summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Lozano <ivanlozano@google.com>2023-06-21 14:25:47 +0000
committerKrzysztof KosiƄski <krzysio@google.com>2023-10-18 19:43:01 +0000
commit86747a9b7ab4a2c0d7f62d66545c8bc7ce24f89a (patch)
tree7054d5b683ac2ae92ca5ccdd48470d32c24f516a
parent9373479334615d76ed1749510322acd3cefe046b (diff)
downloadgrpcio-sys-86747a9b7ab4a2c0d7f62d66545c8bc7ce24f89a.tar.gz
Upgrade grpcio-sys to v0.12.1+1.46.5-patched
Based on aosp/2633389 Bug: 266055490 Test: mm, presubmit Change-Id: I006dce16e643dac75c6b190866746f8186ba5996
-rw-r--r--Android.bp7
-rw-r--r--Cargo.toml88
-rw-r--r--Cargo.toml.orig23
-rw-r--r--METADATA10
-rw-r--r--bindings/aarch64-unknown-linux-gnu-bindings.rs4059
-rw-r--r--bindings/bindings.rs4209
-rw-r--r--bindings/x86_64-unknown-linux-gnu-bindings.rs4059
-rw-r--r--build.rs220
-rw-r--r--cargo2android-extra-module.bp62
-rw-r--r--cargo2android.json66
-rw-r--r--cargo2android_module.bp4
-rw-r--r--grpc/.bazelci/presubmit.yml4
-rw-r--r--grpc/.bazelignore14
-rw-r--r--grpc/.clang-format39
-rw-r--r--grpc/.clang-tidy8
-rw-r--r--grpc/.gitattributes33
-rw-r--r--grpc/.github/CODEOWNERS4
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_core.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_cpp.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_csharp.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_objc.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_php.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_python.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/bug_report_ruby.md41
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/cleanup_request.md2
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/feature_request.md2
-rw-r--r--grpc/.github/ISSUE_TEMPLATE/question.md2
-rwxr-xr-xgrpc/.github/change_repo_manager.sh2
-rw-r--r--grpc/.github/labeler.yml15
-rw-r--r--grpc/.github/pull_request_template.md2
-rw-r--r--grpc/.github/workflows/pr-auto-fix.yaml83
-rw-r--r--grpc/.github/workflows/pr-auto-tag.yaml12
-rw-r--r--grpc/.gitignore34
-rw-r--r--grpc/.pylintrc2
-rw-r--r--grpc/.pylintrc-examples2
-rw-r--r--grpc/.pylintrc-tests2
-rw-r--r--grpc/BUILD4378
-rw-r--r--grpc/BUILD.gn1626
-rw-r--r--grpc/BUILDING.md6
-rw-r--r--grpc/CMakeLists.txt6925
-rw-r--r--grpc/CONCEPTS.md7
-rw-r--r--grpc/LICENSE40
-rw-r--r--grpc/MAINTAINERS.md2
-rw-r--r--grpc/PYTHON-MANIFEST.in1
-rw-r--r--grpc/Package.swift39
-rw-r--r--grpc/README.md127
-rwxr-xr-xgrpc/Rakefile133
-rw-r--r--grpc/WORKSPACE85
-rw-r--r--grpc/_metadata.py17
-rw-r--r--grpc/bazel/BUILD11
-rw-r--r--grpc/bazel/_gevent_test_main.py99
-rw-r--r--grpc/bazel/cc_grpc_library.bzl13
-rw-r--r--grpc/bazel/copts.bzl14
-rw-r--r--grpc/bazel/custom_exec_properties.bzl4
-rw-r--r--grpc/bazel/cython_library.bzl13
-rw-r--r--grpc/bazel/generate_cc.bzl32
-rw-r--r--grpc/bazel/generate_objc.bzl39
-rw-r--r--grpc/bazel/gevent_test.bzl85
-rw-r--r--grpc/bazel/grpc_build_system.bzl377
-rw-r--r--grpc/bazel/grpc_deps.bzl214
-rw-r--r--grpc/bazel/grpc_extra_deps.bzl34
-rw-r--r--grpc/bazel/grpc_python_deps.bzl32
-rw-r--r--grpc/bazel/grpc_util.bzl26
-rw-r--r--grpc/bazel/internal_python_rules.bzl43
-rw-r--r--grpc/bazel/objc_grpc_library.bzl18
-rw-r--r--grpc/bazel/protobuf.bzl118
-rw-r--r--grpc/bazel/python_rules.bzl276
-rw-r--r--grpc/bazel/supported_versions.txt3
-rw-r--r--grpc/bazel/test/python_test_repo/BUILD116
-rw-r--r--grpc/bazel/test/python_test_repo/WORKSPACE15
-rw-r--r--grpc/bazel/test/python_test_repo/dummy_plugin.py37
-rw-r--r--grpc/bazel/test/python_test_repo/helloworld.proto43
-rw-r--r--grpc/bazel/test/python_test_repo/helloworld.py76
-rw-r--r--grpc/bazel/test/python_test_repo/helloworld_moved.py76
-rw-r--r--grpc/bazel/test/python_test_repo/namespaced/upper/example/BUILD165
-rw-r--r--grpc/bazel/test/python_test_repo/namespaced/upper/example/import_no_strip_test.py35
-rw-r--r--grpc/bazel/test/python_test_repo/namespaced/upper/example/import_strip_test.py35
-rw-r--r--grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_no_strip_test.py35
-rw-r--r--grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_strip_test.py35
-rwxr-xr-xgrpc/bazel/test/python_test_repo/tools/bazel80
-rwxr-xr-xgrpc/bazel/update_mirror.sh4
-rw-r--r--grpc/build_autogenerated.yaml4105
-rw-r--r--grpc/build_config.rb2
-rw-r--r--grpc/build_handwritten.yaml41
-rw-r--r--grpc/cmake/abseil-cpp.cmake15
-rw-r--r--grpc/cmake/ccache.cmake38
-rw-r--r--grpc/config.m4337
-rw-r--r--grpc/config.w32375
-rw-r--r--grpc/gRPC-C++.podspec645
-rw-r--r--grpc/gRPC-Core.podspec891
-rw-r--r--grpc/gRPC-ProtoRPC.podspec2
-rw-r--r--grpc/gRPC-RxLibrary.podspec2
-rw-r--r--grpc/gRPC.podspec2
-rw-r--r--grpc/grpc.bzl38
-rw-r--r--grpc/grpc.def35
-rw-r--r--grpc/grpc.gemspec781
-rw-r--r--grpc/grpc.gyp582
-rw-r--r--grpc/include/grpc/byte_buffer.h2
-rw-r--r--grpc/include/grpc/byte_buffer_reader.h2
-rw-r--r--grpc/include/grpc/event_engine/channel_args.h28
-rw-r--r--grpc/include/grpc/event_engine/endpoint_config.h43
-rw-r--r--grpc/include/grpc/event_engine/event_engine.h291
-rw-r--r--grpc/include/grpc/event_engine/internal/memory_allocator_impl.h68
-rw-r--r--grpc/include/grpc/event_engine/memory_allocator.h226
-rw-r--r--grpc/include/grpc/event_engine/memory_request.h57
-rw-r--r--grpc/include/grpc/event_engine/port.h6
-rw-r--r--grpc/include/grpc/event_engine/slice_allocator.h81
-rw-r--r--grpc/include/grpc/fork.h2
-rw-r--r--grpc/include/grpc/grpc.h83
-rw-r--r--grpc/include/grpc/grpc_posix.h40
-rw-r--r--grpc/include/grpc/grpc_security.h549
-rw-r--r--grpc/include/grpc/grpc_security_constants.h17
-rw-r--r--grpc/include/grpc/impl/codegen/atm.h8
-rw-r--r--grpc/include/grpc/impl/codegen/atm_gcc_atomic.h2
-rw-r--r--grpc/include/grpc/impl/codegen/atm_gcc_sync.h2
-rw-r--r--grpc/include/grpc/impl/codegen/atm_windows.h2
-rw-r--r--grpc/include/grpc/impl/codegen/byte_buffer.h2
-rw-r--r--grpc/include/grpc/impl/codegen/byte_buffer_reader.h2
-rw-r--r--grpc/include/grpc/impl/codegen/compression_types.h4
-rw-r--r--grpc/include/grpc/impl/codegen/connectivity_state.h2
-rw-r--r--grpc/include/grpc/impl/codegen/fork.h2
-rw-r--r--grpc/include/grpc/impl/codegen/gpr_slice.h2
-rw-r--r--grpc/include/grpc/impl/codegen/gpr_types.h2
-rw-r--r--grpc/include/grpc/impl/codegen/grpc_types.h106
-rw-r--r--grpc/include/grpc/impl/codegen/log.h2
-rw-r--r--grpc/include/grpc/impl/codegen/port_platform.h100
-rw-r--r--grpc/include/grpc/impl/codegen/propagation_bits.h2
-rw-r--r--grpc/include/grpc/impl/codegen/slice.h7
-rw-r--r--grpc/include/grpc/impl/codegen/status.h2
-rw-r--r--grpc/include/grpc/impl/codegen/sync.h13
-rw-r--r--grpc/include/grpc/impl/codegen/sync_abseil.h2
-rw-r--r--grpc/include/grpc/impl/codegen/sync_custom.h2
-rw-r--r--grpc/include/grpc/impl/codegen/sync_generic.h3
-rw-r--r--grpc/include/grpc/impl/codegen/sync_posix.h6
-rw-r--r--grpc/include/grpc/impl/codegen/sync_windows.h2
-rw-r--r--grpc/include/grpc/slice.h13
-rw-r--r--grpc/include/grpc/status.h2
-rw-r--r--grpc/include/grpc/support/atm.h2
-rw-r--r--grpc/include/grpc/support/atm_gcc_atomic.h2
-rw-r--r--grpc/include/grpc/support/atm_gcc_sync.h2
-rw-r--r--grpc/include/grpc/support/atm_windows.h2
-rw-r--r--grpc/include/grpc/support/log.h2
-rw-r--r--grpc/include/grpc/support/port_platform.h2
-rw-r--r--grpc/include/grpc/support/sync.h2
-rw-r--r--grpc/include/grpc/support/sync_abseil.h2
-rw-r--r--grpc/include/grpc/support/sync_custom.h2
-rw-r--r--grpc/include/grpc/support/sync_generic.h2
-rw-r--r--grpc/include/grpc/support/sync_posix.h2
-rw-r--r--grpc/include/grpc/support/sync_windows.h2
-rw-r--r--grpc/include/grpc/support/time.h4
-rw-r--r--grpc/include/grpcpp/alarm.h44
-rw-r--r--grpc/include/grpcpp/channel.h40
-rw-r--r--grpc/include/grpcpp/client_context.h2
-rw-r--r--grpc/include/grpcpp/completion_queue.h2
-rw-r--r--grpc/include/grpcpp/create_channel_binder.h95
-rw-r--r--grpc/include/grpcpp/create_channel_posix.h3
-rw-r--r--grpc/include/grpcpp/ext/orca_service.h83
-rw-r--r--grpc/include/grpcpp/ext/proto_server_reflection_plugin.h2
-rw-r--r--grpc/include/grpcpp/ext/server_load_reporting.h4
-rw-r--r--grpc/include/grpcpp/generic/async_generic_service.h2
-rw-r--r--grpc/include/grpcpp/generic/generic_stub.h72
-rw-r--r--grpc/include/grpcpp/grpcpp.h1
-rw-r--r--grpc/include/grpcpp/impl/call.h2
-rw-r--r--grpc/include/grpcpp/impl/client_unary_call.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/async_generic_service.h17
-rw-r--r--grpc/include/grpcpp/impl/codegen/async_stream.h223
-rw-r--r--grpc/include/grpcpp/impl/codegen/async_unary_call.h89
-rw-r--r--grpc/include/grpcpp/impl/codegen/byte_buffer.h20
-rw-r--r--grpc/include/grpcpp/impl/codegen/call.h12
-rw-r--r--grpc/include/grpcpp/impl/codegen/call_hook.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/call_op_set.h25
-rw-r--r--grpc/include/grpcpp/impl/codegen/call_op_set_interface.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/callback_common.h14
-rw-r--r--grpc/include/grpcpp/impl/codegen/channel_interface.h49
-rw-r--r--grpc/include/grpcpp/impl/codegen/client_callback.h203
-rw-r--r--grpc/include/grpcpp/impl/codegen/client_context.h84
-rw-r--r--grpc/include/grpcpp/impl/codegen/client_interceptor.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/client_unary_call.h6
-rw-r--r--grpc/include/grpcpp/impl/codegen/completion_queue.h99
-rw-r--r--grpc/include/grpcpp/impl/codegen/completion_queue_tag.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/config.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/config_protobuf.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/core_codegen.h3
-rw-r--r--grpc/include/grpcpp/impl/codegen/core_codegen_interface.h3
-rw-r--r--grpc/include/grpcpp/impl/codegen/create_auth_context.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/delegating_channel.h19
-rw-r--r--grpc/include/grpcpp/impl/codegen/grpc_library.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/intercepted_channel.h11
-rw-r--r--grpc/include/grpcpp/impl/codegen/interceptor.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/interceptor_common.h5
-rw-r--r--grpc/include/grpcpp/impl/codegen/message_allocator.h24
-rw-r--r--grpc/include/grpcpp/impl/codegen/metadata_map.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/method_handler.h159
-rw-r--r--grpc/include/grpcpp/impl/codegen/method_handler_impl.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h4
-rw-r--r--grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h11
-rw-r--r--grpc/include/grpcpp/impl/codegen/proto_utils.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/rpc_method.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/rpc_service_method.h6
-rw-r--r--grpc/include/grpcpp/impl/codegen/security/auth_context.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/serialization_traits.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/server_callback.h78
-rw-r--r--grpc/include/grpcpp/impl/codegen/server_callback_handlers.h269
-rw-r--r--grpc/include/grpcpp/impl/codegen/server_context.h220
-rw-r--r--grpc/include/grpcpp/impl/codegen/server_interceptor.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/server_interface.h99
-rw-r--r--grpc/include/grpcpp/impl/codegen/service_type.h73
-rw-r--r--grpc/include/grpcpp/impl/codegen/slice.h16
-rw-r--r--grpc/include/grpcpp/impl/codegen/status.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/status_code_enum.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/string_ref.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/stub_options.h2
-rw-r--r--grpc/include/grpcpp/impl/codegen/sync.h12
-rw-r--r--grpc/include/grpcpp/impl/codegen/sync_stream.h193
-rw-r--r--grpc/include/grpcpp/impl/codegen/time.h2
-rw-r--r--grpc/include/grpcpp/impl/grpc_library.h2
-rw-r--r--grpc/include/grpcpp/impl/rpc_method.h2
-rw-r--r--grpc/include/grpcpp/impl/rpc_service_method.h2
-rw-r--r--grpc/include/grpcpp/impl/serialization_traits.h2
-rw-r--r--grpc/include/grpcpp/impl/service_type.h2
-rw-r--r--grpc/include/grpcpp/resource_quota.h2
-rw-r--r--grpc/include/grpcpp/security/alts_context.h6
-rw-r--r--grpc/include/grpcpp/security/alts_util.h4
-rw-r--r--grpc/include/grpcpp/security/auth_context.h2
-rw-r--r--grpc/include/grpcpp/security/authorization_policy_provider.h88
-rw-r--r--grpc/include/grpcpp/security/binder_credentials.h43
-rw-r--r--grpc/include/grpcpp/security/binder_security_policy.h82
-rw-r--r--grpc/include/grpcpp/security/credentials.h10
-rw-r--r--grpc/include/grpcpp/security/server_credentials.h11
-rw-r--r--grpc/include/grpcpp/security/tls_certificate_provider.h11
-rw-r--r--grpc/include/grpcpp/security/tls_certificate_verifier.h225
-rw-r--r--grpc/include/grpcpp/security/tls_credentials_options.h164
-rw-r--r--grpc/include/grpcpp/server.h50
-rw-r--r--grpc/include/grpcpp/server_builder.h51
-rw-r--r--grpc/include/grpcpp/server_context.h2
-rw-r--r--grpc/include/grpcpp/server_posix.h3
-rw-r--r--grpc/include/grpcpp/support/async_stream.h2
-rw-r--r--grpc/include/grpcpp/support/async_unary_call.h2
-rw-r--r--grpc/include/grpcpp/support/byte_buffer.h2
-rw-r--r--grpc/include/grpcpp/support/channel_arguments.h8
-rw-r--r--grpc/include/grpcpp/support/client_callback.h2
-rw-r--r--grpc/include/grpcpp/support/client_interceptor.h2
-rw-r--r--grpc/include/grpcpp/support/config.h2
-rw-r--r--grpc/include/grpcpp/support/interceptor.h2
-rw-r--r--grpc/include/grpcpp/support/message_allocator.h2
-rw-r--r--grpc/include/grpcpp/support/method_handler.h2
-rw-r--r--grpc/include/grpcpp/support/proto_buffer_reader.h2
-rw-r--r--grpc/include/grpcpp/support/proto_buffer_writer.h2
-rw-r--r--grpc/include/grpcpp/support/server_callback.h2
-rw-r--r--grpc/include/grpcpp/support/server_interceptor.h2
-rw-r--r--grpc/include/grpcpp/support/slice.h2
-rw-r--r--grpc/include/grpcpp/support/status.h2
-rw-r--r--grpc/include/grpcpp/support/status_code_enum.h2
-rw-r--r--grpc/include/grpcpp/support/string_ref.h2
-rw-r--r--grpc/include/grpcpp/support/stub_options.h2
-rw-r--r--grpc/include/grpcpp/support/sync_stream.h2
-rw-r--r--grpc/include/grpcpp/support/time.h2
-rw-r--r--grpc/include/grpcpp/test/client_context_test_peer.h62
-rw-r--r--grpc/include/grpcpp/test/default_reactor_test_peer.h15
-rw-r--r--grpc/include/grpcpp/test/mock_stream.h57
-rw-r--r--grpc/include/grpcpp/xds_server_builder.h55
-rw-r--r--grpc/package.xml620
-rw-r--r--grpc/requirements.bazel.txt7
-rw-r--r--grpc/setup.py54
-rw-r--r--grpc/spm-core-include/grpc/byte_buffer.h2
-rw-r--r--grpc/spm-core-include/grpc/byte_buffer_reader.h2
-rw-r--r--grpc/spm-core-include/grpc/event_engine/channel_args.h28
-rw-r--r--grpc/spm-core-include/grpc/event_engine/endpoint_config.h43
-rw-r--r--grpc/spm-core-include/grpc/event_engine/event_engine.h291
-rw-r--r--grpc/spm-core-include/grpc/event_engine/internal/memory_allocator_impl.h68
-rw-r--r--grpc/spm-core-include/grpc/event_engine/memory_allocator.h226
-rw-r--r--grpc/spm-core-include/grpc/event_engine/memory_request.h57
-rw-r--r--grpc/spm-core-include/grpc/event_engine/port.h6
-rw-r--r--grpc/spm-core-include/grpc/event_engine/slice_allocator.h81
-rw-r--r--grpc/spm-core-include/grpc/fork.h2
-rw-r--r--grpc/spm-core-include/grpc/grpc.h83
-rw-r--r--grpc/spm-core-include/grpc/grpc_posix.h40
-rw-r--r--grpc/spm-core-include/grpc/grpc_security.h549
-rw-r--r--grpc/spm-core-include/grpc/grpc_security_constants.h17
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/atm.h8
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/atm_gcc_atomic.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/atm_gcc_sync.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/atm_windows.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/byte_buffer.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/byte_buffer_reader.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/compression_types.h4
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/connectivity_state.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/fork.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/gpr_slice.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/gpr_types.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/grpc_types.h106
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/log.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/port_platform.h100
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/propagation_bits.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/slice.h7
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/status.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync.h13
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync_abseil.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync_custom.h2
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync_generic.h3
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync_posix.h6
-rw-r--r--grpc/spm-core-include/grpc/impl/codegen/sync_windows.h2
-rw-r--r--grpc/spm-core-include/grpc/slice.h13
-rw-r--r--grpc/spm-core-include/grpc/status.h2
-rw-r--r--grpc/spm-core-include/grpc/support/atm.h2
-rw-r--r--grpc/spm-core-include/grpc/support/atm_gcc_atomic.h2
-rw-r--r--grpc/spm-core-include/grpc/support/atm_gcc_sync.h2
-rw-r--r--grpc/spm-core-include/grpc/support/atm_windows.h2
-rw-r--r--grpc/spm-core-include/grpc/support/log.h2
-rw-r--r--grpc/spm-core-include/grpc/support/port_platform.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync_abseil.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync_custom.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync_generic.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync_posix.h2
-rw-r--r--grpc/spm-core-include/grpc/support/sync_windows.h2
-rw-r--r--grpc/spm-core-include/grpc/support/time.h4
-rw-r--r--grpc/spm-cpp-include/grpcpp/alarm.h44
-rw-r--r--grpc/spm-cpp-include/grpcpp/channel.h40
-rw-r--r--grpc/spm-cpp-include/grpcpp/client_context.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/completion_queue.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/create_channel_binder.h95
-rw-r--r--grpc/spm-cpp-include/grpcpp/create_channel_posix.h3
-rw-r--r--grpc/spm-cpp-include/grpcpp/ext/orca_service.h83
-rw-r--r--grpc/spm-cpp-include/grpcpp/ext/proto_server_reflection_plugin.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/ext/server_load_reporting.h4
-rw-r--r--grpc/spm-cpp-include/grpcpp/generic/async_generic_service.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/generic/generic_stub.h72
-rw-r--r--grpc/spm-cpp-include/grpcpp/grpcpp.h1
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/call.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/client_unary_call.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/async_generic_service.h17
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/async_stream.h223
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/async_unary_call.h89
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/byte_buffer.h20
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/call.h12
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/call_hook.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set.h25
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set_interface.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/callback_common.h14
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/channel_interface.h49
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/client_callback.h203
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/client_context.h84
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/client_interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/client_unary_call.h6
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue.h99
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue_tag.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/config.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/config_protobuf.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen.h3
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen_interface.h3
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/create_auth_context.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/delegating_channel.h19
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/grpc_library.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/intercepted_channel.h11
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor_common.h5
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/message_allocator.h24
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/metadata_map.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler.h159
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler_impl.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_reader.h4
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_writer.h11
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/proto_utils.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_method.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_service_method.h6
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/security/auth_context.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/serialization_traits.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback.h78
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback_handlers.h269
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/server_context.h220
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/server_interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/server_interface.h99
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/service_type.h73
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/slice.h16
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/status.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/status_code_enum.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/string_ref.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/stub_options.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/sync.h12
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/sync_stream.h193
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/codegen/time.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/grpc_library.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/rpc_method.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/rpc_service_method.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/serialization_traits.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/impl/service_type.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/resource_quota.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/alts_context.h6
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/alts_util.h4
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/auth_context.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/authorization_policy_provider.h88
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/binder_credentials.h43
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/binder_security_policy.h82
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/credentials.h10
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/server_credentials.h11
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/tls_certificate_provider.h11
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/tls_certificate_verifier.h225
-rw-r--r--grpc/spm-cpp-include/grpcpp/security/tls_credentials_options.h164
-rw-r--r--grpc/spm-cpp-include/grpcpp/server.h50
-rw-r--r--grpc/spm-cpp-include/grpcpp/server_builder.h51
-rw-r--r--grpc/spm-cpp-include/grpcpp/server_context.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/server_posix.h3
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/async_stream.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/async_unary_call.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/byte_buffer.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/channel_arguments.h8
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/client_callback.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/client_interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/config.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/message_allocator.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/method_handler.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/proto_buffer_reader.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/proto_buffer_writer.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/server_callback.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/server_interceptor.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/slice.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/status.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/status_code_enum.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/string_ref.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/stub_options.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/sync_stream.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/support/time.h2
-rw-r--r--grpc/spm-cpp-include/grpcpp/test/client_context_test_peer.h62
-rw-r--r--grpc/spm-cpp-include/grpcpp/test/default_reactor_test_peer.h15
-rw-r--r--grpc/spm-cpp-include/grpcpp/test/mock_stream.h57
-rw-r--r--grpc/spm-cpp-include/grpcpp/xds_server_builder.h55
-rw-r--r--grpc/src/abseil-cpp/preprocessed_builds.yaml169
-rw-r--r--grpc/src/boringssl/boringssl_prefix_symbols.h120
-rwxr-xr-xgrpc/src/c-ares/gen_build_yaml.py157
-rw-r--r--grpc/src/compiler/BUILD16
-rw-r--r--grpc/src/compiler/config.h4
-rw-r--r--grpc/src/compiler/cpp_generator.cc380
-rw-r--r--grpc/src/compiler/cpp_plugin.h1
-rw-r--r--grpc/src/compiler/csharp_generator.cc36
-rw-r--r--grpc/src/compiler/csharp_generator_helpers.h7
-rw-r--r--grpc/src/compiler/csharp_plugin.cc8
-rw-r--r--grpc/src/compiler/node_generator.cc3
-rw-r--r--grpc/src/compiler/objective_c_generator.cc7
-rw-r--r--grpc/src/compiler/objective_c_generator_helpers.h31
-rw-r--r--grpc/src/compiler/objective_c_plugin.cc14
-rw-r--r--grpc/src/compiler/php_generator.cc1
-rw-r--r--grpc/src/compiler/protobuf_plugin.h4
-rw-r--r--grpc/src/compiler/python_generator.cc3
-rw-r--r--grpc/src/compiler/python_generator.h2
-rw-r--r--grpc/src/compiler/python_generator_helpers.h4
-rw-r--r--grpc/src/compiler/ruby_generator.cc5
-rw-r--r--grpc/src/compiler/ruby_generator_map-inl.h4
-rw-r--r--grpc/src/compiler/ruby_generator_string-inl.h4
-rw-r--r--grpc/src/compiler/schema_interface.h4
-rw-r--r--grpc/src/core/ext/filters/census/grpc_context.cc1
-rw-r--r--grpc/src/core/ext/filters/channel_idle/channel_idle_filter.cc309
-rw-r--r--grpc/src/core/ext/filters/channel_idle/channel_idle_filter.h122
-rw-r--r--grpc/src/core/ext/filters/channel_idle/idle_filter_state.cc96
-rw-r--r--grpc/src/core/ext/filters/channel_idle/idle_filter_state.h66
-rw-r--r--grpc/src/core/ext/filters/client_channel/backend_metric.cc51
-rw-r--r--grpc/src/core/ext/filters/client_channel/backend_metric.h7
-rw-r--r--grpc/src/core/ext/filters/client_channel/backup_poller.cc23
-rw-r--r--grpc/src/core/ext/filters/client_channel/backup_poller.h1
-rw-r--r--grpc/src/core/ext/filters/client_channel/channel_connectivity.cc169
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel.cc1575
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel.h237
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc11
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel_channelz.h2
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel_factory.cc3
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel_factory.h36
-rw-r--r--grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc42
-rw-r--r--grpc/src/core/ext/filters/client_channel/config_selector.cc3
-rw-r--r--grpc/src/core/ext/filters/client_channel/config_selector.h30
-rw-r--r--grpc/src/core/ext/filters/client_channel/connector.h38
-rw-r--r--grpc/src/core/ext/filters/client_channel/dynamic_filters.cc13
-rw-r--r--grpc/src/core/ext/filters/client_channel/dynamic_filters.h4
-rw-r--r--grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc24
-rw-r--r--grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h19
-rw-r--r--grpc/src/core/ext/filters/client_channel/health/health_check_client.cc708
-rw-r--r--grpc/src/core/ext/filters/client_channel/health/health_check_client.h183
-rw-r--r--grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc64
-rw-r--r--grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h12
-rw-r--r--grpc/src/core/ext/filters/client_channel/http_proxy.cc207
-rw-r--r--grpc/src/core/ext/filters/client_channel/http_proxy.h17
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy.cc45
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy.h307
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc7
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h11
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc8
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc24
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc412
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h9
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc2
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h2
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc36
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h44
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc84
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc7
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h8
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc35
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h8
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc143
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc525
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc800
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h10
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc2542
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc151
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h31
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc204
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc326
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h2
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h2
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc271
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc78
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc944
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy_factory.h1
-rw-r--r--grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc11
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver.cc87
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver.h136
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/binder/README.md9
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc133
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc622
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h35
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc31
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc179
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc41
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc92
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc428
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h63
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc28
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc38
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc2
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc350
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc43
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h3
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc163
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.cc201
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.h106
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc79
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc1078
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver_factory.h73
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver_registry.cc197
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver_registry.h89
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc26
-rw-r--r--grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h20
-rw-r--r--grpc/src/core/ext/filters/client_channel/retry_filter.cc1809
-rw-r--r--grpc/src/core/ext/filters/client_channel/retry_service_config.cc107
-rw-r--r--grpc/src/core/ext/filters/client_channel/retry_service_config.h36
-rw-r--r--grpc/src/core/ext/filters/client_channel/retry_throttle.cc73
-rw-r--r--grpc/src/core/ext/filters/client_channel/retry_throttle.h16
-rw-r--r--grpc/src/core/ext/filters/client_channel/server_address.cc170
-rw-r--r--grpc/src/core/ext/filters/client_channel/server_address.h144
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config.cc227
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config.h127
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config_call_data.h86
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc88
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config_parser.cc89
-rw-r--r--grpc/src/core/ext/filters/client_channel/service_config_parser.h95
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel.cc329
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel.h92
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc29
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h13
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel_stream_client.cc544
-rw-r--r--grpc/src/core/ext/filters/client_channel/subchannel_stream_client.h214
-rw-r--r--grpc/src/core/ext/filters/client_idle/client_idle_filter.cc441
-rw-r--r--grpc/src/core/ext/filters/deadline/deadline_filter.cc64
-rw-r--r--grpc/src/core/ext/filters/deadline/deadline_filter.h5
-rw-r--r--grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc559
-rw-r--r--grpc/src/core/ext/filters/fault_injection/fault_injection_filter.h25
-rw-r--r--grpc/src/core/ext/filters/fault_injection/service_config_parser.cc44
-rw-r--r--grpc/src/core/ext/filters/fault_injection/service_config_parser.h14
-rw-r--r--grpc/src/core/ext/filters/http/client/http_client_filter.cc628
-rw-r--r--grpc/src/core/ext/filters/http/client/http_client_filter.h25
-rw-r--r--grpc/src/core/ext/filters/http/client_authority_filter.cc142
-rw-r--r--grpc/src/core/ext/filters/http/client_authority_filter.h29
-rw-r--r--grpc/src/core/ext/filters/http/http_filters_plugin.cc128
-rw-r--r--grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc209
-rw-r--r--grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc57
-rw-r--r--grpc/src/core/ext/filters/http/server/http_server_filter.cc338
-rw-r--r--grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc369
-rw-r--r--grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.h98
-rw-r--r--grpc/src/core/ext/filters/max_age/max_age_filter.cc562
-rw-r--r--grpc/src/core/ext/filters/max_age/max_age_filter.h26
-rw-r--r--grpc/src/core/ext/filters/message_size/message_size_filter.cc107
-rw-r--r--grpc/src/core/ext/filters/message_size/message_size_filter.h13
-rw-r--r--grpc/src/core/ext/filters/rbac/rbac_filter.cc162
-rw-r--r--grpc/src/core/ext/filters/rbac/rbac_filter.h76
-rw-r--r--grpc/src/core/ext/filters/rbac/rbac_service_config_parser.cc606
-rw-r--r--grpc/src/core/ext/filters/rbac/rbac_service_config_parser.h75
-rw-r--r--grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc61
-rw-r--r--grpc/src/core/ext/filters/server_config_selector/server_config_selector.h71
-rw-r--r--grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc143
-rw-r--r--grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h32
-rw-r--r--grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc211
-rw-r--r--grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h27
-rw-r--r--grpc/src/core/ext/filters/workarounds/workaround_utils.cc53
-rw-r--r--grpc/src/core/ext/filters/workarounds/workaround_utils.h39
-rw-r--r--grpc/src/core/ext/transport/binder/README.md10
-rw-r--r--grpc/src/core/ext/transport/binder/client/binder_connector.cc133
-rw-r--r--grpc/src/core/ext/transport/binder/client/binder_connector.h44
-rw-r--r--grpc/src/core/ext/transport/binder/client/channel_create.cc225
-rw-r--r--grpc/src/core/ext/transport/binder/client/channel_create_impl.cc115
-rw-r--r--grpc/src/core/ext/transport/binder/client/channel_create_impl.h42
-rw-r--r--grpc/src/core/ext/transport/binder/client/connection_id_generator.cc70
-rw-r--r--grpc/src/core/ext/transport/binder/client/connection_id_generator.h52
-rw-r--r--grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc113
-rw-r--r--grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h65
-rw-r--r--grpc/src/core/ext/transport/binder/client/jni_utils.cc113
-rw-r--r--grpc/src/core/ext/transport/binder/client/jni_utils.h54
-rw-r--r--grpc/src/core/ext/transport/binder/client/security_policy_setting.cc45
-rw-r--r--grpc/src/core/ext/transport/binder/client/security_policy_setting.h51
-rw-r--r--grpc/src/core/ext/transport/binder/java/WORKSPACE0
-rw-r--r--grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD28
-rw-r--r--grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcBinderConnection.java85
-rw-r--r--grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java38
-rw-r--r--grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/NativeConnectionHelper.java58
-rw-r--r--grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc105
-rw-r--r--grpc/src/core/ext/transport/binder/security_policy/security_policy.h40
-rw-r--r--grpc/src/core/ext/transport/binder/server/binder_server.cc251
-rw-r--r--grpc/src/core/ext/transport/binder/server/binder_server.h67
-rw-r--r--grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc76
-rw-r--r--grpc/src/core/ext/transport/binder/transport/binder_stream.h119
-rw-r--r--grpc/src/core/ext/transport/binder/transport/binder_transport.cc792
-rw-r--r--grpc/src/core/ext/transport/binder/transport/binder_transport.h95
-rw-r--r--grpc/src/core/ext/transport/binder/utils/binder_auto_utils.h76
-rw-r--r--grpc/src/core/ext/transport/binder/utils/ndk_binder.cc220
-rw-r--r--grpc/src/core/ext/transport/binder/utils/ndk_binder.h107
-rw-r--r--grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h71
-rw-r--r--grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc255
-rw-r--r--grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h112
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/binder.h105
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/binder_android.cc310
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/binder_android.h122
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc29
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/binder_constants.h43
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/transaction.cc33
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/transaction.h102
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/wire_reader.h38
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc409
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h137
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc184
-rw-r--r--grpc/src/core/ext/transport/binder/wire_format/wire_writer.h84
-rw-r--r--grpc/src/core/ext/transport/chttp2/alpn/alpn.cc3
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/authority.cc42
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/authority.h36
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc257
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/insecure/README.md1
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc125
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc90
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/secure/README.md1
-rw-r--r--grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc213
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc395
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/insecure/README.md1
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc54
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc76
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/secure/README.md1
-rw-r--r--grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc129
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc6
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h3
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc37
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc739
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h16
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/context_list.cc5
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/context_list.h8
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/flow_control.cc107
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/flow_control.h32
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_data.cc31
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_data.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc26
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc19
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_ping.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc18
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc57
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_settings.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc19
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h1
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h41
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc1265
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h254
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc86
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h71
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc2021
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h174
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc239
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h115
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc243
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/hpack_table.h148
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc66
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h58
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/internal.h73
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/parsing.cc377
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc4
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/varint.cc20
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/varint.h67
-rw-r--r--grpc/src/core/ext/transport/chttp2/transport/writing.cc294
-rw-r--r--grpc/src/core/ext/transport/cronet/BUILD4
-rw-r--r--grpc/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc14
-rw-r--r--grpc/src/core/ext/transport/cronet/transport/cronet_api_phony.cc4
-rw-r--r--grpc/src/core/ext/transport/cronet/transport/cronet_status.cc8
-rw-r--r--grpc/src/core/ext/transport/cronet/transport/cronet_status.h2
-rw-r--r--grpc/src/core/ext/transport/cronet/transport/cronet_transport.cc238
-rw-r--r--grpc/src/core/ext/transport/inproc/inproc_plugin.cc4
-rw-r--r--grpc/src/core/ext/transport/inproc/inproc_transport.cc362
-rw-r--r--grpc/src/core/ext/transport/inproc/inproc_transport.h5
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c117
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h482
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c121
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h553
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c458
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h2067
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h151
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c62
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h160
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c46
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h124
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c43
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h102
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c43
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h97
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c106
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h605
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c48
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h103
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c45
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h53
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c36
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h75
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c261
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h1147
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c437
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h2049
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c79
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h319
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c590
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h2694
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c29
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h74
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c89
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h379
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c299
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h1381
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c129
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h588
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c30
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h78
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c391
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h1787
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c152
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h732
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h70
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c40
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h144
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c58
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h151
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c264
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h1268
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c234
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h1142
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c31
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h96
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c322
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h1535
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c23
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h53
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c60
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h169
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c33
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h117
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c42
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h150
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c48
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h118
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c88
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h323
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c131
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h580
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c125
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h577
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h63
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c173
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h827
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c185
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h914
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c63
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h234
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c38
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h145
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c53
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h136
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c145
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h698
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c153
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h697
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c231
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h910
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c90
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h448
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c1228
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h5848
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c59
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h240
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c222
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h1052
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c44
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h88
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c49
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h103
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c42
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h137
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c52
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h134
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c63
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h250
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c47
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h94
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c69
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h213
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c32
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h42
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c71
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h218
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c54
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h146
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c23
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h66
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c75
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h331
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c88
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h418
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c64
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h183
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c40
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h143
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c501
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h2434
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c11
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h11
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c166
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h842
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c69
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h263
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c211
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h932
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c62
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h160
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c19
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h44
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c165
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h776
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c50
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h183
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h56
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c125
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h580
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c48
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h112
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c76
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h249
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c74
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h214
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c43
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h172
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c31
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h89
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c29
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h83
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h70
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c58
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h206
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c50
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h202
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c40
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h152
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c61
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h253
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c83
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h418
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c91
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h400
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c66
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h201
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c11
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h5
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c42
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h139
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c34
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h112
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c47
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h170
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c26
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h41
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c27
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h67
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c51
-rw-r--r--grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h127
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/annotations.upb.c24
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/annotations.upb.h25
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c281
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h1176
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c286
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h1271
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/http.upb.c73
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/http.upb.h351
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/httpbody.upb.c46
-rw-r--r--grpc/src/core/ext/upb-generated/google/api/httpbody.upb.h111
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c25
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h68
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c657
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h3316
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c25
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h64
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c19
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h44
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c80
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h290
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c25
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h64
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c95
-rw-r--r--grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h445
-rw-r--r--grpc/src/core/ext/upb-generated/google/rpc/status.upb.c31
-rw-r--r--grpc/src/core/ext/upb-generated/google/rpc/status.upb.h90
-rw-r--r--grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c84
-rw-r--r--grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h319
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.c85
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.h276
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c52
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h159
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c244
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h1118
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c41
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h131
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c32
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h105
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c144
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h680
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c70
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h208
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c175
-rw-r--r--grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h764
-rw-r--r--grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.c43
-rw-r--r--grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.h117
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c90
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h270
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c40
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h80
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c23
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h18
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c38
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h84
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c36
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h75
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c58
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h124
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c33
-rw-r--r--grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h77
-rw-r--r--grpc/src/core/ext/upb-generated/validate/validate.upb.c702
-rw-r--r--grpc/src/core/ext/upb-generated/validate/validate.upb.h4108
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c110
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h278
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c55
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h108
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c38
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h46
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c105
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h290
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c53
-rw-r--r--grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h99
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c25
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h57
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c50
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h167
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c40
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h91
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.c46
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.h103
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c35
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h93
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c56
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h214
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c35
-rw-r--r--grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h96
-rw-r--r--grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c73
-rw-r--r--grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h187
-rw-r--r--grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c47
-rw-r--r--grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h109
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c207
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h878
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c52
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h143
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c65
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h218
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c46
-rw-r--r--grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h103
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c84
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h55
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c127
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c77
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h134
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c43
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c53
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c49
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c46
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c46
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c142
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c51
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c34
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h2
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c23
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c167
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h92
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c688
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h109
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c122
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c982
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h150
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c34
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c48
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c206
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h105
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c49
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c36
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c453
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h143
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c255
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h42
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c67
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h13
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c53
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c74
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h86
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c363
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h55
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c467
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h93
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c30
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c55
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c34
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c78
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c49
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c48
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h26
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c181
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h36
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h32
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c34
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c312
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h37
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c317
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c88
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c76
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c69
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c54
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c87
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h55
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c316
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c156
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h19
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c1616
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h319
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c102
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c188
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h85
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c54
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c57
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c38
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c72
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c99
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c52
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c71
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c57
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h30
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c75
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c77
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c48
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h32
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c57
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c59
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c906
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h119
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c30
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h2
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c316
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h42
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c48
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c430
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h43
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c58
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c72
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c34
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c52
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c73
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c72
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c80
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c74
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c217
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h31
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c46
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c56
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c52
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c51
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c36
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c36
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c36
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c93
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c38
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c37
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c42
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c42
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h32
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c53
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h45
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c22
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h2
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c94
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c33
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c32
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c38
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h30
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c29
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c57
-rw-r--r--grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h2
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c45
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h80
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c47
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h86
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c19
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c39
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c15
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c271
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h164
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c15
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c15
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c21
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h26
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c15
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c31
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h56
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c23
-rw-r--r--grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c67
-rw-r--r--grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.c58
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.h55
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.c62
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.c176
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.h90
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.c52
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.c54
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.c120
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.h75
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c99
-rw-r--r--grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h75
-rw-r--r--grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.c54
-rw-r--r--grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c28
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h20
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c57
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c17
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h2
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c23
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c24
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.c62
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.h45
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c44
-rw-r--r--grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c405
-rw-r--r--grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h140
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c63
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h45
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c47
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h30
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c64
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c70
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c46
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c41
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h35
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c50
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c84
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h14
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c54
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h8
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c126
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h80
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c52
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c40
-rw-r--r--grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h35
-rw-r--r--grpc/src/core/ext/xds/certificate_provider_registry.cc6
-rw-r--r--grpc/src/core/ext/xds/certificate_provider_store.cc8
-rw-r--r--grpc/src/core/ext/xds/certificate_provider_store.h13
-rw-r--r--grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc8
-rw-r--r--grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h4
-rw-r--r--grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc6
-rw-r--r--grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h12
-rw-r--r--grpc/src/core/ext/xds/upb_utils.h67
-rw-r--r--grpc/src/core/ext/xds/xds_api.cc3567
-rw-r--r--grpc/src/core/ext/xds/xds_api.h614
-rw-r--r--grpc/src/core/ext/xds/xds_bootstrap.cc409
-rw-r--r--grpc/src/core/ext/xds/xds_bootstrap.h58
-rw-r--r--grpc/src/core/ext/xds/xds_certificate_provider.cc8
-rw-r--r--grpc/src/core/ext/xds/xds_certificate_provider.h12
-rw-r--r--grpc/src/core/ext/xds/xds_channel_stack_modifier.cc109
-rw-r--r--grpc/src/core/ext/xds/xds_channel_stack_modifier.h53
-rw-r--r--grpc/src/core/ext/xds/xds_client.cc1750
-rw-r--r--grpc/src/core/ext/xds/xds_client.h293
-rw-r--r--grpc/src/core/ext/xds/xds_client_stats.cc61
-rw-r--r--grpc/src/core/ext/xds/xds_client_stats.h23
-rw-r--r--grpc/src/core/ext/xds/xds_cluster.cc453
-rw-r--r--grpc/src/core/ext/xds/xds_cluster.h108
-rw-r--r--grpc/src/core/ext/xds/xds_cluster_specifier_plugin.cc142
-rw-r--r--grpc/src/core/ext/xds/xds_cluster_specifier_plugin.h79
-rw-r--r--grpc/src/core/ext/xds/xds_common_types.cc388
-rw-r--r--grpc/src/core/ext/xds/xds_common_types.h95
-rw-r--r--grpc/src/core/ext/xds/xds_endpoint.cc371
-rw-r--r--grpc/src/core/ext/xds/xds_endpoint.h135
-rw-r--r--grpc/src/core/ext/xds/xds_http_fault_filter.cc21
-rw-r--r--grpc/src/core/ext/xds/xds_http_fault_filter.h11
-rw-r--r--grpc/src/core/ext/xds/xds_http_filters.cc22
-rw-r--r--grpc/src/core/ext/xds/xds_http_filters.h11
-rw-r--r--grpc/src/core/ext/xds/xds_http_rbac_filter.cc563
-rw-r--r--grpc/src/core/ext/xds/xds_http_rbac_filter.h54
-rw-r--r--grpc/src/core/ext/xds/xds_listener.cc1039
-rw-r--r--grpc/src/core/ext/xds/xds_listener.h220
-rw-r--r--grpc/src/core/ext/xds/xds_resource_type.cc33
-rw-r--r--grpc/src/core/ext/xds/xds_resource_type.h98
-rw-r--r--grpc/src/core/ext/xds/xds_resource_type_impl.h87
-rw-r--r--grpc/src/core/ext/xds/xds_route_config.cc1122
-rw-r--r--grpc/src/core/ext/xds/xds_route_config.h218
-rw-r--r--grpc/src/core/ext/xds/xds_routing.cc250
-rw-r--r--grpc/src/core/ext/xds/xds_routing.h101
-rw-r--r--grpc/src/core/ext/xds/xds_server_config_fetcher.cc1346
-rw-r--r--grpc/src/core/lib/address_utils/parse_address.cc34
-rw-r--r--grpc/src/core/lib/address_utils/parse_address.h5
-rw-r--r--grpc/src/core/lib/address_utils/sockaddr_utils.cc56
-rw-r--r--grpc/src/core/lib/address_utils/sockaddr_utils.h7
-rw-r--r--grpc/src/core/lib/avl/avl.cc306
-rw-r--r--grpc/src/core/lib/avl/avl.h540
-rw-r--r--grpc/src/core/lib/backoff/backoff.cc47
-rw-r--r--grpc/src/core/lib/backoff/backoff.h22
-rw-r--r--grpc/src/core/lib/channel/call_finalization.h86
-rw-r--r--grpc/src/core/lib/channel/call_tracer.h88
-rw-r--r--grpc/src/core/lib/channel/channel_args.cc189
-rw-r--r--grpc/src/core/lib/channel/channel_args.h215
-rw-r--r--grpc/src/core/lib/channel/channel_args_preconditioning.cc42
-rw-r--r--grpc/src/core/lib/channel/channel_args_preconditioning.h61
-rw-r--r--grpc/src/core/lib/channel/channel_stack.cc21
-rw-r--r--grpc/src/core/lib/channel/channel_stack.h47
-rw-r--r--grpc/src/core/lib/channel/channel_stack_builder.cc307
-rw-r--r--grpc/src/core/lib/channel/channel_stack_builder.h275
-rw-r--r--grpc/src/core/lib/channel/channel_stack_builder_impl.cc102
-rw-r--r--grpc/src/core/lib/channel/channel_stack_builder_impl.h48
-rw-r--r--grpc/src/core/lib/channel/channel_trace.cc18
-rw-r--r--grpc/src/core/lib/channel/channel_trace.h3
-rw-r--r--grpc/src/core/lib/channel/channelz.cc83
-rw-r--r--grpc/src/core/lib/channel/channelz.h61
-rw-r--r--grpc/src/core/lib/channel/channelz_registry.cc15
-rw-r--r--grpc/src/core/lib/channel/channelz_registry.h2
-rw-r--r--grpc/src/core/lib/channel/connected_channel.cc16
-rw-r--r--grpc/src/core/lib/channel/connected_channel.h4
-rw-r--r--grpc/src/core/lib/channel/context.h14
-rw-r--r--grpc/src/core/lib/channel/handshaker.cc5
-rw-r--r--grpc/src/core/lib/channel/handshaker.h5
-rw-r--r--grpc/src/core/lib/channel/handshaker_factory.h12
-rw-r--r--grpc/src/core/lib/channel/handshaker_registry.cc85
-rw-r--r--grpc/src/core/lib/channel/handshaker_registry.h41
-rw-r--r--grpc/src/core/lib/channel/promise_based_filter.cc1002
-rw-r--r--grpc/src/core/lib/channel/promise_based_filter.h437
-rw-r--r--grpc/src/core/lib/channel/status_util.h8
-rw-r--r--grpc/src/core/lib/compression/algorithm_metadata.h61
-rw-r--r--grpc/src/core/lib/compression/compression.cc136
-rw-r--r--grpc/src/core/lib/compression/compression_args.cc135
-rw-r--r--grpc/src/core/lib/compression/compression_args.h56
-rw-r--r--grpc/src/core/lib/compression/compression_internal.cc361
-rw-r--r--grpc/src/core/lib/compression/compression_internal.h138
-rw-r--r--grpc/src/core/lib/compression/message_compress.cc72
-rw-r--r--grpc/src/core/lib/compression/message_compress.h24
-rw-r--r--grpc/src/core/lib/compression/stream_compression.cc80
-rw-r--r--grpc/src/core/lib/compression/stream_compression.h116
-rw-r--r--grpc/src/core/lib/compression/stream_compression_gzip.cc230
-rw-r--r--grpc/src/core/lib/compression/stream_compression_gzip.h28
-rw-r--r--grpc/src/core/lib/compression/stream_compression_identity.cc90
-rw-r--r--grpc/src/core/lib/compression/stream_compression_identity.h29
-rw-r--r--grpc/src/core/lib/config/core_configuration.cc104
-rw-r--r--grpc/src/core/lib/config/core_configuration.h196
-rw-r--r--grpc/src/core/lib/debug/stats.cc2
-rw-r--r--grpc/src/core/lib/debug/stats.h3
-rw-r--r--grpc/src/core/lib/debug/stats_data.cc37
-rw-r--r--grpc/src/core/lib/debug/stats_data.h40
-rw-r--r--grpc/src/core/lib/debug/stats_data.yaml8
-rw-r--r--grpc/src/core/lib/debug/stats_data_bq_schema.sql3
-rw-r--r--grpc/src/core/lib/debug/trace.cc1
-rw-r--r--grpc/src/core/lib/debug/trace.h7
-rw-r--r--grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc46
-rw-r--r--grpc/src/core/lib/event_engine/channel_args_endpoint_config.h42
-rw-r--r--grpc/src/core/lib/event_engine/default_event_engine_factory.cc27
-rw-r--r--grpc/src/core/lib/event_engine/event_engine.cc52
-rw-r--r--grpc/src/core/lib/event_engine/event_engine_factory.h36
-rw-r--r--grpc/src/core/lib/event_engine/memory_allocator.cc66
-rw-r--r--grpc/src/core/lib/event_engine/resolved_address.cc39
-rw-r--r--grpc/src/core/lib/event_engine/slice_allocator.cc59
-rw-r--r--grpc/src/core/lib/event_engine/sockaddr.cc32
-rw-r--r--grpc/src/core/lib/event_engine/sockaddr.h44
-rw-r--r--grpc/src/core/lib/gpr/alloc.cc7
-rw-r--r--grpc/src/core/lib/gpr/arena.h47
-rw-r--r--grpc/src/core/lib/gpr/atm.cc2
-rw-r--r--grpc/src/core/lib/gpr/cpu_posix.cc2
-rw-r--r--grpc/src/core/lib/gpr/env_linux.cc3
-rw-r--r--grpc/src/core/lib/gpr/env_posix.cc5
-rw-r--r--grpc/src/core/lib/gpr/log.cc6
-rw-r--r--grpc/src/core/lib/gpr/log_android.cc5
-rw-r--r--grpc/src/core/lib/gpr/log_linux.cc11
-rw-r--r--grpc/src/core/lib/gpr/log_posix.cc9
-rw-r--r--grpc/src/core/lib/gpr/murmur_hash.cc6
-rw-r--r--grpc/src/core/lib/gpr/string.cc4
-rw-r--r--grpc/src/core/lib/gpr/string.h4
-rw-r--r--grpc/src/core/lib/gpr/sync.cc4
-rw-r--r--grpc/src/core/lib/gpr/sync_abseil.cc13
-rw-r--r--grpc/src/core/lib/gpr/sync_posix.cc7
-rw-r--r--grpc/src/core/lib/gpr/time.cc8
-rw-r--r--grpc/src/core/lib/gpr/time_windows.cc5
-rw-r--r--grpc/src/core/lib/gpr/tls.h166
-rw-r--r--grpc/src/core/lib/gpr/tls_gcc.h52
-rw-r--r--grpc/src/core/lib/gpr/tls_msvc.h54
-rw-r--r--grpc/src/core/lib/gpr/tls_pthread.cc30
-rw-r--r--grpc/src/core/lib/gpr/tls_pthread.h56
-rw-r--r--grpc/src/core/lib/gpr/tls_stdcpp.h48
-rw-r--r--grpc/src/core/lib/gpr/tmpfile_posix.cc3
-rw-r--r--grpc/src/core/lib/gpr/useful.h129
-rw-r--r--grpc/src/core/lib/gpr/wrap_memcpy.cc3
-rw-r--r--grpc/src/core/lib/gprpp/arena.cc103
-rw-r--r--grpc/src/core/lib/gprpp/arena.h121
-rw-r--r--grpc/src/core/lib/gprpp/atomic.h104
-rw-r--r--grpc/src/core/lib/gprpp/atomic_utils.h47
-rw-r--r--grpc/src/core/lib/gprpp/bitset.h207
-rw-r--r--grpc/src/core/lib/gprpp/capture.h76
-rw-r--r--grpc/src/core/lib/gprpp/chunked_vector.h253
-rw-r--r--grpc/src/core/lib/gprpp/construct_destruct.h39
-rw-r--r--grpc/src/core/lib/gprpp/cpp_impl_of.h49
-rw-r--r--grpc/src/core/lib/gprpp/debug_location.h2
-rw-r--r--grpc/src/core/lib/gprpp/dual_ref_counted.h51
-rw-r--r--grpc/src/core/lib/gprpp/fork.cc26
-rw-r--r--grpc/src/core/lib/gprpp/fork.h8
-rw-r--r--grpc/src/core/lib/gprpp/global_config.h3
-rw-r--r--grpc/src/core/lib/gprpp/global_config_env.cc28
-rw-r--r--grpc/src/core/lib/gprpp/global_config_env.h4
-rw-r--r--grpc/src/core/lib/gprpp/global_config_generic.h4
-rw-r--r--grpc/src/core/lib/gprpp/manual_constructor.h20
-rw-r--r--grpc/src/core/lib/gprpp/match.h73
-rw-r--r--grpc/src/core/lib/gprpp/memory.h12
-rw-r--r--grpc/src/core/lib/gprpp/mpscq.cc14
-rw-r--r--grpc/src/core/lib/gprpp/mpscq.h11
-rw-r--r--grpc/src/core/lib/gprpp/orphanable.h14
-rw-r--r--grpc/src/core/lib/gprpp/overload.h59
-rw-r--r--grpc/src/core/lib/gprpp/ref_counted.h40
-rw-r--r--grpc/src/core/lib/gprpp/ref_counted_ptr.h6
-rw-r--r--grpc/src/core/lib/gprpp/single_set_ptr.h87
-rw-r--r--grpc/src/core/lib/gprpp/status_helper.cc107
-rw-r--r--grpc/src/core/lib/gprpp/status_helper.h33
-rw-r--r--grpc/src/core/lib/gprpp/sync.h36
-rw-r--r--grpc/src/core/lib/gprpp/table.h434
-rw-r--r--grpc/src/core/lib/gprpp/thd_posix.cc10
-rw-r--r--grpc/src/core/lib/gprpp/thd_windows.cc15
-rw-r--r--grpc/src/core/lib/gprpp/time.cc198
-rw-r--r--grpc/src/core/lib/gprpp/time.h292
-rw-r--r--grpc/src/core/lib/gprpp/time_util.cc4
-rw-r--r--grpc/src/core/lib/gprpp/time_util.h4
-rw-r--r--grpc/src/core/lib/http/format_request.cc54
-rw-r--r--grpc/src/core/lib/http/format_request.h14
-rw-r--r--grpc/src/core/lib/http/httpcli.cc506
-rw-r--r--grpc/src/core/lib/http/httpcli.h268
-rw-r--r--grpc/src/core/lib/http/httpcli_security_connector.cc148
-rw-r--r--grpc/src/core/lib/http/httpcli_ssl_credentials.h37
-rw-r--r--grpc/src/core/lib/http/parser.cc93
-rw-r--r--grpc/src/core/lib/http/parser.h18
-rw-r--r--grpc/src/core/lib/iomgr/buffer_list.cc21
-rw-r--r--grpc/src/core/lib/iomgr/buffer_list.h39
-rw-r--r--grpc/src/core/lib/iomgr/call_combiner.cc61
-rw-r--r--grpc/src/core/lib/iomgr/cfstream_handle.cc2
-rw-r--r--grpc/src/core/lib/iomgr/closure.h38
-rw-r--r--grpc/src/core/lib/iomgr/combiner.cc60
-rw-r--r--grpc/src/core/lib/iomgr/combiner.h1
-rw-r--r--grpc/src/core/lib/iomgr/dualstack_socket_posix.cc1
-rw-r--r--grpc/src/core/lib/iomgr/endpoint.cc4
-rw-r--r--grpc/src/core/lib/iomgr/endpoint.h5
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_cfstream.cc57
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_cfstream.h8
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_pair.h1
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc32
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_pair_posix.cc20
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_pair_uv.cc40
-rw-r--r--grpc/src/core/lib/iomgr/endpoint_pair_windows.cc11
-rw-r--r--grpc/src/core/lib/iomgr/error.cc191
-rw-r--r--grpc/src/core/lib/iomgr/error.h95
-rw-r--r--grpc/src/core/lib/iomgr/error_cfstream.cc9
-rw-r--r--grpc/src/core/lib/iomgr/error_internal.h1
-rw-r--r--grpc/src/core/lib/iomgr/ev_apple.cc11
-rw-r--r--grpc/src/core/lib/iomgr/ev_apple.h2
-rw-r--r--grpc/src/core/lib/iomgr/ev_epoll1_linux.cc56
-rw-r--r--grpc/src/core/lib/iomgr/ev_epollex_linux.cc1661
-rw-r--r--grpc/src/core/lib/iomgr/ev_epollex_linux.h30
-rw-r--r--grpc/src/core/lib/iomgr/ev_poll_posix.cc101
-rw-r--r--grpc/src/core/lib/iomgr/ev_posix.cc22
-rw-r--r--grpc/src/core/lib/iomgr/ev_posix.h2
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/closure.cc77
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/closure.h42
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/endpoint.cc172
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/endpoint.h52
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/iomgr.cc85
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/pollset.cc87
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/pollset.h25
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/promise.h51
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc47
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h37
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/resolver.cc133
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/resolver.h56
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/tcp.cc296
-rw-r--r--grpc/src/core/lib/iomgr/event_engine/timer.cc62
-rw-r--r--grpc/src/core/lib/iomgr/exec_ctx.cc129
-rw-r--r--grpc/src/core/lib/iomgr/exec_ctx.h87
-rw-r--r--grpc/src/core/lib/iomgr/executor.cc69
-rw-r--r--grpc/src/core/lib/iomgr/executor.h2
-rw-r--r--grpc/src/core/lib/iomgr/executor/mpmcqueue.cc31
-rw-r--r--grpc/src/core/lib/iomgr/executor/mpmcqueue.h18
-rw-r--r--grpc/src/core/lib/iomgr/executor/threadpool.cc9
-rw-r--r--grpc/src/core/lib/iomgr/executor/threadpool.h7
-rw-r--r--grpc/src/core/lib/iomgr/fork_posix.cc3
-rw-r--r--grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc4
-rw-r--r--grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc4
-rw-r--r--grpc/src/core/lib/iomgr/internal_errqueue.cc5
-rw-r--r--grpc/src/core/lib/iomgr/iocp_windows.cc19
-rw-r--r--grpc/src/core/lib/iomgr/iocp_windows.h2
-rw-r--r--grpc/src/core/lib/iomgr/iomgr.cc6
-rw-r--r--grpc/src/core/lib/iomgr/iomgr.h4
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_custom.cc79
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_custom.h49
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_internal.cc16
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_internal.h5
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_posix.cc6
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc54
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_uv.cc43
-rw-r--r--grpc/src/core/lib/iomgr/iomgr_windows.cc7
-rw-r--r--grpc/src/core/lib/iomgr/is_epollexclusive_available.cc119
-rw-r--r--grpc/src/core/lib/iomgr/is_epollexclusive_available.h36
-rw-r--r--grpc/src/core/lib/iomgr/load_file.cc4
-rw-r--r--grpc/src/core/lib/iomgr/lockfree_event.cc18
-rw-r--r--grpc/src/core/lib/iomgr/polling_entity.cc4
-rw-r--r--grpc/src/core/lib/iomgr/polling_entity.h6
-rw-r--r--grpc/src/core/lib/iomgr/pollset.cc2
-rw-r--r--grpc/src/core/lib/iomgr/pollset.h8
-rw-r--r--grpc/src/core/lib/iomgr/pollset_custom.cc106
-rw-r--r--grpc/src/core/lib/iomgr/pollset_custom.h35
-rw-r--r--grpc/src/core/lib/iomgr/pollset_set_custom.cc48
-rw-r--r--grpc/src/core/lib/iomgr/pollset_set_custom.h26
-rw-r--r--grpc/src/core/lib/iomgr/pollset_set_windows.cc1
-rw-r--r--grpc/src/core/lib/iomgr/pollset_uv.cc93
-rw-r--r--grpc/src/core/lib/iomgr/pollset_uv.h32
-rw-r--r--grpc/src/core/lib/iomgr/pollset_windows.cc4
-rw-r--r--grpc/src/core/lib/iomgr/port.h24
-rw-r--r--grpc/src/core/lib/iomgr/python_util.h3
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address.cc34
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address.h91
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_custom.cc169
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_custom.h45
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_impl.h59
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_posix.cc168
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_posix.h47
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_windows.cc181
-rw-r--r--grpc/src/core/lib/iomgr/resolve_address_windows.h47
-rw-r--r--grpc/src/core/lib/iomgr/resolved_address.h39
-rw-r--r--grpc/src/core/lib/iomgr/resource_quota.cc1017
-rw-r--r--grpc/src/core/lib/iomgr/resource_quota.h177
-rw-r--r--grpc/src/core/lib/iomgr/sockaddr.h3
-rw-r--r--grpc/src/core/lib/iomgr/sockaddr_custom.h54
-rw-r--r--grpc/src/core/lib/iomgr/sockaddr_utils_posix.cc62
-rw-r--r--grpc/src/core/lib/iomgr/socket_factory_posix.cc10
-rw-r--r--grpc/src/core/lib/iomgr/socket_factory_posix.h1
-rw-r--r--grpc/src/core/lib/iomgr/socket_mutator.cc21
-rw-r--r--grpc/src/core/lib/iomgr/socket_mutator.h30
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_common_posix.cc34
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_linux.cc8
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_posix.cc4
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_posix.h8
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_uv.cc49
-rw-r--r--grpc/src/core/lib/iomgr/socket_utils_windows.cc4
-rw-r--r--grpc/src/core/lib/iomgr/sys_epoll_wrapper.h30
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client.cc2
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client.h7
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client_cfstream.cc32
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client_custom.cc160
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client_posix.cc53
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client_posix.h6
-rw-r--r--grpc/src/core/lib/iomgr/tcp_client_windows.cc20
-rw-r--r--grpc/src/core/lib/iomgr/tcp_custom.cc389
-rw-r--r--grpc/src/core/lib/iomgr/tcp_custom.h85
-rw-r--r--grpc/src/core/lib/iomgr/tcp_posix.cc344
-rw-r--r--grpc/src/core/lib/iomgr/tcp_posix.h29
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server.h7
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_custom.cc485
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_posix.cc76
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_utils_posix.h38
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc7
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc8
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc8
-rw-r--r--grpc/src/core/lib/iomgr/tcp_server_windows.cc16
-rw-r--r--grpc/src/core/lib/iomgr/tcp_uv.cc421
-rw-r--r--grpc/src/core/lib/iomgr/tcp_windows.cc61
-rw-r--r--grpc/src/core/lib/iomgr/tcp_windows.h2
-rw-r--r--grpc/src/core/lib/iomgr/timer.cc5
-rw-r--r--grpc/src/core/lib/iomgr/timer.h25
-rw-r--r--grpc/src/core/lib/iomgr/timer_custom.cc96
-rw-r--r--grpc/src/core/lib/iomgr/timer_custom.h43
-rw-r--r--grpc/src/core/lib/iomgr/timer_generic.cc237
-rw-r--r--grpc/src/core/lib/iomgr/timer_generic.h1
-rw-r--r--grpc/src/core/lib/iomgr/timer_heap.cc5
-rw-r--r--grpc/src/core/lib/iomgr/timer_manager.cc31
-rw-r--r--grpc/src/core/lib/iomgr/timer_uv.cc66
-rw-r--r--grpc/src/core/lib/iomgr/udp_server.cc748
-rw-r--r--grpc/src/core/lib/iomgr/udp_server.h103
-rw-r--r--grpc/src/core/lib/iomgr/unix_sockets_posix.cc64
-rw-r--r--grpc/src/core/lib/iomgr/unix_sockets_posix.h16
-rw-r--r--grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc21
-rw-r--r--grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc1
-rw-r--r--grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc5
-rw-r--r--grpc/src/core/lib/iomgr/wakeup_fd_posix.cc1
-rw-r--r--grpc/src/core/lib/iomgr/work_serializer.cc164
-rw-r--r--grpc/src/core/lib/iomgr/work_serializer.h22
-rw-r--r--grpc/src/core/lib/json/json_reader.cc147
-rw-r--r--grpc/src/core/lib/json/json_util.cc74
-rw-r--r--grpc/src/core/lib/json/json_util.h184
-rw-r--r--grpc/src/core/lib/json/json_writer.cc3
-rw-r--r--grpc/src/core/lib/matchers/matchers.cc30
-rw-r--r--grpc/src/core/lib/matchers/matchers.h4
-rw-r--r--grpc/src/core/lib/profiling/basic_timers.cc14
-rw-r--r--grpc/src/core/lib/profiling/stap_timers.cc4
-rw-r--r--grpc/src/core/lib/promise/activity.cc121
-rw-r--r--grpc/src/core/lib/promise/activity.h540
-rw-r--r--grpc/src/core/lib/promise/arena_promise.h188
-rw-r--r--grpc/src/core/lib/promise/call_push_pull.h144
-rw-r--r--grpc/src/core/lib/promise/context.h86
-rw-r--r--grpc/src/core/lib/promise/detail/basic_join.h199
-rw-r--r--grpc/src/core/lib/promise/detail/basic_seq.h496
-rw-r--r--grpc/src/core/lib/promise/detail/promise_factory.h189
-rw-r--r--grpc/src/core/lib/promise/detail/promise_like.h85
-rw-r--r--grpc/src/core/lib/promise/detail/status.h50
-rw-r--r--grpc/src/core/lib/promise/detail/switch.h1455
-rw-r--r--grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h48
-rw-r--r--grpc/src/core/lib/promise/for_each.h140
-rw-r--r--grpc/src/core/lib/promise/if.h134
-rw-r--r--grpc/src/core/lib/promise/intra_activity_waiter.h49
-rw-r--r--grpc/src/core/lib/promise/join.h55
-rw-r--r--grpc/src/core/lib/promise/latch.h104
-rw-r--r--grpc/src/core/lib/promise/loop.h134
-rw-r--r--grpc/src/core/lib/promise/map.h88
-rw-r--r--grpc/src/core/lib/promise/observable.h295
-rw-r--r--grpc/src/core/lib/promise/pipe.h339
-rw-r--r--grpc/src/core/lib/promise/poll.h66
-rw-r--r--grpc/src/core/lib/promise/promise.h95
-rw-r--r--grpc/src/core/lib/promise/race.h84
-rw-r--r--grpc/src/core/lib/promise/seq.h89
-rw-r--r--grpc/src/core/lib/promise/sleep.cc74
-rw-r--r--grpc/src/core/lib/promise/sleep.h66
-rw-r--r--grpc/src/core/lib/promise/try_join.h83
-rw-r--r--grpc/src/core/lib/promise/try_seq.h157
-rw-r--r--grpc/src/core/lib/promise/wait_set.h76
-rw-r--r--grpc/src/core/lib/resolver/resolver.cc79
-rw-r--r--grpc/src/core/lib/resolver/resolver.h135
-rw-r--r--grpc/src/core/lib/resolver/resolver_factory.h76
-rw-r--r--grpc/src/core/lib/resolver/resolver_registry.cc156
-rw-r--r--grpc/src/core/lib/resolver/resolver_registry.h113
-rw-r--r--grpc/src/core/lib/resolver/server_address.cc170
-rw-r--r--grpc/src/core/lib/resolver/server_address.h144
-rw-r--r--grpc/src/core/lib/resource_quota/api.cc83
-rw-r--r--grpc/src/core/lib/resource_quota/api.h40
-rw-r--r--grpc/src/core/lib/resource_quota/arena.cc107
-rw-r--r--grpc/src/core/lib/resource_quota/arena.h142
-rw-r--r--grpc/src/core/lib/resource_quota/memory_quota.cc478
-rw-r--r--grpc/src/core/lib/resource_quota/memory_quota.h457
-rw-r--r--grpc/src/core/lib/resource_quota/resource_quota.cc33
-rw-r--r--grpc/src/core/lib/resource_quota/resource_quota.h66
-rw-r--r--grpc/src/core/lib/resource_quota/thread_quota.cc43
-rw-r--r--grpc/src/core/lib/resource_quota/thread_quota.h57
-rw-r--r--grpc/src/core/lib/resource_quota/trace.cc19
-rw-r--r--grpc/src/core/lib/resource_quota/trace.h24
-rw-r--r--grpc/src/core/lib/security/authorization/authorization_engine.h4
-rw-r--r--grpc/src/core/lib/security/authorization/authorization_policy_provider.h40
-rw-r--r--grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc46
-rw-r--r--grpc/src/core/lib/security/authorization/cel_authorization_engine.cc24
-rw-r--r--grpc/src/core/lib/security/authorization/cel_authorization_engine.h3
-rw-r--r--grpc/src/core/lib/security/authorization/evaluate_args.cc160
-rw-r--r--grpc/src/core/lib/security/authorization/evaluate_args.h30
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_authorization_engine.cc11
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_authorization_engine.h9
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc193
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h103
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_server_authz_filter.cc106
-rw-r--r--grpc/src/core/lib/security/authorization/grpc_server_authz_filter.h50
-rw-r--r--grpc/src/core/lib/security/authorization/matchers.cc239
-rw-r--r--grpc/src/core/lib/security/authorization/matchers.h109
-rw-r--r--grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h2
-rw-r--r--grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h2
-rw-r--r--grpc/src/core/lib/security/authorization/rbac_policy.cc264
-rw-r--r--grpc/src/core/lib/security/authorization/rbac_policy.h84
-rw-r--r--grpc/src/core/lib/security/authorization/rbac_translator.cc60
-rw-r--r--grpc/src/core/lib/security/authorization/rbac_translator.h1
-rw-r--r--grpc/src/core/lib/security/context/security_context.cc25
-rw-r--r--grpc/src/core/lib/security/context/security_context.h11
-rw-r--r--grpc/src/core/lib/security/credentials/alts/alts_credentials.cc11
-rw-r--r--grpc/src/core/lib/security/credentials/alts/alts_credentials.h10
-rw-r--r--grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc4
-rw-r--r--grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc4
-rw-r--r--grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc4
-rw-r--r--grpc/src/core/lib/security/credentials/call_creds_util.cc87
-rw-r--r--grpc/src/core/lib/security/credentials/call_creds_util.h42
-rw-r--r--grpc/src/core/lib/security/credentials/channel_creds_registry.h97
-rw-r--r--grpc/src/core/lib/security/credentials/channel_creds_registry_init.cc70
-rw-r--r--grpc/src/core/lib/security/credentials/composite/composite_credentials.cc114
-rw-r--r--grpc/src/core/lib/security/credentials/composite/composite_credentials.h33
-rw-r--r--grpc/src/core/lib/security/credentials/credentials.cc21
-rw-r--r--grpc/src/core/lib/security/credentials/credentials.h163
-rw-r--r--grpc/src/core/lib/security/credentials/credentials_metadata.cc62
-rw-r--r--grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc120
-rw-r--r--grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h4
-rw-r--r--grpc/src/core/lib/security/credentials/external/aws_request_signer.cc6
-rw-r--r--grpc/src/core/lib/security/credentials/external/external_account_credentials.cc180
-rw-r--r--grpc/src/core/lib/security/credentials/external/external_account_credentials.h15
-rw-r--r--grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc1
-rw-r--r--grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc53
-rw-r--r--grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h1
-rw-r--r--grpc/src/core/lib/security/credentials/fake/fake_credentials.cc50
-rw-r--r--grpc/src/core/lib/security/credentials/fake/fake_credentials.h43
-rw-r--r--grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc3
-rw-r--r--grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc101
-rw-r--r--grpc/src/core/lib/security/credentials/google_default/google_default_credentials.h12
-rw-r--r--grpc/src/core/lib/security/credentials/iam/iam_credentials.cc52
-rw-r--r--grpc/src/core/lib/security/credentials/iam/iam_credentials.h24
-rw-r--r--grpc/src/core/lib/security/credentials/insecure/insecure_credentials.cc51
-rw-r--r--grpc/src/core/lib/security/credentials/insecure/insecure_credentials.h57
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/json_token.cc12
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/json_token.h3
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc107
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h42
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc113
-rw-r--r--grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h8
-rw-r--r--grpc/src/core/lib/security/credentials/local/local_credentials.cc12
-rw-r--r--grpc/src/core/lib/security/credentials/local/local_credentials.h10
-rw-r--r--grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc341
-rw-r--r--grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h94
-rw-r--r--grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc254
-rw-r--r--grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h83
-rw-r--r--grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc29
-rw-r--r--grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h18
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc5
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h16
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc73
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h81
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc209
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h145
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc120
-rw-r--r--grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h226
-rw-r--r--grpc/src/core/lib/security/credentials/tls/tls_credentials.cc46
-rw-r--r--grpc/src/core/lib/security/credentials/tls/tls_credentials.h6
-rw-r--r--grpc/src/core/lib/security/credentials/tls/tls_utils.cc32
-rw-r--r--grpc/src/core/lib/security/credentials/tls/tls_utils.h13
-rw-r--r--grpc/src/core/lib/security/credentials/xds/xds_credentials.cc109
-rw-r--r--grpc/src/core/lib/security/credentials/xds/xds_credentials.h43
-rw-r--r--grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc28
-rw-r--r--grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h6
-rw-r--r--grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc37
-rw-r--r--grpc/src/core/lib/security/security_connector/fake/fake_security_connector.h2
-rw-r--r--grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc26
-rw-r--r--grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h27
-rw-r--r--grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc1
-rw-r--r--grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc9
-rw-r--r--grpc/src/core/lib/security/security_connector/local/local_security_connector.cc48
-rw-r--r--grpc/src/core/lib/security/security_connector/security_connector.cc23
-rw-r--r--grpc/src/core/lib/security/security_connector/security_connector.h48
-rw-r--r--grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc34
-rw-r--r--grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h3
-rw-r--r--grpc/src/core/lib/security/security_connector/ssl_utils.cc82
-rw-r--r--grpc/src/core/lib/security/security_connector/ssl_utils.h32
-rw-r--r--grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc601
-rw-r--r--grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h117
-rw-r--r--grpc/src/core/lib/security/transport/auth_filters.h44
-rw-r--r--grpc/src/core/lib/security/transport/client_auth_filter.cc461
-rw-r--r--grpc/src/core/lib/security/transport/secure_endpoint.cc345
-rw-r--r--grpc/src/core/lib/security/transport/secure_endpoint.h3
-rw-r--r--grpc/src/core/lib/security/transport/security_handshaker.cc165
-rw-r--r--grpc/src/core/lib/security/transport/security_handshaker.h3
-rw-r--r--grpc/src/core/lib/security/transport/server_auth_filter.cc85
-rw-r--r--grpc/src/core/lib/security/transport/tsi_error.cc8
-rw-r--r--grpc/src/core/lib/security/util/json_util.cc14
-rw-r--r--grpc/src/core/lib/service_config/service_config.h82
-rw-r--r--grpc/src/core/lib/service_config/service_config_call_data.h72
-rw-r--r--grpc/src/core/lib/service_config/service_config_impl.cc230
-rw-r--r--grpc/src/core/lib/service_config/service_config_impl.h125
-rw-r--r--grpc/src/core/lib/service_config/service_config_parser.cc93
-rw-r--r--grpc/src/core/lib/service_config/service_config_parser.h106
-rw-r--r--grpc/src/core/lib/slice/percent_encoding.cc181
-rw-r--r--grpc/src/core/lib/slice/percent_encoding.h51
-rw-r--r--grpc/src/core/lib/slice/slice.cc272
-rw-r--r--grpc/src/core/lib/slice/slice.h384
-rw-r--r--grpc/src/core/lib/slice/slice_api.cc39
-rw-r--r--grpc/src/core/lib/slice/slice_buffer.cc17
-rw-r--r--grpc/src/core/lib/slice/slice_intern.cc373
-rw-r--r--grpc/src/core/lib/slice/slice_internal.h291
-rw-r--r--grpc/src/core/lib/slice/slice_refcount.cc35
-rw-r--r--grpc/src/core/lib/slice/slice_refcount.h46
-rw-r--r--grpc/src/core/lib/slice/slice_refcount_base.h61
-rw-r--r--grpc/src/core/lib/slice/slice_split.cc100
-rw-r--r--grpc/src/core/lib/slice/slice_split.h40
-rw-r--r--grpc/src/core/lib/slice/slice_string_helpers.cc83
-rw-r--r--grpc/src/core/lib/slice/slice_string_helpers.h11
-rw-r--r--grpc/src/core/lib/slice/slice_utils.h200
-rw-r--r--grpc/src/core/lib/surface/api_trace.cc3
-rw-r--r--grpc/src/core/lib/surface/api_trace.h1
-rw-r--r--grpc/src/core/lib/surface/builtins.cc49
-rw-r--r--grpc/src/core/lib/surface/builtins.h26
-rw-r--r--grpc/src/core/lib/surface/byte_buffer_reader.cc2
-rw-r--r--grpc/src/core/lib/surface/call.cc2388
-rw-r--r--grpc/src/core/lib/surface/call.h35
-rw-r--r--grpc/src/core/lib/surface/call_details.cc4
-rw-r--r--grpc/src/core/lib/surface/call_log_batch.cc4
-rw-r--r--grpc/src/core/lib/surface/channel.cc175
-rw-r--r--grpc/src/core/lib/surface/channel.h38
-rw-r--r--grpc/src/core/lib/surface/channel_init.cc98
-rw-r--r--grpc/src/core/lib/surface/channel_init.h84
-rw-r--r--grpc/src/core/lib/surface/channel_ping.cc3
-rw-r--r--grpc/src/core/lib/surface/channel_stack_type.cc3
-rw-r--r--grpc/src/core/lib/surface/completion_queue.cc192
-rw-r--r--grpc/src/core/lib/surface/completion_queue.h2
-rw-r--r--grpc/src/core/lib/surface/completion_queue_factory.cc6
-rw-r--r--grpc/src/core/lib/surface/completion_queue_factory.h1
-rw-r--r--grpc/src/core/lib/surface/event_string.cc1
-rw-r--r--grpc/src/core/lib/surface/init.cc142
-rw-r--r--grpc/src/core/lib/surface/init.h14
-rw-r--r--grpc/src/core/lib/surface/init_secure.cc81
-rw-r--r--grpc/src/core/lib/surface/init_unsecure.cc33
-rw-r--r--grpc/src/core/lib/surface/lame_client.cc79
-rw-r--r--grpc/src/core/lib/surface/lame_client.h2
-rw-r--r--grpc/src/core/lib/surface/metadata_array.cc4
-rw-r--r--grpc/src/core/lib/surface/server.cc193
-rw-r--r--grpc/src/core/lib/surface/server.h83
-rw-r--r--grpc/src/core/lib/surface/validate_metadata.cc67
-rw-r--r--grpc/src/core/lib/surface/version.cc6
-rw-r--r--grpc/src/core/lib/transport/authority_override.cc40
-rw-r--r--grpc/src/core/lib/transport/authority_override.h37
-rw-r--r--grpc/src/core/lib/transport/bdp_estimator.cc23
-rw-r--r--grpc/src/core/lib/transport/bdp_estimator.h4
-rw-r--r--grpc/src/core/lib/transport/byte_stream.cc6
-rw-r--r--grpc/src/core/lib/transport/byte_stream.h1
-rw-r--r--grpc/src/core/lib/transport/connectivity_state.cc13
-rw-r--r--grpc/src/core/lib/transport/connectivity_state.h4
-rw-r--r--grpc/src/core/lib/transport/error_utils.cc72
-rw-r--r--grpc/src/core/lib/transport/error_utils.h5
-rw-r--r--grpc/src/core/lib/transport/metadata.cc693
-rw-r--r--grpc/src/core/lib/transport/metadata.h446
-rw-r--r--grpc/src/core/lib/transport/metadata_batch.cc419
-rw-r--r--grpc/src/core/lib/transport/metadata_batch.h1516
-rw-r--r--grpc/src/core/lib/transport/parsed_metadata.cc37
-rw-r--r--grpc/src/core/lib/transport/parsed_metadata.h401
-rw-r--r--grpc/src/core/lib/transport/pid_controller.cc8
-rw-r--r--grpc/src/core/lib/transport/static_metadata.cc1249
-rw-r--r--grpc/src/core/lib/transport/static_metadata.h604
-rw-r--r--grpc/src/core/lib/transport/status_conversion.cc4
-rw-r--r--grpc/src/core/lib/transport/status_conversion.h2
-rw-r--r--grpc/src/core/lib/transport/status_metadata.cc62
-rw-r--r--grpc/src/core/lib/transport/status_metadata.h48
-rw-r--r--grpc/src/core/lib/transport/timeout_encoding.cc271
-rw-r--r--grpc/src/core/lib/transport/timeout_encoding.h50
-rw-r--r--grpc/src/core/lib/transport/transport.cc43
-rw-r--r--grpc/src/core/lib/transport/transport.h109
-rw-r--r--grpc/src/core/lib/transport/transport_impl.h14
-rw-r--r--grpc/src/core/lib/transport/transport_op_string.cc38
-rw-r--r--grpc/src/core/lib/uri/uri_parser.cc300
-rw-r--r--grpc/src/core/lib/uri/uri_parser.h62
-rw-r--r--grpc/src/core/plugin_registry/grpc_plugin_registry.cc175
-rw-r--r--grpc/src/core/plugin_registry/grpc_plugin_registry_extra.cc85
-rw-r--r--grpc/src/core/plugin_registry/grpc_plugin_registry_noextra.cc28
-rw-r--r--grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc111
-rw-r--r--grpc/src/core/tsi/alts/crypt/aes_gcm.cc9
-rw-r--r--grpc/src/core/tsi/alts/crypt/gsec.h7
-rw-r--r--grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc25
-rw-r--r--grpc/src/core/tsi/alts/frame_protector/frame_handler.cc21
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc58
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h5
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_shared_resource.cc10
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc48
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.cc4
-rw-r--r--grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.h2
-rw-r--r--grpc/src/core/tsi/alts/handshaker/proto/handshaker.options2
-rw-r--r--grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc4
-rw-r--r--grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h4
-rw-r--r--grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc4
-rw-r--r--grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc2
-rw-r--r--grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc4
-rw-r--r--grpc/src/core/tsi/fake_transport_security.cc22
-rw-r--r--grpc/src/core/tsi/local_transport_security.cc129
-rw-r--r--grpc/src/core/tsi/local_transport_security.h5
-rw-r--r--grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.cc141
-rw-r--r--grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.h81
-rw-r--r--grpc/src/core/tsi/ssl/session_cache/ssl_session.h6
-rw-r--r--grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc73
-rw-r--r--grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h13
-rw-r--r--grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc4
-rw-r--r--grpc/src/core/tsi/ssl_transport_security.cc291
-rw-r--r--grpc/src/core/tsi/ssl_transport_security.h59
-rw-r--r--grpc/src/core/tsi/test_creds/BUILD2
-rw-r--r--grpc/src/core/tsi/transport_security.cc18
-rw-r--r--grpc/src/core/tsi/transport_security.h17
-rw-r--r--grpc/src/core/tsi/transport_security_grpc.h1
-rw-r--r--grpc/src/core/tsi/transport_security_interface.h28
-rw-r--r--grpc/src/cpp/Protobuf-C++.podspec42
-rwxr-xr-xgrpc/src/cpp/README.md47
-rw-r--r--grpc/src/cpp/client/channel_cc.cc53
-rw-r--r--grpc/src/cpp/client/channel_test_peer.cc3
-rw-r--r--grpc/src/cpp/client/client_callback.cc5
-rw-r--r--grpc/src/cpp/client/client_context.cc8
-rw-r--r--grpc/src/cpp/client/create_channel_internal.cc9
-rw-r--r--grpc/src/cpp/client/create_channel_internal.h6
-rw-r--r--grpc/src/cpp/client/create_channel_posix.cc25
-rw-r--r--grpc/src/cpp/client/cronet_credentials.cc4
-rw-r--r--grpc/src/cpp/client/insecure_credentials.cc13
-rw-r--r--grpc/src/cpp/client/secure_credentials.cc18
-rw-r--r--grpc/src/cpp/client/secure_credentials.h9
-rw-r--r--grpc/src/cpp/client/xds_credentials.cc8
-rw-r--r--grpc/src/cpp/common/alarm.cc23
-rw-r--r--grpc/src/cpp/common/alts_context.cc14
-rw-r--r--grpc/src/cpp/common/auth_property_iterator.cc3
-rw-r--r--grpc/src/cpp/common/channel_arguments.cc6
-rw-r--r--grpc/src/cpp/common/channel_filter.cc72
-rw-r--r--grpc/src/cpp/common/channel_filter.h104
-rw-r--r--grpc/src/cpp/common/completion_queue_cc.cc13
-rw-r--r--grpc/src/cpp/common/core_codegen.cc8
-rw-r--r--grpc/src/cpp/common/secure_channel_arguments.cc2
-rw-r--r--grpc/src/cpp/common/secure_create_auth_context.cc1
-rw-r--r--grpc/src/cpp/common/tls_certificate_provider.cc4
-rw-r--r--grpc/src/cpp/common/tls_certificate_verifier.cc244
-rw-r--r--grpc/src/cpp/common/tls_credentials_options.cc139
-rw-r--r--grpc/src/cpp/common/tls_credentials_options_util.cc76
-rw-r--r--grpc/src/cpp/common/tls_credentials_options_util.h44
-rw-r--r--grpc/src/cpp/common/validate_service_config.cc6
-rw-r--r--grpc/src/cpp/common/version_cc.cc2
-rw-r--r--grpc/src/cpp/ext/filters/census/client_filter.cc312
-rw-r--r--grpc/src/cpp/ext/filters/census/client_filter.h65
-rw-r--r--grpc/src/cpp/ext/filters/census/context.cc3
-rw-r--r--grpc/src/cpp/ext/filters/census/context.h19
-rw-r--r--grpc/src/cpp/ext/filters/census/grpc_plugin.cc18
-rw-r--r--grpc/src/cpp/ext/filters/census/grpc_plugin.h24
-rw-r--r--grpc/src/cpp/ext/filters/census/measures.cc27
-rw-r--r--grpc/src/cpp/ext/filters/census/measures.h4
-rw-r--r--grpc/src/cpp/ext/filters/census/open_census_call_tracer.h100
-rw-r--r--grpc/src/cpp/ext/filters/census/server_filter.cc58
-rw-r--r--grpc/src/cpp/ext/filters/census/server_filter.h10
-rw-r--r--grpc/src/cpp/ext/filters/census/views.cc154
-rw-r--r--grpc/src/cpp/ext/proto_server_reflection.cc4
-rw-r--r--grpc/src/cpp/ext/proto_server_reflection.h1
-rw-r--r--grpc/src/cpp/ext/proto_server_reflection_plugin.cc6
-rw-r--r--grpc/src/cpp/server/admin/admin_services.cc5
-rw-r--r--grpc/src/cpp/server/async_generic_service.cc5
-rw-r--r--grpc/src/cpp/server/authorization_policy_provider.cc69
-rw-r--r--grpc/src/cpp/server/channelz/channelz_service.h1
-rw-r--r--grpc/src/cpp/server/channelz/channelz_service_plugin.cc8
-rw-r--r--grpc/src/cpp/server/csds/csds.cc4
-rw-r--r--grpc/src/cpp/server/csds/csds.h4
-rw-r--r--grpc/src/cpp/server/external_connection_acceptor_impl.h2
-rw-r--r--grpc/src/cpp/server/health/default_health_check_service.cc30
-rw-r--r--grpc/src/cpp/server/health/default_health_check_service.h2
-rw-r--r--grpc/src/cpp/server/insecure_server_credentials.cc10
-rw-r--r--grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc5
-rw-r--r--grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc1
-rw-r--r--grpc/src/cpp/server/load_reporter/load_data_store.cc4
-rw-r--r--grpc/src/cpp/server/load_reporter/load_reporter.cc22
-rw-r--r--grpc/src/cpp/server/load_reporter/load_reporter.h12
-rw-r--r--grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc12
-rw-r--r--grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.h8
-rw-r--r--grpc/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc4
-rw-r--r--grpc/src/cpp/server/load_reporter/util.cc3
-rw-r--r--grpc/src/cpp/server/orca/orca_service.cc224
-rw-r--r--grpc/src/cpp/server/secure_server_credentials.cc7
-rw-r--r--grpc/src/cpp/server/secure_server_credentials.h3
-rw-r--r--grpc/src/cpp/server/server_builder.cc48
-rw-r--r--grpc/src/cpp/server/server_cc.cc51
-rw-r--r--grpc/src/cpp/server/server_context.cc16
-rw-r--r--grpc/src/cpp/server/server_credentials.cc3
-rw-r--r--grpc/src/cpp/server/server_posix.cc8
-rw-r--r--grpc/src/cpp/server/xds_server_credentials.cc8
-rw-r--r--grpc/src/cpp/thread_manager/thread_manager.cc18
-rw-r--r--grpc/src/cpp/thread_manager/thread_manager.h5
-rw-r--r--grpc/src/cpp/util/byte_buffer_cc.cc31
-rw-r--r--grpc/src/cpp/util/core_stats.h3
-rw-r--r--grpc/src/proto/grpc/auth/v1/BUILD25
-rw-r--r--grpc/src/proto/grpc/auth/v1/authz_policy.proto122
-rw-r--r--grpc/src/proto/grpc/binary_log/v1alpha/log.proto93
-rw-r--r--grpc/src/proto/grpc/channelz/BUILD4
-rw-r--r--grpc/src/proto/grpc/core/BUILD4
-rw-r--r--grpc/src/proto/grpc/gcp/BUILD4
-rw-r--r--grpc/src/proto/grpc/health/v1/BUILD4
-rw-r--r--grpc/src/proto/grpc/health/v1/health.options1
-rw-r--r--grpc/src/proto/grpc/http_over_grpc/BUILD31
-rw-r--r--grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto51
-rw-r--r--grpc/src/proto/grpc/lb/v1/BUILD4
-rw-r--r--grpc/src/proto/grpc/lb/v1/load_balancer.options5
-rw-r--r--grpc/src/proto/grpc/lb/v1/load_balancer.proto14
-rw-r--r--grpc/src/proto/grpc/lookup/v1/BUILD48
-rw-r--r--grpc/src/proto/grpc/lookup/v1/rls.proto62
-rw-r--r--grpc/src/proto/grpc/lookup/v1/rls_config.proto225
-rw-r--r--grpc/src/proto/grpc/reflection/v1/BUILD40
-rw-r--r--grpc/src/proto/grpc/reflection/v1/reflection.proto147
-rw-r--r--grpc/src/proto/grpc/reflection/v1alpha/BUILD4
-rw-r--r--grpc/src/proto/grpc/status/BUILD4
-rw-r--r--grpc/src/proto/grpc/testing/BUILD7
-rw-r--r--grpc/src/proto/grpc/testing/control.proto6
-rw-r--r--grpc/src/proto/grpc/testing/duplicate/BUILD4
-rw-r--r--grpc/src/proto/grpc/testing/echo.proto1
-rw-r--r--grpc/src/proto/grpc/testing/proto2/BUILD.bazel17
-rw-r--r--grpc/src/proto/grpc/testing/xds/BUILD11
-rw-r--r--grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto58
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/BUILD85
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/address.proto7
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/ads.proto2
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/base.proto3
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/cluster.proto52
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/csds.proto53
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/discovery.proto45
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/endpoint.proto11
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/expr.proto29
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/extension.proto38
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto27
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/http_filter_rbac.proto41
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/metadata.proto86
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto2
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/orca_service.proto47
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/path.proto35
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/range.proto10
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/rbac.proto293
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/regex.proto5
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/route.proto123
-rw-r--r--grpc/src/proto/grpc/testing/xds/v3/tls.proto198
-rwxr-xr-xgrpc/src/upb/gen_build_yaml.py15
-rw-r--r--grpc/test/build/check_epollexclusive.c23
-rw-r--r--grpc/test/build_test/BUILD4
-rw-r--r--grpc/test/core/security/alts_credentials_fuzzer.cc2
-rw-r--r--grpc/test/core/security/alts_security_connector_test.cc3
-rw-r--r--grpc/test/core/security/auth_context_test.cc6
-rw-r--r--grpc/test/core/security/authorization_matchers_test.cc465
-rw-r--r--grpc/test/core/security/aws_request_signer_test.cc18
-rw-r--r--grpc/test/core/security/channel_creds_registry_test.cc104
-rw-r--r--grpc/test/core/security/check_gcp_environment_windows_test.cc1
-rw-r--r--grpc/test/core/security/create_jwt.cc5
-rw-r--r--grpc/test/core/security/credentials_test.cc2869
-rw-r--r--grpc/test/core/security/evaluate_args_test.cc98
-rw-r--r--grpc/test/core/security/fetch_oauth2.cc2
-rw-r--r--grpc/test/core/security/grpc_alts_credentials_options_test.cc4
-rw-r--r--grpc/test/core/security/grpc_authorization_engine_test.cc32
-rw-r--r--grpc/test/core/security/grpc_authorization_policy_provider_test.cc219
-rw-r--r--grpc/test/core/security/grpc_tls_certificate_distributor_test.cc24
-rw-r--r--grpc/test/core/security/grpc_tls_certificate_provider_test.cc68
-rw-r--r--grpc/test/core/security/grpc_tls_certificate_verifier_test.cc305
-rw-r--r--grpc/test/core/security/grpc_tls_credentials_options_comparator_test.cc175
-rw-r--r--grpc/test/core/security/grpc_tls_credentials_options_test.cc122
-rw-r--r--grpc/test/core/security/insecure_security_connector_test.cc8
-rw-r--r--grpc/test/core/security/json_token_test.cc5
-rw-r--r--grpc/test/core/security/jwt_verifier_test.cc119
-rw-r--r--grpc/test/core/security/linux_system_roots_test.cc12
-rw-r--r--grpc/test/core/security/matchers_test.cc52
-rw-r--r--grpc/test/core/security/oauth2_utils.cc118
-rw-r--r--grpc/test/core/security/print_google_default_creds_token.cc4
-rw-r--r--grpc/test/core/security/rbac_translator_test.cc158
-rw-r--r--grpc/test/core/security/secure_endpoint_test.cc21
-rw-r--r--grpc/test/core/security/security_connector_test.cc342
-rw-r--r--grpc/test/core/security/ssl_credentials_test.cc6
-rw-r--r--grpc/test/core/security/ssl_server_fuzzer.cc10
-rw-r--r--grpc/test/core/security/tls_security_connector_test.cc906
-rw-r--r--grpc/test/core/security/verify_jwt.cc3
-rw-r--r--grpc/test/core/security/xds_credentials_test.cc25
-rw-r--r--grpc/test/core/util/cmdline.cc4
-rw-r--r--grpc/test/distrib/bazel/cpp/BUILD43
-rw-r--r--grpc/test/distrib/bazel/cpp/WORKSPACE27
-rw-r--r--grpc/test/distrib/bazel/cpp/greeter_client.cc104
-rw-r--r--grpc/test/distrib/bazel/cpp/greeter_server.cc73
-rwxr-xr-xgrpc/test/distrib/bazel/cpp/greeter_test.sh61
-rw-r--r--grpc/test/distrib/bazel/cpp/protos/BUILD37
-rw-r--r--grpc/test/distrib/bazel/cpp/protos/helloworld.proto38
-rwxr-xr-xgrpc/test/distrib/bazel/cpp/tools/bazel85
-rw-r--r--grpc/test/distrib/bazel/python/.gitignore (renamed from grpc/bazel/test/python_test_repo/.gitignore)0
-rw-r--r--grpc/test/distrib/bazel/python/BUILD157
-rw-r--r--grpc/test/distrib/bazel/python/README.md (renamed from grpc/bazel/test/python_test_repo/README.md)0
-rw-r--r--grpc/test/distrib/bazel/python/WORKSPACE22
-rw-r--r--grpc/test/distrib/bazel/python/helloworld.proto46
-rw-r--r--grpc/test/distrib/bazel/python/helloworld.py76
-rw-r--r--grpc/test/distrib/bazel/python/helloworld_moved.py79
-rw-r--r--grpc/test/distrib/bazel/python/import_from_proto_library_package.py18
-rw-r--r--grpc/test/distrib/bazel/python/import_from_this_package.py18
-rw-r--r--grpc/test/distrib/bazel/python/in_subpackage/BUILD28
-rw-r--r--grpc/test/distrib/bazel/python/in_subpackage/subpackage.proto29
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/BUILD168
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/import_no_strip_test.py39
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/import_strip_test.py37
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_dependency.proto (renamed from grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_dependency.proto)0
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_example.proto (renamed from grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_example.proto)0
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_no_strip_test.py39
-rw-r--r--grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_strip_test.py37
-rw-r--r--grpc/test/distrib/bazel/python/subdir/hello_dep.proto21
-rwxr-xr-xgrpc/test/distrib/bazel/python/tools/bazel85
-rw-r--r--grpc/test/distrib/bazel/python/transitive_proto_dep.py17
-rw-r--r--grpc/test/distrib/bazel/python_second_test_repo/WORKSPACE1
-rw-r--r--grpc/test/distrib/bazel/python_second_test_repo/proto/BUILD29
-rwxr-xr-xgrpc/test/distrib/bazel/run_bazel_distrib_test.sh33
-rwxr-xr-xgrpc/test/distrib/bazel/test_latest_bazel_version.sh27
-rwxr-xr-xgrpc/test/distrib/bazel/test_single_bazel_version.sh68
-rw-r--r--grpc/test/distrib/cpp/run_distrib_test_cmake.bat3
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake.sh17
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh21
-rw-r--r--grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat2
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh5
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh5
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh5
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_module_install.sh13
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh13
-rwxr-xr-xgrpc/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh19
-rw-r--r--grpc/test/distrib/gcf/python/.gcloudignore19
-rw-r--r--grpc/test/distrib/gcf/python/.gitignore1
-rw-r--r--grpc/test/distrib/gcf/python/README.md12
-rwxr-xr-xgrpc/test/distrib/gcf/python/cleanup.sh24
-rw-r--r--grpc/test/distrib/gcf/python/common.sh18
-rw-r--r--grpc/test/distrib/gcf/python/main.py32
-rw-r--r--grpc/test/distrib/gcf/python/requirements.txt.base1
-rwxr-xr-xgrpc/test/distrib/gcf/python/run.sh52
-rwxr-xr-xgrpc/test/distrib/gcf/python/run_single.sh54
-rwxr-xr-xgrpc/test/distrib/python/test_packages.sh4
-rwxr-xr-xgrpc/test/distrib/ruby/run_distrib_test.sh2
-rw-r--r--grpc/test/http2_test/http2_base_server.py2
-rw-r--r--grpc/test/http2_test/http2_server_health_check.py3
-rw-r--r--grpc/test/http2_test/http2_test_server.py10
-rw-r--r--grpc/test/http2_test/test_data_frame_padding.py3
-rw-r--r--grpc/test/http2_test/test_max_streams.py2
-rw-r--r--grpc/test/spm_build/test.cc29
-rw-r--r--grpc/third_party/ABSEIL_MANUAL.md3
-rw-r--r--grpc/third_party/BUILD2
-rw-r--r--grpc/third_party/README.md43
-rw-r--r--grpc/third_party/abseil-cpp/CMake/AbseilDll.cmake41
-rw-r--r--grpc/third_party/abseil-cpp/CMake/AbseilHelpers.cmake64
-rw-r--r--grpc/third_party/abseil-cpp/CMake/README.md90
-rw-r--r--grpc/third_party/abseil-cpp/CMake/install_test_project/CMakeLists.txt4
-rw-r--r--grpc/third_party/abseil-cpp/CMake/install_test_project/simple.cc9
-rwxr-xr-xgrpc/third_party/abseil-cpp/CMake/install_test_project/test.sh24
-rw-r--r--grpc/third_party/abseil-cpp/CMakeLists.txt53
-rw-r--r--grpc/third_party/abseil-cpp/FAQ.md5
-rw-r--r--grpc/third_party/abseil-cpp/README.md3
-rw-r--r--grpc/third_party/abseil-cpp/WORKSPACE29
-rw-r--r--grpc/third_party/abseil-cpp/absl/BUILD.bazel12
-rw-r--r--grpc/third_party/abseil-cpp/absl/CMakeLists.txt2
-rw-r--r--grpc/third_party/abseil-cpp/absl/algorithm/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt4
-rw-r--r--grpc/third_party/abseil-cpp/absl/algorithm/container.h192
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/BUILD.bazel70
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/CMakeLists.txt108
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/attributes.h95
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/config.h104
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/dynamic_annotations.h27
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h26
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc93
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.h130
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased_test.cc199
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.cc53
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.h211
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_benchmark.cc79
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_test.cc177
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/spinlock.h4
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/sysinfo.cc69
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.cc8
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.h25
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc16
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h8
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/log_severity_test.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/base/options.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/cleanup/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt2
-rw-r--r--grpc/third_party/abseil-cpp/absl/cleanup/cleanup.h8
-rw-r--r--grpc/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc44
-rw-r--r--grpc/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h39
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/BUILD.bazel22
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/CMakeLists.txt77
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/btree_map.h77
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/btree_set.h75
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/btree_test.cc79
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/fixed_array.h5
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc26
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/inlined_vector.h202
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/btree.h51
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/btree_container.h13
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h32
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h21
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc120
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h115
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc41
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/inlined_vector.h811
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/layout_test.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h5
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc22
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h371
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc49
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc262
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h38
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h39
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h35
-rw-r--r--grpc/third_party/abseil-cpp/absl/container/sample_element_size_test.cc114
-rw-r--r--grpc/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake3
-rw-r--r--grpc/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake4
-rw-r--r--grpc/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl4
-rw-r--r--grpc/third_party/abseil-cpp/absl/copts/configure_copts.bzl2
-rw-r--r--grpc/third_party/abseil-cpp/absl/copts/copts.py6
-rwxr-xr-xgrpc/third_party/abseil-cpp/absl/copts/generate_copts.py2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/BUILD.bazel7
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/CMakeLists.txt17
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc4
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/demangle.cc12
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc23
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h8
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h17
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc110
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc234
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc32
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/symbolize.h10
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc24
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/stacktrace.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/symbolize.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc14
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc72
-rw-r--r--grpc/third_party/abseil-cpp/absl/debugging/symbolize_test.cc66
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/BUILD.bazel3
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/CMakeLists.txt24
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/flag.h107
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/flag_benchmark.cc138
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/flag_test.cc38
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/flag.cc91
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/flag.h73
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc116
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/usage.cc12
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/internal/usage_test.cc1
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/parse_test.cc1
-rw-r--r--grpc/third_party/abseil-cpp/absl/flags/reflection.cc8
-rw-r--r--grpc/third_party/abseil-cpp/absl/functional/BUILD.bazel2
-rw-r--r--grpc/third_party/abseil-cpp/absl/functional/CMakeLists.txt5
-rw-r--r--grpc/third_party/abseil-cpp/absl/functional/function_ref.h5
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/BUILD.bazel16
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/CMakeLists.txt23
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/hash.h22
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/hash_test.cc35
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/hash.cc31
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/hash.h125
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc123
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h50
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc580
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.cc111
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.h48
-rw-r--r--grpc/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc486
-rw-r--r--grpc/third_party/abseil-cpp/absl/memory/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/memory/CMakeLists.txt4
-rw-r--r--grpc/third_party/abseil-cpp/absl/memory/memory.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/meta/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/meta/CMakeLists.txt2
-rw-r--r--grpc/third_party/abseil-cpp/absl/meta/type_traits.h34
-rw-r--r--grpc/third_party/abseil-cpp/absl/meta/type_traits_test.cc28
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/CMakeLists.txt4
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/int128.cc13
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/int128.h219
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc44
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc143
-rw-r--r--grpc/third_party/abseil-cpp/absl/numeric/int128_test.cc36
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/BUILD.bazel126
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/CMakeLists.txt93
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc93
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h130
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc199
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.cc53
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h211
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_benchmark.cc79
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc177
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h230
-rw-r--r--grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc171
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/CMakeLists.txt120
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/beta_distribution_test.cc9
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc7
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/distributions_test.cc10
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc10
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/BUILD.bazel9
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc49
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/generate_real.h6
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc7
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_engine.h7
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc87
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc59
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_slow.cc528
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc57
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/randen_test.cc45
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/internal/seed_material.cc50
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc9
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/BUILD.bazel4
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/CMakeLists.txt6
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/internal/status_internal.h10
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/status.cc26
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/status.h34
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/status_test.cc8
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/statusor.cc36
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/statusor.h52
-rw-r--r--grpc/third_party/abseil-cpp/absl/status/statusor_test.cc70
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/BUILD.bazel397
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/CMakeLists.txt513
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/charconv.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/charconv.h5
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord.cc812
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord.h267
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord_ring_reader_test.cc13
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord_ring_test.cc305
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord_test.cc412
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cord_test_helpers.h62
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cordz_test.cc466
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/cordz_test_helpers.h151
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.h203
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal_test.cc116
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc1128
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h939
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc185
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h265
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc325
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc68
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h211
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc293
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc1489
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc129
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h50
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume_test.cc173
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h14
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc236
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h66
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h4
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_test_util.h220
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc96
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h85
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions_test.cc149
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc139
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h131
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle_test.cc265
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc445
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.h298
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc625
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_test.cc341
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.cc64
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h97
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc208
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h87
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h71
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc49
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h121
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc145
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h50
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc59
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h8
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc7
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc3
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc12
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h54
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc135
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h40
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc23
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h70
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/numbers.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/numbers.h34
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/numbers_test.cc143
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/str_cat.cc8
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/str_format.h3
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/str_split_test.cc30
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/string_view.cc37
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/string_view.h159
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/string_view_test.cc46
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/substitute.cc3
-rw-r--r--grpc/third_party/abseil-cpp/absl/strings/substitute.h173
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/BUILD.bazel16
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt14
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc40
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.h8
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_benchmark.cc83
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc12
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/mutex.h6
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/mutex_benchmark.cc6
-rw-r--r--grpc/third_party/abseil-cpp/absl/synchronization/mutex_test.cc55
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/CMakeLists.txt4
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/civil_time.cc4
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/clock_test.cc4
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/duration_test.cc13
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel6
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h113
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc1
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc85
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h3
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc104
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc49
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc17
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc5
-rw-r--r--grpc/third_party/abseil-cpp/absl/time/time.h103
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/CMakeLists.txt26
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/bad_optional_access.h2
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/bad_variant_access.h4
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/span.h6
-rw-r--r--grpc/third_party/abseil-cpp/absl/types/span_test.cc2
-rw-r--r--grpc/third_party/abseil-cpp/absl/utility/BUILD.bazel1
-rw-r--r--grpc/third_party/abseil-cpp/absl/utility/CMakeLists.txt2
-rw-r--r--grpc/third_party/abseil-cpp/ci/cmake_common.sh2
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/cmake_install_test.sh3
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh1
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh1
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh1
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh3
-rw-r--r--grpc/third_party/abseil-cpp/ci/linux_docker_containers.sh6
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh1
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh1
-rwxr-xr-xgrpc/third_party/abseil-cpp/ci/macos_xcode_bazel.sh2
-rwxr-xr-xgrpc/third_party/abseil-cpp/create_lts.py24
-rw-r--r--grpc/third_party/address_sorting/address_sorting_posix.c1
-rw-r--r--grpc/third_party/android/BUILD3
-rw-r--r--grpc/third_party/android/android_configure.bzl62
-rw-r--r--grpc/third_party/cares/cares.BUILD159
-rw-r--r--grpc/third_party/cares/cares/.travis.yml51
-rw-r--r--grpc/third_party/cares/cares/CMakeLists.txt328
-rw-r--r--grpc/third_party/cares/cares/INSTALL.md6
-rw-r--r--grpc/third_party/cares/cares/Makefile.am204
-rw-r--r--grpc/third_party/cares/cares/Makefile.dj119
-rw-r--r--grpc/third_party/cares/cares/Makefile.inc250
-rw-r--r--grpc/third_party/cares/cares/Makefile.m3233
-rw-r--r--grpc/third_party/cares/cares/Makefile.msvc69
-rw-r--r--grpc/third_party/cares/cares/Makefile.netware6
-rw-r--r--grpc/third_party/cares/cares/README.md3
-rw-r--r--grpc/third_party/cares/cares/README.msvc44
-rw-r--r--grpc/third_party/cares/cares/RELEASE-NOTES108
-rw-r--r--grpc/third_party/cares/cares/RELEASE-PROCEDURE.md2
-rw-r--r--grpc/third_party/cares/cares/acountry.153
-rw-r--r--grpc/third_party/cares/cares/acountry.c621
-rw-r--r--grpc/third_party/cares/cares/adig.171
-rw-r--r--grpc/third_party/cares/cares/adig.c827
-rw-r--r--grpc/third_party/cares/cares/ahost.158
-rw-r--r--grpc/third_party/cares/cares/ahost.c206
-rw-r--r--grpc/third_party/cares/cares/appveyor.yml116
-rw-r--r--grpc/third_party/cares/cares/ares.h670
-rw-r--r--grpc/third_party/cares/cares/ares__close_sockets.c61
-rw-r--r--grpc/third_party/cares/cares/ares__get_hostent.c261
-rw-r--r--grpc/third_party/cares/cares/ares_android.c446
-rw-r--r--grpc/third_party/cares/cares/ares_config.h.cmake426
-rw-r--r--grpc/third_party/cares/cares/ares_create_query.c206
-rw-r--r--grpc/third_party/cares/cares/ares_data.c222
-rw-r--r--grpc/third_party/cares/cares/ares_data.h72
-rw-r--r--grpc/third_party/cares/cares/ares_dns.h103
-rw-r--r--grpc/third_party/cares/cares/ares_expand_name.c209
-rw-r--r--grpc/third_party/cares/cares/ares_expand_string.c70
-rw-r--r--grpc/third_party/cares/cares/ares_free_hostent.c41
-rw-r--r--grpc/third_party/cares/cares/ares_getenv.c30
-rw-r--r--grpc/third_party/cares/cares/ares_gethostbyaddr.c294
-rw-r--r--grpc/third_party/cares/cares/ares_gethostbyname.c529
-rw-r--r--grpc/third_party/cares/cares/ares_getnameinfo.c453
-rw-r--r--grpc/third_party/cares/cares/ares_init.c2615
-rw-r--r--grpc/third_party/cares/cares/ares_init_options.3295
-rw-r--r--grpc/third_party/cares/cares/ares_ipv6.h78
-rw-r--r--grpc/third_party/cares/cares/ares_library_init.c195
-rw-r--r--grpc/third_party/cares/cares/ares_library_init.h43
-rw-r--r--grpc/third_party/cares/cares/ares_library_init_android.3155
-rw-r--r--grpc/third_party/cares/cares/ares_parse_a_reply.378
-rw-r--r--grpc/third_party/cares/cares/ares_parse_a_reply.c264
-rw-r--r--grpc/third_party/cares/cares/ares_parse_aaaa_reply.378
-rw-r--r--grpc/third_party/cares/cares/ares_parse_aaaa_reply.c264
-rw-r--r--grpc/third_party/cares/cares/ares_parse_mx_reply.c170
-rw-r--r--grpc/third_party/cares/cares/ares_parse_naptr_reply.c194
-rw-r--r--grpc/third_party/cares/cares/ares_parse_ns_reply.c183
-rw-r--r--grpc/third_party/cares/cares/ares_parse_ptr_reply.c221
-rw-r--r--grpc/third_party/cares/cares/ares_parse_soa_reply.c133
-rw-r--r--grpc/third_party/cares/cares/ares_parse_srv_reply.c179
-rw-r--r--grpc/third_party/cares/cares/ares_parse_txt_reply.c220
-rw-r--r--grpc/third_party/cares/cares/ares_private.h382
-rw-r--r--grpc/third_party/cares/cares/ares_process.c1473
-rw-r--r--grpc/third_party/cares/cares/ares_query.c186
-rw-r--r--grpc/third_party/cares/cares/ares_search.c323
-rw-r--r--grpc/third_party/cares/cares/ares_send.c137
-rw-r--r--grpc/third_party/cares/cares/ares_set_local_ip4.334
-rw-r--r--grpc/third_party/cares/cares/ares_set_local_ip6.334
-rw-r--r--grpc/third_party/cares/cares/ares_setup.h217
-rw-r--r--grpc/third_party/cares/cares/ares_strsplit.c174
-rw-r--r--grpc/third_party/cares/cares/ares_version.h24
-rwxr-xr-xgrpc/third_party/cares/cares/buildconf297
-rw-r--r--grpc/third_party/cares/cares/buildconf.bat4
-rw-r--r--grpc/third_party/cares/cares/c-ares-config.cmake.in1
-rw-r--r--grpc/third_party/cares/cares/cares.rc65
-rw-r--r--grpc/third_party/cares/cares/config-dos.h108
-rw-r--r--grpc/third_party/cares/cares/configure.ac119
-rw-r--r--grpc/third_party/cares/cares/docs/CMakeLists.txt17
-rw-r--r--grpc/third_party/cares/cares/docs/Makefile.am11
-rw-r--r--grpc/third_party/cares/cares/docs/Makefile.inc58
-rw-r--r--grpc/third_party/cares/cares/docs/acountry.154
-rw-r--r--grpc/third_party/cares/cares/docs/adig.185
-rw-r--r--grpc/third_party/cares/cares/docs/ahost.159
-rw-r--r--grpc/third_party/cares/cares/docs/ares_cancel.3 (renamed from grpc/third_party/cares/cares/ares_cancel.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_create_query.3 (renamed from grpc/third_party/cares/cares/ares_create_query.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_destroy.3 (renamed from grpc/third_party/cares/cares/ares_destroy.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_destroy_options.3 (renamed from grpc/third_party/cares/cares/ares_destroy_options.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_dup.3 (renamed from grpc/third_party/cares/cares/ares_dup.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_expand_name.3 (renamed from grpc/third_party/cares/cares/ares_expand_name.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_expand_string.3 (renamed from grpc/third_party/cares/cares/ares_expand_string.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_fds.3 (renamed from grpc/third_party/cares/cares/ares_fds.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_free_data.3 (renamed from grpc/third_party/cares/cares/ares_free_data.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_free_hostent.3 (renamed from grpc/third_party/cares/cares/ares_free_hostent.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_free_string.3 (renamed from grpc/third_party/cares/cares/ares_free_string.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_freeaddrinfo.337
-rw-r--r--grpc/third_party/cares/cares/docs/ares_get_servers.3 (renamed from grpc/third_party/cares/cares/ares_get_servers.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_get_servers_ports.3 (renamed from grpc/third_party/cares/cares/ares_get_servers_ports.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_getaddrinfo.3195
-rw-r--r--grpc/third_party/cares/cares/docs/ares_gethostbyaddr.3 (renamed from grpc/third_party/cares/cares/ares_gethostbyaddr.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_gethostbyname.3 (renamed from grpc/third_party/cares/cares/ares_gethostbyname.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_gethostbyname_file.3 (renamed from grpc/third_party/cares/cares/ares_gethostbyname_file.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_getnameinfo.3 (renamed from grpc/third_party/cares/cares/ares_getnameinfo.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_getsock.3 (renamed from grpc/third_party/cares/cares/ares_getsock.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_inet_ntop.3 (renamed from grpc/third_party/cares/cares/ares_inet_ntop.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_inet_pton.3 (renamed from grpc/third_party/cares/cares/ares_inet_pton.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_init.3 (renamed from grpc/third_party/cares/cares/ares_init.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_init_options.3295
-rw-r--r--grpc/third_party/cares/cares/docs/ares_library_cleanup.3 (renamed from grpc/third_party/cares/cares/ares_library_cleanup.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_library_init.3 (renamed from grpc/third_party/cares/cares/ares_library_init.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_library_init_android.3142
-rw-r--r--grpc/third_party/cares/cares/docs/ares_library_initialized.3 (renamed from grpc/third_party/cares/cares/ares_library_initialized.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_mkquery.3 (renamed from grpc/third_party/cares/cares/ares_mkquery.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_a_reply.380
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_aaaa_reply.380
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_caa_reply.3171
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_mx_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_mx_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_naptr_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_naptr_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_ns_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_ns_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_ptr_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_ptr_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_soa_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_soa_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_srv_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_srv_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_parse_txt_reply.3 (renamed from grpc/third_party/cares/cares/ares_parse_txt_reply.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_process.3 (renamed from grpc/third_party/cares/cares/ares_process.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_query.3 (renamed from grpc/third_party/cares/cares/ares_query.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_save_options.3 (renamed from grpc/third_party/cares/cares/ares_save_options.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_search.3 (renamed from grpc/third_party/cares/cares/ares_search.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_send.3 (renamed from grpc/third_party/cares/cares/ares_send.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_local_dev.3 (renamed from grpc/third_party/cares/cares/ares_set_local_dev.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_local_ip4.334
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_local_ip6.335
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_servers.3 (renamed from grpc/third_party/cares/cares/ares_set_servers.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_servers_csv.3 (renamed from grpc/third_party/cares/cares/ares_set_servers_csv.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_servers_ports.3 (renamed from grpc/third_party/cares/cares/ares_set_servers_ports.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_servers_ports_csv.3 (renamed from grpc/third_party/cares/cares/ares_set_servers_ports_csv.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_socket_callback.3 (renamed from grpc/third_party/cares/cares/ares_set_socket_callback.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_socket_configure_callback.3 (renamed from grpc/third_party/cares/cares/ares_set_socket_configure_callback.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_socket_functions.3 (renamed from grpc/third_party/cares/cares/ares_set_socket_functions.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_set_sortlist.3 (renamed from grpc/third_party/cares/cares/ares_set_sortlist.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_strerror.3 (renamed from grpc/third_party/cares/cares/ares_strerror.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_timeout.3 (renamed from grpc/third_party/cares/cares/ares_timeout.3)0
-rw-r--r--grpc/third_party/cares/cares/docs/ares_version.3 (renamed from grpc/third_party/cares/cares/ares_version.3)0
-rw-r--r--grpc/third_party/cares/cares/include/CMakeLists.txt8
-rw-r--r--grpc/third_party/cares/cares/include/Makefile.am7
-rw-r--r--grpc/third_party/cares/cares/include/ares.h742
-rw-r--r--grpc/third_party/cares/cares/include/ares_build.h.cmake (renamed from grpc/third_party/cares/cares/ares_build.h.cmake)0
-rw-r--r--grpc/third_party/cares/cares/include/ares_build.h.dist (renamed from grpc/third_party/cares/cares/ares_build.h.dist)0
-rw-r--r--grpc/third_party/cares/cares/include/ares_build.h.in (renamed from grpc/third_party/cares/cares/ares_build.h.in)0
-rw-r--r--grpc/third_party/cares/cares/include/ares_dns.h112
-rw-r--r--grpc/third_party/cares/cares/include/ares_rules.h (renamed from grpc/third_party/cares/cares/ares_rules.h)0
-rw-r--r--grpc/third_party/cares/cares/include/ares_version.h24
-rw-r--r--grpc/third_party/cares/cares/inet_net_pton.c450
-rw-r--r--grpc/third_party/cares/cares/inet_ntop.c207
-rw-r--r--grpc/third_party/cares/cares/m4/ax_code_coverage.m42
-rw-r--r--grpc/third_party/cares/cares/m4/cares-compilers.m491
-rw-r--r--grpc/third_party/cares/cares/m4/cares-confopts.m440
-rw-r--r--grpc/third_party/cares/cares/m4/cares-functions.m4140
-rw-r--r--grpc/third_party/cares/cares/m4/xc-cc-check.m42
-rwxr-xr-xgrpc/third_party/cares/cares/maketgz12
-rw-r--r--grpc/third_party/cares/cares/nameser.h211
-rw-r--r--grpc/third_party/cares/cares/src/CMakeLists.txt2
-rw-r--r--grpc/third_party/cares/cares/src/Makefile.am2
-rw-r--r--grpc/third_party/cares/cares/src/lib/CMakeLists.txt115
-rw-r--r--grpc/third_party/cares/cares/src/lib/Makefile.am73
-rw-r--r--grpc/third_party/cares/cares/src/lib/Makefile.inc79
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__close_sockets.c61
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__get_hostent.c260
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c260
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__read_line.c (renamed from grpc/third_party/cares/cares/ares__read_line.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__readaddrinfo.c264
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__sortaddrinfo.c499
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares__timeval.c (renamed from grpc/third_party/cares/cares/ares__timeval.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_android.c444
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_android.h (renamed from grpc/third_party/cares/cares/ares_android.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_cancel.c (renamed from grpc/third_party/cares/cares/ares_cancel.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_config.h.cmake432
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_create_query.c197
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_data.c240
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_data.h74
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_destroy.c (renamed from grpc/third_party/cares/cares/ares_destroy.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_expand_name.c300
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_expand_string.c67
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_fds.c (renamed from grpc/third_party/cares/cares/ares_fds.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_free_hostent.c43
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_free_string.c (renamed from grpc/third_party/cares/cares/ares_free_string.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_freeaddrinfo.c59
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_getaddrinfo.c772
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_getenv.c28
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_getenv.h (renamed from grpc/third_party/cares/cares/ares_getenv.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_gethostbyaddr.c287
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_gethostbyname.c534
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_getnameinfo.c447
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_getsock.c (renamed from grpc/third_party/cares/cares/ares_getsock.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_inet_net_pton.h (renamed from grpc/third_party/cares/cares/ares_inet_net_pton.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_init.c2654
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_iphlpapi.h (renamed from grpc/third_party/cares/cares/ares_iphlpapi.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_ipv6.h85
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_library_init.c200
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_library_init.h43
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_llist.c (renamed from grpc/third_party/cares/cares/ares_llist.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_llist.h (renamed from grpc/third_party/cares/cares/ares_llist.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_mkquery.c (renamed from grpc/third_party/cares/cares/ares_mkquery.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_nameser.h482
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_nowarn.c (renamed from grpc/third_party/cares/cares/ares_nowarn.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_nowarn.h (renamed from grpc/third_party/cares/cares/ares_nowarn.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_options.c (renamed from grpc/third_party/cares/cares/ares_options.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_a_reply.c209
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c212
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_caa_reply.c199
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_mx_reply.c164
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c183
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_ns_reply.c177
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c228
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_soa_reply.c179
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_srv_reply.c168
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_parse_txt_reply.c214
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_platform.c (renamed from grpc/third_party/cares/cares/ares_platform.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_platform.h (renamed from grpc/third_party/cares/cares/ares_platform.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_private.h423
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_process.c1548
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_query.c180
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_search.c321
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_send.c131
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_setup.h220
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strcasecmp.c (renamed from grpc/third_party/cares/cares/ares_strcasecmp.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strcasecmp.h (renamed from grpc/third_party/cares/cares/ares_strcasecmp.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strdup.c (renamed from grpc/third_party/cares/cares/ares_strdup.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strdup.h (renamed from grpc/third_party/cares/cares/ares_strdup.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strerror.c (renamed from grpc/third_party/cares/cares/ares_strerror.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strsplit.c178
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_strsplit.h (renamed from grpc/third_party/cares/cares/ares_strsplit.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_timeout.c (renamed from grpc/third_party/cares/cares/ares_timeout.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_version.c (renamed from grpc/third_party/cares/cares/ares_version.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_writev.c (renamed from grpc/third_party/cares/cares/ares_writev.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/ares_writev.h (renamed from grpc/third_party/cares/cares/ares_writev.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/bitncmp.c (renamed from grpc/third_party/cares/cares/bitncmp.c)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/bitncmp.h (renamed from grpc/third_party/cares/cares/bitncmp.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/cares.rc65
-rw-r--r--grpc/third_party/cares/cares/src/lib/config-dos.h115
-rw-r--r--grpc/third_party/cares/cares/src/lib/config-win32.h (renamed from grpc/third_party/cares/cares/config-win32.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/inet_net_pton.c444
-rw-r--r--grpc/third_party/cares/cares/src/lib/inet_ntop.c201
-rw-r--r--grpc/third_party/cares/cares/src/lib/setup_once.h (renamed from grpc/third_party/cares/cares/setup_once.h)0
-rw-r--r--grpc/third_party/cares/cares/src/lib/windows_port.c (renamed from grpc/third_party/cares/cares/windows_port.c)0
-rw-r--r--grpc/third_party/cares/cares/src/tools/CMakeLists.txt55
-rw-r--r--grpc/third_party/cares/cares/src/tools/Makefile.am36
-rw-r--r--grpc/third_party/cares/cares/src/tools/Makefile.inc7
-rw-r--r--grpc/third_party/cares/cares/src/tools/acountry.c652
-rw-r--r--grpc/third_party/cares/cares/src/tools/adig.c970
-rw-r--r--grpc/third_party/cares/cares/src/tools/ahost.c231
-rw-r--r--grpc/third_party/cares/cares/src/tools/ares_getopt.c (renamed from grpc/third_party/cares/cares/ares_getopt.c)0
-rw-r--r--grpc/third_party/cares/cares/src/tools/ares_getopt.h (renamed from grpc/third_party/cares/cares/ares_getopt.h)0
-rw-r--r--grpc/third_party/cares/cares/test/CMakeLists.txt23
-rw-r--r--grpc/third_party/cares/cares/test/Makefile.am47
-rw-r--r--grpc/third_party/cares/cares/test/Makefile.inc6
-rw-r--r--grpc/third_party/cares/cares/test/Makefile.m3212
-rw-r--r--grpc/third_party/cares/cares/test/Makefile.msvc4
-rw-r--r--grpc/third_party/cares/cares/test/README.md20
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-ai.h57
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-fuzz-name.c4
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-fuzz.c4
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-init.cc18
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-internal.cc111
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-live.cc140
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-misc.cc60
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-mock-ai.cc777
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-mock.cc345
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-a.cc58
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-aaaa.cc23
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-caa.cc113
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-mx.cc16
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-naptr.cc16
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-ns.cc18
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-ptr.cc26
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-soa-any.cc111
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-soa.cc18
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-srv.cc24
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse-txt.cc18
-rw-r--r--grpc/third_party/cares/cares/test/ares-test-parse.cc5
-rw-r--r--grpc/third_party/cares/cares/test/ares-test.cc128
-rw-r--r--grpc/third_party/cares/cares/test/ares-test.h73
-rw-r--r--grpc/third_party/cares/cares/test/dns-proto-test.cc8
-rw-r--r--grpc/third_party/cares/cares/test/dns-proto.cc184
-rw-r--r--grpc/third_party/cares/cares/test/dns-proto.h60
-rwxr-xr-xgrpc/third_party/cares/cares/test/fuzzcheck.sh1
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5637790584012800bin0 -> 40 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5650695891451904bin0 -> 32 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5651369832218624bin0 -> 242 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5674462260756480bin0 -> 1682 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5680630672654336bin0 -> 1965 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5683497160671232bin0 -> 52526 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5687310655422464bin0 -> 789 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5695341573177344bin0 -> 44 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5697835103682560bin0 -> 251 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5728518081609728bin0 -> 922 bytes
-rw-r--r--grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5732960017317888bin0 -> 207725 bytes
-rwxr-xr-xgrpc/third_party/cares/cares/travis/build.sh21
-rwxr-xr-xgrpc/third_party/cares/cares/travis/covupload.sh2
-rwxr-xr-xgrpc/third_party/cares/cares/travis/distcheck.sh19
-rwxr-xr-xgrpc/third_party/cares/cares/travis/test.sh55
-rw-r--r--grpc/third_party/cares/cares/vc/cares/vc6cares.dsp453
-rw-r--r--grpc/third_party/cares/cares/vc/cares/vc6cares.dsw29
-rw-r--r--grpc/third_party/cares/cares/vc/vc6aws.dsw74
-rw-r--r--grpc/third_party/istio/security/proto/providers/google/meshca.proto51
-rw-r--r--grpc/third_party/libprotobuf_mutator.BUILD30
-rw-r--r--grpc/third_party/libuv.BUILD212
-rw-r--r--grpc/third_party/protobuf.patch2
-rw-r--r--grpc/third_party/protoc-gen-validate.patch14
-rw-r--r--grpc/third_party/py/BUILD.tpl7
-rw-r--r--grpc/third_party/py/python_configure.bzl38
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_arm64-darwin/Dockerfile1
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile16
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_x86-linux/Dockerfile16
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile16
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_x86_64-darwin/Dockerfile1
-rw-r--r--grpc/third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile16
-rwxr-xr-xgrpc/third_party/re2/.github/bazel.sh24
-rwxr-xr-xgrpc/third_party/re2/.github/cmake.sh12
-rw-r--r--grpc/third_party/re2/.github/workflows/ci-bazel.yml17
-rw-r--r--grpc/third_party/re2/.github/workflows/ci-cmake.yml15
-rw-r--r--grpc/third_party/re2/.github/workflows/ci.yml51
-rw-r--r--grpc/third_party/re2/.travis.yml210
-rw-r--r--grpc/third_party/re2/BUILD18
-rw-r--r--grpc/third_party/re2/CMakeLists.txt29
-rw-r--r--grpc/third_party/re2/Makefile6
-rw-r--r--grpc/third_party/re2/README8
-rw-r--r--grpc/third_party/re2/SECURITY.md4
-rw-r--r--grpc/third_party/re2/WORKSPACE4
-rwxr-xr-xgrpc/third_party/re2/doc/mksyntaxgo3
-rwxr-xr-xgrpc/third_party/re2/kokoro/bazel.sh38
-rwxr-xr-xgrpc/third_party/re2/kokoro/cmake.sh27
-rw-r--r--grpc/third_party/re2/kokoro/macos-bazel.cfg1
-rwxr-xr-xgrpc/third_party/re2/kokoro/macos-bazel.sh4
-rw-r--r--grpc/third_party/re2/kokoro/macos-cmake.cfg1
-rwxr-xr-xgrpc/third_party/re2/kokoro/macos-cmake.sh4
-rw-r--r--grpc/third_party/re2/kokoro/ubuntu-bazel.cfg1
-rwxr-xr-xgrpc/third_party/re2/kokoro/ubuntu-bazel.sh4
-rw-r--r--grpc/third_party/re2/kokoro/ubuntu-cmake.cfg1
-rwxr-xr-xgrpc/third_party/re2/kokoro/ubuntu-cmake.sh4
-rwxr-xr-xgrpc/third_party/re2/kokoro/windows-bazel.bat2
-rw-r--r--grpc/third_party/re2/kokoro/windows-bazel.cfg1
-rwxr-xr-xgrpc/third_party/re2/kokoro/windows-cmake.bat2
-rw-r--r--grpc/third_party/re2/kokoro/windows-cmake.cfg1
-rw-r--r--grpc/third_party/re2/libre2.symbols3
-rw-r--r--grpc/third_party/re2/libre2.symbols.darwin3
-rw-r--r--grpc/third_party/re2/re2/compile.cc200
-rw-r--r--grpc/third_party/re2/re2/dfa.cc66
-rw-r--r--grpc/third_party/re2/re2/filtered_re2.cc20
-rw-r--r--grpc/third_party/re2/re2/filtered_re2.h15
-rw-r--r--grpc/third_party/re2/re2/fuzzing/re2_fuzzer.cc5
-rwxr-xr-xgrpc/third_party/re2/re2/make_perl_groups.pl2
-rw-r--r--grpc/third_party/re2/re2/nfa.cc2
-rw-r--r--grpc/third_party/re2/re2/parse.cc65
-rw-r--r--grpc/third_party/re2/re2/perl_groups.cc68
-rw-r--r--grpc/third_party/re2/re2/prefilter.cc5
-rw-r--r--grpc/third_party/re2/re2/prog.cc186
-rw-r--r--grpc/third_party/re2/re2/prog.h37
-rw-r--r--grpc/third_party/re2/re2/re2.cc205
-rw-r--r--grpc/third_party/re2/re2/re2.h297
-rw-r--r--grpc/third_party/re2/re2/regexp.cc17
-rw-r--r--grpc/third_party/re2/re2/regexp.h10
-rw-r--r--grpc/third_party/re2/re2/set.cc40
-rw-r--r--grpc/third_party/re2/re2/set.h13
-rw-r--r--grpc/third_party/re2/re2/simplify.cc14
-rw-r--r--grpc/third_party/re2/re2/testing/charclass_test.cc4
-rw-r--r--grpc/third_party/re2/re2/testing/compile_test.cc66
-rw-r--r--grpc/third_party/re2/re2/testing/dfa_test.cc8
-rw-r--r--grpc/third_party/re2/re2/testing/filtered_re2_test.cc46
-rw-r--r--grpc/third_party/re2/re2/testing/parse_test.cc1
-rw-r--r--grpc/third_party/re2/re2/testing/re2_arg_test.cc25
-rw-r--r--grpc/third_party/re2/re2/testing/re2_test.cc94
-rw-r--r--grpc/third_party/re2/re2/testing/regexp_benchmark.cc229
-rw-r--r--grpc/third_party/re2/re2/testing/required_prefix_test.cc102
-rw-r--r--grpc/third_party/re2/re2/testing/search_test.cc2
-rw-r--r--grpc/third_party/re2/re2/testing/set_test.cc26
-rw-r--r--grpc/third_party/re2/re2/testing/tester.cc19
-rw-r--r--grpc/third_party/re2/re2/tostring.cc2
-rw-r--r--grpc/third_party/re2/re2/walker-inl.h2
-rw-r--r--grpc/third_party/re2/testinstall.cc35
-rw-r--r--grpc/third_party/re2/util/mutex.h4
-rw-r--r--grpc/third_party/re2/util/pcre.h6
-rw-r--r--grpc/third_party/rules_python.patch76
-rw-r--r--grpc/third_party/six.BUILD2
-rw-r--r--grpc/third_party/toolchains/BUILD21
-rw-r--r--grpc/third_party/upb/.bazelci/presubmit.yml4
-rw-r--r--grpc/third_party/upb/.bazelignore1
-rw-r--r--grpc/third_party/upb/.bazelrc40
-rw-r--r--grpc/third_party/upb/.clang-format3
-rw-r--r--grpc/third_party/upb/.github/workflows/bazel_tests.yml38
-rw-r--r--grpc/third_party/upb/.github/workflows/cifuzz.yml29
-rw-r--r--grpc/third_party/upb/.github/workflows/clang_format.yml20
-rw-r--r--grpc/third_party/upb/.github/workflows/generate_files.yml20
-rw-r--r--grpc/third_party/upb/.gitignore4
-rw-r--r--grpc/third_party/upb/BUILD464
-rw-r--r--grpc/third_party/upb/CONTRIBUTING.md42
-rw-r--r--grpc/third_party/upb/DESIGN.md271
-rw-r--r--grpc/third_party/upb/LICENSE6
-rw-r--r--grpc/third_party/upb/README.md172
-rw-r--r--grpc/third_party/upb/WORKSPACE54
-rw-r--r--grpc/third_party/upb/bazel/BUILD53
-rwxr-xr-xgrpc/third_party/upb/bazel/amalgamate.py129
-rw-r--r--grpc/third_party/upb/bazel/build_defs.bzl92
-rw-r--r--grpc/third_party/upb/bazel/lua.BUILD25
-rw-r--r--grpc/third_party/upb/bazel/protobuf.patch89
-rw-r--r--grpc/third_party/upb/bazel/py_extension.bzl38
-rw-r--r--grpc/third_party/upb/bazel/py_proto_library.bzl137
-rw-r--r--grpc/third_party/upb/bazel/pyproto_test_wrapper.bzl35
-rw-r--r--grpc/third_party/upb/bazel/ragel.BUILD195
-rw-r--r--grpc/third_party/upb/bazel/upb_proto_library.bzl56
-rw-r--r--grpc/third_party/upb/bazel/workspace_defs.bzl87
-rw-r--r--grpc/third_party/upb/bazel/workspace_deps.bzl44
-rw-r--r--grpc/third_party/upb/benchmarks/BUILD180
-rw-r--r--grpc/third_party/upb/benchmarks/BUILD.googleapis27
-rw-r--r--grpc/third_party/upb/benchmarks/benchmark.cc205
-rw-r--r--grpc/third_party/upb/benchmarks/build_defs.bzl53
-rwxr-xr-xgrpc/third_party/upb/benchmarks/compare.py47
-rw-r--r--grpc/third_party/upb/benchmarks/descriptor.proto19
-rw-r--r--grpc/third_party/upb/benchmarks/gen_protobuf_binary_cc.py26
-rw-r--r--grpc/third_party/upb/benchmarks/gen_synthetic_protos.py26
-rw-r--r--grpc/third_party/upb/benchmarks/gen_upb_binary_c.py28
-rw-r--r--grpc/third_party/upb/cmake/BUILD91
-rw-r--r--grpc/third_party/upb/cmake/BUILD.bazel102
-rw-r--r--grpc/third_party/upb/cmake/CMakeLists.txt165
-rw-r--r--grpc/third_party/upb/cmake/build_defs.bzl32
-rw-r--r--grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.c486
-rw-r--r--grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.h1885
-rwxr-xr-xgrpc/third_party/upb/cmake/make_cmakelists.py75
-rw-r--r--grpc/third_party/upb/cmake/staleness_test.py27
-rw-r--r--grpc/third_party/upb/cmake/staleness_test_lib.py27
-rw-r--r--grpc/third_party/upb/cmake/upb/json/parser.c3433
-rwxr-xr-xgrpc/third_party/upb/docs/render.py43
-rw-r--r--grpc/third_party/upb/docs/vs-cpp-protos.md254
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb.in.md372
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb.md260
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb/1.svg43
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb/2.svg48
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb/3.svg65
-rw-r--r--grpc/third_party/upb/docs/wrapping-upb/4.svg138
-rw-r--r--grpc/third_party/upb/examples/bazel/BUILD21
-rw-r--r--grpc/third_party/upb/examples/bazel/WORKSPACE13
-rw-r--r--grpc/third_party/upb/examples/bazel/foo.proto7
-rw-r--r--grpc/third_party/upb/examples/bazel/test_binary.c17
-rw-r--r--grpc/third_party/upb/kokoro/ubuntu/build.sh50
-rw-r--r--grpc/third_party/upb/kokoro/ubuntu/continuous.cfg2
-rw-r--r--grpc/third_party/upb/kokoro/ubuntu/presubmit.cfg2
-rw-r--r--grpc/third_party/upb/python/BUILD164
-rw-r--r--grpc/third_party/upb/python/api_implementation.c50
-rw-r--r--grpc/third_party/upb/python/convert.c394
-rw-r--r--grpc/third_party/upb/python/convert.h63
-rw-r--r--grpc/third_party/upb/python/descriptor.c1686
-rw-r--r--grpc/third_party/upb/python/descriptor.h80
-rw-r--r--grpc/third_party/upb/python/descriptor_containers.c704
-rw-r--r--grpc/third_party/upb/python/descriptor_containers.h114
-rw-r--r--grpc/third_party/upb/python/descriptor_pool.c643
-rw-r--r--grpc/third_party/upb/python/descriptor_pool.h48
-rw-r--r--grpc/third_party/upb/python/extension_dict.c247
-rw-r--r--grpc/third_party/upb/python/extension_dict.h39
-rw-r--r--grpc/third_party/upb/python/map.c506
-rw-r--r--grpc/third_party/upb/python/map.h66
-rw-r--r--grpc/third_party/upb/python/message.c1860
-rw-r--r--grpc/third_party/upb/python/message.h101
-rw-r--r--grpc/third_party/upb/python/minimal_test.py183
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/BUILD64
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/README.md11
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py48
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py46
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py37
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/message_test_wrapper.py57
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py32
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py47
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py40
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py40
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py30
-rw-r--r--grpc/third_party/upb/python/protobuf.c348
-rw-r--r--grpc/third_party/upb/python/protobuf.h227
-rw-r--r--grpc/third_party/upb/python/python.h42
-rw-r--r--grpc/third_party/upb/python/repeated.c816
-rw-r--r--grpc/third_party/upb/python/repeated.h69
-rw-r--r--grpc/third_party/upb/python/version_script.lds6
-rw-r--r--grpc/third_party/upb/tests/BUILD283
-rw-r--r--grpc/third_party/upb/tests/bindings/lua/BUILD68
-rw-r--r--grpc/third_party/upb/tests/bindings/lua/main.c58
-rw-r--r--grpc/third_party/upb/tests/bindings/lua/test.proto28
-rw-r--r--grpc/third_party/upb/tests/bindings/lua/test_upb.lua751
-rw-r--r--grpc/third_party/upb/tests/conformance_upb.c303
-rw-r--r--grpc/third_party/upb/tests/conformance_upb_failures.txt1
-rw-r--r--grpc/third_party/upb/tests/corpus/README1
-rw-r--r--grpc/third_party/upb/tests/corpus/temp.cc1
-rw-r--r--grpc/third_party/upb/tests/empty.proto2
-rw-r--r--grpc/third_party/upb/tests/file_descriptor_parsenew_fuzzer.cc15
-rw-r--r--grpc/third_party/upb/tests/json/enum_from_separate_file.proto9
-rw-r--r--grpc/third_party/upb/tests/json/test.proto47
-rw-r--r--grpc/third_party/upb/tests/json/test.proto.pbbin1958 -> 0 bytes
-rw-r--r--grpc/third_party/upb/tests/json/test_json.cc336
-rw-r--r--grpc/third_party/upb/tests/pb/test_decoder.cc1194
-rw-r--r--grpc/third_party/upb/tests/pb/test_decoder.proto128
-rw-r--r--grpc/third_party/upb/tests/pb/test_encoder.cc102
-rw-r--r--grpc/third_party/upb/tests/test.proto8
-rw-r--r--grpc/third_party/upb/tests/test_cpp.cc1021
-rw-r--r--grpc/third_party/upb/tests/test_cpp.proto12
-rw-r--r--grpc/third_party/upb/tests/test_generated_code.c423
-rw-r--r--grpc/third_party/upb/tests/test_table.cc690
-rw-r--r--grpc/third_party/upb/tests/test_util.h230
-rw-r--r--grpc/third_party/upb/tests/testmain.cc16
-rw-r--r--grpc/third_party/upb/tests/upb_test.h53
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/BUILD19
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/LICENSE21
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/naive.c92
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/range2-neon.c157
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/range2-sse.c170
-rw-r--r--grpc/third_party/upb/third_party/utf8_range/utf8_range.h9
-rw-r--r--grpc/third_party/upb/third_party/wyhash/BUILD17
-rw-r--r--grpc/third_party/upb/third_party/wyhash/LICENSE25
-rw-r--r--grpc/third_party/upb/third_party/wyhash/wyhash.h145
-rwxr-xr-xgrpc/third_party/upb/tools/amalgamate.py92
-rw-r--r--grpc/third_party/upb/upb/bindings/README5
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/BUILD88
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/README.md8
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/def.c927
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/lua_proto_library.bzl29
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/main.c83
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/msg.c724
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/test.proto69
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/test_upb.lua846
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/upb.c154
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/upb.h110
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/upb.lua28
-rw-r--r--grpc/third_party/upb/upb/bindings/lua/upbc.cc43
-rw-r--r--grpc/third_party/upb/upb/conformance_upb.c346
-rw-r--r--grpc/third_party/upb/upb/conformance_upb_failures.txt1
-rw-r--r--grpc/third_party/upb/upb/decode.c1125
-rw-r--r--grpc/third_party/upb/upb/decode.h78
-rw-r--r--grpc/third_party/upb/upb/decode.int.h163
-rw-r--r--grpc/third_party/upb/upb/decode_fast.c1177
-rw-r--r--grpc/third_party/upb/upb/decode_fast.h53
-rw-r--r--grpc/third_party/upb/upb/decode_internal.h211
-rw-r--r--grpc/third_party/upb/upb/def.c3219
-rw-r--r--grpc/third_party/upb/upb/def.h610
-rw-r--r--grpc/third_party/upb/upb/def.hpp321
-rw-r--r--grpc/third_party/upb/upb/empty.proto1
-rw-r--r--grpc/third_party/upb/upb/encode.c456
-rw-r--r--grpc/third_party/upb/upb/encode.h51
-rw-r--r--grpc/third_party/upb/upb/fuzz/BUILD13
-rw-r--r--grpc/third_party/upb/upb/fuzz/file_descriptor_parsenew_fuzzer.cc43
-rw-r--r--grpc/third_party/upb/upb/handlers-inl.h923
-rw-r--r--grpc/third_party/upb/upb/handlers.c545
-rw-r--r--grpc/third_party/upb/upb/handlers.h735
-rw-r--r--grpc/third_party/upb/upb/json/parser.h140
-rw-r--r--grpc/third_party/upb/upb/json/parser.rl2996
-rw-r--r--grpc/third_party/upb/upb/json/printer.c1396
-rw-r--r--grpc/third_party/upb/upb/json/printer.h72
-rw-r--r--grpc/third_party/upb/upb/json_decode.c662
-rw-r--r--grpc/third_party/upb/upb/json_decode.h40
-rw-r--r--grpc/third_party/upb/upb/json_encode.c471
-rw-r--r--grpc/third_party/upb/upb/json_encode.h40
-rw-r--r--grpc/third_party/upb/upb/mini_table.c1070
-rw-r--r--grpc/third_party/upb/upb/mini_table.h172
-rw-r--r--grpc/third_party/upb/upb/mini_table.hpp99
-rw-r--r--grpc/third_party/upb/upb/mini_table_test.cc182
-rw-r--r--grpc/third_party/upb/upb/msg.c376
-rw-r--r--grpc/third_party/upb/upb/msg.h665
-rw-r--r--grpc/third_party/upb/upb/msg_internal.h831
-rw-r--r--grpc/third_party/upb/upb/msg_test.cc429
-rw-r--r--grpc/third_party/upb/upb/msg_test.proto181
-rw-r--r--grpc/third_party/upb/upb/pb/compile_decoder.c919
-rw-r--r--grpc/third_party/upb/upb/pb/decoder.c1047
-rw-r--r--grpc/third_party/upb/upb/pb/decoder.h242
-rw-r--r--grpc/third_party/upb/upb/pb/decoder.int.h288
-rw-r--r--grpc/third_party/upb/upb/pb/encoder.c563
-rw-r--r--grpc/third_party/upb/upb/pb/encoder.h83
-rwxr-xr-xgrpc/third_party/upb/upb/pb/make-gdb-script.rb36
-rw-r--r--grpc/third_party/upb/upb/pb/textprinter.c339
-rw-r--r--grpc/third_party/upb/upb/pb/textprinter.h69
-rw-r--r--grpc/third_party/upb/upb/pb/varint.c74
-rw-r--r--grpc/third_party/upb/upb/pb/varint.int.h164
-rw-r--r--grpc/third_party/upb/upb/port_def.inc117
-rw-r--r--grpc/third_party/upb/upb/port_undef.inc40
-rw-r--r--grpc/third_party/upb/upb/reflection.c552
-rw-r--r--grpc/third_party/upb/upb/reflection.h186
-rw-r--r--grpc/third_party/upb/upb/reflection.hpp37
-rw-r--r--grpc/third_party/upb/upb/sink.c17
-rw-r--r--grpc/third_party/upb/upb/sink.h517
-rw-r--r--grpc/third_party/upb/upb/table.c603
-rw-r--r--grpc/third_party/upb/upb/table.int.h475
-rw-r--r--grpc/third_party/upb/upb/table_internal.h385
-rw-r--r--grpc/third_party/upb/upb/test.proto48
-rw-r--r--grpc/third_party/upb/upb/test_cpp.cc186
-rw-r--r--grpc/third_party/upb/upb/test_cpp.proto12
-rw-r--r--grpc/third_party/upb/upb/test_generated_code.cc977
-rw-r--r--grpc/third_party/upb/upb/test_table.cc580
-rw-r--r--grpc/third_party/upb/upb/text_encode.c231
-rw-r--r--grpc/third_party/upb/upb/text_encode.h36
-rw-r--r--grpc/third_party/upb/upb/upb.c230
-rw-r--r--grpc/third_party/upb/upb/upb.h328
-rw-r--r--grpc/third_party/upb/upb/upb.hpp73
-rw-r--r--grpc/third_party/upb/upb/upb.int.h29
-rw-r--r--grpc/third_party/upb/upb/upb_internal.h68
-rw-r--r--grpc/third_party/upb/upb/util/BUILD121
-rw-r--r--grpc/third_party/upb/upb/util/README.md7
-rw-r--r--grpc/third_party/upb/upb/util/compare.c300
-rw-r--r--grpc/third_party/upb/upb/util/compare.h66
-rw-r--r--grpc/third_party/upb/upb/util/compare_test.cc236
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto.c558
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto.h62
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_public_import_test.proto32
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_regular_import_test.proto36
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_test.cc143
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_test.proto119
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_weak_import_test.proto28
-rw-r--r--grpc/third_party/upb/upb/util/def_to_proto_wweak_import_test.proto28
-rw-r--r--grpc/third_party/upb/upb/util/required_fields.c311
-rw-r--r--grpc/third_party/upb/upb/util/required_fields.h94
-rw-r--r--grpc/third_party/upb/upb/util/required_fields_test.cc202
-rw-r--r--grpc/third_party/upb/upb/util/required_fields_test.proto48
-rw-r--r--grpc/third_party/upb/upbc/BUILD39
-rw-r--r--grpc/third_party/upb/upbc/common.cc54
-rw-r--r--grpc/third_party/upb/upbc/common.h58
-rw-r--r--grpc/third_party/upb/upbc/message_layout.cc194
-rw-r--r--grpc/third_party/upb/upbc/message_layout.h124
-rw-r--r--grpc/third_party/upb/upbc/protoc-gen-upb.cc1938
-rw-r--r--grpc/third_party/upb/upbc/protoc-gen-upbdefs.cc78
-rw-r--r--grpc/third_party/xxhash/.gitattributes10
-rw-r--r--grpc/third_party/xxhash/.gitignore47
-rw-r--r--grpc/third_party/xxhash/.travis.yml138
-rw-r--r--grpc/third_party/xxhash/CHANGELOG52
-rw-r--r--grpc/third_party/xxhash/Doxyfile58
-rw-r--r--grpc/third_party/xxhash/LICENSE22
-rw-r--r--grpc/third_party/xxhash/Makefile506
-rw-r--r--grpc/third_party/xxhash/README.md235
-rw-r--r--grpc/third_party/xxhash/appveyor.yml111
-rw-r--r--grpc/third_party/xxhash/cli/xsum_arch.h153
-rw-r--r--grpc/third_party/xxhash/cli/xsum_config.h205
-rw-r--r--grpc/third_party/xxhash/cli/xsum_os_specific.c487
-rw-r--r--grpc/third_party/xxhash/cli/xsum_os_specific.h89
-rw-r--r--grpc/third_party/xxhash/cli/xsum_output.c67
-rw-r--r--grpc/third_party/xxhash/cli/xsum_output.h62
-rw-r--r--grpc/third_party/xxhash/cli/xsum_sanity_check.c602
-rw-r--r--grpc/third_party/xxhash/cli/xsum_sanity_check.h60
-rw-r--r--grpc/third_party/xxhash/cmake_unofficial/.gitignore12
-rw-r--r--grpc/third_party/xxhash/cmake_unofficial/CMakeLists.txt173
-rw-r--r--grpc/third_party/xxhash/cmake_unofficial/README.md36
-rw-r--r--grpc/third_party/xxhash/cmake_unofficial/xxHashConfig.cmake.in4
-rw-r--r--grpc/third_party/xxhash/doc/README.md9
-rw-r--r--grpc/third_party/xxhash/doc/xxhash.cry206
-rw-r--r--grpc/third_party/xxhash/doc/xxhash_spec.md317
-rw-r--r--grpc/third_party/xxhash/libxxhash.pc.in15
-rw-r--r--grpc/third_party/xxhash/tests/Makefile83
-rw-r--r--grpc/third_party/xxhash/tests/bench/.gitignore11
-rw-r--r--grpc/third_party/xxhash/tests/bench/LICENSE339
-rw-r--r--grpc/third_party/xxhash/tests/bench/Makefile67
-rw-r--r--grpc/third_party/xxhash/tests/bench/benchHash.c164
-rw-r--r--grpc/third_party/xxhash/tests/bench/benchHash.h67
-rw-r--r--grpc/third_party/xxhash/tests/bench/benchfn.c252
-rw-r--r--grpc/third_party/xxhash/tests/bench/benchfn.h183
-rw-r--r--grpc/third_party/xxhash/tests/bench/bhDisplay.c160
-rw-r--r--grpc/third_party/xxhash/tests/bench/bhDisplay.h61
-rw-r--r--grpc/third_party/xxhash/tests/bench/hashes.h118
-rw-r--r--grpc/third_party/xxhash/tests/bench/main.c220
-rw-r--r--grpc/third_party/xxhash/tests/bench/timefn.c168
-rw-r--r--grpc/third_party/xxhash/tests/bench/timefn.h89
-rw-r--r--grpc/third_party/xxhash/tests/collisions/.gitignore2
-rw-r--r--grpc/third_party/xxhash/tests/collisions/LICENSE339
-rw-r--r--grpc/third_party/xxhash/tests/collisions/Makefile74
-rw-r--r--grpc/third_party/xxhash/tests/collisions/README.md122
-rw-r--r--grpc/third_party/xxhash/tests/collisions/allcodecs/README.md1
-rw-r--r--grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.c38
-rw-r--r--grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.h45
-rw-r--r--grpc/third_party/xxhash/tests/collisions/hashes.h127
-rw-r--r--grpc/third_party/xxhash/tests/collisions/main.c1120
-rw-r--r--grpc/third_party/xxhash/tests/collisions/pool.c344
-rw-r--r--grpc/third_party/xxhash/tests/collisions/pool.h80
-rw-r--r--grpc/third_party/xxhash/tests/collisions/sort.cc59
-rw-r--r--grpc/third_party/xxhash/tests/collisions/sort.hh40
-rw-r--r--grpc/third_party/xxhash/tests/collisions/threading.c82
-rw-r--r--grpc/third_party/xxhash/tests/collisions/threading.h124
-rw-r--r--grpc/third_party/xxhash/tests/generate_unicode_test.c154
-rw-r--r--grpc/third_party/xxhash/tests/multiInclude.c66
-rw-r--r--grpc/third_party/xxhash/tests/ppc_define.c62
-rw-r--r--grpc/third_party/xxhash/xxh3.h55
-rw-r--r--grpc/third_party/xxhash/xxh_x86dispatch.c770
-rw-r--r--grpc/third_party/xxhash/xxh_x86dispatch.h86
-rw-r--r--grpc/third_party/xxhash/xxhash.c43
-rw-r--r--grpc/third_party/xxhash/xxhash.h1221
-rw-r--r--grpc/third_party/xxhash/xxhsum.1165
-rw-r--r--grpc/third_party/xxhash/xxhsum.1.md148
-rw-r--r--grpc/third_party/xxhash/xxhsum.c1503
-rwxr-xr-xgrpc/tools/bazel21
-rw-r--r--grpc/tools/bazel.rc45
-rwxr-xr-xgrpc/tools/buildgen/_mako_renderer.py2
-rw-r--r--grpc/tools/buildgen/_utils.py8
-rwxr-xr-xgrpc/tools/buildgen/build_cleaner.py1
-rwxr-xr-xgrpc/tools/buildgen/extract_metadata_from_bazel_xml.py277
-rwxr-xr-xgrpc/tools/buildgen/generate_projects.py8
-rw-r--r--grpc/tools/buildgen/plugins/check_attrs.py2
-rwxr-xr-xgrpc/tools/buildgen/plugins/list_api.py8
-rw-r--r--grpc/tools/buildgen/plugins/make_fuzzer_tests.py51
-rw-r--r--grpc/tools/buildgen/plugins/supported_bazel_versions.py28
-rw-r--r--grpc/tools/buildgen/plugins/transitive_dependencies.py2
-rwxr-xr-xgrpc/tools/codegen/core/gen_grpc_tls_credentials_options.py394
-rwxr-xr-xgrpc/tools/codegen/core/gen_header_frame.py8
-rw-r--r--grpc/tools/codegen/core/gen_hpack_tables.cc106
-rw-r--r--grpc/tools/codegen/core/gen_legal_metadata_characters.cc66
-rw-r--r--grpc/tools/codegen/core/gen_percent_encoding_tables.cc69
-rwxr-xr-xgrpc/tools/codegen/core/gen_server_registered_method_bad_client_test_body.py9
-rwxr-xr-xgrpc/tools/codegen/core/gen_settings_ids.py120
-rwxr-xr-xgrpc/tools/codegen/core/gen_static_metadata.py743
-rwxr-xr-xgrpc/tools/codegen/core/gen_stats_data.py279
-rwxr-xr-xgrpc/tools/codegen/core/gen_switch.py75
-rwxr-xr-xgrpc/tools/codegen/core/gen_upb_api.sh141
-rwxr-xr-xgrpc/tools/codegen/core/gen_upb_api_from_bazel_xml.py200
-rwxr-xr-xgrpc/tools/debug/core/chttp2_ref_leak.py8
-rw-r--r--grpc/tools/debug/core/error_ref_leak.py6
-rwxr-xr-xgrpc/tools/distrib/add-iwyu.py118
-rw-r--r--grpc/tools/distrib/build_ruby_environment_macos.sh95
-rwxr-xr-xgrpc/tools/distrib/buildifier_format_code.sh4
-rwxr-xr-xgrpc/tools/distrib/buildifier_format_code_strict.sh2
-rwxr-xr-xgrpc/tools/distrib/c-ish/check_documentation.py16
-rwxr-xr-xgrpc/tools/distrib/check_copyright.py99
-rwxr-xr-xgrpc/tools/distrib/check_include_guards.py16
-rwxr-xr-xgrpc/tools/distrib/check_naked_includes.py72
-rwxr-xr-xgrpc/tools/distrib/check_namespace_qualification.py121
-rwxr-xr-xgrpc/tools/distrib/check_redundant_namespace_qualifiers.py169
-rwxr-xr-xgrpc/tools/distrib/docgen/_generate_python_doc.sh2
-rwxr-xr-xgrpc/tools/distrib/docgen/all_lang_docgen.sh20
-rwxr-xr-xgrpc/tools/distrib/gen_compilation_database.py2
-rwxr-xr-xgrpc/tools/distrib/isort_code.sh58
-rwxr-xr-xgrpc/tools/distrib/iwyu.sh55
-rwxr-xr-xgrpc/tools/distrib/pylint_code.sh1
-rw-r--r--grpc/tools/distrib/python/.gitignore2
-rwxr-xr-xgrpc/tools/distrib/python/check_grpcio_tools.py2
-rwxr-xr-xgrpc/tools/distrib/python/docgen.py3
-rw-r--r--grpc/tools/distrib/python/grpc_prefixed/templates/setup.py.template1
-rw-r--r--grpc/tools/distrib/python/grpc_version.py4
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/BUILD.bazel6
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/README.rst17
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx8
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/command.py5
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/main.cc19
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py7
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel4
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/protoc_test.py2
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpc_version.py4
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/grpcio_tools.bzl4
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/protoc_lib_deps.py4
-rw-r--r--grpc/tools/distrib/python/grpcio_tools/setup.py20
-rwxr-xr-xgrpc/tools/distrib/python/make_grpcio_tools.py6
-rwxr-xr-xgrpc/tools/distrib/python/submit.py93
-rw-r--r--grpc/tools/distrib/python/xds_protos/build.py10
-rwxr-xr-xgrpc/tools/distrib/python/xds_protos/build_validate_upload.sh10
-rw-r--r--grpc/tools/distrib/python/xds_protos/setup.py5
-rwxr-xr-xgrpc/tools/distrib/python_wrapper.sh2
-rwxr-xr-xgrpc/tools/distrib/run_clang_tidy.py24
-rwxr-xr-xgrpc/tools/distrib/sanitize.sh16
-rwxr-xr-xgrpc/tools/distrib/yapf_code.sh2
-rwxr-xr-xgrpc/tools/docker_runners/examples/bazel_test_in_docker.sh29
-rwxr-xr-xgrpc/tools/docker_runners/examples/coredump_in_docker.sh51
-rwxr-xr-xgrpc/tools/docker_runners/examples/gdb_in_docker.sh45
-rwxr-xr-xgrpc/tools/docker_runners/examples/run_tests_c_cpp_in_docker.sh25
-rwxr-xr-xgrpc/tools/docker_runners/examples/run_tests_csharp_in_docker.sh23
-rwxr-xr-xgrpc/tools/docker_runners/run_in_docker.sh95
-rw-r--r--grpc/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile38
-rw-r--r--grpc/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile31
-rw-r--r--grpc/tools/dockerfile/distribtest/python_alpine_x64/Dockerfile20
-rw-r--r--grpc/tools/dockerfile/distribtest/python_arch_x64/Dockerfile8
-rw-r--r--grpc/tools/dockerfile/distribtest/python_buster_x64/Dockerfile18
-rw-r--r--grpc/tools/dockerfile/distribtest/python_buster_x86/Dockerfile24
-rw-r--r--grpc/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile33
-rw-r--r--grpc/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile3
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile6
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile8
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile21
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile27
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile12
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile23
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile25
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile21
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile27
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile6
-rw-r--r--grpc/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile6
-rw-r--r--grpc/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile18
-rw-r--r--grpc/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile20
-rw-r--r--grpc/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile18
-rw-r--r--grpc/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile24
-rw-r--r--grpc/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile8
-rw-r--r--grpc/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile2
-rw-r--r--grpc/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile4
-rw-r--r--grpc/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile4
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile8
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile39
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile19
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_4/Dockerfile40
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_5/Dockerfile40
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_6/Dockerfile40
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_7/Dockerfile40
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_3_0/Dockerfile40
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile19
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile30
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_stretch_x64/Dockerfile19
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_5/Dockerfile42
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6/Dockerfile42
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7/Dockerfile42
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0/Dockerfile42
-rw-r--r--grpc/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile8
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile104
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile16
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile14
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_protoc_aarch64/Dockerfile16
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile38
-rwxr-xr-xgrpc/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh11
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile26
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x86/Dockerfile26
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile32
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile22
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile22
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile37
-rw-r--r--grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile37
-rw-r--r--grpc/tools/dockerfile/grpc_clang/Dockerfile46
-rw-r--r--grpc/tools/dockerfile/grpc_clang_format/Dockerfile6
-rwxr-xr-xgrpc/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh9
-rw-r--r--grpc/tools/dockerfile/grpc_clang_tidy/Dockerfile10
-rwxr-xr-xgrpc/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh1
-rw-r--r--grpc/tools/dockerfile/grpc_dist_proto/Dockerfile2
-rw-r--r--grpc/tools/dockerfile/grpc_iwyu/Dockerfile33
-rwxr-xr-xgrpc/tools/dockerfile/grpc_iwyu/iwyu.sh43
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile127
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile127
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile108
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client3
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server3
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile33
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile33
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile33
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile33
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile16
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile1
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile103
-rwxr-xr-xgrpc/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh9
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile70
-rwxr-xr-xgrpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/build_interop.sh9
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile121
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile89
-rwxr-xr-xgrpc/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh4
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile89
-rwxr-xr-xgrpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/build_interop.sh4
-rw-r--r--grpc/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile106
-rwxr-xr-xgrpc/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh2
-rw-r--r--grpc/tools/dockerfile/interoptest/lb_interop_fake_servers/Dockerfile2
-rwxr-xr-xgrpc/tools/dockerfile/push_testing_images.sh13
-rw-r--r--grpc/tools/dockerfile/test/bazel/Dockerfile72
-rw-r--r--grpc/tools/dockerfile/test/bazel_arm64/Dockerfile112
-rw-r--r--grpc/tools/dockerfile/test/binder_transport_apk/Dockerfile78
-rw-r--r--grpc/tools/dockerfile/test/csharp_debian11_arm64/Dockerfile143
-rw-r--r--grpc/tools/dockerfile/test/csharp_debian11_x64/Dockerfile143
-rw-r--r--grpc/tools/dockerfile/test/csharp_stretch_x64/Dockerfile117
-rw-r--r--grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile38
-rw-r--r--grpc/tools/dockerfile/test/cxx_buster_x64/Dockerfile86
-rw-r--r--grpc/tools/dockerfile/test/cxx_clang_13_x64/Dockerfile72
-rw-r--r--grpc/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile72
-rw-r--r--grpc/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile122
-rw-r--r--grpc/tools/dockerfile/test/cxx_debian11_x64/Dockerfile110
-rw-r--r--grpc/tools/dockerfile/test/cxx_debian11_x86/Dockerfile110
-rw-r--r--grpc/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile68
-rw-r--r--grpc/tools/dockerfile/test/cxx_gcc_5_x64/Dockerfile57
-rw-r--r--grpc/tools/dockerfile/test/cxx_jessie_x64/Dockerfile96
-rw-r--r--grpc/tools/dockerfile/test/cxx_jessie_x86/Dockerfile93
-rw-r--r--grpc/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile89
-rw-r--r--grpc/tools/dockerfile/test/cxx_ubuntu1804_x64/Dockerfile86
-rw-r--r--grpc/tools/dockerfile/test/node_jessie_x64/Dockerfile104
-rw-r--r--grpc/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile91
-rw-r--r--grpc/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile45
-rw-r--r--grpc/tools/dockerfile/test/php7_debian11_arm64/Dockerfile137
-rw-r--r--grpc/tools/dockerfile/test/php7_debian11_x64/Dockerfile137
-rw-r--r--grpc/tools/dockerfile/test/php7_jessie_x64/Dockerfile93
-rw-r--r--grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile54
-rw-r--r--grpc/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile90
-rw-r--r--grpc/tools/dockerfile/test/python_debian11_default_x64/Dockerfile175
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile65
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile68
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile85
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile71
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile85
-rw-r--r--grpc/tools/dockerfile/test/python_stretch_default_x64/Dockerfile114
-rw-r--r--grpc/tools/dockerfile/test/ruby_buster_x64/Dockerfile98
-rw-r--r--grpc/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile126
-rw-r--r--grpc/tools/dockerfile/test/ruby_debian11_x64/Dockerfile126
-rw-r--r--grpc/tools/dockerfile/test/sanity/Dockerfile113
-rw-r--r--grpc/tools/doxygen/Doxyfile.c++14
-rw-r--r--grpc/tools/doxygen/Doxyfile.c++.internal562
-rw-r--r--grpc/tools/doxygen/Doxyfile.core9
-rw-r--r--grpc/tools/doxygen/Doxyfile.core.internal522
-rw-r--r--grpc/tools/doxygen/Doxyfile.objc3
-rw-r--r--grpc/tools/doxygen/Doxyfile.objc.internal3
-rw-r--r--grpc/tools/doxygen/Doxyfile.php3
-rwxr-xr-xgrpc/tools/fuzzer/build_and_run_fuzzer.sh23
-rw-r--r--grpc/tools/fuzzer/options/client_fuzzer.options3
-rw-r--r--grpc/tools/fuzzer/options/fuzzer.options2
-rw-r--r--grpc/tools/fuzzer/options/fuzzer_response.options2
-rw-r--r--grpc/tools/fuzzer/options/fuzzer_serverlist.options2
-rw-r--r--grpc/tools/fuzzer/options/hpack_parser_fuzzer_test.options3
-rw-r--r--grpc/tools/fuzzer/options/percent_decode_fuzzer.options2
-rw-r--r--grpc/tools/fuzzer/options/percent_encode_fuzzer.options2
-rw-r--r--grpc/tools/fuzzer/options/request_fuzzer.options3
-rw-r--r--grpc/tools/fuzzer/options/response_fuzzer.options3
-rw-r--r--grpc/tools/fuzzer/options/server_fuzzer.options3
-rw-r--r--grpc/tools/fuzzer/options/ssl_server_fuzzer.options2
-rw-r--r--grpc/tools/fuzzer/options/uri_fuzzer_test.options2
-rw-r--r--grpc/tools/fuzzer/runners/alts_credentials_fuzzer.sh30
-rw-r--r--grpc/tools/fuzzer/runners/client_fuzzer.sh31
-rw-r--r--grpc/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh31
-rw-r--r--grpc/tools/fuzzer/runners/http_request_fuzzer_test.sh30
-rw-r--r--grpc/tools/fuzzer/runners/http_response_fuzzer_test.sh30
-rw-r--r--grpc/tools/fuzzer/runners/json_fuzzer_test.sh30
-rw-r--r--grpc/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh30
-rw-r--r--grpc/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh30
-rw-r--r--grpc/tools/fuzzer/runners/percent_decode_fuzzer.sh30
-rw-r--r--grpc/tools/fuzzer/runners/percent_encode_fuzzer.sh30
-rw-r--r--grpc/tools/fuzzer/runners/server_fuzzer.sh31
-rw-r--r--grpc/tools/fuzzer/runners/ssl_server_fuzzer.sh30
-rw-r--r--grpc/tools/fuzzer/runners/uri_fuzzer_test.sh30
-rw-r--r--grpc/tools/gcp/github_stats_tracking/app.yaml13
-rw-r--r--grpc/tools/gcp/github_stats_tracking/appengine_config.py19
-rw-r--r--grpc/tools/gcp/github_stats_tracking/cron.yaml4
-rw-r--r--grpc/tools/gcp/github_stats_tracking/fetch_data.py93
-rw-r--r--grpc/tools/gcp/github_stats_tracking/main.py28
-rwxr-xr-xgrpc/tools/gcp/utils/big_query_utils.py3
-rw-r--r--grpc/tools/github/pr_latency.py210
-rwxr-xr-xgrpc/tools/internal_ci/helper_scripts/delete_nonartifacts.sh27
-rw-r--r--grpc/tools/internal_ci/helper_scripts/install_python_interpreters.ps141
-rw-r--r--grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself.bat66
-rw-r--r--grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc52
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_interop_rc13
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_linux_rc2
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc46
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc12
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_macos_rc118
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_build_windows.bat61
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_ccache.bat21
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_ccache_rc22
-rw-r--r--grpc/tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc65
-rwxr-xr-xgrpc/tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh37
-rw-r--r--grpc/tools/internal_ci/linux/arm64/grpc_basictests_csharp.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/arm64/grpc_basictests_python.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/arm64/grpc_basictests_ruby.cfg30
-rwxr-xr-xgrpc/tools/internal_ci/linux/arm64/grpc_bazel.sh25
-rw-r--r--grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp.cfg23
-rwxr-xr-xgrpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp_in_docker.sh29
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_csharp.cfg36
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_php.cfg36
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_python.cfg36
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_ruby.cfg36
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_bazel_test_c_cpp.cfg36
-rw-r--r--grpc/tools/internal_ci/linux/aws/grpc_aws_experiment.cfg32
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_aws_experiment_remote.sh30
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh147
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test_8core.sh18
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_bazel_test_c_cpp_aarch64.sh30
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh44
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_run_basictests_php_aarch64.sh33
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_run_basictests_python_aarch64.sh37
-rwxr-xr-xgrpc/tools/internal_ci/linux/aws/grpc_run_basictests_ruby_aarch64.sh33
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh20
-rw-r--r--grpc/tools/internal_ci/linux/grpc_basictests_csharp.cfg2
-rw-r--r--grpc/tools/internal_ci/linux/grpc_basictests_multilang.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/grpc_basictests_node.cfg30
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh15
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_distribtest.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_distribtest.sh27
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh27
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh50
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh20
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh20
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_rbe.sh36
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg6
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh3
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg20
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg21
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_bazel_test.cfg23
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bazel_test_in_docker.sh29
-rw-r--r--grpc/tools/internal_ci/linux/grpc_binder_transport_apk.cfg23
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh25
-rw-r--r--grpc/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh44
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bloat_diff.sh28
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_bloat_diff_in_docker.sh26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_build_artifacts.sh22
-rw-r--r--grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh29
-rw-r--r--grpc/tools/internal_ci/linux/grpc_build_artifacts_extra_release.cfg26
-rw-r--r--grpc/tools/internal_ci/linux/grpc_build_packages.sh19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg5
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_build_submodule_at_head.sh2
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_coverage.sh8
-rw-r--r--grpc/tools/internal_ci/linux/grpc_distribtests.sh11
-rw-r--r--grpc/tools/internal_ci/linux/grpc_distribtests_csharp.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh67
-rw-r--r--grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.sh66
-rw-r--r--grpc/tools/internal_ci/linux/grpc_distribtests_php.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_php.sh56
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_python.sh14
-rw-r--r--grpc/tools/internal_ci/linux/grpc_distribtests_ruby.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh57
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh5
-rw-r--r--grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_e2e_performance_gke.sh136
-rw-r--r--grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh134
-rw-r--r--grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_e2e_performance_v2.sh55
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_feature_example_tests.sh29
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_flaky_network_in_docker.sh2
-rw-r--r--grpc/tools/internal_ci/linux/grpc_line_count.cfg19
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_line_count.sh29
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_memory_diff.sh28
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_memory_diff_in_docker.sh28
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_microbenchmark_diff.sh18
-rw-r--r--grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh19
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_performance_profile_daily.sh10
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_performance_profile_master.sh11
-rw-r--r--grpc/tools/internal_ci/linux/grpc_portability_build_only.cfg2
-rw-r--r--grpc/tools/internal_ci/linux/grpc_python_bazel_test.cfg7
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh22
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_run_interop_tests.sh6
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh8
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_trickle_diff.sh42
-rw-r--r--grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh19
-rw-r--r--grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh19
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh12
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh9
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_csharp.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_csharp.sh26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh78
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_k8s.sh149
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh149
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh182
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh187
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s_python.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_k8s_python.sh163
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh139
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_php.sh2
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh10
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.cfg25
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.sh70
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_ruby.sh2
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh9
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_url_map.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_url_map.sh149
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_url_map_python.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh159
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.cfg25
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_v3_csharp.sh26
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_v3_csharp_test_in_docker.sh16
-rwxr-xr-xgrpc/tools/internal_ci/linux/grpc_xds_v3_php.sh2
-rw-r--r--grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh2
-rw-r--r--grpc/tools/internal_ci/linux/psm-security-python.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/psm-security-python.sh187
-rw-r--r--grpc/tools/internal_ci/linux/psm-security.cfg26
-rwxr-xr-xgrpc/tools/internal_ci/linux/psm-security.sh171
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh19
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_dbg.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_opt.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_dbg.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_opt.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_csharp.cfg2
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_multilang.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_basictests_node.cfg30
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh19
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh19
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg14
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg16
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg14
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg16
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg14
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg14
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_bloat_diff.cfg33
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_build_artifacts.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_csharp.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_php.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_python.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_ruby.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_standalone.cfg31
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_feature_example_tests.cfg29
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_interop_matrix_adhoc.cfg2
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_memory_diff.cfg33
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh18
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_trickle_diff.cfg33
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh18
-rw-r--r--grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh18
-rwxr-xr-xgrpc/tools/internal_ci/linux/run_performance_profile_daily.sh34
-rwxr-xr-xgrpc/tools/internal_ci/linux/run_performance_profile_hourly.sh24
-rw-r--r--grpc/tools/internal_ci/macos/grpc_basictests_node.cfg31
-rw-r--r--grpc/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg21
-rw-r--r--grpc/tools/internal_ci/macos/grpc_build_artifacts.cfg2
-rwxr-xr-xgrpc/tools/internal_ci/macos/grpc_build_artifacts.sh11
-rw-r--r--grpc/tools/internal_ci/macos/grpc_cfstream.cfg5
-rw-r--r--grpc/tools/internal_ci/macos/grpc_cfstream_tsan.cfg2
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests.sh12
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_csharp.cfg27
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh60
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_php.cfg27
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_php.sh54
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_python.cfg27
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_python.sh57
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_ruby.cfg27
-rw-r--r--grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh18
-rwxr-xr-xgrpc/tools/internal_ci/macos/grpc_interop_toprod.sh5
-rwxr-xr-xgrpc/tools/internal_ci/macos/grpc_ios_binary_size.sh3
-rw-r--r--grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh43
-rwxr-xr-x[-rw-r--r--]grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh32
-rw-r--r--grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh3
-rwxr-xr-xgrpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh5
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_basictests_dbg.cfg31
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_basictests_node.cfg31
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_basictests_opt.cfg31
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_build_artifacts.cfg32
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_csharp.cfg32
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_php.cfg32
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_python.cfg32
-rw-r--r--grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_ruby.cfg32
-rw-r--r--grpc/tools/internal_ci/windows/bazel_rbe.bat34
-rw-r--r--grpc/tools/internal_ci/windows/grpc_basictests.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/grpc_basictests_csharp.cfg2
-rw-r--r--grpc/tools/internal_ci/windows/grpc_basictests_dbg.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/grpc_basictests_opt.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/grpc_basictests_python.cfg2
-rw-r--r--grpc/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg7
-rw-r--r--grpc/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg7
-rw-r--r--grpc/tools/internal_ci/windows/grpc_build_artifacts.bat21
-rw-r--r--grpc/tools/internal_ci/windows/grpc_build_packages.bat29
-rw-r--r--grpc/tools/internal_ci/windows/grpc_build_packages.cfg26
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests.bat13
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat73
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests_csharp.cfg26
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests_python.bat49
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests_python.cfg26
-rw-r--r--grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat14
-rw-r--r--grpc/tools/internal_ci/windows/grpc_portability.cfg4
-rw-r--r--grpc/tools/internal_ci/windows/grpc_portability_build_only.cfg2
-rw-r--r--grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat27
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_basictests.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_basictests_csharp.cfg2
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_basictests_dbg.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_basictests_opt.cfg30
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg7
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg7
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_build_artifacts.cfg31
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_csharp.cfg31
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_python.cfg31
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_standalone.cfg31
-rw-r--r--grpc/tools/internal_ci/windows/pull_request/grpc_portability.cfg30
-rw-r--r--grpc/tools/interop_matrix/client_matrix.py267
-rwxr-xr-xgrpc/tools/interop_matrix/create_matrix_images.py12
-rwxr-xr-xgrpc/tools/interop_matrix/run_interop_matrix_tests.py11
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/csharp__master2
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/csharp__v1.20.022
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/csharpcoreclr__master38
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/csharpcoreclr__v1.20.022
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/python__master38
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/python__v1.18.020
-rwxr-xr-xgrpc/tools/interop_matrix/testcases/python__v1.41.122
-rwxr-xr-xgrpc/tools/line_count/collect-history.py42
-rwxr-xr-xgrpc/tools/line_count/collect-now.sh21
-rwxr-xr-xgrpc/tools/line_count/summarize-history.py38
-rwxr-xr-xgrpc/tools/line_count/yaml2csv.py43
-rwxr-xr-xgrpc/tools/mkowners/mkowners.py10
-rwxr-xr-xgrpc/tools/profiling/bloat/bloat_diff.py77
-rwxr-xr-xgrpc/tools/profiling/ios_bin/binary_size.py3
-rwxr-xr-xgrpc/tools/profiling/ios_bin/parse_link_map.py12
-rwxr-xr-xgrpc/tools/profiling/latency_profile/profile_analyzer.py14
-rwxr-xr-xgrpc/tools/profiling/memory/memory_diff.py119
-rwxr-xr-xgrpc/tools/profiling/microbenchmarks/bm2bq.py9
-rw-r--r--grpc/tools/profiling/microbenchmarks/bm_diff/bm_constants.py13
-rwxr-xr-xgrpc/tools/profiling/microbenchmarks/bm_diff/bm_diff.py48
-rwxr-xr-xgrpc/tools/profiling/microbenchmarks/bm_diff/bm_main.py5
-rw-r--r--grpc/tools/profiling/microbenchmarks/bm_json.py15
-rwxr-xr-xgrpc/tools/profiling/qps/qps_diff.py23
-rw-r--r--grpc/tools/release/release_notes.py65
-rwxr-xr-xgrpc/tools/release/update_supported_bazel_versions.sh46
-rw-r--r--grpc/tools/release/verify_python_release.py5
-rw-r--r--grpc/tools/remote_build/README.md4
-rw-r--r--grpc/tools/remote_build/include/rbe_base_config.bazelrc43
-rw-r--r--grpc/tools/remote_build/include/rbe_remote_execution.bazelrc35
-rw-r--r--grpc/tools/remote_build/include/test_config_common.bazelrc24
-rw-r--r--grpc/tools/remote_build/include/test_locally_with_resultstore_results.bazelrc15
-rw-r--r--grpc/tools/remote_build/kokoro.bazelrc33
-rw-r--r--grpc/tools/remote_build/linux.bazelrc82
-rw-r--r--grpc/tools/remote_build/linux_kokoro.bazelrc24
-rw-r--r--grpc/tools/remote_build/mac.bazelrc43
-rw-r--r--grpc/tools/remote_build/manual.bazelrc39
-rw-r--r--grpc/tools/remote_build/rbe_common.bazelrc94
-rw-r--r--grpc/tools/remote_build/windows.bazelrc36
-rw-r--r--grpc/tools/run_tests/artifacts/artifact_targets.py273
-rw-r--r--grpc/tools/run_tests/artifacts/build_artifact_csharp.bat21
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_artifact_csharp.sh6
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_artifact_php.sh7
-rw-r--r--grpc/tools/run_tests/artifacts/build_artifact_protoc.bat23
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_artifact_protoc.sh6
-rw-r--r--grpc/tools/run_tests/artifacts/build_artifact_python.bat19
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_artifact_python.sh64
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_artifact_ruby.sh33
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_package_php.sh2
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_package_python.sh20
-rwxr-xr-xgrpc/tools/run_tests/artifacts/build_package_ruby.sh12
-rw-r--r--grpc/tools/run_tests/artifacts/distribtest_targets.py204
-rw-r--r--grpc/tools/run_tests/artifacts/package_targets.py56
-rwxr-xr-xgrpc/tools/run_tests/dockerize/build_and_run_docker.sh92
-rwxr-xr-xgrpc/tools/run_tests/dockerize/build_docker_and_run_tests.sh90
-rwxr-xr-xgrpc/tools/run_tests/dockerize/build_interop_image.sh15
-rw-r--r--grpc/tools/run_tests/dockerize/docker_propagate_env.list21
-rwxr-xr-xgrpc/tools/run_tests/dockerize/docker_run.sh46
-rwxr-xr-xgrpc/tools/run_tests/dockerize/docker_run_tests.sh48
-rw-r--r--grpc/tools/run_tests/helper_scripts/build_csharp.bat26
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/build_csharp.sh19
-rw-r--r--grpc/tools/run_tests/helper_scripts/build_cxx.bat68
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/build_cxx.sh27
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/build_php.sh11
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/build_python.sh55
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/build_ruby.sh2
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/bundle_install_wrapper.sh9
-rw-r--r--grpc/tools/run_tests/helper_scripts/pre_build_cmake.bat32
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/pre_build_cmake.sh24
-rw-r--r--grpc/tools/run_tests/helper_scripts/pre_build_csharp.bat13
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/pre_build_csharp.sh7
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/prep_xds.sh1
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/run_python.sh3
-rwxr-xr-xgrpc/tools/run_tests/helper_scripts/run_tests_in_workspace.sh4
-rwxr-xr-xgrpc/tools/run_tests/lb_interop_tests/gen_build_yaml.py7
-rw-r--r--grpc/tools/run_tests/performance/README.md417
-rwxr-xr-xgrpc/tools/run_tests/performance/bq_upload_result.py164
-rwxr-xr-xgrpc/tools/run_tests/performance/loadtest_concat_yaml.py1
-rwxr-xr-xgrpc/tools/run_tests/performance/loadtest_config.py178
-rwxr-xr-xgrpc/tools/run_tests/performance/loadtest_examples.sh130
-rwxr-xr-xgrpc/tools/run_tests/performance/loadtest_template.py107
-rw-r--r--grpc/tools/run_tests/performance/massage_qps_stats.py8
-rwxr-xr-xgrpc/tools/run_tests/performance/patch_scenario_results_schema.py2
-rw-r--r--grpc/tools/run_tests/performance/prometheus.py300
-rwxr-xr-xgrpc/tools/run_tests/performance/run_worker_csharp.sh2
-rw-r--r--grpc/tools/run_tests/performance/scenario_config.py267
-rwxr-xr-xgrpc/tools/run_tests/performance/scenario_config_exporter.py7
-rw-r--r--grpc/tools/run_tests/performance/scenario_result_schema.json2423
-rw-r--r--grpc/tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml649
-rw-r--r--grpc/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml282
-rwxr-xr-xgrpc/tools/run_tests/python_utils/antagonist.py2
-rwxr-xr-xgrpc/tools/run_tests/python_utils/bazel_report_helper.py258
-rw-r--r--grpc/tools/run_tests/python_utils/check_on_pr.py75
-rwxr-xr-xgrpc/tools/run_tests/python_utils/dockerjob.py15
-rw-r--r--grpc/tools/run_tests/python_utils/download_and_unzip.py3
-rw-r--r--grpc/tools/run_tests/python_utils/filter_pull_request_tests.py6
-rwxr-xr-xgrpc/tools/run_tests/python_utils/jobset.py19
-rwxr-xr-xgrpc/tools/run_tests/python_utils/port_server.py16
-rw-r--r--grpc/tools/run_tests/python_utils/report_utils.py17
-rw-r--r--grpc/tools/run_tests/python_utils/start_port_server.py11
-rwxr-xr-xgrpc/tools/run_tests/python_utils/upload_rbe_results.py31
-rw-r--r--grpc/tools/run_tests/python_utils/upload_test_results.py7
-rwxr-xr-xgrpc/tools/run_tests/python_utils/watch_dirs.py1
-rwxr-xr-xgrpc/tools/run_tests/run_grpclb_interop_tests.py17
-rwxr-xr-xgrpc/tools/run_tests/run_interop_tests.py82
-rwxr-xr-xgrpc/tools/run_tests/run_microbenchmark.py43
-rwxr-xr-xgrpc/tools/run_tests/run_performance_tests.py16
-rwxr-xr-xgrpc/tools/run_tests/run_tests.py1194
-rwxr-xr-xgrpc/tools/run_tests/run_tests_matrix.py104
-rwxr-xr-xgrpc/tools/run_tests/run_xds_tests.py717
-rwxr-xr-xgrpc/tools/run_tests/sanity/build_banned_constructs.sh31
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_bazel_workspace.py17
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_buildifier.sh4
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_deprecated_grpc++.py10
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_do_not_submit.sh23
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_include_style.py71
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_package_name.py74
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_port_platform.py40
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_qps_scenario_changes.py12
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_submodules.sh33
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_test_filtering.py5
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_tracer_sanity.py6
-rwxr-xr-xgrpc/tools/run_tests/sanity/check_version.py21
-rwxr-xr-xgrpc/tools/run_tests/sanity/core_banned_functions.py20
-rw-r--r--grpc/tools/run_tests/sanity/sanity_tests.yaml10
-rwxr-xr-xgrpc/tools/run_tests/task_runner.py35
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/README.md354
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup.sh59
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/README.md2
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/cleanup.py390
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/keep_xds_interop_resources.json8
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/namespace.py38
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/ensure_venv.sh29
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/isort.sh61
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/run_channelz.py12
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/run_td_setup.py74
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_client.py22
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_server.py26
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/bin/yapf.sh58
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/config/common.cfg5
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/config/grpc-testing.cfg6
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example9
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/config/url-map.cfg12
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/datetime.py52
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/highlighter.py99
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/rand.py49
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py10
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/skips.py67
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/__init__.py1
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/api.py200
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py153
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py312
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_security.py206
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_services.py283
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py149
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py619
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py4
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_csds.py59
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py93
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py111
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py133
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/server_app.py178
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py128
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_flags.py9
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py414
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_test_resources.py332
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py473
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client-secure.deployment.yaml4
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client.deployment.yaml11
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server-secure.deployment.yaml3
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml39
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/requirements-dev.txt4
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/requirements.txt8
-rwxr-xr-xgrpc/tools/run_tests/xds_k8s_test_driver/run.sh67
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py164
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/api_listener_test.py111
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/app_net_test.py62
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py338
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/baseline_test.py9
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/change_backend_service_test.py106
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/failover_test.py127
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/remove_neg_test.py103
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/round_robin_test.py88
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/security_test.py11
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/subsetting_test.py104
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__init__.py13
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__main__.py31
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/affinity_test.py229
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/csds_test.py70
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/fault_injection_test.py367
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/header_matching_test.py357
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/metadata_filter_test.py277
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/path_matching_test.py220
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/retry_test.py153
-rw-r--r--grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/timeout_test.py162
-rw-r--r--grpc_wrap.cc82
-rw-r--r--link-deps.rs56
-rw-r--r--patches/Android.bp.patch129
3815 files changed, 275237 insertions, 182345 deletions
diff --git a/Android.bp b/Android.bp
index 3549944b..82d85f09 100644
--- a/Android.bp
+++ b/Android.bp
@@ -45,11 +45,11 @@ rust_library {
],
edition: "2018",
features: [
+ "_gen-bindings",
+ "_secure",
"bindgen",
+ "boringssl",
"boringssl-src",
- "default",
- "secure",
- "use-bindgen",
],
rustlibs: [
"liblibc",
@@ -73,7 +73,6 @@ cc_defaults {
cflags: [
"-DGRPC_SYS_SECURE",
],
- cpp_std: "c++11",
shared_libs: ["libgrpc++"],
apex_available: [
"//apex_available:anyapex",
diff --git a/Cargo.toml b/Cargo.toml
index e6892c8e..b00d497a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,47 +3,91 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "grpcio-sys"
-version = "0.9.1+1.38.0"
+version = "0.12.1+1.46.5-patched"
authors = ["The TiKV Project Developers"]
build = "build.rs"
-exclude = ["grpc/doc/*", "grpc/etc/*", "grpc/examples/*", "grpc/Makefile", "grpc/templates/*", "grpc/src/android/*", "grpc/src/csharp/*", "grpc/src/node/*", "grpc/src/objective-c/*", "grpc/src/php/*", "grpc/src/python/*", "grpc/src/ruby/*", "grpc/test/core/end2end/*", "grpc/third_party/zlib/*", "grpc/third_party/abseil-cpp/absl/time/internal/cctz/testdata", "grpc/third_party/benchmark/*", "grpc/third_party/bloaty/*", "grpc/third_party/boringssl-with-bazel/*", "grpc/third_party/libuv/*", "grpc/third_party/gflags/*", "grpc/third_party/googletest/*", "grpc/third_party/objective_c/*", "grpc/third_party/protobuf/*", "grpc/third_party/toolchans/*", "grpc/third_party/envoy-api/*", "grpc/third_party/googleapis/*", "grpc/third_party/protoc-gen-validate/*", "grpc/third_party/udpa/*", "grpc/tools/run_tests/generated/*", "grpc/test/core/", "!grpc/test/core/security/*.cc", "!grpc/test/core/util/cmdline.cc", "grpc/test/cpp"]
+exclude = [
+ "grpc/doc/*",
+ "grpc/etc/*",
+ "grpc/examples/*",
+ "grpc/Makefile",
+ "grpc/templates/*",
+ "grpc/src/android/*",
+ "grpc/src/csharp/*",
+ "grpc/src/node/*",
+ "grpc/src/objective-c/*",
+ "grpc/src/php/*",
+ "grpc/src/python/*",
+ "grpc/src/ruby/*",
+ "grpc/test/core/end2end/*",
+ "grpc/third_party/zlib/*",
+ "grpc/third_party/abseil-cpp/absl/time/internal/cctz/testdata",
+ "grpc/third_party/benchmark/*",
+ "grpc/third_party/bloaty/*",
+ "grpc/third_party/boringssl-with-bazel/*",
+ "grpc/third_party/libuv/*",
+ "grpc/third_party/gflags/*",
+ "grpc/third_party/googletest/*",
+ "grpc/third_party/objective_c/*",
+ "grpc/third_party/protobuf/*",
+ "grpc/third_party/toolchans/*",
+ "grpc/third_party/envoy-api/*",
+ "grpc/third_party/googleapis/*",
+ "grpc/third_party/protoc-gen-validate/*",
+ "grpc/third_party/udpa/*",
+ "grpc/tools/run_tests/generated/*",
+ "grpc/test/core/",
+ "!grpc/test/core/security/*.cc",
+ "!grpc/test/core/util/cmdline.cc",
+ "grpc/test/cpp",
+]
description = "FFI bindings to gRPC c core library"
homepage = "https://github.com/tikv/grpc-rs"
documentation = "https://docs.rs/grpcio-sys"
-keywords = ["grpc", "bindings"]
-categories = ["external-ffi-bindings", "network-programming"]
+keywords = [
+ "grpc",
+ "bindings",
+]
+categories = [
+ "external-ffi-bindings",
+ "network-programming",
+]
license = "Apache-2.0"
repository = "https://github.com/tikv/grpc-rs"
+
[dependencies.libc]
version = "0.2"
[dependencies.libz-sys]
version = "1.1.3"
-features = ["libc", "static"]
+features = [
+ "libc",
+ "static",
+]
default-features = false
[dependencies.openssl-sys]
version = "0.9"
features = ["vendored"]
optional = true
+
[build-dependencies.bindgen]
-version = "0.57.0"
+version = "0.59.0"
features = ["runtime"]
optional = true
default-features = false
[build-dependencies.boringssl-src]
-version = "0.3.0"
+version = "0.5.0"
optional = true
[build-dependencies.cc]
@@ -59,9 +103,19 @@ version = "0.3"
version = "2.2.9"
[features]
-default = ["use-bindgen"]
+_gen-bindings = ["bindgen"]
+_list-package = []
+_secure = []
+boringssl = [
+ "boringssl-src",
+ "_secure",
+]
no-omit-frame-pointer = []
-openssl = ["secure"]
-openssl-vendored = ["openssl", "openssl-sys"]
-secure = ["boringssl-src"]
-use-bindgen = ["bindgen"]
+openssl = ["_secure"]
+openssl-vendored = [
+ "openssl",
+ "openssl-sys",
+]
+
+[target."cfg(not(all(any(target_os = \"linux\", target_os = \"macos\"), any(target_arch = \"x86_64\", target_arch = \"aarch64\"))))".build-dependencies.bindgen]
+version = "0.59.0"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 7a520ef4..94ff9b20 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "grpcio-sys"
-version = "0.9.1+1.38.0"
+version = "0.12.1+1.46.5-patched"
authors = ["The TiKV Project Developers"]
license = "Apache-2.0"
keywords = ["grpc", "bindings"]
@@ -53,15 +53,18 @@ openssl-sys = { version = "0.9", optional = true, features = ["vendored"] }
libz-sys = { version = "1.1.3", default-features = false, features = ["libc", "static"] }
[features]
-default = ["use-bindgen"]
-secure = ["boringssl-src"]
-openssl = ["secure"]
+# A hidden feature indicating that secure features should be enabled.
+_secure = []
+boringssl = ["boringssl-src", "_secure"]
+openssl = ["_secure"]
openssl-vendored = ["openssl", "openssl-sys"]
no-omit-frame-pointer = []
-# If this feature is disabled, bindgen will not be used and the previously generated bindings will
-# be compiled instead. This only work for the supported targets and will make compilation fails for
-# the other ones.
-use-bindgen = ["bindgen"]
+# A hidden feature that is used to force regenerating bindings.
+_gen-bindings = ["bindgen"]
+_list-package = []
+
+[target.'cfg(not(all(any(target_os = "linux", target_os = "macos"), any(target_arch = "x86_64", target_arch = "aarch64"))))'.build-dependencies]
+bindgen = "0.59.0"
[build-dependencies]
cc = "1.0"
@@ -69,5 +72,5 @@ cmake = "0.1"
pkg-config = "0.3"
walkdir = "2.2.9"
# Because of rust-lang/cargo#5237, bindgen should not be upgraded util a minor or major release.
-bindgen = { version = "0.57.0", default-features = false, optional = true, features = ["runtime"] }
-boringssl-src = { version = "0.3.0", optional = true }
+bindgen = { version = "0.59.0", default-features = false, optional = true, features = ["runtime"] }
+boringssl-src = { version = "0.5.0", optional = true }
diff --git a/METADATA b/METADATA
index a7622dee..6f81232f 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/grpcio-sys/grpcio-sys-0.9.1+1.38.0.crate"
+ value: "https://static.crates.io/crates/grpcio-sys/grpcio-sys-0.12.1+1.46.5-patched.crate"
}
- version: "0.9.1+1.38.0"
+ version: "0.12.1+1.46.5-patched"
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 9
- day: 23
+ year: 2023
+ month: 6
+ day: 21
}
}
diff --git a/bindings/aarch64-unknown-linux-gnu-bindings.rs b/bindings/aarch64-unknown-linux-gnu-bindings.rs
deleted file mode 100644
index b24c0ee2..00000000
--- a/bindings/aarch64-unknown-linux-gnu-bindings.rs
+++ /dev/null
@@ -1,4059 +0,0 @@
-pub const GRPC_ARES: u32 = 1;
-pub const GRPC_IF_NAMETOINDEX: u32 = 1;
-pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1;
-pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &'static [u8; 31usize] =
- b"grpc-internal-encoding-request\0";
-pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &'static [u8; 35usize] =
- b"grpc.default_compression_algorithm\0";
-pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &'static [u8; 31usize] =
- b"grpc.default_compression_level\0";
-pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &'static [u8; 43usize] =
- b"grpc.compression_enabled_algorithms_bitset\0";
-pub const GRPC_ALLOW_GPR_SLICE_FUNCTIONS: u32 = 1;
-pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8;
-pub const GRPC_ARG_ENABLE_CENSUS: &'static [u8; 12usize] = b"grpc.census\0";
-pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &'static [u8; 19usize] = b"grpc.loadreporting\0";
-pub const GRPC_ARG_MINIMAL_STACK: &'static [u8; 19usize] = b"grpc.minimal_stack\0";
-pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &'static [u8; 28usize] =
- b"grpc.max_concurrent_streams\0";
-pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &'static [u8; 32usize] =
- b"grpc.max_receive_message_length\0";
-pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &'static [u8; 32usize] =
- b"grpc.max_receive_message_length\0";
-pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &'static [u8; 29usize] =
- b"grpc.max_send_message_length\0";
-pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &'static [u8; 28usize] =
- b"grpc.max_connection_idle_ms\0";
-pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &'static [u8; 27usize] = b"grpc.max_connection_age_ms\0";
-pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &'static [u8; 33usize] =
- b"grpc.max_connection_age_grace_ms\0";
-pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.client_idle_timeout_ms\0";
-pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &'static [u8; 29usize] =
- b"grpc.per_message_compression\0";
-pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &'static [u8; 31usize] =
- b"grpc.per_message_decompression\0";
-pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &'static [u8; 30usize] =
- b"grpc.enable_deadline_checking\0";
-pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &'static [u8; 35usize] =
- b"grpc.http2.initial_sequence_number\0";
-pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &'static [u8; 27usize] =
- b"grpc.http2.lookahead_bytes\0";
-pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &'static [u8; 36usize] =
- b"grpc.http2.hpack_table_size.decoder\0";
-pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &'static [u8; 36usize] =
- b"grpc.http2.hpack_table_size.encoder\0";
-pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &'static [u8; 26usize] = b"grpc.http2.max_frame_size\0";
-pub const GRPC_ARG_HTTP2_BDP_PROBE: &'static [u8; 21usize] = b"grpc.http2.bdp_probe\0";
-pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 37usize] =
- b"grpc.http2.min_time_between_pings_ms\0";
-pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 45usize] =
- b"grpc.http2.min_ping_interval_without_data_ms\0";
-pub const GRPC_ARG_HTTP2_SCHEME: &'static [u8; 18usize] = b"grpc.http2_scheme\0";
-pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &'static [u8; 34usize] =
- b"grpc.http2.max_pings_without_data\0";
-pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &'static [u8; 28usize] =
- b"grpc.http2.max_ping_strikes\0";
-pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &'static [u8; 29usize] =
- b"grpc.http2.write_buffer_size\0";
-pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &'static [u8; 23usize] = b"grpc.http2.true_binary\0";
-pub const GRPC_ARG_KEEPALIVE_TIME_MS: &'static [u8; 23usize] = b"grpc.keepalive_time_ms\0";
-pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &'static [u8; 26usize] = b"grpc.keepalive_timeout_ms\0";
-pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &'static [u8; 36usize] =
- b"grpc.keepalive_permit_without_calls\0";
-pub const GRPC_ARG_DEFAULT_AUTHORITY: &'static [u8; 23usize] = b"grpc.default_authority\0";
-pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &'static [u8; 24usize] = b"grpc.primary_user_agent\0";
-pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &'static [u8; 26usize] =
- b"grpc.secondary_user_agent\0";
-pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
- b"grpc.min_reconnect_backoff_ms\0";
-pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
- b"grpc.max_reconnect_backoff_ms\0";
-pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &'static [u8; 34usize] =
- b"grpc.initial_reconnect_backoff_ms\0";
-pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &'static [u8; 41usize] =
- b"grpc.dns_min_time_between_resolutions_ms\0";
-pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &'static [u8; 33usize] =
- b"grpc.server_handshake_timeout_ms\0";
-pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &'static [u8; 30usize] =
- b"grpc.ssl_target_name_override\0";
-pub const GRPC_SSL_SESSION_CACHE_ARG: &'static [u8; 23usize] = b"grpc.ssl_session_cache\0";
-pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &'static [u8; 24usize] = b"grpc.tsi.max_frame_size\0";
-pub const GRPC_ARG_MAX_METADATA_SIZE: &'static [u8; 23usize] = b"grpc.max_metadata_size\0";
-pub const GRPC_ARG_ALLOW_REUSEPORT: &'static [u8; 18usize] = b"grpc.so_reuseport\0";
-pub const GRPC_ARG_RESOURCE_QUOTA: &'static [u8; 20usize] = b"grpc.resource_quota\0";
-pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &'static [u8; 27usize] = b"grpc.expand_wildcard_addrs\0";
-pub const GRPC_ARG_SERVICE_CONFIG: &'static [u8; 20usize] = b"grpc.service_config\0";
-pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &'static [u8; 39usize] =
- b"grpc.service_config_disable_resolution\0";
-pub const GRPC_ARG_LB_POLICY_NAME: &'static [u8; 20usize] = b"grpc.lb_policy_name\0";
-pub const GRPC_ARG_SOCKET_MUTATOR: &'static [u8; 20usize] = b"grpc.socket_mutator\0";
-pub const GRPC_ARG_SOCKET_FACTORY: &'static [u8; 20usize] = b"grpc.socket_factory\0";
-pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &'static [u8; 45usize] =
- b"grpc.max_channel_trace_event_memory_per_node\0";
-pub const GRPC_ARG_ENABLE_CHANNELZ: &'static [u8; 21usize] = b"grpc.enable_channelz\0";
-pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &'static [u8; 34usize] =
- b"grpc.use_cronet_packet_coalescing\0";
-pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &'static [u8; 38usize] =
- b"grpc.experimental.tcp_read_chunk_size\0";
-pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192;
-pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_min_read_chunk_size\0";
-pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_max_read_chunk_size\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_tx_zerocopy_enabled\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &'static [u8; 55usize] =
- b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &'static [u8; 57usize] =
- b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0";
-pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.grpclb_call_timeout_ms\0";
-pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &'static [u8; 55usize] =
- b"grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config\0";
-pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &'static [u8; 32usize] =
- b"grpc.grpclb_fallback_timeout_ms\0";
-pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &'static [u8; 34usize] =
- b"grpc.priority_failover_timeout_ms\0";
-pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &'static [u8; 35usize] =
- b"grpc.workaround.cronet_compression\0";
-pub const GRPC_ARG_OPTIMIZATION_TARGET: &'static [u8; 25usize] = b"grpc.optimization_target\0";
-pub const GRPC_ARG_ENABLE_RETRIES: &'static [u8; 20usize] = b"grpc.enable_retries\0";
-pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &'static [u8; 31usize] =
- b"grpc.per_rpc_retry_buffer_size\0";
-pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &'static [u8; 24usize] = b"grpc.mobile_log_context\0";
-pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &'static [u8; 37usize] =
- b"grpc.disable_client_authority_filter\0";
-pub const GRPC_ARG_ENABLE_HTTP_PROXY: &'static [u8; 23usize] = b"grpc.enable_http_proxy\0";
-pub const GRPC_ARG_HTTP_PROXY: &'static [u8; 16usize] = b"grpc.http_proxy\0";
-pub const GRPC_ARG_SURFACE_USER_AGENT: &'static [u8; 24usize] = b"grpc.surface_user_agent\0";
-pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &'static [u8; 29usize] =
- b"grpc.inhibit_health_checking\0";
-pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &'static [u8; 28usize] =
- b"grpc.dns_enable_srv_queries\0";
-pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.dns_ares_query_timeout\0";
-pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &'static [u8; 31usize] =
- b"grpc.use_local_subchannel_pool\0";
-pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &'static [u8; 28usize] = b"grpc.channel_pooling_domain\0";
-pub const GRPC_ARG_CHANNEL_ID: &'static [u8; 16usize] = b"grpc.channel_id\0";
-pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1;
-pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304;
-pub const GRPC_WRITE_BUFFER_HINT: u32 = 1;
-pub const GRPC_WRITE_NO_COMPRESS: u32 = 2;
-pub const GRPC_WRITE_THROUGH: u32 = 4;
-pub const GRPC_WRITE_USED_MASK: u32 = 7;
-pub const GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST: u32 = 16;
-pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY: u32 = 32;
-pub const GRPC_INITIAL_METADATA_CACHEABLE_REQUEST: u32 = 64;
-pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET: u32 = 128;
-pub const GRPC_INITIAL_METADATA_CORKED: u32 = 256;
-pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 500;
-pub const GRPC_CQ_CURRENT_VERSION: u32 = 2;
-pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2;
-pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6;
-pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &'static [u8; 24usize] =
- b"transport_security_type\0";
-pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &'static [u8; 4usize] = b"ssl\0";
-pub const GRPC_X509_CN_PROPERTY_NAME: &'static [u8; 17usize] = b"x509_common_name\0";
-pub const GRPC_X509_SAN_PROPERTY_NAME: &'static [u8; 30usize] = b"x509_subject_alternative_name\0";
-pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &'static [u8; 14usize] = b"x509_pem_cert\0";
-pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &'static [u8; 20usize] = b"x509_pem_cert_chain\0";
-pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &'static [u8; 19usize] = b"ssl_session_reused\0";
-pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &'static [u8; 15usize] = b"security_level\0";
-pub const GRPC_PEER_DNS_PROPERTY_NAME: &'static [u8; 9usize] = b"peer_dns\0";
-pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &'static [u8; 15usize] = b"peer_spiffe_id\0";
-pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &'static [u8; 11usize] = b"peer_email\0";
-pub const GRPC_PEER_IP_PROPERTY_NAME: &'static [u8; 8usize] = b"peer_ip\0";
-pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &'static [u8; 33usize] =
- b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0";
-pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &'static [u8; 31usize] =
- b"GOOGLE_APPLICATION_CREDENTIALS\0";
-pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4;
-#[repr(u32)]
-#[doc = " The various compression algorithms supported by gRPC (not sorted by"]
-#[doc = " compression level)"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_compression_algorithm {
- GRPC_COMPRESS_NONE = 0,
- GRPC_COMPRESS_DEFLATE = 1,
- GRPC_COMPRESS_GZIP = 2,
- GRPC_COMPRESS_STREAM_GZIP = 3,
- GRPC_COMPRESS_ALGORITHMS_COUNT = 4,
-}
-#[repr(u32)]
-#[doc = " Compression levels allow a party with knowledge of its peer's accepted"]
-#[doc = " encodings to request compression in an abstract way. The level-algorithm"]
-#[doc = " mapping is performed internally and depends on the peer's supported"]
-#[doc = " compression algorithms."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_compression_level {
- GRPC_COMPRESS_LEVEL_NONE = 0,
- GRPC_COMPRESS_LEVEL_LOW = 1,
- GRPC_COMPRESS_LEVEL_MED = 2,
- GRPC_COMPRESS_LEVEL_HIGH = 3,
- GRPC_COMPRESS_LEVEL_COUNT = 4,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options {
- #[doc = " All algs are enabled by default. This option corresponds to the channel"]
- #[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"]
- pub enabled_algorithms_bitset: u32,
- pub default_level: grpc_compression_options_grpc_compression_options_default_level,
- pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm,
-}
-#[doc = " The default compression level. It'll be used in the absence of call"]
-#[doc = " specific settings. This option corresponds to the channel"]
-#[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,"]
-#[doc = " takes precedence over \\a default_algorithm."]
-#[doc = " TODO(dgq): currently only available for server channels."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options_grpc_compression_options_default_level {
- pub is_set: ::std::os::raw::c_int,
- pub level: grpc_compression_level,
-}
-#[doc = " The default message compression algorithm. It'll be used in the absence of"]
-#[doc = " call specific settings. This option corresponds to the channel argument key"]
-#[doc = " behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options_grpc_compression_options_default_algorithm {
- pub is_set: ::std::os::raw::c_int,
- pub algorithm: grpc_compression_algorithm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_refcount {
- _unused: [u8; 0],
-}
-#[doc = " A grpc_slice s, if initialized, represents the byte range"]
-#[doc = "s.bytes[0..s.length-1]."]
-#[doc = ""]
-#[doc = "It can have an associated ref count which has a destruction routine to be run"]
-#[doc = "when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref())."]
-#[doc = "Multiple grpc_slice values may share a ref count."]
-#[doc = ""]
-#[doc = "If the slice does not have a refcount, it represents an inlined small piece"]
-#[doc = "of data that is copied by value."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_slice {
- pub refcount: *mut grpc_slice_refcount,
- pub data: grpc_slice_grpc_slice_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_slice_grpc_slice_data {
- pub refcounted: grpc_slice_grpc_slice_data_grpc_slice_refcounted,
- pub inlined: grpc_slice_grpc_slice_data_grpc_slice_inlined,
- _bindgen_union_align: [u64; 3usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted {
- pub length: usize,
- pub bytes: *mut u8,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined {
- pub length: u8,
- pub bytes: [u8; 23usize],
-}
-impl ::std::fmt::Debug for grpc_slice_grpc_slice_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_slice_grpc_slice_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_slice {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_slice {{ refcount: {:?}, data: {:?} }}",
- self.refcount, self.data
- )
- }
-}
-#[doc = " Represents an expandable array of slices, to be interpreted as a"]
-#[doc = "single item."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_slice_buffer {
- #[doc = " This is for internal use only. External users (i.e any code outside grpc"]
- #[doc = " core) MUST NOT use this field"]
- pub base_slices: *mut grpc_slice,
- #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"]
- pub slices: *mut grpc_slice,
- #[doc = " the number of slices in the array"]
- pub count: usize,
- #[doc = " the number of slices allocated in the array. External users (i.e any code"]
- #[doc = " outside grpc core) MUST NOT use this field"]
- pub capacity: usize,
- #[doc = " the combined length of all slices in the array"]
- pub length: usize,
- #[doc = " inlined elements to avoid allocations"]
- pub inlined: [grpc_slice; 8usize],
-}
-impl ::std::fmt::Debug for grpc_slice_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined)
- }
-}
-#[repr(u32)]
-#[doc = " The clocks we support."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum gpr_clock_type {
- #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."]
- GPR_CLOCK_MONOTONIC = 0,
- #[doc = " Realtime clock. May jump forwards or backwards. Settable by"]
- #[doc = "the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."]
- GPR_CLOCK_REALTIME = 1,
- #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch"]
- #[doc = "undefined. Degrades to GPR_CLOCK_REALTIME on other platforms."]
- GPR_CLOCK_PRECISE = 2,
- #[doc = " Unmeasurable clock type: no base, created by taking the difference"]
- #[doc = "between two times"]
- GPR_TIMESPAN = 3,
-}
-#[doc = " Analogous to struct timespec. On some machines, absolute times may be in"]
-#[doc = " local time."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_timespec {
- pub tv_sec: i64,
- pub tv_nsec: i32,
- #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if"]
- #[doc = "this is a relative time measure)"]
- pub clock_type: gpr_clock_type,
-}
-pub type gpr_atm = isize;
-extern "C" {
- #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"]
- #[doc = "by \\a min and \\a max. Returns the new value."]
- pub fn gpr_atm_no_barrier_clamped_add(
- value: *mut gpr_atm,
- delta: gpr_atm,
- min: gpr_atm,
- max: gpr_atm,
- ) -> gpr_atm;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_event {
- pub state: gpr_atm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_refcount {
- pub count: gpr_atm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_stats_counter {
- pub value: gpr_atm,
-}
-extern "C" {
- #[doc = " Initialize *ev."]
- pub fn gpr_event_init(ev: *mut gpr_event);
-}
-extern "C" {
- #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value."]
- #[doc = "Requires: *ev initialized; value != NULL; no prior or concurrent calls to"]
- #[doc = "gpr_event_set(ev, ...) since initialization."]
- pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has"]
- #[doc = "completed. If the result is non-NULL, all operations that occurred prior to"]
- #[doc = "the gpr_event_set(ev, ...) set will be visible after this call returns."]
- #[doc = "Requires: *ev initialized. This operation is faster than acquiring a mutex"]
- #[doc = "on most platforms."]
- pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is"]
- #[doc = "exceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use"]
- #[doc = "abs_deadline==gpr_inf_future for no deadline. When the event has been"]
- #[doc = "signalled before the call, this operation is faster than acquiring a mutex"]
- #[doc = "on most platforms."]
- pub fn gpr_event_wait(
- ev: *mut gpr_event,
- abs_deadline: gpr_timespec,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Initialize *r to value n."]
- pub fn gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
-}
-extern "C" {
- #[doc = " Increment the reference count *r. Requires *r initialized."]
- pub fn gpr_ref(r: *mut gpr_refcount);
-}
-extern "C" {
- #[doc = " Increment the reference count *r. Requires *r initialized."]
- #[doc = "Crashes if refcount is zero"]
- pub fn gpr_ref_non_zero(r: *mut gpr_refcount);
-}
-extern "C" {
- #[doc = " Increment the reference count *r by n. Requires *r initialized, n > 0."]
- pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
-}
-extern "C" {
- #[doc = " Decrement the reference count *r and return non-zero iff it has reached"]
- #[doc = "zero. . Requires *r initialized."]
- pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned"]
- #[doc = "by exactly one object."]
- pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Initialize *c to the value n."]
- pub fn gpr_stats_init(c: *mut gpr_stats_counter, n: isize);
-}
-extern "C" {
- #[doc = " *c += inc. Requires: *c initialized."]
- pub fn gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize);
-}
-extern "C" {
- #[doc = " Return *c. Requires: *c initialized."]
- pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize;
-}
-extern "C" {
- #[doc = " Increment the refcount of s. Requires slice is initialized."]
- #[doc = "Returns s."]
- pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all"]
- #[doc = "slices sharing the ref count are destroyed, and considered no longer"]
- #[doc = "initialized. If s is ultimately derived from a call to grpc_slice_new(start,"]
- #[doc = "len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is"]
- #[doc = "ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)"]
- #[doc = "where dest!=NULL , then (*dest)(start, len). Requires s initialized."]
- pub fn grpc_slice_unref(s: grpc_slice);
-}
-extern "C" {
- #[doc = " Copy slice - create a new slice that contains the same data as s"]
- pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount"]
- #[doc = "for the object, and arranges that destroy will be called with the pointer"]
- #[doc = "passed in at destruction."]
- pub fn grpc_slice_new(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is"]
- #[doc = "passed to the destroy function. This function can be useful when"]
- #[doc = "the data is part of a larger structure that must be destroyed when"]
- #[doc = "the data is no longer needed."]
- pub fn grpc_slice_new_with_user_data(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
- user_data: *mut ::std::os::raw::c_void,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that"]
- #[doc = "also takes the slice length."]
- pub fn grpc_slice_new_with_len(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<
- unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize),
- >,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()"]
- #[doc = "call."]
- #[doc = "Aborts if malloc() fails."]
- pub fn grpc_slice_malloc(length: usize) -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Intern a slice:"]
- #[doc = ""]
- #[doc = "The return value for two invocations of this function with the same sequence"]
- #[doc = "of bytes is a slice which points to the same memory."]
- pub fn grpc_slice_intern(slice: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice by copying a string."]
- #[doc = "Does not preserve null terminators."]
- #[doc = "Equivalent to:"]
- #[doc = "size_t len = strlen(source);"]
- #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
- #[doc = "memcpy(slice->data, source, len);"]
- pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice by copying a buffer."]
- #[doc = "Equivalent to:"]
- #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
- #[doc = "memcpy(slice->data, source, len);"]
- pub fn grpc_slice_from_copied_buffer(
- source: *const ::std::os::raw::c_char,
- len: usize,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing to constant memory"]
- pub fn grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing to constant memory"]
- pub fn grpc_slice_from_static_buffer(
- source: *const ::std::os::raw::c_void,
- len: usize,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,"]
- #[doc = "where result.data==s.data+begin, and result.length==end-begin. The ref count"]
- #[doc = "of \\a s is increased by one. Do not assign result back to \\a s."]
- #[doc = "Requires s initialized, begin <= end, begin <= s.length, and"]
- #[doc = "end <= source->length."]
- pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " The same as grpc_slice_sub, but without altering the ref count"]
- pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,"]
- #[doc = "sharing a refcount with s, that contains s[split:s.length]."]
- #[doc = "Requires s initialized, split <= s.length"]
- pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_slice_ref_whom {
- GRPC_SLICE_REF_TAIL = 1,
- GRPC_SLICE_REF_HEAD = 2,
- GRPC_SLICE_REF_BOTH = 3,
-}
-extern "C" {
- #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering"]
- #[doc = " refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to"]
- #[doc = " grpc_slice_split_tail(...))"]
- pub fn grpc_slice_split_tail_maybe_ref(
- s: *mut grpc_slice,
- split: usize,
- ref_whom: grpc_slice_ref_whom,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new"]
- #[doc = "slice, sharing a refcount with s, that contains s[0:split]."]
- #[doc = "Requires s initialized, split <= s.length"]
- pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_empty_slice() -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_slice_default_hash_impl(s: grpc_slice) -> u32;
-}
-extern "C" {
- pub fn grpc_slice_default_eq_impl(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b"]
- #[doc = "The order is arbitrary, and is not guaranteed to be stable across different"]
- #[doc = "versions of the API."]
- pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_str_cmp(
- a: grpc_slice,
- b: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return non-zero if the first blen bytes of a are equal to b"]
- pub fn grpc_slice_buf_start_eq(
- a: grpc_slice,
- b: *const ::std::os::raw::c_void,
- blen: usize,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return the index of the last instance of \\a c in \\a s, or -1 if not found"]
- pub fn grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1"]
- #[doc = "if it's not found"]
- pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_hash(s: grpc_slice) -> u32;
-}
-extern "C" {
- #[doc = " Do two slices point at the same memory, with the same length"]
- #[doc = "If a or b is inlined, actually compares data"]
- pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return a slice pointing to newly allocated memory that has the same contents"]
- #[doc = " as \\a s"]
- pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Return a copy of slice as a C string. Offers no protection against embedded"]
- #[doc = "NULL's. Returned string must be freed with gpr_free."]
- pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Return if an algorithm is message compression algorithm."]
- pub fn grpc_compression_algorithm_is_message(
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return if an algorithm is stream compression algorithm."]
- pub fn grpc_compression_algorithm_is_stream(
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a"]
- #[doc = " algorithm. Returns 1 upon success, 0 otherwise."]
- pub fn grpc_compression_algorithm_parse(
- name: grpc_slice,
- algorithm: *mut grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a"]
- #[doc = " algorithm. Note that \\a name is statically allocated and must *not* be freed."]
- #[doc = " Returns 1 upon success, 0 otherwise."]
- pub fn grpc_compression_algorithm_name(
- algorithm: grpc_compression_algorithm,
- name: *mut *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Returns the compression algorithm corresponding to \\a level for the"]
- #[doc = " compression algorithms encoded in the \\a accepted_encodings bitset."]
- pub fn grpc_compression_algorithm_for_level(
- level: grpc_compression_level,
- accepted_encodings: u32,
- ) -> grpc_compression_algorithm;
-}
-extern "C" {
- pub fn grpc_compression_options_init(opts: *mut grpc_compression_options);
-}
-extern "C" {
- #[doc = " Mark \\a algorithm as enabled in \\a opts."]
- pub fn grpc_compression_options_enable_algorithm(
- opts: *mut grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- );
-}
-extern "C" {
- #[doc = " Mark \\a algorithm as disabled in \\a opts."]
- pub fn grpc_compression_options_disable_algorithm(
- opts: *mut grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- );
-}
-extern "C" {
- #[doc = " Returns true if \\a algorithm is marked as enabled in \\a opts."]
- pub fn grpc_compression_options_is_algorithm_enabled(
- opts: *const grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-pub mod grpc_status_code {
- pub type Type = ::std::os::raw::c_int;
- #[doc = " Not an error; returned on success"]
- pub const GRPC_STATUS_OK: Type = 0;
- #[doc = " The operation was cancelled (typically by the caller)."]
- pub const GRPC_STATUS_CANCELLED: Type = 1;
- #[doc = " Unknown error. An example of where this error may be returned is"]
- #[doc = "if a Status value received from another address space belongs to"]
- #[doc = "an error-space that is not known in this address space. Also"]
- #[doc = "errors raised by APIs that do not return enough error information"]
- #[doc = "may be converted to this error."]
- pub const GRPC_STATUS_UNKNOWN: Type = 2;
- #[doc = " Client specified an invalid argument. Note that this differs"]
- #[doc = "from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments"]
- #[doc = "that are problematic regardless of the state of the system"]
- #[doc = "(e.g., a malformed file name)."]
- pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3;
- #[doc = " Deadline expired before operation could complete. For operations"]
- #[doc = "that change the state of the system, this error may be returned"]
- #[doc = "even if the operation has completed successfully. For example, a"]
- #[doc = "successful response from a server could have been delayed long"]
- #[doc = "enough for the deadline to expire."]
- pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4;
- #[doc = " Some requested entity (e.g., file or directory) was not found."]
- pub const GRPC_STATUS_NOT_FOUND: Type = 5;
- #[doc = " Some entity that we attempted to create (e.g., file or directory)"]
- #[doc = "already exists."]
- pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6;
- #[doc = " The caller does not have permission to execute the specified"]
- #[doc = "operation. PERMISSION_DENIED must not be used for rejections"]
- #[doc = "caused by exhausting some resource (use RESOURCE_EXHAUSTED"]
- #[doc = "instead for those errors). PERMISSION_DENIED must not be"]
- #[doc = "used if the caller can not be identified (use UNAUTHENTICATED"]
- #[doc = "instead for those errors)."]
- pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7;
- #[doc = " The request does not have valid authentication credentials for the"]
- #[doc = "operation."]
- pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16;
- #[doc = " Some resource has been exhausted, perhaps a per-user quota, or"]
- #[doc = "perhaps the entire file system is out of space."]
- pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8;
- #[doc = " Operation was rejected because the system is not in a state"]
- #[doc = "required for the operation's execution. For example, directory"]
- #[doc = "to be deleted may be non-empty, an rmdir operation is applied to"]
- #[doc = "a non-directory, etc."]
- #[doc = ""]
- #[doc = "A litmus test that may help a service implementor in deciding"]
- #[doc = "between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:"]
- #[doc = "(a) Use UNAVAILABLE if the client can retry just the failing call."]
- #[doc = "(b) Use ABORTED if the client should retry at a higher-level"]
- #[doc = "(e.g., restarting a read-modify-write sequence)."]
- #[doc = "(c) Use FAILED_PRECONDITION if the client should not retry until"]
- #[doc = "the system state has been explicitly fixed. E.g., if an \"rmdir\""]
- #[doc = "fails because the directory is non-empty, FAILED_PRECONDITION"]
- #[doc = "should be returned since the client should not retry unless"]
- #[doc = "they have first fixed up the directory by deleting files from it."]
- #[doc = "(d) Use FAILED_PRECONDITION if the client performs conditional"]
- #[doc = "REST Get/Update/Delete on a resource and the resource on the"]
- #[doc = "server does not match the condition. E.g., conflicting"]
- #[doc = "read-modify-write on the same resource."]
- pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9;
- #[doc = " The operation was aborted, typically due to a concurrency issue"]
- #[doc = "like sequencer check failures, transaction aborts, etc."]
- #[doc = ""]
- #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
- #[doc = "ABORTED, and UNAVAILABLE."]
- pub const GRPC_STATUS_ABORTED: Type = 10;
- #[doc = " Operation was attempted past the valid range. E.g., seeking or"]
- #[doc = "reading past end of file."]
- #[doc = ""]
- #[doc = "Unlike INVALID_ARGUMENT, this error indicates a problem that may"]
- #[doc = "be fixed if the system state changes. For example, a 32-bit file"]
- #[doc = "system will generate INVALID_ARGUMENT if asked to read at an"]
- #[doc = "offset that is not in the range [0,2^32-1], but it will generate"]
- #[doc = "OUT_OF_RANGE if asked to read from an offset past the current"]
- #[doc = "file size."]
- #[doc = ""]
- #[doc = "There is a fair bit of overlap between FAILED_PRECONDITION and"]
- #[doc = "OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific"]
- #[doc = "error) when it applies so that callers who are iterating through"]
- #[doc = "a space can easily look for an OUT_OF_RANGE error to detect when"]
- #[doc = "they are done."]
- pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11;
- #[doc = " Operation is not implemented or not supported/enabled in this service."]
- pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12;
- #[doc = " Internal errors. Means some invariants expected by underlying"]
- #[doc = "system has been broken. If you see one of these errors,"]
- #[doc = "something is very broken."]
- pub const GRPC_STATUS_INTERNAL: Type = 13;
- #[doc = " The service is currently unavailable. This is a most likely a"]
- #[doc = "transient condition and may be corrected by retrying with"]
- #[doc = "a backoff. Note that it is not always safe to retry non-idempotent"]
- #[doc = "operations."]
- #[doc = ""]
- #[doc = "WARNING: Although data MIGHT not have been transmitted when this"]
- #[doc = "status occurs, there is NOT A GUARANTEE that the server has not seen"]
- #[doc = "anything. So in general it is unsafe to retry on this status code"]
- #[doc = "if the call is non-idempotent."]
- #[doc = ""]
- #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
- #[doc = "ABORTED, and UNAVAILABLE."]
- pub const GRPC_STATUS_UNAVAILABLE: Type = 14;
- #[doc = " Unrecoverable data loss or corruption."]
- pub const GRPC_STATUS_DATA_LOSS: Type = 15;
- #[doc = " Force users to include a default branch:"]
- pub const GRPC_STATUS__DO_NOT_USE: Type = -1;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_byte_buffer_type {
- GRPC_BB_RAW = 0,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer {
- pub reserved: *mut ::std::os::raw::c_void,
- pub type_: grpc_byte_buffer_type,
- pub data: grpc_byte_buffer_grpc_byte_buffer_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_byte_buffer_grpc_byte_buffer_data {
- pub reserved: grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1,
- pub raw: grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer,
- _bindgen_union_align: [u64; 38usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 {
- pub reserved: [*mut ::std::os::raw::c_void; 8usize],
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
- pub compression: grpc_compression_algorithm,
- pub slice_buffer: grpc_slice_buffer,
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer)
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}",
- self.reserved, self.type_, self.data
- )
- }
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_alarm {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_call {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_socket_mutator {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_socket_factory {
- _unused: [u8; 0],
-}
-#[repr(u32)]
-#[doc = " Type specifier for grpc_arg"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_arg_type {
- GRPC_ARG_STRING = 0,
- GRPC_ARG_INTEGER = 1,
- GRPC_ARG_POINTER = 2,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_arg_pointer_vtable {
- pub copy: ::std::option::Option<
- unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
- >,
- pub destroy: ::std::option::Option<unsafe extern "C" fn(p: *mut ::std::os::raw::c_void)>,
- pub cmp: ::std::option::Option<
- unsafe extern "C" fn(
- p: *mut ::std::os::raw::c_void,
- q: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
-}
-#[doc = " A single argument... each argument has a key and a value"]
-#[doc = ""]
-#[doc = "A note on naming keys:"]
-#[doc = "Keys are namespaced into groups, usually grouped by library, and are"]
-#[doc = "keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must"]
-#[doc = "be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}."]
-#[doc = "Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}."]
-#[doc = ""]
-#[doc = "GRPC core library keys are prefixed by grpc."]
-#[doc = ""]
-#[doc = "Library authors are strongly encouraged to \\#define symbolic constants for"]
-#[doc = "their keys so that it's possible to change them in the future."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_arg {
- pub type_: grpc_arg_type,
- pub key: *mut ::std::os::raw::c_char,
- pub value: grpc_arg_grpc_arg_value,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_arg_grpc_arg_value {
- pub string: *mut ::std::os::raw::c_char,
- pub integer: ::std::os::raw::c_int,
- pub pointer: grpc_arg_grpc_arg_value_grpc_arg_pointer,
- _bindgen_union_align: [u64; 2usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer {
- pub p: *mut ::std::os::raw::c_void,
- pub vtable: *const grpc_arg_pointer_vtable,
-}
-impl ::std::fmt::Debug for grpc_arg_grpc_arg_value {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_arg_grpc_arg_value {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_arg {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}",
- self.type_, self.key, self.value
- )
- }
-}
-#[doc = " An array of arguments that can be passed around."]
-#[doc = ""]
-#[doc = "Used to set optional channel-level configuration."]
-#[doc = "These configuration options are modelled as key-value pairs as defined"]
-#[doc = "by grpc_arg; keys are strings to allow easy backwards-compatible extension"]
-#[doc = "by arbitrary parties. All evaluation is performed at channel creation"]
-#[doc = "time (i.e. the keys and values in this structure need only live through the"]
-#[doc = "creation invocation)."]
-#[doc = ""]
-#[doc = "However, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the"]
-#[doc = "grpc_arg_pointer_vtable must live until the channel args are done being"]
-#[doc = "used by core (i.e. when the object for use with which they were passed"]
-#[doc = "is destroyed)."]
-#[doc = ""]
-#[doc = "See the description of the \\ref grpc_arg_keys \"available args\" for more"]
-#[doc = "details."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_args {
- pub num_args: usize,
- pub args: *mut grpc_arg,
-}
-#[repr(u32)]
-#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a"]
-#[doc = "particular operation, the grpc_call_error returned will be GRPC_CALL_OK."]
-#[doc = "Receiving any other value listed here is an indication of a bug in the"]
-#[doc = "caller."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_call_error {
- #[doc = " everything went ok"]
- GRPC_CALL_OK = 0,
- #[doc = " something failed, we don't know what"]
- GRPC_CALL_ERROR = 1,
- #[doc = " this method is not available on the server"]
- GRPC_CALL_ERROR_NOT_ON_SERVER = 2,
- #[doc = " this method is not available on the client"]
- GRPC_CALL_ERROR_NOT_ON_CLIENT = 3,
- #[doc = " this method must be called before server_accept"]
- GRPC_CALL_ERROR_ALREADY_ACCEPTED = 4,
- #[doc = " this method must be called before invoke"]
- GRPC_CALL_ERROR_ALREADY_INVOKED = 5,
- #[doc = " this method must be called after invoke"]
- GRPC_CALL_ERROR_NOT_INVOKED = 6,
- #[doc = " this call is already finished"]
- #[doc = "(writes_done or write_status has already been called)"]
- GRPC_CALL_ERROR_ALREADY_FINISHED = 7,
- #[doc = " there is already an outstanding read/write operation on the call"]
- GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8,
- #[doc = " the flags value was illegal for this call"]
- GRPC_CALL_ERROR_INVALID_FLAGS = 9,
- #[doc = " invalid metadata was passed to this call"]
- GRPC_CALL_ERROR_INVALID_METADATA = 10,
- #[doc = " invalid message was passed to this call"]
- GRPC_CALL_ERROR_INVALID_MESSAGE = 11,
- #[doc = " completion queue for notification has not been registered"]
- #[doc = " with the server"]
- GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12,
- #[doc = " this batch of operations leads to more operations than allowed"]
- GRPC_CALL_ERROR_BATCH_TOO_BIG = 13,
- #[doc = " payload type requested is not the type registered"]
- GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH = 14,
- #[doc = " completion queue has been shutdown"]
- GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN = 15,
-}
-#[doc = " A single metadata element"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_metadata {
- #[doc = " the key, value values are expected to line up with grpc_mdelem: if"]
- #[doc = "changing them, update metadata.h at the same time."]
- pub key: grpc_slice,
- pub value: grpc_slice,
- pub flags: u32,
- pub internal_data: grpc_metadata__bindgen_ty_1,
-}
-#[doc = " The following fields are reserved for grpc internal use."]
-#[doc = "There is no need to initialize them, and they will be set to garbage"]
-#[doc = "during calls to grpc."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata__bindgen_ty_1 {
- pub obfuscated: [*mut ::std::os::raw::c_void; 4usize],
-}
-impl ::std::fmt::Debug for grpc_metadata {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_metadata {{ key: {:?}, value: {:?}, flags: {:?}, internal_data: {:?} }}",
- self.key, self.value, self.flags, self.internal_data
- )
- }
-}
-#[repr(u32)]
-#[doc = " The type of completion (for grpc_event)"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_completion_type {
- #[doc = " Shutting down"]
- GRPC_QUEUE_SHUTDOWN = 0,
- #[doc = " No event before timeout"]
- GRPC_QUEUE_TIMEOUT = 1,
- #[doc = " Operation completion"]
- GRPC_OP_COMPLETE = 2,
-}
-#[doc = " The result of an operation."]
-#[doc = ""]
-#[doc = "Returned by a completion queue when the operation started with tag."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_event {
- #[doc = " The type of the completion."]
- pub type_: grpc_completion_type,
- #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates"]
- #[doc = "whether the operation was successful or not; 0 in case of failure and"]
- #[doc = "non-zero in case of success."]
- #[doc = "If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this"]
- #[doc = "field is guaranteed to be 0"]
- pub success: ::std::os::raw::c_int,
- #[doc = " The tag passed to grpc_call_start_batch etc to start this operation."]
- #[doc = "Only* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type"]
- #[doc = "values, tag is uninitialized."]
- pub tag: *mut ::std::os::raw::c_void,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata_array {
- pub count: usize,
- pub capacity: usize,
- pub metadata: *mut grpc_metadata,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_call_details {
- pub method: grpc_slice,
- pub host: grpc_slice,
- pub deadline: gpr_timespec,
- pub flags: u32,
- pub reserved: *mut ::std::os::raw::c_void,
-}
-impl ::std::fmt::Debug for grpc_call_details {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved)
- }
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_op_type {
- #[doc = " Send initial metadata: one and only one instance MUST be sent for each"]
- #[doc = "call, unless the call was cancelled - in which case this can be skipped."]
- #[doc = "This op completes after all bytes of metadata have been accepted by"]
- #[doc = "outgoing flow control."]
- GRPC_OP_SEND_INITIAL_METADATA = 0,
- #[doc = " Send a message: 0 or more of these operations can occur for each call."]
- #[doc = "This op completes after all bytes for the message have been accepted by"]
- #[doc = "outgoing flow control."]
- GRPC_OP_SEND_MESSAGE = 1,
- #[doc = " Send a close from the client: one and only one instance MUST be sent from"]
- #[doc = "the client, unless the call was cancelled - in which case this can be"]
- #[doc = "skipped. This op completes after all bytes for the call"]
- #[doc = "(including the close) have passed outgoing flow control."]
- GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2,
- #[doc = " Send status from the server: one and only one instance MUST be sent from"]
- #[doc = "the server unless the call was cancelled - in which case this can be"]
- #[doc = "skipped. This op completes after all bytes for the call"]
- #[doc = "(including the status) have passed outgoing flow control."]
- GRPC_OP_SEND_STATUS_FROM_SERVER = 3,
- #[doc = " Receive initial metadata: one and only one MUST be made on the client,"]
- #[doc = "must not be made on the server."]
- #[doc = "This op completes after all initial metadata has been read from the"]
- #[doc = "peer."]
- GRPC_OP_RECV_INITIAL_METADATA = 4,
- #[doc = " Receive a message: 0 or more of these operations can occur for each call."]
- #[doc = "This op completes after all bytes of the received message have been"]
- #[doc = "read, or after a half-close has been received on this call."]
- GRPC_OP_RECV_MESSAGE = 5,
- #[doc = " Receive status on the client: one and only one must be made on the client."]
- #[doc = "This operation always succeeds, meaning ops paired with this operation"]
- #[doc = "will also appear to succeed, even though they may not have. In that case"]
- #[doc = "the status will indicate some failure."]
- #[doc = "This op completes after all activity on the call has completed."]
- GRPC_OP_RECV_STATUS_ON_CLIENT = 6,
- #[doc = " Receive close on the server: one and only one must be made on the"]
- #[doc = "server. This op completes after the close has been received by the"]
- #[doc = "server. This operation always succeeds, meaning ops paired with"]
- #[doc = "this operation will also appear to succeed, even though they may not"]
- #[doc = "have."]
- GRPC_OP_RECV_CLOSE_ON_SERVER = 7,
-}
-#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT"]
-#[doc = "which has no arguments)"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_op {
- #[doc = " Operation type, as defined by grpc_op_type"]
- pub op: grpc_op_type,
- #[doc = " Write flags bitset for grpc_begin_messages"]
- pub flags: u32,
- #[doc = " Reserved for future usage"]
- pub reserved: *mut ::std::os::raw::c_void,
- pub data: grpc_op_grpc_op_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_op_grpc_op_data {
- pub reserved: grpc_op_grpc_op_data__bindgen_ty_1,
- pub send_initial_metadata: grpc_op_grpc_op_data_grpc_op_send_initial_metadata,
- pub send_message: grpc_op_grpc_op_data_grpc_op_send_message,
- pub send_status_from_server: grpc_op_grpc_op_data_grpc_op_send_status_from_server,
- pub recv_initial_metadata: grpc_op_grpc_op_data_grpc_op_recv_initial_metadata,
- pub recv_message: grpc_op_grpc_op_data_grpc_op_recv_message,
- pub recv_status_on_client: grpc_op_grpc_op_data_grpc_op_recv_status_on_client,
- pub recv_close_on_server: grpc_op_grpc_op_data_grpc_op_recv_close_on_server,
- _bindgen_union_align: [u64; 8usize],
-}
-#[doc = " Reserved for future usage"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data__bindgen_ty_1 {
- pub reserved: [*mut ::std::os::raw::c_void; 8usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata { pub count : usize , pub metadata : * mut grpc_metadata , pub maybe_compression_level : grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level , }
-#[doc = " If \\a is_set, \\a compression_level will be used for the call."]
-#[doc = " Otherwise, \\a compression_level won't be considered"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level
-{
- pub is_set: u8,
- pub level: grpc_compression_level,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_message {
- #[doc = " This op takes ownership of the slices in send_message. After"]
- #[doc = " a call completes, the contents of send_message are not guaranteed"]
- #[doc = " and likely empty. The original owner should still call"]
- #[doc = " grpc_byte_buffer_destroy() on this object however."]
- pub send_message: *mut grpc_byte_buffer,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server {
- pub trailing_metadata_count: usize,
- pub trailing_metadata: *mut grpc_metadata,
- pub status: grpc_status_code::Type,
- #[doc = " optional: set to NULL if no details need sending, non-NULL if they do"]
- #[doc = " pointer will not be retained past the start_batch call"]
- pub status_details: *mut grpc_slice,
-}
-#[doc = " ownership of the array is with the caller, but ownership of the elements"]
-#[doc = "stays with the call object (ie key, value members are owned by the call"]
-#[doc = "object, recv_initial_metadata->array is owned by the caller)."]
-#[doc = "After the operation completes, call grpc_metadata_array_destroy on this"]
-#[doc = "value, or reuse it in a future op."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata {
- pub recv_initial_metadata: *mut grpc_metadata_array,
-}
-#[doc = " ownership of the byte buffer is moved to the caller; the caller must"]
-#[doc = "call grpc_byte_buffer_destroy on this value, or reuse it in a future op."]
-#[doc = "The returned byte buffer will be NULL if trailing metadata was"]
-#[doc = "received instead of a message."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_message {
- pub recv_message: *mut *mut grpc_byte_buffer,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client {
- #[doc = " ownership of the array is with the caller, but ownership of the"]
- #[doc = "elements stays with the call object (ie key, value members are owned"]
- #[doc = "by the call object, trailing_metadata->array is owned by the caller)."]
- #[doc = "After the operation completes, call grpc_metadata_array_destroy on"]
- #[doc = "this value, or reuse it in a future op."]
- pub trailing_metadata: *mut grpc_metadata_array,
- pub status: *mut grpc_status_code::Type,
- pub status_details: *mut grpc_slice,
- #[doc = " If this is not nullptr, it will be populated with the full fidelity"]
- #[doc = " error string for debugging purposes. The application is responsible"]
- #[doc = " for freeing the data by using gpr_free()."]
- pub error_string: *mut *const ::std::os::raw::c_char,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server {
- #[doc = " out argument, set to 1 if the call failed at the server for"]
- #[doc = "a reason other than a non-OK status (cancel, deadline"]
- #[doc = "exceeded, network failure, etc.), 0 otherwise (RPC processing ran to"]
- #[doc = "completion and was able to provide any status from the server)"]
- pub cancelled: *mut ::std::os::raw::c_int,
-}
-impl ::std::fmt::Debug for grpc_op_grpc_op_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_op_grpc_op_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_op {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_op {{ op: {:?}, flags: {:?}, reserved: {:?}, data: {:?} }}",
- self.op, self.flags, self.reserved, self.data
- )
- }
-}
-#[doc = " Information requested from the channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_info {
- #[doc = " If non-NULL, will be set to point to a string indicating the LB"]
- #[doc = " policy name. Caller takes ownership."]
- pub lb_policy_name: *mut *mut ::std::os::raw::c_char,
- #[doc = " If non-NULL, will be set to point to a string containing the"]
- #[doc = " service config used by the channel in JSON form."]
- pub service_config_json: *mut *mut ::std::os::raw::c_char,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_resource_quota {
- _unused: [u8; 0],
-}
-#[repr(u32)]
-#[doc = " Completion queues internally MAY maintain a set of file descriptors in a"]
-#[doc = "structure called 'pollset'. This enum specifies if a completion queue has an"]
-#[doc = "associated pollset and any restrictions on the type of file descriptors that"]
-#[doc = "can be present in the pollset."]
-#[doc = ""]
-#[doc = "I/O progress can only be made when grpc_completion_queue_next() or"]
-#[doc = "grpc_completion_queue_pluck() are called on the completion queue (unless the"]
-#[doc = "grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important"]
-#[doc = "to actively call these APIs"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_cq_polling_type {
- #[doc = " The completion queue will have an associated pollset and there is no"]
- #[doc = "restriction on the type of file descriptors the pollset may contain"]
- GRPC_CQ_DEFAULT_POLLING = 0,
- #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will"]
- #[doc = "not contain any 'listening file descriptors' (i.e file descriptors used to"]
- #[doc = "listen to incoming channels)"]
- GRPC_CQ_NON_LISTENING = 1,
- #[doc = " The completion queue will not have an associated pollset. Note that"]
- #[doc = "grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still"]
- #[doc = "be called to pop events from the completion queue; it is not required to"]
- #[doc = "call them actively to make I/O progress"]
- GRPC_CQ_NON_POLLING = 2,
-}
-#[repr(u32)]
-#[doc = " Specifies the type of APIs to use to pop events from the completion queue"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_cq_completion_type {
- #[doc = " Events are popped out by calling grpc_completion_queue_next() API ONLY"]
- GRPC_CQ_NEXT = 0,
- #[doc = " Events are popped out by calling grpc_completion_queue_pluck() API ONLY"]
- GRPC_CQ_PLUCK = 1,
- #[doc = " EXPERIMENTAL: Events trigger a callback specified as the tag"]
- GRPC_CQ_CALLBACK = 2,
-}
-#[doc = " EXPERIMENTAL: Specifies an interface class to be used as a tag"]
-#[doc = "for callback-based completion queues. This can be used directly,"]
-#[doc = "as the first element of a struct in C, or as a base class in C++."]
-#[doc = "Its \"run\" value should be assigned to some non-member function, such as"]
-#[doc = "a static method."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_experimental_completion_queue_functor {
- #[doc = " The run member specifies a function that will be called when this"]
- #[doc = "tag is extracted from the completion queue. Its arguments will be a"]
- #[doc = "pointer to this functor and a boolean that indicates whether the"]
- #[doc = "operation succeeded (non-zero) or failed (zero)"]
- pub functor_run: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut grpc_experimental_completion_queue_functor,
- arg2: ::std::os::raw::c_int,
- ),
- >,
- #[doc = " The inlineable member specifies whether this functor can be run inline."]
- #[doc = "This should only be used for trivial internally-defined functors."]
- pub inlineable: ::std::os::raw::c_int,
- #[doc = " The following fields are not API. They are meant for internal use."]
- pub internal_success: ::std::os::raw::c_int,
- pub internal_next: *mut grpc_experimental_completion_queue_functor,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue_attributes {
- #[doc = " The version number of this structure. More fields might be added to this"]
- #[doc = "structure in future."]
- pub version: ::std::os::raw::c_int,
- #[doc = " Set to GRPC_CQ_CURRENT_VERSION"]
- pub cq_completion_type: grpc_cq_completion_type,
- pub cq_polling_type: grpc_cq_polling_type,
- #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when"]
- #[doc = " shutdown is complete"]
- pub cq_shutdown_cb: *mut grpc_experimental_completion_queue_functor,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue_factory {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices)."]
- #[doc = ""]
- #[doc = " Increases the reference count for all \\a slices processed. The user is"]
- #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
- pub fn grpc_raw_byte_buffer_create(
- slices: *mut grpc_slice,
- nslices: usize,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to"]
- #[doc = " \\a nslices). The \\a compression argument defines the compression algorithm"]
- #[doc = " used to generate the data in \\a slices."]
- #[doc = ""]
- #[doc = " Increases the reference count for all \\a slices processed. The user is"]
- #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
- pub fn grpc_raw_compressed_byte_buffer_create(
- slices: *mut grpc_slice,
- nslices: usize,
- compression: grpc_compression_algorithm,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Copies input byte buffer \\a bb."]
- #[doc = ""]
- #[doc = " Increases the reference count of all the source slices. The user is"]
- #[doc = " responsible for calling grpc_byte_buffer_destroy over the returned copy."]
- pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Returns the size of the given byte buffer, in bytes."]
- pub fn grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize;
-}
-extern "C" {
- #[doc = " Destroys \\a byte_buffer deallocating all its memory."]
- pub fn grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer);
-}
-extern "C" {
- #[doc = " Initialize \\a reader to read over \\a buffer."]
- #[doc = " Returns 1 upon success, 0 otherwise."]
- pub fn grpc_byte_buffer_reader_init(
- reader: *mut grpc_byte_buffer_reader,
- buffer: *mut grpc_byte_buffer,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Cleanup and destroy \\a reader"]
- pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader);
-}
-extern "C" {
- #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
- #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for calling"]
- #[doc = " grpc_slice_unref on the result."]
- pub fn grpc_byte_buffer_reader_next(
- reader: *mut grpc_byte_buffer_reader,
- slice: *mut grpc_slice,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future."]
- #[doc = ""]
- #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
- #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for making sure"]
- #[doc = " the slice pointer remains valid when accessed."]
- #[doc = ""]
- #[doc = " NOTE: Do not use this function unless the caller can guarantee that the"]
- #[doc = " underlying grpc_byte_buffer outlasts the use of the slice. This is only"]
- #[doc = " safe when the underlying grpc_byte_buffer remains immutable while slice"]
- #[doc = " is being accessed."]
- pub fn grpc_byte_buffer_reader_peek(
- reader: *mut grpc_byte_buffer_reader,
- slice: *mut *mut grpc_slice,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Merge all data from \\a reader into single slice"]
- pub fn grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Returns a RAW byte buffer instance from the output of \\a reader."]
- pub fn grpc_raw_byte_buffer_from_reader(
- reader: *mut grpc_byte_buffer_reader,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " initialize a slice buffer"]
- pub fn grpc_slice_buffer_init(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " destroy a slice buffer - unrefs any held elements"]
- pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " Add an element to a slice buffer - takes ownership of the slice."]
- #[doc = "This function is allowed to concatenate the passed in slice to the end of"]
- #[doc = "some other slice if desired by the slice buffer."]
- pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice);
-}
-extern "C" {
- #[doc = " add an element to a slice buffer - takes ownership of the slice and returns"]
- #[doc = "the index of the slice."]
- #[doc = "Guarantees that the slice will not be concatenated at the end of another"]
- #[doc = "slice (i.e. the data for this slice will begin at the first byte of the"]
- #[doc = "slice at the returned index in sb->slices)"]
- #[doc = "The implementation MAY decide to concatenate data at the end of a small"]
- #[doc = "slice added in this fashion."]
- pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize;
-}
-extern "C" {
- pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize);
-}
-extern "C" {
- #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice"]
- #[doc = "buffer: returns a pointer into which to add the data"]
- pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8;
-}
-extern "C" {
- #[doc = " pop the last buffer, but don't unref it"]
- pub fn grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " clear a slice buffer, unref all elements"]
- pub fn grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " swap the contents of two slice buffers"]
- pub fn grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " move all of the elements of src into dst"]
- pub fn grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " remove n bytes from the end of a slice buffer"]
- pub fn grpc_slice_buffer_trim_end(
- sb: *mut grpc_slice_buffer,
- n: usize,
- garbage: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst"]
- pub fn grpc_slice_buffer_move_first(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst without adding references"]
- pub fn grpc_slice_buffer_move_first_no_ref(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst (copying them)"]
- pub fn grpc_slice_buffer_move_first_into_buffer(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " take the first slice in the slice buffer"]
- pub fn grpc_slice_buffer_take_first(sb: *mut grpc_slice_buffer) -> grpc_slice;
-}
-extern "C" {
- #[doc = " undo the above with (a possibly different) \\a slice"]
- pub fn grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice);
-}
-#[repr(u32)]
-#[doc = " Connectivity state of a channel."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_connectivity_state {
- #[doc = " channel is idle"]
- GRPC_CHANNEL_IDLE = 0,
- #[doc = " channel is connecting"]
- GRPC_CHANNEL_CONNECTING = 1,
- #[doc = " channel is ready for work"]
- GRPC_CHANNEL_READY = 2,
- #[doc = " channel has seen a failure but expects to recover"]
- GRPC_CHANNEL_TRANSIENT_FAILURE = 3,
- #[doc = " channel has seen a failure that it cannot recover from"]
- GRPC_CHANNEL_SHUTDOWN = 4,
-}
-extern "C" {
- #[doc = " Time constants."]
- pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " The zero time interval."]
- pub fn gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " The far future"]
- pub fn gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " initialize time subsystem"]
- pub fn gpr_time_init();
-}
-extern "C" {
- #[doc = " Return the current time measured from the given clocks epoch."]
- pub fn gpr_now(clock: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Convert a timespec from one clock to another"]
- pub fn gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b"]
- #[doc = "respectively."]
- pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Add and subtract times. Calculations saturate at infinities."]
- pub fn gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Return a timespec representing a given number of time units. INT64_MIN is"]
- #[doc = "interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."]
- pub fn gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_nanos(ns: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_millis(ms: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_seconds(s: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_minutes(m: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_hours(h: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32;
-}
-extern "C" {
- #[doc = " Return 1 if two times are equal or within threshold of each other,"]
- #[doc = "0 otherwise"]
- pub fn gpr_time_similar(
- a: gpr_timespec,
- b: gpr_timespec,
- threshold: gpr_timespec,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Sleep until at least 'until' - an absolute timeout"]
- pub fn gpr_sleep_until(until: gpr_timespec);
-}
-extern "C" {
- pub fn gpr_timespec_to_micros(t: gpr_timespec) -> f64;
-}
-extern "C" {
- #[doc = " \\mainpage GRPC Core"]
- #[doc = ""]
- #[doc = " The GRPC Core library is a low-level library designed to be wrapped by higher"]
- #[doc = " level libraries. The top-level API is provided in grpc.h. Security related"]
- #[doc = " functionality lives in grpc_security.h."]
- pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpc_metadata_array_destroy(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpc_call_details_init(details: *mut grpc_call_details);
-}
-extern "C" {
- pub fn grpc_call_details_destroy(details: *mut grpc_call_details);
-}
-extern "C" {
- #[doc = " Registers a plugin to be initialized and destroyed with the library."]
- #[doc = ""]
- #[doc = "The \\a init and \\a destroy functions will be invoked as part of"]
- #[doc = "\\a grpc_init() and \\a grpc_shutdown(), respectively."]
- #[doc = "Note that these functions can be invoked an arbitrary number of times"]
- #[doc = "(and hence so will \\a init and \\a destroy)."]
- #[doc = "It is safe to pass NULL to either argument. Plugins are destroyed in"]
- #[doc = "the reverse order they were initialized."]
- pub fn grpc_register_plugin(
- init: ::std::option::Option<unsafe extern "C" fn()>,
- destroy: ::std::option::Option<unsafe extern "C" fn()>,
- );
-}
-extern "C" {
- #[doc = " Initialize the grpc library."]
- #[doc = ""]
- #[doc = "After it's called, a matching invocation to grpc_shutdown() is expected."]
- #[doc = ""]
- #[doc = "It is not safe to call any other grpc functions before calling this."]
- #[doc = "(To avoid overhead, little checking is done, and some things may work. We"]
- #[doc = "do not warrant that they will continue to do so in future revisions of this"]
- #[doc = "library)."]
- pub fn grpc_init();
-}
-extern "C" {
- #[doc = " Shut down the grpc library."]
- #[doc = ""]
- #[doc = "Before it's called, there should haven been a matching invocation to"]
- #[doc = "grpc_init()."]
- #[doc = ""]
- #[doc = "The last call to grpc_shutdown will initiate cleaning up of grpc library"]
- #[doc = "internals, which can happen in another thread. Once the clean-up is done,"]
- #[doc = "no memory is used by grpc, nor are any instructions executing within the"]
- #[doc = "grpc library. Prior to calling, all application owned grpc objects must"]
- #[doc = "have been destroyed."]
- pub fn grpc_shutdown();
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized."]
- #[doc = "TODO(ericgribkoff) Decide if this should be promoted to non-experimental as"]
- #[doc = "part of stabilizing the fork support API, as tracked in"]
- #[doc = "https://github.com/grpc/grpc/issues/15334"]
- pub fn grpc_is_initialized() -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " DEPRECATED. Recommend to use grpc_shutdown only"]
- pub fn grpc_shutdown_blocking();
-}
-extern "C" {
- #[doc = " Return a string representing the current version of grpc"]
- pub fn grpc_version_string() -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Return a string specifying what the 'g' in gRPC stands for"]
- pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns the completion queue factory based on the attributes. MAY return a"]
- #[doc = "NULL if no factory can be found"]
- pub fn grpc_completion_queue_factory_lookup(
- attributes: *const grpc_completion_queue_attributes,
- ) -> *const grpc_completion_queue_factory;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
- pub fn grpc_completion_queue_create_for_next(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
- pub fn grpc_completion_queue_create_for_pluck(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING."]
- #[doc = "This function is experimental."]
- pub fn grpc_completion_queue_create_for_callback(
- shutdown_callback: *mut grpc_experimental_completion_queue_functor,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Create a completion queue"]
- pub fn grpc_completion_queue_create(
- factory: *const grpc_completion_queue_factory,
- attributes: *const grpc_completion_queue_attributes,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Blocks until an event is available, the completion queue is being shut down,"]
- #[doc = "or deadline is reached."]
- #[doc = ""]
- #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
- #[doc = "otherwise a grpc_event describing the event that occurred."]
- #[doc = ""]
- #[doc = "Callers must not call grpc_completion_queue_next and"]
- #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
- pub fn grpc_completion_queue_next(
- cq: *mut grpc_completion_queue,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_event;
-}
-extern "C" {
- #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is"]
- #[doc = "being shutdown or deadline is reached."]
- #[doc = ""]
- #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
- #[doc = "otherwise a grpc_event describing the event that occurred."]
- #[doc = ""]
- #[doc = "Callers must not call grpc_completion_queue_next and"]
- #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
- #[doc = ""]
- #[doc = "Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS"]
- #[doc = "concurrently executing plucks at any time."]
- pub fn grpc_completion_queue_pluck(
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_event;
-}
-extern "C" {
- #[doc = " Begin destruction of a completion queue. Once all possible events are"]
- #[doc = "drained then grpc_completion_queue_next will start to produce"]
- #[doc = "GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call"]
- #[doc = "grpc_completion_queue_destroy."]
- #[doc = ""]
- #[doc = "After calling this function applications should ensure that no"]
- #[doc = "NEW work is added to be published on this completion queue."]
- pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " Destroy a completion queue. The caller must ensure that the queue is"]
- #[doc = "drained and no threads are executing grpc_completion_queue_next"]
- pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API ************/"]
- #[doc = " grpc_flush_cq_tls_cache() MUST be called on the same thread,"]
- #[doc = " with the same cq."]
- pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API ************/"]
- #[doc = " Returns 1 if there was contents in the cache. If there was an event"]
- #[doc = " in \\a cq tls cache, its tag is placed in tag, and ok is set to the"]
- #[doc = " event success."]
- pub fn grpc_completion_queue_thread_local_cache_flush(
- cq: *mut grpc_completion_queue,
- tag: *mut *mut ::std::os::raw::c_void,
- ok: *mut ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check the connectivity state of a channel."]
- pub fn grpc_channel_check_connectivity_state(
- channel: *mut grpc_channel,
- try_to_connect: ::std::os::raw::c_int,
- ) -> grpc_connectivity_state;
-}
-extern "C" {
- #[doc = " Number of active \"external connectivity state watchers\" attached to a"]
- #[doc = " channel."]
- #[doc = " Useful for testing."]
- pub fn grpc_channel_num_external_connectivity_watchers(
- channel: *mut grpc_channel,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Watch for a change in connectivity state."]
- #[doc = "Once the channel connectivity state is different from last_observed_state,"]
- #[doc = "tag will be enqueued on cq with success=1."]
- #[doc = "If deadline expires BEFORE the state is changed, tag will be enqueued on cq"]
- #[doc = "with success=0."]
- pub fn grpc_channel_watch_connectivity_state(
- channel: *mut grpc_channel,
- last_observed_state: grpc_connectivity_state,
- deadline: gpr_timespec,
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " Check whether a grpc channel supports connectivity watcher"]
- pub fn grpc_channel_support_connectivity_watcher(
- channel: *mut grpc_channel,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Create a call given a grpc_channel, in order to call 'method'. All"]
- #[doc = "completions are sent to 'completion_queue'. 'method' and 'host' need only"]
- #[doc = "live through the invocation of this function."]
- #[doc = "If parent_call is non-NULL, it must be a server-side call. It will be used"]
- #[doc = "to propagate properties from the server call to this new client call,"]
- #[doc = "depending on the value of \\a propagation_mask (see propagation_bits.h for"]
- #[doc = "possible values)."]
- pub fn grpc_channel_create_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- completion_queue: *mut grpc_completion_queue,
- method: grpc_slice,
- host: *const grpc_slice,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call;
-}
-extern "C" {
- #[doc = " Pre-register a method/host pair on a channel."]
- #[doc = "method and host are not owned and must remain alive while the channel is"]
- #[doc = "alive."]
- pub fn grpc_channel_register_call(
- channel: *mut grpc_channel,
- method: *const ::std::os::raw::c_char,
- host: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Create a call given a handle returned from grpc_channel_register_call."]
- #[doc = "\\sa grpc_channel_create_call."]
- pub fn grpc_channel_create_registered_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- completion_queue: *mut grpc_completion_queue,
- registered_call_handle: *mut ::std::os::raw::c_void,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call;
-}
-extern "C" {
- #[doc = " Allocate memory in the grpc_call arena: this memory is automatically"]
- #[doc = "discarded at call completion"]
- pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Start a batch of operations defined in the array ops; when complete, post a"]
- #[doc = "completion of type 'tag' to the completion queue bound to the call."]
- #[doc = "The order of ops specified in the batch has no significance."]
- #[doc = "Only one operation of each type can be active at once in any given"]
- #[doc = "batch."]
- #[doc = "If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call"]
- #[doc = "grpc_completion_queue_next or grpc_completion_queue_pluck on the completion"]
- #[doc = "queue associated with 'call' for work to be performed. If a call to"]
- #[doc = "grpc_call_start_batch returns any value other than GRPC_CALL_OK it is"]
- #[doc = "guaranteed that no state associated with 'call' is changed and it is not"]
- #[doc = "appropriate to call grpc_completion_queue_next or"]
- #[doc = "grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch"]
- #[doc = "call."]
- #[doc = "If a call to grpc_call_start_batch with an empty batch returns"]
- #[doc = "GRPC_CALL_OK, the tag is put in the completion queue immediately."]
- #[doc = "THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment"]
- #[doc = "needs to be synchronized. As an optimization, you may synchronize batches"]
- #[doc = "containing just send operations independently from batches containing just"]
- #[doc = "receive operations. Access to grpc_call_start_batch with an empty batch is"]
- #[doc = "thread-compatible."]
- pub fn grpc_call_start_batch(
- call: *mut grpc_call,
- ops: *const grpc_op,
- nops: usize,
- tag: *mut ::std::os::raw::c_void,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Returns a newly allocated string representing the endpoint to which this"]
- #[doc = "call is communicating with. The string is in the uri format accepted by"]
- #[doc = "grpc_channel_create."]
- #[doc = "The returned string should be disposed of with gpr_free()."]
- #[doc = ""]
- #[doc = "WARNING: this value is never authenticated or subject to any security"]
- #[doc = "related code. It must not be used for any authentication related"]
- #[doc = "functionality. Instead, use grpc_auth_context."]
- pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct census_context {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Set census context for a call; Must be called before first call to"]
- #[doc = "grpc_call_start_batch()."]
- pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context);
-}
-extern "C" {
- #[doc = " Retrieve the calls current census context."]
- pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context;
-}
-extern "C" {
- #[doc = " Return a newly allocated string representing the target a channel was"]
- #[doc = "created for."]
- pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Request info about the channel."]
- #[doc = "\\a channel_info indicates what information is being requested and"]
- #[doc = "how that information will be returned."]
- #[doc = "\\a channel_info is owned by the caller."]
- pub fn grpc_channel_get_info(
- channel: *mut grpc_channel,
- channel_info: *const grpc_channel_info,
- );
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Resets the channel's connect backoff."]
- #[doc = "TODO(roth): When we see whether this proves useful, either promote"]
- #[doc = "to non-experimental or remove it."]
- pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel);
-}
-extern "C" {
- #[doc = " Create a client channel to 'target'. Additional channel level configuration"]
- #[doc = "MAY be provided by grpc_channel_args, though the expectation is that most"]
- #[doc = "clients will want to simply pass NULL. The user data in 'args' need only"]
- #[doc = "live through the invocation of this function. However, if any args of the"]
- #[doc = "'pointer' type are passed, then the referenced vtable must be maintained"]
- #[doc = "by the caller until grpc_channel_destroy terminates. See grpc_channel_args"]
- #[doc = "definition for more on this."]
- pub fn grpc_insecure_channel_create(
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Create a lame client: this client fails every operation attempted on it."]
- pub fn grpc_lame_client_channel_create(
- target: *const ::std::os::raw::c_char,
- error_code: grpc_status_code::Type,
- error_message: *const ::std::os::raw::c_char,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Close and destroy a grpc channel"]
- pub fn grpc_channel_destroy(channel: *mut grpc_channel);
-}
-extern "C" {
- #[doc = " Cancel an RPC."]
- #[doc = "Can be called multiple times, from any thread."]
- #[doc = "THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status"]
- #[doc = "are thread-safe, and can be called at any point before grpc_call_unref"]
- #[doc = "is called."]
- pub fn grpc_call_cancel(
- call: *mut grpc_call,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Cancel an RPC."]
- #[doc = "Can be called multiple times, from any thread."]
- #[doc = "If a status has not been received for the call, set it to the status code"]
- #[doc = "and description passed in."]
- #[doc = "Importantly, this function does not send status nor description to the"]
- #[doc = "remote endpoint."]
- #[doc = "Note that \\a description doesn't need be a static string."]
- #[doc = "It doesn't need to be alive after the call to"]
- #[doc = "grpc_call_cancel_with_status completes."]
- pub fn grpc_call_cancel_with_status(
- call: *mut grpc_call,
- status: grpc_status_code::Type,
- description: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Ref a call."]
- #[doc = "THREAD SAFETY: grpc_call_ref is thread-compatible"]
- pub fn grpc_call_ref(call: *mut grpc_call);
-}
-extern "C" {
- #[doc = " Unref a call."]
- #[doc = "THREAD SAFETY: grpc_call_unref is thread-compatible"]
- pub fn grpc_call_unref(call: *mut grpc_call);
-}
-extern "C" {
- #[doc = " Request notification of a new call."]
- #[doc = "Once a call is received, a notification tagged with \\a tag_new is added to"]
- #[doc = "\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are"]
- #[doc = "updated with the appropriate call information. \\a cq_bound_to_call is bound"]
- #[doc = "to \\a call, and batch operation notifications for that call will be posted"]
- #[doc = "to \\a cq_bound_to_call."]
- #[doc = "Note that \\a cq_for_notification must have been registered to the server via"]
- #[doc = "\\a grpc_server_register_completion_queue."]
- pub fn grpc_server_request_call(
- server: *mut grpc_server,
- call: *mut *mut grpc_call,
- details: *mut grpc_call_details,
- request_metadata: *mut grpc_metadata_array,
- cq_bound_to_call: *mut grpc_completion_queue,
- cq_for_notification: *mut grpc_completion_queue,
- tag_new: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-#[repr(u32)]
-#[doc = " How to handle payloads for a registered method"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_server_register_method_payload_handling {
- #[doc = " Don't try to read the payload"]
- GRPC_SRM_PAYLOAD_NONE = 0,
- #[doc = " Read the initial payload as a byte buffer"]
- GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1,
-}
-extern "C" {
- #[doc = " Registers a method in the server."]
- #[doc = "Methods to this (host, method) pair will not be reported by"]
- #[doc = "grpc_server_request_call, but instead be reported by"]
- #[doc = "grpc_server_request_registered_call when passed the appropriate"]
- #[doc = "registered_method (as returned by this function)."]
- #[doc = "Must be called before grpc_server_start."]
- #[doc = "Returns NULL on failure."]
- pub fn grpc_server_register_method(
- server: *mut grpc_server,
- method: *const ::std::os::raw::c_char,
- host: *const ::std::os::raw::c_char,
- payload_handling: grpc_server_register_method_payload_handling,
- flags: u32,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'"]
- #[doc = "must have been registered to the server via"]
- #[doc = "grpc_server_register_completion_queue."]
- pub fn grpc_server_request_registered_call(
- server: *mut grpc_server,
- registered_method: *mut ::std::os::raw::c_void,
- call: *mut *mut grpc_call,
- deadline: *mut gpr_timespec,
- request_metadata: *mut grpc_metadata_array,
- optional_payload: *mut *mut grpc_byte_buffer,
- cq_bound_to_call: *mut grpc_completion_queue,
- cq_for_notification: *mut grpc_completion_queue,
- tag_new: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Create a server. Additional configuration for each incoming channel can"]
- #[doc = "be specified with args. If no additional configuration is needed, args can"]
- #[doc = "be NULL. The user data in 'args' need only live through the invocation of"]
- #[doc = "this function. However, if any args of the 'pointer' type are passed, then"]
- #[doc = "the referenced vtable must be maintained by the caller until"]
- #[doc = "grpc_server_destroy terminates. See grpc_channel_args definition for more"]
- #[doc = "on this."]
- pub fn grpc_server_create(
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server;
-}
-extern "C" {
- #[doc = " Register a completion queue with the server. Must be done for any"]
- #[doc = "notification completion queue that is passed to grpc_server_request_*_call"]
- #[doc = "and to grpc_server_shutdown_and_notify. Must be performed prior to"]
- #[doc = "grpc_server_start."]
- pub fn grpc_server_register_completion_queue(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- reserved: *mut ::std::os::raw::c_void,
- );
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_xds_status_notifier {
- pub on_serving_status_update: ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- uri: *const ::std::os::raw::c_char,
- code: grpc_status_code::Type,
- error_message: *const ::std::os::raw::c_char,
- ),
- >,
- pub user_data: *mut ::std::os::raw::c_void,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_config_fetcher {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Creates an xDS config fetcher."]
- pub fn grpc_server_config_fetcher_xds_create(
- notifier: grpc_server_xds_status_notifier,
- args: *const grpc_channel_args,
- ) -> *mut grpc_server_config_fetcher;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Destroys a config fetcher."]
- pub fn grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership."]
- #[doc = "Must be called before adding ports"]
- pub fn grpc_server_set_config_fetcher(
- server: *mut grpc_server,
- config_fetcher: *mut grpc_server_config_fetcher,
- );
-}
-extern "C" {
- #[doc = " Add a HTTP2 over plaintext over tcp listener."]
- #[doc = "Returns bound port number on success, 0 on failure."]
- #[doc = "REQUIRES: server not started"]
- pub fn grpc_server_add_insecure_http2_port(
- server: *mut grpc_server,
- addr: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Start a server - tells all listeners to start listening"]
- pub fn grpc_server_start(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Begin shutting down a server."]
- #[doc = "After completion, no new calls or connections will be admitted."]
- #[doc = "Existing calls will be allowed to complete."]
- #[doc = "Send a GRPC_OP_COMPLETE event when there are no more calls being serviced."]
- #[doc = "Shutdown is idempotent, and all tags will be notified at once if multiple"]
- #[doc = "grpc_server_shutdown_and_notify calls are made. 'cq' must have been"]
- #[doc = "registered to this server via grpc_server_register_completion_queue."]
- pub fn grpc_server_shutdown_and_notify(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " Cancel all in-progress calls."]
- #[doc = "Only usable after shutdown."]
- pub fn grpc_server_cancel_all_calls(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Destroy a server."]
- #[doc = "Shutdown must have completed beforehand (i.e. all tags generated by"]
- #[doc = "grpc_server_shutdown_and_notify must have been received, and at least"]
- #[doc = "one call to grpc_server_shutdown_and_notify must have been made)."]
- pub fn grpc_server_destroy(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Enable or disable a tracer."]
- #[doc = ""]
- #[doc = "Tracers (usually controlled by the environment variable GRPC_TRACE)"]
- #[doc = "allow printf-style debugging on GRPC internals, and are useful for"]
- #[doc = "tracking down problems in the field."]
- #[doc = ""]
- #[doc = "Use of this function is not strictly thread-safe, but the"]
- #[doc = "thread-safety issues raised by it should not be of concern."]
- pub fn grpc_tracer_set_enabled(
- name: *const ::std::os::raw::c_char,
- enabled: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a metadata key is legal (will be accepted by core)"]
- pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a non-binary metadata value is legal (will be accepted by"]
- #[doc = "core)"]
- pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a metadata key corresponds to a binary value"]
- pub fn grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Convert grpc_call_error values to a string"]
- pub fn grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Create a buffer pool"]
- pub fn grpc_resource_quota_create(
- trace_name: *const ::std::os::raw::c_char,
- ) -> *mut grpc_resource_quota;
-}
-extern "C" {
- #[doc = " Add a reference to a buffer pool"]
- pub fn grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota);
-}
-extern "C" {
- #[doc = " Drop a reference to a buffer pool"]
- pub fn grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota);
-}
-extern "C" {
- #[doc = " Update the size of a buffer pool"]
- pub fn grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize);
-}
-extern "C" {
- #[doc = " Update the size of the maximum number of threads allowed"]
- pub fn grpc_resource_quota_set_max_threads(
- resource_quota: *mut grpc_resource_quota,
- new_max_threads: ::std::os::raw::c_int,
- );
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto."]
- #[doc = "The full name of the proto is envoy.service.status.v3.ClientConfig."]
- pub fn grpc_dump_xds_configs() -> grpc_slice;
-}
-extern "C" {
- #[doc = " Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota"]
- pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable;
-}
-extern "C" {
- #[doc = " CHANNELZ API *************/"]
- #[doc = "churn as the feature is implemented. This comment will be removed once"]
- #[doc = "channelz is officially supported, and these APIs become stable. For now"]
- #[doc = "you may track the progress by following this github issue:"]
- #[doc = "https://github.com/grpc/grpc/issues/15340"]
- #[doc = ""]
- #[doc = "the following APIs return allocated JSON strings that match the response"]
- #[doc = "objects from the channelz proto, found here:"]
- #[doc = "https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto."]
- #[doc = ""]
- #[doc = "For easy conversion to protobuf, The JSON is formatted according to:"]
- #[doc = "https://developers.google.com/protocol-buffers/docs/proto3#json."]
- pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_server_sockets(
- server_id: isize,
- start_socket_id: isize,
- max_results: isize,
- ) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_cronet_secure_channel_create(
- engine: *mut ::std::os::raw::c_void,
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Create a client channel to 'target' using file descriptor 'fd'. The 'target'"]
- #[doc = "argument will be used to indicate the name for this channel. See the comment"]
- #[doc = "for grpc_insecure_channel_create for description of 'args' argument."]
- pub fn grpc_insecure_channel_create_from_fd(
- target: *const ::std::os::raw::c_char,
- fd: ::std::os::raw::c_int,
- args: *const grpc_channel_args,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Add the connected communication channel based on file descriptor 'fd' to the"]
- #[doc = "'server'. The 'fd' must be an open file descriptor corresponding to a"]
- #[doc = "connected socket. Events from the file descriptor may come on any of the"]
- #[doc = "server completion queues (i.e completion queues registered via the"]
- #[doc = "grpc_server_register_completion_queue API)."]
- #[doc = ""]
- #[doc = "The 'reserved' pointer MUST be NULL."]
- pub fn grpc_server_add_insecure_channel_from_fd(
- server: *mut grpc_server,
- reserved: *mut ::std::os::raw::c_void,
- fd: ::std::os::raw::c_int,
- );
-}
-#[repr(u32)]
-#[doc = " Results for the SSL roots override callback."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_roots_override_result {
- GRPC_SSL_ROOTS_OVERRIDE_OK = 0,
- GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY = 1,
- #[doc = " Do not try fallback options."]
- GRPC_SSL_ROOTS_OVERRIDE_FAIL = 2,
-}
-#[repr(u32)]
-#[doc = " Callback results for dynamically loading a SSL certificate config."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_certificate_config_reload_status {
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED = 0,
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW = 1,
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL = 2,
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_client_certificate_request_type {
- #[doc = " Server does not request client certificate."]
- #[doc = "The certificate presented by the client is not checked by the server at"]
- #[doc = "all. (A client may present a self signed or signed certificate or not"]
- #[doc = "present a certificate at all and any of those option would be accepted)"]
- GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0,
- #[doc = " Server requests client certificate but does not enforce that the client"]
- #[doc = "presents a certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is left to"]
- #[doc = "the application (the necessary metadata will be available to the"]
- #[doc = "application via authentication context properties, see grpc_auth_context)."]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1,
- #[doc = " Server requests client certificate but does not enforce that the client"]
- #[doc = "presents a certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is done by"]
- #[doc = "the gRPC framework. (For a successful connection the client needs to either"]
- #[doc = "present a certificate that can be verified against the root certificate"]
- #[doc = "configured by the server or not present a certificate at all)"]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2,
- #[doc = " Server requests client certificate and enforces that the client presents a"]
- #[doc = "certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is left to"]
- #[doc = "the application (the necessary metadata will be available to the"]
- #[doc = "application via authentication context properties, see grpc_auth_context)."]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3,
- #[doc = " Server requests client certificate and enforces that the client presents a"]
- #[doc = "certificate."]
- #[doc = ""]
- #[doc = "The certificate presented by the client is verified by the gRPC framework."]
- #[doc = "(For a successful connection the client needs to present a certificate that"]
- #[doc = "can be verified against the root certificate configured by the server)"]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4,
-}
-impl grpc_security_level {
- pub const GRPC_SECURITY_NONE: grpc_security_level = grpc_security_level::GRPC_SECURITY_MIN;
-}
-impl grpc_security_level {
- pub const GRPC_SECURITY_MAX: grpc_security_level =
- grpc_security_level::GRPC_PRIVACY_AND_INTEGRITY;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_security_level {
- GRPC_SECURITY_MIN = 0,
- GRPC_INTEGRITY_ONLY = 1,
- GRPC_PRIVACY_AND_INTEGRITY = 2,
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_tls_server_verification_option {
- #[doc = " Default option: performs server certificate verification and hostname"]
- #[doc = "verification."]
- GRPC_TLS_SERVER_VERIFICATION = 0,
- #[doc = " Performs server certificate verification, but skips hostname verification"]
- #[doc = "Client is responsible for verifying server's identity via"]
- #[doc = "server authorization check callback."]
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION = 1,
- #[doc = " Skips both server certificate and hostname verification."]
- #[doc = "Client is responsible for verifying server's identity and"]
- #[doc = "server's certificate via server authorization check callback."]
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION = 2,
-}
-#[repr(u32)]
-#[doc = " Type of local connections for which local channel/server credentials will be"]
-#[doc = " applied. It supports UDS and local TCP connections."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_local_connect_type {
- UDS = 0,
- LOCAL_TCP = 1,
-}
-#[repr(u32)]
-#[doc = " The TLS versions that are supported by the SSL stack."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_tls_version {
- TLS1_2 = 0,
- TLS1_3 = 1,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_context {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_property_iterator {
- pub ctx: *const grpc_auth_context,
- pub index: usize,
- pub name: *const ::std::os::raw::c_char,
-}
-#[doc = " value, if not NULL, is guaranteed to be NULL terminated."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_property {
- pub name: *mut ::std::os::raw::c_char,
- pub value: *mut ::std::os::raw::c_char,
- pub value_length: usize,
-}
-extern "C" {
- #[doc = " Returns NULL when the iterator is at the end."]
- pub fn grpc_auth_property_iterator_next(
- it: *mut grpc_auth_property_iterator,
- ) -> *const grpc_auth_property;
-}
-extern "C" {
- #[doc = " Iterates over the auth context."]
- pub fn grpc_auth_context_property_iterator(
- ctx: *const grpc_auth_context,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return"]
- #[doc = "NULL) if the peer is not authenticated."]
- pub fn grpc_auth_context_peer_identity(
- ctx: *const grpc_auth_context,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Finds a property in the context. May return an empty iterator (first _next"]
- #[doc = "will return NULL) if no property with this name was found in the context."]
- pub fn grpc_auth_context_find_properties_by_name(
- ctx: *const grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Gets the name of the property that indicates the peer identity. Will return"]
- #[doc = "NULL if the peer is not authenticated."]
- pub fn grpc_auth_context_peer_identity_property_name(
- ctx: *const grpc_auth_context,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns 1 if the peer is authenticated, 0 otherwise."]
- pub fn grpc_auth_context_peer_is_authenticated(
- ctx: *const grpc_auth_context,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Gets the auth context from the call. Caller needs to call"]
- #[doc = "grpc_auth_context_release on the returned context."]
- pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context;
-}
-extern "C" {
- #[doc = " Releases the auth context returned from grpc_call_auth_context."]
- pub fn grpc_auth_context_release(context: *mut grpc_auth_context);
-}
-extern "C" {
- #[doc = " Add a property."]
- pub fn grpc_auth_context_add_property(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- value_length: usize,
- );
-}
-extern "C" {
- #[doc = " Add a C string property."]
- pub fn grpc_auth_context_add_cstring_property(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure"]
- #[doc = "(which means that no property with this name exists)."]
- pub fn grpc_auth_context_set_peer_identity_property_name(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_session_cache {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Create LRU cache for client-side SSL sessions with the given capacity."]
- #[doc = "If capacity is < 1, a default capacity is used instead."]
- pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache;
-}
-extern "C" {
- #[doc = " Destroy SSL session cache."]
- pub fn grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache);
-}
-extern "C" {
- #[doc = " Create a channel arg with the given cache object."]
- pub fn grpc_ssl_session_cache_create_channel_arg(
- cache: *mut grpc_ssl_session_cache,
- ) -> grpc_arg;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_call_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a call credentials object."]
- #[doc = "The creator of the credentials object is responsible for its release."]
- pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials);
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a channel credentials object."]
- #[doc = "The creator of the credentials object is responsible for its release."]
- pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials);
-}
-extern "C" {
- #[doc = " Creates default credentials to connect to a google gRPC service."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak. The security level of the"]
- #[doc = "resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = ""]
- #[doc = "If specified, the supplied call credentials object will be attached to the"]
- #[doc = "returned channel credentials object. The call_credentials object must remain"]
- #[doc = "valid throughout the lifetime of the returned grpc_channel_credentials"]
- #[doc = "object. It is expected that the call credentials object was generated"]
- #[doc = "according to the Application Default Credentials mechanism and asserts the"]
- #[doc = "identity of the default service account of the machine. Supplying any other"]
- #[doc = "sort of call credential will result in undefined behavior, up to and"]
- #[doc = "including the sudden and unexpected failure of RPCs."]
- #[doc = ""]
- #[doc = "If nullptr is supplied, the returned channel credentials object will use a"]
- #[doc = "call credentials object based on the Application Default Credentials"]
- #[doc = "mechanism."]
- pub fn grpc_google_default_credentials_create(
- call_credentials: *mut grpc_call_credentials,
- ) -> *mut grpc_channel_credentials;
-}
-#[doc = " Callback for getting the SSL roots override from the application."]
-#[doc = "In case of success, *pem_roots_certs must be set to a NULL terminated string"]
-#[doc = "containing the list of PEM encoded root certificates. The ownership is passed"]
-#[doc = "to the core and freed (laster by the core) with gpr_free."]
-#[doc = "If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is"]
-#[doc = "set to a valid path, it will override the roots specified this func"]
-pub type grpc_ssl_roots_override_callback = ::std::option::Option<
- unsafe extern "C" fn(
- pem_root_certs: *mut *mut ::std::os::raw::c_char,
- ) -> grpc_ssl_roots_override_result,
->;
-extern "C" {
- #[doc = " Setup a callback to override the default TLS/SSL roots."]
- #[doc = "This function is not thread-safe and must be called at initialization time"]
- #[doc = "before any ssl credentials are created to have the desired side effect."]
- #[doc = "If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the"]
- #[doc = "callback will not be called."]
- pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback);
-}
-#[doc = " Object that holds a private key / certificate chain pair in PEM format."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_pem_key_cert_pair {
- #[doc = " private_key is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client's private key."]
- pub private_key: *const ::std::os::raw::c_char,
- #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client's certificate chain."]
- pub cert_chain: *const ::std::os::raw::c_char,
-}
-#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed"]
-#[doc = "after all of its call sites are migrated to grpc_ssl_verify_peer_options."]
-#[doc = "Object that holds additional peer-verification options on a secure"]
-#[doc = "channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct verify_peer_options {
- #[doc = " If non-NULL this callback will be invoked with the expected"]
- #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
- #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
- #[doc = "callback then it is treated as a verification failure. Invocation of"]
- #[doc = "the callback is blocking, so any implementation should be light-weight."]
- pub verify_peer_callback: ::std::option::Option<
- unsafe extern "C" fn(
- target_name: *const ::std::os::raw::c_char,
- peer_pem: *const ::std::os::raw::c_char,
- userdata: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Arbitrary userdata that will be passed as the last argument to"]
- #[doc = "verify_peer_callback."]
- pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
- #[doc = " A destruct callback that will be invoked when the channel is being"]
- #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
- #[doc = "to perform any cleanup associated with that userdata."]
- pub verify_peer_destruct:
- ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
-}
-#[doc = " Object that holds additional peer-verification options on a secure"]
-#[doc = "channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_verify_peer_options {
- #[doc = " If non-NULL this callback will be invoked with the expected"]
- #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
- #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
- #[doc = "callback then it is treated as a verification failure. Invocation of"]
- #[doc = "the callback is blocking, so any implementation should be light-weight."]
- pub verify_peer_callback: ::std::option::Option<
- unsafe extern "C" fn(
- target_name: *const ::std::os::raw::c_char,
- peer_pem: *const ::std::os::raw::c_char,
- userdata: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Arbitrary userdata that will be passed as the last argument to"]
- #[doc = "verify_peer_callback."]
- pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
- #[doc = " A destruct callback that will be invoked when the channel is being"]
- #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
- #[doc = "to perform any cleanup associated with that userdata."]
- pub verify_peer_destruct:
- ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
-}
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be"]
- #[doc = "removed after all of its call sites are migrated to"]
- #[doc = "grpc_ssl_server_credentials_create_ex. Creates an SSL credentials object."]
- #[doc = "The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = "- pem_root_certs is the NULL-terminated string containing the PEM encoding"]
- #[doc = "of the server root certificates. If this parameter is NULL, the"]
- #[doc = "implementation will first try to dereference the file pointed by the"]
- #[doc = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,"]
- #[doc = "try to get the roots set by grpc_override_ssl_default_roots. Eventually,"]
- #[doc = "if all these fail, it will try to get the roots from a well-known place on"]
- #[doc = "disk (in the grpc install directory)."]
- #[doc = ""]
- #[doc = "gRPC has implemented root cache if the underlying OpenSSL library supports"]
- #[doc = "it. The gRPC root certificates cache is only applicable on the default"]
- #[doc = "root certificates, which is used when this parameter is nullptr. If user"]
- #[doc = "provides their own pem_root_certs, when creating an SSL credential object,"]
- #[doc = "gRPC would not be able to cache it, and each subchannel will generate a"]
- #[doc = "copy of the root store. So it is recommended to avoid providing large room"]
- #[doc = "pem with pem_root_certs parameter to avoid excessive memory consumption,"]
- #[doc = "particularly on mobile platforms such as iOS."]
- #[doc = "- pem_key_cert_pair is a pointer on the object containing client's private"]
- #[doc = "key and certificate chain. This parameter can be NULL if the client does"]
- #[doc = "not have such a key/cert pair."]
- #[doc = "- verify_options is an optional verify_peer_options object which holds"]
- #[doc = "additional options controlling how peer certificates are verified. For"]
- #[doc = "example, you can supply a callback which receives the peer's certificate"]
- #[doc = "with which you can do additional verification. Can be NULL, in which"]
- #[doc = "case verification will retain default behavior. Any settings in"]
- #[doc = "verify_options are copied during this call, so the verify_options"]
- #[doc = "object can be released afterwards."]
- pub fn grpc_ssl_credentials_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
- verify_options: *const verify_peer_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- pub fn grpc_ssl_credentials_create_ex(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
- verify_options: *const grpc_ssl_verify_peer_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a composite channel credentials object. The security level of"]
- #[doc = " resulting connection is determined by channel_creds."]
- pub fn grpc_composite_channel_credentials_create(
- channel_creds: *mut grpc_channel_credentials,
- call_creds: *mut grpc_call_credentials,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a composite call credentials object."]
- pub fn grpc_composite_call_credentials_create(
- creds1: *mut grpc_call_credentials,
- creds2: *mut grpc_call_credentials,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates a compute engine credentials object for connecting to Google."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak."]
- pub fn grpc_google_compute_engine_credentials_create(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- pub fn grpc_max_auth_token_lifetime() -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid."]
- #[doc = "- json_key is the JSON key string containing the client's private key."]
- #[doc = "- token_lifetime is the lifetime of each Json Web Token (JWT) created with"]
- #[doc = "this credentials. It should not exceed grpc_max_auth_token_lifetime or"]
- #[doc = "will be cropped to this value."]
- pub fn grpc_service_account_jwt_access_credentials_create(
- json_key: *const ::std::os::raw::c_char,
- token_lifetime: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Builds External Account credentials."]
- #[doc = "- json_string is the JSON string containing the credentials options."]
- #[doc = "- scopes_string contains the scopes to be binded with the credentials."]
- #[doc = "This API is used for experimental purposes for now and may change in the"]
- #[doc = "future."]
- pub fn grpc_external_account_credentials_create(
- json_string: *const ::std::os::raw::c_char,
- scopes_string: *const ::std::os::raw::c_char,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google."]
- #[doc = "May return NULL if the input is invalid."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak."]
- #[doc = "- json_refresh_token is the JSON string containing the refresh token itself"]
- #[doc = "along with a client_id and client_secret."]
- pub fn grpc_google_refresh_token_credentials_create(
- json_refresh_token: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an Oauth2 Access Token credentials with an access token that was"]
- #[doc = "acquired by an out of band mechanism."]
- pub fn grpc_access_token_credentials_create(
- access_token: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an IAM credentials object for connecting to Google."]
- pub fn grpc_google_iam_credentials_create(
- authorization_token: *const ::std::os::raw::c_char,
- authority_selector: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF"]
-#[doc = "draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
-#[doc = "Optional fields may be set to NULL or empty string. It is the responsibility"]
-#[doc = "of the caller to ensure that the subject and actor tokens are refreshed on"]
-#[doc = "disk at the specified paths. This API is used for experimental purposes for"]
-#[doc = "now and may change in the future."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_sts_credentials_options {
- pub token_exchange_service_uri: *const ::std::os::raw::c_char,
- pub resource: *const ::std::os::raw::c_char,
- pub audience: *const ::std::os::raw::c_char,
- pub scope: *const ::std::os::raw::c_char,
- pub requested_token_type: *const ::std::os::raw::c_char,
- pub subject_token_path: *const ::std::os::raw::c_char,
- pub subject_token_type: *const ::std::os::raw::c_char,
- pub actor_token_path: *const ::std::os::raw::c_char,
- pub actor_token_type: *const ::std::os::raw::c_char,
-}
-extern "C" {
- #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the"]
- #[doc = "IETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
- #[doc = "This API is used for experimental purposes for now and may change in the"]
- #[doc = "future."]
- pub fn grpc_sts_credentials_create(
- options: *const grpc_sts_credentials_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-#[doc = " Callback function to be called by the metadata credentials plugin"]
-#[doc = "implementation when the metadata is ready."]
-#[doc = "- user_data is the opaque pointer that was passed in the get_metadata method"]
-#[doc = "of the grpc_metadata_credentials_plugin (see below)."]
-#[doc = "- creds_md is an array of credentials metadata produced by the plugin. It"]
-#[doc = "may be set to NULL in case of an error."]
-#[doc = "- num_creds_md is the number of items in the creds_md array."]
-#[doc = "- status must be GRPC_STATUS_OK in case of success or another specific error"]
-#[doc = "code otherwise."]
-#[doc = "- error_details contains details about the error if any. In case of success"]
-#[doc = "it should be NULL and will be otherwise ignored."]
-pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- creds_md: *const grpc_metadata,
- num_creds_md: usize,
- status: grpc_status_code::Type,
- error_details: *const ::std::os::raw::c_char,
- ),
->;
-#[doc = " Context that can be used by metadata credentials plugin in order to create"]
-#[doc = "auth related metadata."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_metadata_context {
- #[doc = " The fully qualifed service url."]
- pub service_url: *const ::std::os::raw::c_char,
- #[doc = " The method name of the RPC being called (not fully qualified)."]
- #[doc = "The fully qualified method name can be built from the service_url:"]
- #[doc = "full_qualified_method_name = ctx->service_url + '/' + ctx->method_name."]
- pub method_name: *const ::std::os::raw::c_char,
- #[doc = " The auth_context of the channel which gives the server's identity."]
- pub channel_auth_context: *const grpc_auth_context,
- #[doc = " Reserved for future use."]
- pub reserved: *mut ::std::os::raw::c_void,
-}
-extern "C" {
- #[doc = " Performs a deep copy from \\a from to \\a to."]
- pub fn grpc_auth_metadata_context_copy(
- from: *mut grpc_auth_metadata_context,
- to: *mut grpc_auth_metadata_context,
- );
-}
-extern "C" {
- #[doc = " Releases internal resources held by \\a context."]
- pub fn grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context);
-}
-#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to"]
-#[doc = "create grpc_credentials objects that can be set on a channel (composed) or"]
-#[doc = "a call. See grpc_credentials_metadata_create_from_plugin below."]
-#[doc = "The grpc client stack will call the get_metadata method of the plugin for"]
-#[doc = "every call in scope for the credentials created from it."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata_credentials_plugin {
- #[doc = " The implementation of this method has to be non-blocking, but can"]
- #[doc = "be performed synchronously or asynchronously."]
- #[doc = ""]
- #[doc = "If processing occurs synchronously, returns non-zero and populates"]
- #[doc = "creds_md, num_creds_md, status, and error_details. In this case,"]
- #[doc = "the caller takes ownership of the entries in creds_md and of"]
- #[doc = "error_details. Note that if the plugin needs to return more than"]
- #[doc = "GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must"]
- #[doc = "return asynchronously."]
- #[doc = ""]
- #[doc = "If processing occurs asynchronously, returns zero and invokes \\a cb"]
- #[doc = "when processing is completed. \\a user_data will be passed as the"]
- #[doc = "first parameter of the callback. NOTE: \\a cb MUST be invoked in a"]
- #[doc = "different thread, not from the thread in which \\a get_metadata() is"]
- #[doc = "invoked."]
- #[doc = ""]
- #[doc = "\\a context is the information that can be used by the plugin to create"]
- #[doc = "auth metadata."]
- pub get_metadata: ::std::option::Option<
- unsafe extern "C" fn(
- state: *mut ::std::os::raw::c_void,
- context: grpc_auth_metadata_context,
- cb: grpc_credentials_plugin_metadata_cb,
- user_data: *mut ::std::os::raw::c_void,
- creds_md: *mut grpc_metadata,
- num_creds_md: *mut usize,
- status: *mut grpc_status_code::Type,
- error_details: *mut *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Implements debug string of the given plugin. This method returns an"]
- #[doc = " allocated string that the caller needs to free using gpr_free()"]
- pub debug_string: ::std::option::Option<
- unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char,
- >,
- #[doc = " Destroys the plugin state."]
- pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
- #[doc = " State that will be set as the first parameter of the methods above."]
- pub state: *mut ::std::os::raw::c_void,
- #[doc = " Type of credentials that this plugin is implementing."]
- pub type_: *const ::std::os::raw::c_char,
-}
-extern "C" {
- #[doc = " Creates a credentials object from a plugin with a specified minimum security"]
- #[doc = " level."]
- pub fn grpc_metadata_credentials_create_from_plugin(
- plugin: grpc_metadata_credentials_plugin,
- min_security_level: grpc_security_level,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates a secure channel using the passed-in credentials. Additional"]
- #[doc = "channel level configuration MAY be provided by grpc_channel_args, though"]
- #[doc = "the expectation is that most clients will want to simply pass NULL. The"]
- #[doc = "user data in 'args' need only live through the invocation of this function."]
- #[doc = "However, if any args of the 'pointer' type are passed, then the referenced"]
- #[doc = "vtable must be maintained by the caller until grpc_channel_destroy"]
- #[doc = "terminates. See grpc_channel_args definition for more on this."]
- pub fn grpc_secure_channel_create(
- creds: *mut grpc_channel_credentials,
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a server_credentials object."]
- #[doc = "The creator of the server_credentials object is responsible for its release."]
- pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials);
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_server_certificate_config {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates a grpc_ssl_server_certificate_config object."]
- #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client root certificates. This parameter may be NULL if the server does"]
- #[doc = "not want the client to be authenticated with SSL."]
- #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
- #[doc = "server. This parameter cannot be NULL."]
- #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
- #[doc = "and cert_chain_files parameters. It must be at least 1."]
- #[doc = "- It is the caller's responsibility to free this object via"]
- #[doc = "grpc_ssl_server_certificate_config_destroy()."]
- pub fn grpc_ssl_server_certificate_config_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- ) -> *mut grpc_ssl_server_certificate_config;
-}
-extern "C" {
- #[doc = " Destroys a grpc_ssl_server_certificate_config object."]
- pub fn grpc_ssl_server_certificate_config_destroy(
- config: *mut grpc_ssl_server_certificate_config,
- );
-}
-#[doc = " Callback to retrieve updated SSL server certificates, private keys, and"]
-#[doc = "trusted CAs (for client authentication)."]
-#[doc = "- user_data parameter, if not NULL, contains opaque data to be used by the"]
-#[doc = "callback."]
-#[doc = "- Use grpc_ssl_server_certificate_config_create to create the config."]
-#[doc = "- The caller assumes ownership of the config."]
-pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- config: *mut *mut grpc_ssl_server_certificate_config,
- ) -> grpc_ssl_certificate_config_reload_status,
->;
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex."]
- #[doc = "Creates an SSL server_credentials object."]
- #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client root certificates. This parameter may be NULL if the server does"]
- #[doc = "not want the client to be authenticated with SSL."]
- #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
- #[doc = "server. This parameter cannot be NULL."]
- #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
- #[doc = "and cert_chain_files parameters. It should be at least 1."]
- #[doc = "- force_client_auth, if set to non-zero will force the client to authenticate"]
- #[doc = "with an SSL cert. Note that this option is ignored if pem_root_certs is"]
- #[doc = "NULL."]
- pub fn grpc_ssl_server_credentials_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- force_client_auth: ::std::os::raw::c_int,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options."]
- #[doc = "Same as grpc_ssl_server_credentials_create method except uses"]
- #[doc = "grpc_ssl_client_certificate_request_type enum to support more ways to"]
- #[doc = "authenticate client certificates."]
- pub fn grpc_ssl_server_credentials_create_ex(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_server_credentials_options {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates an options object using a certificate config. Use this method when"]
- #[doc = "the certificates and keys of the SSL server will not change during the"]
- #[doc = "server's lifetime."]
- #[doc = "- Takes ownership of the certificate_config parameter."]
- pub fn grpc_ssl_server_credentials_create_options_using_config(
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- certificate_config: *mut grpc_ssl_server_certificate_config,
- ) -> *mut grpc_ssl_server_credentials_options;
-}
-extern "C" {
- #[doc = " Creates an options object using a certificate config fetcher. Use this"]
- #[doc = "method to reload the certificates and keys of the SSL server without"]
- #[doc = "interrupting the operation of the server. Initial certificate config will be"]
- #[doc = "fetched during server initialization."]
- #[doc = "- user_data parameter, if not NULL, contains opaque data which will be passed"]
- #[doc = "to the fetcher (see definition of"]
- #[doc = "grpc_ssl_server_certificate_config_callback)."]
- pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher(
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- cb: grpc_ssl_server_certificate_config_callback,
- user_data: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_ssl_server_credentials_options;
-}
-extern "C" {
- #[doc = " Destroys a grpc_ssl_server_credentials_options object."]
- pub fn grpc_ssl_server_credentials_options_destroy(
- options: *mut grpc_ssl_server_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Creates an SSL server_credentials object using the provided options struct."]
- #[doc = "- Takes ownership of the options parameter."]
- pub fn grpc_ssl_server_credentials_create_with_options(
- options: *mut grpc_ssl_server_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " Add a HTTP2 over an encrypted link over tcp listener."]
- #[doc = "Returns bound port number on success, 0 on failure."]
- #[doc = "REQUIRES: server not started"]
- pub fn grpc_server_add_secure_http2_port(
- server: *mut grpc_server,
- addr: *const ::std::os::raw::c_char,
- creds: *mut grpc_server_credentials,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Sets a credentials to a call. Can only be called on the client side before"]
- #[doc = "grpc_call_start_batch."]
- pub fn grpc_call_set_credentials(
- call: *mut grpc_call,
- creds: *mut grpc_call_credentials,
- ) -> grpc_call_error;
-}
-#[doc = " Callback function that is called when the metadata processing is done."]
-#[doc = "- Consumed metadata will be removed from the set of metadata available on the"]
-#[doc = "call. consumed_md may be NULL if no metadata has been consumed."]
-#[doc = "- Response metadata will be set on the response. response_md may be NULL."]
-#[doc = "- status is GRPC_STATUS_OK for success or a specific status for an error."]
-#[doc = "Common error status for auth metadata processing is either"]
-#[doc = "GRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or"]
-#[doc = "GRPC_STATUS PERMISSION_DENIED in case of an authorization failure."]
-#[doc = "- error_details gives details about the error. May be NULL."]
-pub type grpc_process_auth_metadata_done_cb = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- consumed_md: *const grpc_metadata,
- num_consumed_md: usize,
- response_md: *const grpc_metadata,
- num_response_md: usize,
- status: grpc_status_code::Type,
- error_details: *const ::std::os::raw::c_char,
- ),
->;
-#[doc = " Pluggable server-side metadata processor object."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_metadata_processor {
- #[doc = " The context object is read/write: it contains the properties of the"]
- #[doc = "channel peer and it is the job of the process function to augment it with"]
- #[doc = "properties derived from the passed-in metadata."]
- #[doc = "The lifetime of these objects is guaranteed until cb is invoked."]
- pub process: ::std::option::Option<
- unsafe extern "C" fn(
- state: *mut ::std::os::raw::c_void,
- context: *mut grpc_auth_context,
- md: *const grpc_metadata,
- num_md: usize,
- cb: grpc_process_auth_metadata_done_cb,
- user_data: *mut ::std::os::raw::c_void,
- ),
- >,
- pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
- pub state: *mut ::std::os::raw::c_void,
-}
-extern "C" {
- pub fn grpc_server_credentials_set_auth_metadata_processor(
- creds: *mut grpc_server_credentials,
- processor: grpc_auth_metadata_processor,
- );
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_alts_credentials_options {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " This method creates a grpc ALTS credentials client options instance."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options;
-}
-extern "C" {
- #[doc = " This method creates a grpc ALTS credentials server options instance."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options;
-}
-extern "C" {
- #[doc = " This method adds a target service account to grpc client's ALTS credentials"]
- #[doc = " options instance. It is used for experimental purpose for now and subject"]
- #[doc = " to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance."]
- #[doc = " - service_account: service account of target endpoint."]
- pub fn grpc_alts_credentials_client_options_add_target_service_account(
- options: *mut grpc_alts_credentials_options,
- service_account: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " This method destroys a grpc_alts_credentials_options instance by"]
- #[doc = " de-allocating all of its occupied memory. It is used for experimental purpose"]
- #[doc = " for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: a grpc_alts_credentials_options instance that needs to be"]
- #[doc = " destroyed."]
- pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options);
-}
-extern "C" {
- #[doc = " This method creates an ALTS channel credential object. The security"]
- #[doc = " level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance for client."]
- #[doc = ""]
- #[doc = " It returns the created ALTS channel credential object."]
- pub fn grpc_alts_credentials_create(
- options: *const grpc_alts_credentials_options,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " This method creates an ALTS server credential object. It is used for"]
- #[doc = " experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance for server."]
- #[doc = ""]
- #[doc = " It returns the created ALTS server credential object."]
- pub fn grpc_alts_server_credentials_create(
- options: *const grpc_alts_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " This method creates a local channel credential object. The security level"]
- #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and"]
- #[doc = " GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose"]
- #[doc = " for now and subject to change."]
- #[doc = ""]
- #[doc = " - type: local connection type"]
- #[doc = ""]
- #[doc = " It returns the created local channel credential object."]
- pub fn grpc_local_credentials_create(
- type_: grpc_local_connect_type,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " This method creates a local server credential object. It is used for"]
- #[doc = " experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - type: local connection type"]
- #[doc = ""]
- #[doc = " It returns the created local server credential object."]
- pub fn grpc_local_server_credentials_create(
- type_: grpc_local_connect_type,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_error_details {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_server_authorization_check_config {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_credentials_options {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_certificate_provider {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_identity_pairs {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_identity_pairs that stores a list of identity credential"]
- #[doc = " data, including identity private key and identity certificate chain. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs;
-}
-extern "C" {
- #[doc = " Adds a identity private key and a identity certificate chain to"]
- #[doc = " grpc_tls_identity_pairs. This function will make an internal copy of"]
- #[doc = " |private_key| and |cert_chain|. It is used for experimental purpose for now"]
- #[doc = " and subject to change."]
- pub fn grpc_tls_identity_pairs_add_pair(
- pairs: *mut grpc_tls_identity_pairs,
- private_key: *const ::std::os::raw::c_char,
- cert_chain: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Destroys a grpc_tls_identity_pairs object. If this object is passed to a"]
- #[doc = " provider initiation function, the ownership is transferred so this function"]
- #[doc = " doesn't need to be called. Otherwise the creator of the"]
- #[doc = " grpc_tls_identity_pairs object is responsible for its destruction. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs);
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_certificate_provider that will load credential data from"]
- #[doc = " static string during initialization. This provider will always return the"]
- #[doc = " same cert data for all cert names."]
- #[doc = " root_certificate and pem_key_cert_pairs can be nullptr, indicating the"]
- #[doc = " corresponding credential data is not needed."]
- #[doc = " This function will make a copy of |root_certificate|."]
- #[doc = " The ownership of |pem_key_cert_pairs| is transferred."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_static_data_create(
- root_certificate: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_tls_identity_pairs,
- ) -> *mut grpc_tls_certificate_provider;
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_certificate_provider that will watch the credential"]
- #[doc = " changes on the file system. This provider will always return the up-to-date"]
- #[doc = " cert data for all the cert names callers set through"]
- #[doc = " |grpc_tls_credentials_options|. Note that this API only supports one key-cert"]
- #[doc = " file and hence one set of identity key-cert pair, so SNI(Server Name"]
- #[doc = " Indication) is not supported."]
- #[doc = " - private_key_path is the file path of the private key. This must be set if"]
- #[doc = " |identity_certificate_path| is set. Otherwise, it could be null if no"]
- #[doc = " identity credentials are needed."]
- #[doc = " - identity_certificate_path is the file path of the identity certificate"]
- #[doc = " chain. This must be set if |private_key_path| is set. Otherwise, it could"]
- #[doc = " be null if no identity credentials are needed."]
- #[doc = " - root_cert_path is the file path to the root certificate bundle. This"]
- #[doc = " may be null if no root certs are needed."]
- #[doc = " - refresh_interval_sec is the refreshing interval that we will check the"]
- #[doc = " files for updates."]
- #[doc = " It does not take ownership of parameters."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_file_watcher_create(
- private_key_path: *const ::std::os::raw::c_char,
- identity_certificate_path: *const ::std::os::raw::c_char,
- root_cert_path: *const ::std::os::raw::c_char,
- refresh_interval_sec: ::std::os::raw::c_uint,
- ) -> *mut grpc_tls_certificate_provider;
-}
-extern "C" {
- #[doc = " Releases a grpc_tls_certificate_provider object. The creator of the"]
- #[doc = " grpc_tls_certificate_provider object is responsible for its release. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider);
-}
-extern "C" {
- #[doc = " Creates an grpc_tls_credentials_options."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options;
-}
-extern "C" {
- #[doc = " Sets the options of whether to request and verify client certs. This should"]
- #[doc = " be called only on the server side. It is used for experimental purpose for"]
- #[doc = " now and subject to change."]
- pub fn grpc_tls_credentials_options_set_cert_request_type(
- options: *mut grpc_tls_credentials_options,
- type_: grpc_ssl_client_certificate_request_type,
- );
-}
-extern "C" {
- #[doc = " Sets the options of whether to choose certain checks, e.g. certificate check,"]
- #[doc = " hostname check, etc. This should be called only on the client side. If"]
- #[doc = " |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a"]
- #[doc = " custom authorization check (grpc_tls_server_authorization_check_config) is"]
- #[doc = " mandatory. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_server_verification_option(
- options: *mut grpc_tls_credentials_options,
- server_verification_option: grpc_tls_server_verification_option,
- );
-}
-extern "C" {
- #[doc = " Sets the credential provider in the options."]
- #[doc = " The |options| will implicitly take a new ref to the |provider|."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_certificate_provider(
- options: *mut grpc_tls_credentials_options,
- provider: *mut grpc_tls_certificate_provider,
- );
-}
-extern "C" {
- #[doc = " If set, gRPC stack will keep watching the root certificates with"]
- #[doc = " name |root_cert_name|."]
- #[doc = " If this is not set on the client side, we will use the root certificates"]
- #[doc = " stored in the default system location, since client side must provide root"]
- #[doc = " certificates in TLS."]
- #[doc = " If this is not set on the server side, we will not watch any root certificate"]
- #[doc = " updates, and assume no root certificates needed for the server(single-side"]
- #[doc = " TLS). Default root certs on the server side is not supported."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_watch_root_certs(
- options: *mut grpc_tls_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Sets the name of the root certificates being watched."]
- #[doc = " If not set, We will use a default empty string as the root certificate name."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_root_cert_name(
- options: *mut grpc_tls_credentials_options,
- root_cert_name: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " If set, gRPC stack will keep watching the identity key-cert pairs"]
- #[doc = " with name |identity_cert_name|."]
- #[doc = " This is required on the server side, and optional on the client side."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_watch_identity_key_cert_pairs(
- options: *mut grpc_tls_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Sets the name of the identity certificates being watched."]
- #[doc = " If not set, We will use a default empty string as the identity certificate"]
- #[doc = " name. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_identity_cert_name(
- options: *mut grpc_tls_credentials_options,
- identity_cert_name: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Sets the configuration for a custom authorization check performed at the end"]
- #[doc = " of the handshake. The |options| will implicitly take a new ref to the"]
- #[doc = " |config|."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_server_authorization_check_config(
- options: *mut grpc_tls_credentials_options,
- config: *mut grpc_tls_server_authorization_check_config,
- );
-}
-#[doc = " callback function provided by gRPC used to handle the result of server"]
-#[doc = "authorization check. It is used when schedule API is implemented"]
-#[doc = "asynchronously, and serves to bring the control back to gRPC C core. It is"]
-#[doc = "used for experimental purpose for now and subject to change."]
-pub type grpc_tls_on_server_authorization_check_done_cb =
- ::std::option::Option<unsafe extern "C" fn(arg: *mut grpc_tls_server_authorization_check_arg)>;
-#[doc = " A struct containing all information necessary to schedule/cancel a server"]
-#[doc = "authorization check request."]
-#[doc = "- cb and cb_user_data represent a gRPC-provided callback and an argument"]
-#[doc = "passed to it."]
-#[doc = "- success will store the result of server authorization check. That is,"]
-#[doc = "if success returns a non-zero value, it means the authorization check"]
-#[doc = "passes and if returning zero, it means the check fails."]
-#[doc = "- target_name is the name of an endpoint the channel is connecting to."]
-#[doc = "- peer_cert represents a complete certificate chain including both"]
-#[doc = "signing and leaf certificates."]
-#[doc = "- \\a subject_alternative_names is an array of size"]
-#[doc = "\\a subject_alternative_names_size consisting of pointers to strings."]
-#[doc = "- status and error_details contain information"]
-#[doc = "about errors occurred when a server authorization check request is"]
-#[doc = "scheduled/cancelled."]
-#[doc = "- config is a pointer to the unique"]
-#[doc = "grpc_tls_server_authorization_check_config instance that this argument"]
-#[doc = "corresponds to."]
-#[doc = "- context is a pointer to a wrapped language implementation of this"]
-#[doc = "grpc_tls_server_authorization_check_arg instance."]
-#[doc = "- destroy_context is a pointer to a caller-provided method that cleans"]
-#[doc = "up any data associated with the context pointer."]
-#[doc = "It is used for experimental purpose for now and subject to change."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_server_authorization_check_arg {
- pub cb: grpc_tls_on_server_authorization_check_done_cb,
- pub cb_user_data: *mut ::std::os::raw::c_void,
- pub success: ::std::os::raw::c_int,
- pub target_name: *const ::std::os::raw::c_char,
- pub peer_cert: *const ::std::os::raw::c_char,
- pub peer_cert_full_chain: *const ::std::os::raw::c_char,
- pub subject_alternative_names: *mut *mut ::std::os::raw::c_char,
- pub subject_alternative_names_size: usize,
- pub status: grpc_status_code::Type,
- pub error_details: *mut grpc_tls_error_details,
- pub config: *mut grpc_tls_server_authorization_check_config,
- pub context: *mut ::std::os::raw::c_void,
- pub destroy_context:
- ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>,
-}
-extern "C" {
- #[doc = " Create a grpc_tls_server_authorization_check_config instance."]
- #[doc = "- config_user_data is config-specific, read-only user data"]
- #[doc = "that works for all channels created with a credential using the config."]
- #[doc = "- schedule is a pointer to an application-provided callback used to invoke"]
- #[doc = "server authorization check API. The implementation of this method has to"]
- #[doc = "be non-blocking, but can be performed synchronously or asynchronously."]
- #[doc = "1)If processing occurs synchronously, it populates arg->result,"]
- #[doc = "arg->status, and arg->error_details and returns zero."]
- #[doc = "2) If processing occurs asynchronously, it returns a non-zero value. The"]
- #[doc = "application then invokes arg->cb when processing is completed. Note that"]
- #[doc = "arg->cb cannot be invoked before schedule API returns."]
- #[doc = "- cancel is a pointer to an application-provided callback used to cancel a"]
- #[doc = "server authorization check request scheduled via an asynchronous schedule"]
- #[doc = "API. arg is used to pinpoint an exact check request to be cancelled. The"]
- #[doc = "operation may not have any effect if the request has already been"]
- #[doc = "processed."]
- #[doc = "- destruct is a pointer to an application-provided callback used to clean up"]
- #[doc = "any data associated with the config."]
- #[doc = "It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_authorization_check_config_create(
- config_user_data: *const ::std::os::raw::c_void,
- schedule: ::std::option::Option<
- unsafe extern "C" fn(
- config_user_data: *mut ::std::os::raw::c_void,
- arg: *mut grpc_tls_server_authorization_check_arg,
- ) -> ::std::os::raw::c_int,
- >,
- cancel: ::std::option::Option<
- unsafe extern "C" fn(
- config_user_data: *mut ::std::os::raw::c_void,
- arg: *mut grpc_tls_server_authorization_check_arg,
- ),
- >,
- destruct: ::std::option::Option<
- unsafe extern "C" fn(config_user_data: *mut ::std::os::raw::c_void),
- >,
- ) -> *mut grpc_tls_server_authorization_check_config;
-}
-extern "C" {
- #[doc = " Releases a grpc_tls_server_authorization_check_config object. The creator of"]
- #[doc = " the grpc_tls_server_authorization_check_config object is responsible for its"]
- #[doc = " release. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_authorization_check_config_release(
- config: *mut grpc_tls_server_authorization_check_config,
- );
-}
-extern "C" {
- #[doc = " Creates a TLS channel credential object based on the"]
- #[doc = " grpc_tls_credentials_options specified by callers. The"]
- #[doc = " grpc_channel_credentials will take the ownership of the |options|. The"]
- #[doc = " security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY. It"]
- #[doc = " is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_create(
- options: *mut grpc_tls_credentials_options,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a TLS server credential object based on the"]
- #[doc = " grpc_tls_credentials_options specified by callers. The"]
- #[doc = " grpc_server_credentials will take the ownership of the |options|. It"]
- #[doc = " is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_credentials_create(
- options: *mut grpc_tls_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an insecure channel credentials object."]
- pub fn grpc_insecure_credentials_create() -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an insecure server credentials object."]
- pub fn grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an xDS channel credentials object."]
- #[doc = ""]
- #[doc = " Creating a channel with credentials of this type indicates that the channel"]
- #[doc = " should get credentials configuration from the xDS control plane."]
- #[doc = ""]
- #[doc = " \\a fallback_credentials are used if the channel target does not have the"]
- #[doc = " 'xds:///' scheme or if the xDS control plane does not provide information on"]
- #[doc = " how to fetch credentials dynamically. Does NOT take ownership of the \\a"]
- #[doc = " fallback_credentials. (Internally takes a ref to the object.)"]
- pub fn grpc_xds_credentials_create(
- fallback_credentials: *mut grpc_channel_credentials,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an xDS server credentials object."]
- #[doc = ""]
- #[doc = " \\a fallback_credentials are used if the xDS control plane does not provide"]
- #[doc = " information on how to fetch credentials dynamically."]
- #[doc = ""]
- #[doc = " Does NOT take ownership of the \\a fallback_credentials. (Internally takes"]
- #[doc = " a ref to the object.)"]
- pub fn grpc_xds_server_credentials_create(
- fallback_credentials: *mut grpc_server_credentials,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(u32)]
-#[doc = " The severity of a log message - use the #defines below when calling into"]
-#[doc = "gpr_log to additionally supply file and line data"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum gpr_log_severity {
- GPR_LOG_SEVERITY_DEBUG = 0,
- GPR_LOG_SEVERITY_INFO = 1,
- GPR_LOG_SEVERITY_ERROR = 2,
-}
-extern "C" {
- #[doc = " Returns a string representation of the log severity"]
- pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context"]
- #[doc = " for each message"]
- pub fn gpr_log(
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_int,
- severity: gpr_log_severity,
- format: *const ::std::os::raw::c_char,
- ...
- );
-}
-extern "C" {
- pub fn gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn gpr_log_message(
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_int,
- severity: gpr_log_severity,
- message: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Set global log verbosity"]
- pub fn gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity);
-}
-extern "C" {
- pub fn gpr_log_verbosity_init();
-}
-#[doc = " Log overrides: applications can use this API to intercept logging calls"]
-#[doc = "and use their own implementations"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_log_func_args {
- pub file: *const ::std::os::raw::c_char,
- pub line: ::std::os::raw::c_int,
- pub severity: gpr_log_severity,
- pub message: *const ::std::os::raw::c_char,
-}
-pub type gpr_log_func = ::std::option::Option<unsafe extern "C" fn(args: *mut gpr_log_func_args)>;
-extern "C" {
- pub fn gpr_set_log_function(func: gpr_log_func);
-}
-extern "C" {
- #[doc = " malloc."]
- #[doc = " If size==0, always returns NULL. Otherwise this function never returns NULL."]
- #[doc = " The pointer returned is suitably aligned for any kind of variable it could"]
- #[doc = " contain."]
- pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " like malloc, but zero all bytes before returning them"]
- pub fn gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " free"]
- pub fn gpr_free(ptr: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " realloc, never returns NULL"]
- pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " aligned malloc, never returns NULL, will align to alignment, which"]
- #[doc = " must be a power of 2."]
- pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " free memory allocated by gpr_malloc_aligned"]
- pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " Return the number of CPU cores on the current system. Will return 0 if"]
- #[doc = "the information is not available."]
- pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint;
-}
-extern "C" {
- #[doc = " Return the CPU on which the current thread is executing; N.B. This should"]
- #[doc = "be considered advisory only - it is possible that the thread is switched"]
- #[doc = "to a different CPU at any time. Returns a value in range"]
- #[doc = "[0, gpr_cpu_num_cores() - 1]"]
- pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint;
-}
-extern "C" {
- #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8"]
- #[doc = " formatted error message, corresponding to the error messageid."]
- #[doc = " Use in conjunction with GetLastError() et al."]
- pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns a copy of src that can be passed to gpr_free()."]
- #[doc = "If allocation fails or if src is NULL, returns NULL."]
- pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " printf to a newly-allocated string. The set of supported formats may vary"]
- #[doc = "between platforms."]
- #[doc = ""]
- #[doc = "On success, returns the number of bytes printed (excluding the final '\\0'),"]
- #[doc = "and *strp points to a string which must later be destroyed with gpr_free()."]
- #[doc = ""]
- #[doc = "On error, returns -1 and sets *strp to NULL. If the format string is bad,"]
- #[doc = "the result is undefined."]
- pub fn gpr_asprintf(
- strp: *mut *mut ::std::os::raw::c_char,
- format: *const ::std::os::raw::c_char,
- ...
- ) -> ::std::os::raw::c_int;
-}
-pub type gpr_thd_id = usize;
-extern "C" {
- #[doc = " Returns the identifier of the current thread."]
- pub fn gpr_thd_currentid() -> gpr_thd_id;
-}
-#[doc = " Reader for byte buffers. Iterates over slices in the byte buffer"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer_reader {
- pub buffer_in: *mut grpc_byte_buffer,
- pub buffer_out: *mut grpc_byte_buffer,
- pub current: grpc_byte_buffer_reader_grpc_byte_buffer_reader_current,
-}
-#[doc = " Different current objects correspond to different types of byte buffers"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
- #[doc = " Index into a slice buffer's array of slices"]
- pub index: ::std::os::raw::c_uint,
- _bindgen_union_align: u32,
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}"
- )
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_reader {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}",
- self.buffer_in, self.buffer_out, self.current
- )
- }
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_batch_context {
- pub send_initial_metadata: grpc_metadata_array,
- pub send_message: *mut grpc_byte_buffer,
- pub send_status_from_server: grpcwrap_batch_context__bindgen_ty_1,
- pub recv_initial_metadata: grpc_metadata_array,
- pub recv_message: *mut grpc_byte_buffer,
- pub recv_status_on_client: grpcwrap_batch_context__bindgen_ty_2,
- pub recv_close_on_server_cancelled: ::std::os::raw::c_int,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpcwrap_batch_context__bindgen_ty_1 {
- pub trailing_metadata: grpc_metadata_array,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_batch_context__bindgen_ty_2 {
- pub trailing_metadata: grpc_metadata_array,
- pub status: grpc_status_code::Type,
- pub status_details: grpc_slice,
-}
-impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details)
- }
-}
-impl ::std::fmt::Debug for grpcwrap_batch_context {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled)
- }
-}
-extern "C" {
- pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context;
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_request_call_context {
- pub call: *mut grpc_call,
- pub call_details: grpc_call_details,
- pub request_metadata: grpc_metadata_array,
-}
-impl ::std::fmt::Debug for grpcwrap_request_call_context {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata)
- }
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context;
-}
-extern "C" {
- #[link_name = "\u{1}_Z45grpcwrap_metadata_array_destroy_metadata_onlyP19grpc_metadata_array"]
- pub fn grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array);
-}
-extern "C" {
- #[link_name = "\u{1}_Z58grpcwrap_metadata_array_destroy_metadata_including_entriesP19grpc_metadata_array"]
- pub fn grpcwrap_metadata_array_destroy_metadata_including_entries(
- array: *mut grpc_metadata_array,
- );
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_add(
- array: *mut grpc_metadata_array,
- key: *const ::std::os::raw::c_char,
- key_length: usize,
- value: *const ::std::os::raw::c_char,
- value_length: usize,
- );
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_get_key(
- array: *const grpc_metadata_array,
- index: usize,
- key_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_get_value(
- array: *const grpc_metadata_array,
- index: usize,
- value_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array);
-}
-extern "C" {
- #[link_name = "\u{1}_Z28grpcwrap_metadata_array_moveP19grpc_metadata_arrayS0_"]
- pub fn grpcwrap_metadata_array_move(
- dest: *mut grpc_metadata_array,
- src: *mut grpc_metadata_array,
- );
-}
-extern "C" {
- pub fn grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context);
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context);
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_initial_metadata(
- ctx: *const grpcwrap_batch_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_slice_raw_offset(
- slice: *const grpc_slice,
- offset: usize,
- len: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice;
-}
-extern "C" {
- pub fn grpcwrap_slice_unref(slice: *const grpc_slice);
-}
-extern "C" {
- pub fn grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice;
-}
-extern "C" {
- pub fn grpcwrap_slice_length(slice: *const grpc_slice) -> usize;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_take_recv_message(
- ctx: *mut grpcwrap_batch_context,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_status(
- ctx: *const grpcwrap_batch_context,
- ) -> grpc_status_code::Type;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_details(
- ctx: *const grpcwrap_batch_context,
- details_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_trailing_metadata(
- ctx: *const grpcwrap_batch_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_ref_call(
- ctx: *mut grpcwrap_request_call_context,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_get_call(
- ctx: *mut grpcwrap_request_call_context,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_method(
- ctx: *const grpcwrap_request_call_context,
- method_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_host(
- ctx: *const grpcwrap_request_call_context,
- host_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_deadline(
- ctx: *const grpcwrap_request_call_context,
- ) -> gpr_timespec;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_metadata_array(
- ctx: *const grpcwrap_request_call_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_close_on_server_cancelled(
- ctx: *const grpcwrap_batch_context,
- ) -> i32;
-}
-extern "C" {
- pub fn grpcwrap_channel_create_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- cq: *mut grpc_completion_queue,
- method: *const ::std::os::raw::c_char,
- method_len: usize,
- host: *const ::std::os::raw::c_char,
- host_len: usize,
- deadline: gpr_timespec,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args;
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_string(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_integer(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: ::std::os::raw::c_int,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_pointer_vtable(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: *mut ::std::os::raw::c_void,
- vtable: *const grpc_arg_pointer_vtable,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_destroy(args: *mut grpc_channel_args);
-}
-extern "C" {
- pub fn grpcwrap_call_start_unary(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_client_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_server_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_duplex_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_recv_initial_metadata(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_message(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- send_empty_initial_metadata: i32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_close_from_client(
- call: *mut grpc_call,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_status_from_server(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- status_code: grpc_status_code::Type,
- status_details: *const ::std::os::raw::c_char,
- status_details_len: usize,
- trailing_metadata: *mut grpc_metadata_array,
- send_empty_initial_metadata: i32,
- optional_send_buffer: *mut grpc_slice,
- write_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_recv_message(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_serverside(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_initial_metadata(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Kick call's completion queue, it should be called after there is an event"]
- #[doc = "ready to poll."]
- #[doc = "THREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe"]
- #[doc = "because it does not change the call's state."]
- pub fn grpcwrap_call_kick_completion_queue(
- call: *mut grpc_call,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_server_request_call(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- ctx: *mut grpcwrap_request_call_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
diff --git a/bindings/bindings.rs b/bindings/bindings.rs
new file mode 100644
index 00000000..8081114f
--- /dev/null
+++ b/bindings/bindings.rs
@@ -0,0 +1,4209 @@
+pub const GRPC_ARES: u32 = 1;
+pub const GRPC_IF_NAMETOINDEX: u32 = 1;
+pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1;
+pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &[u8; 31usize] =
+ b"grpc-internal-encoding-request\0";
+pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &[u8; 35usize] =
+ b"grpc.default_compression_algorithm\0";
+pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &[u8; 31usize] =
+ b"grpc.default_compression_level\0";
+pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &[u8; 43usize] =
+ b"grpc.compression_enabled_algorithms_bitset\0";
+pub const GRPC_ALLOW_GPR_SLICE_FUNCTIONS: u32 = 1;
+pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8;
+pub const GRPC_ARG_ENABLE_CENSUS: &[u8; 12usize] = b"grpc.census\0";
+pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &[u8; 19usize] = b"grpc.loadreporting\0";
+pub const GRPC_ARG_MINIMAL_STACK: &[u8; 19usize] = b"grpc.minimal_stack\0";
+pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &[u8; 28usize] = b"grpc.max_concurrent_streams\0";
+pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &[u8; 32usize] =
+ b"grpc.max_receive_message_length\0";
+pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &[u8; 32usize] = b"grpc.max_receive_message_length\0";
+pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &[u8; 29usize] = b"grpc.max_send_message_length\0";
+pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &[u8; 28usize] = b"grpc.max_connection_idle_ms\0";
+pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &[u8; 27usize] = b"grpc.max_connection_age_ms\0";
+pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &[u8; 33usize] =
+ b"grpc.max_connection_age_grace_ms\0";
+pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &[u8; 28usize] = b"grpc.client_idle_timeout_ms\0";
+pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &[u8; 29usize] =
+ b"grpc.per_message_compression\0";
+pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &[u8; 31usize] =
+ b"grpc.per_message_decompression\0";
+pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &[u8; 30usize] = b"grpc.enable_deadline_checking\0";
+pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &[u8; 35usize] =
+ b"grpc.http2.initial_sequence_number\0";
+pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &[u8; 27usize] = b"grpc.http2.lookahead_bytes\0";
+pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &[u8; 36usize] =
+ b"grpc.http2.hpack_table_size.decoder\0";
+pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &[u8; 36usize] =
+ b"grpc.http2.hpack_table_size.encoder\0";
+pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &[u8; 26usize] = b"grpc.http2.max_frame_size\0";
+pub const GRPC_ARG_HTTP2_BDP_PROBE: &[u8; 21usize] = b"grpc.http2.bdp_probe\0";
+pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 37usize] =
+ b"grpc.http2.min_time_between_pings_ms\0";
+pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 45usize] =
+ b"grpc.http2.min_ping_interval_without_data_ms\0";
+pub const GRPC_ARG_HTTP2_SCHEME: &[u8; 18usize] = b"grpc.http2_scheme\0";
+pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &[u8; 34usize] =
+ b"grpc.http2.max_pings_without_data\0";
+pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &[u8; 28usize] = b"grpc.http2.max_ping_strikes\0";
+pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &[u8; 29usize] = b"grpc.http2.write_buffer_size\0";
+pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &[u8; 23usize] = b"grpc.http2.true_binary\0";
+pub const GRPC_ARG_KEEPALIVE_TIME_MS: &[u8; 23usize] = b"grpc.keepalive_time_ms\0";
+pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &[u8; 26usize] = b"grpc.keepalive_timeout_ms\0";
+pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &[u8; 36usize] =
+ b"grpc.keepalive_permit_without_calls\0";
+pub const GRPC_ARG_DEFAULT_AUTHORITY: &[u8; 23usize] = b"grpc.default_authority\0";
+pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &[u8; 24usize] = b"grpc.primary_user_agent\0";
+pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &[u8; 26usize] = b"grpc.secondary_user_agent\0";
+pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &[u8; 30usize] = b"grpc.min_reconnect_backoff_ms\0";
+pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &[u8; 30usize] = b"grpc.max_reconnect_backoff_ms\0";
+pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &[u8; 34usize] =
+ b"grpc.initial_reconnect_backoff_ms\0";
+pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &[u8; 41usize] =
+ b"grpc.dns_min_time_between_resolutions_ms\0";
+pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &[u8; 33usize] =
+ b"grpc.server_handshake_timeout_ms\0";
+pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &[u8; 30usize] = b"grpc.ssl_target_name_override\0";
+pub const GRPC_SSL_SESSION_CACHE_ARG: &[u8; 23usize] = b"grpc.ssl_session_cache\0";
+pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &[u8; 24usize] = b"grpc.tsi.max_frame_size\0";
+pub const GRPC_ARG_MAX_METADATA_SIZE: &[u8; 23usize] = b"grpc.max_metadata_size\0";
+pub const GRPC_ARG_ALLOW_REUSEPORT: &[u8; 18usize] = b"grpc.so_reuseport\0";
+pub const GRPC_ARG_RESOURCE_QUOTA: &[u8; 20usize] = b"grpc.resource_quota\0";
+pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &[u8; 27usize] = b"grpc.expand_wildcard_addrs\0";
+pub const GRPC_ARG_SERVICE_CONFIG: &[u8; 20usize] = b"grpc.service_config\0";
+pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &[u8; 39usize] =
+ b"grpc.service_config_disable_resolution\0";
+pub const GRPC_ARG_LB_POLICY_NAME: &[u8; 20usize] = b"grpc.lb_policy_name\0";
+pub const GRPC_ARG_SOCKET_MUTATOR: &[u8; 20usize] = b"grpc.socket_mutator\0";
+pub const GRPC_ARG_SOCKET_FACTORY: &[u8; 20usize] = b"grpc.socket_factory\0";
+pub const GRPC_ARG_GZIP_COMPRESSION_LEVEL: &[u8; 28usize] = b"grpc.gzip_compression_level\0";
+pub const GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS: &[u8; 39usize] =
+ b"grpc.gprc_min_message_size_to_compress\0";
+pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &[u8; 45usize] =
+ b"grpc.max_channel_trace_event_memory_per_node\0";
+pub const GRPC_ARG_ENABLE_CHANNELZ: &[u8; 21usize] = b"grpc.enable_channelz\0";
+pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &[u8; 34usize] =
+ b"grpc.use_cronet_packet_coalescing\0";
+pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &[u8; 38usize] = b"grpc.experimental.tcp_read_chunk_size\0";
+pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192;
+pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &[u8; 42usize] =
+ b"grpc.experimental.tcp_min_read_chunk_size\0";
+pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &[u8; 42usize] =
+ b"grpc.experimental.tcp_max_read_chunk_size\0";
+pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &[u8; 42usize] =
+ b"grpc.experimental.tcp_tx_zerocopy_enabled\0";
+pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &[u8; 55usize] =
+ b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0";
+pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &[u8; 57usize] =
+ b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0";
+pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &[u8; 28usize] = b"grpc.grpclb_call_timeout_ms\0";
+pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &[u8; 55usize] =
+ b"grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config\0";
+pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &[u8; 32usize] =
+ b"grpc.grpclb_fallback_timeout_ms\0";
+pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &[u8; 34usize] =
+ b"grpc.priority_failover_timeout_ms\0";
+pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &[u8; 35usize] =
+ b"grpc.workaround.cronet_compression\0";
+pub const GRPC_ARG_OPTIMIZATION_TARGET: &[u8; 25usize] = b"grpc.optimization_target\0";
+pub const GRPC_ARG_ENABLE_RETRIES: &[u8; 20usize] = b"grpc.enable_retries\0";
+pub const GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING: &[u8; 33usize] =
+ b"grpc.experimental.enable_hedging\0";
+pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &[u8; 31usize] = b"grpc.per_rpc_retry_buffer_size\0";
+pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &[u8; 24usize] = b"grpc.mobile_log_context\0";
+pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &[u8; 37usize] =
+ b"grpc.disable_client_authority_filter\0";
+pub const GRPC_ARG_ENABLE_HTTP_PROXY: &[u8; 23usize] = b"grpc.enable_http_proxy\0";
+pub const GRPC_ARG_HTTP_PROXY: &[u8; 16usize] = b"grpc.http_proxy\0";
+pub const GRPC_ARG_SURFACE_USER_AGENT: &[u8; 24usize] = b"grpc.surface_user_agent\0";
+pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &[u8; 29usize] = b"grpc.inhibit_health_checking\0";
+pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &[u8; 28usize] = b"grpc.dns_enable_srv_queries\0";
+pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &[u8; 28usize] = b"grpc.dns_ares_query_timeout\0";
+pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &[u8; 31usize] = b"grpc.use_local_subchannel_pool\0";
+pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &[u8; 28usize] = b"grpc.channel_pooling_domain\0";
+pub const GRPC_ARG_CHANNEL_ID: &[u8; 16usize] = b"grpc.channel_id\0";
+pub const GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER: &[u8; 35usize] =
+ b"grpc.authorization_policy_provider\0";
+pub const GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS: &[u8; 59usize] =
+ b"grpc.experimental.server_config_change_drain_grace_time_ms\0";
+pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1;
+pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304;
+pub const GRPC_WRITE_BUFFER_HINT: u32 = 1;
+pub const GRPC_WRITE_NO_COMPRESS: u32 = 2;
+pub const GRPC_WRITE_THROUGH: u32 = 4;
+pub const GRPC_WRITE_USED_MASK: u32 = 7;
+pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY: u32 = 32;
+pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET: u32 = 128;
+pub const GRPC_INITIAL_METADATA_CORKED: u32 = 256;
+pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 420;
+pub const GRPC_CQ_CURRENT_VERSION: u32 = 2;
+pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2;
+pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6;
+pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &[u8; 24usize] = b"transport_security_type\0";
+pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &[u8; 4usize] = b"ssl\0";
+pub const GRPC_TLS_TRANSPORT_SECURITY_TYPE: &[u8; 4usize] = b"tls\0";
+pub const GRPC_X509_CN_PROPERTY_NAME: &[u8; 17usize] = b"x509_common_name\0";
+pub const GRPC_X509_SUBJECT_PROPERTY_NAME: &[u8; 13usize] = b"x509_subject\0";
+pub const GRPC_X509_SAN_PROPERTY_NAME: &[u8; 30usize] = b"x509_subject_alternative_name\0";
+pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &[u8; 14usize] = b"x509_pem_cert\0";
+pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &[u8; 20usize] = b"x509_pem_cert_chain\0";
+pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &[u8; 19usize] = b"ssl_session_reused\0";
+pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &[u8; 15usize] = b"security_level\0";
+pub const GRPC_PEER_DNS_PROPERTY_NAME: &[u8; 9usize] = b"peer_dns\0";
+pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &[u8; 15usize] = b"peer_spiffe_id\0";
+pub const GRPC_PEER_URI_PROPERTY_NAME: &[u8; 9usize] = b"peer_uri\0";
+pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &[u8; 11usize] = b"peer_email\0";
+pub const GRPC_PEER_IP_PROPERTY_NAME: &[u8; 8usize] = b"peer_ip\0";
+pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &[u8; 33usize] =
+ b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0";
+pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &[u8; 31usize] = b"GOOGLE_APPLICATION_CREDENTIALS\0";
+pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4;
+#[repr(u32)]
+#[doc = " The various compression algorithms supported by gRPC (not sorted by"]
+#[doc = " compression level)"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_compression_algorithm {
+ GRPC_COMPRESS_NONE = 0,
+ GRPC_COMPRESS_DEFLATE = 1,
+ GRPC_COMPRESS_GZIP = 2,
+ GRPC_COMPRESS_ALGORITHMS_COUNT = 3,
+}
+#[repr(u32)]
+#[doc = " Compression levels allow a party with knowledge of its peer's accepted"]
+#[doc = " encodings to request compression in an abstract way. The level-algorithm"]
+#[doc = " mapping is performed internally and depends on the peer's supported"]
+#[doc = " compression algorithms."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_compression_level {
+ GRPC_COMPRESS_LEVEL_NONE = 0,
+ GRPC_COMPRESS_LEVEL_LOW = 1,
+ GRPC_COMPRESS_LEVEL_MED = 2,
+ GRPC_COMPRESS_LEVEL_HIGH = 3,
+ GRPC_COMPRESS_LEVEL_COUNT = 4,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_compression_options {
+ #[doc = " All algs are enabled by default. This option corresponds to the channel"]
+ #[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"]
+ pub enabled_algorithms_bitset: u32,
+ pub default_level: grpc_compression_options_grpc_compression_options_default_level,
+ pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm,
+}
+#[doc = " The default compression level. It'll be used in the absence of call"]
+#[doc = " specific settings. This option corresponds to the channel"]
+#[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,"]
+#[doc = " takes precedence over \\a default_algorithm."]
+#[doc = " TODO(dgq): currently only available for server channels."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_compression_options_grpc_compression_options_default_level {
+ pub is_set: ::std::os::raw::c_int,
+ pub level: grpc_compression_level,
+}
+#[doc = " The default message compression algorithm. It'll be used in the absence of"]
+#[doc = " call specific settings. This option corresponds to the channel argument key"]
+#[doc = " behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_compression_options_grpc_compression_options_default_algorithm {
+ pub is_set: ::std::os::raw::c_int,
+ pub algorithm: grpc_compression_algorithm,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_slice_refcount {
+ _unused: [u8; 0],
+}
+#[doc = " A grpc_slice s, if initialized, represents the byte range"]
+#[doc = "s.bytes[0..s.length-1]."]
+#[doc = ""]
+#[doc = "It can have an associated ref count which has a destruction routine to be run"]
+#[doc = "when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref())."]
+#[doc = "Multiple grpc_slice values may share a ref count."]
+#[doc = ""]
+#[doc = "If the slice does not have a refcount, it represents an inlined small piece"]
+#[doc = "of data that is copied by value."]
+#[doc = ""]
+#[doc = "As a special case, a slice can be given refcount == uintptr_t(1), meaning"]
+#[doc = "that the slice represents external data that is not refcounted."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_slice {
+ pub refcount: *mut grpc_slice_refcount,
+ pub data: grpc_slice_grpc_slice_data,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union grpc_slice_grpc_slice_data {
+ pub refcounted: grpc_slice_grpc_slice_data_grpc_slice_refcounted,
+ pub inlined: grpc_slice_grpc_slice_data_grpc_slice_inlined,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted {
+ pub length: usize,
+ pub bytes: *mut u8,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined {
+ pub length: u8,
+ pub bytes: [u8; 23usize],
+}
+impl ::std::fmt::Debug for grpc_slice_grpc_slice_data {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(f, "grpc_slice_grpc_slice_data {{ union }}")
+ }
+}
+impl ::std::fmt::Debug for grpc_slice {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_slice {{ refcount: {:?}, data: {:?} }}",
+ self.refcount, self.data
+ )
+ }
+}
+#[doc = " Represents an expandable array of slices, to be interpreted as a"]
+#[doc = "single item."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_slice_buffer {
+ #[doc = " This is for internal use only. External users (i.e any code outside grpc"]
+ #[doc = " core) MUST NOT use this field"]
+ pub base_slices: *mut grpc_slice,
+ #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"]
+ pub slices: *mut grpc_slice,
+ #[doc = " the number of slices in the array"]
+ pub count: usize,
+ #[doc = " the number of slices allocated in the array. External users (i.e any code"]
+ #[doc = " outside grpc core) MUST NOT use this field"]
+ pub capacity: usize,
+ #[doc = " the combined length of all slices in the array"]
+ pub length: usize,
+ #[doc = " inlined elements to avoid allocations"]
+ pub inlined: [grpc_slice; 8usize],
+}
+impl ::std::fmt::Debug for grpc_slice_buffer {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, inlined: {:?} }}",
+ self.base_slices, self.slices, self.inlined
+ )
+ }
+}
+#[repr(u32)]
+#[doc = " The clocks we support."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum gpr_clock_type {
+ #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."]
+ GPR_CLOCK_MONOTONIC = 0,
+ #[doc = " Realtime clock. May jump forwards or backwards. Settable by"]
+ #[doc = "the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."]
+ GPR_CLOCK_REALTIME = 1,
+ #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch"]
+ #[doc = "undefined. Degrades to GPR_CLOCK_REALTIME on other platforms."]
+ GPR_CLOCK_PRECISE = 2,
+ #[doc = " Unmeasurable clock type: no base, created by taking the difference"]
+ #[doc = "between two times"]
+ GPR_TIMESPAN = 3,
+}
+#[doc = " Analogous to struct timespec. On some machines, absolute times may be in"]
+#[doc = " local time."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct gpr_timespec {
+ pub tv_sec: i64,
+ pub tv_nsec: i32,
+ #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if"]
+ #[doc = "this is a relative time measure)"]
+ pub clock_type: gpr_clock_type,
+}
+pub type gpr_atm = isize;
+extern "C" {
+ #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"]
+ #[doc = "by \\a min and \\a max. Returns the new value."]
+ pub fn gpr_atm_no_barrier_clamped_add(
+ value: *mut gpr_atm,
+ delta: gpr_atm,
+ min: gpr_atm,
+ max: gpr_atm,
+ ) -> gpr_atm;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct gpr_event {
+ pub state: gpr_atm,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct gpr_refcount {
+ pub count: gpr_atm,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct gpr_stats_counter {
+ pub value: gpr_atm,
+}
+extern "C" {
+ #[doc = " Initialize *ev."]
+ pub fn gpr_event_init(ev: *mut gpr_event);
+}
+extern "C" {
+ #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value."]
+ #[doc = "Requires: *ev initialized; value != NULL; no prior or concurrent calls to"]
+ #[doc = "gpr_event_set(ev, ...) since initialization."]
+ pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void);
+}
+extern "C" {
+ #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has"]
+ #[doc = "completed. If the result is non-NULL, all operations that occurred prior to"]
+ #[doc = "the gpr_event_set(ev, ...) set will be visible after this call returns."]
+ #[doc = "Requires: *ev initialized. This operation is faster than acquiring a mutex"]
+ #[doc = "on most platforms."]
+ pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is"]
+ #[doc = "exceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use"]
+ #[doc = "abs_deadline==gpr_inf_future for no deadline. When the event has been"]
+ #[doc = "signalled before the call, this operation is faster than acquiring a mutex"]
+ #[doc = "on most platforms."]
+ pub fn gpr_event_wait(
+ ev: *mut gpr_event,
+ abs_deadline: gpr_timespec,
+ ) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " Initialize *r to value n."]
+ pub fn gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
+}
+extern "C" {
+ #[doc = " Increment the reference count *r. Requires *r initialized."]
+ pub fn gpr_ref(r: *mut gpr_refcount);
+}
+extern "C" {
+ #[doc = " Increment the reference count *r. Requires *r initialized."]
+ #[doc = "Crashes if refcount is zero"]
+ pub fn gpr_ref_non_zero(r: *mut gpr_refcount);
+}
+extern "C" {
+ #[doc = " Increment the reference count *r by n. Requires *r initialized, n > 0."]
+ pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
+}
+extern "C" {
+ #[doc = " Decrement the reference count *r and return non-zero iff it has reached"]
+ #[doc = "zero. . Requires *r initialized."]
+ pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned"]
+ #[doc = "by exactly one object."]
+ pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Initialize *c to the value n."]
+ pub fn gpr_stats_init(c: *mut gpr_stats_counter, n: isize);
+}
+extern "C" {
+ #[doc = " *c += inc. Requires: *c initialized."]
+ pub fn gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize);
+}
+extern "C" {
+ #[doc = " Return *c. Requires: *c initialized."]
+ pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize;
+}
+extern "C" {
+ #[doc = " Increment the refcount of s. Requires slice is initialized."]
+ #[doc = "Returns s."]
+ pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all"]
+ #[doc = "slices sharing the ref count are destroyed, and considered no longer"]
+ #[doc = "initialized. If s is ultimately derived from a call to grpc_slice_new(start,"]
+ #[doc = "len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is"]
+ #[doc = "ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)"]
+ #[doc = "where dest!=NULL , then (*dest)(start, len). Requires s initialized."]
+ pub fn grpc_slice_unref(s: grpc_slice);
+}
+extern "C" {
+ #[doc = " Copy slice - create a new slice that contains the same data as s"]
+ pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount"]
+ #[doc = "for the object, and arranges that destroy will be called with the pointer"]
+ #[doc = "passed in at destruction."]
+ pub fn grpc_slice_new(
+ p: *mut ::std::os::raw::c_void,
+ len: usize,
+ destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is"]
+ #[doc = "passed to the destroy function. This function can be useful when"]
+ #[doc = "the data is part of a larger structure that must be destroyed when"]
+ #[doc = "the data is no longer needed."]
+ pub fn grpc_slice_new_with_user_data(
+ p: *mut ::std::os::raw::c_void,
+ len: usize,
+ destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
+ user_data: *mut ::std::os::raw::c_void,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that"]
+ #[doc = "also takes the slice length."]
+ pub fn grpc_slice_new_with_len(
+ p: *mut ::std::os::raw::c_void,
+ len: usize,
+ destroy: ::std::option::Option<
+ unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize),
+ >,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()"]
+ #[doc = "call."]
+ #[doc = "Aborts if malloc() fails."]
+ pub fn grpc_slice_malloc(length: usize) -> grpc_slice;
+}
+extern "C" {
+ pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Create a slice by copying a string."]
+ #[doc = "Does not preserve null terminators."]
+ #[doc = "Equivalent to:"]
+ #[doc = "size_t len = strlen(source);"]
+ #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
+ #[doc = "memcpy(slice->data, source, len);"]
+ pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Create a slice by copying a buffer."]
+ #[doc = "Equivalent to:"]
+ #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
+ #[doc = "memcpy(slice->data, source, len);"]
+ pub fn grpc_slice_from_copied_buffer(
+ source: *const ::std::os::raw::c_char,
+ len: usize,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Create a slice pointing to constant memory"]
+ pub fn grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Create a slice pointing to constant memory"]
+ pub fn grpc_slice_from_static_buffer(
+ source: *const ::std::os::raw::c_void,
+ len: usize,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,"]
+ #[doc = "where result.data==s.data+begin, and result.length==end-begin. The ref count"]
+ #[doc = "of \\a s is increased by one. Do not assign result back to \\a s."]
+ #[doc = "Requires s initialized, begin <= end, begin <= s.length, and"]
+ #[doc = "end <= source->length."]
+ pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " The same as grpc_slice_sub, but without altering the ref count"]
+ pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,"]
+ #[doc = "sharing a refcount with s, that contains s[split:s.length]."]
+ #[doc = "Requires s initialized, split <= s.length"]
+ pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice;
+}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_slice_ref_whom {
+ GRPC_SLICE_REF_TAIL = 1,
+ GRPC_SLICE_REF_HEAD = 2,
+ GRPC_SLICE_REF_BOTH = 3,
+}
+extern "C" {
+ #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering"]
+ #[doc = " refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to"]
+ #[doc = " grpc_slice_split_tail(...))"]
+ pub fn grpc_slice_split_tail_maybe_ref(
+ s: *mut grpc_slice,
+ split: usize,
+ ref_whom: grpc_slice_ref_whom,
+ ) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new"]
+ #[doc = "slice, sharing a refcount with s, that contains s[0:split]."]
+ #[doc = "Requires s initialized, split <= s.length"]
+ pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice;
+}
+extern "C" {
+ pub fn grpc_empty_slice() -> grpc_slice;
+}
+extern "C" {
+ pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b"]
+ #[doc = "The order is arbitrary, and is not guaranteed to be stable across different"]
+ #[doc = "versions of the API."]
+ pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn grpc_slice_str_cmp(
+ a: grpc_slice,
+ b: *const ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " return non-zero if the first blen bytes of a are equal to b"]
+ pub fn grpc_slice_buf_start_eq(
+ a: grpc_slice,
+ b: *const ::std::os::raw::c_void,
+ blen: usize,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " return the index of the last instance of \\a c in \\a s, or -1 if not found"]
+ pub fn grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1"]
+ #[doc = "if it's not found"]
+ pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Do two slices point at the same memory, with the same length"]
+ #[doc = "If a or b is inlined, actually compares data"]
+ pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Return a slice pointing to newly allocated memory that has the same contents"]
+ #[doc = " as \\a s"]
+ pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Return a copy of slice as a C string. Offers no protection against embedded"]
+ #[doc = "NULL's. Returned string must be freed with gpr_free."]
+ pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Return if an algorithm is message compression algorithm."]
+ pub fn grpc_compression_algorithm_is_message(
+ algorithm: grpc_compression_algorithm,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Return if an algorithm is stream compression algorithm."]
+ pub fn grpc_compression_algorithm_is_stream(
+ algorithm: grpc_compression_algorithm,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a"]
+ #[doc = " algorithm. Returns 1 upon success, 0 otherwise."]
+ pub fn grpc_compression_algorithm_parse(
+ name: grpc_slice,
+ algorithm: *mut grpc_compression_algorithm,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a"]
+ #[doc = " algorithm. Note that \\a name is statically allocated and must *not* be freed."]
+ #[doc = " Returns 1 upon success, 0 otherwise."]
+ pub fn grpc_compression_algorithm_name(
+ algorithm: grpc_compression_algorithm,
+ name: *mut *const ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Returns the compression algorithm corresponding to \\a level for the"]
+ #[doc = " compression algorithms encoded in the \\a accepted_encodings bitset."]
+ pub fn grpc_compression_algorithm_for_level(
+ level: grpc_compression_level,
+ accepted_encodings: u32,
+ ) -> grpc_compression_algorithm;
+}
+extern "C" {
+ pub fn grpc_compression_options_init(opts: *mut grpc_compression_options);
+}
+extern "C" {
+ #[doc = " Mark \\a algorithm as enabled in \\a opts."]
+ pub fn grpc_compression_options_enable_algorithm(
+ opts: *mut grpc_compression_options,
+ algorithm: grpc_compression_algorithm,
+ );
+}
+extern "C" {
+ #[doc = " Mark \\a algorithm as disabled in \\a opts."]
+ pub fn grpc_compression_options_disable_algorithm(
+ opts: *mut grpc_compression_options,
+ algorithm: grpc_compression_algorithm,
+ );
+}
+extern "C" {
+ #[doc = " Returns true if \\a algorithm is marked as enabled in \\a opts."]
+ pub fn grpc_compression_options_is_algorithm_enabled(
+ opts: *const grpc_compression_options,
+ algorithm: grpc_compression_algorithm,
+ ) -> ::std::os::raw::c_int;
+}
+pub mod grpc_status_code {
+ pub type Type = ::std::os::raw::c_int;
+ #[doc = " Not an error; returned on success"]
+ pub const GRPC_STATUS_OK: Type = 0;
+ #[doc = " The operation was cancelled (typically by the caller)."]
+ pub const GRPC_STATUS_CANCELLED: Type = 1;
+ #[doc = " Unknown error. An example of where this error may be returned is"]
+ #[doc = "if a Status value received from another address space belongs to"]
+ #[doc = "an error-space that is not known in this address space. Also"]
+ #[doc = "errors raised by APIs that do not return enough error information"]
+ #[doc = "may be converted to this error."]
+ pub const GRPC_STATUS_UNKNOWN: Type = 2;
+ #[doc = " Client specified an invalid argument. Note that this differs"]
+ #[doc = "from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments"]
+ #[doc = "that are problematic regardless of the state of the system"]
+ #[doc = "(e.g., a malformed file name)."]
+ pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3;
+ #[doc = " Deadline expired before operation could complete. For operations"]
+ #[doc = "that change the state of the system, this error may be returned"]
+ #[doc = "even if the operation has completed successfully. For example, a"]
+ #[doc = "successful response from a server could have been delayed long"]
+ #[doc = "enough for the deadline to expire."]
+ pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4;
+ #[doc = " Some requested entity (e.g., file or directory) was not found."]
+ pub const GRPC_STATUS_NOT_FOUND: Type = 5;
+ #[doc = " Some entity that we attempted to create (e.g., file or directory)"]
+ #[doc = "already exists."]
+ pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6;
+ #[doc = " The caller does not have permission to execute the specified"]
+ #[doc = "operation. PERMISSION_DENIED must not be used for rejections"]
+ #[doc = "caused by exhausting some resource (use RESOURCE_EXHAUSTED"]
+ #[doc = "instead for those errors). PERMISSION_DENIED must not be"]
+ #[doc = "used if the caller can not be identified (use UNAUTHENTICATED"]
+ #[doc = "instead for those errors)."]
+ pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7;
+ #[doc = " The request does not have valid authentication credentials for the"]
+ #[doc = "operation."]
+ pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16;
+ #[doc = " Some resource has been exhausted, perhaps a per-user quota, or"]
+ #[doc = "perhaps the entire file system is out of space."]
+ pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8;
+ #[doc = " Operation was rejected because the system is not in a state"]
+ #[doc = "required for the operation's execution. For example, directory"]
+ #[doc = "to be deleted may be non-empty, an rmdir operation is applied to"]
+ #[doc = "a non-directory, etc."]
+ #[doc = ""]
+ #[doc = "A litmus test that may help a service implementor in deciding"]
+ #[doc = "between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:"]
+ #[doc = "(a) Use UNAVAILABLE if the client can retry just the failing call."]
+ #[doc = "(b) Use ABORTED if the client should retry at a higher-level"]
+ #[doc = "(e.g., restarting a read-modify-write sequence)."]
+ #[doc = "(c) Use FAILED_PRECONDITION if the client should not retry until"]
+ #[doc = "the system state has been explicitly fixed. E.g., if an \"rmdir\""]
+ #[doc = "fails because the directory is non-empty, FAILED_PRECONDITION"]
+ #[doc = "should be returned since the client should not retry unless"]
+ #[doc = "they have first fixed up the directory by deleting files from it."]
+ #[doc = "(d) Use FAILED_PRECONDITION if the client performs conditional"]
+ #[doc = "REST Get/Update/Delete on a resource and the resource on the"]
+ #[doc = "server does not match the condition. E.g., conflicting"]
+ #[doc = "read-modify-write on the same resource."]
+ pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9;
+ #[doc = " The operation was aborted, typically due to a concurrency issue"]
+ #[doc = "like sequencer check failures, transaction aborts, etc."]
+ #[doc = ""]
+ #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
+ #[doc = "ABORTED, and UNAVAILABLE."]
+ pub const GRPC_STATUS_ABORTED: Type = 10;
+ #[doc = " Operation was attempted past the valid range. E.g., seeking or"]
+ #[doc = "reading past end of file."]
+ #[doc = ""]
+ #[doc = "Unlike INVALID_ARGUMENT, this error indicates a problem that may"]
+ #[doc = "be fixed if the system state changes. For example, a 32-bit file"]
+ #[doc = "system will generate INVALID_ARGUMENT if asked to read at an"]
+ #[doc = "offset that is not in the range [0,2^32-1], but it will generate"]
+ #[doc = "OUT_OF_RANGE if asked to read from an offset past the current"]
+ #[doc = "file size."]
+ #[doc = ""]
+ #[doc = "There is a fair bit of overlap between FAILED_PRECONDITION and"]
+ #[doc = "OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific"]
+ #[doc = "error) when it applies so that callers who are iterating through"]
+ #[doc = "a space can easily look for an OUT_OF_RANGE error to detect when"]
+ #[doc = "they are done."]
+ pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11;
+ #[doc = " Operation is not implemented or not supported/enabled in this service."]
+ pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12;
+ #[doc = " Internal errors. Means some invariants expected by underlying"]
+ #[doc = "system has been broken. If you see one of these errors,"]
+ #[doc = "something is very broken."]
+ pub const GRPC_STATUS_INTERNAL: Type = 13;
+ #[doc = " The service is currently unavailable. This is a most likely a"]
+ #[doc = "transient condition and may be corrected by retrying with"]
+ #[doc = "a backoff. Note that it is not always safe to retry non-idempotent"]
+ #[doc = "operations."]
+ #[doc = ""]
+ #[doc = "WARNING: Although data MIGHT not have been transmitted when this"]
+ #[doc = "status occurs, there is NOT A GUARANTEE that the server has not seen"]
+ #[doc = "anything. So in general it is unsafe to retry on this status code"]
+ #[doc = "if the call is non-idempotent."]
+ #[doc = ""]
+ #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
+ #[doc = "ABORTED, and UNAVAILABLE."]
+ pub const GRPC_STATUS_UNAVAILABLE: Type = 14;
+ #[doc = " Unrecoverable data loss or corruption."]
+ pub const GRPC_STATUS_DATA_LOSS: Type = 15;
+ #[doc = " Force users to include a default branch:"]
+ pub const GRPC_STATUS__DO_NOT_USE: Type = -1;
+}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_byte_buffer_type {
+ GRPC_BB_RAW = 0,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_byte_buffer {
+ pub reserved: *mut ::std::os::raw::c_void,
+ pub type_: grpc_byte_buffer_type,
+ pub data: grpc_byte_buffer_grpc_byte_buffer_data,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union grpc_byte_buffer_grpc_byte_buffer_data {
+ pub reserved: grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1,
+ pub raw: grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 {
+ pub reserved: [*mut ::std::os::raw::c_void; 8usize],
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
+ pub compression: grpc_compression_algorithm,
+ pub slice_buffer: grpc_slice_buffer,
+}
+impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer)
+ }
+}
+impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}")
+ }
+}
+impl ::std::fmt::Debug for grpc_byte_buffer {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}",
+ self.reserved, self.type_, self.data
+ )
+ }
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_completion_queue {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_channel {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_server {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_call {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_socket_mutator {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_socket_factory {
+ _unused: [u8; 0],
+}
+#[repr(u32)]
+#[doc = " Type specifier for grpc_arg"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_arg_type {
+ GRPC_ARG_STRING = 0,
+ GRPC_ARG_INTEGER = 1,
+ GRPC_ARG_POINTER = 2,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_arg_pointer_vtable {
+ pub copy: ::std::option::Option<
+ unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
+ >,
+ pub destroy: ::std::option::Option<unsafe extern "C" fn(p: *mut ::std::os::raw::c_void)>,
+ pub cmp: ::std::option::Option<
+ unsafe extern "C" fn(
+ p: *mut ::std::os::raw::c_void,
+ q: *mut ::std::os::raw::c_void,
+ ) -> ::std::os::raw::c_int,
+ >,
+}
+#[doc = " A single argument... each argument has a key and a value"]
+#[doc = ""]
+#[doc = "A note on naming keys:"]
+#[doc = "Keys are namespaced into groups, usually grouped by library, and are"]
+#[doc = "keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must"]
+#[doc = "be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}."]
+#[doc = "Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}."]
+#[doc = ""]
+#[doc = "GRPC core library keys are prefixed by grpc."]
+#[doc = ""]
+#[doc = "Library authors are strongly encouraged to \\#define symbolic constants for"]
+#[doc = "their keys so that it's possible to change them in the future."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_arg {
+ pub type_: grpc_arg_type,
+ pub key: *mut ::std::os::raw::c_char,
+ pub value: grpc_arg_grpc_arg_value,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union grpc_arg_grpc_arg_value {
+ pub string: *mut ::std::os::raw::c_char,
+ pub integer: ::std::os::raw::c_int,
+ pub pointer: grpc_arg_grpc_arg_value_grpc_arg_pointer,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer {
+ pub p: *mut ::std::os::raw::c_void,
+ pub vtable: *const grpc_arg_pointer_vtable,
+}
+impl ::std::fmt::Debug for grpc_arg_grpc_arg_value {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(f, "grpc_arg_grpc_arg_value {{ union }}")
+ }
+}
+impl ::std::fmt::Debug for grpc_arg {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}",
+ self.type_, self.key, self.value
+ )
+ }
+}
+#[doc = " An array of arguments that can be passed around."]
+#[doc = ""]
+#[doc = "Used to set optional channel-level configuration."]
+#[doc = "These configuration options are modelled as key-value pairs as defined"]
+#[doc = "by grpc_arg; keys are strings to allow easy backwards-compatible extension"]
+#[doc = "by arbitrary parties. All evaluation is performed at channel creation"]
+#[doc = "time (i.e. the keys and values in this structure need only live through the"]
+#[doc = "creation invocation)."]
+#[doc = ""]
+#[doc = "However, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the"]
+#[doc = "grpc_arg_pointer_vtable must live until the channel args are done being"]
+#[doc = "used by core (i.e. when the object for use with which they were passed"]
+#[doc = "is destroyed)."]
+#[doc = ""]
+#[doc = "See the description of the \\ref grpc_arg_keys \"available args\" for more"]
+#[doc = "details."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_channel_args {
+ pub num_args: usize,
+ pub args: *mut grpc_arg,
+}
+#[repr(u32)]
+#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a"]
+#[doc = "particular operation, the grpc_call_error returned will be GRPC_CALL_OK."]
+#[doc = "Receiving any other value listed here is an indication of a bug in the"]
+#[doc = "caller."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_call_error {
+ #[doc = " everything went ok"]
+ GRPC_CALL_OK = 0,
+ #[doc = " something failed, we don't know what"]
+ GRPC_CALL_ERROR = 1,
+ #[doc = " this method is not available on the server"]
+ GRPC_CALL_ERROR_NOT_ON_SERVER = 2,
+ #[doc = " this method is not available on the client"]
+ GRPC_CALL_ERROR_NOT_ON_CLIENT = 3,
+ #[doc = " this method must be called before server_accept"]
+ GRPC_CALL_ERROR_ALREADY_ACCEPTED = 4,
+ #[doc = " this method must be called before invoke"]
+ GRPC_CALL_ERROR_ALREADY_INVOKED = 5,
+ #[doc = " this method must be called after invoke"]
+ GRPC_CALL_ERROR_NOT_INVOKED = 6,
+ #[doc = " this call is already finished"]
+ #[doc = "(writes_done or write_status has already been called)"]
+ GRPC_CALL_ERROR_ALREADY_FINISHED = 7,
+ #[doc = " there is already an outstanding read/write operation on the call"]
+ GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8,
+ #[doc = " the flags value was illegal for this call"]
+ GRPC_CALL_ERROR_INVALID_FLAGS = 9,
+ #[doc = " invalid metadata was passed to this call"]
+ GRPC_CALL_ERROR_INVALID_METADATA = 10,
+ #[doc = " invalid message was passed to this call"]
+ GRPC_CALL_ERROR_INVALID_MESSAGE = 11,
+ #[doc = " completion queue for notification has not been registered"]
+ #[doc = " with the server"]
+ GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12,
+ #[doc = " this batch of operations leads to more operations than allowed"]
+ GRPC_CALL_ERROR_BATCH_TOO_BIG = 13,
+ #[doc = " payload type requested is not the type registered"]
+ GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH = 14,
+ #[doc = " completion queue has been shutdown"]
+ GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN = 15,
+}
+#[doc = " A single metadata element"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_metadata {
+ #[doc = " the key, value values are expected to line up with grpc_mdelem: if"]
+ #[doc = "changing them, update metadata.h at the same time."]
+ pub key: grpc_slice,
+ pub value: grpc_slice,
+ pub internal_data: grpc_metadata__bindgen_ty_1,
+}
+#[doc = " The following fields are reserved for grpc internal use."]
+#[doc = "There is no need to initialize them, and they will be set to garbage"]
+#[doc = "during calls to grpc."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_metadata__bindgen_ty_1 {
+ pub obfuscated: [*mut ::std::os::raw::c_void; 4usize],
+}
+impl ::std::fmt::Debug for grpc_metadata {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_metadata {{ key: {:?}, value: {:?}, internal_data: {:?} }}",
+ self.key, self.value, self.internal_data
+ )
+ }
+}
+#[repr(u32)]
+#[doc = " The type of completion (for grpc_event)"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_completion_type {
+ #[doc = " Shutting down"]
+ GRPC_QUEUE_SHUTDOWN = 0,
+ #[doc = " No event before timeout"]
+ GRPC_QUEUE_TIMEOUT = 1,
+ #[doc = " Operation completion"]
+ GRPC_OP_COMPLETE = 2,
+}
+#[doc = " The result of an operation."]
+#[doc = ""]
+#[doc = "Returned by a completion queue when the operation started with tag."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_event {
+ #[doc = " The type of the completion."]
+ pub type_: grpc_completion_type,
+ #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates"]
+ #[doc = "whether the operation was successful or not; 0 in case of failure and"]
+ #[doc = "non-zero in case of success."]
+ #[doc = "If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this"]
+ #[doc = "field is guaranteed to be 0"]
+ pub success: ::std::os::raw::c_int,
+ #[doc = " The tag passed to grpc_call_start_batch etc to start this operation."]
+ #[doc = "Only* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type"]
+ #[doc = "values, tag is uninitialized."]
+ pub tag: *mut ::std::os::raw::c_void,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_metadata_array {
+ pub count: usize,
+ pub capacity: usize,
+ pub metadata: *mut grpc_metadata,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_call_details {
+ pub method: grpc_slice,
+ pub host: grpc_slice,
+ pub deadline: gpr_timespec,
+ pub flags: u32,
+ pub reserved: *mut ::std::os::raw::c_void,
+}
+impl ::std::fmt::Debug for grpc_call_details {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, reserved: {:?} }}",
+ self.method, self.host, self.deadline, self.reserved
+ )
+ }
+}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_op_type {
+ #[doc = " Send initial metadata: one and only one instance MUST be sent for each"]
+ #[doc = "call, unless the call was cancelled - in which case this can be skipped."]
+ #[doc = "This op completes after all bytes of metadata have been accepted by"]
+ #[doc = "outgoing flow control."]
+ GRPC_OP_SEND_INITIAL_METADATA = 0,
+ #[doc = " Send a message: 0 or more of these operations can occur for each call."]
+ #[doc = "This op completes after all bytes for the message have been accepted by"]
+ #[doc = "outgoing flow control."]
+ GRPC_OP_SEND_MESSAGE = 1,
+ #[doc = " Send a close from the client: one and only one instance MUST be sent from"]
+ #[doc = "the client, unless the call was cancelled - in which case this can be"]
+ #[doc = "skipped. This op completes after all bytes for the call"]
+ #[doc = "(including the close) have passed outgoing flow control."]
+ GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2,
+ #[doc = " Send status from the server: one and only one instance MUST be sent from"]
+ #[doc = "the server unless the call was cancelled - in which case this can be"]
+ #[doc = "skipped. This op completes after all bytes for the call"]
+ #[doc = "(including the status) have passed outgoing flow control."]
+ GRPC_OP_SEND_STATUS_FROM_SERVER = 3,
+ #[doc = " Receive initial metadata: one and only one MUST be made on the client,"]
+ #[doc = "must not be made on the server."]
+ #[doc = "This op completes after all initial metadata has been read from the"]
+ #[doc = "peer."]
+ GRPC_OP_RECV_INITIAL_METADATA = 4,
+ #[doc = " Receive a message: 0 or more of these operations can occur for each call."]
+ #[doc = "This op completes after all bytes of the received message have been"]
+ #[doc = "read, or after a half-close has been received on this call."]
+ GRPC_OP_RECV_MESSAGE = 5,
+ #[doc = " Receive status on the client: one and only one must be made on the client."]
+ #[doc = "This operation always succeeds, meaning ops paired with this operation"]
+ #[doc = "will also appear to succeed, even though they may not have. In that case"]
+ #[doc = "the status will indicate some failure."]
+ #[doc = "This op completes after all activity on the call has completed."]
+ GRPC_OP_RECV_STATUS_ON_CLIENT = 6,
+ #[doc = " Receive close on the server: one and only one must be made on the"]
+ #[doc = "server. This op completes after the close has been received by the"]
+ #[doc = "server. This operation always succeeds, meaning ops paired with"]
+ #[doc = "this operation will also appear to succeed, even though they may not"]
+ #[doc = "have."]
+ GRPC_OP_RECV_CLOSE_ON_SERVER = 7,
+}
+#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT"]
+#[doc = "which has no arguments)"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_op {
+ #[doc = " Operation type, as defined by grpc_op_type"]
+ pub op: grpc_op_type,
+ #[doc = " Write flags bitset for grpc_begin_messages"]
+ pub flags: u32,
+ #[doc = " Reserved for future usage"]
+ pub reserved: *mut ::std::os::raw::c_void,
+ pub data: grpc_op_grpc_op_data,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union grpc_op_grpc_op_data {
+ pub reserved: grpc_op_grpc_op_data__bindgen_ty_1,
+ pub send_initial_metadata: grpc_op_grpc_op_data_grpc_op_send_initial_metadata,
+ pub send_message: grpc_op_grpc_op_data_grpc_op_send_message,
+ pub send_status_from_server: grpc_op_grpc_op_data_grpc_op_send_status_from_server,
+ pub recv_initial_metadata: grpc_op_grpc_op_data_grpc_op_recv_initial_metadata,
+ pub recv_message: grpc_op_grpc_op_data_grpc_op_recv_message,
+ pub recv_status_on_client: grpc_op_grpc_op_data_grpc_op_recv_status_on_client,
+ pub recv_close_on_server: grpc_op_grpc_op_data_grpc_op_recv_close_on_server,
+}
+#[doc = " Reserved for future usage"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data__bindgen_ty_1 {
+ pub reserved: [*mut ::std::os::raw::c_void; 8usize],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata { pub count : usize , pub metadata : * mut grpc_metadata , pub maybe_compression_level : grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level , }
+#[doc = " If \\a is_set, \\a compression_level will be used for the call."]
+#[doc = " Otherwise, \\a compression_level won't be considered"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level
+{
+ pub is_set: u8,
+ pub level: grpc_compression_level,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_send_message {
+ #[doc = " This op takes ownership of the slices in send_message. After"]
+ #[doc = " a call completes, the contents of send_message are not guaranteed"]
+ #[doc = " and likely empty. The original owner should still call"]
+ #[doc = " grpc_byte_buffer_destroy() on this object however."]
+ pub send_message: *mut grpc_byte_buffer,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server {
+ pub trailing_metadata_count: usize,
+ pub trailing_metadata: *mut grpc_metadata,
+ pub status: grpc_status_code::Type,
+ #[doc = " optional: set to NULL if no details need sending, non-NULL if they do"]
+ #[doc = " pointer will not be retained past the start_batch call"]
+ pub status_details: *mut grpc_slice,
+}
+#[doc = " ownership of the array is with the caller, but ownership of the elements"]
+#[doc = "stays with the call object (ie key, value members are owned by the call"]
+#[doc = "object, recv_initial_metadata->array is owned by the caller)."]
+#[doc = "After the operation completes, call grpc_metadata_array_destroy on this"]
+#[doc = "value, or reuse it in a future op."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata {
+ pub recv_initial_metadata: *mut grpc_metadata_array,
+}
+#[doc = " ownership of the byte buffer is moved to the caller; the caller must"]
+#[doc = "call grpc_byte_buffer_destroy on this value, or reuse it in a future op."]
+#[doc = "The returned byte buffer will be NULL if trailing metadata was"]
+#[doc = "received instead of a message."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_recv_message {
+ pub recv_message: *mut *mut grpc_byte_buffer,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client {
+ #[doc = " ownership of the array is with the caller, but ownership of the"]
+ #[doc = "elements stays with the call object (ie key, value members are owned"]
+ #[doc = "by the call object, trailing_metadata->array is owned by the caller)."]
+ #[doc = "After the operation completes, call grpc_metadata_array_destroy on"]
+ #[doc = "this value, or reuse it in a future op."]
+ pub trailing_metadata: *mut grpc_metadata_array,
+ pub status: *mut grpc_status_code::Type,
+ pub status_details: *mut grpc_slice,
+ #[doc = " If this is not nullptr, it will be populated with the full fidelity"]
+ #[doc = " error string for debugging purposes. The application is responsible"]
+ #[doc = " for freeing the data by using gpr_free()."]
+ pub error_string: *mut *const ::std::os::raw::c_char,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server {
+ #[doc = " out argument, set to 1 if the call failed at the server for"]
+ #[doc = "a reason other than a non-OK status (cancel, deadline"]
+ #[doc = "exceeded, network failure, etc.), 0 otherwise (RPC processing ran to"]
+ #[doc = "completion and was able to provide any status from the server)"]
+ pub cancelled: *mut ::std::os::raw::c_int,
+}
+impl ::std::fmt::Debug for grpc_op_grpc_op_data {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(f, "grpc_op_grpc_op_data {{ union }}")
+ }
+}
+impl ::std::fmt::Debug for grpc_op {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_op {{ op: {:?}, reserved: {:?}, data: {:?} }}",
+ self.op, self.reserved, self.data
+ )
+ }
+}
+#[doc = " Information requested from the channel."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_channel_info {
+ #[doc = " If non-NULL, will be set to point to a string indicating the LB"]
+ #[doc = " policy name. Caller takes ownership."]
+ pub lb_policy_name: *mut *mut ::std::os::raw::c_char,
+ #[doc = " If non-NULL, will be set to point to a string containing the"]
+ #[doc = " service config used by the channel in JSON form."]
+ pub service_config_json: *mut *mut ::std::os::raw::c_char,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_resource_quota {
+ _unused: [u8; 0],
+}
+#[repr(u32)]
+#[doc = " Completion queues internally MAY maintain a set of file descriptors in a"]
+#[doc = "structure called 'pollset'. This enum specifies if a completion queue has an"]
+#[doc = "associated pollset and any restrictions on the type of file descriptors that"]
+#[doc = "can be present in the pollset."]
+#[doc = ""]
+#[doc = "I/O progress can only be made when grpc_completion_queue_next() or"]
+#[doc = "grpc_completion_queue_pluck() are called on the completion queue (unless the"]
+#[doc = "grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important"]
+#[doc = "to actively call these APIs"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_cq_polling_type {
+ #[doc = " The completion queue will have an associated pollset and there is no"]
+ #[doc = "restriction on the type of file descriptors the pollset may contain"]
+ GRPC_CQ_DEFAULT_POLLING = 0,
+ #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will"]
+ #[doc = "not contain any 'listening file descriptors' (i.e file descriptors used to"]
+ #[doc = "listen to incoming channels)"]
+ GRPC_CQ_NON_LISTENING = 1,
+ #[doc = " The completion queue will not have an associated pollset. Note that"]
+ #[doc = "grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still"]
+ #[doc = "be called to pop events from the completion queue; it is not required to"]
+ #[doc = "call them actively to make I/O progress"]
+ GRPC_CQ_NON_POLLING = 2,
+}
+#[repr(u32)]
+#[doc = " Specifies the type of APIs to use to pop events from the completion queue"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_cq_completion_type {
+ #[doc = " Events are popped out by calling grpc_completion_queue_next() API ONLY"]
+ GRPC_CQ_NEXT = 0,
+ #[doc = " Events are popped out by calling grpc_completion_queue_pluck() API ONLY"]
+ GRPC_CQ_PLUCK = 1,
+ #[doc = " Events trigger a callback specified as the tag"]
+ GRPC_CQ_CALLBACK = 2,
+}
+#[doc = " Specifies an interface class to be used as a tag for callback-based"]
+#[doc = " completion queues. This can be used directly, as the first element of a"]
+#[doc = " struct in C, or as a base class in C++. Its \"run\" value should be assigned to"]
+#[doc = " some non-member function, such as a static method."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_completion_queue_functor {
+ #[doc = " The run member specifies a function that will be called when this"]
+ #[doc = "tag is extracted from the completion queue. Its arguments will be a"]
+ #[doc = "pointer to this functor and a boolean that indicates whether the"]
+ #[doc = "operation succeeded (non-zero) or failed (zero)"]
+ pub functor_run: ::std::option::Option<
+ unsafe extern "C" fn(arg1: *mut grpc_completion_queue_functor, arg2: ::std::os::raw::c_int),
+ >,
+ #[doc = " The inlineable member specifies whether this functor can be run inline."]
+ #[doc = "This should only be used for trivial internally-defined functors."]
+ pub inlineable: ::std::os::raw::c_int,
+ #[doc = " The following fields are not API. They are meant for internal use."]
+ pub internal_success: ::std::os::raw::c_int,
+ pub internal_next: *mut grpc_completion_queue_functor,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_completion_queue_attributes {
+ #[doc = " The version number of this structure. More fields might be added to this"]
+ #[doc = "structure in future."]
+ pub version: ::std::os::raw::c_int,
+ #[doc = " Set to GRPC_CQ_CURRENT_VERSION"]
+ pub cq_completion_type: grpc_cq_completion_type,
+ pub cq_polling_type: grpc_cq_polling_type,
+ #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when"]
+ #[doc = " shutdown is complete"]
+ pub cq_shutdown_cb: *mut grpc_completion_queue_functor,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_completion_queue_factory {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices)."]
+ #[doc = ""]
+ #[doc = " Increases the reference count for all \\a slices processed. The user is"]
+ #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
+ pub fn grpc_raw_byte_buffer_create(
+ slices: *mut grpc_slice,
+ nslices: usize,
+ ) -> *mut grpc_byte_buffer;
+}
+extern "C" {
+ #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to"]
+ #[doc = " \\a nslices). The \\a compression argument defines the compression algorithm"]
+ #[doc = " used to generate the data in \\a slices."]
+ #[doc = ""]
+ #[doc = " Increases the reference count for all \\a slices processed. The user is"]
+ #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
+ pub fn grpc_raw_compressed_byte_buffer_create(
+ slices: *mut grpc_slice,
+ nslices: usize,
+ compression: grpc_compression_algorithm,
+ ) -> *mut grpc_byte_buffer;
+}
+extern "C" {
+ #[doc = " Copies input byte buffer \\a bb."]
+ #[doc = ""]
+ #[doc = " Increases the reference count of all the source slices. The user is"]
+ #[doc = " responsible for calling grpc_byte_buffer_destroy over the returned copy."]
+ pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer;
+}
+extern "C" {
+ #[doc = " Returns the size of the given byte buffer, in bytes."]
+ pub fn grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize;
+}
+extern "C" {
+ #[doc = " Destroys \\a byte_buffer deallocating all its memory."]
+ pub fn grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer);
+}
+extern "C" {
+ #[doc = " Initialize \\a reader to read over \\a buffer."]
+ #[doc = " Returns 1 upon success, 0 otherwise."]
+ pub fn grpc_byte_buffer_reader_init(
+ reader: *mut grpc_byte_buffer_reader,
+ buffer: *mut grpc_byte_buffer,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Cleanup and destroy \\a reader"]
+ pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader);
+}
+extern "C" {
+ #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
+ #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for calling"]
+ #[doc = " grpc_slice_unref on the result."]
+ pub fn grpc_byte_buffer_reader_next(
+ reader: *mut grpc_byte_buffer_reader,
+ slice: *mut grpc_slice,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future."]
+ #[doc = ""]
+ #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
+ #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for making sure"]
+ #[doc = " the slice pointer remains valid when accessed."]
+ #[doc = ""]
+ #[doc = " NOTE: Do not use this function unless the caller can guarantee that the"]
+ #[doc = " underlying grpc_byte_buffer outlasts the use of the slice. This is only"]
+ #[doc = " safe when the underlying grpc_byte_buffer remains immutable while slice"]
+ #[doc = " is being accessed."]
+ pub fn grpc_byte_buffer_reader_peek(
+ reader: *mut grpc_byte_buffer_reader,
+ slice: *mut *mut grpc_slice,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Merge all data from \\a reader into single slice"]
+ pub fn grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Returns a RAW byte buffer instance from the output of \\a reader."]
+ pub fn grpc_raw_byte_buffer_from_reader(
+ reader: *mut grpc_byte_buffer_reader,
+ ) -> *mut grpc_byte_buffer;
+}
+extern "C" {
+ #[doc = " initialize a slice buffer"]
+ pub fn grpc_slice_buffer_init(sb: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " destroy a slice buffer - unrefs any held elements"]
+ pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " Add an element to a slice buffer - takes ownership of the slice."]
+ #[doc = "This function is allowed to concatenate the passed in slice to the end of"]
+ #[doc = "some other slice if desired by the slice buffer."]
+ pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice);
+}
+extern "C" {
+ #[doc = " add an element to a slice buffer - takes ownership of the slice and returns"]
+ #[doc = "the index of the slice."]
+ #[doc = "Guarantees that the slice will not be concatenated at the end of another"]
+ #[doc = "slice (i.e. the data for this slice will begin at the first byte of the"]
+ #[doc = "slice at the returned index in sb->slices)"]
+ #[doc = "The implementation MAY decide to concatenate data at the end of a small"]
+ #[doc = "slice added in this fashion."]
+ pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize;
+}
+extern "C" {
+ pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize);
+}
+extern "C" {
+ #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice"]
+ #[doc = "buffer: returns a pointer into which to add the data"]
+ pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8;
+}
+extern "C" {
+ #[doc = " pop the last buffer, but don't unref it"]
+ pub fn grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " clear a slice buffer, unref all elements"]
+ pub fn grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " swap the contents of two slice buffers"]
+ pub fn grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " move all of the elements of src into dst"]
+ pub fn grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer);
+}
+extern "C" {
+ #[doc = " remove n bytes from the end of a slice buffer"]
+ pub fn grpc_slice_buffer_trim_end(
+ sb: *mut grpc_slice_buffer,
+ n: usize,
+ garbage: *mut grpc_slice_buffer,
+ );
+}
+extern "C" {
+ #[doc = " move the first n bytes of src into dst"]
+ pub fn grpc_slice_buffer_move_first(
+ src: *mut grpc_slice_buffer,
+ n: usize,
+ dst: *mut grpc_slice_buffer,
+ );
+}
+extern "C" {
+ #[doc = " move the first n bytes of src into dst without adding references"]
+ pub fn grpc_slice_buffer_move_first_no_ref(
+ src: *mut grpc_slice_buffer,
+ n: usize,
+ dst: *mut grpc_slice_buffer,
+ );
+}
+extern "C" {
+ #[doc = " move the first n bytes of src into dst (copying them)"]
+ pub fn grpc_slice_buffer_move_first_into_buffer(
+ src: *mut grpc_slice_buffer,
+ n: usize,
+ dst: *mut ::std::os::raw::c_void,
+ );
+}
+extern "C" {
+ #[doc = " take the first slice in the slice buffer"]
+ pub fn grpc_slice_buffer_take_first(sb: *mut grpc_slice_buffer) -> grpc_slice;
+}
+extern "C" {
+ #[doc = " undo the above with (a possibly different) \\a slice"]
+ pub fn grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice);
+}
+#[repr(u32)]
+#[doc = " Connectivity state of a channel."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_connectivity_state {
+ #[doc = " channel is idle"]
+ GRPC_CHANNEL_IDLE = 0,
+ #[doc = " channel is connecting"]
+ GRPC_CHANNEL_CONNECTING = 1,
+ #[doc = " channel is ready for work"]
+ GRPC_CHANNEL_READY = 2,
+ #[doc = " channel has seen a failure but expects to recover"]
+ GRPC_CHANNEL_TRANSIENT_FAILURE = 3,
+ #[doc = " channel has seen a failure that it cannot recover from"]
+ GRPC_CHANNEL_SHUTDOWN = 4,
+}
+extern "C" {
+ #[doc = " Time constants."]
+ pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " The zero time interval."]
+ pub fn gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " The far future"]
+ pub fn gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " initialize time subsystem"]
+ pub fn gpr_time_init();
+}
+extern "C" {
+ #[doc = " Return the current time measured from the given clocks epoch."]
+ pub fn gpr_now(clock: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " Convert a timespec from one clock to another"]
+ pub fn gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b"]
+ #[doc = "respectively."]
+ pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " Add and subtract times. Calculations saturate at infinities."]
+ pub fn gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " Return a timespec representing a given number of time units. INT64_MIN is"]
+ #[doc = "interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."]
+ pub fn gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_from_nanos(ns: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_from_millis(ms: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_from_seconds(s: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_from_minutes(m: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_from_hours(h: i64, clock_type: gpr_clock_type) -> gpr_timespec;
+}
+extern "C" {
+ pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32;
+}
+extern "C" {
+ #[doc = " Return 1 if two times are equal or within threshold of each other,"]
+ #[doc = "0 otherwise"]
+ pub fn gpr_time_similar(
+ a: gpr_timespec,
+ b: gpr_timespec,
+ threshold: gpr_timespec,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Sleep until at least 'until' - an absolute timeout"]
+ pub fn gpr_sleep_until(until: gpr_timespec);
+}
+extern "C" {
+ pub fn gpr_timespec_to_micros(t: gpr_timespec) -> f64;
+}
+extern "C" {
+ #[doc = " \\mainpage GRPC Core"]
+ #[doc = ""]
+ #[doc = " The GRPC Core library is a low-level library designed to be wrapped by higher"]
+ #[doc = " level libraries. The top-level API is provided in grpc.h. Security related"]
+ #[doc = " functionality lives in grpc_security.h."]
+ pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpc_metadata_array_destroy(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpc_call_details_init(details: *mut grpc_call_details);
+}
+extern "C" {
+ pub fn grpc_call_details_destroy(details: *mut grpc_call_details);
+}
+extern "C" {
+ #[doc = " Registers a plugin to be initialized and destroyed with the library."]
+ #[doc = ""]
+ #[doc = "The \\a init and \\a destroy functions will be invoked as part of"]
+ #[doc = "\\a grpc_init() and \\a grpc_shutdown(), respectively."]
+ #[doc = "Note that these functions can be invoked an arbitrary number of times"]
+ #[doc = "(and hence so will \\a init and \\a destroy)."]
+ #[doc = "It is safe to pass NULL to either argument. Plugins are destroyed in"]
+ #[doc = "the reverse order they were initialized."]
+ pub fn grpc_register_plugin(
+ init: ::std::option::Option<unsafe extern "C" fn()>,
+ destroy: ::std::option::Option<unsafe extern "C" fn()>,
+ );
+}
+extern "C" {
+ #[doc = " Initialize the grpc library."]
+ #[doc = ""]
+ #[doc = "After it's called, a matching invocation to grpc_shutdown() is expected."]
+ #[doc = ""]
+ #[doc = "It is not safe to call any other grpc functions before calling this."]
+ #[doc = "(To avoid overhead, little checking is done, and some things may work. We"]
+ #[doc = "do not warrant that they will continue to do so in future revisions of this"]
+ #[doc = "library)."]
+ pub fn grpc_init();
+}
+extern "C" {
+ #[doc = " Shut down the grpc library."]
+ #[doc = ""]
+ #[doc = "Before it's called, there should haven been a matching invocation to"]
+ #[doc = "grpc_init()."]
+ #[doc = ""]
+ #[doc = "The last call to grpc_shutdown will initiate cleaning up of grpc library"]
+ #[doc = "internals, which can happen in another thread. Once the clean-up is done,"]
+ #[doc = "no memory is used by grpc, nor are any instructions executing within the"]
+ #[doc = "grpc library. Prior to calling, all application owned grpc objects must"]
+ #[doc = "have been destroyed."]
+ pub fn grpc_shutdown();
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized."]
+ #[doc = "TODO(ericgribkoff) Decide if this should be promoted to non-experimental as"]
+ #[doc = "part of stabilizing the fork support API, as tracked in"]
+ #[doc = "https://github.com/grpc/grpc/issues/15334"]
+ pub fn grpc_is_initialized() -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " DEPRECATED. Recommend to use grpc_shutdown only"]
+ pub fn grpc_shutdown_blocking();
+}
+extern "C" {
+ #[doc = " Return a string representing the current version of grpc"]
+ pub fn grpc_version_string() -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Return a string specifying what the 'g' in gRPC stands for"]
+ pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Returns the completion queue factory based on the attributes. MAY return a"]
+ #[doc = "NULL if no factory can be found"]
+ pub fn grpc_completion_queue_factory_lookup(
+ attributes: *const grpc_completion_queue_attributes,
+ ) -> *const grpc_completion_queue_factory;
+}
+extern "C" {
+ #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
+ #[doc = "of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
+ pub fn grpc_completion_queue_create_for_next(
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_completion_queue;
+}
+extern "C" {
+ #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
+ #[doc = "of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
+ pub fn grpc_completion_queue_create_for_pluck(
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_completion_queue;
+}
+extern "C" {
+ #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
+ #[doc = "of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING."]
+ #[doc = "This function is experimental."]
+ pub fn grpc_completion_queue_create_for_callback(
+ shutdown_callback: *mut grpc_completion_queue_functor,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_completion_queue;
+}
+extern "C" {
+ #[doc = " Create a completion queue"]
+ pub fn grpc_completion_queue_create(
+ factory: *const grpc_completion_queue_factory,
+ attributes: *const grpc_completion_queue_attributes,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_completion_queue;
+}
+extern "C" {
+ #[doc = " Blocks until an event is available, the completion queue is being shut down,"]
+ #[doc = "or deadline is reached."]
+ #[doc = ""]
+ #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
+ #[doc = "otherwise a grpc_event describing the event that occurred."]
+ #[doc = ""]
+ #[doc = "Callers must not call grpc_completion_queue_next and"]
+ #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
+ pub fn grpc_completion_queue_next(
+ cq: *mut grpc_completion_queue,
+ deadline: gpr_timespec,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> grpc_event;
+}
+extern "C" {
+ #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is"]
+ #[doc = "being shutdown or deadline is reached."]
+ #[doc = ""]
+ #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
+ #[doc = "otherwise a grpc_event describing the event that occurred."]
+ #[doc = ""]
+ #[doc = "Callers must not call grpc_completion_queue_next and"]
+ #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
+ #[doc = ""]
+ #[doc = "Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS"]
+ #[doc = "concurrently executing plucks at any time."]
+ pub fn grpc_completion_queue_pluck(
+ cq: *mut grpc_completion_queue,
+ tag: *mut ::std::os::raw::c_void,
+ deadline: gpr_timespec,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> grpc_event;
+}
+extern "C" {
+ #[doc = " Begin destruction of a completion queue. Once all possible events are"]
+ #[doc = "drained then grpc_completion_queue_next will start to produce"]
+ #[doc = "GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call"]
+ #[doc = "grpc_completion_queue_destroy."]
+ #[doc = ""]
+ #[doc = "After calling this function applications should ensure that no"]
+ #[doc = "NEW work is added to be published on this completion queue."]
+ pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue);
+}
+extern "C" {
+ #[doc = " Destroy a completion queue. The caller must ensure that the queue is"]
+ #[doc = "drained and no threads are executing grpc_completion_queue_next"]
+ pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API ************/"]
+ #[doc = " grpc_flush_cq_tls_cache() MUST be called on the same thread,"]
+ #[doc = " with the same cq."]
+ pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API ************/"]
+ #[doc = " Returns 1 if there was contents in the cache. If there was an event"]
+ #[doc = " in \\a cq tls cache, its tag is placed in tag, and ok is set to the"]
+ #[doc = " event success."]
+ pub fn grpc_completion_queue_thread_local_cache_flush(
+ cq: *mut grpc_completion_queue,
+ tag: *mut *mut ::std::os::raw::c_void,
+ ok: *mut ::std::os::raw::c_int,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Check the connectivity state of a channel."]
+ pub fn grpc_channel_check_connectivity_state(
+ channel: *mut grpc_channel,
+ try_to_connect: ::std::os::raw::c_int,
+ ) -> grpc_connectivity_state;
+}
+extern "C" {
+ #[doc = " Number of active \"external connectivity state watchers\" attached to a"]
+ #[doc = " channel."]
+ #[doc = " Useful for testing."]
+ pub fn grpc_channel_num_external_connectivity_watchers(
+ channel: *mut grpc_channel,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Watch for a change in connectivity state."]
+ #[doc = "Once the channel connectivity state is different from last_observed_state,"]
+ #[doc = "tag will be enqueued on cq with success=1."]
+ #[doc = "If deadline expires BEFORE the state is changed, tag will be enqueued on cq"]
+ #[doc = "with success=0."]
+ pub fn grpc_channel_watch_connectivity_state(
+ channel: *mut grpc_channel,
+ last_observed_state: grpc_connectivity_state,
+ deadline: gpr_timespec,
+ cq: *mut grpc_completion_queue,
+ tag: *mut ::std::os::raw::c_void,
+ );
+}
+extern "C" {
+ #[doc = " Check whether a grpc channel supports connectivity watcher"]
+ pub fn grpc_channel_support_connectivity_watcher(
+ channel: *mut grpc_channel,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Create a call given a grpc_channel, in order to call 'method'. All"]
+ #[doc = "completions are sent to 'completion_queue'. 'method' and 'host' need only"]
+ #[doc = "live through the invocation of this function."]
+ #[doc = "If parent_call is non-NULL, it must be a server-side call. It will be used"]
+ #[doc = "to propagate properties from the server call to this new client call,"]
+ #[doc = "depending on the value of \\a propagation_mask (see propagation_bits.h for"]
+ #[doc = "possible values)."]
+ pub fn grpc_channel_create_call(
+ channel: *mut grpc_channel,
+ parent_call: *mut grpc_call,
+ propagation_mask: u32,
+ completion_queue: *mut grpc_completion_queue,
+ method: grpc_slice,
+ host: *const grpc_slice,
+ deadline: gpr_timespec,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call;
+}
+extern "C" {
+ #[doc = " Pre-register a method/host pair on a channel."]
+ #[doc = "method and host are not owned and must remain alive while the channel is"]
+ #[doc = "alive."]
+ pub fn grpc_channel_register_call(
+ channel: *mut grpc_channel,
+ method: *const ::std::os::raw::c_char,
+ host: *const ::std::os::raw::c_char,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " Create a call given a handle returned from grpc_channel_register_call."]
+ #[doc = "\\sa grpc_channel_create_call."]
+ pub fn grpc_channel_create_registered_call(
+ channel: *mut grpc_channel,
+ parent_call: *mut grpc_call,
+ propagation_mask: u32,
+ completion_queue: *mut grpc_completion_queue,
+ registered_call_handle: *mut ::std::os::raw::c_void,
+ deadline: gpr_timespec,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call;
+}
+extern "C" {
+ #[doc = " Allocate memory in the grpc_call arena: this memory is automatically"]
+ #[doc = "discarded at call completion"]
+ pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " Start a batch of operations defined in the array ops; when complete, post a"]
+ #[doc = "completion of type 'tag' to the completion queue bound to the call."]
+ #[doc = "The order of ops specified in the batch has no significance."]
+ #[doc = "Only one operation of each type can be active at once in any given"]
+ #[doc = "batch."]
+ #[doc = "If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call"]
+ #[doc = "grpc_completion_queue_next or grpc_completion_queue_pluck on the completion"]
+ #[doc = "queue associated with 'call' for work to be performed. If a call to"]
+ #[doc = "grpc_call_start_batch returns any value other than GRPC_CALL_OK it is"]
+ #[doc = "guaranteed that no state associated with 'call' is changed and it is not"]
+ #[doc = "appropriate to call grpc_completion_queue_next or"]
+ #[doc = "grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch"]
+ #[doc = "call."]
+ #[doc = "If a call to grpc_call_start_batch with an empty batch returns"]
+ #[doc = "GRPC_CALL_OK, the tag is put in the completion queue immediately."]
+ #[doc = "THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment"]
+ #[doc = "needs to be synchronized. As an optimization, you may synchronize batches"]
+ #[doc = "containing just send operations independently from batches containing just"]
+ #[doc = "receive operations. Access to grpc_call_start_batch with an empty batch is"]
+ #[doc = "thread-compatible."]
+ pub fn grpc_call_start_batch(
+ call: *mut grpc_call,
+ ops: *const grpc_op,
+ nops: usize,
+ tag: *mut ::std::os::raw::c_void,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ #[doc = " Returns a newly allocated string representing the endpoint to which this"]
+ #[doc = "call is communicating with. The string is in the uri format accepted by"]
+ #[doc = "grpc_channel_create."]
+ #[doc = "The returned string should be disposed of with gpr_free()."]
+ #[doc = ""]
+ #[doc = "WARNING: this value is never authenticated or subject to any security"]
+ #[doc = "related code. It must not be used for any authentication related"]
+ #[doc = "functionality. Instead, use grpc_auth_context."]
+ pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct census_context {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Set census context for a call; Must be called before first call to"]
+ #[doc = "grpc_call_start_batch()."]
+ pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context);
+}
+extern "C" {
+ #[doc = " Retrieve the calls current census context."]
+ pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context;
+}
+extern "C" {
+ #[doc = " Return a newly allocated string representing the target a channel was"]
+ #[doc = "created for."]
+ pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Request info about the channel."]
+ #[doc = "\\a channel_info indicates what information is being requested and"]
+ #[doc = "how that information will be returned."]
+ #[doc = "\\a channel_info is owned by the caller."]
+ pub fn grpc_channel_get_info(
+ channel: *mut grpc_channel,
+ channel_info: *const grpc_channel_info,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Resets the channel's connect backoff."]
+ #[doc = "TODO(roth): When we see whether this proves useful, either promote"]
+ #[doc = "to non-experimental or remove it."]
+ pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel);
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_channel_credentials {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Releases a channel credentials object."]
+ #[doc = "The creator of the credentials object is responsible for its release."]
+ pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials);
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_server_credentials {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Releases a server_credentials object."]
+ #[doc = "The creator of the server_credentials object is responsible for its release."]
+ pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials);
+}
+extern "C" {
+ #[doc = " Creates a secure channel using the passed-in credentials. Additional"]
+ #[doc = "channel level configuration MAY be provided by grpc_channel_args, though"]
+ #[doc = "the expectation is that most clients will want to simply pass NULL. The"]
+ #[doc = "user data in 'args' need only live through the invocation of this function."]
+ #[doc = "However, if any args of the 'pointer' type are passed, then the referenced"]
+ #[doc = "vtable must be maintained by the caller until grpc_channel_destroy"]
+ #[doc = "terminates. See grpc_channel_args definition for more on this."]
+ pub fn grpc_channel_create(
+ target: *const ::std::os::raw::c_char,
+ creds: *mut grpc_channel_credentials,
+ args: *const grpc_channel_args,
+ ) -> *mut grpc_channel;
+}
+extern "C" {
+ #[doc = " Create a lame client: this client fails every operation attempted on it."]
+ pub fn grpc_lame_client_channel_create(
+ target: *const ::std::os::raw::c_char,
+ error_code: grpc_status_code::Type,
+ error_message: *const ::std::os::raw::c_char,
+ ) -> *mut grpc_channel;
+}
+extern "C" {
+ #[doc = " Close and destroy a grpc channel"]
+ pub fn grpc_channel_destroy(channel: *mut grpc_channel);
+}
+extern "C" {
+ #[doc = " Cancel an RPC."]
+ #[doc = "Can be called multiple times, from any thread."]
+ #[doc = "THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status"]
+ #[doc = "are thread-safe, and can be called at any point before grpc_call_unref"]
+ #[doc = "is called."]
+ pub fn grpc_call_cancel(
+ call: *mut grpc_call,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ #[doc = " Cancel an RPC."]
+ #[doc = "Can be called multiple times, from any thread."]
+ #[doc = "If a status has not been received for the call, set it to the status code"]
+ #[doc = "and description passed in."]
+ #[doc = "Importantly, this function does not send status nor description to the"]
+ #[doc = "remote endpoint."]
+ #[doc = "Note that \\a description doesn't need be a static string."]
+ #[doc = "It doesn't need to be alive after the call to"]
+ #[doc = "grpc_call_cancel_with_status completes."]
+ pub fn grpc_call_cancel_with_status(
+ call: *mut grpc_call,
+ status: grpc_status_code::Type,
+ description: *const ::std::os::raw::c_char,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpc_call_failed_before_recv_message(c: *const grpc_call) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Ref a call."]
+ #[doc = "THREAD SAFETY: grpc_call_ref is thread-compatible"]
+ pub fn grpc_call_ref(call: *mut grpc_call);
+}
+extern "C" {
+ #[doc = " Unref a call."]
+ #[doc = "THREAD SAFETY: grpc_call_unref is thread-compatible"]
+ pub fn grpc_call_unref(call: *mut grpc_call);
+}
+extern "C" {
+ #[doc = " Request notification of a new call."]
+ #[doc = "Once a call is received, a notification tagged with \\a tag_new is added to"]
+ #[doc = "\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are"]
+ #[doc = "updated with the appropriate call information. \\a cq_bound_to_call is bound"]
+ #[doc = "to \\a call, and batch operation notifications for that call will be posted"]
+ #[doc = "to \\a cq_bound_to_call."]
+ #[doc = "Note that \\a cq_for_notification must have been registered to the server via"]
+ #[doc = "\\a grpc_server_register_completion_queue."]
+ pub fn grpc_server_request_call(
+ server: *mut grpc_server,
+ call: *mut *mut grpc_call,
+ details: *mut grpc_call_details,
+ request_metadata: *mut grpc_metadata_array,
+ cq_bound_to_call: *mut grpc_completion_queue,
+ cq_for_notification: *mut grpc_completion_queue,
+ tag_new: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+#[repr(u32)]
+#[doc = " How to handle payloads for a registered method"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_server_register_method_payload_handling {
+ #[doc = " Don't try to read the payload"]
+ GRPC_SRM_PAYLOAD_NONE = 0,
+ #[doc = " Read the initial payload as a byte buffer"]
+ GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1,
+}
+extern "C" {
+ #[doc = " Registers a method in the server."]
+ #[doc = "Methods to this (host, method) pair will not be reported by"]
+ #[doc = "grpc_server_request_call, but instead be reported by"]
+ #[doc = "grpc_server_request_registered_call when passed the appropriate"]
+ #[doc = "registered_method (as returned by this function)."]
+ #[doc = "Must be called before grpc_server_start."]
+ #[doc = "Returns NULL on failure."]
+ pub fn grpc_server_register_method(
+ server: *mut grpc_server,
+ method: *const ::std::os::raw::c_char,
+ host: *const ::std::os::raw::c_char,
+ payload_handling: grpc_server_register_method_payload_handling,
+ flags: u32,
+ ) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'"]
+ #[doc = "must have been registered to the server via"]
+ #[doc = "grpc_server_register_completion_queue."]
+ pub fn grpc_server_request_registered_call(
+ server: *mut grpc_server,
+ registered_method: *mut ::std::os::raw::c_void,
+ call: *mut *mut grpc_call,
+ deadline: *mut gpr_timespec,
+ request_metadata: *mut grpc_metadata_array,
+ optional_payload: *mut *mut grpc_byte_buffer,
+ cq_bound_to_call: *mut grpc_completion_queue,
+ cq_for_notification: *mut grpc_completion_queue,
+ tag_new: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ #[doc = " Create a server. Additional configuration for each incoming channel can"]
+ #[doc = "be specified with args. If no additional configuration is needed, args can"]
+ #[doc = "be NULL. The user data in 'args' need only live through the invocation of"]
+ #[doc = "this function. However, if any args of the 'pointer' type are passed, then"]
+ #[doc = "the referenced vtable must be maintained by the caller until"]
+ #[doc = "grpc_server_destroy terminates. See grpc_channel_args definition for more"]
+ #[doc = "on this."]
+ pub fn grpc_server_create(
+ args: *const grpc_channel_args,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_server;
+}
+extern "C" {
+ #[doc = " Register a completion queue with the server. Must be done for any"]
+ #[doc = "notification completion queue that is passed to grpc_server_request_*_call"]
+ #[doc = "and to grpc_server_shutdown_and_notify. Must be performed prior to"]
+ #[doc = "grpc_server_start."]
+ pub fn grpc_server_register_completion_queue(
+ server: *mut grpc_server,
+ cq: *mut grpc_completion_queue,
+ reserved: *mut ::std::os::raw::c_void,
+ );
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_serving_status_update {
+ pub code: grpc_status_code::Type,
+ pub error_message: *const ::std::os::raw::c_char,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_server_xds_status_notifier {
+ pub on_serving_status_update: ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ uri: *const ::std::os::raw::c_char,
+ update: grpc_serving_status_update,
+ ),
+ >,
+ pub user_data: *mut ::std::os::raw::c_void,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_server_config_fetcher {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Creates an xDS config fetcher."]
+ pub fn grpc_server_config_fetcher_xds_create(
+ notifier: grpc_server_xds_status_notifier,
+ args: *const grpc_channel_args,
+ ) -> *mut grpc_server_config_fetcher;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Destroys a config fetcher."]
+ pub fn grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership."]
+ #[doc = "Must be called before adding ports"]
+ pub fn grpc_server_set_config_fetcher(
+ server: *mut grpc_server,
+ config_fetcher: *mut grpc_server_config_fetcher,
+ );
+}
+extern "C" {
+ #[doc = " Add a HTTP2 over an encrypted link over tcp listener."]
+ #[doc = "Returns bound port number on success, 0 on failure."]
+ #[doc = "REQUIRES: server not started"]
+ pub fn grpc_server_add_http2_port(
+ server: *mut grpc_server,
+ addr: *const ::std::os::raw::c_char,
+ creds: *mut grpc_server_credentials,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Start a server - tells all listeners to start listening"]
+ pub fn grpc_server_start(server: *mut grpc_server);
+}
+extern "C" {
+ #[doc = " Begin shutting down a server."]
+ #[doc = "After completion, no new calls or connections will be admitted."]
+ #[doc = "Existing calls will be allowed to complete."]
+ #[doc = "Send a GRPC_OP_COMPLETE event when there are no more calls being serviced."]
+ #[doc = "Shutdown is idempotent, and all tags will be notified at once if multiple"]
+ #[doc = "grpc_server_shutdown_and_notify calls are made. 'cq' must have been"]
+ #[doc = "registered to this server via grpc_server_register_completion_queue."]
+ pub fn grpc_server_shutdown_and_notify(
+ server: *mut grpc_server,
+ cq: *mut grpc_completion_queue,
+ tag: *mut ::std::os::raw::c_void,
+ );
+}
+extern "C" {
+ #[doc = " Cancel all in-progress calls."]
+ #[doc = "Only usable after shutdown."]
+ pub fn grpc_server_cancel_all_calls(server: *mut grpc_server);
+}
+extern "C" {
+ #[doc = " Destroy a server."]
+ #[doc = "Shutdown must have completed beforehand (i.e. all tags generated by"]
+ #[doc = "grpc_server_shutdown_and_notify must have been received, and at least"]
+ #[doc = "one call to grpc_server_shutdown_and_notify must have been made)."]
+ pub fn grpc_server_destroy(server: *mut grpc_server);
+}
+extern "C" {
+ #[doc = " Enable or disable a tracer."]
+ #[doc = ""]
+ #[doc = "Tracers (usually controlled by the environment variable GRPC_TRACE)"]
+ #[doc = "allow printf-style debugging on GRPC internals, and are useful for"]
+ #[doc = "tracking down problems in the field."]
+ #[doc = ""]
+ #[doc = "Use of this function is not strictly thread-safe, but the"]
+ #[doc = "thread-safety issues raised by it should not be of concern."]
+ pub fn grpc_tracer_set_enabled(
+ name: *const ::std::os::raw::c_char,
+ enabled: ::std::os::raw::c_int,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Check whether a metadata key is legal (will be accepted by core)"]
+ pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Check whether a non-binary metadata value is legal (will be accepted by"]
+ #[doc = "core)"]
+ pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Check whether a metadata key corresponds to a binary value"]
+ pub fn grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Convert grpc_call_error values to a string"]
+ pub fn grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Create a buffer pool"]
+ pub fn grpc_resource_quota_create(
+ trace_name: *const ::std::os::raw::c_char,
+ ) -> *mut grpc_resource_quota;
+}
+extern "C" {
+ #[doc = " Add a reference to a buffer pool"]
+ pub fn grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota);
+}
+extern "C" {
+ #[doc = " Drop a reference to a buffer pool"]
+ pub fn grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota);
+}
+extern "C" {
+ #[doc = " Update the size of a buffer pool"]
+ pub fn grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize);
+}
+extern "C" {
+ #[doc = " Update the size of the maximum number of threads allowed"]
+ pub fn grpc_resource_quota_set_max_threads(
+ resource_quota: *mut grpc_resource_quota,
+ new_max_threads: ::std::os::raw::c_int,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto."]
+ #[doc = "The full name of the proto is envoy.service.status.v3.ClientConfig."]
+ pub fn grpc_dump_xds_configs() -> grpc_slice;
+}
+extern "C" {
+ #[doc = " Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota"]
+ pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable;
+}
+extern "C" {
+ #[doc = " CHANNELZ API *************/"]
+ #[doc = "churn as the feature is implemented. This comment will be removed once"]
+ #[doc = "channelz is officially supported, and these APIs become stable. For now"]
+ #[doc = "you may track the progress by following this github issue:"]
+ #[doc = "https://github.com/grpc/grpc/issues/15340"]
+ #[doc = ""]
+ #[doc = "the following APIs return allocated JSON strings that match the response"]
+ #[doc = "objects from the channelz proto, found here:"]
+ #[doc = "https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto."]
+ #[doc = ""]
+ #[doc = "For easy conversion to protobuf, The JSON is formatted according to:"]
+ #[doc = "https://developers.google.com/protocol-buffers/docs/proto3#json."]
+ pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_server_sockets(
+ server_id: isize,
+ start_socket_id: isize,
+ max_results: isize,
+ ) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL - Subject to change."]
+ #[doc = " Fetch a vtable for grpc_channel_arg that points to"]
+ #[doc = " grpc_authorization_policy_provider."]
+ pub fn grpc_authorization_policy_provider_arg_vtable() -> *const grpc_arg_pointer_vtable;
+}
+extern "C" {
+ pub fn grpc_cronet_secure_channel_create(
+ engine: *mut ::std::os::raw::c_void,
+ target: *const ::std::os::raw::c_char,
+ args: *const grpc_channel_args,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_channel;
+}
+extern "C" {
+ #[doc = " Create a secure channel to 'target' using file descriptor 'fd' and passed-in"]
+ #[doc = "credentials. The 'target' argument will be used to indicate the name for"]
+ #[doc = "this channel. Note that this API currently only supports insecure channel"]
+ #[doc = "credentials. Using other types of credentials will result in a failure."]
+ pub fn grpc_channel_create_from_fd(
+ target: *const ::std::os::raw::c_char,
+ fd: ::std::os::raw::c_int,
+ creds: *mut grpc_channel_credentials,
+ args: *const grpc_channel_args,
+ ) -> *mut grpc_channel;
+}
+extern "C" {
+ #[doc = " Add the connected secure communication channel based on file descriptor 'fd'"]
+ #[doc = "to the 'server' and server credentials 'creds'. The 'fd' must be an open file"]
+ #[doc = "descriptor corresponding to a connected socket. Events from the file"]
+ #[doc = "descriptor may come on any of the server completion queues (i.e completion"]
+ #[doc = "queues registered via the grpc_server_register_completion_queue API)."]
+ #[doc = "Note that this API currently only supports inseure server credentials"]
+ #[doc = "Using other types of credentials will result in a failure."]
+ #[doc = "TODO(hork): add channel_args to this API to allow endpoints and transports"]
+ #[doc = "created in this function to participate in the resource quota feature."]
+ pub fn grpc_server_add_channel_from_fd(
+ server: *mut grpc_server,
+ fd: ::std::os::raw::c_int,
+ creds: *mut grpc_server_credentials,
+ );
+}
+#[repr(u32)]
+#[doc = " Results for the SSL roots override callback."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_ssl_roots_override_result {
+ GRPC_SSL_ROOTS_OVERRIDE_OK = 0,
+ GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY = 1,
+ #[doc = " Do not try fallback options."]
+ GRPC_SSL_ROOTS_OVERRIDE_FAIL = 2,
+}
+#[repr(u32)]
+#[doc = " Callback results for dynamically loading a SSL certificate config."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_ssl_certificate_config_reload_status {
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED = 0,
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW = 1,
+ GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL = 2,
+}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_ssl_client_certificate_request_type {
+ #[doc = " Server does not request client certificate."]
+ #[doc = "The certificate presented by the client is not checked by the server at"]
+ #[doc = "all. (A client may present a self signed or signed certificate or not"]
+ #[doc = "present a certificate at all and any of those option would be accepted)"]
+ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0,
+ #[doc = " Server requests client certificate but does not enforce that the client"]
+ #[doc = "presents a certificate."]
+ #[doc = ""]
+ #[doc = "If the client presents a certificate, the client authentication is left to"]
+ #[doc = "the application (the necessary metadata will be available to the"]
+ #[doc = "application via authentication context properties, see grpc_auth_context)."]
+ #[doc = ""]
+ #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
+ #[doc = "be established."]
+ GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1,
+ #[doc = " Server requests client certificate but does not enforce that the client"]
+ #[doc = "presents a certificate."]
+ #[doc = ""]
+ #[doc = "If the client presents a certificate, the client authentication is done by"]
+ #[doc = "the gRPC framework. (For a successful connection the client needs to either"]
+ #[doc = "present a certificate that can be verified against the root certificate"]
+ #[doc = "configured by the server or not present a certificate at all)"]
+ #[doc = ""]
+ #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
+ #[doc = "be established."]
+ GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2,
+ #[doc = " Server requests client certificate and enforces that the client presents a"]
+ #[doc = "certificate."]
+ #[doc = ""]
+ #[doc = "If the client presents a certificate, the client authentication is left to"]
+ #[doc = "the application (the necessary metadata will be available to the"]
+ #[doc = "application via authentication context properties, see grpc_auth_context)."]
+ #[doc = ""]
+ #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
+ #[doc = "be established."]
+ GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3,
+ #[doc = " Server requests client certificate and enforces that the client presents a"]
+ #[doc = "certificate."]
+ #[doc = ""]
+ #[doc = "The certificate presented by the client is verified by the gRPC framework."]
+ #[doc = "(For a successful connection the client needs to present a certificate that"]
+ #[doc = "can be verified against the root certificate configured by the server)"]
+ #[doc = ""]
+ #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
+ #[doc = "be established."]
+ GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4,
+}
+impl grpc_security_level {
+ pub const GRPC_SECURITY_NONE: grpc_security_level = grpc_security_level::GRPC_SECURITY_MIN;
+}
+impl grpc_security_level {
+ pub const GRPC_SECURITY_MAX: grpc_security_level =
+ grpc_security_level::GRPC_PRIVACY_AND_INTEGRITY;
+}
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_security_level {
+ GRPC_SECURITY_MIN = 0,
+ GRPC_INTEGRITY_ONLY = 1,
+ GRPC_PRIVACY_AND_INTEGRITY = 2,
+}
+#[repr(u32)]
+#[doc = " Type of local connections for which local channel/server credentials will be"]
+#[doc = " applied. It supports UDS and local TCP connections."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_local_connect_type {
+ UDS = 0,
+ LOCAL_TCP = 1,
+}
+#[repr(u32)]
+#[doc = " The TLS versions that are supported by the SSL stack."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum grpc_tls_version {
+ TLS1_2 = 0,
+ TLS1_3 = 1,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_auth_context {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_auth_property_iterator {
+ pub ctx: *const grpc_auth_context,
+ pub index: usize,
+ pub name: *const ::std::os::raw::c_char,
+}
+#[doc = " value, if not NULL, is guaranteed to be NULL terminated."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_auth_property {
+ pub name: *mut ::std::os::raw::c_char,
+ pub value: *mut ::std::os::raw::c_char,
+ pub value_length: usize,
+}
+extern "C" {
+ #[doc = " Returns NULL when the iterator is at the end."]
+ pub fn grpc_auth_property_iterator_next(
+ it: *mut grpc_auth_property_iterator,
+ ) -> *const grpc_auth_property;
+}
+extern "C" {
+ #[doc = " Iterates over the auth context."]
+ pub fn grpc_auth_context_property_iterator(
+ ctx: *const grpc_auth_context,
+ ) -> grpc_auth_property_iterator;
+}
+extern "C" {
+ #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return"]
+ #[doc = "NULL) if the peer is not authenticated."]
+ pub fn grpc_auth_context_peer_identity(
+ ctx: *const grpc_auth_context,
+ ) -> grpc_auth_property_iterator;
+}
+extern "C" {
+ #[doc = " Finds a property in the context. May return an empty iterator (first _next"]
+ #[doc = "will return NULL) if no property with this name was found in the context."]
+ pub fn grpc_auth_context_find_properties_by_name(
+ ctx: *const grpc_auth_context,
+ name: *const ::std::os::raw::c_char,
+ ) -> grpc_auth_property_iterator;
+}
+extern "C" {
+ #[doc = " Gets the name of the property that indicates the peer identity. Will return"]
+ #[doc = "NULL if the peer is not authenticated."]
+ pub fn grpc_auth_context_peer_identity_property_name(
+ ctx: *const grpc_auth_context,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Returns 1 if the peer is authenticated, 0 otherwise."]
+ pub fn grpc_auth_context_peer_is_authenticated(
+ ctx: *const grpc_auth_context,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " Gets the auth context from the call. Caller needs to call"]
+ #[doc = "grpc_auth_context_release on the returned context."]
+ pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context;
+}
+extern "C" {
+ #[doc = " Releases the auth context returned from grpc_call_auth_context."]
+ pub fn grpc_auth_context_release(context: *mut grpc_auth_context);
+}
+extern "C" {
+ #[doc = " Add a property."]
+ pub fn grpc_auth_context_add_property(
+ ctx: *mut grpc_auth_context,
+ name: *const ::std::os::raw::c_char,
+ value: *const ::std::os::raw::c_char,
+ value_length: usize,
+ );
+}
+extern "C" {
+ #[doc = " Add a C string property."]
+ pub fn grpc_auth_context_add_cstring_property(
+ ctx: *mut grpc_auth_context,
+ name: *const ::std::os::raw::c_char,
+ value: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure"]
+ #[doc = "(which means that no property with this name exists)."]
+ pub fn grpc_auth_context_set_peer_identity_property_name(
+ ctx: *mut grpc_auth_context,
+ name: *const ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_ssl_session_cache {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Create LRU cache for client-side SSL sessions with the given capacity."]
+ #[doc = "If capacity is < 1, a default capacity is used instead."]
+ pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache;
+}
+extern "C" {
+ #[doc = " Destroy SSL session cache."]
+ pub fn grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache);
+}
+extern "C" {
+ #[doc = " Create a channel arg with the given cache object."]
+ pub fn grpc_ssl_session_cache_create_channel_arg(
+ cache: *mut grpc_ssl_session_cache,
+ ) -> grpc_arg;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_call_credentials {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Releases a call credentials object."]
+ #[doc = "The creator of the credentials object is responsible for its release."]
+ pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials);
+}
+extern "C" {
+ #[doc = " Creates default credentials to connect to a google gRPC service."]
+ #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
+ #[doc = "this could result in an oauth2 token leak. The security level of the"]
+ #[doc = "resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
+ #[doc = ""]
+ #[doc = "If specified, the supplied call credentials object will be attached to the"]
+ #[doc = "returned channel credentials object. The call_credentials object must remain"]
+ #[doc = "valid throughout the lifetime of the returned grpc_channel_credentials"]
+ #[doc = "object. It is expected that the call credentials object was generated"]
+ #[doc = "according to the Application Default Credentials mechanism and asserts the"]
+ #[doc = "identity of the default service account of the machine. Supplying any other"]
+ #[doc = "sort of call credential will result in undefined behavior, up to and"]
+ #[doc = "including the sudden and unexpected failure of RPCs."]
+ #[doc = ""]
+ #[doc = "If nullptr is supplied, the returned channel credentials object will use a"]
+ #[doc = "call credentials object based on the Application Default Credentials"]
+ #[doc = "mechanism."]
+ pub fn grpc_google_default_credentials_create(
+ call_credentials: *mut grpc_call_credentials,
+ ) -> *mut grpc_channel_credentials;
+}
+#[doc = " Callback for getting the SSL roots override from the application."]
+#[doc = "In case of success, *pem_roots_certs must be set to a NULL terminated string"]
+#[doc = "containing the list of PEM encoded root certificates. The ownership is passed"]
+#[doc = "to the core and freed (laster by the core) with gpr_free."]
+#[doc = "If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is"]
+#[doc = "set to a valid path, it will override the roots specified this func"]
+pub type grpc_ssl_roots_override_callback = ::std::option::Option<
+ unsafe extern "C" fn(
+ pem_root_certs: *mut *mut ::std::os::raw::c_char,
+ ) -> grpc_ssl_roots_override_result,
+>;
+extern "C" {
+ #[doc = " Setup a callback to override the default TLS/SSL roots."]
+ #[doc = "This function is not thread-safe and must be called at initialization time"]
+ #[doc = "before any ssl credentials are created to have the desired side effect."]
+ #[doc = "If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the"]
+ #[doc = "callback will not be called."]
+ pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback);
+}
+#[doc = " Object that holds a private key / certificate chain pair in PEM format."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_ssl_pem_key_cert_pair {
+ #[doc = " private_key is the NULL-terminated string containing the PEM encoding of"]
+ #[doc = "the client's private key."]
+ pub private_key: *const ::std::os::raw::c_char,
+ #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of"]
+ #[doc = "the client's certificate chain."]
+ pub cert_chain: *const ::std::os::raw::c_char,
+}
+#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed"]
+#[doc = "after all of its call sites are migrated to grpc_ssl_verify_peer_options."]
+#[doc = "Object that holds additional peer-verification options on a secure"]
+#[doc = "channel."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct verify_peer_options {
+ #[doc = " If non-NULL this callback will be invoked with the expected"]
+ #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
+ #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
+ #[doc = "callback then it is treated as a verification failure. Invocation of"]
+ #[doc = "the callback is blocking, so any implementation should be light-weight."]
+ pub verify_peer_callback: ::std::option::Option<
+ unsafe extern "C" fn(
+ target_name: *const ::std::os::raw::c_char,
+ peer_pem: *const ::std::os::raw::c_char,
+ userdata: *mut ::std::os::raw::c_void,
+ ) -> ::std::os::raw::c_int,
+ >,
+ #[doc = " Arbitrary userdata that will be passed as the last argument to"]
+ #[doc = "verify_peer_callback."]
+ pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
+ #[doc = " A destruct callback that will be invoked when the channel is being"]
+ #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
+ #[doc = "to perform any cleanup associated with that userdata."]
+ pub verify_peer_destruct:
+ ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
+}
+#[doc = " Object that holds additional peer-verification options on a secure"]
+#[doc = "channel."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_ssl_verify_peer_options {
+ #[doc = " If non-NULL this callback will be invoked with the expected"]
+ #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
+ #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
+ #[doc = "callback then it is treated as a verification failure. Invocation of"]
+ #[doc = "the callback is blocking, so any implementation should be light-weight."]
+ pub verify_peer_callback: ::std::option::Option<
+ unsafe extern "C" fn(
+ target_name: *const ::std::os::raw::c_char,
+ peer_pem: *const ::std::os::raw::c_char,
+ userdata: *mut ::std::os::raw::c_void,
+ ) -> ::std::os::raw::c_int,
+ >,
+ #[doc = " Arbitrary userdata that will be passed as the last argument to"]
+ #[doc = "verify_peer_callback."]
+ pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
+ #[doc = " A destruct callback that will be invoked when the channel is being"]
+ #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
+ #[doc = "to perform any cleanup associated with that userdata."]
+ pub verify_peer_destruct:
+ ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
+}
+extern "C" {
+ #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be"]
+ #[doc = "removed after all of its call sites are migrated to"]
+ #[doc = "grpc_ssl_server_credentials_create_ex. Creates an SSL credentials object."]
+ #[doc = "The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
+ #[doc = "- pem_root_certs is the NULL-terminated string containing the PEM encoding"]
+ #[doc = "of the server root certificates. If this parameter is NULL, the"]
+ #[doc = "implementation will first try to dereference the file pointed by the"]
+ #[doc = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,"]
+ #[doc = "try to get the roots set by grpc_override_ssl_default_roots. Eventually,"]
+ #[doc = "if all these fail, it will try to get the roots from a well-known place on"]
+ #[doc = "disk (in the grpc install directory)."]
+ #[doc = ""]
+ #[doc = "gRPC has implemented root cache if the underlying OpenSSL library supports"]
+ #[doc = "it. The gRPC root certificates cache is only applicable on the default"]
+ #[doc = "root certificates, which is used when this parameter is nullptr. If user"]
+ #[doc = "provides their own pem_root_certs, when creating an SSL credential object,"]
+ #[doc = "gRPC would not be able to cache it, and each subchannel will generate a"]
+ #[doc = "copy of the root store. So it is recommended to avoid providing large room"]
+ #[doc = "pem with pem_root_certs parameter to avoid excessive memory consumption,"]
+ #[doc = "particularly on mobile platforms such as iOS."]
+ #[doc = "- pem_key_cert_pair is a pointer on the object containing client's private"]
+ #[doc = "key and certificate chain. This parameter can be NULL if the client does"]
+ #[doc = "not have such a key/cert pair."]
+ #[doc = "- verify_options is an optional verify_peer_options object which holds"]
+ #[doc = "additional options controlling how peer certificates are verified. For"]
+ #[doc = "example, you can supply a callback which receives the peer's certificate"]
+ #[doc = "with which you can do additional verification. Can be NULL, in which"]
+ #[doc = "case verification will retain default behavior. Any settings in"]
+ #[doc = "verify_options are copied during this call, so the verify_options"]
+ #[doc = "object can be released afterwards."]
+ pub fn grpc_ssl_credentials_create(
+ pem_root_certs: *const ::std::os::raw::c_char,
+ pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
+ verify_options: *const verify_peer_options,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ pub fn grpc_ssl_credentials_create_ex(
+ pem_root_certs: *const ::std::os::raw::c_char,
+ pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
+ verify_options: *const grpc_ssl_verify_peer_options,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " Creates a composite channel credentials object. The security level of"]
+ #[doc = " resulting connection is determined by channel_creds."]
+ pub fn grpc_composite_channel_credentials_create(
+ channel_creds: *mut grpc_channel_credentials,
+ call_creds: *mut grpc_call_credentials,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " Creates a composite call credentials object."]
+ pub fn grpc_composite_call_credentials_create(
+ creds1: *mut grpc_call_credentials,
+ creds2: *mut grpc_call_credentials,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ #[doc = " Creates a compute engine credentials object for connecting to Google."]
+ #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
+ #[doc = "this could result in an oauth2 token leak."]
+ pub fn grpc_google_compute_engine_credentials_create(
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ pub fn grpc_max_auth_token_lifetime() -> gpr_timespec;
+}
+extern "C" {
+ #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid."]
+ #[doc = "- json_key is the JSON key string containing the client's private key."]
+ #[doc = "- token_lifetime is the lifetime of each Json Web Token (JWT) created with"]
+ #[doc = "this credentials. It should not exceed grpc_max_auth_token_lifetime or"]
+ #[doc = "will be cropped to this value."]
+ pub fn grpc_service_account_jwt_access_credentials_create(
+ json_key: *const ::std::os::raw::c_char,
+ token_lifetime: gpr_timespec,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ #[doc = " Builds External Account credentials."]
+ #[doc = "- json_string is the JSON string containing the credentials options."]
+ #[doc = "- scopes_string contains the scopes to be binded with the credentials."]
+ #[doc = "This API is used for experimental purposes for now and may change in the"]
+ #[doc = "future."]
+ pub fn grpc_external_account_credentials_create(
+ json_string: *const ::std::os::raw::c_char,
+ scopes_string: *const ::std::os::raw::c_char,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google."]
+ #[doc = "May return NULL if the input is invalid."]
+ #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
+ #[doc = "this could result in an oauth2 token leak."]
+ #[doc = "- json_refresh_token is the JSON string containing the refresh token itself"]
+ #[doc = "along with a client_id and client_secret."]
+ pub fn grpc_google_refresh_token_credentials_create(
+ json_refresh_token: *const ::std::os::raw::c_char,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ #[doc = " Creates an Oauth2 Access Token credentials with an access token that was"]
+ #[doc = "acquired by an out of band mechanism."]
+ pub fn grpc_access_token_credentials_create(
+ access_token: *const ::std::os::raw::c_char,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+extern "C" {
+ #[doc = " Creates an IAM credentials object for connecting to Google."]
+ pub fn grpc_google_iam_credentials_create(
+ authorization_token: *const ::std::os::raw::c_char,
+ authority_selector: *const ::std::os::raw::c_char,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF"]
+#[doc = "draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
+#[doc = "Optional fields may be set to NULL or empty string. It is the responsibility"]
+#[doc = "of the caller to ensure that the subject and actor tokens are refreshed on"]
+#[doc = "disk at the specified paths. This API is used for experimental purposes for"]
+#[doc = "now and may change in the future."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_sts_credentials_options {
+ pub token_exchange_service_uri: *const ::std::os::raw::c_char,
+ pub resource: *const ::std::os::raw::c_char,
+ pub audience: *const ::std::os::raw::c_char,
+ pub scope: *const ::std::os::raw::c_char,
+ pub requested_token_type: *const ::std::os::raw::c_char,
+ pub subject_token_path: *const ::std::os::raw::c_char,
+ pub subject_token_type: *const ::std::os::raw::c_char,
+ pub actor_token_path: *const ::std::os::raw::c_char,
+ pub actor_token_type: *const ::std::os::raw::c_char,
+}
+extern "C" {
+ #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the"]
+ #[doc = "IETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
+ #[doc = "This API is used for experimental purposes for now and may change in the"]
+ #[doc = "future."]
+ pub fn grpc_sts_credentials_create(
+ options: *const grpc_sts_credentials_options,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+#[doc = " Callback function to be called by the metadata credentials plugin"]
+#[doc = "implementation when the metadata is ready."]
+#[doc = "- user_data is the opaque pointer that was passed in the get_metadata method"]
+#[doc = "of the grpc_metadata_credentials_plugin (see below)."]
+#[doc = "- creds_md is an array of credentials metadata produced by the plugin. It"]
+#[doc = "may be set to NULL in case of an error."]
+#[doc = "- num_creds_md is the number of items in the creds_md array."]
+#[doc = "- status must be GRPC_STATUS_OK in case of success or another specific error"]
+#[doc = "code otherwise."]
+#[doc = "- error_details contains details about the error if any. In case of success"]
+#[doc = "it should be NULL and will be otherwise ignored."]
+pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ creds_md: *const grpc_metadata,
+ num_creds_md: usize,
+ status: grpc_status_code::Type,
+ error_details: *const ::std::os::raw::c_char,
+ ),
+>;
+#[doc = " Context that can be used by metadata credentials plugin in order to create"]
+#[doc = "auth related metadata."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_auth_metadata_context {
+ #[doc = " The fully qualifed service url."]
+ pub service_url: *const ::std::os::raw::c_char,
+ #[doc = " The method name of the RPC being called (not fully qualified)."]
+ #[doc = "The fully qualified method name can be built from the service_url:"]
+ #[doc = "full_qualified_method_name = ctx->service_url + '/' + ctx->method_name."]
+ pub method_name: *const ::std::os::raw::c_char,
+ #[doc = " The auth_context of the channel which gives the server's identity."]
+ pub channel_auth_context: *const grpc_auth_context,
+ #[doc = " Reserved for future use."]
+ pub reserved: *mut ::std::os::raw::c_void,
+}
+extern "C" {
+ #[doc = " Performs a deep copy from \\a from to \\a to."]
+ pub fn grpc_auth_metadata_context_copy(
+ from: *mut grpc_auth_metadata_context,
+ to: *mut grpc_auth_metadata_context,
+ );
+}
+extern "C" {
+ #[doc = " Releases internal resources held by \\a context."]
+ pub fn grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context);
+}
+#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to"]
+#[doc = "create grpc_credentials objects that can be set on a channel (composed) or"]
+#[doc = "a call. See grpc_credentials_metadata_create_from_plugin below."]
+#[doc = "The grpc client stack will call the get_metadata method of the plugin for"]
+#[doc = "every call in scope for the credentials created from it."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_metadata_credentials_plugin {
+ #[doc = " The implementation of this method has to be non-blocking, but can"]
+ #[doc = "be performed synchronously or asynchronously."]
+ #[doc = ""]
+ #[doc = "If processing occurs synchronously, returns non-zero and populates"]
+ #[doc = "creds_md, num_creds_md, status, and error_details. In this case,"]
+ #[doc = "the caller takes ownership of the entries in creds_md and of"]
+ #[doc = "error_details. Note that if the plugin needs to return more than"]
+ #[doc = "GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must"]
+ #[doc = "return asynchronously."]
+ #[doc = ""]
+ #[doc = "If processing occurs asynchronously, returns zero and invokes \\a cb"]
+ #[doc = "when processing is completed. \\a user_data will be passed as the"]
+ #[doc = "first parameter of the callback. NOTE: \\a cb MUST be invoked in a"]
+ #[doc = "different thread, not from the thread in which \\a get_metadata() is"]
+ #[doc = "invoked."]
+ #[doc = ""]
+ #[doc = "\\a context is the information that can be used by the plugin to create"]
+ #[doc = "auth metadata."]
+ pub get_metadata: ::std::option::Option<
+ unsafe extern "C" fn(
+ state: *mut ::std::os::raw::c_void,
+ context: grpc_auth_metadata_context,
+ cb: grpc_credentials_plugin_metadata_cb,
+ user_data: *mut ::std::os::raw::c_void,
+ creds_md: *mut grpc_metadata,
+ num_creds_md: *mut usize,
+ status: *mut grpc_status_code::Type,
+ error_details: *mut *const ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int,
+ >,
+ #[doc = " Implements debug string of the given plugin. This method returns an"]
+ #[doc = " allocated string that the caller needs to free using gpr_free()"]
+ pub debug_string: ::std::option::Option<
+ unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char,
+ >,
+ #[doc = " Destroys the plugin state."]
+ pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
+ #[doc = " State that will be set as the first parameter of the methods above."]
+ pub state: *mut ::std::os::raw::c_void,
+ #[doc = " Type of credentials that this plugin is implementing."]
+ pub type_: *const ::std::os::raw::c_char,
+}
+extern "C" {
+ #[doc = " Creates a credentials object from a plugin with a specified minimum security"]
+ #[doc = " level."]
+ pub fn grpc_metadata_credentials_create_from_plugin(
+ plugin: grpc_metadata_credentials_plugin,
+ min_security_level: grpc_security_level,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_call_credentials;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_ssl_server_certificate_config {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Creates a grpc_ssl_server_certificate_config object."]
+ #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
+ #[doc = "the client root certificates. This parameter may be NULL if the server does"]
+ #[doc = "not want the client to be authenticated with SSL."]
+ #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
+ #[doc = "server. This parameter cannot be NULL."]
+ #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
+ #[doc = "and cert_chain_files parameters. It must be at least 1."]
+ #[doc = "- It is the caller's responsibility to free this object via"]
+ #[doc = "grpc_ssl_server_certificate_config_destroy()."]
+ pub fn grpc_ssl_server_certificate_config_create(
+ pem_root_certs: *const ::std::os::raw::c_char,
+ pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair,
+ num_key_cert_pairs: usize,
+ ) -> *mut grpc_ssl_server_certificate_config;
+}
+extern "C" {
+ #[doc = " Destroys a grpc_ssl_server_certificate_config object."]
+ pub fn grpc_ssl_server_certificate_config_destroy(
+ config: *mut grpc_ssl_server_certificate_config,
+ );
+}
+#[doc = " Callback to retrieve updated SSL server certificates, private keys, and"]
+#[doc = "trusted CAs (for client authentication)."]
+#[doc = "- user_data parameter, if not NULL, contains opaque data to be used by the"]
+#[doc = "callback."]
+#[doc = "- Use grpc_ssl_server_certificate_config_create to create the config."]
+#[doc = "- The caller assumes ownership of the config."]
+pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ config: *mut *mut grpc_ssl_server_certificate_config,
+ ) -> grpc_ssl_certificate_config_reload_status,
+>;
+extern "C" {
+ #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex."]
+ #[doc = "Creates an SSL server_credentials object."]
+ #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
+ #[doc = "the client root certificates. This parameter may be NULL if the server does"]
+ #[doc = "not want the client to be authenticated with SSL."]
+ #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
+ #[doc = "server. This parameter cannot be NULL."]
+ #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
+ #[doc = "and cert_chain_files parameters. It should be at least 1."]
+ #[doc = "- force_client_auth, if set to non-zero will force the client to authenticate"]
+ #[doc = "with an SSL cert. Note that this option is ignored if pem_root_certs is"]
+ #[doc = "NULL."]
+ pub fn grpc_ssl_server_credentials_create(
+ pem_root_certs: *const ::std::os::raw::c_char,
+ pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
+ num_key_cert_pairs: usize,
+ force_client_auth: ::std::os::raw::c_int,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_server_credentials;
+}
+extern "C" {
+ #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options."]
+ #[doc = "Same as grpc_ssl_server_credentials_create method except uses"]
+ #[doc = "grpc_ssl_client_certificate_request_type enum to support more ways to"]
+ #[doc = "authenticate client certificates."]
+ pub fn grpc_ssl_server_credentials_create_ex(
+ pem_root_certs: *const ::std::os::raw::c_char,
+ pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
+ num_key_cert_pairs: usize,
+ client_certificate_request: grpc_ssl_client_certificate_request_type,
+ reserved: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_server_credentials;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_ssl_server_credentials_options {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " Creates an options object using a certificate config. Use this method when"]
+ #[doc = "the certificates and keys of the SSL server will not change during the"]
+ #[doc = "server's lifetime."]
+ #[doc = "- Takes ownership of the certificate_config parameter."]
+ pub fn grpc_ssl_server_credentials_create_options_using_config(
+ client_certificate_request: grpc_ssl_client_certificate_request_type,
+ certificate_config: *mut grpc_ssl_server_certificate_config,
+ ) -> *mut grpc_ssl_server_credentials_options;
+}
+extern "C" {
+ #[doc = " Creates an options object using a certificate config fetcher. Use this"]
+ #[doc = "method to reload the certificates and keys of the SSL server without"]
+ #[doc = "interrupting the operation of the server. Initial certificate config will be"]
+ #[doc = "fetched during server initialization."]
+ #[doc = "- user_data parameter, if not NULL, contains opaque data which will be passed"]
+ #[doc = "to the fetcher (see definition of"]
+ #[doc = "grpc_ssl_server_certificate_config_callback)."]
+ pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher(
+ client_certificate_request: grpc_ssl_client_certificate_request_type,
+ cb: grpc_ssl_server_certificate_config_callback,
+ user_data: *mut ::std::os::raw::c_void,
+ ) -> *mut grpc_ssl_server_credentials_options;
+}
+extern "C" {
+ #[doc = " Destroys a grpc_ssl_server_credentials_options object."]
+ pub fn grpc_ssl_server_credentials_options_destroy(
+ options: *mut grpc_ssl_server_credentials_options,
+ );
+}
+extern "C" {
+ #[doc = " Creates an SSL server_credentials object using the provided options struct."]
+ #[doc = "- Takes ownership of the options parameter."]
+ pub fn grpc_ssl_server_credentials_create_with_options(
+ options: *mut grpc_ssl_server_credentials_options,
+ ) -> *mut grpc_server_credentials;
+}
+extern "C" {
+ #[doc = " Sets a credentials to a call. Can only be called on the client side before"]
+ #[doc = "grpc_call_start_batch."]
+ pub fn grpc_call_set_credentials(
+ call: *mut grpc_call,
+ creds: *mut grpc_call_credentials,
+ ) -> grpc_call_error;
+}
+#[doc = " Callback function that is called when the metadata processing is done."]
+#[doc = "- Consumed metadata will be removed from the set of metadata available on the"]
+#[doc = "call. consumed_md may be NULL if no metadata has been consumed."]
+#[doc = "- Response metadata will be set on the response. response_md may be NULL."]
+#[doc = "- status is GRPC_STATUS_OK for success or a specific status for an error."]
+#[doc = "Common error status for auth metadata processing is either"]
+#[doc = "GRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or"]
+#[doc = "GRPC_STATUS PERMISSION_DENIED in case of an authorization failure."]
+#[doc = "- error_details gives details about the error. May be NULL."]
+pub type grpc_process_auth_metadata_done_cb = ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ consumed_md: *const grpc_metadata,
+ num_consumed_md: usize,
+ response_md: *const grpc_metadata,
+ num_response_md: usize,
+ status: grpc_status_code::Type,
+ error_details: *const ::std::os::raw::c_char,
+ ),
+>;
+#[doc = " Pluggable server-side metadata processor object."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_auth_metadata_processor {
+ #[doc = " The context object is read/write: it contains the properties of the"]
+ #[doc = "channel peer and it is the job of the process function to augment it with"]
+ #[doc = "properties derived from the passed-in metadata."]
+ #[doc = "The lifetime of these objects is guaranteed until cb is invoked."]
+ pub process: ::std::option::Option<
+ unsafe extern "C" fn(
+ state: *mut ::std::os::raw::c_void,
+ context: *mut grpc_auth_context,
+ md: *const grpc_metadata,
+ num_md: usize,
+ cb: grpc_process_auth_metadata_done_cb,
+ user_data: *mut ::std::os::raw::c_void,
+ ),
+ >,
+ pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
+ pub state: *mut ::std::os::raw::c_void,
+}
+extern "C" {
+ pub fn grpc_server_credentials_set_auth_metadata_processor(
+ creds: *mut grpc_server_credentials,
+ processor: grpc_auth_metadata_processor,
+ );
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_alts_credentials_options {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " This method creates a grpc ALTS credentials client options instance."]
+ #[doc = " It is used for experimental purpose for now and subject to change."]
+ pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options;
+}
+extern "C" {
+ #[doc = " This method creates a grpc ALTS credentials server options instance."]
+ #[doc = " It is used for experimental purpose for now and subject to change."]
+ pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options;
+}
+extern "C" {
+ #[doc = " This method adds a target service account to grpc client's ALTS credentials"]
+ #[doc = " options instance. It is used for experimental purpose for now and subject"]
+ #[doc = " to change."]
+ #[doc = ""]
+ #[doc = " - options: grpc ALTS credentials options instance."]
+ #[doc = " - service_account: service account of target endpoint."]
+ pub fn grpc_alts_credentials_client_options_add_target_service_account(
+ options: *mut grpc_alts_credentials_options,
+ service_account: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " This method destroys a grpc_alts_credentials_options instance by"]
+ #[doc = " de-allocating all of its occupied memory. It is used for experimental purpose"]
+ #[doc = " for now and subject to change."]
+ #[doc = ""]
+ #[doc = " - options: a grpc_alts_credentials_options instance that needs to be"]
+ #[doc = " destroyed."]
+ pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options);
+}
+extern "C" {
+ #[doc = " This method creates an ALTS channel credential object. The security"]
+ #[doc = " level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
+ #[doc = " It is used for experimental purpose for now and subject to change."]
+ #[doc = ""]
+ #[doc = " - options: grpc ALTS credentials options instance for client."]
+ #[doc = ""]
+ #[doc = " It returns the created ALTS channel credential object."]
+ pub fn grpc_alts_credentials_create(
+ options: *const grpc_alts_credentials_options,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " This method creates an ALTS server credential object. It is used for"]
+ #[doc = " experimental purpose for now and subject to change."]
+ #[doc = ""]
+ #[doc = " - options: grpc ALTS credentials options instance for server."]
+ #[doc = ""]
+ #[doc = " It returns the created ALTS server credential object."]
+ pub fn grpc_alts_server_credentials_create(
+ options: *const grpc_alts_credentials_options,
+ ) -> *mut grpc_server_credentials;
+}
+extern "C" {
+ #[doc = " This method creates a local channel credential object. The security level"]
+ #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and"]
+ #[doc = " GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose"]
+ #[doc = " for now and subject to change."]
+ #[doc = ""]
+ #[doc = " - type: local connection type"]
+ #[doc = ""]
+ #[doc = " It returns the created local channel credential object."]
+ pub fn grpc_local_credentials_create(
+ type_: grpc_local_connect_type,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " This method creates a local server credential object. It is used for"]
+ #[doc = " experimental purpose for now and subject to change."]
+ #[doc = ""]
+ #[doc = " - type: local connection type"]
+ #[doc = ""]
+ #[doc = " It returns the created local server credential object."]
+ pub fn grpc_local_server_credentials_create(
+ type_: grpc_local_connect_type,
+ ) -> *mut grpc_server_credentials;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_credentials_options {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_certificate_provider {
+ _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_identity_pairs {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates a grpc_tls_identity_pairs that stores a list of identity credential"]
+ #[doc = " data, including identity private key and identity certificate chain."]
+ pub fn grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Adds a identity private key and a identity certificate chain to"]
+ #[doc = " grpc_tls_identity_pairs. This function will make an internal copy of"]
+ #[doc = " |private_key| and |cert_chain|."]
+ pub fn grpc_tls_identity_pairs_add_pair(
+ pairs: *mut grpc_tls_identity_pairs,
+ private_key: *const ::std::os::raw::c_char,
+ cert_chain: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Destroys a grpc_tls_identity_pairs object. If this object is passed to a"]
+ #[doc = " provider initiation function, the ownership is transferred so this function"]
+ #[doc = " doesn't need to be called. Otherwise the creator of the"]
+ #[doc = " grpc_tls_identity_pairs object is responsible for its destruction."]
+ pub fn grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates a grpc_tls_certificate_provider that will load credential data from"]
+ #[doc = " static string during initialization. This provider will always return the"]
+ #[doc = " same cert data for all cert names."]
+ #[doc = " root_certificate and pem_key_cert_pairs can be nullptr, indicating the"]
+ #[doc = " corresponding credential data is not needed."]
+ #[doc = " This function will make a copy of |root_certificate|."]
+ #[doc = " The ownership of |pem_key_cert_pairs| is transferred."]
+ pub fn grpc_tls_certificate_provider_static_data_create(
+ root_certificate: *const ::std::os::raw::c_char,
+ pem_key_cert_pairs: *mut grpc_tls_identity_pairs,
+ ) -> *mut grpc_tls_certificate_provider;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates a grpc_tls_certificate_provider that will watch the credential"]
+ #[doc = " changes on the file system. This provider will always return the up-to-date"]
+ #[doc = " cert data for all the cert names callers set through"]
+ #[doc = " |grpc_tls_credentials_options|. Note that this API only supports one key-cert"]
+ #[doc = " file and hence one set of identity key-cert pair, so SNI(Server Name"]
+ #[doc = " Indication) is not supported."]
+ #[doc = " - private_key_path is the file path of the private key. This must be set if"]
+ #[doc = " |identity_certificate_path| is set. Otherwise, it could be null if no"]
+ #[doc = " identity credentials are needed."]
+ #[doc = " - identity_certificate_path is the file path of the identity certificate"]
+ #[doc = " chain. This must be set if |private_key_path| is set. Otherwise, it could"]
+ #[doc = " be null if no identity credentials are needed."]
+ #[doc = " - root_cert_path is the file path to the root certificate bundle. This"]
+ #[doc = " may be null if no root certs are needed."]
+ #[doc = " - refresh_interval_sec is the refreshing interval that we will check the"]
+ #[doc = " files for updates."]
+ #[doc = " It does not take ownership of parameters."]
+ pub fn grpc_tls_certificate_provider_file_watcher_create(
+ private_key_path: *const ::std::os::raw::c_char,
+ identity_certificate_path: *const ::std::os::raw::c_char,
+ root_cert_path: *const ::std::os::raw::c_char,
+ refresh_interval_sec: ::std::os::raw::c_uint,
+ ) -> *mut grpc_tls_certificate_provider;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Releases a grpc_tls_certificate_provider object. The creator of the"]
+ #[doc = " grpc_tls_certificate_provider object is responsible for its release."]
+ pub fn grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates an grpc_tls_credentials_options."]
+ pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the credential provider in the options."]
+ #[doc = " The |options| will implicitly take a new ref to the |provider|."]
+ pub fn grpc_tls_credentials_options_set_certificate_provider(
+ options: *mut grpc_tls_credentials_options,
+ provider: *mut grpc_tls_certificate_provider,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " If set, gRPC stack will keep watching the root certificates with"]
+ #[doc = " name |root_cert_name|."]
+ #[doc = " If this is not set on the client side, we will use the root certificates"]
+ #[doc = " stored in the default system location, since client side must provide root"]
+ #[doc = " certificates in TLS."]
+ #[doc = " If this is not set on the server side, we will not watch any root certificate"]
+ #[doc = " updates, and assume no root certificates needed for the server(single-side"]
+ #[doc = " TLS). Default root certs on the server side is not supported."]
+ pub fn grpc_tls_credentials_options_watch_root_certs(
+ options: *mut grpc_tls_credentials_options,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the name of the root certificates being watched."]
+ #[doc = " If not set, We will use a default empty string as the root certificate name."]
+ pub fn grpc_tls_credentials_options_set_root_cert_name(
+ options: *mut grpc_tls_credentials_options,
+ root_cert_name: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " If set, gRPC stack will keep watching the identity key-cert pairs"]
+ #[doc = " with name |identity_cert_name|."]
+ #[doc = " This is required on the server side, and optional on the client side."]
+ pub fn grpc_tls_credentials_options_watch_identity_key_cert_pairs(
+ options: *mut grpc_tls_credentials_options,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the name of the identity certificates being watched."]
+ #[doc = " If not set, We will use a default empty string as the identity certificate"]
+ #[doc = " name."]
+ pub fn grpc_tls_credentials_options_set_identity_cert_name(
+ options: *mut grpc_tls_credentials_options,
+ identity_cert_name: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the options of whether to request and/or verify client certs. This shall"]
+ #[doc = " only be called on the server side."]
+ pub fn grpc_tls_credentials_options_set_cert_request_type(
+ options: *mut grpc_tls_credentials_options,
+ type_: grpc_ssl_client_certificate_request_type,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " If set, gRPC will read all hashed x.509 CRL files in the directory and"]
+ #[doc = " enforce the CRL files on all TLS handshakes. Only supported for OpenSSL"]
+ #[doc = " version > 1.1."]
+ #[doc = " It is used for experimental purpose for now and subject to change."]
+ pub fn grpc_tls_credentials_options_set_crl_directory(
+ options: *mut grpc_tls_credentials_options,
+ crl_directory: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the options of whether to verify server certs on the client side."]
+ #[doc = " Passing in a non-zero value indicates verifying the certs."]
+ pub fn grpc_tls_credentials_options_set_verify_server_cert(
+ options: *mut grpc_tls_credentials_options,
+ verify_server_cert: ::std::os::raw::c_int,
+ );
+}
+#[doc = " EXPERIMENTAL API - Subject to change"]
+#[doc = ""]
+#[doc = " The read-only request information exposed in a verification call."]
+#[doc = " Callers should not directly manage the ownership of it. We will make sure it"]
+#[doc = " is always available inside verify() or cancel() call, and will destroy the"]
+#[doc = " object at the end of custom verification."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_custom_verification_check_request {
+ pub target_name: *const ::std::os::raw::c_char,
+ pub peer_info: grpc_tls_custom_verification_check_request_peer_info,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_custom_verification_check_request_peer_info {
+ pub common_name: *const ::std::os::raw::c_char,
+ pub san_names: grpc_tls_custom_verification_check_request_peer_info_san_names,
+ pub peer_cert: *const ::std::os::raw::c_char,
+ pub peer_cert_full_chain: *const ::std::os::raw::c_char,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_custom_verification_check_request_peer_info_san_names {
+ pub uri_names: *mut *mut ::std::os::raw::c_char,
+ pub uri_names_size: usize,
+ pub dns_names: *mut *mut ::std::os::raw::c_char,
+ pub dns_names_size: usize,
+ pub email_names: *mut *mut ::std::os::raw::c_char,
+ pub email_names_size: usize,
+ pub ip_names: *mut *mut ::std::os::raw::c_char,
+ pub ip_names_size: usize,
+}
+#[doc = " EXPERIMENTAL API - Subject to change"]
+#[doc = ""]
+#[doc = " A callback function provided by gRPC as a parameter of the |verify| function"]
+#[doc = " in grpc_tls_certificate_verifier_external. If |verify| is expected to be run"]
+#[doc = " asynchronously, the implementer of |verify| will need to invoke this callback"]
+#[doc = " with |callback_arg| and proper verification status at the end to bring the"]
+#[doc = " control back to gRPC C core."]
+pub type grpc_tls_on_custom_verification_check_done_cb = ::std::option::Option<
+ unsafe extern "C" fn(
+ request: *mut grpc_tls_custom_verification_check_request,
+ callback_arg: *mut ::std::os::raw::c_void,
+ status: grpc_status_code::Type,
+ error_details: *const ::std::os::raw::c_char,
+ ),
+>;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_certificate_verifier {
+ _unused: [u8; 0],
+}
+#[doc = " EXPERIMENTAL API - Subject to change"]
+#[doc = ""]
+#[doc = " A struct containing all the necessary functions a custom external verifier"]
+#[doc = " needs to implement to be able to be converted to an internal verifier."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_tls_certificate_verifier_external {
+ pub user_data: *mut ::std::os::raw::c_void,
+ #[doc = " A function pointer containing the verification logic that will be"]
+ #[doc = " performed after the TLS handshake is done. It could be processed"]
+ #[doc = " synchronously or asynchronously."]
+ #[doc = " - If expected to be processed synchronously, the implementer should"]
+ #[doc = " populate the verification result through |sync_status| and"]
+ #[doc = " |sync_error_details|, and then return true."]
+ #[doc = " - If expected to be processed asynchronously, the implementer should return"]
+ #[doc = " false immediately, and then in the asynchronous thread invoke |callback|"]
+ #[doc = " with the verification result. The implementer MUST NOT invoke the async"]
+ #[doc = " |callback| in the same thread before |verify| returns, otherwise it can"]
+ #[doc = " lead to deadlocks."]
+ #[doc = ""]
+ #[doc = " user_data: any argument that is passed in the user_data of"]
+ #[doc = " grpc_tls_certificate_verifier_external during construction time"]
+ #[doc = " can be retrieved later here."]
+ #[doc = " request: request information exposed to the function implementer."]
+ #[doc = " callback: the callback that the function implementer needs to invoke, if"]
+ #[doc = " return a non-zero value. It is usually invoked when the"]
+ #[doc = " asynchronous verification is done, and serves to bring the"]
+ #[doc = " control back to gRPC."]
+ #[doc = " callback_arg: A pointer to the internal ExternalVerifier instance. This is"]
+ #[doc = " mainly used as an argument in |callback|, if want to invoke"]
+ #[doc = " |callback| in async mode."]
+ #[doc = " sync_status: indicates if a connection should be allowed. This should only"]
+ #[doc = " be used if the verification check is done synchronously."]
+ #[doc = " sync_error_details: the error generated while verifying a connection. This"]
+ #[doc = " should only be used if the verification check is done"]
+ #[doc = " synchronously. the implementation must allocate the"]
+ #[doc = " error string via gpr_malloc() or gpr_strdup()."]
+ #[doc = " return: return 0 if |verify| is expected to be executed asynchronously,"]
+ #[doc = " otherwise return a non-zero value."]
+ pub verify: ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ request: *mut grpc_tls_custom_verification_check_request,
+ callback: grpc_tls_on_custom_verification_check_done_cb,
+ callback_arg: *mut ::std::os::raw::c_void,
+ sync_status: *mut grpc_status_code::Type,
+ sync_error_details: *mut *mut ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int,
+ >,
+ #[doc = " A function pointer that cleans up the caller-specified resources when the"]
+ #[doc = " verifier is still running but the whole connection got cancelled. This"]
+ #[doc = " could happen when the verifier is doing some async operations, and the"]
+ #[doc = " whole handshaker object got destroyed because of connection time limit is"]
+ #[doc = " reached, or any other reasons. In such cases, function implementers might"]
+ #[doc = " want to be notified, and properly clean up some resources."]
+ #[doc = ""]
+ #[doc = " user_data: any argument that is passed in the user_data of"]
+ #[doc = " grpc_tls_certificate_verifier_external during construction time"]
+ #[doc = " can be retrieved later here."]
+ #[doc = " request: request information exposed to the function implementer. It will"]
+ #[doc = " be the same request object that was passed to verify(), and it"]
+ #[doc = " tells the cancel() which request to cancel."]
+ pub cancel: ::std::option::Option<
+ unsafe extern "C" fn(
+ user_data: *mut ::std::os::raw::c_void,
+ request: *mut grpc_tls_custom_verification_check_request,
+ ),
+ >,
+ #[doc = " A function pointer that does some additional destruction work when the"]
+ #[doc = " verifier is destroyed. This is used when the caller wants to associate some"]
+ #[doc = " objects to the lifetime of external_verifier, and destroy them when"]
+ #[doc = " external_verifier got destructed. For example, in C++, the class containing"]
+ #[doc = " user-specified callback functions should not be destroyed before"]
+ #[doc = " external_verifier, since external_verifier will invoke them while being"]
+ #[doc = " used."]
+ #[doc = " Note that the caller MUST delete the grpc_tls_certificate_verifier_external"]
+ #[doc = " object itself in this function, otherwise it will cause memory leaks. That"]
+ #[doc = " also means the user_data has to carries at least a self pointer, for the"]
+ #[doc = " callers to later delete it in destruct()."]
+ #[doc = ""]
+ #[doc = " user_data: any argument that is passed in the user_data of"]
+ #[doc = " grpc_tls_certificate_verifier_external during construction time"]
+ #[doc = " can be retrieved later here."]
+ pub destruct:
+ ::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>,
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Converts an external verifier to an internal verifier."]
+ #[doc = " Note that we will not take the ownership of the external_verifier. Callers"]
+ #[doc = " will need to delete external_verifier in its own destruct function."]
+ pub fn grpc_tls_certificate_verifier_external_create(
+ external_verifier: *mut grpc_tls_certificate_verifier_external,
+ ) -> *mut grpc_tls_certificate_verifier;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Factory function for an internal verifier that will do the default hostname"]
+ #[doc = " check."]
+ pub fn grpc_tls_certificate_verifier_host_name_create() -> *mut grpc_tls_certificate_verifier;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Releases a grpc_tls_certificate_verifier object. The creator of the"]
+ #[doc = " grpc_tls_certificate_verifier object is responsible for its release."]
+ pub fn grpc_tls_certificate_verifier_release(verifier: *mut grpc_tls_certificate_verifier);
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the verifier in options. The |options| will implicitly take a new ref to"]
+ #[doc = " the |verifier|. If not set on the client side, we will verify server's"]
+ #[doc = " certificates, and check the default hostname. If not set on the server side,"]
+ #[doc = " we will verify client's certificates."]
+ pub fn grpc_tls_credentials_options_set_certificate_verifier(
+ options: *mut grpc_tls_credentials_options,
+ verifier: *mut grpc_tls_certificate_verifier,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Sets the options of whether to check the hostname of the peer on a per-call"]
+ #[doc = " basis. This is usually used in a combination with virtual hosting at the"]
+ #[doc = " client side, where each individual call on a channel can have a different"]
+ #[doc = " host associated with it."]
+ #[doc = " This check is intended to verify that the host specified for the individual"]
+ #[doc = " call is covered by the cert that the peer presented."]
+ #[doc = " The default is a non-zero value, which indicates performing such checks."]
+ pub fn grpc_tls_credentials_options_set_check_call_host(
+ options: *mut grpc_tls_credentials_options,
+ check_call_host: ::std::os::raw::c_int,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Performs the verification logic of an internal verifier."]
+ #[doc = " This is typically used when composing the internal verifiers as part of the"]
+ #[doc = " custom verification."]
+ #[doc = " If |grpc_tls_certificate_verifier_verify| returns true, inspect the"]
+ #[doc = " verification result through request->status and request->error_details."]
+ #[doc = " Otherwise, inspect through the parameter of |callback|."]
+ pub fn grpc_tls_certificate_verifier_verify(
+ verifier: *mut grpc_tls_certificate_verifier,
+ request: *mut grpc_tls_custom_verification_check_request,
+ callback: grpc_tls_on_custom_verification_check_done_cb,
+ callback_arg: *mut ::std::os::raw::c_void,
+ sync_status: *mut grpc_status_code::Type,
+ sync_error_details: *mut *mut ::std::os::raw::c_char,
+ ) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Performs the cancellation logic of an internal verifier."]
+ #[doc = " This is typically used when composing the internal verifiers as part of the"]
+ #[doc = " custom verification."]
+ pub fn grpc_tls_certificate_verifier_cancel(
+ verifier: *mut grpc_tls_certificate_verifier,
+ request: *mut grpc_tls_custom_verification_check_request,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates a TLS channel credential object based on the"]
+ #[doc = " grpc_tls_credentials_options specified by callers. The"]
+ #[doc = " grpc_channel_credentials will take the ownership of the |options|. The"]
+ #[doc = " security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
+ pub fn grpc_tls_credentials_create(
+ options: *mut grpc_tls_credentials_options,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " Creates a TLS server credential object based on the"]
+ #[doc = " grpc_tls_credentials_options specified by callers. The"]
+ #[doc = " grpc_server_credentials will take the ownership of the |options|."]
+ pub fn grpc_tls_server_credentials_create(
+ options: *mut grpc_tls_credentials_options,
+ ) -> *mut grpc_server_credentials;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " This method creates an insecure channel credentials object."]
+ pub fn grpc_insecure_credentials_create() -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " This method creates an insecure server credentials object."]
+ pub fn grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " This method creates an xDS channel credentials object."]
+ #[doc = ""]
+ #[doc = " Creating a channel with credentials of this type indicates that the channel"]
+ #[doc = " should get credentials configuration from the xDS control plane."]
+ #[doc = ""]
+ #[doc = " \\a fallback_credentials are used if the channel target does not have the"]
+ #[doc = " 'xds:///' scheme or if the xDS control plane does not provide information on"]
+ #[doc = " how to fetch credentials dynamically. Does NOT take ownership of the \\a"]
+ #[doc = " fallback_credentials. (Internally takes a ref to the object.)"]
+ pub fn grpc_xds_credentials_create(
+ fallback_credentials: *mut grpc_channel_credentials,
+ ) -> *mut grpc_channel_credentials;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change"]
+ #[doc = ""]
+ #[doc = " This method creates an xDS server credentials object."]
+ #[doc = ""]
+ #[doc = " \\a fallback_credentials are used if the xDS control plane does not provide"]
+ #[doc = " information on how to fetch credentials dynamically."]
+ #[doc = ""]
+ #[doc = " Does NOT take ownership of the \\a fallback_credentials. (Internally takes"]
+ #[doc = " a ref to the object.)"]
+ pub fn grpc_xds_server_credentials_create(
+ fallback_credentials: *mut grpc_server_credentials,
+ ) -> *mut grpc_server_credentials;
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpc_authorization_policy_provider {
+ _unused: [u8; 0],
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL - Subject to change."]
+ #[doc = " Creates a grpc_authorization_policy_provider using gRPC authorization policy"]
+ #[doc = " from static string."]
+ #[doc = " - authz_policy is the input gRPC authorization policy."]
+ #[doc = " - code is the error status code on failure. On success, it equals"]
+ #[doc = " GRPC_STATUS_OK."]
+ #[doc = " - error_details contains details about the error if any. If the"]
+ #[doc = " initialization is successful, it will be null. Caller must use gpr_free to"]
+ #[doc = " destroy this string."]
+ pub fn grpc_authorization_policy_provider_static_data_create(
+ authz_policy: *const ::std::os::raw::c_char,
+ code: *mut grpc_status_code::Type,
+ error_details: *mut *const ::std::os::raw::c_char,
+ ) -> *mut grpc_authorization_policy_provider;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL - Subject to change."]
+ #[doc = " Creates a grpc_authorization_policy_provider by watching for gRPC"]
+ #[doc = " authorization policy changes in filesystem."]
+ #[doc = " - authz_policy is the file path of gRPC authorization policy."]
+ #[doc = " - refresh_interval_sec is the amount of time the internal thread would wait"]
+ #[doc = " before checking for file updates."]
+ #[doc = " - code is the error status code on failure. On success, it equals"]
+ #[doc = " GRPC_STATUS_OK."]
+ #[doc = " - error_details contains details about the error if any. If the"]
+ #[doc = " initialization is successful, it will be null. Caller must use gpr_free to"]
+ #[doc = " destroy this string."]
+ pub fn grpc_authorization_policy_provider_file_watcher_create(
+ authz_policy_path: *const ::std::os::raw::c_char,
+ refresh_interval_sec: ::std::os::raw::c_uint,
+ code: *mut grpc_status_code::Type,
+ error_details: *mut *const ::std::os::raw::c_char,
+ ) -> *mut grpc_authorization_policy_provider;
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL - Subject to change."]
+ #[doc = " Releases grpc_authorization_policy_provider object. The creator of"]
+ #[doc = " grpc_authorization_policy_provider is responsible for its release."]
+ pub fn grpc_authorization_policy_provider_release(
+ provider: *mut grpc_authorization_policy_provider,
+ );
+}
+extern "C" {
+ #[doc = " EXPERIMENTAL API - Subject to change."]
+ #[doc = " Configures a grpc_tls_credentials_options object with tls session key"]
+ #[doc = " logging capability. TLS channels using these credentials have tls session"]
+ #[doc = " key logging enabled."]
+ #[doc = " - options is the grpc_tls_credentials_options object"]
+ #[doc = " - path is a string pointing to the location where TLS session keys would be"]
+ #[doc = " stored."]
+ pub fn grpc_tls_credentials_options_set_tls_session_key_log_file_path(
+ options: *mut grpc_tls_credentials_options,
+ path: *const ::std::os::raw::c_char,
+ );
+}
+#[repr(u32)]
+#[doc = " The severity of a log message - use the #defines below when calling into"]
+#[doc = "gpr_log to additionally supply file and line data"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum gpr_log_severity {
+ GPR_LOG_SEVERITY_DEBUG = 0,
+ GPR_LOG_SEVERITY_INFO = 1,
+ GPR_LOG_SEVERITY_ERROR = 2,
+}
+extern "C" {
+ #[doc = " Returns a string representation of the log severity"]
+ pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context"]
+ #[doc = " for each message"]
+ pub fn gpr_log(
+ file: *const ::std::os::raw::c_char,
+ line: ::std::os::raw::c_int,
+ severity: gpr_log_severity,
+ format: *const ::std::os::raw::c_char,
+ ...
+ );
+}
+extern "C" {
+ pub fn gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int;
+}
+extern "C" {
+ pub fn gpr_log_message(
+ file: *const ::std::os::raw::c_char,
+ line: ::std::os::raw::c_int,
+ severity: gpr_log_severity,
+ message: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ #[doc = " Set global log verbosity"]
+ pub fn gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity);
+}
+extern "C" {
+ pub fn gpr_log_verbosity_init();
+}
+#[doc = " Log overrides: applications can use this API to intercept logging calls"]
+#[doc = "and use their own implementations"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct gpr_log_func_args {
+ pub file: *const ::std::os::raw::c_char,
+ pub line: ::std::os::raw::c_int,
+ pub severity: gpr_log_severity,
+ pub message: *const ::std::os::raw::c_char,
+}
+pub type gpr_log_func = ::std::option::Option<unsafe extern "C" fn(args: *mut gpr_log_func_args)>;
+extern "C" {
+ pub fn gpr_set_log_function(func: gpr_log_func);
+}
+extern "C" {
+ #[doc = " malloc."]
+ #[doc = " If size==0, always returns NULL. Otherwise this function never returns NULL."]
+ #[doc = " The pointer returned is suitably aligned for any kind of variable it could"]
+ #[doc = " contain."]
+ pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " like malloc, but zero all bytes before returning them"]
+ pub fn gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " free"]
+ pub fn gpr_free(ptr: *mut ::std::os::raw::c_void);
+}
+extern "C" {
+ #[doc = " realloc, never returns NULL"]
+ pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " aligned malloc, never returns NULL, will align to alignment, which"]
+ #[doc = " must be a power of 2."]
+ pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void;
+}
+extern "C" {
+ #[doc = " free memory allocated by gpr_malloc_aligned"]
+ pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void);
+}
+extern "C" {
+ #[doc = " Return the number of CPU cores on the current system. Will return 0 if"]
+ #[doc = "the information is not available."]
+ pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint;
+}
+extern "C" {
+ #[doc = " Return the CPU on which the current thread is executing; N.B. This should"]
+ #[doc = "be considered advisory only - it is possible that the thread is switched"]
+ #[doc = "to a different CPU at any time. Returns a value in range"]
+ #[doc = "[0, gpr_cpu_num_cores() - 1]"]
+ pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint;
+}
+extern "C" {
+ #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8"]
+ #[doc = " formatted error message, corresponding to the error messageid."]
+ #[doc = " Use in conjunction with GetLastError() et al."]
+ pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " Returns a copy of src that can be passed to gpr_free()."]
+ #[doc = "If allocation fails or if src is NULL, returns NULL."]
+ pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
+}
+extern "C" {
+ #[doc = " printf to a newly-allocated string. The set of supported formats may vary"]
+ #[doc = "between platforms."]
+ #[doc = ""]
+ #[doc = "On success, returns the number of bytes printed (excluding the final '\\0'),"]
+ #[doc = "and *strp points to a string which must later be destroyed with gpr_free()."]
+ #[doc = ""]
+ #[doc = "On error, returns -1 and sets *strp to NULL. If the format string is bad,"]
+ #[doc = "the result is undefined."]
+ pub fn gpr_asprintf(
+ strp: *mut *mut ::std::os::raw::c_char,
+ format: *const ::std::os::raw::c_char,
+ ...
+ ) -> ::std::os::raw::c_int;
+}
+pub type gpr_thd_id = usize;
+extern "C" {
+ #[doc = " Returns the identifier of the current thread."]
+ pub fn gpr_thd_currentid() -> gpr_thd_id;
+}
+#[doc = " Reader for byte buffers. Iterates over slices in the byte buffer"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpc_byte_buffer_reader {
+ pub buffer_in: *mut grpc_byte_buffer,
+ pub buffer_out: *mut grpc_byte_buffer,
+ pub current: grpc_byte_buffer_reader_grpc_byte_buffer_reader_current,
+}
+#[doc = " Different current objects correspond to different types of byte buffers"]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
+ #[doc = " Index into a slice buffer's array of slices"]
+ pub index: ::std::os::raw::c_uint,
+}
+impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}"
+ )
+ }
+}
+impl ::std::fmt::Debug for grpc_byte_buffer_reader {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write!(
+ f,
+ "grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}",
+ self.buffer_in, self.buffer_out, self.current
+ )
+ }
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpcwrap_batch_context {
+ pub send_initial_metadata: grpc_metadata_array,
+ pub send_message: *mut grpc_byte_buffer,
+ pub send_status_from_server: grpcwrap_batch_context__bindgen_ty_1,
+ pub recv_initial_metadata: grpc_metadata_array,
+ pub recv_message: *mut grpc_byte_buffer,
+ pub recv_status_on_client: grpcwrap_batch_context__bindgen_ty_2,
+ pub recv_close_on_server_cancelled: ::std::os::raw::c_int,
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct grpcwrap_batch_context__bindgen_ty_1 {
+ pub trailing_metadata: grpc_metadata_array,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpcwrap_batch_context__bindgen_ty_2 {
+ pub trailing_metadata: grpc_metadata_array,
+ pub status: grpc_status_code::Type,
+ pub status_details: grpc_slice,
+ pub error_string: *const ::std::os::raw::c_char,
+}
+impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?}, error_string: {:?} }}" , self . trailing_metadata , self . status , self . status_details , self . error_string)
+ }
+}
+impl ::std::fmt::Debug for grpcwrap_batch_context {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled)
+ }
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context;
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct grpcwrap_request_call_context {
+ pub call: *mut grpc_call,
+ pub call_details: grpc_call_details,
+ pub request_metadata: grpc_metadata_array,
+}
+impl ::std::fmt::Debug for grpcwrap_request_call_context {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata)
+ }
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context;
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_destroy_metadata_including_entries(
+ array: *mut grpc_metadata_array,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize);
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_add(
+ array: *mut grpc_metadata_array,
+ key: *const ::std::os::raw::c_char,
+ key_length: usize,
+ value: *const ::std::os::raw::c_char,
+ value_length: usize,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_get_key(
+ array: *const grpc_metadata_array,
+ index: usize,
+ key_length: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_get_value(
+ array: *const grpc_metadata_array,
+ index: usize,
+ value_length: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array);
+}
+extern "C" {
+ pub fn grpcwrap_metadata_array_move(
+ dest: *mut grpc_metadata_array,
+ src: *mut grpc_metadata_array,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context);
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context);
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_take_recv_initial_metadata(
+ ctx: *mut grpcwrap_batch_context,
+ res: *mut grpc_metadata_array,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_take_recv_status_on_client_trailing_metadata(
+ ctx: *mut grpcwrap_batch_context,
+ res: *mut grpc_metadata_array,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_slice_raw_offset(
+ slice: *const grpc_slice,
+ offset: usize,
+ len: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice;
+}
+extern "C" {
+ pub fn grpcwrap_slice_unref(slice: *const grpc_slice);
+}
+extern "C" {
+ pub fn grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice;
+}
+extern "C" {
+ pub fn grpcwrap_slice_length(slice: *const grpc_slice) -> usize;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_take_recv_message(
+ ctx: *mut grpcwrap_batch_context,
+ ) -> *mut grpc_byte_buffer;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_recv_status_on_client_status(
+ ctx: *const grpcwrap_batch_context,
+ ) -> grpc_status_code::Type;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_recv_status_on_client_details(
+ ctx: *const grpcwrap_batch_context,
+ details_length: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_recv_status_on_client_trailing_metadata(
+ ctx: *const grpcwrap_batch_context,
+ ) -> *const grpc_metadata_array;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_recv_status_on_client_error_string(
+ ctx: *const grpcwrap_batch_context,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_ref_call(
+ ctx: *mut grpcwrap_request_call_context,
+ ) -> *mut grpc_call;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_get_call(
+ ctx: *mut grpcwrap_request_call_context,
+ ) -> *mut grpc_call;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_method(
+ ctx: *const grpcwrap_request_call_context,
+ method_length: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_host(
+ ctx: *const grpcwrap_request_call_context,
+ host_length: *mut usize,
+ ) -> *const ::std::os::raw::c_char;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_deadline(
+ ctx: *const grpcwrap_request_call_context,
+ ) -> gpr_timespec;
+}
+extern "C" {
+ pub fn grpcwrap_request_call_context_metadata_array(
+ ctx: *const grpcwrap_request_call_context,
+ ) -> *const grpc_metadata_array;
+}
+extern "C" {
+ pub fn grpcwrap_batch_context_recv_close_on_server_cancelled(
+ ctx: *const grpcwrap_batch_context,
+ ) -> i32;
+}
+extern "C" {
+ pub fn grpcwrap_channel_create_call(
+ channel: *mut grpc_channel,
+ parent_call: *mut grpc_call,
+ propagation_mask: u32,
+ cq: *mut grpc_completion_queue,
+ method: *const ::std::os::raw::c_char,
+ method_len: usize,
+ host: *const ::std::os::raw::c_char,
+ host_len: usize,
+ deadline: gpr_timespec,
+ ) -> *mut grpc_call;
+}
+extern "C" {
+ pub fn grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args;
+}
+extern "C" {
+ pub fn grpcwrap_channel_args_set_string(
+ args: *mut grpc_channel_args,
+ index: usize,
+ key: *const ::std::os::raw::c_char,
+ value: *const ::std::os::raw::c_char,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_channel_args_set_integer(
+ args: *mut grpc_channel_args,
+ index: usize,
+ key: *const ::std::os::raw::c_char,
+ value: ::std::os::raw::c_int,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_channel_args_set_pointer_vtable(
+ args: *mut grpc_channel_args,
+ index: usize,
+ key: *const ::std::os::raw::c_char,
+ value: *mut ::std::os::raw::c_void,
+ vtable: *const grpc_arg_pointer_vtable,
+ );
+}
+extern "C" {
+ pub fn grpcwrap_channel_args_destroy(args: *mut grpc_channel_args);
+}
+extern "C" {
+ pub fn grpcwrap_call_start_unary(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ send_buffer: *mut grpc_slice,
+ write_flags: u32,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_start_client_streaming(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_start_server_streaming(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ send_buffer: *mut grpc_slice,
+ write_flags: u32,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_start_duplex_streaming(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_recv_initial_metadata(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_send_message(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ send_buffer: *mut grpc_slice,
+ write_flags: u32,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_send_close_from_client(
+ call: *mut grpc_call,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_send_status_from_server(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ status_code: grpc_status_code::Type,
+ status_details: *const ::std::os::raw::c_char,
+ status_details_len: usize,
+ initial_metadata: *mut grpc_metadata_array,
+ initial_metadata_flags: u32,
+ trailing_metadata: *mut grpc_metadata_array,
+ optional_send_buffer: *mut grpc_slice,
+ write_flags: u32,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_recv_message(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_start_serverside(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_call_send_initial_metadata(
+ call: *mut grpc_call,
+ ctx: *mut grpcwrap_batch_context,
+ initial_metadata: *mut grpc_metadata_array,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ #[doc = " Kick call's completion queue, it should be called after there is an event"]
+ #[doc = "ready to poll."]
+ #[doc = "THREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe"]
+ #[doc = "because it does not change the call's state."]
+ pub fn grpcwrap_call_kick_completion_queue(
+ call: *mut grpc_call,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
+extern "C" {
+ pub fn grpcwrap_server_request_call(
+ server: *mut grpc_server,
+ cq: *mut grpc_completion_queue,
+ ctx: *mut grpcwrap_request_call_context,
+ tag: *mut ::std::os::raw::c_void,
+ ) -> grpc_call_error;
+}
diff --git a/bindings/x86_64-unknown-linux-gnu-bindings.rs b/bindings/x86_64-unknown-linux-gnu-bindings.rs
deleted file mode 100644
index b24c0ee2..00000000
--- a/bindings/x86_64-unknown-linux-gnu-bindings.rs
+++ /dev/null
@@ -1,4059 +0,0 @@
-pub const GRPC_ARES: u32 = 1;
-pub const GRPC_IF_NAMETOINDEX: u32 = 1;
-pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1;
-pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &'static [u8; 31usize] =
- b"grpc-internal-encoding-request\0";
-pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &'static [u8; 35usize] =
- b"grpc.default_compression_algorithm\0";
-pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &'static [u8; 31usize] =
- b"grpc.default_compression_level\0";
-pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &'static [u8; 43usize] =
- b"grpc.compression_enabled_algorithms_bitset\0";
-pub const GRPC_ALLOW_GPR_SLICE_FUNCTIONS: u32 = 1;
-pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8;
-pub const GRPC_ARG_ENABLE_CENSUS: &'static [u8; 12usize] = b"grpc.census\0";
-pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &'static [u8; 19usize] = b"grpc.loadreporting\0";
-pub const GRPC_ARG_MINIMAL_STACK: &'static [u8; 19usize] = b"grpc.minimal_stack\0";
-pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &'static [u8; 28usize] =
- b"grpc.max_concurrent_streams\0";
-pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &'static [u8; 32usize] =
- b"grpc.max_receive_message_length\0";
-pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &'static [u8; 32usize] =
- b"grpc.max_receive_message_length\0";
-pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &'static [u8; 29usize] =
- b"grpc.max_send_message_length\0";
-pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &'static [u8; 28usize] =
- b"grpc.max_connection_idle_ms\0";
-pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &'static [u8; 27usize] = b"grpc.max_connection_age_ms\0";
-pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &'static [u8; 33usize] =
- b"grpc.max_connection_age_grace_ms\0";
-pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.client_idle_timeout_ms\0";
-pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &'static [u8; 29usize] =
- b"grpc.per_message_compression\0";
-pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &'static [u8; 31usize] =
- b"grpc.per_message_decompression\0";
-pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &'static [u8; 30usize] =
- b"grpc.enable_deadline_checking\0";
-pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &'static [u8; 35usize] =
- b"grpc.http2.initial_sequence_number\0";
-pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &'static [u8; 27usize] =
- b"grpc.http2.lookahead_bytes\0";
-pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &'static [u8; 36usize] =
- b"grpc.http2.hpack_table_size.decoder\0";
-pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &'static [u8; 36usize] =
- b"grpc.http2.hpack_table_size.encoder\0";
-pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &'static [u8; 26usize] = b"grpc.http2.max_frame_size\0";
-pub const GRPC_ARG_HTTP2_BDP_PROBE: &'static [u8; 21usize] = b"grpc.http2.bdp_probe\0";
-pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 37usize] =
- b"grpc.http2.min_time_between_pings_ms\0";
-pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 45usize] =
- b"grpc.http2.min_ping_interval_without_data_ms\0";
-pub const GRPC_ARG_HTTP2_SCHEME: &'static [u8; 18usize] = b"grpc.http2_scheme\0";
-pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &'static [u8; 34usize] =
- b"grpc.http2.max_pings_without_data\0";
-pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &'static [u8; 28usize] =
- b"grpc.http2.max_ping_strikes\0";
-pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &'static [u8; 29usize] =
- b"grpc.http2.write_buffer_size\0";
-pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &'static [u8; 23usize] = b"grpc.http2.true_binary\0";
-pub const GRPC_ARG_KEEPALIVE_TIME_MS: &'static [u8; 23usize] = b"grpc.keepalive_time_ms\0";
-pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &'static [u8; 26usize] = b"grpc.keepalive_timeout_ms\0";
-pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &'static [u8; 36usize] =
- b"grpc.keepalive_permit_without_calls\0";
-pub const GRPC_ARG_DEFAULT_AUTHORITY: &'static [u8; 23usize] = b"grpc.default_authority\0";
-pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &'static [u8; 24usize] = b"grpc.primary_user_agent\0";
-pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &'static [u8; 26usize] =
- b"grpc.secondary_user_agent\0";
-pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
- b"grpc.min_reconnect_backoff_ms\0";
-pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
- b"grpc.max_reconnect_backoff_ms\0";
-pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &'static [u8; 34usize] =
- b"grpc.initial_reconnect_backoff_ms\0";
-pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &'static [u8; 41usize] =
- b"grpc.dns_min_time_between_resolutions_ms\0";
-pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &'static [u8; 33usize] =
- b"grpc.server_handshake_timeout_ms\0";
-pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &'static [u8; 30usize] =
- b"grpc.ssl_target_name_override\0";
-pub const GRPC_SSL_SESSION_CACHE_ARG: &'static [u8; 23usize] = b"grpc.ssl_session_cache\0";
-pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &'static [u8; 24usize] = b"grpc.tsi.max_frame_size\0";
-pub const GRPC_ARG_MAX_METADATA_SIZE: &'static [u8; 23usize] = b"grpc.max_metadata_size\0";
-pub const GRPC_ARG_ALLOW_REUSEPORT: &'static [u8; 18usize] = b"grpc.so_reuseport\0";
-pub const GRPC_ARG_RESOURCE_QUOTA: &'static [u8; 20usize] = b"grpc.resource_quota\0";
-pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &'static [u8; 27usize] = b"grpc.expand_wildcard_addrs\0";
-pub const GRPC_ARG_SERVICE_CONFIG: &'static [u8; 20usize] = b"grpc.service_config\0";
-pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &'static [u8; 39usize] =
- b"grpc.service_config_disable_resolution\0";
-pub const GRPC_ARG_LB_POLICY_NAME: &'static [u8; 20usize] = b"grpc.lb_policy_name\0";
-pub const GRPC_ARG_SOCKET_MUTATOR: &'static [u8; 20usize] = b"grpc.socket_mutator\0";
-pub const GRPC_ARG_SOCKET_FACTORY: &'static [u8; 20usize] = b"grpc.socket_factory\0";
-pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &'static [u8; 45usize] =
- b"grpc.max_channel_trace_event_memory_per_node\0";
-pub const GRPC_ARG_ENABLE_CHANNELZ: &'static [u8; 21usize] = b"grpc.enable_channelz\0";
-pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &'static [u8; 34usize] =
- b"grpc.use_cronet_packet_coalescing\0";
-pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &'static [u8; 38usize] =
- b"grpc.experimental.tcp_read_chunk_size\0";
-pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192;
-pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_min_read_chunk_size\0";
-pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_max_read_chunk_size\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &'static [u8; 42usize] =
- b"grpc.experimental.tcp_tx_zerocopy_enabled\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &'static [u8; 55usize] =
- b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0";
-pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &'static [u8; 57usize] =
- b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0";
-pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.grpclb_call_timeout_ms\0";
-pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &'static [u8; 55usize] =
- b"grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config\0";
-pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &'static [u8; 32usize] =
- b"grpc.grpclb_fallback_timeout_ms\0";
-pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &'static [u8; 34usize] =
- b"grpc.priority_failover_timeout_ms\0";
-pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &'static [u8; 35usize] =
- b"grpc.workaround.cronet_compression\0";
-pub const GRPC_ARG_OPTIMIZATION_TARGET: &'static [u8; 25usize] = b"grpc.optimization_target\0";
-pub const GRPC_ARG_ENABLE_RETRIES: &'static [u8; 20usize] = b"grpc.enable_retries\0";
-pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &'static [u8; 31usize] =
- b"grpc.per_rpc_retry_buffer_size\0";
-pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &'static [u8; 24usize] = b"grpc.mobile_log_context\0";
-pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &'static [u8; 37usize] =
- b"grpc.disable_client_authority_filter\0";
-pub const GRPC_ARG_ENABLE_HTTP_PROXY: &'static [u8; 23usize] = b"grpc.enable_http_proxy\0";
-pub const GRPC_ARG_HTTP_PROXY: &'static [u8; 16usize] = b"grpc.http_proxy\0";
-pub const GRPC_ARG_SURFACE_USER_AGENT: &'static [u8; 24usize] = b"grpc.surface_user_agent\0";
-pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &'static [u8; 29usize] =
- b"grpc.inhibit_health_checking\0";
-pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &'static [u8; 28usize] =
- b"grpc.dns_enable_srv_queries\0";
-pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &'static [u8; 28usize] =
- b"grpc.dns_ares_query_timeout\0";
-pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &'static [u8; 31usize] =
- b"grpc.use_local_subchannel_pool\0";
-pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &'static [u8; 28usize] = b"grpc.channel_pooling_domain\0";
-pub const GRPC_ARG_CHANNEL_ID: &'static [u8; 16usize] = b"grpc.channel_id\0";
-pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1;
-pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304;
-pub const GRPC_WRITE_BUFFER_HINT: u32 = 1;
-pub const GRPC_WRITE_NO_COMPRESS: u32 = 2;
-pub const GRPC_WRITE_THROUGH: u32 = 4;
-pub const GRPC_WRITE_USED_MASK: u32 = 7;
-pub const GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST: u32 = 16;
-pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY: u32 = 32;
-pub const GRPC_INITIAL_METADATA_CACHEABLE_REQUEST: u32 = 64;
-pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET: u32 = 128;
-pub const GRPC_INITIAL_METADATA_CORKED: u32 = 256;
-pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 500;
-pub const GRPC_CQ_CURRENT_VERSION: u32 = 2;
-pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2;
-pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6;
-pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &'static [u8; 24usize] =
- b"transport_security_type\0";
-pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &'static [u8; 4usize] = b"ssl\0";
-pub const GRPC_X509_CN_PROPERTY_NAME: &'static [u8; 17usize] = b"x509_common_name\0";
-pub const GRPC_X509_SAN_PROPERTY_NAME: &'static [u8; 30usize] = b"x509_subject_alternative_name\0";
-pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &'static [u8; 14usize] = b"x509_pem_cert\0";
-pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &'static [u8; 20usize] = b"x509_pem_cert_chain\0";
-pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &'static [u8; 19usize] = b"ssl_session_reused\0";
-pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &'static [u8; 15usize] = b"security_level\0";
-pub const GRPC_PEER_DNS_PROPERTY_NAME: &'static [u8; 9usize] = b"peer_dns\0";
-pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &'static [u8; 15usize] = b"peer_spiffe_id\0";
-pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &'static [u8; 11usize] = b"peer_email\0";
-pub const GRPC_PEER_IP_PROPERTY_NAME: &'static [u8; 8usize] = b"peer_ip\0";
-pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &'static [u8; 33usize] =
- b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0";
-pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &'static [u8; 31usize] =
- b"GOOGLE_APPLICATION_CREDENTIALS\0";
-pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4;
-#[repr(u32)]
-#[doc = " The various compression algorithms supported by gRPC (not sorted by"]
-#[doc = " compression level)"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_compression_algorithm {
- GRPC_COMPRESS_NONE = 0,
- GRPC_COMPRESS_DEFLATE = 1,
- GRPC_COMPRESS_GZIP = 2,
- GRPC_COMPRESS_STREAM_GZIP = 3,
- GRPC_COMPRESS_ALGORITHMS_COUNT = 4,
-}
-#[repr(u32)]
-#[doc = " Compression levels allow a party with knowledge of its peer's accepted"]
-#[doc = " encodings to request compression in an abstract way. The level-algorithm"]
-#[doc = " mapping is performed internally and depends on the peer's supported"]
-#[doc = " compression algorithms."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_compression_level {
- GRPC_COMPRESS_LEVEL_NONE = 0,
- GRPC_COMPRESS_LEVEL_LOW = 1,
- GRPC_COMPRESS_LEVEL_MED = 2,
- GRPC_COMPRESS_LEVEL_HIGH = 3,
- GRPC_COMPRESS_LEVEL_COUNT = 4,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options {
- #[doc = " All algs are enabled by default. This option corresponds to the channel"]
- #[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"]
- pub enabled_algorithms_bitset: u32,
- pub default_level: grpc_compression_options_grpc_compression_options_default_level,
- pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm,
-}
-#[doc = " The default compression level. It'll be used in the absence of call"]
-#[doc = " specific settings. This option corresponds to the channel"]
-#[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,"]
-#[doc = " takes precedence over \\a default_algorithm."]
-#[doc = " TODO(dgq): currently only available for server channels."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options_grpc_compression_options_default_level {
- pub is_set: ::std::os::raw::c_int,
- pub level: grpc_compression_level,
-}
-#[doc = " The default message compression algorithm. It'll be used in the absence of"]
-#[doc = " call specific settings. This option corresponds to the channel argument key"]
-#[doc = " behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_compression_options_grpc_compression_options_default_algorithm {
- pub is_set: ::std::os::raw::c_int,
- pub algorithm: grpc_compression_algorithm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_refcount {
- _unused: [u8; 0],
-}
-#[doc = " A grpc_slice s, if initialized, represents the byte range"]
-#[doc = "s.bytes[0..s.length-1]."]
-#[doc = ""]
-#[doc = "It can have an associated ref count which has a destruction routine to be run"]
-#[doc = "when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref())."]
-#[doc = "Multiple grpc_slice values may share a ref count."]
-#[doc = ""]
-#[doc = "If the slice does not have a refcount, it represents an inlined small piece"]
-#[doc = "of data that is copied by value."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_slice {
- pub refcount: *mut grpc_slice_refcount,
- pub data: grpc_slice_grpc_slice_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_slice_grpc_slice_data {
- pub refcounted: grpc_slice_grpc_slice_data_grpc_slice_refcounted,
- pub inlined: grpc_slice_grpc_slice_data_grpc_slice_inlined,
- _bindgen_union_align: [u64; 3usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted {
- pub length: usize,
- pub bytes: *mut u8,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined {
- pub length: u8,
- pub bytes: [u8; 23usize],
-}
-impl ::std::fmt::Debug for grpc_slice_grpc_slice_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_slice_grpc_slice_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_slice {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_slice {{ refcount: {:?}, data: {:?} }}",
- self.refcount, self.data
- )
- }
-}
-#[doc = " Represents an expandable array of slices, to be interpreted as a"]
-#[doc = "single item."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_slice_buffer {
- #[doc = " This is for internal use only. External users (i.e any code outside grpc"]
- #[doc = " core) MUST NOT use this field"]
- pub base_slices: *mut grpc_slice,
- #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"]
- pub slices: *mut grpc_slice,
- #[doc = " the number of slices in the array"]
- pub count: usize,
- #[doc = " the number of slices allocated in the array. External users (i.e any code"]
- #[doc = " outside grpc core) MUST NOT use this field"]
- pub capacity: usize,
- #[doc = " the combined length of all slices in the array"]
- pub length: usize,
- #[doc = " inlined elements to avoid allocations"]
- pub inlined: [grpc_slice; 8usize],
-}
-impl ::std::fmt::Debug for grpc_slice_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined)
- }
-}
-#[repr(u32)]
-#[doc = " The clocks we support."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum gpr_clock_type {
- #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."]
- GPR_CLOCK_MONOTONIC = 0,
- #[doc = " Realtime clock. May jump forwards or backwards. Settable by"]
- #[doc = "the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."]
- GPR_CLOCK_REALTIME = 1,
- #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch"]
- #[doc = "undefined. Degrades to GPR_CLOCK_REALTIME on other platforms."]
- GPR_CLOCK_PRECISE = 2,
- #[doc = " Unmeasurable clock type: no base, created by taking the difference"]
- #[doc = "between two times"]
- GPR_TIMESPAN = 3,
-}
-#[doc = " Analogous to struct timespec. On some machines, absolute times may be in"]
-#[doc = " local time."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_timespec {
- pub tv_sec: i64,
- pub tv_nsec: i32,
- #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if"]
- #[doc = "this is a relative time measure)"]
- pub clock_type: gpr_clock_type,
-}
-pub type gpr_atm = isize;
-extern "C" {
- #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"]
- #[doc = "by \\a min and \\a max. Returns the new value."]
- pub fn gpr_atm_no_barrier_clamped_add(
- value: *mut gpr_atm,
- delta: gpr_atm,
- min: gpr_atm,
- max: gpr_atm,
- ) -> gpr_atm;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_event {
- pub state: gpr_atm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_refcount {
- pub count: gpr_atm,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_stats_counter {
- pub value: gpr_atm,
-}
-extern "C" {
- #[doc = " Initialize *ev."]
- pub fn gpr_event_init(ev: *mut gpr_event);
-}
-extern "C" {
- #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value."]
- #[doc = "Requires: *ev initialized; value != NULL; no prior or concurrent calls to"]
- #[doc = "gpr_event_set(ev, ...) since initialization."]
- pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has"]
- #[doc = "completed. If the result is non-NULL, all operations that occurred prior to"]
- #[doc = "the gpr_event_set(ev, ...) set will be visible after this call returns."]
- #[doc = "Requires: *ev initialized. This operation is faster than acquiring a mutex"]
- #[doc = "on most platforms."]
- pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is"]
- #[doc = "exceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use"]
- #[doc = "abs_deadline==gpr_inf_future for no deadline. When the event has been"]
- #[doc = "signalled before the call, this operation is faster than acquiring a mutex"]
- #[doc = "on most platforms."]
- pub fn gpr_event_wait(
- ev: *mut gpr_event,
- abs_deadline: gpr_timespec,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Initialize *r to value n."]
- pub fn gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
-}
-extern "C" {
- #[doc = " Increment the reference count *r. Requires *r initialized."]
- pub fn gpr_ref(r: *mut gpr_refcount);
-}
-extern "C" {
- #[doc = " Increment the reference count *r. Requires *r initialized."]
- #[doc = "Crashes if refcount is zero"]
- pub fn gpr_ref_non_zero(r: *mut gpr_refcount);
-}
-extern "C" {
- #[doc = " Increment the reference count *r by n. Requires *r initialized, n > 0."]
- pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
-}
-extern "C" {
- #[doc = " Decrement the reference count *r and return non-zero iff it has reached"]
- #[doc = "zero. . Requires *r initialized."]
- pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned"]
- #[doc = "by exactly one object."]
- pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Initialize *c to the value n."]
- pub fn gpr_stats_init(c: *mut gpr_stats_counter, n: isize);
-}
-extern "C" {
- #[doc = " *c += inc. Requires: *c initialized."]
- pub fn gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize);
-}
-extern "C" {
- #[doc = " Return *c. Requires: *c initialized."]
- pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize;
-}
-extern "C" {
- #[doc = " Increment the refcount of s. Requires slice is initialized."]
- #[doc = "Returns s."]
- pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all"]
- #[doc = "slices sharing the ref count are destroyed, and considered no longer"]
- #[doc = "initialized. If s is ultimately derived from a call to grpc_slice_new(start,"]
- #[doc = "len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is"]
- #[doc = "ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)"]
- #[doc = "where dest!=NULL , then (*dest)(start, len). Requires s initialized."]
- pub fn grpc_slice_unref(s: grpc_slice);
-}
-extern "C" {
- #[doc = " Copy slice - create a new slice that contains the same data as s"]
- pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount"]
- #[doc = "for the object, and arranges that destroy will be called with the pointer"]
- #[doc = "passed in at destruction."]
- pub fn grpc_slice_new(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is"]
- #[doc = "passed to the destroy function. This function can be useful when"]
- #[doc = "the data is part of a larger structure that must be destroyed when"]
- #[doc = "the data is no longer needed."]
- pub fn grpc_slice_new_with_user_data(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
- user_data: *mut ::std::os::raw::c_void,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that"]
- #[doc = "also takes the slice length."]
- pub fn grpc_slice_new_with_len(
- p: *mut ::std::os::raw::c_void,
- len: usize,
- destroy: ::std::option::Option<
- unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize),
- >,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()"]
- #[doc = "call."]
- #[doc = "Aborts if malloc() fails."]
- pub fn grpc_slice_malloc(length: usize) -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Intern a slice:"]
- #[doc = ""]
- #[doc = "The return value for two invocations of this function with the same sequence"]
- #[doc = "of bytes is a slice which points to the same memory."]
- pub fn grpc_slice_intern(slice: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice by copying a string."]
- #[doc = "Does not preserve null terminators."]
- #[doc = "Equivalent to:"]
- #[doc = "size_t len = strlen(source);"]
- #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
- #[doc = "memcpy(slice->data, source, len);"]
- pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice by copying a buffer."]
- #[doc = "Equivalent to:"]
- #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
- #[doc = "memcpy(slice->data, source, len);"]
- pub fn grpc_slice_from_copied_buffer(
- source: *const ::std::os::raw::c_char,
- len: usize,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing to constant memory"]
- pub fn grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Create a slice pointing to constant memory"]
- pub fn grpc_slice_from_static_buffer(
- source: *const ::std::os::raw::c_void,
- len: usize,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,"]
- #[doc = "where result.data==s.data+begin, and result.length==end-begin. The ref count"]
- #[doc = "of \\a s is increased by one. Do not assign result back to \\a s."]
- #[doc = "Requires s initialized, begin <= end, begin <= s.length, and"]
- #[doc = "end <= source->length."]
- pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " The same as grpc_slice_sub, but without altering the ref count"]
- pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,"]
- #[doc = "sharing a refcount with s, that contains s[split:s.length]."]
- #[doc = "Requires s initialized, split <= s.length"]
- pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_slice_ref_whom {
- GRPC_SLICE_REF_TAIL = 1,
- GRPC_SLICE_REF_HEAD = 2,
- GRPC_SLICE_REF_BOTH = 3,
-}
-extern "C" {
- #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering"]
- #[doc = " refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to"]
- #[doc = " grpc_slice_split_tail(...))"]
- pub fn grpc_slice_split_tail_maybe_ref(
- s: *mut grpc_slice,
- split: usize,
- ref_whom: grpc_slice_ref_whom,
- ) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new"]
- #[doc = "slice, sharing a refcount with s, that contains s[0:split]."]
- #[doc = "Requires s initialized, split <= s.length"]
- pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_empty_slice() -> grpc_slice;
-}
-extern "C" {
- pub fn grpc_slice_default_hash_impl(s: grpc_slice) -> u32;
-}
-extern "C" {
- pub fn grpc_slice_default_eq_impl(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b"]
- #[doc = "The order is arbitrary, and is not guaranteed to be stable across different"]
- #[doc = "versions of the API."]
- pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_str_cmp(
- a: grpc_slice,
- b: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return non-zero if the first blen bytes of a are equal to b"]
- pub fn grpc_slice_buf_start_eq(
- a: grpc_slice,
- b: *const ::std::os::raw::c_void,
- blen: usize,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return the index of the last instance of \\a c in \\a s, or -1 if not found"]
- pub fn grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1"]
- #[doc = "if it's not found"]
- pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn grpc_slice_hash(s: grpc_slice) -> u32;
-}
-extern "C" {
- #[doc = " Do two slices point at the same memory, with the same length"]
- #[doc = "If a or b is inlined, actually compares data"]
- pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return a slice pointing to newly allocated memory that has the same contents"]
- #[doc = " as \\a s"]
- pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Return a copy of slice as a C string. Offers no protection against embedded"]
- #[doc = "NULL's. Returned string must be freed with gpr_free."]
- pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Return if an algorithm is message compression algorithm."]
- pub fn grpc_compression_algorithm_is_message(
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Return if an algorithm is stream compression algorithm."]
- pub fn grpc_compression_algorithm_is_stream(
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a"]
- #[doc = " algorithm. Returns 1 upon success, 0 otherwise."]
- pub fn grpc_compression_algorithm_parse(
- name: grpc_slice,
- algorithm: *mut grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a"]
- #[doc = " algorithm. Note that \\a name is statically allocated and must *not* be freed."]
- #[doc = " Returns 1 upon success, 0 otherwise."]
- pub fn grpc_compression_algorithm_name(
- algorithm: grpc_compression_algorithm,
- name: *mut *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Returns the compression algorithm corresponding to \\a level for the"]
- #[doc = " compression algorithms encoded in the \\a accepted_encodings bitset."]
- pub fn grpc_compression_algorithm_for_level(
- level: grpc_compression_level,
- accepted_encodings: u32,
- ) -> grpc_compression_algorithm;
-}
-extern "C" {
- pub fn grpc_compression_options_init(opts: *mut grpc_compression_options);
-}
-extern "C" {
- #[doc = " Mark \\a algorithm as enabled in \\a opts."]
- pub fn grpc_compression_options_enable_algorithm(
- opts: *mut grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- );
-}
-extern "C" {
- #[doc = " Mark \\a algorithm as disabled in \\a opts."]
- pub fn grpc_compression_options_disable_algorithm(
- opts: *mut grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- );
-}
-extern "C" {
- #[doc = " Returns true if \\a algorithm is marked as enabled in \\a opts."]
- pub fn grpc_compression_options_is_algorithm_enabled(
- opts: *const grpc_compression_options,
- algorithm: grpc_compression_algorithm,
- ) -> ::std::os::raw::c_int;
-}
-pub mod grpc_status_code {
- pub type Type = ::std::os::raw::c_int;
- #[doc = " Not an error; returned on success"]
- pub const GRPC_STATUS_OK: Type = 0;
- #[doc = " The operation was cancelled (typically by the caller)."]
- pub const GRPC_STATUS_CANCELLED: Type = 1;
- #[doc = " Unknown error. An example of where this error may be returned is"]
- #[doc = "if a Status value received from another address space belongs to"]
- #[doc = "an error-space that is not known in this address space. Also"]
- #[doc = "errors raised by APIs that do not return enough error information"]
- #[doc = "may be converted to this error."]
- pub const GRPC_STATUS_UNKNOWN: Type = 2;
- #[doc = " Client specified an invalid argument. Note that this differs"]
- #[doc = "from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments"]
- #[doc = "that are problematic regardless of the state of the system"]
- #[doc = "(e.g., a malformed file name)."]
- pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3;
- #[doc = " Deadline expired before operation could complete. For operations"]
- #[doc = "that change the state of the system, this error may be returned"]
- #[doc = "even if the operation has completed successfully. For example, a"]
- #[doc = "successful response from a server could have been delayed long"]
- #[doc = "enough for the deadline to expire."]
- pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4;
- #[doc = " Some requested entity (e.g., file or directory) was not found."]
- pub const GRPC_STATUS_NOT_FOUND: Type = 5;
- #[doc = " Some entity that we attempted to create (e.g., file or directory)"]
- #[doc = "already exists."]
- pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6;
- #[doc = " The caller does not have permission to execute the specified"]
- #[doc = "operation. PERMISSION_DENIED must not be used for rejections"]
- #[doc = "caused by exhausting some resource (use RESOURCE_EXHAUSTED"]
- #[doc = "instead for those errors). PERMISSION_DENIED must not be"]
- #[doc = "used if the caller can not be identified (use UNAUTHENTICATED"]
- #[doc = "instead for those errors)."]
- pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7;
- #[doc = " The request does not have valid authentication credentials for the"]
- #[doc = "operation."]
- pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16;
- #[doc = " Some resource has been exhausted, perhaps a per-user quota, or"]
- #[doc = "perhaps the entire file system is out of space."]
- pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8;
- #[doc = " Operation was rejected because the system is not in a state"]
- #[doc = "required for the operation's execution. For example, directory"]
- #[doc = "to be deleted may be non-empty, an rmdir operation is applied to"]
- #[doc = "a non-directory, etc."]
- #[doc = ""]
- #[doc = "A litmus test that may help a service implementor in deciding"]
- #[doc = "between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:"]
- #[doc = "(a) Use UNAVAILABLE if the client can retry just the failing call."]
- #[doc = "(b) Use ABORTED if the client should retry at a higher-level"]
- #[doc = "(e.g., restarting a read-modify-write sequence)."]
- #[doc = "(c) Use FAILED_PRECONDITION if the client should not retry until"]
- #[doc = "the system state has been explicitly fixed. E.g., if an \"rmdir\""]
- #[doc = "fails because the directory is non-empty, FAILED_PRECONDITION"]
- #[doc = "should be returned since the client should not retry unless"]
- #[doc = "they have first fixed up the directory by deleting files from it."]
- #[doc = "(d) Use FAILED_PRECONDITION if the client performs conditional"]
- #[doc = "REST Get/Update/Delete on a resource and the resource on the"]
- #[doc = "server does not match the condition. E.g., conflicting"]
- #[doc = "read-modify-write on the same resource."]
- pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9;
- #[doc = " The operation was aborted, typically due to a concurrency issue"]
- #[doc = "like sequencer check failures, transaction aborts, etc."]
- #[doc = ""]
- #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
- #[doc = "ABORTED, and UNAVAILABLE."]
- pub const GRPC_STATUS_ABORTED: Type = 10;
- #[doc = " Operation was attempted past the valid range. E.g., seeking or"]
- #[doc = "reading past end of file."]
- #[doc = ""]
- #[doc = "Unlike INVALID_ARGUMENT, this error indicates a problem that may"]
- #[doc = "be fixed if the system state changes. For example, a 32-bit file"]
- #[doc = "system will generate INVALID_ARGUMENT if asked to read at an"]
- #[doc = "offset that is not in the range [0,2^32-1], but it will generate"]
- #[doc = "OUT_OF_RANGE if asked to read from an offset past the current"]
- #[doc = "file size."]
- #[doc = ""]
- #[doc = "There is a fair bit of overlap between FAILED_PRECONDITION and"]
- #[doc = "OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific"]
- #[doc = "error) when it applies so that callers who are iterating through"]
- #[doc = "a space can easily look for an OUT_OF_RANGE error to detect when"]
- #[doc = "they are done."]
- pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11;
- #[doc = " Operation is not implemented or not supported/enabled in this service."]
- pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12;
- #[doc = " Internal errors. Means some invariants expected by underlying"]
- #[doc = "system has been broken. If you see one of these errors,"]
- #[doc = "something is very broken."]
- pub const GRPC_STATUS_INTERNAL: Type = 13;
- #[doc = " The service is currently unavailable. This is a most likely a"]
- #[doc = "transient condition and may be corrected by retrying with"]
- #[doc = "a backoff. Note that it is not always safe to retry non-idempotent"]
- #[doc = "operations."]
- #[doc = ""]
- #[doc = "WARNING: Although data MIGHT not have been transmitted when this"]
- #[doc = "status occurs, there is NOT A GUARANTEE that the server has not seen"]
- #[doc = "anything. So in general it is unsafe to retry on this status code"]
- #[doc = "if the call is non-idempotent."]
- #[doc = ""]
- #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
- #[doc = "ABORTED, and UNAVAILABLE."]
- pub const GRPC_STATUS_UNAVAILABLE: Type = 14;
- #[doc = " Unrecoverable data loss or corruption."]
- pub const GRPC_STATUS_DATA_LOSS: Type = 15;
- #[doc = " Force users to include a default branch:"]
- pub const GRPC_STATUS__DO_NOT_USE: Type = -1;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_byte_buffer_type {
- GRPC_BB_RAW = 0,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer {
- pub reserved: *mut ::std::os::raw::c_void,
- pub type_: grpc_byte_buffer_type,
- pub data: grpc_byte_buffer_grpc_byte_buffer_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_byte_buffer_grpc_byte_buffer_data {
- pub reserved: grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1,
- pub raw: grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer,
- _bindgen_union_align: [u64; 38usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 {
- pub reserved: [*mut ::std::os::raw::c_void; 8usize],
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
- pub compression: grpc_compression_algorithm,
- pub slice_buffer: grpc_slice_buffer,
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer)
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}",
- self.reserved, self.type_, self.data
- )
- }
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_alarm {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_call {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_socket_mutator {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_socket_factory {
- _unused: [u8; 0],
-}
-#[repr(u32)]
-#[doc = " Type specifier for grpc_arg"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_arg_type {
- GRPC_ARG_STRING = 0,
- GRPC_ARG_INTEGER = 1,
- GRPC_ARG_POINTER = 2,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_arg_pointer_vtable {
- pub copy: ::std::option::Option<
- unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
- >,
- pub destroy: ::std::option::Option<unsafe extern "C" fn(p: *mut ::std::os::raw::c_void)>,
- pub cmp: ::std::option::Option<
- unsafe extern "C" fn(
- p: *mut ::std::os::raw::c_void,
- q: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
-}
-#[doc = " A single argument... each argument has a key and a value"]
-#[doc = ""]
-#[doc = "A note on naming keys:"]
-#[doc = "Keys are namespaced into groups, usually grouped by library, and are"]
-#[doc = "keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must"]
-#[doc = "be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}."]
-#[doc = "Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}."]
-#[doc = ""]
-#[doc = "GRPC core library keys are prefixed by grpc."]
-#[doc = ""]
-#[doc = "Library authors are strongly encouraged to \\#define symbolic constants for"]
-#[doc = "their keys so that it's possible to change them in the future."]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_arg {
- pub type_: grpc_arg_type,
- pub key: *mut ::std::os::raw::c_char,
- pub value: grpc_arg_grpc_arg_value,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_arg_grpc_arg_value {
- pub string: *mut ::std::os::raw::c_char,
- pub integer: ::std::os::raw::c_int,
- pub pointer: grpc_arg_grpc_arg_value_grpc_arg_pointer,
- _bindgen_union_align: [u64; 2usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer {
- pub p: *mut ::std::os::raw::c_void,
- pub vtable: *const grpc_arg_pointer_vtable,
-}
-impl ::std::fmt::Debug for grpc_arg_grpc_arg_value {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_arg_grpc_arg_value {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_arg {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}",
- self.type_, self.key, self.value
- )
- }
-}
-#[doc = " An array of arguments that can be passed around."]
-#[doc = ""]
-#[doc = "Used to set optional channel-level configuration."]
-#[doc = "These configuration options are modelled as key-value pairs as defined"]
-#[doc = "by grpc_arg; keys are strings to allow easy backwards-compatible extension"]
-#[doc = "by arbitrary parties. All evaluation is performed at channel creation"]
-#[doc = "time (i.e. the keys and values in this structure need only live through the"]
-#[doc = "creation invocation)."]
-#[doc = ""]
-#[doc = "However, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the"]
-#[doc = "grpc_arg_pointer_vtable must live until the channel args are done being"]
-#[doc = "used by core (i.e. when the object for use with which they were passed"]
-#[doc = "is destroyed)."]
-#[doc = ""]
-#[doc = "See the description of the \\ref grpc_arg_keys \"available args\" for more"]
-#[doc = "details."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_args {
- pub num_args: usize,
- pub args: *mut grpc_arg,
-}
-#[repr(u32)]
-#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a"]
-#[doc = "particular operation, the grpc_call_error returned will be GRPC_CALL_OK."]
-#[doc = "Receiving any other value listed here is an indication of a bug in the"]
-#[doc = "caller."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_call_error {
- #[doc = " everything went ok"]
- GRPC_CALL_OK = 0,
- #[doc = " something failed, we don't know what"]
- GRPC_CALL_ERROR = 1,
- #[doc = " this method is not available on the server"]
- GRPC_CALL_ERROR_NOT_ON_SERVER = 2,
- #[doc = " this method is not available on the client"]
- GRPC_CALL_ERROR_NOT_ON_CLIENT = 3,
- #[doc = " this method must be called before server_accept"]
- GRPC_CALL_ERROR_ALREADY_ACCEPTED = 4,
- #[doc = " this method must be called before invoke"]
- GRPC_CALL_ERROR_ALREADY_INVOKED = 5,
- #[doc = " this method must be called after invoke"]
- GRPC_CALL_ERROR_NOT_INVOKED = 6,
- #[doc = " this call is already finished"]
- #[doc = "(writes_done or write_status has already been called)"]
- GRPC_CALL_ERROR_ALREADY_FINISHED = 7,
- #[doc = " there is already an outstanding read/write operation on the call"]
- GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8,
- #[doc = " the flags value was illegal for this call"]
- GRPC_CALL_ERROR_INVALID_FLAGS = 9,
- #[doc = " invalid metadata was passed to this call"]
- GRPC_CALL_ERROR_INVALID_METADATA = 10,
- #[doc = " invalid message was passed to this call"]
- GRPC_CALL_ERROR_INVALID_MESSAGE = 11,
- #[doc = " completion queue for notification has not been registered"]
- #[doc = " with the server"]
- GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12,
- #[doc = " this batch of operations leads to more operations than allowed"]
- GRPC_CALL_ERROR_BATCH_TOO_BIG = 13,
- #[doc = " payload type requested is not the type registered"]
- GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH = 14,
- #[doc = " completion queue has been shutdown"]
- GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN = 15,
-}
-#[doc = " A single metadata element"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_metadata {
- #[doc = " the key, value values are expected to line up with grpc_mdelem: if"]
- #[doc = "changing them, update metadata.h at the same time."]
- pub key: grpc_slice,
- pub value: grpc_slice,
- pub flags: u32,
- pub internal_data: grpc_metadata__bindgen_ty_1,
-}
-#[doc = " The following fields are reserved for grpc internal use."]
-#[doc = "There is no need to initialize them, and they will be set to garbage"]
-#[doc = "during calls to grpc."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata__bindgen_ty_1 {
- pub obfuscated: [*mut ::std::os::raw::c_void; 4usize],
-}
-impl ::std::fmt::Debug for grpc_metadata {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_metadata {{ key: {:?}, value: {:?}, flags: {:?}, internal_data: {:?} }}",
- self.key, self.value, self.flags, self.internal_data
- )
- }
-}
-#[repr(u32)]
-#[doc = " The type of completion (for grpc_event)"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_completion_type {
- #[doc = " Shutting down"]
- GRPC_QUEUE_SHUTDOWN = 0,
- #[doc = " No event before timeout"]
- GRPC_QUEUE_TIMEOUT = 1,
- #[doc = " Operation completion"]
- GRPC_OP_COMPLETE = 2,
-}
-#[doc = " The result of an operation."]
-#[doc = ""]
-#[doc = "Returned by a completion queue when the operation started with tag."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_event {
- #[doc = " The type of the completion."]
- pub type_: grpc_completion_type,
- #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates"]
- #[doc = "whether the operation was successful or not; 0 in case of failure and"]
- #[doc = "non-zero in case of success."]
- #[doc = "If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this"]
- #[doc = "field is guaranteed to be 0"]
- pub success: ::std::os::raw::c_int,
- #[doc = " The tag passed to grpc_call_start_batch etc to start this operation."]
- #[doc = "Only* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type"]
- #[doc = "values, tag is uninitialized."]
- pub tag: *mut ::std::os::raw::c_void,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata_array {
- pub count: usize,
- pub capacity: usize,
- pub metadata: *mut grpc_metadata,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_call_details {
- pub method: grpc_slice,
- pub host: grpc_slice,
- pub deadline: gpr_timespec,
- pub flags: u32,
- pub reserved: *mut ::std::os::raw::c_void,
-}
-impl ::std::fmt::Debug for grpc_call_details {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved)
- }
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_op_type {
- #[doc = " Send initial metadata: one and only one instance MUST be sent for each"]
- #[doc = "call, unless the call was cancelled - in which case this can be skipped."]
- #[doc = "This op completes after all bytes of metadata have been accepted by"]
- #[doc = "outgoing flow control."]
- GRPC_OP_SEND_INITIAL_METADATA = 0,
- #[doc = " Send a message: 0 or more of these operations can occur for each call."]
- #[doc = "This op completes after all bytes for the message have been accepted by"]
- #[doc = "outgoing flow control."]
- GRPC_OP_SEND_MESSAGE = 1,
- #[doc = " Send a close from the client: one and only one instance MUST be sent from"]
- #[doc = "the client, unless the call was cancelled - in which case this can be"]
- #[doc = "skipped. This op completes after all bytes for the call"]
- #[doc = "(including the close) have passed outgoing flow control."]
- GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2,
- #[doc = " Send status from the server: one and only one instance MUST be sent from"]
- #[doc = "the server unless the call was cancelled - in which case this can be"]
- #[doc = "skipped. This op completes after all bytes for the call"]
- #[doc = "(including the status) have passed outgoing flow control."]
- GRPC_OP_SEND_STATUS_FROM_SERVER = 3,
- #[doc = " Receive initial metadata: one and only one MUST be made on the client,"]
- #[doc = "must not be made on the server."]
- #[doc = "This op completes after all initial metadata has been read from the"]
- #[doc = "peer."]
- GRPC_OP_RECV_INITIAL_METADATA = 4,
- #[doc = " Receive a message: 0 or more of these operations can occur for each call."]
- #[doc = "This op completes after all bytes of the received message have been"]
- #[doc = "read, or after a half-close has been received on this call."]
- GRPC_OP_RECV_MESSAGE = 5,
- #[doc = " Receive status on the client: one and only one must be made on the client."]
- #[doc = "This operation always succeeds, meaning ops paired with this operation"]
- #[doc = "will also appear to succeed, even though they may not have. In that case"]
- #[doc = "the status will indicate some failure."]
- #[doc = "This op completes after all activity on the call has completed."]
- GRPC_OP_RECV_STATUS_ON_CLIENT = 6,
- #[doc = " Receive close on the server: one and only one must be made on the"]
- #[doc = "server. This op completes after the close has been received by the"]
- #[doc = "server. This operation always succeeds, meaning ops paired with"]
- #[doc = "this operation will also appear to succeed, even though they may not"]
- #[doc = "have."]
- GRPC_OP_RECV_CLOSE_ON_SERVER = 7,
-}
-#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT"]
-#[doc = "which has no arguments)"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_op {
- #[doc = " Operation type, as defined by grpc_op_type"]
- pub op: grpc_op_type,
- #[doc = " Write flags bitset for grpc_begin_messages"]
- pub flags: u32,
- #[doc = " Reserved for future usage"]
- pub reserved: *mut ::std::os::raw::c_void,
- pub data: grpc_op_grpc_op_data,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_op_grpc_op_data {
- pub reserved: grpc_op_grpc_op_data__bindgen_ty_1,
- pub send_initial_metadata: grpc_op_grpc_op_data_grpc_op_send_initial_metadata,
- pub send_message: grpc_op_grpc_op_data_grpc_op_send_message,
- pub send_status_from_server: grpc_op_grpc_op_data_grpc_op_send_status_from_server,
- pub recv_initial_metadata: grpc_op_grpc_op_data_grpc_op_recv_initial_metadata,
- pub recv_message: grpc_op_grpc_op_data_grpc_op_recv_message,
- pub recv_status_on_client: grpc_op_grpc_op_data_grpc_op_recv_status_on_client,
- pub recv_close_on_server: grpc_op_grpc_op_data_grpc_op_recv_close_on_server,
- _bindgen_union_align: [u64; 8usize],
-}
-#[doc = " Reserved for future usage"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data__bindgen_ty_1 {
- pub reserved: [*mut ::std::os::raw::c_void; 8usize],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata { pub count : usize , pub metadata : * mut grpc_metadata , pub maybe_compression_level : grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level , }
-#[doc = " If \\a is_set, \\a compression_level will be used for the call."]
-#[doc = " Otherwise, \\a compression_level won't be considered"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level
-{
- pub is_set: u8,
- pub level: grpc_compression_level,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_message {
- #[doc = " This op takes ownership of the slices in send_message. After"]
- #[doc = " a call completes, the contents of send_message are not guaranteed"]
- #[doc = " and likely empty. The original owner should still call"]
- #[doc = " grpc_byte_buffer_destroy() on this object however."]
- pub send_message: *mut grpc_byte_buffer,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server {
- pub trailing_metadata_count: usize,
- pub trailing_metadata: *mut grpc_metadata,
- pub status: grpc_status_code::Type,
- #[doc = " optional: set to NULL if no details need sending, non-NULL if they do"]
- #[doc = " pointer will not be retained past the start_batch call"]
- pub status_details: *mut grpc_slice,
-}
-#[doc = " ownership of the array is with the caller, but ownership of the elements"]
-#[doc = "stays with the call object (ie key, value members are owned by the call"]
-#[doc = "object, recv_initial_metadata->array is owned by the caller)."]
-#[doc = "After the operation completes, call grpc_metadata_array_destroy on this"]
-#[doc = "value, or reuse it in a future op."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata {
- pub recv_initial_metadata: *mut grpc_metadata_array,
-}
-#[doc = " ownership of the byte buffer is moved to the caller; the caller must"]
-#[doc = "call grpc_byte_buffer_destroy on this value, or reuse it in a future op."]
-#[doc = "The returned byte buffer will be NULL if trailing metadata was"]
-#[doc = "received instead of a message."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_message {
- pub recv_message: *mut *mut grpc_byte_buffer,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client {
- #[doc = " ownership of the array is with the caller, but ownership of the"]
- #[doc = "elements stays with the call object (ie key, value members are owned"]
- #[doc = "by the call object, trailing_metadata->array is owned by the caller)."]
- #[doc = "After the operation completes, call grpc_metadata_array_destroy on"]
- #[doc = "this value, or reuse it in a future op."]
- pub trailing_metadata: *mut grpc_metadata_array,
- pub status: *mut grpc_status_code::Type,
- pub status_details: *mut grpc_slice,
- #[doc = " If this is not nullptr, it will be populated with the full fidelity"]
- #[doc = " error string for debugging purposes. The application is responsible"]
- #[doc = " for freeing the data by using gpr_free()."]
- pub error_string: *mut *const ::std::os::raw::c_char,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server {
- #[doc = " out argument, set to 1 if the call failed at the server for"]
- #[doc = "a reason other than a non-OK status (cancel, deadline"]
- #[doc = "exceeded, network failure, etc.), 0 otherwise (RPC processing ran to"]
- #[doc = "completion and was able to provide any status from the server)"]
- pub cancelled: *mut ::std::os::raw::c_int,
-}
-impl ::std::fmt::Debug for grpc_op_grpc_op_data {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(f, "grpc_op_grpc_op_data {{ union }}")
- }
-}
-impl ::std::fmt::Debug for grpc_op {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_op {{ op: {:?}, flags: {:?}, reserved: {:?}, data: {:?} }}",
- self.op, self.flags, self.reserved, self.data
- )
- }
-}
-#[doc = " Information requested from the channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_info {
- #[doc = " If non-NULL, will be set to point to a string indicating the LB"]
- #[doc = " policy name. Caller takes ownership."]
- pub lb_policy_name: *mut *mut ::std::os::raw::c_char,
- #[doc = " If non-NULL, will be set to point to a string containing the"]
- #[doc = " service config used by the channel in JSON form."]
- pub service_config_json: *mut *mut ::std::os::raw::c_char,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_resource_quota {
- _unused: [u8; 0],
-}
-#[repr(u32)]
-#[doc = " Completion queues internally MAY maintain a set of file descriptors in a"]
-#[doc = "structure called 'pollset'. This enum specifies if a completion queue has an"]
-#[doc = "associated pollset and any restrictions on the type of file descriptors that"]
-#[doc = "can be present in the pollset."]
-#[doc = ""]
-#[doc = "I/O progress can only be made when grpc_completion_queue_next() or"]
-#[doc = "grpc_completion_queue_pluck() are called on the completion queue (unless the"]
-#[doc = "grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important"]
-#[doc = "to actively call these APIs"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_cq_polling_type {
- #[doc = " The completion queue will have an associated pollset and there is no"]
- #[doc = "restriction on the type of file descriptors the pollset may contain"]
- GRPC_CQ_DEFAULT_POLLING = 0,
- #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will"]
- #[doc = "not contain any 'listening file descriptors' (i.e file descriptors used to"]
- #[doc = "listen to incoming channels)"]
- GRPC_CQ_NON_LISTENING = 1,
- #[doc = " The completion queue will not have an associated pollset. Note that"]
- #[doc = "grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still"]
- #[doc = "be called to pop events from the completion queue; it is not required to"]
- #[doc = "call them actively to make I/O progress"]
- GRPC_CQ_NON_POLLING = 2,
-}
-#[repr(u32)]
-#[doc = " Specifies the type of APIs to use to pop events from the completion queue"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_cq_completion_type {
- #[doc = " Events are popped out by calling grpc_completion_queue_next() API ONLY"]
- GRPC_CQ_NEXT = 0,
- #[doc = " Events are popped out by calling grpc_completion_queue_pluck() API ONLY"]
- GRPC_CQ_PLUCK = 1,
- #[doc = " EXPERIMENTAL: Events trigger a callback specified as the tag"]
- GRPC_CQ_CALLBACK = 2,
-}
-#[doc = " EXPERIMENTAL: Specifies an interface class to be used as a tag"]
-#[doc = "for callback-based completion queues. This can be used directly,"]
-#[doc = "as the first element of a struct in C, or as a base class in C++."]
-#[doc = "Its \"run\" value should be assigned to some non-member function, such as"]
-#[doc = "a static method."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_experimental_completion_queue_functor {
- #[doc = " The run member specifies a function that will be called when this"]
- #[doc = "tag is extracted from the completion queue. Its arguments will be a"]
- #[doc = "pointer to this functor and a boolean that indicates whether the"]
- #[doc = "operation succeeded (non-zero) or failed (zero)"]
- pub functor_run: ::std::option::Option<
- unsafe extern "C" fn(
- arg1: *mut grpc_experimental_completion_queue_functor,
- arg2: ::std::os::raw::c_int,
- ),
- >,
- #[doc = " The inlineable member specifies whether this functor can be run inline."]
- #[doc = "This should only be used for trivial internally-defined functors."]
- pub inlineable: ::std::os::raw::c_int,
- #[doc = " The following fields are not API. They are meant for internal use."]
- pub internal_success: ::std::os::raw::c_int,
- pub internal_next: *mut grpc_experimental_completion_queue_functor,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue_attributes {
- #[doc = " The version number of this structure. More fields might be added to this"]
- #[doc = "structure in future."]
- pub version: ::std::os::raw::c_int,
- #[doc = " Set to GRPC_CQ_CURRENT_VERSION"]
- pub cq_completion_type: grpc_cq_completion_type,
- pub cq_polling_type: grpc_cq_polling_type,
- #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when"]
- #[doc = " shutdown is complete"]
- pub cq_shutdown_cb: *mut grpc_experimental_completion_queue_functor,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_completion_queue_factory {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices)."]
- #[doc = ""]
- #[doc = " Increases the reference count for all \\a slices processed. The user is"]
- #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
- pub fn grpc_raw_byte_buffer_create(
- slices: *mut grpc_slice,
- nslices: usize,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to"]
- #[doc = " \\a nslices). The \\a compression argument defines the compression algorithm"]
- #[doc = " used to generate the data in \\a slices."]
- #[doc = ""]
- #[doc = " Increases the reference count for all \\a slices processed. The user is"]
- #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
- pub fn grpc_raw_compressed_byte_buffer_create(
- slices: *mut grpc_slice,
- nslices: usize,
- compression: grpc_compression_algorithm,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Copies input byte buffer \\a bb."]
- #[doc = ""]
- #[doc = " Increases the reference count of all the source slices. The user is"]
- #[doc = " responsible for calling grpc_byte_buffer_destroy over the returned copy."]
- pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " Returns the size of the given byte buffer, in bytes."]
- pub fn grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize;
-}
-extern "C" {
- #[doc = " Destroys \\a byte_buffer deallocating all its memory."]
- pub fn grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer);
-}
-extern "C" {
- #[doc = " Initialize \\a reader to read over \\a buffer."]
- #[doc = " Returns 1 upon success, 0 otherwise."]
- pub fn grpc_byte_buffer_reader_init(
- reader: *mut grpc_byte_buffer_reader,
- buffer: *mut grpc_byte_buffer,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Cleanup and destroy \\a reader"]
- pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader);
-}
-extern "C" {
- #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
- #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for calling"]
- #[doc = " grpc_slice_unref on the result."]
- pub fn grpc_byte_buffer_reader_next(
- reader: *mut grpc_byte_buffer_reader,
- slice: *mut grpc_slice,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future."]
- #[doc = ""]
- #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
- #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for making sure"]
- #[doc = " the slice pointer remains valid when accessed."]
- #[doc = ""]
- #[doc = " NOTE: Do not use this function unless the caller can guarantee that the"]
- #[doc = " underlying grpc_byte_buffer outlasts the use of the slice. This is only"]
- #[doc = " safe when the underlying grpc_byte_buffer remains immutable while slice"]
- #[doc = " is being accessed."]
- pub fn grpc_byte_buffer_reader_peek(
- reader: *mut grpc_byte_buffer_reader,
- slice: *mut *mut grpc_slice,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Merge all data from \\a reader into single slice"]
- pub fn grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice;
-}
-extern "C" {
- #[doc = " Returns a RAW byte buffer instance from the output of \\a reader."]
- pub fn grpc_raw_byte_buffer_from_reader(
- reader: *mut grpc_byte_buffer_reader,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- #[doc = " initialize a slice buffer"]
- pub fn grpc_slice_buffer_init(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " destroy a slice buffer - unrefs any held elements"]
- pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " Add an element to a slice buffer - takes ownership of the slice."]
- #[doc = "This function is allowed to concatenate the passed in slice to the end of"]
- #[doc = "some other slice if desired by the slice buffer."]
- pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice);
-}
-extern "C" {
- #[doc = " add an element to a slice buffer - takes ownership of the slice and returns"]
- #[doc = "the index of the slice."]
- #[doc = "Guarantees that the slice will not be concatenated at the end of another"]
- #[doc = "slice (i.e. the data for this slice will begin at the first byte of the"]
- #[doc = "slice at the returned index in sb->slices)"]
- #[doc = "The implementation MAY decide to concatenate data at the end of a small"]
- #[doc = "slice added in this fashion."]
- pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize;
-}
-extern "C" {
- pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize);
-}
-extern "C" {
- #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice"]
- #[doc = "buffer: returns a pointer into which to add the data"]
- pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8;
-}
-extern "C" {
- #[doc = " pop the last buffer, but don't unref it"]
- pub fn grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " clear a slice buffer, unref all elements"]
- pub fn grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " swap the contents of two slice buffers"]
- pub fn grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " move all of the elements of src into dst"]
- pub fn grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer);
-}
-extern "C" {
- #[doc = " remove n bytes from the end of a slice buffer"]
- pub fn grpc_slice_buffer_trim_end(
- sb: *mut grpc_slice_buffer,
- n: usize,
- garbage: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst"]
- pub fn grpc_slice_buffer_move_first(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst without adding references"]
- pub fn grpc_slice_buffer_move_first_no_ref(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut grpc_slice_buffer,
- );
-}
-extern "C" {
- #[doc = " move the first n bytes of src into dst (copying them)"]
- pub fn grpc_slice_buffer_move_first_into_buffer(
- src: *mut grpc_slice_buffer,
- n: usize,
- dst: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " take the first slice in the slice buffer"]
- pub fn grpc_slice_buffer_take_first(sb: *mut grpc_slice_buffer) -> grpc_slice;
-}
-extern "C" {
- #[doc = " undo the above with (a possibly different) \\a slice"]
- pub fn grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice);
-}
-#[repr(u32)]
-#[doc = " Connectivity state of a channel."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_connectivity_state {
- #[doc = " channel is idle"]
- GRPC_CHANNEL_IDLE = 0,
- #[doc = " channel is connecting"]
- GRPC_CHANNEL_CONNECTING = 1,
- #[doc = " channel is ready for work"]
- GRPC_CHANNEL_READY = 2,
- #[doc = " channel has seen a failure but expects to recover"]
- GRPC_CHANNEL_TRANSIENT_FAILURE = 3,
- #[doc = " channel has seen a failure that it cannot recover from"]
- GRPC_CHANNEL_SHUTDOWN = 4,
-}
-extern "C" {
- #[doc = " Time constants."]
- pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " The zero time interval."]
- pub fn gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " The far future"]
- pub fn gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " initialize time subsystem"]
- pub fn gpr_time_init();
-}
-extern "C" {
- #[doc = " Return the current time measured from the given clocks epoch."]
- pub fn gpr_now(clock: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Convert a timespec from one clock to another"]
- pub fn gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b"]
- #[doc = "respectively."]
- pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Add and subtract times. Calculations saturate at infinities."]
- pub fn gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Return a timespec representing a given number of time units. INT64_MIN is"]
- #[doc = "interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."]
- pub fn gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_nanos(ns: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_millis(ms: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_seconds(s: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_minutes(m: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_from_hours(h: i64, clock_type: gpr_clock_type) -> gpr_timespec;
-}
-extern "C" {
- pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32;
-}
-extern "C" {
- #[doc = " Return 1 if two times are equal or within threshold of each other,"]
- #[doc = "0 otherwise"]
- pub fn gpr_time_similar(
- a: gpr_timespec,
- b: gpr_timespec,
- threshold: gpr_timespec,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Sleep until at least 'until' - an absolute timeout"]
- pub fn gpr_sleep_until(until: gpr_timespec);
-}
-extern "C" {
- pub fn gpr_timespec_to_micros(t: gpr_timespec) -> f64;
-}
-extern "C" {
- #[doc = " \\mainpage GRPC Core"]
- #[doc = ""]
- #[doc = " The GRPC Core library is a low-level library designed to be wrapped by higher"]
- #[doc = " level libraries. The top-level API is provided in grpc.h. Security related"]
- #[doc = " functionality lives in grpc_security.h."]
- pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpc_metadata_array_destroy(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpc_call_details_init(details: *mut grpc_call_details);
-}
-extern "C" {
- pub fn grpc_call_details_destroy(details: *mut grpc_call_details);
-}
-extern "C" {
- #[doc = " Registers a plugin to be initialized and destroyed with the library."]
- #[doc = ""]
- #[doc = "The \\a init and \\a destroy functions will be invoked as part of"]
- #[doc = "\\a grpc_init() and \\a grpc_shutdown(), respectively."]
- #[doc = "Note that these functions can be invoked an arbitrary number of times"]
- #[doc = "(and hence so will \\a init and \\a destroy)."]
- #[doc = "It is safe to pass NULL to either argument. Plugins are destroyed in"]
- #[doc = "the reverse order they were initialized."]
- pub fn grpc_register_plugin(
- init: ::std::option::Option<unsafe extern "C" fn()>,
- destroy: ::std::option::Option<unsafe extern "C" fn()>,
- );
-}
-extern "C" {
- #[doc = " Initialize the grpc library."]
- #[doc = ""]
- #[doc = "After it's called, a matching invocation to grpc_shutdown() is expected."]
- #[doc = ""]
- #[doc = "It is not safe to call any other grpc functions before calling this."]
- #[doc = "(To avoid overhead, little checking is done, and some things may work. We"]
- #[doc = "do not warrant that they will continue to do so in future revisions of this"]
- #[doc = "library)."]
- pub fn grpc_init();
-}
-extern "C" {
- #[doc = " Shut down the grpc library."]
- #[doc = ""]
- #[doc = "Before it's called, there should haven been a matching invocation to"]
- #[doc = "grpc_init()."]
- #[doc = ""]
- #[doc = "The last call to grpc_shutdown will initiate cleaning up of grpc library"]
- #[doc = "internals, which can happen in another thread. Once the clean-up is done,"]
- #[doc = "no memory is used by grpc, nor are any instructions executing within the"]
- #[doc = "grpc library. Prior to calling, all application owned grpc objects must"]
- #[doc = "have been destroyed."]
- pub fn grpc_shutdown();
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized."]
- #[doc = "TODO(ericgribkoff) Decide if this should be promoted to non-experimental as"]
- #[doc = "part of stabilizing the fork support API, as tracked in"]
- #[doc = "https://github.com/grpc/grpc/issues/15334"]
- pub fn grpc_is_initialized() -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " DEPRECATED. Recommend to use grpc_shutdown only"]
- pub fn grpc_shutdown_blocking();
-}
-extern "C" {
- #[doc = " Return a string representing the current version of grpc"]
- pub fn grpc_version_string() -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Return a string specifying what the 'g' in gRPC stands for"]
- pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns the completion queue factory based on the attributes. MAY return a"]
- #[doc = "NULL if no factory can be found"]
- pub fn grpc_completion_queue_factory_lookup(
- attributes: *const grpc_completion_queue_attributes,
- ) -> *const grpc_completion_queue_factory;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
- pub fn grpc_completion_queue_create_for_next(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
- pub fn grpc_completion_queue_create_for_pluck(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
- #[doc = "of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING."]
- #[doc = "This function is experimental."]
- pub fn grpc_completion_queue_create_for_callback(
- shutdown_callback: *mut grpc_experimental_completion_queue_functor,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Create a completion queue"]
- pub fn grpc_completion_queue_create(
- factory: *const grpc_completion_queue_factory,
- attributes: *const grpc_completion_queue_attributes,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_completion_queue;
-}
-extern "C" {
- #[doc = " Blocks until an event is available, the completion queue is being shut down,"]
- #[doc = "or deadline is reached."]
- #[doc = ""]
- #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
- #[doc = "otherwise a grpc_event describing the event that occurred."]
- #[doc = ""]
- #[doc = "Callers must not call grpc_completion_queue_next and"]
- #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
- pub fn grpc_completion_queue_next(
- cq: *mut grpc_completion_queue,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_event;
-}
-extern "C" {
- #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is"]
- #[doc = "being shutdown or deadline is reached."]
- #[doc = ""]
- #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
- #[doc = "otherwise a grpc_event describing the event that occurred."]
- #[doc = ""]
- #[doc = "Callers must not call grpc_completion_queue_next and"]
- #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
- #[doc = ""]
- #[doc = "Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS"]
- #[doc = "concurrently executing plucks at any time."]
- pub fn grpc_completion_queue_pluck(
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_event;
-}
-extern "C" {
- #[doc = " Begin destruction of a completion queue. Once all possible events are"]
- #[doc = "drained then grpc_completion_queue_next will start to produce"]
- #[doc = "GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call"]
- #[doc = "grpc_completion_queue_destroy."]
- #[doc = ""]
- #[doc = "After calling this function applications should ensure that no"]
- #[doc = "NEW work is added to be published on this completion queue."]
- pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " Destroy a completion queue. The caller must ensure that the queue is"]
- #[doc = "drained and no threads are executing grpc_completion_queue_next"]
- pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API ************/"]
- #[doc = " grpc_flush_cq_tls_cache() MUST be called on the same thread,"]
- #[doc = " with the same cq."]
- pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API ************/"]
- #[doc = " Returns 1 if there was contents in the cache. If there was an event"]
- #[doc = " in \\a cq tls cache, its tag is placed in tag, and ok is set to the"]
- #[doc = " event success."]
- pub fn grpc_completion_queue_thread_local_cache_flush(
- cq: *mut grpc_completion_queue,
- tag: *mut *mut ::std::os::raw::c_void,
- ok: *mut ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check the connectivity state of a channel."]
- pub fn grpc_channel_check_connectivity_state(
- channel: *mut grpc_channel,
- try_to_connect: ::std::os::raw::c_int,
- ) -> grpc_connectivity_state;
-}
-extern "C" {
- #[doc = " Number of active \"external connectivity state watchers\" attached to a"]
- #[doc = " channel."]
- #[doc = " Useful for testing."]
- pub fn grpc_channel_num_external_connectivity_watchers(
- channel: *mut grpc_channel,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Watch for a change in connectivity state."]
- #[doc = "Once the channel connectivity state is different from last_observed_state,"]
- #[doc = "tag will be enqueued on cq with success=1."]
- #[doc = "If deadline expires BEFORE the state is changed, tag will be enqueued on cq"]
- #[doc = "with success=0."]
- pub fn grpc_channel_watch_connectivity_state(
- channel: *mut grpc_channel,
- last_observed_state: grpc_connectivity_state,
- deadline: gpr_timespec,
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " Check whether a grpc channel supports connectivity watcher"]
- pub fn grpc_channel_support_connectivity_watcher(
- channel: *mut grpc_channel,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Create a call given a grpc_channel, in order to call 'method'. All"]
- #[doc = "completions are sent to 'completion_queue'. 'method' and 'host' need only"]
- #[doc = "live through the invocation of this function."]
- #[doc = "If parent_call is non-NULL, it must be a server-side call. It will be used"]
- #[doc = "to propagate properties from the server call to this new client call,"]
- #[doc = "depending on the value of \\a propagation_mask (see propagation_bits.h for"]
- #[doc = "possible values)."]
- pub fn grpc_channel_create_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- completion_queue: *mut grpc_completion_queue,
- method: grpc_slice,
- host: *const grpc_slice,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call;
-}
-extern "C" {
- #[doc = " Pre-register a method/host pair on a channel."]
- #[doc = "method and host are not owned and must remain alive while the channel is"]
- #[doc = "alive."]
- pub fn grpc_channel_register_call(
- channel: *mut grpc_channel,
- method: *const ::std::os::raw::c_char,
- host: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Create a call given a handle returned from grpc_channel_register_call."]
- #[doc = "\\sa grpc_channel_create_call."]
- pub fn grpc_channel_create_registered_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- completion_queue: *mut grpc_completion_queue,
- registered_call_handle: *mut ::std::os::raw::c_void,
- deadline: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call;
-}
-extern "C" {
- #[doc = " Allocate memory in the grpc_call arena: this memory is automatically"]
- #[doc = "discarded at call completion"]
- pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Start a batch of operations defined in the array ops; when complete, post a"]
- #[doc = "completion of type 'tag' to the completion queue bound to the call."]
- #[doc = "The order of ops specified in the batch has no significance."]
- #[doc = "Only one operation of each type can be active at once in any given"]
- #[doc = "batch."]
- #[doc = "If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call"]
- #[doc = "grpc_completion_queue_next or grpc_completion_queue_pluck on the completion"]
- #[doc = "queue associated with 'call' for work to be performed. If a call to"]
- #[doc = "grpc_call_start_batch returns any value other than GRPC_CALL_OK it is"]
- #[doc = "guaranteed that no state associated with 'call' is changed and it is not"]
- #[doc = "appropriate to call grpc_completion_queue_next or"]
- #[doc = "grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch"]
- #[doc = "call."]
- #[doc = "If a call to grpc_call_start_batch with an empty batch returns"]
- #[doc = "GRPC_CALL_OK, the tag is put in the completion queue immediately."]
- #[doc = "THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment"]
- #[doc = "needs to be synchronized. As an optimization, you may synchronize batches"]
- #[doc = "containing just send operations independently from batches containing just"]
- #[doc = "receive operations. Access to grpc_call_start_batch with an empty batch is"]
- #[doc = "thread-compatible."]
- pub fn grpc_call_start_batch(
- call: *mut grpc_call,
- ops: *const grpc_op,
- nops: usize,
- tag: *mut ::std::os::raw::c_void,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Returns a newly allocated string representing the endpoint to which this"]
- #[doc = "call is communicating with. The string is in the uri format accepted by"]
- #[doc = "grpc_channel_create."]
- #[doc = "The returned string should be disposed of with gpr_free()."]
- #[doc = ""]
- #[doc = "WARNING: this value is never authenticated or subject to any security"]
- #[doc = "related code. It must not be used for any authentication related"]
- #[doc = "functionality. Instead, use grpc_auth_context."]
- pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct census_context {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Set census context for a call; Must be called before first call to"]
- #[doc = "grpc_call_start_batch()."]
- pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context);
-}
-extern "C" {
- #[doc = " Retrieve the calls current census context."]
- pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context;
-}
-extern "C" {
- #[doc = " Return a newly allocated string representing the target a channel was"]
- #[doc = "created for."]
- pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Request info about the channel."]
- #[doc = "\\a channel_info indicates what information is being requested and"]
- #[doc = "how that information will be returned."]
- #[doc = "\\a channel_info is owned by the caller."]
- pub fn grpc_channel_get_info(
- channel: *mut grpc_channel,
- channel_info: *const grpc_channel_info,
- );
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Resets the channel's connect backoff."]
- #[doc = "TODO(roth): When we see whether this proves useful, either promote"]
- #[doc = "to non-experimental or remove it."]
- pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel);
-}
-extern "C" {
- #[doc = " Create a client channel to 'target'. Additional channel level configuration"]
- #[doc = "MAY be provided by grpc_channel_args, though the expectation is that most"]
- #[doc = "clients will want to simply pass NULL. The user data in 'args' need only"]
- #[doc = "live through the invocation of this function. However, if any args of the"]
- #[doc = "'pointer' type are passed, then the referenced vtable must be maintained"]
- #[doc = "by the caller until grpc_channel_destroy terminates. See grpc_channel_args"]
- #[doc = "definition for more on this."]
- pub fn grpc_insecure_channel_create(
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Create a lame client: this client fails every operation attempted on it."]
- pub fn grpc_lame_client_channel_create(
- target: *const ::std::os::raw::c_char,
- error_code: grpc_status_code::Type,
- error_message: *const ::std::os::raw::c_char,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Close and destroy a grpc channel"]
- pub fn grpc_channel_destroy(channel: *mut grpc_channel);
-}
-extern "C" {
- #[doc = " Cancel an RPC."]
- #[doc = "Can be called multiple times, from any thread."]
- #[doc = "THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status"]
- #[doc = "are thread-safe, and can be called at any point before grpc_call_unref"]
- #[doc = "is called."]
- pub fn grpc_call_cancel(
- call: *mut grpc_call,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Cancel an RPC."]
- #[doc = "Can be called multiple times, from any thread."]
- #[doc = "If a status has not been received for the call, set it to the status code"]
- #[doc = "and description passed in."]
- #[doc = "Importantly, this function does not send status nor description to the"]
- #[doc = "remote endpoint."]
- #[doc = "Note that \\a description doesn't need be a static string."]
- #[doc = "It doesn't need to be alive after the call to"]
- #[doc = "grpc_call_cancel_with_status completes."]
- pub fn grpc_call_cancel_with_status(
- call: *mut grpc_call,
- status: grpc_status_code::Type,
- description: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Ref a call."]
- #[doc = "THREAD SAFETY: grpc_call_ref is thread-compatible"]
- pub fn grpc_call_ref(call: *mut grpc_call);
-}
-extern "C" {
- #[doc = " Unref a call."]
- #[doc = "THREAD SAFETY: grpc_call_unref is thread-compatible"]
- pub fn grpc_call_unref(call: *mut grpc_call);
-}
-extern "C" {
- #[doc = " Request notification of a new call."]
- #[doc = "Once a call is received, a notification tagged with \\a tag_new is added to"]
- #[doc = "\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are"]
- #[doc = "updated with the appropriate call information. \\a cq_bound_to_call is bound"]
- #[doc = "to \\a call, and batch operation notifications for that call will be posted"]
- #[doc = "to \\a cq_bound_to_call."]
- #[doc = "Note that \\a cq_for_notification must have been registered to the server via"]
- #[doc = "\\a grpc_server_register_completion_queue."]
- pub fn grpc_server_request_call(
- server: *mut grpc_server,
- call: *mut *mut grpc_call,
- details: *mut grpc_call_details,
- request_metadata: *mut grpc_metadata_array,
- cq_bound_to_call: *mut grpc_completion_queue,
- cq_for_notification: *mut grpc_completion_queue,
- tag_new: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-#[repr(u32)]
-#[doc = " How to handle payloads for a registered method"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_server_register_method_payload_handling {
- #[doc = " Don't try to read the payload"]
- GRPC_SRM_PAYLOAD_NONE = 0,
- #[doc = " Read the initial payload as a byte buffer"]
- GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1,
-}
-extern "C" {
- #[doc = " Registers a method in the server."]
- #[doc = "Methods to this (host, method) pair will not be reported by"]
- #[doc = "grpc_server_request_call, but instead be reported by"]
- #[doc = "grpc_server_request_registered_call when passed the appropriate"]
- #[doc = "registered_method (as returned by this function)."]
- #[doc = "Must be called before grpc_server_start."]
- #[doc = "Returns NULL on failure."]
- pub fn grpc_server_register_method(
- server: *mut grpc_server,
- method: *const ::std::os::raw::c_char,
- host: *const ::std::os::raw::c_char,
- payload_handling: grpc_server_register_method_payload_handling,
- flags: u32,
- ) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'"]
- #[doc = "must have been registered to the server via"]
- #[doc = "grpc_server_register_completion_queue."]
- pub fn grpc_server_request_registered_call(
- server: *mut grpc_server,
- registered_method: *mut ::std::os::raw::c_void,
- call: *mut *mut grpc_call,
- deadline: *mut gpr_timespec,
- request_metadata: *mut grpc_metadata_array,
- optional_payload: *mut *mut grpc_byte_buffer,
- cq_bound_to_call: *mut grpc_completion_queue,
- cq_for_notification: *mut grpc_completion_queue,
- tag_new: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Create a server. Additional configuration for each incoming channel can"]
- #[doc = "be specified with args. If no additional configuration is needed, args can"]
- #[doc = "be NULL. The user data in 'args' need only live through the invocation of"]
- #[doc = "this function. However, if any args of the 'pointer' type are passed, then"]
- #[doc = "the referenced vtable must be maintained by the caller until"]
- #[doc = "grpc_server_destroy terminates. See grpc_channel_args definition for more"]
- #[doc = "on this."]
- pub fn grpc_server_create(
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server;
-}
-extern "C" {
- #[doc = " Register a completion queue with the server. Must be done for any"]
- #[doc = "notification completion queue that is passed to grpc_server_request_*_call"]
- #[doc = "and to grpc_server_shutdown_and_notify. Must be performed prior to"]
- #[doc = "grpc_server_start."]
- pub fn grpc_server_register_completion_queue(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- reserved: *mut ::std::os::raw::c_void,
- );
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_xds_status_notifier {
- pub on_serving_status_update: ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- uri: *const ::std::os::raw::c_char,
- code: grpc_status_code::Type,
- error_message: *const ::std::os::raw::c_char,
- ),
- >,
- pub user_data: *mut ::std::os::raw::c_void,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_config_fetcher {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Creates an xDS config fetcher."]
- pub fn grpc_server_config_fetcher_xds_create(
- notifier: grpc_server_xds_status_notifier,
- args: *const grpc_channel_args,
- ) -> *mut grpc_server_config_fetcher;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Destroys a config fetcher."]
- pub fn grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher);
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership."]
- #[doc = "Must be called before adding ports"]
- pub fn grpc_server_set_config_fetcher(
- server: *mut grpc_server,
- config_fetcher: *mut grpc_server_config_fetcher,
- );
-}
-extern "C" {
- #[doc = " Add a HTTP2 over plaintext over tcp listener."]
- #[doc = "Returns bound port number on success, 0 on failure."]
- #[doc = "REQUIRES: server not started"]
- pub fn grpc_server_add_insecure_http2_port(
- server: *mut grpc_server,
- addr: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Start a server - tells all listeners to start listening"]
- pub fn grpc_server_start(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Begin shutting down a server."]
- #[doc = "After completion, no new calls or connections will be admitted."]
- #[doc = "Existing calls will be allowed to complete."]
- #[doc = "Send a GRPC_OP_COMPLETE event when there are no more calls being serviced."]
- #[doc = "Shutdown is idempotent, and all tags will be notified at once if multiple"]
- #[doc = "grpc_server_shutdown_and_notify calls are made. 'cq' must have been"]
- #[doc = "registered to this server via grpc_server_register_completion_queue."]
- pub fn grpc_server_shutdown_and_notify(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- tag: *mut ::std::os::raw::c_void,
- );
-}
-extern "C" {
- #[doc = " Cancel all in-progress calls."]
- #[doc = "Only usable after shutdown."]
- pub fn grpc_server_cancel_all_calls(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Destroy a server."]
- #[doc = "Shutdown must have completed beforehand (i.e. all tags generated by"]
- #[doc = "grpc_server_shutdown_and_notify must have been received, and at least"]
- #[doc = "one call to grpc_server_shutdown_and_notify must have been made)."]
- pub fn grpc_server_destroy(server: *mut grpc_server);
-}
-extern "C" {
- #[doc = " Enable or disable a tracer."]
- #[doc = ""]
- #[doc = "Tracers (usually controlled by the environment variable GRPC_TRACE)"]
- #[doc = "allow printf-style debugging on GRPC internals, and are useful for"]
- #[doc = "tracking down problems in the field."]
- #[doc = ""]
- #[doc = "Use of this function is not strictly thread-safe, but the"]
- #[doc = "thread-safety issues raised by it should not be of concern."]
- pub fn grpc_tracer_set_enabled(
- name: *const ::std::os::raw::c_char,
- enabled: ::std::os::raw::c_int,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a metadata key is legal (will be accepted by core)"]
- pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a non-binary metadata value is legal (will be accepted by"]
- #[doc = "core)"]
- pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Check whether a metadata key corresponds to a binary value"]
- pub fn grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Convert grpc_call_error values to a string"]
- pub fn grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Create a buffer pool"]
- pub fn grpc_resource_quota_create(
- trace_name: *const ::std::os::raw::c_char,
- ) -> *mut grpc_resource_quota;
-}
-extern "C" {
- #[doc = " Add a reference to a buffer pool"]
- pub fn grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota);
-}
-extern "C" {
- #[doc = " Drop a reference to a buffer pool"]
- pub fn grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota);
-}
-extern "C" {
- #[doc = " Update the size of a buffer pool"]
- pub fn grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize);
-}
-extern "C" {
- #[doc = " Update the size of the maximum number of threads allowed"]
- pub fn grpc_resource_quota_set_max_threads(
- resource_quota: *mut grpc_resource_quota,
- new_max_threads: ::std::os::raw::c_int,
- );
-}
-extern "C" {
- #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto."]
- #[doc = "The full name of the proto is envoy.service.status.v3.ClientConfig."]
- pub fn grpc_dump_xds_configs() -> grpc_slice;
-}
-extern "C" {
- #[doc = " Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota"]
- pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable;
-}
-extern "C" {
- #[doc = " CHANNELZ API *************/"]
- #[doc = "churn as the feature is implemented. This comment will be removed once"]
- #[doc = "channelz is officially supported, and these APIs become stable. For now"]
- #[doc = "you may track the progress by following this github issue:"]
- #[doc = "https://github.com/grpc/grpc/issues/15340"]
- #[doc = ""]
- #[doc = "the following APIs return allocated JSON strings that match the response"]
- #[doc = "objects from the channelz proto, found here:"]
- #[doc = "https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto."]
- #[doc = ""]
- #[doc = "For easy conversion to protobuf, The JSON is formatted according to:"]
- #[doc = "https://developers.google.com/protocol-buffers/docs/proto3#json."]
- pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_server_sockets(
- server_id: isize,
- start_socket_id: isize,
- max_results: isize,
- ) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpc_cronet_secure_channel_create(
- engine: *mut ::std::os::raw::c_void,
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Create a client channel to 'target' using file descriptor 'fd'. The 'target'"]
- #[doc = "argument will be used to indicate the name for this channel. See the comment"]
- #[doc = "for grpc_insecure_channel_create for description of 'args' argument."]
- pub fn grpc_insecure_channel_create_from_fd(
- target: *const ::std::os::raw::c_char,
- fd: ::std::os::raw::c_int,
- args: *const grpc_channel_args,
- ) -> *mut grpc_channel;
-}
-extern "C" {
- #[doc = " Add the connected communication channel based on file descriptor 'fd' to the"]
- #[doc = "'server'. The 'fd' must be an open file descriptor corresponding to a"]
- #[doc = "connected socket. Events from the file descriptor may come on any of the"]
- #[doc = "server completion queues (i.e completion queues registered via the"]
- #[doc = "grpc_server_register_completion_queue API)."]
- #[doc = ""]
- #[doc = "The 'reserved' pointer MUST be NULL."]
- pub fn grpc_server_add_insecure_channel_from_fd(
- server: *mut grpc_server,
- reserved: *mut ::std::os::raw::c_void,
- fd: ::std::os::raw::c_int,
- );
-}
-#[repr(u32)]
-#[doc = " Results for the SSL roots override callback."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_roots_override_result {
- GRPC_SSL_ROOTS_OVERRIDE_OK = 0,
- GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY = 1,
- #[doc = " Do not try fallback options."]
- GRPC_SSL_ROOTS_OVERRIDE_FAIL = 2,
-}
-#[repr(u32)]
-#[doc = " Callback results for dynamically loading a SSL certificate config."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_certificate_config_reload_status {
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED = 0,
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW = 1,
- GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL = 2,
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_ssl_client_certificate_request_type {
- #[doc = " Server does not request client certificate."]
- #[doc = "The certificate presented by the client is not checked by the server at"]
- #[doc = "all. (A client may present a self signed or signed certificate or not"]
- #[doc = "present a certificate at all and any of those option would be accepted)"]
- GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0,
- #[doc = " Server requests client certificate but does not enforce that the client"]
- #[doc = "presents a certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is left to"]
- #[doc = "the application (the necessary metadata will be available to the"]
- #[doc = "application via authentication context properties, see grpc_auth_context)."]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1,
- #[doc = " Server requests client certificate but does not enforce that the client"]
- #[doc = "presents a certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is done by"]
- #[doc = "the gRPC framework. (For a successful connection the client needs to either"]
- #[doc = "present a certificate that can be verified against the root certificate"]
- #[doc = "configured by the server or not present a certificate at all)"]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2,
- #[doc = " Server requests client certificate and enforces that the client presents a"]
- #[doc = "certificate."]
- #[doc = ""]
- #[doc = "If the client presents a certificate, the client authentication is left to"]
- #[doc = "the application (the necessary metadata will be available to the"]
- #[doc = "application via authentication context properties, see grpc_auth_context)."]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3,
- #[doc = " Server requests client certificate and enforces that the client presents a"]
- #[doc = "certificate."]
- #[doc = ""]
- #[doc = "The certificate presented by the client is verified by the gRPC framework."]
- #[doc = "(For a successful connection the client needs to present a certificate that"]
- #[doc = "can be verified against the root certificate configured by the server)"]
- #[doc = ""]
- #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
- #[doc = "be established."]
- GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4,
-}
-impl grpc_security_level {
- pub const GRPC_SECURITY_NONE: grpc_security_level = grpc_security_level::GRPC_SECURITY_MIN;
-}
-impl grpc_security_level {
- pub const GRPC_SECURITY_MAX: grpc_security_level =
- grpc_security_level::GRPC_PRIVACY_AND_INTEGRITY;
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_security_level {
- GRPC_SECURITY_MIN = 0,
- GRPC_INTEGRITY_ONLY = 1,
- GRPC_PRIVACY_AND_INTEGRITY = 2,
-}
-#[repr(u32)]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_tls_server_verification_option {
- #[doc = " Default option: performs server certificate verification and hostname"]
- #[doc = "verification."]
- GRPC_TLS_SERVER_VERIFICATION = 0,
- #[doc = " Performs server certificate verification, but skips hostname verification"]
- #[doc = "Client is responsible for verifying server's identity via"]
- #[doc = "server authorization check callback."]
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION = 1,
- #[doc = " Skips both server certificate and hostname verification."]
- #[doc = "Client is responsible for verifying server's identity and"]
- #[doc = "server's certificate via server authorization check callback."]
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION = 2,
-}
-#[repr(u32)]
-#[doc = " Type of local connections for which local channel/server credentials will be"]
-#[doc = " applied. It supports UDS and local TCP connections."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_local_connect_type {
- UDS = 0,
- LOCAL_TCP = 1,
-}
-#[repr(u32)]
-#[doc = " The TLS versions that are supported by the SSL stack."]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum grpc_tls_version {
- TLS1_2 = 0,
- TLS1_3 = 1,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_context {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_property_iterator {
- pub ctx: *const grpc_auth_context,
- pub index: usize,
- pub name: *const ::std::os::raw::c_char,
-}
-#[doc = " value, if not NULL, is guaranteed to be NULL terminated."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_property {
- pub name: *mut ::std::os::raw::c_char,
- pub value: *mut ::std::os::raw::c_char,
- pub value_length: usize,
-}
-extern "C" {
- #[doc = " Returns NULL when the iterator is at the end."]
- pub fn grpc_auth_property_iterator_next(
- it: *mut grpc_auth_property_iterator,
- ) -> *const grpc_auth_property;
-}
-extern "C" {
- #[doc = " Iterates over the auth context."]
- pub fn grpc_auth_context_property_iterator(
- ctx: *const grpc_auth_context,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return"]
- #[doc = "NULL) if the peer is not authenticated."]
- pub fn grpc_auth_context_peer_identity(
- ctx: *const grpc_auth_context,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Finds a property in the context. May return an empty iterator (first _next"]
- #[doc = "will return NULL) if no property with this name was found in the context."]
- pub fn grpc_auth_context_find_properties_by_name(
- ctx: *const grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- ) -> grpc_auth_property_iterator;
-}
-extern "C" {
- #[doc = " Gets the name of the property that indicates the peer identity. Will return"]
- #[doc = "NULL if the peer is not authenticated."]
- pub fn grpc_auth_context_peer_identity_property_name(
- ctx: *const grpc_auth_context,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns 1 if the peer is authenticated, 0 otherwise."]
- pub fn grpc_auth_context_peer_is_authenticated(
- ctx: *const grpc_auth_context,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Gets the auth context from the call. Caller needs to call"]
- #[doc = "grpc_auth_context_release on the returned context."]
- pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context;
-}
-extern "C" {
- #[doc = " Releases the auth context returned from grpc_call_auth_context."]
- pub fn grpc_auth_context_release(context: *mut grpc_auth_context);
-}
-extern "C" {
- #[doc = " Add a property."]
- pub fn grpc_auth_context_add_property(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- value_length: usize,
- );
-}
-extern "C" {
- #[doc = " Add a C string property."]
- pub fn grpc_auth_context_add_cstring_property(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure"]
- #[doc = "(which means that no property with this name exists)."]
- pub fn grpc_auth_context_set_peer_identity_property_name(
- ctx: *mut grpc_auth_context,
- name: *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_session_cache {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Create LRU cache for client-side SSL sessions with the given capacity."]
- #[doc = "If capacity is < 1, a default capacity is used instead."]
- pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache;
-}
-extern "C" {
- #[doc = " Destroy SSL session cache."]
- pub fn grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache);
-}
-extern "C" {
- #[doc = " Create a channel arg with the given cache object."]
- pub fn grpc_ssl_session_cache_create_channel_arg(
- cache: *mut grpc_ssl_session_cache,
- ) -> grpc_arg;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_call_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a call credentials object."]
- #[doc = "The creator of the credentials object is responsible for its release."]
- pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials);
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_channel_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a channel credentials object."]
- #[doc = "The creator of the credentials object is responsible for its release."]
- pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials);
-}
-extern "C" {
- #[doc = " Creates default credentials to connect to a google gRPC service."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak. The security level of the"]
- #[doc = "resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = ""]
- #[doc = "If specified, the supplied call credentials object will be attached to the"]
- #[doc = "returned channel credentials object. The call_credentials object must remain"]
- #[doc = "valid throughout the lifetime of the returned grpc_channel_credentials"]
- #[doc = "object. It is expected that the call credentials object was generated"]
- #[doc = "according to the Application Default Credentials mechanism and asserts the"]
- #[doc = "identity of the default service account of the machine. Supplying any other"]
- #[doc = "sort of call credential will result in undefined behavior, up to and"]
- #[doc = "including the sudden and unexpected failure of RPCs."]
- #[doc = ""]
- #[doc = "If nullptr is supplied, the returned channel credentials object will use a"]
- #[doc = "call credentials object based on the Application Default Credentials"]
- #[doc = "mechanism."]
- pub fn grpc_google_default_credentials_create(
- call_credentials: *mut grpc_call_credentials,
- ) -> *mut grpc_channel_credentials;
-}
-#[doc = " Callback for getting the SSL roots override from the application."]
-#[doc = "In case of success, *pem_roots_certs must be set to a NULL terminated string"]
-#[doc = "containing the list of PEM encoded root certificates. The ownership is passed"]
-#[doc = "to the core and freed (laster by the core) with gpr_free."]
-#[doc = "If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is"]
-#[doc = "set to a valid path, it will override the roots specified this func"]
-pub type grpc_ssl_roots_override_callback = ::std::option::Option<
- unsafe extern "C" fn(
- pem_root_certs: *mut *mut ::std::os::raw::c_char,
- ) -> grpc_ssl_roots_override_result,
->;
-extern "C" {
- #[doc = " Setup a callback to override the default TLS/SSL roots."]
- #[doc = "This function is not thread-safe and must be called at initialization time"]
- #[doc = "before any ssl credentials are created to have the desired side effect."]
- #[doc = "If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the"]
- #[doc = "callback will not be called."]
- pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback);
-}
-#[doc = " Object that holds a private key / certificate chain pair in PEM format."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_pem_key_cert_pair {
- #[doc = " private_key is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client's private key."]
- pub private_key: *const ::std::os::raw::c_char,
- #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client's certificate chain."]
- pub cert_chain: *const ::std::os::raw::c_char,
-}
-#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed"]
-#[doc = "after all of its call sites are migrated to grpc_ssl_verify_peer_options."]
-#[doc = "Object that holds additional peer-verification options on a secure"]
-#[doc = "channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct verify_peer_options {
- #[doc = " If non-NULL this callback will be invoked with the expected"]
- #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
- #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
- #[doc = "callback then it is treated as a verification failure. Invocation of"]
- #[doc = "the callback is blocking, so any implementation should be light-weight."]
- pub verify_peer_callback: ::std::option::Option<
- unsafe extern "C" fn(
- target_name: *const ::std::os::raw::c_char,
- peer_pem: *const ::std::os::raw::c_char,
- userdata: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Arbitrary userdata that will be passed as the last argument to"]
- #[doc = "verify_peer_callback."]
- pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
- #[doc = " A destruct callback that will be invoked when the channel is being"]
- #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
- #[doc = "to perform any cleanup associated with that userdata."]
- pub verify_peer_destruct:
- ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
-}
-#[doc = " Object that holds additional peer-verification options on a secure"]
-#[doc = "channel."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_verify_peer_options {
- #[doc = " If non-NULL this callback will be invoked with the expected"]
- #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
- #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
- #[doc = "callback then it is treated as a verification failure. Invocation of"]
- #[doc = "the callback is blocking, so any implementation should be light-weight."]
- pub verify_peer_callback: ::std::option::Option<
- unsafe extern "C" fn(
- target_name: *const ::std::os::raw::c_char,
- peer_pem: *const ::std::os::raw::c_char,
- userdata: *mut ::std::os::raw::c_void,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Arbitrary userdata that will be passed as the last argument to"]
- #[doc = "verify_peer_callback."]
- pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
- #[doc = " A destruct callback that will be invoked when the channel is being"]
- #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
- #[doc = "to perform any cleanup associated with that userdata."]
- pub verify_peer_destruct:
- ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
-}
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be"]
- #[doc = "removed after all of its call sites are migrated to"]
- #[doc = "grpc_ssl_server_credentials_create_ex. Creates an SSL credentials object."]
- #[doc = "The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = "- pem_root_certs is the NULL-terminated string containing the PEM encoding"]
- #[doc = "of the server root certificates. If this parameter is NULL, the"]
- #[doc = "implementation will first try to dereference the file pointed by the"]
- #[doc = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,"]
- #[doc = "try to get the roots set by grpc_override_ssl_default_roots. Eventually,"]
- #[doc = "if all these fail, it will try to get the roots from a well-known place on"]
- #[doc = "disk (in the grpc install directory)."]
- #[doc = ""]
- #[doc = "gRPC has implemented root cache if the underlying OpenSSL library supports"]
- #[doc = "it. The gRPC root certificates cache is only applicable on the default"]
- #[doc = "root certificates, which is used when this parameter is nullptr. If user"]
- #[doc = "provides their own pem_root_certs, when creating an SSL credential object,"]
- #[doc = "gRPC would not be able to cache it, and each subchannel will generate a"]
- #[doc = "copy of the root store. So it is recommended to avoid providing large room"]
- #[doc = "pem with pem_root_certs parameter to avoid excessive memory consumption,"]
- #[doc = "particularly on mobile platforms such as iOS."]
- #[doc = "- pem_key_cert_pair is a pointer on the object containing client's private"]
- #[doc = "key and certificate chain. This parameter can be NULL if the client does"]
- #[doc = "not have such a key/cert pair."]
- #[doc = "- verify_options is an optional verify_peer_options object which holds"]
- #[doc = "additional options controlling how peer certificates are verified. For"]
- #[doc = "example, you can supply a callback which receives the peer's certificate"]
- #[doc = "with which you can do additional verification. Can be NULL, in which"]
- #[doc = "case verification will retain default behavior. Any settings in"]
- #[doc = "verify_options are copied during this call, so the verify_options"]
- #[doc = "object can be released afterwards."]
- pub fn grpc_ssl_credentials_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
- verify_options: *const verify_peer_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- pub fn grpc_ssl_credentials_create_ex(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
- verify_options: *const grpc_ssl_verify_peer_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a composite channel credentials object. The security level of"]
- #[doc = " resulting connection is determined by channel_creds."]
- pub fn grpc_composite_channel_credentials_create(
- channel_creds: *mut grpc_channel_credentials,
- call_creds: *mut grpc_call_credentials,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a composite call credentials object."]
- pub fn grpc_composite_call_credentials_create(
- creds1: *mut grpc_call_credentials,
- creds2: *mut grpc_call_credentials,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates a compute engine credentials object for connecting to Google."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak."]
- pub fn grpc_google_compute_engine_credentials_create(
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- pub fn grpc_max_auth_token_lifetime() -> gpr_timespec;
-}
-extern "C" {
- #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid."]
- #[doc = "- json_key is the JSON key string containing the client's private key."]
- #[doc = "- token_lifetime is the lifetime of each Json Web Token (JWT) created with"]
- #[doc = "this credentials. It should not exceed grpc_max_auth_token_lifetime or"]
- #[doc = "will be cropped to this value."]
- pub fn grpc_service_account_jwt_access_credentials_create(
- json_key: *const ::std::os::raw::c_char,
- token_lifetime: gpr_timespec,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Builds External Account credentials."]
- #[doc = "- json_string is the JSON string containing the credentials options."]
- #[doc = "- scopes_string contains the scopes to be binded with the credentials."]
- #[doc = "This API is used for experimental purposes for now and may change in the"]
- #[doc = "future."]
- pub fn grpc_external_account_credentials_create(
- json_string: *const ::std::os::raw::c_char,
- scopes_string: *const ::std::os::raw::c_char,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google."]
- #[doc = "May return NULL if the input is invalid."]
- #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
- #[doc = "this could result in an oauth2 token leak."]
- #[doc = "- json_refresh_token is the JSON string containing the refresh token itself"]
- #[doc = "along with a client_id and client_secret."]
- pub fn grpc_google_refresh_token_credentials_create(
- json_refresh_token: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an Oauth2 Access Token credentials with an access token that was"]
- #[doc = "acquired by an out of band mechanism."]
- pub fn grpc_access_token_credentials_create(
- access_token: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates an IAM credentials object for connecting to Google."]
- pub fn grpc_google_iam_credentials_create(
- authorization_token: *const ::std::os::raw::c_char,
- authority_selector: *const ::std::os::raw::c_char,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF"]
-#[doc = "draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
-#[doc = "Optional fields may be set to NULL or empty string. It is the responsibility"]
-#[doc = "of the caller to ensure that the subject and actor tokens are refreshed on"]
-#[doc = "disk at the specified paths. This API is used for experimental purposes for"]
-#[doc = "now and may change in the future."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_sts_credentials_options {
- pub token_exchange_service_uri: *const ::std::os::raw::c_char,
- pub resource: *const ::std::os::raw::c_char,
- pub audience: *const ::std::os::raw::c_char,
- pub scope: *const ::std::os::raw::c_char,
- pub requested_token_type: *const ::std::os::raw::c_char,
- pub subject_token_path: *const ::std::os::raw::c_char,
- pub subject_token_type: *const ::std::os::raw::c_char,
- pub actor_token_path: *const ::std::os::raw::c_char,
- pub actor_token_type: *const ::std::os::raw::c_char,
-}
-extern "C" {
- #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the"]
- #[doc = "IETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
- #[doc = "This API is used for experimental purposes for now and may change in the"]
- #[doc = "future."]
- pub fn grpc_sts_credentials_create(
- options: *const grpc_sts_credentials_options,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-#[doc = " Callback function to be called by the metadata credentials plugin"]
-#[doc = "implementation when the metadata is ready."]
-#[doc = "- user_data is the opaque pointer that was passed in the get_metadata method"]
-#[doc = "of the grpc_metadata_credentials_plugin (see below)."]
-#[doc = "- creds_md is an array of credentials metadata produced by the plugin. It"]
-#[doc = "may be set to NULL in case of an error."]
-#[doc = "- num_creds_md is the number of items in the creds_md array."]
-#[doc = "- status must be GRPC_STATUS_OK in case of success or another specific error"]
-#[doc = "code otherwise."]
-#[doc = "- error_details contains details about the error if any. In case of success"]
-#[doc = "it should be NULL and will be otherwise ignored."]
-pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- creds_md: *const grpc_metadata,
- num_creds_md: usize,
- status: grpc_status_code::Type,
- error_details: *const ::std::os::raw::c_char,
- ),
->;
-#[doc = " Context that can be used by metadata credentials plugin in order to create"]
-#[doc = "auth related metadata."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_metadata_context {
- #[doc = " The fully qualifed service url."]
- pub service_url: *const ::std::os::raw::c_char,
- #[doc = " The method name of the RPC being called (not fully qualified)."]
- #[doc = "The fully qualified method name can be built from the service_url:"]
- #[doc = "full_qualified_method_name = ctx->service_url + '/' + ctx->method_name."]
- pub method_name: *const ::std::os::raw::c_char,
- #[doc = " The auth_context of the channel which gives the server's identity."]
- pub channel_auth_context: *const grpc_auth_context,
- #[doc = " Reserved for future use."]
- pub reserved: *mut ::std::os::raw::c_void,
-}
-extern "C" {
- #[doc = " Performs a deep copy from \\a from to \\a to."]
- pub fn grpc_auth_metadata_context_copy(
- from: *mut grpc_auth_metadata_context,
- to: *mut grpc_auth_metadata_context,
- );
-}
-extern "C" {
- #[doc = " Releases internal resources held by \\a context."]
- pub fn grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context);
-}
-#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to"]
-#[doc = "create grpc_credentials objects that can be set on a channel (composed) or"]
-#[doc = "a call. See grpc_credentials_metadata_create_from_plugin below."]
-#[doc = "The grpc client stack will call the get_metadata method of the plugin for"]
-#[doc = "every call in scope for the credentials created from it."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_metadata_credentials_plugin {
- #[doc = " The implementation of this method has to be non-blocking, but can"]
- #[doc = "be performed synchronously or asynchronously."]
- #[doc = ""]
- #[doc = "If processing occurs synchronously, returns non-zero and populates"]
- #[doc = "creds_md, num_creds_md, status, and error_details. In this case,"]
- #[doc = "the caller takes ownership of the entries in creds_md and of"]
- #[doc = "error_details. Note that if the plugin needs to return more than"]
- #[doc = "GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must"]
- #[doc = "return asynchronously."]
- #[doc = ""]
- #[doc = "If processing occurs asynchronously, returns zero and invokes \\a cb"]
- #[doc = "when processing is completed. \\a user_data will be passed as the"]
- #[doc = "first parameter of the callback. NOTE: \\a cb MUST be invoked in a"]
- #[doc = "different thread, not from the thread in which \\a get_metadata() is"]
- #[doc = "invoked."]
- #[doc = ""]
- #[doc = "\\a context is the information that can be used by the plugin to create"]
- #[doc = "auth metadata."]
- pub get_metadata: ::std::option::Option<
- unsafe extern "C" fn(
- state: *mut ::std::os::raw::c_void,
- context: grpc_auth_metadata_context,
- cb: grpc_credentials_plugin_metadata_cb,
- user_data: *mut ::std::os::raw::c_void,
- creds_md: *mut grpc_metadata,
- num_creds_md: *mut usize,
- status: *mut grpc_status_code::Type,
- error_details: *mut *const ::std::os::raw::c_char,
- ) -> ::std::os::raw::c_int,
- >,
- #[doc = " Implements debug string of the given plugin. This method returns an"]
- #[doc = " allocated string that the caller needs to free using gpr_free()"]
- pub debug_string: ::std::option::Option<
- unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char,
- >,
- #[doc = " Destroys the plugin state."]
- pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
- #[doc = " State that will be set as the first parameter of the methods above."]
- pub state: *mut ::std::os::raw::c_void,
- #[doc = " Type of credentials that this plugin is implementing."]
- pub type_: *const ::std::os::raw::c_char,
-}
-extern "C" {
- #[doc = " Creates a credentials object from a plugin with a specified minimum security"]
- #[doc = " level."]
- pub fn grpc_metadata_credentials_create_from_plugin(
- plugin: grpc_metadata_credentials_plugin,
- min_security_level: grpc_security_level,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_call_credentials;
-}
-extern "C" {
- #[doc = " Creates a secure channel using the passed-in credentials. Additional"]
- #[doc = "channel level configuration MAY be provided by grpc_channel_args, though"]
- #[doc = "the expectation is that most clients will want to simply pass NULL. The"]
- #[doc = "user data in 'args' need only live through the invocation of this function."]
- #[doc = "However, if any args of the 'pointer' type are passed, then the referenced"]
- #[doc = "vtable must be maintained by the caller until grpc_channel_destroy"]
- #[doc = "terminates. See grpc_channel_args definition for more on this."]
- pub fn grpc_secure_channel_create(
- creds: *mut grpc_channel_credentials,
- target: *const ::std::os::raw::c_char,
- args: *const grpc_channel_args,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_channel;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_server_credentials {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Releases a server_credentials object."]
- #[doc = "The creator of the server_credentials object is responsible for its release."]
- pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials);
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_server_certificate_config {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates a grpc_ssl_server_certificate_config object."]
- #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client root certificates. This parameter may be NULL if the server does"]
- #[doc = "not want the client to be authenticated with SSL."]
- #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
- #[doc = "server. This parameter cannot be NULL."]
- #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
- #[doc = "and cert_chain_files parameters. It must be at least 1."]
- #[doc = "- It is the caller's responsibility to free this object via"]
- #[doc = "grpc_ssl_server_certificate_config_destroy()."]
- pub fn grpc_ssl_server_certificate_config_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- ) -> *mut grpc_ssl_server_certificate_config;
-}
-extern "C" {
- #[doc = " Destroys a grpc_ssl_server_certificate_config object."]
- pub fn grpc_ssl_server_certificate_config_destroy(
- config: *mut grpc_ssl_server_certificate_config,
- );
-}
-#[doc = " Callback to retrieve updated SSL server certificates, private keys, and"]
-#[doc = "trusted CAs (for client authentication)."]
-#[doc = "- user_data parameter, if not NULL, contains opaque data to be used by the"]
-#[doc = "callback."]
-#[doc = "- Use grpc_ssl_server_certificate_config_create to create the config."]
-#[doc = "- The caller assumes ownership of the config."]
-pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- config: *mut *mut grpc_ssl_server_certificate_config,
- ) -> grpc_ssl_certificate_config_reload_status,
->;
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex."]
- #[doc = "Creates an SSL server_credentials object."]
- #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
- #[doc = "the client root certificates. This parameter may be NULL if the server does"]
- #[doc = "not want the client to be authenticated with SSL."]
- #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
- #[doc = "server. This parameter cannot be NULL."]
- #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
- #[doc = "and cert_chain_files parameters. It should be at least 1."]
- #[doc = "- force_client_auth, if set to non-zero will force the client to authenticate"]
- #[doc = "with an SSL cert. Note that this option is ignored if pem_root_certs is"]
- #[doc = "NULL."]
- pub fn grpc_ssl_server_credentials_create(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- force_client_auth: ::std::os::raw::c_int,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options."]
- #[doc = "Same as grpc_ssl_server_credentials_create method except uses"]
- #[doc = "grpc_ssl_client_certificate_request_type enum to support more ways to"]
- #[doc = "authenticate client certificates."]
- pub fn grpc_ssl_server_credentials_create_ex(
- pem_root_certs: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
- num_key_cert_pairs: usize,
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- reserved: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_ssl_server_credentials_options {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates an options object using a certificate config. Use this method when"]
- #[doc = "the certificates and keys of the SSL server will not change during the"]
- #[doc = "server's lifetime."]
- #[doc = "- Takes ownership of the certificate_config parameter."]
- pub fn grpc_ssl_server_credentials_create_options_using_config(
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- certificate_config: *mut grpc_ssl_server_certificate_config,
- ) -> *mut grpc_ssl_server_credentials_options;
-}
-extern "C" {
- #[doc = " Creates an options object using a certificate config fetcher. Use this"]
- #[doc = "method to reload the certificates and keys of the SSL server without"]
- #[doc = "interrupting the operation of the server. Initial certificate config will be"]
- #[doc = "fetched during server initialization."]
- #[doc = "- user_data parameter, if not NULL, contains opaque data which will be passed"]
- #[doc = "to the fetcher (see definition of"]
- #[doc = "grpc_ssl_server_certificate_config_callback)."]
- pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher(
- client_certificate_request: grpc_ssl_client_certificate_request_type,
- cb: grpc_ssl_server_certificate_config_callback,
- user_data: *mut ::std::os::raw::c_void,
- ) -> *mut grpc_ssl_server_credentials_options;
-}
-extern "C" {
- #[doc = " Destroys a grpc_ssl_server_credentials_options object."]
- pub fn grpc_ssl_server_credentials_options_destroy(
- options: *mut grpc_ssl_server_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Creates an SSL server_credentials object using the provided options struct."]
- #[doc = "- Takes ownership of the options parameter."]
- pub fn grpc_ssl_server_credentials_create_with_options(
- options: *mut grpc_ssl_server_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " Add a HTTP2 over an encrypted link over tcp listener."]
- #[doc = "Returns bound port number on success, 0 on failure."]
- #[doc = "REQUIRES: server not started"]
- pub fn grpc_server_add_secure_http2_port(
- server: *mut grpc_server,
- addr: *const ::std::os::raw::c_char,
- creds: *mut grpc_server_credentials,
- ) -> ::std::os::raw::c_int;
-}
-extern "C" {
- #[doc = " Sets a credentials to a call. Can only be called on the client side before"]
- #[doc = "grpc_call_start_batch."]
- pub fn grpc_call_set_credentials(
- call: *mut grpc_call,
- creds: *mut grpc_call_credentials,
- ) -> grpc_call_error;
-}
-#[doc = " Callback function that is called when the metadata processing is done."]
-#[doc = "- Consumed metadata will be removed from the set of metadata available on the"]
-#[doc = "call. consumed_md may be NULL if no metadata has been consumed."]
-#[doc = "- Response metadata will be set on the response. response_md may be NULL."]
-#[doc = "- status is GRPC_STATUS_OK for success or a specific status for an error."]
-#[doc = "Common error status for auth metadata processing is either"]
-#[doc = "GRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or"]
-#[doc = "GRPC_STATUS PERMISSION_DENIED in case of an authorization failure."]
-#[doc = "- error_details gives details about the error. May be NULL."]
-pub type grpc_process_auth_metadata_done_cb = ::std::option::Option<
- unsafe extern "C" fn(
- user_data: *mut ::std::os::raw::c_void,
- consumed_md: *const grpc_metadata,
- num_consumed_md: usize,
- response_md: *const grpc_metadata,
- num_response_md: usize,
- status: grpc_status_code::Type,
- error_details: *const ::std::os::raw::c_char,
- ),
->;
-#[doc = " Pluggable server-side metadata processor object."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_auth_metadata_processor {
- #[doc = " The context object is read/write: it contains the properties of the"]
- #[doc = "channel peer and it is the job of the process function to augment it with"]
- #[doc = "properties derived from the passed-in metadata."]
- #[doc = "The lifetime of these objects is guaranteed until cb is invoked."]
- pub process: ::std::option::Option<
- unsafe extern "C" fn(
- state: *mut ::std::os::raw::c_void,
- context: *mut grpc_auth_context,
- md: *const grpc_metadata,
- num_md: usize,
- cb: grpc_process_auth_metadata_done_cb,
- user_data: *mut ::std::os::raw::c_void,
- ),
- >,
- pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
- pub state: *mut ::std::os::raw::c_void,
-}
-extern "C" {
- pub fn grpc_server_credentials_set_auth_metadata_processor(
- creds: *mut grpc_server_credentials,
- processor: grpc_auth_metadata_processor,
- );
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_alts_credentials_options {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " This method creates a grpc ALTS credentials client options instance."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options;
-}
-extern "C" {
- #[doc = " This method creates a grpc ALTS credentials server options instance."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options;
-}
-extern "C" {
- #[doc = " This method adds a target service account to grpc client's ALTS credentials"]
- #[doc = " options instance. It is used for experimental purpose for now and subject"]
- #[doc = " to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance."]
- #[doc = " - service_account: service account of target endpoint."]
- pub fn grpc_alts_credentials_client_options_add_target_service_account(
- options: *mut grpc_alts_credentials_options,
- service_account: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " This method destroys a grpc_alts_credentials_options instance by"]
- #[doc = " de-allocating all of its occupied memory. It is used for experimental purpose"]
- #[doc = " for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: a grpc_alts_credentials_options instance that needs to be"]
- #[doc = " destroyed."]
- pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options);
-}
-extern "C" {
- #[doc = " This method creates an ALTS channel credential object. The security"]
- #[doc = " level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance for client."]
- #[doc = ""]
- #[doc = " It returns the created ALTS channel credential object."]
- pub fn grpc_alts_credentials_create(
- options: *const grpc_alts_credentials_options,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " This method creates an ALTS server credential object. It is used for"]
- #[doc = " experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - options: grpc ALTS credentials options instance for server."]
- #[doc = ""]
- #[doc = " It returns the created ALTS server credential object."]
- pub fn grpc_alts_server_credentials_create(
- options: *const grpc_alts_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " This method creates a local channel credential object. The security level"]
- #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and"]
- #[doc = " GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose"]
- #[doc = " for now and subject to change."]
- #[doc = ""]
- #[doc = " - type: local connection type"]
- #[doc = ""]
- #[doc = " It returns the created local channel credential object."]
- pub fn grpc_local_credentials_create(
- type_: grpc_local_connect_type,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " This method creates a local server credential object. It is used for"]
- #[doc = " experimental purpose for now and subject to change."]
- #[doc = ""]
- #[doc = " - type: local connection type"]
- #[doc = ""]
- #[doc = " It returns the created local server credential object."]
- pub fn grpc_local_server_credentials_create(
- type_: grpc_local_connect_type,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_error_details {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_server_authorization_check_config {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_credentials_options {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_certificate_provider {
- _unused: [u8; 0],
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_identity_pairs {
- _unused: [u8; 0],
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_identity_pairs that stores a list of identity credential"]
- #[doc = " data, including identity private key and identity certificate chain. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs;
-}
-extern "C" {
- #[doc = " Adds a identity private key and a identity certificate chain to"]
- #[doc = " grpc_tls_identity_pairs. This function will make an internal copy of"]
- #[doc = " |private_key| and |cert_chain|. It is used for experimental purpose for now"]
- #[doc = " and subject to change."]
- pub fn grpc_tls_identity_pairs_add_pair(
- pairs: *mut grpc_tls_identity_pairs,
- private_key: *const ::std::os::raw::c_char,
- cert_chain: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Destroys a grpc_tls_identity_pairs object. If this object is passed to a"]
- #[doc = " provider initiation function, the ownership is transferred so this function"]
- #[doc = " doesn't need to be called. Otherwise the creator of the"]
- #[doc = " grpc_tls_identity_pairs object is responsible for its destruction. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs);
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_certificate_provider that will load credential data from"]
- #[doc = " static string during initialization. This provider will always return the"]
- #[doc = " same cert data for all cert names."]
- #[doc = " root_certificate and pem_key_cert_pairs can be nullptr, indicating the"]
- #[doc = " corresponding credential data is not needed."]
- #[doc = " This function will make a copy of |root_certificate|."]
- #[doc = " The ownership of |pem_key_cert_pairs| is transferred."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_static_data_create(
- root_certificate: *const ::std::os::raw::c_char,
- pem_key_cert_pairs: *mut grpc_tls_identity_pairs,
- ) -> *mut grpc_tls_certificate_provider;
-}
-extern "C" {
- #[doc = " Creates a grpc_tls_certificate_provider that will watch the credential"]
- #[doc = " changes on the file system. This provider will always return the up-to-date"]
- #[doc = " cert data for all the cert names callers set through"]
- #[doc = " |grpc_tls_credentials_options|. Note that this API only supports one key-cert"]
- #[doc = " file and hence one set of identity key-cert pair, so SNI(Server Name"]
- #[doc = " Indication) is not supported."]
- #[doc = " - private_key_path is the file path of the private key. This must be set if"]
- #[doc = " |identity_certificate_path| is set. Otherwise, it could be null if no"]
- #[doc = " identity credentials are needed."]
- #[doc = " - identity_certificate_path is the file path of the identity certificate"]
- #[doc = " chain. This must be set if |private_key_path| is set. Otherwise, it could"]
- #[doc = " be null if no identity credentials are needed."]
- #[doc = " - root_cert_path is the file path to the root certificate bundle. This"]
- #[doc = " may be null if no root certs are needed."]
- #[doc = " - refresh_interval_sec is the refreshing interval that we will check the"]
- #[doc = " files for updates."]
- #[doc = " It does not take ownership of parameters."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_file_watcher_create(
- private_key_path: *const ::std::os::raw::c_char,
- identity_certificate_path: *const ::std::os::raw::c_char,
- root_cert_path: *const ::std::os::raw::c_char,
- refresh_interval_sec: ::std::os::raw::c_uint,
- ) -> *mut grpc_tls_certificate_provider;
-}
-extern "C" {
- #[doc = " Releases a grpc_tls_certificate_provider object. The creator of the"]
- #[doc = " grpc_tls_certificate_provider object is responsible for its release. It is"]
- #[doc = " used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider);
-}
-extern "C" {
- #[doc = " Creates an grpc_tls_credentials_options."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options;
-}
-extern "C" {
- #[doc = " Sets the options of whether to request and verify client certs. This should"]
- #[doc = " be called only on the server side. It is used for experimental purpose for"]
- #[doc = " now and subject to change."]
- pub fn grpc_tls_credentials_options_set_cert_request_type(
- options: *mut grpc_tls_credentials_options,
- type_: grpc_ssl_client_certificate_request_type,
- );
-}
-extern "C" {
- #[doc = " Sets the options of whether to choose certain checks, e.g. certificate check,"]
- #[doc = " hostname check, etc. This should be called only on the client side. If"]
- #[doc = " |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a"]
- #[doc = " custom authorization check (grpc_tls_server_authorization_check_config) is"]
- #[doc = " mandatory. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_server_verification_option(
- options: *mut grpc_tls_credentials_options,
- server_verification_option: grpc_tls_server_verification_option,
- );
-}
-extern "C" {
- #[doc = " Sets the credential provider in the options."]
- #[doc = " The |options| will implicitly take a new ref to the |provider|."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_certificate_provider(
- options: *mut grpc_tls_credentials_options,
- provider: *mut grpc_tls_certificate_provider,
- );
-}
-extern "C" {
- #[doc = " If set, gRPC stack will keep watching the root certificates with"]
- #[doc = " name |root_cert_name|."]
- #[doc = " If this is not set on the client side, we will use the root certificates"]
- #[doc = " stored in the default system location, since client side must provide root"]
- #[doc = " certificates in TLS."]
- #[doc = " If this is not set on the server side, we will not watch any root certificate"]
- #[doc = " updates, and assume no root certificates needed for the server(single-side"]
- #[doc = " TLS). Default root certs on the server side is not supported."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_watch_root_certs(
- options: *mut grpc_tls_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Sets the name of the root certificates being watched."]
- #[doc = " If not set, We will use a default empty string as the root certificate name."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_root_cert_name(
- options: *mut grpc_tls_credentials_options,
- root_cert_name: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " If set, gRPC stack will keep watching the identity key-cert pairs"]
- #[doc = " with name |identity_cert_name|."]
- #[doc = " This is required on the server side, and optional on the client side."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_watch_identity_key_cert_pairs(
- options: *mut grpc_tls_credentials_options,
- );
-}
-extern "C" {
- #[doc = " Sets the name of the identity certificates being watched."]
- #[doc = " If not set, We will use a default empty string as the identity certificate"]
- #[doc = " name. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_identity_cert_name(
- options: *mut grpc_tls_credentials_options,
- identity_cert_name: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Sets the configuration for a custom authorization check performed at the end"]
- #[doc = " of the handshake. The |options| will implicitly take a new ref to the"]
- #[doc = " |config|."]
- #[doc = " It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_options_set_server_authorization_check_config(
- options: *mut grpc_tls_credentials_options,
- config: *mut grpc_tls_server_authorization_check_config,
- );
-}
-#[doc = " callback function provided by gRPC used to handle the result of server"]
-#[doc = "authorization check. It is used when schedule API is implemented"]
-#[doc = "asynchronously, and serves to bring the control back to gRPC C core. It is"]
-#[doc = "used for experimental purpose for now and subject to change."]
-pub type grpc_tls_on_server_authorization_check_done_cb =
- ::std::option::Option<unsafe extern "C" fn(arg: *mut grpc_tls_server_authorization_check_arg)>;
-#[doc = " A struct containing all information necessary to schedule/cancel a server"]
-#[doc = "authorization check request."]
-#[doc = "- cb and cb_user_data represent a gRPC-provided callback and an argument"]
-#[doc = "passed to it."]
-#[doc = "- success will store the result of server authorization check. That is,"]
-#[doc = "if success returns a non-zero value, it means the authorization check"]
-#[doc = "passes and if returning zero, it means the check fails."]
-#[doc = "- target_name is the name of an endpoint the channel is connecting to."]
-#[doc = "- peer_cert represents a complete certificate chain including both"]
-#[doc = "signing and leaf certificates."]
-#[doc = "- \\a subject_alternative_names is an array of size"]
-#[doc = "\\a subject_alternative_names_size consisting of pointers to strings."]
-#[doc = "- status and error_details contain information"]
-#[doc = "about errors occurred when a server authorization check request is"]
-#[doc = "scheduled/cancelled."]
-#[doc = "- config is a pointer to the unique"]
-#[doc = "grpc_tls_server_authorization_check_config instance that this argument"]
-#[doc = "corresponds to."]
-#[doc = "- context is a pointer to a wrapped language implementation of this"]
-#[doc = "grpc_tls_server_authorization_check_arg instance."]
-#[doc = "- destroy_context is a pointer to a caller-provided method that cleans"]
-#[doc = "up any data associated with the context pointer."]
-#[doc = "It is used for experimental purpose for now and subject to change."]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpc_tls_server_authorization_check_arg {
- pub cb: grpc_tls_on_server_authorization_check_done_cb,
- pub cb_user_data: *mut ::std::os::raw::c_void,
- pub success: ::std::os::raw::c_int,
- pub target_name: *const ::std::os::raw::c_char,
- pub peer_cert: *const ::std::os::raw::c_char,
- pub peer_cert_full_chain: *const ::std::os::raw::c_char,
- pub subject_alternative_names: *mut *mut ::std::os::raw::c_char,
- pub subject_alternative_names_size: usize,
- pub status: grpc_status_code::Type,
- pub error_details: *mut grpc_tls_error_details,
- pub config: *mut grpc_tls_server_authorization_check_config,
- pub context: *mut ::std::os::raw::c_void,
- pub destroy_context:
- ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>,
-}
-extern "C" {
- #[doc = " Create a grpc_tls_server_authorization_check_config instance."]
- #[doc = "- config_user_data is config-specific, read-only user data"]
- #[doc = "that works for all channels created with a credential using the config."]
- #[doc = "- schedule is a pointer to an application-provided callback used to invoke"]
- #[doc = "server authorization check API. The implementation of this method has to"]
- #[doc = "be non-blocking, but can be performed synchronously or asynchronously."]
- #[doc = "1)If processing occurs synchronously, it populates arg->result,"]
- #[doc = "arg->status, and arg->error_details and returns zero."]
- #[doc = "2) If processing occurs asynchronously, it returns a non-zero value. The"]
- #[doc = "application then invokes arg->cb when processing is completed. Note that"]
- #[doc = "arg->cb cannot be invoked before schedule API returns."]
- #[doc = "- cancel is a pointer to an application-provided callback used to cancel a"]
- #[doc = "server authorization check request scheduled via an asynchronous schedule"]
- #[doc = "API. arg is used to pinpoint an exact check request to be cancelled. The"]
- #[doc = "operation may not have any effect if the request has already been"]
- #[doc = "processed."]
- #[doc = "- destruct is a pointer to an application-provided callback used to clean up"]
- #[doc = "any data associated with the config."]
- #[doc = "It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_authorization_check_config_create(
- config_user_data: *const ::std::os::raw::c_void,
- schedule: ::std::option::Option<
- unsafe extern "C" fn(
- config_user_data: *mut ::std::os::raw::c_void,
- arg: *mut grpc_tls_server_authorization_check_arg,
- ) -> ::std::os::raw::c_int,
- >,
- cancel: ::std::option::Option<
- unsafe extern "C" fn(
- config_user_data: *mut ::std::os::raw::c_void,
- arg: *mut grpc_tls_server_authorization_check_arg,
- ),
- >,
- destruct: ::std::option::Option<
- unsafe extern "C" fn(config_user_data: *mut ::std::os::raw::c_void),
- >,
- ) -> *mut grpc_tls_server_authorization_check_config;
-}
-extern "C" {
- #[doc = " Releases a grpc_tls_server_authorization_check_config object. The creator of"]
- #[doc = " the grpc_tls_server_authorization_check_config object is responsible for its"]
- #[doc = " release. It is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_authorization_check_config_release(
- config: *mut grpc_tls_server_authorization_check_config,
- );
-}
-extern "C" {
- #[doc = " Creates a TLS channel credential object based on the"]
- #[doc = " grpc_tls_credentials_options specified by callers. The"]
- #[doc = " grpc_channel_credentials will take the ownership of the |options|. The"]
- #[doc = " security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY. It"]
- #[doc = " is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_credentials_create(
- options: *mut grpc_tls_credentials_options,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " Creates a TLS server credential object based on the"]
- #[doc = " grpc_tls_credentials_options specified by callers. The"]
- #[doc = " grpc_server_credentials will take the ownership of the |options|. It"]
- #[doc = " is used for experimental purpose for now and subject to change."]
- pub fn grpc_tls_server_credentials_create(
- options: *mut grpc_tls_credentials_options,
- ) -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an insecure channel credentials object."]
- pub fn grpc_insecure_credentials_create() -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an insecure server credentials object."]
- pub fn grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an xDS channel credentials object."]
- #[doc = ""]
- #[doc = " Creating a channel with credentials of this type indicates that the channel"]
- #[doc = " should get credentials configuration from the xDS control plane."]
- #[doc = ""]
- #[doc = " \\a fallback_credentials are used if the channel target does not have the"]
- #[doc = " 'xds:///' scheme or if the xDS control plane does not provide information on"]
- #[doc = " how to fetch credentials dynamically. Does NOT take ownership of the \\a"]
- #[doc = " fallback_credentials. (Internally takes a ref to the object.)"]
- pub fn grpc_xds_credentials_create(
- fallback_credentials: *mut grpc_channel_credentials,
- ) -> *mut grpc_channel_credentials;
-}
-extern "C" {
- #[doc = " EXPERIMENTAL API - Subject to change"]
- #[doc = ""]
- #[doc = " This method creates an xDS server credentials object."]
- #[doc = ""]
- #[doc = " \\a fallback_credentials are used if the xDS control plane does not provide"]
- #[doc = " information on how to fetch credentials dynamically."]
- #[doc = ""]
- #[doc = " Does NOT take ownership of the \\a fallback_credentials. (Internally takes"]
- #[doc = " a ref to the object.)"]
- pub fn grpc_xds_server_credentials_create(
- fallback_credentials: *mut grpc_server_credentials,
- ) -> *mut grpc_server_credentials;
-}
-#[repr(u32)]
-#[doc = " The severity of a log message - use the #defines below when calling into"]
-#[doc = "gpr_log to additionally supply file and line data"]
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub enum gpr_log_severity {
- GPR_LOG_SEVERITY_DEBUG = 0,
- GPR_LOG_SEVERITY_INFO = 1,
- GPR_LOG_SEVERITY_ERROR = 2,
-}
-extern "C" {
- #[doc = " Returns a string representation of the log severity"]
- pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context"]
- #[doc = " for each message"]
- pub fn gpr_log(
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_int,
- severity: gpr_log_severity,
- format: *const ::std::os::raw::c_char,
- ...
- );
-}
-extern "C" {
- pub fn gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int;
-}
-extern "C" {
- pub fn gpr_log_message(
- file: *const ::std::os::raw::c_char,
- line: ::std::os::raw::c_int,
- severity: gpr_log_severity,
- message: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- #[doc = " Set global log verbosity"]
- pub fn gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity);
-}
-extern "C" {
- pub fn gpr_log_verbosity_init();
-}
-#[doc = " Log overrides: applications can use this API to intercept logging calls"]
-#[doc = "and use their own implementations"]
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct gpr_log_func_args {
- pub file: *const ::std::os::raw::c_char,
- pub line: ::std::os::raw::c_int,
- pub severity: gpr_log_severity,
- pub message: *const ::std::os::raw::c_char,
-}
-pub type gpr_log_func = ::std::option::Option<unsafe extern "C" fn(args: *mut gpr_log_func_args)>;
-extern "C" {
- pub fn gpr_set_log_function(func: gpr_log_func);
-}
-extern "C" {
- #[doc = " malloc."]
- #[doc = " If size==0, always returns NULL. Otherwise this function never returns NULL."]
- #[doc = " The pointer returned is suitably aligned for any kind of variable it could"]
- #[doc = " contain."]
- pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " like malloc, but zero all bytes before returning them"]
- pub fn gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " free"]
- pub fn gpr_free(ptr: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " realloc, never returns NULL"]
- pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " aligned malloc, never returns NULL, will align to alignment, which"]
- #[doc = " must be a power of 2."]
- pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void;
-}
-extern "C" {
- #[doc = " free memory allocated by gpr_malloc_aligned"]
- pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void);
-}
-extern "C" {
- #[doc = " Return the number of CPU cores on the current system. Will return 0 if"]
- #[doc = "the information is not available."]
- pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint;
-}
-extern "C" {
- #[doc = " Return the CPU on which the current thread is executing; N.B. This should"]
- #[doc = "be considered advisory only - it is possible that the thread is switched"]
- #[doc = "to a different CPU at any time. Returns a value in range"]
- #[doc = "[0, gpr_cpu_num_cores() - 1]"]
- pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint;
-}
-extern "C" {
- #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8"]
- #[doc = " formatted error message, corresponding to the error messageid."]
- #[doc = " Use in conjunction with GetLastError() et al."]
- pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " Returns a copy of src that can be passed to gpr_free()."]
- #[doc = "If allocation fails or if src is NULL, returns NULL."]
- pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
-}
-extern "C" {
- #[doc = " printf to a newly-allocated string. The set of supported formats may vary"]
- #[doc = "between platforms."]
- #[doc = ""]
- #[doc = "On success, returns the number of bytes printed (excluding the final '\\0'),"]
- #[doc = "and *strp points to a string which must later be destroyed with gpr_free()."]
- #[doc = ""]
- #[doc = "On error, returns -1 and sets *strp to NULL. If the format string is bad,"]
- #[doc = "the result is undefined."]
- pub fn gpr_asprintf(
- strp: *mut *mut ::std::os::raw::c_char,
- format: *const ::std::os::raw::c_char,
- ...
- ) -> ::std::os::raw::c_int;
-}
-pub type gpr_thd_id = usize;
-extern "C" {
- #[doc = " Returns the identifier of the current thread."]
- pub fn gpr_thd_currentid() -> gpr_thd_id;
-}
-#[doc = " Reader for byte buffers. Iterates over slices in the byte buffer"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpc_byte_buffer_reader {
- pub buffer_in: *mut grpc_byte_buffer,
- pub buffer_out: *mut grpc_byte_buffer,
- pub current: grpc_byte_buffer_reader_grpc_byte_buffer_reader_current,
-}
-#[doc = " Different current objects correspond to different types of byte buffers"]
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
- #[doc = " Index into a slice buffer's array of slices"]
- pub index: ::std::os::raw::c_uint,
- _bindgen_union_align: u32,
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}"
- )
- }
-}
-impl ::std::fmt::Debug for grpc_byte_buffer_reader {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write!(
- f,
- "grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}",
- self.buffer_in, self.buffer_out, self.current
- )
- }
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_batch_context {
- pub send_initial_metadata: grpc_metadata_array,
- pub send_message: *mut grpc_byte_buffer,
- pub send_status_from_server: grpcwrap_batch_context__bindgen_ty_1,
- pub recv_initial_metadata: grpc_metadata_array,
- pub recv_message: *mut grpc_byte_buffer,
- pub recv_status_on_client: grpcwrap_batch_context__bindgen_ty_2,
- pub recv_close_on_server_cancelled: ::std::os::raw::c_int,
-}
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct grpcwrap_batch_context__bindgen_ty_1 {
- pub trailing_metadata: grpc_metadata_array,
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_batch_context__bindgen_ty_2 {
- pub trailing_metadata: grpc_metadata_array,
- pub status: grpc_status_code::Type,
- pub status_details: grpc_slice,
-}
-impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details)
- }
-}
-impl ::std::fmt::Debug for grpcwrap_batch_context {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled)
- }
-}
-extern "C" {
- pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context;
-}
-#[repr(C)]
-#[derive(Copy, Clone)]
-pub struct grpcwrap_request_call_context {
- pub call: *mut grpc_call,
- pub call_details: grpc_call_details,
- pub request_metadata: grpc_metadata_array,
-}
-impl ::std::fmt::Debug for grpcwrap_request_call_context {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata)
- }
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context;
-}
-extern "C" {
- #[link_name = "\u{1}_Z45grpcwrap_metadata_array_destroy_metadata_onlyP19grpc_metadata_array"]
- pub fn grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array);
-}
-extern "C" {
- #[link_name = "\u{1}_Z58grpcwrap_metadata_array_destroy_metadata_including_entriesP19grpc_metadata_array"]
- pub fn grpcwrap_metadata_array_destroy_metadata_including_entries(
- array: *mut grpc_metadata_array,
- );
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_add(
- array: *mut grpc_metadata_array,
- key: *const ::std::os::raw::c_char,
- key_length: usize,
- value: *const ::std::os::raw::c_char,
- value_length: usize,
- );
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_get_key(
- array: *const grpc_metadata_array,
- index: usize,
- key_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_get_value(
- array: *const grpc_metadata_array,
- index: usize,
- value_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array);
-}
-extern "C" {
- pub fn grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array);
-}
-extern "C" {
- #[link_name = "\u{1}_Z28grpcwrap_metadata_array_moveP19grpc_metadata_arrayS0_"]
- pub fn grpcwrap_metadata_array_move(
- dest: *mut grpc_metadata_array,
- src: *mut grpc_metadata_array,
- );
-}
-extern "C" {
- pub fn grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context);
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context);
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_initial_metadata(
- ctx: *const grpcwrap_batch_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_slice_raw_offset(
- slice: *const grpc_slice,
- offset: usize,
- len: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice;
-}
-extern "C" {
- pub fn grpcwrap_slice_unref(slice: *const grpc_slice);
-}
-extern "C" {
- pub fn grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice;
-}
-extern "C" {
- pub fn grpcwrap_slice_length(slice: *const grpc_slice) -> usize;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_take_recv_message(
- ctx: *mut grpcwrap_batch_context,
- ) -> *mut grpc_byte_buffer;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_status(
- ctx: *const grpcwrap_batch_context,
- ) -> grpc_status_code::Type;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_details(
- ctx: *const grpcwrap_batch_context,
- details_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_status_on_client_trailing_metadata(
- ctx: *const grpcwrap_batch_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_ref_call(
- ctx: *mut grpcwrap_request_call_context,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_get_call(
- ctx: *mut grpcwrap_request_call_context,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_method(
- ctx: *const grpcwrap_request_call_context,
- method_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_host(
- ctx: *const grpcwrap_request_call_context,
- host_length: *mut usize,
- ) -> *const ::std::os::raw::c_char;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_deadline(
- ctx: *const grpcwrap_request_call_context,
- ) -> gpr_timespec;
-}
-extern "C" {
- pub fn grpcwrap_request_call_context_metadata_array(
- ctx: *const grpcwrap_request_call_context,
- ) -> *const grpc_metadata_array;
-}
-extern "C" {
- pub fn grpcwrap_batch_context_recv_close_on_server_cancelled(
- ctx: *const grpcwrap_batch_context,
- ) -> i32;
-}
-extern "C" {
- pub fn grpcwrap_channel_create_call(
- channel: *mut grpc_channel,
- parent_call: *mut grpc_call,
- propagation_mask: u32,
- cq: *mut grpc_completion_queue,
- method: *const ::std::os::raw::c_char,
- method_len: usize,
- host: *const ::std::os::raw::c_char,
- host_len: usize,
- deadline: gpr_timespec,
- ) -> *mut grpc_call;
-}
-extern "C" {
- pub fn grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args;
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_string(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: *const ::std::os::raw::c_char,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_integer(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: ::std::os::raw::c_int,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_set_pointer_vtable(
- args: *mut grpc_channel_args,
- index: usize,
- key: *const ::std::os::raw::c_char,
- value: *mut ::std::os::raw::c_void,
- vtable: *const grpc_arg_pointer_vtable,
- );
-}
-extern "C" {
- pub fn grpcwrap_channel_args_destroy(args: *mut grpc_channel_args);
-}
-extern "C" {
- pub fn grpcwrap_call_start_unary(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_client_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_server_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_duplex_streaming(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- initial_metadata_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_recv_initial_metadata(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_message(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- send_buffer: *mut grpc_slice,
- write_flags: u32,
- send_empty_initial_metadata: i32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_close_from_client(
- call: *mut grpc_call,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_status_from_server(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- status_code: grpc_status_code::Type,
- status_details: *const ::std::os::raw::c_char,
- status_details_len: usize,
- trailing_metadata: *mut grpc_metadata_array,
- send_empty_initial_metadata: i32,
- optional_send_buffer: *mut grpc_slice,
- write_flags: u32,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_recv_message(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_start_serverside(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_call_send_initial_metadata(
- call: *mut grpc_call,
- ctx: *mut grpcwrap_batch_context,
- initial_metadata: *mut grpc_metadata_array,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- #[doc = " Kick call's completion queue, it should be called after there is an event"]
- #[doc = "ready to poll."]
- #[doc = "THREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe"]
- #[doc = "because it does not change the call's state."]
- pub fn grpcwrap_call_kick_completion_queue(
- call: *mut grpc_call,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
-extern "C" {
- pub fn grpcwrap_server_request_call(
- server: *mut grpc_server,
- cq: *mut grpc_completion_queue,
- ctx: *mut grpcwrap_request_call_context,
- tag: *mut ::std::os::raw::c_void,
- ) -> grpc_call_error;
-}
diff --git a/build.rs b/build.rs
index 7f045083..a37a3d3a 100644
--- a/build.rs
+++ b/build.rs
@@ -1,6 +1,8 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
+use std::collections::HashSet;
use std::env::VarError;
+use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::path::{Path, PathBuf};
@@ -10,24 +12,9 @@ use cmake::Config as CmakeConfig;
use pkg_config::{Config as PkgConfig, Library};
use walkdir::WalkDir;
-const GRPC_VERSION: &str = "1.38.0";
+const GRPC_VERSION: &str = "1.44.0";
-/// Following two arrays are generated by running pkg-config manually. We can
-/// also choose to run pkg-config at build time, but it will requires pkg-config
-/// in path, which is unfriendly for platforms like Windows.
-// grpc_unsecure.pc is not accurate, see also grpc/grpc#24512. Should also include "address_sorting", "upb", "cares", "z".
-#[rustfmt::skip]
-const COMMON_DEPS: &[&str] = &[
- "absl_bad_optional_access", "absl_bad_variant_access", "absl_base", "absl_city", "absl_civil_time",
- "absl_cord", "absl_debugging_internal", "absl_demangle_internal", "absl_exponential_biased",
- "absl_graphcycles_internal", "absl_hash", "absl_hashtablez_sampler", "absl_int128", "absl_log_severity",
- "absl_malloc_internal", "absl_raw_hash_set", "absl_raw_logging_internal", "absl_spinlock_wait",
- "absl_stacktrace", "absl_status", "absl_statusor", "absl_str_format_internal", "absl_strings",
- "absl_strings_internal", "absl_symbolize", "absl_synchronization", "absl_throw_delegate", "absl_time",
- "absl_time_zone", "absl_wyhash", "address_sorting", "cares", "gpr", "upb", "z",
-];
-const GRPC_DEPS: &[&str] = &["grpc", "re2"];
-const GRPC_UNSECURE_DEPS: &[&str] = &["grpc_unsecure"];
+include!("link-deps.rs");
fn probe_library(library: &str, cargo_metadata: bool) -> Library {
match PkgConfig::new()
@@ -77,8 +64,8 @@ fn trim_start<'a>(s: &'a str, prefix: &str) -> Option<&'a str> {
fn clean_up_stale_cache(cxx_compiler: String) {
// We don't know the cmake output path before it's configured.
let build_dir = format!("{}/build", env::var("OUT_DIR").unwrap());
- let path = format!("{}/CMakeCache.txt", build_dir);
- let f = match std::fs::File::open(&path) {
+ let path = format!("{build_dir}/CMakeCache.txt");
+ let f = match std::fs::File::open(path) {
Ok(f) => BufReader::new(f),
// It may be an empty directory.
Err(_) => return,
@@ -99,6 +86,68 @@ fn clean_up_stale_cache(cxx_compiler: String) {
}
}
+/// List packages needed for linking in working directory.
+fn list_packages(dst: &Path) {
+ env::set_var(
+ "PKG_CONFIG_PATH",
+ format!("{}/lib/pkgconfig", dst.display()),
+ );
+ let mut cfg = PkgConfig::new();
+ cfg.print_system_cflags(false)
+ .print_system_libs(false)
+ .env_metadata(false)
+ .cargo_metadata(false)
+ .atleast_version(GRPC_VERSION);
+ let grpc = cfg.probe("grpc").unwrap();
+ let mut grpc_libs: HashSet<_> = grpc.libs.iter().cloned().collect();
+ let grpc_unsecure = cfg.probe("grpc_unsecure").unwrap();
+ let mut grpc_unsecure_libs: HashSet<_> = grpc_unsecure.libs.iter().cloned().collect();
+
+ // grpc_unsecure.pc is not accurate, see also grpc/grpc#24512. Should also include "address_sorting", "upb", "cares", "z".
+ grpc_unsecure_libs.extend(
+ ["address_sorting", "upb", "cares", "z"]
+ .iter()
+ .map(|s| s.to_string()),
+ );
+ // There is no "rt" on Windows and MacOS.
+ grpc_libs.remove("rt");
+ grpc_unsecure_libs.remove("rt");
+
+ // ssl, crypto is managed by us according to different features.
+ grpc_libs.remove("ssl");
+ grpc_libs.remove("crypto");
+
+ let mut common_libs: Vec<_> = grpc_libs.intersection(&grpc_unsecure_libs).collect();
+ let mut secure_only: Vec<_> = grpc_libs.difference(&grpc_unsecure_libs).collect();
+ let mut unsecure_only: Vec<_> = grpc_unsecure_libs.difference(&grpc_libs).collect();
+
+ common_libs.sort();
+ secure_only.sort();
+ unsecure_only.sort();
+
+ let outputs = &[
+ ("COMMON_DEPS", common_libs),
+ ("GRPC_DEPS", secure_only),
+ ("GRPC_UNSECURE_DEPS", unsecure_only),
+ ];
+
+ let mut f = File::create("link-deps.rs").unwrap();
+ f.write_all(
+ b"/// Following two arrays are generated by running pkg-config manually. We can
+/// also choose to run pkg-config at build time, but it will requires pkg-config
+/// in path, which is unfriendly for platforms like Windows.
+",
+ )
+ .unwrap();
+ for (name, libs) in outputs {
+ writeln!(f, "const {name}: &[&str] = &[").unwrap();
+ for lib in libs {
+ writeln!(f, "\"{lib}\",").unwrap();
+ }
+ writeln!(f, "];").unwrap();
+ }
+}
+
fn build_grpc(cc: &mut cc::Build, library: &str) {
prepare_grpc();
@@ -108,6 +157,7 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
if get_env("CARGO_CFG_TARGET_OS").map_or(false, |s| s == "macos") {
config.cxxflag("-stdlib=libc++");
+ println!("cargo:rustc-link-lib=resolv");
}
// Ensure CoreFoundation be found in macos or ios
@@ -165,7 +215,7 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
}
// We don't need to generate install targets.
- config.define("gRPC_INSTALL", "false");
+ config.define("gRPC_INSTALL", cfg!(feature = "_list-package").to_string());
// We don't need to build csharp target.
config.define("gRPC_BUILD_CSHARP_EXT", "false");
// We don't need to build codegen target.
@@ -175,15 +225,16 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
// `package` should only be set for secure feature, otherwise cmake will always search for
// ssl library.
- if cfg!(feature = "secure") {
+ if cfg!(feature = "_secure") {
config.define("gRPC_SSL_PROVIDER", "package");
}
- #[cfg(feature = "secure")]
+ #[cfg(feature = "_secure")]
if cfg!(feature = "openssl") {
if cfg!(feature = "openssl-vendored") {
config.register_dep("openssl");
}
} else {
+ #[cfg(feature = "boringssl")]
build_boringssl(&mut config);
}
if cfg!(feature = "no-omit-frame-pointer") {
@@ -193,7 +244,10 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
}
// Uses zlib from libz-sys.
setup_libz(&mut config);
- config.build_target(library).uses_cxx11().build()
+ if !cfg!(feature = "_list-package") {
+ config.build_target(library);
+ }
+ config.uses_cxx11().build()
};
let lib_suffix = if target.contains("msvc") {
@@ -212,16 +266,20 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
}
}
+ if cfg!(feature = "_list-package") {
+ list_packages(&dst);
+ }
+
let libs = if library.contains("unsecure") {
GRPC_UNSECURE_DEPS
} else {
GRPC_DEPS
};
for l in COMMON_DEPS.iter().chain(libs) {
- println!("cargo:rustc-link-lib=static={}", l);
+ println!("cargo:rustc-link-lib=static={l}");
}
- if cfg!(feature = "secure") {
+ if cfg!(feature = "_secure") {
if cfg!(feature = "openssl") && !cfg!(feature = "openssl-vendored") {
figure_ssl_path(&build_dir);
} else {
@@ -234,7 +292,7 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
}
fn figure_ssl_path(build_dir: &str) {
- let path = format!("{}/CMakeCache.txt", build_dir);
+ let path = format!("{build_dir}/CMakeCache.txt");
let f = BufReader::new(std::fs::File::open(&path).unwrap());
let mut cnt = 0;
for l in f.lines() {
@@ -260,7 +318,7 @@ fn figure_ssl_path(build_dir: &str) {
println!("cargo:rustc-link-lib=crypto");
}
-#[cfg(feature = "secure")]
+#[cfg(feature = "boringssl")]
fn build_boringssl(config: &mut CmakeConfig) {
let boringssl_artifact = boringssl_src::Build::new().build();
config.define(
@@ -281,34 +339,40 @@ fn setup_libz(config: &mut CmakeConfig) {
// under ${DEP_Z_ROOT}/build. Append the path to CMAKE_PREFIX_PATH to get around it.
let zlib_root = env::var("DEP_Z_ROOT").unwrap();
let prefix_path = if let Ok(prefix_path) = env::var("CMAKE_PREFIX_PATH") {
- format!("{};{}/build", prefix_path, zlib_root)
+ format!("{prefix_path};{zlib_root}/build")
} else {
- format!("{}/build", zlib_root)
+ format!("{zlib_root}/build")
};
// To avoid linking system library, set lib path explicitly.
- println!("cargo:rustc-link-search=native={}/build", zlib_root);
- println!("cargo:rustc-link-search=native={}/lib", zlib_root);
+ println!("cargo:rustc-link-search=native={zlib_root}/build");
+ println!("cargo:rustc-link-search=native={zlib_root}/lib");
env::set_var("CMAKE_PREFIX_PATH", prefix_path);
}
fn get_env(name: &str) -> Option<String> {
- println!("cargo:rerun-if-env-changed={}", name);
+ println!("cargo:rerun-if-env-changed={name}");
match env::var(name) {
Ok(s) => Some(s),
Err(VarError::NotPresent) => None,
Err(VarError::NotUnicode(s)) => {
- panic!("unrecognize env var of {}: {:?}", name, s.to_string_lossy());
+ panic!("unrecognize env var of {name}: {:?}", s.to_string_lossy());
}
}
}
// Generate the bindings to grpc C-core.
// Try to disable the generation of platform-related bindings.
-#[cfg(feature = "use-bindgen")]
+#[cfg(any(
+ feature = "_gen-bindings",
+ not(all(
+ any(target_os = "linux", target_os = "macos"),
+ any(target_arch = "x86_64", target_arch = "aarch64")
+ ))
+))]
fn bindgen_grpc(file_path: &Path) {
// create a config to generate binding file
let mut config = bindgen::Builder::default();
- if cfg!(feature = "secure") {
+ if cfg!(feature = "_secure") {
config = config.clang_arg("-DGRPC_SYS_SECURE");
}
@@ -350,22 +414,23 @@ fn bindgen_grpc(file_path: &Path) {
.impl_debug(true)
.size_t_is_usize(true)
.disable_header_comment()
- .whitelist_function(r"\bgrpc_.*")
- .whitelist_function(r"\bgpr_.*")
- .whitelist_function(r"\bgrpcwrap_.*")
- .whitelist_var(r"\bGRPC_.*")
- .whitelist_type(r"\bgrpc_.*")
- .whitelist_type(r"\bgpr_.*")
- .whitelist_type(r"\bgrpcwrap_.*")
- .whitelist_type(r"\bcensus_context.*")
- .whitelist_type(r"\bverify_peer_options.*")
- .blacklist_type(r"(__)?pthread.*")
- .blacklist_function(r"\bgpr_mu_.*")
- .blacklist_function(r"\bgpr_cv_.*")
- .blacklist_function(r"\bgpr_once_.*")
- .blacklist_type(r"gpr_mu")
- .blacklist_type(r"gpr_cv")
- .blacklist_type(r"gpr_once")
+ .allowlist_function(r"\bgrpc_.*")
+ .allowlist_function(r"\bgpr_.*")
+ .allowlist_function(r"\bgrpcwrap_.*")
+ .allowlist_var(r"\bGRPC_.*")
+ .allowlist_type(r"\bgrpc_.*")
+ .allowlist_type(r"\bgpr_.*")
+ .allowlist_type(r"\bgrpcwrap_.*")
+ .allowlist_type(r"\bcensus_context.*")
+ .allowlist_type(r"\bverify_peer_options.*")
+ // Block all system headers.
+ .blocklist_file(r"^/.*")
+ .blocklist_function(r"\bgpr_mu_.*")
+ .blocklist_function(r"\bgpr_cv_.*")
+ .blocklist_function(r"\bgpr_once_.*")
+ .blocklist_type(r"gpr_mu")
+ .blocklist_type(r"gpr_cv")
+ .blocklist_type(r"gpr_once")
.constified_enum_module(r"grpc_status_code")
.layout_tests(gen_tests)
.default_enum_style(bindgen::EnumVariation::Rust {
@@ -379,38 +444,48 @@ fn bindgen_grpc(file_path: &Path) {
}
// Determine if need to update bindings. Supported platforms do not
-// need to be updated by default unless the UPDATE_BIND is specified.
+// need to be updated by default unless the _gen-bindings feature is specified.
// Other platforms use bindgen to generate the bindings every time.
fn config_binding_path() {
let target = env::var("TARGET").unwrap();
let file_path: PathBuf = match target.as_str() {
- "x86_64-unknown-linux-gnu" | "aarch64-unknown-linux-gnu" => {
+ "x86_64-unknown-linux-gnu"
+ | "x86_64-unknown-linux-musl"
+ | "aarch64-unknown-linux-gnu"
+ | "x86_64-apple-darwin"
+ | "aarch64-apple-darwin" => {
// Cargo treats nonexistent files changed, so we only emit the rerun-if-changed
// directive when we expect the target-specific pre-generated binding file to be
// present.
- println!("cargo:rerun-if-changed=bindings/{}-bindings.rs", &target);
+ println!("cargo:rerun-if-changed=bindings/bindings.rs");
- let file_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
+ PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
.join("bindings")
- .join(format!("{}-bindings.rs", &target));
-
- #[cfg(feature = "use-bindgen")]
- if env::var("UPDATE_BIND").is_ok() {
- bindgen_grpc(&file_path);
- }
-
- file_path
- }
- _ => {
- let file_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("grpc-bindings.rs");
-
- #[cfg(feature = "use-bindgen")]
- bindgen_grpc(&file_path);
-
- file_path
+ .join("bindings.rs")
}
+ _ => PathBuf::from(env::var("OUT_DIR").unwrap()).join("grpc-bindings.rs"),
};
+ #[cfg(any(
+ feature = "_gen-bindings",
+ not(all(
+ any(target_os = "linux", target_os = "macos"),
+ any(target_arch = "x86_64", target_arch = "aarch64")
+ ))
+ ))]
+ {
+ // On some system (like Windows), stack size of main thread may
+ // be too small.
+ let f = file_path.clone();
+ std::thread::Builder::new()
+ .stack_size(8 * 1024 * 1024)
+ .name("bindgen_grpc".to_string())
+ .spawn(move || bindgen_grpc(&f))
+ .unwrap()
+ .join()
+ .unwrap();
+ }
+
println!(
"cargo:rustc-env=BINDING_PATH={}",
file_path.to_str().unwrap()
@@ -420,12 +495,11 @@ fn config_binding_path() {
fn main() {
println!("cargo:rerun-if-changed=grpc_wrap.cc");
println!("cargo:rerun-if-changed=grpc");
- println!("cargo:rerun-if-env-changed=UPDATE_BIND");
// create a builder to compile grpc_wrap.cc
let mut cc = cc::Build::new();
- let library = if cfg!(feature = "secure") {
+ let library = if cfg!(feature = "_secure") {
cc.define("GRPC_SYS_SECURE", None);
"grpc"
} else {
diff --git a/cargo2android-extra-module.bp b/cargo2android-extra-module.bp
new file mode 100644
index 00000000..b5f81d55
--- /dev/null
+++ b/cargo2android-extra-module.bp
@@ -0,0 +1,62 @@
+cc_defaults {
+ name: "libgrpcio_sys_defaults",
+ cflags: [
+ "-DGRPC_SYS_SECURE",
+ ],
+ shared_libs: ["libgrpc++"],
+ apex_available: [
+ "//apex_available:anyapex",
+ "//apex_available:platform",
+ "com.android.btservices",
+ ],
+ product_available: false,
+ vendor_available: true,
+ min_sdk_version: "29",
+}
+
+cc_library {
+ name: "libgrpc_wrap",
+ defaults: ["libgrpcio_sys_defaults"],
+ host_supported: true,
+ srcs: ["grpc_wrap.cc"],
+}
+
+rust_bindgen {
+ name: "libgrpc_bindgen",
+ defaults: ["libgrpcio_sys_defaults"],
+ host_supported: true,
+ wrapper_src: "android/bindgen_wrapper.hpp",
+ source_stem: "grpc-bindings",
+ crate_name: "grpc_bindgen",
+ bindgen_flags: [
+ "--constified-enum-module grpc_status_code",
+ "--default-enum-style rust",
+ "--allowlist-function=\\bgrpc_.*",
+ "--allowlist-function=\\bgpr_.*",
+ "--allowlist-function=\\bgrpcwrap_.*",
+ "--allowlist-var=\\bGRPC_.*",
+ "--allowlist-type=\\bgrpc_.*",
+ "--allowlist-type=\\bgpr_.*",
+ "--allowlist-type=\\bgrpcwrap_.*",
+ "--allowlist-type=\\bcensus_context.*",
+ "--allowlist-type=\\bverify_peer_options.*",
+ "--blocklist-type=(__)?pthread.*",
+ "--blocklist-function=\\bgpr_mu_.*",
+ "--blocklist-function=\\bgpr_cv_.*",
+ "--blocklist-function=\\bgpr_once_.*",
+ "--blocklist-type=gpr_mu",
+ "--blocklist-type=gpr_cv",
+ "--blocklist-type=gpr_once",
+ ],
+ min_sdk_version: "29",
+}
+
+rust_test {
+ name: "libgrpc_bindgen_test",
+ srcs: [":libgrpc_bindgen"],
+ crate_name: "grpc_bindgen_test",
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ clippy_lints: "none",
+ lints: "none",
+}
diff --git a/cargo2android.json b/cargo2android.json
index f46ea87d..2999be3a 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,15 +1,75 @@
{
"apex_available": [
"//apex_available:platform",
- "com.android.bluetooth"
+ "com.android.btservices"
],
"device": true,
- "features": "default,secure",
+ "features": "boringssl,_gen-bindings",
"ignore-cargo-errors": true,
"min-sdk-version": "29",
"no-pkg-vers": true,
"patch": "patches/Android.bp.patch",
"run": true,
"vendor-available": true,
- "product-available": false
+ "product-available": false,
+ "lib-blocklist": [
+ "absl_bad_optional_access",
+ "absl_bad_variant_access",
+ "absl_base",
+ "absl_city",
+ "absl_civil_time",
+ "absl_cord",
+ "absl_debugging_internal",
+ "absl_demangle_internal",
+ "absl_exponential_biased",
+ "absl_graphcycles_internal",
+ "absl_hash",
+ "absl_hashtablez_sampler",
+ "absl_int128",
+ "absl_log_severity",
+ "absl_malloc_internal",
+ "absl_raw_hash_set",
+ "absl_raw_logging_internal",
+ "absl_spinlock_wait",
+ "absl_stacktrace",
+ "absl_status",
+ "absl_statusor",
+ "absl_str_format_internal",
+ "absl_strings",
+ "absl_strings_internal",
+ "absl_symbolize",
+ "absl_synchronization",
+ "absl_throw_delegate",
+ "absl_time",
+ "absl_time_zone",
+ "absl_wyhash",
+ "absl_cord_internal",
+ "absl_cordz_functions",
+ "absl_cordz_handle",
+ "absl_cordz_info",
+ "absl_low_level_hash",
+ "absl_random_distributions",
+ "absl_random_internal_platform",
+ "absl_random_internal_pool_urbg",
+ "absl_random_internal_randen",
+ "absl_random_internal_randen_hwaes",
+ "absl_random_internal_randen_hwaes_impl",
+ "absl_random_internal_randen_slow",
+ "absl_random_internal_seed_material",
+ "absl_random_seed_gen_exception",
+ "absl_random_seed_sequences",
+ "address_sorting",
+ "cares",
+ "crypto",
+ "gpr",
+ "grpc",
+ "grpc_wrap",
+ "re2",
+ "ssl",
+ "stdc++",
+ "upb",
+ "z"
+ ],
+ "add-toplevel-block": "cargo2android-extra-module.bp",
+ "add-module-block": "cargo2android_module.bp"
}
diff --git a/cargo2android_module.bp b/cargo2android_module.bp
new file mode 100644
index 00000000..370ec78c
--- /dev/null
+++ b/cargo2android_module.bp
@@ -0,0 +1,4 @@
+shared_libs: [
+ "libgrpc++",
+ "libgrpc_wrap"
+]
diff --git a/grpc/.bazelci/presubmit.yml b/grpc/.bazelci/presubmit.yml
index ab0bfd3a..8349d412 100644
--- a/grpc/.bazelci/presubmit.yml
+++ b/grpc/.bazelci/presubmit.yml
@@ -11,8 +11,8 @@
# [3] https://github.com/grpc/grpc/pull/20784
---
# TODO(yannic): Ideally, we should also enable buildifier and all platforms should test `//...`.
-platforms:
- ubuntu1604:
+tasks:
+ ubuntu1804:
build_targets:
- //:all
- //src/proto/...
diff --git a/grpc/.bazelignore b/grpc/.bazelignore
index 03343344..6385cc6e 100644
--- a/grpc/.bazelignore
+++ b/grpc/.bazelignore
@@ -6,12 +6,24 @@ bins
libs
objs
third_party/abseil-cpp
+third_party/benchmark
+third_party/boringssl
third_party/bloaty
third_party/boringssl-with-bazel
+third_party/envoy-api
third_party/googleapis
third_party/googletest
third_party/opencensus-proto
third_party/protobuf
third_party/protoc-gen-validate
-third_party/udpa
+third_party/re2
third_party/upb
+third_party/xds
+
+test/distrib/bazel/cpp
+test/distrib/bazel/python
+test/distrib/bazel/python_second_test_repo
+
+# Directories generated by setuptools build containing BUILD files.
+src/python/grpcio_tests/src/
+tools/distrib/python/grpcio_tools/grpc_root/
diff --git a/grpc/.clang-format b/grpc/.clang-format
index 7460950e..953705e8 100644
--- a/grpc/.clang-format
+++ b/grpc/.clang-format
@@ -3,7 +3,44 @@ Language: Cpp
BasedOnStyle: Google
DerivePointerAlignment: false
PointerAlignment: Left
-IncludeBlocks: Preserve
+IncludeBlocks: Regroup
+IncludeCategories:
+ # port_platform.h is before almost everything
+ - Regex: '^<grpc/(support|impl/codegen)/port_platform.h>'
+ Priority: -100
+ # ruby.h is even more first if it's included
+ - Regex: '^<ruby/ruby.h>'
+ Priority: -200
+ # Some platforms (namely msys) need wchar to be included BEFORE
+ # anything else, especially strsafe.h.
+ - Regex: '^<wchar.h>'
+ Priority: 5
+ # use priority 100+ for grpc headers so they sort last
+ # 'system' headers - include things that have " in the names to make them
+ # stand out and get fixed
+ - Regex: '^(<|")grpc'
+ Priority: 100
+ # similary using include/ to get system headers should stand out and get
+ # fixed
+ - Regex: '^"include/'
+ Priority: 100
+ # source headers go last
+ - Regex: '^"(src|test)/'
+ Priority: 101
+ # not-grpc headers follow
+ # first, non system headers that are included like <> - these are all
+ # local carveouts, and get sorted below c++ but before non grpc "" files
+ - Regex: '^<(openssl/|uv\.h|ares\.h|address_sorting/|gmock/|gtest/|zlib|benchmark/|google/)'
+ Priority: 30
+ # first C system headers - they have a . in the filename
+ - Regex: '^<.*\.'
+ Priority: 10
+ # then C++ system headers - no ., the only thing that will match now
+ - Regex: '^<'
+ Priority: 20
+ # finally other "" includes go between system headers and our headers
+ - Regex: '^"'
+ Priority: 40
---
Language: ObjC
BasedOnStyle: Google
diff --git a/grpc/.clang-tidy b/grpc/.clang-tidy
index 8714bad3..c1bc7853 100644
--- a/grpc/.clang-tidy
+++ b/grpc/.clang-tidy
@@ -18,6 +18,8 @@
# Once those issues are clear, these checks can be enabled later.
#
# - bugprone-branch-clone
+# - bugprone-easily-swappable-parameters,
+# - bugprone-implicit-widening-of-multiplication-result
# - bugprone-infinite-loop
# - bugprone-narrowing-conversions
# - bugprone-not-null-terminated-result
@@ -42,18 +44,20 @@
# - modernize-use-equals-delete
# - modernize-use-using
# - performance-no-automatic-move
+# - performance-no-int-to-ptr
# - performance-unnecessary-copy-initialization
# - performance-unnecessary-value-param
# - readability-else-after-return
# - readability-implicit-bool-conversion
# - readability-redundant-declaration
-# - readability-static-definition-in-anonymous-namespace
#
Checks: '-*,
abseil-*,
-abseil-no-namespace,
bugprone-*,
-bugprone-branch-clone,
+ -bugprone-easily-swappable-parameters,
+ -bugprone-implicit-widening-of-multiplication-result,
-bugprone-infinite-loop,
-bugprone-narrowing-conversions,
-bugprone-not-null-terminated-result,
@@ -68,6 +72,7 @@ Checks: '-*,
-google-upgrade-googletest-case,
performance-*,
-performance-no-automatic-move,
+ -performance-no-int-to-ptr,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
clang-diagnostic-deprecated-register,
@@ -115,6 +120,7 @@ Checks: '-*,
readability-redundant-function-ptr-dereference,
readability-redundant-smartptr-get,
readability-simplify-boolean-expr,
+ readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release'
WarningsAsErrors: '*'
diff --git a/grpc/.gitattributes b/grpc/.gitattributes
new file mode 100644
index 00000000..4d890068
--- /dev/null
+++ b/grpc/.gitattributes
@@ -0,0 +1,33 @@
+src/core/ext/upb-generated/** linguist-generated=true
+src/core/ext/upbdefs-generated/** linguist-generated=true
+Makefile linguist-generated=true
+BUILD.gn linguist-generated=true
+CMakeLists.txt linguist-generated=true
+build_autogenerated.yaml linguist-generated=true
+config.m4 linguist-generated=true
+config.w32 linguist-generated=true
+gRPC-C++.podspec linguist-generated=true
+gRPC-Core.podspec linguist-generated=true
+gRPC-ProtoRPC.podspec linguist-generated=true
+gRPC-RxLibrary.podspec linguist-generated=true
+gRPC.podspec linguist-generated=true
+grpc.gemspec linguist-generated=true
+grpc.gyp linguist-generated=true
+grpc.def linguist-generated=true
+package.xml linguist-generated=true
+binding.gyp linguist-generated=true
+src/python/grpcio/grpc_core_dependencies.py linguist-generated=true
+src/ruby/ext/grpc/rb_grpc_imports.generated.h linguist-generated=true
+src/ruby/ext/grpc/rb_grpc_imports.generated.c linguist-generated=true
+test/core/end2end/end2end_tests.cc linguist-generated=true
+test/core/security/grpc_tls_credentials_options_comparator_test.cc linguist-generated=true
+test/core/surface/public_headers_must_be_c89.c linguist-generated=true
+tools/doxygen/Doxyfile.c++.internal linguist-generated=true
+tools/doxygen/Doxyfile.core.internal linguist-generated=true
+tools/run_tests/sources_and_headers.json linguist-generated=true
+tools/run_tests/tests.json linguist-generated=true
+tools/run_tests/generated/tests.json linguist-generated=true
+tools/run_tests/generated/sources_and_headers.json linguist-generated=true
+src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h linguist-generated=true
+src/core/lib/transport/static_metadata.h linguist-generated=true
+src/core/lib/transport/static_metadata.cc linguist-generated=true
diff --git a/grpc/.github/CODEOWNERS b/grpc/.github/CODEOWNERS
index a3bf2b17..1125cabc 100644
--- a/grpc/.github/CODEOWNERS
+++ b/grpc/.github/CODEOWNERS
@@ -1,8 +1,8 @@
# Auto-generated by the tools/mkowners/mkowners.py tool
# Uses OWNERS files in different modules throughout the
# repository as the source of truth for module ownership.
-/**/OWNERS @markdroth @nicolasnoble @a11r
-/bazel/** @nicolasnoble @jtattermusch @veblush @gnossen
+/**/OWNERS @markdroth @nicolasnoble @a11r @ctiller
+/bazel/** @nicolasnoble @jtattermusch @veblush @gnossen @ctiller
/cmake/** @jtattermusch @nicolasnoble @apolcyn
/src/core/ext/filters/client_channel/** @markdroth
/src/core/ext/xds/** @markdroth
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report.md b/grpc/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index e69dc0bd..00000000
--- a/grpc/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-name: Report a bug
-about: Create a report to help us improve
-labels: kind/bug, priority/P2
-assignees: nicolasnoble
-
----
-
-<!--
-PLEASE DO NOT POST A QUESTION HERE.
-This form is for bug reports and feature requests ONLY!
-
-For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
-
-For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
-
-Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
--->
-
-### What version of gRPC and what language are you using?
-
-
-### What operating system (Linux, Windows,...) and version?
-
-
-### What runtime / compiler are you using (e.g. python version or version of gcc)
-
-
-### What did you do?
-Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
-
-### What did you expect to see?
-
-
-### What did you see instead?
-
-Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
-
-See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
-
-### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_core.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_core.md
new file mode 100644
index 00000000..1563b22c
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_core.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC Core bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/core, untriaged
+assignees: yashykt
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_cpp.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_cpp.md
new file mode 100644
index 00000000..4847b656
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_cpp.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC C++ bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/c++, untriaged
+assignees: yashykt
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_csharp.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_csharp.md
new file mode 100644
index 00000000..e8317fa5
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_csharp.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC C# bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/C#
+assignees: jtattermusch
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_objc.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_objc.md
new file mode 100644
index 00000000..1c9a78f9
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_objc.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC ObjC bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/ObjC
+assignees: dennycd
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_php.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_php.md
new file mode 100644
index 00000000..aa53504e
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_php.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC PHP bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/php
+assignees: stanley-cheung
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_python.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_python.md
new file mode 100644
index 00000000..5ca9e460
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_python.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC Python bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/Python
+assignees: gnossen
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/bug_report_ruby.md b/grpc/.github/ISSUE_TEMPLATE/bug_report_ruby.md
new file mode 100644
index 00000000..f6657510
--- /dev/null
+++ b/grpc/.github/ISSUE_TEMPLATE/bug_report_ruby.md
@@ -0,0 +1,41 @@
+---
+name: Report a gRPC Ruby bug
+about: Create a report to help us improve
+labels: kind/bug, priority/P2, lang/ruby
+assignees: apolcyn
+
+---
+
+<!--
+PLEASE DO NOT POST A QUESTION HERE.
+This form is for bug reports and feature requests ONLY!
+
+For general questions and troubleshooting, please ask/look for answers at StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
+
+For questions that specifically need to be answered by gRPC team members, please ask/look for answers at grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
+
+Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
+-->
+
+### What version of gRPC and what language are you using?
+
+
+### What operating system (Linux, Windows,...) and version?
+
+
+### What runtime / compiler are you using (e.g. python version or version of gcc)
+
+
+### What did you do?
+Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
+
+### What did you expect to see?
+
+
+### What did you see instead?
+
+Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
+
+See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better.
+
+### Anything else we should know about your project / environment?
diff --git a/grpc/.github/ISSUE_TEMPLATE/cleanup_request.md b/grpc/.github/ISSUE_TEMPLATE/cleanup_request.md
index c9a6d3f9..98b0a5a5 100644
--- a/grpc/.github/ISSUE_TEMPLATE/cleanup_request.md
+++ b/grpc/.github/ISSUE_TEMPLATE/cleanup_request.md
@@ -2,7 +2,7 @@
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup, priority/P2
-assignees: nicolasnoble
+assignees: yashykt
---
diff --git a/grpc/.github/ISSUE_TEMPLATE/feature_request.md b/grpc/.github/ISSUE_TEMPLATE/feature_request.md
index e3137998..b6a5493c 100644
--- a/grpc/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/grpc/.github/ISSUE_TEMPLATE/feature_request.md
@@ -2,7 +2,7 @@
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2
-assignees: nicolasnoble
+assignees: yashykt
---
diff --git a/grpc/.github/ISSUE_TEMPLATE/question.md b/grpc/.github/ISSUE_TEMPLATE/question.md
index cfde18be..b92cd62f 100644
--- a/grpc/.github/ISSUE_TEMPLATE/question.md
+++ b/grpc/.github/ISSUE_TEMPLATE/question.md
@@ -2,7 +2,7 @@
name: Ask a question
about: Ask a question
labels: kind/question, priority/P3
-assignees: nicolasnoble
+assignees: yashykt
---
diff --git a/grpc/.github/change_repo_manager.sh b/grpc/.github/change_repo_manager.sh
index 5f73a6c2..e48a47ff 100755
--- a/grpc/.github/change_repo_manager.sh
+++ b/grpc/.github/change_repo_manager.sh
@@ -25,7 +25,7 @@ echo "Change repo manager to $1"
BASE_PATH=$(dirname $0)
-for file in bug_report.md cleanup_request.md feature_request.md question.md
+for file in bug_report_core.md bug_report_cpp.md cleanup_request.md feature_request.md question.md
do
sed -i".bak" -E "s/assignees: ([a-zA-Z0-9-]+)/assignees: $1/" "$BASE_PATH/ISSUE_TEMPLATE/$file"
rm "$BASE_PATH/ISSUE_TEMPLATE/$file.bak"
diff --git a/grpc/.github/labeler.yml b/grpc/.github/labeler.yml
new file mode 100644
index 00000000..ed627b28
--- /dev/null
+++ b/grpc/.github/labeler.yml
@@ -0,0 +1,15 @@
+lang/core:
+- src/core/**
+- include/grpc/**
+- test/core/**
+- tools/codegen/core/**
+
+lang/c++:
+- src/cpp/**
+- include/grpc++/**
+- include/grpcpp/**
+- test/cpp/**
+
+area/infra:
+- .github/**
+
diff --git a/grpc/.github/pull_request_template.md b/grpc/.github/pull_request_template.md
index 57af6c21..380c2bda 100644
--- a/grpc/.github/pull_request_template.md
+++ b/grpc/.github/pull_request_template.md
@@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
-->
-@nicolasnoble
+@yashykt
diff --git a/grpc/.github/workflows/pr-auto-fix.yaml b/grpc/.github/workflows/pr-auto-fix.yaml
new file mode 100644
index 00000000..920f6200
--- /dev/null
+++ b/grpc/.github/workflows/pr-auto-fix.yaml
@@ -0,0 +1,83 @@
+name: PR AutoFix
+on: [push]
+jobs:
+ PRAutoFix:
+ runs-on: ubuntu-latest
+ steps:
+ # Cache bazel build
+ - name: Get current time
+ uses: srfrnk/current-time@master
+ id: current-time
+ with:
+ format: YYYYWW
+ - name: Cache bazel
+ uses: actions/cache@v2
+ env:
+ cache-name: bazel-cache
+ with:
+ path: ~/.cache/bazel
+ # formattedTime here is like 202132 - the year concatenated with the week
+ # as this changes every week, we cycle to a new cache once per week.
+ key: ${{ runner.os }}-${{ steps.current-time.outputs.formattedTime }}
+ # Cancel current runs if they're still running
+ # (saves processing on fast pushes)
+ - name: Cancel Previous Runs
+ uses: styfle/cancel-workflow-action@0.9.1
+ with:
+ access_token: ${{ github.token }}
+ # Allow opt-out for some users
+ - name: Should I Stay Or Should I Go
+ uses: actions/github-script@v4
+ id: check
+ with:
+ script: |
+ // If you'd like not to run this code on your commits, add your github user id here:
+ NO_AUTOFIX_USERS = []
+ const { owner, repo } = context.repo
+ if (NO_AUTOFIX_USERS.includes(context.actor)) {
+ console.log('Cancelling');
+ const run_id = "${{ github.run_id }}";
+ await github.actions.cancelWorkflowRun({ owner, repo, run_id });
+ return 'go';
+ } else {
+ return 'stay';
+ }
+ - name: Wait for cancellation
+ run: sleep 60
+ if: steps.check.outputs.result == 'go'
+ - name: Should build?
+ run: test "${{ steps.check.outputs.result }}" = "stay"
+ # Setup to run sanity suite
+ - name: Install Python Interpreter
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.8
+ - name: Install Python Packages
+ run: |
+ python -m pip install --upgrade pip
+ pip install pyyaml mako virtualenv
+ sudo apt-get install python-dev
+ - name: Check out repository code
+ uses: actions/checkout@v2
+ with:
+ submodules: True
+ fetch-depth: 0
+ # Run the things!
+ - name: clang-tidy fixes
+ run: ${{ github.workspace }}/tools/distrib/clang_tidy_code.sh --fix --only-changed || true
+ - name: Run sanitize
+ run: ${{ github.workspace }}/tools/distrib/sanitize.sh
+ # Report back with a PR if things are broken
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v3
+ with:
+ delete-branch: true
+ branch-suffix: short-commit-hash
+ commit-message: "Automated change: Fix sanity tests"
+ title: Automated fix for ${{ github.ref }}
+ body: |
+ PanCakes to the rescue!
+
+ We noticed that our 'sanity' test was going to fail, but we think we can fix that automatically, so we put together this PR to do just that!
+
+ If you'd like to opt-out of these PR's, add yourself to NO_AUTOFIX_USERS in .github/workflows/pr-auto-fix.yaml
diff --git a/grpc/.github/workflows/pr-auto-tag.yaml b/grpc/.github/workflows/pr-auto-tag.yaml
new file mode 100644
index 00000000..22041f6f
--- /dev/null
+++ b/grpc/.github/workflows/pr-auto-tag.yaml
@@ -0,0 +1,12 @@
+name: PR AutoTag
+on:
+ pull_request_target:
+ types: [opened, reopened, synchronized, edited]
+jobs:
+ triage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/labeler@v3
+ with:
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
+
diff --git a/grpc/.gitignore b/grpc/.gitignore
index 14cdcebe..4e1aedf5 100644
--- a/grpc/.gitignore
+++ b/grpc/.gitignore
@@ -6,24 +6,23 @@ libs
objs
# Python items
-cython_debug/
-python_build/
-yapf_virtual_environment/
-python_pylint_venv/
.coverage*
.eggs
-htmlcov/
-dist/
+.pytype
*.egg
-py27_gevent/
-py27_native/
-py3[0-9]_gevent/
-py3[0-9]_native/
+*.egg-info
a.out
+cython_debug/
+dist/
+htmlcov/
+py3*/
+python_build/
+python_pylint_venv/
+src/python/grpcio_*/=*
+src/python/grpcio_*/build/
src/python/grpcio_*/LICENSE
src/python/grpcio_status/grpc_status/google/rpc/status.proto
-.pytype
-*.egg-info
+yapf_virtual_environment/
# Node installation output
node_modules
@@ -64,6 +63,7 @@ Gemfile.lock
# Temporary test reports
report.xml
*/sponge_log.xml
+*/success_log_to_rename.xml
latency_trace.txt
latency_trace.*.txt
@@ -123,6 +123,11 @@ bazel-*
bazel_format_virtual_environment/
tools/bazel-*
+# Bazel wrapper
+bazel_wrapper
+bazel_wrapper.bat
+bazel_wrapper.bazelrc
+
# Debug output
gdb.txt
@@ -157,3 +162,8 @@ BenchmarkDotNet.Artifacts/
# clang JSON compilation database file
compile_commands.json
+
+# IWYU byproducts
+compile_commands_for_iwyu.json
+iwyu.out
+iwyu_files.txt
diff --git a/grpc/.pylintrc b/grpc/.pylintrc
index 08ec7e83..3f2384e0 100644
--- a/grpc/.pylintrc
+++ b/grpc/.pylintrc
@@ -95,5 +95,7 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
+ # NOTE(lidiz): the import order will be enforced by isort instead
+ wrong-import-order,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,
diff --git a/grpc/.pylintrc-examples b/grpc/.pylintrc-examples
index 0100d84a..ba9bded8 100644
--- a/grpc/.pylintrc-examples
+++ b/grpc/.pylintrc-examples
@@ -98,5 +98,7 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
+ # NOTE(lidiz): the import order will be enforced by isort instead
+ wrong-import-order,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,
diff --git a/grpc/.pylintrc-tests b/grpc/.pylintrc-tests
index 808fe7f6..14512019 100644
--- a/grpc/.pylintrc-tests
+++ b/grpc/.pylintrc-tests
@@ -124,5 +124,7 @@ disable=
no-else-return,
# NOTE(lidiz): Python 3 make object inheritance default, but not PY2
useless-object-inheritance,
+ # NOTE(lidiz): the import order will be enforced by isort instead
+ wrong-import-order,
# NOTE(sergiitk): yapf compatibility, ref #25071
bad-continuation,
diff --git a/grpc/BUILD b/grpc/BUILD
index 823abc24..5e36a36d 100644
--- a/grpc/BUILD
+++ b/grpc/BUILD
@@ -14,28 +14,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"])
+load(
+ "//bazel:grpc_build_system.bzl",
+ "grpc_cc_library",
+ "grpc_generate_one_off_targets",
+ "grpc_upb_proto_library",
+ "grpc_upb_proto_reflection_library",
+ "python_config_settings",
+)
+load("@bazel_skylib//lib:selects.bzl", "selects")
-exports_files([
- "LICENSE",
- "etc/roots.pem",
-])
+licenses(["reciprocal"])
package(
default_visibility = ["//visibility:public"],
features = [
- "-layering_check",
+ "layering_check",
"-parse_headers",
],
)
-load(
- "//bazel:grpc_build_system.bzl",
- "grpc_cc_library",
- "grpc_generate_one_off_targets",
- "grpc_upb_proto_library",
- "python_config_settings",
-)
+exports_files([
+ "LICENSE",
+ "etc/roots.pem",
+])
config_setting(
name = "grpc_no_ares",
@@ -43,10 +45,69 @@ config_setting(
)
config_setting(
- name = "grpc_no_xds",
+ name = "grpc_no_xds_define",
values = {"define": "grpc_no_xds=true"},
)
+# When gRPC is build as shared library, binder transport code might still
+# get included even when user's code does not depend on it. In that case
+# --define=grpc_no_binder=true can be used to disable binder transport
+# related code to reduce binary size.
+# For users using build system other than bazel, they can define
+# GRPC_NO_BINDER to achieve the same effect.
+config_setting(
+ name = "grpc_no_binder_define",
+ values = {"define": "grpc_no_binder=true"},
+)
+
+config_setting(
+ name = "android",
+ values = {"crosstool_top": "//external:android/crosstool"},
+)
+
+config_setting(
+ name = "ios",
+ values = {"apple_platform_type": "ios"},
+)
+
+selects.config_setting_group(
+ name = "grpc_no_xds",
+ match_any = [
+ ":grpc_no_xds_define",
+ # In addition to disabling XDS support when --define=grpc_no_xds=true is
+ # specified, we also disable it on mobile platforms where it is not
+ # likely to be needed and where reducing the binary size is more
+ # important.
+ ":android",
+ ":ios",
+ ],
+)
+
+selects.config_setting_group(
+ name = "grpc_no_binder",
+ match_any = [
+ ":grpc_no_binder_define",
+ # We do not need binder on ios.
+ ":ios",
+ ],
+)
+
+selects.config_setting_group(
+ name = "grpc_no_rls",
+ match_any = [
+ # Disable RLS support on mobile platforms where it is not likely to be
+ # needed and where reducing the binary size is more important.
+ ":android",
+ ":ios",
+ ],
+)
+
+# Fuzzers can be built as fuzzers or as tests
+config_setting(
+ name = "grpc_build_fuzzers",
+ values = {"define": "grpc_build_fuzzers=true"},
+)
+
config_setting(
name = "grpc_allow_exceptions",
values = {"define": "GRPC_ALLOW_EXCEPTIONS=1"},
@@ -82,14 +143,19 @@ config_setting(
values = {"define": "use_strict_warning=true"},
)
+config_setting(
+ name = "use_abseil_status",
+ values = {"define": "use_abseil_status=true"},
+)
+
python_config_settings()
# This should be updated along with build_handwritten.yaml
-g_stands_for = "guadalupe_river_park_conservancy" # @unused
+g_stands_for = "golazo" # @unused
-core_version = "16.0.0" # @unused
+core_version = "24.0.0" # @unused
-version = "1.38.0" # @unused
+version = "1.46.5" # @unused
GPR_PUBLIC_HDRS = [
"include/grpc/support/alloc.h",
@@ -119,6 +185,7 @@ GRPC_PUBLIC_HDRS = [
"include/grpc/fork.h",
"include/grpc/grpc.h",
"include/grpc/grpc_posix.h",
+ "include/grpc/grpc_security.h",
"include/grpc/grpc_security_constants.h",
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
@@ -128,17 +195,14 @@ GRPC_PUBLIC_HDRS = [
]
GRPC_PUBLIC_EVENT_ENGINE_HDRS = [
- "include/grpc/event_engine/channel_args.h",
+ "include/grpc/event_engine/endpoint_config.h",
"include/grpc/event_engine/event_engine.h",
"include/grpc/event_engine/port.h",
- "include/grpc/event_engine/slice_allocator.h",
+ "include/grpc/event_engine/memory_allocator.h",
+ "include/grpc/event_engine/memory_request.h",
+ "include/grpc/event_engine/internal/memory_allocator_impl.h",
]
-GRPC_SECURE_PUBLIC_HDRS = [
- "include/grpc/grpc_security.h",
-]
-
-# TODO(ctiller): layer grpc atop grpc_unsecure, layer grpc++ atop grpc++_unsecure
GRPCXX_SRCS = [
"src/cpp/client/channel_cc.cc",
"src/cpp/client/client_callback.cc",
@@ -264,6 +328,8 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/security/credentials.h",
"include/grpcpp/security/server_credentials.h",
"include/grpcpp/security/tls_certificate_provider.h",
+ "include/grpcpp/security/authorization_policy_provider.h",
+ "include/grpcpp/security/tls_certificate_verifier.h",
"include/grpcpp/security/tls_credentials_options.h",
"include/grpcpp/server.h",
"include/grpcpp/server_builder.h",
@@ -298,58 +364,90 @@ grpc_cc_library(
language = "c++",
public_hdrs = GPR_PUBLIC_HDRS,
standalone = True,
+ tags = ["avoid_dep"],
+ visibility = ["@grpc:public"],
deps = [
"gpr_base",
],
)
grpc_cc_library(
+ name = "atomic_utils",
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/atomic_utils.h"],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
name = "grpc_unsecure",
srcs = [
"src/core/lib/surface/init.cc",
- "src/core/lib/surface/init_unsecure.cc",
- "src/core/plugin_registry/grpc_unsecure_plugin_registry.cc",
+ "src/core/plugin_registry/grpc_plugin_registry.cc",
+ "src/core/plugin_registry/grpc_plugin_registry_noextra.cc",
],
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS,
standalone = True,
+ tags = ["avoid_dep"],
+ visibility = ["@grpc:public"],
deps = [
+ "config",
+ "gpr_base",
+ "grpc_authorization_base",
+ "grpc_base",
"grpc_common",
- "grpc_lb_policy_grpclb",
+ "grpc_security_base",
+ "grpc_trace",
+ "slice",
],
)
+GRPC_XDS_TARGETS = [
+ "grpc_lb_policy_cds",
+ "grpc_lb_policy_xds_cluster_impl",
+ "grpc_lb_policy_xds_cluster_manager",
+ "grpc_lb_policy_xds_cluster_resolver",
+ "grpc_resolver_xds",
+ "grpc_resolver_c2p",
+ "grpc_xds_server_config_fetcher",
+
+ # Not xDS-specific but currently only used by xDS.
+ "channel_creds_registry_init",
+]
+
grpc_cc_library(
name = "grpc",
srcs = [
"src/core/lib/surface/init.cc",
"src/core/plugin_registry/grpc_plugin_registry.cc",
+ "src/core/plugin_registry/grpc_plugin_registry_extra.cc",
],
defines = select({
"grpc_no_xds": ["GRPC_NO_XDS"],
"//conditions:default": [],
}),
language = "c++",
- public_hdrs = GRPC_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS,
- select_deps = {
- "grpc_no_xds": [],
- "//conditions:default": [
- "grpc_lb_policy_cds",
- "grpc_lb_policy_xds_cluster_impl",
- "grpc_lb_policy_xds_cluster_manager",
- "grpc_lb_policy_xds_cluster_resolver",
- "grpc_resolver_xds",
- "grpc_resolver_c2p",
- "grpc_xds_server_config_fetcher",
- ],
- },
+ public_hdrs = GRPC_PUBLIC_HDRS,
+ select_deps = [
+ {
+ "grpc_no_xds": [],
+ "//conditions:default": GRPC_XDS_TARGETS,
+ },
+ ],
standalone = True,
+ visibility = [
+ "@grpc:public",
+ ],
deps = [
+ "config",
+ "gpr_base",
+ "grpc_authorization_base",
+ "grpc_base",
"grpc_common",
- "grpc_lb_policy_grpclb_secure",
"grpc_secure",
- "grpc_transport_chttp2_client_secure",
- "grpc_transport_chttp2_server_secure",
+ "grpc_security_base",
+ "grpc_trace",
+ "slice",
],
)
@@ -360,6 +458,7 @@ grpc_cc_library(
"absl/synchronization",
"protobuf_headers",
],
+ visibility = ["@grpc:public"],
)
grpc_cc_library(
@@ -367,21 +466,32 @@ grpc_cc_library(
hdrs = [
"src/cpp/client/secure_credentials.h",
"src/cpp/common/secure_auth_context.h",
- "src/cpp/common/tls_credentials_options_util.h",
"src/cpp/server/secure_server_credentials.h",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
- select_deps = {
- "grpc_no_xds": [],
- "//conditions:default": [
- "grpc++_xds_client",
- "grpc++_xds_server",
- ],
- },
+ select_deps = [
+ {
+ "grpc_no_xds": [],
+ "//conditions:default": [
+ "grpc++_xds_client",
+ "grpc++_xds_server",
+ ],
+ },
+ {
+ "grpc_no_binder": [],
+ "//conditions:default": [
+ "grpc++_binder",
+ ],
+ },
+ ],
standalone = True,
+ visibility = [
+ "@grpc:public",
+ ],
deps = [
"grpc++_internals",
+ "slice",
],
)
@@ -395,31 +505,121 @@ grpc_cc_library(
"src/cpp/common/secure_channel_arguments.cc",
"src/cpp/common/secure_create_auth_context.cc",
"src/cpp/common/tls_certificate_provider.cc",
+ "src/cpp/common/tls_certificate_verifier.cc",
"src/cpp/common/tls_credentials_options.cc",
- "src/cpp/common/tls_credentials_options_util.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/secure_server_credentials.cc",
],
hdrs = [
"src/cpp/client/secure_credentials.h",
"src/cpp/common/secure_auth_context.h",
- "src/cpp/common/tls_credentials_options_util.h",
"src/cpp/server/secure_server_credentials.h",
],
external_deps = [
+ "absl/status",
"absl/synchronization",
+ "absl/container:inlined_vector",
+ "absl/strings",
"protobuf_headers",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
deps = [
- "gpr",
+ "error",
+ "gpr_base",
"grpc",
"grpc++_base",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
"grpc++_codegen_proto",
+ "grpc_base",
+ "grpc_codegen",
+ "grpc_credentials_util",
"grpc_secure",
+ "grpc_security_base",
+ "json",
+ "ref_counted_ptr",
+ "slice",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc++_binder",
+ srcs = [
+ "src/core/ext/transport/binder/client/binder_connector.cc",
+ "src/core/ext/transport/binder/client/channel_create.cc",
+ "src/core/ext/transport/binder/client/channel_create_impl.cc",
+ "src/core/ext/transport/binder/client/connection_id_generator.cc",
+ "src/core/ext/transport/binder/client/endpoint_binder_pool.cc",
+ "src/core/ext/transport/binder/client/jni_utils.cc",
+ "src/core/ext/transport/binder/client/security_policy_setting.cc",
+ "src/core/ext/transport/binder/security_policy/binder_security_policy.cc",
+ "src/core/ext/transport/binder/server/binder_server.cc",
+ "src/core/ext/transport/binder/server/binder_server_credentials.cc",
+ "src/core/ext/transport/binder/transport/binder_transport.cc",
+ "src/core/ext/transport/binder/utils/ndk_binder.cc",
+ "src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc",
+ "src/core/ext/transport/binder/wire_format/binder_android.cc",
+ "src/core/ext/transport/binder/wire_format/binder_constants.cc",
+ "src/core/ext/transport/binder/wire_format/transaction.cc",
+ "src/core/ext/transport/binder/wire_format/wire_reader_impl.cc",
+ "src/core/ext/transport/binder/wire_format/wire_writer.cc",
+ ],
+ hdrs = [
+ "src/core/ext/transport/binder/client/binder_connector.h",
+ "src/core/ext/transport/binder/client/channel_create_impl.h",
+ "src/core/ext/transport/binder/client/connection_id_generator.h",
+ "src/core/ext/transport/binder/client/endpoint_binder_pool.h",
+ "src/core/ext/transport/binder/client/jni_utils.h",
+ "src/core/ext/transport/binder/client/security_policy_setting.h",
+ "src/core/ext/transport/binder/server/binder_server.h",
+ "src/core/ext/transport/binder/transport/binder_stream.h",
+ "src/core/ext/transport/binder/transport/binder_transport.h",
+ "src/core/ext/transport/binder/utils/binder_auto_utils.h",
+ "src/core/ext/transport/binder/utils/ndk_binder.h",
+ "src/core/ext/transport/binder/utils/transport_stream_receiver.h",
+ "src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h",
+ "src/core/ext/transport/binder/wire_format/binder.h",
+ "src/core/ext/transport/binder/wire_format/binder_android.h",
+ "src/core/ext/transport/binder/wire_format/binder_constants.h",
+ "src/core/ext/transport/binder/wire_format/transaction.h",
+ "src/core/ext/transport/binder/wire_format/wire_reader.h",
+ "src/core/ext/transport/binder/wire_format/wire_reader_impl.h",
+ "src/core/ext/transport/binder/wire_format/wire_writer.h",
+ ],
+ defines = select({
+ "grpc_no_binder": ["GRPC_NO_BINDER"],
+ "//conditions:default": [],
+ }),
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/container:flat_hash_map",
+ "absl/memory",
+ "absl/status",
+ "absl/strings",
+ "absl/synchronization",
+ "absl/status:statusor",
+ "absl/time",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "include/grpcpp/security/binder_security_policy.h",
+ "include/grpcpp/create_channel_binder.h",
+ "include/grpcpp/security/binder_credentials.h",
+ ],
+ deps = [
+ "config",
+ "gpr",
+ "gpr_base",
+ "gpr_platform",
+ "grpc",
+ "grpc++_base",
+ "grpc_base",
+ "grpc_client_channel",
+ "grpc_codegen",
+ "iomgr_port",
+ "orphanable",
+ "slice_refcount",
],
)
@@ -431,6 +631,9 @@ grpc_cc_library(
hdrs = [
"src/cpp/client/secure_credentials.h",
],
+ external_deps = [
+ "absl/container:inlined_vector",
+ ],
language = "c++",
deps = [
"grpc++_internals",
@@ -449,6 +652,7 @@ grpc_cc_library(
public_hdrs = [
"include/grpcpp/xds_server_builder.h",
],
+ visibility = ["@grpc:xds"],
deps = [
"grpc++_internals",
],
@@ -463,12 +667,15 @@ grpc_cc_library(
],
language = "c++",
standalone = True,
+ tags = ["avoid_dep"],
+ visibility = ["@grpc:public"],
deps = [
"gpr",
"grpc++_base_unsecure",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
"grpc++_codegen_proto",
+ "grpc_insecure_credentials",
"grpc_unsecure",
],
)
@@ -484,6 +691,7 @@ grpc_cc_library(
],
language = "c++",
standalone = True,
+ visibility = ["@grpc:public"],
deps = [
"grpc++",
],
@@ -499,12 +707,19 @@ grpc_cc_library(
"include/grpcpp/security/alts_context.h",
"include/grpcpp/security/alts_util.h",
],
+ external_deps = [
+ "upb_lib",
+ ],
language = "c++",
standalone = True,
+ visibility = ["@grpc:tsi"],
deps = [
"alts_upb",
"alts_util",
+ "gpr_base",
"grpc++",
+ "grpc_base",
+ "tsi_alts_credentials",
],
)
@@ -529,8 +744,11 @@ grpc_cc_library(
public_hdrs = [
"include/grpc/census.h",
],
+ visibility = ["@grpc:public"],
deps = [
+ "gpr_base",
"grpc_base",
+ "grpc_trace",
],
)
@@ -542,13 +760,21 @@ grpc_cc_library(
external_deps = [
"absl/synchronization",
],
- language = "c++",
deps = [
"gpr_codegen",
],
)
grpc_cc_library(
+ name = "useful",
+ hdrs = ["src/core/lib/gpr/useful.h"],
+ language = "c++",
+ deps = [
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
name = "gpr_base",
srcs = [
"src/core/lib/gpr/alloc.cc",
@@ -578,12 +804,10 @@ grpc_cc_library(
"src/core/lib/gpr/time_posix.cc",
"src/core/lib/gpr/time_precise.cc",
"src/core/lib/gpr/time_windows.cc",
- "src/core/lib/gpr/tls_pthread.cc",
"src/core/lib/gpr/tmpfile_msys.cc",
"src/core/lib/gpr/tmpfile_posix.cc",
"src/core/lib/gpr/tmpfile_windows.cc",
"src/core/lib/gpr/wrap_memcpy.cc",
- "src/core/lib/gprpp/arena.cc",
"src/core/lib/gprpp/examine_stack.cc",
"src/core/lib/gprpp/fork.cc",
"src/core/lib/gprpp/global_config_env.cc",
@@ -600,22 +824,13 @@ grpc_cc_library(
],
hdrs = [
"src/core/lib/gpr/alloc.h",
- "src/core/lib/gpr/arena.h",
"src/core/lib/gpr/env.h",
"src/core/lib/gpr/murmur_hash.h",
"src/core/lib/gpr/spinlock.h",
"src/core/lib/gpr/string.h",
"src/core/lib/gpr/string_windows.h",
"src/core/lib/gpr/time_precise.h",
- "src/core/lib/gpr/tls.h",
- "src/core/lib/gpr/tls_gcc.h",
- "src/core/lib/gpr/tls_msvc.h",
- "src/core/lib/gpr/tls_pthread.h",
- "src/core/lib/gpr/tls_stdcpp.h",
"src/core/lib/gpr/tmpfile.h",
- "src/core/lib/gpr/useful.h",
- "src/core/lib/gprpp/arena.h",
- "src/core/lib/gprpp/atomic.h",
"src/core/lib/gprpp/examine_stack.h",
"src/core/lib/gprpp/fork.h",
"src/core/lib/gprpp/global_config.h",
@@ -635,25 +850,71 @@ grpc_cc_library(
],
external_deps = [
"absl/base",
+ "absl/base:core_headers",
"absl/memory",
+ "absl/random",
"absl/status",
"absl/strings",
+ "absl/strings:cord",
"absl/strings:str_format",
"absl/synchronization",
"absl/time:time",
"absl/types:optional",
+ "upb_lib",
],
language = "c++",
public_hdrs = GPR_PUBLIC_HDRS,
+ visibility = ["@grpc:alt_gpr_base_legacy"],
deps = [
+ "construct_destruct",
"debug_location",
- "google_api_upb",
+ "google_rpc_status_upb",
"gpr_codegen",
+ "gpr_tls",
"grpc_codegen",
+ "protobuf_any_upb",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "gpr_tls",
+ hdrs = ["src/core/lib/gpr/tls.h"],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "chunked_vector",
+ hdrs = ["src/core/lib/gprpp/chunked_vector.h"],
+ external_deps = ["absl/utility"],
+ deps = [
+ "arena",
+ # TODO(ctiller): weaken this to just arena when that splits into its own target
+ "gpr_base",
],
)
grpc_cc_library(
+ name = "capture",
+ external_deps = ["absl/utility"],
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/capture.h"],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "construct_destruct",
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/construct_destruct.h"],
+)
+
+grpc_cc_library(
+ name = "cpp_impl_of",
+ hdrs = ["src/core/lib/gprpp/cpp_impl_of.h"],
+ language = "c++",
+)
+
+grpc_cc_library(
name = "gpr_codegen",
language = "c++",
public_hdrs = [
@@ -673,6 +934,18 @@ grpc_cc_library(
"include/grpc/impl/codegen/sync_posix.h",
"include/grpc/impl/codegen/sync_windows.h",
],
+ visibility = ["@grpc:public"],
+)
+
+# A library that vends only port_platform, so that libraries that don't need
+# anything else from gpr can still be portable!
+grpc_cc_library(
+ name = "gpr_platform",
+ language = "c++",
+ public_hdrs = [
+ "include/grpc/impl/codegen/port_platform.h",
+ "include/grpc/support/port_platform.h",
+ ],
)
grpc_cc_library(
@@ -681,20 +954,31 @@ grpc_cc_library(
hdrs = ["src/core/lib/debug/trace.h"],
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS,
+ visibility = ["@grpc:trace"],
deps = [
+ "gpr",
"grpc_codegen",
- ":gpr",
],
)
grpc_cc_library(
- name = "atomic",
+ name = "config",
+ srcs = [
+ "src/core/lib/config/core_configuration.cc",
+ ],
language = "c++",
public_hdrs = [
- "src/core/lib/gprpp/atomic.h",
+ "src/core/lib/config/core_configuration.h",
],
+ visibility = ["@grpc:client_channel"],
deps = [
- "gpr",
+ "channel_args_preconditioning",
+ "channel_creds_registry",
+ "channel_init",
+ "gpr_base",
+ "grpc_resolver",
+ "handshaker_registry",
+ "service_config_parser",
],
)
@@ -702,12 +986,55 @@ grpc_cc_library(
name = "debug_location",
language = "c++",
public_hdrs = ["src/core/lib/gprpp/debug_location.h"],
+ visibility = ["@grpc:debug_location"],
+)
+
+grpc_cc_library(
+ name = "overload",
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/overload.h"],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "match",
+ external_deps = [
+ "absl/types:variant",
+ ],
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/match.h"],
+ deps = [
+ "gpr_platform",
+ "overload",
+ ],
+)
+
+grpc_cc_library(
+ name = "table",
+ external_deps = ["absl/utility"],
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/table.h"],
+ deps = [
+ "bitset",
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "bitset",
+ language = "c++",
+ public_hdrs = ["src/core/lib/gprpp/bitset.h"],
+ deps = [
+ "gpr_platform",
+ "useful",
+ ],
)
grpc_cc_library(
name = "orphanable",
language = "c++",
public_hdrs = ["src/core/lib/gprpp/orphanable.h"],
+ visibility = ["@grpc:client_channel"],
deps = [
"debug_location",
"gpr_base",
@@ -718,11 +1045,401 @@ grpc_cc_library(
)
grpc_cc_library(
+ name = "poll",
+ external_deps = [
+ "absl/types:variant",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/poll.h",
+ ],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "call_push_pull",
+ hdrs = ["src/core/lib/promise/call_push_pull.h"],
+ language = "c++",
+ deps = [
+ "bitset",
+ "construct_destruct",
+ "poll",
+ "promise_like",
+ "promise_status",
+ ],
+)
+
+grpc_cc_library(
+ name = "context",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/context.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "gpr_tls",
+ ],
+)
+
+grpc_cc_library(
+ name = "map",
+ language = "c++",
+ public_hdrs = ["src/core/lib/promise/map.h"],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_like",
+ ],
+)
+
+grpc_cc_library(
+ name = "sleep",
+ srcs = [
+ "src/core/lib/promise/sleep.cc",
+ ],
+ hdrs = [
+ "src/core/lib/promise/sleep.h",
+ ],
+ deps = [
+ "activity",
+ "gpr_platform",
+ "grpc_base",
+ "poll",
+ ],
+)
+
+grpc_cc_library(
+ name = "promise",
+ external_deps = [
+ "absl/types:optional",
+ "absl/status",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/promise.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_like",
+ ],
+)
+
+grpc_cc_library(
+ name = "arena_promise",
+ external_deps = [
+ "absl/types:optional",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/arena_promise.h",
+ ],
+ deps = [
+ "arena",
+ "gpr_base",
+ "poll",
+ ],
+)
+
+grpc_cc_library(
+ name = "promise_like",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/promise_like.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "poll",
+ ],
+)
+
+grpc_cc_library(
+ name = "promise_factory",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/promise_factory.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_like",
+ ],
+)
+
+grpc_cc_library(
+ name = "if",
+ external_deps = [
+ "absl/status:statusor",
+ ],
+ language = "c++",
+ public_hdrs = ["src/core/lib/promise/if.h"],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_factory",
+ ],
+)
+
+grpc_cc_library(
+ name = "promise_status",
+ external_deps = [
+ "absl/status",
+ "absl/status:statusor",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/status.h",
+ ],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "race",
+ language = "c++",
+ public_hdrs = ["src/core/lib/promise/race.h"],
+ deps = [
+ "gpr_platform",
+ "poll",
+ ],
+)
+
+grpc_cc_library(
+ name = "loop",
+ external_deps = [
+ "absl/types:variant",
+ "absl/status:statusor",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/loop.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_factory",
+ ],
+)
+
+grpc_cc_library(
+ name = "switch",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/switch.h",
+ ],
+ deps = ["gpr_platform"],
+)
+
+grpc_cc_library(
+ name = "basic_join",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/basic_join.h",
+ ],
+ deps = [
+ "bitset",
+ "construct_destruct",
+ "gpr_platform",
+ "poll",
+ "promise_factory",
+ ],
+)
+
+grpc_cc_library(
+ name = "join",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/join.h",
+ ],
+ deps = [
+ "basic_join",
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "try_join",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/try_join.h",
+ ],
+ deps = [
+ "basic_join",
+ "gpr_platform",
+ "promise_status",
+ ],
+)
+
+grpc_cc_library(
+ name = "basic_seq",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/detail/basic_seq.h",
+ ],
+ deps = [
+ "construct_destruct",
+ "gpr_platform",
+ "poll",
+ "promise_factory",
+ "switch",
+ ],
+)
+
+grpc_cc_library(
+ name = "seq",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/seq.h",
+ ],
+ deps = [
+ "basic_seq",
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "try_seq",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/try_seq.h",
+ ],
+ deps = [
+ "basic_seq",
+ "gpr_platform",
+ "promise_status",
+ ],
+)
+
+grpc_cc_library(
+ name = "activity",
+ srcs = [
+ "src/core/lib/promise/activity.cc",
+ ],
+ external_deps = [
+ "absl/base:core_headers",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/activity.h",
+ ],
+ deps = [
+ "atomic_utils",
+ "construct_destruct",
+ "context",
+ "gpr_base",
+ "gpr_codegen",
+ "orphanable",
+ "poll",
+ "promise_factory",
+ "promise_status",
+ ],
+)
+
+grpc_cc_library(
+ name = "exec_ctx_wakeup_scheduler",
+ hdrs = [
+ "src/core/lib/promise/exec_ctx_wakeup_scheduler.h",
+ ],
+ language = "c++",
+ deps = [
+ "exec_ctx",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "wait_set",
+ external_deps = [
+ "absl/container:flat_hash_set",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/wait_set.h",
+ ],
+ deps = [
+ "activity",
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "intra_activity_waiter",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/intra_activity_waiter.h",
+ ],
+ deps = [
+ "activity",
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "latch",
+ external_deps = [
+ "absl/status",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/latch.h",
+ ],
+ deps = [
+ "activity",
+ "gpr_platform",
+ "intra_activity_waiter",
+ ],
+)
+
+grpc_cc_library(
+ name = "observable",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/observable.h",
+ ],
+ deps = [
+ "activity",
+ "gpr_platform",
+ "wait_set",
+ ],
+)
+
+grpc_cc_library(
+ name = "pipe",
+ external_deps = [
+ "absl/status",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/promise/pipe.h",
+ ],
+ deps = [
+ "activity",
+ "arena",
+ "gpr_platform",
+ "intra_activity_waiter",
+ ],
+)
+
+grpc_cc_library(
+ name = "for_each",
+ external_deps = [
+ "absl/status",
+ "absl/types:variant",
+ ],
+ language = "c++",
+ public_hdrs = ["src/core/lib/promise/for_each.h"],
+ deps = [
+ "gpr_platform",
+ "poll",
+ "promise_factory",
+ ],
+)
+
+grpc_cc_library(
name = "ref_counted",
language = "c++",
public_hdrs = ["src/core/lib/gprpp/ref_counted.h"],
deps = [
- "atomic",
+ "atomic_utils",
"debug_location",
"gpr_base",
"grpc_trace",
@@ -735,7 +1452,6 @@ grpc_cc_library(
language = "c++",
public_hdrs = ["src/core/lib/gprpp/dual_ref_counted.h"],
deps = [
- "atomic",
"debug_location",
"gpr_base",
"grpc_trace",
@@ -748,62 +1464,450 @@ grpc_cc_library(
name = "ref_counted_ptr",
language = "c++",
public_hdrs = ["src/core/lib/gprpp/ref_counted_ptr.h"],
+ visibility = ["@grpc:ref_counted_ptr"],
deps = [
"gpr_base",
],
)
grpc_cc_library(
- name = "grpc_base_c",
+ name = "handshaker_factory",
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/channel/handshaker_factory.h",
+ ],
+ deps = [
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "handshaker_registry",
+ srcs = [
+ "src/core/lib/channel/handshaker_registry.cc",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "src/core/lib/channel/handshaker_registry.h",
+ ],
+ deps = [
+ "gpr_base",
+ "handshaker_factory",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_creds_registry",
+ hdrs = [
+ "src/core/lib/security/credentials/channel_creds_registry.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "json",
+ ],
+)
+
+grpc_cc_library(
+ name = "event_engine_memory_allocator",
+ srcs = [
+ "src/core/lib/event_engine/memory_allocator.cc",
+ ],
+ hdrs = [
+ "include/grpc/event_engine/internal/memory_allocator_impl.h",
+ "include/grpc/event_engine/memory_allocator.h",
+ "include/grpc/event_engine/memory_request.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_platform",
+ "ref_counted",
+ "slice",
+ "slice_refcount",
+ ],
+)
+
+grpc_cc_library(
+ name = "memory_quota",
+ srcs = [
+ "src/core/lib/resource_quota/memory_quota.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/memory_quota.h",
+ ],
+ deps = [
+ "activity",
+ "dual_ref_counted",
+ "event_engine_memory_allocator",
+ "exec_ctx_wakeup_scheduler",
+ "gpr_base",
+ "loop",
+ "map",
+ "orphanable",
+ "poll",
+ "race",
+ "ref_counted_ptr",
+ "resource_quota_trace",
+ "seq",
+ "slice_refcount",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "arena",
+ srcs = [
+ "src/core/lib/resource_quota/arena.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/arena.h",
+ ],
+ deps = [
+ "context",
+ "gpr_base",
+ "memory_quota",
+ ],
+)
+
+grpc_cc_library(
+ name = "thread_quota",
+ srcs = [
+ "src/core/lib/resource_quota/thread_quota.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/thread_quota.h",
+ ],
+ deps = [
+ "gpr_base",
+ "ref_counted",
+ ],
+)
+
+grpc_cc_library(
+ name = "resource_quota_trace",
+ srcs = [
+ "src/core/lib/resource_quota/trace.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/trace.h",
+ ],
+ deps = [
+ "gpr_platform",
+ "grpc_trace",
+ ],
+)
+
+grpc_cc_library(
+ name = "resource_quota",
+ srcs = [
+ "src/core/lib/resource_quota/resource_quota.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resource_quota/resource_quota.h",
+ ],
+ deps = [
+ "cpp_impl_of",
+ "gpr_base",
+ "memory_quota",
+ "ref_counted",
+ "thread_quota",
+ ],
+)
+
+grpc_cc_library(
+ name = "slice_refcount",
+ srcs = [
+ "src/core/lib/slice/slice_refcount.cc",
+ ],
+ hdrs = [
+ "src/core/lib/slice/slice_refcount.h",
+ "src/core/lib/slice/slice_refcount_base.h",
+ ],
+ public_hdrs = [
+ "include/grpc/slice.h",
+ ],
+ deps = [
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "slice",
+ srcs = [
+ "src/core/lib/slice/slice.cc",
+ "src/core/lib/slice/slice_string_helpers.cc",
+ ],
+ hdrs = [
+ "src/core/lib/slice/slice.h",
+ "src/core/lib/slice/slice_internal.h",
+ "src/core/lib/slice/slice_string_helpers.h",
+ ],
+ deps = [
+ "gpr_base",
+ "ref_counted",
+ "slice_refcount",
+ ],
+)
+
+grpc_cc_library(
+ name = "error",
+ srcs = [
+ "src/core/lib/iomgr/error.cc",
+ ],
+ hdrs = [
+ "src/core/lib/iomgr/error.h",
+ "src/core/lib/iomgr/error_internal.h",
+ ],
+ deps = [
+ "gpr",
+ "grpc_codegen",
+ "grpc_trace",
+ "slice",
+ "slice_refcount",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "closure",
+ hdrs = [
+ "src/core/lib/iomgr/closure.h",
+ ],
+ deps = [
+ "error",
+ "gpr",
+ ],
+)
+
+grpc_cc_library(
+ name = "time",
+ srcs = [
+ "src/core/lib/gprpp/time.cc",
+ ],
+ hdrs = [
+ "src/core/lib/gprpp/time.h",
+ ],
+ deps = [
+ "gpr",
+ "gpr_codegen",
+ ],
+)
+
+grpc_cc_library(
+ name = "exec_ctx",
+ srcs = [
+ "src/core/lib/iomgr/combiner.cc",
+ "src/core/lib/iomgr/exec_ctx.cc",
+ "src/core/lib/iomgr/executor.cc",
+ "src/core/lib/iomgr/iomgr_internal.cc",
+ ],
+ hdrs = [
+ "src/core/lib/iomgr/combiner.h",
+ "src/core/lib/iomgr/exec_ctx.h",
+ "src/core/lib/iomgr/executor.h",
+ "src/core/lib/iomgr/iomgr_internal.h",
+ ],
+ deps = [
+ "closure",
+ "error",
+ "gpr_base",
+ "gpr_tls",
+ "time",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "sockaddr_utils",
srcs = [
- "src/core/lib/address_utils/parse_address.cc",
"src/core/lib/address_utils/sockaddr_utils.cc",
- "src/core/lib/avl/avl.cc",
+ ],
+ hdrs = [
+ "src/core/lib/address_utils/sockaddr_utils.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "gpr_base",
+ "grpc_sockaddr",
+ "resolved_address",
+ ],
+)
+
+grpc_cc_library(
+ name = "iomgr_port",
+ hdrs = [
+ "src/core/lib/iomgr/port.h",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_sockaddr",
+ srcs = [
+ "src/core/lib/event_engine/sockaddr.cc",
+ "src/core/lib/iomgr/sockaddr_utils_posix.cc",
+ "src/core/lib/iomgr/socket_utils_windows.cc",
+ ],
+ hdrs = [
+ "src/core/lib/event_engine/sockaddr.h",
+ "src/core/lib/iomgr/sockaddr.h",
+ "src/core/lib/iomgr/sockaddr_posix.h",
+ "src/core/lib/iomgr/sockaddr_windows.h",
+ "src/core/lib/iomgr/socket_utils.h",
+ ],
+ deps = [
+ "gpr_base",
+ "iomgr_port",
+ ],
+)
+
+grpc_cc_library(
+ name = "avl",
+ hdrs = [
+ "src/core/lib/avl/avl.h",
+ ],
+ external_deps = [
+ "absl/container:inlined_vector",
+ ],
+ deps = [
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "event_engine_base_hdrs",
+ hdrs = GRPC_PUBLIC_EVENT_ENGINE_HDRS + GRPC_PUBLIC_HDRS,
+ external_deps = [
+ "absl/status",
+ "absl/status:statusor",
+ "absl/time",
+ ],
+ deps = [
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "default_event_engine_factory_hdrs",
+ hdrs = [
+ "src/core/lib/event_engine/event_engine_factory.h",
+ ],
+ deps = [
+ "event_engine_base_hdrs",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "default_event_engine_factory",
+ srcs = [
+ "src/core/lib/event_engine/default_event_engine_factory.cc",
+ ],
+ external_deps = [
+ # TODO(hork): uv, in a subsequent PR
+ ],
+ deps = [
+ "default_event_engine_factory_hdrs",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "event_engine_common",
+ srcs = [
+ "src/core/lib/event_engine/resolved_address.cc",
+ ],
+ deps = [
+ "event_engine_base_hdrs",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "event_engine_base",
+ srcs = [
+ "src/core/lib/event_engine/event_engine.cc",
+ ],
+ deps = [
+ "default_event_engine_factory",
+ "default_event_engine_factory_hdrs",
+ "event_engine_base_hdrs",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "uri_parser",
+ srcs = [
+ "src/core/lib/uri/uri_parser.cc",
+ ],
+ hdrs = [
+ "src/core/lib/uri/uri_parser.h",
+ ],
+ external_deps = [
+ "absl/status:statusor",
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_args_preconditioning",
+ srcs = [
+ "src/core/lib/channel/channel_args_preconditioning.cc",
+ ],
+ hdrs = [
+ "src/core/lib/channel/channel_args_preconditioning.h",
+ ],
+ deps = [
+ "channel_args",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_base",
+ srcs = [
+ "src/core/lib/address_utils/parse_address.cc",
"src/core/lib/backoff/backoff.cc",
- "src/core/lib/channel/channel_args.cc",
"src/core/lib/channel/channel_stack.cc",
- "src/core/lib/channel/channel_stack_builder.cc",
+ "src/core/lib/channel/channel_stack_builder_impl.cc",
"src/core/lib/channel/channel_trace.cc",
"src/core/lib/channel/channelz.cc",
"src/core/lib/channel/channelz_registry.cc",
"src/core/lib/channel/connected_channel.cc",
"src/core/lib/channel/handshaker.cc",
- "src/core/lib/channel/handshaker_registry.cc",
+ "src/core/lib/channel/promise_based_filter.cc",
"src/core/lib/channel/status_util.cc",
"src/core/lib/compression/compression.cc",
- "src/core/lib/compression/compression_args.cc",
"src/core/lib/compression/compression_internal.cc",
"src/core/lib/compression/message_compress.cc",
- "src/core/lib/compression/stream_compression.cc",
- "src/core/lib/compression/stream_compression_gzip.cc",
- "src/core/lib/compression/stream_compression_identity.cc",
"src/core/lib/debug/stats.cc",
"src/core/lib/debug/stats_data.cc",
- "src/core/lib/event_engine/slice_allocator.cc",
+ "src/core/lib/event_engine/channel_args_endpoint_config.cc",
"src/core/lib/event_engine/sockaddr.cc",
- "src/core/lib/http/format_request.cc",
- "src/core/lib/http/httpcli.cc",
- "src/core/lib/http/parser.cc",
"src/core/lib/iomgr/buffer_list.cc",
"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/endpoint.cc",
"src/core/lib/iomgr/endpoint_cfstream.cc",
+ "src/core/lib/iomgr/endpoint_pair_event_engine.cc",
"src/core/lib/iomgr/endpoint_pair_posix.cc",
- "src/core/lib/iomgr/endpoint_pair_uv.cc",
"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_epoll1_linux.cc",
- "src/core/lib/iomgr/ev_epollex_linux.cc",
"src/core/lib/iomgr/ev_poll_posix.cc",
"src/core/lib/iomgr/ev_posix.cc",
"src/core/lib/iomgr/ev_windows.cc",
- "src/core/lib/iomgr/exec_ctx.cc",
- "src/core/lib/iomgr/executor.cc",
"src/core/lib/iomgr/executor/mpmcqueue.cc",
"src/core/lib/iomgr/executor/threadpool.cc",
"src/core/lib/iomgr/fork_posix.cc",
@@ -816,60 +1920,42 @@ grpc_cc_library(
"src/core/lib/iomgr/internal_errqueue.cc",
"src/core/lib/iomgr/iocp_windows.cc",
"src/core/lib/iomgr/iomgr.cc",
- "src/core/lib/iomgr/iomgr_custom.cc",
- "src/core/lib/iomgr/iomgr_internal.cc",
"src/core/lib/iomgr/iomgr_posix.cc",
"src/core/lib/iomgr/iomgr_posix_cfstream.cc",
- "src/core/lib/iomgr/iomgr_uv.cc",
"src/core/lib/iomgr/iomgr_windows.cc",
- "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/polling_entity.cc",
"src/core/lib/iomgr/pollset.cc",
- "src/core/lib/iomgr/pollset_custom.cc",
"src/core/lib/iomgr/pollset_set.cc",
- "src/core/lib/iomgr/pollset_set_custom.cc",
"src/core/lib/iomgr/pollset_set_windows.cc",
- "src/core/lib/iomgr/pollset_uv.cc",
"src/core/lib/iomgr/pollset_windows.cc",
"src/core/lib/iomgr/resolve_address.cc",
- "src/core/lib/iomgr/resolve_address_custom.cc",
"src/core/lib/iomgr/resolve_address_posix.cc",
"src/core/lib/iomgr/resolve_address_windows.cc",
- "src/core/lib/iomgr/resource_quota.cc",
"src/core/lib/iomgr/socket_factory_posix.cc",
"src/core/lib/iomgr/socket_mutator.cc",
"src/core/lib/iomgr/socket_utils_common_posix.cc",
"src/core/lib/iomgr/socket_utils_linux.cc",
"src/core/lib/iomgr/socket_utils_posix.cc",
- "src/core/lib/iomgr/socket_utils_uv.cc",
- "src/core/lib/iomgr/socket_utils_windows.cc",
"src/core/lib/iomgr/socket_windows.cc",
"src/core/lib/iomgr/tcp_client.cc",
"src/core/lib/iomgr/tcp_client_cfstream.cc",
- "src/core/lib/iomgr/tcp_client_custom.cc",
"src/core/lib/iomgr/tcp_client_posix.cc",
"src/core/lib/iomgr/tcp_client_windows.cc",
- "src/core/lib/iomgr/tcp_custom.cc",
"src/core/lib/iomgr/tcp_posix.cc",
"src/core/lib/iomgr/tcp_server.cc",
- "src/core/lib/iomgr/tcp_server_custom.cc",
"src/core/lib/iomgr/tcp_server_posix.cc",
"src/core/lib/iomgr/tcp_server_utils_posix_common.cc",
"src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc",
"src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc",
"src/core/lib/iomgr/tcp_server_windows.cc",
- "src/core/lib/iomgr/tcp_uv.cc",
"src/core/lib/iomgr/tcp_windows.cc",
"src/core/lib/iomgr/time_averaged_stats.cc",
"src/core/lib/iomgr/timer.cc",
- "src/core/lib/iomgr/timer_custom.cc",
"src/core/lib/iomgr/timer_generic.cc",
"src/core/lib/iomgr/timer_heap.cc",
"src/core/lib/iomgr/timer_manager.cc",
- "src/core/lib/iomgr/timer_uv.cc",
- "src/core/lib/iomgr/udp_server.cc",
"src/core/lib/iomgr/unix_sockets_posix.cc",
"src/core/lib/iomgr/unix_sockets_posix_noop.cc",
"src/core/lib/iomgr/wakeup_fd_eventfd.cc",
@@ -877,97 +1963,89 @@ grpc_cc_library(
"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/json/json_reader.cc",
- "src/core/lib/json/json_util.cc",
- "src/core/lib/json/json_writer.cc",
+ "src/core/lib/resource_quota/api.cc",
"src/core/lib/slice/b64.cc",
"src/core/lib/slice/percent_encoding.cc",
- "src/core/lib/slice/slice.cc",
+ "src/core/lib/slice/slice_api.cc",
"src/core/lib/slice/slice_buffer.cc",
- "src/core/lib/slice/slice_intern.cc",
- "src/core/lib/slice/slice_string_helpers.cc",
+ "src/core/lib/slice/slice_split.cc",
"src/core/lib/surface/api_trace.cc",
+ "src/core/lib/surface/builtins.cc",
"src/core/lib/surface/byte_buffer.cc",
"src/core/lib/surface/byte_buffer_reader.cc",
"src/core/lib/surface/call.cc",
"src/core/lib/surface/call_details.cc",
"src/core/lib/surface/call_log_batch.cc",
"src/core/lib/surface/channel.cc",
- "src/core/lib/surface/channel_init.cc",
"src/core/lib/surface/channel_ping.cc",
- "src/core/lib/surface/channel_stack_type.cc",
"src/core/lib/surface/completion_queue.cc",
"src/core/lib/surface/completion_queue_factory.cc",
"src/core/lib/surface/event_string.cc",
+ "src/core/lib/surface/lame_client.cc",
"src/core/lib/surface/metadata_array.cc",
"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/bdp_estimator.cc",
"src/core/lib/transport/byte_stream.cc",
"src/core/lib/transport/connectivity_state.cc",
"src/core/lib/transport/error_utils.cc",
- "src/core/lib/transport/metadata.cc",
- "src/core/lib/transport/metadata_batch.cc",
+ "src/core/lib/transport/parsed_metadata.cc",
"src/core/lib/transport/pid_controller.cc",
- "src/core/lib/transport/static_metadata.cc",
"src/core/lib/transport/status_conversion.cc",
- "src/core/lib/transport/status_metadata.cc",
"src/core/lib/transport/timeout_encoding.cc",
"src/core/lib/transport/transport.cc",
"src/core/lib/transport/transport_op_string.cc",
- "src/core/lib/uri/uri_parser.cc",
+ ] +
+ # TODO(hork): delete the iomgr glue code when EventEngine is fully
+ # integrated, or when it becomes obvious the glue code is unnecessary.
+ [
+ "src/core/lib/iomgr/event_engine/closure.cc",
+ "src/core/lib/iomgr/event_engine/endpoint.cc",
+ "src/core/lib/iomgr/event_engine/iomgr.cc",
+ "src/core/lib/iomgr/event_engine/pollset.cc",
+ "src/core/lib/iomgr/event_engine/resolved_address_internal.cc",
+ "src/core/lib/iomgr/event_engine/resolver.cc",
+ "src/core/lib/iomgr/event_engine/tcp.cc",
+ "src/core/lib/iomgr/event_engine/timer.cc",
],
hdrs = [
+ "src/core/lib/transport/error_utils.h",
+ "src/core/lib/transport/http2_errors.h",
"src/core/lib/address_utils/parse_address.h",
- "src/core/lib/address_utils/sockaddr_utils.h",
- "src/core/lib/avl/avl.h",
"src/core/lib/backoff/backoff.h",
- "src/core/lib/channel/channel_args.h",
+ "src/core/lib/channel/call_finalization.h",
+ "src/core/lib/channel/call_tracer.h",
"src/core/lib/channel/channel_stack.h",
- "src/core/lib/channel/channel_stack_builder.h",
+ "src/core/lib/channel/promise_based_filter.h",
+ "src/core/lib/channel/channel_stack_builder_impl.h",
"src/core/lib/channel/channel_trace.h",
"src/core/lib/channel/channelz.h",
"src/core/lib/channel/channelz_registry.h",
"src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h",
"src/core/lib/channel/handshaker.h",
- "src/core/lib/channel/handshaker_factory.h",
- "src/core/lib/channel/handshaker_registry.h",
"src/core/lib/channel/status_util.h",
- "src/core/lib/compression/algorithm_metadata.h",
- "src/core/lib/compression/compression_args.h",
"src/core/lib/compression/compression_internal.h",
+ "src/core/lib/resource_quota/api.h",
"src/core/lib/compression/message_compress.h",
- "src/core/lib/compression/stream_compression.h",
- "src/core/lib/compression/stream_compression_gzip.h",
- "src/core/lib/compression/stream_compression_identity.h",
"src/core/lib/debug/stats.h",
"src/core/lib/debug/stats_data.h",
- "src/core/lib/http/format_request.h",
- "src/core/lib/http/httpcli.h",
- "src/core/lib/http/parser.h",
+ "src/core/lib/event_engine/channel_args_endpoint_config.h",
+ "src/core/lib/event_engine/sockaddr.h",
"src/core/lib/iomgr/block_annotate.h",
"src/core/lib/iomgr/buffer_list.h",
"src/core/lib/iomgr/call_combiner.h",
"src/core/lib/iomgr/cfstream_handle.h",
- "src/core/lib/iomgr/closure.h",
- "src/core/lib/iomgr/combiner.h",
"src/core/lib/iomgr/dynamic_annotations.h",
"src/core/lib/iomgr/endpoint.h",
"src/core/lib/iomgr/endpoint_cfstream.h",
"src/core/lib/iomgr/endpoint_pair.h",
- "src/core/lib/iomgr/error.h",
"src/core/lib/iomgr/error_cfstream.h",
- "src/core/lib/iomgr/error_internal.h",
"src/core/lib/iomgr/ev_apple.h",
"src/core/lib/iomgr/ev_epoll1_linux.h",
- "src/core/lib/iomgr/ev_epollex_linux.h",
"src/core/lib/iomgr/ev_poll_posix.h",
"src/core/lib/iomgr/ev_posix.h",
- "src/core/lib/iomgr/exec_ctx.h",
- "src/core/lib/iomgr/executor.h",
"src/core/lib/iomgr/executor/mpmcqueue.h",
"src/core/lib/iomgr/executor/threadpool.h",
"src/core/lib/iomgr/gethostname.h",
@@ -975,66 +2053,49 @@ grpc_cc_library(
"src/core/lib/iomgr/internal_errqueue.h",
"src/core/lib/iomgr/iocp_windows.h",
"src/core/lib/iomgr/iomgr.h",
- "src/core/lib/iomgr/iomgr_custom.h",
- "src/core/lib/iomgr/iomgr_internal.h",
- "src/core/lib/iomgr/is_epollexclusive_available.h",
"src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/nameser.h",
"src/core/lib/iomgr/polling_entity.h",
"src/core/lib/iomgr/pollset.h",
- "src/core/lib/iomgr/pollset_custom.h",
"src/core/lib/iomgr/pollset_set.h",
- "src/core/lib/iomgr/pollset_set_custom.h",
"src/core/lib/iomgr/pollset_set_windows.h",
- "src/core/lib/iomgr/pollset_uv.h",
"src/core/lib/iomgr/pollset_windows.h",
- "src/core/lib/iomgr/port.h",
"src/core/lib/iomgr/python_util.h",
"src/core/lib/iomgr/resolve_address.h",
- "src/core/lib/iomgr/resolve_address_custom.h",
- "src/core/lib/iomgr/resource_quota.h",
+ "src/core/lib/iomgr/resolve_address_impl.h",
+ "src/core/lib/iomgr/resolve_address_posix.h",
+ "src/core/lib/iomgr/resolve_address_windows.h",
"src/core/lib/iomgr/sockaddr.h",
- "src/core/lib/iomgr/sockaddr_custom.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_factory_posix.h",
"src/core/lib/iomgr/socket_mutator.h",
- "src/core/lib/iomgr/socket_utils.h",
"src/core/lib/iomgr/socket_utils_posix.h",
"src/core/lib/iomgr/socket_windows.h",
- "src/core/lib/iomgr/sys_epoll_wrapper.h",
"src/core/lib/iomgr/tcp_client.h",
"src/core/lib/iomgr/tcp_client_posix.h",
- "src/core/lib/iomgr/tcp_custom.h",
"src/core/lib/iomgr/tcp_posix.h",
"src/core/lib/iomgr/tcp_server.h",
"src/core/lib/iomgr/tcp_server_utils_posix.h",
"src/core/lib/iomgr/tcp_windows.h",
"src/core/lib/iomgr/time_averaged_stats.h",
"src/core/lib/iomgr/timer.h",
- "src/core/lib/iomgr/timer_custom.h",
"src/core/lib/iomgr/timer_generic.h",
"src/core/lib/iomgr/timer_heap.h",
"src/core/lib/iomgr/timer_manager.h",
- "src/core/lib/iomgr/udp_server.h",
"src/core/lib/iomgr/unix_sockets_posix.h",
"src/core/lib/iomgr/wakeup_fd_pipe.h",
"src/core/lib/iomgr/wakeup_fd_posix.h",
"src/core/lib/iomgr/work_serializer.h",
- "src/core/lib/json/json.h",
- "src/core/lib/json/json_util.h",
"src/core/lib/slice/b64.h",
"src/core/lib/slice/percent_encoding.h",
- "src/core/lib/slice/slice_internal.h",
- "src/core/lib/slice/slice_string_helpers.h",
- "src/core/lib/slice/slice_utils.h",
+ "src/core/lib/slice/slice_split.h",
"src/core/lib/surface/api_trace.h",
+ "src/core/lib/surface/builtins.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
"src/core/lib/surface/channel.h",
- "src/core/lib/surface/channel_init.h",
- "src/core/lib/surface/channel_stack_type.h",
"src/core/lib/surface/completion_queue.h",
"src/core/lib/surface/completion_queue_factory.h",
"src/core/lib/surface/event_string.h",
@@ -1042,83 +2103,349 @@ grpc_cc_library(
"src/core/lib/surface/lame_client.h",
"src/core/lib/surface/server.h",
"src/core/lib/surface/validate_metadata.h",
- "src/core/lib/transport/authority_override.h",
"src/core/lib/transport/bdp_estimator.h",
"src/core/lib/transport/byte_stream.h",
"src/core/lib/transport/connectivity_state.h",
- "src/core/lib/transport/error_utils.h",
- "src/core/lib/transport/http2_errors.h",
- "src/core/lib/transport/metadata.h",
"src/core/lib/transport/metadata_batch.h",
+ "src/core/lib/transport/parsed_metadata.h",
"src/core/lib/transport/pid_controller.h",
- "src/core/lib/transport/static_metadata.h",
"src/core/lib/transport/status_conversion.h",
- "src/core/lib/transport/status_metadata.h",
"src/core/lib/transport/timeout_encoding.h",
"src/core/lib/transport/transport.h",
"src/core/lib/transport/transport_impl.h",
- "src/core/lib/uri/uri_parser.h",
+ ] +
+ # TODO(ctiller): remove these
+ # These headers used to be vended by this target, but they have been split
+ # out into separate targets now. In order to transition downstream code, we
+ # re-export these headers from here for now, and when LSC's have completed
+ # to clean this up, we'll remove these.
+ [
+ "src/core/lib/iomgr/closure.h",
+ "src/core/lib/iomgr/error.h",
+ "src/core/lib/iomgr/error_internal.h",
+ "src/core/lib/slice/slice_internal.h",
+ "src/core/lib/slice/slice_string_helpers.h",
+ "src/core/lib/iomgr/exec_ctx.h",
+ "src/core/lib/iomgr/executor.h",
+ "src/core/lib/iomgr/combiner.h",
+ "src/core/lib/iomgr/iomgr_internal.h",
+ "src/core/lib/channel/channel_args.h",
+ "src/core/lib/channel/channel_stack_builder.h",
+ ] +
+ # TODO(hork): delete the iomgr glue code when EventEngine is fully
+ # integrated, or when it becomes obvious the glue code is unnecessary.
+ [
+ "src/core/lib/iomgr/event_engine/closure.h",
+ "src/core/lib/iomgr/event_engine/endpoint.h",
+ "src/core/lib/iomgr/event_engine/pollset.h",
+ "src/core/lib/iomgr/event_engine/promise.h",
+ "src/core/lib/iomgr/event_engine/resolved_address_internal.h",
+ "src/core/lib/iomgr/event_engine/resolver.h",
],
external_deps = [
- "madler_zlib",
+ "absl/container:flat_hash_map",
"absl/container:inlined_vector",
- "absl/status",
+ "absl/functional:bind_front",
+ "absl/memory",
"absl/status:statusor",
+ "absl/status",
+ "absl/strings:str_format",
"absl/strings",
"absl/types:optional",
- "absl/container:flat_hash_map",
+ "madler_zlib",
],
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS,
+ visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
+ "arena",
+ "arena_promise",
+ "avl",
+ "bitset",
+ "channel_args",
+ "channel_stack_builder",
+ "channel_stack_type",
+ "chunked_vector",
+ "closure",
+ "config",
+ "default_event_engine_factory",
"dual_ref_counted",
+ "error",
+ "event_engine_base",
+ "event_engine_common",
+ "exec_ctx",
"gpr_base",
+ "gpr_codegen",
+ "gpr_tls",
"grpc_codegen",
+ "grpc_sockaddr",
"grpc_trace",
+ "iomgr_port",
+ "json",
+ "latch",
+ "memory_quota",
"orphanable",
+ "promise",
"ref_counted",
"ref_counted_ptr",
+ "resolved_address",
+ "resource_quota",
+ "resource_quota_trace",
+ "slice",
+ "slice_refcount",
+ "sockaddr_utils",
+ "table",
+ "time",
+ "uri_parser",
+ "useful",
],
)
grpc_cc_library(
- name = "grpc_base",
+ name = "channel_stack_type",
srcs = [
- "src/core/lib/surface/lame_client.cc",
+ "src/core/lib/surface/channel_stack_type.cc",
+ ],
+ hdrs = [
+ "src/core/lib/surface/channel_stack_type.h",
],
language = "c++",
deps = [
- "atomic",
- "grpc_base_c",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_init",
+ srcs = [
+ "src/core/lib/surface/channel_init.cc",
+ ],
+ hdrs = [
+ "src/core/lib/surface/channel_init.h",
+ ],
+ language = "c++",
+ deps = [
+ "channel_stack_builder",
+ "channel_stack_type",
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "single_set_ptr",
+ hdrs = [
+ "src/core/lib/gprpp/single_set_ptr.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_stack_builder",
+ srcs = [
+ "src/core/lib/channel/channel_stack_builder.cc",
+ ],
+ hdrs = [
+ "src/core/lib/channel/channel_stack_builder.h",
+ ],
+ language = "c++",
+ visibility = ["@grpc:alt_grpc_base_legacy"],
+ deps = [
+ "channel_args",
+ "channel_stack_type",
+ "closure",
+ "error",
+ "gpr_base",
],
)
grpc_cc_library(
name = "grpc_common",
+ defines = select({
+ "grpc_no_rls": ["GRPC_NO_RLS"],
+ "//conditions:default": [],
+ }),
language = "c++",
+ select_deps = [
+ {
+ "grpc_no_rls": [],
+ "//conditions:default": ["grpc_lb_policy_rls"],
+ },
+ ],
deps = [
"grpc_base",
# standard plugins
"census",
"grpc_deadline_filter",
"grpc_client_authority_filter",
+ "grpc_lb_policy_grpclb",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_priority",
+ "grpc_lb_policy_ring_hash",
"grpc_lb_policy_round_robin",
"grpc_lb_policy_weighted_target",
- "grpc_client_idle_filter",
- "grpc_max_age_filter",
+ "grpc_channel_idle_filter",
"grpc_message_size_filter",
+ "grpc_resolver_binder",
"grpc_resolver_dns_ares",
"grpc_resolver_fake",
"grpc_resolver_dns_native",
"grpc_resolver_sockaddr",
- "grpc_transport_chttp2_client_insecure",
- "grpc_transport_chttp2_server_insecure",
+ "grpc_transport_chttp2_client_connector",
+ "grpc_transport_chttp2_server",
"grpc_transport_inproc",
"grpc_fault_injection_filter",
- "grpc_workaround_cronet_compression_filter",
- "grpc_server_backward_compatibility",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_service_config",
+ hdrs = [
+ "src/core/lib/service_config/service_config.h",
+ "src/core/lib/service_config/service_config_call_data.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "error",
+ "gpr_base",
+ "json",
+ "service_config_parser",
+ "slice",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_service_config_impl",
+ srcs = [
+ "src/core/lib/service_config/service_config_impl.cc",
+ ],
+ hdrs = [
+ "src/core/lib/service_config/service_config_impl.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ visibility = ["@grpc:client_channel"],
+ deps = [
+ "config",
+ "error",
+ "gpr_base",
+ "grpc_service_config",
+ "json",
+ "service_config_parser",
+ "slice",
+ ],
+)
+
+grpc_cc_library(
+ name = "service_config_parser",
+ srcs = [
+ "src/core/lib/service_config/service_config_parser.cc",
+ ],
+ hdrs = [
+ "src/core/lib/service_config/service_config_parser.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "error",
+ "gpr_base",
+ "json",
+ ],
+)
+
+grpc_cc_library(
+ name = "server_address",
+ srcs = [
+ "src/core/lib/resolver/server_address.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resolver/server_address.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ visibility = ["@grpc:client_channel"],
+ deps = [
+ "channel_args",
+ "gpr_platform",
+ "resolved_address",
+ "sockaddr_utils",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_resolver",
+ srcs = [
+ "src/core/lib/resolver/resolver.cc",
+ "src/core/lib/resolver/resolver_registry.cc",
+ ],
+ hdrs = [
+ "src/core/lib/resolver/resolver.h",
+ "src/core/lib/resolver/resolver_factory.h",
+ "src/core/lib/resolver/resolver_registry.h",
+ ],
+ external_deps = [
+ "absl/memory",
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ visibility = ["@grpc:client_channel"],
+ deps = [
+ "gpr_base",
+ "grpc_service_config",
+ "orphanable",
+ "server_address",
+ "uri_parser",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_args",
+ srcs = [
+ "src/core/lib/channel/channel_args.cc",
+ ],
+ hdrs = [
+ "src/core/lib/channel/channel_args.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/types:variant",
+ "absl/types:optional",
+ ],
+ language = "c++",
+ deps = [
+ "avl",
+ "channel_stack_type",
+ "dual_ref_counted",
+ "gpr_base",
+ "grpc_codegen",
+ "match",
+ "ref_counted",
+ "ref_counted_ptr",
+ "time",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "resolved_address",
+ hdrs = ["src/core/lib/iomgr/resolved_address.h"],
+ language = "c++",
+ deps = [
+ "gpr_platform",
],
)
@@ -1143,18 +2470,14 @@ grpc_cc_library(
"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",
- "src/core/ext/filters/client_channel/resolver.cc",
- "src/core/ext/filters/client_channel/resolver_registry.cc",
"src/core/ext/filters/client_channel/resolver_result_parsing.cc",
"src/core/ext/filters/client_channel/retry_filter.cc",
"src/core/ext/filters/client_channel/retry_service_config.cc",
"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/subchannel.cc",
"src/core/ext/filters/client_channel/subchannel_pool_interface.cc",
+ "src/core/ext/filters/client_channel/subchannel_stream_client.cc",
],
hdrs = [
"src/core/ext/filters/client_channel/backend_metric.h",
@@ -1176,60 +2499,123 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/local_subchannel_pool.h",
"src/core/ext/filters/client_channel/proxy_mapper.h",
"src/core/ext/filters/client_channel/proxy_mapper_registry.h",
- "src/core/ext/filters/client_channel/resolver.h",
- "src/core/ext/filters/client_channel/resolver_factory.h",
- "src/core/ext/filters/client_channel/resolver_registry.h",
"src/core/ext/filters/client_channel/resolver_result_parsing.h",
"src/core/ext/filters/client_channel/retry_filter.h",
"src/core/ext/filters/client_channel/retry_service_config.h",
"src/core/ext/filters/client_channel/retry_throttle.h",
- "src/core/ext/filters/client_channel/server_address.h",
- "src/core/ext/filters/client_channel/service_config.h",
- "src/core/ext/filters/client_channel/service_config_call_data.h",
- "src/core/ext/filters/client_channel/service_config_parser.h",
"src/core/ext/filters/client_channel/subchannel.h",
"src/core/ext/filters/client_channel/subchannel_interface.h",
"src/core/ext/filters/client_channel/subchannel_pool_interface.h",
+ "src/core/ext/filters/client_channel/subchannel_stream_client.h",
],
external_deps = [
"absl/container:inlined_vector",
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/types:optional",
+ "absl/status:statusor",
+ "upb_lib",
],
language = "c++",
+ visibility = ["@grpc:client_channel"],
deps = [
+ "config",
+ "debug_location",
+ "error",
"gpr_base",
"grpc_base",
"grpc_client_authority_filter",
"grpc_deadline_filter",
"grpc_health_upb",
+ "grpc_resolver",
+ "grpc_service_config",
+ "grpc_service_config_impl",
+ "grpc_trace",
+ "handshaker_registry",
+ "httpcli",
+ "json",
+ "json_util",
"orphanable",
"ref_counted",
"ref_counted_ptr",
- "udpa_orca_upb",
+ "server_address",
+ "slice",
+ "sockaddr_utils",
+ "time",
+ "uri_parser",
+ "useful",
+ "xds_orca_upb",
],
)
grpc_cc_library(
- name = "grpc_client_idle_filter",
+ name = "grpc_server_config_selector",
srcs = [
- "src/core/ext/filters/client_idle/client_idle_filter.cc",
+ "src/core/ext/filters/server_config_selector/server_config_selector.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/server_config_selector/server_config_selector.h",
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
+ "grpc_service_config",
],
)
grpc_cc_library(
- name = "grpc_max_age_filter",
+ name = "grpc_server_config_selector_filter",
srcs = [
- "src/core/ext/filters/max_age/max_age_filter.cc",
+ "src/core/ext/filters/server_config_selector/server_config_selector_filter.cc",
],
hdrs = [
- "src/core/ext/filters/max_age/max_age_filter.h",
+ "src/core/ext/filters/server_config_selector/server_config_selector_filter.h",
],
language = "c++",
deps = [
+ "arena",
+ "gpr_base",
"grpc_base",
+ "grpc_server_config_selector",
+ "grpc_service_config",
+ "promise",
+ ],
+)
+
+grpc_cc_library(
+ name = "idle_filter_state",
+ srcs = [
+ "src/core/ext/filters/channel_idle/idle_filter_state.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/channel_idle/idle_filter_state.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_channel_idle_filter",
+ srcs = [
+ "src/core/ext/filters/channel_idle/channel_idle_filter.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/channel_idle/channel_idle_filter.h",
+ ],
+ deps = [
+ "capture",
+ "config",
+ "exec_ctx_wakeup_scheduler",
+ "gpr_base",
+ "grpc_base",
+ "idle_filter_state",
+ "loop",
+ "single_set_ptr",
+ "sleep",
+ "try_seq",
],
)
@@ -1243,7 +2629,10 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
+ "slice",
],
)
@@ -1257,7 +2646,11 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "channel_stack_type",
+ "config",
+ "gpr_base",
"grpc_base",
+ "slice",
],
)
@@ -1269,10 +2662,16 @@ grpc_cc_library(
hdrs = [
"src/core/ext/filters/message_size/message_size_filter.h",
],
+ external_deps = ["absl/strings:str_format"],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
- "grpc_client_channel",
+ "grpc_codegen",
+ "grpc_service_config",
+ "ref_counted",
+ "ref_counted_ptr",
],
)
@@ -1286,47 +2685,69 @@ grpc_cc_library(
"src/core/ext/filters/fault_injection/fault_injection_filter.h",
"src/core/ext/filters/fault_injection/service_config_parser.h",
],
+ external_deps = ["absl/strings"],
language = "c++",
deps = [
+ "capture",
+ "gpr_base",
"grpc_base",
- "grpc_client_channel",
+ "grpc_service_config",
+ "json_util",
+ "sleep",
+ "try_seq",
],
)
grpc_cc_library(
- name = "grpc_http_filters",
+ name = "grpc_rbac_filter",
srcs = [
- "src/core/ext/filters/http/client/http_client_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/server/http_server_filter.cc",
+ "src/core/ext/filters/rbac/rbac_filter.cc",
+ "src/core/ext/filters/rbac/rbac_service_config_parser.cc",
],
hdrs = [
- "src/core/ext/filters/http/client/http_client_filter.h",
- "src/core/ext/filters/http/message_compress/message_compress_filter.h",
- "src/core/ext/filters/http/message_compress/message_decompress_filter.h",
- "src/core/ext/filters/http/server/http_server_filter.h",
+ "src/core/ext/filters/rbac/rbac_filter.h",
+ "src/core/ext/filters/rbac/rbac_service_config_parser.h",
],
+ external_deps = ["absl/strings:str_format"],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
- "grpc_message_size_filter",
+ "grpc_rbac_engine",
+ "grpc_service_config",
+ "json_util",
],
)
grpc_cc_library(
- name = "grpc_workaround_cronet_compression_filter",
+ name = "grpc_http_filters",
srcs = [
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc",
+ "src/core/ext/filters/http/client/http_client_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/server/http_server_filter.cc",
],
hdrs = [
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h",
+ "src/core/ext/filters/http/client/http_client_filter.h",
+ "src/core/ext/filters/http/message_compress/message_compress_filter.h",
+ "src/core/ext/filters/http/message_compress/message_decompress_filter.h",
+ "src/core/ext/filters/http/server/http_server_filter.h",
+ ],
+ external_deps = [
+ "absl/strings:str_format",
+ "absl/strings",
+ "absl/types:optional",
],
language = "c++",
deps = [
+ "call_push_pull",
+ "config",
+ "gpr_base",
"grpc_base",
- "grpc_server_backward_compatibility",
+ "grpc_message_size_filter",
+ "seq",
+ "slice",
],
)
@@ -1343,6 +2764,7 @@ grpc_cc_library(
"include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/slice.h",
],
+ visibility = ["@grpc:public"],
deps = [
"gpr_codegen",
],
@@ -1357,9 +2779,12 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h",
],
language = "c++",
+ visibility = ["@grpc:grpclb"],
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "useful",
],
)
@@ -1368,53 +2793,76 @@ grpc_cc_library(
srcs = [
"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_channel.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",
],
hdrs = [
"src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
],
+ external_deps = [
+ "absl/memory",
+ "absl/container:inlined_vector",
+ "absl/strings",
+ "absl/strings:str_format",
+ "upb_lib",
+ ],
language = "c++",
deps = [
+ "config",
+ "error",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_grpclb_balancer_addresses",
"grpc_lb_upb",
"grpc_resolver_fake",
- "grpc_transport_chttp2_client_insecure",
+ "grpc_security_base",
+ "grpc_sockaddr",
+ "grpc_transport_chttp2_client_connector",
+ "orphanable",
+ "protobuf_duration_upb",
+ "protobuf_timestamp_upb",
+ "ref_counted_ptr",
+ "server_address",
+ "slice",
+ "sockaddr_utils",
],
)
grpc_cc_library(
- name = "grpc_lb_policy_grpclb_secure",
+ name = "grpc_lb_policy_rls",
srcs = [
- "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_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/rls/rls.cc",
],
- hdrs = [
- "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
+ external_deps = [
+ "absl/container:inlined_vector",
+ "absl/hash",
+ "absl/memory",
+ "absl/strings",
+ "upb_lib",
],
language = "c++",
deps = [
+ "config",
+ "dual_ref_counted",
+ "gpr_base",
+ "gpr_codegen",
"grpc_base",
"grpc_client_channel",
- "grpc_grpclb_balancer_addresses",
- "grpc_lb_upb",
- "grpc_resolver_fake",
- "grpc_secure",
- "grpc_transport_chttp2_client_secure",
+ "grpc_codegen",
+ "grpc_fake_credentials",
+ "grpc_resolver",
+ "grpc_security_base",
+ "grpc_service_config_impl",
+ "json",
+ "json_util",
+ "orphanable",
+ "ref_counted",
+ "rls_upb",
+ "uri_parser",
],
)
@@ -1429,8 +2877,17 @@ grpc_cc_library(
"src/core/ext/xds/xds_certificate_provider.cc",
"src/core/ext/xds/xds_client.cc",
"src/core/ext/xds/xds_client_stats.cc",
+ "src/core/ext/xds/xds_cluster.cc",
+ "src/core/ext/xds/xds_cluster_specifier_plugin.cc",
+ "src/core/ext/xds/xds_common_types.cc",
+ "src/core/ext/xds/xds_endpoint.cc",
"src/core/ext/xds/xds_http_fault_filter.cc",
"src/core/ext/xds/xds_http_filters.cc",
+ "src/core/ext/xds/xds_http_rbac_filter.cc",
+ "src/core/ext/xds/xds_listener.cc",
+ "src/core/ext/xds/xds_resource_type.cc",
+ "src/core/ext/xds/xds_route_config.cc",
+ "src/core/ext/xds/xds_routing.cc",
"src/core/lib/security/credentials/xds/xds_credentials.cc",
],
hdrs = [
@@ -1438,35 +2895,128 @@ grpc_cc_library(
"src/core/ext/xds/certificate_provider_registry.h",
"src/core/ext/xds/certificate_provider_store.h",
"src/core/ext/xds/file_watcher_certificate_provider_factory.h",
+ "src/core/ext/xds/upb_utils.h",
"src/core/ext/xds/xds_api.h",
"src/core/ext/xds/xds_bootstrap.h",
"src/core/ext/xds/xds_certificate_provider.h",
"src/core/ext/xds/xds_channel_args.h",
"src/core/ext/xds/xds_client.h",
"src/core/ext/xds/xds_client_stats.h",
+ "src/core/ext/xds/xds_cluster.h",
+ "src/core/ext/xds/xds_cluster_specifier_plugin.h",
+ "src/core/ext/xds/xds_common_types.h",
+ "src/core/ext/xds/xds_endpoint.h",
"src/core/ext/xds/xds_http_fault_filter.h",
"src/core/ext/xds/xds_http_filters.h",
+ "src/core/ext/xds/xds_http_rbac_filter.h",
+ "src/core/ext/xds/xds_listener.h",
+ "src/core/ext/xds/xds_resource_type.h",
+ "src/core/ext/xds/xds_resource_type_impl.h",
+ "src/core/ext/xds/xds_route_config.h",
+ "src/core/ext/xds/xds_routing.h",
"src/core/lib/security/credentials/xds/xds_credentials.h",
],
external_deps = [
"absl/functional:bind_front",
+ "absl/memory",
+ "absl/status:statusor",
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/container:inlined_vector",
"upb_lib",
"upb_textformat_lib",
"upb_json_lib",
"re2",
+ "upb_reflection",
],
language = "c++",
deps = [
- "envoy_ads_upb",
- "envoy_ads_upbdefs",
+ "channel_creds_registry",
+ "config",
+ "envoy_admin_upb",
+ "envoy_config_cluster_upb",
+ "envoy_config_cluster_upbdefs",
+ "envoy_config_core_upb",
+ "envoy_config_endpoint_upb",
+ "envoy_config_endpoint_upbdefs",
+ "envoy_config_listener_upb",
+ "envoy_config_listener_upbdefs",
+ "envoy_config_rbac_upb",
+ "envoy_config_route_upb",
+ "envoy_config_route_upbdefs",
+ "envoy_extensions_clusters_aggregate_upb",
+ "envoy_extensions_clusters_aggregate_upbdefs",
+ "envoy_extensions_filters_common_fault_upb",
+ "envoy_extensions_filters_http_fault_upb",
+ "envoy_extensions_filters_http_fault_upbdefs",
+ "envoy_extensions_filters_http_rbac_upb",
+ "envoy_extensions_filters_http_rbac_upbdefs",
+ "envoy_extensions_filters_http_router_upb",
+ "envoy_extensions_filters_http_router_upbdefs",
+ "envoy_extensions_filters_network_http_connection_manager_upb",
+ "envoy_extensions_filters_network_http_connection_manager_upbdefs",
+ "envoy_extensions_transport_sockets_tls_upb",
+ "envoy_extensions_transport_sockets_tls_upbdefs",
+ "envoy_service_discovery_upb",
+ "envoy_service_discovery_upbdefs",
+ "envoy_service_load_stats_upb",
+ "envoy_service_load_stats_upbdefs",
+ "envoy_service_status_upb",
+ "envoy_service_status_upbdefs",
+ "envoy_type_matcher_upb",
+ "envoy_type_upb",
+ "error",
+ "google_rpc_status_upb",
+ "gpr_base",
+ "gpr_codegen",
"grpc_base",
"grpc_client_channel",
+ "grpc_codegen",
+ "grpc_credentials_util",
+ "grpc_fake_credentials",
"grpc_fault_injection_filter",
+ "grpc_lb_xds_channel_args",
"grpc_matchers",
+ "grpc_rbac_filter",
"grpc_secure",
- "grpc_transport_chttp2_client_secure",
- "udpa_type_upb",
- "udpa_type_upbdefs",
+ "grpc_security_base",
+ "grpc_sockaddr",
+ "grpc_tls_credentials",
+ "grpc_transport_chttp2_client_connector",
+ "json",
+ "json_util",
+ "orphanable",
+ "protobuf_any_upb",
+ "protobuf_duration_upb",
+ "protobuf_struct_upb",
+ "protobuf_timestamp_upb",
+ "protobuf_wrappers_upb",
+ "ref_counted_ptr",
+ "rls_config_upb",
+ "rls_config_upbdefs",
+ "slice",
+ "slice_refcount",
+ "sockaddr_utils",
+ "uri_parser",
+ "xds_type_upb",
+ "xds_type_upbdefs",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_xds_channel_stack_modifier",
+ srcs = [
+ "src/core/ext/xds/xds_channel_stack_modifier.cc",
+ ],
+ hdrs = [
+ "src/core/ext/xds/xds_channel_stack_modifier.h",
+ ],
+ language = "c++",
+ deps = [
+ "channel_init",
+ "config",
+ "gpr_base",
+ "grpc_base",
],
)
@@ -1475,9 +3025,39 @@ grpc_cc_library(
srcs = [
"src/core/ext/xds/xds_server_config_fetcher.cc",
],
+ external_deps = [
+ "absl/strings",
+ ],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
+ "grpc_base",
+ "grpc_server_config_selector",
+ "grpc_server_config_selector_filter",
+ "grpc_service_config_impl",
+ "grpc_sockaddr",
+ "grpc_xds_channel_stack_modifier",
"grpc_xds_client",
+ "slice_refcount",
+ "sockaddr_utils",
+ "uri_parser",
+ ],
+)
+
+grpc_cc_library(
+ name = "channel_creds_registry_init",
+ srcs = [
+ "src/core/lib/security/credentials/channel_creds_registry_init.cc",
+ ],
+ language = "c++",
+ deps = [
+ "config",
+ "gpr_base",
+ "grpc_fake_credentials",
+ "grpc_secure",
+ "grpc_security_base",
+ "json",
],
)
@@ -1489,10 +3069,17 @@ grpc_cc_library(
hdrs = [
"src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h",
],
+ external_deps = [
+ "absl/strings",
+ ],
language = "c++",
deps = [
+ "error",
+ "gpr_base",
"grpc_base",
"grpc_xds_client",
+ "json_util",
+ "slice",
],
)
@@ -1501,11 +3088,17 @@ grpc_cc_library(
srcs = [
"src/core/ext/filters/client_channel/lb_policy/xds/cds.cc",
],
+ external_deps = [
+ "absl/strings",
+ ],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_xds_client",
+ "orphanable",
+ "ref_counted_ptr",
],
)
@@ -1524,6 +3117,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_xds_client",
@@ -1537,16 +3131,25 @@ grpc_cc_library(
],
external_deps = [
"absl/strings",
+ "absl/types:optional",
],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_address_filtering",
+ "grpc_lb_policy_ring_hash",
"grpc_lb_xds_channel_args",
"grpc_lb_xds_common",
+ "grpc_resolver",
"grpc_resolver_fake",
"grpc_xds_client",
+ "orphanable",
+ "ref_counted_ptr",
+ "server_address",
+ "uri_parser",
],
)
@@ -1560,11 +3163,14 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_xds_channel_args",
"grpc_lb_xds_common",
"grpc_xds_client",
+ "orphanable",
+ "ref_counted_ptr",
],
)
@@ -1575,12 +3181,17 @@ grpc_cc_library(
],
external_deps = [
"absl/strings",
+ "absl/status",
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_resolver_xds_header",
+ "orphanable",
+ "ref_counted",
+ "ref_counted_ptr",
],
)
@@ -1597,6 +3208,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
],
@@ -1609,6 +3221,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
],
@@ -1621,9 +3234,12 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_subchannel_list",
+ "server_address",
+ "sockaddr_utils",
],
)
@@ -1635,11 +3251,19 @@ grpc_cc_library(
hdrs = [
"src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h",
],
+ external_deps = [
+ "absl/strings",
+ "xxhash",
+ ],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_subchannel_list",
+ "grpc_trace",
+ "ref_counted_ptr",
+ "sockaddr_utils",
],
)
@@ -1650,9 +3274,14 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_subchannel_list",
+ "grpc_trace",
+ "ref_counted_ptr",
+ "server_address",
+ "sockaddr_utils",
],
)
@@ -1663,12 +3292,16 @@ grpc_cc_library(
],
external_deps = [
"absl/strings",
+ "absl/strings:str_format",
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_address_filtering",
+ "orphanable",
+ "ref_counted_ptr",
],
)
@@ -1677,11 +3310,18 @@ grpc_cc_library(
srcs = [
"src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc",
],
+ external_deps = [
+ "absl/container:inlined_vector",
+ "absl/strings",
+ ],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_address_filtering",
+ "orphanable",
+ "ref_counted_ptr",
],
)
@@ -1696,12 +3336,23 @@ grpc_cc_library(
"src/cpp/server/load_reporter/constants.h",
],
external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
"opencensus-stats",
],
language = "c++",
deps = [
+ "config",
+ "error",
+ "gpr",
"grpc++_base",
- "grpc_secure",
+ "grpc_base",
+ "grpc_lb_policy_grpclb",
+ "grpc_security_base",
+ "grpc_sockaddr",
+ "seq",
+ "slice",
+ "uri_parser",
],
alwayslink = 1,
)
@@ -1717,7 +3368,11 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr",
+ "gpr_codegen",
"grpc++",
+ "grpc_base",
+ "grpc_sockaddr",
],
)
@@ -1731,6 +3386,8 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr",
+ "grpc++",
"lb_load_reporter_service",
],
)
@@ -1746,8 +3403,11 @@ grpc_cc_library(
"include/grpcpp/ext/server_load_reporting.h",
],
deps = [
+ "gpr",
+ "gpr_codegen",
"lb_server_load_reporting_filter",
"lb_server_load_reporting_service_server_builder_plugin",
+ "slice",
],
)
@@ -1759,8 +3419,10 @@ grpc_cc_library(
hdrs = [
"src/cpp/server/load_reporter/load_reporter_async_service_impl.h",
],
+ external_deps = ["absl/memory"],
language = "c++",
deps = [
+ "gpr",
"lb_load_reporter",
],
)
@@ -1778,6 +3440,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc++",
],
)
@@ -1793,9 +3456,12 @@ grpc_cc_library(
],
external_deps = [
"opencensus-stats",
+ "opencensus-tags",
],
language = "c++",
deps = [
+ "gpr",
+ "gpr_codegen",
"lb_get_cpu_stats",
"lb_load_data_store",
"//src/proto/grpc/lb/v1:load_reporter_proto",
@@ -1803,6 +3469,26 @@ grpc_cc_library(
)
grpc_cc_library(
+ name = "polling_resolver",
+ srcs = [
+ "src/core/ext/filters/client_channel/resolver/polling_resolver.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/client_channel/resolver/polling_resolver.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_resolver",
+ "orphanable",
+ ],
+)
+
+grpc_cc_library(
name = "grpc_resolver_dns_selection",
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc",
@@ -1812,6 +3498,7 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
],
)
@@ -1821,11 +3508,21 @@ grpc_cc_library(
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc",
],
+ external_deps = [
+ "absl/strings",
+ "absl/functional:bind_front",
+ ],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "grpc_resolver",
"grpc_resolver_dns_selection",
+ "grpc_trace",
+ "polling_resolver",
+ "server_address",
],
)
@@ -1833,11 +3530,11 @@ grpc_cc_library(
name = "grpc_resolver_dns_ares",
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc",
+ "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc",
+ "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc",
],
@@ -1846,15 +3543,30 @@ grpc_cc_library(
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h",
],
external_deps = [
- "cares",
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/container:inlined_vector",
"address_sorting",
+ "cares",
],
language = "c++",
deps = [
+ "config",
+ "error",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_grpclb_balancer_addresses",
+ "grpc_resolver",
"grpc_resolver_dns_selection",
+ "grpc_service_config",
+ "grpc_service_config_impl",
+ "grpc_sockaddr",
+ "iomgr_port",
+ "json",
+ "polling_resolver",
+ "server_address",
+ "sockaddr_utils",
],
)
@@ -1863,10 +3575,39 @@ grpc_cc_library(
srcs = [
"src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc",
],
+ external_deps = [
+ "absl/strings",
+ ],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "grpc_resolver",
+ "server_address",
+ "slice",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_resolver_binder",
+ srcs = [
+ "src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "config",
+ "gpr_base",
+ "grpc_base",
+ "grpc_client_channel",
+ "grpc_resolver",
+ "iomgr_port",
+ "server_address",
+ "slice",
],
)
@@ -1875,10 +3616,19 @@ grpc_cc_library(
srcs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc"],
hdrs = ["src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"],
language = "c++",
- visibility = ["//test:__subpackages__"],
+ visibility = [
+ "//test:__subpackages__",
+ "@grpc:grpc_resolver_fake",
+ ],
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "grpc_resolver",
+ "server_address",
+ "slice",
+ "useful",
],
)
@@ -1897,12 +3647,19 @@ grpc_cc_library(
],
external_deps = [
"xxhash",
+ "re2",
+ "absl/random",
+ "absl/strings",
],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
"grpc_lb_policy_ring_hash",
+ "grpc_resolver",
+ "grpc_service_config_impl",
"grpc_xds_client",
],
)
@@ -1914,114 +3671,692 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "alts_util",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "grpc_resolver",
"grpc_xds_client",
+ "httpcli",
],
)
grpc_cc_library(
- name = "grpc_secure",
+ name = "httpcli",
+ srcs = [
+ "src/core/lib/http/format_request.cc",
+ "src/core/lib/http/httpcli.cc",
+ "src/core/lib/http/parser.cc",
+ ],
+ hdrs = [
+ "src/core/lib/http/format_request.h",
+ "src/core/lib/http/httpcli.h",
+ "src/core/lib/http/parser.h",
+ ],
+ external_deps = [
+ "absl/functional:bind_front",
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ visibility = ["@grpc:httpcli"],
+ deps = [
+ "config",
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "ref_counted_ptr",
+ "sockaddr_utils",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_authorization_base",
+ srcs = [
+ "src/core/lib/security/authorization/authorization_policy_provider_vtable.cc",
+ "src/core/lib/security/authorization/evaluate_args.cc",
+ "src/core/lib/security/authorization/grpc_server_authz_filter.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/authorization/authorization_engine.h",
+ "src/core/lib/security/authorization/authorization_policy_provider.h",
+ "src/core/lib/security/authorization/evaluate_args.h",
+ "src/core/lib/security/authorization/grpc_server_authz_filter.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_trace",
+ "slice_refcount",
+ "sockaddr_utils",
+ ],
+)
+
+grpc_cc_library(
+ name = "tsi_fake_credentials",
+ srcs = [
+ "src/core/tsi/fake_transport_security.cc",
+ ],
+ hdrs = [
+ "src/core/tsi/fake_transport_security.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ visibility = [
+ "@grpc:public",
+ ],
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "tsi_base",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_fake_credentials",
srcs = [
- "src/core/lib/http/httpcli_security_connector.cc",
- "src/core/lib/security/context/security_context.cc",
- "src/core/lib/security/credentials/alts/alts_credentials.cc",
- "src/core/lib/security/credentials/composite/composite_credentials.cc",
- "src/core/lib/security/credentials/credentials.cc",
- "src/core/lib/security/credentials/credentials_metadata.cc",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/aws_request_signer.cc",
- "src/core/lib/security/credentials/external/external_account_credentials.cc",
- "src/core/lib/security/credentials/external/file_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/url_external_account_credentials.cc",
"src/core/lib/security/credentials/fake/fake_credentials.cc",
+ "src/core/lib/security/security_connector/fake/fake_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
+ "src/core/lib/security/credentials/fake/fake_credentials.h",
+ "src/core/lib/security/security_connector/fake/fake_security_connector.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "promise",
+ "ref_counted_ptr",
+ "tsi_fake_credentials",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_insecure_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/insecure/insecure_credentials.cc",
+ "src/core/lib/security/security_connector/insecure/insecure_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/insecure/insecure_credentials.h",
+ "src/core/lib/security/security_connector/insecure/insecure_security_connector.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr",
+ "grpc_security_base",
+ "promise",
+ "ref_counted_ptr",
+ "tsi_local_credentials",
+ ],
+)
+
+grpc_cc_library(
+ name = "tsi_local_credentials",
+ srcs = [
+ "src/core/tsi/local_transport_security.cc",
+ ],
+ hdrs = [
+ "src/core/tsi/local_transport_security.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr",
+ "grpc_base",
+ "tsi_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_local_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/local/local_credentials.cc",
+ "src/core/lib/security/security_connector/local/local_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/local/local_credentials.h",
+ "src/core/lib/security/security_connector/local/local_security_connector.h",
+ ],
+ external_deps = [
+ "absl/strings:str_format",
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_client_channel",
+ "grpc_security_base",
+ "grpc_sockaddr",
+ "promise",
+ "ref_counted_ptr",
+ "sockaddr_utils",
+ "tsi_local_credentials",
+ "uri_parser",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_alts_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/alts/alts_credentials.cc",
+ "src/core/lib/security/security_connector/alts/alts_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/alts/alts_credentials.h",
+ "src/core/lib/security/security_connector/alts/alts_security_connector.h",
+ ],
+ external_deps = [
+ "libssl",
+ "upb_lib",
+ "upb_lib_descriptor",
+ ],
+ language = "c++",
+ visibility = ["@grpc:public"],
+ deps = [
+ "alts_util",
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "promise",
+ "ref_counted_ptr",
+ "tsi_alts_credentials",
+ "tsi_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_ssl_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/ssl/ssl_credentials.cc",
+ "src/core/lib/security/security_connector/ssl/ssl_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/ssl/ssl_credentials.h",
+ "src/core/lib/security/security_connector/ssl/ssl_security_connector.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_security_base",
+ "grpc_transport_chttp2_alpn",
+ "promise",
+ "ref_counted_ptr",
+ "tsi_base",
+ "tsi_ssl_credentials",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_google_default_credentials",
+ srcs = [
"src/core/lib/security/credentials/google_default/credentials_generic.cc",
"src/core/lib/security/credentials/google_default/google_default_credentials.cc",
+ ],
+ hdrs = [
+ "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
+ "src/core/lib/security/credentials/google_default/google_default_credentials.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ deps = [
+ "alts_util",
+ "gpr_base",
+ "grpc_alts_credentials",
+ "grpc_base",
+ "grpc_codegen",
+ "grpc_external_account_credentials",
+ "grpc_jwt_credentials",
+ "grpc_lb_xds_channel_args",
+ "grpc_oauth2_credentials",
+ "grpc_security_base",
+ "grpc_ssl_credentials",
+ "httpcli",
+ "httpcli_ssl_credentials",
+ "ref_counted_ptr",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_tls_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc",
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc",
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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/security_connector/tls/tls_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h",
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h",
+ "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h",
+ "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h",
+ "src/core/lib/security/credentials/tls/tls_credentials.h",
+ "src/core/lib/security/security_connector/tls/tls_security_connector.h",
+ ],
+ external_deps = [
+ "absl/functional:bind_front",
+ "absl/strings",
+ "libssl",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_security_base",
+ "promise",
+ "tsi_base",
+ "tsi_ssl_credentials",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_iam_credentials",
+ srcs = [
"src/core/lib/security/credentials/iam/iam_credentials.cc",
- "src/core/lib/security/credentials/insecure/insecure_credentials.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/iam/iam_credentials.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "promise",
+ "ref_counted_ptr",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_jwt_credentials",
+ srcs = [
"src/core/lib/security/credentials/jwt/json_token.cc",
"src/core/lib/security/credentials/jwt/jwt_credentials.cc",
"src/core/lib/security/credentials/jwt/jwt_verifier.cc",
- "src/core/lib/security/credentials/local/local_credentials.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/jwt/json_token.h",
+ "src/core/lib/security/credentials/jwt/jwt_credentials.h",
+ "src/core/lib/security/credentials/jwt/jwt_verifier.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "libcrypto",
+ "libssl",
+ ],
+ language = "c++",
+ visibility = ["@grpc:public"],
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_security_base",
+ "httpcli",
+ "httpcli_ssl_credentials",
+ "json",
+ "promise",
+ "ref_counted",
+ "ref_counted_ptr",
+ "tsi_ssl_types",
+ "uri_parser",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_oauth2_credentials",
+ srcs = [
"src/core/lib/security/credentials/oauth2/oauth2_credentials.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/oauth2/oauth2_credentials.h",
+ ],
+ external_deps = [
+ "absl/container:inlined_vector",
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/status",
+ ],
+ language = "c++",
+ deps = [
+ "capture",
+ "gpr_base",
+ "grpc_base",
+ "grpc_codegen",
+ "grpc_credentials_util",
+ "grpc_security_base",
+ "httpcli",
+ "httpcli_ssl_credentials",
+ "json",
+ "promise",
+ "ref_counted_ptr",
+ "uri_parser",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_external_account_credentials",
+ srcs = [
+ "src/core/lib/security/credentials/external/aws_external_account_credentials.cc",
+ "src/core/lib/security/credentials/external/aws_request_signer.cc",
+ "src/core/lib/security/credentials/external/external_account_credentials.cc",
+ "src/core/lib/security/credentials/external/file_external_account_credentials.cc",
+ "src/core/lib/security/credentials/external/url_external_account_credentials.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/external/aws_external_account_credentials.h",
+ "src/core/lib/security/credentials/external/aws_request_signer.h",
+ "src/core/lib/security/credentials/external/external_account_credentials.h",
+ "src/core/lib/security/credentials/external/file_external_account_credentials.h",
+ "src/core/lib/security/credentials/external/url_external_account_credentials.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/time",
+ "libcrypto",
+ "libssl",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_oauth2_credentials",
+ "grpc_security_base",
+ "httpcli",
+ "httpcli_ssl_credentials",
+ "slice_refcount",
+ ],
+)
+
+grpc_cc_library(
+ name = "httpcli_ssl_credentials",
+ srcs = [
+ "src/core/lib/http/httpcli_security_connector.cc",
+ ],
+ hdrs = [
+ "src/core/lib/http/httpcli_ssl_credentials.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ ],
+ language = "c++",
+ deps = [
+ "config",
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "promise",
+ "ref_counted_ptr",
+ "tsi_ssl_credentials",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_secure",
+ language = "c++",
+ public_hdrs = GRPC_PUBLIC_HDRS,
+ visibility = ["@grpc:public"],
+ deps = [
+ "config",
+ "gpr_base",
+ "grpc_alts_credentials",
+ "grpc_authorization_base",
+ "grpc_base",
+ "grpc_client_channel",
+ "grpc_codegen",
+ "grpc_credentials_util",
+ "grpc_external_account_credentials",
+ "grpc_fake_credentials",
+ "grpc_google_default_credentials",
+ "grpc_iam_credentials",
+ "grpc_insecure_credentials",
+ "grpc_jwt_credentials",
+ "grpc_local_credentials",
+ "grpc_oauth2_credentials",
+ "grpc_security_base",
+ "grpc_ssl_credentials",
+ "grpc_tls_credentials",
+ "grpc_trace",
+ "grpc_transport_chttp2_alpn",
+ "httpcli",
+ "httpcli_ssl_credentials",
+ "json",
+ "promise",
+ "ref_counted",
+ "ref_counted_ptr",
+ "slice",
+ "slice_refcount",
+ "sockaddr_utils",
+ "tsi_base",
+ "uri_parser",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "tsi_ssl_types",
+ hdrs = [
+ "src/core/tsi/ssl_types.h",
+ ],
+ external_deps = [
+ "libssl",
+ ],
+ language = "c++",
+)
+
+grpc_cc_library(
+ name = "grpc_security_base",
+ srcs = [
+ "src/core/lib/security/context/security_context.cc",
+ "src/core/lib/security/credentials/call_creds_util.cc",
+ "src/core/lib/security/credentials/composite/composite_credentials.cc",
+ "src/core/lib/security/credentials/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_provider.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/tls/tls_utils.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/insecure/insecure_security_connector.cc",
- "src/core/lib/security/security_connector/load_system_roots_fallback.cc",
- "src/core/lib/security/security_connector/load_system_roots_linux.cc",
- "src/core/lib/security/security_connector/local/local_security_connector.cc",
"src/core/lib/security/security_connector/security_connector.cc",
- "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/transport/client_auth_filter.cc",
"src/core/lib/security/transport/secure_endpoint.cc",
"src/core/lib/security/transport/security_handshaker.cc",
"src/core/lib/security/transport/server_auth_filter.cc",
"src/core/lib/security/transport/tsi_error.cc",
- "src/core/lib/security/util/json_util.cc",
- "src/core/lib/surface/init_secure.cc",
],
hdrs = [
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
- "src/core/ext/xds/xds_channel_args.h",
"src/core/lib/security/context/security_context.h",
- "src/core/lib/security/credentials/alts/alts_credentials.h",
+ "src/core/lib/security/credentials/call_creds_util.h",
"src/core/lib/security/credentials/composite/composite_credentials.h",
"src/core/lib/security/credentials/credentials.h",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.h",
- "src/core/lib/security/credentials/external/aws_request_signer.h",
- "src/core/lib/security/credentials/external/external_account_credentials.h",
- "src/core/lib/security/credentials/external/file_external_account_credentials.h",
- "src/core/lib/security/credentials/external/url_external_account_credentials.h",
- "src/core/lib/security/credentials/fake/fake_credentials.h",
- "src/core/lib/security/credentials/google_default/google_default_credentials.h",
- "src/core/lib/security/credentials/iam/iam_credentials.h",
- "src/core/lib/security/credentials/jwt/json_token.h",
- "src/core/lib/security/credentials/jwt/jwt_credentials.h",
- "src/core/lib/security/credentials/jwt/jwt_verifier.h",
- "src/core/lib/security/credentials/local/local_credentials.h",
- "src/core/lib/security/credentials/oauth2/oauth2_credentials.h",
"src/core/lib/security/credentials/plugin/plugin_credentials.h",
- "src/core/lib/security/credentials/ssl/ssl_credentials.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h",
- "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h",
- "src/core/lib/security/credentials/tls/tls_credentials.h",
- "src/core/lib/security/credentials/tls/tls_utils.h",
- "src/core/lib/security/security_connector/alts/alts_security_connector.h",
- "src/core/lib/security/security_connector/fake/fake_security_connector.h",
- "src/core/lib/security/security_connector/insecure/insecure_security_connector.h",
- "src/core/lib/security/security_connector/load_system_roots.h",
- "src/core/lib/security/security_connector/load_system_roots_linux.h",
- "src/core/lib/security/security_connector/local/local_security_connector.h",
"src/core/lib/security/security_connector/security_connector.h",
- "src/core/lib/security/security_connector/ssl/ssl_security_connector.h",
- "src/core/lib/security/security_connector/ssl_utils.h",
- "src/core/lib/security/security_connector/ssl_utils_config.h",
- "src/core/lib/security/security_connector/tls/tls_security_connector.h",
"src/core/lib/security/transport/auth_filters.h",
"src/core/lib/security/transport/secure_endpoint.h",
"src/core/lib/security/transport/security_handshaker.h",
"src/core/lib/security/transport/tsi_error.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ "absl/time",
+ ],
+ language = "c++",
+ public_hdrs = GRPC_PUBLIC_HDRS,
+ visibility = ["@grpc:public"],
+ deps = [
+ "arena",
+ "arena_promise",
+ "capture",
+ "config",
+ "gpr_base",
+ "grpc_base",
+ "grpc_trace",
+ "json",
+ "memory_quota",
+ "promise",
+ "ref_counted",
+ "ref_counted_ptr",
+ "resource_quota",
+ "resource_quota_trace",
+ "try_seq",
+ "tsi_base",
+ ],
+)
+
+grpc_cc_library(
+ name = "grpc_credentials_util",
+ srcs = [
+ "src/core/lib/security/credentials/tls/tls_utils.cc",
+ "src/core/lib/security/security_connector/load_system_roots_fallback.cc",
+ "src/core/lib/security/security_connector/load_system_roots_linux.cc",
+ "src/core/lib/security/util/json_util.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/credentials/tls/tls_utils.h",
+ "src/core/lib/security/security_connector/load_system_roots.h",
+ "src/core/lib/security/security_connector/load_system_roots_linux.h",
"src/core/lib/security/util/json_util.h",
],
+ external_deps = [
+ "absl/container:inlined_vector",
+ "absl/strings",
+ ],
+ language = "c++",
+ visibility = ["@grpc:public"],
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_security_base",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "tsi_alts_credentials",
+ srcs = [
+ "src/core/tsi/alts/crypt/aes_gcm.cc",
+ "src/core/tsi/alts/crypt/gsec.cc",
+ "src/core/tsi/alts/frame_protector/alts_counter.cc",
+ "src/core/tsi/alts/frame_protector/alts_crypter.cc",
+ "src/core/tsi/alts/frame_protector/alts_frame_protector.cc",
+ "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc",
+ "src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc",
+ "src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc",
+ "src/core/tsi/alts/frame_protector/frame_handler.cc",
+ "src/core/tsi/alts/handshaker/alts_handshaker_client.cc",
+ "src/core/tsi/alts/handshaker/alts_shared_resource.cc",
+ "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc",
+ "src/core/tsi/alts/handshaker/alts_tsi_utils.cc",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc",
+ ],
+ hdrs = [
+ "src/core/tsi/alts/crypt/gsec.h",
+ "src/core/tsi/alts/frame_protector/alts_counter.h",
+ "src/core/tsi/alts/frame_protector/alts_crypter.h",
+ "src/core/tsi/alts/frame_protector/alts_frame_protector.h",
+ "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h",
+ "src/core/tsi/alts/frame_protector/frame_handler.h",
+ "src/core/tsi/alts/handshaker/alts_handshaker_client.h",
+ "src/core/tsi/alts/handshaker/alts_shared_resource.h",
+ "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h",
+ "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h",
+ "src/core/tsi/alts/handshaker/alts_tsi_utils.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h",
+ "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h",
+ ],
+ external_deps = [
+ "libssl",
+ "libcrypto",
+ "upb_lib",
+ ],
language = "c++",
- public_hdrs = GRPC_SECURE_PUBLIC_HDRS,
+ visibility = ["@grpc:public"],
deps = [
"alts_util",
+ "arena",
+ "config",
+ "error",
+ "gpr_base",
"grpc_base",
- "grpc_lb_xds_channel_args",
+ "tsi_base",
+ "useful",
+ ],
+)
+
+grpc_cc_library(
+ name = "tsi_ssl_credentials",
+ srcs = [
+ "src/core/lib/security/security_connector/ssl_utils.cc",
+ "src/core/lib/security/security_connector/ssl_utils_config.cc",
+ "src/core/tsi/ssl/key_logging/ssl_key_logging.cc",
+ "src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc",
+ "src/core/tsi/ssl/session_cache/ssl_session_cache.cc",
+ "src/core/tsi/ssl/session_cache/ssl_session_openssl.cc",
+ "src/core/tsi/ssl_transport_security.cc",
+ ],
+ hdrs = [
+ "src/core/lib/security/security_connector/ssl_utils.h",
+ "src/core/lib/security/security_connector/ssl_utils_config.h",
+ "src/core/tsi/ssl/key_logging/ssl_key_logging.h",
+ "src/core/tsi/ssl/session_cache/ssl_session.h",
+ "src/core/tsi/ssl/session_cache/ssl_session_cache.h",
+ "src/core/tsi/ssl_transport_security.h",
+ ],
+ external_deps = [
+ "absl/strings",
+ "libssl",
+ "libcrypto",
+ ],
+ language = "c++",
+ visibility = ["@grpc:public"],
+ deps = [
+ "gpr_base",
+ "grpc_base",
+ "grpc_credentials_util",
+ "grpc_security_base",
"grpc_transport_chttp2_alpn",
- "tsi",
+ "ref_counted_ptr",
+ "tsi_base",
+ "tsi_ssl_types",
+ "useful",
],
)
@@ -2037,7 +4372,6 @@ grpc_cc_library(
],
language = "c++",
deps = [
- "google_api_upb",
"grpc_base",
],
)
@@ -2053,9 +4387,13 @@ grpc_cc_library(
],
external_deps = [
"re2",
+ "absl/memory",
+ "absl/strings",
+ "absl/strings:str_format",
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
],
)
@@ -2064,23 +4402,26 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_rbac_engine",
srcs = [
- "src/core/lib/security/authorization/evaluate_args.cc",
"src/core/lib/security/authorization/grpc_authorization_engine.cc",
"src/core/lib/security/authorization/matchers.cc",
"src/core/lib/security/authorization/rbac_policy.cc",
],
hdrs = [
- "src/core/lib/security/authorization/authorization_engine.h",
- "src/core/lib/security/authorization/evaluate_args.h",
"src/core/lib/security/authorization/grpc_authorization_engine.h",
"src/core/lib/security/authorization/matchers.h",
"src/core/lib/security/authorization/rbac_policy.h",
],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
language = "c++",
deps = [
+ "gpr_base",
+ "grpc_authorization_base",
"grpc_base",
"grpc_matchers",
- "grpc_secure",
+ "sockaddr_utils",
],
)
@@ -2088,15 +4429,44 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_authorization_provider",
srcs = [
+ "src/core/lib/security/authorization/grpc_authorization_policy_provider.cc",
"src/core/lib/security/authorization/rbac_translator.cc",
],
hdrs = [
+ "src/core/lib/security/authorization/grpc_authorization_policy_provider.h",
"src/core/lib/security/authorization/rbac_translator.h",
],
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
language = "c++",
+ public_hdrs = GRPC_PUBLIC_HDRS,
deps = [
+ "gpr_base",
+ "grpc_base",
"grpc_matchers",
"grpc_rbac_engine",
+ "useful",
+ ],
+)
+
+# This target pulls in a dependency on RE2 and should not be linked into grpc by default for binary-size reasons.
+grpc_cc_library(
+ name = "grpc++_authorization_provider",
+ srcs = [
+ "src/cpp/server/authorization_policy_provider.cc",
+ ],
+ external_deps = [
+ "absl/synchronization",
+ "protobuf_headers",
+ ],
+ language = "c++",
+ public_hdrs = GRPCXX_PUBLIC_HDRS,
+ deps = [
+ "gpr_base",
+ "grpc++_codegen_base",
+ "grpc_authorization_provider",
],
)
@@ -2111,14 +4481,45 @@ grpc_cc_library(
],
external_deps = [
"absl/container:flat_hash_set",
+ "absl/memory",
],
language = "c++",
deps = [
- "envoy_ads_upb",
- "google_api_upb",
+ "envoy_config_rbac_upb",
+ "gpr_base",
"grpc_base",
"grpc_mock_cel",
"grpc_rbac_engine",
+ "sockaddr_utils",
+ ],
+)
+
+grpc_cc_library(
+ name = "hpack_constants",
+ hdrs = [
+ "src/core/ext/transport/chttp2/transport/hpack_constants.h",
+ ],
+ language = "c++",
+ deps = [
+ "gpr_platform",
+ ],
+)
+
+grpc_cc_library(
+ name = "hpack_encoder_table",
+ srcs = [
+ "src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc",
+ ],
+ hdrs = [
+ "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h",
+ ],
+ external_deps = [
+ "absl/container:inlined_vector",
+ ],
+ language = "c++",
+ deps = [
+ "gpr",
+ "hpack_constants",
],
)
@@ -2127,7 +4528,6 @@ grpc_cc_library(
srcs = [
"src/core/ext/transport/chttp2/transport/bin_decoder.cc",
"src/core/ext/transport/chttp2/transport/bin_encoder.cc",
- "src/core/ext/transport/chttp2/transport/chttp2_plugin.cc",
"src/core/ext/transport/chttp2/transport/chttp2_transport.cc",
"src/core/ext/transport/chttp2/transport/context_list.cc",
"src/core/ext/transport/chttp2/transport/flow_control.cc",
@@ -2139,10 +4539,9 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_window_update.cc",
"src/core/ext/transport/chttp2/transport/hpack_encoder.cc",
"src/core/ext/transport/chttp2/transport/hpack_parser.cc",
- "src/core/ext/transport/chttp2/transport/hpack_table.cc",
+ "src/core/ext/transport/chttp2/transport/hpack_parser_table.cc",
"src/core/ext/transport/chttp2/transport/http2_settings.cc",
"src/core/ext/transport/chttp2/transport/huffsyms.cc",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.cc",
"src/core/ext/transport/chttp2/transport/parsing.cc",
"src/core/ext/transport/chttp2/transport/stream_lists.cc",
"src/core/ext/transport/chttp2/transport/stream_map.cc",
@@ -2164,20 +4563,37 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_window_update.h",
"src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h",
- "src/core/ext/transport/chttp2/transport/hpack_table.h",
+ "src/core/ext/transport/chttp2/transport/hpack_parser_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/huffsyms.h",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.h",
"src/core/ext/transport/chttp2/transport/internal.h",
"src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/varint.h",
],
+ external_deps = [
+ "absl/base:core_headers",
+ "absl/memory",
+ "absl/status",
+ "absl/strings",
+ "absl/strings:str_format",
+ ],
language = "c++",
+ visibility = ["@grpc:grpclb"],
deps = [
"gpr_base",
"grpc_base",
"grpc_http_filters",
+ "grpc_trace",
"grpc_transport_chttp2_alpn",
+ "hpack_constants",
+ "hpack_encoder_table",
+ "httpcli",
+ "memory_quota",
+ "resource_quota_trace",
+ "slice",
+ "slice_refcount",
+ "uri_parser",
+ "useful",
],
)
@@ -2191,55 +4607,32 @@ grpc_cc_library(
],
language = "c++",
deps = [
- "gpr",
+ "gpr_base",
+ "useful",
],
)
grpc_cc_library(
name = "grpc_transport_chttp2_client_connector",
srcs = [
- "src/core/ext/transport/chttp2/client/authority.cc",
"src/core/ext/transport/chttp2/client/chttp2_connector.cc",
],
hdrs = [
- "src/core/ext/transport/chttp2/client/authority.h",
"src/core/ext/transport/chttp2/client/chttp2_connector.h",
],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
"grpc_client_channel",
+ "grpc_insecure_credentials",
+ "grpc_resolver",
+ "grpc_security_base",
"grpc_transport_chttp2",
- ],
-)
-
-grpc_cc_library(
- name = "grpc_transport_chttp2_client_insecure",
- srcs = [
- "src/core/ext/transport/chttp2/client/insecure/channel_create.cc",
- "src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc",
- ],
- language = "c++",
- deps = [
- "grpc_base",
- "grpc_client_channel",
- "grpc_transport_chttp2",
- "grpc_transport_chttp2_client_connector",
- ],
-)
-
-grpc_cc_library(
- name = "grpc_transport_chttp2_client_secure",
- srcs = [
- "src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc",
- ],
- language = "c++",
- deps = [
- "grpc_base",
- "grpc_client_channel",
- "grpc_secure",
- "grpc_transport_chttp2",
- "grpc_transport_chttp2_client_connector",
+ "slice",
+ "sockaddr_utils",
+ "uri_parser",
],
)
@@ -2251,38 +4644,26 @@ grpc_cc_library(
hdrs = [
"src/core/ext/transport/chttp2/server/chttp2_server.h",
],
- language = "c++",
- deps = [
- "grpc_base",
- "grpc_transport_chttp2",
- ],
-)
-
-grpc_cc_library(
- name = "grpc_transport_chttp2_server_insecure",
- srcs = [
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc",
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc",
- ],
- language = "c++",
- deps = [
- "grpc_base",
- "grpc_transport_chttp2",
- "grpc_transport_chttp2_server",
- ],
-)
-
-grpc_cc_library(
- name = "grpc_transport_chttp2_server_secure",
- srcs = [
- "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc",
+ external_deps = [
+ "absl/strings",
+ "absl/strings:str_format",
],
language = "c++",
deps = [
+ "config",
+ "gpr_base",
"grpc_base",
- "grpc_secure",
+ "grpc_codegen",
+ "grpc_http_filters",
+ "grpc_insecure_credentials",
+ "grpc_security_base",
"grpc_transport_chttp2",
- "grpc_transport_chttp2_server",
+ "memory_quota",
+ "ref_counted",
+ "ref_counted_ptr",
+ "slice",
+ "sockaddr_utils",
+ "uri_parser",
],
)
@@ -2297,20 +4678,26 @@ grpc_cc_library(
],
language = "c++",
deps = [
+ "gpr_base",
"grpc_base",
+ "grpc_trace",
+ "slice",
],
)
grpc_cc_library(
- name = "tsi_interface",
+ name = "tsi_base",
srcs = [
"src/core/tsi/transport_security.cc",
+ "src/core/tsi/transport_security_grpc.cc",
],
hdrs = [
"src/core/tsi/transport_security.h",
+ "src/core/tsi/transport_security_grpc.h",
"src/core/tsi/transport_security_interface.h",
],
language = "c++",
+ visibility = ["@grpc:tsi_interface"],
deps = [
"gpr",
"grpc_trace",
@@ -2318,50 +4705,6 @@ grpc_cc_library(
)
grpc_cc_library(
- name = "alts_frame_protector",
- srcs = [
- "src/core/tsi/alts/crypt/aes_gcm.cc",
- "src/core/tsi/alts/crypt/gsec.cc",
- "src/core/tsi/alts/frame_protector/alts_counter.cc",
- "src/core/tsi/alts/frame_protector/alts_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.cc",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc",
- "src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/frame_handler.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc",
- ],
- hdrs = [
- "src/core/tsi/alts/crypt/gsec.h",
- "src/core/tsi/alts/frame_protector/alts_counter.h",
- "src/core/tsi/alts/frame_protector/alts_crypter.h",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.h",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h",
- "src/core/tsi/alts/frame_protector/frame_handler.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h",
- "src/core/tsi/transport_security_grpc.h",
- ],
- external_deps = [
- "libssl",
- ],
- language = "c++",
- deps = [
- "gpr",
- "grpc_base",
- "tsi_interface",
- ],
-)
-
-grpc_cc_library(
name = "alts_util",
srcs = [
"src/core/lib/security/credentials/alts/check_gcp_environment.cc",
@@ -2378,8 +4721,11 @@ grpc_cc_library(
"src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h",
"src/core/tsi/alts/handshaker/transport_security_common_api.h",
],
+ external_deps = [
+ "upb_lib",
+ ],
language = "c++",
- public_hdrs = GRPC_SECURE_PUBLIC_HDRS,
+ visibility = ["@grpc:tsi"],
deps = [
"alts_upb",
"gpr",
@@ -2389,44 +4735,23 @@ grpc_cc_library(
grpc_cc_library(
name = "tsi",
- srcs = [
- "src/core/tsi/alts/handshaker/alts_handshaker_client.cc",
- "src/core/tsi/alts/handshaker/alts_shared_resource.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.cc",
- "src/core/tsi/fake_transport_security.cc",
- "src/core/tsi/local_transport_security.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_openssl.cc",
- "src/core/tsi/ssl_transport_security.cc",
- "src/core/tsi/transport_security_grpc.cc",
- ],
- hdrs = [
- "src/core/tsi/alts/handshaker/alts_handshaker_client.h",
- "src/core/tsi/alts/handshaker/alts_shared_resource.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.h",
- "src/core/tsi/fake_transport_security.h",
- "src/core/tsi/local_transport_security.h",
- "src/core/tsi/ssl/session_cache/ssl_session.h",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.h",
- "src/core/tsi/ssl_transport_security.h",
- "src/core/tsi/ssl_types.h",
- "src/core/tsi/transport_security_grpc.h",
- ],
external_deps = [
"libssl",
+ "libcrypto",
+ "absl/strings",
+ "upb_lib",
],
language = "c++",
+ visibility = ["@grpc:tsi"],
deps = [
- "alts_frame_protector",
- "alts_util",
"gpr",
"grpc_base",
- "grpc_transport_chttp2_client_insecure",
- "tsi_interface",
+ "tsi_alts_credentials",
+ "tsi_base",
+ "tsi_fake_credentials",
+ "tsi_local_credentials",
+ "tsi_ssl_credentials",
+ "useful",
],
)
@@ -2436,15 +4761,29 @@ grpc_cc_library(
hdrs = GRPCXX_HDRS,
external_deps = [
"absl/synchronization",
+ "absl/memory",
+ "upb_lib",
"protobuf_headers",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
+ visibility = ["@grpc:alt_grpc++_base_legacy"],
deps = [
+ "config",
+ "gpr_base",
"grpc",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
+ "grpc++_internal_hdrs_only",
+ "grpc_base",
+ "grpc_codegen",
"grpc_health_upb",
+ "grpc_service_config",
+ "grpc_service_config_impl",
+ "grpc_trace",
+ "grpc_transport_inproc",
+ "ref_counted",
+ "useful",
],
)
@@ -2454,15 +4793,31 @@ grpc_cc_library(
hdrs = GRPCXX_HDRS,
external_deps = [
"absl/synchronization",
+ "absl/memory",
+ "upb_lib",
"protobuf_headers",
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
+ tags = ["avoid_dep"],
+ visibility = ["@grpc:alt_grpc++_base_unsecure_legacy"],
deps = [
+ "config",
+ "gpr_base",
"grpc++_codegen_base",
"grpc++_codegen_base_src",
+ "grpc++_internal_hdrs_only",
+ "grpc_base",
+ "grpc_codegen",
"grpc_health_upb",
+ "grpc_insecure_credentials",
+ "grpc_service_config",
+ "grpc_service_config_impl",
+ "grpc_trace",
+ "grpc_transport_inproc",
"grpc_unsecure",
+ "ref_counted",
+ "useful",
],
)
@@ -2546,6 +4901,7 @@ grpc_cc_library(
"include/grpcpp/impl/codegen/sync_stream.h",
"include/grpcpp/impl/codegen/time.h",
],
+ visibility = ["@grpc:public"],
deps = [
"grpc++_internal_hdrs_only",
"grpc_codegen",
@@ -2575,6 +4931,7 @@ grpc_cc_library(
"include/grpcpp/impl/codegen/proto_buffer_writer.h",
"include/grpcpp/impl/codegen/proto_utils.h",
],
+ visibility = ["@grpc:public"],
deps = [
"grpc++_codegen_base",
"grpc++_config_proto",
@@ -2591,6 +4948,7 @@ grpc_cc_library(
"include/grpc++/impl/codegen/config_protobuf.h",
"include/grpcpp/impl/codegen/config_protobuf.h",
],
+ visibility = ["@grpc:public"],
)
grpc_cc_library(
@@ -2607,14 +4965,40 @@ grpc_cc_library(
"include/grpc++/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin.h",
],
+ visibility = ["@grpc:public"],
deps = [
- ":grpc++",
+ "grpc++",
"//src/proto/grpc/reflection/v1alpha:reflection_proto",
],
alwayslink = 1,
)
grpc_cc_library(
+ name = "grpcpp_orca",
+ srcs = [
+ "src/cpp/server/orca/orca_service.cc",
+ ],
+ external_deps = [
+ "upb_lib",
+ ],
+ language = "c++",
+ public_hdrs = [
+ "include/grpcpp/ext/orca_service.h",
+ ],
+ visibility = ["@grpc:public"],
+ deps = [
+ "grpc++",
+ "grpc++_codegen_base",
+ "grpc_base",
+ "protobuf_duration_upb",
+ "time",
+ "xds_orca_service_upb",
+ "xds_orca_upb",
+ ],
+ alwayslink = 1,
+)
+
+grpc_cc_library(
name = "grpcpp_channelz",
srcs = [
"src/cpp/server/channelz/channelz_service.cc",
@@ -2627,8 +5011,11 @@ grpc_cc_library(
public_hdrs = [
"include/grpcpp/ext/channelz_service_plugin.h",
],
+ visibility = ["@grpc:channelz"],
deps = [
- ":grpc++",
+ "gpr",
+ "grpc",
+ "grpc++",
"//src/proto/grpc/channelz:channelz_proto",
],
alwayslink = 1,
@@ -2642,9 +5029,13 @@ grpc_cc_library(
hdrs = [
"src/cpp/server/csds/csds.h",
],
+ external_deps = ["absl/status:statusor"],
language = "c++",
deps = [
- ":grpc++_internals",
+ "gpr",
+ "grpc",
+ "grpc++_codegen_base",
+ "grpc++_internals",
"//src/proto/grpc/testing/xds/v3:csds_proto",
],
alwayslink = 1,
@@ -2667,19 +5058,21 @@ grpc_cc_library(
public_hdrs = [
"include/grpcpp/ext/admin_services.h",
],
- select_deps = {
+ select_deps = [{
"grpc_no_xds": [],
"//conditions:default": ["//:grpcpp_csds"],
- },
+ }],
deps = [
- ":grpc++",
- ":grpcpp_channelz",
+ "gpr",
+ "grpc++",
+ "grpcpp_channelz",
],
alwayslink = 1,
)
grpc_cc_library(
name = "grpc++_test",
+ testonly = True,
srcs = [
"src/cpp/client/channel_test_peer.cc",
],
@@ -2690,25 +5083,15 @@ grpc_cc_library(
"include/grpc++/test/mock_stream.h",
"include/grpc++/test/server_context_test_spouse.h",
"include/grpcpp/test/channel_test_peer.h",
+ "include/grpcpp/test/client_context_test_peer.h",
"include/grpcpp/test/default_reactor_test_peer.h",
"include/grpcpp/test/mock_stream.h",
"include/grpcpp/test/server_context_test_spouse.h",
],
+ visibility = ["@grpc:grpc++_test"],
deps = [
- ":grpc++",
- ],
-)
-
-grpc_cc_library(
- name = "grpc_server_backward_compatibility",
- srcs = [
- "src/core/ext/filters/workarounds/workaround_utils.cc",
- ],
- hdrs = [
- "src/core/ext/filters/workarounds/workaround_utils.h",
- ],
- language = "c++",
- deps = [
+ "gpr_base",
+ "grpc++",
"grpc_base",
],
)
@@ -2723,7 +5106,8 @@ grpc_cc_library(
],
language = "c++",
deps = [
- ":grpc++",
+ "gpr",
+ "grpc++",
"//src/proto/grpc/core:stats_proto",
],
)
@@ -2747,876 +5131,306 @@ grpc_cc_library(
"src/cpp/ext/filters/census/context.h",
"src/cpp/ext/filters/census/grpc_plugin.h",
"src/cpp/ext/filters/census/measures.h",
+ "src/cpp/ext/filters/census/open_census_call_tracer.h",
"src/cpp/ext/filters/census/rpc_encoding.h",
"src/cpp/ext/filters/census/server_filter.h",
],
external_deps = [
"absl-base",
"absl-time",
+ "absl/strings",
"opencensus-trace",
"opencensus-trace-context_util",
"opencensus-trace-propagation",
+ "opencensus-tags",
+ "opencensus-tags-context_util",
"opencensus-stats",
"opencensus-context",
],
language = "c++",
+ visibility = ["@grpc:grpc_opencensus_plugin"],
deps = [
- ":census",
- ":grpc++",
- ],
-)
-
-# Once upb code-gen issue is resolved, use the targets commented below to replace the ones using
-# upb-generated files.
-
-# grpc_upb_proto_library(
-# name = "upb_load_report",
-# deps = ["@envoy_api//envoy/api/v2/endpoint:load_report_export"],
-# )
-#
-# grpc_upb_proto_library(
-# name = "upb_lrs",
-# deps = ["@envoy_api//envoy/service/load_stats/v2:lrs_export"],
-# )
-#
-# grpc_upb_proto_library(
-# name = "upb_cds",
-# deps = ["@envoy_api//envoy/api/v2:cds_export"],
-# )
-
-# grpc_cc_library(
-# name = "envoy_lrs_upb",
-# external_deps = [
-# "upb_lib",
-# ],
-# language = "c++",
-# tags = ["no_windows"],
-# deps = [
-# ":upb_load_report",
-# ":upb_lrs",
-# ],
-# )
-
-# grpc_cc_library(
-# name = "envoy_ads_upb",
-# external_deps = [
-# "upb_lib",
-# ],
-# language = "c++",
-# tags = ["no_windows"],
-# deps = [
-# ":upb_cds",
-# ],
-# )
-
-grpc_cc_library(
- name = "envoy_ads_upb",
- srcs = [
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.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/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/metrics/v3/stats.upb.c",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.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/clusters/aggregate/v3/cluster.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.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/service/status/v3/csds.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h",
- "src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
- "src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h",
- "src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h",
- "src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h",
- "src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h",
- "src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h",
- "src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":envoy_annotations_upb",
- ":envoy_core_upb",
- ":envoy_type_upb",
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ":udpa_annotations_upb",
- ":xds_core_upb",
- ],
-)
-
-grpc_cc_library(
- name = "envoy_ads_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":envoy_ads_upb",
- ":envoy_annotations_upbdefs",
- ":envoy_core_upbdefs",
- ":envoy_type_upbdefs",
- ":google_api_upbdefs",
- ":proto_gen_validate_upbdefs",
- ":udpa_annotations_upbdefs",
- ":xds_core_upbdefs",
+ "census",
+ "gpr_base",
+ "grpc++",
+ "grpc_base",
],
)
grpc_cc_library(
- name = "envoy_annotations_upb",
+ name = "json",
srcs = [
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.c",
+ "src/core/lib/json/json_reader.cc",
+ "src/core/lib/json/json_writer.cc",
],
hdrs = [
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.h",
+ "src/core/lib/json/json.h",
],
external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
+ "absl/strings",
+ "absl/strings:str_format",
],
- language = "c++",
deps = [
- ":google_api_upb",
+ "error",
+ "exec_ctx",
+ "gpr_base",
],
)
grpc_cc_library(
- name = "envoy_annotations_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h",
- ],
+ name = "json_util",
+ srcs = ["src/core/lib/json/json_util.cc"],
+ hdrs = ["src/core/lib/json/json_util.h"],
external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
+ "absl/strings",
],
- language = "c++",
deps = [
- ":envoy_annotations_upb",
- ":google_api_upbdefs",
+ "gpr_base",
+ "json",
],
)
-grpc_cc_library(
- name = "envoy_core_upb",
- srcs = [
- "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",
- ],
- hdrs = [
- "src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":envoy_annotations_upb",
- ":envoy_type_upb",
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ":udpa_annotations_upb",
- ":xds_core_upb",
- ],
+### UPB Targets
+
+grpc_upb_proto_library(
+ name = "envoy_admin_upb",
+ deps = ["@envoy_api//envoy/admin/v3:pkg"],
)
-grpc_cc_library(
- name = "envoy_core_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":envoy_core_upb",
- ":envoy_type_upbdefs",
- ":google_api_upbdefs",
- ":proto_gen_validate_upbdefs",
- ],
+grpc_upb_proto_library(
+ name = "envoy_config_cluster_upb",
+ deps = ["@envoy_api//envoy/config/cluster/v3:pkg"],
)
-grpc_cc_library(
- name = "envoy_type_upb",
- srcs = [
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.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/struct.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",
- ],
- hdrs = [
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h",
- "src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/http.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/percent.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/range.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":envoy_annotations_upb",
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ":udpa_annotations_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_config_cluster_upbdefs",
+ deps = ["@envoy_api//envoy/config/cluster/v3:pkg"],
)
-grpc_cc_library(
- name = "envoy_type_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":envoy_type_upb",
- ":google_api_upbdefs",
- ":proto_gen_validate_upbdefs",
- ],
+grpc_upb_proto_library(
+ name = "envoy_config_core_upb",
+ deps = ["@envoy_api//envoy/config/core/v3:pkg"],
)
-grpc_cc_library(
- name = "proto_gen_validate_upb",
- srcs = [
- "src/core/ext/upb-generated/validate/validate.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/validate/validate.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":google_api_upb",
- ],
+grpc_upb_proto_library(
+ name = "envoy_config_endpoint_upb",
+ deps = ["@envoy_api//envoy/config/endpoint/v3:pkg"],
)
-grpc_cc_library(
- name = "proto_gen_validate_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":google_api_upbdefs",
- ":proto_gen_validate_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_config_endpoint_upbdefs",
+ deps = ["@envoy_api//envoy/config/endpoint/v3:pkg"],
)
-# Once upb code-gen issue is resolved, replace udpa_orca_upb with this.
-# grpc_upb_proto_library(
-# name = "udpa_orca_upb",
-# deps = ["@envoy_api//udpa/data/orca/v1:orca_load_report"]
-# )
+grpc_upb_proto_library(
+ name = "envoy_config_listener_upb",
+ deps = ["@envoy_api//envoy/config/listener/v3:pkg"],
+)
-grpc_cc_library(
- name = "udpa_orca_upb",
- srcs = [
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":proto_gen_validate_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_config_listener_upbdefs",
+ deps = ["@envoy_api//envoy/config/listener/v3:pkg"],
)
-grpc_cc_library(
- name = "udpa_annotations_upb",
- srcs = [
- "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",
- ],
- hdrs = [
- "src/core/ext/upb-generated/udpa/annotations/migrate.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/security.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/status.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/versioning.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ],
+grpc_upb_proto_library(
+ name = "envoy_config_rbac_upb",
+ deps = ["@envoy_api//envoy/config/rbac/v3:pkg"],
)
-grpc_cc_library(
- name = "udpa_annotations_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":google_api_upbdefs",
- ":udpa_annotations_upb",
- ],
+grpc_upb_proto_library(
+ name = "envoy_config_route_upb",
+ deps = ["@envoy_api//envoy/config/route/v3:pkg"],
)
-grpc_cc_library(
- name = "xds_core_upb",
- srcs = [
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ":udpa_annotations_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_config_route_upbdefs",
+ deps = ["@envoy_api//envoy/config/route/v3:pkg"],
)
-grpc_cc_library(
- name = "xds_core_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":google_api_upbdefs",
- ":proto_gen_validate_upbdefs",
- ":udpa_annotations_upbdefs",
- ":xds_core_upb",
- ],
+grpc_upb_proto_library(
+ name = "envoy_extensions_clusters_aggregate_upb",
+ deps = ["@envoy_api//envoy/extensions/clusters/aggregate/v3:pkg"],
)
-grpc_cc_library(
- name = "udpa_type_upb",
- srcs = [
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- ":google_api_upb",
- ":proto_gen_validate_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_clusters_aggregate_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/clusters/aggregate/v3:pkg"],
)
-grpc_cc_library(
- name = "udpa_type_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":google_api_upbdefs",
- ":proto_gen_validate_upbdefs",
- ],
+grpc_upb_proto_library(
+ name = "envoy_extensions_filters_common_fault_upb",
+ deps = ["@envoy_api//envoy/extensions/filters/common/fault/v3:pkg"],
)
-# Once upb code-gen issue is resolved, replace grpc_health_upb with this.
-# grpc_upb_proto_library(
-# name = "grpc_health_upb",
-# deps = ["//src/proto/grpc/health/v1:health_proto_descriptor"],
-# )
+grpc_upb_proto_library(
+ name = "envoy_extensions_filters_http_fault_upb",
+ deps = ["@envoy_api//envoy/extensions/filters/http/fault/v3:pkg"],
+)
-grpc_cc_library(
- name = "grpc_health_upb",
- srcs = [
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_filters_http_fault_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/filters/http/fault/v3:pkg"],
)
-# Once upb code-gen issue is resolved, remove this.
-grpc_cc_library(
- name = "google_api_upb",
- srcs = [
- "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/http.upb.c",
- "src/core/ext/upb-generated/google/protobuf/any.upb.c",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.c",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.c",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.c",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c",
- "src/core/ext/upb-generated/google/rpc/status.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/google/api/annotations.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h",
- "src/core/ext/upb-generated/google/api/http.upb.h",
- "src/core/ext/upb-generated/google/protobuf/any.upb.h",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.h",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.h",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.h",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h",
- "src/core/ext/upb-generated/google/rpc/status.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
+grpc_upb_proto_library(
+ name = "envoy_extensions_filters_http_rbac_upb",
+ deps = ["@envoy_api//envoy/extensions/filters/http/rbac/v3:pkg"],
)
-grpc_cc_library(
- name = "google_api_upbdefs",
- srcs = [
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c",
- ],
- hdrs = [
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor_reflection",
- "upb_textformat_lib",
- ],
- language = "c++",
- deps = [
- ":google_api_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_filters_http_rbac_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/filters/http/rbac/v3:pkg"],
)
-# Once upb code-gen issue is resolved, replace grpc_lb_upb with this.
-# grpc_upb_proto_library(
-# name = "grpc_lb_upb",
-# deps = ["//src/proto/grpc/lb/v1:load_balancer_proto_descriptor"],
-# )
+grpc_upb_proto_library(
+ name = "envoy_extensions_filters_http_router_upb",
+ deps = ["@envoy_api//envoy/extensions/filters/http/router/v3:pkg"],
+)
-grpc_cc_library(
- name = "grpc_lb_upb",
- srcs = [
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
- deps = [
- "google_api_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_filters_http_router_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/filters/http/router/v3:pkg"],
)
-# Once upb code-gen issue is resolved, replace meshca_upb with this.
-# meshca_upb_proto_library(
-# name = "meshca_upb",
-# deps = ["//third_party/istio/security/proto/providers/google:meshca_proto"],
-# )
+grpc_upb_proto_library(
+ name = "envoy_extensions_filters_network_http_connection_manager_upb",
+ deps = ["@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg"],
+)
-grpc_cc_library(
- name = "meshca_upb",
- srcs = [
- "src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.h",
- ],
- language = "c++",
- deps = [
- "google_api_upb",
- ],
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_filters_network_http_connection_manager_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg"],
)
-# Once upb code-gen issue is resolved, replace alts_upb with this.
-# grpc_upb_proto_library(
-# name = "alts_upb",
-# deps = ["//src/proto/grpc/gcp:alts_handshaker_proto"],
-# )
+grpc_upb_proto_library(
+ name = "envoy_extensions_transport_sockets_tls_upb",
+ deps = ["@envoy_api//envoy/extensions/transport_sockets/tls/v3:pkg"],
+)
-grpc_cc_library(
+grpc_upb_proto_reflection_library(
+ name = "envoy_extensions_transport_sockets_tls_upbdefs",
+ deps = ["@envoy_api//envoy/extensions/transport_sockets/tls/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "envoy_service_discovery_upb",
+ deps = ["@envoy_api//envoy/service/discovery/v3:pkg"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "envoy_service_discovery_upbdefs",
+ deps = ["@envoy_api//envoy/service/discovery/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "envoy_service_load_stats_upb",
+ deps = ["@envoy_api//envoy/service/load_stats/v3:pkg"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "envoy_service_load_stats_upbdefs",
+ deps = ["@envoy_api//envoy/service/load_stats/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "envoy_service_status_upb",
+ deps = ["@envoy_api//envoy/service/status/v3:pkg"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "envoy_service_status_upbdefs",
+ deps = ["@envoy_api//envoy/service/status/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "envoy_type_matcher_upb",
+ deps = ["@envoy_api//envoy/type/matcher/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "envoy_type_upb",
+ deps = ["@envoy_api//envoy/type/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "xds_type_upb",
+ deps = ["@com_github_cncf_udpa//xds/type/v3:pkg"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "xds_type_upbdefs",
+ deps = ["@com_github_cncf_udpa//xds/type/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "xds_orca_upb",
+ deps = ["@com_github_cncf_udpa//xds/data/orca/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "xds_orca_service_upb",
+ deps = ["@com_github_cncf_udpa//xds/service/orca/v3:pkg"],
+)
+
+grpc_upb_proto_library(
+ name = "grpc_health_upb",
+ deps = ["//src/proto/grpc/health/v1:health_proto_descriptor"],
+)
+
+grpc_upb_proto_library(
+ name = "google_rpc_status_upb",
+ deps = ["@com_google_googleapis//google/rpc:status_proto"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "google_rpc_status_upbdefs",
+ deps = ["@com_google_googleapis//google/rpc:status_proto"],
+)
+
+grpc_upb_proto_library(
+ name = "grpc_lb_upb",
+ deps = ["//src/proto/grpc/lb/v1:load_balancer_proto_descriptor"],
+)
+
+grpc_upb_proto_library(
name = "alts_upb",
- srcs = [
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c",
- ],
- hdrs = [
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h",
- ],
- external_deps = [
- "upb_lib",
- "upb_lib_descriptor",
- ],
- language = "c++",
+ deps = ["//src/proto/grpc/gcp:alts_handshaker_proto"],
+)
+
+grpc_upb_proto_library(
+ name = "rls_upb",
+ deps = ["//src/proto/grpc/lookup/v1:rls_proto_descriptor"],
+)
+
+grpc_upb_proto_library(
+ name = "rls_config_upb",
+ deps = ["//src/proto/grpc/lookup/v1:rls_config_proto_descriptor"],
+)
+
+grpc_upb_proto_reflection_library(
+ name = "rls_config_upbdefs",
+ deps = ["//src/proto/grpc/lookup/v1:rls_config_proto_descriptor"],
)
+WELL_KNOWN_PROTO_TARGETS = [
+ "any",
+ "duration",
+ "empty",
+ "struct",
+ "timestamp",
+ "wrappers",
+]
+
+[grpc_upb_proto_library(
+ name = "protobuf_" + target + "_upb",
+ deps = ["@com_google_protobuf//:" + target + "_proto"],
+) for target in WELL_KNOWN_PROTO_TARGETS]
+
+[grpc_upb_proto_reflection_library(
+ name = "protobuf_" + target + "_upbdefs",
+ deps = ["@com_google_protobuf//:" + target + "_proto"],
+) for target in WELL_KNOWN_PROTO_TARGETS]
+
grpc_generate_one_off_targets()
filegroup(
diff --git a/grpc/BUILD.gn b/grpc/BUILD.gn
deleted file mode 100644
index 2a2889d4..00000000
--- a/grpc/BUILD.gn
+++ /dev/null
@@ -1,1626 +0,0 @@
-# GRPC Fuchsia GN build file
-
-# This file has been automatically generated from a template file.
-# Please look at the templates directory instead.
-# This file can be regenerated from the template by running
-# tools/buildgen/generate_projects.sh
-
-# 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.
-
-config("grpc_config") {
- include_dirs = [
- ".",
- "include/",
- ]
- defines = [
- "GRPC_USE_PROTO_LITE",
- "GPR_SUPPORT_CHANNELS_FROM_FD",
- "PB_FIELD_16BIT",
- ]
-}
-
-
-
- source_set("address_sorting") {
- sources = [
- "third_party/address_sorting/address_sorting.c",
- "third_party/address_sorting/address_sorting_internal.h",
- "third_party/address_sorting/address_sorting_posix.c",
- "third_party/address_sorting/address_sorting_windows.c",
- "third_party/address_sorting/include/address_sorting/address_sorting.h",
- ]
- deps = [
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- include_dirs = [
- "third_party/address_sorting/include",
- ]
- }
-
-
-
- source_set("gpr") {
- sources = [
- "include/grpc/impl/codegen/atm.h",
- "include/grpc/impl/codegen/atm_gcc_atomic.h",
- "include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_windows.h",
- "include/grpc/impl/codegen/byte_buffer.h",
- "include/grpc/impl/codegen/byte_buffer_reader.h",
- "include/grpc/impl/codegen/compression_types.h",
- "include/grpc/impl/codegen/connectivity_state.h",
- "include/grpc/impl/codegen/fork.h",
- "include/grpc/impl/codegen/gpr_slice.h",
- "include/grpc/impl/codegen/gpr_types.h",
- "include/grpc/impl/codegen/grpc_types.h",
- "include/grpc/impl/codegen/log.h",
- "include/grpc/impl/codegen/port_platform.h",
- "include/grpc/impl/codegen/propagation_bits.h",
- "include/grpc/impl/codegen/slice.h",
- "include/grpc/impl/codegen/status.h",
- "include/grpc/impl/codegen/sync.h",
- "include/grpc/impl/codegen/sync_abseil.h",
- "include/grpc/impl/codegen/sync_custom.h",
- "include/grpc/impl/codegen/sync_generic.h",
- "include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_windows.h",
- "include/grpc/support/alloc.h",
- "include/grpc/support/atm.h",
- "include/grpc/support/atm_gcc_atomic.h",
- "include/grpc/support/atm_gcc_sync.h",
- "include/grpc/support/atm_windows.h",
- "include/grpc/support/cpu.h",
- "include/grpc/support/log.h",
- "include/grpc/support/log_windows.h",
- "include/grpc/support/port_platform.h",
- "include/grpc/support/string_util.h",
- "include/grpc/support/sync.h",
- "include/grpc/support/sync_abseil.h",
- "include/grpc/support/sync_custom.h",
- "include/grpc/support/sync_generic.h",
- "include/grpc/support/sync_posix.h",
- "include/grpc/support/sync_windows.h",
- "include/grpc/support/thd_id.h",
- "include/grpc/support/time.h",
- "src/core/ext/upb-generated/google/api/annotations.upb.c",
- "src/core/ext/upb-generated/google/api/annotations.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h",
- "src/core/ext/upb-generated/google/api/http.upb.c",
- "src/core/ext/upb-generated/google/api/http.upb.h",
- "src/core/ext/upb-generated/google/protobuf/any.upb.c",
- "src/core/ext/upb-generated/google/protobuf/any.upb.h",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.c",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.h",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.c",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.h",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.c",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.h",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h",
- "src/core/ext/upb-generated/google/rpc/status.upb.c",
- "src/core/ext/upb-generated/google/rpc/status.upb.h",
- "src/core/lib/gpr/alloc.cc",
- "src/core/lib/gpr/alloc.h",
- "src/core/lib/gpr/arena.h",
- "src/core/lib/gpr/atm.cc",
- "src/core/lib/gpr/cpu_iphone.cc",
- "src/core/lib/gpr/cpu_linux.cc",
- "src/core/lib/gpr/cpu_posix.cc",
- "src/core/lib/gpr/cpu_windows.cc",
- "src/core/lib/gpr/env.h",
- "src/core/lib/gpr/env_linux.cc",
- "src/core/lib/gpr/env_posix.cc",
- "src/core/lib/gpr/env_windows.cc",
- "src/core/lib/gpr/log.cc",
- "src/core/lib/gpr/log_android.cc",
- "src/core/lib/gpr/log_linux.cc",
- "src/core/lib/gpr/log_posix.cc",
- "src/core/lib/gpr/log_windows.cc",
- "src/core/lib/gpr/murmur_hash.cc",
- "src/core/lib/gpr/murmur_hash.h",
- "src/core/lib/gpr/spinlock.h",
- "src/core/lib/gpr/string.cc",
- "src/core/lib/gpr/string.h",
- "src/core/lib/gpr/string_posix.cc",
- "src/core/lib/gpr/string_util_windows.cc",
- "src/core/lib/gpr/string_windows.cc",
- "src/core/lib/gpr/string_windows.h",
- "src/core/lib/gpr/sync.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",
- "src/core/lib/gpr/time_posix.cc",
- "src/core/lib/gpr/time_precise.cc",
- "src/core/lib/gpr/time_precise.h",
- "src/core/lib/gpr/time_windows.cc",
- "src/core/lib/gpr/tls.h",
- "src/core/lib/gpr/tls_gcc.h",
- "src/core/lib/gpr/tls_msvc.h",
- "src/core/lib/gpr/tls_pthread.cc",
- "src/core/lib/gpr/tls_pthread.h",
- "src/core/lib/gpr/tls_stdcpp.h",
- "src/core/lib/gpr/tmpfile.h",
- "src/core/lib/gpr/tmpfile_msys.cc",
- "src/core/lib/gpr/tmpfile_posix.cc",
- "src/core/lib/gpr/tmpfile_windows.cc",
- "src/core/lib/gpr/useful.h",
- "src/core/lib/gpr/wrap_memcpy.cc",
- "src/core/lib/gprpp/arena.cc",
- "src/core/lib/gprpp/arena.h",
- "src/core/lib/gprpp/atomic.h",
- "src/core/lib/gprpp/debug_location.h",
- "src/core/lib/gprpp/examine_stack.cc",
- "src/core/lib/gprpp/examine_stack.h",
- "src/core/lib/gprpp/fork.cc",
- "src/core/lib/gprpp/fork.h",
- "src/core/lib/gprpp/global_config.h",
- "src/core/lib/gprpp/global_config_custom.h",
- "src/core/lib/gprpp/global_config_env.cc",
- "src/core/lib/gprpp/global_config_env.h",
- "src/core/lib/gprpp/global_config_generic.h",
- "src/core/lib/gprpp/host_port.cc",
- "src/core/lib/gprpp/host_port.h",
- "src/core/lib/gprpp/manual_constructor.h",
- "src/core/lib/gprpp/memory.h",
- "src/core/lib/gprpp/mpscq.cc",
- "src/core/lib/gprpp/mpscq.h",
- "src/core/lib/gprpp/stat.h",
- "src/core/lib/gprpp/stat_posix.cc",
- "src/core/lib/gprpp/stat_windows.cc",
- "src/core/lib/gprpp/status_helper.cc",
- "src/core/lib/gprpp/status_helper.h",
- "src/core/lib/gprpp/sync.h",
- "src/core/lib/gprpp/thd.h",
- "src/core/lib/gprpp/thd_posix.cc",
- "src/core/lib/gprpp/thd_windows.cc",
- "src/core/lib/gprpp/time_util.cc",
- "src/core/lib/gprpp/time_util.h",
- "src/core/lib/profiling/basic_timers.cc",
- "src/core/lib/profiling/stap_timers.cc",
- "src/core/lib/profiling/timers.h",
- ]
- deps = [
- ":absl/base:base",
- ":absl/memory:memory",
- ":absl/status:status",
- ":absl/strings:str_format",
- ":absl/strings:strings",
- ":absl/synchronization:synchronization",
- ":absl/time:time",
- ":absl/types:optional",
- ":upb",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
-
-
- source_set("grpc") {
- sources = [
- "include/grpc/byte_buffer.h",
- "include/grpc/byte_buffer_reader.h",
- "include/grpc/census.h",
- "include/grpc/compression.h",
- "include/grpc/event_engine/channel_args.h",
- "include/grpc/event_engine/event_engine.h",
- "include/grpc/event_engine/port.h",
- "include/grpc/event_engine/slice_allocator.h",
- "include/grpc/fork.h",
- "include/grpc/grpc.h",
- "include/grpc/grpc_posix.h",
- "include/grpc/grpc_security.h",
- "include/grpc/grpc_security_constants.h",
- "include/grpc/load_reporting.h",
- "include/grpc/slice.h",
- "include/grpc/slice_buffer.h",
- "include/grpc/status.h",
- "include/grpc/support/workaround_list.h",
- "src/core/ext/filters/census/grpc_context.cc",
- "src/core/ext/filters/client_channel/backend_metric.cc",
- "src/core/ext/filters/client_channel/backend_metric.h",
- "src/core/ext/filters/client_channel/backup_poller.cc",
- "src/core/ext/filters/client_channel/backup_poller.h",
- "src/core/ext/filters/client_channel/channel_connectivity.cc",
- "src/core/ext/filters/client_channel/client_channel.cc",
- "src/core/ext/filters/client_channel/client_channel.h",
- "src/core/ext/filters/client_channel/client_channel_channelz.cc",
- "src/core/ext/filters/client_channel/client_channel_channelz.h",
- "src/core/ext/filters/client_channel/client_channel_factory.cc",
- "src/core/ext/filters/client_channel/client_channel_factory.h",
- "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.h",
- "src/core/ext/filters/client_channel/connector.h",
- "src/core/ext/filters/client_channel/dynamic_filters.cc",
- "src/core/ext/filters/client_channel/dynamic_filters.h",
- "src/core/ext/filters/client_channel/global_subchannel_pool.cc",
- "src/core/ext/filters/client_channel/global_subchannel_pool.h",
- "src/core/ext/filters/client_channel/health/health_check_client.cc",
- "src/core/ext/filters/client_channel/health/health_check_client.h",
- "src/core/ext/filters/client_channel/http_connect_handshaker.cc",
- "src/core/ext/filters/client_channel/http_connect_handshaker.h",
- "src/core/ext/filters/client_channel/http_proxy.cc",
- "src/core/ext/filters/client_channel/http_proxy.h",
- "src/core/ext/filters/client_channel/lb_policy.cc",
- "src/core/ext/filters/client_channel/lb_policy.h",
- "src/core/ext/filters/client_channel/lb_policy/address_filtering.cc",
- "src/core/ext/filters/client_channel/lb_policy/address_filtering.h",
- "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc",
- "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
- "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.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
- "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/grpclb_client_stats.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
- "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/ring_hash/ring_hash.cc",
- "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h",
- "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc",
- "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h",
- "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/xds.h",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc",
- "src/core/ext/filters/client_channel/lb_policy_factory.h",
- "src/core/ext/filters/client_channel/lb_policy_registry.cc",
- "src/core/ext/filters/client_channel/lb_policy_registry.h",
- "src/core/ext/filters/client_channel/local_subchannel_pool.cc",
- "src/core/ext/filters/client_channel/local_subchannel_pool.h",
- "src/core/ext/filters/client_channel/proxy_mapper.h",
- "src/core/ext/filters/client_channel/proxy_mapper_registry.cc",
- "src/core/ext/filters/client_channel/proxy_mapper_registry.h",
- "src/core/ext/filters/client_channel/resolver.cc",
- "src/core/ext/filters/client_channel/resolver.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc",
- "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc",
- "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h",
- "src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h",
- "src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h",
- "src/core/ext/filters/client_channel/resolver_factory.h",
- "src/core/ext/filters/client_channel/resolver_registry.cc",
- "src/core/ext/filters/client_channel/resolver_registry.h",
- "src/core/ext/filters/client_channel/resolver_result_parsing.cc",
- "src/core/ext/filters/client_channel/resolver_result_parsing.h",
- "src/core/ext/filters/client_channel/retry_filter.cc",
- "src/core/ext/filters/client_channel/retry_filter.h",
- "src/core/ext/filters/client_channel/retry_service_config.cc",
- "src/core/ext/filters/client_channel/retry_service_config.h",
- "src/core/ext/filters/client_channel/retry_throttle.cc",
- "src/core/ext/filters/client_channel/retry_throttle.h",
- "src/core/ext/filters/client_channel/server_address.cc",
- "src/core/ext/filters/client_channel/server_address.h",
- "src/core/ext/filters/client_channel/service_config.cc",
- "src/core/ext/filters/client_channel/service_config.h",
- "src/core/ext/filters/client_channel/service_config_call_data.h",
- "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_parser.h",
- "src/core/ext/filters/client_channel/subchannel.cc",
- "src/core/ext/filters/client_channel/subchannel.h",
- "src/core/ext/filters/client_channel/subchannel_interface.h",
- "src/core/ext/filters/client_channel/subchannel_pool_interface.cc",
- "src/core/ext/filters/client_channel/subchannel_pool_interface.h",
- "src/core/ext/filters/client_idle/client_idle_filter.cc",
- "src/core/ext/filters/deadline/deadline_filter.cc",
- "src/core/ext/filters/deadline/deadline_filter.h",
- "src/core/ext/filters/fault_injection/fault_injection_filter.cc",
- "src/core/ext/filters/fault_injection/fault_injection_filter.h",
- "src/core/ext/filters/fault_injection/service_config_parser.cc",
- "src/core/ext/filters/fault_injection/service_config_parser.h",
- "src/core/ext/filters/http/client/http_client_filter.cc",
- "src/core/ext/filters/http/client/http_client_filter.h",
- "src/core/ext/filters/http/client_authority_filter.cc",
- "src/core/ext/filters/http/client_authority_filter.h",
- "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_compress_filter.h",
- "src/core/ext/filters/http/message_compress/message_decompress_filter.cc",
- "src/core/ext/filters/http/message_compress/message_decompress_filter.h",
- "src/core/ext/filters/http/server/http_server_filter.cc",
- "src/core/ext/filters/http/server/http_server_filter.h",
- "src/core/ext/filters/max_age/max_age_filter.cc",
- "src/core/ext/filters/max_age/max_age_filter.h",
- "src/core/ext/filters/message_size/message_size_filter.cc",
- "src/core/ext/filters/message_size/message_size_filter.h",
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc",
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h",
- "src/core/ext/filters/workarounds/workaround_utils.cc",
- "src/core/ext/filters/workarounds/workaround_utils.h",
- "src/core/ext/transport/chttp2/alpn/alpn.cc",
- "src/core/ext/transport/chttp2/alpn/alpn.h",
- "src/core/ext/transport/chttp2/client/authority.cc",
- "src/core/ext/transport/chttp2/client/authority.h",
- "src/core/ext/transport/chttp2/client/chttp2_connector.cc",
- "src/core/ext/transport/chttp2/client/chttp2_connector.h",
- "src/core/ext/transport/chttp2/client/insecure/channel_create.cc",
- "src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc",
- "src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc",
- "src/core/ext/transport/chttp2/server/chttp2_server.cc",
- "src/core/ext/transport/chttp2/server/chttp2_server.h",
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc",
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc",
- "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc",
- "src/core/ext/transport/chttp2/transport/bin_decoder.cc",
- "src/core/ext/transport/chttp2/transport/bin_decoder.h",
- "src/core/ext/transport/chttp2/transport/bin_encoder.cc",
- "src/core/ext/transport/chttp2/transport/bin_encoder.h",
- "src/core/ext/transport/chttp2/transport/chttp2_plugin.cc",
- "src/core/ext/transport/chttp2/transport/chttp2_transport.cc",
- "src/core/ext/transport/chttp2/transport/chttp2_transport.h",
- "src/core/ext/transport/chttp2/transport/context_list.cc",
- "src/core/ext/transport/chttp2/transport/context_list.h",
- "src/core/ext/transport/chttp2/transport/flow_control.cc",
- "src/core/ext/transport/chttp2/transport/flow_control.h",
- "src/core/ext/transport/chttp2/transport/frame.h",
- "src/core/ext/transport/chttp2/transport/frame_data.cc",
- "src/core/ext/transport/chttp2/transport/frame_data.h",
- "src/core/ext/transport/chttp2/transport/frame_goaway.cc",
- "src/core/ext/transport/chttp2/transport/frame_goaway.h",
- "src/core/ext/transport/chttp2/transport/frame_ping.cc",
- "src/core/ext/transport/chttp2/transport/frame_ping.h",
- "src/core/ext/transport/chttp2/transport/frame_rst_stream.cc",
- "src/core/ext/transport/chttp2/transport/frame_rst_stream.h",
- "src/core/ext/transport/chttp2/transport/frame_settings.cc",
- "src/core/ext/transport/chttp2/transport/frame_settings.h",
- "src/core/ext/transport/chttp2/transport/frame_window_update.cc",
- "src/core/ext/transport/chttp2/transport/frame_window_update.h",
- "src/core/ext/transport/chttp2/transport/hpack_encoder.cc",
- "src/core/ext/transport/chttp2/transport/hpack_encoder.h",
- "src/core/ext/transport/chttp2/transport/hpack_parser.cc",
- "src/core/ext/transport/chttp2/transport/hpack_parser.h",
- "src/core/ext/transport/chttp2/transport/hpack_table.cc",
- "src/core/ext/transport/chttp2/transport/hpack_table.h",
- "src/core/ext/transport/chttp2/transport/http2_settings.cc",
- "src/core/ext/transport/chttp2/transport/http2_settings.h",
- "src/core/ext/transport/chttp2/transport/huffsyms.cc",
- "src/core/ext/transport/chttp2/transport/huffsyms.h",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.cc",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.h",
- "src/core/ext/transport/chttp2/transport/internal.h",
- "src/core/ext/transport/chttp2/transport/parsing.cc",
- "src/core/ext/transport/chttp2/transport/stream_lists.cc",
- "src/core/ext/transport/chttp2/transport/stream_map.cc",
- "src/core/ext/transport/chttp2/transport/stream_map.h",
- "src/core/ext/transport/chttp2/transport/varint.cc",
- "src/core/ext/transport/chttp2/transport/varint.h",
- "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/transport/inproc/inproc_transport.h",
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c",
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h",
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c",
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.c",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.h",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c",
- "src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h",
- "src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c",
- "src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
- "src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c",
- "src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h",
- "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/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
- "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/cert.upb.h",
- "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/common.upb.h",
- "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/secret.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h",
- "src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c",
- "src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h",
- "src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c",
- "src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h",
- "src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c",
- "src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h",
- "src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c",
- "src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c",
- "src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c",
- "src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h",
- "src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c",
- "src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h",
- "src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c",
- "src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c",
- "src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/http.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/http.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/percent.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/percent.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/range.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/range.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/migrate.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/migrate.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/security.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/security.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/status.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/status.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/versioning.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/versioning.upb.h",
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c",
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h",
- "src/core/ext/upb-generated/validate/validate.upb.c",
- "src/core/ext/upb-generated/validate/validate.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h",
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.c",
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h",
- "src/core/ext/xds/certificate_provider_factory.h",
- "src/core/ext/xds/certificate_provider_registry.cc",
- "src/core/ext/xds/certificate_provider_registry.h",
- "src/core/ext/xds/certificate_provider_store.cc",
- "src/core/ext/xds/certificate_provider_store.h",
- "src/core/ext/xds/file_watcher_certificate_provider_factory.cc",
- "src/core/ext/xds/file_watcher_certificate_provider_factory.h",
- "src/core/ext/xds/xds_api.cc",
- "src/core/ext/xds/xds_api.h",
- "src/core/ext/xds/xds_bootstrap.cc",
- "src/core/ext/xds/xds_bootstrap.h",
- "src/core/ext/xds/xds_certificate_provider.cc",
- "src/core/ext/xds/xds_certificate_provider.h",
- "src/core/ext/xds/xds_channel_args.h",
- "src/core/ext/xds/xds_client.cc",
- "src/core/ext/xds/xds_client.h",
- "src/core/ext/xds/xds_client_stats.cc",
- "src/core/ext/xds/xds_client_stats.h",
- "src/core/ext/xds/xds_http_fault_filter.cc",
- "src/core/ext/xds/xds_http_fault_filter.h",
- "src/core/ext/xds/xds_http_filters.cc",
- "src/core/ext/xds/xds_http_filters.h",
- "src/core/ext/xds/xds_server_config_fetcher.cc",
- "src/core/lib/address_utils/parse_address.cc",
- "src/core/lib/address_utils/parse_address.h",
- "src/core/lib/address_utils/sockaddr_utils.cc",
- "src/core/lib/address_utils/sockaddr_utils.h",
- "src/core/lib/avl/avl.cc",
- "src/core/lib/avl/avl.h",
- "src/core/lib/backoff/backoff.cc",
- "src/core/lib/backoff/backoff.h",
- "src/core/lib/channel/channel_args.cc",
- "src/core/lib/channel/channel_args.h",
- "src/core/lib/channel/channel_stack.cc",
- "src/core/lib/channel/channel_stack.h",
- "src/core/lib/channel/channel_stack_builder.cc",
- "src/core/lib/channel/channel_stack_builder.h",
- "src/core/lib/channel/channel_trace.cc",
- "src/core/lib/channel/channel_trace.h",
- "src/core/lib/channel/channelz.cc",
- "src/core/lib/channel/channelz.h",
- "src/core/lib/channel/channelz_registry.cc",
- "src/core/lib/channel/channelz_registry.h",
- "src/core/lib/channel/connected_channel.cc",
- "src/core/lib/channel/connected_channel.h",
- "src/core/lib/channel/context.h",
- "src/core/lib/channel/handshaker.cc",
- "src/core/lib/channel/handshaker.h",
- "src/core/lib/channel/handshaker_factory.h",
- "src/core/lib/channel/handshaker_registry.cc",
- "src/core/lib/channel/handshaker_registry.h",
- "src/core/lib/channel/status_util.cc",
- "src/core/lib/channel/status_util.h",
- "src/core/lib/compression/algorithm_metadata.h",
- "src/core/lib/compression/compression.cc",
- "src/core/lib/compression/compression_args.cc",
- "src/core/lib/compression/compression_args.h",
- "src/core/lib/compression/compression_internal.cc",
- "src/core/lib/compression/compression_internal.h",
- "src/core/lib/compression/message_compress.cc",
- "src/core/lib/compression/message_compress.h",
- "src/core/lib/compression/stream_compression.cc",
- "src/core/lib/compression/stream_compression.h",
- "src/core/lib/compression/stream_compression_gzip.cc",
- "src/core/lib/compression/stream_compression_gzip.h",
- "src/core/lib/compression/stream_compression_identity.cc",
- "src/core/lib/compression/stream_compression_identity.h",
- "src/core/lib/debug/stats.cc",
- "src/core/lib/debug/stats.h",
- "src/core/lib/debug/stats_data.cc",
- "src/core/lib/debug/stats_data.h",
- "src/core/lib/debug/trace.cc",
- "src/core/lib/debug/trace.h",
- "src/core/lib/event_engine/slice_allocator.cc",
- "src/core/lib/event_engine/sockaddr.cc",
- "src/core/lib/gprpp/atomic.h",
- "src/core/lib/gprpp/dual_ref_counted.h",
- "src/core/lib/gprpp/orphanable.h",
- "src/core/lib/gprpp/ref_counted.h",
- "src/core/lib/gprpp/ref_counted_ptr.h",
- "src/core/lib/http/format_request.cc",
- "src/core/lib/http/format_request.h",
- "src/core/lib/http/httpcli.cc",
- "src/core/lib/http/httpcli.h",
- "src/core/lib/http/httpcli_security_connector.cc",
- "src/core/lib/http/parser.cc",
- "src/core/lib/http/parser.h",
- "src/core/lib/iomgr/block_annotate.h",
- "src/core/lib/iomgr/buffer_list.cc",
- "src/core/lib/iomgr/buffer_list.h",
- "src/core/lib/iomgr/call_combiner.cc",
- "src/core/lib/iomgr/call_combiner.h",
- "src/core/lib/iomgr/cfstream_handle.cc",
- "src/core/lib/iomgr/cfstream_handle.h",
- "src/core/lib/iomgr/closure.h",
- "src/core/lib/iomgr/combiner.cc",
- "src/core/lib/iomgr/combiner.h",
- "src/core/lib/iomgr/dualstack_socket_posix.cc",
- "src/core/lib/iomgr/dynamic_annotations.h",
- "src/core/lib/iomgr/endpoint.cc",
- "src/core/lib/iomgr/endpoint.h",
- "src/core/lib/iomgr/endpoint_cfstream.cc",
- "src/core/lib/iomgr/endpoint_cfstream.h",
- "src/core/lib/iomgr/endpoint_pair.h",
- "src/core/lib/iomgr/endpoint_pair_posix.cc",
- "src/core/lib/iomgr/endpoint_pair_uv.cc",
- "src/core/lib/iomgr/endpoint_pair_windows.cc",
- "src/core/lib/iomgr/error.cc",
- "src/core/lib/iomgr/error.h",
- "src/core/lib/iomgr/error_cfstream.cc",
- "src/core/lib/iomgr/error_cfstream.h",
- "src/core/lib/iomgr/error_internal.h",
- "src/core/lib/iomgr/ev_apple.cc",
- "src/core/lib/iomgr/ev_apple.h",
- "src/core/lib/iomgr/ev_epoll1_linux.cc",
- "src/core/lib/iomgr/ev_epoll1_linux.h",
- "src/core/lib/iomgr/ev_epollex_linux.cc",
- "src/core/lib/iomgr/ev_epollex_linux.h",
- "src/core/lib/iomgr/ev_poll_posix.cc",
- "src/core/lib/iomgr/ev_poll_posix.h",
- "src/core/lib/iomgr/ev_posix.cc",
- "src/core/lib/iomgr/ev_posix.h",
- "src/core/lib/iomgr/ev_windows.cc",
- "src/core/lib/iomgr/exec_ctx.cc",
- "src/core/lib/iomgr/exec_ctx.h",
- "src/core/lib/iomgr/executor.cc",
- "src/core/lib/iomgr/executor.h",
- "src/core/lib/iomgr/executor/mpmcqueue.cc",
- "src/core/lib/iomgr/executor/mpmcqueue.h",
- "src/core/lib/iomgr/executor/threadpool.cc",
- "src/core/lib/iomgr/executor/threadpool.h",
- "src/core/lib/iomgr/fork_posix.cc",
- "src/core/lib/iomgr/fork_windows.cc",
- "src/core/lib/iomgr/gethostname.h",
- "src/core/lib/iomgr/gethostname_fallback.cc",
- "src/core/lib/iomgr/gethostname_host_name_max.cc",
- "src/core/lib/iomgr/gethostname_sysconf.cc",
- "src/core/lib/iomgr/grpc_if_nametoindex.h",
- "src/core/lib/iomgr/grpc_if_nametoindex_posix.cc",
- "src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc",
- "src/core/lib/iomgr/internal_errqueue.cc",
- "src/core/lib/iomgr/internal_errqueue.h",
- "src/core/lib/iomgr/iocp_windows.cc",
- "src/core/lib/iomgr/iocp_windows.h",
- "src/core/lib/iomgr/iomgr.cc",
- "src/core/lib/iomgr/iomgr.h",
- "src/core/lib/iomgr/iomgr_custom.cc",
- "src/core/lib/iomgr/iomgr_custom.h",
- "src/core/lib/iomgr/iomgr_internal.cc",
- "src/core/lib/iomgr/iomgr_internal.h",
- "src/core/lib/iomgr/iomgr_posix.cc",
- "src/core/lib/iomgr/iomgr_posix_cfstream.cc",
- "src/core/lib/iomgr/iomgr_uv.cc",
- "src/core/lib/iomgr/iomgr_windows.cc",
- "src/core/lib/iomgr/is_epollexclusive_available.cc",
- "src/core/lib/iomgr/is_epollexclusive_available.h",
- "src/core/lib/iomgr/load_file.cc",
- "src/core/lib/iomgr/load_file.h",
- "src/core/lib/iomgr/lockfree_event.cc",
- "src/core/lib/iomgr/lockfree_event.h",
- "src/core/lib/iomgr/nameser.h",
- "src/core/lib/iomgr/polling_entity.cc",
- "src/core/lib/iomgr/polling_entity.h",
- "src/core/lib/iomgr/pollset.cc",
- "src/core/lib/iomgr/pollset.h",
- "src/core/lib/iomgr/pollset_custom.cc",
- "src/core/lib/iomgr/pollset_custom.h",
- "src/core/lib/iomgr/pollset_set.cc",
- "src/core/lib/iomgr/pollset_set.h",
- "src/core/lib/iomgr/pollset_set_custom.cc",
- "src/core/lib/iomgr/pollset_set_custom.h",
- "src/core/lib/iomgr/pollset_set_windows.cc",
- "src/core/lib/iomgr/pollset_set_windows.h",
- "src/core/lib/iomgr/pollset_uv.cc",
- "src/core/lib/iomgr/pollset_uv.h",
- "src/core/lib/iomgr/pollset_windows.cc",
- "src/core/lib/iomgr/pollset_windows.h",
- "src/core/lib/iomgr/port.h",
- "src/core/lib/iomgr/python_util.h",
- "src/core/lib/iomgr/resolve_address.cc",
- "src/core/lib/iomgr/resolve_address.h",
- "src/core/lib/iomgr/resolve_address_custom.cc",
- "src/core/lib/iomgr/resolve_address_custom.h",
- "src/core/lib/iomgr/resolve_address_posix.cc",
- "src/core/lib/iomgr/resolve_address_windows.cc",
- "src/core/lib/iomgr/resource_quota.cc",
- "src/core/lib/iomgr/resource_quota.h",
- "src/core/lib/iomgr/sockaddr.h",
- "src/core/lib/iomgr/sockaddr_custom.h",
- "src/core/lib/iomgr/sockaddr_posix.h",
- "src/core/lib/iomgr/sockaddr_windows.h",
- "src/core/lib/iomgr/socket_factory_posix.cc",
- "src/core/lib/iomgr/socket_factory_posix.h",
- "src/core/lib/iomgr/socket_mutator.cc",
- "src/core/lib/iomgr/socket_mutator.h",
- "src/core/lib/iomgr/socket_utils.h",
- "src/core/lib/iomgr/socket_utils_common_posix.cc",
- "src/core/lib/iomgr/socket_utils_linux.cc",
- "src/core/lib/iomgr/socket_utils_posix.cc",
- "src/core/lib/iomgr/socket_utils_posix.h",
- "src/core/lib/iomgr/socket_utils_uv.cc",
- "src/core/lib/iomgr/socket_utils_windows.cc",
- "src/core/lib/iomgr/socket_windows.cc",
- "src/core/lib/iomgr/socket_windows.h",
- "src/core/lib/iomgr/sys_epoll_wrapper.h",
- "src/core/lib/iomgr/tcp_client.cc",
- "src/core/lib/iomgr/tcp_client.h",
- "src/core/lib/iomgr/tcp_client_cfstream.cc",
- "src/core/lib/iomgr/tcp_client_custom.cc",
- "src/core/lib/iomgr/tcp_client_posix.cc",
- "src/core/lib/iomgr/tcp_client_posix.h",
- "src/core/lib/iomgr/tcp_client_windows.cc",
- "src/core/lib/iomgr/tcp_custom.cc",
- "src/core/lib/iomgr/tcp_custom.h",
- "src/core/lib/iomgr/tcp_posix.cc",
- "src/core/lib/iomgr/tcp_posix.h",
- "src/core/lib/iomgr/tcp_server.cc",
- "src/core/lib/iomgr/tcp_server.h",
- "src/core/lib/iomgr/tcp_server_custom.cc",
- "src/core/lib/iomgr/tcp_server_posix.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix.h",
- "src/core/lib/iomgr/tcp_server_utils_posix_common.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc",
- "src/core/lib/iomgr/tcp_server_windows.cc",
- "src/core/lib/iomgr/tcp_uv.cc",
- "src/core/lib/iomgr/tcp_windows.cc",
- "src/core/lib/iomgr/tcp_windows.h",
- "src/core/lib/iomgr/time_averaged_stats.cc",
- "src/core/lib/iomgr/time_averaged_stats.h",
- "src/core/lib/iomgr/timer.cc",
- "src/core/lib/iomgr/timer.h",
- "src/core/lib/iomgr/timer_custom.cc",
- "src/core/lib/iomgr/timer_custom.h",
- "src/core/lib/iomgr/timer_generic.cc",
- "src/core/lib/iomgr/timer_generic.h",
- "src/core/lib/iomgr/timer_heap.cc",
- "src/core/lib/iomgr/timer_heap.h",
- "src/core/lib/iomgr/timer_manager.cc",
- "src/core/lib/iomgr/timer_manager.h",
- "src/core/lib/iomgr/timer_uv.cc",
- "src/core/lib/iomgr/udp_server.cc",
- "src/core/lib/iomgr/udp_server.h",
- "src/core/lib/iomgr/unix_sockets_posix.cc",
- "src/core/lib/iomgr/unix_sockets_posix.h",
- "src/core/lib/iomgr/unix_sockets_posix_noop.cc",
- "src/core/lib/iomgr/wakeup_fd_eventfd.cc",
- "src/core/lib/iomgr/wakeup_fd_nospecial.cc",
- "src/core/lib/iomgr/wakeup_fd_pipe.cc",
- "src/core/lib/iomgr/wakeup_fd_pipe.h",
- "src/core/lib/iomgr/wakeup_fd_posix.cc",
- "src/core/lib/iomgr/wakeup_fd_posix.h",
- "src/core/lib/iomgr/work_serializer.cc",
- "src/core/lib/iomgr/work_serializer.h",
- "src/core/lib/json/json.h",
- "src/core/lib/json/json_reader.cc",
- "src/core/lib/json/json_util.cc",
- "src/core/lib/json/json_util.h",
- "src/core/lib/json/json_writer.cc",
- "src/core/lib/matchers/matchers.cc",
- "src/core/lib/matchers/matchers.h",
- "src/core/lib/security/context/security_context.cc",
- "src/core/lib/security/context/security_context.h",
- "src/core/lib/security/credentials/alts/alts_credentials.cc",
- "src/core/lib/security/credentials/alts/alts_credentials.h",
- "src/core/lib/security/credentials/alts/check_gcp_environment.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment.h",
- "src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc",
- "src/core/lib/security/credentials/composite/composite_credentials.cc",
- "src/core/lib/security/credentials/composite/composite_credentials.h",
- "src/core/lib/security/credentials/credentials.cc",
- "src/core/lib/security/credentials/credentials.h",
- "src/core/lib/security/credentials/credentials_metadata.cc",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.h",
- "src/core/lib/security/credentials/external/aws_request_signer.cc",
- "src/core/lib/security/credentials/external/aws_request_signer.h",
- "src/core/lib/security/credentials/external/external_account_credentials.cc",
- "src/core/lib/security/credentials/external/external_account_credentials.h",
- "src/core/lib/security/credentials/external/file_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/file_external_account_credentials.h",
- "src/core/lib/security/credentials/external/url_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/url_external_account_credentials.h",
- "src/core/lib/security/credentials/fake/fake_credentials.cc",
- "src/core/lib/security/credentials/fake/fake_credentials.h",
- "src/core/lib/security/credentials/google_default/credentials_generic.cc",
- "src/core/lib/security/credentials/google_default/google_default_credentials.cc",
- "src/core/lib/security/credentials/google_default/google_default_credentials.h",
- "src/core/lib/security/credentials/iam/iam_credentials.cc",
- "src/core/lib/security/credentials/iam/iam_credentials.h",
- "src/core/lib/security/credentials/insecure/insecure_credentials.cc",
- "src/core/lib/security/credentials/jwt/json_token.cc",
- "src/core/lib/security/credentials/jwt/json_token.h",
- "src/core/lib/security/credentials/jwt/jwt_credentials.cc",
- "src/core/lib/security/credentials/jwt/jwt_credentials.h",
- "src/core/lib/security/credentials/jwt/jwt_verifier.cc",
- "src/core/lib/security/credentials/jwt/jwt_verifier.h",
- "src/core/lib/security/credentials/local/local_credentials.cc",
- "src/core/lib/security/credentials/local/local_credentials.h",
- "src/core/lib/security/credentials/oauth2/oauth2_credentials.cc",
- "src/core/lib/security/credentials/oauth2/oauth2_credentials.h",
- "src/core/lib/security/credentials/plugin/plugin_credentials.cc",
- "src/core/lib/security/credentials/plugin/plugin_credentials.h",
- "src/core/lib/security/credentials/ssl/ssl_credentials.cc",
- "src/core/lib/security/credentials/ssl/ssl_credentials.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h",
- "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h",
- "src/core/lib/security/credentials/tls/tls_credentials.cc",
- "src/core/lib/security/credentials/tls/tls_credentials.h",
- "src/core/lib/security/credentials/tls/tls_utils.cc",
- "src/core/lib/security/credentials/tls/tls_utils.h",
- "src/core/lib/security/credentials/xds/xds_credentials.cc",
- "src/core/lib/security/credentials/xds/xds_credentials.h",
- "src/core/lib/security/security_connector/alts/alts_security_connector.cc",
- "src/core/lib/security/security_connector/alts/alts_security_connector.h",
- "src/core/lib/security/security_connector/fake/fake_security_connector.cc",
- "src/core/lib/security/security_connector/fake/fake_security_connector.h",
- "src/core/lib/security/security_connector/insecure/insecure_security_connector.cc",
- "src/core/lib/security/security_connector/insecure/insecure_security_connector.h",
- "src/core/lib/security/security_connector/load_system_roots.h",
- "src/core/lib/security/security_connector/load_system_roots_fallback.cc",
- "src/core/lib/security/security_connector/load_system_roots_linux.cc",
- "src/core/lib/security/security_connector/load_system_roots_linux.h",
- "src/core/lib/security/security_connector/local/local_security_connector.cc",
- "src/core/lib/security/security_connector/local/local_security_connector.h",
- "src/core/lib/security/security_connector/security_connector.cc",
- "src/core/lib/security/security_connector/security_connector.h",
- "src/core/lib/security/security_connector/ssl/ssl_security_connector.cc",
- "src/core/lib/security/security_connector/ssl/ssl_security_connector.h",
- "src/core/lib/security/security_connector/ssl_utils.cc",
- "src/core/lib/security/security_connector/ssl_utils.h",
- "src/core/lib/security/security_connector/ssl_utils_config.cc",
- "src/core/lib/security/security_connector/ssl_utils_config.h",
- "src/core/lib/security/security_connector/tls/tls_security_connector.cc",
- "src/core/lib/security/security_connector/tls/tls_security_connector.h",
- "src/core/lib/security/transport/auth_filters.h",
- "src/core/lib/security/transport/client_auth_filter.cc",
- "src/core/lib/security/transport/secure_endpoint.cc",
- "src/core/lib/security/transport/secure_endpoint.h",
- "src/core/lib/security/transport/security_handshaker.cc",
- "src/core/lib/security/transport/security_handshaker.h",
- "src/core/lib/security/transport/server_auth_filter.cc",
- "src/core/lib/security/transport/tsi_error.cc",
- "src/core/lib/security/transport/tsi_error.h",
- "src/core/lib/security/util/json_util.cc",
- "src/core/lib/security/util/json_util.h",
- "src/core/lib/slice/b64.cc",
- "src/core/lib/slice/b64.h",
- "src/core/lib/slice/percent_encoding.cc",
- "src/core/lib/slice/percent_encoding.h",
- "src/core/lib/slice/slice.cc",
- "src/core/lib/slice/slice_buffer.cc",
- "src/core/lib/slice/slice_intern.cc",
- "src/core/lib/slice/slice_internal.h",
- "src/core/lib/slice/slice_string_helpers.cc",
- "src/core/lib/slice/slice_string_helpers.h",
- "src/core/lib/slice/slice_utils.h",
- "src/core/lib/surface/api_trace.cc",
- "src/core/lib/surface/api_trace.h",
- "src/core/lib/surface/byte_buffer.cc",
- "src/core/lib/surface/byte_buffer_reader.cc",
- "src/core/lib/surface/call.cc",
- "src/core/lib/surface/call.h",
- "src/core/lib/surface/call_details.cc",
- "src/core/lib/surface/call_log_batch.cc",
- "src/core/lib/surface/call_test_only.h",
- "src/core/lib/surface/channel.cc",
- "src/core/lib/surface/channel.h",
- "src/core/lib/surface/channel_init.cc",
- "src/core/lib/surface/channel_init.h",
- "src/core/lib/surface/channel_ping.cc",
- "src/core/lib/surface/channel_stack_type.cc",
- "src/core/lib/surface/channel_stack_type.h",
- "src/core/lib/surface/completion_queue.cc",
- "src/core/lib/surface/completion_queue.h",
- "src/core/lib/surface/completion_queue_factory.cc",
- "src/core/lib/surface/completion_queue_factory.h",
- "src/core/lib/surface/event_string.cc",
- "src/core/lib/surface/event_string.h",
- "src/core/lib/surface/init.cc",
- "src/core/lib/surface/init.h",
- "src/core/lib/surface/init_secure.cc",
- "src/core/lib/surface/lame_client.cc",
- "src/core/lib/surface/lame_client.h",
- "src/core/lib/surface/metadata_array.cc",
- "src/core/lib/surface/server.cc",
- "src/core/lib/surface/server.h",
- "src/core/lib/surface/validate_metadata.cc",
- "src/core/lib/surface/validate_metadata.h",
- "src/core/lib/surface/version.cc",
- "src/core/lib/transport/authority_override.cc",
- "src/core/lib/transport/authority_override.h",
- "src/core/lib/transport/bdp_estimator.cc",
- "src/core/lib/transport/bdp_estimator.h",
- "src/core/lib/transport/byte_stream.cc",
- "src/core/lib/transport/byte_stream.h",
- "src/core/lib/transport/connectivity_state.cc",
- "src/core/lib/transport/connectivity_state.h",
- "src/core/lib/transport/error_utils.cc",
- "src/core/lib/transport/error_utils.h",
- "src/core/lib/transport/http2_errors.h",
- "src/core/lib/transport/metadata.cc",
- "src/core/lib/transport/metadata.h",
- "src/core/lib/transport/metadata_batch.cc",
- "src/core/lib/transport/metadata_batch.h",
- "src/core/lib/transport/pid_controller.cc",
- "src/core/lib/transport/pid_controller.h",
- "src/core/lib/transport/static_metadata.cc",
- "src/core/lib/transport/static_metadata.h",
- "src/core/lib/transport/status_conversion.cc",
- "src/core/lib/transport/status_conversion.h",
- "src/core/lib/transport/status_metadata.cc",
- "src/core/lib/transport/status_metadata.h",
- "src/core/lib/transport/timeout_encoding.cc",
- "src/core/lib/transport/timeout_encoding.h",
- "src/core/lib/transport/transport.cc",
- "src/core/lib/transport/transport.h",
- "src/core/lib/transport/transport_impl.h",
- "src/core/lib/transport/transport_op_string.cc",
- "src/core/lib/uri/uri_parser.cc",
- "src/core/lib/uri/uri_parser.h",
- "src/core/plugin_registry/grpc_plugin_registry.cc",
- "src/core/tsi/alts/crypt/aes_gcm.cc",
- "src/core/tsi/alts/crypt/gsec.cc",
- "src/core/tsi/alts/crypt/gsec.h",
- "src/core/tsi/alts/frame_protector/alts_counter.cc",
- "src/core/tsi/alts/frame_protector/alts_counter.h",
- "src/core/tsi/alts/frame_protector/alts_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_crypter.h",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.cc",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.h",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h",
- "src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/frame_handler.cc",
- "src/core/tsi/alts/frame_protector/frame_handler.h",
- "src/core/tsi/alts/handshaker/alts_handshaker_client.cc",
- "src/core/tsi/alts/handshaker/alts_handshaker_client.h",
- "src/core/tsi/alts/handshaker/alts_shared_resource.cc",
- "src/core/tsi/alts/handshaker/alts_shared_resource.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.h",
- "src/core/tsi/alts/handshaker/transport_security_common_api.cc",
- "src/core/tsi/alts/handshaker/transport_security_common_api.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h",
- "src/core/tsi/fake_transport_security.cc",
- "src/core/tsi/fake_transport_security.h",
- "src/core/tsi/local_transport_security.cc",
- "src/core/tsi/local_transport_security.h",
- "src/core/tsi/ssl/session_cache/ssl_session.h",
- "src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.h",
- "src/core/tsi/ssl/session_cache/ssl_session_openssl.cc",
- "src/core/tsi/ssl_transport_security.cc",
- "src/core/tsi/ssl_transport_security.h",
- "src/core/tsi/ssl_types.h",
- "src/core/tsi/transport_security.cc",
- "src/core/tsi/transport_security.h",
- "src/core/tsi/transport_security_grpc.cc",
- "src/core/tsi/transport_security_grpc.h",
- "src/core/tsi/transport_security_interface.h",
- "third_party/xxhash/xxhash.h",
- ]
- deps = [
- "//third_party/zlib",
- ":absl/container:flat_hash_map",
- ":absl/container:inlined_vector",
- ":absl/functional:bind_front",
- ":absl/status:statusor",
- ":gpr",
- "//third_party/boringssl",
- ":address_sorting",
- "//third_party/cares",
- ":address_sorting",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- include_dirs = [
- "third_party/cares",
- "third_party/address_sorting/include",
- ]
- }
-
-
-
- source_set("grpc++") {
- sources = [
- "include/grpc++/alarm.h",
- "include/grpc++/channel.h",
- "include/grpc++/client_context.h",
- "include/grpc++/completion_queue.h",
- "include/grpc++/create_channel.h",
- "include/grpc++/create_channel_posix.h",
- "include/grpc++/ext/health_check_service_server_builder_option.h",
- "include/grpc++/generic/async_generic_service.h",
- "include/grpc++/generic/generic_stub.h",
- "include/grpc++/grpc++.h",
- "include/grpc++/health_check_service_interface.h",
- "include/grpc++/impl/call.h",
- "include/grpc++/impl/channel_argument_option.h",
- "include/grpc++/impl/client_unary_call.h",
- "include/grpc++/impl/codegen/async_stream.h",
- "include/grpc++/impl/codegen/async_unary_call.h",
- "include/grpc++/impl/codegen/byte_buffer.h",
- "include/grpc++/impl/codegen/call.h",
- "include/grpc++/impl/codegen/call_hook.h",
- "include/grpc++/impl/codegen/channel_interface.h",
- "include/grpc++/impl/codegen/client_context.h",
- "include/grpc++/impl/codegen/client_unary_call.h",
- "include/grpc++/impl/codegen/completion_queue.h",
- "include/grpc++/impl/codegen/completion_queue_tag.h",
- "include/grpc++/impl/codegen/config.h",
- "include/grpc++/impl/codegen/config_protobuf.h",
- "include/grpc++/impl/codegen/core_codegen.h",
- "include/grpc++/impl/codegen/core_codegen_interface.h",
- "include/grpc++/impl/codegen/create_auth_context.h",
- "include/grpc++/impl/codegen/grpc_library.h",
- "include/grpc++/impl/codegen/metadata_map.h",
- "include/grpc++/impl/codegen/method_handler_impl.h",
- "include/grpc++/impl/codegen/proto_utils.h",
- "include/grpc++/impl/codegen/rpc_method.h",
- "include/grpc++/impl/codegen/rpc_service_method.h",
- "include/grpc++/impl/codegen/security/auth_context.h",
- "include/grpc++/impl/codegen/serialization_traits.h",
- "include/grpc++/impl/codegen/server_context.h",
- "include/grpc++/impl/codegen/server_interface.h",
- "include/grpc++/impl/codegen/service_type.h",
- "include/grpc++/impl/codegen/slice.h",
- "include/grpc++/impl/codegen/status.h",
- "include/grpc++/impl/codegen/status_code_enum.h",
- "include/grpc++/impl/codegen/string_ref.h",
- "include/grpc++/impl/codegen/stub_options.h",
- "include/grpc++/impl/codegen/sync_stream.h",
- "include/grpc++/impl/codegen/time.h",
- "include/grpc++/impl/grpc_library.h",
- "include/grpc++/impl/method_handler_impl.h",
- "include/grpc++/impl/rpc_method.h",
- "include/grpc++/impl/rpc_service_method.h",
- "include/grpc++/impl/serialization_traits.h",
- "include/grpc++/impl/server_builder_option.h",
- "include/grpc++/impl/server_builder_plugin.h",
- "include/grpc++/impl/server_initializer.h",
- "include/grpc++/impl/service_type.h",
- "include/grpc++/resource_quota.h",
- "include/grpc++/security/auth_context.h",
- "include/grpc++/security/auth_metadata_processor.h",
- "include/grpc++/security/credentials.h",
- "include/grpc++/security/server_credentials.h",
- "include/grpc++/server.h",
- "include/grpc++/server_builder.h",
- "include/grpc++/server_context.h",
- "include/grpc++/server_posix.h",
- "include/grpc++/support/async_stream.h",
- "include/grpc++/support/async_unary_call.h",
- "include/grpc++/support/byte_buffer.h",
- "include/grpc++/support/channel_arguments.h",
- "include/grpc++/support/config.h",
- "include/grpc++/support/slice.h",
- "include/grpc++/support/status.h",
- "include/grpc++/support/status_code_enum.h",
- "include/grpc++/support/string_ref.h",
- "include/grpc++/support/stub_options.h",
- "include/grpc++/support/sync_stream.h",
- "include/grpc++/support/time.h",
- "include/grpcpp/alarm.h",
- "include/grpcpp/channel.h",
- "include/grpcpp/client_context.h",
- "include/grpcpp/completion_queue.h",
- "include/grpcpp/create_channel.h",
- "include/grpcpp/create_channel_posix.h",
- "include/grpcpp/ext/health_check_service_server_builder_option.h",
- "include/grpcpp/generic/async_generic_service.h",
- "include/grpcpp/generic/generic_stub.h",
- "include/grpcpp/grpcpp.h",
- "include/grpcpp/health_check_service_interface.h",
- "include/grpcpp/impl/call.h",
- "include/grpcpp/impl/channel_argument_option.h",
- "include/grpcpp/impl/client_unary_call.h",
- "include/grpcpp/impl/codegen/async_generic_service.h",
- "include/grpcpp/impl/codegen/async_stream.h",
- "include/grpcpp/impl/codegen/async_unary_call.h",
- "include/grpcpp/impl/codegen/byte_buffer.h",
- "include/grpcpp/impl/codegen/call.h",
- "include/grpcpp/impl/codegen/call_hook.h",
- "include/grpcpp/impl/codegen/call_op_set.h",
- "include/grpcpp/impl/codegen/call_op_set_interface.h",
- "include/grpcpp/impl/codegen/callback_common.h",
- "include/grpcpp/impl/codegen/channel_interface.h",
- "include/grpcpp/impl/codegen/client_callback.h",
- "include/grpcpp/impl/codegen/client_context.h",
- "include/grpcpp/impl/codegen/client_interceptor.h",
- "include/grpcpp/impl/codegen/client_unary_call.h",
- "include/grpcpp/impl/codegen/completion_queue.h",
- "include/grpcpp/impl/codegen/completion_queue_tag.h",
- "include/grpcpp/impl/codegen/config.h",
- "include/grpcpp/impl/codegen/config_protobuf.h",
- "include/grpcpp/impl/codegen/core_codegen.h",
- "include/grpcpp/impl/codegen/core_codegen_interface.h",
- "include/grpcpp/impl/codegen/create_auth_context.h",
- "include/grpcpp/impl/codegen/delegating_channel.h",
- "include/grpcpp/impl/codegen/grpc_library.h",
- "include/grpcpp/impl/codegen/intercepted_channel.h",
- "include/grpcpp/impl/codegen/interceptor.h",
- "include/grpcpp/impl/codegen/interceptor_common.h",
- "include/grpcpp/impl/codegen/message_allocator.h",
- "include/grpcpp/impl/codegen/metadata_map.h",
- "include/grpcpp/impl/codegen/method_handler.h",
- "include/grpcpp/impl/codegen/method_handler_impl.h",
- "include/grpcpp/impl/codegen/proto_buffer_reader.h",
- "include/grpcpp/impl/codegen/proto_buffer_writer.h",
- "include/grpcpp/impl/codegen/proto_utils.h",
- "include/grpcpp/impl/codegen/rpc_method.h",
- "include/grpcpp/impl/codegen/rpc_service_method.h",
- "include/grpcpp/impl/codegen/security/auth_context.h",
- "include/grpcpp/impl/codegen/serialization_traits.h",
- "include/grpcpp/impl/codegen/server_callback.h",
- "include/grpcpp/impl/codegen/server_callback_handlers.h",
- "include/grpcpp/impl/codegen/server_context.h",
- "include/grpcpp/impl/codegen/server_interceptor.h",
- "include/grpcpp/impl/codegen/server_interface.h",
- "include/grpcpp/impl/codegen/service_type.h",
- "include/grpcpp/impl/codegen/slice.h",
- "include/grpcpp/impl/codegen/status.h",
- "include/grpcpp/impl/codegen/status_code_enum.h",
- "include/grpcpp/impl/codegen/string_ref.h",
- "include/grpcpp/impl/codegen/stub_options.h",
- "include/grpcpp/impl/codegen/sync.h",
- "include/grpcpp/impl/codegen/sync_stream.h",
- "include/grpcpp/impl/codegen/time.h",
- "include/grpcpp/impl/grpc_library.h",
- "include/grpcpp/impl/method_handler_impl.h",
- "include/grpcpp/impl/rpc_method.h",
- "include/grpcpp/impl/rpc_service_method.h",
- "include/grpcpp/impl/serialization_traits.h",
- "include/grpcpp/impl/server_builder_option.h",
- "include/grpcpp/impl/server_builder_plugin.h",
- "include/grpcpp/impl/server_initializer.h",
- "include/grpcpp/impl/service_type.h",
- "include/grpcpp/resource_quota.h",
- "include/grpcpp/security/auth_context.h",
- "include/grpcpp/security/auth_metadata_processor.h",
- "include/grpcpp/security/credentials.h",
- "include/grpcpp/security/server_credentials.h",
- "include/grpcpp/security/tls_certificate_provider.h",
- "include/grpcpp/security/tls_credentials_options.h",
- "include/grpcpp/server.h",
- "include/grpcpp/server_builder.h",
- "include/grpcpp/server_context.h",
- "include/grpcpp/server_posix.h",
- "include/grpcpp/support/async_stream.h",
- "include/grpcpp/support/async_unary_call.h",
- "include/grpcpp/support/byte_buffer.h",
- "include/grpcpp/support/channel_arguments.h",
- "include/grpcpp/support/client_callback.h",
- "include/grpcpp/support/client_interceptor.h",
- "include/grpcpp/support/config.h",
- "include/grpcpp/support/interceptor.h",
- "include/grpcpp/support/message_allocator.h",
- "include/grpcpp/support/method_handler.h",
- "include/grpcpp/support/proto_buffer_reader.h",
- "include/grpcpp/support/proto_buffer_writer.h",
- "include/grpcpp/support/server_callback.h",
- "include/grpcpp/support/server_interceptor.h",
- "include/grpcpp/support/slice.h",
- "include/grpcpp/support/status.h",
- "include/grpcpp/support/status_code_enum.h",
- "include/grpcpp/support/string_ref.h",
- "include/grpcpp/support/stub_options.h",
- "include/grpcpp/support/sync_stream.h",
- "include/grpcpp/support/time.h",
- "include/grpcpp/support/validate_service_config.h",
- "include/grpcpp/xds_server_builder.h",
- "src/cpp/client/channel_cc.cc",
- "src/cpp/client/client_callback.cc",
- "src/cpp/client/client_context.cc",
- "src/cpp/client/client_interceptor.cc",
- "src/cpp/client/create_channel.cc",
- "src/cpp/client/create_channel_internal.cc",
- "src/cpp/client/create_channel_internal.h",
- "src/cpp/client/create_channel_posix.cc",
- "src/cpp/client/credentials_cc.cc",
- "src/cpp/client/insecure_credentials.cc",
- "src/cpp/client/secure_credentials.cc",
- "src/cpp/client/secure_credentials.h",
- "src/cpp/client/xds_credentials.cc",
- "src/cpp/codegen/codegen_init.cc",
- "src/cpp/common/alarm.cc",
- "src/cpp/common/auth_property_iterator.cc",
- "src/cpp/common/channel_arguments.cc",
- "src/cpp/common/channel_filter.cc",
- "src/cpp/common/channel_filter.h",
- "src/cpp/common/completion_queue_cc.cc",
- "src/cpp/common/core_codegen.cc",
- "src/cpp/common/resource_quota_cc.cc",
- "src/cpp/common/rpc_method.cc",
- "src/cpp/common/secure_auth_context.cc",
- "src/cpp/common/secure_auth_context.h",
- "src/cpp/common/secure_channel_arguments.cc",
- "src/cpp/common/secure_create_auth_context.cc",
- "src/cpp/common/tls_certificate_provider.cc",
- "src/cpp/common/tls_credentials_options.cc",
- "src/cpp/common/tls_credentials_options_util.cc",
- "src/cpp/common/tls_credentials_options_util.h",
- "src/cpp/common/validate_service_config.cc",
- "src/cpp/common/version_cc.cc",
- "src/cpp/server/async_generic_service.cc",
- "src/cpp/server/channel_argument_option.cc",
- "src/cpp/server/create_default_thread_pool.cc",
- "src/cpp/server/dynamic_thread_pool.cc",
- "src/cpp/server/dynamic_thread_pool.h",
- "src/cpp/server/external_connection_acceptor_impl.cc",
- "src/cpp/server/external_connection_acceptor_impl.h",
- "src/cpp/server/health/default_health_check_service.cc",
- "src/cpp/server/health/default_health_check_service.h",
- "src/cpp/server/health/health_check_service.cc",
- "src/cpp/server/health/health_check_service_server_builder_option.cc",
- "src/cpp/server/insecure_server_credentials.cc",
- "src/cpp/server/secure_server_credentials.cc",
- "src/cpp/server/secure_server_credentials.h",
- "src/cpp/server/server_builder.cc",
- "src/cpp/server/server_callback.cc",
- "src/cpp/server/server_cc.cc",
- "src/cpp/server/server_context.cc",
- "src/cpp/server/server_credentials.cc",
- "src/cpp/server/server_posix.cc",
- "src/cpp/server/thread_pool_interface.h",
- "src/cpp/server/xds_server_credentials.cc",
- "src/cpp/thread_manager/thread_manager.cc",
- "src/cpp/thread_manager/thread_manager.h",
- "src/cpp/util/byte_buffer_cc.cc",
- "src/cpp/util/status.cc",
- "src/cpp/util/string_ref.cc",
- "src/cpp/util/time_cc.cc",
- ]
- deps = [
- "//third_party/protobuf:protobuf_lite",
- ":grpc",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
- # Only compile the plugin for the host architecture.
- if (current_toolchain == host_toolchain) {
-
-
- source_set("grpc_plugin_support") {
- sources = [
- "include/grpc++/impl/codegen/config_protobuf.h",
- "include/grpcpp/impl/codegen/config_protobuf.h",
- "src/compiler/config.h",
- "src/compiler/config_protobuf.h",
- "src/compiler/cpp_generator.cc",
- "src/compiler/cpp_generator.h",
- "src/compiler/cpp_generator_helpers.h",
- "src/compiler/cpp_plugin.h",
- "src/compiler/csharp_generator.cc",
- "src/compiler/csharp_generator.h",
- "src/compiler/csharp_generator_helpers.h",
- "src/compiler/generator_helpers.h",
- "src/compiler/node_generator.cc",
- "src/compiler/node_generator.h",
- "src/compiler/node_generator_helpers.h",
- "src/compiler/objective_c_generator.cc",
- "src/compiler/objective_c_generator.h",
- "src/compiler/objective_c_generator_helpers.h",
- "src/compiler/php_generator.cc",
- "src/compiler/php_generator.h",
- "src/compiler/php_generator_helpers.h",
- "src/compiler/protobuf_plugin.h",
- "src/compiler/python_generator.cc",
- "src/compiler/python_generator.h",
- "src/compiler/python_generator_helpers.h",
- "src/compiler/python_private_generator.h",
- "src/compiler/schema_interface.h",
- ]
- deps = [
- "//third_party/protobuf:protoc_lib",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
- }
- # Only compile the plugin for the host architecture.
- if (current_toolchain == host_toolchain) {
-
- executable("grpc_cpp_plugin") {
- sources = [
- "src/compiler/cpp_plugin.cc",
- ]
- deps = [
- "//third_party/protobuf:protoc_lib",
- ":grpc_plugin_support",
- ]
-
- configs += [
- "//third_party/protobuf:protobuf_config",
- ]
- public_configs = [ ":grpc_config" ]
- }
-
- }
-
-
diff --git a/grpc/BUILDING.md b/grpc/BUILDING.md
index 4a69c3b7..80dadc64 100644
--- a/grpc/BUILDING.md
+++ b/grpc/BUILDING.md
@@ -20,7 +20,7 @@ If you plan to build using CMake
If you are a contributor and plan to build and run tests, install the following as well:
```sh
$ # clang and LLVM C++ lib is only required for sanitizer builds
- $ [sudo] apt-get install clang-5.0 libc++-dev
+ $ [sudo] apt-get install clang libc++-dev
```
## MacOS
@@ -269,10 +269,10 @@ $ make
### A note on `protoc`
-By default gRPC uses [protocol buffers](https://github.com/google/protobuf),
+By default gRPC uses [protocol buffers](https://github.com/protocolbuffers/protobuf),
you will need the `protoc` compiler to generate stub server and client code.
-If you compile gRPC from source, as described below, the Makefile will
+If you compile gRPC from source, as described above, the Makefile will
automatically try compiling the `protoc` in third_party if you cloned the
repository recursively and it detects that you do not already have 'protoc' compiler
installed.
diff --git a/grpc/CMakeLists.txt b/grpc/CMakeLists.txt
index 103df28a..63f17b2b 100644
--- a/grpc/CMakeLists.txt
+++ b/grpc/CMakeLists.txt
@@ -25,13 +25,13 @@
cmake_minimum_required(VERSION 3.5.1)
set(PACKAGE_NAME "grpc")
-set(PACKAGE_VERSION "1.38.0")
-set(gRPC_CORE_VERSION "16.0.0")
-set(gRPC_CORE_SOVERSION "16")
-set(gRPC_CPP_VERSION "1.38.0")
-set(gRPC_CPP_SOVERSION "1.38")
-set(gRPC_CSHARP_VERSION "2.38.0")
-set(gRPC_CSHARP_SOVERSION "2.38")
+set(PACKAGE_VERSION "1.46.5")
+set(gRPC_CORE_VERSION "24.0.0")
+set(gRPC_CORE_SOVERSION "24")
+set(gRPC_CPP_VERSION "1.46.5")
+set(gRPC_CPP_SOVERSION "1.46")
+set(gRPC_CSHARP_VERSION "2.46.5")
+set(gRPC_CSHARP_SOVERSION "2.46")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
@@ -42,6 +42,7 @@ set(gRPC_INSTALL_LIBDIR "lib" CACHE STRING "Installation directory for libraries
set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers")
set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation directory for cmake config files")
set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for root certificates")
+set(gRPC_BUILD_MSVC_MP_COUNT 0 CACHE STRING "The maximum number of processes for MSVC /MP option")
# Options
option(gRPC_BUILD_TESTS "Build tests" OFF)
@@ -114,6 +115,13 @@ set(gRPC_ABSL_USED_TARGETS
absl_container_common
absl_container_memory
absl_cord
+ absl_cord_internal
+ absl_cordz_functions
+ absl_cordz_handle
+ absl_cordz_info
+ absl_cordz_statistics
+ absl_cordz_update_scope
+ absl_cordz_update_tracker
absl_core_headers
absl_debugging_internal
absl_demangle_internal
@@ -121,6 +129,7 @@ set(gRPC_ABSL_USED_TARGETS
absl_endian
absl_errno_saver
absl_exponential_biased
+ absl_fast_type_id
absl_fixed_array
absl_flat_hash_map
absl_function_ref
@@ -137,13 +146,38 @@ set(gRPC_ABSL_USED_TARGETS
absl_kernel_timeout_internal
absl_layout
absl_log_severity
+ absl_low_level_hash
absl_malloc_internal
absl_memory
absl_numeric_representation
absl_optional
+ absl_random_distributions
+ absl_random_internal_distribution_caller
+ absl_random_internal_fast_uniform_bits
+ absl_random_internal_fastmath
+ absl_random_internal_generate_real
+ absl_random_internal_iostream_state_saver
+ absl_random_internal_nonsecure_base
+ absl_random_internal_pcg_engine
+ absl_random_internal_platform
+ absl_random_internal_pool_urbg
+ absl_random_internal_randen
+ absl_random_internal_randen_engine
+ absl_random_internal_randen_hwaes
+ absl_random_internal_randen_hwaes_impl
+ absl_random_internal_randen_slow
+ absl_random_internal_salted_seed_seq
+ absl_random_internal_seed_material
+ absl_random_internal_traits
+ absl_random_internal_uniform_helper
+ absl_random_internal_wide_multiply
+ absl_random_random
+ absl_random_seed_gen_exception
+ absl_random_seed_sequences
absl_raw_hash_map
absl_raw_hash_set
absl_raw_logging_internal
+ absl_sample_recorder
absl_span
absl_spinlock_wait
absl_stacktrace
@@ -161,7 +195,6 @@ set(gRPC_ABSL_USED_TARGETS
absl_type_traits
absl_utility
absl_variant
- absl_wyhash
absl_meta
)
@@ -212,6 +245,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
if(MSVC)
include(cmake/msvc_static_runtime.cmake)
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
+ # Set /MP option
+ if (gRPC_BUILD_MSVC_MP_COUNT GREATER 0)
+ set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /MP${gRPC_BUILD_MSVC_MP_COUNT}")
+ elseif (gRPC_BUILD_MSVC_MP_COUNT LESS 0)
+ set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /MP")
+ endif()
# needed to compile protobuf
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4065 /wd4506")
# TODO(jtattermusch): revisit warnings that were silenced as part of upgrade to protobuf3.6.0
@@ -220,6 +259,10 @@ if(MSVC)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
+ # Silences thousands of trucation warnings
+ set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4503")
+ # Tell MSVC to build grpc using utf-8
+ set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /utf-8")
endif()
if (MINGW)
add_definitions(-D_WIN32_WINNT=0x600)
@@ -248,6 +291,25 @@ else()
set(_gRPC_CORE_NOSTDCXX_FLAGS "")
endif()
+if (gRPC_XDS_USER_AGENT_IS_CSHARP)
+ # The value of the defines needs to contain quotes.
+ # See https://github.com/grpc/grpc/blob/fbf32836a418cc84f58786700273b65cb9174e1d/src/core/ext/xds/xds_api.cc#L854
+ add_definitions("-DGRPC_XDS_USER_AGENT_NAME_SUFFIX=\"csharp\"" "-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX=\"2.46.5\"")
+endif()
+
+if(UNIX)
+ # -pthread does more than -lpthread
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads)
+ set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m Threads::Threads)
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
+ set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} rt)
+ endif()
+endif()
+
+# configure ccache if requested
+include(cmake/ccache.cmake)
+
include(cmake/abseil-cpp.cmake)
include(cmake/address_sorting.cmake)
include(cmake/benchmark.cmake)
@@ -259,16 +321,8 @@ include(cmake/upb.cmake)
include(cmake/xxhash.cmake)
include(cmake/zlib.cmake)
-if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS)
- set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)
-elseif(_gRPC_PLATFORM_ANDROID)
- set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m)
-elseif(UNIX)
- set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)
-endif()
-
if(WIN32)
- set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32)
+ set(_gRPC_BASELIB_LIBRARIES ws2_32 crypt32)
endif()
# Create directory for generated .proto files
@@ -319,7 +373,7 @@ function(protobuf_generate_grpc_cpp)
--plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN}
${_protobuf_include_path}
${REL_FIL}
- DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin
+ DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} ${_gRPC_CPP_PLUGIN}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running gRPC C++ protocol buffer compiler on ${FIL}"
VERBATIM)
@@ -365,14 +419,11 @@ add_custom_target(plugins
add_custom_target(tools_c
DEPENDS
- check_epollexclusive
)
add_custom_target(tools_cxx
DEPENDS
gen_hpack_tables
- gen_legal_metadata_characters
- gen_percent_encoding_tables
)
add_custom_target(tools
@@ -391,6 +442,12 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/lb/v1/load_balancer.proto
)
protobuf_generate_grpc_cpp(
+ src/proto/grpc/lookup/v1/rls.proto
+)
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/lookup/v1/rls_config.proto
+)
+protobuf_generate_grpc_cpp(
src/proto/grpc/reflection/v1alpha/reflection.proto
)
protobuf_generate_grpc_cpp(
@@ -451,9 +508,6 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/lrs_for_test.proto
)
protobuf_generate_grpc_cpp(
- src/proto/grpc/testing/xds/orca_load_report_for_test.proto
-)
-protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/address.proto
)
protobuf_generate_grpc_cpp(
@@ -484,6 +538,12 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/endpoint.proto
)
protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/expr.proto
+)
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/extension.proto
+)
+protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/fault.proto
)
protobuf_generate_grpc_cpp(
@@ -493,6 +553,9 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/http_connection_manager.proto
)
protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/http_filter_rbac.proto
+)
+protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/listener.proto
)
protobuf_generate_grpc_cpp(
@@ -502,6 +565,18 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/lrs.proto
)
protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/metadata.proto
+)
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/orca_load_report.proto
+)
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/orca_service.proto
+)
+protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/path.proto
+)
+protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/percent.proto
)
protobuf_generate_grpc_cpp(
@@ -511,6 +586,9 @@ protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/range.proto
)
protobuf_generate_grpc_cpp(
+ src/proto/grpc/testing/xds/v3/rbac.proto
+)
+protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/regex.proto
)
protobuf_generate_grpc_cpp(
@@ -534,7 +612,6 @@ protobuf_generate_grpc_cpp(
if(gRPC_BUILD_TESTS)
add_custom_target(buildtests_c)
- add_dependencies(buildtests_c algorithm_test)
add_dependencies(buildtests_c alloc_test)
add_dependencies(buildtests_c alpn_test)
add_dependencies(buildtests_c alts_counter_test)
@@ -550,7 +627,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c alts_zero_copy_grpc_protector_test)
add_dependencies(buildtests_c arena_test)
add_dependencies(buildtests_c auth_context_test)
- add_dependencies(buildtests_c avl_test)
add_dependencies(buildtests_c b64_test)
add_dependencies(buildtests_c bad_server_response_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -562,9 +638,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c bin_decoder_test)
add_dependencies(buildtests_c bin_encoder_test)
add_dependencies(buildtests_c buffer_list_test)
- add_dependencies(buildtests_c channel_args_test)
- add_dependencies(buildtests_c channel_create_test)
- add_dependencies(buildtests_c channel_stack_builder_test)
add_dependencies(buildtests_c channel_stack_test)
add_dependencies(buildtests_c check_gcp_environment_linux_test)
add_dependencies(buildtests_c check_gcp_environment_windows_test)
@@ -580,8 +653,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c concurrent_connectivity_test)
add_dependencies(buildtests_c connection_refused_test)
add_dependencies(buildtests_c cpu_test)
- add_dependencies(buildtests_c dns_resolver_connectivity_using_ares_test)
- add_dependencies(buildtests_c dns_resolver_connectivity_using_native_test)
add_dependencies(buildtests_c dns_resolver_cooldown_test)
add_dependencies(buildtests_c dns_resolver_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -589,10 +660,6 @@ if(gRPC_BUILD_TESTS)
endif()
add_dependencies(buildtests_c endpoint_pair_test)
add_dependencies(buildtests_c env_test)
- add_dependencies(buildtests_c error_test)
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_c ev_epollex_linux_test)
- endif()
add_dependencies(buildtests_c fake_resolver_test)
add_dependencies(buildtests_c fake_transport_security_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -620,20 +687,9 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c handshake_server_with_readahead_handshaker_test)
endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_c handshake_verify_peer_options_test)
- endif()
add_dependencies(buildtests_c histogram_test)
add_dependencies(buildtests_c host_port_test)
add_dependencies(buildtests_c hpack_encoder_test)
- add_dependencies(buildtests_c hpack_parser_test)
- add_dependencies(buildtests_c hpack_table_test)
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_c httpcli_test)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_c httpscli_test)
- endif()
add_dependencies(buildtests_c inproc_callback_test)
add_dependencies(buildtests_c invalid_call_argument_test)
add_dependencies(buildtests_c json_token_test)
@@ -641,8 +697,10 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c lame_client_test)
add_dependencies(buildtests_c load_file_test)
add_dependencies(buildtests_c manual_constructor_test)
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
+ add_dependencies(buildtests_c memory_quota_stress_test)
+ endif()
add_dependencies(buildtests_c message_compress_test)
- add_dependencies(buildtests_c metadata_test)
add_dependencies(buildtests_c minimal_stack_is_minimal_test)
add_dependencies(buildtests_c mpmcqueue_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -662,12 +720,9 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c resolve_address_using_ares_resolver_posix_test)
endif()
- add_dependencies(buildtests_c resolve_address_using_ares_resolver_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c resolve_address_using_native_resolver_posix_test)
endif()
- add_dependencies(buildtests_c resolve_address_using_native_resolver_test)
- add_dependencies(buildtests_c resource_quota_test)
add_dependencies(buildtests_c secure_channel_create_test)
add_dependencies(buildtests_c secure_endpoint_test)
add_dependencies(buildtests_c security_connector_test)
@@ -677,6 +732,7 @@ if(gRPC_BUILD_TESTS)
endif()
add_dependencies(buildtests_c server_test)
add_dependencies(buildtests_c slice_buffer_test)
+ add_dependencies(buildtests_c slice_split_test)
add_dependencies(buildtests_c slice_string_helpers_test)
add_dependencies(buildtests_c sockaddr_resolver_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -688,9 +744,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c ssl_transport_security_test)
endif()
add_dependencies(buildtests_c status_conversion_test)
- add_dependencies(buildtests_c stream_compression_test)
add_dependencies(buildtests_c stream_map_test)
- add_dependencies(buildtests_c stream_owned_slice_test)
add_dependencies(buildtests_c string_test)
add_dependencies(buildtests_c sync_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@@ -703,24 +757,17 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_c tcp_server_posix_test)
endif()
add_dependencies(buildtests_c test_core_gpr_time_test)
- add_dependencies(buildtests_c test_core_security_credentials_test)
- add_dependencies(buildtests_c test_core_slice_slice_test)
add_dependencies(buildtests_c thd_test)
add_dependencies(buildtests_c threadpool_test)
add_dependencies(buildtests_c time_averaged_stats_test)
- add_dependencies(buildtests_c timeout_encoding_test)
add_dependencies(buildtests_c timer_heap_test)
add_dependencies(buildtests_c timer_list_test)
- add_dependencies(buildtests_c tls_test)
add_dependencies(buildtests_c transport_security_common_api_test)
add_dependencies(buildtests_c transport_security_test)
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_c udp_server_test)
- endif()
- add_dependencies(buildtests_c useful_test)
add_dependencies(buildtests_c varint_test)
add_custom_target(buildtests_cxx)
+ add_dependencies(buildtests_cxx activity_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx address_sorting_test)
endif()
@@ -735,9 +782,12 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx alts_concurrent_connectivity_test)
endif()
add_dependencies(buildtests_cxx alts_util_test)
+ add_dependencies(buildtests_cxx arena_promise_test)
add_dependencies(buildtests_cxx async_end2end_test)
add_dependencies(buildtests_cxx auth_property_iterator_test)
add_dependencies(buildtests_cxx authorization_matchers_test)
+ add_dependencies(buildtests_cxx authorization_policy_provider_test)
+ add_dependencies(buildtests_cxx avl_test)
add_dependencies(buildtests_cxx aws_request_signer_test)
add_dependencies(buildtests_cxx backoff_test)
add_dependencies(buildtests_cxx bad_streaming_id_bad_client_test)
@@ -745,87 +795,37 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bdp_estimator_test)
endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_alarm)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_arena)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_byte_buffer)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_call_create)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_callback_streaming_ping_pong)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_callback_unary_ping_pong)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_channel)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_chttp2_hpack)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_chttp2_transport)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_closure)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_cq)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_cq_multiple_threads)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_error)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_fullstack_streaming_ping_pong)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_fullstack_streaming_pump)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_fullstack_trickle)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_fullstack_unary_ping_pong)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_metadata)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_pollset)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_threadpool)
- endif()
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx bm_timer)
- endif()
+ add_dependencies(buildtests_cxx binder_resolver_test)
+ add_dependencies(buildtests_cxx binder_server_test)
+ add_dependencies(buildtests_cxx binder_transport_test)
+ add_dependencies(buildtests_cxx bitset_test)
add_dependencies(buildtests_cxx byte_buffer_test)
add_dependencies(buildtests_cxx byte_stream_test)
+ add_dependencies(buildtests_cxx call_finalization_test)
+ add_dependencies(buildtests_cxx call_push_pull_test)
add_dependencies(buildtests_cxx cancel_ares_query_test)
+ add_dependencies(buildtests_cxx capture_test)
add_dependencies(buildtests_cxx cel_authorization_engine_test)
add_dependencies(buildtests_cxx certificate_provider_registry_test)
add_dependencies(buildtests_cxx certificate_provider_store_test)
add_dependencies(buildtests_cxx cfstream_test)
+ add_dependencies(buildtests_cxx channel_args_test)
add_dependencies(buildtests_cxx channel_arguments_test)
+ add_dependencies(buildtests_cxx channel_creds_registry_test)
add_dependencies(buildtests_cxx channel_filter_test)
+ add_dependencies(buildtests_cxx channel_stack_builder_test)
add_dependencies(buildtests_cxx channel_trace_test)
add_dependencies(buildtests_cxx channelz_registry_test)
add_dependencies(buildtests_cxx channelz_service_test)
add_dependencies(buildtests_cxx channelz_test)
+ add_dependencies(buildtests_cxx chunked_vector_test)
add_dependencies(buildtests_cxx cli_call_test)
+ add_dependencies(buildtests_cxx client_authority_filter_test)
add_dependencies(buildtests_cxx client_callback_end2end_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx client_channel_stress_test)
endif()
+ add_dependencies(buildtests_cxx client_context_test_peer_test)
add_dependencies(buildtests_cxx client_interceptors_end2end_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx client_lb_end2end_test)
@@ -836,33 +836,53 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx connectivity_state_test)
add_dependencies(buildtests_cxx context_allocator_end2end_test)
add_dependencies(buildtests_cxx context_list_test)
+ add_dependencies(buildtests_cxx context_test)
+ add_dependencies(buildtests_cxx core_configuration_test)
+ add_dependencies(buildtests_cxx cpp_impl_of_test)
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+ add_dependencies(buildtests_cxx crl_ssl_transport_security_test)
+ endif()
add_dependencies(buildtests_cxx delegating_channel_test)
add_dependencies(buildtests_cxx destroy_grpclb_channel_with_active_connect_stress_test)
add_dependencies(buildtests_cxx dual_ref_counted_test)
add_dependencies(buildtests_cxx duplicate_header_bad_client_test)
+ add_dependencies(buildtests_cxx end2end_binder_transport_test)
add_dependencies(buildtests_cxx end2end_test)
+ add_dependencies(buildtests_cxx endpoint_binder_pool_test)
+ add_dependencies(buildtests_cxx endpoint_config_test)
add_dependencies(buildtests_cxx error_details_test)
+ add_dependencies(buildtests_cxx error_test)
add_dependencies(buildtests_cxx error_utils_test)
add_dependencies(buildtests_cxx evaluate_args_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx examine_stack_test)
endif()
add_dependencies(buildtests_cxx exception_test)
+ add_dependencies(buildtests_cxx exec_ctx_wakeup_scheduler_test)
+ add_dependencies(buildtests_cxx fake_binder_test)
add_dependencies(buildtests_cxx file_watcher_certificate_provider_factory_test)
add_dependencies(buildtests_cxx filter_end2end_test)
add_dependencies(buildtests_cxx flaky_network_test)
+ add_dependencies(buildtests_cxx flow_control_test)
+ add_dependencies(buildtests_cxx for_each_test)
add_dependencies(buildtests_cxx generic_end2end_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx global_config_env_test)
endif()
add_dependencies(buildtests_cxx global_config_test)
+ add_dependencies(buildtests_cxx google_c2p_resolver_test)
add_dependencies(buildtests_cxx google_mesh_ca_certificate_provider_factory_test)
+ add_dependencies(buildtests_cxx graceful_shutdown_test)
add_dependencies(buildtests_cxx grpc_authorization_engine_test)
+ add_dependencies(buildtests_cxx grpc_authorization_policy_provider_test)
+ add_dependencies(buildtests_cxx grpc_authz_end2end_test)
add_dependencies(buildtests_cxx grpc_cli)
add_dependencies(buildtests_cxx grpc_tls_certificate_distributor_test)
add_dependencies(buildtests_cxx grpc_tls_certificate_provider_test)
+ add_dependencies(buildtests_cxx grpc_tls_certificate_verifier_test)
+ add_dependencies(buildtests_cxx grpc_tls_credentials_options_comparator_test)
add_dependencies(buildtests_cxx grpc_tls_credentials_options_test)
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx grpc_tool_test)
endif()
add_dependencies(buildtests_cxx grpclb_api_test)
@@ -873,45 +893,76 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx head_of_line_blocking_bad_client_test)
add_dependencies(buildtests_cxx headers_bad_client_test)
add_dependencies(buildtests_cxx health_service_end2end_test)
+ add_dependencies(buildtests_cxx hpack_parser_table_test)
+ add_dependencies(buildtests_cxx hpack_parser_test)
add_dependencies(buildtests_cxx http2_client)
+ add_dependencies(buildtests_cxx http_proxy_mapper_test)
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+ add_dependencies(buildtests_cxx httpcli_test)
+ endif()
+ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+ add_dependencies(buildtests_cxx httpscli_test)
+ endif()
add_dependencies(buildtests_cxx hybrid_end2end_test)
+ add_dependencies(buildtests_cxx idle_filter_state_test)
+ add_dependencies(buildtests_cxx if_test)
add_dependencies(buildtests_cxx init_test)
add_dependencies(buildtests_cxx initial_settings_frame_bad_client_test)
add_dependencies(buildtests_cxx insecure_security_connector_test)
add_dependencies(buildtests_cxx interop_client)
add_dependencies(buildtests_cxx interop_server)
- if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_dependencies(buildtests_cxx interop_test)
- endif()
+ add_dependencies(buildtests_cxx join_test)
add_dependencies(buildtests_cxx json_test)
add_dependencies(buildtests_cxx large_metadata_bad_client_test)
+ add_dependencies(buildtests_cxx latch_test)
add_dependencies(buildtests_cxx lb_get_cpu_stats_test)
add_dependencies(buildtests_cxx lb_load_data_store_test)
add_dependencies(buildtests_cxx linux_system_roots_test)
add_dependencies(buildtests_cxx log_test)
+ add_dependencies(buildtests_cxx loop_test)
+ add_dependencies(buildtests_cxx match_test)
add_dependencies(buildtests_cxx matchers_test)
+ add_dependencies(buildtests_cxx memory_quota_test)
add_dependencies(buildtests_cxx message_allocator_end2end_test)
+ add_dependencies(buildtests_cxx metadata_map_test)
+ add_dependencies(buildtests_cxx miscompile_with_no_unique_address_test)
add_dependencies(buildtests_cxx mock_stream_test)
add_dependencies(buildtests_cxx mock_test)
add_dependencies(buildtests_cxx nonblocking_test)
- add_dependencies(buildtests_cxx noop-benchmark)
+ add_dependencies(buildtests_cxx observable_test)
+ add_dependencies(buildtests_cxx orca_service_end2end_test)
add_dependencies(buildtests_cxx orphanable_test)
add_dependencies(buildtests_cxx out_of_bounds_bad_client_test)
+ add_dependencies(buildtests_cxx overload_test)
+ add_dependencies(buildtests_cxx parsed_metadata_test)
add_dependencies(buildtests_cxx pid_controller_test)
+ add_dependencies(buildtests_cxx pipe_test)
+ add_dependencies(buildtests_cxx poll_test)
add_dependencies(buildtests_cxx port_sharing_end2end_test)
+ add_dependencies(buildtests_cxx promise_factory_test)
+ add_dependencies(buildtests_cxx promise_map_test)
+ add_dependencies(buildtests_cxx promise_test)
add_dependencies(buildtests_cxx proto_server_reflection_test)
add_dependencies(buildtests_cxx proto_utils_test)
add_dependencies(buildtests_cxx qps_json_driver)
add_dependencies(buildtests_cxx qps_worker)
+ add_dependencies(buildtests_cxx race_test)
add_dependencies(buildtests_cxx raw_end2end_test)
+ add_dependencies(buildtests_cxx rbac_service_config_parser_test)
add_dependencies(buildtests_cxx rbac_translator_test)
add_dependencies(buildtests_cxx ref_counted_ptr_test)
add_dependencies(buildtests_cxx ref_counted_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx remove_stream_from_stalled_lists_test)
endif()
+ add_dependencies(buildtests_cxx resolve_address_using_ares_resolver_test)
+ add_dependencies(buildtests_cxx resolve_address_using_native_resolver_test)
+ add_dependencies(buildtests_cxx resource_quota_test)
add_dependencies(buildtests_cxx retry_throttle_test)
+ add_dependencies(buildtests_cxx rls_end2end_test)
+ add_dependencies(buildtests_cxx rls_lb_config_parser_test)
add_dependencies(buildtests_cxx secure_auth_context_test)
+ add_dependencies(buildtests_cxx seq_test)
add_dependencies(buildtests_cxx server_builder_plugin_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx server_builder_test)
@@ -920,6 +971,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx server_builder_with_socket_mutator_test)
endif()
add_dependencies(buildtests_cxx server_chttp2_test)
+ add_dependencies(buildtests_cxx server_config_selector_test)
add_dependencies(buildtests_cxx server_context_test_spouse_test)
add_dependencies(buildtests_cxx server_early_return_test)
add_dependencies(buildtests_cxx server_interceptors_end2end_test)
@@ -932,15 +984,16 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx settings_timeout_test)
add_dependencies(buildtests_cxx shutdown_test)
add_dependencies(buildtests_cxx simple_request_bad_client_test)
+ add_dependencies(buildtests_cxx single_set_ptr_test)
+ add_dependencies(buildtests_cxx sleep_test)
+ add_dependencies(buildtests_cxx smoke_test)
add_dependencies(buildtests_cxx sockaddr_utils_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx stack_tracer_test)
endif()
add_dependencies(buildtests_cxx stat_test)
- add_dependencies(buildtests_cxx static_metadata_test)
add_dependencies(buildtests_cxx stats_test)
add_dependencies(buildtests_cxx status_helper_test)
- add_dependencies(buildtests_cxx status_metadata_test)
add_dependencies(buildtests_cxx status_util_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx stranded_event_test)
@@ -948,12 +1001,18 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx streaming_throughput_test)
endif()
+ add_dependencies(buildtests_cxx streams_not_seen_test)
add_dependencies(buildtests_cxx string_ref_test)
+ add_dependencies(buildtests_cxx table_test)
+ add_dependencies(buildtests_cxx test_core_gprpp_time_test)
+ add_dependencies(buildtests_cxx test_core_security_credentials_test)
+ add_dependencies(buildtests_cxx test_core_slice_slice_test)
add_dependencies(buildtests_cxx test_cpp_client_credentials_test)
add_dependencies(buildtests_cxx test_cpp_server_credentials_test)
add_dependencies(buildtests_cxx test_cpp_util_slice_test)
add_dependencies(buildtests_cxx test_cpp_util_time_test)
add_dependencies(buildtests_cxx thread_manager_test)
+ add_dependencies(buildtests_cxx thread_quota_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx thread_stress_test)
endif()
@@ -961,12 +1020,23 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx time_jump_test)
endif()
add_dependencies(buildtests_cxx time_util_test)
+ add_dependencies(buildtests_cxx timeout_encoding_test)
add_dependencies(buildtests_cxx timer_test)
+ add_dependencies(buildtests_cxx tls_certificate_verifier_test)
+ add_dependencies(buildtests_cxx tls_key_export_test)
add_dependencies(buildtests_cxx tls_security_connector_test)
+ add_dependencies(buildtests_cxx tls_test)
add_dependencies(buildtests_cxx too_many_pings_test)
+ add_dependencies(buildtests_cxx transport_stream_receiver_test)
+ add_dependencies(buildtests_cxx try_join_test)
+ add_dependencies(buildtests_cxx try_seq_metadata_test)
+ add_dependencies(buildtests_cxx try_seq_test)
add_dependencies(buildtests_cxx unknown_frame_bad_client_test)
add_dependencies(buildtests_cxx uri_parser_test)
+ add_dependencies(buildtests_cxx useful_test)
add_dependencies(buildtests_cxx window_overflow_bad_client_test)
+ add_dependencies(buildtests_cxx wire_reader_test)
+ add_dependencies(buildtests_cxx wire_writer_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx work_serializer_test)
endif()
@@ -982,19 +1052,6 @@ if(gRPC_BUILD_TESTS)
endif()
add_dependencies(buildtests_cxx xds_interop_client)
add_dependencies(buildtests_cxx xds_interop_server)
- add_dependencies(buildtests_cxx alts_credentials_fuzzer_one_entry)
- add_dependencies(buildtests_cxx client_fuzzer_one_entry)
- add_dependencies(buildtests_cxx hpack_parser_fuzzer_test_one_entry)
- add_dependencies(buildtests_cxx http_request_fuzzer_test_one_entry)
- add_dependencies(buildtests_cxx http_response_fuzzer_test_one_entry)
- add_dependencies(buildtests_cxx json_fuzzer_test_one_entry)
- add_dependencies(buildtests_cxx nanopb_fuzzer_response_test_one_entry)
- add_dependencies(buildtests_cxx nanopb_fuzzer_serverlist_test_one_entry)
- add_dependencies(buildtests_cxx percent_decode_fuzzer_one_entry)
- add_dependencies(buildtests_cxx percent_encode_fuzzer_one_entry)
- add_dependencies(buildtests_cxx server_fuzzer_one_entry)
- add_dependencies(buildtests_cxx ssl_server_fuzzer_one_entry)
- add_dependencies(buildtests_cxx uri_fuzzer_test_one_entry)
add_custom_target(buildtests
DEPENDS buildtests_c buildtests_cxx)
@@ -1046,6 +1103,7 @@ target_link_libraries(address_sorting
if(gRPC_INSTALL)
install(TARGETS address_sorting EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -1053,140 +1111,10 @@ endif()
if(gRPC_BUILD_TESTS)
-add_library(end2end_nosec_tests
- test/core/end2end/cq_verifier.cc
- test/core/end2end/data/client_certs.cc
- test/core/end2end/data/server1_cert.cc
- test/core/end2end/data/server1_key.cc
- test/core/end2end/data/test_root_cert.cc
- test/core/end2end/end2end_nosec_tests.cc
- test/core/end2end/end2end_test_utils.cc
- test/core/end2end/fixtures/http_proxy_fixture.cc
- test/core/end2end/fixtures/local_util.cc
- test/core/end2end/fixtures/proxy.cc
- test/core/end2end/tests/authority_not_supported.cc
- test/core/end2end/tests/bad_hostname.cc
- test/core/end2end/tests/bad_ping.cc
- test/core/end2end/tests/binary_metadata.cc
- test/core/end2end/tests/call_host_override.cc
- test/core/end2end/tests/cancel_after_accept.cc
- test/core/end2end/tests/cancel_after_client_done.cc
- test/core/end2end/tests/cancel_after_invoke.cc
- test/core/end2end/tests/cancel_after_round_trip.cc
- test/core/end2end/tests/cancel_before_invoke.cc
- test/core/end2end/tests/cancel_in_a_vacuum.cc
- test/core/end2end/tests/cancel_with_status.cc
- test/core/end2end/tests/channelz.cc
- test/core/end2end/tests/client_streaming.cc
- test/core/end2end/tests/compressed_payload.cc
- test/core/end2end/tests/connectivity.cc
- test/core/end2end/tests/default_host.cc
- test/core/end2end/tests/disappearing_server.cc
- test/core/end2end/tests/empty_batch.cc
- test/core/end2end/tests/filter_causes_close.cc
- test/core/end2end/tests/filter_context.cc
- test/core/end2end/tests/filter_init_fails.cc
- test/core/end2end/tests/filter_latency.cc
- test/core/end2end/tests/filter_status_code.cc
- test/core/end2end/tests/graceful_server_shutdown.cc
- test/core/end2end/tests/high_initial_seqno.cc
- test/core/end2end/tests/hpack_size.cc
- test/core/end2end/tests/idempotent_request.cc
- test/core/end2end/tests/invoke_large_request.cc
- test/core/end2end/tests/keepalive_timeout.cc
- test/core/end2end/tests/large_metadata.cc
- test/core/end2end/tests/max_concurrent_streams.cc
- test/core/end2end/tests/max_connection_age.cc
- test/core/end2end/tests/max_connection_idle.cc
- test/core/end2end/tests/max_message_length.cc
- test/core/end2end/tests/negative_deadline.cc
- test/core/end2end/tests/no_error_on_hotpath.cc
- test/core/end2end/tests/no_logging.cc
- test/core/end2end/tests/no_op.cc
- test/core/end2end/tests/payload.cc
- test/core/end2end/tests/ping.cc
- test/core/end2end/tests/ping_pong_streaming.cc
- test/core/end2end/tests/proxy_auth.cc
- test/core/end2end/tests/registered_call.cc
- test/core/end2end/tests/request_with_flags.cc
- test/core/end2end/tests/request_with_payload.cc
- test/core/end2end/tests/resource_quota_server.cc
- test/core/end2end/tests/retry.cc
- test/core/end2end/tests/retry_cancel_during_delay.cc
- test/core/end2end/tests/retry_cancellation.cc
- test/core/end2end/tests/retry_disabled.cc
- test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc
- test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc
- test/core/end2end/tests/retry_lb_drop.cc
- test/core/end2end/tests/retry_non_retriable_status.cc
- test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc
- test/core/end2end/tests/retry_recv_initial_metadata.cc
- test/core/end2end/tests/retry_recv_message.cc
- test/core/end2end/tests/retry_server_pushback_delay.cc
- test/core/end2end/tests/retry_server_pushback_disabled.cc
- test/core/end2end/tests/retry_streaming.cc
- test/core/end2end/tests/retry_streaming_after_commit.cc
- test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc
- test/core/end2end/tests/retry_throttled.cc
- test/core/end2end/tests/retry_too_many_attempts.cc
- test/core/end2end/tests/server_finishes_request.cc
- test/core/end2end/tests/server_streaming.cc
- test/core/end2end/tests/shutdown_finishes_calls.cc
- test/core/end2end/tests/shutdown_finishes_tags.cc
- test/core/end2end/tests/simple_cacheable_request.cc
- test/core/end2end/tests/simple_delayed_request.cc
- test/core/end2end/tests/simple_metadata.cc
- test/core/end2end/tests/simple_request.cc
- test/core/end2end/tests/stream_compression_compressed_payload.cc
- test/core/end2end/tests/stream_compression_payload.cc
- test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
- test/core/end2end/tests/streaming_error_response.cc
- test/core/end2end/tests/trailing_metadata.cc
- test/core/end2end/tests/workaround_cronet_compression.cc
- test/core/end2end/tests/write_buffering.cc
- test/core/end2end/tests/write_buffering_at_end.cc
- test/core/util/test_lb_policies.cc
-)
-
-set_target_properties(end2end_nosec_tests PROPERTIES
- VERSION ${gRPC_CORE_VERSION}
- SOVERSION ${gRPC_CORE_SOVERSION}
-)
-
-if(WIN32 AND MSVC)
- set_target_properties(end2end_nosec_tests PROPERTIES COMPILE_PDB_NAME "end2end_nosec_tests"
- COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
- )
- if(gRPC_INSTALL)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/end2end_nosec_tests.pdb
- DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
- )
- endif()
-endif()
-
-target_include_directories(end2end_nosec_tests
- PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-target_link_libraries(end2end_nosec_tests
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_library(end2end_tests
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ src/core/lib/security/authorization/rbac_translator.cc
+ test/core/compression/args_utils.cc
test/core/end2end/cq_verifier.cc
test/core/end2end/data/client_certs.cc
test/core/end2end/data/server1_cert.cc
@@ -1222,10 +1150,11 @@ add_library(end2end_tests
test/core/end2end/tests/filter_init_fails.cc
test/core/end2end/tests/filter_latency.cc
test/core/end2end/tests/filter_status_code.cc
+ test/core/end2end/tests/filtered_metadata.cc
test/core/end2end/tests/graceful_server_shutdown.cc
+ test/core/end2end/tests/grpc_authz.cc
test/core/end2end/tests/high_initial_seqno.cc
test/core/end2end/tests/hpack_size.cc
- test/core/end2end/tests/idempotent_request.cc
test/core/end2end/tests/invoke_large_request.cc
test/core/end2end/tests/keepalive_timeout.cc
test/core/end2end/tests/large_metadata.cc
@@ -1246,16 +1175,27 @@ add_library(end2end_tests
test/core/end2end/tests/request_with_payload.cc
test/core/end2end/tests/resource_quota_server.cc
test/core/end2end/tests/retry.cc
+ test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc
test/core/end2end/tests/retry_cancel_during_delay.cc
+ test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc
test/core/end2end/tests/retry_cancellation.cc
test/core/end2end/tests/retry_disabled.cc
+ test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc
test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc
test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc
test/core/end2end/tests/retry_lb_drop.cc
+ test/core/end2end/tests/retry_lb_fail.cc
test/core/end2end/tests/retry_non_retriable_status.cc
test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc
+ test/core/end2end/tests/retry_per_attempt_recv_timeout.cc
+ test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc
test/core/end2end/tests/retry_recv_initial_metadata.cc
test/core/end2end/tests/retry_recv_message.cc
+ test/core/end2end/tests/retry_recv_message_replay.cc
+ test/core/end2end/tests/retry_recv_trailing_metadata_error.cc
+ test/core/end2end/tests/retry_send_initial_metadata_refs.cc
+ test/core/end2end/tests/retry_send_op_fails.cc
+ test/core/end2end/tests/retry_send_recv_batch.cc
test/core/end2end/tests/retry_server_pushback_delay.cc
test/core/end2end/tests/retry_server_pushback_disabled.cc
test/core/end2end/tests/retry_streaming.cc
@@ -1263,20 +1203,20 @@ add_library(end2end_tests
test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc
test/core/end2end/tests/retry_throttled.cc
test/core/end2end/tests/retry_too_many_attempts.cc
+ test/core/end2end/tests/retry_transparent_goaway.cc
+ test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc
+ test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc
+ test/core/end2end/tests/retry_unref_before_finish.cc
+ test/core/end2end/tests/retry_unref_before_recv.cc
test/core/end2end/tests/server_finishes_request.cc
test/core/end2end/tests/server_streaming.cc
test/core/end2end/tests/shutdown_finishes_calls.cc
test/core/end2end/tests/shutdown_finishes_tags.cc
- test/core/end2end/tests/simple_cacheable_request.cc
test/core/end2end/tests/simple_delayed_request.cc
test/core/end2end/tests/simple_metadata.cc
test/core/end2end/tests/simple_request.cc
- test/core/end2end/tests/stream_compression_compressed_payload.cc
- test/core/end2end/tests/stream_compression_payload.cc
- test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
test/core/end2end/tests/streaming_error_response.cc
test/core/end2end/tests/trailing_metadata.cc
- test/core/end2end/tests/workaround_cronet_compression.cc
test/core/end2end/tests/write_buffering.cc
test/core/end2end/tests/write_buffering_at_end.cc
test/core/util/test_lb_policies.cc
@@ -1316,20 +1256,32 @@ target_link_libraries(end2end_tests
grpc_test_util
)
+foreach(_hdr
+ include/grpc/byte_buffer.h
+ include/grpc/byte_buffer_reader.h
+ include/grpc/compression.h
+ include/grpc/fork.h
+ include/grpc/grpc.h
+ include/grpc/grpc_posix.h
+ include/grpc/grpc_security.h
+ include/grpc/grpc_security_constants.h
+ include/grpc/load_reporting.h
+ include/grpc/slice.h
+ include/grpc/slice_buffer.h
+ include/grpc/status.h
+ include/grpc/support/workaround_list.h
+)
+ string(REPLACE "include/" "" _path ${_hdr})
+ get_filename_component(_path ${_path} PATH)
+ install(FILES ${_hdr}
+ DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
+ )
+endforeach()
endif()
add_library(gpr
- 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/http.upb.c
src/core/ext/upb-generated/google/protobuf/any.upb.c
- src/core/ext/upb-generated/google/protobuf/duration.upb.c
- src/core/ext/upb-generated/google/protobuf/empty.upb.c
- src/core/ext/upb-generated/google/protobuf/struct.upb.c
- src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
- src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
src/core/ext/upb-generated/google/rpc/status.upb.c
src/core/lib/gpr/alloc.cc
src/core/lib/gpr/atm.cc
@@ -1358,12 +1310,10 @@ add_library(gpr
src/core/lib/gpr/time_posix.cc
src/core/lib/gpr/time_precise.cc
src/core/lib/gpr/time_windows.cc
- src/core/lib/gpr/tls_pthread.cc
src/core/lib/gpr/tmpfile_msys.cc
src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/arena.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
@@ -1411,8 +1361,11 @@ target_include_directories(gpr
target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
+ absl::core_headers
absl::memory
+ absl::random_random
absl::status
+ absl::cord
absl::str_format
absl::strings
absl::synchronization
@@ -1481,6 +1434,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS gpr EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -1489,6 +1443,8 @@ endif()
add_library(grpc
src/core/ext/filters/census/grpc_context.cc
+ src/core/ext/filters/channel_idle/channel_idle_filter.cc
+ src/core/ext/filters/channel_idle/idle_filter_state.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -1508,12 +1464,12 @@ add_library(grpc
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_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/ring_hash/ring_hash.cc
+ src/core/ext/filters/client_channel/lb_policy/rls/rls.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/xds/cds.cc
@@ -1523,33 +1479,30 @@ add_library(grpc
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
- src/core/ext/filters/client_channel/resolver.cc
+ src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
+ src/core/ext/filters/client_channel/resolver/polling_resolver.cc
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
- src/core/ext/filters/client_channel/resolver_registry.cc
src/core/ext/filters/client_channel/resolver_result_parsing.cc
src/core/ext/filters/client_channel/retry_filter.cc
src/core/ext/filters/client_channel/retry_service_config.cc
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/subchannel.cc
src/core/ext/filters/client_channel/subchannel_pool_interface.cc
- src/core/ext/filters/client_idle/client_idle_filter.cc
+ src/core/ext/filters/client_channel/subchannel_stream_client.cc
src/core/ext/filters/deadline/deadline_filter.cc
src/core/ext/filters/fault_injection/fault_injection_filter.cc
src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -1559,23 +1512,16 @@ add_library(grpc
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/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
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- src/core/ext/filters/workarounds/workaround_utils.cc
+ src/core/ext/filters/rbac/rbac_filter.cc
+ src/core/ext/filters/rbac/rbac_service_config_parser.cc
+ src/core/ext/filters/server_config_selector/server_config_selector.cc
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
src/core/ext/transport/chttp2/alpn/alpn.cc
- src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
- src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
src/core/ext/transport/chttp2/server/chttp2_server.cc
- src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
- src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
- src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
src/core/ext/transport/chttp2/transport/bin_decoder.cc
src/core/ext/transport/chttp2/transport/bin_encoder.cc
- src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
src/core/ext/transport/chttp2/transport/chttp2_transport.cc
src/core/ext/transport/chttp2/transport/context_list.cc
src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -1586,11 +1532,11 @@ add_library(grpc
src/core/ext/transport/chttp2/transport/frame_settings.cc
src/core/ext/transport/chttp2/transport/frame_window_update.cc
src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
src/core/ext/transport/chttp2/transport/hpack_parser.cc
- src/core/ext/transport/chttp2/transport/hpack_table.cc
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
src/core/ext/transport/chttp2/transport/http2_settings.cc
src/core/ext/transport/chttp2/transport/huffsyms.cc
- src/core/ext/transport/chttp2/transport/incoming_metadata.cc
src/core/ext/transport/chttp2/transport/parsing.cc
src/core/ext/transport/chttp2/transport/stream_lists.cc
src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -1598,7 +1544,16 @@ add_library(grpc
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/admin/v3/certs.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c
+ src/core/ext/upb-generated/envoy/admin/v3/tap.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
@@ -1607,51 +1562,67 @@ add_library(grpc
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/common/matcher/v3/matcher.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_method_list.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/resolver.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/core/v3/udp_socket_config.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/quic_config.upb.c
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
+ src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
src/core/ext/upb-generated/envoy/config/overload/v3/overload.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/tap/v3/common.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c
+ src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
+ src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.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/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.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/service/status/v3/csds.upb.c
+ src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c
+ src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
+ src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -1662,30 +1633,66 @@ add_library(grpc
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/hash_policy.upb.c
src/core/ext/upb-generated/envoy/type/v3/http.upb.c
+ src/core/ext/upb-generated/envoy/type/v3/http_status.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/ratelimit_unit.upb.c
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
+ src/core/ext/upb-generated/envoy/type/v3/token_bucket.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/http.upb.c
+ src/core/ext/upb-generated/google/api/httpbody.upb.c
+ src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+ src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+ src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
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/src/proto/grpc/lookup/v1/rls.upb.c
+ src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.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/data/orca/v1/orca_load_report.upb.c
- src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
+ src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c
+ src/core/ext/upb-generated/xds/annotations/v3/security.upb.c
+ src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c
+ src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
+ src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c
src/core/ext/upb-generated/xds/core/v3/authority.upb.c
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
+ src/core/ext/upb-generated/xds/core/v3/extension.upb.c
src/core/ext/upb-generated/xds/core/v3/resource.upb.c
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
+ src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
+ src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c
+ src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c
+ src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c
+ src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
@@ -1694,50 +1701,67 @@ add_library(grpc
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
@@ -1748,12 +1772,19 @@ add_library(grpc
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
+ src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
+ src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c
+ src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
+ src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
@@ -1761,56 +1792,81 @@ add_library(grpc
src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
+ src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c
+ src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c
+ src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
src/core/ext/xds/certificate_provider_registry.cc
src/core/ext/xds/certificate_provider_store.cc
src/core/ext/xds/file_watcher_certificate_provider_factory.cc
src/core/ext/xds/xds_api.cc
src/core/ext/xds/xds_bootstrap.cc
src/core/ext/xds/xds_certificate_provider.cc
+ src/core/ext/xds/xds_channel_stack_modifier.cc
src/core/ext/xds/xds_client.cc
src/core/ext/xds/xds_client_stats.cc
+ src/core/ext/xds/xds_cluster.cc
+ src/core/ext/xds/xds_cluster_specifier_plugin.cc
+ src/core/ext/xds/xds_common_types.cc
+ src/core/ext/xds/xds_endpoint.cc
src/core/ext/xds/xds_http_fault_filter.cc
src/core/ext/xds/xds_http_filters.cc
+ src/core/ext/xds/xds_http_rbac_filter.cc
+ src/core/ext/xds/xds_listener.cc
+ src/core/ext/xds/xds_resource_type.cc
+ src/core/ext/xds/xds_route_config.cc
+ src/core/ext/xds/xds_routing.cc
src/core/ext/xds/xds_server_config_fetcher.cc
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
- src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
+ src/core/lib/channel/channel_args_preconditioning.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
+ src/core/lib/channel/channel_stack_builder_impl.cc
src/core/lib/channel/channel_trace.cc
src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_registry.cc
+ src/core/lib/channel/promise_based_filter.cc
src/core/lib/channel/status_util.cc
src/core/lib/compression/compression.cc
- src/core/lib/compression/compression_args.cc
src/core/lib/compression/compression_internal.cc
src/core/lib/compression/message_compress.cc
- src/core/lib/compression/stream_compression.cc
- src/core/lib/compression/stream_compression_gzip.cc
- src/core/lib/compression/stream_compression_identity.cc
+ src/core/lib/config/core_configuration.cc
src/core/lib/debug/stats.cc
src/core/lib/debug/stats_data.cc
src/core/lib/debug/trace.cc
- src/core/lib/event_engine/slice_allocator.cc
+ src/core/lib/event_engine/channel_args_endpoint_config.cc
+ src/core/lib/event_engine/default_event_engine_factory.cc
+ src/core/lib/event_engine/event_engine.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/event_engine/resolved_address.cc
src/core/lib/event_engine/sockaddr.cc
+ src/core/lib/gprpp/time.cc
src/core/lib/http/format_request.cc
src/core/lib/http/httpcli.cc
src/core/lib/http/httpcli_security_connector.cc
@@ -1822,17 +1878,24 @@ add_library(grpc
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_event_engine.cc
src/core/lib/iomgr/endpoint_pair_posix.cc
- src/core/lib/iomgr/endpoint_pair_uv.cc
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_epoll1_linux.cc
- src/core/lib/iomgr/ev_epollex_linux.cc
src/core/lib/iomgr/ev_poll_posix.cc
src/core/lib/iomgr/ev_posix.cc
src/core/lib/iomgr/ev_windows.cc
+ src/core/lib/iomgr/event_engine/closure.cc
+ src/core/lib/iomgr/event_engine/endpoint.cc
+ src/core/lib/iomgr/event_engine/iomgr.cc
+ src/core/lib/iomgr/event_engine/pollset.cc
+ src/core/lib/iomgr/event_engine/resolved_address_internal.cc
+ src/core/lib/iomgr/event_engine/resolver.cc
+ src/core/lib/iomgr/event_engine/tcp.cc
+ src/core/lib/iomgr/event_engine/timer.cc
src/core/lib/iomgr/exec_ctx.cc
src/core/lib/iomgr/executor.cc
src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -1847,60 +1910,45 @@ add_library(grpc
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
- src/core/lib/iomgr/iomgr_custom.cc
src/core/lib/iomgr/iomgr_internal.cc
src/core/lib/iomgr/iomgr_posix.cc
src/core/lib/iomgr/iomgr_posix_cfstream.cc
- src/core/lib/iomgr/iomgr_uv.cc
src/core/lib/iomgr/iomgr_windows.cc
- 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/polling_entity.cc
src/core/lib/iomgr/pollset.cc
- src/core/lib/iomgr/pollset_custom.cc
src/core/lib/iomgr/pollset_set.cc
- src/core/lib/iomgr/pollset_set_custom.cc
src/core/lib/iomgr/pollset_set_windows.cc
- src/core/lib/iomgr/pollset_uv.cc
src/core/lib/iomgr/pollset_windows.cc
src/core/lib/iomgr/resolve_address.cc
- src/core/lib/iomgr/resolve_address_custom.cc
src/core/lib/iomgr/resolve_address_posix.cc
src/core/lib/iomgr/resolve_address_windows.cc
- src/core/lib/iomgr/resource_quota.cc
+ src/core/lib/iomgr/sockaddr_utils_posix.cc
src/core/lib/iomgr/socket_factory_posix.cc
src/core/lib/iomgr/socket_mutator.cc
src/core/lib/iomgr/socket_utils_common_posix.cc
src/core/lib/iomgr/socket_utils_linux.cc
src/core/lib/iomgr/socket_utils_posix.cc
- src/core/lib/iomgr/socket_utils_uv.cc
src/core/lib/iomgr/socket_utils_windows.cc
src/core/lib/iomgr/socket_windows.cc
src/core/lib/iomgr/tcp_client.cc
src/core/lib/iomgr/tcp_client_cfstream.cc
- src/core/lib/iomgr/tcp_client_custom.cc
src/core/lib/iomgr/tcp_client_posix.cc
src/core/lib/iomgr/tcp_client_windows.cc
- src/core/lib/iomgr/tcp_custom.cc
src/core/lib/iomgr/tcp_posix.cc
src/core/lib/iomgr/tcp_server.cc
- src/core/lib/iomgr/tcp_server_custom.cc
src/core/lib/iomgr/tcp_server_posix.cc
src/core/lib/iomgr/tcp_server_utils_posix_common.cc
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
src/core/lib/iomgr/tcp_server_windows.cc
- src/core/lib/iomgr/tcp_uv.cc
src/core/lib/iomgr/tcp_windows.cc
src/core/lib/iomgr/time_averaged_stats.cc
src/core/lib/iomgr/timer.cc
- src/core/lib/iomgr/timer_custom.cc
src/core/lib/iomgr/timer_generic.cc
src/core/lib/iomgr/timer_heap.cc
src/core/lib/iomgr/timer_manager.cc
- src/core/lib/iomgr/timer_uv.cc
- src/core/lib/iomgr/udp_server.cc
src/core/lib/iomgr/unix_sockets_posix.cc
src/core/lib/iomgr/unix_sockets_posix_noop.cc
src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -1912,6 +1960,23 @@ add_library(grpc
src/core/lib/json/json_util.cc
src/core/lib/json/json_writer.cc
src/core/lib/matchers/matchers.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/promise/sleep.cc
+ src/core/lib/resolver/resolver.cc
+ src/core/lib/resolver/resolver_registry.cc
+ src/core/lib/resolver/server_address.cc
+ src/core/lib/resource_quota/api.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
+ src/core/lib/security/authorization/evaluate_args.cc
+ src/core/lib/security/authorization/grpc_authorization_engine.cc
+ src/core/lib/security/authorization/grpc_server_authz_filter.cc
+ src/core/lib/security/authorization/matchers.cc
+ src/core/lib/security/authorization/rbac_policy.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
@@ -1921,9 +1986,10 @@ add_library(grpc
src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc
src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc
+ src/core/lib/security/credentials/call_creds_util.cc
+ src/core/lib/security/credentials/channel_creds_registry_init.cc
src/core/lib/security/credentials/composite/composite_credentials.cc
src/core/lib/security/credentials/credentials.cc
- src/core/lib/security/credentials/credentials_metadata.cc
src/core/lib/security/credentials/external/aws_external_account_credentials.cc
src/core/lib/security/credentials/external/aws_request_signer.cc
src/core/lib/security/credentials/external/external_account_credentials.cc
@@ -1943,6 +2009,7 @@ add_library(grpc
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_provider.cc
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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/tls/tls_utils.cc
@@ -1964,13 +2031,18 @@ add_library(grpc
src/core/lib/security/transport/server_auth_filter.cc
src/core/lib/security/transport/tsi_error.cc
src/core/lib/security/util/json_util.cc
+ src/core/lib/service_config/service_config_impl.cc
+ src/core/lib/service_config/service_config_parser.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_api.cc
src/core/lib/slice/slice_buffer.cc
- src/core/lib/slice/slice_intern.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_split.cc
src/core/lib/slice/slice_string_helpers.cc
src/core/lib/surface/api_trace.cc
+ src/core/lib/surface/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
@@ -1984,28 +2056,24 @@ add_library(grpc
src/core/lib/surface/completion_queue_factory.cc
src/core/lib/surface/event_string.cc
src/core/lib/surface/init.cc
- src/core/lib/surface/init_secure.cc
src/core/lib/surface/lame_client.cc
src/core/lib/surface/metadata_array.cc
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/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc
src/core/lib/transport/error_utils.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
+ src/core/lib/transport/parsed_metadata.cc
src/core/lib/transport/pid_controller.cc
- src/core/lib/transport/static_metadata.cc
src/core/lib/transport/status_conversion.cc
- src/core/lib/transport/status_metadata.cc
src/core/lib/transport/timeout_encoding.cc
src/core/lib/transport/transport.cc
src/core/lib/transport/transport_op_string.cc
src/core/lib/uri/uri_parser.cc
src/core/plugin_registry/grpc_plugin_registry.cc
+ src/core/plugin_registry/grpc_plugin_registry_extra.cc
src/core/tsi/alts/crypt/aes_gcm.cc
src/core/tsi/alts/crypt/gsec.cc
src/core/tsi/alts/frame_protector/alts_counter.cc
@@ -2027,6 +2095,7 @@ add_library(grpc
src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
src/core/tsi/fake_transport_security.cc
src/core/tsi/local_transport_security.cc
+ src/core/tsi/ssl/key_logging/ssl_key_logging.cc
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
src/core/tsi/ssl/session_cache/ssl_session_cache.cc
src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
@@ -2075,7 +2144,10 @@ target_link_libraries(grpc
absl::flat_hash_map
absl::inlined_vector
absl::bind_front
+ absl::hash
absl::statusor
+ absl::variant
+ absl::utility
gpr
${_gRPC_SSL_LIBRARIES}
address_sorting
@@ -2089,10 +2161,12 @@ foreach(_hdr
include/grpc/byte_buffer_reader.h
include/grpc/census.h
include/grpc/compression.h
- include/grpc/event_engine/channel_args.h
+ include/grpc/event_engine/endpoint_config.h
include/grpc/event_engine/event_engine.h
+ include/grpc/event_engine/internal/memory_allocator_impl.h
+ include/grpc/event_engine/memory_allocator.h
+ include/grpc/event_engine/memory_request.h
include/grpc/event_engine/port.h
- include/grpc/event_engine/slice_allocator.h
include/grpc/fork.h
include/grpc/grpc.h
include/grpc/grpc_posix.h
@@ -2115,6 +2189,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -2165,11 +2240,12 @@ endif()
if(gRPC_BUILD_TESTS)
add_library(grpc_test_util
+ test/core/event_engine/test_init.cc
+ test/core/util/build.cc
test/core/util/cmdline.cc
test/core/util/fuzzer_util.cc
test/core/util/grpc_profiler.cc
test/core/util/histogram.cc
- test/core/util/memory_counters.cc
test/core/util/mock_endpoint.cc
test/core/util/parse_hexstring.cc
test/core/util/passthru_endpoint.cc
@@ -2186,7 +2262,6 @@ add_library(grpc_test_util
test/core/util/test_tcp_server.cc
test/core/util/tls_utils.cc
test/core/util/tracer_util.cc
- test/core/util/trickle_endpoint.cc
)
set_target_properties(grpc_test_util PROPERTIES
@@ -2234,11 +2309,12 @@ endif()
if(gRPC_BUILD_TESTS)
add_library(grpc_test_util_unsecure
+ test/core/event_engine/test_init.cc
+ test/core/util/build.cc
test/core/util/cmdline.cc
test/core/util/fuzzer_util.cc
test/core/util/grpc_profiler.cc
test/core/util/histogram.cc
- test/core/util/memory_counters.cc
test/core/util/mock_endpoint.cc
test/core/util/parse_hexstring.cc
test/core/util/passthru_endpoint.cc
@@ -2254,7 +2330,6 @@ add_library(grpc_test_util_unsecure
test/core/util/test_config.cc
test/core/util/test_tcp_server.cc
test/core/util/tracer_util.cc
- test/core/util/trickle_endpoint.cc
)
set_target_properties(grpc_test_util_unsecure PROPERTIES
@@ -2302,6 +2377,8 @@ endif()
add_library(grpc_unsecure
src/core/ext/filters/census/grpc_context.cc
+ src/core/ext/filters/channel_idle/channel_idle_filter.cc
+ src/core/ext/filters/channel_idle/idle_filter_state.cc
src/core/ext/filters/client_channel/backend_metric.cc
src/core/ext/filters/client_channel/backup_poller.cc
src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -2321,41 +2398,39 @@ add_library(grpc_unsecure
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_channel.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/ring_hash/ring_hash.cc
+ src/core/ext/filters/client_channel/lb_policy/rls/rls.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_registry.cc
src/core/ext/filters/client_channel/local_subchannel_pool.cc
src/core/ext/filters/client_channel/proxy_mapper_registry.cc
- src/core/ext/filters/client_channel/resolver.cc
+ src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+ src/core/ext/filters/client_channel/resolver/polling_resolver.cc
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
- src/core/ext/filters/client_channel/resolver_registry.cc
src/core/ext/filters/client_channel/resolver_result_parsing.cc
src/core/ext/filters/client_channel/retry_filter.cc
src/core/ext/filters/client_channel/retry_service_config.cc
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/subchannel.cc
src/core/ext/filters/client_channel/subchannel_pool_interface.cc
- src/core/ext/filters/client_idle/client_idle_filter.cc
+ src/core/ext/filters/client_channel/subchannel_stream_client.cc
src/core/ext/filters/deadline/deadline_filter.cc
src/core/ext/filters/fault_injection/fault_injection_filter.cc
src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -2365,21 +2440,12 @@ add_library(grpc_unsecure
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/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
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- src/core/ext/filters/workarounds/workaround_utils.cc
src/core/ext/transport/chttp2/alpn/alpn.cc
- src/core/ext/transport/chttp2/client/authority.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
src/core/ext/transport/chttp2/server/chttp2_server.cc
- src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
- src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
src/core/ext/transport/chttp2/transport/bin_decoder.cc
src/core/ext/transport/chttp2/transport/bin_encoder.cc
- src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
src/core/ext/transport/chttp2/transport/chttp2_transport.cc
src/core/ext/transport/chttp2/transport/context_list.cc
src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -2390,11 +2456,11 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/transport/frame_settings.cc
src/core/ext/transport/chttp2/transport/frame_window_update.cc
src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
src/core/ext/transport/chttp2/transport/hpack_parser.cc
- src/core/ext/transport/chttp2/transport/hpack_table.cc
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
src/core/ext/transport/chttp2/transport/http2_settings.cc
src/core/ext/transport/chttp2/transport/huffsyms.cc
- src/core/ext/transport/chttp2/transport/incoming_metadata.cc
src/core/ext/transport/chttp2/transport/parsing.cc
src/core/ext/transport/chttp2/transport/stream_lists.cc
src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -2402,36 +2468,49 @@ add_library(grpc_unsecure
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/google/api/annotations.upb.c
+ src/core/ext/upb-generated/google/api/http.upb.c
+ src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+ src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ src/core/ext/upb-generated/google/protobuf/wrappers.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/data/orca/v1/orca_load_report.upb.c
+ src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
+ src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
- src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
src/core/lib/channel/channel_args.cc
+ src/core/lib/channel/channel_args_preconditioning.cc
src/core/lib/channel/channel_stack.cc
src/core/lib/channel/channel_stack_builder.cc
+ src/core/lib/channel/channel_stack_builder_impl.cc
src/core/lib/channel/channel_trace.cc
src/core/lib/channel/channelz.cc
src/core/lib/channel/channelz_registry.cc
src/core/lib/channel/connected_channel.cc
src/core/lib/channel/handshaker.cc
src/core/lib/channel/handshaker_registry.cc
+ src/core/lib/channel/promise_based_filter.cc
src/core/lib/channel/status_util.cc
src/core/lib/compression/compression.cc
- src/core/lib/compression/compression_args.cc
src/core/lib/compression/compression_internal.cc
src/core/lib/compression/message_compress.cc
- src/core/lib/compression/stream_compression.cc
- src/core/lib/compression/stream_compression_gzip.cc
- src/core/lib/compression/stream_compression_identity.cc
+ src/core/lib/config/core_configuration.cc
src/core/lib/debug/stats.cc
src/core/lib/debug/stats_data.cc
src/core/lib/debug/trace.cc
- src/core/lib/event_engine/slice_allocator.cc
+ src/core/lib/event_engine/channel_args_endpoint_config.cc
+ src/core/lib/event_engine/default_event_engine_factory.cc
+ src/core/lib/event_engine/event_engine.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/event_engine/resolved_address.cc
src/core/lib/event_engine/sockaddr.cc
+ src/core/lib/gprpp/time.cc
src/core/lib/http/format_request.cc
src/core/lib/http/httpcli.cc
src/core/lib/http/parser.cc
@@ -2442,17 +2521,24 @@ add_library(grpc_unsecure
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_event_engine.cc
src/core/lib/iomgr/endpoint_pair_posix.cc
- src/core/lib/iomgr/endpoint_pair_uv.cc
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_epoll1_linux.cc
- src/core/lib/iomgr/ev_epollex_linux.cc
src/core/lib/iomgr/ev_poll_posix.cc
src/core/lib/iomgr/ev_posix.cc
src/core/lib/iomgr/ev_windows.cc
+ src/core/lib/iomgr/event_engine/closure.cc
+ src/core/lib/iomgr/event_engine/endpoint.cc
+ src/core/lib/iomgr/event_engine/iomgr.cc
+ src/core/lib/iomgr/event_engine/pollset.cc
+ src/core/lib/iomgr/event_engine/resolved_address_internal.cc
+ src/core/lib/iomgr/event_engine/resolver.cc
+ src/core/lib/iomgr/event_engine/tcp.cc
+ src/core/lib/iomgr/event_engine/timer.cc
src/core/lib/iomgr/exec_ctx.cc
src/core/lib/iomgr/executor.cc
src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -2467,60 +2553,45 @@ add_library(grpc_unsecure
src/core/lib/iomgr/internal_errqueue.cc
src/core/lib/iomgr/iocp_windows.cc
src/core/lib/iomgr/iomgr.cc
- src/core/lib/iomgr/iomgr_custom.cc
src/core/lib/iomgr/iomgr_internal.cc
src/core/lib/iomgr/iomgr_posix.cc
src/core/lib/iomgr/iomgr_posix_cfstream.cc
- src/core/lib/iomgr/iomgr_uv.cc
src/core/lib/iomgr/iomgr_windows.cc
- 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/polling_entity.cc
src/core/lib/iomgr/pollset.cc
- src/core/lib/iomgr/pollset_custom.cc
src/core/lib/iomgr/pollset_set.cc
- src/core/lib/iomgr/pollset_set_custom.cc
src/core/lib/iomgr/pollset_set_windows.cc
- src/core/lib/iomgr/pollset_uv.cc
src/core/lib/iomgr/pollset_windows.cc
src/core/lib/iomgr/resolve_address.cc
- src/core/lib/iomgr/resolve_address_custom.cc
src/core/lib/iomgr/resolve_address_posix.cc
src/core/lib/iomgr/resolve_address_windows.cc
- src/core/lib/iomgr/resource_quota.cc
+ src/core/lib/iomgr/sockaddr_utils_posix.cc
src/core/lib/iomgr/socket_factory_posix.cc
src/core/lib/iomgr/socket_mutator.cc
src/core/lib/iomgr/socket_utils_common_posix.cc
src/core/lib/iomgr/socket_utils_linux.cc
src/core/lib/iomgr/socket_utils_posix.cc
- src/core/lib/iomgr/socket_utils_uv.cc
src/core/lib/iomgr/socket_utils_windows.cc
src/core/lib/iomgr/socket_windows.cc
src/core/lib/iomgr/tcp_client.cc
src/core/lib/iomgr/tcp_client_cfstream.cc
- src/core/lib/iomgr/tcp_client_custom.cc
src/core/lib/iomgr/tcp_client_posix.cc
src/core/lib/iomgr/tcp_client_windows.cc
- src/core/lib/iomgr/tcp_custom.cc
src/core/lib/iomgr/tcp_posix.cc
src/core/lib/iomgr/tcp_server.cc
- src/core/lib/iomgr/tcp_server_custom.cc
src/core/lib/iomgr/tcp_server_posix.cc
src/core/lib/iomgr/tcp_server_utils_posix_common.cc
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
src/core/lib/iomgr/tcp_server_windows.cc
- src/core/lib/iomgr/tcp_uv.cc
src/core/lib/iomgr/tcp_windows.cc
src/core/lib/iomgr/time_averaged_stats.cc
src/core/lib/iomgr/timer.cc
- src/core/lib/iomgr/timer_custom.cc
src/core/lib/iomgr/timer_generic.cc
src/core/lib/iomgr/timer_heap.cc
src/core/lib/iomgr/timer_manager.cc
- src/core/lib/iomgr/timer_uv.cc
- src/core/lib/iomgr/udp_server.cc
src/core/lib/iomgr/unix_sockets_posix.cc
src/core/lib/iomgr/unix_sockets_posix_noop.cc
src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -2531,13 +2602,51 @@ add_library(grpc_unsecure
src/core/lib/json/json_reader.cc
src/core/lib/json/json_util.cc
src/core/lib/json/json_writer.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/promise/sleep.cc
+ src/core/lib/resolver/resolver.cc
+ src/core/lib/resolver/resolver_registry.cc
+ src/core/lib/resolver/server_address.cc
+ src/core/lib/resource_quota/api.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
+ src/core/lib/security/authorization/evaluate_args.cc
+ src/core/lib/security/authorization/grpc_server_authz_filter.cc
+ src/core/lib/security/context/security_context.cc
+ src/core/lib/security/credentials/call_creds_util.cc
+ src/core/lib/security/credentials/composite/composite_credentials.cc
+ src/core/lib/security/credentials/credentials.cc
+ src/core/lib/security/credentials/fake/fake_credentials.cc
+ src/core/lib/security/credentials/insecure/insecure_credentials.cc
+ src/core/lib/security/credentials/plugin/plugin_credentials.cc
+ src/core/lib/security/credentials/tls/tls_utils.cc
+ src/core/lib/security/security_connector/fake/fake_security_connector.cc
+ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
+ src/core/lib/security/security_connector/load_system_roots_fallback.cc
+ src/core/lib/security/security_connector/load_system_roots_linux.cc
+ src/core/lib/security/security_connector/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
+ src/core/lib/security/transport/server_auth_filter.cc
+ src/core/lib/security/transport/tsi_error.cc
+ src/core/lib/security/util/json_util.cc
+ src/core/lib/service_config/service_config_impl.cc
+ src/core/lib/service_config/service_config_parser.cc
src/core/lib/slice/b64.cc
src/core/lib/slice/percent_encoding.cc
src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_api.cc
src/core/lib/slice/slice_buffer.cc
- src/core/lib/slice/slice_intern.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_split.cc
src/core/lib/slice/slice_string_helpers.cc
src/core/lib/surface/api_trace.cc
+ src/core/lib/surface/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
@@ -2551,28 +2660,28 @@ add_library(grpc_unsecure
src/core/lib/surface/completion_queue_factory.cc
src/core/lib/surface/event_string.cc
src/core/lib/surface/init.cc
- src/core/lib/surface/init_unsecure.cc
src/core/lib/surface/lame_client.cc
src/core/lib/surface/metadata_array.cc
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/bdp_estimator.cc
src/core/lib/transport/byte_stream.cc
src/core/lib/transport/connectivity_state.cc
src/core/lib/transport/error_utils.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
+ src/core/lib/transport/parsed_metadata.cc
src/core/lib/transport/pid_controller.cc
- src/core/lib/transport/static_metadata.cc
src/core/lib/transport/status_conversion.cc
- src/core/lib/transport/status_metadata.cc
src/core/lib/transport/timeout_encoding.cc
src/core/lib/transport/transport.cc
src/core/lib/transport/transport_op_string.cc
src/core/lib/uri/uri_parser.cc
- src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+ src/core/plugin_registry/grpc_plugin_registry.cc
+ src/core/plugin_registry/grpc_plugin_registry_noextra.cc
+ src/core/tsi/fake_transport_security.cc
+ src/core/tsi/local_transport_security.cc
+ src/core/tsi/transport_security.cc
+ src/core/tsi/transport_security_grpc.cc
)
set_target_properties(grpc_unsecure PROPERTIES
@@ -2614,7 +2723,11 @@ target_link_libraries(grpc_unsecure
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flat_hash_map
absl::inlined_vector
+ absl::bind_front
+ absl::hash
absl::statusor
+ absl::variant
+ absl::utility
gpr
address_sorting
)
@@ -2627,13 +2740,16 @@ foreach(_hdr
include/grpc/byte_buffer_reader.h
include/grpc/census.h
include/grpc/compression.h
- include/grpc/event_engine/channel_args.h
+ include/grpc/event_engine/endpoint_config.h
include/grpc/event_engine/event_engine.h
+ include/grpc/event_engine/internal/memory_allocator_impl.h
+ include/grpc/event_engine/memory_allocator.h
+ include/grpc/event_engine/memory_request.h
include/grpc/event_engine/port.h
- include/grpc/event_engine/slice_allocator.h
include/grpc/fork.h
include/grpc/grpc.h
include/grpc/grpc_posix.h
+ include/grpc/grpc_security.h
include/grpc/grpc_security_constants.h
include/grpc/load_reporting.h
include/grpc/slice.h
@@ -2652,6 +2768,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc_unsecure EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -2725,6 +2842,24 @@ endif()
endif()
add_library(grpc++
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
src/cpp/client/channel_cc.cc
src/cpp/client/client_callback.cc
src/cpp/client/client_context.cc
@@ -2749,8 +2884,8 @@ add_library(grpc++
src/cpp/common/secure_channel_arguments.cc
src/cpp/common/secure_create_auth_context.cc
src/cpp/common/tls_certificate_provider.cc
+ src/cpp/common/tls_certificate_verifier.cc
src/cpp/common/tls_credentials_options.cc
- src/cpp/common/tls_credentials_options_util.cc
src/cpp/common/validate_service_config.cc
src/cpp/common/version_cc.cc
src/cpp/server/async_generic_service.cc
@@ -2897,6 +3032,7 @@ foreach(_hdr
include/grpcpp/client_context.h
include/grpcpp/completion_queue.h
include/grpcpp/create_channel.h
+ include/grpcpp/create_channel_binder.h
include/grpcpp/create_channel_posix.h
include/grpcpp/ext/health_check_service_server_builder_option.h
include/grpcpp/generic/async_generic_service.h
@@ -2969,9 +3105,13 @@ foreach(_hdr
include/grpcpp/resource_quota.h
include/grpcpp/security/auth_context.h
include/grpcpp/security/auth_metadata_processor.h
+ include/grpcpp/security/authorization_policy_provider.h
+ include/grpcpp/security/binder_credentials.h
+ include/grpcpp/security/binder_security_policy.h
include/grpcpp/security/credentials.h
include/grpcpp/security/server_credentials.h
include/grpcpp/security/tls_certificate_provider.h
+ include/grpcpp/security/tls_certificate_verifier.h
include/grpcpp/security/tls_credentials_options.h
include/grpcpp/server.h
include/grpcpp/server_builder.h
@@ -3012,6 +3152,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc++ EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3075,6 +3216,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc++_alts EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3136,6 +3278,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc++_error_details EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3205,6 +3348,7 @@ if(gRPC_BUILD_CODEGEN)
if(gRPC_INSTALL)
install(TARGETS grpc++_reflection EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3261,6 +3405,7 @@ foreach(_hdr
include/grpc++/test/mock_stream.h
include/grpc++/test/server_context_test_spouse.h
include/grpcpp/test/channel_test_peer.h
+ include/grpcpp/test/client_context_test_peer.h
include/grpcpp/test/default_reactor_test_peer.h
include/grpcpp/test/mock_stream.h
include/grpcpp/test/server_context_test_spouse.h
@@ -3616,9 +3761,11 @@ foreach(_hdr
include/grpcpp/resource_quota.h
include/grpcpp/security/auth_context.h
include/grpcpp/security/auth_metadata_processor.h
+ include/grpcpp/security/authorization_policy_provider.h
include/grpcpp/security/credentials.h
include/grpcpp/security/server_credentials.h
include/grpcpp/security/tls_certificate_provider.h
+ include/grpcpp/security/tls_certificate_verifier.h
include/grpcpp/security/tls_credentials_options.h
include/grpcpp/server.h
include/grpcpp/server_builder.h
@@ -3658,6 +3805,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc++_unsecure EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3725,6 +3873,7 @@ endforeach()
if(gRPC_INSTALL)
install(TARGETS grpc_plugin_support EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3797,6 +3946,7 @@ if(gRPC_BUILD_CODEGEN)
if(gRPC_INSTALL AND NOT gRPC_USE_PROTO_LITE)
install(TARGETS grpcpp_channelz EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3805,16 +3955,19 @@ endif()
endif()
add_library(upb
+ third_party/upb/third_party/utf8_range/naive.c
+ third_party/upb/third_party/utf8_range/range2-neon.c
+ third_party/upb/third_party/utf8_range/range2-sse.c
third_party/upb/upb/decode_fast.c
third_party/upb/upb/decode.c
third_party/upb/upb/def.c
third_party/upb/upb/encode.c
+ third_party/upb/upb/json_encode.c
third_party/upb/upb/msg.c
third_party/upb/upb/reflection.c
third_party/upb/upb/table.c
third_party/upb/upb/text_encode.c
third_party/upb/upb/upb.c
- src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
)
@@ -3856,6 +4009,7 @@ target_link_libraries(upb
if(gRPC_INSTALL)
install(TARGETS upb EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -3863,32 +4017,6 @@ endif()
-add_executable(check_epollexclusive
- test/build/check_epollexclusive.c
-)
-
-target_include_directories(check_epollexclusive
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(check_epollexclusive
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc
- gpr
-)
-
-
-
add_executable(gen_hpack_tables
tools/codegen/core/gen_hpack_tables.cc
)
@@ -3916,85 +4044,6 @@ target_link_libraries(gen_hpack_tables
)
-
-add_executable(gen_legal_metadata_characters
- tools/codegen/core/gen_legal_metadata_characters.cc
-)
-
-target_include_directories(gen_legal_metadata_characters
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(gen_legal_metadata_characters
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
-)
-
-
-
-add_executable(gen_percent_encoding_tables
- tools/codegen/core/gen_percent_encoding_tables.cc
-)
-
-target_include_directories(gen_percent_encoding_tables
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(gen_percent_encoding_tables
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
-)
-
-
-if(gRPC_BUILD_TESTS)
-
-add_executable(algorithm_test
- test/core/compression/algorithm_test.cc
-)
-
-target_include_directories(algorithm_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(algorithm_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
if(gRPC_BUILD_TESTS)
add_executable(alloc_test
@@ -4413,33 +4462,6 @@ target_link_libraries(auth_context_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(avl_test
- test/core/avl/avl_test.cc
-)
-
-target_include_directories(avl_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(avl_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(b64_test
test/core/slice/b64_test.cc
)
@@ -4636,87 +4658,6 @@ target_link_libraries(buffer_list_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(channel_args_test
- test/core/channel/channel_args_test.cc
-)
-
-target_include_directories(channel_args_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(channel_args_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(channel_create_test
- test/core/surface/channel_create_test.cc
-)
-
-target_include_directories(channel_create_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(channel_create_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(channel_stack_builder_test
- test/core/channel/channel_stack_builder_test.cc
-)
-
-target_include_directories(channel_stack_builder_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(channel_stack_builder_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(channel_stack_test
test/core/channel/channel_stack_test.cc
)
@@ -4911,6 +4852,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(compression_test
+ test/core/compression/args_utils.cc
test/core/compression/compression_test.cc
)
@@ -5019,60 +4961,6 @@ target_link_libraries(cpu_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(dns_resolver_connectivity_using_ares_test
- test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
-)
-
-target_include_directories(dns_resolver_connectivity_using_ares_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(dns_resolver_connectivity_using_ares_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(dns_resolver_connectivity_using_native_test
- test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
-)
-
-target_include_directories(dns_resolver_connectivity_using_native_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(dns_resolver_connectivity_using_native_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(dns_resolver_cooldown_test
test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc
)
@@ -5212,63 +5100,6 @@ target_link_libraries(env_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(error_test
- test/core/iomgr/endpoint_tests.cc
- test/core/iomgr/error_test.cc
-)
-
-target_include_directories(error_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(error_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(ev_epollex_linux_test
- test/core/iomgr/ev_epollex_linux_test.cc
- )
-
- target_include_directories(ev_epollex_linux_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- )
-
- target_link_libraries(ev_epollex_linux_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(fake_resolver_test
test/core/client_channel/resolvers/fake_resolver_test.cc
)
@@ -5701,35 +5532,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
endif()
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(handshake_verify_peer_options_test
- test/core/handshake/verify_peer_options.cc
- )
-
- target_include_directories(handshake_verify_peer_options_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- )
-
- target_link_libraries(handshake_verify_peer_options_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
add_executable(histogram_test
test/core/util/histogram_test.cc
@@ -5812,126 +5614,6 @@ target_link_libraries(hpack_encoder_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(hpack_parser_test
- test/core/transport/chttp2/hpack_parser_test.cc
-)
-
-target_include_directories(hpack_parser_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(hpack_parser_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(hpack_table_test
- test/core/transport/chttp2/hpack_table_test.cc
-)
-
-target_include_directories(hpack_table_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(hpack_table_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(httpcli_test
- test/core/end2end/data/client_certs.cc
- test/core/end2end/data/server1_cert.cc
- test/core/end2end/data/server1_key.cc
- test/core/end2end/data/test_root_cert.cc
- test/core/http/httpcli_test.cc
- )
-
- target_include_directories(httpcli_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- )
-
- target_link_libraries(httpcli_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(httpscli_test
- test/core/end2end/data/client_certs.cc
- test/core/end2end/data/server1_cert.cc
- test/core/end2end/data/server1_key.cc
- test/core/end2end/data/test_root_cert.cc
- test/core/http/httpscli_test.cc
- )
-
- target_include_directories(httpscli_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- )
-
- target_link_libraries(httpscli_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(inproc_callback_test
test/core/end2end/inproc_callback_test.cc
)
@@ -6122,39 +5804,57 @@ target_link_libraries(manual_constructor_test
endif()
if(gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-add_executable(message_compress_test
- test/core/compression/message_compress_test.cc
-)
-
-target_include_directories(message_compress_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
+ add_executable(memory_quota_stress_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/resource_quota/memory_quota_stress_test.cc
+ )
+
+ target_include_directories(memory_quota_stress_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ )
-target_link_libraries(message_compress_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
+ target_link_libraries(memory_quota_stress_test
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+ )
endif()
+endif()
if(gRPC_BUILD_TESTS)
-add_executable(metadata_test
- test/core/transport/metadata_test.cc
+add_executable(message_compress_test
+ test/core/compression/message_compress_test.cc
)
-target_include_directories(metadata_test
+target_include_directories(message_compress_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -6168,7 +5868,7 @@ target_include_directories(metadata_test
${_gRPC_ZLIB_INCLUDE_DIR}
)
-target_link_libraries(metadata_test
+target_link_libraries(message_compress_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
@@ -6485,6 +6185,8 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(public_headers_must_be_c89
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ src/core/lib/security/authorization/rbac_translator.cc
test/core/surface/public_headers_must_be_c89.c
)
@@ -6539,33 +6241,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
endif()
endif()
if(gRPC_BUILD_TESTS)
-
-add_executable(resolve_address_using_ares_resolver_test
- test/core/iomgr/resolve_address_test.cc
-)
-
-target_include_directories(resolve_address_using_ares_resolver_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(resolve_address_using_ares_resolver_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(resolve_address_using_native_resolver_posix_test
@@ -6596,60 +6271,6 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
-add_executable(resolve_address_using_native_resolver_test
- test/core/iomgr/resolve_address_test.cc
-)
-
-target_include_directories(resolve_address_using_native_resolver_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(resolve_address_using_native_resolver_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(resource_quota_test
- test/core/iomgr/resource_quota_test.cc
-)
-
-target_include_directories(resource_quota_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(resource_quota_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(secure_channel_create_test
test/core/surface/secure_channel_create_test.cc
)
@@ -6843,7 +6464,38 @@ target_link_libraries(slice_buffer_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(slice_split_test
+ test/core/slice/slice_split_test.cc
+)
+
+target_include_directories(slice_split_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+)
+
+target_link_libraries(slice_split_test
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(slice_string_helpers_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
test/core/slice/slice_string_helpers_test.cc
)
@@ -6863,7 +6515,7 @@ target_include_directories(slice_string_helpers_test
target_link_libraries(slice_string_helpers_test
${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
+ gpr
)
@@ -7037,33 +6689,6 @@ target_link_libraries(status_conversion_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(stream_compression_test
- test/core/compression/stream_compression_test.cc
-)
-
-target_include_directories(stream_compression_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(stream_compression_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(stream_map_test
test/core/transport/chttp2/stream_map_test.cc
)
@@ -7091,33 +6716,6 @@ target_link_libraries(stream_map_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(stream_owned_slice_test
- test/core/transport/stream_owned_slice_test.cc
-)
-
-target_include_directories(stream_owned_slice_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(stream_owned_slice_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(string_test
test/core/gpr/string_test.cc
)
@@ -7287,60 +6885,6 @@ target_link_libraries(test_core_gpr_time_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(test_core_security_credentials_test
- test/core/security/credentials_test.cc
-)
-
-target_include_directories(test_core_security_credentials_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(test_core_security_credentials_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(test_core_slice_slice_test
- test/core/slice/slice_test.cc
-)
-
-target_include_directories(test_core_slice_slice_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(test_core_slice_slice_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(thd_test
test/core/gprpp/thd_test.cc
)
@@ -7422,33 +6966,6 @@ target_link_libraries(time_averaged_stats_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(timeout_encoding_test
- test/core/transport/timeout_encoding_test.cc
-)
-
-target_include_directories(timeout_encoding_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(timeout_encoding_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(timer_heap_test
test/core/iomgr/timer_heap_test.cc
)
@@ -7503,33 +7020,6 @@ target_link_libraries(timer_list_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(tls_test
- test/core/gpr/tls_test.cc
-)
-
-target_include_directories(tls_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
-)
-
-target_link_libraries(tls_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
add_executable(transport_security_common_api_test
test/core/tsi/alts/handshaker/transport_security_common_api_test.cc
)
@@ -7583,41 +7073,12 @@ target_link_libraries(transport_security_test
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(udp_server_test
- test/core/iomgr/udp_server_test.cc
- )
-
- target_include_directories(udp_server_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- )
-
- target_link_libraries(udp_server_test
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-add_executable(useful_test
- test/core/gpr/useful_test.cc
+add_executable(varint_test
+ test/core/transport/chttp2/varint_test.cc
)
-target_include_directories(useful_test
+target_include_directories(varint_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -7631,7 +7092,7 @@ target_include_directories(useful_test
${_gRPC_ZLIB_INCLUDE_DIR}
)
-target_link_libraries(useful_test
+target_link_libraries(varint_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
@@ -7640,11 +7101,15 @@ target_link_libraries(useful_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(varint_test
- test/core/transport/chttp2/varint_test.cc
+add_executable(activity_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/promise/activity.cc
+ test/core/promise/activity_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(varint_test
+target_include_directories(activity_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -7656,11 +7121,20 @@ target_include_directories(varint_test
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(varint_test
+target_link_libraries(activity_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
+ absl::flat_hash_set
+ absl::statusor
+ absl::variant
+ gpr
)
@@ -7853,6 +7327,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
test/core/end2end/cq_verifier.cc
test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc
test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc
+ test/core/util/fake_udp_and_tcp_server.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -7924,6 +7399,60 @@ target_link_libraries(alts_util_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(arena_promise_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/promise/arena_promise_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(arena_promise_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(arena_promise_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(async_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/health/v1/health.grpc.pb.cc
@@ -8015,10 +7544,6 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(authorization_matchers_test
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/grpc_authorization_engine.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/authorization/rbac_policy.cc
test/core/security/authorization_matchers_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -8053,6 +7578,80 @@ target_link_libraries(authorization_matchers_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(authorization_policy_provider_test
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ src/core/lib/security/authorization/rbac_translator.cc
+ src/cpp/server/authorization_policy_provider.cc
+ test/cpp/server/authorization_policy_provider_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(authorization_policy_provider_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(authorization_policy_provider_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(avl_test
+ test/core/avl/avl_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(avl_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(avl_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::inlined_vector
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(aws_request_signer_test
test/core/security/aws_request_signer_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -8233,800 +7832,293 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
endif()
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_alarm
- test/cpp/microbenchmarks/bm_alarm.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_alarm
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_alarm
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_arena
- test/cpp/microbenchmarks/bm_arena.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
- target_include_directories(bm_arena
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_arena
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_byte_buffer
- test/cpp/microbenchmarks/bm_byte_buffer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_byte_buffer
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_byte_buffer
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_call_create
- test/cpp/microbenchmarks/bm_call_create.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_call_create
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_call_create
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_callback_streaming_ping_pong
- test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc
- test/cpp/microbenchmarks/callback_test_service.cc
- test/cpp/util/byte_buffer_proto_helper.cc
- test/cpp/util/string_ref_helper.cc
- test/cpp/util/subprocess.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_callback_streaming_ping_pong
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_callback_streaming_ping_pong
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_callback_unary_ping_pong
- test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc
- test/cpp/microbenchmarks/callback_test_service.cc
- test/cpp/util/byte_buffer_proto_helper.cc
- test/cpp/util/string_ref_helper.cc
- test/cpp/util/subprocess.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_callback_unary_ping_pong
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_callback_unary_ping_pong
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_channel
- test/cpp/microbenchmarks/bm_channel.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_channel
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_channel
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_chttp2_hpack
- test/cpp/microbenchmarks/bm_chttp2_hpack.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_chttp2_hpack
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_chttp2_hpack
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_chttp2_transport
- test/cpp/microbenchmarks/bm_chttp2_transport.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_chttp2_transport
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_chttp2_transport
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_closure
- test/cpp/microbenchmarks/bm_closure.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_closure
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_closure
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_cq
- test/cpp/microbenchmarks/bm_cq.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_cq
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_cq
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_cq_multiple_threads
- test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_cq_multiple_threads
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_cq_multiple_threads
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_error
- test/cpp/microbenchmarks/bm_error.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_error
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_error
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_fullstack_streaming_ping_pong
- test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_fullstack_streaming_ping_pong
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_fullstack_streaming_ping_pong
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_fullstack_streaming_pump
- test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
-
- target_include_directories(bm_fullstack_streaming_pump
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
-
- target_link_libraries(bm_fullstack_streaming_pump
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
-
-
-endif()
-endif()
-if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-
- add_executable(bm_fullstack_trickle
- test/cpp/microbenchmarks/bm_fullstack_trickle.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(binder_resolver_test
+ test/core/client_channel/resolvers/binder_resolver_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_fullstack_trickle
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(binder_resolver_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_fullstack_trickle
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- benchmark_helpers
- )
+target_link_libraries(binder_resolver_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_executable(bm_fullstack_unary_ping_pong
- test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(binder_server_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ test/core/transport/binder/end2end/binder_server_test.cc
+ test/core/transport/binder/end2end/fake_binder.cc
+ test/cpp/end2end/test_service_impl.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_fullstack_unary_ping_pong
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(binder_server_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_fullstack_unary_ping_pong
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
+target_link_libraries(binder_server_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_executable(bm_metadata
- test/cpp/microbenchmarks/bm_metadata.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(binder_transport_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/binder_transport_test.cc
+ test/core/transport/binder/mock_objects.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_metadata
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(binder_transport_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_metadata
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
+target_link_libraries(binder_transport_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_executable(bm_pollset
- test/cpp/microbenchmarks/bm_pollset.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(bitset_test
+ test/core/gprpp/bitset_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_pollset
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(bitset_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_pollset
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
+target_link_libraries(bitset_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_executable(bm_threadpool
- test/cpp/microbenchmarks/bm_threadpool.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(byte_buffer_test
+ test/cpp/util/byte_buffer_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_threadpool
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(byte_buffer_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_threadpool
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
+target_link_libraries(byte_buffer_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
- add_executable(bm_timer
- test/cpp/microbenchmarks/bm_timer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(byte_stream_test
+ test/core/transport/byte_stream_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(bm_timer
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(byte_stream_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(bm_timer
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- benchmark_helpers
- )
+target_link_libraries(byte_stream_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-add_executable(byte_buffer_test
- test/cpp/util/byte_buffer_test.cc
+add_executable(call_finalization_test
+ test/core/channel/call_finalization_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(byte_buffer_test
+target_include_directories(call_finalization_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -9045,23 +8137,23 @@ target_include_directories(byte_buffer_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(byte_buffer_test
+target_link_libraries(call_finalization_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- grpc++_test_util
+ grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
-add_executable(byte_stream_test
- test/core/transport/byte_stream_test.cc
+add_executable(call_push_pull_test
+ test/core/promise/call_push_pull_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(byte_stream_test
+target_include_directories(call_push_pull_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -9080,10 +8172,12 @@ target_include_directories(byte_stream_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(byte_stream_test
+target_link_libraries(call_push_pull_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
+ absl::status
+ absl::statusor
+ absl::variant
)
@@ -9092,8 +8186,8 @@ if(gRPC_BUILD_TESTS)
add_executable(cancel_ares_query_test
test/core/end2end/cq_verifier.cc
+ test/core/util/fake_udp_and_tcp_server.cc
test/cpp/naming/cancel_ares_query_test.cc
- test/cpp/naming/dns_test_util.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -9128,12 +8222,43 @@ target_link_libraries(cancel_ares_query_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(capture_test
+ test/core/gprpp/capture_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(capture_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(capture_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::utility
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(cel_authorization_engine_test
src/core/lib/security/authorization/cel_authorization_engine.cc
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/grpc_authorization_engine.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/authorization/rbac_policy.cc
test/core/security/cel_authorization_engine_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -9287,6 +8412,41 @@ target_link_libraries(cfstream_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(channel_args_test
+ test/core/channel/channel_args_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(channel_args_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(channel_args_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(channel_arguments_test
test/cpp/common/channel_arguments_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -9323,6 +8483,41 @@ target_link_libraries(channel_arguments_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(channel_creds_registry_test
+ test/core/security/channel_creds_registry_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(channel_creds_registry_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(channel_creds_registry_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(channel_filter_test
test/cpp/common/channel_filter_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -9359,6 +8554,41 @@ target_link_libraries(channel_filter_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(channel_stack_builder_test
+ test/core/channel/channel_stack_builder_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(channel_stack_builder_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(channel_stack_builder_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(channel_trace_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc
@@ -9526,6 +8756,61 @@ target_link_libraries(channelz_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(chunked_vector_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/gprpp/chunked_vector_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(chunked_vector_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(chunked_vector_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ absl::utility
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(cli_call_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc
@@ -9583,6 +8868,41 @@ target_link_libraries(cli_call_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(client_authority_filter_test
+ test/core/filters/client_authority_filter_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(client_authority_filter_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(client_authority_filter_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(client_callback_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -9690,6 +9010,42 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
+add_executable(client_context_test_peer_test
+ test/cpp/test/client_context_test_peer_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(client_context_test_peer_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(client_context_test_peer_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(client_interceptors_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -9757,12 +9113,13 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/orca_load_report_for_test.pb.cc
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/orca_load_report_for_test.grpc.pb.cc
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/orca_load_report_for_test.pb.h
- ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/orca_load_report_for_test.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h
test/core/util/test_lb_policies.cc
test/cpp/end2end/client_lb_end2end_test.cc
+ test/cpp/end2end/connection_delay_injector.cc
test/cpp/end2end/test_service_impl.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -10025,6 +9382,147 @@ target_link_libraries(context_list_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(context_test
+ test/core/promise/context_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(context_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(context_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(core_configuration_test
+ test/core/config/core_configuration_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(core_configuration_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(core_configuration_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(cpp_impl_of_test
+ test/core/gprpp/cpp_impl_of_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(cpp_impl_of_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(cpp_impl_of_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+ add_executable(crl_ssl_transport_security_test
+ test/core/tsi/crl_ssl_transport_security_test.cc
+ test/core/tsi/transport_security_test_lib.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+ )
+
+ target_include_directories(crl_ssl_transport_security_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+ )
+
+ target_link_libraries(crl_ssl_transport_security_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ )
+
+
+endif()
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(delegating_channel_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -10180,6 +9678,56 @@ target_link_libraries(duplicate_header_bad_client_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(end2end_binder_transport_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ test/core/transport/binder/end2end/end2end_binder_transport_test.cc
+ test/core/transport/binder/end2end/fake_binder.cc
+ test/core/transport/binder/end2end/testing_channel_create.cc
+ test/cpp/end2end/test_service_impl.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(end2end_binder_transport_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(end2end_binder_transport_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -10234,6 +9782,132 @@ target_link_libraries(end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(endpoint_binder_pool_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/endpoint_binder_pool_test.cc
+ test/core/transport/binder/mock_objects.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(endpoint_binder_pool_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(endpoint_binder_pool_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(endpoint_config_test
+ test/core/event_engine/endpoint_config_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(endpoint_config_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(endpoint_config_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(error_details_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
@@ -10278,6 +9952,42 @@ target_link_libraries(error_details_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(error_test
+ test/core/iomgr/endpoint_tests.cc
+ test/core/iomgr/error_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(error_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(error_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(error_utils_test
test/core/transport/error_utils_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -10314,10 +10024,6 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(evaluate_args_test
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/grpc_authorization_engine.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/authorization/rbac_policy.cc
test/core/security/evaluate_args_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -10436,6 +10142,145 @@ target_link_libraries(exception_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(exec_ctx_wakeup_scheduler_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/promise/exec_ctx_wakeup_scheduler_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(exec_ctx_wakeup_scheduler_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(exec_ctx_wakeup_scheduler_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(fake_binder_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/end2end/fake_binder.cc
+ test/core/transport/binder/end2end/fake_binder_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(fake_binder_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(fake_binder_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(file_watcher_certificate_provider_factory_test
test/core/xds/file_watcher_certificate_provider_factory_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -10570,6 +10415,97 @@ target_link_libraries(flaky_network_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(flow_control_test
+ test/core/end2end/cq_verifier.cc
+ test/core/transport/chttp2/flow_control_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(flow_control_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(flow_control_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(for_each_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/promise/for_each_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(for_each_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(for_each_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::flat_hash_set
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(generic_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -10693,6 +10629,42 @@ target_link_libraries(global_config_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(google_c2p_resolver_test
+ test/core/client_channel/resolvers/google_c2p_resolver_test.cc
+ test/core/util/fake_udp_and_tcp_server.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(google_c2p_resolver_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(google_c2p_resolver_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(google_mesh_ca_certificate_provider_factory_test
src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
test/core/xds/google_mesh_ca_certificate_provider_factory_test.cc
@@ -10729,11 +10701,43 @@ target_link_libraries(google_mesh_ca_certificate_provider_factory_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(graceful_shutdown_test
+ test/core/end2end/cq_verifier.cc
+ test/core/transport/chttp2/graceful_shutdown_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(graceful_shutdown_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(graceful_shutdown_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(grpc_authorization_engine_test
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/grpc_authorization_engine.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/authorization/rbac_policy.cc
test/core/security/grpc_authorization_engine_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -10768,6 +10772,94 @@ target_link_libraries(grpc_authorization_engine_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(grpc_authorization_policy_provider_test
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ src/core/lib/security/authorization/rbac_translator.cc
+ test/core/security/grpc_authorization_policy_provider_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(grpc_authorization_policy_provider_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(grpc_authorization_policy_provider_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(grpc_authz_end2end_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ src/core/lib/security/authorization/rbac_translator.cc
+ src/cpp/server/authorization_policy_provider.cc
+ test/cpp/end2end/grpc_authz_end2end_test.cc
+ test/cpp/end2end/test_service_impl.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(grpc_authz_end2end_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(grpc_authz_end2end_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(grpc_cli
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc
@@ -10846,6 +10938,7 @@ target_link_libraries(grpc_cpp_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_cpp_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -10885,6 +10978,7 @@ target_link_libraries(grpc_csharp_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_csharp_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -10924,6 +11018,7 @@ target_link_libraries(grpc_node_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_node_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -10963,6 +11058,7 @@ target_link_libraries(grpc_objective_c_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_objective_c_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -11002,6 +11098,7 @@ target_link_libraries(grpc_php_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_php_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -11041,6 +11138,7 @@ target_link_libraries(grpc_python_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_python_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -11080,6 +11178,7 @@ target_link_libraries(grpc_ruby_plugin
if(gRPC_INSTALL)
install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
@@ -11158,6 +11257,76 @@ target_link_libraries(grpc_tls_certificate_provider_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(grpc_tls_certificate_verifier_test
+ test/core/security/grpc_tls_certificate_verifier_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(grpc_tls_certificate_verifier_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(grpc_tls_certificate_verifier_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(grpc_tls_credentials_options_comparator_test
+ test/core/security/grpc_tls_credentials_options_comparator_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(grpc_tls_credentials_options_comparator_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(grpc_tls_credentials_options_comparator_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(grpc_tls_credentials_options_test
test/core/security/grpc_tls_credentials_options_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -11192,7 +11361,7 @@ target_link_libraries(grpc_tls_credentials_options_test
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_executable(grpc_tool_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
@@ -11241,6 +11410,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++_reflection
+ grpc++_test_config
grpc++_test_util
)
@@ -11338,6 +11508,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(grpclb_end2end_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_config
grpc++_test_util
)
@@ -11512,6 +11683,76 @@ target_link_libraries(health_service_end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(hpack_parser_table_test
+ test/core/transport/chttp2/hpack_parser_table_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(hpack_parser_table_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(hpack_parser_table_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(hpack_parser_test
+ test/core/transport/chttp2/hpack_parser_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(hpack_parser_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(hpack_parser_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(http2_client
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/empty.grpc.pb.cc
@@ -11560,6 +11801,119 @@ target_link_libraries(http2_client
endif()
if(gRPC_BUILD_TESTS)
+add_executable(http_proxy_mapper_test
+ test/core/client_channel/http_proxy_mapper_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(http_proxy_mapper_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(http_proxy_mapper_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+ add_executable(httpcli_test
+ test/core/http/httpcli_test.cc
+ test/core/http/httpcli_test_util.cc
+ test/core/util/fake_udp_and_tcp_server.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+ )
+
+ target_include_directories(httpcli_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+ )
+
+ target_link_libraries(httpcli_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+ )
+
+
+endif()
+endif()
+if(gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
+
+ add_executable(httpscli_test
+ test/core/http/httpcli_test_util.cc
+ test/core/http/httpscli_test.cc
+ test/core/util/fake_udp_and_tcp_server.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+ )
+
+ target_include_directories(httpscli_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+ )
+
+ target_link_libraries(httpscli_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+ )
+
+
+endif()
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(hybrid_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -11612,6 +11966,77 @@ target_link_libraries(hybrid_end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(idle_filter_state_test
+ src/core/ext/filters/channel_idle/idle_filter_state.cc
+ test/core/client_idle/idle_filter_state_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(idle_filter_state_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(idle_filter_state_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(if_test
+ test/core/promise/if_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(if_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(if_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(init_test
test/core/surface/init_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -11819,43 +12244,40 @@ target_link_libraries(interop_server
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_executable(interop_test
- test/cpp/interop/interop_test.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(join_test
+ test/core/promise/join_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(interop_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(join_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(interop_test
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc++_test_config
- grpc++_test_util
- )
+target_link_libraries(join_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::variant
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
add_executable(json_test
@@ -11930,6 +12352,45 @@ target_link_libraries(large_metadata_bad_client_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(latch_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/promise/activity.cc
+ test/core/promise/latch_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(latch_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(latch_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(lb_get_cpu_stats_test
src/cpp/server/load_reporter/get_cpu_stats_linux.cc
src/cpp/server/load_reporter/get_cpu_stats_macos.cc
@@ -12077,6 +12538,77 @@ target_link_libraries(log_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(loop_test
+ test/core/promise/loop_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(loop_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(loop_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(match_test
+ test/core/gprpp/match_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(match_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(match_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(matchers_test
test/core/security/matchers_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -12112,6 +12644,57 @@ target_link_libraries(matchers_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(memory_quota_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/resource_quota/memory_quota_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(memory_quota_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(memory_quota_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(message_allocator_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -12160,6 +12743,75 @@ target_link_libraries(message_allocator_end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(metadata_map_test
+ test/core/transport/metadata_map_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(metadata_map_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(metadata_map_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(miscompile_with_no_unique_address_test
+ test/core/compiler_bugs/miscompile_with_no_unique_address_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(miscompile_with_no_unique_address_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(miscompile_with_no_unique_address_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(mock_stream_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -12307,13 +12959,15 @@ target_link_libraries(nonblocking_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(noop-benchmark
- test/cpp/microbenchmarks/noop-benchmark.cc
+add_executable(observable_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/promise/activity.cc
+ test/core/promise/observable_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(noop-benchmark
+target_include_directories(observable_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -12332,11 +12986,70 @@ target_include_directories(noop-benchmark
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(noop-benchmark
+target_link_libraries(observable_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- ${_gRPC_BENCHMARK_LIBRARIES}
- grpc_test_util
+ absl::flat_hash_set
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(orca_service_end2end_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_service.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_service.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_service.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_service.grpc.pb.h
+ src/core/ext/upb-generated/google/api/annotations.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
+ src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+ src/core/ext/upb-generated/google/rpc/status.upb.c
+ src/core/ext/upb-generated/validate/validate.upb.c
+ src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
+ src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c
+ src/cpp/server/orca/orca_service.cc
+ test/cpp/end2end/orca_service_end2end_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(orca_service_end2end_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(orca_service_end2end_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
)
@@ -12415,6 +13128,75 @@ target_link_libraries(out_of_bounds_bad_client_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(overload_test
+ test/core/gprpp/overload_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(overload_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(overload_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(parsed_metadata_test
+ test/core/transport/parsed_metadata_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(parsed_metadata_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(parsed_metadata_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(pid_controller_test
test/core/transport/pid_controller_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -12450,6 +13232,95 @@ target_link_libraries(pid_controller_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(pipe_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/arena.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/promise/pipe_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(pipe_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(pipe_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(poll_test
+ test/core/promise/poll_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(poll_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(poll_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(port_sharing_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@@ -12498,6 +13369,119 @@ target_link_libraries(port_sharing_end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(promise_factory_test
+ test/core/promise/promise_factory_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(promise_factory_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(promise_factory_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::bind_front
+ absl::status
+ absl::optional
+ absl::variant
+ absl::utility
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(promise_map_test
+ test/core/promise/map_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(promise_map_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(promise_map_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::status
+ absl::optional
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(promise_test
+ test/core/promise/promise_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(promise_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(promise_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::status
+ absl::optional
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(proto_server_reflection_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -12744,6 +13728,41 @@ target_link_libraries(qps_worker
endif()
if(gRPC_BUILD_TESTS)
+add_executable(race_test
+ test/core/promise/race_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(race_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(race_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(raw_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -12796,11 +13815,43 @@ target_link_libraries(raw_end2end_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(rbac_service_config_parser_test
+ test/core/ext/filters/rbac/rbac_service_config_parser_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(rbac_service_config_parser_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(rbac_service_config_parser_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(rbac_translator_test
- src/core/lib/security/authorization/evaluate_args.cc
- src/core/lib/security/authorization/grpc_authorization_engine.cc
- src/core/lib/security/authorization/matchers.cc
- src/core/lib/security/authorization/rbac_policy.cc
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
src/core/lib/security/authorization/rbac_translator.cc
test/core/security/rbac_translator_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -12943,6 +13994,133 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
+add_executable(resolve_address_using_ares_resolver_test
+ test/core/iomgr/resolve_address_test.cc
+ test/core/util/fake_udp_and_tcp_server.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(resolve_address_using_ares_resolver_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(resolve_address_using_ares_resolver_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc++_test_config
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(resolve_address_using_native_resolver_test
+ test/core/iomgr/resolve_address_test.cc
+ test/core/util/fake_udp_and_tcp_server.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(resolve_address_using_native_resolver_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(resolve_address_using_native_resolver_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ grpc++_test_config
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(resource_quota_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/event_engine/memory_allocator.cc
+ src/core/lib/gprpp/time.cc
+ src/core/lib/iomgr/combiner.cc
+ src/core/lib/iomgr/error.cc
+ src/core/lib/iomgr/exec_ctx.cc
+ src/core/lib/iomgr/executor.cc
+ src/core/lib/iomgr/iomgr_internal.cc
+ src/core/lib/promise/activity.cc
+ src/core/lib/resource_quota/memory_quota.cc
+ src/core/lib/resource_quota/resource_quota.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ src/core/lib/resource_quota/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/resource_quota/resource_quota_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(resource_quota_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(resource_quota_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::statusor
+ absl::variant
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(retry_throttle_test
test/core/client_channel/retry_throttle_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -12978,6 +14156,100 @@ target_link_libraries(retry_throttle_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(rls_end2end_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ test/core/util/test_lb_policies.cc
+ test/cpp/end2end/rls_end2end_test.cc
+ test/cpp/end2end/rls_server.cc
+ test/cpp/end2end/test_service_impl.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(rls_end2end_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(rls_end2end_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_config
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(rls_lb_config_parser_test
+ test/core/client_channel/rls_lb_config_parser_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(rls_lb_config_parser_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(rls_lb_config_parser_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(secure_auth_context_test
test/cpp/common/secure_auth_context_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -13013,6 +14285,41 @@ target_link_libraries(secure_auth_context_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(seq_test
+ test/core/promise/seq_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(seq_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(seq_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(server_builder_plugin_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
@@ -13200,6 +14507,41 @@ target_link_libraries(server_chttp2_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(server_config_selector_test
+ test/core/server_config_selector/server_config_selector_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(server_config_selector_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(server_config_selector_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(server_context_test_spouse_test
test/cpp/test/server_context_test_spouse_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -13629,13 +14971,59 @@ target_link_libraries(simple_request_bad_client_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(sockaddr_utils_test
- test/core/address_utils/sockaddr_utils_test.cc
+add_executable(single_set_ptr_test
+ src/core/ext/upb-generated/google/protobuf/any.upb.c
+ src/core/ext/upb-generated/google/rpc/status.upb.c
+ src/core/lib/gpr/alloc.cc
+ src/core/lib/gpr/atm.cc
+ src/core/lib/gpr/cpu_iphone.cc
+ src/core/lib/gpr/cpu_linux.cc
+ src/core/lib/gpr/cpu_posix.cc
+ src/core/lib/gpr/cpu_windows.cc
+ src/core/lib/gpr/env_linux.cc
+ src/core/lib/gpr/env_posix.cc
+ src/core/lib/gpr/env_windows.cc
+ src/core/lib/gpr/log.cc
+ src/core/lib/gpr/log_android.cc
+ src/core/lib/gpr/log_linux.cc
+ src/core/lib/gpr/log_posix.cc
+ src/core/lib/gpr/log_windows.cc
+ src/core/lib/gpr/murmur_hash.cc
+ src/core/lib/gpr/string.cc
+ src/core/lib/gpr/string_posix.cc
+ 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_posix.cc
+ src/core/lib/gpr/sync_windows.cc
+ src/core/lib/gpr/time.cc
+ src/core/lib/gpr/time_posix.cc
+ src/core/lib/gpr/time_precise.cc
+ src/core/lib/gpr/time_windows.cc
+ src/core/lib/gpr/tmpfile_msys.cc
+ src/core/lib/gpr/tmpfile_posix.cc
+ src/core/lib/gpr/tmpfile_windows.cc
+ src/core/lib/gpr/wrap_memcpy.cc
+ src/core/lib/gprpp/examine_stack.cc
+ src/core/lib/gprpp/fork.cc
+ src/core/lib/gprpp/global_config_env.cc
+ src/core/lib/gprpp/host_port.cc
+ src/core/lib/gprpp/mpscq.cc
+ src/core/lib/gprpp/stat_posix.cc
+ src/core/lib/gprpp/stat_windows.cc
+ src/core/lib/gprpp/status_helper.cc
+ src/core/lib/gprpp/thd_posix.cc
+ src/core/lib/gprpp/thd_windows.cc
+ src/core/lib/gprpp/time_util.cc
+ src/core/lib/profiling/basic_timers.cc
+ src/core/lib/profiling/stap_timers.cc
+ test/core/gprpp/single_set_ptr_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(sockaddr_utils_test
+target_include_directories(single_set_ptr_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13654,60 +15042,69 @@ target_include_directories(sockaddr_utils_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(sockaddr_utils_test
+target_link_libraries(single_set_ptr_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
+ absl::base
+ absl::core_headers
+ absl::memory
+ absl::random_random
+ absl::status
+ absl::cord
+ absl::str_format
+ absl::strings
+ absl::synchronization
+ absl::time
+ absl::optional
+ upb
)
endif()
if(gRPC_BUILD_TESTS)
-if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
- add_executable(stack_tracer_test
- test/core/util/stack_tracer_test.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
- )
+add_executable(sleep_test
+ test/core/promise/sleep_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
- target_include_directories(stack_tracer_test
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
- )
+target_include_directories(sleep_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
- target_link_libraries(stack_tracer_test
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- grpc_test_util
- )
+target_link_libraries(sleep_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc
+)
endif()
-endif()
if(gRPC_BUILD_TESTS)
-add_executable(stat_test
- test/core/gprpp/stat_test.cc
+add_executable(smoke_test
+ test/core/event_engine/smoke_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(stat_test
+target_include_directories(smoke_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13726,7 +15123,7 @@ target_include_directories(stat_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(stat_test
+target_link_libraries(smoke_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
@@ -13736,13 +15133,13 @@ target_link_libraries(stat_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(static_metadata_test
- test/core/transport/static_metadata_test.cc
+add_executable(sockaddr_utils_test
+ test/core/address_utils/sockaddr_utils_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(static_metadata_test
+target_include_directories(sockaddr_utils_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13761,7 +15158,7 @@ target_include_directories(static_metadata_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(static_metadata_test
+target_link_libraries(sockaddr_utils_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
@@ -13770,14 +15167,51 @@ target_link_libraries(static_metadata_test
endif()
if(gRPC_BUILD_TESTS)
+if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
-add_executable(stats_test
- test/core/debug/stats_test.cc
+ add_executable(stack_tracer_test
+ test/core/util/stack_tracer_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+ )
+
+ target_include_directories(stack_tracer_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+ )
+
+ target_link_libraries(stack_tracer_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+ )
+
+
+endif()
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(stat_test
+ test/core/gprpp/stat_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(stats_test
+target_include_directories(stat_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13796,7 +15230,7 @@ target_include_directories(stats_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(stats_test
+target_link_libraries(stat_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
@@ -13806,13 +15240,13 @@ target_link_libraries(stats_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(status_helper_test
- test/core/gprpp/status_helper_test.cc
+add_executable(stats_test
+ test/core/debug/stats_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(status_helper_test
+target_include_directories(stats_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13831,7 +15265,7 @@ target_include_directories(status_helper_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(status_helper_test
+target_link_libraries(stats_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
@@ -13841,13 +15275,13 @@ target_link_libraries(status_helper_test
endif()
if(gRPC_BUILD_TESTS)
-add_executable(status_metadata_test
- test/core/transport/status_metadata_test.cc
+add_executable(status_helper_test
+ test/core/gprpp/status_helper_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
-target_include_directories(status_metadata_test
+target_include_directories(status_helper_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -13866,7 +15300,7 @@ target_include_directories(status_metadata_test
${_gRPC_PROTO_GENS_DIR}
)
-target_link_libraries(status_metadata_test
+target_link_libraries(status_helper_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
@@ -14002,6 +15436,42 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
+add_executable(streams_not_seen_test
+ test/core/end2end/cq_verifier.cc
+ test/core/transport/chttp2/streams_not_seen_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(streams_not_seen_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(streams_not_seen_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(string_ref_test
test/cpp/util/string_ref_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -14038,8 +15508,156 @@ target_link_libraries(string_ref_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(table_test
+ test/core/gprpp/table_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(table_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(table_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::optional
+ absl::utility
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(test_core_gprpp_time_test
+ src/core/lib/gprpp/time.cc
+ test/core/gprpp/time_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(test_core_gprpp_time_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(test_core_gprpp_time_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(test_core_security_credentials_test
+ test/core/security/credentials_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(test_core_security_credentials_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(test_core_security_credentials_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(test_core_slice_slice_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/slice/slice.cc
+ src/core/lib/slice/slice_refcount.cc
+ src/core/lib/slice/slice_string_helpers.cc
+ test/core/slice/slice_test.cc
+ test/core/util/build.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(test_core_slice_slice_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(test_core_slice_slice_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(test_cpp_client_credentials_test
test/cpp/client/credentials_test.cc
+ test/cpp/util/tls_test_utils.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -14076,6 +15694,7 @@ if(gRPC_BUILD_TESTS)
add_executable(test_cpp_server_credentials_test
test/cpp/server/credentials_test.cc
+ test/cpp/util/tls_test_utils.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -14215,6 +15834,43 @@ target_link_libraries(thread_manager_test
endif()
if(gRPC_BUILD_TESTS)
+
+add_executable(thread_quota_test
+ src/core/lib/debug/trace.cc
+ src/core/lib/resource_quota/thread_quota.cc
+ test/core/resource_quota/thread_quota_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(thread_quota_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(thread_quota_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ gpr
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(thread_stress_test
@@ -14342,6 +15998,41 @@ target_link_libraries(time_util_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(timeout_encoding_test
+ test/core/transport/timeout_encoding_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(timeout_encoding_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(timeout_encoding_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(timer_test
test/cpp/common/timer_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -14378,6 +16069,90 @@ target_link_libraries(timer_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(tls_certificate_verifier_test
+ test/cpp/security/tls_certificate_verifier_test.cc
+ test/cpp/util/tls_test_utils.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(tls_certificate_verifier_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(tls_certificate_verifier_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(tls_key_export_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ test/cpp/end2end/tls_key_export_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(tls_key_export_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(tls_key_export_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(tls_security_connector_test
test/core/security/tls_security_connector_test.cc
third_party/googletest/googletest/src/gtest-all.cc
@@ -14413,6 +16188,41 @@ target_link_libraries(tls_security_connector_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(tls_test
+ test/core/gpr/tls_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(tls_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(tls_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(too_many_pings_test
test/core/end2end/cq_verifier.cc
test/core/transport/chttp2/too_many_pings_test.cc
@@ -14450,6 +16260,205 @@ target_link_libraries(too_many_pings_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(transport_stream_receiver_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/transport_stream_receiver_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(transport_stream_receiver_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(transport_stream_receiver_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(try_join_test
+ test/core/promise/try_join_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(try_join_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(try_join_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::status
+ absl::statusor
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(try_seq_metadata_test
+ test/core/promise/try_seq_metadata_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(try_seq_metadata_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(try_seq_metadata_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(try_seq_test
+ test/core/promise/try_seq_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(try_seq_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(try_seq_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ absl::status
+ absl::statusor
+ absl::variant
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(unknown_frame_bad_client_test
test/core/bad_client/bad_client.cc
test/core/bad_client/tests/unknown_frame.cc
@@ -14522,6 +16531,40 @@ target_link_libraries(uri_parser_test
endif()
if(gRPC_BUILD_TESTS)
+add_executable(useful_test
+ test/core/gpr/useful_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(useful_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(useful_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
add_executable(window_overflow_bad_client_test
test/core/bad_client/bad_client.cc
test/core/bad_client/tests/window_overflow.cc
@@ -14558,6 +16601,188 @@ target_link_libraries(window_overflow_bad_client_test
endif()
if(gRPC_BUILD_TESTS)
+
+add_executable(wire_reader_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/mock_objects.cc
+ test/core/transport/binder/wire_reader_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(wire_reader_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(wire_reader_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
+
+add_executable(wire_writer_test
+ src/core/ext/transport/binder/client/binder_connector.cc
+ src/core/ext/transport/binder/client/channel_create.cc
+ src/core/ext/transport/binder/client/channel_create_impl.cc
+ src/core/ext/transport/binder/client/connection_id_generator.cc
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ src/core/ext/transport/binder/client/jni_utils.cc
+ src/core/ext/transport/binder/client/security_policy_setting.cc
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ src/core/ext/transport/binder/server/binder_server.cc
+ src/core/ext/transport/binder/server/binder_server_credentials.cc
+ src/core/ext/transport/binder/transport/binder_transport.cc
+ src/core/ext/transport/binder/utils/ndk_binder.cc
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ src/core/ext/transport/binder/wire_format/binder_android.cc
+ src/core/ext/transport/binder/wire_format/binder_constants.cc
+ src/core/ext/transport/binder/wire_format/transaction.cc
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ src/core/ext/transport/binder/wire_format/wire_writer.cc
+ src/cpp/client/channel_cc.cc
+ src/cpp/client/client_callback.cc
+ src/cpp/client/client_context.cc
+ src/cpp/client/client_interceptor.cc
+ src/cpp/client/create_channel.cc
+ src/cpp/client/create_channel_internal.cc
+ src/cpp/client/create_channel_posix.cc
+ src/cpp/client/credentials_cc.cc
+ src/cpp/codegen/codegen_init.cc
+ src/cpp/common/alarm.cc
+ src/cpp/common/channel_arguments.cc
+ src/cpp/common/channel_filter.cc
+ src/cpp/common/completion_queue_cc.cc
+ src/cpp/common/core_codegen.cc
+ src/cpp/common/resource_quota_cc.cc
+ src/cpp/common/rpc_method.cc
+ src/cpp/common/validate_service_config.cc
+ src/cpp/common/version_cc.cc
+ src/cpp/server/async_generic_service.cc
+ src/cpp/server/channel_argument_option.cc
+ src/cpp/server/create_default_thread_pool.cc
+ src/cpp/server/dynamic_thread_pool.cc
+ src/cpp/server/external_connection_acceptor_impl.cc
+ src/cpp/server/health/default_health_check_service.cc
+ src/cpp/server/health/health_check_service.cc
+ src/cpp/server/health/health_check_service_server_builder_option.cc
+ src/cpp/server/server_builder.cc
+ src/cpp/server/server_callback.cc
+ src/cpp/server/server_cc.cc
+ src/cpp/server/server_context.cc
+ src/cpp/server/server_credentials.cc
+ src/cpp/server/server_posix.cc
+ src/cpp/thread_manager/thread_manager.cc
+ src/cpp/util/byte_buffer_cc.cc
+ src/cpp/util/status.cc
+ src/cpp/util/string_ref.cc
+ src/cpp/util/time_cc.cc
+ test/core/transport/binder/mock_objects.cc
+ test/core/transport/binder/wire_writer_test.cc
+ third_party/googletest/googletest/src/gtest-all.cc
+ third_party/googletest/googlemock/src/gmock-all.cc
+)
+
+target_include_directories(wire_writer_test
+ PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
+ ${_gRPC_RE2_INCLUDE_DIR}
+ ${_gRPC_SSL_INCLUDE_DIR}
+ ${_gRPC_UPB_GENERATED_DIR}
+ ${_gRPC_UPB_GRPC_GENERATED_DIR}
+ ${_gRPC_UPB_INCLUDE_DIR}
+ ${_gRPC_XXHASH_INCLUDE_DIR}
+ ${_gRPC_ZLIB_INCLUDE_DIR}
+ third_party/googletest/googletest/include
+ third_party/googletest/googletest
+ third_party/googletest/googlemock/include
+ third_party/googletest/googlemock
+ ${_gRPC_PROTO_GENS_DIR}
+)
+
+target_link_libraries(wire_writer_test
+ ${_gRPC_PROTOBUF_LIBRARIES}
+ ${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc_test_util
+)
+
+
+endif()
+if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(work_serializer_test
@@ -14610,11 +16835,12 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
+ test/core/event_engine/test_init.cc
+ test/core/util/build.cc
test/core/util/cmdline.cc
test/core/util/fuzzer_util.cc
test/core/util/grpc_profiler.cc
test/core/util/histogram.cc
- test/core/util/memory_counters.cc
test/core/util/mock_endpoint.cc
test/core/util/parse_hexstring.cc
test/core/util/passthru_endpoint.cc
@@ -14630,7 +16856,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
test/core/util/test_config.cc
test/core/util/test_tcp_server.cc
test/core/util/tracer_util.cc
- test/core/util/trickle_endpoint.cc
test/cpp/performance/writes_per_rpc_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
@@ -14753,7 +16978,7 @@ add_executable(xds_credentials_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
test/cpp/end2end/test_service_impl.cc
- test/cpp/end2end/xds_credentials_end2end_test.cc
+ test/cpp/end2end/xds/xds_credentials_end2end_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -14824,6 +17049,14 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(xds_end2end_test
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls_config.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls_config.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls_config.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lookup/v1/rls_config.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/duplicate/echo_duplicate.pb.h
@@ -14900,6 +17133,14 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/expr.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/expr.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/expr.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/expr.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/fault.pb.h
@@ -14912,6 +17153,10 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_filter_rbac.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_filter_rbac.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_filter_rbac.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/http_filter_rbac.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/listener.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/listener.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/listener.pb.h
@@ -14924,6 +17169,14 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/lrs.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/lrs.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/lrs.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/metadata.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/metadata.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/metadata.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/metadata.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/path.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/path.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/path.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/path.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.h
@@ -14936,6 +17189,10 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/range.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/range.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/range.grpc.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/rbac.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/rbac.grpc.pb.cc
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/rbac.pb.h
+ ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/rbac.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/regex.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/regex.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/regex.pb.h
@@ -14957,8 +17214,13 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/tls.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/tls.grpc.pb.h
src/cpp/server/csds/csds.cc
+ test/cpp/end2end/connection_delay_injector.cc
+ test/cpp/end2end/rls_server.cc
test/cpp/end2end/test_service_impl.cc
- test/cpp/end2end/xds_end2end_test.cc
+ test/cpp/end2end/xds/xds_end2end_test.cc
+ test/cpp/end2end/xds/xds_end2end_test_lib.cc
+ test/cpp/end2end/xds/xds_server.cc
+ test/cpp/util/tls_test_utils.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
@@ -14985,6 +17247,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
target_link_libraries(xds_end2end_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_test_config
grpc++_test_util
)
@@ -15134,500 +17397,6 @@ target_link_libraries(xds_interop_server
endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(alts_credentials_fuzzer_one_entry
- test/core/security/alts_credentials_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(alts_credentials_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(alts_credentials_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(client_fuzzer_one_entry
- test/core/end2end/fuzzers/client_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(client_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(client_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(hpack_parser_fuzzer_test_one_entry
- test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(hpack_parser_fuzzer_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(hpack_parser_fuzzer_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(http_request_fuzzer_test_one_entry
- test/core/http/request_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(http_request_fuzzer_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(http_request_fuzzer_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(http_response_fuzzer_test_one_entry
- test/core/http/response_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(http_response_fuzzer_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(http_response_fuzzer_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(json_fuzzer_test_one_entry
- test/core/json/fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(json_fuzzer_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(json_fuzzer_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(nanopb_fuzzer_response_test_one_entry
- test/core/nanopb/fuzzer_response.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(nanopb_fuzzer_response_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(nanopb_fuzzer_response_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(nanopb_fuzzer_serverlist_test_one_entry
- test/core/nanopb/fuzzer_serverlist.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(nanopb_fuzzer_serverlist_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(nanopb_fuzzer_serverlist_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(percent_decode_fuzzer_one_entry
- test/core/slice/percent_decode_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(percent_decode_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(percent_decode_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(percent_encode_fuzzer_one_entry
- test/core/slice/percent_encode_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(percent_encode_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(percent_encode_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(server_fuzzer_one_entry
- test/core/end2end/fuzzers/server_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(server_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(server_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(ssl_server_fuzzer_one_entry
- test/core/security/ssl_server_fuzzer.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(ssl_server_fuzzer_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(ssl_server_fuzzer_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
-if(gRPC_BUILD_TESTS)
-
-add_executable(uri_fuzzer_test_one_entry
- test/core/uri/uri_fuzzer_test.cc
- test/core/util/one_corpus_entry_fuzzer.cc
- third_party/googletest/googletest/src/gtest-all.cc
- third_party/googletest/googlemock/src/gmock-all.cc
-)
-
-target_include_directories(uri_fuzzer_test_one_entry
- PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
- ${_gRPC_RE2_INCLUDE_DIR}
- ${_gRPC_SSL_INCLUDE_DIR}
- ${_gRPC_UPB_GENERATED_DIR}
- ${_gRPC_UPB_GRPC_GENERATED_DIR}
- ${_gRPC_UPB_INCLUDE_DIR}
- ${_gRPC_XXHASH_INCLUDE_DIR}
- ${_gRPC_ZLIB_INCLUDE_DIR}
- third_party/googletest/googletest/include
- third_party/googletest/googletest
- third_party/googletest/googlemock/include
- third_party/googletest/googlemock
- ${_gRPC_PROTO_GENS_DIR}
-)
-
-target_link_libraries(uri_fuzzer_test_one_entry
- ${_gRPC_PROTOBUF_LIBRARIES}
- ${_gRPC_ALLTARGETS_LIBRARIES}
- absl::flags
- grpc_test_util
- grpc++_test_config
-)
-
-
-endif()
@@ -15686,7 +17455,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
- "absl_base absl_memory absl_optional absl_status absl_str_format absl_strings absl_synchronization absl_time"
+ "absl_base absl_cord absl_core_headers absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time"
"-lgpr"
""
"gpr.pc")
@@ -15696,7 +17465,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
- "gpr openssl absl_base absl_bind_front absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
+ "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant"
"-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz"
""
"grpc.pc")
@@ -15706,7 +17475,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
- "gpr absl_base absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
+ "gpr absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant"
"-lgrpc_unsecure"
""
"grpc_unsecure.pc")
@@ -15716,7 +17485,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
- "grpc absl_base absl_bind_front absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
+ "grpc absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant"
"-lgrpc++"
""
"grpc++.pc")
@@ -15726,7 +17495,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
- "grpc_unsecure absl_base absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time"
+ "grpc_unsecure absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_utility absl_variant"
"-lgrpc++_unsecure"
""
"grpc++_unsecure.pc")
diff --git a/grpc/CONCEPTS.md b/grpc/CONCEPTS.md
index 034d58e4..c85974ed 100644
--- a/grpc/CONCEPTS.md
+++ b/grpc/CONCEPTS.md
@@ -14,7 +14,7 @@ of methods). From this description, gRPC will generate client and server side in
in any of the supported languages. The server implements
the service interface, which can be remotely invoked by the client interface.
-By default, gRPC uses [Protocol Buffers](https://github.com/google/protobuf) as the
+By default, gRPC uses [Protocol Buffers](https://github.com/protocolbuffers/protobuf) as the
Interface Definition Language (IDL) for describing both the service interface
and the structure of the payload messages. It is possible to use other
alternatives if desired.
@@ -54,10 +54,11 @@ clients and servers. A concrete embedding over HTTP/2 completes the picture by
fleshing out the details of each of the required operations.
## Abstract gRPC protocol
-A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
+A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. A client signals end of its message stream by means of an underlying lower level protocol. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
## Implementation over HTTP/2
-The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).
+The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers). A client signals end of its message stream by setting `END_STREAM` flag on the last DATA frame.
+For a detailed description see [doc/PROTOCOL-HTTP2.md](doc/PROTOCOL-HTTP2.md).
## Flow Control
gRPC uses the flow control mechanism in HTTP/2. This enables fine-grained control of memory used for buffering in-flight messages.
diff --git a/grpc/LICENSE b/grpc/LICENSE
index d6456956..74ec4aa7 100644
--- a/grpc/LICENSE
+++ b/grpc/LICENSE
@@ -200,3 +200,43 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+-----------------------------------------------------------
+
+BSD 3-Clause License
+
+Copyright 2016, Google Inc.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+-----------------------------------------------------------
+
+Mozilla Public License, v. 2.0
+
+This Source Code Form is subject to the terms of the Mozilla Public License,
+v. 2.0. If a copy of the MPL was not distributed with this file, You can
+obtain one at https://mozilla.org/MPL/2.0/.
diff --git a/grpc/MAINTAINERS.md b/grpc/MAINTAINERS.md
index f338c6b1..6f6c8a5f 100644
--- a/grpc/MAINTAINERS.md
+++ b/grpc/MAINTAINERS.md
@@ -13,6 +13,7 @@ for general contribution guidelines.
- [arjunroy](https://github.com/arjunroy), Google LLC
- [AspirinSJL](https://github.com/AspirinSJL), Google LLC
- [bogdandrutu](https://github.com/bogdandrutu), Google LLC
+- [ctiller](https://github.com/ctiller), Google LLC
- [daniel-j-born](https://github.com/daniel-j-born), Google LLC
- [dapengzhang0](https://github.com/dapengzhang0), Google LLC
- [dfawley](https://github.com/dfawley), Google LLC
@@ -64,7 +65,6 @@ for general contribution guidelines.
## Emeritus Maintainers (in alphabetical order)
- [adelez](https://github.com/adelez), Google LLC
- [billfeng327](https://github.com/billfeng327), Google LLC
-- [ctiller](https://github.com/ctiller), Google LLC
- [dgquintas](https://github.com/dgquintas), Google LLC
- [fengli79](https://github.com/fengli79), Google LLC
- [jcanizales](https://github.com/jcanizales), Google LLC
diff --git a/grpc/PYTHON-MANIFEST.in b/grpc/PYTHON-MANIFEST.in
index 890a2faa..355f5bf1 100644
--- a/grpc/PYTHON-MANIFEST.in
+++ b/grpc/PYTHON-MANIFEST.in
@@ -24,3 +24,4 @@ include requirements.txt
include etc/roots.pem
include Makefile
include LICENSE
+include _metadata.py
diff --git a/grpc/Package.swift b/grpc/Package.swift
index 66e4a740..0567b76c 100644
--- a/grpc/Package.swift
+++ b/grpc/Package.swift
@@ -23,11 +23,12 @@ let package = Package(
.package(
name: "abseil",
url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
- .revision("05d8107f2971a37e6c77245b7c4c6b0a7e97bc99")
+ "0.20220203.0"..<"0.20220204.0"
),
- .package(name: "BoringSSL-GRPC",
+ .package(
+ name: "BoringSSL-GRPC",
url: "https://github.com/firebase/boringssl-SwiftPM.git",
- .branch("7bcafa2660bc58715c39637494550d1ed7cd7229")
+ "0.9.0"..<"0.10.0"
),
],
@@ -41,38 +42,20 @@ let package = Package(
path: ".",
exclude: [
"src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc",
- "src/core/ext/filters/client_channel/xds/xds_channel.cc",
"src/core/ext/filters/load_reporting/",
"src/core/ext/transport/cronet/",
- "src/core/ext/upb-generated/third_party/",
- "src/core/ext/upb-generated/src/proto/grpc/auth/",
- "src/core/ext/upbdefs-generated/envoy/config/rbac/",
- "src/core/ext/upbdefs-generated/google/api/expr/",
- "src/core/ext/upbdefs-generated/src/",
- "src/core/ext/upbdefs-generated/third_party/",
- "src/core/ext/upbdefs-generated/udpa/data/",
"src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h",
"src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc",
"src/core/lib/surface/init_unsecure.cc",
- "src/core/lib/security/authorization/",
+ "src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.cc",
"third_party/re2/re2/testing/",
"third_party/re2/re2/fuzzing/",
"third_party/re2/util/benchmark.cc",
"third_party/re2/util/test.cc",
"third_party/re2/util/fuzz.cc",
- "third_party/upb/upb/sink.c",
- "third_party/upb/upb/json_decode.c",
- "third_party/upb/upb/json_encode.c",
- "third_party/upb/upb/handlers.h",
- "third_party/upb/upb/sink.h",
- "third_party/upb/upb/json_encode.h",
- "third_party/upb/upb/json_decode.h",
- "third_party/upb/upb/handlers-inl.h",
- "third_party/upb/upb/handlers.c",
"third_party/upb/upb/bindings/",
- "third_party/upb/upb/json/",
- "third_party/upb/upb/pb/",
+ "third_party/upb/upb/msg_test.cc",
],
sources: [
"src/core/ext/filters/",
@@ -86,7 +69,6 @@ let package = Package(
"third_party/re2/re2/",
"third_party/re2/util/",
"third_party/upb/upb/",
- "third_party/upb/third_party/wyhash/wyhash.h",
"third_party/xxhash/xxhash.h",
],
publicHeadersPath: "spm-core-include",
@@ -99,7 +81,6 @@ let package = Package(
.headerSearchPath("src/core/ext/upb-generated/"),
.headerSearchPath("src/core/ext/upbdefs-generated/"),
.define("GRPC_ARES", to: "0"),
- .unsafeFlags(["-Wno-module-import-in-extern-c"]),
],
linkerSettings: [
.linkedFramework("CoreFoundation"),
@@ -137,9 +118,15 @@ let package = Package(
.headerSearchPath("include/"),
.headerSearchPath("third_party/upb/"),
.headerSearchPath("src/core/ext/upb-generated"),
- .unsafeFlags(["-Wno-module-import-in-extern-c"]),
]
),
+ .testTarget(
+ name: "build-test",
+ dependencies: [
+ "gRPC-cpp",
+ ],
+ path: "test/spm_build"
+ ),
],
cLanguageStandard: .gnu11,
cxxLanguageStandard: .cxx11
diff --git a/grpc/README.md b/grpc/README.md
index a392de0e..e9a18c35 100644
--- a/grpc/README.md
+++ b/grpc/README.md
@@ -1,7 +1,8 @@
-gRPC - An RPC library and framework
-===================================
+# gRPC – An RPC library and framework
-gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.
+gRPC is a modern, open source, high-performance remote procedure call (RPC)
+framework that can run anywhere. gRPC enables client and server applications to
+communicate transparently, and simplifies the building of connected systems.
<table>
<tr>
@@ -16,72 +17,88 @@ gRPC is a modern, open source, high-performance remote procedure call (RPC) fram
[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-# To start using gRPC
+## To start using gRPC
-To maximize usability, gRPC supports the standard method for adding dependencies to a user's chosen language (if there is one).
-In most languages, the gRPC runtime comes as a package available in a user's language package manager.
+To maximize usability, gRPC supports the standard method for adding dependencies
+to a user's chosen language (if there is one). In most languages, the gRPC
+runtime comes as a package available in a user's language package manager.
-For instructions on how to use the language-specific gRPC runtime for a project, please refer to these documents
+For instructions on how to use the language-specific gRPC runtime for a project,
+please refer to these documents
- * [C++](src/cpp): follow the instructions under the `src/cpp` directory
- * [C#](src/csharp): NuGet package `Grpc`
- * [Dart](https://github.com/grpc/grpc-dart): pub package `grpc`
- * [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
- * [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central Repository
- * [Kotlin](https://github.com/grpc/grpc-kotlin): Use JARs from Maven Central Repository
- * [Node](https://github.com/grpc/grpc-node): `npm install grpc`
- * [Objective-C](src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec
- * [PHP](src/php): `pecl install grpc`
- * [Python](src/python/grpcio): `pip install grpcio`
- * [Ruby](src/ruby): `gem install grpc`
- * [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions
+- [C++](src/cpp): follow the instructions under the `src/cpp` directory
+- [C#](src/csharp): NuGet package `Grpc`
+- [Dart](https://github.com/grpc/grpc-dart): pub package `grpc`
+- [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc`
+- [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central
+ Repository
+- [Kotlin](https://github.com/grpc/grpc-kotlin): Use JARs from Maven Central
+ Repository
+- [Node](https://github.com/grpc/grpc-node): `npm install grpc`
+- [Objective-C](src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec
+- [PHP](src/php): `pecl install grpc`
+- [Python](src/python/grpcio): `pip install grpcio`
+- [Ruby](src/ruby): `gem install grpc`
+- [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions
-Per-language quickstart guides and tutorials can be found in the [documentation section on the grpc.io website](https://grpc.io/docs/). Code examples are available in the [examples](examples) directory.
+Per-language quickstart guides and tutorials can be found in the
+[documentation section on the grpc.io website](https://grpc.io/docs/). Code
+examples are available in the [examples](examples) directory.
-Precompiled bleeding-edge package builds of gRPC `master` branch's `HEAD` are uploaded daily to [packages.grpc.io](https://packages.grpc.io).
+Precompiled bleeding-edge package builds of gRPC `master` branch's `HEAD` are
+uploaded daily to [packages.grpc.io](https://packages.grpc.io).
-# To start developing gRPC
+## To start developing gRPC
Contributions are welcome!
-Please read [How to contribute](CONTRIBUTING.md) which will guide you through the entire workflow of how to build the source code, how to run the tests, and how to contribute changes to
-the gRPC codebase.
-The "How to contribute" document also contains info on how the contribution process works and contains best practices for creating contributions.
+Please read [How to contribute](CONTRIBUTING.md) which will guide you through
+the entire workflow of how to build the source code, how to run the tests, and
+how to contribute changes to the gRPC codebase. The "How to contribute" document
+also contains info on how the contribution process works and contains best
+practices for creating contributions.
-# Troubleshooting
+## Troubleshooting
-Sometimes things go wrong. Please check out the [Troubleshooting guide](TROUBLESHOOTING.md) if you are experiencing issues with gRPC.
+Sometimes things go wrong. Please check out the
+[Troubleshooting guide](TROUBLESHOOTING.md) if you are experiencing issues with
+gRPC.
-# Performance
+## Performance
-See the [Performance dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584) for performance numbers of master branch daily builds.
+See the
+[Performance dashboard](https://grafana-dot-grpc-testing.appspot.com/)
+for performance numbers of master branch daily builds.
-# Concepts
+## Concepts
See [gRPC Concepts](CONCEPTS.md)
-# About This Repository
-
-This repository contains source code for gRPC libraries implemented in multiple languages written on top of a shared C core library [src/core](src/core).
-
-Libraries in different languages may be in various states of development. We are seeking contributions for all of these libraries:
-
-| Language | Source |
-|-------------------------|-------------------------------------|
-| Shared C [core library] | [src/core](src/core) |
-| C++ | [src/cpp](src/cpp) |
-| Ruby | [src/ruby](src/ruby) |
-| Python | [src/python](src/python) |
-| PHP | [src/php](src/php) |
-| C# (core library based) | [src/csharp](src/csharp) |
-| Objective-C | [src/objective-c](src/objective-c) |
-
-| Language | Source repo |
-|-------------------------|------------------------------------------------------|
-| Java | [grpc-java](https://github.com/grpc/grpc-java) |
-| Kotlin | [grpc-kotlin](https://github.com/grpc/grpc-kotlin) |
-| Go | [grpc-go](https://github.com/grpc/grpc-go) |
-| NodeJS | [grpc-node](https://github.com/grpc/grpc-node) |
-| WebJS | [grpc-web](https://github.com/grpc/grpc-web) |
-| Dart | [grpc-dart](https://github.com/grpc/grpc-dart) |
-| .NET (pure C# impl.) | [grpc-dotnet](https://github.com/grpc/grpc-dotnet) |
+## About This Repository
+
+This repository contains source code for gRPC libraries implemented in multiple
+languages written on top of a shared C core library [src/core](src/core).
+
+Libraries in different languages may be in various states of development. We are
+seeking contributions for all of these libraries:
+
+| Language | Source |
+| ----------------------- | ---------------------------------- |
+| Shared C [core library] | [src/core](src/core) |
+| C++ | [src/cpp](src/cpp) |
+| Ruby | [src/ruby](src/ruby) |
+| Python | [src/python](src/python) |
+| PHP | [src/php](src/php) |
+| C# (core library based) | [src/csharp](src/csharp) |
+| Objective-C | [src/objective-c](src/objective-c) |
+
+| Language | Source repo |
+| -------------------- | -------------------------------------------------- |
+| Java | [grpc-java](https://github.com/grpc/grpc-java) |
+| Kotlin | [grpc-kotlin](https://github.com/grpc/grpc-kotlin) |
+| Go | [grpc-go](https://github.com/grpc/grpc-go) |
+| NodeJS | [grpc-node](https://github.com/grpc/grpc-node) |
+| WebJS | [grpc-web](https://github.com/grpc/grpc-web) |
+| Dart | [grpc-dart](https://github.com/grpc/grpc-dart) |
+| .NET (pure C# impl.) | [grpc-dotnet](https://github.com/grpc/grpc-dotnet) |
+| Swift | [grpc-swift](https://github.com/grpc/grpc-swift) |
diff --git a/grpc/Rakefile b/grpc/Rakefile
index faae2106..e313627e 100755
--- a/grpc/Rakefile
+++ b/grpc/Rakefile
@@ -23,12 +23,6 @@ end
# Add the extension compiler task
Rake::ExtensionTask.new('grpc_c', spec) do |ext|
- unless RUBY_PLATFORM =~ /darwin/
- # TODO: also set "no_native to true" for mac if possible. As is,
- # "no_native" can only be set if the RUBY_PLATFORM doing
- # cross-compilation is contained in the "ext.cross_platform" array.
- ext.no_native = true
- end
ext.source_pattern = '**/*.{c,h}'
ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc')
ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc')
@@ -36,17 +30,20 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
ext.cross_platform = [
'x86-mingw32', 'x64-mingw32',
'x86_64-linux', 'x86-linux',
+ 'x86_64-darwin', 'arm64-darwin',
'universal-darwin'
]
ext.cross_compiling do |spec|
- spec.files = %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby )
- spec.files += Dir.glob('src/ruby/bin/**/*')
- spec.files += Dir.glob('src/ruby/ext/**/*')
- spec.files += Dir.glob('src/ruby/lib/**/*')
- spec.files += Dir.glob('src/ruby/pb/**/*')
+ spec.files = spec.files.select {
+ |file| file.start_with?(
+ "src/ruby/bin/", "src/ruby/ext/", "src/ruby/lib/", "src/ruby/pb/")
+ }
+ spec.files += %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby )
end
end
+CLEAN.add "src/ruby/lib/grpc/[0-9].[0-9]", "src/ruby/lib/grpc/grpc_c.{bundle,so}"
+
# Define the test suites
SPEC_SUITES = [
{ id: :wrapper, title: 'wrapper layer', files: %w(src/ruby/spec/*.rb) },
@@ -81,10 +78,26 @@ namespace :suite do
end
end
-desc 'Build the Windows gRPC DLLs for Ruby'
-task 'dlls' do
+desc 'Build the Windows gRPC DLLs for Ruby. The argument contains the list of platforms for which to build dll. Empty placeholder files will be created for platforms that were not selected.'
+task 'dlls', [:plat] do |t, args|
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
verbose = ENV['V'] || '0'
+ # use env variable to set artifact build paralellism
+ nproc_override = ENV['GRPC_RUBY_BUILD_PROCS'] || `nproc`.strip
+ plat_list = args[:plat]
+
+ build_configs = []
+ w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby', platform: 'x64-mingw32' }
+ w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby', platform: 'x86-mingw32' }
+ [w64, w32].each do |config|
+ if plat_list.include?(config[:platform])
+ # build the DLL (as grpc_c.*.ruby)
+ build_configs.append(config)
+ else
+ # create an empty grpc_c.*.ruby file as a placeholder
+ FileUtils.touch config[:out]
+ end
+ end
env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DNTDDI_VERSION=0x06000000 -DUNICODE -D_UNICODE -Wno-unused-variable -Wno-unused-result -DCARES_STATICLIB -Wno-error=conversion -Wno-sign-compare -Wno-parentheses -Wno-format -DWIN32_LEAN_AND_MEAN" '
env += 'CFLAGS="-Wno-incompatible-pointer-types" '
@@ -96,34 +109,46 @@ task 'dlls' do
env += 'EMBED_CARES=true '
env += 'BUILDDIR=/tmp '
env += "V=#{verbose} "
+ env += "GRPC_RUBY_BUILD_PROCS=#{nproc_override} "
+
out = GrpcBuildConfig::CORE_WINDOWS_DLL
- w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby', platform: 'x64-mingw32' }
- w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby', platform: 'x86-mingw32' }
+ # propagate env variables with ccache configuration to the rake-compiler-dock docker container
+ # and setup ccache symlinks as needed.
+ # TODO(jtattermusch): deduplicate creation of prepare_ccache_cmd
+ prepare_ccache_cmd = "export GRPC_BUILD_ENABLE_CCACHE=\"#{ENV.fetch('GRPC_BUILD_ENABLE_CCACHE', '')}\" && "
+ prepare_ccache_cmd += "export CCACHE_SECONDARY_STORAGE=\"#{ENV.fetch('CCACHE_SECONDARY_STORAGE', '')}\" && "
+ prepare_ccache_cmd += "export PATH=\"$PATH:/usr/local/bin\" && "
+ prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
- [ w64, w32 ].each do |opt|
+ build_configs.each do |opt|
env_comp = "CC=#{opt[:cross]}-gcc "
env_comp += "CXX=#{opt[:cross]}-g++ "
env_comp += "LD=#{opt[:cross]}-gcc "
env_comp += "LDXX=#{opt[:cross]}-g++ "
- run_rake_compiler opt[:platform], <<-EOT
+ run_rake_compiler(opt[:platform], <<~EOT)
+ #{prepare_ccache_cmd} && \
gem update --system --no-document && \
- #{env} #{env_comp} make -j`nproc` #{out} && \
+ #{env} #{env_comp} make -j#{nproc_override} #{out} && \
#{opt[:cross]}-strip -x -S #{out} && \
cp #{out} #{opt[:out]}
EOT
end
-
end
-desc 'Build the native gem file under rake_compiler_dock'
-task 'gem:native' do
+desc 'Build the native gem file under rake_compiler_dock. Optionally one can pass argument to build only native gem for a chosen platform.'
+task 'gem:native', [:plat] do |t, args|
verbose = ENV['V'] || '0'
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
- ruby_cc_versions = ['3.0.0', '2.7.0', '2.6.0', '2.5.0', '2.4.0'].join(':')
+ ruby_cc_versions = ['3.1.0', '3.0.0', '2.7.0', '2.6.0', '2.5.0'].join(':')
+ selected_plat = "#{args[:plat]}"
if RUBY_PLATFORM =~ /darwin/
+ if !selected_plat.empty? && selected_plat != 'darwin'
+ fail "Cannot pass platform as an argument when on Darwin."
+ end
+
FileUtils.touch 'grpc_c.32.ruby'
FileUtils.touch 'grpc_c.64.ruby'
unless '2.5' == /(\d+\.\d+)/.match(RUBY_VERSION).to_s
@@ -131,30 +156,72 @@ task 'gem:native' do
"invoked on macos with ruby #{RUBY_VERSION}. The ruby macos artifact " \
"build should be running on ruby 2.5."
end
- system "rake cross native gem RUBY_CC_VERSION=#{ruby_cc_versions} V=#{verbose} GRPC_CONFIG=#{grpc_config}"
+ system "bundle exec rake cross native gem RUBY_CC_VERSION=#{ruby_cc_versions} V=#{verbose} GRPC_CONFIG=#{grpc_config}"
else
- Rake::Task['dlls'].execute
- ['x86-mingw32', 'x64-mingw32'].each do |plat|
- run_rake_compiler plat, <<-EOT
+ # use env variable to set artifact build paralellism
+ nproc_override = ENV['GRPC_RUBY_BUILD_PROCS'] || `nproc`.strip
+
+ # propagate env variables with ccache configuration to the rake-compiler-dock docker container
+ # and setup ccache symlinks as needed.
+ prepare_ccache_cmd = "export GRPC_BUILD_ENABLE_CCACHE=\"#{ENV.fetch('GRPC_BUILD_ENABLE_CCACHE', '')}\" && "
+ prepare_ccache_cmd += "export CCACHE_SECONDARY_STORAGE=\"#{ENV.fetch('CCACHE_SECONDARY_STORAGE', '')}\" && "
+ prepare_ccache_cmd += "export PATH=\"$PATH:/usr/local/bin\" && "
+ prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
+
+ supported_windows_platforms = ['x86-mingw32', 'x64-mingw32']
+ supported_unix_platforms = ['x86_64-linux', 'x86-linux', 'x86_64-darwin', 'arm64-darwin']
+ supported_platforms = supported_windows_platforms + supported_unix_platforms
+
+ if selected_plat.empty?
+ # build everything
+ windows_platforms = supported_windows_platforms
+ unix_platforms = supported_unix_platforms
+ else
+ # build only selected platform
+ if supported_windows_platforms.include?(selected_plat)
+ windows_platforms = [selected_plat]
+ unix_platforms = []
+ elsif supported_unix_platforms.include?(selected_plat)
+ windows_platforms = []
+ unix_platforms = [selected_plat]
+ else
+ fail "Unsupported platform '#{selected_plat}' passed as an argument."
+ end
+ end
+
+ # Create the windows dlls or create the empty placeholders
+ Rake::Task['dlls'].execute(plat: windows_platforms)
+
+ windows_platforms.each do |plat|
+ run_rake_compiler(plat, <<~EOT)
+ #{prepare_ccache_cmd} && \
gem update --system --no-document && \
bundle && \
- rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
+ bundle exec rake clean && \
+ bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
RUBY_CC_VERSION=#{ruby_cc_versions} \
V=#{verbose} \
- GRPC_CONFIG=#{grpc_config}
+ GRPC_CONFIG=#{grpc_config} \
+ GRPC_RUBY_BUILD_PROCS=#{nproc_override}
EOT
end
- # Truncate grpc_c.*.ruby files because they're for Windows only.
+
+ # Truncate grpc_c.*.ruby files because they're for Windows only and we don't want
+ # them to take up space in the gems that don't target windows.
File.truncate('grpc_c.32.ruby', 0)
File.truncate('grpc_c.64.ruby', 0)
- ['x86_64-linux', 'x86-linux'].each do |plat|
- run_rake_compiler plat, <<-EOT
+
+ unix_platforms.each do |plat|
+ run_rake_compiler(plat, <<~EOT)
+ #{prepare_ccache_cmd} && \
gem update --system --no-document && \
bundle && \
- rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
+ bundle exec rake clean && \
+ bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \
RUBY_CC_VERSION=#{ruby_cc_versions} \
V=#{verbose} \
- GRPC_CONFIG=#{grpc_config}
+ GRPC_CONFIG=#{grpc_config} \
+ GRPC_RUBY_BUILD_PROCS=#{nproc_override}
EOT
end
end
diff --git a/grpc/WORKSPACE b/grpc/WORKSPACE
index 5d772805..782abc63 100644
--- a/grpc/WORKSPACE
+++ b/grpc/WORKSPACE
@@ -10,31 +10,15 @@ load("//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
-register_execution_platforms(
- "//third_party/toolchains:rbe_windows",
-)
-
-register_toolchains(
- "//third_party/toolchains/bazel_0.26.0_rbe_windows:cc-toolchain-x64_windows",
-)
-
-load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_exec_properties_dict", "custom_exec_properties", "merge_dicts")
+load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict", "custom_exec_properties")
custom_exec_properties(
name = "grpc_custom_exec_properties",
constants = {
- "LARGE_MACHINE": merge_dicts(
- create_exec_properties_dict(),
- # TODO(jtattermusch): specifying 'labels = {"abc": "xyz"}' in create_exec_properties_dict
- # is not possible without https://github.com/bazelbuild/bazel-toolchains/pull/748
- # and currently the toolchain we're using is too old for that. To be able to select worker
- # pools through labels, we use a workaround and populate the corresponding label values
- # manually (see create_exec_properties_dict logic for how labels get transformed)
- # Remove this workaround once we transition to a new-enough bazel toolchain.
- # The next line corresponds to 'labels = {"os": "ubuntu", "machine_size": "large"}'
- {
- "label:os": "ubuntu",
- "label:machine_size": "large",
+ "LARGE_MACHINE": create_rbe_exec_properties_dict(
+ labels = {
+ "os": "ubuntu",
+ "machine_size": "large",
},
),
},
@@ -45,23 +29,14 @@ load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
# Create toolchain configuration for remote execution.
rbe_autoconfig(
name = "rbe_default",
- exec_properties = merge_dicts(
- create_exec_properties_dict(
- docker_add_capabilities = "SYS_PTRACE",
- docker_privileged = True,
- os_family = "Linux",
- ),
- # TODO(jtattermusch): specifying 'labels = {"abc": "xyz"}' in create_exec_properties_dict
- # is not possible without https://github.com/bazelbuild/bazel-toolchains/pull/748
- # and currently the toolchain we're using is too old for that. To be able to select worker
- # pools through labels, we use a workaround and populate the corresponding label values
- # manually (see create_exec_properties_dict logic for how labels get transformed)
- # Remove this workaround once we transition to a new-enough bazel toolchain.
- # The next line corresponds to 'labels = {"os": "ubuntu", "machine_size": "small"}'
- {
- "label:os": "ubuntu",
- "label:machine_size": "small",
+ exec_properties = create_rbe_exec_properties_dict(
+ docker_add_capabilities = "SYS_PTRACE",
+ docker_privileged = True,
+ labels = {
+ "os": "ubuntu",
+ "machine_size": "small",
},
+ os_family = "Linux",
),
# use exec_properties instead of deprecated remote_execution_properties
use_legacy_platform_definition = False,
@@ -69,6 +44,32 @@ rbe_autoconfig(
load("@bazel_toolchains//rules:environments.bzl", "clang_env")
load("@bazel_skylib//lib:dicts.bzl", "dicts")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+http_archive(
+ name = "build_bazel_rules_android",
+ sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
+ strip_prefix = "rules_android-0.1.1",
+ urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
+)
+
+load("//third_party/android:android_configure.bzl", "android_configure")
+
+android_configure(name = "local_config_android")
+
+load("@local_config_android//:android_configure.bzl", "android_workspace")
+
+android_workspace()
+
+# Prevents bazel's '...' expansion from including the following folder.
+# This is required because the BUILD file in the following folder
+# will trigger bazel failure when Android SDK is not configured.
+# The targets in the following folder need to be included in APK and will
+# be invoked by binder transport implementation through JNI.
+local_repository(
+ name = "binder_transport_android_helper",
+ path = "./src/core/ext/transport/binder/java",
+)
# Create msan toolchain configuration for remote execution.
rbe_autoconfig(
@@ -81,15 +82,9 @@ rbe_autoconfig(
),
)
-load("@io_bazel_rules_python//python:pip.bzl", "pip_import", "pip_repositories")
+load("@io_bazel_rules_python//python:pip.bzl", "pip_install")
-pip_import(
+pip_install(
name = "grpc_python_dependencies",
requirements = "@com_github_grpc_grpc//:requirements.bazel.txt",
)
-
-load("@grpc_python_dependencies//:requirements.bzl", "pip_install")
-
-pip_repositories()
-
-pip_install()
diff --git a/grpc/_metadata.py b/grpc/_metadata.py
new file mode 100644
index 00000000..731ec589
--- /dev/null
+++ b/grpc/_metadata.py
@@ -0,0 +1,17 @@
+# Copyright 2021 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.
+
+# AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!!
+
+__version__ = """1.46.5"""
diff --git a/grpc/bazel/BUILD b/grpc/bazel/BUILD
index c3c82c9c..3fe42fc7 100644
--- a/grpc/bazel/BUILD
+++ b/grpc/bazel/BUILD
@@ -12,8 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
+"""
+Contains build targets used by Starlark files in the bazel/ directory.
+"""
+
+licenses(["notice"])
package(default_visibility = ["//:__subpackages__"])
-load(":cc_grpc_library.bzl", "cc_grpc_library")
+filegroup(
+ name = "_gevent_test_main",
+ srcs = ["_gevent_test_main.py"],
+)
diff --git a/grpc/bazel/_gevent_test_main.py b/grpc/bazel/_gevent_test_main.py
new file mode 100644
index 00000000..f7936daa
--- /dev/null
+++ b/grpc/bazel/_gevent_test_main.py
@@ -0,0 +1,99 @@
+# Copyright 2021 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 gevent
+from gevent import monkey
+
+monkey.patch_all()
+threadpool = gevent.hub.get_hub().threadpool
+
+# Currently, each channel corresponds to a single native thread in the
+# gevent threadpool. Thus, when the unit test suite spins up hundreds of
+# channels concurrently, some will be starved out, causing the test to
+# increase in duration. We increase the max size here so this does not
+# happen.
+threadpool.maxsize = 1024
+threadpool.size = 32
+
+import traceback, signal
+from typing import Sequence
+
+
+import grpc.experimental.gevent
+grpc.experimental.gevent.init_gevent()
+
+import gevent
+import greenlet
+import datetime
+
+import grpc
+import unittest
+import sys
+import os
+import pkgutil
+
+def trace_callback(event, args):
+ if event in ("switch", "throw"):
+ origin, target = args
+ sys.stderr.write("{} Transfer from {} to {} with {}\n".format(datetime.datetime.now(), origin, target, event))
+ else:
+ sys.stderr.write("Unknown event {}.\n".format(event))
+ sys.stderr.flush()
+
+if os.getenv("GREENLET_TRACE") is not None:
+ greenlet.settrace(trace_callback)
+
+def debug(sig, frame):
+ d={'_frame':frame}
+ d.update(frame.f_globals)
+ d.update(frame.f_locals)
+
+ sys.stderr.write("Traceback:\n{}".format("\n".join(traceback.format_stack(frame))))
+ import gevent.util; gevent.util.print_run_info()
+ sys.stderr.flush()
+
+signal.signal(signal.SIGTERM, debug)
+
+
+class SingleLoader(object):
+ def __init__(self, pattern: str):
+ loader = unittest.TestLoader()
+ self.suite = unittest.TestSuite()
+ tests = []
+ for importer, module_name, is_package in pkgutil.walk_packages([os.path.dirname(os.path.relpath(__file__))]):
+ if pattern in module_name:
+ module = importer.find_module(module_name).load_module(module_name)
+ tests.append(loader.loadTestsFromModule(module))
+ if len(tests) != 1:
+ raise AssertionError("Expected only 1 test module. Found {}".format(tests))
+ self.suite.addTest(tests[0])
+
+
+ def loadTestsFromNames(self, names: Sequence[str], module: str = None) -> unittest.TestSuite:
+ return self.suite
+
+if __name__ == "__main__":
+
+ if len(sys.argv) != 2:
+ print(f"USAGE: {sys.argv[0]} TARGET_MODULE", file=sys.stderr)
+
+ target_module = sys.argv[1]
+
+ loader = SingleLoader(target_module)
+ runner = unittest.TextTestRunner()
+
+ result = gevent.spawn(runner.run, loader.suite)
+ result.join()
+ if not result.value.wasSuccessful():
+ sys.exit("Test failure.")
diff --git a/grpc/bazel/cc_grpc_library.bzl b/grpc/bazel/cc_grpc_library.bzl
index 7ec1a98e..9c31f0c1 100644
--- a/grpc/bazel/cc_grpc_library.bzl
+++ b/grpc/bazel/cc_grpc_library.bzl
@@ -1,3 +1,16 @@
+# Copyright 2021 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.
"""Generates and compiles C++ grpc stubs from proto_library rules."""
load("@rules_proto//proto:defs.bzl", "proto_library")
diff --git a/grpc/bazel/copts.bzl b/grpc/bazel/copts.bzl
index 91f0bc82..f63e39ee 100644
--- a/grpc/bazel/copts.bzl
+++ b/grpc/bazel/copts.bzl
@@ -12,16 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Includes default copts.
+"""
+
# This is a list of llvm flags to be used when being built with use_strict_warning=1
GRPC_LLVM_WARNING_FLAGS = [
- # Enable all & extra waninrgs
+ # Enable all & extra warnings
"-Wall",
"-Wextra",
+ # Avoid some known traps
+ "-Wimplicit-fallthrough",
# Consider warnings as errors
"-Werror",
# Ignore unknown warning flags
"-Wno-unknown-warning-option",
- # A list of flags coming from internal build system
+ # A list of enabled flags coming from internal build system
"-Wc++20-extensions",
"-Wctad-maybe-unsupported",
"-Wdeprecated-increment-bool",
@@ -41,6 +47,10 @@ GRPC_LLVM_WARNING_FLAGS = [
"-Wthread-safety-beta",
"-Wunused-comparison",
"-Wvla",
+ # -Wextra compatibility between gcc and clang
+ "-Wtype-limits",
+ # A list of disabled flags coming from internal build system
+ "-Wno-string-concatenation",
# Exceptions but will be removed
"-Wno-deprecated-declarations",
"-Wno-unused-function",
diff --git a/grpc/bazel/custom_exec_properties.bzl b/grpc/bazel/custom_exec_properties.bzl
index 6605f5cc..514e120b 100644
--- a/grpc/bazel/custom_exec_properties.bzl
+++ b/grpc/bazel/custom_exec_properties.bzl
@@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Reimports constants from the grpc_custom_exec_properties repo.
+"""
+
load("@grpc_custom_exec_properties//:constants.bzl", _LARGE_MACHINE = "LARGE_MACHINE")
LARGE_MACHINE = _LARGE_MACHINE
diff --git a/grpc/bazel/cython_library.bzl b/grpc/bazel/cython_library.bzl
index c9f86423..8e003c22 100644
--- a/grpc/bazel/cython_library.bzl
+++ b/grpc/bazel/cython_library.bzl
@@ -1,3 +1,16 @@
+# Copyright 2021 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.
"""Custom rules for gRPC Python"""
# Adapted with modifications from
diff --git a/grpc/bazel/generate_cc.bzl b/grpc/bazel/generate_cc.bzl
index a1808630..bd1d5457 100644
--- a/grpc/bazel/generate_cc.bzl
+++ b/grpc/bazel/generate_cc.bzl
@@ -1,3 +1,16 @@
+# Copyright 2021 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.
"""Generates C++ grpc stubs from proto_library rules.
This is an internal rule used by cc_grpc_library, and shouldn't be used
@@ -41,7 +54,13 @@ def _join_directories(directories):
return "/".join(massaged_directories)
def generate_cc_impl(ctx):
- """Implementation of the generate_cc rule."""
+ """Implementation of the generate_cc rule.
+
+ Args:
+ ctx: The context object.
+ Returns:
+ The provider for the generated files.
+ """
protos = [f for src in ctx.attr.srcs for f in src[ProtoInfo].check_deps_sources.to_list()]
includes = [
f
@@ -105,7 +124,7 @@ def generate_cc_impl(ctx):
)
tools = [ctx.executable.plugin]
else:
- arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out]
+ arguments.append("--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out)
tools = []
arguments += [
@@ -115,7 +134,7 @@ def generate_cc_impl(ctx):
# Include the output directory so that protoc puts the generated code in the
# right directory.
- arguments += ["--proto_path={0}{1}".format(dir_out, proto_root)]
+ arguments.append("--proto_path={0}{1}".format(dir_out, proto_root))
arguments += [_get_srcs_file_path(proto) for proto in protos]
# create a list of well known proto files if the argument is non-None
@@ -125,11 +144,11 @@ def generate_cc_impl(ctx):
if f != "external/com_google_protobuf/src/google/protobuf":
print(
"Error: Only @com_google_protobuf//:well_known_protos is supported",
- )
+ ) # buildifier: disable=print
else:
# f points to "external/com_google_protobuf/src/google/protobuf"
# add -I argument to protoc so it knows where to look for the proto files.
- arguments += ["-I{0}".format(f + "/../..")]
+ arguments.append("-I{0}".format(f + "/../.."))
well_known_proto_files = [
f
for f in ctx.attr.well_known_protos.files.to_list()
@@ -141,9 +160,10 @@ def generate_cc_impl(ctx):
outputs = out_files,
executable = ctx.executable._protoc,
arguments = arguments,
+ use_default_shell_env = True,
)
- return struct(files = depset(out_files))
+ return struct(files = depset(out_files)) # buildifier: disable=rule-impl-return
_generate_cc = rule(
attrs = {
diff --git a/grpc/bazel/generate_objc.bzl b/grpc/bazel/generate_objc.bzl
index cffe4043..b0e92114 100644
--- a/grpc/bazel/generate_objc.bzl
+++ b/grpc/bazel/generate_objc.bzl
@@ -1,3 +1,21 @@
+# Copyright 2021 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 module contains build rules relating to gRPC Objective-C.
+"""
+
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load(
"//bazel:protobuf.bzl",
@@ -31,13 +49,13 @@ def _generate_objc_impl(ctx):
outs = []
for proto in protos:
- outs += [_get_output_file_name_from_proto(proto, _PROTO_HEADER_FMT)]
- outs += [_get_output_file_name_from_proto(proto, _PROTO_SRC_FMT)]
+ outs.append(_get_output_file_name_from_proto(proto, _PROTO_HEADER_FMT))
+ outs.append(_get_output_file_name_from_proto(proto, _PROTO_SRC_FMT))
file_path = _get_full_path_from_file(proto)
if file_path in files_with_rpc:
- outs += [_get_output_file_name_from_proto(proto, _GRPC_PROTO_HEADER_FMT)]
- outs += [_get_output_file_name_from_proto(proto, _GRPC_PROTO_SRC_FMT)]
+ outs.append(_get_output_file_name_from_proto(proto, _GRPC_PROTO_HEADER_FMT))
+ outs.append(_get_output_file_name_from_proto(proto, _GRPC_PROTO_SRC_FMT))
out_files = [ctx.actions.declare_file(out) for out in outs]
dir_out = _join_directories([
@@ -47,6 +65,7 @@ def _generate_objc_impl(ctx):
])
arguments = []
+ tools = []
if ctx.executable.plugin:
arguments += get_plugin_args(
ctx.executable.plugin,
@@ -55,9 +74,9 @@ def _generate_objc_impl(ctx):
False,
)
tools = [ctx.executable.plugin]
- arguments += ["--objc_out=" + dir_out]
+ arguments.append("--objc_out=" + dir_out)
- arguments += ["--proto_path=."]
+ arguments.append("--proto_path=.")
arguments += [
"--proto_path={}".format(get_include_directory(i))
for i in protos
@@ -65,7 +84,7 @@ def _generate_objc_impl(ctx):
# Include the output directory so that protoc puts the generated code in the
# right directory.
- arguments += ["--proto_path={}".format(dir_out)]
+ arguments.append("--proto_path={}".format(dir_out))
arguments += ["--proto_path={}".format(_get_directory_from_proto(proto)) for proto in protos]
arguments += [_get_full_path_from_file(proto) for proto in protos]
@@ -75,7 +94,7 @@ def _generate_objc_impl(ctx):
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
# go two levels up so that #import "google/protobuf/..." is correct
- arguments += ["-I{0}".format(f + "/../..")]
+ arguments.append("-I{0}".format(f + "/../.."))
well_known_proto_files = ctx.attr.well_known_protos.files.to_list()
ctx.actions.run(
inputs = protos + well_known_proto_files,
@@ -85,7 +104,7 @@ def _generate_objc_impl(ctx):
arguments = arguments,
)
- return struct(files = depset(out_files))
+ return struct(files = depset(out_files)) # buildifier: disable=rule-impl-return
def _label_to_full_file_path(src, package):
if not src.startswith("//"):
@@ -185,7 +204,7 @@ def _group_objc_files_impl(ctx):
for file in ctx.attr.src.files.to_list()
if file.basename.endswith(suffix)
]
- return struct(files = depset(out_files))
+ return struct(files = depset(out_files)) # buildifier: disable=rule-impl-return
generate_objc_hdrs = rule(
attrs = {
diff --git a/grpc/bazel/gevent_test.bzl b/grpc/bazel/gevent_test.bzl
new file mode 100644
index 00000000..173d7064
--- /dev/null
+++ b/grpc/bazel/gevent_test.bzl
@@ -0,0 +1,85 @@
+# Copyright 2021 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.
+"""
+Houses py_grpc_gevent_test.
+"""
+
+load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+
+_GRPC_LIB = "//src/python/grpcio/grpc:grpcio"
+
+_COPIED_MAIN_SUFFIX = ".gevent.main"
+
+def py_grpc_gevent_test(
+ name,
+ srcs,
+ main = None,
+ deps = None,
+ data = None,
+ **kwargs):
+ """Runs a Python test with gevent monkeypatched in.
+
+ Args:
+ name: The name of the test.
+ srcs: The source files.
+ main: The main file of the test.
+ deps: The dependencies of the test.
+ data: The data dependencies of the test.
+ **kwargs: Any other test arguments.
+ """
+ if main == None:
+ if len(srcs) != 1:
+ fail("When main is not provided, srcs must be of size 1.")
+ main = srcs[0]
+ deps = [] if deps == None else deps
+ data = [] if data == None else data
+ lib_name = name + ".gevent.lib"
+ supplied_python_version = kwargs.pop("python_version", "")
+ if supplied_python_version and supplied_python_version != "PY3":
+ fail("py_grpc_gevent_test only supports python_version=PY3")
+ native.py_library(
+ name = lib_name,
+ srcs = srcs,
+ )
+ augmented_deps = deps + [
+ ":{}".format(lib_name),
+ requirement("gevent"),
+ ]
+ if _GRPC_LIB not in augmented_deps:
+ augmented_deps.append(_GRPC_LIB)
+
+ # The main file needs to be in the same package as the test file.
+ copied_main_name = name + _COPIED_MAIN_SUFFIX
+ copied_main_filename = copied_main_name + ".py"
+ native.genrule(
+ name = copied_main_name,
+ srcs = ["//bazel:_gevent_test_main.py"],
+ outs = [copied_main_filename],
+ cmd = "cp $< $@",
+ )
+
+ # TODO(https://github.com/grpc/grpc/issues/27542): Remove once gevent is deemed non-flaky.
+ if "flaky" in kwargs:
+ kwargs.pop("flaky")
+
+ native.py_test(
+ name = name + ".gevent",
+ args = [name],
+ deps = augmented_deps,
+ srcs = [copied_main_filename],
+ main = copied_main_filename,
+ python_version = "PY3",
+ flaky = False,
+ **kwargs
+ )
diff --git a/grpc/bazel/grpc_build_system.bzl b/grpc/bazel/grpc_build_system.bzl
index 85ec2d6b..3379de82 100644
--- a/grpc/bazel/grpc_build_system.bzl
+++ b/grpc/bazel/grpc_build_system.bzl
@@ -23,13 +23,21 @@
# each change must be ported from one to the other.
#
+"""
+Contains macros used throughout the repo.
+"""
+
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("//bazel:copts.bzl", "GRPC_DEFAULT_COPTS")
-load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
+load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
+load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl", "ios_test_runner")
# The set of pollers to test against if a test exercises polling
-POLLERS = ["epollex", "epoll1", "poll"]
+POLLERS = ["epoll1", "poll"]
+
+# The set of known EventEngines to test
+EVENT_ENGINES = {"default": {"tags": []}}
def if_not_windows(a):
return select({
@@ -38,9 +46,10 @@ def if_not_windows(a):
"//conditions:default": a,
})
-def if_mac(a):
+def if_windows(a):
return select({
- "//:mac_x86_64": a,
+ "//:windows": a,
+ "//:windows_msvc": a,
"//conditions:default": [],
})
@@ -48,22 +57,61 @@ def _get_external_deps(external_deps):
ret = []
for dep in external_deps:
if dep == "address_sorting":
- ret += ["//third_party/address_sorting"]
+ ret.append("//third_party/address_sorting")
elif dep == "xxhash":
- ret += ["//third_party/xxhash"]
+ ret.append("//third_party/xxhash")
elif dep == "cares":
ret += select({
"//:grpc_no_ares": [],
"//conditions:default": ["//external:cares"],
})
elif dep == "cronet_c_for_grpc":
- ret += ["//third_party/objective_c/Cronet:cronet_c_for_grpc"]
+ ret.append("//third_party/objective_c/Cronet:cronet_c_for_grpc")
elif dep.startswith("absl/"):
- ret += ["@com_google_absl//" + dep]
+ ret.append("@com_google_absl//" + dep)
else:
- ret += ["//external:" + dep]
+ ret.append("//external:" + dep)
return ret
+def _update_visibility(visibility):
+ if visibility == None:
+ return None
+
+ # Visibility rules prefixed with '@grpc_' are used to flag different visibility rule
+ # classes upstream.
+ PUBLIC = ["//visibility:public"]
+ PRIVATE = ["//:__subpackages__"]
+ VISIBILITY_TARGETS = {
+ "alt_gpr_base_legacy": PRIVATE,
+ "alt_grpc++_base_legacy": PRIVATE,
+ "alt_grpc_base_legacy": PRIVATE,
+ "alt_grpc++_base_unsecure_legacy": PRIVATE,
+ "alts_frame_protector": PRIVATE,
+ "channelz": PRIVATE,
+ "client_channel": PRIVATE,
+ "debug_location": PRIVATE,
+ "endpoint_tests": PRIVATE,
+ "grpclb": PRIVATE,
+ "grpc_opencensus_plugin": PUBLIC,
+ "grpc_resolver_fake": PRIVATE,
+ "grpc++_test": PRIVATE,
+ "httpcli": PRIVATE,
+ "public": PUBLIC,
+ "ref_counted_ptr": PRIVATE,
+ "trace": PRIVATE,
+ "tsi_interface": PRIVATE,
+ "tsi": PRIVATE,
+ "xds": PRIVATE,
+ }
+ final_visibility = []
+ for rule in visibility:
+ if rule.startswith("@grpc:"):
+ for replacement in VISIBILITY_TARGETS[rule[len("@grpc:"):]]:
+ final_visibility.append(replacement)
+ else:
+ final_visibility.append(rule)
+ return [x for x in final_visibility]
+
def grpc_cc_library(
name,
srcs = [],
@@ -79,21 +127,36 @@ def grpc_cc_library(
visibility = None,
alwayslink = 0,
data = [],
- use_cfstream = False,
tags = [],
linkstatic = False):
+ """An internal wrapper around cc_library.
+
+ Args:
+ name: The name of the library.
+ srcs: The source files.
+ public_hdrs: The public headers.
+ hdrs: The headers.
+ external_deps: External depdendencies to be resolved.
+ defines: Build defines to use.
+ deps: cc_library deps.
+ select_deps: deps included conditionally.
+ standalone: Unused.
+ language: The language of the library, e.g. C, C++.
+ testonly: Whether the target is for tests only.
+ visibility: The visibility of the target.
+ alwayslink: Whether to enable alwayslink on the cc_library.
+ data: Data dependencies.
+ tags: Tags to apply to the rule.
+ linkstatic: Whether to enable linkstatic on the cc_library.
+ """
+ visibility = _update_visibility(visibility)
copts = []
- if use_cfstream:
- copts = if_mac(["-DGRPC_CFSTREAM"])
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c99"])
- linkopts = if_not_windows(["-pthread"])
- if use_cfstream:
- linkopts = linkopts + if_mac(["-framework CoreFoundation"])
-
+ linkopts = if_not_windows(["-pthread"]) + if_windows(["-defaultlib:ws2_32.lib"])
if select_deps:
- deps += select(select_deps)
-
+ for select_deps_entry in select_deps:
+ deps += select(select_deps_entry)
native.cc_library(
name = name,
srcs = srcs,
@@ -110,6 +173,10 @@ def grpc_cc_library(
"//:grpc_allow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=1"],
"//:grpc_disallow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=0"],
"//conditions:default": [],
+ }) +
+ select({
+ "//:use_abseil_status": ["GRPC_ERROR_IS_ABSEIL_STATUS=1"],
+ "//conditions:default": [],
}),
hdrs = hdrs + public_hdrs,
deps = deps + _get_external_deps(external_deps),
@@ -157,92 +224,204 @@ def ios_cc_test(
name,
tags = [],
**kwargs):
- ios_test_adapter = "//third_party/objective_c/google_toolbox_for_mac:GTM_GoogleTestRunner_GTM_USING_XCTEST"
+ """An ios C++ test target.
+ Args:
+ name: The name of the test.
+ tags: The tags to apply to the test.
+ **kwargs: All other arguments to apply.
+ """
test_lib_ios = name + "_test_lib_ios"
ios_tags = tags + ["manual", "ios_cc_test"]
+ test_runner = "ios_x86_64_sim_runner_" + name
+ ios_test_runner(
+ name = test_runner,
+ device_type = "iPhone X",
+ )
if not any([t for t in tags if t.startswith("no_test_ios")]):
native.objc_library(
name = test_lib_ios,
srcs = kwargs.get("srcs"),
deps = kwargs.get("deps"),
copts = kwargs.get("copts"),
+ data = kwargs.get("data"),
tags = ios_tags,
alwayslink = 1,
testonly = 1,
)
- ios_test_deps = [ios_test_adapter, ":" + test_lib_ios]
+ ios_test_deps = [":" + test_lib_ios]
ios_unit_test(
name = name + "_on_ios",
size = kwargs.get("size"),
+ data = kwargs.get("data"),
tags = ios_tags,
minimum_os_version = "9.0",
+ runner = test_runner,
deps = ios_test_deps,
)
-def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, copts = []):
- copts = copts + if_mac(["-DGRPC_CFSTREAM"])
+def expand_tests_for_each_poller_and_engine(name, srcs, deps, tags, args, exclude_pollers, uses_event_engine):
+ """Common logic used to parameterize tests for every poller and EventEngine.
+
+ Args:
+ name: base name of the test
+ srcs: source files
+ deps: base deps
+ tags: base tags
+ args: base args
+ exclude_pollers: list of poller names to exclude for this set of tests.
+ uses_event_engine: set to False if the test is not sensitive to
+ EventEngine implementation differences
+
+ Returns:
+ A list of dictionaries containing modified values of name, srcs, deps, tags, and args.
+ """
+ poller_config = []
+
+ # On linux we run the same test with the default EventEngine, once for each
+ # poller
+ for poller in POLLERS:
+ if poller in exclude_pollers:
+ continue
+ poller_config.append({
+ "name": name + "@poller=" + poller,
+ "srcs": srcs,
+ "deps": deps,
+ "tags": (tags + EVENT_ENGINES["default"]["tags"] + [
+ "no_windows",
+ "no_mac",
+ "bazel_only",
+ ]),
+ "args": args + ["--poller=" + poller],
+ })
+
+ # Now generate one test for each subsequent EventEngine, all using the
+ # default poller. These tests will have `@engine=<name>` appended to the
+ # test target name. If a test target name has no `@engine=<name>` component,
+ # that indicates that the default EventEngine is being used.
+ if not uses_event_engine:
+ # The poller tests exercise the default engine on Linux. This test
+ # handles other platforms.
+ poller_config.append({
+ "name": name,
+ "srcs": srcs,
+ "deps": deps,
+ "tags": tags + ["no_linux"],
+ "args": args,
+ })
+ else:
+ for engine_name, engine in EVENT_ENGINES.items():
+ test_name = name + "@engine=" + engine_name
+ test_tags = tags + engine["tags"] + ["bazel_only"]
+ test_args = args + ["--engine=" + engine_name]
+ if engine_name == "default":
+ # The poller tests exercise the default engine on Linux.
+ # This test handles other platforms.
+ test_name = name
+ test_tags = tags + engine["tags"] + ["no_linux"]
+ test_args = args
+ poller_config.append({
+ "name": test_name,
+ "srcs": srcs,
+ "deps": deps,
+ "tags": test_tags,
+ "args": test_args,
+ })
+ return poller_config
+
+def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, copts = [], linkstatic = None, exclude_pollers = [], uses_event_engine = True):
+ """A cc_test target for use in the gRPC repo.
+
+ Args:
+ name: The name of the test.
+ srcs: The source files.
+ deps: The target deps.
+ external_deps: The external deps.
+ args: The args to supply to the test binary.
+ data: Data dependencies.
+ uses_polling: Whether the test uses polling.
+ language: The language of the test, e.g C, C++.
+ size: The size of the test.
+ timeout: The test timeout.
+ tags: The tags for the test.
+ exec_compatible_with: A list of constraint values that must be
+ satisifed for the platform.
+ exec_properties: A dictionary of strings that will be added to the
+ exec_properties of a platform selected for this target.
+ shard_count: The number of shards for this test.
+ flaky: Whether this test is flaky.
+ copts: Add these to the compiler invocation.
+ linkstatic: link the binary in static mode
+ exclude_pollers: list of poller names to exclude for this set of tests.
+ uses_event_engine: set to False if the test is not sensitive to
+ EventEngine implementation differences
+ """
if language.upper() == "C":
copts = copts + if_not_windows(["-std=c99"])
- # NOTE: these attributes won't be used for the poller-specific versions of a test
- # automatically, you need to set them explicitly (if applicable)
- args = {
- "srcs": srcs,
- "args": args,
+ core_deps = deps + _get_external_deps(external_deps)
+
+ # Test args for all tests
+ test_args = {
"data": data,
- "deps": deps + _get_external_deps(external_deps),
"copts": GRPC_DEFAULT_COPTS + copts,
- "linkopts": if_not_windows(["-pthread"]),
+ "linkopts": if_not_windows(["-pthread"]) + if_windows(["-defaultlib:ws2_32.lib"]),
"size": size,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
"shard_count": shard_count,
"flaky": flaky,
+ "linkstatic": linkstatic,
}
- if uses_polling:
- # the vanilla version of the test should run on platforms that only
- # support a single poller
- native.cc_test(
- name = name,
- testonly = True,
- tags = (tags + [
- "no_linux", # linux supports multiple pollers
- ]),
- **args
- )
- # on linux we run the same test multiple times, once for each poller
- for poller in POLLERS:
- native.sh_test(
- name = name + "@poller=" + poller,
- data = [name] + data,
- srcs = [
- "//test/core/util:run_with_poller_sh",
- ],
- size = size,
- timeout = timeout,
- args = [
- poller,
- "$(location %s)" % name,
- ] + args["args"],
- tags = (tags + ["no_windows", "no_mac"]),
- exec_compatible_with = exec_compatible_with,
- exec_properties = exec_properties,
- shard_count = shard_count,
- flaky = flaky,
- )
- else:
- # the test behavior doesn't depend on polling, just generate the test
- native.cc_test(name = name, tags = tags + ["no_uses_polling"], **args)
ios_cc_test(
name = name,
+ srcs = srcs,
tags = tags,
- **args
+ deps = core_deps,
+ args = args,
+ **test_args
)
+ if not uses_polling:
+ # the test behavior doesn't depend on polling, just generate the test
+ native.cc_test(
+ name = name,
+ srcs = srcs,
+ tags = tags + ["no_uses_polling"],
+ deps = core_deps,
+ args = args,
+ **test_args
+ )
+ return
+
+ for poller_config in expand_tests_for_each_poller_and_engine(name, srcs, core_deps, tags, args, exclude_pollers, uses_event_engine):
+ native.cc_test(
+ name = poller_config["name"],
+ srcs = poller_config["srcs"],
+ deps = poller_config["deps"],
+ tags = poller_config["tags"],
+ args = poller_config["args"],
+ **test_args
+ )
def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = [], features = []):
+ """Generates a cc_binary for use in the gRPC repo.
+
+ Args:
+ name: The name of the target.
+ srcs: The source files.
+ deps: The dependencies.
+ external_deps: The external dependencies.
+ args: The arguments to supply to the binary.
+ data: The data dependencies.
+ language: The language of the binary, e.g. C, C++.
+ testonly: Whether the binary is for tests only.
+ linkshared: Enables linkshared on the binary.
+ linkopts: linkopts to supply to the cc_binary.
+ tags: Tags to apply to the target.
+ features: features to be supplied to the cc_binary.
+ """
copts = []
if language.upper() == "C":
copts = ["-std=c99"]
@@ -260,6 +439,7 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
features = features,
)
+# buildifier: disable=unnamed-macro
def grpc_generate_one_off_targets():
# In open-source, grpc_objc* libraries depend directly on //:grpc
native.alias(
@@ -270,13 +450,56 @@ def grpc_generate_one_off_targets():
def grpc_generate_objc_one_off_targets():
pass
-def grpc_sh_test(name, srcs, args = [], data = []):
- native.sh_test(
- name = name,
- srcs = srcs,
- args = args,
- data = data,
- )
+def grpc_sh_test(name, srcs = [], args = [], data = [], uses_polling = True, size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, exclude_pollers = [], uses_event_engine = True):
+ """Execute an sh_test for every <poller> x <EventEngine> combination
+
+ Args:
+ name: The name of the test.
+ srcs: The source files.
+ args: The args to supply to the test binary.
+ data: Data dependencies.
+ uses_polling: Whether the test uses polling.
+ size: The size of the test.
+ timeout: The test timeout.
+ tags: The tags for the test.
+ exec_compatible_with: A list of constraint values that must be
+ satisifed for the platform.
+ exec_properties: A dictionary of strings that will be added to the
+ exec_properties of a platform selected for this target.
+ shard_count: The number of shards for this test.
+ flaky: Whether this test is flaky.
+ exclude_pollers: list of poller names to exclude for this set of tests.
+ uses_event_engine: set to False if the test is not sensitive to
+ EventEngine implementation differences
+ """
+ test_args = {
+ "data": data,
+ "size": size,
+ "timeout": timeout,
+ "exec_compatible_with": exec_compatible_with,
+ "exec_properties": exec_properties,
+ "shard_count": shard_count,
+ "flaky": flaky,
+ }
+ if not uses_polling:
+ native.sh_test(
+ name = name,
+ srcs = srcs,
+ args = args,
+ tags = tags,
+ **test_args
+ )
+ return
+
+ for poller_config in expand_tests_for_each_poller_and_engine(name, srcs, [], tags, args, exclude_pollers, uses_event_engine):
+ native.sh_test(
+ name = poller_config["name"],
+ srcs = poller_config["srcs"],
+ deps = poller_config["deps"],
+ tags = poller_config["tags"],
+ args = poller_config["args"],
+ **test_args
+ )
def grpc_sh_binary(name, srcs, data = []):
native.sh_binary(
@@ -305,6 +528,13 @@ def grpc_py_binary(
)
def grpc_package(name, visibility = "private", features = []):
+ """Creates a package.
+
+ Args:
+ name: The name of the target
+ visibility: The visibility of the target.
+ features: The features to enable.
+ """
if visibility == "tests":
visibility = ["//test:__subpackages__"]
elif visibility == "public":
@@ -315,6 +545,7 @@ def grpc_package(name, visibility = "private", features = []):
fail("Unknown visibility " + visibility)
if len(visibility) != 0:
+ # buildifier: disable=native-package
native.package(
default_visibility = visibility,
features = features,
@@ -359,6 +590,10 @@ def grpc_objc_library(
def grpc_upb_proto_library(name, deps):
upb_proto_library(name = name, deps = deps)
+def grpc_upb_proto_reflection_library(name, deps):
+ upb_proto_reflection_library(name = name, deps = deps)
+
+# buildifier: disable=unnamed-macro
def python_config_settings():
native.config_setting(
name = "python3",
diff --git a/grpc/bazel/grpc_deps.bzl b/grpc/bazel/grpc_deps.bzl
index a463d01b..c2d426dc 100644
--- a/grpc/bazel/grpc_deps.bzl
+++ b/grpc/bazel/grpc_deps.bzl
@@ -1,8 +1,22 @@
+# Copyright 2021 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.
"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//bazel:grpc_python_deps.bzl", "grpc_python_deps")
+# buildifier: disable=unnamed-macro
def grpc_deps():
"""Loads dependencies need to compile and test the grpc library."""
@@ -12,6 +26,11 @@ def grpc_deps():
)
native.bind(
+ name = "upb_reflection",
+ actual = "@upb//:reflection",
+ )
+
+ native.bind(
name = "upb_lib_descriptor",
actual = "@upb//:descriptor_upb_proto",
)
@@ -32,6 +51,11 @@ def grpc_deps():
)
native.bind(
+ name = "upb_generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
+ actual = "@upb//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
+ )
+
+ native.bind(
name = "absl",
actual = "@com_google_absl//absl",
)
@@ -52,6 +76,11 @@ def grpc_deps():
)
native.bind(
+ name = "libcrypto",
+ actual = "@boringssl//:crypto",
+ )
+
+ native.bind(
name = "madler_zlib",
actual = "@zlib//:zlib",
)
@@ -147,8 +176,18 @@ def grpc_deps():
)
native.bind(
+ name = "opencensus-tags-context_util",
+ actual = "@io_opencensus_cpp//opencensus/tags:context_util",
+ )
+
+ native.bind(
name = "libuv",
- actual = "@libuv//:libuv",
+ actual = "@com_github_libuv_libuv//:libuv",
+ )
+
+ native.bind(
+ name = "libuv_test",
+ actual = "@com_github_libuv_libuv//:libuv_test",
)
if "boringssl" not in native.existing_rules():
@@ -156,11 +195,11 @@ def grpc_deps():
name = "boringssl",
# Use github mirror instead of https://boringssl.googlesource.com/boringssl
# to obtain a boringssl archive with consistent sha256
- sha256 = "f8616dff15cb8aad6705af53c7caf7a5f1103b6aaf59c76b55995e179d47f89c",
- strip_prefix = "boringssl-688fc5cf5428868679d2ae1072cad81055752068",
+ sha256 = "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40",
+ strip_prefix = "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/688fc5cf5428868679d2ae1072cad81055752068.tar.gz",
- "https://github.com/google/boringssl/archive/688fc5cf5428868679d2ae1072cad81055752068.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
+ "https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz",
],
)
@@ -168,22 +207,22 @@ def grpc_deps():
http_archive(
name = "zlib",
build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD",
- sha256 = "6d4d6640ca3121620995ee255945161821218752b551a1a180f4215f7d124d45",
- strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f",
+ sha256 = "ef47b0fbe646d69a2fc5ba012cb278de8e8946a8e9649f83a807cc05559f0eff",
+ strip_prefix = "zlib-21767c654d31d2dccdde4330529775c6c5fd5389",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz",
- "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/madler/zlib/archive/21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz",
+ "https://github.com/madler/zlib/archive/21767c654d31d2dccdde4330529775c6c5fd5389.tar.gz",
],
)
if "com_google_protobuf" not in native.existing_rules():
http_archive(
name = "com_google_protobuf",
- sha256 = "cf63d46ef743f4c30b0e36a562caf83cabed3f10e6ca49eb476913c4655394d5",
- strip_prefix = "protobuf-436bd7880e458532901c58f4d9d1ea23fa7edd52",
+ sha256 = "245da8acf76b24317c885b8157b7ddcbe5e4919bd8ff60def824c8ed3ee49a8e",
+ strip_prefix = "protobuf-b464cfbee18c71c40e761a5273ad369f3547294b",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/436bd7880e458532901c58f4d9d1ea23fa7edd52.tar.gz",
- "https://github.com/google/protobuf/archive/436bd7880e458532901c58f4d9d1ea23fa7edd52.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/protobuf/archive/b464cfbee18c71c40e761a5273ad369f3547294b.tar.gz",
+ "https://github.com/protocolbuffers/protobuf/archive/b464cfbee18c71c40e761a5273ad369f3547294b.tar.gz",
],
patches = ["@com_github_grpc_grpc//third_party:protobuf.patch"],
patch_args = ["-p1"],
@@ -192,12 +231,11 @@ def grpc_deps():
if "com_google_googletest" not in native.existing_rules():
http_archive(
name = "com_google_googletest",
- sha256 = "443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468",
- strip_prefix = "googletest-c9ccac7cb7345901884aabf5d1a786cfa6e2f397",
+ sha256 = "c8de6c60e12ad014a28225c5247ee735861d85cf906df617f6a29954ca05f547",
+ strip_prefix = "googletest-0e402173c97aea7a00749e825b194bfede4f2e45",
urls = [
- # 2019-08-19
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
- "https://github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
+ # 2022-02-09
+ "https://github.com/google/googletest/archive/0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz",
],
)
@@ -216,22 +254,23 @@ def grpc_deps():
if "com_github_google_benchmark" not in native.existing_rules():
http_archive(
name = "com_github_google_benchmark",
- sha256 = "daa4a97e0547d76de300e325a49177b199f3689ce5a35e25d47696f7cb050f86",
- strip_prefix = "benchmark-73d4d5e8d6d449fc8663765a42aa8aeeee844489",
+ sha256 = "0b921a3bc39e35f4275c8dcc658af2391c150fb966102341287b0401ff2e6f21",
+ strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz",
- "https://github.com/google/benchmark/archive/73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz",
+ "https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz",
],
)
if "com_googlesource_code_re2" not in native.existing_rules():
http_archive(
name = "com_googlesource_code_re2",
- sha256 = "9f385e146410a8150b6f4cb1a57eab7ec806ced48d427554b1e754877ff26c3e",
- strip_prefix = "re2-aecba11114cf1fac5497aeb844b6966106de3eb6",
+ sha256 = "319a58a58d8af295db97dfeecc4e250179c5966beaa2d842a82f0a013b6a239b",
+ # Release 2021-09-01
+ strip_prefix = "re2-8e08f47b11b413302749c0d8b17a1c94777495d5",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz",
- "https://github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/re2/archive/8e08f47b11b413302749c0d8b17a1c94777495d5.tar.gz",
+ "https://github.com/google/re2/archive/8e08f47b11b413302749c0d8b17a1c94777495d5.tar.gz",
],
)
@@ -239,22 +278,22 @@ def grpc_deps():
http_archive(
name = "com_github_cares_cares",
build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD",
- sha256 = "e8c2751ddc70fed9dc6f999acd92e232d5846f009ee1674f8aee81f19b2b915a",
- strip_prefix = "c-ares-e982924acee7f7313b4baa4ee5ec000c5e373c30",
+ sha256 = "ec76c5e79db59762776bece58b69507d095856c37b81fd35bfb0958e74b61d93",
+ strip_prefix = "c-ares-6654436a307a5a686b008c1d4c93b0085da6e6d8",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz",
- "https://github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/c-ares/c-ares/archive/6654436a307a5a686b008c1d4c93b0085da6e6d8.tar.gz",
+ "https://github.com/c-ares/c-ares/archive/6654436a307a5a686b008c1d4c93b0085da6e6d8.tar.gz",
],
)
if "com_google_absl" not in native.existing_rules():
http_archive(
name = "com_google_absl",
- sha256 = "35f22ef5cb286f09954b7cc4c85b5a3f6221c9d4df6b8c4a1e9d399555b366ee",
- strip_prefix = "abseil-cpp-997aaf3a28308eba1b9156aa35ab7bca9688e9f6",
+ sha256 = "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4",
+ strip_prefix = "abseil-cpp-20211102.0",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz",
- "https://github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz",
+ "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz",
],
)
@@ -262,11 +301,11 @@ def grpc_deps():
# list of releases is at https://releases.bazel.build/bazel-toolchains.html
http_archive(
name = "bazel_toolchains",
- sha256 = "0b36eef8a66f39c8dbae88e522d5bbbef49d5e66e834a982402c79962281be10",
- strip_prefix = "bazel-toolchains-1.0.1",
+ sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024",
+ strip_prefix = "bazel-toolchains-4.1.0",
urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.0.1.tar.gz",
- "https://github.com/bazelbuild/bazel-toolchains/releases/download/1.0.1/bazel-toolchains-1.0.1.tar.gz",
+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/4.1.0.tar.gz",
+ "https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
],
)
@@ -305,87 +344,85 @@ def grpc_deps():
if "upb" not in native.existing_rules():
http_archive(
name = "upb",
- sha256 = "c0b97bf91dfea7e8d7579c24e2ecdd02d10b00f3c5defc3dce23d95100d0e664",
- strip_prefix = "upb-60607da72e89ba0c84c84054d2e562d8b6b61177",
+ sha256 = "d0fe259d650bf9547e75896a1307bfc7034195e4ae89f5139814d295991ba681",
+ strip_prefix = "upb-bef53686ec702607971bd3ea4d4fefd80c6cc6e8",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/60607da72e89ba0c84c84054d2e562d8b6b61177.tar.gz",
- "https://github.com/protocolbuffers/upb/archive/60607da72e89ba0c84c84054d2e562d8b6b61177.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz",
+ "https://github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz",
],
)
if "envoy_api" not in native.existing_rules():
http_archive(
name = "envoy_api",
- sha256 = "4423bef0ab15053dca0f723cbdaf4b48ab145e9d8158f02e33028c66fb1d20e0",
- strip_prefix = "data-plane-api-18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2",
+ sha256 = "c5807010b67033330915ca5a20483e30538ae5e689aa14b3631d6284beca4630",
+ strip_prefix = "data-plane-api-9c42588c956220b48eb3099d186487c2f04d32ec",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/data-plane-api/archive/18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2.tar.gz",
- "https://github.com/envoyproxy/data-plane-api/archive/18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/data-plane-api/archive/9c42588c956220b48eb3099d186487c2f04d32ec.tar.gz",
+ "https://github.com/envoyproxy/data-plane-api/archive/9c42588c956220b48eb3099d186487c2f04d32ec.tar.gz",
],
)
if "io_bazel_rules_go" not in native.existing_rules():
http_archive(
name = "io_bazel_rules_go",
- sha256 = "dbf5a9ef855684f84cac2e7ae7886c5a001d4f66ae23f6904da0faaaef0d61fc",
+ sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
- "https://github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
+ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
+ "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
],
)
if "build_bazel_rules_apple" not in native.existing_rules():
http_archive(
name = "build_bazel_rules_apple",
- strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
- sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
+ sha256 = "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
- "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz",
+ "https://github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz",
],
)
if "build_bazel_apple_support" not in native.existing_rules():
http_archive(
name = "build_bazel_apple_support",
+ sha256 = "76df040ade90836ff5543888d64616e7ba6c3a7b33b916aa3a4b68f342d1b447",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/0.7.1/apple_support.0.7.1.tar.gz",
- "https://github.com/bazelbuild/apple_support/releases/download/0.7.1/apple_support.0.7.1.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz",
+ "https://github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz",
],
- sha256 = "122ebf7fe7d1c8e938af6aeaee0efe788a3a2449ece5a8d6a428cb18d6f88033",
)
- if "libuv" not in native.existing_rules():
+ if "com_github_libuv_libuv" not in native.existing_rules():
http_archive(
- name = "libuv",
+ name = "com_github_libuv_libuv",
build_file = "@com_github_grpc_grpc//third_party:libuv.BUILD",
- sha256 = "dfb4fe1ff0b47340978490a14bf253475159ecfcbad46ab2a350c78f9ce3360f",
- strip_prefix = "libuv-15ae750151ac9341e5945eb38f8982d59fb99201",
+ sha256 = "5ca4e9091f3231d8ad8801862dc4e851c23af89c69141d27723157776f7291e7",
+ strip_prefix = "libuv-02a9e1be252b623ee032a3137c0b0c94afbe6809",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/15ae750151ac9341e5945eb38f8982d59fb99201.tar.gz",
- "https://github.com/libuv/libuv/archive/15ae750151ac9341e5945eb38f8982d59fb99201.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz",
+ "https://github.com/libuv/libuv/archive/02a9e1be252b623ee032a3137c0b0c94afbe6809.tar.gz",
],
)
if "com_google_googleapis" not in native.existing_rules():
http_archive(
name = "com_google_googleapis",
- sha256 = "a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d1405",
- strip_prefix = "googleapis-82944da21578a53b74e547774cf62ed31a05b841",
+ sha256 = "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0",
+ strip_prefix = "googleapis-2f9af297c84c55c8b871ba4495e01ade42476c92",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/googleapis/archive/82944da21578a53b74e547774cf62ed31a05b841.tar.gz",
- "https://github.com/googleapis/googleapis/archive/82944da21578a53b74e547774cf62ed31a05b841.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz",
+ "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz",
],
)
if "bazel_gazelle" not in native.existing_rules():
http_archive(
name = "bazel_gazelle",
- sha256 = "d987004a72697334a095bbaa18d615804a28280201a50ed6c234c40ccc41e493",
- strip_prefix = "bazel-gazelle-0.19.1",
+ sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel-gazelle/archive/v0.19.1.tar.gz",
- "https://github.com/bazelbuild/bazel-gazelle/archive/v0.19.1.tar.gz",
+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
+ "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
],
)
@@ -403,20 +440,35 @@ def grpc_deps():
if "com_envoyproxy_protoc_gen_validate" not in native.existing_rules():
http_archive(
name = "com_envoyproxy_protoc_gen_validate",
- sha256 = "e368733c9fb7f8489591ffaf269170d7658cc0cd1ee322b601512b769446d3c8",
- strip_prefix = "protoc-gen-validate-278964a8052f96a2f514add0298098f63fb7f47f",
+ strip_prefix = "protoc-gen-validate-4694024279bdac52b77e22dc87808bd0fd732b69",
+ sha256 = "1e490b98005664d149b379a9529a6aa05932b8a11b76b4cd86f3d22d76346f47",
+ urls = [
+ "https://github.com/envoyproxy/protoc-gen-validate/archive/4694024279bdac52b77e22dc87808bd0fd732b69.tar.gz",
+ ],
+ patches = ["@com_github_grpc_grpc//third_party:protoc-gen-validate.patch"],
+ patch_args = ["-p1"],
+ )
+
+ if "com_github_cncf_udpa" not in native.existing_rules():
+ http_archive(
+ name = "com_github_cncf_udpa",
+ sha256 = "5bc8365613fe2f8ce6cc33959b7667b13b7fe56cb9d16ba740c06e1a7c4242fc",
+ strip_prefix = "xds-cb28da3451f158a947dfc45090fe92b07b243bc1",
urls = [
- "https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/protoc-gen-validate/archive/278964a8052f96a2f514add0298098f63fb7f47f.tar.gz",
- "https://github.com/envoyproxy/protoc-gen-validate/archive/278964a8052f96a2f514add0298098f63fb7f47f.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/cncf/xds/archive/cb28da3451f158a947dfc45090fe92b07b243bc1.tar.gz",
+ "https://github.com/cncf/xds/archive/cb28da3451f158a947dfc45090fe92b07b243bc1.tar.gz",
],
)
grpc_python_deps()
# TODO: move some dependencies from "grpc_deps" here?
+# buildifier: disable=unnamed-macro
def grpc_test_only_deps():
"""Internal, not intended for use by packages that are consuming grpc.
- Loads dependencies that are only needed to run grpc library's tests."""
+
+ Loads dependencies that are only needed to run grpc library's tests.
+ """
native.bind(
name = "twisted",
actual = "@com_github_twisted_twisted//:twisted",
@@ -486,3 +538,15 @@ def grpc_test_only_deps():
],
build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD",
)
+
+ if "com_google_libprotobuf_mutator" not in native.existing_rules():
+ http_archive(
+ name = "com_google_libprotobuf_mutator",
+ sha256 = "b847c71723d8ce0b747aa661d7f3a07f1d16c595bf9c0202f30febc2f9a24a06",
+ urls = [
+ "https://github.com/google/libprotobuf-mutator/archive/ffd86a32874e5c08a143019aad1aaf0907294c9f.tar.gz",
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/libprotobuf-mutator/archive/ffd86a32874e5c08a143019aad1aaf0907294c9f.tar.gz",
+ ],
+ strip_prefix = "libprotobuf-mutator-ffd86a32874e5c08a143019aad1aaf0907294c9f",
+ build_file = "@com_github_grpc_grpc//third_party:libprotobuf_mutator.BUILD",
+ )
diff --git a/grpc/bazel/grpc_extra_deps.bzl b/grpc/bazel/grpc_extra_deps.bzl
index 2338a14b..4d8afa31 100644
--- a/grpc/bazel/grpc_extra_deps.bzl
+++ b/grpc/bazel/grpc_extra_deps.bzl
@@ -1,12 +1,27 @@
+# Copyright 2021 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.
"""Loads the dependencies necessary for the external repositories defined in grpc_deps.bzl."""
+load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
+load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
+load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
+load("@com_envoyproxy_protoc_gen_validate//:dependencies.bzl", "go_third_party")
+load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
-load("@upb//bazel:workspace_deps.bzl", "upb_deps")
load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
-load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
-load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
-load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
+load("@upb//bazel:workspace_deps.bzl", "upb_deps")
def grpc_extra_deps(ignore_version_differences = False):
"""Loads the extra dependencies.
@@ -26,6 +41,10 @@ def grpc_extra_deps(ignore_version_differences = False):
grpc_extra_deps()
```
+
+ Args:
+ ignore_version_differences: Plumbed directly to the invocation of
+ apple_rules_dependencies.
"""
protobuf_deps()
@@ -34,7 +53,12 @@ def grpc_extra_deps(ignore_version_differences = False):
api_dependencies()
go_rules_dependencies()
- go_register_toolchains()
+ go_register_toolchains(version = "1.18")
+ gazelle_dependencies()
+
+ # Pull-in the go 3rd party dependencies for protoc_gen_validate, which is
+ # needed for building C++ xDS protos
+ go_third_party()
apple_rules_dependencies(ignore_version_differences = ignore_version_differences)
diff --git a/grpc/bazel/grpc_python_deps.bzl b/grpc/bazel/grpc_python_deps.bzl
index 8f0c7db5..c88526e5 100644
--- a/grpc/bazel/grpc_python_deps.bzl
+++ b/grpc/bazel/grpc_python_deps.bzl
@@ -1,9 +1,25 @@
+# Copyright 2021 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.
"""Load dependencies needed to compile and test the grpc python library as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
+# buildifier: disable=unnamed-macro
def grpc_python_deps():
+ """Loads dependencies for gRPC Python."""
+
# protobuf binds to the name "six", so we can't use it here.
# See https://github.com/bazelbuild/bazel/issues/1952 for why bind is
# horrible.
@@ -11,8 +27,8 @@ def grpc_python_deps():
http_archive(
name = "six",
build_file = "@com_github_grpc_grpc//third_party:six.BUILD",
- sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
- urls = ["https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"],
+ sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
+ urls = ["https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz"],
)
if "enum34" not in native.existing_rules():
@@ -36,8 +52,10 @@ def grpc_python_deps():
if "io_bazel_rules_python" not in native.existing_rules():
http_archive(
name = "io_bazel_rules_python",
- url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
- sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
+ url = "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz",
+ sha256 = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea",
+ patches = ["@com_github_grpc_grpc//third_party:rules_python.patch"],
+ patch_args = ["-p1"],
)
python_configure(name = "local_config_python")
@@ -51,9 +69,9 @@ def grpc_python_deps():
http_archive(
name = "cython",
build_file = "@com_github_grpc_grpc//third_party:cython.BUILD",
- sha256 = "e2e38e1f0572ca54d6085df3dec8b607d20e81515fb80215aed19c81e8fe2079",
- strip_prefix = "cython-0.29.21",
+ sha256 = "bb72b2f0ef029472759c711f0a4bded6e15e3f9bda3797550cef3c1d87d02283",
+ strip_prefix = "cython-0.29.26",
urls = [
- "https://github.com/cython/cython/archive/0.29.21.tar.gz",
+ "https://github.com/cython/cython/archive/0.29.26.tar.gz",
],
)
diff --git a/grpc/bazel/grpc_util.bzl b/grpc/bazel/grpc_util.bzl
index 779747c8..42278558 100644
--- a/grpc/bazel/grpc_util.bzl
+++ b/grpc/bazel/grpc_util.bzl
@@ -1,4 +1,22 @@
+# Copyright 2021 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.
# Follows convention set in objectivec_helpers.cc in the protobuf ObjC compiler.
+
+"""
+Contains generic helper utilities.
+"""
+
_upper_segments_list = ["url", "http", "https"]
def strip_extension(str):
@@ -11,6 +29,14 @@ def capitalize(word):
return word.capitalize()
def lower_underscore_to_upper_camel(str):
+ """Converts from lower underscore case to upper camel case.
+
+ Args:
+ str: The snake case string to convert.
+
+ Returns:
+ The title case version of str.
+ """
str = strip_extension(str)
camel_case_str = ""
word = ""
diff --git a/grpc/bazel/internal_python_rules.bzl b/grpc/bazel/internal_python_rules.bzl
new file mode 100644
index 00000000..b2a506c6
--- /dev/null
+++ b/grpc/bazel/internal_python_rules.bzl
@@ -0,0 +1,43 @@
+# Copyright 2021 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.
+"""Python-related rules intended only for use internal to the repo."""
+
+load("//bazel:gevent_test.bzl", "py_grpc_gevent_test")
+
+def internal_py_grpc_test(name, **kwargs):
+ """Runs a test under all supported environments.
+
+ Args:
+ name: The name of the test.
+ **kwargs: Any additional arguments to add to the test.
+ """
+ native.py_test(
+ name = name + ".native",
+ python_version = "PY3",
+ **kwargs
+ )
+ py_grpc_gevent_test(name, **kwargs)
+
+ suite_kwargs = {}
+ if "visibility" in kwargs:
+ suite_kwargs["visibility"] = kwargs["visibility"]
+
+ native.test_suite(
+ name = name,
+ tests = [
+ name + ".native",
+ name + ".gevent",
+ ],
+ **suite_kwargs
+ )
diff --git a/grpc/bazel/objc_grpc_library.bzl b/grpc/bazel/objc_grpc_library.bzl
index 5b712568..dbe07b18 100644
--- a/grpc/bazel/objc_grpc_library.bzl
+++ b/grpc/bazel/objc_grpc_library.bzl
@@ -1,3 +1,20 @@
+# Copyright 2021 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.
+"""
+Contains the objc_grpc_library rule.
+"""
+
load(
"//bazel:generate_objc.bzl",
"generate_objc",
@@ -5,7 +22,6 @@ load(
"generate_objc_non_arc_srcs",
"generate_objc_srcs",
)
-load("//bazel:protobuf.bzl", "well_known_proto_libs")
def objc_grpc_library(name, deps, srcs = [], use_well_known_protos = False, **kwargs):
"""Generates messages and/or service stubs for given proto_library and all transitively dependent proto files
diff --git a/grpc/bazel/protobuf.bzl b/grpc/bazel/protobuf.bzl
index 6475d5bf..4de8f05d 100644
--- a/grpc/bazel/protobuf.bzl
+++ b/grpc/bazel/protobuf.bzl
@@ -1,3 +1,16 @@
+# Copyright 2021 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.
"""Utility functions for generating protobuf code."""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
@@ -21,6 +34,9 @@ def well_known_proto_libs():
"@com_google_protobuf//:wrappers_proto",
]
+def is_well_known(label):
+ return label in well_known_proto_libs()
+
def get_proto_root(workspace_root):
"""Gets the root protobuf directory.
@@ -60,9 +76,10 @@ def proto_path_to_generated_filename(proto_path, fmt_str):
return fmt_str.format(_strip_proto_extension(proto_path))
def get_include_directory(source_file):
- """Returns the include directory path for the source_file. I.e. all of the
- include statements within the given source_file are calculated relative to
- the directory returned by this method.
+ """Returns the include directory path for the source_file.
+
+ All of the include statements within the given source_file are calculated
+ relative to the directory returned by this method.
The returned directory path can be used as the "--proto_path=" argument
value.
@@ -128,15 +145,49 @@ def get_plugin_args(
),
]
-def _get_staged_proto_file(context, source_file):
- if source_file.dirname == context.label.package or \
+def _make_prefix(label):
+ """Returns the directory prefix for a label.
+
+ @repo//foo/bar:sub/dir/file.proto => 'external/repo/foo/bar/'
+ //foo/bar:sub/dir/file.proto => 'foo/bar/'
+ //:sub/dir/file.proto => ''
+
+ That is, the prefix can be removed from a file's full path to
+ obtain the file's relative location within the package's effective
+ directory."""
+
+ wsr = label.workspace_root
+ pkg = label.package
+
+ if not wsr and not pkg:
+ return ""
+ elif not wsr:
+ return pkg + "/"
+ elif not pkg:
+ return wsr + "/"
+ else:
+ return wsr + "/" + pkg + "/"
+
+def get_staged_proto_file(label, context, source_file):
+ """Copies a proto file to the appropriate location if necessary.
+
+ Args:
+ label: The label of the rule using the .proto file.
+ context: The ctx object for the rule or aspect.
+ source_file: The original .proto file.
+
+ Returns:
+ The original proto file OR a new file in the staged location.
+ """
+ if source_file.dirname == label.package or \
is_in_virtual_imports(source_file):
# Current target and source_file are in same package
return source_file
else:
# Current target and source_file are in different packages (most
# probably even in different repositories)
- copied_proto = context.actions.declare_file(source_file.basename)
+ prefix = _make_prefix(source_file.owner)
+ copied_proto = context.actions.declare_file(source_file.path[len(prefix):])
context.actions.run_shell(
inputs = [source_file],
outputs = [copied_proto],
@@ -157,7 +208,7 @@ def protos_from_context(context):
protos = []
for src in context.attr.deps:
for file in src[ProtoInfo].direct_sources:
- protos.append(_get_staged_proto_file(context, file))
+ protos.append(get_staged_proto_file(context.label, context, file))
return protos
def includes_from_deps(deps):
@@ -169,7 +220,15 @@ def includes_from_deps(deps):
]
def get_proto_arguments(protos, genfiles_dir_path):
- """Get the protoc arguments specifying which protos to compile."""
+ """Get the protoc arguments specifying which protos to compile.
+
+ Args:
+ protos: The protob files to supply.
+ genfiles_dir_path: The path to the genfiles directory.
+
+ Returns:
+ The arguments to supply to protoc.
+ """
arguments = []
for proto in protos:
strip_prefix_len = 0
@@ -185,15 +244,30 @@ def get_proto_arguments(protos, genfiles_dir_path):
return arguments
def declare_out_files(protos, context, generated_file_format):
- """Declares and returns the files to be generated."""
+ """Declares and returns the files to be generated.
+
+ Args:
+ protos: A list of files. The protos to declare.
+ context: The context object.
+ generated_file_format: A format string. Will be passed to
+ proto_path_to_generated_filename to generate the filename of each
+ generated file.
+
+ Returns:
+ A list of file providers.
+ """
out_file_paths = []
for proto in protos:
if not is_in_virtual_imports(proto):
- out_file_paths.append(proto.basename)
+ prefix = _make_prefix(proto.owner)
+ full_prefix = context.genfiles_dir.path + "/" + prefix
+ if proto.path.startswith(full_prefix):
+ out_file_paths.append(proto.path[len(full_prefix):])
+ elif proto.path.startswith(prefix):
+ out_file_paths.append(proto.path[len(prefix):])
else:
- path = proto.path[proto.path.index(_VIRTUAL_IMPORTS) + 1:]
- out_file_paths.append(path)
+ out_file_paths.append(proto.path[proto.path.index(_VIRTUAL_IMPORTS) + 1:])
return [
context.actions.declare_file(
@@ -206,8 +280,9 @@ def declare_out_files(protos, context, generated_file_format):
]
def get_out_dir(protos, context):
- """ Returns the calculated value for --<lang>_out= protoc argument based on
- the input source proto files and current context.
+ """Returns the value to supply to the --<lang>_out= protoc flag.
+
+ The result is based on the input source proto files and current context.
Args:
protos: A list of protos to be used as source files in protoc command
@@ -224,11 +299,11 @@ def get_out_dir(protos, context):
if at_least_one_virtual:
out_dir = get_include_directory(protos[0])
ws_root = protos[0].owner.workspace_root
- if ws_root and out_dir.find(ws_root) >= 0:
- out_dir = "".join(out_dir.rsplit(ws_root, 1))
+ prefix = "/" + _make_prefix(protos[0].owner) + _VIRTUAL_IMPORTS[1:]
+
return struct(
path = out_dir,
- import_path = out_dir[out_dir.find(_VIRTUAL_IMPORTS) + 1:],
+ import_path = out_dir[out_dir.find(prefix) + 1:],
)
out_dir = context.genfiles_dir.path
@@ -238,10 +313,11 @@ def get_out_dir(protos, context):
return struct(path = out_dir, import_path = None)
def is_in_virtual_imports(source_file, virtual_folder = _VIRTUAL_IMPORTS):
- """Determines if source_file is virtual (is placed in _virtual_imports
- subdirectory). The output of all proto_library targets which use
- import_prefix and/or strip_import_prefix arguments is placed under
- _virtual_imports directory.
+ """Determines if source_file is virtual.
+
+ A file is virtual if placed in the _virtual_imports subdirectory. The
+ output of all proto_library targets which use import_prefix and/or
+ strip_import_prefix arguments is placed under _virtual_imports directory.
Args:
source_file: A proto file.
diff --git a/grpc/bazel/python_rules.bzl b/grpc/bazel/python_rules.bzl
index 8418c291..a39159ab 100644
--- a/grpc/bazel/python_rules.bzl
+++ b/grpc/bazel/python_rules.bzl
@@ -1,3 +1,16 @@
+# Copyright 2021 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.
"""Generates and compiles Python gRPC stubs from proto_library rules."""
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
@@ -8,42 +21,61 @@ load(
"get_out_dir",
"get_plugin_args",
"get_proto_arguments",
+ "get_staged_proto_file",
"includes_from_deps",
+ "is_well_known",
"protos_from_context",
)
_GENERATED_PROTO_FORMAT = "{}_pb2.py"
_GENERATED_GRPC_PROTO_FORMAT = "{}_pb2_grpc.py"
-def _generate_py_impl(context):
- protos = protos_from_context(context)
- includes = includes_from_deps(context.attr.deps)
+PyProtoInfo = provider(
+ "The Python outputs from the Protobuf compiler.",
+ fields = {
+ "py_info": "A PyInfo provider for the generated code.",
+ "generated_py_srcs": "The direct (not transitive) generated Python source files.",
+ },
+)
+
+def _merge_pyinfos(pyinfos):
+ return PyInfo(
+ transitive_sources = depset(transitive = [p.transitive_sources for p in pyinfos]),
+ imports = depset(transitive = [p.imports for p in pyinfos]),
+ )
+
+def _gen_py_aspect_impl(target, context):
+ # Early return for well-known protos.
+ if is_well_known(str(context.label)):
+ return [
+ PyProtoInfo(py_info = context.attr._protobuf_library[PyInfo]),
+ ]
+
+ protos = []
+ for p in target[ProtoInfo].direct_sources:
+ protos.append(get_staged_proto_file(target.label, context, p))
+
+ includes = depset(direct = protos, transitive = [target[ProtoInfo].transitive_imports])
out_files = declare_out_files(protos, context, _GENERATED_PROTO_FORMAT)
+ generated_py_srcs = out_files
+
tools = [context.executable._protoc]
out_dir = get_out_dir(protos, context)
+
arguments = ([
"--python_out={}".format(out_dir.path),
] + [
"--proto_path={}".format(get_include_directory(i))
- for i in includes
+ for i in includes.to_list()
] + [
"--proto_path={}".format(context.genfiles_dir.path),
])
- if context.attr.plugin:
- arguments += get_plugin_args(
- context.executable.plugin,
- [],
- out_dir.path,
- False,
- context.attr.plugin.label.name,
- )
- tools.append(context.executable.plugin)
arguments += get_proto_arguments(protos, context.genfiles_dir.path)
context.actions.run(
- inputs = protos + includes,
+ inputs = protos + includes.to_list(),
tools = tools,
outputs = out_files,
executable = context.executable._protoc,
@@ -53,28 +85,79 @@ def _generate_py_impl(context):
imports = []
if out_dir.import_path:
- imports.append("%s/%s/%s" % (context.workspace_name, context.label.package, out_dir.import_path))
+ imports.append("{}/{}".format(context.workspace_name, out_dir.import_path))
+
+ py_info = PyInfo(transitive_sources = depset(direct = out_files), imports = depset(direct = imports))
+ return PyProtoInfo(
+ py_info = _merge_pyinfos(
+ [
+ py_info,
+ context.attr._protobuf_library[PyInfo],
+ ] + [dep[PyProtoInfo].py_info for dep in context.rule.attr.deps],
+ ),
+ generated_py_srcs = generated_py_srcs,
+ )
+_gen_py_aspect = aspect(
+ implementation = _gen_py_aspect_impl,
+ attr_aspects = ["deps"],
+ fragments = ["py"],
+ attrs = {
+ "_protoc": attr.label(
+ default = Label("//external:protocol_compiler"),
+ providers = ["files_to_run"],
+ executable = True,
+ cfg = "host",
+ ),
+ "_protobuf_library": attr.label(
+ default = Label("@com_google_protobuf//:protobuf_python"),
+ providers = [PyInfo],
+ ),
+ },
+)
+
+def _generate_py_impl(context):
+ if (len(context.attr.deps) != 1):
+ fail("Can only compile a single proto at a time.")
+
+ py_sources = []
+
+ # If the proto_library this rule *directly* depends on is in another
+ # package, then we generate .py files to import them in this package. This
+ # behavior is needed to allow rearranging of import paths to make Bazel
+ # outputs align with native python workflows.
+ #
+ # Note that this approach is vulnerable to protoc defining __all__ or other
+ # symbols with __ prefixes that need to be directly imported. Since these
+ # names are likely to be reserved for private APIs, the risk is minimal.
+ if context.label.package != context.attr.deps[0].label.package:
+ for py_src in context.attr.deps[0][PyProtoInfo].generated_py_srcs:
+ reimport_py_file = context.actions.declare_file(py_src.basename)
+ py_sources.append(reimport_py_file)
+ import_line = "from %s import *" % py_src.short_path.replace("/", ".")[:-len(".py")]
+ context.actions.write(reimport_py_file, import_line)
+
+ # Collect output PyInfo provider.
+ imports = [context.label.package + "/" + i for i in context.attr.imports]
+ py_info = PyInfo(transitive_sources = depset(direct = py_sources), imports = depset(direct = imports))
+ out_pyinfo = _merge_pyinfos([py_info, context.attr.deps[0][PyProtoInfo].py_info])
+
+ runfiles = context.runfiles(files = out_pyinfo.transitive_sources.to_list()).merge(context.attr._protobuf_library[DefaultInfo].data_runfiles)
return [
- DefaultInfo(files = depset(direct = out_files)),
- PyInfo(
- transitive_sources = depset(),
- imports = depset(direct = imports),
+ DefaultInfo(
+ files = out_pyinfo.transitive_sources,
+ runfiles = runfiles,
),
+ out_pyinfo,
]
-_generate_pb2_src = rule(
+py_proto_library = rule(
attrs = {
"deps": attr.label_list(
mandatory = True,
allow_empty = False,
providers = [ProtoInfo],
- ),
- "plugin": attr.label(
- mandatory = False,
- executable = True,
- providers = ["files_to_run"],
- cfg = "host",
+ aspects = [_gen_py_aspect],
),
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
@@ -82,46 +165,15 @@ _generate_pb2_src = rule(
executable = True,
cfg = "host",
),
+ "_protobuf_library": attr.label(
+ default = Label("@com_google_protobuf//:protobuf_python"),
+ providers = [PyInfo],
+ ),
+ "imports": attr.string_list(),
},
implementation = _generate_py_impl,
)
-def py_proto_library(
- name,
- deps,
- plugin = None,
- **kwargs):
- """Generate python code for a protobuf.
-
- Args:
- name: The name of the target.
- deps: A list of proto_library dependencies. Must contain a single element.
- plugin: An optional custom protoc plugin to execute together with
- generating the protobuf code.
- **kwargs: Additional arguments to be supplied to the invocation of
- py_library.
- """
- codegen_target = "_{}_codegen".format(name)
- if len(deps) != 1:
- fail("Can only compile a single proto at a time.")
-
- _generate_pb2_src(
- name = codegen_target,
- deps = deps,
- plugin = plugin,
- **kwargs
- )
-
- native.py_library(
- name = name,
- srcs = [":{}".format(codegen_target)],
- deps = [
- "@com_google_protobuf//:protobuf_python",
- ":{}".format(codegen_target),
- ],
- **kwargs
- )
-
def _generate_pb2_grpc_src_impl(context):
protos = protos_from_context(context)
includes = includes_from_deps(context.attr.deps)
@@ -138,21 +190,12 @@ def _generate_pb2_grpc_src_impl(context):
out_dir.path,
False,
)
- if context.attr.plugin:
- arguments += get_plugin_args(
- context.executable.plugin,
- [],
- out_dir.path,
- False,
- context.attr.plugin.label.name,
- )
- tools.append(context.executable.plugin)
arguments += [
"--proto_path={}".format(get_include_directory(i))
for i in includes
]
- arguments += ["--proto_path={}".format(context.genfiles_dir.path)]
+ arguments.append("--proto_path={}".format(context.genfiles_dir.path))
arguments += get_proto_arguments(protos, context.genfiles_dir.path)
context.actions.run(
@@ -164,13 +207,22 @@ def _generate_pb2_grpc_src_impl(context):
mnemonic = "ProtocInvocation",
)
+ p = PyInfo(transitive_sources = depset(direct = out_files))
+ py_info = _merge_pyinfos(
+ [
+ p,
+ context.attr._grpc_library[PyInfo],
+ ] + [dep[PyInfo] for dep in context.attr.py_deps],
+ )
+
+ runfiles = context.runfiles(files = out_files, transitive_files = py_info.transitive_sources).merge(context.attr._grpc_library[DefaultInfo].data_runfiles)
+
return [
- DefaultInfo(files = depset(direct = out_files)),
- PyInfo(
- transitive_sources = depset(),
- # Imports are already configured by the generated py impl
- imports = depset(),
+ DefaultInfo(
+ files = depset(direct = out_files),
+ runfiles = runfiles,
),
+ py_info,
]
_generate_pb2_grpc_src = rule(
@@ -180,13 +232,12 @@ _generate_pb2_grpc_src = rule(
allow_empty = False,
providers = [ProtoInfo],
),
- "strip_prefixes": attr.string_list(),
- "plugin": attr.label(
- mandatory = False,
- executable = True,
- providers = ["files_to_run"],
- cfg = "host",
+ "py_deps": attr.label_list(
+ mandatory = True,
+ allow_empty = False,
+ providers = [PyInfo],
),
+ "strip_prefixes": attr.string_list(),
"_grpc_plugin": attr.label(
executable = True,
providers = ["files_to_run"],
@@ -199,6 +250,10 @@ _generate_pb2_grpc_src = rule(
cfg = "host",
default = Label("//external:protocol_compiler"),
),
+ "_grpc_library": attr.label(
+ default = Label("//src/python/grpcio/grpc:grpcio"),
+ providers = [PyInfo],
+ ),
},
implementation = _generate_pb2_grpc_src_impl,
)
@@ -207,7 +262,6 @@ def py_grpc_library(
name,
srcs,
deps,
- plugin = None,
strip_prefixes = [],
**kwargs):
"""Generate python code for gRPC services defined in a protobuf.
@@ -222,12 +276,9 @@ def py_grpc_library(
stripped from the beginning of foo_pb2 modules imported by the
generated stubs. This is useful in combination with the `imports`
attribute of the `py_library` rule.
- plugin: An optional custom protoc plugin to execute together with
- generating the gRPC code.
**kwargs: Additional arguments to be supplied to the invocation of
py_library.
"""
- codegen_grpc_target = "_{}_grpc_codegen".format(name)
if len(srcs) != 1:
fail("Can only compile a single proto at a time.")
@@ -235,56 +286,9 @@ def py_grpc_library(
fail("Deps must have length 1.")
_generate_pb2_grpc_src(
- name = codegen_grpc_target,
+ name = name,
deps = srcs,
+ py_deps = deps,
strip_prefixes = strip_prefixes,
- plugin = plugin,
- **kwargs
- )
-
- native.py_library(
- name = name,
- srcs = [
- ":{}".format(codegen_grpc_target),
- ],
- deps = [
- Label("//src/python/grpcio/grpc:grpcio"),
- ] + deps + [
- ":{}".format(codegen_grpc_target),
- ],
**kwargs
)
-
-def py2and3_test(
- name,
- py_test = native.py_test,
- **kwargs):
- """Runs a Python test under both Python 2 and Python 3.
-
- Args:
- name: The name of the test.
- py_test: The rule to use for each test.
- **kwargs: Keyword arguments passed directly to the underlying py_test
- rule.
- """
- if "python_version" in kwargs:
- fail("Cannot specify 'python_version' in py2and3_test.")
-
- names = [name + suffix for suffix in (".python2", ".python3")]
- python_versions = ["PY2", "PY3"]
- for case_name, python_version in zip(names, python_versions):
- py_test(
- name = case_name,
- python_version = python_version,
- **kwargs
- )
-
- suite_kwargs = {}
- if "visibility" in kwargs:
- suite_kwargs["visibility"] = kwargs["visibility"]
-
- native.test_suite(
- name = name,
- tests = names,
- **suite_kwargs
- )
diff --git a/grpc/bazel/supported_versions.txt b/grpc/bazel/supported_versions.txt
new file mode 100644
index 00000000..97a43aa8
--- /dev/null
+++ b/grpc/bazel/supported_versions.txt
@@ -0,0 +1,3 @@
+5.0.0
+4.2.2
+3.7.2
diff --git a/grpc/bazel/test/python_test_repo/BUILD b/grpc/bazel/test/python_test_repo/BUILD
deleted file mode 100644
index e7d359c6..00000000
--- a/grpc/bazel/test/python_test_repo/BUILD
+++ /dev/null
@@ -1,116 +0,0 @@
-# gRPC Bazel BUILD file.
-#
-# 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.
-
-load("@rules_proto//proto:defs.bzl", "proto_library")
-load(
- "@com_github_grpc_grpc//bazel:python_rules.bzl",
- "py2and3_test",
- "py_grpc_library",
- "py_proto_library",
-)
-
-package(default_testonly = 1)
-
-proto_library(
- name = "helloworld_proto",
- srcs = ["helloworld.proto"],
- deps = [
- "@com_google_protobuf//:duration_proto",
- "@com_google_protobuf//:timestamp_proto",
- ],
-)
-
-py_proto_library(
- name = "helloworld_py_pb2",
- deps = [":helloworld_proto"],
-)
-
-py_grpc_library(
- name = "helloworld_py_pb2_grpc",
- srcs = [":helloworld_proto"],
- deps = [":helloworld_py_pb2"],
-)
-
-py_proto_library(
- name = "duration_py_pb2",
- deps = ["@com_google_protobuf//:duration_proto"],
-)
-
-py_proto_library(
- name = "timestamp_py_pb2",
- deps = ["@com_google_protobuf//:timestamp_proto"],
-)
-
-py2and3_test(
- name = "import_test",
- srcs = ["helloworld.py"],
- main = "helloworld.py",
- deps = [
- ":duration_py_pb2",
- ":helloworld_py_pb2",
- ":helloworld_py_pb2_grpc",
- ":timestamp_py_pb2",
- ],
-)
-
-# Test compatibility of py_proto_library and py_grpc_library rules with
-# proto_library targets as deps when the latter use import_prefix and/or
-# strip_import_prefix arguments
-#
-# See namespaced/upper/example for more encompassing tests.
-proto_library(
- name = "helloworld_moved_proto",
- srcs = ["helloworld.proto"],
- import_prefix = "google/cloud",
- strip_import_prefix = "",
- deps = [
- "@com_google_protobuf//:duration_proto",
- "@com_google_protobuf//:timestamp_proto",
- ],
-)
-
-# Also test the custom plugin execution parameter
-py_proto_library(
- name = "helloworld_moved_py_pb2",
- plugin = ":dummy_plugin",
- deps = [":helloworld_moved_proto"],
-)
-
-py_grpc_library(
- name = "helloworld_moved_py_pb2_grpc",
- srcs = [":helloworld_moved_proto"],
- deps = [":helloworld_moved_py_pb2"],
-)
-
-py2and3_test(
- name = "import_moved_test",
- srcs = ["helloworld_moved.py"],
- main = "helloworld_moved.py",
- deps = [
- ":duration_py_pb2",
- ":helloworld_moved_py_pb2",
- ":helloworld_moved_py_pb2_grpc",
- ":timestamp_py_pb2",
- ],
-)
-
-py_binary(
- name = "dummy_plugin",
- srcs = [":dummy_plugin.py"],
- deps = [
- "@com_google_protobuf//:protobuf_python",
- ],
-)
diff --git a/grpc/bazel/test/python_test_repo/WORKSPACE b/grpc/bazel/test/python_test_repo/WORKSPACE
deleted file mode 100644
index a10b8f96..00000000
--- a/grpc/bazel/test/python_test_repo/WORKSPACE
+++ /dev/null
@@ -1,15 +0,0 @@
-local_repository(
- name = "com_github_grpc_grpc",
- path = "../../..",
-)
-
-# Ensure rules don't rely on __main__ naming convention.
-workspace(name = "python_test_repo")
-
-load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
-
-grpc_deps()
-
-load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
-
-grpc_extra_deps()
diff --git a/grpc/bazel/test/python_test_repo/dummy_plugin.py b/grpc/bazel/test/python_test_repo/dummy_plugin.py
deleted file mode 100644
index a7e3a017..00000000
--- a/grpc/bazel/test/python_test_repo/dummy_plugin.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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.
-"""A dummy plugin for testing"""
-
-import sys
-
-from google.protobuf.compiler.plugin_pb2 import CodeGeneratorRequest
-from google.protobuf.compiler.plugin_pb2 import CodeGeneratorResponse
-
-
-def main(input_file=sys.stdin, output_file=sys.stdout):
- request = CodeGeneratorRequest.FromString(input_file.buffer.read())
- answer = []
- for fname in request.file_to_generate:
- answer.append(CodeGeneratorResponse.File(
- name=fname.replace('.proto', '_pb2.py'),
- insertion_point='module_scope',
- content="# Hello {}, I'm a dummy plugin!".format(fname),
- ))
-
- cgr = CodeGeneratorResponse(file=answer)
- output_file.buffer.write(cgr.SerializeToString())
-
-
-if __name__ == '__main__':
- main()
diff --git a/grpc/bazel/test/python_test_repo/helloworld.proto b/grpc/bazel/test/python_test_repo/helloworld.proto
deleted file mode 100644
index b333a740..00000000
--- a/grpc/bazel/test/python_test_repo/helloworld.proto
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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.
-
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "io.grpc.examples.helloworld";
-option java_outer_classname = "HelloWorldProto";
-option objc_class_prefix = "HLW";
-
-package helloworld;
-
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/duration.proto";
-
-// The greeting service definition.
-service Greeter {
- // Sends a greeting
- rpc SayHello (HelloRequest) returns (HelloReply) {}
-}
-
-// The request message containing the user's name.
-message HelloRequest {
- string name = 1;
- google.protobuf.Timestamp request_initiation = 2;
-}
-
-// The response message containing the greetings
-message HelloReply {
- string message = 1;
- google.protobuf.Duration request_duration = 2;
-}
diff --git a/grpc/bazel/test/python_test_repo/helloworld.py b/grpc/bazel/test/python_test_repo/helloworld.py
deleted file mode 100644
index 3f87191e..00000000
--- a/grpc/bazel/test/python_test_repo/helloworld.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# 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 Python implementation of the GRPC helloworld.Greeter client."""
-
-import contextlib
-import datetime
-import logging
-import unittest
-
-import grpc
-
-from google.protobuf import duration_pb2
-from google.protobuf import timestamp_pb2
-from concurrent import futures
-import helloworld_pb2
-import helloworld_pb2_grpc
-
-_HOST = 'localhost'
-_SERVER_ADDRESS = '{}:0'.format(_HOST)
-
-
-class Greeter(helloworld_pb2_grpc.GreeterServicer):
-
- def SayHello(self, request, context):
- request_in_flight = datetime.datetime.now() - \
- request.request_initiation.ToDatetime()
- request_duration = duration_pb2.Duration()
- request_duration.FromTimedelta(request_in_flight)
- return helloworld_pb2.HelloReply(
- message='Hello, %s!' % request.name,
- request_duration=request_duration,
- )
-
-
-@contextlib.contextmanager
-def _listening_server():
- server = grpc.server(futures.ThreadPoolExecutor())
- helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
- port = server.add_insecure_port(_SERVER_ADDRESS)
- server.start()
- try:
- yield port
- finally:
- server.stop(0)
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- with _listening_server() as port:
- with grpc.insecure_channel('{}:{}'.format(_HOST, port)) as channel:
- stub = helloworld_pb2_grpc.GreeterStub(channel)
- request_timestamp = timestamp_pb2.Timestamp()
- request_timestamp.GetCurrentTime()
- response = stub.SayHello(helloworld_pb2.HelloRequest(
- name='you',
- request_initiation=request_timestamp,
- ),
- wait_for_ready=True)
- self.assertEqual(response.message, "Hello, you!")
- self.assertGreater(response.request_duration.nanos, 0)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/helloworld_moved.py b/grpc/bazel/test/python_test_repo/helloworld_moved.py
deleted file mode 100644
index b32042cd..00000000
--- a/grpc/bazel/test/python_test_repo/helloworld_moved.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# 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 Python implementation of the GRPC helloworld.Greeter client."""
-
-import contextlib
-import datetime
-import logging
-import unittest
-
-import grpc
-
-from google.protobuf import duration_pb2
-from google.protobuf import timestamp_pb2
-from concurrent import futures
-from google.cloud import helloworld_pb2
-from google.cloud import helloworld_pb2_grpc
-
-_HOST = 'localhost'
-_SERVER_ADDRESS = '{}:0'.format(_HOST)
-
-
-class Greeter(helloworld_pb2_grpc.GreeterServicer):
-
- def SayHello(self, request, context):
- request_in_flight = datetime.datetime.now() - \
- request.request_initiation.ToDatetime()
- request_duration = duration_pb2.Duration()
- request_duration.FromTimedelta(request_in_flight)
- return helloworld_pb2.HelloReply(
- message='Hello, %s!' % request.name,
- request_duration=request_duration,
- )
-
-
-@contextlib.contextmanager
-def _listening_server():
- server = grpc.server(futures.ThreadPoolExecutor())
- helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
- port = server.add_insecure_port(_SERVER_ADDRESS)
- server.start()
- try:
- yield port
- finally:
- server.stop(0)
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- with _listening_server() as port:
- with grpc.insecure_channel('{}:{}'.format(_HOST, port)) as channel:
- stub = helloworld_pb2_grpc.GreeterStub(channel)
- request_timestamp = timestamp_pb2.Timestamp()
- request_timestamp.GetCurrentTime()
- response = stub.SayHello(helloworld_pb2.HelloRequest(
- name='you',
- request_initiation=request_timestamp,
- ),
- wait_for_ready=True)
- self.assertEqual(response.message, "Hello, you!")
- self.assertGreater(response.request_duration.nanos, 0)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/BUILD b/grpc/bazel/test/python_test_repo/namespaced/upper/example/BUILD
deleted file mode 100644
index 8995a731..00000000
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/BUILD
+++ /dev/null
@@ -1,165 +0,0 @@
-# gRPC Bazel BUILD file.
-#
-# 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.
-
-load("@rules_proto//proto:defs.bzl", "proto_library")
-load(
- "@com_github_grpc_grpc//bazel:python_rules.bzl",
- "py2and3_test",
- "py_grpc_library",
- "py_proto_library",
-)
-
-_IMPORT_PREFIX = "foo/bar"
-
-_STRIP_PREFIX = "/%s" % package_name()
-
-proto_library(
- name = "import_no_strip_proto",
- srcs = ["namespaced_example.proto"],
- import_prefix = _IMPORT_PREFIX,
- strip_import_prefix = None,
-)
-
-proto_library(
- name = "import_strip_proto",
- srcs = ["namespaced_example.proto"],
- import_prefix = _IMPORT_PREFIX,
- strip_import_prefix = _STRIP_PREFIX,
-)
-
-proto_library(
- name = "no_import_no_strip_proto",
- srcs = ["namespaced_example.proto"],
- import_prefix = None,
- strip_import_prefix = None,
-)
-
-proto_library(
- name = "no_import_strip_proto",
- srcs = ["namespaced_example.proto"],
- import_prefix = None,
- strip_import_prefix = _STRIP_PREFIX,
-)
-
-py_proto_library(
- name = "import_no_strip_py_pb2",
- deps = ["import_no_strip_proto"],
-)
-
-py_grpc_library(
- name = "import_no_strip_py_pb2_grpc",
- srcs = ["import_no_strip_proto"],
- deps = ["import_no_strip_py_pb2"],
-)
-
-py_proto_library(
- name = "import_strip_py_pb2",
- deps = ["import_strip_proto"],
-)
-
-py_grpc_library(
- name = "import_strip_py_pb2_grpc",
- srcs = ["import_strip_proto"],
- deps = ["import_strip_py_pb2"],
-)
-
-py_proto_library(
- name = "no_import_no_strip_py_pb2",
- deps = ["no_import_no_strip_proto"],
-)
-
-py_grpc_library(
- name = "no_import_no_strip_py_pb2_grpc",
- srcs = ["no_import_no_strip_proto"],
- deps = ["no_import_no_strip_py_pb2"],
-)
-
-py_proto_library(
- name = "no_import_strip_py_pb2",
- deps = ["no_import_strip_proto"],
-)
-
-py_grpc_library(
- name = "no_import_strip_py_pb2_grpc",
- srcs = ["no_import_strip_proto"],
- deps = ["no_import_strip_py_pb2"],
-)
-
-#################
-# Namespace Tests
-#################
-
-# Most examples with protos have all proto packages rooted at the workspace root. i.e. google/api has
-# a directory structure:
-# - WORKSPACE
-# - /google
-# - /api
-# - files.proto
-#
-# But if you can't anchor the protos at the root, you have to use strip and import prefixes. This results
-# in the following directory layout for python, which needs to properly be added to the imports.
-#
-# No Import or Strip (Can't compile if there are any proto dependencies)
-# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/namespaced_example_pb2.py
-#
-# No import Prefix (Can't compile if there are any proto dependencies)
-# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/namespaced_example_pb2.py
-#
-# No strip prefix (Can't compile if there are any proto dependencies)
-# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/upper/example/namespaced/upper/example/namespaced_example_pb2.py
-#
-# Both Import and Strip
-# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/upper/example/namespaced_example_pb2.py
-
-py2and3_test(
- "import_no_strip_test",
- srcs = ["import_no_strip_test.py"],
- main = "import_no_strip_test.py",
- deps = [
- ":import_no_strip_py_pb2",
- ":import_no_strip_py_pb2_grpc",
- ],
-)
-
-py2and3_test(
- "import_strip_test",
- srcs = ["import_strip_test.py"],
- main = "import_strip_test.py",
- deps = [
- ":import_strip_py_pb2",
- ":import_strip_py_pb2_grpc",
- ],
-)
-
-py2and3_test(
- "no_import_no_strip_test",
- srcs = ["no_import_no_strip_test.py"],
- main = "no_import_no_strip_test.py",
- deps = [
- ":no_import_no_strip_py_pb2",
- ":no_import_no_strip_py_pb2_grpc",
- ],
-)
-
-py2and3_test(
- "no_import_strip_test",
- srcs = ["no_import_strip_test.py"],
- main = "no_import_strip_test.py",
- deps = [
- ":no_import_strip_py_pb2",
- ":no_import_strip_py_pb2_grpc",
- ],
-)
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_no_strip_test.py b/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_no_strip_test.py
deleted file mode 100644
index 1b5505df..00000000
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_no_strip_test.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- from foo.bar.namespaced.upper.example.namespaced_example_pb2 import NamespacedExample
- namespaced_example = NamespacedExample()
- namespaced_example.value = "hello"
- # Dummy assert, important part is namespaced example was imported.
- self.assertEqual(namespaced_example.value, "hello")
-
- def test_grpc(self):
- from foo.bar.namespaced.upper.example.namespaced_example_pb2_grpc import NamespacedServiceStub
- # No error from import
- self.assertEqual(1, 1)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_strip_test.py b/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_strip_test.py
deleted file mode 100644
index 3519a8aa..00000000
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/import_strip_test.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- from foo.bar.namespaced_example_pb2 import NamespacedExample
- namespaced_example = NamespacedExample()
- namespaced_example.value = "hello"
- # Dummy assert, important part is namespaced example was imported.
- self.assertEqual(namespaced_example.value, "hello")
-
- def test_grpc(self):
- from foo.bar.namespaced_example_pb2_grpc import NamespacedServiceStub
- # No error from import
- self.assertEqual(1, 1)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_no_strip_test.py b/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_no_strip_test.py
deleted file mode 100644
index c0868175..00000000
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_no_strip_test.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- from namespaced.upper.example.namespaced_example_pb2 import NamespacedExample
- namespaced_example = NamespacedExample()
- namespaced_example.value = "hello"
- # Dummy assert, important part is namespaced example was imported.
- self.assertEqual(namespaced_example.value, "hello")
-
- def test_grpc(self):
- from namespaced.upper.example.namespaced_example_pb2_grpc import NamespacedServiceStub
- # No error from import
- self.assertEqual(1, 1)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_strip_test.py b/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_strip_test.py
deleted file mode 100644
index 38dd4fba..00000000
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/no_import_strip_test.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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
-
-
-class ImportTest(unittest.TestCase):
- def test_import(self):
- from namespaced_example_pb2 import NamespacedExample
- namespaced_example = NamespacedExample()
- namespaced_example.value = "hello"
- # Dummy assert, important part is namespaced example was imported.
- self.assertEqual(namespaced_example.value, "hello")
-
- def test_grpc(self):
- from namespaced_example_pb2_grpc import NamespacedServiceStub
- # No error from import
- self.assertEqual(1, 1)
-
-
-if __name__ == '__main__':
- logging.basicConfig()
- unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/tools/bazel b/grpc/bazel/test/python_test_repo/tools/bazel
deleted file mode 100755
index aaa549a3..00000000
--- a/grpc/bazel/test/python_test_repo/tools/bazel
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-# 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.
-
-
-# Keeping up with Bazel's breaking changes is currently difficult.
-# This script wraps calling bazel by downloading the currently
-# supported version, and then calling it. This way, we can make sure
-# that running bazel will always get meaningful results, at least
-# until Bazel 1.0 is released.
-# NOTE: This script relies on bazel's feature where //tools/bazel
-# script can be used to hijack "bazel" invocations in given workspace.
-
-set -e
-
-# DISABLE_BAZEL_WRAPPER can be set to eliminate the wrapper logic
-if [ "${DISABLE_BAZEL_WRAPPER}" != "" ]
-then
- if [ "${BAZEL_REAL}" != "" ]
- then
- # use BAZEL_REAL as set by
- # https://github.com/bazelbuild/bazel/blob/master/scripts/packages/bazel.sh
- # that originally invoked this script (this is what happens when you
- # run "bazel" in our workspace)
- exec -a "$0" "${BAZEL_REAL}" "$@"
- else
- # if BAZEL_REAL is not set, just invoke the default system bazel
- exec bazel "$@"
- fi
-fi
-
-# IMPORTANT: if you update the version here, other parts of infrastructure might needs updating as well
-# (e.g. win RBE builds, sanity checks, bazel toolchains etc.)
-VERSION=3.7.1
-echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." >&2
-
-# update tools/update_mirror.sh to populate the mirror with new bazel archives
-BASEURL_MIRROR="https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel/releases/download"
-BASEURL="https://github.com/bazelbuild/bazel/releases/download"
-pushd "$(dirname "$0")" >/dev/null
-TOOLDIR=$(pwd)
-
-case $(uname -sm) in
- "Linux x86_64")
- suffix=linux-x86_64
- ;;
- "Linux aarch64")
- suffix=linux-arm64
- ;;
- "Darwin x86_64")
- suffix=darwin-x86_64
- ;;
- *)
- echo "Unsupported architecture: $(uname -sm)" >&2
- exit 1
- ;;
-esac
-
-filename="bazel-$VERSION-$suffix"
-
-if [ ! -x "$filename" ] ; then
- # first try to download using mirror, fallback to download from github
- echo "Downloading bazel, will try URLs: ${BASEURL_MIRROR}/${VERSION}/${filename} ${BASEURL}/${VERSION}/${filename}" >&2
- curl --fail -L --output "${filename}" "${BASEURL_MIRROR}/${VERSION}/${filename}" || curl --fail -L --output "${filename}" "${BASEURL}/${VERSION}/${filename}"
- chmod a+x "$filename"
-fi
-
-popd >/dev/null
-exec "$TOOLDIR/$filename" "$@"
diff --git a/grpc/bazel/update_mirror.sh b/grpc/bazel/update_mirror.sh
index 274fe516..a4805db6 100755
--- a/grpc/bazel/update_mirror.sh
+++ b/grpc/bazel/update_mirror.sh
@@ -69,6 +69,10 @@ upload github.com/bazelbuild/bazel/releases/download/3.7.1/bazel-3.7.1-linux-x86
upload github.com/bazelbuild/bazel/releases/download/3.7.1/bazel-3.7.1-darwin-x86_64
upload github.com/bazelbuild/bazel/releases/download/3.7.1/bazel-3.7.1-windows-x86_64.exe
+upload github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-linux-x86_64
+upload github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-darwin-x86_64
+upload github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-windows-x86_64.exe
+
# Collect the github archives to mirror from grpc_deps.bzl
grep -o '"https://github.com/[^"]*"' bazel/grpc_deps.bzl | sed 's/^"https:\/\///' | sed 's/"$//' | while read -r line ; do
echo "Updating mirror for ${line}"
diff --git a/grpc/build_autogenerated.yaml b/grpc/build_autogenerated.yaml
index 31c9d54d..249ffa3c 100644
--- a/grpc/build_autogenerated.yaml
+++ b/grpc/build_autogenerated.yaml
@@ -12,119 +12,27 @@ libs:
- third_party/address_sorting/address_sorting_posix.c
- third_party/address_sorting/address_sorting_windows.c
deps: []
-- name: end2end_nosec_tests
- build: private
- language: c
- public_headers: []
- headers:
- - test/core/end2end/cq_verifier.h
- - test/core/end2end/data/ssl_test_data.h
- - test/core/end2end/end2end_tests.h
- - test/core/end2end/fixtures/http_proxy_fixture.h
- - test/core/end2end/fixtures/local_util.h
- - test/core/end2end/fixtures/proxy.h
- - test/core/end2end/tests/cancel_test_helpers.h
- - test/core/util/test_lb_policies.h
- src:
- - test/core/end2end/cq_verifier.cc
- - test/core/end2end/data/client_certs.cc
- - test/core/end2end/data/server1_cert.cc
- - test/core/end2end/data/server1_key.cc
- - test/core/end2end/data/test_root_cert.cc
- - test/core/end2end/end2end_nosec_tests.cc
- - test/core/end2end/end2end_test_utils.cc
- - test/core/end2end/fixtures/http_proxy_fixture.cc
- - test/core/end2end/fixtures/local_util.cc
- - test/core/end2end/fixtures/proxy.cc
- - test/core/end2end/tests/authority_not_supported.cc
- - test/core/end2end/tests/bad_hostname.cc
- - test/core/end2end/tests/bad_ping.cc
- - test/core/end2end/tests/binary_metadata.cc
- - test/core/end2end/tests/call_host_override.cc
- - test/core/end2end/tests/cancel_after_accept.cc
- - test/core/end2end/tests/cancel_after_client_done.cc
- - test/core/end2end/tests/cancel_after_invoke.cc
- - test/core/end2end/tests/cancel_after_round_trip.cc
- - test/core/end2end/tests/cancel_before_invoke.cc
- - test/core/end2end/tests/cancel_in_a_vacuum.cc
- - test/core/end2end/tests/cancel_with_status.cc
- - test/core/end2end/tests/channelz.cc
- - test/core/end2end/tests/client_streaming.cc
- - test/core/end2end/tests/compressed_payload.cc
- - test/core/end2end/tests/connectivity.cc
- - test/core/end2end/tests/default_host.cc
- - test/core/end2end/tests/disappearing_server.cc
- - test/core/end2end/tests/empty_batch.cc
- - test/core/end2end/tests/filter_causes_close.cc
- - test/core/end2end/tests/filter_context.cc
- - test/core/end2end/tests/filter_init_fails.cc
- - test/core/end2end/tests/filter_latency.cc
- - test/core/end2end/tests/filter_status_code.cc
- - test/core/end2end/tests/graceful_server_shutdown.cc
- - test/core/end2end/tests/high_initial_seqno.cc
- - test/core/end2end/tests/hpack_size.cc
- - test/core/end2end/tests/idempotent_request.cc
- - test/core/end2end/tests/invoke_large_request.cc
- - test/core/end2end/tests/keepalive_timeout.cc
- - test/core/end2end/tests/large_metadata.cc
- - test/core/end2end/tests/max_concurrent_streams.cc
- - test/core/end2end/tests/max_connection_age.cc
- - test/core/end2end/tests/max_connection_idle.cc
- - test/core/end2end/tests/max_message_length.cc
- - test/core/end2end/tests/negative_deadline.cc
- - test/core/end2end/tests/no_error_on_hotpath.cc
- - test/core/end2end/tests/no_logging.cc
- - test/core/end2end/tests/no_op.cc
- - test/core/end2end/tests/payload.cc
- - test/core/end2end/tests/ping.cc
- - test/core/end2end/tests/ping_pong_streaming.cc
- - test/core/end2end/tests/proxy_auth.cc
- - test/core/end2end/tests/registered_call.cc
- - test/core/end2end/tests/request_with_flags.cc
- - test/core/end2end/tests/request_with_payload.cc
- - test/core/end2end/tests/resource_quota_server.cc
- - test/core/end2end/tests/retry.cc
- - test/core/end2end/tests/retry_cancel_during_delay.cc
- - test/core/end2end/tests/retry_cancellation.cc
- - test/core/end2end/tests/retry_disabled.cc
- - test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc
- - test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc
- - test/core/end2end/tests/retry_lb_drop.cc
- - test/core/end2end/tests/retry_non_retriable_status.cc
- - test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc
- - test/core/end2end/tests/retry_recv_initial_metadata.cc
- - test/core/end2end/tests/retry_recv_message.cc
- - test/core/end2end/tests/retry_server_pushback_delay.cc
- - test/core/end2end/tests/retry_server_pushback_disabled.cc
- - test/core/end2end/tests/retry_streaming.cc
- - test/core/end2end/tests/retry_streaming_after_commit.cc
- - test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc
- - test/core/end2end/tests/retry_throttled.cc
- - test/core/end2end/tests/retry_too_many_attempts.cc
- - test/core/end2end/tests/server_finishes_request.cc
- - test/core/end2end/tests/server_streaming.cc
- - test/core/end2end/tests/shutdown_finishes_calls.cc
- - test/core/end2end/tests/shutdown_finishes_tags.cc
- - test/core/end2end/tests/simple_cacheable_request.cc
- - test/core/end2end/tests/simple_delayed_request.cc
- - test/core/end2end/tests/simple_metadata.cc
- - test/core/end2end/tests/simple_request.cc
- - test/core/end2end/tests/stream_compression_compressed_payload.cc
- - test/core/end2end/tests/stream_compression_payload.cc
- - test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
- - test/core/end2end/tests/streaming_error_response.cc
- - test/core/end2end/tests/trailing_metadata.cc
- - test/core/end2end/tests/workaround_cronet_compression.cc
- - test/core/end2end/tests/write_buffering.cc
- - test/core/end2end/tests/write_buffering_at_end.cc
- - test/core/util/test_lb_policies.cc
- deps:
- - grpc_test_util
- name: end2end_tests
build: private
language: c
- public_headers: []
+ public_headers:
+ - include/grpc/byte_buffer.h
+ - include/grpc/byte_buffer_reader.h
+ - include/grpc/compression.h
+ - include/grpc/fork.h
+ - include/grpc/grpc.h
+ - include/grpc/grpc_posix.h
+ - include/grpc/grpc_security.h
+ - include/grpc/grpc_security_constants.h
+ - include/grpc/load_reporting.h
+ - include/grpc/slice.h
+ - include/grpc/slice_buffer.h
+ - include/grpc/status.h
+ - include/grpc/support/workaround_list.h
headers:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
+ - src/core/lib/security/authorization/rbac_translator.h
+ - test/core/compression/args_utils.h
- test/core/end2end/cq_verifier.h
- test/core/end2end/data/ssl_test_data.h
- test/core/end2end/end2end_tests.h
@@ -134,6 +42,9 @@ libs:
- test/core/end2end/tests/cancel_test_helpers.h
- test/core/util/test_lb_policies.h
src:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ - src/core/lib/security/authorization/rbac_translator.cc
+ - test/core/compression/args_utils.cc
- test/core/end2end/cq_verifier.cc
- test/core/end2end/data/client_certs.cc
- test/core/end2end/data/server1_cert.cc
@@ -169,10 +80,11 @@ libs:
- test/core/end2end/tests/filter_init_fails.cc
- test/core/end2end/tests/filter_latency.cc
- test/core/end2end/tests/filter_status_code.cc
+ - test/core/end2end/tests/filtered_metadata.cc
- test/core/end2end/tests/graceful_server_shutdown.cc
+ - test/core/end2end/tests/grpc_authz.cc
- test/core/end2end/tests/high_initial_seqno.cc
- test/core/end2end/tests/hpack_size.cc
- - test/core/end2end/tests/idempotent_request.cc
- test/core/end2end/tests/invoke_large_request.cc
- test/core/end2end/tests/keepalive_timeout.cc
- test/core/end2end/tests/large_metadata.cc
@@ -193,16 +105,27 @@ libs:
- test/core/end2end/tests/request_with_payload.cc
- test/core/end2end/tests/resource_quota_server.cc
- test/core/end2end/tests/retry.cc
+ - test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc
- test/core/end2end/tests/retry_cancel_during_delay.cc
+ - test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc
- test/core/end2end/tests/retry_cancellation.cc
- test/core/end2end/tests/retry_disabled.cc
+ - test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc
- test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc
- test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc
- test/core/end2end/tests/retry_lb_drop.cc
+ - test/core/end2end/tests/retry_lb_fail.cc
- test/core/end2end/tests/retry_non_retriable_status.cc
- test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc
+ - test/core/end2end/tests/retry_per_attempt_recv_timeout.cc
+ - test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc
- test/core/end2end/tests/retry_recv_initial_metadata.cc
- test/core/end2end/tests/retry_recv_message.cc
+ - test/core/end2end/tests/retry_recv_message_replay.cc
+ - test/core/end2end/tests/retry_recv_trailing_metadata_error.cc
+ - test/core/end2end/tests/retry_send_initial_metadata_refs.cc
+ - test/core/end2end/tests/retry_send_op_fails.cc
+ - test/core/end2end/tests/retry_send_recv_batch.cc
- test/core/end2end/tests/retry_server_pushback_delay.cc
- test/core/end2end/tests/retry_server_pushback_disabled.cc
- test/core/end2end/tests/retry_streaming.cc
@@ -210,20 +133,20 @@ libs:
- test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc
- test/core/end2end/tests/retry_throttled.cc
- test/core/end2end/tests/retry_too_many_attempts.cc
+ - test/core/end2end/tests/retry_transparent_goaway.cc
+ - test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc
+ - test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc
+ - test/core/end2end/tests/retry_unref_before_finish.cc
+ - test/core/end2end/tests/retry_unref_before_recv.cc
- test/core/end2end/tests/server_finishes_request.cc
- test/core/end2end/tests/server_streaming.cc
- test/core/end2end/tests/shutdown_finishes_calls.cc
- test/core/end2end/tests/shutdown_finishes_tags.cc
- - test/core/end2end/tests/simple_cacheable_request.cc
- test/core/end2end/tests/simple_delayed_request.cc
- test/core/end2end/tests/simple_metadata.cc
- test/core/end2end/tests/simple_request.cc
- - test/core/end2end/tests/stream_compression_compressed_payload.cc
- - test/core/end2end/tests/stream_compression_payload.cc
- - test/core/end2end/tests/stream_compression_ping_pong_streaming.cc
- test/core/end2end/tests/streaming_error_response.cc
- test/core/end2end/tests/trailing_metadata.cc
- - test/core/end2end/tests/workaround_cronet_compression.cc
- test/core/end2end/tests/write_buffering.cc
- test/core/end2end/tests/write_buffering_at_end.cc
- test/core/util/test_lb_policies.cc
@@ -275,19 +198,9 @@ libs:
- include/grpc/support/thd_id.h
- include/grpc/support/time.h
headers:
- - src/core/ext/upb-generated/google/api/annotations.upb.h
- - src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
- - src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
- - src/core/ext/upb-generated/google/api/http.upb.h
- src/core/ext/upb-generated/google/protobuf/any.upb.h
- - src/core/ext/upb-generated/google/protobuf/duration.upb.h
- - src/core/ext/upb-generated/google/protobuf/empty.upb.h
- - src/core/ext/upb-generated/google/protobuf/struct.upb.h
- - src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
- - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
- src/core/ext/upb-generated/google/rpc/status.upb.h
- src/core/lib/gpr/alloc.h
- - src/core/lib/gpr/arena.h
- src/core/lib/gpr/env.h
- src/core/lib/gpr/murmur_hash.h
- src/core/lib/gpr/spinlock.h
@@ -295,14 +208,9 @@ libs:
- src/core/lib/gpr/string_windows.h
- src/core/lib/gpr/time_precise.h
- src/core/lib/gpr/tls.h
- - src/core/lib/gpr/tls_gcc.h
- - src/core/lib/gpr/tls_msvc.h
- - src/core/lib/gpr/tls_pthread.h
- - src/core/lib/gpr/tls_stdcpp.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- - src/core/lib/gprpp/arena.h
- - src/core/lib/gprpp/atomic.h
+ - src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/examine_stack.h
- src/core/lib/gprpp/fork.h
@@ -321,16 +229,7 @@ libs:
- src/core/lib/gprpp/time_util.h
- src/core/lib/profiling/timers.h
src:
- - 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/http.upb.c
- src/core/ext/upb-generated/google/protobuf/any.upb.c
- - src/core/ext/upb-generated/google/protobuf/duration.upb.c
- - src/core/ext/upb-generated/google/protobuf/empty.upb.c
- - src/core/ext/upb-generated/google/protobuf/struct.upb.c
- - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
- - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
- src/core/ext/upb-generated/google/rpc/status.upb.c
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/atm.cc
@@ -359,12 +258,10 @@ libs:
- src/core/lib/gpr/time_posix.cc
- src/core/lib/gpr/time_precise.cc
- src/core/lib/gpr/time_windows.cc
- - src/core/lib/gpr/tls_pthread.cc
- src/core/lib/gpr/tmpfile_msys.cc
- src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc
- - src/core/lib/gprpp/arena.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
@@ -380,8 +277,11 @@ libs:
- src/core/lib/profiling/stap_timers.cc
deps:
- absl/base:base
+ - absl/base:core_headers
- absl/memory:memory
+ - absl/random:random
- absl/status:status
+ - absl/strings:cord
- absl/strings:str_format
- absl/strings:strings
- absl/synchronization:synchronization
@@ -396,10 +296,12 @@ libs:
- include/grpc/byte_buffer_reader.h
- include/grpc/census.h
- include/grpc/compression.h
- - include/grpc/event_engine/channel_args.h
+ - include/grpc/event_engine/endpoint_config.h
- include/grpc/event_engine/event_engine.h
+ - include/grpc/event_engine/internal/memory_allocator_impl.h
+ - include/grpc/event_engine/memory_allocator.h
+ - include/grpc/event_engine/memory_request.h
- include/grpc/event_engine/port.h
- - include/grpc/event_engine/slice_allocator.h
- include/grpc/fork.h
- include/grpc/grpc.h
- include/grpc/grpc_posix.h
@@ -411,6 +313,8 @@ libs:
- include/grpc/status.h
- include/grpc/support/workaround_list.h
headers:
+ - src/core/ext/filters/channel_idle/channel_idle_filter.h
+ - src/core/ext/filters/channel_idle/idle_filter_state.h
- src/core/ext/filters/client_channel/backend_metric.h
- src/core/ext/filters/client_channel/backup_poller.h
- src/core/ext/filters/client_channel/client_channel.h
@@ -429,7 +333,6 @@ libs:
- src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
- - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
- src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
@@ -441,25 +344,20 @@ libs:
- src/core/ext/filters/client_channel/local_subchannel_pool.h
- src/core/ext/filters/client_channel/proxy_mapper.h
- src/core/ext/filters/client_channel/proxy_mapper_registry.h
- - src/core/ext/filters/client_channel/resolver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
+ - src/core/ext/filters/client_channel/resolver/polling_resolver.h
- src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h
- - src/core/ext/filters/client_channel/resolver_factory.h
- - src/core/ext/filters/client_channel/resolver_registry.h
- src/core/ext/filters/client_channel/resolver_result_parsing.h
- src/core/ext/filters/client_channel/retry_filter.h
- src/core/ext/filters/client_channel/retry_service_config.h
- src/core/ext/filters/client_channel/retry_throttle.h
- - src/core/ext/filters/client_channel/server_address.h
- - src/core/ext/filters/client_channel/service_config.h
- - src/core/ext/filters/client_channel/service_config_call_data.h
- - src/core/ext/filters/client_channel/service_config_parser.h
- src/core/ext/filters/client_channel/subchannel.h
- src/core/ext/filters/client_channel/subchannel_interface.h
- src/core/ext/filters/client_channel/subchannel_pool_interface.h
+ - src/core/ext/filters/client_channel/subchannel_stream_client.h
- src/core/ext/filters/deadline/deadline_filter.h
- src/core/ext/filters/fault_injection/fault_injection_filter.h
- src/core/ext/filters/fault_injection/service_config_parser.h
@@ -468,12 +366,12 @@ libs:
- src/core/ext/filters/http/message_compress/message_compress_filter.h
- src/core/ext/filters/http/message_compress/message_decompress_filter.h
- src/core/ext/filters/http/server/http_server_filter.h
- - src/core/ext/filters/max_age/max_age_filter.h
- src/core/ext/filters/message_size/message_size_filter.h
- - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
- - src/core/ext/filters/workarounds/workaround_utils.h
+ - src/core/ext/filters/rbac/rbac_filter.h
+ - src/core/ext/filters/rbac/rbac_service_config_parser.h
+ - src/core/ext/filters/server_config_selector/server_config_selector.h
+ - src/core/ext/filters/server_config_selector/server_config_selector_filter.h
- src/core/ext/transport/chttp2/alpn/alpn.h
- - src/core/ext/transport/chttp2/client/authority.h
- src/core/ext/transport/chttp2/client/chttp2_connector.h
- src/core/ext/transport/chttp2/server/chttp2_server.h
- src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -488,17 +386,27 @@ libs:
- src/core/ext/transport/chttp2/transport/frame_rst_stream.h
- src/core/ext/transport/chttp2/transport/frame_settings.h
- src/core/ext/transport/chttp2/transport/frame_window_update.h
+ - src/core/ext/transport/chttp2/transport/hpack_constants.h
- src/core/ext/transport/chttp2/transport/hpack_encoder.h
+ - src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
- src/core/ext/transport/chttp2/transport/hpack_parser.h
- - src/core/ext/transport/chttp2/transport/hpack_table.h
+ - src/core/ext/transport/chttp2/transport/hpack_parser_table.h
- src/core/ext/transport/chttp2/transport/http2_settings.h
- src/core/ext/transport/chttp2/transport/huffsyms.h
- - src/core/ext/transport/chttp2/transport/incoming_metadata.h
- src/core/ext/transport/chttp2/transport/internal.h
- src/core/ext/transport/chttp2/transport/stream_map.h
- src/core/ext/transport/chttp2/transport/varint.h
- src/core/ext/transport/inproc/inproc_transport.h
+ - src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h
- src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h
+ - src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h
- src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
- src/core/ext/upb-generated/envoy/annotations/resource.upb.h
- src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
@@ -507,51 +415,67 @@ libs:
- src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
- src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
- src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
+ - src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
+ - src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
+ - src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
- src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
+ - src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h
- src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
- src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
- src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
- src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
- src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
- src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
+ - src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h
- src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
+ - src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h
- src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
- src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
- src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
- src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
- src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
- src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
+ - src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h
+ - src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
+ - src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
- - src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
+ - src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h
- src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
- src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
- - src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
- - src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
- src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
- - src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
- - src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
- src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
+ - src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h
+ - src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h
+ - src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h
- src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
- src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
- src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
@@ -562,30 +486,68 @@ libs:
- src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
- src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
- src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
+ - src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h
- src/core/ext/upb-generated/envoy/type/v3/http.upb.h
+ - src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h
- src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
- src/core/ext/upb-generated/envoy/type/v3/range.upb.h
+ - src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h
- src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
+ - src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h
+ - src/core/ext/upb-generated/google/api/annotations.upb.h
+ - src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
+ - src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
+ - src/core/ext/upb-generated/google/api/http.upb.h
+ - src/core/ext/upb-generated/google/api/httpbody.upb.h
+ - src/core/ext/upb-generated/google/protobuf/any.upb.h
+ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.h
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.h
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.h
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+ - src/core/ext/upb-generated/google/rpc/status.upb.h
+ - src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h
- src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
- src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
- src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
- src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
- src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
+ - src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
+ - src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h
- src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
- src/core/ext/upb-generated/udpa/annotations/security.upb.h
- src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
- src/core/ext/upb-generated/udpa/annotations/status.upb.h
- src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
- - src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
- - src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
- src/core/ext/upb-generated/validate/validate.upb.h
+ - src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h
+ - src/core/ext/upb-generated/xds/annotations/v3/security.upb.h
+ - src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h
+ - src/core/ext/upb-generated/xds/annotations/v3/status.upb.h
+ - src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h
- src/core/ext/upb-generated/xds/core/v3/authority.upb.h
- src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
- src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
+ - src/core/ext/upb-generated/xds/core/v3/extension.upb.h
- src/core/ext/upb-generated/xds/core/v3/resource.upb.h
- src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
- src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
+ - src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h
+ - src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h
+ - src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h
+ - src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h
@@ -594,50 +556,67 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h
- - src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h
- - src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h
- - src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h
- - src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h
- - src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h
@@ -648,51 +627,86 @@ libs:
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h
+ - src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h
- src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h
+ - src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h
+ - src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h
- src/core/ext/upbdefs-generated/google/api/http.upbdefs.h
+ - src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h
+ - src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h
- src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h
- src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h
+ - src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h
+ - src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h
- - src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
- src/core/ext/upbdefs-generated/validate/validate.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h
+ - src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
- src/core/ext/xds/certificate_provider_factory.h
- src/core/ext/xds/certificate_provider_registry.h
- src/core/ext/xds/certificate_provider_store.h
- src/core/ext/xds/file_watcher_certificate_provider_factory.h
+ - src/core/ext/xds/upb_utils.h
- src/core/ext/xds/xds_api.h
- src/core/ext/xds/xds_bootstrap.h
- src/core/ext/xds/xds_certificate_provider.h
- src/core/ext/xds/xds_channel_args.h
+ - src/core/ext/xds/xds_channel_stack_modifier.h
- src/core/ext/xds/xds_client.h
- src/core/ext/xds/xds_client_stats.h
+ - src/core/ext/xds/xds_cluster.h
+ - src/core/ext/xds/xds_cluster_specifier_plugin.h
+ - src/core/ext/xds/xds_common_types.h
+ - src/core/ext/xds/xds_endpoint.h
- src/core/ext/xds/xds_http_fault_filter.h
- src/core/ext/xds/xds_http_filters.h
+ - src/core/ext/xds/xds_http_rbac_filter.h
+ - src/core/ext/xds/xds_listener.h
+ - src/core/ext/xds/xds_resource_type.h
+ - src/core/ext/xds/xds_resource_type_impl.h
+ - src/core/ext/xds/xds_route_config.h
+ - src/core/ext/xds/xds_routing.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
+ - src/core/lib/channel/call_finalization.h
+ - src/core/lib/channel/call_tracer.h
- src/core/lib/channel/channel_args.h
+ - src/core/lib/channel/channel_args_preconditioning.h
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
+ - src/core/lib/channel/channel_stack_builder_impl.h
- src/core/lib/channel/channel_trace.h
- src/core/lib/channel/channelz.h
- src/core/lib/channel/channelz_registry.h
@@ -701,24 +715,34 @@ libs:
- src/core/lib/channel/handshaker.h
- src/core/lib/channel/handshaker_factory.h
- src/core/lib/channel/handshaker_registry.h
+ - src/core/lib/channel/promise_based_filter.h
- src/core/lib/channel/status_util.h
- - src/core/lib/compression/algorithm_metadata.h
- - src/core/lib/compression/compression_args.h
- src/core/lib/compression/compression_internal.h
- src/core/lib/compression/message_compress.h
- - src/core/lib/compression/stream_compression.h
- - src/core/lib/compression/stream_compression_gzip.h
- - src/core/lib/compression/stream_compression_identity.h
+ - src/core/lib/config/core_configuration.h
- src/core/lib/debug/stats.h
- src/core/lib/debug/stats_data.h
- src/core/lib/debug/trace.h
- - src/core/lib/gprpp/atomic.h
+ - src/core/lib/event_engine/channel_args_endpoint_config.h
+ - src/core/lib/event_engine/event_engine_factory.h
+ - src/core/lib/event_engine/sockaddr.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/capture.h
+ - src/core/lib/gprpp/chunked_vector.h
+ - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/match.h
- src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/overload.h
- src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/single_set_ptr.h
+ - src/core/lib/gprpp/table.h
+ - src/core/lib/gprpp/time.h
- src/core/lib/http/format_request.h
- src/core/lib/http/httpcli.h
+ - src/core/lib/http/httpcli_ssl_credentials.h
- src/core/lib/http/parser.h
- src/core/lib/iomgr/block_annotate.h
- src/core/lib/iomgr/buffer_list.h
@@ -735,9 +759,14 @@ libs:
- src/core/lib/iomgr/error_internal.h
- src/core/lib/iomgr/ev_apple.h
- src/core/lib/iomgr/ev_epoll1_linux.h
- - src/core/lib/iomgr/ev_epollex_linux.h
- src/core/lib/iomgr/ev_poll_posix.h
- src/core/lib/iomgr/ev_posix.h
+ - src/core/lib/iomgr/event_engine/closure.h
+ - src/core/lib/iomgr/event_engine/endpoint.h
+ - src/core/lib/iomgr/event_engine/pollset.h
+ - src/core/lib/iomgr/event_engine/promise.h
+ - src/core/lib/iomgr/event_engine/resolved_address_internal.h
+ - src/core/lib/iomgr/event_engine/resolver.h
- src/core/lib/iomgr/exec_ctx.h
- src/core/lib/iomgr/executor.h
- src/core/lib/iomgr/executor/mpmcqueue.h
@@ -747,27 +776,23 @@ libs:
- src/core/lib/iomgr/internal_errqueue.h
- src/core/lib/iomgr/iocp_windows.h
- src/core/lib/iomgr/iomgr.h
- - src/core/lib/iomgr/iomgr_custom.h
- src/core/lib/iomgr/iomgr_internal.h
- - src/core/lib/iomgr/is_epollexclusive_available.h
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
- src/core/lib/iomgr/nameser.h
- src/core/lib/iomgr/polling_entity.h
- src/core/lib/iomgr/pollset.h
- - src/core/lib/iomgr/pollset_custom.h
- src/core/lib/iomgr/pollset_set.h
- - src/core/lib/iomgr/pollset_set_custom.h
- src/core/lib/iomgr/pollset_set_windows.h
- - src/core/lib/iomgr/pollset_uv.h
- src/core/lib/iomgr/pollset_windows.h
- src/core/lib/iomgr/port.h
- src/core/lib/iomgr/python_util.h
- src/core/lib/iomgr/resolve_address.h
- - src/core/lib/iomgr/resolve_address_custom.h
- - src/core/lib/iomgr/resource_quota.h
+ - src/core/lib/iomgr/resolve_address_impl.h
+ - src/core/lib/iomgr/resolve_address_posix.h
+ - src/core/lib/iomgr/resolve_address_windows.h
+ - src/core/lib/iomgr/resolved_address.h
- src/core/lib/iomgr/sockaddr.h
- - src/core/lib/iomgr/sockaddr_custom.h
- src/core/lib/iomgr/sockaddr_posix.h
- src/core/lib/iomgr/sockaddr_windows.h
- src/core/lib/iomgr/socket_factory_posix.h
@@ -775,21 +800,17 @@ libs:
- src/core/lib/iomgr/socket_utils.h
- src/core/lib/iomgr/socket_utils_posix.h
- src/core/lib/iomgr/socket_windows.h
- - src/core/lib/iomgr/sys_epoll_wrapper.h
- src/core/lib/iomgr/tcp_client.h
- src/core/lib/iomgr/tcp_client_posix.h
- - src/core/lib/iomgr/tcp_custom.h
- src/core/lib/iomgr/tcp_posix.h
- src/core/lib/iomgr/tcp_server.h
- src/core/lib/iomgr/tcp_server_utils_posix.h
- src/core/lib/iomgr/tcp_windows.h
- src/core/lib/iomgr/time_averaged_stats.h
- src/core/lib/iomgr/timer.h
- - src/core/lib/iomgr/timer_custom.h
- src/core/lib/iomgr/timer_generic.h
- src/core/lib/iomgr/timer_heap.h
- src/core/lib/iomgr/timer_manager.h
- - src/core/lib/iomgr/udp_server.h
- src/core/lib/iomgr/unix_sockets_posix.h
- src/core/lib/iomgr/wakeup_fd_pipe.h
- src/core/lib/iomgr/wakeup_fd_posix.h
@@ -797,10 +818,49 @@ libs:
- src/core/lib/json/json.h
- src/core/lib/json/json_util.h
- src/core/lib/matchers/matchers.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/arena_promise.h
+ - src/core/lib/promise/call_push_pull.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/intra_activity_waiter.h
+ - src/core/lib/promise/latch.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/promise/sleep.h
+ - src/core/lib/promise/try_seq.h
+ - src/core/lib/resolver/resolver.h
+ - src/core/lib/resolver/resolver_factory.h
+ - src/core/lib/resolver/resolver_registry.h
+ - src/core/lib/resolver/server_address.h
+ - src/core/lib/resource_quota/api.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/security/authorization/authorization_engine.h
+ - src/core/lib/security/authorization/authorization_policy_provider.h
+ - src/core/lib/security/authorization/evaluate_args.h
+ - src/core/lib/security/authorization/grpc_authorization_engine.h
+ - src/core/lib/security/authorization/grpc_server_authz_filter.h
+ - src/core/lib/security/authorization/matchers.h
+ - src/core/lib/security/authorization/rbac_policy.h
- src/core/lib/security/context/security_context.h
- src/core/lib/security/credentials/alts/alts_credentials.h
- src/core/lib/security/credentials/alts/check_gcp_environment.h
- src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h
+ - src/core/lib/security/credentials/call_creds_util.h
+ - src/core/lib/security/credentials/channel_creds_registry.h
- src/core/lib/security/credentials/composite/composite_credentials.h
- src/core/lib/security/credentials/credentials.h
- src/core/lib/security/credentials/external/aws_external_account_credentials.h
@@ -811,6 +871,7 @@ libs:
- src/core/lib/security/credentials/fake/fake_credentials.h
- src/core/lib/security/credentials/google_default/google_default_credentials.h
- src/core/lib/security/credentials/iam/iam_credentials.h
+ - src/core/lib/security/credentials/insecure/insecure_credentials.h
- src/core/lib/security/credentials/jwt/json_token.h
- src/core/lib/security/credentials/jwt/jwt_credentials.h
- src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -820,6 +881,7 @@ libs:
- src/core/lib/security/credentials/ssl/ssl_credentials.h
- src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
- src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
+ - src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h
- src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
- src/core/lib/security/credentials/tls/tls_credentials.h
- src/core/lib/security/credentials/tls/tls_utils.h
@@ -840,12 +902,20 @@ libs:
- src/core/lib/security/transport/security_handshaker.h
- src/core/lib/security/transport/tsi_error.h
- src/core/lib/security/util/json_util.h
+ - src/core/lib/service_config/service_config.h
+ - src/core/lib/service_config/service_config_call_data.h
+ - src/core/lib/service_config/service_config_impl.h
+ - src/core/lib/service_config/service_config_parser.h
- src/core/lib/slice/b64.h
- src/core/lib/slice/percent_encoding.h
+ - src/core/lib/slice/slice.h
- src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_split.h
- src/core/lib/slice/slice_string_helpers.h
- - src/core/lib/slice/slice_utils.h
- src/core/lib/surface/api_trace.h
+ - src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/channel.h
@@ -858,18 +928,15 @@ libs:
- src/core/lib/surface/lame_client.h
- src/core/lib/surface/server.h
- src/core/lib/surface/validate_metadata.h
- - src/core/lib/transport/authority_override.h
- src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/byte_stream.h
- src/core/lib/transport/connectivity_state.h
- src/core/lib/transport/error_utils.h
- src/core/lib/transport/http2_errors.h
- - src/core/lib/transport/metadata.h
- src/core/lib/transport/metadata_batch.h
+ - src/core/lib/transport/parsed_metadata.h
- src/core/lib/transport/pid_controller.h
- - src/core/lib/transport/static_metadata.h
- src/core/lib/transport/status_conversion.h
- - src/core/lib/transport/status_metadata.h
- src/core/lib/transport/timeout_encoding.h
- src/core/lib/transport/transport.h
- src/core/lib/transport/transport_impl.h
@@ -894,6 +961,7 @@ libs:
- src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h
- src/core/tsi/fake_transport_security.h
- src/core/tsi/local_transport_security.h
+ - src/core/tsi/ssl/key_logging/ssl_key_logging.h
- src/core/tsi/ssl/session_cache/ssl_session.h
- src/core/tsi/ssl/session_cache/ssl_session_cache.h
- src/core/tsi/ssl_transport_security.h
@@ -904,6 +972,8 @@ libs:
- third_party/xxhash/xxhash.h
src:
- src/core/ext/filters/census/grpc_context.cc
+ - src/core/ext/filters/channel_idle/channel_idle_filter.cc
+ - src/core/ext/filters/channel_idle/idle_filter_state.cc
- src/core/ext/filters/client_channel/backend_metric.cc
- src/core/ext/filters/client_channel/backup_poller.cc
- src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -923,12 +993,12 @@ libs:
- 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_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/ring_hash/ring_hash.cc
+ - src/core/ext/filters/client_channel/lb_policy/rls/rls.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/xds/cds.cc
@@ -938,33 +1008,30 @@ libs:
- 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
- - src/core/ext/filters/client_channel/resolver.cc
+ - src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
- - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
- src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
- src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
+ - src/core/ext/filters/client_channel/resolver/polling_resolver.cc
- src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
- src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
- - src/core/ext/filters/client_channel/resolver_registry.cc
- src/core/ext/filters/client_channel/resolver_result_parsing.cc
- src/core/ext/filters/client_channel/retry_filter.cc
- src/core/ext/filters/client_channel/retry_service_config.cc
- 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/subchannel.cc
- src/core/ext/filters/client_channel/subchannel_pool_interface.cc
- - src/core/ext/filters/client_idle/client_idle_filter.cc
+ - src/core/ext/filters/client_channel/subchannel_stream_client.cc
- src/core/ext/filters/deadline/deadline_filter.cc
- src/core/ext/filters/fault_injection/fault_injection_filter.cc
- src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -974,23 +1041,16 @@ libs:
- 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/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
- - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- - src/core/ext/filters/workarounds/workaround_utils.cc
+ - src/core/ext/filters/rbac/rbac_filter.cc
+ - src/core/ext/filters/rbac/rbac_service_config_parser.cc
+ - src/core/ext/filters/server_config_selector/server_config_selector.cc
+ - src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
- src/core/ext/transport/chttp2/alpn/alpn.cc
- - src/core/ext/transport/chttp2/client/authority.cc
- src/core/ext/transport/chttp2/client/chttp2_connector.cc
- - src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- - src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
- - src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
- src/core/ext/transport/chttp2/server/chttp2_server.cc
- - src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
- - src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
- - src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
- src/core/ext/transport/chttp2/transport/bin_decoder.cc
- src/core/ext/transport/chttp2/transport/bin_encoder.cc
- - src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
- src/core/ext/transport/chttp2/transport/chttp2_transport.cc
- src/core/ext/transport/chttp2/transport/context_list.cc
- src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -1001,11 +1061,11 @@ libs:
- src/core/ext/transport/chttp2/transport/frame_settings.cc
- src/core/ext/transport/chttp2/transport/frame_window_update.cc
- src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+ - src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
- src/core/ext/transport/chttp2/transport/hpack_parser.cc
- - src/core/ext/transport/chttp2/transport/hpack_table.cc
+ - src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
- src/core/ext/transport/chttp2/transport/http2_settings.cc
- src/core/ext/transport/chttp2/transport/huffsyms.cc
- - src/core/ext/transport/chttp2/transport/incoming_metadata.cc
- src/core/ext/transport/chttp2/transport/parsing.cc
- src/core/ext/transport/chttp2/transport/stream_lists.cc
- src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -1013,7 +1073,16 @@ libs:
- 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/admin/v3/certs.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
- src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c
+ - src/core/ext/upb-generated/envoy/admin/v3/tap.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
@@ -1022,51 +1091,67 @@ libs:
- 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/common/matcher/v3/matcher.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_method_list.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/resolver.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/core/v3/udp_socket_config.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/quic_config.upb.c
- src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
+ - src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c
- src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
- src/core/ext/upb-generated/envoy/config/overload/v3/overload.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/tap/v3/common.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c
+ - src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
+ - src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.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/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.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/service/status/v3/csds.upb.c
+ - src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c
+ - src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
+ - src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c
- src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
- src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
- src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -1077,30 +1162,68 @@ libs:
- 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/hash_policy.upb.c
- src/core/ext/upb-generated/envoy/type/v3/http.upb.c
+ - src/core/ext/upb-generated/envoy/type/v3/http_status.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/ratelimit_unit.upb.c
- src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
+ - src/core/ext/upb-generated/envoy/type/v3/token_bucket.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/http.upb.c
+ - src/core/ext/upb-generated/google/api/httpbody.upb.c
+ - src/core/ext/upb-generated/google/protobuf/any.upb.c
+ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+ - src/core/ext/upb-generated/google/rpc/status.upb.c
+ - src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c
- src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
- src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
- 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/src/proto/grpc/lookup/v1/rls.upb.c
+ - src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.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/data/orca/v1/orca_load_report.upb.c
- - src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
- src/core/ext/upb-generated/validate/validate.upb.c
+ - src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c
+ - src/core/ext/upb-generated/xds/annotations/v3/security.upb.c
+ - src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c
+ - src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
+ - src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c
- src/core/ext/upb-generated/xds/core/v3/authority.upb.c
- src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
- src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
+ - src/core/ext/upb-generated/xds/core/v3/extension.upb.c
- src/core/ext/upb-generated/xds/core/v3/resource.upb.c
- src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
- src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
+ - src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c
+ - src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c
+ - src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c
+ - src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
@@ -1109,50 +1232,67 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
- - src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
- - src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
- - src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
- - src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
- - src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
@@ -1163,69 +1303,102 @@ libs:
- src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
+ - src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c
- src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
+ - src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c
+ - src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c
- src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
+ - src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
+ - src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
- src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
- src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
+ - src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c
+ - src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
- - src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
- src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c
+ - src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
- src/core/ext/xds/certificate_provider_registry.cc
- src/core/ext/xds/certificate_provider_store.cc
- src/core/ext/xds/file_watcher_certificate_provider_factory.cc
- src/core/ext/xds/xds_api.cc
- src/core/ext/xds/xds_bootstrap.cc
- src/core/ext/xds/xds_certificate_provider.cc
+ - src/core/ext/xds/xds_channel_stack_modifier.cc
- src/core/ext/xds/xds_client.cc
- src/core/ext/xds/xds_client_stats.cc
+ - src/core/ext/xds/xds_cluster.cc
+ - src/core/ext/xds/xds_cluster_specifier_plugin.cc
+ - src/core/ext/xds/xds_common_types.cc
+ - src/core/ext/xds/xds_endpoint.cc
- src/core/ext/xds/xds_http_fault_filter.cc
- src/core/ext/xds/xds_http_filters.cc
+ - src/core/ext/xds/xds_http_rbac_filter.cc
+ - src/core/ext/xds/xds_listener.cc
+ - src/core/ext/xds/xds_resource_type.cc
+ - src/core/ext/xds/xds_route_config.cc
+ - src/core/ext/xds/xds_routing.cc
- src/core/ext/xds/xds_server_config_fetcher.cc
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
- - src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
- src/core/lib/channel/channel_args.cc
+ - src/core/lib/channel/channel_args_preconditioning.cc
- src/core/lib/channel/channel_stack.cc
- src/core/lib/channel/channel_stack_builder.cc
+ - src/core/lib/channel/channel_stack_builder_impl.cc
- src/core/lib/channel/channel_trace.cc
- src/core/lib/channel/channelz.cc
- src/core/lib/channel/channelz_registry.cc
- src/core/lib/channel/connected_channel.cc
- src/core/lib/channel/handshaker.cc
- src/core/lib/channel/handshaker_registry.cc
+ - src/core/lib/channel/promise_based_filter.cc
- src/core/lib/channel/status_util.cc
- src/core/lib/compression/compression.cc
- - src/core/lib/compression/compression_args.cc
- src/core/lib/compression/compression_internal.cc
- src/core/lib/compression/message_compress.cc
- - src/core/lib/compression/stream_compression.cc
- - src/core/lib/compression/stream_compression_gzip.cc
- - src/core/lib/compression/stream_compression_identity.cc
+ - src/core/lib/config/core_configuration.cc
- src/core/lib/debug/stats.cc
- src/core/lib/debug/stats_data.cc
- src/core/lib/debug/trace.cc
- - src/core/lib/event_engine/slice_allocator.cc
+ - src/core/lib/event_engine/channel_args_endpoint_config.cc
+ - src/core/lib/event_engine/default_event_engine_factory.cc
+ - src/core/lib/event_engine/event_engine.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/event_engine/resolved_address.cc
- src/core/lib/event_engine/sockaddr.cc
+ - src/core/lib/gprpp/time.cc
- src/core/lib/http/format_request.cc
- src/core/lib/http/httpcli.cc
- src/core/lib/http/httpcli_security_connector.cc
@@ -1237,17 +1410,24 @@ libs:
- 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_event_engine.cc
- src/core/lib/iomgr/endpoint_pair_posix.cc
- - src/core/lib/iomgr/endpoint_pair_uv.cc
- 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_epoll1_linux.cc
- - src/core/lib/iomgr/ev_epollex_linux.cc
- src/core/lib/iomgr/ev_poll_posix.cc
- src/core/lib/iomgr/ev_posix.cc
- src/core/lib/iomgr/ev_windows.cc
+ - src/core/lib/iomgr/event_engine/closure.cc
+ - src/core/lib/iomgr/event_engine/endpoint.cc
+ - src/core/lib/iomgr/event_engine/iomgr.cc
+ - src/core/lib/iomgr/event_engine/pollset.cc
+ - src/core/lib/iomgr/event_engine/resolved_address_internal.cc
+ - src/core/lib/iomgr/event_engine/resolver.cc
+ - src/core/lib/iomgr/event_engine/tcp.cc
+ - src/core/lib/iomgr/event_engine/timer.cc
- src/core/lib/iomgr/exec_ctx.cc
- src/core/lib/iomgr/executor.cc
- src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -1262,60 +1442,45 @@ libs:
- src/core/lib/iomgr/internal_errqueue.cc
- src/core/lib/iomgr/iocp_windows.cc
- src/core/lib/iomgr/iomgr.cc
- - src/core/lib/iomgr/iomgr_custom.cc
- src/core/lib/iomgr/iomgr_internal.cc
- src/core/lib/iomgr/iomgr_posix.cc
- src/core/lib/iomgr/iomgr_posix_cfstream.cc
- - src/core/lib/iomgr/iomgr_uv.cc
- src/core/lib/iomgr/iomgr_windows.cc
- - 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/polling_entity.cc
- src/core/lib/iomgr/pollset.cc
- - src/core/lib/iomgr/pollset_custom.cc
- src/core/lib/iomgr/pollset_set.cc
- - src/core/lib/iomgr/pollset_set_custom.cc
- src/core/lib/iomgr/pollset_set_windows.cc
- - src/core/lib/iomgr/pollset_uv.cc
- src/core/lib/iomgr/pollset_windows.cc
- src/core/lib/iomgr/resolve_address.cc
- - src/core/lib/iomgr/resolve_address_custom.cc
- src/core/lib/iomgr/resolve_address_posix.cc
- src/core/lib/iomgr/resolve_address_windows.cc
- - src/core/lib/iomgr/resource_quota.cc
+ - src/core/lib/iomgr/sockaddr_utils_posix.cc
- src/core/lib/iomgr/socket_factory_posix.cc
- src/core/lib/iomgr/socket_mutator.cc
- src/core/lib/iomgr/socket_utils_common_posix.cc
- src/core/lib/iomgr/socket_utils_linux.cc
- src/core/lib/iomgr/socket_utils_posix.cc
- - src/core/lib/iomgr/socket_utils_uv.cc
- src/core/lib/iomgr/socket_utils_windows.cc
- src/core/lib/iomgr/socket_windows.cc
- src/core/lib/iomgr/tcp_client.cc
- src/core/lib/iomgr/tcp_client_cfstream.cc
- - src/core/lib/iomgr/tcp_client_custom.cc
- src/core/lib/iomgr/tcp_client_posix.cc
- src/core/lib/iomgr/tcp_client_windows.cc
- - src/core/lib/iomgr/tcp_custom.cc
- src/core/lib/iomgr/tcp_posix.cc
- src/core/lib/iomgr/tcp_server.cc
- - src/core/lib/iomgr/tcp_server_custom.cc
- src/core/lib/iomgr/tcp_server_posix.cc
- src/core/lib/iomgr/tcp_server_utils_posix_common.cc
- src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
- src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
- src/core/lib/iomgr/tcp_server_windows.cc
- - src/core/lib/iomgr/tcp_uv.cc
- src/core/lib/iomgr/tcp_windows.cc
- src/core/lib/iomgr/time_averaged_stats.cc
- src/core/lib/iomgr/timer.cc
- - src/core/lib/iomgr/timer_custom.cc
- src/core/lib/iomgr/timer_generic.cc
- src/core/lib/iomgr/timer_heap.cc
- src/core/lib/iomgr/timer_manager.cc
- - src/core/lib/iomgr/timer_uv.cc
- - src/core/lib/iomgr/udp_server.cc
- src/core/lib/iomgr/unix_sockets_posix.cc
- src/core/lib/iomgr/unix_sockets_posix_noop.cc
- src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -1327,6 +1492,23 @@ libs:
- src/core/lib/json/json_util.cc
- src/core/lib/json/json_writer.cc
- src/core/lib/matchers/matchers.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/promise/sleep.cc
+ - src/core/lib/resolver/resolver.cc
+ - src/core/lib/resolver/resolver_registry.cc
+ - src/core/lib/resolver/server_address.cc
+ - src/core/lib/resource_quota/api.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
+ - src/core/lib/security/authorization/evaluate_args.cc
+ - src/core/lib/security/authorization/grpc_authorization_engine.cc
+ - src/core/lib/security/authorization/grpc_server_authz_filter.cc
+ - src/core/lib/security/authorization/matchers.cc
+ - src/core/lib/security/authorization/rbac_policy.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
@@ -1336,9 +1518,10 @@ libs:
- src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc
- src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc
- src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc
+ - src/core/lib/security/credentials/call_creds_util.cc
+ - src/core/lib/security/credentials/channel_creds_registry_init.cc
- src/core/lib/security/credentials/composite/composite_credentials.cc
- src/core/lib/security/credentials/credentials.cc
- - src/core/lib/security/credentials/credentials_metadata.cc
- src/core/lib/security/credentials/external/aws_external_account_credentials.cc
- src/core/lib/security/credentials/external/aws_request_signer.cc
- src/core/lib/security/credentials/external/external_account_credentials.cc
@@ -1358,6 +1541,7 @@ libs:
- 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_provider.cc
+ - src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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/tls/tls_utils.cc
@@ -1379,13 +1563,18 @@ libs:
- src/core/lib/security/transport/server_auth_filter.cc
- src/core/lib/security/transport/tsi_error.cc
- src/core/lib/security/util/json_util.cc
+ - src/core/lib/service_config/service_config_impl.cc
+ - src/core/lib/service_config/service_config_parser.cc
- src/core/lib/slice/b64.cc
- src/core/lib/slice/percent_encoding.cc
- src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_api.cc
- src/core/lib/slice/slice_buffer.cc
- - src/core/lib/slice/slice_intern.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_split.cc
- src/core/lib/slice/slice_string_helpers.cc
- src/core/lib/surface/api_trace.cc
+ - src/core/lib/surface/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
@@ -1399,28 +1588,24 @@ libs:
- src/core/lib/surface/completion_queue_factory.cc
- src/core/lib/surface/event_string.cc
- src/core/lib/surface/init.cc
- - src/core/lib/surface/init_secure.cc
- src/core/lib/surface/lame_client.cc
- src/core/lib/surface/metadata_array.cc
- 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/bdp_estimator.cc
- src/core/lib/transport/byte_stream.cc
- src/core/lib/transport/connectivity_state.cc
- src/core/lib/transport/error_utils.cc
- - src/core/lib/transport/metadata.cc
- - src/core/lib/transport/metadata_batch.cc
+ - src/core/lib/transport/parsed_metadata.cc
- src/core/lib/transport/pid_controller.cc
- - src/core/lib/transport/static_metadata.cc
- src/core/lib/transport/status_conversion.cc
- - src/core/lib/transport/status_metadata.cc
- src/core/lib/transport/timeout_encoding.cc
- src/core/lib/transport/transport.cc
- src/core/lib/transport/transport_op_string.cc
- src/core/lib/uri/uri_parser.cc
- src/core/plugin_registry/grpc_plugin_registry.cc
+ - src/core/plugin_registry/grpc_plugin_registry_extra.cc
- src/core/tsi/alts/crypt/aes_gcm.cc
- src/core/tsi/alts/crypt/gsec.cc
- src/core/tsi/alts/frame_protector/alts_counter.cc
@@ -1442,6 +1627,7 @@ libs:
- src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
- src/core/tsi/fake_transport_security.cc
- src/core/tsi/local_transport_security.cc
+ - src/core/tsi/ssl/key_logging/ssl_key_logging.cc
- src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc
- src/core/tsi/ssl/session_cache/ssl_session_cache.cc
- src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
@@ -1452,7 +1638,10 @@ libs:
- absl/container:flat_hash_map
- absl/container:inlined_vector
- absl/functional:bind_front
+ - absl/hash:hash
- absl/status:statusor
+ - absl/types:variant
+ - absl/utility:utility
- gpr
- libssl
- address_sorting
@@ -1472,12 +1661,13 @@ libs:
language: c
public_headers: []
headers:
+ - test/core/event_engine/test_init.h
+ - test/core/util/build.h
- test/core/util/cmdline.h
- test/core/util/evaluate_args_test_util.h
- test/core/util/fuzzer_util.h
- test/core/util/grpc_profiler.h
- test/core/util/histogram.h
- - test/core/util/memory_counters.h
- test/core/util/mock_authorization_endpoint.h
- test/core/util/mock_endpoint.h
- test/core/util/parse_hexstring.h
@@ -1493,13 +1683,13 @@ libs:
- test/core/util/test_tcp_server.h
- test/core/util/tls_utils.h
- test/core/util/tracer_util.h
- - test/core/util/trickle_endpoint.h
src:
+ - test/core/event_engine/test_init.cc
+ - test/core/util/build.cc
- test/core/util/cmdline.cc
- test/core/util/fuzzer_util.cc
- test/core/util/grpc_profiler.cc
- test/core/util/histogram.cc
- - test/core/util/memory_counters.cc
- test/core/util/mock_endpoint.cc
- test/core/util/parse_hexstring.cc
- test/core/util/passthru_endpoint.cc
@@ -1516,7 +1706,6 @@ libs:
- test/core/util/test_tcp_server.cc
- test/core/util/tls_utils.cc
- test/core/util/tracer_util.cc
- - test/core/util/trickle_endpoint.cc
deps:
- absl/debugging:failure_signal_handler
- absl/debugging:stacktrace
@@ -1527,12 +1716,13 @@ libs:
language: c
public_headers: []
headers:
+ - test/core/event_engine/test_init.h
+ - test/core/util/build.h
- test/core/util/cmdline.h
- test/core/util/evaluate_args_test_util.h
- test/core/util/fuzzer_util.h
- test/core/util/grpc_profiler.h
- test/core/util/histogram.h
- - test/core/util/memory_counters.h
- test/core/util/mock_authorization_endpoint.h
- test/core/util/mock_endpoint.h
- test/core/util/parse_hexstring.h
@@ -1547,13 +1737,13 @@ libs:
- test/core/util/test_config.h
- test/core/util/test_tcp_server.h
- test/core/util/tracer_util.h
- - test/core/util/trickle_endpoint.h
src:
+ - test/core/event_engine/test_init.cc
+ - test/core/util/build.cc
- test/core/util/cmdline.cc
- test/core/util/fuzzer_util.cc
- test/core/util/grpc_profiler.cc
- test/core/util/histogram.cc
- - test/core/util/memory_counters.cc
- test/core/util/mock_endpoint.cc
- test/core/util/parse_hexstring.cc
- test/core/util/passthru_endpoint.cc
@@ -1569,7 +1759,6 @@ libs:
- test/core/util/test_config.cc
- test/core/util/test_tcp_server.cc
- test/core/util/tracer_util.cc
- - test/core/util/trickle_endpoint.cc
deps:
- absl/debugging:failure_signal_handler
- absl/debugging:stacktrace
@@ -1583,13 +1772,16 @@ libs:
- include/grpc/byte_buffer_reader.h
- include/grpc/census.h
- include/grpc/compression.h
- - include/grpc/event_engine/channel_args.h
+ - include/grpc/event_engine/endpoint_config.h
- include/grpc/event_engine/event_engine.h
+ - include/grpc/event_engine/internal/memory_allocator_impl.h
+ - include/grpc/event_engine/memory_allocator.h
+ - include/grpc/event_engine/memory_request.h
- include/grpc/event_engine/port.h
- - include/grpc/event_engine/slice_allocator.h
- include/grpc/fork.h
- include/grpc/grpc.h
- include/grpc/grpc_posix.h
+ - include/grpc/grpc_security.h
- include/grpc/grpc_security_constants.h
- include/grpc/load_reporting.h
- include/grpc/slice.h
@@ -1597,6 +1789,8 @@ libs:
- include/grpc/status.h
- include/grpc/support/workaround_list.h
headers:
+ - src/core/ext/filters/channel_idle/channel_idle_filter.h
+ - src/core/ext/filters/channel_idle/idle_filter_state.h
- src/core/ext/filters/client_channel/backend_metric.h
- src/core/ext/filters/client_channel/backup_poller.h
- src/core/ext/filters/client_channel/client_channel.h
@@ -1615,33 +1809,28 @@ libs:
- src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
- - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
- src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+ - src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
- src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
- src/core/ext/filters/client_channel/lb_policy_factory.h
- src/core/ext/filters/client_channel/lb_policy_registry.h
- src/core/ext/filters/client_channel/local_subchannel_pool.h
- src/core/ext/filters/client_channel/proxy_mapper.h
- src/core/ext/filters/client_channel/proxy_mapper_registry.h
- - src/core/ext/filters/client_channel/resolver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
- - src/core/ext/filters/client_channel/resolver_factory.h
- - src/core/ext/filters/client_channel/resolver_registry.h
+ - src/core/ext/filters/client_channel/resolver/polling_resolver.h
- src/core/ext/filters/client_channel/resolver_result_parsing.h
- src/core/ext/filters/client_channel/retry_filter.h
- src/core/ext/filters/client_channel/retry_service_config.h
- src/core/ext/filters/client_channel/retry_throttle.h
- - src/core/ext/filters/client_channel/server_address.h
- - src/core/ext/filters/client_channel/service_config.h
- - src/core/ext/filters/client_channel/service_config_call_data.h
- - src/core/ext/filters/client_channel/service_config_parser.h
- src/core/ext/filters/client_channel/subchannel.h
- src/core/ext/filters/client_channel/subchannel_interface.h
- src/core/ext/filters/client_channel/subchannel_pool_interface.h
+ - src/core/ext/filters/client_channel/subchannel_stream_client.h
- src/core/ext/filters/deadline/deadline_filter.h
- src/core/ext/filters/fault_injection/fault_injection_filter.h
- src/core/ext/filters/fault_injection/service_config_parser.h
@@ -1650,12 +1839,8 @@ libs:
- src/core/ext/filters/http/message_compress/message_compress_filter.h
- src/core/ext/filters/http/message_compress/message_decompress_filter.h
- src/core/ext/filters/http/server/http_server_filter.h
- - src/core/ext/filters/max_age/max_age_filter.h
- src/core/ext/filters/message_size/message_size_filter.h
- - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
- - src/core/ext/filters/workarounds/workaround_utils.h
- src/core/ext/transport/chttp2/alpn/alpn.h
- - src/core/ext/transport/chttp2/client/authority.h
- src/core/ext/transport/chttp2/client/chttp2_connector.h
- src/core/ext/transport/chttp2/server/chttp2_server.h
- src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -1670,27 +1855,43 @@ libs:
- src/core/ext/transport/chttp2/transport/frame_rst_stream.h
- src/core/ext/transport/chttp2/transport/frame_settings.h
- src/core/ext/transport/chttp2/transport/frame_window_update.h
+ - src/core/ext/transport/chttp2/transport/hpack_constants.h
- src/core/ext/transport/chttp2/transport/hpack_encoder.h
+ - src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
- src/core/ext/transport/chttp2/transport/hpack_parser.h
- - src/core/ext/transport/chttp2/transport/hpack_table.h
+ - src/core/ext/transport/chttp2/transport/hpack_parser_table.h
- src/core/ext/transport/chttp2/transport/http2_settings.h
- src/core/ext/transport/chttp2/transport/huffsyms.h
- - src/core/ext/transport/chttp2/transport/incoming_metadata.h
- src/core/ext/transport/chttp2/transport/internal.h
- src/core/ext/transport/chttp2/transport/stream_map.h
- src/core/ext/transport/chttp2/transport/varint.h
- src/core/ext/transport/inproc/inproc_transport.h
+ - src/core/ext/upb-generated/google/api/annotations.upb.h
+ - src/core/ext/upb-generated/google/api/http.upb.h
+ - src/core/ext/upb-generated/google/protobuf/any.upb.h
+ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.h
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.h
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.h
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+ - src/core/ext/upb-generated/google/rpc/status.upb.h
- src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
- src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
- - src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
+ - src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
- src/core/ext/upb-generated/validate/validate.upb.h
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
+ - src/core/lib/channel/call_finalization.h
+ - src/core/lib/channel/call_tracer.h
- src/core/lib/channel/channel_args.h
+ - src/core/lib/channel/channel_args_preconditioning.h
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
+ - src/core/lib/channel/channel_stack_builder_impl.h
- src/core/lib/channel/channel_trace.h
- src/core/lib/channel/channelz.h
- src/core/lib/channel/channelz_registry.h
@@ -1699,22 +1900,31 @@ libs:
- src/core/lib/channel/handshaker.h
- src/core/lib/channel/handshaker_factory.h
- src/core/lib/channel/handshaker_registry.h
+ - src/core/lib/channel/promise_based_filter.h
- src/core/lib/channel/status_util.h
- - src/core/lib/compression/algorithm_metadata.h
- - src/core/lib/compression/compression_args.h
- src/core/lib/compression/compression_internal.h
- src/core/lib/compression/message_compress.h
- - src/core/lib/compression/stream_compression.h
- - src/core/lib/compression/stream_compression_gzip.h
- - src/core/lib/compression/stream_compression_identity.h
+ - src/core/lib/config/core_configuration.h
- src/core/lib/debug/stats.h
- src/core/lib/debug/stats_data.h
- src/core/lib/debug/trace.h
- - src/core/lib/gprpp/atomic.h
+ - src/core/lib/event_engine/channel_args_endpoint_config.h
+ - src/core/lib/event_engine/event_engine_factory.h
+ - src/core/lib/event_engine/sockaddr.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/capture.h
+ - src/core/lib/gprpp/chunked_vector.h
+ - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/match.h
- src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/overload.h
- src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/single_set_ptr.h
+ - src/core/lib/gprpp/table.h
+ - src/core/lib/gprpp/time.h
- src/core/lib/http/format_request.h
- src/core/lib/http/httpcli.h
- src/core/lib/http/parser.h
@@ -1733,9 +1943,14 @@ libs:
- src/core/lib/iomgr/error_internal.h
- src/core/lib/iomgr/ev_apple.h
- src/core/lib/iomgr/ev_epoll1_linux.h
- - src/core/lib/iomgr/ev_epollex_linux.h
- src/core/lib/iomgr/ev_poll_posix.h
- src/core/lib/iomgr/ev_posix.h
+ - src/core/lib/iomgr/event_engine/closure.h
+ - src/core/lib/iomgr/event_engine/endpoint.h
+ - src/core/lib/iomgr/event_engine/pollset.h
+ - src/core/lib/iomgr/event_engine/promise.h
+ - src/core/lib/iomgr/event_engine/resolved_address_internal.h
+ - src/core/lib/iomgr/event_engine/resolver.h
- src/core/lib/iomgr/exec_ctx.h
- src/core/lib/iomgr/executor.h
- src/core/lib/iomgr/executor/mpmcqueue.h
@@ -1745,27 +1960,23 @@ libs:
- src/core/lib/iomgr/internal_errqueue.h
- src/core/lib/iomgr/iocp_windows.h
- src/core/lib/iomgr/iomgr.h
- - src/core/lib/iomgr/iomgr_custom.h
- src/core/lib/iomgr/iomgr_internal.h
- - src/core/lib/iomgr/is_epollexclusive_available.h
- src/core/lib/iomgr/load_file.h
- src/core/lib/iomgr/lockfree_event.h
- src/core/lib/iomgr/nameser.h
- src/core/lib/iomgr/polling_entity.h
- src/core/lib/iomgr/pollset.h
- - src/core/lib/iomgr/pollset_custom.h
- src/core/lib/iomgr/pollset_set.h
- - src/core/lib/iomgr/pollset_set_custom.h
- src/core/lib/iomgr/pollset_set_windows.h
- - src/core/lib/iomgr/pollset_uv.h
- src/core/lib/iomgr/pollset_windows.h
- src/core/lib/iomgr/port.h
- src/core/lib/iomgr/python_util.h
- src/core/lib/iomgr/resolve_address.h
- - src/core/lib/iomgr/resolve_address_custom.h
- - src/core/lib/iomgr/resource_quota.h
+ - src/core/lib/iomgr/resolve_address_impl.h
+ - src/core/lib/iomgr/resolve_address_posix.h
+ - src/core/lib/iomgr/resolve_address_windows.h
+ - src/core/lib/iomgr/resolved_address.h
- src/core/lib/iomgr/sockaddr.h
- - src/core/lib/iomgr/sockaddr_custom.h
- src/core/lib/iomgr/sockaddr_posix.h
- src/core/lib/iomgr/sockaddr_windows.h
- src/core/lib/iomgr/socket_factory_posix.h
@@ -1773,33 +1984,90 @@ libs:
- src/core/lib/iomgr/socket_utils.h
- src/core/lib/iomgr/socket_utils_posix.h
- src/core/lib/iomgr/socket_windows.h
- - src/core/lib/iomgr/sys_epoll_wrapper.h
- src/core/lib/iomgr/tcp_client.h
- src/core/lib/iomgr/tcp_client_posix.h
- - src/core/lib/iomgr/tcp_custom.h
- src/core/lib/iomgr/tcp_posix.h
- src/core/lib/iomgr/tcp_server.h
- src/core/lib/iomgr/tcp_server_utils_posix.h
- src/core/lib/iomgr/tcp_windows.h
- src/core/lib/iomgr/time_averaged_stats.h
- src/core/lib/iomgr/timer.h
- - src/core/lib/iomgr/timer_custom.h
- src/core/lib/iomgr/timer_generic.h
- src/core/lib/iomgr/timer_heap.h
- src/core/lib/iomgr/timer_manager.h
- - src/core/lib/iomgr/udp_server.h
- src/core/lib/iomgr/unix_sockets_posix.h
- src/core/lib/iomgr/wakeup_fd_pipe.h
- src/core/lib/iomgr/wakeup_fd_posix.h
- src/core/lib/iomgr/work_serializer.h
- src/core/lib/json/json.h
- src/core/lib/json/json_util.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/arena_promise.h
+ - src/core/lib/promise/call_push_pull.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/intra_activity_waiter.h
+ - src/core/lib/promise/latch.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/promise/sleep.h
+ - src/core/lib/promise/try_seq.h
+ - src/core/lib/resolver/resolver.h
+ - src/core/lib/resolver/resolver_factory.h
+ - src/core/lib/resolver/resolver_registry.h
+ - src/core/lib/resolver/server_address.h
+ - src/core/lib/resource_quota/api.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/security/authorization/authorization_engine.h
+ - src/core/lib/security/authorization/authorization_policy_provider.h
+ - src/core/lib/security/authorization/evaluate_args.h
+ - src/core/lib/security/authorization/grpc_server_authz_filter.h
+ - src/core/lib/security/context/security_context.h
+ - src/core/lib/security/credentials/call_creds_util.h
+ - src/core/lib/security/credentials/channel_creds_registry.h
+ - src/core/lib/security/credentials/composite/composite_credentials.h
+ - src/core/lib/security/credentials/credentials.h
+ - src/core/lib/security/credentials/fake/fake_credentials.h
+ - src/core/lib/security/credentials/insecure/insecure_credentials.h
+ - src/core/lib/security/credentials/plugin/plugin_credentials.h
+ - src/core/lib/security/credentials/tls/tls_utils.h
+ - src/core/lib/security/security_connector/fake/fake_security_connector.h
+ - src/core/lib/security/security_connector/insecure/insecure_security_connector.h
+ - src/core/lib/security/security_connector/load_system_roots.h
+ - src/core/lib/security/security_connector/load_system_roots_linux.h
+ - src/core/lib/security/security_connector/security_connector.h
+ - src/core/lib/security/transport/auth_filters.h
+ - src/core/lib/security/transport/secure_endpoint.h
+ - src/core/lib/security/transport/security_handshaker.h
+ - src/core/lib/security/transport/tsi_error.h
+ - src/core/lib/security/util/json_util.h
+ - src/core/lib/service_config/service_config.h
+ - src/core/lib/service_config/service_config_call_data.h
+ - src/core/lib/service_config/service_config_impl.h
+ - src/core/lib/service_config/service_config_parser.h
- src/core/lib/slice/b64.h
- src/core/lib/slice/percent_encoding.h
+ - src/core/lib/slice/slice.h
- src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_split.h
- src/core/lib/slice/slice_string_helpers.h
- - src/core/lib/slice/slice_utils.h
- src/core/lib/surface/api_trace.h
+ - src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/channel.h
@@ -1812,24 +2080,29 @@ libs:
- src/core/lib/surface/lame_client.h
- src/core/lib/surface/server.h
- src/core/lib/surface/validate_metadata.h
- - src/core/lib/transport/authority_override.h
- src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/byte_stream.h
- src/core/lib/transport/connectivity_state.h
- src/core/lib/transport/error_utils.h
- src/core/lib/transport/http2_errors.h
- - src/core/lib/transport/metadata.h
- src/core/lib/transport/metadata_batch.h
+ - src/core/lib/transport/parsed_metadata.h
- src/core/lib/transport/pid_controller.h
- - src/core/lib/transport/static_metadata.h
- src/core/lib/transport/status_conversion.h
- - src/core/lib/transport/status_metadata.h
- src/core/lib/transport/timeout_encoding.h
- src/core/lib/transport/transport.h
- src/core/lib/transport/transport_impl.h
- src/core/lib/uri/uri_parser.h
+ - src/core/tsi/fake_transport_security.h
+ - src/core/tsi/local_transport_security.h
+ - src/core/tsi/transport_security.h
+ - src/core/tsi/transport_security_grpc.h
+ - src/core/tsi/transport_security_interface.h
+ - third_party/xxhash/xxhash.h
src:
- src/core/ext/filters/census/grpc_context.cc
+ - src/core/ext/filters/channel_idle/channel_idle_filter.cc
+ - src/core/ext/filters/channel_idle/idle_filter_state.cc
- src/core/ext/filters/client_channel/backend_metric.cc
- src/core/ext/filters/client_channel/backup_poller.cc
- src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -1849,41 +2122,39 @@ libs:
- 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_channel.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/ring_hash/ring_hash.cc
+ - src/core/ext/filters/client_channel/lb_policy/rls/rls.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_registry.cc
- src/core/ext/filters/client_channel/local_subchannel_pool.cc
- src/core/ext/filters/client_channel/proxy_mapper_registry.cc
- - src/core/ext/filters/client_channel/resolver.cc
+ - src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
- - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
- src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+ - src/core/ext/filters/client_channel/resolver/polling_resolver.cc
- src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
- - src/core/ext/filters/client_channel/resolver_registry.cc
- src/core/ext/filters/client_channel/resolver_result_parsing.cc
- src/core/ext/filters/client_channel/retry_filter.cc
- src/core/ext/filters/client_channel/retry_service_config.cc
- 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/subchannel.cc
- src/core/ext/filters/client_channel/subchannel_pool_interface.cc
- - src/core/ext/filters/client_idle/client_idle_filter.cc
+ - src/core/ext/filters/client_channel/subchannel_stream_client.cc
- src/core/ext/filters/deadline/deadline_filter.cc
- src/core/ext/filters/fault_injection/fault_injection_filter.cc
- src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -1893,21 +2164,12 @@ libs:
- 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/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
- - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- - src/core/ext/filters/workarounds/workaround_utils.cc
- src/core/ext/transport/chttp2/alpn/alpn.cc
- - src/core/ext/transport/chttp2/client/authority.cc
- src/core/ext/transport/chttp2/client/chttp2_connector.cc
- - src/core/ext/transport/chttp2/client/insecure/channel_create.cc
- - src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
- src/core/ext/transport/chttp2/server/chttp2_server.cc
- - src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
- - src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
- src/core/ext/transport/chttp2/transport/bin_decoder.cc
- src/core/ext/transport/chttp2/transport/bin_encoder.cc
- - src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
- src/core/ext/transport/chttp2/transport/chttp2_transport.cc
- src/core/ext/transport/chttp2/transport/context_list.cc
- src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -1918,11 +2180,11 @@ libs:
- src/core/ext/transport/chttp2/transport/frame_settings.cc
- src/core/ext/transport/chttp2/transport/frame_window_update.cc
- src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+ - src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
- src/core/ext/transport/chttp2/transport/hpack_parser.cc
- - src/core/ext/transport/chttp2/transport/hpack_table.cc
+ - src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
- src/core/ext/transport/chttp2/transport/http2_settings.cc
- src/core/ext/transport/chttp2/transport/huffsyms.cc
- - src/core/ext/transport/chttp2/transport/incoming_metadata.cc
- src/core/ext/transport/chttp2/transport/parsing.cc
- src/core/ext/transport/chttp2/transport/stream_lists.cc
- src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -1930,36 +2192,51 @@ libs:
- 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/google/api/annotations.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
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+ - src/core/ext/upb-generated/google/rpc/status.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/data/orca/v1/orca_load_report.upb.c
+ - src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
- src/core/ext/upb-generated/validate/validate.upb.c
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
- - src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
- src/core/lib/channel/channel_args.cc
+ - src/core/lib/channel/channel_args_preconditioning.cc
- src/core/lib/channel/channel_stack.cc
- src/core/lib/channel/channel_stack_builder.cc
+ - src/core/lib/channel/channel_stack_builder_impl.cc
- src/core/lib/channel/channel_trace.cc
- src/core/lib/channel/channelz.cc
- src/core/lib/channel/channelz_registry.cc
- src/core/lib/channel/connected_channel.cc
- src/core/lib/channel/handshaker.cc
- src/core/lib/channel/handshaker_registry.cc
+ - src/core/lib/channel/promise_based_filter.cc
- src/core/lib/channel/status_util.cc
- src/core/lib/compression/compression.cc
- - src/core/lib/compression/compression_args.cc
- src/core/lib/compression/compression_internal.cc
- src/core/lib/compression/message_compress.cc
- - src/core/lib/compression/stream_compression.cc
- - src/core/lib/compression/stream_compression_gzip.cc
- - src/core/lib/compression/stream_compression_identity.cc
+ - src/core/lib/config/core_configuration.cc
- src/core/lib/debug/stats.cc
- src/core/lib/debug/stats_data.cc
- src/core/lib/debug/trace.cc
- - src/core/lib/event_engine/slice_allocator.cc
+ - src/core/lib/event_engine/channel_args_endpoint_config.cc
+ - src/core/lib/event_engine/default_event_engine_factory.cc
+ - src/core/lib/event_engine/event_engine.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/event_engine/resolved_address.cc
- src/core/lib/event_engine/sockaddr.cc
+ - src/core/lib/gprpp/time.cc
- src/core/lib/http/format_request.cc
- src/core/lib/http/httpcli.cc
- src/core/lib/http/parser.cc
@@ -1970,17 +2247,24 @@ libs:
- 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_event_engine.cc
- src/core/lib/iomgr/endpoint_pair_posix.cc
- - src/core/lib/iomgr/endpoint_pair_uv.cc
- 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_epoll1_linux.cc
- - src/core/lib/iomgr/ev_epollex_linux.cc
- src/core/lib/iomgr/ev_poll_posix.cc
- src/core/lib/iomgr/ev_posix.cc
- src/core/lib/iomgr/ev_windows.cc
+ - src/core/lib/iomgr/event_engine/closure.cc
+ - src/core/lib/iomgr/event_engine/endpoint.cc
+ - src/core/lib/iomgr/event_engine/iomgr.cc
+ - src/core/lib/iomgr/event_engine/pollset.cc
+ - src/core/lib/iomgr/event_engine/resolved_address_internal.cc
+ - src/core/lib/iomgr/event_engine/resolver.cc
+ - src/core/lib/iomgr/event_engine/tcp.cc
+ - src/core/lib/iomgr/event_engine/timer.cc
- src/core/lib/iomgr/exec_ctx.cc
- src/core/lib/iomgr/executor.cc
- src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -1995,60 +2279,45 @@ libs:
- src/core/lib/iomgr/internal_errqueue.cc
- src/core/lib/iomgr/iocp_windows.cc
- src/core/lib/iomgr/iomgr.cc
- - src/core/lib/iomgr/iomgr_custom.cc
- src/core/lib/iomgr/iomgr_internal.cc
- src/core/lib/iomgr/iomgr_posix.cc
- src/core/lib/iomgr/iomgr_posix_cfstream.cc
- - src/core/lib/iomgr/iomgr_uv.cc
- src/core/lib/iomgr/iomgr_windows.cc
- - 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/polling_entity.cc
- src/core/lib/iomgr/pollset.cc
- - src/core/lib/iomgr/pollset_custom.cc
- src/core/lib/iomgr/pollset_set.cc
- - src/core/lib/iomgr/pollset_set_custom.cc
- src/core/lib/iomgr/pollset_set_windows.cc
- - src/core/lib/iomgr/pollset_uv.cc
- src/core/lib/iomgr/pollset_windows.cc
- src/core/lib/iomgr/resolve_address.cc
- - src/core/lib/iomgr/resolve_address_custom.cc
- src/core/lib/iomgr/resolve_address_posix.cc
- src/core/lib/iomgr/resolve_address_windows.cc
- - src/core/lib/iomgr/resource_quota.cc
+ - src/core/lib/iomgr/sockaddr_utils_posix.cc
- src/core/lib/iomgr/socket_factory_posix.cc
- src/core/lib/iomgr/socket_mutator.cc
- src/core/lib/iomgr/socket_utils_common_posix.cc
- src/core/lib/iomgr/socket_utils_linux.cc
- src/core/lib/iomgr/socket_utils_posix.cc
- - src/core/lib/iomgr/socket_utils_uv.cc
- src/core/lib/iomgr/socket_utils_windows.cc
- src/core/lib/iomgr/socket_windows.cc
- src/core/lib/iomgr/tcp_client.cc
- src/core/lib/iomgr/tcp_client_cfstream.cc
- - src/core/lib/iomgr/tcp_client_custom.cc
- src/core/lib/iomgr/tcp_client_posix.cc
- src/core/lib/iomgr/tcp_client_windows.cc
- - src/core/lib/iomgr/tcp_custom.cc
- src/core/lib/iomgr/tcp_posix.cc
- src/core/lib/iomgr/tcp_server.cc
- - src/core/lib/iomgr/tcp_server_custom.cc
- src/core/lib/iomgr/tcp_server_posix.cc
- src/core/lib/iomgr/tcp_server_utils_posix_common.cc
- src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
- src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
- src/core/lib/iomgr/tcp_server_windows.cc
- - src/core/lib/iomgr/tcp_uv.cc
- src/core/lib/iomgr/tcp_windows.cc
- src/core/lib/iomgr/time_averaged_stats.cc
- src/core/lib/iomgr/timer.cc
- - src/core/lib/iomgr/timer_custom.cc
- src/core/lib/iomgr/timer_generic.cc
- src/core/lib/iomgr/timer_heap.cc
- src/core/lib/iomgr/timer_manager.cc
- - src/core/lib/iomgr/timer_uv.cc
- - src/core/lib/iomgr/udp_server.cc
- src/core/lib/iomgr/unix_sockets_posix.cc
- src/core/lib/iomgr/unix_sockets_posix_noop.cc
- src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -2059,13 +2328,51 @@ libs:
- src/core/lib/json/json_reader.cc
- src/core/lib/json/json_util.cc
- src/core/lib/json/json_writer.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/promise/sleep.cc
+ - src/core/lib/resolver/resolver.cc
+ - src/core/lib/resolver/resolver_registry.cc
+ - src/core/lib/resolver/server_address.cc
+ - src/core/lib/resource_quota/api.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
+ - src/core/lib/security/authorization/evaluate_args.cc
+ - src/core/lib/security/authorization/grpc_server_authz_filter.cc
+ - src/core/lib/security/context/security_context.cc
+ - src/core/lib/security/credentials/call_creds_util.cc
+ - src/core/lib/security/credentials/composite/composite_credentials.cc
+ - src/core/lib/security/credentials/credentials.cc
+ - src/core/lib/security/credentials/fake/fake_credentials.cc
+ - src/core/lib/security/credentials/insecure/insecure_credentials.cc
+ - src/core/lib/security/credentials/plugin/plugin_credentials.cc
+ - src/core/lib/security/credentials/tls/tls_utils.cc
+ - src/core/lib/security/security_connector/fake/fake_security_connector.cc
+ - src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
+ - src/core/lib/security/security_connector/load_system_roots_fallback.cc
+ - src/core/lib/security/security_connector/load_system_roots_linux.cc
+ - src/core/lib/security/security_connector/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
+ - src/core/lib/security/transport/server_auth_filter.cc
+ - src/core/lib/security/transport/tsi_error.cc
+ - src/core/lib/security/util/json_util.cc
+ - src/core/lib/service_config/service_config_impl.cc
+ - src/core/lib/service_config/service_config_parser.cc
- src/core/lib/slice/b64.cc
- src/core/lib/slice/percent_encoding.cc
- src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_api.cc
- src/core/lib/slice/slice_buffer.cc
- - src/core/lib/slice/slice_intern.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_split.cc
- src/core/lib/slice/slice_string_helpers.cc
- src/core/lib/surface/api_trace.cc
+ - src/core/lib/surface/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
@@ -2079,32 +2386,36 @@ libs:
- src/core/lib/surface/completion_queue_factory.cc
- src/core/lib/surface/event_string.cc
- src/core/lib/surface/init.cc
- - src/core/lib/surface/init_unsecure.cc
- src/core/lib/surface/lame_client.cc
- src/core/lib/surface/metadata_array.cc
- 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/bdp_estimator.cc
- src/core/lib/transport/byte_stream.cc
- src/core/lib/transport/connectivity_state.cc
- src/core/lib/transport/error_utils.cc
- - src/core/lib/transport/metadata.cc
- - src/core/lib/transport/metadata_batch.cc
+ - src/core/lib/transport/parsed_metadata.cc
- src/core/lib/transport/pid_controller.cc
- - src/core/lib/transport/static_metadata.cc
- src/core/lib/transport/status_conversion.cc
- - src/core/lib/transport/status_metadata.cc
- src/core/lib/transport/timeout_encoding.cc
- src/core/lib/transport/transport.cc
- src/core/lib/transport/transport_op_string.cc
- src/core/lib/uri/uri_parser.cc
- - src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+ - src/core/plugin_registry/grpc_plugin_registry.cc
+ - src/core/plugin_registry/grpc_plugin_registry_noextra.cc
+ - src/core/tsi/fake_transport_security.cc
+ - src/core/tsi/local_transport_security.cc
+ - src/core/tsi/transport_security.cc
+ - src/core/tsi/transport_security_grpc.cc
deps:
- absl/container:flat_hash_map
- absl/container:inlined_vector
+ - absl/functional:bind_front
+ - absl/hash:hash
- absl/status:statusor
+ - absl/types:variant
+ - absl/utility:utility
- gpr
- address_sorting
baselib: true
@@ -2214,6 +2525,7 @@ libs:
- include/grpcpp/client_context.h
- include/grpcpp/completion_queue.h
- include/grpcpp/create_channel.h
+ - include/grpcpp/create_channel_binder.h
- include/grpcpp/create_channel_posix.h
- include/grpcpp/ext/health_check_service_server_builder_option.h
- include/grpcpp/generic/async_generic_service.h
@@ -2286,9 +2598,13 @@ libs:
- include/grpcpp/resource_quota.h
- include/grpcpp/security/auth_context.h
- include/grpcpp/security/auth_metadata_processor.h
+ - include/grpcpp/security/authorization_policy_provider.h
+ - include/grpcpp/security/binder_credentials.h
+ - include/grpcpp/security/binder_security_policy.h
- include/grpcpp/security/credentials.h
- include/grpcpp/security/server_credentials.h
- include/grpcpp/security/tls_certificate_provider.h
+ - include/grpcpp/security/tls_certificate_verifier.h
- include/grpcpp/security/tls_credentials_options.h
- include/grpcpp/server.h
- include/grpcpp/server_builder.h
@@ -2318,11 +2634,30 @@ libs:
- include/grpcpp/support/validate_service_config.h
- include/grpcpp/xds_server_builder.h
headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
- src/cpp/client/create_channel_internal.h
- src/cpp/client/secure_credentials.h
- src/cpp/common/channel_filter.h
- src/cpp/common/secure_auth_context.h
- - src/cpp/common/tls_credentials_options_util.h
- src/cpp/server/dynamic_thread_pool.h
- src/cpp/server/external_connection_acceptor_impl.h
- src/cpp/server/health/default_health_check_service.h
@@ -2330,6 +2665,24 @@ libs:
- src/cpp/server/thread_pool_interface.h
- src/cpp/thread_manager/thread_manager.h
src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
- src/cpp/client/channel_cc.cc
- src/cpp/client/client_callback.cc
- src/cpp/client/client_context.cc
@@ -2354,8 +2707,8 @@ libs:
- src/cpp/common/secure_channel_arguments.cc
- src/cpp/common/secure_create_auth_context.cc
- src/cpp/common/tls_certificate_provider.cc
+ - src/cpp/common/tls_certificate_verifier.cc
- src/cpp/common/tls_credentials_options.cc
- - src/cpp/common/tls_credentials_options_util.cc
- src/cpp/common/validate_service_config.cc
- src/cpp/common/version_cc.cc
- src/cpp/server/async_generic_service.cc
@@ -2428,6 +2781,7 @@ libs:
- include/grpc++/test/mock_stream.h
- include/grpc++/test/server_context_test_spouse.h
- include/grpcpp/test/channel_test_peer.h
+ - include/grpcpp/test/client_context_test_peer.h
- include/grpcpp/test/default_reactor_test_peer.h
- include/grpcpp/test/mock_stream.h
- include/grpcpp/test/server_context_test_spouse.h
@@ -2630,9 +2984,11 @@ libs:
- include/grpcpp/resource_quota.h
- include/grpcpp/security/auth_context.h
- include/grpcpp/security/auth_metadata_processor.h
+ - include/grpcpp/security/authorization_policy_provider.h
- include/grpcpp/security/credentials.h
- include/grpcpp/security/server_credentials.h
- include/grpcpp/security/tls_certificate_provider.h
+ - include/grpcpp/security/tls_certificate_verifier.h
- include/grpcpp/security/tls_credentials_options.h
- include/grpcpp/server.h
- include/grpcpp/server_builder.h
@@ -2765,15 +3121,6 @@ libs:
deps:
- grpc++
targets:
-- name: algorithm_test
- build: test
- language: c
- headers: []
- src:
- - test/core/compression/algorithm_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: alloc_test
build: test
language: c
@@ -2919,15 +3266,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: avl_test
- build: test
- language: c
- headers: []
- src:
- - test/core/avl/avl_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: b64_test
build: test
language: c
@@ -3001,31 +3339,6 @@ targets:
- test/core/iomgr/buffer_list_test.cc
deps:
- grpc_test_util
-- name: channel_args_test
- build: test
- language: c
- headers: []
- src:
- - test/core/channel/channel_args_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
-- name: channel_create_test
- build: test
- language: c
- headers: []
- src:
- - test/core/surface/channel_create_test.cc
- deps:
- - grpc_test_util
-- name: channel_stack_builder_test
- build: test
- language: c
- headers: []
- src:
- - test/core/channel/channel_stack_builder_test.cc
- deps:
- - grpc_test_util
- name: channel_stack_test
build: test
language: c
@@ -3096,8 +3409,10 @@ targets:
- name: compression_test
build: test
language: c
- headers: []
+ headers:
+ - test/core/compression/args_utils.h
src:
+ - test/core/compression/args_utils.cc
- test/core/compression/compression_test.cc
deps:
- grpc_test_util
@@ -3129,26 +3444,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: dns_resolver_connectivity_using_ares_test
- build: test
- language: c
- headers: []
- src:
- - test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
- deps:
- - grpc_test_util
- args:
- - --resolver=ares
-- name: dns_resolver_connectivity_using_native_test
- build: test
- language: c
- headers: []
- src:
- - test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc
- deps:
- - grpc_test_util
- args:
- - --resolver=native
- name: dns_resolver_cooldown_test
build: test
language: c
@@ -3198,29 +3493,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: error_test
- build: test
- language: c
- headers:
- - test/core/iomgr/endpoint_tests.h
- src:
- - test/core/iomgr/endpoint_tests.cc
- - test/core/iomgr/error_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
-- name: ev_epollex_linux_test
- build: test
- language: c
- headers: []
- src:
- - test/core/iomgr/ev_epollex_linux_test.cc
- deps:
- - grpc_test_util
- platforms:
- - linux
- - posix
- - mac
- name: fake_resolver_test
build: test
language: c
@@ -3390,18 +3662,6 @@ targets:
- linux
- posix
- mac
-- name: handshake_verify_peer_options_test
- build: test
- language: c
- headers: []
- src:
- - test/core/handshake/verify_peer_options.cc
- deps:
- - grpc_test_util
- platforms:
- - linux
- - posix
- - mac
- name: histogram_test
build: test
language: c
@@ -3429,58 +3689,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: hpack_parser_test
- build: test
- language: c
- headers: []
- src:
- - test/core/transport/chttp2/hpack_parser_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
-- name: hpack_table_test
- build: test
- language: c
- headers: []
- src:
- - test/core/transport/chttp2/hpack_table_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
-- name: httpcli_test
- build: test
- language: c
- headers:
- - test/core/end2end/data/ssl_test_data.h
- src:
- - test/core/end2end/data/client_certs.cc
- - test/core/end2end/data/server1_cert.cc
- - test/core/end2end/data/server1_key.cc
- - test/core/end2end/data/test_root_cert.cc
- - test/core/http/httpcli_test.cc
- deps:
- - grpc_test_util
- platforms:
- - linux
- - posix
- - mac
-- name: httpscli_test
- build: test
- language: c
- headers:
- - test/core/end2end/data/ssl_test_data.h
- src:
- - test/core/end2end/data/client_certs.cc
- - test/core/end2end/data/server1_cert.cc
- - test/core/end2end/data/server1_key.cc
- - test/core/end2end/data/test_root_cert.cc
- - test/core/http/httpscli_test.cc
- deps:
- - grpc_test_util
- platforms:
- - linux
- - posix
- - mac
- name: inproc_callback_test
build: test
language: c
@@ -3546,23 +3754,77 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: message_compress_test
+- name: memory_quota_stress_test
build: test
language: c
- headers: []
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
src:
- - test/core/compression/message_compress_test.cc
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/resource_quota/memory_quota_stress_test.cc
deps:
- - grpc_test_util
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ platforms:
+ - linux
+ - posix
uses_polling: false
-- name: metadata_test
+- name: message_compress_test
build: test
language: c
headers: []
src:
- - test/core/transport/metadata_test.cc
+ - test/core/compression/message_compress_test.cc
deps:
- grpc_test_util
+ uses_polling: false
- name: minimal_stack_is_minimal_test
build: test
language: c
@@ -3678,8 +3940,12 @@ targets:
- name: public_headers_must_be_c89
build: test
language: c
- headers: []
+ headers:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
+ - src/core/lib/security/authorization/rbac_translator.h
src:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ - src/core/lib/security/authorization/rbac_translator.cc
- test/core/surface/public_headers_must_be_c89.c
deps:
- grpc_test_util
@@ -3697,16 +3963,6 @@ targets:
- linux
- posix
- mac
-- name: resolve_address_using_ares_resolver_test
- build: test
- language: c
- headers: []
- src:
- - test/core/iomgr/resolve_address_test.cc
- deps:
- - grpc_test_util
- args:
- - --resolver=ares
- name: resolve_address_using_native_resolver_posix_test
build: test
language: c
@@ -3721,24 +3977,6 @@ targets:
- linux
- posix
- mac
-- name: resolve_address_using_native_resolver_test
- build: test
- language: c
- headers: []
- src:
- - test/core/iomgr/resolve_address_test.cc
- deps:
- - grpc_test_util
- args:
- - --resolver=native
-- name: resource_quota_test
- build: test
- language: c
- headers: []
- src:
- - test/core/iomgr/resource_quota_test.cc
- deps:
- - grpc_test_util
- name: secure_channel_create_test
build: test
language: c
@@ -3805,15 +4043,37 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: slice_string_helpers_test
+- name: slice_split_test
build: test
language: c
headers: []
src:
- - test/core/slice/slice_string_helpers_test.cc
+ - test/core/slice/slice_split_test.cc
deps:
- grpc_test_util
uses_polling: false
+- name: slice_string_helpers_test
+ build: test
+ language: c
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/slice/slice_string_helpers_test.cc
+ deps:
+ - gpr
+ uses_polling: false
- name: sockaddr_resolver_test
build: test
language: c
@@ -3874,15 +4134,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: stream_compression_test
- build: test
- language: c
- headers: []
- src:
- - test/core/compression/stream_compression_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: stream_map_test
build: test
language: c
@@ -3891,15 +4142,6 @@ targets:
- test/core/transport/chttp2/stream_map_test.cc
deps:
- grpc_test_util
-- name: stream_owned_slice_test
- build: test
- language: c
- headers: []
- src:
- - test/core/transport/stream_owned_slice_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: string_test
build: test
language: c
@@ -3964,23 +4206,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: test_core_security_credentials_test
- build: test
- language: c
- headers: []
- src:
- - test/core/security/credentials_test.cc
- deps:
- - grpc_test_util
-- name: test_core_slice_slice_test
- build: test
- language: c
- headers: []
- src:
- - test/core/slice/slice_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: thd_test
build: test
language: c
@@ -4008,15 +4233,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: timeout_encoding_test
- build: test
- language: c
- headers: []
- src:
- - test/core/transport/timeout_encoding_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: timer_heap_test
build: test
language: c
@@ -4035,15 +4251,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: tls_test
- build: test
- language: c
- headers: []
- src:
- - test/core/gpr/tls_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: transport_security_common_api_test
build: test
language: c
@@ -4060,35 +4267,49 @@ targets:
- test/core/tsi/transport_security_test.cc
deps:
- grpc_test_util
-- name: udp_server_test
- build: test
- language: c
- headers: []
- src:
- - test/core/iomgr/udp_server_test.cc
- deps:
- - grpc_test_util
- platforms:
- - linux
- - posix
- - mac
-- name: useful_test
+- name: varint_test
build: test
language: c
headers: []
src:
- - test/core/gpr/useful_test.cc
+ - test/core/transport/chttp2/varint_test.cc
deps:
- grpc_test_util
uses_polling: false
-- name: varint_test
+- name: activity_test
+ gtest: true
build: test
- language: c
- headers: []
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/join.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/promise/wait_set.h
+ - test/core/promise/test_wakeup_schedulers.h
src:
- - test/core/transport/chttp2/varint_test.cc
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/promise/activity.cc
+ - test/core/promise/activity_test.cc
deps:
- - grpc_test_util
+ - absl/container:flat_hash_set
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
uses_polling: false
- name: address_sorting_test
gtest: true
@@ -4164,32 +4385,20 @@ targets:
headers:
- test/core/end2end/cq_verifier.h
- test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h
+ - test/core/util/fake_udp_and_tcp_server.h
src:
- test/core/tsi/alts/fake_handshaker/handshaker.proto
- test/core/tsi/alts/fake_handshaker/transport_security_common.proto
- test/core/end2end/cq_verifier.cc
- test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc
- test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
deps:
- grpc++
- grpc_test_util
platforms:
- linux
- posix
-- name: alts_credentials_fuzzer
- build: fuzzer
- language: c++
- headers: []
- src:
- - test/core/security/alts_credentials_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/security/corpus/alts_credentials_corpus
- maxlen: 2048
- name: alts_util_test
gtest: true
build: test
@@ -4200,6 +4409,75 @@ targets:
deps:
- grpc++_alts
- grpc++_test_util
+- name: arena_promise_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/arena_promise.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - test/core/promise/test_context.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/promise/arena_promise_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
- name: async_end2end_test
gtest: true
build: test
@@ -4228,20 +4506,37 @@ targets:
gtest: true
build: test
language: c++
- headers:
- - src/core/lib/security/authorization/authorization_engine.h
- - src/core/lib/security/authorization/evaluate_args.h
- - src/core/lib/security/authorization/grpc_authorization_engine.h
- - src/core/lib/security/authorization/matchers.h
- - src/core/lib/security/authorization/rbac_policy.h
+ headers: []
src:
- - src/core/lib/security/authorization/evaluate_args.cc
- - src/core/lib/security/authorization/grpc_authorization_engine.cc
- - src/core/lib/security/authorization/matchers.cc
- - src/core/lib/security/authorization/rbac_policy.cc
- test/core/security/authorization_matchers_test.cc
deps:
- grpc_test_util
+- name: authorization_policy_provider_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
+ - src/core/lib/security/authorization/rbac_translator.h
+ src:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ - src/core/lib/security/authorization/rbac_translator.cc
+ - src/cpp/server/authorization_policy_provider.cc
+ - test/cpp/server/authorization_policy_provider_test.cc
+ deps:
+ - grpc++
+ - grpc_test_util
+- name: avl_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/avl/avl.h
+ src:
+ - test/core/avl/avl_test.cc
+ deps:
+ - absl/container:inlined_vector
+ uses_polling: false
- name: aws_request_signer_test
gtest: true
build: test
@@ -4301,336 +4596,184 @@ targets:
- posix
- mac
uses_polling: false
-- name: bm_alarm
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_alarm.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_arena
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_arena.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_byte_buffer
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_byte_buffer.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_call_create
+- name: binder_resolver_test
+ gtest: true
build: test
language: c++
headers: []
src:
- - test/cpp/microbenchmarks/bm_call_create.cc
+ - test/core/client_channel/resolvers/binder_resolver_test.cc
deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_callback_streaming_ping_pong
+ - grpc_test_util
+- name: binder_server_test
+ gtest: true
build: test
- run: false
language: c++
headers:
- - test/cpp/microbenchmarks/callback_streaming_ping_pong.h
- - test/cpp/microbenchmarks/callback_test_service.h
- - test/cpp/util/byte_buffer_proto_helper.h
- - test/cpp/util/string_ref_helper.h
- - test/cpp/util/subprocess.h
+ - test/core/transport/binder/end2end/fake_binder.h
+ - test/cpp/end2end/test_service_impl.h
src:
- - test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc
- - test/cpp/microbenchmarks/callback_test_service.cc
- - test/cpp/util/byte_buffer_proto_helper.cc
- - test/cpp/util/string_ref_helper.cc
- - test/cpp/util/subprocess.cc
+ - src/proto/grpc/testing/echo.proto
+ - src/proto/grpc/testing/echo_messages.proto
+ - src/proto/grpc/testing/simple_messages.proto
+ - test/core/transport/binder/end2end/binder_server_test.cc
+ - test/core/transport/binder/end2end/fake_binder.cc
+ - test/cpp/end2end/test_service_impl.cc
deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_callback_unary_ping_pong
+ - grpc++_test_util
+- name: binder_transport_test
+ gtest: true
build: test
- run: false
language: c++
headers:
- - test/cpp/microbenchmarks/callback_test_service.h
- - test/cpp/microbenchmarks/callback_unary_ping_pong.h
- - test/cpp/util/byte_buffer_proto_helper.h
- - test/cpp/util/string_ref_helper.h
- - test/cpp/util/subprocess.h
- src:
- - test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc
- - test/cpp/microbenchmarks/callback_test_service.cc
- - test/cpp/util/byte_buffer_proto_helper.cc
- - test/cpp/util/string_ref_helper.cc
- - test/cpp/util/subprocess.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_channel
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_channel.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_chttp2_hpack
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_chttp2_hpack.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_chttp2_transport
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_chttp2_transport.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_closure
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_closure.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_cq
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_cq.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_cq_multiple_threads
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- uses_polling: false
-- name: bm_error
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_error.cc
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ - test/core/transport/binder/mock_objects.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/binder_transport_test.cc
+ - test/core/transport/binder/mock_objects.cc
deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
+ - grpc_test_util
uses_polling: false
-- name: bm_fullstack_streaming_ping_pong
- build: test
- language: c++
- headers:
- - test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h
- src:
- - test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_fullstack_streaming_pump
- build: test
- language: c++
- headers:
- - test/cpp/microbenchmarks/fullstack_streaming_pump.h
- src:
- - test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_fullstack_trickle
- build: test
- run: false
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_fullstack_trickle.cc
- deps:
- - absl/flags:flag
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- - mac
-- name: bm_fullstack_unary_ping_pong
+- name: bitset_test
+ gtest: true
build: test
language: c++
headers:
- - test/cpp/microbenchmarks/fullstack_unary_ping_pong.h
- src:
- - test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_metadata
- build: test
- language: c++
- headers: []
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/bitset.h
src:
- - test/cpp/microbenchmarks/bm_metadata.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
+ - test/core/gprpp/bitset_test.cc
+ deps: []
uses_polling: false
-- name: bm_pollset
- build: test
- language: c++
- headers: []
- src:
- - test/cpp/microbenchmarks/bm_pollset.cc
- deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
-- name: bm_threadpool
+- name: byte_buffer_test
+ gtest: true
build: test
- run: false
language: c++
headers: []
src:
- - test/cpp/microbenchmarks/bm_threadpool.cc
+ - test/cpp/util/byte_buffer_test.cc
deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
- - mac
+ - grpc++_test_util
uses_polling: false
-- name: bm_timer
+- name: byte_stream_test
+ gtest: true
build: test
language: c++
headers: []
src:
- - test/cpp/microbenchmarks/bm_timer.cc
+ - test/core/transport/byte_stream_test.cc
deps:
- - benchmark_helpers
- benchmark: true
- defaults: benchmark
- platforms:
- - linux
- - posix
+ - grpc_test_util
uses_polling: false
-- name: byte_buffer_test
+- name: call_finalization_test
gtest: true
build: test
language: c++
- headers: []
+ headers:
+ - test/core/promise/test_context.h
src:
- - test/cpp/util/byte_buffer_test.cc
+ - test/core/channel/call_finalization_test.cc
deps:
- - grpc++_test_util
- uses_polling: false
-- name: byte_stream_test
+ - grpc_test_util
+- name: call_push_pull_test
gtest: true
build: test
language: c++
- headers: []
+ headers:
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/call_push_pull.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/poll.h
src:
- - test/core/transport/byte_stream_test.cc
+ - test/core/promise/call_push_pull_test.cc
deps:
- - grpc_test_util
+ - absl/status:status
+ - absl/status:statusor
+ - absl/types:variant
uses_polling: false
- name: cancel_ares_query_test
gtest: true
@@ -4638,37 +4781,39 @@ targets:
language: c++
headers:
- test/core/end2end/cq_verifier.h
- - test/cpp/naming/dns_test_util.h
+ - test/core/util/fake_udp_and_tcp_server.h
src:
- test/core/end2end/cq_verifier.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
- test/cpp/naming/cancel_ares_query_test.cc
- - test/cpp/naming/dns_test_util.cc
deps:
- grpc++_test_config
- grpc++_test_util
+- name: capture_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/capture.h
+ src:
+ - test/core/gprpp/capture_test.cc
+ deps:
+ - absl/utility:utility
+ uses_polling: false
- name: cel_authorization_engine_test
gtest: true
build: test
language: c++
headers:
- - src/core/lib/security/authorization/authorization_engine.h
- src/core/lib/security/authorization/cel_authorization_engine.h
- - src/core/lib/security/authorization/evaluate_args.h
- - src/core/lib/security/authorization/grpc_authorization_engine.h
- - src/core/lib/security/authorization/matchers.h
- src/core/lib/security/authorization/mock_cel/activation.h
- src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
- src/core/lib/security/authorization/mock_cel/cel_expression.h
- src/core/lib/security/authorization/mock_cel/cel_value.h
- src/core/lib/security/authorization/mock_cel/evaluator_core.h
- src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
- - src/core/lib/security/authorization/rbac_policy.h
src:
- src/core/lib/security/authorization/cel_authorization_engine.cc
- - src/core/lib/security/authorization/evaluate_args.cc
- - src/core/lib/security/authorization/grpc_authorization_engine.cc
- - src/core/lib/security/authorization/matchers.cc
- - src/core/lib/security/authorization/rbac_policy.cc
- test/core/security/cel_authorization_engine_test.cc
deps:
- absl/container:flat_hash_set
@@ -4706,6 +4851,16 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: channel_args_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/channel/channel_args_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: channel_arguments_test
gtest: true
build: test
@@ -4717,6 +4872,15 @@ targets:
- grpc++
- grpc_test_util
uses_polling: false
+- name: channel_creds_registry_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/security/channel_creds_registry_test.cc
+ deps:
+ - grpc_test_util
- name: channel_filter_test
gtest: true
build: test
@@ -4728,6 +4892,15 @@ targets:
- grpc++
- grpc_test_util
uses_polling: false
+- name: channel_stack_builder_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/channel/channel_stack_builder_test.cc
+ deps:
+ - grpc_test_util
- name: channel_trace_test
gtest: true
build: test
@@ -4780,6 +4953,75 @@ targets:
deps:
- grpc++
- grpc_test_util
+- name: chunked_vector_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/chunked_vector.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/gprpp/chunked_vector_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - absl/utility:utility
+ - gpr
+ uses_polling: false
- name: cli_call_test
gtest: true
build: test
@@ -4806,6 +5048,17 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- grpc++_test_util
+- name: client_authority_filter_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/promise/test_context.h
+ src:
+ - test/core/filters/client_authority_filter_test.cc
+ deps:
+ - grpc
+ uses_polling: false
- name: client_callback_end2end_test
gtest: true
build: test
@@ -4843,21 +5096,16 @@ targets:
- linux
- posix
- mac
-- name: client_fuzzer
- build: fuzzer
+- name: client_context_test_peer_test
+ gtest: true
+ build: test
language: c++
headers: []
src:
- - test/core/end2end/fuzzers/client_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/cpp/test/client_context_test_peer_test.cc
deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/end2end/fuzzers/client_fuzzer_corpus
- dict: test/core/end2end/fuzzers/hpack.dictionary
- maxlen: 2048
+ - grpc++_test
+ - grpc++_test_util
- name: client_interceptors_end2end_test
gtest: true
build: test
@@ -4881,15 +5129,17 @@ targets:
language: c++
headers:
- test/core/util/test_lb_policies.h
+ - test/cpp/end2end/connection_delay_injector.h
- test/cpp/end2end/test_service_impl.h
src:
- src/proto/grpc/testing/duplicate/echo_duplicate.proto
- src/proto/grpc/testing/echo.proto
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/simple_messages.proto
- - src/proto/grpc/testing/xds/orca_load_report_for_test.proto
+ - src/proto/grpc/testing/xds/v3/orca_load_report.proto
- test/core/util/test_lb_policies.cc
- test/cpp/end2end/client_lb_end2end_test.cc
+ - test/cpp/end2end/connection_delay_injector.cc
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
@@ -4965,6 +5215,52 @@ targets:
deps:
- grpc_test_util
uses_polling: false
+- name: context_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gpr/tls.h
+ - src/core/lib/promise/context.h
+ src:
+ - test/core/promise/context_test.cc
+ deps: []
+ uses_polling: false
+- name: core_configuration_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/config/core_configuration_test.cc
+ deps:
+ - grpc
+ uses_polling: false
+- name: cpp_impl_of_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/cpp_impl_of.h
+ src:
+ - test/core/gprpp/cpp_impl_of_test.cc
+ deps: []
+ uses_polling: false
+- name: crl_ssl_transport_security_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/tsi/transport_security_test_lib.h
+ src:
+ - test/core/tsi/crl_ssl_transport_security_test.cc
+ - test/core/tsi/transport_security_test_lib.cc
+ deps:
+ - grpc_test_util
+ platforms:
+ - linux
+ - posix
+ - mac
- name: delegating_channel_test
gtest: true
build: test
@@ -5010,6 +5306,24 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
+- name: end2end_binder_transport_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/transport/binder/end2end/fake_binder.h
+ - test/core/transport/binder/end2end/testing_channel_create.h
+ - test/cpp/end2end/test_service_impl.h
+ src:
+ - src/proto/grpc/testing/echo.proto
+ - src/proto/grpc/testing/echo_messages.proto
+ - src/proto/grpc/testing/simple_messages.proto
+ - test/core/transport/binder/end2end/end2end_binder_transport_test.cc
+ - test/core/transport/binder/end2end/fake_binder.cc
+ - test/core/transport/binder/end2end/testing_channel_create.cc
+ - test/cpp/end2end/test_service_impl.cc
+ deps:
+ - grpc++_test_util
- name: end2end_test
gtest: true
build: test
@@ -5029,6 +5343,110 @@ targets:
deps:
- grpc++_test
- grpc++_test_util
+- name: endpoint_binder_pool_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ - test/core/transport/binder/mock_objects.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/endpoint_binder_pool_test.cc
+ - test/core/transport/binder/mock_objects.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
+- name: endpoint_config_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/event_engine/endpoint_config_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: error_details_test
gtest: true
build: test
@@ -5041,6 +5459,18 @@ targets:
deps:
- grpc++_error_details
- grpc_test_util
+- name: error_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/iomgr/endpoint_tests.h
+ src:
+ - test/core/iomgr/endpoint_tests.cc
+ - test/core/iomgr/error_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: error_utils_test
gtest: true
build: test
@@ -5054,17 +5484,8 @@ targets:
gtest: true
build: test
language: c++
- headers:
- - src/core/lib/security/authorization/authorization_engine.h
- - src/core/lib/security/authorization/evaluate_args.h
- - src/core/lib/security/authorization/grpc_authorization_engine.h
- - src/core/lib/security/authorization/matchers.h
- - src/core/lib/security/authorization/rbac_policy.h
+ headers: []
src:
- - src/core/lib/security/authorization/evaluate_args.cc
- - src/core/lib/security/authorization/grpc_authorization_engine.cc
- - src/core/lib/security/authorization/matchers.cc
- - src/core/lib/security/authorization/rbac_policy.cc
- test/core/security/evaluate_args_test.cc
deps:
- grpc_test_util
@@ -5094,6 +5515,148 @@ targets:
- test/cpp/end2end/exception_test.cc
deps:
- grpc++_test_util
+- name: exec_ctx_wakeup_scheduler_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/promise/exec_ctx_wakeup_scheduler_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
+- name: fake_binder_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ - test/core/transport/binder/end2end/fake_binder.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/end2end/fake_binder.cc
+ - test/core/transport/binder/end2end/fake_binder_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: file_watcher_certificate_provider_factory_test
gtest: true
build: test
@@ -5131,6 +5694,94 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: flow_control_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/end2end/cq_verifier.h
+ src:
+ - test/core/end2end/cq_verifier.cc
+ - test/core/transport/chttp2/flow_control_test.cc
+ deps:
+ - grpc_test_util
+- name: for_each_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/for_each.h
+ - src/core/lib/promise/intra_activity_waiter.h
+ - src/core/lib/promise/join.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/observable.h
+ - src/core/lib/promise/pipe.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/promise/wait_set.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - test/core/promise/test_wakeup_schedulers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/promise/for_each_test.cc
+ deps:
+ - absl/container:flat_hash_set
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
- name: generic_end2end_test
gtest: true
build: test
@@ -5168,6 +5819,17 @@ targets:
deps:
- grpc_test_util
uses_polling: false
+- name: google_c2p_resolver_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/util/fake_udp_and_tcp_server.h
+ src:
+ - test/core/client_channel/resolvers/google_c2p_resolver_test.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
+ deps:
+ - grpc++_test_util
- name: google_mesh_ca_certificate_provider_factory_test
gtest: true
build: test
@@ -5179,24 +5841,58 @@ targets:
- test/core/xds/google_mesh_ca_certificate_provider_factory_test.cc
deps:
- grpc_test_util
-- name: grpc_authorization_engine_test
+- name: graceful_shutdown_test
gtest: true
build: test
language: c++
headers:
- - src/core/lib/security/authorization/authorization_engine.h
- - src/core/lib/security/authorization/evaluate_args.h
- - src/core/lib/security/authorization/grpc_authorization_engine.h
- - src/core/lib/security/authorization/matchers.h
- - src/core/lib/security/authorization/rbac_policy.h
+ - test/core/end2end/cq_verifier.h
+ src:
+ - test/core/end2end/cq_verifier.cc
+ - test/core/transport/chttp2/graceful_shutdown_test.cc
+ deps:
+ - grpc_test_util
+- name: grpc_authorization_engine_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
src:
- - src/core/lib/security/authorization/evaluate_args.cc
- - src/core/lib/security/authorization/grpc_authorization_engine.cc
- - src/core/lib/security/authorization/matchers.cc
- - src/core/lib/security/authorization/rbac_policy.cc
- test/core/security/grpc_authorization_engine_test.cc
deps:
- grpc_test_util
+- name: grpc_authorization_policy_provider_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
+ - src/core/lib/security/authorization/rbac_translator.h
+ src:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ - src/core/lib/security/authorization/rbac_translator.cc
+ - test/core/security/grpc_authorization_policy_provider_test.cc
+ deps:
+ - grpc_test_util
+- name: grpc_authz_end2end_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
+ - src/core/lib/security/authorization/rbac_translator.h
+ - test/cpp/end2end/test_service_impl.h
+ src:
+ - src/proto/grpc/testing/echo.proto
+ - src/proto/grpc/testing/echo_messages.proto
+ - src/proto/grpc/testing/simple_messages.proto
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
+ - src/core/lib/security/authorization/rbac_translator.cc
+ - src/cpp/server/authorization_policy_provider.cc
+ - test/cpp/end2end/grpc_authz_end2end_test.cc
+ - test/cpp/end2end/test_service_impl.cc
+ deps:
+ - grpc++_test_util
- name: grpc_cli
build: test
run: false
@@ -5296,6 +5992,24 @@ targets:
- test/core/security/grpc_tls_certificate_provider_test.cc
deps:
- grpc_test_util
+- name: grpc_tls_certificate_verifier_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/security/grpc_tls_certificate_verifier_test.cc
+ deps:
+ - grpc_test_util
+- name: grpc_tls_credentials_options_comparator_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/security/grpc_tls_credentials_options_comparator_test.cc
+ deps:
+ - grpc_test_util
- name: grpc_tls_credentials_options_test
gtest: true
build: test
@@ -5330,11 +6044,11 @@ targets:
- test/cpp/util/service_describer.cc
deps:
- grpc++_reflection
+ - grpc++_test_config
- grpc++_test_util
platforms:
- linux
- posix
- - mac
- name: grpclb_api_test
gtest: true
build: test
@@ -5351,6 +6065,7 @@ targets:
run: false
language: c++
headers:
+ - test/cpp/end2end/counted_service.h
- test/cpp/end2end/test_service_impl.h
src:
- src/proto/grpc/lb/v1/load_balancer.proto
@@ -5361,6 +6076,7 @@ targets:
- test/cpp/end2end/grpclb_end2end_test.cc
- test/cpp/end2end/test_service_impl.cc
deps:
+ - grpc++_test_config
- grpc++_test_util
platforms:
- linux
@@ -5419,21 +6135,26 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
-- name: hpack_parser_fuzzer_test
- build: fuzzer
+- name: hpack_parser_table_test
+ gtest: true
+ build: test
language: c++
headers: []
src:
- - test/core/transport/chttp2/hpack_parser_fuzzer_test.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/transport/chttp2/hpack_parser_table_test.cc
deps:
- - absl/flags:flag
- grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/transport/chttp2/hpack_parser_corpus
- dict: test/core/end2end/fuzzers/hpack.dictionary
- maxlen: 512
+ uses_polling: false
+- name: hpack_parser_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/transport/chttp2/hpack_parser_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: http2_client
build: test
run: false
@@ -5447,34 +6168,50 @@ targets:
deps:
- grpc++_test_config
- grpc++_test_util
-- name: http_request_fuzzer_test
- build: fuzzer
+- name: http_proxy_mapper_test
+ gtest: true
+ build: test
language: c++
headers: []
src:
- - test/core/http/request_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/client_channel/http_proxy_mapper_test.cc
deps:
- - absl/flags:flag
- grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/http/request_corpus
- maxlen: 2048
-- name: http_response_fuzzer_test
- build: fuzzer
+ uses_polling: false
+- name: httpcli_test
+ gtest: true
+ build: test
language: c++
- headers: []
+ headers:
+ - test/core/http/httpcli_test_util.h
+ - test/core/util/fake_udp_and_tcp_server.h
src:
- - test/core/http/response_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/http/httpcli_test.cc
+ - test/core/http/httpcli_test_util.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/http/response_corpus
- maxlen: 2048
+ - grpc++_test_util
+ platforms:
+ - linux
+ - posix
+ - mac
+- name: httpscli_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/http/httpcli_test_util.h
+ - test/core/util/fake_udp_and_tcp_server.h
+ src:
+ - test/core/http/httpcli_test_util.cc
+ - test/core/http/httpscli_test.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
+ deps:
+ - grpc++_test_util
+ platforms:
+ - linux
+ - posix
+ - mac
- name: hybrid_end2end_test
gtest: true
build: test
@@ -5490,6 +6227,32 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: idle_filter_state_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/filters/channel_idle/idle_filter_state.h
+ src:
+ - src/core/ext/filters/channel_idle/idle_filter_state.cc
+ - test/core/client_idle/idle_filter_state_test.cc
+ deps: []
+ uses_polling: false
+- name: if_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/if.h
+ - src/core/lib/promise/poll.h
+ src:
+ - test/core/promise/if_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ uses_polling: false
- name: init_test
gtest: true
build: test
@@ -5557,33 +6320,24 @@ targets:
deps:
- grpc++_test_config
- grpc++_test_util
-- name: interop_test
+- name: join_test
+ gtest: true
build: test
language: c++
- headers: []
- src:
- - test/cpp/interop/interop_test.cc
- deps:
- - grpc++_test_config
- - grpc++_test_util
- platforms:
- - linux
- - posix
- - mac
-- name: json_fuzzer_test
- build: fuzzer
- language: c++
- headers: []
+ headers:
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/join.h
+ - src/core/lib/promise/poll.h
src:
- - test/core/json/fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/promise/join_test.cc
deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/json/corpus
- maxlen: 512
+ - absl/types:variant
+ uses_polling: false
- name: json_test
gtest: true
build: test
@@ -5607,6 +6361,40 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
+- name: latch_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/intra_activity_waiter.h
+ - src/core/lib/promise/join.h
+ - src/core/lib/promise/latch.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/seq.h
+ - test/core/promise/test_wakeup_schedulers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/promise/activity.cc
+ - test/core/promise/latch_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
- name: lb_get_cpu_stats_test
gtest: true
build: test
@@ -5654,6 +6442,37 @@ targets:
deps:
- grpc_test_util
uses_polling: false
+- name: loop_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/seq.h
+ src:
+ - test/core/promise/loop_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ uses_polling: false
+- name: match_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/match.h
+ - src/core/lib/gprpp/overload.h
+ src:
+ - test/core/gprpp/match_test.cc
+ deps:
+ - absl/types:variant
+ uses_polling: false
- name: matchers_test
gtest: true
build: test
@@ -5663,6 +6482,67 @@ targets:
- test/core/security/matchers_test.cc
deps:
- grpc_test_util
+- name: memory_quota_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - test/core/resource_quota/call_checker.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/resource_quota/memory_quota_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
- name: message_allocator_end2end_test
gtest: true
build: test
@@ -5677,6 +6557,24 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: metadata_map_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/transport/metadata_map_test.cc
+ deps:
+ - grpc_test_util
+- name: miscompile_with_no_unique_address_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/compiler_bugs/miscompile_with_no_unique_address_test.cc
+ deps: []
+ uses_polling: false
- name: mock_stream_test
gtest: true
build: test
@@ -5704,34 +6602,6 @@ targets:
deps:
- grpc++_test
- grpc++_test_util
-- name: nanopb_fuzzer_response_test
- build: fuzzer
- language: c++
- headers: []
- src:
- - test/core/nanopb/fuzzer_response.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/nanopb/corpus_response
- maxlen: 128
-- name: nanopb_fuzzer_serverlist_test
- build: fuzzer
- language: c++
- headers: []
- src:
- - test/core/nanopb/fuzzer_serverlist.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/nanopb/corpus_serverlist
- maxlen: 128
- name: nonblocking_test
gtest: true
build: test
@@ -5744,17 +6614,77 @@ targets:
- test/cpp/end2end/nonblocking_test.cc
deps:
- grpc++_test_util
-- name: noop-benchmark
+- name: observable_test
+ gtest: true
build: test
language: c++
- headers: []
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/observable.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/promise/wait_set.h
+ - test/core/promise/test_wakeup_schedulers.h
src:
- - test/cpp/microbenchmarks/noop-benchmark.cc
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/promise/activity.cc
+ - test/core/promise/observable_test.cc
deps:
- - benchmark
- - grpc_test_util
- benchmark: true
- defaults: benchmark
+ - absl/container:flat_hash_set
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
+- name: orca_service_end2end_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/upb-generated/google/api/annotations.upb.h
+ - src/core/ext/upb-generated/google/api/http.upb.h
+ - src/core/ext/upb-generated/google/protobuf/any.upb.h
+ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.h
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.h
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.h
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+ - src/core/ext/upb-generated/google/rpc/status.upb.h
+ - src/core/ext/upb-generated/validate/validate.upb.h
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
+ - src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h
+ src:
+ - src/proto/grpc/testing/xds/v3/orca_load_report.proto
+ - src/proto/grpc/testing/xds/v3/orca_service.proto
+ - src/core/ext/upb-generated/google/api/annotations.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
+ - src/core/ext/upb-generated/google/protobuf/duration.upb.c
+ - src/core/ext/upb-generated/google/protobuf/empty.upb.c
+ - src/core/ext/upb-generated/google/protobuf/struct.upb.c
+ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+ - src/core/ext/upb-generated/google/rpc/status.upb.c
+ - src/core/ext/upb-generated/validate/validate.upb.c
+ - src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
+ - src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c
+ - src/cpp/server/orca/orca_service.cc
+ - test/cpp/end2end/orca_service_end2end_test.cc
+ deps:
+ - grpc++_test_util
- name: orphanable_test
gtest: true
build: test
@@ -5777,34 +6707,25 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
-- name: percent_decode_fuzzer
- build: fuzzer
+- name: overload_test
+ gtest: true
+ build: test
language: c++
- headers: []
+ headers:
+ - src/core/lib/gprpp/overload.h
src:
- - test/core/slice/percent_decode_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/slice/percent_decode_corpus
- maxlen: 32
-- name: percent_encode_fuzzer
- build: fuzzer
+ - test/core/gprpp/overload_test.cc
+ deps: []
+ uses_polling: false
+- name: parsed_metadata_test
+ gtest: true
+ build: test
language: c++
headers: []
src:
- - test/core/slice/percent_encode_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/transport/parsed_metadata_test.cc
deps:
- - absl/flags:flag
- grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/slice/percent_encode_corpus
- maxlen: 32
- name: pid_controller_test
gtest: true
build: test
@@ -5814,6 +6735,91 @@ targets:
- test/core/transport/pid_controller_test.cc
deps:
- grpc_test_util
+- name: pipe_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/intra_activity_waiter.h
+ - src/core/lib/promise/join.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/pipe.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/arena.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - test/core/promise/test_wakeup_schedulers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/arena.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/promise/pipe_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
+- name: poll_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/promise/poll.h
+ src:
+ - test/core/promise/poll_test.cc
+ deps:
+ - absl/types:variant
+ uses_polling: false
- name: port_sharing_end2end_test
gtest: true
build: test
@@ -5828,6 +6834,56 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: promise_factory_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/capture.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ src:
+ - test/core/promise/promise_factory_test.cc
+ deps:
+ - absl/functional:bind_front
+ - absl/status:status
+ - absl/types:optional
+ - absl/types:variant
+ - absl/utility:utility
+ uses_polling: false
+- name: promise_map_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ src:
+ - test/core/promise/map_test.cc
+ deps:
+ - absl/status:status
+ - absl/types:optional
+ - absl/types:variant
+ uses_polling: false
+- name: promise_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/promise.h
+ src:
+ - test/core/promise/promise_test.cc
+ deps:
+ - absl/status:status
+ - absl/types:optional
+ - absl/types:variant
+ uses_polling: false
- name: proto_server_reflection_test
gtest: true
build: test
@@ -5938,6 +6994,18 @@ targets:
deps:
- grpc++_test_config
- grpc++_test_util
+- name: race_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ src:
+ - test/core/promise/race_test.cc
+ deps:
+ - absl/types:variant
+ uses_polling: false
- name: raw_end2end_test
gtest: true
build: test
@@ -5953,22 +7021,25 @@ targets:
- test/cpp/end2end/test_service_impl.cc
deps:
- grpc++_test_util
+- name: rbac_service_config_parser_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/ext/filters/rbac/rbac_service_config_parser_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: rbac_translator_test
gtest: true
build: test
language: c++
headers:
- - src/core/lib/security/authorization/authorization_engine.h
- - src/core/lib/security/authorization/evaluate_args.h
- - src/core/lib/security/authorization/grpc_authorization_engine.h
- - src/core/lib/security/authorization/matchers.h
- - src/core/lib/security/authorization/rbac_policy.h
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.h
- src/core/lib/security/authorization/rbac_translator.h
src:
- - src/core/lib/security/authorization/evaluate_args.cc
- - src/core/lib/security/authorization/grpc_authorization_engine.cc
- - src/core/lib/security/authorization/matchers.cc
- - src/core/lib/security/authorization/rbac_policy.cc
+ - src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
- src/core/lib/security/authorization/rbac_translator.cc
- test/core/security/rbac_translator_test.cc
deps:
@@ -6004,6 +7075,95 @@ targets:
- linux
- posix
- mac
+- name: resolve_address_using_ares_resolver_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/util/fake_udp_and_tcp_server.h
+ src:
+ - test/core/iomgr/resolve_address_test.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
+ deps:
+ - grpc_test_util
+ - grpc++_test_config
+- name: resolve_address_using_native_resolver_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/util/fake_udp_and_tcp_server.h
+ src:
+ - test/core/iomgr/resolve_address_test.cc
+ - test/core/util/fake_udp_and_tcp_server.cc
+ deps:
+ - grpc_test_util
+ - grpc++_test_config
+- name: resource_quota_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/cpp_impl_of.h
+ - src/core/lib/gprpp/dual_ref_counted.h
+ - src/core/lib/gprpp/orphanable.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/gprpp/time.h
+ - src/core/lib/iomgr/closure.h
+ - src/core/lib/iomgr/combiner.h
+ - src/core/lib/iomgr/error.h
+ - src/core/lib/iomgr/error_internal.h
+ - src/core/lib/iomgr/exec_ctx.h
+ - src/core/lib/iomgr/executor.h
+ - src/core/lib/iomgr/iomgr_internal.h
+ - src/core/lib/promise/activity.h
+ - src/core/lib/promise/context.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/exec_ctx_wakeup_scheduler.h
+ - src/core/lib/promise/loop.h
+ - src/core/lib/promise/map.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/race.h
+ - src/core/lib/promise/seq.h
+ - src/core/lib/resource_quota/memory_quota.h
+ - src/core/lib/resource_quota/resource_quota.h
+ - src/core/lib/resource_quota/thread_quota.h
+ - src/core/lib/resource_quota/trace.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/event_engine/memory_allocator.cc
+ - src/core/lib/gprpp/time.cc
+ - src/core/lib/iomgr/combiner.cc
+ - src/core/lib/iomgr/error.cc
+ - src/core/lib/iomgr/exec_ctx.cc
+ - src/core/lib/iomgr/executor.cc
+ - src/core/lib/iomgr/iomgr_internal.cc
+ - src/core/lib/promise/activity.cc
+ - src/core/lib/resource_quota/memory_quota.cc
+ - src/core/lib/resource_quota/resource_quota.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - src/core/lib/resource_quota/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/resource_quota/resource_quota_test.cc
+ deps:
+ - absl/status:statusor
+ - absl/types:variant
+ - gpr
+ uses_polling: false
- name: retry_throttle_test
gtest: true
build: test
@@ -6014,6 +7174,37 @@ targets:
deps:
- grpc_test_util
uses_polling: false
+- name: rls_end2end_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/util/test_lb_policies.h
+ - test/cpp/end2end/counted_service.h
+ - test/cpp/end2end/rls_server.h
+ - test/cpp/end2end/test_service_impl.h
+ src:
+ - src/proto/grpc/lookup/v1/rls.proto
+ - src/proto/grpc/testing/duplicate/echo_duplicate.proto
+ - src/proto/grpc/testing/echo.proto
+ - src/proto/grpc/testing/echo_messages.proto
+ - src/proto/grpc/testing/simple_messages.proto
+ - test/core/util/test_lb_policies.cc
+ - test/cpp/end2end/rls_end2end_test.cc
+ - test/cpp/end2end/rls_server.cc
+ - test/cpp/end2end/test_service_impl.cc
+ deps:
+ - grpc++_test_config
+ - grpc++_test_util
+- name: rls_lb_config_parser_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/client_channel/rls_lb_config_parser_test.cc
+ deps:
+ - grpc_test_util
- name: secure_auth_context_test
gtest: true
build: test
@@ -6023,6 +7214,23 @@ targets:
- test/cpp/common/secure_auth_context_test.cc
deps:
- grpc++_test_util
+- name: seq_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/seq.h
+ src:
+ - test/core/promise/seq_test.cc
+ deps:
+ - absl/types:variant
+ uses_polling: false
- name: server_builder_plugin_test
gtest: true
build: test
@@ -6081,6 +7289,16 @@ targets:
- test/core/surface/server_chttp2_test.cc
deps:
- grpc_test_util
+- name: server_config_selector_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/server_config_selector/server_config_selector_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: server_context_test_spouse_test
gtest: true
build: test
@@ -6103,21 +7321,6 @@ targets:
- test/cpp/end2end/server_early_return_test.cc
deps:
- grpc++_test_util
-- name: server_fuzzer
- build: fuzzer
- language: c++
- headers: []
- src:
- - test/core/end2end/fuzzers/server_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/end2end/fuzzers/server_fuzzer_corpus
- dict: test/core/end2end/fuzzers/hpack.dictionary
- maxlen: 2048
- name: server_interceptors_end2end_test
gtest: true
build: test
@@ -6224,29 +7427,133 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
-- name: sockaddr_utils_test
+- name: single_set_ptr_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/upb-generated/google/protobuf/any.upb.h
+ - src/core/ext/upb-generated/google/rpc/status.upb.h
+ - src/core/lib/gpr/alloc.h
+ - src/core/lib/gpr/env.h
+ - src/core/lib/gpr/murmur_hash.h
+ - src/core/lib/gpr/spinlock.h
+ - src/core/lib/gpr/string.h
+ - src/core/lib/gpr/string_windows.h
+ - src/core/lib/gpr/time_precise.h
+ - src/core/lib/gpr/tls.h
+ - src/core/lib/gpr/tmpfile.h
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/gprpp/debug_location.h
+ - src/core/lib/gprpp/examine_stack.h
+ - src/core/lib/gprpp/fork.h
+ - src/core/lib/gprpp/global_config.h
+ - src/core/lib/gprpp/global_config_custom.h
+ - src/core/lib/gprpp/global_config_env.h
+ - src/core/lib/gprpp/global_config_generic.h
+ - src/core/lib/gprpp/host_port.h
+ - src/core/lib/gprpp/manual_constructor.h
+ - src/core/lib/gprpp/memory.h
+ - src/core/lib/gprpp/mpscq.h
+ - src/core/lib/gprpp/single_set_ptr.h
+ - src/core/lib/gprpp/stat.h
+ - src/core/lib/gprpp/status_helper.h
+ - src/core/lib/gprpp/sync.h
+ - src/core/lib/gprpp/thd.h
+ - src/core/lib/gprpp/time_util.h
+ - src/core/lib/profiling/timers.h
+ src:
+ - src/core/ext/upb-generated/google/protobuf/any.upb.c
+ - src/core/ext/upb-generated/google/rpc/status.upb.c
+ - src/core/lib/gpr/alloc.cc
+ - src/core/lib/gpr/atm.cc
+ - src/core/lib/gpr/cpu_iphone.cc
+ - src/core/lib/gpr/cpu_linux.cc
+ - src/core/lib/gpr/cpu_posix.cc
+ - src/core/lib/gpr/cpu_windows.cc
+ - src/core/lib/gpr/env_linux.cc
+ - src/core/lib/gpr/env_posix.cc
+ - src/core/lib/gpr/env_windows.cc
+ - src/core/lib/gpr/log.cc
+ - src/core/lib/gpr/log_android.cc
+ - src/core/lib/gpr/log_linux.cc
+ - src/core/lib/gpr/log_posix.cc
+ - src/core/lib/gpr/log_windows.cc
+ - src/core/lib/gpr/murmur_hash.cc
+ - src/core/lib/gpr/string.cc
+ - src/core/lib/gpr/string_posix.cc
+ - 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_posix.cc
+ - src/core/lib/gpr/sync_windows.cc
+ - src/core/lib/gpr/time.cc
+ - src/core/lib/gpr/time_posix.cc
+ - src/core/lib/gpr/time_precise.cc
+ - src/core/lib/gpr/time_windows.cc
+ - src/core/lib/gpr/tmpfile_msys.cc
+ - src/core/lib/gpr/tmpfile_posix.cc
+ - src/core/lib/gpr/tmpfile_windows.cc
+ - src/core/lib/gpr/wrap_memcpy.cc
+ - src/core/lib/gprpp/examine_stack.cc
+ - src/core/lib/gprpp/fork.cc
+ - src/core/lib/gprpp/global_config_env.cc
+ - src/core/lib/gprpp/host_port.cc
+ - src/core/lib/gprpp/mpscq.cc
+ - src/core/lib/gprpp/stat_posix.cc
+ - src/core/lib/gprpp/stat_windows.cc
+ - src/core/lib/gprpp/status_helper.cc
+ - src/core/lib/gprpp/thd_posix.cc
+ - src/core/lib/gprpp/thd_windows.cc
+ - src/core/lib/gprpp/time_util.cc
+ - src/core/lib/profiling/basic_timers.cc
+ - src/core/lib/profiling/stap_timers.cc
+ - test/core/gprpp/single_set_ptr_test.cc
+ deps:
+ - absl/base:base
+ - absl/base:core_headers
+ - absl/memory:memory
+ - absl/random:random
+ - absl/status:status
+ - absl/strings:cord
+ - absl/strings:str_format
+ - absl/strings:strings
+ - absl/synchronization:synchronization
+ - absl/time:time
+ - absl/types:optional
+ - upb
+ uses_polling: false
+- name: sleep_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/promise/test_wakeup_schedulers.h
+ src:
+ - test/core/promise/sleep_test.cc
+ deps:
+ - grpc
+ uses_polling: false
+- name: smoke_test
gtest: true
build: test
language: c++
headers: []
src:
- - test/core/address_utils/sockaddr_utils_test.cc
+ - test/core/event_engine/smoke_test.cc
deps:
- grpc_test_util
-- name: ssl_server_fuzzer
- build: fuzzer
+- name: sockaddr_utils_test
+ gtest: true
+ build: test
language: c++
headers: []
src:
- - test/core/security/ssl_server_fuzzer.cc
- - test/core/util/fuzzer_corpus_test.cc
+ - test/core/address_utils/sockaddr_utils_test.cc
deps:
- - absl/flags:flag
- grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/security/corpus/ssl_server_corpus
- maxlen: 2048
- name: stack_tracer_test
gtest: true
build: test
@@ -6271,15 +7578,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: static_metadata_test
- gtest: true
- build: test
- language: c++
- headers: []
- src:
- - test/core/transport/static_metadata_test.cc
- deps:
- - grpc_test_util
- name: stats_test
gtest: true
build: test
@@ -6300,16 +7598,6 @@ targets:
deps:
- grpc_test_util
uses_polling: false
-- name: status_metadata_test
- gtest: true
- build: test
- language: c++
- headers: []
- src:
- - test/core/transport/status_metadata_test.cc
- deps:
- - grpc_test_util
- uses_polling: false
- name: status_util_test
gtest: true
build: test
@@ -6352,6 +7640,17 @@ targets:
- linux
- posix
- mac
+- name: streams_not_seen_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/core/end2end/cq_verifier.h
+ src:
+ - test/core/end2end/cq_verifier.cc
+ - test/core/transport/chttp2/streams_not_seen_test.cc
+ deps:
+ - grpc_test_util
- name: string_ref_test
gtest: true
build: test
@@ -6363,13 +7662,75 @@ targets:
- grpc++
- grpc_test_util
uses_polling: false
-- name: test_cpp_client_credentials_test
+- name: table_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/table.h
+ src:
+ - test/core/gprpp/table_test.cc
+ deps:
+ - absl/types:optional
+ - absl/utility:utility
+ uses_polling: false
+- name: test_core_gprpp_time_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/time.h
+ src:
+ - src/core/lib/gprpp/time.cc
+ - test/core/gprpp/time_test.cc
+ deps:
+ - gpr
+ uses_polling: false
+- name: test_core_security_credentials_test
gtest: true
build: test
language: c++
headers: []
src:
+ - test/core/security/credentials_test.cc
+ deps:
+ - grpc_test_util
+- name: test_core_slice_slice_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/slice/slice.h
+ - src/core/lib/slice/slice_internal.h
+ - src/core/lib/slice/slice_refcount.h
+ - src/core/lib/slice/slice_refcount_base.h
+ - src/core/lib/slice/slice_string_helpers.h
+ - test/core/util/build.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/slice/slice.cc
+ - src/core/lib/slice/slice_refcount.cc
+ - src/core/lib/slice/slice_string_helpers.cc
+ - test/core/slice/slice_test.cc
+ - test/core/util/build.cc
+ deps:
+ - gpr
+ uses_polling: false
+- name: test_cpp_client_credentials_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/cpp/util/tls_test_utils.h
+ src:
- test/cpp/client/credentials_test.cc
+ - test/cpp/util/tls_test_utils.cc
deps:
- grpc++
- grpc_test_util
@@ -6377,9 +7738,11 @@ targets:
gtest: true
build: test
language: c++
- headers: []
+ headers:
+ - test/cpp/util/tls_test_utils.h
src:
- test/cpp/server/credentials_test.cc
+ - test/cpp/util/tls_test_utils.cc
deps:
- grpc++
- grpc_test_util
@@ -6413,6 +7776,23 @@ targets:
deps:
- grpc++_test_config
- grpc++_test_util
+- name: thread_quota_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/debug/trace.h
+ - src/core/lib/gprpp/atomic_utils.h
+ - src/core/lib/gprpp/ref_counted.h
+ - src/core/lib/gprpp/ref_counted_ptr.h
+ - src/core/lib/resource_quota/thread_quota.h
+ src:
+ - src/core/lib/debug/trace.cc
+ - src/core/lib/resource_quota/thread_quota.cc
+ - test/core/resource_quota/thread_quota_test.cc
+ deps:
+ - gpr
+ uses_polling: false
- name: thread_stress_test
gtest: true
build: test
@@ -6455,6 +7835,16 @@ targets:
deps:
- grpc_test_util
uses_polling: false
+- name: timeout_encoding_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/transport/timeout_encoding_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: timer_test
gtest: true
build: test
@@ -6465,6 +7855,30 @@ targets:
deps:
- grpc++
- grpc_test_util
+- name: tls_certificate_verifier_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - test/cpp/util/tls_test_utils.h
+ src:
+ - test/cpp/security/tls_certificate_verifier_test.cc
+ - test/cpp/util/tls_test_utils.cc
+ deps:
+ - grpc++
+ - grpc_test_util
+- name: tls_key_export_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - src/proto/grpc/testing/echo.proto
+ - src/proto/grpc/testing/echo_messages.proto
+ - src/proto/grpc/testing/simple_messages.proto
+ - test/cpp/end2end/tls_key_export_test.cc
+ deps:
+ - grpc++_test_util
- name: tls_security_connector_test
gtest: true
build: test
@@ -6474,6 +7888,16 @@ targets:
- test/core/security/tls_security_connector_test.cc
deps:
- grpc_test_util
+- name: tls_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/gpr/tls_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: too_many_pings_test
gtest: true
build: test
@@ -6486,6 +7910,149 @@ targets:
deps:
- grpc++_test_config
- grpc++_test_util
+- name: transport_stream_receiver_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/transport_stream_receiver_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
+- name: try_join_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gpr/useful.h
+ - src/core/lib/gprpp/bitset.h
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/detail/basic_join.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/try_join.h
+ src:
+ - test/core/promise/try_join_test.cc
+ deps:
+ - absl/status:status
+ - absl/status:statusor
+ - absl/types:variant
+ uses_polling: false
+- name: try_seq_metadata_test
+ gtest: true
+ build: test
+ language: c++
+ headers: []
+ src:
+ - test/core/promise/try_seq_metadata_test.cc
+ deps:
+ - grpc
+ uses_polling: false
+- name: try_seq_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gprpp/construct_destruct.h
+ - src/core/lib/promise/detail/basic_seq.h
+ - src/core/lib/promise/detail/promise_factory.h
+ - src/core/lib/promise/detail/promise_like.h
+ - src/core/lib/promise/detail/status.h
+ - src/core/lib/promise/detail/switch.h
+ - src/core/lib/promise/poll.h
+ - src/core/lib/promise/try_seq.h
+ src:
+ - test/core/promise/try_seq_test.cc
+ deps:
+ - absl/status:status
+ - absl/status:statusor
+ - absl/types:variant
+ uses_polling: false
- name: unknown_frame_bad_client_test
gtest: true
build: test
@@ -6499,20 +8066,6 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
-- name: uri_fuzzer_test
- build: fuzzer
- language: c++
- headers: []
- src:
- - test/core/uri/uri_fuzzer_test.cc
- - test/core/util/fuzzer_corpus_test.cc
- deps:
- - absl/flags:flag
- - grpc_test_util
- - grpc++_test_config
- corpus_dirs:
- - test/core/uri/uri_corpus
- maxlen: 128
- name: uri_parser_test
gtest: true
build: test
@@ -6522,6 +8075,16 @@ targets:
- test/core/uri/uri_parser_test.cc
deps:
- grpc_test_util
+- name: useful_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/lib/gpr/useful.h
+ src:
+ - test/core/gpr/useful_test.cc
+ deps: []
+ uses_polling: false
- name: window_overflow_bad_client_test
gtest: true
build: test
@@ -6535,6 +8098,194 @@ targets:
- test/core/end2end/cq_verifier.cc
deps:
- grpc_test_util
+- name: wire_reader_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ - test/core/transport/binder/mock_objects.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/mock_objects.cc
+ - test/core/transport/binder/wire_reader_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
+- name: wire_writer_test
+ gtest: true
+ build: test
+ language: c++
+ headers:
+ - src/core/ext/transport/binder/client/binder_connector.h
+ - src/core/ext/transport/binder/client/channel_create_impl.h
+ - src/core/ext/transport/binder/client/connection_id_generator.h
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.h
+ - src/core/ext/transport/binder/client/jni_utils.h
+ - src/core/ext/transport/binder/client/security_policy_setting.h
+ - src/core/ext/transport/binder/server/binder_server.h
+ - src/core/ext/transport/binder/transport/binder_stream.h
+ - src/core/ext/transport/binder/transport/binder_transport.h
+ - src/core/ext/transport/binder/utils/binder_auto_utils.h
+ - src/core/ext/transport/binder/utils/ndk_binder.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver.h
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
+ - src/core/ext/transport/binder/wire_format/binder.h
+ - src/core/ext/transport/binder/wire_format/binder_android.h
+ - src/core/ext/transport/binder/wire_format/binder_constants.h
+ - src/core/ext/transport/binder/wire_format/transaction.h
+ - src/core/ext/transport/binder/wire_format/wire_reader.h
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.h
+ - src/core/ext/transport/binder/wire_format/wire_writer.h
+ - src/cpp/client/create_channel_internal.h
+ - src/cpp/common/channel_filter.h
+ - src/cpp/server/dynamic_thread_pool.h
+ - src/cpp/server/external_connection_acceptor_impl.h
+ - src/cpp/server/health/default_health_check_service.h
+ - src/cpp/server/thread_pool_interface.h
+ - src/cpp/thread_manager/thread_manager.h
+ - test/core/transport/binder/mock_objects.h
+ src:
+ - src/core/ext/transport/binder/client/binder_connector.cc
+ - src/core/ext/transport/binder/client/channel_create.cc
+ - src/core/ext/transport/binder/client/channel_create_impl.cc
+ - src/core/ext/transport/binder/client/connection_id_generator.cc
+ - src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ - src/core/ext/transport/binder/client/jni_utils.cc
+ - src/core/ext/transport/binder/client/security_policy_setting.cc
+ - src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ - src/core/ext/transport/binder/server/binder_server.cc
+ - src/core/ext/transport/binder/server/binder_server_credentials.cc
+ - src/core/ext/transport/binder/transport/binder_transport.cc
+ - src/core/ext/transport/binder/utils/ndk_binder.cc
+ - src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ - src/core/ext/transport/binder/wire_format/binder_android.cc
+ - src/core/ext/transport/binder/wire_format/binder_constants.cc
+ - src/core/ext/transport/binder/wire_format/transaction.cc
+ - src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ - src/core/ext/transport/binder/wire_format/wire_writer.cc
+ - src/cpp/client/channel_cc.cc
+ - src/cpp/client/client_callback.cc
+ - src/cpp/client/client_context.cc
+ - src/cpp/client/client_interceptor.cc
+ - src/cpp/client/create_channel.cc
+ - src/cpp/client/create_channel_internal.cc
+ - src/cpp/client/create_channel_posix.cc
+ - src/cpp/client/credentials_cc.cc
+ - src/cpp/codegen/codegen_init.cc
+ - src/cpp/common/alarm.cc
+ - src/cpp/common/channel_arguments.cc
+ - src/cpp/common/channel_filter.cc
+ - src/cpp/common/completion_queue_cc.cc
+ - src/cpp/common/core_codegen.cc
+ - src/cpp/common/resource_quota_cc.cc
+ - src/cpp/common/rpc_method.cc
+ - src/cpp/common/validate_service_config.cc
+ - src/cpp/common/version_cc.cc
+ - src/cpp/server/async_generic_service.cc
+ - src/cpp/server/channel_argument_option.cc
+ - src/cpp/server/create_default_thread_pool.cc
+ - src/cpp/server/dynamic_thread_pool.cc
+ - src/cpp/server/external_connection_acceptor_impl.cc
+ - src/cpp/server/health/default_health_check_service.cc
+ - src/cpp/server/health/health_check_service.cc
+ - src/cpp/server/health/health_check_service_server_builder_option.cc
+ - src/cpp/server/server_builder.cc
+ - src/cpp/server/server_callback.cc
+ - src/cpp/server/server_cc.cc
+ - src/cpp/server/server_context.cc
+ - src/cpp/server/server_credentials.cc
+ - src/cpp/server/server_posix.cc
+ - src/cpp/thread_manager/thread_manager.cc
+ - src/cpp/util/byte_buffer_cc.cc
+ - src/cpp/util/status.cc
+ - src/cpp/util/string_ref.cc
+ - src/cpp/util/time_cc.cc
+ - test/core/transport/binder/mock_objects.cc
+ - test/core/transport/binder/wire_writer_test.cc
+ deps:
+ - grpc_test_util
+ uses_polling: false
- name: work_serializer_test
gtest: true
build: test
@@ -6553,12 +8304,13 @@ targets:
build: test
language: c++
headers:
+ - test/core/event_engine/test_init.h
+ - test/core/util/build.h
- test/core/util/cmdline.h
- test/core/util/evaluate_args_test_util.h
- test/core/util/fuzzer_util.h
- test/core/util/grpc_profiler.h
- test/core/util/histogram.h
- - test/core/util/memory_counters.h
- test/core/util/mock_authorization_endpoint.h
- test/core/util/mock_endpoint.h
- test/core/util/parse_hexstring.h
@@ -6573,16 +8325,16 @@ targets:
- test/core/util/test_config.h
- test/core/util/test_tcp_server.h
- test/core/util/tracer_util.h
- - test/core/util/trickle_endpoint.h
src:
- src/proto/grpc/testing/echo.proto
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/simple_messages.proto
+ - test/core/event_engine/test_init.cc
+ - test/core/util/build.cc
- test/core/util/cmdline.cc
- test/core/util/fuzzer_util.cc
- test/core/util/grpc_profiler.cc
- test/core/util/histogram.cc
- - test/core/util/memory_counters.cc
- test/core/util/mock_endpoint.cc
- test/core/util/parse_hexstring.cc
- test/core/util/passthru_endpoint.cc
@@ -6598,7 +8350,6 @@ targets:
- test/core/util/test_config.cc
- test/core/util/test_tcp_server.cc
- test/core/util/tracer_util.cc
- - test/core/util/trickle_endpoint.cc
- test/cpp/performance/writes_per_rpc_test.cc
deps:
- absl/debugging:failure_signal_handler
@@ -6638,7 +8389,7 @@ targets:
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/simple_messages.proto
- test/cpp/end2end/test_service_impl.cc
- - test/cpp/end2end/xds_credentials_end2end_test.cc
+ - test/cpp/end2end/xds/xds_credentials_end2end_test.cc
deps:
- grpc++_test_util
- name: xds_credentials_test
@@ -6657,8 +8408,16 @@ targets:
language: c++
headers:
- src/cpp/server/csds/csds.h
+ - test/cpp/end2end/connection_delay_injector.h
+ - test/cpp/end2end/counted_service.h
+ - test/cpp/end2end/rls_server.h
- test/cpp/end2end/test_service_impl.h
+ - test/cpp/end2end/xds/xds_end2end_test_lib.h
+ - test/cpp/end2end/xds/xds_server.h
+ - test/cpp/util/tls_test_utils.h
src:
+ - src/proto/grpc/lookup/v1/rls.proto
+ - src/proto/grpc/lookup/v1/rls_config.proto
- src/proto/grpc/testing/duplicate/echo_duplicate.proto
- src/proto/grpc/testing/echo.proto
- src/proto/grpc/testing/echo_messages.proto
@@ -6678,24 +8437,36 @@ targets:
- src/proto/grpc/testing/xds/v3/csds.proto
- src/proto/grpc/testing/xds/v3/discovery.proto
- src/proto/grpc/testing/xds/v3/endpoint.proto
+ - src/proto/grpc/testing/xds/v3/expr.proto
+ - src/proto/grpc/testing/xds/v3/extension.proto
- src/proto/grpc/testing/xds/v3/fault.proto
- src/proto/grpc/testing/xds/v3/fault_common.proto
- src/proto/grpc/testing/xds/v3/http_connection_manager.proto
+ - src/proto/grpc/testing/xds/v3/http_filter_rbac.proto
- src/proto/grpc/testing/xds/v3/listener.proto
- src/proto/grpc/testing/xds/v3/load_report.proto
- src/proto/grpc/testing/xds/v3/lrs.proto
+ - src/proto/grpc/testing/xds/v3/metadata.proto
+ - src/proto/grpc/testing/xds/v3/path.proto
- src/proto/grpc/testing/xds/v3/percent.proto
- src/proto/grpc/testing/xds/v3/protocol.proto
- src/proto/grpc/testing/xds/v3/range.proto
+ - src/proto/grpc/testing/xds/v3/rbac.proto
- src/proto/grpc/testing/xds/v3/regex.proto
- src/proto/grpc/testing/xds/v3/route.proto
- src/proto/grpc/testing/xds/v3/router.proto
- src/proto/grpc/testing/xds/v3/string.proto
- src/proto/grpc/testing/xds/v3/tls.proto
- src/cpp/server/csds/csds.cc
+ - test/cpp/end2end/connection_delay_injector.cc
+ - test/cpp/end2end/rls_server.cc
- test/cpp/end2end/test_service_impl.cc
- - test/cpp/end2end/xds_end2end_test.cc
+ - test/cpp/end2end/xds/xds_end2end_test.cc
+ - test/cpp/end2end/xds/xds_end2end_test_lib.cc
+ - test/cpp/end2end/xds/xds_server.cc
+ - test/cpp/util/tls_test_utils.cc
deps:
+ - grpc++_test_config
- grpc++_test_util
platforms:
- linux
diff --git a/grpc/build_config.rb b/grpc/build_config.rb
index 98253e28..9d5cd745 100644
--- a/grpc/build_config.rb
+++ b/grpc/build_config.rb
@@ -13,5 +13,5 @@
# limitations under the License.
module GrpcBuildConfig
- CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-16.dll'
+ CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-24.dll'
end
diff --git a/grpc/build_handwritten.yaml b/grpc/build_handwritten.yaml
index 49a93de5..85c1d9b0 100644
--- a/grpc/build_handwritten.yaml
+++ b/grpc/build_handwritten.yaml
@@ -12,20 +12,12 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
- core_version: 16.0.0
+ core_version: 24.0.0
csharp_major_version: 2
- g_stands_for: guadalupe_river_park_conservancy
- protobuf_version: 3.15.8
- version: 1.38.0
+ g_stands_for: golazo
+ protobuf_version: 3.19.5
+ version: 1.46.5
targets:
-- name: check_epollexclusive
- build: tool
- language: c
- src:
- - test/build/check_epollexclusive.c
- deps:
- - grpc
- - gpr
- name: gen_hpack_tables
build: tool
language: c++
@@ -35,19 +27,6 @@ targets:
- grpc
- gpr
uses_polling: false
-- name: gen_legal_metadata_characters
- build: tool
- language: c++
- src:
- - tools/codegen/core/gen_legal_metadata_characters.cc
- deps: []
-- name: gen_percent_encoding_tables
- build: tool
- language: c++
- src:
- - tools/codegen/core/gen_percent_encoding_tables.cc
- deps: []
- uses_polling: false
configs:
asan:
CC: clang
@@ -178,14 +157,14 @@ configs:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
abseil:
- CPPFLAGS: -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
+ CPPFLAGS: -g -Ithird_party/abseil-cpp
ares:
CFLAGS: -g
- CPPFLAGS: -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE
- $(if $(subst Darwin,,$(SYSTEM)),,-Ithird_party/cares/config_darwin) $(if $(subst
- FreeBSD,,$(SYSTEM)),,-Ithird_party/cares/config_freebsd) $(if $(subst Linux,,$(SYSTEM)),,-Ithird_party/cares/config_linux)
- $(if $(subst OpenBSD,,$(SYSTEM)),,-Ithird_party/cares/config_openbsd) -DWIN32_LEAN_AND_MEAN
- -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(if $(subst MINGW32,,$(SYSTEM)),-DHAVE_CONFIG_H,)
+ CPPFLAGS: -Ithird_party/cares/cares/include -Ithird_party/cares -Ithird_party/cares/cares
+ -fvisibility=hidden -D_GNU_SOURCE $(if $(subst Darwin,,$(SYSTEM)),,-Ithird_party/cares/config_darwin)
+ $(if $(subst FreeBSD,,$(SYSTEM)),,-Ithird_party/cares/config_freebsd) $(if $(subst
+ Linux,,$(SYSTEM)),,-Ithird_party/cares/config_linux) $(if $(subst OpenBSD,,$(SYSTEM)),,-Ithird_party/cares/config_openbsd)
+ -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX $(if $(subst MINGW32,,$(SYSTEM)),-DHAVE_CONFIG_H,)
benchmark:
CPPFLAGS: -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX
boringssl:
diff --git a/grpc/cmake/abseil-cpp.cmake b/grpc/cmake/abseil-cpp.cmake
index 078d4954..c89ba26f 100644
--- a/grpc/cmake/abseil-cpp.cmake
+++ b/grpc/cmake/abseil-cpp.cmake
@@ -17,15 +17,12 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module")
set(ABSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp)
endif()
if(EXISTS "${ABSL_ROOT_DIR}/CMakeLists.txt")
- add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
- if(TARGET absl_base)
- if(gRPC_INSTALL AND _gRPC_INSTALL_SUPPORTED_FROM_MODULE)
- install(TARGETS ${gRPC_ABSL_USED_TARGETS} EXPORT gRPCTargets
- RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
- LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR})
- endif()
+ if(gRPC_INSTALL)
+ # When gRPC_INSTALL is enabled and Abseil will be built as a module,
+ # Abseil will be installed along with gRPC for convenience.
+ set(ABSL_ENABLE_INSTALL ON)
endif()
+ add_subdirectory(${ABSL_ROOT_DIR} third_party/abseil-cpp)
else()
message(WARNING "gRPC_ABSL_PROVIDER is \"module\" but ABSL_ROOT_DIR is wrong")
endif()
@@ -36,5 +33,5 @@ if(gRPC_ABSL_PROVIDER STREQUAL "module")
elseif(gRPC_ABSL_PROVIDER STREQUAL "package")
# Use "CONFIG" as there is no built-in cmake module for absl.
find_package(absl REQUIRED CONFIG)
- set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()")
endif()
+set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()")
diff --git a/grpc/cmake/ccache.cmake b/grpc/cmake/ccache.cmake
new file mode 100644
index 00000000..351fab05
--- /dev/null
+++ b/grpc/cmake/ccache.cmake
@@ -0,0 +1,38 @@
+# Copyright 2022 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.
+
+# Configure ccache if requested by environment variable GRPC_BUILD_ENABLE_CCACHE
+
+if ($ENV{GRPC_BUILD_ENABLE_CCACHE})
+ find_program(gRPC_CCACHE_BINARY ccache)
+ if(gRPC_CCACHE_BINARY)
+ message(STATUS "Will use ccache as compiler launcher: ${gRPC_CCACHE_BINARY}")
+ set(CMAKE_C_COMPILER_LAUNCHER ${gRPC_CCACHE_BINARY})
+ set(CMAKE_CXX_COMPILER_LAUNCHER ${gRPC_CCACHE_BINARY})
+
+ # avoid conflicts when multiple processes try to write to PDB files. Instead make debug info part of object files.
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
+ string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+ string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
+ elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+ string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+ string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+ endif()
+ else()
+ message(STATUS "Build will not use ccache (ccache binary not found).")
+ endif()
+endif() \ No newline at end of file
diff --git a/grpc/config.m4 b/grpc/config.m4
index 59653584..f6bcd8ad 100644
--- a/grpc/config.m4
+++ b/grpc/config.m4
@@ -18,7 +18,7 @@ if test "$PHP_GRPC" != "no"; then
LIBS="-lpthread $LIBS"
- CFLAGS="-Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std=c11 -g -O2"
+ CFLAGS="-std=c11 -g -O2"
CXXFLAGS="-std=c++11 -fno-exceptions -fno-rtti -g -O2"
GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD"
PHP_REQUIRE_CXX()
@@ -41,6 +41,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_NEW_EXTENSION(grpc,
src/core/ext/filters/census/grpc_context.cc \
+ src/core/ext/filters/channel_idle/channel_idle_filter.cc \
+ src/core/ext/filters/channel_idle/idle_filter_state.cc \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backup_poller.cc \
src/core/ext/filters/client_channel/channel_connectivity.cc \
@@ -60,12 +62,12 @@ if test "$PHP_GRPC" != "no"; then
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_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/ring_hash/ring_hash.cc \
+ src/core/ext/filters/client_channel/lb_policy/rls/rls.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/xds/cds.cc \
@@ -75,33 +77,30 @@ if test "$PHP_GRPC" != "no"; then
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 \
- src/core/ext/filters/client_channel/resolver.cc \
+ src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc \
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc \
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
+ src/core/ext/filters/client_channel/resolver/polling_resolver.cc \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \
- src/core/ext/filters/client_channel/resolver_registry.cc \
src/core/ext/filters/client_channel/resolver_result_parsing.cc \
src/core/ext/filters/client_channel/retry_filter.cc \
src/core/ext/filters/client_channel/retry_service_config.cc \
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/subchannel.cc \
src/core/ext/filters/client_channel/subchannel_pool_interface.cc \
- src/core/ext/filters/client_idle/client_idle_filter.cc \
+ src/core/ext/filters/client_channel/subchannel_stream_client.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/fault_injection/fault_injection_filter.cc \
src/core/ext/filters/fault_injection/service_config_parser.cc \
@@ -111,23 +110,16 @@ if test "$PHP_GRPC" != "no"; then
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/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 \
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
- src/core/ext/filters/workarounds/workaround_utils.cc \
+ src/core/ext/filters/rbac/rbac_filter.cc \
+ src/core/ext/filters/rbac/rbac_service_config_parser.cc \
+ src/core/ext/filters/server_config_selector/server_config_selector.cc \
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \
- src/core/ext/transport/chttp2/client/authority.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
- src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
- src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
- src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc \
- src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc \
- src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc \
src/core/ext/transport/chttp2/transport/bin_decoder.cc \
src/core/ext/transport/chttp2/transport/bin_encoder.cc \
- src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \
src/core/ext/transport/chttp2/transport/chttp2_transport.cc \
src/core/ext/transport/chttp2/transport/context_list.cc \
src/core/ext/transport/chttp2/transport/flow_control.cc \
@@ -138,11 +130,11 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
- src/core/ext/transport/chttp2/transport/hpack_table.cc \
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
src/core/ext/transport/chttp2/transport/huffsyms.cc \
- src/core/ext/transport/chttp2/transport/incoming_metadata.cc \
src/core/ext/transport/chttp2/transport/parsing.cc \
src/core/ext/transport/chttp2/transport/stream_lists.cc \
src/core/ext/transport/chttp2/transport/stream_map.cc \
@@ -150,7 +142,16 @@ if test "$PHP_GRPC" != "no"; then
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/admin/v3/certs.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c \
+ src/core/ext/upb-generated/envoy/admin/v3/tap.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 \
@@ -159,51 +160,67 @@ if test "$PHP_GRPC" != "no"; then
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/common/matcher/v3/matcher.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_method_list.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/resolver.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/core/v3/udp_socket_config.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/quic_config.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c \
+ src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c \
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c \
src/core/ext/upb-generated/envoy/config/overload/v3/overload.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/tap/v3/common.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c \
+ src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c \
+ src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.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/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.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/service/status/v3/csds.upb.c \
+ src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c \
+ src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c \
+ src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c \
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c \
src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c \
src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c \
@@ -214,14 +231,19 @@ if test "$PHP_GRPC" != "no"; then
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/hash_policy.upb.c \
src/core/ext/upb-generated/envoy/type/v3/http.upb.c \
+ src/core/ext/upb-generated/envoy/type/v3/http_status.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/ratelimit_unit.upb.c \
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c \
+ src/core/ext/upb-generated/envoy/type/v3/token_bucket.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/http.upb.c \
+ src/core/ext/upb-generated/google/api/httpbody.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
@@ -230,26 +252,47 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.c \
+ src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c \
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \
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/src/proto/grpc/lookup/v1/rls.upb.c \
+ src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.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/data/orca/v1/orca_load_report.upb.c \
- src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
+ src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c \
+ src/core/ext/upb-generated/xds/annotations/v3/security.upb.c \
+ src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c \
+ src/core/ext/upb-generated/xds/annotations/v3/status.upb.c \
+ src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c \
src/core/ext/upb-generated/xds/core/v3/context_params.upb.c \
+ src/core/ext/upb-generated/xds/core/v3/extension.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c \
+ src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c \
+ src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c \
+ src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c \
+ src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c \
+ src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c \
@@ -258,50 +301,67 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c \
- src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c \
- src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c \
- src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c \
- src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c \
- src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c \
@@ -312,12 +372,19 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c \
+ src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c \
+ src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c \
+ src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c \
+ src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c \
@@ -326,55 +393,79 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c \
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c \
+ src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c \
+ src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
- src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c \
+ src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c \
src/core/ext/xds/certificate_provider_registry.cc \
src/core/ext/xds/certificate_provider_store.cc \
src/core/ext/xds/file_watcher_certificate_provider_factory.cc \
src/core/ext/xds/xds_api.cc \
src/core/ext/xds/xds_bootstrap.cc \
src/core/ext/xds/xds_certificate_provider.cc \
+ src/core/ext/xds/xds_channel_stack_modifier.cc \
src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client_stats.cc \
+ src/core/ext/xds/xds_cluster.cc \
+ src/core/ext/xds/xds_cluster_specifier_plugin.cc \
+ src/core/ext/xds/xds_common_types.cc \
+ src/core/ext/xds/xds_endpoint.cc \
src/core/ext/xds/xds_http_fault_filter.cc \
src/core/ext/xds/xds_http_filters.cc \
+ src/core/ext/xds/xds_http_rbac_filter.cc \
+ src/core/ext/xds/xds_listener.cc \
+ src/core/ext/xds/xds_resource_type.cc \
+ src/core/ext/xds/xds_route_config.cc \
+ src/core/ext/xds/xds_routing.cc \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
- src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
src/core/lib/channel/channel_args.cc \
+ src/core/lib/channel/channel_args_preconditioning.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
+ src/core/lib/channel/channel_stack_builder_impl.cc \
src/core/lib/channel/channel_trace.cc \
src/core/lib/channel/channelz.cc \
src/core/lib/channel/channelz_registry.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_registry.cc \
+ src/core/lib/channel/promise_based_filter.cc \
src/core/lib/channel/status_util.cc \
src/core/lib/compression/compression.cc \
- src/core/lib/compression/compression_args.cc \
src/core/lib/compression/compression_internal.cc \
src/core/lib/compression/message_compress.cc \
- src/core/lib/compression/stream_compression.cc \
- src/core/lib/compression/stream_compression_gzip.cc \
- src/core/lib/compression/stream_compression_identity.cc \
+ src/core/lib/config/core_configuration.cc \
src/core/lib/debug/stats.cc \
src/core/lib/debug/stats_data.cc \
src/core/lib/debug/trace.cc \
- src/core/lib/event_engine/slice_allocator.cc \
+ src/core/lib/event_engine/channel_args_endpoint_config.cc \
+ src/core/lib/event_engine/default_event_engine_factory.cc \
+ src/core/lib/event_engine/event_engine.cc \
+ src/core/lib/event_engine/memory_allocator.cc \
+ src/core/lib/event_engine/resolved_address.cc \
src/core/lib/event_engine/sockaddr.cc \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/atm.cc \
@@ -403,12 +494,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gpr/time_posix.cc \
src/core/lib/gpr/time_precise.cc \
src/core/lib/gpr/time_windows.cc \
- src/core/lib/gpr/tls_pthread.cc \
src/core/lib/gpr/tmpfile_msys.cc \
src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/wrap_memcpy.cc \
- src/core/lib/gprpp/arena.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
@@ -419,6 +508,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/status_helper.cc \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
+ src/core/lib/gprpp/time.cc \
src/core/lib/gprpp/time_util.cc \
src/core/lib/http/format_request.cc \
src/core/lib/http/httpcli.cc \
@@ -431,17 +521,24 @@ if test "$PHP_GRPC" != "no"; then
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_event_engine.cc \
src/core/lib/iomgr/endpoint_pair_posix.cc \
- src/core/lib/iomgr/endpoint_pair_uv.cc \
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_epoll1_linux.cc \
- src/core/lib/iomgr/ev_epollex_linux.cc \
src/core/lib/iomgr/ev_poll_posix.cc \
src/core/lib/iomgr/ev_posix.cc \
src/core/lib/iomgr/ev_windows.cc \
+ src/core/lib/iomgr/event_engine/closure.cc \
+ src/core/lib/iomgr/event_engine/endpoint.cc \
+ src/core/lib/iomgr/event_engine/iomgr.cc \
+ src/core/lib/iomgr/event_engine/pollset.cc \
+ src/core/lib/iomgr/event_engine/resolved_address_internal.cc \
+ src/core/lib/iomgr/event_engine/resolver.cc \
+ src/core/lib/iomgr/event_engine/tcp.cc \
+ src/core/lib/iomgr/event_engine/timer.cc \
src/core/lib/iomgr/exec_ctx.cc \
src/core/lib/iomgr/executor.cc \
src/core/lib/iomgr/executor/mpmcqueue.cc \
@@ -456,60 +553,45 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/internal_errqueue.cc \
src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iomgr.cc \
- src/core/lib/iomgr/iomgr_custom.cc \
src/core/lib/iomgr/iomgr_internal.cc \
src/core/lib/iomgr/iomgr_posix.cc \
src/core/lib/iomgr/iomgr_posix_cfstream.cc \
- src/core/lib/iomgr/iomgr_uv.cc \
src/core/lib/iomgr/iomgr_windows.cc \
- 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/polling_entity.cc \
src/core/lib/iomgr/pollset.cc \
- src/core/lib/iomgr/pollset_custom.cc \
src/core/lib/iomgr/pollset_set.cc \
- src/core/lib/iomgr/pollset_set_custom.cc \
src/core/lib/iomgr/pollset_set_windows.cc \
- src/core/lib/iomgr/pollset_uv.cc \
src/core/lib/iomgr/pollset_windows.cc \
src/core/lib/iomgr/resolve_address.cc \
- src/core/lib/iomgr/resolve_address_custom.cc \
src/core/lib/iomgr/resolve_address_posix.cc \
src/core/lib/iomgr/resolve_address_windows.cc \
- src/core/lib/iomgr/resource_quota.cc \
+ src/core/lib/iomgr/sockaddr_utils_posix.cc \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_mutator.cc \
src/core/lib/iomgr/socket_utils_common_posix.cc \
src/core/lib/iomgr/socket_utils_linux.cc \
src/core/lib/iomgr/socket_utils_posix.cc \
- src/core/lib/iomgr/socket_utils_uv.cc \
src/core/lib/iomgr/socket_utils_windows.cc \
src/core/lib/iomgr/socket_windows.cc \
src/core/lib/iomgr/tcp_client.cc \
src/core/lib/iomgr/tcp_client_cfstream.cc \
- src/core/lib/iomgr/tcp_client_custom.cc \
src/core/lib/iomgr/tcp_client_posix.cc \
src/core/lib/iomgr/tcp_client_windows.cc \
- src/core/lib/iomgr/tcp_custom.cc \
src/core/lib/iomgr/tcp_posix.cc \
src/core/lib/iomgr/tcp_server.cc \
- src/core/lib/iomgr/tcp_server_custom.cc \
src/core/lib/iomgr/tcp_server_posix.cc \
src/core/lib/iomgr/tcp_server_utils_posix_common.cc \
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc \
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc \
src/core/lib/iomgr/tcp_server_windows.cc \
- src/core/lib/iomgr/tcp_uv.cc \
src/core/lib/iomgr/tcp_windows.cc \
src/core/lib/iomgr/time_averaged_stats.cc \
src/core/lib/iomgr/timer.cc \
- src/core/lib/iomgr/timer_custom.cc \
src/core/lib/iomgr/timer_generic.cc \
src/core/lib/iomgr/timer_heap.cc \
src/core/lib/iomgr/timer_manager.cc \
- src/core/lib/iomgr/timer_uv.cc \
- src/core/lib/iomgr/udp_server.cc \
src/core/lib/iomgr/unix_sockets_posix.cc \
src/core/lib/iomgr/unix_sockets_posix_noop.cc \
src/core/lib/iomgr/wakeup_fd_eventfd.cc \
@@ -523,6 +605,23 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/matchers/matchers.cc \
src/core/lib/profiling/basic_timers.cc \
src/core/lib/profiling/stap_timers.cc \
+ src/core/lib/promise/activity.cc \
+ src/core/lib/promise/sleep.cc \
+ src/core/lib/resolver/resolver.cc \
+ src/core/lib/resolver/resolver_registry.cc \
+ src/core/lib/resolver/server_address.cc \
+ src/core/lib/resource_quota/api.cc \
+ src/core/lib/resource_quota/arena.cc \
+ src/core/lib/resource_quota/memory_quota.cc \
+ src/core/lib/resource_quota/resource_quota.cc \
+ src/core/lib/resource_quota/thread_quota.cc \
+ src/core/lib/resource_quota/trace.cc \
+ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc \
+ src/core/lib/security/authorization/evaluate_args.cc \
+ src/core/lib/security/authorization/grpc_authorization_engine.cc \
+ src/core/lib/security/authorization/grpc_server_authz_filter.cc \
+ src/core/lib/security/authorization/matchers.cc \
+ src/core/lib/security/authorization/rbac_policy.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 \
@@ -532,9 +631,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \
+ src/core/lib/security/credentials/call_creds_util.cc \
+ src/core/lib/security/credentials/channel_creds_registry_init.cc \
src/core/lib/security/credentials/composite/composite_credentials.cc \
src/core/lib/security/credentials/credentials.cc \
- src/core/lib/security/credentials/credentials_metadata.cc \
src/core/lib/security/credentials/external/aws_external_account_credentials.cc \
src/core/lib/security/credentials/external/aws_request_signer.cc \
src/core/lib/security/credentials/external/external_account_credentials.cc \
@@ -554,6 +654,7 @@ if test "$PHP_GRPC" != "no"; then
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_provider.cc \
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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/tls/tls_utils.cc \
@@ -575,13 +676,18 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/transport/server_auth_filter.cc \
src/core/lib/security/transport/tsi_error.cc \
src/core/lib/security/util/json_util.cc \
+ src/core/lib/service_config/service_config_impl.cc \
+ src/core/lib/service_config/service_config_parser.cc \
src/core/lib/slice/b64.cc \
src/core/lib/slice/percent_encoding.cc \
src/core/lib/slice/slice.cc \
+ src/core/lib/slice/slice_api.cc \
src/core/lib/slice/slice_buffer.cc \
- src/core/lib/slice/slice_intern.cc \
+ src/core/lib/slice/slice_refcount.cc \
+ src/core/lib/slice/slice_split.cc \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/surface/api_trace.cc \
+ src/core/lib/surface/builtins.cc \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
@@ -595,28 +701,24 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/surface/completion_queue_factory.cc \
src/core/lib/surface/event_string.cc \
src/core/lib/surface/init.cc \
- src/core/lib/surface/init_secure.cc \
src/core/lib/surface/lame_client.cc \
src/core/lib/surface/metadata_array.cc \
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/bdp_estimator.cc \
src/core/lib/transport/byte_stream.cc \
src/core/lib/transport/connectivity_state.cc \
src/core/lib/transport/error_utils.cc \
- src/core/lib/transport/metadata.cc \
- src/core/lib/transport/metadata_batch.cc \
+ src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/pid_controller.cc \
- src/core/lib/transport/static_metadata.cc \
src/core/lib/transport/status_conversion.cc \
- src/core/lib/transport/status_metadata.cc \
src/core/lib/transport/timeout_encoding.cc \
src/core/lib/transport/transport.cc \
src/core/lib/transport/transport_op_string.cc \
src/core/lib/uri/uri_parser.cc \
src/core/plugin_registry/grpc_plugin_registry.cc \
+ src/core/plugin_registry/grpc_plugin_registry_extra.cc \
src/core/tsi/alts/crypt/aes_gcm.cc \
src/core/tsi/alts/crypt/gsec.cc \
src/core/tsi/alts/frame_protector/alts_counter.cc \
@@ -638,6 +740,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc \
src/core/tsi/fake_transport_security.cc \
src/core/tsi/local_transport_security.cc \
+ src/core/tsi/ssl/key_logging/ssl_key_logging.cc \
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \
src/core/tsi/ssl/session_cache/ssl_session_cache.cc \
src/core/tsi/ssl/session_cache/ssl_session_openssl.cc \
@@ -655,7 +758,6 @@ if test "$PHP_GRPC" != "no"; then
src/php/ext/grpc/server_credentials.c \
src/php/ext/grpc/timeval.c \
third_party/abseil-cpp/absl/base/internal/cycleclock.cc \
- third_party/abseil-cpp/absl/base/internal/exponential_biased.cc \
third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc \
third_party/abseil-cpp/absl/base/internal/raw_logging.cc \
third_party/abseil-cpp/absl/base/internal/spinlock.cc \
@@ -676,8 +778,20 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/debugging/symbolize.cc \
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
- third_party/abseil-cpp/absl/hash/internal/wyhash.cc \
+ third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
third_party/abseil-cpp/absl/numeric/int128.cc \
+ third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc \
+ third_party/abseil-cpp/absl/random/discrete_distribution.cc \
+ third_party/abseil-cpp/absl/random/gaussian_distribution.cc \
+ third_party/abseil-cpp/absl/random/internal/pool_urbg.cc \
+ third_party/abseil-cpp/absl/random/internal/randen.cc \
+ third_party/abseil-cpp/absl/random/internal/randen_detect.cc \
+ third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc \
+ third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc \
+ third_party/abseil-cpp/absl/random/internal/randen_slow.cc \
+ third_party/abseil-cpp/absl/random/internal/seed_material.cc \
+ third_party/abseil-cpp/absl/random/seed_gen_exception.cc \
+ third_party/abseil-cpp/absl/random/seed_sequences.cc \
third_party/abseil-cpp/absl/status/status.cc \
third_party/abseil-cpp/absl/status/status_payload_printer.cc \
third_party/abseil-cpp/absl/status/statusor.cc \
@@ -688,7 +802,14 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc \
third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc \
third_party/abseil-cpp/absl/strings/internal/cord_internal.cc \
+ third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc \
+ third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc \
+ third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc \
+ third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc \
third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc \
+ third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc \
+ third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc \
+ third_party/abseil-cpp/absl/strings/internal/cordz_info.cc \
third_party/abseil-cpp/absl/strings/internal/escaping.cc \
third_party/abseil-cpp/absl/strings/internal/memutil.cc \
third_party/abseil-cpp/absl/strings/internal/ostringstream.cc \
@@ -747,6 +868,7 @@ if test "$PHP_GRPC" != "no"; then
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_strex.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 \
@@ -755,7 +877,6 @@ if test "$PHP_GRPC" != "no"; then
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 \
@@ -887,13 +1008,13 @@ if test "$PHP_GRPC" != "no"; then
third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.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/name_print.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 \
@@ -972,6 +1093,7 @@ if test "$PHP_GRPC" != "no"; then
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/encrypted_client_hello.cc \
+ third_party/boringssl-with-bazel/src/ssl/extensions.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 \
@@ -994,7 +1116,6 @@ if test "$PHP_GRPC" != "no"; then
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 \
@@ -1024,10 +1145,14 @@ if test "$PHP_GRPC" != "no"; then
third_party/re2/util/pcre.cc \
third_party/re2/util/rune.cc \
third_party/re2/util/strutil.cc \
+ third_party/upb/third_party/utf8_range/naive.c \
+ third_party/upb/third_party/utf8_range/range2-neon.c \
+ third_party/upb/third_party/utf8_range/range2-sse.c \
third_party/upb/upb/decode.c \
third_party/upb/upb/decode_fast.c \
third_party/upb/upb/def.c \
third_party/upb/upb/encode.c \
+ third_party/upb/upb/json_encode.c \
third_party/upb/upb/msg.c \
third_party/upb/upb/reflection.c \
third_party/upb/upb/table.c \
@@ -1036,9 +1161,12 @@ if test "$PHP_GRPC" != "no"; then
, $ext_shared, , -fvisibility=hidden \
-DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \
-D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \
- -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1)
+ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \
+ -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"\"PHP\""' \
+ -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.46.5\""')
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/census)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/channel_idle)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/health)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy)
@@ -1046,9 +1174,12 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/priority)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/ring_hash)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/rls)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/weighted_target)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/xds)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/binder)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native)
@@ -1056,23 +1187,18 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/google_c2p)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/xds)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_idle)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/fault_injection)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/message_compress)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/server)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/message_size)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/workarounds)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/rbac)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/server_config_selector)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/secure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/insecure)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/inproc)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/admin/v3)
@@ -1080,6 +1206,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/accesslog/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/bootstrap/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/cluster/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/common/matcher/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/core/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/endpoint/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/listener/v3)
@@ -1087,20 +1214,19 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/overload/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/route/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/tap/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/cluster/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/discovery/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/endpoint/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/listener/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/load_stats/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/status/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type/http/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type/matcher/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type/metadata/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type/tracing/v3)
@@ -1109,66 +1235,81 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/api/expr/v1alpha1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/protobuf)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/rpc)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/opencensus/proto/trace/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lookup/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/annotations)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/data/orca/v1)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/type/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/annotations/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/core/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/data/orca/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/type/matcher/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/type/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/admin/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/annotations)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/cluster/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/core/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/listener/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/metrics/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/overload/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/route/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/tap/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/cluster/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/discovery/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/listener/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/status/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/type/http/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/type/matcher/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/type/metadata/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/type/tracing/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/type/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/api)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/protobuf)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/rpc)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/udpa/annotations)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/udpa/type/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/validate)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/annotations/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/core/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/type/matcher/v3)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/type/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/xds)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/address_utils)
- PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/compression)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/config)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/debug)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/event_engine)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/event_engine)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/executor)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/matchers)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/promise)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/resolver)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/resource_quota)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/authorization)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/context)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/credentials)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/credentials/alts)
@@ -1194,6 +1335,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/security_connector/tls)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/transport)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security/util)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/service_config)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/slice)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/transport)
@@ -1204,6 +1346,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/frame_protector)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/handshaker)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/zero_copy_frame_protector)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/key_logging)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache)
PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/base)
@@ -1213,6 +1356,9 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/debugging/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/hash/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/numeric)
+ PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/profiling/internal)
+ PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/random)
+ PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/random/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/status)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/strings/internal)
@@ -1268,5 +1414,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/ssl)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/re2)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/util)
+ PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/third_party/utf8_range)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb)
fi
diff --git a/grpc/config.w32 b/grpc/config.w32
index 1e65f5bf..7ebeebc8 100644
--- a/grpc/config.w32
+++ b/grpc/config.w32
@@ -7,6 +7,8 @@ if (PHP_GRPC != "no") {
EXTENSION("grpc",
"src\\core\\ext\\filters\\census\\grpc_context.cc " +
+ "src\\core\\ext\\filters\\channel_idle\\channel_idle_filter.cc " +
+ "src\\core\\ext\\filters\\channel_idle\\idle_filter_state.cc " +
"src\\core\\ext\\filters\\client_channel\\backend_metric.cc " +
"src\\core\\ext\\filters\\client_channel\\backup_poller.cc " +
"src\\core\\ext\\filters\\client_channel\\channel_connectivity.cc " +
@@ -26,12 +28,12 @@ if (PHP_GRPC != "no") {
"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_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\\ring_hash\\ring_hash.cc " +
+ "src\\core\\ext\\filters\\client_channel\\lb_policy\\rls\\rls.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\\xds\\cds.cc " +
@@ -41,33 +43,30 @@ if (PHP_GRPC != "no") {
"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 " +
- "src\\core\\ext\\filters\\client_channel\\resolver.cc " +
+ "src\\core\\ext\\filters\\client_channel\\resolver\\binder\\binder_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " +
- "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_libuv.cc " +
+ "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_event_engine.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_posix.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_ev_driver_windows.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper.cc " +
- "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_libuv.cc " +
+ "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_event_engine.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_posix.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_windows.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\google_c2p\\google_c2p_resolver.cc " +
+ "src\\core\\ext\\filters\\client_channel\\resolver\\polling_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\xds\\xds_resolver.cc " +
- "src\\core\\ext\\filters\\client_channel\\resolver_registry.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver_result_parsing.cc " +
"src\\core\\ext\\filters\\client_channel\\retry_filter.cc " +
"src\\core\\ext\\filters\\client_channel\\retry_service_config.cc " +
"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\\subchannel.cc " +
"src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " +
- "src\\core\\ext\\filters\\client_idle\\client_idle_filter.cc " +
+ "src\\core\\ext\\filters\\client_channel\\subchannel_stream_client.cc " +
"src\\core\\ext\\filters\\deadline\\deadline_filter.cc " +
"src\\core\\ext\\filters\\fault_injection\\fault_injection_filter.cc " +
"src\\core\\ext\\filters\\fault_injection\\service_config_parser.cc " +
@@ -77,23 +76,16 @@ if (PHP_GRPC != "no") {
"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\\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 " +
- "src\\core\\ext\\filters\\workarounds\\workaround_cronet_compression_filter.cc " +
- "src\\core\\ext\\filters\\workarounds\\workaround_utils.cc " +
+ "src\\core\\ext\\filters\\rbac\\rbac_filter.cc " +
+ "src\\core\\ext\\filters\\rbac\\rbac_service_config_parser.cc " +
+ "src\\core\\ext\\filters\\server_config_selector\\server_config_selector.cc " +
+ "src\\core\\ext\\filters\\server_config_selector\\server_config_selector_filter.cc " +
"src\\core\\ext\\transport\\chttp2\\alpn\\alpn.cc " +
- "src\\core\\ext\\transport\\chttp2\\client\\authority.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " +
- "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " +
- "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " +
- "src\\core\\ext\\transport\\chttp2\\client\\secure\\secure_channel_create.cc " +
"src\\core\\ext\\transport\\chttp2\\server\\chttp2_server.cc " +
- "src\\core\\ext\\transport\\chttp2\\server\\insecure\\server_chttp2.cc " +
- "src\\core\\ext\\transport\\chttp2\\server\\insecure\\server_chttp2_posix.cc " +
- "src\\core\\ext\\transport\\chttp2\\server\\secure\\server_secure_chttp2.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\bin_decoder.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\bin_encoder.cc " +
- "src\\core\\ext\\transport\\chttp2\\transport\\chttp2_plugin.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\chttp2_transport.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\context_list.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\flow_control.cc " +
@@ -104,11 +96,11 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\transport\\chttp2\\transport\\frame_settings.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\frame_window_update.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_encoder.cc " +
+ "src\\core\\ext\\transport\\chttp2\\transport\\hpack_encoder_table.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_parser.cc " +
- "src\\core\\ext\\transport\\chttp2\\transport\\hpack_table.cc " +
+ "src\\core\\ext\\transport\\chttp2\\transport\\hpack_parser_table.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\http2_settings.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\huffsyms.cc " +
- "src\\core\\ext\\transport\\chttp2\\transport\\incoming_metadata.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\parsing.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\stream_lists.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\stream_map.cc " +
@@ -116,7 +108,16 @@ if (PHP_GRPC != "no") {
"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\\admin\\v3\\certs.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\clusters.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\config_dump.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\init_dump.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\listeners.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\memory.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\metrics.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\mutex_stats.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\server_info.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\admin\\v3\\tap.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 " +
@@ -125,51 +126,67 @@ if (PHP_GRPC != "no") {
"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\\common\\matcher\\v3\\matcher.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_method_list.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\\resolver.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\\core\\v3\\udp_socket_config.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\\quic_config.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\listener\\v3\\udp_listener_config.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\metrics\\v3\\metrics_service.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\metrics\\v3\\stats.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\overload\\v3\\overload.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\\tap\\v3\\common.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\datadog.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\dynamic_ot.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\http_tracer.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\lightstep.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\opencensus.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\service.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\skywalking.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\trace.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\xray.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\zipkin.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\common\\fault\\v3\\fault.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\fault\\v3\\fault.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\rbac\\v3\\rbac.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router\\v3\\router.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\\extensions\\transport_sockets\\tls\\v3\\tls_spiffe_validator_config.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\\service\\status\\v3\\csds.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\type\\http\\v3\\cookie.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\type\\http\\v3\\path_transformation.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\type\\matcher\\v3\\http_inputs.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\matcher\\v3\\metadata.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\matcher\\v3\\node.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\matcher\\v3\\number.upb.c " +
@@ -180,14 +197,19 @@ if (PHP_GRPC != "no") {
"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\\hash_policy.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\v3\\http.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\type\\v3\\http_status.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\\ratelimit_unit.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\type\\v3\\semantic_version.upb.c " +
+ "src\\core\\ext\\upb-generated\\envoy\\type\\v3\\token_bucket.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\\http.upb.c " +
+ "src\\core\\ext\\upb-generated\\google\\api\\httpbody.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " +
@@ -196,26 +218,47 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " +
"src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " +
"src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " +
+ "src\\core\\ext\\upb-generated\\opencensus\\proto\\trace\\v1\\trace_config.upb.c " +
"src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\altscontext.upb.c " +
"src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\handshaker.upb.c " +
"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\\src\\proto\\grpc\\lookup\\v1\\rls.upb.c " +
+ "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lookup\\v1\\rls_config.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\\data\\orca\\v1\\orca_load_report.upb.c " +
- "src\\core\\ext\\upb-generated\\udpa\\type\\v1\\typed_struct.upb.c " +
"src\\core\\ext\\upb-generated\\validate\\validate.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\annotations\\v3\\migrate.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\annotations\\v3\\security.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\annotations\\v3\\sensitive.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\annotations\\v3\\status.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\annotations\\v3\\versioning.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\authority.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\collection_entry.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\context_params.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\core\\v3\\extension.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\resource.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\resource_locator.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\resource_name.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\data\\orca\\v3\\orca_load_report.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\type\\matcher\\v3\\matcher.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\type\\matcher\\v3\\regex.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\type\\matcher\\v3\\string.upb.c " +
+ "src\\core\\ext\\upb-generated\\xds\\type\\v3\\typed_struct.upb.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\certs.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\clusters.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\config_dump.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\init_dump.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\listeners.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\memory.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\metrics.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\mutex_stats.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\server_info.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\admin\\v3\\tap.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\annotations\\deprecation.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\annotations\\resource.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\accesslog\\v3\\accesslog.upbdefs.c " +
@@ -224,50 +267,67 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\cluster\\v3\\cluster.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\cluster\\v3\\filter.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\cluster\\v3\\outlier_detection.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\common\\matcher\\v3\\matcher.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\address.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\backoff.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\base.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\config_source.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\event_service_config.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\extension.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\grpc_method_list.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\grpc_service.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\health_check.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\http_uri.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\protocol.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\proxy_protocol.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\resolver.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\socket_option.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\substitution_format_string.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3\\udp_socket_config.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\endpoint\\v3\\endpoint.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\endpoint\\v3\\endpoint_components.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\endpoint\\v3\\load_report.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\listener\\v3\\api_listener.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\listener\\v3\\listener.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\listener\\v3\\listener_components.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\listener\\v3\\quic_config.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\listener\\v3\\udp_listener_config.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\metrics\\v3\\metrics_service.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\metrics\\v3\\stats.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\overload\\v3\\overload.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\rbac\\v3\\rbac.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\route.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\route_components.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\scoped_route.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\tap\\v3\\common.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\datadog.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\dynamic_ot.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\http_tracer.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\lightstep.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\opencensus.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\service.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\skywalking.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\trace.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\xray.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\zipkin.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\common\\fault\\v3\\fault.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\fault\\v3\\fault.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\rbac\\v3\\rbac.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router\\v3\\router.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3\\http_connection_manager.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\cert.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\common.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\secret.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\tls.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\envoy\\service\\cluster\\v3\\cds.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\tls_spiffe_validator_config.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\service\\discovery\\v3\\ads.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\service\\discovery\\v3\\discovery.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\envoy\\service\\endpoint\\v3\\eds.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\envoy\\service\\listener\\v3\\lds.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\service\\load_stats\\v3\\lrs.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\envoy\\service\\route\\v3\\rds.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\envoy\\service\\route\\v3\\srds.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\service\\status\\v3\\csds.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\http\\v3\\cookie.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\http\\v3\\path_transformation.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3\\http_inputs.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3\\metadata.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3\\node.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3\\number.upbdefs.c " +
@@ -278,12 +338,19 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3\\value.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\metadata\\v3\\metadata.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\tracing\\v3\\custom_tag.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\hash_policy.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\http.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\http_status.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\percent.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\range.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\ratelimit_unit.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\semantic_version.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3\\token_bucket.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\api\\annotations.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\google\\api\\expr\\v1alpha1\\checked.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\google\\api\\expr\\v1alpha1\\syntax.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\api\\http.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\google\\api\\httpbody.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\protobuf\\any.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\protobuf\\descriptor.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\protobuf\\duration.upbdefs.c " +
@@ -292,55 +359,79 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\google\\protobuf\\timestamp.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\protobuf\\wrappers.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\google\\rpc\\status.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\opencensus\\proto\\trace\\v1\\trace_config.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\src\\proto\\grpc\\lookup\\v1\\rls_config.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\migrate.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\security.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\sensitive.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\status.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\versioning.upbdefs.c " +
- "src\\core\\ext\\upbdefs-generated\\udpa\\type\\v1\\typed_struct.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\validate\\validate.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3\\migrate.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3\\security.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3\\sensitive.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3\\status.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3\\versioning.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\authority.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\collection_entry.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\context_params.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\extension.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\resource.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\resource_locator.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\resource_name.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\type\\matcher\\v3\\matcher.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\type\\matcher\\v3\\regex.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\type\\matcher\\v3\\string.upbdefs.c " +
+ "src\\core\\ext\\upbdefs-generated\\xds\\type\\v3\\typed_struct.upbdefs.c " +
"src\\core\\ext\\xds\\certificate_provider_registry.cc " +
"src\\core\\ext\\xds\\certificate_provider_store.cc " +
"src\\core\\ext\\xds\\file_watcher_certificate_provider_factory.cc " +
"src\\core\\ext\\xds\\xds_api.cc " +
"src\\core\\ext\\xds\\xds_bootstrap.cc " +
"src\\core\\ext\\xds\\xds_certificate_provider.cc " +
+ "src\\core\\ext\\xds\\xds_channel_stack_modifier.cc " +
"src\\core\\ext\\xds\\xds_client.cc " +
"src\\core\\ext\\xds\\xds_client_stats.cc " +
+ "src\\core\\ext\\xds\\xds_cluster.cc " +
+ "src\\core\\ext\\xds\\xds_cluster_specifier_plugin.cc " +
+ "src\\core\\ext\\xds\\xds_common_types.cc " +
+ "src\\core\\ext\\xds\\xds_endpoint.cc " +
"src\\core\\ext\\xds\\xds_http_fault_filter.cc " +
"src\\core\\ext\\xds\\xds_http_filters.cc " +
+ "src\\core\\ext\\xds\\xds_http_rbac_filter.cc " +
+ "src\\core\\ext\\xds\\xds_listener.cc " +
+ "src\\core\\ext\\xds\\xds_resource_type.cc " +
+ "src\\core\\ext\\xds\\xds_route_config.cc " +
+ "src\\core\\ext\\xds\\xds_routing.cc " +
"src\\core\\ext\\xds\\xds_server_config_fetcher.cc " +
"src\\core\\lib\\address_utils\\parse_address.cc " +
"src\\core\\lib\\address_utils\\sockaddr_utils.cc " +
- "src\\core\\lib\\avl\\avl.cc " +
"src\\core\\lib\\backoff\\backoff.cc " +
"src\\core\\lib\\channel\\channel_args.cc " +
+ "src\\core\\lib\\channel\\channel_args_preconditioning.cc " +
"src\\core\\lib\\channel\\channel_stack.cc " +
"src\\core\\lib\\channel\\channel_stack_builder.cc " +
+ "src\\core\\lib\\channel\\channel_stack_builder_impl.cc " +
"src\\core\\lib\\channel\\channel_trace.cc " +
"src\\core\\lib\\channel\\channelz.cc " +
"src\\core\\lib\\channel\\channelz_registry.cc " +
"src\\core\\lib\\channel\\connected_channel.cc " +
"src\\core\\lib\\channel\\handshaker.cc " +
"src\\core\\lib\\channel\\handshaker_registry.cc " +
+ "src\\core\\lib\\channel\\promise_based_filter.cc " +
"src\\core\\lib\\channel\\status_util.cc " +
"src\\core\\lib\\compression\\compression.cc " +
- "src\\core\\lib\\compression\\compression_args.cc " +
"src\\core\\lib\\compression\\compression_internal.cc " +
"src\\core\\lib\\compression\\message_compress.cc " +
- "src\\core\\lib\\compression\\stream_compression.cc " +
- "src\\core\\lib\\compression\\stream_compression_gzip.cc " +
- "src\\core\\lib\\compression\\stream_compression_identity.cc " +
+ "src\\core\\lib\\config\\core_configuration.cc " +
"src\\core\\lib\\debug\\stats.cc " +
"src\\core\\lib\\debug\\stats_data.cc " +
"src\\core\\lib\\debug\\trace.cc " +
- "src\\core\\lib\\event_engine\\slice_allocator.cc " +
+ "src\\core\\lib\\event_engine\\channel_args_endpoint_config.cc " +
+ "src\\core\\lib\\event_engine\\default_event_engine_factory.cc " +
+ "src\\core\\lib\\event_engine\\event_engine.cc " +
+ "src\\core\\lib\\event_engine\\memory_allocator.cc " +
+ "src\\core\\lib\\event_engine\\resolved_address.cc " +
"src\\core\\lib\\event_engine\\sockaddr.cc " +
"src\\core\\lib\\gpr\\alloc.cc " +
"src\\core\\lib\\gpr\\atm.cc " +
@@ -369,12 +460,10 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gpr\\time_posix.cc " +
"src\\core\\lib\\gpr\\time_precise.cc " +
"src\\core\\lib\\gpr\\time_windows.cc " +
- "src\\core\\lib\\gpr\\tls_pthread.cc " +
"src\\core\\lib\\gpr\\tmpfile_msys.cc " +
"src\\core\\lib\\gpr\\tmpfile_posix.cc " +
"src\\core\\lib\\gpr\\tmpfile_windows.cc " +
"src\\core\\lib\\gpr\\wrap_memcpy.cc " +
- "src\\core\\lib\\gprpp\\arena.cc " +
"src\\core\\lib\\gprpp\\examine_stack.cc " +
"src\\core\\lib\\gprpp\\fork.cc " +
"src\\core\\lib\\gprpp\\global_config_env.cc " +
@@ -385,6 +474,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\status_helper.cc " +
"src\\core\\lib\\gprpp\\thd_posix.cc " +
"src\\core\\lib\\gprpp\\thd_windows.cc " +
+ "src\\core\\lib\\gprpp\\time.cc " +
"src\\core\\lib\\gprpp\\time_util.cc " +
"src\\core\\lib\\http\\format_request.cc " +
"src\\core\\lib\\http\\httpcli.cc " +
@@ -397,17 +487,24 @@ if (PHP_GRPC != "no") {
"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_event_engine.cc " +
"src\\core\\lib\\iomgr\\endpoint_pair_posix.cc " +
- "src\\core\\lib\\iomgr\\endpoint_pair_uv.cc " +
"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_epoll1_linux.cc " +
- "src\\core\\lib\\iomgr\\ev_epollex_linux.cc " +
"src\\core\\lib\\iomgr\\ev_poll_posix.cc " +
"src\\core\\lib\\iomgr\\ev_posix.cc " +
"src\\core\\lib\\iomgr\\ev_windows.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\closure.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\endpoint.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\iomgr.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\pollset.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\resolved_address_internal.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\resolver.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\tcp.cc " +
+ "src\\core\\lib\\iomgr\\event_engine\\timer.cc " +
"src\\core\\lib\\iomgr\\exec_ctx.cc " +
"src\\core\\lib\\iomgr\\executor.cc " +
"src\\core\\lib\\iomgr\\executor\\mpmcqueue.cc " +
@@ -422,60 +519,45 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\iomgr\\internal_errqueue.cc " +
"src\\core\\lib\\iomgr\\iocp_windows.cc " +
"src\\core\\lib\\iomgr\\iomgr.cc " +
- "src\\core\\lib\\iomgr\\iomgr_custom.cc " +
"src\\core\\lib\\iomgr\\iomgr_internal.cc " +
"src\\core\\lib\\iomgr\\iomgr_posix.cc " +
"src\\core\\lib\\iomgr\\iomgr_posix_cfstream.cc " +
- "src\\core\\lib\\iomgr\\iomgr_uv.cc " +
"src\\core\\lib\\iomgr\\iomgr_windows.cc " +
- "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\\polling_entity.cc " +
"src\\core\\lib\\iomgr\\pollset.cc " +
- "src\\core\\lib\\iomgr\\pollset_custom.cc " +
"src\\core\\lib\\iomgr\\pollset_set.cc " +
- "src\\core\\lib\\iomgr\\pollset_set_custom.cc " +
"src\\core\\lib\\iomgr\\pollset_set_windows.cc " +
- "src\\core\\lib\\iomgr\\pollset_uv.cc " +
"src\\core\\lib\\iomgr\\pollset_windows.cc " +
"src\\core\\lib\\iomgr\\resolve_address.cc " +
- "src\\core\\lib\\iomgr\\resolve_address_custom.cc " +
"src\\core\\lib\\iomgr\\resolve_address_posix.cc " +
"src\\core\\lib\\iomgr\\resolve_address_windows.cc " +
- "src\\core\\lib\\iomgr\\resource_quota.cc " +
+ "src\\core\\lib\\iomgr\\sockaddr_utils_posix.cc " +
"src\\core\\lib\\iomgr\\socket_factory_posix.cc " +
"src\\core\\lib\\iomgr\\socket_mutator.cc " +
"src\\core\\lib\\iomgr\\socket_utils_common_posix.cc " +
"src\\core\\lib\\iomgr\\socket_utils_linux.cc " +
"src\\core\\lib\\iomgr\\socket_utils_posix.cc " +
- "src\\core\\lib\\iomgr\\socket_utils_uv.cc " +
"src\\core\\lib\\iomgr\\socket_utils_windows.cc " +
"src\\core\\lib\\iomgr\\socket_windows.cc " +
"src\\core\\lib\\iomgr\\tcp_client.cc " +
"src\\core\\lib\\iomgr\\tcp_client_cfstream.cc " +
- "src\\core\\lib\\iomgr\\tcp_client_custom.cc " +
"src\\core\\lib\\iomgr\\tcp_client_posix.cc " +
"src\\core\\lib\\iomgr\\tcp_client_windows.cc " +
- "src\\core\\lib\\iomgr\\tcp_custom.cc " +
"src\\core\\lib\\iomgr\\tcp_posix.cc " +
"src\\core\\lib\\iomgr\\tcp_server.cc " +
- "src\\core\\lib\\iomgr\\tcp_server_custom.cc " +
"src\\core\\lib\\iomgr\\tcp_server_posix.cc " +
"src\\core\\lib\\iomgr\\tcp_server_utils_posix_common.cc " +
"src\\core\\lib\\iomgr\\tcp_server_utils_posix_ifaddrs.cc " +
"src\\core\\lib\\iomgr\\tcp_server_utils_posix_noifaddrs.cc " +
"src\\core\\lib\\iomgr\\tcp_server_windows.cc " +
- "src\\core\\lib\\iomgr\\tcp_uv.cc " +
"src\\core\\lib\\iomgr\\tcp_windows.cc " +
"src\\core\\lib\\iomgr\\time_averaged_stats.cc " +
"src\\core\\lib\\iomgr\\timer.cc " +
- "src\\core\\lib\\iomgr\\timer_custom.cc " +
"src\\core\\lib\\iomgr\\timer_generic.cc " +
"src\\core\\lib\\iomgr\\timer_heap.cc " +
"src\\core\\lib\\iomgr\\timer_manager.cc " +
- "src\\core\\lib\\iomgr\\timer_uv.cc " +
- "src\\core\\lib\\iomgr\\udp_server.cc " +
"src\\core\\lib\\iomgr\\unix_sockets_posix.cc " +
"src\\core\\lib\\iomgr\\unix_sockets_posix_noop.cc " +
"src\\core\\lib\\iomgr\\wakeup_fd_eventfd.cc " +
@@ -489,6 +571,23 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\matchers\\matchers.cc " +
"src\\core\\lib\\profiling\\basic_timers.cc " +
"src\\core\\lib\\profiling\\stap_timers.cc " +
+ "src\\core\\lib\\promise\\activity.cc " +
+ "src\\core\\lib\\promise\\sleep.cc " +
+ "src\\core\\lib\\resolver\\resolver.cc " +
+ "src\\core\\lib\\resolver\\resolver_registry.cc " +
+ "src\\core\\lib\\resolver\\server_address.cc " +
+ "src\\core\\lib\\resource_quota\\api.cc " +
+ "src\\core\\lib\\resource_quota\\arena.cc " +
+ "src\\core\\lib\\resource_quota\\memory_quota.cc " +
+ "src\\core\\lib\\resource_quota\\resource_quota.cc " +
+ "src\\core\\lib\\resource_quota\\thread_quota.cc " +
+ "src\\core\\lib\\resource_quota\\trace.cc " +
+ "src\\core\\lib\\security\\authorization\\authorization_policy_provider_vtable.cc " +
+ "src\\core\\lib\\security\\authorization\\evaluate_args.cc " +
+ "src\\core\\lib\\security\\authorization\\grpc_authorization_engine.cc " +
+ "src\\core\\lib\\security\\authorization\\grpc_server_authz_filter.cc " +
+ "src\\core\\lib\\security\\authorization\\matchers.cc " +
+ "src\\core\\lib\\security\\authorization\\rbac_policy.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 " +
@@ -498,9 +597,10 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_client_options.cc " +
"src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_options.cc " +
"src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_server_options.cc " +
+ "src\\core\\lib\\security\\credentials\\call_creds_util.cc " +
+ "src\\core\\lib\\security\\credentials\\channel_creds_registry_init.cc " +
"src\\core\\lib\\security\\credentials\\composite\\composite_credentials.cc " +
"src\\core\\lib\\security\\credentials\\credentials.cc " +
- "src\\core\\lib\\security\\credentials\\credentials_metadata.cc " +
"src\\core\\lib\\security\\credentials\\external\\aws_external_account_credentials.cc " +
"src\\core\\lib\\security\\credentials\\external\\aws_request_signer.cc " +
"src\\core\\lib\\security\\credentials\\external\\external_account_credentials.cc " +
@@ -520,6 +620,7 @@ if (PHP_GRPC != "no") {
"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_provider.cc " +
+ "src\\core\\lib\\security\\credentials\\tls\\grpc_tls_certificate_verifier.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\\tls\\tls_utils.cc " +
@@ -541,13 +642,18 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\security\\transport\\server_auth_filter.cc " +
"src\\core\\lib\\security\\transport\\tsi_error.cc " +
"src\\core\\lib\\security\\util\\json_util.cc " +
+ "src\\core\\lib\\service_config\\service_config_impl.cc " +
+ "src\\core\\lib\\service_config\\service_config_parser.cc " +
"src\\core\\lib\\slice\\b64.cc " +
"src\\core\\lib\\slice\\percent_encoding.cc " +
"src\\core\\lib\\slice\\slice.cc " +
+ "src\\core\\lib\\slice\\slice_api.cc " +
"src\\core\\lib\\slice\\slice_buffer.cc " +
- "src\\core\\lib\\slice\\slice_intern.cc " +
+ "src\\core\\lib\\slice\\slice_refcount.cc " +
+ "src\\core\\lib\\slice\\slice_split.cc " +
"src\\core\\lib\\slice\\slice_string_helpers.cc " +
"src\\core\\lib\\surface\\api_trace.cc " +
+ "src\\core\\lib\\surface\\builtins.cc " +
"src\\core\\lib\\surface\\byte_buffer.cc " +
"src\\core\\lib\\surface\\byte_buffer_reader.cc " +
"src\\core\\lib\\surface\\call.cc " +
@@ -561,28 +667,24 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\surface\\completion_queue_factory.cc " +
"src\\core\\lib\\surface\\event_string.cc " +
"src\\core\\lib\\surface\\init.cc " +
- "src\\core\\lib\\surface\\init_secure.cc " +
"src\\core\\lib\\surface\\lame_client.cc " +
"src\\core\\lib\\surface\\metadata_array.cc " +
"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\\bdp_estimator.cc " +
"src\\core\\lib\\transport\\byte_stream.cc " +
"src\\core\\lib\\transport\\connectivity_state.cc " +
"src\\core\\lib\\transport\\error_utils.cc " +
- "src\\core\\lib\\transport\\metadata.cc " +
- "src\\core\\lib\\transport\\metadata_batch.cc " +
+ "src\\core\\lib\\transport\\parsed_metadata.cc " +
"src\\core\\lib\\transport\\pid_controller.cc " +
- "src\\core\\lib\\transport\\static_metadata.cc " +
"src\\core\\lib\\transport\\status_conversion.cc " +
- "src\\core\\lib\\transport\\status_metadata.cc " +
"src\\core\\lib\\transport\\timeout_encoding.cc " +
"src\\core\\lib\\transport\\transport.cc " +
"src\\core\\lib\\transport\\transport_op_string.cc " +
"src\\core\\lib\\uri\\uri_parser.cc " +
"src\\core\\plugin_registry\\grpc_plugin_registry.cc " +
+ "src\\core\\plugin_registry\\grpc_plugin_registry_extra.cc " +
"src\\core\\tsi\\alts\\crypt\\aes_gcm.cc " +
"src\\core\\tsi\\alts\\crypt\\gsec.cc " +
"src\\core\\tsi\\alts\\frame_protector\\alts_counter.cc " +
@@ -604,6 +706,7 @@ if (PHP_GRPC != "no") {
"src\\core\\tsi\\alts\\zero_copy_frame_protector\\alts_zero_copy_grpc_protector.cc " +
"src\\core\\tsi\\fake_transport_security.cc " +
"src\\core\\tsi\\local_transport_security.cc " +
+ "src\\core\\tsi\\ssl\\key_logging\\ssl_key_logging.cc " +
"src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " +
"src\\core\\tsi\\ssl\\session_cache\\ssl_session_cache.cc " +
"src\\core\\tsi\\ssl\\session_cache\\ssl_session_openssl.cc " +
@@ -621,7 +724,6 @@ if (PHP_GRPC != "no") {
"src\\php\\ext\\grpc\\server_credentials.c " +
"src\\php\\ext\\grpc\\timeval.c " +
"third_party\\abseil-cpp\\absl\\base\\internal\\cycleclock.cc " +
- "third_party\\abseil-cpp\\absl\\base\\internal\\exponential_biased.cc " +
"third_party\\abseil-cpp\\absl\\base\\internal\\low_level_alloc.cc " +
"third_party\\abseil-cpp\\absl\\base\\internal\\raw_logging.cc " +
"third_party\\abseil-cpp\\absl\\base\\internal\\spinlock.cc " +
@@ -642,8 +744,20 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\debugging\\symbolize.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\city.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\hash.cc " +
- "third_party\\abseil-cpp\\absl\\hash\\internal\\wyhash.cc " +
+ "third_party\\abseil-cpp\\absl\\hash\\internal\\low_level_hash.cc " +
"third_party\\abseil-cpp\\absl\\numeric\\int128.cc " +
+ "third_party\\abseil-cpp\\absl\\profiling\\internal\\exponential_biased.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\discrete_distribution.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\gaussian_distribution.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\pool_urbg.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\randen.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\randen_detect.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\randen_hwaes.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\randen_round_keys.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\randen_slow.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\internal\\seed_material.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\seed_gen_exception.cc " +
+ "third_party\\abseil-cpp\\absl\\random\\seed_sequences.cc " +
"third_party\\abseil-cpp\\absl\\status\\status.cc " +
"third_party\\abseil-cpp\\absl\\status\\status_payload_printer.cc " +
"third_party\\abseil-cpp\\absl\\status\\statusor.cc " +
@@ -654,7 +768,14 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\strings\\internal\\charconv_bigint.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\charconv_parse.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\cord_internal.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cord_rep_btree.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cord_rep_btree_navigator.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cord_rep_btree_reader.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cord_rep_consume.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\cord_rep_ring.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cordz_functions.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cordz_handle.cc " +
+ "third_party\\abseil-cpp\\absl\\strings\\internal\\cordz_info.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\escaping.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\memutil.cc " +
"third_party\\abseil-cpp\\absl\\strings\\internal\\ostringstream.cc " +
@@ -713,6 +834,7 @@ if (PHP_GRPC != "no") {
"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_strex.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 " +
@@ -721,7 +843,6 @@ if (PHP_GRPC != "no") {
"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 " +
@@ -853,13 +974,13 @@ if (PHP_GRPC != "no") {
"third_party\\boringssl-with-bazel\\src\\crypto\\trust_token\\voprf.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\\name_print.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 " +
@@ -938,6 +1059,7 @@ if (PHP_GRPC != "no") {
"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\\encrypted_client_hello.cc " +
+ "third_party\\boringssl-with-bazel\\src\\ssl\\extensions.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 " +
@@ -960,7 +1082,6 @@ if (PHP_GRPC != "no") {
"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 " +
@@ -990,10 +1111,14 @@ if (PHP_GRPC != "no") {
"third_party\\re2\\util\\pcre.cc " +
"third_party\\re2\\util\\rune.cc " +
"third_party\\re2\\util\\strutil.cc " +
+ "third_party\\upb\\third_party\\utf8_range\\naive.c " +
+ "third_party\\upb\\third_party\\utf8_range\\range2-neon.c " +
+ "third_party\\upb\\third_party\\utf8_range\\range2-sse.c " +
"third_party\\upb\\upb\\decode.c " +
"third_party\\upb\\upb\\decode_fast.c " +
"third_party\\upb\\upb\\def.c " +
"third_party\\upb\\upb\\encode.c " +
+ "third_party\\upb\\upb\\json_encode.c " +
"third_party\\upb\\upb\\msg.c " +
"third_party\\upb\\upb\\reflection.c " +
"third_party\\upb\\upb\\table.c " +
@@ -1039,6 +1164,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\census");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\channel_idle");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\health");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy");
@@ -1046,10 +1172,12 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\priority");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\ring_hash");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\rls");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\weighted_target");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\binder");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native");
@@ -1057,25 +1185,20 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\google_c2p");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\xds");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_idle");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\fault_injection");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\client");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\message_compress");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http\\server");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\max_age");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\message_size");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\workarounds");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\rbac");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\server_config_selector");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\alpn");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\insecure");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\client\\secure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\insecure");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\inproc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated");
@@ -1090,6 +1213,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\bootstrap\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\cluster");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\cluster\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\common");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\common\\matcher");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\common\\matcher\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\core\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\endpoint");
@@ -1104,6 +1230,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\route");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\route\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\tap");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\tap\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\trace");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions");
@@ -1117,6 +1245,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\fault");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\fault\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\rbac");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network");
@@ -1126,21 +1256,15 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\cluster");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\cluster\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\endpoint");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\endpoint\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\listener");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\listener\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\route");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\route\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\status");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\status\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type\\http");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type\\http\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type\\matcher");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type\\matcher\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type\\metadata");
@@ -1154,6 +1278,10 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\api\\expr\\v1alpha1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\protobuf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\rpc");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\opencensus");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\opencensus\\proto");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\opencensus\\proto\\trace");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\opencensus\\proto\\trace\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc");
@@ -1162,17 +1290,23 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lookup");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lookup\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\annotations");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\type");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\type\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\annotations");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\annotations\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\core\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\data");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\data\\orca");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\data\\orca\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\type");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\type\\matcher");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\type\\matcher\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\type\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\admin");
@@ -1185,6 +1319,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\bootstrap\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\cluster");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\cluster\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\common");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\common\\matcher");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\common\\matcher\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\core\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\endpoint");
@@ -1195,8 +1332,12 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\metrics\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\overload");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\overload\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\rbac");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\route");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\tap");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\tap\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions");
@@ -1210,6 +1351,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\fault");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\fault\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\rbac");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network");
@@ -1219,21 +1362,15 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\cluster");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\cluster\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\discovery");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\discovery\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\endpoint");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\endpoint\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\listener");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\listener\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\load_stats");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\load_stats\\v3");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\route");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\route\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\status");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\service\\status\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\http");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\http\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\matcher\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\metadata");
@@ -1243,34 +1380,54 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\type\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\api");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\api\\expr");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\api\\expr\\v1alpha1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\protobuf");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\rpc");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\opencensus");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\opencensus\\proto");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\opencensus\\proto\\trace");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\opencensus\\proto\\trace\\v1");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\src");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\src\\proto");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\src\\proto\\grpc");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\src\\proto\\grpc\\lookup");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\src\\proto\\grpc\\lookup\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\annotations");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\type");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\type\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\validate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\annotations");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\annotations\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\core");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\core\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\type");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\type\\matcher");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\type\\matcher\\v3");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\type\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\address_utils");
- FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\channel");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\compression");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\config");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\debug");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\event_engine");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\event_engine");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\executor");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\json");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\matchers");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\profiling");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\promise");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\resolver");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\resource_quota");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\authorization");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\context");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\credentials\\alts");
@@ -1296,6 +1453,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\security_connector\\tls");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\security\\util");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\service_config");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\slice");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\surface");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\transport");
@@ -1308,6 +1466,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\alts\\handshaker");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\alts\\zero_copy_frame_protector");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\key_logging");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\php\\ext");
@@ -1324,6 +1483,10 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\numeric");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling\\internal");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\random");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\random\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\status");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\strings\\internal");
@@ -1384,6 +1547,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\re2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\util");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\third_party");
+ FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\third_party\\utf8_range");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib");
_build_dirs = new Array();
diff --git a/grpc/gRPC-C++.podspec b/grpc/gRPC-C++.podspec
index ce3ec337..718f2031 100644
--- a/grpc/gRPC-C++.podspec
+++ b/grpc/gRPC-C++.podspec
@@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
- version = '1.38.0'
+ version = '1.46.5'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
@@ -51,7 +51,10 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(PODS_TARGET_SRCROOT)/include"',
- 'USER_HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)"',
+ 'USER_HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)"'\
+ ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upb-generated"'\
+ ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upbdefs-generated"'\
+ ' "$(PODS_TARGET_SRCROOT)/third_party/**"',
'GCC_PREPROCESSOR_DEFINITIONS' => '"$(inherited)" "COCOAPODS=1"',
'CLANG_WARN_STRICT_PROTOTYPES' => 'NO',
'CLANG_WARN_DOCUMENTATION_COMMENTS' => 'NO',
@@ -81,6 +84,7 @@ Pod::Spec.new do |s|
'include/grpcpp/client_context.h',
'include/grpcpp/completion_queue.h',
'include/grpcpp/create_channel.h',
+ 'include/grpcpp/create_channel_binder.h',
'include/grpcpp/create_channel_posix.h',
'include/grpcpp/ext/health_check_service_server_builder_option.h',
'include/grpcpp/generic/async_generic_service.h',
@@ -149,9 +153,13 @@ Pod::Spec.new do |s|
'include/grpcpp/resource_quota.h',
'include/grpcpp/security/auth_context.h',
'include/grpcpp/security/auth_metadata_processor.h',
+ 'include/grpcpp/security/authorization_policy_provider.h',
+ 'include/grpcpp/security/binder_credentials.h',
+ 'include/grpcpp/security/binder_security_policy.h',
'include/grpcpp/security/credentials.h',
'include/grpcpp/security/server_credentials.h',
'include/grpcpp/security/tls_certificate_provider.h',
+ 'include/grpcpp/security/tls_certificate_verifier.h',
'include/grpcpp/security/tls_credentials_options.h',
'include/grpcpp/server.h',
'include/grpcpp/server_builder.h',
@@ -186,21 +194,29 @@ Pod::Spec.new do |s|
ss.header_mappings_dir = '.'
ss.dependency "#{s.name}/Interface", version
ss.dependency 'gRPC-Core', version
- abseil_version = '1.20210324.0'
+ abseil_version = '1.20211102.0'
ss.dependency 'abseil/base/base', abseil_version
+ ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version
+ ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
+ ss.dependency 'abseil/random/random', abseil_version
ss.dependency 'abseil/status/status', abseil_version
ss.dependency 'abseil/status/statusor', abseil_version
+ ss.dependency 'abseil/strings/cord', abseil_version
ss.dependency 'abseil/strings/str_format', abseil_version
ss.dependency 'abseil/strings/strings', abseil_version
ss.dependency 'abseil/synchronization/synchronization', abseil_version
ss.dependency 'abseil/time/time', abseil_version
ss.dependency 'abseil/types/optional', abseil_version
+ ss.dependency 'abseil/types/variant', abseil_version
+ ss.dependency 'abseil/utility/utility', abseil_version
- ss.source_files = 'src/core/ext/filters/client_channel/backend_metric.h',
+ ss.source_files = 'src/core/ext/filters/channel_idle/channel_idle_filter.h',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.h',
+ 'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.h',
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
@@ -218,7 +234,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h',
@@ -230,25 +245,20 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
- 'src/core/ext/filters/client_channel/resolver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
- 'src/core/ext/filters/client_channel/resolver_factory.h',
- 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/filters/client_channel/resolver_result_parsing.h',
'src/core/ext/filters/client_channel/retry_filter.h',
'src/core/ext/filters/client_channel/retry_service_config.h',
'src/core/ext/filters/client_channel/retry_throttle.h',
- 'src/core/ext/filters/client_channel/server_address.h',
- 'src/core/ext/filters/client_channel/service_config.h',
- 'src/core/ext/filters/client_channel/service_config_call_data.h',
- 'src/core/ext/filters/client_channel/service_config_parser.h',
'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_interface.h',
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/fault_injection/fault_injection_filter.h',
'src/core/ext/filters/fault_injection/service_config_parser.h',
@@ -257,12 +267,50 @@ Pod::Spec.new do |s|
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
- 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
- 'src/core/ext/filters/workarounds/workaround_utils.h',
+ 'src/core/ext/filters/rbac/rbac_filter.h',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.h',
+ 'src/core/ext/transport/binder/client/binder_connector.cc',
+ 'src/core/ext/transport/binder/client/binder_connector.h',
+ 'src/core/ext/transport/binder/client/channel_create.cc',
+ 'src/core/ext/transport/binder/client/channel_create_impl.cc',
+ 'src/core/ext/transport/binder/client/channel_create_impl.h',
+ 'src/core/ext/transport/binder/client/connection_id_generator.cc',
+ 'src/core/ext/transport/binder/client/connection_id_generator.h',
+ 'src/core/ext/transport/binder/client/endpoint_binder_pool.cc',
+ 'src/core/ext/transport/binder/client/endpoint_binder_pool.h',
+ 'src/core/ext/transport/binder/client/jni_utils.cc',
+ 'src/core/ext/transport/binder/client/jni_utils.h',
+ 'src/core/ext/transport/binder/client/security_policy_setting.cc',
+ 'src/core/ext/transport/binder/client/security_policy_setting.h',
+ 'src/core/ext/transport/binder/security_policy/binder_security_policy.cc',
+ 'src/core/ext/transport/binder/server/binder_server.cc',
+ 'src/core/ext/transport/binder/server/binder_server.h',
+ 'src/core/ext/transport/binder/server/binder_server_credentials.cc',
+ 'src/core/ext/transport/binder/transport/binder_stream.h',
+ 'src/core/ext/transport/binder/transport/binder_transport.cc',
+ 'src/core/ext/transport/binder/transport/binder_transport.h',
+ 'src/core/ext/transport/binder/utils/binder_auto_utils.h',
+ 'src/core/ext/transport/binder/utils/ndk_binder.cc',
+ 'src/core/ext/transport/binder/utils/ndk_binder.h',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver.h',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h',
+ 'src/core/ext/transport/binder/wire_format/binder.h',
+ 'src/core/ext/transport/binder/wire_format/binder_android.cc',
+ 'src/core/ext/transport/binder/wire_format/binder_android.h',
+ 'src/core/ext/transport/binder/wire_format/binder_constants.cc',
+ 'src/core/ext/transport/binder/wire_format/binder_constants.h',
+ 'src/core/ext/transport/binder/wire_format/transaction.cc',
+ 'src/core/ext/transport/binder/wire_format/transaction.h',
+ 'src/core/ext/transport/binder/wire_format/wire_reader.h',
+ 'src/core/ext/transport/binder/wire_format/wire_reader_impl.cc',
+ 'src/core/ext/transport/binder/wire_format/wire_reader_impl.h',
+ 'src/core/ext/transport/binder/wire_format/wire_writer.cc',
+ 'src/core/ext/transport/binder/wire_format/wire_writer.h',
'src/core/ext/transport/chttp2/alpn/alpn.h',
- 'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@@ -277,17 +325,27 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_rst_stream.h',
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_constants.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
- 'src/core/ext/transport/chttp2/transport/hpack_table.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h',
'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h',
'src/core/ext/upb-generated/envoy/annotations/resource.upb.h',
'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h',
@@ -296,51 +354,67 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h',
'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h',
'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h',
@@ -351,14 +425,19 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h',
'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/range.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
@@ -367,26 +446,47 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.h',
'src/core/ext/upb-generated/udpa/annotations/security.upb.h',
'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h',
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.h',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h',
@@ -395,50 +495,67 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h',
@@ -449,12 +566,19 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h',
@@ -463,38 +587,65 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h',
'src/core/ext/xds/certificate_provider_factory.h',
'src/core/ext/xds/certificate_provider_registry.h',
'src/core/ext/xds/certificate_provider_store.h',
'src/core/ext/xds/file_watcher_certificate_provider_factory.h',
+ 'src/core/ext/xds/upb_utils.h',
'src/core/ext/xds/xds_api.h',
'src/core/ext/xds/xds_bootstrap.h',
'src/core/ext/xds/xds_certificate_provider.h',
'src/core/ext/xds/xds_channel_args.h',
+ 'src/core/ext/xds/xds_channel_stack_modifier.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
+ 'src/core/ext/xds/xds_cluster.h',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.h',
+ 'src/core/ext/xds/xds_common_types.h',
+ 'src/core/ext/xds/xds_endpoint.h',
'src/core/ext/xds/xds_http_fault_filter.h',
'src/core/ext/xds/xds_http_filters.h',
+ 'src/core/ext/xds/xds_http_rbac_filter.h',
+ 'src/core/ext/xds/xds_listener.h',
+ 'src/core/ext/xds/xds_resource_type.h',
+ 'src/core/ext/xds/xds_resource_type_impl.h',
+ 'src/core/ext/xds/xds_route_config.h',
+ 'src/core/ext/xds/xds_routing.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
+ 'src/core/lib/channel/call_finalization.h',
+ 'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
+ 'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
+ 'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_trace.h',
'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
@@ -503,19 +654,18 @@ Pod::Spec.new do |s|
'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h',
+ 'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
- 'src/core/lib/compression/algorithm_metadata.h',
- 'src/core/lib/compression/compression_args.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
- 'src/core/lib/compression/stream_compression.h',
- 'src/core/lib/compression/stream_compression_gzip.h',
- 'src/core/lib/compression/stream_compression_identity.h',
+ 'src/core/lib/config/core_configuration.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.h',
+ 'src/core/lib/event_engine/event_engine_factory.h',
+ 'src/core/lib/event_engine/sockaddr.h',
'src/core/lib/gpr/alloc.h',
- 'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
@@ -523,14 +673,14 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/string_windows.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tls.h',
- 'src/core/lib/gpr/tls_gcc.h',
- 'src/core/lib/gpr/tls_msvc.h',
- 'src/core/lib/gpr/tls_pthread.h',
- 'src/core/lib/gpr/tls_stdcpp.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
- 'src/core/lib/gprpp/atomic.h',
+ 'src/core/lib/gprpp/atomic_utils.h',
+ 'src/core/lib/gprpp/bitset.h',
+ 'src/core/lib/gprpp/capture.h',
+ 'src/core/lib/gprpp/chunked_vector.h',
+ 'src/core/lib/gprpp/construct_destruct.h',
+ 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/examine_stack.h',
@@ -541,18 +691,24 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/manual_constructor.h',
+ 'src/core/lib/gprpp/match.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/orphanable.h',
+ 'src/core/lib/gprpp/overload.h',
'src/core/lib/gprpp/ref_counted.h',
'src/core/lib/gprpp/ref_counted_ptr.h',
+ 'src/core/lib/gprpp/single_set_ptr.h',
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/status_helper.h',
'src/core/lib/gprpp/sync.h',
+ 'src/core/lib/gprpp/table.h',
'src/core/lib/gprpp/thd.h',
+ 'src/core/lib/gprpp/time.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
+ 'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
@@ -569,9 +725,14 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/error_internal.h',
'src/core/lib/iomgr/ev_apple.h',
'src/core/lib/iomgr/ev_epoll1_linux.h',
- 'src/core/lib/iomgr/ev_epollex_linux.h',
'src/core/lib/iomgr/ev_poll_posix.h',
'src/core/lib/iomgr/ev_posix.h',
+ 'src/core/lib/iomgr/event_engine/closure.h',
+ 'src/core/lib/iomgr/event_engine/endpoint.h',
+ 'src/core/lib/iomgr/event_engine/pollset.h',
+ 'src/core/lib/iomgr/event_engine/promise.h',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.h',
+ 'src/core/lib/iomgr/event_engine/resolver.h',
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/executor/mpmcqueue.h',
@@ -581,27 +742,23 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
- 'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
- 'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
'src/core/lib/iomgr/nameser.h',
'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.h',
- 'src/core/lib/iomgr/pollset_custom.h',
'src/core/lib/iomgr/pollset_set.h',
- 'src/core/lib/iomgr/pollset_set_custom.h',
'src/core/lib/iomgr/pollset_set_windows.h',
- 'src/core/lib/iomgr/pollset_uv.h',
'src/core/lib/iomgr/pollset_windows.h',
'src/core/lib/iomgr/port.h',
'src/core/lib/iomgr/python_util.h',
'src/core/lib/iomgr/resolve_address.h',
- 'src/core/lib/iomgr/resolve_address_custom.h',
- 'src/core/lib/iomgr/resource_quota.h',
+ 'src/core/lib/iomgr/resolve_address_impl.h',
+ 'src/core/lib/iomgr/resolve_address_posix.h',
+ 'src/core/lib/iomgr/resolve_address_windows.h',
+ 'src/core/lib/iomgr/resolved_address.h',
'src/core/lib/iomgr/sockaddr.h',
- 'src/core/lib/iomgr/sockaddr_custom.h',
'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.h',
@@ -609,21 +766,17 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/socket_utils.h',
'src/core/lib/iomgr/socket_utils_posix.h',
'src/core/lib/iomgr/socket_windows.h',
- 'src/core/lib/iomgr/sys_epoll_wrapper.h',
'src/core/lib/iomgr/tcp_client.h',
'src/core/lib/iomgr/tcp_client_posix.h',
- 'src/core/lib/iomgr/tcp_custom.h',
'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.h',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.h',
'src/core/lib/iomgr/timer.h',
- 'src/core/lib/iomgr/timer_custom.h',
'src/core/lib/iomgr/timer_generic.h',
'src/core/lib/iomgr/timer_heap.h',
'src/core/lib/iomgr/timer_manager.h',
- 'src/core/lib/iomgr/udp_server.h',
'src/core/lib/iomgr/unix_sockets_posix.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
@@ -632,10 +785,49 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_util.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/profiling/timers.h',
+ 'src/core/lib/promise/activity.h',
+ 'src/core/lib/promise/arena_promise.h',
+ 'src/core/lib/promise/call_push_pull.h',
+ 'src/core/lib/promise/context.h',
+ 'src/core/lib/promise/detail/basic_seq.h',
+ 'src/core/lib/promise/detail/promise_factory.h',
+ 'src/core/lib/promise/detail/promise_like.h',
+ 'src/core/lib/promise/detail/status.h',
+ 'src/core/lib/promise/detail/switch.h',
+ 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h',
+ 'src/core/lib/promise/intra_activity_waiter.h',
+ 'src/core/lib/promise/latch.h',
+ 'src/core/lib/promise/loop.h',
+ 'src/core/lib/promise/map.h',
+ 'src/core/lib/promise/poll.h',
+ 'src/core/lib/promise/promise.h',
+ 'src/core/lib/promise/race.h',
+ 'src/core/lib/promise/seq.h',
+ 'src/core/lib/promise/sleep.h',
+ 'src/core/lib/promise/try_seq.h',
+ 'src/core/lib/resolver/resolver.h',
+ 'src/core/lib/resolver/resolver_factory.h',
+ 'src/core/lib/resolver/resolver_registry.h',
+ 'src/core/lib/resolver/server_address.h',
+ 'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
+ 'src/core/lib/resource_quota/memory_quota.h',
+ 'src/core/lib/resource_quota/resource_quota.h',
+ 'src/core/lib/resource_quota/thread_quota.h',
+ 'src/core/lib/resource_quota/trace.h',
+ 'src/core/lib/security/authorization/authorization_engine.h',
+ 'src/core/lib/security/authorization/authorization_policy_provider.h',
+ 'src/core/lib/security/authorization/evaluate_args.h',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.h',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.h',
+ 'src/core/lib/security/authorization/matchers.h',
+ 'src/core/lib/security/authorization/rbac_policy.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h',
+ 'src/core/lib/security/credentials/call_creds_util.h',
+ 'src/core/lib/security/credentials/channel_creds_registry.h',
'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h',
'src/core/lib/security/credentials/external/aws_external_account_credentials.h',
@@ -646,6 +838,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/fake/fake_credentials.h',
'src/core/lib/security/credentials/google_default/google_default_credentials.h',
'src/core/lib/security/credentials/iam/iam_credentials.h',
+ 'src/core/lib/security/credentials/insecure/insecure_credentials.h',
'src/core/lib/security/credentials/jwt/json_token.h',
'src/core/lib/security/credentials/jwt/jwt_credentials.h',
'src/core/lib/security/credentials/jwt/jwt_verifier.h',
@@ -655,6 +848,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/ssl/ssl_credentials.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h',
'src/core/lib/security/credentials/tls/tls_credentials.h',
'src/core/lib/security/credentials/tls/tls_utils.h',
@@ -675,12 +869,20 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_handshaker.h',
'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.h',
+ 'src/core/lib/service_config/service_config.h',
+ 'src/core/lib/service_config/service_config_call_data.h',
+ 'src/core/lib/service_config/service_config_impl.h',
+ 'src/core/lib/service_config/service_config_parser.h',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.h',
+ 'src/core/lib/slice/slice.h',
'src/core/lib/slice/slice_internal.h',
+ 'src/core/lib/slice/slice_refcount.h',
+ 'src/core/lib/slice/slice_refcount_base.h',
+ 'src/core/lib/slice/slice_split.h',
'src/core/lib/slice/slice_string_helpers.h',
- 'src/core/lib/slice/slice_utils.h',
'src/core/lib/surface/api_trace.h',
+ 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/channel.h',
@@ -693,18 +895,15 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h',
- 'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
- 'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
+ 'src/core/lib/transport/parsed_metadata.h',
'src/core/lib/transport/pid_controller.h',
- 'src/core/lib/transport/static_metadata.h',
'src/core/lib/transport/status_conversion.h',
- 'src/core/lib/transport/status_metadata.h',
'src/core/lib/transport/timeout_encoding.h',
'src/core/lib/transport/transport.h',
'src/core/lib/transport/transport_impl.h',
@@ -729,6 +928,7 @@ Pod::Spec.new do |s|
'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h',
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.h',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
'src/core/tsi/ssl/session_cache/ssl_session_cache.h',
'src/core/tsi/ssl_transport_security.h',
@@ -764,9 +964,8 @@ Pod::Spec.new do |s|
'src/cpp/common/secure_channel_arguments.cc',
'src/cpp/common/secure_create_auth_context.cc',
'src/cpp/common/tls_certificate_provider.cc',
+ 'src/cpp/common/tls_certificate_verifier.cc',
'src/cpp/common/tls_credentials_options.cc',
- 'src/cpp/common/tls_credentials_options_util.cc',
- 'src/cpp/common/tls_credentials_options_util.h',
'src/cpp/common/validate_service_config.cc',
'src/cpp/common/version_cc.cc',
'src/cpp/server/async_generic_service.cc',
@@ -823,25 +1022,30 @@ Pod::Spec.new do |s|
'third_party/re2/util/test.h',
'third_party/re2/util/utf.h',
'third_party/re2/util/util.h',
- 'third_party/upb/third_party/wyhash/wyhash.h',
+ 'third_party/upb/third_party/utf8_range/utf8_range.h',
'third_party/upb/upb/decode.h',
- 'third_party/upb/upb/decode.int.h',
'third_party/upb/upb/decode_fast.h',
+ 'third_party/upb/upb/decode_internal.h',
'third_party/upb/upb/def.h',
'third_party/upb/upb/def.hpp',
'third_party/upb/upb/encode.h',
+ 'third_party/upb/upb/json_encode.h',
'third_party/upb/upb/msg.h',
+ 'third_party/upb/upb/msg_internal.h',
'third_party/upb/upb/port_def.inc',
'third_party/upb/upb/port_undef.inc',
'third_party/upb/upb/reflection.h',
- 'third_party/upb/upb/table.int.h',
+ 'third_party/upb/upb/reflection.hpp',
+ 'third_party/upb/upb/table_internal.h',
'third_party/upb/upb/text_encode.h',
'third_party/upb/upb/upb.h',
'third_party/upb/upb/upb.hpp',
- 'third_party/upb/upb/upb.int.h',
+ 'third_party/upb/upb/upb_internal.h',
'third_party/xxhash/xxhash.h'
- ss.private_header_files = 'src/core/ext/filters/client_channel/backend_metric.h',
+ ss.private_header_files = 'src/core/ext/filters/channel_idle/channel_idle_filter.h',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.h',
+ 'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.h',
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
@@ -859,7 +1063,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h',
@@ -871,25 +1074,20 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
- 'src/core/ext/filters/client_channel/resolver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
- 'src/core/ext/filters/client_channel/resolver_factory.h',
- 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/filters/client_channel/resolver_result_parsing.h',
'src/core/ext/filters/client_channel/retry_filter.h',
'src/core/ext/filters/client_channel/retry_service_config.h',
'src/core/ext/filters/client_channel/retry_throttle.h',
- 'src/core/ext/filters/client_channel/server_address.h',
- 'src/core/ext/filters/client_channel/service_config.h',
- 'src/core/ext/filters/client_channel/service_config_call_data.h',
- 'src/core/ext/filters/client_channel/service_config_parser.h',
'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_interface.h',
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/fault_injection/fault_injection_filter.h',
'src/core/ext/filters/fault_injection/service_config_parser.h',
@@ -898,12 +1096,32 @@ Pod::Spec.new do |s|
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
- 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
- 'src/core/ext/filters/workarounds/workaround_utils.h',
+ 'src/core/ext/filters/rbac/rbac_filter.h',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.h',
+ 'src/core/ext/transport/binder/client/binder_connector.h',
+ 'src/core/ext/transport/binder/client/channel_create_impl.h',
+ 'src/core/ext/transport/binder/client/connection_id_generator.h',
+ 'src/core/ext/transport/binder/client/endpoint_binder_pool.h',
+ 'src/core/ext/transport/binder/client/jni_utils.h',
+ 'src/core/ext/transport/binder/client/security_policy_setting.h',
+ 'src/core/ext/transport/binder/server/binder_server.h',
+ 'src/core/ext/transport/binder/transport/binder_stream.h',
+ 'src/core/ext/transport/binder/transport/binder_transport.h',
+ 'src/core/ext/transport/binder/utils/binder_auto_utils.h',
+ 'src/core/ext/transport/binder/utils/ndk_binder.h',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver.h',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h',
+ 'src/core/ext/transport/binder/wire_format/binder.h',
+ 'src/core/ext/transport/binder/wire_format/binder_android.h',
+ 'src/core/ext/transport/binder/wire_format/binder_constants.h',
+ 'src/core/ext/transport/binder/wire_format/transaction.h',
+ 'src/core/ext/transport/binder/wire_format/wire_reader.h',
+ 'src/core/ext/transport/binder/wire_format/wire_reader_impl.h',
+ 'src/core/ext/transport/binder/wire_format/wire_writer.h',
'src/core/ext/transport/chttp2/alpn/alpn.h',
- 'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@@ -918,17 +1136,27 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_rst_stream.h',
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_constants.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
- 'src/core/ext/transport/chttp2/transport/hpack_table.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h',
'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h',
'src/core/ext/upb-generated/envoy/annotations/resource.upb.h',
'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h',
@@ -937,51 +1165,67 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h',
'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h',
'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h',
@@ -992,14 +1236,19 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h',
'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/range.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
@@ -1008,26 +1257,47 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.h',
'src/core/ext/upb-generated/udpa/annotations/security.upb.h',
'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h',
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.h',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h',
@@ -1036,50 +1306,67 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h',
@@ -1090,12 +1377,19 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h',
@@ -1104,38 +1398,65 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h',
'src/core/ext/xds/certificate_provider_factory.h',
'src/core/ext/xds/certificate_provider_registry.h',
'src/core/ext/xds/certificate_provider_store.h',
'src/core/ext/xds/file_watcher_certificate_provider_factory.h',
+ 'src/core/ext/xds/upb_utils.h',
'src/core/ext/xds/xds_api.h',
'src/core/ext/xds/xds_bootstrap.h',
'src/core/ext/xds/xds_certificate_provider.h',
'src/core/ext/xds/xds_channel_args.h',
+ 'src/core/ext/xds/xds_channel_stack_modifier.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
+ 'src/core/ext/xds/xds_cluster.h',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.h',
+ 'src/core/ext/xds/xds_common_types.h',
+ 'src/core/ext/xds/xds_endpoint.h',
'src/core/ext/xds/xds_http_fault_filter.h',
'src/core/ext/xds/xds_http_filters.h',
+ 'src/core/ext/xds/xds_http_rbac_filter.h',
+ 'src/core/ext/xds/xds_listener.h',
+ 'src/core/ext/xds/xds_resource_type.h',
+ 'src/core/ext/xds/xds_resource_type_impl.h',
+ 'src/core/ext/xds/xds_route_config.h',
+ 'src/core/ext/xds/xds_routing.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
+ 'src/core/lib/channel/call_finalization.h',
+ 'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
+ 'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
+ 'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_trace.h',
'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
@@ -1144,19 +1465,18 @@ Pod::Spec.new do |s|
'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h',
+ 'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
- 'src/core/lib/compression/algorithm_metadata.h',
- 'src/core/lib/compression/compression_args.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
- 'src/core/lib/compression/stream_compression.h',
- 'src/core/lib/compression/stream_compression_gzip.h',
- 'src/core/lib/compression/stream_compression_identity.h',
+ 'src/core/lib/config/core_configuration.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.h',
+ 'src/core/lib/event_engine/event_engine_factory.h',
+ 'src/core/lib/event_engine/sockaddr.h',
'src/core/lib/gpr/alloc.h',
- 'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
@@ -1164,14 +1484,14 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/string_windows.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tls.h',
- 'src/core/lib/gpr/tls_gcc.h',
- 'src/core/lib/gpr/tls_msvc.h',
- 'src/core/lib/gpr/tls_pthread.h',
- 'src/core/lib/gpr/tls_stdcpp.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
- 'src/core/lib/gprpp/atomic.h',
+ 'src/core/lib/gprpp/atomic_utils.h',
+ 'src/core/lib/gprpp/bitset.h',
+ 'src/core/lib/gprpp/capture.h',
+ 'src/core/lib/gprpp/chunked_vector.h',
+ 'src/core/lib/gprpp/construct_destruct.h',
+ 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/examine_stack.h',
@@ -1182,18 +1502,24 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/manual_constructor.h',
+ 'src/core/lib/gprpp/match.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/orphanable.h',
+ 'src/core/lib/gprpp/overload.h',
'src/core/lib/gprpp/ref_counted.h',
'src/core/lib/gprpp/ref_counted_ptr.h',
+ 'src/core/lib/gprpp/single_set_ptr.h',
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/status_helper.h',
'src/core/lib/gprpp/sync.h',
+ 'src/core/lib/gprpp/table.h',
'src/core/lib/gprpp/thd.h',
+ 'src/core/lib/gprpp/time.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
+ 'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
@@ -1210,9 +1536,14 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/error_internal.h',
'src/core/lib/iomgr/ev_apple.h',
'src/core/lib/iomgr/ev_epoll1_linux.h',
- 'src/core/lib/iomgr/ev_epollex_linux.h',
'src/core/lib/iomgr/ev_poll_posix.h',
'src/core/lib/iomgr/ev_posix.h',
+ 'src/core/lib/iomgr/event_engine/closure.h',
+ 'src/core/lib/iomgr/event_engine/endpoint.h',
+ 'src/core/lib/iomgr/event_engine/pollset.h',
+ 'src/core/lib/iomgr/event_engine/promise.h',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.h',
+ 'src/core/lib/iomgr/event_engine/resolver.h',
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/executor/mpmcqueue.h',
@@ -1222,27 +1553,23 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
- 'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
- 'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
'src/core/lib/iomgr/nameser.h',
'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.h',
- 'src/core/lib/iomgr/pollset_custom.h',
'src/core/lib/iomgr/pollset_set.h',
- 'src/core/lib/iomgr/pollset_set_custom.h',
'src/core/lib/iomgr/pollset_set_windows.h',
- 'src/core/lib/iomgr/pollset_uv.h',
'src/core/lib/iomgr/pollset_windows.h',
'src/core/lib/iomgr/port.h',
'src/core/lib/iomgr/python_util.h',
'src/core/lib/iomgr/resolve_address.h',
- 'src/core/lib/iomgr/resolve_address_custom.h',
- 'src/core/lib/iomgr/resource_quota.h',
+ 'src/core/lib/iomgr/resolve_address_impl.h',
+ 'src/core/lib/iomgr/resolve_address_posix.h',
+ 'src/core/lib/iomgr/resolve_address_windows.h',
+ 'src/core/lib/iomgr/resolved_address.h',
'src/core/lib/iomgr/sockaddr.h',
- 'src/core/lib/iomgr/sockaddr_custom.h',
'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.h',
@@ -1250,21 +1577,17 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/socket_utils.h',
'src/core/lib/iomgr/socket_utils_posix.h',
'src/core/lib/iomgr/socket_windows.h',
- 'src/core/lib/iomgr/sys_epoll_wrapper.h',
'src/core/lib/iomgr/tcp_client.h',
'src/core/lib/iomgr/tcp_client_posix.h',
- 'src/core/lib/iomgr/tcp_custom.h',
'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.h',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.h',
'src/core/lib/iomgr/timer.h',
- 'src/core/lib/iomgr/timer_custom.h',
'src/core/lib/iomgr/timer_generic.h',
'src/core/lib/iomgr/timer_heap.h',
'src/core/lib/iomgr/timer_manager.h',
- 'src/core/lib/iomgr/udp_server.h',
'src/core/lib/iomgr/unix_sockets_posix.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
@@ -1273,10 +1596,49 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_util.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/profiling/timers.h',
+ 'src/core/lib/promise/activity.h',
+ 'src/core/lib/promise/arena_promise.h',
+ 'src/core/lib/promise/call_push_pull.h',
+ 'src/core/lib/promise/context.h',
+ 'src/core/lib/promise/detail/basic_seq.h',
+ 'src/core/lib/promise/detail/promise_factory.h',
+ 'src/core/lib/promise/detail/promise_like.h',
+ 'src/core/lib/promise/detail/status.h',
+ 'src/core/lib/promise/detail/switch.h',
+ 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h',
+ 'src/core/lib/promise/intra_activity_waiter.h',
+ 'src/core/lib/promise/latch.h',
+ 'src/core/lib/promise/loop.h',
+ 'src/core/lib/promise/map.h',
+ 'src/core/lib/promise/poll.h',
+ 'src/core/lib/promise/promise.h',
+ 'src/core/lib/promise/race.h',
+ 'src/core/lib/promise/seq.h',
+ 'src/core/lib/promise/sleep.h',
+ 'src/core/lib/promise/try_seq.h',
+ 'src/core/lib/resolver/resolver.h',
+ 'src/core/lib/resolver/resolver_factory.h',
+ 'src/core/lib/resolver/resolver_registry.h',
+ 'src/core/lib/resolver/server_address.h',
+ 'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
+ 'src/core/lib/resource_quota/memory_quota.h',
+ 'src/core/lib/resource_quota/resource_quota.h',
+ 'src/core/lib/resource_quota/thread_quota.h',
+ 'src/core/lib/resource_quota/trace.h',
+ 'src/core/lib/security/authorization/authorization_engine.h',
+ 'src/core/lib/security/authorization/authorization_policy_provider.h',
+ 'src/core/lib/security/authorization/evaluate_args.h',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.h',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.h',
+ 'src/core/lib/security/authorization/matchers.h',
+ 'src/core/lib/security/authorization/rbac_policy.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h',
+ 'src/core/lib/security/credentials/call_creds_util.h',
+ 'src/core/lib/security/credentials/channel_creds_registry.h',
'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h',
'src/core/lib/security/credentials/external/aws_external_account_credentials.h',
@@ -1287,6 +1649,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/fake/fake_credentials.h',
'src/core/lib/security/credentials/google_default/google_default_credentials.h',
'src/core/lib/security/credentials/iam/iam_credentials.h',
+ 'src/core/lib/security/credentials/insecure/insecure_credentials.h',
'src/core/lib/security/credentials/jwt/json_token.h',
'src/core/lib/security/credentials/jwt/jwt_credentials.h',
'src/core/lib/security/credentials/jwt/jwt_verifier.h',
@@ -1296,6 +1659,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/ssl/ssl_credentials.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h',
'src/core/lib/security/credentials/tls/tls_credentials.h',
'src/core/lib/security/credentials/tls/tls_utils.h',
@@ -1316,12 +1680,20 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_handshaker.h',
'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.h',
+ 'src/core/lib/service_config/service_config.h',
+ 'src/core/lib/service_config/service_config_call_data.h',
+ 'src/core/lib/service_config/service_config_impl.h',
+ 'src/core/lib/service_config/service_config_parser.h',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.h',
+ 'src/core/lib/slice/slice.h',
'src/core/lib/slice/slice_internal.h',
+ 'src/core/lib/slice/slice_refcount.h',
+ 'src/core/lib/slice/slice_refcount_base.h',
+ 'src/core/lib/slice/slice_split.h',
'src/core/lib/slice/slice_string_helpers.h',
- 'src/core/lib/slice/slice_utils.h',
'src/core/lib/surface/api_trace.h',
+ 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/channel.h',
@@ -1334,18 +1706,15 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h',
- 'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
- 'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
+ 'src/core/lib/transport/parsed_metadata.h',
'src/core/lib/transport/pid_controller.h',
- 'src/core/lib/transport/static_metadata.h',
'src/core/lib/transport/status_conversion.h',
- 'src/core/lib/transport/status_metadata.h',
'src/core/lib/transport/timeout_encoding.h',
'src/core/lib/transport/transport.h',
'src/core/lib/transport/transport_impl.h',
@@ -1370,6 +1739,7 @@ Pod::Spec.new do |s|
'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h',
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.h',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
'src/core/tsi/ssl/session_cache/ssl_session_cache.h',
'src/core/tsi/ssl_transport_security.h',
@@ -1381,7 +1751,6 @@ Pod::Spec.new do |s|
'src/cpp/client/secure_credentials.h',
'src/cpp/common/channel_filter.h',
'src/cpp/common/secure_auth_context.h',
- 'src/cpp/common/tls_credentials_options_util.h',
'src/cpp/server/dynamic_thread_pool.h',
'src/cpp/server/external_connection_acceptor_impl.h',
'src/cpp/server/health/default_health_check_service.h',
@@ -1414,22 +1783,25 @@ Pod::Spec.new do |s|
'third_party/re2/util/test.h',
'third_party/re2/util/utf.h',
'third_party/re2/util/util.h',
- 'third_party/upb/third_party/wyhash/wyhash.h',
+ 'third_party/upb/third_party/utf8_range/utf8_range.h',
'third_party/upb/upb/decode.h',
- 'third_party/upb/upb/decode.int.h',
'third_party/upb/upb/decode_fast.h',
+ 'third_party/upb/upb/decode_internal.h',
'third_party/upb/upb/def.h',
'third_party/upb/upb/def.hpp',
'third_party/upb/upb/encode.h',
+ 'third_party/upb/upb/json_encode.h',
'third_party/upb/upb/msg.h',
+ 'third_party/upb/upb/msg_internal.h',
'third_party/upb/upb/port_def.inc',
'third_party/upb/upb/port_undef.inc',
'third_party/upb/upb/reflection.h',
- 'third_party/upb/upb/table.int.h',
+ 'third_party/upb/upb/reflection.hpp',
+ 'third_party/upb/upb/table_internal.h',
'third_party/upb/upb/text_encode.h',
'third_party/upb/upb/upb.h',
'third_party/upb/upb/upb.hpp',
- 'third_party/upb/upb/upb.int.h',
+ 'third_party/upb/upb/upb_internal.h',
'third_party/xxhash/xxhash.h'
end
@@ -1461,18 +1833,11 @@ Pod::Spec.new do |s|
ss.source_files = "src/cpp/client/cronet_credentials.cc"
end
+ # patch include of openssl to openssl_grpc
+ # patch xxhash.h to silent the -Wdocumentation error
s.prepare_command = <<-END_OF_COMMAND
+ set -e
find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g'
- find third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "third_party/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/third_party/\\1"\\\n#else\\\n #include "third_party/\\1"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\\\n #include "src/core/ext/upb-generated/\\1.upb.h"\\\n#else\\\n #include "\\1.upb.h"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upbdefs.h";#if COCOAPODS==1\\\n #include "src/core/ext/upbdefs-generated/\\1.upbdefs.h"\\\n#else\\\n #include "\\1.upbdefs.h"\\\n#endif;g'
- find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
- find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
- find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
diff --git a/grpc/gRPC-Core.podspec b/grpc/gRPC-Core.podspec
index eb58cccd..bcdc48e8 100644
--- a/grpc/gRPC-Core.podspec
+++ b/grpc/gRPC-Core.podspec
@@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
- version = '1.38.0'
+ version = '1.46.5'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
@@ -46,7 +46,7 @@ Pod::Spec.new do |s|
s.requires_arc = false
name = 'grpc'
- abseil_version = '1.20210324.0'
+ abseil_version = '1.20211102.0'
# When creating a dynamic framework, name it grpc.framework instead of gRPC-Core.framework.
# This lets users write their includes like `#include <grpc/grpc.h>` as opposed to `#include
@@ -69,24 +69,14 @@ Pod::Spec.new do |s|
s.module_map = 'include/grpc/module.modulemap'
# To compile the library, we need the user headers search path (quoted includes) to point to the
- # root of the repo, and the system headers search path (angled includes) to point to `include/`.
- # Cocoapods effectively clones the repo under `<Podfile dir>/Pods/gRPC-Core/`, and sets a build
- # variable called `$(PODS_ROOT)` to `<Podfile dir>/Pods/`, so we use that.
- #
- # Relying on the file structure under $(PODS_ROOT) isn't officially supported in Cocoapods, as it
- # is taken as an implementation detail. We've asked for an alternative, and have been told that
- # what we're doing should keep working: https://github.com/CocoaPods/CocoaPods/issues/4386
- #
- # The `src_root` value of `$(PODS_ROOT)/gRPC-Core` assumes Cocoapods is installing this pod from
- # its remote repo. For local development of this library, enabled by using `:path` in the Podfile,
- # that assumption is wrong. In such case, the following settings need to be reset with the
- # appropriate value of `src_root`. This can be accomplished in the `pre_install` hook of the
- # Podfile; see `src/objective-c/tests/Podfile` for an example.
- src_root = '$(PODS_ROOT)/gRPC-Core'
+ # root of the repo, third_party/** and two upb generated directories, and the system headers
+ # search path (angled includes) to point to `include/`.
s.pod_target_xcconfig = {
- 'GRPC_SRC_ROOT' => src_root,
- 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
- 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
+ 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(PODS_TARGET_SRCROOT)/include"',
+ 'USER_HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)"'\
+ ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upb-generated"'\
+ ' "$(PODS_TARGET_SRCROOT)/src/core/ext/upbdefs-generated"'\
+ ' "$(PODS_TARGET_SRCROOT)/third_party/**"',
# If we don't set these two settings, `include/grpc/support/time.h` and
# `src/core/lib/gpr/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
# build.
@@ -117,6 +107,11 @@ Pod::Spec.new do |s|
'include/grpc/byte_buffer_reader.h',
'include/grpc/census.h',
'include/grpc/compression.h',
+ 'include/grpc/event_engine/endpoint_config.h',
+ 'include/grpc/event_engine/event_engine.h',
+ 'include/grpc/event_engine/internal/memory_allocator_impl.h',
+ 'include/grpc/event_engine/memory_allocator.h',
+ 'include/grpc/event_engine/memory_request.h',
'include/grpc/event_engine/port.h',
'include/grpc/fork.h',
'include/grpc/grpc.h',
@@ -174,22 +169,33 @@ Pod::Spec.new do |s|
ss.header_mappings_dir = '.'
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
- ss.dependency 'BoringSSL-GRPC', '0.0.18'
+ ss.dependency 'BoringSSL-GRPC', '0.0.24'
+ ss.dependency 'Libuv-gRPC', '0.0.10'
ss.dependency 'abseil/base/base', abseil_version
+ ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version
+ ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
+ ss.dependency 'abseil/random/random', abseil_version
ss.dependency 'abseil/status/status', abseil_version
ss.dependency 'abseil/status/statusor', abseil_version
+ ss.dependency 'abseil/strings/cord', abseil_version
ss.dependency 'abseil/strings/str_format', abseil_version
ss.dependency 'abseil/strings/strings', abseil_version
ss.dependency 'abseil/synchronization/synchronization', abseil_version
ss.dependency 'abseil/time/time', abseil_version
ss.dependency 'abseil/types/optional', abseil_version
+ ss.dependency 'abseil/types/variant', abseil_version
+ ss.dependency 'abseil/utility/utility', abseil_version
ss.compiler_flags = '-DBORINGSSL_PREFIX=GRPC -Wno-unreachable-code -Wno-shorten-64-to-32'
ss.source_files = 'src/core/ext/filters/census/grpc_context.cc',
+ 'src/core/ext/filters/channel_idle/channel_idle_filter.cc',
+ 'src/core/ext/filters/channel_idle/channel_idle_filter.h',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.cc',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.h',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.cc',
@@ -227,8 +233,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'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.h',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
- '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/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc',
@@ -237,6 +241,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/priority/priority.cc',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h',
+ 'src/core/ext/filters/client_channel/lb_policy/rls/rls.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h',
'src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc',
@@ -254,16 +259,15 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
- 'src/core/ext/filters/client_channel/resolver.cc',
- 'src/core/ext/filters/client_channel/resolver.h',
+ 'src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
@@ -272,12 +276,11 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
- 'src/core/ext/filters/client_channel/resolver_factory.h',
- 'src/core/ext/filters/client_channel/resolver_registry.cc',
- 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/filters/client_channel/resolver_result_parsing.cc',
'src/core/ext/filters/client_channel/resolver_result_parsing.h',
'src/core/ext/filters/client_channel/retry_filter.cc',
@@ -286,20 +289,14 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/retry_service_config.h',
'src/core/ext/filters/client_channel/retry_throttle.cc',
'src/core/ext/filters/client_channel/retry_throttle.h',
- 'src/core/ext/filters/client_channel/server_address.cc',
- 'src/core/ext/filters/client_channel/server_address.h',
- 'src/core/ext/filters/client_channel/service_config.cc',
- 'src/core/ext/filters/client_channel/service_config.h',
- 'src/core/ext/filters/client_channel/service_config_call_data.h',
'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_parser.h',
'src/core/ext/filters/client_channel/subchannel.cc',
'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_interface.h',
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
- 'src/core/ext/filters/client_idle/client_idle_filter.cc',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.cc',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.h',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/fault_injection/fault_injection_filter.cc',
@@ -317,33 +314,26 @@ Pod::Spec.new do |s|
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.cc',
'src/core/ext/filters/http/server/http_server_filter.h',
- 'src/core/ext/filters/max_age/max_age_filter.cc',
- 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.h',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
- 'src/core/ext/filters/workarounds/workaround_utils.cc',
- 'src/core/ext/filters/workarounds/workaround_utils.h',
+ 'src/core/ext/filters/rbac/rbac_filter.cc',
+ 'src/core/ext/filters/rbac/rbac_filter.h',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.cc',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.h',
'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/alpn/alpn.h',
- 'src/core/ext/transport/chttp2/client/authority.cc',
- 'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
- 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
'src/core/ext/transport/chttp2/server/chttp2_server.cc',
'src/core/ext/transport/chttp2/server/chttp2_server.h',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc',
- 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc',
'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
'src/core/ext/transport/chttp2/transport/bin_decoder.h',
'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
'src/core/ext/transport/chttp2/transport/bin_encoder.h',
- 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
'src/core/ext/transport/chttp2/transport/chttp2_transport.cc',
'src/core/ext/transport/chttp2/transport/chttp2_transport.h',
'src/core/ext/transport/chttp2/transport/context_list.cc',
@@ -363,18 +353,19 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_constants.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
- 'src/core/ext/transport/chttp2/transport/hpack_table.cc',
- 'src/core/ext/transport/chttp2/transport/hpack_table.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.cc',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/parsing.cc',
'src/core/ext/transport/chttp2/transport/stream_lists.cc',
@@ -386,8 +377,26 @@ Pod::Spec.new do |s|
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/inproc_transport.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h',
'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c',
'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h',
'src/core/ext/upb-generated/envoy/annotations/resource.upb.c',
@@ -404,6 +413,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c',
'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c',
@@ -416,6 +427,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c',
@@ -426,10 +439,14 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c',
@@ -442,8 +459,12 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c',
@@ -456,14 +477,36 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
@@ -476,24 +519,22 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c',
'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c',
'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h',
'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c',
'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c',
@@ -514,14 +555,22 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c',
'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/percent.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/range.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/range.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c',
@@ -530,6 +579,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.h',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.c',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
@@ -546,6 +597,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c',
@@ -556,6 +609,10 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.c',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.h',
'src/core/ext/upb-generated/udpa/annotations/security.upb.c',
@@ -566,26 +623,62 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.c',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.h',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.c',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c',
@@ -602,6 +695,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c',
@@ -614,6 +709,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c',
@@ -624,10 +721,14 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c',
@@ -640,26 +741,54 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
@@ -672,24 +801,22 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c',
@@ -710,18 +837,32 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.c',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c',
@@ -738,6 +879,10 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c',
@@ -748,22 +893,40 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h',
'src/core/ext/xds/certificate_provider_factory.h',
'src/core/ext/xds/certificate_provider_registry.cc',
'src/core/ext/xds/certificate_provider_registry.h',
@@ -771,6 +934,7 @@ Pod::Spec.new do |s|
'src/core/ext/xds/certificate_provider_store.h',
'src/core/ext/xds/file_watcher_certificate_provider_factory.cc',
'src/core/ext/xds/file_watcher_certificate_provider_factory.h',
+ 'src/core/ext/xds/upb_utils.h',
'src/core/ext/xds/xds_api.cc',
'src/core/ext/xds/xds_api.h',
'src/core/ext/xds/xds_bootstrap.cc',
@@ -778,29 +942,55 @@ Pod::Spec.new do |s|
'src/core/ext/xds/xds_certificate_provider.cc',
'src/core/ext/xds/xds_certificate_provider.h',
'src/core/ext/xds/xds_channel_args.h',
+ 'src/core/ext/xds/xds_channel_stack_modifier.cc',
+ 'src/core/ext/xds/xds_channel_stack_modifier.h',
'src/core/ext/xds/xds_client.cc',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.cc',
'src/core/ext/xds/xds_client_stats.h',
+ 'src/core/ext/xds/xds_cluster.cc',
+ 'src/core/ext/xds/xds_cluster.h',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.cc',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.h',
+ 'src/core/ext/xds/xds_common_types.cc',
+ 'src/core/ext/xds/xds_common_types.h',
+ 'src/core/ext/xds/xds_endpoint.cc',
+ 'src/core/ext/xds/xds_endpoint.h',
'src/core/ext/xds/xds_http_fault_filter.cc',
'src/core/ext/xds/xds_http_fault_filter.h',
'src/core/ext/xds/xds_http_filters.cc',
'src/core/ext/xds/xds_http_filters.h',
+ 'src/core/ext/xds/xds_http_rbac_filter.cc',
+ 'src/core/ext/xds/xds_http_rbac_filter.h',
+ 'src/core/ext/xds/xds_listener.cc',
+ 'src/core/ext/xds/xds_listener.h',
+ 'src/core/ext/xds/xds_resource_type.cc',
+ 'src/core/ext/xds/xds_resource_type.h',
+ 'src/core/ext/xds/xds_resource_type_impl.h',
+ 'src/core/ext/xds/xds_route_config.cc',
+ 'src/core/ext/xds/xds_route_config.h',
+ 'src/core/ext/xds/xds_routing.cc',
+ 'src/core/ext/xds/xds_routing.h',
'src/core/ext/xds/xds_server_config_fetcher.cc',
'src/core/lib/address_utils/parse_address.cc',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.cc',
'src/core/lib/address_utils/sockaddr_utils.h',
- 'src/core/lib/avl/avl.cc',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/backoff/backoff.h',
+ 'src/core/lib/channel/call_finalization.h',
+ 'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_args.h',
+ 'src/core/lib/channel/channel_args_preconditioning.cc',
+ 'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_stack_builder.h',
+ 'src/core/lib/channel/channel_stack_builder_impl.cc',
+ 'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_trace.cc',
'src/core/lib/channel/channel_trace.h',
'src/core/lib/channel/channelz.cc',
@@ -815,31 +1005,34 @@ Pod::Spec.new do |s|
'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.cc',
'src/core/lib/channel/handshaker_registry.h',
+ 'src/core/lib/channel/promise_based_filter.cc',
+ 'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.cc',
'src/core/lib/channel/status_util.h',
- 'src/core/lib/compression/algorithm_metadata.h',
'src/core/lib/compression/compression.cc',
- 'src/core/lib/compression/compression_args.cc',
- 'src/core/lib/compression/compression_args.h',
'src/core/lib/compression/compression_internal.cc',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.cc',
'src/core/lib/compression/message_compress.h',
- 'src/core/lib/compression/stream_compression.cc',
- 'src/core/lib/compression/stream_compression.h',
- 'src/core/lib/compression/stream_compression_gzip.cc',
- 'src/core/lib/compression/stream_compression_gzip.h',
- 'src/core/lib/compression/stream_compression_identity.cc',
- 'src/core/lib/compression/stream_compression_identity.h',
+ 'src/core/lib/config/core_configuration.cc',
+ 'src/core/lib/config/core_configuration.h',
'src/core/lib/debug/stats.cc',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.cc',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.cc',
'src/core/lib/debug/trace.h',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.cc',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.h',
+ 'src/core/lib/event_engine/default_event_engine_factory.cc',
+ 'src/core/lib/event_engine/event_engine.cc',
+ 'src/core/lib/event_engine/event_engine_factory.h',
+ 'src/core/lib/event_engine/memory_allocator.cc',
+ 'src/core/lib/event_engine/resolved_address.cc',
+ 'src/core/lib/event_engine/sockaddr.cc',
+ 'src/core/lib/event_engine/sockaddr.h',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/alloc.h',
- 'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/cpu_iphone.cc',
'src/core/lib/gpr/cpu_linux.cc',
@@ -873,20 +1066,18 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/time_windows.cc',
'src/core/lib/gpr/tls.h',
- 'src/core/lib/gpr/tls_gcc.h',
- 'src/core/lib/gpr/tls_msvc.h',
- 'src/core/lib/gpr/tls_pthread.cc',
- 'src/core/lib/gpr/tls_pthread.h',
- 'src/core/lib/gpr/tls_stdcpp.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/tmpfile_msys.cc',
'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/useful.h',
'src/core/lib/gpr/wrap_memcpy.cc',
- 'src/core/lib/gprpp/arena.cc',
- 'src/core/lib/gprpp/arena.h',
- 'src/core/lib/gprpp/atomic.h',
+ 'src/core/lib/gprpp/atomic_utils.h',
+ 'src/core/lib/gprpp/bitset.h',
+ 'src/core/lib/gprpp/capture.h',
+ 'src/core/lib/gprpp/chunked_vector.h',
+ 'src/core/lib/gprpp/construct_destruct.h',
+ 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/examine_stack.cc',
@@ -901,21 +1092,27 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/manual_constructor.h',
+ 'src/core/lib/gprpp/match.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.cc',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/orphanable.h',
+ 'src/core/lib/gprpp/overload.h',
'src/core/lib/gprpp/ref_counted.h',
'src/core/lib/gprpp/ref_counted_ptr.h',
+ 'src/core/lib/gprpp/single_set_ptr.h',
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/stat_posix.cc',
'src/core/lib/gprpp/stat_windows.cc',
'src/core/lib/gprpp/status_helper.cc',
'src/core/lib/gprpp/status_helper.h',
'src/core/lib/gprpp/sync.h',
+ 'src/core/lib/gprpp/table.h',
'src/core/lib/gprpp/thd.h',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
+ 'src/core/lib/gprpp/time.cc',
+ 'src/core/lib/gprpp/time.h',
'src/core/lib/gprpp/time_util.cc',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.cc',
@@ -923,6 +1120,7 @@ Pod::Spec.new do |s|
'src/core/lib/http/httpcli.cc',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/httpcli_security_connector.cc',
+ 'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.cc',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
@@ -942,8 +1140,8 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/endpoint_cfstream.cc',
'src/core/lib/iomgr/endpoint_cfstream.h',
'src/core/lib/iomgr/endpoint_pair.h',
+ 'src/core/lib/iomgr/endpoint_pair_event_engine.cc',
'src/core/lib/iomgr/endpoint_pair_posix.cc',
- 'src/core/lib/iomgr/endpoint_pair_uv.cc',
'src/core/lib/iomgr/endpoint_pair_windows.cc',
'src/core/lib/iomgr/error.cc',
'src/core/lib/iomgr/error.h',
@@ -954,13 +1152,25 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/ev_apple.h',
'src/core/lib/iomgr/ev_epoll1_linux.cc',
'src/core/lib/iomgr/ev_epoll1_linux.h',
- 'src/core/lib/iomgr/ev_epollex_linux.cc',
- 'src/core/lib/iomgr/ev_epollex_linux.h',
'src/core/lib/iomgr/ev_poll_posix.cc',
'src/core/lib/iomgr/ev_poll_posix.h',
'src/core/lib/iomgr/ev_posix.cc',
'src/core/lib/iomgr/ev_posix.h',
'src/core/lib/iomgr/ev_windows.cc',
+ 'src/core/lib/iomgr/event_engine/closure.cc',
+ 'src/core/lib/iomgr/event_engine/closure.h',
+ 'src/core/lib/iomgr/event_engine/endpoint.cc',
+ 'src/core/lib/iomgr/event_engine/endpoint.h',
+ 'src/core/lib/iomgr/event_engine/iomgr.cc',
+ 'src/core/lib/iomgr/event_engine/pollset.cc',
+ 'src/core/lib/iomgr/event_engine/pollset.h',
+ 'src/core/lib/iomgr/event_engine/promise.h',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.cc',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.h',
+ 'src/core/lib/iomgr/event_engine/resolver.cc',
+ 'src/core/lib/iomgr/event_engine/resolver.h',
+ 'src/core/lib/iomgr/event_engine/tcp.cc',
+ 'src/core/lib/iomgr/event_engine/timer.cc',
'src/core/lib/iomgr/exec_ctx.cc',
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.cc',
@@ -984,16 +1194,11 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.cc',
'src/core/lib/iomgr/iomgr.h',
- 'src/core/lib/iomgr/iomgr_custom.cc',
- 'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.cc',
'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.cc',
'src/core/lib/iomgr/iomgr_posix_cfstream.cc',
- 'src/core/lib/iomgr/iomgr_uv.cc',
'src/core/lib/iomgr/iomgr_windows.cc',
- 'src/core/lib/iomgr/is_epollexclusive_available.cc',
- 'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.cc',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.cc',
@@ -1003,31 +1208,25 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.cc',
'src/core/lib/iomgr/pollset.h',
- 'src/core/lib/iomgr/pollset_custom.cc',
- 'src/core/lib/iomgr/pollset_custom.h',
'src/core/lib/iomgr/pollset_set.cc',
'src/core/lib/iomgr/pollset_set.h',
- 'src/core/lib/iomgr/pollset_set_custom.cc',
- 'src/core/lib/iomgr/pollset_set_custom.h',
'src/core/lib/iomgr/pollset_set_windows.cc',
'src/core/lib/iomgr/pollset_set_windows.h',
- 'src/core/lib/iomgr/pollset_uv.cc',
- 'src/core/lib/iomgr/pollset_uv.h',
'src/core/lib/iomgr/pollset_windows.cc',
'src/core/lib/iomgr/pollset_windows.h',
'src/core/lib/iomgr/port.h',
'src/core/lib/iomgr/python_util.h',
'src/core/lib/iomgr/resolve_address.cc',
'src/core/lib/iomgr/resolve_address.h',
- 'src/core/lib/iomgr/resolve_address_custom.cc',
- 'src/core/lib/iomgr/resolve_address_custom.h',
+ 'src/core/lib/iomgr/resolve_address_impl.h',
'src/core/lib/iomgr/resolve_address_posix.cc',
+ 'src/core/lib/iomgr/resolve_address_posix.h',
'src/core/lib/iomgr/resolve_address_windows.cc',
- 'src/core/lib/iomgr/resource_quota.cc',
- 'src/core/lib/iomgr/resource_quota.h',
+ 'src/core/lib/iomgr/resolve_address_windows.h',
+ 'src/core/lib/iomgr/resolved_address.h',
'src/core/lib/iomgr/sockaddr.h',
- 'src/core/lib/iomgr/sockaddr_custom.h',
'src/core/lib/iomgr/sockaddr_posix.h',
+ 'src/core/lib/iomgr/sockaddr_utils_posix.cc',
'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.cc',
'src/core/lib/iomgr/socket_factory_posix.h',
@@ -1038,49 +1237,37 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/socket_utils_linux.cc',
'src/core/lib/iomgr/socket_utils_posix.cc',
'src/core/lib/iomgr/socket_utils_posix.h',
- 'src/core/lib/iomgr/socket_utils_uv.cc',
'src/core/lib/iomgr/socket_utils_windows.cc',
'src/core/lib/iomgr/socket_windows.cc',
'src/core/lib/iomgr/socket_windows.h',
- 'src/core/lib/iomgr/sys_epoll_wrapper.h',
'src/core/lib/iomgr/tcp_client.cc',
'src/core/lib/iomgr/tcp_client.h',
'src/core/lib/iomgr/tcp_client_cfstream.cc',
- 'src/core/lib/iomgr/tcp_client_custom.cc',
'src/core/lib/iomgr/tcp_client_posix.cc',
'src/core/lib/iomgr/tcp_client_posix.h',
'src/core/lib/iomgr/tcp_client_windows.cc',
- 'src/core/lib/iomgr/tcp_custom.cc',
- 'src/core/lib/iomgr/tcp_custom.h',
'src/core/lib/iomgr/tcp_posix.cc',
'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.cc',
'src/core/lib/iomgr/tcp_server.h',
- 'src/core/lib/iomgr/tcp_server_custom.cc',
'src/core/lib/iomgr/tcp_server_posix.cc',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_server_utils_posix_common.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
'src/core/lib/iomgr/tcp_server_windows.cc',
- 'src/core/lib/iomgr/tcp_uv.cc',
'src/core/lib/iomgr/tcp_windows.cc',
'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.cc',
'src/core/lib/iomgr/time_averaged_stats.h',
'src/core/lib/iomgr/timer.cc',
'src/core/lib/iomgr/timer.h',
- 'src/core/lib/iomgr/timer_custom.cc',
- 'src/core/lib/iomgr/timer_custom.h',
'src/core/lib/iomgr/timer_generic.cc',
'src/core/lib/iomgr/timer_generic.h',
'src/core/lib/iomgr/timer_heap.cc',
'src/core/lib/iomgr/timer_heap.h',
'src/core/lib/iomgr/timer_manager.cc',
'src/core/lib/iomgr/timer_manager.h',
- 'src/core/lib/iomgr/timer_uv.cc',
- 'src/core/lib/iomgr/udp_server.cc',
- 'src/core/lib/iomgr/udp_server.h',
'src/core/lib/iomgr/unix_sockets_posix.cc',
'src/core/lib/iomgr/unix_sockets_posix.h',
'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
@@ -1102,6 +1289,60 @@ Pod::Spec.new do |s|
'src/core/lib/profiling/basic_timers.cc',
'src/core/lib/profiling/stap_timers.cc',
'src/core/lib/profiling/timers.h',
+ 'src/core/lib/promise/activity.cc',
+ 'src/core/lib/promise/activity.h',
+ 'src/core/lib/promise/arena_promise.h',
+ 'src/core/lib/promise/call_push_pull.h',
+ 'src/core/lib/promise/context.h',
+ 'src/core/lib/promise/detail/basic_seq.h',
+ 'src/core/lib/promise/detail/promise_factory.h',
+ 'src/core/lib/promise/detail/promise_like.h',
+ 'src/core/lib/promise/detail/status.h',
+ 'src/core/lib/promise/detail/switch.h',
+ 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h',
+ 'src/core/lib/promise/intra_activity_waiter.h',
+ 'src/core/lib/promise/latch.h',
+ 'src/core/lib/promise/loop.h',
+ 'src/core/lib/promise/map.h',
+ 'src/core/lib/promise/poll.h',
+ 'src/core/lib/promise/promise.h',
+ 'src/core/lib/promise/race.h',
+ 'src/core/lib/promise/seq.h',
+ 'src/core/lib/promise/sleep.cc',
+ 'src/core/lib/promise/sleep.h',
+ 'src/core/lib/promise/try_seq.h',
+ 'src/core/lib/resolver/resolver.cc',
+ 'src/core/lib/resolver/resolver.h',
+ 'src/core/lib/resolver/resolver_factory.h',
+ 'src/core/lib/resolver/resolver_registry.cc',
+ 'src/core/lib/resolver/resolver_registry.h',
+ 'src/core/lib/resolver/server_address.cc',
+ 'src/core/lib/resolver/server_address.h',
+ 'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.cc',
+ 'src/core/lib/resource_quota/arena.h',
+ 'src/core/lib/resource_quota/memory_quota.cc',
+ 'src/core/lib/resource_quota/memory_quota.h',
+ 'src/core/lib/resource_quota/resource_quota.cc',
+ 'src/core/lib/resource_quota/resource_quota.h',
+ 'src/core/lib/resource_quota/thread_quota.cc',
+ 'src/core/lib/resource_quota/thread_quota.h',
+ 'src/core/lib/resource_quota/trace.cc',
+ 'src/core/lib/resource_quota/trace.h',
+ 'src/core/lib/security/authorization/authorization_engine.h',
+ 'src/core/lib/security/authorization/authorization_policy_provider.h',
+ 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc',
+ 'src/core/lib/security/authorization/evaluate_args.cc',
+ 'src/core/lib/security/authorization/evaluate_args.h',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.cc',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.h',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.cc',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.h',
+ 'src/core/lib/security/authorization/matchers.cc',
+ 'src/core/lib/security/authorization/matchers.h',
+ 'src/core/lib/security/authorization/rbac_policy.cc',
+ 'src/core/lib/security/authorization/rbac_policy.h',
'src/core/lib/security/context/security_context.cc',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.cc',
@@ -1115,11 +1356,14 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc',
+ 'src/core/lib/security/credentials/call_creds_util.cc',
+ 'src/core/lib/security/credentials/call_creds_util.h',
+ 'src/core/lib/security/credentials/channel_creds_registry.h',
+ 'src/core/lib/security/credentials/channel_creds_registry_init.cc',
'src/core/lib/security/credentials/composite/composite_credentials.cc',
'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.cc',
'src/core/lib/security/credentials/credentials.h',
- 'src/core/lib/security/credentials/credentials_metadata.cc',
'src/core/lib/security/credentials/external/aws_external_account_credentials.cc',
'src/core/lib/security/credentials/external/aws_external_account_credentials.h',
'src/core/lib/security/credentials/external/aws_request_signer.cc',
@@ -1138,6 +1382,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/iam/iam_credentials.cc',
'src/core/lib/security/credentials/iam/iam_credentials.h',
'src/core/lib/security/credentials/insecure/insecure_credentials.cc',
+ 'src/core/lib/security/credentials/insecure/insecure_credentials.h',
'src/core/lib/security/credentials/jwt/json_token.cc',
'src/core/lib/security/credentials/jwt/json_token.h',
'src/core/lib/security/credentials/jwt/jwt_credentials.cc',
@@ -1156,6 +1401,8 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h',
'src/core/lib/security/credentials/tls/tls_credentials.cc',
@@ -1197,19 +1444,32 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.cc',
'src/core/lib/security/util/json_util.h',
+ 'src/core/lib/service_config/service_config.h',
+ 'src/core/lib/service_config/service_config_call_data.h',
+ 'src/core/lib/service_config/service_config_impl.cc',
+ 'src/core/lib/service_config/service_config_impl.h',
+ 'src/core/lib/service_config/service_config_parser.cc',
+ 'src/core/lib/service_config/service_config_parser.h',
'src/core/lib/slice/b64.cc',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.cc',
'src/core/lib/slice/percent_encoding.h',
'src/core/lib/slice/slice.cc',
+ 'src/core/lib/slice/slice.h',
+ 'src/core/lib/slice/slice_api.cc',
'src/core/lib/slice/slice_buffer.cc',
- 'src/core/lib/slice/slice_intern.cc',
'src/core/lib/slice/slice_internal.h',
+ 'src/core/lib/slice/slice_refcount.cc',
+ 'src/core/lib/slice/slice_refcount.h',
+ 'src/core/lib/slice/slice_refcount_base.h',
+ 'src/core/lib/slice/slice_split.cc',
+ 'src/core/lib/slice/slice_split.h',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/slice/slice_string_helpers.h',
- 'src/core/lib/slice/slice_utils.h',
'src/core/lib/surface/api_trace.cc',
'src/core/lib/surface/api_trace.h',
+ 'src/core/lib/surface/builtins.cc',
+ 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -1232,7 +1492,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/event_string.h',
'src/core/lib/surface/init.cc',
'src/core/lib/surface/init.h',
- 'src/core/lib/surface/init_secure.cc',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/metadata_array.cc',
@@ -1241,8 +1500,6 @@ Pod::Spec.new do |s|
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/version.cc',
- 'src/core/lib/transport/authority_override.cc',
- 'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.cc',
@@ -1252,18 +1509,13 @@ Pod::Spec.new do |s|
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
- 'src/core/lib/transport/metadata.cc',
- 'src/core/lib/transport/metadata.h',
- 'src/core/lib/transport/metadata_batch.cc',
'src/core/lib/transport/metadata_batch.h',
+ 'src/core/lib/transport/parsed_metadata.cc',
+ 'src/core/lib/transport/parsed_metadata.h',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/pid_controller.h',
- 'src/core/lib/transport/static_metadata.cc',
- 'src/core/lib/transport/static_metadata.h',
'src/core/lib/transport/status_conversion.cc',
'src/core/lib/transport/status_conversion.h',
- 'src/core/lib/transport/status_metadata.cc',
- 'src/core/lib/transport/status_metadata.h',
'src/core/lib/transport/timeout_encoding.cc',
'src/core/lib/transport/timeout_encoding.h',
'src/core/lib/transport/transport.cc',
@@ -1273,6 +1525,7 @@ Pod::Spec.new do |s|
'src/core/lib/uri/uri_parser.cc',
'src/core/lib/uri/uri_parser.h',
'src/core/plugin_registry/grpc_plugin_registry.cc',
+ 'src/core/plugin_registry/grpc_plugin_registry_extra.cc',
'src/core/tsi/alts/crypt/aes_gcm.cc',
'src/core/tsi/alts/crypt/gsec.cc',
'src/core/tsi/alts/crypt/gsec.h',
@@ -1314,6 +1567,8 @@ Pod::Spec.new do |s|
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.cc',
'src/core/tsi/local_transport_security.h',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.cc',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc',
'src/core/tsi/ssl/session_cache/ssl_session_cache.cc',
@@ -1376,33 +1631,42 @@ Pod::Spec.new do |s|
'third_party/re2/util/test.h',
'third_party/re2/util/utf.h',
'third_party/re2/util/util.h',
- 'third_party/upb/third_party/wyhash/wyhash.h',
+ 'third_party/upb/third_party/utf8_range/naive.c',
+ 'third_party/upb/third_party/utf8_range/range2-neon.c',
+ 'third_party/upb/third_party/utf8_range/range2-sse.c',
+ 'third_party/upb/third_party/utf8_range/utf8_range.h',
'third_party/upb/upb/decode.c',
'third_party/upb/upb/decode.h',
- 'third_party/upb/upb/decode.int.h',
'third_party/upb/upb/decode_fast.c',
'third_party/upb/upb/decode_fast.h',
+ 'third_party/upb/upb/decode_internal.h',
'third_party/upb/upb/def.c',
'third_party/upb/upb/def.h',
'third_party/upb/upb/def.hpp',
'third_party/upb/upb/encode.c',
'third_party/upb/upb/encode.h',
+ 'third_party/upb/upb/json_encode.c',
+ 'third_party/upb/upb/json_encode.h',
'third_party/upb/upb/msg.c',
'third_party/upb/upb/msg.h',
+ 'third_party/upb/upb/msg_internal.h',
'third_party/upb/upb/port_def.inc',
'third_party/upb/upb/port_undef.inc',
'third_party/upb/upb/reflection.c',
'third_party/upb/upb/reflection.h',
+ 'third_party/upb/upb/reflection.hpp',
'third_party/upb/upb/table.c',
- 'third_party/upb/upb/table.int.h',
+ 'third_party/upb/upb/table_internal.h',
'third_party/upb/upb/text_encode.c',
'third_party/upb/upb/text_encode.h',
'third_party/upb/upb/upb.c',
'third_party/upb/upb/upb.h',
'third_party/upb/upb/upb.hpp',
- 'third_party/upb/upb/upb.int.h',
+ 'third_party/upb/upb/upb_internal.h',
'third_party/xxhash/xxhash.h'
- ss.private_header_files = 'src/core/ext/filters/client_channel/backend_metric.h',
+ ss.private_header_files = 'src/core/ext/filters/channel_idle/channel_idle_filter.h',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.h',
+ 'src/core/ext/filters/client_channel/backend_metric.h',
'src/core/ext/filters/client_channel/backup_poller.h',
'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/filters/client_channel/client_channel_channelz.h',
@@ -1420,7 +1684,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h',
- 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h',
@@ -1432,25 +1695,20 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
- 'src/core/ext/filters/client_channel/resolver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
- 'src/core/ext/filters/client_channel/resolver_factory.h',
- 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/filters/client_channel/resolver_result_parsing.h',
'src/core/ext/filters/client_channel/retry_filter.h',
'src/core/ext/filters/client_channel/retry_service_config.h',
'src/core/ext/filters/client_channel/retry_throttle.h',
- 'src/core/ext/filters/client_channel/server_address.h',
- 'src/core/ext/filters/client_channel/service_config.h',
- 'src/core/ext/filters/client_channel/service_config_call_data.h',
- 'src/core/ext/filters/client_channel/service_config_parser.h',
'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_interface.h',
'src/core/ext/filters/client_channel/subchannel_pool_interface.h',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/fault_injection/fault_injection_filter.h',
'src/core/ext/filters/fault_injection/service_config_parser.h',
@@ -1459,12 +1717,12 @@ Pod::Spec.new do |s|
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
- 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h',
- 'src/core/ext/filters/workarounds/workaround_utils.h',
+ 'src/core/ext/filters/rbac/rbac_filter.h',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.h',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.h',
'src/core/ext/transport/chttp2/alpn/alpn.h',
- 'src/core/ext/transport/chttp2/client/authority.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/transport/chttp2/transport/bin_decoder.h',
@@ -1479,17 +1737,27 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_rst_stream.h',
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_constants.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
- 'src/core/ext/transport/chttp2/transport/hpack_table.h',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/inproc/inproc_transport.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h',
'src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h',
'src/core/ext/upb-generated/envoy/annotations/resource.upb.h',
'src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h',
@@ -1498,51 +1766,67 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h',
'src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h',
'src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h',
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h',
- 'src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h',
+ 'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h',
'src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h',
- 'src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h',
'src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h',
- 'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h',
'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h',
@@ -1553,14 +1837,19 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h',
'src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h',
'src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/percent.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/range.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h',
'src/core/ext/upb-generated/google/api/annotations.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h',
'src/core/ext/upb-generated/google/api/http.upb.h',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.h',
'src/core/ext/upb-generated/google/protobuf/any.upb.h',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h',
'src/core/ext/upb-generated/google/protobuf/duration.upb.h',
@@ -1569,26 +1858,47 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h',
'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h',
'src/core/ext/upb-generated/google/rpc/status.upb.h',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.h',
'src/core/ext/upb-generated/udpa/annotations/security.upb.h',
'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h',
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.h',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.h',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h',
@@ -1597,50 +1907,67 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h',
@@ -1651,12 +1978,19 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h',
@@ -1665,38 +1999,65 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h',
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h',
'src/core/ext/xds/certificate_provider_factory.h',
'src/core/ext/xds/certificate_provider_registry.h',
'src/core/ext/xds/certificate_provider_store.h',
'src/core/ext/xds/file_watcher_certificate_provider_factory.h',
+ 'src/core/ext/xds/upb_utils.h',
'src/core/ext/xds/xds_api.h',
'src/core/ext/xds/xds_bootstrap.h',
'src/core/ext/xds/xds_certificate_provider.h',
'src/core/ext/xds/xds_channel_args.h',
+ 'src/core/ext/xds/xds_channel_stack_modifier.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
+ 'src/core/ext/xds/xds_cluster.h',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.h',
+ 'src/core/ext/xds/xds_common_types.h',
+ 'src/core/ext/xds/xds_endpoint.h',
'src/core/ext/xds/xds_http_fault_filter.h',
'src/core/ext/xds/xds_http_filters.h',
+ 'src/core/ext/xds/xds_http_rbac_filter.h',
+ 'src/core/ext/xds/xds_listener.h',
+ 'src/core/ext/xds/xds_resource_type.h',
+ 'src/core/ext/xds/xds_resource_type_impl.h',
+ 'src/core/ext/xds/xds_route_config.h',
+ 'src/core/ext/xds/xds_routing.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
+ 'src/core/lib/channel/call_finalization.h',
+ 'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
+ 'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
+ 'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_trace.h',
'src/core/lib/channel/channelz.h',
'src/core/lib/channel/channelz_registry.h',
@@ -1705,19 +2066,18 @@ Pod::Spec.new do |s|
'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h',
+ 'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
- 'src/core/lib/compression/algorithm_metadata.h',
- 'src/core/lib/compression/compression_args.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
- 'src/core/lib/compression/stream_compression.h',
- 'src/core/lib/compression/stream_compression_gzip.h',
- 'src/core/lib/compression/stream_compression_identity.h',
+ 'src/core/lib/config/core_configuration.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.h',
+ 'src/core/lib/event_engine/event_engine_factory.h',
+ 'src/core/lib/event_engine/sockaddr.h',
'src/core/lib/gpr/alloc.h',
- 'src/core/lib/gpr/arena.h',
'src/core/lib/gpr/env.h',
'src/core/lib/gpr/murmur_hash.h',
'src/core/lib/gpr/spinlock.h',
@@ -1725,14 +2085,14 @@ Pod::Spec.new do |s|
'src/core/lib/gpr/string_windows.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tls.h',
- 'src/core/lib/gpr/tls_gcc.h',
- 'src/core/lib/gpr/tls_msvc.h',
- 'src/core/lib/gpr/tls_pthread.h',
- 'src/core/lib/gpr/tls_stdcpp.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
- 'src/core/lib/gprpp/arena.h',
- 'src/core/lib/gprpp/atomic.h',
+ 'src/core/lib/gprpp/atomic_utils.h',
+ 'src/core/lib/gprpp/bitset.h',
+ 'src/core/lib/gprpp/capture.h',
+ 'src/core/lib/gprpp/chunked_vector.h',
+ 'src/core/lib/gprpp/construct_destruct.h',
+ 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/examine_stack.h',
@@ -1743,18 +2103,24 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/manual_constructor.h',
+ 'src/core/lib/gprpp/match.h',
'src/core/lib/gprpp/memory.h',
'src/core/lib/gprpp/mpscq.h',
'src/core/lib/gprpp/orphanable.h',
+ 'src/core/lib/gprpp/overload.h',
'src/core/lib/gprpp/ref_counted.h',
'src/core/lib/gprpp/ref_counted_ptr.h',
+ 'src/core/lib/gprpp/single_set_ptr.h',
'src/core/lib/gprpp/stat.h',
'src/core/lib/gprpp/status_helper.h',
'src/core/lib/gprpp/sync.h',
+ 'src/core/lib/gprpp/table.h',
'src/core/lib/gprpp/thd.h',
+ 'src/core/lib/gprpp/time.h',
'src/core/lib/gprpp/time_util.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
+ 'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
@@ -1771,9 +2137,14 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/error_internal.h',
'src/core/lib/iomgr/ev_apple.h',
'src/core/lib/iomgr/ev_epoll1_linux.h',
- 'src/core/lib/iomgr/ev_epollex_linux.h',
'src/core/lib/iomgr/ev_poll_posix.h',
'src/core/lib/iomgr/ev_posix.h',
+ 'src/core/lib/iomgr/event_engine/closure.h',
+ 'src/core/lib/iomgr/event_engine/endpoint.h',
+ 'src/core/lib/iomgr/event_engine/pollset.h',
+ 'src/core/lib/iomgr/event_engine/promise.h',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.h',
+ 'src/core/lib/iomgr/event_engine/resolver.h',
'src/core/lib/iomgr/exec_ctx.h',
'src/core/lib/iomgr/executor.h',
'src/core/lib/iomgr/executor/mpmcqueue.h',
@@ -1783,27 +2154,23 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/internal_errqueue.h',
'src/core/lib/iomgr/iocp_windows.h',
'src/core/lib/iomgr/iomgr.h',
- 'src/core/lib/iomgr/iomgr_custom.h',
'src/core/lib/iomgr/iomgr_internal.h',
- 'src/core/lib/iomgr/is_epollexclusive_available.h',
'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
'src/core/lib/iomgr/nameser.h',
'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.h',
- 'src/core/lib/iomgr/pollset_custom.h',
'src/core/lib/iomgr/pollset_set.h',
- 'src/core/lib/iomgr/pollset_set_custom.h',
'src/core/lib/iomgr/pollset_set_windows.h',
- 'src/core/lib/iomgr/pollset_uv.h',
'src/core/lib/iomgr/pollset_windows.h',
'src/core/lib/iomgr/port.h',
'src/core/lib/iomgr/python_util.h',
'src/core/lib/iomgr/resolve_address.h',
- 'src/core/lib/iomgr/resolve_address_custom.h',
- 'src/core/lib/iomgr/resource_quota.h',
+ 'src/core/lib/iomgr/resolve_address_impl.h',
+ 'src/core/lib/iomgr/resolve_address_posix.h',
+ 'src/core/lib/iomgr/resolve_address_windows.h',
+ 'src/core/lib/iomgr/resolved_address.h',
'src/core/lib/iomgr/sockaddr.h',
- 'src/core/lib/iomgr/sockaddr_custom.h',
'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.h',
@@ -1811,21 +2178,17 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/socket_utils.h',
'src/core/lib/iomgr/socket_utils_posix.h',
'src/core/lib/iomgr/socket_windows.h',
- 'src/core/lib/iomgr/sys_epoll_wrapper.h',
'src/core/lib/iomgr/tcp_client.h',
'src/core/lib/iomgr/tcp_client_posix.h',
- 'src/core/lib/iomgr/tcp_custom.h',
'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.h',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.h',
'src/core/lib/iomgr/timer.h',
- 'src/core/lib/iomgr/timer_custom.h',
'src/core/lib/iomgr/timer_generic.h',
'src/core/lib/iomgr/timer_heap.h',
'src/core/lib/iomgr/timer_manager.h',
- 'src/core/lib/iomgr/udp_server.h',
'src/core/lib/iomgr/unix_sockets_posix.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
@@ -1834,10 +2197,49 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_util.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/profiling/timers.h',
+ 'src/core/lib/promise/activity.h',
+ 'src/core/lib/promise/arena_promise.h',
+ 'src/core/lib/promise/call_push_pull.h',
+ 'src/core/lib/promise/context.h',
+ 'src/core/lib/promise/detail/basic_seq.h',
+ 'src/core/lib/promise/detail/promise_factory.h',
+ 'src/core/lib/promise/detail/promise_like.h',
+ 'src/core/lib/promise/detail/status.h',
+ 'src/core/lib/promise/detail/switch.h',
+ 'src/core/lib/promise/exec_ctx_wakeup_scheduler.h',
+ 'src/core/lib/promise/intra_activity_waiter.h',
+ 'src/core/lib/promise/latch.h',
+ 'src/core/lib/promise/loop.h',
+ 'src/core/lib/promise/map.h',
+ 'src/core/lib/promise/poll.h',
+ 'src/core/lib/promise/promise.h',
+ 'src/core/lib/promise/race.h',
+ 'src/core/lib/promise/seq.h',
+ 'src/core/lib/promise/sleep.h',
+ 'src/core/lib/promise/try_seq.h',
+ 'src/core/lib/resolver/resolver.h',
+ 'src/core/lib/resolver/resolver_factory.h',
+ 'src/core/lib/resolver/resolver_registry.h',
+ 'src/core/lib/resolver/server_address.h',
+ 'src/core/lib/resource_quota/api.h',
+ 'src/core/lib/resource_quota/arena.h',
+ 'src/core/lib/resource_quota/memory_quota.h',
+ 'src/core/lib/resource_quota/resource_quota.h',
+ 'src/core/lib/resource_quota/thread_quota.h',
+ 'src/core/lib/resource_quota/trace.h',
+ 'src/core/lib/security/authorization/authorization_engine.h',
+ 'src/core/lib/security/authorization/authorization_policy_provider.h',
+ 'src/core/lib/security/authorization/evaluate_args.h',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.h',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.h',
+ 'src/core/lib/security/authorization/matchers.h',
+ 'src/core/lib/security/authorization/rbac_policy.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h',
+ 'src/core/lib/security/credentials/call_creds_util.h',
+ 'src/core/lib/security/credentials/channel_creds_registry.h',
'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h',
'src/core/lib/security/credentials/external/aws_external_account_credentials.h',
@@ -1848,6 +2250,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/fake/fake_credentials.h',
'src/core/lib/security/credentials/google_default/google_default_credentials.h',
'src/core/lib/security/credentials/iam/iam_credentials.h',
+ 'src/core/lib/security/credentials/insecure/insecure_credentials.h',
'src/core/lib/security/credentials/jwt/json_token.h',
'src/core/lib/security/credentials/jwt/jwt_credentials.h',
'src/core/lib/security/credentials/jwt/jwt_verifier.h',
@@ -1857,6 +2260,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials/ssl/ssl_credentials.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h',
'src/core/lib/security/credentials/tls/tls_credentials.h',
'src/core/lib/security/credentials/tls/tls_utils.h',
@@ -1877,12 +2281,20 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_handshaker.h',
'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.h',
+ 'src/core/lib/service_config/service_config.h',
+ 'src/core/lib/service_config/service_config_call_data.h',
+ 'src/core/lib/service_config/service_config_impl.h',
+ 'src/core/lib/service_config/service_config_parser.h',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.h',
+ 'src/core/lib/slice/slice.h',
'src/core/lib/slice/slice_internal.h',
+ 'src/core/lib/slice/slice_refcount.h',
+ 'src/core/lib/slice/slice_refcount_base.h',
+ 'src/core/lib/slice/slice_split.h',
'src/core/lib/slice/slice_string_helpers.h',
- 'src/core/lib/slice/slice_utils.h',
'src/core/lib/surface/api_trace.h',
+ 'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/channel.h',
@@ -1895,18 +2307,15 @@ Pod::Spec.new do |s|
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/validate_metadata.h',
- 'src/core/lib/transport/authority_override.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/byte_stream.h',
'src/core/lib/transport/connectivity_state.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
- 'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
+ 'src/core/lib/transport/parsed_metadata.h',
'src/core/lib/transport/pid_controller.h',
- 'src/core/lib/transport/static_metadata.h',
'src/core/lib/transport/status_conversion.h',
- 'src/core/lib/transport/status_metadata.h',
'src/core/lib/transport/timeout_encoding.h',
'src/core/lib/transport/transport.h',
'src/core/lib/transport/transport_impl.h',
@@ -1931,6 +2340,7 @@ Pod::Spec.new do |s|
'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h',
'src/core/tsi/fake_transport_security.h',
'src/core/tsi/local_transport_security.h',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.h',
'src/core/tsi/ssl/session_cache/ssl_session.h',
'src/core/tsi/ssl/session_cache/ssl_session_cache.h',
'src/core/tsi/ssl_transport_security.h',
@@ -1964,22 +2374,25 @@ Pod::Spec.new do |s|
'third_party/re2/util/test.h',
'third_party/re2/util/utf.h',
'third_party/re2/util/util.h',
- 'third_party/upb/third_party/wyhash/wyhash.h',
+ 'third_party/upb/third_party/utf8_range/utf8_range.h',
'third_party/upb/upb/decode.h',
- 'third_party/upb/upb/decode.int.h',
'third_party/upb/upb/decode_fast.h',
+ 'third_party/upb/upb/decode_internal.h',
'third_party/upb/upb/def.h',
'third_party/upb/upb/def.hpp',
'third_party/upb/upb/encode.h',
+ 'third_party/upb/upb/json_encode.h',
'third_party/upb/upb/msg.h',
+ 'third_party/upb/upb/msg_internal.h',
'third_party/upb/upb/port_def.inc',
'third_party/upb/upb/port_undef.inc',
'third_party/upb/upb/reflection.h',
- 'third_party/upb/upb/table.int.h',
+ 'third_party/upb/upb/reflection.hpp',
+ 'third_party/upb/upb/table_internal.h',
'third_party/upb/upb/text_encode.h',
'third_party/upb/upb/upb.h',
'third_party/upb/upb/upb.hpp',
- 'third_party/upb/upb/upb.int.h',
+ 'third_party/upb/upb/upb_internal.h',
'third_party/xxhash/xxhash.h'
end
@@ -2018,7 +2431,13 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/debugging/stacktrace', abseil_version
ss.dependency 'abseil/debugging/symbolize', abseil_version
- ss.source_files = 'test/core/end2end/cq_verifier.cc',
+ ss.source_files = 'src/core/lib/security/authorization/grpc_authorization_policy_provider.cc',
+ 'src/core/lib/security/authorization/grpc_authorization_policy_provider.h',
+ 'src/core/lib/security/authorization/rbac_translator.cc',
+ 'src/core/lib/security/authorization/rbac_translator.h',
+ 'test/core/compression/args_utils.cc',
+ 'test/core/compression/args_utils.h',
+ 'test/core/end2end/cq_verifier.cc',
'test/core/end2end/cq_verifier.h',
'test/core/end2end/data/client_certs.cc',
'test/core/end2end/data/server1_cert.cc',
@@ -2060,10 +2479,11 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/filter_init_fails.cc',
'test/core/end2end/tests/filter_latency.cc',
'test/core/end2end/tests/filter_status_code.cc',
+ 'test/core/end2end/tests/filtered_metadata.cc',
'test/core/end2end/tests/graceful_server_shutdown.cc',
+ 'test/core/end2end/tests/grpc_authz.cc',
'test/core/end2end/tests/high_initial_seqno.cc',
'test/core/end2end/tests/hpack_size.cc',
- 'test/core/end2end/tests/idempotent_request.cc',
'test/core/end2end/tests/invoke_large_request.cc',
'test/core/end2end/tests/keepalive_timeout.cc',
'test/core/end2end/tests/large_metadata.cc',
@@ -2084,16 +2504,27 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/request_with_payload.cc',
'test/core/end2end/tests/resource_quota_server.cc',
'test/core/end2end/tests/retry.cc',
+ 'test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc',
'test/core/end2end/tests/retry_cancel_during_delay.cc',
+ 'test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc',
'test/core/end2end/tests/retry_cancellation.cc',
'test/core/end2end/tests/retry_disabled.cc',
+ 'test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc',
'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc',
'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc',
'test/core/end2end/tests/retry_lb_drop.cc',
+ 'test/core/end2end/tests/retry_lb_fail.cc',
'test/core/end2end/tests/retry_non_retriable_status.cc',
'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc',
+ 'test/core/end2end/tests/retry_per_attempt_recv_timeout.cc',
+ 'test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc',
'test/core/end2end/tests/retry_recv_initial_metadata.cc',
'test/core/end2end/tests/retry_recv_message.cc',
+ 'test/core/end2end/tests/retry_recv_message_replay.cc',
+ 'test/core/end2end/tests/retry_recv_trailing_metadata_error.cc',
+ 'test/core/end2end/tests/retry_send_initial_metadata_refs.cc',
+ 'test/core/end2end/tests/retry_send_op_fails.cc',
+ 'test/core/end2end/tests/retry_send_recv_batch.cc',
'test/core/end2end/tests/retry_server_pushback_delay.cc',
'test/core/end2end/tests/retry_server_pushback_disabled.cc',
'test/core/end2end/tests/retry_streaming.cc',
@@ -2101,22 +2532,26 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc',
'test/core/end2end/tests/retry_throttled.cc',
'test/core/end2end/tests/retry_too_many_attempts.cc',
+ 'test/core/end2end/tests/retry_transparent_goaway.cc',
+ 'test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc',
+ 'test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc',
+ 'test/core/end2end/tests/retry_unref_before_finish.cc',
+ 'test/core/end2end/tests/retry_unref_before_recv.cc',
'test/core/end2end/tests/server_finishes_request.cc',
'test/core/end2end/tests/server_streaming.cc',
'test/core/end2end/tests/shutdown_finishes_calls.cc',
'test/core/end2end/tests/shutdown_finishes_tags.cc',
- 'test/core/end2end/tests/simple_cacheable_request.cc',
'test/core/end2end/tests/simple_delayed_request.cc',
'test/core/end2end/tests/simple_metadata.cc',
'test/core/end2end/tests/simple_request.cc',
- 'test/core/end2end/tests/stream_compression_compressed_payload.cc',
- 'test/core/end2end/tests/stream_compression_payload.cc',
- 'test/core/end2end/tests/stream_compression_ping_pong_streaming.cc',
'test/core/end2end/tests/streaming_error_response.cc',
'test/core/end2end/tests/trailing_metadata.cc',
- 'test/core/end2end/tests/workaround_cronet_compression.cc',
'test/core/end2end/tests/write_buffering.cc',
'test/core/end2end/tests/write_buffering_at_end.cc',
+ 'test/core/event_engine/test_init.cc',
+ 'test/core/event_engine/test_init.h',
+ 'test/core/util/build.cc',
+ 'test/core/util/build.h',
'test/core/util/cmdline.cc',
'test/core/util/cmdline.h',
'test/core/util/evaluate_args_test_util.h',
@@ -2126,8 +2561,6 @@ Pod::Spec.new do |s|
'test/core/util/grpc_profiler.h',
'test/core/util/histogram.cc',
'test/core/util/histogram.h',
- 'test/core/util/memory_counters.cc',
- 'test/core/util/memory_counters.h',
'test/core/util/mock_authorization_endpoint.h',
'test/core/util/mock_endpoint.cc',
'test/core/util/mock_endpoint.h',
@@ -2159,24 +2592,14 @@ Pod::Spec.new do |s|
'test/core/util/tls_utils.cc',
'test/core/util/tls_utils.h',
'test/core/util/tracer_util.cc',
- 'test/core/util/tracer_util.h',
- 'test/core/util/trickle_endpoint.cc',
- 'test/core/util/trickle_endpoint.h'
+ 'test/core/util/tracer_util.h'
end
- # TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
+ # patch include of openssl to openssl_grpc
+ # patch xxhash.h to silent the -Wdocumentation error
s.prepare_command = <<-END_OF_COMMAND
+ set -e
find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g'
- find third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "third_party/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/third_party/\\1"\\\n#else\\\n #include "third_party/\\1"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.hpp' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\\\n #include "src/core/ext/upb-generated/\\1.upb.h"\\\n#else\\\n #include "\\1.upb.h"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upbdefs.h";#if COCOAPODS==1\\\n #include "src/core/ext/upbdefs-generated/\\1.upbdefs.h"\\\n#else\\\n #include "\\1.upbdefs.h"\\\n#endif;g'
- find src/core/ src/cpp/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find third_party/re2/re2/ third_party/re2/util/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g;s;#include "util/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/util/\\1"\\\n#else\\\n #include "util/\\1"\\\n#endif;g'
- find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "re2/(.*)";#if COCOAPODS==1\\\n #include "third_party/re2/re2/\\1"\\\n#else\\\n #include "re2/\\1"\\\n#endif;g'
- find src/core/ third_party/re2/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
- find src/core/ -type f \\( -name '*.h' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "xxhash.h";#if COCOAPODS==1\\\n #include "third_party/xxhash/xxhash.h"\\\n#else\\\n #include "xxhash.h"\\\n#endif;g'
find third_party/xxhash -type f -name xxhash.h -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;@param([^,]*),;@param\\1 ,;g'
find src/core/ third_party/xxhash/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
diff --git a/grpc/gRPC-ProtoRPC.podspec b/grpc/gRPC-ProtoRPC.podspec
index 68dcb4d4..923e2103 100644
--- a/grpc/gRPC-ProtoRPC.podspec
+++ b/grpc/gRPC-ProtoRPC.podspec
@@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
- version = '1.38.0'
+ version = '1.46.5'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
diff --git a/grpc/gRPC-RxLibrary.podspec b/grpc/gRPC-RxLibrary.podspec
index dbfc8de7..422d7428 100644
--- a/grpc/gRPC-RxLibrary.podspec
+++ b/grpc/gRPC-RxLibrary.podspec
@@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
- version = '1.38.0'
+ version = '1.46.5'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
diff --git a/grpc/gRPC.podspec b/grpc/gRPC.podspec
index af62f2e6..548b18a0 100644
--- a/grpc/gRPC.podspec
+++ b/grpc/gRPC.podspec
@@ -20,7 +20,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
- version = '1.38.0'
+ version = '1.46.5'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
diff --git a/grpc/grpc.bzl b/grpc/grpc.bzl
index 06de3bca..5eb25dc0 100644
--- a/grpc/grpc.bzl
+++ b/grpc/grpc.bzl
@@ -23,7 +23,7 @@ This file declares two macros:
def _lower_underscore_to_upper_camel(str):
humps = []
for hump in str.split("_"):
- humps += [hump[0].upper() + hump[1:]]
+ humps.append(hump[0].upper() + hump[1:])
return "".join(humps)
def _file_to_upper_camel(src):
@@ -37,8 +37,9 @@ def _file_with_extension(src, ext):
return "".join(elements[:-1] + [basename, ext])
def _protoc_invocation(srcs, flags):
- """Returns a command line to invoke protoc from a genrule, on the given
- sources, using the given flags.
+ """Returns a CLI command to invoke protoc.
+
+ Uses the given sources and flags. Suitable for use in a genrule.
"""
protoc_command = "$(location //external:protoc) -I . "
srcs_params = ""
@@ -47,15 +48,22 @@ def _protoc_invocation(srcs, flags):
return protoc_command + flags + srcs_params
def objc_proto_library(name, srcs, visibility = None):
- """Declares an objc_library for the code generated by protoc from the given
- proto sources. This generated code doesn't include proto services.
+ """Declares an objc_library for the code generated by protoc.
+
+ Uses the given proto sources. This generated code doesn't include proto
+ services.
+
+ Args:
+ name: The name of the library.
+ srcs: A list of .proto file sources.
+ visibility: The visibility label to apply to the target.
"""
h_files = []
m_files = []
for src in srcs:
src = _file_to_upper_camel(src)
- h_files += [_file_with_extension(src, ".pbobjc.h")]
- m_files += [_file_with_extension(src, ".pbobjc.m")]
+ h_files.append(_file_with_extension(src, ".pbobjc.h"))
+ m_files.append(_file_with_extension(src, ".pbobjc.m"))
protoc_flags = "--objc_out=$(GENDIR)"
@@ -75,9 +83,15 @@ def objc_proto_library(name, srcs, visibility = None):
)
def objc_grpc_library(name, services, other_messages, visibility = None):
- """Declares an objc_library for the code generated by gRPC and protoc from the
- given proto sources (services and other_messages). The generated code doesn't
- include proto services of the files passed as other_messages.
+ """Declares an objc_library for the code generated by the gRPC ObjC plugin.
+
+ The generated code does not include the services of the files in other_messages.
+
+ Args:
+ name: The name of the library.
+ services: The .proto files from which to generate the library.
+ other_messages: A list of .proto files containing messages needed for the library.
+ visibility: The visibility label to apply to the library.
"""
objc_proto_library(name + "_messages", services + other_messages)
@@ -85,8 +99,8 @@ def objc_grpc_library(name, services, other_messages, visibility = None):
m_files = []
for src in services:
src = _file_to_upper_camel(src)
- h_files += [_file_with_extension(src, ".pbrpc.h")]
- m_files += [_file_with_extension(src, ".pbrpc.m")]
+ h_files.append(_file_with_extension(src, ".pbrpc.h"))
+ m_files.append(_file_with_extension(src, ".pbrpc.m"))
protoc_flags = ("--grpc_out=$(GENDIR) --plugin=" +
"protoc-gen-grpc=$(location //external:grpc_protoc_plugin_objc)")
diff --git a/grpc/grpc.def b/grpc/grpc.def
index 7be77a61..9a605619 100644
--- a/grpc/grpc.def
+++ b/grpc/grpc.def
@@ -45,11 +45,14 @@ EXPORTS
grpc_channel_get_target
grpc_channel_get_info
grpc_channel_reset_connect_backoff
- grpc_insecure_channel_create
+ grpc_channel_credentials_release
+ grpc_server_credentials_release
+ grpc_channel_create
grpc_lame_client_channel_create
grpc_channel_destroy
grpc_call_cancel
grpc_call_cancel_with_status
+ grpc_call_failed_before_recv_message
grpc_call_ref
grpc_call_unref
grpc_server_request_call
@@ -60,7 +63,7 @@ EXPORTS
grpc_server_config_fetcher_xds_create
grpc_server_config_fetcher_destroy
grpc_server_set_config_fetcher
- grpc_server_add_insecure_http2_port
+ grpc_server_add_http2_port
grpc_server_start
grpc_server_shutdown_and_notify
grpc_server_cancel_all_calls
@@ -84,8 +87,9 @@ EXPORTS
grpc_channelz_get_channel
grpc_channelz_get_subchannel
grpc_channelz_get_socket
- grpc_insecure_channel_create_from_fd
- grpc_server_add_insecure_channel_from_fd
+ grpc_authorization_policy_provider_arg_vtable
+ grpc_channel_create_from_fd
+ grpc_server_add_channel_from_fd
grpc_auth_property_iterator_next
grpc_auth_context_property_iterator
grpc_auth_context_peer_identity
@@ -101,7 +105,6 @@ EXPORTS
grpc_ssl_session_cache_destroy
grpc_ssl_session_cache_create_channel_arg
grpc_call_credentials_release
- grpc_channel_credentials_release
grpc_google_default_credentials_create
grpc_set_ssl_roots_override_callback
grpc_ssl_credentials_create
@@ -119,8 +122,6 @@ EXPORTS
grpc_auth_metadata_context_copy
grpc_auth_metadata_context_reset
grpc_metadata_credentials_create_from_plugin
- grpc_secure_channel_create
- grpc_server_credentials_release
grpc_ssl_server_certificate_config_create
grpc_ssl_server_certificate_config_destroy
grpc_ssl_server_credentials_create
@@ -129,7 +130,6 @@ EXPORTS
grpc_ssl_server_credentials_create_options_using_config_fetcher
grpc_ssl_server_credentials_options_destroy
grpc_ssl_server_credentials_create_with_options
- grpc_server_add_secure_http2_port
grpc_call_set_credentials
grpc_server_credentials_set_auth_metadata_processor
grpc_alts_credentials_client_options_create
@@ -147,18 +147,23 @@ EXPORTS
grpc_tls_certificate_provider_file_watcher_create
grpc_tls_certificate_provider_release
grpc_tls_credentials_options_create
- grpc_tls_credentials_options_set_cert_request_type
- grpc_tls_credentials_options_set_server_verification_option
grpc_tls_credentials_options_set_certificate_provider
grpc_tls_credentials_options_watch_root_certs
grpc_tls_credentials_options_set_root_cert_name
grpc_tls_credentials_options_watch_identity_key_cert_pairs
grpc_tls_credentials_options_set_identity_cert_name
- grpc_tls_credentials_options_set_server_authorization_check_config
- grpc_tls_server_authorization_check_config_create
- grpc_tls_server_authorization_check_config_release
+ grpc_tls_credentials_options_set_cert_request_type
+ grpc_tls_credentials_options_set_crl_directory
+ grpc_tls_credentials_options_set_verify_server_cert
+ grpc_tls_credentials_options_set_check_call_host
+ grpc_insecure_credentials_create
+ grpc_insecure_server_credentials_create
grpc_xds_credentials_create
grpc_xds_server_credentials_create
+ grpc_authorization_policy_provider_static_data_create
+ grpc_authorization_policy_provider_file_watcher_create
+ grpc_authorization_policy_provider_release
+ grpc_tls_credentials_options_set_tls_session_key_log_file_path
grpc_raw_byte_buffer_create
grpc_raw_compressed_byte_buffer_create
grpc_byte_buffer_copy
@@ -185,7 +190,6 @@ EXPORTS
grpc_slice_new_with_len
grpc_slice_malloc
grpc_slice_malloc_large
- grpc_slice_intern
grpc_slice_from_copied_string
grpc_slice_from_copied_buffer
grpc_slice_from_static_string
@@ -196,8 +200,6 @@ EXPORTS
grpc_slice_split_tail_maybe_ref
grpc_slice_split_head
grpc_empty_slice
- grpc_slice_default_hash_impl
- grpc_slice_default_eq_impl
grpc_slice_eq
grpc_slice_cmp
grpc_slice_str_cmp
@@ -205,7 +207,6 @@ EXPORTS
grpc_slice_rchr
grpc_slice_chr
grpc_slice_slice
- grpc_slice_hash
grpc_slice_is_equivalent
grpc_slice_dup
grpc_slice_to_c_string
diff --git a/grpc/grpc.gemspec b/grpc/grpc.gemspec
index 2185cbf0..16a06e60 100644
--- a/grpc/grpc.gemspec
+++ b/grpc/grpc.gemspec
@@ -13,26 +13,24 @@ Gem::Specification.new do |s|
s.description = 'Send RPCs from Ruby using GRPC'
s.license = 'Apache-2.0'
- s.required_ruby_version = '>= 2.4.0'
+ s.required_ruby_version = '>= 2.5.0'
s.files = %w( Makefile .yardopts )
s.files += %w( etc/roots.pem )
s.files += Dir.glob('src/ruby/bin/**/*')
s.files += Dir.glob('src/ruby/ext/**/*')
- s.files += Dir.glob('src/ruby/lib/**/*').reject do |f|
- # Binaries are included by rake-compiler and would lead to circular dependencies here
- File.fnmatch("**/?.?/grpc_c.so", f)
- end
+ s.files += Dir.glob('src/ruby/lib/**/*')
s.files += Dir.glob('src/ruby/pb/**/*').reject do |f|
f.match(%r{^src/ruby/pb/test})
end
s.files += Dir.glob('include/grpc/**/*')
s.test_files = Dir.glob('src/ruby/spec/**/*')
+ s.test_files += Dir.glob('src/ruby/pb/test/**/*')
s.bindir = 'src/ruby/bin'
s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
s.platform = Gem::Platform::RUBY
- s.add_dependency 'google-protobuf', '~> 3.15'
+ s.add_dependency 'google-protobuf', '~> 3.19'
s.add_dependency 'googleapis-common-protos-types', '~> 1.0'
s.add_development_dependency 'bundler', '>= 1.9'
@@ -40,8 +38,8 @@ Gem::Specification.new do |s|
s.add_development_dependency 'logging', '~> 2.0'
s.add_development_dependency 'simplecov', '~> 0.14.1'
s.add_development_dependency 'rake', '~> 13.0'
- s.add_development_dependency 'rake-compiler', '~> 1.1'
- s.add_development_dependency 'rake-compiler-dock', '~> 1.0'
+ s.add_development_dependency 'rake-compiler', '<= 1.1.1'
+ s.add_development_dependency 'rake-compiler-dock', '~> 1.2'
s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rubocop', '~> 0.49.1'
s.add_development_dependency 'signet', '~> 0.7'
@@ -53,10 +51,12 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/byte_buffer_reader.h )
s.files += %w( include/grpc/census.h )
s.files += %w( include/grpc/compression.h )
- s.files += %w( include/grpc/event_engine/channel_args.h )
+ s.files += %w( include/grpc/event_engine/endpoint_config.h )
s.files += %w( include/grpc/event_engine/event_engine.h )
+ s.files += %w( include/grpc/event_engine/internal/memory_allocator_impl.h )
+ s.files += %w( include/grpc/event_engine/memory_allocator.h )
+ s.files += %w( include/grpc/event_engine/memory_request.h )
s.files += %w( include/grpc/event_engine/port.h )
- s.files += %w( include/grpc/event_engine/slice_allocator.h )
s.files += %w( include/grpc/fork.h )
s.files += %w( include/grpc/grpc.h )
s.files += %w( include/grpc/grpc_posix.h )
@@ -109,6 +109,10 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/time.h )
s.files += %w( include/grpc/support/workaround_list.h )
s.files += %w( src/core/ext/filters/census/grpc_context.cc )
+ s.files += %w( src/core/ext/filters/channel_idle/channel_idle_filter.cc )
+ s.files += %w( src/core/ext/filters/channel_idle/channel_idle_filter.h )
+ s.files += %w( src/core/ext/filters/channel_idle/idle_filter_state.cc )
+ s.files += %w( src/core/ext/filters/channel_idle/idle_filter_state.h )
s.files += %w( src/core/ext/filters/client_channel/backend_metric.cc )
s.files += %w( src/core/ext/filters/client_channel/backend_metric.h )
s.files += %w( src/core/ext/filters/client_channel/backup_poller.cc )
@@ -146,8 +150,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h )
- s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h )
- s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc )
@@ -156,6 +158,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/priority/priority.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h )
+ s.files += %w( src/core/ext/filters/client_channel/lb_policy/rls/rls.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc )
@@ -173,16 +176,15 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/proxy_mapper.h )
s.files += %w( src/core/ext/filters/client_channel/proxy_mapper_registry.cc )
s.files += %w( src/core/ext/filters/client_channel/proxy_mapper_registry.h )
- s.files += %w( src/core/ext/filters/client_channel/resolver.cc )
- s.files += %w( src/core/ext/filters/client_channel/resolver.h )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
- s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
- s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc )
@@ -191,12 +193,11 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/polling_resolver.cc )
+ s.files += %w( src/core/ext/filters/client_channel/resolver/polling_resolver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h )
- s.files += %w( src/core/ext/filters/client_channel/resolver_factory.h )
- s.files += %w( src/core/ext/filters/client_channel/resolver_registry.cc )
- s.files += %w( src/core/ext/filters/client_channel/resolver_registry.h )
s.files += %w( src/core/ext/filters/client_channel/resolver_result_parsing.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver_result_parsing.h )
s.files += %w( src/core/ext/filters/client_channel/retry_filter.cc )
@@ -205,20 +206,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/retry_service_config.h )
s.files += %w( src/core/ext/filters/client_channel/retry_throttle.cc )
s.files += %w( src/core/ext/filters/client_channel/retry_throttle.h )
- s.files += %w( src/core/ext/filters/client_channel/server_address.cc )
- s.files += %w( src/core/ext/filters/client_channel/server_address.h )
- s.files += %w( src/core/ext/filters/client_channel/service_config.cc )
- s.files += %w( src/core/ext/filters/client_channel/service_config.h )
- s.files += %w( src/core/ext/filters/client_channel/service_config_call_data.h )
s.files += %w( src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc )
- s.files += %w( src/core/ext/filters/client_channel/service_config_parser.cc )
- s.files += %w( src/core/ext/filters/client_channel/service_config_parser.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel.cc )
s.files += %w( src/core/ext/filters/client_channel/subchannel.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel_interface.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc )
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h )
- s.files += %w( src/core/ext/filters/client_idle/client_idle_filter.cc )
+ s.files += %w( src/core/ext/filters/client_channel/subchannel_stream_client.cc )
+ s.files += %w( src/core/ext/filters/client_channel/subchannel_stream_client.h )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/filters/fault_injection/fault_injection_filter.cc )
@@ -236,33 +231,26 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/http/message_compress/message_decompress_filter.h )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.cc )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.h )
- s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc )
- s.files += %w( src/core/ext/filters/max_age/max_age_filter.h )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.cc )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.h )
- s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc )
- s.files += %w( src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h )
- s.files += %w( src/core/ext/filters/workarounds/workaround_utils.cc )
- s.files += %w( src/core/ext/filters/workarounds/workaround_utils.h )
+ s.files += %w( src/core/ext/filters/rbac/rbac_filter.cc )
+ s.files += %w( src/core/ext/filters/rbac/rbac_filter.h )
+ s.files += %w( src/core/ext/filters/rbac/rbac_service_config_parser.cc )
+ s.files += %w( src/core/ext/filters/rbac/rbac_service_config_parser.h )
+ s.files += %w( src/core/ext/filters/server_config_selector/server_config_selector.cc )
+ s.files += %w( src/core/ext/filters/server_config_selector/server_config_selector.h )
+ s.files += %w( src/core/ext/filters/server_config_selector/server_config_selector_filter.cc )
+ s.files += %w( src/core/ext/filters/server_config_selector/server_config_selector_filter.h )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.cc )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h )
- s.files += %w( src/core/ext/transport/chttp2/client/authority.cc )
- s.files += %w( src/core/ext/transport/chttp2/client/authority.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
- s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc )
- s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc )
- s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc )
s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.cc )
s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.h )
- s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc )
- s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc )
- s.files += %w( src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/bin_decoder.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/bin_decoder.h )
s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h )
- s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_plugin.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h )
s.files += %w( src/core/ext/transport/chttp2/transport/context_list.cc )
@@ -282,18 +270,19 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/frame_settings.h )
s.files += %w( src/core/ext/transport/chttp2/transport/frame_window_update.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/frame_window_update.h )
+ s.files += %w( src/core/ext/transport/chttp2/transport/hpack_constants.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h )
+ s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc )
+ s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder_table.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h )
- s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.cc )
- s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h )
+ s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser_table.cc )
+ s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser_table.h )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.h )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h )
- s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.cc )
- s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.h )
s.files += %w( src/core/ext/transport/chttp2/transport/internal.h )
s.files += %w( src/core/ext/transport/chttp2/transport/parsing.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/stream_lists.cc )
@@ -305,8 +294,26 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/inproc/inproc_plugin.cc )
s.files += %w( src/core/ext/transport/inproc/inproc_transport.cc )
s.files += %w( src/core/ext/transport/inproc/inproc_transport.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/annotations/resource.upb.c )
@@ -323,6 +330,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c )
@@ -335,6 +344,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c )
@@ -345,10 +356,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c )
@@ -361,8 +376,12 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c )
@@ -375,14 +394,36 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c )
@@ -395,24 +436,22 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h )
- s.files += %w( src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c )
- s.files += %w( src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h )
- s.files += %w( src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c )
- s.files += %w( src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h )
- s.files += %w( src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c )
- s.files += %w( src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h )
- s.files += %w( src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c )
- s.files += %w( src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h )
- s.files += %w( src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c )
- s.files += %w( src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c )
@@ -433,14 +472,22 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/http.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/http.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/percent.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/percent.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/range.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/range.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c )
+ s.files += %w( src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c )
@@ -449,6 +496,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h )
+ s.files += %w( src/core/ext/upb-generated/google/api/httpbody.upb.c )
+ s.files += %w( src/core/ext/upb-generated/google/api/httpbody.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c )
@@ -465,6 +514,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h )
+ s.files += %w( src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c )
+ s.files += %w( src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c )
@@ -475,6 +526,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h )
+ s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c )
+ s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h )
+ s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c )
+ s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/annotations/migrate.upb.c )
s.files += %w( src/core/ext/upb-generated/udpa/annotations/migrate.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/annotations/security.upb.c )
@@ -485,26 +540,62 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/udpa/annotations/status.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/annotations/versioning.upb.c )
s.files += %w( src/core/ext/upb-generated/udpa/annotations/versioning.upb.h )
- s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c )
- s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h )
- s.files += %w( src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c )
- s.files += %w( src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/security.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/security.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/status.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/status.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/authority.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/authority.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/context_params.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/context_params.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/core/v3/extension.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/core/v3/extension.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h )
+ s.files += %w( src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c )
+ s.files += %w( src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c )
@@ -521,6 +612,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c )
@@ -533,6 +626,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c )
@@ -543,10 +638,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c )
@@ -559,26 +658,54 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c )
@@ -591,24 +718,22 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c )
@@ -629,18 +754,32 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/google/api/http.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/google/api/http.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c )
@@ -657,6 +796,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c )
@@ -667,22 +810,40 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h )
- s.files += %w( src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c )
- s.files += %w( src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/validate/validate.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/validate/validate.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c )
+ s.files += %w( src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h )
s.files += %w( src/core/ext/xds/certificate_provider_factory.h )
s.files += %w( src/core/ext/xds/certificate_provider_registry.cc )
s.files += %w( src/core/ext/xds/certificate_provider_registry.h )
@@ -690,6 +851,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/xds/certificate_provider_store.h )
s.files += %w( src/core/ext/xds/file_watcher_certificate_provider_factory.cc )
s.files += %w( src/core/ext/xds/file_watcher_certificate_provider_factory.h )
+ s.files += %w( src/core/ext/xds/upb_utils.h )
s.files += %w( src/core/ext/xds/xds_api.cc )
s.files += %w( src/core/ext/xds/xds_api.h )
s.files += %w( src/core/ext/xds/xds_bootstrap.cc )
@@ -697,29 +859,55 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/xds/xds_certificate_provider.cc )
s.files += %w( src/core/ext/xds/xds_certificate_provider.h )
s.files += %w( src/core/ext/xds/xds_channel_args.h )
+ s.files += %w( src/core/ext/xds/xds_channel_stack_modifier.cc )
+ s.files += %w( src/core/ext/xds/xds_channel_stack_modifier.h )
s.files += %w( src/core/ext/xds/xds_client.cc )
s.files += %w( src/core/ext/xds/xds_client.h )
s.files += %w( src/core/ext/xds/xds_client_stats.cc )
s.files += %w( src/core/ext/xds/xds_client_stats.h )
+ s.files += %w( src/core/ext/xds/xds_cluster.cc )
+ s.files += %w( src/core/ext/xds/xds_cluster.h )
+ s.files += %w( src/core/ext/xds/xds_cluster_specifier_plugin.cc )
+ s.files += %w( src/core/ext/xds/xds_cluster_specifier_plugin.h )
+ s.files += %w( src/core/ext/xds/xds_common_types.cc )
+ s.files += %w( src/core/ext/xds/xds_common_types.h )
+ s.files += %w( src/core/ext/xds/xds_endpoint.cc )
+ s.files += %w( src/core/ext/xds/xds_endpoint.h )
s.files += %w( src/core/ext/xds/xds_http_fault_filter.cc )
s.files += %w( src/core/ext/xds/xds_http_fault_filter.h )
s.files += %w( src/core/ext/xds/xds_http_filters.cc )
s.files += %w( src/core/ext/xds/xds_http_filters.h )
+ s.files += %w( src/core/ext/xds/xds_http_rbac_filter.cc )
+ s.files += %w( src/core/ext/xds/xds_http_rbac_filter.h )
+ s.files += %w( src/core/ext/xds/xds_listener.cc )
+ s.files += %w( src/core/ext/xds/xds_listener.h )
+ s.files += %w( src/core/ext/xds/xds_resource_type.cc )
+ s.files += %w( src/core/ext/xds/xds_resource_type.h )
+ s.files += %w( src/core/ext/xds/xds_resource_type_impl.h )
+ s.files += %w( src/core/ext/xds/xds_route_config.cc )
+ s.files += %w( src/core/ext/xds/xds_route_config.h )
+ s.files += %w( src/core/ext/xds/xds_routing.cc )
+ s.files += %w( src/core/ext/xds/xds_routing.h )
s.files += %w( src/core/ext/xds/xds_server_config_fetcher.cc )
s.files += %w( src/core/lib/address_utils/parse_address.cc )
s.files += %w( src/core/lib/address_utils/parse_address.h )
s.files += %w( src/core/lib/address_utils/sockaddr_utils.cc )
s.files += %w( src/core/lib/address_utils/sockaddr_utils.h )
- s.files += %w( src/core/lib/avl/avl.cc )
s.files += %w( src/core/lib/avl/avl.h )
s.files += %w( src/core/lib/backoff/backoff.cc )
s.files += %w( src/core/lib/backoff/backoff.h )
+ s.files += %w( src/core/lib/channel/call_finalization.h )
+ s.files += %w( src/core/lib/channel/call_tracer.h )
s.files += %w( src/core/lib/channel/channel_args.cc )
s.files += %w( src/core/lib/channel/channel_args.h )
+ s.files += %w( src/core/lib/channel/channel_args_preconditioning.cc )
+ s.files += %w( src/core/lib/channel/channel_args_preconditioning.h )
s.files += %w( src/core/lib/channel/channel_stack.cc )
s.files += %w( src/core/lib/channel/channel_stack.h )
s.files += %w( src/core/lib/channel/channel_stack_builder.cc )
s.files += %w( src/core/lib/channel/channel_stack_builder.h )
+ s.files += %w( src/core/lib/channel/channel_stack_builder_impl.cc )
+ s.files += %w( src/core/lib/channel/channel_stack_builder_impl.h )
s.files += %w( src/core/lib/channel/channel_trace.cc )
s.files += %w( src/core/lib/channel/channel_trace.h )
s.files += %w( src/core/lib/channel/channelz.cc )
@@ -734,33 +922,34 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/handshaker_factory.h )
s.files += %w( src/core/lib/channel/handshaker_registry.cc )
s.files += %w( src/core/lib/channel/handshaker_registry.h )
+ s.files += %w( src/core/lib/channel/promise_based_filter.cc )
+ s.files += %w( src/core/lib/channel/promise_based_filter.h )
s.files += %w( src/core/lib/channel/status_util.cc )
s.files += %w( src/core/lib/channel/status_util.h )
- s.files += %w( src/core/lib/compression/algorithm_metadata.h )
s.files += %w( src/core/lib/compression/compression.cc )
- s.files += %w( src/core/lib/compression/compression_args.cc )
- s.files += %w( src/core/lib/compression/compression_args.h )
s.files += %w( src/core/lib/compression/compression_internal.cc )
s.files += %w( src/core/lib/compression/compression_internal.h )
s.files += %w( src/core/lib/compression/message_compress.cc )
s.files += %w( src/core/lib/compression/message_compress.h )
- s.files += %w( src/core/lib/compression/stream_compression.cc )
- s.files += %w( src/core/lib/compression/stream_compression.h )
- s.files += %w( src/core/lib/compression/stream_compression_gzip.cc )
- s.files += %w( src/core/lib/compression/stream_compression_gzip.h )
- s.files += %w( src/core/lib/compression/stream_compression_identity.cc )
- s.files += %w( src/core/lib/compression/stream_compression_identity.h )
+ s.files += %w( src/core/lib/config/core_configuration.cc )
+ s.files += %w( src/core/lib/config/core_configuration.h )
s.files += %w( src/core/lib/debug/stats.cc )
s.files += %w( src/core/lib/debug/stats.h )
s.files += %w( src/core/lib/debug/stats_data.cc )
s.files += %w( src/core/lib/debug/stats_data.h )
s.files += %w( src/core/lib/debug/trace.cc )
s.files += %w( src/core/lib/debug/trace.h )
- s.files += %w( src/core/lib/event_engine/slice_allocator.cc )
+ s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.cc )
+ s.files += %w( src/core/lib/event_engine/channel_args_endpoint_config.h )
+ s.files += %w( src/core/lib/event_engine/default_event_engine_factory.cc )
+ s.files += %w( src/core/lib/event_engine/event_engine.cc )
+ s.files += %w( src/core/lib/event_engine/event_engine_factory.h )
+ s.files += %w( src/core/lib/event_engine/memory_allocator.cc )
+ s.files += %w( src/core/lib/event_engine/resolved_address.cc )
s.files += %w( src/core/lib/event_engine/sockaddr.cc )
+ s.files += %w( src/core/lib/event_engine/sockaddr.h )
s.files += %w( src/core/lib/gpr/alloc.cc )
s.files += %w( src/core/lib/gpr/alloc.h )
- s.files += %w( src/core/lib/gpr/arena.h )
s.files += %w( src/core/lib/gpr/atm.cc )
s.files += %w( src/core/lib/gpr/cpu_iphone.cc )
s.files += %w( src/core/lib/gpr/cpu_linux.cc )
@@ -794,20 +983,18 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gpr/time_precise.h )
s.files += %w( src/core/lib/gpr/time_windows.cc )
s.files += %w( src/core/lib/gpr/tls.h )
- s.files += %w( src/core/lib/gpr/tls_gcc.h )
- s.files += %w( src/core/lib/gpr/tls_msvc.h )
- s.files += %w( src/core/lib/gpr/tls_pthread.cc )
- s.files += %w( src/core/lib/gpr/tls_pthread.h )
- s.files += %w( src/core/lib/gpr/tls_stdcpp.h )
s.files += %w( src/core/lib/gpr/tmpfile.h )
s.files += %w( src/core/lib/gpr/tmpfile_msys.cc )
s.files += %w( src/core/lib/gpr/tmpfile_posix.cc )
s.files += %w( src/core/lib/gpr/tmpfile_windows.cc )
s.files += %w( src/core/lib/gpr/useful.h )
s.files += %w( src/core/lib/gpr/wrap_memcpy.cc )
- s.files += %w( src/core/lib/gprpp/arena.cc )
- s.files += %w( src/core/lib/gprpp/arena.h )
- s.files += %w( src/core/lib/gprpp/atomic.h )
+ s.files += %w( src/core/lib/gprpp/atomic_utils.h )
+ s.files += %w( src/core/lib/gprpp/bitset.h )
+ s.files += %w( src/core/lib/gprpp/capture.h )
+ s.files += %w( src/core/lib/gprpp/chunked_vector.h )
+ s.files += %w( src/core/lib/gprpp/construct_destruct.h )
+ s.files += %w( src/core/lib/gprpp/cpp_impl_of.h )
s.files += %w( src/core/lib/gprpp/debug_location.h )
s.files += %w( src/core/lib/gprpp/dual_ref_counted.h )
s.files += %w( src/core/lib/gprpp/examine_stack.cc )
@@ -822,21 +1009,27 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/host_port.cc )
s.files += %w( src/core/lib/gprpp/host_port.h )
s.files += %w( src/core/lib/gprpp/manual_constructor.h )
+ s.files += %w( src/core/lib/gprpp/match.h )
s.files += %w( src/core/lib/gprpp/memory.h )
s.files += %w( src/core/lib/gprpp/mpscq.cc )
s.files += %w( src/core/lib/gprpp/mpscq.h )
s.files += %w( src/core/lib/gprpp/orphanable.h )
+ s.files += %w( src/core/lib/gprpp/overload.h )
s.files += %w( src/core/lib/gprpp/ref_counted.h )
s.files += %w( src/core/lib/gprpp/ref_counted_ptr.h )
+ s.files += %w( src/core/lib/gprpp/single_set_ptr.h )
s.files += %w( src/core/lib/gprpp/stat.h )
s.files += %w( src/core/lib/gprpp/stat_posix.cc )
s.files += %w( src/core/lib/gprpp/stat_windows.cc )
s.files += %w( src/core/lib/gprpp/status_helper.cc )
s.files += %w( src/core/lib/gprpp/status_helper.h )
s.files += %w( src/core/lib/gprpp/sync.h )
+ s.files += %w( src/core/lib/gprpp/table.h )
s.files += %w( src/core/lib/gprpp/thd.h )
s.files += %w( src/core/lib/gprpp/thd_posix.cc )
s.files += %w( src/core/lib/gprpp/thd_windows.cc )
+ s.files += %w( src/core/lib/gprpp/time.cc )
+ s.files += %w( src/core/lib/gprpp/time.h )
s.files += %w( src/core/lib/gprpp/time_util.cc )
s.files += %w( src/core/lib/gprpp/time_util.h )
s.files += %w( src/core/lib/http/format_request.cc )
@@ -844,6 +1037,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/http/httpcli.cc )
s.files += %w( src/core/lib/http/httpcli.h )
s.files += %w( src/core/lib/http/httpcli_security_connector.cc )
+ s.files += %w( src/core/lib/http/httpcli_ssl_credentials.h )
s.files += %w( src/core/lib/http/parser.cc )
s.files += %w( src/core/lib/http/parser.h )
s.files += %w( src/core/lib/iomgr/block_annotate.h )
@@ -863,8 +1057,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/endpoint_cfstream.cc )
s.files += %w( src/core/lib/iomgr/endpoint_cfstream.h )
s.files += %w( src/core/lib/iomgr/endpoint_pair.h )
+ s.files += %w( src/core/lib/iomgr/endpoint_pair_event_engine.cc )
s.files += %w( src/core/lib/iomgr/endpoint_pair_posix.cc )
- s.files += %w( src/core/lib/iomgr/endpoint_pair_uv.cc )
s.files += %w( src/core/lib/iomgr/endpoint_pair_windows.cc )
s.files += %w( src/core/lib/iomgr/error.cc )
s.files += %w( src/core/lib/iomgr/error.h )
@@ -875,13 +1069,25 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/ev_apple.h )
s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.cc )
s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.h )
- s.files += %w( src/core/lib/iomgr/ev_epollex_linux.cc )
- s.files += %w( src/core/lib/iomgr/ev_epollex_linux.h )
s.files += %w( src/core/lib/iomgr/ev_poll_posix.cc )
s.files += %w( src/core/lib/iomgr/ev_poll_posix.h )
s.files += %w( src/core/lib/iomgr/ev_posix.cc )
s.files += %w( src/core/lib/iomgr/ev_posix.h )
s.files += %w( src/core/lib/iomgr/ev_windows.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/closure.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/closure.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/endpoint.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/endpoint.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/iomgr.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/pollset.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/pollset.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/promise.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/resolved_address_internal.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/resolved_address_internal.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/resolver.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/resolver.h )
+ s.files += %w( src/core/lib/iomgr/event_engine/tcp.cc )
+ s.files += %w( src/core/lib/iomgr/event_engine/timer.cc )
s.files += %w( src/core/lib/iomgr/exec_ctx.cc )
s.files += %w( src/core/lib/iomgr/exec_ctx.h )
s.files += %w( src/core/lib/iomgr/executor.cc )
@@ -905,16 +1111,11 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/iocp_windows.h )
s.files += %w( src/core/lib/iomgr/iomgr.cc )
s.files += %w( src/core/lib/iomgr/iomgr.h )
- s.files += %w( src/core/lib/iomgr/iomgr_custom.cc )
- s.files += %w( src/core/lib/iomgr/iomgr_custom.h )
s.files += %w( src/core/lib/iomgr/iomgr_internal.cc )
s.files += %w( src/core/lib/iomgr/iomgr_internal.h )
s.files += %w( src/core/lib/iomgr/iomgr_posix.cc )
s.files += %w( src/core/lib/iomgr/iomgr_posix_cfstream.cc )
- s.files += %w( src/core/lib/iomgr/iomgr_uv.cc )
s.files += %w( src/core/lib/iomgr/iomgr_windows.cc )
- s.files += %w( src/core/lib/iomgr/is_epollexclusive_available.cc )
- s.files += %w( src/core/lib/iomgr/is_epollexclusive_available.h )
s.files += %w( src/core/lib/iomgr/load_file.cc )
s.files += %w( src/core/lib/iomgr/load_file.h )
s.files += %w( src/core/lib/iomgr/lockfree_event.cc )
@@ -924,31 +1125,25 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/polling_entity.h )
s.files += %w( src/core/lib/iomgr/pollset.cc )
s.files += %w( src/core/lib/iomgr/pollset.h )
- s.files += %w( src/core/lib/iomgr/pollset_custom.cc )
- s.files += %w( src/core/lib/iomgr/pollset_custom.h )
s.files += %w( src/core/lib/iomgr/pollset_set.cc )
s.files += %w( src/core/lib/iomgr/pollset_set.h )
- s.files += %w( src/core/lib/iomgr/pollset_set_custom.cc )
- s.files += %w( src/core/lib/iomgr/pollset_set_custom.h )
s.files += %w( src/core/lib/iomgr/pollset_set_windows.cc )
s.files += %w( src/core/lib/iomgr/pollset_set_windows.h )
- s.files += %w( src/core/lib/iomgr/pollset_uv.cc )
- s.files += %w( src/core/lib/iomgr/pollset_uv.h )
s.files += %w( src/core/lib/iomgr/pollset_windows.cc )
s.files += %w( src/core/lib/iomgr/pollset_windows.h )
s.files += %w( src/core/lib/iomgr/port.h )
s.files += %w( src/core/lib/iomgr/python_util.h )
s.files += %w( src/core/lib/iomgr/resolve_address.cc )
s.files += %w( src/core/lib/iomgr/resolve_address.h )
- s.files += %w( src/core/lib/iomgr/resolve_address_custom.cc )
- s.files += %w( src/core/lib/iomgr/resolve_address_custom.h )
+ s.files += %w( src/core/lib/iomgr/resolve_address_impl.h )
s.files += %w( src/core/lib/iomgr/resolve_address_posix.cc )
+ s.files += %w( src/core/lib/iomgr/resolve_address_posix.h )
s.files += %w( src/core/lib/iomgr/resolve_address_windows.cc )
- s.files += %w( src/core/lib/iomgr/resource_quota.cc )
- s.files += %w( src/core/lib/iomgr/resource_quota.h )
+ s.files += %w( src/core/lib/iomgr/resolve_address_windows.h )
+ s.files += %w( src/core/lib/iomgr/resolved_address.h )
s.files += %w( src/core/lib/iomgr/sockaddr.h )
- s.files += %w( src/core/lib/iomgr/sockaddr_custom.h )
s.files += %w( src/core/lib/iomgr/sockaddr_posix.h )
+ s.files += %w( src/core/lib/iomgr/sockaddr_utils_posix.cc )
s.files += %w( src/core/lib/iomgr/sockaddr_windows.h )
s.files += %w( src/core/lib/iomgr/socket_factory_posix.cc )
s.files += %w( src/core/lib/iomgr/socket_factory_posix.h )
@@ -959,49 +1154,37 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/socket_utils_linux.cc )
s.files += %w( src/core/lib/iomgr/socket_utils_posix.cc )
s.files += %w( src/core/lib/iomgr/socket_utils_posix.h )
- s.files += %w( src/core/lib/iomgr/socket_utils_uv.cc )
s.files += %w( src/core/lib/iomgr/socket_utils_windows.cc )
s.files += %w( src/core/lib/iomgr/socket_windows.cc )
s.files += %w( src/core/lib/iomgr/socket_windows.h )
- s.files += %w( src/core/lib/iomgr/sys_epoll_wrapper.h )
s.files += %w( src/core/lib/iomgr/tcp_client.cc )
s.files += %w( src/core/lib/iomgr/tcp_client.h )
s.files += %w( src/core/lib/iomgr/tcp_client_cfstream.cc )
- s.files += %w( src/core/lib/iomgr/tcp_client_custom.cc )
s.files += %w( src/core/lib/iomgr/tcp_client_posix.cc )
s.files += %w( src/core/lib/iomgr/tcp_client_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_client_windows.cc )
- s.files += %w( src/core/lib/iomgr/tcp_custom.cc )
- s.files += %w( src/core/lib/iomgr/tcp_custom.h )
s.files += %w( src/core/lib/iomgr/tcp_posix.cc )
s.files += %w( src/core/lib/iomgr/tcp_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_server.cc )
s.files += %w( src/core/lib/iomgr/tcp_server.h )
- s.files += %w( src/core/lib/iomgr/tcp_server_custom.cc )
s.files += %w( src/core/lib/iomgr/tcp_server_posix.cc )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_common.cc )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc )
s.files += %w( src/core/lib/iomgr/tcp_server_windows.cc )
- s.files += %w( src/core/lib/iomgr/tcp_uv.cc )
s.files += %w( src/core/lib/iomgr/tcp_windows.cc )
s.files += %w( src/core/lib/iomgr/tcp_windows.h )
s.files += %w( src/core/lib/iomgr/time_averaged_stats.cc )
s.files += %w( src/core/lib/iomgr/time_averaged_stats.h )
s.files += %w( src/core/lib/iomgr/timer.cc )
s.files += %w( src/core/lib/iomgr/timer.h )
- s.files += %w( src/core/lib/iomgr/timer_custom.cc )
- s.files += %w( src/core/lib/iomgr/timer_custom.h )
s.files += %w( src/core/lib/iomgr/timer_generic.cc )
s.files += %w( src/core/lib/iomgr/timer_generic.h )
s.files += %w( src/core/lib/iomgr/timer_heap.cc )
s.files += %w( src/core/lib/iomgr/timer_heap.h )
s.files += %w( src/core/lib/iomgr/timer_manager.cc )
s.files += %w( src/core/lib/iomgr/timer_manager.h )
- s.files += %w( src/core/lib/iomgr/timer_uv.cc )
- s.files += %w( src/core/lib/iomgr/udp_server.cc )
- s.files += %w( src/core/lib/iomgr/udp_server.h )
s.files += %w( src/core/lib/iomgr/unix_sockets_posix.cc )
s.files += %w( src/core/lib/iomgr/unix_sockets_posix.h )
s.files += %w( src/core/lib/iomgr/unix_sockets_posix_noop.cc )
@@ -1023,6 +1206,60 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/profiling/basic_timers.cc )
s.files += %w( src/core/lib/profiling/stap_timers.cc )
s.files += %w( src/core/lib/profiling/timers.h )
+ s.files += %w( src/core/lib/promise/activity.cc )
+ s.files += %w( src/core/lib/promise/activity.h )
+ s.files += %w( src/core/lib/promise/arena_promise.h )
+ s.files += %w( src/core/lib/promise/call_push_pull.h )
+ s.files += %w( src/core/lib/promise/context.h )
+ s.files += %w( src/core/lib/promise/detail/basic_seq.h )
+ s.files += %w( src/core/lib/promise/detail/promise_factory.h )
+ s.files += %w( src/core/lib/promise/detail/promise_like.h )
+ s.files += %w( src/core/lib/promise/detail/status.h )
+ s.files += %w( src/core/lib/promise/detail/switch.h )
+ s.files += %w( src/core/lib/promise/exec_ctx_wakeup_scheduler.h )
+ s.files += %w( src/core/lib/promise/intra_activity_waiter.h )
+ s.files += %w( src/core/lib/promise/latch.h )
+ s.files += %w( src/core/lib/promise/loop.h )
+ s.files += %w( src/core/lib/promise/map.h )
+ s.files += %w( src/core/lib/promise/poll.h )
+ s.files += %w( src/core/lib/promise/promise.h )
+ s.files += %w( src/core/lib/promise/race.h )
+ s.files += %w( src/core/lib/promise/seq.h )
+ s.files += %w( src/core/lib/promise/sleep.cc )
+ s.files += %w( src/core/lib/promise/sleep.h )
+ s.files += %w( src/core/lib/promise/try_seq.h )
+ s.files += %w( src/core/lib/resolver/resolver.cc )
+ s.files += %w( src/core/lib/resolver/resolver.h )
+ s.files += %w( src/core/lib/resolver/resolver_factory.h )
+ s.files += %w( src/core/lib/resolver/resolver_registry.cc )
+ s.files += %w( src/core/lib/resolver/resolver_registry.h )
+ s.files += %w( src/core/lib/resolver/server_address.cc )
+ s.files += %w( src/core/lib/resolver/server_address.h )
+ s.files += %w( src/core/lib/resource_quota/api.cc )
+ s.files += %w( src/core/lib/resource_quota/api.h )
+ s.files += %w( src/core/lib/resource_quota/arena.cc )
+ s.files += %w( src/core/lib/resource_quota/arena.h )
+ s.files += %w( src/core/lib/resource_quota/memory_quota.cc )
+ s.files += %w( src/core/lib/resource_quota/memory_quota.h )
+ s.files += %w( src/core/lib/resource_quota/resource_quota.cc )
+ s.files += %w( src/core/lib/resource_quota/resource_quota.h )
+ s.files += %w( src/core/lib/resource_quota/thread_quota.cc )
+ s.files += %w( src/core/lib/resource_quota/thread_quota.h )
+ s.files += %w( src/core/lib/resource_quota/trace.cc )
+ s.files += %w( src/core/lib/resource_quota/trace.h )
+ s.files += %w( src/core/lib/security/authorization/authorization_engine.h )
+ s.files += %w( src/core/lib/security/authorization/authorization_policy_provider.h )
+ s.files += %w( src/core/lib/security/authorization/authorization_policy_provider_vtable.cc )
+ s.files += %w( src/core/lib/security/authorization/evaluate_args.cc )
+ s.files += %w( src/core/lib/security/authorization/evaluate_args.h )
+ s.files += %w( src/core/lib/security/authorization/grpc_authorization_engine.cc )
+ s.files += %w( src/core/lib/security/authorization/grpc_authorization_engine.h )
+ s.files += %w( src/core/lib/security/authorization/grpc_server_authz_filter.cc )
+ s.files += %w( src/core/lib/security/authorization/grpc_server_authz_filter.h )
+ s.files += %w( src/core/lib/security/authorization/matchers.cc )
+ s.files += %w( src/core/lib/security/authorization/matchers.h )
+ s.files += %w( src/core/lib/security/authorization/rbac_policy.cc )
+ s.files += %w( src/core/lib/security/authorization/rbac_policy.h )
s.files += %w( src/core/lib/security/context/security_context.cc )
s.files += %w( src/core/lib/security/context/security_context.h )
s.files += %w( src/core/lib/security/credentials/alts/alts_credentials.cc )
@@ -1036,11 +1273,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc )
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h )
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc )
+ s.files += %w( src/core/lib/security/credentials/call_creds_util.cc )
+ s.files += %w( src/core/lib/security/credentials/call_creds_util.h )
+ s.files += %w( src/core/lib/security/credentials/channel_creds_registry.h )
+ s.files += %w( src/core/lib/security/credentials/channel_creds_registry_init.cc )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.cc )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h )
s.files += %w( src/core/lib/security/credentials/credentials.cc )
s.files += %w( src/core/lib/security/credentials/credentials.h )
- s.files += %w( src/core/lib/security/credentials/credentials_metadata.cc )
s.files += %w( src/core/lib/security/credentials/external/aws_external_account_credentials.cc )
s.files += %w( src/core/lib/security/credentials/external/aws_external_account_credentials.h )
s.files += %w( src/core/lib/security/credentials/external/aws_request_signer.cc )
@@ -1059,6 +1299,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/credentials/iam/iam_credentials.cc )
s.files += %w( src/core/lib/security/credentials/iam/iam_credentials.h )
s.files += %w( src/core/lib/security/credentials/insecure/insecure_credentials.cc )
+ s.files += %w( src/core/lib/security/credentials/insecure/insecure_credentials.h )
s.files += %w( src/core/lib/security/credentials/jwt/json_token.cc )
s.files += %w( src/core/lib/security/credentials/jwt/json_token.h )
s.files += %w( src/core/lib/security/credentials/jwt/jwt_credentials.cc )
@@ -1077,6 +1318,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h )
s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc )
s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h )
+ s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc )
+ s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h )
s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc )
s.files += %w( src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h )
s.files += %w( src/core/lib/security/credentials/tls/tls_credentials.cc )
@@ -1118,19 +1361,32 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/transport/tsi_error.h )
s.files += %w( src/core/lib/security/util/json_util.cc )
s.files += %w( src/core/lib/security/util/json_util.h )
+ s.files += %w( src/core/lib/service_config/service_config.h )
+ s.files += %w( src/core/lib/service_config/service_config_call_data.h )
+ s.files += %w( src/core/lib/service_config/service_config_impl.cc )
+ s.files += %w( src/core/lib/service_config/service_config_impl.h )
+ s.files += %w( src/core/lib/service_config/service_config_parser.cc )
+ s.files += %w( src/core/lib/service_config/service_config_parser.h )
s.files += %w( src/core/lib/slice/b64.cc )
s.files += %w( src/core/lib/slice/b64.h )
s.files += %w( src/core/lib/slice/percent_encoding.cc )
s.files += %w( src/core/lib/slice/percent_encoding.h )
s.files += %w( src/core/lib/slice/slice.cc )
+ s.files += %w( src/core/lib/slice/slice.h )
+ s.files += %w( src/core/lib/slice/slice_api.cc )
s.files += %w( src/core/lib/slice/slice_buffer.cc )
- s.files += %w( src/core/lib/slice/slice_intern.cc )
s.files += %w( src/core/lib/slice/slice_internal.h )
+ s.files += %w( src/core/lib/slice/slice_refcount.cc )
+ s.files += %w( src/core/lib/slice/slice_refcount.h )
+ s.files += %w( src/core/lib/slice/slice_refcount_base.h )
+ s.files += %w( src/core/lib/slice/slice_split.cc )
+ s.files += %w( src/core/lib/slice/slice_split.h )
s.files += %w( src/core/lib/slice/slice_string_helpers.cc )
s.files += %w( src/core/lib/slice/slice_string_helpers.h )
- s.files += %w( src/core/lib/slice/slice_utils.h )
s.files += %w( src/core/lib/surface/api_trace.cc )
s.files += %w( src/core/lib/surface/api_trace.h )
+ s.files += %w( src/core/lib/surface/builtins.cc )
+ s.files += %w( src/core/lib/surface/builtins.h )
s.files += %w( src/core/lib/surface/byte_buffer.cc )
s.files += %w( src/core/lib/surface/byte_buffer_reader.cc )
s.files += %w( src/core/lib/surface/call.cc )
@@ -1153,7 +1409,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/event_string.h )
s.files += %w( src/core/lib/surface/init.cc )
s.files += %w( src/core/lib/surface/init.h )
- s.files += %w( src/core/lib/surface/init_secure.cc )
s.files += %w( src/core/lib/surface/lame_client.cc )
s.files += %w( src/core/lib/surface/lame_client.h )
s.files += %w( src/core/lib/surface/metadata_array.cc )
@@ -1162,8 +1417,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/validate_metadata.cc )
s.files += %w( src/core/lib/surface/validate_metadata.h )
s.files += %w( src/core/lib/surface/version.cc )
- s.files += %w( src/core/lib/transport/authority_override.cc )
- s.files += %w( src/core/lib/transport/authority_override.h )
s.files += %w( src/core/lib/transport/bdp_estimator.cc )
s.files += %w( src/core/lib/transport/bdp_estimator.h )
s.files += %w( src/core/lib/transport/byte_stream.cc )
@@ -1173,18 +1426,13 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/transport/error_utils.cc )
s.files += %w( src/core/lib/transport/error_utils.h )
s.files += %w( src/core/lib/transport/http2_errors.h )
- s.files += %w( src/core/lib/transport/metadata.cc )
- s.files += %w( src/core/lib/transport/metadata.h )
- s.files += %w( src/core/lib/transport/metadata_batch.cc )
s.files += %w( src/core/lib/transport/metadata_batch.h )
+ s.files += %w( src/core/lib/transport/parsed_metadata.cc )
+ s.files += %w( src/core/lib/transport/parsed_metadata.h )
s.files += %w( src/core/lib/transport/pid_controller.cc )
s.files += %w( src/core/lib/transport/pid_controller.h )
- s.files += %w( src/core/lib/transport/static_metadata.cc )
- s.files += %w( src/core/lib/transport/static_metadata.h )
s.files += %w( src/core/lib/transport/status_conversion.cc )
s.files += %w( src/core/lib/transport/status_conversion.h )
- s.files += %w( src/core/lib/transport/status_metadata.cc )
- s.files += %w( src/core/lib/transport/status_metadata.h )
s.files += %w( src/core/lib/transport/timeout_encoding.cc )
s.files += %w( src/core/lib/transport/timeout_encoding.h )
s.files += %w( src/core/lib/transport/transport.cc )
@@ -1194,6 +1442,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/uri/uri_parser.cc )
s.files += %w( src/core/lib/uri/uri_parser.h )
s.files += %w( src/core/plugin_registry/grpc_plugin_registry.cc )
+ s.files += %w( src/core/plugin_registry/grpc_plugin_registry_extra.cc )
s.files += %w( src/core/tsi/alts/crypt/aes_gcm.cc )
s.files += %w( src/core/tsi/alts/crypt/gsec.cc )
s.files += %w( src/core/tsi/alts/crypt/gsec.h )
@@ -1235,6 +1484,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/tsi/fake_transport_security.h )
s.files += %w( src/core/tsi/local_transport_security.cc )
s.files += %w( src/core/tsi/local_transport_security.h )
+ s.files += %w( src/core/tsi/ssl/key_logging/ssl_key_logging.cc )
+ s.files += %w( src/core/tsi/ssl/key_logging/ssl_key_logging.h )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_cache.cc )
@@ -1263,8 +1514,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h )
s.files += %w( third_party/abseil-cpp/absl/base/internal/endian.h )
s.files += %w( third_party/abseil-cpp/absl/base/internal/errno_saver.h )
- s.files += %w( third_party/abseil-cpp/absl/base/internal/exponential_biased.cc )
- s.files += %w( third_party/abseil-cpp/absl/base/internal/exponential_biased.h )
+ s.files += %w( third_party/abseil-cpp/absl/base/internal/fast_type_id.h )
s.files += %w( third_party/abseil-cpp/absl/base/internal/hide_ptr.h )
s.files += %w( third_party/abseil-cpp/absl/base/internal/identity.h )
s.files += %w( third_party/abseil-cpp/absl/base/internal/inline_variable.h )
@@ -1330,8 +1580,10 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h )
+ s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc )
+ s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc )
@@ -1344,6 +1596,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_elf.inc )
+ s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_win32.inc )
s.files += %w( third_party/abseil-cpp/absl/functional/bind_front.h )
@@ -1355,8 +1608,8 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/hash/internal/city.h )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/hash.cc )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/hash.h )
- s.files += %w( third_party/abseil-cpp/absl/hash/internal/wyhash.cc )
- s.files += %w( third_party/abseil-cpp/absl/hash/internal/wyhash.h )
+ s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc )
+ s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.h )
s.files += %w( third_party/abseil-cpp/absl/memory/memory.h )
s.files += %w( third_party/abseil-cpp/absl/meta/type_traits.h )
s.files += %w( third_party/abseil-cpp/absl/numeric/bits.h )
@@ -1366,6 +1619,54 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc )
s.files += %w( third_party/abseil-cpp/absl/numeric/internal/bits.h )
s.files += %w( third_party/abseil-cpp/absl/numeric/internal/representation.h )
+ s.files += %w( third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc )
+ s.files += %w( third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h )
+ s.files += %w( third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/bernoulli_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/beta_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/discrete_distribution.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/discrete_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/distributions.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/exponential_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/gaussian_distribution.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/gaussian_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/distribution_caller.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/fastmath.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/generate_real.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/nonsecure_base.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/pcg_engine.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/platform.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/pool_urbg.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/pool_urbg.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_detect.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_detect.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_engine.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_hwaes.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_slow.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_slow.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/randen_traits.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/seed_material.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/seed_material.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/traits.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/uniform_helper.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/internal/wide_multiply.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/poisson_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/random.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/seed_gen_exception.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/seed_gen_exception.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/seed_sequences.cc )
+ s.files += %w( third_party/abseil-cpp/absl/random/seed_sequences.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/uniform_int_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/uniform_real_distribution.h )
+ s.files += %w( third_party/abseil-cpp/absl/random/zipf_distribution.h )
s.files += %w( third_party/abseil-cpp/absl/status/internal/status_internal.h )
s.files += %w( third_party/abseil-cpp/absl/status/internal/statusor_internal.h )
s.files += %w( third_party/abseil-cpp/absl/status/status.cc )
@@ -1389,10 +1690,27 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/strings/internal/charconv_parse.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_internal.cc )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_internal.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_functions.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_handle.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_info.cc )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_info.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h )
+ s.files += %w( third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/escaping.cc )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/escaping.h )
s.files += %w( third_party/abseil-cpp/absl/strings/internal/memutil.cc )
@@ -1514,18 +1832,19 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c )
+ s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c )
+ s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/charmap.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c )
+ s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c )
@@ -1719,10 +2038,10 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/kdf.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/hpke/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/hrss/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/internal.h )
+ s.files += %w( third_party/boringssl-with-bazel/src/crypto/lhash/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/mem.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/obj/obj.c )
@@ -1772,21 +2091,19 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/by_file.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/charmap.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/internal.h )
+ s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/name_print.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/t_req.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/x509.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c )
@@ -1825,7 +2142,6 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c )
- s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c )
@@ -1895,6 +2211,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/ex_data.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/hkdf.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/hmac.h )
+ s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/hpke.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/hrss.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/is_boringssl.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/lhash.h )
@@ -1941,6 +2258,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/ssl/dtls_method.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/dtls_record.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc )
+ s.files += %w( third_party/boringssl-with-bazel/src/ssl/extensions.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/handoff.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/handshake.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/handshake_client.cc )
@@ -1964,7 +2282,6 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/t1_enc.cc )
- s.files += %w( third_party/boringssl-with-bazel/src/ssl/t1_lib.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/tls13_both.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/tls13_client.cc )
s.files += %w( third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc )
@@ -1976,78 +2293,87 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/third_party/fiat/p256_32.h )
s.files += %w( third_party/boringssl-with-bazel/src/third_party/fiat/p256_64.h )
s.files += %w( third_party/cares/ares_build.h )
- s.files += %w( third_party/cares/cares/ares.h )
- s.files += %w( third_party/cares/cares/ares__close_sockets.c )
- s.files += %w( third_party/cares/cares/ares__get_hostent.c )
- s.files += %w( third_party/cares/cares/ares__read_line.c )
- s.files += %w( third_party/cares/cares/ares__timeval.c )
- s.files += %w( third_party/cares/cares/ares_cancel.c )
- s.files += %w( third_party/cares/cares/ares_create_query.c )
- s.files += %w( third_party/cares/cares/ares_data.c )
- s.files += %w( third_party/cares/cares/ares_data.h )
- s.files += %w( third_party/cares/cares/ares_destroy.c )
- s.files += %w( third_party/cares/cares/ares_dns.h )
- s.files += %w( third_party/cares/cares/ares_expand_name.c )
- s.files += %w( third_party/cares/cares/ares_expand_string.c )
- s.files += %w( third_party/cares/cares/ares_fds.c )
- s.files += %w( third_party/cares/cares/ares_free_hostent.c )
- s.files += %w( third_party/cares/cares/ares_free_string.c )
- s.files += %w( third_party/cares/cares/ares_getenv.c )
- s.files += %w( third_party/cares/cares/ares_getenv.h )
- s.files += %w( third_party/cares/cares/ares_gethostbyaddr.c )
- s.files += %w( third_party/cares/cares/ares_gethostbyname.c )
- s.files += %w( third_party/cares/cares/ares_getnameinfo.c )
- s.files += %w( third_party/cares/cares/ares_getopt.c )
- s.files += %w( third_party/cares/cares/ares_getopt.h )
- s.files += %w( third_party/cares/cares/ares_getsock.c )
- s.files += %w( third_party/cares/cares/ares_inet_net_pton.h )
- s.files += %w( third_party/cares/cares/ares_init.c )
- s.files += %w( third_party/cares/cares/ares_iphlpapi.h )
- s.files += %w( third_party/cares/cares/ares_ipv6.h )
- s.files += %w( third_party/cares/cares/ares_library_init.c )
- s.files += %w( third_party/cares/cares/ares_library_init.h )
- s.files += %w( third_party/cares/cares/ares_llist.c )
- s.files += %w( third_party/cares/cares/ares_llist.h )
- s.files += %w( third_party/cares/cares/ares_mkquery.c )
- s.files += %w( third_party/cares/cares/ares_nowarn.c )
- s.files += %w( third_party/cares/cares/ares_nowarn.h )
- s.files += %w( third_party/cares/cares/ares_options.c )
- s.files += %w( third_party/cares/cares/ares_parse_a_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_aaaa_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_mx_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_naptr_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_ns_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_ptr_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_soa_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_srv_reply.c )
- s.files += %w( third_party/cares/cares/ares_parse_txt_reply.c )
- s.files += %w( third_party/cares/cares/ares_platform.c )
- s.files += %w( third_party/cares/cares/ares_platform.h )
- s.files += %w( third_party/cares/cares/ares_private.h )
- s.files += %w( third_party/cares/cares/ares_process.c )
- s.files += %w( third_party/cares/cares/ares_query.c )
- s.files += %w( third_party/cares/cares/ares_rules.h )
- s.files += %w( third_party/cares/cares/ares_search.c )
- s.files += %w( third_party/cares/cares/ares_send.c )
- s.files += %w( third_party/cares/cares/ares_setup.h )
- s.files += %w( third_party/cares/cares/ares_strcasecmp.c )
- s.files += %w( third_party/cares/cares/ares_strcasecmp.h )
- s.files += %w( third_party/cares/cares/ares_strdup.c )
- s.files += %w( third_party/cares/cares/ares_strdup.h )
- s.files += %w( third_party/cares/cares/ares_strerror.c )
- s.files += %w( third_party/cares/cares/ares_strsplit.c )
- s.files += %w( third_party/cares/cares/ares_strsplit.h )
- s.files += %w( third_party/cares/cares/ares_timeout.c )
- s.files += %w( third_party/cares/cares/ares_version.c )
- s.files += %w( third_party/cares/cares/ares_version.h )
- s.files += %w( third_party/cares/cares/ares_writev.c )
- s.files += %w( third_party/cares/cares/bitncmp.c )
- s.files += %w( third_party/cares/cares/bitncmp.h )
- s.files += %w( third_party/cares/cares/config-win32.h )
- s.files += %w( third_party/cares/cares/inet_net_pton.c )
- s.files += %w( third_party/cares/cares/inet_ntop.c )
- s.files += %w( third_party/cares/cares/setup_once.h )
- s.files += %w( third_party/cares/cares/windows_port.c )
+ s.files += %w( third_party/cares/cares/include/ares.h )
+ s.files += %w( third_party/cares/cares/include/ares_dns.h )
+ s.files += %w( third_party/cares/cares/include/ares_rules.h )
+ s.files += %w( third_party/cares/cares/include/ares_version.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares__close_sockets.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__get_hostent.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__read_line.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__readaddrinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__sortaddrinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares__timeval.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_android.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_android.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_cancel.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_create_query.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_data.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_data.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_destroy.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_expand_name.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_expand_string.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_fds.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_free_hostent.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_free_string.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_freeaddrinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_getaddrinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_getenv.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_getenv.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_gethostbyaddr.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_gethostbyname.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_getnameinfo.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_getsock.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_inet_net_pton.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_init.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_iphlpapi.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_ipv6.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_library_init.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_library_init.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_llist.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_llist.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_mkquery.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_nameser.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_nowarn.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_nowarn.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_options.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_a_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_caa_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_mx_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_naptr_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_ns_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_ptr_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_soa_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_srv_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_parse_txt_reply.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_platform.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_platform.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_private.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_process.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_query.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_search.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_send.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_setup.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strcasecmp.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strcasecmp.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strdup.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strdup.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strerror.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strsplit.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_strsplit.h )
+ s.files += %w( third_party/cares/cares/src/lib/ares_timeout.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_version.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_writev.c )
+ s.files += %w( third_party/cares/cares/src/lib/ares_writev.h )
+ s.files += %w( third_party/cares/cares/src/lib/bitncmp.c )
+ s.files += %w( third_party/cares/cares/src/lib/bitncmp.h )
+ s.files += %w( third_party/cares/cares/src/lib/config-dos.h )
+ s.files += %w( third_party/cares/cares/src/lib/config-win32.h )
+ s.files += %w( third_party/cares/cares/src/lib/inet_net_pton.c )
+ s.files += %w( third_party/cares/cares/src/lib/inet_ntop.c )
+ s.files += %w( third_party/cares/cares/src/lib/setup_once.h )
+ s.files += %w( third_party/cares/cares/src/lib/windows_port.c )
s.files += %w( third_party/cares/config_darwin/ares_config.h )
s.files += %w( third_party/cares/config_freebsd/ares_config.h )
s.files += %w( third_party/cares/config_linux/ares_config.h )
@@ -2101,31 +2427,38 @@ Gem::Specification.new do |s|
s.files += %w( third_party/re2/util/test.h )
s.files += %w( third_party/re2/util/utf.h )
s.files += %w( third_party/re2/util/util.h )
- s.files += %w( third_party/upb/third_party/wyhash/wyhash.h )
+ s.files += %w( third_party/upb/third_party/utf8_range/naive.c )
+ s.files += %w( third_party/upb/third_party/utf8_range/range2-neon.c )
+ s.files += %w( third_party/upb/third_party/utf8_range/range2-sse.c )
+ s.files += %w( third_party/upb/third_party/utf8_range/utf8_range.h )
s.files += %w( third_party/upb/upb/decode.c )
s.files += %w( third_party/upb/upb/decode.h )
- s.files += %w( third_party/upb/upb/decode.int.h )
s.files += %w( third_party/upb/upb/decode_fast.c )
s.files += %w( third_party/upb/upb/decode_fast.h )
+ s.files += %w( third_party/upb/upb/decode_internal.h )
s.files += %w( third_party/upb/upb/def.c )
s.files += %w( third_party/upb/upb/def.h )
s.files += %w( third_party/upb/upb/def.hpp )
s.files += %w( third_party/upb/upb/encode.c )
s.files += %w( third_party/upb/upb/encode.h )
+ s.files += %w( third_party/upb/upb/json_encode.c )
+ s.files += %w( third_party/upb/upb/json_encode.h )
s.files += %w( third_party/upb/upb/msg.c )
s.files += %w( third_party/upb/upb/msg.h )
+ s.files += %w( third_party/upb/upb/msg_internal.h )
s.files += %w( third_party/upb/upb/port_def.inc )
s.files += %w( third_party/upb/upb/port_undef.inc )
s.files += %w( third_party/upb/upb/reflection.c )
s.files += %w( third_party/upb/upb/reflection.h )
+ s.files += %w( third_party/upb/upb/reflection.hpp )
s.files += %w( third_party/upb/upb/table.c )
- s.files += %w( third_party/upb/upb/table.int.h )
+ s.files += %w( third_party/upb/upb/table_internal.h )
s.files += %w( third_party/upb/upb/text_encode.c )
s.files += %w( third_party/upb/upb/text_encode.h )
s.files += %w( third_party/upb/upb/upb.c )
s.files += %w( third_party/upb/upb/upb.h )
s.files += %w( third_party/upb/upb/upb.hpp )
- s.files += %w( third_party/upb/upb/upb.int.h )
+ s.files += %w( third_party/upb/upb/upb_internal.h )
s.files += %w( third_party/xxhash/xxhash.h )
s.files += %w( third_party/zlib/adler32.c )
s.files += %w( third_party/zlib/compress.c )
diff --git a/grpc/grpc.gyp b/grpc/grpc.gyp
index 2418290d..d2aa69ac 100644
--- a/grpc/grpc.gyp
+++ b/grpc/grpc.gyp
@@ -174,113 +174,15 @@
],
},
{
- 'target_name': 'end2end_nosec_tests',
- 'type': 'static_library',
- 'dependencies': [
- 'grpc_test_util',
- ],
- 'sources': [
- 'test/core/end2end/cq_verifier.cc',
- 'test/core/end2end/data/client_certs.cc',
- 'test/core/end2end/data/server1_cert.cc',
- 'test/core/end2end/data/server1_key.cc',
- 'test/core/end2end/data/test_root_cert.cc',
- 'test/core/end2end/end2end_nosec_tests.cc',
- 'test/core/end2end/end2end_test_utils.cc',
- 'test/core/end2end/fixtures/http_proxy_fixture.cc',
- 'test/core/end2end/fixtures/local_util.cc',
- 'test/core/end2end/fixtures/proxy.cc',
- 'test/core/end2end/tests/authority_not_supported.cc',
- 'test/core/end2end/tests/bad_hostname.cc',
- 'test/core/end2end/tests/bad_ping.cc',
- 'test/core/end2end/tests/binary_metadata.cc',
- 'test/core/end2end/tests/call_host_override.cc',
- 'test/core/end2end/tests/cancel_after_accept.cc',
- 'test/core/end2end/tests/cancel_after_client_done.cc',
- 'test/core/end2end/tests/cancel_after_invoke.cc',
- 'test/core/end2end/tests/cancel_after_round_trip.cc',
- 'test/core/end2end/tests/cancel_before_invoke.cc',
- 'test/core/end2end/tests/cancel_in_a_vacuum.cc',
- 'test/core/end2end/tests/cancel_with_status.cc',
- 'test/core/end2end/tests/channelz.cc',
- 'test/core/end2end/tests/client_streaming.cc',
- 'test/core/end2end/tests/compressed_payload.cc',
- 'test/core/end2end/tests/connectivity.cc',
- 'test/core/end2end/tests/default_host.cc',
- 'test/core/end2end/tests/disappearing_server.cc',
- 'test/core/end2end/tests/empty_batch.cc',
- 'test/core/end2end/tests/filter_causes_close.cc',
- 'test/core/end2end/tests/filter_context.cc',
- 'test/core/end2end/tests/filter_init_fails.cc',
- 'test/core/end2end/tests/filter_latency.cc',
- 'test/core/end2end/tests/filter_status_code.cc',
- 'test/core/end2end/tests/graceful_server_shutdown.cc',
- 'test/core/end2end/tests/high_initial_seqno.cc',
- 'test/core/end2end/tests/hpack_size.cc',
- 'test/core/end2end/tests/idempotent_request.cc',
- 'test/core/end2end/tests/invoke_large_request.cc',
- 'test/core/end2end/tests/keepalive_timeout.cc',
- 'test/core/end2end/tests/large_metadata.cc',
- 'test/core/end2end/tests/max_concurrent_streams.cc',
- 'test/core/end2end/tests/max_connection_age.cc',
- 'test/core/end2end/tests/max_connection_idle.cc',
- 'test/core/end2end/tests/max_message_length.cc',
- 'test/core/end2end/tests/negative_deadline.cc',
- 'test/core/end2end/tests/no_error_on_hotpath.cc',
- 'test/core/end2end/tests/no_logging.cc',
- 'test/core/end2end/tests/no_op.cc',
- 'test/core/end2end/tests/payload.cc',
- 'test/core/end2end/tests/ping.cc',
- 'test/core/end2end/tests/ping_pong_streaming.cc',
- 'test/core/end2end/tests/proxy_auth.cc',
- 'test/core/end2end/tests/registered_call.cc',
- 'test/core/end2end/tests/request_with_flags.cc',
- 'test/core/end2end/tests/request_with_payload.cc',
- 'test/core/end2end/tests/resource_quota_server.cc',
- 'test/core/end2end/tests/retry.cc',
- 'test/core/end2end/tests/retry_cancel_during_delay.cc',
- 'test/core/end2end/tests/retry_cancellation.cc',
- 'test/core/end2end/tests/retry_disabled.cc',
- 'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc',
- 'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc',
- 'test/core/end2end/tests/retry_lb_drop.cc',
- 'test/core/end2end/tests/retry_non_retriable_status.cc',
- 'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc',
- 'test/core/end2end/tests/retry_recv_initial_metadata.cc',
- 'test/core/end2end/tests/retry_recv_message.cc',
- 'test/core/end2end/tests/retry_server_pushback_delay.cc',
- 'test/core/end2end/tests/retry_server_pushback_disabled.cc',
- 'test/core/end2end/tests/retry_streaming.cc',
- 'test/core/end2end/tests/retry_streaming_after_commit.cc',
- 'test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc',
- 'test/core/end2end/tests/retry_throttled.cc',
- 'test/core/end2end/tests/retry_too_many_attempts.cc',
- 'test/core/end2end/tests/server_finishes_request.cc',
- 'test/core/end2end/tests/server_streaming.cc',
- 'test/core/end2end/tests/shutdown_finishes_calls.cc',
- 'test/core/end2end/tests/shutdown_finishes_tags.cc',
- 'test/core/end2end/tests/simple_cacheable_request.cc',
- 'test/core/end2end/tests/simple_delayed_request.cc',
- 'test/core/end2end/tests/simple_metadata.cc',
- 'test/core/end2end/tests/simple_request.cc',
- 'test/core/end2end/tests/stream_compression_compressed_payload.cc',
- 'test/core/end2end/tests/stream_compression_payload.cc',
- 'test/core/end2end/tests/stream_compression_ping_pong_streaming.cc',
- 'test/core/end2end/tests/streaming_error_response.cc',
- 'test/core/end2end/tests/trailing_metadata.cc',
- 'test/core/end2end/tests/workaround_cronet_compression.cc',
- 'test/core/end2end/tests/write_buffering.cc',
- 'test/core/end2end/tests/write_buffering_at_end.cc',
- 'test/core/util/test_lb_policies.cc',
- ],
- },
- {
'target_name': 'end2end_tests',
'type': 'static_library',
'dependencies': [
'grpc_test_util',
],
'sources': [
+ 'src/core/lib/security/authorization/grpc_authorization_policy_provider.cc',
+ 'src/core/lib/security/authorization/rbac_translator.cc',
+ 'test/core/compression/args_utils.cc',
'test/core/end2end/cq_verifier.cc',
'test/core/end2end/data/client_certs.cc',
'test/core/end2end/data/server1_cert.cc',
@@ -316,10 +218,11 @@
'test/core/end2end/tests/filter_init_fails.cc',
'test/core/end2end/tests/filter_latency.cc',
'test/core/end2end/tests/filter_status_code.cc',
+ 'test/core/end2end/tests/filtered_metadata.cc',
'test/core/end2end/tests/graceful_server_shutdown.cc',
+ 'test/core/end2end/tests/grpc_authz.cc',
'test/core/end2end/tests/high_initial_seqno.cc',
'test/core/end2end/tests/hpack_size.cc',
- 'test/core/end2end/tests/idempotent_request.cc',
'test/core/end2end/tests/invoke_large_request.cc',
'test/core/end2end/tests/keepalive_timeout.cc',
'test/core/end2end/tests/large_metadata.cc',
@@ -340,16 +243,27 @@
'test/core/end2end/tests/request_with_payload.cc',
'test/core/end2end/tests/resource_quota_server.cc',
'test/core/end2end/tests/retry.cc',
+ 'test/core/end2end/tests/retry_cancel_after_first_attempt_starts.cc',
'test/core/end2end/tests/retry_cancel_during_delay.cc',
+ 'test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc',
'test/core/end2end/tests/retry_cancellation.cc',
'test/core/end2end/tests/retry_disabled.cc',
+ 'test/core/end2end/tests/retry_exceeds_buffer_size_in_delay.cc',
'test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc',
'test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc',
'test/core/end2end/tests/retry_lb_drop.cc',
+ 'test/core/end2end/tests/retry_lb_fail.cc',
'test/core/end2end/tests/retry_non_retriable_status.cc',
'test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc',
+ 'test/core/end2end/tests/retry_per_attempt_recv_timeout.cc',
+ 'test/core/end2end/tests/retry_per_attempt_recv_timeout_on_last_attempt.cc',
'test/core/end2end/tests/retry_recv_initial_metadata.cc',
'test/core/end2end/tests/retry_recv_message.cc',
+ 'test/core/end2end/tests/retry_recv_message_replay.cc',
+ 'test/core/end2end/tests/retry_recv_trailing_metadata_error.cc',
+ 'test/core/end2end/tests/retry_send_initial_metadata_refs.cc',
+ 'test/core/end2end/tests/retry_send_op_fails.cc',
+ 'test/core/end2end/tests/retry_send_recv_batch.cc',
'test/core/end2end/tests/retry_server_pushback_delay.cc',
'test/core/end2end/tests/retry_server_pushback_disabled.cc',
'test/core/end2end/tests/retry_streaming.cc',
@@ -357,20 +271,20 @@
'test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc',
'test/core/end2end/tests/retry_throttled.cc',
'test/core/end2end/tests/retry_too_many_attempts.cc',
+ 'test/core/end2end/tests/retry_transparent_goaway.cc',
+ 'test/core/end2end/tests/retry_transparent_max_concurrent_streams.cc',
+ 'test/core/end2end/tests/retry_transparent_not_sent_on_wire.cc',
+ 'test/core/end2end/tests/retry_unref_before_finish.cc',
+ 'test/core/end2end/tests/retry_unref_before_recv.cc',
'test/core/end2end/tests/server_finishes_request.cc',
'test/core/end2end/tests/server_streaming.cc',
'test/core/end2end/tests/shutdown_finishes_calls.cc',
'test/core/end2end/tests/shutdown_finishes_tags.cc',
- 'test/core/end2end/tests/simple_cacheable_request.cc',
'test/core/end2end/tests/simple_delayed_request.cc',
'test/core/end2end/tests/simple_metadata.cc',
'test/core/end2end/tests/simple_request.cc',
- 'test/core/end2end/tests/stream_compression_compressed_payload.cc',
- 'test/core/end2end/tests/stream_compression_payload.cc',
- 'test/core/end2end/tests/stream_compression_ping_pong_streaming.cc',
'test/core/end2end/tests/streaming_error_response.cc',
'test/core/end2end/tests/trailing_metadata.cc',
- 'test/core/end2end/tests/workaround_cronet_compression.cc',
'test/core/end2end/tests/write_buffering.cc',
'test/core/end2end/tests/write_buffering_at_end.cc',
'test/core/util/test_lb_policies.cc',
@@ -381,8 +295,11 @@
'type': 'static_library',
'dependencies': [
'absl/base:base',
+ 'absl/base:core_headers',
'absl/memory:memory',
+ 'absl/random:random',
'absl/status:status',
+ 'absl/strings:cord',
'absl/strings:str_format',
'absl/strings:strings',
'absl/synchronization:synchronization',
@@ -391,16 +308,7 @@
'upb',
],
'sources': [
- '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/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
- 'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
- 'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
- 'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
- 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
- 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
'src/core/ext/upb-generated/google/rpc/status.upb.c',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/atm.cc',
@@ -429,12 +337,10 @@
'src/core/lib/gpr/time_posix.cc',
'src/core/lib/gpr/time_precise.cc',
'src/core/lib/gpr/time_windows.cc',
- 'src/core/lib/gpr/tls_pthread.cc',
'src/core/lib/gpr/tmpfile_msys.cc',
'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/wrap_memcpy.cc',
- 'src/core/lib/gprpp/arena.cc',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
@@ -457,12 +363,17 @@
'absl/container:flat_hash_map',
'absl/container:inlined_vector',
'absl/functional:bind_front',
+ 'absl/hash:hash',
'absl/status:statusor',
+ 'absl/types:variant',
+ 'absl/utility:utility',
'gpr',
'address_sorting',
],
'sources': [
'src/core/ext/filters/census/grpc_context.cc',
+ 'src/core/ext/filters/channel_idle/channel_idle_filter.cc',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
@@ -482,12 +393,12 @@
'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_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/ring_hash/ring_hash.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/rls/rls.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/xds/cds.cc',
@@ -497,33 +408,30 @@
'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',
- 'src/core/ext/filters/client_channel/resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc',
- 'src/core/ext/filters/client_channel/resolver_registry.cc',
'src/core/ext/filters/client_channel/resolver_result_parsing.cc',
'src/core/ext/filters/client_channel/retry_filter.cc',
'src/core/ext/filters/client_channel/retry_service_config.cc',
'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/subchannel.cc',
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
- 'src/core/ext/filters/client_idle/client_idle_filter.cc',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/fault_injection/fault_injection_filter.cc',
'src/core/ext/filters/fault_injection/service_config_parser.cc',
@@ -533,23 +441,16 @@
'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/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',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
- 'src/core/ext/filters/workarounds/workaround_utils.cc',
+ 'src/core/ext/filters/rbac/rbac_filter.cc',
+ 'src/core/ext/filters/rbac/rbac_service_config_parser.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc',
- 'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
- 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc',
'src/core/ext/transport/chttp2/server/chttp2_server.cc',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc',
- 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc',
'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
- 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
'src/core/ext/transport/chttp2/transport/chttp2_transport.cc',
'src/core/ext/transport/chttp2/transport/context_list.cc',
'src/core/ext/transport/chttp2/transport/flow_control.cc',
@@ -560,11 +461,11 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
- 'src/core/ext/transport/chttp2/transport/hpack_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
'src/core/ext/transport/chttp2/transport/huffsyms.cc',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
'src/core/ext/transport/chttp2/transport/parsing.cc',
'src/core/ext/transport/chttp2/transport/stream_lists.cc',
'src/core/ext/transport/chttp2/transport/stream_map.cc',
@@ -572,7 +473,16 @@
'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/admin/v3/certs.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c',
'src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c',
+ 'src/core/ext/upb-generated/envoy/admin/v3/tap.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',
@@ -581,51 +491,67 @@
'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/common/matcher/v3/matcher.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_method_list.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/resolver.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/core/v3/udp_socket_config.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/quic_config.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.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/tap/v3/common.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c',
+ 'src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.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/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.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/service/status/v3/csds.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c',
@@ -636,30 +562,68 @@
'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/hash_policy.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/http.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/http_status.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/ratelimit_unit.upb.c',
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/v3/token_bucket.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/http.upb.c',
+ 'src/core/ext/upb-generated/google/api/httpbody.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/any.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
+ 'src/core/ext/upb-generated/google/rpc/status.upb.c',
+ 'src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c',
'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/src/proto/grpc/lookup/v1/rls.upb.c',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.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/data/orca/v1/orca_load_report.upb.c',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/security.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.c',
+ 'src/core/ext/upb-generated/xds/core/v3/extension.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c',
+ 'src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c',
@@ -668,50 +632,67 @@
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c',
- 'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c',
@@ -722,69 +703,102 @@
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c',
'src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c',
'src/core/ext/upbdefs-generated/google/api/http.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c',
'src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c',
'src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c',
'src/core/ext/xds/certificate_provider_registry.cc',
'src/core/ext/xds/certificate_provider_store.cc',
'src/core/ext/xds/file_watcher_certificate_provider_factory.cc',
'src/core/ext/xds/xds_api.cc',
'src/core/ext/xds/xds_bootstrap.cc',
'src/core/ext/xds/xds_certificate_provider.cc',
+ 'src/core/ext/xds/xds_channel_stack_modifier.cc',
'src/core/ext/xds/xds_client.cc',
'src/core/ext/xds/xds_client_stats.cc',
+ 'src/core/ext/xds/xds_cluster.cc',
+ 'src/core/ext/xds/xds_cluster_specifier_plugin.cc',
+ 'src/core/ext/xds/xds_common_types.cc',
+ 'src/core/ext/xds/xds_endpoint.cc',
'src/core/ext/xds/xds_http_fault_filter.cc',
'src/core/ext/xds/xds_http_filters.cc',
+ 'src/core/ext/xds/xds_http_rbac_filter.cc',
+ 'src/core/ext/xds/xds_listener.cc',
+ 'src/core/ext/xds/xds_resource_type.cc',
+ 'src/core/ext/xds/xds_route_config.cc',
+ 'src/core/ext/xds/xds_routing.cc',
'src/core/ext/xds/xds_server_config_fetcher.cc',
'src/core/lib/address_utils/parse_address.cc',
'src/core/lib/address_utils/sockaddr_utils.cc',
- 'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
+ 'src/core/lib/channel/channel_args_preconditioning.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
+ 'src/core/lib/channel/channel_stack_builder_impl.cc',
'src/core/lib/channel/channel_trace.cc',
'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_registry.cc',
+ 'src/core/lib/channel/promise_based_filter.cc',
'src/core/lib/channel/status_util.cc',
'src/core/lib/compression/compression.cc',
- 'src/core/lib/compression/compression_args.cc',
'src/core/lib/compression/compression_internal.cc',
'src/core/lib/compression/message_compress.cc',
- 'src/core/lib/compression/stream_compression.cc',
- 'src/core/lib/compression/stream_compression_gzip.cc',
- 'src/core/lib/compression/stream_compression_identity.cc',
+ 'src/core/lib/config/core_configuration.cc',
'src/core/lib/debug/stats.cc',
'src/core/lib/debug/stats_data.cc',
'src/core/lib/debug/trace.cc',
- 'src/core/lib/event_engine/slice_allocator.cc',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.cc',
+ 'src/core/lib/event_engine/default_event_engine_factory.cc',
+ 'src/core/lib/event_engine/event_engine.cc',
+ 'src/core/lib/event_engine/memory_allocator.cc',
+ 'src/core/lib/event_engine/resolved_address.cc',
'src/core/lib/event_engine/sockaddr.cc',
+ 'src/core/lib/gprpp/time.cc',
'src/core/lib/http/format_request.cc',
'src/core/lib/http/httpcli.cc',
'src/core/lib/http/httpcli_security_connector.cc',
@@ -796,17 +810,24 @@
'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_event_engine.cc',
'src/core/lib/iomgr/endpoint_pair_posix.cc',
- 'src/core/lib/iomgr/endpoint_pair_uv.cc',
'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_epoll1_linux.cc',
- 'src/core/lib/iomgr/ev_epollex_linux.cc',
'src/core/lib/iomgr/ev_poll_posix.cc',
'src/core/lib/iomgr/ev_posix.cc',
'src/core/lib/iomgr/ev_windows.cc',
+ 'src/core/lib/iomgr/event_engine/closure.cc',
+ 'src/core/lib/iomgr/event_engine/endpoint.cc',
+ 'src/core/lib/iomgr/event_engine/iomgr.cc',
+ 'src/core/lib/iomgr/event_engine/pollset.cc',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.cc',
+ 'src/core/lib/iomgr/event_engine/resolver.cc',
+ 'src/core/lib/iomgr/event_engine/tcp.cc',
+ 'src/core/lib/iomgr/event_engine/timer.cc',
'src/core/lib/iomgr/exec_ctx.cc',
'src/core/lib/iomgr/executor.cc',
'src/core/lib/iomgr/executor/mpmcqueue.cc',
@@ -821,60 +842,45 @@
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
- 'src/core/lib/iomgr/iomgr_custom.cc',
'src/core/lib/iomgr/iomgr_internal.cc',
'src/core/lib/iomgr/iomgr_posix.cc',
'src/core/lib/iomgr/iomgr_posix_cfstream.cc',
- 'src/core/lib/iomgr/iomgr_uv.cc',
'src/core/lib/iomgr/iomgr_windows.cc',
- '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/polling_entity.cc',
'src/core/lib/iomgr/pollset.cc',
- 'src/core/lib/iomgr/pollset_custom.cc',
'src/core/lib/iomgr/pollset_set.cc',
- 'src/core/lib/iomgr/pollset_set_custom.cc',
'src/core/lib/iomgr/pollset_set_windows.cc',
- 'src/core/lib/iomgr/pollset_uv.cc',
'src/core/lib/iomgr/pollset_windows.cc',
'src/core/lib/iomgr/resolve_address.cc',
- 'src/core/lib/iomgr/resolve_address_custom.cc',
'src/core/lib/iomgr/resolve_address_posix.cc',
'src/core/lib/iomgr/resolve_address_windows.cc',
- 'src/core/lib/iomgr/resource_quota.cc',
+ 'src/core/lib/iomgr/sockaddr_utils_posix.cc',
'src/core/lib/iomgr/socket_factory_posix.cc',
'src/core/lib/iomgr/socket_mutator.cc',
'src/core/lib/iomgr/socket_utils_common_posix.cc',
'src/core/lib/iomgr/socket_utils_linux.cc',
'src/core/lib/iomgr/socket_utils_posix.cc',
- 'src/core/lib/iomgr/socket_utils_uv.cc',
'src/core/lib/iomgr/socket_utils_windows.cc',
'src/core/lib/iomgr/socket_windows.cc',
'src/core/lib/iomgr/tcp_client.cc',
'src/core/lib/iomgr/tcp_client_cfstream.cc',
- 'src/core/lib/iomgr/tcp_client_custom.cc',
'src/core/lib/iomgr/tcp_client_posix.cc',
'src/core/lib/iomgr/tcp_client_windows.cc',
- 'src/core/lib/iomgr/tcp_custom.cc',
'src/core/lib/iomgr/tcp_posix.cc',
'src/core/lib/iomgr/tcp_server.cc',
- 'src/core/lib/iomgr/tcp_server_custom.cc',
'src/core/lib/iomgr/tcp_server_posix.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_common.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
'src/core/lib/iomgr/tcp_server_windows.cc',
- 'src/core/lib/iomgr/tcp_uv.cc',
'src/core/lib/iomgr/tcp_windows.cc',
'src/core/lib/iomgr/time_averaged_stats.cc',
'src/core/lib/iomgr/timer.cc',
- 'src/core/lib/iomgr/timer_custom.cc',
'src/core/lib/iomgr/timer_generic.cc',
'src/core/lib/iomgr/timer_heap.cc',
'src/core/lib/iomgr/timer_manager.cc',
- 'src/core/lib/iomgr/timer_uv.cc',
- 'src/core/lib/iomgr/udp_server.cc',
'src/core/lib/iomgr/unix_sockets_posix.cc',
'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
'src/core/lib/iomgr/wakeup_fd_eventfd.cc',
@@ -886,6 +892,23 @@
'src/core/lib/json/json_util.cc',
'src/core/lib/json/json_writer.cc',
'src/core/lib/matchers/matchers.cc',
+ 'src/core/lib/promise/activity.cc',
+ 'src/core/lib/promise/sleep.cc',
+ 'src/core/lib/resolver/resolver.cc',
+ 'src/core/lib/resolver/resolver_registry.cc',
+ 'src/core/lib/resolver/server_address.cc',
+ 'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/arena.cc',
+ 'src/core/lib/resource_quota/memory_quota.cc',
+ 'src/core/lib/resource_quota/resource_quota.cc',
+ 'src/core/lib/resource_quota/thread_quota.cc',
+ 'src/core/lib/resource_quota/trace.cc',
+ 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc',
+ 'src/core/lib/security/authorization/evaluate_args.cc',
+ 'src/core/lib/security/authorization/grpc_authorization_engine.cc',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.cc',
+ 'src/core/lib/security/authorization/matchers.cc',
+ 'src/core/lib/security/authorization/rbac_policy.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',
@@ -895,9 +918,10 @@
'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc',
'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc',
+ 'src/core/lib/security/credentials/call_creds_util.cc',
+ 'src/core/lib/security/credentials/channel_creds_registry_init.cc',
'src/core/lib/security/credentials/composite/composite_credentials.cc',
'src/core/lib/security/credentials/credentials.cc',
- 'src/core/lib/security/credentials/credentials_metadata.cc',
'src/core/lib/security/credentials/external/aws_external_account_credentials.cc',
'src/core/lib/security/credentials/external/aws_request_signer.cc',
'src/core/lib/security/credentials/external/external_account_credentials.cc',
@@ -917,6 +941,7 @@
'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_provider.cc',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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/tls/tls_utils.cc',
@@ -938,13 +963,18 @@
'src/core/lib/security/transport/server_auth_filter.cc',
'src/core/lib/security/transport/tsi_error.cc',
'src/core/lib/security/util/json_util.cc',
+ 'src/core/lib/service_config/service_config_impl.cc',
+ 'src/core/lib/service_config/service_config_parser.cc',
'src/core/lib/slice/b64.cc',
'src/core/lib/slice/percent_encoding.cc',
'src/core/lib/slice/slice.cc',
+ 'src/core/lib/slice/slice_api.cc',
'src/core/lib/slice/slice_buffer.cc',
- 'src/core/lib/slice/slice_intern.cc',
+ 'src/core/lib/slice/slice_refcount.cc',
+ 'src/core/lib/slice/slice_split.cc',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/surface/api_trace.cc',
+ 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -958,28 +988,24 @@
'src/core/lib/surface/completion_queue_factory.cc',
'src/core/lib/surface/event_string.cc',
'src/core/lib/surface/init.cc',
- 'src/core/lib/surface/init_secure.cc',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/metadata_array.cc',
'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/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc',
'src/core/lib/transport/error_utils.cc',
- 'src/core/lib/transport/metadata.cc',
- 'src/core/lib/transport/metadata_batch.cc',
+ 'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
- 'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',
- 'src/core/lib/transport/status_metadata.cc',
'src/core/lib/transport/timeout_encoding.cc',
'src/core/lib/transport/transport.cc',
'src/core/lib/transport/transport_op_string.cc',
'src/core/lib/uri/uri_parser.cc',
'src/core/plugin_registry/grpc_plugin_registry.cc',
+ 'src/core/plugin_registry/grpc_plugin_registry_extra.cc',
'src/core/tsi/alts/crypt/aes_gcm.cc',
'src/core/tsi/alts/crypt/gsec.cc',
'src/core/tsi/alts/frame_protector/alts_counter.cc',
@@ -1001,6 +1027,7 @@
'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc',
'src/core/tsi/fake_transport_security.cc',
'src/core/tsi/local_transport_security.cc',
+ 'src/core/tsi/ssl/key_logging/ssl_key_logging.cc',
'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc',
'src/core/tsi/ssl/session_cache/ssl_session_cache.cc',
'src/core/tsi/ssl/session_cache/ssl_session_openssl.cc',
@@ -1029,11 +1056,12 @@
'grpc',
],
'sources': [
+ 'test/core/event_engine/test_init.cc',
+ 'test/core/util/build.cc',
'test/core/util/cmdline.cc',
'test/core/util/fuzzer_util.cc',
'test/core/util/grpc_profiler.cc',
'test/core/util/histogram.cc',
- 'test/core/util/memory_counters.cc',
'test/core/util/mock_endpoint.cc',
'test/core/util/parse_hexstring.cc',
'test/core/util/passthru_endpoint.cc',
@@ -1050,7 +1078,6 @@
'test/core/util/test_tcp_server.cc',
'test/core/util/tls_utils.cc',
'test/core/util/tracer_util.cc',
- 'test/core/util/trickle_endpoint.cc',
],
},
{
@@ -1063,11 +1090,12 @@
'grpc_unsecure',
],
'sources': [
+ 'test/core/event_engine/test_init.cc',
+ 'test/core/util/build.cc',
'test/core/util/cmdline.cc',
'test/core/util/fuzzer_util.cc',
'test/core/util/grpc_profiler.cc',
'test/core/util/histogram.cc',
- 'test/core/util/memory_counters.cc',
'test/core/util/mock_endpoint.cc',
'test/core/util/parse_hexstring.cc',
'test/core/util/passthru_endpoint.cc',
@@ -1083,7 +1111,6 @@
'test/core/util/test_config.cc',
'test/core/util/test_tcp_server.cc',
'test/core/util/tracer_util.cc',
- 'test/core/util/trickle_endpoint.cc',
],
},
{
@@ -1092,12 +1119,18 @@
'dependencies': [
'absl/container:flat_hash_map',
'absl/container:inlined_vector',
+ 'absl/functional:bind_front',
+ 'absl/hash:hash',
'absl/status:statusor',
+ 'absl/types:variant',
+ 'absl/utility:utility',
'gpr',
'address_sorting',
],
'sources': [
'src/core/ext/filters/census/grpc_context.cc',
+ 'src/core/ext/filters/channel_idle/channel_idle_filter.cc',
+ 'src/core/ext/filters/channel_idle/idle_filter_state.cc',
'src/core/ext/filters/client_channel/backend_metric.cc',
'src/core/ext/filters/client_channel/backup_poller.cc',
'src/core/ext/filters/client_channel/channel_connectivity.cc',
@@ -1117,41 +1150,39 @@
'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_channel.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/ring_hash/ring_hash.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/rls/rls.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_registry.cc',
'src/core/ext/filters/client_channel/local_subchannel_pool.cc',
'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
- 'src/core/ext/filters/client_channel/resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/polling_resolver.cc',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc',
- 'src/core/ext/filters/client_channel/resolver_registry.cc',
'src/core/ext/filters/client_channel/resolver_result_parsing.cc',
'src/core/ext/filters/client_channel/retry_filter.cc',
'src/core/ext/filters/client_channel/retry_service_config.cc',
'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/subchannel.cc',
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
- 'src/core/ext/filters/client_idle/client_idle_filter.cc',
+ 'src/core/ext/filters/client_channel/subchannel_stream_client.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/fault_injection/fault_injection_filter.cc',
'src/core/ext/filters/fault_injection/service_config_parser.cc',
@@ -1161,21 +1192,12 @@
'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/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',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
- 'src/core/ext/filters/workarounds/workaround_utils.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc',
- 'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
- 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
'src/core/ext/transport/chttp2/server/chttp2_server.cc',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc',
- 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc',
'src/core/ext/transport/chttp2/transport/bin_decoder.cc',
'src/core/ext/transport/chttp2/transport/bin_encoder.cc',
- 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc',
'src/core/ext/transport/chttp2/transport/chttp2_transport.cc',
'src/core/ext/transport/chttp2/transport/context_list.cc',
'src/core/ext/transport/chttp2/transport/flow_control.cc',
@@ -1186,11 +1208,11 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
- 'src/core/ext/transport/chttp2/transport/hpack_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
'src/core/ext/transport/chttp2/transport/huffsyms.cc',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
'src/core/ext/transport/chttp2/transport/parsing.cc',
'src/core/ext/transport/chttp2/transport/stream_lists.cc',
'src/core/ext/transport/chttp2/transport/stream_map.cc',
@@ -1198,36 +1220,51 @@
'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/google/api/annotations.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',
+ 'src/core/ext/upb-generated/google/protobuf/duration.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/empty.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/struct.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c',
+ 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c',
+ 'src/core/ext/upb-generated/google/rpc/status.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/data/orca/v1/orca_load_report.upb.c',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c',
'src/core/lib/address_utils/parse_address.cc',
'src/core/lib/address_utils/sockaddr_utils.cc',
- 'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
+ 'src/core/lib/channel/channel_args_preconditioning.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
+ 'src/core/lib/channel/channel_stack_builder_impl.cc',
'src/core/lib/channel/channel_trace.cc',
'src/core/lib/channel/channelz.cc',
'src/core/lib/channel/channelz_registry.cc',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/handshaker.cc',
'src/core/lib/channel/handshaker_registry.cc',
+ 'src/core/lib/channel/promise_based_filter.cc',
'src/core/lib/channel/status_util.cc',
'src/core/lib/compression/compression.cc',
- 'src/core/lib/compression/compression_args.cc',
'src/core/lib/compression/compression_internal.cc',
'src/core/lib/compression/message_compress.cc',
- 'src/core/lib/compression/stream_compression.cc',
- 'src/core/lib/compression/stream_compression_gzip.cc',
- 'src/core/lib/compression/stream_compression_identity.cc',
+ 'src/core/lib/config/core_configuration.cc',
'src/core/lib/debug/stats.cc',
'src/core/lib/debug/stats_data.cc',
'src/core/lib/debug/trace.cc',
- 'src/core/lib/event_engine/slice_allocator.cc',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.cc',
+ 'src/core/lib/event_engine/default_event_engine_factory.cc',
+ 'src/core/lib/event_engine/event_engine.cc',
+ 'src/core/lib/event_engine/memory_allocator.cc',
+ 'src/core/lib/event_engine/resolved_address.cc',
'src/core/lib/event_engine/sockaddr.cc',
+ 'src/core/lib/gprpp/time.cc',
'src/core/lib/http/format_request.cc',
'src/core/lib/http/httpcli.cc',
'src/core/lib/http/parser.cc',
@@ -1238,17 +1275,24 @@
'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_event_engine.cc',
'src/core/lib/iomgr/endpoint_pair_posix.cc',
- 'src/core/lib/iomgr/endpoint_pair_uv.cc',
'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_epoll1_linux.cc',
- 'src/core/lib/iomgr/ev_epollex_linux.cc',
'src/core/lib/iomgr/ev_poll_posix.cc',
'src/core/lib/iomgr/ev_posix.cc',
'src/core/lib/iomgr/ev_windows.cc',
+ 'src/core/lib/iomgr/event_engine/closure.cc',
+ 'src/core/lib/iomgr/event_engine/endpoint.cc',
+ 'src/core/lib/iomgr/event_engine/iomgr.cc',
+ 'src/core/lib/iomgr/event_engine/pollset.cc',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.cc',
+ 'src/core/lib/iomgr/event_engine/resolver.cc',
+ 'src/core/lib/iomgr/event_engine/tcp.cc',
+ 'src/core/lib/iomgr/event_engine/timer.cc',
'src/core/lib/iomgr/exec_ctx.cc',
'src/core/lib/iomgr/executor.cc',
'src/core/lib/iomgr/executor/mpmcqueue.cc',
@@ -1263,60 +1307,45 @@
'src/core/lib/iomgr/internal_errqueue.cc',
'src/core/lib/iomgr/iocp_windows.cc',
'src/core/lib/iomgr/iomgr.cc',
- 'src/core/lib/iomgr/iomgr_custom.cc',
'src/core/lib/iomgr/iomgr_internal.cc',
'src/core/lib/iomgr/iomgr_posix.cc',
'src/core/lib/iomgr/iomgr_posix_cfstream.cc',
- 'src/core/lib/iomgr/iomgr_uv.cc',
'src/core/lib/iomgr/iomgr_windows.cc',
- '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/polling_entity.cc',
'src/core/lib/iomgr/pollset.cc',
- 'src/core/lib/iomgr/pollset_custom.cc',
'src/core/lib/iomgr/pollset_set.cc',
- 'src/core/lib/iomgr/pollset_set_custom.cc',
'src/core/lib/iomgr/pollset_set_windows.cc',
- 'src/core/lib/iomgr/pollset_uv.cc',
'src/core/lib/iomgr/pollset_windows.cc',
'src/core/lib/iomgr/resolve_address.cc',
- 'src/core/lib/iomgr/resolve_address_custom.cc',
'src/core/lib/iomgr/resolve_address_posix.cc',
'src/core/lib/iomgr/resolve_address_windows.cc',
- 'src/core/lib/iomgr/resource_quota.cc',
+ 'src/core/lib/iomgr/sockaddr_utils_posix.cc',
'src/core/lib/iomgr/socket_factory_posix.cc',
'src/core/lib/iomgr/socket_mutator.cc',
'src/core/lib/iomgr/socket_utils_common_posix.cc',
'src/core/lib/iomgr/socket_utils_linux.cc',
'src/core/lib/iomgr/socket_utils_posix.cc',
- 'src/core/lib/iomgr/socket_utils_uv.cc',
'src/core/lib/iomgr/socket_utils_windows.cc',
'src/core/lib/iomgr/socket_windows.cc',
'src/core/lib/iomgr/tcp_client.cc',
'src/core/lib/iomgr/tcp_client_cfstream.cc',
- 'src/core/lib/iomgr/tcp_client_custom.cc',
'src/core/lib/iomgr/tcp_client_posix.cc',
'src/core/lib/iomgr/tcp_client_windows.cc',
- 'src/core/lib/iomgr/tcp_custom.cc',
'src/core/lib/iomgr/tcp_posix.cc',
'src/core/lib/iomgr/tcp_server.cc',
- 'src/core/lib/iomgr/tcp_server_custom.cc',
'src/core/lib/iomgr/tcp_server_posix.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_common.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
'src/core/lib/iomgr/tcp_server_windows.cc',
- 'src/core/lib/iomgr/tcp_uv.cc',
'src/core/lib/iomgr/tcp_windows.cc',
'src/core/lib/iomgr/time_averaged_stats.cc',
'src/core/lib/iomgr/timer.cc',
- 'src/core/lib/iomgr/timer_custom.cc',
'src/core/lib/iomgr/timer_generic.cc',
'src/core/lib/iomgr/timer_heap.cc',
'src/core/lib/iomgr/timer_manager.cc',
- 'src/core/lib/iomgr/timer_uv.cc',
- 'src/core/lib/iomgr/udp_server.cc',
'src/core/lib/iomgr/unix_sockets_posix.cc',
'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
'src/core/lib/iomgr/wakeup_fd_eventfd.cc',
@@ -1327,13 +1356,51 @@
'src/core/lib/json/json_reader.cc',
'src/core/lib/json/json_util.cc',
'src/core/lib/json/json_writer.cc',
+ 'src/core/lib/promise/activity.cc',
+ 'src/core/lib/promise/sleep.cc',
+ 'src/core/lib/resolver/resolver.cc',
+ 'src/core/lib/resolver/resolver_registry.cc',
+ 'src/core/lib/resolver/server_address.cc',
+ 'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/arena.cc',
+ 'src/core/lib/resource_quota/memory_quota.cc',
+ 'src/core/lib/resource_quota/resource_quota.cc',
+ 'src/core/lib/resource_quota/thread_quota.cc',
+ 'src/core/lib/resource_quota/trace.cc',
+ 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc',
+ 'src/core/lib/security/authorization/evaluate_args.cc',
+ 'src/core/lib/security/authorization/grpc_server_authz_filter.cc',
+ 'src/core/lib/security/context/security_context.cc',
+ 'src/core/lib/security/credentials/call_creds_util.cc',
+ 'src/core/lib/security/credentials/composite/composite_credentials.cc',
+ 'src/core/lib/security/credentials/credentials.cc',
+ 'src/core/lib/security/credentials/fake/fake_credentials.cc',
+ 'src/core/lib/security/credentials/insecure/insecure_credentials.cc',
+ 'src/core/lib/security/credentials/plugin/plugin_credentials.cc',
+ 'src/core/lib/security/credentials/tls/tls_utils.cc',
+ 'src/core/lib/security/security_connector/fake/fake_security_connector.cc',
+ 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc',
+ 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
+ 'src/core/lib/security/security_connector/load_system_roots_linux.cc',
+ 'src/core/lib/security/security_connector/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',
+ 'src/core/lib/security/transport/server_auth_filter.cc',
+ 'src/core/lib/security/transport/tsi_error.cc',
+ 'src/core/lib/security/util/json_util.cc',
+ 'src/core/lib/service_config/service_config_impl.cc',
+ 'src/core/lib/service_config/service_config_parser.cc',
'src/core/lib/slice/b64.cc',
'src/core/lib/slice/percent_encoding.cc',
'src/core/lib/slice/slice.cc',
+ 'src/core/lib/slice/slice_api.cc',
'src/core/lib/slice/slice_buffer.cc',
- 'src/core/lib/slice/slice_intern.cc',
+ 'src/core/lib/slice/slice_refcount.cc',
+ 'src/core/lib/slice/slice_split.cc',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/surface/api_trace.cc',
+ 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -1347,28 +1414,28 @@
'src/core/lib/surface/completion_queue_factory.cc',
'src/core/lib/surface/event_string.cc',
'src/core/lib/surface/init.cc',
- 'src/core/lib/surface/init_unsecure.cc',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/metadata_array.cc',
'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/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc',
'src/core/lib/transport/error_utils.cc',
- 'src/core/lib/transport/metadata.cc',
- 'src/core/lib/transport/metadata_batch.cc',
+ 'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
- 'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',
- 'src/core/lib/transport/status_metadata.cc',
'src/core/lib/transport/timeout_encoding.cc',
'src/core/lib/transport/transport.cc',
'src/core/lib/transport/transport_op_string.cc',
'src/core/lib/uri/uri_parser.cc',
- 'src/core/plugin_registry/grpc_unsecure_plugin_registry.cc',
+ 'src/core/plugin_registry/grpc_plugin_registry.cc',
+ 'src/core/plugin_registry/grpc_plugin_registry_noextra.cc',
+ 'src/core/tsi/fake_transport_security.cc',
+ 'src/core/tsi/local_transport_security.cc',
+ 'src/core/tsi/transport_security.cc',
+ 'src/core/tsi/transport_security_grpc.cc',
],
},
{
@@ -1394,6 +1461,24 @@
'grpc',
],
'sources': [
+ 'src/core/ext/transport/binder/client/binder_connector.cc',
+ 'src/core/ext/transport/binder/client/channel_create.cc',
+ 'src/core/ext/transport/binder/client/channel_create_impl.cc',
+ 'src/core/ext/transport/binder/client/connection_id_generator.cc',
+ 'src/core/ext/transport/binder/client/endpoint_binder_pool.cc',
+ 'src/core/ext/transport/binder/client/jni_utils.cc',
+ 'src/core/ext/transport/binder/client/security_policy_setting.cc',
+ 'src/core/ext/transport/binder/security_policy/binder_security_policy.cc',
+ 'src/core/ext/transport/binder/server/binder_server.cc',
+ 'src/core/ext/transport/binder/server/binder_server_credentials.cc',
+ 'src/core/ext/transport/binder/transport/binder_transport.cc',
+ 'src/core/ext/transport/binder/utils/ndk_binder.cc',
+ 'src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc',
+ 'src/core/ext/transport/binder/wire_format/binder_android.cc',
+ 'src/core/ext/transport/binder/wire_format/binder_constants.cc',
+ 'src/core/ext/transport/binder/wire_format/transaction.cc',
+ 'src/core/ext/transport/binder/wire_format/wire_reader_impl.cc',
+ 'src/core/ext/transport/binder/wire_format/wire_writer.cc',
'src/cpp/client/channel_cc.cc',
'src/cpp/client/client_callback.cc',
'src/cpp/client/client_context.cc',
@@ -1418,8 +1503,8 @@
'src/cpp/common/secure_channel_arguments.cc',
'src/cpp/common/secure_create_auth_context.cc',
'src/cpp/common/tls_certificate_provider.cc',
+ 'src/cpp/common/tls_certificate_verifier.cc',
'src/cpp/common/tls_credentials_options.cc',
- 'src/cpp/common/tls_credentials_options_util.cc',
'src/cpp/common/validate_service_config.cc',
'src/cpp/common/version_cc.cc',
'src/cpp/server/async_generic_service.cc',
@@ -1615,6 +1700,7 @@
'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_strex.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',
@@ -1623,7 +1709,6 @@
'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',
@@ -1755,13 +1840,13 @@
'third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.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/name_print.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',
@@ -1840,6 +1925,7 @@
'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/encrypted_client_hello.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/extensions.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',
@@ -1862,7 +1948,6 @@
'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',
@@ -1902,6 +1987,7 @@
'third_party/benchmark/src/counter.cc',
'third_party/benchmark/src/csv_reporter.cc',
'third_party/benchmark/src/json_reporter.cc',
+ 'third_party/benchmark/src/perf_counters.cc',
'third_party/benchmark/src/reporter.cc',
'third_party/benchmark/src/sleep.cc',
'third_party/benchmark/src/statistics.cc',
@@ -1947,10 +2033,14 @@
'dependencies': [
],
'sources': [
+ 'third_party/upb/third_party/utf8_range/naive.c',
+ 'third_party/upb/third_party/utf8_range/range2-neon.c',
+ 'third_party/upb/third_party/utf8_range/range2-sse.c',
'third_party/upb/upb/decode_fast.c',
'third_party/upb/upb/decode.c',
'third_party/upb/upb/def.c',
'third_party/upb/upb/encode.c',
+ 'third_party/upb/upb/json_encode.c',
'third_party/upb/upb/msg.c',
'third_party/upb/upb/reflection.c',
'third_party/upb/upb/table.c',
diff --git a/grpc/include/grpc/byte_buffer.h b/grpc/include/grpc/byte_buffer.h
index ee740f47..fff33cb8 100644
--- a/grpc/include/grpc/byte_buffer.h
+++ b/grpc/include/grpc/byte_buffer.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer.h>
+#include <grpc/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpc/slice_buffer.h>
#endif /* GRPC_BYTE_BUFFER_H */
diff --git a/grpc/include/grpc/byte_buffer_reader.h b/grpc/include/grpc/byte_buffer_reader.h
index 15e06cad..763dd780 100644
--- a/grpc/include/grpc/byte_buffer_reader.h
+++ b/grpc/include/grpc/byte_buffer_reader.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer_reader.h>
+#include <grpc/impl/codegen/byte_buffer_reader.h> // IWYU pragma: export
#endif /* GRPC_BYTE_BUFFER_READER_H */
diff --git a/grpc/include/grpc/event_engine/channel_args.h b/grpc/include/grpc/event_engine/channel_args.h
deleted file mode 100644
index d809b1fb..00000000
--- a/grpc/include/grpc/event_engine/channel_args.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2021 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.
-#ifndef GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
-#define GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
-
-#include <grpc/support/port_platform.h>
-
-namespace grpc_event_engine {
-namespace experimental {
-
-// TODO(hork): define
-class ChannelArgs;
-
-} // namespace experimental
-} // namespace grpc_event_engine
-
-#endif // GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
diff --git a/grpc/include/grpc/event_engine/endpoint_config.h b/grpc/include/grpc/event_engine/endpoint_config.h
new file mode 100644
index 00000000..6ca4b4f7
--- /dev/null
+++ b/grpc/include/grpc/event_engine/endpoint_config.h
@@ -0,0 +1,43 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+#define GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include "absl/strings/string_view.h"
+#include "absl/types/variant.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Collection of parameters used to configure client and server endpoints. The
+/// \a EndpointConfig maps string-valued keys to values of type int,
+/// string_view, or void pointer. Each EventEngine implementation should
+/// document its set of supported configuration options.
+class EndpointConfig {
+ public:
+ virtual ~EndpointConfig() = default;
+ using Setting = absl::variant<absl::monostate, int, absl::string_view, void*>;
+ /// Returns the Setting for a specified key, or \a absl::monostate if there is
+ /// no such entry. Caller does not take ownership of the resulting value.
+ virtual Setting Get(absl::string_view key) const = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
diff --git a/grpc/include/grpc/event_engine/event_engine.h b/grpc/include/grpc/event_engine/event_engine.h
index cdb59662..63c92bf8 100644
--- a/grpc/include/grpc/event_engine/event_engine.h
+++ b/grpc/include/grpc/event_engine/event_engine.h
@@ -23,13 +23,11 @@
#include "absl/status/statusor.h"
#include "absl/time/time.h"
-#include "grpc/event_engine/channel_args.h"
-#include "grpc/event_engine/port.h"
-#include "grpc/event_engine/slice_allocator.h"
+#include <grpc/event_engine/endpoint_config.h>
+#include <grpc/event_engine/memory_allocator.h>
+#include <grpc/event_engine/port.h>
-// TODO(hork): explicitly define lifetimes and ownership of all objects.
// TODO(hork): Define the Endpoint::Write metrics collection system
-
namespace grpc_event_engine {
namespace experimental {
@@ -75,16 +73,37 @@ namespace experimental {
////////////////////////////////////////////////////////////////////////////////
class EventEngine {
public:
- /// A basic callable function. The first argument to all callbacks is an
- /// absl::Status indicating the status of the operation associated with this
- /// callback. Each EventEngine method that takes a callback parameter, defines
- /// the expected sets and meanings of statuses for that use case.
- using Callback = std::function<void(absl::Status)>;
- /// A callback handle, used to cancel a callback.
+ /// A custom closure type for EventEngine task execution.
+ ///
+ /// Throughout the EventEngine API, \a Closure ownership is retained by the
+ /// caller - the EventEngine will never delete a Closure, and upon
+ /// cancellation, the EventEngine will simply forget the Closure exists. The
+ /// caller is responsible for all necessary cleanup.
+ class Closure {
+ public:
+ Closure() = default;
+ // Closure's are an interface, and thus non-copyable.
+ Closure(const Closure&) = delete;
+ Closure& operator=(const Closure&) = delete;
+ // Polymorphic type => virtual destructor
+ virtual ~Closure() = default;
+ // Run the contained code.
+ virtual void Run() = 0;
+ };
+ /// Represents a scheduled task.
+ ///
+ /// \a TaskHandles are returned by \a Run* methods, and can be given to the
+ /// \a Cancel method.
struct TaskHandle {
- intptr_t key;
+ intptr_t keys[2];
};
- /// A thin wrapper around a platform-specific sockaddr type. A sockaddr struct
+ /// A handle to a cancellable connection attempt.
+ ///
+ /// Returned by \a Connect, and can be passed to \a CancelConnect.
+ struct ConnectionHandle {
+ intptr_t keys[2];
+ };
+ /// Thin wrapper around a platform-specific sockaddr type. A sockaddr struct
/// exists on all platforms that gRPC supports.
///
/// Platforms are expected to provide definitions for:
@@ -96,28 +115,30 @@ class EventEngine {
static constexpr socklen_t MAX_SIZE_BYTES = 128;
ResolvedAddress(const sockaddr* address, socklen_t size);
+ ResolvedAddress() = default;
+ ResolvedAddress(const ResolvedAddress&) = default;
const struct sockaddr* address() const;
socklen_t size() const;
private:
char address_[MAX_SIZE_BYTES];
- socklen_t size_;
+ socklen_t size_ = 0;
};
- /// An Endpoint represents one end of a connection between a gRPC client and
- /// server. Endpoints are created when connections are established, and
- /// Endpoint operations are gRPC's primary means of communication.
+ /// One end of a connection between a gRPC client and server. Endpoints are
+ /// created when connections are established, and Endpoint operations are
+ /// gRPC's primary means of communication.
///
- /// Endpoints must use the provided SliceAllocator for all data buffer memory
+ /// Endpoints must use the provided MemoryAllocator for all data buffer memory
/// allocations. gRPC allows applications to set memory constraints per
/// Channel or Server, and the implementation depends on all dynamic memory
/// allocation being handled by the quota system.
class Endpoint {
public:
- /// The Endpoint destructor is responsible for shutting down all connections
- /// and invoking all pending read or write callbacks with an error status.
+ /// Shuts down all connections and invokes all pending read or write
+ /// callbacks with an error status.
virtual ~Endpoint() = default;
- /// Read data from the Endpoint.
+ /// Reads data from the Endpoint.
///
/// When data is available on the connection, that data is moved into the
/// \a buffer, and the \a on_read callback is called. The caller must ensure
@@ -125,33 +146,41 @@ class EventEngine {
/// Ownership of the buffer is not transferred. Valid slices *may* be placed
/// into the buffer even if the callback is invoked with a non-OK Status.
///
+ /// There can be at most one outstanding read per Endpoint at any given
+ /// time. An outstanding read is one in which the \a on_read callback has
+ /// not yet been executed for some previous call to \a Read. If an attempt
+ /// is made to call \a Read while a previous read is still outstanding, the
+ /// \a EventEngine must abort.
+ ///
/// For failed read operations, implementations should pass the appropriate
/// statuses to \a on_read. For example, callbacks might expect to receive
- /// DEADLINE_EXCEEDED when the deadline is exceeded, and CANCELLED on
- /// endpoint shutdown.
- virtual void Read(Callback on_read, SliceBuffer* buffer,
- absl::Time deadline) = 0;
- /// Write data out on the connection.
+ /// CANCELLED on endpoint shutdown.
+ virtual void Read(std::function<void(absl::Status)> on_read,
+ SliceBuffer* buffer) = 0;
+ /// Writes data out on the connection.
///
/// \a on_writable is called when the connection is ready for more data. The
/// Slices within the \a data buffer may be mutated at will by the Endpoint
/// until \a on_writable is called. The \a data SliceBuffer will remain
- /// valid after calling \a Write, but its state is otherwise undefined.
+ /// valid after calling \a Write, but its state is otherwise undefined. All
+ /// bytes in \a data must have been written before calling \a on_writable
+ /// unless an error has occurred.
+ ///
+ /// There can be at most one outstanding write per Endpoint at any given
+ /// time. An outstanding write is one in which the \a on_writable callback
+ /// has not yet been executed for some previous call to \a Write. If an
+ /// attempt is made to call \a Write while a previous write is still
+ /// outstanding, the \a EventEngine must abort.
///
/// For failed write operations, implementations should pass the appropriate
/// statuses to \a on_writable. For example, callbacks might expect to
- /// receive DEADLINE_EXCEEDED when the deadline is exceeded, and CANCELLED
- /// on endpoint shutdown.
- virtual void Write(Callback on_writable, SliceBuffer* data,
- absl::Time deadline) = 0;
- // TODO(hork): define status codes for the callback
- // TODO(hork): define cleanup operations, lifetimes, responsibilities.
- virtual void Close(Callback on_close) = 0;
- /// These methods return an address in the format described in DNSResolver.
- /// The returned values are owned by the Endpoint and are expected to remain
- /// valid for the life of the Endpoint.
- virtual const ResolvedAddress* GetPeerAddress() const = 0;
- virtual const ResolvedAddress* GetLocalAddress() const = 0;
+ /// receive CANCELLED on endpoint shutdown.
+ virtual void Write(std::function<void(absl::Status)> on_writable,
+ SliceBuffer* data) = 0;
+ /// Returns an address in the format described in DNSResolver. The returned
+ /// values are expected to remain valid for the life of the Endpoint.
+ virtual const ResolvedAddress& GetPeerAddress() const = 0;
+ virtual const ResolvedAddress& GetLocalAddress() const = 0;
};
/// Called when a new connection is established.
@@ -163,12 +192,13 @@ class EventEngine {
using OnConnectCallback =
std::function<void(absl::StatusOr<std::unique_ptr<Endpoint>>)>;
- /// An EventEngine Listener listens for incoming connection requests from gRPC
- /// clients and initiates request processing once connections are established.
+ /// Listens for incoming connection requests from gRPC clients and initiates
+ /// request processing once connections are established.
class Listener {
public:
/// Called when the listener has accepted a new client connection.
- using AcceptCallback = std::function<void(std::unique_ptr<Endpoint>)>;
+ using AcceptCallback = std::function<void(
+ std::unique_ptr<Endpoint>, MemoryAllocator memory_allocator)>;
virtual ~Listener() = default;
/// Bind an address/port to this Listener.
///
@@ -182,52 +212,56 @@ class EventEngine {
/// Factory method to create a network listener / server.
///
/// Once a \a Listener is created and started, the \a on_accept callback will
- /// be called once asynchronously for each established connection. Note that
- /// unlike other callbacks, there is no status code parameter since the
- /// callback will only be called in healthy scenarios where connections can be
- /// accepted.
- ///
- /// This method may return a non-OK status immediately if an error was
- /// encountered in any synchronous steps required to create the Listener. In
- /// this case, \a on_shutdown will never be called.
+ /// be called once asynchronously for each established connection. This method
+ /// may return a non-OK status immediately if an error was encountered in any
+ /// synchronous steps required to create the Listener. In this case,
+ /// \a on_shutdown will never be called.
///
/// If this method returns a Listener, then \a on_shutdown will be invoked
/// exactly once, when the Listener is shut down. The status passed to it will
/// indicate if there was a problem during shutdown.
///
- /// The provided \a SliceAllocatorFactory is used to create \a SliceAllocators
- /// for Endpoint construction.
+ /// The provided \a MemoryAllocatorFactory is used to create \a
+ /// MemoryAllocators for Endpoint construction.
virtual absl::StatusOr<std::unique_ptr<Listener>> CreateListener(
- Listener::AcceptCallback on_accept, Callback on_shutdown,
- const ChannelArgs& args,
- SliceAllocatorFactory slice_allocator_factory) = 0;
+ Listener::AcceptCallback on_accept,
+ std::function<void(absl::Status)> on_shutdown,
+ const EndpointConfig& config,
+ std::unique_ptr<MemoryAllocatorFactory> memory_allocator_factory) = 0;
/// Creates a client network connection to a remote network listener.
///
- /// \a Connect may return an error status immediately if there was a failure
- /// in the synchronous part of establishing a connection. In that event, the
- /// \a on_connect callback *will not* have been executed. Otherwise, it is
- /// expected that the \a on_connect callback will be asynchronously executed
- /// exactly once by the EventEngine.
+ /// Even in the event of an error, it is expected that the \a on_connect
+ /// callback will be asynchronously executed exactly once by the EventEngine.
+ /// A connection attempt can be cancelled using the \a CancelConnect method.
///
- /// Implementation Note: it is important that the \a slice_allocator be used
+ /// Implementation Note: it is important that the \a memory_allocator be used
/// for all read/write buffer allocations in the EventEngine implementation.
/// This allows gRPC's \a ResourceQuota system to monitor and control memory
/// usage with graceful degradation mechanisms. Please see the \a
- /// SliceAllocator API for more information.
- virtual absl::Status Connect(OnConnectCallback on_connect,
- const ResolvedAddress& addr,
- const ChannelArgs& args,
- SliceAllocator slice_allocator,
- absl::Time deadline) = 0;
+ /// MemoryAllocator API for more information.
+ virtual ConnectionHandle Connect(OnConnectCallback on_connect,
+ const ResolvedAddress& addr,
+ const EndpointConfig& args,
+ MemoryAllocator memory_allocator,
+ absl::Time deadline) = 0;
- /// The DNSResolver that provides asynchronous resolution.
+ /// Request cancellation of a connection attempt.
+ ///
+ /// If the associated connection has already been completed, it will not be
+ /// cancelled, and this method will return false.
+ ///
+ /// If the associated connection has not been completed, it will be cancelled,
+ /// and this method will return true. The \a OnConnectCallback will not be
+ /// called.
+ virtual bool CancelConnect(ConnectionHandle handle) = 0;
+ /// Provides asynchronous resolution.
class DNSResolver {
public:
- /// A task handle for DNS Resolution requests.
+ /// Task handle for DNS Resolution requests.
struct LookupTaskHandle {
- intptr_t key;
+ intptr_t key[2];
};
- /// A DNS SRV record type.
+ /// DNS SRV record type.
struct SRVRecord {
std::string host;
int port = 0;
@@ -254,8 +288,10 @@ class EventEngine {
/// When the lookup is complete, the \a on_resolve callback will be invoked
/// with a status indicating the success or failure of the lookup.
/// Implementations should pass the appropriate statuses to the callback.
- /// For example, callbacks might expect to receive DEADLINE_EXCEEDED when
- /// the deadline is exceeded or CANCELLED if the lookup was cancelled.
+ /// For example, callbacks might expect to receive DEADLINE_EXCEEDED or
+ /// NOT_FOUND.
+ ///
+ /// If cancelled, \a on_resolve will not be executed.
virtual LookupTaskHandle LookupHostname(LookupHostnameCallback on_resolve,
absl::string_view address,
absl::string_view default_port,
@@ -275,60 +311,87 @@ class EventEngine {
absl::string_view name,
absl::Time deadline) = 0;
/// Cancel an asynchronous lookup operation.
- virtual void TryCancelLookup(LookupTaskHandle handle) = 0;
+ ///
+ /// This shares the same semantics with \a EventEngine::Cancel: successfully
+ /// cancelled lookups will not have their callbacks executed, and this
+ /// method returns true.
+ virtual bool CancelLookup(LookupTaskHandle handle) = 0;
};
+ /// At time of destruction, the EventEngine must have no active
+ /// responsibilities. EventEngine users (applications) are responsible for
+ /// cancelling all tasks and DNS lookups, shutting down listeners and
+ /// endpoints, prior to EventEngine destruction. If there are any outstanding
+ /// tasks, any running listeners, etc. at time of EventEngine destruction,
+ /// that is an invalid use of the API, and it will result in undefined
+ /// behavior.
virtual ~EventEngine() = default;
- // TODO(hork): define return status codes
- /// Retrieves an instance of a DNSResolver.
- virtual absl::StatusOr<std::unique_ptr<DNSResolver>> GetDNSResolver() = 0;
+ // TODO(nnoble): consider whether we can remove this method before we
+ // de-experimentalize this API.
+ virtual bool IsWorkerThread() = 0;
- /// Intended for future expansion of Task run functionality.
- struct RunOptions {};
- // TODO(hork): consider recommendation to make TaskHandle an output arg
- /// Run a callback as soon as possible.
+ /// Creates and returns an instance of a DNSResolver.
+ virtual std::unique_ptr<DNSResolver> GetDNSResolver() = 0;
+
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. The \a closure will
+ /// not be deleted after it has been run, ownership remains with the caller.
+ virtual void Run(Closure* closure) = 0;
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. Unlike the
+ /// overloaded \a Closure alternative, the std::function version's \a closure
+ /// will be deleted by the EventEngine after the closure has been run.
///
- /// The \a fn callback's \a status argument is used to indicate whether it was
- /// executed normally. For example, the status may be CANCELLED if
- /// \a TryCancel was called, or if the EventEngine is being shut down.
- virtual TaskHandle Run(Callback fn, RunOptions opts) = 0;
+ /// This version of \a Run may be less performant than the \a Closure version
+ /// in some scenarios. This overload is useful in situations where performance
+ /// is not a critical concern.
+ virtual void Run(std::function<void()> closure) = 0;
/// Synonymous with scheduling an alarm to run at time \a when.
///
- /// The callback \a fn will execute when either when time \a when arrives
- /// (receiving status OK), or when the \a fn is cancelled (reveiving status
- /// CANCELLED). The callback is guaranteed to be called exactly once.
- virtual TaskHandle RunAt(absl::Time when, Callback fn, RunOptions opts) = 0;
- /// Immediately tries to cancel a callback.
- /// Note that this is a "best effort" cancellation. No guarantee is made that
- /// the callback will be cancelled, the call could be in any stage.
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run, nor will it be deleted. Ownership remains with the caller.
+ virtual TaskHandle RunAt(absl::Time when, Closure* closure) = 0;
+ /// Synonymous with scheduling an alarm to run at time \a when.
+ ///
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run. Unilke the overloaded \a Closure alternative, the std::function
+ /// version's \a closure will be deleted by the EventEngine after the closure
+ /// has been run, or upon cancellation.
///
- /// There are three scenarios in which we may cancel a scheduled function:
- /// 1. We cancel the execution before it has run.
- /// 2. The callback has already run.
- /// 3. We can't cancel it because it is "in flight".
+ /// This version of \a RunAt may be less performant than the \a Closure
+ /// version in some scenarios. This overload is useful in situations where
+ /// performance is not a critical concern.
+ virtual TaskHandle RunAt(absl::Time when, std::function<void()> closure) = 0;
+ /// Request cancellation of a task.
///
- /// In all cases, the cancellation is still considered successful, the
- /// callback will be run exactly once from either cancellation or from its
- /// activation.
- virtual void TryCancel(TaskHandle handle) = 0;
- /// Immediately run all callbacks with status indicating the shutdown. Every
- /// EventEngine is expected to shut down exactly once. No new callbacks/tasks
- /// should be scheduled after shutdown has begun, no new connections should be
- /// created.
+ /// If the associated closure has already been scheduled to run, it will not
+ /// be cancelled, and this function will return false.
///
- /// If the \a on_shutdown_complete callback is given a non-OK status, errors
- /// are expected to be unrecoverable. For example, an implementation could
- /// warn callers about leaks if memory cannot be freed within a certain
- /// timeframe.
- virtual void Shutdown(Callback on_shutdown_complete) = 0;
+ /// If the associated callback has not been scheduled to run, it will be
+ /// cancelled, and the associated std::function or \a Closure* will not be
+ /// executed. In this case, Cancel will return true.
+ virtual bool Cancel(TaskHandle handle) = 0;
};
-/// Lazily instantiate and return a default global EventEngine instance if no
-/// custom instance is provided. If a custom EventEngine is provided for every
-/// channel/server via ChannelArgs, this method should never be called, and the
-/// default instance will never be instantiated.
-std::shared_ptr<EventEngine> GetDefaultEventEngine();
+/// Replace gRPC's default EventEngine factory.
+///
+/// Applications may call \a SetDefaultEventEngineFactory at any time to replace
+/// the default factory used within gRPC. EventEngines will be created when
+/// necessary, when they are otherwise not provided by the application.
+///
+/// To be certain that none of the gRPC-provided built-in EventEngines are
+/// created, applications must set a custom EventEngine factory method *before*
+/// grpc is initialized.
+void SetDefaultEventEngineFactory(
+ const std::function<std::unique_ptr<EventEngine>()>* factory);
+
+/// Create an EventEngine using the default factory.
+std::unique_ptr<EventEngine> CreateEventEngine();
} // namespace experimental
} // namespace grpc_event_engine
diff --git a/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h b/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h
new file mode 100644
index 00000000..e0ca2f5e
--- /dev/null
+++ b/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h
@@ -0,0 +1,68 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+#define GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/memory_request.h>
+#include <grpc/slice.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace internal {
+
+/// Underlying memory allocation interface.
+/// This is an internal interface, not intended to be used by users.
+/// Its interface is subject to change at any time.
+class MemoryAllocatorImpl
+ : public std::enable_shared_from_this<MemoryAllocatorImpl> {
+ public:
+ MemoryAllocatorImpl() {}
+ virtual ~MemoryAllocatorImpl() {}
+
+ MemoryAllocatorImpl(const MemoryAllocatorImpl&) = delete;
+ MemoryAllocatorImpl& operator=(const MemoryAllocatorImpl&) = delete;
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ /// If MemoryRequest is invalid, this function will abort.
+ /// If MemoryRequest is valid, this function is infallible, and will always
+ /// succeed at reserving the some number of bytes between request.min() and
+ /// request.max() inclusively.
+ virtual size_t Reserve(MemoryRequest request) = 0;
+
+ /// Release some bytes that were previously reserved.
+ /// If more bytes are released than were reserved, we will have undefined
+ /// behavior.
+ virtual void Release(size_t n) = 0;
+
+ /// Shutdown this allocator.
+ /// Further usage of Reserve() is undefined behavior.
+ virtual void Shutdown() = 0;
+};
+
+} // namespace internal
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
diff --git a/grpc/include/grpc/event_engine/memory_allocator.h b/grpc/include/grpc/event_engine/memory_allocator.h
new file mode 100644
index 00000000..8c812671
--- /dev/null
+++ b/grpc/include/grpc/event_engine/memory_allocator.h
@@ -0,0 +1,226 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+#define GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <stdlib.h> // for abort()
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/internal/memory_allocator_impl.h>
+#include <grpc/slice.h>
+
+// forward-declaring an internal struct, not used publicly.
+struct grpc_slice_buffer;
+
+namespace grpc_event_engine {
+namespace experimental {
+
+// TODO(nnoble): needs implementation
+class SliceBuffer {
+ public:
+ SliceBuffer() { abort(); }
+ explicit SliceBuffer(grpc_slice_buffer*) { abort(); }
+
+ grpc_slice_buffer* RawSliceBuffer() { return slice_buffer_; }
+
+ private:
+ grpc_slice_buffer* slice_buffer_;
+};
+
+// Tracks memory allocated by one system.
+// Is effectively a thin wrapper/smart pointer for a MemoryAllocatorImpl,
+// providing a convenient and stable API.
+class MemoryAllocator {
+ public:
+ /// Construct a MemoryAllocator given an internal::MemoryAllocatorImpl
+ /// implementation. The constructed MemoryAllocator will call
+ /// MemoryAllocatorImpl::Shutdown() upon destruction.
+ explicit MemoryAllocator(
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator)
+ : allocator_(std::move(allocator)) {}
+ // Construct an invalid MemoryAllocator.
+ MemoryAllocator() : allocator_(nullptr) {}
+ ~MemoryAllocator() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ }
+
+ MemoryAllocator(const MemoryAllocator&) = delete;
+ MemoryAllocator& operator=(const MemoryAllocator&) = delete;
+
+ MemoryAllocator(MemoryAllocator&&) = default;
+ MemoryAllocator& operator=(MemoryAllocator&&) = default;
+
+ /// Drop the underlying allocator and make this an empty object.
+ /// The object will not be usable after this call unless it's a valid
+ /// allocator is moved into it.
+ void Reset() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ allocator_.reset();
+ }
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ size_t Reserve(MemoryRequest request) { return allocator_->Reserve(request); }
+
+ /// Release some bytes that were previously reserved.
+ void Release(size_t n) { return allocator_->Release(n); }
+
+ //
+ // The remainder of this type are helper functions implemented in terms of
+ // Reserve/Release.
+ //
+
+ /// An automatic releasing reservation of memory.
+ class Reservation {
+ public:
+ Reservation() = default;
+ Reservation(const Reservation&) = delete;
+ Reservation& operator=(const Reservation&) = delete;
+ Reservation(Reservation&&) = default;
+ Reservation& operator=(Reservation&&) = default;
+ ~Reservation() {
+ if (allocator_ != nullptr) allocator_->Release(size_);
+ }
+
+ private:
+ friend class MemoryAllocator;
+ Reservation(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ size_t size)
+ : allocator_(std::move(allocator)), size_(size) {}
+
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ size_t size_ = 0;
+ };
+
+ /// Reserve bytes from the quota and automatically release them when
+ /// Reservation is destroyed.
+ Reservation MakeReservation(MemoryRequest request) {
+ return Reservation(allocator_, Reserve(request));
+ }
+
+ /// Allocate a new object of type T, with constructor arguments.
+ /// The returned type is wrapped, and upon destruction the reserved memory
+ /// will be released to the allocator automatically. As such, T must have a
+ /// virtual destructor so we can insert the necessary hook.
+ template <typename T, typename... Args>
+ typename std::enable_if<std::has_virtual_destructor<T>::value, T*>::type New(
+ Args&&... args) {
+ // Wrap T such that when it's destroyed, we can release memory back to the
+ // allocator.
+ class Wrapper final : public T {
+ public:
+ explicit Wrapper(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ Args&&... args)
+ : T(std::forward<Args>(args)...), allocator_(std::move(allocator)) {}
+ ~Wrapper() override { allocator_->Release(sizeof(*this)); }
+
+ private:
+ const std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ };
+ Reserve(sizeof(Wrapper));
+ return new Wrapper(allocator_, std::forward<Args>(args)...);
+ }
+
+ /// Construct a unique_ptr immediately.
+ template <typename T, typename... Args>
+ std::unique_ptr<T> MakeUnique(Args&&... args) {
+ return std::unique_ptr<T>(New<T>(std::forward<Args>(args)...));
+ }
+
+ /// Allocate a slice, using MemoryRequest to size the number of returned
+ /// bytes. For a variable length request, check the returned slice length to
+ /// verify how much memory was allocated. Takes care of reserving memory for
+ /// any relevant control structures also.
+ grpc_slice MakeSlice(MemoryRequest request);
+
+ /// A C++ allocator for containers of T.
+ template <typename T>
+ class Container {
+ public:
+ using value_type = T;
+
+ /// Construct the allocator: \a underlying_allocator is borrowed, and must
+ /// outlive this object.
+ explicit Container(MemoryAllocator* underlying_allocator)
+ : underlying_allocator_(underlying_allocator) {}
+ template <typename U>
+ explicit Container(const Container<U>& other)
+ : underlying_allocator_(other.underlying_allocator()) {}
+
+ MemoryAllocator* underlying_allocator() const {
+ return underlying_allocator_;
+ }
+
+ T* allocate(size_t n) {
+ underlying_allocator_->Reserve(n * sizeof(T));
+ return static_cast<T*>(::operator new(n * sizeof(T)));
+ }
+ void deallocate(T* p, size_t n) {
+ ::operator delete(p);
+ underlying_allocator_->Release(n * sizeof(T));
+ }
+
+ private:
+ MemoryAllocator* underlying_allocator_;
+ };
+
+ protected:
+ /// Return a pointer to the underlying implementation.
+ /// Note that the interface of said implementation is unstable and likely to
+ /// change at any time.
+ internal::MemoryAllocatorImpl* get_internal_impl_ptr() {
+ return allocator_.get();
+ }
+
+ const internal::MemoryAllocatorImpl* get_internal_impl_ptr() const {
+ return allocator_.get();
+ }
+
+ private:
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+};
+
+// Wrapper type around std::vector to make initialization against a
+// MemoryAllocator based container allocator easy.
+template <typename T>
+class Vector : public std::vector<T, MemoryAllocator::Container<T>> {
+ public:
+ explicit Vector(MemoryAllocator* allocator)
+ : std::vector<T, MemoryAllocator::Container<T>>(
+ MemoryAllocator::Container<T>(allocator)) {}
+};
+
+class MemoryAllocatorFactory {
+ public:
+ virtual ~MemoryAllocatorFactory() = default;
+ /// On Endpoint creation, call \a CreateMemoryAllocator to create a new
+ /// allocator for the endpoint.
+ /// \a name is used to label the memory allocator in debug logs.
+ /// Typically we'll want to:
+ /// auto allocator = factory->CreateMemoryAllocator(peer_address_string);
+ /// auto* endpoint = allocator->New<MyEndpoint>(std::move(allocator), ...);
+ virtual MemoryAllocator CreateMemoryAllocator(absl::string_view name) = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
diff --git a/grpc/include/grpc/event_engine/memory_request.h b/grpc/include/grpc/event_engine/memory_request.h
new file mode 100644
index 00000000..fa15e26c
--- /dev/null
+++ b/grpc/include/grpc/event_engine/memory_request.h
@@ -0,0 +1,57 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+#define GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "absl/strings/string_view.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Reservation request - how much memory do we want to allocate?
+class MemoryRequest {
+ public:
+ /// Request a fixed amount of memory.
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ MemoryRequest(size_t n) : min_(n), max_(n) {}
+ /// Request a range of memory.
+ /// Requires: \a min <= \a max.
+ /// Requires: \a max <= max_size()
+ MemoryRequest(size_t min, size_t max) : min_(min), max_(max) {}
+
+ /// Maximum allowable request size - hard coded to 1GB.
+ static constexpr size_t max_allowed_size() { return 1024 * 1024 * 1024; }
+
+ /// Increase the size by \a amount.
+ /// Undefined behavior if min() + amount or max() + amount overflows.
+ MemoryRequest Increase(size_t amount) const {
+ return MemoryRequest(min_ + amount, max_ + amount);
+ }
+
+ size_t min() const { return min_; }
+ size_t max() const { return max_; }
+
+ private:
+ size_t min_;
+ size_t max_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
diff --git a/grpc/include/grpc/event_engine/port.h b/grpc/include/grpc/event_engine/port.h
index c24b8f90..94245864 100644
--- a/grpc/include/grpc/event_engine/port.h
+++ b/grpc/include/grpc/event_engine/port.h
@@ -17,16 +17,16 @@
#include <grpc/support/port_platform.h>
// Platform-specific sockaddr includes
-#ifdef GRPC_UV
-#include <uv.h>
-#elif defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
+#if defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
defined(GPR_FREEBSD) || defined(GPR_OPENBSD) || defined(GPR_SOLARIS) || \
defined(GPR_AIX) || defined(GPR_NACL) || defined(GPR_FUCHSIA) || \
defined(GRPC_POSIX_SOCKET)
#define GRPC_EVENT_ENGINE_POSIX
+#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#include <unistd.h>
#elif defined(GPR_WINDOWS)
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/grpc/include/grpc/event_engine/slice_allocator.h b/grpc/include/grpc/event_engine/slice_allocator.h
deleted file mode 100644
index 4370cd51..00000000
--- a/grpc/include/grpc/event_engine/slice_allocator.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2021 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.
-#ifndef GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
-#define GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include <functional>
-
-#include "absl/status/status.h"
-
-// forward-declaring an internal struct, not used publicly.
-struct grpc_resource_quota;
-struct grpc_resource_user;
-
-namespace grpc_event_engine {
-namespace experimental {
-
-// TODO(nnoble): forward declared here, needs definition.
-class SliceBuffer;
-
-class SliceAllocator {
- public:
- // gRPC-internal constructor
- explicit SliceAllocator(grpc_resource_user* user);
- // Not copyable
- SliceAllocator(SliceAllocator& other) = delete;
- SliceAllocator& operator=(const SliceAllocator& other) = delete;
- // Moveable
- SliceAllocator(SliceAllocator&& other) = default;
- SliceAllocator& operator=(SliceAllocator&& other) = default;
- ~SliceAllocator();
-
- using AllocateCallback =
- std::function<void(absl::Status, SliceBuffer* buffer)>;
- // TODO(hork): explain what happens under resource exhaustion.
- /// Requests \a size bytes from gRPC, and populates \a dest with the allocated
- /// slices. Ownership of the \a SliceBuffer is not transferred.
- absl::Status Allocate(size_t size, SliceBuffer* dest,
- SliceAllocator::AllocateCallback cb);
-
- private:
- grpc_resource_user* resource_user_;
-};
-
-class SliceAllocatorFactory {
- public:
- // gRPC-internal constructor
- explicit SliceAllocatorFactory(grpc_resource_quota* quota);
- // Not copyable
- SliceAllocatorFactory(SliceAllocatorFactory& other) = delete;
- SliceAllocatorFactory& operator=(const SliceAllocatorFactory& other) = delete;
- // Moveable
- SliceAllocatorFactory(SliceAllocatorFactory&& other) = default;
- SliceAllocatorFactory& operator=(SliceAllocatorFactory&& other) = default;
- ~SliceAllocatorFactory();
-
- /// On Endpoint creation, call \a CreateSliceAllocator with the name of the
- /// endpoint peer (a URI string, most likely). Note: \a peer_name must outlive
- /// the Endpoint.
- SliceAllocator CreateSliceAllocator(absl::string_view peer_name);
-
- private:
- grpc_resource_quota* resource_quota_;
-};
-
-} // namespace experimental
-} // namespace grpc_event_engine
-
-#endif // GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
diff --git a/grpc/include/grpc/fork.h b/grpc/include/grpc/fork.h
index 26f9df98..f52cb502 100644
--- a/grpc/include/grpc/fork.h
+++ b/grpc/include/grpc/fork.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/fork.h>
+#include <grpc/impl/codegen/fork.h> // IWYU pragma: export
#endif /* GRPC_FORK_H */
diff --git a/grpc/include/grpc/grpc.h b/grpc/include/grpc/grpc.h
index f4408e11..0d863b9a 100644
--- a/grpc/include/grpc/grpc.h
+++ b/grpc/include/grpc/grpc.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
+#include <stddef.h>
#include <grpc/byte_buffer.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/slice.h>
+#include <grpc/status.h>
#include <grpc/support/time.h>
-#include <stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -115,8 +115,7 @@ GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_pluck(
of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING.
This function is experimental. */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
- void* reserved);
+ grpc_completion_queue_functor* shutdown_callback, void* reserved);
/** Create a completion queue */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create(
@@ -296,15 +295,41 @@ GRPCAPI void grpc_channel_get_info(grpc_channel* channel,
to non-experimental or remove it. */
GRPCAPI void grpc_channel_reset_connect_backoff(grpc_channel* channel);
-/** Create a client channel to 'target'. Additional channel level configuration
- MAY be provided by grpc_channel_args, though the expectation is that most
- clients will want to simply pass NULL. The user data in 'args' need only
- live through the invocation of this function. However, if any args of the
- 'pointer' type are passed, then the referenced vtable must be maintained
- by the caller until grpc_channel_destroy terminates. See grpc_channel_args
- definition for more on this. */
-GRPCAPI grpc_channel* grpc_insecure_channel_create(
- const char* target, const grpc_channel_args* args, void* reserved);
+/** --- grpc_channel_credentials object. ---
+
+ A channel credentials object represents a way to authenticate a client on a
+ channel. Different types of channel credentials are declared in
+ grpc_security.h. */
+
+typedef struct grpc_channel_credentials grpc_channel_credentials;
+
+/** Releases a channel credentials object.
+ The creator of the credentials object is responsible for its release. */
+
+GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
+
+/** --- grpc_server_credentials object. ---
+
+ A server credentials object represents a way to authenticate a server.
+ Different types of server credentials are declared in grpc_security.h. */
+
+typedef struct grpc_server_credentials grpc_server_credentials;
+
+/** Releases a server_credentials object.
+ The creator of the server_credentials object is responsible for its release.
+ */
+GRPCAPI void grpc_server_credentials_release(grpc_server_credentials* creds);
+
+/** Creates a secure channel using the passed-in credentials. Additional
+ channel level configuration MAY be provided by grpc_channel_args, though
+ the expectation is that most clients will want to simply pass NULL. The
+ user data in 'args' need only live through the invocation of this function.
+ However, if any args of the 'pointer' type are passed, then the referenced
+ vtable must be maintained by the caller until grpc_channel_destroy
+ terminates. See grpc_channel_args definition for more on this. */
+GRPCAPI grpc_channel* grpc_channel_create(const char* target,
+ grpc_channel_credentials* creds,
+ const grpc_channel_args* args);
/** Create a lame client: this client fails every operation attempted on it. */
GRPCAPI grpc_channel* grpc_lame_client_channel_create(
@@ -341,6 +366,10 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
const char* description,
void* reserved);
+/* Returns whether or not the call's receive message operation failed because of
+ * an error (as opposed to a graceful end-of-stream) */
+GRPCAPI int grpc_call_failed_before_recv_message(const grpc_call* c);
+
/** Ref a call.
THREAD SAFETY: grpc_call_ref is thread-compatible */
GRPCAPI void grpc_call_ref(grpc_call* call);
@@ -411,12 +440,18 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server* server,
grpc_completion_queue* cq,
void* reserved);
+// More members might be added in later, so users should take care to memset
+// this to 0 before using it.
+typedef struct {
+ grpc_status_code code;
+ const char* error_message;
+} grpc_serving_status_update;
+
// There might be more methods added later, so users should take care to memset
// this to 0 before using it.
typedef struct {
void (*on_serving_status_update)(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message);
+ grpc_serving_status_update update);
void* user_data;
} grpc_server_xds_status_notifier;
@@ -435,11 +470,11 @@ GRPCAPI void grpc_server_config_fetcher_destroy(
GRPCAPI void grpc_server_set_config_fetcher(
grpc_server* server, grpc_server_config_fetcher* config_fetcher);
-/** Add a HTTP2 over plaintext over tcp listener.
- Returns bound port number on success, 0 on failure.
- REQUIRES: server not started */
-GRPCAPI int grpc_server_add_insecure_http2_port(grpc_server* server,
- const char* addr);
+/** Add a HTTP2 over an encrypted link over tcp listener.
+ Returns bound port number on success, 0 on failure.
+ REQUIRES: server not started */
+GRPCAPI int grpc_server_add_http2_port(grpc_server* server, const char* addr,
+ grpc_server_credentials* creds);
/** Start a server - tells all listeners to start listening */
GRPCAPI void grpc_server_start(grpc_server* server);
@@ -555,6 +590,14 @@ GRPCAPI char* grpc_channelz_get_subchannel(intptr_t subchannel_id);
is allocated and must be freed by the application. */
GRPCAPI char* grpc_channelz_get_socket(intptr_t socket_id);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Fetch a vtable for grpc_channel_arg that points to
+ * grpc_authorization_policy_provider.
+ */
+GRPCAPI const grpc_arg_pointer_vtable*
+grpc_authorization_policy_provider_arg_vtable(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/grpc/include/grpc/grpc_posix.h b/grpc/include/grpc/grpc_posix.h
index fbce5e13..797e3c5b 100644
--- a/grpc/include/grpc/grpc_posix.h
+++ b/grpc/include/grpc/grpc_posix.h
@@ -21,10 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
#include <stddef.h>
+#include <grpc/grpc.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -35,22 +36,25 @@ extern "C" {
* functionality on top of GRPC Core.
*/
-/** Create a client channel to 'target' using file descriptor 'fd'. The 'target'
- argument will be used to indicate the name for this channel. See the comment
- for grpc_insecure_channel_create for description of 'args' argument. */
-GRPCAPI grpc_channel* grpc_insecure_channel_create_from_fd(
- const char* target, int fd, const grpc_channel_args* args);
-
-/** Add the connected communication channel based on file descriptor 'fd' to the
- 'server'. The 'fd' must be an open file descriptor corresponding to a
- connected socket. Events from the file descriptor may come on any of the
- server completion queues (i.e completion queues registered via the
- grpc_server_register_completion_queue API).
-
- The 'reserved' pointer MUST be NULL.
- */
-GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- void* reserved, int fd);
+/** Create a secure channel to 'target' using file descriptor 'fd' and passed-in
+ credentials. The 'target' argument will be used to indicate the name for
+ this channel. Note that this API currently only supports insecure channel
+ credentials. Using other types of credentials will result in a failure. */
+GRPCAPI grpc_channel* grpc_channel_create_from_fd(
+ const char* target, int fd, grpc_channel_credentials* creds,
+ const grpc_channel_args* args);
+
+/** Add the connected secure communication channel based on file descriptor 'fd'
+ to the 'server' and server credentials 'creds'. The 'fd' must be an open file
+ descriptor corresponding to a connected socket. Events from the file
+ descriptor may come on any of the server completion queues (i.e completion
+ queues registered via the grpc_server_register_completion_queue API).
+ Note that this API currently only supports inseure server credentials
+ Using other types of credentials will result in a failure.
+ TODO(hork): add channel_args to this API to allow endpoints and transports
+ created in this function to participate in the resource quota feature. */
+GRPCAPI void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
+ grpc_server_credentials* creds);
#ifdef __cplusplus
}
diff --git a/grpc/include/grpc/grpc_security.h b/grpc/include/grpc/grpc_security.h
index b5dafe1b..a90904e7 100644
--- a/grpc/include/grpc/grpc_security.h
+++ b/grpc/include/grpc/grpc_security.h
@@ -131,17 +131,6 @@ typedef struct grpc_call_credentials grpc_call_credentials;
The creator of the credentials object is responsible for its release. */
GRPCAPI void grpc_call_credentials_release(grpc_call_credentials* creds);
-/** --- grpc_channel_credentials object. ---
-
- A channel credentials object represents a way to authenticate a client on a
- channel. */
-
-typedef struct grpc_channel_credentials grpc_channel_credentials;
-
-/** Releases a channel credentials object.
- The creator of the credentials object is responsible for its release. */
-GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
-
/** Creates default credentials to connect to a google gRPC service.
WARNING: Do NOT use this credentials to connect to a non-google service as
this could result in an oauth2 token leak. The security level of the
@@ -478,30 +467,6 @@ GRPCAPI grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
grpc_metadata_credentials_plugin plugin,
grpc_security_level min_security_level, void* reserved);
-/** --- Secure channel creation. --- */
-
-/** Creates a secure channel using the passed-in credentials. Additional
- channel level configuration MAY be provided by grpc_channel_args, though
- the expectation is that most clients will want to simply pass NULL. The
- user data in 'args' need only live through the invocation of this function.
- However, if any args of the 'pointer' type are passed, then the referenced
- vtable must be maintained by the caller until grpc_channel_destroy
- terminates. See grpc_channel_args definition for more on this. */
-GRPCAPI grpc_channel* grpc_secure_channel_create(
- grpc_channel_credentials* creds, const char* target,
- const grpc_channel_args* args, void* reserved);
-
-/** --- grpc_server_credentials object. ---
-
- A server credentials object represents a way to authenticate a server. */
-
-typedef struct grpc_server_credentials grpc_server_credentials;
-
-/** Releases a server_credentials object.
- The creator of the server_credentials object is responsible for its release.
- */
-GRPCAPI void grpc_server_credentials_release(grpc_server_credentials* creds);
-
/** Server certificate config object holds the server's public certificates and
associated private keys, as well as any CA certificates needed for client
certificate validation (if applicable). Create using
@@ -599,15 +564,6 @@ GRPCAPI grpc_server_credentials*
grpc_ssl_server_credentials_create_with_options(
grpc_ssl_server_credentials_options* options);
-/** --- Server-side secure ports. --- */
-
-/** Add a HTTP2 over an encrypted link over tcp listener.
- Returns bound port number on success, 0 on failure.
- REQUIRES: server not started */
-GRPCAPI int grpc_server_add_secure_http2_port(grpc_server* server,
- const char* addr,
- grpc_server_credentials* creds);
-
/** --- Call specific credentials. --- */
/** Sets a credentials to a call. Can only be called on the client side before
@@ -747,61 +703,62 @@ GRPCAPI grpc_server_credentials* grpc_local_server_credentials_create(
/** --- TLS channel/server credentials ---
* It is used for experimental purpose for now and subject to change. */
-/** Struct for indicating errors. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_error_details grpc_tls_error_details;
-
-/** Config for TLS server authorization check. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_server_authorization_check_config
- grpc_tls_server_authorization_check_config;
-
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that can be specified by callers to configure underlying TLS
- * behaviors. It is used for experimental purpose for now and subject to change.
+ * behaviors.
*/
typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct provides ways to gain credential data that will be used in the TLS
- * handshake. It is used for experimental purpose for now and subject to change.
+ * handshake.
*/
typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that stores the credential data presented to the peer in handshake
- * to show local identity. It is used for experimental purpose for now and
- * subject to change.
+ * to show local identity.
*/
typedef struct grpc_tls_identity_pairs grpc_tls_identity_pairs;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_identity_pairs that stores a list of identity credential
- * data, including identity private key and identity certificate chain. It is
- * used for experimental purpose for now and subject to change.
+ * data, including identity private key and identity certificate chain.
*/
GRPCAPI grpc_tls_identity_pairs* grpc_tls_identity_pairs_create();
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Adds a identity private key and a identity certificate chain to
* grpc_tls_identity_pairs. This function will make an internal copy of
- * |private_key| and |cert_chain|. It is used for experimental purpose for now
- * and subject to change.
+ * |private_key| and |cert_chain|.
*/
GRPCAPI void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs* pairs,
const char* private_key,
const char* cert_chain);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Destroys a grpc_tls_identity_pairs object. If this object is passed to a
* provider initiation function, the ownership is transferred so this function
* doesn't need to be called. Otherwise the creator of the
- * grpc_tls_identity_pairs object is responsible for its destruction. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_identity_pairs object is responsible for its destruction.
*/
GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will load credential data from
* static string during initialization. This provider will always return the
* same cert data for all cert names.
@@ -809,13 +766,14 @@ GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
* corresponding credential data is not needed.
* This function will make a copy of |root_certificate|.
* The ownership of |pem_key_cert_pairs| is transferred.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_static_data_create(
const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will watch the credential
* changes on the file system. This provider will always return the up-to-date
* cert data for all the cert names callers set through
@@ -833,7 +791,6 @@ grpc_tls_certificate_provider_static_data_create(
* - refresh_interval_sec is the refreshing interval that we will check the
* files for updates.
* It does not take ownership of parameters.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_file_watcher_create(
@@ -841,49 +798,34 @@ grpc_tls_certificate_provider_file_watcher_create(
const char* root_cert_path, unsigned int refresh_interval_sec);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Releases a grpc_tls_certificate_provider object. The creator of the
- * grpc_tls_certificate_provider object is responsible for its release. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_certificate_provider object is responsible for its release.
*/
GRPCAPI void grpc_tls_certificate_provider_release(
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates an grpc_tls_credentials_options.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_credentials_options* grpc_tls_credentials_options_create(void);
/**
- * Sets the options of whether to request and verify client certs. This should
- * be called only on the server side. It is used for experimental purpose for
- * now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
- grpc_tls_credentials_options* options,
- grpc_ssl_client_certificate_request_type type);
-
-/**
- * Sets the options of whether to choose certain checks, e.g. certificate check,
- * hostname check, etc. This should be called only on the client side. If
- * |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a
- * custom authorization check (grpc_tls_server_authorization_check_config) is
- * mandatory. It is used for experimental purpose for now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option);
-
-/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the credential provider in the options.
* The |options| will implicitly take a new ref to the |provider|.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
grpc_tls_credentials_options* options,
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the root certificates with
* name |root_cert_name|.
* If this is not set on the client side, we will use the root certificates
@@ -892,151 +834,306 @@ GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
* If this is not set on the server side, we will not watch any root certificate
* updates, and assume no root certificates needed for the server(single-side
* TLS). Default root certs on the server side is not supported.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_root_certs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the root certificates being watched.
* If not set, We will use a default empty string as the root certificate name.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_root_cert_name(
grpc_tls_credentials_options* options, const char* root_cert_name);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the identity key-cert pairs
* with name |identity_cert_name|.
* This is required on the server side, and optional on the client side.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the identity certificates being watched.
* If not set, We will use a default empty string as the identity certificate
- * name. It is used for experimental purpose for now and subject to change.
+ * name.
*/
GRPCAPI void grpc_tls_credentials_options_set_identity_cert_name(
grpc_tls_credentials_options* options, const char* identity_cert_name);
/**
- * Sets the configuration for a custom authorization check performed at the end
- * of the handshake. The |options| will implicitly take a new ref to the
- * |config|.
- * It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to request and/or verify client certs. This shall
+ * only be called on the server side.
*/
-GRPCAPI void grpc_tls_credentials_options_set_server_authorization_check_config(
+GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
grpc_tls_credentials_options* options,
- grpc_tls_server_authorization_check_config* config);
-
-/** --- TLS server authorization check config. ---
- * It is used for experimental purpose for now and subject to change. */
-
-typedef struct grpc_tls_server_authorization_check_arg
- grpc_tls_server_authorization_check_arg;
-
-/** callback function provided by gRPC used to handle the result of server
- authorization check. It is used when schedule API is implemented
- asynchronously, and serves to bring the control back to gRPC C core. It is
- used for experimental purpose for now and subject to change. */
-typedef void (*grpc_tls_on_server_authorization_check_done_cb)(
- grpc_tls_server_authorization_check_arg* arg);
-
-/** A struct containing all information necessary to schedule/cancel a server
- authorization check request.
- - cb and cb_user_data represent a gRPC-provided callback and an argument
- passed to it.
- - success will store the result of server authorization check. That is,
- if success returns a non-zero value, it means the authorization check
- passes and if returning zero, it means the check fails.
- - target_name is the name of an endpoint the channel is connecting to.
- - peer_cert represents a complete certificate chain including both
- signing and leaf certificates.
- - \a subject_alternative_names is an array of size
- \a subject_alternative_names_size consisting of pointers to strings.
- - status and error_details contain information
- about errors occurred when a server authorization check request is
- scheduled/cancelled.
- - config is a pointer to the unique
- grpc_tls_server_authorization_check_config instance that this argument
- corresponds to.
- - context is a pointer to a wrapped language implementation of this
- grpc_tls_server_authorization_check_arg instance.
- - destroy_context is a pointer to a caller-provided method that cleans
- up any data associated with the context pointer.
- It is used for experimental purpose for now and subject to change.
-*/
-struct grpc_tls_server_authorization_check_arg {
- grpc_tls_on_server_authorization_check_done_cb cb;
- void* cb_user_data;
- int success;
+ grpc_ssl_client_certificate_request_type type);
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * If set, gRPC will read all hashed x.509 CRL files in the directory and
+ * enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
+ * version > 1.1.
+ * It is used for experimental purpose for now and subject to change.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_crl_directory(
+ grpc_tls_credentials_options* options, const char* crl_directory);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to verify server certs on the client side.
+ * Passing in a non-zero value indicates verifying the certs.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_verify_server_cert(
+ grpc_tls_credentials_options* options, int verify_server_cert);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The read-only request information exposed in a verification call.
+ * Callers should not directly manage the ownership of it. We will make sure it
+ * is always available inside verify() or cancel() call, and will destroy the
+ * object at the end of custom verification.
+ */
+typedef struct grpc_tls_custom_verification_check_request {
+ /* The target name of the server when the client initiates the connection. */
+ /* This field will be nullptr if on the server side. */
const char* target_name;
- const char* peer_cert;
- const char* peer_cert_full_chain;
- char** subject_alternative_names;
- size_t subject_alternative_names_size;
- grpc_status_code status;
- grpc_tls_error_details* error_details;
- grpc_tls_server_authorization_check_config* config;
- void* context;
- void (*destroy_context)(void* ctx);
-};
-
-/** Create a grpc_tls_server_authorization_check_config instance.
- - config_user_data is config-specific, read-only user data
- that works for all channels created with a credential using the config.
- - schedule is a pointer to an application-provided callback used to invoke
- server authorization check API. The implementation of this method has to
- be non-blocking, but can be performed synchronously or asynchronously.
- 1)If processing occurs synchronously, it populates arg->result,
- arg->status, and arg->error_details and returns zero.
- 2) If processing occurs asynchronously, it returns a non-zero value. The
- application then invokes arg->cb when processing is completed. Note that
- arg->cb cannot be invoked before schedule API returns.
- - cancel is a pointer to an application-provided callback used to cancel a
- server authorization check request scheduled via an asynchronous schedule
- API. arg is used to pinpoint an exact check request to be cancelled. The
- operation may not have any effect if the request has already been
- processed.
- - destruct is a pointer to an application-provided callback used to clean up
- any data associated with the config.
- It is used for experimental purpose for now and subject to change.
-*/
-GRPCAPI grpc_tls_server_authorization_check_config*
-grpc_tls_server_authorization_check_config_create(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data));
+ /* The information contained in the certificate chain sent from the peer. */
+ struct peer_info {
+ /* The Common Name field on the peer leaf certificate. */
+ const char* common_name;
+ /* The list of Subject Alternative Names on the peer leaf certificate. */
+ struct san_names {
+ char** uri_names;
+ size_t uri_names_size;
+ char** dns_names;
+ size_t dns_names_size;
+ char** email_names;
+ size_t email_names_size;
+ char** ip_names;
+ size_t ip_names_size;
+ } san_names;
+ /* The raw peer leaf certificate. */
+ const char* peer_cert;
+ /* The raw peer certificate chain. Note that it is not always guaranteed to
+ * get the peer full chain. For more, please refer to
+ * GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME defined in file
+ * grpc_security_constants.h.
+ * TODO(ZhenLian): Consider fixing this in the future. */
+ const char* peer_cert_full_chain;
+ } peer_info;
+} grpc_tls_custom_verification_check_request;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A callback function provided by gRPC as a parameter of the |verify| function
+ * in grpc_tls_certificate_verifier_external. If |verify| is expected to be run
+ * asynchronously, the implementer of |verify| will need to invoke this callback
+ * with |callback_arg| and proper verification status at the end to bring the
+ * control back to gRPC C core.
+ */
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The internal verifier type that will be used inside core.
+ */
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A struct containing all the necessary functions a custom external verifier
+ * needs to implement to be able to be converted to an internal verifier.
+ */
+typedef struct grpc_tls_certificate_verifier_external {
+ void* user_data;
+ /**
+ * A function pointer containing the verification logic that will be
+ * performed after the TLS handshake is done. It could be processed
+ * synchronously or asynchronously.
+ * - If expected to be processed synchronously, the implementer should
+ * populate the verification result through |sync_status| and
+ * |sync_error_details|, and then return true.
+ * - If expected to be processed asynchronously, the implementer should return
+ * false immediately, and then in the asynchronous thread invoke |callback|
+ * with the verification result. The implementer MUST NOT invoke the async
+ * |callback| in the same thread before |verify| returns, otherwise it can
+ * lead to deadlocks.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer.
+ * callback: the callback that the function implementer needs to invoke, if
+ * return a non-zero value. It is usually invoked when the
+ * asynchronous verification is done, and serves to bring the
+ * control back to gRPC.
+ * callback_arg: A pointer to the internal ExternalVerifier instance. This is
+ * mainly used as an argument in |callback|, if want to invoke
+ * |callback| in async mode.
+ * sync_status: indicates if a connection should be allowed. This should only
+ * be used if the verification check is done synchronously.
+ * sync_error_details: the error generated while verifying a connection. This
+ * should only be used if the verification check is done
+ * synchronously. the implementation must allocate the
+ * error string via gpr_malloc() or gpr_strdup().
+ * return: return 0 if |verify| is expected to be executed asynchronously,
+ * otherwise return a non-zero value.
+ */
+ int (*verify)(void* user_data,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+ /**
+ * A function pointer that cleans up the caller-specified resources when the
+ * verifier is still running but the whole connection got cancelled. This
+ * could happen when the verifier is doing some async operations, and the
+ * whole handshaker object got destroyed because of connection time limit is
+ * reached, or any other reasons. In such cases, function implementers might
+ * want to be notified, and properly clean up some resources.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer. It will
+ * be the same request object that was passed to verify(), and it
+ * tells the cancel() which request to cancel.
+ */
+ void (*cancel)(void* user_data,
+ grpc_tls_custom_verification_check_request* request);
+ /**
+ * A function pointer that does some additional destruction work when the
+ * verifier is destroyed. This is used when the caller wants to associate some
+ * objects to the lifetime of external_verifier, and destroy them when
+ * external_verifier got destructed. For example, in C++, the class containing
+ * user-specified callback functions should not be destroyed before
+ * external_verifier, since external_verifier will invoke them while being
+ * used.
+ * Note that the caller MUST delete the grpc_tls_certificate_verifier_external
+ * object itself in this function, otherwise it will cause memory leaks. That
+ * also means the user_data has to carries at least a self pointer, for the
+ * callers to later delete it in destruct().
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ */
+ void (*destruct)(void* user_data);
+} grpc_tls_certificate_verifier_external;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Converts an external verifier to an internal verifier.
+ * Note that we will not take the ownership of the external_verifier. Callers
+ * will need to delete external_verifier in its own destruct function.
+ */
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Factory function for an internal verifier that will do the default hostname
+ * check.
+ */
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_host_name_create();
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Releases a grpc_tls_certificate_verifier object. The creator of the
+ * grpc_tls_certificate_verifier object is responsible for its release.
+ */
+void grpc_tls_certificate_verifier_release(
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the verifier in options. The |options| will implicitly take a new ref to
+ * the |verifier|. If not set on the client side, we will verify server's
+ * certificates, and check the default hostname. If not set on the server side,
+ * we will verify client's certificates.
+ */
+void grpc_tls_credentials_options_set_certificate_verifier(
+ grpc_tls_credentials_options* options,
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to check the hostname of the peer on a per-call
+ * basis. This is usually used in a combination with virtual hosting at the
+ * client side, where each individual call on a channel can have a different
+ * host associated with it.
+ * This check is intended to verify that the host specified for the individual
+ * call is covered by the cert that the peer presented.
+ * The default is a non-zero value, which indicates performing such checks.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_check_call_host(
+ grpc_tls_credentials_options* options, int check_call_host);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the verification logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
+ * If |grpc_tls_certificate_verifier_verify| returns true, inspect the
+ * verification result through request->status and request->error_details.
+ * Otherwise, inspect through the parameter of |callback|.
+ */
+int grpc_tls_certificate_verifier_verify(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details);
/**
- * Releases a grpc_tls_server_authorization_check_config object. The creator of
- * the grpc_tls_server_authorization_check_config object is responsible for its
- * release. It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the cancellation logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
*/
-GRPCAPI void grpc_tls_server_authorization_check_config_release(
- grpc_tls_server_authorization_check_config* config);
+void grpc_tls_certificate_verifier_cancel(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS channel credential object based on the
* grpc_tls_credentials_options specified by callers. The
* grpc_channel_credentials will take the ownership of the |options|. The
- * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY. It
- * is used for experimental purpose for now and subject to change.
+ * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.
*/
grpc_channel_credentials* grpc_tls_credentials_create(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS server credential object based on the
* grpc_tls_credentials_options specified by callers. The
- * grpc_server_credentials will take the ownership of the |options|. It
- * is used for experimental purpose for now and subject to change.
+ * grpc_server_credentials will take the ownership of the |options|.
*/
grpc_server_credentials* grpc_tls_server_credentials_create(
grpc_tls_credentials_options* options);
@@ -1046,14 +1143,14 @@ grpc_server_credentials* grpc_tls_server_credentials_create(
*
* This method creates an insecure channel credentials object.
*/
-grpc_channel_credentials* grpc_insecure_credentials_create();
+GRPCAPI grpc_channel_credentials* grpc_insecure_credentials_create();
/**
* EXPERIMENTAL API - Subject to change
*
* This method creates an insecure server credentials object.
*/
-grpc_server_credentials* grpc_insecure_server_credentials_create();
+GRPCAPI grpc_server_credentials* grpc_insecure_server_credentials_create();
/**
* EXPERIMENTAL API - Subject to change
@@ -1085,6 +1182,76 @@ GRPCAPI grpc_channel_credentials* grpc_xds_credentials_create(
GRPCAPI grpc_server_credentials* grpc_xds_server_credentials_create(
grpc_server_credentials* fallback_credentials);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * An opaque type that is responsible for providing authorization policies to
+ * gRPC.
+ */
+typedef struct grpc_authorization_policy_provider
+ grpc_authorization_policy_provider;
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider using gRPC authorization policy
+ * from static string.
+ * - authz_policy is the input gRPC authorization policy.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_static_data_create(
+ const char* authz_policy, grpc_status_code* code,
+ const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider by watching for gRPC
+ * authorization policy changes in filesystem.
+ * - authz_policy is the file path of gRPC authorization policy.
+ * - refresh_interval_sec is the amount of time the internal thread would wait
+ * before checking for file updates.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_file_watcher_create(
+ const char* authz_policy_path, unsigned int refresh_interval_sec,
+ grpc_status_code* code, const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Releases grpc_authorization_policy_provider object. The creator of
+ * grpc_authorization_policy_provider is responsible for its release.
+ */
+GRPCAPI void grpc_authorization_policy_provider_release(
+ grpc_authorization_policy_provider* provider);
+
+/** --- TLS session key logging. ---
+ * Experimental API to control tls session key logging. Tls session key logging
+ * is expected to be used only for debugging purposes and never in production.
+ * Tls session key logging is only enabled when:
+ * At least one grpc_tls_credentials_options object is assigned a tls session
+ * key logging file path using the API specified below.
+ */
+
+/**
+ * EXPERIMENTAL API - Subject to change.
+ * Configures a grpc_tls_credentials_options object with tls session key
+ * logging capability. TLS channels using these credentials have tls session
+ * key logging enabled.
+ * - options is the grpc_tls_credentials_options object
+ * - path is a string pointing to the location where TLS session keys would be
+ * stored.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_tls_session_key_log_file_path(
+ grpc_tls_credentials_options* options, const char* path);
+
#ifdef __cplusplus
}
#endif
diff --git a/grpc/include/grpc/grpc_security_constants.h b/grpc/include/grpc/grpc_security_constants.h
index 4d7f0788..505037ed 100644
--- a/grpc/include/grpc/grpc_security_constants.h
+++ b/grpc/include/grpc/grpc_security_constants.h
@@ -25,8 +25,10 @@ extern "C" {
#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME "transport_security_type"
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE "ssl"
+#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
#define GRPC_X509_CN_PROPERTY_NAME "x509_common_name"
+#define GRPC_X509_SUBJECT_PROPERTY_NAME "x509_subject"
#define GRPC_X509_SAN_PROPERTY_NAME "x509_subject_alternative_name"
#define GRPC_X509_PEM_CERT_PROPERTY_NAME "x509_pem_cert"
// Please note that internally, we just faithfully pass whatever value we got by
@@ -45,6 +47,7 @@ extern "C" {
#define GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME "security_level"
#define GRPC_PEER_DNS_PROPERTY_NAME "peer_dns"
#define GRPC_PEER_SPIFFE_ID_PROPERTY_NAME "peer_spiffe_id"
+#define GRPC_PEER_URI_PROPERTY_NAME "peer_uri"
#define GRPC_PEER_EMAIL_PROPERTY_NAME "peer_email"
#define GRPC_PEER_IP_PROPERTY_NAME "peer_ip"
@@ -133,20 +136,6 @@ typedef enum {
GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY,
} grpc_security_level;
-typedef enum {
- /** Default option: performs server certificate verification and hostname
- verification. */
- GRPC_TLS_SERVER_VERIFICATION,
- /** Performs server certificate verification, but skips hostname verification
- Client is responsible for verifying server's identity via
- server authorization check callback. */
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION,
- /** Skips both server certificate and hostname verification.
- Client is responsible for verifying server's identity and
- server's certificate via server authorization check callback. */
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION
-} grpc_tls_server_verification_option;
-
/**
* Type of local connections for which local channel/server credentials will be
* applied. It supports UDS and local TCP connections.
diff --git a/grpc/include/grpc/impl/codegen/atm.h b/grpc/include/grpc/impl/codegen/atm.h
index 00d83f06..606369a2 100644
--- a/grpc/include/grpc/impl/codegen/atm.h
+++ b/grpc/include/grpc/impl/codegen/atm.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_H
#define GRPC_IMPL_CODEGEN_ATM_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** This interface provides atomic operations and barriers.
It is internal to gpr support code and should not be used outside it.
@@ -70,11 +72,11 @@
#include <grpc/impl/codegen/port_platform.h>
#if defined(GPR_GCC_ATOMIC)
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#elif defined(GPR_GCC_SYNC)
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS_ATOMIC)
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#else
#error could not determine platform for atm
#endif
diff --git a/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h b/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
index 58797085..05d6e42c 100644
--- a/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
+++ b/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* atm_platform.h for gcc and gcc-like compilers with the
__atomic_* interface. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/include/grpc/impl/codegen/atm_gcc_sync.h b/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
index 728c3d54..bdc7a172 100644
--- a/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
+++ b/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* variant of atm_platform.h for gcc and gcc-like compiers with __sync_*
interface */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/include/grpc/impl/codegen/atm_windows.h b/grpc/include/grpc/impl/codegen/atm_windows.h
index 36c76ab6..816c9a9c 100644
--- a/grpc/include/grpc/impl/codegen/atm_windows.h
+++ b/grpc/include/grpc/impl/codegen/atm_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
#define GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** Win32 variant of atm_platform.h */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/include/grpc/impl/codegen/byte_buffer.h b/grpc/include/grpc/impl/codegen/byte_buffer.h
index 04137292..eeec56c1 100644
--- a/grpc/include/grpc/impl/codegen/byte_buffer.h
+++ b/grpc/include/grpc/impl/codegen/byte_buffer.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
+// IWYU pragma: private, include <grpc/byte_buffer.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/include/grpc/impl/codegen/byte_buffer_reader.h b/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
index e06e1955..35b8ee70 100644
--- a/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
+++ b/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
+// IWYU pragma: private, include <grpc/byte_buffer_reader.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/include/grpc/impl/codegen/compression_types.h b/grpc/include/grpc/impl/codegen/compression_types.h
index f778b005..35f49075 100644
--- a/grpc/include/grpc/impl/codegen/compression_types.h
+++ b/grpc/include/grpc/impl/codegen/compression_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
@@ -58,8 +60,6 @@ typedef enum {
GRPC_COMPRESS_NONE = 0,
GRPC_COMPRESS_DEFLATE,
GRPC_COMPRESS_GZIP,
- /* EXPERIMENTAL: Stream compression is currently experimental. */
- GRPC_COMPRESS_STREAM_GZIP,
/* TODO(ctiller): snappy */
GRPC_COMPRESS_ALGORITHMS_COUNT
} grpc_compression_algorithm;
diff --git a/grpc/include/grpc/impl/codegen/connectivity_state.h b/grpc/include/grpc/impl/codegen/connectivity_state.h
index b70dbef3..52084da4 100644
--- a/grpc/include/grpc/impl/codegen/connectivity_state.h
+++ b/grpc/include/grpc/impl/codegen/connectivity_state.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
#define GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
+// IWYU pragma: private
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/include/grpc/impl/codegen/fork.h b/grpc/include/grpc/impl/codegen/fork.h
index 555df349..6818b530 100644
--- a/grpc/include/grpc/impl/codegen/fork.h
+++ b/grpc/include/grpc/impl/codegen/fork.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_FORK_H
#define GRPC_IMPL_CODEGEN_FORK_H
+// IWYU pragma: private, include <grpc/fork.h>
+
/**
* gRPC applications should call this before calling fork(). There should be no
* active gRPC function calls between calling grpc_prefork() and
diff --git a/grpc/include/grpc/impl/codegen/gpr_slice.h b/grpc/include/grpc/impl/codegen/gpr_slice.h
index 89fa72d5..8782ba3f 100644
--- a/grpc/include/grpc/impl/codegen/gpr_slice.h
+++ b/grpc/include/grpc/impl/codegen/gpr_slice.h
@@ -18,6 +18,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_SLICE_H
#define GRPC_IMPL_CODEGEN_GPR_SLICE_H
+// IWYU pragma: private
+
/** WARNING: Please do not use this header. This was added as a temporary
* measure to not break some of the external projects that depend on
* gpr_slice_* functions. We are actively working on moving all the
diff --git a/grpc/include/grpc/impl/codegen/gpr_types.h b/grpc/include/grpc/impl/codegen/gpr_types.h
index 6daf3398..415bf7a9 100644
--- a/grpc/include/grpc/impl/codegen/gpr_types.h
+++ b/grpc/include/grpc/impl/codegen/gpr_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_TYPES_H
#define GRPC_IMPL_CODEGEN_GPR_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
diff --git a/grpc/include/grpc/impl/codegen/grpc_types.h b/grpc/include/grpc/impl/codegen/grpc_types.h
index 9cf6d837..074bf7ee 100644
--- a/grpc/include/grpc/impl/codegen/grpc_types.h
+++ b/grpc/include/grpc/impl/codegen/grpc_types.h
@@ -19,15 +19,17 @@
#ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H
#define GRPC_IMPL_CODEGEN_GRPC_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
+#include <stddef.h>
+
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/impl/codegen/slice.h>
#include <grpc/impl/codegen/status.h>
-#include <stddef.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -55,9 +57,6 @@ typedef struct grpc_byte_buffer {
* asynchronous actions. */
typedef struct grpc_completion_queue grpc_completion_queue;
-/** An alarm associated with a completion queue. */
-typedef struct grpc_alarm grpc_alarm;
-
/** The Channel interface allows creation of Call objects. */
typedef struct grpc_channel grpc_channel;
@@ -220,7 +219,7 @@ typedef struct {
"grpc.http2.min_ping_interval_without_data_ms"
/** Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
-/** How many pings can we send before needing to send a
+/** How many pings can the client send before needing to send a
data/header frame? (0 indicates that an infinite number of
pings can be sent without sending a data frame or header frame) */
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \
@@ -242,8 +241,8 @@ typedef struct {
not receive the ping ack, it will close the transport. Int valued,
milliseconds. */
#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS "grpc.keepalive_timeout_ms"
-/** Is it permissible to send keepalive pings without any outstanding streams.
- Int valued, 0(false)/1(true). */
+/** Is it permissible to send keepalive pings from the client without any
+ outstanding streams. Int valued, 0(false)/1(true). */
#define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \
"grpc.keepalive_permit_without_calls"
/** Default authority to pass if none specified on call construction. A string.
@@ -311,6 +310,14 @@ typedef struct {
#define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator"
/** The grpc_socket_factory instance to create and bind sockets. A pointer. */
#define GRPC_ARG_SOCKET_FACTORY "grpc.socket_factory"
+/** Gzip compression level. Used only if gzip message compression is used.
+ The value must be in the range 0 to 9. If not specified, the gzip default
+ will be used. */
+#define GRPC_ARG_GZIP_COMPRESSION_LEVEL "grpc.gzip_compression_level"
+/** The minimum message size in bytes for a message to be compressed.
+ If not specified, messages will be compressed regardless of size. */
+#define GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS \
+ "grpc.gprc_min_message_size_to_compress"
/** The maximum amount of memory used by trace events per channel trace node.
* Once the maximum is reached, subsequent events will evict the oldest events
* from the buffer. The unit for this knob is bytes. Setting it to zero causes
@@ -384,12 +391,25 @@ typedef struct {
Defaults to "blend". In the current implementation "blend" is equivalent to
"latency". */
#define GRPC_ARG_OPTIMIZATION_TARGET "grpc.optimization_target"
-/** If set to zero, disables retry behavior. Otherwise, transparent retries
- are enabled for all RPCs, and configurable retries are enabled when they
- are configured via the service config. For details, see:
+/** Enables retry functionality. Defaults to true. When enabled,
+ transparent retries will be performed as appropriate, and configurable
+ retries are enabled when they are configured via the service config.
+ For details, see:
https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ NOTE: Hedging functionality is not yet implemented, so those
+ fields in the service config will currently be ignored. See
+ also the GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING arg below.
*/
#define GRPC_ARG_ENABLE_RETRIES "grpc.enable_retries"
+/** Enables hedging functionality, as described in:
+ https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ Default is currently false, since this functionality is not yet
+ fully implemented.
+ NOTE: This channel arg is experimental and will eventually be removed.
+ Once hedging functionality has been implemented and proves stable,
+ this arg will be removed, and the hedging functionality will
+ be enabled via the GRPC_ARG_ENABLE_RETRIES arg above. */
+#define GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING "grpc.experimental.enable_hedging"
/** Per-RPC retry buffer size, in bytes. Default is 256 KiB. */
#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size"
/** Channel arg that carries the bridged objective c object for custom metrics
@@ -409,10 +429,14 @@ typedef struct {
/** If set, inhibits health checking (which may be enabled via the
* service config.) */
#define GRPC_ARG_INHIBIT_HEALTH_CHECKING "grpc.inhibit_health_checking"
-/** If set, the channel's resolver is allowed to query for SRV records.
- * For example, this is useful as a way to enable the "grpclb"
- * load balancing policy. Note that this only works with the "ares"
- * DNS resolver, and isn't supported by the "native" DNS resolver. */
+/** If enabled, the channel's DNS resolver queries for SRV records.
+ * This is useful only when using the "grpclb" load balancing policy,
+ * as described in the following documents:
+ * https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md
+ * https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md
+ * https://github.com/grpc/proposal/blob/master/A26-grpclb-selection.md
+ * Note that this works only with the "ares" DNS resolver; it isn't supported
+ * by the "native" DNS resolver. */
#define GRPC_ARG_DNS_ENABLE_SRV_QUERIES "grpc.dns_enable_srv_queries"
/** If set, determines an upper bound on the number of milliseconds that the
* c-ares based DNS resolver will wait on queries before cancelling them.
@@ -428,6 +452,16 @@ typedef struct {
#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain"
/** gRPC Objective-C channel pooling id. */
#define GRPC_ARG_CHANNEL_ID "grpc.channel_id"
+/** Channel argument for grpc_authorization_policy_provider. If present, enables
+ gRPC authorization check. */
+#define GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER \
+ "grpc.authorization_policy_provider"
+/** EXPERIMENTAL. Updates to a server's configuration from a config fetcher (for
+ * example, listener updates from xDS) cause all older connections to be
+ * gracefully shut down (i.e., "drained") with a grace period configured by this
+ * channel arg. Int valued, milliseconds. Defaults to 10 minutes.*/
+#define GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS \
+ "grpc.experimental.server_config_change_drain_grace_time_ms"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
@@ -491,12 +525,9 @@ typedef enum grpc_call_error {
(GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_THROUGH)
/** Initial metadata flags */
-/** Signal that the call is idempotent */
-#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u)
+/** These flags are to be passed to the `grpc_op::flags` field */
/** Signal that the call should not return UNAVAILABLE before it has started */
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u)
-/** Signal that the call is cacheable. GRPC is free to use GET verb */
-#define GRPC_INITIAL_METADATA_CACHEABLE_REQUEST (0x00000040u)
/** Signal that GRPC_INITIAL_METADATA_WAIT_FOR_READY was explicitly set
by the calling application. */
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u)
@@ -504,12 +535,10 @@ typedef enum grpc_call_error {
#define GRPC_INITIAL_METADATA_CORKED (0x00000100u)
/** Mask of all valid flags */
-#define GRPC_INITIAL_METADATA_USED_MASK \
- (GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \
- GRPC_INITIAL_METADATA_WAIT_FOR_READY | \
- GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
- GRPC_INITIAL_METADATA_CORKED | GRPC_WRITE_THROUGH)
+#define GRPC_INITIAL_METADATA_USED_MASK \
+ (GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY | GRPC_INITIAL_METADATA_CORKED | \
+ GRPC_WRITE_THROUGH)
/** A single metadata element */
typedef struct grpc_metadata {
@@ -518,8 +547,6 @@ typedef struct grpc_metadata {
grpc_slice key;
grpc_slice value;
- uint32_t flags;
-
/** The following fields are reserved for grpc internal use.
There is no need to initialize them, and they will be set to garbage
during calls to grpc. */
@@ -742,21 +769,20 @@ typedef enum {
/** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK,
- /** EXPERIMENTAL: Events trigger a callback specified as the tag */
+ /** Events trigger a callback specified as the tag */
GRPC_CQ_CALLBACK
} grpc_cq_completion_type;
-/** EXPERIMENTAL: Specifies an interface class to be used as a tag
- for callback-based completion queues. This can be used directly,
- as the first element of a struct in C, or as a base class in C++.
- Its "run" value should be assigned to some non-member function, such as
- a static method. */
-typedef struct grpc_experimental_completion_queue_functor {
+/** Specifies an interface class to be used as a tag for callback-based
+ * completion queues. This can be used directly, as the first element of a
+ * struct in C, or as a base class in C++. Its "run" value should be assigned to
+ * some non-member function, such as a static method. */
+typedef struct grpc_completion_queue_functor {
/** The run member specifies a function that will be called when this
tag is extracted from the completion queue. Its arguments will be a
pointer to this functor and a boolean that indicates whether the
operation succeeded (non-zero) or failed (zero) */
- void (*functor_run)(struct grpc_experimental_completion_queue_functor*, int);
+ void (*functor_run)(struct grpc_completion_queue_functor*, int);
/** The inlineable member specifies whether this functor can be run inline.
This should only be used for trivial internally-defined functors. */
@@ -764,10 +790,8 @@ typedef struct grpc_experimental_completion_queue_functor {
/** The following fields are not API. They are meant for internal use. */
int internal_success;
- struct grpc_experimental_completion_queue_functor* internal_next;
-} grpc_experimental_completion_queue_functor;
-
-/* The upgrade to version 2 is currently experimental. */
+ struct grpc_completion_queue_functor* internal_next;
+} grpc_completion_queue_functor;
#define GRPC_CQ_CURRENT_VERSION 2
#define GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE 2
@@ -782,10 +806,10 @@ typedef struct grpc_completion_queue_attributes {
/* END OF VERSION 1 CQ ATTRIBUTES */
- /* EXPERIMENTAL: START OF VERSION 2 CQ ATTRIBUTES */
+ /* START OF VERSION 2 CQ ATTRIBUTES */
/** When creating a callbackable CQ, pass in a functor to get invoked when
* shutdown is complete */
- grpc_experimental_completion_queue_functor* cq_shutdown_cb;
+ grpc_completion_queue_functor* cq_shutdown_cb;
/* END OF VERSION 2 CQ ATTRIBUTES */
} grpc_completion_queue_attributes;
diff --git a/grpc/include/grpc/impl/codegen/log.h b/grpc/include/grpc/impl/codegen/log.h
index 9dd3a518..1d5d2da2 100644
--- a/grpc/include/grpc/impl/codegen/log.h
+++ b/grpc/include/grpc/impl/codegen/log.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H
+// IWYU pragma: private, include <grpc/support/log.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stdarg.h>
diff --git a/grpc/include/grpc/impl/codegen/port_platform.h b/grpc/include/grpc/impl/codegen/port_platform.h
index 387639bf..3227f511 100644
--- a/grpc/include/grpc/impl/codegen/port_platform.h
+++ b/grpc/include/grpc/impl/codegen/port_platform.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
#define GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
+// IWYU pragma: private, include <grpc/support/port_platform.h>
+
/*
* Define GPR_BACKWARDS_COMPATIBILITY_MODE to try harder to be ABI
* compatible with older platforms (currently only on Linux)
@@ -27,6 +29,13 @@
* - some syscalls to be made directly
*/
+// [[deprecated]] attribute is only available since C++14
+#if __cplusplus >= 201402L
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif // __cplusplus >= 201402L
+
/*
* Defines GPR_ABSEIL_SYNC to use synchronization features from Abseil
*/
@@ -42,7 +51,9 @@
/*
* Defines GRPC_ERROR_IS_ABSEIL_STATUS to use absl::Status for grpc_error_handle
*/
+#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
// #define GRPC_ERROR_IS_ABSEIL_STATUS 1
+#endif
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
@@ -114,10 +125,16 @@
#else
#define GPR_WINDOWS_ATOMIC 1
#endif
-#define GPR_STDCPP_TLS 1
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_PLATFORM_STRING "android"
#define GPR_ANDROID 1
+#ifndef __ANDROID_API__
+#error "__ANDROID_API__ must be defined for Android builds."
+#endif
+#if __ANDROID_API__ < 21
+#error "Requires Android API v21 and above"
+#endif
+#define GPR_SUPPORT_BINDER_TRANSPORT 1
// TODO(apolcyn): re-evaluate support for c-ares
// on android after upgrading our c-ares dependency.
// See https://github.com/grpc/grpc/issues/18038.
@@ -129,7 +146,6 @@
#endif /* _LP64 */
#define GPR_CPU_POSIX 1
#define GPR_GCC_SYNC 1
-#define GPR_STDCPP_TLS 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
#define GPR_POSIX_STAT 1
@@ -155,7 +171,6 @@
#include <features.h>
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_STDCPP_TLS 1
#define GPR_LINUX 1
#define GPR_LINUX_LOG
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
@@ -175,7 +190,14 @@
#endif /* _LP64 */
#ifdef __GLIBC__
#define GPR_POSIX_CRASH_HANDLER 1
+#ifdef __GLIBC_PREREQ
+#if __GLIBC_PREREQ(2, 12)
+#define GPR_LINUX_PTHREAD_NAME 1
+#endif
+#else
+// musl libc & others
#define GPR_LINUX_PTHREAD_NAME 1
+#endif
#include <linux/version.h>
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
@@ -183,7 +205,6 @@
#elif defined(__ASYLO__)
#define GPR_ARCH_64 1
#define GPR_CPU_POSIX 1
-#define GPR_GCC_TLS 1
#define GPR_PLATFORM_STRING "asylo"
#define GPR_GCC_SYNC 1
#define GPR_POSIX_SYNC 1
@@ -217,12 +238,7 @@
#define GPR_CPU_POSIX 1
#define GPR_POSIX_CRASH_HANDLER 1
#endif
-#ifdef __has_feature
-#if __has_feature(cxx_thread_local)
-#define GPR_STDCPP_TLS 1
-#endif
-#endif
-#ifndef GPR_STDCPP_TLS
+#if !(defined(__has_feature) && __has_feature(cxx_thread_local))
#define GPR_PTHREAD_TLS 1
#endif
#define GPR_APPLE 1
@@ -253,7 +269,6 @@
#define GPR_FREEBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -278,7 +293,6 @@
#define GPR_OPENBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -300,7 +314,6 @@
#define GPR_SOLARIS 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -324,7 +337,6 @@
#define GPR_AIX 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -354,7 +366,6 @@
#define GPR_NACL 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -381,7 +392,6 @@
#define GPR_MUSL_LIBC_COMPAT 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_PTHREAD_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_ENV 1
@@ -498,12 +508,6 @@ typedef unsigned __int64 uint64_t;
#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
#endif
-#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
- defined(GPR_STDCPP_TLS) + defined(GPR_CUSTOM_TLS) != \
- 1
-#error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_STDCPP_TLS, GPR_CUSTOM_TLS
-#endif
-
/* maximum alignment needed for any type on this platform, rounded up to a
power of two */
#define GPR_MAX_ALIGNMENT 16
@@ -566,6 +570,14 @@ typedef unsigned __int64 uint64_t;
#define CENSUSAPI GRPCAPI
#endif
+#ifndef GPR_HAS_CPP_ATTRIBUTE
+#ifdef __has_cpp_attribute
+#define GPR_HAS_CPP_ATTRIBUTE(a) __has_cpp_attribute(a)
+#else
+#define GPR_HAS_CPP_ATTRIBUTE(a) 0
+#endif
+#endif /* GPR_HAS_CPP_ATTRIBUTE */
+
#ifndef GPR_HAS_ATTRIBUTE
#ifdef __has_attribute
#define GPR_HAS_ATTRIBUTE(a) __has_attribute(a)
@@ -591,6 +603,22 @@ typedef unsigned __int64 uint64_t;
#endif
#endif /* GPR_ATTRIBUTE_NOINLINE */
+#ifndef GPR_NO_UNIQUE_ADDRESS
+#if GPR_HAS_CPP_ATTRIBUTE(no_unique_address)
+#define GPR_NO_UNIQUE_ADDRESS [[no_unique_address]]
+#else
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif /* GPR_NO_UNIQUE_ADDRESS */
+
+#ifndef GRPC_DEPRECATED
+#if GPR_HAS_CPP_ATTRIBUTE(deprecated)
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif
+#endif /* GRPC_DEPRECATED */
+
#ifndef GPR_ATTRIBUTE_WEAK
/* Attribute weak is broken on LLVM/windows:
* https://bugs.llvm.org/show_bug.cgi?id=37598 */
@@ -664,4 +692,32 @@ typedef unsigned __int64 uint64_t;
#define __STDC_FORMAT_MACROS
#endif
+/* Selectively enable EventEngine on specific platforms. This default can be
+ * overridden using the GRPC_USE_EVENT_ENGINE compiler flag.
+ */
+#ifndef GRPC_USE_EVENT_ENGINE
+/* Not enabled by default on any platforms yet. (2021.06) */
+#elif GRPC_USE_EVENT_ENGINE == 0
+/* Building with `-DGRPC_USE_EVENT_ENGINE=0` will override the default. */
+#undef GRPC_USE_EVENT_ENGINE
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#undef GPR_SUPPORT_CHANNELS_FROM_FD
+#define GRPC_ARES 0
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#define GRPC_CALLBACK_API_NONEXPERIMENTAL
+
+/* clang 11 with msan miscompiles destruction of [[no_unique_address]] members
+ * of zero size - for a repro see:
+ * test/core/compiler_bugs/miscompile_with_no_unique_address_test.cc
+ */
+#ifdef __clang__
+#if __clang__ && __clang_major__ <= 11 && __has_feature(memory_sanitizer)
+#undef GPR_NO_UNIQUE_ADDRESS
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif
+
#endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */
diff --git a/grpc/include/grpc/impl/codegen/propagation_bits.h b/grpc/include/grpc/impl/codegen/propagation_bits.h
index 824bdbd8..d7020998 100644
--- a/grpc/include/grpc/impl/codegen/propagation_bits.h
+++ b/grpc/include/grpc/impl/codegen/propagation_bits.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
#define GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
diff --git a/grpc/include/grpc/impl/codegen/slice.h b/grpc/include/grpc/impl/codegen/slice.h
index 3567b1e8..130e5eff 100644
--- a/grpc/include/grpc/impl/codegen/slice.h
+++ b/grpc/include/grpc/impl/codegen/slice.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SLICE_H
#define GRPC_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpc/slice.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
@@ -56,7 +58,10 @@ struct grpc_slice_refcount;
Multiple grpc_slice values may share a ref count.
If the slice does not have a refcount, it represents an inlined small piece
- of data that is copied by value. */
+ of data that is copied by value.
+
+ As a special case, a slice can be given refcount == uintptr_t(1), meaning
+ that the slice represents external data that is not refcounted. */
struct grpc_slice {
struct grpc_slice_refcount* refcount;
union grpc_slice_data {
diff --git a/grpc/include/grpc/impl/codegen/status.h b/grpc/include/grpc/impl/codegen/status.h
index dec3b8f3..2b18f6d9 100644
--- a/grpc/include/grpc/impl/codegen/status.h
+++ b/grpc/include/grpc/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_STATUS_H
#define GRPC_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpc/status.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/include/grpc/impl/codegen/sync.h b/grpc/include/grpc/impl/codegen/sync.h
index 49e31947..1b30ea75 100644
--- a/grpc/include/grpc/impl/codegen/sync.h
+++ b/grpc/include/grpc/impl/codegen/sync.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_H
#define GRPC_IMPL_CODEGEN_SYNC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/** Synchronization primitives for GPR.
The type gpr_mu provides a non-reentrant mutex (lock).
@@ -44,16 +47,16 @@ extern "C" {
/* Platform-specific type declarations of gpr_mu and gpr_cv. */
#include <grpc/impl/codegen/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#if defined(GPR_CUSTOM_SYNC)
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#elif defined(GPR_ABSEIL_SYNC)
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#elif defined(GPR_POSIX_SYNC)
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS)
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#else
#error Unable to determine platform for sync
#endif
diff --git a/grpc/include/grpc/impl/codegen/sync_abseil.h b/grpc/include/grpc/impl/codegen/sync_abseil.h
index 38dfab32..92b31697 100644
--- a/grpc/include/grpc/impl/codegen/sync_abseil.h
+++ b/grpc/include/grpc/impl/codegen/sync_abseil.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
#define GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/grpc/include/grpc/impl/codegen/sync_custom.h b/grpc/include/grpc/impl/codegen/sync_custom.h
index 69b1bf6c..ec0d6728 100644
--- a/grpc/include/grpc/impl/codegen/sync_custom.h
+++ b/grpc/include/grpc/impl/codegen/sync_custom.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
#define GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/grpc/include/grpc/impl/codegen/sync_generic.h b/grpc/include/grpc/impl/codegen/sync_generic.h
index eabdc513..a79b9c64 100644
--- a/grpc/include/grpc/impl/codegen/sync_generic.h
+++ b/grpc/include/grpc/impl/codegen/sync_generic.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
#define GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/* Generic type definitions for gpr_sync. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/include/grpc/impl/codegen/sync_posix.h b/grpc/include/grpc/impl/codegen/sync_posix.h
index 2aec3a3f..f5cf482c 100644
--- a/grpc/include/grpc/impl/codegen/sync_posix.h
+++ b/grpc/include/grpc/impl/codegen/sync_posix.h
@@ -19,12 +19,14 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_POSIX_H
#define GRPC_IMPL_CODEGEN_SYNC_POSIX_H
-#include <grpc/impl/codegen/port_platform.h>
+// IWYU pragma: private, include <grpc/support/sync.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/port_platform.h>
#include <pthread.h>
+#include <grpc/impl/codegen/sync_generic.h>
+
#ifdef GRPC_ASAN_ENABLED
/* The member |leak_checker| is used to check whether there is a memory leak
* caused by upper layer logic that's missing the |gpr_xx_destroy| call
diff --git a/grpc/include/grpc/impl/codegen/sync_windows.h b/grpc/include/grpc/impl/codegen/sync_windows.h
index f2ff83b3..2bee03b6 100644
--- a/grpc/include/grpc/impl/codegen/sync_windows.h
+++ b/grpc/include/grpc/impl/codegen/sync_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
#define GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_WINDOWS
diff --git a/grpc/include/grpc/slice.h b/grpc/include/grpc/slice.h
index 51fc62b4..15978fe5 100644
--- a/grpc/include/grpc/slice.h
+++ b/grpc/include/grpc/slice.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/slice.h>
+#include <grpc/impl/codegen/slice.h> // IWYU pragma: export
#include <grpc/support/sync.h>
#ifdef __cplusplus
@@ -69,12 +69,6 @@ GPRAPI grpc_slice grpc_slice_malloc_large(size_t length);
#define GRPC_SLICE_MALLOC(len) grpc_slice_malloc(len)
-/** Intern a slice:
-
- The return value for two invocations of this function with the same sequence
- of bytes is a slice which points to the same memory. */
-GPRAPI grpc_slice grpc_slice_intern(grpc_slice slice);
-
/** Create a slice by copying a string.
Does not preserve null terminators.
Equivalent to:
@@ -129,9 +123,6 @@ GPRAPI grpc_slice grpc_slice_split_head(grpc_slice* s, size_t split);
GPRAPI grpc_slice grpc_empty_slice(void);
-GPRAPI uint32_t grpc_slice_default_hash_impl(grpc_slice s);
-GPRAPI int grpc_slice_default_eq_impl(grpc_slice a, grpc_slice b);
-
GPRAPI int grpc_slice_eq(grpc_slice a, grpc_slice b);
/** Returns <0 if a < b, ==0 if a == b, >0 if a > b
@@ -151,8 +142,6 @@ GPRAPI int grpc_slice_chr(grpc_slice s, char c);
if it's not found */
GPRAPI int grpc_slice_slice(grpc_slice haystack, grpc_slice needle);
-GPRAPI uint32_t grpc_slice_hash(grpc_slice s);
-
/** Do two slices point at the same memory, with the same length
If a or b is inlined, actually compares data */
GPRAPI int grpc_slice_is_equivalent(grpc_slice a, grpc_slice b);
diff --git a/grpc/include/grpc/status.h b/grpc/include/grpc/status.h
index ecb9668b..6763264e 100644
--- a/grpc/include/grpc/status.h
+++ b/grpc/include/grpc/status.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/status.h>
+#include <grpc/impl/codegen/status.h> // IWYU pragma: export
#endif /* GRPC_STATUS_H */
diff --git a/grpc/include/grpc/support/atm.h b/grpc/include/grpc/support/atm.h
index 073b0a6f..fbfcee3b 100644
--- a/grpc/include/grpc/support/atm.h
+++ b/grpc/include/grpc/support/atm.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm.h>
+#include <grpc/impl/codegen/atm.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_H */
diff --git a/grpc/include/grpc/support/atm_gcc_atomic.h b/grpc/include/grpc/support/atm_gcc_atomic.h
index ae603db4..8226349f 100644
--- a/grpc/include/grpc/support/atm_gcc_atomic.h
+++ b/grpc/include/grpc/support/atm_gcc_atomic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_ATOMIC_H */
diff --git a/grpc/include/grpc/support/atm_gcc_sync.h b/grpc/include/grpc/support/atm_gcc_sync.h
index 6f51fdb1..500a9f14 100644
--- a/grpc/include/grpc/support/atm_gcc_sync.h
+++ b/grpc/include/grpc/support/atm_gcc_sync.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_SYNC_H */
diff --git a/grpc/include/grpc/support/atm_windows.h b/grpc/include/grpc/support/atm_windows.h
index 36955e4d..b85d7f74 100644
--- a/grpc/include/grpc/support/atm_windows.h
+++ b/grpc/include/grpc/support/atm_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_WINDOWS_H */
diff --git a/grpc/include/grpc/support/log.h b/grpc/include/grpc/support/log.h
index 8d8742b9..7af557d0 100644
--- a/grpc/include/grpc/support/log.h
+++ b/grpc/include/grpc/support/log.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
+#include <grpc/impl/codegen/log.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_LOG_H */
diff --git a/grpc/include/grpc/support/port_platform.h b/grpc/include/grpc/support/port_platform.h
index 26025dcd..fced02a9 100644
--- a/grpc/include/grpc/support/port_platform.h
+++ b/grpc/include/grpc/support/port_platform.h
@@ -19,6 +19,6 @@
#ifndef GRPC_SUPPORT_PORT_PLATFORM_H
#define GRPC_SUPPORT_PORT_PLATFORM_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/impl/codegen/port_platform.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */
diff --git a/grpc/include/grpc/support/sync.h b/grpc/include/grpc/support/sync.h
index f617322f..b1f5b786 100644
--- a/grpc/include/grpc/support/sync.h
+++ b/grpc/include/grpc/support/sync.h
@@ -22,7 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/impl/codegen/gpr_types.h> /* for gpr_timespec */
-#include <grpc/impl/codegen/sync.h>
+#include <grpc/impl/codegen/sync.h> // IWYU pragma: export
#ifdef __cplusplus
extern "C" {
diff --git a/grpc/include/grpc/support/sync_abseil.h b/grpc/include/grpc/support/sync_abseil.h
index 3ee73489..d6ad9692 100644
--- a/grpc/include/grpc/support/sync_abseil.h
+++ b/grpc/include/grpc/support/sync_abseil.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_ABSEIL_H */
diff --git a/grpc/include/grpc/support/sync_custom.h b/grpc/include/grpc/support/sync_custom.h
index 27cf0e05..de7e2200 100644
--- a/grpc/include/grpc/support/sync_custom.h
+++ b/grpc/include/grpc/support/sync_custom.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_CUSTOM_H */
diff --git a/grpc/include/grpc/support/sync_generic.h b/grpc/include/grpc/support/sync_generic.h
index 93028c4a..d1d9fd7e 100644
--- a/grpc/include/grpc/support/sync_generic.h
+++ b/grpc/include/grpc/support/sync_generic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_GENERIC_H */
diff --git a/grpc/include/grpc/support/sync_posix.h b/grpc/include/grpc/support/sync_posix.h
index 3dce7ee4..b971cd10 100644
--- a/grpc/include/grpc/support/sync_posix.h
+++ b/grpc/include/grpc/support/sync_posix.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_POSIX_H */
diff --git a/grpc/include/grpc/support/sync_windows.h b/grpc/include/grpc/support/sync_windows.h
index a493c864..3ee4a6ff 100644
--- a/grpc/include/grpc/support/sync_windows.h
+++ b/grpc/include/grpc/support/sync_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_WINDOWS_H */
diff --git a/grpc/include/grpc/support/time.h b/grpc/include/grpc/support/time.h
index 44aead5e..a193dbc8 100644
--- a/grpc/include/grpc/support/time.h
+++ b/grpc/include/grpc/support/time.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/gpr_types.h>
-
#include <stddef.h>
#include <time.h>
+#include <grpc/impl/codegen/gpr_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/include/grpcpp/alarm.h b/grpc/include/grpcpp/alarm.h
index 6723e136..1b5ddfe8 100644
--- a/grpc/include/grpcpp/alarm.h
+++ b/grpc/include/grpcpp/alarm.h
@@ -32,7 +32,7 @@
namespace grpc {
-class Alarm : private ::grpc::GrpcLibraryCodegen {
+class Alarm : private grpc::GrpcLibraryCodegen {
public:
/// Create an unset completion queue alarm
Alarm();
@@ -48,8 +48,8 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
/// internal::GrpcLibraryInitializer instance would need to be introduced
/// here. \endinternal.
template <typename T>
- Alarm(::grpc::CompletionQueue* cq, const T& deadline, void* tag) : Alarm() {
- SetInternal(cq, ::grpc::TimePoint<T>(deadline).raw_time(), tag);
+ Alarm(grpc::CompletionQueue* cq, const T& deadline, void* tag) : Alarm() {
+ SetInternal(cq, grpc::TimePoint<T>(deadline).raw_time(), tag);
}
/// Trigger an alarm instance on completion queue \a cq at the specified time.
@@ -61,8 +61,8 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
// setting an immediate deadline. Such usage allows synchronizing an external
// event with an application's \a grpc::CompletionQueue::Next loop.
template <typename T>
- void Set(::grpc::CompletionQueue* cq, const T& deadline, void* tag) {
- SetInternal(cq, ::grpc::TimePoint<T>(deadline).raw_time(), tag);
+ void Set(grpc::CompletionQueue* cq, const T& deadline, void* tag) {
+ SetInternal(cq, grpc::TimePoint<T>(deadline).raw_time(), tag);
}
/// Alarms aren't copyable.
@@ -81,47 +81,19 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
/// has already fired has no effect.
void Cancel();
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Set an alarm to invoke callback \a f. The argument to the callback
/// states whether the alarm expired at \a deadline (true) or was cancelled
/// (false)
template <typename T>
void Set(const T& deadline, std::function<void(bool)> f) {
- SetInternal(::grpc::TimePoint<T>(deadline).raw_time(), std::move(f));
+ SetInternal(grpc::TimePoint<T>(deadline).raw_time(), std::move(f));
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of Alarm when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(Alarm* alarm) : alarm_(alarm) {}
-
- /// Set an alarm to invoke callback \a f. The argument to the callback
- /// states whether the alarm expired at \a deadline (true) or was cancelled
- /// (false)
- template <typename T>
- void Set(const T& deadline, std::function<void(bool)> f) {
- alarm_->SetInternal(::grpc::TimePoint<T>(deadline).raw_time(),
- std::move(f));
- }
-
- private:
- Alarm* alarm_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
- void SetInternal(::grpc::CompletionQueue* cq, gpr_timespec deadline,
- void* tag);
+ void SetInternal(grpc::CompletionQueue* cq, gpr_timespec deadline, void* tag);
void SetInternal(gpr_timespec deadline, std::function<void(bool)> f);
- ::grpc::internal::CompletionQueueTag* alarm_;
+ grpc::internal::CompletionQueueTag* alarm_;
};
} // namespace grpc
diff --git a/grpc/include/grpcpp/channel.h b/grpc/include/grpcpp/channel.h
index 65cc46d1..ec8702e4 100644
--- a/grpc/include/grpcpp/channel.h
+++ b/grpc/include/grpcpp/channel.h
@@ -51,10 +51,10 @@ void ChannelResetConnectionBackoff(Channel* channel);
} // namespace experimental
/// Channels represent a connection to an endpoint. Created by \a CreateChannel.
-class Channel final : public ::grpc::ChannelInterface,
- public ::grpc::internal::CallHook,
+class Channel final : public grpc::ChannelInterface,
+ public grpc::internal::CallHook,
public std::enable_shared_from_this<Channel>,
- private ::grpc::GrpcLibraryCodegen {
+ private grpc::GrpcLibraryCodegen {
public:
~Channel() override;
@@ -71,38 +71,38 @@ class Channel final : public ::grpc::ChannelInterface,
private:
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
- friend class ::grpc::testing::ChannelTestPeer;
+ friend class grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::testing::ChannelTestPeer;
friend void experimental::ChannelResetConnectionBackoff(Channel* channel);
friend std::shared_ptr<Channel> grpc::CreateChannelInternal(
const std::string& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
- friend class ::grpc::internal::InterceptedChannel;
+ friend class grpc::internal::InterceptedChannel;
Channel(const std::string& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
- ::grpc::internal::Call CreateCall(const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) override;
- void PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops,
- ::grpc::internal::Call* call) override;
+ grpc::internal::Call CreateCall(const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) override;
+ void PerformOpsOnCall(grpc::internal::CallOpSetInterface* ops,
+ grpc::internal::Call* call) override;
void* RegisterMethod(const char* method) override;
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq, void* tag) override;
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
+ void* tag) override;
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) override;
- ::grpc::CompletionQueue* CallbackCQ() override;
+ grpc::CompletionQueue* CallbackCQ() override;
- ::grpc::internal::Call CreateCallInternal(
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq, size_t interceptor_pos) override;
+ grpc::internal::Call CreateCallInternal(
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
+ grpc::CompletionQueue* cq, size_t interceptor_pos) override;
const std::string host_;
grpc_channel* const c_channel_; // owned
@@ -117,7 +117,7 @@ class Channel final : public ::grpc::ChannelInterface,
std::atomic<CompletionQueue*> callback_cq_{nullptr};
std::vector<
- std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>>
+ std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators_;
};
diff --git a/grpc/include/grpcpp/client_context.h b/grpc/include/grpcpp/client_context.h
index 1994fcc6..74a91e26 100644
--- a/grpc/include/grpcpp/client_context.h
+++ b/grpc/include/grpcpp/client_context.h
@@ -34,6 +34,6 @@
#ifndef GRPCPP_CLIENT_CONTEXT_H
#define GRPCPP_CLIENT_CONTEXT_H
-#include <grpcpp/impl/codegen/client_context.h>
+#include <grpcpp/impl/codegen/client_context.h> // IWYU pragma: export
#endif // GRPCPP_CLIENT_CONTEXT_H
diff --git a/grpc/include/grpcpp/completion_queue.h b/grpc/include/grpcpp/completion_queue.h
index 123b277f..42637b59 100644
--- a/grpc/include/grpcpp/completion_queue.h
+++ b/grpc/include/grpcpp/completion_queue.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_COMPLETION_QUEUE_H
#define GRPCPP_COMPLETION_QUEUE_H
-#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/completion_queue.h> // IWYU pragma: export
#endif // GRPCPP_COMPLETION_QUEUE_H
diff --git a/grpc/include/grpcpp/create_channel_binder.h b/grpc/include/grpcpp/create_channel_binder.h
new file mode 100644
index 00000000..a8f963db
--- /dev/null
+++ b/grpc/include/grpcpp/create_channel_binder.h
@@ -0,0 +1,95 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_CREATE_CHANNEL_BINDER_H
+#define GRPCPP_CREATE_CHANNEL_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_ANDROID
+
+#include <jni.h>
+
+#include <memory>
+
+#include "absl/strings/string_view.h"
+
+#include <grpcpp/channel.h>
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/support/channel_arguments.h>
+
+namespace grpc {
+namespace experimental {
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void* jni_env, jobject context, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+/// \param args Options for channel creation.
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void* jni_env_void, jobject application, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ const ChannelArguments& args);
+
+/// EXPERIMENTAL Finds internal binder transport Java code. To create channels
+/// in threads created in native code, it is required to call this function
+/// once beforehand in a thread that is not created in native code.
+/// See
+/// https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
+/// for details of this limitation.
+/// Returns true when the initialization is successful.
+bool InitializeBinderChannelJavaClass(void* jni_env_void);
+
+/// EXPERIMENTAL Alternative version of `InitializeBinderChannelJavaClass(void*
+/// jni_env_void)`. This version used a user-specified function to find the
+/// required internal Java class. When a class is found, the `class_finder`
+/// function should return a local reference to the class (jclass type). The
+/// returned jclass will then be used to create global reference for gRPC to use
+/// it later. After that, gRPC will DeleteLocalRef the returned local reference.
+bool InitializeBinderChannelJavaClass(
+ void* jni_env_void, std::function<void*(std::string)> class_finder);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif
+
+#endif // GRPCPP_CREATE_CHANNEL_BINDER_H
diff --git a/grpc/include/grpcpp/create_channel_posix.h b/grpc/include/grpcpp/create_channel_posix.h
index 8c34330d..e6019d2c 100644
--- a/grpc/include/grpcpp/create_channel_posix.h
+++ b/grpc/include/grpcpp/create_channel_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_CREATE_CHANNEL_POSIX_H
#define GRPCPP_CREATE_CHANNEL_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/channel.h>
#include <grpcpp/support/channel_arguments.h>
diff --git a/grpc/include/grpcpp/ext/orca_service.h b/grpc/include/grpcpp/ext/orca_service.h
new file mode 100644
index 00000000..3acf4bf0
--- /dev/null
+++ b/grpc/include/grpcpp/ext/orca_service.h
@@ -0,0 +1,83 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_EXT_ORCA_SERVICE_H
+#define GRPCPP_EXT_ORCA_SERVICE_H
+
+#include <map>
+#include <string>
+
+#include "absl/time/time.h"
+#include "absl/types/optional.h"
+
+#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/sync.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/support/slice.h>
+
+namespace grpc {
+namespace experimental {
+
+// RPC service implementation for supplying out-of-band backend
+// utilization metrics to clients.
+class OrcaService : public Service {
+ public:
+ struct Options {
+ // Minimum report interval. If a client requests an interval lower
+ // than this value, this value will be used instead.
+ absl::Duration min_report_duration = absl::Seconds(30);
+
+ Options() = default;
+ Options& set_min_report_duration(absl::Duration duration) {
+ min_report_duration = duration;
+ return *this;
+ }
+ };
+
+ explicit OrcaService(Options options);
+
+ // Sets or removes the CPU utilization value to be reported to clients.
+ void SetCpuUtilization(double cpu_utilization);
+ void DeleteCpuUtilization();
+
+ // Sets of removes the memory utilization value to be reported to clients.
+ void SetMemoryUtilization(double memory_utilization);
+ void DeleteMemoryUtilization();
+
+ // Sets or removed named utilization values to be reported to clients.
+ void SetNamedUtilization(std::string name, double utilization);
+ void DeleteNamedUtilization(const std::string& name);
+ void SetAllNamedUtilization(std::map<std::string, double> named_utilization);
+
+ private:
+ class Reactor;
+
+ Slice GetOrCreateSerializedResponse();
+
+ const absl::Duration min_report_duration_;
+
+ grpc::internal::Mutex mu_;
+ double cpu_utilization_ ABSL_GUARDED_BY(&mu_) = -1;
+ double memory_utilization_ ABSL_GUARDED_BY(&mu_) = -1;
+ std::map<std::string, double> named_utilization_ ABSL_GUARDED_BY(&mu_);
+ absl::optional<Slice> response_slice_ ABSL_GUARDED_BY(&mu_);
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_EXT_ORCA_SERVICE_H
diff --git a/grpc/include/grpcpp/ext/proto_server_reflection_plugin.h b/grpc/include/grpcpp/ext/proto_server_reflection_plugin.h
index 6bf7c282..3c58debc 100644
--- a/grpc/include/grpcpp/ext/proto_server_reflection_plugin.h
+++ b/grpc/include/grpcpp/ext/proto_server_reflection_plugin.h
@@ -28,7 +28,7 @@ class ServerInitializer;
namespace reflection {
-class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
+class ProtoServerReflectionPlugin : public grpc::ServerBuilderPlugin {
public:
ProtoServerReflectionPlugin();
::std::string name() override;
diff --git a/grpc/include/grpcpp/ext/server_load_reporting.h b/grpc/include/grpcpp/ext/server_load_reporting.h
index 7f681eb1..30c08d3b 100644
--- a/grpc/include/grpcpp/ext/server_load_reporting.h
+++ b/grpc/include/grpcpp/ext/server_load_reporting.h
@@ -37,8 +37,8 @@ namespace experimental {
class LoadReportingServiceServerBuilderOption
: public grpc::ServerBuilderOption {
public:
- void UpdateArguments(::grpc::ChannelArguments* args) override;
- void UpdatePlugins(std::vector<std::unique_ptr<::grpc::ServerBuilderPlugin>>*
+ void UpdateArguments(grpc::ChannelArguments* args) override;
+ void UpdatePlugins(std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>>*
plugins) override;
};
diff --git a/grpc/include/grpcpp/generic/async_generic_service.h b/grpc/include/grpcpp/generic/async_generic_service.h
index 2c67edc5..01c79428 100644
--- a/grpc/include/grpcpp/generic/async_generic_service.h
+++ b/grpc/include/grpcpp/generic/async_generic_service.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
-#include <grpcpp/impl/codegen/async_generic_service.h>
+#include <grpcpp/impl/codegen/async_generic_service.h> // IWYU pragma: export
#endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
diff --git a/grpc/include/grpcpp/generic/generic_stub.h b/grpc/include/grpcpp/generic/generic_stub.h
index e9564c33..6ae6c991 100644
--- a/grpc/include/grpcpp/generic/generic_stub.h
+++ b/grpc/include/grpcpp/generic/generic_stub.h
@@ -53,7 +53,7 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
PrepareCall(ClientContext* context, const std::string& method,
- ::grpc::CompletionQueue* cq) {
+ grpc::CompletionQueue* cq) {
return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
false, nullptr);
}
@@ -64,7 +64,7 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncResponseReader<ResponseType>> PrepareUnaryCall(
ClientContext* context, const std::string& method,
- const RequestType& request, ::grpc::CompletionQueue* cq) {
+ const RequestType& request, grpc::CompletionQueue* cq) {
return std::unique_ptr<ClientAsyncResponseReader<ResponseType>>(
internal::ClientAsyncResponseReaderHelper::Create<ResponseType>(
channel_.get(), cq,
@@ -82,18 +82,18 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>> Call(
ClientContext* context, const std::string& method,
- ::grpc::CompletionQueue* cq, void* tag) {
+ grpc::CompletionQueue* cq, void* tag) {
return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
true, tag);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Setup and start a unary call to a named method \a method using
/// \a context and specifying the \a request and \a response buffers.
void UnaryCall(ClientContext* context, const std::string& method,
- const RequestType* request, ResponseType* response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response,
std::function<void(grpc::Status)> on_completion) {
- UnaryCallInternal(context, method, /*options=*/{}, request, response,
+ UnaryCallInternal(context, method, options, request, response,
std::move(on_completion));
}
@@ -102,9 +102,9 @@ class TemplatedGenericStub final {
/// Like any other reactor-based RPC, it will not be activated until
/// StartCall is invoked on its reactor.
void PrepareUnaryCall(ClientContext* context, const std::string& method,
- const RequestType* request, ResponseType* response,
- ClientUnaryReactor* reactor) {
- PrepareUnaryCallInternal(context, method, /*options=*/{}, request, response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response, ClientUnaryReactor* reactor) {
+ PrepareUnaryCallInternal(context, method, options, request, response,
reactor);
}
@@ -112,58 +112,10 @@ class TemplatedGenericStub final {
/// \a reactor . Like any other bidi streaming RPC, it will not be activated
/// until StartCall is invoked on its reactor.
void PrepareBidiStreamingCall(
- ClientContext* context, const std::string& method,
+ ClientContext* context, const std::string& method, StubOptions options,
ClientBidiReactor<RequestType, ResponseType>* reactor) {
- PrepareBidiStreamingCallInternal(context, method, /*options=*/{}, reactor);
+ PrepareBidiStreamingCallInternal(context, method, options, reactor);
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of GenericStub when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(TemplatedGenericStub* stub) : stub_(stub) {}
-
- /// Setup and start a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- void UnaryCall(ClientContext* context, const std::string& method,
- StubOptions options, const RequestType* request,
- ResponseType* response,
- std::function<void(grpc::Status)> on_completion) {
- stub_->UnaryCallInternal(context, method, options, request, response,
- std::move(on_completion));
- }
-
- /// Setup a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- /// Like any other reactor-based RPC, it will not be activated until
- /// StartCall is invoked on its reactor.
- void PrepareUnaryCall(ClientContext* context, const std::string& method,
- StubOptions options, const RequestType* request,
- ResponseType* response, ClientUnaryReactor* reactor) {
- stub_->PrepareUnaryCallInternal(context, method, options, request,
- response, reactor);
- }
-
- /// Setup a call to a named method \a method using \a context and tied to
- /// \a reactor . Like any other bidi streaming RPC, it will not be activated
- /// until StartCall is invoked on its reactor.
- void PrepareBidiStreamingCall(
- ClientContext* context, const std::string& method, StubOptions options,
- ClientBidiReactor<RequestType, ResponseType>* reactor) {
- stub_->PrepareBidiStreamingCallInternal(context, method, options,
- reactor);
- }
-
- private:
- TemplatedGenericStub* stub_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
std::shared_ptr<grpc::ChannelInterface> channel_;
@@ -205,7 +157,7 @@ class TemplatedGenericStub final {
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
CallInternal(grpc::ChannelInterface* channel, ClientContext* context,
const std::string& method, StubOptions options,
- ::grpc::CompletionQueue* cq, bool start, void* tag) {
+ grpc::CompletionQueue* cq, bool start, void* tag) {
return std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>(
internal::ClientAsyncReaderWriterFactory<RequestType, ResponseType>::
Create(channel, cq,
diff --git a/grpc/include/grpcpp/grpcpp.h b/grpc/include/grpcpp/grpcpp.h
index 8912f99f..9d707e29 100644
--- a/grpc/include/grpcpp/grpcpp.h
+++ b/grpc/include/grpcpp/grpcpp.h
@@ -49,7 +49,6 @@
// headers are not private for grpcpp.h and are part of its interface.
// IWYU pragma: begin_exports
#include <grpc/grpc.h>
-
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
diff --git a/grpc/include/grpcpp/impl/call.h b/grpc/include/grpcpp/impl/call.h
index a6b13126..97d8fdfc 100644
--- a/grpc/include/grpcpp/impl/call.h
+++ b/grpc/include/grpcpp/impl/call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CALL_H
#define GRPCPP_IMPL_CALL_H
-#include <grpcpp/impl/codegen/call.h>
+#include <grpcpp/impl/codegen/call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CALL_H
diff --git a/grpc/include/grpcpp/impl/client_unary_call.h b/grpc/include/grpcpp/impl/client_unary_call.h
index 378482c5..7ecf3548 100644
--- a/grpc/include/grpcpp/impl/client_unary_call.h
+++ b/grpc/include/grpcpp/impl/client_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CLIENT_UNARY_CALL_H
-#include <grpcpp/impl/codegen/client_unary_call.h>
+#include <grpcpp/impl/codegen/client_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CLIENT_UNARY_CALL_H
diff --git a/grpc/include/grpcpp/impl/codegen/async_generic_service.h b/grpc/include/grpcpp/impl/codegen/async_generic_service.h
index 048af332..2a000662 100644
--- a/grpc/include/grpcpp/impl/codegen/async_generic_service.h
+++ b/grpc/include/grpcpp/impl/codegen/async_generic_service.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
+// IWYU pragma: private, include <grpcpp/generic/async_generic_service.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpcpp/impl/codegen/async_stream.h>
@@ -71,18 +73,14 @@ class AsyncGenericService final {
void 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);
private:
friend class grpc::Server;
grpc::Server* server_;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
-
/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs
/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with
/// ByteBuffer arguments.
@@ -94,7 +92,7 @@ class GenericCallbackServerContext final : public grpc::CallbackServerContext {
const std::string& host() const { return host_; }
private:
- friend class ::grpc::Server;
+ friend class grpc::Server;
std::string method_;
std::string host_;
@@ -126,7 +124,7 @@ class CallbackGenericService {
internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>* Handler() {
return new internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>(
- [this](::grpc::CallbackServerContext* ctx) {
+ [this](grpc::CallbackServerContext* ctx) {
return CreateReactor(static_cast<GenericCallbackServerContext*>(ctx));
});
}
@@ -134,9 +132,6 @@ class CallbackGenericService {
grpc::Server* server_{nullptr};
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
diff --git a/grpc/include/grpcpp/impl/codegen/async_stream.h b/grpc/include/grpcpp/impl/codegen/async_stream.h
index aaee93df..5b63c301 100644
--- a/grpc/include/grpcpp/impl/codegen/async_stream.h
+++ b/grpc/include/grpcpp/impl/codegen/async_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/async_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
@@ -73,7 +75,7 @@ class ClientAsyncStreamingInterface {
///
/// \param[in] tag Tag identifying this request.
/// \param[out] status To be updated with the operation status.
- virtual void Finish(::grpc::Status* status, void* tag) = 0;
+ virtual void Finish(grpc::Status* status, void* tag) = 0;
};
/// An interface that yields a sequence of messages of type \a R.
@@ -133,7 +135,7 @@ class AsyncWriterInterface {
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
- virtual void Write(const W& msg, ::grpc::WriteOptions options, void* tag) = 0;
+ virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with the writing
/// of trailing metadata, using WriteOptions \a options with
@@ -153,7 +155,7 @@ class AsyncWriterInterface {
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
- void WriteLast(const W& msg, ::grpc::WriteOptions options, void* tag) {
+ void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) {
Write(msg, options.set_last_message(), tag);
}
};
@@ -177,13 +179,13 @@ class ClientAsyncReaderFactory {
/// Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
template <class W>
- static ClientAsyncReader<R>* Create(::grpc::ChannelInterface* channel,
- ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static ClientAsyncReader<R>* Create(grpc::ChannelInterface* channel,
+ grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const W& request, bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncReader<R>)))
ClientAsyncReader<R>(call, context, request, start, tag);
}
@@ -246,7 +248,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata received from the server.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -259,7 +261,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
private:
friend class internal::ClientAsyncReaderFactory<R>;
template <class W>
- ClientAsyncReader(::grpc::internal::Call call, ::grpc::ClientContext* context,
+ ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context,
const W& request, bool start, void* tag)
: context_(context), call_(call), started_(start) {
// TODO(ctiller): don't assert
@@ -279,20 +281,20 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
call_.PerformOps(&init_ops_);
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
init_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
@@ -325,13 +327,13 @@ class ClientAsyncWriterFactory {
/// message from the server upon a successful call to the \a Finish
/// method of this instance.
template <class R>
- static ClientAsyncWriter<W>* Create(::grpc::ChannelInterface* channel,
- ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- R* response, bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ static ClientAsyncWriter<W>* Create(grpc::ChannelInterface* channel,
+ grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response,
+ bool start, void* tag) {
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncWriter<W>)))
ClientAsyncWriter<W>(call, context, response, start, tag);
}
@@ -386,7 +388,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
@@ -412,7 +414,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
/// possible initial and trailing metadata received from the server.
/// - attempts to fill in the \a response parameter passed to this class's
/// constructor with the server's response message.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -425,7 +427,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
private:
friend class internal::ClientAsyncWriterFactory<W>;
template <class R>
- ClientAsyncWriter(::grpc::internal::Call call, ::grpc::ClientContext* context,
+ ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context,
R* response, bool start, void* tag)
: context_(context), call_(call), started_(start) {
finish_ops_.RecvMessage(response);
@@ -448,18 +450,18 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpGenericRecvMessage,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpGenericRecvMessage,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
@@ -491,12 +493,12 @@ class ClientAsyncReaderWriterFactory {
/// Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
static ClientAsyncReaderWriter<W, R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncReaderWriter<W, R>)))
ClientAsyncReaderWriter<W, R>(call, context, start, tag);
}
@@ -563,7 +565,7 @@ class ClientAsyncReaderWriter final
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
@@ -586,7 +588,7 @@ class ClientAsyncReaderWriter final
/// Side effect
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -598,8 +600,8 @@ class ClientAsyncReaderWriter final
private:
friend class internal::ClientAsyncReaderWriterFactory<W, R>;
- ClientAsyncReaderWriter(::grpc::internal::Call call,
- ::grpc::ClientContext* context, bool start, void* tag)
+ ClientAsyncReaderWriter(grpc::internal::Call call,
+ grpc::ClientContext* context, bool start, void* tag)
: context_(context), call_(call), started_(start) {
if (start) {
StartCallInternal(tag);
@@ -619,26 +621,26 @@ class ClientAsyncReaderWriter final
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
template <class W, class R>
class ServerAsyncReaderInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncReaderInterface<R> {
public:
/// Indicate that the stream is to be finished with a certain status code
@@ -663,8 +665,7 @@ class ServerAsyncReaderInterface
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
/// \param[in] msg To be sent to the client as the response for this call.
- virtual void Finish(const W& msg, const ::grpc::Status& status,
- void* tag) = 0;
+ virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0;
/// Indicate that the stream is to be finished with a certain
/// non-OK status code.
@@ -687,7 +688,7 @@ class ServerAsyncReaderInterface
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
/// - Note: \a status must have a non-OK code.
- virtual void FinishWithError(const ::grpc::Status& status, void* tag) = 0;
+ virtual void FinishWithError(const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing client-streaming RPCs,
@@ -696,7 +697,7 @@ class ServerAsyncReaderInterface
template <class W, class R>
class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
public:
- explicit ServerAsyncReader(::grpc::ServerContext* ctx)
+ explicit ServerAsyncReader(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -734,7 +735,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
///
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once Finish returns.
- void Finish(const W& msg, const ::grpc::Status& status, void* tag) override {
+ void Finish(const W& msg, const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@@ -763,7 +764,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
///
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once FinishWithError returns.
- void FinishWithError(const ::grpc::Status& status, void* tag) override {
+ void FinishWithError(const grpc::Status& status, void* tag) override {
GPR_CODEGEN_ASSERT(!status.ok());
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -779,22 +780,22 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
template <class W>
class ServerAsyncWriterInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncWriterInterface<W> {
public:
/// Indicate that the stream is to be finished with a certain status code.
@@ -818,7 +819,7 @@ class ServerAsyncWriterInterface
///
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
- virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
+ virtual void Finish(const grpc::Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with
@@ -834,8 +835,8 @@ class ServerAsyncWriterInterface
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
- virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) = 0;
+ virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing server streaming RPCs,
@@ -843,7 +844,7 @@ class ServerAsyncWriterInterface
template <class W>
class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
public:
- explicit ServerAsyncWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -874,7 +875,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -896,8 +897,8 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
///
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once WriteAndFinish returns.
- void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) override {
+ void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
@@ -917,7 +918,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
///
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once Finish returns.
- void Finish(const ::grpc::Status& status, void* tag) override {
+ void Finish(const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&finish_ops_);
finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
@@ -925,7 +926,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
@@ -939,23 +940,23 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
}
}
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
/// Server-side interface for asynchronous bi-directional streaming.
template <class W, class R>
class ServerAsyncReaderWriterInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncWriterInterface<W>,
public internal::AsyncReaderInterface<R> {
public:
@@ -981,7 +982,7 @@ class ServerAsyncReaderWriterInterface
///
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
- virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
+ virtual void Finish(const grpc::Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with
@@ -997,8 +998,8 @@ class ServerAsyncReaderWriterInterface
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
- virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) = 0;
+ virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing bidirectional streaming RPCs,
@@ -1009,7 +1010,7 @@ template <class W, class R>
class ServerAsyncReaderWriter final
: public ServerAsyncReaderWriterInterface<W, R> {
public:
- explicit ServerAsyncReaderWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -1046,7 +1047,7 @@ class ServerAsyncReaderWriter final
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -1067,8 +1068,8 @@ class ServerAsyncReaderWriter final
//
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once WriteAndFinish returns.
- void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) override {
+ void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
@@ -1088,7 +1089,7 @@ class ServerAsyncReaderWriter final
//
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once Finish returns.
- void Finish(const ::grpc::Status& status, void* tag) override {
+ void Finish(const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&finish_ops_);
@@ -1097,9 +1098,9 @@ class ServerAsyncReaderWriter final
}
private:
- friend class ::grpc::Server;
+ friend class grpc::Server;
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
@@ -1113,17 +1114,17 @@ class ServerAsyncReaderWriter final
}
}
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
diff --git a/grpc/include/grpcpp/impl/codegen/async_unary_call.h b/grpc/include/grpcpp/impl/codegen/async_unary_call.h
index 7cb7cc6f..0034d210 100644
--- a/grpc/include/grpcpp/impl/codegen/async_unary_call.h
+++ b/grpc/include/grpcpp/impl/codegen/async_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/support/async_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
@@ -68,7 +70,7 @@ class ClientAsyncResponseReaderInterface {
/// \param[in] tag Tag identifying this request.
/// \param[out] status To be updated with the operation status.
/// \param[out] msg To be filled in with the server's response message.
- virtual void Finish(R* msg, ::grpc::Status* status, void* tag) = 0;
+ virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0;
};
namespace internal {
@@ -89,12 +91,12 @@ class ClientAsyncResponseReaderHelper {
/// extraneous parameter just to provide the needed type information.
template <class R, class W, class BaseR = R, class BaseW = W>
static ClientAsyncResponseReader<R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
const W& request) /* __attribute__((noinline)) */ {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
ClientAsyncResponseReader<R>* result =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncResponseReader<R>)))
ClientAsyncResponseReader<R>(call, context);
SetupRequest<BaseR, BaseW>(
@@ -109,7 +111,7 @@ class ClientAsyncResponseReaderHelper {
template <class R, class W>
static void SetupRequest(
grpc_call* call,
- ::grpc::internal::CallOpSendInitialMetadata** single_buf_ptr,
+ grpc::internal::CallOpSendInitialMetadata** single_buf_ptr,
std::function<void(ClientContext*, internal::Call*,
internal::CallOpSendInitialMetadata*, void*)>*
read_initial_metadata,
@@ -119,14 +121,14 @@ class ClientAsyncResponseReaderHelper {
internal::CallOpSetInterface**, void*, Status*, void*)>* finish,
const W& request) {
using SingleBufType =
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose,
- ::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>,
- ::grpc::internal::CallOpClientRecvStatus>;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose,
+ grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>,
+ grpc::internal::CallOpClientRecvStatus>;
SingleBufType* single_buf =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call, sizeof(SingleBufType))) SingleBufType;
*single_buf_ptr = single_buf;
// TODO(ctiller): don't assert
@@ -160,11 +162,11 @@ class ClientAsyncResponseReaderHelper {
internal::CallOpSetInterface** finish_buf_ptr, void* msg,
Status* status, void* tag) {
if (initial_metadata_read) {
- using FinishBufType = ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<R>,
- ::grpc::internal::CallOpClientRecvStatus>;
+ using FinishBufType =
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>,
+ grpc::internal::CallOpClientRecvStatus>;
FinishBufType* finish_buf =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call->call(), sizeof(FinishBufType))) FinishBufType;
*finish_buf_ptr = finish_buf;
finish_buf->set_output_tag(tag);
@@ -184,9 +186,8 @@ class ClientAsyncResponseReaderHelper {
};
}
- static void StartCall(
- ::grpc::ClientContext* context,
- ::grpc::internal::CallOpSendInitialMetadata* single_buf) {
+ static void StartCall(grpc::ClientContext* context,
+ grpc::internal::CallOpSendInitialMetadata* single_buf) {
single_buf->SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
}
@@ -199,8 +200,8 @@ class ClientAsyncResponseReaderFactory {
public:
template <class W>
static ClientAsyncResponseReader<R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
const W& request, bool start) {
auto* result = ClientAsyncResponseReaderHelper::Create<R>(
channel, cq, method, context, request);
@@ -255,7 +256,7 @@ class ClientAsyncResponseReader final
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
- void Finish(R* msg, ::grpc::Status* status, void* tag) override {
+ void Finish(R* msg, grpc::Status* status, void* tag) override {
GPR_CODEGEN_DEBUG_ASSERT(started_);
finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_,
static_cast<void*>(msg), status, tag);
@@ -263,13 +264,13 @@ class ClientAsyncResponseReader final
private:
friend class internal::ClientAsyncResponseReaderHelper;
- ::grpc::ClientContext* const context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* const context_;
+ grpc::internal::Call call_;
bool started_ = false;
bool initial_metadata_read_ = false;
- ClientAsyncResponseReader(::grpc::internal::Call call,
- ::grpc::ClientContext* context)
+ ClientAsyncResponseReader(grpc::internal::Call call,
+ grpc::ClientContext* context)
: context_(context), call_(call) {}
// disable operator new
@@ -292,9 +293,9 @@ class ClientAsyncResponseReader final
/// response message sent to the client is of type \a W.
template <class W>
class ServerAsyncResponseWriter final
- : public ::grpc::internal::ServerAsyncStreamingInterface {
+ : public grpc::internal::ServerAsyncStreamingInterface {
public:
- explicit ServerAsyncResponseWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -332,7 +333,11 @@ class ServerAsyncResponseWriter final
/// Note: if \a status has a non-OK code, then \a msg will not be sent,
/// and the client will receive only the status with possible trailing
/// metadata.
- void Finish(const W& msg, const ::grpc::Status& status, void* tag) {
+ ///
+ /// gRPC doesn't take ownership or a reference to msg and status, so it is
+ /// safe to deallocate them once the Finish operation is complete (i.e. a
+ /// result arrives in the completion queue).
+ void Finish(const W& msg, const grpc::Status& status, void* tag) {
finish_buf_.set_output_tag(tag);
finish_buf_.set_core_cq_tag(&finish_buf_);
if (!ctx_->sent_initial_metadata_) {
@@ -365,7 +370,11 @@ class ServerAsyncResponseWriter final
/// Side effect:
/// - also sends initial metadata if not already sent (using the
/// \a ServerContext associated with this call).
- void FinishWithError(const ::grpc::Status& status, void* tag) {
+ ///
+ /// gRPC doesn't take ownership or a reference to status, so it is safe to
+ /// deallocate them once the Finish operation is complete (i.e. a result
+ /// arrives in the completion queue).
+ void FinishWithError(const grpc::Status& status, void* tag) {
GPR_CODEGEN_ASSERT(!status.ok());
finish_buf_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -381,15 +390,15 @@ class ServerAsyncResponseWriter final
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_buf_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_buf_;
};
@@ -397,12 +406,12 @@ class ServerAsyncResponseWriter final
namespace std {
template <class R>
-class default_delete<::grpc::ClientAsyncResponseReader<R>> {
+class default_delete<grpc::ClientAsyncResponseReader<R>> {
public:
void operator()(void* /*p*/) {}
};
template <class R>
-class default_delete<::grpc::ClientAsyncResponseReaderInterface<R>> {
+class default_delete<grpc::ClientAsyncResponseReaderInterface<R>> {
public:
void operator()(void* /*p*/) {}
};
diff --git a/grpc/include/grpcpp/impl/codegen/byte_buffer.h b/grpc/include/grpcpp/impl/codegen/byte_buffer.h
index 2c015f22..a9ba7d16 100644
--- a/grpc/include/grpcpp/impl/codegen/byte_buffer.h
+++ b/grpc/include/grpcpp/impl/codegen/byte_buffer.h
@@ -19,16 +19,17 @@
#ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
-#include <grpc/impl/codegen/byte_buffer.h>
+// IWYU pragma: private, include <grpcpp/support/byte_buffer.h>
+
+#include <vector>
+#include <grpc/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/serialization_traits.h>
#include <grpcpp/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/status.h>
-#include <vector>
-
namespace grpc {
class ServerInterface;
@@ -41,10 +42,10 @@ class CallbackUnaryHandler;
template <class RequestType, class ResponseType>
class CallbackServerStreamingHandler;
template <class RequestType>
-void* UnaryDeserializeHelper(grpc_byte_buffer*, ::grpc::Status*, RequestType*);
+void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*);
template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
class CallOpSendMessage;
template <class R>
@@ -114,6 +115,13 @@ class ByteBuffer final {
return *this;
}
+ // If this ByteBuffer's representation is a single flat slice, returns a
+ // slice referencing that array.
+ Status TrySingleSlice(Slice* slice) const;
+
+ /// Dump (read) the buffer contents into \a slics.
+ Status DumpToSingleSlice(Slice* slice) const;
+
/// Dump (read) the buffer contents into \a slices.
Status Dump(std::vector<Slice>* slices) const;
@@ -164,7 +172,7 @@ class ByteBuffer final {
friend class internal::CallOpGenericRecvMessage;
template <class RequestType>
friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*,
- ::grpc::Status*, RequestType*);
+ grpc::Status*, RequestType*);
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ServerStreamingHandler;
template <class RequestType, class ResponseType>
diff --git a/grpc/include/grpcpp/impl/codegen/call.h b/grpc/include/grpcpp/impl/codegen/call.h
index b2292862..90d54bc5 100644
--- a/grpc/include/grpcpp/impl/codegen/call.h
+++ b/grpc/include/grpcpp/impl/codegen/call.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_H
#define GRPCPP_IMPL_CODEGEN_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/call.h>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call_hook.h>
@@ -40,13 +42,13 @@ class Call final {
call_(nullptr),
max_receive_message_size_(-1) {}
/** call is owned by the caller */
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq)
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq)
: call_hook_(call_hook),
cq_(cq),
call_(call),
max_receive_message_size_(-1) {}
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq,
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq,
experimental::ClientRpcInfo* rpc_info)
: call_hook_(call_hook),
cq_(cq),
@@ -54,7 +56,7 @@ class Call final {
max_receive_message_size_(-1),
client_rpc_info_(rpc_info) {}
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq,
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq,
int max_receive_message_size, experimental::ServerRpcInfo* rpc_info)
: call_hook_(call_hook),
cq_(cq),
@@ -67,7 +69,7 @@ class Call final {
}
grpc_call* call() const { return call_; }
- ::grpc::CompletionQueue* cq() const { return cq_; }
+ grpc::CompletionQueue* cq() const { return cq_; }
int max_receive_message_size() const { return max_receive_message_size_; }
@@ -81,7 +83,7 @@ class Call final {
private:
CallHook* call_hook_;
- ::grpc::CompletionQueue* cq_;
+ grpc::CompletionQueue* cq_;
grpc_call* call_;
int max_receive_message_size_;
experimental::ClientRpcInfo* client_rpc_info_ = nullptr;
diff --git a/grpc/include/grpcpp/impl/codegen/call_hook.h b/grpc/include/grpcpp/impl/codegen/call_hook.h
index 4f7d370c..8c4278e7 100644
--- a/grpc/include/grpcpp/impl/codegen/call_hook.h
+++ b/grpc/include/grpcpp/impl/codegen/call_hook.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
#define GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/grpc/include/grpcpp/impl/codegen/call_op_set.h b/grpc/include/grpcpp/impl/codegen/call_op_set.h
index 7fde1edb..5b1d4409 100644
--- a/grpc/include/grpcpp/impl/codegen/call_op_set.h
+++ b/grpc/include/grpcpp/impl/codegen/call_op_set.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
+// IWYU pragma: private
+
#include <cstring>
#include <map>
#include <memory>
@@ -165,6 +167,12 @@ class WriteOptions {
return *this;
}
+ /// Get value for the flag indicating that this is the last message, and
+ /// should be coalesced with trailing metadata.
+ ///
+ /// \sa GRPC_WRITE_LAST_MESSAGE
+ bool is_last_message() const { return last_message_; }
+
/// Guarantee that all bytes have been written to the socket before completing
/// this write (usually writes are completed when they pass flow control).
inline WriteOptions& set_write_through() {
@@ -172,13 +180,12 @@ class WriteOptions {
return *this;
}
- inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); }
+ inline WriteOptions& clear_write_through() {
+ ClearBit(GRPC_WRITE_THROUGH);
+ return *this;
+ }
- /// Get value for the flag indicating that this is the last message, and
- /// should be coalesced with trailing metadata.
- ///
- /// \sa GRPC_WRITE_LAST_MESSAGE
- bool is_last_message() const { return last_message_; }
+ inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); }
private:
void SetBit(const uint32_t mask) { flags_ |= mask; }
@@ -722,7 +729,7 @@ class CallOpRecvInitialMetadata {
public:
CallOpRecvInitialMetadata() : metadata_map_(nullptr) {}
- void RecvInitialMetadata(::grpc::ClientContext* context) {
+ void RecvInitialMetadata(grpc::ClientContext* context) {
context->initial_metadata_received_ = true;
metadata_map_ = &context->recv_initial_metadata_;
}
@@ -771,7 +778,7 @@ class CallOpClientRecvStatus {
CallOpClientRecvStatus()
: recv_status_(nullptr), debug_error_string_(nullptr) {}
- void ClientRecvStatus(::grpc::ClientContext* context, Status* status) {
+ void ClientRecvStatus(grpc::ClientContext* context, Status* status) {
client_context_ = context;
metadata_map_ = &client_context_->trailing_metadata_;
recv_status_ = status;
@@ -838,7 +845,7 @@ class CallOpClientRecvStatus {
private:
bool hijacked_ = false;
- ::grpc::ClientContext* client_context_;
+ grpc::ClientContext* client_context_;
MetadataMap* metadata_map_;
Status* recv_status_;
const char* debug_error_string_;
diff --git a/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h b/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
index 3b74566a..a8eed9f6 100644
--- a/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
+++ b/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/completion_queue_tag.h>
namespace grpc {
diff --git a/grpc/include/grpcpp/impl/codegen/callback_common.h b/grpc/include/grpcpp/impl/codegen/callback_common.h
index 086a179a..7c67c928 100644
--- a/grpc/include/grpcpp/impl/codegen/callback_common.h
+++ b/grpc/include/grpcpp/impl/codegen/callback_common.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
#define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
+// IWYU pragma: private
+
#include <functional>
#include <grpc/impl/codegen/grpc_types.h>
@@ -66,8 +68,7 @@ Reactor* CatchingReactorGetter(Func&& func, Args&&... args) {
// constructed and then fired at exactly one point. There is no expectation
// that they can be reused without reconstruction.
-class CallbackWithStatusTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithStatusTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -108,8 +109,7 @@ class CallbackWithStatusTag
CompletionQueueTag* ops_;
Status status_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithStatusTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
@@ -134,8 +134,7 @@ class CallbackWithStatusTag
/// CallbackWithSuccessTag can be reused multiple times, and will be used in
/// this fashion for streaming operations. As a result, it shouldn't clear
/// anything up until its destructor
-class CallbackWithSuccessTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithSuccessTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -198,8 +197,7 @@ class CallbackWithSuccessTag
std::function<void(bool)> func_;
CompletionQueueTag* ops_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithSuccessTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
diff --git a/grpc/include/grpcpp/impl/codegen/channel_interface.h b/grpc/include/grpcpp/impl/codegen/channel_interface.h
index 324c10d1..19fef7e2 100644
--- a/grpc/include/grpcpp/impl/codegen/channel_interface.h
+++ b/grpc/include/grpcpp/impl/codegen/channel_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/status.h>
@@ -79,7 +81,7 @@ class ChannelInterface {
/// deadline expires. \a GetState needs to called to get the current state.
template <typename T>
void NotifyOnStateChange(grpc_connectivity_state last_observed, T deadline,
- ::grpc::CompletionQueue* cq, void* tag) {
+ grpc::CompletionQueue* cq, void* tag) {
TimePoint<T> deadline_tp(deadline);
NotifyOnStateChangeImpl(last_observed, deadline_tp.raw_time(), cq, tag);
}
@@ -104,41 +106,41 @@ class ChannelInterface {
private:
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::internal::ClientAsyncReaderFactory;
+ friend class grpc::internal::ClientAsyncReaderFactory;
template <class W>
- friend class ::grpc::internal::ClientAsyncWriterFactory;
+ friend class grpc::internal::ClientAsyncWriterFactory;
template <class W, class R>
- friend class ::grpc::internal::ClientAsyncReaderWriterFactory;
- friend class ::grpc::internal::ClientAsyncResponseReaderHelper;
+ friend class grpc::internal::ClientAsyncReaderWriterFactory;
+ friend class grpc::internal::ClientAsyncResponseReaderHelper;
template <class W, class R>
- friend class ::grpc::internal::ClientCallbackReaderWriterFactory;
+ friend class grpc::internal::ClientCallbackReaderWriterFactory;
template <class R>
- friend class ::grpc::internal::ClientCallbackReaderFactory;
+ friend class grpc::internal::ClientCallbackReaderFactory;
template <class W>
- friend class ::grpc::internal::ClientCallbackWriterFactory;
- friend class ::grpc::internal::ClientCallbackUnaryFactory;
+ friend class grpc::internal::ClientCallbackWriterFactory;
+ friend class grpc::internal::ClientCallbackUnaryFactory;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::CallbackUnaryCallImpl;
- friend class ::grpc::internal::RpcMethod;
- friend class ::grpc::experimental::DelegatingChannel;
- friend class ::grpc::internal::InterceptedChannel;
+ friend class grpc::internal::CallbackUnaryCallImpl;
+ friend class grpc::internal::RpcMethod;
+ friend class grpc::experimental::DelegatingChannel;
+ friend class grpc::internal::InterceptedChannel;
virtual internal::Call CreateCall(const internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) = 0;
+ grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) = 0;
virtual void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) = 0;
virtual void* RegisterMethod(const char* method) = 0;
virtual void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ grpc::CompletionQueue* cq,
void* tag) = 0;
virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) = 0;
@@ -151,12 +153,11 @@ class ChannelInterface {
// method and adding a new pure method to an interface would be a breaking
// change (even though this is private and non-API)
virtual internal::Call CreateCallInternal(
- const internal::RpcMethod& /*method*/, ::grpc::ClientContext* /*context*/,
- ::grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) {
+ const internal::RpcMethod& /*method*/, grpc::ClientContext* /*context*/,
+ grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) {
return internal::Call();
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// channel. If the return value is nullptr, this channel doesn't support
// callback operations.
@@ -164,7 +165,7 @@ class ChannelInterface {
// Returns nullptr (rather than being pure) since this is a post-1.0 method
// and adding a new pure method to an interface would be a breaking change
// (even though this is private and non-API)
- virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; }
+ virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; }
};
} // namespace grpc
diff --git a/grpc/include/grpcpp/impl/codegen/client_callback.h b/grpc/include/grpcpp/impl/codegen/client_callback.h
index ba802909..04ab4aa8 100644
--- a/grpc/include/grpcpp/impl/codegen/client_callback.h
+++ b/grpc/include/grpcpp/impl/codegen/client_callback.h
@@ -17,6 +17,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
+
+// IWYU pragma: private, include <grpcpp/support/client_callback.h>
+
#include <atomic>
#include <functional>
@@ -45,11 +48,11 @@ class RpcMethod;
template <class InputMessage, class OutputMessage,
class BaseInputMessage = InputMessage,
class BaseOutputMessage = OutputMessage>
-void CallbackUnaryCall(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+void CallbackUnaryCall(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const InputMessage* request, OutputMessage* result,
- std::function<void(::grpc::Status)> on_completion) {
+ std::function<void(grpc::Status)> on_completion) {
static_assert(std::is_base_of<BaseInputMessage, InputMessage>::value,
"Invalid input message specification");
static_assert(std::is_base_of<BaseOutputMessage, OutputMessage>::value,
@@ -61,17 +64,17 @@ void CallbackUnaryCall(::grpc::ChannelInterface* channel,
template <class InputMessage, class OutputMessage>
class CallbackUnaryCallImpl {
public:
- CallbackUnaryCallImpl(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ CallbackUnaryCallImpl(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const InputMessage* request, OutputMessage* result,
- std::function<void(::grpc::Status)> on_completion) {
- ::grpc::CompletionQueue* cq = channel->CallbackCQ();
+ std::function<void(grpc::Status)> on_completion) {
+ grpc::CompletionQueue* cq = channel->CallbackCQ();
GPR_CODEGEN_ASSERT(cq != nullptr);
grpc::internal::Call call(channel->CreateCall(method, context, cq));
using FullCallOpSet = grpc::internal::CallOpSet<
- ::grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
grpc::internal::CallOpRecvInitialMetadata,
grpc::internal::CallOpRecvMessage<OutputMessage>,
@@ -84,14 +87,14 @@ class CallbackUnaryCallImpl {
};
const size_t alloc_sz = sizeof(OpSetAndTag);
auto* const alloced = static_cast<OpSetAndTag*>(
- ::grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(),
- alloc_sz));
+ grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(),
+ alloc_sz));
auto* ops = new (&alloced->opset) FullCallOpSet;
auto* tag = new (&alloced->tag)
grpc::internal::CallbackWithStatusTag(call.call(), on_completion, ops);
// TODO(vjpai): Unify code with sync API as much as possible
- ::grpc::Status s = ops->SendMessagePtr(request);
+ grpc::Status s = ops->SendMessagePtr(request);
if (!s.ok()) {
tag->force_run(s);
return;
@@ -120,7 +123,7 @@ class ClientReactor {
/// hold).
///
/// \param[in] s The status outcome of this RPC
- virtual void OnDone(const ::grpc::Status& /*s*/) = 0;
+ virtual void OnDone(const grpc::Status& /*s*/) = 0;
/// InternalScheduleOnDone is not part of the API and is not meant to be
/// overridden. It is virtual to allow successful builds for certain bazel
@@ -129,7 +132,16 @@ class ClientReactor {
/// the virtual call is slower than a direct call, this function is
/// heavyweight and the cost of the virtual call is not much in comparison.
/// This function may be removed or devirtualized in the future.
- virtual void InternalScheduleOnDone(::grpc::Status s);
+ virtual void InternalScheduleOnDone(grpc::Status s);
+
+ /// InternalTrailersOnly is not part of the API and is not meant to be
+ /// overridden. It is virtual to allow successful builds for certain bazel
+ /// build users that only want to depend on gRPC codegen headers and not the
+ /// full library (although this is not a generally-supported option). Although
+ /// the virtual call is slower than a direct call, this function is
+ /// heavyweight and the cost of the virtual call is not much in comparison.
+ /// This function may be removed or devirtualized in the future.
+ virtual bool InternalTrailersOnly(const grpc_call* call) const;
};
} // namespace internal
@@ -151,7 +163,7 @@ class ClientCallbackReaderWriter {
public:
virtual ~ClientCallbackReaderWriter() {}
virtual void StartCall() = 0;
- virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0;
+ virtual void Write(const Request* req, grpc::WriteOptions options) = 0;
virtual void WritesDone() = 0;
virtual void Read(Response* resp) = 0;
virtual void AddHold(int holds) = 0;
@@ -183,9 +195,9 @@ class ClientCallbackWriter {
public:
virtual ~ClientCallbackWriter() {}
virtual void StartCall() = 0;
- void Write(const Request* req) { Write(req, ::grpc::WriteOptions()); }
- virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0;
- void WriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void Write(const Request* req) { Write(req, grpc::WriteOptions()); }
+ virtual void Write(const Request* req, grpc::WriteOptions options) = 0;
+ void WriteLast(const Request* req, grpc::WriteOptions options) {
Write(req, options.set_last_message());
}
virtual void WritesDone() = 0;
@@ -246,9 +258,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// \param[in] req The message to be written. The library does not take
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
- void StartWrite(const Request* req) {
- StartWrite(req, ::grpc::WriteOptions());
- }
+ void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); }
/// Initiate/post a write operation with specified options.
///
@@ -256,7 +266,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWrite(const Request* req, ::grpc::WriteOptions options) {
+ void StartWrite(const Request* req, grpc::WriteOptions options) {
stream_->Write(req, options);
}
@@ -269,7 +279,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Request* req, grpc::WriteOptions options) {
StartWrite(req, options.set_last_message());
}
@@ -316,7 +326,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// (like failure to remove a hold).
///
/// \param[in] s The status outcome of this RPC
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
/// Notifies the application that a read of initial metadata from the
/// server is done. If the application chooses not to implement this method,
@@ -373,7 +383,7 @@ class ClientReadReactor : public internal::ClientReactor {
}
void RemoveHold() { reader_->RemoveHold(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
virtual void OnReadDone(bool /*ok*/) {}
@@ -389,13 +399,11 @@ template <class Request>
class ClientWriteReactor : public internal::ClientReactor {
public:
void StartCall() { writer_->StartCall(); }
- void StartWrite(const Request* req) {
- StartWrite(req, ::grpc::WriteOptions());
- }
- void StartWrite(const Request* req, ::grpc::WriteOptions options) {
+ void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); }
+ void StartWrite(const Request* req, grpc::WriteOptions options) {
writer_->Write(req, options);
}
- void StartWriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Request* req, grpc::WriteOptions options) {
StartWrite(req, options.set_last_message());
}
void StartWritesDone() { writer_->WritesDone(); }
@@ -407,7 +415,7 @@ class ClientWriteReactor : public internal::ClientReactor {
}
void RemoveHold() { writer_->RemoveHold(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
virtual void OnWriteDone(bool /*ok*/) {}
virtual void OnWritesDoneDone(bool /*ok*/) {}
@@ -433,7 +441,7 @@ class ClientWriteReactor : public internal::ClientReactor {
class ClientUnaryReactor : public internal::ClientReactor {
public:
void StartCall() { call_->StartCall(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
private:
@@ -522,7 +530,7 @@ class ClientCallbackReaderWriterImpl
call_.PerformOps(&read_ops_);
}
- void Write(const Request* msg, ::grpc::WriteOptions options)
+ void Write(const Request* msg, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(start_mu_) override {
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -581,7 +589,7 @@ class ClientCallbackReaderWriterImpl
friend class ClientCallbackReaderWriterFactory<Request, Response>;
ClientCallbackReaderWriterImpl(grpc::internal::Call call,
- ::grpc::ClientContext* context,
+ grpc::ClientContext* context,
ClientBidiReactor<Request, Response>* reactor)
: context_(context),
call_(call),
@@ -594,7 +602,8 @@ class ClientCallbackReaderWriterImpl
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -638,11 +647,11 @@ class ClientCallbackReaderWriterImpl
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackReaderWriterImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -651,7 +660,7 @@ class ClientCallbackReaderWriterImpl
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientBidiReactor<Request, Response>* const reactor_;
@@ -665,7 +674,7 @@ class ClientCallbackReaderWriterImpl
grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
@@ -698,15 +707,15 @@ class ClientCallbackReaderWriterImpl
template <class Request, class Response>
class ClientCallbackReaderWriterFactory {
public:
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
ClientBidiReactor<Request, Response>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackReaderWriterImpl<Request, Response>)))
ClientCallbackReaderWriterImpl<Request, Response>(call, context,
reactor);
@@ -737,7 +746,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -796,8 +806,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
friend class ClientCallbackReaderFactory<Response>;
template <class Request>
- ClientCallbackReaderImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Request* request,
+ ClientCallbackReaderImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Request* request,
ClientReadReactor<Response>* reactor)
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
@@ -810,11 +820,11 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackReaderImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -823,7 +833,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientReadReactor<Response>* const reactor_;
@@ -836,7 +846,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<Response>>
read_ops_;
@@ -857,15 +867,15 @@ template <class Response>
class ClientCallbackReaderFactory {
public:
template <class Request>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const Request* request,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const Request* request,
ClientReadReactor<Response>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackReaderImpl<Response>)))
ClientCallbackReaderImpl<Response>(call, context, request, reactor);
}
@@ -918,7 +928,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
this->MaybeFinish(/*from_reaction=*/false);
}
- void Write(const Request* msg, ::grpc::WriteOptions options)
+ void Write(const Request* msg, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(start_mu_) override {
if (GPR_UNLIKELY(options.is_last_message())) {
options.set_buffer_hint();
@@ -981,8 +991,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
friend class ClientCallbackWriterFactory<Request>;
template <class Response>
- ClientCallbackWriterImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Response* response,
+ ClientCallbackWriterImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Response* response,
ClientWriteReactor<Request>* reactor)
: context_(context),
call_(call),
@@ -995,7 +1005,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -1027,11 +1038,11 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackWriterImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -1040,7 +1051,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientWriteReactor<Request>* const reactor_;
@@ -1056,7 +1067,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
grpc::internal::CallOpClientRecvStatus>
finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
@@ -1085,15 +1096,15 @@ template <class Request>
class ClientCallbackWriterFactory {
public:
template <class Response>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, Response* response,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, Response* response,
ClientWriteReactor<Request>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackWriterImpl<Request>)))
ClientCallbackWriterImpl<Request>(call, context, response, reactor);
}
@@ -1121,7 +1132,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish();
},
&start_ops_, /*can_inline=*/false);
@@ -1143,8 +1155,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
friend class ClientCallbackUnaryFactory;
template <class Request, class Response>
- ClientCallbackUnaryImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Request* request,
+ ClientCallbackUnaryImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Request* request,
Response* response, ClientUnaryReactor* reactor)
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
@@ -1161,16 +1173,16 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
void MaybeFinish() {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackUnaryImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
reactor->OnDone(s);
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientUnaryReactor* const reactor_;
@@ -1185,7 +1197,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
grpc::internal::CallOpClientRecvStatus>
finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
// This call will have 2 callbacks: start and finish
std::atomic<intptr_t> callbacks_outstanding_{2};
@@ -1195,16 +1207,16 @@ class ClientCallbackUnaryFactory {
public:
template <class Request, class Response, class BaseRequest = Request,
class BaseResponse = Response>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const Request* request,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const Request* request,
Response* response, ClientUnaryReactor* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackUnaryImpl)))
ClientCallbackUnaryImpl(call, context,
static_cast<const BaseRequest*>(request),
@@ -1213,32 +1225,5 @@ class ClientCallbackUnaryFactory {
};
} // namespace internal
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-template <class Response>
-using ClientCallbackReader = ::grpc::ClientCallbackReader<Response>;
-
-template <class Request>
-using ClientCallbackWriter = ::grpc::ClientCallbackWriter<Request>;
-
-template <class Request, class Response>
-using ClientCallbackReaderWriter =
- ::grpc::ClientCallbackReaderWriter<Request, Response>;
-
-template <class Response>
-using ClientReadReactor = ::grpc::ClientReadReactor<Response>;
-
-template <class Request>
-using ClientWriteReactor = ::grpc::ClientWriteReactor<Request>;
-
-template <class Request, class Response>
-using ClientBidiReactor = ::grpc::ClientBidiReactor<Request, Response>;
-
-typedef ::grpc::ClientUnaryReactor ClientUnaryReactor;
-
-} // namespace experimental
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
diff --git a/grpc/include/grpcpp/impl/codegen/client_context.h b/grpc/include/grpcpp/impl/codegen/client_context.h
index 952a7baf..9d616532 100644
--- a/grpc/include/grpcpp/impl/codegen/client_context.h
+++ b/grpc/include/grpcpp/impl/codegen/client_context.h
@@ -34,6 +34,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/client_context.h>
+
#include <map>
#include <memory>
#include <string>
@@ -92,6 +94,7 @@ class ClientAsyncResponseReader;
namespace testing {
class InteropClientContextInspector;
+class ClientContextTestPeer;
} // namespace testing
namespace internal {
@@ -205,7 +208,7 @@ class ClientContext {
/// \return A newly constructed \a ClientContext instance based on \a
/// server_context, with traits propagated (copied) according to \a options.
static std::unique_ptr<ClientContext> FromServerContext(
- const grpc::ServerContext& server_context,
+ const grpc::ServerContextBase& server_context,
PropagationOptions options = PropagationOptions());
static std::unique_ptr<ClientContext> FromCallbackServerContext(
const grpc::CallbackServerContext& server_context,
@@ -223,11 +226,16 @@ class ClientContext {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ \endverbatim
+ **/
void AddMetadata(const std::string& meta_key, const std::string& meta_value);
/// Return a collection of initial metadata key-value pairs. Note that keys
@@ -268,19 +276,7 @@ class ClientContext {
deadline_ = deadline_tp.raw_time();
}
- /// EXPERIMENTAL: Indicate that this request is idempotent.
- /// By default, RPCs are assumed to <i>not</i> be idempotent.
- ///
- /// If true, the gRPC library assumes that it's safe to initiate
- /// this RPC multiple times.
- void set_idempotent(bool idempotent) { idempotent_ = idempotent; }
-
- /// EXPERIMENTAL: Set this request to be cacheable.
- /// If set, grpc is free to use the HTTP GET verb for sending the request,
- /// with the possibility of receiving a cached response.
- void set_cacheable(bool cacheable) { cacheable_ = cacheable; }
-
- /// EXPERIMENTAL: Trigger wait-for-ready or not on this request.
+ /// Trigger wait-for-ready or not on this request.
/// See https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md.
/// If set, if an RPC is made when a channel's connectivity state is
/// TRANSIENT_FAILURE or CONNECTING, the call will not "fail fast",
@@ -422,37 +418,38 @@ class ClientContext {
ClientContext(const ClientContext&);
ClientContext& operator=(const ClientContext&);
- friend class ::grpc::testing::InteropClientContextInspector;
- friend class ::grpc::internal::CallOpClientRecvStatus;
- friend class ::grpc::internal::CallOpRecvInitialMetadata;
- friend class ::grpc::Channel;
+ friend class grpc::testing::InteropClientContextInspector;
+ friend class grpc::testing::ClientContextTestPeer;
+ friend class grpc::internal::CallOpClientRecvStatus;
+ friend class grpc::internal::CallOpRecvInitialMetadata;
+ friend class grpc::Channel;
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::ClientAsyncReader;
+ friend class grpc::ClientAsyncReader;
template <class W>
- friend class ::grpc::ClientAsyncWriter;
+ friend class grpc::ClientAsyncWriter;
template <class W, class R>
- friend class ::grpc::ClientAsyncReaderWriter;
+ friend class grpc::ClientAsyncReaderWriter;
template <class R>
- friend class ::grpc::ClientAsyncResponseReader;
- friend class ::grpc::internal::ClientAsyncResponseReaderHelper;
+ friend class grpc::ClientAsyncResponseReader;
+ friend class grpc::internal::ClientAsyncResponseReaderHelper;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::CallbackUnaryCallImpl;
+ friend class grpc::internal::CallbackUnaryCallImpl;
template <class Request, class Response>
- friend class ::grpc::internal::ClientCallbackReaderWriterImpl;
+ friend class grpc::internal::ClientCallbackReaderWriterImpl;
template <class Response>
- friend class ::grpc::internal::ClientCallbackReaderImpl;
+ friend class grpc::internal::ClientCallbackReaderImpl;
template <class Request>
- friend class ::grpc::internal::ClientCallbackWriterImpl;
- friend class ::grpc::internal::ClientCallbackUnaryImpl;
- friend class ::grpc::internal::ClientContextAccessor;
+ friend class grpc::internal::ClientCallbackWriterImpl;
+ friend class grpc::internal::ClientCallbackUnaryImpl;
+ friend class grpc::internal::ClientContextAccessor;
// Used by friend class CallOpClientRecvStatus
void set_debug_error_string(const std::string& debug_error_string) {
@@ -460,8 +457,7 @@ class ClientContext {
}
grpc_call* call() const { return call_; }
- void set_call(grpc_call* call,
- const std::shared_ptr<::grpc::Channel>& channel);
+ void set_call(grpc_call* call, const std::shared_ptr<grpc::Channel>& channel);
grpc::experimental::ClientRpcInfo* set_client_rpc_info(
const char* method, const char* suffix_for_stats,
@@ -476,9 +472,7 @@ class ClientContext {
}
uint32_t initial_metadata_flags() const {
- return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) |
- (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) |
- (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) |
+ return (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) |
(wait_for_ready_explicitly_set_
? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET
: 0) |
@@ -496,9 +490,7 @@ class ClientContext {
bool initial_metadata_received_;
bool wait_for_ready_;
bool wait_for_ready_explicitly_set_;
- bool idempotent_;
- bool cacheable_;
- std::shared_ptr<::grpc::Channel> channel_;
+ std::shared_ptr<grpc::Channel> channel_;
grpc::internal::Mutex mu_;
grpc_call* call_;
bool call_canceled_;
diff --git a/grpc/include/grpcpp/impl/codegen/client_interceptor.h b/grpc/include/grpcpp/impl/codegen/client_interceptor.h
index ec78074a..f3560b5a 100644
--- a/grpc/include/grpcpp/impl/codegen/client_interceptor.h
+++ b/grpc/include/grpcpp/impl/codegen/client_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/client_interceptor.h>
+
#include <memory>
#include <vector>
diff --git a/grpc/include/grpcpp/impl/codegen/client_unary_call.h b/grpc/include/grpcpp/impl/codegen/client_unary_call.h
index d41ea1ad..86adb3e3 100644
--- a/grpc/include/grpcpp/impl/codegen/client_unary_call.h
+++ b/grpc/include/grpcpp/impl/codegen/client_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/client_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/channel_interface.h>
@@ -58,10 +60,10 @@ class BlockingUnaryCallImpl {
BlockingUnaryCallImpl(ChannelInterface* channel, const RpcMethod& method,
grpc::ClientContext* context,
const InputMessage& request, OutputMessage* result) {
- ::grpc::CompletionQueue cq(grpc_completion_queue_attributes{
+ grpc::CompletionQueue cq(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}); // Pluckable completion queue
- ::grpc::internal::Call call(channel->CreateCall(method, context, &cq));
+ grpc::internal::Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
CallOpClientSendClose, CallOpClientRecvStatus>
diff --git a/grpc/include/grpcpp/impl/codegen/completion_queue.h b/grpc/include/grpcpp/impl/codegen/completion_queue.h
index d23e0e2b..33786f6e 100644
--- a/grpc/include/grpcpp/impl/codegen/completion_queue.h
+++ b/grpc/include/grpcpp/impl/codegen/completion_queue.h
@@ -32,6 +32,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
+// IWYU pragma: private, include <grpcpp/completion_queue.h>
+
#include <list>
#include <grpc/impl/codegen/atm.h>
@@ -62,8 +64,8 @@ class ServerReaderWriterBody;
template <class ResponseType>
void UnaryRunHandlerHelper(
- const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
- ::grpc::Status&);
+ const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
+ grpc::Status&);
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType, class BaseResponseType>
class RpcMethodHandler;
@@ -73,7 +75,7 @@ template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
class TemplatedBidiStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
} // namespace internal
@@ -99,7 +101,7 @@ extern CoreCodegenInterface* g_core_codegen_interface;
/// src/core/lib/surface/completion_queue.h).
/// See \ref doc/cpp/perf_notes.md for notes on best practices for high
/// performance servers.
-class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
+class CompletionQueue : private grpc::GrpcLibraryCodegen {
public:
/// Default constructor. Implicitly creates a \a grpc_completion_queue
/// instance.
@@ -115,7 +117,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// Destructor. Destroys the owned wrapped completion queue / instance.
~CompletionQueue() override {
- ::grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_);
+ grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_);
}
/// Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT.
@@ -175,9 +177,14 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// \return true if got an event, false if the queue is fully drained and
/// shut down.
bool Next(void** tag, bool* ok) {
+ // Check return type == GOT_EVENT... cases:
+ // SHUTDOWN - queue has been shutdown, return false.
+ // TIMEOUT - we passed infinity time => queue has been shutdown, return
+ // false.
+ // GOT_EVENT - we actually got an event, return true.
return (AsyncNextInternal(tag, ok,
- ::grpc::g_core_codegen_interface->gpr_inf_future(
- GPR_CLOCK_REALTIME)) != SHUTDOWN);
+ grpc::g_core_codegen_interface->gpr_inf_future(
+ GPR_CLOCK_REALTIME)) == GOT_EVENT);
}
/// Read from the queue, blocking up to \a deadline (or the queue's shutdown).
@@ -193,7 +200,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// \return The type of event read.
template <typename T>
NextStatus AsyncNext(void** tag, bool* ok, const T& deadline) {
- ::grpc::TimePoint<T> deadline_tp(deadline);
+ grpc::TimePoint<T> deadline_tp(deadline);
return AsyncNextInternal(tag, ok, deadline_tp.raw_time());
}
@@ -244,8 +251,8 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
protected:
/// Private constructor of CompletionQueue only visible to friend classes
explicit CompletionQueue(const grpc_completion_queue_attributes& attributes) {
- cq_ = ::grpc::g_core_codegen_interface->grpc_completion_queue_create(
- ::grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup(
+ cq_ = grpc::g_core_codegen_interface->grpc_completion_queue_create(
+ grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup(
&attributes),
&attributes, nullptr);
InitialAvalanching(); // reserve this for the future shutdown
@@ -254,46 +261,46 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
private:
// Friends for access to server registration lists that enable checking and
// logging on shutdown
- friend class ::grpc::ServerBuilder;
- friend class ::grpc::Server;
+ friend class grpc::ServerBuilder;
+ friend class grpc::Server;
// Friend synchronous wrappers so that they can access Pluck(), which is
// a semi-private API geared towards the synchronous implementation.
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::ServerReader;
+ friend class grpc::ServerReader;
template <class W>
- friend class ::grpc::ServerWriter;
+ friend class grpc::ServerWriter;
template <class W, class R>
- friend class ::grpc::internal::ServerReaderWriterBody;
+ friend class grpc::internal::ServerReaderWriterBody;
template <class ResponseType>
- friend void ::grpc::internal::UnaryRunHandlerHelper(
- const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
- ::grpc::Status&);
+ friend void grpc::internal::UnaryRunHandlerHelper(
+ const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
+ grpc::Status&);
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ClientStreamingHandler;
+ friend class grpc::internal::ClientStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ServerStreamingHandler;
+ friend class grpc::internal::ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
- friend class ::grpc::internal::TemplatedBidiStreamingHandler;
- template <::grpc::StatusCode code>
- friend class ::grpc::internal::ErrorMethodHandler;
- friend class ::grpc::ServerContextBase;
- friend class ::grpc::ServerInterface;
+ friend class grpc::internal::TemplatedBidiStreamingHandler;
+ template <grpc::StatusCode code>
+ friend class grpc::internal::ErrorMethodHandler;
+ friend class grpc::ServerContextBase;
+ friend class grpc::ServerInterface;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
// Friends that need access to constructor for callback CQ
- friend class ::grpc::Channel;
+ friend class grpc::Channel;
// For access to Register/CompleteAvalanching
template <class Op1, class Op2, class Op3, class Op4, class Op5, class Op6>
- friend class ::grpc::internal::CallOpSet;
+ friend class grpc::internal::CallOpSet;
/// EXPERIMENTAL
/// Creates a Thread Local cache to store the first event
@@ -314,11 +321,11 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// Wraps \a grpc_completion_queue_pluck.
/// \warning Must not be mixed with calls to \a Next.
- bool Pluck(::grpc::internal::CompletionQueueTag* tag) {
+ bool Pluck(grpc::internal::CompletionQueueTag* tag) {
auto deadline =
- ::grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME);
+ grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME);
while (true) {
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
bool ok = ev.success != 0;
void* ignored = tag;
@@ -337,10 +344,10 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// implementation to simple call the other TryPluck function with a zero
/// timeout. i.e:
/// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME))
- void TryPluck(::grpc::internal::CompletionQueueTag* tag) {
+ void TryPluck(grpc::internal::CompletionQueueTag* tag) {
auto deadline =
- ::grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT) return;
bool ok = ev.success != 0;
@@ -354,9 +361,9 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
///
/// This exects tag->FinalizeResult (if called) to return 'false' i.e expects
/// that the tag is internal not something that is returned to the user.
- void TryPluck(::grpc::internal::CompletionQueueTag* tag,
+ void TryPluck(grpc::internal::CompletionQueueTag* tag,
gpr_timespec deadline) {
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) {
return;
@@ -383,18 +390,18 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
void CompleteAvalanching() {
if (gpr_atm_no_barrier_fetch_add(&avalanches_in_flight_,
static_cast<gpr_atm>(-1)) == 1) {
- ::grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_);
+ grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_);
}
}
- void RegisterServer(const ::grpc::Server* server) {
+ void RegisterServer(const grpc::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
server_list_.push_back(server);
#endif
}
- void UnregisterServer(const ::grpc::Server* server) {
+ void UnregisterServer(const grpc::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
@@ -420,7 +427,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
// NDEBUG, instantiate it in all cases since otherwise the size will be
// inconsistent.
mutable grpc::internal::Mutex server_list_mutex_;
- std::list<const ::grpc::Server*>
+ std::list<const grpc::Server*>
server_list_ /* GUARDED_BY(server_list_mutex_) */;
};
@@ -443,15 +450,15 @@ class ServerCompletionQueue : public CompletionQueue {
/// \param shutdown_cb is the shutdown callback used for CALLBACK api queues
ServerCompletionQueue(grpc_cq_completion_type completion_type,
grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_cb)
+ grpc_completion_queue_functor* shutdown_cb)
: CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, completion_type, polling_type,
shutdown_cb}),
polling_type_(polling_type) {}
grpc_cq_polling_type polling_type_;
- friend class ::grpc::ServerBuilder;
- friend class ::grpc::Server;
+ friend class grpc::ServerBuilder;
+ friend class grpc::Server;
};
} // namespace grpc
diff --git a/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h b/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
index 304386a9..9af470b7 100644
--- a/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
+++ b/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/grpc/include/grpcpp/impl/codegen/config.h b/grpc/include/grpcpp/impl/codegen/config.h
index 0a8a9c13..d810cfae 100644
--- a/grpc/include/grpcpp/impl/codegen/config.h
+++ b/grpc/include/grpcpp/impl/codegen/config.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_H
+// IWYU pragma: private, include <grpcpp/support/config.h>
+
#include <string>
/// The following macros are deprecated and appear only for users
diff --git a/grpc/include/grpcpp/impl/codegen/config_protobuf.h b/grpc/include/grpcpp/impl/codegen/config_protobuf.h
index 49db4c5d..da874c58 100644
--- a/grpc/include/grpcpp/impl/codegen/config_protobuf.h
+++ b/grpc/include/grpcpp/impl/codegen/config_protobuf.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
+// IWYU pragma: private
+
#define GRPC_OPEN_SOURCE_PROTO
#ifndef GRPC_CUSTOM_MESSAGE
diff --git a/grpc/include/grpcpp/impl/codegen/core_codegen.h b/grpc/include/grpcpp/impl/codegen/core_codegen.h
index df2a03cd..e0440ffe 100644
--- a/grpc/include/grpcpp/impl/codegen/core_codegen.h
+++ b/grpc/include/grpcpp/impl/codegen/core_codegen.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
+// IWYU pragma: private
+
// This file should be compiled as part of grpcpp.
#include <grpc/byte_buffer.h>
@@ -70,6 +72,7 @@ class CoreCodegen final : public CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) override;
+ int grpc_call_failed_before_recv_message(const grpc_call* c) override;
void grpc_call_ref(grpc_call* call) override;
void grpc_call_unref(grpc_call* call) override;
void* grpc_call_arena_alloc(grpc_call* call, size_t length) override;
diff --git a/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h b/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
index c08cf6c6..0b23bf46 100644
--- a/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
+++ b/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc/impl/codegen/byte_buffer_reader.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -111,6 +113,7 @@ class CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) = 0;
+ virtual int grpc_call_failed_before_recv_message(const grpc_call* c) = 0;
virtual void grpc_call_ref(grpc_call* call) = 0;
virtual void grpc_call_unref(grpc_call* call) = 0;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0;
diff --git a/grpc/include/grpcpp/impl/codegen/create_auth_context.h b/grpc/include/grpcpp/impl/codegen/create_auth_context.h
index cb6095c3..817988f3 100644
--- a/grpc/include/grpcpp/impl/codegen/create_auth_context.h
+++ b/grpc/include/grpcpp/impl/codegen/create_auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
+// IWYU pragma: private
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/include/grpcpp/impl/codegen/delegating_channel.h b/grpc/include/grpcpp/impl/codegen/delegating_channel.h
index 0479567b..5e63d542 100644
--- a/grpc/include/grpcpp/impl/codegen/delegating_channel.h
+++ b/grpc/include/grpcpp/impl/codegen/delegating_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
+// IWYU pragma: private
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
@@ -26,26 +28,26 @@
namespace grpc {
namespace experimental {
-class DelegatingChannel : public ::grpc::ChannelInterface {
+class DelegatingChannel : public grpc::ChannelInterface {
public:
~DelegatingChannel() override {}
explicit DelegatingChannel(
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel)
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel)
: delegate_channel_(delegate_channel) {}
grpc_connectivity_state GetState(bool try_to_connect) override {
return delegate_channel()->GetState(try_to_connect);
}
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel() {
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel() {
return delegate_channel_;
}
private:
internal::Call CreateCall(const internal::RpcMethod& method,
ClientContext* context,
- ::grpc::CompletionQueue* cq) final {
+ grpc::CompletionQueue* cq) final {
return delegate_channel()->CreateCall(method, context, cq);
}
@@ -59,8 +61,7 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
tag);
@@ -73,17 +74,17 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
internal::Call CreateCallInternal(const internal::RpcMethod& method,
ClientContext* context,
- ::grpc::CompletionQueue* cq,
+ grpc::CompletionQueue* cq,
size_t interceptor_pos) final {
return delegate_channel()->CreateCallInternal(method, context, cq,
interceptor_pos);
}
- ::grpc::CompletionQueue* CallbackCQ() final {
+ grpc::CompletionQueue* CallbackCQ() final {
return delegate_channel()->CallbackCQ();
}
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel_;
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
};
} // namespace experimental
diff --git a/grpc/include/grpcpp/impl/codegen/grpc_library.h b/grpc/include/grpcpp/impl/codegen/grpc_library.h
index 660d6d0a..9f83a7f9 100644
--- a/grpc/include/grpcpp/impl/codegen/grpc_library.h
+++ b/grpc/include/grpcpp/impl/codegen/grpc_library.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
#define GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
+// IWYU pragma: private, include <grpcpp/impl/grpc_library.h>
+
#include <grpcpp/impl/codegen/core_codegen_interface.h>
namespace grpc {
diff --git a/grpc/include/grpcpp/impl/codegen/intercepted_channel.h b/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
index e3a4c8e7..57c97dd6 100644
--- a/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
+++ b/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/channel_interface.h>
namespace grpc {
@@ -46,8 +48,8 @@ class InterceptedChannel : public ChannelInterface {
InterceptedChannel(ChannelInterface* channel, size_t pos)
: channel_(channel), interceptor_pos_(pos) {}
- Call CreateCall(const RpcMethod& method, ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) override {
+ Call CreateCall(const RpcMethod& method, grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) override {
return channel_->CreateCallInternal(method, context, cq, interceptor_pos_);
}
@@ -59,8 +61,7 @@ class InterceptedChannel : public ChannelInterface {
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
return channel_->NotifyOnStateChangeImpl(last_observed, deadline, cq, tag);
}
@@ -69,7 +70,7 @@ class InterceptedChannel : public ChannelInterface {
return channel_->WaitForStateChangeImpl(last_observed, deadline);
}
- ::grpc::CompletionQueue* CallbackCQ() override {
+ grpc::CompletionQueue* CallbackCQ() override {
return channel_->CallbackCQ();
}
diff --git a/grpc/include/grpcpp/impl/codegen/interceptor.h b/grpc/include/grpcpp/impl/codegen/interceptor.h
index 58fb36c8..8faea760 100644
--- a/grpc/include/grpcpp/impl/codegen/interceptor.h
+++ b/grpc/include/grpcpp/impl/codegen/interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/interceptor.h>
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/include/grpcpp/impl/codegen/interceptor_common.h b/grpc/include/grpcpp/impl/codegen/interceptor_common.h
index b9a6eded..b084b7ce 100644
--- a/grpc/include/grpcpp/impl/codegen/interceptor_common.h
+++ b/grpc/include/grpcpp/impl/codegen/interceptor_common.h
@@ -19,17 +19,18 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
+// IWYU pragma: private
+
#include <array>
#include <functional>
+#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
#include <grpcpp/impl/codegen/intercepted_channel.h>
#include <grpcpp/impl/codegen/server_interceptor.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
namespace grpc {
namespace internal {
diff --git a/grpc/include/grpcpp/impl/codegen/message_allocator.h b/grpc/include/grpcpp/impl/codegen/message_allocator.h
index 4048ea11..440c7f1d 100644
--- a/grpc/include/grpcpp/impl/codegen/message_allocator.h
+++ b/grpc/include/grpcpp/impl/codegen/message_allocator.h
@@ -19,10 +19,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
#define GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
+// IWYU pragma: private, include <grpcpp/support/message_allocator.h>
+
namespace grpc {
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
// NOTE: This is an API for advanced users who need custom allocators.
// Per rpc struct for the allocator. This is the interface to return to user.
@@ -69,25 +68,6 @@ class MessageAllocator {
virtual MessageHolder<RequestT, ResponseT>* AllocateMessages() = 0;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-
-using ::grpc::RpcAllocatorState;
-
-template <typename RequestT, typename ResponseT>
-using MessageHolder = ::grpc::MessageHolder<RequestT, ResponseT>;
-
-template <typename RequestT, typename ResponseT>
-using MessageAllocator = ::grpc::MessageAllocator<RequestT, ResponseT>;
-
-} // namespace experimental
-#endif
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
diff --git a/grpc/include/grpcpp/impl/codegen/metadata_map.h b/grpc/include/grpcpp/impl/codegen/metadata_map.h
index 9b9957bb..931d682d 100644
--- a/grpc/include/grpcpp/impl/codegen/metadata_map.h
+++ b/grpc/include/grpcpp/impl/codegen/metadata_map.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
#define GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
+// IWYU pragma: private
+
#include <map>
#include <grpc/impl/codegen/log.h>
diff --git a/grpc/include/grpcpp/impl/codegen/method_handler.h b/grpc/include/grpcpp/impl/codegen/method_handler.h
index fb093f54..58056314 100644
--- a/grpc/include/grpcpp/impl/codegen/method_handler.h
+++ b/grpc/include/grpcpp/impl/codegen/method_handler.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
+// IWYU pragma: private, include <grpcpp/support/method_handler.h>
+
#include <grpcpp/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -41,8 +43,8 @@ template <class Callable>
try {
return handler();
} catch (...) {
- return ::grpc::Status(::grpc::StatusCode::UNKNOWN,
- "Unexpected error in RPC handling");
+ return grpc::Status(grpc::StatusCode::UNKNOWN,
+ "Unexpected error in RPC handling");
}
#else // GRPC_ALLOW_EXCEPTIONS
return handler();
@@ -55,11 +57,11 @@ template <class Callable>
template <class ResponseType>
void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param,
- ResponseType* rsp, ::grpc::Status& status) {
+ ResponseType* rsp, grpc::Status& status) {
GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
param.server_context->initial_metadata_flags());
@@ -77,11 +79,11 @@ void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param,
/// A helper function with reduced templating to do deserializing.
template <class RequestType>
-void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status,
+void* UnaryDeserializeHelper(grpc_byte_buffer* req, grpc::Status* status,
RequestType* request) {
- ::grpc::ByteBuffer buf;
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- *status = ::grpc::SerializationTraits<RequestType>::Deserialize(
+ *status = grpc::SerializationTraits<RequestType>::Deserialize(
&buf, static_cast<RequestType*>(request));
buf.Release();
if (status->ok()) {
@@ -95,22 +97,22 @@ void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status,
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType = RequestType,
class BaseResponseType = ResponseType>
-class RpcMethodHandler : public ::grpc::internal::MethodHandler {
+class RpcMethodHandler : public grpc::internal::MethodHandler {
public:
RpcMethodHandler(
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ResponseType*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
ResponseType rsp;
- ::grpc::Status status = param.status;
+ grpc::Status status = param.status;
if (status.ok()) {
status = CatchingFunctionHandler([this, &param, &rsp] {
return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context),
static_cast<RequestType*>(param.request), &rsp);
});
static_cast<RequestType*>(param.request)->~RequestType();
@@ -119,18 +121,17 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType;
+ grpc::Status* status, void** /*handler_data*/) final {
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType;
return UnaryDeserializeHelper(req, status,
static_cast<BaseRequestType*>(request));
}
private:
/// Application provided rpc handler function.
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ResponseType*)>
func_;
// The class the above handler function lives in.
ServiceType* service_;
@@ -138,29 +139,29 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler {
/// A wrapper class of an application provided client streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
-class ClientStreamingHandler : public ::grpc::internal::MethodHandler {
+class ClientStreamingHandler : public grpc::internal::MethodHandler {
public:
ClientStreamingHandler(
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- ServerReader<RequestType>*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ ServerReader<RequestType>*, ResponseType*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
ServerReader<RequestType> reader(
- param.call, static_cast<::grpc::ServerContext*>(param.server_context));
+ param.call, static_cast<grpc::ServerContext*>(param.server_context));
ResponseType rsp;
- ::grpc::Status status = CatchingFunctionHandler([this, &param, &reader,
- &rsp] {
- return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
- &reader, &rsp);
- });
-
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::Status status =
+ CatchingFunctionHandler([this, &param, &reader, &rsp] {
+ return func_(service_,
+ static_cast<grpc::ServerContext*>(param.server_context),
+ &reader, &rsp);
+ });
+
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -178,39 +179,38 @@ class ClientStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- ServerReader<RequestType>*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ ServerReader<RequestType>*, ResponseType*)>
func_;
ServiceType* service_;
};
/// A wrapper class of an application provided server streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
-class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
+class ServerStreamingHandler : public grpc::internal::MethodHandler {
public:
- ServerStreamingHandler(std::function<::grpc::Status(
- ServiceType*, ::grpc::ServerContext*,
+ ServerStreamingHandler(std::function<grpc::Status(
+ ServiceType*, grpc::ServerContext*,
const RequestType*, ServerWriter<ResponseType>*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::Status status = param.status;
+ grpc::Status status = param.status;
if (status.ok()) {
ServerWriter<ResponseType> writer(
- param.call,
- static_cast<::grpc::ServerContext*>(param.server_context));
+ param.call, static_cast<grpc::ServerContext*>(param.server_context));
status = CatchingFunctionHandler([this, &param, &writer] {
return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context),
static_cast<RequestType*>(param.request), &writer);
});
static_cast<RequestType*>(param.request)->~RequestType();
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -228,14 +228,13 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** /*handler_data*/) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType();
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
@@ -245,8 +244,8 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ServerWriter<ResponseType>*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ServerWriter<ResponseType>*)>
func_;
ServiceType* service_;
};
@@ -259,22 +258,22 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
/// Instead, it is expected to be an implicitly-captured argument of func
/// (through bind or something along those lines)
template <class Streamer, bool WriteNeeded>
-class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
+class TemplatedBidiStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit TemplatedBidiStreamingHandler(
- std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func)
+ std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func)
: func_(func), write_needed_(WriteNeeded) {}
void RunHandler(const HandlerParameter& param) final {
Streamer stream(param.call,
- static_cast<::grpc::ServerContext*>(param.server_context));
- ::grpc::Status status = CatchingFunctionHandler([this, &param, &stream] {
- return func_(static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context));
+ grpc::Status status = CatchingFunctionHandler([this, &param, &stream] {
+ return func_(static_cast<grpc::ServerContext*>(param.server_context),
&stream);
});
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -285,8 +284,8 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
if (write_needed_ && status.ok()) {
// If we needed a write but never did one, we need to mark the
// status as a fail
- status = ::grpc::Status(::grpc::StatusCode::INTERNAL,
- "Service did not provide response message");
+ status = grpc::Status(grpc::StatusCode::INTERNAL,
+ "Service did not provide response message");
}
}
ops.ServerSendStatus(&param.server_context->trailing_metadata_, status);
@@ -298,7 +297,7 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func_;
+ std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func_;
const bool write_needed_;
};
@@ -307,8 +306,8 @@ class BidiStreamingHandler
: public TemplatedBidiStreamingHandler<
ServerReaderWriter<ResponseType, RequestType>, false> {
public:
- BidiStreamingHandler(std::function<::grpc::Status(
- ServiceType*, ::grpc::ServerContext*,
+ BidiStreamingHandler(std::function<grpc::Status(
+ ServiceType*, grpc::ServerContext*,
ServerReaderWriter<ResponseType, RequestType>*)>
func,
ServiceType* service)
@@ -316,7 +315,7 @@ class BidiStreamingHandler
: TemplatedBidiStreamingHandler<
ServerReaderWriter<ResponseType, RequestType>, false>(
[func, service](
- ::grpc::ServerContext* ctx,
+ grpc::ServerContext* ctx,
ServerReaderWriter<ResponseType, RequestType>* streamer) {
return func(service, ctx, streamer);
}) {}
@@ -329,8 +328,8 @@ class StreamedUnaryHandler
public:
explicit StreamedUnaryHandler(
std::function<
- ::grpc::Status(::grpc::ServerContext*,
- ServerUnaryStreamer<RequestType, ResponseType>*)>
+ grpc::Status(grpc::ServerContext*,
+ ServerUnaryStreamer<RequestType, ResponseType>*)>
func)
: TemplatedBidiStreamingHandler<
ServerUnaryStreamer<RequestType, ResponseType>, true>(
@@ -344,8 +343,8 @@ class SplitServerStreamingHandler
public:
explicit SplitServerStreamingHandler(
std::function<
- ::grpc::Status(::grpc::ServerContext*,
- ServerSplitStreamer<RequestType, ResponseType>*)>
+ grpc::Status(grpc::ServerContext*,
+ ServerSplitStreamer<RequestType, ResponseType>*)>
func)
: TemplatedBidiStreamingHandler<
ServerSplitStreamer<RequestType, ResponseType>, false>(
@@ -354,15 +353,15 @@ class SplitServerStreamingHandler
/// General method handler class for errors that prevent real method use
/// e.g., handle unknown method by returning UNIMPLEMENTED error.
-template <::grpc::StatusCode code>
-class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
+template <grpc::StatusCode code>
+class ErrorMethodHandler : public grpc::internal::MethodHandler {
public:
explicit ErrorMethodHandler(const std::string& message) : message_(message) {}
template <class T>
- static void FillOps(::grpc::ServerContextBase* context,
+ static void FillOps(grpc::ServerContextBase* context,
const std::string& message, T* ops) {
- ::grpc::Status status(code, message);
+ grpc::Status status(code, message);
if (!context->sent_initial_metadata_) {
ops->SendInitialMetadata(&context->initial_metadata_,
context->initial_metadata_flags());
@@ -375,8 +374,8 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
FillOps(param.server_context, message_, &ops);
param.call->PerformOps(&ops);
@@ -384,10 +383,10 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* /*call*/, grpc_byte_buffer* req,
- ::grpc::Status* /*status*/, void** /*handler_data*/) final {
+ grpc::Status* /*status*/, void** /*handler_data*/) final {
// We have to destroy any request payload
if (req != nullptr) {
- ::grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req);
+ grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req);
}
return nullptr;
}
@@ -396,9 +395,9 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
const std::string message_;
};
-typedef ErrorMethodHandler<::grpc::StatusCode::UNIMPLEMENTED>
+typedef ErrorMethodHandler<grpc::StatusCode::UNIMPLEMENTED>
UnknownMethodHandler;
-typedef ErrorMethodHandler<::grpc::StatusCode::RESOURCE_EXHAUSTED>
+typedef ErrorMethodHandler<grpc::StatusCode::RESOURCE_EXHAUSTED>
ResourceExhaustedHandler;
} // namespace internal
diff --git a/grpc/include/grpcpp/impl/codegen/method_handler_impl.h b/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
index cc88a135..3f1d573b 100644
--- a/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
+++ b/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
@@ -19,4 +19,6 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
+// IWYU pragma: private
+
#endif // GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
diff --git a/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h b/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
index d25b79a4..ecc0e301 100644
--- a/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
+++ b/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_reader.h>
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
@@ -43,7 +45,7 @@ extern CoreCodegenInterface* g_core_codegen_interface;
///
/// Read more about ZeroCopyInputStream interface here:
/// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyInputStream
-class ProtoBufferReader : public ::grpc::protobuf::io::ZeroCopyInputStream {
+class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
public:
/// Constructs buffer reader from \a buffer. Will set \a status() to non ok
/// if \a buffer is invalid (the internal buffer has not been initialized).
diff --git a/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h b/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
index cd9d70c5..552c6a70 100644
--- a/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
+++ b/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_writer.h>
+
#include <type_traits>
#include <grpc/impl/codegen/grpc_types.h>
@@ -50,7 +52,7 @@ const int kProtoBufferWriterMaxBufferLength = 1024 * 1024;
///
/// Read more about ZeroCopyOutputStream interface here:
/// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyOutputStream
-class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
+class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
public:
/// Constructor for this derived class
///
@@ -116,6 +118,13 @@ class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
/// (only used in the last buffer). \a count must be less than or equal too
/// the last buffer returned from next.
void BackUp(int count) override {
+ // count == 0 is invoked by ZeroCopyOutputStream users indicating that any
+ // potential buffer obtained through a previous call to Next() is final.
+ // ZeroCopyOutputStream implementations such as streaming output can use
+ // these calls to flush any temporary buffer and flush the output. The logic
+ // below is not robust against count == 0 invocations, so directly return.
+ if (count == 0) return;
+
/// 1. Remove the partially-used last slice from the slice buffer
/// 2. Split it into the needed (if any) and unneeded part
/// 3. Add the needed part back to the slice buffer
diff --git a/grpc/include/grpcpp/impl/codegen/proto_utils.h b/grpc/include/grpcpp/impl/codegen/proto_utils.h
index 7f5c6e9a..4f6d8741 100644
--- a/grpc/include/grpcpp/impl/codegen/proto_utils.h
+++ b/grpc/include/grpcpp/impl/codegen/proto_utils.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
#define GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
+// IWYU pragma: private
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
diff --git a/grpc/include/grpcpp/impl/codegen/rpc_method.h b/grpc/include/grpcpp/impl/codegen/rpc_method.h
index 388784e6..83dedda4 100644
--- a/grpc/include/grpcpp/impl/codegen/rpc_method.h
+++ b/grpc/include/grpcpp/impl/codegen/rpc_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_method.h>
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
diff --git a/grpc/include/grpcpp/impl/codegen/rpc_service_method.h b/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
index 4fcc2112..6f6730a1 100644
--- a/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
+++ b/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_service_method.h>
+
#include <climits>
#include <functional>
#include <map>
@@ -49,7 +51,7 @@ class MethodHandler {
/// \param requester : used only by the callback API. It is a function
/// called by the RPC Controller to request another RPC (and also
/// to set up the state required to make that request possible)
- HandlerParameter(Call* c, ::grpc::ServerContextBase* context, void* req,
+ HandlerParameter(Call* c, grpc::ServerContextBase* context, void* req,
Status req_status, void* handler_data,
std::function<void()> requester)
: call(c),
@@ -60,7 +62,7 @@ class MethodHandler {
call_requester(std::move(requester)) {}
~HandlerParameter() {}
Call* const call;
- ::grpc::ServerContextBase* const server_context;
+ grpc::ServerContextBase* const server_context;
void* const request;
const Status status;
void* const internal_data;
diff --git a/grpc/include/grpcpp/impl/codegen/security/auth_context.h b/grpc/include/grpcpp/impl/codegen/security/auth_context.h
index cea6dbea..d834ec16 100644
--- a/grpc/include/grpcpp/impl/codegen/security/auth_context.h
+++ b/grpc/include/grpcpp/impl/codegen/security/auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/security/auth_context.h>
+
#include <iterator>
#include <vector>
diff --git a/grpc/include/grpcpp/impl/codegen/serialization_traits.h b/grpc/include/grpcpp/impl/codegen/serialization_traits.h
index 8f792232..3148dffc 100644
--- a/grpc/include/grpcpp/impl/codegen/serialization_traits.h
+++ b/grpc/include/grpcpp/impl/codegen/serialization_traits.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
+// IWYU pragma: private, include <grpcpp/impl/serialization_traits.h>
+
namespace grpc {
/// Defines how to serialize and deserialize some type.
diff --git a/grpc/include/grpcpp/impl/codegen/server_callback.h b/grpc/include/grpcpp/impl/codegen/server_callback.h
index 3ccabdbb..d292e7b0 100644
--- a/grpc/include/grpcpp/impl/codegen/server_callback.h
+++ b/grpc/include/grpcpp/impl/codegen/server_callback.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
+// IWYU pragma: private, include <grpcpp/support/server_callback.h>
+
#include <atomic>
#include <functional>
#include <type_traits>
@@ -158,8 +160,7 @@ class ServerCallbackCall {
};
template <class Request, class Response>
-class DefaultMessageHolder
- : public ::grpc::experimental::MessageHolder<Request, Response> {
+class DefaultMessageHolder : public MessageHolder<Request, Response> {
public:
DefaultMessageHolder() {
this->set_request(&request_obj_);
@@ -192,7 +193,7 @@ class ServerBidiReactor;
class ServerCallbackUnary : public internal::ServerCallbackCall {
public:
~ServerCallbackUnary() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
protected:
@@ -208,7 +209,7 @@ template <class Request>
class ServerCallbackReader : public internal::ServerCallbackCall {
public:
~ServerCallbackReader() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
virtual void Read(Request* msg) = 0;
@@ -223,11 +224,11 @@ class ServerCallbackWriter : public internal::ServerCallbackCall {
public:
~ServerCallbackWriter() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
- virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0;
- virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options,
- ::grpc::Status s) = 0;
+ virtual void Write(const Response* msg, grpc::WriteOptions options) = 0;
+ virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options,
+ grpc::Status s) = 0;
protected:
void BindReactor(ServerWriteReactor<Response>* reactor) {
@@ -240,12 +241,12 @@ class ServerCallbackReaderWriter : public internal::ServerCallbackCall {
public:
~ServerCallbackReaderWriter() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
virtual void Read(Request* msg) = 0;
- virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0;
- virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options,
- ::grpc::Status s) = 0;
+ virtual void Write(const Response* msg, grpc::WriteOptions options) = 0;
+ virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options,
+ grpc::Status s) = 0;
protected:
void BindReactor(ServerBidiReactor<Request, Response>* reactor) {
@@ -317,7 +318,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
void StartWrite(const Response* resp) {
- StartWrite(resp, ::grpc::WriteOptions());
+ StartWrite(resp, grpc::WriteOptions());
}
/// Initiate a write operation with specified options.
@@ -326,7 +327,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWrite(const Response* resp, ::grpc::WriteOptions options)
+ void StartWrite(const Response* resp, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
@@ -355,8 +356,8 @@ class ServerBidiReactor : public internal::ServerReactor {
/// not deleted or modified until OnDone is called.
/// \param[in] options The WriteOptions to use for writing this message
/// \param[in] s The status outcome of this RPC
- void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
+ void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options,
+ grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
if (stream == nullptr) {
@@ -381,7 +382,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Response* resp, grpc::WriteOptions options) {
StartWrite(resp, options.set_last_message());
}
@@ -391,7 +392,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// cancelled.
///
/// \param[in] s The status outcome of this RPC
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
if (stream == nullptr) {
@@ -480,8 +481,8 @@ class ServerBidiReactor : public internal::ServerReactor {
bool finish_wanted = false;
Request* read_wanted = nullptr;
const Response* write_wanted = nullptr;
- ::grpc::WriteOptions write_options_wanted;
- ::grpc::Status status_wanted;
+ grpc::WriteOptions write_options_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(stream_mu_);
};
@@ -520,7 +521,7 @@ class ServerReadReactor : public internal::ServerReactor {
}
reader->Read(req);
}
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(reader_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(reader_mu_) {
ServerCallbackReader<Request>* reader =
reader_.load(std::memory_order_acquire);
if (reader == nullptr) {
@@ -569,7 +570,7 @@ class ServerReadReactor : public internal::ServerReactor {
bool send_initial_metadata_wanted = false;
bool finish_wanted = false;
Request* read_wanted = nullptr;
- ::grpc::Status status_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(reader_mu_);
};
@@ -596,9 +597,9 @@ class ServerWriteReactor : public internal::ServerReactor {
writer->SendInitialMetadata();
}
void StartWrite(const Response* resp) {
- StartWrite(resp, ::grpc::WriteOptions());
+ StartWrite(resp, grpc::WriteOptions());
}
- void StartWrite(const Response* resp, ::grpc::WriteOptions options)
+ void StartWrite(const Response* resp, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
@@ -613,8 +614,8 @@ class ServerWriteReactor : public internal::ServerReactor {
}
writer->Write(resp, options);
}
- void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
+ void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options,
+ grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
if (writer == nullptr) {
@@ -630,10 +631,10 @@ class ServerWriteReactor : public internal::ServerReactor {
}
writer->WriteAndFinish(resp, options, std::move(s));
}
- void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Response* resp, grpc::WriteOptions options) {
StartWrite(resp, options.set_last_message());
}
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
if (writer == nullptr) {
@@ -689,8 +690,8 @@ class ServerWriteReactor : public internal::ServerReactor {
bool write_and_finish_wanted = false;
bool finish_wanted = false;
const Response* write_wanted = nullptr;
- ::grpc::WriteOptions write_options_wanted;
- ::grpc::Status status_wanted;
+ grpc::WriteOptions write_options_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(writer_mu_);
};
@@ -716,7 +717,7 @@ class ServerUnaryReactor : public internal::ServerReactor {
/// Finish is similar to ServerBidiReactor except for one detail.
/// If the status is non-OK, any message will not be sent. Instead,
/// the client will only receive the status and any trailing metadata.
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(call_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(call_mu_) {
ServerCallbackUnary* call = call_.load(std::memory_order_acquire);
if (call == nullptr) {
grpc::internal::MutexLock l(&call_mu_);
@@ -758,7 +759,7 @@ class ServerUnaryReactor : public internal::ServerReactor {
struct PreBindBacklog {
bool send_initial_metadata_wanted = false;
bool finish_wanted = false;
- ::grpc::Status status_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(call_mu_);
};
@@ -768,7 +769,7 @@ namespace internal {
template <class Base>
class FinishOnlyReactor : public Base {
public:
- explicit FinishOnlyReactor(::grpc::Status s) { this->Finish(std::move(s)); }
+ explicit FinishOnlyReactor(grpc::Status s) { this->Finish(std::move(s)); }
void OnDone() override { this->~FinishOnlyReactor(); }
};
@@ -784,20 +785,13 @@ using UnimplementedBidiReactor =
} // namespace internal
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
+// TODO(vjpai): Remove namespace experimental when last known users are migrated
+// off.
namespace experimental {
-template <class Request>
-using ServerReadReactor = ::grpc::ServerReadReactor<Request>;
-
-template <class Response>
-using ServerWriteReactor = ::grpc::ServerWriteReactor<Response>;
-
template <class Request, class Response>
using ServerBidiReactor = ::grpc::ServerBidiReactor<Request, Response>;
-using ServerUnaryReactor = ::grpc::ServerUnaryReactor;
-
} // namespace experimental
} // namespace grpc
diff --git a/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h b/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
index 76e655a9..eac524f6 100644
--- a/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
+++ b/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
@@ -28,49 +30,48 @@ namespace grpc {
namespace internal {
template <class RequestType, class ResponseType>
-class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
+class CallbackUnaryHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackUnaryHandler(
- std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*,
+ std::function<ServerUnaryReactor*(grpc::CallbackServerContext*,
const RequestType*, ResponseType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void SetMessageAllocator(
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator) {
+ MessageAllocator<RequestType, ResponseType>* allocator) {
allocator_ = allocator;
}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a controller structure (that includes request/response)
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* allocator_state = static_cast<
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*>(
- param.internal_data);
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ auto* allocator_state =
+ static_cast<MessageHolder<RequestType, ResponseType>*>(
+ param.internal_data);
- auto* call = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* call = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackUnaryImpl)))
ServerCallbackUnaryImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, allocator_state, param.call_requester);
param.server_context->BeginCompletionOp(
param.call, [call](bool) { call->MaybeDone(); }, call);
ServerUnaryReactor* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<ServerUnaryReactor>(
+ reactor = grpc::internal::CatchingReactorGetter<ServerUnaryReactor>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
call->request(), call->response());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedUnaryReactor)))
UnimplementedUnaryReactor(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
/// Invoke SetupReactor as the last part of the handler
@@ -78,43 +79,39 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** handler_data) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** handler_data) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
RequestType* request = nullptr;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state = nullptr;
+ MessageHolder<RequestType, ResponseType>* allocator_state;
if (allocator_ != nullptr) {
allocator_state = allocator_->AllocateMessages();
} else {
allocator_state =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call, sizeof(DefaultMessageHolder<RequestType, ResponseType>)))
DefaultMessageHolder<RequestType, ResponseType>();
}
*handler_data = allocator_state;
request = allocator_state->request();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
}
- // Clean up on deserialization failure.
- allocator_state->Release();
return nullptr;
}
private:
- std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*,
+ std::function<ServerUnaryReactor*(grpc::CallbackServerContext*,
const RequestType*, ResponseType*)>
get_reactor_;
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator_ = nullptr;
+ MessageAllocator<RequestType, ResponseType>* allocator_ = nullptr;
class ServerCallbackUnaryImpl : public ServerCallbackUnary {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A callback that only contains a call to MaybeDone can be run as an
// inline callback regardless of whether or not OnDone is inlineable
// because if the actual OnDone callback needs to be scheduled, MaybeDone
@@ -180,9 +177,8 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
friend class CallbackUnaryHandler<RequestType, ResponseType>;
ServerCallbackUnaryImpl(
- ::grpc::CallbackServerContext* ctx, ::grpc::internal::Call* call,
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state,
+ grpc::CallbackServerContext* ctx, grpc::internal::Call* call,
+ MessageHolder<RequestType, ResponseType>* allocator_state,
std::function<void()> call_requester)
: ctx_(ctx),
call_(*call),
@@ -214,7 +210,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackUnaryImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -222,19 +218,18 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>* const
- allocator_state_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
+ MessageHolder<RequestType, ResponseType>* const allocator_state_;
std::function<void()> call_requester_;
// reactor_ can always be loaded/stored with relaxed memory ordering because
// its value is only set once, independently of other data in the object,
@@ -254,21 +249,21 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
+class CallbackClientStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackClientStreamingHandler(
std::function<ServerReadReactor<RequestType>*(
- ::grpc::CallbackServerContext*, ResponseType*)>
+ grpc::CallbackServerContext*, ResponseType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a reader structure (that includes response)
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* reader = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* reader = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackReaderImpl)))
ServerCallbackReaderImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
// is no read reactor that has an inlineable OnDone; this only applies to
@@ -280,32 +275,32 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
ServerReadReactor<RequestType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
- ServerReadReactor<RequestType>>(
- get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
- reader->response());
+ reactor =
+ grpc::internal::CatchingReactorGetter<ServerReadReactor<RequestType>>(
+ get_reactor_,
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
+ reader->response());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedReadReactor<RequestType>)))
UnimplementedReadReactor<RequestType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
reader->SetupReactor(reactor);
}
private:
- std::function<ServerReadReactor<RequestType>*(::grpc::CallbackServerContext*,
+ std::function<ServerReadReactor<RequestType>*(grpc::CallbackServerContext*,
ResponseType*)>
get_reactor_;
class ServerCallbackReaderImpl : public ServerCallbackReader<RequestType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -371,8 +366,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackClientStreamingHandler<RequestType, ResponseType>;
- ServerCallbackReaderImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
+ ServerCallbackReaderImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call,
std::function<void()> call_requester)
: ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {}
@@ -384,6 +379,9 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
@@ -409,7 +407,7 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -417,21 +415,20 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<RequestType>>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>>
read_ops_;
- ::grpc::internal::CallbackWithSuccessTag read_tag_;
+ grpc::internal::CallbackWithSuccessTag read_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
ResponseType resp_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
@@ -443,21 +440,21 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
+class CallbackServerStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackServerStreamingHandler(
std::function<ServerWriteReactor<ResponseType>*(
- ::grpc::CallbackServerContext*, const RequestType*)>
+ grpc::CallbackServerContext*, const RequestType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a writer structure
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* writer = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* writer = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackWriterImpl)))
ServerCallbackWriterImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, static_cast<RequestType*>(param.request),
param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
@@ -470,32 +467,31 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
ServerWriteReactor<ResponseType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
+ reactor = grpc::internal::CatchingReactorGetter<
ServerWriteReactor<ResponseType>>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
writer->request());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedWriteReactor<ResponseType>)))
UnimplementedWriteReactor<ResponseType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
writer->SetupReactor(reactor);
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** /*handler_data*/) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType();
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
@@ -505,13 +501,13 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<ServerWriteReactor<ResponseType>*(
- ::grpc::CallbackServerContext*, const RequestType*)>
+ std::function<ServerWriteReactor<ResponseType>*(grpc::CallbackServerContext*,
+ const RequestType*)>
get_reactor_;
class ServerCallbackWriterImpl : public ServerCallbackWriter<ResponseType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -563,8 +559,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&meta_ops_);
}
- void Write(const ResponseType* resp,
- ::grpc::WriteOptions options) override {
+ void Write(const ResponseType* resp, grpc::WriteOptions options) override {
this->Ref();
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -582,8 +577,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&write_ops_);
}
- void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) override {
+ void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options,
+ grpc::Status s) override {
// This combines the write into the finish callback
// TODO(vjpai): don't assert
GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok());
@@ -593,9 +588,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackServerStreamingHandler<RequestType, ResponseType>;
- ServerCallbackWriterImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
- const RequestType* req,
+ ServerCallbackWriterImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call, const RequestType* req,
std::function<void()> call_requester)
: ctx_(ctx),
call_(*call),
@@ -638,7 +632,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackWriterImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -646,21 +640,21 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
write_ops_;
- ::grpc::internal::CallbackWithSuccessTag write_tag_;
+ grpc::internal::CallbackWithSuccessTag write_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
const RequestType* req_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
@@ -672,20 +666,20 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
+class CallbackBidiHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackBidiHandler(
std::function<ServerBidiReactor<RequestType, ResponseType>*(
- ::grpc::CallbackServerContext*)>
+ grpc::CallbackServerContext*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* stream = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* stream = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackReaderWriterImpl)))
ServerCallbackReaderWriterImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
// is no bidi reactor that has an inlineable OnDone; this only applies to
@@ -697,19 +691,19 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
ServerBidiReactor<RequestType, ResponseType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
+ reactor = grpc::internal::CatchingReactorGetter<
ServerBidiReactor<RequestType, ResponseType>>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context));
+ static_cast<grpc::CallbackServerContext*>(param.server_context));
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(),
sizeof(UnimplementedBidiReactor<RequestType, ResponseType>)))
UnimplementedBidiReactor<RequestType, ResponseType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
stream->SetupReactor(reactor);
@@ -717,13 +711,13 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
private:
std::function<ServerBidiReactor<RequestType, ResponseType>*(
- ::grpc::CallbackServerContext*)>
+ grpc::CallbackServerContext*)>
get_reactor_;
class ServerCallbackReaderWriterImpl
: public ServerCallbackReaderWriter<RequestType, ResponseType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -775,8 +769,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&meta_ops_);
}
- void Write(const ResponseType* resp,
- ::grpc::WriteOptions options) override {
+ void Write(const ResponseType* resp, grpc::WriteOptions options) override {
this->Ref();
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -794,8 +787,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&write_ops_);
}
- void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) override {
+ void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options,
+ grpc::Status s) override {
// TODO(vjpai): don't assert
GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok());
Finish(std::move(s));
@@ -810,8 +803,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackBidiHandler<RequestType, ResponseType>;
- ServerCallbackReaderWriterImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
+ ServerCallbackReaderWriterImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call,
std::function<void()> call_requester)
: ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {}
@@ -831,6 +824,9 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
@@ -852,7 +848,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderWriterImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -860,25 +856,24 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
write_ops_;
- ::grpc::internal::CallbackWithSuccessTag write_tag_;
- ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<RequestType>>
+ grpc::internal::CallbackWithSuccessTag write_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>>
read_ops_;
- ::grpc::internal::CallbackWithSuccessTag read_tag_;
+ grpc::internal::CallbackWithSuccessTag read_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
std::atomic<ServerBidiReactor<RequestType, ResponseType>*> reactor_;
diff --git a/grpc/include/grpcpp/impl/codegen/server_context.h b/grpc/include/grpcpp/impl/codegen/server_context.h
index cbbd2291..30da8a1e 100644
--- a/grpc/include/grpcpp/impl/codegen/server_context.h
+++ b/grpc/include/grpcpp/impl/codegen/server_context.h
@@ -19,6 +19,10 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/server_context.h>
+
+#include <grpc/impl/codegen/port_platform.h>
+
#include <atomic>
#include <cassert>
#include <map>
@@ -26,8 +30,6 @@
#include <type_traits>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/impl/codegen/compression_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
@@ -63,6 +65,8 @@ class ServerReader;
template <class W>
class ServerWriter;
+extern CoreCodegenInterface* g_core_codegen_interface;
+
namespace internal {
template <class ServiceType, class RequestType, class ResponseType>
class BidiStreamingHandler;
@@ -91,7 +95,7 @@ class ServerStreamingHandler;
class ServerReactor;
template <class Streamer, bool WriteNeeded>
class TemplatedBidiStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
} // namespace internal
@@ -101,22 +105,8 @@ class GenericServerContext;
class Server;
class ServerInterface;
class ContextAllocator;
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-typedef ::grpc::ServerContextBase ServerContextBase;
-typedef ::grpc::CallbackServerContext CallbackServerContext;
-
-} // namespace experimental
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class GenericCallbackServerContext;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
+
namespace internal {
class Call;
} // namespace internal
@@ -127,14 +117,14 @@ class ServerContextTestSpouse;
class DefaultReactorTestPeer;
} // namespace testing
-/// Base class of ServerContext. Experimental until callback API is final.
+/// Base class of ServerContext.
class ServerContextBase {
public:
virtual ~ServerContextBase();
/// Return the deadline for the server call.
std::chrono::system_clock::time_point deadline() const {
- return ::grpc::Timespec2Timepoint(deadline_);
+ return grpc::Timespec2Timepoint(deadline_);
}
/// Return a \a gpr_timespec representation of the server call's deadline.
@@ -154,11 +144,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddInitialMetadata(const std::string& key, const std::string& value);
/// Add the (\a key, \a value) pair to the initial metadata
@@ -175,11 +169,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddTrailingMetadata(const std::string& key, const std::string& value);
/// Return whether this RPC failed before the server could provide its status
@@ -265,9 +263,9 @@ class ServerContextBase {
/// Return the authentication context for this server call.
///
/// \see grpc::AuthContext.
- std::shared_ptr<const ::grpc::AuthContext> auth_context() const {
+ std::shared_ptr<const grpc::AuthContext> auth_context() const {
if (auth_context_ == nullptr) {
- auth_context_ = ::grpc::CreateAuthContext(call_.call);
+ auth_context_ = grpc::CreateAuthContext(call_.call);
}
return auth_context_;
}
@@ -299,10 +297,7 @@ class ServerContextBase {
/// NOTE: This is an API for advanced users who need custom allocators.
/// Get and maybe mutate the allocator state associated with the current RPC.
/// Currently only applicable for callback unary RPC methods.
- /// WARNING: This is experimental API and could be changed or removed.
- ::grpc::experimental::RpcAllocatorState* GetRpcAllocatorState() {
- return message_allocator_state_;
- }
+ RpcAllocatorState* GetRpcAllocatorState() { return message_allocator_state_; }
/// Get a library-owned default unary reactor for use in minimal reaction
/// cases. This supports typical unary RPC usage of providing a response and
@@ -318,9 +313,7 @@ class ServerContextBase {
///
/// This method should not be called more than once or called after return
/// from the method handler.
- ///
- /// WARNING: This is experimental API and could be changed or removed.
- ::grpc::ServerUnaryReactor* DefaultReactor() {
+ grpc::ServerUnaryReactor* DefaultReactor() {
// Short-circuit the case where a default reactor was already set up by
// the TestPeer.
if (test_unary_ != nullptr) {
@@ -348,57 +341,53 @@ class ServerContextBase {
ContextAllocator* context_allocator() const { return context_allocator_; }
private:
- friend class ::grpc::testing::InteropServerContextInspector;
- friend class ::grpc::testing::ServerContextTestSpouse;
- friend class ::grpc::testing::DefaultReactorTestPeer;
- friend class ::grpc::ServerInterface;
- friend class ::grpc::Server;
+ friend class grpc::testing::InteropServerContextInspector;
+ friend class grpc::testing::ServerContextTestSpouse;
+ friend class grpc::testing::DefaultReactorTestPeer;
+ friend class grpc::ServerInterface;
+ friend class grpc::Server;
template <class W, class R>
- friend class ::grpc::ServerAsyncReader;
+ friend class grpc::ServerAsyncReader;
template <class W>
- friend class ::grpc::ServerAsyncWriter;
+ friend class grpc::ServerAsyncWriter;
template <class W>
- friend class ::grpc::ServerAsyncResponseWriter;
+ friend class grpc::ServerAsyncResponseWriter;
template <class W, class R>
- friend class ::grpc::ServerAsyncReaderWriter;
+ friend class grpc::ServerAsyncReaderWriter;
template <class R>
- friend class ::grpc::ServerReader;
+ friend class grpc::ServerReader;
template <class W>
- friend class ::grpc::ServerWriter;
+ friend class grpc::ServerWriter;
template <class W, class R>
- friend class ::grpc::internal::ServerReaderWriterBody;
+ friend class grpc::internal::ServerReaderWriterBody;
template <class ResponseType>
- friend void ::grpc::internal::UnaryRunHandlerHelper(
+ friend void grpc::internal::UnaryRunHandlerHelper(
const internal::MethodHandler::HandlerParameter& param, ResponseType* rsp,
Status& status);
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType, class BaseResponseType>
- friend class ::grpc::internal::RpcMethodHandler;
+ friend class grpc::internal::RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ClientStreamingHandler;
+ friend class grpc::internal::ClientStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ServerStreamingHandler;
+ friend class grpc::internal::ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
- friend class ::grpc::internal::TemplatedBidiStreamingHandler;
+ friend class grpc::internal::TemplatedBidiStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackUnaryHandler;
+ friend class grpc::internal::CallbackUnaryHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackClientStreamingHandler;
+ friend class grpc::internal::CallbackClientStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackServerStreamingHandler;
+ friend class grpc::internal::CallbackServerStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackBidiHandler;
- template <::grpc::StatusCode code>
- friend class ::grpc::internal::ErrorMethodHandler;
+ friend class grpc::internal::CallbackBidiHandler;
+ template <grpc::StatusCode code>
+ friend class grpc::internal::ErrorMethodHandler;
template <class Base>
- friend class ::grpc::internal::FinishOnlyReactor;
- friend class ::grpc::ClientContext;
- friend class ::grpc::GenericServerContext;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
- friend class ::grpc::GenericCallbackServerContext;
-#else
- friend class ::grpc::experimental::GenericCallbackServerContext;
-#endif
+ friend class grpc::internal::FinishOnlyReactor;
+ friend class grpc::ClientContext;
+ friend class grpc::GenericServerContext;
+ friend class grpc::GenericCallbackServerContext;
/// Prevent copying.
ServerContextBase(const ServerContextBase&);
@@ -407,10 +396,10 @@ class ServerContextBase {
class CompletionOp;
void BeginCompletionOp(
- ::grpc::internal::Call* call, std::function<void(bool)> callback,
- ::grpc::internal::ServerCallbackCall* callback_controller);
+ grpc::internal::Call* call, std::function<void(bool)> callback,
+ grpc::internal::ServerCallbackCall* callback_controller);
/// Return the tag queued by BeginCompletionOp()
- ::grpc::internal::CompletionQueueTag* GetCompletionOpTag();
+ grpc::internal::CompletionQueueTag* GetCompletionOpTag();
void set_call(grpc_call* call) { call_.call = call; }
@@ -418,22 +407,28 @@ class ServerContextBase {
uint32_t initial_metadata_flags() const { return 0; }
- ::grpc::experimental::ServerRpcInfo* set_server_rpc_info(
- const char* method, ::grpc::internal::RpcMethod::RpcType type,
+ grpc::experimental::ServerRpcInfo* set_server_rpc_info(
+ const char* method, grpc::internal::RpcMethod::RpcType type,
const std::vector<std::unique_ptr<
- ::grpc::experimental::ServerInterceptorFactoryInterface>>& creators) {
+ grpc::experimental::ServerInterceptorFactoryInterface>>& creators) {
if (!creators.empty()) {
- rpc_info_ = new ::grpc::experimental::ServerRpcInfo(this, method, type);
+ rpc_info_ = new grpc::experimental::ServerRpcInfo(this, method, type);
rpc_info_->RegisterInterceptors(creators);
}
return rpc_info_;
}
- void set_message_allocator_state(
- ::grpc::experimental::RpcAllocatorState* allocator_state) {
+ void set_message_allocator_state(RpcAllocatorState* allocator_state) {
message_allocator_state_ = allocator_state;
}
+ void MaybeMarkCancelledOnRead() {
+ if (g_core_codegen_interface->grpc_call_failed_before_recv_message(
+ call_.call)) {
+ marked_cancelled_.store(true, std::memory_order_release);
+ }
+ }
+
struct CallWrapper {
~CallWrapper();
@@ -449,13 +444,13 @@ class ServerContextBase {
CompletionOp* completion_op_ = nullptr;
bool has_notify_when_done_tag_ = false;
void* async_notify_when_done_tag_ = nullptr;
- ::grpc::internal::CallbackWithSuccessTag completion_tag_;
+ grpc::internal::CallbackWithSuccessTag completion_tag_;
gpr_timespec deadline_;
- ::grpc::CompletionQueue* cq_ = nullptr;
+ grpc::CompletionQueue* cq_ = nullptr;
bool sent_initial_metadata_ = false;
- mutable std::shared_ptr<const ::grpc::AuthContext> auth_context_;
- mutable ::grpc::internal::MetadataMap client_metadata_;
+ mutable std::shared_ptr<const grpc::AuthContext> auth_context_;
+ mutable grpc::internal::MetadataMap client_metadata_;
std::multimap<std::string, std::string> initial_metadata_;
std::multimap<std::string, std::string> trailing_metadata_;
@@ -463,16 +458,16 @@ class ServerContextBase {
grpc_compression_level compression_level_;
grpc_compression_algorithm compression_algorithm_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
pending_ops_;
bool has_pending_ops_ = false;
- ::grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
- ::grpc::experimental::RpcAllocatorState* message_allocator_state_ = nullptr;
+ grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
+ RpcAllocatorState* message_allocator_state_ = nullptr;
ContextAllocator* context_allocator_ = nullptr;
- class Reactor : public ::grpc::ServerUnaryReactor {
+ class Reactor : public grpc::ServerUnaryReactor {
public:
void OnCancel() override {}
void OnDone() override {}
@@ -483,23 +478,23 @@ class ServerContextBase {
bool InternalInlineable() override { return true; }
};
- void SetupTestDefaultReactor(std::function<void(::grpc::Status)> func) {
+ void SetupTestDefaultReactor(std::function<void(grpc::Status)> func) {
// NOLINTNEXTLINE(modernize-make-unique)
test_unary_.reset(new TestServerCallbackUnary(this, std::move(func)));
}
bool test_status_set() const {
return (test_unary_ != nullptr) && test_unary_->status_set();
}
- ::grpc::Status test_status() const { return test_unary_->status(); }
+ grpc::Status test_status() const { return test_unary_->status(); }
- class TestServerCallbackUnary : public ::grpc::ServerCallbackUnary {
+ class TestServerCallbackUnary : public grpc::ServerCallbackUnary {
public:
TestServerCallbackUnary(ServerContextBase* ctx,
- std::function<void(::grpc::Status)> func)
+ std::function<void(grpc::Status)> func)
: reactor_(ctx->DefaultReactor()), func_(std::move(func)) {
this->BindReactor(reactor_);
}
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
status_ = s;
func_(std::move(s));
status_set_.store(true, std::memory_order_release);
@@ -509,21 +504,24 @@ class ServerContextBase {
bool status_set() const {
return status_set_.load(std::memory_order_acquire);
}
- ::grpc::Status status() const { return status_; }
+ grpc::Status status() const { return status_; }
private:
void CallOnDone() override {}
- ::grpc::internal::ServerReactor* reactor() override { return reactor_; }
+ grpc::internal::ServerReactor* reactor() override { return reactor_; }
- ::grpc::ServerUnaryReactor* const reactor_;
+ grpc::ServerUnaryReactor* const reactor_;
std::atomic_bool status_set_{false};
- ::grpc::Status status_;
- const std::function<void(::grpc::Status s)> func_;
+ grpc::Status status_;
+ const std::function<void(grpc::Status s)> func_;
};
typename std::aligned_storage<sizeof(Reactor), alignof(Reactor)>::type
default_reactor_;
std::atomic_bool default_reactor_used_{false};
+
+ std::atomic_bool marked_cancelled_{false};
+
std::unique_ptr<TestServerCallbackUnary> test_unary_;
};
@@ -570,7 +568,7 @@ class ServerContext : public ServerContextBase {
private:
// Constructor for internal use by server only
- friend class ::grpc::Server;
+ friend class grpc::Server;
ServerContext(gpr_timespec deadline, grpc_metadata_array* arr)
: ServerContextBase(deadline, arr) {}
@@ -633,39 +631,27 @@ class ContextAllocator {
virtual CallbackServerContext* NewCallbackServerContext() { return nullptr; }
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual experimental::GenericCallbackServerContext*
- NewGenericCallbackServerContext() {
- return nullptr;
- }
-#else
virtual GenericCallbackServerContext* NewGenericCallbackServerContext() {
return nullptr;
}
-#endif
virtual void Release(CallbackServerContext*) {}
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual void Release(experimental::GenericCallbackServerContext*) {}
-#else
virtual void Release(GenericCallbackServerContext*) {}
-#endif
};
} // namespace grpc
static_assert(
- std::is_base_of<::grpc::ServerContextBase, ::grpc::ServerContext>::value,
+ std::is_base_of<grpc::ServerContextBase, grpc::ServerContext>::value,
"improper base class");
-static_assert(std::is_base_of<::grpc::ServerContextBase,
- ::grpc::CallbackServerContext>::value,
+static_assert(std::is_base_of<grpc::ServerContextBase,
+ grpc::CallbackServerContext>::value,
"improper base class");
-static_assert(sizeof(::grpc::ServerContextBase) ==
- sizeof(::grpc::ServerContext),
+static_assert(sizeof(grpc::ServerContextBase) == sizeof(grpc::ServerContext),
"wrong size");
-static_assert(sizeof(::grpc::ServerContextBase) ==
- sizeof(::grpc::CallbackServerContext),
+static_assert(sizeof(grpc::ServerContextBase) ==
+ sizeof(grpc::CallbackServerContext),
"wrong size");
#endif // GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
diff --git a/grpc/include/grpcpp/impl/codegen/server_interceptor.h b/grpc/include/grpcpp/impl/codegen/server_interceptor.h
index 7598e72a..3a8fd52a 100644
--- a/grpc/include/grpcpp/impl/codegen/server_interceptor.h
+++ b/grpc/include/grpcpp/impl/codegen/server_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/server_interceptor.h>
+
#include <atomic>
#include <vector>
diff --git a/grpc/include/grpcpp/impl/codegen/server_interface.h b/grpc/include/grpcpp/impl/codegen/server_interface.h
index a44ab1fa..0deac825 100644
--- a/grpc/include/grpcpp/impl/codegen/server_interface.h
+++ b/grpc/include/grpcpp/impl/codegen/server_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -50,13 +52,7 @@ namespace internal {
class ServerAsyncStreamingInterface;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
class ServerInterceptorFactoryInterface;
@@ -120,7 +116,7 @@ class ServerInterface : public internal::CallHook {
virtual void Wait() = 0;
protected:
- friend class ::grpc::Service;
+ friend class grpc::Service;
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the Server instance.
@@ -130,35 +126,12 @@ class ServerInterface : public internal::CallHook {
/// service. The service must exist for the lifetime of the Server instance.
virtual void RegisterAsyncGenericService(AsyncGenericService* service) = 0;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback generic service. This call does not take ownership of
/// the service. The service must exist for the lifetime of the Server
/// instance. May not be abstract since this is a post-1.0 API addition.
virtual void RegisterCallbackGenericService(CallbackGenericService*
/*service*/) {}
-#else
- /// NOTE: class experimental_registration_interface is not part of the public
- /// API of this class
- /// TODO(vjpai): Move these contents to public API when no longer experimental
- class experimental_registration_interface {
- public:
- virtual ~experimental_registration_interface() {}
- /// May not be abstract since this is a post-1.0 API addition
- virtual void RegisterCallbackGenericService(
- experimental::CallbackGenericService* /*service*/) {}
- virtual void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> context_allocator) {}
- };
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time. May not be abstract since this is a
- /// post-1.0 API addition
- virtual experimental_registration_interface* experimental_registration() {
- return nullptr;
- }
-#endif
/// Tries to bind \a server to the given \a addr.
///
@@ -180,7 +153,7 @@ class ServerInterface : public internal::CallHook {
/// caller is required to keep all completion queues live until the server is
/// destroyed.
/// \param num_cqs How many completion queues does \a cqs hold.
- virtual void Start(::grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0;
+ virtual void Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0;
virtual void ShutdownInternal(gpr_timespec deadline) = 0;
@@ -193,10 +166,10 @@ class ServerInterface : public internal::CallHook {
class BaseAsyncRequest : public internal::CompletionQueueTag {
public:
- BaseAsyncRequest(ServerInterface* server, ::grpc::ServerContext* context,
+ BaseAsyncRequest(ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
bool delete_on_finalize);
~BaseAsyncRequest() override;
@@ -207,10 +180,10 @@ class ServerInterface : public internal::CallHook {
protected:
ServerInterface* const server_;
- ::grpc::ServerContext* const context_;
+ grpc::ServerContext* const context_;
internal::ServerAsyncStreamingInterface* const stream_;
- ::grpc::CompletionQueue* const call_cq_;
- ::grpc::ServerCompletionQueue* const notification_cq_;
+ grpc::CompletionQueue* const call_cq_;
+ grpc::ServerCompletionQueue* const notification_cq_;
void* const tag_;
const bool delete_on_finalize_;
grpc_call* call_;
@@ -223,10 +196,10 @@ class ServerInterface : public internal::CallHook {
class RegisteredAsyncRequest : public BaseAsyncRequest {
public:
RegisteredAsyncRequest(ServerInterface* server,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag, const char* name,
internal::RpcMethod::RpcType type);
@@ -235,7 +208,7 @@ class ServerInterface : public internal::CallHook {
if (done_intercepting_) {
return BaseAsyncRequest::FinalizeResult(tag, status);
}
- call_wrapper_ = ::grpc::internal::Call(
+ call_wrapper_ = grpc::internal::Call(
call_, server_, call_cq_, server_->max_receive_message_size(),
context_->set_server_rpc_info(name_, type_,
*server_->interceptor_creators()));
@@ -244,7 +217,7 @@ class ServerInterface : public internal::CallHook {
protected:
void IssueRequest(void* registered_method, grpc_byte_buffer** payload,
- ::grpc::ServerCompletionQueue* notification_cq);
+ grpc::ServerCompletionQueue* notification_cq);
const char* name_;
const internal::RpcMethod::RpcType type_;
};
@@ -252,11 +225,10 @@ class ServerInterface : public internal::CallHook {
class NoPayloadAsyncRequest final : public RegisteredAsyncRequest {
public:
NoPayloadAsyncRequest(internal::RpcServiceMethod* registered_method,
- ServerInterface* server,
- ::grpc::ServerContext* context,
+ ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
@@ -271,11 +243,11 @@ class ServerInterface : public internal::CallHook {
class PayloadAsyncRequest final : public RegisteredAsyncRequest {
public:
PayloadAsyncRequest(internal::RpcServiceMethod* registered_method,
- ServerInterface* server, ::grpc::ServerContext* context,
+ ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, Message* request)
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ Message* request)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
registered_method->name(), registered_method->method_type()),
@@ -329,9 +301,9 @@ class ServerInterface : public internal::CallHook {
public:
GenericAsyncRequest(ServerInterface* server, GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, bool delete_on_finalize);
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ bool delete_on_finalize);
bool FinalizeResult(void** tag, bool* status) override;
@@ -341,21 +313,21 @@ class ServerInterface : public internal::CallHook {
template <class Message>
void RequestAsyncCall(internal::RpcServiceMethod* method,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, Message* message) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ Message* message) {
GPR_CODEGEN_ASSERT(method);
new PayloadAsyncRequest<Message>(method, this, context, stream, call_cq,
notification_cq, tag, message);
}
void RequestAsyncCall(internal::RpcServiceMethod* method,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
GPR_CODEGEN_ASSERT(method);
new NoPayloadAsyncRequest(method, this, context, stream, call_cq,
@@ -364,8 +336,8 @@ class ServerInterface : public internal::CallHook {
void RequestAsyncGenericCall(GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
new GenericAsyncRequest(this, context, stream, call_cq, notification_cq,
tag, true);
@@ -383,7 +355,6 @@ class ServerInterface : public internal::CallHook {
return nullptr;
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// server. If the return value is nullptr, this server doesn't support
// callback operations.
@@ -391,7 +362,7 @@ class ServerInterface : public internal::CallHook {
// Returns nullptr (rather than being pure) since this is a post-1.0 method
// and adding a new pure method to an interface would be a breaking change
// (even though this is private and non-API)
- virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; }
+ virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; }
};
} // namespace grpc
diff --git a/grpc/include/grpcpp/impl/codegen/service_type.h b/grpc/include/grpcpp/impl/codegen/service_type.h
index 57ca9f09..88bcb4a9 100644
--- a/grpc/include/grpcpp/impl/codegen/service_type.h
+++ b/grpc/include/grpcpp/impl/codegen/service_type.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
#define GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
+// IWYU pragma: private, include <grpcpp/impl/service_type.h>
+
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -47,7 +49,7 @@ class ServerAsyncStreamingInterface {
virtual void SendInitialMetadata(void* tag) = 0;
private:
- friend class ::grpc::ServerInterface;
+ friend class grpc::ServerInterface;
virtual void BindCall(Call* call) = 0;
};
} // namespace internal
@@ -99,35 +101,12 @@ class Service {
}
protected:
- // TODO(vjpai): Promote experimental contents once callback API is accepted
- class experimental_type {
- public:
- explicit experimental_type(Service* service) : service_(service) {}
-
- void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return service_->GetHandlerInternal(index);
- }
-
- private:
- Service* service_;
- };
-
- experimental_type experimental() { return experimental_type(this); }
-
template <class Message>
- void RequestAsyncUnary(int index, ::grpc::ServerContext* context,
+ void RequestAsyncUnary(int index, grpc::ServerContext* context,
Message* request,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
// Typecast the index to size_t for indexing into a vector
// while preserving the API that existed before a compiler
@@ -137,29 +116,29 @@ class Service {
notification_cq, tag, request);
}
void RequestAsyncClientStreaming(
- int index, ::grpc::ServerContext* context,
+ int index, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);
}
template <class Message>
void RequestAsyncServerStreaming(
- int index, ::grpc::ServerContext* context, Message* request,
+ int index, grpc::ServerContext* context, Message* request,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag, request);
}
void RequestAsyncBidiStreaming(
- int index, ::grpc::ServerContext* context,
+ int index, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);
@@ -216,23 +195,7 @@ class Service {
methods_[idx]->SetMethodType(internal::RpcMethod::BIDI_STREAMING);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return GetHandlerInternal(index);
- }
-#endif
- private:
- // TODO(vjpai): migrate the Internal functions to mainline functions once
- // callback API is fully de-experimental
- void MarkMethodCallbackInternal(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -245,8 +208,7 @@ class Service {
internal::RpcServiceMethod::ApiType::CALL_BACK);
}
- void MarkMethodRawCallbackInternal(int index,
- internal::MethodHandler* handler) {
+ void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -259,11 +221,12 @@ class Service {
internal::RpcServiceMethod::ApiType::RAW_CALL_BACK);
}
- internal::MethodHandler* GetHandlerInternal(int index) {
+ internal::MethodHandler* GetHandler(int index) {
size_t idx = static_cast<size_t>(index);
return methods_[idx]->handler();
}
+ private:
friend class Server;
friend class ServerInterface;
ServerInterface* server_;
diff --git a/grpc/include/grpcpp/impl/codegen/slice.h b/grpc/include/grpcpp/impl/codegen/slice.h
index ea550259..392986a5 100644
--- a/grpc/include/grpcpp/impl/codegen/slice.h
+++ b/grpc/include/grpcpp/impl/codegen/slice.h
@@ -19,12 +19,13 @@
#ifndef GRPCPP_IMPL_CODEGEN_SLICE_H
#define GRPCPP_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpcpp/support/slice.h>
+
+#include <grpc/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/string_ref.h>
-#include <grpc/impl/codegen/slice.h>
-
namespace grpc {
/// A wrapper around \a grpc_slice.
@@ -74,6 +75,11 @@ class Slice final {
Slice(const Slice& other)
: slice_(g_core_codegen_interface->grpc_slice_ref(other.slice_)) {}
+ /// Move constructor, steals a reference.
+ Slice(Slice&& other) noexcept : slice_(other.slice_) {
+ other.slice_ = g_core_codegen_interface->grpc_empty_slice();
+ }
+
/// Assignment, reference count is unchanged.
Slice& operator=(Slice other) {
std::swap(slice_, other.slice_);
@@ -107,6 +113,12 @@ class Slice final {
/// Raw pointer to the end (one byte \em past the last element) of the slice.
const uint8_t* end() const { return GRPC_SLICE_END_PTR(slice_); }
+ /// Returns a substring of the `slice` as another slice.
+ Slice sub(size_t begin, size_t end) const {
+ return Slice(g_core_codegen_interface->grpc_slice_sub(slice_, begin, end),
+ STEAL_REF);
+ }
+
/// Raw C slice. Caller needs to call grpc_slice_unref when done.
grpc_slice c_slice() const {
return g_core_codegen_interface->grpc_slice_ref(slice_);
diff --git a/grpc/include/grpcpp/impl/codegen/status.h b/grpc/include/grpcpp/impl/codegen/status.h
index 9a6cf89b..f5ffc615 100644
--- a/grpc/include/grpcpp/impl/codegen/status.h
+++ b/grpc/include/grpcpp/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_H
#define GRPCPP_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpcpp/support/status.h>
+
#include <grpc/impl/codegen/status.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/status_code_enum.h>
diff --git a/grpc/include/grpcpp/impl/codegen/status_code_enum.h b/grpc/include/grpcpp/impl/codegen/status_code_enum.h
index bdd7ead6..36ea24fd 100644
--- a/grpc/include/grpcpp/impl/codegen/status_code_enum.h
+++ b/grpc/include/grpcpp/impl/codegen/status_code_enum.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
#define GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
+// IWYU pragma: private, include <grpcpp/support/status_code_enum.h>
+
namespace grpc {
enum StatusCode {
diff --git a/grpc/include/grpcpp/impl/codegen/string_ref.h b/grpc/include/grpcpp/impl/codegen/string_ref.h
index 4543e426..f71778b5 100644
--- a/grpc/include/grpcpp/impl/codegen/string_ref.h
+++ b/grpc/include/grpcpp/impl/codegen/string_ref.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STRING_REF_H
#define GRPCPP_IMPL_CODEGEN_STRING_REF_H
+// IWYU pragma: private, include <grpcpp/support/string_ref.h>
+
#include <string.h>
#include <algorithm>
diff --git a/grpc/include/grpcpp/impl/codegen/stub_options.h b/grpc/include/grpcpp/impl/codegen/stub_options.h
index 30509c25..efa1e38e 100644
--- a/grpc/include/grpcpp/impl/codegen/stub_options.h
+++ b/grpc/include/grpcpp/impl/codegen/stub_options.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
#define GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
+// IWYU pragma: private, include <grpcpp/support/stub_options.h>
+
namespace grpc {
/// Useful interface for generated stubs
diff --git a/grpc/include/grpcpp/impl/codegen/sync.h b/grpc/include/grpcpp/impl/codegen/sync.h
index 0c4effe4..4cb8133c 100644
--- a/grpc/include/grpcpp/impl/codegen/sync.h
+++ b/grpc/include/grpcpp/impl/codegen/sync.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_H
#define GRPCPP_IMPL_CODEGEN_SYNC_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_HAS_PTHREAD_H
@@ -27,13 +29,12 @@
#include <mutex>
+#include "absl/synchronization/mutex.h"
+
#include <grpc/impl/codegen/log.h>
#include <grpc/impl/codegen/sync.h>
-
#include <grpcpp/impl/codegen/core_codegen_interface.h>
-#include "absl/synchronization/mutex.h"
-
// The core library is not accessible in C++ codegen headers, and vice versa.
// Thus, we need to have duplicate headers with similar functionality.
// Make sure any change to this file is also reflected in
@@ -46,7 +47,7 @@
namespace grpc {
namespace internal {
-#ifdef GRPCPP_ABSEIL_SYNC
+#ifdef GPR_ABSEIL_SYNC
using Mutex = absl::Mutex;
using MutexLock = absl::MutexLock;
@@ -141,9 +142,10 @@ class CondVar {
gpr_cv cv_;
};
-#endif // GRPCPP_ABSEIL_SYNC
+#endif // GPR_ABSEIL_SYNC
template <typename Predicate>
+GRPC_DEPRECATED("incompatible with thread safety analysis")
static void WaitUntil(CondVar* cv, Mutex* mu, Predicate pred) {
while (!pred()) {
cv->Wait(mu);
diff --git a/grpc/include/grpcpp/impl/codegen/sync_stream.h b/grpc/include/grpcpp/impl/codegen/sync_stream.h
index 408f42f2..aca60790 100644
--- a/grpc/include/grpcpp/impl/codegen/sync_stream.h
+++ b/grpc/include/grpcpp/impl/codegen/sync_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/sync_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_context.h>
@@ -59,7 +61,7 @@ class ClientStreamingInterface {
/// - \a Status contains the status code, message and details for the call
/// - the \a ClientContext associated with this call is updated with
/// possible trailing metadata sent from the server.
- virtual ::grpc::Status Finish() = 0;
+ virtual grpc::Status Finish() = 0;
};
/// Common interface for all synchronous server side streaming.
@@ -112,7 +114,7 @@ class WriterInterface {
/// \param options The WriteOptions affecting the write operation.
///
/// \return \a true on success, \a false when the stream has been closed.
- virtual bool Write(const W& msg, ::grpc::WriteOptions options) = 0;
+ virtual bool Write(const W& msg, grpc::WriteOptions options) = 0;
/// Block to write \a msg to the stream with default write options.
/// This is thread-safe with respect to \a ReaderInterface::Read
@@ -120,7 +122,7 @@ class WriterInterface {
/// \param msg The message to be written to the stream.
///
/// \return \a true on success, \a false when the stream has been closed.
- inline bool Write(const W& msg) { return Write(msg, ::grpc::WriteOptions()); }
+ inline bool Write(const W& msg) { return Write(msg, grpc::WriteOptions()); }
/// Write \a msg and coalesce it with the writing of trailing metadata, using
/// WriteOptions \a options.
@@ -136,7 +138,7 @@ class WriterInterface {
///
/// \param[in] msg The message to be written to the stream.
/// \param[in] options The WriteOptions to be used to write this message.
- void WriteLast(const W& msg, ::grpc::WriteOptions options) {
+ void WriteLast(const W& msg, grpc::WriteOptions options) {
Write(msg, options.set_last_message());
}
};
@@ -160,9 +162,9 @@ template <class R>
class ClientReaderFactory {
public:
template <class W>
- static ClientReader<R>* Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static ClientReader<R>* Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const W& request) {
return new ClientReader<R>(channel, method, context, request);
}
@@ -185,8 +187,7 @@ class ClientReader final : public ClientReaderInterface<R> {
void WaitForInitialMetadata() override {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); /// status ignored
@@ -204,8 +205,8 @@ class ClientReader final : public ClientReaderInterface<R> {
/// already received (if initial metadata is received, it can be then
/// accessed through the \a ClientContext associated with this call).
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
@@ -220,9 +221,14 @@ class ClientReader final : public ClientReaderInterface<R> {
/// Side effect:
/// The \a ClientContext associated with this call is updated with
/// possible metadata received from the server.
- ::grpc::Status Finish() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientRecvStatus> ops;
- ::grpc::Status status;
+ grpc::Status Finish() override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
+ ops;
+ if (!context_->initial_metadata_received_) {
+ ops.RecvInitialMetadata(context_);
+ }
+ grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
GPR_CODEGEN_ASSERT(cq_.Pluck(&ops));
@@ -231,25 +237,25 @@ class ClientReader final : public ClientReaderInterface<R> {
private:
friend class internal::ClientReaderFactory<R>;
- ::grpc::ClientContext* context_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request
/// out. Note that \a context will be used to fill in custom initial
/// metadata used to send to the server when starting the call.
template <class W>
- ClientReader(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const W& request)
+ ClientReader(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const W& request)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
@@ -280,9 +286,9 @@ template <class W>
class ClientWriterFactory {
public:
template <class R>
- static ClientWriter<W>* Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, R* response) {
+ static ClientWriter<W>* Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response) {
return new ClientWriter<W>(channel, method, context, response);
}
};
@@ -303,8 +309,7 @@ class ClientWriter : public ClientWriterInterface<W> {
void WaitForInitialMetadata() {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); // status ignored
@@ -317,10 +322,10 @@ class ClientWriter : public ClientWriterInterface<W> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ bool Write(const W& msg, grpc::WriteOptions options) override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
if (options.is_last_message()) {
@@ -341,7 +346,7 @@ class ClientWriter : public ClientWriterInterface<W> {
}
bool WritesDone() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops;
ops.ClientSendClose();
call_.PerformOps(&ops);
return cq_.Pluck(&ops);
@@ -353,8 +358,8 @@ class ClientWriter : public ClientWriterInterface<W> {
/// - Attempts to fill in the \a response parameter passed
/// to the constructor of this instance with the response
/// message from the server.
- ::grpc::Status Finish() override {
- ::grpc::Status status;
+ grpc::Status Finish() override {
+ grpc::Status status;
if (!context_->initial_metadata_received_) {
finish_ops_.RecvInitialMetadata(context_);
}
@@ -373,9 +378,9 @@ class ClientWriter : public ClientWriterInterface<W> {
/// single expected response message from the server upon a successful
/// call to the \a Finish method of this instance.
template <class R>
- ClientWriter(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, R* response)
+ ClientWriter(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
@@ -385,8 +390,7 @@ class ClientWriter : public ClientWriterInterface<W> {
finish_ops_.AllowNoMessage();
if (!context_->initial_metadata_corked_) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&ops);
@@ -394,13 +398,13 @@ class ClientWriter : public ClientWriterInterface<W> {
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpGenericRecvMessage,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::ClientContext* context_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpGenericRecvMessage,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
};
/// Client-side interface for bi-directional streaming with
@@ -431,9 +435,8 @@ template <class W, class R>
class ClientReaderWriterFactory {
public:
static ClientReaderWriter<W, R>* Create(
- ::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context) {
+ grpc::ChannelInterface* channel, const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context) {
return new ClientReaderWriter<W, R>(channel, method, context);
}
};
@@ -455,8 +458,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
void WaitForInitialMetadata() override {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); // status ignored
@@ -473,8 +475,8 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Also receives initial metadata if not already received (updates the \a
/// ClientContext associated with this call in that case).
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
@@ -490,10 +492,10 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call to fill in values).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ bool Write(const W& msg, grpc::WriteOptions options) override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
if (options.is_last_message()) {
@@ -514,7 +516,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
}
bool WritesDone() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops;
ops.ClientSendClose();
call_.PerformOps(&ops);
return cq_.Pluck(&ops);
@@ -525,14 +527,14 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible trailing metadata sent from the server.
- ::grpc::Status Finish() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::Status Finish() override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
}
- ::grpc::Status status;
+ grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
GPR_CODEGEN_ASSERT(cq_.Pluck(&ops));
@@ -542,24 +544,23 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
private:
friend class internal::ClientReaderWriterFactory<W, R>;
- ::grpc::ClientContext* context_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request
/// out. Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
- ClientReaderWriter(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context)
+ ClientReaderWriter(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
if (!context_->initial_metadata_corked_) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&ops);
@@ -585,8 +586,7 @@ class ServerReader final : public ServerReaderInterface<R> {
void SendInitialMetadata() override {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
@@ -604,20 +604,24 @@ class ServerReader final : public ServerReaderInterface<R> {
}
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
private:
- ::grpc::internal::Call* const call_;
+ grpc::internal::Call* const call_;
ServerContext* const ctx_;
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ClientStreamingHandler;
- ServerReader(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReader(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
};
@@ -639,8 +643,7 @@ class ServerWriter final : public ServerWriterInterface<W> {
void SendInitialMetadata() override {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
@@ -657,7 +660,7 @@ class ServerWriter final : public ServerWriterInterface<W> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call to fill in values).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
+ bool Write(const W& msg, grpc::WriteOptions options) override {
if (options.is_last_message()) {
options.set_buffer_hint();
}
@@ -686,13 +689,13 @@ class ServerWriter final : public ServerWriterInterface<W> {
}
private:
- ::grpc::internal::Call* const call_;
- ::grpc::ServerContext* const ctx_;
+ grpc::internal::Call* const call_;
+ grpc::ServerContext* const ctx_;
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ServerStreamingHandler;
- ServerWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerWriter(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
};
@@ -707,7 +710,7 @@ namespace internal {
template <class W, class R>
class ServerReaderWriterBody final {
public:
- ServerReaderWriterBody(grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReaderWriterBody(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
@@ -731,13 +734,17 @@ class ServerReaderWriterBody final {
}
bool Read(R* msg) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
- bool Write(const W& msg, ::grpc::WriteOptions options) {
+ bool Write(const W& msg, grpc::WriteOptions options) {
if (options.is_last_message()) {
options.set_buffer_hint();
}
@@ -766,7 +773,7 @@ class ServerReaderWriterBody final {
private:
grpc::internal::Call* const call_;
- ::grpc::ServerContext* const ctx_;
+ grpc::ServerContext* const ctx_;
};
} // namespace internal
@@ -795,7 +802,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
/// Also sends initial metadata if not already sent (using the \a
/// ServerContext associated with this call).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
+ bool Write(const W& msg, grpc::WriteOptions options) override {
return body_.Write(msg, options);
}
@@ -804,7 +811,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
friend class internal::TemplatedBidiStreamingHandler<ServerReaderWriter<W, R>,
false>;
- ServerReaderWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReaderWriter(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx) {}
};
@@ -858,7 +865,7 @@ class ServerUnaryStreamer final
/// \return \a true on success, \a false when the stream has been closed.
using internal::WriterInterface<ResponseType>::Write;
bool Write(const ResponseType& response,
- ::grpc::WriteOptions options) override {
+ grpc::WriteOptions options) override {
if (write_done_ || !read_done_) {
return false;
}
@@ -873,7 +880,7 @@ class ServerUnaryStreamer final
friend class internal::TemplatedBidiStreamingHandler<
ServerUnaryStreamer<RequestType, ResponseType>, true>;
- ServerUnaryStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerUnaryStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx), read_done_(false), write_done_(false) {}
};
@@ -924,7 +931,7 @@ class ServerSplitStreamer final
/// \return \a true on success, \a false when the stream has been closed.
using internal::WriterInterface<ResponseType>::Write;
bool Write(const ResponseType& response,
- ::grpc::WriteOptions options) override {
+ grpc::WriteOptions options) override {
return read_done_ && body_.Write(response, options);
}
@@ -934,7 +941,7 @@ class ServerSplitStreamer final
friend class internal::TemplatedBidiStreamingHandler<
ServerSplitStreamer<RequestType, ResponseType>, false>;
- ServerSplitStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerSplitStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx), read_done_(false) {}
};
diff --git a/grpc/include/grpcpp/impl/codegen/time.h b/grpc/include/grpcpp/impl/codegen/time.h
index 340a06f5..f2021f51 100644
--- a/grpc/include/grpcpp/impl/codegen/time.h
+++ b/grpc/include/grpcpp/impl/codegen/time.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_TIME_H
#define GRPCPP_IMPL_CODEGEN_TIME_H
+// IWYU pragma: private, include <grpcpp/support/time.h>
+
#include <chrono>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/include/grpcpp/impl/grpc_library.h b/grpc/include/grpcpp/impl/grpc_library.h
index 3711c098..0afca8e4 100644
--- a/grpc/include/grpcpp/impl/grpc_library.h
+++ b/grpc/include/grpcpp/impl/grpc_library.h
@@ -24,7 +24,7 @@
#include <grpc/grpc.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen.h>
-#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/grpc_library.h> // IWYU pragma: export
namespace grpc {
diff --git a/grpc/include/grpcpp/impl/rpc_method.h b/grpc/include/grpcpp/impl/rpc_method.h
index 5da70416..aeef8b77 100644
--- a/grpc/include/grpcpp/impl/rpc_method.h
+++ b/grpc/include/grpcpp/impl/rpc_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_METHOD_H
#define GRPCPP_IMPL_RPC_METHOD_H
-#include <grpcpp/impl/codegen/rpc_method.h>
+#include <grpcpp/impl/codegen/rpc_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_METHOD_H
diff --git a/grpc/include/grpcpp/impl/rpc_service_method.h b/grpc/include/grpcpp/impl/rpc_service_method.h
index ef70a3a1..86cb2dc5 100644
--- a/grpc/include/grpcpp/impl/rpc_service_method.h
+++ b/grpc/include/grpcpp/impl/rpc_service_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_RPC_SERVICE_METHOD_H
-#include <grpcpp/impl/codegen/rpc_service_method.h>
+#include <grpcpp/impl/codegen/rpc_service_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_SERVICE_METHOD_H
diff --git a/grpc/include/grpcpp/impl/serialization_traits.h b/grpc/include/grpcpp/impl/serialization_traits.h
index 95194fbd..6da8b4df 100644
--- a/grpc/include/grpcpp/impl/serialization_traits.h
+++ b/grpc/include/grpcpp/impl/serialization_traits.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_SERIALIZATION_TRAITS_H
-#include <grpcpp/impl/codegen/serialization_traits.h>
+#include <grpcpp/impl/codegen/serialization_traits.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERIALIZATION_TRAITS_H
diff --git a/grpc/include/grpcpp/impl/service_type.h b/grpc/include/grpcpp/impl/service_type.h
index 250bc8cd..de45c426 100644
--- a/grpc/include/grpcpp/impl/service_type.h
+++ b/grpc/include/grpcpp/impl/service_type.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERVICE_TYPE_H
#define GRPCPP_IMPL_SERVICE_TYPE_H
-#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/service_type.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERVICE_TYPE_H
diff --git a/grpc/include/grpcpp/resource_quota.h b/grpc/include/grpcpp/resource_quota.h
index 374feae7..bde32f93 100644
--- a/grpc/include/grpcpp/resource_quota.h
+++ b/grpc/include/grpcpp/resource_quota.h
@@ -31,7 +31,7 @@ namespace grpc {
/// or a client channel (via \a ChannelArguments).
/// gRPC will attempt to keep memory and threads used by all attached entities
/// below the ResourceQuota bound.
-class ResourceQuota final : private ::grpc::GrpcLibraryCodegen {
+class ResourceQuota final : private grpc::GrpcLibraryCodegen {
public:
/// \param name - a unique name for this ResourceQuota.
explicit ResourceQuota(const std::string& name);
diff --git a/grpc/include/grpcpp/security/alts_context.h b/grpc/include/grpcpp/security/alts_context.h
index bba0fca0..8d842575 100644
--- a/grpc/include/grpcpp/security/alts_context.h
+++ b/grpc/include/grpcpp/security/alts_context.h
@@ -19,12 +19,12 @@
#ifndef GRPCPP_SECURITY_ALTS_CONTEXT_H
#define GRPCPP_SECURITY_ALTS_CONTEXT_H
-#include <grpc/grpc_security_constants.h>
-#include <grpcpp/security/auth_context.h>
-
#include <map>
#include <memory>
+#include <grpc/grpc_security_constants.h>
+#include <grpcpp/security/auth_context.h>
+
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/grpc/include/grpcpp/security/alts_util.h b/grpc/include/grpcpp/security/alts_util.h
index 2b2b07e4..b0ef4b4d 100644
--- a/grpc/include/grpcpp/security/alts_util.h
+++ b/grpc/include/grpcpp/security/alts_util.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SECURITY_ALTS_UTIL_H
#define GRPCPP_SECURITY_ALTS_UTIL_H
+#include <memory>
+
#include <grpc/grpc_security_constants.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/security/alts_context.h>
#include <grpcpp/security/auth_context.h>
-#include <memory>
-
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/grpc/include/grpcpp/security/auth_context.h b/grpc/include/grpcpp/security/auth_context.h
index 7a6f2cb7..17784508 100644
--- a/grpc/include/grpcpp/security/auth_context.h
+++ b/grpc/include/grpcpp/security/auth_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_SECURITY_AUTH_CONTEXT_H
-#include <grpcpp/impl/codegen/security/auth_context.h>
+#include <grpcpp/impl/codegen/security/auth_context.h> // IWYU pragma: export
#endif // GRPCPP_SECURITY_AUTH_CONTEXT_H
diff --git a/grpc/include/grpcpp/security/authorization_policy_provider.h b/grpc/include/grpcpp/security/authorization_policy_provider.h
new file mode 100644
index 00000000..1718db4a
--- /dev/null
+++ b/grpc/include/grpcpp/security/authorization_policy_provider.h
@@ -0,0 +1,88 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <memory>
+
+#include <grpc/grpc_security.h>
+#include <grpc/status.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+
+namespace grpc {
+namespace experimental {
+
+// Wrapper around C-core grpc_authorization_policy_provider. Internally, it
+// handles creating and updating authorization engine objects, using SDK
+// authorization policy.
+class AuthorizationPolicyProviderInterface {
+ public:
+ virtual ~AuthorizationPolicyProviderInterface() = default;
+ virtual grpc_authorization_policy_provider* c_provider() = 0;
+};
+
+// Implementation obtains authorization policy from static string. This provider
+// will always return the same authorization engines.
+class StaticDataAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<StaticDataAuthorizationPolicyProvider> Create(
+ const std::string& authz_policy, grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // StaticDataAuthorizationPolicyProvider.
+ explicit StaticDataAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~StaticDataAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+// Implementation obtains authorization policy by watching for changes in
+// filesystem.
+class FileWatcherAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<FileWatcherAuthorizationPolicyProvider> Create(
+ const std::string& authz_policy_path, unsigned int refresh_interval_sec,
+ grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // FileWatcherAuthorizationPolicyProvider.
+ explicit FileWatcherAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~FileWatcherAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/grpc/include/grpcpp/security/binder_credentials.h b/grpc/include/grpcpp/security/binder_credentials.h
new file mode 100644
index 00000000..f511837e
--- /dev/null
+++ b/grpc/include/grpcpp/security/binder_credentials.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+#define GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+
+#include <memory>
+
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/security/server_credentials.h>
+
+namespace grpc {
+
+class ChannelCredentials;
+
+namespace experimental {
+
+/// EXPERIMENTAL Builds Binder ServerCredentials.
+///
+/// This should be used along with `binder:` URI scheme. The path in the URI can
+/// later be used to access the server's endpoint binder.
+/// Note that calling \a ServerBuilder::AddListeningPort() with Binder
+/// ServerCredentials in a non-supported environment will make the subsequent
+/// call to \a ServerBuilder::BuildAndStart() return a null pointer.
+std::shared_ptr<grpc::ServerCredentials> BinderServerCredentials(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_CREDENTIALS_H
diff --git a/grpc/include/grpcpp/security/binder_security_policy.h b/grpc/include/grpcpp/security/binder_security_policy.h
new file mode 100644
index 00000000..e1c951fc
--- /dev/null
+++ b/grpc/include/grpcpp/security/binder_security_policy.h
@@ -0,0 +1,82 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+#define GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+
+#include <memory>
+
+#ifdef GPR_ANDROID
+
+#include <jni.h>
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+// EXPERIMENTAL Determinines if a connection is allowed to be
+// established on Android. See https://source.android.com/security/app-sandbox
+// for more info about UID.
+class SecurityPolicy {
+ public:
+ virtual ~SecurityPolicy() = default;
+ // Returns true if the UID is authorized to connect.
+ // Must return the same value for the same inputs so callers can safely cache
+ // the result.
+ virtual bool IsAuthorized(int uid) = 0;
+};
+
+// EXPERIMENTAL Allows all connection. Anything on the Android device will be
+// able to connect, use with caution!
+class UntrustedSecurityPolicy : public SecurityPolicy {
+ public:
+ UntrustedSecurityPolicy();
+ ~UntrustedSecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+// EXPERIMENTAL Only allows the connections from processes with the same UID. In
+// most cases this means "from the same APK".
+class InternalOnlySecurityPolicy : public SecurityPolicy {
+ public:
+ InternalOnlySecurityPolicy();
+ ~InternalOnlySecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+#ifdef GPR_ANDROID
+
+// EXPERIMENTAL Only allows the connections from the APK that have the same
+// signature.
+class SameSignatureSecurityPolicy : public SecurityPolicy {
+ public:
+ // `context` is required for getting PackageManager Java class
+ SameSignatureSecurityPolicy(JavaVM* jvm, jobject context);
+ ~SameSignatureSecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+
+ private:
+ JavaVM* jvm_;
+ jobject context_;
+};
+
+#endif
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
diff --git a/grpc/include/grpcpp/security/credentials.h b/grpc/include/grpcpp/security/credentials.h
index 1b1f994c..18dce966 100644
--- a/grpc/include/grpcpp/security/credentials.h
+++ b/grpc/include/grpcpp/security/credentials.h
@@ -55,11 +55,17 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
-/// Builds XDS Credentials.
+GRPC_DEPRECATED(
+ "Use grpc::XdsCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
std::shared_ptr<ChannelCredentials> XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
} // namespace experimental
+/// Builds XDS Credentials.
+std::shared_ptr<ChannelCredentials> XdsCredentials(
+ const std::shared_ptr<ChannelCredentials>& fallback_creds);
+
/// A channel credentials object encapsulates all the state needed by a client
/// to authenticate with a server for a given channel.
/// It can make various assertions, e.g., about the client’s identity, role
@@ -80,7 +86,7 @@ class ChannelCredentials : private grpc::GrpcLibraryCodegen {
// AsSecureCredentials(). Once we are able to remove insecure builds from gRPC
// (and also internal dependencies on the indirect method of creating a
// channel through credentials), we would be able to remove this.
- friend std::shared_ptr<ChannelCredentials> grpc::experimental::XdsCredentials(
+ friend std::shared_ptr<ChannelCredentials> grpc::XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
virtual SecureChannelCredentials* AsSecureCredentials() = 0;
diff --git a/grpc/include/grpcpp/security/server_credentials.h b/grpc/include/grpcpp/security/server_credentials.h
index 0ce46a82..2d1bc07a 100644
--- a/grpc/include/grpcpp/security/server_credentials.h
+++ b/grpc/include/grpcpp/security/server_credentials.h
@@ -60,10 +60,16 @@ struct SslServerCredentialsOptions {
grpc_ssl_client_certificate_request_type client_certificate_request;
};
-namespace experimental {
/// Builds Xds ServerCredentials given fallback credentials
std::shared_ptr<ServerCredentials> XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
+
+namespace experimental {
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
+std::shared_ptr<ServerCredentials> XdsServerCredentials(
+ const std::shared_ptr<ServerCredentials>& fallback_credentials);
} // namespace experimental
/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
@@ -83,8 +89,7 @@ class ServerCredentials : private grpc::GrpcLibraryCodegen {
// We need this friend declaration for access to Insecure() and
// AsSecureServerCredentials(). When these two functions are no longer
// necessary, this friend declaration can be removed too.
- friend std::shared_ptr<ServerCredentials>
- grpc::experimental::XdsServerCredentials(
+ friend std::shared_ptr<ServerCredentials> grpc::XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
/// Tries to bind \a server to the given \a addr (eg, localhost:1234,
diff --git a/grpc/include/grpcpp/security/tls_certificate_provider.h b/grpc/include/grpcpp/security/tls_certificate_provider.h
index a7480cc6..bbef455f 100644
--- a/grpc/include/grpcpp/security/tls_certificate_provider.h
+++ b/grpc/include/grpcpp/security/tls_certificate_provider.h
@@ -17,19 +17,16 @@
#ifndef GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
#define GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
+#include <memory>
+#include <vector>
+
+#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
-// TODO(yihuazhang): remove the forward declaration here and include
-// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
-typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
-
namespace grpc {
namespace experimental {
diff --git a/grpc/include/grpcpp/security/tls_certificate_verifier.h b/grpc/include/grpcpp/security/tls_certificate_verifier.h
new file mode 100644
index 00000000..e619d96d
--- /dev/null
+++ b/grpc/include/grpcpp/security/tls_certificate_verifier.h
@@ -0,0 +1,225 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+#define GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include <grpc/grpc_security_constants.h>
+#include <grpc/status.h>
+#include <grpc/support/log.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/sync.h>
+#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/support/config.h>
+#include <grpcpp/support/string_ref.h>
+
+// TODO(yihuazhang): remove the forward declaration here and include
+// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
+typedef struct grpc_tls_custom_verification_check_request
+ grpc_tls_custom_verification_check_request;
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+typedef struct grpc_tls_certificate_verifier_external
+ grpc_tls_certificate_verifier_external;
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+extern "C" grpc_tls_certificate_verifier*
+grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
+
+namespace grpc {
+namespace experimental {
+
+// Contains the verification-related information associated with a connection
+// request. Users should not directly create or destroy this request object, but
+// shall interact with it through CertificateVerifier's Verify() and Cancel().
+class TlsCustomVerificationCheckRequest {
+ public:
+ explicit TlsCustomVerificationCheckRequest(
+ grpc_tls_custom_verification_check_request* request);
+ ~TlsCustomVerificationCheckRequest() {}
+
+ grpc::string_ref target_name() const;
+ grpc::string_ref peer_cert() const;
+ grpc::string_ref peer_cert_full_chain() const;
+ grpc::string_ref common_name() const;
+ std::vector<grpc::string_ref> uri_names() const;
+ std::vector<grpc::string_ref> dns_names() const;
+ std::vector<grpc::string_ref> email_names() const;
+ std::vector<grpc::string_ref> ip_names() const;
+
+ grpc_tls_custom_verification_check_request* c_request() { return c_request_; }
+
+ private:
+ grpc_tls_custom_verification_check_request* c_request_ = nullptr;
+};
+
+// The base class of all internal verifier implementations, and the ultimate
+// class that all external verifiers will eventually be transformed into.
+// To implement a custom verifier, do not extend this class; instead,
+// implement a subclass of ExternalCertificateVerifier. Note that custom
+// verifier implementations can compose their functionality with existing
+// implementations of this interface, such as HostnameVerifier, by delegating
+// to an instance of that class.
+class CertificateVerifier {
+ public:
+ explicit CertificateVerifier(grpc_tls_certificate_verifier* v);
+
+ ~CertificateVerifier();
+
+ // Verifies a connection request, based on the logic specified in an internal
+ // verifier. The check on each internal verifier could be either synchronous
+ // or asynchronous, and we will need to use return value to know.
+ //
+ // request: the verification information associated with this request
+ // callback: This will only take effect if the verifier is asynchronous.
+ // The function that gRPC will invoke when the verifier has already
+ // completed its asynchronous check. Callers can use this function
+ // to perform any additional checks. The input parameter of the
+ // std::function indicates the status of the verifier check.
+ // sync_status: This will only be useful if the verifier is synchronous.
+ // The status of the verifier as it has already done it's
+ // synchronous check.
+ // return: return true if executed synchronously, otherwise return false
+ bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status);
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending.
+ //
+ // request: the verification information associated with this request
+ void Cancel(TlsCustomVerificationCheckRequest* request);
+
+ // Gets the core verifier used internally.
+ grpc_tls_certificate_verifier* c_verifier() { return verifier_; }
+
+ private:
+ static void AsyncCheckDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+ grpc_tls_certificate_verifier* verifier_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*,
+ std::function<void(grpc::Status)>>
+ request_map_ ABSL_GUARDED_BY(mu_);
+};
+
+// The base class of all external, user-specified verifiers. Users should
+// inherit this class to implement a custom verifier.
+// Note that while implementing the custom verifier that extends this class, it
+// is possible to compose an existing ExternalCertificateVerifier or
+// CertificateVerifier, inside the Verify() and Cancel() function of the new
+// custom verifier.
+class ExternalCertificateVerifier {
+ public:
+ // A factory method for creating a |CertificateVerifier| from this class. All
+ // the user-implemented verifiers should use this function to be converted to
+ // verifiers compatible with |TlsCredentialsOptions|.
+ // The resulting CertificateVerifier takes ownership of the newly instantiated
+ // Subclass.
+ template <typename Subclass, typename... Args>
+ static std::shared_ptr<CertificateVerifier> Create(Args&&... args) {
+ grpc::internal::GrpcLibraryInitializer g_gli_initializer;
+ g_gli_initializer.summon();
+ auto* external_verifier = new Subclass(std::forward<Args>(args)...);
+ return std::make_shared<CertificateVerifier>(
+ grpc_tls_certificate_verifier_external_create(
+ external_verifier->base_));
+ }
+
+ // The verification logic that will be performed after the TLS handshake
+ // completes. Implementers can choose to do their checks synchronously or
+ // asynchronously.
+ //
+ // request: the verification information associated with this request
+ // callback: This should only be used if your check is done asynchronously.
+ // When the asynchronous work is done, invoke this callback function
+ // with the proper status, indicating the success or the failure of
+ // the check. The implementer MUST NOT invoke this |callback| in the
+ // same thread before Verify() returns, otherwise it can lead to
+ // deadlocks.
+ // sync_status: This should only be used if your check is done synchronously.
+ // Modifies this value to indicate the success or the failure of
+ // the check.
+ // return: return true if your check is done synchronously, otherwise return
+ // false
+ virtual bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) = 0;
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending. The implementation should abort whatever
+ // async operation it is waiting for and quickly invoke the callback that was
+ // passed to Verify() with a status indicating the cancellation.
+ //
+ // request: the verification information associated with this request
+ virtual void Cancel(TlsCustomVerificationCheckRequest* request) = 0;
+
+ protected:
+ ExternalCertificateVerifier();
+
+ virtual ~ExternalCertificateVerifier();
+
+ private:
+ struct AsyncRequestState {
+ AsyncRequestState(grpc_tls_on_custom_verification_check_done_cb cb,
+ void* arg,
+ grpc_tls_custom_verification_check_request* request)
+ : callback(cb), callback_arg(arg), cpp_request(request) {}
+
+ grpc_tls_on_custom_verification_check_done_cb callback;
+ void* callback_arg;
+ TlsCustomVerificationCheckRequest cpp_request;
+ };
+
+ static int VerifyInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+
+ static void CancelInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request);
+
+ static void DestructInCoreExternalVerifier(void* user_data);
+
+ // TODO(yihuazhang): after the insecure build is removed, make this an object
+ // member instead of a pointer.
+ grpc_tls_certificate_verifier_external* base_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*, AsyncRequestState>
+ request_map_ ABSL_GUARDED_BY(mu_);
+};
+
+class HostNameCertificateVerifier : public CertificateVerifier {
+ public:
+ HostNameCertificateVerifier();
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
diff --git a/grpc/include/grpcpp/security/tls_credentials_options.h b/grpc/include/grpcpp/security/tls_credentials_options.h
index da2b595b..220c9533 100644
--- a/grpc/include/grpcpp/security/tls_credentials_options.h
+++ b/grpc/include/grpcpp/security/tls_credentials_options.h
@@ -19,133 +19,20 @@
#ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
#define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
+#include <memory>
+#include <vector>
+
+#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/security/tls_certificate_provider.h>
+#include <grpcpp/security/tls_certificate_verifier.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
-// TODO(yihuazhang): remove the forward declaration here and include
-// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
-typedef struct grpc_tls_server_authorization_check_arg
- grpc_tls_server_authorization_check_arg;
-typedef struct grpc_tls_server_authorization_check_config
- grpc_tls_server_authorization_check_config;
-typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
-typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
-
namespace grpc {
namespace experimental {
-/** TLS server authorization check arguments, wraps
- * grpc_tls_server_authorization_check_arg. It is used for experimental
- * purposes for now and it is subject to change.
- *
- * The server authorization check arg contains all the info necessary to
- * schedule/cancel a server authorization check request. The callback function
- * must be called after finishing the schedule operation. See the description
- * of the grpc_tls_server_authorization_check_arg struct in grpc_security.h for
- * more details. **/
-class TlsServerAuthorizationCheckArg {
- public:
- /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed
- * to the constructor. One must remember to free any memory allocated to the
- * C arg after using the setter functions below. **/
- explicit TlsServerAuthorizationCheckArg(
- grpc_tls_server_authorization_check_arg* arg);
- ~TlsServerAuthorizationCheckArg();
-
- /** Getters for member fields. **/
- void* cb_user_data() const;
- int success() const;
- std::string target_name() const;
- std::string peer_cert() const;
- std::string peer_cert_full_chain() const;
- grpc_status_code status() const;
- std::string error_details() const;
-
- /** Setters for member fields. **/
- void set_cb_user_data(void* cb_user_data);
- void set_success(int success);
- void set_target_name(const std::string& target_name);
- void set_peer_cert(const std::string& peer_cert);
- void set_peer_cert_full_chain(const std::string& peer_cert_full_chain);
- void set_status(grpc_status_code status);
- void set_error_details(const std::string& error_details);
-
- /** Calls the C arg's callback function. **/
- void OnServerAuthorizationCheckDoneCallback();
-
- private:
- grpc_tls_server_authorization_check_arg* c_arg_;
-};
-
-/** An interface that the application derives and uses to instantiate a
- * TlsServerAuthorizationCheckConfig instance. Refer to the definition of the
- * grpc_tls_server_authorization_check_config in grpc_tls_credentials_options.h
- * for more details on the expectations of the member functions of the
- * interface.
- * **/
-struct TlsServerAuthorizationCheckInterface {
- virtual ~TlsServerAuthorizationCheckInterface() = default;
- /** A callback that invokes the server authorization check. **/
- virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0;
- /** A callback that cancels a server authorization check request. **/
- virtual void Cancel(TlsServerAuthorizationCheckArg* /* arg */) {}
-};
-
-/** TLS server authorization check config, wraps
- * grps_tls_server_authorization_check_config. It is used for experimental
- * purposes for now and it is subject to change. **/
-class TlsServerAuthorizationCheckConfig {
- public:
- explicit TlsServerAuthorizationCheckConfig(
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface);
- ~TlsServerAuthorizationCheckConfig();
-
- int Schedule(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return 1;
- }
- return server_authorization_check_interface_->Schedule(arg);
- }
-
- void Cancel(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return;
- }
- server_authorization_check_interface_->Cancel(arg);
- }
-
- /** Returns C struct for the server authorization check config. **/
- grpc_tls_server_authorization_check_config* c_config() const {
- return c_config_;
- }
-
- private:
- grpc_tls_server_authorization_check_config* c_config_;
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface_;
-};
-
// Base class of configurable options specified by users to configure their
// certain security features supported in TLS. It is used for experimental
// purposes for now and it is subject to change.
@@ -187,6 +74,35 @@ class TlsCredentialsOptions {
//
// @param identity_cert_name the name of identity key-cert pairs being set.
void set_identity_cert_name(const std::string& identity_cert_name);
+ // Sets the Tls session key logging configuration. If not set, tls
+ // session key logging is disabled. Note that this should be used only for
+ // debugging purposes. It should never be used in a production environment
+ // due to security concerns.
+ //
+ // @param tls_session_key_log_file_path: Path where tls session keys would
+ // be logged.
+ void set_tls_session_key_log_file_path(
+ const std::string& tls_session_key_log_file_path);
+ // Sets the certificate verifier used to perform post-handshake peer identity
+ // checks.
+ void set_certificate_verifier(
+ std::shared_ptr<CertificateVerifier> certificate_verifier);
+ // Sets the options of whether to check the hostname of the peer on a per-call
+ // basis. This is usually used in a combination with virtual hosting at the
+ // client side, where each individual call on a channel can have a different
+ // host associated with it.
+ // This check is intended to verify that the host specified for the individual
+ // call is covered by the cert that the peer presented.
+ // We will perform such checks by default. This should be disabled if
+ // verifiers other than the host name verifier is used.
+ void set_check_call_host(bool check_call_host);
+
+ // TODO(zhenlian): This is an experimental API is likely to change in the
+ // future. Before de-experiementalizing, verify the API is up to date.
+ // If set, gRPC will read all hashed x.509 CRL files in the directory and
+ // enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
+ // version > 1.1.
+ void set_crl_directory(const std::string& path);
// ----- Getters for member fields ----
// Get the internal c options. This function shall be used only internally.
@@ -196,6 +112,7 @@ class TlsCredentialsOptions {
private:
std::shared_ptr<CertificateProviderInterface> certificate_provider_;
+ std::shared_ptr<CertificateVerifier> certificate_verifier_;
grpc_tls_credentials_options* c_credentials_options_ = nullptr;
};
@@ -207,14 +124,9 @@ class TlsCredentialsOptions {
// It is used for experimental purposes for now and it is subject to change.
class TlsChannelCredentialsOptions final : public TlsCredentialsOptions {
public:
- // Sets the option to verify the server.
- // The default is GRPC_TLS_SERVER_VERIFICATION.
- void set_server_verification_option(
- grpc_tls_server_verification_option server_verification_option);
- // Sets the custom authorization config.
- void set_server_authorization_check_config(
- std::shared_ptr<TlsServerAuthorizationCheckConfig>
- authorization_check_config);
+ // Sets the decision of whether to do a crypto check on the server certs.
+ // The default is true.
+ void set_verify_server_certs(bool verify_server_certs);
private:
};
diff --git a/grpc/include/grpcpp/server.h b/grpc/include/grpcpp/server.h
index a69e64b4..dce87448 100644
--- a/grpc/include/grpcpp/server.h
+++ b/grpc/include/grpcpp/server.h
@@ -19,12 +19,12 @@
#ifndef GRPCPP_SERVER_H
#define GRPCPP_SERVER_H
+#include <grpc/impl/codegen/port_platform.h>
+
#include <list>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/atm.h>
#include <grpcpp/channel.h>
@@ -237,7 +237,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// service. The service must exist for the lifetime of the Server instance.
void RegisterAsyncGenericService(AsyncGenericService* service) override;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback-based generic service. This call does not take
/// ownership of theservice. The service must exist for the lifetime of the
/// Server instance.
@@ -248,41 +247,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
context_allocator_ = std::move(context_allocator);
}
-#else
- /// NOTE: class experimental_registration_type is not part of the public API
- /// of this class
- /// TODO(vjpai): Move these contents to the public API of Server when
- /// they are no longer experimental
- class experimental_registration_type final
- : public experimental_registration_interface {
- public:
- explicit experimental_registration_type(Server* server) : server_(server) {}
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) override {
- server_->RegisterCallbackGenericService(service);
- }
-
- void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> context_allocator) override {
- server_->context_allocator_ = std::move(context_allocator);
- }
-
- private:
- Server* server_;
- };
-
- /// TODO(vjpai): Mark this override when experimental type above is deleted
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service);
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time.
- experimental_registration_interface* experimental_registration() override {
- return &experimental_registration_;
- }
-#endif
-
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) override;
@@ -327,12 +291,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// the \a sync_server_cqs)
std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- // For registering experimental callback generic service; remove when that
- // method longer experimental
- experimental_registration_type experimental_registration_{this};
-#endif
-
// Server status
internal::Mutex mu_;
bool started_;
@@ -364,11 +322,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// When appropriate, use a default callback generic service to handle
// unimplemented methods
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
std::unique_ptr<CallbackGenericService> unimplemented_service_;
-#else
- std::unique_ptr<experimental::CallbackGenericService> unimplemented_service_;
-#endif
// A special handler for resource exhausted in sync case
std::unique_ptr<internal::MethodHandler> resource_exhausted_handler_;
diff --git a/grpc/include/grpcpp/server_builder.h b/grpc/include/grpcpp/server_builder.h
index 00e82a10..e542ef2c 100644
--- a/grpc/include/grpcpp/server_builder.h
+++ b/grpc/include/grpcpp/server_builder.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SERVER_BUILDER_H
#define GRPCPP_SERVER_BUILDER_H
+#include <grpc/impl/codegen/port_platform.h>
+
#include <climits>
#include <map>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/cpu.h>
#include <grpc/support/workaround_list.h>
@@ -33,6 +33,7 @@
#include <grpcpp/impl/codegen/server_interceptor.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
+#include <grpcpp/security/authorization_policy_provider.h>
#include <grpcpp/server.h>
#include <grpcpp/support/config.h>
@@ -55,13 +56,7 @@ namespace internal {
class ExternalConnectionAcceptorImpl;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
// EXPERIMENTAL API:
@@ -121,8 +116,8 @@ class ServerBuilder {
/// \param addr_uri The address to try to bind to the server in URI form. If
/// the scheme name is omitted, "dns:///" is assumed. To bind to any address,
/// please use IPv6 any, i.e., [::]:<port>, which also accepts IPv4
- /// connections. Valid values include dns:///localhost:1234, /
- /// 192.168.1.1:31416, dns:///[::1]:27182, etc.).
+ /// connections. Valid values include dns:///localhost:1234,
+ /// 192.168.1.1:31416, dns:///[::1]:27182, etc.
/// \param creds The credentials associated with the server.
/// \param[out] selected_port If not `nullptr`, gets populated with the port
/// number bound to the \a grpc::Server for the corresponding endpoint after
@@ -269,20 +264,6 @@ class ServerBuilder {
builder_->interceptor_creators_ = std::move(interceptor_creators);
}
- /// Set the allocator for creating and releasing callback server context.
- /// Takes the owndership of the allocator.
- ServerBuilder& SetContextAllocator(
- std::unique_ptr<grpc::ContextAllocator> context_allocator);
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- /// Register a generic service that uses the callback API.
- /// Matches requests with any :authority
- /// This is mostly useful for writing generic gRPC Proxies where the exact
- /// serialization format is unknown
- ServerBuilder& RegisterCallbackGenericService(
- grpc::experimental::CallbackGenericService* service);
-#endif
-
enum class ExternalConnectionType {
FROM_FD = 0 // in the form of a file descriptor
};
@@ -295,18 +276,27 @@ class ServerBuilder {
AddExternalConnectionAcceptor(ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds);
+ /// Sets server authorization policy provider in
+ /// GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER channel argument.
+ void SetAuthorizationPolicyProvider(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider);
+
private:
ServerBuilder* builder_;
};
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+ /// Set the allocator for creating and releasing callback server context.
+ /// Takes the owndership of the allocator.
+ ServerBuilder& SetContextAllocator(
+ std::unique_ptr<grpc::ContextAllocator> context_allocator);
+
/// Register a generic service that uses the callback API.
/// Matches requests with any :authority
/// This is mostly useful for writing generic gRPC Proxies where the exact
/// serialization format is unknown
ServerBuilder& RegisterCallbackGenericService(
grpc::CallbackGenericService* service);
-#endif
/// NOTE: The function experimental() is not stable public API. It is a view
/// to the experimental components of this class. It may be changed or removed
@@ -361,7 +351,7 @@ class ServerBuilder {
virtual ChannelArguments BuildChannelArgs();
private:
- friend class ::grpc::testing::ServerBuilderPluginTest;
+ friend class grpc::testing::ServerBuilderPluginTest;
struct SyncServerSettings {
SyncServerSettings()
@@ -398,12 +388,7 @@ class ServerBuilder {
grpc_resource_quota* resource_quota_;
grpc::AsyncGenericService* generic_service_{nullptr};
std::unique_ptr<ContextAllocator> context_allocator_;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
grpc::CallbackGenericService* callback_generic_service_{nullptr};
-#else
- grpc::experimental::CallbackGenericService* callback_generic_service_{
- nullptr};
-#endif
struct {
bool is_set;
@@ -420,6 +405,8 @@ class ServerBuilder {
std::vector<std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
acceptors_;
grpc_server_config_fetcher* server_config_fetcher_ = nullptr;
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ authorization_provider_;
};
} // namespace grpc
diff --git a/grpc/include/grpcpp/server_context.h b/grpc/include/grpcpp/server_context.h
index 45f26149..ed6bd66d 100644
--- a/grpc/include/grpcpp/server_context.h
+++ b/grpc/include/grpcpp/server_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SERVER_CONTEXT_H
#define GRPCPP_SERVER_CONTEXT_H
-#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/server_context.h> // IWYU pragma: export
#endif // GRPCPP_SERVER_CONTEXT_H
diff --git a/grpc/include/grpcpp/server_posix.h b/grpc/include/grpcpp/server_posix.h
index ef3ee01a..2e938624 100644
--- a/grpc/include/grpcpp/server_posix.h
+++ b/grpc/include/grpcpp/server_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_SERVER_POSIX_H
#define GRPCPP_SERVER_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/server.h>
namespace grpc {
diff --git a/grpc/include/grpcpp/support/async_stream.h b/grpc/include/grpcpp/support/async_stream.h
index ff9e4556..5f717014 100644
--- a/grpc/include/grpcpp/support/async_stream.h
+++ b/grpc/include/grpcpp/support/async_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H
#define GRPCPP_SUPPORT_ASYNC_STREAM_H
-#include <grpcpp/impl/codegen/async_stream.h>
+#include <grpcpp/impl/codegen/async_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_STREAM_H
diff --git a/grpc/include/grpcpp/support/async_unary_call.h b/grpc/include/grpcpp/support/async_unary_call.h
index 2e5181c5..02071e48 100644
--- a/grpc/include/grpcpp/support/async_unary_call.h
+++ b/grpc/include/grpcpp/support/async_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
#define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
-#include <grpcpp/impl/codegen/async_unary_call.h>
+#include <grpcpp/impl/codegen/async_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
diff --git a/grpc/include/grpcpp/support/byte_buffer.h b/grpc/include/grpcpp/support/byte_buffer.h
index 53aeff19..6f566e76 100644
--- a/grpc/include/grpcpp/support/byte_buffer.h
+++ b/grpc/include/grpcpp/support/byte_buffer.h
@@ -22,7 +22,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-#include <grpcpp/impl/codegen/byte_buffer.h>
+#include <grpcpp/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/slice.h>
diff --git a/grpc/include/grpcpp/support/channel_arguments.h b/grpc/include/grpcpp/support/channel_arguments.h
index a9514bc9..afee7041 100644
--- a/grpc/include/grpcpp/support/channel_arguments.h
+++ b/grpc/include/grpcpp/support/channel_arguments.h
@@ -70,13 +70,7 @@ class ChannelArguments {
/// the resolver.
void SetGrpclbFallbackTimeout(int fallback_timeout);
- /// For client channel's, the socket mutator operates on
- /// "channel" sockets. For server's, the socket mutator operates
- /// only on "listen" sockets.
- /// TODO(apolcyn): allow socket mutators to also operate
- /// on server "channel" sockets, and adjust the socket mutator
- /// object to be more speficic about which type of socket
- /// it should operate on.
+ /// Set a mutator for the underlying socket.
void SetSocketMutator(grpc_socket_mutator* mutator);
/// Set the string to prepend to the user agent.
diff --git a/grpc/include/grpcpp/support/client_callback.h b/grpc/include/grpcpp/support/client_callback.h
index 063fdc4f..c15bca0d 100644
--- a/grpc/include/grpcpp/support/client_callback.h
+++ b/grpc/include/grpcpp/support/client_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_CALLBACK_H
#define GRPCPP_SUPPORT_CLIENT_CALLBACK_H
-#include <grpcpp/impl/codegen/client_callback.h>
+#include <grpcpp/impl/codegen/client_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_CALLBACK_H
diff --git a/grpc/include/grpcpp/support/client_interceptor.h b/grpc/include/grpcpp/support/client_interceptor.h
index 50810e3f..552cab4c 100644
--- a/grpc/include/grpcpp/support/client_interceptor.h
+++ b/grpc/include/grpcpp/support/client_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/client_interceptor.h>
+#include <grpcpp/impl/codegen/client_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
diff --git a/grpc/include/grpcpp/support/config.h b/grpc/include/grpcpp/support/config.h
index 16bdab64..f2632f26 100644
--- a/grpc/include/grpcpp/support/config.h
+++ b/grpc/include/grpcpp/support/config.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CONFIG_H
#define GRPCPP_SUPPORT_CONFIG_H
-#include <grpcpp/impl/codegen/config.h>
+#include <grpcpp/impl/codegen/config.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CONFIG_H
diff --git a/grpc/include/grpcpp/support/interceptor.h b/grpc/include/grpcpp/support/interceptor.h
index 7ff79516..d4f2ea18 100644
--- a/grpc/include/grpcpp/support/interceptor.h
+++ b/grpc/include/grpcpp/support/interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/interceptor.h>
+#include <grpcpp/impl/codegen/interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_INTERCEPTOR_H
diff --git a/grpc/include/grpcpp/support/message_allocator.h b/grpc/include/grpcpp/support/message_allocator.h
index 20ce072b..22a963f3 100644
--- a/grpc/include/grpcpp/support/message_allocator.h
+++ b/grpc/include/grpcpp/support/message_allocator.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
#define GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
-#include <grpcpp/impl/codegen/message_allocator.h>
+#include <grpcpp/impl/codegen/message_allocator.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
diff --git a/grpc/include/grpcpp/support/method_handler.h b/grpc/include/grpcpp/support/method_handler.h
index 038e76c8..0b97a7af 100644
--- a/grpc/include/grpcpp/support/method_handler.h
+++ b/grpc/include/grpcpp/support/method_handler.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_METHOD_HANDLER_H
#define GRPCPP_SUPPORT_METHOD_HANDLER_H
-#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/method_handler.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_METHOD_HANDLER_H
diff --git a/grpc/include/grpcpp/support/proto_buffer_reader.h b/grpc/include/grpcpp/support/proto_buffer_reader.h
index 4cdb65d5..07e523ed 100644
--- a/grpc/include/grpcpp/support/proto_buffer_reader.h
+++ b/grpc/include/grpcpp/support/proto_buffer_reader.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
-#include <grpcpp/impl/codegen/proto_buffer_reader.h>
+#include <grpcpp/impl/codegen/proto_buffer_reader.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
diff --git a/grpc/include/grpcpp/support/proto_buffer_writer.h b/grpc/include/grpcpp/support/proto_buffer_writer.h
index 01cf29c4..589deb82 100644
--- a/grpc/include/grpcpp/support/proto_buffer_writer.h
+++ b/grpc/include/grpcpp/support/proto_buffer_writer.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
-#include <grpcpp/impl/codegen/proto_buffer_writer.h>
+#include <grpcpp/impl/codegen/proto_buffer_writer.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
diff --git a/grpc/include/grpcpp/support/server_callback.h b/grpc/include/grpcpp/support/server_callback.h
index b0aeeb53..1ffdce53 100644
--- a/grpc/include/grpcpp/support/server_callback.h
+++ b/grpc/include/grpcpp/support/server_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_CALLBACK_H
#define GRPCPP_SUPPORT_SERVER_CALLBACK_H
-#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_CALLBACK_H
diff --git a/grpc/include/grpcpp/support/server_interceptor.h b/grpc/include/grpcpp/support/server_interceptor.h
index b0a6229b..ad9c7a18 100644
--- a/grpc/include/grpcpp/support/server_interceptor.h
+++ b/grpc/include/grpcpp/support/server_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
#define GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/server_interceptor.h>
+#include <grpcpp/impl/codegen/server_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
diff --git a/grpc/include/grpcpp/support/slice.h b/grpc/include/grpcpp/support/slice.h
index eaeb29a4..2434983f 100644
--- a/grpc/include/grpcpp/support/slice.h
+++ b/grpc/include/grpcpp/support/slice.h
@@ -20,7 +20,7 @@
#define GRPCPP_SUPPORT_SLICE_H
#include <grpc/slice.h>
-#include <grpcpp/impl/codegen/slice.h>
+#include <grpcpp/impl/codegen/slice.h> // IWYU pragma: export
#include <grpcpp/support/config.h>
#endif // GRPCPP_SUPPORT_SLICE_H
diff --git a/grpc/include/grpcpp/support/status.h b/grpc/include/grpcpp/support/status.h
index 91b629f1..e46b46d1 100644
--- a/grpc/include/grpcpp/support/status.h
+++ b/grpc/include/grpcpp/support/status.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_H
#define GRPCPP_SUPPORT_STATUS_H
-#include <grpcpp/impl/codegen/status.h>
+#include <grpcpp/impl/codegen/status.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_H
diff --git a/grpc/include/grpcpp/support/status_code_enum.h b/grpc/include/grpcpp/support/status_code_enum.h
index bfb47f39..eac697f4 100644
--- a/grpc/include/grpcpp/support/status_code_enum.h
+++ b/grpc/include/grpcpp/support/status_code_enum.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
#define GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
-#include <grpcpp/impl/codegen/status_code_enum.h>
+#include <grpcpp/impl/codegen/status_code_enum.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
diff --git a/grpc/include/grpcpp/support/string_ref.h b/grpc/include/grpcpp/support/string_ref.h
index 0e0d3d43..6cf82bed 100644
--- a/grpc/include/grpcpp/support/string_ref.h
+++ b/grpc/include/grpcpp/support/string_ref.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STRING_REF_H
#define GRPCPP_SUPPORT_STRING_REF_H
-#include <grpcpp/impl/codegen/string_ref.h>
+#include <grpcpp/impl/codegen/string_ref.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STRING_REF_H
diff --git a/grpc/include/grpcpp/support/stub_options.h b/grpc/include/grpcpp/support/stub_options.h
index e9700ea4..ffe1ad77 100644
--- a/grpc/include/grpcpp/support/stub_options.h
+++ b/grpc/include/grpcpp/support/stub_options.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STUB_OPTIONS_H
#define GRPCPP_SUPPORT_STUB_OPTIONS_H
-#include <grpcpp/impl/codegen/stub_options.h>
+#include <grpcpp/impl/codegen/stub_options.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STUB_OPTIONS_H
diff --git a/grpc/include/grpcpp/support/sync_stream.h b/grpc/include/grpcpp/support/sync_stream.h
index ea60b6da..78a348de 100644
--- a/grpc/include/grpcpp/support/sync_stream.h
+++ b/grpc/include/grpcpp/support/sync_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SYNC_STREAM_H
#define GRPCPP_SUPPORT_SYNC_STREAM_H
-#include <grpcpp/impl/codegen/sync_stream.h>
+#include <grpcpp/impl/codegen/sync_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SYNC_STREAM_H
diff --git a/grpc/include/grpcpp/support/time.h b/grpc/include/grpcpp/support/time.h
index c7408ff2..b5e07b68 100644
--- a/grpc/include/grpcpp/support/time.h
+++ b/grpc/include/grpcpp/support/time.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_TIME_H
#define GRPCPP_SUPPORT_TIME_H
-#include <grpcpp/impl/codegen/time.h>
+#include <grpcpp/impl/codegen/time.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_TIME_H
diff --git a/grpc/include/grpcpp/test/client_context_test_peer.h b/grpc/include/grpcpp/test/client_context_test_peer.h
new file mode 100644
index 00000000..0ce96439
--- /dev/null
+++ b/grpc/include/grpcpp/test/client_context_test_peer.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+#define GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+
+#include <map>
+
+#include <grpcpp/client_context.h>
+
+namespace grpc {
+namespace testing {
+
+/// A test-only class to access private members and methods of ClientContext.
+class ClientContextTestPeer {
+ public:
+ explicit ClientContextTestPeer(ClientContext* const ctx) : ctx_(ctx) {}
+
+ /// Inject metadata to the ClientContext for the test. The test peer
+ /// must be alive when a ClientContext::GetServerInitialMetadata is called.
+ void AddServerInitialMetadata(const std::string& key,
+ const std::string& value) {
+ server_initial_metadata_storage_.insert(
+ std::pair<std::string, std::string>(key, value));
+ ctx_->initial_metadata_received_ = true;
+ ctx_->recv_initial_metadata_.map()->clear();
+ for (const auto& item : server_initial_metadata_storage_) {
+ ctx_->recv_initial_metadata_.map()->insert(
+ std::pair<grpc::string_ref, grpc::string_ref>(
+ item.first.c_str(),
+ grpc::string_ref(item.second.data(), item.second.size())));
+ }
+ }
+
+ std::multimap<std::string, std::string> GetSendInitialMetadata() const {
+ return ctx_->send_initial_metadata_;
+ }
+
+ private:
+ ClientContext* const ctx_; // not owned
+ std::multimap<std::string, std::string> server_initial_metadata_storage_;
+};
+
+} // namespace testing
+} // namespace grpc
+
+#endif // GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
diff --git a/grpc/include/grpcpp/test/default_reactor_test_peer.h b/grpc/include/grpcpp/test/default_reactor_test_peer.h
index a792e6f9..4d4ae5c3 100644
--- a/grpc/include/grpcpp/test/default_reactor_test_peer.h
+++ b/grpc/include/grpcpp/test/default_reactor_test_peer.h
@@ -34,22 +34,21 @@ namespace testing {
/// test mode rather than letting it follow the normal paths.
class DefaultReactorTestPeer {
public:
- explicit DefaultReactorTestPeer(experimental::CallbackServerContext* ctx)
- : DefaultReactorTestPeer(ctx, [](::grpc::Status) {}) {}
- DefaultReactorTestPeer(experimental::CallbackServerContext* ctx,
- std::function<void(::grpc::Status)> finish_func)
+ explicit DefaultReactorTestPeer(CallbackServerContext* ctx)
+ : DefaultReactorTestPeer(ctx, [](Status) {}) {}
+ DefaultReactorTestPeer(CallbackServerContext* ctx,
+ std::function<void(Status)> finish_func)
: ctx_(ctx) {
ctx->SetupTestDefaultReactor(std::move(finish_func));
}
- ::grpc::experimental::ServerUnaryReactor* reactor() const {
- return reinterpret_cast<experimental::ServerUnaryReactor*>(
- &ctx_->default_reactor_);
+ ServerUnaryReactor* reactor() const {
+ return reinterpret_cast<ServerUnaryReactor*>(&ctx_->default_reactor_);
}
bool test_status_set() const { return ctx_->test_status_set(); }
Status test_status() const { return ctx_->test_status(); }
private:
- experimental::CallbackServerContext* const ctx_; // not owned
+ CallbackServerContext* const ctx_; // not owned
};
} // namespace testing
diff --git a/grpc/include/grpcpp/test/mock_stream.h b/grpc/include/grpcpp/test/mock_stream.h
index deffad3d..de398087 100644
--- a/grpc/include/grpcpp/test/mock_stream.h
+++ b/grpc/include/grpcpp/test/mock_stream.h
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <gmock/gmock.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
@@ -31,7 +32,7 @@ namespace grpc {
namespace testing {
template <class R>
-class MockClientReader : public ::grpc::ClientReaderInterface<R> {
+class MockClientReader : public grpc::ClientReaderInterface<R> {
public:
MockClientReader() = default;
@@ -47,7 +48,7 @@ class MockClientReader : public ::grpc::ClientReaderInterface<R> {
};
template <class W>
-class MockClientWriter : public ::grpc::ClientWriterInterface<W> {
+class MockClientWriter : public grpc::ClientWriterInterface<W> {
public:
MockClientWriter() = default;
@@ -62,8 +63,7 @@ class MockClientWriter : public ::grpc::ClientWriterInterface<W> {
};
template <class W, class R>
-class MockClientReaderWriter
- : public ::grpc::ClientReaderWriterInterface<W, R> {
+class MockClientReaderWriter : public grpc::ClientReaderWriterInterface<W, R> {
public:
MockClientReaderWriter() = default;
@@ -86,7 +86,7 @@ class MockClientReaderWriter
template <class R>
class MockClientAsyncResponseReader
- : public ::grpc::ClientAsyncResponseReaderInterface<R> {
+ : public grpc::ClientAsyncResponseReaderInterface<R> {
public:
MockClientAsyncResponseReader() = default;
@@ -111,7 +111,7 @@ class MockClientAsyncReader : public ClientAsyncReaderInterface<R> {
};
template <class W>
-class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> {
+class MockClientAsyncWriter : public grpc::ClientAsyncWriterInterface<W> {
public:
MockClientAsyncWriter() = default;
@@ -122,7 +122,7 @@ class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> {
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
+ MOCK_METHOD3_T(Write, void(const W&, grpc::WriteOptions, void*));
/// ClientAsyncWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
@@ -141,7 +141,7 @@ class MockClientAsyncReaderWriter
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
+ MOCK_METHOD3_T(Write, void(const W&, grpc::WriteOptions, void*));
/// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
@@ -150,6 +150,47 @@ class MockClientAsyncReaderWriter
MOCK_METHOD1_T(WritesDone, void(void*));
};
+template <class R>
+class MockServerReader : public grpc::ServerReaderInterface<R> {
+ public:
+ MockServerReader() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+};
+
+template <class W>
+class MockServerWriter : public grpc::ServerWriterInterface<W> {
+ public:
+ MockServerWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
+template <class W, class R>
+class MockServerReaderWriter : public grpc::ServerReaderWriterInterface<W, R> {
+ public:
+ MockServerReaderWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
} // namespace testing
} // namespace grpc
diff --git a/grpc/include/grpcpp/xds_server_builder.h b/grpc/include/grpcpp/xds_server_builder.h
index 076c377f..e2fde72f 100644
--- a/grpc/include/grpcpp/xds_server_builder.h
+++ b/grpc/include/grpcpp/xds_server_builder.h
@@ -24,10 +24,13 @@
#include <grpcpp/server_builder.h>
namespace grpc {
-namespace experimental {
class XdsServerServingStatusNotifierInterface {
public:
+ struct ServingStatusUpdate {
+ grpc::Status status;
+ };
+
virtual ~XdsServerServingStatusNotifierInterface() = default;
// \a uri contains the listening target associated with the notification. Note
@@ -37,11 +40,30 @@ class XdsServerServingStatusNotifierInterface {
// The API does not provide any guarantees around duplicate updates.
// Status::OK signifies that the server is serving, while a non-OK status
// signifies that the server is not serving.
- virtual void OnServingStatusUpdate(std::string uri, grpc::Status status) = 0;
+ virtual void OnServingStatusUpdate(std::string uri,
+ ServingStatusUpdate update) = 0;
};
-class XdsServerBuilder : public ::grpc::ServerBuilder {
+class XdsServerBuilder : public grpc::ServerBuilder {
public:
+ // NOTE: class experimental_type is not part of the public API of this class
+ // TODO(yashykt): Integrate into public API when this is no longer
+ // experimental.
+ class experimental_type : public grpc::ServerBuilder::experimental_type {
+ public:
+ explicit experimental_type(XdsServerBuilder* builder)
+ : ServerBuilder::experimental_type(builder), builder_(builder) {}
+
+ // EXPERIMENTAL: Sets the drain grace period in ms for older connections
+ // when updates to a Listener is received.
+ void set_drain_grace_time(int drain_grace_time_ms) {
+ builder_->drain_grace_time_ms_ = drain_grace_time_ms;
+ }
+
+ private:
+ XdsServerBuilder* builder_;
+ };
+
// It is the responsibility of the application to make sure that \a notifier
// outlasts the life of the server. Notifications will start being made
// asynchronously once `BuildAndStart()` has been called. Note that it is
@@ -50,10 +72,19 @@ class XdsServerBuilder : public ::grpc::ServerBuilder {
notifier_ = notifier;
}
+ /// NOTE: The function experimental() is not stable public API. It is a view
+ /// to the experimental components of this class. It may be changed or removed
+ /// at any time.
+ experimental_type experimental() { return experimental_type(this); }
+
private:
// Called at the beginning of BuildAndStart().
ChannelArguments BuildChannelArgs() override {
ChannelArguments args = ServerBuilder::BuildChannelArgs();
+ if (drain_grace_time_ms_ >= 0) {
+ args.SetInt(GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS,
+ drain_grace_time_ms_);
+ }
grpc_channel_args c_channel_args = args.c_channel_args();
grpc_server_config_fetcher* fetcher = grpc_server_config_fetcher_xds_create(
{OnServingStatusUpdate, notifier_}, &c_channel_args);
@@ -62,18 +93,30 @@ class XdsServerBuilder : public ::grpc::ServerBuilder {
}
static void OnServingStatusUpdate(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message) {
+ grpc_serving_status_update update) {
if (user_data == nullptr) return;
XdsServerServingStatusNotifierInterface* notifier =
static_cast<XdsServerServingStatusNotifierInterface*>(user_data);
notifier->OnServingStatusUpdate(
- uri, grpc::Status(static_cast<StatusCode>(code), error_message));
+ uri, {grpc::Status(static_cast<StatusCode>(update.code),
+ update.error_message)});
}
XdsServerServingStatusNotifierInterface* notifier_ = nullptr;
+ int drain_grace_time_ms_ = -1;
};
+namespace experimental {
+// TODO(yashykt): Delete this after the 1.42 release.
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerServingStatusNotifierInterface instead. The "
+ "experimental version will be deleted after the 1.42 release.")
+typedef grpc::XdsServerServingStatusNotifierInterface
+ XdsServerServingStatusNotifierInterface;
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerBuilder instead. The experimental version will be "
+ "deleted after the 1.42 release.")
+typedef grpc::XdsServerBuilder XdsServerBuilder;
} // namespace experimental
} // namespace grpc
diff --git a/grpc/package.xml b/grpc/package.xml
index c8935d31..ca2ed65b 100644
--- a/grpc/package.xml
+++ b/grpc/package.xml
@@ -13,8 +13,8 @@
<date>2019-09-24</date>
<time>16:06:07</time>
<version>
- <release>1.38.0</release>
- <api>1.38.0</api>
+ <release>1.46.5</release>
+ <api>1.46.5</api>
</version>
<stability>
<release>stable</release>
@@ -22,7 +22,7 @@
</stability>
<license>Apache 2.0</license>
<notes>
-- gRPC Core 1.38.0 update
+- gRPC Core 1.46.5 update
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@@ -33,10 +33,12 @@
<file baseinstalldir="/" name="include/grpc/byte_buffer_reader.h" role="src" />
<file baseinstalldir="/" name="include/grpc/census.h" role="src" />
<file baseinstalldir="/" name="include/grpc/compression.h" role="src" />
- <file baseinstalldir="/" name="include/grpc/event_engine/channel_args.h" role="src" />
+ <file baseinstalldir="/" name="include/grpc/event_engine/endpoint_config.h" role="src" />
<file baseinstalldir="/" name="include/grpc/event_engine/event_engine.h" role="src" />
+ <file baseinstalldir="/" name="include/grpc/event_engine/internal/memory_allocator_impl.h" role="src" />
+ <file baseinstalldir="/" name="include/grpc/event_engine/memory_allocator.h" role="src" />
+ <file baseinstalldir="/" name="include/grpc/event_engine/memory_request.h" role="src" />
<file baseinstalldir="/" name="include/grpc/event_engine/port.h" role="src" />
- <file baseinstalldir="/" name="include/grpc/event_engine/slice_allocator.h" role="src" />
<file baseinstalldir="/" name="include/grpc/fork.h" role="src" />
<file baseinstalldir="/" name="include/grpc/grpc.h" role="src" />
<file baseinstalldir="/" name="include/grpc/grpc_posix.h" role="src" />
@@ -89,6 +91,10 @@
<file baseinstalldir="/" name="include/grpc/support/time.h" role="src" />
<file baseinstalldir="/" name="include/grpc/support/workaround_list.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/census/grpc_context.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/channel_idle/channel_idle_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/channel_idle/channel_idle_filter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/channel_idle/idle_filter_state.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/channel_idle/idle_filter_state.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backend_metric.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backend_metric.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/backup_poller.cc" role="src" />
@@ -126,8 +132,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc" role="src" />
@@ -136,6 +140,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/priority/priority.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/rls/rls.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc" role="src" />
@@ -153,16 +158,15 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/proxy_mapper.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/proxy_mapper_registry.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/proxy_mapper_registry.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc" role="src" />
@@ -171,12 +175,11 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/polling_resolver.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/polling_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver_factory.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver_registry.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver_result_parsing.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver_result_parsing.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/retry_filter.cc" role="src" />
@@ -185,20 +188,14 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/retry_service_config.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/retry_throttle.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/retry_throttle.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/server_address.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/server_address.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config_call_data.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config_parser.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_channel/service_config_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/client_idle/client_idle_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_stream_client.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_stream_client.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/fault_injection/fault_injection_filter.cc" role="src" />
@@ -216,33 +213,26 @@
<file baseinstalldir="/" name="src/core/ext/filters/http/message_compress/message_decompress_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/filters/workarounds/workaround_utils.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/rbac/rbac_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/rbac/rbac_filter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/rbac/rbac_service_config_parser.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/rbac/rbac_service_config_parser.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/server_config_selector/server_config_selector.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/server_config_selector/server_config_selector.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/server_config_selector/server_config_selector_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/filters/server_config_selector/server_config_selector_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/chttp2_server.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/chttp2_server.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_decoder.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_decoder.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_encoder.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_encoder.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_plugin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_transport.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_transport.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/context_list.cc" role="src" />
@@ -262,18 +252,19 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_settings.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_window_update.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_window_update.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_constants.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser_table.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser_table.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.cc" role="src" />
- <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/internal.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/parsing.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_lists.cc" role="src" />
@@ -285,8 +276,26 @@
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_plugin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_transport.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/inproc/inproc_transport.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/annotations/resource.upb.c" role="src" />
@@ -303,6 +312,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c" role="src" />
@@ -315,6 +326,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c" role="src" />
@@ -325,10 +338,14 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c" role="src" />
@@ -341,8 +358,12 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c" role="src" />
@@ -355,14 +376,36 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c" role="src" />
@@ -375,24 +418,22 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c" role="src" />
@@ -413,14 +454,22 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/http.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/http.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/percent.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/percent.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/range.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/range.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c" role="src" />
@@ -429,6 +478,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/httpbody.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/httpbody.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.c" role="src" />
@@ -445,6 +496,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c" role="src" />
@@ -455,6 +508,10 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/migrate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/migrate.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/security.upb.c" role="src" />
@@ -465,26 +522,62 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/status.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/versioning.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/versioning.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/security.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/security.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/status.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/status.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/authority.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/authority.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/context_params.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/context_params.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/extension.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/extension.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c" role="src" />
@@ -501,6 +594,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c" role="src" />
@@ -513,6 +608,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c" role="src" />
@@ -523,10 +620,14 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c" role="src" />
@@ -539,26 +640,54 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c" role="src" />
@@ -571,24 +700,22 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c" role="src" />
@@ -609,18 +736,32 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/http.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/http.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c" role="src" />
@@ -637,6 +778,10 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c" role="src" />
@@ -647,22 +792,40 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c" role="src" />
- <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/validate/validate.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/validate/validate.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/certificate_provider_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/certificate_provider_registry.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/certificate_provider_registry.h" role="src" />
@@ -670,6 +833,7 @@
<file baseinstalldir="/" name="src/core/ext/xds/certificate_provider_store.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/file_watcher_certificate_provider_factory.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/file_watcher_certificate_provider_factory.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/upb_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_bootstrap.cc" role="src" />
@@ -677,29 +841,55 @@
<file baseinstalldir="/" name="src/core/ext/xds/xds_certificate_provider.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_certificate_provider.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_channel_args.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_channel_stack_modifier.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_channel_stack_modifier.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client_stats.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_cluster.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_cluster.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_cluster_specifier_plugin.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_cluster_specifier_plugin.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_common_types.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_common_types.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_endpoint.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_endpoint.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_fault_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_fault_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_filters.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_filters.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_http_rbac_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_http_rbac_filter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_listener.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_listener.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_resource_type.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_resource_type.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_resource_type_impl.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_route_config.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_route_config.h" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_routing.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/ext/xds/xds_routing.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_server_config_fetcher.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/address_utils/parse_address.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/address_utils/parse_address.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/address_utils/sockaddr_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/address_utils/sockaddr_utils.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/avl/avl.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/avl/avl.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/backoff/backoff.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/backoff/backoff.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/call_finalization.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/call_tracer.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channel_args_preconditioning.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channel_args_preconditioning.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder_impl.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder_impl.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_trace.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channelz.cc" role="src" />
@@ -714,33 +904,34 @@
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/promise_based_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/channel/promise_based_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/status_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/status_util.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/algorithm_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/compression.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/compression_args.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/compression_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/compression_internal.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/compression_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression_gzip.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression_gzip.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression_identity.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/compression/stream_compression_identity.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/config/core_configuration.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/config/core_configuration.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/stats.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/stats_data.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/stats_data.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/event_engine/slice_allocator.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/channel_args_endpoint_config.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/channel_args_endpoint_config.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/default_event_engine_factory.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/event_engine.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/event_engine_factory.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/memory_allocator.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/resolved_address.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/sockaddr.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/event_engine/sockaddr.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/arena.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/atm.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/cpu_iphone.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/cpu_linux.cc" role="src" />
@@ -774,20 +965,18 @@
<file baseinstalldir="/" name="src/core/lib/gpr/time_precise.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/time_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tls.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/tls_gcc.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/tls_msvc.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/tls_pthread.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/tls_pthread.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gpr/tls_stdcpp.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile_msys.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/useful.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/wrap_memcpy.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gprpp/arena.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gprpp/arena.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/gprpp/atomic.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/atomic_utils.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/bitset.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/capture.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/chunked_vector.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/construct_destruct.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/cpp_impl_of.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/debug_location.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/dual_ref_counted.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/examine_stack.cc" role="src" />
@@ -802,21 +991,27 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/host_port.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/host_port.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/manual_constructor.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/match.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/memory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/mpscq.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/mpscq.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/orphanable.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/overload.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/ref_counted.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/ref_counted_ptr.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/single_set_ptr.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/stat.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/stat_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/stat_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/status_helper.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/status_helper.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/sync.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/table.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/thd_windows.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/time.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/gprpp/time.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/time_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/time_util.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/format_request.cc" role="src" />
@@ -824,6 +1019,7 @@
<file baseinstalldir="/" name="src/core/lib/http/httpcli.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/http/httpcli_ssl_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/parser.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/block_annotate.h" role="src" />
@@ -843,8 +1039,8 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_cfstream.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_cfstream.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_pair.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_pair_event_engine.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_pair_posix.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_pair_uv.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/endpoint_pair_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/error.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/error.h" role="src" />
@@ -855,13 +1051,25 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_apple.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_epoll1_linux.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_epoll1_linux.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/ev_epollex_linux.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/ev_epollex_linux.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_poll_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_poll_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/ev_windows.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/closure.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/closure.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/endpoint.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/endpoint.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/iomgr.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/pollset.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/pollset.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/promise.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/resolved_address_internal.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/resolved_address_internal.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/resolver.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/resolver.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/tcp.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/event_engine/timer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/exec_ctx.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/exec_ctx.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/executor.cc" role="src" />
@@ -885,16 +1093,11 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/iocp_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_internal.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_posix_cfstream.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_uv.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/iomgr_windows.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/is_epollexclusive_available.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/is_epollexclusive_available.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/load_file.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/load_file.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/lockfree_event.cc" role="src" />
@@ -904,31 +1107,25 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/polling_entity.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_set_windows.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_uv.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/pollset_uv.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/pollset_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/port.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/python_util.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_custom.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_impl.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_posix.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_windows.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/resource_quota.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/resource_quota.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/resolve_address_windows.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/resolved_address.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/sockaddr.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/sockaddr_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/sockaddr_posix.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/iomgr/sockaddr_utils_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/sockaddr_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_factory_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_factory_posix.h" role="src" />
@@ -939,49 +1136,37 @@
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_utils_linux.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_utils_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_utils_posix.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/socket_utils_uv.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_utils_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/socket_windows.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/sys_epoll_wrapper.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client_cfstream.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client_custom.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_client_windows.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/tcp_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/tcp_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_custom.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_utils_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_utils_posix_common.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_server_windows.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/tcp_uv.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/tcp_windows.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/time_averaged_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/time_averaged_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/timer_custom.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/timer_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_generic.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_generic.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_heap.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_heap.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_manager.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/timer_manager.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/timer_uv.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/udp_server.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/iomgr/udp_server.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/unix_sockets_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/unix_sockets_posix.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/unix_sockets_posix_noop.cc" role="src" />
@@ -1003,6 +1188,60 @@
<file baseinstalldir="/" name="src/core/lib/profiling/basic_timers.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/profiling/stap_timers.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/profiling/timers.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/activity.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/activity.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/arena_promise.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/call_push_pull.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/context.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/detail/basic_seq.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/detail/promise_factory.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/detail/promise_like.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/detail/status.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/detail/switch.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/exec_ctx_wakeup_scheduler.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/intra_activity_waiter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/latch.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/loop.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/map.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/poll.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/promise.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/race.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/seq.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/sleep.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/sleep.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/promise/try_seq.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/resolver.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/resolver.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/resolver_factory.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/resolver_registry.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/resolver_registry.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/server_address.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resolver/server_address.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/api.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/api.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/arena.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/arena.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/memory_quota.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/memory_quota.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/resource_quota.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/resource_quota.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/thread_quota.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/thread_quota.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/trace.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/resource_quota/trace.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/authorization_engine.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/authorization_policy_provider.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/authorization_policy_provider_vtable.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/grpc_authorization_engine.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/grpc_authorization_engine.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/grpc_server_authz_filter.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/grpc_server_authz_filter.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/matchers.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/matchers.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/rbac_policy.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/authorization/rbac_policy.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/alts_credentials.cc" role="src" />
@@ -1016,11 +1255,14 @@
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/call_creds_util.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/call_creds_util.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/channel_creds_registry.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/channel_creds_registry_init.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/security/credentials/credentials_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/external/aws_external_account_credentials.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/external/aws_external_account_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/external/aws_request_signer.cc" role="src" />
@@ -1039,6 +1281,7 @@
<file baseinstalldir="/" name="src/core/lib/security/credentials/iam/iam_credentials.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/iam/iam_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/insecure/insecure_credentials.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/insecure/insecure_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/jwt/json_token.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/jwt/json_token.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/jwt/jwt_credentials.cc" role="src" />
@@ -1057,6 +1300,8 @@
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/tls/tls_credentials.cc" role="src" />
@@ -1098,19 +1343,32 @@
<file baseinstalldir="/" name="src/core/lib/security/transport/tsi_error.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/util/json_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/util/json_util.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config_call_data.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config_impl.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config_impl.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config_parser.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/service_config/service_config_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/b64.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/b64.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/percent_encoding.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/percent_encoding.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_buffer.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/slice/slice_intern.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_internal.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_refcount.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_refcount.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_refcount_base.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_split.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/slice/slice_split.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_string_helpers.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/slice/slice_string_helpers.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/slice/slice_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/surface/builtins.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/surface/builtins.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/byte_buffer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/byte_buffer_reader.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/call.cc" role="src" />
@@ -1133,7 +1391,6 @@
<file baseinstalldir="/" name="src/core/lib/surface/event_string.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/surface/init_secure.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/lame_client.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/lame_client.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/metadata_array.cc" role="src" />
@@ -1142,8 +1399,6 @@
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/version.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/authority_override.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/authority_override.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/byte_stream.cc" role="src" />
@@ -1153,18 +1408,13 @@
<file baseinstalldir="/" name="src/core/lib/transport/error_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/error_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/http2_errors.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/metadata.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/metadata.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/metadata_batch.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/metadata_batch.h" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/transport/parsed_metadata.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/lib/transport/parsed_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/pid_controller.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/pid_controller.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/static_metadata.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/static_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/status_conversion.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/status_conversion.h" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/status_metadata.cc" role="src" />
- <file baseinstalldir="/" name="src/core/lib/transport/status_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/timeout_encoding.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/timeout_encoding.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/transport.cc" role="src" />
@@ -1174,6 +1424,7 @@
<file baseinstalldir="/" name="src/core/lib/uri/uri_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/uri/uri_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry_extra.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/crypt/aes_gcm.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/crypt/gsec.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/crypt/gsec.h" role="src" />
@@ -1215,6 +1466,8 @@
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.h" role="src" />
+ <file baseinstalldir="/" name="src/core/tsi/ssl/key_logging/ssl_key_logging.cc" role="src" />
+ <file baseinstalldir="/" name="src/core/tsi/ssl/key_logging/ssl_key_logging.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session_cache.cc" role="src" />
@@ -1265,8 +1518,7 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/dynamic_annotations.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/endian.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/errno_saver.h" role="src" />
- <file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/exponential_biased.cc" role="src" />
- <file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/exponential_biased.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/fast_type_id.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/hide_ptr.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/identity.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/base/internal/inline_variable.h" role="src" />
@@ -1332,8 +1584,10 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc" role="src" />
@@ -1346,6 +1600,7 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_elf.inc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_win32.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/functional/bind_front.h" role="src" />
@@ -1357,8 +1612,8 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/city.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/hash.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/hash.h" role="src" />
- <file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/wyhash.cc" role="src" />
- <file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/wyhash.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/memory/memory.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/meta/type_traits.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/bits.h" role="src" />
@@ -1368,6 +1623,54 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/internal/bits.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/internal/representation.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/bernoulli_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/beta_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/discrete_distribution.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/discrete_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/distributions.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/exponential_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/gaussian_distribution.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/gaussian_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/distribution_caller.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/fastmath.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/generate_real.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/nonsecure_base.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/pcg_engine.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/platform.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/pool_urbg.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/pool_urbg.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_detect.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_detect.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_engine.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_hwaes.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_slow.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_slow.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/randen_traits.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/seed_material.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/seed_material.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/traits.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/uniform_helper.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/internal/wide_multiply.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/poisson_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/random.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/seed_gen_exception.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/seed_gen_exception.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/seed_sequences.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/seed_sequences.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/uniform_int_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/uniform_real_distribution.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/random/zipf_distribution.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/status/internal/status_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/status/internal/statusor_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/status/status.cc" role="src" />
@@ -1391,10 +1694,27 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/charconv_parse.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_internal.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_internal.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_functions.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_handle.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_info.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_info.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h" role="src" />
+ <file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/escaping.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/escaping.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/strings/internal/memutil.cc" role="src" />
@@ -1516,18 +1836,19 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/a_utf8.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/asn1_locl.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/charmap.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c" role="src" />
@@ -1721,10 +2042,10 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/kdf.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/hpke/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/hrss/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/internal.h" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/lhash/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/mem.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/obj/obj.c" role="src" />
@@ -1774,21 +2095,19 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/by_file.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/charmap.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/internal.h" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/name_print.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/t_req.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/vpm_int.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/x509.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c" role="src" />
@@ -1827,7 +2146,6 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c" role="src" />
@@ -1897,6 +2215,7 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/ex_data.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/hkdf.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/hmac.h" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/hpke.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/hrss.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/is_boringssl.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/lhash.h" role="src" />
@@ -1943,6 +2262,7 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/dtls_method.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/dtls_record.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc" role="src" />
+ <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/extensions.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/handoff.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/handshake.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/handshake_client.cc" role="src" />
@@ -1966,7 +2286,6 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/t1_enc.cc" role="src" />
- <file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/t1_lib.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/tls13_both.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/tls13_client.cc" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc" role="src" />
@@ -2026,31 +2345,38 @@
<file baseinstalldir="/" name="third_party/re2/util/test.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/utf.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/util.h" role="src" />
- <file baseinstalldir="/" name="third_party/upb/third_party/wyhash/wyhash.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/third_party/utf8_range/naive.c" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/third_party/utf8_range/range2-neon.c" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/third_party/utf8_range/range2-sse.c" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/third_party/utf8_range/utf8_range.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.h" role="src" />
- <file baseinstalldir="/" name="third_party/upb/upb/decode.int.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode_fast.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode_fast.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/decode_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/def.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/def.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/def.hpp" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/encode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/encode.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/json_encode.c" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/json_encode.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/msg.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/msg.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/msg_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/port_def.inc" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/port_undef.inc" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/reflection.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/reflection.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/reflection.hpp" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/table.c" role="src" />
- <file baseinstalldir="/" name="third_party/upb/upb/table.int.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/table_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/text_encode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/text_encode.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/upb.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/upb.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/upb.hpp" role="src" />
- <file baseinstalldir="/" name="third_party/upb/upb/upb.int.h" role="src" />
+ <file baseinstalldir="/" name="third_party/upb/upb/upb_internal.h" role="src" />
<file baseinstalldir="/" name="third_party/xxhash/xxhash.h" role="src" />
<file baseinstalldir="/" name="third_party/zlib/adler32.c" role="src" />
<file baseinstalldir="/" name="third_party/zlib/compress.c" role="src" />
diff --git a/grpc/requirements.bazel.txt b/grpc/requirements.bazel.txt
index 4b7135b3..e24eca17 100644
--- a/grpc/requirements.bazel.txt
+++ b/grpc/requirements.bazel.txt
@@ -3,14 +3,17 @@ coverage==4.5.4
cython==0.29.21
enum34==1.1.10
protobuf>=3.5.0.post1, < 4.0dev
-six==1.15.0
+six==1.16.0
wheel==0.36.2
futures==3.1.1
google-auth==1.24.0
oauth2client==4.1.0
requests==2.25.1
-urllib3==1.26.3
+urllib3==1.26.5
chardet==3.0.4
certifi==2017.4.17
idna==2.7
googleapis-common-protos==1.5.5
+gevent==21.1.2
+zope.event==4.5.0
+setuptools==44.1.1
diff --git a/grpc/setup.py b/grpc/setup.py
index c93d419f..5ac221ad 100644
--- a/grpc/setup.py
+++ b/grpc/setup.py
@@ -13,13 +13,14 @@
# limitations under the License.
"""A setup module for the GRPC Python package."""
-# setuptools need to be imported before distutils. Otherwise it might lead to
-# undesirable behaviors or errors.
-import setuptools
+# NOTE(https://github.com/grpc/grpc/issues/24028): allow setuptools to monkey
+# patch distutils
+import setuptools # isort:skip
# Monkey Patch the unix compiler to accept ASM
# files used by boring SSL.
from distutils.unixccompiler import UnixCCompiler
+
UnixCCompiler.src_extensions.append('.S')
del UnixCCompiler
@@ -28,19 +29,19 @@ from distutils import extension as _extension
from distutils import util
import os
import os.path
-import pkg_resources
import platform
import re
import shlex
import shutil
+import subprocess
+from subprocess import PIPE
import sys
import sysconfig
+import _metadata
+import pkg_resources
from setuptools.command import egg_info
-import subprocess
-from subprocess import PIPE
-
# Redirect the manifest template from MANIFEST.in to PYTHON-MANIFEST.in.
egg_info.manifest_maker.template = 'PYTHON-MANIFEST.in'
@@ -54,6 +55,7 @@ ABSL_INCLUDE = (os.path.join('third_party', 'abseil-cpp'),)
ADDRESS_SORTING_INCLUDE = (os.path.join('third_party', 'address_sorting',
'include'),)
CARES_INCLUDE = (
+ os.path.join('third_party', 'cares', 'cares', 'include'),
os.path.join('third_party', 'cares'),
os.path.join('third_party', 'cares', 'cares'),
)
@@ -84,8 +86,9 @@ sys.path.insert(0, os.path.abspath(PYTHON_STEM))
# Break import-style to ensure we can actually find our in-repo dependencies.
import _parallel_compile_patch
import _spawn_patch
-import commands
import grpc_core_dependencies
+
+import commands
import grpc_version
_parallel_compile_patch.monkeypatch_compile_maybe()
@@ -96,14 +99,13 @@ LICENSE = 'Apache License 2.0'
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: Apache Software License',
]
@@ -159,7 +161,7 @@ BUILD_WITH_SYSTEM_RE2 = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_RE2', 'False')
# without statically linking libstdc++ (which leads to a slight increase in the wheel size).
# This option is useful when crosscompiling wheels for aarch64 where
# it's difficult to ensure that the crosscompilation toolchain has a high-enough version
-# of GCC (we require >4.9) but still uses old-enough libstdc++ symbols.
+# of GCC (we require >=5.1) but still uses old-enough libstdc++ symbols.
# TODO(jtattermusch): remove this workaround once issues with crosscompiler version are resolved.
BUILD_WITH_STATIC_LIBSTDCXX = _env_bool_value(
'GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX', 'False')
@@ -198,8 +200,8 @@ def check_linker_need_libatomic():
"""Test if linker on system needs libatomic."""
code_test = (b'#include <atomic>\n' +
b'int main() { return std::atomic<int64_t>{}; }')
- cxx = os.environ.get('CXX', 'c++')
- cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
+ cxx = shlex.split(os.environ.get('CXX', 'c++'))
+ cpp_test = subprocess.Popen(cxx + ['-x', 'c++', '-std=c++11', '-'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
@@ -209,7 +211,7 @@ def check_linker_need_libatomic():
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
cpp_test = subprocess.Popen(
- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'],
+ [cxx, '-x', 'c++', '-std=c++11', '-', '-latomic'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
@@ -246,7 +248,7 @@ if EXTRA_ENV_COMPILE_ARGS is None:
elif "linux" in sys.platform:
EXTRA_ENV_COMPILE_ARGS += ' -std=gnu99 -fvisibility=hidden -fno-wrapv -fno-exceptions'
elif "darwin" in sys.platform:
- EXTRA_ENV_COMPILE_ARGS += ' -stdlib=libc++ -fvisibility=hidden -fno-wrapv -fno-exceptions'
+ EXTRA_ENV_COMPILE_ARGS += ' -stdlib=libc++ -fvisibility=hidden -fno-wrapv -fno-exceptions -DHAVE_UNISTD_H'
if EXTRA_ENV_LINK_ARGS is None:
EXTRA_ENV_LINK_ARGS = ''
@@ -260,7 +262,7 @@ if EXTRA_ENV_LINK_ARGS is None:
' -static-libgcc -static-libstdc++ -mcrtdll={msvcr}'
' -static -lshlwapi'.format(msvcr=msvcr))
if "linux" in sys.platform:
- EXTRA_ENV_LINK_ARGS += ' -Wl,-wrap,memcpy -static-libgcc'
+ EXTRA_ENV_LINK_ARGS += ' -static-libgcc'
EXTRA_COMPILE_ARGS = shlex.split(EXTRA_ENV_COMPILE_ARGS)
EXTRA_LINK_ARGS = shlex.split(EXTRA_ENV_LINK_ARGS)
@@ -311,8 +313,9 @@ if not "win32" in sys.platform:
if "win32" in sys.platform:
EXTENSION_LIBRARIES += (
'advapi32',
- 'ws2_32',
+ 'bcrypt',
'dbghelp',
+ 'ws2_32',
)
if BUILD_WITH_SYSTEM_OPENSSL:
EXTENSION_LIBRARIES += (
@@ -329,6 +332,22 @@ if BUILD_WITH_SYSTEM_RE2:
DEFINE_MACROS = (('_WIN32_WINNT', 0x600),)
asm_files = []
+
+# Quotes on Windows build macros are evaluated differently from other platforms,
+# so we must apply quotes asymmetrically in order to yield the proper result in
+# the binary.
+def _quote_build_define(argument):
+ if "win32" in sys.platform:
+ return '"\\\"{}\\\""'.format(argument)
+ return '"{}"'.format(argument)
+
+
+DEFINE_MACROS += (
+ ("GRPC_XDS_USER_AGENT_NAME_SUFFIX", _quote_build_define("Python")),
+ ("GRPC_XDS_USER_AGENT_VERSION_SUFFIX",
+ _quote_build_define(_metadata.__version__)),
+)
+
asm_key = ''
if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL:
boringssl_asm_platform = BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM if BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM else util.get_platform(
@@ -519,6 +538,7 @@ setuptools.setup(
packages=list(PACKAGES),
package_dir=PACKAGE_DIRECTORIES,
package_data=PACKAGE_DATA,
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRES,
setup_requires=SETUP_REQUIRES,
diff --git a/grpc/spm-core-include/grpc/byte_buffer.h b/grpc/spm-core-include/grpc/byte_buffer.h
index ee740f47..fff33cb8 100644
--- a/grpc/spm-core-include/grpc/byte_buffer.h
+++ b/grpc/spm-core-include/grpc/byte_buffer.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer.h>
+#include <grpc/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpc/slice_buffer.h>
#endif /* GRPC_BYTE_BUFFER_H */
diff --git a/grpc/spm-core-include/grpc/byte_buffer_reader.h b/grpc/spm-core-include/grpc/byte_buffer_reader.h
index 15e06cad..763dd780 100644
--- a/grpc/spm-core-include/grpc/byte_buffer_reader.h
+++ b/grpc/spm-core-include/grpc/byte_buffer_reader.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer_reader.h>
+#include <grpc/impl/codegen/byte_buffer_reader.h> // IWYU pragma: export
#endif /* GRPC_BYTE_BUFFER_READER_H */
diff --git a/grpc/spm-core-include/grpc/event_engine/channel_args.h b/grpc/spm-core-include/grpc/event_engine/channel_args.h
deleted file mode 100644
index d809b1fb..00000000
--- a/grpc/spm-core-include/grpc/event_engine/channel_args.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2021 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.
-#ifndef GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
-#define GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
-
-#include <grpc/support/port_platform.h>
-
-namespace grpc_event_engine {
-namespace experimental {
-
-// TODO(hork): define
-class ChannelArgs;
-
-} // namespace experimental
-} // namespace grpc_event_engine
-
-#endif // GRPC_EVENT_ENGINE_CHANNEL_ARGS_H
diff --git a/grpc/spm-core-include/grpc/event_engine/endpoint_config.h b/grpc/spm-core-include/grpc/event_engine/endpoint_config.h
new file mode 100644
index 00000000..6ca4b4f7
--- /dev/null
+++ b/grpc/spm-core-include/grpc/event_engine/endpoint_config.h
@@ -0,0 +1,43 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+#define GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include "absl/strings/string_view.h"
+#include "absl/types/variant.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Collection of parameters used to configure client and server endpoints. The
+/// \a EndpointConfig maps string-valued keys to values of type int,
+/// string_view, or void pointer. Each EventEngine implementation should
+/// document its set of supported configuration options.
+class EndpointConfig {
+ public:
+ virtual ~EndpointConfig() = default;
+ using Setting = absl::variant<absl::monostate, int, absl::string_view, void*>;
+ /// Returns the Setting for a specified key, or \a absl::monostate if there is
+ /// no such entry. Caller does not take ownership of the resulting value.
+ virtual Setting Get(absl::string_view key) const = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
diff --git a/grpc/spm-core-include/grpc/event_engine/event_engine.h b/grpc/spm-core-include/grpc/event_engine/event_engine.h
index cdb59662..63c92bf8 100644
--- a/grpc/spm-core-include/grpc/event_engine/event_engine.h
+++ b/grpc/spm-core-include/grpc/event_engine/event_engine.h
@@ -23,13 +23,11 @@
#include "absl/status/statusor.h"
#include "absl/time/time.h"
-#include "grpc/event_engine/channel_args.h"
-#include "grpc/event_engine/port.h"
-#include "grpc/event_engine/slice_allocator.h"
+#include <grpc/event_engine/endpoint_config.h>
+#include <grpc/event_engine/memory_allocator.h>
+#include <grpc/event_engine/port.h>
-// TODO(hork): explicitly define lifetimes and ownership of all objects.
// TODO(hork): Define the Endpoint::Write metrics collection system
-
namespace grpc_event_engine {
namespace experimental {
@@ -75,16 +73,37 @@ namespace experimental {
////////////////////////////////////////////////////////////////////////////////
class EventEngine {
public:
- /// A basic callable function. The first argument to all callbacks is an
- /// absl::Status indicating the status of the operation associated with this
- /// callback. Each EventEngine method that takes a callback parameter, defines
- /// the expected sets and meanings of statuses for that use case.
- using Callback = std::function<void(absl::Status)>;
- /// A callback handle, used to cancel a callback.
+ /// A custom closure type for EventEngine task execution.
+ ///
+ /// Throughout the EventEngine API, \a Closure ownership is retained by the
+ /// caller - the EventEngine will never delete a Closure, and upon
+ /// cancellation, the EventEngine will simply forget the Closure exists. The
+ /// caller is responsible for all necessary cleanup.
+ class Closure {
+ public:
+ Closure() = default;
+ // Closure's are an interface, and thus non-copyable.
+ Closure(const Closure&) = delete;
+ Closure& operator=(const Closure&) = delete;
+ // Polymorphic type => virtual destructor
+ virtual ~Closure() = default;
+ // Run the contained code.
+ virtual void Run() = 0;
+ };
+ /// Represents a scheduled task.
+ ///
+ /// \a TaskHandles are returned by \a Run* methods, and can be given to the
+ /// \a Cancel method.
struct TaskHandle {
- intptr_t key;
+ intptr_t keys[2];
};
- /// A thin wrapper around a platform-specific sockaddr type. A sockaddr struct
+ /// A handle to a cancellable connection attempt.
+ ///
+ /// Returned by \a Connect, and can be passed to \a CancelConnect.
+ struct ConnectionHandle {
+ intptr_t keys[2];
+ };
+ /// Thin wrapper around a platform-specific sockaddr type. A sockaddr struct
/// exists on all platforms that gRPC supports.
///
/// Platforms are expected to provide definitions for:
@@ -96,28 +115,30 @@ class EventEngine {
static constexpr socklen_t MAX_SIZE_BYTES = 128;
ResolvedAddress(const sockaddr* address, socklen_t size);
+ ResolvedAddress() = default;
+ ResolvedAddress(const ResolvedAddress&) = default;
const struct sockaddr* address() const;
socklen_t size() const;
private:
char address_[MAX_SIZE_BYTES];
- socklen_t size_;
+ socklen_t size_ = 0;
};
- /// An Endpoint represents one end of a connection between a gRPC client and
- /// server. Endpoints are created when connections are established, and
- /// Endpoint operations are gRPC's primary means of communication.
+ /// One end of a connection between a gRPC client and server. Endpoints are
+ /// created when connections are established, and Endpoint operations are
+ /// gRPC's primary means of communication.
///
- /// Endpoints must use the provided SliceAllocator for all data buffer memory
+ /// Endpoints must use the provided MemoryAllocator for all data buffer memory
/// allocations. gRPC allows applications to set memory constraints per
/// Channel or Server, and the implementation depends on all dynamic memory
/// allocation being handled by the quota system.
class Endpoint {
public:
- /// The Endpoint destructor is responsible for shutting down all connections
- /// and invoking all pending read or write callbacks with an error status.
+ /// Shuts down all connections and invokes all pending read or write
+ /// callbacks with an error status.
virtual ~Endpoint() = default;
- /// Read data from the Endpoint.
+ /// Reads data from the Endpoint.
///
/// When data is available on the connection, that data is moved into the
/// \a buffer, and the \a on_read callback is called. The caller must ensure
@@ -125,33 +146,41 @@ class EventEngine {
/// Ownership of the buffer is not transferred. Valid slices *may* be placed
/// into the buffer even if the callback is invoked with a non-OK Status.
///
+ /// There can be at most one outstanding read per Endpoint at any given
+ /// time. An outstanding read is one in which the \a on_read callback has
+ /// not yet been executed for some previous call to \a Read. If an attempt
+ /// is made to call \a Read while a previous read is still outstanding, the
+ /// \a EventEngine must abort.
+ ///
/// For failed read operations, implementations should pass the appropriate
/// statuses to \a on_read. For example, callbacks might expect to receive
- /// DEADLINE_EXCEEDED when the deadline is exceeded, and CANCELLED on
- /// endpoint shutdown.
- virtual void Read(Callback on_read, SliceBuffer* buffer,
- absl::Time deadline) = 0;
- /// Write data out on the connection.
+ /// CANCELLED on endpoint shutdown.
+ virtual void Read(std::function<void(absl::Status)> on_read,
+ SliceBuffer* buffer) = 0;
+ /// Writes data out on the connection.
///
/// \a on_writable is called when the connection is ready for more data. The
/// Slices within the \a data buffer may be mutated at will by the Endpoint
/// until \a on_writable is called. The \a data SliceBuffer will remain
- /// valid after calling \a Write, but its state is otherwise undefined.
+ /// valid after calling \a Write, but its state is otherwise undefined. All
+ /// bytes in \a data must have been written before calling \a on_writable
+ /// unless an error has occurred.
+ ///
+ /// There can be at most one outstanding write per Endpoint at any given
+ /// time. An outstanding write is one in which the \a on_writable callback
+ /// has not yet been executed for some previous call to \a Write. If an
+ /// attempt is made to call \a Write while a previous write is still
+ /// outstanding, the \a EventEngine must abort.
///
/// For failed write operations, implementations should pass the appropriate
/// statuses to \a on_writable. For example, callbacks might expect to
- /// receive DEADLINE_EXCEEDED when the deadline is exceeded, and CANCELLED
- /// on endpoint shutdown.
- virtual void Write(Callback on_writable, SliceBuffer* data,
- absl::Time deadline) = 0;
- // TODO(hork): define status codes for the callback
- // TODO(hork): define cleanup operations, lifetimes, responsibilities.
- virtual void Close(Callback on_close) = 0;
- /// These methods return an address in the format described in DNSResolver.
- /// The returned values are owned by the Endpoint and are expected to remain
- /// valid for the life of the Endpoint.
- virtual const ResolvedAddress* GetPeerAddress() const = 0;
- virtual const ResolvedAddress* GetLocalAddress() const = 0;
+ /// receive CANCELLED on endpoint shutdown.
+ virtual void Write(std::function<void(absl::Status)> on_writable,
+ SliceBuffer* data) = 0;
+ /// Returns an address in the format described in DNSResolver. The returned
+ /// values are expected to remain valid for the life of the Endpoint.
+ virtual const ResolvedAddress& GetPeerAddress() const = 0;
+ virtual const ResolvedAddress& GetLocalAddress() const = 0;
};
/// Called when a new connection is established.
@@ -163,12 +192,13 @@ class EventEngine {
using OnConnectCallback =
std::function<void(absl::StatusOr<std::unique_ptr<Endpoint>>)>;
- /// An EventEngine Listener listens for incoming connection requests from gRPC
- /// clients and initiates request processing once connections are established.
+ /// Listens for incoming connection requests from gRPC clients and initiates
+ /// request processing once connections are established.
class Listener {
public:
/// Called when the listener has accepted a new client connection.
- using AcceptCallback = std::function<void(std::unique_ptr<Endpoint>)>;
+ using AcceptCallback = std::function<void(
+ std::unique_ptr<Endpoint>, MemoryAllocator memory_allocator)>;
virtual ~Listener() = default;
/// Bind an address/port to this Listener.
///
@@ -182,52 +212,56 @@ class EventEngine {
/// Factory method to create a network listener / server.
///
/// Once a \a Listener is created and started, the \a on_accept callback will
- /// be called once asynchronously for each established connection. Note that
- /// unlike other callbacks, there is no status code parameter since the
- /// callback will only be called in healthy scenarios where connections can be
- /// accepted.
- ///
- /// This method may return a non-OK status immediately if an error was
- /// encountered in any synchronous steps required to create the Listener. In
- /// this case, \a on_shutdown will never be called.
+ /// be called once asynchronously for each established connection. This method
+ /// may return a non-OK status immediately if an error was encountered in any
+ /// synchronous steps required to create the Listener. In this case,
+ /// \a on_shutdown will never be called.
///
/// If this method returns a Listener, then \a on_shutdown will be invoked
/// exactly once, when the Listener is shut down. The status passed to it will
/// indicate if there was a problem during shutdown.
///
- /// The provided \a SliceAllocatorFactory is used to create \a SliceAllocators
- /// for Endpoint construction.
+ /// The provided \a MemoryAllocatorFactory is used to create \a
+ /// MemoryAllocators for Endpoint construction.
virtual absl::StatusOr<std::unique_ptr<Listener>> CreateListener(
- Listener::AcceptCallback on_accept, Callback on_shutdown,
- const ChannelArgs& args,
- SliceAllocatorFactory slice_allocator_factory) = 0;
+ Listener::AcceptCallback on_accept,
+ std::function<void(absl::Status)> on_shutdown,
+ const EndpointConfig& config,
+ std::unique_ptr<MemoryAllocatorFactory> memory_allocator_factory) = 0;
/// Creates a client network connection to a remote network listener.
///
- /// \a Connect may return an error status immediately if there was a failure
- /// in the synchronous part of establishing a connection. In that event, the
- /// \a on_connect callback *will not* have been executed. Otherwise, it is
- /// expected that the \a on_connect callback will be asynchronously executed
- /// exactly once by the EventEngine.
+ /// Even in the event of an error, it is expected that the \a on_connect
+ /// callback will be asynchronously executed exactly once by the EventEngine.
+ /// A connection attempt can be cancelled using the \a CancelConnect method.
///
- /// Implementation Note: it is important that the \a slice_allocator be used
+ /// Implementation Note: it is important that the \a memory_allocator be used
/// for all read/write buffer allocations in the EventEngine implementation.
/// This allows gRPC's \a ResourceQuota system to monitor and control memory
/// usage with graceful degradation mechanisms. Please see the \a
- /// SliceAllocator API for more information.
- virtual absl::Status Connect(OnConnectCallback on_connect,
- const ResolvedAddress& addr,
- const ChannelArgs& args,
- SliceAllocator slice_allocator,
- absl::Time deadline) = 0;
+ /// MemoryAllocator API for more information.
+ virtual ConnectionHandle Connect(OnConnectCallback on_connect,
+ const ResolvedAddress& addr,
+ const EndpointConfig& args,
+ MemoryAllocator memory_allocator,
+ absl::Time deadline) = 0;
- /// The DNSResolver that provides asynchronous resolution.
+ /// Request cancellation of a connection attempt.
+ ///
+ /// If the associated connection has already been completed, it will not be
+ /// cancelled, and this method will return false.
+ ///
+ /// If the associated connection has not been completed, it will be cancelled,
+ /// and this method will return true. The \a OnConnectCallback will not be
+ /// called.
+ virtual bool CancelConnect(ConnectionHandle handle) = 0;
+ /// Provides asynchronous resolution.
class DNSResolver {
public:
- /// A task handle for DNS Resolution requests.
+ /// Task handle for DNS Resolution requests.
struct LookupTaskHandle {
- intptr_t key;
+ intptr_t key[2];
};
- /// A DNS SRV record type.
+ /// DNS SRV record type.
struct SRVRecord {
std::string host;
int port = 0;
@@ -254,8 +288,10 @@ class EventEngine {
/// When the lookup is complete, the \a on_resolve callback will be invoked
/// with a status indicating the success or failure of the lookup.
/// Implementations should pass the appropriate statuses to the callback.
- /// For example, callbacks might expect to receive DEADLINE_EXCEEDED when
- /// the deadline is exceeded or CANCELLED if the lookup was cancelled.
+ /// For example, callbacks might expect to receive DEADLINE_EXCEEDED or
+ /// NOT_FOUND.
+ ///
+ /// If cancelled, \a on_resolve will not be executed.
virtual LookupTaskHandle LookupHostname(LookupHostnameCallback on_resolve,
absl::string_view address,
absl::string_view default_port,
@@ -275,60 +311,87 @@ class EventEngine {
absl::string_view name,
absl::Time deadline) = 0;
/// Cancel an asynchronous lookup operation.
- virtual void TryCancelLookup(LookupTaskHandle handle) = 0;
+ ///
+ /// This shares the same semantics with \a EventEngine::Cancel: successfully
+ /// cancelled lookups will not have their callbacks executed, and this
+ /// method returns true.
+ virtual bool CancelLookup(LookupTaskHandle handle) = 0;
};
+ /// At time of destruction, the EventEngine must have no active
+ /// responsibilities. EventEngine users (applications) are responsible for
+ /// cancelling all tasks and DNS lookups, shutting down listeners and
+ /// endpoints, prior to EventEngine destruction. If there are any outstanding
+ /// tasks, any running listeners, etc. at time of EventEngine destruction,
+ /// that is an invalid use of the API, and it will result in undefined
+ /// behavior.
virtual ~EventEngine() = default;
- // TODO(hork): define return status codes
- /// Retrieves an instance of a DNSResolver.
- virtual absl::StatusOr<std::unique_ptr<DNSResolver>> GetDNSResolver() = 0;
+ // TODO(nnoble): consider whether we can remove this method before we
+ // de-experimentalize this API.
+ virtual bool IsWorkerThread() = 0;
- /// Intended for future expansion of Task run functionality.
- struct RunOptions {};
- // TODO(hork): consider recommendation to make TaskHandle an output arg
- /// Run a callback as soon as possible.
+ /// Creates and returns an instance of a DNSResolver.
+ virtual std::unique_ptr<DNSResolver> GetDNSResolver() = 0;
+
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. The \a closure will
+ /// not be deleted after it has been run, ownership remains with the caller.
+ virtual void Run(Closure* closure) = 0;
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. Unlike the
+ /// overloaded \a Closure alternative, the std::function version's \a closure
+ /// will be deleted by the EventEngine after the closure has been run.
///
- /// The \a fn callback's \a status argument is used to indicate whether it was
- /// executed normally. For example, the status may be CANCELLED if
- /// \a TryCancel was called, or if the EventEngine is being shut down.
- virtual TaskHandle Run(Callback fn, RunOptions opts) = 0;
+ /// This version of \a Run may be less performant than the \a Closure version
+ /// in some scenarios. This overload is useful in situations where performance
+ /// is not a critical concern.
+ virtual void Run(std::function<void()> closure) = 0;
/// Synonymous with scheduling an alarm to run at time \a when.
///
- /// The callback \a fn will execute when either when time \a when arrives
- /// (receiving status OK), or when the \a fn is cancelled (reveiving status
- /// CANCELLED). The callback is guaranteed to be called exactly once.
- virtual TaskHandle RunAt(absl::Time when, Callback fn, RunOptions opts) = 0;
- /// Immediately tries to cancel a callback.
- /// Note that this is a "best effort" cancellation. No guarantee is made that
- /// the callback will be cancelled, the call could be in any stage.
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run, nor will it be deleted. Ownership remains with the caller.
+ virtual TaskHandle RunAt(absl::Time when, Closure* closure) = 0;
+ /// Synonymous with scheduling an alarm to run at time \a when.
+ ///
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run. Unilke the overloaded \a Closure alternative, the std::function
+ /// version's \a closure will be deleted by the EventEngine after the closure
+ /// has been run, or upon cancellation.
///
- /// There are three scenarios in which we may cancel a scheduled function:
- /// 1. We cancel the execution before it has run.
- /// 2. The callback has already run.
- /// 3. We can't cancel it because it is "in flight".
+ /// This version of \a RunAt may be less performant than the \a Closure
+ /// version in some scenarios. This overload is useful in situations where
+ /// performance is not a critical concern.
+ virtual TaskHandle RunAt(absl::Time when, std::function<void()> closure) = 0;
+ /// Request cancellation of a task.
///
- /// In all cases, the cancellation is still considered successful, the
- /// callback will be run exactly once from either cancellation or from its
- /// activation.
- virtual void TryCancel(TaskHandle handle) = 0;
- /// Immediately run all callbacks with status indicating the shutdown. Every
- /// EventEngine is expected to shut down exactly once. No new callbacks/tasks
- /// should be scheduled after shutdown has begun, no new connections should be
- /// created.
+ /// If the associated closure has already been scheduled to run, it will not
+ /// be cancelled, and this function will return false.
///
- /// If the \a on_shutdown_complete callback is given a non-OK status, errors
- /// are expected to be unrecoverable. For example, an implementation could
- /// warn callers about leaks if memory cannot be freed within a certain
- /// timeframe.
- virtual void Shutdown(Callback on_shutdown_complete) = 0;
+ /// If the associated callback has not been scheduled to run, it will be
+ /// cancelled, and the associated std::function or \a Closure* will not be
+ /// executed. In this case, Cancel will return true.
+ virtual bool Cancel(TaskHandle handle) = 0;
};
-/// Lazily instantiate and return a default global EventEngine instance if no
-/// custom instance is provided. If a custom EventEngine is provided for every
-/// channel/server via ChannelArgs, this method should never be called, and the
-/// default instance will never be instantiated.
-std::shared_ptr<EventEngine> GetDefaultEventEngine();
+/// Replace gRPC's default EventEngine factory.
+///
+/// Applications may call \a SetDefaultEventEngineFactory at any time to replace
+/// the default factory used within gRPC. EventEngines will be created when
+/// necessary, when they are otherwise not provided by the application.
+///
+/// To be certain that none of the gRPC-provided built-in EventEngines are
+/// created, applications must set a custom EventEngine factory method *before*
+/// grpc is initialized.
+void SetDefaultEventEngineFactory(
+ const std::function<std::unique_ptr<EventEngine>()>* factory);
+
+/// Create an EventEngine using the default factory.
+std::unique_ptr<EventEngine> CreateEventEngine();
} // namespace experimental
} // namespace grpc_event_engine
diff --git a/grpc/spm-core-include/grpc/event_engine/internal/memory_allocator_impl.h b/grpc/spm-core-include/grpc/event_engine/internal/memory_allocator_impl.h
new file mode 100644
index 00000000..e0ca2f5e
--- /dev/null
+++ b/grpc/spm-core-include/grpc/event_engine/internal/memory_allocator_impl.h
@@ -0,0 +1,68 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+#define GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/memory_request.h>
+#include <grpc/slice.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace internal {
+
+/// Underlying memory allocation interface.
+/// This is an internal interface, not intended to be used by users.
+/// Its interface is subject to change at any time.
+class MemoryAllocatorImpl
+ : public std::enable_shared_from_this<MemoryAllocatorImpl> {
+ public:
+ MemoryAllocatorImpl() {}
+ virtual ~MemoryAllocatorImpl() {}
+
+ MemoryAllocatorImpl(const MemoryAllocatorImpl&) = delete;
+ MemoryAllocatorImpl& operator=(const MemoryAllocatorImpl&) = delete;
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ /// If MemoryRequest is invalid, this function will abort.
+ /// If MemoryRequest is valid, this function is infallible, and will always
+ /// succeed at reserving the some number of bytes between request.min() and
+ /// request.max() inclusively.
+ virtual size_t Reserve(MemoryRequest request) = 0;
+
+ /// Release some bytes that were previously reserved.
+ /// If more bytes are released than were reserved, we will have undefined
+ /// behavior.
+ virtual void Release(size_t n) = 0;
+
+ /// Shutdown this allocator.
+ /// Further usage of Reserve() is undefined behavior.
+ virtual void Shutdown() = 0;
+};
+
+} // namespace internal
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
diff --git a/grpc/spm-core-include/grpc/event_engine/memory_allocator.h b/grpc/spm-core-include/grpc/event_engine/memory_allocator.h
new file mode 100644
index 00000000..8c812671
--- /dev/null
+++ b/grpc/spm-core-include/grpc/event_engine/memory_allocator.h
@@ -0,0 +1,226 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+#define GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <stdlib.h> // for abort()
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/internal/memory_allocator_impl.h>
+#include <grpc/slice.h>
+
+// forward-declaring an internal struct, not used publicly.
+struct grpc_slice_buffer;
+
+namespace grpc_event_engine {
+namespace experimental {
+
+// TODO(nnoble): needs implementation
+class SliceBuffer {
+ public:
+ SliceBuffer() { abort(); }
+ explicit SliceBuffer(grpc_slice_buffer*) { abort(); }
+
+ grpc_slice_buffer* RawSliceBuffer() { return slice_buffer_; }
+
+ private:
+ grpc_slice_buffer* slice_buffer_;
+};
+
+// Tracks memory allocated by one system.
+// Is effectively a thin wrapper/smart pointer for a MemoryAllocatorImpl,
+// providing a convenient and stable API.
+class MemoryAllocator {
+ public:
+ /// Construct a MemoryAllocator given an internal::MemoryAllocatorImpl
+ /// implementation. The constructed MemoryAllocator will call
+ /// MemoryAllocatorImpl::Shutdown() upon destruction.
+ explicit MemoryAllocator(
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator)
+ : allocator_(std::move(allocator)) {}
+ // Construct an invalid MemoryAllocator.
+ MemoryAllocator() : allocator_(nullptr) {}
+ ~MemoryAllocator() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ }
+
+ MemoryAllocator(const MemoryAllocator&) = delete;
+ MemoryAllocator& operator=(const MemoryAllocator&) = delete;
+
+ MemoryAllocator(MemoryAllocator&&) = default;
+ MemoryAllocator& operator=(MemoryAllocator&&) = default;
+
+ /// Drop the underlying allocator and make this an empty object.
+ /// The object will not be usable after this call unless it's a valid
+ /// allocator is moved into it.
+ void Reset() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ allocator_.reset();
+ }
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ size_t Reserve(MemoryRequest request) { return allocator_->Reserve(request); }
+
+ /// Release some bytes that were previously reserved.
+ void Release(size_t n) { return allocator_->Release(n); }
+
+ //
+ // The remainder of this type are helper functions implemented in terms of
+ // Reserve/Release.
+ //
+
+ /// An automatic releasing reservation of memory.
+ class Reservation {
+ public:
+ Reservation() = default;
+ Reservation(const Reservation&) = delete;
+ Reservation& operator=(const Reservation&) = delete;
+ Reservation(Reservation&&) = default;
+ Reservation& operator=(Reservation&&) = default;
+ ~Reservation() {
+ if (allocator_ != nullptr) allocator_->Release(size_);
+ }
+
+ private:
+ friend class MemoryAllocator;
+ Reservation(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ size_t size)
+ : allocator_(std::move(allocator)), size_(size) {}
+
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ size_t size_ = 0;
+ };
+
+ /// Reserve bytes from the quota and automatically release them when
+ /// Reservation is destroyed.
+ Reservation MakeReservation(MemoryRequest request) {
+ return Reservation(allocator_, Reserve(request));
+ }
+
+ /// Allocate a new object of type T, with constructor arguments.
+ /// The returned type is wrapped, and upon destruction the reserved memory
+ /// will be released to the allocator automatically. As such, T must have a
+ /// virtual destructor so we can insert the necessary hook.
+ template <typename T, typename... Args>
+ typename std::enable_if<std::has_virtual_destructor<T>::value, T*>::type New(
+ Args&&... args) {
+ // Wrap T such that when it's destroyed, we can release memory back to the
+ // allocator.
+ class Wrapper final : public T {
+ public:
+ explicit Wrapper(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ Args&&... args)
+ : T(std::forward<Args>(args)...), allocator_(std::move(allocator)) {}
+ ~Wrapper() override { allocator_->Release(sizeof(*this)); }
+
+ private:
+ const std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ };
+ Reserve(sizeof(Wrapper));
+ return new Wrapper(allocator_, std::forward<Args>(args)...);
+ }
+
+ /// Construct a unique_ptr immediately.
+ template <typename T, typename... Args>
+ std::unique_ptr<T> MakeUnique(Args&&... args) {
+ return std::unique_ptr<T>(New<T>(std::forward<Args>(args)...));
+ }
+
+ /// Allocate a slice, using MemoryRequest to size the number of returned
+ /// bytes. For a variable length request, check the returned slice length to
+ /// verify how much memory was allocated. Takes care of reserving memory for
+ /// any relevant control structures also.
+ grpc_slice MakeSlice(MemoryRequest request);
+
+ /// A C++ allocator for containers of T.
+ template <typename T>
+ class Container {
+ public:
+ using value_type = T;
+
+ /// Construct the allocator: \a underlying_allocator is borrowed, and must
+ /// outlive this object.
+ explicit Container(MemoryAllocator* underlying_allocator)
+ : underlying_allocator_(underlying_allocator) {}
+ template <typename U>
+ explicit Container(const Container<U>& other)
+ : underlying_allocator_(other.underlying_allocator()) {}
+
+ MemoryAllocator* underlying_allocator() const {
+ return underlying_allocator_;
+ }
+
+ T* allocate(size_t n) {
+ underlying_allocator_->Reserve(n * sizeof(T));
+ return static_cast<T*>(::operator new(n * sizeof(T)));
+ }
+ void deallocate(T* p, size_t n) {
+ ::operator delete(p);
+ underlying_allocator_->Release(n * sizeof(T));
+ }
+
+ private:
+ MemoryAllocator* underlying_allocator_;
+ };
+
+ protected:
+ /// Return a pointer to the underlying implementation.
+ /// Note that the interface of said implementation is unstable and likely to
+ /// change at any time.
+ internal::MemoryAllocatorImpl* get_internal_impl_ptr() {
+ return allocator_.get();
+ }
+
+ const internal::MemoryAllocatorImpl* get_internal_impl_ptr() const {
+ return allocator_.get();
+ }
+
+ private:
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+};
+
+// Wrapper type around std::vector to make initialization against a
+// MemoryAllocator based container allocator easy.
+template <typename T>
+class Vector : public std::vector<T, MemoryAllocator::Container<T>> {
+ public:
+ explicit Vector(MemoryAllocator* allocator)
+ : std::vector<T, MemoryAllocator::Container<T>>(
+ MemoryAllocator::Container<T>(allocator)) {}
+};
+
+class MemoryAllocatorFactory {
+ public:
+ virtual ~MemoryAllocatorFactory() = default;
+ /// On Endpoint creation, call \a CreateMemoryAllocator to create a new
+ /// allocator for the endpoint.
+ /// \a name is used to label the memory allocator in debug logs.
+ /// Typically we'll want to:
+ /// auto allocator = factory->CreateMemoryAllocator(peer_address_string);
+ /// auto* endpoint = allocator->New<MyEndpoint>(std::move(allocator), ...);
+ virtual MemoryAllocator CreateMemoryAllocator(absl::string_view name) = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
diff --git a/grpc/spm-core-include/grpc/event_engine/memory_request.h b/grpc/spm-core-include/grpc/event_engine/memory_request.h
new file mode 100644
index 00000000..fa15e26c
--- /dev/null
+++ b/grpc/spm-core-include/grpc/event_engine/memory_request.h
@@ -0,0 +1,57 @@
+// Copyright 2021 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.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+#define GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "absl/strings/string_view.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Reservation request - how much memory do we want to allocate?
+class MemoryRequest {
+ public:
+ /// Request a fixed amount of memory.
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ MemoryRequest(size_t n) : min_(n), max_(n) {}
+ /// Request a range of memory.
+ /// Requires: \a min <= \a max.
+ /// Requires: \a max <= max_size()
+ MemoryRequest(size_t min, size_t max) : min_(min), max_(max) {}
+
+ /// Maximum allowable request size - hard coded to 1GB.
+ static constexpr size_t max_allowed_size() { return 1024 * 1024 * 1024; }
+
+ /// Increase the size by \a amount.
+ /// Undefined behavior if min() + amount or max() + amount overflows.
+ MemoryRequest Increase(size_t amount) const {
+ return MemoryRequest(min_ + amount, max_ + amount);
+ }
+
+ size_t min() const { return min_; }
+ size_t max() const { return max_; }
+
+ private:
+ size_t min_;
+ size_t max_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
diff --git a/grpc/spm-core-include/grpc/event_engine/port.h b/grpc/spm-core-include/grpc/event_engine/port.h
index c24b8f90..94245864 100644
--- a/grpc/spm-core-include/grpc/event_engine/port.h
+++ b/grpc/spm-core-include/grpc/event_engine/port.h
@@ -17,16 +17,16 @@
#include <grpc/support/port_platform.h>
// Platform-specific sockaddr includes
-#ifdef GRPC_UV
-#include <uv.h>
-#elif defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
+#if defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
defined(GPR_FREEBSD) || defined(GPR_OPENBSD) || defined(GPR_SOLARIS) || \
defined(GPR_AIX) || defined(GPR_NACL) || defined(GPR_FUCHSIA) || \
defined(GRPC_POSIX_SOCKET)
#define GRPC_EVENT_ENGINE_POSIX
+#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#include <unistd.h>
#elif defined(GPR_WINDOWS)
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/grpc/spm-core-include/grpc/event_engine/slice_allocator.h b/grpc/spm-core-include/grpc/event_engine/slice_allocator.h
deleted file mode 100644
index 4370cd51..00000000
--- a/grpc/spm-core-include/grpc/event_engine/slice_allocator.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2021 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.
-#ifndef GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
-#define GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
-
-#include <grpc/support/port_platform.h>
-
-#include <functional>
-
-#include "absl/status/status.h"
-
-// forward-declaring an internal struct, not used publicly.
-struct grpc_resource_quota;
-struct grpc_resource_user;
-
-namespace grpc_event_engine {
-namespace experimental {
-
-// TODO(nnoble): forward declared here, needs definition.
-class SliceBuffer;
-
-class SliceAllocator {
- public:
- // gRPC-internal constructor
- explicit SliceAllocator(grpc_resource_user* user);
- // Not copyable
- SliceAllocator(SliceAllocator& other) = delete;
- SliceAllocator& operator=(const SliceAllocator& other) = delete;
- // Moveable
- SliceAllocator(SliceAllocator&& other) = default;
- SliceAllocator& operator=(SliceAllocator&& other) = default;
- ~SliceAllocator();
-
- using AllocateCallback =
- std::function<void(absl::Status, SliceBuffer* buffer)>;
- // TODO(hork): explain what happens under resource exhaustion.
- /// Requests \a size bytes from gRPC, and populates \a dest with the allocated
- /// slices. Ownership of the \a SliceBuffer is not transferred.
- absl::Status Allocate(size_t size, SliceBuffer* dest,
- SliceAllocator::AllocateCallback cb);
-
- private:
- grpc_resource_user* resource_user_;
-};
-
-class SliceAllocatorFactory {
- public:
- // gRPC-internal constructor
- explicit SliceAllocatorFactory(grpc_resource_quota* quota);
- // Not copyable
- SliceAllocatorFactory(SliceAllocatorFactory& other) = delete;
- SliceAllocatorFactory& operator=(const SliceAllocatorFactory& other) = delete;
- // Moveable
- SliceAllocatorFactory(SliceAllocatorFactory&& other) = default;
- SliceAllocatorFactory& operator=(SliceAllocatorFactory&& other) = default;
- ~SliceAllocatorFactory();
-
- /// On Endpoint creation, call \a CreateSliceAllocator with the name of the
- /// endpoint peer (a URI string, most likely). Note: \a peer_name must outlive
- /// the Endpoint.
- SliceAllocator CreateSliceAllocator(absl::string_view peer_name);
-
- private:
- grpc_resource_quota* resource_quota_;
-};
-
-} // namespace experimental
-} // namespace grpc_event_engine
-
-#endif // GRPC_EVENT_ENGINE_SLICE_ALLOCATOR_H
diff --git a/grpc/spm-core-include/grpc/fork.h b/grpc/spm-core-include/grpc/fork.h
index 26f9df98..f52cb502 100644
--- a/grpc/spm-core-include/grpc/fork.h
+++ b/grpc/spm-core-include/grpc/fork.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/fork.h>
+#include <grpc/impl/codegen/fork.h> // IWYU pragma: export
#endif /* GRPC_FORK_H */
diff --git a/grpc/spm-core-include/grpc/grpc.h b/grpc/spm-core-include/grpc/grpc.h
index f4408e11..0d863b9a 100644
--- a/grpc/spm-core-include/grpc/grpc.h
+++ b/grpc/spm-core-include/grpc/grpc.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
+#include <stddef.h>
#include <grpc/byte_buffer.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/slice.h>
+#include <grpc/status.h>
#include <grpc/support/time.h>
-#include <stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -115,8 +115,7 @@ GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_pluck(
of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING.
This function is experimental. */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
- void* reserved);
+ grpc_completion_queue_functor* shutdown_callback, void* reserved);
/** Create a completion queue */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create(
@@ -296,15 +295,41 @@ GRPCAPI void grpc_channel_get_info(grpc_channel* channel,
to non-experimental or remove it. */
GRPCAPI void grpc_channel_reset_connect_backoff(grpc_channel* channel);
-/** Create a client channel to 'target'. Additional channel level configuration
- MAY be provided by grpc_channel_args, though the expectation is that most
- clients will want to simply pass NULL. The user data in 'args' need only
- live through the invocation of this function. However, if any args of the
- 'pointer' type are passed, then the referenced vtable must be maintained
- by the caller until grpc_channel_destroy terminates. See grpc_channel_args
- definition for more on this. */
-GRPCAPI grpc_channel* grpc_insecure_channel_create(
- const char* target, const grpc_channel_args* args, void* reserved);
+/** --- grpc_channel_credentials object. ---
+
+ A channel credentials object represents a way to authenticate a client on a
+ channel. Different types of channel credentials are declared in
+ grpc_security.h. */
+
+typedef struct grpc_channel_credentials grpc_channel_credentials;
+
+/** Releases a channel credentials object.
+ The creator of the credentials object is responsible for its release. */
+
+GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
+
+/** --- grpc_server_credentials object. ---
+
+ A server credentials object represents a way to authenticate a server.
+ Different types of server credentials are declared in grpc_security.h. */
+
+typedef struct grpc_server_credentials grpc_server_credentials;
+
+/** Releases a server_credentials object.
+ The creator of the server_credentials object is responsible for its release.
+ */
+GRPCAPI void grpc_server_credentials_release(grpc_server_credentials* creds);
+
+/** Creates a secure channel using the passed-in credentials. Additional
+ channel level configuration MAY be provided by grpc_channel_args, though
+ the expectation is that most clients will want to simply pass NULL. The
+ user data in 'args' need only live through the invocation of this function.
+ However, if any args of the 'pointer' type are passed, then the referenced
+ vtable must be maintained by the caller until grpc_channel_destroy
+ terminates. See grpc_channel_args definition for more on this. */
+GRPCAPI grpc_channel* grpc_channel_create(const char* target,
+ grpc_channel_credentials* creds,
+ const grpc_channel_args* args);
/** Create a lame client: this client fails every operation attempted on it. */
GRPCAPI grpc_channel* grpc_lame_client_channel_create(
@@ -341,6 +366,10 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
const char* description,
void* reserved);
+/* Returns whether or not the call's receive message operation failed because of
+ * an error (as opposed to a graceful end-of-stream) */
+GRPCAPI int grpc_call_failed_before_recv_message(const grpc_call* c);
+
/** Ref a call.
THREAD SAFETY: grpc_call_ref is thread-compatible */
GRPCAPI void grpc_call_ref(grpc_call* call);
@@ -411,12 +440,18 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server* server,
grpc_completion_queue* cq,
void* reserved);
+// More members might be added in later, so users should take care to memset
+// this to 0 before using it.
+typedef struct {
+ grpc_status_code code;
+ const char* error_message;
+} grpc_serving_status_update;
+
// There might be more methods added later, so users should take care to memset
// this to 0 before using it.
typedef struct {
void (*on_serving_status_update)(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message);
+ grpc_serving_status_update update);
void* user_data;
} grpc_server_xds_status_notifier;
@@ -435,11 +470,11 @@ GRPCAPI void grpc_server_config_fetcher_destroy(
GRPCAPI void grpc_server_set_config_fetcher(
grpc_server* server, grpc_server_config_fetcher* config_fetcher);
-/** Add a HTTP2 over plaintext over tcp listener.
- Returns bound port number on success, 0 on failure.
- REQUIRES: server not started */
-GRPCAPI int grpc_server_add_insecure_http2_port(grpc_server* server,
- const char* addr);
+/** Add a HTTP2 over an encrypted link over tcp listener.
+ Returns bound port number on success, 0 on failure.
+ REQUIRES: server not started */
+GRPCAPI int grpc_server_add_http2_port(grpc_server* server, const char* addr,
+ grpc_server_credentials* creds);
/** Start a server - tells all listeners to start listening */
GRPCAPI void grpc_server_start(grpc_server* server);
@@ -555,6 +590,14 @@ GRPCAPI char* grpc_channelz_get_subchannel(intptr_t subchannel_id);
is allocated and must be freed by the application. */
GRPCAPI char* grpc_channelz_get_socket(intptr_t socket_id);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Fetch a vtable for grpc_channel_arg that points to
+ * grpc_authorization_policy_provider.
+ */
+GRPCAPI const grpc_arg_pointer_vtable*
+grpc_authorization_policy_provider_arg_vtable(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/grpc/spm-core-include/grpc/grpc_posix.h b/grpc/spm-core-include/grpc/grpc_posix.h
index fbce5e13..797e3c5b 100644
--- a/grpc/spm-core-include/grpc/grpc_posix.h
+++ b/grpc/spm-core-include/grpc/grpc_posix.h
@@ -21,10 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
#include <stddef.h>
+#include <grpc/grpc.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -35,22 +36,25 @@ extern "C" {
* functionality on top of GRPC Core.
*/
-/** Create a client channel to 'target' using file descriptor 'fd'. The 'target'
- argument will be used to indicate the name for this channel. See the comment
- for grpc_insecure_channel_create for description of 'args' argument. */
-GRPCAPI grpc_channel* grpc_insecure_channel_create_from_fd(
- const char* target, int fd, const grpc_channel_args* args);
-
-/** Add the connected communication channel based on file descriptor 'fd' to the
- 'server'. The 'fd' must be an open file descriptor corresponding to a
- connected socket. Events from the file descriptor may come on any of the
- server completion queues (i.e completion queues registered via the
- grpc_server_register_completion_queue API).
-
- The 'reserved' pointer MUST be NULL.
- */
-GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- void* reserved, int fd);
+/** Create a secure channel to 'target' using file descriptor 'fd' and passed-in
+ credentials. The 'target' argument will be used to indicate the name for
+ this channel. Note that this API currently only supports insecure channel
+ credentials. Using other types of credentials will result in a failure. */
+GRPCAPI grpc_channel* grpc_channel_create_from_fd(
+ const char* target, int fd, grpc_channel_credentials* creds,
+ const grpc_channel_args* args);
+
+/** Add the connected secure communication channel based on file descriptor 'fd'
+ to the 'server' and server credentials 'creds'. The 'fd' must be an open file
+ descriptor corresponding to a connected socket. Events from the file
+ descriptor may come on any of the server completion queues (i.e completion
+ queues registered via the grpc_server_register_completion_queue API).
+ Note that this API currently only supports inseure server credentials
+ Using other types of credentials will result in a failure.
+ TODO(hork): add channel_args to this API to allow endpoints and transports
+ created in this function to participate in the resource quota feature. */
+GRPCAPI void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
+ grpc_server_credentials* creds);
#ifdef __cplusplus
}
diff --git a/grpc/spm-core-include/grpc/grpc_security.h b/grpc/spm-core-include/grpc/grpc_security.h
index b5dafe1b..a90904e7 100644
--- a/grpc/spm-core-include/grpc/grpc_security.h
+++ b/grpc/spm-core-include/grpc/grpc_security.h
@@ -131,17 +131,6 @@ typedef struct grpc_call_credentials grpc_call_credentials;
The creator of the credentials object is responsible for its release. */
GRPCAPI void grpc_call_credentials_release(grpc_call_credentials* creds);
-/** --- grpc_channel_credentials object. ---
-
- A channel credentials object represents a way to authenticate a client on a
- channel. */
-
-typedef struct grpc_channel_credentials grpc_channel_credentials;
-
-/** Releases a channel credentials object.
- The creator of the credentials object is responsible for its release. */
-GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials* creds);
-
/** Creates default credentials to connect to a google gRPC service.
WARNING: Do NOT use this credentials to connect to a non-google service as
this could result in an oauth2 token leak. The security level of the
@@ -478,30 +467,6 @@ GRPCAPI grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
grpc_metadata_credentials_plugin plugin,
grpc_security_level min_security_level, void* reserved);
-/** --- Secure channel creation. --- */
-
-/** Creates a secure channel using the passed-in credentials. Additional
- channel level configuration MAY be provided by grpc_channel_args, though
- the expectation is that most clients will want to simply pass NULL. The
- user data in 'args' need only live through the invocation of this function.
- However, if any args of the 'pointer' type are passed, then the referenced
- vtable must be maintained by the caller until grpc_channel_destroy
- terminates. See grpc_channel_args definition for more on this. */
-GRPCAPI grpc_channel* grpc_secure_channel_create(
- grpc_channel_credentials* creds, const char* target,
- const grpc_channel_args* args, void* reserved);
-
-/** --- grpc_server_credentials object. ---
-
- A server credentials object represents a way to authenticate a server. */
-
-typedef struct grpc_server_credentials grpc_server_credentials;
-
-/** Releases a server_credentials object.
- The creator of the server_credentials object is responsible for its release.
- */
-GRPCAPI void grpc_server_credentials_release(grpc_server_credentials* creds);
-
/** Server certificate config object holds the server's public certificates and
associated private keys, as well as any CA certificates needed for client
certificate validation (if applicable). Create using
@@ -599,15 +564,6 @@ GRPCAPI grpc_server_credentials*
grpc_ssl_server_credentials_create_with_options(
grpc_ssl_server_credentials_options* options);
-/** --- Server-side secure ports. --- */
-
-/** Add a HTTP2 over an encrypted link over tcp listener.
- Returns bound port number on success, 0 on failure.
- REQUIRES: server not started */
-GRPCAPI int grpc_server_add_secure_http2_port(grpc_server* server,
- const char* addr,
- grpc_server_credentials* creds);
-
/** --- Call specific credentials. --- */
/** Sets a credentials to a call. Can only be called on the client side before
@@ -747,61 +703,62 @@ GRPCAPI grpc_server_credentials* grpc_local_server_credentials_create(
/** --- TLS channel/server credentials ---
* It is used for experimental purpose for now and subject to change. */
-/** Struct for indicating errors. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_error_details grpc_tls_error_details;
-
-/** Config for TLS server authorization check. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_server_authorization_check_config
- grpc_tls_server_authorization_check_config;
-
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that can be specified by callers to configure underlying TLS
- * behaviors. It is used for experimental purpose for now and subject to change.
+ * behaviors.
*/
typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct provides ways to gain credential data that will be used in the TLS
- * handshake. It is used for experimental purpose for now and subject to change.
+ * handshake.
*/
typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that stores the credential data presented to the peer in handshake
- * to show local identity. It is used for experimental purpose for now and
- * subject to change.
+ * to show local identity.
*/
typedef struct grpc_tls_identity_pairs grpc_tls_identity_pairs;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_identity_pairs that stores a list of identity credential
- * data, including identity private key and identity certificate chain. It is
- * used for experimental purpose for now and subject to change.
+ * data, including identity private key and identity certificate chain.
*/
GRPCAPI grpc_tls_identity_pairs* grpc_tls_identity_pairs_create();
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Adds a identity private key and a identity certificate chain to
* grpc_tls_identity_pairs. This function will make an internal copy of
- * |private_key| and |cert_chain|. It is used for experimental purpose for now
- * and subject to change.
+ * |private_key| and |cert_chain|.
*/
GRPCAPI void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs* pairs,
const char* private_key,
const char* cert_chain);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Destroys a grpc_tls_identity_pairs object. If this object is passed to a
* provider initiation function, the ownership is transferred so this function
* doesn't need to be called. Otherwise the creator of the
- * grpc_tls_identity_pairs object is responsible for its destruction. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_identity_pairs object is responsible for its destruction.
*/
GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will load credential data from
* static string during initialization. This provider will always return the
* same cert data for all cert names.
@@ -809,13 +766,14 @@ GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
* corresponding credential data is not needed.
* This function will make a copy of |root_certificate|.
* The ownership of |pem_key_cert_pairs| is transferred.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_static_data_create(
const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will watch the credential
* changes on the file system. This provider will always return the up-to-date
* cert data for all the cert names callers set through
@@ -833,7 +791,6 @@ grpc_tls_certificate_provider_static_data_create(
* - refresh_interval_sec is the refreshing interval that we will check the
* files for updates.
* It does not take ownership of parameters.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_file_watcher_create(
@@ -841,49 +798,34 @@ grpc_tls_certificate_provider_file_watcher_create(
const char* root_cert_path, unsigned int refresh_interval_sec);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Releases a grpc_tls_certificate_provider object. The creator of the
- * grpc_tls_certificate_provider object is responsible for its release. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_certificate_provider object is responsible for its release.
*/
GRPCAPI void grpc_tls_certificate_provider_release(
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates an grpc_tls_credentials_options.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_credentials_options* grpc_tls_credentials_options_create(void);
/**
- * Sets the options of whether to request and verify client certs. This should
- * be called only on the server side. It is used for experimental purpose for
- * now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
- grpc_tls_credentials_options* options,
- grpc_ssl_client_certificate_request_type type);
-
-/**
- * Sets the options of whether to choose certain checks, e.g. certificate check,
- * hostname check, etc. This should be called only on the client side. If
- * |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a
- * custom authorization check (grpc_tls_server_authorization_check_config) is
- * mandatory. It is used for experimental purpose for now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option);
-
-/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the credential provider in the options.
* The |options| will implicitly take a new ref to the |provider|.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
grpc_tls_credentials_options* options,
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the root certificates with
* name |root_cert_name|.
* If this is not set on the client side, we will use the root certificates
@@ -892,151 +834,306 @@ GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
* If this is not set on the server side, we will not watch any root certificate
* updates, and assume no root certificates needed for the server(single-side
* TLS). Default root certs on the server side is not supported.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_root_certs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the root certificates being watched.
* If not set, We will use a default empty string as the root certificate name.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_root_cert_name(
grpc_tls_credentials_options* options, const char* root_cert_name);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the identity key-cert pairs
* with name |identity_cert_name|.
* This is required on the server side, and optional on the client side.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the identity certificates being watched.
* If not set, We will use a default empty string as the identity certificate
- * name. It is used for experimental purpose for now and subject to change.
+ * name.
*/
GRPCAPI void grpc_tls_credentials_options_set_identity_cert_name(
grpc_tls_credentials_options* options, const char* identity_cert_name);
/**
- * Sets the configuration for a custom authorization check performed at the end
- * of the handshake. The |options| will implicitly take a new ref to the
- * |config|.
- * It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to request and/or verify client certs. This shall
+ * only be called on the server side.
*/
-GRPCAPI void grpc_tls_credentials_options_set_server_authorization_check_config(
+GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
grpc_tls_credentials_options* options,
- grpc_tls_server_authorization_check_config* config);
-
-/** --- TLS server authorization check config. ---
- * It is used for experimental purpose for now and subject to change. */
-
-typedef struct grpc_tls_server_authorization_check_arg
- grpc_tls_server_authorization_check_arg;
-
-/** callback function provided by gRPC used to handle the result of server
- authorization check. It is used when schedule API is implemented
- asynchronously, and serves to bring the control back to gRPC C core. It is
- used for experimental purpose for now and subject to change. */
-typedef void (*grpc_tls_on_server_authorization_check_done_cb)(
- grpc_tls_server_authorization_check_arg* arg);
-
-/** A struct containing all information necessary to schedule/cancel a server
- authorization check request.
- - cb and cb_user_data represent a gRPC-provided callback and an argument
- passed to it.
- - success will store the result of server authorization check. That is,
- if success returns a non-zero value, it means the authorization check
- passes and if returning zero, it means the check fails.
- - target_name is the name of an endpoint the channel is connecting to.
- - peer_cert represents a complete certificate chain including both
- signing and leaf certificates.
- - \a subject_alternative_names is an array of size
- \a subject_alternative_names_size consisting of pointers to strings.
- - status and error_details contain information
- about errors occurred when a server authorization check request is
- scheduled/cancelled.
- - config is a pointer to the unique
- grpc_tls_server_authorization_check_config instance that this argument
- corresponds to.
- - context is a pointer to a wrapped language implementation of this
- grpc_tls_server_authorization_check_arg instance.
- - destroy_context is a pointer to a caller-provided method that cleans
- up any data associated with the context pointer.
- It is used for experimental purpose for now and subject to change.
-*/
-struct grpc_tls_server_authorization_check_arg {
- grpc_tls_on_server_authorization_check_done_cb cb;
- void* cb_user_data;
- int success;
+ grpc_ssl_client_certificate_request_type type);
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * If set, gRPC will read all hashed x.509 CRL files in the directory and
+ * enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
+ * version > 1.1.
+ * It is used for experimental purpose for now and subject to change.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_crl_directory(
+ grpc_tls_credentials_options* options, const char* crl_directory);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to verify server certs on the client side.
+ * Passing in a non-zero value indicates verifying the certs.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_verify_server_cert(
+ grpc_tls_credentials_options* options, int verify_server_cert);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The read-only request information exposed in a verification call.
+ * Callers should not directly manage the ownership of it. We will make sure it
+ * is always available inside verify() or cancel() call, and will destroy the
+ * object at the end of custom verification.
+ */
+typedef struct grpc_tls_custom_verification_check_request {
+ /* The target name of the server when the client initiates the connection. */
+ /* This field will be nullptr if on the server side. */
const char* target_name;
- const char* peer_cert;
- const char* peer_cert_full_chain;
- char** subject_alternative_names;
- size_t subject_alternative_names_size;
- grpc_status_code status;
- grpc_tls_error_details* error_details;
- grpc_tls_server_authorization_check_config* config;
- void* context;
- void (*destroy_context)(void* ctx);
-};
-
-/** Create a grpc_tls_server_authorization_check_config instance.
- - config_user_data is config-specific, read-only user data
- that works for all channels created with a credential using the config.
- - schedule is a pointer to an application-provided callback used to invoke
- server authorization check API. The implementation of this method has to
- be non-blocking, but can be performed synchronously or asynchronously.
- 1)If processing occurs synchronously, it populates arg->result,
- arg->status, and arg->error_details and returns zero.
- 2) If processing occurs asynchronously, it returns a non-zero value. The
- application then invokes arg->cb when processing is completed. Note that
- arg->cb cannot be invoked before schedule API returns.
- - cancel is a pointer to an application-provided callback used to cancel a
- server authorization check request scheduled via an asynchronous schedule
- API. arg is used to pinpoint an exact check request to be cancelled. The
- operation may not have any effect if the request has already been
- processed.
- - destruct is a pointer to an application-provided callback used to clean up
- any data associated with the config.
- It is used for experimental purpose for now and subject to change.
-*/
-GRPCAPI grpc_tls_server_authorization_check_config*
-grpc_tls_server_authorization_check_config_create(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data));
+ /* The information contained in the certificate chain sent from the peer. */
+ struct peer_info {
+ /* The Common Name field on the peer leaf certificate. */
+ const char* common_name;
+ /* The list of Subject Alternative Names on the peer leaf certificate. */
+ struct san_names {
+ char** uri_names;
+ size_t uri_names_size;
+ char** dns_names;
+ size_t dns_names_size;
+ char** email_names;
+ size_t email_names_size;
+ char** ip_names;
+ size_t ip_names_size;
+ } san_names;
+ /* The raw peer leaf certificate. */
+ const char* peer_cert;
+ /* The raw peer certificate chain. Note that it is not always guaranteed to
+ * get the peer full chain. For more, please refer to
+ * GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME defined in file
+ * grpc_security_constants.h.
+ * TODO(ZhenLian): Consider fixing this in the future. */
+ const char* peer_cert_full_chain;
+ } peer_info;
+} grpc_tls_custom_verification_check_request;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A callback function provided by gRPC as a parameter of the |verify| function
+ * in grpc_tls_certificate_verifier_external. If |verify| is expected to be run
+ * asynchronously, the implementer of |verify| will need to invoke this callback
+ * with |callback_arg| and proper verification status at the end to bring the
+ * control back to gRPC C core.
+ */
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The internal verifier type that will be used inside core.
+ */
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A struct containing all the necessary functions a custom external verifier
+ * needs to implement to be able to be converted to an internal verifier.
+ */
+typedef struct grpc_tls_certificate_verifier_external {
+ void* user_data;
+ /**
+ * A function pointer containing the verification logic that will be
+ * performed after the TLS handshake is done. It could be processed
+ * synchronously or asynchronously.
+ * - If expected to be processed synchronously, the implementer should
+ * populate the verification result through |sync_status| and
+ * |sync_error_details|, and then return true.
+ * - If expected to be processed asynchronously, the implementer should return
+ * false immediately, and then in the asynchronous thread invoke |callback|
+ * with the verification result. The implementer MUST NOT invoke the async
+ * |callback| in the same thread before |verify| returns, otherwise it can
+ * lead to deadlocks.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer.
+ * callback: the callback that the function implementer needs to invoke, if
+ * return a non-zero value. It is usually invoked when the
+ * asynchronous verification is done, and serves to bring the
+ * control back to gRPC.
+ * callback_arg: A pointer to the internal ExternalVerifier instance. This is
+ * mainly used as an argument in |callback|, if want to invoke
+ * |callback| in async mode.
+ * sync_status: indicates if a connection should be allowed. This should only
+ * be used if the verification check is done synchronously.
+ * sync_error_details: the error generated while verifying a connection. This
+ * should only be used if the verification check is done
+ * synchronously. the implementation must allocate the
+ * error string via gpr_malloc() or gpr_strdup().
+ * return: return 0 if |verify| is expected to be executed asynchronously,
+ * otherwise return a non-zero value.
+ */
+ int (*verify)(void* user_data,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+ /**
+ * A function pointer that cleans up the caller-specified resources when the
+ * verifier is still running but the whole connection got cancelled. This
+ * could happen when the verifier is doing some async operations, and the
+ * whole handshaker object got destroyed because of connection time limit is
+ * reached, or any other reasons. In such cases, function implementers might
+ * want to be notified, and properly clean up some resources.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer. It will
+ * be the same request object that was passed to verify(), and it
+ * tells the cancel() which request to cancel.
+ */
+ void (*cancel)(void* user_data,
+ grpc_tls_custom_verification_check_request* request);
+ /**
+ * A function pointer that does some additional destruction work when the
+ * verifier is destroyed. This is used when the caller wants to associate some
+ * objects to the lifetime of external_verifier, and destroy them when
+ * external_verifier got destructed. For example, in C++, the class containing
+ * user-specified callback functions should not be destroyed before
+ * external_verifier, since external_verifier will invoke them while being
+ * used.
+ * Note that the caller MUST delete the grpc_tls_certificate_verifier_external
+ * object itself in this function, otherwise it will cause memory leaks. That
+ * also means the user_data has to carries at least a self pointer, for the
+ * callers to later delete it in destruct().
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ */
+ void (*destruct)(void* user_data);
+} grpc_tls_certificate_verifier_external;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Converts an external verifier to an internal verifier.
+ * Note that we will not take the ownership of the external_verifier. Callers
+ * will need to delete external_verifier in its own destruct function.
+ */
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Factory function for an internal verifier that will do the default hostname
+ * check.
+ */
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_host_name_create();
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Releases a grpc_tls_certificate_verifier object. The creator of the
+ * grpc_tls_certificate_verifier object is responsible for its release.
+ */
+void grpc_tls_certificate_verifier_release(
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the verifier in options. The |options| will implicitly take a new ref to
+ * the |verifier|. If not set on the client side, we will verify server's
+ * certificates, and check the default hostname. If not set on the server side,
+ * we will verify client's certificates.
+ */
+void grpc_tls_credentials_options_set_certificate_verifier(
+ grpc_tls_credentials_options* options,
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to check the hostname of the peer on a per-call
+ * basis. This is usually used in a combination with virtual hosting at the
+ * client side, where each individual call on a channel can have a different
+ * host associated with it.
+ * This check is intended to verify that the host specified for the individual
+ * call is covered by the cert that the peer presented.
+ * The default is a non-zero value, which indicates performing such checks.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_check_call_host(
+ grpc_tls_credentials_options* options, int check_call_host);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the verification logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
+ * If |grpc_tls_certificate_verifier_verify| returns true, inspect the
+ * verification result through request->status and request->error_details.
+ * Otherwise, inspect through the parameter of |callback|.
+ */
+int grpc_tls_certificate_verifier_verify(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details);
/**
- * Releases a grpc_tls_server_authorization_check_config object. The creator of
- * the grpc_tls_server_authorization_check_config object is responsible for its
- * release. It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the cancellation logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
*/
-GRPCAPI void grpc_tls_server_authorization_check_config_release(
- grpc_tls_server_authorization_check_config* config);
+void grpc_tls_certificate_verifier_cancel(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS channel credential object based on the
* grpc_tls_credentials_options specified by callers. The
* grpc_channel_credentials will take the ownership of the |options|. The
- * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY. It
- * is used for experimental purpose for now and subject to change.
+ * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.
*/
grpc_channel_credentials* grpc_tls_credentials_create(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS server credential object based on the
* grpc_tls_credentials_options specified by callers. The
- * grpc_server_credentials will take the ownership of the |options|. It
- * is used for experimental purpose for now and subject to change.
+ * grpc_server_credentials will take the ownership of the |options|.
*/
grpc_server_credentials* grpc_tls_server_credentials_create(
grpc_tls_credentials_options* options);
@@ -1046,14 +1143,14 @@ grpc_server_credentials* grpc_tls_server_credentials_create(
*
* This method creates an insecure channel credentials object.
*/
-grpc_channel_credentials* grpc_insecure_credentials_create();
+GRPCAPI grpc_channel_credentials* grpc_insecure_credentials_create();
/**
* EXPERIMENTAL API - Subject to change
*
* This method creates an insecure server credentials object.
*/
-grpc_server_credentials* grpc_insecure_server_credentials_create();
+GRPCAPI grpc_server_credentials* grpc_insecure_server_credentials_create();
/**
* EXPERIMENTAL API - Subject to change
@@ -1085,6 +1182,76 @@ GRPCAPI grpc_channel_credentials* grpc_xds_credentials_create(
GRPCAPI grpc_server_credentials* grpc_xds_server_credentials_create(
grpc_server_credentials* fallback_credentials);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * An opaque type that is responsible for providing authorization policies to
+ * gRPC.
+ */
+typedef struct grpc_authorization_policy_provider
+ grpc_authorization_policy_provider;
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider using gRPC authorization policy
+ * from static string.
+ * - authz_policy is the input gRPC authorization policy.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_static_data_create(
+ const char* authz_policy, grpc_status_code* code,
+ const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider by watching for gRPC
+ * authorization policy changes in filesystem.
+ * - authz_policy is the file path of gRPC authorization policy.
+ * - refresh_interval_sec is the amount of time the internal thread would wait
+ * before checking for file updates.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_file_watcher_create(
+ const char* authz_policy_path, unsigned int refresh_interval_sec,
+ grpc_status_code* code, const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Releases grpc_authorization_policy_provider object. The creator of
+ * grpc_authorization_policy_provider is responsible for its release.
+ */
+GRPCAPI void grpc_authorization_policy_provider_release(
+ grpc_authorization_policy_provider* provider);
+
+/** --- TLS session key logging. ---
+ * Experimental API to control tls session key logging. Tls session key logging
+ * is expected to be used only for debugging purposes and never in production.
+ * Tls session key logging is only enabled when:
+ * At least one grpc_tls_credentials_options object is assigned a tls session
+ * key logging file path using the API specified below.
+ */
+
+/**
+ * EXPERIMENTAL API - Subject to change.
+ * Configures a grpc_tls_credentials_options object with tls session key
+ * logging capability. TLS channels using these credentials have tls session
+ * key logging enabled.
+ * - options is the grpc_tls_credentials_options object
+ * - path is a string pointing to the location where TLS session keys would be
+ * stored.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_tls_session_key_log_file_path(
+ grpc_tls_credentials_options* options, const char* path);
+
#ifdef __cplusplus
}
#endif
diff --git a/grpc/spm-core-include/grpc/grpc_security_constants.h b/grpc/spm-core-include/grpc/grpc_security_constants.h
index 4d7f0788..505037ed 100644
--- a/grpc/spm-core-include/grpc/grpc_security_constants.h
+++ b/grpc/spm-core-include/grpc/grpc_security_constants.h
@@ -25,8 +25,10 @@ extern "C" {
#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME "transport_security_type"
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE "ssl"
+#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
#define GRPC_X509_CN_PROPERTY_NAME "x509_common_name"
+#define GRPC_X509_SUBJECT_PROPERTY_NAME "x509_subject"
#define GRPC_X509_SAN_PROPERTY_NAME "x509_subject_alternative_name"
#define GRPC_X509_PEM_CERT_PROPERTY_NAME "x509_pem_cert"
// Please note that internally, we just faithfully pass whatever value we got by
@@ -45,6 +47,7 @@ extern "C" {
#define GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME "security_level"
#define GRPC_PEER_DNS_PROPERTY_NAME "peer_dns"
#define GRPC_PEER_SPIFFE_ID_PROPERTY_NAME "peer_spiffe_id"
+#define GRPC_PEER_URI_PROPERTY_NAME "peer_uri"
#define GRPC_PEER_EMAIL_PROPERTY_NAME "peer_email"
#define GRPC_PEER_IP_PROPERTY_NAME "peer_ip"
@@ -133,20 +136,6 @@ typedef enum {
GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY,
} grpc_security_level;
-typedef enum {
- /** Default option: performs server certificate verification and hostname
- verification. */
- GRPC_TLS_SERVER_VERIFICATION,
- /** Performs server certificate verification, but skips hostname verification
- Client is responsible for verifying server's identity via
- server authorization check callback. */
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION,
- /** Skips both server certificate and hostname verification.
- Client is responsible for verifying server's identity and
- server's certificate via server authorization check callback. */
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION
-} grpc_tls_server_verification_option;
-
/**
* Type of local connections for which local channel/server credentials will be
* applied. It supports UDS and local TCP connections.
diff --git a/grpc/spm-core-include/grpc/impl/codegen/atm.h b/grpc/spm-core-include/grpc/impl/codegen/atm.h
index 00d83f06..606369a2 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/atm.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/atm.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_H
#define GRPC_IMPL_CODEGEN_ATM_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** This interface provides atomic operations and barriers.
It is internal to gpr support code and should not be used outside it.
@@ -70,11 +72,11 @@
#include <grpc/impl/codegen/port_platform.h>
#if defined(GPR_GCC_ATOMIC)
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#elif defined(GPR_GCC_SYNC)
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS_ATOMIC)
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#else
#error could not determine platform for atm
#endif
diff --git a/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_atomic.h b/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_atomic.h
index 58797085..05d6e42c 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_atomic.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* atm_platform.h for gcc and gcc-like compilers with the
__atomic_* interface. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_sync.h b/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_sync.h
index 728c3d54..bdc7a172 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_sync.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/atm_gcc_sync.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* variant of atm_platform.h for gcc and gcc-like compiers with __sync_*
interface */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/atm_windows.h b/grpc/spm-core-include/grpc/impl/codegen/atm_windows.h
index 36c76ab6..816c9a9c 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/atm_windows.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/atm_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
#define GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** Win32 variant of atm_platform.h */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/byte_buffer.h b/grpc/spm-core-include/grpc/impl/codegen/byte_buffer.h
index 04137292..eeec56c1 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/byte_buffer.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/byte_buffer.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
+// IWYU pragma: private, include <grpc/byte_buffer.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/byte_buffer_reader.h b/grpc/spm-core-include/grpc/impl/codegen/byte_buffer_reader.h
index e06e1955..35b8ee70 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/byte_buffer_reader.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/byte_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
+// IWYU pragma: private, include <grpc/byte_buffer_reader.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/spm-core-include/grpc/impl/codegen/compression_types.h b/grpc/spm-core-include/grpc/impl/codegen/compression_types.h
index f778b005..35f49075 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/compression_types.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/compression_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
@@ -58,8 +60,6 @@ typedef enum {
GRPC_COMPRESS_NONE = 0,
GRPC_COMPRESS_DEFLATE,
GRPC_COMPRESS_GZIP,
- /* EXPERIMENTAL: Stream compression is currently experimental. */
- GRPC_COMPRESS_STREAM_GZIP,
/* TODO(ctiller): snappy */
GRPC_COMPRESS_ALGORITHMS_COUNT
} grpc_compression_algorithm;
diff --git a/grpc/spm-core-include/grpc/impl/codegen/connectivity_state.h b/grpc/spm-core-include/grpc/impl/codegen/connectivity_state.h
index b70dbef3..52084da4 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/connectivity_state.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/connectivity_state.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
#define GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
+// IWYU pragma: private
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/spm-core-include/grpc/impl/codegen/fork.h b/grpc/spm-core-include/grpc/impl/codegen/fork.h
index 555df349..6818b530 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/fork.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/fork.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_FORK_H
#define GRPC_IMPL_CODEGEN_FORK_H
+// IWYU pragma: private, include <grpc/fork.h>
+
/**
* gRPC applications should call this before calling fork(). There should be no
* active gRPC function calls between calling grpc_prefork() and
diff --git a/grpc/spm-core-include/grpc/impl/codegen/gpr_slice.h b/grpc/spm-core-include/grpc/impl/codegen/gpr_slice.h
index 89fa72d5..8782ba3f 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/gpr_slice.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/gpr_slice.h
@@ -18,6 +18,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_SLICE_H
#define GRPC_IMPL_CODEGEN_GPR_SLICE_H
+// IWYU pragma: private
+
/** WARNING: Please do not use this header. This was added as a temporary
* measure to not break some of the external projects that depend on
* gpr_slice_* functions. We are actively working on moving all the
diff --git a/grpc/spm-core-include/grpc/impl/codegen/gpr_types.h b/grpc/spm-core-include/grpc/impl/codegen/gpr_types.h
index 6daf3398..415bf7a9 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/gpr_types.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/gpr_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_TYPES_H
#define GRPC_IMPL_CODEGEN_GPR_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/grpc_types.h b/grpc/spm-core-include/grpc/impl/codegen/grpc_types.h
index 9cf6d837..074bf7ee 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/grpc_types.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/grpc_types.h
@@ -19,15 +19,17 @@
#ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H
#define GRPC_IMPL_CODEGEN_GRPC_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
+#include <stddef.h>
+
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/impl/codegen/slice.h>
#include <grpc/impl/codegen/status.h>
-#include <stddef.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -55,9 +57,6 @@ typedef struct grpc_byte_buffer {
* asynchronous actions. */
typedef struct grpc_completion_queue grpc_completion_queue;
-/** An alarm associated with a completion queue. */
-typedef struct grpc_alarm grpc_alarm;
-
/** The Channel interface allows creation of Call objects. */
typedef struct grpc_channel grpc_channel;
@@ -220,7 +219,7 @@ typedef struct {
"grpc.http2.min_ping_interval_without_data_ms"
/** Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
-/** How many pings can we send before needing to send a
+/** How many pings can the client send before needing to send a
data/header frame? (0 indicates that an infinite number of
pings can be sent without sending a data frame or header frame) */
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \
@@ -242,8 +241,8 @@ typedef struct {
not receive the ping ack, it will close the transport. Int valued,
milliseconds. */
#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS "grpc.keepalive_timeout_ms"
-/** Is it permissible to send keepalive pings without any outstanding streams.
- Int valued, 0(false)/1(true). */
+/** Is it permissible to send keepalive pings from the client without any
+ outstanding streams. Int valued, 0(false)/1(true). */
#define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \
"grpc.keepalive_permit_without_calls"
/** Default authority to pass if none specified on call construction. A string.
@@ -311,6 +310,14 @@ typedef struct {
#define GRPC_ARG_SOCKET_MUTATOR "grpc.socket_mutator"
/** The grpc_socket_factory instance to create and bind sockets. A pointer. */
#define GRPC_ARG_SOCKET_FACTORY "grpc.socket_factory"
+/** Gzip compression level. Used only if gzip message compression is used.
+ The value must be in the range 0 to 9. If not specified, the gzip default
+ will be used. */
+#define GRPC_ARG_GZIP_COMPRESSION_LEVEL "grpc.gzip_compression_level"
+/** The minimum message size in bytes for a message to be compressed.
+ If not specified, messages will be compressed regardless of size. */
+#define GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS \
+ "grpc.gprc_min_message_size_to_compress"
/** The maximum amount of memory used by trace events per channel trace node.
* Once the maximum is reached, subsequent events will evict the oldest events
* from the buffer. The unit for this knob is bytes. Setting it to zero causes
@@ -384,12 +391,25 @@ typedef struct {
Defaults to "blend". In the current implementation "blend" is equivalent to
"latency". */
#define GRPC_ARG_OPTIMIZATION_TARGET "grpc.optimization_target"
-/** If set to zero, disables retry behavior. Otherwise, transparent retries
- are enabled for all RPCs, and configurable retries are enabled when they
- are configured via the service config. For details, see:
+/** Enables retry functionality. Defaults to true. When enabled,
+ transparent retries will be performed as appropriate, and configurable
+ retries are enabled when they are configured via the service config.
+ For details, see:
https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ NOTE: Hedging functionality is not yet implemented, so those
+ fields in the service config will currently be ignored. See
+ also the GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING arg below.
*/
#define GRPC_ARG_ENABLE_RETRIES "grpc.enable_retries"
+/** Enables hedging functionality, as described in:
+ https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ Default is currently false, since this functionality is not yet
+ fully implemented.
+ NOTE: This channel arg is experimental and will eventually be removed.
+ Once hedging functionality has been implemented and proves stable,
+ this arg will be removed, and the hedging functionality will
+ be enabled via the GRPC_ARG_ENABLE_RETRIES arg above. */
+#define GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING "grpc.experimental.enable_hedging"
/** Per-RPC retry buffer size, in bytes. Default is 256 KiB. */
#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size"
/** Channel arg that carries the bridged objective c object for custom metrics
@@ -409,10 +429,14 @@ typedef struct {
/** If set, inhibits health checking (which may be enabled via the
* service config.) */
#define GRPC_ARG_INHIBIT_HEALTH_CHECKING "grpc.inhibit_health_checking"
-/** If set, the channel's resolver is allowed to query for SRV records.
- * For example, this is useful as a way to enable the "grpclb"
- * load balancing policy. Note that this only works with the "ares"
- * DNS resolver, and isn't supported by the "native" DNS resolver. */
+/** If enabled, the channel's DNS resolver queries for SRV records.
+ * This is useful only when using the "grpclb" load balancing policy,
+ * as described in the following documents:
+ * https://github.com/grpc/proposal/blob/master/A5-grpclb-in-dns.md
+ * https://github.com/grpc/proposal/blob/master/A24-lb-policy-config.md
+ * https://github.com/grpc/proposal/blob/master/A26-grpclb-selection.md
+ * Note that this works only with the "ares" DNS resolver; it isn't supported
+ * by the "native" DNS resolver. */
#define GRPC_ARG_DNS_ENABLE_SRV_QUERIES "grpc.dns_enable_srv_queries"
/** If set, determines an upper bound on the number of milliseconds that the
* c-ares based DNS resolver will wait on queries before cancelling them.
@@ -428,6 +452,16 @@ typedef struct {
#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain"
/** gRPC Objective-C channel pooling id. */
#define GRPC_ARG_CHANNEL_ID "grpc.channel_id"
+/** Channel argument for grpc_authorization_policy_provider. If present, enables
+ gRPC authorization check. */
+#define GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER \
+ "grpc.authorization_policy_provider"
+/** EXPERIMENTAL. Updates to a server's configuration from a config fetcher (for
+ * example, listener updates from xDS) cause all older connections to be
+ * gracefully shut down (i.e., "drained") with a grace period configured by this
+ * channel arg. Int valued, milliseconds. Defaults to 10 minutes.*/
+#define GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS \
+ "grpc.experimental.server_config_change_drain_grace_time_ms"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
@@ -491,12 +525,9 @@ typedef enum grpc_call_error {
(GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_THROUGH)
/** Initial metadata flags */
-/** Signal that the call is idempotent */
-#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u)
+/** These flags are to be passed to the `grpc_op::flags` field */
/** Signal that the call should not return UNAVAILABLE before it has started */
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u)
-/** Signal that the call is cacheable. GRPC is free to use GET verb */
-#define GRPC_INITIAL_METADATA_CACHEABLE_REQUEST (0x00000040u)
/** Signal that GRPC_INITIAL_METADATA_WAIT_FOR_READY was explicitly set
by the calling application. */
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u)
@@ -504,12 +535,10 @@ typedef enum grpc_call_error {
#define GRPC_INITIAL_METADATA_CORKED (0x00000100u)
/** Mask of all valid flags */
-#define GRPC_INITIAL_METADATA_USED_MASK \
- (GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \
- GRPC_INITIAL_METADATA_WAIT_FOR_READY | \
- GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \
- GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
- GRPC_INITIAL_METADATA_CORKED | GRPC_WRITE_THROUGH)
+#define GRPC_INITIAL_METADATA_USED_MASK \
+ (GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY | GRPC_INITIAL_METADATA_CORKED | \
+ GRPC_WRITE_THROUGH)
/** A single metadata element */
typedef struct grpc_metadata {
@@ -518,8 +547,6 @@ typedef struct grpc_metadata {
grpc_slice key;
grpc_slice value;
- uint32_t flags;
-
/** The following fields are reserved for grpc internal use.
There is no need to initialize them, and they will be set to garbage
during calls to grpc. */
@@ -742,21 +769,20 @@ typedef enum {
/** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK,
- /** EXPERIMENTAL: Events trigger a callback specified as the tag */
+ /** Events trigger a callback specified as the tag */
GRPC_CQ_CALLBACK
} grpc_cq_completion_type;
-/** EXPERIMENTAL: Specifies an interface class to be used as a tag
- for callback-based completion queues. This can be used directly,
- as the first element of a struct in C, or as a base class in C++.
- Its "run" value should be assigned to some non-member function, such as
- a static method. */
-typedef struct grpc_experimental_completion_queue_functor {
+/** Specifies an interface class to be used as a tag for callback-based
+ * completion queues. This can be used directly, as the first element of a
+ * struct in C, or as a base class in C++. Its "run" value should be assigned to
+ * some non-member function, such as a static method. */
+typedef struct grpc_completion_queue_functor {
/** The run member specifies a function that will be called when this
tag is extracted from the completion queue. Its arguments will be a
pointer to this functor and a boolean that indicates whether the
operation succeeded (non-zero) or failed (zero) */
- void (*functor_run)(struct grpc_experimental_completion_queue_functor*, int);
+ void (*functor_run)(struct grpc_completion_queue_functor*, int);
/** The inlineable member specifies whether this functor can be run inline.
This should only be used for trivial internally-defined functors. */
@@ -764,10 +790,8 @@ typedef struct grpc_experimental_completion_queue_functor {
/** The following fields are not API. They are meant for internal use. */
int internal_success;
- struct grpc_experimental_completion_queue_functor* internal_next;
-} grpc_experimental_completion_queue_functor;
-
-/* The upgrade to version 2 is currently experimental. */
+ struct grpc_completion_queue_functor* internal_next;
+} grpc_completion_queue_functor;
#define GRPC_CQ_CURRENT_VERSION 2
#define GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE 2
@@ -782,10 +806,10 @@ typedef struct grpc_completion_queue_attributes {
/* END OF VERSION 1 CQ ATTRIBUTES */
- /* EXPERIMENTAL: START OF VERSION 2 CQ ATTRIBUTES */
+ /* START OF VERSION 2 CQ ATTRIBUTES */
/** When creating a callbackable CQ, pass in a functor to get invoked when
* shutdown is complete */
- grpc_experimental_completion_queue_functor* cq_shutdown_cb;
+ grpc_completion_queue_functor* cq_shutdown_cb;
/* END OF VERSION 2 CQ ATTRIBUTES */
} grpc_completion_queue_attributes;
diff --git a/grpc/spm-core-include/grpc/impl/codegen/log.h b/grpc/spm-core-include/grpc/impl/codegen/log.h
index 9dd3a518..1d5d2da2 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/log.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/log.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H
+// IWYU pragma: private, include <grpc/support/log.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stdarg.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/port_platform.h b/grpc/spm-core-include/grpc/impl/codegen/port_platform.h
index 387639bf..3227f511 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/port_platform.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/port_platform.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
#define GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
+// IWYU pragma: private, include <grpc/support/port_platform.h>
+
/*
* Define GPR_BACKWARDS_COMPATIBILITY_MODE to try harder to be ABI
* compatible with older platforms (currently only on Linux)
@@ -27,6 +29,13 @@
* - some syscalls to be made directly
*/
+// [[deprecated]] attribute is only available since C++14
+#if __cplusplus >= 201402L
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif // __cplusplus >= 201402L
+
/*
* Defines GPR_ABSEIL_SYNC to use synchronization features from Abseil
*/
@@ -42,7 +51,9 @@
/*
* Defines GRPC_ERROR_IS_ABSEIL_STATUS to use absl::Status for grpc_error_handle
*/
+#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
// #define GRPC_ERROR_IS_ABSEIL_STATUS 1
+#endif
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
@@ -114,10 +125,16 @@
#else
#define GPR_WINDOWS_ATOMIC 1
#endif
-#define GPR_STDCPP_TLS 1
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_PLATFORM_STRING "android"
#define GPR_ANDROID 1
+#ifndef __ANDROID_API__
+#error "__ANDROID_API__ must be defined for Android builds."
+#endif
+#if __ANDROID_API__ < 21
+#error "Requires Android API v21 and above"
+#endif
+#define GPR_SUPPORT_BINDER_TRANSPORT 1
// TODO(apolcyn): re-evaluate support for c-ares
// on android after upgrading our c-ares dependency.
// See https://github.com/grpc/grpc/issues/18038.
@@ -129,7 +146,6 @@
#endif /* _LP64 */
#define GPR_CPU_POSIX 1
#define GPR_GCC_SYNC 1
-#define GPR_STDCPP_TLS 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
#define GPR_POSIX_STAT 1
@@ -155,7 +171,6 @@
#include <features.h>
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_STDCPP_TLS 1
#define GPR_LINUX 1
#define GPR_LINUX_LOG
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
@@ -175,7 +190,14 @@
#endif /* _LP64 */
#ifdef __GLIBC__
#define GPR_POSIX_CRASH_HANDLER 1
+#ifdef __GLIBC_PREREQ
+#if __GLIBC_PREREQ(2, 12)
+#define GPR_LINUX_PTHREAD_NAME 1
+#endif
+#else
+// musl libc & others
#define GPR_LINUX_PTHREAD_NAME 1
+#endif
#include <linux/version.h>
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
@@ -183,7 +205,6 @@
#elif defined(__ASYLO__)
#define GPR_ARCH_64 1
#define GPR_CPU_POSIX 1
-#define GPR_GCC_TLS 1
#define GPR_PLATFORM_STRING "asylo"
#define GPR_GCC_SYNC 1
#define GPR_POSIX_SYNC 1
@@ -217,12 +238,7 @@
#define GPR_CPU_POSIX 1
#define GPR_POSIX_CRASH_HANDLER 1
#endif
-#ifdef __has_feature
-#if __has_feature(cxx_thread_local)
-#define GPR_STDCPP_TLS 1
-#endif
-#endif
-#ifndef GPR_STDCPP_TLS
+#if !(defined(__has_feature) && __has_feature(cxx_thread_local))
#define GPR_PTHREAD_TLS 1
#endif
#define GPR_APPLE 1
@@ -253,7 +269,6 @@
#define GPR_FREEBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -278,7 +293,6 @@
#define GPR_OPENBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -300,7 +314,6 @@
#define GPR_SOLARIS 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -324,7 +337,6 @@
#define GPR_AIX 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -354,7 +366,6 @@
#define GPR_NACL 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -381,7 +392,6 @@
#define GPR_MUSL_LIBC_COMPAT 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_PTHREAD_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_ENV 1
@@ -498,12 +508,6 @@ typedef unsigned __int64 uint64_t;
#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
#endif
-#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
- defined(GPR_STDCPP_TLS) + defined(GPR_CUSTOM_TLS) != \
- 1
-#error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_STDCPP_TLS, GPR_CUSTOM_TLS
-#endif
-
/* maximum alignment needed for any type on this platform, rounded up to a
power of two */
#define GPR_MAX_ALIGNMENT 16
@@ -566,6 +570,14 @@ typedef unsigned __int64 uint64_t;
#define CENSUSAPI GRPCAPI
#endif
+#ifndef GPR_HAS_CPP_ATTRIBUTE
+#ifdef __has_cpp_attribute
+#define GPR_HAS_CPP_ATTRIBUTE(a) __has_cpp_attribute(a)
+#else
+#define GPR_HAS_CPP_ATTRIBUTE(a) 0
+#endif
+#endif /* GPR_HAS_CPP_ATTRIBUTE */
+
#ifndef GPR_HAS_ATTRIBUTE
#ifdef __has_attribute
#define GPR_HAS_ATTRIBUTE(a) __has_attribute(a)
@@ -591,6 +603,22 @@ typedef unsigned __int64 uint64_t;
#endif
#endif /* GPR_ATTRIBUTE_NOINLINE */
+#ifndef GPR_NO_UNIQUE_ADDRESS
+#if GPR_HAS_CPP_ATTRIBUTE(no_unique_address)
+#define GPR_NO_UNIQUE_ADDRESS [[no_unique_address]]
+#else
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif /* GPR_NO_UNIQUE_ADDRESS */
+
+#ifndef GRPC_DEPRECATED
+#if GPR_HAS_CPP_ATTRIBUTE(deprecated)
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif
+#endif /* GRPC_DEPRECATED */
+
#ifndef GPR_ATTRIBUTE_WEAK
/* Attribute weak is broken on LLVM/windows:
* https://bugs.llvm.org/show_bug.cgi?id=37598 */
@@ -664,4 +692,32 @@ typedef unsigned __int64 uint64_t;
#define __STDC_FORMAT_MACROS
#endif
+/* Selectively enable EventEngine on specific platforms. This default can be
+ * overridden using the GRPC_USE_EVENT_ENGINE compiler flag.
+ */
+#ifndef GRPC_USE_EVENT_ENGINE
+/* Not enabled by default on any platforms yet. (2021.06) */
+#elif GRPC_USE_EVENT_ENGINE == 0
+/* Building with `-DGRPC_USE_EVENT_ENGINE=0` will override the default. */
+#undef GRPC_USE_EVENT_ENGINE
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#undef GPR_SUPPORT_CHANNELS_FROM_FD
+#define GRPC_ARES 0
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#define GRPC_CALLBACK_API_NONEXPERIMENTAL
+
+/* clang 11 with msan miscompiles destruction of [[no_unique_address]] members
+ * of zero size - for a repro see:
+ * test/core/compiler_bugs/miscompile_with_no_unique_address_test.cc
+ */
+#ifdef __clang__
+#if __clang__ && __clang_major__ <= 11 && __has_feature(memory_sanitizer)
+#undef GPR_NO_UNIQUE_ADDRESS
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif
+
#endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */
diff --git a/grpc/spm-core-include/grpc/impl/codegen/propagation_bits.h b/grpc/spm-core-include/grpc/impl/codegen/propagation_bits.h
index 824bdbd8..d7020998 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/propagation_bits.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/propagation_bits.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
#define GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
diff --git a/grpc/spm-core-include/grpc/impl/codegen/slice.h b/grpc/spm-core-include/grpc/impl/codegen/slice.h
index 3567b1e8..130e5eff 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/slice.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/slice.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SLICE_H
#define GRPC_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpc/slice.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
@@ -56,7 +58,10 @@ struct grpc_slice_refcount;
Multiple grpc_slice values may share a ref count.
If the slice does not have a refcount, it represents an inlined small piece
- of data that is copied by value. */
+ of data that is copied by value.
+
+ As a special case, a slice can be given refcount == uintptr_t(1), meaning
+ that the slice represents external data that is not refcounted. */
struct grpc_slice {
struct grpc_slice_refcount* refcount;
union grpc_slice_data {
diff --git a/grpc/spm-core-include/grpc/impl/codegen/status.h b/grpc/spm-core-include/grpc/impl/codegen/status.h
index dec3b8f3..2b18f6d9 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/status.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_STATUS_H
#define GRPC_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpc/status.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync.h b/grpc/spm-core-include/grpc/impl/codegen/sync.h
index 49e31947..1b30ea75 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_H
#define GRPC_IMPL_CODEGEN_SYNC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/** Synchronization primitives for GPR.
The type gpr_mu provides a non-reentrant mutex (lock).
@@ -44,16 +47,16 @@ extern "C" {
/* Platform-specific type declarations of gpr_mu and gpr_cv. */
#include <grpc/impl/codegen/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#if defined(GPR_CUSTOM_SYNC)
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#elif defined(GPR_ABSEIL_SYNC)
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#elif defined(GPR_POSIX_SYNC)
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS)
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#else
#error Unable to determine platform for sync
#endif
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync_abseil.h b/grpc/spm-core-include/grpc/impl/codegen/sync_abseil.h
index 38dfab32..92b31697 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync_abseil.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync_abseil.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
#define GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync_custom.h b/grpc/spm-core-include/grpc/impl/codegen/sync_custom.h
index 69b1bf6c..ec0d6728 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync_custom.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync_custom.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
#define GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync_generic.h b/grpc/spm-core-include/grpc/impl/codegen/sync_generic.h
index eabdc513..a79b9c64 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync_generic.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync_generic.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
#define GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/* Generic type definitions for gpr_sync. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync_posix.h b/grpc/spm-core-include/grpc/impl/codegen/sync_posix.h
index 2aec3a3f..f5cf482c 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync_posix.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync_posix.h
@@ -19,12 +19,14 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_POSIX_H
#define GRPC_IMPL_CODEGEN_SYNC_POSIX_H
-#include <grpc/impl/codegen/port_platform.h>
+// IWYU pragma: private, include <grpc/support/sync.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/port_platform.h>
#include <pthread.h>
+#include <grpc/impl/codegen/sync_generic.h>
+
#ifdef GRPC_ASAN_ENABLED
/* The member |leak_checker| is used to check whether there is a memory leak
* caused by upper layer logic that's missing the |gpr_xx_destroy| call
diff --git a/grpc/spm-core-include/grpc/impl/codegen/sync_windows.h b/grpc/spm-core-include/grpc/impl/codegen/sync_windows.h
index f2ff83b3..2bee03b6 100644
--- a/grpc/spm-core-include/grpc/impl/codegen/sync_windows.h
+++ b/grpc/spm-core-include/grpc/impl/codegen/sync_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
#define GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_WINDOWS
diff --git a/grpc/spm-core-include/grpc/slice.h b/grpc/spm-core-include/grpc/slice.h
index 51fc62b4..15978fe5 100644
--- a/grpc/spm-core-include/grpc/slice.h
+++ b/grpc/spm-core-include/grpc/slice.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/slice.h>
+#include <grpc/impl/codegen/slice.h> // IWYU pragma: export
#include <grpc/support/sync.h>
#ifdef __cplusplus
@@ -69,12 +69,6 @@ GPRAPI grpc_slice grpc_slice_malloc_large(size_t length);
#define GRPC_SLICE_MALLOC(len) grpc_slice_malloc(len)
-/** Intern a slice:
-
- The return value for two invocations of this function with the same sequence
- of bytes is a slice which points to the same memory. */
-GPRAPI grpc_slice grpc_slice_intern(grpc_slice slice);
-
/** Create a slice by copying a string.
Does not preserve null terminators.
Equivalent to:
@@ -129,9 +123,6 @@ GPRAPI grpc_slice grpc_slice_split_head(grpc_slice* s, size_t split);
GPRAPI grpc_slice grpc_empty_slice(void);
-GPRAPI uint32_t grpc_slice_default_hash_impl(grpc_slice s);
-GPRAPI int grpc_slice_default_eq_impl(grpc_slice a, grpc_slice b);
-
GPRAPI int grpc_slice_eq(grpc_slice a, grpc_slice b);
/** Returns <0 if a < b, ==0 if a == b, >0 if a > b
@@ -151,8 +142,6 @@ GPRAPI int grpc_slice_chr(grpc_slice s, char c);
if it's not found */
GPRAPI int grpc_slice_slice(grpc_slice haystack, grpc_slice needle);
-GPRAPI uint32_t grpc_slice_hash(grpc_slice s);
-
/** Do two slices point at the same memory, with the same length
If a or b is inlined, actually compares data */
GPRAPI int grpc_slice_is_equivalent(grpc_slice a, grpc_slice b);
diff --git a/grpc/spm-core-include/grpc/status.h b/grpc/spm-core-include/grpc/status.h
index ecb9668b..6763264e 100644
--- a/grpc/spm-core-include/grpc/status.h
+++ b/grpc/spm-core-include/grpc/status.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/status.h>
+#include <grpc/impl/codegen/status.h> // IWYU pragma: export
#endif /* GRPC_STATUS_H */
diff --git a/grpc/spm-core-include/grpc/support/atm.h b/grpc/spm-core-include/grpc/support/atm.h
index 073b0a6f..fbfcee3b 100644
--- a/grpc/spm-core-include/grpc/support/atm.h
+++ b/grpc/spm-core-include/grpc/support/atm.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm.h>
+#include <grpc/impl/codegen/atm.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_H */
diff --git a/grpc/spm-core-include/grpc/support/atm_gcc_atomic.h b/grpc/spm-core-include/grpc/support/atm_gcc_atomic.h
index ae603db4..8226349f 100644
--- a/grpc/spm-core-include/grpc/support/atm_gcc_atomic.h
+++ b/grpc/spm-core-include/grpc/support/atm_gcc_atomic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_ATOMIC_H */
diff --git a/grpc/spm-core-include/grpc/support/atm_gcc_sync.h b/grpc/spm-core-include/grpc/support/atm_gcc_sync.h
index 6f51fdb1..500a9f14 100644
--- a/grpc/spm-core-include/grpc/support/atm_gcc_sync.h
+++ b/grpc/spm-core-include/grpc/support/atm_gcc_sync.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_SYNC_H */
diff --git a/grpc/spm-core-include/grpc/support/atm_windows.h b/grpc/spm-core-include/grpc/support/atm_windows.h
index 36955e4d..b85d7f74 100644
--- a/grpc/spm-core-include/grpc/support/atm_windows.h
+++ b/grpc/spm-core-include/grpc/support/atm_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_WINDOWS_H */
diff --git a/grpc/spm-core-include/grpc/support/log.h b/grpc/spm-core-include/grpc/support/log.h
index 8d8742b9..7af557d0 100644
--- a/grpc/spm-core-include/grpc/support/log.h
+++ b/grpc/spm-core-include/grpc/support/log.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
+#include <grpc/impl/codegen/log.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_LOG_H */
diff --git a/grpc/spm-core-include/grpc/support/port_platform.h b/grpc/spm-core-include/grpc/support/port_platform.h
index 26025dcd..fced02a9 100644
--- a/grpc/spm-core-include/grpc/support/port_platform.h
+++ b/grpc/spm-core-include/grpc/support/port_platform.h
@@ -19,6 +19,6 @@
#ifndef GRPC_SUPPORT_PORT_PLATFORM_H
#define GRPC_SUPPORT_PORT_PLATFORM_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/impl/codegen/port_platform.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */
diff --git a/grpc/spm-core-include/grpc/support/sync.h b/grpc/spm-core-include/grpc/support/sync.h
index f617322f..b1f5b786 100644
--- a/grpc/spm-core-include/grpc/support/sync.h
+++ b/grpc/spm-core-include/grpc/support/sync.h
@@ -22,7 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/impl/codegen/gpr_types.h> /* for gpr_timespec */
-#include <grpc/impl/codegen/sync.h>
+#include <grpc/impl/codegen/sync.h> // IWYU pragma: export
#ifdef __cplusplus
extern "C" {
diff --git a/grpc/spm-core-include/grpc/support/sync_abseil.h b/grpc/spm-core-include/grpc/support/sync_abseil.h
index 3ee73489..d6ad9692 100644
--- a/grpc/spm-core-include/grpc/support/sync_abseil.h
+++ b/grpc/spm-core-include/grpc/support/sync_abseil.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_ABSEIL_H */
diff --git a/grpc/spm-core-include/grpc/support/sync_custom.h b/grpc/spm-core-include/grpc/support/sync_custom.h
index 27cf0e05..de7e2200 100644
--- a/grpc/spm-core-include/grpc/support/sync_custom.h
+++ b/grpc/spm-core-include/grpc/support/sync_custom.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_CUSTOM_H */
diff --git a/grpc/spm-core-include/grpc/support/sync_generic.h b/grpc/spm-core-include/grpc/support/sync_generic.h
index 93028c4a..d1d9fd7e 100644
--- a/grpc/spm-core-include/grpc/support/sync_generic.h
+++ b/grpc/spm-core-include/grpc/support/sync_generic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_GENERIC_H */
diff --git a/grpc/spm-core-include/grpc/support/sync_posix.h b/grpc/spm-core-include/grpc/support/sync_posix.h
index 3dce7ee4..b971cd10 100644
--- a/grpc/spm-core-include/grpc/support/sync_posix.h
+++ b/grpc/spm-core-include/grpc/support/sync_posix.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_POSIX_H */
diff --git a/grpc/spm-core-include/grpc/support/sync_windows.h b/grpc/spm-core-include/grpc/support/sync_windows.h
index a493c864..3ee4a6ff 100644
--- a/grpc/spm-core-include/grpc/support/sync_windows.h
+++ b/grpc/spm-core-include/grpc/support/sync_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_WINDOWS_H */
diff --git a/grpc/spm-core-include/grpc/support/time.h b/grpc/spm-core-include/grpc/support/time.h
index 44aead5e..a193dbc8 100644
--- a/grpc/spm-core-include/grpc/support/time.h
+++ b/grpc/spm-core-include/grpc/support/time.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/gpr_types.h>
-
#include <stddef.h>
#include <time.h>
+#include <grpc/impl/codegen/gpr_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/grpc/spm-cpp-include/grpcpp/alarm.h b/grpc/spm-cpp-include/grpcpp/alarm.h
index 6723e136..1b5ddfe8 100644
--- a/grpc/spm-cpp-include/grpcpp/alarm.h
+++ b/grpc/spm-cpp-include/grpcpp/alarm.h
@@ -32,7 +32,7 @@
namespace grpc {
-class Alarm : private ::grpc::GrpcLibraryCodegen {
+class Alarm : private grpc::GrpcLibraryCodegen {
public:
/// Create an unset completion queue alarm
Alarm();
@@ -48,8 +48,8 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
/// internal::GrpcLibraryInitializer instance would need to be introduced
/// here. \endinternal.
template <typename T>
- Alarm(::grpc::CompletionQueue* cq, const T& deadline, void* tag) : Alarm() {
- SetInternal(cq, ::grpc::TimePoint<T>(deadline).raw_time(), tag);
+ Alarm(grpc::CompletionQueue* cq, const T& deadline, void* tag) : Alarm() {
+ SetInternal(cq, grpc::TimePoint<T>(deadline).raw_time(), tag);
}
/// Trigger an alarm instance on completion queue \a cq at the specified time.
@@ -61,8 +61,8 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
// setting an immediate deadline. Such usage allows synchronizing an external
// event with an application's \a grpc::CompletionQueue::Next loop.
template <typename T>
- void Set(::grpc::CompletionQueue* cq, const T& deadline, void* tag) {
- SetInternal(cq, ::grpc::TimePoint<T>(deadline).raw_time(), tag);
+ void Set(grpc::CompletionQueue* cq, const T& deadline, void* tag) {
+ SetInternal(cq, grpc::TimePoint<T>(deadline).raw_time(), tag);
}
/// Alarms aren't copyable.
@@ -81,47 +81,19 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
/// has already fired has no effect.
void Cancel();
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Set an alarm to invoke callback \a f. The argument to the callback
/// states whether the alarm expired at \a deadline (true) or was cancelled
/// (false)
template <typename T>
void Set(const T& deadline, std::function<void(bool)> f) {
- SetInternal(::grpc::TimePoint<T>(deadline).raw_time(), std::move(f));
+ SetInternal(grpc::TimePoint<T>(deadline).raw_time(), std::move(f));
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of Alarm when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(Alarm* alarm) : alarm_(alarm) {}
-
- /// Set an alarm to invoke callback \a f. The argument to the callback
- /// states whether the alarm expired at \a deadline (true) or was cancelled
- /// (false)
- template <typename T>
- void Set(const T& deadline, std::function<void(bool)> f) {
- alarm_->SetInternal(::grpc::TimePoint<T>(deadline).raw_time(),
- std::move(f));
- }
-
- private:
- Alarm* alarm_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
- void SetInternal(::grpc::CompletionQueue* cq, gpr_timespec deadline,
- void* tag);
+ void SetInternal(grpc::CompletionQueue* cq, gpr_timespec deadline, void* tag);
void SetInternal(gpr_timespec deadline, std::function<void(bool)> f);
- ::grpc::internal::CompletionQueueTag* alarm_;
+ grpc::internal::CompletionQueueTag* alarm_;
};
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/channel.h b/grpc/spm-cpp-include/grpcpp/channel.h
index 65cc46d1..ec8702e4 100644
--- a/grpc/spm-cpp-include/grpcpp/channel.h
+++ b/grpc/spm-cpp-include/grpcpp/channel.h
@@ -51,10 +51,10 @@ void ChannelResetConnectionBackoff(Channel* channel);
} // namespace experimental
/// Channels represent a connection to an endpoint. Created by \a CreateChannel.
-class Channel final : public ::grpc::ChannelInterface,
- public ::grpc::internal::CallHook,
+class Channel final : public grpc::ChannelInterface,
+ public grpc::internal::CallHook,
public std::enable_shared_from_this<Channel>,
- private ::grpc::GrpcLibraryCodegen {
+ private grpc::GrpcLibraryCodegen {
public:
~Channel() override;
@@ -71,38 +71,38 @@ class Channel final : public ::grpc::ChannelInterface,
private:
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
- friend class ::grpc::testing::ChannelTestPeer;
+ friend class grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::testing::ChannelTestPeer;
friend void experimental::ChannelResetConnectionBackoff(Channel* channel);
friend std::shared_ptr<Channel> grpc::CreateChannelInternal(
const std::string& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
- friend class ::grpc::internal::InterceptedChannel;
+ friend class grpc::internal::InterceptedChannel;
Channel(const std::string& host, grpc_channel* c_channel,
std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
- ::grpc::internal::Call CreateCall(const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) override;
- void PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops,
- ::grpc::internal::Call* call) override;
+ grpc::internal::Call CreateCall(const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) override;
+ void PerformOpsOnCall(grpc::internal::CallOpSetInterface* ops,
+ grpc::internal::Call* call) override;
void* RegisterMethod(const char* method) override;
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq, void* tag) override;
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
+ void* tag) override;
bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) override;
- ::grpc::CompletionQueue* CallbackCQ() override;
+ grpc::CompletionQueue* CallbackCQ() override;
- ::grpc::internal::Call CreateCallInternal(
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq, size_t interceptor_pos) override;
+ grpc::internal::Call CreateCallInternal(
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
+ grpc::CompletionQueue* cq, size_t interceptor_pos) override;
const std::string host_;
grpc_channel* const c_channel_; // owned
@@ -117,7 +117,7 @@ class Channel final : public ::grpc::ChannelInterface,
std::atomic<CompletionQueue*> callback_cq_{nullptr};
std::vector<
- std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>>
+ std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators_;
};
diff --git a/grpc/spm-cpp-include/grpcpp/client_context.h b/grpc/spm-cpp-include/grpcpp/client_context.h
index 1994fcc6..74a91e26 100644
--- a/grpc/spm-cpp-include/grpcpp/client_context.h
+++ b/grpc/spm-cpp-include/grpcpp/client_context.h
@@ -34,6 +34,6 @@
#ifndef GRPCPP_CLIENT_CONTEXT_H
#define GRPCPP_CLIENT_CONTEXT_H
-#include <grpcpp/impl/codegen/client_context.h>
+#include <grpcpp/impl/codegen/client_context.h> // IWYU pragma: export
#endif // GRPCPP_CLIENT_CONTEXT_H
diff --git a/grpc/spm-cpp-include/grpcpp/completion_queue.h b/grpc/spm-cpp-include/grpcpp/completion_queue.h
index 123b277f..42637b59 100644
--- a/grpc/spm-cpp-include/grpcpp/completion_queue.h
+++ b/grpc/spm-cpp-include/grpcpp/completion_queue.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_COMPLETION_QUEUE_H
#define GRPCPP_COMPLETION_QUEUE_H
-#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/completion_queue.h> // IWYU pragma: export
#endif // GRPCPP_COMPLETION_QUEUE_H
diff --git a/grpc/spm-cpp-include/grpcpp/create_channel_binder.h b/grpc/spm-cpp-include/grpcpp/create_channel_binder.h
new file mode 100644
index 00000000..a8f963db
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/create_channel_binder.h
@@ -0,0 +1,95 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_CREATE_CHANNEL_BINDER_H
+#define GRPCPP_CREATE_CHANNEL_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_ANDROID
+
+#include <jni.h>
+
+#include <memory>
+
+#include "absl/strings/string_view.h"
+
+#include <grpcpp/channel.h>
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/support/channel_arguments.h>
+
+namespace grpc {
+namespace experimental {
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void* jni_env, jobject context, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+/// \param args Options for channel creation.
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void* jni_env_void, jobject application, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ const ChannelArguments& args);
+
+/// EXPERIMENTAL Finds internal binder transport Java code. To create channels
+/// in threads created in native code, it is required to call this function
+/// once beforehand in a thread that is not created in native code.
+/// See
+/// https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
+/// for details of this limitation.
+/// Returns true when the initialization is successful.
+bool InitializeBinderChannelJavaClass(void* jni_env_void);
+
+/// EXPERIMENTAL Alternative version of `InitializeBinderChannelJavaClass(void*
+/// jni_env_void)`. This version used a user-specified function to find the
+/// required internal Java class. When a class is found, the `class_finder`
+/// function should return a local reference to the class (jclass type). The
+/// returned jclass will then be used to create global reference for gRPC to use
+/// it later. After that, gRPC will DeleteLocalRef the returned local reference.
+bool InitializeBinderChannelJavaClass(
+ void* jni_env_void, std::function<void*(std::string)> class_finder);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif
+
+#endif // GRPCPP_CREATE_CHANNEL_BINDER_H
diff --git a/grpc/spm-cpp-include/grpcpp/create_channel_posix.h b/grpc/spm-cpp-include/grpcpp/create_channel_posix.h
index 8c34330d..e6019d2c 100644
--- a/grpc/spm-cpp-include/grpcpp/create_channel_posix.h
+++ b/grpc/spm-cpp-include/grpcpp/create_channel_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_CREATE_CHANNEL_POSIX_H
#define GRPCPP_CREATE_CHANNEL_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/channel.h>
#include <grpcpp/support/channel_arguments.h>
diff --git a/grpc/spm-cpp-include/grpcpp/ext/orca_service.h b/grpc/spm-cpp-include/grpcpp/ext/orca_service.h
new file mode 100644
index 00000000..3acf4bf0
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/ext/orca_service.h
@@ -0,0 +1,83 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_EXT_ORCA_SERVICE_H
+#define GRPCPP_EXT_ORCA_SERVICE_H
+
+#include <map>
+#include <string>
+
+#include "absl/time/time.h"
+#include "absl/types/optional.h"
+
+#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/sync.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/support/slice.h>
+
+namespace grpc {
+namespace experimental {
+
+// RPC service implementation for supplying out-of-band backend
+// utilization metrics to clients.
+class OrcaService : public Service {
+ public:
+ struct Options {
+ // Minimum report interval. If a client requests an interval lower
+ // than this value, this value will be used instead.
+ absl::Duration min_report_duration = absl::Seconds(30);
+
+ Options() = default;
+ Options& set_min_report_duration(absl::Duration duration) {
+ min_report_duration = duration;
+ return *this;
+ }
+ };
+
+ explicit OrcaService(Options options);
+
+ // Sets or removes the CPU utilization value to be reported to clients.
+ void SetCpuUtilization(double cpu_utilization);
+ void DeleteCpuUtilization();
+
+ // Sets of removes the memory utilization value to be reported to clients.
+ void SetMemoryUtilization(double memory_utilization);
+ void DeleteMemoryUtilization();
+
+ // Sets or removed named utilization values to be reported to clients.
+ void SetNamedUtilization(std::string name, double utilization);
+ void DeleteNamedUtilization(const std::string& name);
+ void SetAllNamedUtilization(std::map<std::string, double> named_utilization);
+
+ private:
+ class Reactor;
+
+ Slice GetOrCreateSerializedResponse();
+
+ const absl::Duration min_report_duration_;
+
+ grpc::internal::Mutex mu_;
+ double cpu_utilization_ ABSL_GUARDED_BY(&mu_) = -1;
+ double memory_utilization_ ABSL_GUARDED_BY(&mu_) = -1;
+ std::map<std::string, double> named_utilization_ ABSL_GUARDED_BY(&mu_);
+ absl::optional<Slice> response_slice_ ABSL_GUARDED_BY(&mu_);
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_EXT_ORCA_SERVICE_H
diff --git a/grpc/spm-cpp-include/grpcpp/ext/proto_server_reflection_plugin.h b/grpc/spm-cpp-include/grpcpp/ext/proto_server_reflection_plugin.h
index 6bf7c282..3c58debc 100644
--- a/grpc/spm-cpp-include/grpcpp/ext/proto_server_reflection_plugin.h
+++ b/grpc/spm-cpp-include/grpcpp/ext/proto_server_reflection_plugin.h
@@ -28,7 +28,7 @@ class ServerInitializer;
namespace reflection {
-class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
+class ProtoServerReflectionPlugin : public grpc::ServerBuilderPlugin {
public:
ProtoServerReflectionPlugin();
::std::string name() override;
diff --git a/grpc/spm-cpp-include/grpcpp/ext/server_load_reporting.h b/grpc/spm-cpp-include/grpcpp/ext/server_load_reporting.h
index 7f681eb1..30c08d3b 100644
--- a/grpc/spm-cpp-include/grpcpp/ext/server_load_reporting.h
+++ b/grpc/spm-cpp-include/grpcpp/ext/server_load_reporting.h
@@ -37,8 +37,8 @@ namespace experimental {
class LoadReportingServiceServerBuilderOption
: public grpc::ServerBuilderOption {
public:
- void UpdateArguments(::grpc::ChannelArguments* args) override;
- void UpdatePlugins(std::vector<std::unique_ptr<::grpc::ServerBuilderPlugin>>*
+ void UpdateArguments(grpc::ChannelArguments* args) override;
+ void UpdatePlugins(std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>>*
plugins) override;
};
diff --git a/grpc/spm-cpp-include/grpcpp/generic/async_generic_service.h b/grpc/spm-cpp-include/grpcpp/generic/async_generic_service.h
index 2c67edc5..01c79428 100644
--- a/grpc/spm-cpp-include/grpcpp/generic/async_generic_service.h
+++ b/grpc/spm-cpp-include/grpcpp/generic/async_generic_service.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
-#include <grpcpp/impl/codegen/async_generic_service.h>
+#include <grpcpp/impl/codegen/async_generic_service.h> // IWYU pragma: export
#endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
diff --git a/grpc/spm-cpp-include/grpcpp/generic/generic_stub.h b/grpc/spm-cpp-include/grpcpp/generic/generic_stub.h
index e9564c33..6ae6c991 100644
--- a/grpc/spm-cpp-include/grpcpp/generic/generic_stub.h
+++ b/grpc/spm-cpp-include/grpcpp/generic/generic_stub.h
@@ -53,7 +53,7 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
PrepareCall(ClientContext* context, const std::string& method,
- ::grpc::CompletionQueue* cq) {
+ grpc::CompletionQueue* cq) {
return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
false, nullptr);
}
@@ -64,7 +64,7 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncResponseReader<ResponseType>> PrepareUnaryCall(
ClientContext* context, const std::string& method,
- const RequestType& request, ::grpc::CompletionQueue* cq) {
+ const RequestType& request, grpc::CompletionQueue* cq) {
return std::unique_ptr<ClientAsyncResponseReader<ResponseType>>(
internal::ClientAsyncResponseReaderHelper::Create<ResponseType>(
channel_.get(), cq,
@@ -82,18 +82,18 @@ class TemplatedGenericStub final {
/// succeeded (i.e. the call won't proceed if the return value is nullptr).
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>> Call(
ClientContext* context, const std::string& method,
- ::grpc::CompletionQueue* cq, void* tag) {
+ grpc::CompletionQueue* cq, void* tag) {
return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
true, tag);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Setup and start a unary call to a named method \a method using
/// \a context and specifying the \a request and \a response buffers.
void UnaryCall(ClientContext* context, const std::string& method,
- const RequestType* request, ResponseType* response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response,
std::function<void(grpc::Status)> on_completion) {
- UnaryCallInternal(context, method, /*options=*/{}, request, response,
+ UnaryCallInternal(context, method, options, request, response,
std::move(on_completion));
}
@@ -102,9 +102,9 @@ class TemplatedGenericStub final {
/// Like any other reactor-based RPC, it will not be activated until
/// StartCall is invoked on its reactor.
void PrepareUnaryCall(ClientContext* context, const std::string& method,
- const RequestType* request, ResponseType* response,
- ClientUnaryReactor* reactor) {
- PrepareUnaryCallInternal(context, method, /*options=*/{}, request, response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response, ClientUnaryReactor* reactor) {
+ PrepareUnaryCallInternal(context, method, options, request, response,
reactor);
}
@@ -112,58 +112,10 @@ class TemplatedGenericStub final {
/// \a reactor . Like any other bidi streaming RPC, it will not be activated
/// until StartCall is invoked on its reactor.
void PrepareBidiStreamingCall(
- ClientContext* context, const std::string& method,
+ ClientContext* context, const std::string& method, StubOptions options,
ClientBidiReactor<RequestType, ResponseType>* reactor) {
- PrepareBidiStreamingCallInternal(context, method, /*options=*/{}, reactor);
+ PrepareBidiStreamingCallInternal(context, method, options, reactor);
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of GenericStub when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(TemplatedGenericStub* stub) : stub_(stub) {}
-
- /// Setup and start a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- void UnaryCall(ClientContext* context, const std::string& method,
- StubOptions options, const RequestType* request,
- ResponseType* response,
- std::function<void(grpc::Status)> on_completion) {
- stub_->UnaryCallInternal(context, method, options, request, response,
- std::move(on_completion));
- }
-
- /// Setup a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- /// Like any other reactor-based RPC, it will not be activated until
- /// StartCall is invoked on its reactor.
- void PrepareUnaryCall(ClientContext* context, const std::string& method,
- StubOptions options, const RequestType* request,
- ResponseType* response, ClientUnaryReactor* reactor) {
- stub_->PrepareUnaryCallInternal(context, method, options, request,
- response, reactor);
- }
-
- /// Setup a call to a named method \a method using \a context and tied to
- /// \a reactor . Like any other bidi streaming RPC, it will not be activated
- /// until StartCall is invoked on its reactor.
- void PrepareBidiStreamingCall(
- ClientContext* context, const std::string& method, StubOptions options,
- ClientBidiReactor<RequestType, ResponseType>* reactor) {
- stub_->PrepareBidiStreamingCallInternal(context, method, options,
- reactor);
- }
-
- private:
- TemplatedGenericStub* stub_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
std::shared_ptr<grpc::ChannelInterface> channel_;
@@ -205,7 +157,7 @@ class TemplatedGenericStub final {
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
CallInternal(grpc::ChannelInterface* channel, ClientContext* context,
const std::string& method, StubOptions options,
- ::grpc::CompletionQueue* cq, bool start, void* tag) {
+ grpc::CompletionQueue* cq, bool start, void* tag) {
return std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>(
internal::ClientAsyncReaderWriterFactory<RequestType, ResponseType>::
Create(channel, cq,
diff --git a/grpc/spm-cpp-include/grpcpp/grpcpp.h b/grpc/spm-cpp-include/grpcpp/grpcpp.h
index 8912f99f..9d707e29 100644
--- a/grpc/spm-cpp-include/grpcpp/grpcpp.h
+++ b/grpc/spm-cpp-include/grpcpp/grpcpp.h
@@ -49,7 +49,6 @@
// headers are not private for grpcpp.h and are part of its interface.
// IWYU pragma: begin_exports
#include <grpc/grpc.h>
-
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/call.h b/grpc/spm-cpp-include/grpcpp/impl/call.h
index a6b13126..97d8fdfc 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/call.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CALL_H
#define GRPCPP_IMPL_CALL_H
-#include <grpcpp/impl/codegen/call.h>
+#include <grpcpp/impl/codegen/call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CALL_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/client_unary_call.h b/grpc/spm-cpp-include/grpcpp/impl/client_unary_call.h
index 378482c5..7ecf3548 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/client_unary_call.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/client_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CLIENT_UNARY_CALL_H
-#include <grpcpp/impl/codegen/client_unary_call.h>
+#include <grpcpp/impl/codegen/client_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CLIENT_UNARY_CALL_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_generic_service.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_generic_service.h
index 048af332..2a000662 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_generic_service.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_generic_service.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
+// IWYU pragma: private, include <grpcpp/generic/async_generic_service.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpcpp/impl/codegen/async_stream.h>
@@ -71,18 +73,14 @@ class AsyncGenericService final {
void 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);
private:
friend class grpc::Server;
grpc::Server* server_;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
-
/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs
/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with
/// ByteBuffer arguments.
@@ -94,7 +92,7 @@ class GenericCallbackServerContext final : public grpc::CallbackServerContext {
const std::string& host() const { return host_; }
private:
- friend class ::grpc::Server;
+ friend class grpc::Server;
std::string method_;
std::string host_;
@@ -126,7 +124,7 @@ class CallbackGenericService {
internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>* Handler() {
return new internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>(
- [this](::grpc::CallbackServerContext* ctx) {
+ [this](grpc::CallbackServerContext* ctx) {
return CreateReactor(static_cast<GenericCallbackServerContext*>(ctx));
});
}
@@ -134,9 +132,6 @@ class CallbackGenericService {
grpc::Server* server_{nullptr};
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_stream.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_stream.h
index aaee93df..5b63c301 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_stream.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/async_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
@@ -73,7 +75,7 @@ class ClientAsyncStreamingInterface {
///
/// \param[in] tag Tag identifying this request.
/// \param[out] status To be updated with the operation status.
- virtual void Finish(::grpc::Status* status, void* tag) = 0;
+ virtual void Finish(grpc::Status* status, void* tag) = 0;
};
/// An interface that yields a sequence of messages of type \a R.
@@ -133,7 +135,7 @@ class AsyncWriterInterface {
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
- virtual void Write(const W& msg, ::grpc::WriteOptions options, void* tag) = 0;
+ virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with the writing
/// of trailing metadata, using WriteOptions \a options with
@@ -153,7 +155,7 @@ class AsyncWriterInterface {
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
- void WriteLast(const W& msg, ::grpc::WriteOptions options, void* tag) {
+ void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) {
Write(msg, options.set_last_message(), tag);
}
};
@@ -177,13 +179,13 @@ class ClientAsyncReaderFactory {
/// Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
template <class W>
- static ClientAsyncReader<R>* Create(::grpc::ChannelInterface* channel,
- ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static ClientAsyncReader<R>* Create(grpc::ChannelInterface* channel,
+ grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const W& request, bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncReader<R>)))
ClientAsyncReader<R>(call, context, request, start, tag);
}
@@ -246,7 +248,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata received from the server.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -259,7 +261,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
private:
friend class internal::ClientAsyncReaderFactory<R>;
template <class W>
- ClientAsyncReader(::grpc::internal::Call call, ::grpc::ClientContext* context,
+ ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context,
const W& request, bool start, void* tag)
: context_(context), call_(call), started_(start) {
// TODO(ctiller): don't assert
@@ -279,20 +281,20 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
call_.PerformOps(&init_ops_);
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
init_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
@@ -325,13 +327,13 @@ class ClientAsyncWriterFactory {
/// message from the server upon a successful call to the \a Finish
/// method of this instance.
template <class R>
- static ClientAsyncWriter<W>* Create(::grpc::ChannelInterface* channel,
- ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- R* response, bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ static ClientAsyncWriter<W>* Create(grpc::ChannelInterface* channel,
+ grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response,
+ bool start, void* tag) {
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncWriter<W>)))
ClientAsyncWriter<W>(call, context, response, start, tag);
}
@@ -386,7 +388,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
@@ -412,7 +414,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
/// possible initial and trailing metadata received from the server.
/// - attempts to fill in the \a response parameter passed to this class's
/// constructor with the server's response message.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -425,7 +427,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
private:
friend class internal::ClientAsyncWriterFactory<W>;
template <class R>
- ClientAsyncWriter(::grpc::internal::Call call, ::grpc::ClientContext* context,
+ ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context,
R* response, bool start, void* tag)
: context_(context), call_(call), started_(start) {
finish_ops_.RecvMessage(response);
@@ -448,18 +450,18 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpGenericRecvMessage,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpGenericRecvMessage,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
@@ -491,12 +493,12 @@ class ClientAsyncReaderWriterFactory {
/// Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
static ClientAsyncReaderWriter<W, R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
bool start, void* tag) {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
- return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncReaderWriter<W, R>)))
ClientAsyncReaderWriter<W, R>(call, context, start, tag);
}
@@ -563,7 +565,7 @@ class ClientAsyncReaderWriter final
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
@@ -586,7 +588,7 @@ class ClientAsyncReaderWriter final
/// Side effect
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
- void Finish(::grpc::Status* status, void* tag) override {
+ void Finish(grpc::Status* status, void* tag) override {
GPR_CODEGEN_ASSERT(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
@@ -598,8 +600,8 @@ class ClientAsyncReaderWriter final
private:
friend class internal::ClientAsyncReaderWriterFactory<W, R>;
- ClientAsyncReaderWriter(::grpc::internal::Call call,
- ::grpc::ClientContext* context, bool start, void* tag)
+ ClientAsyncReaderWriter(grpc::internal::Call call,
+ grpc::ClientContext* context, bool start, void* tag)
: context_(context), call_(call), started_(start) {
if (start) {
StartCallInternal(tag);
@@ -619,26 +621,26 @@ class ClientAsyncReaderWriter final
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::internal::Call call_;
bool started_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
};
template <class W, class R>
class ServerAsyncReaderInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncReaderInterface<R> {
public:
/// Indicate that the stream is to be finished with a certain status code
@@ -663,8 +665,7 @@ class ServerAsyncReaderInterface
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
/// \param[in] msg To be sent to the client as the response for this call.
- virtual void Finish(const W& msg, const ::grpc::Status& status,
- void* tag) = 0;
+ virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0;
/// Indicate that the stream is to be finished with a certain
/// non-OK status code.
@@ -687,7 +688,7 @@ class ServerAsyncReaderInterface
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
/// - Note: \a status must have a non-OK code.
- virtual void FinishWithError(const ::grpc::Status& status, void* tag) = 0;
+ virtual void FinishWithError(const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing client-streaming RPCs,
@@ -696,7 +697,7 @@ class ServerAsyncReaderInterface
template <class W, class R>
class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
public:
- explicit ServerAsyncReader(::grpc::ServerContext* ctx)
+ explicit ServerAsyncReader(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -734,7 +735,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
///
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once Finish returns.
- void Finish(const W& msg, const ::grpc::Status& status, void* tag) override {
+ void Finish(const W& msg, const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@@ -763,7 +764,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
///
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once FinishWithError returns.
- void FinishWithError(const ::grpc::Status& status, void* tag) override {
+ void FinishWithError(const grpc::Status& status, void* tag) override {
GPR_CODEGEN_ASSERT(!status.ok());
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -779,22 +780,22 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
template <class W>
class ServerAsyncWriterInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncWriterInterface<W> {
public:
/// Indicate that the stream is to be finished with a certain status code.
@@ -818,7 +819,7 @@ class ServerAsyncWriterInterface
///
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
- virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
+ virtual void Finish(const grpc::Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with
@@ -834,8 +835,8 @@ class ServerAsyncWriterInterface
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
- virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) = 0;
+ virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing server streaming RPCs,
@@ -843,7 +844,7 @@ class ServerAsyncWriterInterface
template <class W>
class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
public:
- explicit ServerAsyncWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -874,7 +875,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -896,8 +897,8 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
///
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once WriteAndFinish returns.
- void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) override {
+ void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
@@ -917,7 +918,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
///
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once Finish returns.
- void Finish(const ::grpc::Status& status, void* tag) override {
+ void Finish(const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&finish_ops_);
finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
@@ -925,7 +926,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
@@ -939,23 +940,23 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
}
}
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
/// Server-side interface for asynchronous bi-directional streaming.
template <class W, class R>
class ServerAsyncReaderWriterInterface
- : public ::grpc::internal::ServerAsyncStreamingInterface,
+ : public grpc::internal::ServerAsyncStreamingInterface,
public internal::AsyncWriterInterface<W>,
public internal::AsyncReaderInterface<R> {
public:
@@ -981,7 +982,7 @@ class ServerAsyncReaderWriterInterface
///
/// \param[in] tag Tag identifying this request.
/// \param[in] status To be sent to the client as the result of this call.
- virtual void Finish(const ::grpc::Status& status, void* tag) = 0;
+ virtual void Finish(const grpc::Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with
@@ -997,8 +998,8 @@ class ServerAsyncReaderWriterInterface
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
- virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) = 0;
+ virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) = 0;
};
/// Async server-side API for doing bidirectional streaming RPCs,
@@ -1009,7 +1010,7 @@ template <class W, class R>
class ServerAsyncReaderWriter final
: public ServerAsyncReaderWriterInterface<W, R> {
public:
- explicit ServerAsyncReaderWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -1046,7 +1047,7 @@ class ServerAsyncReaderWriter final
call_.PerformOps(&write_ops_);
}
- void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override {
+ void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -1067,8 +1068,8 @@ class ServerAsyncReaderWriter final
//
/// gRPC doesn't take ownership or a reference to \a msg and \a status, so it
/// is safe to deallocate once WriteAndFinish returns.
- void WriteAndFinish(const W& msg, ::grpc::WriteOptions options,
- const ::grpc::Status& status, void* tag) override {
+ void WriteAndFinish(const W& msg, grpc::WriteOptions options,
+ const grpc::Status& status, void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
@@ -1088,7 +1089,7 @@ class ServerAsyncReaderWriter final
//
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once Finish returns.
- void Finish(const ::grpc::Status& status, void* tag) override {
+ void Finish(const grpc::Status& status, void* tag) override {
finish_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&finish_ops_);
@@ -1097,9 +1098,9 @@ class ServerAsyncReaderWriter final
}
private:
- friend class ::grpc::Server;
+ friend class grpc::Server;
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
@@ -1113,17 +1114,17 @@ class ServerAsyncReaderWriter final
}
}
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
write_ops_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
};
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_unary_call.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_unary_call.h
index 7cb7cc6f..0034d210 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/async_unary_call.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/async_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/support/async_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
@@ -68,7 +70,7 @@ class ClientAsyncResponseReaderInterface {
/// \param[in] tag Tag identifying this request.
/// \param[out] status To be updated with the operation status.
/// \param[out] msg To be filled in with the server's response message.
- virtual void Finish(R* msg, ::grpc::Status* status, void* tag) = 0;
+ virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0;
};
namespace internal {
@@ -89,12 +91,12 @@ class ClientAsyncResponseReaderHelper {
/// extraneous parameter just to provide the needed type information.
template <class R, class W, class BaseR = R, class BaseW = W>
static ClientAsyncResponseReader<R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
const W& request) /* __attribute__((noinline)) */ {
- ::grpc::internal::Call call = channel->CreateCall(method, context, cq);
+ grpc::internal::Call call = channel->CreateCall(method, context, cq);
ClientAsyncResponseReader<R>* result =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncResponseReader<R>)))
ClientAsyncResponseReader<R>(call, context);
SetupRequest<BaseR, BaseW>(
@@ -109,7 +111,7 @@ class ClientAsyncResponseReaderHelper {
template <class R, class W>
static void SetupRequest(
grpc_call* call,
- ::grpc::internal::CallOpSendInitialMetadata** single_buf_ptr,
+ grpc::internal::CallOpSendInitialMetadata** single_buf_ptr,
std::function<void(ClientContext*, internal::Call*,
internal::CallOpSendInitialMetadata*, void*)>*
read_initial_metadata,
@@ -119,14 +121,14 @@ class ClientAsyncResponseReaderHelper {
internal::CallOpSetInterface**, void*, Status*, void*)>* finish,
const W& request) {
using SingleBufType =
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose,
- ::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>,
- ::grpc::internal::CallOpClientRecvStatus>;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose,
+ grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>,
+ grpc::internal::CallOpClientRecvStatus>;
SingleBufType* single_buf =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call, sizeof(SingleBufType))) SingleBufType;
*single_buf_ptr = single_buf;
// TODO(ctiller): don't assert
@@ -160,11 +162,11 @@ class ClientAsyncResponseReaderHelper {
internal::CallOpSetInterface** finish_buf_ptr, void* msg,
Status* status, void* tag) {
if (initial_metadata_read) {
- using FinishBufType = ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<R>,
- ::grpc::internal::CallOpClientRecvStatus>;
+ using FinishBufType =
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>,
+ grpc::internal::CallOpClientRecvStatus>;
FinishBufType* finish_buf =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call->call(), sizeof(FinishBufType))) FinishBufType;
*finish_buf_ptr = finish_buf;
finish_buf->set_output_tag(tag);
@@ -184,9 +186,8 @@ class ClientAsyncResponseReaderHelper {
};
}
- static void StartCall(
- ::grpc::ClientContext* context,
- ::grpc::internal::CallOpSendInitialMetadata* single_buf) {
+ static void StartCall(grpc::ClientContext* context,
+ grpc::internal::CallOpSendInitialMetadata* single_buf) {
single_buf->SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
}
@@ -199,8 +200,8 @@ class ClientAsyncResponseReaderFactory {
public:
template <class W>
static ClientAsyncResponseReader<R>* Create(
- ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq,
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+ grpc::ChannelInterface* channel, grpc::CompletionQueue* cq,
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
const W& request, bool start) {
auto* result = ClientAsyncResponseReaderHelper::Create<R>(
channel, cq, method, context, request);
@@ -255,7 +256,7 @@ class ClientAsyncResponseReader final
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
- void Finish(R* msg, ::grpc::Status* status, void* tag) override {
+ void Finish(R* msg, grpc::Status* status, void* tag) override {
GPR_CODEGEN_DEBUG_ASSERT(started_);
finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_,
static_cast<void*>(msg), status, tag);
@@ -263,13 +264,13 @@ class ClientAsyncResponseReader final
private:
friend class internal::ClientAsyncResponseReaderHelper;
- ::grpc::ClientContext* const context_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* const context_;
+ grpc::internal::Call call_;
bool started_ = false;
bool initial_metadata_read_ = false;
- ClientAsyncResponseReader(::grpc::internal::Call call,
- ::grpc::ClientContext* context)
+ ClientAsyncResponseReader(grpc::internal::Call call,
+ grpc::ClientContext* context)
: context_(context), call_(call) {}
// disable operator new
@@ -292,9 +293,9 @@ class ClientAsyncResponseReader final
/// response message sent to the client is of type \a W.
template <class W>
class ServerAsyncResponseWriter final
- : public ::grpc::internal::ServerAsyncStreamingInterface {
+ : public grpc::internal::ServerAsyncStreamingInterface {
public:
- explicit ServerAsyncResponseWriter(::grpc::ServerContext* ctx)
+ explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
/// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics.
@@ -332,7 +333,11 @@ class ServerAsyncResponseWriter final
/// Note: if \a status has a non-OK code, then \a msg will not be sent,
/// and the client will receive only the status with possible trailing
/// metadata.
- void Finish(const W& msg, const ::grpc::Status& status, void* tag) {
+ ///
+ /// gRPC doesn't take ownership or a reference to msg and status, so it is
+ /// safe to deallocate them once the Finish operation is complete (i.e. a
+ /// result arrives in the completion queue).
+ void Finish(const W& msg, const grpc::Status& status, void* tag) {
finish_buf_.set_output_tag(tag);
finish_buf_.set_core_cq_tag(&finish_buf_);
if (!ctx_->sent_initial_metadata_) {
@@ -365,7 +370,11 @@ class ServerAsyncResponseWriter final
/// Side effect:
/// - also sends initial metadata if not already sent (using the
/// \a ServerContext associated with this call).
- void FinishWithError(const ::grpc::Status& status, void* tag) {
+ ///
+ /// gRPC doesn't take ownership or a reference to status, so it is safe to
+ /// deallocate them once the Finish operation is complete (i.e. a result
+ /// arrives in the completion queue).
+ void FinishWithError(const grpc::Status& status, void* tag) {
GPR_CODEGEN_ASSERT(!status.ok());
finish_buf_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
@@ -381,15 +390,15 @@ class ServerAsyncResponseWriter final
}
private:
- void BindCall(::grpc::internal::Call* call) override { call_ = *call; }
+ void BindCall(grpc::internal::Call* call) override { call_ = *call; }
- ::grpc::internal::Call call_;
- ::grpc::ServerContext* ctx_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::Call call_;
+ grpc::ServerContext* ctx_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_buf_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_buf_;
};
@@ -397,12 +406,12 @@ class ServerAsyncResponseWriter final
namespace std {
template <class R>
-class default_delete<::grpc::ClientAsyncResponseReader<R>> {
+class default_delete<grpc::ClientAsyncResponseReader<R>> {
public:
void operator()(void* /*p*/) {}
};
template <class R>
-class default_delete<::grpc::ClientAsyncResponseReaderInterface<R>> {
+class default_delete<grpc::ClientAsyncResponseReaderInterface<R>> {
public:
void operator()(void* /*p*/) {}
};
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/byte_buffer.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/byte_buffer.h
index 2c015f22..a9ba7d16 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/byte_buffer.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/byte_buffer.h
@@ -19,16 +19,17 @@
#ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
-#include <grpc/impl/codegen/byte_buffer.h>
+// IWYU pragma: private, include <grpcpp/support/byte_buffer.h>
+
+#include <vector>
+#include <grpc/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/serialization_traits.h>
#include <grpcpp/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/status.h>
-#include <vector>
-
namespace grpc {
class ServerInterface;
@@ -41,10 +42,10 @@ class CallbackUnaryHandler;
template <class RequestType, class ResponseType>
class CallbackServerStreamingHandler;
template <class RequestType>
-void* UnaryDeserializeHelper(grpc_byte_buffer*, ::grpc::Status*, RequestType*);
+void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*);
template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
class CallOpSendMessage;
template <class R>
@@ -114,6 +115,13 @@ class ByteBuffer final {
return *this;
}
+ // If this ByteBuffer's representation is a single flat slice, returns a
+ // slice referencing that array.
+ Status TrySingleSlice(Slice* slice) const;
+
+ /// Dump (read) the buffer contents into \a slics.
+ Status DumpToSingleSlice(Slice* slice) const;
+
/// Dump (read) the buffer contents into \a slices.
Status Dump(std::vector<Slice>* slices) const;
@@ -164,7 +172,7 @@ class ByteBuffer final {
friend class internal::CallOpGenericRecvMessage;
template <class RequestType>
friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*,
- ::grpc::Status*, RequestType*);
+ grpc::Status*, RequestType*);
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ServerStreamingHandler;
template <class RequestType, class ResponseType>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/call.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/call.h
index b2292862..90d54bc5 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/call.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/call.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_H
#define GRPCPP_IMPL_CODEGEN_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/call.h>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call_hook.h>
@@ -40,13 +42,13 @@ class Call final {
call_(nullptr),
max_receive_message_size_(-1) {}
/** call is owned by the caller */
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq)
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq)
: call_hook_(call_hook),
cq_(cq),
call_(call),
max_receive_message_size_(-1) {}
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq,
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq,
experimental::ClientRpcInfo* rpc_info)
: call_hook_(call_hook),
cq_(cq),
@@ -54,7 +56,7 @@ class Call final {
max_receive_message_size_(-1),
client_rpc_info_(rpc_info) {}
- Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq,
+ Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq,
int max_receive_message_size, experimental::ServerRpcInfo* rpc_info)
: call_hook_(call_hook),
cq_(cq),
@@ -67,7 +69,7 @@ class Call final {
}
grpc_call* call() const { return call_; }
- ::grpc::CompletionQueue* cq() const { return cq_; }
+ grpc::CompletionQueue* cq() const { return cq_; }
int max_receive_message_size() const { return max_receive_message_size_; }
@@ -81,7 +83,7 @@ class Call final {
private:
CallHook* call_hook_;
- ::grpc::CompletionQueue* cq_;
+ grpc::CompletionQueue* cq_;
grpc_call* call_;
int max_receive_message_size_;
experimental::ClientRpcInfo* client_rpc_info_ = nullptr;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_hook.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_hook.h
index 4f7d370c..8c4278e7 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_hook.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_hook.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
#define GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set.h
index 7fde1edb..5b1d4409 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
+// IWYU pragma: private
+
#include <cstring>
#include <map>
#include <memory>
@@ -165,6 +167,12 @@ class WriteOptions {
return *this;
}
+ /// Get value for the flag indicating that this is the last message, and
+ /// should be coalesced with trailing metadata.
+ ///
+ /// \sa GRPC_WRITE_LAST_MESSAGE
+ bool is_last_message() const { return last_message_; }
+
/// Guarantee that all bytes have been written to the socket before completing
/// this write (usually writes are completed when they pass flow control).
inline WriteOptions& set_write_through() {
@@ -172,13 +180,12 @@ class WriteOptions {
return *this;
}
- inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); }
+ inline WriteOptions& clear_write_through() {
+ ClearBit(GRPC_WRITE_THROUGH);
+ return *this;
+ }
- /// Get value for the flag indicating that this is the last message, and
- /// should be coalesced with trailing metadata.
- ///
- /// \sa GRPC_WRITE_LAST_MESSAGE
- bool is_last_message() const { return last_message_; }
+ inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); }
private:
void SetBit(const uint32_t mask) { flags_ |= mask; }
@@ -722,7 +729,7 @@ class CallOpRecvInitialMetadata {
public:
CallOpRecvInitialMetadata() : metadata_map_(nullptr) {}
- void RecvInitialMetadata(::grpc::ClientContext* context) {
+ void RecvInitialMetadata(grpc::ClientContext* context) {
context->initial_metadata_received_ = true;
metadata_map_ = &context->recv_initial_metadata_;
}
@@ -771,7 +778,7 @@ class CallOpClientRecvStatus {
CallOpClientRecvStatus()
: recv_status_(nullptr), debug_error_string_(nullptr) {}
- void ClientRecvStatus(::grpc::ClientContext* context, Status* status) {
+ void ClientRecvStatus(grpc::ClientContext* context, Status* status) {
client_context_ = context;
metadata_map_ = &client_context_->trailing_metadata_;
recv_status_ = status;
@@ -838,7 +845,7 @@ class CallOpClientRecvStatus {
private:
bool hijacked_ = false;
- ::grpc::ClientContext* client_context_;
+ grpc::ClientContext* client_context_;
MetadataMap* metadata_map_;
Status* recv_status_;
const char* debug_error_string_;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set_interface.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set_interface.h
index 3b74566a..a8eed9f6 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set_interface.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/call_op_set_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/completion_queue_tag.h>
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/callback_common.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/callback_common.h
index 086a179a..7c67c928 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/callback_common.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/callback_common.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
#define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
+// IWYU pragma: private
+
#include <functional>
#include <grpc/impl/codegen/grpc_types.h>
@@ -66,8 +68,7 @@ Reactor* CatchingReactorGetter(Func&& func, Args&&... args) {
// constructed and then fired at exactly one point. There is no expectation
// that they can be reused without reconstruction.
-class CallbackWithStatusTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithStatusTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -108,8 +109,7 @@ class CallbackWithStatusTag
CompletionQueueTag* ops_;
Status status_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithStatusTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
@@ -134,8 +134,7 @@ class CallbackWithStatusTag
/// CallbackWithSuccessTag can be reused multiple times, and will be used in
/// this fashion for streaming operations. As a result, it shouldn't clear
/// anything up until its destructor
-class CallbackWithSuccessTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithSuccessTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -198,8 +197,7 @@ class CallbackWithSuccessTag
std::function<void(bool)> func_;
CompletionQueueTag* ops_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithSuccessTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/channel_interface.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/channel_interface.h
index 324c10d1..19fef7e2 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/channel_interface.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/channel_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/status.h>
@@ -79,7 +81,7 @@ class ChannelInterface {
/// deadline expires. \a GetState needs to called to get the current state.
template <typename T>
void NotifyOnStateChange(grpc_connectivity_state last_observed, T deadline,
- ::grpc::CompletionQueue* cq, void* tag) {
+ grpc::CompletionQueue* cq, void* tag) {
TimePoint<T> deadline_tp(deadline);
NotifyOnStateChangeImpl(last_observed, deadline_tp.raw_time(), cq, tag);
}
@@ -104,41 +106,41 @@ class ChannelInterface {
private:
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::internal::ClientAsyncReaderFactory;
+ friend class grpc::internal::ClientAsyncReaderFactory;
template <class W>
- friend class ::grpc::internal::ClientAsyncWriterFactory;
+ friend class grpc::internal::ClientAsyncWriterFactory;
template <class W, class R>
- friend class ::grpc::internal::ClientAsyncReaderWriterFactory;
- friend class ::grpc::internal::ClientAsyncResponseReaderHelper;
+ friend class grpc::internal::ClientAsyncReaderWriterFactory;
+ friend class grpc::internal::ClientAsyncResponseReaderHelper;
template <class W, class R>
- friend class ::grpc::internal::ClientCallbackReaderWriterFactory;
+ friend class grpc::internal::ClientCallbackReaderWriterFactory;
template <class R>
- friend class ::grpc::internal::ClientCallbackReaderFactory;
+ friend class grpc::internal::ClientCallbackReaderFactory;
template <class W>
- friend class ::grpc::internal::ClientCallbackWriterFactory;
- friend class ::grpc::internal::ClientCallbackUnaryFactory;
+ friend class grpc::internal::ClientCallbackWriterFactory;
+ friend class grpc::internal::ClientCallbackUnaryFactory;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::CallbackUnaryCallImpl;
- friend class ::grpc::internal::RpcMethod;
- friend class ::grpc::experimental::DelegatingChannel;
- friend class ::grpc::internal::InterceptedChannel;
+ friend class grpc::internal::CallbackUnaryCallImpl;
+ friend class grpc::internal::RpcMethod;
+ friend class grpc::experimental::DelegatingChannel;
+ friend class grpc::internal::InterceptedChannel;
virtual internal::Call CreateCall(const internal::RpcMethod& method,
- ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) = 0;
+ grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) = 0;
virtual void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) = 0;
virtual void* RegisterMethod(const char* method) = 0;
virtual void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ grpc::CompletionQueue* cq,
void* tag) = 0;
virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) = 0;
@@ -151,12 +153,11 @@ class ChannelInterface {
// method and adding a new pure method to an interface would be a breaking
// change (even though this is private and non-API)
virtual internal::Call CreateCallInternal(
- const internal::RpcMethod& /*method*/, ::grpc::ClientContext* /*context*/,
- ::grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) {
+ const internal::RpcMethod& /*method*/, grpc::ClientContext* /*context*/,
+ grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) {
return internal::Call();
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// channel. If the return value is nullptr, this channel doesn't support
// callback operations.
@@ -164,7 +165,7 @@ class ChannelInterface {
// Returns nullptr (rather than being pure) since this is a post-1.0 method
// and adding a new pure method to an interface would be a breaking change
// (even though this is private and non-API)
- virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; }
+ virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; }
};
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_callback.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_callback.h
index ba802909..04ab4aa8 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_callback.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_callback.h
@@ -17,6 +17,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
+
+// IWYU pragma: private, include <grpcpp/support/client_callback.h>
+
#include <atomic>
#include <functional>
@@ -45,11 +48,11 @@ class RpcMethod;
template <class InputMessage, class OutputMessage,
class BaseInputMessage = InputMessage,
class BaseOutputMessage = OutputMessage>
-void CallbackUnaryCall(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+void CallbackUnaryCall(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const InputMessage* request, OutputMessage* result,
- std::function<void(::grpc::Status)> on_completion) {
+ std::function<void(grpc::Status)> on_completion) {
static_assert(std::is_base_of<BaseInputMessage, InputMessage>::value,
"Invalid input message specification");
static_assert(std::is_base_of<BaseOutputMessage, OutputMessage>::value,
@@ -61,17 +64,17 @@ void CallbackUnaryCall(::grpc::ChannelInterface* channel,
template <class InputMessage, class OutputMessage>
class CallbackUnaryCallImpl {
public:
- CallbackUnaryCallImpl(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ CallbackUnaryCallImpl(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const InputMessage* request, OutputMessage* result,
- std::function<void(::grpc::Status)> on_completion) {
- ::grpc::CompletionQueue* cq = channel->CallbackCQ();
+ std::function<void(grpc::Status)> on_completion) {
+ grpc::CompletionQueue* cq = channel->CallbackCQ();
GPR_CODEGEN_ASSERT(cq != nullptr);
grpc::internal::Call call(channel->CreateCall(method, context, cq));
using FullCallOpSet = grpc::internal::CallOpSet<
- ::grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
grpc::internal::CallOpRecvInitialMetadata,
grpc::internal::CallOpRecvMessage<OutputMessage>,
@@ -84,14 +87,14 @@ class CallbackUnaryCallImpl {
};
const size_t alloc_sz = sizeof(OpSetAndTag);
auto* const alloced = static_cast<OpSetAndTag*>(
- ::grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(),
- alloc_sz));
+ grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(),
+ alloc_sz));
auto* ops = new (&alloced->opset) FullCallOpSet;
auto* tag = new (&alloced->tag)
grpc::internal::CallbackWithStatusTag(call.call(), on_completion, ops);
// TODO(vjpai): Unify code with sync API as much as possible
- ::grpc::Status s = ops->SendMessagePtr(request);
+ grpc::Status s = ops->SendMessagePtr(request);
if (!s.ok()) {
tag->force_run(s);
return;
@@ -120,7 +123,7 @@ class ClientReactor {
/// hold).
///
/// \param[in] s The status outcome of this RPC
- virtual void OnDone(const ::grpc::Status& /*s*/) = 0;
+ virtual void OnDone(const grpc::Status& /*s*/) = 0;
/// InternalScheduleOnDone is not part of the API and is not meant to be
/// overridden. It is virtual to allow successful builds for certain bazel
@@ -129,7 +132,16 @@ class ClientReactor {
/// the virtual call is slower than a direct call, this function is
/// heavyweight and the cost of the virtual call is not much in comparison.
/// This function may be removed or devirtualized in the future.
- virtual void InternalScheduleOnDone(::grpc::Status s);
+ virtual void InternalScheduleOnDone(grpc::Status s);
+
+ /// InternalTrailersOnly is not part of the API and is not meant to be
+ /// overridden. It is virtual to allow successful builds for certain bazel
+ /// build users that only want to depend on gRPC codegen headers and not the
+ /// full library (although this is not a generally-supported option). Although
+ /// the virtual call is slower than a direct call, this function is
+ /// heavyweight and the cost of the virtual call is not much in comparison.
+ /// This function may be removed or devirtualized in the future.
+ virtual bool InternalTrailersOnly(const grpc_call* call) const;
};
} // namespace internal
@@ -151,7 +163,7 @@ class ClientCallbackReaderWriter {
public:
virtual ~ClientCallbackReaderWriter() {}
virtual void StartCall() = 0;
- virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0;
+ virtual void Write(const Request* req, grpc::WriteOptions options) = 0;
virtual void WritesDone() = 0;
virtual void Read(Response* resp) = 0;
virtual void AddHold(int holds) = 0;
@@ -183,9 +195,9 @@ class ClientCallbackWriter {
public:
virtual ~ClientCallbackWriter() {}
virtual void StartCall() = 0;
- void Write(const Request* req) { Write(req, ::grpc::WriteOptions()); }
- virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0;
- void WriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void Write(const Request* req) { Write(req, grpc::WriteOptions()); }
+ virtual void Write(const Request* req, grpc::WriteOptions options) = 0;
+ void WriteLast(const Request* req, grpc::WriteOptions options) {
Write(req, options.set_last_message());
}
virtual void WritesDone() = 0;
@@ -246,9 +258,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// \param[in] req The message to be written. The library does not take
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
- void StartWrite(const Request* req) {
- StartWrite(req, ::grpc::WriteOptions());
- }
+ void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); }
/// Initiate/post a write operation with specified options.
///
@@ -256,7 +266,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWrite(const Request* req, ::grpc::WriteOptions options) {
+ void StartWrite(const Request* req, grpc::WriteOptions options) {
stream_->Write(req, options);
}
@@ -269,7 +279,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Request* req, grpc::WriteOptions options) {
StartWrite(req, options.set_last_message());
}
@@ -316,7 +326,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// (like failure to remove a hold).
///
/// \param[in] s The status outcome of this RPC
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
/// Notifies the application that a read of initial metadata from the
/// server is done. If the application chooses not to implement this method,
@@ -373,7 +383,7 @@ class ClientReadReactor : public internal::ClientReactor {
}
void RemoveHold() { reader_->RemoveHold(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
virtual void OnReadDone(bool /*ok*/) {}
@@ -389,13 +399,11 @@ template <class Request>
class ClientWriteReactor : public internal::ClientReactor {
public:
void StartCall() { writer_->StartCall(); }
- void StartWrite(const Request* req) {
- StartWrite(req, ::grpc::WriteOptions());
- }
- void StartWrite(const Request* req, ::grpc::WriteOptions options) {
+ void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); }
+ void StartWrite(const Request* req, grpc::WriteOptions options) {
writer_->Write(req, options);
}
- void StartWriteLast(const Request* req, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Request* req, grpc::WriteOptions options) {
StartWrite(req, options.set_last_message());
}
void StartWritesDone() { writer_->WritesDone(); }
@@ -407,7 +415,7 @@ class ClientWriteReactor : public internal::ClientReactor {
}
void RemoveHold() { writer_->RemoveHold(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
virtual void OnWriteDone(bool /*ok*/) {}
virtual void OnWritesDoneDone(bool /*ok*/) {}
@@ -433,7 +441,7 @@ class ClientWriteReactor : public internal::ClientReactor {
class ClientUnaryReactor : public internal::ClientReactor {
public:
void StartCall() { call_->StartCall(); }
- void OnDone(const ::grpc::Status& /*s*/) override {}
+ void OnDone(const grpc::Status& /*s*/) override {}
virtual void OnReadInitialMetadataDone(bool /*ok*/) {}
private:
@@ -522,7 +530,7 @@ class ClientCallbackReaderWriterImpl
call_.PerformOps(&read_ops_);
}
- void Write(const Request* msg, ::grpc::WriteOptions options)
+ void Write(const Request* msg, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(start_mu_) override {
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -581,7 +589,7 @@ class ClientCallbackReaderWriterImpl
friend class ClientCallbackReaderWriterFactory<Request, Response>;
ClientCallbackReaderWriterImpl(grpc::internal::Call call,
- ::grpc::ClientContext* context,
+ grpc::ClientContext* context,
ClientBidiReactor<Request, Response>* reactor)
: context_(context),
call_(call),
@@ -594,7 +602,8 @@ class ClientCallbackReaderWriterImpl
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -638,11 +647,11 @@ class ClientCallbackReaderWriterImpl
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackReaderWriterImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -651,7 +660,7 @@ class ClientCallbackReaderWriterImpl
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientBidiReactor<Request, Response>* const reactor_;
@@ -665,7 +674,7 @@ class ClientCallbackReaderWriterImpl
grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
@@ -698,15 +707,15 @@ class ClientCallbackReaderWriterImpl
template <class Request, class Response>
class ClientCallbackReaderWriterFactory {
public:
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
ClientBidiReactor<Request, Response>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackReaderWriterImpl<Request, Response>)))
ClientCallbackReaderWriterImpl<Request, Response>(call, context,
reactor);
@@ -737,7 +746,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -796,8 +806,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
friend class ClientCallbackReaderFactory<Response>;
template <class Request>
- ClientCallbackReaderImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Request* request,
+ ClientCallbackReaderImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Request* request,
ClientReadReactor<Response>* reactor)
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
@@ -810,11 +820,11 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackReaderImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -823,7 +833,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientReadReactor<Response>* const reactor_;
@@ -836,7 +846,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<Response>>
read_ops_;
@@ -857,15 +867,15 @@ template <class Response>
class ClientCallbackReaderFactory {
public:
template <class Request>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const Request* request,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const Request* request,
ClientReadReactor<Response>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackReaderImpl<Response>)))
ClientCallbackReaderImpl<Response>(call, context, request, reactor);
}
@@ -918,7 +928,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
this->MaybeFinish(/*from_reaction=*/false);
}
- void Write(const Request* msg, ::grpc::WriteOptions options)
+ void Write(const Request* msg, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(start_mu_) override {
if (GPR_UNLIKELY(options.is_last_message())) {
options.set_buffer_hint();
@@ -981,8 +991,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
friend class ClientCallbackWriterFactory<Request>;
template <class Response>
- ClientCallbackWriterImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Response* response,
+ ClientCallbackWriterImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Response* response,
ClientWriteReactor<Request>* reactor)
: context_(context),
call_(call),
@@ -995,7 +1005,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -1027,11 +1038,11 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
void MaybeFinish(bool from_reaction) {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackWriterImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
if (GPR_LIKELY(from_reaction)) {
reactor->OnDone(s);
} else {
@@ -1040,7 +1051,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientWriteReactor<Request>* const reactor_;
@@ -1056,7 +1067,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
grpc::internal::CallOpClientRecvStatus>
finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
@@ -1085,15 +1096,15 @@ template <class Request>
class ClientCallbackWriterFactory {
public:
template <class Response>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, Response* response,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, Response* response,
ClientWriteReactor<Request>* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackWriterImpl<Request>)))
ClientCallbackWriterImpl<Request>(call, context, response, reactor);
}
@@ -1121,7 +1132,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish();
},
&start_ops_, /*can_inline=*/false);
@@ -1143,8 +1155,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
friend class ClientCallbackUnaryFactory;
template <class Request, class Response>
- ClientCallbackUnaryImpl(::grpc::internal::Call call,
- ::grpc::ClientContext* context, Request* request,
+ ClientCallbackUnaryImpl(grpc::internal::Call call,
+ grpc::ClientContext* context, Request* request,
Response* response, ClientUnaryReactor* reactor)
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
@@ -1161,16 +1173,16 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
void MaybeFinish() {
if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub(
1, std::memory_order_acq_rel) == 1)) {
- ::grpc::Status s = std::move(finish_status_);
+ grpc::Status s = std::move(finish_status_);
auto* reactor = reactor_;
auto* call = call_.call();
this->~ClientCallbackUnaryImpl();
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
reactor->OnDone(s);
}
}
- ::grpc::ClientContext* const context_;
+ grpc::ClientContext* const context_;
grpc::internal::Call call_;
ClientUnaryReactor* const reactor_;
@@ -1185,7 +1197,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
grpc::internal::CallOpClientRecvStatus>
finish_ops_;
grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::Status finish_status_;
+ grpc::Status finish_status_;
// This call will have 2 callbacks: start and finish
std::atomic<intptr_t> callbacks_outstanding_{2};
@@ -1195,16 +1207,16 @@ class ClientCallbackUnaryFactory {
public:
template <class Request, class Response, class BaseRequest = Request,
class BaseResponse = Response>
- static void Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const Request* request,
+ static void Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const Request* request,
Response* response, ClientUnaryReactor* reactor) {
grpc::internal::Call call =
channel->CreateCall(method, context, channel->CallbackCQ());
- ::grpc::g_core_codegen_interface->grpc_call_ref(call.call());
+ grpc::g_core_codegen_interface->grpc_call_ref(call.call());
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientCallbackUnaryImpl)))
ClientCallbackUnaryImpl(call, context,
static_cast<const BaseRequest*>(request),
@@ -1213,32 +1225,5 @@ class ClientCallbackUnaryFactory {
};
} // namespace internal
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-template <class Response>
-using ClientCallbackReader = ::grpc::ClientCallbackReader<Response>;
-
-template <class Request>
-using ClientCallbackWriter = ::grpc::ClientCallbackWriter<Request>;
-
-template <class Request, class Response>
-using ClientCallbackReaderWriter =
- ::grpc::ClientCallbackReaderWriter<Request, Response>;
-
-template <class Response>
-using ClientReadReactor = ::grpc::ClientReadReactor<Response>;
-
-template <class Request>
-using ClientWriteReactor = ::grpc::ClientWriteReactor<Request>;
-
-template <class Request, class Response>
-using ClientBidiReactor = ::grpc::ClientBidiReactor<Request, Response>;
-
-typedef ::grpc::ClientUnaryReactor ClientUnaryReactor;
-
-} // namespace experimental
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_context.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_context.h
index 952a7baf..9d616532 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_context.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_context.h
@@ -34,6 +34,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/client_context.h>
+
#include <map>
#include <memory>
#include <string>
@@ -92,6 +94,7 @@ class ClientAsyncResponseReader;
namespace testing {
class InteropClientContextInspector;
+class ClientContextTestPeer;
} // namespace testing
namespace internal {
@@ -205,7 +208,7 @@ class ClientContext {
/// \return A newly constructed \a ClientContext instance based on \a
/// server_context, with traits propagated (copied) according to \a options.
static std::unique_ptr<ClientContext> FromServerContext(
- const grpc::ServerContext& server_context,
+ const grpc::ServerContextBase& server_context,
PropagationOptions options = PropagationOptions());
static std::unique_ptr<ClientContext> FromCallbackServerContext(
const grpc::CallbackServerContext& server_context,
@@ -223,11 +226,16 @@ class ClientContext {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ \endverbatim
+ **/
void AddMetadata(const std::string& meta_key, const std::string& meta_value);
/// Return a collection of initial metadata key-value pairs. Note that keys
@@ -268,19 +276,7 @@ class ClientContext {
deadline_ = deadline_tp.raw_time();
}
- /// EXPERIMENTAL: Indicate that this request is idempotent.
- /// By default, RPCs are assumed to <i>not</i> be idempotent.
- ///
- /// If true, the gRPC library assumes that it's safe to initiate
- /// this RPC multiple times.
- void set_idempotent(bool idempotent) { idempotent_ = idempotent; }
-
- /// EXPERIMENTAL: Set this request to be cacheable.
- /// If set, grpc is free to use the HTTP GET verb for sending the request,
- /// with the possibility of receiving a cached response.
- void set_cacheable(bool cacheable) { cacheable_ = cacheable; }
-
- /// EXPERIMENTAL: Trigger wait-for-ready or not on this request.
+ /// Trigger wait-for-ready or not on this request.
/// See https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md.
/// If set, if an RPC is made when a channel's connectivity state is
/// TRANSIENT_FAILURE or CONNECTING, the call will not "fail fast",
@@ -422,37 +418,38 @@ class ClientContext {
ClientContext(const ClientContext&);
ClientContext& operator=(const ClientContext&);
- friend class ::grpc::testing::InteropClientContextInspector;
- friend class ::grpc::internal::CallOpClientRecvStatus;
- friend class ::grpc::internal::CallOpRecvInitialMetadata;
- friend class ::grpc::Channel;
+ friend class grpc::testing::InteropClientContextInspector;
+ friend class grpc::testing::ClientContextTestPeer;
+ friend class grpc::internal::CallOpClientRecvStatus;
+ friend class grpc::internal::CallOpRecvInitialMetadata;
+ friend class grpc::Channel;
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::ClientAsyncReader;
+ friend class grpc::ClientAsyncReader;
template <class W>
- friend class ::grpc::ClientAsyncWriter;
+ friend class grpc::ClientAsyncWriter;
template <class W, class R>
- friend class ::grpc::ClientAsyncReaderWriter;
+ friend class grpc::ClientAsyncReaderWriter;
template <class R>
- friend class ::grpc::ClientAsyncResponseReader;
- friend class ::grpc::internal::ClientAsyncResponseReaderHelper;
+ friend class grpc::ClientAsyncResponseReader;
+ friend class grpc::internal::ClientAsyncResponseReaderHelper;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::CallbackUnaryCallImpl;
+ friend class grpc::internal::CallbackUnaryCallImpl;
template <class Request, class Response>
- friend class ::grpc::internal::ClientCallbackReaderWriterImpl;
+ friend class grpc::internal::ClientCallbackReaderWriterImpl;
template <class Response>
- friend class ::grpc::internal::ClientCallbackReaderImpl;
+ friend class grpc::internal::ClientCallbackReaderImpl;
template <class Request>
- friend class ::grpc::internal::ClientCallbackWriterImpl;
- friend class ::grpc::internal::ClientCallbackUnaryImpl;
- friend class ::grpc::internal::ClientContextAccessor;
+ friend class grpc::internal::ClientCallbackWriterImpl;
+ friend class grpc::internal::ClientCallbackUnaryImpl;
+ friend class grpc::internal::ClientContextAccessor;
// Used by friend class CallOpClientRecvStatus
void set_debug_error_string(const std::string& debug_error_string) {
@@ -460,8 +457,7 @@ class ClientContext {
}
grpc_call* call() const { return call_; }
- void set_call(grpc_call* call,
- const std::shared_ptr<::grpc::Channel>& channel);
+ void set_call(grpc_call* call, const std::shared_ptr<grpc::Channel>& channel);
grpc::experimental::ClientRpcInfo* set_client_rpc_info(
const char* method, const char* suffix_for_stats,
@@ -476,9 +472,7 @@ class ClientContext {
}
uint32_t initial_metadata_flags() const {
- return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) |
- (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) |
- (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) |
+ return (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) |
(wait_for_ready_explicitly_set_
? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET
: 0) |
@@ -496,9 +490,7 @@ class ClientContext {
bool initial_metadata_received_;
bool wait_for_ready_;
bool wait_for_ready_explicitly_set_;
- bool idempotent_;
- bool cacheable_;
- std::shared_ptr<::grpc::Channel> channel_;
+ std::shared_ptr<grpc::Channel> channel_;
grpc::internal::Mutex mu_;
grpc_call* call_;
bool call_canceled_;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_interceptor.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_interceptor.h
index ec78074a..f3560b5a 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/client_interceptor.h>
+
#include <memory>
#include <vector>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_unary_call.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_unary_call.h
index d41ea1ad..86adb3e3 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/client_unary_call.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/client_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/client_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/channel_interface.h>
@@ -58,10 +60,10 @@ class BlockingUnaryCallImpl {
BlockingUnaryCallImpl(ChannelInterface* channel, const RpcMethod& method,
grpc::ClientContext* context,
const InputMessage& request, OutputMessage* result) {
- ::grpc::CompletionQueue cq(grpc_completion_queue_attributes{
+ grpc::CompletionQueue cq(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}); // Pluckable completion queue
- ::grpc::internal::Call call(channel->CreateCall(method, context, &cq));
+ grpc::internal::Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
CallOpClientSendClose, CallOpClientRecvStatus>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue.h
index d23e0e2b..33786f6e 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue.h
@@ -32,6 +32,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
+// IWYU pragma: private, include <grpcpp/completion_queue.h>
+
#include <list>
#include <grpc/impl/codegen/atm.h>
@@ -62,8 +64,8 @@ class ServerReaderWriterBody;
template <class ResponseType>
void UnaryRunHandlerHelper(
- const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
- ::grpc::Status&);
+ const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
+ grpc::Status&);
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType, class BaseResponseType>
class RpcMethodHandler;
@@ -73,7 +75,7 @@ template <class ServiceType, class RequestType, class ResponseType>
class ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
class TemplatedBidiStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
} // namespace internal
@@ -99,7 +101,7 @@ extern CoreCodegenInterface* g_core_codegen_interface;
/// src/core/lib/surface/completion_queue.h).
/// See \ref doc/cpp/perf_notes.md for notes on best practices for high
/// performance servers.
-class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
+class CompletionQueue : private grpc::GrpcLibraryCodegen {
public:
/// Default constructor. Implicitly creates a \a grpc_completion_queue
/// instance.
@@ -115,7 +117,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// Destructor. Destroys the owned wrapped completion queue / instance.
~CompletionQueue() override {
- ::grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_);
+ grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_);
}
/// Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT.
@@ -175,9 +177,14 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// \return true if got an event, false if the queue is fully drained and
/// shut down.
bool Next(void** tag, bool* ok) {
+ // Check return type == GOT_EVENT... cases:
+ // SHUTDOWN - queue has been shutdown, return false.
+ // TIMEOUT - we passed infinity time => queue has been shutdown, return
+ // false.
+ // GOT_EVENT - we actually got an event, return true.
return (AsyncNextInternal(tag, ok,
- ::grpc::g_core_codegen_interface->gpr_inf_future(
- GPR_CLOCK_REALTIME)) != SHUTDOWN);
+ grpc::g_core_codegen_interface->gpr_inf_future(
+ GPR_CLOCK_REALTIME)) == GOT_EVENT);
}
/// Read from the queue, blocking up to \a deadline (or the queue's shutdown).
@@ -193,7 +200,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// \return The type of event read.
template <typename T>
NextStatus AsyncNext(void** tag, bool* ok, const T& deadline) {
- ::grpc::TimePoint<T> deadline_tp(deadline);
+ grpc::TimePoint<T> deadline_tp(deadline);
return AsyncNextInternal(tag, ok, deadline_tp.raw_time());
}
@@ -244,8 +251,8 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
protected:
/// Private constructor of CompletionQueue only visible to friend classes
explicit CompletionQueue(const grpc_completion_queue_attributes& attributes) {
- cq_ = ::grpc::g_core_codegen_interface->grpc_completion_queue_create(
- ::grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup(
+ cq_ = grpc::g_core_codegen_interface->grpc_completion_queue_create(
+ grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup(
&attributes),
&attributes, nullptr);
InitialAvalanching(); // reserve this for the future shutdown
@@ -254,46 +261,46 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
private:
// Friends for access to server registration lists that enable checking and
// logging on shutdown
- friend class ::grpc::ServerBuilder;
- friend class ::grpc::Server;
+ friend class grpc::ServerBuilder;
+ friend class grpc::Server;
// Friend synchronous wrappers so that they can access Pluck(), which is
// a semi-private API geared towards the synchronous implementation.
template <class R>
- friend class ::grpc::ClientReader;
+ friend class grpc::ClientReader;
template <class W>
- friend class ::grpc::ClientWriter;
+ friend class grpc::ClientWriter;
template <class W, class R>
- friend class ::grpc::ClientReaderWriter;
+ friend class grpc::ClientReaderWriter;
template <class R>
- friend class ::grpc::ServerReader;
+ friend class grpc::ServerReader;
template <class W>
- friend class ::grpc::ServerWriter;
+ friend class grpc::ServerWriter;
template <class W, class R>
- friend class ::grpc::internal::ServerReaderWriterBody;
+ friend class grpc::internal::ServerReaderWriterBody;
template <class ResponseType>
- friend void ::grpc::internal::UnaryRunHandlerHelper(
- const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
- ::grpc::Status&);
+ friend void grpc::internal::UnaryRunHandlerHelper(
+ const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*,
+ grpc::Status&);
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ClientStreamingHandler;
+ friend class grpc::internal::ClientStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ServerStreamingHandler;
+ friend class grpc::internal::ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
- friend class ::grpc::internal::TemplatedBidiStreamingHandler;
- template <::grpc::StatusCode code>
- friend class ::grpc::internal::ErrorMethodHandler;
- friend class ::grpc::ServerContextBase;
- friend class ::grpc::ServerInterface;
+ friend class grpc::internal::TemplatedBidiStreamingHandler;
+ template <grpc::StatusCode code>
+ friend class grpc::internal::ErrorMethodHandler;
+ friend class grpc::ServerContextBase;
+ friend class grpc::ServerInterface;
template <class InputMessage, class OutputMessage>
- friend class ::grpc::internal::BlockingUnaryCallImpl;
+ friend class grpc::internal::BlockingUnaryCallImpl;
// Friends that need access to constructor for callback CQ
- friend class ::grpc::Channel;
+ friend class grpc::Channel;
// For access to Register/CompleteAvalanching
template <class Op1, class Op2, class Op3, class Op4, class Op5, class Op6>
- friend class ::grpc::internal::CallOpSet;
+ friend class grpc::internal::CallOpSet;
/// EXPERIMENTAL
/// Creates a Thread Local cache to store the first event
@@ -314,11 +321,11 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// Wraps \a grpc_completion_queue_pluck.
/// \warning Must not be mixed with calls to \a Next.
- bool Pluck(::grpc::internal::CompletionQueueTag* tag) {
+ bool Pluck(grpc::internal::CompletionQueueTag* tag) {
auto deadline =
- ::grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME);
+ grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME);
while (true) {
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
bool ok = ev.success != 0;
void* ignored = tag;
@@ -337,10 +344,10 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// implementation to simple call the other TryPluck function with a zero
/// timeout. i.e:
/// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME))
- void TryPluck(::grpc::internal::CompletionQueueTag* tag) {
+ void TryPluck(grpc::internal::CompletionQueueTag* tag) {
auto deadline =
- ::grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT) return;
bool ok = ev.success != 0;
@@ -354,9 +361,9 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
///
/// This exects tag->FinalizeResult (if called) to return 'false' i.e expects
/// that the tag is internal not something that is returned to the user.
- void TryPluck(::grpc::internal::CompletionQueueTag* tag,
+ void TryPluck(grpc::internal::CompletionQueueTag* tag,
gpr_timespec deadline) {
- auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
+ auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) {
return;
@@ -383,18 +390,18 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
void CompleteAvalanching() {
if (gpr_atm_no_barrier_fetch_add(&avalanches_in_flight_,
static_cast<gpr_atm>(-1)) == 1) {
- ::grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_);
+ grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_);
}
}
- void RegisterServer(const ::grpc::Server* server) {
+ void RegisterServer(const grpc::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
server_list_.push_back(server);
#endif
}
- void UnregisterServer(const ::grpc::Server* server) {
+ void UnregisterServer(const grpc::Server* server) {
(void)server;
#ifndef NDEBUG
grpc::internal::MutexLock l(&server_list_mutex_);
@@ -420,7 +427,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
// NDEBUG, instantiate it in all cases since otherwise the size will be
// inconsistent.
mutable grpc::internal::Mutex server_list_mutex_;
- std::list<const ::grpc::Server*>
+ std::list<const grpc::Server*>
server_list_ /* GUARDED_BY(server_list_mutex_) */;
};
@@ -443,15 +450,15 @@ class ServerCompletionQueue : public CompletionQueue {
/// \param shutdown_cb is the shutdown callback used for CALLBACK api queues
ServerCompletionQueue(grpc_cq_completion_type completion_type,
grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_cb)
+ grpc_completion_queue_functor* shutdown_cb)
: CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, completion_type, polling_type,
shutdown_cb}),
polling_type_(polling_type) {}
grpc_cq_polling_type polling_type_;
- friend class ::grpc::ServerBuilder;
- friend class ::grpc::Server;
+ friend class grpc::ServerBuilder;
+ friend class grpc::Server;
};
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue_tag.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue_tag.h
index 304386a9..9af470b7 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue_tag.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/completion_queue_tag.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/config.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/config.h
index 0a8a9c13..d810cfae 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/config.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/config.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_H
+// IWYU pragma: private, include <grpcpp/support/config.h>
+
#include <string>
/// The following macros are deprecated and appear only for users
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/config_protobuf.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/config_protobuf.h
index 49db4c5d..da874c58 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/config_protobuf.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/config_protobuf.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
+// IWYU pragma: private
+
#define GRPC_OPEN_SOURCE_PROTO
#ifndef GRPC_CUSTOM_MESSAGE
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen.h
index df2a03cd..e0440ffe 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
+// IWYU pragma: private
+
// This file should be compiled as part of grpcpp.
#include <grpc/byte_buffer.h>
@@ -70,6 +72,7 @@ class CoreCodegen final : public CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) override;
+ int grpc_call_failed_before_recv_message(const grpc_call* c) override;
void grpc_call_ref(grpc_call* call) override;
void grpc_call_unref(grpc_call* call) override;
void* grpc_call_arena_alloc(grpc_call* call, size_t length) override;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen_interface.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen_interface.h
index c08cf6c6..0b23bf46 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen_interface.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/core_codegen_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc/impl/codegen/byte_buffer_reader.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -111,6 +113,7 @@ class CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) = 0;
+ virtual int grpc_call_failed_before_recv_message(const grpc_call* c) = 0;
virtual void grpc_call_ref(grpc_call* call) = 0;
virtual void grpc_call_unref(grpc_call* call) = 0;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/create_auth_context.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/create_auth_context.h
index cb6095c3..817988f3 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/create_auth_context.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/create_auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
+// IWYU pragma: private
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/delegating_channel.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/delegating_channel.h
index 0479567b..5e63d542 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/delegating_channel.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/delegating_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
+// IWYU pragma: private
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
@@ -26,26 +28,26 @@
namespace grpc {
namespace experimental {
-class DelegatingChannel : public ::grpc::ChannelInterface {
+class DelegatingChannel : public grpc::ChannelInterface {
public:
~DelegatingChannel() override {}
explicit DelegatingChannel(
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel)
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel)
: delegate_channel_(delegate_channel) {}
grpc_connectivity_state GetState(bool try_to_connect) override {
return delegate_channel()->GetState(try_to_connect);
}
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel() {
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel() {
return delegate_channel_;
}
private:
internal::Call CreateCall(const internal::RpcMethod& method,
ClientContext* context,
- ::grpc::CompletionQueue* cq) final {
+ grpc::CompletionQueue* cq) final {
return delegate_channel()->CreateCall(method, context, cq);
}
@@ -59,8 +61,7 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq,
tag);
@@ -73,17 +74,17 @@ class DelegatingChannel : public ::grpc::ChannelInterface {
internal::Call CreateCallInternal(const internal::RpcMethod& method,
ClientContext* context,
- ::grpc::CompletionQueue* cq,
+ grpc::CompletionQueue* cq,
size_t interceptor_pos) final {
return delegate_channel()->CreateCallInternal(method, context, cq,
interceptor_pos);
}
- ::grpc::CompletionQueue* CallbackCQ() final {
+ grpc::CompletionQueue* CallbackCQ() final {
return delegate_channel()->CallbackCQ();
}
- std::shared_ptr<::grpc::ChannelInterface> delegate_channel_;
+ std::shared_ptr<grpc::ChannelInterface> delegate_channel_;
};
} // namespace experimental
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/grpc_library.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/grpc_library.h
index 660d6d0a..9f83a7f9 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/grpc_library.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/grpc_library.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
#define GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
+// IWYU pragma: private, include <grpcpp/impl/grpc_library.h>
+
#include <grpcpp/impl/codegen/core_codegen_interface.h>
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/intercepted_channel.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/intercepted_channel.h
index e3a4c8e7..57c97dd6 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/intercepted_channel.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/intercepted_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/channel_interface.h>
namespace grpc {
@@ -46,8 +48,8 @@ class InterceptedChannel : public ChannelInterface {
InterceptedChannel(ChannelInterface* channel, size_t pos)
: channel_(channel), interceptor_pos_(pos) {}
- Call CreateCall(const RpcMethod& method, ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq) override {
+ Call CreateCall(const RpcMethod& method, grpc::ClientContext* context,
+ grpc::CompletionQueue* cq) override {
return channel_->CreateCallInternal(method, context, cq, interceptor_pos_);
}
@@ -59,8 +61,7 @@ class InterceptedChannel : public ChannelInterface {
}
void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
- gpr_timespec deadline,
- ::grpc::CompletionQueue* cq,
+ gpr_timespec deadline, grpc::CompletionQueue* cq,
void* tag) override {
return channel_->NotifyOnStateChangeImpl(last_observed, deadline, cq, tag);
}
@@ -69,7 +70,7 @@ class InterceptedChannel : public ChannelInterface {
return channel_->WaitForStateChangeImpl(last_observed, deadline);
}
- ::grpc::CompletionQueue* CallbackCQ() override {
+ grpc::CompletionQueue* CallbackCQ() override {
return channel_->CallbackCQ();
}
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor.h
index 58fb36c8..8faea760 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/interceptor.h>
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor_common.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor_common.h
index b9a6eded..b084b7ce 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor_common.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/interceptor_common.h
@@ -19,17 +19,18 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
+// IWYU pragma: private
+
#include <array>
#include <functional>
+#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
#include <grpcpp/impl/codegen/intercepted_channel.h>
#include <grpcpp/impl/codegen/server_interceptor.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
namespace grpc {
namespace internal {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/message_allocator.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/message_allocator.h
index 4048ea11..440c7f1d 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/message_allocator.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/message_allocator.h
@@ -19,10 +19,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
#define GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
+// IWYU pragma: private, include <grpcpp/support/message_allocator.h>
+
namespace grpc {
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
// NOTE: This is an API for advanced users who need custom allocators.
// Per rpc struct for the allocator. This is the interface to return to user.
@@ -69,25 +68,6 @@ class MessageAllocator {
virtual MessageHolder<RequestT, ResponseT>* AllocateMessages() = 0;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-
-using ::grpc::RpcAllocatorState;
-
-template <typename RequestT, typename ResponseT>
-using MessageHolder = ::grpc::MessageHolder<RequestT, ResponseT>;
-
-template <typename RequestT, typename ResponseT>
-using MessageAllocator = ::grpc::MessageAllocator<RequestT, ResponseT>;
-
-} // namespace experimental
-#endif
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/metadata_map.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/metadata_map.h
index 9b9957bb..931d682d 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/metadata_map.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/metadata_map.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
#define GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
+// IWYU pragma: private
+
#include <map>
#include <grpc/impl/codegen/log.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler.h
index fb093f54..58056314 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
+// IWYU pragma: private, include <grpcpp/support/method_handler.h>
+
#include <grpcpp/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -41,8 +43,8 @@ template <class Callable>
try {
return handler();
} catch (...) {
- return ::grpc::Status(::grpc::StatusCode::UNKNOWN,
- "Unexpected error in RPC handling");
+ return grpc::Status(grpc::StatusCode::UNKNOWN,
+ "Unexpected error in RPC handling");
}
#else // GRPC_ALLOW_EXCEPTIONS
return handler();
@@ -55,11 +57,11 @@ template <class Callable>
template <class ResponseType>
void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param,
- ResponseType* rsp, ::grpc::Status& status) {
+ ResponseType* rsp, grpc::Status& status) {
GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
ops;
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
param.server_context->initial_metadata_flags());
@@ -77,11 +79,11 @@ void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param,
/// A helper function with reduced templating to do deserializing.
template <class RequestType>
-void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status,
+void* UnaryDeserializeHelper(grpc_byte_buffer* req, grpc::Status* status,
RequestType* request) {
- ::grpc::ByteBuffer buf;
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- *status = ::grpc::SerializationTraits<RequestType>::Deserialize(
+ *status = grpc::SerializationTraits<RequestType>::Deserialize(
&buf, static_cast<RequestType*>(request));
buf.Release();
if (status->ok()) {
@@ -95,22 +97,22 @@ void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status,
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType = RequestType,
class BaseResponseType = ResponseType>
-class RpcMethodHandler : public ::grpc::internal::MethodHandler {
+class RpcMethodHandler : public grpc::internal::MethodHandler {
public:
RpcMethodHandler(
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ResponseType*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
ResponseType rsp;
- ::grpc::Status status = param.status;
+ grpc::Status status = param.status;
if (status.ok()) {
status = CatchingFunctionHandler([this, &param, &rsp] {
return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context),
static_cast<RequestType*>(param.request), &rsp);
});
static_cast<RequestType*>(param.request)->~RequestType();
@@ -119,18 +121,17 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType;
+ grpc::Status* status, void** /*handler_data*/) final {
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType;
return UnaryDeserializeHelper(req, status,
static_cast<BaseRequestType*>(request));
}
private:
/// Application provided rpc handler function.
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ResponseType*)>
func_;
// The class the above handler function lives in.
ServiceType* service_;
@@ -138,29 +139,29 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler {
/// A wrapper class of an application provided client streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
-class ClientStreamingHandler : public ::grpc::internal::MethodHandler {
+class ClientStreamingHandler : public grpc::internal::MethodHandler {
public:
ClientStreamingHandler(
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- ServerReader<RequestType>*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ ServerReader<RequestType>*, ResponseType*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
ServerReader<RequestType> reader(
- param.call, static_cast<::grpc::ServerContext*>(param.server_context));
+ param.call, static_cast<grpc::ServerContext*>(param.server_context));
ResponseType rsp;
- ::grpc::Status status = CatchingFunctionHandler([this, &param, &reader,
- &rsp] {
- return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
- &reader, &rsp);
- });
-
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::Status status =
+ CatchingFunctionHandler([this, &param, &reader, &rsp] {
+ return func_(service_,
+ static_cast<grpc::ServerContext*>(param.server_context),
+ &reader, &rsp);
+ });
+
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -178,39 +179,38 @@ class ClientStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- ServerReader<RequestType>*, ResponseType*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ ServerReader<RequestType>*, ResponseType*)>
func_;
ServiceType* service_;
};
/// A wrapper class of an application provided server streaming handler.
template <class ServiceType, class RequestType, class ResponseType>
-class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
+class ServerStreamingHandler : public grpc::internal::MethodHandler {
public:
- ServerStreamingHandler(std::function<::grpc::Status(
- ServiceType*, ::grpc::ServerContext*,
+ ServerStreamingHandler(std::function<grpc::Status(
+ ServiceType*, grpc::ServerContext*,
const RequestType*, ServerWriter<ResponseType>*)>
func,
ServiceType* service)
: func_(func), service_(service) {}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::Status status = param.status;
+ grpc::Status status = param.status;
if (status.ok()) {
ServerWriter<ResponseType> writer(
- param.call,
- static_cast<::grpc::ServerContext*>(param.server_context));
+ param.call, static_cast<grpc::ServerContext*>(param.server_context));
status = CatchingFunctionHandler([this, &param, &writer] {
return func_(service_,
- static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context),
static_cast<RequestType*>(param.request), &writer);
});
static_cast<RequestType*>(param.request)->~RequestType();
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -228,14 +228,13 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** /*handler_data*/) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType();
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
@@ -245,8 +244,8 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*,
- const RequestType*, ServerWriter<ResponseType>*)>
+ std::function<grpc::Status(ServiceType*, grpc::ServerContext*,
+ const RequestType*, ServerWriter<ResponseType>*)>
func_;
ServiceType* service_;
};
@@ -259,22 +258,22 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler {
/// Instead, it is expected to be an implicitly-captured argument of func
/// (through bind or something along those lines)
template <class Streamer, bool WriteNeeded>
-class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
+class TemplatedBidiStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit TemplatedBidiStreamingHandler(
- std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func)
+ std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func)
: func_(func), write_needed_(WriteNeeded) {}
void RunHandler(const HandlerParameter& param) final {
Streamer stream(param.call,
- static_cast<::grpc::ServerContext*>(param.server_context));
- ::grpc::Status status = CatchingFunctionHandler([this, &param, &stream] {
- return func_(static_cast<::grpc::ServerContext*>(param.server_context),
+ static_cast<grpc::ServerContext*>(param.server_context));
+ grpc::Status status = CatchingFunctionHandler([this, &param, &stream] {
+ return func_(static_cast<grpc::ServerContext*>(param.server_context),
&stream);
});
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
if (!param.server_context->sent_initial_metadata_) {
ops.SendInitialMetadata(&param.server_context->initial_metadata_,
@@ -285,8 +284,8 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
if (write_needed_ && status.ok()) {
// If we needed a write but never did one, we need to mark the
// status as a fail
- status = ::grpc::Status(::grpc::StatusCode::INTERNAL,
- "Service did not provide response message");
+ status = grpc::Status(grpc::StatusCode::INTERNAL,
+ "Service did not provide response message");
}
}
ops.ServerSendStatus(&param.server_context->trailing_metadata_, status);
@@ -298,7 +297,7 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func_;
+ std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func_;
const bool write_needed_;
};
@@ -307,8 +306,8 @@ class BidiStreamingHandler
: public TemplatedBidiStreamingHandler<
ServerReaderWriter<ResponseType, RequestType>, false> {
public:
- BidiStreamingHandler(std::function<::grpc::Status(
- ServiceType*, ::grpc::ServerContext*,
+ BidiStreamingHandler(std::function<grpc::Status(
+ ServiceType*, grpc::ServerContext*,
ServerReaderWriter<ResponseType, RequestType>*)>
func,
ServiceType* service)
@@ -316,7 +315,7 @@ class BidiStreamingHandler
: TemplatedBidiStreamingHandler<
ServerReaderWriter<ResponseType, RequestType>, false>(
[func, service](
- ::grpc::ServerContext* ctx,
+ grpc::ServerContext* ctx,
ServerReaderWriter<ResponseType, RequestType>* streamer) {
return func(service, ctx, streamer);
}) {}
@@ -329,8 +328,8 @@ class StreamedUnaryHandler
public:
explicit StreamedUnaryHandler(
std::function<
- ::grpc::Status(::grpc::ServerContext*,
- ServerUnaryStreamer<RequestType, ResponseType>*)>
+ grpc::Status(grpc::ServerContext*,
+ ServerUnaryStreamer<RequestType, ResponseType>*)>
func)
: TemplatedBidiStreamingHandler<
ServerUnaryStreamer<RequestType, ResponseType>, true>(
@@ -344,8 +343,8 @@ class SplitServerStreamingHandler
public:
explicit SplitServerStreamingHandler(
std::function<
- ::grpc::Status(::grpc::ServerContext*,
- ServerSplitStreamer<RequestType, ResponseType>*)>
+ grpc::Status(grpc::ServerContext*,
+ ServerSplitStreamer<RequestType, ResponseType>*)>
func)
: TemplatedBidiStreamingHandler<
ServerSplitStreamer<RequestType, ResponseType>, false>(
@@ -354,15 +353,15 @@ class SplitServerStreamingHandler
/// General method handler class for errors that prevent real method use
/// e.g., handle unknown method by returning UNIMPLEMENTED error.
-template <::grpc::StatusCode code>
-class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
+template <grpc::StatusCode code>
+class ErrorMethodHandler : public grpc::internal::MethodHandler {
public:
explicit ErrorMethodHandler(const std::string& message) : message_(message) {}
template <class T>
- static void FillOps(::grpc::ServerContextBase* context,
+ static void FillOps(grpc::ServerContextBase* context,
const std::string& message, T* ops) {
- ::grpc::Status status(code, message);
+ grpc::Status status(code, message);
if (!context->sent_initial_metadata_) {
ops->SendInitialMetadata(&context->initial_metadata_,
context->initial_metadata_flags());
@@ -375,8 +374,8 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpServerSendStatus>
ops;
FillOps(param.server_context, message_, &ops);
param.call->PerformOps(&ops);
@@ -384,10 +383,10 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* /*call*/, grpc_byte_buffer* req,
- ::grpc::Status* /*status*/, void** /*handler_data*/) final {
+ grpc::Status* /*status*/, void** /*handler_data*/) final {
// We have to destroy any request payload
if (req != nullptr) {
- ::grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req);
+ grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req);
}
return nullptr;
}
@@ -396,9 +395,9 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
const std::string message_;
};
-typedef ErrorMethodHandler<::grpc::StatusCode::UNIMPLEMENTED>
+typedef ErrorMethodHandler<grpc::StatusCode::UNIMPLEMENTED>
UnknownMethodHandler;
-typedef ErrorMethodHandler<::grpc::StatusCode::RESOURCE_EXHAUSTED>
+typedef ErrorMethodHandler<grpc::StatusCode::RESOURCE_EXHAUSTED>
ResourceExhaustedHandler;
} // namespace internal
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler_impl.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler_impl.h
index cc88a135..3f1d573b 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler_impl.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/method_handler_impl.h
@@ -19,4 +19,6 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
+// IWYU pragma: private
+
#endif // GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_reader.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_reader.h
index d25b79a4..ecc0e301 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_reader.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_reader.h>
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
@@ -43,7 +45,7 @@ extern CoreCodegenInterface* g_core_codegen_interface;
///
/// Read more about ZeroCopyInputStream interface here:
/// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyInputStream
-class ProtoBufferReader : public ::grpc::protobuf::io::ZeroCopyInputStream {
+class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
public:
/// Constructs buffer reader from \a buffer. Will set \a status() to non ok
/// if \a buffer is invalid (the internal buffer has not been initialized).
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_writer.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_writer.h
index cd9d70c5..552c6a70 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_writer.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_buffer_writer.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_writer.h>
+
#include <type_traits>
#include <grpc/impl/codegen/grpc_types.h>
@@ -50,7 +52,7 @@ const int kProtoBufferWriterMaxBufferLength = 1024 * 1024;
///
/// Read more about ZeroCopyOutputStream interface here:
/// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyOutputStream
-class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
+class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
public:
/// Constructor for this derived class
///
@@ -116,6 +118,13 @@ class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
/// (only used in the last buffer). \a count must be less than or equal too
/// the last buffer returned from next.
void BackUp(int count) override {
+ // count == 0 is invoked by ZeroCopyOutputStream users indicating that any
+ // potential buffer obtained through a previous call to Next() is final.
+ // ZeroCopyOutputStream implementations such as streaming output can use
+ // these calls to flush any temporary buffer and flush the output. The logic
+ // below is not robust against count == 0 invocations, so directly return.
+ if (count == 0) return;
+
/// 1. Remove the partially-used last slice from the slice buffer
/// 2. Split it into the needed (if any) and unneeded part
/// 3. Add the needed part back to the slice buffer
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_utils.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_utils.h
index 7f5c6e9a..4f6d8741 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_utils.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/proto_utils.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
#define GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
+// IWYU pragma: private
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_method.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_method.h
index 388784e6..83dedda4 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_method.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_method.h>
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_service_method.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_service_method.h
index 4fcc2112..6f6730a1 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_service_method.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/rpc_service_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_service_method.h>
+
#include <climits>
#include <functional>
#include <map>
@@ -49,7 +51,7 @@ class MethodHandler {
/// \param requester : used only by the callback API. It is a function
/// called by the RPC Controller to request another RPC (and also
/// to set up the state required to make that request possible)
- HandlerParameter(Call* c, ::grpc::ServerContextBase* context, void* req,
+ HandlerParameter(Call* c, grpc::ServerContextBase* context, void* req,
Status req_status, void* handler_data,
std::function<void()> requester)
: call(c),
@@ -60,7 +62,7 @@ class MethodHandler {
call_requester(std::move(requester)) {}
~HandlerParameter() {}
Call* const call;
- ::grpc::ServerContextBase* const server_context;
+ grpc::ServerContextBase* const server_context;
void* const request;
const Status status;
void* const internal_data;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/security/auth_context.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/security/auth_context.h
index cea6dbea..d834ec16 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/security/auth_context.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/security/auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/security/auth_context.h>
+
#include <iterator>
#include <vector>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/serialization_traits.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/serialization_traits.h
index 8f792232..3148dffc 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/serialization_traits.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/serialization_traits.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
+// IWYU pragma: private, include <grpcpp/impl/serialization_traits.h>
+
namespace grpc {
/// Defines how to serialize and deserialize some type.
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback.h
index 3ccabdbb..d292e7b0 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
+// IWYU pragma: private, include <grpcpp/support/server_callback.h>
+
#include <atomic>
#include <functional>
#include <type_traits>
@@ -158,8 +160,7 @@ class ServerCallbackCall {
};
template <class Request, class Response>
-class DefaultMessageHolder
- : public ::grpc::experimental::MessageHolder<Request, Response> {
+class DefaultMessageHolder : public MessageHolder<Request, Response> {
public:
DefaultMessageHolder() {
this->set_request(&request_obj_);
@@ -192,7 +193,7 @@ class ServerBidiReactor;
class ServerCallbackUnary : public internal::ServerCallbackCall {
public:
~ServerCallbackUnary() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
protected:
@@ -208,7 +209,7 @@ template <class Request>
class ServerCallbackReader : public internal::ServerCallbackCall {
public:
~ServerCallbackReader() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
virtual void Read(Request* msg) = 0;
@@ -223,11 +224,11 @@ class ServerCallbackWriter : public internal::ServerCallbackCall {
public:
~ServerCallbackWriter() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
- virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0;
- virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options,
- ::grpc::Status s) = 0;
+ virtual void Write(const Response* msg, grpc::WriteOptions options) = 0;
+ virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options,
+ grpc::Status s) = 0;
protected:
void BindReactor(ServerWriteReactor<Response>* reactor) {
@@ -240,12 +241,12 @@ class ServerCallbackReaderWriter : public internal::ServerCallbackCall {
public:
~ServerCallbackReaderWriter() override {}
- virtual void Finish(::grpc::Status s) = 0;
+ virtual void Finish(grpc::Status s) = 0;
virtual void SendInitialMetadata() = 0;
virtual void Read(Request* msg) = 0;
- virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0;
- virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options,
- ::grpc::Status s) = 0;
+ virtual void Write(const Response* msg, grpc::WriteOptions options) = 0;
+ virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options,
+ grpc::Status s) = 0;
protected:
void BindReactor(ServerBidiReactor<Request, Response>* reactor) {
@@ -317,7 +318,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
void StartWrite(const Response* resp) {
- StartWrite(resp, ::grpc::WriteOptions());
+ StartWrite(resp, grpc::WriteOptions());
}
/// Initiate a write operation with specified options.
@@ -326,7 +327,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWrite(const Response* resp, ::grpc::WriteOptions options)
+ void StartWrite(const Response* resp, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
@@ -355,8 +356,8 @@ class ServerBidiReactor : public internal::ServerReactor {
/// not deleted or modified until OnDone is called.
/// \param[in] options The WriteOptions to use for writing this message
/// \param[in] s The status outcome of this RPC
- void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
+ void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options,
+ grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
if (stream == nullptr) {
@@ -381,7 +382,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// ownership but the caller must ensure that the message is
/// not deleted or modified until OnWriteDone is called.
/// \param[in] options The WriteOptions to use for writing this message
- void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Response* resp, grpc::WriteOptions options) {
StartWrite(resp, options.set_last_message());
}
@@ -391,7 +392,7 @@ class ServerBidiReactor : public internal::ServerReactor {
/// cancelled.
///
/// \param[in] s The status outcome of this RPC
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(stream_mu_) {
ServerCallbackReaderWriter<Request, Response>* stream =
stream_.load(std::memory_order_acquire);
if (stream == nullptr) {
@@ -480,8 +481,8 @@ class ServerBidiReactor : public internal::ServerReactor {
bool finish_wanted = false;
Request* read_wanted = nullptr;
const Response* write_wanted = nullptr;
- ::grpc::WriteOptions write_options_wanted;
- ::grpc::Status status_wanted;
+ grpc::WriteOptions write_options_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(stream_mu_);
};
@@ -520,7 +521,7 @@ class ServerReadReactor : public internal::ServerReactor {
}
reader->Read(req);
}
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(reader_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(reader_mu_) {
ServerCallbackReader<Request>* reader =
reader_.load(std::memory_order_acquire);
if (reader == nullptr) {
@@ -569,7 +570,7 @@ class ServerReadReactor : public internal::ServerReactor {
bool send_initial_metadata_wanted = false;
bool finish_wanted = false;
Request* read_wanted = nullptr;
- ::grpc::Status status_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(reader_mu_);
};
@@ -596,9 +597,9 @@ class ServerWriteReactor : public internal::ServerReactor {
writer->SendInitialMetadata();
}
void StartWrite(const Response* resp) {
- StartWrite(resp, ::grpc::WriteOptions());
+ StartWrite(resp, grpc::WriteOptions());
}
- void StartWrite(const Response* resp, ::grpc::WriteOptions options)
+ void StartWrite(const Response* resp, grpc::WriteOptions options)
ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
@@ -613,8 +614,8 @@ class ServerWriteReactor : public internal::ServerReactor {
}
writer->Write(resp, options);
}
- void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
+ void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options,
+ grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
if (writer == nullptr) {
@@ -630,10 +631,10 @@ class ServerWriteReactor : public internal::ServerReactor {
}
writer->WriteAndFinish(resp, options, std::move(s));
}
- void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) {
+ void StartWriteLast(const Response* resp, grpc::WriteOptions options) {
StartWrite(resp, options.set_last_message());
}
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(writer_mu_) {
ServerCallbackWriter<Response>* writer =
writer_.load(std::memory_order_acquire);
if (writer == nullptr) {
@@ -689,8 +690,8 @@ class ServerWriteReactor : public internal::ServerReactor {
bool write_and_finish_wanted = false;
bool finish_wanted = false;
const Response* write_wanted = nullptr;
- ::grpc::WriteOptions write_options_wanted;
- ::grpc::Status status_wanted;
+ grpc::WriteOptions write_options_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(writer_mu_);
};
@@ -716,7 +717,7 @@ class ServerUnaryReactor : public internal::ServerReactor {
/// Finish is similar to ServerBidiReactor except for one detail.
/// If the status is non-OK, any message will not be sent. Instead,
/// the client will only receive the status and any trailing metadata.
- void Finish(::grpc::Status s) ABSL_LOCKS_EXCLUDED(call_mu_) {
+ void Finish(grpc::Status s) ABSL_LOCKS_EXCLUDED(call_mu_) {
ServerCallbackUnary* call = call_.load(std::memory_order_acquire);
if (call == nullptr) {
grpc::internal::MutexLock l(&call_mu_);
@@ -758,7 +759,7 @@ class ServerUnaryReactor : public internal::ServerReactor {
struct PreBindBacklog {
bool send_initial_metadata_wanted = false;
bool finish_wanted = false;
- ::grpc::Status status_wanted;
+ grpc::Status status_wanted;
};
PreBindBacklog backlog_ ABSL_GUARDED_BY(call_mu_);
};
@@ -768,7 +769,7 @@ namespace internal {
template <class Base>
class FinishOnlyReactor : public Base {
public:
- explicit FinishOnlyReactor(::grpc::Status s) { this->Finish(std::move(s)); }
+ explicit FinishOnlyReactor(grpc::Status s) { this->Finish(std::move(s)); }
void OnDone() override { this->~FinishOnlyReactor(); }
};
@@ -784,20 +785,13 @@ using UnimplementedBidiReactor =
} // namespace internal
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
+// TODO(vjpai): Remove namespace experimental when last known users are migrated
+// off.
namespace experimental {
-template <class Request>
-using ServerReadReactor = ::grpc::ServerReadReactor<Request>;
-
-template <class Response>
-using ServerWriteReactor = ::grpc::ServerWriteReactor<Response>;
-
template <class Request, class Response>
using ServerBidiReactor = ::grpc::ServerBidiReactor<Request, Response>;
-using ServerUnaryReactor = ::grpc::ServerUnaryReactor;
-
} // namespace experimental
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback_handlers.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback_handlers.h
index 76e655a9..eac524f6 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback_handlers.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_callback_handlers.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
@@ -28,49 +30,48 @@ namespace grpc {
namespace internal {
template <class RequestType, class ResponseType>
-class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
+class CallbackUnaryHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackUnaryHandler(
- std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*,
+ std::function<ServerUnaryReactor*(grpc::CallbackServerContext*,
const RequestType*, ResponseType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void SetMessageAllocator(
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator) {
+ MessageAllocator<RequestType, ResponseType>* allocator) {
allocator_ = allocator;
}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a controller structure (that includes request/response)
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* allocator_state = static_cast<
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*>(
- param.internal_data);
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ auto* allocator_state =
+ static_cast<MessageHolder<RequestType, ResponseType>*>(
+ param.internal_data);
- auto* call = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* call = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackUnaryImpl)))
ServerCallbackUnaryImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, allocator_state, param.call_requester);
param.server_context->BeginCompletionOp(
param.call, [call](bool) { call->MaybeDone(); }, call);
ServerUnaryReactor* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<ServerUnaryReactor>(
+ reactor = grpc::internal::CatchingReactorGetter<ServerUnaryReactor>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
call->request(), call->response());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedUnaryReactor)))
UnimplementedUnaryReactor(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
/// Invoke SetupReactor as the last part of the handler
@@ -78,43 +79,39 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** handler_data) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** handler_data) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
RequestType* request = nullptr;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state = nullptr;
+ MessageHolder<RequestType, ResponseType>* allocator_state;
if (allocator_ != nullptr) {
allocator_state = allocator_->AllocateMessages();
} else {
allocator_state =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
call, sizeof(DefaultMessageHolder<RequestType, ResponseType>)))
DefaultMessageHolder<RequestType, ResponseType>();
}
*handler_data = allocator_state;
request = allocator_state->request();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
}
- // Clean up on deserialization failure.
- allocator_state->Release();
return nullptr;
}
private:
- std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*,
+ std::function<ServerUnaryReactor*(grpc::CallbackServerContext*,
const RequestType*, ResponseType*)>
get_reactor_;
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator_ = nullptr;
+ MessageAllocator<RequestType, ResponseType>* allocator_ = nullptr;
class ServerCallbackUnaryImpl : public ServerCallbackUnary {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A callback that only contains a call to MaybeDone can be run as an
// inline callback regardless of whether or not OnDone is inlineable
// because if the actual OnDone callback needs to be scheduled, MaybeDone
@@ -180,9 +177,8 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
friend class CallbackUnaryHandler<RequestType, ResponseType>;
ServerCallbackUnaryImpl(
- ::grpc::CallbackServerContext* ctx, ::grpc::internal::Call* call,
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state,
+ grpc::CallbackServerContext* ctx, grpc::internal::Call* call,
+ MessageHolder<RequestType, ResponseType>* allocator_state,
std::function<void()> call_requester)
: ctx_(ctx),
call_(*call),
@@ -214,7 +210,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackUnaryImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -222,19 +218,18 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>* const
- allocator_state_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
+ MessageHolder<RequestType, ResponseType>* const allocator_state_;
std::function<void()> call_requester_;
// reactor_ can always be loaded/stored with relaxed memory ordering because
// its value is only set once, independently of other data in the object,
@@ -254,21 +249,21 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
+class CallbackClientStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackClientStreamingHandler(
std::function<ServerReadReactor<RequestType>*(
- ::grpc::CallbackServerContext*, ResponseType*)>
+ grpc::CallbackServerContext*, ResponseType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a reader structure (that includes response)
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* reader = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* reader = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackReaderImpl)))
ServerCallbackReaderImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
// is no read reactor that has an inlineable OnDone; this only applies to
@@ -280,32 +275,32 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
ServerReadReactor<RequestType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
- ServerReadReactor<RequestType>>(
- get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
- reader->response());
+ reactor =
+ grpc::internal::CatchingReactorGetter<ServerReadReactor<RequestType>>(
+ get_reactor_,
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
+ reader->response());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedReadReactor<RequestType>)))
UnimplementedReadReactor<RequestType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
reader->SetupReactor(reactor);
}
private:
- std::function<ServerReadReactor<RequestType>*(::grpc::CallbackServerContext*,
+ std::function<ServerReadReactor<RequestType>*(grpc::CallbackServerContext*,
ResponseType*)>
get_reactor_;
class ServerCallbackReaderImpl : public ServerCallbackReader<RequestType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -371,8 +366,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackClientStreamingHandler<RequestType, ResponseType>;
- ServerCallbackReaderImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
+ ServerCallbackReaderImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call,
std::function<void()> call_requester)
: ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {}
@@ -384,6 +379,9 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
@@ -409,7 +407,7 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -417,21 +415,20 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<RequestType>>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>>
read_ops_;
- ::grpc::internal::CallbackWithSuccessTag read_tag_;
+ grpc::internal::CallbackWithSuccessTag read_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
ResponseType resp_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
@@ -443,21 +440,21 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
+class CallbackServerStreamingHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackServerStreamingHandler(
std::function<ServerWriteReactor<ResponseType>*(
- ::grpc::CallbackServerContext*, const RequestType*)>
+ grpc::CallbackServerContext*, const RequestType*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a writer structure
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* writer = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* writer = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackWriterImpl)))
ServerCallbackWriterImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, static_cast<RequestType*>(param.request),
param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
@@ -470,32 +467,31 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
ServerWriteReactor<ResponseType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
+ reactor = grpc::internal::CatchingReactorGetter<
ServerWriteReactor<ResponseType>>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
writer->request());
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(UnimplementedWriteReactor<ResponseType>)))
UnimplementedWriteReactor<ResponseType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
writer->SetupReactor(reactor);
}
void* Deserialize(grpc_call* call, grpc_byte_buffer* req,
- ::grpc::Status* status, void** /*handler_data*/) final {
- ::grpc::ByteBuffer buf;
+ grpc::Status* status, void** /*handler_data*/) final {
+ grpc::ByteBuffer buf;
buf.set_buffer(req);
- auto* request =
- new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
- call, sizeof(RequestType))) RequestType();
+ auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ call, sizeof(RequestType))) RequestType();
*status =
- ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
+ grpc::SerializationTraits<RequestType>::Deserialize(&buf, request);
buf.Release();
if (status->ok()) {
return request;
@@ -505,13 +501,13 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
}
private:
- std::function<ServerWriteReactor<ResponseType>*(
- ::grpc::CallbackServerContext*, const RequestType*)>
+ std::function<ServerWriteReactor<ResponseType>*(grpc::CallbackServerContext*,
+ const RequestType*)>
get_reactor_;
class ServerCallbackWriterImpl : public ServerCallbackWriter<ResponseType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -563,8 +559,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&meta_ops_);
}
- void Write(const ResponseType* resp,
- ::grpc::WriteOptions options) override {
+ void Write(const ResponseType* resp, grpc::WriteOptions options) override {
this->Ref();
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -582,8 +577,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&write_ops_);
}
- void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) override {
+ void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options,
+ grpc::Status s) override {
// This combines the write into the finish callback
// TODO(vjpai): don't assert
GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok());
@@ -593,9 +588,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackServerStreamingHandler<RequestType, ResponseType>;
- ServerCallbackWriterImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
- const RequestType* req,
+ ServerCallbackWriterImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call, const RequestType* req,
std::function<void()> call_requester)
: ctx_(ctx),
call_(*call),
@@ -638,7 +632,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackWriterImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -646,21 +640,21 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
write_ops_;
- ::grpc::internal::CallbackWithSuccessTag write_tag_;
+ grpc::internal::CallbackWithSuccessTag write_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
const RequestType* req_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
@@ -672,20 +666,20 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler {
};
template <class RequestType, class ResponseType>
-class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
+class CallbackBidiHandler : public grpc::internal::MethodHandler {
public:
explicit CallbackBidiHandler(
std::function<ServerBidiReactor<RequestType, ResponseType>*(
- ::grpc::CallbackServerContext*)>
+ grpc::CallbackServerContext*)>
get_reactor)
: get_reactor_(std::move(get_reactor)) {}
void RunHandler(const HandlerParameter& param) final {
- ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
+ grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* stream = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ auto* stream = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackReaderWriterImpl)))
ServerCallbackReaderWriterImpl(
- static_cast<::grpc::CallbackServerContext*>(param.server_context),
+ static_cast<grpc::CallbackServerContext*>(param.server_context),
param.call, param.call_requester);
// Inlineable OnDone can be false in the CompletionOp callback because there
// is no bidi reactor that has an inlineable OnDone; this only applies to
@@ -697,19 +691,19 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
ServerBidiReactor<RequestType, ResponseType>* reactor = nullptr;
if (param.status.ok()) {
- reactor = ::grpc::internal::CatchingReactorGetter<
+ reactor = grpc::internal::CatchingReactorGetter<
ServerBidiReactor<RequestType, ResponseType>>(
get_reactor_,
- static_cast<::grpc::CallbackServerContext*>(param.server_context));
+ static_cast<grpc::CallbackServerContext*>(param.server_context));
}
if (reactor == nullptr) {
// if deserialization or reactor creator failed, we need to fail the call
- reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
+ reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(),
sizeof(UnimplementedBidiReactor<RequestType, ResponseType>)))
UnimplementedBidiReactor<RequestType, ResponseType>(
- ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""));
+ grpc::Status(grpc::StatusCode::UNIMPLEMENTED, ""));
}
stream->SetupReactor(reactor);
@@ -717,13 +711,13 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
private:
std::function<ServerBidiReactor<RequestType, ResponseType>*(
- ::grpc::CallbackServerContext*)>
+ grpc::CallbackServerContext*)>
get_reactor_;
class ServerCallbackReaderWriterImpl
: public ServerCallbackReaderWriter<RequestType, ResponseType> {
public:
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
// A finish tag with only MaybeDone can have its callback inlined
// regardless even if OnDone is not inlineable because this callback just
// checks a ref and then decides whether or not to dispatch OnDone.
@@ -775,8 +769,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&meta_ops_);
}
- void Write(const ResponseType* resp,
- ::grpc::WriteOptions options) override {
+ void Write(const ResponseType* resp, grpc::WriteOptions options) override {
this->Ref();
if (options.is_last_message()) {
options.set_buffer_hint();
@@ -794,8 +787,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
call_.PerformOps(&write_ops_);
}
- void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options,
- ::grpc::Status s) override {
+ void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options,
+ grpc::Status s) override {
// TODO(vjpai): don't assert
GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok());
Finish(std::move(s));
@@ -810,8 +803,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
private:
friend class CallbackBidiHandler<RequestType, ResponseType>;
- ServerCallbackReaderWriterImpl(::grpc::CallbackServerContext* ctx,
- ::grpc::internal::Call* call,
+ ServerCallbackReaderWriterImpl(grpc::CallbackServerContext* ctx,
+ grpc::internal::Call* call,
std::function<void()> call_requester)
: ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {}
@@ -831,6 +824,9 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
@@ -852,7 +848,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
ctx_->context_allocator()->Release(ctx_);
}
this->~ServerCallbackReaderWriterImpl(); // explicitly call destructor
- ::grpc::g_core_codegen_interface->grpc_call_unref(call);
+ grpc::g_core_codegen_interface->grpc_call_unref(call);
call_requester();
}
@@ -860,25 +856,24 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
return reactor_.load(std::memory_order_relaxed);
}
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata>
meta_ops_;
- ::grpc::internal::CallbackWithSuccessTag meta_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpServerSendStatus>
+ grpc::internal::CallbackWithSuccessTag meta_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpServerSendStatus>
finish_ops_;
- ::grpc::internal::CallbackWithSuccessTag finish_tag_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallbackWithSuccessTag finish_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
write_ops_;
- ::grpc::internal::CallbackWithSuccessTag write_tag_;
- ::grpc::internal::CallOpSet<
- ::grpc::internal::CallOpRecvMessage<RequestType>>
+ grpc::internal::CallbackWithSuccessTag write_tag_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>>
read_ops_;
- ::grpc::internal::CallbackWithSuccessTag read_tag_;
+ grpc::internal::CallbackWithSuccessTag read_tag_;
- ::grpc::CallbackServerContext* const ctx_;
- ::grpc::internal::Call call_;
+ grpc::CallbackServerContext* const ctx_;
+ grpc::internal::Call call_;
std::function<void()> call_requester_;
// The memory ordering of reactor_ follows ServerCallbackUnaryImpl.
std::atomic<ServerBidiReactor<RequestType, ResponseType>*> reactor_;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_context.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_context.h
index cbbd2291..30da8a1e 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_context.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_context.h
@@ -19,6 +19,10 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/server_context.h>
+
+#include <grpc/impl/codegen/port_platform.h>
+
#include <atomic>
#include <cassert>
#include <map>
@@ -26,8 +30,6 @@
#include <type_traits>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/impl/codegen/compression_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
@@ -63,6 +65,8 @@ class ServerReader;
template <class W>
class ServerWriter;
+extern CoreCodegenInterface* g_core_codegen_interface;
+
namespace internal {
template <class ServiceType, class RequestType, class ResponseType>
class BidiStreamingHandler;
@@ -91,7 +95,7 @@ class ServerStreamingHandler;
class ServerReactor;
template <class Streamer, bool WriteNeeded>
class TemplatedBidiStreamingHandler;
-template <::grpc::StatusCode code>
+template <grpc::StatusCode code>
class ErrorMethodHandler;
} // namespace internal
@@ -101,22 +105,8 @@ class GenericServerContext;
class Server;
class ServerInterface;
class ContextAllocator;
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-typedef ::grpc::ServerContextBase ServerContextBase;
-typedef ::grpc::CallbackServerContext CallbackServerContext;
-
-} // namespace experimental
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class GenericCallbackServerContext;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
+
namespace internal {
class Call;
} // namespace internal
@@ -127,14 +117,14 @@ class ServerContextTestSpouse;
class DefaultReactorTestPeer;
} // namespace testing
-/// Base class of ServerContext. Experimental until callback API is final.
+/// Base class of ServerContext.
class ServerContextBase {
public:
virtual ~ServerContextBase();
/// Return the deadline for the server call.
std::chrono::system_clock::time_point deadline() const {
- return ::grpc::Timespec2Timepoint(deadline_);
+ return grpc::Timespec2Timepoint(deadline_);
}
/// Return a \a gpr_timespec representation of the server call's deadline.
@@ -154,11 +144,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddInitialMetadata(const std::string& key, const std::string& value);
/// Add the (\a key, \a value) pair to the initial metadata
@@ -175,11 +169,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddTrailingMetadata(const std::string& key, const std::string& value);
/// Return whether this RPC failed before the server could provide its status
@@ -265,9 +263,9 @@ class ServerContextBase {
/// Return the authentication context for this server call.
///
/// \see grpc::AuthContext.
- std::shared_ptr<const ::grpc::AuthContext> auth_context() const {
+ std::shared_ptr<const grpc::AuthContext> auth_context() const {
if (auth_context_ == nullptr) {
- auth_context_ = ::grpc::CreateAuthContext(call_.call);
+ auth_context_ = grpc::CreateAuthContext(call_.call);
}
return auth_context_;
}
@@ -299,10 +297,7 @@ class ServerContextBase {
/// NOTE: This is an API for advanced users who need custom allocators.
/// Get and maybe mutate the allocator state associated with the current RPC.
/// Currently only applicable for callback unary RPC methods.
- /// WARNING: This is experimental API and could be changed or removed.
- ::grpc::experimental::RpcAllocatorState* GetRpcAllocatorState() {
- return message_allocator_state_;
- }
+ RpcAllocatorState* GetRpcAllocatorState() { return message_allocator_state_; }
/// Get a library-owned default unary reactor for use in minimal reaction
/// cases. This supports typical unary RPC usage of providing a response and
@@ -318,9 +313,7 @@ class ServerContextBase {
///
/// This method should not be called more than once or called after return
/// from the method handler.
- ///
- /// WARNING: This is experimental API and could be changed or removed.
- ::grpc::ServerUnaryReactor* DefaultReactor() {
+ grpc::ServerUnaryReactor* DefaultReactor() {
// Short-circuit the case where a default reactor was already set up by
// the TestPeer.
if (test_unary_ != nullptr) {
@@ -348,57 +341,53 @@ class ServerContextBase {
ContextAllocator* context_allocator() const { return context_allocator_; }
private:
- friend class ::grpc::testing::InteropServerContextInspector;
- friend class ::grpc::testing::ServerContextTestSpouse;
- friend class ::grpc::testing::DefaultReactorTestPeer;
- friend class ::grpc::ServerInterface;
- friend class ::grpc::Server;
+ friend class grpc::testing::InteropServerContextInspector;
+ friend class grpc::testing::ServerContextTestSpouse;
+ friend class grpc::testing::DefaultReactorTestPeer;
+ friend class grpc::ServerInterface;
+ friend class grpc::Server;
template <class W, class R>
- friend class ::grpc::ServerAsyncReader;
+ friend class grpc::ServerAsyncReader;
template <class W>
- friend class ::grpc::ServerAsyncWriter;
+ friend class grpc::ServerAsyncWriter;
template <class W>
- friend class ::grpc::ServerAsyncResponseWriter;
+ friend class grpc::ServerAsyncResponseWriter;
template <class W, class R>
- friend class ::grpc::ServerAsyncReaderWriter;
+ friend class grpc::ServerAsyncReaderWriter;
template <class R>
- friend class ::grpc::ServerReader;
+ friend class grpc::ServerReader;
template <class W>
- friend class ::grpc::ServerWriter;
+ friend class grpc::ServerWriter;
template <class W, class R>
- friend class ::grpc::internal::ServerReaderWriterBody;
+ friend class grpc::internal::ServerReaderWriterBody;
template <class ResponseType>
- friend void ::grpc::internal::UnaryRunHandlerHelper(
+ friend void grpc::internal::UnaryRunHandlerHelper(
const internal::MethodHandler::HandlerParameter& param, ResponseType* rsp,
Status& status);
template <class ServiceType, class RequestType, class ResponseType,
class BaseRequestType, class BaseResponseType>
- friend class ::grpc::internal::RpcMethodHandler;
+ friend class grpc::internal::RpcMethodHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ClientStreamingHandler;
+ friend class grpc::internal::ClientStreamingHandler;
template <class ServiceType, class RequestType, class ResponseType>
- friend class ::grpc::internal::ServerStreamingHandler;
+ friend class grpc::internal::ServerStreamingHandler;
template <class Streamer, bool WriteNeeded>
- friend class ::grpc::internal::TemplatedBidiStreamingHandler;
+ friend class grpc::internal::TemplatedBidiStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackUnaryHandler;
+ friend class grpc::internal::CallbackUnaryHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackClientStreamingHandler;
+ friend class grpc::internal::CallbackClientStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackServerStreamingHandler;
+ friend class grpc::internal::CallbackServerStreamingHandler;
template <class RequestType, class ResponseType>
- friend class ::grpc::internal::CallbackBidiHandler;
- template <::grpc::StatusCode code>
- friend class ::grpc::internal::ErrorMethodHandler;
+ friend class grpc::internal::CallbackBidiHandler;
+ template <grpc::StatusCode code>
+ friend class grpc::internal::ErrorMethodHandler;
template <class Base>
- friend class ::grpc::internal::FinishOnlyReactor;
- friend class ::grpc::ClientContext;
- friend class ::grpc::GenericServerContext;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
- friend class ::grpc::GenericCallbackServerContext;
-#else
- friend class ::grpc::experimental::GenericCallbackServerContext;
-#endif
+ friend class grpc::internal::FinishOnlyReactor;
+ friend class grpc::ClientContext;
+ friend class grpc::GenericServerContext;
+ friend class grpc::GenericCallbackServerContext;
/// Prevent copying.
ServerContextBase(const ServerContextBase&);
@@ -407,10 +396,10 @@ class ServerContextBase {
class CompletionOp;
void BeginCompletionOp(
- ::grpc::internal::Call* call, std::function<void(bool)> callback,
- ::grpc::internal::ServerCallbackCall* callback_controller);
+ grpc::internal::Call* call, std::function<void(bool)> callback,
+ grpc::internal::ServerCallbackCall* callback_controller);
/// Return the tag queued by BeginCompletionOp()
- ::grpc::internal::CompletionQueueTag* GetCompletionOpTag();
+ grpc::internal::CompletionQueueTag* GetCompletionOpTag();
void set_call(grpc_call* call) { call_.call = call; }
@@ -418,22 +407,28 @@ class ServerContextBase {
uint32_t initial_metadata_flags() const { return 0; }
- ::grpc::experimental::ServerRpcInfo* set_server_rpc_info(
- const char* method, ::grpc::internal::RpcMethod::RpcType type,
+ grpc::experimental::ServerRpcInfo* set_server_rpc_info(
+ const char* method, grpc::internal::RpcMethod::RpcType type,
const std::vector<std::unique_ptr<
- ::grpc::experimental::ServerInterceptorFactoryInterface>>& creators) {
+ grpc::experimental::ServerInterceptorFactoryInterface>>& creators) {
if (!creators.empty()) {
- rpc_info_ = new ::grpc::experimental::ServerRpcInfo(this, method, type);
+ rpc_info_ = new grpc::experimental::ServerRpcInfo(this, method, type);
rpc_info_->RegisterInterceptors(creators);
}
return rpc_info_;
}
- void set_message_allocator_state(
- ::grpc::experimental::RpcAllocatorState* allocator_state) {
+ void set_message_allocator_state(RpcAllocatorState* allocator_state) {
message_allocator_state_ = allocator_state;
}
+ void MaybeMarkCancelledOnRead() {
+ if (g_core_codegen_interface->grpc_call_failed_before_recv_message(
+ call_.call)) {
+ marked_cancelled_.store(true, std::memory_order_release);
+ }
+ }
+
struct CallWrapper {
~CallWrapper();
@@ -449,13 +444,13 @@ class ServerContextBase {
CompletionOp* completion_op_ = nullptr;
bool has_notify_when_done_tag_ = false;
void* async_notify_when_done_tag_ = nullptr;
- ::grpc::internal::CallbackWithSuccessTag completion_tag_;
+ grpc::internal::CallbackWithSuccessTag completion_tag_;
gpr_timespec deadline_;
- ::grpc::CompletionQueue* cq_ = nullptr;
+ grpc::CompletionQueue* cq_ = nullptr;
bool sent_initial_metadata_ = false;
- mutable std::shared_ptr<const ::grpc::AuthContext> auth_context_;
- mutable ::grpc::internal::MetadataMap client_metadata_;
+ mutable std::shared_ptr<const grpc::AuthContext> auth_context_;
+ mutable grpc::internal::MetadataMap client_metadata_;
std::multimap<std::string, std::string> initial_metadata_;
std::multimap<std::string, std::string> trailing_metadata_;
@@ -463,16 +458,16 @@ class ServerContextBase {
grpc_compression_level compression_level_;
grpc_compression_algorithm compression_algorithm_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage>
pending_ops_;
bool has_pending_ops_ = false;
- ::grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
- ::grpc::experimental::RpcAllocatorState* message_allocator_state_ = nullptr;
+ grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
+ RpcAllocatorState* message_allocator_state_ = nullptr;
ContextAllocator* context_allocator_ = nullptr;
- class Reactor : public ::grpc::ServerUnaryReactor {
+ class Reactor : public grpc::ServerUnaryReactor {
public:
void OnCancel() override {}
void OnDone() override {}
@@ -483,23 +478,23 @@ class ServerContextBase {
bool InternalInlineable() override { return true; }
};
- void SetupTestDefaultReactor(std::function<void(::grpc::Status)> func) {
+ void SetupTestDefaultReactor(std::function<void(grpc::Status)> func) {
// NOLINTNEXTLINE(modernize-make-unique)
test_unary_.reset(new TestServerCallbackUnary(this, std::move(func)));
}
bool test_status_set() const {
return (test_unary_ != nullptr) && test_unary_->status_set();
}
- ::grpc::Status test_status() const { return test_unary_->status(); }
+ grpc::Status test_status() const { return test_unary_->status(); }
- class TestServerCallbackUnary : public ::grpc::ServerCallbackUnary {
+ class TestServerCallbackUnary : public grpc::ServerCallbackUnary {
public:
TestServerCallbackUnary(ServerContextBase* ctx,
- std::function<void(::grpc::Status)> func)
+ std::function<void(grpc::Status)> func)
: reactor_(ctx->DefaultReactor()), func_(std::move(func)) {
this->BindReactor(reactor_);
}
- void Finish(::grpc::Status s) override {
+ void Finish(grpc::Status s) override {
status_ = s;
func_(std::move(s));
status_set_.store(true, std::memory_order_release);
@@ -509,21 +504,24 @@ class ServerContextBase {
bool status_set() const {
return status_set_.load(std::memory_order_acquire);
}
- ::grpc::Status status() const { return status_; }
+ grpc::Status status() const { return status_; }
private:
void CallOnDone() override {}
- ::grpc::internal::ServerReactor* reactor() override { return reactor_; }
+ grpc::internal::ServerReactor* reactor() override { return reactor_; }
- ::grpc::ServerUnaryReactor* const reactor_;
+ grpc::ServerUnaryReactor* const reactor_;
std::atomic_bool status_set_{false};
- ::grpc::Status status_;
- const std::function<void(::grpc::Status s)> func_;
+ grpc::Status status_;
+ const std::function<void(grpc::Status s)> func_;
};
typename std::aligned_storage<sizeof(Reactor), alignof(Reactor)>::type
default_reactor_;
std::atomic_bool default_reactor_used_{false};
+
+ std::atomic_bool marked_cancelled_{false};
+
std::unique_ptr<TestServerCallbackUnary> test_unary_;
};
@@ -570,7 +568,7 @@ class ServerContext : public ServerContextBase {
private:
// Constructor for internal use by server only
- friend class ::grpc::Server;
+ friend class grpc::Server;
ServerContext(gpr_timespec deadline, grpc_metadata_array* arr)
: ServerContextBase(deadline, arr) {}
@@ -633,39 +631,27 @@ class ContextAllocator {
virtual CallbackServerContext* NewCallbackServerContext() { return nullptr; }
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual experimental::GenericCallbackServerContext*
- NewGenericCallbackServerContext() {
- return nullptr;
- }
-#else
virtual GenericCallbackServerContext* NewGenericCallbackServerContext() {
return nullptr;
}
-#endif
virtual void Release(CallbackServerContext*) {}
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual void Release(experimental::GenericCallbackServerContext*) {}
-#else
virtual void Release(GenericCallbackServerContext*) {}
-#endif
};
} // namespace grpc
static_assert(
- std::is_base_of<::grpc::ServerContextBase, ::grpc::ServerContext>::value,
+ std::is_base_of<grpc::ServerContextBase, grpc::ServerContext>::value,
"improper base class");
-static_assert(std::is_base_of<::grpc::ServerContextBase,
- ::grpc::CallbackServerContext>::value,
+static_assert(std::is_base_of<grpc::ServerContextBase,
+ grpc::CallbackServerContext>::value,
"improper base class");
-static_assert(sizeof(::grpc::ServerContextBase) ==
- sizeof(::grpc::ServerContext),
+static_assert(sizeof(grpc::ServerContextBase) == sizeof(grpc::ServerContext),
"wrong size");
-static_assert(sizeof(::grpc::ServerContextBase) ==
- sizeof(::grpc::CallbackServerContext),
+static_assert(sizeof(grpc::ServerContextBase) ==
+ sizeof(grpc::CallbackServerContext),
"wrong size");
#endif // GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interceptor.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interceptor.h
index 7598e72a..3a8fd52a 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/server_interceptor.h>
+
#include <atomic>
#include <vector>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interface.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interface.h
index a44ab1fa..0deac825 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interface.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/server_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -50,13 +52,7 @@ namespace internal {
class ServerAsyncStreamingInterface;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
class ServerInterceptorFactoryInterface;
@@ -120,7 +116,7 @@ class ServerInterface : public internal::CallHook {
virtual void Wait() = 0;
protected:
- friend class ::grpc::Service;
+ friend class grpc::Service;
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the Server instance.
@@ -130,35 +126,12 @@ class ServerInterface : public internal::CallHook {
/// service. The service must exist for the lifetime of the Server instance.
virtual void RegisterAsyncGenericService(AsyncGenericService* service) = 0;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback generic service. This call does not take ownership of
/// the service. The service must exist for the lifetime of the Server
/// instance. May not be abstract since this is a post-1.0 API addition.
virtual void RegisterCallbackGenericService(CallbackGenericService*
/*service*/) {}
-#else
- /// NOTE: class experimental_registration_interface is not part of the public
- /// API of this class
- /// TODO(vjpai): Move these contents to public API when no longer experimental
- class experimental_registration_interface {
- public:
- virtual ~experimental_registration_interface() {}
- /// May not be abstract since this is a post-1.0 API addition
- virtual void RegisterCallbackGenericService(
- experimental::CallbackGenericService* /*service*/) {}
- virtual void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> context_allocator) {}
- };
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time. May not be abstract since this is a
- /// post-1.0 API addition
- virtual experimental_registration_interface* experimental_registration() {
- return nullptr;
- }
-#endif
/// Tries to bind \a server to the given \a addr.
///
@@ -180,7 +153,7 @@ class ServerInterface : public internal::CallHook {
/// caller is required to keep all completion queues live until the server is
/// destroyed.
/// \param num_cqs How many completion queues does \a cqs hold.
- virtual void Start(::grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0;
+ virtual void Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0;
virtual void ShutdownInternal(gpr_timespec deadline) = 0;
@@ -193,10 +166,10 @@ class ServerInterface : public internal::CallHook {
class BaseAsyncRequest : public internal::CompletionQueueTag {
public:
- BaseAsyncRequest(ServerInterface* server, ::grpc::ServerContext* context,
+ BaseAsyncRequest(ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
bool delete_on_finalize);
~BaseAsyncRequest() override;
@@ -207,10 +180,10 @@ class ServerInterface : public internal::CallHook {
protected:
ServerInterface* const server_;
- ::grpc::ServerContext* const context_;
+ grpc::ServerContext* const context_;
internal::ServerAsyncStreamingInterface* const stream_;
- ::grpc::CompletionQueue* const call_cq_;
- ::grpc::ServerCompletionQueue* const notification_cq_;
+ grpc::CompletionQueue* const call_cq_;
+ grpc::ServerCompletionQueue* const notification_cq_;
void* const tag_;
const bool delete_on_finalize_;
grpc_call* call_;
@@ -223,10 +196,10 @@ class ServerInterface : public internal::CallHook {
class RegisteredAsyncRequest : public BaseAsyncRequest {
public:
RegisteredAsyncRequest(ServerInterface* server,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag, const char* name,
internal::RpcMethod::RpcType type);
@@ -235,7 +208,7 @@ class ServerInterface : public internal::CallHook {
if (done_intercepting_) {
return BaseAsyncRequest::FinalizeResult(tag, status);
}
- call_wrapper_ = ::grpc::internal::Call(
+ call_wrapper_ = grpc::internal::Call(
call_, server_, call_cq_, server_->max_receive_message_size(),
context_->set_server_rpc_info(name_, type_,
*server_->interceptor_creators()));
@@ -244,7 +217,7 @@ class ServerInterface : public internal::CallHook {
protected:
void IssueRequest(void* registered_method, grpc_byte_buffer** payload,
- ::grpc::ServerCompletionQueue* notification_cq);
+ grpc::ServerCompletionQueue* notification_cq);
const char* name_;
const internal::RpcMethod::RpcType type_;
};
@@ -252,11 +225,10 @@ class ServerInterface : public internal::CallHook {
class NoPayloadAsyncRequest final : public RegisteredAsyncRequest {
public:
NoPayloadAsyncRequest(internal::RpcServiceMethod* registered_method,
- ServerInterface* server,
- ::grpc::ServerContext* context,
+ ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
@@ -271,11 +243,11 @@ class ServerInterface : public internal::CallHook {
class PayloadAsyncRequest final : public RegisteredAsyncRequest {
public:
PayloadAsyncRequest(internal::RpcServiceMethod* registered_method,
- ServerInterface* server, ::grpc::ServerContext* context,
+ ServerInterface* server, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, Message* request)
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ Message* request)
: RegisteredAsyncRequest(
server, context, stream, call_cq, notification_cq, tag,
registered_method->name(), registered_method->method_type()),
@@ -329,9 +301,9 @@ class ServerInterface : public internal::CallHook {
public:
GenericAsyncRequest(ServerInterface* server, GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, bool delete_on_finalize);
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ bool delete_on_finalize);
bool FinalizeResult(void** tag, bool* status) override;
@@ -341,21 +313,21 @@ class ServerInterface : public internal::CallHook {
template <class Message>
void RequestAsyncCall(internal::RpcServiceMethod* method,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
- void* tag, Message* message) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag,
+ Message* message) {
GPR_CODEGEN_ASSERT(method);
new PayloadAsyncRequest<Message>(method, this, context, stream, call_cq,
notification_cq, tag, message);
}
void RequestAsyncCall(internal::RpcServiceMethod* method,
- ::grpc::ServerContext* context,
+ grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
GPR_CODEGEN_ASSERT(method);
new NoPayloadAsyncRequest(method, this, context, stream, call_cq,
@@ -364,8 +336,8 @@ class ServerInterface : public internal::CallHook {
void RequestAsyncGenericCall(GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
new GenericAsyncRequest(this, context, stream, call_cq, notification_cq,
tag, true);
@@ -383,7 +355,6 @@ class ServerInterface : public internal::CallHook {
return nullptr;
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// server. If the return value is nullptr, this server doesn't support
// callback operations.
@@ -391,7 +362,7 @@ class ServerInterface : public internal::CallHook {
// Returns nullptr (rather than being pure) since this is a post-1.0 method
// and adding a new pure method to an interface would be a breaking change
// (even though this is private and non-API)
- virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; }
+ virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; }
};
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/service_type.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/service_type.h
index 57ca9f09..88bcb4a9 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/service_type.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/service_type.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
#define GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
+// IWYU pragma: private, include <grpcpp/impl/service_type.h>
+
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -47,7 +49,7 @@ class ServerAsyncStreamingInterface {
virtual void SendInitialMetadata(void* tag) = 0;
private:
- friend class ::grpc::ServerInterface;
+ friend class grpc::ServerInterface;
virtual void BindCall(Call* call) = 0;
};
} // namespace internal
@@ -99,35 +101,12 @@ class Service {
}
protected:
- // TODO(vjpai): Promote experimental contents once callback API is accepted
- class experimental_type {
- public:
- explicit experimental_type(Service* service) : service_(service) {}
-
- void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return service_->GetHandlerInternal(index);
- }
-
- private:
- Service* service_;
- };
-
- experimental_type experimental() { return experimental_type(this); }
-
template <class Message>
- void RequestAsyncUnary(int index, ::grpc::ServerContext* context,
+ void RequestAsyncUnary(int index, grpc::ServerContext* context,
Message* request,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq,
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq,
void* tag) {
// Typecast the index to size_t for indexing into a vector
// while preserving the API that existed before a compiler
@@ -137,29 +116,29 @@ class Service {
notification_cq, tag, request);
}
void RequestAsyncClientStreaming(
- int index, ::grpc::ServerContext* context,
+ int index, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);
}
template <class Message>
void RequestAsyncServerStreaming(
- int index, ::grpc::ServerContext* context, Message* request,
+ int index, grpc::ServerContext* context, Message* request,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag, request);
}
void RequestAsyncBidiStreaming(
- int index, ::grpc::ServerContext* context,
+ int index, grpc::ServerContext* context,
internal::ServerAsyncStreamingInterface* stream,
- ::grpc::CompletionQueue* call_cq,
- ::grpc::ServerCompletionQueue* notification_cq, void* tag) {
+ grpc::CompletionQueue* call_cq,
+ grpc::ServerCompletionQueue* notification_cq, void* tag) {
size_t idx = static_cast<size_t>(index);
server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq,
notification_cq, tag);
@@ -216,23 +195,7 @@ class Service {
methods_[idx]->SetMethodType(internal::RpcMethod::BIDI_STREAMING);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return GetHandlerInternal(index);
- }
-#endif
- private:
- // TODO(vjpai): migrate the Internal functions to mainline functions once
- // callback API is fully de-experimental
- void MarkMethodCallbackInternal(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -245,8 +208,7 @@ class Service {
internal::RpcServiceMethod::ApiType::CALL_BACK);
}
- void MarkMethodRawCallbackInternal(int index,
- internal::MethodHandler* handler) {
+ void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -259,11 +221,12 @@ class Service {
internal::RpcServiceMethod::ApiType::RAW_CALL_BACK);
}
- internal::MethodHandler* GetHandlerInternal(int index) {
+ internal::MethodHandler* GetHandler(int index) {
size_t idx = static_cast<size_t>(index);
return methods_[idx]->handler();
}
+ private:
friend class Server;
friend class ServerInterface;
ServerInterface* server_;
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/slice.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/slice.h
index ea550259..392986a5 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/slice.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/slice.h
@@ -19,12 +19,13 @@
#ifndef GRPCPP_IMPL_CODEGEN_SLICE_H
#define GRPCPP_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpcpp/support/slice.h>
+
+#include <grpc/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/string_ref.h>
-#include <grpc/impl/codegen/slice.h>
-
namespace grpc {
/// A wrapper around \a grpc_slice.
@@ -74,6 +75,11 @@ class Slice final {
Slice(const Slice& other)
: slice_(g_core_codegen_interface->grpc_slice_ref(other.slice_)) {}
+ /// Move constructor, steals a reference.
+ Slice(Slice&& other) noexcept : slice_(other.slice_) {
+ other.slice_ = g_core_codegen_interface->grpc_empty_slice();
+ }
+
/// Assignment, reference count is unchanged.
Slice& operator=(Slice other) {
std::swap(slice_, other.slice_);
@@ -107,6 +113,12 @@ class Slice final {
/// Raw pointer to the end (one byte \em past the last element) of the slice.
const uint8_t* end() const { return GRPC_SLICE_END_PTR(slice_); }
+ /// Returns a substring of the `slice` as another slice.
+ Slice sub(size_t begin, size_t end) const {
+ return Slice(g_core_codegen_interface->grpc_slice_sub(slice_, begin, end),
+ STEAL_REF);
+ }
+
/// Raw C slice. Caller needs to call grpc_slice_unref when done.
grpc_slice c_slice() const {
return g_core_codegen_interface->grpc_slice_ref(slice_);
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/status.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/status.h
index 9a6cf89b..f5ffc615 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/status.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_H
#define GRPCPP_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpcpp/support/status.h>
+
#include <grpc/impl/codegen/status.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/status_code_enum.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/status_code_enum.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/status_code_enum.h
index bdd7ead6..36ea24fd 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/status_code_enum.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/status_code_enum.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
#define GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
+// IWYU pragma: private, include <grpcpp/support/status_code_enum.h>
+
namespace grpc {
enum StatusCode {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/string_ref.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/string_ref.h
index 4543e426..f71778b5 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/string_ref.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/string_ref.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STRING_REF_H
#define GRPCPP_IMPL_CODEGEN_STRING_REF_H
+// IWYU pragma: private, include <grpcpp/support/string_ref.h>
+
#include <string.h>
#include <algorithm>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/stub_options.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/stub_options.h
index 30509c25..efa1e38e 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/stub_options.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/stub_options.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
#define GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
+// IWYU pragma: private, include <grpcpp/support/stub_options.h>
+
namespace grpc {
/// Useful interface for generated stubs
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/sync.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/sync.h
index 0c4effe4..4cb8133c 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/sync.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/sync.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_H
#define GRPCPP_IMPL_CODEGEN_SYNC_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_HAS_PTHREAD_H
@@ -27,13 +29,12 @@
#include <mutex>
+#include "absl/synchronization/mutex.h"
+
#include <grpc/impl/codegen/log.h>
#include <grpc/impl/codegen/sync.h>
-
#include <grpcpp/impl/codegen/core_codegen_interface.h>
-#include "absl/synchronization/mutex.h"
-
// The core library is not accessible in C++ codegen headers, and vice versa.
// Thus, we need to have duplicate headers with similar functionality.
// Make sure any change to this file is also reflected in
@@ -46,7 +47,7 @@
namespace grpc {
namespace internal {
-#ifdef GRPCPP_ABSEIL_SYNC
+#ifdef GPR_ABSEIL_SYNC
using Mutex = absl::Mutex;
using MutexLock = absl::MutexLock;
@@ -141,9 +142,10 @@ class CondVar {
gpr_cv cv_;
};
-#endif // GRPCPP_ABSEIL_SYNC
+#endif // GPR_ABSEIL_SYNC
template <typename Predicate>
+GRPC_DEPRECATED("incompatible with thread safety analysis")
static void WaitUntil(CondVar* cv, Mutex* mu, Predicate pred) {
while (!pred()) {
cv->Wait(mu);
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/sync_stream.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/sync_stream.h
index 408f42f2..aca60790 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/sync_stream.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/sync_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/sync_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_context.h>
@@ -59,7 +61,7 @@ class ClientStreamingInterface {
/// - \a Status contains the status code, message and details for the call
/// - the \a ClientContext associated with this call is updated with
/// possible trailing metadata sent from the server.
- virtual ::grpc::Status Finish() = 0;
+ virtual grpc::Status Finish() = 0;
};
/// Common interface for all synchronous server side streaming.
@@ -112,7 +114,7 @@ class WriterInterface {
/// \param options The WriteOptions affecting the write operation.
///
/// \return \a true on success, \a false when the stream has been closed.
- virtual bool Write(const W& msg, ::grpc::WriteOptions options) = 0;
+ virtual bool Write(const W& msg, grpc::WriteOptions options) = 0;
/// Block to write \a msg to the stream with default write options.
/// This is thread-safe with respect to \a ReaderInterface::Read
@@ -120,7 +122,7 @@ class WriterInterface {
/// \param msg The message to be written to the stream.
///
/// \return \a true on success, \a false when the stream has been closed.
- inline bool Write(const W& msg) { return Write(msg, ::grpc::WriteOptions()); }
+ inline bool Write(const W& msg) { return Write(msg, grpc::WriteOptions()); }
/// Write \a msg and coalesce it with the writing of trailing metadata, using
/// WriteOptions \a options.
@@ -136,7 +138,7 @@ class WriterInterface {
///
/// \param[in] msg The message to be written to the stream.
/// \param[in] options The WriteOptions to be used to write this message.
- void WriteLast(const W& msg, ::grpc::WriteOptions options) {
+ void WriteLast(const W& msg, grpc::WriteOptions options) {
Write(msg, options.set_last_message());
}
};
@@ -160,9 +162,9 @@ template <class R>
class ClientReaderFactory {
public:
template <class W>
- static ClientReader<R>* Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context,
+ static ClientReader<R>* Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context,
const W& request) {
return new ClientReader<R>(channel, method, context, request);
}
@@ -185,8 +187,7 @@ class ClientReader final : public ClientReaderInterface<R> {
void WaitForInitialMetadata() override {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); /// status ignored
@@ -204,8 +205,8 @@ class ClientReader final : public ClientReaderInterface<R> {
/// already received (if initial metadata is received, it can be then
/// accessed through the \a ClientContext associated with this call).
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
@@ -220,9 +221,14 @@ class ClientReader final : public ClientReaderInterface<R> {
/// Side effect:
/// The \a ClientContext associated with this call is updated with
/// possible metadata received from the server.
- ::grpc::Status Finish() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientRecvStatus> ops;
- ::grpc::Status status;
+ grpc::Status Finish() override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
+ ops;
+ if (!context_->initial_metadata_received_) {
+ ops.RecvInitialMetadata(context_);
+ }
+ grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
GPR_CODEGEN_ASSERT(cq_.Pluck(&ops));
@@ -231,25 +237,25 @@ class ClientReader final : public ClientReaderInterface<R> {
private:
friend class internal::ClientReaderFactory<R>;
- ::grpc::ClientContext* context_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request
/// out. Note that \a context will be used to fill in custom initial
/// metadata used to send to the server when starting the call.
template <class W>
- ClientReader(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, const W& request)
+ ClientReader(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, const W& request)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
@@ -280,9 +286,9 @@ template <class W>
class ClientWriterFactory {
public:
template <class R>
- static ClientWriter<W>* Create(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, R* response) {
+ static ClientWriter<W>* Create(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response) {
return new ClientWriter<W>(channel, method, context, response);
}
};
@@ -303,8 +309,7 @@ class ClientWriter : public ClientWriterInterface<W> {
void WaitForInitialMetadata() {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); // status ignored
@@ -317,10 +322,10 @@ class ClientWriter : public ClientWriterInterface<W> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ bool Write(const W& msg, grpc::WriteOptions options) override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
if (options.is_last_message()) {
@@ -341,7 +346,7 @@ class ClientWriter : public ClientWriterInterface<W> {
}
bool WritesDone() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops;
ops.ClientSendClose();
call_.PerformOps(&ops);
return cq_.Pluck(&ops);
@@ -353,8 +358,8 @@ class ClientWriter : public ClientWriterInterface<W> {
/// - Attempts to fill in the \a response parameter passed
/// to the constructor of this instance with the response
/// message from the server.
- ::grpc::Status Finish() override {
- ::grpc::Status status;
+ grpc::Status Finish() override {
+ grpc::Status status;
if (!context_->initial_metadata_received_) {
finish_ops_.RecvInitialMetadata(context_);
}
@@ -373,9 +378,9 @@ class ClientWriter : public ClientWriterInterface<W> {
/// single expected response message from the server upon a successful
/// call to the \a Finish method of this instance.
template <class R>
- ClientWriter(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context, R* response)
+ ClientWriter(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context, R* response)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
@@ -385,8 +390,7 @@ class ClientWriter : public ClientWriterInterface<W> {
finish_ops_.AllowNoMessage();
if (!context_->initial_metadata_corked_) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&ops);
@@ -394,13 +398,13 @@ class ClientWriter : public ClientWriterInterface<W> {
}
}
- ::grpc::ClientContext* context_;
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpGenericRecvMessage,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::ClientContext* context_;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpGenericRecvMessage,
+ grpc::internal::CallOpClientRecvStatus>
finish_ops_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
};
/// Client-side interface for bi-directional streaming with
@@ -431,9 +435,8 @@ template <class W, class R>
class ClientReaderWriterFactory {
public:
static ClientReaderWriter<W, R>* Create(
- ::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context) {
+ grpc::ChannelInterface* channel, const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context) {
return new ClientReaderWriter<W, R>(channel, method, context);
}
};
@@ -455,8 +458,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
void WaitForInitialMetadata() override {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
call_.PerformOps(&ops);
cq_.Pluck(&ops); // status ignored
@@ -473,8 +475,8 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Also receives initial metadata if not already received (updates the \a
/// ClientContext associated with this call in that case).
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpRecvMessage<R>>
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpRecvMessage<R>>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
@@ -490,10 +492,10 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call to fill in values).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
- ::grpc::internal::CallOpSendMessage,
- ::grpc::internal::CallOpClientSendClose>
+ bool Write(const W& msg, grpc::WriteOptions options) override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
+ grpc::internal::CallOpSendMessage,
+ grpc::internal::CallOpClientSendClose>
ops;
if (options.is_last_message()) {
@@ -514,7 +516,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
}
bool WritesDone() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops;
ops.ClientSendClose();
call_.PerformOps(&ops);
return cq_.Pluck(&ops);
@@ -525,14 +527,14 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Side effect:
/// - the \a ClientContext associated with this call is updated with
/// possible trailing metadata sent from the server.
- ::grpc::Status Finish() override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata,
- ::grpc::internal::CallOpClientRecvStatus>
+ grpc::Status Finish() override {
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata,
+ grpc::internal::CallOpClientRecvStatus>
ops;
if (!context_->initial_metadata_received_) {
ops.RecvInitialMetadata(context_);
}
- ::grpc::Status status;
+ grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
GPR_CODEGEN_ASSERT(cq_.Pluck(&ops));
@@ -542,24 +544,23 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
private:
friend class internal::ClientReaderWriterFactory<W, R>;
- ::grpc::ClientContext* context_;
- ::grpc::CompletionQueue cq_;
- ::grpc::internal::Call call_;
+ grpc::ClientContext* context_;
+ grpc::CompletionQueue cq_;
+ grpc::internal::Call call_;
/// Block to create a stream and write the initial metadata and \a request
/// out. Note that \a context will be used to fill in custom initial metadata
/// used to send to the server when starting the call.
- ClientReaderWriter(::grpc::ChannelInterface* channel,
- const ::grpc::internal::RpcMethod& method,
- ::grpc::ClientContext* context)
+ ClientReaderWriter(grpc::ChannelInterface* channel,
+ const grpc::internal::RpcMethod& method,
+ grpc::ClientContext* context)
: context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
nullptr}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
if (!context_->initial_metadata_corked_) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&ops);
@@ -585,8 +586,7 @@ class ServerReader final : public ServerReaderInterface<R> {
void SendInitialMetadata() override {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
@@ -604,20 +604,24 @@ class ServerReader final : public ServerReaderInterface<R> {
}
bool Read(R* msg) override {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
private:
- ::grpc::internal::Call* const call_;
+ grpc::internal::Call* const call_;
ServerContext* const ctx_;
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ClientStreamingHandler;
- ServerReader(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReader(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
};
@@ -639,8 +643,7 @@ class ServerWriter final : public ServerWriterInterface<W> {
void SendInitialMetadata() override {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata>
- ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
@@ -657,7 +660,7 @@ class ServerWriter final : public ServerWriterInterface<W> {
/// Also sends initial metadata if not already sent (using the
/// \a ClientContext associated with this call to fill in values).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
+ bool Write(const W& msg, grpc::WriteOptions options) override {
if (options.is_last_message()) {
options.set_buffer_hint();
}
@@ -686,13 +689,13 @@ class ServerWriter final : public ServerWriterInterface<W> {
}
private:
- ::grpc::internal::Call* const call_;
- ::grpc::ServerContext* const ctx_;
+ grpc::internal::Call* const call_;
+ grpc::ServerContext* const ctx_;
template <class ServiceType, class RequestType, class ResponseType>
friend class internal::ServerStreamingHandler;
- ServerWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerWriter(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
};
@@ -707,7 +710,7 @@ namespace internal {
template <class W, class R>
class ServerReaderWriterBody final {
public:
- ServerReaderWriterBody(grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReaderWriterBody(grpc::internal::Call* call, grpc::ServerContext* ctx)
: call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
@@ -731,13 +734,17 @@ class ServerReaderWriterBody final {
}
bool Read(R* msg) {
- ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
+ grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
- bool Write(const W& msg, ::grpc::WriteOptions options) {
+ bool Write(const W& msg, grpc::WriteOptions options) {
if (options.is_last_message()) {
options.set_buffer_hint();
}
@@ -766,7 +773,7 @@ class ServerReaderWriterBody final {
private:
grpc::internal::Call* const call_;
- ::grpc::ServerContext* const ctx_;
+ grpc::ServerContext* const ctx_;
};
} // namespace internal
@@ -795,7 +802,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
/// Also sends initial metadata if not already sent (using the \a
/// ServerContext associated with this call).
using internal::WriterInterface<W>::Write;
- bool Write(const W& msg, ::grpc::WriteOptions options) override {
+ bool Write(const W& msg, grpc::WriteOptions options) override {
return body_.Write(msg, options);
}
@@ -804,7 +811,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> {
friend class internal::TemplatedBidiStreamingHandler<ServerReaderWriter<W, R>,
false>;
- ServerReaderWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerReaderWriter(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx) {}
};
@@ -858,7 +865,7 @@ class ServerUnaryStreamer final
/// \return \a true on success, \a false when the stream has been closed.
using internal::WriterInterface<ResponseType>::Write;
bool Write(const ResponseType& response,
- ::grpc::WriteOptions options) override {
+ grpc::WriteOptions options) override {
if (write_done_ || !read_done_) {
return false;
}
@@ -873,7 +880,7 @@ class ServerUnaryStreamer final
friend class internal::TemplatedBidiStreamingHandler<
ServerUnaryStreamer<RequestType, ResponseType>, true>;
- ServerUnaryStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerUnaryStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx), read_done_(false), write_done_(false) {}
};
@@ -924,7 +931,7 @@ class ServerSplitStreamer final
/// \return \a true on success, \a false when the stream has been closed.
using internal::WriterInterface<ResponseType>::Write;
bool Write(const ResponseType& response,
- ::grpc::WriteOptions options) override {
+ grpc::WriteOptions options) override {
return read_done_ && body_.Write(response, options);
}
@@ -934,7 +941,7 @@ class ServerSplitStreamer final
friend class internal::TemplatedBidiStreamingHandler<
ServerSplitStreamer<RequestType, ResponseType>, false>;
- ServerSplitStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx)
+ ServerSplitStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx)
: body_(call, ctx), read_done_(false) {}
};
diff --git a/grpc/spm-cpp-include/grpcpp/impl/codegen/time.h b/grpc/spm-cpp-include/grpcpp/impl/codegen/time.h
index 340a06f5..f2021f51 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/codegen/time.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/codegen/time.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_TIME_H
#define GRPCPP_IMPL_CODEGEN_TIME_H
+// IWYU pragma: private, include <grpcpp/support/time.h>
+
#include <chrono>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/grpc/spm-cpp-include/grpcpp/impl/grpc_library.h b/grpc/spm-cpp-include/grpcpp/impl/grpc_library.h
index 3711c098..0afca8e4 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/grpc_library.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/grpc_library.h
@@ -24,7 +24,7 @@
#include <grpc/grpc.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen.h>
-#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/grpc_library.h> // IWYU pragma: export
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/impl/rpc_method.h b/grpc/spm-cpp-include/grpcpp/impl/rpc_method.h
index 5da70416..aeef8b77 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/rpc_method.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/rpc_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_METHOD_H
#define GRPCPP_IMPL_RPC_METHOD_H
-#include <grpcpp/impl/codegen/rpc_method.h>
+#include <grpcpp/impl/codegen/rpc_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_METHOD_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/rpc_service_method.h b/grpc/spm-cpp-include/grpcpp/impl/rpc_service_method.h
index ef70a3a1..86cb2dc5 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/rpc_service_method.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/rpc_service_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_RPC_SERVICE_METHOD_H
-#include <grpcpp/impl/codegen/rpc_service_method.h>
+#include <grpcpp/impl/codegen/rpc_service_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_SERVICE_METHOD_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/serialization_traits.h b/grpc/spm-cpp-include/grpcpp/impl/serialization_traits.h
index 95194fbd..6da8b4df 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/serialization_traits.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/serialization_traits.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_SERIALIZATION_TRAITS_H
-#include <grpcpp/impl/codegen/serialization_traits.h>
+#include <grpcpp/impl/codegen/serialization_traits.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERIALIZATION_TRAITS_H
diff --git a/grpc/spm-cpp-include/grpcpp/impl/service_type.h b/grpc/spm-cpp-include/grpcpp/impl/service_type.h
index 250bc8cd..de45c426 100644
--- a/grpc/spm-cpp-include/grpcpp/impl/service_type.h
+++ b/grpc/spm-cpp-include/grpcpp/impl/service_type.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERVICE_TYPE_H
#define GRPCPP_IMPL_SERVICE_TYPE_H
-#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/service_type.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERVICE_TYPE_H
diff --git a/grpc/spm-cpp-include/grpcpp/resource_quota.h b/grpc/spm-cpp-include/grpcpp/resource_quota.h
index 374feae7..bde32f93 100644
--- a/grpc/spm-cpp-include/grpcpp/resource_quota.h
+++ b/grpc/spm-cpp-include/grpcpp/resource_quota.h
@@ -31,7 +31,7 @@ namespace grpc {
/// or a client channel (via \a ChannelArguments).
/// gRPC will attempt to keep memory and threads used by all attached entities
/// below the ResourceQuota bound.
-class ResourceQuota final : private ::grpc::GrpcLibraryCodegen {
+class ResourceQuota final : private grpc::GrpcLibraryCodegen {
public:
/// \param name - a unique name for this ResourceQuota.
explicit ResourceQuota(const std::string& name);
diff --git a/grpc/spm-cpp-include/grpcpp/security/alts_context.h b/grpc/spm-cpp-include/grpcpp/security/alts_context.h
index bba0fca0..8d842575 100644
--- a/grpc/spm-cpp-include/grpcpp/security/alts_context.h
+++ b/grpc/spm-cpp-include/grpcpp/security/alts_context.h
@@ -19,12 +19,12 @@
#ifndef GRPCPP_SECURITY_ALTS_CONTEXT_H
#define GRPCPP_SECURITY_ALTS_CONTEXT_H
-#include <grpc/grpc_security_constants.h>
-#include <grpcpp/security/auth_context.h>
-
#include <map>
#include <memory>
+#include <grpc/grpc_security_constants.h>
+#include <grpcpp/security/auth_context.h>
+
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/security/alts_util.h b/grpc/spm-cpp-include/grpcpp/security/alts_util.h
index 2b2b07e4..b0ef4b4d 100644
--- a/grpc/spm-cpp-include/grpcpp/security/alts_util.h
+++ b/grpc/spm-cpp-include/grpcpp/security/alts_util.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SECURITY_ALTS_UTIL_H
#define GRPCPP_SECURITY_ALTS_UTIL_H
+#include <memory>
+
#include <grpc/grpc_security_constants.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/security/alts_context.h>
#include <grpcpp/security/auth_context.h>
-#include <memory>
-
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/security/auth_context.h b/grpc/spm-cpp-include/grpcpp/security/auth_context.h
index 7a6f2cb7..17784508 100644
--- a/grpc/spm-cpp-include/grpcpp/security/auth_context.h
+++ b/grpc/spm-cpp-include/grpcpp/security/auth_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_SECURITY_AUTH_CONTEXT_H
-#include <grpcpp/impl/codegen/security/auth_context.h>
+#include <grpcpp/impl/codegen/security/auth_context.h> // IWYU pragma: export
#endif // GRPCPP_SECURITY_AUTH_CONTEXT_H
diff --git a/grpc/spm-cpp-include/grpcpp/security/authorization_policy_provider.h b/grpc/spm-cpp-include/grpcpp/security/authorization_policy_provider.h
new file mode 100644
index 00000000..1718db4a
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/security/authorization_policy_provider.h
@@ -0,0 +1,88 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <memory>
+
+#include <grpc/grpc_security.h>
+#include <grpc/status.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+
+namespace grpc {
+namespace experimental {
+
+// Wrapper around C-core grpc_authorization_policy_provider. Internally, it
+// handles creating and updating authorization engine objects, using SDK
+// authorization policy.
+class AuthorizationPolicyProviderInterface {
+ public:
+ virtual ~AuthorizationPolicyProviderInterface() = default;
+ virtual grpc_authorization_policy_provider* c_provider() = 0;
+};
+
+// Implementation obtains authorization policy from static string. This provider
+// will always return the same authorization engines.
+class StaticDataAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<StaticDataAuthorizationPolicyProvider> Create(
+ const std::string& authz_policy, grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // StaticDataAuthorizationPolicyProvider.
+ explicit StaticDataAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~StaticDataAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+// Implementation obtains authorization policy by watching for changes in
+// filesystem.
+class FileWatcherAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<FileWatcherAuthorizationPolicyProvider> Create(
+ const std::string& authz_policy_path, unsigned int refresh_interval_sec,
+ grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // FileWatcherAuthorizationPolicyProvider.
+ explicit FileWatcherAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~FileWatcherAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/grpc/spm-cpp-include/grpcpp/security/binder_credentials.h b/grpc/spm-cpp-include/grpcpp/security/binder_credentials.h
new file mode 100644
index 00000000..f511837e
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/security/binder_credentials.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+#define GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+
+#include <memory>
+
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/security/server_credentials.h>
+
+namespace grpc {
+
+class ChannelCredentials;
+
+namespace experimental {
+
+/// EXPERIMENTAL Builds Binder ServerCredentials.
+///
+/// This should be used along with `binder:` URI scheme. The path in the URI can
+/// later be used to access the server's endpoint binder.
+/// Note that calling \a ServerBuilder::AddListeningPort() with Binder
+/// ServerCredentials in a non-supported environment will make the subsequent
+/// call to \a ServerBuilder::BuildAndStart() return a null pointer.
+std::shared_ptr<grpc::ServerCredentials> BinderServerCredentials(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_CREDENTIALS_H
diff --git a/grpc/spm-cpp-include/grpcpp/security/binder_security_policy.h b/grpc/spm-cpp-include/grpcpp/security/binder_security_policy.h
new file mode 100644
index 00000000..e1c951fc
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/security/binder_security_policy.h
@@ -0,0 +1,82 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+#define GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+
+#include <memory>
+
+#ifdef GPR_ANDROID
+
+#include <jni.h>
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+// EXPERIMENTAL Determinines if a connection is allowed to be
+// established on Android. See https://source.android.com/security/app-sandbox
+// for more info about UID.
+class SecurityPolicy {
+ public:
+ virtual ~SecurityPolicy() = default;
+ // Returns true if the UID is authorized to connect.
+ // Must return the same value for the same inputs so callers can safely cache
+ // the result.
+ virtual bool IsAuthorized(int uid) = 0;
+};
+
+// EXPERIMENTAL Allows all connection. Anything on the Android device will be
+// able to connect, use with caution!
+class UntrustedSecurityPolicy : public SecurityPolicy {
+ public:
+ UntrustedSecurityPolicy();
+ ~UntrustedSecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+// EXPERIMENTAL Only allows the connections from processes with the same UID. In
+// most cases this means "from the same APK".
+class InternalOnlySecurityPolicy : public SecurityPolicy {
+ public:
+ InternalOnlySecurityPolicy();
+ ~InternalOnlySecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+#ifdef GPR_ANDROID
+
+// EXPERIMENTAL Only allows the connections from the APK that have the same
+// signature.
+class SameSignatureSecurityPolicy : public SecurityPolicy {
+ public:
+ // `context` is required for getting PackageManager Java class
+ SameSignatureSecurityPolicy(JavaVM* jvm, jobject context);
+ ~SameSignatureSecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+
+ private:
+ JavaVM* jvm_;
+ jobject context_;
+};
+
+#endif
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
diff --git a/grpc/spm-cpp-include/grpcpp/security/credentials.h b/grpc/spm-cpp-include/grpcpp/security/credentials.h
index 1b1f994c..18dce966 100644
--- a/grpc/spm-cpp-include/grpcpp/security/credentials.h
+++ b/grpc/spm-cpp-include/grpcpp/security/credentials.h
@@ -55,11 +55,17 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
-/// Builds XDS Credentials.
+GRPC_DEPRECATED(
+ "Use grpc::XdsCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
std::shared_ptr<ChannelCredentials> XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
} // namespace experimental
+/// Builds XDS Credentials.
+std::shared_ptr<ChannelCredentials> XdsCredentials(
+ const std::shared_ptr<ChannelCredentials>& fallback_creds);
+
/// A channel credentials object encapsulates all the state needed by a client
/// to authenticate with a server for a given channel.
/// It can make various assertions, e.g., about the client’s identity, role
@@ -80,7 +86,7 @@ class ChannelCredentials : private grpc::GrpcLibraryCodegen {
// AsSecureCredentials(). Once we are able to remove insecure builds from gRPC
// (and also internal dependencies on the indirect method of creating a
// channel through credentials), we would be able to remove this.
- friend std::shared_ptr<ChannelCredentials> grpc::experimental::XdsCredentials(
+ friend std::shared_ptr<ChannelCredentials> grpc::XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
virtual SecureChannelCredentials* AsSecureCredentials() = 0;
diff --git a/grpc/spm-cpp-include/grpcpp/security/server_credentials.h b/grpc/spm-cpp-include/grpcpp/security/server_credentials.h
index 0ce46a82..2d1bc07a 100644
--- a/grpc/spm-cpp-include/grpcpp/security/server_credentials.h
+++ b/grpc/spm-cpp-include/grpcpp/security/server_credentials.h
@@ -60,10 +60,16 @@ struct SslServerCredentialsOptions {
grpc_ssl_client_certificate_request_type client_certificate_request;
};
-namespace experimental {
/// Builds Xds ServerCredentials given fallback credentials
std::shared_ptr<ServerCredentials> XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
+
+namespace experimental {
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
+std::shared_ptr<ServerCredentials> XdsServerCredentials(
+ const std::shared_ptr<ServerCredentials>& fallback_credentials);
} // namespace experimental
/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
@@ -83,8 +89,7 @@ class ServerCredentials : private grpc::GrpcLibraryCodegen {
// We need this friend declaration for access to Insecure() and
// AsSecureServerCredentials(). When these two functions are no longer
// necessary, this friend declaration can be removed too.
- friend std::shared_ptr<ServerCredentials>
- grpc::experimental::XdsServerCredentials(
+ friend std::shared_ptr<ServerCredentials> grpc::XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
/// Tries to bind \a server to the given \a addr (eg, localhost:1234,
diff --git a/grpc/spm-cpp-include/grpcpp/security/tls_certificate_provider.h b/grpc/spm-cpp-include/grpcpp/security/tls_certificate_provider.h
index a7480cc6..bbef455f 100644
--- a/grpc/spm-cpp-include/grpcpp/security/tls_certificate_provider.h
+++ b/grpc/spm-cpp-include/grpcpp/security/tls_certificate_provider.h
@@ -17,19 +17,16 @@
#ifndef GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
#define GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
+#include <memory>
+#include <vector>
+
+#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
-// TODO(yihuazhang): remove the forward declaration here and include
-// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
-typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
-
namespace grpc {
namespace experimental {
diff --git a/grpc/spm-cpp-include/grpcpp/security/tls_certificate_verifier.h b/grpc/spm-cpp-include/grpcpp/security/tls_certificate_verifier.h
new file mode 100644
index 00000000..e619d96d
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/security/tls_certificate_verifier.h
@@ -0,0 +1,225 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+#define GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include <grpc/grpc_security_constants.h>
+#include <grpc/status.h>
+#include <grpc/support/log.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/sync.h>
+#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/support/config.h>
+#include <grpcpp/support/string_ref.h>
+
+// TODO(yihuazhang): remove the forward declaration here and include
+// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
+typedef struct grpc_tls_custom_verification_check_request
+ grpc_tls_custom_verification_check_request;
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+typedef struct grpc_tls_certificate_verifier_external
+ grpc_tls_certificate_verifier_external;
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+extern "C" grpc_tls_certificate_verifier*
+grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
+
+namespace grpc {
+namespace experimental {
+
+// Contains the verification-related information associated with a connection
+// request. Users should not directly create or destroy this request object, but
+// shall interact with it through CertificateVerifier's Verify() and Cancel().
+class TlsCustomVerificationCheckRequest {
+ public:
+ explicit TlsCustomVerificationCheckRequest(
+ grpc_tls_custom_verification_check_request* request);
+ ~TlsCustomVerificationCheckRequest() {}
+
+ grpc::string_ref target_name() const;
+ grpc::string_ref peer_cert() const;
+ grpc::string_ref peer_cert_full_chain() const;
+ grpc::string_ref common_name() const;
+ std::vector<grpc::string_ref> uri_names() const;
+ std::vector<grpc::string_ref> dns_names() const;
+ std::vector<grpc::string_ref> email_names() const;
+ std::vector<grpc::string_ref> ip_names() const;
+
+ grpc_tls_custom_verification_check_request* c_request() { return c_request_; }
+
+ private:
+ grpc_tls_custom_verification_check_request* c_request_ = nullptr;
+};
+
+// The base class of all internal verifier implementations, and the ultimate
+// class that all external verifiers will eventually be transformed into.
+// To implement a custom verifier, do not extend this class; instead,
+// implement a subclass of ExternalCertificateVerifier. Note that custom
+// verifier implementations can compose their functionality with existing
+// implementations of this interface, such as HostnameVerifier, by delegating
+// to an instance of that class.
+class CertificateVerifier {
+ public:
+ explicit CertificateVerifier(grpc_tls_certificate_verifier* v);
+
+ ~CertificateVerifier();
+
+ // Verifies a connection request, based on the logic specified in an internal
+ // verifier. The check on each internal verifier could be either synchronous
+ // or asynchronous, and we will need to use return value to know.
+ //
+ // request: the verification information associated with this request
+ // callback: This will only take effect if the verifier is asynchronous.
+ // The function that gRPC will invoke when the verifier has already
+ // completed its asynchronous check. Callers can use this function
+ // to perform any additional checks. The input parameter of the
+ // std::function indicates the status of the verifier check.
+ // sync_status: This will only be useful if the verifier is synchronous.
+ // The status of the verifier as it has already done it's
+ // synchronous check.
+ // return: return true if executed synchronously, otherwise return false
+ bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status);
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending.
+ //
+ // request: the verification information associated with this request
+ void Cancel(TlsCustomVerificationCheckRequest* request);
+
+ // Gets the core verifier used internally.
+ grpc_tls_certificate_verifier* c_verifier() { return verifier_; }
+
+ private:
+ static void AsyncCheckDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+ grpc_tls_certificate_verifier* verifier_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*,
+ std::function<void(grpc::Status)>>
+ request_map_ ABSL_GUARDED_BY(mu_);
+};
+
+// The base class of all external, user-specified verifiers. Users should
+// inherit this class to implement a custom verifier.
+// Note that while implementing the custom verifier that extends this class, it
+// is possible to compose an existing ExternalCertificateVerifier or
+// CertificateVerifier, inside the Verify() and Cancel() function of the new
+// custom verifier.
+class ExternalCertificateVerifier {
+ public:
+ // A factory method for creating a |CertificateVerifier| from this class. All
+ // the user-implemented verifiers should use this function to be converted to
+ // verifiers compatible with |TlsCredentialsOptions|.
+ // The resulting CertificateVerifier takes ownership of the newly instantiated
+ // Subclass.
+ template <typename Subclass, typename... Args>
+ static std::shared_ptr<CertificateVerifier> Create(Args&&... args) {
+ grpc::internal::GrpcLibraryInitializer g_gli_initializer;
+ g_gli_initializer.summon();
+ auto* external_verifier = new Subclass(std::forward<Args>(args)...);
+ return std::make_shared<CertificateVerifier>(
+ grpc_tls_certificate_verifier_external_create(
+ external_verifier->base_));
+ }
+
+ // The verification logic that will be performed after the TLS handshake
+ // completes. Implementers can choose to do their checks synchronously or
+ // asynchronously.
+ //
+ // request: the verification information associated with this request
+ // callback: This should only be used if your check is done asynchronously.
+ // When the asynchronous work is done, invoke this callback function
+ // with the proper status, indicating the success or the failure of
+ // the check. The implementer MUST NOT invoke this |callback| in the
+ // same thread before Verify() returns, otherwise it can lead to
+ // deadlocks.
+ // sync_status: This should only be used if your check is done synchronously.
+ // Modifies this value to indicate the success or the failure of
+ // the check.
+ // return: return true if your check is done synchronously, otherwise return
+ // false
+ virtual bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) = 0;
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending. The implementation should abort whatever
+ // async operation it is waiting for and quickly invoke the callback that was
+ // passed to Verify() with a status indicating the cancellation.
+ //
+ // request: the verification information associated with this request
+ virtual void Cancel(TlsCustomVerificationCheckRequest* request) = 0;
+
+ protected:
+ ExternalCertificateVerifier();
+
+ virtual ~ExternalCertificateVerifier();
+
+ private:
+ struct AsyncRequestState {
+ AsyncRequestState(grpc_tls_on_custom_verification_check_done_cb cb,
+ void* arg,
+ grpc_tls_custom_verification_check_request* request)
+ : callback(cb), callback_arg(arg), cpp_request(request) {}
+
+ grpc_tls_on_custom_verification_check_done_cb callback;
+ void* callback_arg;
+ TlsCustomVerificationCheckRequest cpp_request;
+ };
+
+ static int VerifyInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+
+ static void CancelInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request);
+
+ static void DestructInCoreExternalVerifier(void* user_data);
+
+ // TODO(yihuazhang): after the insecure build is removed, make this an object
+ // member instead of a pointer.
+ grpc_tls_certificate_verifier_external* base_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*, AsyncRequestState>
+ request_map_ ABSL_GUARDED_BY(mu_);
+};
+
+class HostNameCertificateVerifier : public CertificateVerifier {
+ public:
+ HostNameCertificateVerifier();
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
diff --git a/grpc/spm-cpp-include/grpcpp/security/tls_credentials_options.h b/grpc/spm-cpp-include/grpcpp/security/tls_credentials_options.h
index da2b595b..220c9533 100644
--- a/grpc/spm-cpp-include/grpcpp/security/tls_credentials_options.h
+++ b/grpc/spm-cpp-include/grpcpp/security/tls_credentials_options.h
@@ -19,133 +19,20 @@
#ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
#define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
+#include <memory>
+#include <vector>
+
+#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/security/tls_certificate_provider.h>
+#include <grpcpp/security/tls_certificate_verifier.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
-// TODO(yihuazhang): remove the forward declaration here and include
-// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
-typedef struct grpc_tls_server_authorization_check_arg
- grpc_tls_server_authorization_check_arg;
-typedef struct grpc_tls_server_authorization_check_config
- grpc_tls_server_authorization_check_config;
-typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
-typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
-
namespace grpc {
namespace experimental {
-/** TLS server authorization check arguments, wraps
- * grpc_tls_server_authorization_check_arg. It is used for experimental
- * purposes for now and it is subject to change.
- *
- * The server authorization check arg contains all the info necessary to
- * schedule/cancel a server authorization check request. The callback function
- * must be called after finishing the schedule operation. See the description
- * of the grpc_tls_server_authorization_check_arg struct in grpc_security.h for
- * more details. **/
-class TlsServerAuthorizationCheckArg {
- public:
- /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed
- * to the constructor. One must remember to free any memory allocated to the
- * C arg after using the setter functions below. **/
- explicit TlsServerAuthorizationCheckArg(
- grpc_tls_server_authorization_check_arg* arg);
- ~TlsServerAuthorizationCheckArg();
-
- /** Getters for member fields. **/
- void* cb_user_data() const;
- int success() const;
- std::string target_name() const;
- std::string peer_cert() const;
- std::string peer_cert_full_chain() const;
- grpc_status_code status() const;
- std::string error_details() const;
-
- /** Setters for member fields. **/
- void set_cb_user_data(void* cb_user_data);
- void set_success(int success);
- void set_target_name(const std::string& target_name);
- void set_peer_cert(const std::string& peer_cert);
- void set_peer_cert_full_chain(const std::string& peer_cert_full_chain);
- void set_status(grpc_status_code status);
- void set_error_details(const std::string& error_details);
-
- /** Calls the C arg's callback function. **/
- void OnServerAuthorizationCheckDoneCallback();
-
- private:
- grpc_tls_server_authorization_check_arg* c_arg_;
-};
-
-/** An interface that the application derives and uses to instantiate a
- * TlsServerAuthorizationCheckConfig instance. Refer to the definition of the
- * grpc_tls_server_authorization_check_config in grpc_tls_credentials_options.h
- * for more details on the expectations of the member functions of the
- * interface.
- * **/
-struct TlsServerAuthorizationCheckInterface {
- virtual ~TlsServerAuthorizationCheckInterface() = default;
- /** A callback that invokes the server authorization check. **/
- virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0;
- /** A callback that cancels a server authorization check request. **/
- virtual void Cancel(TlsServerAuthorizationCheckArg* /* arg */) {}
-};
-
-/** TLS server authorization check config, wraps
- * grps_tls_server_authorization_check_config. It is used for experimental
- * purposes for now and it is subject to change. **/
-class TlsServerAuthorizationCheckConfig {
- public:
- explicit TlsServerAuthorizationCheckConfig(
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface);
- ~TlsServerAuthorizationCheckConfig();
-
- int Schedule(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return 1;
- }
- return server_authorization_check_interface_->Schedule(arg);
- }
-
- void Cancel(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return;
- }
- server_authorization_check_interface_->Cancel(arg);
- }
-
- /** Returns C struct for the server authorization check config. **/
- grpc_tls_server_authorization_check_config* c_config() const {
- return c_config_;
- }
-
- private:
- grpc_tls_server_authorization_check_config* c_config_;
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface_;
-};
-
// Base class of configurable options specified by users to configure their
// certain security features supported in TLS. It is used for experimental
// purposes for now and it is subject to change.
@@ -187,6 +74,35 @@ class TlsCredentialsOptions {
//
// @param identity_cert_name the name of identity key-cert pairs being set.
void set_identity_cert_name(const std::string& identity_cert_name);
+ // Sets the Tls session key logging configuration. If not set, tls
+ // session key logging is disabled. Note that this should be used only for
+ // debugging purposes. It should never be used in a production environment
+ // due to security concerns.
+ //
+ // @param tls_session_key_log_file_path: Path where tls session keys would
+ // be logged.
+ void set_tls_session_key_log_file_path(
+ const std::string& tls_session_key_log_file_path);
+ // Sets the certificate verifier used to perform post-handshake peer identity
+ // checks.
+ void set_certificate_verifier(
+ std::shared_ptr<CertificateVerifier> certificate_verifier);
+ // Sets the options of whether to check the hostname of the peer on a per-call
+ // basis. This is usually used in a combination with virtual hosting at the
+ // client side, where each individual call on a channel can have a different
+ // host associated with it.
+ // This check is intended to verify that the host specified for the individual
+ // call is covered by the cert that the peer presented.
+ // We will perform such checks by default. This should be disabled if
+ // verifiers other than the host name verifier is used.
+ void set_check_call_host(bool check_call_host);
+
+ // TODO(zhenlian): This is an experimental API is likely to change in the
+ // future. Before de-experiementalizing, verify the API is up to date.
+ // If set, gRPC will read all hashed x.509 CRL files in the directory and
+ // enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
+ // version > 1.1.
+ void set_crl_directory(const std::string& path);
// ----- Getters for member fields ----
// Get the internal c options. This function shall be used only internally.
@@ -196,6 +112,7 @@ class TlsCredentialsOptions {
private:
std::shared_ptr<CertificateProviderInterface> certificate_provider_;
+ std::shared_ptr<CertificateVerifier> certificate_verifier_;
grpc_tls_credentials_options* c_credentials_options_ = nullptr;
};
@@ -207,14 +124,9 @@ class TlsCredentialsOptions {
// It is used for experimental purposes for now and it is subject to change.
class TlsChannelCredentialsOptions final : public TlsCredentialsOptions {
public:
- // Sets the option to verify the server.
- // The default is GRPC_TLS_SERVER_VERIFICATION.
- void set_server_verification_option(
- grpc_tls_server_verification_option server_verification_option);
- // Sets the custom authorization config.
- void set_server_authorization_check_config(
- std::shared_ptr<TlsServerAuthorizationCheckConfig>
- authorization_check_config);
+ // Sets the decision of whether to do a crypto check on the server certs.
+ // The default is true.
+ void set_verify_server_certs(bool verify_server_certs);
private:
};
diff --git a/grpc/spm-cpp-include/grpcpp/server.h b/grpc/spm-cpp-include/grpcpp/server.h
index a69e64b4..dce87448 100644
--- a/grpc/spm-cpp-include/grpcpp/server.h
+++ b/grpc/spm-cpp-include/grpcpp/server.h
@@ -19,12 +19,12 @@
#ifndef GRPCPP_SERVER_H
#define GRPCPP_SERVER_H
+#include <grpc/impl/codegen/port_platform.h>
+
#include <list>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/atm.h>
#include <grpcpp/channel.h>
@@ -237,7 +237,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// service. The service must exist for the lifetime of the Server instance.
void RegisterAsyncGenericService(AsyncGenericService* service) override;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback-based generic service. This call does not take
/// ownership of theservice. The service must exist for the lifetime of the
/// Server instance.
@@ -248,41 +247,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
context_allocator_ = std::move(context_allocator);
}
-#else
- /// NOTE: class experimental_registration_type is not part of the public API
- /// of this class
- /// TODO(vjpai): Move these contents to the public API of Server when
- /// they are no longer experimental
- class experimental_registration_type final
- : public experimental_registration_interface {
- public:
- explicit experimental_registration_type(Server* server) : server_(server) {}
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) override {
- server_->RegisterCallbackGenericService(service);
- }
-
- void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> context_allocator) override {
- server_->context_allocator_ = std::move(context_allocator);
- }
-
- private:
- Server* server_;
- };
-
- /// TODO(vjpai): Mark this override when experimental type above is deleted
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service);
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time.
- experimental_registration_interface* experimental_registration() override {
- return &experimental_registration_;
- }
-#endif
-
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) override;
@@ -327,12 +291,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// the \a sync_server_cqs)
std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- // For registering experimental callback generic service; remove when that
- // method longer experimental
- experimental_registration_type experimental_registration_{this};
-#endif
-
// Server status
internal::Mutex mu_;
bool started_;
@@ -364,11 +322,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// When appropriate, use a default callback generic service to handle
// unimplemented methods
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
std::unique_ptr<CallbackGenericService> unimplemented_service_;
-#else
- std::unique_ptr<experimental::CallbackGenericService> unimplemented_service_;
-#endif
// A special handler for resource exhausted in sync case
std::unique_ptr<internal::MethodHandler> resource_exhausted_handler_;
diff --git a/grpc/spm-cpp-include/grpcpp/server_builder.h b/grpc/spm-cpp-include/grpcpp/server_builder.h
index 00e82a10..e542ef2c 100644
--- a/grpc/spm-cpp-include/grpcpp/server_builder.h
+++ b/grpc/spm-cpp-include/grpcpp/server_builder.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SERVER_BUILDER_H
#define GRPCPP_SERVER_BUILDER_H
+#include <grpc/impl/codegen/port_platform.h>
+
#include <climits>
#include <map>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/cpu.h>
#include <grpc/support/workaround_list.h>
@@ -33,6 +33,7 @@
#include <grpcpp/impl/codegen/server_interceptor.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
+#include <grpcpp/security/authorization_policy_provider.h>
#include <grpcpp/server.h>
#include <grpcpp/support/config.h>
@@ -55,13 +56,7 @@ namespace internal {
class ExternalConnectionAcceptorImpl;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
// EXPERIMENTAL API:
@@ -121,8 +116,8 @@ class ServerBuilder {
/// \param addr_uri The address to try to bind to the server in URI form. If
/// the scheme name is omitted, "dns:///" is assumed. To bind to any address,
/// please use IPv6 any, i.e., [::]:<port>, which also accepts IPv4
- /// connections. Valid values include dns:///localhost:1234, /
- /// 192.168.1.1:31416, dns:///[::1]:27182, etc.).
+ /// connections. Valid values include dns:///localhost:1234,
+ /// 192.168.1.1:31416, dns:///[::1]:27182, etc.
/// \param creds The credentials associated with the server.
/// \param[out] selected_port If not `nullptr`, gets populated with the port
/// number bound to the \a grpc::Server for the corresponding endpoint after
@@ -269,20 +264,6 @@ class ServerBuilder {
builder_->interceptor_creators_ = std::move(interceptor_creators);
}
- /// Set the allocator for creating and releasing callback server context.
- /// Takes the owndership of the allocator.
- ServerBuilder& SetContextAllocator(
- std::unique_ptr<grpc::ContextAllocator> context_allocator);
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- /// Register a generic service that uses the callback API.
- /// Matches requests with any :authority
- /// This is mostly useful for writing generic gRPC Proxies where the exact
- /// serialization format is unknown
- ServerBuilder& RegisterCallbackGenericService(
- grpc::experimental::CallbackGenericService* service);
-#endif
-
enum class ExternalConnectionType {
FROM_FD = 0 // in the form of a file descriptor
};
@@ -295,18 +276,27 @@ class ServerBuilder {
AddExternalConnectionAcceptor(ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds);
+ /// Sets server authorization policy provider in
+ /// GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER channel argument.
+ void SetAuthorizationPolicyProvider(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider);
+
private:
ServerBuilder* builder_;
};
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+ /// Set the allocator for creating and releasing callback server context.
+ /// Takes the owndership of the allocator.
+ ServerBuilder& SetContextAllocator(
+ std::unique_ptr<grpc::ContextAllocator> context_allocator);
+
/// Register a generic service that uses the callback API.
/// Matches requests with any :authority
/// This is mostly useful for writing generic gRPC Proxies where the exact
/// serialization format is unknown
ServerBuilder& RegisterCallbackGenericService(
grpc::CallbackGenericService* service);
-#endif
/// NOTE: The function experimental() is not stable public API. It is a view
/// to the experimental components of this class. It may be changed or removed
@@ -361,7 +351,7 @@ class ServerBuilder {
virtual ChannelArguments BuildChannelArgs();
private:
- friend class ::grpc::testing::ServerBuilderPluginTest;
+ friend class grpc::testing::ServerBuilderPluginTest;
struct SyncServerSettings {
SyncServerSettings()
@@ -398,12 +388,7 @@ class ServerBuilder {
grpc_resource_quota* resource_quota_;
grpc::AsyncGenericService* generic_service_{nullptr};
std::unique_ptr<ContextAllocator> context_allocator_;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
grpc::CallbackGenericService* callback_generic_service_{nullptr};
-#else
- grpc::experimental::CallbackGenericService* callback_generic_service_{
- nullptr};
-#endif
struct {
bool is_set;
@@ -420,6 +405,8 @@ class ServerBuilder {
std::vector<std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
acceptors_;
grpc_server_config_fetcher* server_config_fetcher_ = nullptr;
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ authorization_provider_;
};
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/server_context.h b/grpc/spm-cpp-include/grpcpp/server_context.h
index 45f26149..ed6bd66d 100644
--- a/grpc/spm-cpp-include/grpcpp/server_context.h
+++ b/grpc/spm-cpp-include/grpcpp/server_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SERVER_CONTEXT_H
#define GRPCPP_SERVER_CONTEXT_H
-#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/server_context.h> // IWYU pragma: export
#endif // GRPCPP_SERVER_CONTEXT_H
diff --git a/grpc/spm-cpp-include/grpcpp/server_posix.h b/grpc/spm-cpp-include/grpcpp/server_posix.h
index ef3ee01a..2e938624 100644
--- a/grpc/spm-cpp-include/grpcpp/server_posix.h
+++ b/grpc/spm-cpp-include/grpcpp/server_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_SERVER_POSIX_H
#define GRPCPP_SERVER_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/server.h>
namespace grpc {
diff --git a/grpc/spm-cpp-include/grpcpp/support/async_stream.h b/grpc/spm-cpp-include/grpcpp/support/async_stream.h
index ff9e4556..5f717014 100644
--- a/grpc/spm-cpp-include/grpcpp/support/async_stream.h
+++ b/grpc/spm-cpp-include/grpcpp/support/async_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H
#define GRPCPP_SUPPORT_ASYNC_STREAM_H
-#include <grpcpp/impl/codegen/async_stream.h>
+#include <grpcpp/impl/codegen/async_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_STREAM_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/async_unary_call.h b/grpc/spm-cpp-include/grpcpp/support/async_unary_call.h
index 2e5181c5..02071e48 100644
--- a/grpc/spm-cpp-include/grpcpp/support/async_unary_call.h
+++ b/grpc/spm-cpp-include/grpcpp/support/async_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
#define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
-#include <grpcpp/impl/codegen/async_unary_call.h>
+#include <grpcpp/impl/codegen/async_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/byte_buffer.h b/grpc/spm-cpp-include/grpcpp/support/byte_buffer.h
index 53aeff19..6f566e76 100644
--- a/grpc/spm-cpp-include/grpcpp/support/byte_buffer.h
+++ b/grpc/spm-cpp-include/grpcpp/support/byte_buffer.h
@@ -22,7 +22,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-#include <grpcpp/impl/codegen/byte_buffer.h>
+#include <grpcpp/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/slice.h>
diff --git a/grpc/spm-cpp-include/grpcpp/support/channel_arguments.h b/grpc/spm-cpp-include/grpcpp/support/channel_arguments.h
index a9514bc9..afee7041 100644
--- a/grpc/spm-cpp-include/grpcpp/support/channel_arguments.h
+++ b/grpc/spm-cpp-include/grpcpp/support/channel_arguments.h
@@ -70,13 +70,7 @@ class ChannelArguments {
/// the resolver.
void SetGrpclbFallbackTimeout(int fallback_timeout);
- /// For client channel's, the socket mutator operates on
- /// "channel" sockets. For server's, the socket mutator operates
- /// only on "listen" sockets.
- /// TODO(apolcyn): allow socket mutators to also operate
- /// on server "channel" sockets, and adjust the socket mutator
- /// object to be more speficic about which type of socket
- /// it should operate on.
+ /// Set a mutator for the underlying socket.
void SetSocketMutator(grpc_socket_mutator* mutator);
/// Set the string to prepend to the user agent.
diff --git a/grpc/spm-cpp-include/grpcpp/support/client_callback.h b/grpc/spm-cpp-include/grpcpp/support/client_callback.h
index 063fdc4f..c15bca0d 100644
--- a/grpc/spm-cpp-include/grpcpp/support/client_callback.h
+++ b/grpc/spm-cpp-include/grpcpp/support/client_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_CALLBACK_H
#define GRPCPP_SUPPORT_CLIENT_CALLBACK_H
-#include <grpcpp/impl/codegen/client_callback.h>
+#include <grpcpp/impl/codegen/client_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_CALLBACK_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/client_interceptor.h b/grpc/spm-cpp-include/grpcpp/support/client_interceptor.h
index 50810e3f..552cab4c 100644
--- a/grpc/spm-cpp-include/grpcpp/support/client_interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/support/client_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/client_interceptor.h>
+#include <grpcpp/impl/codegen/client_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/config.h b/grpc/spm-cpp-include/grpcpp/support/config.h
index 16bdab64..f2632f26 100644
--- a/grpc/spm-cpp-include/grpcpp/support/config.h
+++ b/grpc/spm-cpp-include/grpcpp/support/config.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CONFIG_H
#define GRPCPP_SUPPORT_CONFIG_H
-#include <grpcpp/impl/codegen/config.h>
+#include <grpcpp/impl/codegen/config.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CONFIG_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/interceptor.h b/grpc/spm-cpp-include/grpcpp/support/interceptor.h
index 7ff79516..d4f2ea18 100644
--- a/grpc/spm-cpp-include/grpcpp/support/interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/support/interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/interceptor.h>
+#include <grpcpp/impl/codegen/interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_INTERCEPTOR_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/message_allocator.h b/grpc/spm-cpp-include/grpcpp/support/message_allocator.h
index 20ce072b..22a963f3 100644
--- a/grpc/spm-cpp-include/grpcpp/support/message_allocator.h
+++ b/grpc/spm-cpp-include/grpcpp/support/message_allocator.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
#define GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
-#include <grpcpp/impl/codegen/message_allocator.h>
+#include <grpcpp/impl/codegen/message_allocator.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/method_handler.h b/grpc/spm-cpp-include/grpcpp/support/method_handler.h
index 038e76c8..0b97a7af 100644
--- a/grpc/spm-cpp-include/grpcpp/support/method_handler.h
+++ b/grpc/spm-cpp-include/grpcpp/support/method_handler.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_METHOD_HANDLER_H
#define GRPCPP_SUPPORT_METHOD_HANDLER_H
-#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/method_handler.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_METHOD_HANDLER_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/proto_buffer_reader.h b/grpc/spm-cpp-include/grpcpp/support/proto_buffer_reader.h
index 4cdb65d5..07e523ed 100644
--- a/grpc/spm-cpp-include/grpcpp/support/proto_buffer_reader.h
+++ b/grpc/spm-cpp-include/grpcpp/support/proto_buffer_reader.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
-#include <grpcpp/impl/codegen/proto_buffer_reader.h>
+#include <grpcpp/impl/codegen/proto_buffer_reader.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/proto_buffer_writer.h b/grpc/spm-cpp-include/grpcpp/support/proto_buffer_writer.h
index 01cf29c4..589deb82 100644
--- a/grpc/spm-cpp-include/grpcpp/support/proto_buffer_writer.h
+++ b/grpc/spm-cpp-include/grpcpp/support/proto_buffer_writer.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
-#include <grpcpp/impl/codegen/proto_buffer_writer.h>
+#include <grpcpp/impl/codegen/proto_buffer_writer.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/server_callback.h b/grpc/spm-cpp-include/grpcpp/support/server_callback.h
index b0aeeb53..1ffdce53 100644
--- a/grpc/spm-cpp-include/grpcpp/support/server_callback.h
+++ b/grpc/spm-cpp-include/grpcpp/support/server_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_CALLBACK_H
#define GRPCPP_SUPPORT_SERVER_CALLBACK_H
-#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_CALLBACK_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/server_interceptor.h b/grpc/spm-cpp-include/grpcpp/support/server_interceptor.h
index b0a6229b..ad9c7a18 100644
--- a/grpc/spm-cpp-include/grpcpp/support/server_interceptor.h
+++ b/grpc/spm-cpp-include/grpcpp/support/server_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
#define GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/server_interceptor.h>
+#include <grpcpp/impl/codegen/server_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/slice.h b/grpc/spm-cpp-include/grpcpp/support/slice.h
index eaeb29a4..2434983f 100644
--- a/grpc/spm-cpp-include/grpcpp/support/slice.h
+++ b/grpc/spm-cpp-include/grpcpp/support/slice.h
@@ -20,7 +20,7 @@
#define GRPCPP_SUPPORT_SLICE_H
#include <grpc/slice.h>
-#include <grpcpp/impl/codegen/slice.h>
+#include <grpcpp/impl/codegen/slice.h> // IWYU pragma: export
#include <grpcpp/support/config.h>
#endif // GRPCPP_SUPPORT_SLICE_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/status.h b/grpc/spm-cpp-include/grpcpp/support/status.h
index 91b629f1..e46b46d1 100644
--- a/grpc/spm-cpp-include/grpcpp/support/status.h
+++ b/grpc/spm-cpp-include/grpcpp/support/status.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_H
#define GRPCPP_SUPPORT_STATUS_H
-#include <grpcpp/impl/codegen/status.h>
+#include <grpcpp/impl/codegen/status.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/status_code_enum.h b/grpc/spm-cpp-include/grpcpp/support/status_code_enum.h
index bfb47f39..eac697f4 100644
--- a/grpc/spm-cpp-include/grpcpp/support/status_code_enum.h
+++ b/grpc/spm-cpp-include/grpcpp/support/status_code_enum.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
#define GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
-#include <grpcpp/impl/codegen/status_code_enum.h>
+#include <grpcpp/impl/codegen/status_code_enum.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/string_ref.h b/grpc/spm-cpp-include/grpcpp/support/string_ref.h
index 0e0d3d43..6cf82bed 100644
--- a/grpc/spm-cpp-include/grpcpp/support/string_ref.h
+++ b/grpc/spm-cpp-include/grpcpp/support/string_ref.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STRING_REF_H
#define GRPCPP_SUPPORT_STRING_REF_H
-#include <grpcpp/impl/codegen/string_ref.h>
+#include <grpcpp/impl/codegen/string_ref.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STRING_REF_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/stub_options.h b/grpc/spm-cpp-include/grpcpp/support/stub_options.h
index e9700ea4..ffe1ad77 100644
--- a/grpc/spm-cpp-include/grpcpp/support/stub_options.h
+++ b/grpc/spm-cpp-include/grpcpp/support/stub_options.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STUB_OPTIONS_H
#define GRPCPP_SUPPORT_STUB_OPTIONS_H
-#include <grpcpp/impl/codegen/stub_options.h>
+#include <grpcpp/impl/codegen/stub_options.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STUB_OPTIONS_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/sync_stream.h b/grpc/spm-cpp-include/grpcpp/support/sync_stream.h
index ea60b6da..78a348de 100644
--- a/grpc/spm-cpp-include/grpcpp/support/sync_stream.h
+++ b/grpc/spm-cpp-include/grpcpp/support/sync_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SYNC_STREAM_H
#define GRPCPP_SUPPORT_SYNC_STREAM_H
-#include <grpcpp/impl/codegen/sync_stream.h>
+#include <grpcpp/impl/codegen/sync_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SYNC_STREAM_H
diff --git a/grpc/spm-cpp-include/grpcpp/support/time.h b/grpc/spm-cpp-include/grpcpp/support/time.h
index c7408ff2..b5e07b68 100644
--- a/grpc/spm-cpp-include/grpcpp/support/time.h
+++ b/grpc/spm-cpp-include/grpcpp/support/time.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_TIME_H
#define GRPCPP_SUPPORT_TIME_H
-#include <grpcpp/impl/codegen/time.h>
+#include <grpcpp/impl/codegen/time.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_TIME_H
diff --git a/grpc/spm-cpp-include/grpcpp/test/client_context_test_peer.h b/grpc/spm-cpp-include/grpcpp/test/client_context_test_peer.h
new file mode 100644
index 00000000..0ce96439
--- /dev/null
+++ b/grpc/spm-cpp-include/grpcpp/test/client_context_test_peer.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+#define GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+
+#include <map>
+
+#include <grpcpp/client_context.h>
+
+namespace grpc {
+namespace testing {
+
+/// A test-only class to access private members and methods of ClientContext.
+class ClientContextTestPeer {
+ public:
+ explicit ClientContextTestPeer(ClientContext* const ctx) : ctx_(ctx) {}
+
+ /// Inject metadata to the ClientContext for the test. The test peer
+ /// must be alive when a ClientContext::GetServerInitialMetadata is called.
+ void AddServerInitialMetadata(const std::string& key,
+ const std::string& value) {
+ server_initial_metadata_storage_.insert(
+ std::pair<std::string, std::string>(key, value));
+ ctx_->initial_metadata_received_ = true;
+ ctx_->recv_initial_metadata_.map()->clear();
+ for (const auto& item : server_initial_metadata_storage_) {
+ ctx_->recv_initial_metadata_.map()->insert(
+ std::pair<grpc::string_ref, grpc::string_ref>(
+ item.first.c_str(),
+ grpc::string_ref(item.second.data(), item.second.size())));
+ }
+ }
+
+ std::multimap<std::string, std::string> GetSendInitialMetadata() const {
+ return ctx_->send_initial_metadata_;
+ }
+
+ private:
+ ClientContext* const ctx_; // not owned
+ std::multimap<std::string, std::string> server_initial_metadata_storage_;
+};
+
+} // namespace testing
+} // namespace grpc
+
+#endif // GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
diff --git a/grpc/spm-cpp-include/grpcpp/test/default_reactor_test_peer.h b/grpc/spm-cpp-include/grpcpp/test/default_reactor_test_peer.h
index a792e6f9..4d4ae5c3 100644
--- a/grpc/spm-cpp-include/grpcpp/test/default_reactor_test_peer.h
+++ b/grpc/spm-cpp-include/grpcpp/test/default_reactor_test_peer.h
@@ -34,22 +34,21 @@ namespace testing {
/// test mode rather than letting it follow the normal paths.
class DefaultReactorTestPeer {
public:
- explicit DefaultReactorTestPeer(experimental::CallbackServerContext* ctx)
- : DefaultReactorTestPeer(ctx, [](::grpc::Status) {}) {}
- DefaultReactorTestPeer(experimental::CallbackServerContext* ctx,
- std::function<void(::grpc::Status)> finish_func)
+ explicit DefaultReactorTestPeer(CallbackServerContext* ctx)
+ : DefaultReactorTestPeer(ctx, [](Status) {}) {}
+ DefaultReactorTestPeer(CallbackServerContext* ctx,
+ std::function<void(Status)> finish_func)
: ctx_(ctx) {
ctx->SetupTestDefaultReactor(std::move(finish_func));
}
- ::grpc::experimental::ServerUnaryReactor* reactor() const {
- return reinterpret_cast<experimental::ServerUnaryReactor*>(
- &ctx_->default_reactor_);
+ ServerUnaryReactor* reactor() const {
+ return reinterpret_cast<ServerUnaryReactor*>(&ctx_->default_reactor_);
}
bool test_status_set() const { return ctx_->test_status_set(); }
Status test_status() const { return ctx_->test_status(); }
private:
- experimental::CallbackServerContext* const ctx_; // not owned
+ CallbackServerContext* const ctx_; // not owned
};
} // namespace testing
diff --git a/grpc/spm-cpp-include/grpcpp/test/mock_stream.h b/grpc/spm-cpp-include/grpcpp/test/mock_stream.h
index deffad3d..de398087 100644
--- a/grpc/spm-cpp-include/grpcpp/test/mock_stream.h
+++ b/grpc/spm-cpp-include/grpcpp/test/mock_stream.h
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <gmock/gmock.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
@@ -31,7 +32,7 @@ namespace grpc {
namespace testing {
template <class R>
-class MockClientReader : public ::grpc::ClientReaderInterface<R> {
+class MockClientReader : public grpc::ClientReaderInterface<R> {
public:
MockClientReader() = default;
@@ -47,7 +48,7 @@ class MockClientReader : public ::grpc::ClientReaderInterface<R> {
};
template <class W>
-class MockClientWriter : public ::grpc::ClientWriterInterface<W> {
+class MockClientWriter : public grpc::ClientWriterInterface<W> {
public:
MockClientWriter() = default;
@@ -62,8 +63,7 @@ class MockClientWriter : public ::grpc::ClientWriterInterface<W> {
};
template <class W, class R>
-class MockClientReaderWriter
- : public ::grpc::ClientReaderWriterInterface<W, R> {
+class MockClientReaderWriter : public grpc::ClientReaderWriterInterface<W, R> {
public:
MockClientReaderWriter() = default;
@@ -86,7 +86,7 @@ class MockClientReaderWriter
template <class R>
class MockClientAsyncResponseReader
- : public ::grpc::ClientAsyncResponseReaderInterface<R> {
+ : public grpc::ClientAsyncResponseReaderInterface<R> {
public:
MockClientAsyncResponseReader() = default;
@@ -111,7 +111,7 @@ class MockClientAsyncReader : public ClientAsyncReaderInterface<R> {
};
template <class W>
-class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> {
+class MockClientAsyncWriter : public grpc::ClientAsyncWriterInterface<W> {
public:
MockClientAsyncWriter() = default;
@@ -122,7 +122,7 @@ class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> {
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
+ MOCK_METHOD3_T(Write, void(const W&, grpc::WriteOptions, void*));
/// ClientAsyncWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
@@ -141,7 +141,7 @@ class MockClientAsyncReaderWriter
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
- MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
+ MOCK_METHOD3_T(Write, void(const W&, grpc::WriteOptions, void*));
/// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
@@ -150,6 +150,47 @@ class MockClientAsyncReaderWriter
MOCK_METHOD1_T(WritesDone, void(void*));
};
+template <class R>
+class MockServerReader : public grpc::ServerReaderInterface<R> {
+ public:
+ MockServerReader() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+};
+
+template <class W>
+class MockServerWriter : public grpc::ServerWriterInterface<W> {
+ public:
+ MockServerWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
+template <class W, class R>
+class MockServerReaderWriter : public grpc::ServerReaderWriterInterface<W, R> {
+ public:
+ MockServerReaderWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
} // namespace testing
} // namespace grpc
diff --git a/grpc/spm-cpp-include/grpcpp/xds_server_builder.h b/grpc/spm-cpp-include/grpcpp/xds_server_builder.h
index 076c377f..e2fde72f 100644
--- a/grpc/spm-cpp-include/grpcpp/xds_server_builder.h
+++ b/grpc/spm-cpp-include/grpcpp/xds_server_builder.h
@@ -24,10 +24,13 @@
#include <grpcpp/server_builder.h>
namespace grpc {
-namespace experimental {
class XdsServerServingStatusNotifierInterface {
public:
+ struct ServingStatusUpdate {
+ grpc::Status status;
+ };
+
virtual ~XdsServerServingStatusNotifierInterface() = default;
// \a uri contains the listening target associated with the notification. Note
@@ -37,11 +40,30 @@ class XdsServerServingStatusNotifierInterface {
// The API does not provide any guarantees around duplicate updates.
// Status::OK signifies that the server is serving, while a non-OK status
// signifies that the server is not serving.
- virtual void OnServingStatusUpdate(std::string uri, grpc::Status status) = 0;
+ virtual void OnServingStatusUpdate(std::string uri,
+ ServingStatusUpdate update) = 0;
};
-class XdsServerBuilder : public ::grpc::ServerBuilder {
+class XdsServerBuilder : public grpc::ServerBuilder {
public:
+ // NOTE: class experimental_type is not part of the public API of this class
+ // TODO(yashykt): Integrate into public API when this is no longer
+ // experimental.
+ class experimental_type : public grpc::ServerBuilder::experimental_type {
+ public:
+ explicit experimental_type(XdsServerBuilder* builder)
+ : ServerBuilder::experimental_type(builder), builder_(builder) {}
+
+ // EXPERIMENTAL: Sets the drain grace period in ms for older connections
+ // when updates to a Listener is received.
+ void set_drain_grace_time(int drain_grace_time_ms) {
+ builder_->drain_grace_time_ms_ = drain_grace_time_ms;
+ }
+
+ private:
+ XdsServerBuilder* builder_;
+ };
+
// It is the responsibility of the application to make sure that \a notifier
// outlasts the life of the server. Notifications will start being made
// asynchronously once `BuildAndStart()` has been called. Note that it is
@@ -50,10 +72,19 @@ class XdsServerBuilder : public ::grpc::ServerBuilder {
notifier_ = notifier;
}
+ /// NOTE: The function experimental() is not stable public API. It is a view
+ /// to the experimental components of this class. It may be changed or removed
+ /// at any time.
+ experimental_type experimental() { return experimental_type(this); }
+
private:
// Called at the beginning of BuildAndStart().
ChannelArguments BuildChannelArgs() override {
ChannelArguments args = ServerBuilder::BuildChannelArgs();
+ if (drain_grace_time_ms_ >= 0) {
+ args.SetInt(GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS,
+ drain_grace_time_ms_);
+ }
grpc_channel_args c_channel_args = args.c_channel_args();
grpc_server_config_fetcher* fetcher = grpc_server_config_fetcher_xds_create(
{OnServingStatusUpdate, notifier_}, &c_channel_args);
@@ -62,18 +93,30 @@ class XdsServerBuilder : public ::grpc::ServerBuilder {
}
static void OnServingStatusUpdate(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message) {
+ grpc_serving_status_update update) {
if (user_data == nullptr) return;
XdsServerServingStatusNotifierInterface* notifier =
static_cast<XdsServerServingStatusNotifierInterface*>(user_data);
notifier->OnServingStatusUpdate(
- uri, grpc::Status(static_cast<StatusCode>(code), error_message));
+ uri, {grpc::Status(static_cast<StatusCode>(update.code),
+ update.error_message)});
}
XdsServerServingStatusNotifierInterface* notifier_ = nullptr;
+ int drain_grace_time_ms_ = -1;
};
+namespace experimental {
+// TODO(yashykt): Delete this after the 1.42 release.
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerServingStatusNotifierInterface instead. The "
+ "experimental version will be deleted after the 1.42 release.")
+typedef grpc::XdsServerServingStatusNotifierInterface
+ XdsServerServingStatusNotifierInterface;
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerBuilder instead. The experimental version will be "
+ "deleted after the 1.42 release.")
+typedef grpc::XdsServerBuilder XdsServerBuilder;
} // namespace experimental
} // namespace grpc
diff --git a/grpc/src/abseil-cpp/preprocessed_builds.yaml b/grpc/src/abseil-cpp/preprocessed_builds.yaml
index 6c73dd3d..6e340d00 100644
--- a/grpc/src/abseil-cpp/preprocessed_builds.yaml
+++ b/grpc/src/abseil-cpp/preprocessed_builds.yaml
@@ -110,15 +110,6 @@
- third_party/abseil-cpp/absl/base/internal/errno_saver.h
name: absl/base:errno_saver
src: []
-- cmake_target: absl::exponential_biased
- deps:
- - absl/base:config
- - absl/base:core_headers
- headers:
- - third_party/abseil-cpp/absl/base/internal/exponential_biased.h
- name: absl/base:exponential_biased
- src:
- - third_party/abseil-cpp/absl/base/internal/exponential_biased.cc
- cmake_target: absl::fast_type_id
deps:
- absl/base:config
@@ -149,15 +140,6 @@
name: absl/base:malloc_internal
src:
- third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc
-- cmake_target: absl::periodic_sampler
- deps:
- - absl/base:core_headers
- - absl/base:exponential_biased
- headers:
- - third_party/abseil-cpp/absl/base/internal/periodic_sampler.h
- name: absl/base:periodic_sampler
- src:
- - third_party/abseil-cpp/absl/base/internal/periodic_sampler.cc
- cmake_target: absl::pretty_function
deps: []
headers:
@@ -343,10 +325,11 @@
deps:
- absl/base:base
- absl/base:core_headers
- - absl/base:exponential_biased
- absl/container:have_sse
- absl/debugging:stacktrace
- absl/memory:memory
+ - absl/profiling:exponential_biased
+ - absl/profiling:sample_recorder
- absl/synchronization:synchronization
- absl/utility:utility
headers:
@@ -446,7 +429,6 @@
- absl/container:hashtable_debug_hooks
- absl/container:hashtablez_sampler
- absl/container:have_sse
- - absl/container:layout
- absl/memory:memory
- absl/meta:type_traits
- absl/numeric:bits
@@ -533,8 +515,10 @@
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
+ - third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc
+ - third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc
- third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc
@@ -558,6 +542,7 @@
- third_party/abseil-cpp/absl/debugging/symbolize.h
- third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc
- third_party/abseil-cpp/absl/debugging/symbolize_elf.inc
+ - third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc
- third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc
- third_party/abseil-cpp/absl/debugging/symbolize_win32.inc
name: absl/debugging:symbolize
@@ -610,6 +595,7 @@
headers:
- third_party/abseil-cpp/absl/flags/declare.h
- third_party/abseil-cpp/absl/flags/flag.h
+ - third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc
name: absl/flags:flag
src:
- third_party/abseil-cpp/absl/flags/flag.cc
@@ -732,6 +718,7 @@
deps:
- absl/base:config
- absl/base:core_headers
+ - absl/container:flat_hash_map
- absl/flags:commandlineflag
- absl/flags:config
- absl/flags:flag
@@ -760,6 +747,7 @@
- cmake_target: absl::function_ref
deps:
- absl/base:base_internal
+ - absl/base:core_headers
- absl/meta:type_traits
headers:
- third_party/abseil-cpp/absl/functional/function_ref.h
@@ -783,7 +771,7 @@
- absl/base:endian
- absl/container:fixed_array
- absl/hash:city
- - absl/hash:wyhash
+ - absl/hash:low_level_hash
- absl/meta:type_traits
- absl/numeric:int128
- absl/strings:strings
@@ -796,16 +784,17 @@
name: absl/hash:hash
src:
- third_party/abseil-cpp/absl/hash/internal/hash.cc
-- cmake_target: absl::wyhash
+- cmake_target: absl::low_level_hash
deps:
- absl/base:config
- absl/base:endian
+ - absl/numeric:bits
- absl/numeric:int128
headers:
- - third_party/abseil-cpp/absl/hash/internal/wyhash.h
- name: absl/hash:wyhash
+ - third_party/abseil-cpp/absl/hash/internal/low_level_hash.h
+ name: absl/hash:low_level_hash
src:
- - third_party/abseil-cpp/absl/hash/internal/wyhash.cc
+ - third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc
- cmake_target: absl::memory
deps:
- absl/base:core_headers
@@ -849,6 +838,34 @@
- third_party/abseil-cpp/absl/numeric/internal/representation.h
name: absl/numeric:representation
src: []
+- cmake_target: absl::exponential_biased
+ deps:
+ - absl/base:config
+ - absl/base:core_headers
+ headers:
+ - third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h
+ name: absl/profiling:exponential_biased
+ src:
+ - third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc
+- cmake_target: absl::periodic_sampler
+ deps:
+ - absl/base:core_headers
+ - absl/profiling:exponential_biased
+ headers:
+ - third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h
+ name: absl/profiling:periodic_sampler
+ src:
+ - third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.cc
+- cmake_target: absl::sample_recorder
+ deps:
+ - absl/base:config
+ - absl/base:core_headers
+ - absl/synchronization:synchronization
+ - absl/time:time
+ headers:
+ - third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h
+ name: absl/profiling:sample_recorder
+ src: []
- cmake_target: absl::random_internal_distribution_caller
deps:
- absl/base:config
@@ -998,6 +1015,7 @@
deps:
- absl/base:config
- absl/base:core_headers
+ - absl/numeric:int128
- absl/random/internal:platform
headers:
- third_party/abseil-cpp/absl/random/internal/randen_hwaes.h
@@ -1008,6 +1026,8 @@
deps:
- absl/base:config
- absl/base:core_headers
+ - absl/base:endian
+ - absl/numeric:int128
- absl/random/internal:platform
headers:
- third_party/abseil-cpp/absl/random/internal/randen_slow.h
@@ -1028,6 +1048,7 @@
- cmake_target: absl::random_internal_seed_material
deps:
- absl/base:core_headers
+ - absl/base:dynamic_annotations
- absl/base:raw_logging_internal
- absl/random/internal:fast_uniform_bits
- absl/strings:strings
@@ -1151,6 +1172,7 @@
- absl/container:inlined_vector
- absl/debugging:stacktrace
- absl/debugging:symbolize
+ - absl/functional:function_ref
- absl/strings:cord
- absl/strings:str_format
- absl/strings:strings
@@ -1165,6 +1187,7 @@
- third_party/abseil-cpp/absl/status/status_payload_printer.cc
- cmake_target: absl::statusor
deps:
+ - absl/base:base
- absl/base:core_headers
- absl/base:raw_logging_internal
- absl/meta:type_traits
@@ -1181,6 +1204,7 @@
- cmake_target: absl::cord
deps:
- absl/base:base
+ - absl/base:config
- absl/base:core_headers
- absl/base:endian
- absl/base:raw_logging_internal
@@ -1189,6 +1213,11 @@
- absl/functional:function_ref
- absl/meta:type_traits
- absl/strings:cord_internal
+ - absl/strings:cordz_functions
+ - absl/strings:cordz_info
+ - absl/strings:cordz_statistics
+ - absl/strings:cordz_update_scope
+ - absl/strings:cordz_update_tracker
- absl/strings:internal
- absl/strings:str_format
- absl/strings:strings
@@ -1198,7 +1227,7 @@
name: absl/strings:cord
src:
- third_party/abseil-cpp/absl/strings/cord.cc
-- cmake_target: absl::cord
+- cmake_target: absl::cord_internal
deps:
- absl/base:base_internal
- absl/base:config
@@ -1209,17 +1238,105 @@
- absl/container:compressed_tuple
- absl/container:inlined_vector
- absl/container:layout
+ - absl/functional:function_ref
- absl/meta:type_traits
- absl/strings:strings
+ - absl/types:span
headers:
- third_party/abseil-cpp/absl/strings/internal/cord_internal.h
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h
- third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h
- third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h
- third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h
name: absl/strings:cord_internal
src:
- third_party/abseil-cpp/absl/strings/internal/cord_internal.cc
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc
+ - third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc
- third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc
+- cmake_target: absl::cordz_functions
+ deps:
+ - absl/base:config
+ - absl/base:core_headers
+ - absl/base:raw_logging_internal
+ - absl/profiling:exponential_biased
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_functions.h
+ name: absl/strings:cordz_functions
+ src:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc
+- cmake_target: absl::cordz_handle
+ deps:
+ - absl/base:base
+ - absl/base:config
+ - absl/base:raw_logging_internal
+ - absl/synchronization:synchronization
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_handle.h
+ name: absl/strings:cordz_handle
+ src:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc
+- cmake_target: absl::cordz_info
+ deps:
+ - absl/base:base
+ - absl/base:config
+ - absl/base:core_headers
+ - absl/base:raw_logging_internal
+ - absl/container:inlined_vector
+ - absl/debugging:stacktrace
+ - absl/strings:cord_internal
+ - absl/strings:cordz_functions
+ - absl/strings:cordz_handle
+ - absl/strings:cordz_statistics
+ - absl/strings:cordz_update_tracker
+ - absl/synchronization:synchronization
+ - absl/types:span
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_info.h
+ name: absl/strings:cordz_info
+ src:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_info.cc
+- cmake_target: absl::cordz_sample_token
+ deps:
+ - absl/base:config
+ - absl/strings:cordz_handle
+ - absl/strings:cordz_info
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h
+ name: absl/strings:cordz_sample_token
+ src:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.cc
+- cmake_target: absl::cordz_statistics
+ deps:
+ - absl/base:config
+ - absl/strings:cordz_update_tracker
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h
+ name: absl/strings:cordz_statistics
+ src: []
+- cmake_target: absl::cordz_update_scope
+ deps:
+ - absl/base:config
+ - absl/base:core_headers
+ - absl/strings:cord_internal
+ - absl/strings:cordz_info
+ - absl/strings:cordz_update_tracker
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h
+ name: absl/strings:cordz_update_scope
+ src: []
+- cmake_target: absl::cordz_update_tracker
+ deps:
+ - absl/base:config
+ headers:
+ - third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h
+ name: absl/strings:cordz_update_tracker
+ src: []
- cmake_target: absl::strings_internal
deps:
- absl/base:config
diff --git a/grpc/src/boringssl/boringssl_prefix_symbols.h b/grpc/src/boringssl/boringssl_prefix_symbols.h
index 1991903f..66f866e4 100644
--- a/grpc/src/boringssl/boringssl_prefix_symbols.h
+++ b/grpc/src/boringssl/boringssl_prefix_symbols.h
@@ -1,4 +1,4 @@
-// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: 688fc5cf5428868679d2ae1072cad81055752068
+// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: b9232f9e27e5668bc0414879dcdedb2a59ea75f2
// Copyright (c) 2018, Google Inc.
//
@@ -88,7 +88,6 @@
#define SSL_CTX_get0_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get0_param)
#define SSL_CTX_get0_privatekey BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get0_privatekey)
#define SSL_CTX_get_cert_store BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get_cert_store)
-#define SSL_CTX_get_channel_id_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get_channel_id_cb)
#define SSL_CTX_get_ciphers BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get_ciphers)
#define SSL_CTX_get_client_CA_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get_client_CA_list)
#define SSL_CTX_get_default_passwd_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_get_default_passwd_cb)
@@ -142,7 +141,7 @@
#define SSL_CTX_set1_chain BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_chain)
#define SSL_CTX_set1_curves BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_curves)
#define SSL_CTX_set1_curves_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_curves_list)
-#define SSL_CTX_set1_ech_server_config_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_ech_server_config_list)
+#define SSL_CTX_set1_ech_keys BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_ech_keys)
#define SSL_CTX_set1_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_param)
#define SSL_CTX_set1_sigalgs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_sigalgs)
#define SSL_CTX_set1_sigalgs_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set1_sigalgs_list)
@@ -155,7 +154,6 @@
#define SSL_CTX_set_cert_store BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_cert_store)
#define SSL_CTX_set_cert_verify_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_cert_verify_callback)
#define SSL_CTX_set_chain_and_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_chain_and_key)
-#define SSL_CTX_set_channel_id_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_channel_id_cb)
#define SSL_CTX_set_cipher_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_cipher_list)
#define SSL_CTX_set_client_CA_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_client_CA_list)
#define SSL_CTX_set_client_cert_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_client_cert_cb)
@@ -182,6 +180,7 @@
#define SSL_CTX_set_next_protos_advertised_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_next_protos_advertised_cb)
#define SSL_CTX_set_ocsp_response BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_ocsp_response)
#define SSL_CTX_set_options BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_options)
+#define SSL_CTX_set_permute_extensions BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_permute_extensions)
#define SSL_CTX_set_private_key_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_private_key_method)
#define SSL_CTX_set_psk_client_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_psk_client_callback)
#define SSL_CTX_set_psk_server_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_psk_server_callback)
@@ -189,6 +188,7 @@
#define SSL_CTX_set_quic_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_quic_method)
#define SSL_CTX_set_quiet_shutdown BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_quiet_shutdown)
#define SSL_CTX_set_read_ahead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_read_ahead)
+#define SSL_CTX_set_record_protocol_version BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_record_protocol_version)
#define SSL_CTX_set_retain_only_sha256_of_client_certs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_retain_only_sha256_of_client_certs)
#define SSL_CTX_set_reverify_on_resume BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_reverify_on_resume)
#define SSL_CTX_set_select_certificate_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_set_select_certificate_cb)
@@ -230,10 +230,12 @@
#define SSL_CTX_use_certificate_chain_file BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_use_certificate_chain_file)
#define SSL_CTX_use_certificate_file BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_use_certificate_file)
#define SSL_CTX_use_psk_identity_hint BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_CTX_use_psk_identity_hint)
-#define SSL_ECH_SERVER_CONFIG_LIST_add BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_SERVER_CONFIG_LIST_add)
-#define SSL_ECH_SERVER_CONFIG_LIST_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_SERVER_CONFIG_LIST_free)
-#define SSL_ECH_SERVER_CONFIG_LIST_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_SERVER_CONFIG_LIST_new)
-#define SSL_ECH_SERVER_CONFIG_LIST_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_SERVER_CONFIG_LIST_up_ref)
+#define SSL_ECH_KEYS_add BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_add)
+#define SSL_ECH_KEYS_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_free)
+#define SSL_ECH_KEYS_has_duplicate_config_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_has_duplicate_config_id)
+#define SSL_ECH_KEYS_marshal_retry_configs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_marshal_retry_configs)
+#define SSL_ECH_KEYS_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_new)
+#define SSL_ECH_KEYS_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ECH_KEYS_up_ref)
#define SSL_SESSION_copy_without_early_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_SESSION_copy_without_early_data)
#define SSL_SESSION_early_data_capable BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_SESSION_early_data_capable)
#define SSL_SESSION_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_SESSION_free)
@@ -282,6 +284,7 @@
#define SSL_alert_type_string BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_alert_type_string)
#define SSL_alert_type_string_long BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_alert_type_string_long)
#define SSL_cache_hit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_cache_hit)
+#define SSL_can_release_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_can_release_private_key)
#define SSL_certs_clear BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_certs_clear)
#define SSL_check_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_check_private_key)
#define SSL_clear BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_clear)
@@ -296,6 +299,7 @@
#define SSL_early_callback_ctx_extension_get BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_early_callback_ctx_extension_get)
#define SSL_early_data_accepted BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_early_data_accepted)
#define SSL_early_data_reason_string BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_early_data_reason_string)
+#define SSL_ech_accepted BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_ech_accepted)
#define SSL_enable_ocsp_stapling BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_enable_ocsp_stapling)
#define SSL_enable_signed_cert_timestamps BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_enable_signed_cert_timestamps)
#define SSL_enable_tls_channel_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_enable_tls_channel_id)
@@ -306,6 +310,8 @@
#define SSL_get0_alpn_selected BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_alpn_selected)
#define SSL_get0_certificate_types BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_certificate_types)
#define SSL_get0_chain_certs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_chain_certs)
+#define SSL_get0_ech_name_override BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ech_name_override)
+#define SSL_get0_ech_retry_configs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ech_retry_configs)
#define SSL_get0_next_proto_negotiated BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_next_proto_negotiated)
#define SSL_get0_ocsp_response BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ocsp_response)
#define SSL_get0_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_param)
@@ -345,7 +351,6 @@
#define SSL_get_max_proto_version BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_max_proto_version)
#define SSL_get_min_proto_version BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_min_proto_version)
#define SSL_get_mode BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_mode)
-#define SSL_get_negotiated_token_binding_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_negotiated_token_binding_param)
#define SSL_get_options BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_options)
#define SSL_get_peer_cert_chain BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_peer_cert_chain)
#define SSL_get_peer_certificate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_peer_certificate)
@@ -390,6 +395,7 @@
#define SSL_get_wfd BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_wfd)
#define SSL_get_write_sequence BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get_write_sequence)
#define SSL_has_application_settings BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_has_application_settings)
+#define SSL_has_pending BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_has_pending)
#define SSL_in_early_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_in_early_data)
#define SSL_in_false_start BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_in_false_start)
#define SSL_in_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_in_init)
@@ -397,12 +403,12 @@
#define SSL_is_init_finished BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_is_init_finished)
#define SSL_is_server BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_is_server)
#define SSL_is_signature_algorithm_rsa_pss BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_is_signature_algorithm_rsa_pss)
-#define SSL_is_token_binding_negotiated BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_is_token_binding_negotiated)
#define SSL_key_update BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_key_update)
#define SSL_library_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_library_init)
#define SSL_load_client_CA_file BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_load_client_CA_file)
#define SSL_load_error_strings BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_load_error_strings)
#define SSL_magic_pending_session_ptr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_magic_pending_session_ptr)
+#define SSL_marshal_ech_config BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_marshal_ech_config)
#define SSL_max_seal_overhead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_max_seal_overhead)
#define SSL_need_tmp_RSA BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_need_tmp_RSA)
#define SSL_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_new)
@@ -434,6 +440,7 @@
#define SSL_set1_curves BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_curves)
#define SSL_set1_curves_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_curves_list)
#define SSL_set1_delegated_credential BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_delegated_credential)
+#define SSL_set1_ech_config_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_ech_config_list)
#define SSL_set1_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_param)
#define SSL_set1_sigalgs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_sigalgs)
#define SSL_set1_sigalgs_list BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set1_sigalgs_list)
@@ -467,6 +474,7 @@
#define SSL_set_mtu BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_mtu)
#define SSL_set_ocsp_response BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_ocsp_response)
#define SSL_set_options BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_options)
+#define SSL_set_permute_extensions BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_permute_extensions)
#define SSL_set_private_key_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_private_key_method)
#define SSL_set_psk_client_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_psk_client_callback)
#define SSL_set_psk_server_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_psk_server_callback)
@@ -499,12 +507,10 @@
#define SSL_set_tmp_ecdh BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_tmp_ecdh)
#define SSL_set_tmp_rsa BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_tmp_rsa)
#define SSL_set_tmp_rsa_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_tmp_rsa_callback)
-#define SSL_set_token_binding_params BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_token_binding_params)
#define SSL_set_trust BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_trust)
#define SSL_set_verify BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_verify)
#define SSL_set_verify_algorithm_prefs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_verify_algorithm_prefs)
#define SSL_set_verify_depth BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_verify_depth)
-#define SSL_set_verify_result BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_verify_result)
#define SSL_set_wfd BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_set_wfd)
#define SSL_shutdown BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_shutdown)
#define SSL_state BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_state)
@@ -605,6 +611,7 @@
#define ASN1_BIT_STRING_get_bit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_get_bit)
#define ASN1_BIT_STRING_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_it)
#define ASN1_BIT_STRING_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_new)
+#define ASN1_BIT_STRING_num_bytes BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_num_bytes)
#define ASN1_BIT_STRING_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_set)
#define ASN1_BIT_STRING_set_bit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BIT_STRING_set_bit)
#define ASN1_BMPSTRING_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_BMPSTRING_free)
@@ -666,7 +673,6 @@
#define ASN1_SET_ANY_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_SET_ANY_it)
#define ASN1_STRING_TABLE_add BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_TABLE_add)
#define ASN1_STRING_TABLE_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_TABLE_cleanup)
-#define ASN1_STRING_TABLE_get BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_TABLE_get)
#define ASN1_STRING_cmp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_cmp)
#define ASN1_STRING_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_copy)
#define ASN1_STRING_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_STRING_data)
@@ -726,7 +732,6 @@
#define ASN1_VISIBLESTRING_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_VISIBLESTRING_it)
#define ASN1_VISIBLESTRING_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_VISIBLESTRING_new)
#define ASN1_digest BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_digest)
-#define ASN1_generate_nconf BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_generate_nconf)
#define ASN1_generate_v3 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_generate_v3)
#define ASN1_get_object BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_get_object)
#define ASN1_item_d2i BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ASN1_item_d2i)
@@ -1030,6 +1035,7 @@
#define CBB_add_u64le BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_add_u64le)
#define CBB_add_u8 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_add_u8)
#define CBB_add_u8_length_prefixed BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_add_u8_length_prefixed)
+#define CBB_add_zeros BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_add_zeros)
#define CBB_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_cleanup)
#define CBB_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_data)
#define CBB_did_write BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBB_did_write)
@@ -1075,6 +1081,7 @@
#define CBS_get_u64le BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_get_u64le)
#define CBS_get_u8 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_get_u8)
#define CBS_get_u8_length_prefixed BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_get_u8_length_prefixed)
+#define CBS_get_until_first BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_get_until_first)
#define CBS_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_init)
#define CBS_is_unsigned_asn1_integer BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_is_unsigned_asn1_integer)
#define CBS_is_valid_asn1_bitstring BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CBS_is_valid_asn1_bitstring)
@@ -1111,6 +1118,7 @@
#define CRYPTO_BUFFER_len BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_BUFFER_len)
#define CRYPTO_BUFFER_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_BUFFER_new)
#define CRYPTO_BUFFER_new_from_CBS BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_BUFFER_new_from_CBS)
+#define CRYPTO_BUFFER_new_from_static_data_unsafe BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_BUFFER_new_from_static_data_unsafe)
#define CRYPTO_BUFFER_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_BUFFER_up_ref)
#define CRYPTO_MUTEX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_MUTEX_cleanup)
#define CRYPTO_MUTEX_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_MUTEX_init)
@@ -1139,6 +1147,7 @@
#define CRYPTO_ctr128_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_ctr128_encrypt)
#define CRYPTO_ctr128_encrypt_ctr32 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_ctr128_encrypt_ctr32)
#define CRYPTO_fork_detect_ignore_madv_wipeonfork_for_testing BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_fork_detect_ignore_madv_wipeonfork_for_testing)
+#define CRYPTO_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_free)
#define CRYPTO_free_ex_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_free_ex_data)
#define CRYPTO_gcm128_aad BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_gcm128_aad)
#define CRYPTO_gcm128_decrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_gcm128_decrypt)
@@ -1164,6 +1173,7 @@
#define CRYPTO_init_sysrand BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_init_sysrand)
#define CRYPTO_is_confidential_build BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_is_confidential_build)
#define CRYPTO_library_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_library_init)
+#define CRYPTO_malloc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_malloc)
#define CRYPTO_malloc_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_malloc_init)
#define CRYPTO_memcmp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_memcmp)
#define CRYPTO_new_ex_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_new_ex_data)
@@ -1176,6 +1186,7 @@
#define CRYPTO_pre_sandbox_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_pre_sandbox_init)
#define CRYPTO_rdrand BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_rdrand)
#define CRYPTO_rdrand_multiple8_buf BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_rdrand_multiple8_buf)
+#define CRYPTO_realloc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_realloc)
#define CRYPTO_refcount_dec_and_test_zero BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_refcount_dec_and_test_zero)
#define CRYPTO_refcount_inc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_refcount_inc)
#define CRYPTO_set_add_lock_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_set_add_lock_callback)
@@ -1187,6 +1198,7 @@
#define CRYPTO_set_locking_callback BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_set_locking_callback)
#define CRYPTO_set_thread_local BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_set_thread_local)
#define CRYPTO_sysrand BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_sysrand)
+#define CRYPTO_sysrand_for_seed BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_sysrand_for_seed)
#define CRYPTO_sysrand_if_available BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_sysrand_if_available)
#define CRYPTO_tls1_prf BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CRYPTO_tls1_prf)
#define CTR_DRBG_clear BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, CTR_DRBG_clear)
@@ -1244,9 +1256,11 @@
#define DIST_POINT_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DIST_POINT_new)
#define DIST_POINT_set_dpname BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DIST_POINT_set_dpname)
#define DSA_SIG_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_free)
+#define DSA_SIG_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_get0)
#define DSA_SIG_marshal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_marshal)
#define DSA_SIG_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_new)
#define DSA_SIG_parse BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_parse)
+#define DSA_SIG_set0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_SIG_set0)
#define DSA_check_signature BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_check_signature)
#define DSA_do_check_signature BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_do_check_signature)
#define DSA_do_sign BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DSA_do_sign)
@@ -1473,6 +1487,7 @@
#define EVP_CIPHER_mode BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CIPHER_mode)
#define EVP_CIPHER_nid BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CIPHER_nid)
#define EVP_Cipher BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_Cipher)
+#define EVP_CipherFinal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CipherFinal)
#define EVP_CipherFinal_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CipherFinal_ex)
#define EVP_CipherInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CipherInit)
#define EVP_CipherInit_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_CipherInit_ex)
@@ -1483,6 +1498,7 @@
#define EVP_DecodeInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecodeInit)
#define EVP_DecodeUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecodeUpdate)
#define EVP_DecodedLength BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecodedLength)
+#define EVP_DecryptFinal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecryptFinal)
#define EVP_DecryptFinal_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecryptFinal_ex)
#define EVP_DecryptInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecryptInit)
#define EVP_DecryptInit_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DecryptInit_ex)
@@ -1502,31 +1518,45 @@
#define EVP_DigestVerifyFinal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DigestVerifyFinal)
#define EVP_DigestVerifyInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DigestVerifyInit)
#define EVP_DigestVerifyUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_DigestVerifyUpdate)
+#define EVP_ENCODE_CTX_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_ENCODE_CTX_free)
+#define EVP_ENCODE_CTX_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_ENCODE_CTX_new)
#define EVP_EncodeBlock BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncodeBlock)
#define EVP_EncodeFinal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncodeFinal)
#define EVP_EncodeInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncodeInit)
#define EVP_EncodeUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncodeUpdate)
#define EVP_EncodedLength BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncodedLength)
+#define EVP_EncryptFinal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptFinal)
#define EVP_EncryptFinal_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptFinal_ex)
#define EVP_EncryptInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptInit)
#define EVP_EncryptInit_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptInit_ex)
#define EVP_EncryptUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptUpdate)
+#define EVP_HPKE_AEAD_aead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_AEAD_aead)
+#define EVP_HPKE_AEAD_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_AEAD_id)
+#define EVP_HPKE_CTX_aead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_aead)
#define EVP_HPKE_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_cleanup)
#define EVP_HPKE_CTX_export BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_export)
-#define EVP_HPKE_CTX_get_aead_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_get_aead_id)
-#define EVP_HPKE_CTX_get_kdf_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_get_kdf_id)
-#define EVP_HPKE_CTX_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_init)
+#define EVP_HPKE_CTX_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_free)
+#define EVP_HPKE_CTX_kdf BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_kdf)
#define EVP_HPKE_CTX_max_overhead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_max_overhead)
+#define EVP_HPKE_CTX_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_new)
#define EVP_HPKE_CTX_open BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_open)
#define EVP_HPKE_CTX_seal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_seal)
-#define EVP_HPKE_CTX_setup_base_r_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_r_x25519)
-#define EVP_HPKE_CTX_setup_base_s_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519)
-#define EVP_HPKE_CTX_setup_base_s_x25519_for_test BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519_for_test)
-#define EVP_HPKE_CTX_setup_psk_r_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_psk_r_x25519)
-#define EVP_HPKE_CTX_setup_psk_s_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_psk_s_x25519)
-#define EVP_HPKE_CTX_setup_psk_s_x25519_for_test BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_psk_s_x25519_for_test)
-#define EVP_HPKE_get_aead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_get_aead)
-#define EVP_HPKE_get_hkdf_md BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_get_hkdf_md)
+#define EVP_HPKE_CTX_setup_recipient BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_recipient)
+#define EVP_HPKE_CTX_setup_sender BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_sender)
+#define EVP_HPKE_CTX_setup_sender_with_seed_for_testing BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_sender_with_seed_for_testing)
+#define EVP_HPKE_CTX_zero BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_zero)
+#define EVP_HPKE_KDF_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KDF_id)
+#define EVP_HPKE_KEM_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEM_id)
+#define EVP_HPKE_KEY_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_cleanup)
+#define EVP_HPKE_KEY_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_copy)
+#define EVP_HPKE_KEY_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_free)
+#define EVP_HPKE_KEY_generate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_generate)
+#define EVP_HPKE_KEY_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_init)
+#define EVP_HPKE_KEY_kem BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_kem)
+#define EVP_HPKE_KEY_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_new)
+#define EVP_HPKE_KEY_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_private_key)
+#define EVP_HPKE_KEY_public_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_public_key)
+#define EVP_HPKE_KEY_zero BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_KEY_zero)
#define EVP_MD_CTX_block_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_block_size)
#define EVP_MD_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_cleanup)
#define EVP_MD_CTX_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_copy)
@@ -1536,6 +1566,7 @@
#define EVP_MD_CTX_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_free)
#define EVP_MD_CTX_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_init)
#define EVP_MD_CTX_md BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_md)
+#define EVP_MD_CTX_move BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_move)
#define EVP_MD_CTX_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_new)
#define EVP_MD_CTX_reset BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_reset)
#define EVP_MD_CTX_set_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_set_flags)
@@ -1544,6 +1575,7 @@
#define EVP_MD_block_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_block_size)
#define EVP_MD_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_flags)
#define EVP_MD_meth_get_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_meth_get_flags)
+#define EVP_MD_nid BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_nid)
#define EVP_MD_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_size)
#define EVP_MD_type BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_type)
#define EVP_PBE_scrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PBE_scrypt)
@@ -1591,6 +1623,7 @@
#define EVP_PKEY_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_encrypt)
#define EVP_PKEY_encrypt_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_encrypt_init)
#define EVP_PKEY_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_free)
+#define EVP_PKEY_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_get0)
#define EVP_PKEY_get0_DH BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_get0_DH)
#define EVP_PKEY_get0_DSA BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_get0_DSA)
#define EVP_PKEY_get0_EC_KEY BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_PKEY_get0_EC_KEY)
@@ -1694,6 +1727,11 @@
#define EVP_get_digestbynid BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_get_digestbynid)
#define EVP_get_digestbyobj BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_get_digestbyobj)
#define EVP_has_aes_hardware BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_has_aes_hardware)
+#define EVP_hpke_aes_128_gcm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_hpke_aes_128_gcm)
+#define EVP_hpke_aes_256_gcm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_hpke_aes_256_gcm)
+#define EVP_hpke_chacha20_poly1305 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_hpke_chacha20_poly1305)
+#define EVP_hpke_hkdf_sha256 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_hpke_hkdf_sha256)
+#define EVP_hpke_x25519_hkdf_sha256 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_hpke_x25519_hkdf_sha256)
#define EVP_marshal_digest_algorithm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_marshal_digest_algorithm)
#define EVP_marshal_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_marshal_private_key)
#define EVP_marshal_public_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_marshal_public_key)
@@ -1835,6 +1873,14 @@
#define OPENSSL_hash32 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_hash32)
#define OPENSSL_ia32cap_P BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_ia32cap_P)
#define OPENSSL_init_crypto BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_init_crypto)
+#define OPENSSL_lh_delete BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_delete)
+#define OPENSSL_lh_doall_arg BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_doall_arg)
+#define OPENSSL_lh_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_free)
+#define OPENSSL_lh_insert BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_insert)
+#define OPENSSL_lh_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_new)
+#define OPENSSL_lh_num_items BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_num_items)
+#define OPENSSL_lh_retrieve BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_retrieve)
+#define OPENSSL_lh_retrieve_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_lh_retrieve_key)
#define OPENSSL_load_builtin_modules BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_load_builtin_modules)
#define OPENSSL_malloc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_malloc)
#define OPENSSL_malloc_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_malloc_init)
@@ -1843,6 +1889,7 @@
#define OPENSSL_realloc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_realloc)
#define OPENSSL_strcasecmp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strcasecmp)
#define OPENSSL_strdup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strdup)
+#define OPENSSL_strhash BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strhash)
#define OPENSSL_strlcat BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strlcat)
#define OPENSSL_strlcpy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strlcpy)
#define OPENSSL_strncasecmp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, OPENSSL_strncasecmp)
@@ -1965,6 +2012,7 @@
#define PKCS5_pbe2_encrypt_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS5_pbe2_encrypt_init)
#define PKCS7_bundle_CRLs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_bundle_CRLs)
#define PKCS7_bundle_certificates BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_bundle_certificates)
+#define PKCS7_bundle_raw_certificates BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_bundle_raw_certificates)
#define PKCS7_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_free)
#define PKCS7_get_CRLs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_get_CRLs)
#define PKCS7_get_PEM_CRLs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS7_get_PEM_CRLs)
@@ -2052,6 +2100,7 @@
#define RSA_get0_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get0_key)
#define RSA_get0_n BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get0_n)
#define RSA_get0_p BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get0_p)
+#define RSA_get0_pss_params BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get0_pss_params)
#define RSA_get0_q BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get0_q)
#define RSA_get_ex_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get_ex_data)
#define RSA_get_ex_new_index BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_get_ex_new_index)
@@ -2269,6 +2318,8 @@
#define X509_CRL_print_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_print_fp)
#define X509_CRL_set1_lastUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_lastUpdate)
#define X509_CRL_set1_nextUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_nextUpdate)
+#define X509_CRL_set1_signature_algo BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_signature_algo)
+#define X509_CRL_set1_signature_value BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_signature_value)
#define X509_CRL_set_default_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_default_method)
#define X509_CRL_set_issuer_name BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_issuer_name)
#define X509_CRL_set_meth_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_meth_data)
@@ -2492,7 +2543,6 @@
#define X509_STORE_get_verify_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_get_verify_cb)
#define X509_STORE_load_locations BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_load_locations)
#define X509_STORE_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_new)
-#define X509_STORE_set0_additional_untrusted BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set0_additional_untrusted)
#define X509_STORE_set1_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set1_param)
#define X509_STORE_set_cert_crl BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_cert_crl)
#define X509_STORE_set_check_crl BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_check_crl)
@@ -2687,7 +2737,6 @@
#define X509at_add1_attr_by_OBJ BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_add1_attr_by_OBJ)
#define X509at_add1_attr_by_txt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_add1_attr_by_txt)
#define X509at_delete_attr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_delete_attr)
-#define X509at_get0_data_by_OBJ BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_get0_data_by_OBJ)
#define X509at_get_attr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_get_attr)
#define X509at_get_attr_by_NID BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_get_attr_by_NID)
#define X509at_get_attr_by_OBJ BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509at_get_attr_by_OBJ)
@@ -2702,7 +2751,6 @@
#define a2i_GENERAL_NAME BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, a2i_GENERAL_NAME)
#define a2i_IPADDRESS BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, a2i_IPADDRESS)
#define a2i_IPADDRESS_NC BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, a2i_IPADDRESS_NC)
-#define a2i_ipadd BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, a2i_ipadd)
#define abi_test_bad_unwind_temporary BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, abi_test_bad_unwind_temporary)
#define abi_test_bad_unwind_wrong_register BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, abi_test_bad_unwind_wrong_register)
#define abi_test_clobber_r10 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, abi_test_clobber_r10)
@@ -2776,6 +2824,7 @@
#define aesgcmsiv_polyval_horner BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, aesgcmsiv_polyval_horner)
#define aesni_gcm_decrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, aesni_gcm_decrypt)
#define aesni_gcm_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, aesni_gcm_encrypt)
+#define asn1_bit_string_length BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_bit_string_length)
#define asn1_do_adb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_do_adb)
#define asn1_enc_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_enc_free)
#define asn1_enc_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_enc_init)
@@ -2784,6 +2833,8 @@
#define asn1_generalizedtime_to_tm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_generalizedtime_to_tm)
#define asn1_get_choice_selector BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_get_choice_selector)
#define asn1_get_field_ptr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_get_field_ptr)
+#define asn1_get_string_table_for_testing BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_get_string_table_for_testing)
+#define asn1_is_printable BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_is_printable)
#define asn1_item_combine_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_item_combine_free)
#define asn1_refcount_dec_and_test_zero BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_refcount_dec_and_test_zero)
#define asn1_refcount_set_one BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, asn1_refcount_set_one)
@@ -3266,22 +3317,13 @@
#define kOpenSSLReasonValuesLen BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, kOpenSSLReasonValuesLen)
#define level_add_node BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, level_add_node)
#define level_find_node BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, level_find_node)
-#define lh_delete BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_delete)
-#define lh_doall_arg BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_doall_arg)
-#define lh_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_free)
-#define lh_insert BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_insert)
-#define lh_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_new)
-#define lh_num_items BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_num_items)
-#define lh_retrieve BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_retrieve)
-#define lh_retrieve_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_retrieve_key)
-#define lh_strhash BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, lh_strhash)
#define md4_block_data_order BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, md4_block_data_order)
#define md5_block_asm_data_order BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, md5_block_asm_data_order)
#define o2i_ECPublicKey BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, o2i_ECPublicKey)
#define pkcs12_iterations_acceptable BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs12_iterations_acceptable)
#define pkcs12_key_gen BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs12_key_gen)
#define pkcs12_pbe_encrypt_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs12_pbe_encrypt_init)
-#define pkcs7_bundle BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs7_bundle)
+#define pkcs7_add_signed_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs7_add_signed_data)
#define pkcs7_parse_header BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs7_parse_header)
#define pkcs8_pbe_decrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pkcs8_pbe_decrypt)
#define pmbtoken_exp1_blind BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, pmbtoken_exp1_blind)
@@ -3406,11 +3448,13 @@
#define x25519_ge_tobytes BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x25519_ge_tobytes)
#define x25519_pkey_meth BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x25519_pkey_meth)
#define x25519_sc_reduce BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x25519_sc_reduce)
+#define x509V3_add_value_asn1_string BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509V3_add_value_asn1_string)
#define x509_digest_sign_algorithm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509_digest_sign_algorithm)
#define x509_digest_verify_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509_digest_verify_init)
#define x509_print_rsa_pss_params BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509_print_rsa_pss_params)
#define x509_rsa_ctx_to_pss BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509_rsa_ctx_to_pss)
#define x509_rsa_pss_to_ctx BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509_rsa_pss_to_ctx)
+#define x509v3_a2i_ipadd BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509v3_a2i_ipadd)
#define x509v3_bytes_to_hex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509v3_bytes_to_hex)
#define x509v3_cache_extensions BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509v3_cache_extensions)
#define x509v3_hex_to_bytes BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, x509v3_hex_to_bytes)
diff --git a/grpc/src/c-ares/gen_build_yaml.py b/grpc/src/c-ares/gen_build_yaml.py
index d12203d7..607704ca 100755
--- a/grpc/src/c-ares/gen_build_yaml.py
+++ b/grpc/src/c-ares/gen_build_yaml.py
@@ -45,9 +45,9 @@ try:
def ares_build(x):
if os.path.isfile('src/cares/cares/ares_build.h'):
return 'src/cares/cares/ares_build.h'
- if not os.path.isfile('third_party/cares/cares/ares_build.h'):
+ if not os.path.isfile('third_party/cares/cares/include/ares_build.h'):
gen_ares_build(x)
- return 'third_party/cares/cares/ares_build.h'
+ return 'third_party/cares/cares/include/ares_build.h'
out['libs'] = [{
'name':
@@ -61,81 +61,90 @@ try:
'secure':
False,
'src': [
- "third_party/cares/cares/ares__close_sockets.c",
- "third_party/cares/cares/ares__get_hostent.c",
- "third_party/cares/cares/ares__read_line.c",
- "third_party/cares/cares/ares__timeval.c",
- "third_party/cares/cares/ares_cancel.c",
- "third_party/cares/cares/ares_create_query.c",
- "third_party/cares/cares/ares_data.c",
- "third_party/cares/cares/ares_destroy.c",
- "third_party/cares/cares/ares_expand_name.c",
- "third_party/cares/cares/ares_expand_string.c",
- "third_party/cares/cares/ares_fds.c",
- "third_party/cares/cares/ares_free_hostent.c",
- "third_party/cares/cares/ares_free_string.c",
- "third_party/cares/cares/ares_getenv.c",
- "third_party/cares/cares/ares_gethostbyaddr.c",
- "third_party/cares/cares/ares_gethostbyname.c",
- "third_party/cares/cares/ares_getnameinfo.c",
- "third_party/cares/cares/ares_getopt.c",
- "third_party/cares/cares/ares_getsock.c",
- "third_party/cares/cares/ares_init.c",
- "third_party/cares/cares/ares_library_init.c",
- "third_party/cares/cares/ares_llist.c",
- "third_party/cares/cares/ares_mkquery.c",
- "third_party/cares/cares/ares_nowarn.c",
- "third_party/cares/cares/ares_options.c",
- "third_party/cares/cares/ares_parse_a_reply.c",
- "third_party/cares/cares/ares_parse_aaaa_reply.c",
- "third_party/cares/cares/ares_parse_mx_reply.c",
- "third_party/cares/cares/ares_parse_naptr_reply.c",
- "third_party/cares/cares/ares_parse_ns_reply.c",
- "third_party/cares/cares/ares_parse_ptr_reply.c",
- "third_party/cares/cares/ares_parse_soa_reply.c",
- "third_party/cares/cares/ares_parse_srv_reply.c",
- "third_party/cares/cares/ares_parse_txt_reply.c",
- "third_party/cares/cares/ares_platform.c",
- "third_party/cares/cares/ares_process.c",
- "third_party/cares/cares/ares_query.c",
- "third_party/cares/cares/ares_search.c",
- "third_party/cares/cares/ares_send.c",
- "third_party/cares/cares/ares_strcasecmp.c",
- "third_party/cares/cares/ares_strdup.c",
- "third_party/cares/cares/ares_strerror.c",
- "third_party/cares/cares/ares_strsplit.c",
- "third_party/cares/cares/ares_timeout.c",
- "third_party/cares/cares/ares_version.c",
- "third_party/cares/cares/ares_writev.c",
- "third_party/cares/cares/bitncmp.c",
- "third_party/cares/cares/inet_net_pton.c",
- "third_party/cares/cares/inet_ntop.c",
- "third_party/cares/cares/windows_port.c",
+ "third_party/cares/cares/src/lib/ares_init.c",
+ "third_party/cares/cares/src/lib/ares_expand_string.c",
+ "third_party/cares/cares/src/lib/ares_strcasecmp.c",
+ "third_party/cares/cares/src/lib/ares_destroy.c",
+ "third_party/cares/cares/src/lib/ares_free_string.c",
+ "third_party/cares/cares/src/lib/ares__timeval.c",
+ "third_party/cares/cares/src/lib/ares_library_init.c",
+ "third_party/cares/cares/src/lib/ares_getsock.c",
+ "third_party/cares/cares/src/lib/ares_process.c",
+ "third_party/cares/cares/src/lib/ares_create_query.c",
+ "third_party/cares/cares/src/lib/ares_fds.c",
+ "third_party/cares/cares/src/lib/ares_gethostbyname.c",
+ "third_party/cares/cares/src/lib/ares_mkquery.c",
+ "third_party/cares/cares/src/lib/ares_freeaddrinfo.c",
+ "third_party/cares/cares/src/lib/ares_strdup.c",
+ "third_party/cares/cares/src/lib/ares_timeout.c",
+ "third_party/cares/cares/src/lib/ares_getnameinfo.c",
+ "third_party/cares/cares/src/lib/ares_parse_soa_reply.c",
+ "third_party/cares/cares/src/lib/ares_parse_naptr_reply.c",
+ "third_party/cares/cares/src/lib/ares_parse_a_reply.c",
+ "third_party/cares/cares/src/lib/ares_send.c",
+ "third_party/cares/cares/src/lib/ares_nowarn.c",
+ "third_party/cares/cares/src/lib/ares__sortaddrinfo.c",
+ "third_party/cares/cares/src/lib/ares_android.c",
+ "third_party/cares/cares/src/lib/ares_strerror.c",
+ "third_party/cares/cares/src/lib/ares_parse_caa_reply.c",
+ "third_party/cares/cares/src/lib/ares__close_sockets.c",
+ "third_party/cares/cares/src/lib/ares_llist.c",
+ "third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c",
+ "third_party/cares/cares/src/lib/ares_getaddrinfo.c",
+ "third_party/cares/cares/src/lib/ares_parse_ns_reply.c",
+ "third_party/cares/cares/src/lib/windows_port.c",
+ "third_party/cares/cares/src/lib/bitncmp.c",
+ "third_party/cares/cares/src/lib/ares_strsplit.c",
+ "third_party/cares/cares/src/lib/ares_data.c",
+ "third_party/cares/cares/src/lib/ares_free_hostent.c",
+ "third_party/cares/cares/src/lib/ares_platform.c",
+ "third_party/cares/cares/src/lib/ares_parse_txt_reply.c",
+ "third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c",
+ "third_party/cares/cares/src/lib/ares_gethostbyaddr.c",
+ "third_party/cares/cares/src/lib/ares_parse_srv_reply.c",
+ "third_party/cares/cares/src/lib/ares_version.c",
+ "third_party/cares/cares/src/lib/ares_getenv.c",
+ "third_party/cares/cares/src/lib/ares_search.c",
+ "third_party/cares/cares/src/lib/ares_parse_mx_reply.c",
+ "third_party/cares/cares/src/lib/ares__get_hostent.c",
+ "third_party/cares/cares/src/lib/ares__readaddrinfo.c",
+ "third_party/cares/cares/src/lib/ares_parse_ptr_reply.c",
+ "third_party/cares/cares/src/lib/ares__read_line.c",
+ "third_party/cares/cares/src/lib/ares_query.c",
+ "third_party/cares/cares/src/lib/ares_options.c",
+ "third_party/cares/cares/src/lib/inet_net_pton.c",
+ "third_party/cares/cares/src/lib/ares_expand_name.c",
+ "third_party/cares/cares/src/lib/inet_ntop.c",
+ "third_party/cares/cares/src/lib/ares_cancel.c",
+ "third_party/cares/cares/src/lib/ares_writev.c",
],
'headers': [
- "third_party/cares/cares/ares.h",
- "third_party/cares/cares/ares_data.h",
- "third_party/cares/cares/ares_dns.h",
- "third_party/cares/cares/ares_getenv.h",
- "third_party/cares/cares/ares_getopt.h",
- "third_party/cares/cares/ares_inet_net_pton.h",
- "third_party/cares/cares/ares_iphlpapi.h",
- "third_party/cares/cares/ares_ipv6.h",
- "third_party/cares/cares/ares_library_init.h",
- "third_party/cares/cares/ares_llist.h",
- "third_party/cares/cares/ares_nowarn.h",
- "third_party/cares/cares/ares_platform.h",
- "third_party/cares/cares/ares_private.h",
- "third_party/cares/cares/ares_rules.h",
- "third_party/cares/cares/ares_setup.h",
- "third_party/cares/cares/ares_strcasecmp.h",
- "third_party/cares/cares/ares_strdup.h",
- "third_party/cares/cares/ares_strsplit.h",
- "third_party/cares/cares/ares_version.h",
- "third_party/cares/cares/bitncmp.h",
- "third_party/cares/cares/config-win32.h",
- "third_party/cares/cares/setup_once.h",
"third_party/cares/ares_build.h",
+ "third_party/cares/cares/include/ares_version.h",
+ "third_party/cares/cares/include/ares.h",
+ "third_party/cares/cares/include/ares_rules.h",
+ "third_party/cares/cares/include/ares_dns.h",
+ "third_party/cares/cares/src/lib/ares_data.h",
+ "third_party/cares/cares/src/lib/ares_strsplit.h",
+ "third_party/cares/cares/src/lib/bitncmp.h",
+ "third_party/cares/cares/src/lib/ares_iphlpapi.h",
+ "third_party/cares/cares/src/lib/ares_inet_net_pton.h",
+ "third_party/cares/cares/src/lib/ares_getenv.h",
+ "third_party/cares/cares/src/lib/ares_platform.h",
+ "third_party/cares/cares/src/lib/ares_writev.h",
+ "third_party/cares/cares/src/lib/ares_private.h",
+ "third_party/cares/cares/src/lib/ares_setup.h",
+ "third_party/cares/cares/src/lib/config-win32.h",
+ "third_party/cares/cares/src/lib/ares_strcasecmp.h",
+ "third_party/cares/cares/src/lib/setup_once.h",
+ "third_party/cares/cares/src/lib/ares_ipv6.h",
+ "third_party/cares/cares/src/lib/ares_library_init.h",
+ "third_party/cares/cares/src/lib/ares_nameser.h",
+ "third_party/cares/cares/src/lib/ares_strdup.h",
+ "third_party/cares/cares/src/lib/config-dos.h",
+ "third_party/cares/cares/src/lib/ares_llist.h",
+ "third_party/cares/cares/src/lib/ares_nowarn.h",
+ "third_party/cares/cares/src/lib/ares_android.h",
"third_party/cares/config_darwin/ares_config.h",
"third_party/cares/config_freebsd/ares_config.h",
"third_party/cares/config_linux/ares_config.h",
diff --git a/grpc/src/compiler/BUILD b/grpc/src/compiler/BUILD
index c11616dc..ad40a828 100644
--- a/grpc/src/compiler/BUILD
+++ b/grpc/src/compiler/BUILD
@@ -14,9 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"])
-
-exports_files(["LICENSE"])
+load(
+ "//bazel:grpc_build_system.bzl",
+ "grpc_cc_library",
+ "grpc_proto_plugin",
+)
package(
default_visibility = ["//visibility:public"],
@@ -26,11 +28,9 @@ package(
],
)
-load(
- "//bazel:grpc_build_system.bzl",
- "grpc_cc_library",
- "grpc_proto_plugin",
-)
+licenses(["notice"])
+
+exports_files(["LICENSE"])
grpc_cc_library(
name = "grpc_plugin_support",
diff --git a/grpc/src/compiler/config.h b/grpc/src/compiler/config.h
index f25f394c..49c78755 100644
--- a/grpc/src/compiler/config.h
+++ b/grpc/src/compiler/config.h
@@ -19,10 +19,10 @@
#ifndef SRC_COMPILER_CONFIG_H
#define SRC_COMPILER_CONFIG_H
-#include "src/compiler/config_protobuf.h"
-
#include <string>
+#include "src/compiler/config_protobuf.h"
+
#ifdef GRPC_CUSTOM_STRING
#warning GRPC_CUSTOM_STRING is no longer supported. Please use std::string.
#endif
diff --git a/grpc/src/compiler/cpp_generator.cc b/grpc/src/compiler/cpp_generator.cc
index c8dff735..f5283280 100644
--- a/grpc/src/compiler/cpp_generator.cc
+++ b/grpc/src/compiler/cpp_generator.cc
@@ -16,10 +16,9 @@
*
*/
-#include <map>
-
#include "src/compiler/cpp_generator.h"
+#include <map>
#include <sstream>
namespace grpc_cpp_generator {
@@ -136,12 +135,8 @@ std::string GetHeaderIncludes(grpc_generator::File* file,
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.
static const char* headers_strs[] = {
"functional",
- "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",
@@ -584,12 +579,12 @@ void PrintHeaderClientMethodCallbackInterfacesStart(
// 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
// StubInterface, not new additions to StubInterface itself
- printer->Print("class experimental_async_interface {\n");
+ printer->Print("class async_interface {\n");
// All methods in this new interface are public. There is no need for private
// "Raw" methods since the callback-based API returns unowned raw pointers
printer->Print(" public:\n");
printer->Indent();
- printer->Print("virtual ~experimental_async_interface() {}\n");
+ printer->Print("virtual ~async_interface() {}\n");
}
void PrintHeaderClientMethodCallbackInterfaces(
@@ -604,55 +599,27 @@ 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.
printer->Print(*vars,
- "#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::experimental::ClientUnaryReactor* reactor) = 0;\n"
- "#endif\n");
+ "::grpc::ClientUnaryReactor* reactor) = 0;\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#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::experimental::ClientWriteReactor< $Request$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#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::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) = 0;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) = 0;\n");
}
}
@@ -661,31 +628,30 @@ void PrintHeaderClientMethodCallbackInterfacesEnd(
std::map<std::string, std::string>* /*vars*/) {
printer->Outdent();
printer->Print("};\n");
+ // TODO: Remove typedef when all uses of experimental_async are migrated off.
printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "typedef class experimental_async_interface async_interface;\n"
- "#endif\n");
+ "typedef class async_interface experimental_async_interface;\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
// (since any stub that wants to use it must have its own implementation of
// the callback functions therein), so make the default return value nullptr.
// Intentionally include the word "class" to avoid possible shadowing.
+ // TODO: Remove experimental_async call when possible, replace with nullptr.
printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "async_interface* async() { return experimental_async(); }\n"
- "#endif\n");
+ "virtual class async_interface* async() { return nullptr; }\n");
+
+ // TODO: Remove experimental_async call when possible.
printer->Print(
- "virtual class experimental_async_interface* experimental_async() { "
- "return nullptr; }\n");
+ "class async_interface* experimental_async() { return async(); }\n");
}
void PrintHeaderClientMethodCallbackStart(
grpc_generator::Printer* printer,
std::map<std::string, std::string>* /*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");
+ printer->Print("class async final :\n");
+ printer->Print(" public StubInterface::async_interface {\n");
printer->Print(" public:\n");
printer->Indent();
}
@@ -702,55 +668,28 @@ void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
"void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)>) override;\n");
- printer->Print(
- *vars,
- "#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::experimental::ClientUnaryReactor* reactor) override;\n"
- "#endif\n");
+ printer->Print(*vars,
+ "void $Method$(::grpc::ClientContext* context, "
+ "const $Request$* request, $Response$* response, "
+ "::grpc::ClientUnaryReactor* reactor) override;\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#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::experimental::ClientWriteReactor< $Request$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#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::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) override;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) override;\n");
}
}
@@ -761,7 +700,7 @@ void PrintHeaderClientMethodCallbackEnd(
printer->Print(" private:\n");
printer->Indent();
printer->Print("friend class Stub;\n");
- printer->Print("explicit experimental_async(Stub* stub): stub_(stub) { }\n");
+ printer->Print("explicit async(Stub* stub): stub_(stub) { }\n");
// include a function with a phony use of stub_ to avoid an unused
// private member warning for service with no methods
printer->Print("Stub* stub() { return stub_; }\n");
@@ -770,7 +709,7 @@ void PrintHeaderClientMethodCallbackEnd(
printer->Print("};\n");
printer->Print(
- "class experimental_async_interface* experimental_async() override { "
+ "class async* async() override { "
"return &async_stub_; }\n");
}
@@ -963,18 +902,10 @@ 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"
- "virtual ::grpc::experimental::ServerUnaryReactor* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/, "
- "$RealResponse$* /*response*/)\n"
- "#endif\n"
+ "$RealResponse$* /*response*/)"
" { return nullptr; }\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
@@ -988,17 +919,10 @@ 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"
- "virtual ::grpc::experimental::ServerReadReactor< "
- "$RealRequest$>* $Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, $RealResponse$* /*response*/)\n"
- "#endif\n"
+ "/*context*/, $RealResponse$* /*response*/)"
" { return nullptr; }\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
@@ -1013,16 +937,9 @@ 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"
+ "/*context*/, const $RealRequest$* /*request*/)"
" { return nullptr; }\n");
} else if (method->BidiStreaming()) {
printer->Print(
@@ -1037,16 +954,9 @@ 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"
- "virtual ::grpc::experimental::ServerBidiReactor< "
- "$RealRequest$, $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* /*context*/)\n"
- "#endif\n"
" { return nullptr; }\n");
}
}
@@ -1062,117 +972,70 @@ void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
(*vars)["RealRequest"] = method->input_type_name();
(*vars)["RealResponse"] = method->output_type_name();
printer->Print(*vars, "template <class BaseClass>\n");
- printer->Print(
- *vars,
- "class ExperimentalWithCallbackMethod_$Method$ : public BaseClass {\n");
+ printer->Print(*vars,
+ "class WithCallbackMethod_$Method$ : public BaseClass {\n");
printer->Print(
" private:\n"
" void BaseClassMustBeDerivedFromService(const Service* /*service*/) "
"{}\n");
printer->Print(" public:\n");
printer->Indent();
- printer->Print(*vars, "ExperimentalWithCallbackMethod_$Method$() {\n");
+ printer->Print(*vars, "WithCallbackMethod_$Method$() {\n");
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"
+ " ::grpc::Service::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, "
+ " ::grpc::CallbackServerContext* context, "
"const $RealRequest$* "
"request, "
"$RealResponse$* response) { "
"return this->$Method$(context, request, response); }));}\n");
printer->Print(*vars,
"void SetMessageAllocatorFor_$Method$(\n"
- " ::grpc::experimental::MessageAllocator< "
+ " ::grpc::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"
" ->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"
+ " ::grpc::Service::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, "
+ " ::grpc::CallbackServerContext* 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"
+ " ::grpc::Service::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, "
+ " ::grpc::CallbackServerContext* 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< "
- "$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");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
- "~ExperimentalWithCallbackMethod_$Method$() override {\n"
+ "~WithCallbackMethod_$Method$() override {\n"
" BaseClassMustBeDerivedFromService(this);\n"
"}\n");
PrintHeaderServerCallbackMethodsHelper(printer, method, vars);
@@ -1192,7 +1055,7 @@ void PrintHeaderServerMethodRawCallback(
(*vars)["RealResponse"] = "::grpc::ByteBuffer";
printer->Print(*vars, "template <class BaseClass>\n");
printer->Print(*vars,
- "class ExperimentalWithRawCallbackMethod_$Method$ : public "
+ "class WithRawCallbackMethod_$Method$ : public "
"BaseClass {\n");
printer->Print(
" private:\n"
@@ -1200,93 +1063,51 @@ void PrintHeaderServerMethodRawCallback(
"{}\n");
printer->Print(" public:\n");
printer->Indent();
- printer->Print(*vars, "ExperimentalWithRawCallbackMethod_$Method$() {\n");
+ printer->Print(*vars, "WithRawCallbackMethod_$Method$() {\n");
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< "
- "$RealRequest$, $RealResponse$>(\n"
- " [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 "
- "this->$Method$(context, request, response); }));\n");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackUnaryHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context, "
+ "const $RealRequest$* "
+ "request, "
+ "$RealResponse$* response) { return "
+ "this->$Method$(context, request, response); }));\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"
- " MarkMethodRawCallback($Idx$,\n"
+ " ::grpc::Service::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, "
+ " ::grpc::CallbackServerContext* 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"
+ " ::grpc::Service::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, "
+ " ::grpc::CallbackServerContext* 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< "
- "$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");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
- "~ExperimentalWithRawCallbackMethod_$Method$() override {\n"
+ "~WithRawCallbackMethod_$Method$() override {\n"
" BaseClassMustBeDerivedFromService(this);\n"
"}\n");
PrintHeaderServerCallbackMethodsHelper(printer, method, vars);
@@ -1543,7 +1364,7 @@ void PrintHeaderService(grpc_generator::Printer* printer,
}
PrintHeaderClientMethodCallbackInterfacesEnd(printer, vars);
printer->Outdent();
- printer->Print("private:\n");
+ printer->Print(" private:\n");
printer->Indent();
for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderClientMethodInterfaces(printer, service->method(i).get(), vars,
@@ -1571,7 +1392,7 @@ void PrintHeaderService(grpc_generator::Printer* printer,
printer->Print("\n private:\n");
printer->Indent();
printer->Print("std::shared_ptr< ::grpc::ChannelInterface> channel_;\n");
- printer->Print("class experimental_async async_stub_{this};\n");
+ printer->Print("class async async_stub_{this};\n");
for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderClientMethod(printer, service->method(i).get(), vars, false);
}
@@ -1624,31 +1445,21 @@ void PrintHeaderService(grpc_generator::Printer* printer,
PrintHeaderServerMethodCallback(printer, service->method(i).get(), vars);
}
- 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(*vars, "WithCallbackMethod_$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) {
- (*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");
+ // TODO: Remove following typedef once all uses of ExperimentalCallbackService
+ // are migrated to CallbackService
+ printer->Print("typedef CallbackService ExperimentalCallbackService;\n");
// Server side - Generic
for (int i = 0; i < service->method_count(); ++i) {
@@ -1894,7 +1705,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request, response);\n}\n\n");
printer->Print(*vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$("
+ "void $ns$$Service$::Stub::async::$Method$("
"::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)> f) {\n");
@@ -1906,10 +1717,10 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request, response, std::move(f));\n}\n\n");
printer->Print(*vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$("
+ "void $ns$$Service$::Stub::async::$Method$("
"::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) {\n");
+ "::grpc::ClientUnaryReactor* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackUnaryFactory::Create"
"< ::grpc::protobuf::MessageLite, "
@@ -1956,12 +1767,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, response);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::"
- "Stub::experimental_async::$Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
- "::grpc::experimental::ClientWriteReactor< $Request$>* reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::"
+ "Stub::async::$Method$(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::ClientWriteReactor< $Request$>* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackWriterFactory< "
"$Request$>::Create("
@@ -2002,12 +1812,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$(::grpc::"
- "ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::Stub::async::$Method$(::grpc::"
+ "ClientContext* context, "
+ "const $Request$* request, "
+ "::grpc::ClientReadReactor< $Response$>* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackReaderFactory< "
"$Response$>::Create("
@@ -2048,12 +1857,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$(::grpc::"
- "ClientContext* context, "
- "::grpc::experimental::ClientBidiReactor< $Request$,$Response$>* "
- "reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::Stub::async::$Method$(::grpc::"
+ "ClientContext* context, "
+ "::grpc::ClientBidiReactor< $Request$,$Response$>* "
+ "reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackReaderWriterFactory< "
"$Request$,$Response$>::Create("
diff --git a/grpc/src/compiler/cpp_plugin.h b/grpc/src/compiler/cpp_plugin.h
index a3a0f339..3d6f19e4 100644
--- a/grpc/src/compiler/cpp_plugin.h
+++ b/grpc/src/compiler/cpp_plugin.h
@@ -23,7 +23,6 @@
#include <sstream>
#include "src/compiler/config.h"
-
#include "src/compiler/cpp_generator.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/protobuf_plugin.h"
diff --git a/grpc/src/compiler/csharp_generator.cc b/grpc/src/compiler/csharp_generator.cc
index c7677c53..c4cee7a0 100644
--- a/grpc/src/compiler/csharp_generator.cc
+++ b/grpc/src/compiler/csharp_generator.cc
@@ -16,13 +16,14 @@
*
*/
+#include "src/compiler/csharp_generator.h"
+
#include <cctype>
#include <map>
#include <sstream>
#include <vector>
#include "src/compiler/config.h"
-#include "src/compiler/csharp_generator.h"
#include "src/compiler/csharp_generator_helpers.h"
using grpc::protobuf::Descriptor;
@@ -38,7 +39,7 @@ namespace grpc_csharp_generator {
namespace {
// This function is a massaged version of
-// https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
+// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
// Currently, we cannot easily reuse the functionality as
// google/protobuf/compiler/csharp/csharp_doc_comment.h is not a public header.
// TODO(jtattermusch): reuse the functionality from google/protobuf.
@@ -88,6 +89,17 @@ bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
return true;
}
+void GenerateGeneratedCodeAttribute(grpc::protobuf::io::Printer* printer) {
+ // Mark the code as generated using the [GeneratedCode] attribute.
+ // We don't provide plugin version info in attribute the because:
+ // * the version information is not readily available from the plugin's code.
+ // * it would cause a lot of churn in the pre-generated code
+ // in this repository every time the version is updated.
+ printer->Print(
+ "[global::System.CodeDom.Compiler.GeneratedCode(\"grpc_csharp_plugin\", "
+ "null)]\n");
+}
+
template <typename DescriptorType>
bool GenerateDocCommentBody(grpc::protobuf::io::Printer* printer,
const DescriptorType* descriptor) {
@@ -304,6 +316,7 @@ 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
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static void __Helper_SerializeMessage("
"global::Google.Protobuf.IMessage message, "
@@ -331,6 +344,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
out->Outdent();
out->Print("}\n\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static class __Helper_MessageCache<T>\n"
"{\n");
@@ -343,6 +357,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
out->Outdent();
out->Print("}\n\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static T __Helper_DeserializeMessage<T>("
"grpc::DeserializationContext context, "
@@ -368,6 +383,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
for (size_t i = 0; i < used_messages.size(); i++) {
const Descriptor* message = used_messages[i];
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static readonly grpc::Marshaller<$type$> $fieldname$ = "
"grpc::Marshallers.Create(__Helper_SerializeMessage, "
@@ -379,6 +395,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
}
void GenerateStaticMethodField(Printer* out, const MethodDescriptor* method) {
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static readonly grpc::Method<$request$, $response$> $fieldname$ = new "
"grpc::Method<$request$, $response$>(\n",
@@ -433,6 +450,7 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
for (int i = 0; i < service->method_count(); i++) {
const MethodDescriptor* method = service->method(i);
GenerateDocCommentServerMethod(out, method);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request$$response_stream_maybe$, "
@@ -468,6 +486,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <param name=\"channel\">The channel to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
+ GenerateGeneratedCodeAttribute(out);
out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n",
"name", GetClientClassName(service));
out->Print("{\n");
@@ -478,6 +497,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <param name=\"callInvoker\">The callInvoker to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n",
"name", GetClientClassName(service));
@@ -486,6 +506,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <summary>Protected parameterless constructor to allow creation"
" of test doubles.</summary>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print("protected $name$() : base()\n", "name",
GetClientClassName(service));
out->Print("{\n");
@@ -494,6 +515,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <summary>Protected constructor to allow creation of configured "
"clients.</summary>\n"
"/// <param name=\"configuration\">The client configuration.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"protected $name$(ClientBaseConfiguration configuration)"
" : base(configuration)\n",
@@ -506,6 +528,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
if (!method->client_streaming() && !method->server_streaming()) {
// unary calls have an extra synchronous stub method
GenerateDocCommentClientMethod(out, method, true, false);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $response$ $methodname$($request$ request, "
"grpc::Metadata "
@@ -528,6 +551,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
// overload taking CallOptions as a param
GenerateDocCommentClientMethod(out, method, true, true);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $response$ $methodname$($request$ request, "
"grpc::CallOptions options)\n",
@@ -549,6 +573,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
method_name += "Async"; // prevent name clash with synchronous method.
}
GenerateDocCommentClientMethod(out, method, false, false);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request_maybe$grpc::Metadata "
@@ -573,6 +598,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
// overload taking CallOptions as a param
GenerateDocCommentClientMethod(out, method, false, true);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request_maybe$grpc::CallOptions "
@@ -615,6 +641,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <summary>Creates a new instance of client from given "
"<c>ClientBaseConfiguration</c>.</summary>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"protected override $name$ NewInstance(ClientBaseConfiguration "
"configuration)\n",
@@ -638,6 +665,7 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <param name=\"serviceImpl\">An object implementing the server-side"
" handling logic.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public static grpc::ServerServiceDefinition BindService($implclass$ "
"serviceImpl)\n",
@@ -667,7 +695,7 @@ void GenerateBindServiceWithBinderMethod(Printer* out,
const ServiceDescriptor* service) {
out->Print(
"/// <summary>Register service method with a service "
- "binder with or without implementation. Useful when customizing the "
+ "binder with or without implementation. Useful when customizing the "
"service binding logic.\n"
"/// Note: this method is part of an experimental API that can change or "
"be "
@@ -679,6 +707,7 @@ void GenerateBindServiceWithBinderMethod(Printer* out,
out->Print(
"/// <param name=\"serviceImpl\">An object implementing the server-side"
" handling logic.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public static void BindService(grpc::ServiceBinderBase serviceBinder, "
"$implclass$ "
@@ -709,6 +738,7 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
bool generate_client, bool generate_server,
bool internal_access) {
GenerateDocCommentBody(out, service);
+
out->Print("$access_level$ static partial class $classname$\n",
"access_level", GetAccessLevel(internal_access), "classname",
GetServiceClassName(service));
diff --git a/grpc/src/compiler/csharp_generator_helpers.h b/grpc/src/compiler/csharp_generator_helpers.h
index c2694315..466c6458 100644
--- a/grpc/src/compiler/csharp_generator_helpers.h
+++ b/grpc/src/compiler/csharp_generator_helpers.h
@@ -25,9 +25,10 @@
namespace grpc_csharp_generator {
inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
- std::string* file_name_or_error) {
- *file_name_or_error =
- grpc_generator::FileNameInUpperCamel(file, false) + "Grpc.cs";
+ const std::string& file_suffix,
+ std::string& out_file_name_or_error) {
+ out_file_name_or_error =
+ grpc_generator::FileNameInUpperCamel(file, false) + file_suffix;
return true;
}
diff --git a/grpc/src/compiler/csharp_plugin.cc b/grpc/src/compiler/csharp_plugin.cc
index cac50d28..f63bb4de 100644
--- a/grpc/src/compiler/csharp_plugin.cc
+++ b/grpc/src/compiler/csharp_plugin.cc
@@ -43,6 +43,9 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
bool generate_client = true;
bool generate_server = true;
bool internal_access = false;
+ // the suffix that will get appended to the name generated from the name
+ // of the original .proto file
+ std::string file_suffix = "Grpc.cs";
for (size_t i = 0; i < options.size(); i++) {
if (options[i].first == "no_client") {
generate_client = false;
@@ -50,6 +53,8 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
generate_server = false;
} else if (options[i].first == "internal_access") {
internal_access = true;
+ } else if (options[i].first == "file_suffix") {
+ file_suffix = options[i].second;
} else {
*error = "Unknown generator option: " + options[i].first;
return false;
@@ -64,7 +69,8 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
// Get output file name.
std::string file_name;
- if (!grpc_csharp_generator::ServicesFilename(file, &file_name)) {
+ if (!grpc_csharp_generator::ServicesFilename(file, file_suffix,
+ file_name)) {
return false;
}
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output(
diff --git a/grpc/src/compiler/node_generator.cc b/grpc/src/compiler/node_generator.cc
index 465ac7e4..8c9f0263 100644
--- a/grpc/src/compiler/node_generator.cc
+++ b/grpc/src/compiler/node_generator.cc
@@ -16,11 +16,12 @@
*
*/
+#include "src/compiler/node_generator.h"
+
#include <map>
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
-#include "src/compiler/node_generator.h"
#include "src/compiler/node_generator_helpers.h"
using grpc::protobuf::Descriptor;
diff --git a/grpc/src/compiler/objective_c_generator.cc b/grpc/src/compiler/objective_c_generator.cc
index c8f1c43c..cd05ae78 100644
--- a/grpc/src/compiler/objective_c_generator.cc
+++ b/grpc/src/compiler/objective_c_generator.cc
@@ -16,16 +16,17 @@
*
*/
+#include "src/compiler/objective_c_generator.h"
+
#include <map>
#include <set>
#include <sstream>
+#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+
#include "src/compiler/config.h"
-#include "src/compiler/objective_c_generator.h"
#include "src/compiler/objective_c_generator_helpers.h"
-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
-
using ::google::protobuf::compiler::objectivec::ClassName;
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::MethodDescriptor;
diff --git a/grpc/src/compiler/objective_c_generator_helpers.h b/grpc/src/compiler/objective_c_generator_helpers.h
index b372e24d..25b25b27 100644
--- a/grpc/src/compiler/objective_c_generator_helpers.h
+++ b/grpc/src/compiler/objective_c_generator_helpers.h
@@ -20,11 +20,12 @@
#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
#include <map>
-#include "src/compiler/config.h"
-#include "src/compiler/generator_helpers.h"
#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+#include "src/compiler/config.h"
+#include "src/compiler/generator_helpers.h"
+
namespace grpc_objective_c_generator {
using ::grpc::protobuf::FileDescriptor;
@@ -35,10 +36,30 @@ inline string MessageHeaderName(const FileDescriptor* file) {
return google::protobuf::compiler::objectivec::FilePath(file) + ".pbobjc.h";
}
-inline string ServiceClassName(const ServiceDescriptor* service) {
+inline bool AsciiIsUpper(char c) { return c >= 'A' && c <= 'Z'; }
+
+inline ::std::string ServiceClassName(const ServiceDescriptor* service) {
const FileDescriptor* file = service->file();
- string prefix = file->options().objc_class_prefix();
- return prefix + service->name();
+ ::std::string prefix =
+ google::protobuf::compiler::objectivec::FileClassPrefix(file);
+ ::std::string class_name = service->name();
+ // We add the prefix in the cases where the string is missing a prefix.
+ // We define "missing a prefix" as where 'input':
+ // a) Doesn't start with the prefix or
+ // b) Isn't equivalent to the prefix or
+ // c) Has the prefix, but the letter after the prefix is lowercase
+ // This is the same semantics as the Objective-C protoc.
+ // https://github.com/protocolbuffers/protobuf/blob/c160ae52a91ca4c76936531d68cc846f8230dbb1/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc#L389
+ if (class_name.rfind(prefix, 0) == 0) {
+ if (class_name.length() == prefix.length() ||
+ !AsciiIsUpper(class_name[prefix.length()])) {
+ return prefix + class_name;
+ } else {
+ return class_name;
+ }
+ } else {
+ return prefix + class_name;
+ }
}
inline ::std::string LocalImport(const ::std::string& import) {
diff --git a/grpc/src/compiler/objective_c_plugin.cc b/grpc/src/compiler/objective_c_plugin.cc
index 7f4a0d3b..65807dc9 100644
--- a/grpc/src/compiler/objective_c_plugin.cc
+++ b/grpc/src/compiler/objective_c_plugin.cc
@@ -20,15 +20,18 @@
#include <memory>
+#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+
#include "src/compiler/config.h"
#include "src/compiler/objective_c_generator.h"
#include "src/compiler/objective_c_generator_helpers.h"
-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
-
using ::google::protobuf::compiler::objectivec::
IsProtobufLibraryBundledProtoFile;
using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName;
+#ifdef SUPPORT_OBJC_PREFIX_VALIDATION
+using ::google::protobuf::compiler::objectivec::ValidateObjCClassPrefixes;
+#endif
using ::grpc_objective_c_generator::FrameworkImport;
using ::grpc_objective_c_generator::LocalImport;
using ::grpc_objective_c_generator::PreprocIfElse;
@@ -90,6 +93,13 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
return true;
}
+#ifdef SUPPORT_OBJC_PREFIX_VALIDATION
+ // Default options will use env variables for controls.
+ if (!ValidateObjCClassPrefixes({file}, {}, error)) {
+ return false;
+ }
+#endif
+
bool grpc_local_import = false;
::std::string framework;
::std::string pb_runtime_import_prefix;
diff --git a/grpc/src/compiler/php_generator.cc b/grpc/src/compiler/php_generator.cc
index 28bbebd1..78d95419 100644
--- a/grpc/src/compiler/php_generator.cc
+++ b/grpc/src/compiler/php_generator.cc
@@ -19,6 +19,7 @@
#include <map>
#include <google/protobuf/compiler/php/php_generator.h>
+
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/php_generator_helpers.h"
diff --git a/grpc/src/compiler/protobuf_plugin.h b/grpc/src/compiler/protobuf_plugin.h
index 951ff5eb..0a7aa414 100644
--- a/grpc/src/compiler/protobuf_plugin.h
+++ b/grpc/src/compiler/protobuf_plugin.h
@@ -19,14 +19,14 @@
#ifndef GRPC_INTERNAL_COMPILER_PROTOBUF_PLUGIN_H
#define GRPC_INTERNAL_COMPILER_PROTOBUF_PLUGIN_H
+#include <vector>
+
#include "src/compiler/config.h"
#include "src/compiler/cpp_generator_helpers.h"
#include "src/compiler/python_generator_helpers.h"
#include "src/compiler/python_private_generator.h"
#include "src/compiler/schema_interface.h"
-#include <vector>
-
// Get leading or trailing comments in a string.
template <typename DescriptorType>
inline std::string GetCommentsHelper(const DescriptorType* desc, bool leading,
diff --git a/grpc/src/compiler/python_generator.cc b/grpc/src/compiler/python_generator.cc
index 40e79b54..753fe1c8 100644
--- a/grpc/src/compiler/python_generator.cc
+++ b/grpc/src/compiler/python_generator.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/compiler/python_generator.h"
+
#include <algorithm>
#include <cassert>
#include <cctype>
@@ -33,7 +35,6 @@
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/protobuf_plugin.h"
-#include "src/compiler/python_generator.h"
#include "src/compiler/python_generator_helpers.h"
#include "src/compiler/python_private_generator.h"
diff --git a/grpc/src/compiler/python_generator.h b/grpc/src/compiler/python_generator.h
index 94807968..12343ccd 100644
--- a/grpc/src/compiler/python_generator.h
+++ b/grpc/src/compiler/python_generator.h
@@ -34,7 +34,7 @@ struct GeneratorConfiguration {
std::string grpc_package_root;
// TODO(https://github.com/grpc/grpc/issues/8622): Drop this.
std::string beta_package_root;
- // TODO(https://github.com/google/protobuf/issues/888): Drop this.
+ // TODO(https://github.com/protocolbuffers/protobuf/issues/888): Drop this.
std::string import_prefix;
std::vector<std::string> prefixes_to_filter;
};
diff --git a/grpc/src/compiler/python_generator_helpers.h b/grpc/src/compiler/python_generator_helpers.h
index 4bdc9383..8a5d7454 100644
--- a/grpc/src/compiler/python_generator_helpers.h
+++ b/grpc/src/compiler/python_generator_helpers.h
@@ -61,7 +61,7 @@ static std::string StripModulePrefixes(
return raw_module_name;
}
-// TODO(https://github.com/google/protobuf/issues/888):
+// TODO(https://github.com/protocolbuffers/protobuf/issues/888):
// Export `ModuleName` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
std::string ModuleName(const std::string& filename,
@@ -74,7 +74,7 @@ std::string ModuleName(const std::string& filename,
prefixes_to_filter);
}
-// TODO(https://github.com/google/protobuf/issues/888):
+// TODO(https://github.com/protocolbuffers/protobuf/issues/888):
// Export `ModuleAlias` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
std::string ModuleAlias(const std::string& filename,
diff --git a/grpc/src/compiler/ruby_generator.cc b/grpc/src/compiler/ruby_generator.cc
index 2fae6108..c553e1c3 100644
--- a/grpc/src/compiler/ruby_generator.cc
+++ b/grpc/src/compiler/ruby_generator.cc
@@ -16,12 +16,13 @@
*
*/
+#include "src/compiler/ruby_generator.h"
+
#include <cctype>
#include <map>
#include <vector>
#include "src/compiler/config.h"
-#include "src/compiler/ruby_generator.h"
#include "src/compiler/ruby_generator_helpers-inl.h"
#include "src/compiler/ruby_generator_map-inl.h"
#include "src/compiler/ruby_generator_string-inl.h"
@@ -109,7 +110,7 @@ void PrintService(const ServiceDescriptor* service, Printer* out) {
// ruby generator
// to ensure compatibility (with the exception of int and string type changes).
// See
-// https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
+// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
// TODO: keep up to date with protoc code generation, though this behavior isn't
// expected to change
bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; }
diff --git a/grpc/src/compiler/ruby_generator_map-inl.h b/grpc/src/compiler/ruby_generator_map-inl.h
index 5f85abc3..89515523 100644
--- a/grpc/src/compiler/ruby_generator_map-inl.h
+++ b/grpc/src/compiler/ruby_generator_map-inl.h
@@ -19,14 +19,14 @@
#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
-#include "src/compiler/config.h"
-
#include <initializer_list>
#include <iostream>
#include <map>
#include <ostream> // NOLINT
#include <vector>
+#include "src/compiler/config.h"
+
using std::initializer_list;
using std::map;
using std::vector;
diff --git a/grpc/src/compiler/ruby_generator_string-inl.h b/grpc/src/compiler/ruby_generator_string-inl.h
index 968f795c..feaa4955 100644
--- a/grpc/src/compiler/ruby_generator_string-inl.h
+++ b/grpc/src/compiler/ruby_generator_string-inl.h
@@ -19,12 +19,12 @@
#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H
#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H
-#include "src/compiler/config.h"
-
#include <algorithm>
#include <sstream>
#include <vector>
+#include "src/compiler/config.h"
+
using std::getline;
using std::transform;
diff --git a/grpc/src/compiler/schema_interface.h b/grpc/src/compiler/schema_interface.h
index f1a255ac..2e2bdd32 100644
--- a/grpc/src/compiler/schema_interface.h
+++ b/grpc/src/compiler/schema_interface.h
@@ -19,12 +19,12 @@
#ifndef GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#define GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
-#include "src/compiler/config.h"
-
#include <memory>
#include <string>
#include <vector>
+#include "src/compiler/config.h"
+
#ifdef GRPC_CUSTOM_STRING
#warning GRPC_CUSTOM_STRING is no longer supported. Please use std::string.
#endif
diff --git a/grpc/src/core/ext/filters/census/grpc_context.cc b/grpc/src/core/ext/filters/census/grpc_context.cc
index 599a798d..6659f701 100644
--- a/grpc/src/core/ext/filters/census/grpc_context.cc
+++ b/grpc/src/core/ext/filters/census/grpc_context.cc
@@ -20,6 +20,7 @@
#include <grpc/census.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
diff --git a/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.cc b/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.cc
new file mode 100644
index 00000000..3c22d517
--- /dev/null
+++ b/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.cc
@@ -0,0 +1,309 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// TODO(ctiller): Add a unit test suite for these filters once it's practical to
+// mock transport operations.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/channel_idle/channel_idle_filter.h"
+
+#include <limits.h>
+#include <stdlib.h>
+
+#include <atomic>
+#include <limits>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/gprpp/capture.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
+#include "src/core/lib/promise/loop.h"
+#include "src/core/lib/promise/sleep.h"
+#include "src/core/lib/promise/try_seq.h"
+#include "src/core/lib/transport/http2_errors.h"
+
+namespace grpc_core {
+
+namespace {
+// TODO(ctiller): The idle filter was disabled in client channel by default
+// due to b/143502997. Now the bug is fixed enable the filter by default.
+const auto kDefaultIdleTimeout = Duration::Infinity();
+
+// If these settings change, make sure that we are not sending a GOAWAY for
+// inproc transport, since a GOAWAY to inproc ends up destroying the transport.
+const auto kDefaultMaxConnectionAge = Duration::Infinity();
+const auto kDefaultMaxConnectionAgeGrace = Duration::Infinity();
+const auto kDefaultMaxConnectionIdle = Duration::Infinity();
+const auto kMaxConnectionAgeJitter = 0.1;
+
+TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter");
+} // namespace
+
+#define GRPC_IDLE_FILTER_LOG(format, ...) \
+ do { \
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_client_idle_filter)) { \
+ gpr_log(GPR_INFO, "(client idle filter) " format, ##__VA_ARGS__); \
+ } \
+ } while (0)
+
+namespace {
+
+Duration GetClientIdleTimeout(const ChannelArgs& args) {
+ return args.GetDurationFromIntMillis(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS)
+ .value_or(kDefaultIdleTimeout);
+}
+
+} // namespace
+
+struct MaxAgeFilter::Config {
+ Duration max_connection_age;
+ Duration max_connection_idle;
+ Duration max_connection_age_grace;
+
+ bool enable() const {
+ return max_connection_age != Duration::Infinity() ||
+ max_connection_idle != Duration::Infinity();
+ }
+
+ /* A random jitter of +/-10% will be added to MAX_CONNECTION_AGE to spread out
+ connection storms. Note that the MAX_CONNECTION_AGE option without jitter
+ would not create connection storms by itself, but if there happened to be a
+ connection storm it could cause it to repeat at a fixed period. */
+ static Config FromChannelArgs(ChannelArgs args) {
+ const Duration args_max_age =
+ args.GetDurationFromIntMillis(GRPC_ARG_MAX_CONNECTION_AGE_MS)
+ .value_or(kDefaultMaxConnectionAge);
+ const Duration args_max_idle =
+ args.GetDurationFromIntMillis(GRPC_ARG_MAX_CONNECTION_IDLE_MS)
+ .value_or(kDefaultMaxConnectionIdle);
+ const Duration args_max_age_grace =
+ args.GetDurationFromIntMillis(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS)
+ .value_or(kDefaultMaxConnectionAgeGrace);
+ /* generate a random number between 1 - kMaxConnectionAgeJitter and
+ 1 + kMaxConnectionAgeJitter */
+ const double multiplier =
+ rand() * kMaxConnectionAgeJitter * 2.0 / RAND_MAX + 1.0 -
+ kMaxConnectionAgeJitter;
+ /* GRPC_MILLIS_INF_FUTURE - 0.5 converts the value to float, so that result
+ will not be cast to int implicitly before the comparison. */
+ return Config{args_max_age * multiplier, args_max_idle, args_max_age_grace};
+ }
+};
+
+absl::StatusOr<ClientIdleFilter> ClientIdleFilter::Create(
+ ChannelArgs args, ChannelFilter::Args filter_args) {
+ ClientIdleFilter filter(filter_args.channel_stack(),
+ GetClientIdleTimeout(args));
+ return absl::StatusOr<ClientIdleFilter>(std::move(filter));
+}
+
+absl::StatusOr<MaxAgeFilter> MaxAgeFilter::Create(
+ ChannelArgs args, ChannelFilter::Args filter_args) {
+ MaxAgeFilter filter(filter_args.channel_stack(),
+ Config::FromChannelArgs(args));
+ return absl::StatusOr<MaxAgeFilter>(std::move(filter));
+}
+
+void MaxAgeFilter::Shutdown() {
+ max_age_activity_.Reset();
+ ChannelIdleFilter::Shutdown();
+}
+
+void MaxAgeFilter::Start() {
+ // Trigger idle timer immediately
+ IncreaseCallCount();
+ DecreaseCallCount();
+
+ struct StartupClosure {
+ RefCountedPtr<grpc_channel_stack> channel_stack;
+ MaxAgeFilter* filter;
+ grpc_closure closure;
+ };
+ auto run_startup = [](void* p, grpc_error_handle) {
+ auto* startup = static_cast<StartupClosure*>(p);
+ grpc_transport_op* op = grpc_make_transport_op(nullptr);
+ op->start_connectivity_watch.reset(
+ new ConnectivityWatcher(startup->filter));
+ op->start_connectivity_watch_state = GRPC_CHANNEL_IDLE;
+ grpc_channel_next_op(
+ grpc_channel_stack_element(startup->channel_stack.get(), 0), op);
+ delete startup;
+ };
+ auto* startup =
+ new StartupClosure{this->channel_stack()->Ref(), this, grpc_closure{}};
+ GRPC_CLOSURE_INIT(&startup->closure, run_startup, startup, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &startup->closure, GRPC_ERROR_NONE);
+
+ auto channel_stack = this->channel_stack()->Ref();
+
+ // Start the max age timer
+ if (max_connection_age_ != Duration::Infinity()) {
+ max_age_activity_.Set(MakeActivity(
+ TrySeq(
+ // First sleep until the max connection age
+ Sleep(ExecCtx::Get()->Now() + max_connection_age_),
+ // Then send a goaway.
+ [this] {
+ GRPC_CHANNEL_STACK_REF(this->channel_stack(),
+ "max_age send_goaway");
+ // Jump out of the activity to send the goaway.
+ auto fn = [](void* arg, grpc_error_handle) {
+ auto* channel_stack = static_cast<grpc_channel_stack*>(arg);
+ grpc_transport_op* op = grpc_make_transport_op(nullptr);
+ op->goaway_error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("max_age"),
+ GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_NO_ERROR);
+ grpc_channel_element* elem =
+ grpc_channel_stack_element(channel_stack, 0);
+ elem->filter->start_transport_op(elem, op);
+ GRPC_CHANNEL_STACK_UNREF(channel_stack, "max_age send_goaway");
+ };
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(fn, this->channel_stack(), nullptr),
+ GRPC_ERROR_NONE);
+ return Immediate(absl::OkStatus());
+ },
+ // Sleep for the grace period
+ [this] {
+ return Sleep(ExecCtx::Get()->Now() + max_connection_age_grace_);
+ }),
+ ExecCtxWakeupScheduler(), [channel_stack, this](absl::Status status) {
+ // OnDone -- close the connection if the promise completed
+ // successfully.
+ // (if it did not, it was cancelled)
+ if (status.ok()) CloseChannel();
+ }));
+ }
+}
+
+// Construct a promise for one call.
+ArenaPromise<ServerMetadataHandle> ChannelIdleFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ using Decrementer = std::unique_ptr<ChannelIdleFilter, CallCountDecreaser>;
+ IncreaseCallCount();
+ return ArenaPromise<ServerMetadataHandle>(
+ Capture([](Decrementer*, ArenaPromise<ServerMetadataHandle>* next)
+ -> Poll<ServerMetadataHandle> { return (*next)(); },
+ Decrementer(this), next_promise_factory(std::move(call_args))));
+}
+
+bool ChannelIdleFilter::StartTransportOp(grpc_transport_op* op) {
+ // Catch the disconnect_with_error transport op.
+ if (op->disconnect_with_error != GRPC_ERROR_NONE) Shutdown();
+ // Pass the op to the next filter.
+ return false;
+}
+
+void ChannelIdleFilter::Shutdown() {
+ // IncreaseCallCount() introduces a phony call and prevent the timer from
+ // being reset by other threads.
+ IncreaseCallCount();
+ activity_.Reset();
+}
+
+void ChannelIdleFilter::IncreaseCallCount() {
+ idle_filter_state_->IncreaseCallCount();
+}
+
+void ChannelIdleFilter::DecreaseCallCount() {
+ if (idle_filter_state_->DecreaseCallCount()) {
+ // If there are no more calls in progress, start the idle timer.
+ StartIdleTimer();
+ }
+}
+
+void ChannelIdleFilter::StartIdleTimer() {
+ GRPC_IDLE_FILTER_LOG("timer has started");
+ auto idle_filter_state = idle_filter_state_;
+ // Hold a ref to the channel stack for the timer callback.
+ auto channel_stack = channel_stack_->Ref();
+ auto timeout = client_idle_timeout_;
+ auto promise = Loop([timeout, idle_filter_state]() {
+ return TrySeq(Sleep(ExecCtx::Get()->Now() + timeout),
+ [idle_filter_state]() -> Poll<LoopCtl<absl::Status>> {
+ if (idle_filter_state->CheckTimer()) {
+ return Continue{};
+ } else {
+ return absl::OkStatus();
+ }
+ });
+ });
+ activity_.Set(MakeActivity(std::move(promise), ExecCtxWakeupScheduler{},
+ [channel_stack, this](absl::Status status) {
+ if (status.ok()) CloseChannel();
+ }));
+}
+
+void ChannelIdleFilter::CloseChannel() {
+ auto* op = grpc_make_transport_op(nullptr);
+ op->disconnect_with_error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("enter idle"),
+ GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE, GRPC_CHANNEL_IDLE);
+ // Pass the transport op down to the channel stack.
+ auto* elem = grpc_channel_stack_element(channel_stack_, 0);
+ elem->filter->start_transport_op(elem, op);
+}
+
+namespace {
+
+const grpc_channel_filter grpc_client_idle_filter =
+ MakePromiseBasedFilter<ClientIdleFilter, FilterEndpoint::kClient>(
+ "client_idle");
+const grpc_channel_filter grpc_max_age_filter =
+ MakePromiseBasedFilter<MaxAgeFilter, FilterEndpoint::kServer>("max_age");
+
+} // namespace
+
+void RegisterChannelIdleFilters(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
+ if (!grpc_channel_args_want_minimal_stack(channel_args) &&
+ GetClientIdleTimeout(ChannelArgs::FromC(channel_args)) !=
+ Duration::Infinity()) {
+ builder->PrependFilter(&grpc_client_idle_filter, nullptr);
+ }
+ return true;
+ });
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
+ if (!grpc_channel_args_want_minimal_stack(channel_args) &&
+ MaxAgeFilter::Config::FromChannelArgs(
+ ChannelArgs::FromC(channel_args))
+ .enable()) {
+ builder->PrependFilter(
+ &grpc_max_age_filter,
+ [](grpc_channel_stack*, grpc_channel_element* elem) {
+ static_cast<MaxAgeFilter*>(elem->channel_data)->Start();
+ });
+ }
+ return true;
+ });
+}
+
+MaxAgeFilter::MaxAgeFilter(grpc_channel_stack* channel_stack,
+ const Config& max_age_config)
+ : ChannelIdleFilter(channel_stack, max_age_config.max_connection_idle),
+ max_connection_age_(max_age_config.max_connection_age),
+ max_connection_age_grace_(max_age_config.max_connection_age_grace) {}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.h b/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.h
new file mode 100644
index 00000000..2d4a570d
--- /dev/null
+++ b/grpc/src/core/ext/filters/channel_idle/channel_idle_filter.h
@@ -0,0 +1,122 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_IDLE_CHANNEL_IDLE_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_CHANNEL_IDLE_CHANNEL_IDLE_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/channel_idle/idle_filter_state.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/gprpp/single_set_ptr.h"
+
+namespace grpc_core {
+
+class ChannelIdleFilter : public ChannelFilter {
+ public:
+ ~ChannelIdleFilter() override = default;
+
+ ChannelIdleFilter(const ChannelIdleFilter&) = delete;
+ ChannelIdleFilter& operator=(const ChannelIdleFilter&) = delete;
+ ChannelIdleFilter(ChannelIdleFilter&&) = default;
+ ChannelIdleFilter& operator=(ChannelIdleFilter&&) = default;
+
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ bool StartTransportOp(grpc_transport_op* op) override;
+
+ protected:
+ using SingleSetActivityPtr =
+ SingleSetPtr<Activity, typename ActivityPtr::deleter_type>;
+
+ ChannelIdleFilter(grpc_channel_stack* channel_stack,
+ Duration client_idle_timeout)
+ : channel_stack_(channel_stack),
+ client_idle_timeout_(client_idle_timeout) {}
+
+ grpc_channel_stack* channel_stack() { return channel_stack_; };
+
+ virtual void Shutdown();
+ void CloseChannel();
+
+ void IncreaseCallCount();
+ void DecreaseCallCount();
+
+ private:
+ void StartIdleTimer();
+
+ struct CallCountDecreaser {
+ void operator()(ChannelIdleFilter* filter) const {
+ filter->DecreaseCallCount();
+ }
+ };
+
+ // The channel stack to which we take refs for pending callbacks.
+ grpc_channel_stack* channel_stack_;
+ Duration client_idle_timeout_;
+ std::shared_ptr<IdleFilterState> idle_filter_state_{
+ std::make_shared<IdleFilterState>(false)};
+
+ SingleSetActivityPtr activity_;
+};
+
+class ClientIdleFilter final : public ChannelIdleFilter {
+ public:
+ static absl::StatusOr<ClientIdleFilter> Create(
+ ChannelArgs args, ChannelFilter::Args filter_args);
+
+ private:
+ using ChannelIdleFilter::ChannelIdleFilter;
+};
+
+class MaxAgeFilter final : public ChannelIdleFilter {
+ public:
+ struct Config;
+
+ static absl::StatusOr<MaxAgeFilter> Create(ChannelArgs args,
+ ChannelFilter::Args filter_args);
+
+ void Start();
+
+ private:
+ class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit ConnectivityWatcher(MaxAgeFilter* filter)
+ : channel_stack_(filter->channel_stack()->Ref()), filter_(filter) {}
+ ~ConnectivityWatcher() override = default;
+
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const absl::Status&) override {
+ if (new_state == GRPC_CHANNEL_SHUTDOWN) filter_->Shutdown();
+ }
+
+ private:
+ RefCountedPtr<grpc_channel_stack> channel_stack_;
+ MaxAgeFilter* filter_;
+ };
+
+ MaxAgeFilter(grpc_channel_stack* channel_stack, const Config& max_age_config);
+
+ void Shutdown() override;
+
+ SingleSetActivityPtr max_age_activity_;
+ Duration max_connection_age_;
+ Duration max_connection_age_grace_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CHANNEL_IDLE_CHANNEL_IDLE_FILTER_H
diff --git a/grpc/src/core/ext/filters/channel_idle/idle_filter_state.cc b/grpc/src/core/ext/filters/channel_idle/idle_filter_state.cc
new file mode 100644
index 00000000..72b5448a
--- /dev/null
+++ b/grpc/src/core/ext/filters/channel_idle/idle_filter_state.cc
@@ -0,0 +1,96 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/channel_idle/idle_filter_state.h"
+
+#include <assert.h>
+
+namespace grpc_core {
+
+IdleFilterState::IdleFilterState(bool start_timer)
+ : state_(start_timer ? kTimerStarted : 0) {}
+
+void IdleFilterState::IncreaseCallCount() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ do {
+ // Increment the counter, and flag that there's been activity.
+ new_state = state;
+ new_state |= kCallsStartedSinceLastTimerCheck;
+ new_state += kCallIncrement;
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+}
+
+bool IdleFilterState::DecreaseCallCount() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ bool start_timer;
+ do {
+ start_timer = false;
+ new_state = state;
+ // Decrement call count (and assert there's at least one call outstanding!)
+ assert(new_state >= kCallIncrement);
+ new_state -= kCallIncrement;
+ // If that decrement reaches a call count of zero and we have not started a
+ // timer
+ if ((new_state >> kCallsInProgressShift) == 0 &&
+ (new_state & kTimerStarted) == 0) {
+ // Flag that we will start a timer, and mark it started so nobody else
+ // does.
+ start_timer = true;
+ new_state |= kTimerStarted;
+ new_state &= ~kCallsInProgressShift;
+ }
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+ return start_timer;
+}
+
+bool IdleFilterState::CheckTimer() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ bool start_timer;
+ do {
+ if ((state >> kCallsInProgressShift) != 0) {
+ // Still calls in progress: nothing needs updating, just return
+ // and keep the timer going!
+ return true;
+ }
+ new_state = state;
+ bool is_active = false;
+ if (new_state & kCallsStartedSinceLastTimerCheck) {
+ // If any calls started since the last time we checked, then consider the
+ // channel still active and try again.
+ is_active = true;
+ new_state &= ~kCallsStartedSinceLastTimerCheck;
+ }
+ if (is_active) {
+ // If we are still active, we should signal that the timer should start
+ // again.
+ start_timer = true;
+ } else {
+ // Otherwise, we should not start the timer again, and we should signal
+ // that in the updated state.
+ start_timer = false;
+ new_state &= ~kTimerStarted;
+ }
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+ return start_timer;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/channel_idle/idle_filter_state.h b/grpc/src/core/ext/filters/channel_idle/idle_filter_state.h
new file mode 100644
index 00000000..f70c3c85
--- /dev/null
+++ b/grpc/src/core/ext/filters/channel_idle/idle_filter_state.h
@@ -0,0 +1,66 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_IDLE_IDLE_FILTER_STATE_H
+#define GRPC_CORE_EXT_FILTERS_CHANNEL_IDLE_IDLE_FILTER_STATE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+namespace grpc_core {
+
+// State machine for the idle filter.
+// Keeps track of how many calls are in progress, whether there is a timer
+// started, and whether we've seen calls since the previous timer fired.
+class IdleFilterState {
+ public:
+ explicit IdleFilterState(bool start_timer);
+ ~IdleFilterState() = default;
+
+ IdleFilterState(const IdleFilterState&) = delete;
+ IdleFilterState& operator=(const IdleFilterState&) = delete;
+
+ // Increment the number of calls in progress.
+ void IncreaseCallCount();
+
+ // Decrement the number of calls in progress.
+ // Return true if we reached idle with no timer started.
+ GRPC_MUST_USE_RESULT bool DecreaseCallCount();
+
+ // Check if there's been any activity since the last timer check.
+ // If there was, reset the activity flag and return true to indicated that
+ // a new timer should be started.
+ // If there was not, reset the timer flag and return false - in this case
+ // we know that the channel is idle and has been for one full cycle.
+ GRPC_MUST_USE_RESULT bool CheckTimer();
+
+ private:
+ // Bit in state_ indicating that the timer has been started.
+ static constexpr uintptr_t kTimerStarted = 1;
+ // Bit in state_ indicating that we've seen a call start or stop since the
+ // last timer.
+ static constexpr uintptr_t kCallsStartedSinceLastTimerCheck = 2;
+ // How much should we shift to get the number of calls in progress.
+ static constexpr uintptr_t kCallsInProgressShift = 2;
+ // How much to increment/decrement the state_ when a call is started/stopped.
+ // Ensures we don't clobber the preceding bits.
+ static constexpr uintptr_t kCallIncrement = uintptr_t(1)
+ << kCallsInProgressShift;
+ std::atomic<uintptr_t> state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CHANNEL_IDLE_IDLE_FILTER_STATE_H
diff --git a/grpc/src/core/ext/filters/client_channel/backend_metric.cc b/grpc/src/core/ext/filters/client_channel/backend_metric.cc
index 441657ef..ddc2623d 100644
--- a/grpc/src/core/ext/filters/client_channel/backend_metric.cc
+++ b/grpc/src/core/ext/filters/client_channel/backend_metric.cc
@@ -19,9 +19,8 @@
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "absl/strings/string_view.h"
-
-#include "udpa/data/orca/v1/orca_load_report.upb.h"
#include "upb/upb.hpp"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
namespace grpc_core {
@@ -29,17 +28,17 @@ namespace {
template <typename EntryType>
std::map<absl::string_view, double> ParseMap(
- udpa_data_orca_v1_OrcaLoadReport* msg,
- const EntryType* (*entry_func)(const udpa_data_orca_v1_OrcaLoadReport*,
+ xds_data_orca_v3_OrcaLoadReport* msg,
+ const EntryType* (*entry_func)(const xds_data_orca_v3_OrcaLoadReport*,
size_t*),
- upb_strview (*key_func)(const EntryType*),
+ upb_StringView (*key_func)(const EntryType*),
double (*value_func)(const EntryType*), Arena* arena) {
std::map<absl::string_view, double> result;
- size_t i = UPB_MAP_BEGIN;
+ size_t i = kUpb_Map_Begin;
while (true) {
const auto* entry = entry_func(msg, &i);
if (entry == nullptr) break;
- upb_strview key_view = key_func(entry);
+ upb_StringView key_view = key_func(entry);
char* key = static_cast<char*>(arena->Alloc(key_view.size));
memcpy(key, key_view.data, key_view.size);
result[absl::string_view(key, key_view.size)] = value_func(entry);
@@ -49,33 +48,31 @@ std::map<absl::string_view, double> ParseMap(
} // namespace
-const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
- const grpc_slice& serialized_load_report, Arena* arena) {
+const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena) {
upb::Arena upb_arena;
- udpa_data_orca_v1_OrcaLoadReport* msg =
- udpa_data_orca_v1_OrcaLoadReport_parse(
- reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(serialized_load_report)),
- GRPC_SLICE_LENGTH(serialized_load_report), upb_arena.ptr());
+ xds_data_orca_v3_OrcaLoadReport* msg = xds_data_orca_v3_OrcaLoadReport_parse(
+ reinterpret_cast<const char*>(serialized_load_report.begin()),
+ serialized_load_report.size(), upb_arena.ptr());
if (msg == nullptr) return nullptr;
- LoadBalancingPolicy::BackendMetricData* backend_metric_data =
- arena->New<LoadBalancingPolicy::BackendMetricData>();
+ auto* backend_metric_data = arena->New<
+ LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData>();
backend_metric_data->cpu_utilization =
- udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(msg);
+ xds_data_orca_v3_OrcaLoadReport_cpu_utilization(msg);
backend_metric_data->mem_utilization =
- udpa_data_orca_v1_OrcaLoadReport_mem_utilization(msg);
+ xds_data_orca_v3_OrcaLoadReport_mem_utilization(msg);
backend_metric_data->requests_per_second =
- udpa_data_orca_v1_OrcaLoadReport_rps(msg);
+ xds_data_orca_v3_OrcaLoadReport_rps(msg);
backend_metric_data->request_cost =
- ParseMap<udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_request_cost_next,
- udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key,
- udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value, arena);
+ ParseMap<xds_data_orca_v3_OrcaLoadReport_RequestCostEntry>(
+ msg, xds_data_orca_v3_OrcaLoadReport_request_cost_next,
+ xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_key,
+ xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_value, arena);
backend_metric_data->utilization =
- ParseMap<udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_utilization_next,
- udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key,
- udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value, arena);
+ ParseMap<xds_data_orca_v3_OrcaLoadReport_UtilizationEntry>(
+ msg, xds_data_orca_v3_OrcaLoadReport_utilization_next,
+ xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_key,
+ xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_value, arena);
return backend_metric_data;
}
diff --git a/grpc/src/core/ext/filters/client_channel/backend_metric.h b/grpc/src/core/ext/filters/client_channel/backend_metric.h
index d92b76c8..70efe6b7 100644
--- a/grpc/src/core/ext/filters/client_channel/backend_metric.h
+++ b/grpc/src/core/ext/filters/client_channel/backend_metric.h
@@ -22,14 +22,15 @@
#include <grpc/slice.h>
#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/slice/slice.h"
namespace grpc_core {
// Parses the serialized load report and allocates a BackendMetricData
// object on the arena.
-const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
- const grpc_slice& serialized_load_report, Arena* arena);
+const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena);
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/backup_poller.cc b/grpc/src/core/ext/filters/client_channel/backup_poller.cc
index ad7f8921..ba3365cd 100644
--- a/grpc/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/grpc/src/core/ext/filters/client_channel/backup_poller.cc
@@ -28,6 +28,8 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/global_config.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset.h"
@@ -56,7 +58,8 @@ static backup_poller* g_poller = nullptr; // guarded by g_poller_mu
// g_poll_interval_ms is set only once at the first time
// grpc_client_channel_start_backup_polling() is called, after that it is
// treated as const.
-static int g_poll_interval_ms = DEFAULT_POLL_INTERVAL_MS;
+static grpc_core::Duration g_poll_interval =
+ grpc_core::Duration::Milliseconds(DEFAULT_POLL_INTERVAL_MS);
GPR_GLOBAL_CONFIG_DEFINE_INT32(
grpc_client_channel_backup_poll_interval_ms, DEFAULT_POLL_INTERVAL_MS,
@@ -74,10 +77,10 @@ void grpc_client_channel_global_init_backup_polling() {
if (poll_interval_ms < 0) {
gpr_log(GPR_ERROR,
"Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %d, "
- "default value %d will be used.",
- poll_interval_ms, g_poll_interval_ms);
+ "default value %" PRId64 " will be used.",
+ poll_interval_ms, g_poll_interval.millis());
} else {
- g_poll_interval_ms = poll_interval_ms;
+ g_poll_interval = grpc_core::Duration::Milliseconds(poll_interval_ms);
}
}
@@ -132,13 +135,13 @@ static void run_poller(void* arg, grpc_error_handle error) {
gpr_mu_unlock(p->pollset_mu);
GRPC_LOG_IF_ERROR("Run client channel backup poller", err);
grpc_timer_init(&p->polling_timer,
- grpc_core::ExecCtx::Get()->Now() + g_poll_interval_ms,
+ grpc_core::ExecCtx::Get()->Now() + g_poll_interval,
&p->run_poller_closure);
}
static void g_poller_init_locked() {
if (g_poller == nullptr) {
- g_poller = static_cast<backup_poller*>(gpr_zalloc(sizeof(backup_poller)));
+ g_poller = grpc_core::Zalloc<backup_poller>();
g_poller->pollset =
static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
g_poller->shutting_down = false;
@@ -149,14 +152,15 @@ static void g_poller_init_locked() {
GRPC_CLOSURE_INIT(&g_poller->run_poller_closure, run_poller, g_poller,
grpc_schedule_on_exec_ctx);
grpc_timer_init(&g_poller->polling_timer,
- grpc_core::ExecCtx::Get()->Now() + g_poll_interval_ms,
+ grpc_core::ExecCtx::Get()->Now() + g_poll_interval,
&g_poller->run_poller_closure);
}
}
void grpc_client_channel_start_backup_polling(
grpc_pollset_set* interested_parties) {
- if (g_poll_interval_ms == 0 || grpc_iomgr_run_in_background()) {
+ if (g_poll_interval == grpc_core::Duration::Zero() ||
+ grpc_iomgr_run_in_background()) {
return;
}
gpr_mu_lock(&g_poller_mu);
@@ -174,7 +178,8 @@ void grpc_client_channel_start_backup_polling(
void grpc_client_channel_stop_backup_polling(
grpc_pollset_set* interested_parties) {
- if (g_poll_interval_ms == 0 || grpc_iomgr_run_in_background()) {
+ if (g_poll_interval == grpc_core::Duration::Zero() ||
+ grpc_iomgr_run_in_background()) {
return;
}
grpc_pollset_set_del_pollset(interested_parties, g_poller->pollset);
diff --git a/grpc/src/core/ext/filters/client_channel/backup_poller.h b/grpc/src/core/ext/filters/client_channel/backup_poller.h
index b412081b..ae47353a 100644
--- a/grpc/src/core/ext/filters/client_channel/backup_poller.h
+++ b/grpc/src/core/ext/filters/client_channel/backup_poller.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gprpp/global_config.h"
diff --git a/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc b/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
index e5ec5c5f..e40cc083 100644
--- a/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
+++ b/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -16,14 +16,24 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/channel.h"
-
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/lame_client.h"
+
+namespace {
+
+bool IsLameChannel(grpc_channel* channel) {
+ grpc_channel_element* elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
+ return elem->filter == &grpc_lame_filter;
+}
+
+} // namespace
grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_channel* channel, int try_to_connect) {
@@ -36,6 +46,7 @@ grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_core::ClientChannel* client_channel =
grpc_core::ClientChannel::GetFromChannel(channel);
if (GPR_UNLIKELY(client_channel == nullptr)) {
+ if (IsLameChannel(channel)) return GRPC_CHANNEL_TRANSIENT_FAILURE;
gpr_log(GPR_ERROR,
"grpc_channel_check_connectivity_state called on something that is "
"not a client channel");
@@ -48,9 +59,11 @@ int grpc_channel_num_external_connectivity_watchers(grpc_channel* channel) {
grpc_core::ClientChannel* client_channel =
grpc_core::ClientChannel::GetFromChannel(channel);
if (client_channel == nullptr) {
- gpr_log(GPR_ERROR,
- "grpc_channel_num_external_connectivity_watchers called on "
- "something that is not a client channel");
+ if (!IsLameChannel(channel)) {
+ gpr_log(GPR_ERROR,
+ "grpc_channel_num_external_connectivity_watchers called on "
+ "something that is not a client channel");
+ }
return 0;
}
return client_channel->NumExternalConnectivityWatchers();
@@ -63,7 +76,7 @@ int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
namespace grpc_core {
namespace {
-class StateWatcher {
+class StateWatcher : public DualRefCounted<StateWatcher> {
public:
StateWatcher(grpc_channel* channel, grpc_completion_queue* cq, void* tag,
grpc_connectivity_state last_observed_state,
@@ -73,16 +86,35 @@ class StateWatcher {
GRPC_CHANNEL_INTERNAL_REF(channel, "watch_channel_connectivity");
GRPC_CLOSURE_INIT(&on_complete_, WatchComplete, this, nullptr);
GRPC_CLOSURE_INIT(&on_timeout_, TimeoutComplete, this, nullptr);
- auto* watcher_timer_init_state = new WatcherTimerInitState(
- this, grpc_timespec_to_millis_round_up(deadline));
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel);
- GPR_ASSERT(client_channel != nullptr);
+ if (client_channel == nullptr) {
+ // If the target URI used to create the channel was invalid, channel
+ // stack initialization failed, and that caused us to create a lame
+ // channel. In that case, connectivity state will never change (it
+ // will always be TRANSIENT_FAILURE), so we don't actually start a
+ // watch, but we are hiding that fact from the application.
+ if (IsLameChannel(channel)) {
+ // Ref from object creation is held by timer callback.
+ StartTimer(Timestamp::FromTimespecRoundUp(deadline));
+ return;
+ }
+ gpr_log(GPR_ERROR,
+ "grpc_channel_watch_connectivity_state called on "
+ "something that is not a client channel");
+ GPR_ASSERT(false);
+ }
+ // Take an addition ref, so we have two (the first one is from the
+ // creation of this object). One will be held by the timer callback,
+ // the other by the watcher callback.
+ Ref().release();
+ auto* watcher_timer_init_state = new WatcherTimerInitState(
+ this, Timestamp::FromTimespecRoundUp(deadline));
client_channel->AddExternalConnectivityWatcher(
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &state_,
&on_complete_, watcher_timer_init_state->closure());
}
- ~StateWatcher() {
+ ~StateWatcher() override {
GRPC_CHANNEL_INTERNAL_UNREF(channel_, "watch_channel_connectivity");
}
@@ -91,7 +123,7 @@ class StateWatcher {
// ClientChannel actually starts the watch.
class WatcherTimerInitState {
public:
- WatcherTimerInitState(StateWatcher* state_watcher, grpc_millis deadline)
+ WatcherTimerInitState(StateWatcher* state_watcher, Timestamp deadline)
: state_watcher_(state_watcher), deadline_(deadline) {
GRPC_CLOSURE_INIT(&closure_, WatcherTimerInit, this, nullptr);
}
@@ -101,104 +133,55 @@ class StateWatcher {
private:
static void WatcherTimerInit(void* arg, grpc_error_handle /*error*/) {
auto* self = static_cast<WatcherTimerInitState*>(arg);
- grpc_timer_init(&self->state_watcher_->timer_, self->deadline_,
- &self->state_watcher_->on_timeout_);
+ self->state_watcher_->StartTimer(self->deadline_);
delete self;
}
StateWatcher* state_watcher_;
- grpc_millis deadline_;
+ Timestamp deadline_;
grpc_closure closure_;
};
- enum CallbackPhase { kWaiting, kReadyToCallBack, kCallingBackAndFinished };
+ void StartTimer(Timestamp deadline) {
+ grpc_timer_init(&timer_, deadline, &on_timeout_);
+ }
- // Called when the completion is returned to the CQ.
- static void FinishedCompletion(void* arg, grpc_cq_completion* /*ignored*/) {
+ static void WatchComplete(void* arg, grpc_error_handle error) {
auto* self = static_cast<StateWatcher*>(arg);
- bool should_delete = false;
- {
- MutexLock lock(&self->mu_);
- switch (self->phase_) {
- case kWaiting:
- case kReadyToCallBack:
- GPR_UNREACHABLE_CODE(return );
- case kCallingBackAndFinished:
- should_delete = true;
- }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
+ GRPC_LOG_IF_ERROR("watch_completion_error", GRPC_ERROR_REF(error));
}
- if (should_delete) delete self;
+ grpc_timer_cancel(&self->timer_);
+ self->Unref();
}
- void PartlyDone(bool due_to_completion, grpc_error_handle error) {
- bool end_op = false;
- void* end_op_tag = nullptr;
- grpc_error_handle end_op_error = GRPC_ERROR_NONE;
- grpc_completion_queue* end_op_cq = nullptr;
- grpc_cq_completion* end_op_completion_storage = nullptr;
- if (due_to_completion) {
- grpc_timer_cancel(&timer_);
- } else {
- grpc_core::ClientChannel* client_channel =
- grpc_core::ClientChannel::GetFromChannel(channel_);
- GPR_ASSERT(client_channel != nullptr);
- client_channel->CancelExternalConnectivityWatcher(&on_complete_);
- }
- {
- MutexLock lock(&mu_);
- if (due_to_completion) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
- GRPC_LOG_IF_ERROR("watch_completion_error", GRPC_ERROR_REF(error));
- }
- GRPC_ERROR_UNREF(error);
- error = GRPC_ERROR_NONE;
- } else {
- if (error == GRPC_ERROR_NONE) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Timed out waiting for connection state change");
- } else if (error == GRPC_ERROR_CANCELLED) {
- error = GRPC_ERROR_NONE;
- }
- }
- switch (phase_) {
- case kWaiting:
- GRPC_ERROR_REF(error);
- error_ = error;
- phase_ = kReadyToCallBack;
- break;
- case kReadyToCallBack:
- if (error != GRPC_ERROR_NONE) {
- GPR_ASSERT(!due_to_completion);
- GRPC_ERROR_UNREF(error_);
- GRPC_ERROR_REF(error);
- error_ = error;
- }
- phase_ = kCallingBackAndFinished;
- end_op = true;
- end_op_cq = cq_;
- end_op_tag = tag_;
- end_op_error = error_;
- end_op_completion_storage = &completion_storage_;
- break;
- case kCallingBackAndFinished:
- GPR_UNREACHABLE_CODE(return );
- }
- }
- if (end_op) {
- grpc_cq_end_op(end_op_cq, end_op_tag, end_op_error, FinishedCompletion,
- this, end_op_completion_storage);
+ static void TimeoutComplete(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<StateWatcher*>(arg);
+ self->timer_fired_ = error == GRPC_ERROR_NONE;
+ // If this is a client channel (not a lame channel), cancel the watch.
+ ClientChannel* client_channel =
+ ClientChannel::GetFromChannel(self->channel_);
+ if (client_channel != nullptr) {
+ client_channel->CancelExternalConnectivityWatcher(&self->on_complete_);
}
- GRPC_ERROR_UNREF(error);
+ self->Unref();
}
- static void WatchComplete(void* arg, grpc_error_handle error) {
- auto* self = static_cast<StateWatcher*>(arg);
- self->PartlyDone(/*due_to_completion=*/true, GRPC_ERROR_REF(error));
+ // Invoked when both strong refs are released.
+ void Orphan() override {
+ WeakRef().release(); // Take a weak ref until completion is finished.
+ grpc_error_handle error =
+ timer_fired_ ? GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Timed out waiting for connection state change")
+ : GRPC_ERROR_NONE;
+ grpc_cq_end_op(cq_, tag_, error, FinishedCompletion, this,
+ &completion_storage_);
}
- static void TimeoutComplete(void* arg, grpc_error_handle error) {
+ // Called when the completion is returned to the CQ.
+ static void FinishedCompletion(void* arg, grpc_cq_completion* /*ignored*/) {
auto* self = static_cast<StateWatcher*>(arg);
- self->PartlyDone(/*due_to_completion=*/false, GRPC_ERROR_REF(error));
+ self->WeakUnref();
}
grpc_channel* channel_;
@@ -213,9 +196,7 @@ class StateWatcher {
grpc_timer timer_;
grpc_closure on_timeout_;
- Mutex mu_;
- CallbackPhase phase_ ABSL_GUARDED_BY(mu_) = kWaiting;
- grpc_error_handle error_ ABSL_GUARDED_BY(mu_) = GRPC_ERROR_NONE;
+ bool timer_fired_ = false;
};
} // namespace
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel.cc b/grpc/src/core/ext/filters/client_channel/client_channel.cc
index 3bbec5ea..c52f8a73 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel.cc
+++ b/grpc/src/core/ext/filters/client_channel/client_channel.cc
@@ -26,19 +26,18 @@
#include <set>
+#include "absl/container/inlined_vector.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "absl/container/inlined_vector.h"
-#include "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"
@@ -49,15 +48,13 @@
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/local_subchannel_pool.h"
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
-#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_filter.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/subchannel.h"
#include "src/core/ext/filters/deadline/deadline_filter.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/channel/connected_channel.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
@@ -66,28 +63,32 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/service_config/service_config_impl.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/metadata_batch.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "src/core/lib/transport/status_metadata.h"
//
// Client channel filter
//
+#define GRPC_ARG_HEALTH_CHECK_SERVICE_NAME \
+ "grpc.internal.health_check_service_name"
+
namespace grpc_core {
using internal::ClientChannelGlobalParsedConfig;
using internal::ClientChannelMethodParsedConfig;
using internal::ClientChannelServiceConfigParser;
+TraceFlag grpc_client_channel_trace(false, "client_channel");
TraceFlag grpc_client_channel_call_trace(false, "client_channel_call");
-TraceFlag grpc_client_channel_routing_trace(false, "client_channel_routing");
+TraceFlag grpc_client_channel_lb_call_trace(false, "client_channel_lb_call");
//
// ClientChannel::CallData definition
@@ -174,10 +175,8 @@ class ClientChannel::CallData {
void MaybeAddCallToResolverQueuedCallsLocked(grpc_call_element* elem)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
- static void RecvInitialMetadataReadyForConfigSelectorCommitCallback(
+ static void RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
void* arg, grpc_error_handle error);
- void InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(
- grpc_transport_stream_op_batch* batch);
void CreateDynamicCall(grpc_call_element* elem);
@@ -191,7 +190,7 @@ class ClientChannel::CallData {
grpc_slice path_; // Request path.
gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
+ Timestamp deadline_;
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
@@ -199,7 +198,7 @@ class ClientChannel::CallData {
grpc_polling_entity* pollent_ = nullptr;
- grpc_closure pick_closure_;
+ grpc_closure resolution_done_closure_;
// Accessed while holding ClientChannel::resolution_mu_.
bool service_config_applied_ ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) =
@@ -211,10 +210,8 @@ class ClientChannel::CallData {
ResolverQueuedCallCanceller* resolver_call_canceller_
ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) = nullptr;
- std::function<void()> on_call_committed_;
-
- grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
- grpc_closure recv_initial_metadata_ready_;
+ grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
+ grpc_closure recv_trailing_metadata_ready_;
RefCountedPtr<DynamicFilters> dynamic_filters_;
RefCountedPtr<DynamicFilters::Call> dynamic_call_;
@@ -236,6 +233,7 @@ class ClientChannel::CallData {
const grpc_channel_filter ClientChannel::kFilterVtable = {
ClientChannel::CallData::StartTransportStreamOpBatch,
+ nullptr,
ClientChannel::StartTransportOp,
sizeof(ClientChannel::CallData),
ClientChannel::CallData::Init,
@@ -257,7 +255,7 @@ namespace {
// Channel arg pointer vtable for GRPC_ARG_CLIENT_CHANNEL.
void* ClientChannelArgCopy(void* p) { return p; }
void ClientChannelArgDestroy(void* /*p*/) {}
-int ClientChannelArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int ClientChannelArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kClientChannelArgPointerVtable = {
ClientChannelArgCopy, ClientChannelArgDestroy, ClientChannelArgCmp};
@@ -271,7 +269,7 @@ void ServiceConfigObjArgDestroy(void* p) {
auto* service_config = static_cast<ServiceConfig*>(p);
service_config->Unref();
}
-int ServiceConfigObjArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int ServiceConfigObjArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kServiceConfigObjArgPointerVtable = {
ServiceConfigObjArgCopy, ServiceConfigObjArgDestroy,
ServiceConfigObjArgCmp};
@@ -345,14 +343,18 @@ class DynamicTerminationFilter::CallData {
auto* calld = static_cast<CallData*>(elem->call_data);
auto* chand = static_cast<DynamicTerminationFilter*>(elem->channel_data);
ClientChannel* client_channel = chand->chand_;
- grpc_call_element_args args = {
- calld->owning_call_, nullptr,
- calld->call_context_, calld->path_,
- calld->call_start_time_, calld->deadline_,
- calld->arena_, calld->call_combiner_};
- calld->lb_call_ =
- client_channel->CreateLoadBalancedCall(args, pollent, nullptr);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ grpc_call_element_args args = {calld->owning_call_, nullptr,
+ calld->call_context_, calld->path_,
+ /*start_time=*/0, calld->deadline_,
+ calld->arena_, calld->call_combiner_};
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ calld->lb_call_ = client_channel->CreateLoadBalancedCall(
+ args, pollent, nullptr,
+ service_config_call_data->call_dispatch_controller(),
+ /*is_transparent_retry=*/false);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p dynamic_termination_calld=%p: create lb_call=%p", chand,
client_channel, calld->lb_call_.get());
@@ -362,7 +364,6 @@ class DynamicTerminationFilter::CallData {
private:
explicit CallData(const grpc_call_element_args& args)
: path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
deadline_(args.deadline),
arena_(args.arena),
owning_call_(args.call_stack),
@@ -372,18 +373,18 @@ class DynamicTerminationFilter::CallData {
~CallData() { grpc_slice_unref_internal(path_); }
grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
+ Timestamp deadline_;
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
- RefCountedPtr<ClientChannel::LoadBalancedCall> lb_call_;
+ OrphanablePtr<ClientChannel::LoadBalancedCall> lb_call_;
};
const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
DynamicTerminationFilter::CallData::StartTransportStreamOpBatch,
+ nullptr,
DynamicTerminationFilter::StartTransportOp,
sizeof(DynamicTerminationFilter::CallData),
DynamicTerminationFilter::CallData::Init,
@@ -409,22 +410,17 @@ class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler {
}
~ResolverResultHandler() override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: resolver shutdown complete", chand_);
}
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ResolverResultHandler");
}
- void ReturnResult(Resolver::Result result) override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ void ReportResult(Resolver::Result result) override
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
chand_->OnResolverResultChangedLocked(std::move(result));
}
- void ReturnError(grpc_error_handle error) override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
- chand_->OnResolverErrorLocked(error);
- }
-
private:
ClientChannel* chand_;
};
@@ -445,65 +441,64 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
public:
SubchannelWrapper(ClientChannel* chand, RefCountedPtr<Subchannel> subchannel,
absl::optional<std::string> health_check_service_name)
- : SubchannelInterface(
- GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
- ? "SubchannelWrapper"
- : nullptr),
+ : SubchannelInterface(GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)
+ ? "SubchannelWrapper"
+ : nullptr),
chand_(chand),
subchannel_(std::move(subchannel)),
health_check_service_name_(std::move(health_check_service_name)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: creating subchannel wrapper %p for subchannel %p",
chand, this, subchannel_.get());
}
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper");
- auto* subchannel_node = subchannel_->channelz_node();
- if (subchannel_node != nullptr) {
- auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
- if (it == chand_->subchannel_refcount_map_.end()) {
- chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid());
- it = chand_->subchannel_refcount_map_.emplace(subchannel_.get(), 0)
- .first;
+ if (chand_->channelz_node_ != nullptr) {
+ auto* subchannel_node = subchannel_->channelz_node();
+ if (subchannel_node != nullptr) {
+ auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
+ if (it == chand_->subchannel_refcount_map_.end()) {
+ chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid());
+ it = chand_->subchannel_refcount_map_.emplace(subchannel_.get(), 0)
+ .first;
+ }
+ ++it->second;
}
- ++it->second;
}
chand_->subchannel_wrappers_.insert(this);
}
~SubchannelWrapper() override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: destroying subchannel wrapper %p for subchannel %p",
chand_, this, subchannel_.get());
}
chand_->subchannel_wrappers_.erase(this);
- auto* subchannel_node = subchannel_->channelz_node();
- if (subchannel_node != nullptr) {
- auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
- GPR_ASSERT(it != chand_->subchannel_refcount_map_.end());
- --it->second;
- if (it->second == 0) {
- chand_->channelz_node_->RemoveChildSubchannel(subchannel_node->uuid());
- chand_->subchannel_refcount_map_.erase(it);
+ if (chand_->channelz_node_ != nullptr) {
+ auto* subchannel_node = subchannel_->channelz_node();
+ if (subchannel_node != nullptr) {
+ auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
+ GPR_ASSERT(it != chand_->subchannel_refcount_map_.end());
+ --it->second;
+ if (it->second == 0) {
+ chand_->channelz_node_->RemoveChildSubchannel(
+ subchannel_node->uuid());
+ chand_->subchannel_refcount_map_.erase(it);
+ }
}
}
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "SubchannelWrapper");
}
- grpc_connectivity_state CheckConnectivityState() override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
- grpc_connectivity_state connectivity_state =
- subchannel_->CheckConnectivityState(health_check_service_name_,
- &connected_subchannel);
- MaybeUpdateConnectedSubchannel(std::move(connected_subchannel));
- return connectivity_state;
+ grpc_connectivity_state CheckConnectivityState() override {
+ return subchannel_->CheckConnectivityState(health_check_service_name_);
}
void WatchConnectivityState(
grpc_connectivity_state initial_state,
- std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override {
+ std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
auto& watcher_wrapper = watcher_map_[watcher.get()];
GPR_ASSERT(watcher_wrapper == nullptr);
watcher_wrapper = new WatcherWrapper(std::move(watcher),
@@ -515,8 +510,8 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
watcher_wrapper));
}
- void CancelConnectivityStateWatch(
- ConnectivityStateWatcherInterface* watcher) override {
+ void CancelConnectivityStateWatch(ConnectivityStateWatcherInterface* watcher)
+ override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
auto it = watcher_map_.find(watcher);
GPR_ASSERT(it != watcher_map_.end());
subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
@@ -524,6 +519,10 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
watcher_map_.erase(it);
}
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel() const {
+ return subchannel_->connected_subchannel();
+ }
+
void AttemptToConnect() override { subchannel_->AttemptToConnect(); }
void ResetBackoff() override { subchannel_->ResetBackoff(); }
@@ -536,57 +535,6 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
subchannel_->ThrottleKeepaliveTime(new_keepalive_time);
}
- void UpdateHealthCheckServiceName(
- absl::optional<std::string> health_check_service_name) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: subchannel wrapper %p: updating health check service "
- "name from \"%s\" to \"%s\"",
- chand_, this, health_check_service_name_->c_str(),
- health_check_service_name->c_str());
- }
- for (auto& p : watcher_map_) {
- WatcherWrapper*& watcher_wrapper = p.second;
- // Cancel the current watcher and create a new one using the new
- // health check service name.
- // TODO(roth): If there is not already an existing health watch
- // call for the new name, then the watcher will initially report
- // state CONNECTING. If the LB policy is currently reporting
- // state READY, this may cause it to switch to CONNECTING before
- // switching back to READY. This could cause a small delay for
- // RPCs being started on the channel. If/when this becomes a
- // problem, we may be able to handle it by waiting for the new
- // watcher to report READY before we use it to replace the old one.
- WatcherWrapper* replacement = watcher_wrapper->MakeReplacement();
- subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
- watcher_wrapper);
- watcher_wrapper = replacement;
- subchannel_->WatchConnectivityState(
- replacement->last_seen_state(), health_check_service_name,
- 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.
- ConnectedSubchannel* connected_subchannel() const
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::work_serializer_) {
- return connected_subchannel_.get();
- }
-
- // Caller must be holding the data-plane mutex.
- ConnectedSubchannel* connected_subchannel_in_data_plane() const
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
- return connected_subchannel_in_data_plane_.get();
- }
- void set_connected_subchannel_in_data_plane(
- RefCountedPtr<ConnectedSubchannel> connected_subchannel)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
- connected_subchannel_in_data_plane_ = std::move(connected_subchannel);
- }
-
private:
// Subchannel and SubchannelInterface have different interfaces for
// their respective ConnectivityStateWatcherInterface classes.
@@ -616,15 +564,15 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
~WatcherWrapper() override {
auto* parent = parent_.release(); // ref owned by lambda
parent->chand_->work_serializer_->Run(
- [parent]()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
- parent->Unref(DEBUG_LOCATION, "WatcherWrapper");
- },
+ [parent]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
+ *parent_->chand_->work_serializer_) {
+ parent->Unref(DEBUG_LOCATION, "WatcherWrapper");
+ },
DEBUG_LOCATION);
}
void OnConnectivityStateChange() override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: connectivity change for subchannel wrapper %p "
"subchannel %p; hopping into work_serializer",
@@ -632,11 +580,11 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
}
Ref().release(); // ref owned by lambda
parent_->chand_->work_serializer_->Run(
- [this]()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
- ApplyUpdateInControlPlaneWorkSerializer();
- Unref();
- },
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
+ *parent_->chand_->work_serializer_) {
+ ApplyUpdateInControlPlaneWorkSerializer();
+ Unref();
+ },
DEBUG_LOCATION);
}
@@ -658,8 +606,8 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
private:
void ApplyUpdateInControlPlaneWorkSerializer()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*parent_->chand_->work_serializer_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: processing connectivity change in work serializer "
"for subchannel wrapper %p subchannel %p "
@@ -676,7 +624,7 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
&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)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: throttling keepalive time to %d",
parent_->chand_, parent_->chand_->keepalive_time_);
}
@@ -698,8 +646,6 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
// 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);
}
}
@@ -711,28 +657,6 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
WatcherWrapper* replacement_ = nullptr;
};
- void MaybeUpdateConnectedSubchannel(
- RefCountedPtr<ConnectedSubchannel> connected_subchannel)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::work_serializer_) {
- // Update the connected subchannel only if the channel is not shutting
- // down. This is because once the channel is shutting down, we
- // ignore picker updates from the LB policy, which means that
- // UpdateStateAndPickerLocked() will never process the entries
- // in chand_->pending_subchannel_updates_. So we don't want to add
- // entries there that will never be processed, since that would
- // leave dangling refs to the channel and prevent its destruction.
- grpc_error_handle disconnect_error = chand_->disconnect_error();
- if (disconnect_error != GRPC_ERROR_NONE) return;
- // Not shutting down, so do the update.
- if (connected_subchannel_ != connected_subchannel) {
- connected_subchannel_ = std::move(connected_subchannel);
- // Record the new connected subchannel so that it can be updated
- // in the data plane mutex the next time the picker is updated.
- chand_->pending_subchannel_updates_[Ref(
- DEBUG_LOCATION, "ConnectedSubchannelUpdate")] = connected_subchannel_;
- }
- }
-
ClientChannel* chand_;
RefCountedPtr<Subchannel> subchannel_;
absl::optional<std::string> health_check_service_name_;
@@ -741,13 +665,8 @@ class ClientChannel::SubchannelWrapper : public SubchannelInterface {
// 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.
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_
- ABSL_GUARDED_BY(&ClientChannel::work_serializer_);
- // To be accessed only in the data plane mutex.
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_in_data_plane_
- ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_);
+ std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_
+ ABSL_GUARDED_BY(*chand_->work_serializer_);
};
//
@@ -777,7 +696,7 @@ ClientChannel::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
}
// Pass the ref from creating the object to Start().
chand_->work_serializer_->Run(
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
// The ref is passed to AddWatcherLocked().
AddWatcherLocked();
},
@@ -812,8 +731,8 @@ void ClientChannel::ExternalConnectivityWatcher::
void ClientChannel::ExternalConnectivityWatcher::Notify(
grpc_connectivity_state state, const absl::Status& /* status */) {
bool done = false;
- if (!done_.CompareExchangeStrong(&done, true, MemoryOrder::RELAXED,
- MemoryOrder::RELAXED)) {
+ if (!done_.compare_exchange_strong(done, true, std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
return; // Already done.
}
// Remove external watcher.
@@ -827,7 +746,7 @@ void ClientChannel::ExternalConnectivityWatcher::Notify(
// automatically remove all watchers in that case.
if (state != GRPC_CHANNEL_SHUTDOWN) {
chand_->work_serializer_->Run(
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
RemoveWatcherLocked();
},
DEBUG_LOCATION);
@@ -836,14 +755,14 @@ void ClientChannel::ExternalConnectivityWatcher::Notify(
void ClientChannel::ExternalConnectivityWatcher::Cancel() {
bool done = false;
- if (!done_.CompareExchangeStrong(&done, true, MemoryOrder::RELAXED,
- MemoryOrder::RELAXED)) {
+ if (!done_.compare_exchange_strong(done, true, std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
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]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
RemoveWatcherLocked();
},
DEBUG_LOCATION);
@@ -874,7 +793,7 @@ class ClientChannel::ConnectivityWatcherAdder {
watcher_(std::move(watcher)) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherAdder");
chand_->work_serializer_->Run(
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
AddWatcherLocked();
},
DEBUG_LOCATION);
@@ -882,7 +801,7 @@ class ClientChannel::ConnectivityWatcherAdder {
private:
void AddWatcherLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
chand_->state_tracker_.AddWatcher(initial_state_, std::move(watcher_));
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ConnectivityWatcherAdder");
delete this;
@@ -904,7 +823,7 @@ class ClientChannel::ConnectivityWatcherRemover {
: chand_(chand), watcher_(watcher) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherRemover");
chand_->work_serializer_->Run(
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
RemoveWatcherLocked();
},
DEBUG_LOCATION);
@@ -912,7 +831,7 @@ class ClientChannel::ConnectivityWatcherRemover {
private:
void RemoveWatcherLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
chand_->state_tracker_.RemoveWatcher(watcher_);
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
"ConnectivityWatcherRemover");
@@ -941,38 +860,65 @@ class ClientChannel::ClientChannelControlHelper
RefCountedPtr<SubchannelInterface> CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return nullptr; // Shutting down.
// Determine health check service name.
- bool inhibit_health_checking = grpc_channel_args_find_bool(
- &args, GRPC_ARG_INHIBIT_HEALTH_CHECKING, false);
absl::optional<std::string> health_check_service_name;
- if (!inhibit_health_checking) {
- health_check_service_name = chand_->health_check_service_name_;
+ const char* health_check_service_name_arg = grpc_channel_args_find_string(
+ &args, GRPC_ARG_HEALTH_CHECK_SERVICE_NAME);
+ if (health_check_service_name_arg != nullptr) {
+ bool inhibit_health_checking = grpc_channel_args_find_bool(
+ &args, GRPC_ARG_INHIBIT_HEALTH_CHECKING, false);
+ if (!inhibit_health_checking) {
+ health_check_service_name = health_check_service_name_arg;
+ }
}
+ // Construct channel args for subchannel.
// Remove channel args that should not affect subchannel uniqueness.
- static const char* args_to_remove[] = {
+ absl::InlinedVector<const char*, 4> args_to_remove = {
+ GRPC_ARG_HEALTH_CHECK_SERVICE_NAME,
GRPC_ARG_INHIBIT_HEALTH_CHECKING,
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
};
// Add channel args needed for the subchannel.
- absl::InlinedVector<grpc_arg, 3> args_to_add = {
- Subchannel::CreateSubchannelAddressArg(&address.address()),
+ absl::InlinedVector<grpc_arg, 2> args_to_add = {
SubchannelPoolInterface::CreateChannelArg(
chand_->subchannel_pool_.get()),
};
+ // Check if default authority arg is already set.
+ const char* default_authority =
+ grpc_channel_args_find_string(&args, GRPC_ARG_DEFAULT_AUTHORITY);
+ // Add args from subchannel address.
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_arg& arg = address.args()->args[j];
+ if (strcmp(arg.key, GRPC_ARG_DEFAULT_AUTHORITY) == 0) {
+ // Don't add default authority arg from subchannel address if
+ // it's already set at the channel level -- the value from the
+ // application should take precedence over what is set by the
+ // resolver.
+ if (default_authority != nullptr) continue;
+ default_authority = arg.value.string;
+ }
+ args_to_add.emplace_back(arg);
}
}
+ // If we haven't already set the default authority arg, add it from
+ // the channel.
+ if (default_authority == nullptr) {
+ // Remove it, just in case it's actually present but is the wrong type.
+ args_to_remove.push_back(GRPC_ARG_DEFAULT_AUTHORITY);
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>(chand_->default_authority_.c_str())));
+ }
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);
+ &args, args_to_remove.data(), args_to_remove.size(), args_to_add.data(),
+ args_to_add.size());
// Create subchannel.
RefCountedPtr<Subchannel> subchannel =
- chand_->client_channel_factory_->CreateSubchannel(new_args);
+ chand_->client_channel_factory_->CreateSubchannel(address.address(),
+ new_args);
grpc_channel_args_destroy(new_args);
if (subchannel == nullptr) return nullptr;
// Make sure the subchannel has updated keepalive time.
@@ -985,11 +931,10 @@ class ClientChannel::ClientChannelControlHelper
void UpdateState(
grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
- grpc_error_handle disconnect_error = chand_->disconnect_error();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- const char* extra = disconnect_error == GRPC_ERROR_NONE
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
+ const char* extra = chand_->disconnect_error_ == GRPC_ERROR_NONE
? ""
: " (ignoring -- channel shutting down)";
gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s",
@@ -997,23 +942,27 @@ class ClientChannel::ClientChannelControlHelper
picker.get(), extra);
}
// Do update only if not shutting down.
- if (disconnect_error == GRPC_ERROR_NONE) {
+ if (chand_->disconnect_error_ == GRPC_ERROR_NONE) {
chand_->UpdateStateAndPickerLocked(state, status, "helper",
std::move(picker));
}
}
void RequestReresolution() override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: started name re-resolving", chand_);
}
chand_->resolver_->RequestReresolutionLocked();
}
+ absl::string_view GetAuthority() override {
+ return chand_->default_authority_;
+ }
+
void AddTraceEvent(TraceSeverity severity, absl::string_view message) override
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
if (chand_->channelz_node_ != nullptr) {
chand_->channelz_node_->AddTraceEvent(
@@ -1060,10 +1009,6 @@ void ClientChannel::Destroy(grpc_channel_element* elem) {
namespace {
-bool GetEnableRetries(const grpc_channel_args* args) {
- return grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_RETRIES, false);
-}
-
RefCountedPtr<SubchannelPoolInterface> GetSubchannelPool(
const grpc_channel_args* args) {
const bool use_local_subchannel_pool = grpc_channel_args_find_bool(
@@ -1085,17 +1030,17 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
grpc_error_handle* error)
: deadline_checking_enabled_(
grpc_deadline_checking_enabled(args->channel_args)),
- enable_retries_(GetEnableRetries(args->channel_args)),
owning_stack_(args->channel_stack),
client_channel_factory_(
ClientChannelFactory::GetFromChannelArgs(args->channel_args)),
channelz_node_(GetChannelzNode(args->channel_args)),
interested_parties_(grpc_pollset_set_create()),
+ service_config_parser_index_(
+ internal::ClientChannelServiceConfigParser::ParserIndex()),
work_serializer_(std::make_shared<WorkSerializer>()),
state_tracker_("client_channel", GRPC_CHANNEL_IDLE),
- subchannel_pool_(GetSubchannelPool(args->channel_args)),
- disconnect_error_(GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ subchannel_pool_(GetSubchannelPool(args->channel_args)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: creating client_channel for channel stack %p",
this, owning_stack_);
}
@@ -1107,15 +1052,6 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
"Missing client channel factory in args for client channel filter");
return;
}
- // Get server name to resolve, using proxy mapper if needed.
- const char* server_uri =
- grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
- if (server_uri == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "server URI channel arg missing or wrong type in client channel "
- "filter");
- return;
- }
// Get default service config. If none is specified via the client API,
// we use an empty config.
const char* service_config_json = grpc_channel_args_find_string(
@@ -1123,58 +1059,82 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
if (service_config_json == nullptr) service_config_json = "{}";
*error = GRPC_ERROR_NONE;
default_service_config_ =
- ServiceConfig::Create(args->channel_args, service_config_json, error);
+ ServiceConfigImpl::Create(args->channel_args, service_config_json, error);
if (*error != GRPC_ERROR_NONE) {
default_service_config_.reset();
return;
}
- absl::StatusOr<URI> uri = URI::Parse(server_uri);
- if (uri.ok() && !uri->path().empty()) {
- server_name_ = std::string(absl::StripPrefix(uri->path(), "/"));
+ // Get URI to resolve, using proxy mapper if needed.
+ const char* server_uri =
+ grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
+ if (server_uri == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "target URI channel arg missing or wrong type in client channel "
+ "filter");
+ return;
}
+ uri_to_resolve_ = server_uri;
char* proxy_name = nullptr;
grpc_channel_args* new_args = nullptr;
ProxyMapperRegistry::MapName(server_uri, args->channel_args, &proxy_name,
&new_args);
- target_uri_.reset(proxy_name != nullptr ? proxy_name
- : gpr_strdup(server_uri));
+ if (proxy_name != nullptr) {
+ uri_to_resolve_ = proxy_name;
+ gpr_free(proxy_name);
+ }
+ // Make sure the URI to resolve is valid, so that we know that
+ // resolver creation will succeed later.
+ if (!CoreConfiguration::Get().resolver_registry().IsValidTarget(
+ uri_to_resolve_)) {
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("the target uri is not valid: ", uri_to_resolve_));
+ return;
+ }
// 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);
+ // Set initial keepalive time.
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())) {
- std::string error_message =
- absl::StrCat("the target uri is not valid: ", target_uri_.get());
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_message.c_str());
- return;
+ // Set default authority.
+ const char* default_authority =
+ grpc_channel_args_find_string(channel_args_, GRPC_ARG_DEFAULT_AUTHORITY);
+ if (default_authority == nullptr) {
+ default_authority_ =
+ CoreConfiguration::Get().resolver_registry().GetDefaultAuthority(
+ server_uri);
+ } else {
+ default_authority_ = default_authority;
}
+ // Success.
*error = GRPC_ERROR_NONE;
}
ClientChannel::~ClientChannel() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: destroying channel", this);
}
DestroyResolverAndLbPolicyLocked();
grpc_channel_args_destroy(channel_args_);
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
// Stop backup polling.
grpc_client_channel_stop_backup_polling(interested_parties_);
grpc_pollset_set_destroy(interested_parties_);
- GRPC_ERROR_UNREF(disconnect_error_.Load(MemoryOrder::RELAXED));
+ GRPC_ERROR_UNREF(disconnect_error_);
}
-RefCountedPtr<ClientChannel::LoadBalancedCall>
+OrphanablePtr<ClientChannel::LoadBalancedCall>
ClientChannel::CreateLoadBalancedCall(
const grpc_call_element_args& args, grpc_polling_entity* pollent,
- grpc_closure* on_call_destruction_complete) {
- return args.arena->New<LoadBalancedCall>(this, args, pollent,
- on_call_destruction_complete);
+ grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry) {
+ return OrphanablePtr<LoadBalancedCall>(args.arena->New<LoadBalancedCall>(
+ this, args, pollent, on_call_destruction_complete,
+ call_dispatch_controller, is_transparent_retry));
}
namespace {
@@ -1194,6 +1154,24 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
} else {
policy_name = grpc_channel_args_find_string(resolver_result.args,
GRPC_ARG_LB_POLICY_NAME);
+ bool requires_config = false;
+ if (policy_name != nullptr &&
+ (!LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
+ policy_name, &requires_config) ||
+ requires_config)) {
+ if (requires_config) {
+ gpr_log(GPR_ERROR,
+ "LB policy: %s passed through channel_args must not "
+ "require a config. Using pick_first instead.",
+ policy_name);
+ } else {
+ gpr_log(GPR_ERROR,
+ "LB policy: %s passed through channel_args does not exist. "
+ "Using pick_first instead.",
+ policy_name);
+ }
+ policy_name = "pick_first";
+ }
}
// Use pick_first if nothing was specified and we didn't select grpclb
// above.
@@ -1211,12 +1189,9 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
// 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.
+ // - A channel arg, in which case we check that the specified policy exists
+ // and accepts an empty config. If not, we revert to using pick_first
+ // lb_policy
GPR_ASSERT(lb_policy_config != nullptr);
GPR_ASSERT(parse_error == GRPC_ERROR_NONE);
return lb_policy_config;
@@ -1227,7 +1202,7 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
// Handle race conditions.
if (resolver_ == nullptr) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: got resolver result", this);
}
// We only want to trace the address resolution in the follow cases:
@@ -1240,31 +1215,34 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
//
// We track a list of strings to eventually be concatenated and traced.
absl::InlinedVector<const char*, 3> trace_strings;
- if (result.addresses.empty() && previous_resolution_contained_addresses_) {
+ const bool resolution_contains_addresses =
+ result.addresses.ok() && !result.addresses->empty();
+ if (!resolution_contains_addresses &&
+ previous_resolution_contained_addresses_) {
trace_strings.push_back("Address list became empty");
- } else if (!result.addresses.empty() &&
+ } else if (resolution_contains_addresses &&
!previous_resolution_contained_addresses_) {
trace_strings.push_back("Address list became non-empty");
}
- previous_resolution_contained_addresses_ = !result.addresses.empty();
+ previous_resolution_contained_addresses_ = resolution_contains_addresses;
std::string service_config_error_string_storage;
- if (result.service_config_error != GRPC_ERROR_NONE) {
+ if (!result.service_config.ok()) {
service_config_error_string_storage =
- grpc_error_std_string(result.service_config_error);
+ result.service_config.status().ToString();
trace_strings.push_back(service_config_error_string_storage.c_str());
}
// Choose the service config.
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)) {
+ if (!result.service_config.ok()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s",
- this, grpc_error_std_string(result.service_config_error).c_str());
+ this, result.service_config.status().ToString().c_str());
}
// If the service config was invalid, then fallback to the
// previously returned service config.
if (saved_service_config_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: resolver returned invalid service config. "
"Continuing to use previous service config.",
@@ -1273,15 +1251,15 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
service_config = saved_service_config_;
config_selector = saved_config_selector_;
} else {
- // We received an invalid service config and we don't have a
+ // We received a service config error and we don't have a
// previous service config to fall back to. Put the channel into
// TRANSIENT_FAILURE.
- OnResolverErrorLocked(GRPC_ERROR_REF(result.service_config_error));
+ OnResolverErrorLocked(result.service_config.status());
trace_strings.push_back("no valid service config");
}
- } else if (result.service_config == nullptr) {
+ } else if (*result.service_config == nullptr) {
// Resolver did not return any service config.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: resolver returned no service config. Using default "
"service config for channel.",
@@ -1290,15 +1268,18 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
service_config = default_service_config_;
} else {
// Use ServiceConfig and ConfigSelector returned by resolver.
- service_config = result.service_config;
+ service_config = std::move(*result.service_config);
config_selector = ConfigSelector::GetFromChannelArgs(*result.args);
}
+ // Note: The only case in which service_config is null here is if the resolver
+ // returned a service config error and we don't have a previous service
+ // config to fall back to.
if (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()));
+ service_config_parser_index_));
// Choose LB policy config.
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config =
ChooseLbPolicy(result, parsed_service_config);
@@ -1312,15 +1293,16 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
// If either has changed, apply the global parameters now.
if (service_config_changed || config_selector_changed) {
// Update service config in control plane.
- UpdateServiceConfigInControlPlaneLocked(
- std::move(service_config), std::move(config_selector),
- parsed_service_config, lb_policy_config->name());
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ UpdateServiceConfigInControlPlaneLocked(std::move(service_config),
+ std::move(config_selector),
+ lb_policy_config->name());
+ } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: service config not changed", this);
}
// Create or update LB policy, as needed.
- CreateOrUpdateLbPolicyLocked(std::move(lb_policy_config),
- std::move(result));
+ CreateOrUpdateLbPolicyLocked(
+ std::move(lb_policy_config),
+ parsed_service_config->health_check_service_name(), std::move(result));
if (service_config_changed || config_selector_changed) {
// Start using new service config for calls.
// This needs to happen after the LB policy has been updated, since
@@ -1343,27 +1325,21 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
}
}
-void ClientChannel::OnResolverErrorLocked(grpc_error_handle error) {
- if (resolver_ == nullptr) {
- GRPC_ERROR_UNREF(error);
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+void ClientChannel::OnResolverErrorLocked(absl::Status status) {
+ if (resolver_ == nullptr) return;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: resolver transient failure: %s", this,
- grpc_error_std_string(error).c_str());
+ status.ToString().c_str());
}
// If we already have an LB policy from a previous resolution
// result, then we continue to let it set the connectivity state.
// Otherwise, we go into TRANSIENT_FAILURE.
if (lb_policy_ == nullptr) {
- grpc_error_handle state_error =
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Resolver transient failure", &error, 1);
+ grpc_error_handle error = absl_status_to_grpc_error(status);
{
MutexLock lock(&resolution_mu_);
// Update resolver transient failure.
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
- resolver_transient_failure_error_ = GRPC_ERROR_REF(state_error);
+ resolver_transient_failure_error_ = status;
// Process calls that were queued waiting for the resolver result.
for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
call = call->next) {
@@ -1375,35 +1351,42 @@ void ClientChannel::OnResolverErrorLocked(grpc_error_handle error) {
}
}
}
+ GRPC_ERROR_UNREF(error);
// Update connectivity state.
UpdateStateAndPickerLocked(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(state_error),
- "resolver failure",
- absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
- state_error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status, "resolver failure",
+ absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
}
- GRPC_ERROR_UNREF(error);
}
void ClientChannel::CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
+ const absl::optional<std::string>& health_check_service_name,
Resolver::Result result) {
// Construct update.
LoadBalancingPolicy::UpdateArgs update_args;
update_args.addresses = std::move(result.addresses);
update_args.config = std::move(lb_policy_config);
+ update_args.resolution_note = std::move(result.resolution_note);
+ // Add health check service name to channel args.
+ absl::InlinedVector<grpc_arg, 1> args_to_add;
+ if (health_check_service_name.has_value()) {
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME),
+ const_cast<char*>(health_check_service_name->c_str())));
+ }
// 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);
+ const char* arg_to_remove = GRPC_ARG_CONFIG_SELECTOR;
+ update_args.args = grpc_channel_args_copy_and_add_and_remove(
+ result.args, &arg_to_remove, 1, args_to_add.data(), args_to_add.size());
// Create policy if needed.
if (lb_policy_ == nullptr) {
lb_policy_ = CreateLbPolicyLocked(*update_args.args);
}
// Update the policy.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: Updating child policy %p", this,
lb_policy_.get());
}
@@ -1420,8 +1403,8 @@ OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
lb_policy_args.args = &args;
OrphanablePtr<LoadBalancingPolicy> lb_policy =
MakeOrphanable<ChildPolicyHandler>(std::move(lb_policy_args),
- &grpc_client_channel_routing_trace);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ &grpc_client_channel_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: created new LB policy %p", this,
lb_policy.get());
}
@@ -1456,39 +1439,24 @@ void ClientChannel::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
void ClientChannel::UpdateServiceConfigInControlPlaneLocked(
RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name) {
- UniquePtr<char> service_config_json(
- gpr_strdup(service_config->json_string().c_str()));
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name) {
+ std::string service_config_json(service_config->json_string());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO,
"chand=%p: resolver returned updated service config: \"%s\"", this,
- service_config_json.get());
+ service_config_json.c_str());
}
// Save service config.
saved_service_config_ = std::move(service_config);
- // Update health check service name if needed.
- if (health_check_service_name_ !=
- parsed_service_config->health_check_service_name()) {
- health_check_service_name_ =
- 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(
- health_check_service_name_);
- }
- }
// Swap out the data used by GetChannelInfo().
- 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_lb_policy_name_ = std::move(lb_policy_name);
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)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: using ConfigSelector %p", this,
saved_config_selector_.get());
}
@@ -1499,7 +1467,7 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
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)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: switching to ConfigSelector %p", this,
saved_config_selector_.get());
}
@@ -1507,14 +1475,6 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
config_selector =
MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
}
- // Construct dynamic filter stack.
- std::vector<const grpc_channel_filter*> filters =
- config_selector->GetFilters();
- if (enable_retries_) {
- filters.push_back(&kRetryFilterVtable);
- } else {
- filters.push_back(&DynamicTerminationFilter::kFilterVtable);
- }
absl::InlinedVector<grpc_arg, 2> args_to_add = {
grpc_channel_arg_pointer_create(
const_cast<char*>(GRPC_ARG_CLIENT_CHANNEL), this,
@@ -1526,6 +1486,16 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
channel_args_, args_to_add.data(), args_to_add.size());
new_args = config_selector->ModifyChannelArgs(new_args);
+ bool enable_retries =
+ grpc_channel_args_find_bool(new_args, GRPC_ARG_ENABLE_RETRIES, true);
+ // Construct dynamic filter stack.
+ std::vector<const grpc_channel_filter*> filters =
+ config_selector->GetFilters();
+ if (enable_retries) {
+ filters.push_back(&kRetryFilterVtable);
+ } else {
+ filters.push_back(&DynamicTerminationFilter::kFilterVtable);
+ }
RefCountedPtr<DynamicFilters> dynamic_filters =
DynamicFilters::Create(new_args, std::move(filters));
GPR_ASSERT(dynamic_filters != nullptr);
@@ -1534,11 +1504,9 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
//
// We defer unreffing the old values (and deallocating memory) until
// after releasing the lock to keep the critical section small.
- std::set<grpc_call_element*> calls_pending_resolver_result;
{
MutexLock lock(&resolution_mu_);
- GRPC_ERROR_UNREF(resolver_transient_failure_error_);
- resolver_transient_failure_error_ = GRPC_ERROR_NONE;
+ resolver_transient_failure_error_ = absl::OkStatus();
// Update service config.
received_service_config_data_ = true;
// Old values will be unreffed after lock is released.
@@ -1548,6 +1516,15 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
// Process calls that were queued waiting for the resolver result.
for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
call = call->next) {
+ // If there are a lot of queued calls here, resuming them all may cause us
+ // to stay inside C-core for a long period of time. All of that work would
+ // be done using the same ExecCtx instance and therefore the same cached
+ // value of "now". The longer it takes to finish all of this work and exit
+ // from C-core, the more stale the cached value of "now" may become. This
+ // can cause problems whereby (e.g.) we calculate a timer deadline based
+ // on the stale value, which results in the timer firing too early. To
+ // avoid this, we invalidate the cached value for each call we process.
+ ExecCtx::Get()->InvalidateNow();
grpc_call_element* elem = call->elem;
CallData* calld = static_cast<CallData*>(elem->call_data);
grpc_error_handle error = GRPC_ERROR_NONE;
@@ -1561,12 +1538,12 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
}
void ClientChannel::CreateResolverLocked() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: starting name resolution", this);
}
- resolver_ = ResolverRegistry::CreateResolver(
- target_uri_.get(), channel_args_, interested_parties_, work_serializer_,
- absl::make_unique<ResolverResultHandler>(this));
+ resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
+ uri_to_resolve_.c_str(), channel_args_, interested_parties_,
+ work_serializer_, absl::make_unique<ResolverResultHandler>(this));
// Since the validity of the args was checked when the channel was created,
// CreateResolver() must return a non-null result.
GPR_ASSERT(resolver_ != nullptr);
@@ -1574,20 +1551,20 @@ void ClientChannel::CreateResolverLocked() {
GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving",
absl::make_unique<LoadBalancingPolicy::QueuePicker>(nullptr));
resolver_->StartLocked();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: created resolver=%p", this, resolver_.get());
}
}
void ClientChannel::DestroyResolverAndLbPolicyLocked() {
if (resolver_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: shutting down resolver=%p", this,
resolver_.get());
}
resolver_.reset();
if (lb_policy_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: shutting down lb_policy=%p", this,
lb_policy_.get());
}
@@ -1630,47 +1607,66 @@ void ClientChannel::UpdateStateAndPickerLocked(
channelz::ChannelNode::GetChannelConnectivityStateChangeString(
state)));
}
- // Grab data plane lock to do subchannel updates and update the picker.
- //
- // Note that we want to minimize the work done while holding the data
- // plane lock, to keep the critical section small. So, for all of the
- // objects that we might wind up unreffing here, we actually hold onto
- // the refs until after we release the lock, and then unref them at
- // that point. This includes the following:
- // - refs to subchannel wrappers in the keys of pending_subchannel_updates_
- // - ownership of the existing picker in picker_
+ // Grab data plane lock to update the picker.
{
MutexLock lock(&data_plane_mu_);
- // Handle subchannel updates.
- for (auto& p : pending_subchannel_updates_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: updating subchannel wrapper %p data plane "
- "connected_subchannel to %p",
- this, p.first.get(), p.second.get());
- }
- // Note: We do not remove the entry from pending_subchannel_updates_
- // here, since this would unref the subchannel wrapper; instead,
- // we wait until we've released the lock to clear the map.
- p.first->set_connected_subchannel_in_data_plane(std::move(p.second));
- }
// Swap out the picker.
// Note: Original value will be destroyed after the lock is released.
picker_.swap(picker);
// Re-process queued picks.
for (LbQueuedCall* call = lb_queued_calls_; call != nullptr;
call = call->next) {
+ // If there are a lot of queued calls here, resuming them all may cause us
+ // to stay inside C-core for a long period of time. All of that work would
+ // be done using the same ExecCtx instance and therefore the same cached
+ // value of "now". The longer it takes to finish all of this work and exit
+ // from C-core, the more stale the cached value of "now" may become. This
+ // can cause problems whereby (e.g.) we calculate a timer deadline based
+ // on the stale value, which results in the timer firing too early. To
+ // avoid this, we invalidate the cached value for each call we process.
+ ExecCtx::Get()->InvalidateNow();
grpc_error_handle error = GRPC_ERROR_NONE;
if (call->lb_call->PickSubchannelLocked(&error)) {
call->lb_call->AsyncPickDone(error);
}
}
}
- // Clear the pending update map after releasing the lock, to keep the
- // critical section small.
- pending_subchannel_updates_.clear();
}
+namespace {
+
+// TODO(roth): Remove this in favor of the gprpp Match() function once
+// we can do that without breaking lock annotations.
+template <typename T>
+T HandlePickResult(
+ LoadBalancingPolicy::PickResult* result,
+ std::function<T(LoadBalancingPolicy::PickResult::Complete*)> complete_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Queue*)> queue_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Fail*)> fail_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Drop*)> drop_func) {
+ auto* complete_pick =
+ absl::get_if<LoadBalancingPolicy::PickResult::Complete>(&result->result);
+ if (complete_pick != nullptr) {
+ return complete_func(complete_pick);
+ }
+ auto* queue_pick =
+ absl::get_if<LoadBalancingPolicy::PickResult::Queue>(&result->result);
+ if (queue_pick != nullptr) {
+ return queue_func(queue_pick);
+ }
+ auto* fail_pick =
+ absl::get_if<LoadBalancingPolicy::PickResult::Fail>(&result->result);
+ if (fail_pick != nullptr) {
+ return fail_func(fail_pick);
+ }
+ auto* drop_pick =
+ absl::get_if<LoadBalancingPolicy::PickResult::Drop>(&result->result);
+ GPR_ASSERT(drop_pick != nullptr);
+ return drop_func(drop_pick);
+}
+
+} // namespace
+
grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
if (state_tracker_.state() != GRPC_CHANNEL_READY) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel not connected");
@@ -1680,21 +1676,31 @@ grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
MutexLock lock(&data_plane_mu_);
result = picker_->Pick(LoadBalancingPolicy::PickArgs());
}
- ConnectedSubchannel* connected_subchannel = nullptr;
- if (result.subchannel != nullptr) {
- SubchannelWrapper* subchannel =
- static_cast<SubchannelWrapper*>(result.subchannel.get());
- connected_subchannel = subchannel->connected_subchannel();
- }
- if (connected_subchannel != nullptr) {
- connected_subchannel->Ping(op->send_ping.on_initiate, op->send_ping.on_ack);
- } else {
- if (result.error == GRPC_ERROR_NONE) {
- result.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "LB policy dropped call on ping");
- }
- }
- return result.error;
+ return HandlePickResult<grpc_error_handle>(
+ &result,
+ // Complete pick.
+ [op](LoadBalancingPolicy::PickResult::Complete* complete_pick)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*ClientChannel::work_serializer_) {
+ SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
+ complete_pick->subchannel.get());
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel =
+ subchannel->connected_subchannel();
+ connected_subchannel->Ping(op->send_ping.on_initiate,
+ op->send_ping.on_ack);
+ return GRPC_ERROR_NONE;
+ },
+ // Queue pick.
+ [](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("LB picker queued call");
+ },
+ // Fail pick.
+ [](LoadBalancingPolicy::PickResult::Fail* fail_pick) {
+ return absl_status_to_grpc_error(fail_pick->status);
+ },
+ // Drop pick.
+ [](LoadBalancingPolicy::PickResult::Drop* drop_pick) {
+ return absl_status_to_grpc_error(drop_pick->status);
+ });
}
void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
@@ -1726,7 +1732,7 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
}
// Disconnect or enter IDLE.
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) {
gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this,
grpc_error_std_string(op->disconnect_with_error).c_str());
}
@@ -1735,7 +1741,7 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
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, absl::Status(),
"channel entering IDLE", nullptr);
@@ -1743,13 +1749,12 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
GRPC_ERROR_UNREF(op->disconnect_with_error);
} else {
// Disconnect.
- GPR_ASSERT(disconnect_error_.Load(MemoryOrder::RELAXED) ==
- GRPC_ERROR_NONE);
- disconnect_error_.Store(op->disconnect_with_error, MemoryOrder::RELEASE);
+ GPR_ASSERT(disconnect_error_ == GRPC_ERROR_NONE);
+ disconnect_error_ = op->disconnect_with_error;
UpdateStateAndPickerLocked(
GRPC_CHANNEL_SHUTDOWN, absl::Status(), "shutdown from API",
absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
- GRPC_ERROR_REF(op->disconnect_with_error)));
+ grpc_error_to_absl_status(op->disconnect_with_error)));
}
}
GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
@@ -1767,7 +1772,7 @@ void ClientChannel::StartTransportOp(grpc_channel_element* elem,
// 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]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
+ [chand, op]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
chand->StartTransportOpLocked(op);
},
DEBUG_LOCATION);
@@ -1778,11 +1783,11 @@ void ClientChannel::GetChannelInfo(grpc_channel_element* elem,
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
MutexLock lock(&chand->info_mu_);
if (info->lb_policy_name != nullptr) {
- *info->lb_policy_name = gpr_strdup(chand->info_lb_policy_name_.get());
+ *info->lb_policy_name = gpr_strdup(chand->info_lb_policy_name_.c_str());
}
if (info->service_config_json != nullptr) {
*info->service_config_json =
- gpr_strdup(chand->info_service_config_json_.get());
+ gpr_strdup(chand->info_service_config_json_.c_str());
}
}
@@ -1810,17 +1815,6 @@ void ClientChannel::RemoveLbQueuedCall(LbQueuedCall* to_remove,
}
}
-RefCountedPtr<ConnectedSubchannel>
-ClientChannel::GetConnectedSubchannelInDataPlane(
- SubchannelInterface* subchannel) const {
- SubchannelWrapper* subchannel_wrapper =
- static_cast<SubchannelWrapper*>(subchannel);
- ConnectedSubchannel* connected_subchannel =
- subchannel_wrapper->connected_subchannel_in_data_plane();
- if (connected_subchannel == nullptr) return nullptr;
- return connected_subchannel->Ref();
-}
-
void ClientChannel::TryToConnectLocked() {
if (lb_policy_ != nullptr) {
lb_policy_->ExitIdleLocked();
@@ -1840,7 +1834,7 @@ grpc_connectivity_state ClientChannel::CheckConnectivityState(
if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
GRPC_CHANNEL_STACK_REF(owning_stack_, "TryToConnect");
work_serializer_->Run([this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(
- work_serializer_) { TryToConnectLocked(); },
+ *work_serializer_) { TryToConnectLocked(); },
DEBUG_LOCATION);
}
return out;
@@ -1867,7 +1861,7 @@ ClientChannel::CallData::CallData(grpc_call_element* elem,
: deadline_state_(elem, args,
GPR_LIKELY(chand.deadline_checking_enabled_)
? args.deadline
- : GRPC_MILLIS_INF_FUTURE),
+ : Timestamp::InfFuture()),
path_(grpc_slice_ref_internal(args.path)),
call_start_time_(args.start_time),
deadline_(args.deadline),
@@ -1916,13 +1910,39 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
GPR_TIMER_SCOPE("cc_start_transport_stream_op_batch", 0);
CallData* calld = static_cast<CallData*>(elem->call_data);
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace) &&
+ !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from above: %s", chand,
+ calld, grpc_transport_stream_op_batch_string(batch).c_str());
+ }
if (GPR_LIKELY(chand->deadline_checking_enabled_)) {
grpc_deadline_state_client_start_transport_stream_op_batch(elem, batch);
}
- // Intercept recv_initial_metadata for config selector on-committed callback.
- if (batch->recv_initial_metadata) {
- calld->InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(batch);
+ // Intercept recv_trailing_metadata to call CallDispatchController::Commit(),
+ // in case we wind up failing the call before we get down to the retry
+ // or LB call layer.
+ if (batch->recv_trailing_metadata) {
+ calld->original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ GRPC_CLOSURE_INIT(&calld->recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback,
+ elem, nullptr);
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &calld->recv_trailing_metadata_ready_;
+ }
+ // If we already have a dynamic call, pass the batch down to it.
+ // Note that once we have done so, we do not need to acquire the channel's
+ // resolution mutex, which is more efficient (especially for streaming calls).
+ if (calld->dynamic_call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on dynamic_call=%p",
+ chand, calld, calld->dynamic_call_.get());
+ }
+ calld->dynamic_call_->StartTransportStreamOpBatch(batch);
+ return;
}
+ // We do not yet have a dynamic call.
+ //
// If we've previously been cancelled, immediately fail any new batches.
if (GPR_UNLIKELY(calld->cancel_error_ != GRPC_ERROR_NONE)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -1949,35 +1969,16 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
gpr_log(GPR_INFO, "chand=%p calld=%p: recording cancel_error=%s", chand,
calld, grpc_error_std_string(calld->cancel_error_).c_str());
}
- // If we do not have a dynamic call (i.e., name resolution has not
- // yet completed), fail all pending batches. Otherwise, send the
- // cancellation down to the dynamic call.
- if (calld->dynamic_call_ == nullptr) {
- calld->PendingBatchesFail(elem, GRPC_ERROR_REF(calld->cancel_error_),
- NoYieldCallCombiner);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
- } else {
- // Note: This will release the call combiner.
- calld->dynamic_call_->StartTransportStreamOpBatch(batch);
- }
+ // Fail all pending batches.
+ calld->PendingBatchesFail(elem, GRPC_ERROR_REF(calld->cancel_error_),
+ NoYieldCallCombiner);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
return;
}
// Add the batch to the pending list.
calld->PendingBatchesAdd(elem, batch);
- // Check if we've already created a dynamic call.
- // Note that once we have done so, we do not need to acquire the channel's
- // resolution mutex, which is more efficient (especially for streaming calls).
- if (calld->dynamic_call_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on dynamic_call=%p",
- chand, calld, calld->dynamic_call_.get());
- }
- calld->PendingBatchesResume(elem);
- return;
- }
- // We do not yet have a dynamic call.
// For batches containing a send_initial_metadata op, acquire the
// channel's resolution mutex to apply the service config to the call,
// after which we will create a dynamic call.
@@ -2121,7 +2122,7 @@ void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
GRPC_CLOSURE_INIT(&batch->handler_private.closure,
ResumePendingBatchInCallCombiner, batch, nullptr);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "PendingBatchesResume");
+ "resuming pending batch from client channel call");
batch = nullptr;
}
}
@@ -2152,7 +2153,7 @@ class ClientChannel::CallData::ResolverQueuedCallCanceller {
auto* calld = static_cast<CallData*>(self->elem_->call_data);
{
MutexLock lock(&chand->resolution_mu_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: cancelling resolver queued pick: "
"error=%s self=%p calld->resolver_pick_canceller=%p",
@@ -2179,7 +2180,7 @@ void ClientChannel::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
grpc_call_element* elem) {
if (!queued_pending_resolver_result_) return;
auto* chand = static_cast<ClientChannel*>(elem->channel_data);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: removing from resolver queued picks list",
chand, this);
@@ -2194,7 +2195,7 @@ void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
grpc_call_element* elem) {
if (queued_pending_resolver_result_) return;
auto* chand = static_cast<ClientChannel*>(elem->channel_data);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: adding to resolver queued picks list",
chand, this);
}
@@ -2208,7 +2209,7 @@ void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
chand, this);
}
@@ -2218,25 +2219,27 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
ConfigSelector::CallConfig call_config =
config_selector->GetCallConfig({&path_, initial_metadata, arena_});
if (call_config.error != GRPC_ERROR_NONE) return call_config.error;
- 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,
- std::move(call_config.call_attributes), call_context_);
+ // Create a ClientChannelServiceConfigCallData for the call. This stores
+ // a ref to the ServiceConfig and caches the right set of parsed configs
+ // to use for the call. The ClientChannelServiceConfigCallData will store
+ // itself in the call context, so that it can be accessed by filters
+ // below us in the stack, and it will be cleaned up when the call ends.
+ auto* service_config_call_data =
+ arena_->New<ClientChannelServiceConfigCallData>(
+ std::move(call_config.service_config), call_config.method_configs,
+ std::move(call_config.call_attributes),
+ call_config.call_dispatch_controller, call_context_);
// Apply our own method params to the call.
auto* method_params = static_cast<ClientChannelMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(
- internal::ClientChannelServiceConfigParser::ParserIndex()));
+ chand->service_config_parser_index_));
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_) +
+ if (chand->deadline_checking_enabled_ &&
+ method_params->timeout() != Duration::Zero()) {
+ const Timestamp per_method_deadline =
+ Timestamp::FromCycleCounterRoundUp(call_start_time_) +
method_params->timeout();
if (per_method_deadline < deadline_) {
deadline_ = per_method_deadline;
@@ -2265,36 +2268,34 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
}
void ClientChannel::CallData::
- RecvInitialMetadataReadyForConfigSelectorCommitCallback(
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
void* arg, grpc_error_handle error) {
- auto* self = static_cast<CallData*>(arg);
- if (self->on_call_committed_ != nullptr) {
- self->on_call_committed_();
- self->on_call_committed_ = nullptr;
+ auto* elem = static_cast<grpc_call_element*>(arg);
+ auto* chand = static_cast<ClientChannel*>(elem->channel_data);
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: got recv_trailing_metadata_ready: error=%s "
+ "service_config_call_data=%p",
+ chand, calld, grpc_error_std_string(error).c_str(),
+ service_config_call_data);
+ }
+ if (service_config_call_data != nullptr) {
+ service_config_call_data->call_dispatch_controller()->Commit();
}
// Chain to original callback.
- Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
+ Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
GRPC_ERROR_REF(error));
}
-// TODO(roth): Consider not intercepting this callback unless we
-// actually need to, if this causes a performance problem.
-void ClientChannel::CallData::
- InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(
- grpc_transport_stream_op_batch* batch) {
- original_recv_initial_metadata_ready_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_,
- RecvInitialMetadataReadyForConfigSelectorCommitCallback,
- this, nullptr);
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &recv_initial_metadata_ready_;
-}
-
void ClientChannel::CallData::AsyncResolutionDone(grpc_call_element* elem,
grpc_error_handle error) {
- GRPC_CLOSURE_INIT(&pick_closure_, ResolutionDone, elem, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &pick_closure_, error);
+ // TODO(roth): Does this callback need to hold a ref to the call stack?
+ GRPC_CLOSURE_INIT(&resolution_done_closure_, ResolutionDone, elem, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &resolution_done_closure_, error);
}
void ClientChannel::CallData::ResolutionDone(void* arg,
@@ -2303,7 +2304,7 @@ void ClientChannel::CallData::ResolutionDone(void* arg,
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
CallData* calld = static_cast<CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: error applying config to call: error=%s",
chand, calld, grpc_error_std_string(error).c_str());
@@ -2335,6 +2336,9 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
// If we're still in IDLE, we need to start resolving.
if (GPR_UNLIKELY(chand->CheckConnectivityState(false) == GRPC_CHANNEL_IDLE)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: triggering exit idle", chand, this);
+ }
// Bounce into the control plane work serializer to start resolving,
// in case we are still in IDLE state. Since we are holding on to the
// resolution mutex here, we offload it on the ExecCtx so that we don't
@@ -2347,7 +2351,7 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
auto* chand = static_cast<ClientChannel*>(arg);
chand->work_serializer_->Run(
[chand]()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand->work_serializer_) {
chand->CheckConnectivityState(/*try_to_connect=*/true);
GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_,
"CheckResolutionLocked");
@@ -2369,17 +2373,24 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
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_handle resolver_error = chand->resolver_transient_failure_error_;
- if (resolver_error != GRPC_ERROR_NONE &&
- (send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) ==
- 0) {
+ absl::Status resolver_error = chand->resolver_transient_failure_error_;
+ if (!resolver_error.ok() && (send_initial_metadata_flags &
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: resolution failed, failing call",
+ chand, this);
+ }
MaybeRemoveCallFromResolverQueuedCallsLocked(elem);
- *error = GRPC_ERROR_REF(resolver_error);
+ *error = absl_status_to_grpc_error(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.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: queuing to wait for resolution",
+ chand, this);
+ }
MaybeAddCallToResolverQueuedCallsLocked(elem);
return false;
}
@@ -2404,7 +2415,7 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
call_combiner_};
grpc_error_handle error = GRPC_ERROR_NONE;
DynamicFilters* channel_stack = args.channel_stack.get();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(
GPR_INFO,
"chand=%p calld=%p: creating dynamic call stack on channel_stack=%p",
@@ -2412,7 +2423,7 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
}
dynamic_call_ = channel_stack->CreateCall(std::move(args), &error);
if (error != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: failed to create dynamic call: error=%s",
chand, this, grpc_error_std_string(error).c_str());
@@ -2430,62 +2441,71 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
class ClientChannel::LoadBalancedCall::Metadata
: public LoadBalancingPolicy::MetadataInterface {
public:
- Metadata(LoadBalancedCall* lb_call, grpc_metadata_batch* batch)
- : lb_call_(lb_call), batch_(batch) {}
+ explicit Metadata(grpc_metadata_batch* batch) : batch_(batch) {}
void Add(absl::string_view key, absl::string_view value) override {
- grpc_linked_mdelem* linked_mdelem = static_cast<grpc_linked_mdelem*>(
- lb_call_->arena_->Alloc(sizeof(grpc_linked_mdelem)));
- linked_mdelem->md = grpc_mdelem_from_slices(
- ExternallyManagedSlice(key.data(), key.size()),
- ExternallyManagedSlice(value.data(), value.size()));
- GPR_ASSERT(grpc_metadata_batch_link_tail(batch_, linked_mdelem) ==
- GRPC_ERROR_NONE);
+ if (batch_ == nullptr) return;
+ // Gross, egregious hack to support legacy grpclb behavior.
+ // TODO(ctiller): Use a promise context for this once that plumbing is done.
+ if (key == GrpcLbClientStatsMetadata::key()) {
+ batch_->Set(
+ GrpcLbClientStatsMetadata(),
+ const_cast<GrpcLbClientStats*>(
+ reinterpret_cast<const GrpcLbClientStats*>(value.data())));
+ return;
+ }
+ batch_->Append(key, Slice::FromStaticString(value),
+ [key](absl::string_view error, const Slice& value) {
+ gpr_log(GPR_ERROR, "%s",
+ absl::StrCat(error, " key:", key,
+ " value:", value.as_string_view())
+ .c_str());
+ });
}
- 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)));
- }
- iterator end() const override {
- static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(intptr_t),
- "iterator size too large");
- return iterator(this, 0);
+ std::vector<std::pair<std::string, std::string>> TestOnlyCopyToVector()
+ override {
+ if (batch_ == nullptr) return {};
+ Encoder encoder;
+ batch_->Encode(&encoder);
+ return encoder.Take();
}
- iterator erase(iterator it) override {
- grpc_linked_mdelem* linked_mdelem =
- reinterpret_cast<grpc_linked_mdelem*>(GetIteratorHandle(it));
- intptr_t handle = reinterpret_cast<intptr_t>(linked_mdelem->next);
- grpc_metadata_batch_remove(batch_, linked_mdelem);
- return iterator(this, handle);
+ absl::optional<absl::string_view> Lookup(absl::string_view key,
+ std::string* buffer) const override {
+ if (batch_ == nullptr) return absl::nullopt;
+ return batch_->GetStringValue(key, buffer);
}
private:
- grpc_linked_mdelem* MaybeSkipEntry(grpc_linked_mdelem* entry) const {
- if (entry != nullptr && batch_->idx.named.path == entry) {
- return entry->next;
+ class Encoder {
+ public:
+ void Encode(const Slice& key, const Slice& value) {
+ out_.emplace_back(std::string(key.as_string_view()),
+ std::string(value.as_string_view()));
}
- 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));
- }
+ template <class Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ auto value_slice = Which::Encode(value);
+ out_.emplace_back(std::string(Which::key()),
+ std::string(value_slice.as_string_view()));
+ }
- std::pair<absl::string_view, absl::string_view> IteratorHandleGet(
- intptr_t handle) const override {
- grpc_linked_mdelem* linked_mdelem =
- reinterpret_cast<grpc_linked_mdelem*>(handle);
- return std::make_pair(StringViewFromSlice(GRPC_MDKEY(linked_mdelem->md)),
- StringViewFromSlice(GRPC_MDVALUE(linked_mdelem->md)));
- }
+ void Encode(GrpcTimeoutMetadata,
+ const typename GrpcTimeoutMetadata::ValueType&) {}
+ void Encode(HttpPathMetadata, const Slice&) {}
+ void Encode(HttpMethodMetadata,
+ const typename HttpMethodMetadata::ValueType&) {}
+
+ std::vector<std::pair<std::string, std::string>> Take() {
+ return std::move(out_);
+ }
+
+ private:
+ std::vector<std::pair<std::string, std::string>> out_;
+ };
- LoadBalancedCall* lb_call_;
grpc_metadata_batch* batch_;
};
@@ -2500,19 +2520,6 @@ class ClientChannel::LoadBalancedCall::LbCallState
void* Alloc(size_t size) override { return lb_call_->arena_->Alloc(size); }
- const LoadBalancingPolicy::BackendMetricData* GetBackendMetricData()
- override {
- if (lb_call_->backend_metric_data_ == nullptr) {
- grpc_linked_mdelem* md = lb_call_->recv_trailing_metadata_->idx.named
- .x_endpoint_load_metrics_bin;
- if (md != nullptr) {
- lb_call_->backend_metric_data_ =
- ParseBackendMetricData(GRPC_MDVALUE(md->md), lb_call_->arena_);
- }
- }
- return lb_call_->backend_metric_data_;
- }
-
absl::string_view ExperimentalGetCallAttribute(const char* key) override {
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
lb_call_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
@@ -2527,33 +2534,79 @@ class ClientChannel::LoadBalancedCall::LbCallState
};
//
-// LoadBalancedCall
+// ClientChannel::LoadBalancedCall::BackendMetricAccessor
//
+class ClientChannel::LoadBalancedCall::BackendMetricAccessor
+ : public LoadBalancingPolicy::BackendMetricAccessor {
+ public:
+ explicit BackendMetricAccessor(LoadBalancedCall* lb_call)
+ : lb_call_(lb_call) {}
+
+ const BackendMetricData* GetBackendMetricData() override {
+ if (lb_call_->backend_metric_data_ == nullptr &&
+ lb_call_->recv_trailing_metadata_ != nullptr) {
+ if (const auto* md = lb_call_->recv_trailing_metadata_->get_pointer(
+ XEndpointLoadMetricsBinMetadata())) {
+ lb_call_->backend_metric_data_ =
+ ParseBackendMetricData(*md, lb_call_->arena_);
+ }
+ }
+ return lb_call_->backend_metric_data_;
+ }
+
+ private:
+ LoadBalancedCall* lb_call_;
+};
+
+//
+// ClientChannel::LoadBalancedCall
+//
+
+namespace {
+
+CallTracer::CallAttemptTracer* GetCallAttemptTracer(
+ grpc_call_context_element* context, bool is_transparent_retry) {
+ auto* call_tracer =
+ static_cast<CallTracer*>(context[GRPC_CONTEXT_CALL_TRACER].value);
+ if (call_tracer == nullptr) return nullptr;
+ return call_tracer->StartNewAttempt(is_transparent_retry);
+}
+
+} // namespace
+
ClientChannel::LoadBalancedCall::LoadBalancedCall(
ClientChannel* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete)
- : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
- ? "LoadBalancedCall"
- : nullptr),
+ grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry)
+ : InternallyRefCounted(
+ GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)
+ ? "LoadBalancedCall"
+ : nullptr),
chand_(chand),
path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
deadline_(args.deadline),
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
call_context_(args.context),
pollent_(pollent),
- on_call_destruction_complete_(on_call_destruction_complete) {}
+ on_call_destruction_complete_(on_call_destruction_complete),
+ call_dispatch_controller_(call_dispatch_controller),
+ call_attempt_tracer_(
+ GetCallAttemptTracer(args.context, is_transparent_retry)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: created", chand_, this);
+ }
+}
ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
- grpc_slice_unref_internal(path_);
GRPC_ERROR_UNREF(cancel_error_);
GRPC_ERROR_UNREF(failure_error_);
if (backend_metric_data_ != nullptr) {
- backend_metric_data_
- ->LoadBalancingPolicy::BackendMetricData::~BackendMetricData();
+ backend_metric_data_->LoadBalancingPolicy::BackendMetricAccessor::
+ BackendMetricData::~BackendMetricData();
}
// Make sure there are no remaining pending batches.
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2565,6 +2618,22 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
}
}
+void ClientChannel::LoadBalancedCall::Orphan() {
+ // If the recv_trailing_metadata op was never started, then notify
+ // about call completion here, as best we can. We assume status
+ // CANCELLED in this case.
+ if (recv_trailing_metadata_ == nullptr) {
+ RecordCallCompletion(absl::CancelledError("call cancelled"));
+ }
+ // Compute latency and report it to the tracer.
+ if (call_attempt_tracer_ != nullptr) {
+ gpr_timespec latency =
+ gpr_cycle_counter_sub(gpr_get_cycle_counter(), lb_call_start_time_);
+ call_attempt_tracer_->RecordEnd(latency);
+ }
+ Unref();
+}
+
size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
grpc_transport_stream_op_batch* batch) {
// Note: It is important the send_initial_metadata be the first entry
@@ -2582,7 +2651,7 @@ size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
void ClientChannel::LoadBalancedCall::PendingBatchesAdd(
grpc_transport_stream_op_batch* batch) {
const size_t idx = GetBatchIndex(batch);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: adding pending batch at index %" PRIuPTR,
chand_, this, idx);
@@ -2609,7 +2678,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesFail(
GPR_ASSERT(error != GRPC_ERROR_NONE);
GRPC_ERROR_UNREF(failure_error_);
failure_error_ = error;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
size_t num_batches = 0;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
if (pending_batches_[i] != nullptr) ++num_batches;
@@ -2651,7 +2720,7 @@ void ClientChannel::LoadBalancedCall::ResumePendingBatchInCallCombiner(
// This is called via the call combiner, so access to calld is synchronized.
void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
size_t num_batches = 0;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
if (pending_batches_[i] != nullptr) ++num_batches;
@@ -2670,7 +2739,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
ResumePendingBatchInCallCombiner, batch,
grpc_schedule_on_exec_ctx);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "PendingBatchesResume");
+ "resuming pending batch from LB call");
batch = nullptr;
}
}
@@ -2680,13 +2749,90 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
grpc_transport_stream_op_batch* batch) {
- // Intercept recv_trailing_metadata_ready for LB callback.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace) ||
+ GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: batch started from above: %s, "
+ "call_attempt_tracer_=%p",
+ chand_, this, grpc_transport_stream_op_batch_string(batch).c_str(),
+ call_attempt_tracer_);
+ }
+ // Handle call tracing.
+ if (call_attempt_tracer_ != nullptr) {
+ // Record send ops in tracer.
+ if (batch->cancel_stream) {
+ call_attempt_tracer_->RecordCancel(
+ GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error));
+ }
+ if (batch->send_initial_metadata) {
+ call_attempt_tracer_->RecordSendInitialMetadata(
+ batch->payload->send_initial_metadata.send_initial_metadata,
+ batch->payload->send_initial_metadata.send_initial_metadata_flags);
+ peer_string_ = batch->payload->send_initial_metadata.peer_string;
+ original_send_initial_metadata_on_complete_ = batch->on_complete;
+ GRPC_CLOSURE_INIT(&send_initial_metadata_on_complete_,
+ SendInitialMetadataOnComplete, this, nullptr);
+ batch->on_complete = &send_initial_metadata_on_complete_;
+ }
+ if (batch->send_message) {
+ call_attempt_tracer_->RecordSendMessage(
+ *batch->payload->send_message.send_message);
+ }
+ if (batch->send_trailing_metadata) {
+ call_attempt_tracer_->RecordSendTrailingMetadata(
+ batch->payload->send_trailing_metadata.send_trailing_metadata);
+ }
+ // Intercept recv ops.
+ 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;
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ this, nullptr);
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &recv_initial_metadata_ready_;
+ }
+ if (batch->recv_message) {
+ recv_message_ = batch->payload->recv_message.recv_message;
+ original_recv_message_ready_ =
+ batch->payload->recv_message.recv_message_ready;
+ GRPC_CLOSURE_INIT(&recv_message_ready_, RecvMessageReady, this, nullptr);
+ batch->payload->recv_message.recv_message_ready = &recv_message_ready_;
+ }
+ }
+ // Intercept recv_trailing_metadata even if there is no call tracer,
+ // since we may need to notify the LB policy about trailing metadata.
if (batch->recv_trailing_metadata) {
- InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(batch);
+ recv_trailing_metadata_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata;
+ transport_stream_stats_ =
+ batch->payload->recv_trailing_metadata.collect_stats;
+ original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_, RecvTrailingMetadataReady,
+ this, nullptr);
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &recv_trailing_metadata_ready_;
+ }
+ // If we've already gotten a subchannel call, pass the batch down to it.
+ // Note that once we have picked a subchannel, we do not need to acquire
+ // the channel's data plane mutex, which is more efficient (especially for
+ // streaming calls).
+ if (subchannel_call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
+ chand_, this, subchannel_call_.get());
+ }
+ subchannel_call_->StartTransportStreamOpBatch(batch);
+ return;
}
+ // We do not yet have a subchannel call.
+ //
// If we've previously been cancelled, immediately fail any new batches.
if (GPR_UNLIKELY(cancel_error_ != GRPC_ERROR_NONE)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: failing batch with error: %s",
chand_, this, grpc_error_std_string(cancel_error_).c_str());
}
@@ -2704,44 +2850,23 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
// error to the caller when the first batch does get passed down.
GRPC_ERROR_UNREF(cancel_error_);
cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: recording cancel_error=%s",
chand_, this, grpc_error_std_string(cancel_error_).c_str());
}
- // If we do not have a subchannel call (i.e., a pick has not yet
- // been started), fail all pending batches. Otherwise, send the
- // cancellation down to the subchannel call.
- if (subchannel_call_ == nullptr) {
- PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
- } else {
- // Note: This will release the call combiner.
- subchannel_call_->StartTransportStreamOpBatch(batch);
- }
+ // Fail all pending batches.
+ PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
return;
}
// Add the batch to the pending list.
PendingBatchesAdd(batch);
- // Check if we've already gotten a subchannel call.
- // Note that once we have picked a subchannel, we do not need to acquire
- // the channel's data plane mutex, which is more efficient (especially for
- // streaming calls).
- if (subchannel_call_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
- chand_, this, subchannel_call_.get());
- }
- PendingBatchesResume();
- return;
- }
- // We do not yet have a subchannel call.
// For batches containing a send_initial_metadata op, acquire the
// channel's data plane mutex to pick a subchannel.
if (GPR_LIKELY(batch->send_initial_metadata)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: grabbing data plane mutex to perform pick",
chand_, this);
@@ -2749,7 +2874,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
PickSubchannel(this, GRPC_ERROR_NONE);
} else {
// For all other batches, release the call combiner.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: saved batch, yielding call combiner",
chand_, this);
@@ -2759,38 +2884,91 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
}
}
-void ClientChannel::LoadBalancedCall::
- RecvTrailingMetadataReadyForLoadBalancingPolicy(void* arg,
- grpc_error_handle error) {
+void ClientChannel::LoadBalancedCall::SendInitialMetadataOnComplete(
+ void* arg, grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
- if (self->lb_recv_trailing_metadata_ready_ != nullptr) {
- // Set error if call did not succeed.
- grpc_error_handle error_for_lb = GRPC_ERROR_NONE;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: got on_complete for send_initial_metadata: "
+ "error=%s",
+ self->chand_, self, grpc_error_std_string(error).c_str());
+ }
+ self->call_attempt_tracer_->RecordOnDoneSendInitialMetadata(
+ self->peer_string_);
+ Closure::Run(DEBUG_LOCATION,
+ self->original_send_initial_metadata_on_complete_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvInitialMetadataReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: got recv_initial_metadata_ready: error=%s",
+ self->chand_, self, grpc_error_std_string(error).c_str());
+ }
+ if (error == GRPC_ERROR_NONE) {
+ // recv_initial_metadata_flags is not populated for clients
+ self->call_attempt_tracer_->RecordReceivedInitialMetadata(
+ self->recv_initial_metadata_, 0 /* recv_initial_metadata_flags */);
+ }
+ Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvMessageReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: got recv_message_ready: error=%s",
+ self->chand_, self, grpc_error_std_string(error).c_str());
+ }
+ if (*self->recv_message_ != nullptr) {
+ self->call_attempt_tracer_->RecordReceivedMessage(**self->recv_message_);
+ }
+ Closure::Run(DEBUG_LOCATION, self->original_recv_message_ready_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: got recv_trailing_metadata_ready: error=%s "
+ "call_attempt_tracer_=%p lb_subchannel_call_tracker_=%p "
+ "failure_error_=%s",
+ self->chand_, self, grpc_error_std_string(error).c_str(),
+ self->call_attempt_tracer_, self->lb_subchannel_call_tracker_.get(),
+ grpc_error_std_string(self->failure_error_).c_str());
+ }
+ // Check if we have a tracer or an LB callback to invoke.
+ if (self->call_attempt_tracer_ != nullptr ||
+ self->lb_subchannel_call_tracker_ != nullptr) {
+ // Get the call's status.
+ absl::Status status;
if (error != GRPC_ERROR_NONE) {
- error_for_lb = error;
+ // Get status from error.
+ grpc_status_code code;
+ std::string message;
+ grpc_error_get_status(error, self->deadline_, &code, &message,
+ /*http_error=*/nullptr, /*error_string=*/nullptr);
+ status = absl::Status(static_cast<absl::StatusCode>(code), message);
} else {
- const auto& fields = self->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);
- std::string 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)));
+ // Get status from headers.
+ const auto& md = *self->recv_trailing_metadata_;
+ grpc_status_code code =
+ md.get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN);
+ if (code != GRPC_STATUS_OK) {
+ absl::string_view message;
+ if (const auto* grpc_message = md.get_pointer(GrpcMessageMetadata())) {
+ message = grpc_message->as_string_view();
}
+ status = absl::Status(static_cast<absl::StatusCode>(code), message);
}
}
- // Invoke callback to LB policy.
- Metadata trailing_metadata(self, self->recv_trailing_metadata_);
- LbCallState lb_call_state(self);
- self->lb_recv_trailing_metadata_ready_(error_for_lb, &trailing_metadata,
- &lb_call_state);
- if (error == GRPC_ERROR_NONE) GRPC_ERROR_UNREF(error_for_lb);
+ self->RecordCallCompletion(status);
}
// Chain to original callback.
if (self->failure_error_ != GRPC_ERROR_NONE) {
@@ -2803,30 +2981,35 @@ void ClientChannel::LoadBalancedCall::
error);
}
-void ClientChannel::LoadBalancedCall::
- InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(
- grpc_transport_stream_op_batch* batch) {
- recv_trailing_metadata_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata;
- original_recv_trailing_metadata_ready_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
- RecvTrailingMetadataReadyForLoadBalancingPolicy, this,
- grpc_schedule_on_exec_ctx);
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &recv_trailing_metadata_ready_;
+void ClientChannel::LoadBalancedCall::RecordCallCompletion(
+ absl::Status status) {
+ // If we have a tracer, notify it.
+ if (call_attempt_tracer_ != nullptr) {
+ call_attempt_tracer_->RecordReceivedTrailingMetadata(
+ status, recv_trailing_metadata_, transport_stream_stats_);
+ }
+ // If the LB policy requested a callback for trailing metadata, invoke
+ // the callback.
+ if (lb_subchannel_call_tracker_ != nullptr) {
+ Metadata trailing_metadata(recv_trailing_metadata_);
+ BackendMetricAccessor backend_metric_accessor(this);
+ LoadBalancingPolicy::SubchannelCallTrackerInterface::FinishArgs args = {
+ status, &trailing_metadata, &backend_metric_accessor};
+ lb_subchannel_call_tracker_->Finish(args);
+ lb_subchannel_call_tracker_.reset();
+ }
}
void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
SubchannelCall::Args call_args = {
- std::move(connected_subchannel_), pollent_, path_, call_start_time_,
+ std::move(connected_subchannel_), pollent_, path_.Ref(), /*start_time=*/0,
deadline_, arena_,
// TODO(roth): When we implement hedging support, we will probably
// need to use a separate call context for each subchannel call.
call_context_, call_combiner_};
grpc_error_handle error = GRPC_ERROR_NONE;
subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand_,
this, subchannel_call_.get(), grpc_error_std_string(error).c_str());
@@ -2865,7 +3048,7 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
auto* chand = lb_call->chand_;
{
MutexLock lock(&chand->data_plane_mu_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: cancelling queued pick: "
"error=%s self=%p calld->pick_canceller=%p",
@@ -2873,6 +3056,7 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
lb_call->lb_call_canceller_);
}
if (lb_call->lb_call_canceller_ == self && error != GRPC_ERROR_NONE) {
+ lb_call->call_dispatch_controller_->Commit();
// Remove pick from list of queued picks.
lb_call->MaybeRemoveCallFromLbQueuedCallsLocked();
// Fail pending batches on the call.
@@ -2890,7 +3074,7 @@ class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
if (!queued_pending_lb_pick_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list",
chand_, this);
}
@@ -2902,7 +3086,7 @@ void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
void ClientChannel::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
if (queued_pending_lb_pick_) return;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list",
chand_, this);
}
@@ -2914,6 +3098,7 @@ void ClientChannel::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
}
void ClientChannel::LoadBalancedCall::AsyncPickDone(grpc_error_handle error) {
+ // TODO(roth): Does this callback need to hold a ref to LoadBalancedCall?
GRPC_CLOSURE_INIT(&pick_closure_, PickDone, this, grpc_schedule_on_exec_ctx);
ExecCtx::Run(DEBUG_LOCATION, &pick_closure_, error);
}
@@ -2922,7 +3107,7 @@ void ClientChannel::LoadBalancedCall::PickDone(void* arg,
grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
if (error != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: failed to pick subchannel: error=%s",
self->chand_, self, grpc_error_std_string(error).c_str());
@@ -2930,26 +3115,10 @@ void ClientChannel::LoadBalancedCall::PickDone(void* arg,
self->PendingBatchesFail(GRPC_ERROR_REF(error), YieldCallCombiner);
return;
}
+ self->call_dispatch_controller_->Commit();
self->CreateSubchannelCall();
}
-namespace {
-
-const char* PickResultTypeName(
- LoadBalancingPolicy::PickResult::ResultType type) {
- switch (type) {
- case LoadBalancingPolicy::PickResult::PICK_COMPLETE:
- return "COMPLETE";
- case LoadBalancingPolicy::PickResult::PICK_QUEUE:
- return "QUEUE";
- case LoadBalancingPolicy::PickResult::PICK_FAILED:
- return "FAILED";
- }
- GPR_UNREACHABLE_CODE(return "UNKNOWN");
-}
-
-} // namespace
-
void ClientChannel::LoadBalancedCall::PickSubchannel(void* arg,
grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
@@ -2977,70 +3146,98 @@ bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
send_initial_metadata.send_initial_metadata_flags;
// Perform LB pick.
LoadBalancingPolicy::PickArgs pick_args;
- pick_args.path = StringViewFromSlice(path_);
+ pick_args.path = path_.as_string_view();
LbCallState lb_call_state(this);
pick_args.call_state = &lb_call_state;
- Metadata initial_metadata(this, initial_metadata_batch);
+ Metadata initial_metadata(initial_metadata_batch);
pick_args.initial_metadata = &initial_metadata;
auto result = chand_->picker_->Pick(pick_args);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p lb_call=%p: LB pick returned %s (subchannel=%p, error=%s)",
- chand_, this, PickResultTypeName(result.type), result.subchannel.get(),
- grpc_error_std_string(result.error).c_str());
- }
- switch (result.type) {
- case LoadBalancingPolicy::PickResult::PICK_FAILED: {
- // If we're shutting down, fail all RPCs.
- grpc_error_handle disconnect_error = chand_->disconnect_error();
- if (disconnect_error != GRPC_ERROR_NONE) {
- GRPC_ERROR_UNREF(result.error);
- MaybeRemoveCallFromLbQueuedCallsLocked();
- *error = GRPC_ERROR_REF(disconnect_error);
- return true;
- }
- // If wait_for_ready is false, then the error indicates the RPC
- // attempt's final status.
- if ((send_initial_metadata_flags &
- GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
- grpc_error_handle new_error =
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to pick subchannel", &result.error, 1);
- GRPC_ERROR_UNREF(result.error);
- *error = new_error;
- MaybeRemoveCallFromLbQueuedCallsLocked();
- return true;
- }
- // If wait_for_ready is true, then queue to retry when we get a new
- // picker.
- GRPC_ERROR_UNREF(result.error);
- }
- // Fallthrough
- case LoadBalancingPolicy::PickResult::PICK_QUEUE:
- MaybeAddCallToLbQueuedCallsLocked();
- return false;
- default: // PICK_COMPLETE
- MaybeRemoveCallFromLbQueuedCallsLocked();
- // Handle drops.
- if (GPR_UNLIKELY(result.subchannel == nullptr)) {
- result.error = grpc_error_set_int(
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Call dropped by load balancing policy"),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAVAILABLE),
- GRPC_ERROR_INT_LB_POLICY_DROP, 1);
- } 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);
- }
- lb_recv_trailing_metadata_ready_ = result.recv_trailing_metadata_ready;
- *error = result.error;
- return true;
- }
+ return HandlePickResult<bool>(
+ &result,
+ // CompletePick
+ [this](LoadBalancingPolicy::PickResult::Complete* complete_pick)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p",
+ chand_, this, complete_pick->subchannel.get());
+ }
+ GPR_ASSERT(complete_pick->subchannel != nullptr);
+ // Grab a ref to the connected subchannel while we're still
+ // holding the data plane mutex.
+ SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
+ complete_pick->subchannel.get());
+ connected_subchannel_ = subchannel->connected_subchannel();
+ // If the subchannel has no connected subchannel (e.g., if the
+ // subchannel has moved out of state READY but the LB policy hasn't
+ // yet seen that change and given us a new picker), then just
+ // queue the pick. We'll try again as soon as we get a new picker.
+ if (connected_subchannel_ == nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: subchannel returned by LB picker "
+ "has no connected subchannel; queueing pick",
+ chand_, this);
+ }
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ }
+ lb_subchannel_call_tracker_ =
+ std::move(complete_pick->subchannel_call_tracker);
+ if (lb_subchannel_call_tracker_ != nullptr) {
+ lb_subchannel_call_tracker_->Start();
+ }
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ },
+ // QueuePick
+ [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_,
+ this);
+ }
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ },
+ // FailPick
+ [this, send_initial_metadata_flags,
+ &error](LoadBalancingPolicy::PickResult::Fail* fail_pick)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s",
+ chand_, this, fail_pick->status.ToString().c_str());
+ }
+ // If wait_for_ready is false, then the error indicates the RPC
+ // attempt's final status.
+ if ((send_initial_metadata_flags &
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
+ grpc_error_handle lb_error =
+ absl_status_to_grpc_error(fail_pick->status);
+ *error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to pick subchannel", &lb_error, 1);
+ GRPC_ERROR_UNREF(lb_error);
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ }
+ // If wait_for_ready is true, then queue to retry when we get a new
+ // picker.
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ },
+ // DropPick
+ [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s",
+ chand_, this, drop_pick->status.ToString().c_str());
+ }
+ *error =
+ grpc_error_set_int(absl_status_to_grpc_error(drop_pick->status),
+ GRPC_ERROR_INT_LB_POLICY_DROP, 1);
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ });
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel.h b/grpc/src/core/ext/filters/client_channel/client_channel.h
index b7dd1a19..170d4a68 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel.h
+++ b/grpc/src/core/ext/filters/client_channel/client_channel.h
@@ -33,16 +33,21 @@
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/dynamic_filters.h"
#include "src/core/ext/filters/client_channel/lb_policy.h"
-#include "src/core/ext/filters/client_channel/resolver.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.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
+#include "src/core/lib/channel/call_tracer.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/resolver/resolver.h"
+#include "src/core/lib/service_config/service_config.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/service_config/service_config_parser.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
@@ -132,9 +137,11 @@ class ClientChannel {
void RemoveConnectivityWatcher(
AsyncConnectivityStateWatcherInterface* watcher);
- RefCountedPtr<LoadBalancedCall> CreateLoadBalancedCall(
+ OrphanablePtr<LoadBalancedCall> CreateLoadBalancedCall(
const grpc_call_element_args& args, grpc_polling_entity* pollent,
- grpc_closure* on_call_destruction_complete);
+ grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry);
private:
class CallData;
@@ -170,9 +177,9 @@ class ClientChannel {
// Adds the watcher to state_tracker_. Consumes the ref that is passed to it
// from Start().
void AddWatcherLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_);
void RemoveWatcherLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_);
ClientChannel* chand_;
grpc_polling_entity pollent_;
@@ -180,7 +187,7 @@ class ClientChannel {
grpc_connectivity_state* state_;
grpc_closure* on_complete_;
grpc_closure* watcher_timer_init_;
- Atomic<bool> done_{false};
+ std::atomic<bool> done_{false};
};
struct ResolverQueuedCall {
@@ -204,53 +211,47 @@ class ClientChannel {
static void GetChannelInfo(grpc_channel_element* elem,
const grpc_channel_info* info);
- // Note: Does NOT return a new ref.
- grpc_error_handle disconnect_error() const {
- return disconnect_error_.Load(MemoryOrder::ACQUIRE);
- }
-
// Note: All methods with "Locked" suffix must be invoked from within
// work_serializer_.
void OnResolverResultChangedLocked(Resolver::Result result)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
- void OnResolverErrorLocked(grpc_error_handle error)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
+ void OnResolverErrorLocked(absl::Status status)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
- Resolver::Result result) ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ const absl::optional<std::string>& health_check_service_name,
+ Resolver::Result result) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
const grpc_channel_args& args)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateStateAndPickerLocked(
grpc_connectivity_state state, const absl::Status& status,
const char* reason,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateServiceConfigInControlPlaneLocked(
RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateServiceConfigInDataPlaneLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
- void CreateResolverLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ void CreateResolverLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void DestroyResolverAndLbPolicyLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
grpc_error_handle DoPingLocked(grpc_transport_op* op)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void StartTransportOpLocked(grpc_transport_op* op)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
- void TryToConnectLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ void TryToConnectLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
// These methods all require holding resolution_mu_.
void AddResolverQueuedCall(ResolverQueuedCall* call,
@@ -265,23 +266,20 @@ class ClientChannel {
ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
void RemoveLbQueuedCall(LbQueuedCall* to_remove, grpc_polling_entity* pollent)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
- RefCountedPtr<ConnectedSubchannel> GetConnectedSubchannelInDataPlane(
- SubchannelInterface* subchannel) const
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
//
// Fields set at construction and never modified.
//
const bool deadline_checking_enabled_;
- const bool enable_retries_;
grpc_channel_stack* owning_stack_;
ClientChannelFactory* client_channel_factory_;
const grpc_channel_args* channel_args_;
RefCountedPtr<ServiceConfig> default_service_config_;
- std::string server_name_;
- UniquePtr<char> target_uri_;
+ std::string uri_to_resolve_;
+ std::string default_authority_;
channelz::ChannelNode* channelz_node_;
grpc_pollset_set* interested_parties_;
+ const size_t service_config_parser_index_;
//
// Fields related to name resolution. Guarded by resolution_mu_.
@@ -291,8 +289,8 @@ class ClientChannel {
ResolverQueuedCall* resolver_queued_calls_ ABSL_GUARDED_BY(resolution_mu_) =
nullptr;
// Data from service config.
- grpc_error_handle resolver_transient_failure_error_
- ABSL_GUARDED_BY(resolution_mu_) = GRPC_ERROR_NONE;
+ absl::Status resolver_transient_failure_error_
+ ABSL_GUARDED_BY(resolution_mu_);
bool received_service_config_data_ ABSL_GUARDED_BY(resolution_mu_) = false;
RefCountedPtr<ServiceConfig> service_config_ ABSL_GUARDED_BY(resolution_mu_);
RefCountedPtr<ConfigSelector> config_selector_
@@ -313,48 +311,37 @@ class ClientChannel {
// Fields used in the control plane. Guarded by work_serializer.
//
std::shared_ptr<WorkSerializer> work_serializer_;
- ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(work_serializer_);
- OrphanablePtr<Resolver> resolver_ ABSL_GUARDED_BY(work_serializer_);
+ ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(*work_serializer_);
+ OrphanablePtr<Resolver> resolver_ ABSL_GUARDED_BY(*work_serializer_);
bool previous_resolution_contained_addresses_
- ABSL_GUARDED_BY(work_serializer_) = false;
+ ABSL_GUARDED_BY(*work_serializer_) = false;
RefCountedPtr<ServiceConfig> saved_service_config_
- ABSL_GUARDED_BY(work_serializer_);
+ ABSL_GUARDED_BY(*work_serializer_);
RefCountedPtr<ConfigSelector> saved_config_selector_
- ABSL_GUARDED_BY(work_serializer_);
- absl::optional<std::string> health_check_service_name_
- ABSL_GUARDED_BY(work_serializer_);
+ ABSL_GUARDED_BY(*work_serializer_);
OrphanablePtr<LoadBalancingPolicy> lb_policy_
- ABSL_GUARDED_BY(work_serializer_);
+ ABSL_GUARDED_BY(*work_serializer_);
RefCountedPtr<SubchannelPoolInterface> subchannel_pool_
- ABSL_GUARDED_BY(work_serializer_);
+ ABSL_GUARDED_BY(*work_serializer_);
// The number of SubchannelWrapper instances referencing a given Subchannel.
std::map<Subchannel*, int> subchannel_refcount_map_
- ABSL_GUARDED_BY(work_serializer_);
+ ABSL_GUARDED_BY(*work_serializer_);
// 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.
std::set<SubchannelWrapper*> subchannel_wrappers_
- ABSL_GUARDED_BY(work_serializer_);
- // 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>>
- pending_subchannel_updates_ ABSL_GUARDED_BY(work_serializer_);
- int keepalive_time_ ABSL_GUARDED_BY(work_serializer_) = -1;
-
- //
- // Fields accessed from both data plane mutex and control plane
- // work_serializer.
- //
- Atomic<grpc_error_handle> disconnect_error_;
+ ABSL_GUARDED_BY(*work_serializer_);
+ int keepalive_time_ ABSL_GUARDED_BY(*work_serializer_) = -1;
+ grpc_error_handle disconnect_error_ ABSL_GUARDED_BY(*work_serializer_) =
+ GRPC_ERROR_NONE;
//
// Fields guarded by a mutex, since they need to be accessed
// synchronously via get_channel_info().
//
Mutex info_mu_;
- UniquePtr<char> info_lb_policy_name_ ABSL_GUARDED_BY(info_mu_);
- UniquePtr<char> info_service_config_json_ ABSL_GUARDED_BY(info_mu_);
+ std::string info_lb_policy_name_ ABSL_GUARDED_BY(info_mu_);
+ std::string info_service_config_json_ ABSL_GUARDED_BY(info_mu_);
//
// Fields guarded by a mutex, since they need to be accessed
@@ -369,12 +356,10 @@ class ClientChannel {
// ClientChannel::LoadBalancedCall
//
-// This object is ref-counted, but it cannot inherit from RefCounted<>,
-// because it is allocated on the arena and can't free its memory when
-// its refcount goes to zero. So instead, it manually implements the
-// same API as RefCounted<>, so that it can be used with RefCountedPtr<>.
+// TODO(roth): As part of simplifying cancellation in the filter stack,
+// this should no longer need to be ref-counted.
class ClientChannel::LoadBalancedCall
- : public RefCounted<LoadBalancedCall, PolymorphicRefCount, kUnrefCallDtor> {
+ : public InternallyRefCounted<LoadBalancedCall, kUnrefCallDtor> {
public:
// If on_call_destruction_complete is non-null, then it will be
// invoked once the LoadBalancedCall is completely destroyed.
@@ -382,11 +367,15 @@ class ClientChannel::LoadBalancedCall
// the LB call has a subchannel call and ensuring that the
// on_call_destruction_complete closure passed down from the surface
// is not invoked until after the subchannel call stack is destroyed.
- LoadBalancedCall(ClientChannel* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent,
- grpc_closure* on_call_destruction_complete);
+ LoadBalancedCall(
+ ClientChannel* chand, const grpc_call_element_args& args,
+ grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry);
~LoadBalancedCall() override;
+ void Orphan() override;
+
void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
// Invoked by channel for queued LB picks when the picker is updated.
@@ -408,6 +397,7 @@ class ClientChannel::LoadBalancedCall
class LbQueuedCallCanceller;
class Metadata;
class LbCallState;
+ class BackendMetricAccessor;
// Returns the index into pending_batches_ to be used for batch.
static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
@@ -438,10 +428,12 @@ class ClientChannel::LoadBalancedCall
// Resumes all pending batches on subchannel_call_.
void PendingBatchesResume();
- static void RecvTrailingMetadataReadyForLoadBalancingPolicy(
- void* arg, grpc_error_handle error);
- void InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(
- grpc_transport_stream_op_batch* batch);
+ static void SendInitialMetadataOnComplete(void* arg, grpc_error_handle error);
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+ static void RecvMessageReady(void* arg, grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
+
+ void RecordCallCompletion(absl::Status status);
void CreateSubchannelCall();
// Invoked when a pick is completed, on both success or failure.
@@ -458,15 +450,19 @@ class ClientChannel::LoadBalancedCall
// TODO(roth): Instead of duplicating these fields in every filter
// that uses any one of them, we should store them in the call
// context. This will save per-call memory overhead.
- grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
+ Slice path_; // Request path.
+ Timestamp deadline_;
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
grpc_polling_entity* pollent_;
grpc_closure* on_call_destruction_complete_;
+ ConfigSelector::CallDispatchController* call_dispatch_controller_;
+
+ CallTracer::CallAttemptTracer* call_attempt_tracer_;
+
+ gpr_cycle_counter lb_call_start_time_ = gpr_get_cycle_counter();
// Set when we get a cancel_stream op.
grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
@@ -485,15 +481,31 @@ class ClientChannel::LoadBalancedCall
ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_) = nullptr;
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
- const LoadBalancingPolicy::BackendMetricData* backend_metric_data_ = nullptr;
- std::function<void(grpc_error_handle, LoadBalancingPolicy::MetadataInterface*,
- LoadBalancingPolicy::CallState*)>
- lb_recv_trailing_metadata_ready_;
+ const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ backend_metric_data_ = nullptr;
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ lb_subchannel_call_tracker_;
RefCountedPtr<SubchannelCall> subchannel_call_;
- // For intercepting recv_trailing_metadata_ready for the LB policy.
+ // For intercepting send_initial_metadata on_complete.
+ gpr_atm* peer_string_ = nullptr;
+ grpc_closure send_initial_metadata_on_complete_;
+ grpc_closure* original_send_initial_metadata_on_complete_ = nullptr;
+
+ // For intercepting recv_initial_metadata_ready.
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ grpc_closure recv_initial_metadata_ready_;
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+
+ // For intercepting recv_message_ready.
+ OrphanablePtr<ByteStream>* recv_message_ = nullptr;
+ grpc_closure recv_message_ready_;
+ grpc_closure* original_recv_message_ready_ = nullptr;
+
+ // For intercepting recv_trailing_metadata_ready.
grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
+ grpc_transport_stream_stats* transport_stream_stats_ = nullptr;
grpc_closure recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
@@ -505,6 +517,69 @@ class ClientChannel::LoadBalancedCall
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
};
+// A sub-class of ServiceConfigCallData used to access the
+// CallDispatchController. Allocated on the arena, stored in the call
+// context, and destroyed when the call is destroyed.
+class ClientChannelServiceConfigCallData : public ServiceConfigCallData {
+ public:
+ ClientChannelServiceConfigCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_configs,
+ ServiceConfigCallData::CallAttributes call_attributes,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ grpc_call_context_element* call_context)
+ : ServiceConfigCallData(std::move(service_config), method_configs,
+ std::move(call_attributes)),
+ call_dispatch_controller_(call_dispatch_controller) {
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
+ }
+
+ ConfigSelector::CallDispatchController* call_dispatch_controller() {
+ return &call_dispatch_controller_;
+ }
+
+ private:
+ // A wrapper for the CallDispatchController returned by the ConfigSelector.
+ // Handles the case where the ConfigSelector doees not return any
+ // CallDispatchController.
+ // Also ensures that we call Commit() at most once, which allows the
+ // client channel code to call Commit() when the call is complete in case
+ // it wasn't called earlier, without needing to know whether or not it was.
+ class CallDispatchControllerWrapper
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit CallDispatchControllerWrapper(
+ ConfigSelector::CallDispatchController* call_dispatch_controller)
+ : call_dispatch_controller_(call_dispatch_controller) {}
+
+ bool ShouldRetry() override {
+ if (call_dispatch_controller_ != nullptr) {
+ return call_dispatch_controller_->ShouldRetry();
+ }
+ return true;
+ }
+
+ void Commit() override {
+ if (call_dispatch_controller_ != nullptr && !commit_called_) {
+ call_dispatch_controller_->Commit();
+ commit_called_ = true;
+ }
+ }
+
+ private:
+ ConfigSelector::CallDispatchController* call_dispatch_controller_;
+ bool commit_called_ = false;
+ };
+
+ static void Destroy(void* ptr) {
+ auto* self = static_cast<ClientChannelServiceConfigCallData*>(ptr);
+ self->~ClientChannelServiceConfigCallData();
+ }
+
+ CallDispatchControllerWrapper call_dispatch_controller_;
+};
+
} // namespace grpc_core
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc b/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
index 9a9e3b7d..d543aa41 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -18,15 +18,16 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
+
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
-#include <grpc/support/string_util.h>
-
namespace grpc_core {
namespace channelz {
@@ -39,7 +40,7 @@ SubchannelNode::SubchannelNode(std::string target_address,
SubchannelNode::~SubchannelNode() {}
void SubchannelNode::UpdateConnectivityState(grpc_connectivity_state state) {
- connectivity_state_.Store(state, MemoryOrder::RELAXED);
+ connectivity_state_.store(state, std::memory_order_relaxed);
}
void SubchannelNode::SetChildSocket(RefCountedPtr<SocketNode> socket) {
@@ -50,7 +51,7 @@ void SubchannelNode::SetChildSocket(RefCountedPtr<SocketNode> socket) {
Json SubchannelNode::RenderJson() {
// Create and fill the data child.
grpc_connectivity_state state =
- connectivity_state_.Load(MemoryOrder::RELAXED);
+ connectivity_state_.load(std::memory_order_relaxed);
Json::Object data = {
{"state",
Json::Object{
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h b/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
index a106897b..2f530980 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
+++ b/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
@@ -61,7 +61,7 @@ class SubchannelNode : public BaseNode {
void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
private:
- Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
+ std::atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Mutex socket_mu_;
RefCountedPtr<SocketNode> child_socket_ ABSL_GUARDED_BY(socket_mu_);
std::string target_;
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc b/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
index c0d853eb..7e234a3e 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
+++ b/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
+
#include "src/core/lib/channel/channel_args.h"
// Channel arg key for client channel factory.
@@ -31,7 +32,7 @@ namespace {
void* factory_arg_copy(void* f) { return f; }
void factory_arg_destroy(void* /*f*/) {}
int factory_arg_cmp(void* factory1, void* factory2) {
- return GPR_ICMP(factory1, factory2);
+ return QsortCompare(factory1, factory2);
}
const grpc_arg_pointer_vtable factory_arg_vtable = {
factory_arg_copy, factory_arg_destroy, factory_arg_cmp};
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel_factory.h b/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
index 75d74d67..0e00edc5 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
@@ -33,7 +31,7 @@ class ClientChannelFactory {
// Creates a subchannel with the specified args.
virtual RefCountedPtr<Subchannel> CreateSubchannel(
- const grpc_channel_args* args) = 0;
+ const grpc_resolved_address& address, const grpc_channel_args* args) = 0;
// Returns a channel arg containing the specified factory.
static grpc_arg CreateChannelArg(ClientChannelFactory* factory);
@@ -45,4 +43,4 @@ class ClientChannelFactory {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
diff --git a/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc b/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
index 1d33d25b..4b53c20f 100644
--- a/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ b/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -32,42 +32,36 @@
#include "src/core/ext/filters/client_channel/http_proxy.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"
#include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
#include "src/core/ext/filters/client_channel/retry_service_config.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/lib/surface/channel_init.h"
-
-static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_append_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/resolver/resolver_registry.h"
void grpc_client_channel_init(void) {
- grpc_core::ServiceConfigParser::Init();
- grpc_core::internal::ClientChannelServiceConfigParser::Register();
- grpc_core::internal::RetryServiceConfigParser::Register();
grpc_core::LoadBalancingPolicyRegistry::Builder::InitRegistry();
- grpc_core::ResolverRegistry::Builder::InitRegistry();
- grpc_core::internal::ServerRetryThrottleMap::Init();
grpc_core::ProxyMapperRegistry::Init();
grpc_core::RegisterHttpProxyMapper();
- grpc_core::GlobalSubchannelPool::Init();
- grpc_channel_init_register_stage(
- GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
- const_cast<grpc_channel_filter*>(
- &grpc_core::ClientChannel::kFilterVtable));
- grpc_http_connect_register_handshaker_factory();
grpc_client_channel_global_init_backup_polling();
}
void grpc_client_channel_shutdown(void) {
- grpc_core::GlobalSubchannelPool::Shutdown();
- grpc_channel_init_shutdown();
grpc_core::ProxyMapperRegistry::Shutdown();
- grpc_core::internal::ServerRetryThrottleMap::Shutdown();
- grpc_core::ResolverRegistry::Builder::ShutdownRegistry();
grpc_core::LoadBalancingPolicyRegistry::Builder::ShutdownRegistry();
- grpc_core::ServiceConfigParser::Shutdown();
}
+
+namespace grpc_core {
+
+void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) {
+ RegisterHttpConnectHandshaker(builder);
+ internal::ClientChannelServiceConfigParser::Register(builder);
+ internal::RetryServiceConfigParser::Register(builder);
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](ChannelStackBuilder* builder) {
+ builder->AppendFilter(&ClientChannel::kFilterVtable, nullptr);
+ return true;
+ });
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/config_selector.cc b/grpc/src/core/ext/filters/client_channel/config_selector.cc
index 0c2a08e5..e741a3e6 100644
--- a/grpc/src/core/ext/filters/client_channel/config_selector.cc
+++ b/grpc/src/core/ext/filters/client_channel/config_selector.cc
@@ -17,6 +17,7 @@
#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 {
@@ -34,7 +35,7 @@ void ConfigSelectorArgDestroy(void* p) {
config_selector->Unref();
}
-int ConfigSelectorArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int ConfigSelectorArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kChannelArgVtable = {
ConfigSelectorArgCopy, ConfigSelectorArgDestroy, ConfigSelectorArgCmp};
diff --git a/grpc/src/core/ext/filters/client_channel/config_selector.h b/grpc/src/core/ext/filters/client_channel/config_selector.h
index 98ae07e4..76540698 100644
--- a/grpc/src/core/ext/filters/client_channel/config_selector.h
+++ b/grpc/src/core/ext/filters/client_channel/config_selector.h
@@ -27,12 +27,13 @@
#include <grpc/grpc.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/channel_stack.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/resource_quota/arena.h"
+#include "src/core/lib/service_config/service_config.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/service_config/service_config_parser.h"
#include "src/core/lib/transport/metadata_batch.h"
// Channel arg key for ConfigSelector.
@@ -44,6 +45,20 @@ namespace grpc_core {
// MethodConfig and provide input to LB policies on a per-call basis.
class ConfigSelector : public RefCounted<ConfigSelector> {
public:
+ // An interface to be used by the channel when dispatching calls.
+ class CallDispatchController {
+ public:
+ virtual ~CallDispatchController() = default;
+
+ // Called by the channel to decide if it should retry the call upon a
+ // failure.
+ virtual bool ShouldRetry() = 0;
+
+ // Called by the channel when no more LB picks will be performed for
+ // the call.
+ virtual void Commit() = 0;
+ };
+
struct GetCallConfigArgs {
grpc_slice* path;
grpc_metadata_batch* initial_metadata;
@@ -60,11 +75,9 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
// 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*, 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;
+ ServiceConfigCallData::CallAttributes call_attributes;
+ // Call dispatch controller.
+ CallDispatchController* call_dispatch_controller = nullptr;
};
~ConfigSelector() override = default;
@@ -85,7 +98,6 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
// The channel will call this when the resolver returns a new ConfigSelector
// to determine what set of dynamic filters will be configured.
virtual std::vector<const grpc_channel_filter*> GetFilters() { return {}; }
-
// Modifies channel args to be passed to the dynamic filter stack.
// Takes ownership of argument. Caller takes ownership of result.
virtual grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) {
diff --git a/grpc/src/core/ext/filters/client_channel/connector.h b/grpc/src/core/ext/filters/client_channel/connector.h
index 20e25b5b..5777db70 100644
--- a/grpc/src/core/ext/filters/client_channel/connector.h
+++ b/grpc/src/core/ext/filters/client_channel/connector.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
@@ -35,10 +33,12 @@ namespace grpc_core {
class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
public:
struct Args {
+ // Address to connect to.
+ grpc_resolved_address* address;
// Set of pollsets interested in this connection.
grpc_pollset_set* interested_parties;
// Deadline for connection.
- grpc_millis deadline;
+ Timestamp deadline;
// Channel args to be passed to handshakers and transport.
const grpc_channel_args* channel_args;
};
@@ -76,4 +76,4 @@ class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
diff --git a/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc b/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
index 47c05a30..c46cd290 100644
--- a/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
+++ b/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
@@ -79,7 +79,7 @@ RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref() {
}
RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref(
- const grpc_core::DebugLocation& location, const char* reason) {
+ const DebugLocation& location, const char* reason) {
IncrementRefCount(location, reason);
return RefCountedPtr<DynamicFilters::Call>(this);
}
@@ -112,8 +112,8 @@ void DynamicFilters::Call::IncrementRefCount() {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), "");
}
-void DynamicFilters::Call::IncrementRefCount(
- const grpc_core::DebugLocation& /*location*/, const char* reason) {
+void DynamicFilters::Call::IncrementRefCount(const DebugLocation& /*location*/,
+ const char* reason) {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), reason);
}
@@ -140,8 +140,7 @@ std::pair<grpc_channel_stack*, grpc_error_handle> CreateChannelStack(
// Initialize stack.
grpc_error_handle error = grpc_channel_stack_init(
/*initial_refs=*/1, DestroyChannelStack, channel_stack, filters.data(),
- filters.size(), args, /*optional_transport=*/nullptr, "DynamicFilters",
- channel_stack);
+ filters.size(), args, "DynamicFilters", channel_stack);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error initializing client internal stack: %s",
grpc_error_std_string(error).c_str());
@@ -163,7 +162,7 @@ RefCountedPtr<DynamicFilters> DynamicFilters::Create(
// Channel stack creation failed with requested filters.
// Create with lame filter instead.
grpc_error_handle error = p.second;
- grpc_arg error_arg = MakeLameClientErrorArg(error);
+ grpc_arg error_arg = MakeLameClientErrorArg(&error);
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &error_arg, 1);
GRPC_ERROR_UNREF(error);
@@ -184,7 +183,7 @@ RefCountedPtr<DynamicFilters::Call> DynamicFilters::CreateCall(
channel_stack_->call_stack_size;
Call* call = static_cast<Call*>(args.arena->Alloc(allocation_size));
new (call) Call(std::move(args), error);
- return call;
+ return RefCountedPtr<DynamicFilters::Call>(call);
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/dynamic_filters.h b/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
index 08a7f498..515b9252 100644
--- a/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
+++ b/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
@@ -23,10 +23,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
@@ -40,7 +40,7 @@ class DynamicFilters : public RefCounted<DynamicFilters> {
grpc_polling_entity* pollent;
grpc_slice path;
gpr_cycle_counter start_time;
- grpc_millis deadline;
+ Timestamp deadline;
Arena* arena;
grpc_call_context_element* context;
CallCombiner* call_combiner;
diff --git a/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc b/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
index 72593a6f..4fc5ff9c 100644
--- a/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
+++ b/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.cc
@@ -24,27 +24,9 @@
namespace grpc_core {
-#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_AFTER_ATTEMPTS 100
-#define GRPC_REGISTER_SUBCHANNEL_CALM_DOWN_MICROS 10
-
-void GlobalSubchannelPool::Init() {
- instance_ = new RefCountedPtr<GlobalSubchannelPool>(
- MakeRefCounted<GlobalSubchannelPool>());
-}
-
-void GlobalSubchannelPool::Shutdown() {
- // To ensure Init() was called before.
- GPR_ASSERT(instance_ != nullptr);
- // To ensure Shutdown() was not called before.
- GPR_ASSERT(*instance_ != nullptr);
- instance_->reset();
- delete instance_;
-}
-
RefCountedPtr<GlobalSubchannelPool> GlobalSubchannelPool::instance() {
- GPR_ASSERT(instance_ != nullptr);
- GPR_ASSERT(*instance_ != nullptr);
- return *instance_;
+ static GlobalSubchannelPool* p = new GlobalSubchannelPool();
+ return p->Ref();
}
RefCountedPtr<Subchannel> GlobalSubchannelPool::RegisterSubchannel(
@@ -59,8 +41,6 @@ RefCountedPtr<Subchannel> GlobalSubchannelPool::RegisterSubchannel(
return constructed;
}
-RefCountedPtr<GlobalSubchannelPool>* GlobalSubchannelPool::instance_ = nullptr;
-
void GlobalSubchannelPool::UnregisterSubchannel(const SubchannelKey& key,
Subchannel* subchannel) {
MutexLock lock(&mu_);
diff --git a/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h b/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
index 7ff9b070..cb380918 100644
--- a/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
+++ b/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
@@ -29,21 +29,9 @@
namespace grpc_core {
// The global subchannel pool. It shares subchannels among channels. There
-// should be only one instance of this class. Init() should be called once at
-// the filter initialization time; Shutdown() should be called once at the
-// filter shutdown time.
-// TODO(juanlishen): Enable subchannel retention.
+// should be only one instance of this class.
class GlobalSubchannelPool final : public SubchannelPoolInterface {
public:
- // The ctor and dtor are not intended to use directly.
- GlobalSubchannelPool() {}
- ~GlobalSubchannelPool() override {}
-
- // Should be called exactly once at filter initialization time.
- static void Init();
- // Should be called exactly once at filter shutdown time.
- static void Shutdown();
-
// Gets the singleton instance.
static RefCountedPtr<GlobalSubchannelPool> instance();
@@ -58,9 +46,8 @@ class GlobalSubchannelPool final : public SubchannelPoolInterface {
ABSL_LOCKS_EXCLUDED(mu_);
private:
- // The singleton instance. (It's a pointer to RefCountedPtr so that this
- // non-local static object can be trivially destructible.)
- static RefCountedPtr<GlobalSubchannelPool>* instance_;
+ GlobalSubchannelPool() {}
+ ~GlobalSubchannelPool() override {}
// A map from subchannel key to subchannel.
std::map<SubchannelKey, Subchannel*> subchannel_map_ ABSL_GUARDED_BY(mu_);
diff --git a/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc b/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
index adde23d3..5adbd772 100644
--- a/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
+++ b/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
@@ -1,615 +1,163 @@
-/*
- *
- * 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/filters/client_channel/health/health_check_client.h"
+
#include <stdint.h>
#include <stdio.h>
-#include "src/core/ext/filters/client_channel/health/health_check_client.h"
-
#include "upb/upb.hpp"
+#include <grpc/status.h>
+
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/status_metadata.h"
#include "src/proto/grpc/health/v1/health.upb.h"
-#define HEALTH_CHECK_INITIAL_CONNECT_BACKOFF_SECONDS 1
-#define HEALTH_CHECK_RECONNECT_BACKOFF_MULTIPLIER 1.6
-#define HEALTH_CHECK_RECONNECT_MAX_BACKOFF_SECONDS 120
-#define HEALTH_CHECK_RECONNECT_JITTER 0.2
-
namespace grpc_core {
TraceFlag grpc_health_check_client_trace(false, "health_check_client");
-//
-// HealthCheckClient
-//
-
-HealthCheckClient::HealthCheckClient(
- std::string service_name,
- RefCountedPtr<ConnectedSubchannel> connected_subchannel,
- grpc_pollset_set* interested_parties,
- RefCountedPtr<channelz::SubchannelNode> channelz_node,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher)
- : InternallyRefCounted<HealthCheckClient>(
- GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)
- ? "HealthCheckClient"
- : nullptr),
- service_name_(std::move(service_name)),
- connected_subchannel_(std::move(connected_subchannel)),
- interested_parties_(interested_parties),
- channelz_node_(std::move(channelz_node)),
- watcher_(std::move(watcher)),
- retry_backoff_(
- BackOff::Options()
- .set_initial_backoff(
- HEALTH_CHECK_INITIAL_CONNECT_BACKOFF_SECONDS * 1000)
- .set_multiplier(HEALTH_CHECK_RECONNECT_BACKOFF_MULTIPLIER)
- .set_jitter(HEALTH_CHECK_RECONNECT_JITTER)
- .set_max_backoff(HEALTH_CHECK_RECONNECT_MAX_BACKOFF_SECONDS *
- 1000)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "created HealthCheckClient %p", this);
- }
- GRPC_CLOSURE_INIT(&retry_timer_callback_, OnRetryTimer, this,
- grpc_schedule_on_exec_ctx);
- StartCall();
-}
-
-HealthCheckClient::~HealthCheckClient() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "destroying HealthCheckClient %p", this);
- }
-}
-
-void HealthCheckClient::SetHealthStatus(grpc_connectivity_state state,
- const char* reason) {
- MutexLock lock(&mu_);
- SetHealthStatusLocked(state, reason);
-}
-
-void HealthCheckClient::SetHealthStatusLocked(grpc_connectivity_state state,
- const char* reason) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- 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
- ? absl::Status(absl::StatusCode::kUnavailable, reason)
- : absl::Status());
- }
-}
+namespace {
-void HealthCheckClient::Orphan() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "HealthCheckClient %p: shutting down", this);
- }
- {
- MutexLock lock(&mu_);
- shutting_down_ = true;
- watcher_.reset();
- call_state_.reset();
- if (retry_timer_callback_pending_) {
- grpc_timer_cancel(&retry_timer_);
+class HealthStreamEventHandler
+ : public SubchannelStreamClient::CallEventHandler {
+ public:
+ HealthStreamEventHandler(
+ std::string service_name,
+ RefCountedPtr<channelz::SubchannelNode> channelz_node,
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher)
+ : service_name_(std::move(service_name)),
+ channelz_node_(std::move(channelz_node)),
+ watcher_(std::move(watcher)) {}
+
+ Slice GetPathLocked() override {
+ return Slice::FromStaticString("/grpc.health.v1.Health/Watch");
+ }
+
+ void OnCallStartLocked(SubchannelStreamClient* client) override {
+ SetHealthStatusLocked(client, GRPC_CHANNEL_CONNECTING,
+ "starting health watch");
+ }
+
+ void OnRetryTimerStartLocked(SubchannelStreamClient* client) override {
+ SetHealthStatusLocked(client, GRPC_CHANNEL_TRANSIENT_FAILURE,
+ "health check call failed; will retry after backoff");
+ }
+
+ grpc_slice EncodeSendMessageLocked() override {
+ upb::Arena arena;
+ grpc_health_v1_HealthCheckRequest* request_struct =
+ grpc_health_v1_HealthCheckRequest_new(arena.ptr());
+ grpc_health_v1_HealthCheckRequest_set_service(
+ request_struct, upb_StringView_FromDataAndSize(service_name_.data(),
+ service_name_.size()));
+ size_t buf_length;
+ char* buf = grpc_health_v1_HealthCheckRequest_serialize(
+ request_struct, arena.ptr(), &buf_length);
+ grpc_slice request_slice = GRPC_SLICE_MALLOC(buf_length);
+ memcpy(GRPC_SLICE_START_PTR(request_slice), buf, buf_length);
+ return request_slice;
+ }
+
+ absl::Status RecvMessageReadyLocked(
+ SubchannelStreamClient* client,
+ absl::string_view serialized_message) override {
+ auto healthy = DecodeResponse(serialized_message);
+ if (!healthy.ok()) {
+ SetHealthStatusLocked(client, GRPC_CHANNEL_TRANSIENT_FAILURE,
+ healthy.status().ToString().c_str());
+ return healthy.status();
}
- }
- Unref(DEBUG_LOCATION, "orphan");
-}
-
-void HealthCheckClient::StartCall() {
- MutexLock lock(&mu_);
- StartCallLocked();
-}
-
-void HealthCheckClient::StartCallLocked() {
- if (shutting_down_) return;
- GPR_ASSERT(call_state_ == nullptr);
- SetHealthStatusLocked(GRPC_CHANNEL_CONNECTING, "starting health watch");
- call_state_ = MakeOrphanable<CallState>(Ref(), interested_parties_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "HealthCheckClient %p: created CallState %p", this,
- call_state_.get());
- }
- call_state_->StartCall();
-}
-
-void HealthCheckClient::StartRetryTimerLocked() {
- SetHealthStatusLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
- "health check call failed; will retry after backoff");
- grpc_millis next_try = retry_backoff_.NextAttemptTime();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "HealthCheckClient %p: health check call lost...", this);
- grpc_millis timeout = next_try - ExecCtx::Get()->Now();
- if (timeout > 0) {
- gpr_log(GPR_INFO,
- "HealthCheckClient %p: ... will retry in %" PRId64 "ms.", this,
- timeout);
+ if (!*healthy) {
+ SetHealthStatusLocked(client, GRPC_CHANNEL_TRANSIENT_FAILURE,
+ "backend unhealthy");
} else {
- gpr_log(GPR_INFO, "HealthCheckClient %p: ... retrying immediately.",
- this);
+ SetHealthStatusLocked(client, GRPC_CHANNEL_READY, "OK");
}
- }
- // Ref for callback, tracked manually.
- Ref(DEBUG_LOCATION, "health_retry_timer").release();
- retry_timer_callback_pending_ = true;
- grpc_timer_init(&retry_timer_, next_try, &retry_timer_callback_);
-}
-
-void HealthCheckClient::OnRetryTimer(void* arg, grpc_error_handle error) {
- HealthCheckClient* self = static_cast<HealthCheckClient*>(arg);
- {
- MutexLock lock(&self->mu_);
- self->retry_timer_callback_pending_ = false;
- if (!self->shutting_down_ && error == GRPC_ERROR_NONE &&
- self->call_state_ == nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "HealthCheckClient %p: restarting health check call",
- self);
+ return absl::OkStatus();
+ }
+
+ void RecvTrailingMetadataReadyLocked(SubchannelStreamClient* client,
+ grpc_status_code status) override {
+ if (status == GRPC_STATUS_UNIMPLEMENTED) {
+ static const char kErrorMessage[] =
+ "health checking Watch method returned UNIMPLEMENTED; "
+ "disabling health checks but assuming server is healthy";
+ gpr_log(GPR_ERROR, kErrorMessage);
+ if (channelz_node_ != nullptr) {
+ channelz_node_->AddTraceEvent(
+ channelz::ChannelTrace::Error,
+ grpc_slice_from_static_string(kErrorMessage));
}
- self->StartCallLocked();
- }
- }
- self->Unref(DEBUG_LOCATION, "health_retry_timer");
-}
-
-//
-// protobuf helpers
-//
-
-namespace {
-
-void EncodeRequest(const std::string& service_name,
- ManualConstructor<SliceBufferByteStream>* send_message) {
- upb::Arena arena;
- grpc_health_v1_HealthCheckRequest* request_struct =
- grpc_health_v1_HealthCheckRequest_new(arena.ptr());
- grpc_health_v1_HealthCheckRequest_set_service(
- request_struct,
- upb_strview_make(service_name.data(), service_name.size()));
- size_t buf_length;
- char* buf = grpc_health_v1_HealthCheckRequest_serialize(
- request_struct, arena.ptr(), &buf_length);
- grpc_slice request_slice = GRPC_SLICE_MALLOC(buf_length);
- memcpy(GRPC_SLICE_START_PTR(request_slice), buf, buf_length);
- grpc_slice_buffer slice_buffer;
- grpc_slice_buffer_init(&slice_buffer);
- grpc_slice_buffer_add(&slice_buffer, request_slice);
- send_message->Init(&slice_buffer, 0);
- grpc_slice_buffer_destroy_internal(&slice_buffer);
-}
-
-// Returns true if healthy.
-// If there was an error parsing the response, sets *error and returns false.
-bool DecodeResponse(grpc_slice_buffer* slice_buffer, grpc_error_handle* error) {
- // If message is empty, assume unhealthy.
- if (slice_buffer->length == 0) {
- *error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("health check response was empty");
- return false;
- }
- // Concatenate the slices to form a single string.
- std::unique_ptr<uint8_t> recv_message_deleter;
- uint8_t* recv_message;
- if (slice_buffer->count == 1) {
- recv_message = GRPC_SLICE_START_PTR(slice_buffer->slices[0]);
- } else {
- recv_message = static_cast<uint8_t*>(gpr_malloc(slice_buffer->length));
- recv_message_deleter.reset(recv_message);
- size_t offset = 0;
- for (size_t i = 0; i < slice_buffer->count; ++i) {
- memcpy(recv_message + offset,
- GRPC_SLICE_START_PTR(slice_buffer->slices[i]),
- GRPC_SLICE_LENGTH(slice_buffer->slices[i]));
- offset += GRPC_SLICE_LENGTH(slice_buffer->slices[i]);
+ SetHealthStatusLocked(client, GRPC_CHANNEL_READY, kErrorMessage);
}
}
- // Deserialize message.
- upb::Arena arena;
- grpc_health_v1_HealthCheckResponse* response_struct =
- grpc_health_v1_HealthCheckResponse_parse(
- reinterpret_cast<char*>(recv_message), slice_buffer->length,
- arena.ptr());
- if (response_struct == nullptr) {
- // Can't parse message; assume unhealthy.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "cannot parse health check response");
- return false;
- }
- int32_t status = grpc_health_v1_HealthCheckResponse_status(response_struct);
- return status == grpc_health_v1_HealthCheckResponse_SERVING;
-}
-
-} // namespace
-
-//
-// HealthCheckClient::CallState
-//
-HealthCheckClient::CallState::CallState(
- RefCountedPtr<HealthCheckClient> health_check_client,
- grpc_pollset_set* interested_parties)
- : health_check_client_(std::move(health_check_client)),
- pollent_(grpc_polling_entity_create_from_pollset_set(interested_parties)),
- arena_(Arena::Create(health_check_client_->connected_subchannel_
- ->GetInitialCallSizeEstimate())),
- payload_(context_) {}
-
-HealthCheckClient::CallState::~CallState() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO, "HealthCheckClient %p: destroying CallState %p",
- health_check_client_.get(), this);
- }
- for (size_t i = 0; i < GRPC_CONTEXT_COUNT; i++) {
- if (context_[i].destroy != nullptr) {
- context_[i].destroy(context_[i].value);
+ private:
+ // Returns true if healthy.
+ static absl::StatusOr<bool> DecodeResponse(
+ absl::string_view serialized_message) {
+ // Deserialize message.
+ upb::Arena arena;
+ auto* response = grpc_health_v1_HealthCheckResponse_parse(
+ serialized_message.data(), serialized_message.size(), arena.ptr());
+ if (response == nullptr) {
+ // Can't parse message; assume unhealthy.
+ return absl::InvalidArgumentError("cannot parse health check response");
}
+ int32_t status = grpc_health_v1_HealthCheckResponse_status(response);
+ return status == grpc_health_v1_HealthCheckResponse_SERVING;
}
- // Unset the call combiner cancellation closure. This has the
- // effect of scheduling the previously set cancellation closure, if
- // any, so that it can release any internal references it may be
- // holding to the call stack.
- call_combiner_.SetNotifyOnCancel(nullptr);
- arena_->Destroy();
-}
-
-void HealthCheckClient::CallState::Orphan() {
- call_combiner_.Cancel(GRPC_ERROR_CANCELLED);
- Cancel();
-}
-
-void HealthCheckClient::CallState::StartCall() {
- SubchannelCall::Args args = {
- health_check_client_->connected_subchannel_,
- &pollent_,
- GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH,
- gpr_get_cycle_counter(), // start_time
- GRPC_MILLIS_INF_FUTURE, // deadline
- arena_,
- context_,
- &call_combiner_,
- };
- grpc_error_handle error = GRPC_ERROR_NONE;
- call_ = SubchannelCall::Create(std::move(args), &error).release();
- // Register after-destruction callback.
- GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
- this, grpc_schedule_on_exec_ctx);
- call_->SetAfterCallStackDestroy(&after_call_stack_destruction_);
- // Check if creation failed.
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "HealthCheckClient %p CallState %p: error creating health "
- "checking call on subchannel (%s); will retry",
- health_check_client_.get(), this,
- grpc_error_std_string(error).c_str());
- GRPC_ERROR_UNREF(error);
- CallEndedLocked(/*retry=*/true);
- return;
- }
- // Initialize payload and batch.
- payload_.context = context_;
- batch_.payload = &payload_;
- // on_complete callback takes ref, handled manually.
- call_->Ref(DEBUG_LOCATION, "on_complete").release();
- batch_.on_complete = GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this,
- grpc_schedule_on_exec_ctx);
- // Add send_initial_metadata op.
- grpc_metadata_batch_init(&send_initial_metadata_);
- error = grpc_metadata_batch_add_head(
- &send_initial_metadata_, &path_metadata_storage_,
- grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH,
- GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH),
- GRPC_BATCH_PATH);
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- payload_.send_initial_metadata.send_initial_metadata =
- &send_initial_metadata_;
- payload_.send_initial_metadata.send_initial_metadata_flags = 0;
- payload_.send_initial_metadata.peer_string = nullptr;
- batch_.send_initial_metadata = true;
- // Add send_message op.
- EncodeRequest(health_check_client_->service_name_, &send_message_);
- payload_.send_message.send_message.reset(send_message_.get());
- batch_.send_message = true;
- // Add send_trailing_metadata op.
- grpc_metadata_batch_init(&send_trailing_metadata_);
- payload_.send_trailing_metadata.send_trailing_metadata =
- &send_trailing_metadata_;
- batch_.send_trailing_metadata = true;
- // Add recv_initial_metadata op.
- grpc_metadata_batch_init(&recv_initial_metadata_);
- payload_.recv_initial_metadata.recv_initial_metadata =
- &recv_initial_metadata_;
- payload_.recv_initial_metadata.recv_flags = nullptr;
- payload_.recv_initial_metadata.trailing_metadata_available = nullptr;
- payload_.recv_initial_metadata.peer_string = nullptr;
- // recv_initial_metadata_ready callback takes ref, handled manually.
- call_->Ref(DEBUG_LOCATION, "recv_initial_metadata_ready").release();
- payload_.recv_initial_metadata.recv_initial_metadata_ready =
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
- this, grpc_schedule_on_exec_ctx);
- batch_.recv_initial_metadata = true;
- // Add recv_message op.
- payload_.recv_message.recv_message = &recv_message_;
- // recv_message callback takes ref, handled manually.
- call_->Ref(DEBUG_LOCATION, "recv_message_ready").release();
- payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
- &recv_message_ready_, RecvMessageReady, this, grpc_schedule_on_exec_ctx);
- batch_.recv_message = true;
- // Start batch.
- StartBatch(&batch_);
- // Initialize recv_trailing_metadata batch.
- recv_trailing_metadata_batch_.payload = &payload_;
- // Add recv_trailing_metadata op.
- grpc_metadata_batch_init(&recv_trailing_metadata_);
- payload_.recv_trailing_metadata.recv_trailing_metadata =
- &recv_trailing_metadata_;
- payload_.recv_trailing_metadata.collect_stats = &collect_stats_;
- // This callback signals the end of the call, so it relies on the
- // initial ref instead of taking a new ref. When it's invoked, the
- // initial ref is released.
- payload_.recv_trailing_metadata.recv_trailing_metadata_ready =
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
- RecvTrailingMetadataReady, this,
- grpc_schedule_on_exec_ctx);
- recv_trailing_metadata_batch_.recv_trailing_metadata = true;
- // Start recv_trailing_metadata batch.
- StartBatch(&recv_trailing_metadata_batch_);
-}
-
-void HealthCheckClient::CallState::StartBatchInCallCombiner(
- void* arg, grpc_error_handle /*error*/) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- SubchannelCall* call =
- static_cast<SubchannelCall*>(batch->handler_private.extra_arg);
- call->StartTransportStreamOpBatch(batch);
-}
-
-void HealthCheckClient::CallState::StartBatch(
- grpc_transport_stream_op_batch* batch) {
- batch->handler_private.extra_arg = call_;
- GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
- batch, grpc_schedule_on_exec_ctx);
- GRPC_CALL_COMBINER_START(&call_combiner_, &batch->handler_private.closure,
- GRPC_ERROR_NONE, "start_subchannel_batch");
-}
-
-void HealthCheckClient::CallState::AfterCallStackDestruction(
- void* arg, grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- delete self;
-}
-
-void HealthCheckClient::CallState::OnCancelComplete(
- void* arg, grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "health_cancel");
- self->call_->Unref(DEBUG_LOCATION, "cancel");
-}
-
-void HealthCheckClient::CallState::StartCancel(void* arg,
- grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- auto* batch = grpc_make_transport_stream_op(
- GRPC_CLOSURE_CREATE(OnCancelComplete, self, grpc_schedule_on_exec_ctx));
- batch->cancel_stream = true;
- batch->payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
- self->call_->StartTransportStreamOpBatch(batch);
-}
-
-void HealthCheckClient::CallState::Cancel() {
- bool expected = false;
- if (cancelled_.CompareExchangeStrong(&expected, true, MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE)) {
- call_->Ref(DEBUG_LOCATION, "cancel").release();
- GRPC_CALL_COMBINER_START(
- &call_combiner_,
- GRPC_CLOSURE_CREATE(StartCancel, this, grpc_schedule_on_exec_ctx),
- GRPC_ERROR_NONE, "health_cancel");
- }
-}
-
-void HealthCheckClient::CallState::OnComplete(void* arg,
- grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "on_complete");
- grpc_metadata_batch_destroy(&self->send_initial_metadata_);
- grpc_metadata_batch_destroy(&self->send_trailing_metadata_);
- self->call_->Unref(DEBUG_LOCATION, "on_complete");
-}
-
-void HealthCheckClient::CallState::RecvInitialMetadataReady(
- void* arg, grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_initial_metadata_ready");
- grpc_metadata_batch_destroy(&self->recv_initial_metadata_);
- self->call_->Unref(DEBUG_LOCATION, "recv_initial_metadata_ready");
-}
-void HealthCheckClient::CallState::DoneReadingRecvMessage(
- grpc_error_handle error) {
- recv_message_.reset();
- if (error != GRPC_ERROR_NONE) {
- GRPC_ERROR_UNREF(error);
- Cancel();
- grpc_slice_buffer_destroy_internal(&recv_message_buffer_);
- call_->Unref(DEBUG_LOCATION, "recv_message_ready");
- return;
- }
- const bool healthy = DecodeResponse(&recv_message_buffer_, &error);
- const grpc_connectivity_state state =
- healthy ? GRPC_CHANNEL_READY : GRPC_CHANNEL_TRANSIENT_FAILURE;
- health_check_client_->SetHealthStatus(
- state, error == GRPC_ERROR_NONE && !healthy
- ? "backend unhealthy"
- : grpc_error_std_string(error).c_str());
- seen_response_.Store(true, MemoryOrder::RELEASE);
- grpc_slice_buffer_destroy_internal(&recv_message_buffer_);
- // Start another recv_message batch.
- // This re-uses the ref we're holding.
- // Note: Can't just reuse batch_ here, since we don't know that all
- // callbacks from the original batch have completed yet.
- recv_message_batch_.payload = &payload_;
- payload_.recv_message.recv_message = &recv_message_;
- payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
- &recv_message_ready_, RecvMessageReady, this, grpc_schedule_on_exec_ctx);
- recv_message_batch_.recv_message = true;
- StartBatch(&recv_message_batch_);
-}
-
-grpc_error_handle HealthCheckClient::CallState::PullSliceFromRecvMessage() {
- grpc_slice slice;
- grpc_error_handle error = recv_message_->Pull(&slice);
- if (error == GRPC_ERROR_NONE) {
- grpc_slice_buffer_add(&recv_message_buffer_, slice);
- }
- return error;
-}
-
-void HealthCheckClient::CallState::ContinueReadingRecvMessage() {
- while (recv_message_->Next(SIZE_MAX, &recv_message_ready_)) {
- grpc_error_handle error = PullSliceFromRecvMessage();
- if (error != GRPC_ERROR_NONE) {
- DoneReadingRecvMessage(error);
- return;
- }
- if (recv_message_buffer_.length == recv_message_->length()) {
- DoneReadingRecvMessage(GRPC_ERROR_NONE);
- break;
+ void SetHealthStatusLocked(SubchannelStreamClient* client,
+ grpc_connectivity_state state,
+ const char* reason) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
+ gpr_log(GPR_INFO, "HealthCheckClient %p: setting state=%s reason=%s",
+ client, ConnectivityStateName(state), reason);
}
+ watcher_->Notify(state, state == GRPC_CHANNEL_TRANSIENT_FAILURE
+ ? absl::UnavailableError(reason)
+ : absl::Status());
}
-}
-void HealthCheckClient::CallState::OnByteStreamNext(void* arg,
- grpc_error_handle error) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- if (error != GRPC_ERROR_NONE) {
- self->DoneReadingRecvMessage(GRPC_ERROR_REF(error));
- return;
- }
- error = self->PullSliceFromRecvMessage();
- if (error != GRPC_ERROR_NONE) {
- self->DoneReadingRecvMessage(error);
- return;
- }
- if (self->recv_message_buffer_.length == self->recv_message_->length()) {
- self->DoneReadingRecvMessage(GRPC_ERROR_NONE);
- } else {
- self->ContinueReadingRecvMessage();
- }
-}
-
-void HealthCheckClient::CallState::RecvMessageReady(
- void* arg, grpc_error_handle /*error*/) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_message_ready");
- if (self->recv_message_ == nullptr) {
- self->call_->Unref(DEBUG_LOCATION, "recv_message_ready");
- return;
- }
- grpc_slice_buffer_init(&self->recv_message_buffer_);
- GRPC_CLOSURE_INIT(&self->recv_message_ready_, OnByteStreamNext, self,
- grpc_schedule_on_exec_ctx);
- self->ContinueReadingRecvMessage();
- // Ref will continue to be held until we finish draining the byte stream.
-}
+ std::string service_name_;
+ RefCountedPtr<channelz::SubchannelNode> channelz_node_;
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher_;
+};
-void HealthCheckClient::CallState::RecvTrailingMetadataReady(
- void* arg, grpc_error_handle error) {
- HealthCheckClient::CallState* self =
- static_cast<HealthCheckClient::CallState*>(arg);
- GRPC_CALL_COMBINER_STOP(&self->call_combiner_,
- "recv_trailing_metadata_ready");
- // Get call status.
- grpc_status_code status = GRPC_STATUS_UNKNOWN;
- if (error != GRPC_ERROR_NONE) {
- grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, &status,
- nullptr /* slice */, nullptr /* http_error */,
- nullptr /* error_string */);
- } else if (self->recv_trailing_metadata_.idx.named.grpc_status != nullptr) {
- status = grpc_get_status_code_from_metadata(
- self->recv_trailing_metadata_.idx.named.grpc_status->md);
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
- gpr_log(GPR_INFO,
- "HealthCheckClient %p CallState %p: health watch failed with "
- "status %d",
- self->health_check_client_.get(), self, status);
- }
- // Clean up.
- grpc_metadata_batch_destroy(&self->recv_trailing_metadata_);
- // For status UNIMPLEMENTED, give up and assume always healthy.
- bool retry = true;
- if (status == GRPC_STATUS_UNIMPLEMENTED) {
- static const char kErrorMessage[] =
- "health checking Watch method returned UNIMPLEMENTED; "
- "disabling health checks but assuming server is healthy";
- gpr_log(GPR_ERROR, kErrorMessage);
- if (self->health_check_client_->channelz_node_ != nullptr) {
- self->health_check_client_->channelz_node_->AddTraceEvent(
- channelz::ChannelTrace::Error,
- grpc_slice_from_static_string(kErrorMessage));
- }
- self->health_check_client_->SetHealthStatus(GRPC_CHANNEL_READY,
- kErrorMessage);
- retry = false;
- }
- MutexLock lock(&self->health_check_client_->mu_);
- self->CallEndedLocked(retry);
-}
+} // namespace
-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
- // is required.
- if (this == health_check_client_->call_state_.get()) {
- health_check_client_->call_state_.reset();
- if (retry) {
- GPR_ASSERT(!health_check_client_->shutting_down_);
- if (seen_response_.Load(MemoryOrder::ACQUIRE)) {
- // 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();
- } else {
- // If the call failed without receiving any messages, retry later.
- health_check_client_->StartRetryTimerLocked();
- }
- }
- }
- // When the last ref to the call stack goes away, the CallState object
- // will be automatically destroyed.
- call_->Unref(DEBUG_LOCATION, "call_ended");
+OrphanablePtr<SubchannelStreamClient> MakeHealthCheckClient(
+ std::string service_name,
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel,
+ grpc_pollset_set* interested_parties,
+ RefCountedPtr<channelz::SubchannelNode> channelz_node,
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher) {
+ return MakeOrphanable<SubchannelStreamClient>(
+ std::move(connected_subchannel), interested_parties,
+ absl::make_unique<HealthStreamEventHandler>(std::move(service_name),
+ std::move(channelz_node),
+ std::move(watcher)),
+ GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)
+ ? "HealthCheckClient"
+ : nullptr);
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/health/health_check_client.h b/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
index d1f063b5..ac4e920f 100644
--- a/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
+++ b/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
@@ -1,176 +1,41 @@
-/*
- *
- * 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.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
-#include <grpc/support/sync.h>
+#include <string>
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
-#include "src/core/lib/backoff/backoff.h"
-#include "src/core/lib/gprpp/arena.h"
-#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/ext/filters/client_channel/subchannel_stream_client.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/call_combiner.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/polling_entity.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/transport/byte_stream.h"
-#include "src/core/lib/transport/metadata_batch.h"
-#include "src/core/lib/transport/transport.h"
namespace grpc_core {
-class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
- public:
- HealthCheckClient(std::string service_name,
- RefCountedPtr<ConnectedSubchannel> connected_subchannel,
- grpc_pollset_set* interested_parties,
- RefCountedPtr<channelz::SubchannelNode> channelz_node,
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
-
- ~HealthCheckClient() override;
-
- void Orphan() override;
-
- private:
- // Contains a call to the backend and all the data related to the call.
- class CallState : public Orphanable {
- public:
- CallState(RefCountedPtr<HealthCheckClient> health_check_client,
- grpc_pollset_set* interested_parties_);
- ~CallState() override;
-
- void Orphan() override;
-
- void StartCall() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&HealthCheckClient::mu_);
-
- private:
- void Cancel();
-
- void StartBatch(grpc_transport_stream_op_batch* batch);
- static void StartBatchInCallCombiner(void* arg, grpc_error_handle error);
-
- void CallEndedLocked(bool retry)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(health_check_client_->mu_);
-
- static void OnComplete(void* arg, grpc_error_handle error);
- static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
- static void RecvMessageReady(void* arg, grpc_error_handle error);
- static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
- static void StartCancel(void* arg, grpc_error_handle error);
- static void OnCancelComplete(void* arg, grpc_error_handle error);
-
- static void OnByteStreamNext(void* arg, grpc_error_handle error);
- void ContinueReadingRecvMessage();
- grpc_error_handle PullSliceFromRecvMessage();
- void DoneReadingRecvMessage(grpc_error_handle error);
-
- static void AfterCallStackDestruction(void* arg, grpc_error_handle error);
-
- RefCountedPtr<HealthCheckClient> health_check_client_;
- grpc_polling_entity pollent_;
-
- Arena* arena_;
- grpc_core::CallCombiner call_combiner_;
- grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
-
- // The streaming call to the backend. Always non-null.
- // Refs are tracked manually; when the last ref is released, the
- // CallState object will be automatically destroyed.
- SubchannelCall* call_;
-
- grpc_transport_stream_op_batch_payload payload_;
- grpc_transport_stream_op_batch batch_;
- grpc_transport_stream_op_batch recv_message_batch_;
- grpc_transport_stream_op_batch recv_trailing_metadata_batch_;
-
- grpc_closure on_complete_;
-
- // send_initial_metadata
- grpc_metadata_batch send_initial_metadata_;
- grpc_linked_mdelem path_metadata_storage_;
-
- // send_message
- ManualConstructor<SliceBufferByteStream> send_message_;
-
- // send_trailing_metadata
- grpc_metadata_batch send_trailing_metadata_;
-
- // recv_initial_metadata
- grpc_metadata_batch recv_initial_metadata_;
- grpc_closure recv_initial_metadata_ready_;
-
- // recv_message
- OrphanablePtr<ByteStream> recv_message_;
- grpc_closure recv_message_ready_;
- grpc_slice_buffer recv_message_buffer_;
- Atomic<bool> seen_response_{false};
-
- // recv_trailing_metadata
- grpc_metadata_batch recv_trailing_metadata_;
- grpc_transport_stream_stats collect_stats_;
- grpc_closure recv_trailing_metadata_ready_;
-
- // True if the cancel_stream batch has been started.
- Atomic<bool> cancelled_{false};
-
- // Closure for call stack destruction.
- grpc_closure after_call_stack_destruction_;
- };
-
- void StartCall();
- void StartCallLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
-
- void StartRetryTimerLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- static void OnRetryTimer(void* arg, grpc_error_handle error);
-
- void SetHealthStatus(grpc_connectivity_state state, const char* reason);
- void SetHealthStatusLocked(grpc_connectivity_state state, const char* reason)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
-
- std::string service_name_;
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
- grpc_pollset_set* interested_parties_; // Do not own.
- RefCountedPtr<channelz::SubchannelNode> channelz_node_;
-
- Mutex mu_;
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher_
- ABSL_GUARDED_BY(mu_);
- bool shutting_down_ ABSL_GUARDED_BY(mu_) = false;
-
- // The data associated with the current health check call. It holds a ref
- // to this HealthCheckClient object.
- OrphanablePtr<CallState> call_state_ ABSL_GUARDED_BY(mu_);
-
- // Call retry state.
- BackOff retry_backoff_ ABSL_GUARDED_BY(mu_);
- grpc_timer retry_timer_ ABSL_GUARDED_BY(mu_);
- grpc_closure retry_timer_callback_ ABSL_GUARDED_BY(mu_);
- bool retry_timer_callback_pending_ ABSL_GUARDED_BY(mu_) = false;
-};
+OrphanablePtr<SubchannelStreamClient> MakeHealthCheckClient(
+ std::string service_name,
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel,
+ grpc_pollset_set* interested_parties,
+ RefCountedPtr<channelz::SubchannelNode> channelz_node,
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher);
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HEALTH_HEALTH_CHECK_CLIENT_H
diff --git a/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index 3dff8249..909f3baa 100644
--- a/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
+++ b/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
@@ -30,13 +30,15 @@
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
#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/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/http/format_request.h"
#include "src/core/lib/http/parser.h"
+#include "src/core/lib/resolver/resolver_registry.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -137,12 +139,11 @@ void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error_handle error) {
void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg,
grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_INIT(&handshaker->request_done_closure_,
- &HttpConnectHandshaker::OnWriteDone, handshaker,
- grpc_schedule_on_exec_ctx),
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&handshaker->request_done_closure_,
+ &HttpConnectHandshaker::OnWriteDone,
+ handshaker, grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_REF(error));
}
// Callback invoked when finished writing HTTP CONNECT request.
@@ -172,12 +173,11 @@ void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error_handle error) {
void HttpConnectHandshaker::OnReadDoneScheduler(void* arg,
grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_INIT(&handshaker->response_read_closure_,
- &HttpConnectHandshaker::OnReadDone, handshaker,
- grpc_schedule_on_exec_ctx),
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&handshaker->response_read_closure_,
+ &HttpConnectHandshaker::OnReadDone, handshaker,
+ grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_REF(error));
}
// Callback invoked for reading HTTP CONNECT response.
@@ -246,10 +246,9 @@ void HttpConnectHandshaker::OnReadDone(void* arg, grpc_error_handle 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(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("HTTP proxy returned response code ",
- handshaker->http_response_.status)
- .c_str());
+ handshaker->http_response_.status));
handshaker->HandshakeFailedLocked(error);
goto done;
}
@@ -332,18 +331,15 @@ void HttpConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
gpr_log(GPR_INFO, "Connecting to server %s via HTTP proxy %s", server_name,
proxy_name.c_str());
// Construct HTTP CONNECT request.
- grpc_httpcli_request request;
- request.host = server_name;
- request.ssl_host_override = nullptr;
- request.http.method = const_cast<char*>("CONNECT");
- request.http.path = server_name;
- request.http.version = GRPC_HTTP_HTTP10; // Set by OnReadDone
- request.http.hdrs = headers;
- request.http.hdr_count = num_headers;
- request.http.body_length = 0;
- request.http.body = nullptr;
- request.handshaker = &grpc_httpcli_plaintext;
- grpc_slice request_slice = grpc_httpcli_format_connect_request(&request);
+ grpc_http_request request;
+ request.method = const_cast<char*>("CONNECT");
+ request.version = GRPC_HTTP_HTTP10; // Set by OnReadDone
+ request.hdrs = headers;
+ request.hdr_count = num_headers;
+ request.body_length = 0;
+ request.body = nullptr;
+ grpc_slice request_slice =
+ grpc_httpcli_format_connect_request(&request, server_name, server_name);
grpc_slice_buffer_add(&write_buffer_, request_slice);
// Clean up.
gpr_free(headers);
@@ -382,10 +378,10 @@ class HttpConnectHandshakerFactory : public HandshakerFactory {
} // namespace
-} // namespace grpc_core
-
-void grpc_http_connect_register_handshaker_factory() {
- grpc_core::HandshakerRegistry::RegisterHandshakerFactory(
- true /* at_start */, grpc_core::HANDSHAKER_CLIENT,
- absl::make_unique<grpc_core::HttpConnectHandshakerFactory>());
+void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) {
+ builder->handshaker_registry()->RegisterHandshakerFactory(
+ true /* at_start */, HANDSHAKER_CLIENT,
+ absl::make_unique<HttpConnectHandshakerFactory>());
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h b/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
index 26c31f2a..d23ce910 100644
--- a/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
+++ b/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/config/core_configuration.h"
+
/// Channel arg indicating the server in HTTP CONNECT request (string).
/// The presence of this arg triggers the use of HTTP CONNECT.
#define GRPC_ARG_HTTP_CONNECT_SERVER "grpc.http_connect_server"
@@ -28,7 +32,11 @@
/// separated by colons.
#define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers"
-/// Registers handshaker factory.
-void grpc_http_connect_register_handshaker_factory();
+namespace grpc_core {
+
+// Register the HTTP Connect handshaker into the configuration builder.
+void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
diff --git a/grpc/src/core/ext/filters/client_channel/http_proxy.cc b/grpc/src/core/ext/filters/client_channel/http_proxy.cc
index f061c424..72acea58 100644
--- a/grpc/src/core/ext/filters/client_channel/http_proxy.cc
+++ b/grpc/src/core/ext/filters/client_channel/http_proxy.cc
@@ -23,7 +23,9 @@
#include <stdbool.h>
#include <string.h>
+#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
+#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
#include <grpc/support/alloc.h>
@@ -36,6 +38,7 @@
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -63,24 +66,24 @@ char* GetHttpProxyServer(const grpc_channel_args* args, char** user_cred) {
* 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");
- if (uri_str == nullptr) uri_str = gpr_getenv("https_proxy");
- if (uri_str == nullptr) uri_str = gpr_getenv("http_proxy");
+ auto uri_str = UniquePtr<char>(
+ gpr_strdup(grpc_channel_args_find_string(args, GRPC_ARG_HTTP_PROXY)));
+ if (uri_str == nullptr) uri_str = UniquePtr<char>(gpr_getenv("grpc_proxy"));
+ if (uri_str == nullptr) uri_str = UniquePtr<char>(gpr_getenv("https_proxy"));
+ if (uri_str == nullptr) uri_str = UniquePtr<char>(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 = URI::Parse(uri_str);
+ if (uri_str.get()[0] == '\0') return nullptr;
+ uri = URI::Parse(uri_str.get());
if (!uri.ok() || uri->authority().empty()) {
gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var. Error: %s",
uri.status().ToString().c_str());
- goto done;
+ return nullptr;
}
if (uri->scheme() != "http") {
gpr_log(GPR_ERROR, "'%s' scheme not supported in proxy URI",
uri->scheme().c_str());
- goto done;
+ return nullptr;
}
/* Split on '@' to separate user credentials from host */
gpr_string_split(uri->authority().c_str(), "@", &authority_strs,
@@ -102,113 +105,103 @@ char* GetHttpProxyServer(const grpc_channel_args* args, char** user_cred) {
proxy_name = nullptr;
}
gpr_free(authority_strs);
-done:
- gpr_free(uri_str);
return proxy_name;
}
-class HttpProxyMapper : public ProxyMapperInterface {
- public:
- bool MapName(const char* server_uri, const grpc_channel_args* args,
- char** name_to_resolve, grpc_channel_args** new_args) override {
- if (!grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_HTTP_PROXY, true)) {
- return false;
- }
- char* user_cred = nullptr;
- *name_to_resolve = GetHttpProxyServer(args, &user_cred);
- if (*name_to_resolve == nullptr) return false;
- char* no_proxy_str = nullptr;
- absl::StatusOr<URI> uri = URI::Parse(server_uri);
- if (!uri.ok() || uri->path().empty()) {
- gpr_log(GPR_ERROR,
- "'http_proxy' environment variable set, but cannot "
- "parse server URI '%s' -- not using proxy. Error: %s",
- server_uri, uri.status().ToString().c_str());
- goto no_use_proxy;
- }
- if (uri->scheme() == "unix") {
- gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
- server_uri);
- goto no_use_proxy;
- }
- /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
- no_proxy_str = gpr_getenv("no_grpc_proxy");
- if (no_proxy_str == nullptr) no_proxy_str = gpr_getenv("no_proxy");
- if (no_proxy_str != nullptr) {
- static const char* NO_PROXY_SEPARATOR = ",";
- bool use_proxy = true;
- std::string server_host;
- std::string server_port;
- if (!SplitHostPort(absl::StripPrefix(uri->path(), "/"), &server_host,
- &server_port)) {
- gpr_log(GPR_INFO,
- "unable to split host and port, not checking no_proxy list for "
- "host '%s'",
- server_uri);
- gpr_free(no_proxy_str);
- } else {
- 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,
- &num_no_proxy_hosts);
- for (size_t i = 0; i < num_no_proxy_hosts; i++) {
- char* no_proxy_entry = no_proxy_hosts[i];
- 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) {
- gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
- server_uri);
- use_proxy = false;
- break;
- }
- }
- for (size_t i = 0; i < num_no_proxy_hosts; i++) {
- gpr_free(no_proxy_hosts[i]);
- }
- gpr_free(no_proxy_hosts);
- gpr_free(no_proxy_str);
- if (!use_proxy) goto no_use_proxy;
- }
- }
- grpc_arg args_to_add[2];
- args_to_add[0] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_HTTP_CONNECT_SERVER),
- const_cast<char*>(absl::StripPrefix(uri->path(), "/").data()));
- if (user_cred != nullptr) {
- /* 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);
- std::string header =
- 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()));
- *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);
- }
- gpr_free(user_cred);
- return true;
- no_use_proxy:
+// Adds the default port if target does not contain a port.
+std::string MaybeAddDefaultPort(absl::string_view target) {
+ absl::string_view host;
+ absl::string_view port;
+ SplitHostPort(target, &host, &port);
+ if (port.empty()) {
+ return JoinHostPort(host, kDefaultSecurePortInt);
+ }
+ return std::string(target);
+}
+
+} // namespace
+
+bool HttpProxyMapper::MapName(const char* server_uri,
+ const grpc_channel_args* args,
+ char** name_to_resolve,
+ grpc_channel_args** new_args) {
+ if (!grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_HTTP_PROXY, true)) {
+ return false;
+ }
+ char* user_cred = nullptr;
+ *name_to_resolve = GetHttpProxyServer(args, &user_cred);
+ if (*name_to_resolve == nullptr) return false;
+ std::string server_target;
+ absl::StatusOr<URI> uri = URI::Parse(server_uri);
+ auto no_use_proxy = [&]() {
gpr_free(*name_to_resolve);
*name_to_resolve = nullptr;
gpr_free(user_cred);
return false;
+ };
+ if (!uri.ok() || uri->path().empty()) {
+ gpr_log(GPR_ERROR,
+ "'http_proxy' environment variable set, but cannot "
+ "parse server URI '%s' -- not using proxy. Error: %s",
+ server_uri, uri.status().ToString().c_str());
+ return no_use_proxy();
}
-
- 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;
+ if (uri->scheme() == "unix") {
+ gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
+ server_uri);
+ return no_use_proxy();
}
-};
-
-} // namespace
+ /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */
+ auto no_proxy_str = UniquePtr<char>(gpr_getenv("no_grpc_proxy"));
+ if (no_proxy_str == nullptr) {
+ no_proxy_str = UniquePtr<char>(gpr_getenv("no_proxy"));
+ }
+ if (no_proxy_str != nullptr) {
+ bool use_proxy = true;
+ std::string server_host;
+ std::string server_port;
+ if (!SplitHostPort(absl::StripPrefix(uri->path(), "/"), &server_host,
+ &server_port)) {
+ gpr_log(GPR_INFO,
+ "unable to split host and port, not checking no_proxy list for "
+ "host '%s'",
+ server_uri);
+ } else {
+ std::vector<absl::string_view> no_proxy_hosts =
+ absl::StrSplit(no_proxy_str.get(), ',', absl::SkipEmpty());
+ for (const auto& no_proxy_entry : no_proxy_hosts) {
+ if (absl::EndsWithIgnoreCase(server_host, no_proxy_entry)) {
+ gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
+ server_uri);
+ use_proxy = false;
+ break;
+ }
+ }
+ if (!use_proxy) return no_use_proxy();
+ }
+ }
+ server_target =
+ MaybeAddDefaultPort(absl::StripPrefix(uri->path(), "/")).c_str();
+ absl::InlinedVector<grpc_arg, 2> args_to_add;
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_HTTP_CONNECT_SERVER),
+ const_cast<char*>(server_target.c_str())));
+ std::string header;
+ if (user_cred != nullptr) {
+ /* Use base64 encoding for user credentials as stated in RFC 7617 */
+ auto encoded_user_cred =
+ UniquePtr<char>(grpc_base64_encode(user_cred, strlen(user_cred), 0, 0));
+ header =
+ absl::StrCat("Proxy-Authorization:Basic ", encoded_user_cred.get());
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ 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.data(),
+ args_to_add.size());
+ gpr_free(user_cred);
+ return true;
+}
void RegisterHttpProxyMapper() {
ProxyMapperRegistry::Register(
diff --git a/grpc/src/core/ext/filters/client_channel/http_proxy.h b/grpc/src/core/ext/filters/client_channel/http_proxy.h
index cecdaf84..0d150d81 100644
--- a/grpc/src/core/ext/filters/client_channel/http_proxy.h
+++ b/grpc/src/core/ext/filters/client_channel/http_proxy.h
@@ -19,8 +19,25 @@
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/proxy_mapper.h"
+
namespace grpc_core {
+class HttpProxyMapper : public ProxyMapperInterface {
+ public:
+ bool MapName(const char* server_uri, const grpc_channel_args* args,
+ char** name_to_resolve, 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;
+ }
+};
+
void RegisterHttpProxyMapper();
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy.cc b/grpc/src/core/ext/filters/client_channel/lb_policy.cc
index b9272249..e3da7698 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy.cc
@@ -54,27 +54,27 @@ void LoadBalancingPolicy::Orphan() {
// LoadBalancingPolicy::UpdateArgs
//
-LoadBalancingPolicy::UpdateArgs::UpdateArgs(const UpdateArgs& other) {
- addresses = other.addresses;
- config = other.config;
- args = grpc_channel_args_copy(other.args);
-}
-
-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++.
- args = other.args;
+LoadBalancingPolicy::UpdateArgs::UpdateArgs(const UpdateArgs& other)
+ : addresses(other.addresses),
+ config(other.config),
+ resolution_note(other.resolution_note),
+ args(grpc_channel_args_copy(other.args)) {}
+
+LoadBalancingPolicy::UpdateArgs::UpdateArgs(UpdateArgs&& other) noexcept
+ : addresses(std::move(other.addresses)),
+ config(std::move(other.config)),
+ resolution_note(std::move(other.resolution_note)),
+ // TODO(roth): Use std::move() once channel args is converted to C++.
+ args(other.args) {
other.args = nullptr;
}
LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
const UpdateArgs& other) {
- if (&other == this) {
- return *this;
- }
+ if (&other == this) return *this;
addresses = other.addresses;
config = other.config;
+ resolution_note = other.resolution_note;
grpc_channel_args_destroy(args);
args = grpc_channel_args_copy(other.args);
return *this;
@@ -84,6 +84,7 @@ LoadBalancingPolicy::UpdateArgs& LoadBalancingPolicy::UpdateArgs::operator=(
UpdateArgs&& other) noexcept {
addresses = std::move(other.addresses);
config = std::move(other.config);
+ resolution_note = std::move(other.resolution_note);
// TODO(roth): Use std::move() once channel args is converted to C++.
grpc_channel_args_destroy(args);
args = other.args;
@@ -125,21 +126,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
parent, nullptr),
GRPC_ERROR_NONE);
}
- PickResult result;
- result.type = PickResult::PICK_QUEUE;
- return result;
-}
-
-//
-// LoadBalancingPolicy::TransientFailurePicker
-//
-
-LoadBalancingPolicy::PickResult
-LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) {
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error = GRPC_ERROR_REF(error_);
- return result;
+ return PickResult::Queue();
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy.h b/grpc/src/core/ext/filters/client_channel/lb_policy.h
index 1c6f3098..ac4c740b 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
@@ -25,15 +23,16 @@
#include <iterator>
#include "absl/status/status.h"
+#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
+#include "absl/types/variant.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"
#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/resolver/server_address.h"
#include "src/core/lib/transport/connectivity_state.h"
namespace grpc_core {
@@ -81,26 +80,6 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
// interested_parties() hooks from the API.
class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
public:
- // Represents backend metrics reported by the backend to the client.
- struct BackendMetricData {
- /// CPU utilization expressed as a fraction of available CPU resources.
- double cpu_utilization;
- /// Memory utilization expressed as a fraction of available memory
- /// resources.
- double mem_utilization;
- /// Total requests per second being served by the backend. This
- /// should include all services that a backend is responsible for.
- uint64_t requests_per_second;
- /// 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<absl::string_view, double> 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<absl::string_view, double> utilization;
- };
-
/// Interface for accessing per-call state.
/// Implemented by the client channel and used by the SubchannelPicker.
class CallState {
@@ -114,13 +93,6 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// for allocations that need to be made on a per-call basis.
virtual void* Alloc(size_t size) = 0;
- /// 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.
- 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
@@ -133,35 +105,16 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Implemented by the client channel and used by the SubchannelPicker.
class MetadataInterface {
public:
- class iterator
- : public std::iterator<
- std::input_iterator_tag,
- std::pair<absl::string_view, absl::string_view>, // value_type
- std::ptrdiff_t, // difference_type
- std::pair<absl::string_view, absl::string_view>*, // pointer
- std::pair<absl::string_view, absl::string_view>& // reference
- > {
- public:
- iterator(const MetadataInterface* md, intptr_t handle)
- : md_(md), handle_(handle) {}
- iterator& operator++() {
- handle_ = md_->IteratorHandleNext(handle_);
- return *this;
- }
- bool operator==(iterator other) const {
- return md_ == other.md_ && handle_ == other.handle_;
- }
- bool operator!=(iterator other) const { return !(*this == other); }
- value_type operator*() const { return md_->IteratorHandleGet(handle_); }
-
- private:
- friend class MetadataInterface;
- const MetadataInterface* md_;
- intptr_t handle_;
- };
-
virtual ~MetadataInterface() = default;
+ //////////////////////////////////////////////////////////////////////////
+ // TODO(ctiller): DO NOT MAKE THIS A PUBLIC API YET
+ // This needs some API design to ensure we can add/remove/replace metadata
+ // keys... we're deliberately not doing so to save some time whilst
+ // cleaning up the internal metadata representation, but we should add
+ // something back before making this a public API.
+ //////////////////////////////////////////////////////////////////////////
+
/// Adds a key/value pair.
/// Does NOT take ownership of \a key or \a value.
/// Implementations must ensure that the key and value remain alive
@@ -169,23 +122,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// CallState::Alloc().
virtual void Add(absl::string_view key, absl::string_view value) = 0;
- /// Iteration interface.
- virtual iterator begin() const = 0;
- virtual iterator end() const = 0;
+ /// Produce a vector of metadata key/value strings for tests.
+ virtual std::vector<std::pair<std::string, std::string>>
+ TestOnlyCopyToVector() = 0;
- /// Removes the element pointed to by \a it.
- /// Returns an iterator pointing to the next element.
- virtual iterator erase(iterator it) = 0;
-
- protected:
- intptr_t GetIteratorHandle(const iterator& it) const { return it.handle_; }
-
- private:
- friend class iterator;
-
- virtual intptr_t IteratorHandleNext(intptr_t handle) const = 0;
- virtual std::pair<absl::string_view /*key*/, absl::string_view /*value */>
- IteratorHandleGet(intptr_t handle) const = 0;
+ virtual absl::optional<absl::string_view> Lookup(
+ absl::string_view key, std::string* buffer) const = 0;
};
/// Arguments used when picking a subchannel for a call.
@@ -202,49 +144,116 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
CallState* call_state;
};
+ /// Interface for accessing backend metric data.
+ /// Implemented by the client channel and used by
+ /// SubchannelCallTrackerInterface.
+ class BackendMetricAccessor {
+ public:
+ // Represents backend metrics reported by the backend to the client.
+ struct BackendMetricData {
+ /// CPU utilization expressed as a fraction of available CPU resources.
+ double cpu_utilization;
+ /// Memory utilization expressed as a fraction of available memory
+ /// resources.
+ double mem_utilization;
+ /// Total requests per second being served by the backend. This
+ /// should include all services that a backend is responsible for.
+ uint64_t requests_per_second;
+ /// 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<absl::string_view, double> 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<absl::string_view, double> utilization;
+ };
+
+ virtual ~BackendMetricAccessor() = default;
+
+ /// Returns the backend metric data returned by the server for the call,
+ /// or null if no backend metric data was returned.
+ virtual const BackendMetricData* GetBackendMetricData() = 0;
+ };
+
+ /// Interface for tracking subchannel calls.
+ /// Implemented by LB policy and used by the channel.
+ class SubchannelCallTrackerInterface {
+ public:
+ virtual ~SubchannelCallTrackerInterface() = default;
+
+ /// Called when a subchannel call is started after an LB pick.
+ virtual void Start() = 0;
+
+ /// Called when a subchannel call is completed.
+ /// The metadata may be modified by the implementation. However, the
+ /// implementation does not take ownership, so any data that needs to be
+ /// used after returning must be copied.
+ struct FinishArgs {
+ absl::Status status;
+ MetadataInterface* trailing_metadata;
+ BackendMetricAccessor* backend_metric_accessor;
+ };
+ virtual void Finish(FinishArgs args) = 0;
+ };
+
/// The result of picking a subchannel for a call.
struct PickResult {
- enum ResultType {
- /// Pick complete. If \a subchannel is non-null, the client channel
- /// will immediately proceed with the call on that subchannel;
- /// otherwise, it will drop the call.
- PICK_COMPLETE,
- /// Pick cannot be completed until something changes on the control
- /// plane. The client channel will queue the pick and try again the
- /// next time the picker is updated.
- PICK_QUEUE,
- /// Pick failed. If the call is wait_for_ready, the client channel
- /// will wait for the next picker and try again; otherwise, it
- /// will immediately fail the call with the status indicated via
- /// \a error (although the call may be retried if the client channel
- /// is configured to do so).
- PICK_FAILED,
+ /// A successful pick.
+ struct Complete {
+ /// The subchannel to be used for the call. Must be non-null.
+ RefCountedPtr<SubchannelInterface> subchannel;
+
+ /// Optionally set by the LB policy when it wishes to be notified
+ /// about the resulting subchannel call.
+ /// Note that if the pick is abandoned by the channel, this may never
+ /// be used.
+ std::unique_ptr<SubchannelCallTrackerInterface> subchannel_call_tracker;
+
+ explicit Complete(
+ RefCountedPtr<SubchannelInterface> sc,
+ std::unique_ptr<SubchannelCallTrackerInterface> tracker = nullptr)
+ : subchannel(std::move(sc)),
+ subchannel_call_tracker(std::move(tracker)) {}
+ };
+
+ /// Pick cannot be completed until something changes on the control
+ /// plane. The client channel will queue the pick and try again the
+ /// next time the picker is updated.
+ struct Queue {};
+
+ /// Pick failed. If the call is wait_for_ready, the client channel
+ /// will wait for the next picker and try again; otherwise, it
+ /// will immediately fail the call with the status indicated (although
+ /// the call may be retried if the client channel is configured to do so).
+ struct Fail {
+ absl::Status status;
+
+ explicit Fail(absl::Status s) : status(s) {}
};
- ResultType type;
-
- /// Used only if type is PICK_COMPLETE. Will be set to the selected
- /// subchannel, or nullptr if the LB policy decides to drop the call.
- RefCountedPtr<SubchannelInterface> subchannel;
-
- /// Used only if type is PICK_FAILED.
- /// Error to be set when returning a failure.
- // TODO(roth): Replace this with something similar to grpc::Status,
- // so that we don't expose grpc_error to this API.
- grpc_error_handle error = GRPC_ERROR_NONE;
-
- /// Used only if type is PICK_COMPLETE.
- /// Callback set by LB policy to be notified of trailing metadata.
- /// If set by LB policy, the client channel will invoke the callback
- /// when trailing metadata is returned.
- /// The metadata may be modified by the callback. However, the callback
- /// 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.
- std::function<void(grpc_error_handle, MetadataInterface*, CallState*)>
- recv_trailing_metadata_ready;
+
+ /// Pick will be dropped with the status specified.
+ /// Unlike FailPick, the call will be dropped even if it is
+ /// wait_for_ready, and retries (if configured) will be inhibited.
+ struct Drop {
+ absl::Status status;
+
+ explicit Drop(absl::Status s) : status(s) {}
+ };
+
+ // A pick result must be one of these types.
+ // Default to Queue, just to allow default construction.
+ absl::variant<Complete, Queue, Fail, Drop> result = Queue();
+
+ PickResult() = default;
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Complete complete) : result(std::move(complete)) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Queue queue) : result(queue) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Fail fail) : result(std::move(fail)) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Drop drop) : result(std::move(drop)) {}
};
/// A subchannel picker is the object used to pick the subchannel to
@@ -271,6 +280,11 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// A proxy object implemented by the client channel and used by the
/// LB policy to communicate with the channel.
+ // TODO(roth): Once insecure builds go away, add methods for accessing
+ // channel creds. By default, that should strip off the call creds
+ // attached to the channel creds, but there should also be a "use at
+ // your own risk" option to get the channel creds without stripping
+ // off the attached call creds.
class ChannelControlHelper {
public:
ChannelControlHelper() = default;
@@ -289,6 +303,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Requests that the resolver re-resolve.
virtual void RequestReresolution() = 0;
+ /// Returns the channel authority.
+ virtual absl::string_view GetAuthority() = 0;
+
/// Adds a trace message associated with the channel.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
virtual void AddTraceEvent(TraceSeverity severity,
@@ -309,8 +326,20 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Data passed to the UpdateLocked() method when new addresses and
/// config are available.
struct UpdateArgs {
- ServerAddressList addresses;
+ /// A list of addresses, or an error indicating a failure to obtain the
+ /// list of addresses.
+ absl::StatusOr<ServerAddressList> addresses;
+ /// The LB policy config.
RefCountedPtr<Config> config;
+ /// A human-readable note providing context about the name resolution that
+ /// provided this update. LB policies may wish to include this message
+ /// in RPC failure status messages. For example, if the update has an
+ /// empty list of addresses, this message might say "no DNS entries
+ /// found for <name>".
+ std::string resolution_note;
+
+ // TODO(roth): Before making this a public API, find a better
+ // abstraction for representing channel args.
const grpc_channel_args* args = nullptr;
// TODO(roth): Remove everything below once channel args is
@@ -352,6 +381,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Updates the policy with new data from the resolver. Will be invoked
/// immediately after LB policy is constructed, and then again whenever
/// the resolver returns a new result.
+ // TODO(roth): Change this to return some indication as to whether the
+ // update has been accepted, so that we can indicate to the resolver
+ // whether it should go into backoff to retry the resolution.
virtual void UpdateLocked(UpdateArgs) = 0; // NOLINT
/// Tries to enter a READY connectivity state.
@@ -367,7 +399,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
// Note: This must be invoked while holding the work_serializer.
void Orphan() override;
- // A picker that returns PICK_QUEUE for all picks.
+ // A picker that returns PickResult::Queue for all picks.
// Also calls the parent LB policy's ExitIdleLocked() method when the
// first pick is seen.
class QueuePicker : public SubchannelPicker {
@@ -384,16 +416,17 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
bool exit_idle_called_ = false;
};
- // A picker that returns PICK_TRANSIENT_FAILURE for all picks.
+ // A picker that returns PickResult::Fail for all picks.
class TransientFailurePicker : public SubchannelPicker {
public:
- explicit TransientFailurePicker(grpc_error_handle error) : error_(error) {}
- ~TransientFailurePicker() override { GRPC_ERROR_UNREF(error_); }
+ explicit TransientFailurePicker(absl::Status status) : status_(status) {}
- PickResult Pick(PickArgs args) override;
+ PickResult Pick(PickArgs /*args*/) override {
+ return PickResult::Fail(status_);
+ }
private:
- grpc_error_handle error_;
+ absl::Status status_;
};
protected:
@@ -421,4 +454,4 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
index c6078e0d..45c3ad00 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc
@@ -69,10 +69,11 @@ MakeHierarchicalPathAttribute(std::vector<std::string> path) {
return absl::make_unique<HierarchicalPathAttribute>(std::move(path));
}
-HierarchicalAddressMap MakeHierarchicalAddressMap(
- const ServerAddressList& addresses) {
+absl::StatusOr<HierarchicalAddressMap> MakeHierarchicalAddressMap(
+ const absl::StatusOr<ServerAddressList>& addresses) {
+ if (!addresses.ok()) return addresses.status();
HierarchicalAddressMap result;
- for (const ServerAddress& address : addresses) {
+ for (const ServerAddress& address : *addresses) {
const HierarchicalPathAttribute* path_attribute =
static_cast<const HierarchicalPathAttribute*>(
address.GetAttribute(kHierarchicalPathAttributeKey));
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h b/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
index c276c8e2..1e384d9b 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/address_filtering.h
@@ -23,7 +23,9 @@
#include <string>
#include <vector>
-#include "src/core/ext/filters/client_channel/server_address.h"
+#include "absl/status/statusor.h"
+
+#include "src/core/lib/resolver/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
@@ -92,10 +94,9 @@ MakeHierarchicalPathAttribute(std::vector<std::string> path);
using HierarchicalAddressMap = std::map<std::string, ServerAddressList>;
// Splits up the addresses into a separate list for each child.
-HierarchicalAddressMap MakeHierarchicalAddressMap(
- const ServerAddressList& addresses);
+absl::StatusOr<HierarchicalAddressMap> MakeHierarchicalAddressMap(
+ const absl::StatusOr<ServerAddressList>& addresses);
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H \
- */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_ADDRESS_FILTERING_H
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
index 0edf61db..1d0b1ef2 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
@@ -16,10 +16,10 @@
#include <grpc/support/port_platform.h>
-#include <cstring>
-
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include <cstring>
+
#include "absl/strings/str_cat.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
@@ -90,6 +90,10 @@ class ChildPolicyHandler::Helper
parent_->channel_control_helper()->RequestReresolution();
}
+ absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override {
if (parent_->shutting_down_) return;
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
index 5f7d75c0..3be5a7f2 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
@@ -101,20 +101,11 @@ static void clr_start_transport_stream_op_batch(
// Handle send_initial_metadata.
if (batch->send_initial_metadata) {
// Grab client stats object from metadata.
- grpc_linked_mdelem* client_stats_md =
- batch->payload->send_initial_metadata.send_initial_metadata->list.head;
- for (; client_stats_md != nullptr;
- client_stats_md = client_stats_md->next) {
- if (GRPC_SLICE_START_PTR(GRPC_MDKEY(client_stats_md->md)) ==
- static_cast<const void*>(grpc_core::kGrpcLbClientStatsMetadataKey)) {
- break;
- }
- }
- if (client_stats_md != nullptr) {
- grpc_core::GrpcLbClientStats* client_stats =
- const_cast<grpc_core::GrpcLbClientStats*>(
- reinterpret_cast<const grpc_core::GrpcLbClientStats*>(
- GRPC_SLICE_START_PTR(GRPC_MDVALUE(client_stats_md->md))));
+ auto client_stats_md =
+ batch->payload->send_initial_metadata.send_initial_metadata->Take(
+ grpc_core::GrpcLbClientStatsMetadata());
+ if (client_stats_md.has_value()) {
+ grpc_core::GrpcLbClientStats* client_stats = *client_stats_md;
if (client_stats != nullptr) {
calld->client_stats.reset(client_stats);
// Intercept completion.
@@ -123,10 +114,6 @@ static void clr_start_transport_stream_op_batch(
calld, grpc_schedule_on_exec_ctx);
batch->on_complete = &calld->on_complete_for_send;
}
- // Remove metadata so it doesn't go out on the wire.
- grpc_metadata_batch_remove(
- batch->payload->send_initial_metadata.send_initial_metadata,
- client_stats_md);
}
}
// Intercept completion of recv_initial_metadata.
@@ -145,6 +132,7 @@ static void clr_start_transport_stream_op_batch(
const grpc_channel_filter grpc_client_load_reporting_filter = {
clr_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(call_data),
clr_init_call_elem,
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 4b4f1ab6..55ee8ebb 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -1,20 +1,18 @@
-/*
- *
- * 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.
+//
/// Implementation of the gRPC LB policy.
///
@@ -51,14 +49,9 @@
/// \see https://github.com/grpc/grpc/blob/master/doc/load-balancing.md for the
/// high level design and details.
-// With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-// using that endpoint. Because of various transitive includes in uv.h,
-// including windows.h on Windows, uv.h must be included before other system
-// headers. Therefore, sockaddr.h must always be included first.
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
#include <inttypes.h>
#include <limits.h>
@@ -69,11 +62,11 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/strings/strip.h"
-
#include "upb/upb.hpp"
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
@@ -81,50 +74,45 @@
#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/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_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"
#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/fake/fake_resolver.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.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/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.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/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resolver/server_address.h"
+#include "src/core/lib/security/credentials/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_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER 1.6
#define GRPC_GRPCLB_RECONNECT_MAX_BACKOFF_SECONDS 120
#define GRPC_GRPCLB_RECONNECT_JITTER 0.2
#define GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS 10000
-
-#define GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN "grpc.grpclb_address_lb_token"
-#define GRPC_ARG_GRPCLB_ADDRESS_CLIENT_STATS "grpc.grpclb_address_client_stats"
+#define GRPC_GRPCLB_DEFAULT_SUBCHANNEL_DELETION_DELAY_MS 10000
namespace grpc_core {
TraceFlag grpc_lb_glb_trace(false, "glb");
-const char kGrpcLbClientStatsMetadataKey[] = "grpclb_client_stats";
-const char kGrpcLbLbTokenMetadataKey[] = "lb-token";
-
const char kGrpcLbAddressAttributeKey[] = "grpclb";
namespace {
@@ -226,7 +214,7 @@ class GrpcLb : public LoadBalancingPolicy {
// The stats for client-side load reporting associated with this LB call.
// Created after the first serverlist is received.
RefCountedPtr<GrpcLbClientStats> client_stats_;
- grpc_millis client_stats_report_interval_ = 0;
+ Duration client_stats_report_interval_;
grpc_timer client_load_report_timer_;
bool client_load_report_timer_callback_pending_ = false;
bool last_client_load_report_counters_were_zero_ = false;
@@ -239,16 +227,24 @@ class GrpcLb : public LoadBalancingPolicy {
class SubchannelWrapper : public DelegatingSubchannel {
public:
SubchannelWrapper(RefCountedPtr<SubchannelInterface> subchannel,
- std::string lb_token,
+ RefCountedPtr<GrpcLb> lb_policy, std::string lb_token,
RefCountedPtr<GrpcLbClientStats> client_stats)
: DelegatingSubchannel(std::move(subchannel)),
+ lb_policy_(std::move(lb_policy)),
lb_token_(std::move(lb_token)),
client_stats_(std::move(client_stats)) {}
+ ~SubchannelWrapper() override {
+ if (!lb_policy_->shutting_down_) {
+ lb_policy_->CacheDeletedSubchannelLocked(wrapped_subchannel());
+ }
+ }
+
const std::string& lb_token() const { return lb_token_; }
GrpcLbClientStats* client_stats() const { return client_stats_.get(); }
private:
+ RefCountedPtr<GrpcLb> lb_policy_;
std::string lb_token_;
RefCountedPtr<GrpcLbClientStats> client_stats_;
};
@@ -271,7 +267,7 @@ class GrpcLb : public LoadBalancingPolicy {
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());
+ return QsortCompare(client_stats_.get(), other->client_stats_.get());
}
std::string ToString() const override {
@@ -357,6 +353,7 @@ class GrpcLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -401,10 +398,7 @@ class GrpcLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
// Helper functions used in UpdateLocked().
- void ProcessAddressesAndChannelArgsLocked(const ServerAddressList& addresses,
- const grpc_channel_args& args);
- static ServerAddressList AddNullLbTokenToAddresses(
- const ServerAddressList& addresses);
+ void UpdateBalancerChannelLocked(const grpc_channel_args& args);
void CancelBalancerChannelConnectivityWatchLocked();
@@ -426,6 +420,13 @@ class GrpcLb : public LoadBalancingPolicy {
const grpc_channel_args* args);
void CreateOrUpdateChildPolicyLocked();
+ // Subchannel caching.
+ void CacheDeletedSubchannelLocked(
+ RefCountedPtr<SubchannelInterface> subchannel);
+ void StartSubchannelCacheTimerLocked();
+ static void OnSubchannelCacheTimer(void* arg, grpc_error_handle error);
+ void OnSubchannelCacheTimerLocked(grpc_error_handle error);
+
// Who the client is trying to communicate with.
std::string server_name_;
// Configurations for the policy.
@@ -451,8 +452,8 @@ class GrpcLb : public LoadBalancingPolicy {
// is shutting down, or the LB call has ended). A non-NULL lb_calld_ always
// contains a non-NULL lb_call_.
OrphanablePtr<BalancerCallState> lb_calld_;
- // Timeout in milliseconds for the LB call. 0 means no deadline.
- int lb_call_timeout_ms_ = 0;
+ // Timeout for the LB call. 0 means no deadline.
+ const Duration lb_call_timeout_;
// Balancer call retry state.
BackOff lb_call_backoff_;
bool retry_timer_callback_pending_ = false;
@@ -466,11 +467,14 @@ class GrpcLb : public LoadBalancingPolicy {
// Whether we're in fallback mode.
bool fallback_mode_ = false;
// The backend addresses from the resolver.
- ServerAddressList fallback_backend_addresses_;
+ absl::StatusOr<ServerAddressList> fallback_backend_addresses_;
+ // The last resolution note from our parent.
+ // To be passed to child policy when fallback_backend_addresses_ is empty.
+ std::string resolution_note_;
// State for fallback-at-startup checks.
// Timeout after startup after which we will go into fallback mode if
// we have not received a serverlist from the balancer.
- int fallback_at_startup_timeout_ = 0;
+ const Duration fallback_at_startup_timeout_;
bool fallback_at_startup_checks_pending_ = false;
grpc_timer lb_fallback_timer_;
grpc_closure lb_on_fallback_;
@@ -479,6 +483,15 @@ class GrpcLb : public LoadBalancingPolicy {
OrphanablePtr<LoadBalancingPolicy> child_policy_;
// Child policy in state READY.
bool child_policy_ready_ = false;
+
+ // Deleted subchannel caching.
+ const Duration subchannel_cache_interval_;
+ std::map<Timestamp /*deletion time*/,
+ std::vector<RefCountedPtr<SubchannelInterface>>>
+ cached_subchannels_;
+ grpc_timer subchannel_cache_timer_;
+ grpc_closure on_subchannel_cache_timer_;
+ bool subchannel_cache_timer_pending_ = false;
};
//
@@ -606,7 +619,6 @@ const char* GrpcLb::Serverlist::ShouldDrop() {
//
GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
- PickResult result;
// Check if we should drop the call.
const char* drop_token =
serverlist_ == nullptr ? nullptr : serverlist_->ShouldDrop();
@@ -619,16 +631,16 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
if (client_stats_ != nullptr) {
client_stats_->AddCallDropped(drop_token);
}
- result.type = PickResult::PICK_COMPLETE;
- return result;
+ return PickResult::Drop(
+ absl::UnavailableError("drop directed by grpclb balancer"));
}
// Forward pick to child policy.
- result = child_picker_->Pick(args);
+ PickResult result = child_picker_->Pick(args);
// If pick succeeded, add LB token to initial metadata.
- if (result.type == PickResult::PICK_COMPLETE &&
- result.subchannel != nullptr) {
+ auto* complete_pick = absl::get_if<PickResult::Complete>(&result.result);
+ if (complete_pick != nullptr) {
const SubchannelWrapper* subchannel_wrapper =
- static_cast<SubchannelWrapper*>(result.subchannel.get());
+ static_cast<SubchannelWrapper*>(complete_pick->subchannel.get());
// Encode client stats object into metadata for use by
// client_load_reporting filter.
GrpcLbClientStats* client_stats = subchannel_wrapper->client_stats();
@@ -638,7 +650,7 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
// a string and rely on the client_load_reporting filter to know
// how to interpret it.
args.initial_metadata->Add(
- kGrpcLbClientStatsMetadataKey,
+ GrpcLbClientStatsMetadata::key(),
absl::string_view(reinterpret_cast<const char*>(client_stats), 0));
// Update calls-started.
client_stats->AddCallStarted();
@@ -651,10 +663,10 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
char* lb_token = static_cast<char*>(
args.call_state->Alloc(subchannel_wrapper->lb_token().size() + 1));
strcpy(lb_token, subchannel_wrapper->lb_token().c_str());
- args.initial_metadata->Add(kGrpcLbLbTokenMetadataKey, lb_token);
+ args.initial_metadata->Add(LbTokenMetadata::key(), lb_token);
}
// Unwrap subchannel to pass up to the channel.
- result.subchannel = subchannel_wrapper->wrapped_subchannel();
+ complete_pick->subchannel = subchannel_wrapper->wrapped_subchannel();
}
return result;
}
@@ -680,7 +692,8 @@ RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
return MakeRefCounted<SubchannelWrapper>(
parent_->channel_control_helper()->CreateSubchannel(std::move(address),
args),
- std::move(lb_token), std::move(client_stats));
+ parent_->Ref(DEBUG_LOCATION, "SubchannelWrapper"), std::move(lb_token),
+ std::move(client_stats));
}
void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
@@ -736,6 +749,10 @@ void GrpcLb::Helper::RequestReresolution() {
}
}
+absl::string_view GrpcLb::Helper::GetAuthority() {
+ return parent_->channel_control_helper()->GetAuthority();
+}
+
void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) {
if (parent_->shutting_down_) return;
@@ -767,14 +784,14 @@ GrpcLb::BalancerCallState::BalancerCallState(
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
- : ExecCtx::Get()->Now() + grpclb_policy()->lb_call_timeout_ms_;
+ const Timestamp deadline =
+ grpclb_policy()->lb_call_timeout_ == Duration::Zero()
+ ? Timestamp::InfFuture()
+ : ExecCtx::Get()->Now() + grpclb_policy()->lb_call_timeout_;
lb_call_ = grpc_channel_create_pollset_set_call(
grpclb_policy()->lb_channel_, nullptr, GRPC_PROPAGATE_DEFAULTS,
grpclb_policy_->interested_parties(),
- GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD,
+ Slice::FromStaticString("/grpc.lb.v1.LoadBalancer/BalanceLoad").c_slice(),
nullptr, deadline, nullptr);
// Init the LB call request payload.
upb::Arena arena;
@@ -897,7 +914,7 @@ void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
// in a loop while draining the currently-held WorkSerializer.
// Also see https://github.com/grpc/grpc/issues/26079.
ExecCtx::Get()->InvalidateNow();
- const grpc_millis next_client_load_report_time =
+ const Timestamp next_client_load_report_time =
ExecCtx::Get()->Now() + client_stats_report_interval_;
GRPC_CLOSURE_INIT(&client_load_report_closure_, MaybeSendClientLoadReport,
this, grpc_schedule_on_exec_ctx);
@@ -909,7 +926,7 @@ void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
void GrpcLb::BalancerCallState::MaybeSendClientLoadReport(
void* arg, grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->MaybeSendClientLoadReportLocked(error); },
DEBUG_LOCATION);
@@ -988,7 +1005,7 @@ void GrpcLb::BalancerCallState::SendClientLoadReportLocked() {
void GrpcLb::BalancerCallState::ClientLoadReportDone(void* arg,
grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->ClientLoadReportDoneLocked(error); },
DEBUG_LOCATION);
@@ -1060,15 +1077,16 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
} 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 (response.client_stats_report_interval != Duration::Zero()) {
+ client_stats_report_interval_ = std::max(
+ Duration::Seconds(1), 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_);
+ grpclb_policy(), this,
+ client_stats_report_interval_.millis());
}
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO,
@@ -1094,7 +1112,8 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
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) {
+ if (client_stats_report_interval_ > Duration::Zero() &&
+ client_stats_ == nullptr) {
client_stats_ = MakeRefCounted<GrpcLbClientStats>();
// Ref held by callback.
Ref(DEBUG_LOCATION, "client_load_report").release();
@@ -1191,7 +1210,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
void GrpcLb::BalancerCallState::OnBalancerStatusReceived(
void* arg, grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // owned by lambda
+ (void)GRPC_ERROR_REF(error); // owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->OnBalancerStatusReceivedLocked(error); },
DEBUG_LOCATION);
@@ -1297,67 +1316,87 @@ grpc_channel_args* BuildBalancerChannelArgs(
// Don't want to pass down channelz node from parent; the balancer
// channel will get its own.
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
+ // Remove the channel args for channel credentials and replace it
+ // with a version that does not contain call credentials. The loadbalancer
+ // is not necessarily trusted to handle bearer token credentials.
+ GRPC_ARG_CHANNEL_CREDENTIALS,
};
+ // Create channel args for channel credentials that does not contain bearer
+ // token credentials.
+ grpc_channel_credentials* channel_credentials =
+ grpc_channel_credentials_find_in_args(args);
+ GPR_ASSERT(channel_credentials != nullptr);
+ RefCountedPtr<grpc_channel_credentials> creds_sans_call_creds =
+ channel_credentials->duplicate_without_call_credentials();
+ GPR_ASSERT(creds_sans_call_creds != nullptr);
// Channel args to add.
- absl::InlinedVector<grpc_arg, 3> args_to_add = {
+ absl::InlinedVector<grpc_arg, 4> 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),
+ 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),
+ // A channel args for new channel credentials that does not contain bearer
+ // tokens.
+ grpc_channel_credentials_to_arg(creds_sans_call_creds.get()),
};
- // Construct channel args.
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+ return 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());
- // Make any necessary modifications for security.
- return ModifyGrpclbBalancerChannelArgs(new_args);
}
//
// ctor and dtor
//
+std::string GetServerNameFromChannelArgs(const grpc_channel_args* args) {
+ const char* server_uri =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri != nullptr);
+ absl::StatusOr<URI> uri = URI::Parse(server_uri);
+ GPR_ASSERT(uri.ok() && !uri->path().empty());
+ return std::string(absl::StripPrefix(uri->path(), "/"));
+}
+
GrpcLb::GrpcLb(Args args)
: LoadBalancingPolicy(std::move(args)),
+ server_name_(GetServerNameFromChannelArgs(args.args)),
response_generator_(MakeRefCounted<FakeResolverResponseGenerator>()),
+ lb_call_timeout_(Duration::Milliseconds(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS, {0, 0, INT_MAX}))),
lb_call_backoff_(
BackOff::Options()
- .set_initial_backoff(GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS *
- 1000)
+ .set_initial_backoff(Duration::Seconds(
+ GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS))
.set_multiplier(GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER)
.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);
- // 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);
- GPR_ASSERT(server_uri != nullptr);
- absl::StatusOr<URI> uri = URI::Parse(server_uri);
- GPR_ASSERT(uri.ok() && !uri->path().empty());
- server_name_ = std::string(absl::StripPrefix(uri->path(), "/"));
+ .set_max_backoff(Duration::Seconds(
+ GRPC_GRPCLB_RECONNECT_MAX_BACKOFF_SECONDS))),
+ fallback_at_startup_timeout_(
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS,
+ {GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX}))),
+ subchannel_cache_interval_(
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS,
+ {GRPC_GRPCLB_DEFAULT_SUBCHANNEL_DELETION_DELAY_MS, 0,
+ INT_MAX}))) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO,
"[grpclb %p] Will use '%s' as the server name for LB request.",
this, server_name_.c_str());
}
- // Record LB call timeout.
- arg = grpc_channel_args_find(args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS);
- lb_call_timeout_ms_ = grpc_channel_arg_get_integer(arg, {0, 0, INT_MAX});
- // Record fallback-at-startup timeout.
- arg = grpc_channel_args_find(args.args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS);
- fallback_at_startup_timeout_ = grpc_channel_arg_get_integer(
- arg, {GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX});
+ // 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);
+ GRPC_CLOSURE_INIT(&on_subchannel_cache_timer_, &OnSubchannelCacheTimer, this,
+ nullptr);
}
GrpcLb::~GrpcLb() { grpc_channel_args_destroy(args_); }
@@ -1365,6 +1404,11 @@ GrpcLb::~GrpcLb() { grpc_channel_args_destroy(args_); }
void GrpcLb::ShutdownLocked() {
shutting_down_ = true;
lb_calld_.reset();
+ if (subchannel_cache_timer_pending_) {
+ subchannel_cache_timer_pending_ = false;
+ grpc_timer_cancel(&subchannel_cache_timer_);
+ }
+ cached_subchannels_.clear();
if (retry_timer_callback_pending_) {
grpc_timer_cancel(&lb_call_retry_timer_);
}
@@ -1411,15 +1455,27 @@ void GrpcLb::UpdateLocked(UpdateArgs args) {
const bool is_initial_update = lb_channel_ == nullptr;
config_ = args.config;
GPR_ASSERT(config_ != nullptr);
- ProcessAddressesAndChannelArgsLocked(args.addresses, *args.args);
- // Update the existing child policy.
+ // Update fallback address list.
+ fallback_backend_addresses_ = std::move(args.addresses);
+ if (fallback_backend_addresses_.ok()) {
+ // Add null LB token attributes.
+ for (ServerAddress& address : *fallback_backend_addresses_) {
+ address = address.WithAttribute(
+ kGrpcLbAddressAttributeKey,
+ absl::make_unique<TokenAndClientStatsAttribute>("", nullptr));
+ }
+ }
+ resolution_note_ = std::move(args.resolution_note);
+ // Update balancer channel.
+ UpdateBalancerChannelLocked(*args.args);
+ // Update the existing child policy, if any.
if (child_policy_ != nullptr) CreateOrUpdateChildPolicyLocked();
// If this is the initial update, start the fallback-at-startup checks
// and the balancer call.
if (is_initial_update) {
fallback_at_startup_checks_pending_ = true;
// Start timer.
- grpc_millis deadline = ExecCtx::Get()->Now() + fallback_at_startup_timeout_;
+ Timestamp deadline = ExecCtx::Get()->Now() + fallback_at_startup_timeout_;
Ref(DEBUG_LOCATION, "on_fallback_timer").release(); // Ref for callback
grpc_timer_init(&lb_fallback_timer_, deadline, &lb_on_fallback_);
// Start watching the channel's connectivity state. If the channel
@@ -1441,21 +1497,7 @@ 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,
- absl::make_unique<TokenAndClientStatsAttribute>("", nullptr)));
- }
- return addresses_out;
-}
-
-void GrpcLb::ProcessAddressesAndChannelArgsLocked(
- const ServerAddressList& addresses, const grpc_channel_args& args) {
- // Update fallback address list.
- fallback_backend_addresses_ = AddNullLbTokenToAddresses(addresses);
+void GrpcLb::UpdateBalancerChannelLocked(const grpc_channel_args& args) {
// 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};
@@ -1471,9 +1513,15 @@ void GrpcLb::ProcessAddressesAndChannelArgsLocked(
// Create balancer channel if needed.
if (lb_channel_ == nullptr) {
std::string uri_str = absl::StrCat("fake:///", server_name_);
- lb_channel_ =
- CreateGrpclbBalancerChannel(uri_str.c_str(), *lb_channel_args);
+ grpc_channel_credentials* creds =
+ grpc_channel_credentials_find_in_args(lb_channel_args);
+ GPR_ASSERT(creds != nullptr);
+ const char* arg_to_remove = GRPC_ARG_CHANNEL_CREDENTIALS;
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_remove(lb_channel_args, &arg_to_remove, 1);
+ lb_channel_ = grpc_channel_create(uri_str.c_str(), creds, new_args);
GPR_ASSERT(lb_channel_ != nullptr);
+ grpc_channel_args_destroy(new_args);
// Set up channelz linkage.
channelz::ChannelNode* child_channelz_node =
grpc_channel_get_channelz_node(lb_channel_);
@@ -1518,13 +1566,13 @@ void GrpcLb::StartBalancerCallLocked() {
}
void GrpcLb::StartBalancerCallRetryTimerLocked() {
- grpc_millis next_try = lb_call_backoff_.NextAttemptTime();
+ Timestamp next_try = lb_call_backoff_.NextAttemptTime();
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO, "[grpclb %p] Connection to LB server lost...", this);
- grpc_millis timeout = next_try - ExecCtx::Get()->Now();
- if (timeout > 0) {
+ Duration timeout = next_try - ExecCtx::Get()->Now();
+ if (timeout > Duration::Zero()) {
gpr_log(GPR_INFO, "[grpclb %p] ... retry_timer_active in %" PRId64 "ms.",
- this, timeout);
+ this, timeout.millis());
} else {
gpr_log(GPR_INFO, "[grpclb %p] ... retry_timer_active immediately.",
this);
@@ -1541,7 +1589,7 @@ void GrpcLb::StartBalancerCallRetryTimerLocked() {
void GrpcLb::OnBalancerCallRetryTimer(void* arg, grpc_error_handle error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
grpclb_policy->work_serializer()->Run(
[grpclb_policy, error]() {
grpclb_policy->OnBalancerCallRetryTimerLocked(error);
@@ -1585,7 +1633,7 @@ void GrpcLb::MaybeEnterFallbackModeAfterStartup() {
void GrpcLb::OnFallbackTimer(void* arg, grpc_error_handle error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
grpclb_policy->work_serializer()->Run(
[grpclb_policy, error]() { grpclb_policy->OnFallbackTimerLocked(error); },
DEBUG_LOCATION);
@@ -1657,9 +1705,14 @@ void GrpcLb::CreateOrUpdateChildPolicyLocked() {
// If CreateOrUpdateChildPolicyLocked() is invoked when we haven't
// received any serverlist from the balancer, we use the fallback backends
// returned by the resolver. Note that the fallback backend list may be
- // empty, in which case the new round_robin policy will keep the requested
- // picks pending.
+ // empty, in which case the new child policy will fail the picks.
update_args.addresses = fallback_backend_addresses_;
+ if (fallback_backend_addresses_.ok() &&
+ fallback_backend_addresses_->empty()) {
+ update_args.resolution_note = absl::StrCat(
+ "grpclb in fallback mode without any balancer addresses: ",
+ resolution_note_);
+ }
} else {
update_args.addresses = serverlist_->GetServerAddressList(
lb_calld_ == nullptr ? nullptr : lb_calld_->client_stats());
@@ -1682,6 +1735,56 @@ void GrpcLb::CreateOrUpdateChildPolicyLocked() {
}
//
+// subchannel caching
+//
+
+void GrpcLb::CacheDeletedSubchannelLocked(
+ RefCountedPtr<SubchannelInterface> subchannel) {
+ Timestamp deletion_time = ExecCtx::Get()->Now() + subchannel_cache_interval_;
+ cached_subchannels_[deletion_time].push_back(std::move(subchannel));
+ if (!subchannel_cache_timer_pending_) {
+ Ref(DEBUG_LOCATION, "OnSubchannelCacheTimer").release();
+ subchannel_cache_timer_pending_ = true;
+ StartSubchannelCacheTimerLocked();
+ }
+}
+
+void GrpcLb::StartSubchannelCacheTimerLocked() {
+ GPR_ASSERT(!cached_subchannels_.empty());
+ grpc_timer_init(&subchannel_cache_timer_, cached_subchannels_.begin()->first,
+ &on_subchannel_cache_timer_);
+}
+
+void GrpcLb::OnSubchannelCacheTimer(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<GrpcLb*>(arg);
+ (void)GRPC_ERROR_REF(error);
+ self->work_serializer()->Run(
+ [self, error]() { self->GrpcLb::OnSubchannelCacheTimerLocked(error); },
+ DEBUG_LOCATION);
+}
+
+void GrpcLb::OnSubchannelCacheTimerLocked(grpc_error_handle error) {
+ if (subchannel_cache_timer_pending_ && error == GRPC_ERROR_NONE) {
+ auto it = cached_subchannels_.begin();
+ if (it != cached_subchannels_.end()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] removing %" PRIuPTR " subchannels from cache",
+ this, it->second.size());
+ }
+ cached_subchannels_.erase(it);
+ }
+ if (!cached_subchannels_.empty()) {
+ StartSubchannelCacheTimerLocked();
+ return;
+ }
+ subchannel_cache_timer_pending_ = false;
+ }
+ Unref(DEBUG_LOCATION, "OnSubchannelCacheTimer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
// factory
//
@@ -1751,39 +1854,32 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
// Plugin registration
//
-namespace {
-
-// Only add client_load_reporting filter if the grpclb LB policy is used.
-bool maybe_add_client_load_reporting_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- const grpc_arg* channel_arg =
- grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME);
- if (channel_arg != nullptr && channel_arg->type == GRPC_ARG_STRING &&
- strcmp(channel_arg->value.string, "grpclb") == 0) {
- // TODO(roth): When we get around to re-attempting
- // https://github.com/grpc/grpc/pull/16214, we should try to keep
- // this filter at the very top of the subchannel stack, since that
- // will minimize the number of metadata elements that the filter
- // needs to iterate through to find the ClientStats object.
- return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr,
- nullptr);
- }
- return true;
-}
-
-} // namespace
-
void grpc_lb_policy_grpclb_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
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,
- const_cast<grpc_channel_filter*>(&grpc_client_load_reporting_filter));
}
void grpc_lb_policy_grpclb_shutdown() {}
+
+namespace grpc_core {
+void RegisterGrpcLbLoadReportingFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](ChannelStackBuilder* builder) {
+ const grpc_channel_args* args = builder->channel_args();
+ const grpc_arg* channel_arg =
+ grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME);
+ if (channel_arg != nullptr && channel_arg->type == GRPC_ARG_STRING &&
+ strcmp(channel_arg->value.string, "grpclb") == 0) {
+ // TODO(roth): When we get around to re-attempting
+ // https://github.com/grpc/grpc/pull/16214, we should try to keep
+ // this filter at the very top of the subchannel stack, since that
+ // will minimize the number of metadata elements that the filter
+ // needs to iterate through to find the ClientStats object.
+ builder->PrependFilter(&grpc_client_load_reporting_filter, nullptr);
+ }
+ return true;
+ });
+}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
index a032b5db..91aa541b 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@@ -32,12 +32,9 @@
#define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \
"grpc.address_is_backend_from_grpclb_load_balancer"
-namespace grpc_core {
-
-extern const char kGrpcLbClientStatsMetadataKey[];
-extern const char kGrpcLbLbTokenMetadataKey[];
-
-} // namespace grpc_core
+// For use in tests.
+#define GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS \
+ "grpc.internal.grpclb_subchannel_cache_interval_ms"
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H \
*/
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
index 0bd587a9..8168d156 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
@@ -42,7 +42,7 @@ 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);
+ return QsortCompare(address_list1, address_list2);
}
if (address_list1->size() > address_list2->size()) return 1;
if (address_list1->size() < address_list2->size()) return -1;
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
index f95341e3..32ee1dd8 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h
@@ -21,7 +21,7 @@
#include <grpc/impl/codegen/grpc_types.h>
-#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/resolver/server_address.h"
namespace grpc_core {
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
deleted file mode 100644
index 07c5fd6f..00000000
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
-
-namespace grpc_core {
-
-grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) {
- return args;
-}
-
-grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri,
- const grpc_channel_args& args) {
- return grpc_insecure_channel_create(target_uri, &args, nullptr);
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
deleted file mode 100644
index 8ea48852..00000000
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_CHANNEL_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_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 {
-
-/// Makes any necessary modifications to \a args for use in the grpclb
-/// balancer channel.
-///
-/// Takes ownership of \a args.
-///
-/// Caller takes ownership of the returned args.
-grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args);
-
-grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri,
- const grpc_channel_args& args);
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H \
- */
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
deleted file mode 100644
index 837cc09b..00000000
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_channel.h"
-
-#include <string.h>
-
-#include "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/server_address.h"
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-namespace grpc_core {
-
-grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) {
- absl::InlinedVector<const char*, 1> args_to_remove;
- 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.
- grpc_channel_credentials* channel_credentials =
- grpc_channel_credentials_find_in_args(args);
- RefCountedPtr<grpc_channel_credentials> creds_sans_call_creds;
- if (channel_credentials != nullptr) {
- creds_sans_call_creds =
- channel_credentials->duplicate_without_call_credentials();
- GPR_ASSERT(creds_sans_call_creds != nullptr);
- args_to_remove.emplace_back(GRPC_ARG_CHANNEL_CREDENTIALS);
- args_to_add.emplace_back(
- grpc_channel_credentials_to_arg(creds_sans_call_creds.get()));
- }
- grpc_channel_args* result = grpc_channel_args_copy_and_add_and_remove(
- args, args_to_remove.data(), args_to_remove.size(), args_to_add.data(),
- args_to_add.size());
- // Clean up.
- grpc_channel_args_destroy(args);
- return result;
-}
-
-grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri,
- const grpc_channel_args& args) {
- grpc_channel_credentials* creds =
- grpc_channel_credentials_find_in_args(&args);
- if (creds == nullptr) {
- // Build with security but parent channel is insecure.
- return grpc_insecure_channel_create(target_uri, &args, nullptr);
- }
- const char* arg_to_remove = GRPC_ARG_CHANNEL_CREDENTIALS;
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_remove(&args, &arg_to_remove, 1);
- grpc_channel* channel =
- grpc_secure_channel_create(creds, target_uri, new_args, nullptr);
- grpc_channel_args_destroy(new_args);
- return channel;
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
index d4104ec5..bf25138e 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
@@ -22,11 +22,11 @@
#include <string.h>
+#include "absl/memory/memory.h"
+
#include <grpc/support/atm.h>
#include <grpc/support/string_util.h>
-#include "absl/memory/memory.h"
-
#include "src/core/lib/gprpp/sync.h"
namespace grpc_core {
@@ -63,8 +63,7 @@ void GrpcLbClientStats::AddCallDropped(const char* token) {
}
}
// Not found, so add a new entry.
- drop_token_counts_->emplace_back(
- grpc_core::UniquePtr<char>(gpr_strdup(token)), 1);
+ drop_token_counts_->emplace_back(UniquePtr<char>(gpr_strdup(token)), 1);
}
namespace {
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index c369827d..bfa030da 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
-
#include "absl/container/inlined_vector.h"
+#include <grpc/support/atm.h>
+
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -34,10 +34,10 @@ namespace grpc_core {
class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
public:
struct DropTokenCount {
- grpc_core::UniquePtr<char> token;
+ UniquePtr<char> token;
int64_t count;
- DropTokenCount(grpc_core::UniquePtr<char> token, int64_t count)
+ DropTokenCount(UniquePtr<char> token, int64_t count)
: token(std::move(token)), count(count) {}
};
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index 2ba01c1e..c9d54a98 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
-#include "src/core/lib/gpr/useful.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/timestamp.upb.h"
@@ -42,7 +41,7 @@ bool GrpcLbServer::operator==(const GrpcLbServer& other) const {
namespace {
grpc_slice grpc_grpclb_request_encode(
- const grpc_lb_v1_LoadBalanceRequest* request, upb_arena* arena) {
+ const grpc_lb_v1_LoadBalanceRequest* request, upb_Arena* arena) {
size_t buf_length;
char* buf =
grpc_lb_v1_LoadBalanceRequest_serialize(request, arena, &buf_length);
@@ -51,14 +50,15 @@ grpc_slice grpc_grpclb_request_encode(
} // namespace
-grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena) {
+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);
+ size_t name_len = std::min(strlen(lb_service_name),
+ size_t(GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH));
grpc_lb_v1_InitialLoadBalanceRequest_set_name(
- initial_request, upb_strview_make(lb_service_name, name_len));
+ initial_request,
+ upb_StringView_FromDataAndSize(lb_service_name, name_len));
return grpc_grpclb_request_encode(req, arena);
}
@@ -77,7 +77,7 @@ grpc_slice GrpcLbLoadReportRequestCreate(
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) {
+ 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);
@@ -96,10 +96,10 @@ grpc_slice GrpcLbLoadReportRequestCreate(
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());
- char* token = reinterpret_cast<char*>(upb_arena_malloc(arena, token_len));
+ char* token = reinterpret_cast<char*>(upb_Arena_Malloc(arena, token_len));
memcpy(token, cur.token.get(), token_len);
grpc_lb_v1_ClientStatsPerToken_set_load_balance_token(
- cur_msg, upb_strview_make(token, token_len));
+ cur_msg, upb_StringView_FromDataAndSize(token, token_len));
grpc_lb_v1_ClientStatsPerToken_set_num_calls(cur_msg, cur.count);
}
}
@@ -122,7 +122,7 @@ bool ParseServerList(const grpc_lb_v1_LoadBalanceResponse& response,
server_list->reserve(server_count);
for (size_t i = 0; i < server_count; ++i) {
GrpcLbServer& cur = *server_list->emplace(server_list->end());
- upb_strview address = grpc_lb_v1_Server_ip_address(servers[i]);
+ upb_StringView 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) {
@@ -130,7 +130,7 @@ bool ParseServerList(const grpc_lb_v1_LoadBalanceResponse& response,
memcpy(cur.ip_addr, address.data, address.size);
}
cur.port = grpc_lb_v1_Server_port(servers[i]);
- upb_strview token = grpc_lb_v1_Server_load_balance_token(servers[i]);
+ upb_StringView 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) {
@@ -146,17 +146,16 @@ bool ParseServerList(const grpc_lb_v1_LoadBalanceResponse& response,
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));
+Duration ParseDuration(const google_protobuf_Duration* duration_pb) {
+ return Duration::FromSecondsAndNanoseconds(
+ google_protobuf_Duration_seconds(duration_pb),
+ google_protobuf_Duration_nanos(duration_pb));
}
} // namespace
bool GrpcLbResponseParse(const grpc_slice& serialized_response,
- upb_arena* arena, GrpcLbResponse* result) {
+ upb_Arena* arena, GrpcLbResponse* result) {
grpc_lb_v1_LoadBalanceResponse* response =
grpc_lb_v1_LoadBalanceResponse_parse(
reinterpret_cast<const char*>(
@@ -177,7 +176,7 @@ bool GrpcLbResponseParse(const grpc_slice& serialized_response,
initial_response);
if (client_stats_report_interval != nullptr) {
result->client_stats_report_interval =
- grpc_grpclb_duration_to_millis(client_stats_report_interval);
+ ParseDuration(client_stats_report_interval);
}
return true;
}
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
index 1a55251b..a9ad62fa 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h
@@ -49,12 +49,12 @@ struct GrpcLbServer {
struct GrpcLbResponse {
enum { INITIAL, SERVERLIST, FALLBACK } type;
- grpc_millis client_stats_report_interval = 0;
+ Duration client_stats_report_interval;
std::vector<GrpcLbServer> serverlist;
};
// Creates a serialized grpclb request.
-grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena);
+grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_Arena* arena);
// Creates a serialized grpclb load report request.
grpc_slice GrpcLbLoadReportRequestCreate(
@@ -62,11 +62,11 @@ grpc_slice GrpcLbLoadReportRequestCreate(
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);
+ upb_Arena* arena);
// Deserialize a grpclb response.
bool GrpcLbResponseParse(const grpc_slice& serialized_response,
- upb_arena* arena, GrpcLbResponse* result);
+ upb_Arena* arena, GrpcLbResponse* result);
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index 6b7568c8..02ae76bc 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -1,20 +1,18 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
@@ -24,11 +22,11 @@
#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.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/filters/client_channel/subchannel.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
@@ -114,10 +112,7 @@ class PickFirst : public LoadBalancingPolicy {
: subchannel_(std::move(subchannel)) {}
PickResult Pick(PickArgs /*args*/) override {
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- result.subchannel = subchannel_;
- return result;
+ return PickResult::Complete(subchannel_);
}
private:
@@ -184,25 +179,28 @@ void PickFirst::ResetBackoffLocked() {
}
void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
- // Create a subchannel list from the latest_update_args_.
+ // Create a subchannel list from latest_update_args_.
+ ServerAddressList addresses;
+ if (latest_update_args_.addresses.ok()) {
+ addresses = *latest_update_args_.addresses;
+ }
auto subchannel_list = MakeOrphanable<PickFirstSubchannelList>(
- this, &grpc_lb_pick_first_trace, latest_update_args_.addresses,
+ this, &grpc_lb_pick_first_trace, std::move(addresses),
*latest_update_args_.args);
// Empty update or no valid subchannels.
if (subchannel_list->num_subchannels() == 0) {
// Unsubscribe from all current subchannels.
subchannel_list_ = std::move(subchannel_list); // Empty list.
selected_ = nullptr;
- // If not idle, put the channel in TRANSIENT_FAILURE.
- // (If we are idle, then this will happen in ExitIdleLocked() if we
- // haven't gotten a non-empty update by the time the application tries
- // to start a new call.)
- grpc_error_handle error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ // Put the channel in TRANSIENT_FAILURE.
+ absl::Status status =
+ latest_update_args_.addresses.ok()
+ ? absl::UnavailableError(absl::StrCat(
+ "empty address list: ", latest_update_args_.resolution_note))
+ : latest_update_args_.addresses.status();
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
return;
}
// If one of the subchannels in the new list is already in state
@@ -263,17 +261,28 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
void PickFirst::UpdateLocked(UpdateArgs args) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
- gpr_log(GPR_INFO,
- "Pick First %p received update with %" PRIuPTR " addresses", this,
- args.addresses.size());
+ if (args.addresses.ok()) {
+ gpr_log(GPR_INFO,
+ "Pick First %p received update with %" PRIuPTR " addresses", this,
+ args.addresses->size());
+ } else {
+ gpr_log(GPR_INFO, "Pick First %p received update with address error: %s",
+ this, args.addresses.status().ToString().c_str());
+ }
}
- // Update the latest_update_args_
+ // Add GRPC_ARG_INHIBIT_HEALTH_CHECKING channel arg.
grpc_arg new_arg = grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1);
const grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args.args, &new_arg, 1);
- GPR_SWAP(const grpc_channel_args*, new_args, args.args);
+ std::swap(new_args, args.args);
grpc_channel_args_destroy(new_args);
+ // If the update contains a resolver error and we have a previous update
+ // that was not a resolver error, keep using the previous addresses.
+ if (!args.addresses.ok() && latest_update_args_.config != nullptr) {
+ args.addresses = std::move(latest_update_args_.addresses);
+ }
+ // Update latest_update_args_.
latest_update_args_ = std::move(args);
// If we are not in idle, start connection attempt immediately.
// Otherwise, we defer the attempt into ExitIdleLocked().
@@ -292,6 +301,7 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
GPR_ASSERT(connectivity_state != GRPC_CHANNEL_SHUTDOWN);
// Handle updates for the currently selected subchannel.
if (p->selected_ == this) {
+ GPR_ASSERT(subchannel_list() == p->subchannel_list_.get());
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
gpr_log(GPR_INFO,
"Pick First %p selected subchannel connectivity changed to %s", p,
@@ -314,13 +324,11 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
// Set our state to that of the pending subchannel list.
if (p->subchannel_list_->in_transient_failure()) {
- grpc_error_handle error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "selected subchannel failed; switching to pending update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ absl::Status status = absl::UnavailableError(
+ "selected subchannel failed; switching to pending update");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
} else {
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
@@ -370,9 +378,9 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
// for a subchannel in p->latest_pending_subchannel_list_. The
// goal here is to find a subchannel from the update that we can
// select in place of the current one.
- subchannel_list()->set_in_transient_failure(false);
switch (connectivity_state) {
case GRPC_CHANNEL_READY: {
+ subchannel_list()->set_in_transient_failure(false);
ProcessUnselectedReadyLocked();
break;
}
@@ -384,22 +392,37 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
sd = subchannel_list()->subchannel(next_index);
// If we're tried all subchannels, set state to TRANSIENT_FAILURE.
if (sd->Index() == 0) {
- // Re-resolve if this is the most recent subchannel list.
- if (subchannel_list() == (p->latest_pending_subchannel_list_ != nullptr
- ? p->latest_pending_subchannel_list_.get()
- : p->subchannel_list_.get())) {
- p->channel_control_helper()->RequestReresolution();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
+ gpr_log(GPR_INFO,
+ "Pick First %p subchannel list %p failed to connect to "
+ "all subchannels",
+ p, subchannel_list());
}
subchannel_list()->set_in_transient_failure(true);
- // Only report new state in case 1.
+ // In case 2, swap to the new subchannel list. This means reporting
+ // TRANSIENT_FAILURE and dropping the existing (working) connection,
+ // but we can't ignore what the control plane has told us.
+ if (subchannel_list() == p->latest_pending_subchannel_list_.get()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
+ gpr_log(GPR_INFO,
+ "Pick First %p promoting pending subchannel list %p to "
+ "replace %p",
+ p, p->latest_pending_subchannel_list_.get(),
+ p->subchannel_list_.get());
+ }
+ p->selected_ = nullptr; // owned by p->subchannel_list_
+ p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
+ }
+ // If this is the current subchannel list (either because we were
+ // in case 1 or because we were in case 2 and just promoted it to
+ // be the current list), re-resolve and report new state.
if (subchannel_list() == p->subchannel_list_.get()) {
- grpc_error_handle error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "failed to connect to all addresses"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ p->channel_control_helper()->RequestReresolution();
+ absl::Status status =
+ absl::UnavailableError("failed to connect to all addresses");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
}
}
sd->CheckConnectivityStateAndStartWatchingLocked();
@@ -407,8 +430,10 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
}
case GRPC_CHANNEL_CONNECTING:
case GRPC_CHANNEL_IDLE: {
- // Only update connectivity state in case 1.
- if (subchannel_list() == p->subchannel_list_.get()) {
+ // Only update connectivity state in case 1, and only if we're not
+ // already in TRANSIENT_FAILURE.
+ if (subchannel_list() == p->subchannel_list_.get() &&
+ !subchannel_list()->in_transient_failure()) {
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
index 3cd7c541..7ccdfe35 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
@@ -47,11 +47,11 @@ 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;
+constexpr Duration kChildRetentionInterval = Duration::Minutes(15);
// 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;
+constexpr Duration kDefaultChildFailoverTimeout = Duration::Seconds(10);
// Config for priority LB policy.
class PriorityLbConfig : public LoadBalancingPolicy::Config {
@@ -104,9 +104,8 @@ class PriorityLb : public LoadBalancingPolicy {
bool ignore_reresolution_requests);
void ExitIdleLocked();
void ResetBackoffLocked();
- void DeactivateLocked();
+ void MaybeDeactivateLocked();
void MaybeReactivateLocked();
- void MaybeCancelFailoverTimerLocked();
void Orphan() override;
@@ -122,9 +121,7 @@ class PriorityLb : public LoadBalancingPolicy {
return connectivity_status_;
}
- bool failover_timer_callback_pending() const {
- return failover_timer_callback_pending_;
- }
+ bool FailoverTimerPending() const { return failover_timer_ != nullptr; }
private:
// A simple wrapper for ref-counting a picker from the child policy.
@@ -162,6 +159,7 @@ class PriorityLb : public LoadBalancingPolicy {
const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -169,6 +167,38 @@ class PriorityLb : public LoadBalancingPolicy {
RefCountedPtr<ChildPriority> priority_;
};
+ class DeactivationTimer : public InternallyRefCounted<DeactivationTimer> {
+ public:
+ explicit DeactivationTimer(RefCountedPtr<ChildPriority> child_priority);
+
+ void Orphan() override;
+
+ private:
+ static void OnTimer(void* arg, grpc_error_handle error);
+ void OnTimerLocked(grpc_error_handle);
+
+ RefCountedPtr<ChildPriority> child_priority_;
+ grpc_timer timer_;
+ grpc_closure on_timer_;
+ bool timer_pending_ = true;
+ };
+
+ class FailoverTimer : public InternallyRefCounted<FailoverTimer> {
+ public:
+ explicit FailoverTimer(RefCountedPtr<ChildPriority> child_priority);
+
+ void Orphan() override;
+
+ private:
+ static void OnTimer(void* arg, grpc_error_handle error);
+ void OnTimerLocked(grpc_error_handle);
+
+ RefCountedPtr<ChildPriority> child_priority_;
+ grpc_timer timer_;
+ grpc_closure on_timer_;
+ bool timer_pending_ = true;
+ };
+
// Methods for dealing with the child policy.
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
const grpc_channel_args* args);
@@ -177,13 +207,6 @@ class PriorityLb : public LoadBalancingPolicy {
grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker);
- void StartFailoverTimerLocked();
-
- static void OnFailoverTimer(void* arg, grpc_error_handle error);
- void OnFailoverTimerLocked(grpc_error_handle error);
- static void OnDeactivationTimer(void* arg, grpc_error_handle error);
- void OnDeactivationTimerLocked(grpc_error_handle error);
-
RefCountedPtr<PriorityLb> priority_policy_;
const std::string name_;
bool ignore_reresolution_requests_ = false;
@@ -194,40 +217,62 @@ class PriorityLb : public LoadBalancingPolicy {
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;
+ bool seen_ready_or_idle_since_transient_failure_ = true;
- // States of failover.
- grpc_timer failover_timer_;
- grpc_closure on_failover_timer_;
- bool failover_timer_callback_pending_ = false;
+ OrphanablePtr<DeactivationTimer> deactivation_timer_;
+ OrphanablePtr<FailoverTimer> failover_timer_;
};
~PriorityLb() override;
void ShutdownLocked() override;
- // Returns UINT32_MAX if child is not in current priority list.
+ // Returns the priority of the specified child name, or UINT32_MAX if
+ // the child is not in the current priority list.
uint32_t GetChildPriorityLocked(const std::string& child_name) const;
+ // Called when a child's connectivity state has changed.
+ // May propagate the update to the channel or trigger choosing a new
+ // priority.
void HandleChildConnectivityStateChangeLocked(ChildPriority* child);
- void DeleteChild(ChildPriority* child);
- void TryNextPriorityLocked(bool report_connecting);
- void SelectPriorityLocked(uint32_t priority);
+ // Deletes a child. Called when the child's deactivation timer fires.
+ void DeleteChild(ChildPriority* child);
- const int child_failover_timeout_ms_;
+ // Iterates through the list of priorities to choose one:
+ // - If the child for a priority doesn't exist, creates it.
+ // - If a child's failover timer is pending, returns without selecting
+ // a priority while we wait for the child to attempt to connect. In
+ // this case, if report_connecting is true, reports CONNECTING state to
+ // the channel.
+ // - If the child is connected, it will be used as the current priority.
+ // - Otherwise, continues on to the next child.
+ // Reports TRANSIENT_FAILURE to the channel if all children are not
+ // connected.
+ //
+ // This method is idempotent; it should yield the same result every
+ // time as a function of the state of the children.
+ void ChoosePriorityLocked(bool report_connecting);
+
+ // Sets the specified priority as the current priority.
+ // Deactivates any children at lower priorities.
+ // Returns the child's picker to the channel.
+ void SetCurrentPriorityLocked(uint32_t priority);
+
+ const Duration child_failover_timeout_;
// Current channel args and config from the resolver.
const grpc_channel_args* args_ = nullptr;
RefCountedPtr<PriorityLbConfig> config_;
- HierarchicalAddressMap addresses_;
+ absl::StatusOr<HierarchicalAddressMap> addresses_;
// Internal state.
bool shutting_down_ = false;
+ bool update_in_progress_ = false;
+
+ // All children that currently exist.
+ // Some of these children may be in deactivated state.
std::map<std::string, OrphanablePtr<ChildPriority>> children_;
// The priority that is being used.
uint32_t current_priority_ = UINT32_MAX;
@@ -243,9 +288,11 @@ class PriorityLb : public LoadBalancingPolicy {
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})) {
+ child_failover_timeout_(
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS,
+ {static_cast<int>(kDefaultChildFailoverTimeout.millis()), 0,
+ INT_MAX}))) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO, "[priority_lb %p] created", this);
}
@@ -292,7 +339,7 @@ void PriorityLb::UpdateLocked(UpdateArgs args) {
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
+ // reset later by ChoosePriorityLocked(), but we unset it here in
// case updating any of our children triggers a state update.
current_priority_ = UINT32_MAX;
}
@@ -305,21 +352,23 @@ void PriorityLb::UpdateLocked(UpdateArgs args) {
// Update addresses.
addresses_ = MakeHierarchicalAddressMap(args.addresses);
// Check all existing children against the new config.
+ update_in_progress_ = true;
for (const auto& p : children_) {
const std::string& 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();
+ child->MaybeDeactivateLocked();
} else {
// Existing child found in new config. Update it.
child->UpdateLocked(config_it->second.config,
config_it->second.ignore_reresolution_requests);
}
}
+ update_in_progress_ = false;
// Try to get connected.
- TryNextPriorityLocked(/*report_connecting=*/children_.empty());
+ ChoosePriorityLocked(/*report_connecting=*/children_.empty());
}
uint32_t PriorityLb::GetChildPriorityLocked(
@@ -333,6 +382,12 @@ uint32_t PriorityLb::GetChildPriorityLocked(
void PriorityLb::HandleChildConnectivityStateChangeLocked(
ChildPriority* child) {
+ // If we're in the process of propagating an update from our parent to
+ // our children, ignore any updates that come from the children. We
+ // will instead choose a new priority once the update has been seen by
+ // all children. This ensures that we don't incorrectly do the wrong
+ // thing while state is inconsistent.
+ if (update_in_progress_) return;
// Special case for the child that was the current child before the
// most recent update.
if (child == current_child_from_before_update_) {
@@ -352,11 +407,11 @@ void PriorityLb::HandleChildConnectivityStateChangeLocked(
} 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
+ // update, but calling ChoosePriorityLocked() 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);
+ ChoosePriorityLocked(/*report_connecting=*/true);
}
return;
}
@@ -368,52 +423,26 @@ void PriorityLb::HandleChildConnectivityStateChangeLocked(
"priority %u",
this, child_priority, child->name().c_str(), current_priority_);
}
- // 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());
+ // Unconditionally call ChoosePriorityLocked(). It should do the
+ // right thing based on the state of all children.
+ ChoosePriorityLocked(
+ /*report_connecting=*/child_priority == current_priority_);
}
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
+ // result of the update, but calling ChoosePriorityLocked() 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);
+ ChoosePriorityLocked(/*report_connecting=*/true);
}
children_.erase(child->name());
}
-void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
+void PriorityLb::ChoosePriorityLocked(bool report_connecting) {
current_priority_ = UINT32_MAX;
for (uint32_t priority = 0; priority < config_->priorities().size();
++priority) {
@@ -443,12 +472,12 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
// 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);
+ SetCurrentPriorityLocked(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 (child->FailoverTimerPending()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO,
"[priority_lb %p] priority %u, child %s: child still "
@@ -463,6 +492,13 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
return;
}
// Child has been failing for a while. Move on to the next priority.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] skipping priority %u, child %s: state=%s, "
+ "failover timer not pending",
+ this, priority, child_name.c_str(),
+ ConnectivityStateName(child->connectivity_state()));
+ }
}
// If there are no more priorities to try, report TRANSIENT_FAILURE.
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
@@ -472,15 +508,13 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
this);
}
current_child_from_before_update_ = nullptr;
- grpc_error_handle error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready priority"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ absl::Status status = absl::UnavailableError("no ready priority");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
}
-void PriorityLb::SelectPriorityLocked(uint32_t priority) {
+void PriorityLb::SetCurrentPriorityLocked(uint32_t priority) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
gpr_log(GPR_INFO, "[priority_lb %p] selected priority %u, child %s", this,
priority, config_->priorities()[priority].c_str());
@@ -491,7 +525,7 @@ void PriorityLb::SelectPriorityLocked(uint32_t priority) {
for (uint32_t p = priority + 1; p < config_->priorities().size(); ++p) {
const std::string& child_name = config_->priorities()[p];
auto it = children_.find(child_name);
- if (it != children_.end()) it->second->DeactivateLocked();
+ if (it != children_.end()) it->second->MaybeDeactivateLocked();
}
// Update picker.
auto& child = children_[config_->priorities()[priority]];
@@ -501,6 +535,132 @@ void PriorityLb::SelectPriorityLocked(uint32_t priority) {
}
//
+// PriorityLb::ChildPriority::DeactivationTimer
+//
+
+PriorityLb::ChildPriority::DeactivationTimer::DeactivationTimer(
+ RefCountedPtr<PriorityLb::ChildPriority> child_priority)
+ : child_priority_(std::move(child_priority)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): deactivating -- will remove in "
+ "%" PRId64 "ms",
+ child_priority_->priority_policy_.get(),
+ child_priority_->name_.c_str(), child_priority_.get(),
+ kChildRetentionInterval.millis());
+ }
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr);
+ Ref(DEBUG_LOCATION, "Timer").release();
+ grpc_timer_init(&timer_, ExecCtx::Get()->Now() + kChildRetentionInterval,
+ &on_timer_);
+}
+
+void PriorityLb::ChildPriority::DeactivationTimer::Orphan() {
+ if (timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): reactivating",
+ child_priority_->priority_policy_.get(),
+ child_priority_->name_.c_str(), child_priority_.get());
+ }
+ timer_pending_ = false;
+ grpc_timer_cancel(&timer_);
+ }
+ Unref();
+}
+
+void PriorityLb::ChildPriority::DeactivationTimer::OnTimer(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<DeactivationTimer*>(arg);
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
+ self->child_priority_->priority_policy_->work_serializer()->Run(
+ [self, error]() { self->OnTimerLocked(error); }, DEBUG_LOCATION);
+}
+
+void PriorityLb::ChildPriority::DeactivationTimer::OnTimerLocked(
+ grpc_error_handle error) {
+ if (error == GRPC_ERROR_NONE && timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): deactivation timer fired, "
+ "deleting child",
+ child_priority_->priority_policy_.get(),
+ child_priority_->name_.c_str(), child_priority_.get());
+ }
+ timer_pending_ = false;
+ child_priority_->priority_policy_->DeleteChild(child_priority_.get());
+ }
+ Unref(DEBUG_LOCATION, "Timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
+// PriorityLb::ChildPriority::FailoverTimer
+//
+
+PriorityLb::ChildPriority::FailoverTimer::FailoverTimer(
+ RefCountedPtr<PriorityLb::ChildPriority> child_priority)
+ : child_priority_(std::move(child_priority)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[priority_lb %p] child %s (%p): starting failover timer for %" PRId64
+ "ms",
+ child_priority_->priority_policy_.get(), child_priority_->name_.c_str(),
+ child_priority_.get(),
+ child_priority_->priority_policy_->child_failover_timeout_.millis());
+ }
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr);
+ Ref(DEBUG_LOCATION, "Timer").release();
+ grpc_timer_init(
+ &timer_,
+ ExecCtx::Get()->Now() +
+ child_priority_->priority_policy_->child_failover_timeout_,
+ &on_timer_);
+}
+
+void PriorityLb::ChildPriority::FailoverTimer::Orphan() {
+ if (timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
+ gpr_log(GPR_INFO,
+ "[priority_lb %p] child %s (%p): cancelling failover timer",
+ child_priority_->priority_policy_.get(),
+ child_priority_->name_.c_str(), child_priority_.get());
+ }
+ timer_pending_ = false;
+ grpc_timer_cancel(&timer_);
+ }
+ Unref();
+}
+
+void PriorityLb::ChildPriority::FailoverTimer::OnTimer(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<FailoverTimer*>(arg);
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
+ self->child_priority_->priority_policy_->work_serializer()->Run(
+ [self, error]() { self->OnTimerLocked(error); }, DEBUG_LOCATION);
+}
+
+void PriorityLb::ChildPriority::FailoverTimer::OnTimerLocked(
+ grpc_error_handle error) {
+ if (error == GRPC_ERROR_NONE && timer_pending_) {
+ 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",
+ child_priority_->priority_policy_.get(),
+ child_priority_->name_.c_str(), child_priority_.get());
+ }
+ timer_pending_ = false;
+ child_priority_->OnConnectivityStateUpdateLocked(
+ GRPC_CHANNEL_TRANSIENT_FAILURE,
+ absl::Status(absl::StatusCode::kUnavailable, "failover timer fired"),
+ nullptr);
+ }
+ Unref(DEBUG_LOCATION, "Timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
// PriorityLb::ChildPriority
//
@@ -511,12 +671,8 @@ PriorityLb::ChildPriority::ChildPriority(
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();
+ failover_timer_ = MakeOrphanable<FailoverTimer>(Ref());
}
void PriorityLb::ChildPriority::Orphan() {
@@ -524,10 +680,8 @@ void PriorityLb::ChildPriority::Orphan() {
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_);
- }
+ failover_timer_.reset();
+ deactivation_timer_.reset();
// Remove the child policy's interested_parties pollset_set from the
// xDS policy.
grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
@@ -536,9 +690,6 @@ void PriorityLb::ChildPriority::Orphan() {
// 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");
}
@@ -558,7 +709,11 @@ void PriorityLb::ChildPriority::UpdateLocked(
// Construct update args.
UpdateArgs update_args;
update_args.config = std::move(config);
- update_args.addresses = priority_policy_->addresses_[name_];
+ if (priority_policy_->addresses_.ok()) {
+ update_args.addresses = (*priority_policy_->addresses_)[name_];
+ } else {
+ update_args.addresses = priority_policy_->addresses_.status();
+ }
update_args.args = grpc_channel_args_copy(priority_policy_->args_);
// Update the policy.
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
@@ -595,10 +750,6 @@ PriorityLb::ChildPriority::CreateChildPolicyLocked(
}
void PriorityLb::ChildPriority::ExitIdleLocked() {
- if (connectivity_state_ == GRPC_CHANNEL_IDLE &&
- !failover_timer_callback_pending_) {
- StartFailoverTimerLocked();
- }
child_policy_->ExitIdleLocked();
}
@@ -620,136 +771,41 @@ void PriorityLb::ChildPriority::OnConnectivityStateUpdateLocked(
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();
+ // If we transition to state CONNECTING and we've not seen
+ // TRANSIENT_FAILURE more recently than READY or IDLE, start failover
+ // timer if not already pending.
+ // In any other state, update seen_ready_or_idle_since_transient_failure_
+ // and cancel failover timer.
+ if (state == GRPC_CHANNEL_CONNECTING) {
+ if (seen_ready_or_idle_since_transient_failure_ &&
+ failover_timer_ == nullptr) {
+ failover_timer_ = MakeOrphanable<FailoverTimer>(Ref());
+ }
+ } else if (state == GRPC_CHANNEL_READY || state == GRPC_CHANNEL_IDLE) {
+ seen_ready_or_idle_since_transient_failure_ = true;
+ failover_timer_.reset();
+ } else if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ seen_ready_or_idle_since_transient_failure_ = false;
+ failover_timer_.reset();
}
// 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_handle 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_handle 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,
- absl::Status(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);
+void PriorityLb::ChildPriority::MaybeDeactivateLocked() {
+ if (deactivation_timer_ == nullptr) {
+ deactivation_timer_ = MakeOrphanable<DeactivationTimer>(Ref());
}
- 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_handle 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_handle 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);
+ deactivation_timer_.reset();
}
//
// PriorityLb::ChildPriority::Helper
//
-void PriorityLb::ChildPriority::Helper::RequestReresolution() {
- if (priority_->priority_policy_->shutting_down_) return;
- if (priority_->ignore_reresolution_requests_) {
- return;
- }
- priority_->priority_policy_->channel_control_helper()->RequestReresolution();
-}
-
RefCountedPtr<SubchannelInterface>
PriorityLb::ChildPriority::Helper::CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) {
@@ -766,6 +822,18 @@ void PriorityLb::ChildPriority::Helper::UpdateState(
priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker));
}
+void PriorityLb::ChildPriority::Helper::RequestReresolution() {
+ if (priority_->priority_policy_->shutting_down_) return;
+ if (priority_->ignore_reresolution_requests_) {
+ return;
+ }
+ priority_->priority_policy_->channel_control_helper()->RequestReresolution();
+}
+
+absl::string_view PriorityLb::ChildPriority::Helper::GetAuthority() {
+ return priority_->priority_policy_->channel_control_helper()->GetAuthority();
+}
+
void PriorityLb::ChildPriority::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) {
if (priority_->priority_policy_->shutting_down_) return;
@@ -814,17 +882,15 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
const std::string& 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(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("field:children key:", child_name,
- " error:should be type object")
- .c_str()));
+ " error:should be type object")));
} else {
auto it2 = element.object_value().find("config");
if (it2 == element.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("field:children key:", child_name,
- " error:missing 'config' field")
- .c_str()));
+ " error:missing 'config' field")));
} else {
grpc_error_handle parse_error = GRPC_ERROR_NONE;
auto config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
@@ -838,11 +904,10 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
if (it3->second.type() == Json::Type::JSON_TRUE) {
ignore_resolution_requests = true;
} else if (it3->second.type() != Json::Type::JSON_FALSE) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("field:children key:", child_name,
" field:ignore_reresolution_requests:should "
- "be type boolean")
- .c_str()));
+ "be type boolean")));
}
}
if (config == nullptr) {
@@ -874,26 +939,20 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
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(
- absl::StrCat("field:priorities element:", i,
- " error:should be type string")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:priorities element:", i, " error:should be type string")));
} else if (children.find(element.string_value()) == children.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:priorities element:", i,
- " error:unknown child '", element.string_value(),
- "'")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:priorities element:", i, " error:unknown child '",
+ element.string_value(), "'")));
} else {
priorities.emplace_back(element.string_value());
}
}
if (priorities.size() != children.size()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:priorities error:priorities size (",
- priorities.size(), ") != children size (",
- children.size(), ")")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:priorities error:priorities size (", priorities.size(),
+ ") != children size (", children.size(), ")")));
}
}
if (error_list.empty()) {
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
index 921bd2e0..5a95c563 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
@@ -16,8 +16,808 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
+#define XXH_INLINE_ALL
+#include "xxhash.h"
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/error_utils.h"
+
namespace grpc_core {
const char* kRequestRingHashAttribute = "request_ring_hash";
+TraceFlag grpc_lb_ring_hash_trace(false, "ring_hash_lb");
+
+// Helper Parser method
+void ParseRingHashLbConfig(const Json& json, size_t* min_ring_size,
+ size_t* max_ring_size,
+ std::vector<grpc_error_handle>* error_list) {
+ *min_ring_size = 1024;
+ *max_ring_size = 8388608;
+ if (json.type() != Json::Type::OBJECT) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ring_hash_experimental should be of type object"));
+ return;
+ }
+ const Json::Object& ring_hash = json.object_value();
+ auto ring_hash_it = ring_hash.find("min_ring_size");
+ if (ring_hash_it != ring_hash.end()) {
+ if (ring_hash_it->second.type() != Json::Type::NUMBER) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:min_ring_size error: should be of type number"));
+ } else {
+ *min_ring_size = gpr_parse_nonnegative_int(
+ ring_hash_it->second.string_value().c_str());
+ }
+ }
+ ring_hash_it = ring_hash.find("max_ring_size");
+ if (ring_hash_it != ring_hash.end()) {
+ if (ring_hash_it->second.type() != Json::Type::NUMBER) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:max_ring_size error: should be of type number"));
+ } else {
+ *max_ring_size = gpr_parse_nonnegative_int(
+ ring_hash_it->second.string_value().c_str());
+ }
+ }
+ if (*min_ring_size == 0 || *min_ring_size > 8388608 || *max_ring_size == 0 ||
+ *max_ring_size > 8388608 || *min_ring_size > *max_ring_size) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:max_ring_size and or min_ring_size error: "
+ "values need to be in the range of 1 to 8388608 "
+ "and max_ring_size cannot be smaller than "
+ "min_ring_size"));
+ }
+}
+
+namespace {
+
+constexpr char kRingHash[] = "ring_hash_experimental";
+
+class RingHashLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ RingHashLbConfig(size_t min_ring_size, size_t max_ring_size)
+ : min_ring_size_(min_ring_size), max_ring_size_(max_ring_size) {}
+ const char* name() const override { return kRingHash; }
+ size_t min_ring_size() const { return min_ring_size_; }
+ size_t max_ring_size() const { return max_ring_size_; }
+
+ private:
+ size_t min_ring_size_;
+ size_t max_ring_size_;
+};
+
+//
+// ring_hash LB policy
+//
+
+class RingHash : public LoadBalancingPolicy {
+ public:
+ explicit RingHash(Args args);
+
+ const char* name() const override { return kRingHash; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ResetBackoffLocked() override;
+
+ private:
+ ~RingHash() override;
+
+ // Forward declarations.
+ class RingHashSubchannelList;
+ class Ring;
+
+ // Data for a particular subchannel in a subchannel list.
+ // This subclass adds the following functionality:
+ // - Tracks the previous connectivity state of the subchannel, so that
+ // we know how many subchannels are in each state.
+ class RingHashSubchannelData
+ : public SubchannelData<RingHashSubchannelList, RingHashSubchannelData> {
+ public:
+ RingHashSubchannelData(
+ SubchannelList<RingHashSubchannelList, RingHashSubchannelData>*
+ subchannel_list,
+ const ServerAddress& address,
+ RefCountedPtr<SubchannelInterface> subchannel)
+ : SubchannelData(subchannel_list, address, std::move(subchannel)),
+ address_(address) {}
+
+ grpc_connectivity_state GetConnectivityState() const {
+ return connectivity_state_for_picker_.load(std::memory_order_relaxed);
+ }
+
+ const ServerAddress& address() const { return address_; }
+
+ // Performs connectivity state updates that need to be done both when we
+ // first start watching and when a watcher notification is received.
+ void UpdateConnectivityStateLocked(
+ grpc_connectivity_state connectivity_state);
+
+ private:
+ // Performs connectivity state updates that need to be done only
+ // after we have started watching.
+ void ProcessConnectivityChangeLocked(
+ grpc_connectivity_state connectivity_state) override;
+
+ ServerAddress address_;
+
+ // Last logical connectivity state seen.
+ // Note that this may differ from the state actually reported by the
+ // subchannel in some cases; for example, once this is set to
+ // TRANSIENT_FAILURE, we do not change it again until we get READY,
+ // so we skip any interim stops in CONNECTING.
+ grpc_connectivity_state last_connectivity_state_ = GRPC_CHANNEL_SHUTDOWN;
+
+ // Connectivity state seen by picker.
+ // Uses an atomic so that it can be accessed outside of the WorkSerializer.
+ std::atomic<grpc_connectivity_state> connectivity_state_for_picker_{
+ GRPC_CHANNEL_IDLE};
+ };
+
+ // A list of subchannels.
+ class RingHashSubchannelList
+ : public SubchannelList<RingHashSubchannelList, RingHashSubchannelData> {
+ public:
+ RingHashSubchannelList(RingHash* policy, TraceFlag* tracer,
+ ServerAddressList addresses,
+ const grpc_channel_args& args)
+ : 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'
+ // pollset_sets will include the LB policy's pollset_set.
+ policy->Ref(DEBUG_LOCATION, "subchannel_list").release();
+ }
+
+ ~RingHashSubchannelList() override {
+ RingHash* p = static_cast<RingHash*>(policy());
+ p->Unref(DEBUG_LOCATION, "subchannel_list");
+ }
+
+ // Starts watching the subchannels in this list.
+ void StartWatchingLocked();
+
+ // Updates the counters of subchannels in each state when a
+ // subchannel transitions from old_state to new_state.
+ void UpdateStateCountersLocked(grpc_connectivity_state old_state,
+ grpc_connectivity_state new_state);
+
+ // Updates the RH policy's connectivity state based on the
+ // subchannel list's state counters, creating new picker and new ring.
+ // The index parameter indicates the index into the list of the subchannel
+ // whose status report triggered the call to
+ // UpdateRingHashConnectivityStateLocked().
+ void UpdateRingHashConnectivityStateLocked(size_t index);
+
+ // Create a new ring from this subchannel list.
+ RefCountedPtr<Ring> MakeRing();
+
+ private:
+ size_t num_idle_ = 0;
+ size_t num_ready_ = 0;
+ size_t num_connecting_ = 0;
+ size_t num_transient_failure_ = 0;
+ };
+
+ class Ring : public RefCounted<Ring> {
+ public:
+ struct Entry {
+ uint64_t hash;
+ RingHashSubchannelData* subchannel;
+ };
+
+ Ring(RingHash* parent,
+ RefCountedPtr<RingHashSubchannelList> subchannel_list);
+
+ const std::vector<Entry>& ring() const { return ring_; }
+
+ private:
+ RefCountedPtr<RingHashSubchannelList> subchannel_list_;
+ std::vector<Entry> ring_;
+ };
+
+ class Picker : public SubchannelPicker {
+ public:
+ Picker(RefCountedPtr<RingHash> parent, RefCountedPtr<Ring> ring)
+ : parent_(std::move(parent)), ring_(std::move(ring)) {}
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ // A fire-and-forget class that schedules subchannel connection attempts
+ // on the control plane WorkSerializer.
+ class SubchannelConnectionAttempter : public Orphanable {
+ public:
+ explicit SubchannelConnectionAttempter(
+ RefCountedPtr<RingHash> ring_hash_lb)
+ : ring_hash_lb_(std::move(ring_hash_lb)) {
+ GRPC_CLOSURE_INIT(&closure_, RunInExecCtx, this, nullptr);
+ }
+
+ void AddSubchannel(RefCountedPtr<SubchannelInterface> subchannel) {
+ subchannels_.push_back(std::move(subchannel));
+ }
+
+ void Orphan() override {
+ // Hop into ExecCtx, so that we're not holding the data plane mutex
+ // while we run control-plane code.
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+ }
+
+ private:
+ static void RunInExecCtx(void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelConnectionAttempter*>(arg);
+ self->ring_hash_lb_->work_serializer()->Run(
+ [self]() {
+ if (!self->ring_hash_lb_->shutdown_) {
+ for (auto& subchannel : self->subchannels_) {
+ subchannel->AttemptToConnect();
+ }
+ }
+ delete self;
+ },
+ DEBUG_LOCATION);
+ }
+
+ RefCountedPtr<RingHash> ring_hash_lb_;
+ grpc_closure closure_;
+ absl::InlinedVector<RefCountedPtr<SubchannelInterface>, 10> subchannels_;
+ };
+
+ RefCountedPtr<RingHash> parent_;
+ RefCountedPtr<Ring> ring_;
+ };
+
+ void ShutdownLocked() override;
+
+ // Current config from resolver.
+ RefCountedPtr<RingHashLbConfig> config_;
+
+ // list of subchannels.
+ OrphanablePtr<RingHashSubchannelList> subchannel_list_;
+ // indicating if we are shutting down.
+ bool shutdown_ = false;
+
+ // Current ring.
+ RefCountedPtr<Ring> ring_;
+};
+
+//
+// RingHash::Ring
+//
+
+RingHash::Ring::Ring(RingHash* parent,
+ RefCountedPtr<RingHashSubchannelList> subchannel_list)
+ : subchannel_list_(std::move(subchannel_list)) {
+ size_t num_subchannels = subchannel_list_->num_subchannels();
+ // Store the weights while finding the sum.
+ struct AddressWeight {
+ std::string address;
+ // Default weight is 1 for the cases where a weight is not provided,
+ // each occurrence of the address will be counted a weight value of 1.
+ uint32_t weight = 1;
+ double normalized_weight;
+ };
+ std::vector<AddressWeight> address_weights;
+ size_t sum = 0;
+ address_weights.reserve(num_subchannels);
+ for (size_t i = 0; i < num_subchannels; ++i) {
+ RingHashSubchannelData* sd = subchannel_list_->subchannel(i);
+ const ServerAddressWeightAttribute* weight_attribute = static_cast<
+ const ServerAddressWeightAttribute*>(sd->address().GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ AddressWeight address_weight;
+ address_weight.address =
+ grpc_sockaddr_to_string(&sd->address().address(), false);
+ if (weight_attribute != nullptr) {
+ GPR_ASSERT(weight_attribute->weight() != 0);
+ address_weight.weight = weight_attribute->weight();
+ }
+ sum += address_weight.weight;
+ address_weights.push_back(std::move(address_weight));
+ }
+ // Calculating normalized weights and find min and max.
+ double min_normalized_weight = 1.0;
+ double max_normalized_weight = 0.0;
+ for (auto& address : address_weights) {
+ address.normalized_weight = static_cast<double>(address.weight) / sum;
+ min_normalized_weight =
+ std::min(address.normalized_weight, min_normalized_weight);
+ max_normalized_weight =
+ std::max(address.normalized_weight, max_normalized_weight);
+ }
+ // Scale up the number of hashes per host such that the least-weighted host
+ // gets a whole number of hashes on the ring. Other hosts might not end up
+ // with whole numbers, and that's fine (the ring-building algorithm below can
+ // handle this). This preserves the original implementation's behavior: when
+ // weights aren't provided, all hosts should get an equal number of hashes. In
+ // the case where this number exceeds the max_ring_size, it's scaled back down
+ // to fit.
+ const size_t min_ring_size = parent->config_->min_ring_size();
+ const size_t max_ring_size = parent->config_->max_ring_size();
+ const double scale = std::min(
+ std::ceil(min_normalized_weight * min_ring_size) / min_normalized_weight,
+ static_cast<double>(max_ring_size));
+ // Reserve memory for the entire ring up front.
+ const uint64_t ring_size = std::ceil(scale);
+ ring_.reserve(ring_size);
+ // Populate the hash ring by walking through the (host, weight) pairs in
+ // normalized_host_weights, and generating (scale * weight) hashes for each
+ // host. Since these aren't necessarily whole numbers, we maintain running
+ // sums -- current_hashes and target_hashes -- which allows us to populate the
+ // ring in a mostly stable way.
+ absl::InlinedVector<char, 196> hash_key_buffer;
+ double current_hashes = 0.0;
+ double target_hashes = 0.0;
+ uint64_t min_hashes_per_host = ring_size;
+ uint64_t max_hashes_per_host = 0;
+ for (size_t i = 0; i < num_subchannels; ++i) {
+ const std::string& address_string = address_weights[i].address;
+ hash_key_buffer.assign(address_string.begin(), address_string.end());
+ hash_key_buffer.emplace_back('_');
+ auto offset_start = hash_key_buffer.end();
+ target_hashes += scale * address_weights[i].normalized_weight;
+ size_t count = 0;
+ while (current_hashes < target_hashes) {
+ const std::string count_str = absl::StrCat(count);
+ hash_key_buffer.insert(offset_start, count_str.begin(), count_str.end());
+ absl::string_view hash_key(hash_key_buffer.data(),
+ hash_key_buffer.size());
+ const uint64_t hash = XXH64(hash_key.data(), hash_key.size(), 0);
+ ring_.push_back({hash, subchannel_list_->subchannel(i)});
+ ++count;
+ ++current_hashes;
+ hash_key_buffer.erase(offset_start, hash_key_buffer.end());
+ }
+ min_hashes_per_host =
+ std::min(static_cast<uint64_t>(i), min_hashes_per_host);
+ max_hashes_per_host =
+ std::max(static_cast<uint64_t>(i), max_hashes_per_host);
+ }
+ std::sort(ring_.begin(), ring_.end(),
+ [](const Entry& lhs, const Entry& rhs) -> bool {
+ return lhs.hash < rhs.hash;
+ });
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO,
+ "[RH %p picker %p] created ring from subchannel_list=%p "
+ "with %" PRIuPTR " ring entries",
+ parent, this, subchannel_list_.get(), ring_.size());
+ }
+}
+
+//
+// RingHash::Picker
+//
+
+RingHash::PickResult RingHash::Picker::Pick(PickArgs args) {
+ auto hash =
+ args.call_state->ExperimentalGetCallAttribute(kRequestRingHashAttribute);
+ uint64_t h;
+ if (!absl::SimpleAtoi(hash, &h)) {
+ return PickResult::Fail(
+ absl::InternalError("xds ring hash value is not a number"));
+ }
+ const std::vector<Ring::Entry>& ring = ring_->ring();
+ // Ported from https://github.com/RJ/ketama/blob/master/libketama/ketama.c
+ // (ketama_get_server) NOTE: The algorithm depends on using signed integers
+ // for lowp, highp, and first_index. Do not change them!
+ int64_t lowp = 0;
+ int64_t highp = ring.size();
+ int64_t first_index = 0;
+ while (true) {
+ first_index = (lowp + highp) / 2;
+ if (first_index == static_cast<int64_t>(ring.size())) {
+ first_index = 0;
+ break;
+ }
+ uint64_t midval = ring[first_index].hash;
+ uint64_t midval1 = first_index == 0 ? 0 : ring[first_index - 1].hash;
+ if (h <= midval && h > midval1) {
+ break;
+ }
+ if (midval < h) {
+ lowp = first_index + 1;
+ } else {
+ highp = first_index - 1;
+ }
+ if (lowp > highp) {
+ first_index = 0;
+ break;
+ }
+ }
+ OrphanablePtr<SubchannelConnectionAttempter> subchannel_connection_attempter;
+ auto ScheduleSubchannelConnectionAttempt =
+ [&](RefCountedPtr<SubchannelInterface> subchannel) {
+ if (subchannel_connection_attempter == nullptr) {
+ subchannel_connection_attempter =
+ MakeOrphanable<SubchannelConnectionAttempter>(parent_);
+ }
+ subchannel_connection_attempter->AddSubchannel(std::move(subchannel));
+ };
+ switch (ring[first_index].subchannel->GetConnectivityState()) {
+ case GRPC_CHANNEL_READY:
+ return PickResult::Complete(
+ ring[first_index].subchannel->subchannel()->Ref());
+ case GRPC_CHANNEL_IDLE:
+ ScheduleSubchannelConnectionAttempt(
+ ring[first_index].subchannel->subchannel()->Ref());
+ ABSL_FALLTHROUGH_INTENDED;
+ case GRPC_CHANNEL_CONNECTING:
+ return PickResult::Queue();
+ default: // GRPC_CHANNEL_TRANSIENT_FAILURE
+ break;
+ }
+ ScheduleSubchannelConnectionAttempt(
+ ring[first_index].subchannel->subchannel()->Ref());
+ // Loop through remaining subchannels to find one in READY.
+ // On the way, we make sure the right set of connection attempts
+ // will happen.
+ bool found_second_subchannel = false;
+ bool found_first_non_failed = false;
+ for (size_t i = 1; i < ring.size(); ++i) {
+ const Ring::Entry& entry = ring[(first_index + i) % ring.size()];
+ if (entry.subchannel == ring[first_index].subchannel) {
+ continue;
+ }
+ grpc_connectivity_state connectivity_state =
+ entry.subchannel->GetConnectivityState();
+ if (connectivity_state == GRPC_CHANNEL_READY) {
+ return PickResult::Complete(entry.subchannel->subchannel()->Ref());
+ }
+ if (!found_second_subchannel) {
+ switch (connectivity_state) {
+ case GRPC_CHANNEL_IDLE:
+ ScheduleSubchannelConnectionAttempt(
+ entry.subchannel->subchannel()->Ref());
+ ABSL_FALLTHROUGH_INTENDED;
+ case GRPC_CHANNEL_CONNECTING:
+ return PickResult::Queue();
+ default:
+ break;
+ }
+ found_second_subchannel = true;
+ }
+ if (!found_first_non_failed) {
+ if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ ScheduleSubchannelConnectionAttempt(
+ entry.subchannel->subchannel()->Ref());
+ } else {
+ if (connectivity_state == GRPC_CHANNEL_IDLE) {
+ ScheduleSubchannelConnectionAttempt(
+ entry.subchannel->subchannel()->Ref());
+ }
+ found_first_non_failed = true;
+ }
+ }
+ }
+ return PickResult::Fail(absl::UnavailableError(
+ "xds ring hash found a subchannel that is in TRANSIENT_FAILURE state"));
+}
+
+//
+// RingHash::RingHashSubchannelList
+//
+
+void RingHash::RingHashSubchannelList::StartWatchingLocked() {
+ GPR_ASSERT(num_subchannels() != 0);
+ // Check current state of each subchannel synchronously.
+ for (size_t i = 0; i < num_subchannels(); ++i) {
+ grpc_connectivity_state state =
+ subchannel(i)->CheckConnectivityStateLocked();
+ subchannel(i)->UpdateConnectivityStateLocked(state);
+ }
+ // Start connectivity watch for each subchannel.
+ for (size_t i = 0; i < num_subchannels(); i++) {
+ if (subchannel(i)->subchannel() != nullptr) {
+ subchannel(i)->StartConnectivityWatchLocked();
+ }
+ }
+ // Send updated state to parent based on reported subchannel states.
+ // Pretend we're getting this update from the last subchannel, so that
+ // if we need to proactively start connecting, we'll start from the
+ // first subchannel.
+ UpdateRingHashConnectivityStateLocked(num_subchannels() - 1);
+}
+
+void RingHash::RingHashSubchannelList::UpdateStateCountersLocked(
+ grpc_connectivity_state old_state, grpc_connectivity_state new_state) {
+ GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN);
+ if (old_state == GRPC_CHANNEL_IDLE) {
+ GPR_ASSERT(num_idle_ > 0);
+ --num_idle_;
+ } else if (old_state == GRPC_CHANNEL_READY) {
+ GPR_ASSERT(num_ready_ > 0);
+ --num_ready_;
+ } else if (old_state == GRPC_CHANNEL_CONNECTING) {
+ GPR_ASSERT(num_connecting_ > 0);
+ --num_connecting_;
+ } else if (old_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ GPR_ASSERT(num_transient_failure_ > 0);
+ --num_transient_failure_;
+ }
+ if (new_state == GRPC_CHANNEL_IDLE) {
+ ++num_idle_;
+ } else if (new_state == GRPC_CHANNEL_READY) {
+ ++num_ready_;
+ } else if (new_state == GRPC_CHANNEL_CONNECTING) {
+ ++num_connecting_;
+ } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ ++num_transient_failure_;
+ }
+}
+
+void RingHash::RingHashSubchannelList::UpdateRingHashConnectivityStateLocked(
+ size_t index) {
+ RingHash* p = static_cast<RingHash*>(policy());
+ // Only set connectivity state if this is the current subchannel list.
+ if (p->subchannel_list_.get() != this) return;
+ // The overall aggregation rules here are:
+ // 1. If there is at least one subchannel in READY state, report READY.
+ // 2. If there are 2 or more subchannels in TRANSIENT_FAILURE state, report
+ // TRANSIENT_FAILURE.
+ // 3. If there is at least one subchannel in CONNECTING state, report
+ // CONNECTING.
+ // 4. If there is one subchannel in TRANSIENT_FAILURE state and there is
+ // more than one subchannel, report CONNECTING.
+ // 5. If there is at least one subchannel in IDLE state, report IDLE.
+ // 6. Otherwise, report TRANSIENT_FAILURE.
+ //
+ // We set start_connection_attempt to true if we match rules 2, 3, or 6.
+ grpc_connectivity_state state;
+ absl::Status status;
+ bool start_connection_attempt = false;
+ if (num_ready_ > 0) {
+ state = GRPC_CHANNEL_READY;
+ } else if (num_transient_failure_ >= 2) {
+ state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ status = absl::UnavailableError("connections to backends failing");
+ start_connection_attempt = true;
+ } else if (num_connecting_ > 0) {
+ state = GRPC_CHANNEL_CONNECTING;
+ } else if (num_transient_failure_ == 1 && num_subchannels() > 1) {
+ state = GRPC_CHANNEL_CONNECTING;
+ start_connection_attempt = true;
+ } else if (num_idle_ > 0) {
+ state = GRPC_CHANNEL_IDLE;
+ } else {
+ state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ status = absl::UnavailableError("connections to backends failing");
+ start_connection_attempt = true;
+ }
+ // Generate new picker and return it to the channel.
+ // Note that we use our own picker regardless of connectivity state.
+ p->channel_control_helper()->UpdateState(
+ state, status,
+ absl::make_unique<Picker>(p->Ref(DEBUG_LOCATION, "RingHashPicker"),
+ p->ring_));
+ // While the ring_hash policy is reporting TRANSIENT_FAILURE, it will
+ // not be getting any pick requests from the priority policy.
+ // However, because the ring_hash policy does not attempt to
+ // reconnect to subchannels unless it is getting pick requests,
+ // it will need special handling to ensure that it will eventually
+ // recover from TRANSIENT_FAILURE state once the problem is resolved.
+ // Specifically, it will make sure that it is attempting to connect to
+ // at least one subchannel at any given time. After a given subchannel
+ // fails a connection attempt, it will move on to the next subchannel
+ // in the ring. It will keep doing this until one of the subchannels
+ // successfully connects, at which point it will report READY and stop
+ // proactively trying to connect. The policy will remain in
+ // TRANSIENT_FAILURE until at least one subchannel becomes connected,
+ // even if subchannels are in state CONNECTING during that time.
+ //
+ // Note that we do the same thing when the policy is in state
+ // CONNECTING, just to ensure that we don't remain in CONNECTING state
+ // indefinitely if there are no new picks coming in.
+ if (start_connection_attempt) {
+ size_t next_index = (index + 1) % num_subchannels();
+ subchannel(next_index)->subchannel()->AttemptToConnect();
+ }
+}
+
+RefCountedPtr<RingHash::Ring> RingHash::RingHashSubchannelList::MakeRing() {
+ RingHash* p = static_cast<RingHash*>(policy());
+ return MakeRefCounted<Ring>(p, Ref(DEBUG_LOCATION, "Ring"));
+}
+
+//
+// RingHash::RingHashSubchannelData
+//
+
+void RingHash::RingHashSubchannelData::UpdateConnectivityStateLocked(
+ grpc_connectivity_state connectivity_state) {
+ RingHash* p = static_cast<RingHash*>(subchannel_list()->policy());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[RH %p] connectivity changed for subchannel %p, subchannel_list %p "
+ "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s",
+ p, subchannel(), subchannel_list(), Index(),
+ subchannel_list()->num_subchannels(),
+ ConnectivityStateName(last_connectivity_state_),
+ ConnectivityStateName(connectivity_state));
+ }
+ // Decide what state to report for the purposes of aggregation and
+ // picker behavior.
+ // 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 do not report any subsequent
+ // state changes until we go back into state READY.
+ if (last_connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ // If not transitioning to READY, ignore the update, since we want
+ // to continue to consider ourselves in TRANSIENT_FAILURE.
+ if (connectivity_state != GRPC_CHANNEL_READY) return;
+ } else if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ // If we go from READY to TF, treat it as IDLE.
+ // This transition can be caused by a "normal" connection failure, such
+ // as the server closing the connection due to a max-age setting. In
+ // this case, we want to have RPCs that hash to this subchannel wait for
+ // the reconnection attempt rather than assuming that the subchannel is
+ // bad and moving on to a subsequent subchannel in the ring.
+ if (last_connectivity_state_ == GRPC_CHANNEL_READY) {
+ connectivity_state = GRPC_CHANNEL_IDLE;
+ }
+ }
+ // Update state counters used for aggregation.
+ subchannel_list()->UpdateStateCountersLocked(last_connectivity_state_,
+ connectivity_state);
+ // Update state seen by picker.
+ connectivity_state_for_picker_.store(connectivity_state,
+ std::memory_order_relaxed);
+ // Update last seen connectivity state.
+ last_connectivity_state_ = connectivity_state;
+}
+
+void RingHash::RingHashSubchannelData::ProcessConnectivityChangeLocked(
+ grpc_connectivity_state connectivity_state) {
+ RingHash* p = static_cast<RingHash*>(subchannel_list()->policy());
+ GPR_ASSERT(subchannel() != nullptr);
+ // If the new state is TRANSIENT_FAILURE, re-resolve.
+ // Only do this if we've started watching, not at startup time.
+ // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE
+ // when the subchannel list was created, we'd wind up in a constant
+ // loop of re-resolution.
+ if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO,
+ "[RH %p] Subchannel %p has gone into TRANSIENT_FAILURE. "
+ "Requesting re-resolution",
+ p, subchannel());
+ }
+ p->channel_control_helper()->RequestReresolution();
+ }
+ // Update state counters.
+ UpdateConnectivityStateLocked(connectivity_state);
+ // Update the RH policy's connectivity state, creating new picker and new
+ // ring.
+ subchannel_list()->UpdateRingHashConnectivityStateLocked(Index());
+}
+
+//
+// RingHash
+//
+
+RingHash::RingHash(Args args) : LoadBalancingPolicy(std::move(args)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Created", this);
+ }
+}
+
+RingHash::~RingHash() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Destroying Ring Hash policy", this);
+ }
+ GPR_ASSERT(subchannel_list_ == nullptr);
+}
+
+void RingHash::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Shutting down", this);
+ }
+ shutdown_ = true;
+ subchannel_list_.reset();
+ ring_.reset(DEBUG_LOCATION, "RingHash");
+}
+
+void RingHash::ResetBackoffLocked() { subchannel_list_->ResetBackoffLocked(); }
+
+void RingHash::UpdateLocked(UpdateArgs args) {
+ config_ = std::move(args.config);
+ ServerAddressList addresses;
+ if (args.addresses.ok()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] received update with %" PRIuPTR " addresses",
+ this, args.addresses->size());
+ }
+ // Filter out any address with weight 0.
+ addresses.reserve(args.addresses->size());
+ for (ServerAddress& address : *args.addresses) {
+ const ServerAddressWeightAttribute* weight_attribute =
+ static_cast<const ServerAddressWeightAttribute*>(address.GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ if (weight_attribute == nullptr || weight_attribute->weight() > 0) {
+ addresses.emplace_back(std::move(address));
+ }
+ }
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] received update with addresses error: %s",
+ this, args.addresses.status().ToString().c_str());
+ }
+ // If we already have a subchannel list, then ignore the resolver
+ // failure and keep using the existing list.
+ if (subchannel_list_ != nullptr) return;
+ }
+ subchannel_list_ = MakeOrphanable<RingHashSubchannelList>(
+ this, &grpc_lb_ring_hash_trace, std::move(addresses), *args.args);
+ if (subchannel_list_->num_subchannels() == 0) {
+ // If the new list is empty, immediately transition to TRANSIENT_FAILURE.
+ absl::Status status =
+ args.addresses.ok() ? absl::UnavailableError(absl::StrCat(
+ "empty address list: ", args.resolution_note))
+ : args.addresses.status();
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
+ } else {
+ // Build the ring.
+ ring_ = subchannel_list_->MakeRing();
+ // Start watching the new list.
+ subchannel_list_->StartWatchingLocked();
+ }
+}
+
+//
+// factory
+//
+
+class RingHashFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<RingHash>(std::move(args));
+ }
+
+ const char* name() const override { return kRingHash; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error_handle* error) const override {
+ size_t min_ring_size;
+ size_t max_ring_size;
+ std::vector<grpc_error_handle> error_list;
+ ParseRingHashLbConfig(json, &min_ring_size, &max_ring_size, &error_list);
+ if (error_list.empty()) {
+ return MakeRefCounted<RingHashLbConfig>(min_ring_size, max_ring_size);
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "ring_hash_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ }
+};
+
+} // namespace
+
+void GrpcLbPolicyRingHashInit() {
+ LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
+ absl::make_unique<RingHashFactory>());
+}
+
+void GrpcLbPolicyRingHashShutdown() {}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h b/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
index dc176c2d..f0f86b25 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
@@ -19,9 +19,19 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json.h"
+
namespace grpc_core {
extern const char* kRequestRingHashAttribute;
+// Helper Parsing method to parse ring hash policy configs; for example, ring
+// hash size validity.
+void ParseRingHashLbConfig(const Json& json, size_t* min_ring_size,
+ size_t* max_ring_size,
+ std::vector<grpc_error_handle>* error_list);
} // namespace grpc_core
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_RING_HASH_RING_HASH_H
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
new file mode 100644
index 00000000..e7bd8089
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
@@ -0,0 +1,2542 @@
+//
+// 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 Route Lookup Service (RLS) LB policy
+//
+// The policy queries a route lookup service for the name of the actual service
+// to use. A child policy that recognizes the name as a field of its
+// configuration will take further load balancing action on the request.
+
+#include <grpc/support/port_platform.h>
+
+#include <stdlib.h>
+
+#include <algorithm>
+#include <deque>
+#include <functional>
+#include <list>
+#include <map>
+#include <random>
+#include <string>
+#include <unordered_map>
+#include <utility>
+
+#include "absl/container/inlined_vector.h"
+#include "absl/hash/hash.h"
+#include "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_join.h"
+#include "absl/strings/string_view.h"
+#include "absl/strings/strip.h"
+#include "upb/upb.hpp"
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/impl/codegen/byte_buffer_reader.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/time.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/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/backoff/backoff.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/json/json_util.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/service_config/service_config_impl.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
+#include "src/proto/grpc/lookup/v1/rls.upb.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_lb_rls_trace(false, "rls_lb");
+
+namespace {
+
+const char* kRls = "rls_experimental";
+const char kGrpc[] = "grpc";
+const char* kRlsRequestPath = "/grpc.lookup.v1.RouteLookupService/RouteLookup";
+const char* kFakeTargetFieldValue = "fake_target_field_value";
+const char* kRlsHeaderKey = "X-Google-RLS-Data";
+
+const Duration kDefaultLookupServiceTimeout = Duration::Seconds(10);
+const Duration kMaxMaxAge = Duration::Minutes(5);
+const Duration kMinExpirationTime = Duration::Seconds(5);
+const Duration kCacheBackoffInitial = Duration::Seconds(1);
+const double kCacheBackoffMultiplier = 1.6;
+const double kCacheBackoffJitter = 0.2;
+const Duration kCacheBackoffMax = Duration::Minutes(2);
+const Duration kDefaultThrottleWindowSize = Duration::Seconds(30);
+const double kDefaultThrottleRatioForSuccesses = 2.0;
+const int kDefaultThrottlePadding = 8;
+const Duration kCacheCleanupTimerInterval = Duration::Minutes(1);
+const int64_t kMaxCacheSizeBytes = 5 * 1024 * 1024;
+
+// Parsed RLS LB policy configuration.
+class RlsLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ struct KeyBuilder {
+ std::map<std::string /*key*/, std::vector<std::string /*header*/>>
+ header_keys;
+ std::string host_key;
+ std::string service_key;
+ std::string method_key;
+ std::map<std::string /*key*/, std::string /*value*/> constant_keys;
+ };
+ using KeyBuilderMap = std::unordered_map<std::string /*path*/, KeyBuilder>;
+
+ struct RouteLookupConfig {
+ KeyBuilderMap key_builder_map;
+ std::string lookup_service;
+ Duration lookup_service_timeout;
+ Duration max_age;
+ Duration stale_age;
+ int64_t cache_size_bytes = 0;
+ std::string default_target;
+ };
+
+ RlsLbConfig(RouteLookupConfig route_lookup_config,
+ std::string rls_channel_service_config, Json child_policy_config,
+ std::string child_policy_config_target_field_name,
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config)
+ : route_lookup_config_(std::move(route_lookup_config)),
+ rls_channel_service_config_(std::move(rls_channel_service_config)),
+ child_policy_config_(std::move(child_policy_config)),
+ child_policy_config_target_field_name_(
+ std::move(child_policy_config_target_field_name)),
+ default_child_policy_parsed_config_(
+ std::move(default_child_policy_parsed_config)) {}
+
+ const char* name() const override { return kRls; }
+
+ const KeyBuilderMap& key_builder_map() const {
+ return route_lookup_config_.key_builder_map;
+ }
+ const std::string& lookup_service() const {
+ return route_lookup_config_.lookup_service;
+ }
+ Duration lookup_service_timeout() const {
+ return route_lookup_config_.lookup_service_timeout;
+ }
+ Duration max_age() const { return route_lookup_config_.max_age; }
+ Duration stale_age() const { return route_lookup_config_.stale_age; }
+ int64_t cache_size_bytes() const {
+ return route_lookup_config_.cache_size_bytes;
+ }
+ const std::string& default_target() const {
+ return route_lookup_config_.default_target;
+ }
+ const std::string& rls_channel_service_config() const {
+ return rls_channel_service_config_;
+ }
+ const Json& child_policy_config() const { return child_policy_config_; }
+ const std::string& child_policy_config_target_field_name() const {
+ return child_policy_config_target_field_name_;
+ }
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config() const {
+ return default_child_policy_parsed_config_;
+ }
+
+ private:
+ RouteLookupConfig route_lookup_config_;
+ std::string rls_channel_service_config_;
+ Json child_policy_config_;
+ std::string child_policy_config_target_field_name_;
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config_;
+};
+
+// RLS LB policy.
+class RlsLb : public LoadBalancingPolicy {
+ public:
+ explicit RlsLb(Args args);
+
+ const char* name() const override { return kRls; }
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // Key to access entries in the cache and the request map.
+ struct RequestKey {
+ std::map<std::string, std::string> key_map;
+
+ bool operator==(const RequestKey& rhs) const {
+ return key_map == rhs.key_map;
+ }
+
+ template <typename H>
+ friend H AbslHashValue(H h, const RequestKey& key) {
+ std::hash<std::string> string_hasher;
+ for (auto& kv : key.key_map) {
+ h = H::combine(std::move(h), string_hasher(kv.first),
+ string_hasher(kv.second));
+ }
+ return h;
+ }
+
+ size_t Size() const {
+ size_t size = sizeof(RequestKey);
+ for (auto& kv : key_map) {
+ size += kv.first.length() + kv.second.length();
+ }
+ return size;
+ }
+
+ std::string ToString() const {
+ return absl::StrCat(
+ "{", absl::StrJoin(key_map, ",", absl::PairFormatter("=")), "}");
+ }
+ };
+
+ // Data from an RLS response.
+ struct ResponseInfo {
+ absl::Status status;
+ std::vector<std::string> targets;
+ std::string header_data;
+
+ std::string ToString() const {
+ return absl::StrFormat("{status=%s, targets=[%s], header_data=\"%s\"}",
+ status.ToString(), absl::StrJoin(targets, ","),
+ header_data);
+ }
+ };
+
+ // Wraps a child policy for a given RLS target.
+ class ChildPolicyWrapper : public DualRefCounted<ChildPolicyWrapper> {
+ public:
+ ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy, std::string target);
+
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ const std::string& target() const { return target_; }
+
+ PickResult Pick(PickArgs args) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return picker_->Pick(args);
+ }
+
+ // Updates for the child policy are handled in two phases:
+ // 1. In StartUpdate(), we parse and validate the new child policy
+ // config and store the parsed config.
+ // 2. In MaybeFinishUpdate(), we actually pass the parsed config to the
+ // child policy's UpdateLocked() method.
+ //
+ // The reason we do this is to avoid deadlocks. In StartUpdate(),
+ // if the new config fails to validate, then we need to set
+ // picker_ to an instance that will fail all requests, which
+ // requires holding the lock. However, we cannot call the child
+ // policy's UpdateLocked() method from MaybeFinishUpdate() while
+ // holding the lock, since that would cause a deadlock: the child's
+ // UpdateLocked() will call the helper's UpdateState() method, which
+ // will try to acquire the lock to set picker_. So StartUpdate() is
+ // called while we are still holding the lock, but MaybeFinishUpdate()
+ // is called after releasing it.
+ //
+ // Both methods grab the data they need from the parent object.
+ void StartUpdate() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+ // Does not take ownership of channel_args.
+ void MaybeFinishUpdate() ABSL_LOCKS_EXCLUDED(&RlsLb::mu_);
+
+ void ExitIdleLocked() {
+ if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
+ }
+
+ void ResetBackoffLocked() {
+ if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
+ }
+
+ // Gets the connectivity state of the child policy. Once the child policy
+ // reports TRANSIENT_FAILURE, the function will always return
+ // TRANSIENT_FAILURE state instead of the actual state of the child policy
+ // until the child policy reports another READY state.
+ grpc_connectivity_state connectivity_state() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return connectivity_state_;
+ }
+
+ private:
+ // ChannelControlHelper object that allows the child policy to update state
+ // with the wrapper.
+ class ChildPolicyHelper : public LoadBalancingPolicy::ChannelControlHelper {
+ public:
+ explicit ChildPolicyHelper(WeakRefCountedPtr<ChildPolicyWrapper> wrapper)
+ : wrapper_(std::move(wrapper)) {}
+ ~ChildPolicyHelper() override {
+ wrapper_.reset(DEBUG_LOCATION, "ChildPolicyHelper");
+ }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state,
+ const absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
+ void AddTraceEvent(TraceSeverity severity,
+ absl::string_view message) override;
+
+ private:
+ WeakRefCountedPtr<ChildPolicyWrapper> wrapper_;
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ std::string target_;
+
+ bool is_shutdown_ = false;
+
+ OrphanablePtr<ChildPolicyHandler> child_policy_;
+ RefCountedPtr<LoadBalancingPolicy::Config> pending_config_;
+
+ grpc_connectivity_state connectivity_state_ ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_CHANNEL_IDLE;
+ std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_
+ ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ // A picker that uses the cache and the request map in the LB policy
+ // (synchronized via a mutex) to determine how to route requests.
+ class Picker : public LoadBalancingPolicy::SubchannelPicker {
+ public:
+ explicit Picker(RefCountedPtr<RlsLb> lb_policy);
+ ~Picker() override;
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ RefCountedPtr<RlsLb> lb_policy_;
+ RefCountedPtr<RlsLbConfig> config_;
+ RefCountedPtr<ChildPolicyWrapper> default_child_policy_;
+ };
+
+ // An LRU cache with adjustable size.
+ class Cache {
+ public:
+ using Iterator = std::list<RequestKey>::iterator;
+
+ class Entry : public InternallyRefCounted<Entry> {
+ public:
+ Entry(RefCountedPtr<RlsLb> lb_policy, const RequestKey& key);
+
+ // Notify the entry when it's evicted from the cache. Performs shut down.
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ const absl::Status& status() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return status_;
+ }
+ Timestamp backoff_time() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return backoff_time_;
+ }
+ Timestamp backoff_expiration_time() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return backoff_expiration_time_;
+ }
+ Timestamp data_expiration_time() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return data_expiration_time_;
+ }
+ const std::string& header_data() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return header_data_;
+ }
+ Timestamp stale_time() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return stale_time_;
+ }
+ Timestamp min_expiration_time() const
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return min_expiration_time_;
+ }
+
+ std::unique_ptr<BackOff> TakeBackoffState()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return std::move(backoff_state_);
+ }
+
+ // Cache size of entry.
+ size_t Size() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Pick subchannel for request based on the entry's state.
+ PickResult Pick(PickArgs args) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // If the cache entry is in backoff state, resets the backoff and, if
+ // applicable, its backoff timer. The method does not update the LB
+ // policy's picker; the caller is responsible for that if necessary.
+ void ResetBackoff() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Check if the entry should be removed by the clean-up timer.
+ bool ShouldRemove() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Check if the entry can be evicted from the cache, i.e. the
+ // min_expiration_time_ has passed.
+ bool CanEvict() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Updates the entry upon reception of a new RLS response.
+ // Returns a list of child policy wrappers on which FinishUpdate()
+ // needs to be called after releasing the lock.
+ std::vector<ChildPolicyWrapper*> OnRlsResponseLocked(
+ ResponseInfo response, std::unique_ptr<BackOff> backoff_state)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Moves entry to the end of the LRU list.
+ void MarkUsed() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ class BackoffTimer : public InternallyRefCounted<BackoffTimer> {
+ public:
+ BackoffTimer(RefCountedPtr<Entry> entry, Timestamp backoff_time);
+
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ private:
+ static void OnBackoffTimer(void* args, grpc_error_handle error);
+
+ RefCountedPtr<Entry> entry_;
+ bool armed_ ABSL_GUARDED_BY(&RlsLb::mu_) = true;
+ grpc_timer backoff_timer_;
+ grpc_closure backoff_timer_callback_;
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+
+ bool is_shutdown_ ABSL_GUARDED_BY(&RlsLb::mu_) = false;
+
+ // Backoff states
+ absl::Status status_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ std::unique_ptr<BackOff> backoff_state_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ Timestamp backoff_time_ ABSL_GUARDED_BY(&RlsLb::mu_) =
+ Timestamp::InfPast();
+ Timestamp backoff_expiration_time_ ABSL_GUARDED_BY(&RlsLb::mu_) =
+ Timestamp::InfPast();
+ OrphanablePtr<BackoffTimer> backoff_timer_;
+
+ // RLS response states
+ std::vector<RefCountedPtr<ChildPolicyWrapper>> child_policy_wrappers_
+ ABSL_GUARDED_BY(&RlsLb::mu_);
+ std::string header_data_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ Timestamp data_expiration_time_ ABSL_GUARDED_BY(&RlsLb::mu_) =
+ Timestamp::InfPast();
+ Timestamp stale_time_ ABSL_GUARDED_BY(&RlsLb::mu_) = Timestamp::InfPast();
+
+ Timestamp min_expiration_time_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ Cache::Iterator lru_iterator_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ explicit Cache(RlsLb* lb_policy);
+
+ // Finds an entry from the cache that corresponds to a key. If an entry is
+ // not found, nullptr is returned. Otherwise, the entry is considered
+ // recently used and its order in the LRU list of the cache is updated.
+ Entry* Find(const RequestKey& key)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Finds an entry from the cache that corresponds to a key. If an entry is
+ // not found, an entry is created, inserted in the cache, and returned to
+ // the caller. Otherwise, the entry found is returned to the caller. The
+ // entry returned to the user is considered recently used and its order in
+ // the LRU list of the cache is updated.
+ Entry* FindOrInsert(const RequestKey& key)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Resizes the cache. If the new cache size is greater than the current size
+ // of the cache, do nothing. Otherwise, evict the oldest entries that
+ // exceed the new size limit of the cache.
+ void Resize(size_t bytes) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Resets backoff of all the cache entries.
+ void ResetAllBackoff() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Shutdown the cache; clean-up and orphan all the stored cache entries.
+ void Shutdown() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ static void OnCleanupTimer(void* arg, grpc_error_handle error);
+
+ // Returns the entry size for a given key.
+ static size_t EntrySizeForKey(const RequestKey& key);
+
+ // Evicts oversized cache elements when the current size is greater than
+ // the specified limit.
+ void MaybeShrinkSize(size_t bytes)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ RlsLb* lb_policy_;
+
+ size_t size_limit_ ABSL_GUARDED_BY(&RlsLb::mu_) = 0;
+ size_t size_ ABSL_GUARDED_BY(&RlsLb::mu_) = 0;
+
+ std::list<RequestKey> lru_list_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ std::unordered_map<RequestKey, OrphanablePtr<Entry>, absl::Hash<RequestKey>>
+ map_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ grpc_timer cleanup_timer_;
+ grpc_closure timer_callback_;
+ };
+
+ // Channel for communicating with the RLS server.
+ // Contains throttling logic for RLS requests.
+ class RlsChannel : public InternallyRefCounted<RlsChannel> {
+ public:
+ explicit RlsChannel(RefCountedPtr<RlsLb> lb_policy);
+
+ // Shuts down the channel.
+ void Orphan() override;
+
+ // Starts an RLS call.
+ // If stale_entry is non-null, it points to the entry containing
+ // stale data for the key.
+ void StartRlsCall(const RequestKey& key, Cache::Entry* stale_entry)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Reports the result of an RLS call to the throttle.
+ void ReportResponseLocked(bool response_succeeded)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Checks if a proposed RLS call should be throttled.
+ bool ShouldThrottle() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return throttle_.ShouldThrottle();
+ }
+
+ // Resets the channel's backoff.
+ void ResetBackoff();
+
+ grpc_channel* channel() const { return channel_; }
+
+ private:
+ // Watches the state of the RLS channel. Notifies the LB policy when
+ // the channel was previously in TRANSIENT_FAILURE and then becomes READY.
+ class StateWatcher : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit StateWatcher(RefCountedPtr<RlsChannel> rls_channel)
+ : AsyncConnectivityStateWatcherInterface(
+ rls_channel->lb_policy_->work_serializer()),
+ rls_channel_(std::move(rls_channel)) {}
+
+ private:
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const absl::Status& status) override;
+
+ RefCountedPtr<RlsChannel> rls_channel_;
+ bool was_transient_failure_ = false;
+ };
+
+ // Throttle state for RLS requests.
+ class Throttle {
+ public:
+ explicit Throttle(
+ Duration window_size = kDefaultThrottleWindowSize,
+ float ratio_for_successes = kDefaultThrottleRatioForSuccesses,
+ int padding = kDefaultThrottlePadding)
+ : window_size_(window_size),
+ ratio_for_successes_(ratio_for_successes),
+ padding_(padding) {}
+
+ bool ShouldThrottle() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ void RegisterResponse(bool success)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ Duration window_size_;
+ double ratio_for_successes_;
+ int padding_;
+ std::mt19937 rng_{std::random_device()()};
+
+ // Logged timestamp of requests.
+ std::deque<Timestamp> requests_ ABSL_GUARDED_BY(&RlsLb::mu_);
+
+ // Logged timestamps of failures.
+ std::deque<Timestamp> failures_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ bool is_shutdown_ = false;
+
+ grpc_channel* channel_ = nullptr;
+ RefCountedPtr<channelz::ChannelNode> parent_channelz_node_;
+ StateWatcher* watcher_ = nullptr;
+ Throttle throttle_ ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ // A pending RLS request. Instances will be tracked in request_map_.
+ class RlsRequest : public InternallyRefCounted<RlsRequest> {
+ public:
+ // Asynchronously starts a call on rls_channel for key.
+ // Stores backoff_state, which will be transferred to the data cache
+ // if the RLS request fails.
+ RlsRequest(RefCountedPtr<RlsLb> lb_policy, RlsLb::RequestKey key,
+ RefCountedPtr<RlsChannel> rls_channel,
+ std::unique_ptr<BackOff> backoff_state,
+ grpc_lookup_v1_RouteLookupRequest_Reason reason,
+ std::string stale_header_data);
+ ~RlsRequest() override;
+
+ // Shuts down the request. If the request is still in flight, it is
+ // cancelled, in which case no response will be added to the cache.
+ void Orphan() override;
+
+ private:
+ // Callback to be invoked to start the call.
+ static void StartCall(void* arg, grpc_error_handle error);
+
+ // Helper for StartCall() that runs within the WorkSerializer.
+ void StartCallLocked();
+
+ // Callback to be invoked when the call is completed.
+ static void OnRlsCallComplete(void* arg, grpc_error_handle error);
+
+ // Call completion callback running on LB policy WorkSerializer.
+ void OnRlsCallCompleteLocked(grpc_error_handle error);
+
+ grpc_byte_buffer* MakeRequestProto();
+ ResponseInfo ParseResponseProto();
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ RlsLb::RequestKey key_;
+ RefCountedPtr<RlsChannel> rls_channel_;
+ std::unique_ptr<BackOff> backoff_state_;
+ grpc_lookup_v1_RouteLookupRequest_Reason reason_;
+ std::string stale_header_data_;
+
+ // RLS call state.
+ Timestamp deadline_;
+ grpc_closure call_start_cb_;
+ grpc_closure call_complete_cb_;
+ grpc_call* call_ = nullptr;
+ grpc_byte_buffer* send_message_ = nullptr;
+ grpc_metadata_array recv_initial_metadata_;
+ grpc_byte_buffer* recv_message_ = nullptr;
+ grpc_metadata_array recv_trailing_metadata_;
+ grpc_status_code status_recv_;
+ grpc_slice status_details_recv_;
+ };
+
+ void ShutdownLocked() override;
+
+ // Returns a new picker to the channel to trigger reprocessing of
+ // pending picks. Schedules the actual picker update on the ExecCtx
+ // to be run later, so it's safe to invoke this while holding the lock.
+ void UpdatePickerAsync();
+ // Hops into work serializer and calls UpdatePickerLocked().
+ static void UpdatePickerCallback(void* arg, grpc_error_handle error);
+ // Updates the picker in the work serializer.
+ void UpdatePickerLocked() ABSL_LOCKS_EXCLUDED(&mu_);
+
+ // The name of the server for the channel.
+ std::string server_name_;
+
+ // Mutex to guard LB policy state that is accessed by the picker.
+ Mutex mu_;
+ bool is_shutdown_ ABSL_GUARDED_BY(mu_) = false;
+ Cache cache_ ABSL_GUARDED_BY(mu_);
+ // Maps an RLS request key to an RlsRequest object that represents a pending
+ // RLS request.
+ std::unordered_map<RequestKey, OrphanablePtr<RlsRequest>,
+ absl::Hash<RequestKey>>
+ request_map_ ABSL_GUARDED_BY(mu_);
+ // The channel on which RLS requests are sent.
+ // Note that this channel may be swapped out when the RLS policy gets
+ // an update. However, when that happens, any existing entries in
+ // request_map_ will continue to use the previous channel.
+ OrphanablePtr<RlsChannel> rls_channel_ ABSL_GUARDED_BY(mu_);
+
+ // Accessed only from within WorkSerializer.
+ absl::StatusOr<ServerAddressList> addresses_;
+ const grpc_channel_args* channel_args_ = nullptr;
+ RefCountedPtr<RlsLbConfig> config_;
+ RefCountedPtr<ChildPolicyWrapper> default_child_policy_;
+ std::map<std::string /*target*/, ChildPolicyWrapper*> child_policy_map_;
+};
+
+//
+// RlsLb::ChildPolicyWrapper
+//
+
+RlsLb::ChildPolicyWrapper::ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy,
+ std::string target)
+ : DualRefCounted<ChildPolicyWrapper>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "ChildPolicyWrapper"
+ : nullptr),
+ lb_policy_(lb_policy),
+ target_(std::move(target)),
+ picker_(absl::make_unique<QueuePicker>(std::move(lb_policy))) {
+ lb_policy_->child_policy_map_.emplace(target_, this);
+}
+
+void RlsLb::ChildPolicyWrapper::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s]: shutdown",
+ lb_policy_.get(), this, target_.c_str());
+ }
+ is_shutdown_ = true;
+ lb_policy_->child_policy_map_.erase(target_);
+ if (child_policy_ != nullptr) {
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ lb_policy_->interested_parties());
+ child_policy_.reset();
+ }
+ picker_.reset();
+}
+
+grpc_error_handle InsertOrUpdateChildPolicyField(const std::string& field,
+ const std::string& value,
+ Json* config) {
+ if (config->type() != Json::Type::ARRAY) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy configuration is not an array");
+ }
+ std::vector<grpc_error_handle> error_list;
+ for (Json& child_json : *config->mutable_array()) {
+ if (child_json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item is not an object"));
+ } else {
+ Json::Object& child = *child_json.mutable_object();
+ if (child.size() != 1) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item contains more than one field"));
+ } else {
+ Json& child_config_json = child.begin()->second;
+ if (child_config_json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item config is not an object"));
+ } else {
+ Json::Object& child_config = *child_config_json.mutable_object();
+ child_config[field] = Json(value);
+ }
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("errors when inserting field \"", field,
+ "\" for child policy"),
+ &error_list);
+}
+
+void RlsLb::ChildPolicyWrapper::StartUpdate() {
+ Json child_policy_config = lb_policy_->config_->child_policy_config();
+ grpc_error_handle error = InsertOrUpdateChildPolicyField(
+ lb_policy_->config_->child_policy_config_target_field_name(), target_,
+ &child_policy_config);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s]: validating update, config: %s",
+ lb_policy_.get(), this, target_.c_str(),
+ child_policy_config.Dump().c_str());
+ }
+ pending_config_ = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ child_policy_config, &error);
+ // Returned RLS target fails the validation.
+ if (error != GRPC_ERROR_NONE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s]: config failed to parse: "
+ "%s; config: %s",
+ lb_policy_.get(), this, target_.c_str(),
+ grpc_error_std_string(error).c_str(),
+ child_policy_config.Dump().c_str());
+ }
+ pending_config_.reset();
+ picker_ = absl::make_unique<TransientFailurePicker>(
+ grpc_error_to_absl_status(error));
+ GRPC_ERROR_UNREF(error);
+ child_policy_.reset();
+ }
+}
+
+void RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() {
+ // If pending_config_ is not set, that means StartUpdate() failed, so
+ // there's nothing to do here.
+ if (pending_config_ == nullptr) return;
+ // If child policy doesn't yet exist, create it.
+ if (child_policy_ == nullptr) {
+ Args create_args;
+ create_args.work_serializer = lb_policy_->work_serializer();
+ create_args.channel_control_helper = absl::make_unique<ChildPolicyHelper>(
+ WeakRef(DEBUG_LOCATION, "ChildPolicyHelper"));
+ create_args.args = lb_policy_->channel_args_;
+ child_policy_ = MakeOrphanable<ChildPolicyHandler>(std::move(create_args),
+ &grpc_lb_rls_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s], created new child policy "
+ "handler %p",
+ lb_policy_.get(), this, target_.c_str(), child_policy_.get());
+ }
+ grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
+ lb_policy_->interested_parties());
+ }
+ // Send the child the updated config.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s], updating child policy "
+ "handler %p",
+ lb_policy_.get(), this, target_.c_str(), child_policy_.get());
+ }
+ UpdateArgs update_args;
+ update_args.config = std::move(pending_config_);
+ update_args.addresses = lb_policy_->addresses_;
+ update_args.args = grpc_channel_args_copy(lb_policy_->channel_args_);
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+//
+// RlsLb::ChildPolicyWrapper::ChildPolicyHelper
+//
+
+RefCountedPtr<SubchannelInterface>
+RlsLb::ChildPolicyWrapper::ChildPolicyHelper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "CreateSubchannel() for %s",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this, address.ToString().c_str());
+ }
+ if (wrapper_->is_shutdown_) return nullptr;
+ return wrapper_->lb_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::UpdateState(
+ grpc_connectivity_state state, const absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "UpdateState(state=%s, status=%s, picker=%p)",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this, ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
+ }
+ {
+ MutexLock lock(&wrapper_->lb_policy_->mu_);
+ if (wrapper_->is_shutdown_) return;
+ if (wrapper_->connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE &&
+ state != GRPC_CHANNEL_READY) {
+ return;
+ }
+ wrapper_->connectivity_state_ = state;
+ GPR_DEBUG_ASSERT(picker != nullptr);
+ if (picker != nullptr) {
+ wrapper_->picker_ = std::move(picker);
+ }
+ }
+ wrapper_->lb_policy_->UpdatePickerLocked();
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::RequestReresolution() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "RequestReresolution",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this);
+ }
+ if (wrapper_->is_shutdown_) return;
+ wrapper_->lb_policy_->channel_control_helper()->RequestReresolution();
+}
+
+absl::string_view RlsLb::ChildPolicyWrapper::ChildPolicyHelper::GetAuthority() {
+ return wrapper_->lb_policy_->channel_control_helper()->GetAuthority();
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::AddTraceEvent(
+ TraceSeverity severity, absl::string_view message) {
+ if (wrapper_->is_shutdown_) return;
+ wrapper_->lb_policy_->channel_control_helper()->AddTraceEvent(severity,
+ message);
+}
+
+//
+// RlsLb::Picker
+//
+
+// Builds the key to be used for a request based on path and initial_metadata.
+std::map<std::string, std::string> BuildKeyMap(
+ const RlsLbConfig::KeyBuilderMap& key_builder_map, absl::string_view path,
+ const std::string& host,
+ const LoadBalancingPolicy::MetadataInterface* initial_metadata) {
+ size_t last_slash_pos = path.npos; // May need this a few times, so cache it.
+ // Find key builder for this path.
+ auto it = key_builder_map.find(std::string(path));
+ if (it == key_builder_map.end()) {
+ // Didn't find exact match, try method wildcard.
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ std::string service(path.substr(0, last_slash_pos + 1));
+ it = key_builder_map.find(service);
+ if (it == key_builder_map.end()) return {};
+ }
+ const RlsLbConfig::KeyBuilder* key_builder = &it->second;
+ // Construct key map using key builder.
+ std::map<std::string, std::string> key_map;
+ // Add header keys.
+ for (const auto& p : key_builder->header_keys) {
+ const std::string& key = p.first;
+ const std::vector<std::string>& header_names = p.second;
+ for (const std::string& header_name : header_names) {
+ std::string buffer;
+ absl::optional<absl::string_view> value =
+ initial_metadata->Lookup(header_name, &buffer);
+ if (value.has_value()) {
+ key_map[key] = std::string(*value);
+ break;
+ }
+ }
+ }
+ // Add constant keys.
+ key_map.insert(key_builder->constant_keys.begin(),
+ key_builder->constant_keys.end());
+ // Add host key.
+ if (!key_builder->host_key.empty()) {
+ key_map[key_builder->host_key] = host;
+ }
+ // Add service key.
+ if (!key_builder->service_key.empty()) {
+ if (last_slash_pos == path.npos) {
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ }
+ key_map[key_builder->service_key] =
+ std::string(path.substr(1, last_slash_pos - 1));
+ }
+ // Add method key.
+ if (!key_builder->method_key.empty()) {
+ if (last_slash_pos == path.npos) {
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ }
+ key_map[key_builder->method_key] =
+ std::string(path.substr(last_slash_pos + 1));
+ }
+ return key_map;
+}
+
+RlsLb::Picker::Picker(RefCountedPtr<RlsLb> lb_policy)
+ : lb_policy_(std::move(lb_policy)), config_(lb_policy_->config_) {
+ if (lb_policy_->default_child_policy_ != nullptr) {
+ default_child_policy_ =
+ lb_policy_->default_child_policy_->Ref(DEBUG_LOCATION, "Picker");
+ }
+}
+
+RlsLb::Picker::~Picker() {
+ // It's not safe to unref the default child policy in the picker,
+ // since that needs to be done in the WorkSerializer.
+ if (default_child_policy_ != nullptr) {
+ auto* default_child_policy = default_child_policy_.release();
+ lb_policy_->work_serializer()->Run(
+ [default_child_policy]() {
+ default_child_policy->Unref(DEBUG_LOCATION, "Picker");
+ },
+ DEBUG_LOCATION);
+ }
+}
+
+LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) {
+ // Construct key for request.
+ RequestKey key = {BuildKeyMap(config_->key_builder_map(), args.path,
+ lb_policy_->server_name_,
+ args.initial_metadata)};
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: request keys: %s",
+ lb_policy_.get(), this, key.ToString().c_str());
+ }
+ Timestamp now = ExecCtx::Get()->Now();
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) {
+ return PickResult::Fail(
+ absl::UnavailableError("LB policy already shut down"));
+ }
+ // Check if there's a cache entry.
+ Cache::Entry* entry = lb_policy_->cache_.Find(key);
+ // If there is no cache entry, or if the cache entry is not in backoff
+ // and has a stale time in the past, and there is not already a
+ // pending RLS request for this key, then try to start a new RLS request.
+ if ((entry == nullptr ||
+ (entry->stale_time() < now && entry->backoff_time() < now)) &&
+ lb_policy_->request_map_.find(key) == lb_policy_->request_map_.end()) {
+ // Check if requests are being throttled.
+ if (lb_policy_->rls_channel_->ShouldThrottle()) {
+ // Request is throttled.
+ // If there is no non-expired data in the cache, then we use the
+ // default target if set, or else we fail the pick.
+ if (entry == nullptr || entry->data_expiration_time() < now) {
+ if (default_child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call throttled; "
+ "using default target",
+ lb_policy_.get(), this);
+ }
+ return default_child_policy_->Pick(args);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call throttled; failing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Fail(
+ absl::UnavailableError("RLS request throttled"));
+ }
+ }
+ // Start the RLS call.
+ lb_policy_->rls_channel_->StartRlsCall(
+ key, (entry == nullptr || entry->data_expiration_time() < now) ? nullptr
+ : entry);
+ }
+ // If the cache entry exists, see if it has usable data.
+ if (entry != nullptr) {
+ // If the entry has non-expired data, use it.
+ if (entry->data_expiration_time() >= now) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: using cache entry %p",
+ lb_policy_.get(), this, entry);
+ }
+ return entry->Pick(args);
+ }
+ // If the entry is in backoff, then use the default target if set,
+ // or else fail the pick.
+ if (entry->backoff_time() >= now) {
+ if (default_child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call in backoff; using default target",
+ lb_policy_.get(), this);
+ }
+ return default_child_policy_->Pick(args);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call in backoff; failing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Fail(entry->status());
+ }
+ }
+ // RLS call pending. Queue the pick.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: RLS request pending; queuing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Queue();
+}
+
+//
+// RlsLb::Cache::Entry::BackoffTimer
+//
+
+RlsLb::Cache::Entry::BackoffTimer::BackoffTimer(RefCountedPtr<Entry> entry,
+ Timestamp backoff_time)
+ : entry_(std::move(entry)) {
+ GRPC_CLOSURE_INIT(&backoff_timer_callback_, OnBackoffTimer, this, nullptr);
+ Ref(DEBUG_LOCATION, "BackoffTimer").release();
+ grpc_timer_init(&backoff_timer_, backoff_time, &backoff_timer_callback_);
+}
+
+void RlsLb::Cache::Entry::BackoffTimer::Orphan() {
+ if (armed_) {
+ armed_ = false;
+ grpc_timer_cancel(&backoff_timer_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::Cache::Entry::BackoffTimer::OnBackoffTimer(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<BackoffTimer*>(arg);
+ self->entry_->lb_policy_->work_serializer()->Run(
+ [self]() {
+ RefCountedPtr<BackoffTimer> backoff_timer(self);
+ {
+ MutexLock lock(&self->entry_->lb_policy_->mu_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s, armed_=%d: "
+ "backoff timer fired",
+ self->entry_->lb_policy_.get(), self->entry_.get(),
+ self->entry_->is_shutdown_
+ ? "(shut down)"
+ : self->entry_->lru_iterator_->ToString().c_str(),
+ self->armed_);
+ }
+ bool cancelled = !self->armed_;
+ self->armed_ = false;
+ if (cancelled) return;
+ }
+ // The pick was in backoff state and there could be a pick queued if
+ // wait_for_ready is true. We'll update the picker for that case.
+ self->entry_->lb_policy_->UpdatePickerLocked();
+ },
+ DEBUG_LOCATION);
+}
+
+//
+// RlsLb::Cache::Entry
+//
+
+std::unique_ptr<BackOff> MakeCacheEntryBackoff() {
+ return absl::make_unique<BackOff>(
+ BackOff::Options()
+ .set_initial_backoff(kCacheBackoffInitial)
+ .set_multiplier(kCacheBackoffMultiplier)
+ .set_jitter(kCacheBackoffJitter)
+ .set_max_backoff(kCacheBackoffMax));
+}
+
+RlsLb::Cache::Entry::Entry(RefCountedPtr<RlsLb> lb_policy,
+ const RequestKey& key)
+ : InternallyRefCounted<Entry>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "CacheEntry" : nullptr),
+ lb_policy_(std::move(lb_policy)),
+ backoff_state_(MakeCacheEntryBackoff()),
+ min_expiration_time_(ExecCtx::Get()->Now() + kMinExpirationTime),
+ lru_iterator_(lb_policy_->cache_.lru_list_.insert(
+ lb_policy_->cache_.lru_list_.end(), key)) {}
+
+void RlsLb::Cache::Entry::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s: cache entry evicted",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str());
+ }
+ is_shutdown_ = true;
+ lb_policy_->cache_.lru_list_.erase(lru_iterator_);
+ lru_iterator_ = lb_policy_->cache_.lru_list_.end(); // Just in case.
+ backoff_state_.reset();
+ if (backoff_timer_ != nullptr) {
+ backoff_timer_.reset();
+ lb_policy_->UpdatePickerAsync();
+ }
+ child_policy_wrappers_.clear();
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+size_t RlsLb::Cache::Entry::Size() const {
+ // lru_iterator_ is not valid once we're shut down.
+ GPR_ASSERT(!is_shutdown_);
+ return lb_policy_->cache_.EntrySizeForKey(*lru_iterator_);
+}
+
+LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) {
+ for (const auto& child_policy_wrapper : child_policy_wrappers_) {
+ if (child_policy_wrapper->connectivity_state() ==
+ GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: target %s in state "
+ "TRANSIENT_FAILURE; skipping",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str(),
+ child_policy_wrapper->target().c_str());
+ }
+ continue;
+ }
+ // Child policy not in TRANSIENT_FAILURE, so delegate.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: target %s in state %s; "
+ "delegating",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str(),
+ child_policy_wrapper->target().c_str(),
+ ConnectivityStateName(child_policy_wrapper->connectivity_state()));
+ }
+ // Add header data.
+ if (!header_data_.empty()) {
+ char* copied_header_data =
+ static_cast<char*>(args.call_state->Alloc(header_data_.length() + 1));
+ strcpy(copied_header_data, header_data_.c_str());
+ args.initial_metadata->Add(kRlsHeaderKey, copied_header_data);
+ }
+ return child_policy_wrapper->Pick(args);
+ }
+ // No child policy found.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: no healthy target found; "
+ "failing pick",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str());
+ }
+ return PickResult::Fail(
+ absl::UnavailableError("all RLS targets unreachable"));
+}
+
+void RlsLb::Cache::Entry::ResetBackoff() {
+ backoff_time_ = Timestamp::InfPast();
+ backoff_timer_.reset();
+}
+
+bool RlsLb::Cache::Entry::ShouldRemove() const {
+ Timestamp now = ExecCtx::Get()->Now();
+ return data_expiration_time_ < now && backoff_expiration_time_ < now;
+}
+
+bool RlsLb::Cache::Entry::CanEvict() const {
+ Timestamp now = ExecCtx::Get()->Now();
+ return min_expiration_time_ < now;
+}
+
+void RlsLb::Cache::Entry::MarkUsed() {
+ auto& lru_list = lb_policy_->cache_.lru_list_;
+ auto new_it = lru_list.insert(lru_list.end(), *lru_iterator_);
+ lru_list.erase(lru_iterator_);
+ lru_iterator_ = new_it;
+}
+
+std::vector<RlsLb::ChildPolicyWrapper*>
+RlsLb::Cache::Entry::OnRlsResponseLocked(
+ ResponseInfo response, std::unique_ptr<BackOff> backoff_state) {
+ // Move the entry to the end of the LRU list.
+ MarkUsed();
+ // If the request failed, store the failed status and update the
+ // backoff state.
+ if (!response.status.ok()) {
+ status_ = response.status;
+ if (backoff_state != nullptr) {
+ backoff_state_ = std::move(backoff_state);
+ } else {
+ backoff_state_ = MakeCacheEntryBackoff();
+ }
+ backoff_time_ = backoff_state_->NextAttemptTime();
+ Timestamp now = ExecCtx::Get()->Now();
+ backoff_expiration_time_ = now + (backoff_time_ - now) * 2;
+ backoff_timer_ = MakeOrphanable<BackoffTimer>(
+ Ref(DEBUG_LOCATION, "BackoffTimer"), backoff_time_);
+ lb_policy_->UpdatePickerAsync();
+ return {};
+ }
+ // Request succeeded, so store the result.
+ header_data_ = std::move(response.header_data);
+ Timestamp now = ExecCtx::Get()->Now();
+ data_expiration_time_ = now + lb_policy_->config_->max_age();
+ stale_time_ = now + lb_policy_->config_->stale_age();
+ status_ = absl::OkStatus();
+ backoff_state_.reset();
+ backoff_time_ = Timestamp::InfPast();
+ backoff_expiration_time_ = Timestamp::InfPast();
+ // Check if we need to update this list of targets.
+ bool targets_changed = [&]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ if (child_policy_wrappers_.size() != response.targets.size()) return true;
+ for (size_t i = 0; i < response.targets.size(); ++i) {
+ if (child_policy_wrappers_[i]->target() != response.targets[i]) {
+ return true;
+ }
+ }
+ return false;
+ }();
+ if (!targets_changed) {
+ // Targets didn't change, so we're not updating the list of child
+ // policies. Return a new picker so that any queued requests can be
+ // re-processed.
+ lb_policy_->UpdatePickerAsync();
+ return {};
+ }
+ // Target list changed, so update it.
+ std::set<absl::string_view> old_targets;
+ for (RefCountedPtr<ChildPolicyWrapper>& child_policy_wrapper :
+ child_policy_wrappers_) {
+ old_targets.emplace(child_policy_wrapper->target());
+ }
+ bool update_picker = false;
+ std::vector<ChildPolicyWrapper*> child_policies_to_finish_update;
+ std::vector<RefCountedPtr<ChildPolicyWrapper>> new_child_policy_wrappers;
+ new_child_policy_wrappers.reserve(response.targets.size());
+ for (std::string& target : response.targets) {
+ auto it = lb_policy_->child_policy_map_.find(target);
+ if (it == lb_policy_->child_policy_map_.end()) {
+ auto new_child = MakeRefCounted<ChildPolicyWrapper>(
+ lb_policy_->Ref(DEBUG_LOCATION, "ChildPolicyWrapper"), target);
+ new_child->StartUpdate();
+ child_policies_to_finish_update.push_back(new_child.get());
+ new_child_policy_wrappers.emplace_back(std::move(new_child));
+ } else {
+ new_child_policy_wrappers.emplace_back(
+ it->second->Ref(DEBUG_LOCATION, "CacheEntry"));
+ // If the target already existed but was not previously used for
+ // this key, then we'll need to update the picker, since we
+ // didn't actually create a new child policy, which would have
+ // triggered an RLS picker update when it returned its first picker.
+ if (old_targets.find(target) == old_targets.end()) {
+ update_picker = true;
+ }
+ }
+ }
+ child_policy_wrappers_ = std::move(new_child_policy_wrappers);
+ if (update_picker) {
+ lb_policy_->UpdatePickerAsync();
+ }
+ return child_policies_to_finish_update;
+}
+
+//
+// RlsLb::Cache
+//
+
+RlsLb::Cache::Cache(RlsLb* lb_policy) : lb_policy_(lb_policy) {
+ Timestamp now = ExecCtx::Get()->Now();
+ lb_policy_->Ref(DEBUG_LOCATION, "CacheCleanupTimer").release();
+ GRPC_CLOSURE_INIT(&timer_callback_, OnCleanupTimer, this, nullptr);
+ grpc_timer_init(&cleanup_timer_, now + kCacheCleanupTimerInterval,
+ &timer_callback_);
+}
+
+RlsLb::Cache::Entry* RlsLb::Cache::Find(const RequestKey& key) {
+ auto it = map_.find(key);
+ if (it == map_.end()) return nullptr;
+ it->second->MarkUsed();
+ return it->second.get();
+}
+
+RlsLb::Cache::Entry* RlsLb::Cache::FindOrInsert(const RequestKey& key) {
+ auto it = map_.find(key);
+ // If not found, create new entry.
+ if (it == map_.end()) {
+ size_t entry_size = EntrySizeForKey(key);
+ MaybeShrinkSize(size_limit_ - std::min(size_limit_, entry_size));
+ Entry* entry =
+ new Entry(lb_policy_->Ref(DEBUG_LOCATION, "CacheEntry"), key);
+ map_.emplace(key, OrphanablePtr<Entry>(entry));
+ size_ += entry_size;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] key=%s: cache entry added, entry=%p",
+ lb_policy_, key.ToString().c_str(), entry);
+ }
+ return entry;
+ }
+ // Entry found, so use it.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] key=%s: found cache entry %p", lb_policy_,
+ key.ToString().c_str(), it->second.get());
+ }
+ it->second->MarkUsed();
+ return it->second.get();
+}
+
+void RlsLb::Cache::Resize(size_t bytes) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] resizing cache to %" PRIuPTR " bytes",
+ lb_policy_, bytes);
+ }
+ size_limit_ = bytes;
+ MaybeShrinkSize(size_limit_);
+}
+
+void RlsLb::Cache::ResetAllBackoff() {
+ for (auto& p : map_) {
+ p.second->ResetBackoff();
+ }
+ lb_policy_->UpdatePickerAsync();
+}
+
+void RlsLb::Cache::Shutdown() {
+ map_.clear();
+ lru_list_.clear();
+ grpc_timer_cancel(&cleanup_timer_);
+}
+
+void RlsLb::Cache::OnCleanupTimer(void* arg, grpc_error_handle error) {
+ Cache* cache = static_cast<Cache*>(arg);
+ (void)GRPC_ERROR_REF(error);
+ cache->lb_policy_->work_serializer()->Run(
+ [cache, error]() {
+ RefCountedPtr<RlsLb> lb_policy(cache->lb_policy_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] cache cleanup timer fired (%s)",
+ cache->lb_policy_, grpc_error_std_string(error).c_str());
+ }
+ if (error == GRPC_ERROR_CANCELLED) return;
+ MutexLock lock(&lb_policy->mu_);
+ if (lb_policy->is_shutdown_) return;
+ for (auto it = cache->map_.begin(); it != cache->map_.end();) {
+ if (GPR_UNLIKELY(it->second->ShouldRemove() &&
+ it->second->CanEvict())) {
+ cache->size_ -= it->second->Size();
+ it = cache->map_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+ Timestamp now = ExecCtx::Get()->Now();
+ lb_policy.release();
+ grpc_timer_init(&cache->cleanup_timer_,
+ now + kCacheCleanupTimerInterval,
+ &cache->timer_callback_);
+ },
+ DEBUG_LOCATION);
+}
+
+size_t RlsLb::Cache::EntrySizeForKey(const RequestKey& key) {
+ // Key is stored twice, once in LRU list and again in the cache map.
+ return (key.Size() * 2) + sizeof(Entry);
+}
+
+void RlsLb::Cache::MaybeShrinkSize(size_t bytes) {
+ while (size_ > bytes) {
+ auto lru_it = lru_list_.begin();
+ if (GPR_UNLIKELY(lru_it == lru_list_.end())) break;
+ auto map_it = map_.find(*lru_it);
+ GPR_ASSERT(map_it != map_.end());
+ if (!map_it->second->CanEvict()) break;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] LRU eviction: removing entry %p %s",
+ lb_policy_, map_it->second.get(), lru_it->ToString().c_str());
+ }
+ size_ -= map_it->second->Size();
+ map_.erase(map_it);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] LRU pass complete: desired size=%" PRIuPTR
+ " size=%" PRIuPTR,
+ lb_policy_, bytes, size_);
+ }
+}
+
+//
+// RlsLb::RlsChannel::StateWatcher
+//
+
+void RlsLb::RlsChannel::StateWatcher::OnConnectivityStateChange(
+ grpc_connectivity_state new_state, const absl::Status& status) {
+ auto* lb_policy = rls_channel_->lb_policy_.get();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] RlsChannel=%p StateWatcher=%p: "
+ "state changed to %s (%s)",
+ lb_policy, rls_channel_.get(), this,
+ ConnectivityStateName(new_state), status.ToString().c_str());
+ }
+ if (rls_channel_->is_shutdown_) return;
+ MutexLock lock(&lb_policy->mu_);
+ if (new_state == GRPC_CHANNEL_READY && was_transient_failure_) {
+ was_transient_failure_ = false;
+ // Reset the backoff of all cache entries, so that we don't
+ // double-penalize if an RLS request fails while the channel is
+ // down, since the throttling for the channel being down is handled
+ // at the channel level instead of in the individual cache entries.
+ lb_policy->cache_.ResetAllBackoff();
+ } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ was_transient_failure_ = true;
+ }
+}
+
+//
+// RlsLb::RlsChannel::Throttle
+//
+
+bool RlsLb::RlsChannel::Throttle::ShouldThrottle() {
+ Timestamp now = ExecCtx::Get()->Now();
+ while (!requests_.empty() && now - requests_.front() > window_size_) {
+ requests_.pop_front();
+ }
+ while (!failures_.empty() && now - failures_.front() > window_size_) {
+ failures_.pop_front();
+ }
+ // Compute probability of throttling.
+ float num_requests = requests_.size();
+ float num_successes = num_requests - failures_.size();
+ // Note: it's possible that this ratio will be negative, in which case
+ // no throttling will be done.
+ float throttle_probability =
+ (num_requests - (num_successes * ratio_for_successes_)) /
+ (num_requests + padding_);
+ // Generate a random number for the request.
+ std::uniform_real_distribution<float> dist(0, 1.0);
+ // Check if we should throttle the request.
+ bool throttle = dist(rng_) < throttle_probability;
+ // If we're throttling, record the request and the failure.
+ if (throttle) {
+ requests_.push_back(now);
+ failures_.push_back(now);
+ }
+ return throttle;
+}
+
+void RlsLb::RlsChannel::Throttle::RegisterResponse(bool success) {
+ Timestamp now = ExecCtx::Get()->Now();
+ requests_.push_back(now);
+ if (!success) failures_.push_back(now);
+}
+
+//
+// RlsLb::RlsChannel
+//
+
+RlsLb::RlsChannel::RlsChannel(RefCountedPtr<RlsLb> lb_policy)
+ : InternallyRefCounted<RlsChannel>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsChannel" : nullptr),
+ lb_policy_(std::move(lb_policy)) {
+ // Get channel creds from parent channel.
+ // TODO(roth): Once we eliminate insecure builds, get this via a
+ // method on the helper instead of digging through channel args.
+ grpc_channel_credentials* creds =
+ grpc_channel_credentials_find_in_args(lb_policy_->channel_args_);
+ // Use the parent channel's authority.
+ std::string authority(lb_policy_->channel_control_helper()->GetAuthority());
+ absl::InlinedVector<grpc_arg, 3> args = {
+ grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>(authority.c_str())),
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
+ };
+ // Propagate fake security connector expected targets, if any.
+ // (This is ugly, but it seems better than propagating all channel args
+ // from the parent channel by default and then having a giant
+ // exclude list of args to strip out, like we do in grpclb.)
+ const char* fake_security_expected_targets = grpc_channel_args_find_string(
+ lb_policy_->channel_args_, GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS);
+ if (fake_security_expected_targets != nullptr) {
+ args.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS),
+ const_cast<char*>(fake_security_expected_targets)));
+ }
+ // Add service config args if needed.
+ const std::string& service_config =
+ lb_policy_->config_->rls_channel_service_config();
+ if (!service_config.empty()) {
+ args.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_SERVICE_CONFIG),
+ const_cast<char*>(service_config.c_str())));
+ args.push_back(grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION), 1));
+ }
+ grpc_channel_args rls_channel_args = {args.size(), args.data()};
+ channel_ = grpc_channel_create(lb_policy_->config_->lookup_service().c_str(),
+ creds, &rls_channel_args);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p: created channel %p for %s",
+ lb_policy_.get(), this, channel_,
+ lb_policy_->config_->lookup_service().c_str());
+ }
+ if (channel_ != nullptr) {
+ // Set up channelz linkage.
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(channel_);
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ lb_policy_->channel_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();
+ }
+ // Start connectivity watch.
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "StateWatcher"));
+ client_channel->AddConnectivityWatcher(
+ GRPC_CHANNEL_IDLE,
+ OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
+ }
+}
+
+void RlsLb::RlsChannel::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p, channel=%p: shutdown",
+ lb_policy_.get(), this, channel_);
+ }
+ is_shutdown_ = true;
+ if (channel_ != nullptr) {
+ // Remove channelz linkage.
+ if (parent_channelz_node_ != nullptr) {
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(channel_);
+ GPR_ASSERT(child_channelz_node != nullptr);
+ parent_channelz_node_->RemoveChildChannel(child_channelz_node->uuid());
+ }
+ // Stop connectivity watch.
+ if (watcher_ != nullptr) {
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ client_channel->RemoveConnectivityWatcher(watcher_);
+ watcher_ = nullptr;
+ }
+ grpc_channel_destroy(channel_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::RlsChannel::StartRlsCall(const RequestKey& key,
+ Cache::Entry* stale_entry) {
+ std::unique_ptr<BackOff> backoff_state;
+ grpc_lookup_v1_RouteLookupRequest_Reason reason =
+ grpc_lookup_v1_RouteLookupRequest_REASON_MISS;
+ std::string stale_header_data;
+ if (stale_entry != nullptr) {
+ backoff_state = stale_entry->TakeBackoffState();
+ reason = grpc_lookup_v1_RouteLookupRequest_REASON_STALE;
+ stale_header_data = stale_entry->header_data();
+ }
+ lb_policy_->request_map_.emplace(
+ key, MakeOrphanable<RlsRequest>(
+ lb_policy_->Ref(DEBUG_LOCATION, "RlsRequest"), key,
+ lb_policy_->rls_channel_->Ref(DEBUG_LOCATION, "RlsRequest"),
+ std::move(backoff_state), reason, std::move(stale_header_data)));
+}
+
+void RlsLb::RlsChannel::ReportResponseLocked(bool response_succeeded) {
+ throttle_.RegisterResponse(response_succeeded);
+}
+
+void RlsLb::RlsChannel::ResetBackoff() {
+ GPR_DEBUG_ASSERT(channel_ != nullptr);
+ grpc_channel_reset_connect_backoff(channel_);
+}
+
+//
+// RlsLb::RlsRequest
+//
+
+RlsLb::RlsRequest::RlsRequest(RefCountedPtr<RlsLb> lb_policy, RequestKey key,
+ RefCountedPtr<RlsChannel> rls_channel,
+ std::unique_ptr<BackOff> backoff_state,
+ grpc_lookup_v1_RouteLookupRequest_Reason reason,
+ std::string stale_header_data)
+ : InternallyRefCounted<RlsRequest>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsRequest" : nullptr),
+ lb_policy_(std::move(lb_policy)),
+ key_(std::move(key)),
+ rls_channel_(std::move(rls_channel)),
+ backoff_state_(std::move(backoff_state)),
+ reason_(reason),
+ stale_header_data_(std::move(stale_header_data)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] rls_request=%p: RLS request created for key %s",
+ lb_policy_.get(), this, key_.ToString().c_str());
+ }
+ GRPC_CLOSURE_INIT(&call_complete_cb_, OnRlsCallComplete, this, nullptr);
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&call_start_cb_, StartCall,
+ Ref(DEBUG_LOCATION, "StartCall").release(), nullptr),
+ GRPC_ERROR_NONE);
+}
+
+RlsLb::RlsRequest::~RlsRequest() { GPR_ASSERT(call_ == nullptr); }
+
+void RlsLb::RlsRequest::Orphan() {
+ if (call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: cancelling RLS call",
+ lb_policy_.get(), this, key_.ToString().c_str());
+ }
+ grpc_call_cancel_internal(call_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::RlsRequest::StartCall(void* arg, grpc_error_handle /*error*/) {
+ auto* request = static_cast<RlsRequest*>(arg);
+ request->lb_policy_->work_serializer()->Run(
+ [request]() {
+ request->StartCallLocked();
+ request->Unref(DEBUG_LOCATION, "StartCall");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::RlsRequest::StartCallLocked() {
+ {
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) return;
+ }
+ Timestamp now = ExecCtx::Get()->Now();
+ deadline_ = now + lb_policy_->config_->lookup_service_timeout();
+ grpc_metadata_array_init(&recv_initial_metadata_);
+ grpc_metadata_array_init(&recv_trailing_metadata_);
+ call_ = grpc_channel_create_pollset_set_call(
+ rls_channel_->channel(), nullptr, GRPC_PROPAGATE_DEFAULTS,
+ lb_policy_->interested_parties(),
+ grpc_slice_from_static_string(kRlsRequestPath), nullptr, deadline_,
+ nullptr);
+ grpc_op ops[6];
+ memset(ops, 0, sizeof(ops));
+ grpc_op* op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ ++op;
+ op->op = GRPC_OP_SEND_MESSAGE;
+ send_message_ = MakeRequestProto();
+ op->data.send_message.send_message = send_message_;
+ ++op;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ ++op;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata =
+ &recv_initial_metadata_;
+ ++op;
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->data.recv_message.recv_message = &recv_message_;
+ ++op;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &recv_trailing_metadata_;
+ op->data.recv_status_on_client.status = &status_recv_;
+ op->data.recv_status_on_client.status_details = &status_details_recv_;
+ ++op;
+ Ref(DEBUG_LOCATION, "OnRlsCallComplete").release();
+ auto call_error = grpc_call_start_batch_and_execute(
+ call_, ops, static_cast<size_t>(op - ops), &call_complete_cb_);
+ GPR_ASSERT(call_error == GRPC_CALL_OK);
+}
+
+void RlsLb::RlsRequest::OnRlsCallComplete(void* arg, grpc_error_handle error) {
+ auto* request = static_cast<RlsRequest*>(arg);
+ (void)GRPC_ERROR_REF(error);
+ request->lb_policy_->work_serializer()->Run(
+ [request, error]() {
+ request->OnRlsCallCompleteLocked(error);
+ request->Unref(DEBUG_LOCATION, "OnRlsCallComplete");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::RlsRequest::OnRlsCallCompleteLocked(grpc_error_handle error) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ std::string status_message(StringViewFromSlice(status_details_recv_));
+ gpr_log(GPR_INFO,
+ "[rlslb %p] rls_request=%p %s, error=%s, status={%d, %s} RLS call "
+ "response received",
+ lb_policy_.get(), this, key_.ToString().c_str(),
+ grpc_error_std_string(error).c_str(), status_recv_,
+ status_message.c_str());
+ }
+ // Parse response.
+ ResponseInfo response;
+ if (error != GRPC_ERROR_NONE) {
+ grpc_status_code code;
+ std::string message;
+ grpc_error_get_status(error, deadline_, &code, &message,
+ /*http_error=*/nullptr, /*error_string=*/nullptr);
+ response.status =
+ absl::Status(static_cast<absl::StatusCode>(code), message);
+ } else if (status_recv_ != GRPC_STATUS_OK) {
+ response.status = absl::Status(static_cast<absl::StatusCode>(status_recv_),
+ StringViewFromSlice(status_details_recv_));
+ } else {
+ response = ParseResponseProto();
+ }
+ // Clean up call state.
+ grpc_byte_buffer_destroy(send_message_);
+ grpc_byte_buffer_destroy(recv_message_);
+ grpc_metadata_array_destroy(&recv_initial_metadata_);
+ grpc_metadata_array_destroy(&recv_trailing_metadata_);
+ grpc_slice_unref_internal(status_details_recv_);
+ grpc_call_unref(call_);
+ call_ = nullptr;
+ // Return result to cache.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: response info: %s",
+ lb_policy_.get(), this, key_.ToString().c_str(),
+ response.ToString().c_str());
+ }
+ std::vector<ChildPolicyWrapper*> child_policies_to_finish_update;
+ {
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) return;
+ rls_channel_->ReportResponseLocked(response.status.ok());
+ Cache::Entry* cache_entry = lb_policy_->cache_.FindOrInsert(key_);
+ child_policies_to_finish_update = cache_entry->OnRlsResponseLocked(
+ std::move(response), std::move(backoff_state_));
+ lb_policy_->request_map_.erase(key_);
+ }
+ // Now that we've released the lock, finish the update on any newly
+ // created child policies.
+ for (ChildPolicyWrapper* child : child_policies_to_finish_update) {
+ child->MaybeFinishUpdate();
+ }
+}
+
+grpc_byte_buffer* RlsLb::RlsRequest::MakeRequestProto() {
+ upb::Arena arena;
+ grpc_lookup_v1_RouteLookupRequest* req =
+ grpc_lookup_v1_RouteLookupRequest_new(arena.ptr());
+ grpc_lookup_v1_RouteLookupRequest_set_target_type(
+ req, upb_StringView_FromDataAndSize(kGrpc, sizeof(kGrpc) - 1));
+ for (const auto& kv : key_.key_map) {
+ grpc_lookup_v1_RouteLookupRequest_key_map_set(
+ req, upb_StringView_FromDataAndSize(kv.first.data(), kv.first.size()),
+ upb_StringView_FromDataAndSize(kv.second.data(), kv.second.size()),
+ arena.ptr());
+ }
+ grpc_lookup_v1_RouteLookupRequest_set_reason(req, reason_);
+ if (!stale_header_data_.empty()) {
+ grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(
+ req, upb_StringView_FromDataAndSize(stale_header_data_.data(),
+ stale_header_data_.size()));
+ }
+ size_t len;
+ char* buf =
+ grpc_lookup_v1_RouteLookupRequest_serialize(req, arena.ptr(), &len);
+ grpc_slice send_slice = grpc_slice_from_copied_buffer(buf, len);
+ grpc_byte_buffer* byte_buffer = grpc_raw_byte_buffer_create(&send_slice, 1);
+ grpc_slice_unref_internal(send_slice);
+ return byte_buffer;
+}
+
+RlsLb::ResponseInfo RlsLb::RlsRequest::ParseResponseProto() {
+ ResponseInfo response_info;
+ upb::Arena arena;
+ grpc_byte_buffer_reader bbr;
+ grpc_byte_buffer_reader_init(&bbr, recv_message_);
+ grpc_slice recv_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_byte_buffer_reader_destroy(&bbr);
+ grpc_lookup_v1_RouteLookupResponse* response =
+ grpc_lookup_v1_RouteLookupResponse_parse(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(recv_slice)),
+ GRPC_SLICE_LENGTH(recv_slice), arena.ptr());
+ grpc_slice_unref_internal(recv_slice);
+ if (response == nullptr) {
+ response_info.status = absl::InternalError("cannot parse RLS response");
+ return response_info;
+ }
+ size_t num_targets;
+ const upb_StringView* targets_strview =
+ grpc_lookup_v1_RouteLookupResponse_targets(response, &num_targets);
+ if (num_targets == 0) {
+ response_info.status =
+ absl::InvalidArgumentError("RLS response has no target entry");
+ return response_info;
+ }
+ response_info.targets.reserve(num_targets);
+ for (size_t i = 0; i < num_targets; ++i) {
+ response_info.targets.emplace_back(targets_strview[i].data,
+ targets_strview[i].size);
+ }
+ upb_StringView header_data_strview =
+ grpc_lookup_v1_RouteLookupResponse_header_data(response);
+ response_info.header_data =
+ std::string(header_data_strview.data, header_data_strview.size);
+ return response_info;
+}
+
+//
+// RlsLb
+//
+
+std::string GetServerUri(const grpc_channel_args* args) {
+ const char* server_uri_str =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri_str != nullptr);
+ absl::StatusOr<URI> uri = URI::Parse(server_uri_str);
+ GPR_ASSERT(uri.ok());
+ return std::string(absl::StripPrefix(uri->path(), "/"));
+}
+
+RlsLb::RlsLb(Args args)
+ : LoadBalancingPolicy(std::move(args)),
+ server_name_(GetServerUri(args.args)),
+ cache_(this) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy created", this);
+ }
+}
+
+void RlsLb::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy updated", this);
+ }
+ // Swap out config.
+ RefCountedPtr<RlsLbConfig> old_config = std::move(config_);
+ config_ = std::move(args.config);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) &&
+ (old_config == nullptr ||
+ old_config->child_policy_config() != config_->child_policy_config())) {
+ gpr_log(GPR_INFO, "[rlslb %p] updated child policy config: %s", this,
+ config_->child_policy_config().Dump().c_str());
+ }
+ // Swap out addresses.
+ // If the new address list is an error and we have an existing address list,
+ // stick with the existing addresses.
+ absl::StatusOr<ServerAddressList> old_addresses;
+ if (args.addresses.ok()) {
+ old_addresses = std::move(addresses_);
+ addresses_ = std::move(args.addresses);
+ } else {
+ old_addresses = addresses_;
+ }
+ // Swap out channel args.
+ grpc_channel_args_destroy(channel_args_);
+ channel_args_ = grpc_channel_args_copy(args.args);
+ // Determine whether we need to update all child policies.
+ bool update_child_policies =
+ old_config == nullptr ||
+ old_config->child_policy_config() != config_->child_policy_config() ||
+ old_addresses != addresses_ ||
+ grpc_channel_args_compare(args.args, channel_args_) != 0;
+ // If default target changes, swap out child policy.
+ bool created_default_child = false;
+ if (old_config == nullptr ||
+ config_->default_target() != old_config->default_target()) {
+ if (config_->default_target().empty()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] unsetting default target", this);
+ }
+ default_child_policy_.reset();
+ } else {
+ auto it = child_policy_map_.find(config_->default_target());
+ if (it == child_policy_map_.end()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] creating new default target", this);
+ }
+ default_child_policy_ = MakeRefCounted<ChildPolicyWrapper>(
+ Ref(DEBUG_LOCATION, "ChildPolicyWrapper"),
+ config_->default_target());
+ created_default_child = true;
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] using existing child for default target", this);
+ }
+ default_child_policy_ =
+ it->second->Ref(DEBUG_LOCATION, "DefaultChildPolicy");
+ }
+ }
+ }
+ // Now grab the lock to swap out the state it guards.
+ {
+ MutexLock lock(&mu_);
+ // Swap out RLS channel if needed.
+ if (old_config == nullptr ||
+ config_->lookup_service() != old_config->lookup_service()) {
+ rls_channel_ =
+ MakeOrphanable<RlsChannel>(Ref(DEBUG_LOCATION, "RlsChannel"));
+ }
+ // Resize cache if needed.
+ if (old_config == nullptr ||
+ config_->cache_size_bytes() != old_config->cache_size_bytes()) {
+ cache_.Resize(config_->cache_size_bytes());
+ }
+ // Start update of child policies if needed.
+ if (update_child_policies) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] starting child policy updates", this);
+ }
+ for (auto& p : child_policy_map_) {
+ p.second->StartUpdate();
+ }
+ } else if (created_default_child) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] starting default child policy update",
+ this);
+ }
+ default_child_policy_->StartUpdate();
+ }
+ }
+ // Now that we've released the lock, finish update of child policies.
+ if (update_child_policies) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] finishing child policy updates", this);
+ }
+ for (auto& p : child_policy_map_) {
+ p.second->MaybeFinishUpdate();
+ }
+ } else if (created_default_child) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] finishing default child policy update",
+ this);
+ }
+ default_child_policy_->MaybeFinishUpdate();
+ }
+ // In principle, we need to update the picker here only if the config
+ // fields used by the picker have changed. However, it seems fragile
+ // to check individual fields, since the picker logic could change in
+ // the future to use additional config fields, and we might not
+ // remember to update the code here. So for now, we just unconditionally
+ // update the picker here, even though it's probably redundant.
+ UpdatePickerLocked();
+}
+
+void RlsLb::ExitIdleLocked() {
+ MutexLock lock(&mu_);
+ for (auto& child_entry : child_policy_map_) {
+ child_entry.second->ExitIdleLocked();
+ }
+}
+
+void RlsLb::ResetBackoffLocked() {
+ {
+ MutexLock lock(&mu_);
+ rls_channel_->ResetBackoff();
+ cache_.ResetAllBackoff();
+ }
+ for (auto& child : child_policy_map_) {
+ child.second->ResetBackoffLocked();
+ }
+}
+
+void RlsLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy shutdown", this);
+ }
+ MutexLock lock(&mu_);
+ is_shutdown_ = true;
+ config_.reset(DEBUG_LOCATION, "ShutdownLocked");
+ if (channel_args_ != nullptr) {
+ grpc_channel_args_destroy(channel_args_);
+ }
+ cache_.Shutdown();
+ request_map_.clear();
+ rls_channel_.reset();
+ default_child_policy_.reset();
+}
+
+void RlsLb::UpdatePickerAsync() {
+ // Run via the ExecCtx, since the caller may be holding the lock, and
+ // we don't want to be doing that when we hop into the WorkSerializer,
+ // in case the WorkSerializer callback happens to run inline.
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(UpdatePickerCallback,
+ Ref(DEBUG_LOCATION, "UpdatePickerCallback").release(),
+ grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_NONE);
+}
+
+void RlsLb::UpdatePickerCallback(void* arg, grpc_error_handle /*error*/) {
+ auto* rls_lb = static_cast<RlsLb*>(arg);
+ rls_lb->work_serializer()->Run(
+ [rls_lb]() {
+ RefCountedPtr<RlsLb> lb_policy(rls_lb);
+ lb_policy->UpdatePickerLocked();
+ lb_policy.reset(DEBUG_LOCATION, "UpdatePickerCallback");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::UpdatePickerLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] updating picker", this);
+ }
+ grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+ if (!child_policy_map_.empty()) {
+ state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ int num_idle = 0;
+ int num_connecting = 0;
+ {
+ MutexLock lock(&mu_);
+ if (is_shutdown_) return;
+ for (auto& p : child_policy_map_) {
+ grpc_connectivity_state child_state = p.second->connectivity_state();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] target %s in state %s", this,
+ p.second->target().c_str(),
+ ConnectivityStateName(child_state));
+ }
+ if (child_state == GRPC_CHANNEL_READY) {
+ state = GRPC_CHANNEL_READY;
+ break;
+ } else if (child_state == GRPC_CHANNEL_CONNECTING) {
+ ++num_connecting;
+ } else if (child_state == GRPC_CHANNEL_IDLE) {
+ ++num_idle;
+ }
+ }
+ if (state != GRPC_CHANNEL_READY) {
+ if (num_connecting > 0) {
+ state = GRPC_CHANNEL_CONNECTING;
+ } else if (num_idle > 0) {
+ state = GRPC_CHANNEL_IDLE;
+ }
+ }
+ }
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] reporting state %s", this,
+ ConnectivityStateName(state));
+ }
+ absl::Status status;
+ if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ status = absl::UnavailableError("no children available");
+ }
+ channel_control_helper()->UpdateState(
+ state, status, absl::make_unique<Picker>(Ref(DEBUG_LOCATION, "Picker")));
+}
+
+//
+// RlsLbFactory
+//
+
+grpc_error_handle ParseJsonHeaders(size_t idx, const Json& json,
+ std::string* key,
+ std::vector<std::string>* headers) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:headers index:", idx, " error:type should be OBJECT"));
+ }
+ std::vector<grpc_error_handle> error_list;
+ // requiredMatch must not be present.
+ if (json.object_value().find("requiredMatch") != json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:requiredMatch error:must not be present"));
+ }
+ // Find key.
+ if (ParseJsonObjectField(json.object_value(), "key", key, &error_list) &&
+ key->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:key error:must be non-empty"));
+ }
+ // Find headers.
+ const Json::Array* headers_json = nullptr;
+ ParseJsonObjectField(json.object_value(), "names", &headers_json,
+ &error_list);
+ if (headers_json != nullptr) {
+ if (headers_json->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:names error:list is empty"));
+ } else {
+ size_t name_idx = 0;
+ for (const Json& name_json : *headers_json) {
+ if (name_json.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:names index:", name_idx, " error:type should be STRING")));
+ } else if (name_json.string_value().empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:names index:", name_idx,
+ " error:header name must be non-empty")));
+ } else {
+ headers->push_back(name_json.string_value());
+ }
+ ++name_idx;
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("field:headers index:", idx), &error_list);
+}
+
+std::string ParseJsonMethodName(size_t idx, const Json& json,
+ grpc_error_handle* error) {
+ if (json.type() != Json::Type::OBJECT) {
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:names index:", idx, " error:type should be OBJECT"));
+ return "";
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Find service name.
+ absl::string_view service_name;
+ ParseJsonObjectField(json.object_value(), "service", &service_name,
+ &error_list);
+ // Find method name.
+ absl::string_view method_name;
+ ParseJsonObjectField(json.object_value(), "method", &method_name, &error_list,
+ /*required=*/false);
+ // Return error, if any.
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("field:names index:", idx), &error_list);
+ // Construct path.
+ return absl::StrCat("/", service_name, "/", method_name);
+}
+
+grpc_error_handle ParseGrpcKeybuilder(
+ size_t idx, const Json& json, RlsLbConfig::KeyBuilderMap* key_builder_map) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:grpc_keybuilders index:", idx, " error:type should be OBJECT"));
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Parse names.
+ std::set<std::string> names;
+ const Json::Array* names_array = nullptr;
+ if (ParseJsonObjectField(json.object_value(), "names", &names_array,
+ &error_list)) {
+ if (names_array->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:names error:list is empty"));
+ } else {
+ size_t name_idx = 0;
+ for (const Json& name_json : *names_array) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ std::string name =
+ ParseJsonMethodName(name_idx++, name_json, &child_error);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(child_error);
+ } else {
+ bool inserted = names.insert(name).second;
+ if (!inserted) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:names error:duplicate entry for ", name)));
+ }
+ }
+ }
+ }
+ }
+ // Helper function to check for duplicate keys.
+ std::set<std::string> all_keys;
+ auto duplicate_key_check_func = [&all_keys,
+ &error_list](const std::string& key) {
+ auto it = all_keys.find(key);
+ if (it != all_keys.end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("key \"", key, "\" listed multiple times")));
+ } else {
+ all_keys.insert(key);
+ }
+ };
+ // Parse headers.
+ RlsLbConfig::KeyBuilder key_builder;
+ const Json::Array* headers_array = nullptr;
+ ParseJsonObjectField(json.object_value(), "headers", &headers_array,
+ &error_list, /*required=*/false);
+ if (headers_array != nullptr) {
+ size_t header_idx = 0;
+ for (const Json& header_json : *headers_array) {
+ std::string key;
+ std::vector<std::string> headers;
+ grpc_error_handle child_error =
+ ParseJsonHeaders(header_idx++, header_json, &key, &headers);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(child_error);
+ } else {
+ duplicate_key_check_func(key);
+ key_builder.header_keys.emplace(key, std::move(headers));
+ }
+ }
+ }
+ // Parse extraKeys.
+ const Json::Object* extra_keys = nullptr;
+ ParseJsonObjectField(json.object_value(), "extraKeys", &extra_keys,
+ &error_list, /*required=*/false);
+ if (extra_keys != nullptr) {
+ std::vector<grpc_error_handle> extra_keys_errors;
+ if (ParseJsonObjectField(*extra_keys, "host", &key_builder.host_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.host_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:host error:must be non-empty"));
+ }
+ if (!key_builder.host_key.empty()) {
+ duplicate_key_check_func(key_builder.host_key);
+ }
+ if (ParseJsonObjectField(*extra_keys, "service", &key_builder.service_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.service_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:service error:must be non-empty"));
+ }
+ if (!key_builder.service_key.empty()) {
+ duplicate_key_check_func(key_builder.service_key);
+ }
+ if (ParseJsonObjectField(*extra_keys, "method", &key_builder.method_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.method_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:method error:must be non-empty"));
+ }
+ if (!key_builder.method_key.empty()) {
+ duplicate_key_check_func(key_builder.method_key);
+ }
+ if (!extra_keys_errors.empty()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:extraKeys", &extra_keys_errors));
+ }
+ }
+ // Parse constantKeys.
+ const Json::Object* constant_keys = nullptr;
+ ParseJsonObjectField(json.object_value(), "constantKeys", &constant_keys,
+ &error_list, /*required=*/false);
+ if (constant_keys != nullptr) {
+ std::vector<grpc_error_handle> constant_keys_errors;
+ for (const auto& p : *constant_keys) {
+ const std::string& key = p.first;
+ const Json& value = p.second;
+ if (key.empty()) {
+ constant_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "error:keys must be non-empty"));
+ }
+ duplicate_key_check_func(key);
+ ExtractJsonString(value, key, &key_builder.constant_keys[key],
+ &constant_keys_errors);
+ }
+ if (!constant_keys_errors.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:constantKeys", &constant_keys_errors));
+ }
+ }
+ // Insert key_builder into key_builder_map.
+ for (const std::string& name : names) {
+ bool inserted = key_builder_map->emplace(name, key_builder).second;
+ if (!inserted) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:names error:duplicate entry for ", name)));
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("index:", idx), &error_list);
+}
+
+RlsLbConfig::KeyBuilderMap ParseGrpcKeybuilders(
+ const Json::Array& key_builder_list, grpc_error_handle* error) {
+ RlsLbConfig::KeyBuilderMap key_builder_map;
+ if (key_builder_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:grpcKeybuilders error:list is empty");
+ return key_builder_map;
+ }
+ std::vector<grpc_error_handle> error_list;
+ size_t idx = 0;
+ for (const Json& key_builder : key_builder_list) {
+ grpc_error_handle child_error =
+ ParseGrpcKeybuilder(idx++, key_builder, &key_builder_map);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("field:grpcKeybuilders", &error_list);
+ return key_builder_map;
+}
+
+RlsLbConfig::RouteLookupConfig ParseRouteLookupConfig(
+ const Json::Object& json, grpc_error_handle* error) {
+ std::vector<grpc_error_handle> error_list;
+ RlsLbConfig::RouteLookupConfig route_lookup_config;
+ // Parse grpcKeybuilders.
+ const Json::Array* keybuilder_list = nullptr;
+ ParseJsonObjectField(json, "grpcKeybuilders", &keybuilder_list, &error_list);
+ if (keybuilder_list != nullptr) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ route_lookup_config.key_builder_map =
+ ParseGrpcKeybuilders(*keybuilder_list, &child_error);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ // Parse lookupService.
+ if (ParseJsonObjectField(json, "lookupService",
+ &route_lookup_config.lookup_service, &error_list)) {
+ if (!CoreConfiguration::Get().resolver_registry().IsValidTarget(
+ route_lookup_config.lookup_service)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:lookupService error:must be valid gRPC target URI"));
+ }
+ }
+ // Parse lookupServiceTimeout.
+ route_lookup_config.lookup_service_timeout = kDefaultLookupServiceTimeout;
+ ParseJsonObjectFieldAsDuration(json, "lookupServiceTimeout",
+ &route_lookup_config.lookup_service_timeout,
+ &error_list, /*required=*/false);
+ // Parse maxAge.
+ route_lookup_config.max_age = kMaxMaxAge;
+ bool max_age_set = ParseJsonObjectFieldAsDuration(
+ json, "maxAge", &route_lookup_config.max_age, &error_list,
+ /*required=*/false);
+ // Clamp maxAge to the max allowed value.
+ if (route_lookup_config.max_age > kMaxMaxAge) {
+ route_lookup_config.max_age = kMaxMaxAge;
+ }
+ // Parse staleAge.
+ route_lookup_config.stale_age = kMaxMaxAge;
+ bool stale_age_set = ParseJsonObjectFieldAsDuration(
+ json, "staleAge", &route_lookup_config.stale_age, &error_list,
+ /*required=*/false);
+ // If staleAge is set, then maxAge must also be set.
+ if (stale_age_set && !max_age_set) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAge error:must be set if staleAge is set"));
+ }
+ // Ignore staleAge if greater than or equal to maxAge.
+ if (route_lookup_config.stale_age >= route_lookup_config.max_age) {
+ route_lookup_config.stale_age = route_lookup_config.max_age;
+ }
+ // Parse cacheSizeBytes.
+ ParseJsonObjectField(json, "cacheSizeBytes",
+ &route_lookup_config.cache_size_bytes, &error_list);
+ if (route_lookup_config.cache_size_bytes <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:cacheSizeBytes error:must be greater than 0"));
+ }
+ // Clamp cacheSizeBytes to the max allowed value.
+ if (route_lookup_config.cache_size_bytes > kMaxCacheSizeBytes) {
+ route_lookup_config.cache_size_bytes = kMaxCacheSizeBytes;
+ }
+ // Parse defaultTarget.
+ if (ParseJsonObjectField(json, "defaultTarget",
+ &route_lookup_config.default_target, &error_list,
+ /*required=*/false)) {
+ if (route_lookup_config.default_target.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:defaultTarget error:must be non-empty if set"));
+ }
+ }
+ *error =
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:routeLookupConfig", &error_list);
+ return route_lookup_config;
+}
+
+grpc_error_handle ValidateChildPolicyList(
+ const Json& child_policy_list,
+ const std::string& child_policy_config_target_field_name,
+ const std::string& default_target, Json* child_policy_config,
+ RefCountedPtr<LoadBalancingPolicy::Config>*
+ default_child_policy_parsed_config) {
+ // Add target to each entry in the config proto.
+ *child_policy_config = child_policy_list;
+ std::string target =
+ default_target.empty() ? kFakeTargetFieldValue : default_target;
+ grpc_error_handle error = InsertOrUpdateChildPolicyField(
+ child_policy_config_target_field_name, target, child_policy_config);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Parse the config.
+ RefCountedPtr<LoadBalancingPolicy::Config> parsed_config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ *child_policy_config, &error);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Find the chosen config and return it in JSON form.
+ // We remove all non-selected configs, and in the selected config, we leave
+ // the target field in place, set to the default value. This slightly
+ // optimizes what we need to do later when we update a child policy for a
+ // given target.
+ if (parsed_config != nullptr) {
+ for (Json& config : *(child_policy_config->mutable_array())) {
+ if (config.object_value().begin()->first == parsed_config->name()) {
+ Json save_config = std::move(config);
+ child_policy_config->mutable_array()->clear();
+ child_policy_config->mutable_array()->push_back(std::move(save_config));
+ break;
+ }
+ }
+ }
+ // If default target is set, return the parsed config.
+ if (!default_target.empty()) {
+ *default_child_policy_parsed_config = std::move(parsed_config);
+ }
+ return GRPC_ERROR_NONE;
+}
+
+class RlsLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ const char* name() const override { return kRls; }
+
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<RlsLb>(std::move(args));
+ }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& config, grpc_error_handle* error) const override {
+ std::vector<grpc_error_handle> error_list;
+ // Parse routeLookupConfig.
+ RlsLbConfig::RouteLookupConfig route_lookup_config;
+ const Json::Object* route_lookup_config_json = nullptr;
+ if (ParseJsonObjectField(config.object_value(), "routeLookupConfig",
+ &route_lookup_config_json, &error_list)) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ route_lookup_config =
+ ParseRouteLookupConfig(*route_lookup_config_json, &child_error);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ // Parse routeLookupChannelServiceConfig.
+ std::string rls_channel_service_config;
+ const Json::Object* rls_channel_service_config_json_obj = nullptr;
+ if (ParseJsonObjectField(config.object_value(),
+ "routeLookupChannelServiceConfig",
+ &rls_channel_service_config_json_obj, &error_list,
+ /*required=*/false)) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ Json rls_channel_service_config_json(
+ *rls_channel_service_config_json_obj);
+ rls_channel_service_config = rls_channel_service_config_json.Dump();
+ auto service_config = MakeRefCounted<ServiceConfigImpl>(
+ /*args=*/nullptr, rls_channel_service_config,
+ std::move(rls_channel_service_config_json), &child_error);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "field:routeLookupChannelServiceConfig", &child_error, 1));
+ GRPC_ERROR_UNREF(child_error);
+ }
+ }
+ // Parse childPolicyConfigTargetFieldName.
+ std::string child_policy_config_target_field_name;
+ if (ParseJsonObjectField(
+ config.object_value(), "childPolicyConfigTargetFieldName",
+ &child_policy_config_target_field_name, &error_list)) {
+ if (child_policy_config_target_field_name.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicyConfigTargetFieldName error:must be non-empty"));
+ }
+ }
+ // Parse childPolicy.
+ Json child_policy_config;
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config;
+ auto it = config.object_value().find("childPolicy");
+ if (it == config.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicy error:does not exist."));
+ } else if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicy error:type should be ARRAY"));
+ } else {
+ grpc_error_handle child_error = ValidateChildPolicyList(
+ it->second, child_policy_config_target_field_name,
+ route_lookup_config.default_target, &child_policy_config,
+ &default_child_policy_parsed_config);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "field:childPolicy", &child_error, 1));
+ GRPC_ERROR_UNREF(child_error);
+ }
+ }
+ // Return result.
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "errors parsing RLS LB policy config", &error_list);
+ return MakeRefCounted<RlsLbConfig>(
+ std::move(route_lookup_config), std::move(rls_channel_service_config),
+ std::move(child_policy_config),
+ std::move(child_policy_config_target_field_name),
+ std::move(default_child_policy_parsed_config));
+ }
+};
+
+} // namespace
+
+void RlsLbPluginInit() {
+ LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
+ absl::make_unique<RlsLbFactory>());
+}
+
+void RlsLbPluginShutdown() {}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index 529d90d3..1946a878 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -1,28 +1,18 @@
-/*
- *
- * 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.
- *
- */
-
-/** Round Robin Policy.
- *
- * Before every pick, the \a get_next_ready_subchannel_index_locked function
- * returns the p->subchannel_list->subchannels index for next subchannel,
- * respecting the relative order of the addresses provided upon creation or
- * updates. Note however that updates will start picking from the beginning of
- * the updated list. */
+//
+// 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>
@@ -41,7 +31,6 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/static_metadata.h"
namespace grpc_core {
@@ -166,15 +155,14 @@ class RoundRobin : public LoadBalancingPolicy {
void ShutdownLocked() override;
- /** list of subchannels */
+ // List of subchannels.
OrphanablePtr<RoundRobinSubchannelList> subchannel_list_;
- /** Latest version of the subchannel list.
- * Subchannel connectivity callbacks will only promote updated subchannel
- * lists if they equal \a latest_pending_subchannel_list. In other words,
- * racing callbacks that reference outdated subchannel lists won't perform any
- * update. */
+ // Latest pending subchannel list.
+ // When we get an updated address list, we create a new subchannel list
+ // for it here, and we wait to swap it into subchannel_list_ until the new
+ // list becomes READY.
OrphanablePtr<RoundRobinSubchannelList> latest_pending_subchannel_list_;
- /** are we shutting down? */
+
bool shutdown_ = false;
};
@@ -213,10 +201,7 @@ RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs /*args*/) {
parent_, this, last_picked_index_,
subchannels_[last_picked_index_].get());
}
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- result.subchannel = subchannels_[last_picked_index_];
- return result;
+ return PickResult::Complete(subchannels_[last_picked_index_]);
}
//
@@ -306,45 +291,47 @@ void RoundRobin::RoundRobinSubchannelList::
RoundRobin* p = static_cast<RoundRobin*>(policy());
// Only set connectivity state if this is the current subchannel list.
if (p->subchannel_list_.get() != this) return;
- /* In priority order. The first rule to match terminates the search (ie, if we
- * are on rule n, all previous rules were unfulfilled).
- *
- * 1) RULE: ANY subchannel is READY => policy is READY.
- * CHECK: subchannel_list->num_ready > 0.
- *
- * 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING.
- * CHECK: sd->curr_connectivity_state == CONNECTING.
- *
- * 3) RULE: ALL subchannels are TRANSIENT_FAILURE => policy is
- * TRANSIENT_FAILURE.
- * CHECK: subchannel_list->num_transient_failures ==
- * subchannel_list->num_subchannels.
- */
+ // In priority order. The first rule to match terminates the search (ie, if we
+ // are on rule n, all previous rules were unfulfilled).
+ //
+ // 1) RULE: ANY subchannel is READY => policy is READY.
+ // CHECK: subchannel_list->num_ready > 0.
+ //
+ // 2) RULE: ANY subchannel is CONNECTING => policy is CONNECTING.
+ // CHECK: sd->curr_connectivity_state == CONNECTING.
+ //
+ // 3) RULE: ALL subchannels are TRANSIENT_FAILURE => policy is
+ // TRANSIENT_FAILURE.
+ // CHECK: subchannel_list->num_transient_failures ==
+ // subchannel_list->num_subchannels.
if (num_ready_ > 0) {
- /* 1) READY */
+ // 1) READY
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_READY, absl::Status(), absl::make_unique<Picker>(p, this));
} else if (num_connecting_ > 0) {
- /* 2) CONNECTING */
+ // 2) CONNECTING
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, absl::Status(),
absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
} else if (num_transient_failure_ == num_subchannels()) {
- /* 3) TRANSIENT_FAILURE */
- grpc_error_handle error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "connections to all backends failing"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ // 3) TRANSIENT_FAILURE
+ absl::Status status =
+ absl::UnavailableError("connections to all backends failing");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
}
}
void RoundRobin::RoundRobinSubchannelList::
UpdateRoundRobinStateFromSubchannelStateCountsLocked() {
RoundRobin* p = static_cast<RoundRobin*>(policy());
- if (num_ready_ > 0) {
+ // If we have at least one READY subchannel, then swap to the new list.
+ // Also, if all of the subchannels are in TRANSIENT_FAILURE, then we know
+ // we've tried all of them and failed, so we go ahead and swap over
+ // anyway; this may cause the channel to go from READY to TRANSIENT_FAILURE,
+ // but we are doing what the control plane told us to do.
+ if (num_ready_ > 0 || num_transient_failure_ == num_subchannels()) {
if (p->subchannel_list_.get() != this) {
// Promote this list to p->subchannel_list_.
// This list must be p->latest_pending_subchannel_list_, because
@@ -432,29 +419,41 @@ void RoundRobin::RoundRobinSubchannelData::ProcessConnectivityChangeLocked(
}
void RoundRobin::UpdateLocked(UpdateArgs args) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
- gpr_log(GPR_INFO, "[RR %p] received update with %" PRIuPTR " addresses",
- this, args.addresses.size());
- }
- // Replace latest_pending_subchannel_list_.
- if (latest_pending_subchannel_list_ != nullptr) {
+ ServerAddressList addresses;
+ if (args.addresses.ok()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
- gpr_log(GPR_INFO,
- "[RR %p] Shutting down previous pending subchannel list %p", this,
- latest_pending_subchannel_list_.get());
+ gpr_log(GPR_INFO, "[RR %p] received update with %" PRIuPTR " addresses",
+ this, args.addresses->size());
}
+ addresses = std::move(*args.addresses);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) {
+ gpr_log(GPR_INFO, "[RR %p] received update with address error: %s", this,
+ args.addresses.status().ToString().c_str());
+ }
+ // If we already have a subchannel list, then ignore the resolver
+ // failure and keep using the existing list.
+ if (subchannel_list_ != nullptr) return;
+ }
+ // Replace latest_pending_subchannel_list_.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) &&
+ latest_pending_subchannel_list_ != nullptr) {
+ gpr_log(GPR_INFO,
+ "[RR %p] Shutting down previous pending subchannel list %p", this,
+ latest_pending_subchannel_list_.get());
}
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(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.
- grpc_error_handle error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ absl::Status status =
+ args.addresses.ok() ? absl::UnavailableError(absl::StrCat(
+ "empty address list: ", args.resolution_note))
+ : args.addresses.status();
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
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
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index b894c592..d015bc72 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -23,23 +23,21 @@
#include <string.h>
-#include <grpc/support/alloc.h>
-
#include "absl/container/inlined_vector.h"
+#include <grpc/support/alloc.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
-// that implementation should be hidden from the LB policy API.
-#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gprpp/manual_constructor.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/iomgr/closure.h"
+#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/transport/connectivity_state.h"
// Code for maintaining a list of subchannels within an LB policy.
@@ -175,13 +173,18 @@ class SubchannelData {
template <typename SubchannelListType, typename SubchannelDataType>
class SubchannelList : public InternallyRefCounted<SubchannelListType> {
public:
- typedef absl::InlinedVector<SubchannelDataType, 10> SubchannelVector;
+ // We use ManualConstructor here to support SubchannelDataType classes
+ // that are not copyable.
+ typedef absl::InlinedVector<ManualConstructor<SubchannelDataType>, 10>
+ SubchannelVector;
// The number of subchannels in the list.
size_t num_subchannels() const { return subchannels_.size(); }
// The data for the subchannel at a particular index.
- SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; }
+ SubchannelDataType* subchannel(size_t index) {
+ return subchannels_[index].get();
+ }
// Returns true if the subchannel list is shutting down.
bool shutting_down() const { return shutting_down_; }
@@ -386,7 +389,8 @@ SubchannelList<SubchannelListType, SubchannelDataType>::SubchannelList(
tracer_->name(), policy_, this, subchannels_.size(),
subchannel.get(), address.ToString().c_str());
}
- subchannels_.emplace_back(this, std::move(address), std::move(subchannel));
+ subchannels_.emplace_back();
+ subchannels_.back().Init(this, std::move(address), std::move(subchannel));
}
}
@@ -396,6 +400,9 @@ SubchannelList<SubchannelListType, SubchannelDataType>::~SubchannelList() {
gpr_log(GPR_INFO, "[%s %p] Destroying subchannel_list %p", tracer_->name(),
policy_, this);
}
+ for (auto& sd : subchannels_) {
+ sd.Destroy();
+ }
}
template <typename SubchannelListType, typename SubchannelDataType>
@@ -406,8 +413,7 @@ void SubchannelList<SubchannelListType, SubchannelDataType>::ShutdownLocked() {
}
GPR_ASSERT(!shutting_down_);
shutting_down_ = true;
- for (size_t i = 0; i < subchannels_.size(); i++) {
- SubchannelDataType* sd = &subchannels_[i];
+ for (auto& sd : subchannels_) {
sd->ShutdownLocked();
}
}
@@ -415,8 +421,7 @@ void SubchannelList<SubchannelListType, SubchannelDataType>::ShutdownLocked() {
template <typename SubchannelListType, typename SubchannelDataType>
void SubchannelList<SubchannelListType,
SubchannelDataType>::ResetBackoffLocked() {
- for (size_t i = 0; i < subchannels_.size(); i++) {
- SubchannelDataType* sd = &subchannels_[i];
+ for (auto& sd : subchannels_) {
sd->ResetBackoffLocked();
}
}
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
index ac1857be..4b663316 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
@@ -48,7 +48,7 @@ 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;
+constexpr Duration kChildRetentionInterval = Duration::Minutes(15);
// Config for weighted_target LB policy.
class WeightedTargetLbConfig : public LoadBalancingPolicy::Config {
@@ -123,7 +123,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
void Orphan() override;
void UpdateLocked(const WeightedTargetLbConfig::ChildConfig& config,
- ServerAddressList addresses,
+ absl::StatusOr<ServerAddressList> addresses,
const grpc_channel_args* args);
void ResetBackoffLocked();
void DeactivateLocked();
@@ -150,6 +150,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -157,6 +158,23 @@ class WeightedTargetLb : public LoadBalancingPolicy {
RefCountedPtr<WeightedChild> weighted_child_;
};
+ class DelayedRemovalTimer
+ : public InternallyRefCounted<DelayedRemovalTimer> {
+ public:
+ explicit DelayedRemovalTimer(RefCountedPtr<WeightedChild> weighted_child);
+
+ void Orphan() override;
+
+ private:
+ static void OnTimer(void* arg, grpc_error_handle error);
+ void OnTimerLocked(grpc_error_handle error);
+
+ RefCountedPtr<WeightedChild> weighted_child_;
+ grpc_timer timer_;
+ grpc_closure on_timer_;
+ bool timer_pending_ = true;
+ };
+
// Methods for dealing with the child policy.
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
const grpc_channel_args* args);
@@ -165,9 +183,6 @@ class WeightedTargetLb : public LoadBalancingPolicy {
grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker);
- static void OnDelayedRemovalTimer(void* arg, grpc_error_handle error);
- void OnDelayedRemovalTimerLocked(grpc_error_handle error);
-
// The owning LB policy.
RefCountedPtr<WeightedTargetLb> weighted_target_policy_;
@@ -179,13 +194,8 @@ class WeightedTargetLb : public LoadBalancingPolicy {
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;
+ OrphanablePtr<DelayedRemovalTimer> delayed_removal_timer_;
};
~WeightedTargetLb() override;
@@ -199,6 +209,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
// Internal state.
bool shutting_down_ = false;
+ bool update_in_progress_ = false;
// Children.
std::map<std::string, OrphanablePtr<WeightedChild>> targets_;
@@ -270,6 +281,7 @@ void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
gpr_log(GPR_INFO, "[weighted_target_lb %p] Received update", this);
}
+ update_in_progress_ = true;
// Update config.
config_ = std::move(args.config);
// Deactivate the targets not in the new config.
@@ -280,33 +292,37 @@ void WeightedTargetLb::UpdateLocked(UpdateArgs args) {
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 std::string& 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 =
+ absl::StatusOr<HierarchicalAddressMap> address_map =
MakeHierarchicalAddressMap(args.addresses);
for (const auto& p : config_->target_map()) {
const std::string& name = p.first;
const WeightedTargetLbConfig::ChildConfig& config = p.second;
- targets_[name]->UpdateLocked(config, std::move(address_map[name]),
- args.args);
+ auto& target = targets_[name];
+ // Create child if it does not already exist.
+ if (target == nullptr) {
+ target = MakeOrphanable<WeightedChild>(
+ Ref(DEBUG_LOCATION, "WeightedChild"), name);
+ }
+ absl::StatusOr<ServerAddressList> addresses;
+ if (address_map.ok()) {
+ addresses = std::move((*address_map)[name]);
+ } else {
+ addresses = address_map.status();
+ }
+ target->UpdateLocked(config, std::move(addresses), args.args);
}
+ update_in_progress_ = false;
UpdateStateLocked();
}
void WeightedTargetLb::UpdateStateLocked() {
+ // If we're in the process of propagating an update from our parent to
+ // our children, ignore any updates that come from the children. We
+ // will instead return a new picker once the update has been seen by
+ // all children. This avoids unnecessary picker churn while an update
+ // is being propagated to our children.
+ if (update_in_progress_) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
gpr_log(GPR_INFO,
"[weighted_target_lb %p] scanning children to determine "
@@ -340,6 +356,7 @@ void WeightedTargetLb::UpdateStateLocked() {
}
switch (child->connectivity_state()) {
case GRPC_CHANNEL_READY: {
+ GPR_ASSERT(child->weight() > 0);
end += child->weight();
picker_list.push_back(std::make_pair(end, child->picker_wrapper()));
break;
@@ -387,18 +404,62 @@ void WeightedTargetLb::UpdateStateLocked() {
absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
break;
default:
- grpc_error_handle 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 = absl::make_unique<TransientFailurePicker>(error);
+ status = absl::UnavailableError(
+ "weighted_target: all children report state TRANSIENT_FAILURE");
+ picker = absl::make_unique<TransientFailurePicker>(status);
}
channel_control_helper()->UpdateState(connectivity_state, status,
std::move(picker));
}
//
+// WeightedTargetLb::WeightedChild::DelayedRemovalTimer
+//
+
+WeightedTargetLb::WeightedChild::DelayedRemovalTimer::DelayedRemovalTimer(
+ RefCountedPtr<WeightedTargetLb::WeightedChild> weighted_child)
+ : weighted_child_(std::move(weighted_child)) {
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr);
+ Ref().release();
+ grpc_timer_init(&timer_, ExecCtx::Get()->Now() + kChildRetentionInterval,
+ &on_timer_);
+}
+
+void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::Orphan() {
+ if (timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) {
+ gpr_log(GPR_INFO,
+ "[weighted_target_lb %p] WeightedChild %p %s: cancelling "
+ "delayed removal timer",
+ weighted_child_->weighted_target_policy_.get(),
+ weighted_child_.get(), weighted_child_->name_.c_str());
+ }
+ timer_pending_ = false;
+ grpc_timer_cancel(&timer_);
+ }
+ Unref();
+}
+
+void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::OnTimer(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<DelayedRemovalTimer*>(arg);
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
+ self->weighted_child_->weighted_target_policy_->work_serializer()->Run(
+ [self, error]() { self->OnTimerLocked(error); }, DEBUG_LOCATION);
+}
+
+void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::OnTimerLocked(
+ grpc_error_handle error) {
+ if (error == GRPC_ERROR_NONE && timer_pending_) {
+ timer_pending_ = false;
+ weighted_child_->weighted_target_policy_->targets_.erase(
+ weighted_child_->name_);
+ }
+ GRPC_ERROR_UNREF(error);
+ Unref();
+}
+
+//
// WeightedTargetLb::WeightedChild
//
@@ -410,8 +471,6 @@ WeightedTargetLb::WeightedChild::WeightedChild(
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() {
@@ -438,11 +497,7 @@ void WeightedTargetLb::WeightedChild::Orphan() {
// 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;
+ delayed_removal_timer_.reset();
Unref();
}
@@ -475,19 +530,19 @@ WeightedTargetLb::WeightedChild::CreateChildPolicyLocked(
void WeightedTargetLb::WeightedChild::UpdateLocked(
const WeightedTargetLbConfig::ChildConfig& config,
- ServerAddressList addresses, const grpc_channel_args* args) {
+ absl::StatusOr<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 (delayed_removal_timer_ != nullptr) {
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_);
+ delayed_removal_timer_.reset();
}
// Create child policy if needed.
if (child_policy_ == nullptr) {
@@ -529,19 +584,12 @@ void WeightedTargetLb::WeightedChild::OnConnectivityStateUpdateLocked(
// 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;
+ // If the last recorded state was TRANSIENT_FAILURE and the new state
+ // is something other than READY, don't change the state.
+ if (connectivity_state_ != GRPC_CHANNEL_TRANSIENT_FAILURE ||
+ state == GRPC_CHANNEL_READY) {
+ connectivity_state_ = state;
}
- connectivity_state_ = state;
// Notify the LB policy.
weighted_target_policy_->UpdateStateLocked();
}
@@ -557,31 +605,8 @@ void WeightedTargetLb::WeightedChild::DeactivateLocked() {
// 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_handle 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_handle 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);
+ delayed_removal_timer_ = MakeOrphanable<DelayedRemovalTimer>(
+ Ref(DEBUG_LOCATION, "DelayedRemovalTimer"));
}
//
@@ -610,6 +635,11 @@ void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
->RequestReresolution();
}
+absl::string_view WeightedTargetLb::WeightedChild::Helper::GetAuthority() {
+ return weighted_child_->weighted_target_policy_->channel_control_helper()
+ ->GetAuthority();
+}
+
void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) {
if (weighted_child_->weighted_target_policy_->shutting_down_) return;
@@ -658,14 +688,8 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
std::vector<grpc_error_handle> 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_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:targets key:", p.first).c_str());
- for (grpc_error_handle child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("field:targets key:", p.first), &child_errors));
} else {
target_map[p.first] = std::move(child_config);
}
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
index 49bff276..c983648e 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
@@ -23,9 +23,9 @@
#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_certificate_provider.h"
#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_cluster.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
@@ -67,41 +67,42 @@ class CdsLb : public LoadBalancingPolicy {
private:
// Watcher for getting cluster data from XdsClient.
- class ClusterWatcher : public XdsClient::ClusterWatcherInterface {
+ class ClusterWatcher : public XdsClusterResourceType::WatcherInterface {
public:
ClusterWatcher(RefCountedPtr<CdsLb> parent, std::string name)
: parent_(std::move(parent)), name_(std::move(name)) {}
- void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override {
- new Notifier(parent_, name_, std::move(cluster_data));
+ void OnResourceChanged(XdsClusterResource cluster_data) override {
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ // TODO(roth): When we move to C++14, capture cluster_data with
+ // std::move().
+ [this, cluster_data]() mutable {
+ parent_->OnClusterChanged(name_, std::move(cluster_data));
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error_handle error) override {
- new Notifier(parent_, name_, error);
+ void OnError(absl::Status status) override {
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ [this, status]() {
+ parent_->OnError(name_, status);
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ [this]() {
+ parent_->OnResourceDoesNotExist(name_);
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnResourceDoesNotExist() override { new Notifier(parent_, name_); }
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<CdsLb> parent, std::string name,
- XdsApi::CdsUpdate update);
- Notifier(RefCountedPtr<CdsLb> parent, std::string name,
- grpc_error_handle error);
- explicit Notifier(RefCountedPtr<CdsLb> parent, std::string name);
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error_handle error);
- void RunInWorkSerializer(grpc_error_handle error);
-
- RefCountedPtr<CdsLb> parent_;
- std::string name_;
- grpc_closure closure_;
- XdsApi::CdsUpdate update_;
- Type type_;
- };
-
RefCountedPtr<CdsLb> parent_;
std::string name_;
};
@@ -111,7 +112,7 @@ class CdsLb : public LoadBalancingPolicy {
// Not owned, so do not dereference.
ClusterWatcher* watcher = nullptr;
// Most recent update obtained from this watcher.
- absl::optional<XdsApi::CdsUpdate> update;
+ absl::optional<XdsClusterResource> update;
};
// Delegating helper to be passed to child policy.
@@ -123,6 +124,7 @@ class CdsLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -134,19 +136,19 @@ class CdsLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
- bool GenerateDiscoveryMechanismForCluster(
+ absl::StatusOr<bool> GenerateDiscoveryMechanismForCluster(
const std::string& name, Json::Array* discovery_mechanisms,
std::set<std::string>* clusters_needed);
void OnClusterChanged(const std::string& name,
- XdsApi::CdsUpdate cluster_data);
- void OnError(const std::string& name, grpc_error_handle error);
+ XdsClusterResource cluster_data);
+ void OnError(const std::string& name, absl::Status status);
void OnResourceDoesNotExist(const std::string& name);
- grpc_error_handle UpdateXdsCertificateProvider(
- const std::string& cluster_name, const XdsApi::CdsUpdate& cluster_data);
+ absl::Status UpdateXdsCertificateProvider(
+ const std::string& cluster_name, const XdsClusterResource& cluster_data);
void CancelClusterDataWatch(absl::string_view cluster_name,
- XdsClient::ClusterWatcherInterface* watcher,
+ ClusterWatcher* watcher,
bool delay_unsubscription = false);
void MaybeDestroyChildPolicyLocked();
@@ -175,60 +177,6 @@ class CdsLb : public LoadBalancingPolicy {
};
//
-// CdsLb::ClusterWatcher::Notifier
-//
-
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- std::string name,
- XdsApi::CdsUpdate update)
- : parent_(std::move(parent)),
- name_(std::move(name)),
- 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,
- std::string name,
- grpc_error_handle error)
- : parent_(std::move(parent)), name_(std::move(name)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- std::string name)
- : parent_(std::move(parent)), name_(std::move(name)), 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_handle 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_handle error) {
- switch (type_) {
- case kUpdate:
- parent_->OnClusterChanged(name_, std::move(update_));
- break;
- case kError:
- parent_->OnError(name_, error);
- break;
- case kDoesNotExist:
- parent_->OnResourceDoesNotExist(name_);
- break;
- };
- delete this;
-}
-
-//
// CdsLb::Helper
//
@@ -261,6 +209,10 @@ void CdsLb::Helper::RequestReresolution() {
parent_->channel_control_helper()->RequestReresolution();
}
+absl::string_view CdsLb::Helper::GetAuthority() {
+ return parent_->channel_control_helper()->GetAuthority();
+}
+
void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) {
if (parent_->shutting_down_) return;
@@ -348,80 +300,85 @@ void CdsLb::UpdateLocked(UpdateArgs args) {
}
watchers_.clear();
}
- auto watcher = absl::make_unique<ClusterWatcher>(Ref(), config_->cluster());
+ auto watcher = MakeRefCounted<ClusterWatcher>(Ref(), config_->cluster());
watchers_[config_->cluster()].watcher = watcher.get();
- xds_client_->WatchClusterData(config_->cluster(), std::move(watcher));
+ XdsClusterResourceType::StartWatch(xds_client_.get(), config_->cluster(),
+ std::move(watcher));
}
}
-// This method will attempt to generate one or multiple entries of discovery
-// mechanism recursively:
-// For cluster types EDS or LOGICAL_DNS, one discovery mechanism entry may be
-// generated cluster name, type and other data from the CdsUpdate inserted into
-// the entry and the entry appended to the array of entries.
-// Note, discovery mechanism entry can be generated if an CdsUpdate is
-// available; otherwise, just return false. For cluster type AGGREGATE,
-// recursively call the method for each child cluster.
-bool CdsLb::GenerateDiscoveryMechanismForCluster(
+// Generates the discovery mechanism config for the specified cluster name.
+//
+// If no CdsUpdate has been received for the cluster, starts the watcher
+// if needed, and returns false. Otherwise, generates the discovery
+// mechanism config, adds it to *discovery_mechanisms, and returns true.
+//
+// For aggregate clusters, may call itself recursively. Returns an
+// error if there is a loop in the aggregate cluster graph.
+absl::StatusOr<bool> CdsLb::GenerateDiscoveryMechanismForCluster(
const std::string& name, Json::Array* discovery_mechanisms,
std::set<std::string>* clusters_needed) {
- clusters_needed->insert(name);
+ if (!clusters_needed->insert(name).second) {
+ return absl::FailedPreconditionError(absl::StrCat(
+ "aggregate cluster graph contains a loop for cluster ", name));
+ }
auto& state = watchers_[name];
// Create a new watcher if needed.
if (state.watcher == nullptr) {
- auto watcher = absl::make_unique<ClusterWatcher>(Ref(), name);
+ auto watcher = MakeRefCounted<ClusterWatcher>(Ref(), name);
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
name.c_str());
}
state.watcher = watcher.get();
- xds_client_->WatchClusterData(name, std::move(watcher));
+ XdsClusterResourceType::StartWatch(xds_client_.get(), name,
+ std::move(watcher));
return false;
}
// Don't have the update we need yet.
if (!state.update.has_value()) return false;
// For AGGREGATE clusters, recursively expand to child clusters.
- if (state.update->cluster_type == XdsApi::CdsUpdate::ClusterType::AGGREGATE) {
+ if (state.update->cluster_type ==
+ XdsClusterResource::ClusterType::AGGREGATE) {
bool missing_cluster = false;
for (const std::string& child_name :
state.update->prioritized_cluster_names) {
- if (!GenerateDiscoveryMechanismForCluster(
- child_name, discovery_mechanisms, clusters_needed)) {
- missing_cluster = true;
- }
+ auto result = GenerateDiscoveryMechanismForCluster(
+ child_name, discovery_mechanisms, clusters_needed);
+ if (!result.ok()) return result;
+ if (!*result) missing_cluster = true;
}
return !missing_cluster;
}
- std::string type;
+ Json::Object mechanism = {
+ {"clusterName", name},
+ {"max_concurrent_requests", state.update->max_concurrent_requests},
+ };
switch (state.update->cluster_type) {
- case XdsApi::CdsUpdate::ClusterType::EDS:
- type = "EDS";
+ case XdsClusterResource::ClusterType::EDS:
+ mechanism["type"] = "EDS";
+ if (!state.update->eds_service_name.empty()) {
+ mechanism["edsServiceName"] = state.update->eds_service_name;
+ }
break;
- case XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS:
- type = "LOGICAL_DNS";
+ case XdsClusterResource::ClusterType::LOGICAL_DNS:
+ mechanism["type"] = "LOGICAL_DNS";
+ mechanism["dnsHostname"] = state.update->dns_hostname;
break;
default:
GPR_ASSERT(0);
break;
}
- Json::Object mechanism = {
- {"clusterName", name},
- {"max_concurrent_requests", state.update->max_concurrent_requests},
- {"type", std::move(type)},
- };
- if (!state.update->eds_service_name.empty()) {
- mechanism["edsServiceName"] = state.update->eds_service_name;
- }
- if (state.update->lrs_load_reporting_server_name.has_value()) {
- mechanism["lrsLoadReportingServerName"] =
- state.update->lrs_load_reporting_server_name.value();
+ if (state.update->lrs_load_reporting_server.has_value()) {
+ mechanism["lrsLoadReportingServer"] =
+ state.update->lrs_load_reporting_server->ToJson();
}
discovery_mechanisms->emplace_back(std::move(mechanism));
return true;
}
void CdsLb::OnClusterChanged(const std::string& name,
- XdsApi::CdsUpdate cluster_data) {
+ XdsClusterResource cluster_data) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(
GPR_INFO,
@@ -436,10 +393,10 @@ void CdsLb::OnClusterChanged(const std::string& name,
if (it == watchers_.end()) return;
it->second.update = cluster_data;
// Take care of integration with new certificate code.
- grpc_error_handle error = GRPC_ERROR_NONE;
- error = UpdateXdsCertificateProvider(name, it->second.update.value());
- if (error != GRPC_ERROR_NONE) {
- return OnError(name, error);
+ absl::Status status =
+ UpdateXdsCertificateProvider(name, it->second.update.value());
+ if (!status.ok()) {
+ return OnError(name, status);
}
// Scan the map starting from the root cluster to generate the list of
// discovery mechanisms. If we don't have some of the data we need (i.e., we
@@ -447,27 +404,23 @@ void CdsLb::OnClusterChanged(const std::string& name,
// update the child policy at all.
Json::Array discovery_mechanisms;
std::set<std::string> clusters_needed;
- if (GenerateDiscoveryMechanismForCluster(
- config_->cluster(), &discovery_mechanisms, &clusters_needed)) {
+ auto result = GenerateDiscoveryMechanismForCluster(
+ config_->cluster(), &discovery_mechanisms, &clusters_needed);
+ if (!result.ok()) {
+ return OnError(name, result.status());
+ }
+ if (*result) {
+ // LB policy is configured by aggregate cluster, not by the individual
+ // underlying cluster that we may be processing an update for.
+ auto it = watchers_.find(config_->cluster());
+ GPR_ASSERT(it != watchers_.end());
+ const std::string& lb_policy = it->second.update->lb_policy;
// Construct config for child policy.
Json::Object xds_lb_policy;
- if (cluster_data.lb_policy == "RING_HASH") {
- std::string hash_function;
- switch (cluster_data.hash_function) {
- case XdsApi::CdsUpdate::HashFunction::XX_HASH:
- hash_function = "XX_HASH";
- break;
- case XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2:
- hash_function = "MURMUR_HASH_2";
- break;
- default:
- GPR_ASSERT(0);
- break;
- }
+ if (lb_policy == "RING_HASH") {
xds_lb_policy["RING_HASH"] = Json::Object{
{"min_ring_size", cluster_data.min_ring_size},
{"max_ring_size", cluster_data.max_ring_size},
- {"hash_function", hash_function},
};
} else {
xds_lb_policy["ROUND_ROBIN"] = Json::Object();
@@ -489,10 +442,12 @@ void CdsLb::OnClusterChanged(const std::string& name,
gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s",
this, json_str.c_str());
}
+ grpc_error_handle error = GRPC_ERROR_NONE;
RefCountedPtr<LoadBalancingPolicy::Config> config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
if (error != GRPC_ERROR_NONE) {
- OnError(name, error);
+ OnError(name, absl::UnavailableError(grpc_error_std_string(error)));
+ GRPC_ERROR_UNREF(error);
return;
}
// Create child policy if not already present.
@@ -504,8 +459,7 @@ void CdsLb::OnClusterChanged(const std::string& name,
child_policy_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
config->name(), std::move(args));
if (child_policy_ == nullptr) {
- OnError(name, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "failed to create child policy"));
+ OnError(name, absl::UnavailableError("failed to create child policy"));
return;
}
grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
@@ -543,18 +497,17 @@ void CdsLb::OnClusterChanged(const std::string& name,
}
}
-void CdsLb::OnError(const std::string& name, grpc_error_handle error) {
+void CdsLb::OnError(const std::string& name, absl::Status status) {
gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
- this, name.c_str(), grpc_error_std_string(error).c_str());
+ this, name.c_str(), status.ToString().c_str());
// 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),
- absl::make_unique<TransientFailurePicker>(error));
- } else {
- GRPC_ERROR_UNREF(error);
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(
+ absl::UnavailableError(status.ToString())));
}
}
@@ -563,50 +516,43 @@ void CdsLb::OnResourceDoesNotExist(const std::string& name) {
"[cdslb %p] CDS resource for %s does not exist -- reporting "
"TRANSIENT_FAILURE",
this, name.c_str());
- grpc_error_handle error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("CDS resource \"", config_->cluster(),
- "\" does not exist")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ absl::Status status = absl::UnavailableError(
+ absl::StrCat("CDS resource \"", config_->cluster(), "\" does not exist"));
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
MaybeDestroyChildPolicyLocked();
}
-grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
- const std::string& cluster_name, const XdsApi::CdsUpdate& cluster_data) {
+absl::Status CdsLb::UpdateXdsCertificateProvider(
+ const std::string& cluster_name, const XdsClusterResource& cluster_data) {
// Early out if channel is not configured to use xds security.
grpc_channel_credentials* channel_credentials =
grpc_channel_credentials_find_in_args(args_);
if (channel_credentials == nullptr ||
- channel_credentials->type() != kCredentialsTypeXds) {
+ channel_credentials->type() != XdsCredentials::Type()) {
xds_certificate_provider_ = nullptr;
- return GRPC_ERROR_NONE;
+ return absl::OkStatus();
}
if (xds_certificate_provider_ == nullptr) {
xds_certificate_provider_ = MakeRefCounted<XdsCertificateProvider>();
}
// Configure root cert.
absl::string_view root_provider_instance_name =
- cluster_data.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance.instance_name;
+ cluster_data.common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.instance_name;
absl::string_view root_provider_cert_name =
- cluster_data.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance.certificate_name;
+ cluster_data.common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.certificate_name;
RefCountedPtr<XdsCertificateProvider> new_root_provider;
if (!root_provider_instance_name.empty()) {
new_root_provider =
xds_client_->certificate_provider_store()
.CreateOrGetCertificateProvider(root_provider_instance_name);
if (new_root_provider == nullptr) {
- return grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Certificate provider instance name: \"",
- root_provider_instance_name, "\" not recognized.")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return absl::UnavailableError(
+ absl::StrCat("Certificate provider instance name: \"",
+ root_provider_instance_name, "\" not recognized."));
}
}
if (root_certificate_provider_ != new_root_provider) {
@@ -630,24 +576,20 @@ grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
: root_certificate_provider_->distributor());
// Configure identity cert.
absl::string_view identity_provider_instance_name =
- cluster_data.common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name;
+ cluster_data.common_tls_context.tls_certificate_provider_instance
+ .instance_name;
absl::string_view identity_provider_cert_name =
- cluster_data.common_tls_context
- .tls_certificate_certificate_provider_instance.certificate_name;
+ cluster_data.common_tls_context.tls_certificate_provider_instance
+ .certificate_name;
RefCountedPtr<XdsCertificateProvider> new_identity_provider;
if (!identity_provider_instance_name.empty()) {
new_identity_provider =
xds_client_->certificate_provider_store()
.CreateOrGetCertificateProvider(identity_provider_instance_name);
if (new_identity_provider == nullptr) {
- return grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Certificate provider instance name: \"",
- identity_provider_instance_name,
- "\" not recognized.")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return absl::UnavailableError(
+ absl::StrCat("Certificate provider instance name: \"",
+ identity_provider_instance_name, "\" not recognized."));
}
}
if (identity_certificate_provider_ != new_identity_provider) {
@@ -671,15 +613,15 @@ grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
: identity_certificate_provider_->distributor());
// Configure SAN matchers.
const std::vector<StringMatcher>& match_subject_alt_names =
- cluster_data.common_tls_context.combined_validation_context
- .default_validation_context.match_subject_alt_names;
+ cluster_data.common_tls_context.certificate_validation_context
+ .match_subject_alt_names;
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
cluster_name, match_subject_alt_names);
- return GRPC_ERROR_NONE;
+ return absl::OkStatus();
}
void CdsLb::CancelClusterDataWatch(absl::string_view cluster_name,
- XdsClient::ClusterWatcherInterface* watcher,
+ ClusterWatcher* watcher,
bool delay_unsubscription) {
if (xds_certificate_provider_ != nullptr) {
std::string name(cluster_name);
@@ -689,7 +631,7 @@ void CdsLb::CancelClusterDataWatch(absl::string_view cluster_name,
nullptr);
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(name, {});
}
- xds_client_->CancelClusterDataWatch(cluster_name, watcher,
+ XdsClusterResourceType::CancelWatch(xds_client_.get(), cluster_name, watcher,
delay_unsubscription);
}
//
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
index 7546f5b5..85c9642d 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds.h
@@ -19,9 +19,9 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/resolver/server_address.h"
namespace grpc_core {
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
index 2351502c..430f88da 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
@@ -24,6 +24,6 @@
// For testing purpose, this channel arg indicating xds_cluster_resolver LB
// policy should use the fake DNS resolver to resolve logical dns cluster.
#define GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR \
- "grpc.internal.xds_logical_dns_cluster_fake_resolver_response_generator"
+ "grpc.TEST_ONLY.xds_logical_dns_cluster_fake_resolver_response_generator"
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
index 7dbba646..b3ec1b06 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
@@ -16,6 +16,8 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
+
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
@@ -28,10 +30,10 @@
#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/ext/xds/xds_endpoint.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/atomic.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
@@ -57,13 +59,15 @@ class CircuitBreakerCallCounterMap {
explicit CallCounter(Key key) : key_(std::move(key)) {}
~CallCounter() override;
- uint32_t Load() { return concurrent_requests_.Load(MemoryOrder::SEQ_CST); }
- uint32_t Increment() { return concurrent_requests_.FetchAdd(1); }
- void Decrement() { concurrent_requests_.FetchSub(1); }
+ uint32_t Load() {
+ return concurrent_requests_.load(std::memory_order_seq_cst);
+ }
+ uint32_t Increment() { return concurrent_requests_.fetch_add(1); }
+ void Decrement() { concurrent_requests_.fetch_sub(1); }
private:
Key key_;
- Atomic<uint32_t> concurrent_requests_{0};
+ std::atomic<uint32_t> concurrent_requests_{0};
};
RefCountedPtr<CallCounter> GetOrCreate(const std::string& cluster,
@@ -115,14 +119,13 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
XdsClusterImplLbConfig(
RefCountedPtr<LoadBalancingPolicy::Config> child_policy,
std::string cluster_name, std::string eds_service_name,
- absl::optional<std::string> lrs_load_reporting_server_name,
+ absl::optional<XdsBootstrap::XdsServer> lrs_load_reporting_server,
uint32_t max_concurrent_requests,
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config)
+ RefCountedPtr<XdsEndpointResource::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)),
+ lrs_load_reporting_server_(std::move(lrs_load_reporting_server)),
max_concurrent_requests_(max_concurrent_requests),
drop_config_(std::move(drop_config)) {}
@@ -133,11 +136,12 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
}
const std::string& cluster_name() const { return cluster_name_; }
const std::string& eds_service_name() const { return eds_service_name_; }
- const absl::optional<std::string>& lrs_load_reporting_server_name() const {
- return lrs_load_reporting_server_name_;
+ const absl::optional<XdsBootstrap::XdsServer>& lrs_load_reporting_server()
+ const {
+ return lrs_load_reporting_server_;
};
uint32_t max_concurrent_requests() const { return max_concurrent_requests_; }
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config() const {
+ RefCountedPtr<XdsEndpointResource::DropConfig> drop_config() const {
return drop_config_;
}
@@ -145,9 +149,9 @@ class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
RefCountedPtr<LoadBalancingPolicy::Config> child_policy_;
std::string cluster_name_;
std::string eds_service_name_;
- absl::optional<std::string> lrs_load_reporting_server_name_;
+ absl::optional<XdsBootstrap::XdsServer> lrs_load_reporting_server_;
uint32_t max_concurrent_requests_;
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+ RefCountedPtr<XdsEndpointResource::DropConfig> drop_config_;
};
// xDS Cluster Impl LB policy.
@@ -198,9 +202,11 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
PickResult Pick(PickArgs args) override;
private:
+ class SubchannelCallTracker;
+
RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
uint32_t max_concurrent_requests_;
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
+ RefCountedPtr<XdsEndpointResource::DropConfig> drop_config_;
RefCountedPtr<XdsClusterDropStats> drop_stats_;
RefCountedPtr<RefCountedPicker> picker_;
};
@@ -219,6 +225,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -232,7 +239,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
const grpc_channel_args* args);
- void UpdateChildPolicyLocked(ServerAddressList addresses,
+ void UpdateChildPolicyLocked(absl::StatusOr<ServerAddressList> addresses,
const grpc_channel_args* args);
void MaybeUpdatePickerLocked();
@@ -261,6 +268,71 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
};
//
+// XdsClusterImplLb::Picker::SubchannelCallTracker
+//
+
+class XdsClusterImplLb::Picker::SubchannelCallTracker
+ : public LoadBalancingPolicy::SubchannelCallTrackerInterface {
+ public:
+ SubchannelCallTracker(
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ original_subchannel_call_tracker,
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats,
+ RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter)
+ : original_subchannel_call_tracker_(
+ std::move(original_subchannel_call_tracker)),
+ locality_stats_(std::move(locality_stats)),
+ call_counter_(std::move(call_counter)) {}
+
+ ~SubchannelCallTracker() override {
+ locality_stats_.reset(DEBUG_LOCATION, "SubchannelCallTracker");
+ call_counter_.reset(DEBUG_LOCATION, "SubchannelCallTracker");
+ GPR_DEBUG_ASSERT(!started_);
+ }
+
+ void Start() override {
+ // Increment number of calls in flight.
+ call_counter_->Increment();
+ // Record a call started.
+ if (locality_stats_ != nullptr) {
+ locality_stats_->AddCallStarted();
+ }
+ // Delegate if needed.
+ if (original_subchannel_call_tracker_ != nullptr) {
+ original_subchannel_call_tracker_->Start();
+ }
+#ifndef NDEBUG
+ started_ = true;
+#endif
+ }
+
+ void Finish(FinishArgs args) override {
+ // Delegate if needed.
+ if (original_subchannel_call_tracker_ != nullptr) {
+ original_subchannel_call_tracker_->Finish(args);
+ }
+ // Record call completion for load reporting.
+ if (locality_stats_ != nullptr) {
+ locality_stats_->AddCallFinished(!args.status.ok());
+ }
+ // Decrement number of calls in flight.
+ call_counter_->Decrement();
+#ifndef NDEBUG
+ started_ = false;
+#endif
+ }
+
+ private:
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ original_subchannel_call_tracker_;
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
+ RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
+#ifndef NDEBUG
+ bool started_ = false;
+#endif
+};
+
+//
// XdsClusterImplLb::Picker
//
@@ -284,75 +356,48 @@ LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick(
const std::string* 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;
+ return PickResult::Drop(absl::UnavailableError(
+ absl::StrCat("EDS-configured drop: ", *drop_category)));
}
- // Handle circuit breaking.
- uint32_t current = call_counter_->Load();
- // Check and see if we exceeded the max concurrent requests count.
- if (current >= max_concurrent_requests_) {
+ // Check if we exceeded the max concurrent requests circuit breaking limit.
+ // Note: We check the value here, but we don't actually increment the
+ // counter for the current request until the channel calls the subchannel
+ // call tracker's Start() method. This means that we may wind up
+ // allowing more concurrent requests than the configured limit.
+ if (call_counter_->Load() >= max_concurrent_requests_) {
if (drop_stats_ != nullptr) drop_stats_->AddUncategorizedDrops();
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- return result;
+ return PickResult::Drop(absl::UnavailableError("circuit breaker drop"));
}
- call_counter_->Increment();
// 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(
- "xds_cluster_impl picker not given any child picker"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- call_counter_->Decrement();
- return result;
+ return PickResult::Fail(absl::InternalError(
+ "xds_cluster_impl picker not given any child picker"));
}
// Not dropping, so delegate to child picker.
PickResult result = picker_->Pick(args);
- if (result.type == result.PICK_COMPLETE && result.subchannel != nullptr) {
- XdsClusterLocalityStats* locality_stats = nullptr;
+ auto* complete_pick = absl::get_if<PickResult::Complete>(&result.result);
+ if (complete_pick != nullptr) {
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats;
if (drop_stats_ != nullptr) { // If load reporting is enabled.
auto* subchannel_wrapper =
- static_cast<StatsSubchannelWrapper*>(result.subchannel.get());
+ static_cast<StatsSubchannelWrapper*>(complete_pick->subchannel.get());
// Handle load reporting.
- locality_stats = subchannel_wrapper->locality_stats()->Ref().release();
- // Record a call started.
- locality_stats->AddCallStarted();
+ locality_stats = subchannel_wrapper->locality_stats()->Ref(
+ DEBUG_LOCATION, "SubchannelCallTracker");
// Unwrap subchannel to pass back up the stack.
- result.subchannel = subchannel_wrapper->wrapped_subchannel();
+ complete_pick->subchannel = subchannel_wrapper->wrapped_subchannel();
}
- // Intercept the recv_trailing_metadata op to record call completion.
- auto* call_counter = call_counter_->Ref(DEBUG_LOCATION, "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, call_counter](
- grpc_error_handle 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.
- call_counter->Decrement();
- call_counter->Unref(DEBUG_LOCATION, "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);
- }
- };
+ // Inject subchannel call tracker to record call completion.
+ complete_pick->subchannel_call_tracker =
+ absl::make_unique<SubchannelCallTracker>(
+ std::move(complete_pick->subchannel_call_tracker),
+ std::move(locality_stats),
+ call_counter_->Ref(DEBUG_LOCATION, "SubchannelCallTracker"));
} 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.
- call_counter_->Decrement();
}
return result;
}
@@ -417,21 +462,30 @@ void XdsClusterImplLb::UpdateLocked(UpdateArgs args) {
config_ = std::move(args.config);
// On initial update, create drop stats.
if (is_initial_update) {
- if (config_->lrs_load_reporting_server_name().has_value()) {
+ if (config_->lrs_load_reporting_server().has_value()) {
drop_stats_ = xds_client_->AddClusterDropStats(
- config_->lrs_load_reporting_server_name().value(),
- config_->cluster_name(), config_->eds_service_name());
+ config_->lrs_load_reporting_server().value(), config_->cluster_name(),
+ config_->eds_service_name());
+ if (drop_stats_ == nullptr) {
+ gpr_log(GPR_ERROR,
+ "[xds_cluster_impl_lb %p] Failed to get cluster drop stats for "
+ "LRS server %s, cluster %s, EDS service name %s, load "
+ "reporting for drops will not be done.",
+ this, config_->lrs_load_reporting_server()->server_uri.c_str(),
+ config_->cluster_name().c_str(),
+ config_->eds_service_name().c_str());
+ }
}
call_counter_ = g_call_counter_map->GetOrCreate(
config_->cluster_name(), config_->eds_service_name());
} else {
// Cluster name, EDS service name, and LRS server name should never
- // change, because the EDS policy above us should be swapped out if
- // that happens.
+ // change, because the xds_cluster_resolver policy above us should be
+ // swapped out if that happens.
GPR_ASSERT(config_->cluster_name() == old_config->cluster_name());
GPR_ASSERT(config_->eds_service_name() == old_config->eds_service_name());
- GPR_ASSERT(config_->lrs_load_reporting_server_name() ==
- old_config->lrs_load_reporting_server_name());
+ GPR_ASSERT(config_->lrs_load_reporting_server() ==
+ old_config->lrs_load_reporting_server());
}
// Update picker if max_concurrent_requests has changed.
if (is_initial_update || config_->max_concurrent_requests() !=
@@ -450,8 +504,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
gpr_log(GPR_INFO,
"[xds_cluster_impl_lb %p] updating connectivity (drop all): "
- "state=READY "
- "picker=%p",
+ "state=READY picker=%p",
this, drop_picker.get());
}
channel_control_helper()->UpdateState(GRPC_CHANNEL_READY, absl::Status(),
@@ -464,8 +517,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) {
gpr_log(GPR_INFO,
"[xds_cluster_impl_lb %p] updating connectivity: state=%s "
- "status=(%s) "
- "picker=%p",
+ "status=(%s) picker=%p",
this, ConnectivityStateName(state_), status_.ToString().c_str(),
drop_picker.get());
}
@@ -497,8 +549,9 @@ OrphanablePtr<LoadBalancingPolicy> XdsClusterImplLb::CreateChildPolicyLocked(
return lb_policy;
}
-void XdsClusterImplLb::UpdateChildPolicyLocked(ServerAddressList addresses,
- const grpc_channel_args* args) {
+void XdsClusterImplLb::UpdateChildPolicyLocked(
+ absl::StatusOr<ServerAddressList> addresses,
+ const grpc_channel_args* args) {
// Create policy if needed.
if (child_policy_ == nullptr) {
child_policy_ = CreateChildPolicyLocked(args);
@@ -529,7 +582,7 @@ RefCountedPtr<SubchannelInterface> XdsClusterImplLb::Helper::CreateSubchannel(
if (xds_cluster_impl_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 (xds_cluster_impl_policy_->config_->lrs_load_reporting_server_name()
+ if (xds_cluster_impl_policy_->config_->lrs_load_reporting_server()
.has_value()) {
RefCountedPtr<XdsLocalityName> locality_name;
auto* attribute = address.GetAttribute(kXdsLocalityNameAttributeKey);
@@ -540,15 +593,26 @@ RefCountedPtr<SubchannelInterface> XdsClusterImplLb::Helper::CreateSubchannel(
}
RefCountedPtr<XdsClusterLocalityStats> locality_stats =
xds_cluster_impl_policy_->xds_client_->AddClusterLocalityStats(
- *xds_cluster_impl_policy_->config_
- ->lrs_load_reporting_server_name(),
+ xds_cluster_impl_policy_->config_->lrs_load_reporting_server()
+ .value(),
xds_cluster_impl_policy_->config_->cluster_name(),
xds_cluster_impl_policy_->config_->eds_service_name(),
std::move(locality_name));
- return MakeRefCounted<StatsSubchannelWrapper>(
- xds_cluster_impl_policy_->channel_control_helper()->CreateSubchannel(
- std::move(address), args),
- std::move(locality_stats));
+ if (locality_stats != nullptr) {
+ return MakeRefCounted<StatsSubchannelWrapper>(
+ xds_cluster_impl_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args),
+ std::move(locality_stats));
+ }
+ gpr_log(GPR_ERROR,
+ "[xds_cluster_impl_lb %p] Failed to get locality stats object for "
+ "LRS server %s, cluster %s, EDS service name %s; load reports will "
+ "not be generated (not wrapping subchannel)",
+ this,
+ xds_cluster_impl_policy_->config_->lrs_load_reporting_server()
+ ->server_uri.c_str(),
+ xds_cluster_impl_policy_->config_->cluster_name().c_str(),
+ xds_cluster_impl_policy_->config_->eds_service_name().c_str());
}
// Load reporting not enabled, so don't wrap the subchannel.
return xds_cluster_impl_policy_->channel_control_helper()->CreateSubchannel(
@@ -581,6 +645,10 @@ void XdsClusterImplLb::Helper::RequestReresolution() {
xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution();
}
+absl::string_view XdsClusterImplLb::Helper::GetAuthority() {
+ return xds_cluster_impl_policy_->channel_control_helper()->GetAuthority();
+}
+
void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) {
if (xds_cluster_impl_policy_->shutting_down_) return;
@@ -665,14 +733,21 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
}
// LRS load reporting server name.
- absl::optional<std::string> lrs_load_reporting_server_name;
- it = json.object_value().find("lrsLoadReportingServerName");
+ absl::optional<XdsBootstrap::XdsServer> lrs_load_reporting_server;
+ it = json.object_value().find("lrsLoadReportingServer");
if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
+ if (it->second.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:lrsLoadReportingServerName error:type should be string"));
+ "field:lrsLoadReportingServer error:type should be object"));
} else {
- lrs_load_reporting_server_name = it->second.string_value();
+ grpc_error_handle parser_error;
+ lrs_load_reporting_server = XdsBootstrap::XdsServer::Parse(
+ it->second.object_value(), &parser_error);
+ if (parser_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("errors parsing lrs_load_reporting_server")));
+ error_list.push_back(parser_error);
+ }
}
}
// Max concurrent requests.
@@ -688,7 +763,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
}
// Drop config.
- auto drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
+ auto drop_config = MakeRefCounted<XdsEndpointResource::DropConfig>();
it = json.object_value().find("dropCategories");
if (it == json.object_value().end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -708,13 +783,13 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
return MakeRefCounted<XdsClusterImplLbConfig>(
std::move(child_policy), std::move(cluster_name),
- std::move(eds_service_name), std::move(lrs_load_reporting_server_name),
+ std::move(eds_service_name), std::move(lrs_load_reporting_server),
max_concurrent_requests, std::move(drop_config));
}
private:
static std::vector<grpc_error_handle> ParseDropCategories(
- const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
+ const Json& json, XdsEndpointResource::DropConfig* drop_config) {
std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::ARRAY) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -726,8 +801,8 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
std::vector<grpc_error_handle> child_errors =
ParseDropCategory(entry, drop_config);
if (!child_errors.empty()) {
- grpc_error_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("errors parsing index ", i).c_str());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("errors parsing index ", i));
for (size_t i = 0; i < child_errors.size(); ++i) {
error = grpc_error_add_child(error, child_errors[i]);
}
@@ -738,7 +813,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
static std::vector<grpc_error_handle> ParseDropCategory(
- const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
+ const Json& json, XdsEndpointResource::DropConfig* drop_config) {
std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
index 1d4f1431..e1065d27 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
@@ -122,7 +122,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
void Orphan() override;
void UpdateLocked(RefCountedPtr<LoadBalancingPolicy::Config> config,
- const ServerAddressList& addresses,
+ const absl::StatusOr<ServerAddressList>& addresses,
const grpc_channel_args* args);
void ExitIdleLocked();
void ResetBackoffLocked();
@@ -151,6 +151,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
const absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -175,7 +176,6 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
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_;
@@ -195,6 +195,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
// Internal state.
bool shutting_down_ = false;
+ bool update_in_progress_ = false;
// Children.
std::map<std::string, OrphanablePtr<ClusterChild>> children_;
@@ -212,15 +213,8 @@ XdsClusterManagerLb::PickResult XdsClusterManagerLb::ClusterPicker::Pick(
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(
- absl::StrCat("xds cluster manager picker: unknown cluster \"",
- cluster_name, "\"")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- return result;
+ return PickResult::Fail(absl::InternalError(absl::StrCat(
+ "xds cluster manager picker: unknown cluster \"", cluster_name, "\"")));
}
//
@@ -260,6 +254,7 @@ void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] Received update", this);
}
+ update_in_progress_ = true;
// Update config.
config_ = std::move(args.config);
// Deactivate the children not in the new config.
@@ -274,19 +269,24 @@ void XdsClusterManagerLb::UpdateLocked(UpdateArgs args) {
for (const auto& p : config_->cluster_map()) {
const std::string& 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;
+ auto& child = children_[name];
+ if (child == nullptr) {
+ child = MakeOrphanable<ClusterChild>(Ref(DEBUG_LOCATION, "ClusterChild"),
+ name);
}
- it->second->UpdateLocked(config, args.addresses, args.args);
+ child->UpdateLocked(config, args.addresses, args.args);
}
+ update_in_progress_ = false;
UpdateStateLocked();
}
void XdsClusterManagerLb::UpdateStateLocked() {
+ // If we're in the process of propagating an update from our parent to
+ // our children, ignore any updates that come from the children. We
+ // will instead return a new picker once the update has been seen by
+ // all children. This avoids unnecessary picker churn while an update
+ // is being propagated to our children.
+ if (update_in_progress_) return;
// Also count the number of children in each state, to determine the
// overall state.
size_t num_ready = 0;
@@ -447,7 +447,8 @@ XdsClusterManagerLb::ClusterChild::CreateChildPolicyLocked(
void XdsClusterManagerLb::ClusterChild::UpdateLocked(
RefCountedPtr<LoadBalancingPolicy::Config> config,
- const ServerAddressList& addresses, const grpc_channel_args* args) {
+ const absl::StatusOr<ServerAddressList>& addresses,
+ const grpc_channel_args* args) {
if (xds_cluster_manager_policy_->shutting_down_) return;
// Update child weight.
// Reactivate if needed.
@@ -492,7 +493,8 @@ void XdsClusterManagerLb::ClusterChild::DeactivateLocked() {
Ref(DEBUG_LOCATION, "ClusterChild+timer").release();
grpc_timer_init(&delayed_removal_timer_,
ExecCtx::Get()->Now() +
- GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS,
+ Duration::Milliseconds(
+ GRPC_XDS_CLUSTER_MANAGER_CHILD_RETENTION_INTERVAL_MS),
&on_delayed_removal_timer_);
delayed_removal_timer_callback_pending_ = true;
}
@@ -500,7 +502,7 @@ void XdsClusterManagerLb::ClusterChild::DeactivateLocked() {
void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimer(
void* arg, grpc_error_handle error) {
ClusterChild* self = static_cast<ClusterChild*>(arg);
- GRPC_ERROR_REF(error); // Ref owned by the lambda
+ (void)GRPC_ERROR_REF(error); // Ref owned by the lambda
self->xds_cluster_manager_policy_->work_serializer()->Run(
[self, error]() { self->OnDelayedRemovalTimerLocked(error); },
DEBUG_LOCATION);
@@ -551,19 +553,13 @@ void XdsClusterManagerLb::ClusterChild::Helper::UpdateState(
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;
+ // If the last recorded state was TRANSIENT_FAILURE and the new state
+ // is something other than READY, don't change the state.
+ if (xds_cluster_manager_child_->connectivity_state_ !=
+ GRPC_CHANNEL_TRANSIENT_FAILURE ||
+ state == GRPC_CHANNEL_READY) {
+ xds_cluster_manager_child_->connectivity_state_ = state;
}
- xds_cluster_manager_child_->connectivity_state_ = state;
// Notify the LB policy.
xds_cluster_manager_child_->xds_cluster_manager_policy_->UpdateStateLocked();
}
@@ -577,6 +573,12 @@ void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
->RequestReresolution();
}
+absl::string_view XdsClusterManagerLb::ClusterChild::Helper::GetAuthority() {
+ return xds_cluster_manager_child_->xds_cluster_manager_policy_
+ ->channel_control_helper()
+ ->GetAuthority();
+}
+
void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
TraceSeverity severity, absl::string_view message) {
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {
@@ -634,14 +636,8 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
std::vector<grpc_error_handle> 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_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:children name:", child_name).c_str());
- for (grpc_error_handle child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("field:children name:", child_name), &child_errors));
} else {
cluster_map[child_name] = std::move(child_config);
clusters_to_be_used.insert(child_name);
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
index bcb81945..b9fa5fa9 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
@@ -28,21 +28,25 @@
#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/ring_hash/ring_hash.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.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/fake/fake_resolver.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.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_channel_args.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/ext/xds/xds_endpoint.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.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"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -63,7 +67,7 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
public:
struct DiscoveryMechanism {
std::string cluster_name;
- absl::optional<std::string> lrs_load_reporting_server_name;
+ absl::optional<XdsBootstrap::XdsServer> lrs_load_reporting_server;
uint32_t max_concurrent_requests;
enum DiscoveryMechanismType {
EDS,
@@ -71,13 +75,15 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
};
DiscoveryMechanismType type;
std::string eds_service_name;
+ std::string dns_hostname;
bool operator==(const DiscoveryMechanism& other) const {
return (cluster_name == other.cluster_name &&
- lrs_load_reporting_server_name ==
- other.lrs_load_reporting_server_name &&
+ lrs_load_reporting_server == other.lrs_load_reporting_server &&
max_concurrent_requests == other.max_concurrent_requests &&
- type == other.type && eds_service_name == other.eds_service_name);
+ type == other.type &&
+ eds_service_name == other.eds_service_name &&
+ dns_hostname == other.dns_hostname);
}
};
@@ -101,8 +107,7 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
// Xds Cluster Resolver LB policy.
class XdsClusterResolverLb : public LoadBalancingPolicy {
public:
- XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client, Args args,
- std::string server_name, bool is_xds_uri);
+ XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client, Args args);
const char* name() const override { return kXdsClusterResolver; }
@@ -126,36 +131,14 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
RefCountedPtr<XdsClusterResolverLb> xds_cluster_resolver_lb,
size_t index)
: parent_(std::move(xds_cluster_resolver_lb)), index_(index) {}
- virtual void Start() = 0;
- void Orphan() override = 0;
- virtual Json::Array override_child_policy() = 0;
- virtual bool disable_reresolution() = 0;
- // Caller must ensure that config_ is set before calling.
- absl::string_view GetXdsClusterResolverResourceName() const {
- if (!parent_->is_xds_uri_) return parent_->server_name_;
- if (!parent_->config_->discovery_mechanisms()[index_]
- .eds_service_name.empty()) {
- return parent_->config_->discovery_mechanisms()[index_]
- .eds_service_name;
- }
- return parent_->config_->discovery_mechanisms()[index_].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<absl::string_view, absl::string_view> GetLrsClusterKey() const {
- if (!parent_->is_xds_uri_) return {parent_->server_name_, nullptr};
- return {
- parent_->config_->discovery_mechanisms()[index_].cluster_name,
- parent_->config_->discovery_mechanisms()[index_].eds_service_name};
- }
-
- protected:
XdsClusterResolverLb* parent() const { return parent_.get(); }
size_t index() const { return index_; }
+ virtual void Start() = 0;
+ virtual Json::Array override_child_policy() = 0;
+ virtual bool disable_reresolution() = 0;
+
private:
RefCountedPtr<XdsClusterResolverLb> parent_;
// Stores its own index in the vector of DiscoveryMechanism.
@@ -174,7 +157,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
bool disable_reresolution() override { return true; }
private:
- class EndpointWatcher : public XdsClient::EndpointWatcherInterface {
+ class EndpointWatcher : public XdsEndpointResourceType::WatcherInterface {
public:
explicit EndpointWatcher(
RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism)
@@ -182,42 +165,65 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
~EndpointWatcher() override {
discovery_mechanism_.reset(DEBUG_LOCATION, "EndpointWatcher");
}
- void OnEndpointChanged(XdsApi::EdsUpdate update) override {
- new Notifier(discovery_mechanism_, std::move(update));
+ void OnResourceChanged(XdsEndpointResource update) override {
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ // TODO(yashykt): When we move to C++14, capture update with
+ // std::move
+ [this, update]() mutable {
+ OnResourceChangedHelper(std::move(update));
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error_handle error) override {
- new Notifier(discovery_mechanism_, error);
+ void OnError(absl::Status status) override {
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ [this, status]() {
+ OnErrorHelper(status);
+ Unref();
+ },
+ DEBUG_LOCATION);
}
void OnResourceDoesNotExist() override {
- new Notifier(discovery_mechanism_);
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ [this]() {
+ OnResourceDoesNotExistHelper();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism,
- XdsApi::EdsUpdate update);
- Notifier(RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism,
- grpc_error_handle error);
- explicit Notifier(
- RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism);
- ~Notifier() { discovery_mechanism_.reset(DEBUG_LOCATION, "Notifier"); }
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error_handle error);
- void RunInWorkSerializer(grpc_error_handle error);
-
- RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism_;
- grpc_closure closure_;
- XdsApi::EdsUpdate update_;
- Type type_;
- };
-
+ // Code accessing protected methods of `DiscoveryMechanism` need to be
+ // in methods of this class rather than in lambdas to work around an MSVC
+ // bug.
+ void OnResourceChangedHelper(XdsEndpointResource update) {
+ discovery_mechanism_->parent()->OnEndpointChanged(
+ discovery_mechanism_->index(), std::move(update));
+ }
+ void OnErrorHelper(absl::Status status) {
+ discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(),
+ status);
+ }
+ void OnResourceDoesNotExistHelper() {
+ discovery_mechanism_->parent()->OnResourceDoesNotExist(
+ discovery_mechanism_->index());
+ }
RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism_;
};
+ // This is necessary only because of a bug in msvc where nested class
+ // cannot access protected member in base class.
+ friend class EndpointWatcher;
+
+ absl::string_view GetEdsResourceName() const {
+ auto& config = parent()->config_->discovery_mechanisms()[index()];
+ if (!config.eds_service_name.empty()) return config.eds_service_name;
+ return config.cluster_name;
+ }
+
// Note that this is not owned, so this pointer must never be dereferenced.
EndpointWatcher* watcher_ = nullptr;
};
@@ -248,30 +254,31 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
~ResolverResultHandler() override {}
- void ReturnResult(Resolver::Result result) override;
-
- void ReturnError(grpc_error_handle error) override;
+ void ReportResult(Resolver::Result result) override;
private:
RefCountedPtr<LogicalDNSDiscoveryMechanism> discovery_mechanism_;
};
- // This is only necessary because of a bug in msvc where nested class cannot
+
+ // This is necessary only because of a bug in msvc where nested class cannot
// access protected member in base class.
friend class ResolverResultHandler;
+
OrphanablePtr<Resolver> resolver_;
};
struct DiscoveryMechanismEntry {
OrphanablePtr<DiscoveryMechanism> discovery_mechanism;
- bool first_update_received = false;
- // Number of priorities this mechanism has contributed to priority_list_.
- // (The sum of this across all discovery mechanisms should always equal
- // the number of priorities in priority_list_.)
- uint32_t num_priorities = 0;
- RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config;
- // Populated only when an update has been delivered by the mechanism
- // but has not yet been applied to the LB policy's combined priority_list_.
- absl::optional<XdsApi::EdsUpdate::PriorityList> pending_priority_list;
+ // Most recent update reported by the discovery mechanism.
+ absl::optional<XdsEndpointResource> latest_update;
+ // State used to retain child policy names for priority policy.
+ std::vector<size_t /*child_number*/> priority_child_numbers;
+ size_t next_available_child_number = 0;
+
+ const XdsClusterResolverLbConfig::DiscoveryMechanism& config() const;
+
+ // Returns the child policy name for a given priority.
+ std::string GetChildPolicyName(size_t priority) const;
};
class Helper : public ChannelControlHelper {
@@ -292,6 +299,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// This is a no-op, because we get the addresses from the xds
// client, which is a watch-based API.
void RequestReresolution() override {}
+ absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
absl::string_view message) override;
@@ -303,13 +311,12 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
- void OnEndpointChanged(size_t index, XdsApi::EdsUpdate update);
- void OnError(size_t index, grpc_error_handle error);
+ void OnEndpointChanged(size_t index, XdsEndpointResource update);
+ void OnError(size_t index, absl::Status status);
void OnResourceDoesNotExist(size_t index);
void MaybeDestroyChildPolicyLocked();
- void UpdatePriorityList(XdsApi::EdsUpdate::PriorityList priority_list);
void UpdateChildPolicyLocked();
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
const grpc_channel_args* args);
@@ -321,10 +328,6 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// The xds client and endpoint watcher.
RefCountedPtr<XdsClient> xds_client_;
- // Server name from target URI.
- std::string server_name_;
- bool is_xds_uri_;
-
// Current channel args and config from the resolver.
const grpc_channel_args* args_ = nullptr;
RefCountedPtr<XdsClusterResolverLbConfig> config_;
@@ -335,11 +338,6 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// Vector of discovery mechansism entries in priority order.
std::vector<DiscoveryMechanismEntry> discovery_mechanisms_;
- // 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_;
-
OrphanablePtr<LoadBalancingPolicy> child_policy_;
};
@@ -373,6 +371,10 @@ void XdsClusterResolverLb::Helper::UpdateState(
state, status, std::move(picker));
}
+absl::string_view XdsClusterResolverLb::Helper::GetAuthority() {
+ return xds_cluster_resolver_policy_->channel_control_helper()->GetAuthority();
+}
+
void XdsClusterResolverLb::Helper::AddTraceEvent(TraceSeverity severity,
absl::string_view message) {
if (xds_cluster_resolver_policy_->shutting_down_) return;
@@ -389,14 +391,13 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::Start() {
gpr_log(GPR_INFO,
"[xds_cluster_resolver_lb %p] eds discovery mechanism %" PRIuPTR
":%p starting xds watch for %s",
- parent(), index(), this,
- std::string(GetXdsClusterResolverResourceName()).c_str());
+ parent(), index(), this, std::string(GetEdsResourceName()).c_str());
}
- auto watcher = absl::make_unique<EndpointWatcher>(
+ auto watcher = MakeRefCounted<EndpointWatcher>(
Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"));
watcher_ = watcher.get();
- parent()->xds_client_->WatchEndpointData(GetXdsClusterResolverResourceName(),
- std::move(watcher));
+ XdsEndpointResourceType::StartWatch(parent()->xds_client_.get(),
+ GetEdsResourceName(), std::move(watcher));
}
void XdsClusterResolverLb::EdsDiscoveryMechanism::Orphan() {
@@ -404,80 +405,20 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::Orphan() {
gpr_log(GPR_INFO,
"[xds_cluster_resolver_lb %p] eds discovery mechanism %" PRIuPTR
":%p cancelling xds watch for %s",
- parent(), index(), this,
- std::string(GetXdsClusterResolverResourceName()).c_str());
+ parent(), index(), this, std::string(GetEdsResourceName()).c_str());
}
- parent()->xds_client_->CancelEndpointDataWatch(
- GetXdsClusterResolverResourceName(), watcher_);
+ XdsEndpointResourceType::CancelWatch(parent()->xds_client_.get(),
+ GetEdsResourceName(), watcher_);
Unref();
}
//
-// XdsClusterResolverLb::EndpointWatcher::Notifier
-//
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism,
- XdsApi::EdsUpdate update)
- : discovery_mechanism_(std::move(discovery_mechanism)),
- update_(std::move(update)),
- type_(kUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism,
- grpc_error_handle error)
- : discovery_mechanism_(std::move(discovery_mechanism)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism)
- : discovery_mechanism_(std::move(discovery_mechanism)),
- type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- RunInExecCtx(void* arg, grpc_error_handle error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->discovery_mechanism_->parent()->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- RunInWorkSerializer(grpc_error_handle error) {
- switch (type_) {
- case kUpdate:
- discovery_mechanism_->parent()->OnEndpointChanged(
- discovery_mechanism_->index(), std::move(update_));
- break;
- case kError:
- discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(),
- error);
- break;
- case kDoesNotExist:
- discovery_mechanism_->parent()->OnResourceDoesNotExist(
- discovery_mechanism_->index());
- break;
- };
- delete this;
-}
-
-//
// XdsClusterResolverLb::LogicalDNSDiscoveryMechanism
//
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
- std::string target = parent()->server_name_;
+ std::string target =
+ parent()->config_->discovery_mechanisms()[index()].dns_hostname;
grpc_channel_args* args = nullptr;
FakeResolverResponseGenerator* fake_resolver_response_generator =
grpc_channel_args_find_pointer<FakeResolverResponseGenerator>(
@@ -489,9 +430,10 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
fake_resolver_response_generator);
args = grpc_channel_args_copy_and_add(parent()->args_, &new_arg, 1);
} else {
+ target = absl::StrCat("dns:", target);
args = grpc_channel_args_copy(parent()->args_);
}
- resolver_ = ResolverRegistry::CreateResolver(
+ resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
target.c_str(), args, parent()->interested_parties(),
parent()->work_serializer(),
absl::make_unique<ResolverResultHandler>(
@@ -527,23 +469,41 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Orphan() {
//
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
- ReturnResult(Resolver::Result result) {
- // convert result to eds update
- XdsApi::EdsUpdate update;
- XdsApi::EdsUpdate::Priority::Locality locality;
+ ReportResult(Resolver::Result result) {
+ if (!result.addresses.ok()) {
+ discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(),
+ result.addresses.status());
+ return;
+ }
+ // Convert resolver result to EDS update.
+ // TODO(roth): Figure out a way to pass resolution_note through to the
+ // child policy.
+ XdsEndpointResource update;
+ XdsEndpointResource::Priority::Locality locality;
locality.name = MakeRefCounted<XdsLocalityName>("", "", "");
locality.lb_weight = 1;
- locality.endpoints = std::move(result.addresses);
- XdsApi::EdsUpdate::Priority priority;
+ locality.endpoints = std::move(*result.addresses);
+ XdsEndpointResource::Priority priority;
priority.localities.emplace(locality.name.get(), std::move(locality));
update.priorities.emplace_back(std::move(priority));
discovery_mechanism_->parent()->OnEndpointChanged(
discovery_mechanism_->index(), std::move(update));
}
-void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
- ReturnError(grpc_error_handle error) {
- discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(), error);
+//
+// XdsClusterResolverLb::DiscoveryMechanismEntry
+//
+
+const XdsClusterResolverLbConfig::DiscoveryMechanism&
+XdsClusterResolverLb::DiscoveryMechanismEntry::config() const {
+ return discovery_mechanism->parent()
+ ->config_->discovery_mechanisms()[discovery_mechanism->index()];
+}
+
+std::string XdsClusterResolverLb::DiscoveryMechanismEntry::GetChildPolicyName(
+ size_t priority) const {
+ return absl::StrCat("{cluster=", config().cluster_name,
+ ", child_number=", priority_child_numbers[priority], "}");
}
//
@@ -551,30 +511,11 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
//
XdsClusterResolverLb::XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client,
- Args args, std::string server_name,
- bool is_xds_uri)
- : LoadBalancingPolicy(std::move(args)),
- xds_client_(std::move(xds_client)),
- server_name_(std::move(server_name)),
- is_xds_uri_(is_xds_uri) {
+ Args args)
+ : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_cluster_resolver_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_resolver_lb %p] created -- xds_client=%p, "
- "server_name=%s, is_xds_uri=%d",
- this, xds_client_.get(), server_name_.c_str(), is_xds_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());
+ gpr_log(GPR_INFO, "[xds_cluster_resolver_lb %p] created -- xds_client=%p",
+ this, xds_client_.get());
}
}
@@ -594,18 +535,6 @@ void XdsClusterResolverLb::ShutdownLocked() {
shutting_down_ = true;
MaybeDestroyChildPolicyLocked();
discovery_mechanisms_.clear();
- 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, "XdsClusterResolverLb");
// Destroy channel args.
grpc_channel_args_destroy(args_);
@@ -640,14 +569,13 @@ void XdsClusterResolverLb::UpdateLocked(UpdateArgs args) {
DiscoveryMechanismEntry entry;
if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::EDS) {
- entry.discovery_mechanism =
- grpc_core::MakeOrphanable<EdsDiscoveryMechanism>(
- Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"),
- discovery_mechanisms_.size());
+ entry.discovery_mechanism = MakeOrphanable<EdsDiscoveryMechanism>(
+ Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"),
+ discovery_mechanisms_.size());
} else if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::LOGICAL_DNS) {
entry.discovery_mechanism =
- grpc_core::MakeOrphanable<LogicalDNSDiscoveryMechanism>(
+ MakeOrphanable<LogicalDNSDiscoveryMechanism>(
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism"),
discovery_mechanisms_.size());
} else {
@@ -663,9 +591,6 @@ void XdsClusterResolverLb::UpdateLocked(UpdateArgs args) {
}
void XdsClusterResolverLb::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();
}
@@ -676,7 +601,7 @@ void XdsClusterResolverLb::ExitIdleLocked() {
}
void XdsClusterResolverLb::OnEndpointChanged(size_t index,
- XdsApi::EdsUpdate update) {
+ XdsEndpointResource update) {
if (shutting_down_) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_cluster_resolver_trace)) {
gpr_log(GPR_INFO,
@@ -684,100 +609,37 @@ void XdsClusterResolverLb::OnEndpointChanged(size_t index,
" for discovery mechanism %" PRIuPTR "",
this, index);
}
+ DiscoveryMechanismEntry& discovery_entry = discovery_mechanisms_[index];
// We need at least one priority for each discovery mechanism, just so that we
// have a child in which to create the xds_cluster_impl policy. This ensures
// that we properly handle the case of a discovery mechanism dropping 100% of
// calls, the OnError() case, and the OnResourceDoesNotExist() case.
if (update.priorities.empty()) update.priorities.emplace_back();
- discovery_mechanisms_[index].drop_config = std::move(update.drop_config);
- discovery_mechanisms_[index].pending_priority_list =
- std::move(update.priorities);
- discovery_mechanisms_[index].first_update_received = true;
- // If any discovery mechanism has not received its first update,
- // wait until that happens before creating the child policy.
- // TODO(roth): If this becomes problematic in the future (e.g., a
- // secondary discovery mechanism delaying us from starting up at all),
- // we can consider some sort of optimization whereby we can create the
- // priority policy with only a subset of its children. But we need to
- // make sure not to get into a situation where the priority policy
- // will put the channel into TRANSIENT_FAILURE instead of CONNECTING
- // while we're still waiting for the other discovery mechanism(s).
- for (DiscoveryMechanismEntry& mechanism : discovery_mechanisms_) {
- if (!mechanism.first_update_received) return;
- }
- // Construct new priority list.
- XdsApi::EdsUpdate::PriorityList priority_list;
- size_t priority_index = 0;
- for (DiscoveryMechanismEntry& mechanism : discovery_mechanisms_) {
- // If the mechanism has a pending update, use that.
- // Otherwise, use the priorities that it previously contributed to the
- // combined list.
- if (mechanism.pending_priority_list.has_value()) {
- priority_list.insert(priority_list.end(),
- mechanism.pending_priority_list->begin(),
- mechanism.pending_priority_list->end());
- priority_index += mechanism.num_priorities;
- mechanism.num_priorities = mechanism.pending_priority_list->size();
- mechanism.pending_priority_list.reset();
- } else {
- priority_list.insert(
- priority_list.end(), priority_list_.begin() + priority_index,
- priority_list_.begin() + priority_index + mechanism.num_priorities);
- priority_index += mechanism.num_priorities;
- }
- }
- // Update child policy.
- UpdatePriorityList(std::move(priority_list));
-}
-
-void XdsClusterResolverLb::OnError(size_t index, grpc_error_handle error) {
- gpr_log(GPR_ERROR,
- "[xds_cluster_resolver_lb %p] discovery mechanism %" PRIuPTR
- " xds watcher reported error: %s",
- this, index, grpc_error_std_string(error).c_str());
- GRPC_ERROR_UNREF(error);
- if (shutting_down_) return;
- if (!discovery_mechanisms_[index].first_update_received) {
- // Call OnEndpointChanged with an empty update just like
- // OnResourceDoesNotExist.
- OnEndpointChanged(index, XdsApi::EdsUpdate());
- }
-}
-
-void XdsClusterResolverLb::OnResourceDoesNotExist(size_t index) {
- gpr_log(GPR_ERROR,
- "[xds_cluster_resolver_lb %p] discovery mechanism %" PRIuPTR
- " resource does not exist",
- this, index);
- if (shutting_down_) return;
- // Call OnEndpointChanged with an empty update.
- OnEndpointChanged(index, XdsApi::EdsUpdate());
-}
-
-//
-// child policy-related methods
-//
-
-void XdsClusterResolverLb::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_.
+ // Update priority_child_numbers, reusing old child numbers in an
+ // intelligent way to avoid unnecessary churn.
+ // First, build some maps from locality to child number and the reverse
+ // from the old data in the entry's update 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);
+ std::map<size_t, std::set<XdsLocalityName*, XdsLocalityName::Less>>
+ child_locality_map;
+ if (discovery_entry.latest_update.has_value()) {
+ const auto& prev_priority_list = discovery_entry.latest_update->priorities;
+ for (size_t priority = 0; priority < prev_priority_list.size();
+ ++priority) {
+ size_t child_number = discovery_entry.priority_child_numbers[priority];
+ const auto& localities = prev_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;
+ for (size_t priority = 0; priority < update.priorities.size(); ++priority) {
+ const auto& localities = update.priorities[priority].localities;
absl::optional<size_t> child_number;
// If one of the localities in this priority already existed, reuse its
// child number.
@@ -805,10 +667,11 @@ void XdsClusterResolverLb::UpdatePriorityList(
}
// If we didn't find an existing child number, assign a new one.
if (!child_number.has_value()) {
- for (child_number = 0;
+ for (child_number = discovery_entry.next_available_child_number;
child_locality_map.find(*child_number) != child_locality_map.end();
++(*child_number)) {
}
+ discovery_entry.next_available_child_number = *child_number + 1;
// 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];
@@ -816,35 +679,87 @@ void XdsClusterResolverLb::UpdatePriorityList(
priority_child_numbers.push_back(*child_number);
}
// Save update.
- priority_list_ = std::move(priority_list);
- priority_child_numbers_ = std::move(priority_child_numbers);
+ discovery_entry.latest_update = std::move(update);
+ discovery_entry.priority_child_numbers = std::move(priority_child_numbers);
+ // If any discovery mechanism has not received its first update,
+ // wait until that happens before creating the child policy.
+ // TODO(roth): If this becomes problematic in the future (e.g., a
+ // secondary discovery mechanism delaying us from starting up at all),
+ // we can consider some sort of optimization whereby we can create the
+ // priority policy with only a subset of its children. But we need to
+ // make sure not to get into a situation where the priority policy
+ // will put the channel into TRANSIENT_FAILURE instead of CONNECTING
+ // while we're still waiting for the other discovery mechanism(s).
+ for (DiscoveryMechanismEntry& mechanism : discovery_mechanisms_) {
+ if (!mechanism.latest_update.has_value()) return;
+ }
// Update child policy.
UpdateChildPolicyLocked();
}
+void XdsClusterResolverLb::OnError(size_t index, absl::Status status) {
+ gpr_log(GPR_ERROR,
+ "[xds_cluster_resolver_lb %p] discovery mechanism %" PRIuPTR
+ " xds watcher reported error: %s",
+ this, index, status.ToString().c_str());
+ if (shutting_down_) return;
+ if (!discovery_mechanisms_[index].latest_update.has_value()) {
+ // Call OnEndpointChanged with an empty update just like
+ // OnResourceDoesNotExist.
+ OnEndpointChanged(index, XdsEndpointResource());
+ }
+}
+
+void XdsClusterResolverLb::OnResourceDoesNotExist(size_t index) {
+ gpr_log(GPR_ERROR,
+ "[xds_cluster_resolver_lb %p] discovery mechanism %" PRIuPTR
+ " resource does not exist",
+ this, index);
+ if (shutting_down_) return;
+ // Call OnEndpointChanged with an empty update.
+ OnEndpointChanged(index, XdsEndpointResource());
+}
+
+//
+// child policy-related methods
+//
+
ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
ServerAddressList addresses;
- for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
- const auto& localities = priority_list_[priority].localities;
- std::string priority_child_name =
- 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<std::string> 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,
- absl::make_unique<XdsLocalityAttribute>(
- locality_name->Ref()))
- .WithAttribute(ServerAddressWeightAttribute::
- kServerAddressWeightAttributeKey,
- absl::make_unique<ServerAddressWeightAttribute>(
- locality.lb_weight)));
+ for (const auto& discovery_entry : discovery_mechanisms_) {
+ for (size_t priority = 0;
+ priority < discovery_entry.latest_update->priorities.size();
+ ++priority) {
+ const auto& priority_entry =
+ discovery_entry.latest_update->priorities[priority];
+ std::string priority_child_name =
+ discovery_entry.GetChildPolicyName(priority);
+ for (const auto& p : priority_entry.localities) {
+ const auto& locality_name = p.first;
+ const auto& locality = p.second;
+ std::vector<std::string> hierarchical_path = {
+ priority_child_name, locality_name->AsHumanReadableString()};
+ for (const auto& endpoint : locality.endpoints) {
+ const ServerAddressWeightAttribute* weight_attribute = static_cast<
+ const ServerAddressWeightAttribute*>(endpoint.GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ uint32_t weight = locality.lb_weight;
+ if (weight_attribute != nullptr) {
+ weight = locality.lb_weight * weight_attribute->weight();
+ }
+ addresses.emplace_back(
+ endpoint
+ .WithAttribute(
+ kHierarchicalPathAttributeKey,
+ MakeHierarchicalPathAttribute(hierarchical_path))
+ .WithAttribute(kXdsLocalityNameAttributeKey,
+ absl::make_unique<XdsLocalityAttribute>(
+ locality_name->Ref()))
+ .WithAttribute(
+ ServerAddressWeightAttribute::
+ kServerAddressWeightAttributeKey,
+ absl::make_unique<ServerAddressWeightAttribute>(weight)));
+ }
}
}
}
@@ -855,139 +770,106 @@ RefCountedPtr<LoadBalancingPolicy::Config>
XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
Json::Object priority_children;
Json::Array priority_priorities;
- // Setting up index to iterate through the discovery mechanisms and keeping
- // track the discovery_mechanism each priority belongs to.
- size_t discovery_index = 0;
- // Setting up num_priorities_remaining to track the priorities in each
- // discovery_mechanism.
- size_t num_priorities_remaining_in_discovery =
- discovery_mechanisms_[discovery_index].num_priorities;
- for (size_t priority = 0; priority < priority_list_.size(); ++priority) {
- Json child_policy;
- if (!discovery_mechanisms_[discovery_index]
- .discovery_mechanism->override_child_policy()
- .empty()) {
- child_policy = discovery_mechanisms_[discovery_index]
- .discovery_mechanism->override_child_policy();
- } else {
- const auto& xds_lb_policy = config_->xds_lb_policy().object_value();
- if (xds_lb_policy.find("ROUND_ROBIN") != xds_lb_policy.end()) {
- 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["sub_zone"] = locality_name->sub_zone();
+ for (const auto& discovery_entry : discovery_mechanisms_) {
+ const auto& discovery_config = discovery_entry.config();
+ for (size_t priority = 0;
+ priority < discovery_entry.latest_update->priorities.size();
+ ++priority) {
+ const auto& priority_entry =
+ discovery_entry.latest_update->priorities[priority];
+ Json child_policy;
+ if (!discovery_entry.discovery_mechanism->override_child_policy()
+ .empty()) {
+ child_policy =
+ discovery_entry.discovery_mechanism->override_child_policy();
+ } else {
+ const auto& xds_lb_policy = config_->xds_lb_policy().object_value();
+ if (xds_lb_policy.find("ROUND_ROBIN") != xds_lb_policy.end()) {
+ const auto& localities = priority_entry.localities;
+ Json::Object weighted_targets;
+ for (const auto& p : localities) {
+ XdsLocalityName* locality_name = p.first;
+ const auto& locality = p.second;
+ // Add weighted target entry.
+ weighted_targets[locality_name->AsHumanReadableString()] =
+ Json::Object{
+ {"weight", locality.lb_weight},
+ {"childPolicy",
+ Json::Array{
+ Json::Object{
+ {"round_robin", Json::Object()},
+ },
+ }},
+ };
}
- // Add weighted target entry.
- weighted_targets[locality_name->AsHumanReadableString()] =
+ // Construct locality-picking policy.
+ // Start with field from our config and add the "targets" field.
+ child_policy = Json::Array{
Json::Object{
- {"weight", locality.lb_weight},
- {"childPolicy",
- Json::Array{
- Json::Object{
- {"round_robin", Json::Object()},
- },
+ {"weighted_target_experimental",
+ Json::Object{
+ {"targets", Json::Object()},
}},
- };
+ },
+ };
+ Json::Object& config =
+ *(*child_policy.mutable_array())[0].mutable_object();
+ auto it = config.begin();
+ GPR_ASSERT(it != config.end());
+ (*it->second.mutable_object())["targets"] =
+ std::move(weighted_targets);
+ } else {
+ auto it = xds_lb_policy.find("RING_HASH");
+ GPR_ASSERT(it != xds_lb_policy.end());
+ Json::Object ring_hash_experimental_policy =
+ it->second.object_value();
+ child_policy = Json::Array{
+ Json::Object{
+ {"ring_hash_experimental", ring_hash_experimental_policy},
+ },
+ };
}
- // Construct locality-picking policy.
- // Start with field from our config and add the "targets" field.
- child_policy = Json::Array{
- Json::Object{
- {"weighted_target_experimental",
- Json::Object{
- {"targets", Json::Object()},
- }},
- },
- };
- Json::Object& config =
- *(*child_policy.mutable_array())[0].mutable_object();
- auto it = config.begin();
- GPR_ASSERT(it != config.end());
- (*it->second.mutable_object())["targets"] = std::move(weighted_targets);
- } else {
- auto it = xds_lb_policy.find("RING_HASH");
- GPR_ASSERT(it != xds_lb_policy.end());
- Json::Object ring_hash_experimental_policy = it->second.object_value();
- child_policy = Json::Array{
- Json::Object{
- {"ring_hash_experimental", ring_hash_experimental_policy},
- },
- };
}
- }
- // Wrap it in the drop policy.
- Json::Array drop_categories;
- if (discovery_mechanisms_[discovery_index].drop_config != nullptr) {
- for (const auto& category : discovery_mechanisms_[discovery_index]
- .drop_config->drop_category_list()) {
- drop_categories.push_back(Json::Object{
- {"category", category.name},
- {"requests_per_million", category.parts_per_million},
- });
+ // Wrap it in the drop policy.
+ Json::Array drop_categories;
+ if (discovery_entry.latest_update->drop_config != nullptr) {
+ for (const auto& category :
+ discovery_entry.latest_update->drop_config->drop_category_list()) {
+ drop_categories.push_back(Json::Object{
+ {"category", category.name},
+ {"requests_per_million", category.parts_per_million},
+ });
+ }
}
- }
- const auto lrs_key = discovery_mechanisms_[discovery_index]
- .discovery_mechanism->GetLrsClusterKey();
- Json::Object xds_cluster_impl_config = {
- {"clusterName", std::string(lrs_key.first)},
- {"childPolicy", std::move(child_policy)},
- {"dropCategories", std::move(drop_categories)},
- {"maxConcurrentRequests",
- config_->discovery_mechanisms()[discovery_index]
- .max_concurrent_requests},
- };
- if (!lrs_key.second.empty()) {
- xds_cluster_impl_config["edsServiceName"] = std::string(lrs_key.second);
- }
- if (config_->discovery_mechanisms()[discovery_index]
- .lrs_load_reporting_server_name.has_value()) {
- xds_cluster_impl_config["lrsLoadReportingServerName"] =
- config_->discovery_mechanisms()[discovery_index]
- .lrs_load_reporting_server_name.value();
- }
- Json locality_picking_policy = Json::Array{Json::Object{
- {"xds_cluster_impl_experimental", std::move(xds_cluster_impl_config)},
- }};
- // Add priority entry.
- const size_t child_number = priority_child_numbers_[priority];
- std::string child_name = absl::StrCat("child", child_number);
- priority_priorities.emplace_back(child_name);
- Json::Object child_config = {
- {"config", std::move(locality_picking_policy)},
- };
- if (discovery_mechanisms_[discovery_index]
- .discovery_mechanism->disable_reresolution()) {
- child_config["ignore_reresolution_requests"] = true;
- }
- priority_children[child_name] = std::move(child_config);
- // Each priority in the priority_list_ should correspond to a priority in a
- // discovery mechanism in discovery_mechanisms_ (both in the same order).
- // Keeping track of the discovery_mechanism each priority belongs to.
- --num_priorities_remaining_in_discovery;
- while (num_priorities_remaining_in_discovery == 0 &&
- discovery_index < discovery_mechanisms_.size() - 1) {
- ++discovery_index;
- num_priorities_remaining_in_discovery =
- discovery_mechanisms_[discovery_index].num_priorities;
+ Json::Object xds_cluster_impl_config = {
+ {"clusterName", discovery_config.cluster_name},
+ {"childPolicy", std::move(child_policy)},
+ {"dropCategories", std::move(drop_categories)},
+ {"maxConcurrentRequests", discovery_config.max_concurrent_requests},
+ };
+ if (!discovery_config.eds_service_name.empty()) {
+ xds_cluster_impl_config["edsServiceName"] =
+ discovery_config.eds_service_name;
+ }
+ if (discovery_config.lrs_load_reporting_server.has_value()) {
+ xds_cluster_impl_config["lrsLoadReportingServer"] =
+ discovery_config.lrs_load_reporting_server->ToJson();
+ }
+ Json locality_picking_policy = Json::Array{Json::Object{
+ {"xds_cluster_impl_experimental", std::move(xds_cluster_impl_config)},
+ }};
+ // Add priority entry, with the appropriate child name.
+ std::string child_name = discovery_entry.GetChildPolicyName(priority);
+ priority_priorities.emplace_back(child_name);
+ Json::Object child_config = {
+ {"config", std::move(locality_picking_policy)},
+ };
+ if (discovery_entry.discovery_mechanism->disable_reresolution()) {
+ child_config["ignore_reresolution_requests"] = true;
+ }
+ priority_children[child_name] = std::move(child_config);
}
}
- // There should be matching number of priorities in discovery_mechanisms_ and
- // in priority_list_; therefore at the end of looping through all the
- // priorities, num_priorities_remaining should be down to 0, and index should
- // be the last index in discovery_mechanisms_.
- GPR_ASSERT(num_priorities_remaining_in_discovery == 0);
- GPR_ASSERT(discovery_index == discovery_mechanisms_.size() - 1);
Json json = Json::Array{Json::Object{
{"priority_experimental",
Json::Object{
@@ -1013,15 +895,12 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
"config -- "
"will put channel in TRANSIENT_FAILURE: %s",
this, grpc_error_std_string(error).c_str());
- error = grpc_error_set_int(
- grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "xds_cluster_resolver LB policy: error "
- "parsing generated child policy config"),
- error),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ absl::Status status = absl::InternalError(
+ "xds_cluster_resolver LB policy: error parsing generated child policy "
+ "config");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ absl::make_unique<TransientFailurePicker>(status));
return nullptr;
}
return config;
@@ -1052,7 +931,6 @@ grpc_channel_args* XdsClusterResolverLb::CreateChildPolicyArgsLocked(
grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1),
};
- if (!is_xds_uri_) new_args.push_back(xds_client_->MakeChannelArg());
return grpc_channel_args_copy_and_add(args, new_args.data(), new_args.size());
}
@@ -1092,39 +970,16 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- // Find server name.
- const char* server_uri =
- grpc_channel_args_find_string(args.args, GRPC_ARG_SERVER_URI);
- GPR_ASSERT(server_uri != nullptr);
- absl::StatusOr<URI> uri = URI::Parse(server_uri);
- GPR_ASSERT(uri.ok() && !uri->path().empty());
- absl::string_view server_name = absl::StripPrefix(uri->path(), "/");
- // Determine if it's an xds URI.
- bool is_xds_uri = uri->scheme() == "xds";
- // Get XdsClient.
RefCountedPtr<XdsClient> xds_client =
XdsClient::GetFromChannelArgs(*args.args);
if (xds_client == nullptr) {
- if (!is_xds_uri) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- xds_client = XdsClient::GetOrCreate(args.args, &error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "cannot get or create XdsClient to instantiate "
- "xds_cluster_resolver LB policy: %s",
- grpc_error_std_string(error).c_str());
- GRPC_ERROR_UNREF(error);
- return nullptr;
- }
- } else {
- gpr_log(GPR_ERROR,
- "XdsClient not present in channel args -- cannot instantiate "
- "xds_cluster_resolver LB policy");
- return nullptr;
- }
+ gpr_log(GPR_ERROR,
+ "XdsClient not present in channel args -- cannot instantiate "
+ "xds_cluster_resolver LB policy");
+ return nullptr;
}
- return MakeOrphanable<XdsClusterResolverChildHandler>(
- std::move(xds_client), std::move(args), server_name, is_xds_uri);
+ return MakeOrphanable<XdsClusterResolverChildHandler>(std::move(xds_client),
+ std::move(args));
}
const char* name() const override { return kXdsClusterResolver; }
@@ -1158,10 +1013,9 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
std::vector<grpc_error_handle> discovery_mechanism_errors =
ParseDiscoveryMechanism(array[i], &discovery_mechanism);
if (!discovery_mechanism_errors.empty()) {
- grpc_error_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:discovery_mechanism element: ", i, " error")
- .c_str());
- for (grpc_error_handle discovery_mechanism_error :
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:discovery_mechanism element: ", i, " error"));
+ for (const grpc_error_handle& discovery_mechanism_error :
discovery_mechanism_errors) {
error = grpc_error_add_child(error, discovery_mechanism_error);
}
@@ -1201,65 +1055,11 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
}
policy_it = policy.find("RING_HASH");
if (policy_it != policy.end()) {
- if (policy_it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:RING_HASH error:type should be object"));
- continue;
- }
- // TODO(donnadionne): Move this to a method in
- // ring_hash_experimental and call it here.
- const Json::Object& ring_hash = policy_it->second.object_value();
xds_lb_policy = array[i];
- size_t min_ring_size = 1024;
- size_t max_ring_size = 8388608;
- auto ring_hash_it = ring_hash.find("min_ring_size");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:min_ring_size missing"));
- } else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:min_ring_size error: should be of "
- "number"));
- } else {
- min_ring_size = gpr_parse_nonnegative_int(
- ring_hash_it->second.string_value().c_str());
- }
- ring_hash_it = ring_hash.find("max_ring_size");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size missing"));
- } else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size error: should be of "
- "number"));
- } else {
- max_ring_size = gpr_parse_nonnegative_int(
- ring_hash_it->second.string_value().c_str());
- }
- if (min_ring_size <= 0 || min_ring_size > 8388608 ||
- max_ring_size <= 0 || max_ring_size > 8388608 ||
- min_ring_size > max_ring_size) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size and or min_ring_size error: "
- "values need to be in the range of 1 to 8388608 "
- "and max_ring_size cannot be smaller than "
- "min_ring_size"));
- }
- ring_hash_it = ring_hash.find("hash_function");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function missing"));
- } else if (ring_hash_it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function error: should be a "
- "string"));
- } else if (ring_hash_it->second.string_value() != "XX_HASH" &&
- ring_hash_it->second.string_value() != "MURMUR_HASH_2") {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function error: unsupported "
- "hash_function"));
- }
- break;
+ size_t min_ring_size;
+ size_t max_ring_size;
+ ParseRingHashLbConfig(policy_it->second, &min_ring_size,
+ &max_ring_size, &error_list);
}
}
}
@@ -1297,14 +1097,20 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
discovery_mechanism->cluster_name = it->second.string_value();
}
// LRS load reporting server name.
- it = json.object_value().find("lrsLoadReportingServerName");
+ it = json.object_value().find("lrsLoadReportingServer");
if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
+ if (it->second.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:lrsLoadReportingServerName error:type should be string"));
+ "field:lrsLoadReportingServer error:type should be object"));
} else {
- discovery_mechanism->lrs_load_reporting_server_name.emplace(
- it->second.string_value());
+ grpc_error_handle parse_error;
+ discovery_mechanism->lrs_load_reporting_server.emplace(
+ XdsBootstrap::XdsServer::Parse(it->second, &parse_error));
+ if (parse_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("errors parsing lrs_load_reporting_server")));
+ error_list.push_back(parse_error);
+ }
}
}
// Max concurrent requests.
@@ -1331,38 +1137,43 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
if (it->second.string_value() == "EDS") {
discovery_mechanism->type = XdsClusterResolverLbConfig::
DiscoveryMechanism::DiscoveryMechanismType::EDS;
+ 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 {
+ discovery_mechanism->eds_service_name = it->second.string_value();
+ }
+ }
} else if (it->second.string_value() == "LOGICAL_DNS") {
discovery_mechanism->type = XdsClusterResolverLbConfig::
DiscoveryMechanism::DiscoveryMechanismType::LOGICAL_DNS;
+ it = json.object_value().find("dnsHostname");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:dnsHostname error:required field missing"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:dnsHostname error:type should be string"));
+ } else {
+ discovery_mechanism->dns_hostname = it->second.string_value();
+ }
} else {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:type error:invalid type"));
}
}
- // 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:xds_cluster_resolverServiceName error:type should be "
- "string"));
- } else {
- discovery_mechanism->eds_service_name = it->second.string_value();
- }
- }
return error_list;
}
class XdsClusterResolverChildHandler : public ChildPolicyHandler {
public:
XdsClusterResolverChildHandler(RefCountedPtr<XdsClient> xds_client,
- Args args, absl::string_view server_name,
- bool is_xds_uri)
+ Args args)
: ChildPolicyHandler(std::move(args),
&grpc_lb_xds_cluster_resolver_trace),
- xds_client_(std::move(xds_client)),
- server_name_(server_name),
- is_xds_uri_(is_xds_uri) {}
+ xds_client_(std::move(xds_client)) {}
bool ConfigChangeRequiresNewPolicyInstance(
LoadBalancingPolicy::Config* old_config,
@@ -1379,14 +1190,11 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
const char* /*name*/, LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args),
- server_name_, is_xds_uri_);
+ return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args));
}
private:
RefCountedPtr<XdsClient> xds_client_;
- std::string server_name_;
- bool is_xds_uri_;
};
};
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h b/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
index a595c271..d8163cee 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -23,6 +23,7 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/json/json.h"
namespace grpc_core {
diff --git a/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc b/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
index a3f03473..c72a6095 100644
--- a/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
+++ b/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
@@ -154,10 +154,8 @@ grpc_error_handle ParseLoadBalancingConfigHelper(
}
policies_tried.push_back(it->first);
}
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("No known policies in list: ",
- absl::StrJoin(policies_tried, " "))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "No known policies in list: ", absl::StrJoin(policies_tried, " ")));
}
} // namespace
@@ -176,9 +174,8 @@ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
LoadBalancingPolicyFactory* factory =
g_state->GetLoadBalancingPolicyFactory(policy->first.c_str());
if (factory == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Factory not found for policy \"%s\"", policy->first)
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("Factory not found for policy \"%s\"", policy->first));
return nullptr;
}
// Parse load balancing config via factory.
diff --git a/grpc/src/core/ext/filters/client_channel/resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver.cc
deleted file mode 100644
index a5494b16..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * 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/resolver.h"
-
-grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false,
- "resolver_refcount");
-
-namespace grpc_core {
-
-//
-// Resolver
-//
-
-Resolver::Resolver()
- : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_resolver_refcount)
- ? "Resolver"
- : nullptr) {}
-
-//
-// Resolver::Result
-//
-
-Resolver::Result::~Result() {
- GRPC_ERROR_UNREF(service_config_error);
- grpc_channel_args_destroy(args);
-}
-
-Resolver::Result::Result(const Result& other) {
- addresses = other.addresses;
- service_config = other.service_config;
- service_config_error = GRPC_ERROR_REF(other.service_config_error);
- args = grpc_channel_args_copy(other.args);
-}
-
-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;
- other.service_config_error = GRPC_ERROR_NONE;
- args = other.args;
- other.args = nullptr;
-}
-
-Resolver::Result& Resolver::Result::operator=(const Result& other) {
- if (&other == this) {
- return *this;
- }
- addresses = other.addresses;
- service_config = other.service_config;
- GRPC_ERROR_UNREF(service_config_error);
- service_config_error = GRPC_ERROR_REF(other.service_config_error);
- grpc_channel_args_destroy(args);
- args = grpc_channel_args_copy(other.args);
- return *this;
-}
-
-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);
- service_config_error = other.service_config_error;
- other.service_config_error = GRPC_ERROR_NONE;
- grpc_channel_args_destroy(args);
- args = other.args;
- other.args = nullptr;
- return *this;
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver.h b/grpc/src/core/ext/filters/client_channel/resolver.h
deleted file mode 100644
index 2ab74096..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/impl/codegen/grpc_types.h>
-
-#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
-#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"
-
-extern grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount;
-
-// Name associated with individual address, if available.
-#define GRPC_ARG_ADDRESS_NAME "grpc.address_name"
-
-namespace grpc_core {
-
-/// Interface for name resolution.
-///
-/// This interface is designed to support both push-based and pull-based
-/// mechanisms. A push-based mechanism is one where the resolver will
-/// subscribe to updates for a given name, and the name service will
-/// proactively send new data to the resolver whenever the data associated
-/// with the name changes. A pull-based mechanism is one where the resolver
-/// needs to query the name service again to get updated information (e.g.,
-/// DNS).
-///
-/// Note: All methods with a "Locked" suffix must be called from the
-/// work_serializer passed to the constructor.
-class Resolver : public InternallyRefCounted<Resolver> {
- public:
- /// Results returned by the resolver.
- struct Result {
- ServerAddressList addresses;
- RefCountedPtr<ServiceConfig> service_config;
- grpc_error_handle service_config_error = GRPC_ERROR_NONE;
- const grpc_channel_args* args = nullptr;
-
- // TODO(roth): Remove everything below once grpc_error and
- // grpc_channel_args are convert to copyable and movable C++ objects.
- Result() = default;
- ~Result();
- Result(const Result& other);
- Result(Result&& other) noexcept;
- Result& operator=(const Result& other);
- Result& operator=(Result&& other) noexcept;
- };
-
- /// A proxy object used by the resolver to return results to the
- /// client channel.
- class ResultHandler {
- public:
- virtual ~ResultHandler() {}
-
- /// Returns a result to the channel.
- /// Takes ownership of \a result.args.
- virtual void ReturnResult(Result result) = 0; // NOLINT
-
- /// Returns a transient error to the channel.
- /// If the resolver does not set the GRPC_ERROR_INT_GRPC_STATUS
- /// attribute on the error, calls will be failed with status UNKNOWN.
- virtual void ReturnError(grpc_error_handle error) = 0;
-
- // TODO(yashkt): As part of the service config error handling
- // changes, add a method to parse the service config JSON string.
- };
-
- // Not copyable nor movable.
- Resolver(const Resolver&) = delete;
- Resolver& operator=(const Resolver&) = delete;
- ~Resolver() override = default;
-
- /// Starts resolving.
- virtual void StartLocked() = 0;
-
- /// Asks the resolver to obtain an updated resolver result, if
- /// applicable.
- ///
- /// This is useful for pull-based implementations to decide when to
- /// re-resolve. However, the implementation is not required to
- /// re-resolve immediately upon receiving this call; it may instead
- /// elect to delay based on some configured minimum time between
- /// queries, to avoid hammering the name service with queries.
- ///
- /// For push-based implementations, this may be a no-op.
- ///
- /// Note: Implementations must not invoke any method on the
- /// ResultHandler from within this call.
- virtual void RequestReresolutionLocked() {}
-
- /// Resets the re-resolution backoff, if any.
- /// This needs to be implemented only by pull-based implementations;
- /// for push-based implementations, it will be a no-op.
- /// TODO(roth): Pull the backoff code out of resolver and into
- /// client_channel, so that it can be shared across resolver
- /// implementations. At that point, this method can go away.
- virtual void ResetBackoffLocked() {}
-
- // Note: This must be invoked while holding the work_serializer.
- void Orphan() override {
- ShutdownLocked();
- Unref();
- }
-
- protected:
- Resolver();
-
- /// Shuts down the resolver.
- virtual void ShutdownLocked() = 0;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md b/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md
new file mode 100644
index 00000000..b6029676
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md
@@ -0,0 +1,9 @@
+Support for resolving the scheme used by binder transport implementation.
+
+The URI's authority is required to be empty.
+
+The path is used as the identifiers of endpoint binder objects and the length
+limit of the identifier is the same as unix socket length limit.
+
+The length limit of the path should at least be 100 characters long. This is
+guaranteed by `static_assert` in the implementation.
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
new file mode 100644
index 00000000..240394bc
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
@@ -0,0 +1,133 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_HAVE_UNIX_SOCKET
+
+#include <sys/un.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
+
+namespace grpc_core {
+namespace {
+
+class BinderResolver : public Resolver {
+ public:
+ BinderResolver(ServerAddressList addresses, ResolverArgs args)
+ : result_handler_(std::move(args.result_handler)),
+ addresses_(std::move(addresses)),
+ channel_args_(grpc_channel_args_copy(args.args)) {}
+
+ ~BinderResolver() override { grpc_channel_args_destroy(channel_args_); };
+
+ void StartLocked() override {
+ Result result;
+ result.addresses = std::move(addresses_);
+ result.args = channel_args_;
+ channel_args_ = nullptr;
+ result_handler_->ReportResult(std::move(result));
+ }
+
+ void ShutdownLocked() override {}
+
+ private:
+ std::unique_ptr<ResultHandler> result_handler_;
+ ServerAddressList addresses_;
+ const grpc_channel_args* channel_args_ = nullptr;
+};
+
+class BinderResolverFactory : public ResolverFactory {
+ public:
+ absl::string_view scheme() const override { return "binder"; }
+
+ bool IsValidUri(const URI& uri) const override {
+ return ParseUri(uri, nullptr);
+ }
+
+ OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
+ ServerAddressList addresses;
+ if (!ParseUri(args.uri, &addresses)) return nullptr;
+ return MakeOrphanable<BinderResolver>(std::move(addresses),
+ std::move(args));
+ }
+
+ private:
+ static grpc_error_handle BinderAddrPopulate(
+ absl::string_view path, grpc_resolved_address* resolved_addr) {
+ path = absl::StripPrefix(path, "/");
+ if (path.empty()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING("path is empty");
+ }
+ // Store parsed path in a unix socket so it can be reinterpreted as
+ // sockaddr. An invalid address family (AF_MAX) is set to make sure it won't
+ // be accidentally used.
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
+ struct sockaddr_un* un =
+ reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
+ un->sun_family = AF_MAX;
+ static_assert(sizeof(un->sun_path) >= 101,
+ "unix socket path size is unexpectedly short");
+ if (path.size() + 1 > sizeof(un->sun_path)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat(path, " is too long to be handled"));
+ }
+ // `un` has already be set to zero, no need to append null after the string
+ memcpy(un->sun_path, path.data(), path.size());
+ resolved_addr->len =
+ static_cast<socklen_t>(sizeof(un->sun_family) + path.size() + 1);
+ return GRPC_ERROR_NONE;
+ }
+
+ static bool ParseUri(const URI& uri, ServerAddressList* addresses) {
+ grpc_resolved_address addr;
+ {
+ if (!uri.authority().empty()) {
+ gpr_log(GPR_ERROR, "authority is not supported in binder scheme");
+ return false;
+ }
+ grpc_error_handle error = BinderAddrPopulate(uri.path(), &addr);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return false;
+ }
+ }
+ if (addresses != nullptr) {
+ addresses->emplace_back(addr, nullptr /* args */);
+ }
+ return true;
+ }
+};
+
+} // namespace
+
+void RegisterBinderResolver(CoreConfiguration::Builder* builder) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<BinderResolverFactory>());
+}
+
+} // namespace grpc_core
+
+#endif
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 2911eae7..4c5c0dad 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -1,55 +1,50 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
+#include "src/core/lib/config/core_configuration.h"
+
#if GRPC_ARES == 1
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <address_sorting/address_sorting.h>
+
#include "absl/container/inlined_vector.h"
#include "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_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"
-#include "src/core/ext/filters/client_channel/resolver_registry.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/resolver/polling_resolver.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/gethostname.h"
-#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/json/json.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
+#include "src/core/lib/service_config/service_config_impl.h"
+#include "src/core/lib/transport/error_utils.h"
#define GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -60,161 +55,96 @@ namespace grpc_core {
namespace {
-const char kDefaultPort[] = "https";
-
-class AresDnsResolver : public Resolver {
+class AresClientChannelDNSResolver : public PollingResolver {
public:
- explicit AresDnsResolver(ResolverArgs args);
+ AresClientChannelDNSResolver(ResolverArgs args,
+ const grpc_channel_args* channel_args);
- void StartLocked() override;
+ OrphanablePtr<Orphanable> StartRequest() override;
- void RequestReresolutionLocked() override;
+ private:
+ class AresRequestWrapper : public InternallyRefCounted<AresRequestWrapper> {
+ public:
+ explicit AresRequestWrapper(
+ RefCountedPtr<AresClientChannelDNSResolver> resolver)
+ : resolver_(std::move(resolver)) {
+ Ref(DEBUG_LOCATION, "OnResolved").release();
+ GRPC_CLOSURE_INIT(&on_resolved_, OnResolved, this, nullptr);
+ request_.reset(grpc_dns_lookup_ares(
+ resolver_->authority().c_str(), resolver_->name_to_resolve().c_str(),
+ kDefaultSecurePort, resolver_->interested_parties(), &on_resolved_,
+ &addresses_,
+ resolver_->enable_srv_queries_ ? &balancer_addresses_ : nullptr,
+ resolver_->request_service_config_ ? &service_config_json_ : nullptr,
+ resolver_->query_timeout_ms_));
+ GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. request_:%p",
+ resolver_.get(), request_.get());
+ }
+
+ ~AresRequestWrapper() override {
+ gpr_free(service_config_json_);
+ resolver_.reset(DEBUG_LOCATION, "dns-resolving");
+ }
- void ResetBackoffLocked() override;
+ void Orphan() override {
+ grpc_cancel_ares_request(request_.get());
+ Unref(DEBUG_LOCATION, "Orphan");
+ }
- void ShutdownLocked() override;
+ private:
+ static void OnResolved(void* arg, grpc_error_handle error);
+ void OnResolved(grpc_error_handle error);
- private:
- ~AresDnsResolver() override;
-
- void MaybeStartResolvingLocked();
- void StartResolvingLocked();
-
- static void OnNextResolution(void* arg, grpc_error_handle error);
- static void OnResolved(void* arg, grpc_error_handle error);
- void OnNextResolutionLocked(grpc_error_handle error);
- void OnResolvedLocked(grpc_error_handle error);
-
- /// DNS server to use (if not system default)
- std::string dns_server_;
- /// name to resolve (usually the same as target_name)
- std::string name_to_resolve_;
- /// channel args
- grpc_channel_args* channel_args_;
- std::shared_ptr<WorkSerializer> work_serializer_;
- std::unique_ptr<ResultHandler> result_handler_;
- /// pollset_set to drive the name resolution process
- grpc_pollset_set* interested_parties_;
+ RefCountedPtr<AresClientChannelDNSResolver> resolver_;
+ std::unique_ptr<grpc_ares_request> request_;
+ grpc_closure on_resolved_;
+ // Output fields from ares request.
+ std::unique_ptr<ServerAddressList> addresses_;
+ std::unique_ptr<ServerAddressList> balancer_addresses_;
+ char* service_config_json_ = nullptr;
+ };
+
+ ~AresClientChannelDNSResolver() override;
/// whether to request the service config
- bool request_service_config_;
+ const bool request_service_config_;
// whether or not to enable SRV DNS queries
- bool enable_srv_queries_;
+ const bool enable_srv_queries_;
// timeout in milliseconds for active DNS queries
- int query_timeout_ms_;
- /// min interval between DNS requests
- grpc_millis min_time_between_resolutions_;
-
- /// closures used by the work_serializer
- grpc_closure on_next_resolution_;
- grpc_closure on_resolved_;
- /// are we currently resolving?
- bool resolving_ = false;
- /// the pending resolving request
- grpc_ares_request* pending_request_ = nullptr;
- /// next resolution timer
- bool have_next_resolution_timer_ = false;
- grpc_timer next_resolution_timer_;
- /// timestamp of last DNS request
- grpc_millis last_resolution_timestamp_ = -1;
- /// retry backoff state
- BackOff backoff_;
- /// currently resolving backend addresses
- std::unique_ptr<ServerAddressList> addresses_;
- /// currently resolving balancer addresses
- std::unique_ptr<ServerAddressList> balancer_addresses_;
- /// currently resolving service config
- char* service_config_json_ = nullptr;
- // has shutdown been initiated
- bool shutdown_initiated_ = false;
+ const int query_timeout_ms_;
};
-AresDnsResolver::AresDnsResolver(ResolverArgs args)
- : dns_server_(args.uri.authority()),
- name_to_resolve_(absl::StripPrefix(args.uri.path(), "/")),
- channel_args_(grpc_channel_args_copy(args.args)),
- work_serializer_(std::move(args.work_serializer)),
- result_handler_(std::move(args.result_handler)),
- interested_parties_(args.pollset_set),
- request_service_config_(!grpc_channel_args_find_bool(
- channel_args_, GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION, true)),
- enable_srv_queries_(grpc_channel_args_find_bool(
- channel_args_, GRPC_ARG_DNS_ENABLE_SRV_QUERIES, false)),
- query_timeout_ms_(grpc_channel_args_find_integer(
- channel_args_, GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS,
- {GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, 0, INT_MAX})),
- min_time_between_resolutions_(grpc_channel_args_find_integer(
- channel_args_, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
- {1000 * 30, 0, INT_MAX})),
- backoff_(
+AresClientChannelDNSResolver::AresClientChannelDNSResolver(
+ ResolverArgs args, const grpc_channel_args* channel_args)
+ : PollingResolver(
+ std::move(args), channel_args,
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ channel_args, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
+ {1000 * 30, 0, INT_MAX})),
BackOff::Options()
- .set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
- 1000)
+ .set_initial_backoff(Duration::Milliseconds(
+ GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS * 1000))
.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);
-}
-
-AresDnsResolver::~AresDnsResolver() {
- GRPC_CARES_TRACE_LOG("resolver:%p destroying AresDnsResolver", this);
- grpc_channel_args_destroy(channel_args_);
-}
+ .set_max_backoff(Duration::Milliseconds(
+ GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)),
+ &grpc_trace_cares_resolver),
+ request_service_config_(!grpc_channel_args_find_bool(
+ channel_args, GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION, true)),
+ enable_srv_queries_(grpc_channel_args_find_bool(
+ channel_args, GRPC_ARG_DNS_ENABLE_SRV_QUERIES, false)),
+ query_timeout_ms_(grpc_channel_args_find_integer(
+ channel_args, GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS,
+ {GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS, 0, INT_MAX})) {}
-void AresDnsResolver::StartLocked() {
- GRPC_CARES_TRACE_LOG("resolver:%p AresDnsResolver::StartLocked() is called.",
+AresClientChannelDNSResolver::~AresClientChannelDNSResolver() {
+ GRPC_CARES_TRACE_LOG("resolver:%p destroying AresClientChannelDNSResolver",
this);
- MaybeStartResolvingLocked();
-}
-
-void AresDnsResolver::RequestReresolutionLocked() {
- if (!resolving_) {
- MaybeStartResolvingLocked();
- }
-}
-
-void AresDnsResolver::ResetBackoffLocked() {
- if (have_next_resolution_timer_) {
- grpc_timer_cancel(&next_resolution_timer_);
- }
- backoff_.Reset();
-}
-
-void AresDnsResolver::ShutdownLocked() {
- shutdown_initiated_ = true;
- if (have_next_resolution_timer_) {
- grpc_timer_cancel(&next_resolution_timer_);
- }
- if (pending_request_ != nullptr) {
- grpc_cancel_ares_request_locked(pending_request_);
- }
-}
-
-void AresDnsResolver::OnNextResolution(void* arg, grpc_error_handle 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);
}
-void AresDnsResolver::OnNextResolutionLocked(grpc_error_handle error) {
- GRPC_CARES_TRACE_LOG(
- "resolver:%p re-resolution timer fired. error: %s. shutdown_initiated_: "
- "%d",
- this, grpc_error_std_string(error).c_str(), 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();
- }
- }
- Unref(DEBUG_LOCATION, "next_resolution_timer");
- GRPC_ERROR_UNREF(error);
+OrphanablePtr<Orphanable> AresClientChannelDNSResolver::StartRequest() {
+ return MakeOrphanable<AresRequestWrapper>(
+ Ref(DEBUG_LOCATION, "dns-resolving"));
}
bool ValueInJsonArray(const Json::Array& array, const char* value) {
@@ -305,217 +235,253 @@ std::string ChooseServiceConfig(char* service_config_choice_json,
return service_config->Dump();
}
-void AresDnsResolver::OnResolved(void* arg, grpc_error_handle 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);
+void AresClientChannelDNSResolver::AresRequestWrapper::OnResolved(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<AresRequestWrapper*>(arg);
+ self->OnResolved(error);
}
-void AresDnsResolver::OnResolvedLocked(grpc_error_handle 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;
- }
+void AresClientChannelDNSResolver::AresRequestWrapper::OnResolved(
+ grpc_error_handle error) {
+ GRPC_CARES_TRACE_LOG("resolver:%p OnResolved()", this);
+ Result result;
+ absl::InlinedVector<grpc_arg, 1> new_args;
+ // TODO(roth): Change logic to be able to report failures for addresses
+ // and service config independently of each other.
if (addresses_ != nullptr || balancer_addresses_ != nullptr) {
- Result result;
if (addresses_ != nullptr) {
result.addresses = std::move(*addresses_);
+ } else {
+ result.addresses = ServerAddressList();
}
if (service_config_json_ != nullptr) {
- std::string service_config_string = ChooseServiceConfig(
- service_config_json_, &result.service_config_error);
- gpr_free(service_config_json_);
- if (result.service_config_error == GRPC_ERROR_NONE &&
+ grpc_error_handle service_config_error = GRPC_ERROR_NONE;
+ std::string service_config_string =
+ ChooseServiceConfig(service_config_json_, &service_config_error);
+ RefCountedPtr<ServiceConfig> service_config;
+ if (service_config_error == GRPC_ERROR_NONE &&
!service_config_string.empty()) {
GRPC_CARES_TRACE_LOG("resolver:%p selected service config choice: %s",
this, service_config_string.c_str());
- result.service_config = ServiceConfig::Create(
- channel_args_, service_config_string, &result.service_config_error);
+ service_config = ServiceConfigImpl::Create(resolver_->channel_args(),
+ service_config_string,
+ &service_config_error);
+ }
+ if (service_config_error != GRPC_ERROR_NONE) {
+ result.service_config = absl::UnavailableError(
+ absl::StrCat("failed to parse service config: ",
+ grpc_error_std_string(service_config_error)));
+ GRPC_ERROR_UNREF(service_config_error);
+ } else {
+ result.service_config = std::move(service_config);
}
}
- 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();
} else {
GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed: %s", this,
grpc_error_std_string(error).c_str());
- std::string error_message =
- 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.
- // InvalidateNow to avoid getting stuck re-initializing this timer
- // in a loop while draining the currently-held WorkSerializer.
- // Also see https://github.com/grpc/grpc/issues/26079.
- ExecCtx::Get()->InvalidateNow();
- 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_std_string(error).c_str());
- 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();
- if (timeout > 0) {
- GRPC_CARES_TRACE_LOG("resolver:%p retrying in %" PRId64 " milliseconds",
- this, timeout);
- } else {
- GRPC_CARES_TRACE_LOG("resolver:%p retrying immediately", this);
- }
- grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
- }
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
-}
-
-void AresDnsResolver::MaybeStartResolvingLocked() {
- // If there is an existing timer, the time it fires is the earliest time we
- // can start the next resolution.
- if (have_next_resolution_timer_) return;
- if (last_resolution_timestamp_ >= 0) {
- // InvalidateNow to avoid getting stuck re-initializing this timer
- // in a loop while draining the currently-held WorkSerializer.
- // Also see https://github.com/grpc/grpc/issues/26079.
- ExecCtx::Get()->InvalidateNow();
- const grpc_millis earliest_next_resolution =
- last_resolution_timestamp_ + min_time_between_resolutions_;
- const grpc_millis ms_until_next_resolution =
- earliest_next_resolution - grpc_core::ExecCtx::Get()->Now();
- if (ms_until_next_resolution > 0) {
- const grpc_millis last_resolution_ago =
- grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_;
- GRPC_CARES_TRACE_LOG(
- "resolver:%p In cooldown from last resolution (from %" PRId64
- " ms ago). Will resolve again in %" PRId64 " ms",
- this, last_resolution_ago, ms_until_next_resolution);
- 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_cooldown").release();
- grpc_timer_init(&next_resolution_timer_,
- ExecCtx::Get()->Now() + ms_until_next_resolution,
- &on_next_resolution_);
- return;
- }
+ std::string error_message;
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &error_message);
+ absl::Status status = absl::UnavailableError(
+ absl::StrCat("DNS resolution failed for ", resolver_->name_to_resolve(),
+ ": ", error_message));
+ result.addresses = status;
+ result.service_config = status;
}
- StartResolvingLocked();
-}
-
-void AresDnsResolver::StartResolvingLocked() {
- // 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, "dns-resolving").release();
- GPR_ASSERT(!resolving_);
- resolving_ = true;
- service_config_json_ = nullptr;
- pending_request_ = grpc_dns_lookup_ares_locked(
- dns_server_.c_str(), name_to_resolve_.c_str(), kDefaultPort,
- interested_parties_, &on_resolved_, &addresses_,
- enable_srv_queries_ ? &balancer_addresses_ : nullptr,
- request_service_config_ ? &service_config_json_ : nullptr,
- 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_);
+ result.args = grpc_channel_args_copy_and_add(
+ resolver_->channel_args(), new_args.data(), new_args.size());
+ resolver_->OnRequestComplete(std::move(result));
+ Unref(DEBUG_LOCATION, "OnResolved");
}
//
// Factory
//
-class AresDnsResolverFactory : public ResolverFactory {
+class AresClientChannelDNSResolverFactory : public ResolverFactory {
public:
- bool IsValidUri(const URI& /*uri*/) const override { return true; }
+ absl::string_view scheme() const override { return "dns"; }
- OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
- return MakeOrphanable<AresDnsResolver>(std::move(args));
+ bool IsValidUri(const URI& uri) const override {
+ if (absl::StripPrefix(uri.path(), "/").empty()) {
+ gpr_log(GPR_ERROR, "no server name supplied in dns URI");
+ return false;
+ }
+ return true;
}
- const char* scheme() const override { return "dns"; }
+ OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
+ const grpc_channel_args* channel_args = args.args;
+ return MakeOrphanable<AresClientChannelDNSResolver>(std::move(args),
+ channel_args);
+ }
};
-} // namespace
+class AresDNSResolver : public DNSResolver {
+ public:
+ class AresRequest : public DNSResolver::Request {
+ public:
+ AresRequest(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_resolve_address_done)
+ : name_(std::string(name)),
+ default_port_(std::string(default_port)),
+ interested_parties_(interested_parties),
+ on_resolve_address_done_(std::move(on_resolve_address_done)) {
+ GRPC_CARES_TRACE_LOG("AresRequest:%p ctor", this);
+ GRPC_CLOSURE_INIT(&on_dns_lookup_done_, OnDnsLookupDone, this,
+ grpc_schedule_on_exec_ctx);
+ }
-} // namespace grpc_core
+ ~AresRequest() override {
+ GRPC_CARES_TRACE_LOG("AresRequest:%p dtor ares_request_:%p", this,
+ ares_request_.get());
+ }
+
+ void Start() override {
+ absl::MutexLock lock(&mu_);
+ Ref().release(); // ref held by resolution
+ ares_request_ = std::unique_ptr<grpc_ares_request>(grpc_dns_lookup_ares(
+ "" /* dns_server */, name_.c_str(), default_port_.c_str(),
+ interested_parties_, &on_dns_lookup_done_, &addresses_,
+ nullptr /* balancer_addresses */, nullptr /* service_config_json */,
+ GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS));
+ GRPC_CARES_TRACE_LOG("AresRequest:%p Start ares_request_:%p", this,
+ ares_request_.get());
+ }
-extern grpc_address_resolver_vtable* grpc_resolve_address_impl;
-static grpc_address_resolver_vtable* default_resolver;
+ void Orphan() override {
+ {
+ absl::MutexLock lock(&mu_);
+ GRPC_CARES_TRACE_LOG("AresRequest:%p Orphan ares_request_:%p", this,
+ ares_request_.get());
+ if (ares_request_ != nullptr) {
+ grpc_cancel_ares_request(ares_request_.get());
+ }
+ }
+ Unref();
+ }
-static grpc_error_handle blocking_resolve_address_ares(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses) {
- return default_resolver->blocking_resolve_address(name, default_port,
- addresses);
-}
+ private:
+ static void OnDnsLookupDone(void* arg, grpc_error_handle error) {
+ AresRequest* r = static_cast<AresRequest*>(arg);
+ std::vector<grpc_resolved_address> resolved_addresses;
+ {
+ absl::MutexLock lock(&r->mu_);
+ GRPC_CARES_TRACE_LOG("AresRequest:%p OnDnsLookupDone error:%s", r,
+ grpc_error_std_string(error).c_str());
+ if (r->addresses_ != nullptr) {
+ resolved_addresses.reserve(r->addresses_->size());
+ for (const auto& server_address : *r->addresses_) {
+ resolved_addresses.push_back(server_address.address());
+ }
+ }
+ }
+ if (error == GRPC_ERROR_NONE) {
+ // it's safe to run this inline since we've already been scheduled
+ // on the ExecCtx
+ r->on_resolve_address_done_(std::move(resolved_addresses));
+ } else {
+ r->on_resolve_address_done_(grpc_error_to_absl_status(error));
+ }
+ r->Unref();
+ }
+
+ // mutex to synchronize access to this object (but not to the ares_request
+ // object itself).
+ absl::Mutex mu_;
+ // the name to resolve
+ const std::string name_;
+ // the default port to use if name doesn't have one
+ const std::string default_port_;
+ // parties interested in our I/O
+ grpc_pollset_set* const interested_parties_;
+ // user-provided completion callback
+ const std::function<void(
+ absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_resolve_address_done_;
+ // currently resolving addresses
+ std::unique_ptr<ServerAddressList> addresses_ ABSL_GUARDED_BY(mu_);
+ // closure to call when the resolve_address_ares request completes
+ // a closure wrapping on_resolve_address_done, which should be invoked
+ // when the grpc_dns_lookup_ares operation is done.
+ grpc_closure on_dns_lookup_done_ ABSL_GUARDED_BY(mu_);
+ // underlying ares_request that the query is performed on
+ std::unique_ptr<grpc_ares_request> ares_request_ ABSL_GUARDED_BY(mu_);
+ };
+
+ // gets the singleton instance, possibly creating it first
+ static AresDNSResolver* GetOrCreate() {
+ static AresDNSResolver* instance = new AresDNSResolver();
+ return instance;
+ }
+
+ OrphanablePtr<DNSResolver::Request> ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) override {
+ return MakeOrphanable<AresRequest>(name, default_port, interested_parties,
+ std::move(on_done));
+ }
+
+ absl::StatusOr<std::vector<grpc_resolved_address>> ResolveNameBlocking(
+ absl::string_view name, absl::string_view default_port) override {
+ // TODO(apolcyn): change this to wrap the async version of the c-ares
+ // API with a promise, and remove the reference to the previous resolver.
+ return default_resolver_->ResolveNameBlocking(name, default_port);
+ }
+
+ private:
+ // the previous default DNS resolver, used to delegate blocking DNS calls to
+ DNSResolver* default_resolver_ = GetDNSResolver();
+};
-static grpc_address_resolver_vtable ares_resolver = {
- grpc_resolve_address_ares, blocking_resolve_address_ares};
+bool ShouldUseAres(const char* resolver_env) {
+ return resolver_env == nullptr || strlen(resolver_env) == 0 ||
+ gpr_stricmp(resolver_env, "ares") == 0;
+}
-#ifdef GRPC_UV
-/* TODO(murgatroid99): Remove this when we want the cares resolver to be the
- * default when using libuv */
-static bool should_use_ares(const char* resolver_env) {
- return resolver_env != nullptr && gpr_stricmp(resolver_env, "ares") == 0;
+bool UseAresDnsResolver() {
+ static const bool result = []() {
+ UniquePtr<char> resolver = GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
+ bool result = ShouldUseAres(resolver.get());
+ if (result) gpr_log(GPR_DEBUG, "Using ares dns resolver");
+ return result;
+ }();
+ return result;
}
-#else /* GRPC_UV */
-static bool should_use_ares(const char* resolver_env) {
- // TODO(lidiz): Remove the "g_custom_iomgr_enabled" flag once c-ares support
- // custom IO managers (e.g. gevent).
- return !g_custom_iomgr_enabled &&
- (resolver_env == nullptr || strlen(resolver_env) == 0 ||
- gpr_stricmp(resolver_env, "ares") == 0);
+
+} // namespace
+
+void RegisterAresDnsResolver(CoreConfiguration::Builder* builder) {
+ if (UseAresDnsResolver()) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<AresClientChannelDNSResolverFactory>());
+ }
}
-#endif /* GRPC_UV */
-static bool g_use_ares_dns_resolver;
+} // namespace grpc_core
void grpc_resolver_dns_ares_init() {
- grpc_core::UniquePtr<char> resolver =
- GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
- if (should_use_ares(resolver.get())) {
- g_use_ares_dns_resolver = true;
- gpr_log(GPR_DEBUG, "Using ares dns resolver");
+ if (grpc_core::UseAresDnsResolver()) {
address_sorting_init();
grpc_error_handle error = grpc_ares_init();
if (error != GRPC_ERROR_NONE) {
GRPC_LOG_IF_ERROR("grpc_ares_init() failed", error);
return;
}
- if (default_resolver == nullptr) {
- default_resolver = grpc_resolve_address_impl;
- }
- grpc_set_resolver_impl(&ares_resolver);
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::AresDnsResolverFactory>());
- } else {
- g_use_ares_dns_resolver = false;
+ grpc_core::SetDNSResolver(grpc_core::AresDNSResolver::GetOrCreate());
}
}
void grpc_resolver_dns_ares_shutdown() {
- if (g_use_ares_dns_resolver) {
+ if (grpc_core::UseAresDnsResolver()) {
address_sorting_shutdown();
grpc_ares_cleanup();
}
@@ -523,8 +489,12 @@ void grpc_resolver_dns_ares_shutdown() {
#else /* GRPC_ARES == 1 */
-void grpc_resolver_dns_ares_init(void) {}
+namespace grpc_core {
+void RegisterAresDnsResolver(CoreConfiguration::Builder*) {}
+} // namespace grpc_core
+
+void grpc_resolver_dns_ares_init() {}
-void grpc_resolver_dns_ares_shutdown(void) {}
+void grpc_resolver_dns_ares_shutdown() {}
#endif /* GRPC_ARES == 1 */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index 08069232..a1374af6 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -22,8 +22,9 @@
#include <grpc/support/port_platform.h>
#include <ares.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/iomgr/pollset_set.h"
-#include "src/core/lib/iomgr/work_serializer.h"
namespace grpc_core {
@@ -35,18 +36,23 @@ class GrpcPolledFd {
public:
virtual ~GrpcPolledFd() {}
/* Called when c-ares library is interested and there's no pending callback */
- virtual void RegisterForOnReadableLocked(grpc_closure* read_closure) = 0;
+ virtual void RegisterForOnReadableLocked(grpc_closure* read_closure)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* Called when c-ares library is interested and there's no pending callback */
- virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure) = 0;
+ virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* Indicates if there is data left even after just being read from */
- virtual bool IsFdStillReadableLocked() = 0;
+ virtual bool IsFdStillReadableLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* Called once and only once. Must cause cancellation of any pending
* read/write callbacks. */
- virtual void ShutdownLocked(grpc_error_handle error) = 0;
+ virtual void ShutdownLocked(grpc_error_handle error)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* Get the underlying ares_socket_t that this was created from */
- virtual ares_socket_t GetWrappedAresSocketLocked() = 0;
+ virtual ares_socket_t GetWrappedAresSocketLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* A unique name, for logging */
- virtual const char* GetName() = 0;
+ virtual const char* GetName() const = 0;
};
/* A GrpcPolledFdFactory is 1-to-1 with and owned by the
@@ -58,14 +64,19 @@ class GrpcPolledFdFactory {
virtual ~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;
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
/* Optionally configures the ares channel after creation */
- virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
+ virtual void ConfigureAresChannelLocked(ares_channel channel)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0;
};
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
+/* Creates a new polled fd factory.
+ * Note that even though ownership of mu is not transferred, the mu
+ * parameter is guaranteed to be alive for the the whole lifetime of
+ * the resulting GrpcPolledFdFactory as well as any GrpcPolledFd
+ * returned by the factory. */
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* mu);
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
new file mode 100644
index 00000000..45c14648
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
@@ -0,0 +1,31 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+#if GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE)
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+
+namespace grpc_core {
+
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
+ std::shared_ptr<WorkSerializer> /* work_serializer */) {
+ return nullptr;
+}
+
+} // namespace grpc_core
+
+#endif /* GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE) */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
deleted file mode 100644
index 5c4c5350..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *
- * 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/port.h"
-#if GRPC_ARES == 1 && defined(GRPC_UV)
-
-#include "absl/strings/str_format.h"
-
-#include <ares.h>
-#include <uv.h>
-
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#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"
-
-namespace grpc_core {
-
-void ares_uv_poll_cb(uv_poll_t* handle, int status, int events);
-
-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_(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;
- }
-
- void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
- GPR_ASSERT(read_closure_ == nullptr);
- GPR_ASSERT((poll_events_ & UV_READABLE) == 0);
- read_closure_ = read_closure;
- poll_events_ |= UV_READABLE;
- uv_poll_start(handle_, poll_events_, ares_uv_poll_cb);
- }
-
- void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
- GPR_ASSERT(write_closure_ == nullptr);
- GPR_ASSERT((poll_events_ & UV_WRITABLE) == 0);
- write_closure_ = write_closure;
- poll_events_ |= UV_WRITABLE;
- uv_poll_start(handle_, poll_events_, ares_uv_poll_cb);
- }
-
- bool IsFdStillReadableLocked() override {
- /* uv_poll_t is based on poll, which is level triggered. So, if cares
- * leaves some data unread, the event will trigger again. */
- return false;
- }
-
- void ShutdownInternalLocked(grpc_error_handle error) {
- uv_poll_stop(handle_);
- uv_close(reinterpret_cast<uv_handle_t*>(handle_), ares_uv_poll_close_cb);
- if (read_closure_ != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_,
- GRPC_ERROR_CANCELLED);
- }
- if (write_closure_ != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_,
- GRPC_ERROR_CANCELLED);
- }
- }
-
- void ShutdownLocked(grpc_error_handle error) override {
- if (grpc_core::ExecCtx::Get() == nullptr) {
- grpc_core::ExecCtx exec_ctx;
- ShutdownInternalLocked(error);
- } else {
- ShutdownInternalLocked(error);
- }
- }
-
- ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
-
- const char* GetName() override { return name_.c_str(); }
-
- // TODO(apolcyn): Data members should be private.
- std::string 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_;
-};
-
-struct AresUvPollCbArg {
- AresUvPollCbArg(uv_poll_t* handle, int status, int events)
- : handle(handle), status(status), events(events) {}
-
- uv_poll_t* handle;
- int status;
- int events;
-};
-
-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_handle error = GRPC_ERROR_NONE;
- if (status < 0) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("cares polling error");
- error =
- grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(uv_strerror(status)));
- }
- if (events & UV_READABLE) {
- GPR_ASSERT(polled_fd->read_closure_ != nullptr);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, polled_fd->read_closure_, error);
- polled_fd->read_closure_ = nullptr;
- polled_fd->poll_events_ &= ~UV_READABLE;
- }
- if (events & UV_WRITABLE) {
- GPR_ASSERT(polled_fd->write_closure_ != nullptr);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, polled_fd->write_closure_, error);
- polled_fd->write_closure_ = nullptr;
- polled_fd->poll_events_ &= ~UV_WRITABLE;
- }
- uv_poll_start(handle, polled_fd->poll_events_, ares_uv_poll_cb);
-}
-
-void ares_uv_poll_cb(uv_poll_t* handle, int status, int events) {
- grpc_core::ExecCtx exec_ctx;
- 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);
-}
-
-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));
- }
-
- void ConfigureAresChannelLocked(ares_channel channel) override {}
-};
-
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- return absl::make_unique<GrpcPolledFdFactoryLibuv>();
-}
-
-} // namespace grpc_core
-
-#endif /* GRPC_ARES == 1 && defined(GRPC_UV) */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index 31de6799..68f1c2bb 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -20,18 +20,19 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
-#include <ares.h>
#include <string.h>
#include <sys/ioctl.h>
-#include "absl/strings/str_cat.h"
+#include <ares.h>
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
@@ -58,49 +59,53 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
grpc_fd_orphan(fd_, nullptr, &phony_release_fd, "c-ares query finished");
}
- void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
+ void RegisterForOnReadableLocked(grpc_closure* read_closure)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) override {
grpc_fd_notify_on_read(fd_, read_closure);
}
- void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
+ void RegisterForOnWriteableLocked(grpc_closure* write_closure)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) override {
grpc_fd_notify_on_write(fd_, write_closure);
}
- bool IsFdStillReadableLocked() override {
+ bool IsFdStillReadableLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) override {
size_t bytes_available = 0;
return ioctl(grpc_fd_wrapped_fd(fd_), FIONREAD, &bytes_available) == 0 &&
bytes_available > 0;
}
- void ShutdownLocked(grpc_error_handle error) override {
+ void ShutdownLocked(grpc_error_handle error)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) override {
grpc_fd_shutdown(fd_, error);
}
- ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
+ ares_socket_t GetWrappedAresSocketLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) override {
+ return as_;
+ }
- const char* GetName() override { return name_.c_str(); }
+ const char* GetName() const override { return name_.c_str(); }
private:
- std::string name_;
- ares_socket_t as_;
- grpc_fd* fd_;
- grpc_pollset_set* driver_pollset_set_;
+ const std::string name_;
+ const ares_socket_t as_;
+ grpc_fd* fd_ ABSL_GUARDED_BY(&grpc_ares_request::mu);
+ grpc_pollset_set* driver_pollset_set_ ABSL_GUARDED_BY(&grpc_ares_request::mu);
};
class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
public:
GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> /*work_serializer*/) override {
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set) override {
return new GrpcPolledFdPosix(as, driver_pollset_set);
}
void ConfigureAresChannelLocked(ares_channel /*channel*/) override {}
};
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- (void)work_serializer;
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* /* mu */) {
return absl::make_unique<GrpcPolledFdFactoryPosix>();
}
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
index 0b4675fa..eab25f30 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
@@ -20,16 +20,20 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER)
-#include "absl/strings/str_format.h"
+#include <string.h>
#include <ares.h>
+#include "absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include <string.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
@@ -37,12 +41,8 @@
#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/slice/slice_internal.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-
/* TODO(apolcyn): remove this hack after fixing upstream.
* Our grpc/c-ares code on Windows uses the ares_set_socket_functions API,
* which uses "struct iovec" type, which on Windows is defined inside of
@@ -99,10 +99,9 @@ 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)),
+ GrpcPolledFdWindows(ares_socket_t as, Mutex* mu, int address_family,
+ int socket_type)
+ : mu_(mu),
read_buf_(grpc_empty_slice()),
write_buf_(grpc_empty_slice()),
tcp_write_state_(WRITE_IDLE),
@@ -132,12 +131,12 @@ class GrpcPolledFdWindows {
}
void ScheduleAndNullReadClosure(grpc_error_handle error) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
+ ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
read_closure_ = nullptr;
}
void ScheduleAndNullWriteClosure(grpc_error_handle error) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
+ ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
write_closure_ = nullptr;
}
@@ -149,8 +148,7 @@ class GrpcPolledFdWindows {
GPR_ASSERT(!read_buf_has_data_);
read_buf_ = GRPC_SLICE_MALLOC(4192);
if (connect_done_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ ContinueRegisterForOnReadableLocked();
} else {
GPR_ASSERT(pending_continue_register_for_on_readable_locked_ == false);
pending_continue_register_for_on_readable_locked_ = true;
@@ -159,7 +157,7 @@ class GrpcPolledFdWindows {
void ContinueRegisterForOnReadableLocked() {
GRPC_CARES_TRACE_LOG(
- "fd:|%s| InnerContinueRegisterForOnReadableLocked "
+ "fd:|%s| ContinueRegisterForOnReadableLocked "
"wsa_connect_error_:%d",
GetName(), wsa_connect_error_);
GPR_ASSERT(connect_done_);
@@ -206,8 +204,7 @@ class GrpcPolledFdWindows {
GPR_ASSERT(write_closure_ == nullptr);
write_closure_ = write_closure;
if (connect_done_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ ContinueRegisterForOnWriteableLocked();
} else {
GPR_ASSERT(pending_continue_register_for_on_writeable_locked_ == false);
pending_continue_register_for_on_writeable_locked_ = true;
@@ -216,7 +213,7 @@ class GrpcPolledFdWindows {
void ContinueRegisterForOnWriteableLocked() {
GRPC_CARES_TRACE_LOG(
- "fd:|%s| InnerContinueRegisterForOnWriteableLocked "
+ "fd:|%s| ContinueRegisterForOnWriteableLocked "
"wsa_connect_error_:%d",
GetName(), wsa_connect_error_);
GPR_ASSERT(connect_done_);
@@ -261,7 +258,7 @@ class GrpcPolledFdWindows {
return grpc_winsocket_wrapped_socket(winsocket_);
}
- const char* GetName() { return name_.c_str(); }
+ const char* GetName() const { return name_.c_str(); }
ares_ssize_t RecvFrom(WSAErrorContext* wsa_error_ctx, void* data,
ares_socket_t data_len, int flags,
@@ -423,12 +420,8 @@ class GrpcPolledFdWindows {
static void OnTcpConnect(void* arg, grpc_error_handle 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);
+ MutexLock lock(grpc_polled_fd->mu_);
+ grpc_polled_fd->OnTcpConnectLocked(error);
}
void OnTcpConnectLocked(grpc_error_handle error) {
@@ -465,14 +458,11 @@ class GrpcPolledFdWindows {
wsa_connect_error_ = WSA_OPERATION_ABORTED;
}
if (pending_continue_register_for_on_readable_locked_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ ContinueRegisterForOnReadableLocked();
}
if (pending_continue_register_for_on_writeable_locked_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ ContinueRegisterForOnWriteableLocked();
}
- GRPC_ERROR_UNREF(error);
}
int Connect(WSAErrorContext* wsa_error_ctx, const struct sockaddr* target,
@@ -578,10 +568,9 @@ class GrpcPolledFdWindows {
static void OnIocpReadable(void* arg, grpc_error_handle 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);
+ (void)GRPC_ERROR_REF(error);
+ MutexLock lock(polled_fd->mu_);
+ polled_fd->OnIocpReadableLocked(error);
}
// TODO(apolcyn): improve this error handling to be less conversative.
@@ -623,10 +612,9 @@ class GrpcPolledFdWindows {
static void OnIocpWriteable(void* arg, grpc_error_handle 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);
+ (void)GRPC_ERROR_REF(error);
+ MutexLock lock(polled_fd->mu_);
+ polled_fd->OnIocpWriteableLocked(error);
}
void OnIocpWriteableLocked(grpc_error_handle error) {
@@ -661,7 +649,7 @@ class GrpcPolledFdWindows {
void set_gotten_into_driver_list() { gotten_into_driver_list_ = true; }
private:
- std::shared_ptr<WorkSerializer> work_serializer_;
+ Mutex* mu_;
char recv_from_source_addr_[200];
ares_socklen_t recv_from_source_addr_len_;
grpc_slice read_buf_;
@@ -674,7 +662,7 @@ class GrpcPolledFdWindows {
grpc_winsocket* winsocket_;
// tcp_write_state_ is only used on TCP GrpcPolledFds
WriteState tcp_write_state_;
- std::string name_;
+ const std::string name_;
bool gotten_into_driver_list_;
int address_family_;
int socket_type_;
@@ -703,8 +691,7 @@ 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(Mutex* mu) : mu_(mu) {}
~SockToPolledFdMap() { GPR_ASSERT(head_ == nullptr); }
@@ -762,7 +749,7 @@ class SockToPolledFdMap {
}
grpc_tcp_set_non_block(s);
GrpcPolledFdWindows* polled_fd =
- new GrpcPolledFdWindows(s, map->work_serializer_, af, type);
+ new GrpcPolledFdWindows(s, map->mu_, af, type);
GRPC_CARES_TRACE_LOG(
"fd:|%s| created with params af:%d type:%d protocol:%d",
polled_fd->GetName(), af, type, protocol);
@@ -817,8 +804,8 @@ class SockToPolledFdMap {
}
private:
+ Mutex* mu_;
SockToPolledFdEntry* head_ = nullptr;
- std::shared_ptr<WorkSerializer> work_serializer_;
};
const struct ares_socket_functions custom_ares_sock_funcs = {
@@ -859,21 +846,18 @@ class GrpcPolledFdWindowsWrapper : public GrpcPolledFd {
return wrapped_->GetWrappedAresSocketLocked();
}
- const char* GetName() override { return wrapped_->GetName(); }
+ const char* GetName() const override { return wrapped_->GetName(); }
private:
- GrpcPolledFdWindows* wrapped_;
+ GrpcPolledFdWindows* const wrapped_;
};
class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
public:
- explicit GrpcPolledFdFactoryWindows(
- std::shared_ptr<WorkSerializer> work_serializer)
- : sock_to_polled_fd_map_(std::move(work_serializer)) {}
+ explicit GrpcPolledFdFactoryWindows(Mutex* mu) : sock_to_polled_fd_map_(mu) {}
GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer) override {
+ ares_socket_t as, grpc_pollset_set* driver_pollset_set) 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.
@@ -890,10 +874,8 @@ class GrpcPolledFdFactoryWindows : public GrpcPolledFdFactory {
SockToPolledFdMap sock_to_polled_fd_map_;
};
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- return absl::make_unique<GrpcPolledFdFactoryWindows>(
- std::move(work_serializer));
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* mu) {
+ return absl::make_unique<GrpcPolledFdFactoryWindows>(mu);
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 82dbb00e..38fd38bf 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
@@ -20,24 +20,23 @@
#if GRPC_ARES == 1
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <string.h>
#include <sys/types.h>
+#include <address_sorting/address_sorting.h>
+#include <ares.h>
+
#include "absl/container/inlined_vector.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
-#include <ares.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include <address_sorting/address_sorting.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
@@ -46,8 +45,8 @@
#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/sockaddr.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/transport/authority_override.h"
using grpc_core::ServerAddress;
using grpc_core::ServerAddressList;
@@ -57,79 +56,64 @@ grpc_core::TraceFlag grpc_trace_cares_address_sorting(false,
grpc_core::TraceFlag grpc_trace_cares_resolver(false, "cares_resolver");
-typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
-
-struct grpc_ares_request {
- /** indicates the DNS server to use, if specified */
- struct ares_addr_port_node dns_server_addr;
- /** following members are set in grpc_resolve_address_ares_impl */
- /** closure to call when the request completes */
- 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 service config in JSON */
- char** service_config_json_out;
- /** the evernt driver used by this request */
- grpc_ares_ev_driver* ev_driver;
- /** number of ongoing queries */
- size_t pending_queries;
-
- /** the errors explaining query failures, appended to in query callbacks */
- grpc_error_handle error;
-};
-
typedef struct fd_node {
+ /* default constructor exists only for linked list manipulation */
+ fd_node() : ev_driver(nullptr) {}
+
+ explicit fd_node(grpc_ares_ev_driver* ev_driver) : ev_driver(ev_driver) {}
+
/** the owner of this fd node */
- grpc_ares_ev_driver* ev_driver;
+ grpc_ares_ev_driver* const ev_driver;
/** a closure wrapping on_readable_locked, which should be
invoked when the grpc_fd in this node becomes readable. */
- grpc_closure read_closure;
+ grpc_closure read_closure ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** a closure wrapping on_writable_locked, which should be
invoked when the grpc_fd in this node becomes writable. */
- grpc_closure write_closure;
+ grpc_closure write_closure ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** next fd node in the list */
- struct fd_node* next;
+ struct fd_node* next ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** wrapped fd that's polled by grpc's poller for the current platform */
- grpc_core::GrpcPolledFd* grpc_polled_fd;
+ grpc_core::GrpcPolledFd* grpc_polled_fd
+ ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** if the readable closure has been registered */
- bool readable_registered;
+ bool readable_registered ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** if the writable closure has been registered */
- bool writable_registered;
+ bool writable_registered ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** if the fd has been shutdown yet from grpc iomgr perspective */
- bool already_shutdown;
+ bool already_shutdown ABSL_GUARDED_BY(&grpc_ares_request::mu);
} fd_node;
struct grpc_ares_ev_driver {
+ explicit grpc_ares_ev_driver(grpc_ares_request* request) : request(request) {}
+
/** the ares_channel owned by this event driver */
- ares_channel channel;
+ ares_channel channel ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** pollset set for driving the IO events of the channel */
- grpc_pollset_set* pollset_set;
+ grpc_pollset_set* pollset_set ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** 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;
/** a list of grpc_fd that this event driver is currently using. */
- fd_node* fds;
+ fd_node* fds ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** is this event driver being shut down */
- bool shutting_down;
+ bool shutting_down ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** request object that's using this ev driver */
- grpc_ares_request* request;
+ grpc_ares_request* const request;
/** Owned by the ev_driver. Creates new GrpcPolledFd's */
- std::unique_ptr<grpc_core::GrpcPolledFdFactory> polled_fd_factory;
+ std::unique_ptr<grpc_core::GrpcPolledFdFactory> polled_fd_factory
+ ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** query timeout in milliseconds */
- int query_timeout_ms;
+ int query_timeout_ms ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** alarm to cancel active queries */
- grpc_timer query_timeout;
+ grpc_timer query_timeout ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** cancels queries on a timeout */
- grpc_closure on_timeout_locked;
+ grpc_closure on_timeout_locked ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** alarm to poll ares_process on in case fd events don't happen */
- grpc_timer ares_backup_poll_alarm;
+ grpc_timer ares_backup_poll_alarm ABSL_GUARDED_BY(&grpc_ares_request::mu);
/** polls ares_process on a periodic timer */
- grpc_closure on_ares_backup_poll_alarm_locked;
+ grpc_closure on_ares_backup_poll_alarm_locked
+ ABSL_GUARDED_BY(&grpc_ares_request::mu);
};
// TODO(apolcyn): make grpc_ares_hostbyname_request a sub-class
@@ -149,8 +133,10 @@ typedef struct grpc_ares_hostbyname_request {
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);
+static void grpc_ares_request_ref_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu);
+static void grpc_ares_request_unref_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu);
// TODO(apolcyn): as a part of C++-ification, find a way to
// organize per-query and per-resolution information in such a way
@@ -177,14 +163,19 @@ class GrpcAresQuery {
};
static grpc_ares_ev_driver* grpc_ares_ev_driver_ref(
- grpc_ares_ev_driver* ev_driver) {
+ grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
GRPC_CARES_TRACE_LOG("request:%p Ref ev_driver %p", ev_driver->request,
ev_driver);
gpr_ref(&ev_driver->refs);
return ev_driver;
}
-static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver) {
+static void grpc_ares_complete_request_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu);
+
+static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
GRPC_CARES_TRACE_LOG("request:%p Unref ev_driver %p", ev_driver->request,
ev_driver);
if (gpr_unref(&ev_driver->refs)) {
@@ -197,17 +188,19 @@ static void grpc_ares_ev_driver_unref(grpc_ares_ev_driver* ev_driver) {
}
}
-static void fd_node_destroy_locked(fd_node* fdn) {
+static void fd_node_destroy_locked(fd_node* fdn)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
GRPC_CARES_TRACE_LOG("request:%p delete fd: %s", fdn->ev_driver->request,
fdn->grpc_polled_fd->GetName());
GPR_ASSERT(!fdn->readable_registered);
GPR_ASSERT(!fdn->writable_registered);
GPR_ASSERT(fdn->already_shutdown);
delete fdn->grpc_polled_fd;
- gpr_free(fdn);
+ delete fdn;
}
-static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
+static void fd_node_shutdown_locked(fd_node* fdn, const char* reason)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
if (!fdn->already_shutdown) {
fdn->already_shutdown = true;
fdn->grpc_polled_fd->ShutdownLocked(
@@ -216,7 +209,8 @@ static void fd_node_shutdown_locked(fd_node* fdn, const char* reason) {
}
void grpc_ares_ev_driver_on_queries_complete_locked(
- grpc_ares_ev_driver* ev_driver) {
+ grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
// We mark the event driver as being shut down.
// grpc_ares_notify_on_event_locked will shut down any remaining
// fds.
@@ -226,7 +220,8 @@ void grpc_ares_ev_driver_on_queries_complete_locked(
grpc_ares_ev_driver_unref(ev_driver);
}
-void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver) {
+void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
ev_driver->shutting_down = true;
fd_node* fn = ev_driver->fds;
while (fn != nullptr) {
@@ -237,7 +232,8 @@ void grpc_ares_ev_driver_shutdown_locked(grpc_ares_ev_driver* ev_driver) {
// Search fd in the fd_node list head. This is an O(n) search, the max possible
// value of n is ARES_GETSOCK_MAXNUM (16). n is typically 1 - 2 in our tests.
-static fd_node* pop_fd_node_locked(fd_node** head, ares_socket_t as) {
+static fd_node* pop_fd_node_locked(fd_node** head, ares_socket_t as)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
fd_node phony_head;
phony_head.next = *head;
fd_node* node = &phony_head;
@@ -253,23 +249,25 @@ static fd_node* pop_fd_node_locked(fd_node** head, ares_socket_t as) {
return nullptr;
}
-static grpc_millis calculate_next_ares_backup_poll_alarm_ms(
- grpc_ares_ev_driver* driver) {
+static grpc_core::Timestamp calculate_next_ares_backup_poll_alarm(
+ grpc_ares_ev_driver* driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
// An alternative here could be to use ares_timeout to try to be more
// accurate, but that would require using "struct timeval"'s, which just makes
// things a bit more complicated. So just poll every second, as suggested
// by the c-ares code comments.
- grpc_millis ms_until_next_ares_backup_poll_alarm = 1000;
+ grpc_core::Duration until_next_ares_backup_poll_alarm =
+ grpc_core::Duration::Seconds(1);
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p. next ares process poll time in "
"%" PRId64 " ms",
- driver->request, driver, ms_until_next_ares_backup_poll_alarm);
- return ms_until_next_ares_backup_poll_alarm +
- grpc_core::ExecCtx::Get()->Now();
+ driver->request, driver, until_next_ares_backup_poll_alarm.millis());
+ return grpc_core::ExecCtx::Get()->Now() + until_next_ares_backup_poll_alarm;
}
-static void on_timeout_locked(grpc_ares_ev_driver* driver,
- grpc_error_handle error) {
+static void on_timeout(void* arg, grpc_error_handle error) {
+ grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
+ grpc_core::MutexLock lock(&driver->request->mu);
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_timeout_locked. driver->shutting_down=%d. "
"err=%s",
@@ -279,28 +277,10 @@ static void on_timeout_locked(grpc_ares_ev_driver* driver,
grpc_ares_ev_driver_shutdown_locked(driver);
}
grpc_ares_ev_driver_unref(driver);
- GRPC_ERROR_UNREF(error);
-}
-
-static void on_timeout(void* arg, grpc_error_handle 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);
}
-static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver);
-
-static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
- grpc_error_handle error);
-
-static void on_ares_backup_poll_alarm(void* arg, grpc_error_handle 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);
-}
+static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu);
/* In case of non-responsive DNS servers, dropped packets, etc., c-ares has
* intelligent timeout and retry logic, which we can take advantage of by
@@ -310,8 +290,9 @@ static void on_ares_backup_poll_alarm(void* arg, grpc_error_handle 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_handle error) {
+static void on_ares_backup_poll_alarm(void* arg, grpc_error_handle error) {
+ grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
+ grpc_core::MutexLock lock(&driver->request->mu);
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_ares_backup_poll_alarm_locked. "
"driver->shutting_down=%d. "
@@ -336,8 +317,8 @@ static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
// in a loop while draining the currently-held WorkSerializer.
// Also see https://github.com/grpc/grpc/issues/26079.
grpc_core::ExecCtx::Get()->InvalidateNow();
- grpc_millis next_ares_backup_poll_alarm =
- calculate_next_ares_backup_poll_alarm_ms(driver);
+ grpc_core::Timestamp next_ares_backup_poll_alarm =
+ calculate_next_ares_backup_poll_alarm(driver);
grpc_ares_ev_driver_ref(driver);
GRPC_CLOSURE_INIT(&driver->on_ares_backup_poll_alarm_locked,
on_ares_backup_poll_alarm, driver,
@@ -349,10 +330,11 @@ 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);
}
-static void on_readable_locked(fd_node* fdn, grpc_error_handle error) {
+static void on_readable(void* arg, grpc_error_handle error) {
+ fd_node* fdn = static_cast<fd_node*>(arg);
+ grpc_core::MutexLock lock(&fdn->ev_driver->request->mu);
GPR_ASSERT(fdn->readable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -374,17 +356,11 @@ static void on_readable_locked(fd_node* fdn, grpc_error_handle error) {
}
grpc_ares_notify_on_event_locked(ev_driver);
grpc_ares_ev_driver_unref(ev_driver);
- GRPC_ERROR_UNREF(error);
}
-static void on_readable(void* arg, grpc_error_handle error) {
+static void on_writable(void* arg, grpc_error_handle 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);
-}
-
-static void on_writable_locked(fd_node* fdn, grpc_error_handle error) {
+ grpc_core::MutexLock lock(&fdn->ev_driver->request->mu);
GPR_ASSERT(fdn->writable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -404,19 +380,12 @@ static void on_writable_locked(fd_node* fdn, grpc_error_handle error) {
}
grpc_ares_notify_on_event_locked(ev_driver);
grpc_ares_ev_driver_unref(ev_driver);
- GRPC_ERROR_UNREF(error);
-}
-
-static void on_writable(void* arg, grpc_error_handle 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);
}
// Get the file descriptors used by the ev_driver's ares channel, register
// driver_closure with these filedescriptors.
-static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
+static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
fd_node* new_list = nullptr;
if (!ev_driver->shutting_down) {
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
@@ -428,13 +397,12 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
fd_node* fdn = pop_fd_node_locked(&ev_driver->fds, socks[i]);
// Create a new fd_node if sock[i] is not in the fd_node list.
if (fdn == nullptr) {
- fdn = static_cast<fd_node*>(gpr_malloc(sizeof(fd_node)));
+ fdn = new fd_node(ev_driver);
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);
GRPC_CARES_TRACE_LOG("request:%p new fd: %s", ev_driver->request,
fdn->grpc_polled_fd->GetName());
- fdn->ev_driver = ev_driver;
fdn->readable_registered = false;
fdn->writable_registered = false;
fdn->already_shutdown = false;
@@ -490,25 +458,27 @@ static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) {
ev_driver->fds = new_list;
}
-void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver) {
+void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) {
grpc_ares_notify_on_event_locked(ev_driver);
// Initialize overall DNS resolution timeout alarm
- grpc_millis timeout =
+ grpc_core::Duration timeout =
ev_driver->query_timeout_ms == 0
- ? GRPC_MILLIS_INF_FUTURE
- : ev_driver->query_timeout_ms + grpc_core::ExecCtx::Get()->Now();
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(ev_driver->query_timeout_ms);
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p grpc_ares_ev_driver_start_locked. timeout in "
"%" PRId64 " ms",
- ev_driver->request, ev_driver, timeout);
+ ev_driver->request, ev_driver, timeout.millis());
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_timeout_locked, on_timeout, ev_driver,
grpc_schedule_on_exec_ctx);
- grpc_timer_init(&ev_driver->query_timeout, timeout,
+ grpc_timer_init(&ev_driver->query_timeout,
+ grpc_core::ExecCtx::Get()->Now() + timeout,
&ev_driver->on_timeout_locked);
// Initialize the backup poll alarm
- grpc_millis next_ares_backup_poll_alarm =
- calculate_next_ares_backup_poll_alarm_ms(ev_driver);
+ grpc_core::Timestamp next_ares_backup_poll_alarm =
+ calculate_next_ares_backup_poll_alarm(ev_driver);
grpc_ares_ev_driver_ref(ev_driver);
GRPC_CLOSURE_INIT(&ev_driver->on_ares_backup_poll_alarm_locked,
on_ares_backup_poll_alarm, ev_driver,
@@ -525,10 +495,9 @@ void (*grpc_ares_test_only_inject_config)(ares_channel channel) =
grpc_error_handle 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();
+ int query_timeout_ms, grpc_ares_request* request)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(request->mu) {
+ *ev_driver = new grpc_ares_ev_driver(request);
ares_options opts;
memset(&opts, 0, sizeof(opts));
opts.flags |= ARES_FLAG_STAYOPEN;
@@ -536,21 +505,17 @@ grpc_error_handle 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_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Failed to init ares channel. C-ares error: ",
- ares_strerror(status))
- .c_str());
- gpr_free(*ev_driver);
+ grpc_error_handle err = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Failed to init ares channel. C-ares error: ", ares_strerror(status)));
+ delete *ev_driver;
return err;
}
- (*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;
(*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)->request->mu);
(*ev_driver)
->polled_fd_factory->ConfigureAresChannelLocked((*ev_driver)->channel);
(*ev_driver)->query_timeout_ms = query_timeout_ms;
@@ -596,18 +561,21 @@ void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r,
}
}
-static void grpc_ares_request_ref_locked(grpc_ares_request* r) {
+static void grpc_ares_request_ref_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) {
r->pending_queries++;
}
-static void grpc_ares_request_unref_locked(grpc_ares_request* r) {
+static void grpc_ares_request_unref_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) {
r->pending_queries--;
if (r->pending_queries == 0u) {
grpc_ares_ev_driver_on_queries_complete_locked(r->ev_driver);
}
}
-void grpc_ares_complete_request_locked(grpc_ares_request* r) {
+void grpc_ares_complete_request_locked(grpc_ares_request* r)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) {
/* Invoke on_done callback and destroy the
request */
r->ev_driver = nullptr;
@@ -632,7 +600,8 @@ void grpc_ares_complete_request_locked(grpc_ares_request* r) {
* 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) {
+ bool is_balancer, const char* qtype)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_request->mu) {
GRPC_CARES_TRACE_LOG(
"request:%p create_hostbyname_request_locked host:%s port:%d "
"is_balancer:%d qtype:%s",
@@ -647,15 +616,18 @@ static grpc_ares_hostbyname_request* create_hostbyname_request_locked(
return hr;
}
-static void destroy_hostbyname_request_locked(
- grpc_ares_hostbyname_request* hr) {
+static void destroy_hostbyname_request_locked(grpc_ares_hostbyname_request* hr)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(hr->parent_request->mu) {
grpc_ares_request_unref_locked(hr->parent_request);
gpr_free(hr->host);
delete hr;
}
static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
- struct hostent* hostent) {
+ struct hostent* hostent)
+ ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ // This callback is invoked from the c-ares library, so disable thread safety
+ // analysis. Note that we are guaranteed to be holding r->mu, though.
grpc_ares_hostbyname_request* hr =
static_cast<grpc_ares_hostbyname_request*>(arg);
grpc_ares_request* r = hr->parent_request;
@@ -672,8 +644,8 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) {
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_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY), hr->host));
}
grpc_channel_args* args = grpc_channel_args_copy_and_add(
nullptr, args_to_add.data(), args_to_add.size());
@@ -720,15 +692,17 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
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_handle error =
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(error_msg);
r->error = grpc_error_add_child(error, r->error);
}
destroy_hostbyname_request_locked(hr);
}
static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
- unsigned char* abuf, int alen) {
+ unsigned char* abuf,
+ int alen) ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ // This callback is invoked from the c-ares library, so disable thread safety
+ // analysis. Note that we are guaranteed to be holding r->mu, though.
GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
grpc_ares_request* r = q->parent_request();
if (status == ARES_SUCCESS) {
@@ -765,8 +739,7 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
ares_strerror(status));
GRPC_CARES_TRACE_LOG("request:%p on_srv_query_done_locked: %s", r,
error_msg.c_str());
- grpc_error_handle error =
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(error_msg);
r->error = grpc_error_add_child(error, r->error);
}
delete q;
@@ -775,7 +748,10 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
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) {
+ unsigned char* buf,
+ int len) ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ // This callback is invoked from the c-ares library, so disable thread safety
+ // analysis. Note that we are guaranteed to be holding r->mu, though.
GrpcAresQuery* q = static_cast<GrpcAresQuery*>(arg);
std::unique_ptr<GrpcAresQuery> query_deleter(q);
grpc_ares_request* r = q->parent_request();
@@ -823,17 +799,16 @@ fail:
std::string error_msg =
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());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(error_msg);
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) ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_ares_hostbyname_request* hr = nullptr;
/* parse name, splitting it into host and port parts */
@@ -843,20 +818,19 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
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));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
} else if (port.empty()) {
- if (default_port == nullptr) {
+ if (default_port == nullptr || strlen(default_port) == 0) {
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));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
}
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, r);
if (error != GRPC_ERROR_NONE) goto error_cleanup;
// If dns_server is specified, use it.
if (dns_server != nullptr && dns_server[0] != '\0') {
@@ -881,16 +855,14 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
} else {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("cannot parse authority"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
}
int status =
ares_set_servers_ports(r->ev_driver->channel, &r->dns_server_addr);
if (status != ARES_SUCCESS) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("C-ares status is not ARES_SUCCESS: ",
- ares_strerror(status))
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "C-ares status is not ARES_SUCCESS: ", ares_strerror(status)));
goto error_cleanup;
}
}
@@ -940,7 +912,7 @@ static bool inner_resolve_as_ip_literal_locked(
return false;
}
if (port->empty()) {
- if (default_port == nullptr) {
+ if (default_port == nullptr || strlen(default_port) == 0) {
gpr_log(GPR_ERROR,
"No port or default port for %s while attempting to resolve as "
"ip literal.",
@@ -1003,7 +975,7 @@ static bool inner_maybe_resolve_localhost_manually_locked(
return false;
}
if (port->empty()) {
- if (default_port == nullptr) {
+ if (default_port == nullptr || strlen(default_port) == 0) {
gpr_log(GPR_ERROR,
"No port or default port for %s during manual localhost "
"resolution check.",
@@ -1057,24 +1029,21 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked(
}
#endif /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */
-static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
+static grpc_ares_request* grpc_dns_lookup_ares_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,
- char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
- grpc_ares_request* r =
- static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
+ char** service_config_json, int query_timeout_ms) {
+ grpc_ares_request* r = new grpc_ares_request();
+ grpc_core::MutexLock lock(&r->mu);
r->ev_driver = nullptr;
r->on_done = on_done;
r->addresses_out = addrs;
r->balancer_addresses_out = balancer_addrs;
r->service_config_json_out = service_config_json;
- r->error = GRPC_ERROR_NONE;
- r->pending_queries = 0;
GRPC_CARES_TRACE_LOG(
- "request:%p c-ares grpc_dns_lookup_ares_locked_impl name=%s, "
+ "request:%p c-ares grpc_dns_lookup_ares_impl name=%s, "
"default_port=%s",
r, name, default_port);
// Early out if the target is an ipv4 or ipv6 literal.
@@ -1097,29 +1066,30 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
}
// 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);
return r;
}
-grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
+grpc_ares_request* (*grpc_dns_lookup_ares)(
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,
- char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) =
- grpc_dns_lookup_ares_locked_impl;
+ char** service_config_json,
+ int query_timeout_ms) = grpc_dns_lookup_ares_impl;
-static void grpc_cancel_ares_request_locked_impl(grpc_ares_request* r) {
+static void grpc_cancel_ares_request_impl(grpc_ares_request* r) {
GPR_ASSERT(r != nullptr);
+ grpc_core::MutexLock lock(&r->mu);
+ GRPC_CARES_TRACE_LOG("request:%p grpc_cancel_ares_request ev_driver:%p", r,
+ r->ev_driver);
if (r->ev_driver != nullptr) {
grpc_ares_ev_driver_shutdown_locked(r->ev_driver);
}
}
-void (*grpc_cancel_ares_request_locked)(grpc_ares_request* r) =
- grpc_cancel_ares_request_locked_impl;
+void (*grpc_cancel_ares_request)(grpc_ares_request* r) =
+ grpc_cancel_ares_request_impl;
// ares_library_init and ares_library_cleanup are currently no-op except under
// Windows. Calling them may cause race conditions when other parts of the
@@ -1128,9 +1098,8 @@ void (*grpc_cancel_ares_request_locked)(grpc_ares_request* r) =
grpc_error_handle grpc_ares_init(void) {
int status = ares_library_init(ARES_LIB_INIT_ALL);
if (status != ARES_SUCCESS) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("ares_library_init failed: ", ares_strerror(status))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("ares_library_init failed: ", ares_strerror(status)));
}
return GRPC_ERROR_NONE;
}
@@ -1141,95 +1110,4 @@ grpc_error_handle grpc_ares_init(void) { return GRPC_ERROR_NONE; }
void grpc_ares_cleanup(void) {}
#endif // GPR_WINDOWS
-/*
- * grpc_resolve_address_ares related structs and functions
- */
-
-typedef struct grpc_resolve_address_ares_request {
- /* 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 */
- std::unique_ptr<ServerAddressList> addresses;
- /** closure to call when the resolve_address_ares request completes */
- grpc_closure* on_resolve_address_done;
- /** a closure wrapping on_resolve_address_done, which should be invoked when
- the grpc_dns_lookup_ares_locked operation is done. */
- grpc_closure on_dns_lookup_done_locked;
- /* target name */
- const char* name;
- /* default port to use if none is specified */
- const char* default_port;
- /* pollset_set to be driven by */
- grpc_pollset_set* interested_parties;
- /* underlying ares_request that the query is performed on */
- 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_handle error) {
- gpr_free(r->ares_request);
- grpc_resolved_addresses** resolved_addresses = r->addrs_out;
- if (r->addresses == nullptr || r->addresses->empty()) {
- *resolved_addresses = nullptr;
- } else {
- *resolved_addresses = static_cast<grpc_resolved_addresses*>(
- gpr_zalloc(sizeof(grpc_resolved_addresses)));
- (*resolved_addresses)->naddrs = r->addresses->size();
- (*resolved_addresses)->addrs =
- static_cast<grpc_resolved_address*>(gpr_zalloc(
- sizeof(grpc_resolved_address) * (*resolved_addresses)->naddrs));
- for (size_t i = 0; i < (*resolved_addresses)->naddrs; ++i) {
- memcpy(&(*resolved_addresses)->addrs[i], &(*r->addresses)[i].address(),
- sizeof(grpc_resolved_address));
- }
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_resolve_address_done, error);
- delete r;
-}
-
-static void on_dns_lookup_done(void* arg, grpc_error_handle 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);
-}
-
-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);
-}
-
-static void grpc_resolve_address_ares_impl(const char* name,
- const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- 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->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);
-}
-
-void (*grpc_resolve_address_ares)(
- const char* name, const char* default_port,
- grpc_pollset_set* interested_parties, grpc_closure* on_done,
- grpc_resolved_addresses** addrs) = grpc_resolve_address_ares_impl;
-
#endif /* GRPC_ARES == 1 */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 675dfc8e..bc35060b 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -23,11 +23,11 @@
#include <ares.h>
-#include "src/core/ext/filters/client_channel/server_address.h"
#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/resolver/server_address.h"
#define GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS 120000
@@ -42,37 +42,54 @@ extern grpc_core::TraceFlag grpc_trace_cares_resolver;
} \
} while (0)
-typedef struct grpc_ares_request grpc_ares_request;
-
-/* Asynchronously resolve \a name. Use \a default_port if a port isn't
- designated in \a name, otherwise use the port in \a name. grpc_ares_init()
- must be called at least once before this function. \a on_done may be
- called directly in this function without being scheduled with \a exec_ctx,
- so it must not try to acquire locks that are being held by the caller. */
-extern void (*grpc_resolve_address_ares)(const char* name,
- const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_resolved_addresses** addresses);
+typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
+
+struct grpc_ares_request {
+ /** synchronizes access to this request, and also to associated
+ * ev_driver and fd_node objects */
+ grpc_core::Mutex mu;
+ /** indicates the DNS server to use, if specified */
+ struct ares_addr_port_node dns_server_addr ABSL_GUARDED_BY(mu);
+ /** following members are set in grpc_resolve_address_ares_impl */
+ /** closure to call when the request completes */
+ grpc_closure* on_done ABSL_GUARDED_BY(mu) = nullptr;
+ /** the pointer to receive the resolved addresses */
+ std::unique_ptr<grpc_core::ServerAddressList>* addresses_out
+ ABSL_GUARDED_BY(mu);
+ /** the pointer to receive the resolved balancer addresses */
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses_out
+ ABSL_GUARDED_BY(mu);
+ /** the pointer to receive the service config in JSON */
+ char** service_config_json_out ABSL_GUARDED_BY(mu) = nullptr;
+ /** the evernt driver used by this request */
+ grpc_ares_ev_driver* ev_driver ABSL_GUARDED_BY(mu) = nullptr;
+ /** number of ongoing queries */
+ size_t pending_queries ABSL_GUARDED_BY(mu) = 0;
+ /** the errors explaining query failures, appended to in query callbacks */
+ grpc_error_handle error ABSL_GUARDED_BY(mu) = GRPC_ERROR_NONE;
+};
/* Asynchronously resolve \a name. It will try to resolve grpclb SRV records in
addition to the normal address records. For normal address records, it uses
\a default_port if a port isn't designated in \a name, otherwise it uses the
port in \a name. grpc_ares_init() must be called at least once before this
- function. \a on_done may be called directly in this function without being
- scheduled with \a exec_ctx, so it must not try to acquire locks that are
- being held by the caller. The returned grpc_ares_request object is owned
- by the caller and it is safe to free after on_done is called back. */
-extern grpc_ares_request* (*grpc_dns_lookup_ares_locked)(
+ function. The returned grpc_ares_request object is owned by the caller and it
+ is safe to free after on_done is called back.
+
+ Note on synchronization: \a as on_done might be called from another thread
+ ~immediately, access to the grpc_ares_request* return value must be
+ synchronized by the caller. TODO(apolcyn): we should remove this requirement
+ by changing this API to use two phase initialization - one API to create
+ the grpc_ares_request* and another to start the async work. */
+extern grpc_ares_request* (*grpc_dns_lookup_ares)(
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,
- char** service_config_json, int query_timeout_ms,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
+ char** service_config_json, int query_timeout_ms);
/* Cancel the pending grpc_ares_request \a request */
-extern void (*grpc_cancel_ares_request_locked)(grpc_ares_request* request);
+extern void (*grpc_cancel_ares_request)(grpc_ares_request* request);
/* Initialize gRPC ares wrapper. Must be called at least once before
grpc_resolve_address_ares(). */
@@ -83,10 +100,6 @@ grpc_error_handle grpc_ares_init(void);
it has been called the same number of times as grpc_ares_init(). */
void grpc_ares_cleanup(void);
-/** Schedules the desired callback for request completion
- * and destroys the grpc_ares_request */
-void grpc_ares_complete_request_locked(grpc_ares_request* request);
-
/* Indicates whether or not AAAA queries should be attempted. */
/* E.g., return false if ipv6 is known to not be available. */
bool grpc_ares_query_ipv6();
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
new file mode 100644
index 00000000..fdd4e00c
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
@@ -0,0 +1,28 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+#if GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE)
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+
+bool grpc_ares_query_ipv6() {
+ /* The libuv grpc code currently does not have the code to probe for this,
+ * so we assume for now that IPv6 is always available in contexts where this
+ * code will be used. */
+ return true;
+}
+
+#endif /* GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE) */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
deleted file mode 100644
index 8735aa8e..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * 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/port.h"
-#if GRPC_ARES == 1 && defined(GRPC_UV)
-
-#include <grpc/support/string_util.h>
-
-#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/address_utils/parse_address.h"
-#include "src/core/lib/gpr/string.h"
-
-bool grpc_ares_query_ipv6() {
- /* The libuv grpc code currently does not have the code to probe for this,
- * so we assume for now that IPv6 is always available in contexts where this
- * code will be used. */
- return true;
-}
-
-#endif /* GRPC_ARES == 1 && defined(GRPC_UV) */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
index f76c6a4a..5269a06e 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
@@ -24,10 +24,10 @@
#include <grpc/support/string_util.h>
#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/address_utils/parse_address.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/socket_windows.h"
+#include "src/core/lib/resolver/server_address.h"
bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); }
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index 3265e29c..c787ae2c 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -1,43 +1,36 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
-#include <inttypes.h>
-#include <climits>
-#include <cstring>
-
+#include "absl/functional/bind_front.h"
#include "absl/strings/str_cat.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/ext/filters/client_channel/resolver/polling_resolver.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
-#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/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
#define GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -48,282 +41,129 @@ namespace grpc_core {
namespace {
-const char kDefaultPort[] = "https";
+TraceFlag grpc_trace_dns_resolver(false, "dns_resolver");
-class NativeDnsResolver : public Resolver {
+class NativeClientChannelDNSResolver : public PollingResolver {
public:
- explicit NativeDnsResolver(ResolverArgs args);
-
- void StartLocked() override;
-
- void RequestReresolutionLocked() override;
-
- void ResetBackoffLocked() override;
+ NativeClientChannelDNSResolver(ResolverArgs args,
+ const grpc_channel_args* channel_args);
+ ~NativeClientChannelDNSResolver() override;
- void ShutdownLocked() override;
+ OrphanablePtr<Orphanable> StartRequest() override;
private:
- ~NativeDnsResolver() override;
-
- void MaybeStartResolvingLocked();
- void StartResolvingLocked();
-
- static void OnNextResolution(void* arg, grpc_error_handle error);
- void OnNextResolutionLocked(grpc_error_handle error);
- static void OnResolved(void* arg, grpc_error_handle error);
- void OnResolvedLocked(grpc_error_handle error);
-
- /// name to resolve
- std::string name_to_resolve_;
- /// channel args
- grpc_channel_args* channel_args_ = nullptr;
- std::shared_ptr<WorkSerializer> work_serializer_;
- std::unique_ptr<ResultHandler> result_handler_;
- /// pollset_set to drive the name resolution process
- grpc_pollset_set* interested_parties_ = nullptr;
- /// are we shutting down?
- bool shutdown_ = false;
- /// are we currently resolving?
- bool resolving_ = false;
- grpc_closure on_resolved_;
- /// next resolution timer
- bool have_next_resolution_timer_ = false;
- grpc_timer next_resolution_timer_;
- grpc_closure on_next_resolution_;
- /// min time between DNS requests
- grpc_millis min_time_between_resolutions_;
- /// timestamp of last DNS request
- grpc_millis last_resolution_timestamp_ = -1;
- /// retry backoff state
- BackOff backoff_;
- /// currently resolving addresses
- grpc_resolved_addresses* addresses_ = nullptr;
+ void OnResolved(
+ absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or);
};
-NativeDnsResolver::NativeDnsResolver(ResolverArgs args)
- : name_to_resolve_(absl::StripPrefix(args.uri.path(), "/")),
- channel_args_(grpc_channel_args_copy(args.args)),
- work_serializer_(std::move(args.work_serializer)),
- result_handler_(std::move(args.result_handler)),
- interested_parties_(grpc_pollset_set_create()),
- min_time_between_resolutions_(grpc_channel_args_find_integer(
- channel_args_, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
- {1000 * 30, 0, INT_MAX})),
- backoff_(
+NativeClientChannelDNSResolver::NativeClientChannelDNSResolver(
+ ResolverArgs args, const grpc_channel_args* channel_args)
+ : PollingResolver(
+ std::move(args), channel_args,
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ channel_args, GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS,
+ {1000 * 30, 0, INT_MAX})),
BackOff::Options()
- .set_initial_backoff(GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS *
- 1000)
+ .set_initial_backoff(Duration::Milliseconds(
+ GRPC_DNS_INITIAL_CONNECT_BACKOFF_SECONDS * 1000))
.set_multiplier(GRPC_DNS_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(GRPC_DNS_RECONNECT_JITTER)
- .set_max_backoff(GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) {
- if (args.pollset_set != nullptr) {
- grpc_pollset_set_add_pollset_set(interested_parties_, args.pollset_set);
- }
-}
-
-NativeDnsResolver::~NativeDnsResolver() {
- grpc_channel_args_destroy(channel_args_);
- grpc_pollset_set_destroy(interested_parties_);
-}
-
-void NativeDnsResolver::StartLocked() { MaybeStartResolvingLocked(); }
-
-void NativeDnsResolver::RequestReresolutionLocked() {
- if (!resolving_) {
- MaybeStartResolvingLocked();
- }
-}
-
-void NativeDnsResolver::ResetBackoffLocked() {
- if (have_next_resolution_timer_) {
- grpc_timer_cancel(&next_resolution_timer_);
+ .set_max_backoff(Duration::Milliseconds(
+ GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)),
+ &grpc_trace_dns_resolver) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) {
+ gpr_log(GPR_DEBUG, "[dns_resolver=%p] created", this);
}
- backoff_.Reset();
}
-void NativeDnsResolver::ShutdownLocked() {
- shutdown_ = true;
- if (have_next_resolution_timer_) {
- grpc_timer_cancel(&next_resolution_timer_);
+NativeClientChannelDNSResolver::~NativeClientChannelDNSResolver() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) {
+ gpr_log(GPR_DEBUG, "[dns_resolver=%p] destroyed", this);
}
}
-void NativeDnsResolver::OnNextResolution(void* arg, grpc_error_handle 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);
-}
-
-void NativeDnsResolver::OnNextResolutionLocked(grpc_error_handle error) {
- have_next_resolution_timer_ = false;
- if (error == GRPC_ERROR_NONE && !resolving_) {
- StartResolvingLocked();
+OrphanablePtr<Orphanable> NativeClientChannelDNSResolver::StartRequest() {
+ Ref(DEBUG_LOCATION, "dns_request").release();
+ auto dns_request = GetDNSResolver()->ResolveName(
+ name_to_resolve(), kDefaultSecurePort, interested_parties(),
+ absl::bind_front(&NativeClientChannelDNSResolver::OnResolved, this));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) {
+ gpr_log(GPR_DEBUG, "[dns_resolver=%p] starting request=%p", this,
+ dns_request.get());
}
- Unref(DEBUG_LOCATION, "retry-timer");
- GRPC_ERROR_UNREF(error);
-}
-
-void NativeDnsResolver::OnResolved(void* arg, grpc_error_handle 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);
+ dns_request->Start();
+ // Explicit type conversion to work around issue with older compilers.
+ return OrphanablePtr<Orphanable>(dns_request.release());
}
-void NativeDnsResolver::OnResolvedLocked(grpc_error_handle error) {
- GPR_ASSERT(resolving_);
- resolving_ = false;
- if (shutdown_) {
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
- return;
+void NativeClientChannelDNSResolver::OnResolved(
+ absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) {
+ gpr_log(GPR_DEBUG, "[dns_resolver=%p] request complete, status=\"%s\"",
+ this, addresses_or.status().ToString().c_str());
}
- 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,
- nullptr /* args */);
+ // Convert result from iomgr DNS API into Resolver::Result.
+ Result result;
+ if (addresses_or.ok()) {
+ ServerAddressList addresses;
+ for (auto& addr : *addresses_or) {
+ addresses.emplace_back(addr, nullptr /* args */);
}
- 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();
+ result.addresses = std::move(addresses);
} else {
- gpr_log(GPR_INFO, "dns resolution failed (will retry): %s",
- grpc_error_std_string(error).c_str());
- // Return transient error.
- std::string error_message =
- 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.
- // InvalidateNow to avoid getting stuck re-initializing this timer
- // in a loop while draining the currently-held WorkSerializer.
- // Also see https://github.com/grpc/grpc/issues/26079.
- ExecCtx::Get()->InvalidateNow();
- 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;
- // 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();
- 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_);
- }
- Unref(DEBUG_LOCATION, "dns-resolving");
- GRPC_ERROR_UNREF(error);
-}
-
-void NativeDnsResolver::MaybeStartResolvingLocked() {
- // If there is an existing timer, the time it fires is the earliest time we
- // can start the next resolution.
- if (have_next_resolution_timer_) return;
- if (last_resolution_timestamp_ >= 0) {
- // InvalidateNow to avoid getting stuck re-initializing this timer
- // in a loop while draining the currently-held WorkSerializer.
- // Also see https://github.com/grpc/grpc/issues/26079.
- ExecCtx::Get()->InvalidateNow();
- const grpc_millis earliest_next_resolution =
- last_resolution_timestamp_ + min_time_between_resolutions_;
- const grpc_millis ms_until_next_resolution =
- earliest_next_resolution - grpc_core::ExecCtx::Get()->Now();
- if (ms_until_next_resolution > 0) {
- const grpc_millis last_resolution_ago =
- grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_;
- gpr_log(GPR_DEBUG,
- "In cooldown from last resolution (from %" PRId64
- " ms ago). Will resolve again in %" PRId64 " ms",
- last_resolution_ago, ms_until_next_resolution);
- 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_cooldown").release();
- GRPC_CLOSURE_INIT(&on_next_resolution_,
- NativeDnsResolver::OnNextResolution, this,
- grpc_schedule_on_exec_ctx);
- grpc_timer_init(&next_resolution_timer_,
- ExecCtx::Get()->Now() + ms_until_next_resolution,
- &on_next_resolution_);
- return;
- }
+ result.addresses = absl::UnavailableError(
+ absl::StrCat("DNS resolution failed for ", name_to_resolve(), ": ",
+ addresses_or.status().ToString()));
}
- StartResolvingLocked();
-}
-
-void NativeDnsResolver::StartResolvingLocked() {
- gpr_log(GPR_DEBUG, "Start resolving.");
- // 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, "dns-resolving").release();
- GPR_ASSERT(!resolving_);
- resolving_ = true;
- addresses_ = nullptr;
- GRPC_CLOSURE_INIT(&on_resolved_, NativeDnsResolver::OnResolved, this,
- grpc_schedule_on_exec_ctx);
- grpc_resolve_address(name_to_resolve_.c_str(), kDefaultPort,
- interested_parties_, &on_resolved_, &addresses_);
- last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
+ result.args = grpc_channel_args_copy(channel_args());
+ OnRequestComplete(std::move(result));
+ Unref(DEBUG_LOCATION, "dns_request");
}
//
// Factory
//
-class NativeDnsResolverFactory : public ResolverFactory {
+class NativeClientChannelDNSResolverFactory : public ResolverFactory {
public:
+ absl::string_view scheme() const override { return "dns"; }
+
bool IsValidUri(const URI& uri) const override {
if (GPR_UNLIKELY(!uri.authority().empty())) {
gpr_log(GPR_ERROR, "authority based dns uri's not supported");
return false;
}
+ if (absl::StripPrefix(uri.path(), "/").empty()) {
+ gpr_log(GPR_ERROR, "no server name supplied in dns URI");
+ return false;
+ }
return true;
}
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
if (!IsValidUri(args.uri)) return nullptr;
- return MakeOrphanable<NativeDnsResolver>(std::move(args));
+ const grpc_channel_args* channel_args = args.args;
+ return MakeOrphanable<NativeClientChannelDNSResolver>(std::move(args),
+ channel_args);
}
-
- const char* scheme() const override { return "dns"; }
};
} // namespace
-} // namespace grpc_core
-
-void grpc_resolver_dns_native_init() {
- grpc_core::UniquePtr<char> resolver =
- GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
- if (gpr_stricmp(resolver.get(), "native") == 0) {
+void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder) {
+ static const char* const resolver =
+ GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver).release();
+ if (gpr_stricmp(resolver, "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::NativeDnsResolverFactory>());
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<NativeClientChannelDNSResolverFactory>());
} else {
- grpc_core::ResolverRegistry::Builder::InitRegistry();
- grpc_core::ResolverFactory* existing_factory =
- grpc_core::ResolverRegistry::LookupResolverFactory("dns");
- if (existing_factory == nullptr) {
+ if (!builder->resolver_registry()->HasResolverFactory("dns")) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::NativeDnsResolverFactory>());
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<NativeClientChannelDNSResolverFactory>());
}
}
}
-void grpc_resolver_dns_native_shutdown() {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
index 7978d59e..7ea635f4 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
@@ -19,6 +19,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
+
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -28,21 +30,20 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#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/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
-
namespace grpc_core {
// This cannot be in an anonymous namespace, because it is a friend of
@@ -142,23 +143,23 @@ void FakeResolver::MaybeSendResultLocked() {
if (!started_ || shutdown_) return;
if (return_failure_) {
// TODO(roth): Change resolver result generator to be able to inject
- // the error to be returned.
- result_handler_->ReturnError(grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resolver transient failure"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ // the error to be returned and to be able to independently set errors
+ // for addresses and service config.
+ Result result;
+ result.addresses = absl::UnavailableError("Resolver transient failure");
+ result.service_config = result.addresses.status();
+ result.args = grpc_channel_args_copy(channel_args_);
+ result_handler_->ReportResult(std::move(result));
return_failure_ = false;
} else if (has_next_result_) {
Result result;
result.addresses = std::move(next_result_.addresses);
result.service_config = std::move(next_result_.service_config);
- // TODO(roth): Use std::move() once grpc_error is converted to C++.
- result.service_config_error = next_result_.service_config_error;
- next_result_.service_config_error = GRPC_ERROR_NONE;
// When both next_results_ and channel_args_ contain an arg with the same
// name, only the one in next_results_ will be kept since next_results_ is
// before channel_args_.
result.args = grpc_channel_args_union(next_result_.args, channel_args_);
- result_handler_->ReturnResult(std::move(result));
+ result_handler_->ReportResult(std::move(result));
has_next_result_ = false;
}
}
@@ -324,7 +325,9 @@ void ResponseGeneratorChannelArgDestroy(void* p) {
generator->Unref();
}
-int ResponseGeneratorChannelArgCmp(void* a, void* b) { return GPR_ICMP(a, b); }
+int ResponseGeneratorChannelArgCmp(void* a, void* b) {
+ return QsortCompare(a, b);
+}
} // namespace
@@ -357,22 +360,22 @@ namespace {
class FakeResolverFactory : public ResolverFactory {
public:
+ absl::string_view scheme() const override { return "fake"; }
+
bool IsValidUri(const URI& /*uri*/) const override { return true; }
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
return MakeOrphanable<FakeResolver>(std::move(args));
}
-
- const char* scheme() const override { return "fake"; }
};
} // namespace
-} // namespace grpc_core
-
-void grpc_resolver_fake_init() {
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::FakeResolverFactory>());
+void RegisterFakeResolver(CoreConfiguration::Builder* builder) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<FakeResolverFactory>());
}
+} // namespace grpc_core
+
void grpc_resolver_fake_shutdown() {}
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
index 94d7c22c..c1feaf16 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
+++ b/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -19,10 +19,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/resolver.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/resolver/resolver.h"
#define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \
"grpc.fake_resolver.response_generator"
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
index 208ec670..807a2c74 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
@@ -16,12 +16,15 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include <random>
+
#include "src/core/ext/xds/xds_client.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
namespace grpc_core {
@@ -50,19 +53,15 @@ class GoogleCloud2ProdResolver : public Resolver {
private:
static void OnHttpRequestDone(void* arg, grpc_error_handle error);
- // Calls OnDone() if not already called. Releases a ref.
- void MaybeCallOnDone(grpc_error_handle error);
-
// If error is not GRPC_ERROR_NONE, then it's not safe to look at response.
virtual void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response,
grpc_error_handle error) = 0;
RefCountedPtr<GoogleCloud2ProdResolver> resolver_;
- grpc_httpcli_context context_;
- grpc_httpcli_response response_;
+ OrphanablePtr<HttpRequest> http_request_;
+ grpc_http_response response_;
grpc_closure on_done_;
- Atomic<bool> on_done_called_{false};
};
// A metadata server query to get the zone.
@@ -93,10 +92,13 @@ class GoogleCloud2ProdResolver : public Resolver {
void IPv6QueryDone(bool ipv6_supported);
void StartXdsResolver();
+ ResourceQuotaRefPtr resource_quota_;
std::shared_ptr<WorkSerializer> work_serializer_;
grpc_polling_entity pollent_;
bool using_dns_ = false;
OrphanablePtr<Resolver> child_resolver_;
+ std::string metadata_server_name_ = "metadata.google.internal.";
+ bool shutdown_ = false;
OrphanablePtr<ZoneQuery> zone_query_;
absl::optional<std::string> zone_;
@@ -113,59 +115,50 @@ GoogleCloud2ProdResolver::MetadataQuery::MetadataQuery(
RefCountedPtr<GoogleCloud2ProdResolver> resolver, const char* path,
grpc_polling_entity* pollent)
: resolver_(std::move(resolver)) {
- grpc_httpcli_context_init(&context_);
// Start HTTP request.
GRPC_CLOSURE_INIT(&on_done_, OnHttpRequestDone, this, nullptr);
Ref().release(); // Ref held by callback.
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
grpc_http_header header = {const_cast<char*>("Metadata-Flavor"),
const_cast<char*>("Google")};
- request.host = const_cast<char*>("metadata.google.internal");
- request.http.path = const_cast<char*>(path);
- request.http.hdr_count = 1;
- request.http.hdrs = &header;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("c2p_resolver");
- grpc_httpcli_get(&context_, pollent, resource_quota, &request,
- ExecCtx::Get()->Now() + 10000, // 10s timeout
- &on_done_, &response_);
- grpc_resource_quota_unref_internal(resource_quota);
+ request.hdr_count = 1;
+ request.hdrs = &header;
+ auto uri = URI::Create("http", resolver_->metadata_server_name_, path,
+ {} /* query params */, "" /* fragment */);
+ GPR_ASSERT(uri.ok()); // params are hardcoded
+ grpc_arg resource_quota_arg = grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA),
+ resolver_->resource_quota_.get(), grpc_resource_quota_arg_vtable());
+ grpc_channel_args args = {1, &resource_quota_arg};
+ http_request_ = HttpRequest::Get(
+ std::move(*uri), &args, pollent, &request,
+ ExecCtx::Get()->Now() + Duration::Seconds(10), // 10s timeout
+ &on_done_, &response_,
+ RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create()));
+ http_request_->Start();
}
GoogleCloud2ProdResolver::MetadataQuery::~MetadataQuery() {
- grpc_httpcli_context_destroy(&context_);
grpc_http_response_destroy(&response_);
}
void GoogleCloud2ProdResolver::MetadataQuery::Orphan() {
- // TODO(roth): Once the HTTP client library supports cancellation,
- // use that here.
- MaybeCallOnDone(GRPC_ERROR_CANCELLED);
+ http_request_.reset();
+ Unref();
}
void GoogleCloud2ProdResolver::MetadataQuery::OnHttpRequestDone(
void* arg, grpc_error_handle error) {
auto* self = static_cast<MetadataQuery*>(arg);
- self->MaybeCallOnDone(GRPC_ERROR_REF(error));
-}
-
-void GoogleCloud2ProdResolver::MetadataQuery::MaybeCallOnDone(
- grpc_error_handle error) {
- bool expected = false;
- if (!on_done_called_.CompareExchangeStrong(
- &expected, true, MemoryOrder::RELAXED, MemoryOrder::RELAXED)) {
- // We've already called OnDone(), so just clean up.
- GRPC_ERROR_UNREF(error);
- Unref();
- return;
- }
// Hop back into WorkSerializer to call OnDone().
// Note: We implicitly pass our ref to the callback here.
- resolver_->work_serializer_->Run(
- [this, error]() {
- OnDone(resolver_.get(), &response_, error);
- Unref();
+ (void)GRPC_ERROR_REF(error);
+ self->resolver_->work_serializer_->Run(
+ [self, error]() {
+ self->OnDone(self->resolver_.get(), &self->response_, error);
+ self->Unref();
},
DEBUG_LOCATION);
}
@@ -183,22 +176,31 @@ GoogleCloud2ProdResolver::ZoneQuery::ZoneQuery(
void GoogleCloud2ProdResolver::ZoneQuery::OnDone(
GoogleCloud2ProdResolver* resolver, const grpc_http_response* response,
grpc_error_handle error) {
+ absl::StatusOr<std::string> zone;
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "error fetching zone from metadata server: %s",
- grpc_error_std_string(error).c_str());
- }
- std::string zone;
- if (error == GRPC_ERROR_NONE && response->status == 200) {
+ zone = absl::UnknownError(
+ absl::StrCat("error fetching zone from metadata server: ",
+ grpc_error_std_string(error)));
+ } else if (response->status != 200) {
+ zone = absl::UnknownError(absl::StrFormat(
+ "zone query received non-200 status: %d", response->status));
+ } else {
absl::string_view body(response->body, response->body_length);
size_t i = body.find_last_of('/');
if (i == body.npos) {
- gpr_log(GPR_ERROR, "could not parse zone from metadata server: %s",
- std::string(body).c_str());
+ zone = absl::UnknownError(
+ absl::StrCat("could not parse zone from metadata server: ", body));
} else {
- zone = std::string(body.substr(i));
+ zone = std::string(body.substr(i + 1));
}
}
- resolver->ZoneQueryDone(std::move(zone));
+ if (!zone.ok()) {
+ gpr_log(GPR_ERROR, "zone query failed: %s",
+ zone.status().ToString().c_str());
+ resolver->ZoneQueryDone("");
+ } else {
+ resolver->ZoneQueryDone(std::move(*zone));
+ }
GRPC_ERROR_UNREF(error);
}
@@ -229,12 +231,18 @@ void GoogleCloud2ProdResolver::IPv6Query::OnDone(
//
GoogleCloud2ProdResolver::GoogleCloud2ProdResolver(ResolverArgs args)
- : work_serializer_(std::move(args.work_serializer)),
+ : resource_quota_(ResourceQuotaFromChannelArgs(args.args)),
+ work_serializer_(std::move(args.work_serializer)),
pollent_(grpc_polling_entity_create_from_pollset_set(args.pollset_set)) {
absl::string_view name_to_resolve = absl::StripPrefix(args.uri.path(), "/");
// If we're not running on GCP, we can't use DirectPath, so delegate
// to the DNS resolver.
- if (!grpc_alts_is_running_on_gcp() ||
+ bool test_only_pretend_running_on_gcp = grpc_channel_args_find_bool(
+ args.args, "grpc.testing.google_c2p_resolver_pretend_running_on_gcp",
+ false);
+ bool running_on_gcp =
+ test_only_pretend_running_on_gcp || grpc_alts_is_running_on_gcp();
+ if (!running_on_gcp ||
// If the client is already using xDS, we can't use it here, because
// they may be talking to a completely different xDS server than we
// want to.
@@ -242,14 +250,24 @@ GoogleCloud2ProdResolver::GoogleCloud2ProdResolver(ResolverArgs args)
UniquePtr<char>(gpr_getenv("GRPC_XDS_BOOTSTRAP")) != nullptr ||
UniquePtr<char>(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG")) != nullptr) {
using_dns_ = true;
- child_resolver_ = ResolverRegistry::CreateResolver(
- absl::StrCat("dns:", name_to_resolve).c_str(), args.args,
- args.pollset_set, work_serializer_, std::move(args.result_handler));
+ child_resolver_ =
+ CoreConfiguration::Get().resolver_registry().CreateResolver(
+ absl::StrCat("dns:", name_to_resolve).c_str(), args.args,
+ args.pollset_set, work_serializer_, std::move(args.result_handler));
GPR_ASSERT(child_resolver_ != nullptr);
return;
}
+ // Maybe override metadata server name for testing
+ const char* test_only_metadata_server_override =
+ grpc_channel_args_find_string(
+ args.args,
+ "grpc.testing.google_c2p_resolver_metadata_server_override");
+ if (test_only_metadata_server_override != nullptr &&
+ strlen(test_only_metadata_server_override) > 0) {
+ metadata_server_name_ = std::string(test_only_metadata_server_override);
+ }
// Create xds resolver.
- child_resolver_ = ResolverRegistry::CreateResolver(
+ child_resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver(
absl::StrCat("xds:", name_to_resolve).c_str(), args.args,
args.pollset_set, work_serializer_, std::move(args.result_handler));
GPR_ASSERT(child_resolver_ != nullptr);
@@ -278,6 +296,7 @@ void GoogleCloud2ProdResolver::ResetBackoffLocked() {
}
void GoogleCloud2ProdResolver::ShutdownLocked() {
+ shutdown_ = true;
zone_query_.reset();
ipv6_query_.reset();
child_resolver_.reset();
@@ -296,9 +315,15 @@ void GoogleCloud2ProdResolver::IPv6QueryDone(bool ipv6_supported) {
}
void GoogleCloud2ProdResolver::StartXdsResolver() {
+ if (shutdown_) {
+ return;
+ }
// Construct bootstrap JSON.
+ std::random_device rd;
+ std::mt19937 mt(rd());
+ std::uniform_int_distribution<uint64_t> dist(1, UINT64_MAX);
Json::Object node = {
- {"id", "C2P"},
+ {"id", absl::StrCat("C2P-", dist(mt))},
};
if (!zone_->empty()) {
node["locality"] = Json::Object{
@@ -316,7 +341,7 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
const char* server_uri =
override_server != nullptr && strlen(override_server.get()) > 0
? override_server.get()
- : "directpath-trafficdirector.googleapis.com";
+ : "directpath-pa.googleapis.com";
Json bootstrap = Json::Object{
{"xds_servers",
Json::Array{
@@ -345,6 +370,12 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
class GoogleCloud2ProdResolverFactory : public ResolverFactory {
public:
+ // TODO(roth): Remove experimental suffix once this code is proven stable,
+ // and update the scheme in google_c2p_resolver_test.cc when doing so.
+ absl::string_view scheme() const override {
+ return "google-c2p-experimental";
+ }
+
bool IsValidUri(const URI& uri) const override {
if (GPR_UNLIKELY(!uri.authority().empty())) {
gpr_log(GPR_ERROR, "google-c2p URI scheme does not support authorities");
@@ -357,23 +388,13 @@ class GoogleCloud2ProdResolverFactory : public ResolverFactory {
if (!IsValidUri(args.uri)) return nullptr;
return MakeOrphanable<GoogleCloud2ProdResolver>(std::move(args));
}
-
- const char* scheme() const override { return "google-c2p"; }
};
} // namespace
-void GoogleCloud2ProdResolverInit() {
- // TODO(roth): Remove env var protection once this code is proven stable.
- UniquePtr<char> value(gpr_getenv("GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER"));
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value.get(), &parsed_value);
- if (parse_succeeded && parsed_value) {
- ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<GoogleCloud2ProdResolverFactory>());
- }
+void RegisterCloud2ProdResolver(CoreConfiguration::Builder* builder) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<GoogleCloud2ProdResolverFactory>());
}
-void GoogleCloud2ProdResolverShutdown() {}
-
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.cc
new file mode 100644
index 00000000..d33f120e
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.cc
@@ -0,0 +1,201 @@
+//
+// 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/resolver/polling_resolver.h"
+
+#include "absl/strings/strip.h"
+
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+
+namespace grpc_core {
+
+PollingResolver::PollingResolver(ResolverArgs args,
+ const grpc_channel_args* channel_args,
+ Duration min_time_between_resolutions,
+ BackOff::Options backoff_options,
+ TraceFlag* tracer)
+ : authority_(args.uri.authority()),
+ name_to_resolve_(absl::StripPrefix(args.uri.path(), "/")),
+ channel_args_(grpc_channel_args_copy(channel_args)),
+ work_serializer_(std::move(args.work_serializer)),
+ result_handler_(std::move(args.result_handler)),
+ tracer_(tracer),
+ interested_parties_(args.pollset_set),
+ min_time_between_resolutions_(min_time_between_resolutions),
+ backoff_(backoff_options) {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO, "[polling resolver %p] created", this);
+ }
+}
+
+PollingResolver::~PollingResolver() {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO, "[polling resolver %p] destroying", this);
+ }
+ grpc_channel_args_destroy(channel_args_);
+}
+
+void PollingResolver::StartLocked() { MaybeStartResolvingLocked(); }
+
+void PollingResolver::RequestReresolutionLocked() {
+ if (request_ == nullptr) {
+ MaybeStartResolvingLocked();
+ }
+}
+
+void PollingResolver::ResetBackoffLocked() {
+ if (have_next_resolution_timer_) {
+ grpc_timer_cancel(&next_resolution_timer_);
+ }
+ backoff_.Reset();
+}
+
+void PollingResolver::ShutdownLocked() {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO, "[polling resolver %p] shutting down", this);
+ }
+ shutdown_ = true;
+ if (have_next_resolution_timer_) {
+ grpc_timer_cancel(&next_resolution_timer_);
+ }
+ request_.reset();
+}
+
+void PollingResolver::OnNextResolution(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<PollingResolver*>(arg);
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
+ self->work_serializer_->Run(
+ [self, error]() { self->OnNextResolutionLocked(error); }, DEBUG_LOCATION);
+}
+
+void PollingResolver::OnNextResolutionLocked(grpc_error_handle error) {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO,
+ "[polling resolver %p] re-resolution timer fired: error=\"%s\", "
+ "shutdown_=%d",
+ this, grpc_error_std_string(error).c_str(), shutdown_);
+ }
+ have_next_resolution_timer_ = false;
+ if (error == GRPC_ERROR_NONE && !shutdown_) {
+ StartResolvingLocked();
+ }
+ Unref(DEBUG_LOCATION, "retry-timer");
+ GRPC_ERROR_UNREF(error);
+}
+
+void PollingResolver::OnRequestComplete(Result result) {
+ Ref(DEBUG_LOCATION, "OnRequestComplete").release();
+ work_serializer_->Run(
+ [this, result]() mutable { OnRequestCompleteLocked(std::move(result)); },
+ DEBUG_LOCATION);
+}
+
+void PollingResolver::OnRequestCompleteLocked(Result result) {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO, "[polling resolver %p] request complete", this);
+ }
+ request_.reset();
+ if (!shutdown_) {
+ if (result.service_config.ok() && result.addresses.ok()) {
+ // Reset backoff state so that we start from the beginning when the
+ // next request gets triggered.
+ backoff_.Reset();
+ } else {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO,
+ "[polling resolver %p] resolution failed (will retry): "
+ "address status \"%s\"; service config status \"%s\"",
+ this, result.addresses.status().ToString().c_str(),
+ result.service_config.status().ToString().c_str());
+ }
+ // Set up for retry.
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
+ Timestamp next_try = backoff_.NextAttemptTime();
+ Duration timeout = next_try - ExecCtx::Get()->Now();
+ GPR_ASSERT(!have_next_resolution_timer_);
+ have_next_resolution_timer_ = true;
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ if (timeout > Duration::Zero()) {
+ gpr_log(GPR_INFO, "[polling resolver %p] retrying in %" PRId64 " ms",
+ this, timeout.millis());
+ } else {
+ gpr_log(GPR_INFO, "[polling resolver %p] retrying immediately", this);
+ }
+ }
+ Ref(DEBUG_LOCATION, "next_resolution_timer").release();
+ GRPC_CLOSURE_INIT(&on_next_resolution_, OnNextResolution, this, nullptr);
+ grpc_timer_init(&next_resolution_timer_, next_try, &on_next_resolution_);
+ }
+ result_handler_->ReportResult(std::move(result));
+ }
+ Unref(DEBUG_LOCATION, "OnRequestComplete");
+}
+
+void PollingResolver::MaybeStartResolvingLocked() {
+ // If there is an existing timer, the time it fires is the earliest time we
+ // can start the next resolution.
+ if (have_next_resolution_timer_) return;
+ if (last_resolution_timestamp_.has_value()) {
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
+ const Timestamp earliest_next_resolution =
+ *last_resolution_timestamp_ + min_time_between_resolutions_;
+ const Duration time_until_next_resolution =
+ earliest_next_resolution - ExecCtx::Get()->Now();
+ if (time_until_next_resolution > Duration::Zero()) {
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ const Duration last_resolution_ago =
+ ExecCtx::Get()->Now() - *last_resolution_timestamp_;
+ gpr_log(GPR_INFO,
+ "[polling resolver %p] in cooldown from last resolution "
+ "(from %" PRId64 " ms ago); will resolve again in %" PRId64
+ " ms",
+ this, last_resolution_ago.millis(),
+ time_until_next_resolution.millis());
+ }
+ have_next_resolution_timer_ = true;
+ Ref(DEBUG_LOCATION, "next_resolution_timer_cooldown").release();
+ GRPC_CLOSURE_INIT(&on_next_resolution_, OnNextResolution, this, nullptr);
+ grpc_timer_init(&next_resolution_timer_,
+ ExecCtx::Get()->Now() + time_until_next_resolution,
+ &on_next_resolution_);
+ return;
+ }
+ }
+ StartResolvingLocked();
+}
+
+void PollingResolver::StartResolvingLocked() {
+ request_ = StartRequest();
+ last_resolution_timestamp_ = ExecCtx::Get()->Now();
+ if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
+ gpr_log(GPR_INFO, "[polling resolver %p] starting resolution, request_=%p",
+ this, request_.get());
+ }
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.h b/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.h
new file mode 100644
index 00000000..d781124a
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/resolver/polling_resolver.h
@@ -0,0 +1,106 @@
+//
+// 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_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_POLLING_RESOLVER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_POLLING_RESOLVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "absl/types/optional.h"
+
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/resolver/resolver.h"
+#include "src/core/lib/resolver/resolver_factory.h"
+
+namespace grpc_core {
+
+// A base class for polling-based resolvers.
+// Handles cooldown and backoff timers.
+// Implementations need only to implement StartRequest().
+class PollingResolver : public Resolver {
+ public:
+ PollingResolver(ResolverArgs args, const grpc_channel_args* channel_args,
+ Duration min_time_between_resolutions,
+ BackOff::Options backoff_options, TraceFlag* tracer);
+ ~PollingResolver() override;
+
+ void StartLocked() override;
+ void RequestReresolutionLocked() override;
+ void ResetBackoffLocked() override;
+ void ShutdownLocked() override;
+
+ protected:
+ // Implemented by subclass.
+ // Starts a request, returning an object representing the pending
+ // request. Orphaning that object should cancel the request.
+ // When the request is complete, the implementation must call
+ // OnRequestComplete() with the result.
+ virtual OrphanablePtr<Orphanable> StartRequest() = 0;
+
+ // To be invoked by the subclass when a request is complete.
+ void OnRequestComplete(Result result);
+
+ // Convenient accessor methods for subclasses.
+ const std::string& authority() const { return authority_; }
+ const std::string& name_to_resolve() const { return name_to_resolve_; }
+ grpc_pollset_set* interested_parties() const { return interested_parties_; }
+ const grpc_channel_args* channel_args() const { return channel_args_; }
+
+ private:
+ void MaybeStartResolvingLocked();
+ void StartResolvingLocked();
+
+ void OnRequestCompleteLocked(Result result);
+
+ static void OnNextResolution(void* arg, grpc_error_handle error);
+ void OnNextResolutionLocked(grpc_error_handle error);
+
+ /// authority
+ std::string authority_;
+ /// name to resolve
+ std::string name_to_resolve_;
+ /// channel args
+ const grpc_channel_args* channel_args_ = nullptr;
+ std::shared_ptr<WorkSerializer> work_serializer_;
+ std::unique_ptr<ResultHandler> result_handler_;
+ TraceFlag* tracer_;
+ /// pollset_set to drive the name resolution process
+ grpc_pollset_set* interested_parties_ = nullptr;
+ /// are we shutting down?
+ bool shutdown_ = false;
+ /// are we currently resolving?
+ OrphanablePtr<Orphanable> request_;
+ /// next resolution timer
+ bool have_next_resolution_timer_ = false;
+ grpc_timer next_resolution_timer_;
+ grpc_closure on_next_resolution_;
+ /// min time between DNS requests
+ Duration min_time_between_resolutions_;
+ /// timestamp of last DNS request
+ absl::optional<Timestamp> last_resolution_timestamp_;
+ /// retry backoff state
+ BackOff backoff_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_POLLING_RESOLVER_H
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index 46efbb06..d893f2d5 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
@@ -1,20 +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 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
@@ -28,13 +26,14 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -73,7 +72,7 @@ void SockaddrResolver::StartLocked() {
// TODO(roth): Use std::move() once channel args is converted to C++.
result.args = channel_args_;
channel_args_ = nullptr;
- result_handler_->ReturnResult(std::move(result));
+ result_handler_->ReportResult(std::move(result));
}
//
@@ -91,9 +90,13 @@ bool ParseUri(const URI& uri,
// Construct addresses.
bool errors_found = false;
for (absl::string_view ith_path : absl::StrSplit(uri.path(), ',')) {
- URI ith_uri(uri.scheme(), "", std::string(ith_path), {}, "");
+ if (ith_path.empty()) {
+ // Skip targets which are empty.
+ continue;
+ }
+ auto ith_uri = URI::Create(uri.scheme(), "", std::string(ith_path), {}, "");
grpc_resolved_address addr;
- if (!parse(ith_uri, &addr)) {
+ if (!ith_uri.ok() || !parse(*ith_uri, &addr)) {
errors_found = true;
break;
}
@@ -123,7 +126,7 @@ class IPv4ResolverFactory : public ResolverFactory {
return CreateSockaddrResolver(std::move(args), grpc_parse_ipv4);
}
- const char* scheme() const override { return "ipv4"; }
+ absl::string_view scheme() const override { return "ipv4"; }
};
class IPv6ResolverFactory : public ResolverFactory {
@@ -136,7 +139,7 @@ class IPv6ResolverFactory : public ResolverFactory {
return CreateSockaddrResolver(std::move(args), grpc_parse_ipv6);
}
- const char* scheme() const override { return "ipv6"; }
+ absl::string_view scheme() const override { return "ipv6"; }
};
#ifdef GRPC_HAVE_UNIX_SOCKET
@@ -154,11 +157,13 @@ class UnixResolverFactory : public ResolverFactory {
return "localhost";
}
- const char* scheme() const override { return "unix"; }
+ absl::string_view scheme() const override { return "unix"; }
};
class UnixAbstractResolverFactory : public ResolverFactory {
public:
+ absl::string_view scheme() const override { return "unix-abstract"; }
+
bool IsValidUri(const URI& uri) const override {
return ParseUri(uri, grpc_parse_unix_abstract, nullptr);
}
@@ -170,26 +175,22 @@ class UnixAbstractResolverFactory : public ResolverFactory {
std::string GetDefaultAuthority(const URI& /*uri*/) const override {
return "localhost";
}
-
- const char* scheme() const override { return "unix-abstract"; }
};
#endif // GRPC_HAVE_UNIX_SOCKET
} // namespace
-} // namespace grpc_core
-
-void grpc_resolver_sockaddr_init() {
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::IPv4ResolverFactory>());
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::IPv6ResolverFactory>());
+void RegisterSockaddrResolver(CoreConfiguration::Builder* builder) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<IPv4ResolverFactory>());
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<IPv6ResolverFactory>());
#ifdef GRPC_HAVE_UNIX_SOCKET
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::UnixResolverFactory>());
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::UnixAbstractResolverFactory>());
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<UnixResolverFactory>());
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<UnixAbstractResolverFactory>());
#endif
}
-void grpc_resolver_sockaddr_shutdown() {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
index 3a10a423..5c3e0ef1 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
@@ -1,25 +1,25 @@
-/*
- *
- * 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.
- *
- */
+//
+// 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 "absl/random/random.h"
#include "absl/strings/match.h"
#include "absl/strings/str_join.h"
+#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "re2/re2.h"
#define XXH_INLINE_ALL
@@ -27,14 +27,19 @@
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/xds/xds_channel_args.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/ext/xds/xds_listener.h"
+#include "src/core/ext/xds/xds_route_config.h"
+#include "src/core/ext/xds/xds_routing.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/surface/lame_client.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/service_config/service_config_impl.h"
+#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/timeout_encoding.h"
namespace grpc_core {
@@ -45,6 +50,24 @@ const char* kXdsClusterAttribute = "xds_cluster_name";
namespace {
+std::string GetDefaultAuthorityInternal(const URI& uri) {
+ // Obtain the authority to use for the data plane connections, which is
+ // also used to select the right VirtualHost from the RouteConfiguration.
+ // We need to take the part of the URI path following the last
+ // "/" character or the entire path if the path contains no "/" character.
+ size_t pos = uri.path().find_last_of('/');
+ if (pos == uri.path().npos) return uri.path();
+ return uri.path().substr(pos + 1);
+}
+
+std::string GetDataPlaneAuthority(const grpc_channel_args& args,
+ const URI& uri) {
+ const char* authority =
+ grpc_channel_args_find_string(&args, GRPC_ARG_DEFAULT_AUTHORITY);
+ if (authority != nullptr) return authority;
+ return GetDefaultAuthorityInternal(uri);
+}
+
//
// XdsResolver
//
@@ -54,12 +77,16 @@ class XdsResolver : public Resolver {
explicit XdsResolver(ResolverArgs args)
: work_serializer_(std::move(args.work_serializer)),
result_handler_(std::move(args.result_handler)),
- server_name_(absl::StripPrefix(args.uri.path(), "/")),
args_(grpc_channel_args_copy(args.args)),
- interested_parties_(args.pollset_set) {
+ interested_parties_(args.pollset_set),
+ uri_(std::move(args.uri)),
+ data_plane_authority_(GetDataPlaneAuthority(*args.args, uri_)),
+ channel_id_(absl::Uniform<uint64_t>(absl::BitGen())) {
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());
+ gpr_log(
+ GPR_INFO,
+ "[xds_resolver %p] created for URI %s; data plane authority is %s",
+ this, uri_.ToString().c_str(), data_plane_authority_.c_str());
}
}
@@ -79,74 +106,145 @@ class XdsResolver : public Resolver {
}
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::LdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::RdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, grpc_error_handle error);
- explicit Notifier(RefCountedPtr<XdsResolver> resolver);
-
- private:
- enum Type { kLdsUpdate, kRdsUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error_handle error);
- void RunInWorkSerializer(grpc_error_handle error);
-
- RefCountedPtr<XdsResolver> resolver_;
- grpc_closure closure_;
- XdsApi::LdsUpdate update_;
- Type type_;
- };
-
- class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
+ class ListenerWatcher : public XdsListenerResourceType::WatcherInterface {
public:
explicit ListenerWatcher(RefCountedPtr<XdsResolver> resolver)
: resolver_(std::move(resolver)) {}
- void OnListenerChanged(XdsApi::LdsUpdate listener) override {
- new Notifier(resolver_, std::move(listener));
+ void OnResourceChanged(XdsListenerResource listener) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ // TODO(yashykt): When we move to C++14, capture listener with
+ // std::move
+ [this, listener]() mutable {
+ resolver_->OnListenerUpdate(std::move(listener));
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error_handle error) override {
- new Notifier(resolver_, error);
+ void OnError(absl::Status status) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this, status]() {
+ resolver_->OnError(status);
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this]() {
+ resolver_->OnResourceDoesNotExist();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
private:
RefCountedPtr<XdsResolver> resolver_;
};
- class RouteConfigWatcher : public XdsClient::RouteConfigWatcherInterface {
+ class RouteConfigWatcher
+ : public XdsRouteConfigResourceType::WatcherInterface {
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 OnResourceChanged(XdsRouteConfigResource route_config) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ // TODO(yashykt): When we move to C++14, capture route_config with
+ // std::move
+ [this, route_config]() mutable {
+ resolver_->OnRouteConfigUpdate(std::move(route_config));
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnError(absl::Status status) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this, status]() {
+ resolver_->OnError(status);
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error_handle error) override {
- new Notifier(resolver_, error);
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this]() {
+ resolver_->OnResourceDoesNotExist();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
private:
RefCountedPtr<XdsResolver> resolver_;
};
- class ClusterState
- : public RefCounted<ClusterState, PolymorphicRefCount, kUnrefNoDelete> {
+ // An entry in the map of clusters that need to be present in the LB
+ // policy config. The map holds a weak ref. One strong ref is held by
+ // the ConfigSelector, and another is held by each call assigned to
+ // the cluster by the ConfigSelector. The ref for each call is held
+ // until the call is committed. When the strong refs go away, we hop
+ // back into the WorkSerializer to remove the entry from the map.
+ class ClusterState : public DualRefCounted<ClusterState> {
public:
using ClusterStateMap =
- std::map<std::string, std::unique_ptr<ClusterState>>;
+ std::map<std::string, WeakRefCountedPtr<ClusterState>>;
- ClusterState(const std::string& cluster_name,
- ClusterStateMap* cluster_state_map)
- : it_(cluster_state_map
- ->emplace(cluster_name, std::unique_ptr<ClusterState>(this))
+ ClusterState(RefCountedPtr<XdsResolver> resolver,
+ const std::string& cluster_name)
+ : resolver_(std::move(resolver)),
+ it_(resolver_->cluster_state_map_.emplace(cluster_name, WeakRef())
.first) {}
+
+ void Orphan() override {
+ auto* resolver = resolver_.release();
+ resolver->work_serializer_->Run(
+ [resolver]() {
+ resolver->MaybeRemoveUnusedClusters();
+ resolver->Unref();
+ },
+ DEBUG_LOCATION);
+ }
+
const std::string& cluster() const { return it_->first; }
private:
+ RefCountedPtr<XdsResolver> resolver_;
ClusterStateMap::iterator it_;
};
+ // Call dispatch controller, created for each call handled by the
+ // ConfigSelector. Holds a ref to the ClusterState object until the
+ // call is committed.
+ class XdsCallDispatchController
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit XdsCallDispatchController(
+ RefCountedPtr<ClusterState> cluster_state)
+ : cluster_state_(std::move(cluster_state)) {}
+
+ bool ShouldRetry() override {
+ // TODO(donnadionne): Implement the retry circuit breaker here.
+ return true;
+ }
+
+ void Commit() override {
+ // TODO(donnadionne): If ShouldRetry() was called previously,
+ // decrement the retry circuit breaker counter.
+ cluster_state_.reset();
+ }
+
+ private:
+ // Note: The XdsCallDispatchController object is never actually destroyed,
+ // so do not add any data members that require destruction unless you have
+ // some other way to clean them up.
+ RefCountedPtr<ClusterState> cluster_state_;
+ };
+
class XdsConfigSelector : public ConfigSelector {
public:
XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
@@ -180,7 +278,7 @@ class XdsResolver : public Resolver {
bool operator==(const ClusterWeightState& other) const;
};
- XdsApi::Route route;
+ XdsRouteConfigResource::Route route;
RefCountedPtr<ServiceConfig> method_config;
absl::InlinedVector<ClusterWeightState, 2> weighted_cluster_state;
@@ -188,116 +286,58 @@ class XdsResolver : public Resolver {
};
using RouteTable = std::vector<Route>;
+ class RouteListIterator;
+
void MaybeAddCluster(const std::string& name);
grpc_error_handle CreateMethodConfig(
- const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight,
+ const XdsRouteConfigResource::Route& route,
+ const XdsRouteConfigResource::Route::RouteAction::ClusterWeight*
+ cluster_weight,
RefCountedPtr<ServiceConfig>* method_config);
RefCountedPtr<XdsResolver> resolver_;
RouteTable route_table_;
std::map<absl::string_view, RefCountedPtr<ClusterState>> clusters_;
std::vector<const grpc_channel_filter*> filters_;
- grpc_error_handle filter_error_ = GRPC_ERROR_NONE;
};
- void OnListenerUpdate(XdsApi::LdsUpdate listener);
- void OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update);
- void OnError(grpc_error_handle error);
+ void OnListenerUpdate(XdsListenerResource listener);
+ void OnRouteConfigUpdate(XdsRouteConfigResource rds_update);
+ void OnError(absl::Status status);
void OnResourceDoesNotExist();
- grpc_error_handle CreateServiceConfig(
- RefCountedPtr<ServiceConfig>* service_config);
+ absl::StatusOr<RefCountedPtr<ServiceConfig>> CreateServiceConfig();
void GenerateResult();
void MaybeRemoveUnusedClusters();
+ uint64_t channel_id() const { return channel_id_; }
std::shared_ptr<WorkSerializer> work_serializer_;
std::unique_ptr<ResultHandler> result_handler_;
- std::string server_name_;
const grpc_channel_args* args_;
grpc_pollset_set* interested_parties_;
-
+ URI uri_;
RefCountedPtr<XdsClient> xds_client_;
+ std::string lds_resource_name_;
+ std::string data_plane_authority_;
+ uint64_t channel_id_;
- XdsClient::ListenerWatcherInterface* listener_watcher_ = nullptr;
+ ListenerWatcher* listener_watcher_ = nullptr;
// This will not contain the RouteConfiguration, even if it comes with the
// LDS response; instead, the relevant VirtualHost from the
// RouteConfiguration will be saved in current_virtual_host_.
- XdsApi::LdsUpdate current_listener_;
+ XdsListenerResource current_listener_;
std::string route_config_name_;
- XdsClient::RouteConfigWatcherInterface* route_config_watcher_ = nullptr;
- XdsApi::RdsUpdate::VirtualHost current_virtual_host_;
+ RouteConfigWatcher* route_config_watcher_ = nullptr;
+ XdsRouteConfigResource::VirtualHost current_virtual_host_;
+ std::map<std::string /*cluster_specifier_plugin_name*/,
+ std::string /*LB policy config*/>
+ cluster_specifier_plugin_map_;
ClusterState::ClusterStateMap cluster_state_map_;
};
//
-// 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_.http_connection_manager.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_handle 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_handle 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_handle 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_.http_connection_manager.rds_update));
- break;
- case kError:
- resolver_->OnError(error);
- break;
- case kDoesNotExist:
- resolver_->OnResourceDoesNotExist();
- break;
- };
- delete this;
-}
-
-//
// XdsResolver::XdsConfigSelector::Route
//
@@ -320,6 +360,25 @@ bool XdsResolver::XdsConfigSelector::Route::operator==(
MethodConfigsEqual(method_config.get(), other.method_config.get());
}
+// Implementation of XdsRouting::RouteListIterator for getting the matching
+// route for a request.
+class XdsResolver::XdsConfigSelector::RouteListIterator
+ : public XdsRouting::RouteListIterator {
+ public:
+ explicit RouteListIterator(const RouteTable* route_table)
+ : route_table_(route_table) {}
+
+ size_t Size() const override { return route_table_->size(); }
+
+ const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
+ size_t index) const override {
+ return (*route_table_)[index].route.matchers;
+ }
+
+ private:
+ const RouteTable* route_table_;
+};
+
//
// XdsResolver::XdsConfigSelector
//
@@ -349,44 +408,61 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
route_table_.emplace_back();
auto& route_entry = route_table_.back();
route_entry.route = route;
- // If the route doesn't specify a timeout, set its timeout to the global
- // one.
- if (!route.max_stream_duration.has_value()) {
- route_entry.route.max_stream_duration =
- resolver_->current_listener_.http_connection_manager
- .http_max_stream_duration;
- }
- if (route.weighted_clusters.empty()) {
- *error = CreateMethodConfig(route_entry.route, nullptr,
- &route_entry.method_config);
- MaybeAddCluster(route.cluster_name);
- } else {
- uint32_t end = 0;
- for (const auto& weighted_cluster : route_entry.route.weighted_clusters) {
- Route::ClusterWeightState cluster_weight_state;
- *error = CreateMethodConfig(route_entry.route, &weighted_cluster,
- &cluster_weight_state.method_config);
- if (*error != GRPC_ERROR_NONE) return;
- end += weighted_cluster.weight;
- cluster_weight_state.range_end = end;
- cluster_weight_state.cluster = weighted_cluster.name;
- route_entry.weighted_cluster_state.push_back(
- std::move(cluster_weight_state));
- MaybeAddCluster(weighted_cluster.name);
+ auto* route_action =
+ absl::get_if<XdsRouteConfigResource::Route::RouteAction>(
+ &route_entry.route.action);
+ if (route_action != nullptr) {
+ // If the route doesn't specify a timeout, set its timeout to the global
+ // one.
+ if (!route_action->max_stream_duration.has_value()) {
+ route_action->max_stream_duration =
+ resolver_->current_listener_.http_connection_manager
+ .http_max_stream_duration;
+ }
+ if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::kClusterIndex) {
+ *error = CreateMethodConfig(route_entry.route, nullptr,
+ &route_entry.method_config);
+ MaybeAddCluster(absl::StrCat(
+ "cluster:",
+ absl::get<
+ XdsRouteConfigResource::Route::RouteAction::kClusterIndex>(
+ route_action->action)));
+ } else if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::
+ kWeightedClustersIndex) {
+ auto& action_weighted_clusters = absl::get<
+ XdsRouteConfigResource::Route::RouteAction::kWeightedClustersIndex>(
+ route_action->action);
+ uint32_t end = 0;
+ for (const auto& weighted_cluster : action_weighted_clusters) {
+ Route::ClusterWeightState cluster_weight_state;
+ *error = CreateMethodConfig(route_entry.route, &weighted_cluster,
+ &cluster_weight_state.method_config);
+ if (*error != GRPC_ERROR_NONE) return;
+ end += weighted_cluster.weight;
+ cluster_weight_state.range_end = end;
+ cluster_weight_state.cluster = weighted_cluster.name;
+ route_entry.weighted_cluster_state.push_back(
+ std::move(cluster_weight_state));
+ MaybeAddCluster(absl::StrCat("cluster:", weighted_cluster.name));
+ }
+ } else if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex) {
+ // cluster_specifier_plugin case:
+ *error = CreateMethodConfig(route_entry.route, nullptr,
+ &route_entry.method_config);
+ MaybeAddCluster(absl::StrCat(
+ "cluster_specifier_plugin:",
+ absl::get<XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex>(route_action->action)));
}
}
}
// Populate filter list.
- bool found_router = false;
for (const auto& http_filter :
resolver_->current_listener_.http_connection_manager.http_filters) {
- // Stop at the router filter. It's a no-op for us, and we ignore
- // anything that may come after it, for compatibility with Envoy.
- if (http_filter.config.config_proto_type_name ==
- kXdsHttpRouterFilterConfigName) {
- found_router = true;
- break;
- }
// Find filter. This is guaranteed to succeed, because it's checked
// at config validation time in the XdsApi code.
const XdsHttpFilterImpl* filter_impl =
@@ -394,16 +470,9 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
http_filter.config.config_proto_type_name);
GPR_ASSERT(filter_impl != nullptr);
// Add C-core filter to list.
- filters_.push_back(filter_impl->channel_filter());
- }
- // For compatibility with Envoy, if the router filter is not
- // configured, we fail all RPCs.
- if (!found_router) {
- filter_error_ =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "no xDS HTTP router filter configured"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- filters_.push_back(&grpc_lame_filter);
+ if (filter_impl->channel_filter() != nullptr) {
+ filters_.push_back(filter_impl->channel_filter());
+ }
}
}
@@ -414,80 +483,73 @@ XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
}
clusters_.clear();
resolver_->MaybeRemoveUnusedClusters();
- GRPC_ERROR_UNREF(filter_error_);
-}
-
-const XdsHttpFilterImpl::FilterConfig* FindFilterConfigOverride(
- const std::string& instance_name,
- const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight) {
- // Check ClusterWeight, if any.
- if (cluster_weight != nullptr) {
- auto it = cluster_weight->typed_per_filter_config.find(instance_name);
- if (it != cluster_weight->typed_per_filter_config.end()) return &it->second;
- }
- // Check Route.
- auto it = route.typed_per_filter_config.find(instance_name);
- if (it != route.typed_per_filter_config.end()) return &it->second;
- // Check VirtualHost.
- it = vhost.typed_per_filter_config.find(instance_name);
- if (it != vhost.typed_per_filter_config.end()) return &it->second;
- // Not found.
- return nullptr;
}
grpc_error_handle XdsResolver::XdsConfigSelector::CreateMethodConfig(
- const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight,
+ const XdsRouteConfigResource::Route& route,
+ const XdsRouteConfigResource::Route::RouteAction::ClusterWeight*
+ cluster_weight,
RefCountedPtr<ServiceConfig>* method_config) {
std::vector<std::string> fields;
+ const auto& route_action =
+ absl::get<XdsRouteConfigResource::Route::RouteAction>(route.action);
+ // Set retry policy if any.
+ if (route_action.retry_policy.has_value() &&
+ !route_action.retry_policy->retry_on.Empty()) {
+ std::vector<std::string> retry_parts;
+ const auto base_interval =
+ route_action.retry_policy->retry_back_off.base_interval.as_timespec();
+ const auto max_interval =
+ route_action.retry_policy->retry_back_off.max_interval.as_timespec();
+ retry_parts.push_back(absl::StrFormat(
+ "\"retryPolicy\": {\n"
+ " \"maxAttempts\": %d,\n"
+ " \"initialBackoff\": \"%d.%09ds\",\n"
+ " \"maxBackoff\": \"%d.%09ds\",\n"
+ " \"backoffMultiplier\": 2,\n",
+ route_action.retry_policy->num_retries + 1, base_interval.tv_sec,
+ base_interval.tv_nsec, max_interval.tv_sec, max_interval.tv_nsec));
+ std::vector<std::string> code_parts;
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_CANCELLED)) {
+ code_parts.push_back(" \"CANCELLED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(
+ GRPC_STATUS_DEADLINE_EXCEEDED)) {
+ code_parts.push_back(" \"DEADLINE_EXCEEDED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_INTERNAL)) {
+ code_parts.push_back(" \"INTERNAL\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(
+ GRPC_STATUS_RESOURCE_EXHAUSTED)) {
+ code_parts.push_back(" \"RESOURCE_EXHAUSTED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_UNAVAILABLE)) {
+ code_parts.push_back(" \"UNAVAILABLE\"");
+ }
+ retry_parts.push_back(
+ absl::StrFormat(" \"retryableStatusCodes\": [\n %s ]\n",
+ absl::StrJoin(code_parts, ",\n")));
+ retry_parts.push_back(absl::StrFormat(" }"));
+ fields.emplace_back(absl::StrJoin(retry_parts, ""));
+ }
// Set timeout.
- if (route.max_stream_duration.has_value() &&
- (route.max_stream_duration->seconds != 0 ||
- route.max_stream_duration->nanos != 0)) {
+ if (route_action.max_stream_duration.has_value() &&
+ (route_action.max_stream_duration != Duration::Zero())) {
+ gpr_timespec ts = route_action.max_stream_duration->as_timespec();
fields.emplace_back(absl::StrFormat(" \"timeout\": \"%d.%09ds\"",
- route.max_stream_duration->seconds,
- route.max_stream_duration->nanos));
+ ts.tv_sec, ts.tv_nsec));
}
// Handle xDS HTTP filters.
- std::map<std::string, std::vector<std::string>> per_filter_configs;
- grpc_channel_args* args = grpc_channel_args_copy(resolver_->args_);
- for (const auto& http_filter :
- resolver_->current_listener_.http_connection_manager.http_filters) {
- // Stop at the router filter. It's a no-op for us, and we ignore
- // anything that may come after it, for compatibility with Envoy.
- if (http_filter.config.config_proto_type_name ==
- kXdsHttpRouterFilterConfigName) {
- break;
- }
- // Find filter. This is guaranteed to succeed, because it's checked
- // at config validation time in the XdsApi code.
- const XdsHttpFilterImpl* filter_impl =
- XdsHttpFilterRegistry::GetFilterForType(
- http_filter.config.config_proto_type_name);
- GPR_ASSERT(filter_impl != nullptr);
- // Allow filter to add channel args that may affect service config
- // parsing.
- args = filter_impl->ModifyChannelArgs(args);
- // Find config override, if any.
- const XdsHttpFilterImpl::FilterConfig* config_override =
- FindFilterConfigOverride(http_filter.name,
- resolver_->current_virtual_host_, route,
- cluster_weight);
- // Generate service config for filter.
- auto method_config_field =
- filter_impl->GenerateServiceConfig(http_filter.config, config_override);
- if (!method_config_field.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("failed to generate method config for HTTP filter ",
- http_filter.name, ": ",
- method_config_field.status().ToString())
- .c_str());
- }
- per_filter_configs[method_config_field->service_config_field_name]
- .push_back(method_config_field->element);
- }
- for (const auto& p : per_filter_configs) {
+ XdsRouting::GeneratePerHttpFilterConfigsResult result =
+ XdsRouting::GeneratePerHTTPFilterConfigs(
+ resolver_->current_listener_.http_connection_manager.http_filters,
+ resolver_->current_virtual_host_, route, cluster_weight,
+ grpc_channel_args_copy(resolver_->args_));
+ if (result.error != GRPC_ERROR_NONE) {
+ return result.error;
+ }
+ for (const auto& p : result.per_filter_configs) {
fields.emplace_back(absl::StrCat(" \"", p.first, "\": [\n",
absl::StrJoin(p.second, ",\n"),
"\n ]"));
@@ -505,28 +567,23 @@ grpc_error_handle XdsResolver::XdsConfigSelector::CreateMethodConfig(
absl::StrJoin(fields, ",\n"),
"\n } ]\n"
"}");
- *method_config = ServiceConfig::Create(args, json.c_str(), &error);
+ *method_config =
+ ServiceConfigImpl::Create(result.args, json.c_str(), &error);
}
- grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(result.args);
return error;
}
grpc_channel_args* XdsResolver::XdsConfigSelector::ModifyChannelArgs(
grpc_channel_args* args) {
- if (filter_error_ == GRPC_ERROR_NONE) return args;
- grpc_arg error_arg = MakeLameClientErrorArg(filter_error_);
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_add(args, &error_arg, 1);
- grpc_channel_args_destroy(args);
- return new_args;
+ return args;
}
void XdsResolver::XdsConfigSelector::MaybeAddCluster(const std::string& 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_);
+ auto new_cluster_state = MakeRefCounted<ClusterState>(resolver_, name);
clusters_[new_cluster_state->cluster()] = std::move(new_cluster_state);
} else {
clusters_[it->second->cluster()] = it->second->Ref();
@@ -534,40 +591,17 @@ void XdsResolver::XdsConfigSelector::MaybeAddCluster(const std::string& name) {
}
}
-absl::optional<absl::string_view> GetHeaderValue(
- grpc_metadata_batch* initial_metadata, absl::string_view header_name,
- std::string* concatenated_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 (absl::EndsWith(header_name, "-bin")) {
- return absl::nullopt;
- } else if (header_name == "content-type") {
- return "application/grpc";
- }
- return grpc_metadata_batch_get_value(initial_metadata, header_name,
- concatenated_value);
-}
-
-bool HeadersMatch(const std::vector<HeaderMatcher>& header_matchers,
- grpc_metadata_batch* initial_metadata) {
- for (const auto& header_matcher : header_matchers) {
- std::string concatenated_value;
- if (!header_matcher.Match(GetHeaderValue(
- initial_metadata, header_matcher.name(), &concatenated_value))) {
- return false;
- }
- }
- return true;
-}
-
absl::optional<uint64_t> HeaderHashHelper(
- const XdsApi::Route::HashPolicy& policy,
+ const XdsRouteConfigResource::Route::RouteAction::HashPolicy& policy,
grpc_metadata_batch* initial_metadata) {
- GPR_ASSERT(policy.type == XdsApi::Route::HashPolicy::HEADER);
+ GPR_ASSERT(policy.type ==
+ XdsRouteConfigResource::Route::RouteAction::HashPolicy::HEADER);
std::string value_buffer;
- absl::optional<absl::string_view> header_value =
- GetHeaderValue(initial_metadata, policy.header_name, &value_buffer);
+ absl::optional<absl::string_view> header_value = XdsRouting::GetHeaderValue(
+ initial_metadata, policy.header_name, &value_buffer);
+ if (!header_value.has_value()) {
+ return absl::nullopt;
+ }
if (policy.regex != nullptr) {
// If GetHeaderValue() did not already store the value in
// value_buffer, copy it there now, so we can modify it.
@@ -580,136 +614,121 @@ absl::optional<uint64_t> HeaderHashHelper(
return XXH64(header_value->data(), header_value->size(), 0);
}
-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 (!entry.route.matchers.path_matcher.Match(
- StringViewFromSlice(*args.path))) {
- 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
- absl::string_view cluster_name;
- RefCountedPtr<ServiceConfig> method_config;
- if (entry.route.weighted_clusters.empty()) {
- cluster_name = entry.route.cluster_name;
- method_config = entry.method_config;
- } else {
- const uint32_t key =
- rand() %
- entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
- .range_end;
- // 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].range_end > key) {
- end_index = mid;
- } else if (entry.weighted_cluster_state[mid].range_end < key) {
- start_index = mid + 1;
- } else {
- index = mid + 1;
- break;
- }
- }
- if (index == 0) index = start_index;
- GPR_ASSERT(entry.weighted_cluster_state[index].range_end > key);
- cluster_name = entry.weighted_cluster_state[index].cluster;
- method_config = entry.weighted_cluster_state[index].method_config;
- }
- 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();
- // Generate a hash
- absl::optional<uint64_t> hash;
- for (const auto& hash_policy : entry.route.hash_policies) {
- absl::optional<uint64_t> new_hash;
- switch (hash_policy.type) {
- case XdsApi::Route::HashPolicy::HEADER:
- new_hash = HeaderHashHelper(hash_policy, args.initial_metadata);
- break;
- case XdsApi::Route::HashPolicy::CHANNEL_ID:
- new_hash =
- static_cast<uint64_t>(reinterpret_cast<uintptr_t>(resolver));
- break;
- default:
- GPR_ASSERT(0);
- }
- if (new_hash.has_value()) {
- // Rotating the old value prevents duplicate hash rules from cancelling
- // each other out and preserves all of the entropy
- const uint64_t old_value =
- hash.has_value() ? ((hash.value() << 1) | (hash.value() >> 63)) : 0;
- hash = old_value ^ new_hash.value();
- }
- // If the policy is a terminal policy and a hash has been generated,
- // ignore the rest of the hash policies.
- if (hash_policy.terminal && hash.has_value()) {
+ auto route_index = XdsRouting::GetRouteForRequest(
+ RouteListIterator(&route_table_), StringViewFromSlice(*args.path),
+ args.initial_metadata);
+ if (!route_index.has_value()) {
+ return CallConfig();
+ }
+ auto& entry = route_table_[*route_index];
+ // Found a route match
+ const auto* route_action =
+ absl::get_if<XdsRouteConfigResource::Route::RouteAction>(
+ &entry.route.action);
+ if (route_action == nullptr) {
+ CallConfig call_config;
+ call_config.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Matching route has inappropriate action"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+ }
+ std::string cluster_name;
+ RefCountedPtr<ServiceConfig> method_config;
+ if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::kClusterIndex) {
+ cluster_name = absl::StrCat(
+ "cluster:",
+ absl::get<XdsRouteConfigResource::Route::RouteAction::kClusterIndex>(
+ route_action->action));
+ method_config = entry.method_config;
+ } else if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::
+ kWeightedClustersIndex) {
+ const uint32_t key =
+ rand() %
+ entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
+ .range_end;
+ // 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].range_end > key) {
+ end_index = mid;
+ } else if (entry.weighted_cluster_state[mid].range_end < key) {
+ start_index = mid + 1;
+ } else {
+ index = mid + 1;
break;
}
}
- if (!hash.has_value()) {
- // If there is no hash, we just choose a random value as a default.
- hash = rand();
+ if (index == 0) index = start_index;
+ GPR_ASSERT(entry.weighted_cluster_state[index].range_end > key);
+ cluster_name =
+ absl::StrCat("cluster:", entry.weighted_cluster_state[index].cluster);
+ method_config = entry.weighted_cluster_state[index].method_config;
+ } else if (route_action->action.index() ==
+ XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex) {
+ cluster_name = absl::StrCat(
+ "cluster_specifier_plugin:",
+ absl::get<XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex>(route_action->action));
+ method_config = entry.method_config;
+ }
+ auto it = clusters_.find(cluster_name);
+ GPR_ASSERT(it != clusters_.end());
+ // Generate a hash.
+ absl::optional<uint64_t> hash;
+ for (const auto& hash_policy : route_action->hash_policies) {
+ absl::optional<uint64_t> new_hash;
+ switch (hash_policy.type) {
+ case XdsRouteConfigResource::Route::RouteAction::HashPolicy::HEADER:
+ new_hash = HeaderHashHelper(hash_policy, args.initial_metadata);
+ break;
+ case XdsRouteConfigResource::Route::RouteAction::HashPolicy::CHANNEL_ID:
+ new_hash = resolver_->channel_id();
+ break;
+ default:
+ GPR_ASSERT(0);
}
- CallConfig call_config;
- if (method_config != nullptr) {
- call_config.method_configs =
- method_config->GetMethodParsedConfigVector(grpc_empty_slice());
- call_config.service_config = std::move(method_config);
- }
- call_config.call_attributes[kXdsClusterAttribute] = it->first;
- call_config.call_attributes[kRequestRingHashAttribute] =
- absl::StrFormat("%" PRIu64, hash.value());
- 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_handle /*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;
+ if (new_hash.has_value()) {
+ // Rotating the old value prevents duplicate hash rules from cancelling
+ // each other out and preserves all of the entropy
+ const uint64_t old_value =
+ hash.has_value() ? ((hash.value() << 1) | (hash.value() >> 63)) : 0;
+ hash = old_value ^ new_hash.value();
+ }
+ // If the policy is a terminal policy and a hash has been generated,
+ // ignore the rest of the hash policies.
+ if (hash_policy.terminal && hash.has_value()) {
+ break;
+ }
+ }
+ if (!hash.has_value()) {
+ hash = absl::Uniform<uint64_t>(absl::BitGen());
+ }
+ CallConfig call_config;
+ if (method_config != nullptr) {
+ call_config.method_configs =
+ method_config->GetMethodParsedConfigVector(grpc_empty_slice());
+ call_config.service_config = std::move(method_config);
}
- return CallConfig();
+ call_config.call_attributes[kXdsClusterAttribute] = it->first;
+ std::string hash_string = absl::StrCat(hash.value());
+ char* hash_value =
+ static_cast<char*>(args.arena->Alloc(hash_string.size() + 1));
+ memcpy(hash_value, hash_string.c_str(), hash_string.size());
+ hash_value[hash_string.size()] = '\0';
+ call_config.call_attributes[kRequestRingHashAttribute] = hash_value;
+ call_config.call_dispatch_controller =
+ args.arena->New<XdsCallDispatchController>(it->second->Ref());
+ return call_config;
}
//
@@ -724,20 +743,64 @@ void XdsResolver::StartLocked() {
"Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: %s",
grpc_error_std_string(error).c_str());
- result_handler_->ReturnError(error);
+ std::string error_message;
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &error_message);
+ Result result;
+ result.service_config = absl::UnavailableError(
+ absl::StrCat("Failed to create XdsClient: ", error_message));
+ result.args = grpc_channel_args_copy(args_);
+ result_handler_->ReportResult(std::move(result));
+ GRPC_ERROR_UNREF(error);
return;
}
+ std::string resource_name_fragment(absl::StripPrefix(uri_.path(), "/"));
+ if (!uri_.authority().empty()) {
+ // target_uri.authority is set case
+ const auto* authority_config =
+ xds_client_->bootstrap().LookupAuthority(uri_.authority());
+ if (authority_config == nullptr) {
+ Result result;
+ result.service_config = absl::UnavailableError(
+ absl::StrCat("Invalid target URI -- authority not found for %s.",
+ uri_.authority().c_str()));
+ result.args = grpc_channel_args_copy(args_);
+ result_handler_->ReportResult(std::move(result));
+ return;
+ }
+ std::string name_template =
+ authority_config->client_listener_resource_name_template;
+ if (name_template.empty()) {
+ name_template = absl::StrCat(
+ "xdstp://", URI::PercentEncodeAuthority(uri_.authority()),
+ "/envoy.config.listener.v3.Listener/%s");
+ }
+ lds_resource_name_ = absl::StrReplaceAll(
+ name_template,
+ {{"%s", URI::PercentEncodePath(resource_name_fragment)}});
+ } else {
+ // target_uri.authority not set
+ absl::string_view name_template =
+ xds_client_->bootstrap()
+ .client_default_listener_resource_name_template();
+ if (name_template.empty()) {
+ name_template = "%s";
+ }
+ if (absl::StartsWith(name_template, "xdstp:")) {
+ resource_name_fragment = URI::PercentEncodePath(resource_name_fragment);
+ }
+ lds_resource_name_ =
+ absl::StrReplaceAll(name_template, {{"%s", resource_name_fragment}});
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
+ gpr_log(GPR_INFO, "[xds_resolver %p] Started with lds_resource_name %s.",
+ this, lds_resource_name_.c_str());
+ }
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 = absl::make_unique<ListenerWatcher>(Ref());
+ auto watcher = MakeRefCounted<ListenerWatcher>(Ref());
listener_watcher_ = watcher.get();
- xds_client_->WatchListenerData(server_name_, std::move(watcher));
+ XdsListenerResourceType::StartWatch(xds_client_.get(), lds_resource_name_,
+ std::move(watcher));
}
void XdsResolver::ShutdownLocked() {
@@ -746,18 +809,14 @@ void XdsResolver::ShutdownLocked() {
}
if (xds_client_ != nullptr) {
if (listener_watcher_ != nullptr) {
- xds_client_->CancelListenerDataWatch(server_name_, listener_watcher_,
- /*delay_unsubscription=*/false);
+ XdsListenerResourceType::CancelWatch(
+ xds_client_.get(), lds_resource_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);
+ XdsRouteConfigResourceType::CancelWatch(
+ xds_client_.get(), route_config_name_, route_config_watcher_,
+ /*delay_unsubscription=*/false);
}
grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
interested_parties_);
@@ -765,15 +824,18 @@ void XdsResolver::ShutdownLocked() {
}
}
-void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
+void XdsResolver::OnListenerUpdate(XdsListenerResource listener) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] received updated listener data", this);
}
+ if (xds_client_ == nullptr) {
+ return;
+ }
if (listener.http_connection_manager.route_config_name !=
route_config_name_) {
if (route_config_watcher_ != nullptr) {
- xds_client_->CancelRouteConfigDataWatch(
- route_config_name_, route_config_watcher_,
+ XdsRouteConfigResourceType::CancelWatch(
+ xds_client_.get(), route_config_name_, route_config_watcher_,
/*delay_unsubscription=*/
!listener.http_connection_manager.route_config_name.empty());
route_config_watcher_ = nullptr;
@@ -782,9 +844,10 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
std::move(listener.http_connection_manager.route_config_name);
if (!route_config_name_.empty()) {
current_virtual_host_.routes.clear();
- auto watcher = absl::make_unique<RouteConfigWatcher>(Ref());
+ auto watcher = MakeRefCounted<RouteConfigWatcher>(Ref());
route_config_watcher_ = watcher.get();
- xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
+ XdsRouteConfigResourceType::StartWatch(
+ xds_client_.get(), route_config_name_, std::move(watcher));
}
}
current_listener_ = std::move(listener);
@@ -800,34 +863,60 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
}
}
-void XdsResolver::OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update) {
+namespace {
+class VirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
+ public:
+ explicit VirtualHostListIterator(
+ const std::vector<XdsRouteConfigResource::VirtualHost>* virtual_hosts)
+ : virtual_hosts_(virtual_hosts) {}
+
+ size_t Size() const override { return virtual_hosts_->size(); }
+
+ const std::vector<std::string>& GetDomainsForVirtualHost(
+ size_t index) const override {
+ return (*virtual_hosts_)[index].domains;
+ }
+
+ private:
+ const std::vector<XdsRouteConfigResource::VirtualHost>* virtual_hosts_;
+};
+} // namespace
+
+void XdsResolver::OnRouteConfigUpdate(XdsRouteConfigResource rds_update) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] received updated route config", this);
}
+ if (xds_client_ == nullptr) {
+ return;
+ }
// 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(
- absl::StrCat("could not find VirtualHost for ", server_name_,
- " in RouteConfiguration")
- .c_str()));
+ auto vhost_index = XdsRouting::FindVirtualHostForDomain(
+ VirtualHostListIterator(&rds_update.virtual_hosts),
+ data_plane_authority_);
+ if (!vhost_index.has_value()) {
+ OnError(absl::UnavailableError(
+ absl::StrCat("could not find VirtualHost for ", data_plane_authority_,
+ " in RouteConfiguration")));
return;
}
// Save the virtual host in the resolver.
- current_virtual_host_ = std::move(*vhost);
+ current_virtual_host_ = std::move(rds_update.virtual_hosts[*vhost_index]);
+ cluster_specifier_plugin_map_ =
+ std::move(rds_update.cluster_specifier_plugin_map);
// Send a new result to the channel.
GenerateResult();
}
-void XdsResolver::OnError(grpc_error_handle error) {
+void XdsResolver::OnError(absl::Status status) {
gpr_log(GPR_ERROR, "[xds_resolver %p] received error from XdsClient: %s",
- this, grpc_error_std_string(error).c_str());
+ this, status.ToString().c_str());
+ if (xds_client_ == nullptr) return;
Result result;
grpc_arg new_arg = xds_client_->MakeChannelArg();
result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
- result.service_config_error = error;
- result_handler_->ReturnResult(std::move(result));
+ result.service_config = absl::UnavailableError(
+ absl::StrCat("error obtaining xDS resources: ", status.ToString()));
+ result_handler_->ReportResult(std::move(result));
}
void XdsResolver::OnResourceDoesNotExist() {
@@ -835,28 +924,42 @@ void XdsResolver::OnResourceDoesNotExist() {
"[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
"update and returning empty service config",
this);
+ if (xds_client_ == nullptr) {
+ return;
+ }
current_virtual_host_.routes.clear();
Result result;
- result.service_config =
- ServiceConfig::Create(args_, "{}", &result.service_config_error);
- GPR_ASSERT(result.service_config != nullptr);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ result.service_config = ServiceConfigImpl::Create(args_, "{}", &error);
+ GPR_ASSERT(*result.service_config != nullptr);
result.args = grpc_channel_args_copy(args_);
- result_handler_->ReturnResult(std::move(result));
+ result_handler_->ReportResult(std::move(result));
}
-grpc_error_handle XdsResolver::CreateServiceConfig(
- RefCountedPtr<ServiceConfig>* service_config) {
+absl::StatusOr<RefCountedPtr<ServiceConfig>>
+XdsResolver::CreateServiceConfig() {
std::vector<std::string> clusters;
for (const auto& cluster : cluster_state_map_) {
- clusters.push_back(
- absl::StrFormat(" \"%s\":{\n"
- " \"childPolicy\":[ {\n"
- " \"cds_experimental\":{\n"
- " \"cluster\": \"%s\"\n"
- " }\n"
- " } ]\n"
- " }",
- cluster.first, cluster.first));
+ absl::string_view child_name = cluster.first;
+ if (absl::ConsumePrefix(&child_name, "cluster_specifier_plugin:")) {
+ clusters.push_back(absl::StrFormat(
+ " \"%s\":{\n"
+ " \"childPolicy\": %s\n"
+ " }",
+ cluster.first,
+ cluster_specifier_plugin_map_[std::string(child_name)]));
+ } else {
+ absl::ConsumePrefix(&child_name, "cluster:");
+ clusters.push_back(
+ absl::StrFormat(" \"%s\":{\n"
+ " \"childPolicy\":[ {\n"
+ " \"cds_experimental\":{\n"
+ " \"cluster\": \"%s\"\n"
+ " }\n"
+ " } ]\n"
+ " }",
+ cluster.first, child_name));
+ }
}
std::vector<std::string> config_parts;
config_parts.push_back(
@@ -872,8 +975,13 @@ grpc_error_handle XdsResolver::CreateServiceConfig(
"}");
std::string json = absl::StrJoin(config_parts, "");
grpc_error_handle error = GRPC_ERROR_NONE;
- *service_config = ServiceConfig::Create(args_, json.c_str(), &error);
- return error;
+ absl::StatusOr<RefCountedPtr<ServiceConfig>> result =
+ ServiceConfigImpl::Create(args_, json.c_str(), &error);
+ if (error != GRPC_ERROR_NONE) {
+ result = grpc_error_to_absl_status(error);
+ GRPC_ERROR_UNREF(error);
+ }
+ return result;
}
void XdsResolver::GenerateResult() {
@@ -883,18 +991,17 @@ void XdsResolver::GenerateResult() {
grpc_error_handle error = GRPC_ERROR_NONE;
auto config_selector = MakeRefCounted<XdsConfigSelector>(Ref(), &error);
if (error != GRPC_ERROR_NONE) {
- OnError(error);
+ OnError(absl::UnavailableError(grpc_error_std_string(error)));
+ GRPC_ERROR_UNREF(error);
return;
}
Result result;
- error = CreateServiceConfig(&result.service_config);
- if (error != GRPC_ERROR_NONE) {
- OnError(error);
- return;
- }
+ result.service_config = CreateServiceConfig();
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());
+ result.service_config.ok()
+ ? std::string((*result.service_config)->json_string()).c_str()
+ : result.service_config.status().ToString().c_str());
}
grpc_arg new_args[] = {
xds_client_->MakeChannelArg(),
@@ -902,7 +1009,7 @@ void XdsResolver::GenerateResult() {
};
result.args =
grpc_channel_args_copy_and_add(args_, new_args, GPR_ARRAY_SIZE(new_args));
- result_handler_->ReturnResult(std::move(result));
+ result_handler_->ReportResult(std::move(result));
}
void XdsResolver::MaybeRemoveUnusedClusters() {
@@ -928,29 +1035,32 @@ void XdsResolver::MaybeRemoveUnusedClusters() {
class XdsResolverFactory : public ResolverFactory {
public:
+ absl::string_view scheme() const override { return "xds"; }
+
bool IsValidUri(const URI& uri) const override {
- if (GPR_UNLIKELY(!uri.authority().empty())) {
- gpr_log(GPR_ERROR, "URI authority not supported");
+ if (uri.path().empty() || uri.path().back() == '/') {
+ gpr_log(GPR_ERROR,
+ "URI path does not contain valid data plane authority");
return false;
}
return true;
}
+ std::string GetDefaultAuthority(const URI& uri) const override {
+ return GetDefaultAuthorityInternal(uri);
+ }
+
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
if (!IsValidUri(args.uri)) return nullptr;
return MakeOrphanable<XdsResolver>(std::move(args));
}
-
- const char* scheme() const override { return "xds"; }
};
} // namespace
-} // namespace grpc_core
-
-void grpc_resolver_xds_init() {
- grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
- absl::make_unique<grpc_core::XdsResolverFactory>());
+void RegisterXdsResolver(CoreConfiguration::Builder* builder) {
+ builder->resolver_registry()->RegisterResolverFactory(
+ absl::make_unique<XdsResolverFactory>());
}
-void grpc_resolver_xds_shutdown() {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver_factory.h b/grpc/src/core/ext/filters/client_channel/resolver_factory.h
deleted file mode 100644
index 7b967461..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver_factory.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H
-
-#include <grpc/support/port_platform.h>
-
-#include "absl/strings/strip.h"
-
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/filters/client_channel/resolver.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/iomgr/pollset_set.h"
-#include "src/core/lib/uri/uri_parser.h"
-
-namespace grpc_core {
-
-struct ResolverArgs {
- /// The parsed URI to resolve.
- URI uri;
- /// Channel args to be included in resolver results.
- 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 result handler to be used by the resolver.
- std::unique_ptr<Resolver::ResultHandler> result_handler;
-};
-
-class ResolverFactory {
- public:
- /// Returns a bool indicating whether the input uri is valid to create a
- /// resolver.
- virtual bool IsValidUri(const URI& uri) const = 0;
-
- /// Returns a new resolver instance.
- virtual OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const = 0;
-
- /// Returns a string representing the default authority to use for this
- /// scheme.
- virtual std::string GetDefaultAuthority(const URI& uri) const {
- return std::string(absl::StripPrefix(uri.path(), "/"));
- }
-
- /// Returns the URI scheme that this factory implements.
- /// Caller does NOT take ownership of result.
- virtual const char* scheme() const = 0;
-
- virtual ~ResolverFactory() {}
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver_registry.cc b/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
deleted file mode 100644
index 42b69bbb..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- *
- * 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/resolver_registry.h"
-
-#include <string.h>
-
-#include "absl/container/inlined_vector.h"
-#include "absl/strings/str_cat.h"
-#include "absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-namespace grpc_core {
-
-namespace {
-
-class RegistryState {
- public:
- RegistryState() : default_prefix_(gpr_strdup("dns:///")) {}
-
- void SetDefaultPrefix(const char* default_resolver_prefix) {
- GPR_ASSERT(default_resolver_prefix != nullptr);
- GPR_ASSERT(*default_resolver_prefix != '\0');
- default_prefix_.reset(gpr_strdup(default_resolver_prefix));
- }
-
- void RegisterResolverFactory(std::unique_ptr<ResolverFactory> factory) {
- for (size_t i = 0; i < factories_.size(); ++i) {
- GPR_ASSERT(strcmp(factories_[i]->scheme(), factory->scheme()) != 0);
- }
- factories_.push_back(std::move(factory));
- }
-
- ResolverFactory* LookupResolverFactory(absl::string_view scheme) const {
- for (size_t i = 0; i < factories_.size(); ++i) {
- if (scheme == factories_[i]->scheme()) {
- return factories_[i].get();
- }
- }
- return nullptr;
- }
-
- // Returns the factory for the scheme of \a target. If \a target does
- // not parse as a URI, prepends \a default_prefix_ and tries again.
- // If URI parsing is successful (in either attempt), sets \a uri to
- // point to the parsed URI.
- // If \a default_prefix_ needs to be prepended, sets \a canonical_target
- // to the canonical target string.
- ResolverFactory* FindResolverFactory(absl::string_view target, URI* uri,
- std::string* canonical_target) const {
- GPR_ASSERT(uri != nullptr);
- absl::StatusOr<URI> tmp_uri = URI::Parse(target);
- ResolverFactory* factory =
- tmp_uri.ok() ? LookupResolverFactory(tmp_uri->scheme()) : nullptr;
- if (factory != nullptr) {
- *uri = *tmp_uri;
- return factory;
- }
- *canonical_target = absl::StrCat(default_prefix_.get(), target);
- absl::StatusOr<URI> tmp_uri2 = URI::Parse(*canonical_target);
- factory =
- tmp_uri2.ok() ? LookupResolverFactory(tmp_uri2->scheme()) : nullptr;
- if (factory != nullptr) {
- *uri = *tmp_uri2;
- return factory;
- }
- if (!tmp_uri.ok() || !tmp_uri2.ok()) {
- gpr_log(GPR_ERROR, "%s",
- absl::StrFormat("Error parsing URI(s). '%s':%s; '%s':%s", target,
- tmp_uri.status().ToString(), *canonical_target,
- tmp_uri2.status().ToString())
- .c_str());
- return nullptr;
- }
- gpr_log(GPR_ERROR, "Don't know how to resolve '%s' or '%s'.",
- std::string(target).c_str(), canonical_target->c_str());
- return nullptr;
- }
-
- private:
- // We currently support 10 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).
- absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
- grpc_core::UniquePtr<char> default_prefix_;
-};
-
-static RegistryState* g_state = nullptr;
-
-} // namespace
-
-//
-// ResolverRegistry::Builder
-//
-
-void ResolverRegistry::Builder::InitRegistry() {
- if (g_state == nullptr) g_state = new RegistryState();
-}
-
-void ResolverRegistry::Builder::ShutdownRegistry() {
- delete g_state;
- g_state = nullptr;
-}
-
-void ResolverRegistry::Builder::SetDefaultPrefix(const char* default_prefix) {
- InitRegistry();
- g_state->SetDefaultPrefix(default_prefix);
-}
-
-void ResolverRegistry::Builder::RegisterResolverFactory(
- std::unique_ptr<ResolverFactory> factory) {
- InitRegistry();
- g_state->RegisterResolverFactory(std::move(factory));
-}
-
-//
-// ResolverRegistry
-//
-
-ResolverFactory* ResolverRegistry::LookupResolverFactory(const char* scheme) {
- GPR_ASSERT(g_state != nullptr);
- return g_state->LookupResolverFactory(scheme);
-}
-
-bool ResolverRegistry::IsValidTarget(absl::string_view target) {
- URI uri;
- std::string canonical_target;
- ResolverFactory* factory =
- g_state->FindResolverFactory(target, &uri, &canonical_target);
- return factory == nullptr ? false : factory->IsValidUri(uri);
-}
-
-OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
- const char* target, const grpc_channel_args* args,
- grpc_pollset_set* pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer,
- std::unique_ptr<Resolver::ResultHandler> result_handler) {
- GPR_ASSERT(g_state != nullptr);
- std::string canonical_target;
- ResolverArgs resolver_args;
- ResolverFactory* factory = g_state->FindResolverFactory(
- target, &resolver_args.uri, &canonical_target);
- resolver_args.args = args;
- resolver_args.pollset_set = pollset_set;
- resolver_args.work_serializer = std::move(work_serializer);
- resolver_args.result_handler = std::move(result_handler);
- OrphanablePtr<Resolver> resolver =
- factory == nullptr ? nullptr
- : factory->CreateResolver(std::move(resolver_args));
- return resolver;
-}
-
-std::string ResolverRegistry::GetDefaultAuthority(absl::string_view target) {
- GPR_ASSERT(g_state != nullptr);
- URI uri;
- std::string canonical_target;
- ResolverFactory* factory =
- g_state->FindResolverFactory(target, &uri, &canonical_target);
- std::string authority =
- factory == nullptr ? "" : factory->GetDefaultAuthority(uri);
- return authority;
-}
-
-grpc_core::UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(
- const char* target) {
- GPR_ASSERT(g_state != nullptr);
- URI uri;
- std::string canonical_target;
- g_state->FindResolverFactory(target, &uri, &canonical_target);
- return grpc_core::UniquePtr<char>(canonical_target.empty()
- ? gpr_strdup(target)
- : gpr_strdup(canonical_target.c_str()));
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/resolver_registry.h b/grpc/src/core/ext/filters/client_channel/resolver_registry.h
deleted file mode 100644
index f2e5b9c1..00000000
--- a/grpc/src/core/ext/filters/client_channel/resolver_registry.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/client_channel/resolver_factory.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/gprpp/orphanable.h"
-#include "src/core/lib/iomgr/pollset_set.h"
-
-namespace grpc_core {
-
-class ResolverRegistry {
- public:
- /// Methods used to create and populate the ResolverRegistry.
- /// NOT THREAD SAFE -- to be used only during global gRPC
- /// initialization and shutdown.
- class Builder {
- public:
- /// Global initialization and shutdown hooks.
- static void InitRegistry();
- static void ShutdownRegistry();
-
- /// Sets the default URI prefix to \a default_prefix.
- /// Calls InitRegistry() if it has not already been called.
- static void SetDefaultPrefix(const char* default_prefix);
-
- /// Registers a resolver factory. The factory will be used to create a
- /// resolver for any URI whose scheme matches that of the factory.
- /// Calls InitRegistry() if it has not already been called.
- static void RegisterResolverFactory(
- std::unique_ptr<ResolverFactory> factory);
- };
-
- /// Checks whether the user input \a target is valid to create a resolver.
- static bool IsValidTarget(absl::string_view target);
-
- /// Creates a resolver given \a target.
- /// First tries to parse \a target as a URI. If this succeeds, tries
- /// to locate a registered resolver factory based on the URI scheme.
- /// If parsing fails or there is no factory for the URI's scheme,
- /// 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.
- static OrphanablePtr<Resolver> CreateResolver(
- const char* target, const grpc_channel_args* args,
- 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.
- static std::string GetDefaultAuthority(absl::string_view target);
-
- /// Returns \a target with the default prefix prepended, if needed.
- static grpc_core::UniquePtr<char> AddDefaultPrefixIfNeeded(
- const char* target);
-
- /// Returns the resolver factory for \a scheme.
- /// Caller does NOT own the return value.
- static ResolverFactory* LookupResolverFactory(const char* scheme);
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */
diff --git a/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc b/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
index b0c8eebe..23294742 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
+++ b/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
@@ -31,12 +31,12 @@
#include "src/core/ext/filters/client_channel/client_channel.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/lib/channel/channel_args.h"
#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/resolver/server_address.h"
#include "src/core/lib/uri/uri_parser.h"
// As per the retry design, we do not allow more than 5 retry attempts.
@@ -45,18 +45,15 @@
namespace grpc_core {
namespace internal {
-namespace {
-size_t g_client_channel_service_config_parser_index;
-}
-
size_t ClientChannelServiceConfigParser::ParserIndex() {
- return g_client_channel_service_config_parser_index;
+ return CoreConfiguration::Get().service_config_parser().GetParserIndex(
+ parser_name());
}
-void ClientChannelServiceConfigParser::Register() {
- g_client_channel_service_config_parser_index =
- ServiceConfigParser::RegisterParser(
- absl::make_unique<ClientChannelServiceConfigParser>());
+void ClientChannelServiceConfigParser::Register(
+ CoreConfiguration::Builder* builder) {
+ builder->service_config_parser()->RegisterParser(
+ absl::make_unique<ClientChannelServiceConfigParser>());
}
namespace {
@@ -100,7 +97,7 @@ ClientChannelServiceConfigParser::ParseGlobalParams(
grpc_error_handle parse_error = GRPC_ERROR_NONE;
parsed_lb_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
it->second, &parse_error);
- if (parsed_lb_config == nullptr) {
+ if (parse_error != GRPC_ERROR_NONE) {
std::vector<grpc_error_handle> lb_errors;
lb_errors.push_back(parse_error);
error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
@@ -125,11 +122,10 @@ ClientChannelServiceConfigParser::ParseGlobalParams(
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(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("field:loadBalancingPolicy error:", lb_policy_name,
" requires a config. Please use loadBalancingConfig "
- "instead.")
- .c_str()));
+ "instead.")));
}
}
}
@@ -174,7 +170,7 @@ ClientChannelServiceConfigParser::ParsePerMethodParams(
}
}
// Parse timeout.
- grpc_millis timeout = 0;
+ Duration timeout;
ParseJsonObjectFieldAsDuration(json.object_value(), "timeout", &timeout,
&error_list, false);
// Return result.
diff --git a/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h b/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
index b70068e0..855ebbde 100644
--- a/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
+++ b/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
@@ -23,13 +23,14 @@
#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"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/exec_ctx.h" // for grpc_millis
+#include "src/core/lib/iomgr/exec_ctx.h" // for grpc_core::Timestamp
#include "src/core/lib/json/json.h"
+#include "src/core/lib/resolver/resolver.h"
+#include "src/core/lib/service_config/service_config_parser.h"
namespace grpc_core {
namespace internal {
@@ -66,21 +67,23 @@ class ClientChannelGlobalParsedConfig
class ClientChannelMethodParsedConfig
: public ServiceConfigParser::ParsedConfig {
public:
- ClientChannelMethodParsedConfig(grpc_millis timeout,
+ ClientChannelMethodParsedConfig(Duration timeout,
const absl::optional<bool>& wait_for_ready)
: timeout_(timeout), wait_for_ready_(wait_for_ready) {}
- grpc_millis timeout() const { return timeout_; }
+ Duration timeout() const { return timeout_; }
absl::optional<bool> wait_for_ready() const { return wait_for_ready_; }
private:
- grpc_millis timeout_ = 0;
+ Duration timeout_;
absl::optional<bool> wait_for_ready_;
};
class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
public:
+ absl::string_view name() const override { return parser_name(); }
+
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
const grpc_channel_args* /*args*/, const Json& json,
grpc_error_handle* error) override;
@@ -90,7 +93,10 @@ class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
grpc_error_handle* error) override;
static size_t ParserIndex();
- static void Register();
+ static void Register(CoreConfiguration::Builder* builder);
+
+ private:
+ static absl::string_view parser_name() { return "client_channel"; }
};
} // namespace internal
diff --git a/grpc/src/core/ext/filters/client_channel/retry_filter.cc b/grpc/src/core/ext/filters/client_channel/retry_filter.cc
index a03d2da1..ad90b830 100644
--- a/grpc/src/core/ext/filters/client_channel/retry_filter.cc
+++ b/grpc/src/core/ext/filters/client_channel/retry_filter.cc
@@ -22,26 +22,24 @@
#include "absl/status/statusor.h"
#include "absl/strings/strip.h"
+#include <grpc/status.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/retry_service_config.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/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/service_config/service_config.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/metadata_batch.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "src/core/lib/transport/status_metadata.h"
#include "src/core/lib/uri/uri_parser.h"
//
@@ -87,10 +85,7 @@
// which batches need to be sent on the LB call for a given attempt.
// TODO(roth): In subsequent PRs:
-// - add support for transparent retries (including initial metadata)
-// - figure out how to record stats in census for retries
-// (census filter is on top of this one)
-// - add census stats for retries
+// - implement hedging
// By default, we buffer 256 KiB per RPC for retries.
// TODO(roth): Do we have any data to suggest a better value?
@@ -149,7 +144,9 @@ class RetryFilter {
RetryFilter(const grpc_channel_args* args, grpc_error_handle* error)
: client_channel_(grpc_channel_args_find_pointer<ClientChannel>(
args, GRPC_ARG_CLIENT_CHANNEL)),
- per_rpc_retry_buffer_size_(GetMaxPerRpcRetryBufferSize(args)) {
+ per_rpc_retry_buffer_size_(GetMaxPerRpcRetryBufferSize(args)),
+ service_config_parser_index_(
+ internal::RetryServiceConfigParser::ParserIndex()) {
// Get retry throttling parameters from service config.
auto* service_config = grpc_channel_args_find_pointer<ServiceConfig>(
args, GRPC_ARG_SERVICE_CONFIG_OBJ);
@@ -175,13 +172,19 @@ class RetryFilter {
}
std::string server_name(absl::StripPrefix(uri->path(), "/"));
// Get throttling config for server_name.
- retry_throttle_data_ = internal::ServerRetryThrottleMap::GetDataForServer(
- server_name, config->max_milli_tokens(), config->milli_token_ratio());
+ retry_throttle_data_ =
+ internal::ServerRetryThrottleMap::Get()->GetDataForServer(
+ server_name, config->max_milli_tokens(),
+ config->milli_token_ratio());
}
+ const RetryMethodConfig* GetRetryPolicy(
+ const grpc_call_context_element* context);
+
ClientChannel* client_channel_;
size_t per_rpc_retry_buffer_size_;
RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
+ const size_t service_config_parser_index_;
};
//
@@ -200,7 +203,6 @@ class RetryFilter::CallData {
static void SetPollent(grpc_call_element* elem, grpc_polling_entity* pollent);
private:
- class Canceller;
class CallStackDestructionBarrier;
// Pending batches stored in call data.
@@ -212,13 +214,12 @@ class RetryFilter::CallData {
};
// State associated with each call attempt.
- // Allocated on the arena.
- class CallAttempt
- : public RefCounted<CallAttempt, PolymorphicRefCount, kUnrefCallDtor> {
+ class CallAttempt : public RefCounted<CallAttempt> {
public:
- explicit CallAttempt(CallData* calld);
+ CallAttempt(CallData* calld, bool is_transparent_retry);
+ ~CallAttempt() override;
- ClientChannel::LoadBalancedCall* lb_call() const { return lb_call_.get(); }
+ bool lb_call_committed() const { return lb_call_committed_; }
// Constructs and starts whatever batches are needed on this call
// attempt.
@@ -228,6 +229,9 @@ class RetryFilter::CallData {
// committing the call.
void FreeCachedSendOpDataAfterCommit();
+ // Cancels the call attempt.
+ void CancelFromSurface(grpc_transport_stream_op_batch* cancel_batch);
+
private:
// State used for starting a retryable batch on the call attempt's LB call.
// This provides its own grpc_transport_stream_op_batch and other data
@@ -235,7 +239,7 @@ class RetryFilter::CallData {
// We allocate one struct on the arena for each attempt at starting a
// batch on a given LB call.
class BatchData
- : public RefCounted<CallAttempt, PolymorphicRefCount, kUnrefCallDtor> {
+ : public RefCounted<BatchData, PolymorphicRefCount, kUnrefCallDtor> {
public:
BatchData(RefCountedPtr<CallAttempt> call_attempt, int refcount,
bool set_on_complete);
@@ -243,48 +247,50 @@ class RetryFilter::CallData {
grpc_transport_stream_op_batch* batch() { return &batch_; }
- // Adds retriable send_initial_metadata op to batch_data.
+ // Adds retriable send_initial_metadata op.
void AddRetriableSendInitialMetadataOp();
- // Adds retriable send_message op to batch_data.
+ // Adds retriable send_message op.
void AddRetriableSendMessageOp();
- // Adds retriable send_trailing_metadata op to batch_data.
+ // Adds retriable send_trailing_metadata op.
void AddRetriableSendTrailingMetadataOp();
- // Adds retriable recv_initial_metadata op to batch_data.
+ // Adds retriable recv_initial_metadata op.
void AddRetriableRecvInitialMetadataOp();
- // Adds retriable recv_message op to batch_data.
+ // Adds retriable recv_message op.
void AddRetriableRecvMessageOp();
- // Adds retriable recv_trailing_metadata op to batch_data.
+ // Adds retriable recv_trailing_metadata op.
void AddRetriableRecvTrailingMetadataOp();
+ // Adds cancel_stream op.
+ void AddCancelStreamOp(grpc_error_handle error);
private:
- // Returns true if the call is being retried.
- bool MaybeRetry(grpc_status_code status, grpc_mdelem* server_pushback_md,
- bool is_lb_drop);
-
// Frees cached send ops that were completed by the completed batch in
// batch_data. Used when batches are completed after the call is
// committed.
void FreeCachedSendOpDataForCompletedBatch();
- // Invokes recv_initial_metadata_ready for a batch.
- static void InvokeRecvInitialMetadataCallback(void* arg,
- grpc_error_handle error);
+ // If there is a pending recv_initial_metadata op, adds a closure
+ // to closures for recv_initial_metadata_ready.
+ void MaybeAddClosureForRecvInitialMetadataCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures);
// Intercepts recv_initial_metadata_ready callback for retries.
// Commits the call and returns the initial metadata up the stack.
static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
- // Invokes recv_message_ready for a batch.
- static void InvokeRecvMessageCallback(void* arg, grpc_error_handle error);
+ // If there is a pending recv_message op, adds a closure to closures
+ // for recv_message_ready.
+ void MaybeAddClosureForRecvMessageCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures);
// Intercepts recv_message_ready callback for retries.
// Commits the call and returns the message up the stack.
static void RecvMessageReady(void* arg, grpc_error_handle error);
- // Adds recv_trailing_metadata_ready closure to closures.
- void AddClosureForRecvTrailingMetadataReady(
+ // If there is a pending recv_trailing_metadata op, adds a closure to
+ // closures for recv_trailing_metadata_ready.
+ void MaybeAddClosureForRecvTrailingMetadataReady(
grpc_error_handle error, CallCombinerClosureList* closures);
- // Adds any necessary closures for deferred recv_initial_metadata and
- // recv_message callbacks to closures.
- void AddClosuresForDeferredRecvCallbacks(
+ // Adds any necessary closures for deferred batch completion
+ // callbacks to closures.
+ void AddClosuresForDeferredCompletionCallbacks(
CallCombinerClosureList* closures);
// For any pending batch containing an op that has not yet been started,
// adds the pending batch's completion closures to closures.
@@ -309,6 +315,10 @@ class RetryFilter::CallData {
// Callback used to intercept on_complete from LB calls.
static void OnComplete(void* arg, grpc_error_handle error);
+ // Callback used to handle on_complete for internally generated
+ // cancel_stream op.
+ static void OnCompleteForCancelOp(void* arg, grpc_error_handle error);
+
RefCountedPtr<CallAttempt> call_attempt_;
// The batch to use in the LB call.
// Its payload field points to CallAttempt::batch_payload_.
@@ -317,12 +327,38 @@ class RetryFilter::CallData {
grpc_closure on_complete_;
};
+ class AttemptDispatchController
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit AttemptDispatchController(CallAttempt* call_attempt)
+ : call_attempt_(call_attempt) {}
+
+ // Will never be called.
+ bool ShouldRetry() override { return false; }
+
+ void Commit() override {
+ call_attempt_->lb_call_committed_ = true;
+ auto* calld = call_attempt_->calld_;
+ if (calld->retry_committed_) {
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
+ .value);
+ service_config_call_data->call_dispatch_controller()->Commit();
+ }
+ }
+
+ private:
+ CallAttempt* call_attempt_;
+ };
+
// Creates a BatchData object on the call's arena with the
// specified refcount. If set_on_complete is true, the batch's
// on_complete callback will be set to point to on_complete();
// otherwise, the batch's on_complete callback will be null.
BatchData* CreateBatch(int refcount, bool set_on_complete) {
- return calld_->arena_->New<BatchData>(Ref(), refcount, set_on_complete);
+ return calld_->arena_->New<BatchData>(Ref(DEBUG_LOCATION, "CreateBatch"),
+ refcount, set_on_complete);
}
// If there are any cached send ops that need to be replayed on this
@@ -330,48 +366,79 @@ class RetryFilter::CallData {
// Otherwise, returns nullptr.
BatchData* MaybeCreateBatchForReplay();
+ // Adds a closure to closures that will execute batch in the call combiner.
+ void AddClosureForBatch(grpc_transport_stream_op_batch* batch,
+ const char* reason,
+ CallCombinerClosureList* closures);
+
+ // Helper function used to start a recv_trailing_metadata batch. This
+ // is used in the case where a recv_initial_metadata or recv_message
+ // op fails in a way that we know the call is over but when the application
+ // has not yet started its own recv_trailing_metadata op.
+ void AddBatchForInternalRecvTrailingMetadata(
+ CallCombinerClosureList* closures);
+
+ // Adds a batch to closures to cancel this call attempt, if
+ // cancellation has not already been sent on the LB call.
+ void MaybeAddBatchForCancelOp(grpc_error_handle error,
+ CallCombinerClosureList* closures);
+
// Adds batches for pending batches to closures.
void AddBatchesForPendingBatches(CallCombinerClosureList* closures);
// Adds whatever batches are needed on this attempt to closures.
void AddRetriableBatches(CallCombinerClosureList* closures);
- // Returns true if any op in the batch was not yet started on this attempt.
- bool PendingBatchIsUnstarted(PendingBatch* pending);
+ // Returns true if any send op in the batch was not yet started on this
+ // attempt.
+ bool PendingBatchContainsUnstartedSendOps(PendingBatch* pending);
- // Helper function used to start a recv_trailing_metadata batch. This
- // is used in the case where a recv_initial_metadata or recv_message
- // op fails in a way that we know the call is over but when the application
- // has not yet started its own recv_trailing_metadata op.
- void StartInternalRecvTrailingMetadata();
+ // Returns true if there are cached send ops to replay.
+ bool HaveSendOpsToReplay();
+
+ // If our retry state is no longer needed, switch to fast path by moving
+ // our LB call into calld_->committed_call_ and having calld_ drop
+ // its ref to us.
+ void MaybeSwitchToFastPath();
+
+ // Returns true if the call should be retried.
+ bool ShouldRetry(absl::optional<grpc_status_code> status,
+ absl::optional<Duration> server_pushback_ms);
+
+ // Abandons the call attempt. Unrefs any deferred batches.
+ void Abandon();
+
+ static void OnPerAttemptRecvTimer(void* arg, grpc_error_handle error);
+ static void OnPerAttemptRecvTimerLocked(void* arg, grpc_error_handle error);
+ void MaybeCancelPerAttemptRecvTimer();
CallData* calld_;
- RefCountedPtr<ClientChannel::LoadBalancedCall> lb_call_;
+ AttemptDispatchController attempt_dispatch_controller_;
+ OrphanablePtr<ClientChannel::LoadBalancedCall> lb_call_;
+ bool lb_call_committed_ = false;
+
+ grpc_timer per_attempt_recv_timer_;
+ grpc_closure on_per_attempt_recv_timer_;
+ bool per_attempt_recv_timer_pending_ = false;
// BatchData.batch.payload points to this.
grpc_transport_stream_op_batch_payload batch_payload_;
// For send_initial_metadata.
- // Note that we need to make a copy of the initial metadata for each
- // call attempt instead of just referring to the copy in call_data,
- // because filters in the subchannel stack may modify the metadata,
- // so we need to start in a pristine state for each attempt of the call.
- grpc_linked_mdelem* send_initial_metadata_storage_;
- grpc_metadata_batch send_initial_metadata_;
+ grpc_metadata_batch send_initial_metadata_{calld_->arena_};
// For send_message.
// TODO(roth): Restructure this to eliminate use of ManualConstructor.
ManualConstructor<ByteStreamCache::CachingByteStream> send_message_;
// For send_trailing_metadata.
- grpc_linked_mdelem* send_trailing_metadata_storage_;
- grpc_metadata_batch send_trailing_metadata_;
+ grpc_metadata_batch send_trailing_metadata_{calld_->arena_};
// For intercepting recv_initial_metadata.
- grpc_metadata_batch recv_initial_metadata_;
+ grpc_metadata_batch recv_initial_metadata_{calld_->arena_};
grpc_closure recv_initial_metadata_ready_;
bool trailing_metadata_available_ = false;
// For intercepting recv_message.
grpc_closure recv_message_ready_;
OrphanablePtr<ByteStream> recv_message_;
// For intercepting recv_trailing_metadata.
- grpc_metadata_batch recv_trailing_metadata_;
+ grpc_metadata_batch recv_trailing_metadata_{calld_->arena_};
grpc_transport_stream_stats collect_stats_;
grpc_closure recv_trailing_metadata_ready_;
// These fields indicate which ops have been started and completed on
@@ -388,17 +455,30 @@ class RetryFilter::CallData {
bool completed_recv_initial_metadata_ : 1;
bool started_recv_trailing_metadata_ : 1;
bool completed_recv_trailing_metadata_ : 1;
+ bool sent_cancel_stream_ : 1;
// State for callback processing.
- BatchData* recv_initial_metadata_ready_deferred_batch_ = nullptr;
+ RefCountedPtr<BatchData> recv_initial_metadata_ready_deferred_batch_;
grpc_error_handle recv_initial_metadata_error_ = GRPC_ERROR_NONE;
- BatchData* recv_message_ready_deferred_batch_ = nullptr;
+ RefCountedPtr<BatchData> recv_message_ready_deferred_batch_;
grpc_error_handle recv_message_error_ = GRPC_ERROR_NONE;
- BatchData* recv_trailing_metadata_internal_batch_ = nullptr;
+ struct OnCompleteDeferredBatch {
+ OnCompleteDeferredBatch(RefCountedPtr<BatchData> batch,
+ grpc_error_handle error)
+ : batch(std::move(batch)), error(error) {}
+ RefCountedPtr<BatchData> batch;
+ grpc_error_handle error;
+ };
+ // There cannot be more than 3 pending send op batches at a time.
+ absl::InlinedVector<OnCompleteDeferredBatch, 3>
+ on_complete_deferred_batches_;
+ RefCountedPtr<BatchData> recv_trailing_metadata_internal_batch_;
+ grpc_error_handle recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ bool seen_recv_trailing_metadata_from_surface_ : 1;
// NOTE: Do not move this next to the metadata bitfields above. That would
// save space but will also result in a data race because compiler
// will generate a 2 byte store which overwrites the meta-data
// fields upon setting this field.
- bool retry_dispatched_ : 1;
+ bool abandoned_ : 1;
};
CallData(RetryFilter* chand, const grpc_call_element_args& args);
@@ -432,17 +512,22 @@ class RetryFilter::CallData {
// Commits the call so that no further retry attempts will be performed.
void RetryCommit(CallAttempt* call_attempt);
- // Starts a retry after appropriate back-off.
- void DoRetry(grpc_millis server_pushback_ms);
+ // Starts a timer to retry after appropriate back-off.
+ // If server_pushback is nullopt, retry_backoff_ is used.
+ void StartRetryTimer(absl::optional<Duration> server_pushback);
+
static void OnRetryTimer(void* arg, grpc_error_handle error);
+ static void OnRetryTimerLocked(void* arg, grpc_error_handle error);
- RefCountedPtr<ClientChannel::LoadBalancedCall> CreateLoadBalancedCall();
+ // Adds a closure to closures to start a transparent retry.
+ void AddClosureToStartTransparentRetry(CallCombinerClosureList* closures);
+ static void StartTransparentRetry(void* arg, grpc_error_handle error);
- void CreateCallAttempt();
+ OrphanablePtr<ClientChannel::LoadBalancedCall> CreateLoadBalancedCall(
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry);
- // Adds a closure to closures that will execute batch in the call combiner.
- void AddClosureForBatch(grpc_transport_stream_op_batch* batch,
- CallCombinerClosureList* closures);
+ void CreateCallAttempt(bool is_transparent_retry);
RetryFilter* chand_;
grpc_polling_entity* pollent_;
@@ -451,13 +536,14 @@ class RetryFilter::CallData {
BackOff retry_backoff_;
grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
+ Timestamp deadline_;
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
+ grpc_error_handle cancelled_from_surface_ = GRPC_ERROR_NONE;
+
RefCountedPtr<CallStackDestructionBarrier> call_stack_destruction_barrier_;
// TODO(roth): As part of implementing hedging, we will need to maintain a
@@ -465,13 +551,10 @@ class RetryFilter::CallData {
// gets cancelled.
RefCountedPtr<CallAttempt> call_attempt_;
- // LB call used when the call is commited before any CallAttempt is
- // created.
- // TODO(roth): Change CallAttempt logic such that once we've committed
- // and all cached send ops have been replayed, we move the LB call
- // from the CallAttempt here, thus creating a fast path for the
- // remainder of the streaming call.
- RefCountedPtr<ClientChannel::LoadBalancedCall> committed_call_;
+ // LB call used when we've committed to a call attempt and the retry
+ // state for that attempt is no longer needed. This provides a fast
+ // path for long-running streaming calls that minimizes overhead.
+ OrphanablePtr<ClientChannel::LoadBalancedCall> committed_call_;
// When are are not yet fully committed to a particular call (i.e.,
// either we might still retry or we have committed to the call but
@@ -486,34 +569,26 @@ class RetryFilter::CallData {
// Retry state.
bool retry_committed_ : 1;
- bool last_attempt_got_server_pushback_ : 1;
+ bool retry_timer_pending_ : 1;
+ bool retry_codepath_started_ : 1;
+ bool sent_transparent_retry_not_seen_by_server_ : 1;
int num_attempts_completed_ = 0;
- Mutex timer_mu_;
- Canceller* canceller_ ABSL_GUARDED_BY(timer_mu_);
- grpc_timer retry_timer_ ABSL_GUARDED_BY(timer_mu_);
+ grpc_timer retry_timer_;
grpc_closure retry_closure_;
- // The number of batches containing send ops that are currently in-flight
- // on any call attempt.
- // We hold a ref to the call stack while this is non-zero, since replay
- // batches may not complete until after all callbacks have been returned
- // to the surface, and we need to make sure that the call is not destroyed
- // until all of these batches have completed.
- // Note that we actually only need to track replay batches, but it's
- // easier to track all batches with send ops.
- int num_in_flight_call_attempt_send_batches_ = 0;
-
// Cached data for retrying send ops.
// send_initial_metadata
bool seen_send_initial_metadata_ = false;
- grpc_linked_mdelem* send_initial_metadata_storage_ = nullptr;
- grpc_metadata_batch send_initial_metadata_;
+ grpc_metadata_batch send_initial_metadata_{arena_};
uint32_t send_initial_metadata_flags_;
// TODO(roth): As part of implementing hedging, we'll probably need to
// have the LB call set a value in CallAttempt and then propagate it
// from CallAttempt to the parent call when we commit. Otherwise, we
// may leave this with a value for a peer other than the one we
- // actually commit to.
+ // actually commit to. Alternatively, maybe see if there's a way to
+ // change the surface API such that the peer isn't available until
+ // after initial metadata is received? (Could even change the
+ // transport API to return this with the recv_initial_metadata op.)
gpr_atm* peer_string_;
// send_message
// When we get a send_message op, we replace the original byte stream
@@ -522,11 +597,14 @@ class RetryFilter::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.
+ // TODO(roth): As part of implementing hedging, we may need some
+ // synchronization here, since ByteStreamCache does not provide any
+ // synchronization, so it's not safe to have multiple
+ // CachingByteStreams read from the same ByteStreamCache concurrently.
absl::InlinedVector<ByteStreamCache*, 3> send_messages_;
// send_trailing_metadata
bool seen_send_trailing_metadata_ = false;
- grpc_linked_mdelem* send_trailing_metadata_storage_ = nullptr;
- grpc_metadata_batch send_trailing_metadata_;
+ grpc_metadata_batch send_trailing_metadata_{arena_};
};
//
@@ -583,51 +661,15 @@ class RetryFilter::CallData::CallStackDestructionBarrier
};
//
-// RetryFilter::CallData::Canceller
-//
-
-class RetryFilter::CallData::Canceller {
- public:
- explicit Canceller(CallData* calld) : calld_(calld) {
- GRPC_CALL_STACK_REF(calld_->owning_call_, "RetryCanceller");
- GRPC_CLOSURE_INIT(&closure_, &Cancel, this, nullptr);
- calld_->call_combiner_->SetNotifyOnCancel(&closure_);
- }
-
- private:
- static void Cancel(void* arg, grpc_error_handle error) {
- auto* self = static_cast<Canceller*>(arg);
- auto* calld = self->calld_;
- {
- MutexLock lock(&calld->timer_mu_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "calld=%p: cancelling retry timer: error=%s self=%p "
- "calld->canceller_=%p",
- calld, grpc_error_std_string(error).c_str(), self,
- calld->canceller_);
- }
- if (calld->canceller_ == self && error != GRPC_ERROR_NONE) {
- calld->canceller_ = nullptr; // Checked by OnRetryTimer().
- grpc_timer_cancel(&calld->retry_timer_);
- calld->FreeAllCachedSendOpData();
- GRPC_CALL_COMBINER_STOP(calld->call_combiner_, "Canceller");
- }
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call_, "RetryCanceller");
- delete self;
- }
-
- CallData* calld_;
- grpc_closure closure_;
-};
-
-//
// RetryFilter::CallData::CallAttempt
//
-RetryFilter::CallData::CallAttempt::CallAttempt(CallData* calld)
- : calld_(calld),
+RetryFilter::CallData::CallAttempt::CallAttempt(CallData* calld,
+ bool is_transparent_retry)
+ : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "CallAttempt"
+ : nullptr),
+ calld_(calld),
+ attempt_dispatch_controller_(this),
batch_payload_(calld->call_context_),
started_send_initial_metadata_(false),
completed_send_initial_metadata_(false),
@@ -637,12 +679,45 @@ RetryFilter::CallData::CallAttempt::CallAttempt(CallData* calld)
completed_recv_initial_metadata_(false),
started_recv_trailing_metadata_(false),
completed_recv_trailing_metadata_(false),
- retry_dispatched_(false) {
- lb_call_ = calld->CreateLoadBalancedCall();
+ sent_cancel_stream_(false),
+ seen_recv_trailing_metadata_from_surface_(false),
+ abandoned_(false) {
+ lb_call_ = calld->CreateLoadBalancedCall(&attempt_dispatch_controller_,
+ is_transparent_retry);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: attempt=%p: create lb_call=%p",
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: created attempt, lb_call=%p",
calld->chand_, calld, this, lb_call_.get());
}
+ // If per_attempt_recv_timeout is set, start a timer.
+ if (calld->retry_policy_ != nullptr &&
+ calld->retry_policy_->per_attempt_recv_timeout().has_value()) {
+ Timestamp per_attempt_recv_deadline =
+ ExecCtx::Get()->Now() +
+ *calld->retry_policy_->per_attempt_recv_timeout();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: per-attempt timeout in %" PRId64
+ " ms",
+ calld->chand_, calld, this,
+ calld->retry_policy_->per_attempt_recv_timeout()->millis());
+ }
+ // Schedule retry after computed delay.
+ GRPC_CLOSURE_INIT(&on_per_attempt_recv_timer_, OnPerAttemptRecvTimer, this,
+ nullptr);
+ GRPC_CALL_STACK_REF(calld->owning_call_, "OnPerAttemptRecvTimer");
+ Ref(DEBUG_LOCATION, "OnPerAttemptRecvTimer").release();
+ per_attempt_recv_timer_pending_ = true;
+ grpc_timer_init(&per_attempt_recv_timer_, per_attempt_recv_deadline,
+ &on_per_attempt_recv_timer_);
+ }
+}
+
+RetryFilter::CallData::CallAttempt::~CallAttempt() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying call attempt",
+ calld_->chand_, calld_, this);
+ }
}
void RetryFilter::CallData::CallAttempt::FreeCachedSendOpDataAfterCommit() {
@@ -661,13 +736,9 @@ void RetryFilter::CallData::CallAttempt::FreeCachedSendOpDataAfterCommit() {
}
}
-bool RetryFilter::CallData::CallAttempt::PendingBatchIsUnstarted(
+bool RetryFilter::CallData::CallAttempt::PendingBatchContainsUnstartedSendOps(
PendingBatch* pending) {
- // Only look at batches containing send ops, since batches containing
- // only recv ops are always started immediately.
- if (pending->batch == nullptr || pending->batch->on_complete == nullptr) {
- return false;
- }
+ if (pending->batch->on_complete == nullptr) return false;
if (pending->batch->send_initial_metadata &&
!started_send_initial_metadata_) {
return true;
@@ -683,22 +754,40 @@ bool RetryFilter::CallData::CallAttempt::PendingBatchIsUnstarted(
return false;
}
-void RetryFilter::CallData::CallAttempt::StartInternalRecvTrailingMetadata() {
+bool RetryFilter::CallData::CallAttempt::HaveSendOpsToReplay() {
+ // We don't check send_initial_metadata here, because that op will always
+ // be started as soon as it is received from the surface, so it will
+ // never need to be started at this point.
+ return started_send_message_count_ < calld_->send_messages_.size() ||
+ (calld_->seen_send_trailing_metadata_ &&
+ !started_send_trailing_metadata_);
+}
+
+void RetryFilter::CallData::CallAttempt::MaybeSwitchToFastPath() {
+ // If we're not yet committed, we can't switch yet.
+ // TODO(roth): As part of implementing hedging, this logic needs to
+ // check that *this* call attempt is the one that we've committed to.
+ // Might need to replace abandoned_ with an enum indicating whether we're
+ // in flight, abandoned, or the winning call attempt.
+ if (!calld_->retry_committed_) return;
+ // If we've already switched to fast path, there's nothing to do here.
+ if (calld_->committed_call_ != nullptr) return;
+ // If the perAttemptRecvTimeout timer is pending, we can't switch yet.
+ if (per_attempt_recv_timer_pending_) return;
+ // If there are still send ops to replay, we can't switch yet.
+ if (HaveSendOpsToReplay()) return;
+ // If we started an internal batch for recv_trailing_metadata but have not
+ // yet seen that op from the surface, we can't switch yet.
+ if (recv_trailing_metadata_internal_batch_ != nullptr) return;
+ // Switch to fast path.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: call failed but recv_trailing_metadata not "
- "started; starting it internally",
- calld_->chand_, calld_);
+ "chand=%p calld=%p attempt=%p: retry state no longer needed; "
+ "moving LB call to parent and unreffing the call attempt",
+ calld_->chand_, calld_, this);
}
- // Create batch_data with 2 refs, since this batch will be unreffed twice:
- // once for the recv_trailing_metadata_ready callback when the batch
- // completes, and again when we actually get a recv_trailing_metadata
- // op from the surface.
- BatchData* batch_data = CreateBatch(2, false /* set_on_complete */);
- batch_data->AddRetriableRecvTrailingMetadataOp();
- recv_trailing_metadata_internal_batch_ = batch_data;
- // Note: This will release the call combiner.
- lb_call_->StartTransportStreamOpBatch(batch_data->batch());
+ calld_->committed_call_ = std::move(lb_call_);
+ calld_->call_attempt_.reset(DEBUG_LOCATION, "MaybeSwitchToFastPath");
}
// If there are any cached send ops that need to be replayed on the
@@ -712,9 +801,9 @@ RetryFilter::CallData::CallAttempt::MaybeCreateBatchForReplay() {
!calld_->pending_send_initial_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: replaying previously completed "
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
"send_initial_metadata op",
- calld_->chand_, calld_);
+ calld_->chand_, calld_, this);
}
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
replay_batch_data->AddRetriableSendInitialMetadataOp();
@@ -726,9 +815,9 @@ RetryFilter::CallData::CallAttempt::MaybeCreateBatchForReplay() {
!calld_->pending_send_message_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: replaying previously completed "
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
"send_message op",
- calld_->chand_, calld_);
+ calld_->chand_, calld_, this);
}
if (replay_batch_data == nullptr) {
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
@@ -745,9 +834,9 @@ RetryFilter::CallData::CallAttempt::MaybeCreateBatchForReplay() {
!calld_->pending_send_trailing_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: replaying previously completed "
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
"send_trailing_metadata op",
- calld_->chand_, calld_);
+ calld_->chand_, calld_, this);
}
if (replay_batch_data == nullptr) {
replay_batch_data = CreateBatch(1, true /* set_on_complete */);
@@ -757,12 +846,72 @@ RetryFilter::CallData::CallAttempt::MaybeCreateBatchForReplay() {
return replay_batch_data;
}
+namespace {
+
+void StartBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
+ auto* lb_call = static_cast<ClientChannel::LoadBalancedCall*>(
+ batch->handler_private.extra_arg);
+ // Note: This will release the call combiner.
+ lb_call->StartTransportStreamOpBatch(batch);
+}
+
+} // namespace
+
+void RetryFilter::CallData::CallAttempt::AddClosureForBatch(
+ grpc_transport_stream_op_batch* batch, const char* reason,
+ CallCombinerClosureList* closures) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: adding batch (%s): %s",
+ calld_->chand_, calld_, this, reason,
+ grpc_transport_stream_op_batch_string(batch).c_str());
+ }
+ batch->handler_private.extra_arg = lb_call_.get();
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
+ batch, grpc_schedule_on_exec_ctx);
+ closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE, reason);
+}
+
+void RetryFilter::CallData::CallAttempt::
+ AddBatchForInternalRecvTrailingMetadata(CallCombinerClosureList* closures) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call failed but "
+ "recv_trailing_metadata not started; starting it internally",
+ calld_->chand_, calld_, this);
+ }
+ // Create batch_data with 2 refs, since this batch will be unreffed twice:
+ // once for the recv_trailing_metadata_ready callback when the batch
+ // completes, and again when we actually get a recv_trailing_metadata
+ // op from the surface.
+ BatchData* batch_data = CreateBatch(2, false /* set_on_complete */);
+ batch_data->AddRetriableRecvTrailingMetadataOp();
+ recv_trailing_metadata_internal_batch_.reset(batch_data);
+ AddClosureForBatch(batch_data->batch(),
+ "starting internal recv_trailing_metadata", closures);
+}
+
+void RetryFilter::CallData::CallAttempt::MaybeAddBatchForCancelOp(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
+ if (sent_cancel_stream_) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ sent_cancel_stream_ = true;
+ BatchData* cancel_batch_data = CreateBatch(1, /*set_on_complete=*/true);
+ cancel_batch_data->AddCancelStreamOp(error);
+ AddClosureForBatch(cancel_batch_data->batch(),
+ "start cancellation batch on call attempt", closures);
+}
+
void RetryFilter::CallData::CallAttempt::AddBatchesForPendingBatches(
CallCombinerClosureList* closures) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld_->pending_batches_); ++i) {
PendingBatch* pending = &calld_->pending_batches_[i];
grpc_transport_stream_op_batch* batch = pending->batch;
if (batch == nullptr) continue;
+ bool has_send_ops = false;
// Skip any batch that either (a) has already been started on this
// call attempt or (b) we can't start yet because we're still
// replaying send ops that need to be completed first.
@@ -773,65 +922,105 @@ void RetryFilter::CallData::CallAttempt::AddBatchesForPendingBatches(
// starting a recv op due to it being in the same batch with a send
// op. If/when we revamp the callback protocol in
// transport_stream_op_batch, we may be able to fix this.
- if (batch->send_initial_metadata && started_send_initial_metadata_) {
- continue;
+ if (batch->send_initial_metadata) {
+ if (started_send_initial_metadata_) continue;
+ has_send_ops = true;
}
- if (batch->send_message &&
- completed_send_message_count_ < started_send_message_count_) {
- continue;
+ if (batch->send_message) {
+ // Cases where we can't start this send_message op:
+ // - We are currently replaying a previous cached send_message op.
+ // - We have already replayed all send_message ops, including this
+ // one. (This can happen if a send_message op is in the same
+ // batch as a recv op, the send_message op has already completed
+ // but the recv op hasn't, and then a subsequent batch with another
+ // recv op is started from the surface.)
+ if (completed_send_message_count_ < started_send_message_count_ ||
+ completed_send_message_count_ ==
+ (calld_->send_messages_.size() + !pending->send_ops_cached)) {
+ continue;
+ }
+ has_send_ops = true;
}
// Note that we only start send_trailing_metadata if we have no more
// send_message ops to start, since we can't send down any more
// send_message ops after send_trailing_metadata.
- if (batch->send_trailing_metadata &&
- (started_send_message_count_ + batch->send_message <
- calld_->send_messages_.size() ||
- started_send_trailing_metadata_)) {
- continue;
+ if (batch->send_trailing_metadata) {
+ if (started_send_message_count_ + batch->send_message <
+ calld_->send_messages_.size() ||
+ started_send_trailing_metadata_) {
+ continue;
+ }
+ has_send_ops = true;
}
- if (batch->recv_initial_metadata && started_recv_initial_metadata_) {
- continue;
+ int num_callbacks = has_send_ops; // All send ops share one callback.
+ if (batch->recv_initial_metadata) {
+ if (started_recv_initial_metadata_) continue;
+ ++num_callbacks;
}
- if (batch->recv_message &&
- completed_recv_message_count_ < started_recv_message_count_) {
- continue;
+ if (batch->recv_message) {
+ // Skip if the op is already in flight, or if it has already completed
+ // but the completion has not yet been sent to the surface.
+ if (completed_recv_message_count_ < started_recv_message_count_ ||
+ recv_message_ready_deferred_batch_ != nullptr) {
+ continue;
+ }
+ ++num_callbacks;
}
- if (batch->recv_trailing_metadata && started_recv_trailing_metadata_) {
- // If we previously completed a recv_trailing_metadata op
- // initiated by StartInternalRecvTrailingMetadata(), use the
- // result of that instead of trying to re-start this op.
- if (GPR_UNLIKELY(recv_trailing_metadata_internal_batch_ != nullptr)) {
- // If the batch completed, then trigger the completion callback
- // directly, so that we return the previously returned results to
- // the application. Otherwise, just unref the internally started
- // batch, since we'll propagate the completion when it completes.
- if (completed_recv_trailing_metadata_) {
- // Batches containing recv_trailing_metadata always succeed.
- closures->Add(
- &recv_trailing_metadata_ready_, GRPC_ERROR_NONE,
- "re-executing recv_trailing_metadata_ready to propagate "
- "internally triggered result");
- } else {
- recv_trailing_metadata_internal_batch_->Unref();
+ if (batch->recv_trailing_metadata) {
+ if (started_recv_trailing_metadata_) {
+ seen_recv_trailing_metadata_from_surface_ = true;
+ // If we previously completed a recv_trailing_metadata op
+ // initiated by AddBatchForInternalRecvTrailingMetadata(), use the
+ // result of that instead of trying to re-start this op.
+ if (GPR_UNLIKELY(recv_trailing_metadata_internal_batch_ != nullptr)) {
+ // If the batch completed, then trigger the completion callback
+ // directly, so that we return the previously returned results to
+ // the application. Otherwise, just unref the internally started
+ // batch, since we'll propagate the completion when it completes.
+ if (completed_recv_trailing_metadata_) {
+ closures->Add(
+ &recv_trailing_metadata_ready_, recv_trailing_metadata_error_,
+ "re-executing recv_trailing_metadata_ready to propagate "
+ "internally triggered result");
+ // Ref will be released by callback.
+ recv_trailing_metadata_internal_batch_.release();
+ } else {
+ recv_trailing_metadata_internal_batch_.reset(
+ DEBUG_LOCATION,
+ "internally started recv_trailing_metadata batch pending and "
+ "recv_trailing_metadata started from surface");
+ GRPC_ERROR_UNREF(recv_trailing_metadata_error_);
+ }
+ recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
}
- recv_trailing_metadata_internal_batch_ = nullptr;
+ // We don't want the fact that we've already started this op internally
+ // to prevent us from adding a batch that may contain other ops.
+ // Instead, we'll just skip adding this op below.
+ if (num_callbacks == 0) continue;
+ } else {
+ ++num_callbacks;
}
- continue;
}
- // If we're already committed, just send the batch as-is.
- if (calld_->retry_committed_) {
- calld_->AddClosureForBatch(batch, closures);
+ // If we're already committed and the following conditions are met,
+ // just send the batch down as-is:
+ // - The batch contains no cached send ops. (If it does, we need
+ // the logic below to use the cached payloads.)
+ // - The batch does not contain recv_trailing_metadata when we have
+ // already started an internal recv_trailing_metadata batch. (If
+ // we've already started an internal recv_trailing_metadata batch,
+ // then we need the logic below to send all ops in the batch
+ // *except* the recv_trailing_metadata op.)
+ if (calld_->retry_committed_ && !pending->send_ops_cached &&
+ (!batch->recv_trailing_metadata || !started_recv_trailing_metadata_)) {
+ AddClosureForBatch(
+ batch,
+ "start non-replayable pending batch on call attempt after commit",
+ closures);
calld_->PendingBatchClear(pending);
continue;
}
// Create batch with the right number of callbacks.
- const bool has_send_ops = batch->send_initial_metadata ||
- batch->send_message ||
- batch->send_trailing_metadata;
- const int num_callbacks = has_send_ops + batch->recv_initial_metadata +
- batch->recv_message +
- batch->recv_trailing_metadata;
- CallAttempt::BatchData* batch_data =
+ BatchData* batch_data =
CreateBatch(num_callbacks, has_send_ops /* set_on_complete */);
// Cache send ops if needed.
calld_->MaybeCacheSendOpsForBatch(pending);
@@ -858,19 +1047,12 @@ void RetryFilter::CallData::CallAttempt::AddBatchesForPendingBatches(
batch_data->AddRetriableRecvMessageOp();
}
// recv_trailing_metadata.
- if (batch->recv_trailing_metadata) {
+ if (batch->recv_trailing_metadata && !started_recv_trailing_metadata_) {
batch_data->AddRetriableRecvTrailingMetadataOp();
}
- calld_->AddClosureForBatch(batch_data->batch(), closures);
- // Track number of in-flight send batches.
- // If this is the first one, take a ref to the call stack.
- if (batch->send_initial_metadata || batch->send_message ||
- batch->send_trailing_metadata) {
- if (calld_->num_in_flight_call_attempt_send_batches_ == 0) {
- GRPC_CALL_STACK_REF(calld_->owning_call_, "retriable_send_batches");
- }
- ++calld_->num_in_flight_call_attempt_send_batches_;
- }
+ AddClosureForBatch(batch_data->batch(),
+ "start replayable pending batch on call attempt",
+ closures);
}
}
@@ -879,13 +1061,8 @@ void RetryFilter::CallData::CallAttempt::AddRetriableBatches(
// Replay previously-returned send_* ops if needed.
BatchData* replay_batch_data = MaybeCreateBatchForReplay();
if (replay_batch_data != nullptr) {
- calld_->AddClosureForBatch(replay_batch_data->batch(), closures);
- // Track number of pending send batches.
- // If this is the first one, take a ref to the call stack.
- if (calld_->num_in_flight_call_attempt_send_batches_ == 0) {
- GRPC_CALL_STACK_REF(calld_->owning_call_, "retriable_send_batches");
- }
- ++calld_->num_in_flight_call_attempt_send_batches_;
+ AddClosureForBatch(replay_batch_data->batch(),
+ "start replay batch on call attempt", closures);
}
// Now add pending batches.
AddBatchesForPendingBatches(closures);
@@ -893,8 +1070,9 @@ void RetryFilter::CallData::CallAttempt::AddRetriableBatches(
void RetryFilter::CallData::CallAttempt::StartRetriableBatches() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: constructing retriable batches",
- calld_->chand_, calld_);
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: constructing retriable batches",
+ calld_->chand_, calld_, this);
}
// Construct list of closures to execute, one for each pending batch.
CallCombinerClosureList closures;
@@ -903,107 +1081,49 @@ void RetryFilter::CallData::CallAttempt::StartRetriableBatches() {
// Start batches on LB call.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: starting %" PRIuPTR
+ "chand=%p calld=%p attempt=%p: starting %" PRIuPTR
" retriable batches on lb_call=%p",
- calld_->chand_, calld_, closures.size(), lb_call());
+ calld_->chand_, calld_, this, closures.size(), lb_call_.get());
}
closures.RunClosures(calld_->call_combiner_);
}
-//
-// RetryFilter::CallData::CallAttempt::BatchData
-//
-
-RetryFilter::CallData::CallAttempt::BatchData::BatchData(
- RefCountedPtr<CallAttempt> attempt, int refcount, bool set_on_complete)
- : RefCounted(nullptr, refcount), call_attempt_(std::move(attempt)) {
- // TODO(roth): Consider holding this ref on the call stack in
- // CallAttempt instead of here in BatchData. This would eliminate the
- // need for CallData::num_in_flight_call_attempt_send_batches_.
- // But it would require having a way to unref CallAttempt when it is
- // no longer needed (i.e., when the call is committed and all cached
- // send ops have been replayed and the LB call is moved into
- // CallData::committed_call_).
- GRPC_CALL_STACK_REF(call_attempt_->calld_->owning_call_, "CallAttempt");
- batch_.payload = &call_attempt_->batch_payload_;
- if (set_on_complete) {
- GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this,
- grpc_schedule_on_exec_ctx);
- batch_.on_complete = &on_complete_;
- }
+void RetryFilter::CallData::CallAttempt::CancelFromSurface(
+ grpc_transport_stream_op_batch* cancel_batch) {
+ MaybeCancelPerAttemptRecvTimer();
+ Abandon();
+ // Propagate cancellation to LB call.
+ lb_call_->StartTransportStreamOpBatch(cancel_batch);
}
-RetryFilter::CallData::CallAttempt::BatchData::~BatchData() {
- if (batch_.send_initial_metadata) {
- grpc_metadata_batch_destroy(&call_attempt_->send_initial_metadata_);
- }
- if (batch_.send_trailing_metadata) {
- grpc_metadata_batch_destroy(&call_attempt_->send_trailing_metadata_);
- }
- if (batch_.recv_initial_metadata) {
- grpc_metadata_batch_destroy(&call_attempt_->recv_initial_metadata_);
- }
- if (batch_.recv_trailing_metadata) {
- grpc_metadata_batch_destroy(&call_attempt_->recv_trailing_metadata_);
- }
- GRPC_CALL_STACK_UNREF(call_attempt_->calld_->owning_call_, "CallAttempt");
-}
-
-void RetryFilter::CallData::CallAttempt::BatchData::
- FreeCachedSendOpDataForCompletedBatch() {
- auto* calld = call_attempt_->calld_;
- // TODO(roth): When we implement hedging, this logic will need to get
- // a bit more complex, because there may be other (now abandoned) call
- // attempts still using this data. We may need to do some sort of
- // ref-counting instead.
- if (batch_.send_initial_metadata) {
- calld->FreeCachedSendInitialMetadata();
- }
- if (batch_.send_message) {
- calld->FreeCachedSendMessage(call_attempt_->completed_send_message_count_ -
- 1);
- }
- if (batch_.send_trailing_metadata) {
- calld->FreeCachedSendTrailingMetadata();
- }
-}
-
-bool RetryFilter::CallData::CallAttempt::BatchData::MaybeRetry(
- grpc_status_code status, grpc_mdelem* server_pushback_md, bool is_lb_drop) {
- auto* calld = call_attempt_->calld_;
- // LB drops always inhibit retries.
- if (is_lb_drop) return false;
- // Get retry policy.
- if (calld->retry_policy_ == nullptr) return false;
- // If we've already dispatched a retry from this call, return true.
- // This catches the case where the batch has multiple callbacks
- // (i.e., it includes either recv_message or recv_initial_metadata).
- if (call_attempt_->retry_dispatched_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: retry already dispatched",
- calld->chand_, calld);
- }
- return true;
- }
+bool RetryFilter::CallData::CallAttempt::ShouldRetry(
+ absl::optional<grpc_status_code> status,
+ absl::optional<Duration> server_pushback) {
+ // If no retry policy, don't retry.
+ if (calld_->retry_policy_ == nullptr) return false;
// Check status.
- if (GPR_LIKELY(status == GRPC_STATUS_OK)) {
- if (calld->retry_throttle_data_ != nullptr) {
- calld->retry_throttle_data_->RecordSuccess();
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: call succeeded", calld->chand_,
- calld);
+ if (status.has_value()) {
+ if (GPR_LIKELY(*status == GRPC_STATUS_OK)) {
+ if (calld_->retry_throttle_data_ != nullptr) {
+ calld_->retry_throttle_data_->RecordSuccess();
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call succeeded",
+ calld_->chand_, calld_, this);
+ }
+ return false;
}
- return false;
- }
- // Status is not OK. Check whether the status is retryable.
- if (!calld->retry_policy_->retryable_status_codes().Contains(status)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: status %s not configured as retryable",
- calld->chand_, calld, grpc_status_code_to_string(status));
+ // Status is not OK. Check whether the status is retryable.
+ if (!calld_->retry_policy_->retryable_status_codes().Contains(*status)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: status %s not configured as "
+ "retryable",
+ calld_->chand_, calld_, this,
+ grpc_status_code_to_string(*status));
+ }
+ return false;
}
- return false;
}
// Record the failure and check whether retries are throttled.
// Note that it's important for this check to come after the status
@@ -1012,78 +1132,252 @@ bool RetryFilter::CallData::CallAttempt::BatchData::MaybeRetry(
// things like failures due to malformed requests (INVALID_ARGUMENT).
// Conversely, it's important for this to come before the remaining
// checks, so that we don't fail to record failures due to other factors.
- if (calld->retry_throttle_data_ != nullptr &&
- !calld->retry_throttle_data_->RecordFailure()) {
+ if (calld_->retry_throttle_data_ != nullptr &&
+ !calld_->retry_throttle_data_->RecordFailure()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: retries throttled", calld->chand_,
- calld);
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retries throttled",
+ calld_->chand_, calld_, this);
}
return false;
}
// Check whether the call is committed.
- if (calld->retry_committed_) {
+ if (calld_->retry_committed_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: retries already committed",
- calld->chand_, calld);
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: retries already committed",
+ calld_->chand_, calld_, this);
}
return false;
}
// Check whether we have retries remaining.
- ++calld->num_attempts_completed_;
- if (calld->num_attempts_completed_ >= calld->retry_policy_->max_attempts()) {
+ ++calld_->num_attempts_completed_;
+ if (calld_->num_attempts_completed_ >=
+ calld_->retry_policy_->max_attempts()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: exceeded %d retry attempts",
- calld->chand_, calld, calld->retry_policy_->max_attempts());
+ gpr_log(
+ GPR_INFO, "chand=%p calld=%p attempt=%p: exceeded %d retry attempts",
+ calld_->chand_, calld_, this, calld_->retry_policy_->max_attempts());
}
return false;
}
// Check server push-back.
- grpc_millis server_pushback_ms = -1;
- if (server_pushback_md != nullptr) {
- // If the value is "-1" or any other unparseable string, we do not retry.
- uint32_t ms;
- if (!grpc_parse_slice_to_uint32(GRPC_MDVALUE(*server_pushback_md), &ms)) {
+ if (server_pushback.has_value()) {
+ if (*server_pushback < Duration::Zero()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: not retrying due to server push-back",
- calld->chand_, calld);
+ "chand=%p calld=%p attempt=%p: not retrying due to server "
+ "push-back",
+ calld_->chand_, calld_, this);
}
return false;
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: server push-back: retry in %u ms",
- calld->chand_, calld, ms);
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: server push-back: retry in %" PRIu64
+ " ms",
+ calld_->chand_, calld_, this, server_pushback->millis());
}
- server_pushback_ms = static_cast<grpc_millis>(ms);
}
}
- // Do retry.
- call_attempt_->retry_dispatched_ = true;
- calld->DoRetry(server_pushback_ms);
+ // Check with call dispatch controller.
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (!service_config_call_data->call_dispatch_controller()->ShouldRetry()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call dispatch controller denied retry",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ }
+ // We should retry.
return true;
}
+void RetryFilter::CallData::CallAttempt::Abandon() {
+ abandoned_ = true;
+ // Unref batches for deferred completion callbacks that will now never
+ // be invoked.
+ if (started_recv_trailing_metadata_ &&
+ !seen_recv_trailing_metadata_from_surface_) {
+ recv_trailing_metadata_internal_batch_.reset(
+ DEBUG_LOCATION,
+ "unref internal recv_trailing_metadata_ready batch; attempt abandoned");
+ }
+ GRPC_ERROR_UNREF(recv_trailing_metadata_error_);
+ recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ recv_initial_metadata_ready_deferred_batch_.reset(
+ DEBUG_LOCATION,
+ "unref deferred recv_initial_metadata_ready batch; attempt abandoned");
+ GRPC_ERROR_UNREF(recv_initial_metadata_error_);
+ recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ recv_message_ready_deferred_batch_.reset(
+ DEBUG_LOCATION,
+ "unref deferred recv_message_ready batch; attempt abandoned");
+ GRPC_ERROR_UNREF(recv_message_error_);
+ recv_message_error_ = GRPC_ERROR_NONE;
+ for (auto& on_complete_deferred_batch : on_complete_deferred_batches_) {
+ on_complete_deferred_batch.batch.reset(
+ DEBUG_LOCATION, "unref deferred on_complete batch; attempt abandoned");
+ GRPC_ERROR_UNREF(on_complete_deferred_batch.error);
+ }
+ on_complete_deferred_batches_.clear();
+}
+
+void RetryFilter::CallData::CallAttempt::OnPerAttemptRecvTimer(
+ void* arg, grpc_error_handle error) {
+ auto* call_attempt = static_cast<CallAttempt*>(arg);
+ GRPC_CLOSURE_INIT(&call_attempt->on_per_attempt_recv_timer_,
+ OnPerAttemptRecvTimerLocked, call_attempt, nullptr);
+ GRPC_CALL_COMBINER_START(call_attempt->calld_->call_combiner_,
+ &call_attempt->on_per_attempt_recv_timer_,
+ GRPC_ERROR_REF(error), "per-attempt timer fired");
+}
+
+void RetryFilter::CallData::CallAttempt::OnPerAttemptRecvTimerLocked(
+ void* arg, grpc_error_handle error) {
+ auto* call_attempt = static_cast<CallAttempt*>(arg);
+ auto* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: perAttemptRecvTimeout timer fired: "
+ "error=%s, per_attempt_recv_timer_pending_=%d",
+ calld->chand_, calld, call_attempt,
+ grpc_error_std_string(error).c_str(),
+ call_attempt->per_attempt_recv_timer_pending_);
+ }
+ CallCombinerClosureList closures;
+ if (error == GRPC_ERROR_NONE &&
+ call_attempt->per_attempt_recv_timer_pending_) {
+ call_attempt->per_attempt_recv_timer_pending_ = false;
+ // Cancel this attempt.
+ // TODO(roth): When implementing hedging, we should not cancel the
+ // current attempt.
+ call_attempt->MaybeAddBatchForCancelOp(
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "retry perAttemptRecvTimeout exceeded"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED),
+ &closures);
+ // Check whether we should retry.
+ if (call_attempt->ShouldRetry(/*status=*/absl::nullopt,
+ /*server_pushback_ms=*/absl::nullopt)) {
+ // Mark current attempt as abandoned.
+ call_attempt->Abandon();
+ // We are retrying. Start backoff timer.
+ calld->StartRetryTimer(/*server_pushback=*/absl::nullopt);
+ } else {
+ // Not retrying, so commit the call.
+ calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
+ }
+ }
+ closures.RunClosures(calld->call_combiner_);
+ call_attempt->Unref(DEBUG_LOCATION, "OnPerAttemptRecvTimer");
+ GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnPerAttemptRecvTimer");
+}
+
+void RetryFilter::CallData::CallAttempt::MaybeCancelPerAttemptRecvTimer() {
+ if (per_attempt_recv_timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: cancelling "
+ "perAttemptRecvTimeout timer",
+ calld_->chand_, calld_, this);
+ }
+ per_attempt_recv_timer_pending_ = false;
+ grpc_timer_cancel(&per_attempt_recv_timer_);
+ }
+}
+
+//
+// RetryFilter::CallData::CallAttempt::BatchData
+//
+
+RetryFilter::CallData::CallAttempt::BatchData::BatchData(
+ RefCountedPtr<CallAttempt> attempt, int refcount, bool set_on_complete)
+ : RefCounted(
+ GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "BatchData" : nullptr,
+ refcount),
+ call_attempt_(std::move(attempt)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: creating batch %p",
+ call_attempt_->calld_->chand_, call_attempt_->calld_,
+ call_attempt_.get(), this);
+ }
+ // We hold a ref to the call stack for every batch sent on a call attempt.
+ // This is because some batches on the call attempt may not complete
+ // until after all of the batches are completed at the surface (because
+ // each batch that is pending at the surface holds a ref). This
+ // can happen for replayed send ops, and it can happen for
+ // recv_initial_metadata and recv_message ops on a call attempt that has
+ // been abandoned.
+ GRPC_CALL_STACK_REF(call_attempt_->calld_->owning_call_, "Retry BatchData");
+ batch_.payload = &call_attempt_->batch_payload_;
+ if (set_on_complete) {
+ GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this, nullptr);
+ batch_.on_complete = &on_complete_;
+ }
+}
+
+RetryFilter::CallData::CallAttempt::BatchData::~BatchData() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying batch %p",
+ call_attempt_->calld_->chand_, call_attempt_->calld_,
+ call_attempt_.get(), this);
+ }
+ GRPC_CALL_STACK_UNREF(call_attempt_->calld_->owning_call_, "Retry BatchData");
+ call_attempt_.reset(DEBUG_LOCATION, "~BatchData");
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ FreeCachedSendOpDataForCompletedBatch() {
+ auto* calld = call_attempt_->calld_;
+ // TODO(roth): When we implement hedging, this logic will need to get
+ // a bit more complex, because there may be other (now abandoned) call
+ // attempts still using this data. We may need to do some sort of
+ // ref-counting instead.
+ if (batch_.send_initial_metadata) {
+ calld->FreeCachedSendInitialMetadata();
+ }
+ if (batch_.send_message) {
+ calld->FreeCachedSendMessage(call_attempt_->completed_send_message_count_ -
+ 1);
+ }
+ if (batch_.send_trailing_metadata) {
+ calld->FreeCachedSendTrailingMetadata();
+ }
+}
+
//
// recv_initial_metadata callback handling
//
void RetryFilter::CallData::CallAttempt::BatchData::
- InvokeRecvInitialMetadataCallback(void* arg, grpc_error_handle error) {
- auto* batch_data = static_cast<CallAttempt::BatchData*>(arg);
- auto* call_attempt = batch_data->call_attempt_.get();
+ MaybeAddClosureForRecvInitialMetadataCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
// Find pending batch.
- PendingBatch* pending = call_attempt->calld_->PendingBatchFind(
+ PendingBatch* pending = call_attempt_->calld_->PendingBatchFind(
"invoking recv_initial_metadata_ready for",
[](grpc_transport_stream_op_batch* batch) {
return batch->recv_initial_metadata &&
batch->payload->recv_initial_metadata
.recv_initial_metadata_ready != nullptr;
});
- GPR_ASSERT(pending != nullptr);
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
// Return metadata.
- grpc_metadata_batch_move(
- &call_attempt->recv_initial_metadata_,
- pending->batch->payload->recv_initial_metadata.recv_initial_metadata);
+ *pending->batch->payload->recv_initial_metadata.recv_initial_metadata =
+ std::move(call_attempt_->recv_initial_metadata_);
+ // Propagate trailing_metadata_available.
+ *pending->batch->payload->recv_initial_metadata.trailing_metadata_available =
+ call_attempt_->trailing_metadata_available_;
// Update bookkeeping.
// Note: Need to do this before invoking the callback, since invoking
// the callback will result in yielding the call combiner.
@@ -1092,33 +1386,36 @@ void RetryFilter::CallData::CallAttempt::BatchData::
.recv_initial_metadata_ready;
pending->batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
nullptr;
- call_attempt->calld_->MaybeClearPendingBatch(pending);
- batch_data->Unref();
- // Invoke callback.
- Closure::Run(DEBUG_LOCATION, recv_initial_metadata_ready,
- GRPC_ERROR_REF(error));
+ call_attempt_->calld_->MaybeClearPendingBatch(pending);
+ // Add callback to closures.
+ closures->Add(recv_initial_metadata_ready, error,
+ "recv_initial_metadata_ready for pending batch");
}
void RetryFilter::CallData::CallAttempt::BatchData::RecvInitialMetadataReady(
void* arg, grpc_error_handle error) {
- CallAttempt::BatchData* batch_data =
- static_cast<CallAttempt::BatchData*>(arg);
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_.get();
CallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: got recv_initial_metadata_ready, error=%s",
- calld->chand_, calld, grpc_error_std_string(error).c_str());
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_initial_metadata_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
}
call_attempt->completed_recv_initial_metadata_ = true;
- // If a retry was already dispatched, then we're not going to use the
+ // If this attempt has been abandoned, then we're not going to use the
// result of this recv_initial_metadata op, so do nothing.
- if (call_attempt->retry_dispatched_) {
+ if (call_attempt->abandoned_) {
GRPC_CALL_COMBINER_STOP(
calld->call_combiner_,
- "recv_initial_metadata_ready after retry dispatched");
+ "recv_initial_metadata_ready for abandoned attempt");
return;
}
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
+ // If we're not committed, check the response to see if we need to commit.
if (!calld->retry_committed_) {
// If we got an error or a Trailers-Only response and have not yet gotten
// the recv_trailing_metadata_ready callback, then defer propagating this
@@ -1129,82 +1426,99 @@ void RetryFilter::CallData::CallAttempt::BatchData::RecvInitialMetadataReady(
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: deferring recv_initial_metadata_ready "
- "(Trailers-Only)",
- calld->chand_, calld);
+ "chand=%p calld=%p attempt=%p: deferring "
+ "recv_initial_metadata_ready (Trailers-Only)",
+ calld->chand_, calld, call_attempt);
}
- call_attempt->recv_initial_metadata_ready_deferred_batch_ = batch_data;
+ call_attempt->recv_initial_metadata_ready_deferred_batch_ =
+ std::move(batch_data);
call_attempt->recv_initial_metadata_error_ = GRPC_ERROR_REF(error);
+ CallCombinerClosureList closures;
+ if (error != GRPC_ERROR_NONE) {
+ call_attempt->MaybeAddBatchForCancelOp(GRPC_ERROR_REF(error),
+ &closures);
+ }
if (!call_attempt->started_recv_trailing_metadata_) {
// recv_trailing_metadata not yet started by application; start it
// ourselves to get status.
- call_attempt->StartInternalRecvTrailingMetadata();
- } else {
- GRPC_CALL_COMBINER_STOP(
- calld->call_combiner_,
- "recv_initial_metadata_ready trailers-only or error");
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
}
+ closures.RunClosures(calld->call_combiner_);
return;
}
// Received valid initial metadata, so commit the call.
calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
}
// Invoke the callback to return the result to the surface.
- // Manually invoking a callback function; it does not take ownership of error.
- InvokeRecvInitialMetadataCallback(batch_data, error);
+ CallCombinerClosureList closures;
+ batch_data->MaybeAddClosureForRecvInitialMetadataCallback(
+ GRPC_ERROR_REF(error), &closures);
+ closures.RunClosures(calld->call_combiner_);
}
//
// recv_message callback handling
//
-void RetryFilter::CallData::CallAttempt::BatchData::InvokeRecvMessageCallback(
- void* arg, grpc_error_handle error) {
- CallAttempt::BatchData* batch_data =
- static_cast<CallAttempt::BatchData*>(arg);
- CallAttempt* call_attempt = batch_data->call_attempt_.get();
- CallData* calld = call_attempt->calld_;
+void RetryFilter::CallData::CallAttempt::BatchData::
+ MaybeAddClosureForRecvMessageCallback(grpc_error_handle error,
+ CallCombinerClosureList* closures) {
// Find pending op.
- PendingBatch* pending = calld->PendingBatchFind(
+ PendingBatch* pending = call_attempt_->calld_->PendingBatchFind(
"invoking recv_message_ready for",
[](grpc_transport_stream_op_batch* batch) {
return batch->recv_message &&
batch->payload->recv_message.recv_message_ready != nullptr;
});
- GPR_ASSERT(pending != nullptr);
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
// Return payload.
*pending->batch->payload->recv_message.recv_message =
- std::move(call_attempt->recv_message_);
+ std::move(call_attempt_->recv_message_);
// Update bookkeeping.
// Note: Need to do this before invoking the callback, since invoking
// the callback will result in yielding the call combiner.
grpc_closure* recv_message_ready =
pending->batch->payload->recv_message.recv_message_ready;
pending->batch->payload->recv_message.recv_message_ready = nullptr;
- calld->MaybeClearPendingBatch(pending);
- batch_data->Unref();
- // Invoke callback.
- Closure::Run(DEBUG_LOCATION, recv_message_ready, GRPC_ERROR_REF(error));
+ call_attempt_->calld_->MaybeClearPendingBatch(pending);
+ // Add callback to closures.
+ closures->Add(recv_message_ready, error,
+ "recv_message_ready for pending batch");
}
void RetryFilter::CallData::CallAttempt::BatchData::RecvMessageReady(
void* arg, grpc_error_handle error) {
- CallAttempt::BatchData* batch_data =
- static_cast<CallAttempt::BatchData*>(arg);
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_.get();
CallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: got recv_message_ready, error=%s",
- calld->chand_, calld, grpc_error_std_string(error).c_str());
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_message_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
}
++call_attempt->completed_recv_message_count_;
- // If a retry was already dispatched, then we're not going to use the
+ // If this attempt has been abandoned, then we're not going to use the
// result of this recv_message op, so do nothing.
- if (call_attempt->retry_dispatched_) {
+ if (call_attempt->abandoned_) {
+ // The transport will not invoke recv_trailing_metadata_ready until the byte
+ // stream for any recv_message op is orphaned, so we do that here to ensure
+ // that any pending recv_trailing_metadata op can complete.
+ call_attempt->recv_message_.reset();
GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
- "recv_message_ready after retry dispatched");
+ "recv_message_ready for abandoned attempt");
return;
}
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
+ // If we're not committed, check the response to see if we need to commit.
if (!calld->retry_committed_) {
// If we got an error or the payload was nullptr and we have not yet gotten
// the recv_trailing_metadata_ready callback, then defer propagating this
@@ -1215,28 +1529,36 @@ void RetryFilter::CallData::CallAttempt::BatchData::RecvMessageReady(
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: deferring recv_message_ready (nullptr "
- "message and recv_trailing_metadata pending)",
- calld->chand_, calld);
+ "chand=%p calld=%p attempt=%p: deferring recv_message_ready "
+ "(nullptr message and recv_trailing_metadata pending)",
+ calld->chand_, calld, call_attempt);
}
- call_attempt->recv_message_ready_deferred_batch_ = batch_data;
+ call_attempt->recv_message_ready_deferred_batch_ = std::move(batch_data);
call_attempt->recv_message_error_ = GRPC_ERROR_REF(error);
+ CallCombinerClosureList closures;
+ if (error != GRPC_ERROR_NONE) {
+ call_attempt->MaybeAddBatchForCancelOp(GRPC_ERROR_REF(error),
+ &closures);
+ }
if (!call_attempt->started_recv_trailing_metadata_) {
// recv_trailing_metadata not yet started by application; start it
// ourselves to get status.
- call_attempt->StartInternalRecvTrailingMetadata();
- } else {
- GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
- "recv_message_ready null");
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
}
+ closures.RunClosures(calld->call_combiner_);
return;
}
// Received a valid message, so commit the call.
calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
}
// Invoke the callback to return the result to the surface.
- // Manually invoking a callback function; it does not take ownership of error.
- InvokeRecvMessageCallback(batch_data, error);
+ CallCombinerClosureList closures;
+ batch_data->MaybeAddClosureForRecvMessageCallback(GRPC_ERROR_REF(error),
+ &closures);
+ closures.RunClosures(calld->call_combiner_);
}
//
@@ -1245,11 +1567,13 @@ void RetryFilter::CallData::CallAttempt::BatchData::RecvMessageReady(
namespace {
-// Sets *status, *server_pushback_md, and *is_lb_drop based on md_batch
+// Sets *status, *server_pushback, and *is_lb_drop based on md_batch
// and error.
-void GetCallStatus(grpc_millis deadline, grpc_metadata_batch* md_batch,
- grpc_error_handle error, grpc_status_code* status,
- grpc_mdelem** server_pushback_md, bool* is_lb_drop) {
+void GetCallStatus(
+ Timestamp deadline, grpc_metadata_batch* md_batch, grpc_error_handle error,
+ grpc_status_code* status, absl::optional<Duration>* server_pushback,
+ bool* is_lb_drop,
+ absl::optional<GrpcStreamNetworkState::ValueType>* stream_network_state) {
if (error != GRPC_ERROR_NONE) {
grpc_error_get_status(error, deadline, status, nullptr, nullptr, nullptr);
intptr_t value = 0;
@@ -1258,40 +1582,41 @@ void GetCallStatus(grpc_millis deadline, grpc_metadata_batch* md_batch,
*is_lb_drop = true;
}
} else {
- GPR_ASSERT(md_batch->idx.named.grpc_status != nullptr);
- *status =
- grpc_get_status_code_from_metadata(md_batch->idx.named.grpc_status->md);
- if (md_batch->idx.named.grpc_retry_pushback_ms != nullptr) {
- *server_pushback_md = &md_batch->idx.named.grpc_retry_pushback_ms->md;
- }
+ *status = *md_batch->get(GrpcStatusMetadata());
}
+ *server_pushback = md_batch->get(GrpcRetryPushbackMsMetadata());
+ *stream_network_state = md_batch->get(GrpcStreamNetworkState());
GRPC_ERROR_UNREF(error);
}
} // namespace
void RetryFilter::CallData::CallAttempt::BatchData::
- AddClosureForRecvTrailingMetadataReady(grpc_error_handle error,
- CallCombinerClosureList* closures) {
+ MaybeAddClosureForRecvTrailingMetadataReady(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
auto* calld = call_attempt_->calld_;
// Find pending batch.
PendingBatch* pending = calld->PendingBatchFind(
- "invoking recv_trailing_metadata for",
+ "invoking recv_trailing_metadata_ready for",
[](grpc_transport_stream_op_batch* batch) {
return batch->recv_trailing_metadata &&
batch->payload->recv_trailing_metadata
.recv_trailing_metadata_ready != nullptr;
});
// If we generated the recv_trailing_metadata op internally via
- // StartInternalRecvTrailingMetadata(), then there will be no pending batch.
+ // AddBatchForInternalRecvTrailingMetadata(), then there will be no
+ // pending batch.
if (pending == nullptr) {
- GRPC_ERROR_UNREF(error);
+ call_attempt_->recv_trailing_metadata_error_ = error;
return;
}
+ // Copy transport stats to be delivered up to the surface.
+ grpc_transport_move_stats(
+ &call_attempt_->collect_stats_,
+ pending->batch->payload->recv_trailing_metadata.collect_stats);
// Return metadata.
- grpc_metadata_batch_move(
- &call_attempt_->recv_trailing_metadata_,
- pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata);
+ *pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata =
+ std::move(call_attempt_->recv_trailing_metadata_);
// Add closure.
closures->Add(pending->batch->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
@@ -1303,35 +1628,34 @@ void RetryFilter::CallData::CallAttempt::BatchData::
}
void RetryFilter::CallData::CallAttempt::BatchData::
- AddClosuresForDeferredRecvCallbacks(CallCombinerClosureList* closures) {
- if (batch_.recv_trailing_metadata) {
- // Add closure for deferred recv_initial_metadata_ready.
- if (GPR_UNLIKELY(
- call_attempt_->recv_initial_metadata_ready_deferred_batch_ !=
- nullptr)) {
- GRPC_CLOSURE_INIT(
- &call_attempt_->recv_initial_metadata_ready_,
- InvokeRecvInitialMetadataCallback,
- call_attempt_->recv_initial_metadata_ready_deferred_batch_,
- grpc_schedule_on_exec_ctx);
- closures->Add(&call_attempt_->recv_initial_metadata_ready_,
- call_attempt_->recv_initial_metadata_error_,
- "resuming recv_initial_metadata_ready");
- call_attempt_->recv_initial_metadata_ready_deferred_batch_ = nullptr;
- }
- // Add closure for deferred recv_message_ready.
- if (GPR_UNLIKELY(call_attempt_->recv_message_ready_deferred_batch_ !=
- nullptr)) {
- GRPC_CLOSURE_INIT(&call_attempt_->recv_message_ready_,
- InvokeRecvMessageCallback,
- call_attempt_->recv_message_ready_deferred_batch_,
- grpc_schedule_on_exec_ctx);
- closures->Add(&call_attempt_->recv_message_ready_,
- call_attempt_->recv_message_error_,
- "resuming recv_message_ready");
- call_attempt_->recv_message_ready_deferred_batch_ = nullptr;
- }
- }
+ AddClosuresForDeferredCompletionCallbacks(
+ CallCombinerClosureList* closures) {
+ // Add closure for deferred recv_initial_metadata_ready.
+ if (GPR_UNLIKELY(call_attempt_->recv_initial_metadata_ready_deferred_batch_ !=
+ nullptr)) {
+ MaybeAddClosureForRecvInitialMetadataCallback(
+ call_attempt_->recv_initial_metadata_error_, closures);
+ call_attempt_->recv_initial_metadata_ready_deferred_batch_.reset(
+ DEBUG_LOCATION, "resuming deferred recv_initial_metadata_ready");
+ call_attempt_->recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ }
+ // Add closure for deferred recv_message_ready.
+ if (GPR_UNLIKELY(call_attempt_->recv_message_ready_deferred_batch_ !=
+ nullptr)) {
+ MaybeAddClosureForRecvMessageCallback(call_attempt_->recv_message_error_,
+ closures);
+ call_attempt_->recv_message_ready_deferred_batch_.reset(
+ DEBUG_LOCATION, "resuming deferred recv_message_ready");
+ call_attempt_->recv_message_error_ = GRPC_ERROR_NONE;
+ }
+ // Add closures for deferred on_complete callbacks.
+ for (auto& on_complete_deferred_batch :
+ call_attempt_->on_complete_deferred_batches_) {
+ closures->Add(&on_complete_deferred_batch.batch->on_complete_,
+ on_complete_deferred_batch.error, "resuming on_complete");
+ on_complete_deferred_batch.batch.release();
+ }
+ call_attempt_->on_complete_deferred_batches_.clear();
}
void RetryFilter::CallData::CallAttempt::BatchData::
@@ -1340,13 +1664,8 @@ void RetryFilter::CallData::CallAttempt::BatchData::
auto* calld = call_attempt_->calld_;
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches_); ++i) {
PendingBatch* pending = &calld->pending_batches_[i];
- if (call_attempt_->PendingBatchIsUnstarted(pending)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: failing unstarted pending batch at "
- "index %" PRIuPTR,
- calld->chand_, calld, i);
- }
+ if (pending->batch == nullptr) continue;
+ if (call_attempt_->PendingBatchContainsUnstartedSendOps(pending)) {
closures->Add(pending->batch->on_complete, GRPC_ERROR_REF(error),
"failing on_complete for pending batch");
pending->batch->on_complete = nullptr;
@@ -1361,62 +1680,114 @@ void RetryFilter::CallData::CallAttempt::BatchData::RunClosuresForCompletedCall(
// Construct list of closures to execute.
CallCombinerClosureList closures;
// First, add closure for recv_trailing_metadata_ready.
- AddClosureForRecvTrailingMetadataReady(GRPC_ERROR_REF(error), &closures);
- // If there are deferred recv_initial_metadata_ready or recv_message_ready
- // callbacks, add them to closures.
- AddClosuresForDeferredRecvCallbacks(&closures);
+ MaybeAddClosureForRecvTrailingMetadataReady(GRPC_ERROR_REF(error), &closures);
+ // If there are deferred batch completion callbacks, add them to closures.
+ AddClosuresForDeferredCompletionCallbacks(&closures);
// Add closures to fail any pending batches that have not yet been started.
AddClosuresToFailUnstartedPendingBatches(GRPC_ERROR_REF(error), &closures);
// Schedule all of the closures identified above.
// Note: This will release the call combiner.
closures.RunClosures(call_attempt_->calld_->call_combiner_);
- // Don't need batch_data anymore.
- Unref();
GRPC_ERROR_UNREF(error);
}
void RetryFilter::CallData::CallAttempt::BatchData::RecvTrailingMetadataReady(
void* arg, grpc_error_handle error) {
- CallAttempt::BatchData* batch_data =
- static_cast<CallAttempt::BatchData*>(arg);
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_.get();
CallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: got recv_trailing_metadata_ready, error=%s",
- calld->chand_, calld, grpc_error_std_string(error).c_str());
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_trailing_metadata_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
}
call_attempt->completed_recv_trailing_metadata_ = true;
+ // If this attempt has been abandoned, then we're not going to use the
+ // result of this recv_trailing_metadata op, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "recv_trailing_metadata_ready for abandoned attempt");
+ return;
+ }
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
// Get the call's status and check for server pushback metadata.
grpc_status_code status = GRPC_STATUS_OK;
- grpc_mdelem* server_pushback_md = nullptr;
+ absl::optional<Duration> server_pushback;
+ bool is_lb_drop = false;
+ absl::optional<GrpcStreamNetworkState::ValueType> stream_network_state;
grpc_metadata_batch* md_batch =
batch_data->batch_.payload->recv_trailing_metadata.recv_trailing_metadata;
- bool is_lb_drop = false;
GetCallStatus(calld->deadline_, md_batch, GRPC_ERROR_REF(error), &status,
- &server_pushback_md, &is_lb_drop);
+ &server_pushback, &is_lb_drop, &stream_network_state);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(
- GPR_INFO, "chand=%p calld=%p: call finished, status=%s is_lb_drop=%d",
- calld->chand_, calld, grpc_status_code_to_string(status), is_lb_drop);
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call finished, status=%s "
+ "server_pushback=%s is_lb_drop=%d stream_network_state=%s",
+ calld->chand_, calld, call_attempt,
+ grpc_status_code_to_string(status),
+ server_pushback.has_value() ? server_pushback->ToString().c_str()
+ : "N/A",
+ is_lb_drop,
+ stream_network_state.has_value()
+ ? absl::StrCat(*stream_network_state).c_str()
+ : "N/A");
}
// Check if we should retry.
- if (batch_data->MaybeRetry(status, server_pushback_md, is_lb_drop)) {
- // Unref batch_data for deferred recv_initial_metadata_ready or
- // recv_message_ready callbacks, if any.
- if (call_attempt->recv_initial_metadata_ready_deferred_batch_ != nullptr) {
- GRPC_ERROR_UNREF(call_attempt->recv_initial_metadata_error_);
- batch_data->Unref();
+ if (!is_lb_drop) { // Never retry on LB drops.
+ enum { kNoRetry, kTransparentRetry, kConfigurableRetry } retry = kNoRetry;
+ // Handle transparent retries.
+ if (stream_network_state.has_value() && !calld->retry_committed_) {
+ // If not sent on wire, then always retry.
+ // If sent on wire but not seen by server, retry exactly once.
+ if (*stream_network_state == GrpcStreamNetworkState::kNotSentOnWire) {
+ retry = kTransparentRetry;
+ } else if (*stream_network_state ==
+ GrpcStreamNetworkState::kNotSeenByServer &&
+ !calld->sent_transparent_retry_not_seen_by_server_) {
+ calld->sent_transparent_retry_not_seen_by_server_ = true;
+ retry = kTransparentRetry;
+ }
}
- if (call_attempt->recv_message_ready_deferred_batch_ != nullptr) {
- GRPC_ERROR_UNREF(call_attempt->recv_message_error_);
- batch_data->Unref();
+ // If not transparently retrying, check for configurable retry.
+ if (retry == kNoRetry &&
+ call_attempt->ShouldRetry(status, server_pushback)) {
+ retry = kConfigurableRetry;
+ }
+ // If we're retrying, do so.
+ if (retry != kNoRetry) {
+ CallCombinerClosureList closures;
+ // Cancel call attempt.
+ call_attempt->MaybeAddBatchForCancelOp(
+ error == GRPC_ERROR_NONE
+ ? grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("call attempt failed"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED)
+ : GRPC_ERROR_REF(error),
+ &closures);
+ // For transparent retries, add a closure to immediately start a new
+ // call attempt.
+ // For configurable retries, start retry timer.
+ if (retry == kTransparentRetry) {
+ calld->AddClosureToStartTransparentRetry(&closures);
+ } else {
+ calld->StartRetryTimer(server_pushback);
+ }
+ // Record that this attempt has been abandoned.
+ call_attempt->Abandon();
+ // Yields call combiner.
+ closures.RunClosures(calld->call_combiner_);
+ return;
}
- batch_data->Unref();
- return;
}
// Not retrying, so commit the call.
calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
// Run any necessary closures.
batch_data->RunClosuresForCompletedCall(GRPC_ERROR_REF(error));
}
@@ -1444,6 +1815,11 @@ void RetryFilter::CallData::CallAttempt::BatchData::
GRPC_ERROR_UNREF(error);
return;
}
+ // Propagate payload.
+ if (batch_.send_message) {
+ pending->batch->payload->send_message.stream_write_closed =
+ batch_.payload->send_message.stream_write_closed;
+ }
// Add closure.
closures->Add(pending->batch->on_complete, error,
"on_complete for pending batch");
@@ -1454,31 +1830,27 @@ void RetryFilter::CallData::CallAttempt::BatchData::
void RetryFilter::CallData::CallAttempt::BatchData::
AddClosuresForReplayOrPendingSendOps(CallCombinerClosureList* closures) {
auto* calld = call_attempt_->calld_;
+ bool have_pending_send_ops = call_attempt_->HaveSendOpsToReplay();
// We don't check send_initial_metadata here, because that op will always
// be started as soon as it is received from the surface, so it will
// never need to be started at this point.
- bool have_pending_send_message_ops =
- call_attempt_->started_send_message_count_ < calld->send_messages_.size();
- bool have_pending_send_trailing_metadata_op =
- calld->seen_send_trailing_metadata_ &&
- !call_attempt_->started_send_trailing_metadata_;
- if (!have_pending_send_message_ops &&
- !have_pending_send_trailing_metadata_op) {
+ if (!have_pending_send_ops) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches_); ++i) {
PendingBatch* pending = &calld->pending_batches_[i];
grpc_transport_stream_op_batch* batch = pending->batch;
if (batch == nullptr || pending->send_ops_cached) continue;
- if (batch->send_message) have_pending_send_message_ops = true;
- if (batch->send_trailing_metadata) {
- have_pending_send_trailing_metadata_op = true;
+ if (batch->send_message || batch->send_trailing_metadata) {
+ have_pending_send_ops = true;
+ break;
}
}
}
- if (have_pending_send_message_ops || have_pending_send_trailing_metadata_op) {
+ if (have_pending_send_ops) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand=%p calld=%p: starting next batch for pending send op(s)",
- calld->chand_, calld);
+ "chand=%p calld=%p attempt=%p: starting next batch for pending "
+ "send op(s)",
+ calld->chand_, calld, call_attempt_.get());
}
call_attempt_->AddRetriableBatches(closures);
}
@@ -1486,15 +1858,46 @@ void RetryFilter::CallData::CallAttempt::BatchData::
void RetryFilter::CallData::CallAttempt::BatchData::OnComplete(
void* arg, grpc_error_handle error) {
- CallAttempt::BatchData* batch_data =
- static_cast<CallAttempt::BatchData*>(arg);
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_.get();
CallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: got on_complete, error=%s, batch=%s",
- calld->chand_, calld, grpc_error_std_string(error).c_str(),
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got on_complete, error=%s, batch=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str(),
grpc_transport_stream_op_batch_string(&batch_data->batch_).c_str());
}
+ // If this attempt has been abandoned, then we're not going to propagate
+ // the completion of this batch, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "on_complete for abandoned attempt");
+ return;
+ }
+ // If we got an error and have not yet gotten the
+ // recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
+ if (GPR_UNLIKELY(!calld->retry_committed_ && error != GRPC_ERROR_NONE &&
+ !call_attempt->completed_recv_trailing_metadata_)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring on_complete",
+ calld->chand_, calld, call_attempt);
+ }
+ call_attempt->on_complete_deferred_batches_.emplace_back(
+ std::move(batch_data), GRPC_ERROR_REF(error));
+ CallCombinerClosureList closures;
+ call_attempt->MaybeAddBatchForCancelOp(GRPC_ERROR_REF(error), &closures);
+ if (!call_attempt->started_recv_trailing_metadata_) {
+ // recv_trailing_metadata not yet started by application; start it
+ // ourselves to get status.
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
+ }
+ closures.RunClosures(calld->call_combiner_);
+ return;
+ }
// Update bookkeeping in call_attempt.
if (batch_data->batch_.send_initial_metadata) {
call_attempt->completed_send_initial_metadata_ = true;
@@ -1512,33 +1915,39 @@ void RetryFilter::CallData::CallAttempt::BatchData::OnComplete(
}
// Construct list of closures to execute.
CallCombinerClosureList closures;
- // If a retry was already dispatched, that means we saw
- // recv_trailing_metadata before this, so we do nothing here.
- // Otherwise, invoke the callback to return the result to the surface.
- if (!call_attempt->retry_dispatched_) {
- // Add closure for the completed pending batch, if any.
- batch_data->AddClosuresForCompletedPendingBatch(GRPC_ERROR_REF(error),
- &closures);
- // If needed, add a callback to start any replay or pending send ops on
- // the LB call.
- if (!call_attempt->completed_recv_trailing_metadata_) {
- batch_data->AddClosuresForReplayOrPendingSendOps(&closures);
- }
- }
- // Track number of in-flight send batches and determine if this was the
- // last one.
- --calld->num_in_flight_call_attempt_send_batches_;
- const bool last_send_batch_complete =
- calld->num_in_flight_call_attempt_send_batches_ == 0;
- // Don't need batch_data anymore.
- batch_data->Unref();
+ // Add closure for the completed pending batch, if any.
+ batch_data->AddClosuresForCompletedPendingBatch(GRPC_ERROR_REF(error),
+ &closures);
+ // If needed, add a callback to start any replay or pending send ops on
+ // the LB call.
+ if (!call_attempt->completed_recv_trailing_metadata_) {
+ batch_data->AddClosuresForReplayOrPendingSendOps(&closures);
+ }
+ // If retry state is no longer needed (i.e., we're committed and there
+ // are no more send ops to replay), switch to fast path for subsequent
+ // batches.
+ call_attempt->MaybeSwitchToFastPath();
// Schedule all of the closures identified above.
// Note: This yields the call combiner.
closures.RunClosures(calld->call_combiner_);
- // If this was the last in-flight send batch, unref the call stack.
- if (last_send_batch_complete) {
- GRPC_CALL_STACK_UNREF(calld->owning_call_, "retriable_send_batches");
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::OnCompleteForCancelOp(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got on_complete for cancel_stream batch, error=%s, batch=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str(),
+ grpc_transport_stream_op_batch_string(&batch_data->batch_).c_str());
}
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "on_complete for internally generated cancel_stream op");
}
//
@@ -1548,42 +1957,19 @@ void RetryFilter::CallData::CallAttempt::BatchData::OnComplete(
void RetryFilter::CallData::CallAttempt::BatchData::
AddRetriableSendInitialMetadataOp() {
auto* calld = call_attempt_->calld_;
- // Maps the number of retries to the corresponding metadata value slice.
- const grpc_slice* retry_count_strings[] = {&GRPC_MDSTR_1, &GRPC_MDSTR_2,
- &GRPC_MDSTR_3, &GRPC_MDSTR_4};
// We need to make a copy of the metadata batch for each attempt, since
// the filters in the subchannel stack may modify this batch, and we don't
// want those modifications to be passed forward to subsequent attempts.
//
// If we've already completed one or more attempts, add the
// grpc-retry-attempts header.
- call_attempt_->send_initial_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(
- calld->arena_->Alloc(sizeof(grpc_linked_mdelem) *
- (calld->send_initial_metadata_.list.count +
- (calld->num_attempts_completed_ > 0))));
- grpc_metadata_batch_copy(&calld->send_initial_metadata_,
- &call_attempt_->send_initial_metadata_,
- call_attempt_->send_initial_metadata_storage_);
- if (GPR_UNLIKELY(call_attempt_->send_initial_metadata_.idx.named
- .grpc_previous_rpc_attempts != nullptr)) {
- grpc_metadata_batch_remove(&call_attempt_->send_initial_metadata_,
- GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
- }
+ call_attempt_->send_initial_metadata_ = calld->send_initial_metadata_.Copy();
if (GPR_UNLIKELY(calld->num_attempts_completed_ > 0)) {
- grpc_mdelem retry_md = grpc_mdelem_create(
- GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS,
- *retry_count_strings[calld->num_attempts_completed_ - 1], nullptr);
- grpc_error_handle error = grpc_metadata_batch_add_tail(
- &call_attempt_->send_initial_metadata_,
- &call_attempt_->send_initial_metadata_storage_
- [calld->send_initial_metadata_.list.count],
- retry_md, GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- gpr_log(GPR_ERROR, "error adding retry metadata: %s",
- grpc_error_std_string(error).c_str());
- GPR_ASSERT(false);
- }
+ call_attempt_->send_initial_metadata_.Set(GrpcPreviousRpcAttemptsMetadata(),
+ calld->num_attempts_completed_);
+ } else {
+ call_attempt_->send_initial_metadata_.Remove(
+ GrpcPreviousRpcAttemptsMetadata());
}
call_attempt_->started_send_initial_metadata_ = true;
batch_.send_initial_metadata = true;
@@ -1598,9 +1984,12 @@ void RetryFilter::CallData::CallAttempt::BatchData::
AddRetriableSendMessageOp() {
auto* calld = call_attempt_->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: starting calld->send_messages[%" PRIuPTR "]",
- calld->chand_, calld, call_attempt_->started_send_message_count_);
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: starting calld->send_messages[%" PRIuPTR
+ "]",
+ calld->chand_, calld, call_attempt_.get(),
+ call_attempt_->started_send_message_count_);
}
ByteStreamCache* cache =
calld->send_messages_[call_attempt_->started_send_message_count_];
@@ -1617,13 +2006,8 @@ void RetryFilter::CallData::CallAttempt::BatchData::
// We need to make a copy of the metadata batch for each attempt, since
// the filters in the subchannel stack may modify this batch, and we don't
// want those modifications to be passed forward to subsequent attempts.
- call_attempt_->send_trailing_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(
- calld->arena_->Alloc(sizeof(grpc_linked_mdelem) *
- calld->send_trailing_metadata_.list.count));
- grpc_metadata_batch_copy(&calld->send_trailing_metadata_,
- &call_attempt_->send_trailing_metadata_,
- call_attempt_->send_trailing_metadata_storage_);
+ call_attempt_->send_trailing_metadata_ =
+ calld->send_trailing_metadata_.Copy();
call_attempt_->started_send_trailing_metadata_ = true;
batch_.send_trailing_metadata = true;
batch_.payload->send_trailing_metadata.send_trailing_metadata =
@@ -1634,7 +2018,7 @@ void RetryFilter::CallData::CallAttempt::BatchData::
AddRetriableRecvInitialMetadataOp() {
call_attempt_->started_recv_initial_metadata_ = true;
batch_.recv_initial_metadata = true;
- grpc_metadata_batch_init(&call_attempt_->recv_initial_metadata_);
+ call_attempt_->recv_initial_metadata_.Clear();
batch_.payload->recv_initial_metadata.recv_initial_metadata =
&call_attempt_->recv_initial_metadata_;
batch_.payload->recv_initial_metadata.trailing_metadata_available =
@@ -1650,6 +2034,7 @@ void RetryFilter::CallData::CallAttempt::BatchData::
++call_attempt_->started_recv_message_count_;
batch_.recv_message = true;
batch_.payload->recv_message.recv_message = &call_attempt_->recv_message_;
+ batch_.payload->recv_message.call_failed_before_recv_message = nullptr;
GRPC_CLOSURE_INIT(&call_attempt_->recv_message_ready_, RecvMessageReady, this,
grpc_schedule_on_exec_ctx);
batch_.payload->recv_message.recv_message_ready =
@@ -1660,7 +2045,7 @@ void RetryFilter::CallData::CallAttempt::BatchData::
AddRetriableRecvTrailingMetadataOp() {
call_attempt_->started_recv_trailing_metadata_ = true;
batch_.recv_trailing_metadata = true;
- grpc_metadata_batch_init(&call_attempt_->recv_trailing_metadata_);
+ call_attempt_->recv_trailing_metadata_.Clear();
batch_.payload->recv_trailing_metadata.recv_trailing_metadata =
&call_attempt_->recv_trailing_metadata_;
batch_.payload->recv_trailing_metadata.collect_stats =
@@ -1671,6 +2056,14 @@ void RetryFilter::CallData::CallAttempt::BatchData::
&call_attempt_->recv_trailing_metadata_ready_;
}
+void RetryFilter::CallData::CallAttempt::BatchData::AddCancelStreamOp(
+ grpc_error_handle error) {
+ batch_.cancel_stream = true;
+ batch_.payload->cancel_stream.cancel_error = error;
+ // Override on_complete callback.
+ GRPC_CLOSURE_INIT(&on_complete_, OnCompleteForCancelOp, this, nullptr);
+}
+
//
// CallData vtable functions
//
@@ -1680,7 +2073,8 @@ grpc_error_handle RetryFilter::CallData::Init(
auto* chand = static_cast<RetryFilter*>(elem->channel_data);
new (elem->call_data) CallData(chand, *args);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p: created call=%p", chand, elem->call_data);
+ gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand,
+ elem->call_data);
}
return GRPC_ERROR_NONE;
}
@@ -1718,35 +2112,34 @@ void RetryFilter::CallData::SetPollent(grpc_call_element* elem,
// CallData implementation
//
-const RetryMethodConfig* GetRetryPolicy(
+const RetryMethodConfig* RetryFilter::GetRetryPolicy(
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 RetryMethodConfig*>(
- svc_cfg_call_data->GetMethodParsedConfig(
- RetryServiceConfigParser::ParserIndex()));
+ svc_cfg_call_data->GetMethodParsedConfig(service_config_parser_index_));
}
RetryFilter::CallData::CallData(RetryFilter* chand,
const grpc_call_element_args& args)
: chand_(chand),
retry_throttle_data_(chand->retry_throttle_data_),
- retry_policy_(GetRetryPolicy(args.context)),
+ retry_policy_(chand->GetRetryPolicy(args.context)),
retry_backoff_(
BackOff::Options()
.set_initial_backoff(retry_policy_ == nullptr
- ? 0
+ ? Duration::Zero()
: retry_policy_->initial_backoff())
.set_multiplier(retry_policy_ == nullptr
? 0
: retry_policy_->backoff_multiplier())
.set_jitter(RETRY_BACKOFF_JITTER)
- .set_max_backoff(
- retry_policy_ == nullptr ? 0 : retry_policy_->max_backoff())),
+ .set_max_backoff(retry_policy_ == nullptr
+ ? Duration::Zero()
+ : retry_policy_->max_backoff())),
path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
deadline_(args.deadline),
arena_(args.arena),
owning_call_(args.call_stack),
@@ -1758,56 +2151,114 @@ RetryFilter::CallData::CallData(RetryFilter* chand,
pending_send_message_(false),
pending_send_trailing_metadata_(false),
retry_committed_(false),
- last_attempt_got_server_pushback_(false) {}
+ retry_timer_pending_(false),
+ retry_codepath_started_(false),
+ sent_transparent_retry_not_seen_by_server_(false) {}
RetryFilter::CallData::~CallData() {
+ FreeAllCachedSendOpData();
grpc_slice_unref_internal(path_);
// Make sure there are no remaining pending batches.
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
GPR_ASSERT(pending_batches_[i].batch == nullptr);
}
+ GRPC_ERROR_UNREF(cancelled_from_surface_);
}
void RetryFilter::CallData::StartTransportStreamOpBatch(
grpc_transport_stream_op_batch* batch) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) &&
+ !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from surface: %s",
+ chand_, this, grpc_transport_stream_op_batch_string(batch).c_str());
+ }
// If we have an LB call, delegate to the LB call.
if (committed_call_ != nullptr) {
// Note: This will release the call combiner.
committed_call_->StartTransportStreamOpBatch(batch);
return;
}
+ // If we were previously cancelled from the surface, fail this
+ // batch immediately.
+ if (cancelled_from_surface_ != GRPC_ERROR_NONE) {
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancelled_from_surface_), call_combiner_);
+ return;
+ }
// Handle cancellation.
if (GPR_UNLIKELY(batch->cancel_stream)) {
- grpc_error_handle cancel_error = batch->payload->cancel_stream.cancel_error;
+ // Save cancel_error in case subsequent batches are started.
+ GRPC_ERROR_UNREF(cancelled_from_surface_);
+ cancelled_from_surface_ =
+ GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: cancelled from surface: %s", chand_,
- this, grpc_error_std_string(cancel_error).c_str());
+ this, grpc_error_std_string(cancelled_from_surface_).c_str());
}
+ // Fail any pending batches.
+ PendingBatchesFail(GRPC_ERROR_REF(cancelled_from_surface_));
// If we have a current call attempt, commit the call, then send
// the cancellation down to that attempt. When the call fails, it
// will not be retried, because we have committed it here.
if (call_attempt_ != nullptr) {
RetryCommit(call_attempt_.get());
+ // TODO(roth): When implementing hedging, this will get more
+ // complex, because instead of just passing the batch down to a
+ // single call attempt, we'll need to cancel multiple call
+ // attempts and wait for the cancellation on_complete from each call
+ // attempt before we propagate the on_complete from this batch
+ // back to the surface.
// Note: This will release the call combiner.
- call_attempt_->lb_call()->StartTransportStreamOpBatch(batch);
+ call_attempt_->CancelFromSurface(batch);
return;
}
- // Fail pending batches.
- PendingBatchesFail(GRPC_ERROR_REF(cancel_error));
+ // Cancel retry timer if needed.
+ if (retry_timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling retry timer", chand_,
+ this);
+ }
+ retry_timer_pending_ = false; // Lame timer callback.
+ grpc_timer_cancel(&retry_timer_);
+ FreeAllCachedSendOpData();
+ }
+ // We have no call attempt, so there's nowhere to send the cancellation
+ // batch. Return it back to the surface immediately.
// Note: This will release the call combiner.
grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error), call_combiner_);
+ batch, GRPC_ERROR_REF(cancelled_from_surface_), call_combiner_);
return;
}
// Add the batch to the pending list.
PendingBatch* pending = PendingBatchesAdd(batch);
+ // If the timer is pending, yield the call combiner and wait for it to
+ // run, since we don't want to start another call attempt until it does.
+ if (retry_timer_pending_) {
+ GRPC_CALL_COMBINER_STOP(call_combiner_,
+ "added pending batch while retry timer pending");
+ return;
+ }
+ // If we do not yet have a call attempt, create one.
if (call_attempt_ == nullptr) {
// If this is the first batch and retries are already committed
// (e.g., if this batch put the call above the buffer size limit), then
// immediately create an LB call and delegate the batch to it. This
// avoids the overhead of unnecessarily allocating a CallAttempt
// object or caching any of the send op data.
- if (num_attempts_completed_ == 0 && retry_committed_) {
+ // Note that we would ideally like to do this also on subsequent
+ // attempts (e.g., if a batch puts the call above the buffer size
+ // limit since the last attempt was complete), but in practice that's
+ // not really worthwhile, because we will almost always have cached and
+ // completed at least the send_initial_metadata op on the previous
+ // attempt, which means that we'd need special logic to replay the
+ // batch anyway, which is exactly what the CallAttempt object provides.
+ // We also skip this optimization if perAttemptRecvTimeout is set in the
+ // retry policy, because we need the code in CallAttempt to handle
+ // the associated timer.
+ if (!retry_codepath_started_ && retry_committed_ &&
+ (retry_policy_ == nullptr ||
+ !retry_policy_->per_attempt_recv_timeout().has_value())) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: retry committed before first attempt; "
@@ -1815,70 +2266,52 @@ void RetryFilter::CallData::StartTransportStreamOpBatch(
chand_, this);
}
PendingBatchClear(pending);
- committed_call_ = CreateLoadBalancedCall();
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ committed_call_ = CreateLoadBalancedCall(
+ service_config_call_data->call_dispatch_controller(),
+ /*is_transparent_retry=*/false);
committed_call_->StartTransportStreamOpBatch(batch);
return;
}
- // We do not yet have a call attempt, so create one.
+ // Otherwise, create a call attempt.
+ // The attempt will automatically start any necessary replays or
+ // pending batches.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: creating call attempt", chand_,
this);
}
- CreateCallAttempt();
+ retry_codepath_started_ = true;
+ CreateCallAttempt(/*is_transparent_retry=*/false);
return;
}
// Send batches to call attempt.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: starting batch on attempt=%p lb_call=%p",
- chand_, this, call_attempt_.get(), call_attempt_->lb_call());
+ gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on attempt=%p", chand_,
+ this, call_attempt_.get());
}
call_attempt_->StartRetriableBatches();
}
-RefCountedPtr<ClientChannel::LoadBalancedCall>
-RetryFilter::CallData::CreateLoadBalancedCall() {
+OrphanablePtr<ClientChannel::LoadBalancedCall>
+RetryFilter::CallData::CreateLoadBalancedCall(
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry) {
grpc_call_element_args args = {owning_call_, nullptr, call_context_,
- path_, call_start_time_, deadline_,
+ path_, /*start_time=*/0, deadline_,
arena_, call_combiner_};
return chand_->client_channel_->CreateLoadBalancedCall(
args, pollent_,
// This callback holds a ref to the CallStackDestructionBarrier
// object until the LB call is destroyed.
- call_stack_destruction_barrier_->MakeLbCallDestructionClosure(this));
+ call_stack_destruction_barrier_->MakeLbCallDestructionClosure(this),
+ call_dispatch_controller, is_transparent_retry);
}
-void RetryFilter::CallData::CreateCallAttempt() {
- call_attempt_.reset(arena_->New<CallAttempt>(this));
+void RetryFilter::CallData::CreateCallAttempt(bool is_transparent_retry) {
+ call_attempt_ = MakeRefCounted<CallAttempt>(this, is_transparent_retry);
call_attempt_->StartRetriableBatches();
- // TODO(roth): When implementing hedging, change this to start a timer
- // for the next hedging attempt.
-}
-
-namespace {
-
-void StartBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- auto* lb_call = static_cast<ClientChannel::LoadBalancedCall*>(
- batch->handler_private.extra_arg);
- // Note: This will release the call combiner.
- lb_call->StartTransportStreamOpBatch(batch);
-}
-
-} // namespace
-
-void RetryFilter::CallData::AddClosureForBatch(
- grpc_transport_stream_op_batch* batch, CallCombinerClosureList* closures) {
- batch->handler_private.extra_arg = call_attempt_->lb_call();
- GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
- batch, grpc_schedule_on_exec_ctx);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on LB call: %s",
- chand_, this, grpc_transport_stream_op_batch_string(batch).c_str());
- }
- closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "start_batch_on_lb_call");
}
//
@@ -1892,14 +2325,9 @@ void RetryFilter::CallData::MaybeCacheSendOpsForBatch(PendingBatch* pending) {
// Save a copy of metadata for send_initial_metadata ops.
if (batch->send_initial_metadata) {
seen_send_initial_metadata_ = true;
- GPR_ASSERT(send_initial_metadata_storage_ == nullptr);
grpc_metadata_batch* send_initial_metadata =
batch->payload->send_initial_metadata.send_initial_metadata;
- send_initial_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) * send_initial_metadata->list.count));
- grpc_metadata_batch_copy(send_initial_metadata, &send_initial_metadata_,
- send_initial_metadata_storage_);
+ send_initial_metadata_ = send_initial_metadata->Copy();
send_initial_metadata_flags_ =
batch->payload->send_initial_metadata.send_initial_metadata_flags;
peer_string_ = batch->payload->send_initial_metadata.peer_string;
@@ -1913,14 +2341,9 @@ void RetryFilter::CallData::MaybeCacheSendOpsForBatch(PendingBatch* pending) {
// Save metadata batch for send_trailing_metadata ops.
if (batch->send_trailing_metadata) {
seen_send_trailing_metadata_ = true;
- GPR_ASSERT(send_trailing_metadata_storage_ == nullptr);
grpc_metadata_batch* send_trailing_metadata =
batch->payload->send_trailing_metadata.send_trailing_metadata;
- send_trailing_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) * send_trailing_metadata->list.count));
- grpc_metadata_batch_copy(send_trailing_metadata, &send_trailing_metadata_,
- send_trailing_metadata_storage_);
+ send_trailing_metadata_ = send_trailing_metadata->Copy();
}
}
@@ -1929,24 +2352,27 @@ void RetryFilter::CallData::FreeCachedSendInitialMetadata() {
gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_initial_metadata",
chand_, this);
}
- grpc_metadata_batch_destroy(&send_initial_metadata_);
+ send_initial_metadata_.Clear();
}
void RetryFilter::CallData::FreeCachedSendMessage(size_t idx) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: destroying send_messages[%" PRIuPTR "]", chand_,
- this, idx);
+ if (send_messages_[idx] != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: destroying send_messages[%" PRIuPTR "]",
+ chand_, this, idx);
+ }
+ send_messages_[idx]->Destroy();
+ send_messages_[idx] = nullptr;
}
- send_messages_[idx]->Destroy();
}
void RetryFilter::CallData::FreeCachedSendTrailingMetadata() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
- gpr_log(GPR_INFO, "chand_=%p calld=%p: destroying send_trailing_metadata",
+ gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_trailing_metadata",
chand_, this);
}
- grpc_metadata_batch_destroy(&send_trailing_metadata_);
+ send_trailing_metadata_.Clear();
}
void RetryFilter::CallData::FreeAllCachedSendOpData() {
@@ -1982,7 +2408,7 @@ RetryFilter::CallData::PendingBatch* RetryFilter::CallData::PendingBatchesAdd(
const size_t idx = GetBatchIndex(batch);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
- "chand_=%p calld=%p: adding pending batch at index %" PRIuPTR,
+ "chand=%p calld=%p: adding pending batch at index %" PRIuPTR,
chand_, this, idx);
}
PendingBatch* pending = &pending_batches_[idx];
@@ -1995,8 +2421,8 @@ RetryFilter::CallData::PendingBatch* RetryFilter::CallData::PendingBatchesAdd(
// gRPC clients do not send trailing metadata.
if (batch->send_initial_metadata) {
pending_send_initial_metadata_ = true;
- bytes_buffered_for_retry_ += grpc_metadata_batch_size(
- batch->payload->send_initial_metadata.send_initial_metadata);
+ bytes_buffered_for_retry_ += batch->payload->send_initial_metadata
+ .send_initial_metadata->TransportSize();
}
if (batch->send_message) {
pending_send_message_ = true;
@@ -2006,6 +2432,9 @@ RetryFilter::CallData::PendingBatch* RetryFilter::CallData::PendingBatchesAdd(
if (batch->send_trailing_metadata) {
pending_send_trailing_metadata_ = true;
}
+ // TODO(roth): When we implement hedging, if there are currently attempts
+ // in flight, we will need to pick the one on which the max number of send
+ // ops have already been sent, and we commit to that attempt.
if (GPR_UNLIKELY(bytes_buffered_for_retry_ >
chand_->per_rpc_retry_buffer_size_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
@@ -2122,49 +2551,86 @@ void RetryFilter::CallData::RetryCommit(CallAttempt* call_attempt) {
gpr_log(GPR_INFO, "chand=%p calld=%p: committing retries", chand_, this);
}
if (call_attempt != nullptr) {
+ // If the call attempt's LB call has been committed, inform the call
+ // dispatch controller that the call has been committed.
+ // Note: If call_attempt is null, this is happening before the first
+ // retry attempt is started, in which case we'll just pass the real
+ // call dispatch controller down into the LB call, and it won't be
+ // our problem anymore.
+ if (call_attempt->lb_call_committed()) {
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ service_config_call_data->call_dispatch_controller()->Commit();
+ }
+ // Free cached send ops.
call_attempt->FreeCachedSendOpDataAfterCommit();
}
}
-void RetryFilter::CallData::DoRetry(grpc_millis server_pushback_ms) {
+void RetryFilter::CallData::StartRetryTimer(
+ absl::optional<Duration> server_pushback) {
// Reset call attempt.
- call_attempt_.reset();
+ call_attempt_.reset(DEBUG_LOCATION, "StartRetryTimer");
// Compute backoff delay.
- grpc_millis next_attempt_time;
- if (server_pushback_ms >= 0) {
- next_attempt_time = ExecCtx::Get()->Now() + server_pushback_ms;
- last_attempt_got_server_pushback_ = true;
+ Timestamp next_attempt_time;
+ if (server_pushback.has_value()) {
+ GPR_ASSERT(*server_pushback >= Duration::Zero());
+ next_attempt_time = ExecCtx::Get()->Now() + *server_pushback;
+ retry_backoff_.Reset();
} else {
- if (num_attempts_completed_ == 1 || last_attempt_got_server_pushback_) {
- last_attempt_got_server_pushback_ = false;
- }
next_attempt_time = retry_backoff_.NextAttemptTime();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: retrying failed call in %" PRId64 " ms", chand_,
- this, next_attempt_time - ExecCtx::Get()->Now());
+ this, (next_attempt_time - ExecCtx::Get()->Now()).millis());
}
// Schedule retry after computed delay.
GRPC_CLOSURE_INIT(&retry_closure_, OnRetryTimer, this, nullptr);
GRPC_CALL_STACK_REF(owning_call_, "OnRetryTimer");
- MutexLock lock(&timer_mu_);
- canceller_ = new Canceller(this);
+ retry_timer_pending_ = true;
grpc_timer_init(&retry_timer_, next_attempt_time, &retry_closure_);
}
void RetryFilter::CallData::OnRetryTimer(void* arg, grpc_error_handle error) {
auto* calld = static_cast<CallData*>(arg);
- if (error == GRPC_ERROR_NONE) {
- bool start_attempt = false;
- {
- MutexLock lock(&calld->timer_mu_);
- if (calld->canceller_ != nullptr) {
- calld->canceller_ = nullptr;
- start_attempt = true;
- }
- }
- if (start_attempt) calld->CreateCallAttempt();
+ GRPC_CLOSURE_INIT(&calld->retry_closure_, OnRetryTimerLocked, calld, nullptr);
+ GRPC_CALL_COMBINER_START(calld->call_combiner_, &calld->retry_closure_,
+ GRPC_ERROR_REF(error), "retry timer fired");
+}
+
+void RetryFilter::CallData::OnRetryTimerLocked(void* arg,
+ grpc_error_handle error) {
+ auto* calld = static_cast<CallData*>(arg);
+ if (error == GRPC_ERROR_NONE && calld->retry_timer_pending_) {
+ calld->retry_timer_pending_ = false;
+ calld->CreateCallAttempt(/*is_transparent_retry=*/false);
+ } else {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_, "retry timer cancelled");
+ }
+ GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnRetryTimer");
+}
+
+void RetryFilter::CallData::AddClosureToStartTransparentRetry(
+ CallCombinerClosureList* closures) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: scheduling transparent retry", chand_,
+ this);
+ }
+ GRPC_CALL_STACK_REF(owning_call_, "OnRetryTimer");
+ GRPC_CLOSURE_INIT(&retry_closure_, StartTransparentRetry, this, nullptr);
+ closures->Add(&retry_closure_, GRPC_ERROR_NONE, "start transparent retry");
+}
+
+void RetryFilter::CallData::StartTransparentRetry(void* arg,
+ grpc_error_handle /*error*/) {
+ auto* calld = static_cast<CallData*>(arg);
+ if (calld->cancelled_from_surface_ == GRPC_ERROR_NONE) {
+ calld->CreateCallAttempt(/*is_transparent_retry=*/true);
+ } else {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "call cancelled before transparent retry");
}
GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnRetryTimer");
}
@@ -2173,6 +2639,7 @@ void RetryFilter::CallData::OnRetryTimer(void* arg, grpc_error_handle error) {
const grpc_channel_filter kRetryFilterVtable = {
RetryFilter::CallData::StartTransportStreamOpBatch,
+ nullptr,
RetryFilter::StartTransportOp,
sizeof(RetryFilter::CallData),
RetryFilter::CallData::Init,
diff --git a/grpc/src/core/ext/filters/client_channel/retry_service_config.cc b/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
index fc066e63..9382904b 100644
--- a/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
+++ b/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
@@ -31,12 +31,13 @@
#include "src/core/ext/filters/client_channel/client_channel.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/lib/channel/channel_args.h"
#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/config/core_configuration.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/resolver/server_address.h"
#include "src/core/lib/uri/uri_parser.h"
// As per the retry design, we do not allow more than 5 retry attempts.
@@ -45,16 +46,13 @@
namespace grpc_core {
namespace internal {
-namespace {
-size_t g_retry_service_config_parser_index;
-}
-
size_t RetryServiceConfigParser::ParserIndex() {
- return g_retry_service_config_parser_index;
+ return CoreConfiguration::Get().service_config_parser().GetParserIndex(
+ parser_name());
}
-void RetryServiceConfigParser::Register() {
- g_retry_service_config_parser_index = ServiceConfigParser::RegisterParser(
+void RetryServiceConfigParser::Register(CoreConfiguration::Builder* builder) {
+ builder->service_config_parser()->RegisterParser(
absl::make_unique<RetryServiceConfigParser>());
}
@@ -158,11 +156,11 @@ RetryServiceConfigParser::ParseGlobalParams(const grpc_channel_args* /*args*/,
namespace {
-grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
- grpc_millis* initial_backoff,
- grpc_millis* max_backoff,
- float* backoff_multiplier,
- StatusCodeSet* retryable_status_codes) {
+grpc_error_handle ParseRetryPolicy(
+ const grpc_channel_args* args, const Json& json, int* max_attempts,
+ Duration* initial_backoff, Duration* max_backoff, float* backoff_multiplier,
+ StatusCodeSet* retryable_status_codes,
+ absl::optional<Duration>* per_attempt_recv_timeout) {
if (json.type() != Json::Type::OBJECT) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:retryPolicy error:should be of type object");
@@ -170,7 +168,10 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
std::vector<grpc_error_handle> error_list;
// Parse maxAttempts.
auto it = json.object_value().find("maxAttempts");
- if (it != json.object_value().end()) {
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAttempts error:required field missing"));
+ } else {
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"));
@@ -191,20 +192,23 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
// Parse initialBackoff.
if (ParseJsonObjectFieldAsDuration(json.object_value(), "initialBackoff",
initial_backoff, &error_list) &&
- *initial_backoff == 0) {
+ *initial_backoff == Duration::Zero()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:initialBackoff error:must be greater than 0"));
}
// Parse maxBackoff.
if (ParseJsonObjectFieldAsDuration(json.object_value(), "maxBackoff",
max_backoff, &error_list) &&
- *max_backoff == 0) {
+ *max_backoff == Duration::Zero()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxBackoff error:should be greater than 0"));
+ "field:maxBackoff error:must be greater than 0"));
}
// Parse backoffMultiplier.
it = json.object_value().find("backoffMultiplier");
- if (it != json.object_value().end()) {
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:required field missing"));
+ } else {
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"));
@@ -215,7 +219,7 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
"field:backoffMultiplier error:failed to parse"));
} else if (*backoff_multiplier <= 0) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:backoffMultiplier error:should be greater than 0"));
+ "field:backoffMultiplier error:must be greater than 0"));
}
}
}
@@ -224,7 +228,7 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
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"));
+ "field:retryableStatusCodes error:must be of type array"));
} else {
for (const Json& element : it->second.array_value()) {
if (element.type() != Json::Type::STRING) {
@@ -242,18 +246,40 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
}
retryable_status_codes->Add(status);
}
- if (retryable_status_codes->Empty()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:should be non-empty"));
- };
}
}
- // Make sure required fields are set.
- if (error_list.empty()) {
- if (*max_attempts == 0 || *initial_backoff == 0 || *max_backoff == 0 ||
- *backoff_multiplier == 0 || retryable_status_codes->Empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryPolicy error:Missing required field(s)");
+ // Parse perAttemptRecvTimeout.
+ if (grpc_channel_args_find_bool(args, GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING,
+ false)) {
+ it = json.object_value().find("perAttemptRecvTimeout");
+ if (it != json.object_value().end()) {
+ Duration per_attempt_recv_timeout_value;
+ if (!ParseDurationFromJson(it->second, &per_attempt_recv_timeout_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:perAttemptRecvTimeout error:type must be STRING of the "
+ "form given by google.proto.Duration."));
+ } else {
+ *per_attempt_recv_timeout = per_attempt_recv_timeout_value;
+ // TODO(roth): As part of implementing hedging, relax this check such
+ // that we allow a value of 0 if a hedging policy is specified.
+ if (per_attempt_recv_timeout_value == Duration::Zero()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:perAttemptRecvTimeout error:must be greater than 0"));
+ }
+ }
+ } else if (retryable_status_codes->Empty()) {
+ // If perAttemptRecvTimeout not present, retryableStatusCodes must be
+ // non-empty.
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:must be non-empty if "
+ "perAttemptRecvTimeout not present"));
+ }
+ } else {
+ // Hedging not enabled, so the error message for
+ // retryableStatusCodes unset should be different.
+ if (retryable_status_codes->Empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:must be non-empty"));
}
}
return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
@@ -262,25 +288,26 @@ grpc_error_handle ParseRetryPolicy(const Json& json, int* max_attempts,
} // namespace
std::unique_ptr<ServiceConfigParser::ParsedConfig>
-RetryServiceConfigParser::ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json,
- grpc_error_handle* error) {
+RetryServiceConfigParser::ParsePerMethodParams(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
// Parse retry policy.
auto it = json.object_value().find("retryPolicy");
if (it == json.object_value().end()) return nullptr;
int max_attempts = 0;
- grpc_millis initial_backoff = 0;
- grpc_millis max_backoff = 0;
+ Duration initial_backoff;
+ Duration max_backoff;
float backoff_multiplier = 0;
StatusCodeSet retryable_status_codes;
- *error = ParseRetryPolicy(it->second, &max_attempts, &initial_backoff,
+ absl::optional<Duration> per_attempt_recv_timeout;
+ *error = ParseRetryPolicy(args, it->second, &max_attempts, &initial_backoff,
&max_backoff, &backoff_multiplier,
- &retryable_status_codes);
+ &retryable_status_codes, &per_attempt_recv_timeout);
if (*error != GRPC_ERROR_NONE) return nullptr;
- return absl::make_unique<RetryMethodConfig>(max_attempts, initial_backoff,
- max_backoff, backoff_multiplier,
- retryable_status_codes);
+ return absl::make_unique<RetryMethodConfig>(
+ max_attempts, initial_backoff, max_backoff, backoff_multiplier,
+ retryable_status_codes, per_attempt_recv_timeout);
}
} // namespace internal
diff --git a/grpc/src/core/ext/filters/client_channel/retry_service_config.h b/grpc/src/core/ext/filters/client_channel/retry_service_config.h
index 256183f2..c576c6f6 100644
--- a/grpc/src/core/ext/filters/client_channel/retry_service_config.h
+++ b/grpc/src/core/ext/filters/client_channel/retry_service_config.h
@@ -22,9 +22,10 @@
#include <memory>
#include "src/core/ext/filters/client_channel/retry_throttle.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/channel/status_util.h"
-#include "src/core/lib/iomgr/exec_ctx.h" // for grpc_millis
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/gprpp/time.h"
+#include "src/core/lib/service_config/service_config_parser.h"
namespace grpc_core {
namespace internal {
@@ -45,43 +46,54 @@ class RetryGlobalConfig : public ServiceConfigParser::ParsedConfig {
class RetryMethodConfig : public ServiceConfigParser::ParsedConfig {
public:
- RetryMethodConfig(int max_attempts, grpc_millis initial_backoff,
- grpc_millis max_backoff, float backoff_multiplier,
- StatusCodeSet retryable_status_codes)
+ RetryMethodConfig(int max_attempts, Duration initial_backoff,
+ Duration max_backoff, float backoff_multiplier,
+ StatusCodeSet retryable_status_codes,
+ absl::optional<Duration> per_attempt_recv_timeout)
: max_attempts_(max_attempts),
initial_backoff_(initial_backoff),
max_backoff_(max_backoff),
backoff_multiplier_(backoff_multiplier),
- retryable_status_codes_(retryable_status_codes) {}
+ retryable_status_codes_(retryable_status_codes),
+ per_attempt_recv_timeout_(per_attempt_recv_timeout) {}
int max_attempts() const { return max_attempts_; }
- grpc_millis initial_backoff() const { return initial_backoff_; }
- grpc_millis max_backoff() const { return max_backoff_; }
+ Duration initial_backoff() const { return initial_backoff_; }
+ Duration max_backoff() const { return max_backoff_; }
float backoff_multiplier() const { return backoff_multiplier_; }
StatusCodeSet retryable_status_codes() const {
return retryable_status_codes_;
}
+ absl::optional<Duration> per_attempt_recv_timeout() const {
+ return per_attempt_recv_timeout_;
+ }
private:
int max_attempts_ = 0;
- grpc_millis initial_backoff_ = 0;
- grpc_millis max_backoff_ = 0;
+ Duration initial_backoff_;
+ Duration max_backoff_;
float backoff_multiplier_ = 0;
StatusCodeSet retryable_status_codes_;
+ absl::optional<Duration> per_attempt_recv_timeout_;
};
class RetryServiceConfigParser : public ServiceConfigParser::Parser {
public:
+ absl::string_view name() const override { return parser_name(); }
+
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
const grpc_channel_args* /*args*/, const Json& json,
grpc_error_handle* error) override;
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json,
+ const grpc_channel_args* args, const Json& json,
grpc_error_handle* error) override;
static size_t ParserIndex();
- static void Register();
+ static void Register(CoreConfiguration::Builder* builder);
+
+ private:
+ static absl::string_view parser_name() { return "retry"; }
};
} // namespace internal
diff --git a/grpc/src/core/ext/filters/client_channel/retry_throttle.cc b/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
index 03c7a673..c3838fb2 100644
--- a/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
+++ b/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
@@ -23,6 +23,7 @@
#include <limits.h>
#include <string.h>
+#include <map>
#include <string>
#include <grpc/support/alloc.h>
@@ -30,7 +31,7 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/avl/avl.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
namespace grpc_core {
namespace internal {
@@ -115,78 +116,32 @@ void ServerRetryThrottleData::RecordSuccess() {
}
//
-// avl vtable for string -> server_retry_throttle_data map
-//
-
-namespace {
-
-void* copy_server_name(void* key, void* /*unused*/) {
- return gpr_strdup(static_cast<const char*>(key));
-}
-
-long compare_server_name(void* key1, void* key2, void* /*unused*/) {
- return strcmp(static_cast<const char*>(key1), static_cast<const char*>(key2));
-}
-
-void destroy_server_retry_throttle_data(void* value, void* /*unused*/) {
- ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(value);
- throttle_data->Unref();
-}
-
-void* copy_server_retry_throttle_data(void* value, void* /*unused*/) {
- ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(value);
- return throttle_data->Ref().release();
-}
-
-void destroy_server_name(void* key, void* /*unused*/) { gpr_free(key); }
-
-const grpc_avl_vtable avl_vtable = {
- destroy_server_name, copy_server_name, compare_server_name,
- destroy_server_retry_throttle_data, copy_server_retry_throttle_data};
-
-} // namespace
-
-//
// ServerRetryThrottleMap
//
-static gpr_mu g_mu;
-static grpc_avl g_avl;
-
-void ServerRetryThrottleMap::Init() {
- gpr_mu_init(&g_mu);
- g_avl = grpc_avl_create(&avl_vtable);
-}
-
-void ServerRetryThrottleMap::Shutdown() {
- gpr_mu_destroy(&g_mu);
- grpc_avl_unref(g_avl, nullptr);
+ServerRetryThrottleMap* ServerRetryThrottleMap::Get() {
+ static ServerRetryThrottleMap* m = new ServerRetryThrottleMap();
+ return m;
}
RefCountedPtr<ServerRetryThrottleData> ServerRetryThrottleMap::GetDataForServer(
const std::string& server_name, intptr_t max_milli_tokens,
intptr_t milli_token_ratio) {
- RefCountedPtr<ServerRetryThrottleData> result;
- gpr_mu_lock(&g_mu);
+ MutexLock lock(&mu_);
+ auto it = map_.find(server_name);
ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(
- grpc_avl_get(g_avl, const_cast<char*>(server_name.c_str()), nullptr));
+ it == map_.end() ? nullptr : it->second.get();
if (throttle_data == nullptr ||
throttle_data->max_milli_tokens() != max_milli_tokens ||
throttle_data->milli_token_ratio() != milli_token_ratio) {
// Entry not found, or found with old parameters. Create a new one.
- result = MakeRefCounted<ServerRetryThrottleData>(
- max_milli_tokens, milli_token_ratio, throttle_data);
- g_avl = grpc_avl_add(g_avl, gpr_strdup(server_name.c_str()),
- result->Ref().release(), nullptr);
- } else {
- // Entry found. Return a new ref to it.
- result = throttle_data->Ref();
+ it = map_.emplace(server_name,
+ MakeRefCounted<ServerRetryThrottleData>(
+ max_milli_tokens, milli_token_ratio, throttle_data))
+ .first;
+ throttle_data = it->second.get();
}
- gpr_mu_unlock(&g_mu);
- return result;
+ return throttle_data->Ref();
}
} // namespace internal
diff --git a/grpc/src/core/ext/filters/client_channel/retry_throttle.h b/grpc/src/core/ext/filters/client_channel/retry_throttle.h
index 17cc7a07..18132ac0 100644
--- a/grpc/src/core/ext/filters/client_channel/retry_throttle.h
+++ b/grpc/src/core/ext/filters/client_channel/retry_throttle.h
@@ -21,10 +21,12 @@
#include <grpc/support/port_platform.h>
+#include <map>
#include <string>
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
namespace grpc_core {
namespace internal {
@@ -61,16 +63,20 @@ class ServerRetryThrottleData : public RefCounted<ServerRetryThrottleData> {
/// Global map of server name to retry throttle data.
class ServerRetryThrottleMap {
public:
- /// Initializes global map of failure data for each server name.
- static void Init();
- /// Shuts down global map of failure data for each server name.
- static void Shutdown();
+ static ServerRetryThrottleMap* Get();
/// Returns the failure data for \a server_name, creating a new entry if
/// needed.
- static RefCountedPtr<ServerRetryThrottleData> GetDataForServer(
+ RefCountedPtr<ServerRetryThrottleData> GetDataForServer(
const std::string& server_name, intptr_t max_milli_tokens,
intptr_t milli_token_ratio);
+
+ private:
+ using StringToDataMap =
+ std::map<std::string, RefCountedPtr<ServerRetryThrottleData>>;
+
+ Mutex mu_;
+ StringToDataMap map_ ABSL_GUARDED_BY(mu_);
};
} // namespace internal
diff --git a/grpc/src/core/ext/filters/client_channel/server_address.cc b/grpc/src/core/ext/filters/client_channel/server_address.cc
deleted file mode 100644
index e082256b..00000000
--- a/grpc/src/core/ext/filters/client_channel/server_address.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- *
- * 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/filters/client_channel/server_address.h"
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "absl/strings/str_cat.h"
-#include "absl/strings/str_join.h"
-
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-
-namespace grpc_core {
-
-//
-// ServerAddressWeightAttribute
-//
-const char* ServerAddressWeightAttribute::kServerAddressWeightAttributeKey =
- "server_address_weight";
-
-//
-// 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 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) {
- if (&other == this) {
- return *this;
- }
- 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;
-}
-
-std::string ServerAddress::ToString() const {
- std::vector<std::string> parts = {
- grpc_sockaddr_to_string(&address_, false),
- };
- if (args_ != nullptr) {
- parts.emplace_back(
- absl::StrCat("args={", grpc_channel_args_string(args_), "}"));
- }
- if (!attributes_.empty()) {
- std::vector<std::string> attrs;
- for (const auto& p : attributes_) {
- attrs.emplace_back(absl::StrCat(p.first, "=", p.second->ToString()));
- }
- parts.emplace_back(
- absl::StrCat("attributes={", absl::StrJoin(attrs, ", "), "}"));
- }
- return absl::StrJoin(parts, " ");
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/server_address.h b/grpc/src/core/ext/filters/client_channel/server_address.h
deleted file mode 100644
index 1e0eaa11..00000000
--- a/grpc/src/core/ext/filters/client_channel/server_address.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- *
- * 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_SERVER_ADDRESS_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <map>
-#include <memory>
-
-#include "absl/container/inlined_vector.h"
-#include "absl/strings/str_format.h"
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-
-namespace grpc_core {
-
-//
-// ServerAddress
-//
-
-// A server address is a grpc_resolved_address with an associated set of
-// channel args. Any args present here will be merged into the channel
-// 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 std::string 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 void* address, size_t address_len,
- 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);
-
- // Movable.
- ServerAddress(ServerAddress&& other) noexcept;
- ServerAddress& operator=(ServerAddress&& other) noexcept;
-
- bool operator==(const ServerAddress& other) const { return Cmp(other) == 0; }
-
- 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;
-
- std::string ToString() const;
-
- private:
- grpc_resolved_address address_;
- grpc_channel_args* args_;
- std::map<const char*, std::unique_ptr<AttributeInterface>> attributes_;
-};
-
-//
-// ServerAddressList
-//
-
-typedef absl::InlinedVector<ServerAddress, 1> ServerAddressList;
-
-//
-// ServerAddressWeightAttribute
-//
-class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
- public:
- static const char* kServerAddressWeightAttributeKey;
-
- explicit ServerAddressWeightAttribute(uint32_t weight) : weight_(weight) {}
-
- uint32_t weight() const { return weight_; }
-
- std::unique_ptr<AttributeInterface> Copy() const override {
- return absl::make_unique<ServerAddressWeightAttribute>(weight_);
- }
-
- int Cmp(const AttributeInterface* other) const override {
- const auto* other_locality_attr =
- static_cast<const ServerAddressWeightAttribute*>(other);
- return GPR_ICMP(weight_, other_locality_attr->weight_);
- }
-
- std::string ToString() const override {
- return absl::StrFormat("%d", weight_);
- }
-
- private:
- uint32_t weight_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVER_ADDRESS_H */
diff --git a/grpc/src/core/ext/filters/client_channel/service_config.cc b/grpc/src/core/ext/filters/client_channel/service_config.cc
deleted file mode 100644
index b87226c6..00000000
--- a/grpc/src/core/ext/filters/client_channel/service_config.cc
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// 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.h"
-
-#include <string>
-
-#include "absl/strings/str_cat.h"
-
-#include <grpc/support/log.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, absl::string_view json_string,
- grpc_error_handle* error) {
- GPR_DEBUG_ASSERT(error != nullptr);
- Json json = Json::Parse(json_string, error);
- if (*error != GRPC_ERROR_NONE) return nullptr;
- return MakeRefCounted<ServiceConfig>(args, std::string(json_string),
- std::move(json), error);
-}
-
-ServiceConfig::ServiceConfig(const grpc_channel_args* args,
- std::string json_string, Json json,
- grpc_error_handle* 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");
- return;
- }
- std::vector<grpc_error_handle> error_list;
- grpc_error_handle 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_handle 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);
- }
-}
-
-grpc_error_handle ServiceConfig::ParseJsonMethodConfig(
- const grpc_channel_args* args, const Json& json) {
- std::vector<grpc_error_handle> error_list;
- // Parse method config with each registered parser.
- auto parsed_configs =
- absl::make_unique<ServiceConfigParser::ParsedConfigVector>();
- grpc_error_handle 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_handle parse_error = GRPC_ERROR_NONE;
- std::string 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();
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
-}
-
-grpc_error_handle ServiceConfig::ParsePerMethodParams(
- const grpc_channel_args* args) {
- std::vector<grpc_error_handle> 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"));
- }
- 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;
- }
- grpc_error_handle 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);
-}
-
-std::string ServiceConfig::ParseJsonMethodName(const Json& json,
- grpc_error_handle* error) {
- if (json.type() != Json::Type::OBJECT) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:name error:type is not object");
- return "";
- }
- // Find service name.
- const std::string* 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 std::string* 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");
- }
- return "";
- }
- // Construct path.
- return 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 default_method_config_vector_;
- }
- // 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_;
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/service_config.h b/grpc/src/core/ext/filters/client_channel/service_config.h
deleted file mode 100644
index a06ae162..00000000
--- a/grpc/src/core/ext/filters/client_channel/service_config.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// 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_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
-
-#include <grpc/support/port_platform.h>
-
-#include <unordered_map>
-
-#include "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/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"
-
-// The main purpose of the code here is to parse the service config in
-// JSON form, which will look like this:
-//
-// {
-// "loadBalancingPolicy": "string", // optional
-// "methodConfig": [ // array of one or more method_config objects
-// {
-// "name": [ // array of one or more name objects
-// {
-// "service": "string", // required
-// "method": "string", // optional
-// }
-// ],
-// // remaining fields are optional.
-// // see https://developers.google.com/protocol-buffers/docs/proto3#json
-// // for format details.
-// "waitForReady": bool,
-// "timeout": "duration_string",
-// "maxRequestMessageBytes": "int64_string",
-// "maxResponseMessageBytes": "int64_string",
-// }
-// ]
-// }
-
-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.
-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,
- absl::string_view json_string,
- grpc_error_handle* error);
-
- ServiceConfig(const grpc_channel_args* args, std::string json_string,
- Json json, grpc_error_handle* error);
- ~ServiceConfig() override;
-
- const std::string& 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) {
- GPR_DEBUG_ASSERT(index < parsed_global_configs_.size());
- return parsed_global_configs_[index].get();
- }
-
- /// 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;
-
- private:
- // Helper functions for parsing the method configs.
- grpc_error_handle ParsePerMethodParams(const grpc_channel_args* args);
- grpc_error_handle 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 std::string ParseJsonMethodName(const Json& json,
- grpc_error_handle* error);
-
- std::string json_string_;
- Json json_;
-
- 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;
- // Storage for all the vectors that are being used in
- // parsed_method_configs_table_.
- absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfigVector>,
- 32>
- parsed_method_config_vectors_storage_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H */
diff --git a/grpc/src/core/ext/filters/client_channel/service_config_call_data.h b/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
deleted file mode 100644
index 544683a6..00000000
--- a/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// 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 <map>
-
-#include "absl/strings/string_view.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,
- std::map<const char*, absl::string_view> call_attributes,
- grpc_call_context_element* call_context)
- : service_config_(std::move(service_config)),
- method_configs_(method_configs),
- call_attributes_(std::move(call_attributes)) {
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
- }
-
- ServiceConfigCallData(
- RefCountedPtr<ServiceConfig> service_config,
- const ServiceConfigParser::ParsedConfigVector* method_configs,
- grpc_call_context_element* call_context)
- : ServiceConfigCallData(std::move(service_config), method_configs, {},
- call_context) {}
-
- 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);
- }
-
- const std::map<const char*, absl::string_view>& call_attributes() const {
- return call_attributes_;
- }
-
- private:
- static void Destroy(void* ptr) {
- ServiceConfigCallData* self = static_cast<ServiceConfigCallData*>(ptr);
- self->~ServiceConfigCallData();
- }
-
- RefCountedPtr<ServiceConfig> service_config_;
- const ServiceConfigParser::ParsedConfigVector* method_configs_ = nullptr;
- std::map<const char*, absl::string_view> call_attributes_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H */
diff --git a/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc b/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
index 5763e17d..34d3382d 100644
--- a/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
+++ b/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
@@ -19,11 +19,12 @@
#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"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/service_config/service_config_impl.h"
namespace grpc_core {
@@ -37,7 +38,7 @@ class ServiceConfigChannelArgChannelData {
args->channel_args, GRPC_ARG_SERVICE_CONFIG);
if (service_config_str != nullptr) {
grpc_error_handle service_config_error = GRPC_ERROR_NONE;
- auto service_config = ServiceConfig::Create(
+ auto service_config = ServiceConfigImpl::Create(
args->channel_args, service_config_str, &service_config_error);
if (service_config_error == GRPC_ERROR_NONE) {
service_config_ = std::move(service_config);
@@ -59,26 +60,43 @@ class ServiceConfigChannelArgChannelData {
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);
- }
+ ServiceConfigChannelArgCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_config,
+ const grpc_call_element_args* args)
+ : call_context_(args->context),
+ service_config_call_data_(std::move(service_config), method_config,
+ /*call_attributes=*/{}) {
+ GPR_DEBUG_ASSERT(args->context != nullptr);
+ // No need to set the destroy function, since it will be cleaned up
+ // when this filter is destroyed in the filter stack.
+ args->context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value =
+ &service_config_call_data_;
+ }
+
+ ~ServiceConfigChannelArgCallData() {
+ // Remove the entry from call context, just in case anyone above us
+ // tries to look at it during call stack destruction.
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = nullptr;
}
+
+ private:
+ grpc_call_context_element* call_context_;
+ ServiceConfigCallData service_config_call_data_;
};
grpc_error_handle ServiceConfigChannelArgInitCallElem(
grpc_call_element* elem, const grpc_call_element_args* args) {
- ServiceConfigChannelArgCallData* calld =
- static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
- new (calld) ServiceConfigChannelArgCallData(elem, args);
+ auto* chand =
+ static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
+ auto* calld = static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
+ RefCountedPtr<ServiceConfig> service_config = chand->service_config();
+ const ServiceConfigParser::ParsedConfigVector* method_config = nullptr;
+ if (service_config != nullptr) {
+ method_config = service_config->GetMethodParsedConfigVector(args->path);
+ }
+ new (calld) ServiceConfigChannelArgCallData(std::move(service_config),
+ method_config, args);
return GRPC_ERROR_NONE;
}
@@ -106,6 +124,7 @@ void ServiceConfigChannelArgDestroyChannelElem(grpc_channel_element* elem) {
const grpc_channel_filter ServiceConfigChannelArgFilter = {
grpc_call_next_op,
+ nullptr,
grpc_channel_next_op,
sizeof(ServiceConfigChannelArgCallData),
ServiceConfigChannelArgInitCallElem,
@@ -117,27 +136,22 @@ const grpc_channel_filter ServiceConfigChannelArgFilter = {
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(
+void RegisterServiceConfigChannelArgFilter(
+ CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_core::maybe_add_service_config_channel_arg_filter, nullptr);
+ [](ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
+ if (grpc_channel_args_want_minimal_stack(channel_args) ||
+ grpc_channel_args_find_string(channel_args,
+ GRPC_ARG_SERVICE_CONFIG) == nullptr) {
+ return true;
+ }
+ builder->PrependFilter(&ServiceConfigChannelArgFilter, nullptr);
+ return true;
+ });
}
-void grpc_service_config_channel_arg_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/service_config_parser.cc b/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
deleted file mode 100644
index fa8fbea6..00000000
--- a/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// 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 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_handle* error) {
- ParsedConfigVector parsed_global_configs;
- std::vector<grpc_error_handle> error_list;
- for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error_handle 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_handle* error) {
- ParsedConfigVector parsed_method_configs;
- std::vector<grpc_error_handle> error_list;
- for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error_handle 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/grpc/src/core/ext/filters/client_channel/service_config_parser.h b/grpc/src/core/ext/filters/client_channel/service_config_parser.h
deleted file mode 100644
index ebd31660..00000000
--- a/grpc/src/core/ext/filters/client_channel/service_config_parser.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// 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 "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_handle* 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_handle* error) {
- // Avoid unused parameter warning on debug-only parameter
- (void)error;
- GPR_DEBUG_ASSERT(error != nullptr);
- return nullptr;
- }
- };
-
- static constexpr int kNumPreallocatedParsers = 4;
- typedef 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_handle* error);
-
- static ParsedConfigVector ParsePerMethodParameters(
- const grpc_channel_args* args, const Json& json,
- grpc_error_handle* error);
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H */
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel.cc b/grpc/src/core/ext/filters/client_channel/subchannel.cc
index a3db6096..f6404179 100644
--- a/grpc/src/core/ext/filters/client_channel/subchannel.cc
+++ b/grpc/src/core/ext/filters/client_channel/subchannel.cc
@@ -1,20 +1,18 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
@@ -28,19 +26,21 @@
#include "absl/strings/str_format.h"
+#include <grpc/status.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/health/health_check_client.h"
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gprpp/debug_location.h"
@@ -50,10 +50,8 @@
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/status_metadata.h"
#include "src/core/lib/uri/uri_parser.h"
// Strong and weak refs.
@@ -144,14 +142,14 @@ SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error)
deadline_(args.deadline) {
grpc_call_stack* callstk = SUBCHANNEL_CALL_TO_CALL_STACK(this);
const grpc_call_element_args call_args = {
- callstk, /* call_stack */
- nullptr, /* server_transport_data */
- args.context, /* context */
- args.path, /* path */
- args.start_time, /* start_time */
- args.deadline, /* deadline */
- args.arena, /* arena */
- args.call_combiner /* call_combiner */
+ callstk, /* call_stack */
+ nullptr, /* server_transport_data */
+ args.context, /* context */
+ args.path.c_slice(), /* path */
+ args.start_time, /* start_time */
+ args.deadline, /* deadline */
+ args.arena, /* arena */
+ args.call_combiner /* call_combiner */
};
*error = grpc_call_stack_init(connected_subchannel_->channel_stack(), 1,
SubchannelCall::Destroy, this, &call_args);
@@ -191,8 +189,8 @@ RefCountedPtr<SubchannelCall> SubchannelCall::Ref() {
return RefCountedPtr<SubchannelCall>(this);
}
-RefCountedPtr<SubchannelCall> SubchannelCall::Ref(
- const grpc_core::DebugLocation& location, const char* reason) {
+RefCountedPtr<SubchannelCall> SubchannelCall::Ref(const DebugLocation& location,
+ const char* reason) {
IncrementRefCount(location, reason);
return RefCountedPtr<SubchannelCall>(this);
}
@@ -250,17 +248,12 @@ void SubchannelCall::MaybeInterceptRecvTrailingMetadata(
namespace {
// Sets *status based on the rest of the parameters.
-void GetCallStatus(grpc_status_code* status, grpc_millis deadline,
+void GetCallStatus(grpc_status_code* status, Timestamp deadline,
grpc_metadata_batch* md_batch, grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
grpc_error_get_status(error, deadline, status, nullptr, nullptr, nullptr);
} else {
- if (md_batch->idx.named.grpc_status != nullptr) {
- *status = grpc_get_status_code_from_metadata(
- md_batch->idx.named.grpc_status->md);
- } else {
- *status = GRPC_STATUS_UNKNOWN;
- }
+ *status = md_batch->get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN);
}
GRPC_ERROR_UNREF(error);
}
@@ -290,8 +283,8 @@ void SubchannelCall::IncrementRefCount() {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), "");
}
-void SubchannelCall::IncrementRefCount(
- const grpc_core::DebugLocation& /*location*/, const char* reason) {
+void SubchannelCall::IncrementRefCount(const DebugLocation& /*location*/,
+ const char* reason) {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason);
}
@@ -319,11 +312,12 @@ class Subchannel::ConnectedSubchannelStateWatcher
case GRPC_CHANNEL_TRANSIENT_FAILURE:
case GRPC_CHANNEL_SHUTDOWN: {
if (!c->disconnected_ && c->connected_subchannel_ != nullptr) {
- if (grpc_trace_subchannel.enabled()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
gpr_log(GPR_INFO,
- "Connected subchannel %p of subchannel %p has gone into "
+ "subchannel %p %s: Connected subchannel %p has gone into "
"%s. Attempting to reconnect.",
- c->connected_subchannel_.get(), c,
+ c, c->key_.ToString().c_str(),
+ c->connected_subchannel_.get(),
ConnectivityStateName(new_state));
}
c->connected_subchannel_.reset();
@@ -363,15 +357,9 @@ class Subchannel::AsyncWatcherNotifierLocked {
public:
AsyncWatcherNotifierLocked(
RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher,
- Subchannel* subchannel, grpc_connectivity_state state,
- const absl::Status& status)
+ grpc_connectivity_state state, const 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)});
+ watcher_->PushConnectivityStateChange({state, status});
ExecCtx::Run(DEBUG_LOCATION,
GRPC_CLOSURE_INIT(
&closure_,
@@ -405,10 +393,9 @@ void Subchannel::ConnectivityStateWatcherList::RemoveWatcherLocked(
}
void Subchannel::ConnectivityStateWatcherList::NotifyLocked(
- Subchannel* subchannel, grpc_connectivity_state state,
- const absl::Status& status) {
+ grpc_connectivity_state state, const absl::Status& status) {
for (const auto& p : watchers_) {
- new AsyncWatcherNotifierLocked(p.second, subchannel, state, status);
+ new AsyncWatcherNotifierLocked(p.second, state, status);
}
}
@@ -446,8 +433,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
grpc_connectivity_state initial_state,
RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, subchannel_.get(), state_,
- status_);
+ new AsyncWatcherNotifierLocked(watcher, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
}
@@ -469,14 +455,14 @@ class Subchannel::HealthWatcherMap::HealthWatcher
if (state_ != GRPC_CHANNEL_CONNECTING) {
state_ = GRPC_CHANNEL_CONNECTING;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), state_, status);
+ watcher_list_.NotifyLocked(state_, status);
}
// If we've become connected, start health checking.
StartHealthCheckingLocked();
} else {
state_ = state;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), state_, status);
+ watcher_list_.NotifyLocked(state_, status);
// We're not connected, so stop health checking.
health_check_client_.reset();
}
@@ -495,21 +481,21 @@ class Subchannel::HealthWatcherMap::HealthWatcher
if (new_state != GRPC_CHANNEL_SHUTDOWN && health_check_client_ != nullptr) {
state_ = new_state;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), new_state, status);
+ watcher_list_.NotifyLocked(new_state, status);
}
}
void StartHealthCheckingLocked()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(subchannel_->mu_) {
GPR_ASSERT(health_check_client_ == nullptr);
- health_check_client_ = MakeOrphanable<HealthCheckClient>(
+ health_check_client_ = MakeHealthCheckClient(
health_check_service_name_, subchannel_->connected_subchannel_,
subchannel_->pollset_set_, subchannel_->channelz_node_, Ref());
}
WeakRefCountedPtr<Subchannel> subchannel_;
std::string health_check_service_name_;
- OrphanablePtr<HealthCheckClient> health_check_client_;
+ OrphanablePtr<SubchannelStreamClient> health_check_client_;
grpc_connectivity_state state_;
absl::Status status_;
ConnectivityStateWatcherList watcher_list_;
@@ -583,52 +569,55 @@ void Subchannel::HealthWatcherMap::ShutdownLocked() { map_.clear(); }
namespace {
-BackOff::Options ParseArgsForBackoffValues(
- const grpc_channel_args* args, grpc_millis* min_connect_timeout_ms) {
- grpc_millis initial_backoff_ms =
- GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000;
- *min_connect_timeout_ms =
- GRPC_SUBCHANNEL_RECONNECT_MIN_TIMEOUT_SECONDS * 1000;
- grpc_millis max_backoff_ms =
- GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS * 1000;
+BackOff::Options ParseArgsForBackoffValues(const grpc_channel_args* args,
+ Duration* min_connect_timeout) {
+ Duration initial_backoff =
+ Duration::Seconds(GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS);
+ *min_connect_timeout =
+ Duration::Seconds(GRPC_SUBCHANNEL_RECONNECT_MIN_TIMEOUT_SECONDS);
+ Duration max_backoff =
+ Duration::Seconds(GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS);
bool fixed_reconnect_backoff = false;
if (args != nullptr) {
for (size_t i = 0; i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key,
"grpc.testing.fixed_reconnect_backoff_ms")) {
fixed_reconnect_backoff = true;
- initial_backoff_ms = *min_connect_timeout_ms = max_backoff_ms =
- grpc_channel_arg_get_integer(
+ initial_backoff = *min_connect_timeout = max_backoff =
+ Duration::Milliseconds(grpc_channel_arg_get_integer(
&args->args[i],
- {static_cast<int>(initial_backoff_ms), 100, INT_MAX});
+ {static_cast<int>(initial_backoff.millis()), 100, INT_MAX}));
} else if (0 ==
strcmp(args->args[i].key, GRPC_ARG_MIN_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
- *min_connect_timeout_ms = grpc_channel_arg_get_integer(
- &args->args[i],
- {static_cast<int>(*min_connect_timeout_ms), 100, INT_MAX});
+ *min_connect_timeout =
+ Duration::Milliseconds(grpc_channel_arg_get_integer(
+ &args->args[i],
+ {static_cast<int>(min_connect_timeout->millis()), 100,
+ INT_MAX}));
} else if (0 ==
strcmp(args->args[i].key, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
- max_backoff_ms = grpc_channel_arg_get_integer(
- &args->args[i], {static_cast<int>(max_backoff_ms), 100, INT_MAX});
+ max_backoff = Duration::Milliseconds(grpc_channel_arg_get_integer(
+ &args->args[i],
+ {static_cast<int>(max_backoff.millis()), 100, INT_MAX}));
} else if (0 == strcmp(args->args[i].key,
GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS)) {
fixed_reconnect_backoff = false;
- initial_backoff_ms = grpc_channel_arg_get_integer(
+ initial_backoff = Duration::Milliseconds(grpc_channel_arg_get_integer(
&args->args[i],
- {static_cast<int>(initial_backoff_ms), 100, INT_MAX});
+ {static_cast<int>(initial_backoff.millis()), 100, INT_MAX}));
}
}
}
return BackOff::Options()
- .set_initial_backoff(initial_backoff_ms)
+ .set_initial_backoff(initial_backoff)
.set_multiplier(fixed_reconnect_backoff
? 1.0
: GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(fixed_reconnect_backoff ? 0.0
: GRPC_SUBCHANNEL_RECONNECT_JITTER)
- .set_max_backoff(max_backoff_ms);
+ .set_max_backoff(max_backoff);
}
} // namespace
@@ -655,42 +644,39 @@ Subchannel::Subchannel(SubchannelKey key,
GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount) ? "Subchannel"
: nullptr),
key_(std::move(key)),
+ pollset_set_(grpc_pollset_set_create()),
connector_(std::move(connector)),
- backoff_(ParseArgsForBackoffValues(args, &min_connect_timeout_ms_)) {
+ backoff_(ParseArgsForBackoffValues(args, &min_connect_timeout_)) {
GRPC_STATS_INC_CLIENT_SUBCHANNELS_CREATED();
- pollset_set_ = grpc_pollset_set_create();
- grpc_resolved_address* addr =
- static_cast<grpc_resolved_address*>(gpr_malloc(sizeof(*addr)));
- GetAddressFromSubchannelAddressArg(args, addr);
+ GRPC_CLOSURE_INIT(&on_connecting_finished_, OnConnectingFinished, this,
+ grpc_schedule_on_exec_ctx);
+ // Check proxy mapper to determine address to connect to and channel
+ // args to use.
+ address_for_connect_ = key_.address();
grpc_resolved_address* new_address = nullptr;
grpc_channel_args* new_args = nullptr;
- if (ProxyMapperRegistry::MapAddress(*addr, args, &new_address, &new_args)) {
+ if (ProxyMapperRegistry::MapAddress(address_for_connect_, args, &new_address,
+ &new_args)) {
GPR_ASSERT(new_address != nullptr);
- gpr_free(addr);
- addr = new_address;
+ address_for_connect_ = *new_address;
+ gpr_free(new_address);
}
- static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
- grpc_arg new_arg = CreateSubchannelAddressArg(addr);
- gpr_free(addr);
- args_ = grpc_channel_args_copy_and_add_and_remove(
- new_args != nullptr ? new_args : args, keys_to_remove,
- GPR_ARRAY_SIZE(keys_to_remove), &new_arg, 1);
- gpr_free(new_arg.value.string);
- if (new_args != nullptr) grpc_channel_args_destroy(new_args);
- GRPC_CLOSURE_INIT(&on_connecting_finished_, OnConnectingFinished, this,
- grpc_schedule_on_exec_ctx);
- const grpc_arg* arg = grpc_channel_args_find(args_, GRPC_ARG_ENABLE_CHANNELZ);
- const bool channelz_enabled =
- grpc_channel_arg_get_bool(arg, GRPC_ENABLE_CHANNELZ_DEFAULT);
- arg = grpc_channel_args_find(
- args_, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE);
- const grpc_integer_options options = {
- GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0, INT_MAX};
- size_t channel_tracer_max_memory =
- static_cast<size_t>(grpc_channel_arg_get_integer(arg, options));
+ if (new_args != nullptr) {
+ args_ = new_args;
+ } else {
+ args_ = grpc_channel_args_copy(args);
+ }
+ // Initialize channelz.
+ const bool channelz_enabled = grpc_channel_args_find_bool(
+ args_, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT);
if (channelz_enabled) {
+ const size_t channel_tracer_max_memory =
+ static_cast<size_t>(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::SubchannelNode>(
- GetTargetAddress(), channel_tracer_max_memory);
+ grpc_sockaddr_to_uri(&key_.address()), channel_tracer_max_memory);
channelz_node_->AddTraceEvent(
channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("subchannel created"));
@@ -711,8 +697,8 @@ Subchannel::~Subchannel() {
RefCountedPtr<Subchannel> Subchannel::Create(
OrphanablePtr<SubchannelConnector> connector,
- const grpc_channel_args* args) {
- SubchannelKey key(args);
+ const grpc_resolved_address& address, const grpc_channel_args* args) {
+ SubchannelKey key(address, args);
SubchannelPoolInterface* subchannel_pool =
SubchannelPoolInterface::GetSubchannelPoolFromChannelArgs(args);
GPR_ASSERT(subchannel_pool != nullptr);
@@ -736,9 +722,9 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
// 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);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
+ gpr_log(GPR_INFO, "subchannel %p %s: throttling keepalive time to %d",
+ this, key_.ToString().c_str(), 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);
@@ -750,33 +736,18 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
}
}
-const char* Subchannel::GetTargetAddress() {
- const grpc_arg* addr_arg =
- grpc_channel_args_find(args_, GRPC_ARG_SUBCHANNEL_ADDRESS);
- const char* addr_str = grpc_channel_arg_get_string(addr_arg);
- GPR_ASSERT(addr_str != nullptr); // Should have been set by LB policy.
- return addr_str;
-}
-
channelz::SubchannelNode* Subchannel::channelz_node() {
return channelz_node_.get();
}
grpc_connectivity_state Subchannel::CheckConnectivityState(
- const absl::optional<std::string>& health_check_service_name,
- RefCountedPtr<ConnectedSubchannel>* connected_subchannel) {
+ const absl::optional<std::string>& health_check_service_name) {
MutexLock lock(&mu_);
- grpc_connectivity_state state;
- if (!health_check_service_name.has_value()) {
- state = state_;
- } else {
- state = health_watcher_map_.CheckConnectivityStateLocked(
+ if (health_check_service_name.has_value()) {
+ return health_watcher_map_.CheckConnectivityStateLocked(
this, *health_check_service_name);
}
- if (connected_subchannel != nullptr && state == GRPC_CHANNEL_READY) {
- *connected_subchannel = connected_subchannel_;
- }
- return state;
+ return state_;
}
void Subchannel::WatchConnectivityState(
@@ -790,7 +761,7 @@ void Subchannel::WatchConnectivityState(
}
if (!health_check_service_name.has_value()) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, this, state_, status_);
+ new AsyncWatcherNotifierLocked(watcher, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
} else {
@@ -848,44 +819,6 @@ void Subchannel::Orphan() {
health_watcher_map_.ShutdownLocked();
}
-grpc_arg Subchannel::CreateSubchannelAddressArg(
- const grpc_resolved_address* addr) {
- return grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_SUBCHANNEL_ADDRESS),
- gpr_strdup(addr->len > 0 ? grpc_sockaddr_to_uri(addr).c_str() : ""));
-}
-
-const char* Subchannel::GetUriFromSubchannelAddressArg(
- const grpc_channel_args* args) {
- const grpc_arg* addr_arg =
- grpc_channel_args_find(args, GRPC_ARG_SUBCHANNEL_ADDRESS);
- const char* addr_str = grpc_channel_arg_get_string(addr_arg);
- GPR_ASSERT(addr_str != nullptr); // Should have been set by LB policy.
- return addr_str;
-}
-
-namespace {
-
-void UriToSockaddr(const char* uri_str, grpc_resolved_address* addr) {
- absl::StatusOr<URI> uri = URI::Parse(uri_str);
- if (!uri.ok()) {
- gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
- GPR_ASSERT(uri.ok());
- }
- if (!grpc_parse_uri(*uri, addr)) memset(addr, 0, sizeof(*addr));
-}
-
-} // namespace
-
-void Subchannel::GetAddressFromSubchannelAddressArg(
- const grpc_channel_args* args, grpc_resolved_address* addr) {
- const char* addr_uri_str = GetUriFromSubchannelAddressArg(args);
- memset(addr, 0, sizeof(*addr));
- if (*addr_uri_str != '\0') {
- UriToSockaddr(addr_uri_str, addr);
- }
-}
-
namespace {
// Returns a string indicating the subchannel's connectivity state change to
@@ -922,7 +855,7 @@ void Subchannel::SetConnectivityStateLocked(grpc_connectivity_state state,
SubchannelConnectivityStateChangeString(state)));
}
// Notify non-health watchers.
- watcher_list_.NotifyLocked(this, state, status);
+ watcher_list_.NotifyLocked(state, status);
// Notify health watchers.
health_watcher_map_.NotifyLocked(state, status);
}
@@ -949,13 +882,14 @@ void Subchannel::MaybeStartConnectingLocked() {
} else {
GPR_ASSERT(!have_retry_alarm_);
have_retry_alarm_ = true;
- const grpc_millis time_til_next =
+ const Duration time_til_next =
next_attempt_deadline_ - ExecCtx::Get()->Now();
- if (time_til_next <= 0) {
- gpr_log(GPR_INFO, "Subchannel %p: Retry immediately", this);
+ if (time_til_next <= Duration::Zero()) {
+ gpr_log(GPR_INFO, "subchannel %p %s: Retry immediately", this,
+ key_.ToString().c_str());
} else {
- gpr_log(GPR_INFO, "Subchannel %p: Retry in %" PRId64 " milliseconds",
- this, time_til_next);
+ gpr_log(GPR_INFO, "subchannel %p %s: Retry in %" PRId64 " milliseconds",
+ this, key_.ToString().c_str(), time_til_next.millis());
}
GRPC_CLOSURE_INIT(&on_retry_alarm_, OnRetryAlarm, this,
grpc_schedule_on_exec_ctx);
@@ -974,10 +908,12 @@ void Subchannel::OnRetryAlarm(void* arg, grpc_error_handle error) {
c->retry_immediately_ = false;
error = GRPC_ERROR_NONE;
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
if (error == GRPC_ERROR_NONE) {
- gpr_log(GPR_INFO, "Failed to connect to channel, retrying");
+ gpr_log(GPR_INFO,
+ "subchannel %p %s: failed to connect to channel, retrying", c.get(),
+ c->key_.ToString().c_str());
c->ContinueConnectingLocked();
// Still connecting, keep ref around. Note that this stolen ref won't
// be dropped without first acquiring c->mu_.
@@ -988,9 +924,9 @@ void Subchannel::OnRetryAlarm(void* arg, grpc_error_handle error) {
void Subchannel::ContinueConnectingLocked() {
SubchannelConnector::Args args;
+ args.address = &address_for_connect_;
args.interested_parties = pollset_set_;
- const grpc_millis min_deadline =
- min_connect_timeout_ms_ + ExecCtx::Get()->Now();
+ const Timestamp min_deadline = min_connect_timeout_ + ExecCtx::Get()->Now();
next_attempt_deadline_ = backoff_.NextAttemptTime();
args.deadline = std::max(next_attempt_deadline_, min_deadline);
args.channel_args = args_;
@@ -1009,8 +945,8 @@ void Subchannel::OnConnectingFinished(void* arg, grpc_error_handle error) {
c->PublishTransportLocked()) {
// Do nothing, transport was published.
} else if (!c->disconnected_) {
- gpr_log(GPR_INFO, "Connect failed: %s",
- grpc_error_std_string(error).c_str());
+ gpr_log(GPR_INFO, "subchannel %p %s: connect failed: %s", c.get(),
+ c->key_.ToString().c_str(), grpc_error_std_string(error).c_str());
c->SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
grpc_error_to_absl_status(error));
}
@@ -1031,23 +967,20 @@ void ConnectionDestroy(void* arg, grpc_error_handle /*error*/) {
bool Subchannel::PublishTransportLocked() {
// Construct channel stack.
- grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
- grpc_channel_stack_builder_set_channel_arguments(
- builder, connecting_result_.channel_args);
- grpc_channel_stack_builder_set_transport(builder,
- connecting_result_.transport);
- if (!grpc_channel_init_create_stack(builder, GRPC_CLIENT_SUBCHANNEL)) {
- grpc_channel_stack_builder_destroy(builder);
+ ChannelStackBuilderImpl builder("subchannel", GRPC_CLIENT_SUBCHANNEL);
+ builder.SetChannelArgs(connecting_result_.channel_args)
+ .SetTransport(connecting_result_.transport);
+ if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
return false;
}
grpc_channel_stack* stk;
- grpc_error_handle error = grpc_channel_stack_builder_finish(
- builder, 0, 1, ConnectionDestroy, nullptr,
- reinterpret_cast<void**>(&stk));
+ grpc_error_handle error = builder.Build(0, 1, ConnectionDestroy, nullptr,
+ reinterpret_cast<void**>(&stk));
if (error != GRPC_ERROR_NONE) {
grpc_transport_destroy(connecting_result_.transport);
- gpr_log(GPR_ERROR, "error initializing subchannel stack: %s",
- grpc_error_std_string(error).c_str());
+ gpr_log(GPR_ERROR,
+ "subchannel %p %s: error initializing subchannel stack: %s", this,
+ key_.ToString().c_str(), grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return false;
}
@@ -1062,8 +995,10 @@ bool Subchannel::PublishTransportLocked() {
// Publish.
connected_subchannel_.reset(
new ConnectedSubchannel(stk, args_, channelz_node_));
- gpr_log(GPR_INFO, "New connected subchannel at %p for subchannel %p",
- connected_subchannel_.get(), this);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
+ gpr_log(GPR_INFO, "subchannel %p %s: new connected subchannel at %p", this,
+ key_.ToString().c_str(), connected_subchannel_.get());
+ }
if (channelz_node_ != nullptr) {
channelz_node_->SetChildSocket(std::move(socket));
}
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel.h b/grpc/src/core/ext/filters/client_channel/subchannel.h
index 9667fe7f..9e3ddd39 100644
--- a/grpc/src/core/ext/filters/client_channel/subchannel.h
+++ b/grpc/src/core/ext/filters/client_channel/subchannel.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
@@ -29,18 +27,14 @@
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/dual_ref_counted.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"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/arena.h"
#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.
-#define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
namespace grpc_core {
@@ -80,9 +74,9 @@ class SubchannelCall {
struct Args {
RefCountedPtr<ConnectedSubchannel> connected_subchannel;
grpc_polling_entity* pollent;
- grpc_slice path;
+ Slice path;
gpr_cycle_counter start_time;
- grpc_millis deadline;
+ Timestamp deadline;
Arena* arena;
grpc_call_context_element* context;
CallCombiner* call_combiner;
@@ -135,7 +129,7 @@ class SubchannelCall {
grpc_closure recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ = nullptr;
grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
- grpc_millis deadline_;
+ Timestamp deadline_;
};
// A subchannel that knows how to connect to exactly one target address. It
@@ -153,7 +147,6 @@ class Subchannel : public DualRefCounted<Subchannel> {
struct ConnectivityStateChange {
grpc_connectivity_state state;
absl::Status status;
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
};
~ConnectivityStateWatcherInterface() override = default;
@@ -190,10 +183,10 @@ class Subchannel : public DualRefCounted<Subchannel> {
ABSL_GUARDED_BY(&mu_);
};
- // Creates a subchannel given \a connector and \a args.
+ // Creates a subchannel.
static RefCountedPtr<Subchannel> Create(
OrphanablePtr<SubchannelConnector> connector,
- const grpc_channel_args* args);
+ const grpc_resolved_address& address, const grpc_channel_args* args);
// The ctor and dtor are not intended to use directly.
Subchannel(SubchannelKey key, OrphanablePtr<SubchannelConnector> connector,
@@ -205,10 +198,6 @@ class Subchannel : public DualRefCounted<Subchannel> {
// will have an affect when the subchannel creates a new ConnectedSubchannel.
void ThrottleKeepaliveTime(int new_keepalive_time) ABSL_LOCKS_EXCLUDED(mu_);
- // Gets the string representing the subchannel address.
- // Caller doesn't take ownership.
- const char* GetTargetAddress();
-
const grpc_channel_args* channel_args() const { return args_; }
channelz::SubchannelNode* channelz_node();
@@ -217,10 +206,8 @@ class Subchannel : public DualRefCounted<Subchannel> {
// If health_check_service_name is non-null, the returned connectivity
// state will be based on the state reported by the backend for that
// service name.
- // If the return value is GRPC_CHANNEL_READY, also sets *connected_subchannel.
grpc_connectivity_state CheckConnectivityState(
- const absl::optional<std::string>& health_check_service_name,
- RefCountedPtr<ConnectedSubchannel>* connected_subchannel)
+ const absl::optional<std::string>& health_check_service_name)
ABSL_LOCKS_EXCLUDED(mu_);
// Starts watching the subchannel's connectivity state.
@@ -243,31 +230,21 @@ class Subchannel : public DualRefCounted<Subchannel> {
const absl::optional<std::string>& health_check_service_name,
ConnectivityStateWatcherInterface* watcher) ABSL_LOCKS_EXCLUDED(mu_);
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel()
+ ABSL_LOCKS_EXCLUDED(mu_) {
+ MutexLock lock(&mu_);
+ return connected_subchannel_;
+ }
+
// Attempt to connect to the backend. Has no effect if already connected.
void AttemptToConnect() ABSL_LOCKS_EXCLUDED(mu_);
// Resets the connection backoff of the subchannel.
- // TODO(roth): Move connection backoff out of subchannels and up into LB
- // policy code (probably by adding a SubchannelGroup between
- // SubchannelList and SubchannelData), at which point this method can
- // go away.
void ResetBackoff() ABSL_LOCKS_EXCLUDED(mu_);
// Tears down any existing connection, and arranges for destruction
void Orphan() override ABSL_LOCKS_EXCLUDED(mu_);
- // Returns a new channel arg encoding the subchannel address as a URI
- // string. Caller is responsible for freeing the string.
- static grpc_arg CreateSubchannelAddressArg(const grpc_resolved_address* addr);
-
- // Returns the URI string from the subchannel address arg in \a args.
- static const char* GetUriFromSubchannelAddressArg(
- const grpc_channel_args* args);
-
- // Sets \a addr from the subchannel address arg in \a args.
- static void GetAddressFromSubchannelAddressArg(const grpc_channel_args* args,
- grpc_resolved_address* addr);
-
private:
// A linked list of ConnectivityStateWatcherInterfaces that are monitoring
// the subchannel's state.
@@ -280,7 +257,7 @@ class Subchannel : public DualRefCounted<Subchannel> {
void RemoveWatcherLocked(ConnectivityStateWatcherInterface* watcher);
// Notifies all watchers in the list about a change to state.
- void NotifyLocked(Subchannel* subchannel, grpc_connectivity_state state,
+ void NotifyLocked(grpc_connectivity_state state,
const absl::Status& status);
void Clear() { watchers_.clear(); }
@@ -350,9 +327,11 @@ class Subchannel : public DualRefCounted<Subchannel> {
// The subchannel pool this subchannel is in.
RefCountedPtr<SubchannelPoolInterface> subchannel_pool_;
- // TODO(juanlishen): Consider using args_ as key_ directly.
// Subchannel key that identifies this subchannel in the subchannel pool.
const SubchannelKey key_;
+ // Actual address to connect to. May be different than the address in
+ // key_ if overridden by proxy mapper.
+ grpc_resolved_address address_for_connect_;
// Channel args.
grpc_channel_args* args_;
// pollset_set tracking who's interested in a connection being setup.
@@ -381,10 +360,11 @@ class Subchannel : public DualRefCounted<Subchannel> {
// The map of watchers with health check service names.
HealthWatcherMap health_watcher_map_ ABSL_GUARDED_BY(mu_);
+ // Minimum connect timeout - must be located before backoff_.
+ Duration min_connect_timeout_ ABSL_GUARDED_BY(mu_);
// Backoff state.
BackOff backoff_ ABSL_GUARDED_BY(mu_);
- grpc_millis next_attempt_deadline_ ABSL_GUARDED_BY(mu_);
- grpc_millis min_connect_timeout_ms_ ABSL_GUARDED_BY(mu_);
+ Timestamp next_attempt_deadline_ ABSL_GUARDED_BY(mu_);
bool backoff_begun_ ABSL_GUARDED_BY(mu_) = false;
// Retry alarm.
@@ -399,4 +379,4 @@ class Subchannel : public DualRefCounted<Subchannel> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc b/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
index 308541c5..d6b12ecc 100644
--- a/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
+++ b/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
@@ -20,10 +20,11 @@
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/useful.h"
// The subchannel pool to reuse subchannels.
-#define GRPC_ARG_SUBCHANNEL_POOL "grpc.subchannel_pool"
+#define GRPC_ARG_SUBCHANNEL_POOL "grpc.internal.subchannel_pool"
// The subchannel key ID that is only used in test to make each key unique.
#define GRPC_ARG_SUBCHANNEL_KEY_TEST_ONLY_ID "grpc.subchannel_key_test_only_id"
@@ -31,8 +32,9 @@ namespace grpc_core {
TraceFlag grpc_subchannel_pool_trace(false, "subchannel_pool");
-SubchannelKey::SubchannelKey(const grpc_channel_args* args) {
- Init(args, grpc_channel_args_normalize);
+SubchannelKey::SubchannelKey(const grpc_resolved_address& address,
+ const grpc_channel_args* args) {
+ Init(address, args, grpc_channel_args_normalize);
}
SubchannelKey::~SubchannelKey() {
@@ -40,7 +42,7 @@ SubchannelKey::~SubchannelKey() {
}
SubchannelKey::SubchannelKey(const SubchannelKey& other) {
- Init(other.args_, grpc_channel_args_copy);
+ Init(other.address_, other.args_, grpc_channel_args_copy);
}
SubchannelKey& SubchannelKey::operator=(const SubchannelKey& other) {
@@ -48,31 +50,44 @@ SubchannelKey& SubchannelKey::operator=(const SubchannelKey& other) {
return *this;
}
grpc_channel_args_destroy(const_cast<grpc_channel_args*>(args_));
- Init(other.args_, grpc_channel_args_copy);
+ Init(other.address_, other.args_, grpc_channel_args_copy);
return *this;
}
SubchannelKey::SubchannelKey(SubchannelKey&& other) noexcept {
+ address_ = other.address_;
args_ = other.args_;
other.args_ = nullptr;
}
SubchannelKey& SubchannelKey::operator=(SubchannelKey&& other) noexcept {
+ address_ = other.address_;
args_ = other.args_;
other.args_ = nullptr;
return *this;
}
bool SubchannelKey::operator<(const SubchannelKey& other) const {
+ if (address_.len < other.address_.len) return true;
+ if (address_.len > other.address_.len) return false;
+ int r = memcmp(address_.addr, other.address_.addr, address_.len);
+ if (r < 0) return true;
+ if (r > 0) return false;
return grpc_channel_args_compare(args_, other.args_) < 0;
}
void SubchannelKey::Init(
- const grpc_channel_args* args,
+ const grpc_resolved_address& address, const grpc_channel_args* args,
grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args)) {
+ address_ = address;
args_ = copy_channel_args(args);
}
+std::string SubchannelKey::ToString() const {
+ return absl::StrCat("{address=", grpc_sockaddr_to_uri(&address_),
+ ", args=", grpc_channel_args_string(args_), "}");
+}
+
namespace {
void* arg_copy(void* p) {
@@ -86,7 +101,7 @@ void arg_destroy(void* p) {
subchannel_pool->Unref();
}
-int arg_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+int arg_cmp(void* a, void* b) { return QsortCompare(a, b); }
const grpc_arg_pointer_vtable subchannel_pool_arg_vtable = {
arg_copy, arg_destroy, arg_cmp};
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h b/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
index 8a8a0cb6..515104db 100644
--- a/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
+++ b/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
@@ -25,6 +25,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/iomgr/resolve_address.h"
namespace grpc_core {
@@ -35,7 +36,8 @@ extern TraceFlag grpc_subchannel_pool_trace;
// A key that can uniquely identify a subchannel.
class SubchannelKey {
public:
- explicit SubchannelKey(const grpc_channel_args* args);
+ SubchannelKey(const grpc_resolved_address& address,
+ const grpc_channel_args* args);
~SubchannelKey();
// Copyable.
@@ -47,13 +49,20 @@ class SubchannelKey {
bool operator<(const SubchannelKey& other) const;
+ const grpc_resolved_address& address() const { return address_; }
+ const grpc_channel_args* args() const { return args_; }
+
+ // Human-readable string suitable for logging.
+ std::string ToString() const;
+
private:
// Initializes the subchannel key with the given \a args and the function to
// copy channel args.
void Init(
- const grpc_channel_args* args,
+ const grpc_resolved_address& address, const grpc_channel_args* args,
grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args));
+ grpc_resolved_address address_;
const grpc_channel_args* args_;
};
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.cc b/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.cc
new file mode 100644
index 00000000..a596e044
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.cc
@@ -0,0 +1,544 @@
+//
+// 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/filters/client_channel/subchannel_stream_client.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+#include <grpc/status.h>
+
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/error_utils.h"
+
+#define SUBCHANNEL_STREAM_INITIAL_CONNECT_BACKOFF_SECONDS 1
+#define SUBCHANNEL_STREAM_RECONNECT_BACKOFF_MULTIPLIER 1.6
+#define SUBCHANNEL_STREAM_RECONNECT_MAX_BACKOFF_SECONDS 120
+#define SUBCHANNEL_STREAM_RECONNECT_JITTER 0.2
+
+namespace grpc_core {
+
+//
+// SubchannelStreamClient
+//
+
+SubchannelStreamClient::SubchannelStreamClient(
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel,
+ grpc_pollset_set* interested_parties,
+ std::unique_ptr<CallEventHandler> event_handler, const char* tracer)
+ : InternallyRefCounted<SubchannelStreamClient>(tracer),
+ connected_subchannel_(std::move(connected_subchannel)),
+ interested_parties_(interested_parties),
+ tracer_(tracer),
+ call_allocator_(
+ ResourceQuotaFromChannelArgs(connected_subchannel_->args())
+ ->memory_quota()
+ ->CreateMemoryAllocator(tracer)),
+ event_handler_(std::move(event_handler)),
+ retry_backoff_(
+ BackOff::Options()
+ .set_initial_backoff(Duration::Seconds(
+ SUBCHANNEL_STREAM_INITIAL_CONNECT_BACKOFF_SECONDS))
+ .set_multiplier(SUBCHANNEL_STREAM_RECONNECT_BACKOFF_MULTIPLIER)
+ .set_jitter(SUBCHANNEL_STREAM_RECONNECT_JITTER)
+ .set_max_backoff(Duration::Seconds(
+ SUBCHANNEL_STREAM_RECONNECT_MAX_BACKOFF_SECONDS))) {
+ if (GPR_UNLIKELY(tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: created SubchannelStreamClient", tracer_, this);
+ }
+ GRPC_CLOSURE_INIT(&retry_timer_callback_, OnRetryTimer, this,
+ grpc_schedule_on_exec_ctx);
+ StartCall();
+}
+
+SubchannelStreamClient::~SubchannelStreamClient() {
+ if (GPR_UNLIKELY(tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: destroying SubchannelStreamClient", tracer_,
+ this);
+ }
+}
+
+void SubchannelStreamClient::Orphan() {
+ if (GPR_UNLIKELY(tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient shutting down", tracer_,
+ this);
+ }
+ {
+ MutexLock lock(&mu_);
+ event_handler_.reset();
+ call_state_.reset();
+ if (retry_timer_callback_pending_) {
+ grpc_timer_cancel(&retry_timer_);
+ }
+ }
+ Unref(DEBUG_LOCATION, "orphan");
+}
+
+void SubchannelStreamClient::StartCall() {
+ MutexLock lock(&mu_);
+ StartCallLocked();
+}
+
+void SubchannelStreamClient::StartCallLocked() {
+ if (event_handler_ == nullptr) return;
+ GPR_ASSERT(call_state_ == nullptr);
+ if (event_handler_ != nullptr) {
+ event_handler_->OnCallStartLocked(this);
+ }
+ call_state_ = MakeOrphanable<CallState>(Ref(), interested_parties_);
+ if (GPR_UNLIKELY(tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient created CallState %p",
+ tracer_, this, call_state_.get());
+ }
+ call_state_->StartCallLocked();
+}
+
+void SubchannelStreamClient::StartRetryTimerLocked() {
+ if (event_handler_ != nullptr) {
+ event_handler_->OnRetryTimerStartLocked(this);
+ }
+ Timestamp next_try = retry_backoff_.NextAttemptTime();
+ if (GPR_UNLIKELY(tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient health check call lost...",
+ tracer_, this);
+ Duration timeout = next_try - ExecCtx::Get()->Now();
+ if (timeout > Duration::Zero()) {
+ gpr_log(GPR_INFO, "%s %p: ... will retry in %" PRId64 "ms.", tracer_,
+ this, timeout.millis());
+ } else {
+ gpr_log(GPR_INFO, "%s %p: ... retrying immediately.", tracer_, this);
+ }
+ }
+ // Ref for callback, tracked manually.
+ Ref(DEBUG_LOCATION, "health_retry_timer").release();
+ retry_timer_callback_pending_ = true;
+ grpc_timer_init(&retry_timer_, next_try, &retry_timer_callback_);
+}
+
+void SubchannelStreamClient::OnRetryTimer(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<SubchannelStreamClient*>(arg);
+ {
+ MutexLock lock(&self->mu_);
+ self->retry_timer_callback_pending_ = false;
+ if (self->event_handler_ != nullptr && error == GRPC_ERROR_NONE &&
+ self->call_state_ == nullptr) {
+ if (GPR_UNLIKELY(self->tracer_ != nullptr)) {
+ gpr_log(GPR_INFO,
+ "%s %p: SubchannelStreamClient restarting health check call",
+ self->tracer_, self);
+ }
+ self->StartCallLocked();
+ }
+ }
+ self->Unref(DEBUG_LOCATION, "health_retry_timer");
+}
+
+//
+// SubchannelStreamClient::CallState
+//
+
+SubchannelStreamClient::CallState::CallState(
+ RefCountedPtr<SubchannelStreamClient> health_check_client,
+ grpc_pollset_set* interested_parties)
+ : subchannel_stream_client_(std::move(health_check_client)),
+ pollent_(grpc_polling_entity_create_from_pollset_set(interested_parties)),
+ arena_(Arena::Create(subchannel_stream_client_->connected_subchannel_
+ ->GetInitialCallSizeEstimate(),
+ &subchannel_stream_client_->call_allocator_)),
+ payload_(context_),
+ send_initial_metadata_(arena_.get()),
+ send_trailing_metadata_(arena_.get()),
+ recv_initial_metadata_(arena_.get()),
+ recv_trailing_metadata_(arena_.get()) {}
+
+SubchannelStreamClient::CallState::~CallState() {
+ if (GPR_UNLIKELY(subchannel_stream_client_->tracer_ != nullptr)) {
+ gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient destroying CallState %p",
+ subchannel_stream_client_->tracer_, subchannel_stream_client_.get(),
+ this);
+ }
+ for (size_t i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
+ if (context_[i].destroy != nullptr) {
+ context_[i].destroy(context_[i].value);
+ }
+ }
+ // Unset the call combiner cancellation closure. This has the
+ // effect of scheduling the previously set cancellation closure, if
+ // any, so that it can release any internal references it may be
+ // holding to the call stack.
+ call_combiner_.SetNotifyOnCancel(nullptr);
+}
+
+void SubchannelStreamClient::CallState::Orphan() {
+ call_combiner_.Cancel(GRPC_ERROR_CANCELLED);
+ Cancel();
+}
+
+void SubchannelStreamClient::CallState::StartCallLocked() {
+ SubchannelCall::Args args = {
+ subchannel_stream_client_->connected_subchannel_,
+ &pollent_,
+ Slice::FromStaticString("/grpc.health.v1.Health/Watch"),
+ gpr_get_cycle_counter(), // start_time
+ Timestamp::InfFuture(), // deadline
+ arena_.get(),
+ context_,
+ &call_combiner_,
+ };
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ call_ = SubchannelCall::Create(std::move(args), &error).release();
+ // Register after-destruction callback.
+ GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
+ this, grpc_schedule_on_exec_ctx);
+ call_->SetAfterCallStackDestroy(&after_call_stack_destruction_);
+ // Check if creation failed.
+ if (error != GRPC_ERROR_NONE ||
+ subchannel_stream_client_->event_handler_ == nullptr) {
+ gpr_log(GPR_ERROR,
+ "SubchannelStreamClient %p CallState %p: error creating "
+ "stream on subchannel (%s); will retry",
+ subchannel_stream_client_.get(), this,
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ CallEndedLocked(/*retry=*/true);
+ return;
+ }
+ // Initialize payload and batch.
+ payload_.context = context_;
+ batch_.payload = &payload_;
+ // on_complete callback takes ref, handled manually.
+ call_->Ref(DEBUG_LOCATION, "on_complete").release();
+ batch_.on_complete = GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this,
+ grpc_schedule_on_exec_ctx);
+ // Add send_initial_metadata op.
+ send_initial_metadata_.Set(
+ HttpPathMetadata(),
+ subchannel_stream_client_->event_handler_->GetPathLocked());
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ payload_.send_initial_metadata.send_initial_metadata =
+ &send_initial_metadata_;
+ payload_.send_initial_metadata.send_initial_metadata_flags = 0;
+ payload_.send_initial_metadata.peer_string = nullptr;
+ batch_.send_initial_metadata = true;
+ // Add send_message op.
+ grpc_slice request_slice =
+ subchannel_stream_client_->event_handler_->EncodeSendMessageLocked();
+ grpc_slice_buffer slice_buffer;
+ grpc_slice_buffer_init(&slice_buffer);
+ grpc_slice_buffer_add(&slice_buffer, request_slice);
+ send_message_.emplace(&slice_buffer, 0);
+ grpc_slice_buffer_destroy_internal(&slice_buffer);
+ payload_.send_message.send_message.reset(&*send_message_);
+ batch_.send_message = true;
+ // Add send_trailing_metadata op.
+ payload_.send_trailing_metadata.send_trailing_metadata =
+ &send_trailing_metadata_;
+ batch_.send_trailing_metadata = true;
+ // Add recv_initial_metadata op.
+ payload_.recv_initial_metadata.recv_initial_metadata =
+ &recv_initial_metadata_;
+ payload_.recv_initial_metadata.recv_flags = nullptr;
+ payload_.recv_initial_metadata.trailing_metadata_available = nullptr;
+ payload_.recv_initial_metadata.peer_string = nullptr;
+ // recv_initial_metadata_ready callback takes ref, handled manually.
+ call_->Ref(DEBUG_LOCATION, "recv_initial_metadata_ready").release();
+ payload_.recv_initial_metadata.recv_initial_metadata_ready =
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ this, grpc_schedule_on_exec_ctx);
+ batch_.recv_initial_metadata = true;
+ // Add recv_message op.
+ payload_.recv_message.recv_message = &recv_message_;
+ payload_.recv_message.call_failed_before_recv_message = nullptr;
+ // recv_message callback takes ref, handled manually.
+ call_->Ref(DEBUG_LOCATION, "recv_message_ready").release();
+ payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
+ &recv_message_ready_, RecvMessageReady, this, grpc_schedule_on_exec_ctx);
+ batch_.recv_message = true;
+ // Start batch.
+ StartBatch(&batch_);
+ // Initialize recv_trailing_metadata batch.
+ recv_trailing_metadata_batch_.payload = &payload_;
+ // Add recv_trailing_metadata op.
+ payload_.recv_trailing_metadata.recv_trailing_metadata =
+ &recv_trailing_metadata_;
+ payload_.recv_trailing_metadata.collect_stats = &collect_stats_;
+ // This callback signals the end of the call, so it relies on the
+ // initial ref instead of taking a new ref. When it's invoked, the
+ // initial ref is released.
+ payload_.recv_trailing_metadata.recv_trailing_metadata_ready =
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReady, this,
+ grpc_schedule_on_exec_ctx);
+ recv_trailing_metadata_batch_.recv_trailing_metadata = true;
+ // Start recv_trailing_metadata batch.
+ StartBatch(&recv_trailing_metadata_batch_);
+}
+
+void SubchannelStreamClient::CallState::StartBatchInCallCombiner(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* batch = static_cast<grpc_transport_stream_op_batch*>(arg);
+ auto* call = static_cast<SubchannelCall*>(batch->handler_private.extra_arg);
+ call->StartTransportStreamOpBatch(batch);
+}
+
+void SubchannelStreamClient::CallState::StartBatch(
+ grpc_transport_stream_op_batch* batch) {
+ batch->handler_private.extra_arg = call_;
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
+ batch, grpc_schedule_on_exec_ctx);
+ GRPC_CALL_COMBINER_START(&call_combiner_, &batch->handler_private.closure,
+ GRPC_ERROR_NONE, "start_subchannel_batch");
+}
+
+void SubchannelStreamClient::CallState::AfterCallStackDestruction(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ delete self;
+}
+
+void SubchannelStreamClient::CallState::OnCancelComplete(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "health_cancel");
+ self->call_->Unref(DEBUG_LOCATION, "cancel");
+}
+
+void SubchannelStreamClient::CallState::StartCancel(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ auto* batch = grpc_make_transport_stream_op(
+ GRPC_CLOSURE_CREATE(OnCancelComplete, self, grpc_schedule_on_exec_ctx));
+ batch->cancel_stream = true;
+ batch->payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
+ self->call_->StartTransportStreamOpBatch(batch);
+}
+
+void SubchannelStreamClient::CallState::Cancel() {
+ bool expected = false;
+ if (cancelled_.compare_exchange_strong(expected, true,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ call_->Ref(DEBUG_LOCATION, "cancel").release();
+ GRPC_CALL_COMBINER_START(
+ &call_combiner_,
+ GRPC_CLOSURE_CREATE(StartCancel, this, grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_NONE, "health_cancel");
+ }
+}
+
+void SubchannelStreamClient::CallState::OnComplete(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "on_complete");
+ self->send_initial_metadata_.Clear();
+ self->send_trailing_metadata_.Clear();
+ self->call_->Unref(DEBUG_LOCATION, "on_complete");
+}
+
+void SubchannelStreamClient::CallState::RecvInitialMetadataReady(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_initial_metadata_ready");
+ self->recv_initial_metadata_.Clear();
+ self->call_->Unref(DEBUG_LOCATION, "recv_initial_metadata_ready");
+}
+
+void SubchannelStreamClient::CallState::DoneReadingRecvMessage(
+ grpc_error_handle error) {
+ recv_message_.reset();
+ if (error != GRPC_ERROR_NONE) {
+ GRPC_ERROR_UNREF(error);
+ Cancel();
+ grpc_slice_buffer_destroy_internal(&recv_message_buffer_);
+ call_->Unref(DEBUG_LOCATION, "recv_message_ready");
+ return;
+ }
+ // Concatenate the slices to form a single string.
+ std::unique_ptr<uint8_t> recv_message_deleter;
+ uint8_t* recv_message;
+ if (recv_message_buffer_.count == 1) {
+ recv_message = GRPC_SLICE_START_PTR(recv_message_buffer_.slices[0]);
+ } else {
+ recv_message =
+ static_cast<uint8_t*>(gpr_malloc(recv_message_buffer_.length));
+ recv_message_deleter.reset(recv_message);
+ size_t offset = 0;
+ for (size_t i = 0; i < recv_message_buffer_.count; ++i) {
+ memcpy(recv_message + offset,
+ GRPC_SLICE_START_PTR(recv_message_buffer_.slices[i]),
+ GRPC_SLICE_LENGTH(recv_message_buffer_.slices[i]));
+ offset += GRPC_SLICE_LENGTH(recv_message_buffer_.slices[i]);
+ }
+ }
+ // Report payload.
+ {
+ MutexLock lock(&subchannel_stream_client_->mu_);
+ if (subchannel_stream_client_->event_handler_ != nullptr) {
+ absl::string_view serialized_message(
+ reinterpret_cast<char*>(recv_message), recv_message_buffer_.length);
+ absl::Status status =
+ subchannel_stream_client_->event_handler_->RecvMessageReadyLocked(
+ subchannel_stream_client_.get(), serialized_message);
+ if (!status.ok()) {
+ if (GPR_UNLIKELY(subchannel_stream_client_->tracer_ != nullptr)) {
+ gpr_log(GPR_INFO,
+ "%s %p: SubchannelStreamClient CallState %p: failed to "
+ "parse response message: %s",
+ subchannel_stream_client_->tracer_,
+ subchannel_stream_client_.get(), this,
+ status.ToString().c_str());
+ }
+ Cancel();
+ }
+ }
+ }
+ seen_response_.store(true, std::memory_order_release);
+ grpc_slice_buffer_destroy_internal(&recv_message_buffer_);
+ // Start another recv_message batch.
+ // This re-uses the ref we're holding.
+ // Note: Can't just reuse batch_ here, since we don't know that all
+ // callbacks from the original batch have completed yet.
+ recv_message_batch_.payload = &payload_;
+ payload_.recv_message.recv_message = &recv_message_;
+ payload_.recv_message.call_failed_before_recv_message = nullptr;
+ payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
+ &recv_message_ready_, RecvMessageReady, this, grpc_schedule_on_exec_ctx);
+ recv_message_batch_.recv_message = true;
+ StartBatch(&recv_message_batch_);
+}
+
+grpc_error_handle
+SubchannelStreamClient::CallState::PullSliceFromRecvMessage() {
+ grpc_slice slice;
+ grpc_error_handle error = recv_message_->Pull(&slice);
+ if (error == GRPC_ERROR_NONE) {
+ grpc_slice_buffer_add(&recv_message_buffer_, slice);
+ }
+ return error;
+}
+
+void SubchannelStreamClient::CallState::ContinueReadingRecvMessage() {
+ while (recv_message_->Next(SIZE_MAX, &recv_message_ready_)) {
+ grpc_error_handle error = PullSliceFromRecvMessage();
+ if (error != GRPC_ERROR_NONE) {
+ DoneReadingRecvMessage(error);
+ return;
+ }
+ if (recv_message_buffer_.length == recv_message_->length()) {
+ DoneReadingRecvMessage(GRPC_ERROR_NONE);
+ break;
+ }
+ }
+}
+
+void SubchannelStreamClient::CallState::OnByteStreamNext(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ if (error != GRPC_ERROR_NONE) {
+ self->DoneReadingRecvMessage(GRPC_ERROR_REF(error));
+ return;
+ }
+ error = self->PullSliceFromRecvMessage();
+ if (error != GRPC_ERROR_NONE) {
+ self->DoneReadingRecvMessage(error);
+ return;
+ }
+ if (self->recv_message_buffer_.length == self->recv_message_->length()) {
+ self->DoneReadingRecvMessage(GRPC_ERROR_NONE);
+ } else {
+ self->ContinueReadingRecvMessage();
+ }
+}
+
+void SubchannelStreamClient::CallState::RecvMessageReady(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_message_ready");
+ if (self->recv_message_ == nullptr) {
+ self->call_->Unref(DEBUG_LOCATION, "recv_message_ready");
+ return;
+ }
+ grpc_slice_buffer_init(&self->recv_message_buffer_);
+ GRPC_CLOSURE_INIT(&self->recv_message_ready_, OnByteStreamNext, self,
+ grpc_schedule_on_exec_ctx);
+ self->ContinueReadingRecvMessage();
+ // Ref will continue to be held until we finish draining the byte stream.
+}
+
+void SubchannelStreamClient::CallState::RecvTrailingMetadataReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<SubchannelStreamClient::CallState*>(arg);
+ GRPC_CALL_COMBINER_STOP(&self->call_combiner_,
+ "recv_trailing_metadata_ready");
+ // Get call status.
+ grpc_status_code status =
+ self->recv_trailing_metadata_.get(GrpcStatusMetadata())
+ .value_or(GRPC_STATUS_UNKNOWN);
+ if (error != GRPC_ERROR_NONE) {
+ grpc_error_get_status(error, Timestamp::InfFuture(), &status,
+ nullptr /* slice */, nullptr /* http_error */,
+ nullptr /* error_string */);
+ }
+ if (GPR_UNLIKELY(self->subchannel_stream_client_->tracer_ != nullptr)) {
+ gpr_log(GPR_INFO,
+ "%s %p: SubchannelStreamClient CallState %p: health watch failed "
+ "with status %d",
+ self->subchannel_stream_client_->tracer_,
+ self->subchannel_stream_client_.get(), self, status);
+ }
+ // Clean up.
+ self->recv_trailing_metadata_.Clear();
+ // Report call end.
+ MutexLock lock(&self->subchannel_stream_client_->mu_);
+ if (self->subchannel_stream_client_->event_handler_ != nullptr) {
+ self->subchannel_stream_client_->event_handler_
+ ->RecvTrailingMetadataReadyLocked(self->subchannel_stream_client_.get(),
+ status);
+ }
+ // For status UNIMPLEMENTED, give up and assume always healthy.
+ self->CallEndedLocked(/*retry=*/status != GRPC_STATUS_UNIMPLEMENTED);
+}
+
+void SubchannelStreamClient::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
+ // is required.
+ if (this == subchannel_stream_client_->call_state_.get()) {
+ subchannel_stream_client_->call_state_.reset();
+ if (retry) {
+ GPR_ASSERT(subchannel_stream_client_->event_handler_ != nullptr);
+ if (seen_response_.load(std::memory_order_acquire)) {
+ // If the call fails after we've gotten a successful response, reset
+ // the backoff and restart the call immediately.
+ subchannel_stream_client_->retry_backoff_.Reset();
+ subchannel_stream_client_->StartCallLocked();
+ } else {
+ // If the call failed without receiving any messages, retry later.
+ subchannel_stream_client_->StartRetryTimerLocked();
+ }
+ }
+ }
+ // When the last ref to the call stack goes away, the CallState object
+ // will be automatically destroyed.
+ call_->Unref(DEBUG_LOCATION, "call_ended");
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.h b/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.h
new file mode 100644
index 00000000..b48ab223
--- /dev/null
+++ b/grpc/src/core/ext/filters/client_channel/subchannel_stream_client.h
@@ -0,0 +1,214 @@
+//
+// 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_SUBCHANNEL_STREAM_CLIENT_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_STREAM_CLIENT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+#include "absl/status/status.h"
+#include "absl/strings/string_view.h"
+
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/backoff/backoff.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/call_combiner.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/transport/byte_stream.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/transport.h"
+
+namespace grpc_core {
+
+// Represents a streaming call on a subchannel that should be maintained
+// open at all times.
+// If the call fails with UNIMPLEMENTED, no further attempts are made.
+// If the call fails with any other status (including OK), we retry the
+// call with appropriate backoff.
+// The backoff state is reset when we receive a message on a stream.
+//
+// Currently, this assumes server-side streaming, but it could be extended
+// to support full bidi streaming if there is a need in the future.
+class SubchannelStreamClient
+ : public InternallyRefCounted<SubchannelStreamClient> {
+ public:
+ // Interface implemented by caller. Thread safety is provided for the
+ // implementation; only one method will be called by any thread at any
+ // one time (including destruction).
+ //
+ // The address of the SubchannelStreamClient object is passed to most
+ // methods for logging purposes.
+ class CallEventHandler {
+ public:
+ virtual ~CallEventHandler() = default;
+
+ // Returns the path for the streaming call.
+ virtual Slice GetPathLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ // Called when a new call attempt is being started.
+ virtual void OnCallStartLocked(SubchannelStreamClient* client)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ // Called when a previous call attempt has failed and the retry
+ // timer is started before the next attempt.
+ virtual void OnRetryTimerStartLocked(SubchannelStreamClient* client)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ // Returns the message payload to send from the client.
+ virtual grpc_slice EncodeSendMessageLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ // Called whenever a message is received from the server.
+ virtual absl::Status RecvMessageReadyLocked(
+ SubchannelStreamClient* client, absl::string_view serialized_message)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ // Called when a stream fails.
+ virtual void RecvTrailingMetadataReadyLocked(SubchannelStreamClient* client,
+ grpc_status_code status)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_) = 0;
+ };
+
+ // If tracer is non-null, it enables trace logging, with the specified
+ // string being the first part of the log message.
+ // Does not take ownership of interested_parties; the caller is responsible
+ // for ensuring that it will outlive the SubchannelStreamClient.
+ SubchannelStreamClient(
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel,
+ grpc_pollset_set* interested_parties,
+ std::unique_ptr<CallEventHandler> event_handler, const char* tracer);
+
+ ~SubchannelStreamClient() override;
+
+ void Orphan() override;
+
+ private:
+ // Contains a call to the backend and all the data related to the call.
+ class CallState : public Orphanable {
+ public:
+ CallState(RefCountedPtr<SubchannelStreamClient> client,
+ grpc_pollset_set* interested_parties);
+ ~CallState() override;
+
+ void Orphan() override;
+
+ void StartCallLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&SubchannelStreamClient::mu_);
+
+ private:
+ void Cancel();
+
+ void StartBatch(grpc_transport_stream_op_batch* batch);
+ static void StartBatchInCallCombiner(void* arg, grpc_error_handle error);
+
+ void CallEndedLocked(bool retry)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&subchannel_stream_client_->mu_);
+
+ static void OnComplete(void* arg, grpc_error_handle error);
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+ static void RecvMessageReady(void* arg, grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
+ static void StartCancel(void* arg, grpc_error_handle error);
+ static void OnCancelComplete(void* arg, grpc_error_handle error);
+
+ static void OnByteStreamNext(void* arg, grpc_error_handle error);
+ void ContinueReadingRecvMessage();
+ grpc_error_handle PullSliceFromRecvMessage();
+ void DoneReadingRecvMessage(grpc_error_handle error);
+
+ static void AfterCallStackDestruction(void* arg, grpc_error_handle error);
+
+ RefCountedPtr<SubchannelStreamClient> subchannel_stream_client_;
+ grpc_polling_entity pollent_;
+
+ ScopedArenaPtr arena_;
+ CallCombiner call_combiner_;
+ grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
+
+ // The streaming call to the backend. Always non-null.
+ // Refs are tracked manually; when the last ref is released, the
+ // CallState object will be automatically destroyed.
+ SubchannelCall* call_;
+
+ grpc_transport_stream_op_batch_payload payload_;
+ grpc_transport_stream_op_batch batch_;
+ grpc_transport_stream_op_batch recv_message_batch_;
+ grpc_transport_stream_op_batch recv_trailing_metadata_batch_;
+
+ grpc_closure on_complete_;
+
+ // send_initial_metadata
+ grpc_metadata_batch send_initial_metadata_;
+
+ // send_message
+ absl::optional<SliceBufferByteStream> send_message_;
+
+ // send_trailing_metadata
+ grpc_metadata_batch send_trailing_metadata_;
+
+ // recv_initial_metadata
+ grpc_metadata_batch recv_initial_metadata_;
+ grpc_closure recv_initial_metadata_ready_;
+
+ // recv_message
+ OrphanablePtr<ByteStream> recv_message_;
+ grpc_closure recv_message_ready_;
+ grpc_slice_buffer recv_message_buffer_;
+ std::atomic<bool> seen_response_{false};
+
+ // True if the cancel_stream batch has been started.
+ std::atomic<bool> cancelled_{false};
+
+ // recv_trailing_metadata
+ grpc_metadata_batch recv_trailing_metadata_;
+ grpc_transport_stream_stats collect_stats_;
+ grpc_closure recv_trailing_metadata_ready_;
+
+ // Closure for call stack destruction.
+ grpc_closure after_call_stack_destruction_;
+ };
+
+ void StartCall();
+ void StartCallLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
+
+ void StartRetryTimerLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
+ static void OnRetryTimer(void* arg, grpc_error_handle error);
+
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
+ grpc_pollset_set* interested_parties_; // Do not own.
+ const char* tracer_;
+ MemoryAllocator call_allocator_;
+
+ Mutex mu_;
+ std::unique_ptr<CallEventHandler> event_handler_ ABSL_GUARDED_BY(mu_);
+
+ // The data associated with the current health check call. It holds a ref
+ // to this SubchannelStreamClient object.
+ OrphanablePtr<CallState> call_state_ ABSL_GUARDED_BY(mu_);
+
+ // Call retry state.
+ BackOff retry_backoff_ ABSL_GUARDED_BY(mu_);
+ grpc_timer retry_timer_ ABSL_GUARDED_BY(mu_);
+ grpc_closure retry_timer_callback_ ABSL_GUARDED_BY(mu_);
+ bool retry_timer_callback_pending_ ABSL_GUARDED_BY(mu_) = false;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_STREAM_CLIENT_H
diff --git a/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc b/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
deleted file mode 100644
index 01abaab7..00000000
--- a/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- *
- * 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 <limits.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/http2_errors.h"
-
-// TODO(juanlishen): The idle filter is disabled in client channel by default
-// due to b/143502997. Try to fix the bug and enable the filter by default.
-#define DEFAULT_IDLE_TIMEOUT_MS INT_MAX
-// The user input idle timeout smaller than this would be capped to it.
-#define MIN_IDLE_TIMEOUT_MS (1 /*second*/ * 1000)
-
-namespace grpc_core {
-
-TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter");
-
-#define GRPC_IDLE_FILTER_LOG(format, ...) \
- do { \
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_client_idle_filter)) { \
- gpr_log(GPR_INFO, "(client idle filter) " format, ##__VA_ARGS__); \
- } \
- } while (0)
-
-namespace {
-
-/*
- client_idle_filter maintains a state tracking if there are active calls in the
- channel and its internal idle_timer_. The states are specified as following:
-
- +--------------------------------------------+-------------+---------+
- | ChannelState | idle_timer_ | channel |
- +--------------------------------------------+-------------+---------+
- | IDLE | unset | idle |
- | CALLS_ACTIVE | unset | busy |
- | TIMER_PENDING | set-valid | idle |
- | TIMER_PENDING_CALLS_ACTIVE | set-invalid | busy |
- | TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START | set-invalid | idle |
- +--------------------------------------------+-------------+---------+
-
- IDLE: The initial state of the client_idle_filter, indicating the channel is
- in IDLE.
-
- CALLS_ACTIVE: The channel has 1 or 1+ active calls and the timer is not set.
-
- TIMER_PENDING: The state after the timer is set and no calls have arrived
- after the timer is set. The channel must have 0 active call in this state. If
- the timer is fired in this state, the channel will go into IDLE state.
-
- TIMER_PENDING_CALLS_ACTIVE: The state after the timer is set and at least one
- call has arrived after the timer is set. The channel must have 1 or 1+ active
- calls in this state. If the timer is fired in this state, we won't reschedule
- it.
-
- TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START: The state after the timer is set
- and at least one call has arrived after the timer is set, BUT the channel
- currently has 0 active call. If the timer is fired in this state, we will
- reschedule it according to the finish time of the latest call.
-
- PROCESSING: The state set to block other threads when the setting thread is
- doing some work to keep state consistency.
-
- idle_timer_ will not be cancelled (unless the channel is shutting down).
- If the timer callback is called when the idle_timer_ is valid (i.e. idle_state
- is TIMER_PENDING), the channel will enter IDLE, otherwise the channel won't be
- changed.
-
- State transitions:
- IDLE
- | ^
- --------------------------------- *
- | *
- v *
- CALLS_ACTIVE =================> TIMER_PENDING
- ^ | ^
- * ------------------------------ *
- * | *
- * v *
-TIMER_PENDING_CALLS_ACTIVE ===> TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START
- ^ |
- | |
- ---------------------------------
-
- ---> Triggered by IncreaseCallCount()
- ===> Triggered by DecreaseCallCount()
- ***> Triggered by IdleTimerCallback()
-*/
-enum ChannelState {
- IDLE,
- CALLS_ACTIVE,
- TIMER_PENDING,
- TIMER_PENDING_CALLS_ACTIVE,
- TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START,
- PROCESSING
-};
-
-grpc_millis GetClientIdleTimeout(const grpc_channel_args* args) {
- return GPR_MAX(
- grpc_channel_arg_get_integer(
- grpc_channel_args_find(args, GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS),
- {DEFAULT_IDLE_TIMEOUT_MS, 0, INT_MAX}),
- MIN_IDLE_TIMEOUT_MS);
-}
-
-class ChannelData {
- public:
- static grpc_error_handle Init(grpc_channel_element* elem,
- grpc_channel_element_args* args);
- static void Destroy(grpc_channel_element* elem);
-
- static void StartTransportOp(grpc_channel_element* elem,
- grpc_transport_op* op);
-
- void IncreaseCallCount();
-
- void DecreaseCallCount();
-
- private:
- ChannelData(grpc_channel_element* elem, grpc_channel_element_args* args,
- grpc_error_handle* error);
- ~ChannelData() = default;
-
- static void IdleTimerCallback(void* arg, grpc_error_handle error);
- static void IdleTransportOpCompleteCallback(void* arg,
- grpc_error_handle error);
-
- void StartIdleTimer();
-
- void EnterIdle();
-
- grpc_channel_element* elem_;
- // The channel stack to which we take refs for pending callbacks.
- grpc_channel_stack* channel_stack_;
- // Timeout after the last RPC finishes on the client channel at which the
- // channel goes back into IDLE state.
- const grpc_millis client_idle_timeout_;
-
- // Member data used to track the state of channel.
- grpc_millis last_idle_time_;
- Atomic<intptr_t> call_count_{0};
- Atomic<ChannelState> state_{IDLE};
-
- // Idle timer and its callback closure.
- grpc_timer idle_timer_;
- grpc_closure idle_timer_callback_;
-
- // The transport op telling the client channel to enter IDLE.
- grpc_transport_op idle_transport_op_;
- grpc_closure idle_transport_op_complete_callback_;
-};
-
-grpc_error_handle ChannelData::Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- new (elem->channel_data) ChannelData(elem, args, &error);
- return error;
-}
-
-void ChannelData::Destroy(grpc_channel_element* elem) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->~ChannelData();
-}
-
-void ChannelData::StartTransportOp(grpc_channel_element* elem,
- grpc_transport_op* op) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- // Catch the disconnect_with_error transport op.
- if (op->disconnect_with_error != nullptr) {
- // IncreaseCallCount() introduces a phony call and prevent the timer from
- // being reset by other threads.
- chand->IncreaseCallCount();
- // If the timer has been set, cancel the timer.
- // No synchronization issues here. grpc_timer_cancel() is valid as long as
- // the timer has been init()ed before.
- grpc_timer_cancel(&chand->idle_timer_);
- }
- // Pass the op to the next filter.
- grpc_channel_next_op(elem, op);
-}
-
-void ChannelData::IncreaseCallCount() {
- const intptr_t previous_value = call_count_.FetchAdd(1, MemoryOrder::RELAXED);
- GRPC_IDLE_FILTER_LOG("call counter has increased to %" PRIuPTR,
- previous_value + 1);
- if (previous_value == 0) {
- // This call is the one that makes the channel busy.
- // Loop here to make sure the previous decrease operation has finished.
- ChannelState state = state_.Load(MemoryOrder::RELAXED);
- while (true) {
- switch (state) {
- // Timer has not been set. Switch to CALLS_ACTIVE.
- case IDLE:
- // In this case, no other threads will modify the state, so we can
- // just store the value.
- state_.Store(CALLS_ACTIVE, MemoryOrder::RELAXED);
- return;
- // Timer has been set. Switch to TIMER_PENDING_CALLS_ACTIVE.
- case TIMER_PENDING:
- case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START:
- // At this point, the state may have been switched to IDLE by the
- // idle timer callback. Therefore, use CAS operation to change the
- // state atomically.
- // Use MemoryOrder::ACQUIRE on success to ensure last_idle_time_ has
- // been properly set in DecreaseCallCount().
- if (state_.CompareExchangeWeak(&state, TIMER_PENDING_CALLS_ACTIVE,
- MemoryOrder::ACQUIRE,
- MemoryOrder::RELAXED)) {
- return;
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = state_.Load(MemoryOrder::RELAXED);
- break;
- }
- }
- }
-}
-
-void ChannelData::DecreaseCallCount() {
- const intptr_t previous_value = call_count_.FetchSub(1, MemoryOrder::RELAXED);
- GRPC_IDLE_FILTER_LOG("call counter has decreased to %" PRIuPTR,
- previous_value - 1);
- if (previous_value == 1) {
- // This call is the one that makes the channel idle.
- // last_idle_time_ does not need to be Atomic<> because busy-loops in
- // IncreaseCallCount(), DecreaseCallCount() and IdleTimerCallback() will
- // prevent multiple threads from simultaneously accessing this variable.
- last_idle_time_ = ExecCtx::Get()->Now();
- ChannelState state = state_.Load(MemoryOrder::RELAXED);
- while (true) {
- switch (state) {
- // Timer has not been set. Set the timer and switch to TIMER_PENDING
- case CALLS_ACTIVE:
- // Release store here to make other threads see the updated value of
- // last_idle_time_.
- StartIdleTimer();
- state_.Store(TIMER_PENDING, MemoryOrder::RELEASE);
- return;
- // Timer has been set. Switch to
- // TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START
- case TIMER_PENDING_CALLS_ACTIVE:
- // At this point, the state may have been switched to CALLS_ACTIVE by
- // the idle timer callback. Therefore, use CAS operation to change the
- // state atomically.
- // Release store here to make the idle timer callback see the updated
- // value of last_idle_time_ to properly reset the idle timer.
- if (state_.CompareExchangeWeak(
- &state, TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START,
- MemoryOrder::RELEASE, MemoryOrder::RELAXED)) {
- return;
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = state_.Load(MemoryOrder::RELAXED);
- break;
- }
- }
- }
-}
-
-ChannelData::ChannelData(grpc_channel_element* elem,
- grpc_channel_element_args* args,
- grpc_error_handle* /*error*/)
- : elem_(elem),
- channel_stack_(args->channel_stack),
- client_idle_timeout_(GetClientIdleTimeout(args->channel_args)) {
- // If the idle filter is explicitly disabled in channel args, this ctor should
- // not get called.
- GPR_ASSERT(client_idle_timeout_ != GRPC_MILLIS_INF_FUTURE);
- GRPC_IDLE_FILTER_LOG("created with max_leisure_time = %" PRId64 " ms",
- client_idle_timeout_);
- // Initialize the idle timer without setting it.
- grpc_timer_init_unset(&idle_timer_);
- // Initialize the idle timer callback closure.
- GRPC_CLOSURE_INIT(&idle_timer_callback_, IdleTimerCallback, this,
- grpc_schedule_on_exec_ctx);
- // Initialize the idle transport op complete callback.
- GRPC_CLOSURE_INIT(&idle_transport_op_complete_callback_,
- IdleTransportOpCompleteCallback, this,
- grpc_schedule_on_exec_ctx);
-}
-
-void ChannelData::IdleTimerCallback(void* arg, grpc_error_handle error) {
- GRPC_IDLE_FILTER_LOG("timer alarms");
- ChannelData* chand = static_cast<ChannelData*>(arg);
- if (error != GRPC_ERROR_NONE) {
- GRPC_IDLE_FILTER_LOG("timer canceled");
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "max idle timer callback");
- return;
- }
- bool finished = false;
- ChannelState state = chand->state_.Load(MemoryOrder::RELAXED);
- while (!finished) {
- switch (state) {
- case TIMER_PENDING:
- // Change the state to PROCESSING to block IncreaseCallCout() until the
- // EnterIdle() operation finishes, preventing mistakenly entering IDLE
- // when active RPC exists.
- finished = chand->state_.CompareExchangeWeak(
- &state, PROCESSING, MemoryOrder::ACQUIRE, MemoryOrder::RELAXED);
- if (finished) {
- chand->EnterIdle();
- chand->state_.Store(IDLE, MemoryOrder::RELAXED);
- }
- break;
- case TIMER_PENDING_CALLS_ACTIVE:
- finished = chand->state_.CompareExchangeWeak(
- &state, CALLS_ACTIVE, MemoryOrder::RELAXED, MemoryOrder::RELAXED);
- break;
- case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START:
- // Change the state to PROCESSING to block IncreaseCallCount() until the
- // StartIdleTimer() operation finishes, preventing mistakenly restarting
- // the timer after grpc_timer_cancel() when shutdown.
- finished = chand->state_.CompareExchangeWeak(
- &state, PROCESSING, MemoryOrder::ACQUIRE, MemoryOrder::RELAXED);
- if (finished) {
- chand->StartIdleTimer();
- chand->state_.Store(TIMER_PENDING, MemoryOrder::RELAXED);
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = chand->state_.Load(MemoryOrder::RELAXED);
- break;
- }
- }
- GRPC_IDLE_FILTER_LOG("timer finishes");
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "max idle timer callback");
-}
-
-void ChannelData::IdleTransportOpCompleteCallback(void* arg,
- grpc_error_handle /*error*/) {
- ChannelData* chand = static_cast<ChannelData*>(arg);
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "idle transport op");
-}
-
-void ChannelData::StartIdleTimer() {
- GRPC_IDLE_FILTER_LOG("timer has started");
- // Hold a ref to the channel stack for the timer callback.
- GRPC_CHANNEL_STACK_REF(channel_stack_, "max idle timer callback");
- grpc_timer_init(&idle_timer_, last_idle_time_ + client_idle_timeout_,
- &idle_timer_callback_);
-}
-
-void ChannelData::EnterIdle() {
- GRPC_IDLE_FILTER_LOG("the channel will enter IDLE");
- // Hold a ref to the channel stack for the transport op.
- GRPC_CHANNEL_STACK_REF(channel_stack_, "idle transport op");
- // Initialize the transport op.
- idle_transport_op_ = {};
- idle_transport_op_.disconnect_with_error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("enter idle"),
- GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE, GRPC_CHANNEL_IDLE);
- idle_transport_op_.on_consumed = &idle_transport_op_complete_callback_;
- // Pass the transport op down to the channel stack.
- grpc_channel_next_op(elem_, &idle_transport_op_);
-}
-
-class CallData {
- public:
- static grpc_error_handle Init(grpc_call_element* elem,
- const grpc_call_element_args* args);
- static void Destroy(grpc_call_element* elem,
- const grpc_call_final_info* final_info,
- grpc_closure* then_schedule_closure);
-};
-
-grpc_error_handle CallData::Init(grpc_call_element* elem,
- const grpc_call_element_args* /*args*/) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->IncreaseCallCount();
- return GRPC_ERROR_NONE;
-}
-
-void CallData::Destroy(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->DecreaseCallCount();
-}
-
-const grpc_channel_filter grpc_client_idle_filter = {
- grpc_call_next_op,
- ChannelData::StartTransportOp,
- sizeof(CallData),
- CallData::Init,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- CallData::Destroy,
- sizeof(ChannelData),
- ChannelData::Init,
- ChannelData::Destroy,
- grpc_channel_next_get_info,
- "client_idle"};
-
-static bool MaybeAddClientIdleFilter(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) &&
- GetClientIdleTimeout(channel_args) != INT_MAX) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_client_idle_filter, nullptr, nullptr);
- } else {
- return true;
- }
-}
-
-} // namespace
-} // namespace grpc_core
-
-void grpc_client_idle_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_core::MaybeAddClientIdleFilter, nullptr);
-}
-
-void grpc_client_idle_filter_shutdown(void) {}
diff --git a/grpc/src/core/ext/filters/deadline/deadline_filter.cc b/grpc/src/core/ext/filters/deadline/deadline_filter.cc
index 8944f5d9..8ff05762 100644
--- a/grpc/src/core/ext/filters/deadline/deadline_filter.cc
+++ b/grpc/src/core/ext/filters/deadline/deadline_filter.cc
@@ -27,10 +27,10 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/channel_init.h"
namespace grpc_core {
@@ -38,7 +38,7 @@ namespace grpc_core {
// Allocated on the call arena.
class TimerState {
public:
- TimerState(grpc_call_element* elem, grpc_millis deadline) : elem_(elem) {
+ TimerState(grpc_call_element* elem, Timestamp deadline) : elem_(elem) {
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(elem_->call_data);
GRPC_CALL_STACK_REF(deadline_state->call_stack, "DeadlineTimerState");
@@ -113,10 +113,8 @@ class TimerState {
// This is called via the call combiner, so access to deadline_state is
// synchronized.
static void start_timer_if_needed(grpc_call_element* elem,
- grpc_millis deadline) {
- if (deadline == GRPC_MILLIS_INF_FUTURE) {
- return;
- }
+ grpc_core::Timestamp deadline) {
+ if (deadline == grpc_core::Timestamp::InfFuture()) return;
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(elem->call_data);
GPR_ASSERT(deadline_state->timer_state == nullptr);
@@ -159,13 +157,14 @@ static void inject_recv_trailing_metadata_ready(
// Callback and associated state for starting the timer after call stack
// initialization has been completed.
struct start_timer_after_init_state {
- start_timer_after_init_state(grpc_call_element* elem, grpc_millis deadline)
+ start_timer_after_init_state(grpc_call_element* elem,
+ grpc_core::Timestamp deadline)
: elem(elem), deadline(deadline) {}
~start_timer_after_init_state() { start_timer_if_needed(elem, deadline); }
bool in_call_combiner = false;
grpc_call_element* elem;
- grpc_millis deadline;
+ grpc_core::Timestamp deadline;
grpc_closure closure;
};
static void start_timer_after_init(void* arg, grpc_error_handle error) {
@@ -189,13 +188,13 @@ static void start_timer_after_init(void* arg, grpc_error_handle error) {
grpc_deadline_state::grpc_deadline_state(grpc_call_element* elem,
const grpc_call_element_args& args,
- grpc_millis deadline)
+ grpc_core::Timestamp deadline)
: call_stack(args.call_stack),
call_combiner(args.call_combiner),
arena(args.arena) {
// Deadline will always be infinite on servers, so the timer will only be
// set on clients with a finite deadline.
- if (deadline != GRPC_MILLIS_INF_FUTURE) {
+ if (deadline != grpc_core::Timestamp::InfFuture()) {
// When the deadline passes, we indicate the failure by sending down
// an op with cancel_error set. However, we can't send down any ops
// until after the call stack is fully initialized. If we start the
@@ -214,7 +213,7 @@ grpc_deadline_state::grpc_deadline_state(grpc_call_element* elem,
grpc_deadline_state::~grpc_deadline_state() { cancel_timer_if_needed(this); }
void grpc_deadline_state_reset(grpc_call_element* elem,
- grpc_millis new_deadline) {
+ grpc_core::Timestamp new_deadline) {
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(elem->call_data);
cancel_timer_if_needed(deadline_state);
@@ -295,7 +294,9 @@ static void deadline_client_start_transport_stream_op_batch(
static void recv_initial_metadata_ready(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
server_call_data* calld = static_cast<server_call_data*>(elem->call_data);
- start_timer_if_needed(elem, calld->recv_initial_metadata->deadline);
+ start_timer_if_needed(
+ elem, calld->recv_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(grpc_core::Timestamp::InfFuture()));
// Invoke the next callback.
grpc_core::Closure::Run(DEBUG_LOCATION,
calld->next_recv_initial_metadata_ready,
@@ -338,6 +339,7 @@ static void deadline_server_start_transport_stream_op_batch(
const grpc_channel_filter grpc_client_deadline_filter = {
deadline_client_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(base_call_data),
deadline_init_call_elem,
@@ -352,6 +354,7 @@ const grpc_channel_filter grpc_client_deadline_filter = {
const grpc_channel_filter grpc_server_deadline_filter = {
deadline_server_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(server_call_data),
deadline_init_call_elem,
@@ -370,25 +373,20 @@ bool grpc_deadline_checking_enabled(const grpc_channel_args* channel_args) {
!grpc_channel_args_want_minimal_stack(channel_args));
}
-static bool maybe_add_deadline_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- return grpc_deadline_checking_enabled(
- grpc_channel_stack_builder_get_channel_arguments(builder))
- ? grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg),
- nullptr, nullptr)
- : true;
-}
-
-void grpc_deadline_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_deadline_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_deadline_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_deadline_filter,
- const_cast<grpc_channel_filter*>(&grpc_server_deadline_filter));
+namespace grpc_core {
+void RegisterDeadlineFilter(CoreConfiguration::Builder* builder) {
+ auto register_filter = [builder](grpc_channel_stack_type type,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [filter](ChannelStackBuilder* builder) {
+ if (grpc_deadline_checking_enabled(builder->channel_args())) {
+ builder->PrependFilter(filter, nullptr);
+ }
+ return true;
+ });
+ };
+ register_filter(GRPC_CLIENT_DIRECT_CHANNEL, &grpc_client_deadline_filter);
+ register_filter(GRPC_SERVER_CHANNEL, &grpc_server_deadline_filter);
}
-
-void grpc_deadline_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/deadline/deadline_filter.h b/grpc/src/core/ext/filters/deadline/deadline_filter.h
index fd6fd457..6aaa1a05 100644
--- a/grpc/src/core/ext/filters/deadline/deadline_filter.h
+++ b/grpc/src/core/ext/filters/deadline/deadline_filter.h
@@ -30,7 +30,8 @@ class TimerState;
// Must be the first field in the filter's call_data.
struct grpc_deadline_state {
grpc_deadline_state(grpc_call_element* elem,
- const grpc_call_element_args& args, grpc_millis deadline);
+ const grpc_call_element_args& args,
+ grpc_core::Timestamp deadline);
~grpc_deadline_state();
// We take a reference to the call stack for the timer callback.
@@ -61,7 +62,7 @@ struct grpc_deadline_state {
//
// Note: Must be called while holding the call combiner.
void grpc_deadline_state_reset(grpc_call_element* elem,
- grpc_millis new_deadline);
+ grpc_core::Timestamp new_deadline);
// To be called from the client-side filter's start_transport_stream_op_batch()
// method. Ensures that the deadline timer is cancelled when the call
diff --git a/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc b/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
index 5f8d7794..cdb01e58 100644
--- a/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
+++ b/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
@@ -18,21 +18,23 @@
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
+#include <atomic>
+
#include "absl/strings/numbers.h"
+#include <grpc/status.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/fault_injection/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/status_util.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/gprpp/capture.h"
+#include "src/core/lib/promise/sleep.h"
+#include "src/core/lib/promise/try_seq.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
#include "src/core/lib/transport/status_conversion.h"
+#include "src/core/lib/transport/transport.h"
namespace grpc_core {
@@ -40,36 +42,16 @@ TraceFlag grpc_fault_injection_filter_trace(false, "fault_injection_filter");
namespace {
-Atomic<uint32_t> g_active_faults{0};
+std::atomic<uint32_t> g_active_faults{0};
static_assert(
- std::is_trivially_destructible<Atomic<uint32_t>>::value,
+ std::is_trivially_destructible<std::atomic<uint32_t>>::value,
"the active fault counter needs to have a trivially destructible type");
-inline int GetLinkedMetadatumValueInt(grpc_linked_mdelem* md) {
- int res;
- if (absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
- return res;
- } else {
- return -1;
- }
-}
-
-inline uint32_t GetLinkedMetadatumValueUnsignedInt(grpc_linked_mdelem* md) {
- uint32_t res;
- if (absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
- return res;
- } else {
- return -1;
- }
-}
-
-inline int64_t GetLinkedMetadatumValueInt64(grpc_linked_mdelem* md) {
- int64_t res;
- if (absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
- return res;
- } else {
- return -1;
- }
+template <typename T>
+auto AsInt(absl::string_view s) -> absl::optional<T> {
+ T x;
+ if (absl::SimpleAtoi(s, &x)) return x;
+ return absl::nullopt;
}
inline bool UnderFraction(const uint32_t numerator,
@@ -81,421 +63,196 @@ inline bool UnderFraction(const uint32_t numerator,
return random_number < numerator;
}
-class ChannelData {
- public:
- static grpc_error_handle Init(grpc_channel_element* elem,
- grpc_channel_element_args* args);
- static void Destroy(grpc_channel_element* elem);
-
- int index() const { return index_; }
-
- private:
- ChannelData(grpc_channel_element* elem, grpc_channel_element_args* args);
- ~ChannelData() = default;
-
- // The relative index of instances of the same filter.
- int index_;
-};
-
-class CallData {
+// Tracks an active faults lifetime.
+// Increments g_active_faults when created, and decrements it when destroyed.
+class FaultHandle {
public:
- static grpc_error_handle Init(grpc_call_element* elem,
- const grpc_call_element_args* args);
-
- static void Destroy(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*then_schedule_closure*/);
-
- static void StartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
-
- private:
- class ResumeBatchCanceller;
-
- CallData(grpc_call_element* elem, const grpc_call_element_args* args);
- ~CallData();
-
- void DecideWhetherToInjectFaults(grpc_metadata_batch* initial_metadata);
-
- // Checks if current active faults exceed the allowed max faults.
- bool HaveActiveFaultsQuota(bool increment);
-
- // Returns true if this RPC needs to be delayed. If so, this call will be
- // counted as an active fault.
- bool MaybeDelay();
-
- // Returns the aborted RPC status if this RPC needs to be aborted. If so,
- // this call will be counted as an active fault. Otherwise, it returns
- // GRPC_ERROR_NONE.
- // If this call is already been delay injected, skip the active faults
- // quota check.
- grpc_error_handle MaybeAbort();
-
- // Delays the stream operations batch.
- void DelayBatch(grpc_call_element* elem,
- grpc_transport_stream_op_batch* batch);
-
- // Cancels the delay timer.
- void CancelDelayTimer() { grpc_timer_cancel(&delay_timer_); }
-
- // Finishes the fault injection, should only be called once.
- void FaultInjectionFinished() {
- g_active_faults.FetchSub(1, MemoryOrder::RELAXED);
+ explicit FaultHandle(bool active) : active_(active) {
+ if (active) {
+ g_active_faults.fetch_add(1, std::memory_order_relaxed);
+ }
+ }
+ ~FaultHandle() {
+ if (active_) {
+ g_active_faults.fetch_sub(1, std::memory_order_relaxed);
+ }
+ }
+ FaultHandle(const FaultHandle&) = delete;
+ FaultHandle& operator=(const FaultHandle&) = delete;
+ FaultHandle(FaultHandle&& other) noexcept
+ : active_(absl::exchange(other.active_, false)) {}
+ FaultHandle& operator=(FaultHandle&& other) noexcept {
+ std::swap(active_, other.active_);
+ return *this;
}
- // This is a callback that will be invoked after the delay timer is up.
- static void ResumeBatch(void* arg, grpc_error_handle error);
-
- // This is a callback invoked upon completion of recv_trailing_metadata.
- // Injects the abort_error_ to the recv_trailing_metadata batch if needed.
- static void HijackedRecvTrailingMetadataReady(void* arg, grpc_error_handle);
-
- // Used to track the policy structs that needs to be destroyed in dtor.
- bool fi_policy_owned_ = false;
- const FaultInjectionMethodParsedConfig::FaultInjectionPolicy* fi_policy_;
- grpc_call_stack* owning_call_;
- Arena* arena_;
- CallCombiner* call_combiner_;
-
- // Indicates whether we are doing a delay and/or an abort for this call.
- bool delay_request_ = false;
- bool abort_request_ = false;
-
- // Delay states
- grpc_timer delay_timer_ ABSL_GUARDED_BY(delay_mu_);
- ResumeBatchCanceller* resume_batch_canceller_ ABSL_GUARDED_BY(delay_mu_);
- grpc_transport_stream_op_batch* delayed_batch_ ABSL_GUARDED_BY(delay_mu_);
- // Abort states
- grpc_error_handle abort_error_ = GRPC_ERROR_NONE;
- grpc_closure recv_trailing_metadata_ready_;
- grpc_closure* original_recv_trailing_metadata_ready_;
- // Protects the asynchronous delay, resume, and cancellation.
- Mutex delay_mu_;
+ private:
+ bool active_;
};
-// ChannelData
-
-grpc_error_handle ChannelData::Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- GPR_ASSERT(elem->filter == &FaultInjectionFilterVtable);
- new (elem->channel_data) ChannelData(elem, args);
- return GRPC_ERROR_NONE;
-}
-
-void ChannelData::Destroy(grpc_channel_element* elem) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->~ChannelData();
-}
-
-ChannelData::ChannelData(grpc_channel_element* elem,
- grpc_channel_element_args* args)
- : index_(grpc_channel_stack_filter_instance_number(args->channel_stack,
- elem)) {}
-
-// CallData::ResumeBatchCanceller
+} // namespace
-class CallData::ResumeBatchCanceller {
+class FaultInjectionFilter::InjectionDecision {
public:
- explicit ResumeBatchCanceller(grpc_call_element* elem) : elem_(elem) {
- auto* calld = static_cast<CallData*>(elem->call_data);
- GRPC_CALL_STACK_REF(calld->owning_call_, "ResumeBatchCanceller");
- GRPC_CLOSURE_INIT(&closure_, &Cancel, this, grpc_schedule_on_exec_ctx);
- calld->call_combiner_->SetNotifyOnCancel(&closure_);
- }
+ InjectionDecision(uint32_t max_faults, Duration delay_time,
+ absl::optional<absl::Status> abort_request)
+ : max_faults_(max_faults),
+ delay_time_(delay_time),
+ abort_request_(abort_request) {}
+
+ std::string ToString() const;
+ Timestamp DelayUntil();
+ absl::Status MaybeAbort() const;
private:
- static void Cancel(void* arg, grpc_error_handle error) {
- auto* self = static_cast<ResumeBatchCanceller*>(arg);
- auto* chand = static_cast<ChannelData*>(self->elem_->channel_data);
- auto* calld = static_cast<CallData*>(self->elem_->call_data);
- {
- MutexLock lock(&calld->delay_mu_);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: cancelling schdueled pick: "
- "error=%s self=%p calld->resume_batch_canceller_=%p",
- chand, calld, grpc_error_std_string(error).c_str(), self,
- calld->resume_batch_canceller_);
- }
- if (error != GRPC_ERROR_NONE && calld->resume_batch_canceller_ == self) {
- // Cancel the delayed pick.
- calld->CancelDelayTimer();
- calld->FaultInjectionFinished();
- // Fail pending batches on the call.
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->delayed_batch_, GRPC_ERROR_REF(error),
- calld->call_combiner_);
- }
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call_, "ResumeBatchCanceller");
- delete self;
- }
+ bool HaveActiveFaultsQuota() const;
- grpc_call_element* elem_;
- grpc_closure closure_;
+ uint32_t max_faults_;
+ Duration delay_time_;
+ absl::optional<absl::Status> abort_request_;
+ FaultHandle active_fault_{false};
};
-// CallData
-
-grpc_error_handle CallData::Init(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- auto* calld = new (elem->call_data) CallData(elem, args);
- if (calld->fi_policy_ == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "failed to find fault injection policy");
- }
- return GRPC_ERROR_NONE;
+absl::StatusOr<FaultInjectionFilter> FaultInjectionFilter::Create(
+ ChannelArgs, ChannelFilter::Args filter_args) {
+ return FaultInjectionFilter(filter_args);
}
-void CallData::Destroy(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*then_schedule_closure*/) {
- auto* calld = static_cast<CallData*>(elem->call_data);
- calld->~CallData();
-}
-
-void CallData::StartTransportStreamOpBatch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- auto* calld = static_cast<CallData*>(elem->call_data);
- // There should only be one send_initial_metdata op, and fault injection also
- // only need to be enforced once.
- if (batch->send_initial_metadata) {
- calld->DecideWhetherToInjectFaults(
- batch->payload->send_initial_metadata.send_initial_metadata);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p calld=%p: Fault injection triggered delay=%d abort=%d",
- elem->channel_data, calld, calld->delay_request_,
- calld->abort_request_);
- }
- if (calld->MaybeDelay()) {
- // Delay the batch, and pass down the batch in the scheduled closure.
- calld->DelayBatch(elem, batch);
- return;
- }
- grpc_error_handle abort_error = calld->MaybeAbort();
- if (abort_error != GRPC_ERROR_NONE) {
- calld->abort_error_ = abort_error;
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(calld->abort_error_), calld->call_combiner_);
- return;
- }
- } else {
- if (batch->recv_trailing_metadata) {
- // Intercept recv_trailing_metadata callback so that we can inject the
- // failure when aborting streaming calls, because their
- // recv_trailing_metatdata op may not be on the same batch as the
- // send_initial_metadata op.
- calld->original_recv_trailing_metadata_ready_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &calld->recv_trailing_metadata_ready_;
- }
- if (calld->abort_error_ != GRPC_ERROR_NONE) {
- // If we already decided to abort, then immediately fail this batch.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(calld->abort_error_), calld->call_combiner_);
- return;
- }
+FaultInjectionFilter::FaultInjectionFilter(ChannelFilter::Args filter_args)
+ : index_(grpc_channel_stack_filter_instance_number(
+ filter_args.channel_stack(),
+ filter_args.uninitialized_channel_element())),
+ service_config_parser_index_(
+ FaultInjectionServiceConfigParser::ParserIndex()) {}
+
+// Construct a promise for one call.
+ArenaPromise<ServerMetadataHandle> FaultInjectionFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ auto decision = MakeInjectionDecision(call_args.client_initial_metadata);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: Fault injection triggered %s", this,
+ decision.ToString().c_str());
}
- // Chain to the next filter.
- grpc_call_next_op(elem, batch);
+ auto delay = decision.DelayUntil();
+ return TrySeq(
+ Sleep(delay),
+ Capture(
+ [](InjectionDecision* decision) { return decision->MaybeAbort(); },
+ std::move(decision)),
+ next_promise_factory(std::move(call_args)));
}
-CallData::CallData(grpc_call_element* elem, const grpc_call_element_args* args)
- : owning_call_(args->call_stack),
- arena_(args->arena),
- call_combiner_(args->call_combiner) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
+FaultInjectionFilter::InjectionDecision
+FaultInjectionFilter::MakeInjectionDecision(
+ const ClientMetadataHandle& initial_metadata) {
// Fetch the fault injection policy from the service config, based on the
// relative index for which policy should this CallData use.
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
- args->context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ GetContext<
+ grpc_call_context_element>()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
+ .value);
auto* method_params = static_cast<FaultInjectionMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(
- FaultInjectionServiceConfigParser::ParserIndex()));
+ service_config_parser_index_));
+ const FaultInjectionMethodParsedConfig::FaultInjectionPolicy* fi_policy =
+ nullptr;
if (method_params != nullptr) {
- fi_policy_ = method_params->fault_injection_policy(chand->index());
+ fi_policy = method_params->fault_injection_policy(index_);
}
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
- HijackedRecvTrailingMetadataReady, elem,
- grpc_schedule_on_exec_ctx);
-}
-CallData::~CallData() {
- if (fi_policy_owned_) {
- fi_policy_->~FaultInjectionPolicy();
- }
- GRPC_ERROR_UNREF(abort_error_);
-}
+ grpc_status_code abort_code = fi_policy->abort_code;
+ uint32_t abort_percentage_numerator = fi_policy->abort_percentage_numerator;
+ uint32_t delay_percentage_numerator = fi_policy->delay_percentage_numerator;
+ Duration delay = fi_policy->delay;
-void CallData::DecideWhetherToInjectFaults(
- grpc_metadata_batch* initial_metadata) {
- FaultInjectionMethodParsedConfig::FaultInjectionPolicy* copied_policy =
- nullptr;
// Update the policy with values in initial metadata.
- if (!fi_policy_->abort_code_header.empty() ||
- !fi_policy_->abort_percentage_header.empty() ||
- !fi_policy_->delay_header.empty() ||
- !fi_policy_->delay_percentage_header.empty()) {
- // Defer the actual copy until the first matched header.
- auto maybe_copy_policy_func = [this, &copied_policy]() {
- if (copied_policy == nullptr) {
- copied_policy =
- arena_->New<FaultInjectionMethodParsedConfig::FaultInjectionPolicy>(
- *fi_policy_);
+ if (!fi_policy->abort_code_header.empty() ||
+ !fi_policy->abort_percentage_header.empty() ||
+ !fi_policy->delay_header.empty() ||
+ !fi_policy->delay_percentage_header.empty()) {
+ std::string buffer;
+ if (!fi_policy->abort_code_header.empty() && abort_code == GRPC_STATUS_OK) {
+ auto value = initial_metadata->GetStringValue(
+ fi_policy->abort_code_header, &buffer);
+ if (value.has_value()) {
+ grpc_status_code_from_int(
+ AsInt<int>(*value).value_or(GRPC_STATUS_UNKNOWN), &abort_code);
}
- };
- for (grpc_linked_mdelem* md = initial_metadata->list.head; md != nullptr;
- md = md->next) {
- absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
- // Only perform string comparison if:
- // 1. Needs to check this header;
- // 2. The value is not been filled before.
- if (!fi_policy_->abort_code_header.empty() &&
- (copied_policy == nullptr ||
- copied_policy->abort_code == GRPC_STATUS_OK) &&
- key == fi_policy_->abort_code_header) {
- maybe_copy_policy_func();
- grpc_status_code_from_int(GetLinkedMetadatumValueInt(md),
- &copied_policy->abort_code);
- }
- if (!fi_policy_->abort_percentage_header.empty() &&
- key == fi_policy_->abort_percentage_header) {
- maybe_copy_policy_func();
- copied_policy->abort_percentage_numerator =
- GPR_MIN(GetLinkedMetadatumValueUnsignedInt(md),
- fi_policy_->abort_percentage_numerator);
+ }
+ if (!fi_policy->abort_percentage_header.empty()) {
+ auto value = initial_metadata->GetStringValue(
+ fi_policy->abort_percentage_header, &buffer);
+ if (value.has_value()) {
+ abort_percentage_numerator = std::min(
+ AsInt<uint32_t>(*value).value_or(-1), abort_percentage_numerator);
}
- if (!fi_policy_->delay_header.empty() &&
- (copied_policy == nullptr || copied_policy->delay == 0) &&
- key == fi_policy_->delay_header) {
- maybe_copy_policy_func();
- copied_policy->delay = static_cast<grpc_millis>(
- GPR_MAX(GetLinkedMetadatumValueInt64(md), 0));
+ }
+ if (!fi_policy->delay_header.empty() && delay == Duration::Zero()) {
+ auto value =
+ initial_metadata->GetStringValue(fi_policy->delay_header, &buffer);
+ if (value.has_value()) {
+ delay = Duration::Milliseconds(
+ std::max(AsInt<int64_t>(*value).value_or(0), int64_t(0)));
}
- if (!fi_policy_->delay_percentage_header.empty() &&
- key == fi_policy_->delay_percentage_header) {
- maybe_copy_policy_func();
- copied_policy->delay_percentage_numerator =
- GPR_MIN(GetLinkedMetadatumValueUnsignedInt(md),
- fi_policy_->delay_percentage_numerator);
+ }
+ if (!fi_policy->delay_percentage_header.empty()) {
+ auto value = initial_metadata->GetStringValue(
+ fi_policy->delay_percentage_header, &buffer);
+ if (value.has_value()) {
+ delay_percentage_numerator = std::min(
+ AsInt<uint32_t>(*value).value_or(-1), delay_percentage_numerator);
}
}
- if (copied_policy != nullptr) fi_policy_ = copied_policy;
}
// Roll the dice
- delay_request_ = fi_policy_->delay != 0 &&
- UnderFraction(fi_policy_->delay_percentage_numerator,
- fi_policy_->delay_percentage_denominator);
- abort_request_ = fi_policy_->abort_code != GRPC_STATUS_OK &&
- UnderFraction(fi_policy_->abort_percentage_numerator,
- fi_policy_->abort_percentage_denominator);
- if (!delay_request_ && !abort_request_) {
- if (copied_policy != nullptr) copied_policy->~FaultInjectionPolicy();
- // No fault injection for this call
- } else {
- fi_policy_owned_ = copied_policy != nullptr;
- }
+ const bool delay_request =
+ delay != Duration::Zero() &&
+ UnderFraction(delay_percentage_numerator,
+ fi_policy->delay_percentage_denominator);
+ const bool abort_request =
+ abort_code != GRPC_STATUS_OK &&
+ UnderFraction(abort_percentage_numerator,
+ fi_policy->abort_percentage_denominator);
+
+ return InjectionDecision(
+ fi_policy->max_faults, delay_request ? delay : Duration::Zero(),
+ abort_request ? absl::optional<absl::Status>(absl::Status(
+ static_cast<absl::StatusCode>(abort_code),
+ fi_policy->abort_message))
+ : absl::nullopt);
}
-bool CallData::HaveActiveFaultsQuota(bool increment) {
- if (g_active_faults.Load(MemoryOrder::ACQUIRE) >= fi_policy_->max_faults) {
- return false;
- }
- if (increment) g_active_faults.FetchAdd(1, MemoryOrder::RELAXED);
- return true;
+bool FaultInjectionFilter::InjectionDecision::HaveActiveFaultsQuota() const {
+ return g_active_faults.load(std::memory_order_acquire) < max_faults_;
}
-bool CallData::MaybeDelay() {
- if (delay_request_) {
- return HaveActiveFaultsQuota(true);
+Timestamp FaultInjectionFilter::InjectionDecision::DelayUntil() {
+ if (delay_time_ != Duration::Zero() && HaveActiveFaultsQuota()) {
+ active_fault_ = FaultHandle{true};
+ return ExecCtx::Get()->Now() + delay_time_;
}
- return false;
+ return Timestamp::InfPast();
}
-grpc_error_handle CallData::MaybeAbort() {
- if (abort_request_ && (delay_request_ || HaveActiveFaultsQuota(false))) {
- return grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(fi_policy_->abort_message.c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, fi_policy_->abort_code);
+absl::Status FaultInjectionFilter::InjectionDecision::MaybeAbort() const {
+ if (abort_request_.has_value() &&
+ (delay_time_ != Duration::Zero() || HaveActiveFaultsQuota())) {
+ return abort_request_.value();
}
- return GRPC_ERROR_NONE;
+ return absl::OkStatus();
}
-void CallData::DelayBatch(grpc_call_element* elem,
- grpc_transport_stream_op_batch* batch) {
- MutexLock lock(&delay_mu_);
- delayed_batch_ = batch;
- resume_batch_canceller_ = new ResumeBatchCanceller(elem);
- grpc_millis resume_time = ExecCtx::Get()->Now() + fi_policy_->delay;
- GRPC_CLOSURE_INIT(&batch->handler_private.closure, ResumeBatch, elem,
- grpc_schedule_on_exec_ctx);
- grpc_timer_init(&delay_timer_, resume_time, &batch->handler_private.closure);
+std::string FaultInjectionFilter::InjectionDecision::ToString() const {
+ return absl::StrCat("delay=", delay_time_ != Duration::Zero(),
+ " abort=", abort_request_.has_value());
}
-void CallData::ResumeBatch(void* arg, grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- auto* calld = static_cast<CallData*>(elem->call_data);
- MutexLock lock(&calld->delay_mu_);
- // Cancelled or canceller has already run
- if (error == GRPC_ERROR_CANCELLED ||
- calld->resume_batch_canceller_ == nullptr) {
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: Resuming delayed stream op batch %p",
- elem->channel_data, calld, calld->delayed_batch_);
- }
- // Lame the canceller
- calld->resume_batch_canceller_ = nullptr;
- // Finish fault injection.
- calld->FaultInjectionFinished();
- // Abort if needed.
- error = calld->MaybeAbort();
- if (error != GRPC_ERROR_NONE) {
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->delayed_batch_, error, calld->call_combiner_);
- return;
- }
- // Chain to the next filter.
- grpc_call_next_op(elem, calld->delayed_batch_);
-}
+const grpc_channel_filter FaultInjectionFilter::kFilter =
+ MakePromiseBasedFilter<FaultInjectionFilter, FilterEndpoint::kClient>(
+ "fault_injection_filter");
-void CallData::HijackedRecvTrailingMetadataReady(void* arg,
- grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- auto* calld = static_cast<CallData*>(elem->call_data);
- if (calld->abort_error_ != GRPC_ERROR_NONE) {
- error = grpc_error_add_child(GRPC_ERROR_REF(error),
- GRPC_ERROR_REF(calld->abort_error_));
- } else {
- error = GRPC_ERROR_REF(error);
- }
- Closure::Run(DEBUG_LOCATION, calld->original_recv_trailing_metadata_ready_,
- error);
+void FaultInjectionFilterRegister(CoreConfiguration::Builder* builder) {
+ FaultInjectionServiceConfigParser::Register(builder);
}
-} // namespace
-
-extern const grpc_channel_filter FaultInjectionFilterVtable = {
- CallData::StartTransportStreamOpBatch,
- grpc_channel_next_op,
- sizeof(CallData),
- CallData::Init,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- CallData::Destroy,
- sizeof(ChannelData),
- ChannelData::Init,
- ChannelData::Destroy,
- grpc_channel_next_get_info,
- "fault_injection_filter",
-};
-
-void FaultInjectionFilterInit(void) {
- grpc_core::FaultInjectionServiceConfigParser::Register();
-}
-
-void FaultInjectionFilterShutdown(void) {}
-
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.h b/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.h
index fbc1eb0c..49c6c0e3 100644
--- a/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.h
+++ b/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.h
@@ -21,6 +21,8 @@
#include "src/core/ext/filters/fault_injection/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/transport/transport.h"
// Channel arg key for enabling parsing fault injection via method config.
#define GRPC_ARG_PARSE_FAULT_INJECTION_METHOD_CONFIG \
@@ -32,7 +34,28 @@ namespace grpc_core {
// of the ordinary channel stack. The fault injection filter fetches fault
// injection policy from the method config of service config returned by the
// resolver, and enforces the fault injection policy.
-extern const grpc_channel_filter FaultInjectionFilterVtable;
+class FaultInjectionFilter : public ChannelFilter {
+ public:
+ static const grpc_channel_filter kFilter;
+
+ static absl::StatusOr<FaultInjectionFilter> Create(
+ ChannelArgs args, ChannelFilter::Args filter_args);
+
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ private:
+ explicit FaultInjectionFilter(ChannelFilter::Args filter_args);
+
+ class InjectionDecision;
+ InjectionDecision MakeInjectionDecision(
+ const ClientMetadataHandle& initial_metadata);
+
+ // The relative index of instances of the same filter.
+ int index_;
+ const size_t service_config_parser_index_;
+};
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc b/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
index e8c23e19..df5d3026 100644
--- a/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
+++ b/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -22,7 +22,7 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/status_util.h"
@@ -33,8 +33,6 @@ namespace grpc_core {
namespace {
-size_t g_fault_injection_parser_index;
-
std::vector<FaultInjectionMethodParsedConfig::FaultInjectionPolicy>
ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
std::vector<grpc_error_handle>* error_list) {
@@ -44,10 +42,8 @@ ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
fault_injection_policy;
std::vector<grpc_error_handle> sub_error_list;
if (policies_json_array[i].type() != Json::Type::OBJECT) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("faultInjectionPolicy index ", i,
- " is not a JSON object")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "faultInjectionPolicy index ", i, " is not a JSON object")));
continue;
}
const Json::Object& json_object = policies_json_array[i].object_value();
@@ -124,24 +120,16 @@ ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
}
}
// Parse max_faults
- if (ParseJsonObjectField(json_object, "maxFaults",
- &fault_injection_policy.max_faults,
- &sub_error_list, false)) {
- if (fault_injection_policy.max_faults < 0) {
- sub_error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxFaults error:should be zero or positive"));
- }
- }
+ static_assert(
+ std::is_unsigned<decltype(fault_injection_policy.max_faults)>::value,
+ "maxFaults should be unsigned");
+ ParseJsonObjectField(json_object, "maxFaults",
+ &fault_injection_policy.max_faults, &sub_error_list,
+ false);
if (!sub_error_list.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("failed to parse faultInjectionPolicy index ", i)
- .c_str());
- for (size_t i = 0; i < sub_error_list.size(); ++i) {
- error = grpc_error_add_child(error, sub_error_list[i]);
- }
- error_list->push_back(error);
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("failed to parse faultInjectionPolicy index ", i),
+ &sub_error_list));
}
policies.push_back(std::move(fault_injection_policy));
}
@@ -177,13 +165,15 @@ FaultInjectionServiceConfigParser::ParsePerMethodParams(
std::move(fault_injection_policies));
}
-void FaultInjectionServiceConfigParser::Register() {
- g_fault_injection_parser_index = ServiceConfigParser::RegisterParser(
+void FaultInjectionServiceConfigParser::Register(
+ CoreConfiguration::Builder* builder) {
+ builder->service_config_parser()->RegisterParser(
absl::make_unique<FaultInjectionServiceConfigParser>());
}
size_t FaultInjectionServiceConfigParser::ParserIndex() {
- return g_fault_injection_parser_index;
+ return CoreConfiguration::Get().service_config_parser().GetParserIndex(
+ parser_name());
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/fault_injection/service_config_parser.h b/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
index a885539c..8354b0f4 100644
--- a/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
+++ b/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
@@ -21,8 +21,9 @@
#include <vector>
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/service_config/service_config_parser.h"
namespace grpc_core {
@@ -37,7 +38,7 @@ class FaultInjectionMethodParsedConfig
uint32_t abort_percentage_numerator = 0;
uint32_t abort_percentage_denominator = 100;
- grpc_millis delay = 0;
+ Duration delay;
std::string delay_header;
std::string delay_percentage_header;
uint32_t delay_percentage_numerator = 0;
@@ -68,8 +69,10 @@ class FaultInjectionMethodParsedConfig
std::vector<FaultInjectionPolicy> fault_injection_policies_;
};
-class FaultInjectionServiceConfigParser : public ServiceConfigParser::Parser {
+class FaultInjectionServiceConfigParser final
+ : public ServiceConfigParser::Parser {
public:
+ absl::string_view name() const override { return parser_name(); }
// Parses the per-method service config for fault injection filter.
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
const grpc_channel_args* args, const Json& json,
@@ -77,7 +80,10 @@ class FaultInjectionServiceConfigParser : public ServiceConfigParser::Parser {
// Returns the parser index for FaultInjectionServiceConfigParser.
static size_t ParserIndex();
// Registers FaultInjectionServiceConfigParser to ServiceConfigParser.
- static void Register();
+ static void Register(CoreConfiguration::Builder* builder);
+
+ private:
+ static absl::string_view parser_name() { return "fault_injection"; }
};
} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/http/client/http_client_filter.cc b/grpc/src/core/ext/filters/http/client/http_client_filter.cc
index ef737f0e..ef4e42bd 100644
--- a/grpc/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/grpc/src/core/ext/filters/http/client/http_client_filter.cc
@@ -17,6 +17,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/client/http_client_filter.h"
+
#include <stdint.h>
#include <string.h>
@@ -30,574 +32,110 @@
#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"
-#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/slice/b64.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/promise/call_push_pull.h"
+#include "src/core/lib/promise/seq.h"
#include "src/core/lib/slice/percent_encoding.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/transport_impl.h"
-#define EXPECTED_CONTENT_TYPE "application/grpc"
-#define EXPECTED_CONTENT_TYPE_LENGTH (sizeof(EXPECTED_CONTENT_TYPE) - 1)
+namespace grpc_core {
-/* default maximum size of payload eligible for GET request */
-static constexpr size_t kMaxPayloadSizeForGet = 2048;
-
-static void recv_initial_metadata_ready(void* user_data,
- grpc_error_handle error);
-static void recv_trailing_metadata_ready(void* user_data,
- grpc_error_handle error);
-static void on_send_message_next_done(void* arg, grpc_error_handle error);
-static void send_message_on_complete(void* arg, grpc_error_handle error);
+const grpc_channel_filter HttpClientFilter::kFilter =
+ MakePromiseBasedFilter<HttpClientFilter, FilterEndpoint::kClient,
+ kFilterExaminesServerInitialMetadata>("http-client");
namespace {
-struct call_data {
- call_data(grpc_call_element* elem, const grpc_call_element_args& args)
- : call_combiner(args.call_combiner) {
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready,
- ::recv_initial_metadata_ready, elem,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready,
- ::recv_trailing_metadata_ready, elem,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_send_message_next_done, ::on_send_message_next_done,
- elem, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&send_message_on_complete, ::send_message_on_complete,
- elem, grpc_schedule_on_exec_ctx);
- }
-
- ~call_data() { GRPC_ERROR_UNREF(recv_initial_metadata_error); }
-
- grpc_core::CallCombiner* call_combiner;
- // State for handling send_initial_metadata ops.
- grpc_linked_mdelem method;
- grpc_linked_mdelem scheme;
- grpc_linked_mdelem authority;
- grpc_linked_mdelem te_trailers;
- grpc_linked_mdelem content_type;
- grpc_linked_mdelem user_agent;
- // State for handling recv_initial_metadata ops.
- grpc_metadata_batch* recv_initial_metadata;
- grpc_error_handle recv_initial_metadata_error = GRPC_ERROR_NONE;
- grpc_closure* original_recv_initial_metadata_ready = nullptr;
- grpc_closure recv_initial_metadata_ready;
- // State for handling recv_trailing_metadata ops.
- grpc_metadata_batch* recv_trailing_metadata;
- grpc_closure* original_recv_trailing_metadata_ready;
- grpc_closure recv_trailing_metadata_ready;
- grpc_error_handle recv_trailing_metadata_error = GRPC_ERROR_NONE;
- bool seen_recv_trailing_metadata_ready = false;
- // State for handling send_message ops.
- grpc_transport_stream_op_batch* send_message_batch;
- size_t send_message_bytes_read = 0;
- grpc_core::ManualConstructor<grpc_core::ByteStreamCache> send_message_cache;
- grpc_core::ManualConstructor<grpc_core::ByteStreamCache::CachingByteStream>
- send_message_caching_stream;
- grpc_closure on_send_message_next_done;
- grpc_closure* original_send_message_on_complete;
- grpc_closure send_message_on_complete;
-};
-
-struct channel_data {
- grpc_mdelem static_scheme;
- grpc_mdelem user_agent;
- size_t max_payload_size_for_get;
-};
-} // namespace
-
-static grpc_error_handle client_filter_incoming_metadata(
- grpc_metadata_batch* b) {
- if (b->idx.named.status != nullptr) {
+absl::Status CheckServerMetadata(ServerMetadata* b) {
+ if (auto* status = b->get_pointer(HttpStatusMetadata())) {
/* If both gRPC status and HTTP status are provided in the response, we
* should prefer the gRPC status code, as mentioned in
* https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md.
*/
- if (b->idx.named.grpc_status != nullptr ||
- grpc_mdelem_static_value_eq(b->idx.named.status->md,
- GRPC_MDELEM_STATUS_200)) {
- grpc_metadata_batch_remove(b, GRPC_BATCH_STATUS);
+ const grpc_status_code* grpc_status = b->get_pointer(GrpcStatusMetadata());
+ if (grpc_status != nullptr || *status == 200) {
+ b->Remove(HttpStatusMetadata());
} else {
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
- GPR_DUMP_ASCII);
- std::string msg =
- absl::StrCat("Received http2 header with status: ", val);
- grpc_error_handle e = grpc_error_set_str(
- grpc_error_set_int(
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Received http2 :status header with non-200 OK status"),
- 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)));
- gpr_free(val);
- return e;
- }
- }
-
- if (b->idx.named.grpc_message != nullptr) {
- grpc_slice pct_decoded_msg = grpc_permissive_percent_decode_slice(
- GRPC_MDVALUE(b->idx.named.grpc_message->md));
- if (grpc_slice_is_equivalent(pct_decoded_msg,
- GRPC_MDVALUE(b->idx.named.grpc_message->md))) {
- grpc_slice_unref_internal(pct_decoded_msg);
- } else {
- grpc_metadata_batch_set_value(b->idx.named.grpc_message, pct_decoded_msg);
- }
- }
-
- if (b->idx.named.content_type != nullptr) {
- if (!grpc_mdelem_static_value_eq(
- b->idx.named.content_type->md,
- GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) {
- if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md),
- EXPECTED_CONTENT_TYPE,
- EXPECTED_CONTENT_TYPE_LENGTH) &&
- (GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
- '+' ||
- GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
- ';')) {
- /* Although the C implementation doesn't (currently) generate them,
- any custom +-suffix is explicitly valid. */
- /* TODO(klempner): We should consider preallocating common values such
- as +proto or +json, or at least stashing them if we see them. */
- /* TODO(klempner): Should we be surfacing this to application code? */
- } else {
- /* TODO(klempner): We're currently allowing this, but we shouldn't
- see it without a proxy so log for now. */
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
- GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
- gpr_free(val);
- }
- }
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE);
- }
-
- return GRPC_ERROR_NONE;
-}
-
-static void recv_initial_metadata_ready(void* user_data,
- grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- if (error == GRPC_ERROR_NONE) {
- error = client_filter_incoming_metadata(calld->recv_initial_metadata);
- calld->recv_initial_metadata_error = GRPC_ERROR_REF(error);
- } else {
- 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 recv_trailing_metadata");
- }
- grpc_core::Closure::Run(DEBUG_LOCATION, closure, error);
-}
-
-static void recv_trailing_metadata_ready(void* user_data,
- grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(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_CALL_COMBINER_STOP(calld->call_combiner,
- "deferring recv_trailing_metadata_ready until "
- "after recv_initial_metadata_ready");
- return;
- }
- if (error == GRPC_ERROR_NONE) {
- error = client_filter_incoming_metadata(calld->recv_trailing_metadata);
- } else {
- GRPC_ERROR_REF(error);
- }
- error = grpc_error_add_child(
- error, GRPC_ERROR_REF(calld->recv_initial_metadata_error));
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->original_recv_trailing_metadata_ready, error);
-}
-
-static void send_message_on_complete(void* arg, grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->send_message_cache.Destroy();
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->original_send_message_on_complete,
- GRPC_ERROR_REF(error));
-}
-
-// Pulls a slice from the send_message byte stream, updating
-// calld->send_message_bytes_read.
-static grpc_error_handle pull_slice_from_send_message(call_data* calld) {
- grpc_slice incoming_slice;
- grpc_error_handle error =
- calld->send_message_caching_stream->Pull(&incoming_slice);
- if (error == GRPC_ERROR_NONE) {
- calld->send_message_bytes_read += GRPC_SLICE_LENGTH(incoming_slice);
- grpc_slice_unref_internal(incoming_slice);
- }
- return error;
-}
-
-// Reads as many slices as possible from the send_message byte stream.
-// Upon successful return, if calld->send_message_bytes_read ==
-// calld->send_message_caching_stream->length(), then we have completed
-// reading from the byte stream; otherwise, an async read has been dispatched
-// and on_send_message_next_done() will be invoked when it is complete.
-static grpc_error_handle read_all_available_send_message_data(
- call_data* calld) {
- while (calld->send_message_caching_stream->Next(
- SIZE_MAX, &calld->on_send_message_next_done)) {
- grpc_error_handle error = pull_slice_from_send_message(calld);
- if (error != GRPC_ERROR_NONE) return error;
- if (calld->send_message_bytes_read ==
- calld->send_message_caching_stream->length()) {
- break;
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-// Async callback for ByteStream::Next().
-static void on_send_message_next_done(void* arg, grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- if (error != GRPC_ERROR_NONE) {
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->send_message_batch, error, calld->call_combiner);
- return;
- }
- error = pull_slice_from_send_message(calld);
- if (error != GRPC_ERROR_NONE) {
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->send_message_batch, error, calld->call_combiner);
- return;
- }
- // There may or may not be more to read, but we don't care. If we got
- // here, then we know that all of the data was not available
- // synchronously, so we were not able to do a cached call. Instead,
- // we just reset the byte stream and then send down the batch as-is.
- calld->send_message_caching_stream->Reset();
- grpc_call_next_op(elem, calld->send_message_batch);
-}
-
-static char* slice_buffer_to_string(grpc_slice_buffer* slice_buffer) {
- char* payload_bytes =
- static_cast<char*>(gpr_malloc(slice_buffer->length + 1));
- size_t offset = 0;
- for (size_t i = 0; i < slice_buffer->count; ++i) {
- memcpy(payload_bytes + offset,
- GRPC_SLICE_START_PTR(slice_buffer->slices[i]),
- GRPC_SLICE_LENGTH(slice_buffer->slices[i]));
- offset += GRPC_SLICE_LENGTH(slice_buffer->slices[i]);
- }
- *(payload_bytes + offset) = '\0';
- return payload_bytes;
-}
-
-// Modifies the path entry in the batch's send_initial_metadata to
-// append the base64-encoded query for a GET request.
-static grpc_error_handle update_path_for_get(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- grpc_slice path_slice =
- GRPC_MDVALUE(batch->payload->send_initial_metadata.send_initial_metadata
- ->idx.named.path->md);
- /* sum up individual component's lengths and allocate enough memory to
- * hold combined path+query */
- size_t estimated_len = GRPC_SLICE_LENGTH(path_slice);
- estimated_len++; /* for the '?' */
- estimated_len += grpc_base64_estimate_encoded_size(
- batch->payload->send_message.send_message->length(),
- false /* multi_line */);
- grpc_core::UnmanagedMemorySlice path_with_query_slice(estimated_len);
- /* memcopy individual pieces into this slice */
- char* write_ptr =
- reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice);
- char* original_path =
- reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_slice);
- memcpy(write_ptr, original_path, GRPC_SLICE_LENGTH(path_slice));
- write_ptr += GRPC_SLICE_LENGTH(path_slice);
- *write_ptr++ = '?';
- char* payload_bytes =
- slice_buffer_to_string(calld->send_message_cache->cache_buffer());
- grpc_base64_encode_core(write_ptr, payload_bytes,
- batch->payload->send_message.send_message->length(),
- true /* url_safe */, false /* multi_line */);
- gpr_free(payload_bytes);
- /* remove trailing unused memory and add trailing 0 to terminate string */
- char* t = reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice);
- /* safe to use strlen since base64_encode will always add '\0' */
- path_with_query_slice =
- grpc_slice_sub_no_ref(path_with_query_slice, 0, strlen(t));
- /* substitute previous path with the new path+query */
- grpc_mdelem mdelem_path_and_query =
- grpc_mdelem_from_slices(GRPC_MDSTR_PATH, path_with_query_slice);
- grpc_metadata_batch* b =
- batch->payload->send_initial_metadata.send_initial_metadata;
- return grpc_metadata_batch_substitute(b, b->idx.named.path,
- mdelem_path_and_query);
-}
-
-static void remove_if_present(grpc_metadata_batch* batch,
- grpc_metadata_batch_callouts_index idx) {
- if (batch->idx.array[idx] != nullptr) {
- grpc_metadata_batch_remove(batch, idx);
- }
-}
-
-static void http_client_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- channel_data* channeld = static_cast<channel_data*>(elem->channel_data);
- GPR_TIMER_SCOPE("http_client_start_transport_stream_op_batch", 0);
-
- if (batch->recv_initial_metadata) {
- /* substitute our callback for the higher callback */
- calld->recv_initial_metadata =
- batch->payload->recv_initial_metadata.recv_initial_metadata;
- calld->original_recv_initial_metadata_ready =
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &calld->recv_initial_metadata_ready;
- }
-
- if (batch->recv_trailing_metadata) {
- /* substitute our callback for the higher callback */
- calld->recv_trailing_metadata =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata;
- calld->original_recv_trailing_metadata_ready =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &calld->recv_trailing_metadata_ready;
- }
-
- grpc_error_handle error = GRPC_ERROR_NONE;
- bool batch_will_be_handled_asynchronously = false;
- if (batch->send_initial_metadata) {
- // Decide which HTTP VERB to use. We use GET if the request is marked
- // cacheable, and the operation contains both initial metadata and send
- // message, and the payload is below the size threshold, and all the data
- // for this request is immediately available.
- grpc_mdelem method = GRPC_MDELEM_METHOD_POST;
- if (batch->send_message &&
- (batch->payload->send_initial_metadata.send_initial_metadata_flags &
- GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) &&
- batch->payload->send_message.send_message->length() <
- channeld->max_payload_size_for_get) {
- calld->send_message_bytes_read = 0;
- calld->send_message_cache.Init(
- std::move(batch->payload->send_message.send_message));
- calld->send_message_caching_stream.Init(calld->send_message_cache.get());
- batch->payload->send_message.send_message.reset(
- calld->send_message_caching_stream.get());
- calld->original_send_message_on_complete = batch->on_complete;
- batch->on_complete = &calld->send_message_on_complete;
- calld->send_message_batch = batch;
- error = read_all_available_send_message_data(calld);
- if (error != GRPC_ERROR_NONE) goto done;
- // If all the data has been read, then we can use GET.
- if (calld->send_message_bytes_read ==
- calld->send_message_caching_stream->length()) {
- method = GRPC_MDELEM_METHOD_GET;
- error = update_path_for_get(elem, batch);
- if (error != GRPC_ERROR_NONE) goto done;
- batch->send_message = false;
- calld->send_message_caching_stream->Orphan();
- } else {
- // Not all data is available. The batch will be sent down
- // asynchronously in on_send_message_next_done().
- batch_will_be_handled_asynchronously = true;
- // Fall back to POST.
- gpr_log(GPR_DEBUG,
- "Request is marked Cacheable but not all data is available. "
- "Falling back to POST");
- }
- } else if (batch->payload->send_initial_metadata
- .send_initial_metadata_flags &
- GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) {
- method = GRPC_MDELEM_METHOD_PUT;
+ return absl::Status(
+ static_cast<absl::StatusCode>(
+ grpc_http2_status_to_grpc_status(*status)),
+ absl::StrCat("Received http2 header with status: ", *status));
}
-
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_METHOD);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_SCHEME);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_TE);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_CONTENT_TYPE);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_USER_AGENT);
-
- /* Send : prefixed headers, which have to be before any application
- layer headers. */
- error = grpc_metadata_batch_add_head(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->method, method, GRPC_BATCH_METHOD);
- if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_head(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->scheme, channeld->static_scheme, GRPC_BATCH_SCHEME);
- if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_tail(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->te_trailers, GRPC_MDELEM_TE_TRAILERS, GRPC_BATCH_TE);
- if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_tail(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->content_type, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC,
- GRPC_BATCH_CONTENT_TYPE);
- if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_tail(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->user_agent, GRPC_MDELEM_REF(channeld->user_agent),
- GRPC_BATCH_USER_AGENT);
- if (error != GRPC_ERROR_NONE) goto done;
}
-done:
- if (error != GRPC_ERROR_NONE) {
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->send_message_batch, error, calld->call_combiner);
- } else if (!batch_will_be_handled_asynchronously) {
- grpc_call_next_op(elem, batch);
+ if (Slice* grpc_message = b->get_pointer(GrpcMessageMetadata())) {
+ *grpc_message = PermissivePercentDecodeSlice(std::move(*grpc_message));
}
-}
-/* Constructor for call_data */
-static grpc_error_handle http_client_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- new (elem->call_data) call_data(elem, *args);
- return GRPC_ERROR_NONE;
+ b->Remove(ContentTypeMetadata());
+ return absl::OkStatus();
}
-/* Destructor for call_data */
-static void http_client_destroy_call_elem(
- grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->~call_data();
+HttpSchemeMetadata::ValueType SchemeFromArgs(const ChannelArgs& args) {
+ HttpSchemeMetadata::ValueType scheme = HttpSchemeMetadata::Parse(
+ args.GetString(GRPC_ARG_HTTP2_SCHEME).value_or(""),
+ [](absl::string_view, const Slice&) {});
+ if (scheme == HttpSchemeMetadata::kInvalid) return HttpSchemeMetadata::kHttp;
+ return scheme;
}
-static grpc_mdelem scheme_from_args(const grpc_channel_args* args) {
- unsigned i;
- size_t j;
- grpc_mdelem valid_schemes[] = {GRPC_MDELEM_SCHEME_HTTP,
- GRPC_MDELEM_SCHEME_HTTPS};
- if (args != nullptr) {
- for (i = 0; i < args->num_args; ++i) {
- if (args->args[i].type == GRPC_ARG_STRING &&
- strcmp(args->args[i].key, GRPC_ARG_HTTP2_SCHEME) == 0) {
- for (j = 0; j < GPR_ARRAY_SIZE(valid_schemes); j++) {
- if (0 == grpc_slice_str_cmp(GRPC_MDVALUE(valid_schemes[j]),
- args->args[i].value.string)) {
- return valid_schemes[j];
- }
- }
- }
- }
- }
- return GRPC_MDELEM_SCHEME_HTTP;
-}
-
-static size_t max_payload_size_from_args(const grpc_channel_args* args) {
- if (args != nullptr) {
- for (size_t i = 0; i < args->num_args; ++i) {
- if (0 == strcmp(args->args[i].key, GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET)) {
- if (args->args[i].type != GRPC_ARG_INTEGER) {
- gpr_log(GPR_ERROR, "%s: must be an integer",
- GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET);
- } else {
- return static_cast<size_t>(args->args[i].value.integer);
- }
- }
- }
- }
- return kMaxPayloadSizeForGet;
-}
-
-static grpc_core::ManagedMemorySlice user_agent_from_args(
- const grpc_channel_args* args, const char* transport_name) {
- std::vector<std::string> user_agent_fields;
+Slice UserAgentFromArgs(const ChannelArgs& args, const char* transport_name) {
+ std::vector<std::string> fields;
+ auto add = [&fields](absl::string_view x) {
+ if (!x.empty()) fields.push_back(std::string(x));
+ };
- 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(
- absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
+ add(args.GetString(GRPC_ARG_PRIMARY_USER_AGENT_STRING).value_or(""));
+ add(absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
GPR_PLATFORM_STRING, transport_name));
+ add(args.GetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING).value_or(""));
- 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);
- }
- }
- }
-
- std::string user_agent_string = absl::StrJoin(user_agent_fields, " ");
- return grpc_core::ManagedMemorySlice(user_agent_string.c_str());
-}
-
-/* Constructor for channel_data */
-static grpc_error_handle http_client_init_channel_elem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- GPR_ASSERT(!args->is_last);
- GPR_ASSERT(args->optional_transport != nullptr);
- chand->static_scheme = scheme_from_args(args->channel_args);
- chand->max_payload_size_for_get =
- max_payload_size_from_args(args->channel_args);
- chand->user_agent = grpc_mdelem_from_slices(
- GRPC_MDSTR_USER_AGENT,
- user_agent_from_args(args->channel_args,
- args->optional_transport->vtable->name));
- return GRPC_ERROR_NONE;
-}
-
-/* Destructor for channel data */
-static void http_client_destroy_channel_elem(grpc_channel_element* elem) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- GRPC_MDELEM_UNREF(chand->user_agent);
+ return Slice::FromCopiedString(absl::StrJoin(fields, " "));
}
+} // namespace
-const grpc_channel_filter grpc_http_client_filter = {
- http_client_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- http_client_init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- http_client_destroy_call_elem,
- sizeof(channel_data),
- http_client_init_channel_elem,
- http_client_destroy_channel_elem,
- grpc_channel_next_get_info,
- "http-client"};
+ArenaPromise<ServerMetadataHandle> HttpClientFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ auto& md = call_args.client_initial_metadata;
+ md->Set(HttpMethodMetadata(), HttpMethodMetadata::kPost);
+ md->Set(HttpSchemeMetadata(), scheme_);
+ md->Set(TeMetadata(), TeMetadata::kTrailers);
+ md->Set(ContentTypeMetadata(), ContentTypeMetadata::kApplicationGrpc);
+ md->Set(UserAgentMetadata(), user_agent_.Ref());
+
+ auto* read_latch = GetContext<Arena>()->New<Latch<ServerMetadata*>>();
+ auto* write_latch =
+ absl::exchange(call_args.server_initial_metadata, read_latch);
+
+ return CallPushPull(
+ Seq(next_promise_factory(std::move(call_args)),
+ [](ServerMetadataHandle md) -> ServerMetadataHandle {
+ auto r = CheckServerMetadata(md.get());
+ if (!r.ok()) return ServerMetadataHandle(r);
+ return md;
+ }),
+ []() { return absl::OkStatus(); },
+ Seq(read_latch->Wait(),
+ [write_latch](ServerMetadata** md) -> absl::Status {
+ auto r =
+ *md == nullptr ? absl::OkStatus() : CheckServerMetadata(*md);
+ write_latch->Set(*md);
+ return r;
+ }));
+}
+
+HttpClientFilter::HttpClientFilter(HttpSchemeMetadata::ValueType scheme,
+ Slice user_agent)
+ : scheme_(scheme), user_agent_(std::move(user_agent)) {}
+
+absl::StatusOr<HttpClientFilter> HttpClientFilter::Create(ChannelArgs args,
+ ChannelFilter::Args) {
+ auto* transport = args.GetObject<grpc_transport>();
+ if (transport == nullptr) {
+ return absl::InvalidArgumentError("HttpClientFilter needs a transport");
+ }
+ return HttpClientFilter(SchemeFromArgs(args),
+ UserAgentFromArgs(args, transport->vtable->name));
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/http/client/http_client_filter.h b/grpc/src/core/ext/filters/http/client/http_client_filter.h
index a2f16ddb..97764ea0 100644
--- a/grpc/src/core/ext/filters/http/client/http_client_filter.h
+++ b/grpc/src/core/ext/filters/http/client/http_client_filter.h
@@ -21,11 +21,28 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/promise_based_filter.h"
-/* Processes metadata on the client side for HTTP2 transports */
-extern const grpc_channel_filter grpc_http_client_filter;
+namespace grpc_core {
-/* Channel arg to determine maximum size of payload eligible for GET request */
-#define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get"
+class HttpClientFilter : public ChannelFilter {
+ public:
+ static const grpc_channel_filter kFilter;
+
+ static absl::StatusOr<HttpClientFilter> Create(
+ ChannelArgs args, ChannelFilter::Args filter_args);
+
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ private:
+ HttpClientFilter(HttpSchemeMetadata::ValueType scheme, Slice user_agent);
+
+ HttpSchemeMetadata::ValueType scheme_;
+ Slice user_agent_;
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */
diff --git a/grpc/src/core/ext/filters/http/client_authority_filter.cc b/grpc/src/core/ext/filters/http/client_authority_filter.cc
index f44ef853..a3e8f0b3 100644
--- a/grpc/src/core/ext/filters/http/client_authority_filter.cc
+++ b/grpc/src/core/ext/filters/http/client_authority_filter.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/client_authority_filter.h"
+
#include <assert.h>
#include <limits.h>
#include <string.h>
@@ -27,113 +29,48 @@
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/http/client_authority_filter.h"
-#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.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"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-namespace {
-struct call_data {
- grpc_linked_mdelem authority_storage;
- grpc_core::CallCombiner* call_combiner;
-};
+namespace grpc_core {
-struct channel_data {
- grpc_core::ManagedMemorySlice default_authority;
- grpc_mdelem default_authority_mdelem;
-};
-
-void client_authority_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- // 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) {
- grpc_error_handle error = grpc_metadata_batch_add_head(
- 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,
- calld->call_combiner);
- return;
- }
+absl::StatusOr<ClientAuthorityFilter> ClientAuthorityFilter::Create(
+ ChannelArgs args, ChannelFilter::Args) {
+ absl::optional<absl::string_view> default_authority =
+ args.GetString(GRPC_ARG_DEFAULT_AUTHORITY);
+ if (!default_authority.has_value()) {
+ return absl::InvalidArgumentError(
+ "GRPC_ARG_DEFAULT_AUTHORITY string channel arg. not found. Note that "
+ "direct channels must explicitly specify a value for this argument.");
}
- // Pass control down the stack.
- grpc_call_next_op(elem, batch);
-}
-
-/* Constructor for call_data */
-grpc_error_handle client_authority_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->call_combiner = args->call_combiner;
- return GRPC_ERROR_NONE;
+ return ClientAuthorityFilter(Slice::FromCopiedString(*default_authority));
}
-/* Destructor for call_data */
-void client_authority_destroy_call_elem(
- grpc_call_element* /*elem*/, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {}
-
-/* Constructor for channel_data */
-grpc_error_handle client_authority_init_channel_elem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- const grpc_arg* default_authority_arg =
- grpc_channel_args_find(args->channel_args, GRPC_ARG_DEFAULT_AUTHORITY);
- if (default_authority_arg == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "GRPC_ARG_DEFAULT_AUTHORITY channel arg. not found. Note that direct "
- "channels must explicitly specify a value for this argument.");
- }
- const char* default_authority_str =
- grpc_channel_arg_get_string(default_authority_arg);
- if (default_authority_str == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "GRPC_ARG_DEFAULT_AUTHORITY channel arg. must be a string");
+ArenaPromise<ServerMetadataHandle> ClientAuthorityFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ // If no authority is set, set the default authority.
+ if (call_args.client_initial_metadata->get_pointer(HttpAuthorityMetadata()) ==
+ nullptr) {
+ call_args.client_initial_metadata->Set(HttpAuthorityMetadata(),
+ default_authority_.Ref());
}
- chand->default_authority =
- grpc_core::ManagedMemorySlice(default_authority_str);
- chand->default_authority_mdelem = grpc_mdelem_create(
- GRPC_MDSTR_AUTHORITY, chand->default_authority, nullptr);
- GPR_ASSERT(!args->is_last);
- return GRPC_ERROR_NONE;
+ // We have no asynchronous work, so we can just ask the next promise to run,
+ // passing down initial_metadata.
+ return next_promise_factory(std::move(call_args));
}
-/* Destructor for channel data */
-void client_authority_destroy_channel_elem(grpc_channel_element* elem) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- grpc_slice_unref_internal(chand->default_authority);
- GRPC_MDELEM_UNREF(chand->default_authority_mdelem);
-}
-} // namespace
+const grpc_channel_filter ClientAuthorityFilter::kFilter =
+ MakePromiseBasedFilter<ClientAuthorityFilter, FilterEndpoint::kClient>(
+ "authority");
-const grpc_channel_filter grpc_client_authority_filter = {
- client_authority_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- client_authority_init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- client_authority_destroy_call_elem,
- sizeof(channel_data),
- client_authority_init_channel_elem,
- client_authority_destroy_channel_elem,
- grpc_channel_next_get_info,
- "authority"};
-
-static bool add_client_authority_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
+namespace {
+bool add_client_authority_filter(ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
const grpc_arg* disable_client_authority_filter_arg = grpc_channel_args_find(
channel_args, GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER);
if (disable_client_authority_filter_arg != nullptr) {
@@ -143,17 +80,16 @@ static bool add_client_authority_filter(grpc_channel_stack_builder* builder,
return true;
}
}
- return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
+ builder->PrependFilter(&ClientAuthorityFilter::kFilter, nullptr);
+ return true;
}
+} // namespace
-void grpc_client_authority_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, INT_MAX, add_client_authority_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_authority_filter));
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX, add_client_authority_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_authority_filter));
+void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
+ add_client_authority_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ add_client_authority_filter);
}
-void grpc_client_authority_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/http/client_authority_filter.h b/grpc/src/core/ext/filters/http/client_authority_filter.h
index 5824e91f..f049e304 100644
--- a/grpc/src/core/ext/filters/http/client_authority_filter.h
+++ b/grpc/src/core/ext/filters/http/client_authority_filter.h
@@ -21,14 +21,33 @@
#include <grpc/support/port_platform.h>
+#include "absl/status/statusor.h"
+
#include <grpc/impl/codegen/compression_types.h>
-#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/slice/slice.h"
+
+namespace grpc_core {
+
+class ClientAuthorityFilter final : public ChannelFilter {
+ public:
+ static const grpc_channel_filter kFilter;
+
+ static absl::StatusOr<ClientAuthorityFilter> Create(ChannelArgs args,
+ ChannelFilter::Args);
+
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
-/// Filter responsible for setting the authority header, if not already set. It
-/// uses the value of the GRPC_ARG_DEFAULT_AUTHORITY channel arg if the initial
-/// metadata doesn't already contain an authority value.
+ private:
+ explicit ClientAuthorityFilter(Slice default_authority)
+ : default_authority_(std::move(default_authority)) {}
+ Slice default_authority_;
+};
-extern const grpc_channel_filter grpc_client_authority_filter;
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H */
diff --git a/grpc/src/core/ext/filters/http/http_filters_plugin.cc b/grpc/src/core/ext/filters/http/http_filters_plugin.cc
index d5577d56..b0ed558e 100644
--- a/grpc/src/core/ext/filters/http/http_filters_plugin.cc
+++ b/grpc/src/core/ext/filters/http/http_filters_plugin.cc
@@ -25,84 +25,66 @@
#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/config/core_configuration.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/transport_impl.h"
-struct optional_filter {
- const grpc_channel_filter* filter;
- const char* control_channel_arg;
-};
-
-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 bool is_building_http_like_transport(
- grpc_channel_stack_builder* builder) {
- grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
+ grpc_core::ChannelStackBuilder* builder) {
+ grpc_transport* t = builder->transport();
return t != nullptr && strstr(t->vtable->name, "http");
}
-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;
- optional_filter* filtarg = static_cast<optional_filter*>(arg);
- const grpc_channel_args* channel_args =
- 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));
- return enable ? grpc_channel_stack_builder_prepend_filter(
- builder, filtarg->filter, nullptr, nullptr)
- : true;
-}
-
-static bool maybe_add_required_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- return is_building_http_like_transport(builder)
- ? grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg),
- nullptr, nullptr)
- : true;
-}
-
-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_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_client_filter));
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_client_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_server_filter));
+namespace grpc_core {
+void RegisterHttpFilters(CoreConfiguration::Builder* builder) {
+ auto optional = [builder](grpc_channel_stack_type channel_type,
+ bool enable_in_minimal_stack,
+ const char* control_channel_arg,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ channel_type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [enable_in_minimal_stack, control_channel_arg,
+ filter](ChannelStackBuilder* builder) {
+ if (!is_building_http_like_transport(builder)) return true;
+ const grpc_channel_args* channel_args = builder->channel_args();
+ bool enable = grpc_channel_arg_get_bool(
+ grpc_channel_args_find(channel_args, control_channel_arg),
+ enable_in_minimal_stack ||
+ !grpc_channel_args_want_minimal_stack(channel_args));
+ if (enable) builder->PrependFilter(filter, nullptr);
+ return true;
+ });
+ };
+ auto required = [builder](grpc_channel_stack_type channel_type,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ channel_type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [filter](ChannelStackBuilder* builder) {
+ if (is_building_http_like_transport(builder)) {
+ builder->PrependFilter(filter, nullptr);
+ }
+ return true;
+ });
+ };
+ // TODO(ctiller): return this flag to true once the promise conversion is
+ // complete.
+ static constexpr bool kMinimalStackHasDecompression = false;
+ optional(GRPC_CLIENT_SUBCHANNEL, false,
+ GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_CLIENT_DIRECT_CHANNEL, false,
+ GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_SERVER_CHANNEL, false, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_CLIENT_SUBCHANNEL, kMinimalStackHasDecompression,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
+ optional(GRPC_CLIENT_DIRECT_CHANNEL, kMinimalStackHasDecompression,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
+ optional(GRPC_SERVER_CHANNEL, kMinimalStackHasDecompression,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
+ required(GRPC_CLIENT_SUBCHANNEL, &HttpClientFilter::kFilter);
+ required(GRPC_CLIENT_DIRECT_CHANNEL, &HttpClientFilter::kFilter);
+ required(GRPC_SERVER_CHANNEL, &grpc_http_server_filter);
}
-
-void grpc_http_filters_shutdown(void) {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
index 0fc85b1e..3d1c3ab2 100644
--- a/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
+++ b/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
+
#include <assert.h>
#include <string.h>
@@ -28,10 +30,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/filters/http/message_compress/message_compress_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"
@@ -40,7 +39,6 @@
#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/transport/static_metadata.h"
namespace {
@@ -48,28 +46,32 @@ 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);
+ enabled_compression_algorithms_ =
+ grpc_core::CompressionAlgorithmSet::FromChannelArgs(args->channel_args);
default_compression_algorithm_ =
- grpc_channel_args_get_channel_default_compression_algorithm(
- args->channel_args);
+ grpc_core::DefaultCompressionAlgorithmFromChannelArgs(
+ args->channel_args)
+ .value_or(GRPC_COMPRESS_NONE);
// Make sure the default is enabled.
- if (!GPR_BITGET(enabled_compression_algorithms_bitset_,
- default_compression_algorithm_)) {
+ if (!enabled_compression_algorithms_.IsSet(
+ default_compression_algorithm_)) {
const char* name;
- GPR_ASSERT(grpc_compression_algorithm_name(default_compression_algorithm_,
- &name) == 1);
+ if (!grpc_compression_algorithm_name(default_compression_algorithm_,
+ &name)) {
+ name = "<unknown>";
+ }
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_);
+
+ min_message_size_to_compress_ =
+ grpc_core::DefaultGrpcMinMessageSizeToCompressFromChannelArgs(
+ args->channel_args);
+
+ compression_options_ =
+ grpc_core::MakeCompressionOptions(args->channel_args);
GPR_ASSERT(!args->is_last);
}
@@ -77,27 +79,25 @@ class ChannelData {
return default_compression_algorithm_;
}
- uint32_t enabled_compression_algorithms_bitset() const {
- return enabled_compression_algorithms_bitset_;
+ const grpc_core::CompressionOptions* compression_options() {
+ return compression_options_.get();
}
- uint32_t enabled_message_compression_algorithms_bitset() const {
- return enabled_message_compression_algorithms_bitset_;
+ int min_message_size_to_compress() const {
+ return min_message_size_to_compress_;
}
- uint32_t enabled_stream_compression_algorithms_bitset() const {
- return enabled_stream_compression_algorithms_bitset_;
+ grpc_core::CompressionAlgorithmSet enabled_compression_algorithms() const {
+ return enabled_compression_algorithms_;
}
private:
/** The default, channel-level, compression algorithm */
grpc_compression_algorithm default_compression_algorithm_;
- /** Bitset of enabled compression algorithms */
- uint32_t enabled_compression_algorithms_bitset_;
- /** Bitset of enabled message compression algorithms */
- uint32_t enabled_message_compression_algorithms_bitset_;
- /** Bitset of enabled stream compression algorithms */
- uint32_t enabled_stream_compression_algorithms_bitset_;
+ /** Enabled compression algorithms */
+ grpc_core::CompressionAlgorithmSet enabled_compression_algorithms_;
+ std::unique_ptr<grpc_core::CompressionOptions> compression_options_;
+ int min_message_size_to_compress_;
};
class CallData {
@@ -107,12 +107,12 @@ class CallData {
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_ =
- grpc_compression_algorithm_to_message_compression_algorithm(
- channeld->default_compression_algorithm());
+ if (GPR_LIKELY(channeld->enabled_compression_algorithms().IsSet(
+ channeld->default_compression_algorithm()))) {
+ compression_algorithm_ = channeld->default_compression_algorithm();
}
+ compression_options_ = channeld->compression_options();
+ min_message_size_to_compress_ = channeld->min_message_size_to_compress();
GRPC_CLOSURE_INIT(&start_send_message_batch_in_call_combiner_,
StartSendMessageBatch, elem, grpc_schedule_on_exec_ctx);
}
@@ -131,8 +131,8 @@ class CallData {
bool SkipMessageCompression();
void InitializeState(grpc_call_element* elem);
- grpc_error_handle ProcessSendInitialMetadata(
- grpc_call_element* elem, grpc_metadata_batch* initial_metadata);
+ void 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_handle unused);
@@ -147,8 +147,9 @@ class CallData {
static void SendMessageOnComplete(void* calld_arg, grpc_error_handle error);
grpc_core::CallCombiner* call_combiner_;
- grpc_message_compression_algorithm message_compression_algorithm_ =
- GRPC_MESSAGE_COMPRESS_NONE;
+ grpc_compression_algorithm compression_algorithm_ = GRPC_COMPRESS_NONE;
+ int min_message_size_to_compress_;
+ const grpc_core::CompressionOptions* compression_options_;
grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
grpc_transport_stream_op_batch* send_message_batch_ = nullptr;
bool seen_initial_metadata_ = false;
@@ -158,10 +159,6 @@ class CallData {
/* 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),
@@ -181,45 +178,15 @@ bool CallData::SkipMessageCompression() {
if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) {
return true;
}
+ // If the message size is less than the min_message_size_to_compress_,
+ // skip message compression.
+ if (send_message_batch_->payload->send_message.send_message->length() <
+ min_message_size_to_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;
-}
-
-// 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) {
- if (initial_metadata->idx.named.grpc_internal_encoding_request == nullptr) {
- return channeld->default_compression_algorithm();
- }
- grpc_compression_algorithm compression_algorithm;
- // Parse the compression algorithm from the initial metadata.
- grpc_mdelem md =
- initial_metadata->idx.named.grpc_internal_encoding_request->md;
- GPR_ASSERT(grpc_compression_algorithm_parse(GRPC_MDVALUE(md),
- &compression_algorithm));
- // Remove this metadata since it's an internal one (i.e., it won't be
- // transmitted out).
- grpc_metadata_batch_remove(initial_metadata,
- GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST);
- // Check if that algorithm is enabled. Note that GRPC_COMPRESS_NONE is always
- // 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(),
- compression_algorithm))) {
- return compression_algorithm;
- }
- const char* algorithm_name;
- GPR_ASSERT(
- grpc_compression_algorithm_name(compression_algorithm, &algorithm_name));
- gpr_log(GPR_ERROR,
- "Invalid compression algorithm from initial metadata: '%s' "
- "(previously disabled). "
- "Will not compress.",
- algorithm_name);
- return GRPC_COMPRESS_NONE;
+ return compression_algorithm_ == GRPC_COMPRESS_NONE;
}
void CallData::InitializeState(grpc_call_element* elem) {
@@ -232,53 +199,28 @@ void CallData::InitializeState(grpc_call_element* elem) {
grpc_schedule_on_exec_ctx);
}
-grpc_error_handle CallData::ProcessSendInitialMetadata(
+void CallData::ProcessSendInitialMetadata(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
// Find the compression algorithm.
- grpc_compression_algorithm compression_algorithm =
- FindCompressionAlgorithm(initial_metadata, channeld);
- // Note that at most one of the following algorithms can be set.
- message_compression_algorithm_ =
- grpc_compression_algorithm_to_message_compression_algorithm(
- compression_algorithm);
- grpc_stream_compression_algorithm stream_compression_algorithm =
- grpc_compression_algorithm_to_stream_compression_algorithm(
- compression_algorithm);
- // Hint compression algorithm.
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (message_compression_algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
- InitializeState(elem);
- error = grpc_metadata_batch_add_tail(
- initial_metadata, &message_compression_algorithm_storage_,
- grpc_message_compression_encoding_mdelem(
- message_compression_algorithm_),
- GRPC_BATCH_GRPC_ENCODING);
- } else if (stream_compression_algorithm != GRPC_STREAM_COMPRESS_NONE) {
- InitializeState(elem);
- error = grpc_metadata_batch_add_tail(
- initial_metadata, &stream_compression_algorithm_storage_,
- grpc_stream_compression_encoding_mdelem(stream_compression_algorithm),
- GRPC_BATCH_CONTENT_ENCODING);
+ compression_algorithm_ =
+ initial_metadata->Take(grpc_core::GrpcInternalEncodingRequest())
+ .value_or(channeld->default_compression_algorithm());
+ switch (compression_algorithm_) {
+ case GRPC_COMPRESS_NONE:
+ break;
+ case GRPC_COMPRESS_DEFLATE:
+ case GRPC_COMPRESS_GZIP:
+ InitializeState(elem);
+ initial_metadata->Set(grpc_core::GrpcEncodingMetadata(),
+ compression_algorithm_);
+ break;
+ case GRPC_COMPRESS_ALGORITHMS_COUNT:
+ abort();
}
- if (error != GRPC_ERROR_NONE) return error;
// Convey supported compression algorithms.
- error = grpc_metadata_batch_add_tail(
- initial_metadata, &accept_encoding_storage_,
- GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(
- 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_,
- GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(
- channeld->enabled_stream_compression_algorithms_bitset()),
- GRPC_BATCH_ACCEPT_ENCODING);
- }
- return error;
+ initial_metadata->Set(grpc_core::GrpcAcceptEncodingMetadata(),
+ channeld->enabled_compression_algorithms());
}
void CallData::SendMessageOnComplete(void* calld_arg, grpc_error_handle error) {
@@ -298,15 +240,14 @@ void CallData::SendMessageBatchContinue(grpc_call_element* elem) {
}
void CallData::FinishSendMessage(grpc_call_element* elem) {
- GPR_DEBUG_ASSERT(message_compression_algorithm_ !=
- GRPC_MESSAGE_COMPRESS_NONE);
+ GPR_DEBUG_ASSERT(compression_algorithm_ != GRPC_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);
+ bool did_compress = grpc_msg_compress(compression_algorithm_, &slices_, &tmp,
+ compression_options_);
if (did_compress) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
const char* algo_name;
@@ -314,8 +255,8 @@ void CallData::FinishSendMessage(grpc_call_element* elem) {
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));
+ GPR_ASSERT(
+ grpc_compression_algorithm_name(compression_algorithm_, &algo_name));
gpr_log(GPR_INFO,
"Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR
" bytes (%.2f%% savings)",
@@ -326,8 +267,8 @@ void CallData::FinishSendMessage(grpc_call_element* elem) {
} 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));
+ GPR_ASSERT(
+ grpc_compression_algorithm_name(compression_algorithm_, &algo_name));
gpr_log(GPR_INFO,
"Algorithm '%s' enabled but decided not to compress. Input size: "
"%" PRIuPTR,
@@ -459,13 +400,8 @@ void CallData::CompressStartTransportStreamOpBatch(
// Handle send_initial_metadata.
if (batch->send_initial_metadata) {
GPR_ASSERT(!seen_initial_metadata_);
- grpc_error_handle error = ProcessSendInitialMetadata(
+ 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_);
- return;
- }
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
@@ -535,6 +471,7 @@ void CompressDestroyChannelElem(grpc_channel_element* elem) {
const grpc_channel_filter grpc_message_compress_filter = {
CompressStartTransportStreamOpBatch,
+ nullptr,
grpc_channel_next_op,
sizeof(CallData),
CompressInitCallElem,
diff --git a/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc b/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
index 426dd903..aab2dbc3 100644
--- a/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
+++ b/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
@@ -24,17 +24,15 @@
#include <string.h>
#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
#include <grpc/compression.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "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"
@@ -47,12 +45,18 @@ namespace {
class ChannelData {
public:
explicit ChannelData(const grpc_channel_element_args* args)
- : max_recv_size_(GetMaxRecvSizeFromChannelArgs(args->channel_args)) {}
+ : max_recv_size_(GetMaxRecvSizeFromChannelArgs(args->channel_args)),
+ message_size_service_config_parser_index_(
+ MessageSizeParser::ParserIndex()) {}
int max_recv_size() const { return max_recv_size_; }
+ size_t message_size_service_config_parser_index() const {
+ return message_size_service_config_parser_index_;
+ }
private:
int max_recv_size_;
+ const size_t message_size_service_config_parser_index_;
};
class CallData {
@@ -75,7 +79,8 @@ class CallData {
OnRecvTrailingMetadataReady, this,
grpc_schedule_on_exec_ctx);
const MessageSizeParsedConfig* limits =
- MessageSizeParsedConfig::GetFromCallContext(args.context);
+ MessageSizeParsedConfig::GetFromCallContext(
+ args.context, chand->message_size_service_config_parser_index());
if (limits != nullptr && limits->limits().max_recv_size >= 0 &&
(limits->limits().max_recv_size < max_recv_message_length_ ||
max_recv_message_length_ < 0)) {
@@ -114,7 +119,7 @@ class CallData {
// 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_compression_algorithm algorithm_ = GRPC_COMPRESS_NONE;
grpc_closure on_recv_message_ready_;
grpc_closure* original_recv_message_ready_ = nullptr;
grpc_closure on_recv_message_next_done_;
@@ -133,30 +138,12 @@ class CallData {
grpc_error_handle 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_handle 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->algorithm_ =
+ calld->recv_initial_metadata_->get(GrpcEncodingMetadata())
+ .value_or(GRPC_COMPRESS_NONE);
}
calld->MaybeResumeOnRecvMessageReady();
calld->MaybeResumeOnRecvTrailingMetadataReady();
@@ -184,7 +171,7 @@ void CallData::OnRecvMessageReady(void* arg, grpc_error_handle error) {
"OnRecvInitialMetadataReady");
return;
}
- if (calld->algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
+ if (calld->algorithm_ != GRPC_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 ||
@@ -196,12 +183,12 @@ void CallData::OnRecvMessageReady(void* arg, grpc_error_handle error) {
if (calld->max_recv_message_length_ >= 0 &&
(*calld->recv_message_)->length() >
static_cast<uint32_t>(calld->max_recv_message_length_)) {
- std::string message_string = 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_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("Received message larger than max (%u vs. %d)",
+ (*calld->recv_message_)->length(),
+ calld->max_recv_message_length_)),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
return calld->ContinueRecvMessageReadyCallback(
GRPC_ERROR_REF(calld->error_));
@@ -260,11 +247,10 @@ void CallData::FinishRecvMessage() {
if (grpc_msg_decompress(algorithm_, &recv_slices_, &decompressed_slices) ==
0) {
GPR_DEBUG_ASSERT(error_ == GRPC_ERROR_NONE);
- error_ = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_ = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("Unexpected error decompressing data for algorithm with "
"enum value ",
- algorithm_)
- .c_str());
+ algorithm_));
grpc_slice_buffer_destroy_internal(&decompressed_slices);
} else {
uint32_t recv_flags =
@@ -386,6 +372,7 @@ void DecompressDestroyChannelElem(grpc_channel_element* elem) {
const grpc_channel_filter MessageDecompressFilter = {
DecompressStartTransportStreamOpBatch,
+ nullptr,
grpc_channel_next_op,
sizeof(CallData),
DecompressInitCallElem,
diff --git a/grpc/src/core/ext/filters/http/server/http_server_filter.cc b/grpc/src/core/ext/filters/http/server/http_server_filter.cc
index 226ba020..5df249bf 100644
--- a/grpc/src/core/ext/filters/http/server/http_server_filter.cc
+++ b/grpc/src/core/ext/filters/http/server/http_server_filter.cc
@@ -20,9 +20,11 @@
#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/profiling/timers.h"
@@ -30,16 +32,11 @@
#include "src/core/lib/slice/percent_encoding.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-#define EXPECTED_CONTENT_TYPE "application/grpc"
-#define EXPECTED_CONTENT_TYPE_LENGTH (sizeof(EXPECTED_CONTENT_TYPE) - 1)
static void hs_recv_initial_metadata_ready(void* user_data,
grpc_error_handle err);
static void hs_recv_trailing_metadata_ready(void* user_data,
grpc_error_handle err);
-static void hs_recv_message_ready(void* user_data, grpc_error_handle err);
namespace {
@@ -49,31 +46,15 @@ struct call_data {
GRPC_CLOSURE_INIT(&recv_initial_metadata_ready,
hs_recv_initial_metadata_ready, elem,
grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&recv_message_ready, hs_recv_message_ready, elem,
- grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready,
hs_recv_trailing_metadata_ready, elem,
grpc_schedule_on_exec_ctx);
}
- ~call_data() {
- GRPC_ERROR_UNREF(recv_initial_metadata_ready_error);
- if (have_read_stream) {
- read_stream->Orphan();
- }
- }
+ ~call_data() { GRPC_ERROR_UNREF(recv_initial_metadata_ready_error); }
grpc_core::CallCombiner* call_combiner;
- // Outgoing headers to add to send_initial_metadata.
- grpc_linked_mdelem status;
- grpc_linked_mdelem content_type;
-
- // If we see the recv_message contents in the GET query string, we
- // store it here.
- grpc_core::ManualConstructor<grpc_core::SliceBufferByteStream> read_stream;
- bool have_read_stream = false;
-
// State for intercepting recv_initial_metadata.
grpc_closure recv_initial_metadata_ready;
grpc_error_handle recv_initial_metadata_ready_error = GRPC_ERROR_NONE;
@@ -82,12 +63,6 @@ struct call_data {
uint32_t* recv_initial_metadata_flags;
bool seen_recv_initial_metadata_ready = false;
- // State for intercepting recv_message.
- grpc_closure* original_recv_message_ready;
- grpc_closure recv_message_ready;
- grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message;
- bool seen_recv_message_ready = false;
-
// State for intercepting recv_trailing_metadata
grpc_closure recv_trailing_metadata_ready;
grpc_closure* original_recv_trailing_metadata_ready;
@@ -102,16 +77,10 @@ struct channel_data {
} // namespace
static grpc_error_handle hs_filter_outgoing_metadata(grpc_metadata_batch* b) {
- if (b->idx.named.grpc_message != nullptr) {
- grpc_slice pct_encoded_msg = grpc_percent_encode_slice(
- GRPC_MDVALUE(b->idx.named.grpc_message->md),
- grpc_compatible_percent_encoding_unreserved_bytes);
- if (grpc_slice_is_equivalent(pct_encoded_msg,
- GRPC_MDVALUE(b->idx.named.grpc_message->md))) {
- grpc_slice_unref_internal(pct_encoded_msg);
- } else {
- grpc_metadata_batch_set_value(b->idx.named.grpc_message, pct_encoded_msg);
- }
+ if (grpc_core::Slice* grpc_message =
+ b->get_pointer(grpc_core::GrpcMessageMetadata())) {
+ *grpc_message = grpc_core::PercentEncodeSlice(
+ std::move(*grpc_message), grpc_core::PercentEncodingType::Compatible);
}
return GRPC_ERROR_NONE;
}
@@ -125,208 +94,82 @@ static void hs_add_error(const char* error_name, grpc_error_handle* cumulative,
*cumulative = grpc_error_add_child(*cumulative, new_err);
}
-// Metadata equality within this filter leverages the fact that the sender was
-// likely using the gRPC chttp2 transport, in which case the encoder would emit
-// indexed values, in which case the local hpack parser would intern the
-// relevant metadata, allowing a simple pointer comparison.
-//
-// That said, if the header was transmitted sans indexing/encoding, we still
-// need to do the right thing.
-//
-// Assumptions:
-// 1) The keys for a and b_static must match
-// 2) b_static must be a statically allocated metadata object.
-// 3) It is assumed that the remote end is indexing, but not necessary.
-// TODO(arjunroy): Revisit this method when grpc_mdelem is strongly typed.
-static bool md_strict_equal(grpc_mdelem a, grpc_mdelem b_static) {
- // Hpack encoder on the remote side should emit indexed values, in which case
- // hpack parser on this end should pick up interned values, in which case the
- // pointer comparison alone is enough.
- //
- if (GPR_LIKELY(GRPC_MDELEM_IS_INTERNED(a))) {
- return a.payload == b_static.payload;
- } else {
- return grpc_slice_eq_static_interned(GRPC_MDVALUE(a),
- GRPC_MDVALUE(b_static));
- }
-}
-
static grpc_error_handle hs_filter_incoming_metadata(grpc_call_element* elem,
grpc_metadata_batch* b) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
grpc_error_handle error = GRPC_ERROR_NONE;
static const char* error_name = "Failed processing incoming headers";
- if (b->idx.named.method != nullptr) {
- if (md_strict_equal(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) {
- *calld->recv_initial_metadata_flags &=
- ~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST |
- GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
- } else if (md_strict_equal(b->idx.named.method->md,
- GRPC_MDELEM_METHOD_PUT)) {
- *calld->recv_initial_metadata_flags &=
- ~GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
- *calld->recv_initial_metadata_flags |=
- GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
- } else if (md_strict_equal(b->idx.named.method->md,
- GRPC_MDELEM_METHOD_GET)) {
- *calld->recv_initial_metadata_flags |=
- GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
- *calld->recv_initial_metadata_flags &=
- ~GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
- } else {
- hs_add_error(error_name, &error,
- grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.method->md));
+ auto method = b->get(grpc_core::HttpMethodMetadata());
+ if (method.has_value()) {
+ switch (*method) {
+ case grpc_core::HttpMethodMetadata::kPost:
+ break;
+ case grpc_core::HttpMethodMetadata::kInvalid:
+ case grpc_core::HttpMethodMetadata::kGet:
+ hs_add_error(error_name, &error,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad method header"));
+ break;
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_METHOD);
} else {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":method")));
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":method"));
}
- if (b->idx.named.te != nullptr) {
- if (!grpc_mdelem_static_value_eq(b->idx.named.te->md,
- GRPC_MDELEM_TE_TRAILERS)) {
- hs_add_error(error_name, &error,
- grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.te->md));
- }
- grpc_metadata_batch_remove(b, GRPC_BATCH_TE);
- } else {
+ auto te = b->Take(grpc_core::TeMetadata());
+ if (te == grpc_core::TeMetadata::kTrailers) {
+ // Do nothing, ok.
+ } else if (!te.has_value()) {
hs_add_error(error_name, &error,
grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string("te")));
+ GRPC_ERROR_STR_KEY, "te"));
+ } else {
+ hs_add_error(error_name, &error,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad te header"));
}
- if (b->idx.named.scheme != nullptr) {
- if (!md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTP) &&
- !md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) &&
- !grpc_mdelem_static_value_eq(b->idx.named.scheme->md,
- GRPC_MDELEM_SCHEME_GRPC)) {
+ auto scheme = b->Take(grpc_core::HttpSchemeMetadata());
+ if (scheme.has_value()) {
+ if (*scheme == grpc_core::HttpSchemeMetadata::kInvalid) {
hs_add_error(error_name, &error,
- grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.scheme->md));
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad :scheme header"));
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_SCHEME);
} else {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":scheme")));
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":scheme"));
}
- if (b->idx.named.content_type != nullptr) {
- if (!grpc_mdelem_static_value_eq(
- b->idx.named.content_type->md,
- GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) {
- if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md),
- EXPECTED_CONTENT_TYPE,
- EXPECTED_CONTENT_TYPE_LENGTH) &&
- (GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
- '+' ||
- GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
- ';')) {
- /* Although the C implementation doesn't (currently) generate them,
- any custom +-suffix is explicitly valid. */
- /* TODO(klempner): We should consider preallocating common values such
- as +proto or +json, or at least stashing them if we see them. */
- /* TODO(klempner): Should we be surfacing this to application code? */
- } else {
- /* TODO(klempner): We're currently allowing this, but we shouldn't
- see it without a proxy so log for now. */
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
- GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
- gpr_free(val);
- }
- }
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE);
- }
+ b->Remove(grpc_core::ContentTypeMetadata());
- if (b->idx.named.path == nullptr) {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":path")));
- } else if (*calld->recv_initial_metadata_flags &
- GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
- /* We have a cacheable request made with GET verb. The path contains the
- * query parameter which is base64 encoded request payload. */
- const char k_query_separator = '?';
- grpc_slice path_slice = GRPC_MDVALUE(b->idx.named.path->md);
- uint8_t* path_ptr = GRPC_SLICE_START_PTR(path_slice);
- size_t path_length = GRPC_SLICE_LENGTH(path_slice);
- /* offset of the character '?' */
- size_t offset = 0;
- for (offset = 0; offset < path_length && *path_ptr != k_query_separator;
- path_ptr++, offset++) {
- }
- if (offset < path_length) {
- grpc_slice query_slice =
- grpc_slice_sub(path_slice, offset + 1, path_length);
-
- /* substitute path metadata with just the path (not query) */
- grpc_mdelem mdelem_path_without_query = grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH, grpc_slice_sub(path_slice, 0, offset));
-
- grpc_metadata_batch_substitute(b, b->idx.named.path,
- mdelem_path_without_query);
-
- /* decode payload from query and add to the slice buffer to be returned */
- const int k_url_safe = 1;
- grpc_slice_buffer read_slice_buffer;
- grpc_slice_buffer_init(&read_slice_buffer);
- grpc_slice_buffer_add(
- &read_slice_buffer,
- grpc_base64_decode_with_len(
- reinterpret_cast<const char*> GRPC_SLICE_START_PTR(query_slice),
- GRPC_SLICE_LENGTH(query_slice), k_url_safe));
- calld->read_stream.Init(&read_slice_buffer, 0);
- grpc_slice_buffer_destroy_internal(&read_slice_buffer);
- calld->have_read_stream = true;
- grpc_slice_unref_internal(query_slice);
- } else {
- gpr_log(GPR_ERROR, "GET request without QUERY");
- }
+ grpc_core::Slice* path_slice = b->get_pointer(grpc_core::HttpPathMetadata());
+ if (path_slice == nullptr) {
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":path"));
}
- if (b->idx.named.host != nullptr && b->idx.named.authority == nullptr) {
- grpc_linked_mdelem* el = b->idx.named.host;
- grpc_mdelem md = GRPC_MDELEM_REF(el->md);
- grpc_metadata_batch_remove(b, el);
- hs_add_error(
- error_name, &error,
- grpc_metadata_batch_add_head(
- b, el,
- grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY,
- grpc_slice_ref_internal(GRPC_MDVALUE(md))),
- GRPC_BATCH_AUTHORITY));
- GRPC_MDELEM_UNREF(md);
+ if (b->get_pointer(grpc_core::HttpAuthorityMetadata()) == nullptr) {
+ absl::optional<grpc_core::Slice> host = b->Take(grpc_core::HostMetadata());
+ if (host.has_value()) {
+ b->Set(grpc_core::HttpAuthorityMetadata(), std::move(*host));
+ }
}
- if (b->idx.named.authority == nullptr) {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":authority")));
+ if (b->get_pointer(grpc_core::HttpAuthorityMetadata()) == nullptr) {
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":authority"));
}
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- if (!chand->surface_user_agent && b->idx.named.user_agent != nullptr) {
- grpc_metadata_batch_remove(b, GRPC_BATCH_USER_AGENT);
+ if (!chand->surface_user_agent) {
+ b->Remove(grpc_core::UserAgentMetadata());
}
return error;
@@ -340,24 +183,8 @@ static void hs_recv_initial_metadata_ready(void* user_data,
if (err == GRPC_ERROR_NONE) {
err = hs_filter_incoming_metadata(elem, calld->recv_initial_metadata);
calld->recv_initial_metadata_ready_error = GRPC_ERROR_REF(err);
- if (calld->seen_recv_message_ready) {
- // We've already seen the recv_message callback, but we previously
- // deferred it, so we need to return it here.
- // Replace the recv_message byte stream if needed.
- if (calld->have_read_stream) {
- calld->recv_message->reset(calld->read_stream.get());
- calld->have_read_stream = false;
- }
- // Re-enter call combiner for original_recv_message_ready, since the
- // surface code will release the call combiner for each callback it
- // receives.
- GRPC_CALL_COMBINER_START(
- calld->call_combiner, calld->original_recv_message_ready,
- GRPC_ERROR_REF(err),
- "resuming recv_message_ready from recv_initial_metadata_ready");
- }
} else {
- GRPC_ERROR_REF(err);
+ (void)GRPC_ERROR_REF(err);
}
if (calld->seen_recv_trailing_metadata_ready) {
GRPC_CALL_COMBINER_START(calld->call_combiner,
@@ -370,31 +197,6 @@ static void hs_recv_initial_metadata_ready(void* user_data,
calld->original_recv_initial_metadata_ready, err);
}
-static void hs_recv_message_ready(void* user_data, grpc_error_handle err) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->seen_recv_message_ready = true;
- if (calld->seen_recv_initial_metadata_ready) {
- // We've already seen the recv_initial_metadata callback, so
- // replace the recv_message byte stream if needed and invoke the
- // original recv_message callback immediately.
- if (calld->have_read_stream) {
- calld->recv_message->reset(calld->read_stream.get());
- calld->have_read_stream = false;
- }
- grpc_core::Closure::Run(DEBUG_LOCATION, calld->original_recv_message_ready,
- GRPC_ERROR_REF(err));
- } else {
- // We have not yet seen the recv_initial_metadata callback, so we
- // need to wait to see if this is a GET request.
- // Note that we release the call combiner here, so that other
- // callbacks can run.
- GRPC_CALL_COMBINER_STOP(
- calld->call_combiner,
- "pausing recv_message_ready until recv_initial_metadata_ready");
- }
-}
-
static void hs_recv_trailing_metadata_ready(void* user_data,
grpc_error_handle err) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
@@ -422,17 +224,11 @@ static grpc_error_handle hs_mutate_op(grpc_call_element* elem,
if (op->send_initial_metadata) {
grpc_error_handle error = GRPC_ERROR_NONE;
static const char* error_name = "Failed sending initial metadata";
- hs_add_error(
- error_name, &error,
- grpc_metadata_batch_add_head(
- op->payload->send_initial_metadata.send_initial_metadata,
- &calld->status, GRPC_MDELEM_STATUS_200, GRPC_BATCH_STATUS));
- hs_add_error(error_name, &error,
- grpc_metadata_batch_add_tail(
- op->payload->send_initial_metadata.send_initial_metadata,
- &calld->content_type,
- GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC,
- GRPC_BATCH_CONTENT_TYPE));
+ op->payload->send_initial_metadata.send_initial_metadata->Set(
+ grpc_core::HttpStatusMetadata(), 200);
+ op->payload->send_initial_metadata.send_initial_metadata->Set(
+ grpc_core::ContentTypeMetadata(),
+ grpc_core::ContentTypeMetadata::kApplicationGrpc);
hs_add_error(error_name, &error,
hs_filter_outgoing_metadata(
op->payload->send_initial_metadata.send_initial_metadata));
@@ -452,13 +248,6 @@ static grpc_error_handle hs_mutate_op(grpc_call_element* elem,
&calld->recv_initial_metadata_ready;
}
- if (op->recv_message) {
- calld->recv_message = op->payload->recv_message.recv_message;
- calld->original_recv_message_ready =
- op->payload->recv_message.recv_message_ready;
- op->payload->recv_message.recv_message_ready = &calld->recv_message_ready;
- }
-
if (op->recv_trailing_metadata) {
calld->original_recv_trailing_metadata_ready =
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
@@ -520,6 +309,7 @@ static void hs_destroy_channel_elem(grpc_channel_element* /*elem*/) {}
const grpc_channel_filter grpc_http_server_filter = {
hs_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(call_data),
hs_init_call_elem,
diff --git a/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
index 46af805f..72fb6619 100644
--- a/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
+++ b/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
@@ -18,10 +18,13 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
+
#include <string.h>
#include <string>
+#include "absl/strings/ascii.h"
#include "absl/strings/str_format.h"
#include <grpc/grpc_security.h>
@@ -34,28 +37,29 @@
#include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/channel/context.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
+#include "src/core/lib/promise/seq.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/uri/uri_parser.h"
-namespace grpc {
+namespace grpc_core {
constexpr char kEncodedIpv4AddressLengthString[] = "08";
constexpr char kEncodedIpv6AddressLengthString[] = "32";
constexpr char kEmptyAddressLengthString[] = "00";
-constexpr size_t kLengthPrefixSize = 2;
-grpc_error_handle ServerLoadReportingChannelData::Init(
- grpc_channel_element* /* elem */, grpc_channel_element_args* args) {
- GPR_ASSERT(!args->is_last);
+absl::StatusOr<ServerLoadReportingFilter> ServerLoadReportingFilter::Create(
+ ChannelArgs channel_args, ChannelFilter::Args) {
// Find and record the peer_identity.
- const grpc_auth_context* auth_context =
- grpc_find_auth_context_in_args(args->channel_args);
+ ServerLoadReportingFilter filter;
+ const auto* auth_context = channel_args.GetObject<grpc_auth_context>();
if (auth_context != nullptr &&
grpc_auth_context_peer_is_authenticated(auth_context)) {
grpc_auth_property_iterator auth_it =
@@ -63,79 +67,25 @@ grpc_error_handle ServerLoadReportingChannelData::Init(
const grpc_auth_property* auth_property =
grpc_auth_property_iterator_next(&auth_it);
if (auth_property != nullptr) {
- peer_identity_ = auth_property->value;
- peer_identity_len_ = auth_property->value_length;
+ filter.peer_identity_ =
+ std::string(auth_property->value, auth_property->value_length);
}
}
- return GRPC_ERROR_NONE;
-}
-
-void ServerLoadReportingCallData::Destroy(
- grpc_call_element* elem, const grpc_call_final_info* final_info,
- grpc_closure* /*then_call_closure*/) {
- ServerLoadReportingChannelData* chand =
- reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
- // Only record an end if we've recorded its corresponding start, which is
- // indicated by a non-null client_ip_and_lr_token_. Note that it's possible
- // that we attempt to record the call end before we have recorded the call
- // start, because the data needed for recording the start comes from the
- // initial metadata, which may not be ready before the call finishes.
- if (client_ip_and_lr_token_ != nullptr) {
- opencensus::stats::Record(
- {{::grpc::load_reporter::MeasureEndCount(), 1},
- {::grpc::load_reporter::MeasureEndBytesSent(),
- final_info->stats.transport_stream_stats.outgoing.data_bytes},
- {::grpc::load_reporter::MeasureEndBytesReceived(),
- final_info->stats.transport_stream_stats.incoming.data_bytes},
- {::grpc::load_reporter::MeasureEndLatencyMs(),
- gpr_time_to_millis(final_info->stats.latency)}},
- {{::grpc::load_reporter::TagKeyToken(),
- {client_ip_and_lr_token_, client_ip_and_lr_token_len_}},
- {::grpc::load_reporter::TagKeyHost(),
- {target_host_, target_host_len_}},
- {::grpc::load_reporter::TagKeyUserId(),
- {chand->peer_identity(), chand->peer_identity_len()}},
- {::grpc::load_reporter::TagKeyStatus(),
- GetStatusTagForStatus(final_info->final_status)}});
- gpr_free(client_ip_and_lr_token_);
- }
- gpr_free(target_host_);
- grpc_slice_unref_internal(service_method_);
+ return std::move(filter);
}
-void ServerLoadReportingCallData::StartTransportStreamOpBatch(
- grpc_call_element* elem, TransportStreamOpBatch* op) {
- GPR_TIMER_SCOPE("lr_start_transport_stream_op", 0);
- if (op->recv_initial_metadata() != nullptr) {
- // Save some fields to use when initial metadata is ready.
- peer_string_ = op->get_peer_string();
- recv_initial_metadata_ =
- op->op()->payload->recv_initial_metadata.recv_initial_metadata;
- original_recv_initial_metadata_ready_ = op->recv_initial_metadata_ready();
- // Substitute the original closure for the wrapper closure.
- op->set_recv_initial_metadata_ready(&recv_initial_metadata_ready_);
- } else if (op->send_trailing_metadata() != nullptr) {
- GRPC_LOG_IF_ERROR(
- "server_load_reporting_filter",
- grpc_metadata_batch_filter(op->send_trailing_metadata()->batch(),
- SendTrailingMetadataFilter, elem,
- "send_trailing_metadata filtering error"));
- }
- grpc_call_next_op(elem, op->op());
-}
-
-std::string ServerLoadReportingCallData::GetCensusSafeClientIpString() {
+namespace {
+std::string GetCensusSafeClientIpString(
+ const ClientMetadataHandle& initial_metadata) {
// Find the client URI string.
- const char* client_uri_str =
- reinterpret_cast<const char*>(gpr_atm_acq_load(peer_string_));
- if (client_uri_str == nullptr) {
+ auto client_uri_str = initial_metadata->get(PeerString());
+ if (!client_uri_str.has_value()) {
gpr_log(GPR_ERROR,
"Unable to extract client URI string (peer string) from gRPC "
"metadata.");
return "";
}
- absl::StatusOr<grpc_core::URI> client_uri =
- grpc_core::URI::Parse(client_uri_str);
+ absl::StatusOr<URI> client_uri = URI::Parse(*client_uri_str);
if (!client_uri.ok()) {
gpr_log(GPR_ERROR,
"Unable to parse the client URI string (peer string) to a client "
@@ -171,159 +121,119 @@ std::string ServerLoadReportingCallData::GetCensusSafeClientIpString() {
}
}
-void ServerLoadReportingCallData::StoreClientIpAndLrToken(const char* lr_token,
- size_t lr_token_len) {
- std::string client_ip = GetCensusSafeClientIpString();
- client_ip_and_lr_token_len_ =
- kLengthPrefixSize + client_ip.size() + lr_token_len;
- client_ip_and_lr_token_ = static_cast<char*>(
- gpr_zalloc(client_ip_and_lr_token_len_ * sizeof(char)));
- char* cur_pos = client_ip_and_lr_token_;
- // Store the IP length prefix.
- if (client_ip.empty()) {
- strncpy(cur_pos, kEmptyAddressLengthString, kLengthPrefixSize);
- } else if (client_ip.size() == 8) {
- strncpy(cur_pos, kEncodedIpv4AddressLengthString, kLengthPrefixSize);
- } else if (client_ip.size() == 32) {
- strncpy(cur_pos, kEncodedIpv6AddressLengthString, kLengthPrefixSize);
- } else {
- GPR_UNREACHABLE_CODE();
- }
- cur_pos += kLengthPrefixSize;
- // Store the IP.
- if (!client_ip.empty()) {
- strncpy(cur_pos, client_ip.c_str(), client_ip.size());
- }
- cur_pos += client_ip.size();
- // Store the LR token.
- if (lr_token_len != 0) {
- strncpy(cur_pos, lr_token, lr_token_len);
- }
- GPR_ASSERT(cur_pos + lr_token_len - client_ip_and_lr_token_ ==
- long(client_ip_and_lr_token_len_));
-}
-
-grpc_filtered_mdelem ServerLoadReportingCallData::RecvInitialMetadataFilter(
- void* user_data, grpc_mdelem md) {
- grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
- ServerLoadReportingCallData* calld =
- reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
- if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_PATH)) {
- calld->service_method_ = grpc_slice_ref_internal(GRPC_MDVALUE(md));
- } else if (calld->target_host_ == nullptr &&
- grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_AUTHORITY)) {
- grpc_slice target_host_slice = GRPC_MDVALUE(md);
- calld->target_host_len_ = GRPC_SLICE_LENGTH(target_host_slice);
- calld->target_host_ =
- reinterpret_cast<char*>(gpr_zalloc(calld->target_host_len_));
- for (size_t i = 0; i < calld->target_host_len_; ++i) {
- calld->target_host_[i] = static_cast<char>(
- tolower(GRPC_SLICE_START_PTR(target_host_slice)[i]));
- }
- } else if (grpc_slice_str_cmp(GRPC_MDKEY(md),
- grpc_core::kGrpcLbLbTokenMetadataKey) == 0) {
- if (calld->client_ip_and_lr_token_ == nullptr) {
- calld->StoreClientIpAndLrToken(
- reinterpret_cast<const char*> GRPC_SLICE_START_PTR(GRPC_MDVALUE(md)),
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(md)));
- }
- return GRPC_FILTERED_REMOVE();
- }
- return GRPC_FILTERED_MDELEM(md);
-}
-
-void ServerLoadReportingCallData::RecvInitialMetadataReady(
- void* arg, grpc_error_handle err) {
- grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(arg);
- ServerLoadReportingCallData* calld =
- reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
- ServerLoadReportingChannelData* chand =
- reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
- if (err == GRPC_ERROR_NONE) {
- GRPC_LOG_IF_ERROR(
- "server_load_reporting_filter",
- grpc_metadata_batch_filter(calld->recv_initial_metadata_,
- RecvInitialMetadataFilter, elem,
- "recv_initial_metadata filtering error"));
- // If the LB token was not found in the recv_initial_metadata, only the
- // client IP part will be recorded (with an empty LB token).
- if (calld->client_ip_and_lr_token_ == nullptr) {
- calld->StoreClientIpAndLrToken(nullptr, 0);
- }
- opencensus::stats::Record(
- {{::grpc::load_reporter::MeasureStartCount(), 1}},
- {{::grpc::load_reporter::TagKeyToken(),
- {calld->client_ip_and_lr_token_, calld->client_ip_and_lr_token_len_}},
- {::grpc::load_reporter::TagKeyHost(),
- {calld->target_host_, calld->target_host_len_}},
- {::grpc::load_reporter::TagKeyUserId(),
- {chand->peer_identity(), chand->peer_identity_len()}}});
- }
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->original_recv_initial_metadata_ready_,
- GRPC_ERROR_REF(err));
-}
-
-grpc_error_handle ServerLoadReportingCallData::Init(
- grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
- service_method_ = grpc_empty_slice();
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
- elem, grpc_schedule_on_exec_ctx);
- return GRPC_ERROR_NONE;
-}
-
-grpc_filtered_mdelem ServerLoadReportingCallData::SendTrailingMetadataFilter(
- void* user_data, grpc_mdelem md) {
- grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
- ServerLoadReportingCallData* calld =
- reinterpret_cast<ServerLoadReportingCallData*>(elem->call_data);
- ServerLoadReportingChannelData* chand =
- reinterpret_cast<ServerLoadReportingChannelData*>(elem->channel_data);
- if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_COST_BIN)) {
- const grpc_slice value = GRPC_MDVALUE(md);
- const size_t cost_entry_size = GRPC_SLICE_LENGTH(value);
- if (cost_entry_size < sizeof(double)) {
- gpr_log(GPR_ERROR,
- "Cost metadata value too small (%zu bytes) to hold valid data. "
- "Ignoring.",
- cost_entry_size);
- return GRPC_FILTERED_REMOVE();
- }
- const double* cost_entry_ptr =
- reinterpret_cast<const double*>(GRPC_SLICE_START_PTR(value));
- double cost_value = *cost_entry_ptr++;
- const char* cost_name = reinterpret_cast<const char*>(cost_entry_ptr);
- const size_t cost_name_len = cost_entry_size - sizeof(double);
- opencensus::stats::Record(
- {{::grpc::load_reporter::MeasureOtherCallMetric(), cost_value}},
- {{::grpc::load_reporter::TagKeyToken(),
- {calld->client_ip_and_lr_token_, calld->client_ip_and_lr_token_len_}},
- {::grpc::load_reporter::TagKeyHost(),
- {calld->target_host_, calld->target_host_len_}},
- {::grpc::load_reporter::TagKeyUserId(),
- {chand->peer_identity(), chand->peer_identity_len()}},
- {::grpc::load_reporter::TagKeyMetricName(),
- {cost_name, cost_name_len}}});
- return GRPC_FILTERED_REMOVE();
+std::string MakeClientIpAndLrToken(
+ absl::string_view lr_token, const ClientMetadataHandle& initial_metadata) {
+ std::string client_ip = GetCensusSafeClientIpString(initial_metadata);
+ absl::string_view prefix;
+ switch (client_ip.length()) {
+ case 0:
+ prefix = kEmptyAddressLengthString;
+ break;
+ case 8:
+ prefix = kEncodedIpv4AddressLengthString;
+ break;
+ case 32:
+ prefix = kEncodedIpv6AddressLengthString;
+ break;
+ default:
+ GPR_UNREACHABLE_CODE();
}
- return GRPC_FILTERED_MDELEM(md);
+ return absl::StrCat(prefix, client_ip, lr_token);
}
-const char* ServerLoadReportingCallData::GetStatusTagForStatus(
- grpc_status_code status) {
+const char* GetStatusTagForStatus(grpc_status_code status) {
switch (status) {
case GRPC_STATUS_OK:
- return ::grpc::load_reporter::kCallStatusOk;
+ return grpc::load_reporter::kCallStatusOk;
case GRPC_STATUS_UNKNOWN:
case GRPC_STATUS_DEADLINE_EXCEEDED:
case GRPC_STATUS_UNIMPLEMENTED:
case GRPC_STATUS_INTERNAL:
case GRPC_STATUS_UNAVAILABLE:
case GRPC_STATUS_DATA_LOSS:
- return ::grpc::load_reporter::kCallStatusServerError;
+ return grpc::load_reporter::kCallStatusServerError;
default:
- return ::grpc::load_reporter::kCallStatusClientError;
+ return grpc::load_reporter::kCallStatusClientError;
+ }
+}
+} // namespace
+
+ArenaPromise<ServerMetadataHandle> ServerLoadReportingFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ // Gather up basic facts about the request
+ Slice service_method;
+ if (const Slice* path =
+ call_args.client_initial_metadata->get_pointer(HttpPathMetadata())) {
+ service_method = path->Ref();
}
+ std::string target_host;
+ if (const Slice* authority = call_args.client_initial_metadata->get_pointer(
+ HttpAuthorityMetadata())) {
+ target_host = absl::AsciiStrToLower(authority->as_string_view());
+ }
+ std::string client_ip_and_lr_token;
+ auto lb_token = call_args.client_initial_metadata->Take(LbTokenMetadata())
+ .value_or(Slice());
+ client_ip_and_lr_token = MakeClientIpAndLrToken(
+ lb_token.as_string_view(), call_args.client_initial_metadata);
+ // Record the beginning of the request
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureStartCount(), 1}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {client_ip_and_lr_token.data(), client_ip_and_lr_token.length()}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {target_host.data(), target_host.length()}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {peer_identity_.data(), peer_identity_.length()}}});
+ // Returned promise runs the rest of the request, then reports costs and
+ // records measurements
+ return ArenaPromise<ServerMetadataHandle>(Seq(
+ // Call down the stack
+ next_promise_factory(std::move(call_args)),
+ // And then record the call result
+ [this, client_ip_and_lr_token,
+ target_host](ServerMetadataHandle trailing_metadata) {
+ const auto& costs = trailing_metadata->Take(LbCostBinMetadata());
+ for (const auto& cost : costs) {
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureOtherCallMetric(), cost.cost}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {client_ip_and_lr_token.data(),
+ client_ip_and_lr_token.length()}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {target_host.data(), target_host.length()}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {peer_identity_.data(), peer_identity_.length()}},
+ {::grpc::load_reporter::TagKeyMetricName(),
+ {cost.name.data(), cost.name.length()}}});
+ }
+ GetContext<CallFinalization>()->Add([this, client_ip_and_lr_token,
+ target_host](
+ const grpc_call_final_info*
+ final_info) {
+ if (final_info == nullptr) return;
+ // After the last bytes have been placed on the wire we record
+ // final measurements
+ opencensus::stats::Record(
+ {{::grpc::load_reporter::MeasureEndCount(), 1},
+ {::grpc::load_reporter::MeasureEndBytesSent(),
+ final_info->stats.transport_stream_stats.outgoing.data_bytes},
+ {::grpc::load_reporter::MeasureEndBytesReceived(),
+ final_info->stats.transport_stream_stats.incoming.data_bytes},
+ {::grpc::load_reporter::MeasureEndLatencyMs(),
+ gpr_time_to_millis(final_info->stats.latency)}},
+ {{::grpc::load_reporter::TagKeyToken(),
+ {client_ip_and_lr_token.data(),
+ client_ip_and_lr_token.length()}},
+ {::grpc::load_reporter::TagKeyHost(),
+ {target_host.data(), target_host.length()}},
+ {::grpc::load_reporter::TagKeyUserId(),
+ {peer_identity_.data(), peer_identity_.length()}},
+ {::grpc::load_reporter::TagKeyStatus(),
+ GetStatusTagForStatus(final_info->final_status)}});
+ });
+ return Immediate(std::move(trailing_metadata));
+ }));
}
namespace {
@@ -331,6 +241,10 @@ bool MaybeAddServerLoadReportingFilter(const grpc_channel_args& args) {
return grpc_channel_arg_get_bool(
grpc_channel_args_find(&args, GRPC_ARG_ENABLE_LOAD_REPORTING), false);
}
+
+const grpc_channel_filter kFilter =
+ MakePromiseBasedFilter<ServerLoadReportingFilter, FilterEndpoint::kServer>(
+ "server_load_reporting");
} // namespace
// TODO(juanlishen): We should register the filter during grpc initialization
@@ -339,22 +253,25 @@ bool MaybeAddServerLoadReportingFilter(const grpc_channel_args& args) {
// time if we build with the filter target.
struct ServerLoadReportingFilterStaticRegistrar {
ServerLoadReportingFilterStaticRegistrar() {
- static grpc_core::Atomic<bool> registered{false};
- if (registered.Load(grpc_core::MemoryOrder::ACQUIRE)) return;
- RegisterChannelFilter<ServerLoadReportingChannelData,
- ServerLoadReportingCallData>(
- "server_load_reporting", GRPC_SERVER_CHANNEL, INT_MAX,
- MaybeAddServerLoadReportingFilter);
- // Access measures to ensure they are initialized. Otherwise, we can't
- // create any valid view before the first RPC.
- ::grpc::load_reporter::MeasureStartCount();
- ::grpc::load_reporter::MeasureEndCount();
- ::grpc::load_reporter::MeasureEndBytesSent();
- ::grpc::load_reporter::MeasureEndBytesReceived();
- ::grpc::load_reporter::MeasureEndLatencyMs();
- ::grpc::load_reporter::MeasureOtherCallMetric();
- registered.Store(true, grpc_core::MemoryOrder::RELEASE);
+ CoreConfiguration::RegisterBuilder([](CoreConfiguration::Builder* builder) {
+ // Access measures to ensure they are initialized. Otherwise, we can't
+ // create any valid view before the first RPC.
+ grpc::load_reporter::MeasureStartCount();
+ grpc::load_reporter::MeasureEndCount();
+ grpc::load_reporter::MeasureEndBytesSent();
+ grpc::load_reporter::MeasureEndBytesReceived();
+ grpc::load_reporter::MeasureEndLatencyMs();
+ grpc::load_reporter::MeasureOtherCallMetric();
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX, [](ChannelStackBuilder* cs_builder) {
+ if (MaybeAddServerLoadReportingFilter(
+ *cs_builder->channel_args())) {
+ cs_builder->PrependFilter(&kFilter, nullptr);
+ }
+ return true;
+ });
+ });
}
} server_load_reporting_filter_static_registrar;
-} // namespace grpc
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
index 47390fa0..92fd152e 100644
--- a/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
+++ b/grpc/src/core/ext/filters/load_reporting/server_load_reporting_filter.h
@@ -24,98 +24,28 @@
#include <string>
#include "src/core/lib/channel/channel_stack.h"
-#include "src/cpp/common/channel_filter.h"
+#include "src/core/lib/channel/promise_based_filter.h"
-namespace grpc {
+namespace grpc_core {
-class ServerLoadReportingChannelData : public ChannelData {
+class ServerLoadReportingFilter : public ChannelFilter {
public:
- grpc_error_handle Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) override;
+ static absl::StatusOr<ServerLoadReportingFilter> Create(ChannelArgs args,
+ ChannelFilter::Args);
// Getters.
- const char* peer_identity() { return peer_identity_; }
- size_t peer_identity_len() { return peer_identity_len_; }
+ const char* peer_identity() { return peer_identity_.c_str(); }
+ size_t peer_identity_len() { return peer_identity_.length(); }
- private:
- // The peer's authenticated identity.
- char* peer_identity_ = nullptr;
- size_t peer_identity_len_ = 0;
-};
-
-class ServerLoadReportingCallData : public CallData {
- public:
- grpc_error_handle Init(grpc_call_element* elem,
- const grpc_call_element_args* args) override;
-
- void Destroy(grpc_call_element* elem, const grpc_call_final_info* final_info,
- grpc_closure* then_call_closure) override;
-
- void StartTransportStreamOpBatch(grpc_call_element* elem,
- TransportStreamOpBatch* op) override;
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
private:
- // From the peer_string_ in calld, extracts the client IP string (owned by
- // caller), e.g., "01020a0b". Upon failure, returns empty string.
- std::string GetCensusSafeClientIpString();
-
- // Concatenates the client IP address and the load reporting token, then
- // stores the result into the call data.
- void StoreClientIpAndLrToken(const char* lr_token, size_t lr_token_len);
-
- // This matches the classification of the status codes in
- // googleapis/google/rpc/code.proto.
- static const char* GetStatusTagForStatus(grpc_status_code status);
-
- // Records the call start.
- static void RecvInitialMetadataReady(void* arg, grpc_error_handle err);
-
- // From the initial metadata, extracts the service_method_, target_host_, and
- // client_ip_and_lr_token_.
- static grpc_filtered_mdelem RecvInitialMetadataFilter(void* user_data,
- grpc_mdelem md);
-
- // Records the other call metrics.
- static grpc_filtered_mdelem SendTrailingMetadataFilter(void* user_data,
- grpc_mdelem md);
-
- // The peer string (a member of the recv_initial_metadata op). Note that
- // gpr_atm itself is a pointer type here, making "peer_string_" effectively a
- // double pointer.
- const gpr_atm* peer_string_;
-
- // The received initial metadata (a member of the recv_initial_metadata op).
- // When it is ready, we will extract some data from it via
- // recv_initial_metadata_ready_ closure, before the original
- // recv_initial_metadata_ready closure.
- grpc_metadata_batch* recv_initial_metadata_;
-
- // The original recv_initial_metadata closure, which is wrapped by our own
- // closure (recv_initial_metadata_ready_) to capture the incoming initial
- // metadata.
- grpc_closure* original_recv_initial_metadata_ready_;
-
- // The closure that wraps the original closure. Scheduled when
- // recv_initial_metadata_ is ready.
- grpc_closure recv_initial_metadata_ready_;
-
- // Corresponds to the :path header.
- grpc_slice service_method_;
-
- // The backend host that the client thinks it's talking to. This may be
- // different from the actual backend in the case of, for example,
- // load-balanced targets. We store a copy of the metadata slice in order to
- // lowercase it. */
- char* target_host_;
- size_t target_host_len_;
-
- // The client IP address (including a length prefix) and the load reporting
- // token.
- char* client_ip_and_lr_token_;
- size_t client_ip_and_lr_token_len_;
+ // The peer's authenticated identity.
+ std::string peer_identity_;
};
-} // namespace grpc
+} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H \
- */
+#endif // GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H
diff --git a/grpc/src/core/ext/filters/max_age/max_age_filter.cc b/grpc/src/core/ext/filters/max_age/max_age_filter.cc
deleted file mode 100644
index 97a4dc28..00000000
--- a/grpc/src/core/ext/filters/max_age/max_age_filter.cc
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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/max_age/max_age_filter.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/http2_errors.h"
-
-/* If these settings change, make sure that we are not sending a GOAWAY for
- * inproc transport, since a GOAWAY to inproc ends up destroying the transport.
- */
-#define DEFAULT_MAX_CONNECTION_AGE_MS INT_MAX
-#define DEFAULT_MAX_CONNECTION_AGE_GRACE_MS INT_MAX
-#define DEFAULT_MAX_CONNECTION_IDLE_MS INT_MAX
-#define MAX_CONNECTION_AGE_JITTER 0.1
-
-#define MAX_CONNECTION_AGE_INTEGER_OPTIONS \
- { DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX }
-#define MAX_CONNECTION_IDLE_INTEGER_OPTIONS \
- { DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX }
-
-/* States for idle_state in channel_data */
-#define MAX_IDLE_STATE_INIT ((gpr_atm)0)
-#define MAX_IDLE_STATE_SEEN_EXIT_IDLE ((gpr_atm)1)
-#define MAX_IDLE_STATE_SEEN_ENTER_IDLE ((gpr_atm)2)
-#define MAX_IDLE_STATE_TIMER_SET ((gpr_atm)3)
-
-namespace {
-struct channel_data {
- /* The channel stack to which we take refs for pending callbacks. */
- grpc_channel_stack* channel_stack;
- /* Guards access to max_age_timer, max_age_timer_pending, max_age_grace_timer
- and max_age_grace_timer_pending */
- grpc_core::Mutex max_age_timer_mu;
- /* True if the max_age timer callback is currently pending */
- bool max_age_timer_pending ABSL_GUARDED_BY(max_age_timer_mu) = false;
- /* True if the max_age_grace timer callback is currently pending */
- bool max_age_grace_timer_pending ABSL_GUARDED_BY(max_age_timer_mu) = false;
- /* The timer for checking if the channel has reached its max age */
- grpc_timer max_age_timer ABSL_GUARDED_BY(max_age_timer_mu);
- /* The timer for checking if the max-aged channel has uesed up the grace
- period */
- grpc_timer max_age_grace_timer ABSL_GUARDED_BY(max_age_timer_mu);
- /* The timer for checking if the channel's idle duration reaches
- max_connection_idle */
- grpc_timer max_idle_timer;
- /* Allowed max time a channel may have no outstanding rpcs */
- grpc_millis max_connection_idle;
- /* Allowed max time a channel may exist */
- grpc_millis max_connection_age;
- /* Allowed grace period after the channel reaches its max age */
- grpc_millis max_connection_age_grace;
- /* Closure to run when the channel's idle duration reaches max_connection_idle
- and should be closed gracefully */
- grpc_closure max_idle_timer_cb;
- /* Closure to run when the channel reaches its max age and should be closed
- gracefully */
- grpc_closure close_max_age_channel;
- /* Closure to run the channel uses up its max age grace time and should be
- closed forcibly */
- grpc_closure force_close_max_age_channel;
- /* Closure to run when the init fo channel stack is done and the max_idle
- timer should be started */
- grpc_closure start_max_idle_timer_after_init;
- /* Closure to run when the init fo channel stack is done and the max_age timer
- should be started */
- grpc_closure start_max_age_timer_after_init;
- /* Closure to run when the goaway op is finished and the max_age_timer */
- grpc_closure start_max_age_grace_timer_after_goaway_op;
- /* Number of active calls */
- gpr_atm call_count;
- /* TODO(zyc): C++lize this state machine */
- /* 'idle_state' holds the states of max_idle_timer and channel idleness.
- It can contain one of the following values:
- +--------------------------------+----------------+---------+
- | idle_state | max_idle_timer | channel |
- +--------------------------------+----------------+---------+
- | MAX_IDLE_STATE_INIT | unset | busy |
- | MAX_IDLE_STATE_TIMER_SET | set, valid | idle |
- | MAX_IDLE_STATE_SEEN_EXIT_IDLE | set, invalid | busy |
- | MAX_IDLE_STATE_SEEN_ENTER_IDLE | set, invalid | idle |
- +--------------------------------+----------------+---------+
-
- MAX_IDLE_STATE_INIT: The initial and final state of 'idle_state'. The
- channel has 1 or 1+ active calls, and the timer is not set. Note that
- we may put a virtual call to hold this state at channel initialization or
- shutdown, so that the channel won't enter other states.
-
- MAX_IDLE_STATE_TIMER_SET: The state after the timer is set and no calls
- have arrived after the timer is set. The channel must have 0 active call in
- this state. If the timer is fired in this state, we will close the channel
- due to idleness.
-
- MAX_IDLE_STATE_SEEN_EXIT_IDLE: The state after the timer is set and at
- least one call has arrived after the timer is set. The channel must have 1
- or 1+ active calls in this state. If the timer is fired in this state, we
- won't reschudle it.
-
- MAX_IDLE_STATE_SEEN_ENTER_IDLE: The state after the timer is set and the at
- least one call has arrived after the timer is set, BUT the channel
- currently has 0 active calls. If the timer is fired in this state, we will
- reschudle it.
-
- max_idle_timer will not be cancelled (unless the channel is shutting down).
- If the timer callback is called when the max_idle_timer is valid (i.e.
- idle_state is MAX_IDLE_STATE_TIMER_SET), the channel will be closed due to
- idleness, otherwise the channel won't be changed.
-
- State transitions:
- MAX_IDLE_STATE_INIT <-------3------ MAX_IDLE_STATE_SEEN_EXIT_IDLE
- ^ | ^ ^ |
- | | | | |
- 1 2 +-----------4------------+ 6 7
- | | | | |
- | v | | v
- MAX_IDLE_STATE_TIMER_SET <----5------ MAX_IDLE_STATE_SEEN_ENTER_IDLE
-
- For 1, 3, 5 : See max_idle_timer_cb() function
- For 2, 7 : See decrease_call_count() function
- For 4, 6 : See increase_call_count() function */
- gpr_atm idle_state;
- /* Time when the channel finished its last outstanding call, in grpc_millis */
- gpr_atm last_enter_idle_time_millis;
-};
-} // namespace
-
-/* Increase the nubmer of active calls. Before the increasement, if there are no
- calls, the max_idle_timer should be cancelled. */
-static void increase_call_count(channel_data* chand) {
- /* Exit idle */
- if (gpr_atm_full_fetch_add(&chand->call_count, 1) == 0) {
- while (true) {
- gpr_atm idle_state = gpr_atm_acq_load(&chand->idle_state);
- switch (idle_state) {
- case MAX_IDLE_STATE_TIMER_SET:
- /* max_idle_timer_cb may have already set idle_state to
- MAX_IDLE_STATE_INIT, in this case, we don't need to set it to
- MAX_IDLE_STATE_SEEN_EXIT_IDLE */
- gpr_atm_rel_cas(&chand->idle_state, MAX_IDLE_STATE_TIMER_SET,
- MAX_IDLE_STATE_SEEN_EXIT_IDLE);
- return;
- case MAX_IDLE_STATE_SEEN_ENTER_IDLE:
- gpr_atm_rel_store(&chand->idle_state, MAX_IDLE_STATE_SEEN_EXIT_IDLE);
- return;
- default:
- /* try again */
- break;
- }
- }
- }
-}
-
-/* Decrease the nubmer of active calls. After the decrement, if there are no
- calls, the max_idle_timer should be started. */
-static void decrease_call_count(channel_data* chand) {
- /* Enter idle */
- if (gpr_atm_full_fetch_add(&chand->call_count, -1) == 1) {
- gpr_atm_no_barrier_store(&chand->last_enter_idle_time_millis,
- (gpr_atm)grpc_core::ExecCtx::Get()->Now());
- while (true) {
- gpr_atm idle_state = gpr_atm_acq_load(&chand->idle_state);
- switch (idle_state) {
- case MAX_IDLE_STATE_INIT:
- GRPC_CHANNEL_STACK_REF(chand->channel_stack,
- "max_age max_idle_timer");
- grpc_timer_init(
- &chand->max_idle_timer,
- grpc_core::ExecCtx::Get()->Now() + chand->max_connection_idle,
- &chand->max_idle_timer_cb);
- gpr_atm_rel_store(&chand->idle_state, MAX_IDLE_STATE_TIMER_SET);
- return;
- case MAX_IDLE_STATE_SEEN_EXIT_IDLE:
- if (gpr_atm_rel_cas(&chand->idle_state, MAX_IDLE_STATE_SEEN_EXIT_IDLE,
- MAX_IDLE_STATE_SEEN_ENTER_IDLE)) {
- return;
- }
- break;
- default:
- /* try again */
- break;
- }
- }
- }
-}
-
-static void start_max_idle_timer_after_init(void* arg,
- grpc_error_handle /*error*/) {
- channel_data* chand = static_cast<channel_data*>(arg);
- /* Decrease call_count. If there are no active calls at this time,
- max_idle_timer will start here. If the number of active calls is not 0,
- max_idle_timer will start after all the active calls end. */
- decrease_call_count(chand);
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack,
- "max_age start_max_idle_timer_after_init");
-}
-
-namespace grpc_core {
-
-class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface {
- public:
- explicit ConnectivityWatcher(channel_data* chand) : chand_(chand) {
- GRPC_CHANNEL_STACK_REF(chand_->channel_stack, "max_age conn_watch");
- }
-
- ~ConnectivityWatcher() override {
- GRPC_CHANNEL_STACK_UNREF(chand_->channel_stack, "max_age conn_watch");
- }
-
- private:
- void OnConnectivityStateChange(grpc_connectivity_state new_state,
- const absl::Status& /* status */) override {
- if (new_state != GRPC_CHANNEL_SHUTDOWN) return;
- {
- MutexLock lock(&chand_->max_age_timer_mu);
- if (chand_->max_age_timer_pending) {
- grpc_timer_cancel(&chand_->max_age_timer);
- chand_->max_age_timer_pending = false;
- }
- if (chand_->max_age_grace_timer_pending) {
- grpc_timer_cancel(&chand_->max_age_grace_timer);
- chand_->max_age_grace_timer_pending = false;
- }
- }
- /* If there are no active calls, this increasement will cancel
- max_idle_timer, and prevent max_idle_timer from being started in the
- future. */
- increase_call_count(chand_);
- if (gpr_atm_acq_load(&chand_->idle_state) ==
- MAX_IDLE_STATE_SEEN_EXIT_IDLE) {
- grpc_timer_cancel(&chand_->max_idle_timer);
- }
- }
-
- channel_data* chand_;
-};
-
-} // namespace grpc_core
-
-static void start_max_age_timer_after_init(void* arg,
- grpc_error_handle /*error*/) {
- channel_data* chand = static_cast<channel_data*>(arg);
- {
- grpc_core::MutexLock lock(&chand->max_age_timer_mu);
- chand->max_age_timer_pending = true;
- GRPC_CHANNEL_STACK_REF(chand->channel_stack, "max_age max_age_timer");
- grpc_timer_init(
- &chand->max_age_timer,
- grpc_core::ExecCtx::Get()->Now() + chand->max_connection_age,
- &chand->close_max_age_channel);
- }
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- op->start_connectivity_watch.reset(new grpc_core::ConnectivityWatcher(chand));
- op->start_connectivity_watch_state = GRPC_CHANNEL_IDLE;
- grpc_channel_next_op(grpc_channel_stack_element(chand->channel_stack, 0), op);
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack,
- "max_age start_max_age_timer_after_init");
-}
-
-static void start_max_age_grace_timer_after_goaway_op(
- void* arg, grpc_error_handle /*error*/) {
- channel_data* chand = static_cast<channel_data*>(arg);
- {
- grpc_core::MutexLock lock(&chand->max_age_timer_mu);
- chand->max_age_grace_timer_pending = true;
- GRPC_CHANNEL_STACK_REF(chand->channel_stack, "max_age max_age_grace_timer");
- grpc_timer_init(&chand->max_age_grace_timer,
- chand->max_connection_age_grace == GRPC_MILLIS_INF_FUTURE
- ? GRPC_MILLIS_INF_FUTURE
- : grpc_core::ExecCtx::Get()->Now() +
- chand->max_connection_age_grace,
- &chand->force_close_max_age_channel);
- }
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack,
- "max_age start_max_age_grace_timer_after_goaway_op");
-}
-
-static void close_max_idle_channel(channel_data* chand) {
- /* Prevent the max idle timer from being set again */
- gpr_atm_no_barrier_fetch_add(&chand->call_count, 1);
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- op->goaway_error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("max_idle"),
- GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_NO_ERROR);
- grpc_channel_element* elem =
- grpc_channel_stack_element(chand->channel_stack, 0);
- elem->filter->start_transport_op(elem, op);
-}
-
-static void max_idle_timer_cb(void* arg, grpc_error_handle error) {
- channel_data* chand = static_cast<channel_data*>(arg);
- if (error == GRPC_ERROR_NONE) {
- bool try_again = true;
- while (try_again) {
- gpr_atm idle_state = gpr_atm_acq_load(&chand->idle_state);
- switch (idle_state) {
- case MAX_IDLE_STATE_TIMER_SET:
- close_max_idle_channel(chand);
- /* This MAX_IDLE_STATE_INIT is a final state, we don't have to check
- * if idle_state has been changed */
- gpr_atm_rel_store(&chand->idle_state, MAX_IDLE_STATE_INIT);
- try_again = false;
- break;
- case MAX_IDLE_STATE_SEEN_EXIT_IDLE:
- if (gpr_atm_rel_cas(&chand->idle_state, MAX_IDLE_STATE_SEEN_EXIT_IDLE,
- MAX_IDLE_STATE_INIT)) {
- try_again = false;
- }
- break;
- case MAX_IDLE_STATE_SEEN_ENTER_IDLE:
- GRPC_CHANNEL_STACK_REF(chand->channel_stack,
- "max_age max_idle_timer");
- grpc_timer_init(&chand->max_idle_timer,
- static_cast<grpc_millis>(gpr_atm_no_barrier_load(
- &chand->last_enter_idle_time_millis)) +
- chand->max_connection_idle,
- &chand->max_idle_timer_cb);
- /* idle_state may have already been set to
- MAX_IDLE_STATE_SEEN_EXIT_IDLE by increase_call_count(), in this
- case, we don't need to set it to MAX_IDLE_STATE_TIMER_SET */
- gpr_atm_rel_cas(&chand->idle_state, MAX_IDLE_STATE_SEEN_ENTER_IDLE,
- MAX_IDLE_STATE_TIMER_SET);
- try_again = false;
- break;
- default:
- /* try again */
- break;
- }
- }
- }
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack, "max_age max_idle_timer");
-}
-
-static void close_max_age_channel(void* arg, grpc_error_handle error) {
- channel_data* chand = static_cast<channel_data*>(arg);
- {
- grpc_core::MutexLock lock(&chand->max_age_timer_mu);
- chand->max_age_timer_pending = false;
- }
- if (error == GRPC_ERROR_NONE) {
- GRPC_CHANNEL_STACK_REF(chand->channel_stack,
- "max_age start_max_age_grace_timer_after_goaway_op");
- grpc_transport_op* op = grpc_make_transport_op(
- &chand->start_max_age_grace_timer_after_goaway_op);
- op->goaway_error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("max_age"),
- GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_NO_ERROR);
- grpc_channel_element* elem =
- grpc_channel_stack_element(chand->channel_stack, 0);
- elem->filter->start_transport_op(elem, op);
- } else if (error != GRPC_ERROR_CANCELLED) {
- GRPC_LOG_IF_ERROR("close_max_age_channel", error);
- }
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack, "max_age max_age_timer");
-}
-
-static void force_close_max_age_channel(void* arg, grpc_error_handle error) {
- channel_data* chand = static_cast<channel_data*>(arg);
- {
- grpc_core::MutexLock lock(&chand->max_age_timer_mu);
- chand->max_age_grace_timer_pending = false;
- }
- if (error == GRPC_ERROR_NONE) {
- grpc_transport_op* op = grpc_make_transport_op(nullptr);
- op->disconnect_with_error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel reaches max age");
- grpc_channel_element* elem =
- grpc_channel_stack_element(chand->channel_stack, 0);
- elem->filter->start_transport_op(elem, op);
- } else if (error != GRPC_ERROR_CANCELLED) {
- GRPC_LOG_IF_ERROR("force_close_max_age_channel", error);
- }
- GRPC_CHANNEL_STACK_UNREF(chand->channel_stack, "max_age max_age_grace_timer");
-}
-
-/* A random jitter of +/-10% will be added to MAX_CONNECTION_AGE to spread out
- connection storms. Note that the MAX_CONNECTION_AGE option without jitter
- would not create connection storms by itself, but if there happened to be a
- connection storm it could cause it to repeat at a fixed period. */
-static grpc_millis
-add_random_max_connection_age_jitter_and_convert_to_grpc_millis(int value) {
- /* generate a random number between 1 - MAX_CONNECTION_AGE_JITTER and
- 1 + MAX_CONNECTION_AGE_JITTER */
- double multiplier = rand() * MAX_CONNECTION_AGE_JITTER * 2.0 / RAND_MAX +
- 1.0 - MAX_CONNECTION_AGE_JITTER;
- double result = multiplier * value;
- /* INT_MAX - 0.5 converts the value to float, so that result will not be
- cast to int implicitly before the comparison. */
- return result > (static_cast<double>(GRPC_MILLIS_INF_FUTURE)) - 0.5
- ? GRPC_MILLIS_INF_FUTURE
- : static_cast<grpc_millis>(result);
-}
-
-/* Constructor for call_data. */
-static grpc_error_handle max_age_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- increase_call_count(chand);
- return GRPC_ERROR_NONE;
-}
-
-/* Destructor for call_data. */
-static void max_age_destroy_call_elem(
- grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- decrease_call_count(chand);
-}
-
-/* Constructor for channel_data. */
-static grpc_error_handle max_age_init_channel_elem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- new (chand) channel_data();
- chand->channel_stack = args->channel_stack;
- chand->max_connection_age =
- add_random_max_connection_age_jitter_and_convert_to_grpc_millis(
- DEFAULT_MAX_CONNECTION_AGE_MS);
- chand->max_connection_age_grace =
- DEFAULT_MAX_CONNECTION_AGE_GRACE_MS == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : DEFAULT_MAX_CONNECTION_AGE_GRACE_MS;
- chand->max_connection_idle = DEFAULT_MAX_CONNECTION_IDLE_MS == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : DEFAULT_MAX_CONNECTION_IDLE_MS;
- chand->idle_state = MAX_IDLE_STATE_INIT;
- gpr_atm_no_barrier_store(&chand->last_enter_idle_time_millis, GPR_ATM_MIN);
- for (size_t i = 0; i < args->channel_args->num_args; ++i) {
- if (0 == strcmp(args->channel_args->args[i].key,
- GRPC_ARG_MAX_CONNECTION_AGE_MS)) {
- const int value = grpc_channel_arg_get_integer(
- &args->channel_args->args[i], MAX_CONNECTION_AGE_INTEGER_OPTIONS);
- chand->max_connection_age =
- add_random_max_connection_age_jitter_and_convert_to_grpc_millis(
- value);
- } else if (0 == strcmp(args->channel_args->args[i].key,
- GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS)) {
- const int value = grpc_channel_arg_get_integer(
- &args->channel_args->args[i],
- {DEFAULT_MAX_CONNECTION_AGE_GRACE_MS, 0, INT_MAX});
- chand->max_connection_age_grace =
- value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
- } else if (0 == strcmp(args->channel_args->args[i].key,
- GRPC_ARG_MAX_CONNECTION_IDLE_MS)) {
- const int value = grpc_channel_arg_get_integer(
- &args->channel_args->args[i], MAX_CONNECTION_IDLE_INTEGER_OPTIONS);
- chand->max_connection_idle =
- value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
- }
- }
- GRPC_CLOSURE_INIT(&chand->max_idle_timer_cb, max_idle_timer_cb, chand,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&chand->close_max_age_channel, close_max_age_channel, chand,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&chand->force_close_max_age_channel,
- force_close_max_age_channel, chand,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&chand->start_max_idle_timer_after_init,
- start_max_idle_timer_after_init, chand,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&chand->start_max_age_timer_after_init,
- start_max_age_timer_after_init, chand,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&chand->start_max_age_grace_timer_after_goaway_op,
- start_max_age_grace_timer_after_goaway_op, chand,
- grpc_schedule_on_exec_ctx);
-
- if (chand->max_connection_age != GRPC_MILLIS_INF_FUTURE) {
- /* When the channel reaches its max age, we send down an op with
- goaway_error set. However, we can't send down any ops until after the
- channel stack is fully initialized. If we start the timer here, we have
- no guarantee that the timer won't pop before channel stack initialization
- is finished. To avoid that problem, we create a closure to start the
- timer, and we schedule that closure to be run after call stack
- initialization is done. */
- GRPC_CHANNEL_STACK_REF(chand->channel_stack,
- "max_age start_max_age_timer_after_init");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION,
- &chand->start_max_age_timer_after_init,
- GRPC_ERROR_NONE);
- }
-
- /* Initialize the number of calls as 1, so that the max_idle_timer will not
- start until start_max_idle_timer_after_init is invoked. */
- gpr_atm_rel_store(&chand->call_count, 1);
- if (chand->max_connection_idle != GRPC_MILLIS_INF_FUTURE) {
- GRPC_CHANNEL_STACK_REF(chand->channel_stack,
- "max_age start_max_idle_timer_after_init");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION,
- &chand->start_max_idle_timer_after_init,
- GRPC_ERROR_NONE);
- }
- return GRPC_ERROR_NONE;
-}
-
-/* Destructor for channel_data. */
-static void max_age_destroy_channel_elem(grpc_channel_element* elem) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- chand->~channel_data();
-}
-
-const grpc_channel_filter grpc_max_age_filter = {
- grpc_call_next_op,
- grpc_channel_next_op,
- 0, /* sizeof_call_data */
- max_age_init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- max_age_destroy_call_elem,
- sizeof(channel_data),
- max_age_init_channel_elem,
- max_age_destroy_channel_elem,
- grpc_channel_next_get_info,
- "max_age"};
-
-static bool maybe_add_max_age_filter(grpc_channel_stack_builder* builder,
- void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- bool enable =
- grpc_channel_arg_get_integer(
- grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS),
- MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX ||
- grpc_channel_arg_get_integer(
- grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS),
- MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX;
- if (enable) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_max_age_filter, nullptr, nullptr);
- } else {
- return true;
- }
-}
-
-void grpc_max_age_filter_init(void) {
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_max_age_filter, nullptr);
-}
-
-void grpc_max_age_filter_shutdown(void) {}
diff --git a/grpc/src/core/ext/filters/max_age/max_age_filter.h b/grpc/src/core/ext/filters/max_age/max_age_filter.h
deleted file mode 100644
index 98932224..00000000
--- a/grpc/src/core/ext/filters/max_age/max_age_filter.h
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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_MAX_AGE_MAX_AGE_FILTER_H
-#define GRPC_CORE_EXT_FILTERS_MAX_AGE_MAX_AGE_FILTER_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/channel/channel_stack.h"
-
-extern const grpc_channel_filter grpc_max_age_filter;
-
-#endif /* GRPC_CORE_EXT_FILTERS_MAX_AGE_MAX_AGE_FILTER_H */
diff --git a/grpc/src/core/ext/filters/message_size/message_size_filter.cc b/grpc/src/core/ext/filters/message_size/message_size_filter.cc
index 3c921e28..7be43729 100644
--- a/grpc/src/core/ext/filters/message_size/message_size_filter.cc
+++ b/grpc/src/core/ext/filters/message_size/message_size_filter.cc
@@ -27,15 +27,15 @@
#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/message_size/message_size_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
static void recv_message_ready(void* user_data, grpc_error_handle error);
static void recv_trailing_metadata_ready(void* user_data,
@@ -43,23 +43,19 @@ static void recv_trailing_metadata_ready(void* user_data,
namespace grpc_core {
-namespace {
-size_t g_message_size_parser_index;
-} // namespace
-
//
// MessageSizeParsedConfig
//
const MessageSizeParsedConfig* MessageSizeParsedConfig::GetFromCallContext(
- const grpc_call_context_element* context) {
+ const grpc_call_context_element* context,
+ size_t service_config_parser_index) {
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()));
+ svc_cfg_call_data->GetMethodParsedConfig(service_config_parser_index));
}
//
@@ -114,12 +110,15 @@ MessageSizeParser::ParsePerMethodParams(const grpc_channel_args* /*args*/,
max_response_message_bytes);
}
-void MessageSizeParser::Register() {
- g_message_size_parser_index = ServiceConfigParser::RegisterParser(
+void MessageSizeParser::Register(CoreConfiguration::Builder* builder) {
+ builder->service_config_parser()->RegisterParser(
absl::make_unique<MessageSizeParser>());
}
-size_t MessageSizeParser::ParserIndex() { return g_message_size_parser_index; }
+size_t MessageSizeParser::ParserIndex() {
+ return CoreConfiguration::Get().service_config_parser().GetParserIndex(
+ parser_name());
+}
int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args) {
if (grpc_channel_args_want_minimal_stack(args)) return -1;
@@ -140,6 +139,8 @@ int GetMaxSendSizeFromChannelArgs(const grpc_channel_args* args) {
namespace {
struct channel_data {
grpc_core::MessageSizeParsedConfig::message_size_limits limits;
+ const size_t service_config_parser_index{
+ grpc_core::MessageSizeParser::ParserIndex()};
};
struct call_data {
@@ -156,7 +157,8 @@ struct call_data {
// 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);
+ grpc_core::MessageSizeParsedConfig::GetFromCallContext(
+ args.context, chand.service_config_parser_index);
if (limits != nullptr) {
if (limits->limits().max_send_size >= 0 &&
(limits->limits().max_send_size < this->limits.max_send_size ||
@@ -203,17 +205,15 @@ static void recv_message_ready(void* user_data, grpc_error_handle error) {
(*calld->recv_message)->length() >
static_cast<size_t>(calld->limits.max_recv_size)) {
grpc_error_handle new_error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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_CPP_STRING(absl::StrFormat(
+ "Received message larger than max (%u vs. %d)",
+ (*calld->recv_message)->length(), calld->limits.max_recv_size)),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
error = grpc_error_add_child(GRPC_ERROR_REF(error), new_error);
GRPC_ERROR_UNREF(calld->error);
calld->error = GRPC_ERROR_REF(error);
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
// Invoke the next callback.
grpc_closure* closure = calld->next_recv_message_ready;
@@ -264,14 +264,12 @@ 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(
- 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_CPP_STRING(absl::StrFormat(
+ "Sent message larger than max (%u vs. %d)",
+ op->payload->send_message.send_message->length(),
+ calld->limits.max_send_size)),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_RESOURCE_EXHAUSTED),
calld->call_combiner);
return;
}
@@ -335,6 +333,7 @@ static void message_size_destroy_channel_elem(grpc_channel_element* elem) {
const grpc_channel_filter grpc_message_size_filter = {
message_size_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(call_data),
message_size_init_call_elem,
@@ -348,22 +347,20 @@ const grpc_channel_filter grpc_message_size_filter = {
// Used for GRPC_CLIENT_SUBCHANNEL
static bool maybe_add_message_size_filter_subchannel(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
+ grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
if (grpc_channel_args_want_minimal_stack(channel_args)) {
return true;
}
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_message_size_filter, nullptr, nullptr);
+ builder->PrependFilter(&grpc_message_size_filter, nullptr);
+ return true;
}
// Used for GRPC_CLIENT_DIRECT_CHANNEL and GRPC_SERVER_CHANNEL. Adds the filter
// only if message size limits or service config is specified.
-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);
+static bool maybe_add_message_size_filter(
+ grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* channel_args = builder->channel_args();
if (grpc_channel_args_want_minimal_stack(channel_args)) {
return true;
}
@@ -376,28 +373,22 @@ static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder,
const grpc_arg* a =
grpc_channel_args_find(channel_args, GRPC_ARG_SERVICE_CONFIG);
const char* svc_cfg_str = grpc_channel_arg_get_string(a);
- if (svc_cfg_str != nullptr) {
- enable = true;
- }
- if (enable) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_message_size_filter, nullptr, nullptr);
- } else {
- return true;
- }
+ if (svc_cfg_str != nullptr) enable = true;
+ if (enable) builder->PrependFilter(&grpc_message_size_filter, nullptr);
+ return true;
}
-void grpc_message_size_filter_init(void) {
- grpc_channel_init_register_stage(
+namespace grpc_core {
+void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder) {
+ MessageSizeParser::Register(builder);
+ builder->channel_init()->RegisterStage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter_subchannel, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter, nullptr);
- grpc_core::MessageSizeParser::Register();
+ maybe_add_message_size_filter_subchannel);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_message_size_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_message_size_filter);
}
-
-void grpc_message_size_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/message_size/message_size_filter.h b/grpc/src/core/ext/filters/message_size/message_size_filter.h
index 6629803e..457ec6ef 100644
--- a/grpc/src/core/ext/filters/message_size/message_size_filter.h
+++ b/grpc/src/core/ext/filters/message_size/message_size_filter.h
@@ -19,8 +19,9 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/service_config/service_config_parser.h"
extern const grpc_channel_filter grpc_message_size_filter;
@@ -41,7 +42,8 @@ class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
const message_size_limits& limits() const { return limits_; }
static const MessageSizeParsedConfig* GetFromCallContext(
- const grpc_call_context_element* context);
+ const grpc_call_context_element* context,
+ size_t service_config_parser_index);
private:
message_size_limits limits_;
@@ -49,13 +51,18 @@ class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
class MessageSizeParser : public ServiceConfigParser::Parser {
public:
+ absl::string_view name() const override { return parser_name(); }
+
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
const grpc_channel_args* /*args*/, const Json& json,
grpc_error_handle* error) override;
- static void Register();
+ static void Register(CoreConfiguration::Builder* builder);
static size_t ParserIndex();
+
+ private:
+ static absl::string_view parser_name() { return "message_size"; }
};
int GetMaxRecvSizeFromChannelArgs(const grpc_channel_args* args);
diff --git a/grpc/src/core/ext/filters/rbac/rbac_filter.cc b/grpc/src/core/ext/filters/rbac/rbac_filter.cc
new file mode 100644
index 00000000..8e9abae0
--- /dev/null
+++ b/grpc/src/core/ext/filters/rbac/rbac_filter.cc
@@ -0,0 +1,162 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/rbac/rbac_filter.h"
+
+#include "src/core/ext/filters/rbac/rbac_service_config_parser.h"
+#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+//
+// RbacFilter::CallData
+//
+
+// CallData
+
+grpc_error_handle RbacFilter::CallData::Init(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ new (elem->call_data) CallData(elem, *args);
+ return GRPC_ERROR_NONE;
+}
+
+void RbacFilter::CallData::Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*then_schedule_closure*/) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
+}
+
+void RbacFilter::CallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ if (op->recv_initial_metadata) {
+ calld->recv_initial_metadata_ =
+ op->payload->recv_initial_metadata.recv_initial_metadata;
+ calld->original_recv_initial_metadata_ready_ =
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &calld->recv_initial_metadata_ready_;
+ }
+ // Chain to the next filter.
+ grpc_call_next_op(elem, op);
+}
+
+RbacFilter::CallData::CallData(grpc_call_element* elem,
+ const grpc_call_element_args& args)
+ : call_context_(args.context) {
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+}
+
+void RbacFilter::CallData::RecvInitialMetadataReady(void* user_data,
+ grpc_error_handle error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ RbacFilter* filter = static_cast<RbacFilter*>(elem->channel_data);
+ if (error == GRPC_ERROR_NONE) {
+ // Fetch and apply the rbac policy from the service config.
+ auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ auto* method_params = static_cast<RbacMethodParsedConfig*>(
+ service_config_call_data->GetMethodParsedConfig(
+ filter->service_config_parser_index_));
+ if (method_params == nullptr) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("No RBAC policy found.");
+ } else {
+ RbacFilter* chand = static_cast<RbacFilter*>(elem->channel_data);
+ auto* authorization_engine =
+ method_params->authorization_engine(chand->index_);
+ if (authorization_engine
+ ->Evaluate(EvaluateArgs(calld->recv_initial_metadata_,
+ &chand->per_channel_evaluate_args_))
+ .type == AuthorizationEngine::Decision::Type::kDeny) {
+ error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unauthorized RPC rejected");
+ }
+ }
+ if (error != GRPC_ERROR_NONE) {
+ error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_PERMISSION_DENIED);
+ }
+ } else {
+ (void)GRPC_ERROR_REF(error);
+ }
+ grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
+ calld->original_recv_initial_metadata_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, error);
+}
+
+//
+// RbacFilter
+//
+
+const grpc_channel_filter RbacFilter::kFilterVtable = {
+ RbacFilter::CallData::StartTransportStreamOpBatch,
+ nullptr,
+ grpc_channel_next_op,
+ sizeof(RbacFilter::CallData),
+ RbacFilter::CallData::Init,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ RbacFilter::CallData::Destroy,
+ sizeof(RbacFilter),
+ RbacFilter::Init,
+ RbacFilter::Destroy,
+ grpc_channel_next_get_info,
+ "rbac_filter",
+};
+
+RbacFilter::RbacFilter(size_t index,
+ EvaluateArgs::PerChannelArgs per_channel_evaluate_args)
+ : index_(index),
+ service_config_parser_index_(RbacServiceConfigParser::ParserIndex()),
+ per_channel_evaluate_args_(std::move(per_channel_evaluate_args)) {}
+
+grpc_error_handle RbacFilter::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ GPR_ASSERT(elem->filter == &kFilterVtable);
+ auto* auth_context = grpc_find_auth_context_in_args(args->channel_args);
+ if (auth_context == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No auth context found");
+ }
+ auto* transport = grpc_channel_args_find_pointer<grpc_transport>(
+ args->channel_args, GRPC_ARG_TRANSPORT);
+ if (transport == nullptr) {
+ // This should never happen since the transport is always set on the server
+ // side.
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No transport configured");
+ }
+ new (elem->channel_data) RbacFilter(
+ grpc_channel_stack_filter_instance_number(args->channel_stack, elem),
+ EvaluateArgs::PerChannelArgs(auth_context,
+ grpc_transport_get_endpoint(transport)));
+ return GRPC_ERROR_NONE;
+}
+
+void RbacFilter::Destroy(grpc_channel_element* elem) {
+ auto* chand = static_cast<RbacFilter*>(elem->channel_data);
+ chand->~RbacFilter();
+}
+
+void RbacFilterRegister(CoreConfiguration::Builder* builder) {
+ RbacServiceConfigParser::Register(builder);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/rbac/rbac_filter.h b/grpc/src/core/ext/filters/rbac/rbac_filter.h
new file mode 100644
index 00000000..1c8a31e6
--- /dev/null
+++ b/grpc/src/core/ext/filters/rbac/rbac_filter.h
@@ -0,0 +1,76 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RBAC_RBAC_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_RBAC_RBAC_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/security/authorization/evaluate_args.h"
+
+namespace grpc_core {
+
+// Filter used when xDS server config fetcher provides a configuration with an
+// HTTP RBAC filter. Also serves as the type for channel data for the filter.
+class RbacFilter {
+ public:
+ // This channel filter is intended to be used by connections on xDS enabled
+ // servers configured with RBAC. The RBAC filter fetches the RBAC policy from
+ // the method config of service config returned by the ServerConfigSelector,
+ // and enforces the RBAC policy.
+ static const grpc_channel_filter kFilterVtable;
+
+ private:
+ class CallData {
+ public:
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
+ static void Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /* final_info */,
+ grpc_closure* /* then_schedule_closure */);
+ static void StartTransportStreamOpBatch(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op);
+
+ private:
+ CallData(grpc_call_element* elem, const grpc_call_element_args& args);
+ static void RecvInitialMetadataReady(void* user_data,
+ grpc_error_handle error);
+
+ grpc_call_context_element* call_context_;
+ // State for keeping track of recv_initial_metadata
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+ grpc_closure recv_initial_metadata_ready_;
+ };
+
+ RbacFilter(size_t index,
+ EvaluateArgs::PerChannelArgs per_channel_evaluate_args);
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
+ static void Destroy(grpc_channel_element* elem);
+
+ // The index of this filter instance among instances of the same filter.
+ size_t index_;
+ // Assigned index for service config data from the parser.
+ const size_t service_config_parser_index_;
+ // Per channel args used for authorization.
+ EvaluateArgs::PerChannelArgs per_channel_evaluate_args_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_RBAC_RBAC_FILTER_H
diff --git a/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.cc b/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.cc
new file mode 100644
index 00000000..08d045ab
--- /dev/null
+++ b/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.cc
@@ -0,0 +1,606 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/rbac/rbac_service_config_parser.h"
+
+#include "absl/strings/str_format.h"
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/json/json_util.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+namespace {
+
+std::string ParseRegexMatcher(const Json::Object& regex_matcher_json,
+ std::vector<grpc_error_handle>* error_list) {
+ std::string regex;
+ ParseJsonObjectField(regex_matcher_json, "regex", &regex, error_list);
+ return regex;
+}
+
+absl::StatusOr<HeaderMatcher> ParseHeaderMatcher(
+ const Json::Object& header_matcher_json,
+ std::vector<grpc_error_handle>* error_list) {
+ std::string name;
+ ParseJsonObjectField(header_matcher_json, "name", &name, error_list);
+ std::string match;
+ HeaderMatcher::Type type = HeaderMatcher::Type();
+ const Json::Object* inner_json;
+ int64_t start = 0;
+ int64_t end = 0;
+ bool present_match = false;
+ bool invert_match = false;
+ ParseJsonObjectField(header_matcher_json, "invertMatch", &invert_match,
+ error_list, /*required=*/false);
+ if (ParseJsonObjectField(header_matcher_json, "exactMatch", &match,
+ error_list, /*required=*/false)) {
+ type = HeaderMatcher::Type::kExact;
+ } else if (ParseJsonObjectField(header_matcher_json, "safeRegexMatch",
+ &inner_json, error_list,
+ /*required=*/false)) {
+ type = HeaderMatcher::Type::kSafeRegex;
+ std::vector<grpc_error_handle> safe_regex_matcher_error_list;
+ match = ParseRegexMatcher(*inner_json, &safe_regex_matcher_error_list);
+ if (!safe_regex_matcher_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "safeRegexMatch", &safe_regex_matcher_error_list));
+ }
+ } else if (ParseJsonObjectField(header_matcher_json, "rangeMatch",
+ &inner_json, error_list,
+ /*required=*/false)) {
+ type = HeaderMatcher::Type::kRange;
+ std::vector<grpc_error_handle> range_error_list;
+ ParseJsonObjectField(*inner_json, "start", &start, &range_error_list);
+ ParseJsonObjectField(*inner_json, "end", &end, &range_error_list);
+ if (!range_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("rangeMatch", &range_error_list));
+ }
+ } else if (ParseJsonObjectField(header_matcher_json, "presentMatch",
+ &present_match, error_list,
+ /*required=*/false)) {
+ type = HeaderMatcher::Type::kPresent;
+ } else if (ParseJsonObjectField(header_matcher_json, "prefixMatch", &match,
+ error_list, /*required=*/false)) {
+ type = HeaderMatcher::Type::kPrefix;
+ } else if (ParseJsonObjectField(header_matcher_json, "suffixMatch", &match,
+ error_list, /*required=*/false)) {
+ type = HeaderMatcher::Type::kSuffix;
+ } else if (ParseJsonObjectField(header_matcher_json, "containsMatch", &match,
+ error_list, /*required=*/false)) {
+ type = HeaderMatcher::Type::kContains;
+ } else {
+ return absl::InvalidArgumentError("No valid matcher found");
+ }
+ return HeaderMatcher::Create(name, type, match, start, end, present_match,
+ invert_match);
+}
+
+absl::StatusOr<StringMatcher> ParseStringMatcher(
+ const Json::Object& string_matcher_json,
+ std::vector<grpc_error_handle>* error_list) {
+ std::string match;
+ StringMatcher::Type type = StringMatcher::Type();
+ const Json::Object* inner_json;
+ bool ignore_case = false;
+ ParseJsonObjectField(string_matcher_json, "ignoreCase", &ignore_case,
+ error_list, /*required=*/false);
+ if (ParseJsonObjectField(string_matcher_json, "exact", &match, error_list,
+ /*required=*/false)) {
+ type = StringMatcher::Type::kExact;
+ } else if (ParseJsonObjectField(string_matcher_json, "prefix", &match,
+ error_list, /*required=*/false)) {
+ type = StringMatcher::Type::kPrefix;
+ } else if (ParseJsonObjectField(string_matcher_json, "suffix", &match,
+ error_list, /*required=*/false)) {
+ type = StringMatcher::Type::kSuffix;
+ } else if (ParseJsonObjectField(string_matcher_json, "safeRegex", &inner_json,
+ error_list, /*required=*/false)) {
+ type = StringMatcher::Type::kSafeRegex;
+ std::vector<grpc_error_handle> safe_regex_matcher_error_list;
+ match = ParseRegexMatcher(*inner_json, &safe_regex_matcher_error_list);
+ if (!safe_regex_matcher_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "safeRegex", &safe_regex_matcher_error_list));
+ }
+ } else if (ParseJsonObjectField(string_matcher_json, "contains", &match,
+ error_list, /*required=*/false)) {
+ type = StringMatcher::Type::kContains;
+ } else {
+ return absl::InvalidArgumentError("No valid matcher found");
+ }
+ return StringMatcher::Create(type, match, ignore_case);
+}
+
+absl::StatusOr<StringMatcher> ParsePathMatcher(
+ const Json::Object& path_matcher_json,
+ std::vector<grpc_error_handle>* error_list) {
+ const Json::Object* string_matcher_json;
+ if (ParseJsonObjectField(path_matcher_json, "path", &string_matcher_json,
+ error_list)) {
+ std::vector<grpc_error_handle> sub_error_list;
+ auto matcher = ParseStringMatcher(*string_matcher_json, &sub_error_list);
+ if (!sub_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("path", &sub_error_list));
+ }
+ return matcher;
+ }
+ return absl::InvalidArgumentError("No path found");
+}
+
+Rbac::CidrRange ParseCidrRange(const Json::Object& cidr_range_json,
+ std::vector<grpc_error_handle>* error_list) {
+ std::string address_prefix;
+ ParseJsonObjectField(cidr_range_json, "addressPrefix", &address_prefix,
+ error_list);
+ const Json::Object* uint32_json;
+ uint32_t prefix_len = 0; // default value
+ if (ParseJsonObjectField(cidr_range_json, "prefixLen", &uint32_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> sub_error_list;
+ ParseJsonObjectField(*uint32_json, "value", &prefix_len, &sub_error_list);
+ if (!sub_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("prefixLen", &sub_error_list));
+ }
+ }
+ return Rbac::CidrRange(std::move(address_prefix), prefix_len);
+}
+
+Rbac::Permission ParsePermission(const Json::Object& permission_json,
+ std::vector<grpc_error_handle>* error_list) {
+ auto parse_permission_set = [](const Json::Object& permission_set_json,
+ std::vector<grpc_error_handle>* error_list) {
+ const Json::Array* rules_json;
+ std::vector<std::unique_ptr<Rbac::Permission>> permissions;
+ if (ParseJsonObjectField(permission_set_json, "rules", &rules_json,
+ error_list)) {
+ for (size_t i = 0; i < rules_json->size(); ++i) {
+ const Json::Object* permission_json;
+ if (!ExtractJsonType((*rules_json)[i],
+ absl::StrFormat("rules[%d]", i).c_str(),
+ &permission_json, error_list)) {
+ continue;
+ }
+ std::vector<grpc_error_handle> permission_error_list;
+ permissions.emplace_back(absl::make_unique<Rbac::Permission>(
+ ParsePermission(*permission_json, &permission_error_list)));
+ if (!permission_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("rules[%d]", i), &permission_error_list));
+ }
+ }
+ }
+ return permissions;
+ };
+ Rbac::Permission permission;
+ const Json::Object* inner_json;
+ bool any;
+ int port;
+ if (ParseJsonObjectField(permission_json, "andRules", &inner_json, error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> and_rules_error_list;
+ permission = Rbac::Permission::MakeAndPermission(
+ parse_permission_set(*inner_json, &and_rules_error_list));
+ if (!and_rules_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("andRules", &and_rules_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "orRules", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> or_rules_error_list;
+ permission = Rbac::Permission::MakeOrPermission(
+ parse_permission_set(*inner_json, &or_rules_error_list));
+ if (!or_rules_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("orRules", &or_rules_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "any", &any, error_list,
+ /*required=*/false) &&
+ any) {
+ permission = Rbac::Permission::MakeAnyPermission();
+ } else if (ParseJsonObjectField(permission_json, "header", &inner_json,
+ error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> header_error_list;
+ auto matcher = ParseHeaderMatcher(*inner_json, &header_error_list);
+ if (matcher.ok()) {
+ permission = Rbac::Permission::MakeHeaderPermission(*matcher);
+ } else {
+ header_error_list.push_back(absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!header_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("header", &header_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "urlPath", &inner_json,
+ error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> url_path_error_list;
+ auto matcher = ParsePathMatcher(*inner_json, &url_path_error_list);
+ if (matcher.ok()) {
+ permission = Rbac::Permission::MakePathPermission(*matcher);
+ } else {
+ url_path_error_list.push_back(
+ absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!url_path_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("urlPath", &url_path_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "destinationIp", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> destination_ip_error_list;
+ permission = Rbac::Permission::MakeDestIpPermission(
+ ParseCidrRange(*inner_json, &destination_ip_error_list));
+ if (!destination_ip_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "destinationIp", &destination_ip_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "destinationPort", &port,
+ error_list, /*required=*/false)) {
+ permission = Rbac::Permission::MakeDestPortPermission(port);
+ } else if (ParseJsonObjectField(permission_json, "metadata", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> metadata_error_list;
+ bool invert = false;
+ ParseJsonObjectField(*inner_json, "invert", &invert, &metadata_error_list,
+ /*required=*/false);
+ if (metadata_error_list.empty()) {
+ permission = Rbac::Permission::MakeMetadataPermission(invert);
+ } else {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("metadata", &metadata_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "notRule", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> not_rule_error_list;
+ permission = Rbac::Permission::MakeNotPermission(
+ ParsePermission(*inner_json, &not_rule_error_list));
+ if (!not_rule_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("notRule", &not_rule_error_list));
+ }
+ } else if (ParseJsonObjectField(permission_json, "requestedServerName",
+ &inner_json, error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> req_server_name_error_list;
+ auto matcher = ParseStringMatcher(*inner_json, &req_server_name_error_list);
+ if (matcher.ok()) {
+ permission = Rbac::Permission::MakeReqServerNamePermission(*matcher);
+ } else {
+ req_server_name_error_list.push_back(
+ absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!req_server_name_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "requestedServerName", &req_server_name_error_list));
+ }
+ } else {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid rule found"));
+ }
+ return permission;
+}
+
+Rbac::Principal ParsePrincipal(const Json::Object& principal_json,
+ std::vector<grpc_error_handle>* error_list) {
+ auto parse_principal_set = [](const Json::Object& principal_set_json,
+ std::vector<grpc_error_handle>* error_list) {
+ const Json::Array* rules_json;
+ std::vector<std::unique_ptr<Rbac::Principal>> principals;
+ if (ParseJsonObjectField(principal_set_json, "ids", &rules_json,
+ error_list)) {
+ for (size_t i = 0; i < rules_json->size(); ++i) {
+ const Json::Object* principal_json;
+ if (!ExtractJsonType((*rules_json)[i],
+ absl::StrFormat("ids[%d]", i).c_str(),
+ &principal_json, error_list)) {
+ continue;
+ }
+ std::vector<grpc_error_handle> principal_error_list;
+ principals.emplace_back(absl::make_unique<Rbac::Principal>(
+ ParsePrincipal(*principal_json, &principal_error_list)));
+ if (!principal_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("ids[%d]", i), &principal_error_list));
+ }
+ }
+ }
+ return principals;
+ };
+ Rbac::Principal principal;
+ const Json::Object* inner_json;
+ bool any;
+ if (ParseJsonObjectField(principal_json, "andIds", &inner_json, error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> and_rules_error_list;
+ principal = Rbac::Principal::MakeAndPrincipal(
+ parse_principal_set(*inner_json, &and_rules_error_list));
+ if (!and_rules_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("andIds", &and_rules_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "orIds", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> or_rules_error_list;
+ principal = Rbac::Principal::MakeOrPrincipal(
+ parse_principal_set(*inner_json, &or_rules_error_list));
+ if (!or_rules_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("orIds", &or_rules_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "any", &any, error_list,
+ /*required=*/false) &&
+ any) {
+ principal = Rbac::Principal::MakeAnyPrincipal();
+ } else if (ParseJsonObjectField(principal_json, "authenticated", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> authenticated_error_list;
+ const Json::Object* principal_name_json;
+ if (ParseJsonObjectField(*inner_json, "principalName", &principal_name_json,
+ &authenticated_error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> principal_name_error_list;
+ auto matcher =
+ ParseStringMatcher(*principal_name_json, &principal_name_error_list);
+ if (matcher.ok()) {
+ principal = Rbac::Principal::MakeAuthenticatedPrincipal(*matcher);
+ } else {
+ principal_name_error_list.push_back(
+ absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!principal_name_error_list.empty()) {
+ authenticated_error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "principalName", &principal_name_error_list));
+ }
+ } else if (authenticated_error_list.empty()) {
+ // No principalName found. Match for all users.
+ principal = Rbac::Principal::MakeAnyPrincipal();
+ } else {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "authenticated", &authenticated_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "sourceIp", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> source_ip_error_list;
+ principal = Rbac::Principal::MakeSourceIpPrincipal(
+ ParseCidrRange(*inner_json, &source_ip_error_list));
+ if (!source_ip_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("sourceIp", &source_ip_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "directRemoteIp", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> direct_remote_ip_error_list;
+ principal = Rbac::Principal::MakeDirectRemoteIpPrincipal(
+ ParseCidrRange(*inner_json, &direct_remote_ip_error_list));
+ if (!direct_remote_ip_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "directRemoteIp", &direct_remote_ip_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "remoteIp", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> remote_ip_error_list;
+ principal = Rbac::Principal::MakeRemoteIpPrincipal(
+ ParseCidrRange(*inner_json, &remote_ip_error_list));
+ if (!remote_ip_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("remoteIp", &remote_ip_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "header", &inner_json,
+ error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> header_error_list;
+ auto matcher = ParseHeaderMatcher(*inner_json, &header_error_list);
+ if (matcher.ok()) {
+ principal = Rbac::Principal::MakeHeaderPrincipal(*matcher);
+ } else {
+ header_error_list.push_back(absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!header_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("header", &header_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "urlPath", &inner_json,
+ error_list,
+ /*required=*/false)) {
+ std::vector<grpc_error_handle> url_path_error_list;
+ auto matcher = ParsePathMatcher(*inner_json, &url_path_error_list);
+ if (matcher.ok()) {
+ principal = Rbac::Principal::MakePathPrincipal(*matcher);
+ } else {
+ url_path_error_list.push_back(
+ absl_status_to_grpc_error(matcher.status()));
+ }
+ if (!url_path_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("urlPath", &url_path_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "metadata", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> metadata_error_list;
+ bool invert = false;
+ ParseJsonObjectField(*inner_json, "invert", &invert, &metadata_error_list,
+ /*required=*/false);
+ if (metadata_error_list.empty()) {
+ principal = Rbac::Principal::MakeMetadataPrincipal(invert);
+ } else {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("metadata", &metadata_error_list));
+ }
+ } else if (ParseJsonObjectField(principal_json, "notId", &inner_json,
+ error_list, /*required=*/false)) {
+ std::vector<grpc_error_handle> not_rule_error_list;
+ principal = Rbac::Principal::MakeNotPrincipal(
+ ParsePrincipal(*inner_json, &not_rule_error_list));
+ if (!not_rule_error_list.empty()) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("notId", &not_rule_error_list));
+ }
+ } else {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid id found"));
+ }
+ return principal;
+}
+
+Rbac::Policy ParsePolicy(const Json::Object& policy_json,
+ std::vector<grpc_error_handle>* error_list) {
+ Rbac::Policy policy;
+ const Json::Array* permissions_json_array;
+ std::vector<std::unique_ptr<Rbac::Permission>> permissions;
+ if (ParseJsonObjectField(policy_json, "permissions", &permissions_json_array,
+ error_list)) {
+ for (size_t i = 0; i < permissions_json_array->size(); ++i) {
+ const Json::Object* permission_json;
+ if (!ExtractJsonType((*permissions_json_array)[i],
+ absl::StrFormat("permissions[%d]", i),
+ &permission_json, error_list)) {
+ continue;
+ }
+ std::vector<grpc_error_handle> permission_error_list;
+ permissions.emplace_back(absl::make_unique<Rbac::Permission>(
+ ParsePermission(*permission_json, &permission_error_list)));
+ if (!permission_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("permissions[%d]", i), &permission_error_list));
+ }
+ }
+ }
+ const Json::Array* principals_json_array;
+ std::vector<std::unique_ptr<Rbac::Principal>> principals;
+ if (ParseJsonObjectField(policy_json, "principals", &principals_json_array,
+ error_list)) {
+ for (size_t i = 0; i < principals_json_array->size(); ++i) {
+ const Json::Object* principal_json;
+ if (!ExtractJsonType((*principals_json_array)[i],
+ absl::StrFormat("principals[%d]", i),
+ &principal_json, error_list)) {
+ continue;
+ }
+ std::vector<grpc_error_handle> principal_error_list;
+ principals.emplace_back(absl::make_unique<Rbac::Principal>(
+ ParsePrincipal(*principal_json, &principal_error_list)));
+ if (!principal_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("principals[%d]", i), &principal_error_list));
+ }
+ }
+ }
+ policy.permissions =
+ Rbac::Permission::MakeOrPermission(std::move(permissions));
+ policy.principals = Rbac::Principal::MakeOrPrincipal(std::move(principals));
+ return policy;
+}
+
+Rbac ParseRbac(const Json::Object& rbac_json,
+ std::vector<grpc_error_handle>* error_list) {
+ Rbac rbac;
+ const Json::Object* rules_json;
+ if (!ParseJsonObjectField(rbac_json, "rules", &rules_json, error_list,
+ /*required=*/false)) {
+ // No enforcing to be applied. An empty deny policy with an empty map is
+ // equivalent to no enforcing.
+ return Rbac(Rbac::Action::kDeny, {});
+ }
+ int action;
+ if (ParseJsonObjectField(*rules_json, "action", &action, error_list)) {
+ if (action > 1) {
+ error_list->push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown action"));
+ }
+ }
+ rbac.action = static_cast<Rbac::Action>(action);
+ const Json::Object* policies_json;
+ if (ParseJsonObjectField(*rules_json, "policies", &policies_json, error_list,
+ /*required=*/false)) {
+ for (const auto& entry : *policies_json) {
+ std::vector<grpc_error_handle> policy_error_list;
+ rbac.policies.emplace(
+ entry.first,
+ ParsePolicy(entry.second.object_value(), &policy_error_list));
+ if (!policy_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("policies key:'%s'", entry.first.c_str()),
+ &policy_error_list));
+ }
+ }
+ }
+ return rbac;
+}
+
+std::vector<Rbac> ParseRbacArray(const Json::Array& policies_json_array,
+ std::vector<grpc_error_handle>* error_list) {
+ std::vector<Rbac> policies;
+ for (size_t i = 0; i < policies_json_array.size(); ++i) {
+ const Json::Object* rbac_json;
+ if (!ExtractJsonType(policies_json_array[i],
+ absl::StrFormat("rbacPolicy[%d]", i), &rbac_json,
+ error_list)) {
+ continue;
+ }
+ std::vector<grpc_error_handle> rbac_policy_error_list;
+ policies.emplace_back(ParseRbac(*rbac_json, &rbac_policy_error_list));
+ if (!rbac_policy_error_list.empty()) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrFormat("rbacPolicy[%d]", i), &rbac_policy_error_list));
+ }
+ }
+ return policies;
+}
+
+} // namespace
+
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+RbacServiceConfigParser::ParsePerMethodParams(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ // Only parse rbac policy if the channel arg is present
+ if (!grpc_channel_args_find_bool(args, GRPC_ARG_PARSE_RBAC_METHOD_CONFIG,
+ false)) {
+ return nullptr;
+ }
+ std::vector<Rbac> rbac_policies;
+ std::vector<grpc_error_handle> error_list;
+ const Json::Array* policies_json_array;
+ if (ParseJsonObjectField(json.object_value(), "rbacPolicy",
+ &policies_json_array, &error_list)) {
+ rbac_policies = ParseRbacArray(*policies_json_array, &error_list);
+ }
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("Rbac parser", &error_list);
+ if (*error != GRPC_ERROR_NONE || rbac_policies.empty()) {
+ return nullptr;
+ }
+ return absl::make_unique<RbacMethodParsedConfig>(std::move(rbac_policies));
+}
+
+void RbacServiceConfigParser::Register(CoreConfiguration::Builder* builder) {
+ builder->service_config_parser()->RegisterParser(
+ absl::make_unique<RbacServiceConfigParser>());
+}
+
+size_t RbacServiceConfigParser::ParserIndex() {
+ return CoreConfiguration::Get().service_config_parser().GetParserIndex(
+ parser_name());
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.h b/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.h
new file mode 100644
index 00000000..b9b57a4b
--- /dev/null
+++ b/grpc/src/core/ext/filters/rbac/rbac_service_config_parser.h
@@ -0,0 +1,75 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RBAC_RBAC_SERVICE_CONFIG_PARSER_H
+#define GRPC_CORE_EXT_FILTERS_RBAC_RBAC_SERVICE_CONFIG_PARSER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
+#include "src/core/lib/service_config/service_config_parser.h"
+
+namespace grpc_core {
+
+// Channel arg key for enabling parsing RBAC via method config.
+#define GRPC_ARG_PARSE_RBAC_METHOD_CONFIG \
+ "grpc.internal.parse_rbac_method_config"
+
+class RbacMethodParsedConfig : public ServiceConfigParser::ParsedConfig {
+ public:
+ explicit RbacMethodParsedConfig(std::vector<Rbac> rbac_policies) {
+ for (auto& rbac_policy : rbac_policies) {
+ authorization_engines_.emplace_back(std::move(rbac_policy));
+ }
+ }
+
+ // Returns the authorization engine for a rbac policy at a certain index. For
+ // a connection on the server, multiple RBAC policies might be active. The
+ // RBAC filter uses this method to get the RBAC policy configured for a
+ // instance at a particular instance.
+ const GrpcAuthorizationEngine* authorization_engine(int index) const {
+ if (static_cast<size_t>(index) >= authorization_engines_.size()) {
+ return nullptr;
+ }
+ return &authorization_engines_[index];
+ }
+
+ private:
+ std::vector<GrpcAuthorizationEngine> authorization_engines_;
+};
+
+class RbacServiceConfigParser : public ServiceConfigParser::Parser {
+ public:
+ absl::string_view name() const override { return parser_name(); }
+ // Parses the per-method service config for rbac filter.
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
+ const grpc_channel_args* args, const Json& json,
+ grpc_error_handle* error) override;
+ // Returns the parser index for RbacServiceConfigParser.
+ static size_t ParserIndex();
+ // Registers RbacServiceConfigParser to ServiceConfigParser.
+ static void Register(CoreConfiguration::Builder* builder);
+
+ private:
+ static absl::string_view parser_name() { return "rbac"; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_RBAC_RBAC_SERVICE_CONFIG_PARSER_H
diff --git a/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc b/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc
new file mode 100644
index 00000000..8d21905c
--- /dev/null
+++ b/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc
@@ -0,0 +1,61 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/server_config_selector/server_config_selector.h"
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+namespace {
+
+void* ServerConfigSelectorProviderArgCopy(void* p) {
+ ServerConfigSelectorProvider* arg =
+ static_cast<ServerConfigSelectorProvider*>(p);
+ return arg->Ref().release();
+}
+
+void ServerConfigSelectorProviderArgDestroy(void* p) {
+ ServerConfigSelectorProvider* arg =
+ static_cast<ServerConfigSelectorProvider*>(p);
+ arg->Unref();
+}
+
+int ServerConfigSelectorProviderArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
+
+const grpc_arg_pointer_vtable kChannelArgVtable = {
+ ServerConfigSelectorProviderArgCopy, ServerConfigSelectorProviderArgDestroy,
+ ServerConfigSelectorProviderArgCmp};
+
+const char* kServerConfigSelectorProviderChannelArgName =
+ "grpc.internal.server_config_selector_provider";
+
+} // namespace
+
+grpc_arg ServerConfigSelectorProvider::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(kServerConfigSelectorProviderChannelArgName),
+ const_cast<ServerConfigSelectorProvider*>(this), &kChannelArgVtable);
+}
+
+absl::string_view ServerConfigSelectorProvider::ChannelArgName() {
+ return kServerConfigSelectorProviderChannelArgName;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h b/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h
new file mode 100644
index 00000000..590763f6
--- /dev/null
+++ b/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h
@@ -0,0 +1,71 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
+#define GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/status/statusor.h"
+
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/service_config/service_config.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// ServerConfigSelector allows for choosing the service config to apply to a
+// server-side call based on the received initial metadata.
+class ServerConfigSelector : public RefCounted<ServerConfigSelector> {
+ public:
+ // Configuration to apply to an incoming call
+ struct CallConfig {
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
+ RefCountedPtr<ServiceConfig> service_config;
+ };
+
+ ~ServerConfigSelector() override = default;
+ // Returns the CallConfig to apply to a call based on the incoming \a metadata
+ virtual CallConfig GetCallConfig(grpc_metadata_batch* metadata) = 0;
+};
+
+// ServerConfigSelectorProvider allows for subscribers to watch for updates on
+// ServerConfigSelector. It is propagated via channel args.
+class ServerConfigSelectorProvider
+ : public DualRefCounted<ServerConfigSelectorProvider> {
+ public:
+ class ServerConfigSelectorWatcher {
+ public:
+ virtual ~ServerConfigSelectorWatcher() = default;
+ virtual void OnServerConfigSelectorUpdate(
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> update) = 0;
+ };
+
+ ~ServerConfigSelectorProvider() override = default;
+ // Only a single watcher is allowed at present
+ virtual absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorWatcher> watcher) = 0;
+ virtual void CancelWatch() = 0;
+
+ static absl::string_view ChannelArgName();
+
+ grpc_arg MakeChannelArg() const;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
diff --git a/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc b/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
new file mode 100644
index 00000000..bb1b9a77
--- /dev/null
+++ b/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
@@ -0,0 +1,143 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/server_config_selector/server_config_selector_filter.h"
+
+#include "src/core/ext/filters/server_config_selector/server_config_selector.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/service_config/service_config_call_data.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+namespace {
+
+class ServerConfigSelectorFilter final : public ChannelFilter {
+ public:
+ ~ServerConfigSelectorFilter() override;
+
+ ServerConfigSelectorFilter(const ServerConfigSelectorFilter&) = delete;
+ ServerConfigSelectorFilter& operator=(const ServerConfigSelectorFilter&) =
+ delete;
+ ServerConfigSelectorFilter(ServerConfigSelectorFilter&&) = default;
+ ServerConfigSelectorFilter& operator=(ServerConfigSelectorFilter&&) = default;
+
+ static absl::StatusOr<ServerConfigSelectorFilter> Create(ChannelArgs args,
+ ChannelFilter::Args);
+
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> config_selector() {
+ MutexLock lock(&state_->mu);
+ return state_->config_selector.value();
+ }
+
+ private:
+ struct State {
+ Mutex mu;
+ absl::optional<absl::StatusOr<RefCountedPtr<ServerConfigSelector>>>
+ config_selector ABSL_GUARDED_BY(mu);
+ };
+ class ServerConfigSelectorWatcher
+ : public ServerConfigSelectorProvider::ServerConfigSelectorWatcher {
+ public:
+ explicit ServerConfigSelectorWatcher(std::shared_ptr<State> state)
+ : state_(state) {}
+ void OnServerConfigSelectorUpdate(
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> update) override {
+ MutexLock lock(&state_->mu);
+ state_->config_selector = std::move(update);
+ }
+
+ private:
+ std::shared_ptr<State> state_;
+ };
+
+ explicit ServerConfigSelectorFilter(
+ RefCountedPtr<ServerConfigSelectorProvider>
+ server_config_selector_provider);
+
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider_;
+ std::shared_ptr<State> state_;
+};
+
+absl::StatusOr<ServerConfigSelectorFilter> ServerConfigSelectorFilter::Create(
+ ChannelArgs args, ChannelFilter::Args) {
+ ServerConfigSelectorProvider* server_config_selector_provider =
+ args.GetObject<ServerConfigSelectorProvider>();
+ if (server_config_selector_provider == nullptr) {
+ return absl::UnknownError("No ServerConfigSelectorProvider object found");
+ }
+ return ServerConfigSelectorFilter(server_config_selector_provider->Ref());
+}
+
+ServerConfigSelectorFilter::ServerConfigSelectorFilter(
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider)
+ : server_config_selector_provider_(
+ std::move(server_config_selector_provider)),
+ state_(std::make_shared<State>()) {
+ GPR_ASSERT(server_config_selector_provider_ != nullptr);
+ auto server_config_selector_watcher =
+ absl::make_unique<ServerConfigSelectorWatcher>(state_);
+ auto config_selector = server_config_selector_provider_->Watch(
+ std::move(server_config_selector_watcher));
+ MutexLock lock(&state_->mu);
+ // It's possible for the watcher to have already updated config_selector_
+ if (!state_->config_selector.has_value()) {
+ state_->config_selector = std::move(config_selector);
+ }
+}
+
+ServerConfigSelectorFilter::~ServerConfigSelectorFilter() {
+ if (server_config_selector_provider_ != nullptr) {
+ server_config_selector_provider_->CancelWatch();
+ }
+}
+
+ArenaPromise<ServerMetadataHandle> ServerConfigSelectorFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ auto sel = config_selector();
+ if (!sel.ok()) return Immediate(ServerMetadataHandle(sel.status()));
+ auto call_config =
+ sel.value()->GetCallConfig(call_args.client_initial_metadata.get());
+ if (call_config.error != GRPC_ERROR_NONE) {
+ auto r = Immediate(ServerMetadataHandle(
+ absl::UnavailableError(grpc_error_std_string(call_config.error))));
+ GRPC_ERROR_UNREF(call_config.error);
+ return std::move(r);
+ }
+ auto& ctx = GetContext<
+ grpc_call_context_element>()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA];
+ ctx.value = GetContext<Arena>()->New<ServiceConfigCallData>(
+ std::move(call_config.service_config), call_config.method_configs,
+ ServiceConfigCallData::CallAttributes{});
+ ctx.destroy = [](void* p) {
+ static_cast<ServiceConfigCallData*>(p)->~ServiceConfigCallData();
+ };
+ return next_promise_factory(std::move(call_args));
+}
+
+} // namespace
+
+const grpc_channel_filter kServerConfigSelectorFilter =
+ MakePromiseBasedFilter<ServerConfigSelectorFilter, FilterEndpoint::kServer>(
+ "server_config_selector_filter");
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h b/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h
new file mode 100644
index 00000000..370a229b
--- /dev/null
+++ b/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h
@@ -0,0 +1,32 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+
+namespace grpc_core {
+
+extern const grpc_channel_filter kServerConfigSelectorFilter;
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
diff --git a/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc b/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
deleted file mode 100644
index b2e8f3fd..00000000
--- a/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
+++ /dev/null
@@ -1,211 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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/workarounds/workaround_cronet_compression_filter.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/workarounds/workaround_utils.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/metadata.h"
-
-namespace {
-struct call_data {
- // Receive closures are chained: we inject this closure as the
- // recv_initial_metadata_ready up-call on transport_stream_op, and remember to
- // call our next_recv_initial_metadata_ready member after handling it.
- grpc_closure recv_initial_metadata_ready;
- // Used by recv_initial_metadata_ready.
- grpc_metadata_batch* recv_initial_metadata;
- // Original recv_initial_metadata_ready callback, invoked after our own.
- grpc_closure* next_recv_initial_metadata_ready;
-
- // Marks whether the workaround is active
- bool workaround_active;
-};
-} // namespace
-
-// Find the user agent metadata element in the batch
-static bool get_user_agent_mdelem(const grpc_metadata_batch* batch,
- grpc_mdelem* md) {
- if (batch->idx.named.user_agent != nullptr) {
- *md = batch->idx.named.user_agent->md;
- return true;
- }
- return false;
-}
-
-// Callback invoked when we receive an initial metadata.
-static void recv_initial_metadata_ready(void* user_data,
- grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
-
- if (GRPC_ERROR_NONE == error) {
- grpc_mdelem md;
- if (get_user_agent_mdelem(calld->recv_initial_metadata, &md)) {
- grpc_workaround_user_agent_md* user_agent_md = grpc_parse_user_agent(md);
- if (user_agent_md
- ->workaround_active[GRPC_WORKAROUND_ID_CRONET_COMPRESSION]) {
- calld->workaround_active = true;
- }
- }
- }
-
- // Invoke the next callback.
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->next_recv_initial_metadata_ready,
- GRPC_ERROR_REF(error));
-}
-
-// Start transport stream op.
-static void cronet_compression_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
-
- // Inject callback for receiving initial metadata
- if (op->recv_initial_metadata) {
- calld->next_recv_initial_metadata_ready =
- op->payload->recv_initial_metadata.recv_initial_metadata_ready;
- op->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &calld->recv_initial_metadata_ready;
- calld->recv_initial_metadata =
- op->payload->recv_initial_metadata.recv_initial_metadata;
- }
-
- if (op->send_message) {
- /* Send message happens after client's user-agent (initial metadata) is
- * received, so workaround_active must be set already */
- if (calld->workaround_active) {
- op->payload->send_message.send_message->set_flags(
- op->payload->send_message.send_message->flags() |
- GRPC_WRITE_NO_COMPRESS);
- }
- }
-
- // Chain to the next filter.
- grpc_call_next_op(elem, op);
-}
-
-// Constructor for call_data.
-static grpc_error_handle cronet_compression_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->next_recv_initial_metadata_ready = nullptr;
- calld->workaround_active = false;
- GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
- recv_initial_metadata_ready, elem,
- grpc_schedule_on_exec_ctx);
- return GRPC_ERROR_NONE;
-}
-
-// Destructor for call_data.
-static void cronet_compression_destroy_call_elem(
- grpc_call_element* /*elem*/, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {}
-
-// Constructor for channel_data.
-static grpc_error_handle cronet_compression_init_channel_elem(
- grpc_channel_element* /*elem*/, grpc_channel_element_args* /*args*/) {
- return GRPC_ERROR_NONE;
-}
-
-// Destructor for channel_data.
-static void cronet_compression_destroy_channel_elem(
- grpc_channel_element* /*elem*/) {}
-
-// Parse the user agent
-static bool parse_user_agent(grpc_mdelem md) {
- const char grpc_objc_specifier[] = "grpc-objc/";
- const size_t grpc_objc_specifier_len = sizeof(grpc_objc_specifier) - 1;
- const char cronet_specifier[] = "cronet_http";
- const size_t cronet_specifier_len = sizeof(cronet_specifier) - 1;
-
- char* user_agent_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- bool grpc_objc_specifier_seen = false;
- bool cronet_specifier_seen = false;
- char *major_version_str = user_agent_str, *minor_version_str;
- long major_version = 0, minor_version = 0;
-
- char* head = strtok(user_agent_str, " ");
- while (head != nullptr) {
- if (!grpc_objc_specifier_seen &&
- 0 == strncmp(head, grpc_objc_specifier, grpc_objc_specifier_len)) {
- major_version_str = head + grpc_objc_specifier_len;
- grpc_objc_specifier_seen = true;
- } else if (grpc_objc_specifier_seen &&
- 0 == strncmp(head, cronet_specifier, cronet_specifier_len)) {
- cronet_specifier_seen = true;
- break;
- }
-
- head = strtok(nullptr, " ");
- }
- if (grpc_objc_specifier_seen) {
- major_version_str = strtok(major_version_str, ".");
- minor_version_str = strtok(nullptr, ".");
- major_version = atol(major_version_str);
- minor_version = atol(minor_version_str);
- }
-
- gpr_free(user_agent_str);
- return (grpc_objc_specifier_seen && cronet_specifier_seen &&
- (major_version < 1 || (major_version == 1 && minor_version <= 3)));
-}
-
-const grpc_channel_filter grpc_workaround_cronet_compression_filter = {
- cronet_compression_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- cronet_compression_init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- cronet_compression_destroy_call_elem,
- 0,
- cronet_compression_init_channel_elem,
- cronet_compression_destroy_channel_elem,
- grpc_channel_next_get_info,
- "workaround_cronet_compression"};
-
-static bool register_workaround_cronet_compression(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- const grpc_arg* a = grpc_channel_args_find(
- channel_args, GRPC_ARG_WORKAROUND_CRONET_COMPRESSION);
- if (a == nullptr) {
- return true;
- }
- if (!grpc_channel_arg_get_bool(a, false)) {
- return true;
- }
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_workaround_cronet_compression_filter, nullptr, nullptr);
-}
-
-void grpc_workaround_cronet_compression_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_WORKAROUND_PRIORITY_HIGH,
- register_workaround_cronet_compression, nullptr);
- grpc_register_workaround(GRPC_WORKAROUND_ID_CRONET_COMPRESSION,
- parse_user_agent);
-}
-
-void grpc_workaround_cronet_compression_filter_shutdown(void) {}
diff --git a/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h b/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
deleted file mode 100644
index 94d20f0c..00000000
--- a/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H
-#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/channel/channel_stack.h"
-
-extern const grpc_channel_filter grpc_workaround_cronet_compression_filter;
-
-#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H \
- */
diff --git a/grpc/src/core/ext/filters/workarounds/workaround_utils.cc b/grpc/src/core/ext/filters/workarounds/workaround_utils.cc
deleted file mode 100644
index 2a184ba8..00000000
--- a/grpc/src/core/ext/filters/workarounds/workaround_utils.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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/workarounds/workaround_utils.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-user_agent_parser ua_parser[GRPC_MAX_WORKAROUND_ID];
-
-static void destroy_user_agent_md(void* user_agent_md) {
- gpr_free(user_agent_md);
-}
-
-grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md) {
- grpc_workaround_user_agent_md* user_agent_md =
- static_cast<grpc_workaround_user_agent_md*>(
- grpc_mdelem_get_user_data(md, destroy_user_agent_md));
-
- if (nullptr != user_agent_md) {
- return user_agent_md;
- }
- user_agent_md = static_cast<grpc_workaround_user_agent_md*>(
- gpr_malloc(sizeof(grpc_workaround_user_agent_md)));
- for (int i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) {
- if (ua_parser[i]) {
- user_agent_md->workaround_active[i] = ua_parser[i](md);
- }
- }
- grpc_mdelem_set_user_data(md, destroy_user_agent_md, user_agent_md);
-
- return user_agent_md;
-}
-
-void grpc_register_workaround(uint32_t id, user_agent_parser parser) {
- GPR_ASSERT(id < GRPC_MAX_WORKAROUND_ID);
- ua_parser[id] = parser;
-}
diff --git a/grpc/src/core/ext/filters/workarounds/workaround_utils.h b/grpc/src/core/ext/filters/workarounds/workaround_utils.h
deleted file mode 100644
index f172ccc0..00000000
--- a/grpc/src/core/ext/filters/workarounds/workaround_utils.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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_WORKAROUNDS_WORKAROUND_UTILS_H
-#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/workaround_list.h>
-
-#include "src/core/lib/transport/metadata.h"
-
-#define GRPC_WORKAROUND_PRIORITY_HIGH 10001
-#define GRPC_WORKAROUND_PROIRITY_LOW 9999
-
-typedef struct grpc_workaround_user_agent_md {
- bool workaround_active[GRPC_MAX_WORKAROUND_ID];
-} grpc_workaround_user_agent_md;
-
-grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md);
-
-typedef bool (*user_agent_parser)(grpc_mdelem);
-
-void grpc_register_workaround(uint32_t id, user_agent_parser parser);
-
-#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */
diff --git a/grpc/src/core/ext/transport/binder/README.md b/grpc/src/core/ext/transport/binder/README.md
new file mode 100644
index 00000000..74200cd3
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/README.md
@@ -0,0 +1,10 @@
+# Binder transport for cross process IPC on Android
+
+EXPERIMENTAL. API stability not guaranteed.
+
+This transport implements
+[BinderChannel for native cross-process communication on Android](https://github.com/grpc/proposal/blob/master/L73-java-binderchannel.md) and enables C++/Java cross-process communication on Android with gRPC.
+
+Tests: https://github.com/grpc/grpc/tree/master/test/core/transport/binder/
+
+Example apps: https://github.com/grpc/grpc/tree/master/examples/android/binder/java/io/grpc/binder/cpp
diff --git a/grpc/src/core/ext/transport/binder/client/binder_connector.cc b/grpc/src/core/ext/transport/binder/client/binder_connector.cc
new file mode 100644
index 00000000..dbd72475
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/binder_connector.cc
@@ -0,0 +1,133 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/binder_connector.h"
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#include <functional>
+#include <map>
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/filters/client_channel/connector.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+
+namespace {
+
+// TODO(mingcl): Currently this does no error handling and assumes the
+// connection always succeeds in reasonable amount of time.
+class BinderConnector : public grpc_core::SubchannelConnector {
+ public:
+ BinderConnector() {}
+ ~BinderConnector() override {}
+ void Connect(const Args& args, Result* result,
+ grpc_closure* notify) override {
+#ifdef GRPC_HAVE_UNIX_SOCKET
+ {
+ struct sockaddr_un* un =
+ reinterpret_cast<struct sockaddr_un*>(args.address->addr);
+ // length of identifier, including null terminator
+ size_t id_length = args.address->len - sizeof(un->sun_family);
+ // The c-style string at least will have a null terminator, and the
+ // connection id itself should not be empty
+ GPR_ASSERT(id_length >= 2);
+ // Make sure there is null terminator at the expected location before
+ // reading from it
+ GPR_ASSERT(un->sun_path[id_length - 1] == '\0');
+ conn_id_ = un->sun_path;
+ }
+#else
+ GPR_ASSERT(0);
+#endif
+ gpr_log(GPR_INFO, "BinderConnector %p conn_id_ = %s", this,
+ conn_id_.c_str());
+
+ args_ = args;
+ GPR_ASSERT(notify_ == nullptr);
+ GPR_ASSERT(notify != nullptr);
+ notify_ = notify;
+ result_ = result;
+
+ Ref().release(); // Ref held by the following callback
+
+ grpc_binder::GetEndpointBinderPool()->GetEndpointBinder(
+ conn_id_,
+ std::bind(&BinderConnector::OnConnected, this, std::placeholders::_1));
+ }
+
+ void OnConnected(std::unique_ptr<grpc_binder::Binder> endpoint_binder) {
+ GPR_ASSERT(endpoint_binder != nullptr);
+ grpc_transport* transport = grpc_create_binder_transport_client(
+ std::move(endpoint_binder),
+ grpc_binder::GetSecurityPolicySetting()->Get(conn_id_));
+ GPR_ASSERT(transport != nullptr);
+ result_->channel_args = grpc_channel_args_copy(args_.channel_args);
+ result_->transport = transport;
+
+ GPR_ASSERT(notify_ != nullptr);
+ // ExecCtx is required here for running grpc_closure because this callback
+ // might be invoked from non-gRPC code
+ if (grpc_core::ExecCtx::Get() == nullptr) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
+ } else {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
+ }
+
+ Unref(); // Was referenced in BinderConnector::Connect
+ }
+ void Shutdown(grpc_error_handle error) override { (void)error; }
+
+ private:
+ Args args_;
+ grpc_closure* notify_ = nullptr;
+ Result* result_ = nullptr;
+
+ std::string conn_id_;
+};
+
+} // namespace
+
+namespace grpc_core {
+
+RefCountedPtr<Subchannel> BinderClientChannelFactory::CreateSubchannel(
+ const grpc_resolved_address& address, const grpc_channel_args* args) {
+ gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this);
+ grpc_arg default_authority_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>("binder.authority"));
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+
+ RefCountedPtr<Subchannel> s =
+ Subchannel::Create(MakeOrphanable<BinderConnector>(), address, new_args);
+
+ return s;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_NO_BINDER
diff --git a/grpc/src/core/ext/transport/binder/client/binder_connector.h b/grpc/src/core/ext/transport/binder/client/binder_connector.h
new file mode 100644
index 00000000..6b350fa2
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/binder_connector.h
@@ -0,0 +1,44 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "absl/strings/string_view.h"
+#include "absl/strings/strip.h"
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/support/channel_arguments.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/client_channel_factory.h"
+
+namespace grpc_core {
+
+class BinderClientChannelFactory : public ClientChannelFactory {
+ public:
+ RefCountedPtr<Subchannel> CreateSubchannel(
+ const grpc_resolved_address& address,
+ const grpc_channel_args* args) override;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
diff --git a/grpc/src/core/ext/transport/binder/client/channel_create.cc b/grpc/src/core/ext/transport/binder/client/channel_create.cc
new file mode 100644
index 00000000..dcb89799
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/channel_create.cc
@@ -0,0 +1,225 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/create_channel_binder.h>
+
+// The interface is only defined if GPR_ANDROID is defined, because some
+// arguments requires JNI.
+// Furthermore, the interface is non-phony only when
+// GPR_SUPPORT_BINDER_TRANSPORT is true because actual implementation of binder
+// transport requires newer version of NDK API
+
+#ifdef GPR_ANDROID
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_posix.h>
+#include <grpc/support/log.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/memory/memory.h"
+#include "absl/time/clock.h"
+#include "absl/time/time.h"
+
+#include <grpcpp/impl/grpc_library.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/transport/binder/client/channel_create_impl.h"
+#include "src/core/ext/transport/binder/client/connection_id_generator.h"
+#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/transport.h"
+#include "src/cpp/client/create_channel_internal.h"
+
+namespace {
+// grpc.io.action.BIND is the standard action name for binding to binder
+// transport server.
+const char* kStandardActionName = "grpc.io.action.BIND";
+
+// grpc::ChannelArguments key for specifying custom action name.
+const char* kCustomIntentActionNameArgKey =
+ "grpc.binder.custom_android_intent_action_name";
+} // namespace
+
+namespace grpc {
+namespace experimental {
+
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void* jni_env_void, jobject application, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ return CreateCustomBinderChannel(jni_env_void, application, package_name,
+ class_name, security_policy,
+ ChannelArguments());
+}
+
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void* jni_env_void, jobject application, absl::string_view package_name,
+ absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ const ChannelArguments& args) {
+ grpc::internal::GrpcLibrary init_lib;
+ init_lib.init();
+
+ GPR_ASSERT(jni_env_void != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ // Generate an unique connection ID that identifies this connection (Useful
+ // for mapping connection between Java and C++ code).
+ std::string connection_id = grpc_binder::GetConnectionIdGenerator()->Generate(
+ std::string(package_name), std::string(class_name));
+
+ grpc_channel_args channel_args_with_custom_action;
+ args.SetChannelArgs(&channel_args_with_custom_action);
+
+ // Check if user set an option to use non-standard action name to bind to
+ // server. At this moment this option is not intend for general production use
+ // and is mainly for stress testing purpose.
+ std::string action_name = kStandardActionName;
+ const grpc_arg* action_name_arg = grpc_channel_args_find(
+ &channel_args_with_custom_action, kCustomIntentActionNameArgKey);
+ if (action_name_arg != nullptr) {
+ // The option is set. Now check if it is a string.
+ char* action_name_arg_string = grpc_channel_arg_get_string(action_name_arg);
+ if (action_name_arg_string != nullptr) {
+ action_name = action_name_arg_string;
+ }
+ }
+ grpc_channel_args* channel_args;
+ {
+ // Passing the key down will cause gRPC internal error for unclear reason.
+ // Remove it here.
+ const char* to_remove[] = {kCustomIntentActionNameArgKey};
+ channel_args = grpc_channel_args_copy_and_remove(
+ &channel_args_with_custom_action, to_remove, 1);
+ }
+
+ // After invoking this Java method, Java code will put endpoint binder into
+ // `EndpointBinderPool` after the connection succeeds
+ // TODO(mingcl): Consider if we want to delay the connection establishment
+ // until SubchannelConnector start establishing connection. For now we don't
+ // see any benifits doing that.
+ grpc_binder::TryEstablishConnection(static_cast<JNIEnv*>(jni_env_void),
+ application, package_name, class_name,
+ action_name, connection_id);
+
+ // Set server URI to a URI that contains connection id. The URI will be used
+ // by subchannel connector to obtain correct endpoint binder from
+ // `EndpointBinderPool`.
+ grpc_channel_args* new_args;
+ {
+ grpc_arg server_uri_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_SERVER_URI),
+ const_cast<char*>(("binder:" + connection_id).c_str()));
+ const char* to_remove[] = {GRPC_ARG_SERVER_URI};
+ new_args = grpc_channel_args_copy_and_add_and_remove(
+ channel_args, to_remove, 1, &server_uri_arg, 1);
+ }
+
+ grpc_binder::GetSecurityPolicySetting()->Set(connection_id, security_policy);
+
+ auto channel = CreateChannelInternal(
+ "", grpc::internal::CreateClientBinderChannelImpl(new_args),
+ std::vector<
+ std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+
+ grpc_channel_args_destroy(new_args);
+ grpc_channel_args_destroy(channel_args);
+
+ return channel;
+}
+
+bool InitializeBinderChannelJavaClass(void* jni_env_void) {
+ return grpc_binder::FindNativeConnectionHelper(
+ static_cast<JNIEnv*>(jni_env_void)) != nullptr;
+}
+
+bool InitializeBinderChannelJavaClass(
+ void* jni_env_void, std::function<void*(std::string)> class_finder) {
+ return grpc_binder::FindNativeConnectionHelper(
+ static_cast<JNIEnv*>(jni_env_void), class_finder) != nullptr;
+}
+
+} // namespace experimental
+} // namespace grpc
+
+#else // !GPR_SUPPORT_BINDER_TRANSPORT
+
+namespace grpc {
+namespace experimental {
+
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void*, jobject, absl::string_view, absl::string_view,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void*, jobject, absl::string_view, absl::string_view,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>,
+ const ChannelArguments&) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+bool InitializeBinderChannelJavaClass(void* jni_env_void) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+bool InitializeBinderChannelJavaClass(
+ void* jni_env_void, std::function<void*(std::string)> class_finder) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+#endif // GPR_ANDROID
+
+#endif // GRPC_NO_BINDER
diff --git a/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc b/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc
new file mode 100644
index 00000000..843e3113
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc
@@ -0,0 +1,115 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/client/channel_create_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <memory>
+#include <utility>
+
+#include "src/core/ext/transport/binder/client/binder_connector.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
+
+namespace {
+
+grpc_core::BinderClientChannelFactory* g_factory;
+gpr_once g_factory_once = GPR_ONCE_INIT;
+
+void FactoryInit() { g_factory = new grpc_core::BinderClientChannelFactory(); }
+} // namespace
+
+namespace grpc {
+namespace internal {
+
+grpc_channel* CreateDirectBinderChannelImplForTesting(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ const grpc_channel_args* args,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ grpc_core::ExecCtx exec_ctx;
+
+ grpc_transport* transport = grpc_create_binder_transport_client(
+ std::move(endpoint_binder), security_policy);
+ GPR_ASSERT(transport != nullptr);
+
+ grpc_arg default_authority_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>("binder.authority"));
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel_args* final_args =
+ grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_channel* channel = grpc_channel_create_internal(
+ "binder_target_placeholder", final_args, GRPC_CLIENT_DIRECT_CHANNEL,
+ transport, &error);
+ // TODO(mingcl): Handle error properly
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(final_args);
+ return channel;
+}
+
+grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_once_init(&g_factory_once, FactoryInit);
+
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+
+ // Set channel factory argument
+ grpc_arg channel_factory_arg =
+ grpc_core::ClientChannelFactory::CreateChannelArg(g_factory);
+ const char* arg_to_remove = channel_factory_arg.key;
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+ args, &arg_to_remove, 1, &channel_factory_arg, 1);
+
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_channel* channel = grpc_channel_create_internal(
+ "binder_channel_target_placeholder", new_args, GRPC_CLIENT_CHANNEL,
+ nullptr, &error);
+
+ // Clean up.
+ grpc_channel_args_destroy(new_args);
+ grpc_channel_args_destroy(args);
+
+ if (channel == nullptr) {
+ intptr_t integer;
+ grpc_status_code status = GRPC_STATUS_INTERNAL;
+ if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
+ status = static_cast<grpc_status_code>(integer);
+ }
+ GRPC_ERROR_UNREF(error);
+ channel = grpc_lame_client_channel_create(
+ "binder_channel_target_placeholder", status,
+ "Failed to create binder channel");
+ }
+
+ return channel;
+}
+
+} // namespace internal
+} // namespace grpc
+#endif
diff --git a/grpc/src/core/ext/transport/binder/client/channel_create_impl.h b/grpc/src/core/ext/transport/binder/client/channel_create_impl.h
new file mode 100644
index 00000000..d48fa228
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/channel_create_impl.h
@@ -0,0 +1,42 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc {
+namespace internal {
+
+// Creates a GRPC_CLIENT_DIRECT_CHANNEL channel from endpoint binder
+// At this moment this is only used for testing.
+grpc_channel* CreateDirectBinderChannelImplForTesting(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ const grpc_channel_args* args,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+// Creates a GRPC_CLIENT_CHANNEL channel
+grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args);
+
+} // namespace internal
+} // namespace grpc
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
diff --git a/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc b/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc
new file mode 100644
index 00000000..f957a7ae
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc
@@ -0,0 +1,70 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/client/connection_id_generator.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include "absl/strings/str_cat.h"
+
+namespace {
+// Make sure `s` does not contain characters other than numbers, alphabets,
+// period and underscore
+std::string Normalize(absl::string_view str_view) {
+ std::string s = std::string(str_view);
+ for (size_t i = 0; i < s.length(); i++) {
+ if (!isalnum(s[i]) && s[i] != '.') {
+ s[i] = '_';
+ }
+ }
+ return s;
+}
+
+// Remove prefix of the string if the string is longer than len
+std::string StripToLength(const std::string& s, size_t len) {
+ if (s.length() > len) {
+ return s.substr(s.length() - len, len);
+ }
+ return s;
+}
+} // namespace
+
+namespace grpc_binder {
+
+std::string ConnectionIdGenerator::Generate(absl::string_view package_name,
+ absl::string_view class_name) {
+ // reserve some room for serial number
+ const size_t kReserveForNumbers = 15;
+ std::string s = StripToLength(
+ absl::StrCat(Normalize(package_name), "-", Normalize(class_name)),
+ kPathLengthLimit - kReserveForNumbers);
+ std::string ret;
+ {
+ grpc_core::MutexLock l(&m_);
+ // Insert a hyphen before serial number
+ ret = absl::StrCat(s, "-", ++count_);
+ }
+ GPR_ASSERT(ret.length() < kPathLengthLimit);
+ return ret;
+}
+
+ConnectionIdGenerator* GetConnectionIdGenerator() {
+ static ConnectionIdGenerator* cig = new ConnectionIdGenerator();
+ return cig;
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/client/connection_id_generator.h b/grpc/src/core/ext/transport/binder/client/connection_id_generator.h
new file mode 100644
index 00000000..543e67ed
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/connection_id_generator.h
@@ -0,0 +1,52 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+
+#include "absl/strings/string_view.h"
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// Generates somewhat human-readable unique identifiers from package name and
+// class name. We will generate a Id that only contains unreserved URI
+// characters (uppercase and lowercase letters, decimal digits, hyphen, period,
+// underscore, and tilde).
+class ConnectionIdGenerator {
+ public:
+ std::string Generate(absl::string_view package_name,
+ absl::string_view class_name);
+
+ private:
+ // Our generated Id need to fit in unix socket path length limit. We use 100
+ // here to be safe.
+ const size_t kPathLengthLimit = 100;
+
+ grpc_core::Mutex m_;
+ // Every generated identifier will followed by the value of this counter to
+ // make sure every generated id is unique.
+ int count_ ABSL_GUARDED_BY(m_);
+};
+
+ConnectionIdGenerator* GetConnectionIdGenerator();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
diff --git a/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc b/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc
new file mode 100644
index 00000000..14263536
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc
@@ -0,0 +1,113 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/client/endpoint_binder_pool.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <jni.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+
+extern "C" {
+// Adds endpoint binder to binder pool when Java notify us that the endpoint
+// binder is ready. This is called from GrpcBinderConnection.java
+JNIEXPORT void JNICALL
+Java_io_grpc_binder_cpp_GrpcBinderConnection_notifyConnected__Ljava_lang_String_2Landroid_os_IBinder_2(
+ JNIEnv* jni_env, jobject, jstring conn_id_jstring, jobject ibinder) {
+ jboolean isCopy;
+ const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
+ gpr_log(GPR_INFO, "%s invoked with conn_id = %s", __func__, conn_id);
+ GPR_ASSERT(ibinder != nullptr);
+ grpc_binder::ndk_util::SpAIBinder aibinder =
+ grpc_binder::FromJavaBinder(jni_env, ibinder);
+ gpr_log(GPR_INFO, "%s got aibinder = %p", __func__, aibinder.get());
+ auto b = absl::make_unique<grpc_binder::BinderAndroid>(aibinder);
+ GPR_ASSERT(b != nullptr);
+ grpc_binder::GetEndpointBinderPool()->AddEndpointBinder(conn_id,
+ std::move(b));
+ if (isCopy == JNI_TRUE) {
+ jni_env->ReleaseStringUTFChars(conn_id_jstring, conn_id);
+ }
+}
+}
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+namespace grpc_binder {
+
+void EndpointBinderPool::GetEndpointBinder(
+ std::string conn_id,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb) {
+ gpr_log(GPR_INFO, "EndpointBinder requested. conn_id = %s", conn_id.c_str());
+ std::unique_ptr<grpc_binder::Binder> b;
+ {
+ grpc_core::MutexLock l(&m_);
+ if (binder_map_.count(conn_id)) {
+ b = std::move(binder_map_[conn_id]);
+ binder_map_.erase(conn_id);
+ GPR_ASSERT(b != nullptr);
+ } else {
+ if (pending_requests_.count(conn_id) != 0) {
+ gpr_log(GPR_ERROR,
+ "Duplicate GetEndpointBinder requested. conn_id = %s",
+ conn_id.c_str());
+ return;
+ }
+ pending_requests_[conn_id] = std::move(cb);
+ return;
+ }
+ }
+ GPR_ASSERT(b != nullptr);
+ cb(std::move(b));
+}
+
+void EndpointBinderPool::AddEndpointBinder(
+ std::string conn_id, std::unique_ptr<grpc_binder::Binder> b) {
+ gpr_log(GPR_INFO, "EndpointBinder added. conn_id = %s", conn_id.c_str());
+ GPR_ASSERT(b != nullptr);
+ // cb will be set in the following block if there is a pending callback
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ if (binder_map_.count(conn_id) != 0) {
+ gpr_log(GPR_ERROR, "EndpointBinder already in the pool. conn_id = %s",
+ conn_id.c_str());
+ return;
+ }
+ if (pending_requests_.count(conn_id)) {
+ cb = std::move(pending_requests_[conn_id]);
+ pending_requests_.erase(conn_id);
+ } else {
+ binder_map_[conn_id] = std::move(b);
+ b = nullptr;
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(b));
+ }
+}
+
+EndpointBinderPool* GetEndpointBinderPool() {
+ static EndpointBinderPool* p = new EndpointBinderPool();
+ return p;
+}
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h b/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h
new file mode 100644
index 00000000..9d19e722
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h
@@ -0,0 +1,65 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <string>
+
+#include "absl/container/flat_hash_map.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// This class serves as a buffer of endpoint binders between C++ and
+// Java. `AddEndpointBinder` will be indirectly invoked by Java code, and
+// `GetEndpointBinder` is for C++ code to register callback to get endpoint
+// binder when become available. This simplifies JNI related threading issues
+// since both side only need to interact with this buffer in non-blocking
+// manner and avoids cross-language callbacks.
+class EndpointBinderPool {
+ public:
+ // Invokes the callback when the binder corresponding to the conn_id become
+ // available. If the binder is already available, invokes the callback
+ // immediately.
+ // Ownership of the endpoint binder will be transferred to the callback
+ // function and it will be removed from the pool
+ void GetEndpointBinder(
+ std::string conn_id,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb);
+
+ // Add an endpoint binder to the pool
+ void AddEndpointBinder(std::string conn_id,
+ std::unique_ptr<grpc_binder::Binder> b);
+
+ private:
+ grpc_core::Mutex m_;
+ absl::flat_hash_map<std::string, std::unique_ptr<grpc_binder::Binder>>
+ binder_map_ ABSL_GUARDED_BY(m_);
+ absl::flat_hash_map<std::string,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)>>
+ pending_requests_ ABSL_GUARDED_BY(m_);
+};
+
+// Returns the singleton
+EndpointBinderPool* GetEndpointBinderPool();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
diff --git a/grpc/src/core/ext/transport/binder/client/jni_utils.cc b/grpc/src/core/ext/transport/binder/client/jni_utils.cc
new file mode 100644
index 00000000..1bf1ccdd
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/jni_utils.cc
@@ -0,0 +1,113 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/client/jni_utils.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpc/support/log.h>
+
+#if defined(ANDROID) || defined(__ANDROID__)
+
+namespace grpc_binder {
+
+jclass FindNativeConnectionHelper(JNIEnv* env) {
+ return FindNativeConnectionHelper(
+ env, [env](std::string cl) { return env->FindClass(cl.c_str()); });
+}
+
+jclass FindNativeConnectionHelper(
+ JNIEnv* env, std::function<void*(std::string)> class_finder) {
+ auto do_find = [env, class_finder]() {
+ jclass cl = static_cast<jclass>(
+ class_finder("io/grpc/binder/cpp/NativeConnectionHelper"));
+ if (cl == nullptr) {
+ return cl;
+ }
+ jclass global_cl = static_cast<jclass>(env->NewGlobalRef(cl));
+ env->DeleteLocalRef(cl);
+ GPR_ASSERT(global_cl != nullptr);
+ return global_cl;
+ };
+ static jclass connection_helper_class = do_find();
+ if (connection_helper_class != nullptr) {
+ return connection_helper_class;
+ }
+ // Some possible reasons:
+ // * There is no Java class in the call stack and this is not invoked
+ // from JNI_OnLoad
+ // * The APK does not correctly depends on the helper class, or the
+ // class get shrinked
+ gpr_log(GPR_ERROR,
+ "Cannot find binder transport Java helper class. Did you invoke "
+ "grpc::experimental::InitializeBinderChannelJavaClass correctly "
+ "beforehand? Did the APK correctly include the connection helper "
+ "class (i.e depends on build target "
+ "src/core/ext/transport/binder/java/io/grpc/binder/"
+ "cpp:connection_helper) ?");
+ // TODO(mingcl): Maybe it is worth to try again so the failure can be fixed
+ // by invoking this function again at a different thread.
+ return nullptr;
+}
+
+void TryEstablishConnection(JNIEnv* env, jobject application,
+ absl::string_view pkg, absl::string_view cls,
+ absl::string_view action_name,
+ absl::string_view conn_id) {
+ std::string method = "tryEstablishConnection";
+ std::string type =
+ "(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/"
+ "lang/String;Ljava/lang/String;)V";
+
+ jclass cl = FindNativeConnectionHelper(env);
+ if (cl == nullptr) {
+ return;
+ }
+
+ jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
+ if (mid == nullptr) {
+ gpr_log(GPR_ERROR, "No method id %s", method.c_str());
+ }
+
+ env->CallStaticVoidMethod(cl, mid, application,
+ env->NewStringUTF(std::string(pkg).c_str()),
+ env->NewStringUTF(std::string(cls).c_str()),
+ env->NewStringUTF(std::string(action_name).c_str()),
+ env->NewStringUTF(std::string(conn_id).c_str()));
+}
+
+bool IsSignatureMatch(JNIEnv* env, jobject context, int uid1, int uid2) {
+ const std::string method = "isSignatureMatch";
+ const std::string type = "(Landroid/content/Context;II)Z";
+
+ jclass cl = FindNativeConnectionHelper(env);
+ if (cl == nullptr) {
+ return false;
+ }
+
+ jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
+ if (mid == nullptr) {
+ gpr_log(GPR_ERROR, "No method id %s", method.c_str());
+ }
+
+ jboolean result = env->CallStaticBooleanMethod(cl, mid, context, uid1, uid2);
+ return result == JNI_TRUE;
+}
+
+} // namespace grpc_binder
+
+#endif
+#endif
diff --git a/grpc/src/core/ext/transport/binder/client/jni_utils.h b/grpc/src/core/ext/transport/binder/client/jni_utils.h
new file mode 100644
index 00000000..a50c94bc
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/jni_utils.h
@@ -0,0 +1,54 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
+
+#if defined(ANDROID) || defined(__ANDROID__)
+
+#include <grpc/support/port_platform.h>
+
+#include <jni.h>
+
+#include <functional>
+#include <string>
+
+#include "absl/strings/string_view.h"
+
+namespace grpc_binder {
+
+// Finds NativeConnectionHelper Java class and caches it. This is useful because
+// FindClass only works when there is a Java class in the call stack. Typically
+// user might want to call this once in a place that is called from Java (ex.
+// JNI_OnLoad) so subsequent BinderTransport code can find Java class
+jclass FindNativeConnectionHelper(JNIEnv* env);
+
+jclass FindNativeConnectionHelper(
+ JNIEnv* env, std::function<void*(std::string)> class_finder);
+
+// Calls Java method NativeConnectionHelper.tryEstablishConnection
+void TryEstablishConnection(JNIEnv* env, jobject application,
+ absl::string_view pkg, absl::string_view cls,
+ absl::string_view action_name,
+ absl::string_view conn_id);
+
+// Calls Java method NativeConnectionHelper.isSignatureMatch.
+// Will also return false if failed to invoke Java.
+bool IsSignatureMatch(JNIEnv* env, jobject context, int uid1, int uid2);
+
+} // namespace grpc_binder
+
+#endif
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
diff --git a/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc b/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc
new file mode 100644
index 00000000..d8739142
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc
@@ -0,0 +1,45 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+
+namespace grpc_binder {
+
+void SecurityPolicySetting::Set(
+ absl::string_view connection_id,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(security_policy_map_.count(std::string(connection_id)) == 0);
+ security_policy_map_[std::string(connection_id)] = security_policy;
+}
+
+std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+SecurityPolicySetting::Get(absl::string_view connection_id) {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(security_policy_map_.count(std::string(connection_id)) != 0);
+ return security_policy_map_[std::string(connection_id)];
+}
+
+SecurityPolicySetting* GetSecurityPolicySetting() {
+ static SecurityPolicySetting* s = new SecurityPolicySetting();
+ return s;
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/client/security_policy_setting.h b/grpc/src/core/ext/transport/binder/client/security_policy_setting.h
new file mode 100644
index 00000000..d2516617
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/client/security_policy_setting.h
@@ -0,0 +1,51 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/container/flat_hash_map.h"
+#include "absl/strings/string_view.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// A singleton class for setting security setting for each connection. This is
+// required because we cannot pass security policy shared pointers around using
+// gRPC arguments, we can only pass connection_id around as part of URI
+class SecurityPolicySetting {
+ public:
+ void Set(absl::string_view connection_id,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> Get(
+ absl::string_view connection_id);
+
+ private:
+ grpc_core::Mutex m_;
+ absl::flat_hash_map<
+ std::string, std::shared_ptr<grpc::experimental::binder::SecurityPolicy>>
+ security_policy_map_ ABSL_GUARDED_BY(m_);
+};
+
+SecurityPolicySetting* GetSecurityPolicySetting();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
diff --git a/grpc/src/core/ext/transport/binder/java/WORKSPACE b/grpc/src/core/ext/transport/binder/java/WORKSPACE
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/java/WORKSPACE
diff --git a/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD
new file mode 100644
index 00000000..8da1c379
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD
@@ -0,0 +1,28 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@build_bazel_rules_android//android:rules.bzl", "android_library")
+
+licenses(["notice"])
+
+android_library(
+ name = "connection_helper",
+ srcs = [
+ "GrpcBinderConnection.java",
+ "GrpcCppServerBuilder.java",
+ "NativeConnectionHelper.java",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [],
+)
diff --git a/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcBinderConnection.java b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcBinderConnection.java
new file mode 100644
index 00000000..35f3d84f
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcBinderConnection.java
@@ -0,0 +1,85 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package io.grpc.binder.cpp;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.util.Log;
+
+/* Handles the binder connection state with OnDeviceServer server */
+public class GrpcBinderConnection implements ServiceConnection {
+ private static final String logTag = "GrpcBinderConnection";
+
+ private Context mContext;
+ private IBinder mService;
+
+ // A string that identifies this service connection
+ private final String mConnId;
+
+ public GrpcBinderConnection(Context context, String connId) {
+ mContext = context;
+ mConnId = connId;
+ }
+
+ @Override
+ public void onNullBinding(ComponentName className) {
+ // TODO(mingcl): Notify C++ that the connection is never going to happen
+ Log.e(logTag, "Service returned null IBinder. mConnId = " + mConnId);
+ }
+
+ @Override
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ Log.e(logTag, "Service has connected. mConnId = " + mConnId);
+ if (service == null) {
+ // This should not happen since onNullBinding should be invoked instead
+ throw new IllegalArgumentException("service was null");
+ }
+ synchronized (this) {
+ mService = service;
+ }
+ notifyConnected(mConnId, mService);
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName className) {
+ Log.e(logTag, "Service has disconnected. mConnId = " + mConnId);
+ }
+
+ public void tryConnect(String pkg, String cls, String action_name) {
+ synchronized (this) {
+ Intent intent = new Intent(action_name);
+ ComponentName compName = new ComponentName(pkg, cls);
+ intent.setComponent(compName);
+ // Will return true if the system is in the process of bringing up a service that your client
+ // has permission to bind to; false if the system couldn't find the service or if your client
+ // doesn't have permission to bind to it
+ boolean result = mContext.bindService(intent, this, Context.BIND_AUTO_CREATE);
+ if (result) {
+ Log.e(logTag, "bindService returns ok");
+ } else {
+ Log.e(
+ logTag,
+ "bindService failed. Maybe the system couldn't find the service or the"
+ + " client doesn't have permission to bind to it.");
+ }
+ }
+ }
+
+ // Calls a function defined in endpoint_binder_pool.cc
+ private static native void notifyConnected(String connId, IBinder service);
+}
diff --git a/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java
new file mode 100644
index 00000000..c5ccfd39
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java
@@ -0,0 +1,38 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package io.grpc.binder.cpp;
+
+import android.os.IBinder;
+import android.util.Log;
+
+/* EXPERIMENTAL. Provides a interface to get endpoint binder from C++ */
+public class GrpcCppServerBuilder {
+ private static final String logTag = "GrpcCppServerBuilder";
+
+ public static IBinder GetEndpointBinder(String uri) {
+ String scheme = "binder:";
+ if (uri.startsWith(scheme)) {
+ String path = uri.substring(scheme.length());
+ // TODO(mingcl): Consider if we would like to make sure the path only contain valid
+ // characters here
+ return GetEndpointBinderInternal(path);
+ } else {
+ Log.e(logTag, "URI " + uri + " does not start with 'binder:'");
+ return null;
+ }
+ }
+
+ private static native IBinder GetEndpointBinderInternal(String conn_id);
+}
diff --git a/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/NativeConnectionHelper.java b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/NativeConnectionHelper.java
new file mode 100644
index 00000000..257f6514
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/java/io/grpc/binder/cpp/NativeConnectionHelper.java
@@ -0,0 +1,58 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package io.grpc.binder.cpp;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.Parcel;
+import android.util.Log;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class will be invoked by gRPC binder transport internal implementation (from
+ * src/core/ext/transport/binder/client/jni_utils.cc) to perform operations that are only possible
+ * in Java
+ */
+final class NativeConnectionHelper {
+ // Maps connection id to GrpcBinderConnection instances
+ static Map<String, GrpcBinderConnection> s = new HashMap<>();
+
+ static void tryEstablishConnection(Context context, String pkg, String cls, String action_name, String connId) {
+ // TODO(mingcl): Assert that connId is unique
+ s.put(connId, new GrpcBinderConnection(context, connId));
+ s.get(connId).tryConnect(pkg, cls, action_name);
+ }
+
+ // Returns true if the packages signature of the 2 UIDs match.
+ // `context` is used to get PackageManager.
+ // Suppress unnecessary internal warnings related to checkSignatures compatibility issue.
+ // BinderTransport code is only used on newer Android platform versions so this is fine.
+ @SuppressWarnings("CheckSignatures")
+ static boolean isSignatureMatch(Context context, int uid1, int uid2) {
+ int result = context.getPackageManager().checkSignatures(uid1, uid2);
+ if (result == PackageManager.SIGNATURE_MATCH) {
+ return true;
+ }
+ Log.e(
+ "NativeConnectionHelper",
+ "Signatures does not match. checkSignature return value = " + result);
+ return false;
+ }
+
+ static Parcel getEmptyParcel() {
+ return Parcel.obtain();
+ }
+}
diff --git a/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc b/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc
new file mode 100644
index 00000000..af24f878
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc
@@ -0,0 +1,105 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#ifdef GPR_ANDROID
+
+#include <jni.h>
+#include <unistd.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+UntrustedSecurityPolicy::UntrustedSecurityPolicy() = default;
+
+UntrustedSecurityPolicy::~UntrustedSecurityPolicy() = default;
+
+bool UntrustedSecurityPolicy::IsAuthorized(int) { return true; };
+
+InternalOnlySecurityPolicy::InternalOnlySecurityPolicy() = default;
+
+InternalOnlySecurityPolicy::~InternalOnlySecurityPolicy() = default;
+
+#ifdef GPR_ANDROID
+bool InternalOnlySecurityPolicy::IsAuthorized(int uid) {
+ return static_cast<uid_t>(uid) == getuid();
+}
+#else
+bool InternalOnlySecurityPolicy::IsAuthorized(int) { return false; }
+#endif
+
+#ifdef GPR_ANDROID
+
+namespace {
+JNIEnv* GetEnv(JavaVM* vm) {
+ if (vm == nullptr) return nullptr;
+
+ JNIEnv* result = nullptr;
+ jint attach = vm->AttachCurrentThread(&result, nullptr);
+
+ GPR_ASSERT(JNI_OK == attach);
+ GPR_ASSERT(nullptr != result);
+ return result;
+}
+} // namespace
+
+SameSignatureSecurityPolicy::SameSignatureSecurityPolicy(JavaVM* jvm,
+ jobject context)
+ : jvm_(jvm) {
+ GPR_ASSERT(jvm != nullptr);
+ GPR_ASSERT(context != nullptr);
+
+ JNIEnv* env = GetEnv(jvm_);
+
+ // Make sure the context is still valid when IsAuthorized() is called
+ context_ = env->NewGlobalRef(context);
+ GPR_ASSERT(context_ != nullptr);
+}
+
+SameSignatureSecurityPolicy::~SameSignatureSecurityPolicy() {
+ JNIEnv* env = GetEnv(jvm_);
+ env->DeleteLocalRef(context_);
+}
+
+bool SameSignatureSecurityPolicy::IsAuthorized(int uid) {
+ JNIEnv* env = GetEnv(jvm_);
+ bool result = grpc_binder::IsSignatureMatch(env, context_, getuid(), uid);
+ if (result) {
+ gpr_log(GPR_INFO, "uid %d and uid %d passed SameSignature check", getuid(),
+ uid);
+ } else {
+ gpr_log(GPR_ERROR, "uid %d and uid %d failed SameSignature check", getuid(),
+ uid);
+ }
+ return result;
+}
+
+#endif
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+#endif
diff --git a/grpc/src/core/ext/transport/binder/security_policy/security_policy.h b/grpc/src/core/ext/transport/binder/security_policy/security_policy.h
new file mode 100644
index 00000000..69a6e959
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/security_policy/security_policy.h
@@ -0,0 +1,40 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_SECURITY_POLICY_SECURITY_POLICY_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_SECURITY_POLICY_SECURITY_POLICY_H
+
+#include <grpc/support/port_platform.h>
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+// This interface is for determining if a connection is allowed to be
+// established on Android. See https://source.android.com/security/app-sandbox
+// for more info about UID.
+class SecurityPolicy {
+ public:
+ virtual ~SecurityPolicy() = default;
+ // Returns true if the UID is authorized to connect.
+ // Must return the same value for the same inputs so callers can safely cache
+ // the result.
+ virtual bool IsAuthorized(int uid) = 0;
+};
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_SECURITY_POLICY_SECURITY_POLICY_H
diff --git a/grpc/src/core/ext/transport/binder/server/binder_server.cc b/grpc/src/core/ext/transport/binder/server/binder_server.cc
new file mode 100644
index 00000000..994a04a0
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/server/binder_server.cc
@@ -0,0 +1,251 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/server/binder_server.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "absl/memory/memory.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <jni.h>
+
+extern "C" {
+
+// This will be invoked from
+// src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java
+JNIEXPORT jobject JNICALL
+Java_io_grpc_binder_cpp_GrpcCppServerBuilder_GetEndpointBinderInternal__Ljava_lang_String_2(
+ JNIEnv* jni_env, jobject, jstring conn_id_jstring) {
+ grpc_binder::ndk_util::AIBinder* ai_binder = nullptr;
+
+ {
+ // This block is the scope of conn_id c-string
+ jboolean isCopy;
+ const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
+ ai_binder = static_cast<grpc_binder::ndk_util::AIBinder*>(
+ grpc_get_endpoint_binder(std::string(conn_id)));
+ if (ai_binder == nullptr) {
+ gpr_log(GPR_ERROR, "Cannot find endpoint binder with connection id = %s",
+ conn_id);
+ }
+ if (isCopy == JNI_TRUE) {
+ jni_env->ReleaseStringUTFChars(conn_id_jstring, conn_id);
+ }
+ }
+
+ if (ai_binder == nullptr) {
+ return nullptr;
+ }
+
+ return grpc_binder::ndk_util::AIBinder_toJavaBinder(jni_env, ai_binder);
+}
+}
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+void* GetEndpointBinder(const std::string& service) {
+ return grpc_get_endpoint_binder(service);
+}
+
+void AddEndpointBinder(const std::string& service, void* endpoint_binder) {
+ grpc_add_endpoint_binder(service, endpoint_binder);
+}
+
+void RemoveEndpointBinder(const std::string& service) {
+ grpc_remove_endpoint_binder(service);
+}
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+static absl::flat_hash_map<std::string, void*>* g_endpoint_binder_pool =
+ nullptr;
+
+namespace {
+
+grpc_core::Mutex* GetBinderPoolMutex() {
+ static grpc_core::Mutex* mu = new grpc_core::Mutex();
+ return mu;
+}
+
+} // namespace
+
+void grpc_add_endpoint_binder(const std::string& service,
+ void* endpoint_binder) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ g_endpoint_binder_pool = new absl::flat_hash_map<std::string, void*>();
+ }
+ (*g_endpoint_binder_pool)[service] = endpoint_binder;
+}
+
+void grpc_remove_endpoint_binder(const std::string& service) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ return;
+ }
+ g_endpoint_binder_pool->erase(service);
+}
+
+void* grpc_get_endpoint_binder(const std::string& service) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ return nullptr;
+ }
+ auto iter = g_endpoint_binder_pool->find(service);
+ return iter == g_endpoint_binder_pool->end() ? nullptr : iter->second;
+}
+
+namespace grpc_core {
+
+class BinderServerListener : public Server::ListenerInterface {
+ public:
+ BinderServerListener(
+ Server* server, std::string addr, BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy)
+ : server_(server),
+ addr_(std::move(addr)),
+ factory_(std::move(factory)),
+ security_policy_(security_policy) {}
+
+ void Start(Server* /*server*/,
+ const std::vector<grpc_pollset*>* /*pollsets*/) override {
+ tx_receiver_ = factory_(
+ [this](transaction_code_t code, grpc_binder::ReadableParcel* parcel,
+ int uid) { return OnSetupTransport(code, parcel, uid); });
+ endpoint_binder_ = tx_receiver_->GetRawBinder();
+ grpc_add_endpoint_binder(addr_, endpoint_binder_);
+ }
+
+ channelz::ListenSocketNode* channelz_listen_socket_node() const override {
+ return nullptr;
+ }
+
+ void SetOnDestroyDone(grpc_closure* on_destroy_done) override {
+ on_destroy_done_ = on_destroy_done;
+ }
+
+ void Orphan() override { delete this; }
+
+ ~BinderServerListener() override {
+ ExecCtx::Get()->Flush();
+ if (on_destroy_done_) {
+ ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, GRPC_ERROR_NONE);
+ ExecCtx::Get()->Flush();
+ }
+ grpc_remove_endpoint_binder(addr_);
+ }
+
+ private:
+ absl::Status OnSetupTransport(transaction_code_t code,
+ grpc_binder::ReadableParcel* parcel, int uid) {
+ ExecCtx exec_ctx;
+ if (grpc_binder::BinderTransportTxCode(code) !=
+ grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT) {
+ return absl::InvalidArgumentError("Not a SETUP_TRANSPORT request");
+ }
+
+ gpr_log(GPR_INFO, "BinderServerListener calling uid = %d", uid);
+ if (!security_policy_->IsAuthorized(uid)) {
+ // TODO(mingcl): For now we just ignore this unauthorized
+ // SETUP_TRANSPORT transaction and ghost the client. Check if we should
+ // send back a SHUTDOWN_TRANSPORT in this case.
+ return absl::PermissionDeniedError(
+ "UID " + std::to_string(uid) +
+ " is not allowed to connect to this "
+ "server according to security policy.");
+ }
+
+ int version;
+ absl::Status status = parcel->ReadInt32(&version);
+ if (!status.ok()) {
+ return status;
+ }
+ gpr_log(GPR_INFO, "BinderTransport client protocol version = %d", version);
+ // TODO(mingcl): Make sure we only give client a version that is not newer
+ // than the version they specify. For now, we always tell client that we
+ // only support version=1.
+ std::unique_ptr<grpc_binder::Binder> client_binder{};
+ status = parcel->ReadBinder(&client_binder);
+ if (!status.ok()) {
+ return status;
+ }
+ if (!client_binder) {
+ return absl::InvalidArgumentError("NULL binder read from the parcel");
+ }
+ client_binder->Initialize();
+ // Finish the second half of SETUP_TRANSPORT in
+ // grpc_create_binder_transport_server().
+ grpc_transport* server_transport = grpc_create_binder_transport_server(
+ std::move(client_binder), security_policy_);
+ GPR_ASSERT(server_transport);
+ grpc_channel_args* args = grpc_channel_args_copy(server_->channel_args());
+ grpc_error_handle error =
+ server_->SetupTransport(server_transport, nullptr, args, nullptr);
+ grpc_channel_args_destroy(args);
+ return grpc_error_to_absl_status(error);
+ }
+
+ Server* server_;
+ grpc_closure* on_destroy_done_ = nullptr;
+ std::string addr_;
+ BinderTxReceiverFactory factory_;
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+ void* endpoint_binder_ = nullptr;
+ std::unique_ptr<grpc_binder::TransactionReceiver> tx_receiver_;
+};
+
+bool AddBinderPort(const std::string& addr, grpc_server* server,
+ BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ // TODO(mingcl): Check if the addr is valid here after binder address resolver
+ // related code are merged.
+ const std::string kBinderUriScheme = "binder:";
+ if (addr.compare(0, kBinderUriScheme.size(), kBinderUriScheme) != 0) {
+ return false;
+ }
+ std::string conn_id = addr.substr(kBinderUriScheme.size());
+ Server* core_server = Server::FromC(server);
+ core_server->AddListener(
+ OrphanablePtr<Server::ListenerInterface>(new BinderServerListener(
+ core_server, conn_id, std::move(factory), security_policy)));
+ return true;
+}
+
+} // namespace grpc_core
+#endif
diff --git a/grpc/src/core/ext/transport/binder/server/binder_server.h b/grpc/src/core/ext/transport/binder/server/binder_server.h
new file mode 100644
index 00000000..6fc1b889
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/server/binder_server.h
@@ -0,0 +1,67 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include "absl/container/flat_hash_map.h"
+#include "absl/status/status.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
+
+// TODO(waynetu): This is part of the public API and should be moved to the
+// include/ folder.
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+void* GetEndpointBinder(const std::string& service);
+void AddEndpointBinder(const std::string& service, void* endpoint_binder);
+void RemoveEndpointBinder(const std::string& service);
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+void grpc_add_endpoint_binder(const std::string& service,
+ void* endpoint_binder);
+void grpc_remove_endpoint_binder(const std::string& service);
+void* grpc_get_endpoint_binder(const std::string& service);
+
+namespace grpc_core {
+
+// Consume a callback, produce a transaction listener. This is used to perform
+// testing in non-Android environments where the actual binder is not available.
+using BinderTxReceiverFactory =
+ std::function<std::unique_ptr<grpc_binder::TransactionReceiver>(
+ grpc_binder::TransactionReceiver::OnTransactCb)>;
+
+bool AddBinderPort(const std::string& addr, grpc_server* server,
+ BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
diff --git a/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc b/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc
new file mode 100644
index 00000000..d43f928e
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/security/server_credentials.h>
+
+#include "src/core/ext/transport/binder/server/binder_server.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+
+namespace grpc {
+namespace experimental {
+
+namespace {
+
+class BinderServerCredentialsImpl final : public ServerCredentials {
+ public:
+ explicit BinderServerCredentialsImpl(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy)
+ : security_policy_(security_policy) {}
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+ int AddPortToServer(const std::string& addr, grpc_server* server) override {
+ return grpc_core::AddBinderPort(
+ std::string(addr), server,
+ [](grpc_binder::TransactionReceiver::OnTransactCb transact_cb) {
+ return absl::make_unique<grpc_binder::TransactionReceiverAndroid>(
+ nullptr, std::move(transact_cb));
+ },
+ security_policy_);
+ }
+#else
+ int AddPortToServer(const std::string& /*addr*/,
+ grpc_server* /*server*/) override {
+ return 0;
+ }
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+ void SetAuthMetadataProcessor(
+ const std::shared_ptr<AuthMetadataProcessor>& /*processor*/) override {
+ GPR_ASSERT(false);
+ }
+
+ private:
+ bool IsInsecure() const override { return true; }
+
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+};
+
+} // namespace
+
+std::shared_ptr<ServerCredentials> BinderServerCredentials(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ GPR_ASSERT(security_policy != nullptr);
+ return std::shared_ptr<ServerCredentials>(
+ new BinderServerCredentialsImpl(security_policy));
+}
+
+} // namespace experimental
+} // namespace grpc
+#endif
diff --git a/grpc/src/core/ext/transport/binder/transport/binder_stream.h b/grpc/src/core/ext/transport/binder/transport/binder_stream.h
new file mode 100644
index 00000000..b04076b1
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/transport/binder_stream.h
@@ -0,0 +1,119 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+
+struct RecvInitialMetadataArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ absl::StatusOr<grpc_binder::Metadata> initial_metadata;
+};
+
+struct RecvMessageArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ absl::StatusOr<std::string> message;
+};
+
+struct RecvTrailingMetadataArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ absl::StatusOr<grpc_binder::Metadata> trailing_metadata;
+ int status;
+};
+
+struct RegisterStreamArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+};
+
+// TODO(mingcl): Figure out if we want to use class instead of struct here
+struct grpc_binder_stream {
+ // server_data will be null for client, and for server it will be whatever
+ // passed in to the accept_stream_fn callback by client.
+ grpc_binder_stream(grpc_binder_transport* t, grpc_stream_refcount* refcount,
+ const void* /*server_data*/, grpc_core::Arena* arena,
+ int tx_code, bool is_client)
+ : t(t),
+ refcount(refcount),
+ arena(arena),
+ tx_code(tx_code),
+ is_client(is_client),
+ is_closed(false) {
+ recv_initial_metadata_args.gbs = this;
+ recv_initial_metadata_args.gbt = t;
+ recv_message_args.gbs = this;
+ recv_message_args.gbt = t;
+ recv_trailing_metadata_args.gbs = this;
+ recv_trailing_metadata_args.gbt = t;
+ }
+
+ ~grpc_binder_stream() {
+ GRPC_ERROR_UNREF(cancel_self_error);
+ if (destroy_stream_then_closure != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_then_closure,
+ GRPC_ERROR_NONE);
+ }
+ }
+
+ int GetTxCode() const { return tx_code; }
+
+ grpc_binder_transport* t;
+ grpc_stream_refcount* refcount;
+ grpc_core::Arena* arena;
+ grpc_core::ManualConstructor<grpc_core::SliceBufferByteStream> sbs;
+ int tx_code;
+ const bool is_client;
+ bool is_closed;
+
+ grpc_closure* destroy_stream_then_closure = nullptr;
+ grpc_closure destroy_stream;
+
+ // The reason why this stream is cancelled and closed.
+ grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
+
+ grpc_closure recv_initial_metadata_closure;
+ RecvInitialMetadataArgs recv_initial_metadata_args;
+ grpc_closure recv_message_closure;
+ RecvMessageArgs recv_message_args;
+ grpc_closure recv_trailing_metadata_closure;
+ RecvTrailingMetadataArgs recv_trailing_metadata_args;
+
+ grpc_closure register_stream_closure;
+ RegisterStreamArgs register_stream_args;
+
+ // We store these fields passed from op batch, in order to access them through
+ // grpc_binder_stream
+ grpc_metadata_batch* recv_initial_metadata;
+ grpc_closure* recv_initial_metadata_ready = nullptr;
+ bool* trailing_metadata_available = nullptr;
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message;
+ grpc_closure* recv_message_ready = nullptr;
+ bool* call_failed_before_recv_message = nullptr;
+ grpc_metadata_batch* recv_trailing_metadata;
+ grpc_closure* recv_trailing_metadata_finished = nullptr;
+
+ bool trailing_metadata_sent = false;
+ bool need_to_call_trailing_metadata_callback = false;
+};
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
diff --git a/grpc/src/core/ext/transport/binder/transport/binder_transport.cc b/grpc/src/core/ext/transport/binder/transport/binder_transport.cc
new file mode 100644
index 00000000..fc5e553a
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/transport/binder_transport.cc
@@ -0,0 +1,792 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/transport/binder_transport.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/substitute.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/transport/binder_stream.h"
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/byte_stream.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/transport.h"
+
+#ifndef NDEBUG
+static void grpc_binder_stream_ref(grpc_binder_stream* s, const char* reason) {
+ grpc_stream_ref(s->refcount, reason);
+}
+static void grpc_binder_stream_unref(grpc_binder_stream* s,
+ const char* reason) {
+ grpc_stream_unref(s->refcount, reason);
+}
+static void grpc_binder_ref_transport(grpc_binder_transport* t,
+ const char* reason, const char* file,
+ int line) {
+ t->refs.Ref(grpc_core::DebugLocation(file, line), reason);
+}
+static void grpc_binder_unref_transport(grpc_binder_transport* t,
+ const char* reason, const char* file,
+ int line) {
+ if (t->refs.Unref(grpc_core::DebugLocation(file, line), reason)) {
+ delete t;
+ }
+}
+#else
+static void grpc_binder_stream_ref(grpc_binder_stream* s) {
+ grpc_stream_ref(s->refcount);
+}
+static void grpc_binder_stream_unref(grpc_binder_stream* s) {
+ grpc_stream_unref(s->refcount);
+}
+static void grpc_binder_ref_transport(grpc_binder_transport* t) {
+ t->refs.Ref();
+}
+static void grpc_binder_unref_transport(grpc_binder_transport* t) {
+ if (t->refs.Unref()) {
+ delete t;
+ }
+}
+#endif
+
+#ifndef NDEBUG
+#define GRPC_BINDER_STREAM_REF(stream, reason) \
+ grpc_binder_stream_ref(stream, reason)
+#define GRPC_BINDER_STREAM_UNREF(stream, reason) \
+ grpc_binder_stream_unref(stream, reason)
+#define GRPC_BINDER_REF_TRANSPORT(t, r) \
+ grpc_binder_ref_transport(t, r, __FILE__, __LINE__)
+#define GRPC_BINDER_UNREF_TRANSPORT(t, r) \
+ grpc_binder_unref_transport(t, r, __FILE__, __LINE__)
+#else
+#define GRPC_BINDER_STREAM_REF(stream, reason) grpc_binder_stream_ref(stream)
+#define GRPC_BINDER_STREAM_UNREF(stream, reason) \
+ grpc_binder_stream_unref(stream)
+#define GRPC_BINDER_REF_TRANSPORT(t, r) grpc_binder_ref_transport(t)
+#define GRPC_BINDER_UNREF_TRANSPORT(t, r) grpc_binder_unref_transport(t)
+#endif
+
+static void register_stream_locked(void* arg, grpc_error_handle /*error*/) {
+ RegisterStreamArgs* args = static_cast<RegisterStreamArgs*>(arg);
+ args->gbt->registered_stream[args->gbs->GetTxCode()] = args->gbs;
+}
+
+static int init_stream(grpc_transport* gt, grpc_stream* gs,
+ grpc_stream_refcount* refcount, const void* server_data,
+ grpc_core::Arena* arena) {
+ GPR_TIMER_SCOPE("init_stream", 0);
+ gpr_log(GPR_INFO, "%s = %p %p %p %p %p", __func__, gt, gs, refcount,
+ server_data, arena);
+ grpc_binder_transport* t = reinterpret_cast<grpc_binder_transport*>(gt);
+ // TODO(mingcl): Figure out if we need to worry about concurrent invocation
+ // here
+ new (gs) grpc_binder_stream(t, refcount, server_data, arena,
+ t->NewStreamTxCode(), t->is_client);
+
+ // `grpc_binder_transport::registered_stream` should only be updated in
+ // combiner
+ grpc_binder_stream* gbs = reinterpret_cast<grpc_binder_stream*>(gs);
+ gbs->register_stream_args.gbs = gbs;
+ gbs->register_stream_args.gbt = t;
+ grpc_core::ExecCtx exec_ctx;
+ t->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->register_stream_closure, register_stream_locked,
+ &gbs->register_stream_args, nullptr),
+ GRPC_ERROR_NONE);
+
+ return 0;
+}
+
+static void set_pollset(grpc_transport* gt, grpc_stream* gs, grpc_pollset* gp) {
+ gpr_log(GPR_INFO, "%s = %p %p %p", __func__, gt, gs, gp);
+}
+
+static void set_pollset_set(grpc_transport*, grpc_stream*, grpc_pollset_set*) {
+ gpr_log(GPR_INFO, __func__);
+}
+
+static void AssignMetadata(grpc_metadata_batch* mb,
+ const grpc_binder::Metadata& md) {
+ mb->Clear();
+ for (auto& p : md) {
+ mb->Append(p.first, grpc_core::Slice::FromCopiedString(p.second),
+ [&](absl::string_view error, const grpc_core::Slice&) {
+ gpr_log(
+ GPR_DEBUG, "Failed to parse metadata: %s",
+ absl::StrCat("key=", p.first, " error=", error).c_str());
+ });
+ }
+}
+
+static void cancel_stream_locked(grpc_binder_transport* gbt,
+ grpc_binder_stream* gbs,
+ grpc_error_handle error) {
+ gpr_log(GPR_INFO, "cancel_stream_locked");
+ if (!gbs->is_closed) {
+ GPR_ASSERT(gbs->cancel_self_error == GRPC_ERROR_NONE);
+ gbs->is_closed = true;
+ gbs->cancel_self_error = GRPC_ERROR_REF(error);
+ gbt->transport_stream_receiver->CancelStream(gbs->tx_code);
+ gbt->registered_stream.erase(gbs->tx_code);
+ if (gbs->recv_initial_metadata_ready != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, gbs->recv_initial_metadata_ready,
+ GRPC_ERROR_REF(error));
+ gbs->recv_initial_metadata_ready = nullptr;
+ gbs->recv_initial_metadata = nullptr;
+ gbs->trailing_metadata_available = nullptr;
+ }
+ if (gbs->recv_message_ready != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, gbs->recv_message_ready,
+ GRPC_ERROR_REF(error));
+ gbs->recv_message_ready = nullptr;
+ gbs->recv_message->reset();
+ gbs->recv_message = nullptr;
+ gbs->call_failed_before_recv_message = nullptr;
+ }
+ if (gbs->recv_trailing_metadata_finished != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION,
+ gbs->recv_trailing_metadata_finished,
+ GRPC_ERROR_REF(error));
+ gbs->recv_trailing_metadata_finished = nullptr;
+ gbs->recv_trailing_metadata = nullptr;
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+static bool ContainsAuthorityAndPath(const grpc_binder::Metadata& metadata) {
+ bool has_authority = false;
+ bool has_path = false;
+ for (const auto& kv : metadata) {
+ if (kv.first == ":authority") {
+ has_authority = true;
+ }
+ if (kv.first == ":path") {
+ has_path = true;
+ }
+ }
+ return has_authority && has_path;
+}
+
+static void recv_initial_metadata_locked(void* arg,
+ grpc_error_handle /*error*/) {
+ RecvInitialMetadataArgs* args = static_cast<RecvInitialMetadataArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO,
+ "recv_initial_metadata_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_initial_metadata);
+ GPR_ASSERT(gbs->recv_initial_metadata_ready);
+ if (!args->initial_metadata.ok()) {
+ gpr_log(GPR_ERROR, "Failed to parse initial metadata");
+ return absl_status_to_grpc_error(args->initial_metadata.status());
+ }
+ if (!gbs->is_client) {
+ // For server, we expect :authority and :path in initial metadata.
+ if (!ContainsAuthorityAndPath(*args->initial_metadata)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ "Missing :authority or :path in initial metadata");
+ }
+ }
+ AssignMetadata(gbs->recv_initial_metadata, *args->initial_metadata);
+ return GRPC_ERROR_NONE;
+ }();
+
+ grpc_closure* cb = gbs->recv_initial_metadata_ready;
+ gbs->recv_initial_metadata_ready = nullptr;
+ gbs->recv_initial_metadata = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_initial_metadata");
+}
+
+static void recv_message_locked(void* arg, grpc_error_handle /*error*/) {
+ RecvMessageArgs* args = static_cast<RecvMessageArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO, "recv_message_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_message);
+ GPR_ASSERT(gbs->recv_message_ready);
+ if (!args->message.ok()) {
+ gpr_log(GPR_ERROR, "Failed to receive message");
+ if (args->message.status().message() ==
+ grpc_binder::TransportStreamReceiver::
+ kGrpcBinderTransportCancelledGracefully) {
+ gpr_log(GPR_ERROR, "message cancelled gracefully");
+ // Cancelled because we've already received trailing metadata.
+ // It's not an error in this case.
+ return GRPC_ERROR_NONE;
+ } else {
+ return absl_status_to_grpc_error(args->message.status());
+ }
+ }
+ grpc_slice_buffer buf;
+ grpc_slice_buffer_init(&buf);
+ grpc_slice_buffer_add(&buf, grpc_slice_from_cpp_string(*args->message));
+
+ gbs->sbs.Init(&buf, 0);
+ gbs->recv_message->reset(gbs->sbs.get());
+ return GRPC_ERROR_NONE;
+ }();
+
+ if (error != GRPC_ERROR_NONE &&
+ gbs->call_failed_before_recv_message != nullptr) {
+ *gbs->call_failed_before_recv_message = true;
+ }
+ grpc_closure* cb = gbs->recv_message_ready;
+ gbs->recv_message_ready = nullptr;
+ gbs->recv_message = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ }
+
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_message");
+}
+
+static void recv_trailing_metadata_locked(void* arg,
+ grpc_error_handle /*error*/) {
+ RecvTrailingMetadataArgs* args = static_cast<RecvTrailingMetadataArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO,
+ "recv_trailing_metadata_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_trailing_metadata);
+ GPR_ASSERT(gbs->recv_trailing_metadata_finished);
+ if (!args->trailing_metadata.ok()) {
+ gpr_log(GPR_ERROR, "Failed to receive trailing metadata");
+ return absl_status_to_grpc_error(args->trailing_metadata.status());
+ }
+ if (!gbs->is_client) {
+ // Client will not send non-empty trailing metadata.
+ if (!args->trailing_metadata.value().empty()) {
+ gpr_log(GPR_ERROR, "Server receives non-empty trailing metadata.");
+ return GRPC_ERROR_CANCELLED;
+ }
+ } else {
+ AssignMetadata(gbs->recv_trailing_metadata, *args->trailing_metadata);
+ // Append status to metadata
+ // TODO(b/192208695): See if we can avoid to manually put status
+ // code into the header
+ gpr_log(GPR_INFO, "status = %d", args->status);
+ gbs->recv_trailing_metadata->Set(
+ grpc_core::GrpcStatusMetadata(),
+ static_cast<grpc_status_code>(args->status));
+ }
+ return GRPC_ERROR_NONE;
+ }();
+
+ if (gbs->is_client || gbs->trailing_metadata_sent) {
+ grpc_closure* cb = gbs->recv_trailing_metadata_finished;
+ gbs->recv_trailing_metadata_finished = nullptr;
+ gbs->recv_trailing_metadata = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ } else {
+ // According to transport explaineer - "Server extra: This op shouldn't
+ // actually be considered complete until the server has also sent trailing
+ // metadata to provide the other side with final status"
+ //
+ // We haven't sent trailing metadata yet, so we have to delay completing
+ // the recv_trailing_metadata callback.
+ gbs->need_to_call_trailing_metadata_callback = true;
+ }
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_trailing_metadata");
+}
+
+namespace grpc_binder {
+namespace {
+
+class MetadataEncoder {
+ public:
+ MetadataEncoder(bool is_client, Transaction* tx, Metadata* init_md)
+ : is_client_(is_client), tx_(tx), init_md_(init_md) {}
+
+ void Encode(const grpc_core::Slice& key_slice,
+ const grpc_core::Slice& value_slice) {
+ absl::string_view key = key_slice.as_string_view();
+ absl::string_view value = value_slice.as_string_view();
+ init_md_->emplace_back(std::string(key), std::string(value));
+ }
+
+ void Encode(grpc_core::HttpPathMetadata, const grpc_core::Slice& value) {
+ // TODO(b/192208403): Figure out if it is correct to simply drop '/'
+ // prefix and treat it as rpc method name
+ GPR_ASSERT(value[0] == '/');
+ std::string path = std::string(value.as_string_view().substr(1));
+
+ // Only client send method ref.
+ GPR_ASSERT(is_client_);
+ tx_->SetMethodRef(path);
+ }
+
+ void Encode(grpc_core::GrpcStatusMetadata, grpc_status_code status) {
+ gpr_log(GPR_INFO, "send trailing metadata status = %d", status);
+ tx_->SetStatus(status);
+ }
+
+ template <typename Trait>
+ void Encode(Trait, const typename Trait::ValueType& value) {
+ init_md_->emplace_back(std::string(Trait::key()),
+ std::string(Trait::Encode(value).as_string_view()));
+ }
+
+ private:
+ const bool is_client_;
+ Transaction* const tx_;
+ Metadata* const init_md_;
+};
+
+} // namespace
+} // namespace grpc_binder
+
+static void perform_stream_op_locked(void* stream_op,
+ grpc_error_handle /*error*/) {
+ grpc_transport_stream_op_batch* op =
+ static_cast<grpc_transport_stream_op_batch*>(stream_op);
+ grpc_binder_stream* gbs =
+ static_cast<grpc_binder_stream*>(op->handler_private.extra_arg);
+ grpc_binder_transport* gbt = gbs->t;
+ if (op->cancel_stream) {
+ // TODO(waynetu): Is this true?
+ GPR_ASSERT(!op->send_initial_metadata && !op->send_message &&
+ !op->send_trailing_metadata && !op->recv_initial_metadata &&
+ !op->recv_message && !op->recv_trailing_metadata);
+ gpr_log(GPR_INFO, "cancel_stream is_client = %d", gbs->is_client);
+ if (!gbs->is_client) {
+ // Send trailing metadata to inform the other end about the cancellation,
+ // regardless if we'd already done that or not.
+ grpc_binder::Transaction cancel_tx(gbs->GetTxCode(), gbt->is_client);
+ cancel_tx.SetSuffix(grpc_binder::Metadata{});
+ cancel_tx.SetStatus(1);
+ absl::Status status = gbt->wire_writer->RpcCall(cancel_tx);
+ }
+ cancel_stream_locked(gbt, gbs, op->payload->cancel_stream.cancel_error);
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete, GRPC_ERROR_NONE);
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+ return;
+ }
+
+ if (gbs->is_closed) {
+ if (op->send_message) {
+ // Reset the send_message payload to prevent memory leaks.
+ op->payload->send_message.send_message.reset();
+ }
+ if (op->recv_initial_metadata) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->recv_message) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION,
+ op->payload->recv_message.recv_message_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->recv_trailing_metadata) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+ return;
+ }
+
+ int tx_code = gbs->tx_code;
+ grpc_binder::Transaction tx(tx_code, gbt->is_client);
+
+ if (op->send_initial_metadata) {
+ gpr_log(GPR_INFO, "send_initial_metadata");
+ grpc_binder::Metadata init_md;
+ auto batch = op->payload->send_initial_metadata.send_initial_metadata;
+
+ grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx, &init_md);
+ batch->Encode(&encoder);
+ tx.SetPrefix(init_md);
+ }
+ if (op->send_message) {
+ gpr_log(GPR_INFO, "send_message");
+ size_t remaining = op->payload->send_message.send_message->length();
+ std::string message_data;
+ while (remaining > 0) {
+ grpc_slice message_slice;
+ // TODO(waynetu): Temporarily assume that the message is ready.
+ GPR_ASSERT(
+ op->payload->send_message.send_message->Next(SIZE_MAX, nullptr));
+ grpc_error_handle error =
+ op->payload->send_message.send_message->Pull(&message_slice);
+ // TODO(waynetu): Cancel the stream if error is not GRPC_ERROR_NONE.
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ uint8_t* p = GRPC_SLICE_START_PTR(message_slice);
+ size_t len = GRPC_SLICE_LENGTH(message_slice);
+ remaining -= len;
+ message_data += std::string(reinterpret_cast<char*>(p), len);
+ grpc_slice_unref_internal(message_slice);
+ }
+ tx.SetData(message_data);
+ // TODO(b/192369787): Are we supposed to reset here to avoid
+ // use-after-free issue in call.cc?
+ op->payload->send_message.send_message.reset();
+ }
+
+ if (op->send_trailing_metadata) {
+ gpr_log(GPR_INFO, "send_trailing_metadata");
+ auto batch = op->payload->send_trailing_metadata.send_trailing_metadata;
+ grpc_binder::Metadata trailing_metadata;
+
+ grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx,
+ &trailing_metadata);
+ batch->Encode(&encoder);
+
+ // TODO(mingcl): Will we ever has key-value pair here? According to
+ // wireformat client suffix data is always empty.
+ tx.SetSuffix(trailing_metadata);
+ }
+ if (op->recv_initial_metadata) {
+ gpr_log(GPR_INFO, "recv_initial_metadata");
+ gbs->recv_initial_metadata_ready =
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ gbs->recv_initial_metadata =
+ op->payload->recv_initial_metadata.recv_initial_metadata;
+ gbs->trailing_metadata_available =
+ op->payload->recv_initial_metadata.trailing_metadata_available;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_initial_metadata");
+ gbt->transport_stream_receiver->RegisterRecvInitialMetadata(
+ tx_code, [tx_code, gbs,
+ gbt](absl::StatusOr<grpc_binder::Metadata> initial_metadata) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_initial_metadata_args.tx_code = tx_code;
+ gbs->recv_initial_metadata_args.initial_metadata =
+ std::move(initial_metadata);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_initial_metadata_closure,
+ recv_initial_metadata_locked,
+ &gbs->recv_initial_metadata_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ if (op->recv_message) {
+ gpr_log(GPR_INFO, "recv_message");
+ gbs->recv_message_ready = op->payload->recv_message.recv_message_ready;
+ gbs->recv_message = op->payload->recv_message.recv_message;
+ gbs->call_failed_before_recv_message =
+ op->payload->recv_message.call_failed_before_recv_message;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_message");
+ gbt->transport_stream_receiver->RegisterRecvMessage(
+ tx_code, [tx_code, gbs, gbt](absl::StatusOr<std::string> message) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_message_args.tx_code = tx_code;
+ gbs->recv_message_args.message = std::move(message);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_message_closure, recv_message_locked,
+ &gbs->recv_message_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ if (op->recv_trailing_metadata) {
+ gpr_log(GPR_INFO, "recv_trailing_metadata");
+ gbs->recv_trailing_metadata_finished =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ gbs->recv_trailing_metadata =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_trailing_metadata");
+ gbt->transport_stream_receiver->RegisterRecvTrailingMetadata(
+ tx_code, [tx_code, gbs, gbt](
+ absl::StatusOr<grpc_binder::Metadata> trailing_metadata,
+ int status) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_trailing_metadata_args.tx_code = tx_code;
+ gbs->recv_trailing_metadata_args.trailing_metadata =
+ std::move(trailing_metadata);
+ gbs->recv_trailing_metadata_args.status = status;
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_trailing_metadata_closure,
+ recv_trailing_metadata_locked,
+ &gbs->recv_trailing_metadata_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ // Only send transaction when there's a send op presented.
+ absl::Status status = absl::OkStatus();
+ if (op->send_initial_metadata || op->send_message ||
+ op->send_trailing_metadata) {
+ // TODO(waynetu): RpcCall() is doing a lot of work (including waiting for
+ // acknowledgements from the other side). Consider delaying this operation
+ // with combiner.
+ status = gbt->wire_writer->RpcCall(tx);
+ if (!gbs->is_client && op->send_trailing_metadata) {
+ gbs->trailing_metadata_sent = true;
+ // According to transport explaineer - "Server extra: This op shouldn't
+ // actually be considered complete until the server has also sent trailing
+ // metadata to provide the other side with final status"
+ //
+ // Because we've done sending trailing metadata here, we can safely
+ // complete the recv_trailing_metadata callback here.
+ if (gbs->need_to_call_trailing_metadata_callback) {
+ grpc_closure* cb = gbs->recv_trailing_metadata_finished;
+ gbs->recv_trailing_metadata_finished = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
+ gbs->need_to_call_trailing_metadata_callback = false;
+ }
+ }
+ }
+ // Note that this should only be scheduled when all non-recv ops are
+ // completed
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
+ absl_status_to_grpc_error(status));
+ gpr_log(GPR_INFO, "on_complete closure schuduled");
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+}
+
+static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
+ grpc_transport_stream_op_batch* op) {
+ GPR_TIMER_SCOPE("perform_stream_op", 0);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ grpc_binder_stream* gbs = reinterpret_cast<grpc_binder_stream*>(gs);
+ gpr_log(GPR_INFO, "%s = %p %p %p is_client = %d", __func__, gt, gs, op,
+ gbs->is_client);
+ GRPC_BINDER_STREAM_REF(gbs, "perform_stream_op");
+ op->handler_private.extra_arg = gbs;
+ gbt->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
+ perform_stream_op_locked, op, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void close_transport_locked(grpc_binder_transport* gbt) {
+ gbt->state_tracker.SetState(GRPC_CHANNEL_SHUTDOWN, absl::OkStatus(),
+ "transport closed due to disconnection/goaway");
+ while (!gbt->registered_stream.empty()) {
+ cancel_stream_locked(
+ gbt, gbt->registered_stream.begin()->second,
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("transport closed"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ }
+}
+
+static void perform_transport_op_locked(void* transport_op,
+ grpc_error_handle /*error*/) {
+ grpc_transport_op* op = static_cast<grpc_transport_op*>(transport_op);
+ grpc_binder_transport* gbt =
+ static_cast<grpc_binder_transport*>(op->handler_private.extra_arg);
+ // TODO(waynetu): Should we lock here to avoid data race?
+ if (op->start_connectivity_watch != nullptr) {
+ gbt->state_tracker.AddWatcher(op->start_connectivity_watch_state,
+ std::move(op->start_connectivity_watch));
+ }
+ if (op->stop_connectivity_watch != nullptr) {
+ gbt->state_tracker.RemoveWatcher(op->stop_connectivity_watch);
+ }
+ if (op->set_accept_stream) {
+ gbt->accept_stream_fn = op->set_accept_stream_fn;
+ gbt->accept_stream_user_data = op->set_accept_stream_user_data;
+ }
+ if (op->on_consumed) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
+ }
+ bool do_close = false;
+ if (op->disconnect_with_error != GRPC_ERROR_NONE) {
+ do_close = true;
+ GRPC_ERROR_UNREF(op->disconnect_with_error);
+ }
+ if (op->goaway_error != GRPC_ERROR_NONE) {
+ do_close = true;
+ GRPC_ERROR_UNREF(op->goaway_error);
+ }
+ if (do_close) {
+ close_transport_locked(gbt);
+ }
+ GRPC_BINDER_UNREF_TRANSPORT(gbt, "perform_transport_op");
+}
+
+static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ op->handler_private.extra_arg = gbt;
+ GRPC_BINDER_REF_TRANSPORT(gbt, "perform_transport_op");
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&op->handler_private.closure,
+ perform_transport_op_locked, op, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
+ grpc_binder_stream* gbs = static_cast<grpc_binder_stream*>(sp);
+ grpc_binder_transport* gbt = gbs->t;
+ cancel_stream_locked(
+ gbt, gbs,
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("destroy stream"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ gbs->~grpc_binder_stream();
+}
+
+static void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
+ grpc_closure* then_schedule_closure) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_stream* gbs = reinterpret_cast<grpc_binder_stream*>(gs);
+ gbs->destroy_stream_then_closure = then_schedule_closure;
+ gbs->t->combiner->Run(GRPC_CLOSURE_INIT(&gbs->destroy_stream,
+ destroy_stream_locked, gbs, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void destroy_transport_locked(void* gt, grpc_error_handle /*error*/) {
+ grpc_binder_transport* gbt = static_cast<grpc_binder_transport*>(gt);
+ close_transport_locked(gbt);
+ // Release the references held by the transport.
+ gbt->wire_reader = nullptr;
+ gbt->transport_stream_receiver = nullptr;
+ gbt->wire_writer = nullptr;
+ GRPC_BINDER_UNREF_TRANSPORT(gbt, "transport destroyed");
+}
+
+static void destroy_transport(grpc_transport* gt) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_CREATE(destroy_transport_locked, gbt, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static grpc_endpoint* get_endpoint(grpc_transport*) {
+ gpr_log(GPR_INFO, __func__);
+ return nullptr;
+}
+
+// See grpc_transport_vtable declaration for meaning of each field
+static const grpc_transport_vtable vtable = {sizeof(grpc_binder_stream),
+ "binder",
+ init_stream,
+ nullptr,
+ set_pollset,
+ set_pollset_set,
+ perform_stream_op,
+ perform_transport_op,
+ destroy_stream,
+ destroy_transport,
+ get_endpoint};
+
+static const grpc_transport_vtable* get_vtable() { return &vtable; }
+
+static void accept_stream_locked(void* gt, grpc_error_handle /*error*/) {
+ grpc_binder_transport* gbt = static_cast<grpc_binder_transport*>(gt);
+ if (gbt->accept_stream_fn) {
+ // must pass in a non-null value.
+ (*gbt->accept_stream_fn)(gbt->accept_stream_user_data, &gbt->base, gbt);
+ }
+}
+
+grpc_binder_transport::grpc_binder_transport(
+ std::unique_ptr<grpc_binder::Binder> binder, bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy)
+ : is_client(is_client),
+ combiner(grpc_combiner_create()),
+ state_tracker(
+ is_client ? "binder_transport_client" : "binder_transport_server",
+ GRPC_CHANNEL_READY),
+ refs(1, nullptr) {
+ gpr_log(GPR_INFO, __func__);
+ base.vtable = get_vtable();
+ GRPC_CLOSURE_INIT(&accept_stream_closure, accept_stream_locked, this,
+ nullptr);
+ transport_stream_receiver =
+ std::make_shared<grpc_binder::TransportStreamReceiverImpl>(
+ is_client, /*accept_stream_callback=*/[this] {
+ grpc_core::ExecCtx exec_ctx;
+ combiner->Run(&accept_stream_closure, GRPC_ERROR_NONE);
+ });
+ // WireReader holds a ref to grpc_binder_transport.
+ GRPC_BINDER_REF_TRANSPORT(this, "wire reader");
+ wire_reader = grpc_core::MakeOrphanable<grpc_binder::WireReaderImpl>(
+ transport_stream_receiver, is_client, security_policy,
+ /*on_destruct_callback=*/
+ [this] {
+ // Unref transport when destructed.
+ GRPC_BINDER_UNREF_TRANSPORT(this, "wire reader");
+ });
+ wire_writer = wire_reader->SetupTransport(std::move(binder));
+}
+
+grpc_binder_transport::~grpc_binder_transport() {
+ GRPC_COMBINER_UNREF(combiner, "binder_transport");
+}
+
+grpc_transport* grpc_create_binder_transport_client(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ gpr_log(GPR_INFO, __func__);
+
+ GPR_ASSERT(endpoint_binder != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ grpc_binder_transport* t = new grpc_binder_transport(
+ std::move(endpoint_binder), /*is_client=*/true, security_policy);
+
+ return &t->base;
+}
+
+grpc_transport* grpc_create_binder_transport_server(
+ std::unique_ptr<grpc_binder::Binder> client_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ gpr_log(GPR_INFO, __func__);
+
+ GPR_ASSERT(client_binder != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ grpc_binder_transport* t = new grpc_binder_transport(
+ std::move(client_binder), /*is_client=*/false, security_policy);
+
+ return &t->base;
+}
+#endif
diff --git a/grpc/src/core/ext/transport/binder/transport/binder_transport.h b/grpc/src/core/ext/transport/binder/transport/binder_transport.h
new file mode 100644
index 00000000..8cad2d5d
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/transport/binder_transport.h
@@ -0,0 +1,95 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "absl/container/flat_hash_map.h"
+
+#include <grpc/support/log.h>
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/transport/transport.h"
+#include "src/core/lib/transport/transport_impl.h"
+
+struct grpc_binder_stream;
+
+// TODO(mingcl): Consider putting the struct in a namespace (Eventually this
+// depends on what style we want to follow)
+// TODO(mingcl): Decide casing for this class name. Should we use C-style class
+// name here or just go with C++ style?
+struct grpc_binder_transport {
+ explicit grpc_binder_transport(
+ std::unique_ptr<grpc_binder::Binder> binder, bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+ ~grpc_binder_transport();
+
+ int NewStreamTxCode() {
+ // TODO(mingcl): Wrap around when all tx codes are used. "If we do detect a
+ // collision however, we will fail the new call with UNAVAILABLE, and shut
+ // down the transport gracefully."
+ GPR_ASSERT(next_free_tx_code <= LAST_CALL_TRANSACTION);
+ return next_free_tx_code++;
+ }
+
+ grpc_transport base; /* must be first */
+
+ std::shared_ptr<grpc_binder::TransportStreamReceiver>
+ transport_stream_receiver;
+ grpc_core::OrphanablePtr<grpc_binder::WireReader> wire_reader;
+ std::shared_ptr<grpc_binder::WireWriter> wire_writer;
+
+ bool is_client;
+ // A set of currently registered streams (the key is the stream ID).
+ absl::flat_hash_map<int, grpc_binder_stream*> registered_stream;
+ grpc_core::Combiner* combiner;
+
+ grpc_closure accept_stream_closure;
+
+ // The callback and the data for the callback when the stream is connected
+ // between client and server.
+ void (*accept_stream_fn)(void* user_data, grpc_transport* transport,
+ const void* server_data) = nullptr;
+ void* accept_stream_user_data = nullptr;
+
+ grpc_core::ConnectivityStateTracker state_tracker;
+ grpc_core::RefCount refs;
+
+ private:
+ int next_free_tx_code = grpc_binder::kFirstCallId;
+};
+
+grpc_transport* grpc_create_binder_transport_client(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+grpc_transport* grpc_create_binder_transport_server(
+ std::unique_ptr<grpc_binder::Binder> client_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
diff --git a/grpc/src/core/ext/transport/binder/utils/binder_auto_utils.h b/grpc/src/core/ext/transport/binder/utils/binder_auto_utils.h
new file mode 100644
index 00000000..2317b5b1
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/binder_auto_utils.h
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_UTILS_BINDER_AUTO_UTILS_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_BINDER_AUTO_UTILS_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+
+namespace grpc_binder {
+namespace ndk_util {
+
+/**
+ * Represents one strong pointer to an AIBinder object.
+ * Copied from binder/ndk/include_cpp/android/binder_auto_utils.h
+ */
+class SpAIBinder {
+ public:
+ SpAIBinder() : mBinder(nullptr) {}
+ explicit SpAIBinder(AIBinder* binder) : mBinder(binder) {}
+ SpAIBinder(std::nullptr_t)
+ : SpAIBinder() {} // NOLINT(google-explicit-constructor)
+ SpAIBinder(const SpAIBinder& other) { *this = other; }
+
+ ~SpAIBinder() { set(nullptr); }
+ SpAIBinder& operator=(const SpAIBinder& other) {
+ if (this == &other) {
+ return *this;
+ }
+ AIBinder_incStrong(other.mBinder);
+ set(other.mBinder);
+ return *this;
+ }
+
+ void set(AIBinder* binder) {
+ AIBinder* old = *const_cast<AIBinder* volatile*>(&mBinder);
+ if (old != nullptr) AIBinder_decStrong(old);
+ if (old != *const_cast<AIBinder* volatile*>(&mBinder)) {
+ __assert(__FILE__, __LINE__, "Race detected.");
+ }
+ mBinder = binder;
+ }
+
+ AIBinder* get() const { return mBinder; }
+ AIBinder** getR() { return &mBinder; }
+
+ bool operator!=(const SpAIBinder& rhs) const { return get() != rhs.get(); }
+ bool operator<(const SpAIBinder& rhs) const { return get() < rhs.get(); }
+ bool operator<=(const SpAIBinder& rhs) const { return get() <= rhs.get(); }
+ bool operator==(const SpAIBinder& rhs) const { return get() == rhs.get(); }
+ bool operator>(const SpAIBinder& rhs) const { return get() > rhs.get(); }
+ bool operator>=(const SpAIBinder& rhs) const { return get() >= rhs.get(); }
+
+ private:
+ AIBinder* mBinder = nullptr;
+};
+} // namespace ndk_util
+} // namespace grpc_binder
+
+#endif
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_BINDER_AUTO_UTILS_H
diff --git a/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc b/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc
new file mode 100644
index 00000000..f5aafc05
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc
@@ -0,0 +1,220 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/utils/ndk_binder.h"
+
+#ifndef GRPC_NO_BINDER
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <dlfcn.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/tls.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace {
+void* GetNdkBinderHandle() {
+ // TODO(mingcl): Consider using RTLD_NOLOAD to check if it is already loaded
+ // first
+ static void* handle = dlopen("libbinder_ndk.so", RTLD_LAZY);
+ if (handle == nullptr) {
+ gpr_log(
+ GPR_ERROR,
+ "Cannot open libbinder_ndk.so. Does this device support API level 29?");
+ GPR_ASSERT(0);
+ }
+ return handle;
+}
+
+JavaVM* g_jvm = nullptr;
+grpc_core::Mutex g_jvm_mu;
+
+// Whether the thread has already attached to JVM (this is to prevent
+// repeated attachment in `AttachJvm()`)
+GPR_THREAD_LOCAL(bool) g_is_jvm_attached = false;
+
+void SetJvm(JNIEnv* env) {
+ // OK to lock here since this function will only be called once for each
+ // connection.
+ grpc_core::MutexLock lock(&g_jvm_mu);
+ if (g_jvm != nullptr) {
+ return;
+ }
+ JavaVM* jvm = nullptr;
+ jint error = env->GetJavaVM(&jvm);
+ if (error != JNI_OK) {
+ gpr_log(GPR_ERROR, "Failed to get JVM");
+ }
+ g_jvm = jvm;
+ gpr_log(GPR_INFO, "JVM cached");
+}
+
+// `SetJvm` need to be called in the process before `AttachJvm`. This is always
+// the case because one of `AIBinder_fromJavaBinder`/`AIBinder_toJavaBinder`
+// will be called before we actually uses the binder. Return `false` if not able
+// to attach to JVM. Return `true` if JVM is attached (or already attached).
+bool AttachJvm() {
+ if (g_is_jvm_attached) {
+ return true;
+ }
+ // Note: The following code would be run at most once per thread.
+ grpc_core::MutexLock lock(&g_jvm_mu);
+ if (g_jvm == nullptr) {
+ gpr_log(GPR_ERROR, "JVM not cached yet");
+ return false;
+ }
+ JNIEnv* env_unused;
+ // Note that attach a thread that is already attached is a no-op, so it is
+ // fine to call this again if the thread has already been attached by other.
+ g_jvm->AttachCurrentThread(&env_unused, /* thr_args= */ nullptr);
+ gpr_log(GPR_INFO, "JVM attached successfully");
+ g_is_jvm_attached = true;
+ return true;
+}
+
+} // namespace
+
+namespace grpc_binder {
+namespace ndk_util {
+
+// Helper macro to obtain the function pointer corresponding to the name
+#define FORWARD(name) \
+ typedef decltype(&name) func_type; \
+ static func_type ptr = \
+ reinterpret_cast<func_type>(dlsym(GetNdkBinderHandle(), #name)); \
+ if (ptr == nullptr) { \
+ gpr_log(GPR_ERROR, \
+ "dlsym failed. Cannot find %s in libbinder_ndk.so. " \
+ "BinderTransport requires API level >= 33", \
+ #name); \
+ GPR_ASSERT(0); \
+ } \
+ return ptr
+
+void AIBinder_Class_disableInterfaceTokenHeader(AIBinder_Class* clazz) {
+ FORWARD(AIBinder_Class_disableInterfaceTokenHeader)(clazz);
+}
+
+void* AIBinder_getUserData(AIBinder* binder) {
+ FORWARD(AIBinder_getUserData)(binder);
+}
+
+uid_t AIBinder_getCallingUid() { FORWARD(AIBinder_getCallingUid)(); }
+
+AIBinder* AIBinder_fromJavaBinder(JNIEnv* env, jobject binder) {
+ SetJvm(env);
+ FORWARD(AIBinder_fromJavaBinder)(env, binder);
+}
+
+AIBinder_Class* AIBinder_Class_define(const char* interfaceDescriptor,
+ AIBinder_Class_onCreate onCreate,
+ AIBinder_Class_onDestroy onDestroy,
+ AIBinder_Class_onTransact onTransact) {
+ FORWARD(AIBinder_Class_define)
+ (interfaceDescriptor, onCreate, onDestroy, onTransact);
+}
+
+AIBinder* AIBinder_new(const AIBinder_Class* clazz, void* args) {
+ FORWARD(AIBinder_new)(clazz, args);
+}
+
+bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz) {
+ FORWARD(AIBinder_associateClass)(binder, clazz);
+}
+
+void AIBinder_incStrong(AIBinder* binder) {
+ FORWARD(AIBinder_incStrong)(binder);
+}
+
+void AIBinder_decStrong(AIBinder* binder) {
+ FORWARD(AIBinder_decStrong)(binder);
+}
+
+binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code,
+ AParcel** in, AParcel** out,
+ binder_flags_t flags) {
+ if (!AttachJvm()) {
+ gpr_log(GPR_ERROR, "failed to attach JVM. AIBinder_transact might fail.");
+ }
+ FORWARD(AIBinder_transact)(binder, code, in, out, flags);
+}
+
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteArrayAllocator allocator) {
+ FORWARD(AParcel_readByteArray)(parcel, arrayData, allocator);
+}
+
+void AParcel_delete(AParcel* parcel) { FORWARD(AParcel_delete)(parcel); }
+int32_t AParcel_getDataSize(const AParcel* parcel) {
+ FORWARD(AParcel_getDataSize)(parcel);
+}
+
+binder_status_t AParcel_writeInt32(AParcel* parcel, int32_t value) {
+ FORWARD(AParcel_writeInt32)(parcel, value);
+}
+
+binder_status_t AParcel_writeInt64(AParcel* parcel, int64_t value) {
+ FORWARD(AParcel_writeInt64)(parcel, value);
+}
+
+binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) {
+ FORWARD(AParcel_writeStrongBinder)(parcel, binder);
+}
+
+binder_status_t AParcel_writeString(AParcel* parcel, const char* string,
+ int32_t length) {
+ FORWARD(AParcel_writeString)(parcel, string, length);
+}
+
+binder_status_t AParcel_readInt32(const AParcel* parcel, int32_t* value) {
+ FORWARD(AParcel_readInt32)(parcel, value);
+}
+
+binder_status_t AParcel_readInt64(const AParcel* parcel, int64_t* value) {
+ FORWARD(AParcel_readInt64)(parcel, value);
+}
+
+binder_status_t AParcel_readString(const AParcel* parcel, void* stringData,
+ AParcel_stringAllocator allocator) {
+ FORWARD(AParcel_readString)(parcel, stringData, allocator);
+}
+
+binder_status_t AParcel_readStrongBinder(const AParcel* parcel,
+ AIBinder** binder) {
+ FORWARD(AParcel_readStrongBinder)(parcel, binder);
+}
+
+binder_status_t AParcel_writeByteArray(AParcel* parcel, const int8_t* arrayData,
+ int32_t length) {
+ FORWARD(AParcel_writeByteArray)(parcel, arrayData, length);
+}
+
+binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) {
+ FORWARD(AIBinder_prepareTransaction)(binder, in);
+}
+
+jobject AIBinder_toJavaBinder(JNIEnv* env, AIBinder* binder) {
+ SetJvm(env);
+ FORWARD(AIBinder_toJavaBinder)(env, binder);
+}
+
+} // namespace ndk_util
+} // namespace grpc_binder
+
+#endif
+#endif
diff --git a/grpc/src/core/ext/transport/binder/utils/ndk_binder.h b/grpc/src/core/ext/transport/binder/utils/ndk_binder.h
new file mode 100644
index 00000000..25ebb80c
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/ndk_binder.h
@@ -0,0 +1,107 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <assert.h>
+#include <jni.h>
+
+#include <memory>
+
+// This file defines NdkBinder functions, variables, and types in
+// grpc_binder::ndk_util namespace. This allows us to dynamically load
+// libbinder_ndk at runtime, and make it possible to compile the code without
+// the library present at compile time.
+
+// TODO(mingcl): Consider if we want to check API level and include NDK headers
+// normally if the level is high enough
+
+namespace grpc_binder {
+namespace ndk_util {
+
+struct AIBinder;
+struct AParcel;
+struct AIBinder_Class;
+
+// Only enum values used by the project is defined here
+enum {
+ FLAG_ONEWAY = 0x01,
+};
+enum {
+ STATUS_OK = 0,
+ STATUS_UNKNOWN_ERROR = (-2147483647 - 1),
+};
+
+typedef int32_t binder_status_t;
+typedef uint32_t binder_flags_t;
+typedef uint32_t transaction_code_t;
+
+typedef bool (*AParcel_byteArrayAllocator)(void* arrayData, int32_t length,
+ int8_t** outBuffer);
+typedef bool (*AParcel_stringAllocator)(void* stringData, int32_t length,
+ char** buffer);
+typedef void* (*AIBinder_Class_onCreate)(void* args);
+typedef void (*AIBinder_Class_onDestroy)(void* userData);
+typedef binder_status_t (*AIBinder_Class_onTransact)(AIBinder* binder,
+ transaction_code_t code,
+ const AParcel* in,
+ AParcel* out);
+
+void AIBinder_Class_disableInterfaceTokenHeader(AIBinder_Class* clazz);
+void* AIBinder_getUserData(AIBinder* binder);
+uid_t AIBinder_getCallingUid();
+AIBinder* AIBinder_fromJavaBinder(JNIEnv* env, jobject binder);
+AIBinder_Class* AIBinder_Class_define(const char* interfaceDescriptor,
+ AIBinder_Class_onCreate onCreate,
+ AIBinder_Class_onDestroy onDestroy,
+ AIBinder_Class_onTransact onTransact);
+AIBinder* AIBinder_new(const AIBinder_Class* clazz, void* args);
+bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz);
+void AIBinder_incStrong(AIBinder* binder);
+void AIBinder_decStrong(AIBinder* binder);
+binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code,
+ AParcel** in, AParcel** out,
+ binder_flags_t flags);
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteArrayAllocator allocator);
+void AParcel_delete(AParcel* parcel);
+int32_t AParcel_getDataSize(const AParcel* parcel);
+binder_status_t AParcel_writeInt32(AParcel* parcel, int32_t value);
+binder_status_t AParcel_writeInt64(AParcel* parcel, int64_t value);
+binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder);
+binder_status_t AParcel_writeString(AParcel* parcel, const char* string,
+ int32_t length);
+binder_status_t AParcel_readInt32(const AParcel* parcel, int32_t* value);
+binder_status_t AParcel_readInt64(const AParcel* parcel, int64_t* value);
+binder_status_t AParcel_readString(const AParcel* parcel, void* stringData,
+ AParcel_stringAllocator allocator);
+binder_status_t AParcel_readStrongBinder(const AParcel* parcel,
+ AIBinder** binder);
+binder_status_t AParcel_writeByteArray(AParcel* parcel, const int8_t* arrayData,
+ int32_t length);
+binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in);
+jobject AIBinder_toJavaBinder(JNIEnv* env, AIBinder* binder);
+
+} // namespace ndk_util
+
+} // namespace grpc_binder
+
+#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
diff --git a/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h
new file mode 100644
index 00000000..b9991a00
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h
@@ -0,0 +1,71 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <string>
+#include <vector>
+
+#include "absl/status/statusor.h"
+
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+
+namespace grpc_binder {
+
+typedef int StreamIdentifier;
+
+class TransportStreamReceiver {
+ public:
+ virtual ~TransportStreamReceiver() = default;
+
+ using InitialMetadataCallbackType =
+ std::function<void(absl::StatusOr<Metadata>)>;
+ using MessageDataCallbackType =
+ std::function<void(absl::StatusOr<std::string>)>;
+ using TrailingMetadataCallbackType =
+ std::function<void(absl::StatusOr<Metadata>, int)>;
+
+ // Only handles single time invocation. Callback object will be deleted.
+ // The callback should be valid until invocation or unregister.
+ virtual void RegisterRecvInitialMetadata(StreamIdentifier id,
+ InitialMetadataCallbackType cb) = 0;
+ virtual void RegisterRecvMessage(StreamIdentifier id,
+ MessageDataCallbackType cb) = 0;
+ virtual void RegisterRecvTrailingMetadata(
+ StreamIdentifier id, TrailingMetadataCallbackType cb) = 0;
+
+ // For the following functions, the second arguments are the transaction
+ // result received from the lower level. If it is None, that means there's
+ // something wrong when receiving the corresponding transaction. In such case,
+ // we should cancel the gRPC callback as well.
+ virtual void NotifyRecvInitialMetadata(
+ StreamIdentifier id, absl::StatusOr<Metadata> initial_metadata) = 0;
+ virtual void NotifyRecvMessage(StreamIdentifier id,
+ absl::StatusOr<std::string> message) = 0;
+ virtual void NotifyRecvTrailingMetadata(
+ StreamIdentifier id, absl::StatusOr<Metadata> trailing_metadata,
+ int status) = 0;
+ // Remove all entries associated with stream number `id`.
+ virtual void CancelStream(StreamIdentifier id) = 0;
+
+ static const absl::string_view kGrpcBinderTransportCancelledGracefully;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
diff --git a/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
new file mode 100644
index 00000000..d7cbf7a2
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
@@ -0,0 +1,255 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/utils/transport_stream_receiver_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <functional>
+#include <string>
+#include <utility>
+
+#include <grpc/support/log.h>
+
+namespace grpc_binder {
+
+const absl::string_view
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully =
+ "grpc-binder-transport: cancelled gracefully";
+
+void TransportStreamReceiverImpl::RegisterRecvInitialMetadata(
+ StreamIdentifier id, InitialMetadataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ absl::StatusOr<Metadata> initial_metadata{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(initial_metadata_cbs_.count(id) == 0);
+ auto iter = pending_initial_metadata_.find(id);
+ if (iter == pending_initial_metadata_.end()) {
+ if (trailing_metadata_recvd_.count(id)) {
+ cb(absl::CancelledError(""));
+ } else {
+ initial_metadata_cbs_[id] = std::move(cb);
+ }
+ cb = nullptr;
+ } else {
+ initial_metadata = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_initial_metadata_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(initial_metadata));
+ }
+}
+
+void TransportStreamReceiverImpl::RegisterRecvMessage(
+ StreamIdentifier id, MessageDataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ absl::StatusOr<std::string> message{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(message_cbs_.count(id) == 0);
+ auto iter = pending_message_.find(id);
+ if (iter == pending_message_.end()) {
+ // If we'd already received trailing-metadata and there's no pending
+ // messages, cancel the callback.
+ if (trailing_metadata_recvd_.count(id)) {
+ cb(absl::CancelledError(
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully));
+ } else {
+ message_cbs_[id] = std::move(cb);
+ }
+ cb = nullptr;
+ } else {
+ // We'll still keep all pending messages received before the trailing
+ // metadata since they're issued before the end of stream, as promised by
+ // WireReader which keeps transactions commit in-order.
+ message = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_message_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(message));
+ }
+}
+
+void TransportStreamReceiverImpl::RegisterRecvTrailingMetadata(
+ StreamIdentifier id, TrailingMetadataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ std::pair<absl::StatusOr<Metadata>, int> trailing_metadata{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(trailing_metadata_cbs_.count(id) == 0);
+ auto iter = pending_trailing_metadata_.find(id);
+ if (iter == pending_trailing_metadata_.end()) {
+ trailing_metadata_cbs_[id] = std::move(cb);
+ cb = nullptr;
+ } else {
+ trailing_metadata = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_trailing_metadata_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(trailing_metadata.first), trailing_metadata.second);
+ }
+}
+
+void TransportStreamReceiverImpl::NotifyRecvInitialMetadata(
+ StreamIdentifier id, absl::StatusOr<Metadata> initial_metadata) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ if (!is_client_ && accept_stream_callback_ && initial_metadata.ok()) {
+ accept_stream_callback_();
+ }
+ InitialMetadataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = initial_metadata_cbs_.find(id);
+ if (iter != initial_metadata_cbs_.end()) {
+ cb = iter->second;
+ initial_metadata_cbs_.erase(iter);
+ } else {
+ pending_initial_metadata_[id].push(std::move(initial_metadata));
+ return;
+ }
+ }
+ cb(std::move(initial_metadata));
+}
+
+void TransportStreamReceiverImpl::NotifyRecvMessage(
+ StreamIdentifier id, absl::StatusOr<std::string> message) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ MessageDataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = message_cbs_.find(id);
+ if (iter != message_cbs_.end()) {
+ cb = iter->second;
+ message_cbs_.erase(iter);
+ } else {
+ pending_message_[id].push(std::move(message));
+ return;
+ }
+ }
+ cb(std::move(message));
+}
+
+void TransportStreamReceiverImpl::NotifyRecvTrailingMetadata(
+ StreamIdentifier id, absl::StatusOr<Metadata> trailing_metadata,
+ int status) {
+ // Trailing metadata mark the end of the stream. Since TransportStreamReceiver
+ // assumes in-order commitments of transactions and that trailing metadata is
+ // parsed after message data, we can safely cancel all upcoming callbacks of
+ // recv_message.
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ OnRecvTrailingMetadata(id);
+ TrailingMetadataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = trailing_metadata_cbs_.find(id);
+ if (iter != trailing_metadata_cbs_.end()) {
+ cb = iter->second;
+ trailing_metadata_cbs_.erase(iter);
+ } else {
+ pending_trailing_metadata_[id].emplace(std::move(trailing_metadata),
+ status);
+ return;
+ }
+ }
+ cb(std::move(trailing_metadata), status);
+}
+
+void TransportStreamReceiverImpl::CancelInitialMetadataCallback(
+ StreamIdentifier id, absl::Status error) {
+ InitialMetadataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = initial_metadata_cbs_.find(id);
+ if (iter != initial_metadata_cbs_.end()) {
+ callback = std::move(iter->second);
+ initial_metadata_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error);
+ }
+}
+
+void TransportStreamReceiverImpl::CancelMessageCallback(StreamIdentifier id,
+ absl::Status error) {
+ MessageDataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = message_cbs_.find(id);
+ if (iter != message_cbs_.end()) {
+ callback = std::move(iter->second);
+ message_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error);
+ }
+}
+
+void TransportStreamReceiverImpl::CancelTrailingMetadataCallback(
+ StreamIdentifier id, absl::Status error) {
+ TrailingMetadataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = trailing_metadata_cbs_.find(id);
+ if (iter != trailing_metadata_cbs_.end()) {
+ callback = std::move(iter->second);
+ trailing_metadata_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error, 0);
+ }
+}
+
+void TransportStreamReceiverImpl::OnRecvTrailingMetadata(StreamIdentifier id) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ m_.Lock();
+ trailing_metadata_recvd_.insert(id);
+ m_.Unlock();
+ CancelInitialMetadataCallback(id, absl::CancelledError(""));
+ CancelMessageCallback(
+ id,
+ absl::CancelledError(
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully));
+}
+
+void TransportStreamReceiverImpl::CancelStream(StreamIdentifier id) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ CancelInitialMetadataCallback(id, absl::CancelledError("Stream cancelled"));
+ CancelMessageCallback(id, absl::CancelledError("Stream cancelled"));
+ CancelTrailingMetadataCallback(id, absl::CancelledError("Stream cancelled"));
+ grpc_core::MutexLock l(&m_);
+ trailing_metadata_recvd_.erase(id);
+ pending_initial_metadata_.erase(id);
+ pending_message_.erase(id);
+ pending_trailing_metadata_.erase(id);
+}
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
new file mode 100644
index 00000000..ffafaf43
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
@@ -0,0 +1,112 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <map>
+#include <queue>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// Routes the data received from transport to corresponding streams
+class TransportStreamReceiverImpl : public TransportStreamReceiver {
+ public:
+ explicit TransportStreamReceiverImpl(
+ bool is_client, std::function<void()> accept_stream_callback = nullptr)
+ : is_client_(is_client),
+ accept_stream_callback_(accept_stream_callback) {}
+ void RegisterRecvInitialMetadata(StreamIdentifier id,
+ InitialMetadataCallbackType cb) override;
+ void RegisterRecvMessage(StreamIdentifier id,
+ MessageDataCallbackType cb) override;
+ void RegisterRecvTrailingMetadata(StreamIdentifier id,
+ TrailingMetadataCallbackType cb) override;
+ void NotifyRecvInitialMetadata(
+ StreamIdentifier id, absl::StatusOr<Metadata> initial_metadata) override;
+ void NotifyRecvMessage(StreamIdentifier id,
+ absl::StatusOr<std::string> message) override;
+ void NotifyRecvTrailingMetadata(StreamIdentifier id,
+ absl::StatusOr<Metadata> trailing_metadata,
+ int status) override;
+
+ void CancelStream(StreamIdentifier id) override;
+
+ private:
+ // Trailing metadata marks the end of one-side of the stream. Thus, after
+ // receiving trailing metadata from the other-end, we know that there will
+ // never be in-coming message data anymore, and all recv_message callbacks
+ // (as well as recv_initial_metadata callback, if there's any) registered will
+ // never be satisfied. This function cancels all such callbacks gracefully
+ // (with GRPC_ERROR_NONE) to avoid being blocked waiting for them.
+ void OnRecvTrailingMetadata(StreamIdentifier id);
+
+ void CancelInitialMetadataCallback(StreamIdentifier id, absl::Status error);
+ void CancelMessageCallback(StreamIdentifier id, absl::Status error);
+ void CancelTrailingMetadataCallback(StreamIdentifier id, absl::Status error);
+
+ std::map<StreamIdentifier, InitialMetadataCallbackType> initial_metadata_cbs_;
+ std::map<StreamIdentifier, MessageDataCallbackType> message_cbs_;
+ std::map<StreamIdentifier, TrailingMetadataCallbackType>
+ trailing_metadata_cbs_;
+ // TODO(waynetu): Better thread safety design. For example, use separate
+ // mutexes for different type of messages.
+ grpc_core::Mutex m_;
+ // TODO(waynetu): gRPC surface layer will not wait for the current message to
+ // be delivered before sending the next message. The following implementation
+ // is still buggy with the current implementation of wire writer if
+ // transaction issued first completes after the one issued later does. This is
+ // because we just take the first element out of the queue and assume it's the
+ // one issued first without further checking, which results in callbacks being
+ // invoked with incorrect data.
+ //
+ // This should be fixed in the wire writer level and make sure out-of-order
+ // messages will be re-ordered by it. In such case, the queueing approach will
+ // work fine. Refer to the TODO in WireWriterImpl::ProcessTransaction() at
+ // wire_reader_impl.cc for detecting and resolving out-of-order transactions.
+ //
+ // TODO(waynetu): Use absl::flat_hash_map.
+ std::map<StreamIdentifier, std::queue<absl::StatusOr<Metadata>>>
+ pending_initial_metadata_ ABSL_GUARDED_BY(m_);
+ std::map<StreamIdentifier, std::queue<absl::StatusOr<std::string>>>
+ pending_message_ ABSL_GUARDED_BY(m_);
+ std::map<StreamIdentifier,
+ std::queue<std::pair<absl::StatusOr<Metadata>, int>>>
+ pending_trailing_metadata_ ABSL_GUARDED_BY(m_);
+ // Record whether or not the recv_message callbacks of a given stream is
+ // cancelled. Although we explicitly cancel the registered recv_message() in
+ // CancelRecvMessageCallbacksDueToTrailingMetadata(), there are chances that
+ // the registration comes "after" we receive trailing metadata. Therefore,
+ // when RegisterRecvMessage() gets called, we should check whether
+ // recv_message_cancelled_ contains the corresponding stream ID, and if so,
+ // directly cancel the callback gracefully without pending it.
+ std::set<StreamIdentifier> trailing_metadata_recvd_ ABSL_GUARDED_BY(m_);
+
+ bool is_client_;
+ // Called when receiving initial metadata to inform the server about a new
+ // stream.
+ std::function<void()> accept_stream_callback_;
+};
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/binder.h b/grpc/src/core/ext/transport/binder/wire_format/binder.h
new file mode 100644
index 00000000..493df44c
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/binder.h
@@ -0,0 +1,105 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <string>
+
+#include "absl/status/status.h"
+#include "absl/strings/string_view.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder_constants.h"
+#include "src/core/lib/gprpp/orphanable.h"
+
+namespace grpc_binder {
+
+class HasRawBinder {
+ public:
+ virtual ~HasRawBinder() = default;
+ virtual void* GetRawBinder() = 0;
+};
+
+class Binder;
+
+// TODO(waynetu): We might need other methods as well.
+// TODO(waynetu): Find a better way to express the returned status than
+// binder_status_t.
+class WritableParcel {
+ public:
+ virtual ~WritableParcel() = default;
+ virtual int32_t GetDataSize() const = 0;
+ virtual absl::Status WriteInt32(int32_t data) = 0;
+ virtual absl::Status WriteInt64(int64_t data) = 0;
+ virtual absl::Status WriteBinder(HasRawBinder* binder) = 0;
+ virtual absl::Status WriteString(absl::string_view s) = 0;
+ virtual absl::Status WriteByteArray(const int8_t* buffer, int32_t length) = 0;
+
+ absl::Status WriteByteArrayWithLength(absl::string_view buffer) {
+ absl::Status status = WriteInt32(buffer.length());
+ if (!status.ok()) return status;
+ if (buffer.empty()) return absl::OkStatus();
+ return WriteByteArray(reinterpret_cast<const int8_t*>(buffer.data()),
+ buffer.length());
+ }
+};
+
+// TODO(waynetu): We might need other methods as well.
+// TODO(waynetu): Find a better way to express the returned status than
+// binder_status_t.
+class ReadableParcel {
+ public:
+ virtual ~ReadableParcel() = default;
+ virtual int32_t GetDataSize() const = 0;
+ virtual absl::Status ReadInt32(int32_t* data) = 0;
+ virtual absl::Status ReadInt64(int64_t* data) = 0;
+ virtual absl::Status ReadBinder(std::unique_ptr<Binder>* data) = 0;
+ virtual absl::Status ReadByteArray(std::string* data) = 0;
+ virtual absl::Status ReadString(std::string* str) = 0;
+};
+
+class TransactionReceiver : public HasRawBinder {
+ public:
+ using OnTransactCb =
+ std::function<absl::Status(transaction_code_t, ReadableParcel*, int uid)>;
+
+ ~TransactionReceiver() override = default;
+};
+
+class WireReader;
+
+class Binder : public HasRawBinder {
+ public:
+ ~Binder() override = default;
+
+ virtual void Initialize() = 0;
+ virtual absl::Status PrepareTransaction() = 0;
+ virtual absl::Status Transact(BinderTransportTxCode tx_code) = 0;
+
+ virtual WritableParcel* GetWritableParcel() const = 0;
+
+ // TODO(waynetu): Can we decouple the receiver from the binder?
+ virtual std::unique_ptr<TransactionReceiver> ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc b/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc
new file mode 100644
index 00000000..bba8616d
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc
@@ -0,0 +1,310 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <map>
+
+#include "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+namespace {
+
+struct BinderUserData {
+ explicit BinderUserData(grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb* callback)
+ : wire_reader_ref(wire_reader_ref), callback(callback) {}
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref;
+ TransactionReceiver::OnTransactCb* callback;
+};
+
+struct OnCreateArgs {
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref;
+ TransactionReceiver::OnTransactCb* callback;
+};
+
+void* f_onCreate_userdata(void* data) {
+ auto* args = static_cast<OnCreateArgs*>(data);
+ return new BinderUserData(args->wire_reader_ref, args->callback);
+}
+
+void f_onDestroy_delete(void* data) {
+ auto* user_data = static_cast<BinderUserData*>(data);
+ delete user_data;
+}
+
+void* f_onCreate_noop(void* /*args*/) { return nullptr; }
+void f_onDestroy_noop(void* /*userData*/) {}
+
+// TODO(mingcl): Consider if thread safety is a requirement here
+ndk_util::binder_status_t f_onTransact(ndk_util::AIBinder* binder,
+ transaction_code_t code,
+ const ndk_util::AParcel* in,
+ ndk_util::AParcel* /*out*/) {
+ gpr_log(GPR_INFO, __func__);
+ gpr_log(GPR_INFO, "tx code = %u", code);
+
+ auto* user_data =
+ static_cast<BinderUserData*>(ndk_util::AIBinder_getUserData(binder));
+ TransactionReceiver::OnTransactCb* callback = user_data->callback;
+ // Wrap the parcel in a ReadableParcel.
+ std::unique_ptr<ReadableParcel> output =
+ absl::make_unique<ReadableParcelAndroid>(in);
+ // The lock should be released "after" the callback finishes.
+ absl::Status status =
+ (*callback)(code, output.get(), ndk_util::AIBinder_getCallingUid());
+ if (status.ok()) {
+ return ndk_util::STATUS_OK;
+ } else {
+ gpr_log(GPR_ERROR, "Callback failed: %s", status.ToString().c_str());
+ return ndk_util::STATUS_UNKNOWN_ERROR;
+ }
+}
+
+// StdStringAllocator, ReadString, StdVectorAllocator, and ReadVector's
+// implementations are copied from android/binder_parcel_utils.h
+// We cannot include the header because it does not compile in C++11
+
+bool StdStringAllocator(void* stringData, int32_t length, char** buffer) {
+ if (length <= 0) return false;
+
+ std::string* str = static_cast<std::string*>(stringData);
+ str->resize(static_cast<size_t>(length) - 1);
+ *buffer = &(*str)[0];
+ return true;
+}
+
+ndk_util::binder_status_t AParcelReadString(const ndk_util::AParcel* parcel,
+ std::string* str) {
+ void* stringData = static_cast<void*>(str);
+ return ndk_util::AParcel_readString(parcel, stringData, StdStringAllocator);
+}
+
+template <typename T>
+bool StdVectorAllocator(void* vectorData, int32_t length, T** outBuffer) {
+ if (length < 0) return false;
+
+ std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
+ if (static_cast<size_t>(length) > vec->max_size()) return false;
+
+ vec->resize(static_cast<size_t>(length));
+ *outBuffer = vec->data();
+ return true;
+}
+
+ndk_util::binder_status_t AParcelReadVector(const ndk_util::AParcel* parcel,
+ std::vector<uint8_t>* vec) {
+ void* vectorData = static_cast<void*>(vec);
+ return ndk_util::AParcel_readByteArray(parcel, vectorData,
+ StdVectorAllocator<int8_t>);
+}
+
+} // namespace
+
+ndk_util::SpAIBinder FromJavaBinder(JNIEnv* jni_env, jobject binder) {
+ return ndk_util::SpAIBinder(
+ ndk_util::AIBinder_fromJavaBinder(jni_env, binder));
+}
+
+TransactionReceiverAndroid::TransactionReceiverAndroid(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ OnTransactCb transact_cb)
+ : transact_cb_(transact_cb) {
+ // TODO(mingcl): For now interface descriptor is always empty, figure out if
+ // we want it to be something more meaningful (we can probably manually change
+ // interface descriptor by modifying Java code's reply to
+ // os.IBinder.INTERFACE_TRANSACTION)
+ ndk_util::AIBinder_Class* aibinder_class = ndk_util::AIBinder_Class_define(
+ /*interfaceDescriptor=*/"", f_onCreate_userdata, f_onDestroy_delete,
+ f_onTransact);
+
+ ndk_util::AIBinder_Class_disableInterfaceTokenHeader(aibinder_class);
+
+ // Pass the on-transact callback to the on-create function of the binder. The
+ // on-create function equips the callback with a mutex and gives it to the
+ // user data stored in the binder which can be retrieved later.
+ // Also Ref() (called implicitly by the copy constructor of RefCountedPtr) the
+ // wire reader so that it would not be destructed during the callback
+ // invocation.
+ OnCreateArgs args;
+ args.wire_reader_ref = wire_reader_ref;
+ args.callback = &transact_cb_;
+ binder_ = ndk_util::AIBinder_new(aibinder_class, &args);
+ GPR_ASSERT(binder_);
+ gpr_log(GPR_INFO, "ndk_util::AIBinder_associateClass = %d",
+ static_cast<int>(
+ ndk_util::AIBinder_associateClass(binder_, aibinder_class)));
+}
+
+TransactionReceiverAndroid::~TransactionReceiverAndroid() {
+ // Release the binder.
+ ndk_util::AIBinder_decStrong(binder_);
+}
+
+namespace {
+
+ndk_util::binder_status_t f_onTransact_noop(ndk_util::AIBinder* /*binder*/,
+ transaction_code_t /*code*/,
+ const ndk_util::AParcel* /*in*/,
+ ndk_util::AParcel* /*out*/) {
+ return {};
+}
+
+void AssociateWithNoopClass(ndk_util::AIBinder* binder) {
+ // Need to associate class before using it
+ ndk_util::AIBinder_Class* aibinder_class = ndk_util::AIBinder_Class_define(
+ "", f_onCreate_noop, f_onDestroy_noop, f_onTransact_noop);
+
+ ndk_util::AIBinder_Class_disableInterfaceTokenHeader(aibinder_class);
+
+ gpr_log(GPR_INFO, "ndk_util::AIBinder_associateClass = %d",
+ static_cast<int>(
+ ndk_util::AIBinder_associateClass(binder, aibinder_class)));
+}
+
+} // namespace
+
+void BinderAndroid::Initialize() {
+ ndk_util::AIBinder* binder = binder_.get();
+ AssociateWithNoopClass(binder);
+}
+
+absl::Status BinderAndroid::PrepareTransaction() {
+ ndk_util::AIBinder* binder = binder_.get();
+ return ndk_util::AIBinder_prepareTransaction(
+ binder, &input_parcel_->parcel_) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError(
+ "ndk_util::AIBinder_prepareTransaction failed");
+}
+
+absl::Status BinderAndroid::Transact(BinderTransportTxCode tx_code) {
+ ndk_util::AIBinder* binder = binder_.get();
+ // We only do one-way transaction and thus the output parcel is never used.
+ ndk_util::AParcel* unused_output_parcel;
+ absl::Status result =
+ (ndk_util::AIBinder_transact(
+ binder, static_cast<transaction_code_t>(tx_code),
+ &input_parcel_->parcel_, &unused_output_parcel,
+ ndk_util::FLAG_ONEWAY) == ndk_util::STATUS_OK)
+ ? absl::OkStatus()
+ : absl::InternalError("ndk_util::AIBinder_transact failed");
+ ndk_util::AParcel_delete(unused_output_parcel);
+ return result;
+}
+
+std::unique_ptr<TransactionReceiver> BinderAndroid::ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const {
+ return absl::make_unique<TransactionReceiverAndroid>(wire_reader_ref,
+ transact_cb);
+}
+
+int32_t WritableParcelAndroid::GetDataSize() const {
+ return ndk_util::AParcel_getDataSize(parcel_);
+}
+
+absl::Status WritableParcelAndroid::WriteInt32(int32_t data) {
+ return ndk_util::AParcel_writeInt32(parcel_, data) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_writeInt32 failed");
+}
+
+absl::Status WritableParcelAndroid::WriteInt64(int64_t data) {
+ return ndk_util::AParcel_writeInt64(parcel_, data) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_writeInt64 failed");
+}
+
+absl::Status WritableParcelAndroid::WriteBinder(HasRawBinder* binder) {
+ return ndk_util::AParcel_writeStrongBinder(
+ parcel_, reinterpret_cast<ndk_util::AIBinder*>(
+ binder->GetRawBinder())) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_writeStrongBinder failed");
+}
+
+absl::Status WritableParcelAndroid::WriteString(absl::string_view s) {
+ return ndk_util::AParcel_writeString(parcel_, s.data(), s.length()) ==
+ ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_writeString failed");
+}
+
+absl::Status WritableParcelAndroid::WriteByteArray(const int8_t* buffer,
+ int32_t length) {
+ return ndk_util::AParcel_writeByteArray(parcel_, buffer, length) ==
+ ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_writeByteArray failed");
+}
+
+int32_t ReadableParcelAndroid::GetDataSize() const {
+ return ndk_util::AParcel_getDataSize(parcel_);
+}
+
+absl::Status ReadableParcelAndroid::ReadInt32(int32_t* data) {
+ return ndk_util::AParcel_readInt32(parcel_, data) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_readInt32 failed");
+}
+
+absl::Status ReadableParcelAndroid::ReadInt64(int64_t* data) {
+ return ndk_util::AParcel_readInt64(parcel_, data) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_readInt64 failed");
+}
+
+absl::Status ReadableParcelAndroid::ReadBinder(std::unique_ptr<Binder>* data) {
+ ndk_util::AIBinder* binder;
+ if (AParcel_readStrongBinder(parcel_, &binder) != ndk_util::STATUS_OK) {
+ *data = nullptr;
+ return absl::InternalError("AParcel_readStrongBinder failed");
+ }
+ *data = absl::make_unique<BinderAndroid>(ndk_util::SpAIBinder(binder));
+ return absl::OkStatus();
+}
+
+absl::Status ReadableParcelAndroid::ReadByteArray(std::string* data) {
+ std::vector<uint8_t> vec;
+ if (AParcelReadVector(parcel_, &vec) == ndk_util::STATUS_OK) {
+ data->resize(vec.size());
+ if (!vec.empty()) {
+ memcpy(&((*data)[0]), vec.data(), vec.size());
+ }
+ return absl::OkStatus();
+ }
+ return absl::InternalError("AParcel_readByteArray failed");
+}
+
+absl::Status ReadableParcelAndroid::ReadString(std::string* str) {
+ return AParcelReadString(parcel_, str) == ndk_util::STATUS_OK
+ ? absl::OkStatus()
+ : absl::InternalError("AParcel_readString failed");
+}
+
+} // namespace grpc_binder
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+#endif
diff --git a/grpc/src/core/ext/transport/binder/wire_format/binder_android.h b/grpc/src/core/ext/transport/binder/wire_format/binder_android.h
new file mode 100644
index 00000000..774bc09b
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/binder_android.h
@@ -0,0 +1,122 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <jni.h>
+
+#include <memory>
+
+#include "absl/memory/memory.h"
+
+#include "src/core/ext/transport/binder/utils/binder_auto_utils.h"
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+
+namespace grpc_binder {
+
+ndk_util::SpAIBinder FromJavaBinder(JNIEnv* jni_env, jobject binder);
+
+class BinderAndroid;
+
+class WritableParcelAndroid final : public WritableParcel {
+ public:
+ WritableParcelAndroid() = default;
+ explicit WritableParcelAndroid(ndk_util::AParcel* parcel) : parcel_(parcel) {}
+ ~WritableParcelAndroid() override = default;
+
+ int32_t GetDataSize() const override;
+ absl::Status WriteInt32(int32_t data) override;
+ absl::Status WriteInt64(int64_t data) override;
+ absl::Status WriteBinder(HasRawBinder* binder) override;
+ absl::Status WriteString(absl::string_view s) override;
+ absl::Status WriteByteArray(const int8_t* buffer, int32_t length) override;
+
+ private:
+ ndk_util::AParcel* parcel_ = nullptr;
+
+ friend class BinderAndroid;
+};
+
+class ReadableParcelAndroid final : public ReadableParcel {
+ public:
+ ReadableParcelAndroid() = default;
+ // TODO(waynetu): Get rid of the const_cast.
+ explicit ReadableParcelAndroid(const ndk_util::AParcel* parcel)
+ : parcel_(parcel) {}
+ ~ReadableParcelAndroid() override = default;
+
+ int32_t GetDataSize() const override;
+ absl::Status ReadInt32(int32_t* data) override;
+ absl::Status ReadInt64(int64_t* data) override;
+ absl::Status ReadBinder(std::unique_ptr<Binder>* data) override;
+ absl::Status ReadByteArray(std::string* data) override;
+ absl::Status ReadString(std::string* str) override;
+
+ private:
+ const ndk_util::AParcel* parcel_ = nullptr;
+
+ friend class BinderAndroid;
+};
+
+class BinderAndroid final : public Binder {
+ public:
+ explicit BinderAndroid(ndk_util::SpAIBinder binder)
+ : binder_(binder),
+ input_parcel_(absl::make_unique<WritableParcelAndroid>()) {}
+ ~BinderAndroid() override = default;
+
+ void* GetRawBinder() override { return binder_.get(); }
+
+ void Initialize() override;
+ absl::Status PrepareTransaction() override;
+ absl::Status Transact(BinderTransportTxCode tx_code) override;
+
+ WritableParcel* GetWritableParcel() const override {
+ return input_parcel_.get();
+ }
+
+ std::unique_ptr<TransactionReceiver> ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const override;
+
+ private:
+ ndk_util::SpAIBinder binder_;
+ std::unique_ptr<WritableParcelAndroid> input_parcel_;
+};
+
+class TransactionReceiverAndroid final : public TransactionReceiver {
+ public:
+ TransactionReceiverAndroid(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ OnTransactCb transaction_cb);
+ ~TransactionReceiverAndroid() override;
+ void* GetRawBinder() override { return binder_; }
+
+ private:
+ ndk_util::AIBinder* binder_;
+ OnTransactCb transact_cb_;
+};
+
+} // namespace grpc_binder
+
+#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc b/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc
new file mode 100644
index 00000000..42048bdb
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc
@@ -0,0 +1,29 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/wire_format/binder_constants.h"
+
+const int FIRST_CALL_TRANSACTION = 0x00000001;
+const int LAST_CALL_TRANSACTION = 0x00FFFFFF;
+
+namespace grpc_binder {
+
+const int kFirstCallId = FIRST_CALL_TRANSACTION + 1000;
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h b/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h
new file mode 100644
index 00000000..5479f1af
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+
+#include "absl/base/attributes.h"
+
+using transaction_code_t = uint32_t;
+
+ABSL_CONST_INIT extern const int FIRST_CALL_TRANSACTION;
+ABSL_CONST_INIT extern const int LAST_CALL_TRANSACTION;
+
+namespace grpc_binder {
+
+enum class BinderTransportTxCode {
+ SETUP_TRANSPORT = 1,
+ SHUTDOWN_TRANSPORT = 2,
+ ACKNOWLEDGE_BYTES = 3,
+ PING = 4,
+ PING_RESPONSE = 5,
+};
+
+ABSL_CONST_INIT extern const int kFirstCallId;
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/transaction.cc b/grpc/src/core/ext/transport/binder/wire_format/transaction.cc
new file mode 100644
index 00000000..939b5574
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/transaction.cc
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+
+namespace grpc_binder {
+
+const int kFlagPrefix = 0x1;
+const int kFlagMessageData = 0x2;
+const int kFlagSuffix = 0x4;
+const int kFlagOutOfBandClose = 0x8;
+const int kFlagExpectSingleMessage = 0x10;
+const int kFlagStatusDescription = 0x20;
+const int kFlagMessageDataIsParcelable = 0x40;
+const int kFlagMessageDataIsPartial = 0x80;
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/wire_format/transaction.h b/grpc/src/core/ext/transport/binder/wire_format/transaction.h
new file mode 100644
index 00000000..eb6d1805
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/transaction.h
@@ -0,0 +1,102 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+#include <vector>
+
+#include "absl/strings/string_view.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_binder {
+
+ABSL_CONST_INIT extern const int kFlagPrefix;
+ABSL_CONST_INIT extern const int kFlagMessageData;
+ABSL_CONST_INIT extern const int kFlagSuffix;
+ABSL_CONST_INIT extern const int kFlagOutOfBandClose;
+ABSL_CONST_INIT extern const int kFlagExpectSingleMessage;
+ABSL_CONST_INIT extern const int kFlagStatusDescription;
+ABSL_CONST_INIT extern const int kFlagMessageDataIsParcelable;
+ABSL_CONST_INIT extern const int kFlagMessageDataIsPartial;
+
+using Metadata = std::vector<std::pair<std::string, std::string>>;
+
+class Transaction {
+ public:
+ Transaction(int tx_code, bool is_client)
+ : tx_code_(tx_code), is_client_(is_client) {}
+ // TODO(mingcl): Consider using string_view
+ void SetPrefix(Metadata prefix_metadata) {
+ prefix_metadata_ = prefix_metadata;
+ GPR_ASSERT((flags_ & kFlagPrefix) == 0);
+ flags_ |= kFlagPrefix;
+ }
+ void SetMethodRef(std::string method_ref) {
+ GPR_ASSERT(is_client_);
+ method_ref_ = method_ref;
+ }
+ void SetData(std::string message_data) {
+ message_data_ = message_data;
+ GPR_ASSERT((flags_ & kFlagMessageData) == 0);
+ flags_ |= kFlagMessageData;
+ }
+ void SetSuffix(Metadata suffix_metadata) {
+ if (is_client_) GPR_ASSERT(suffix_metadata.empty());
+ suffix_metadata_ = suffix_metadata;
+ GPR_ASSERT((flags_ & kFlagSuffix) == 0);
+ flags_ |= kFlagSuffix;
+ }
+ void SetStatusDescription(std::string status_desc) {
+ GPR_ASSERT(!is_client_);
+ GPR_ASSERT((flags_ & kFlagStatusDescription) == 0);
+ status_desc_ = status_desc;
+ }
+ void SetStatus(int status) {
+ GPR_ASSERT(!is_client_);
+ GPR_ASSERT((flags_ >> 16) == 0);
+ GPR_ASSERT(status < (1 << 16));
+ flags_ |= (status << 16);
+ }
+
+ bool IsClient() const { return is_client_; }
+ bool IsServer() const { return !is_client_; }
+ int GetTxCode() const { return tx_code_; }
+ int GetFlags() const { return flags_; }
+
+ absl::string_view GetMethodRef() const { return method_ref_; }
+ const Metadata& GetPrefixMetadata() const { return prefix_metadata_; }
+ const Metadata& GetSuffixMetadata() const { return suffix_metadata_; }
+ absl::string_view GetMessageData() const { return message_data_; }
+ absl::string_view GetStatusDesc() const { return status_desc_; }
+
+ private:
+ int tx_code_;
+ bool is_client_;
+ Metadata prefix_metadata_;
+ Metadata suffix_metadata_;
+ std::string method_ref_;
+ std::string message_data_;
+ std::string status_desc_;
+
+ int flags_ = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h b/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h
new file mode 100644
index 00000000..8a5068eb
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h
@@ -0,0 +1,38 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/gprpp/orphanable.h"
+
+namespace grpc_binder {
+
+class WireReader : public grpc_core::InternallyRefCounted<WireReader> {
+ public:
+ ~WireReader() override = default;
+ virtual std::shared_ptr<WireWriter> SetupTransport(
+ std::unique_ptr<Binder> endpoint_binder) = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc b/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
new file mode 100644
index 00000000..fbce4162
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
@@ -0,0 +1,409 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/wire_format/wire_reader_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <functional>
+#include <limits>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "absl/memory/memory.h"
+#include "absl/status/statusor.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+
+#define RETURN_IF_ERROR(expr) \
+ do { \
+ const absl::Status status = (expr); \
+ if (!status.ok()) return status; \
+ } while (0)
+
+namespace grpc_binder {
+namespace {
+
+const int32_t kWireFormatVersion = 1;
+const char kAuthorityMetadataKey[] = ":authority";
+
+absl::StatusOr<Metadata> parse_metadata(ReadableParcel* reader) {
+ int num_header;
+ RETURN_IF_ERROR(reader->ReadInt32(&num_header));
+ gpr_log(GPR_INFO, "num_header = %d", num_header);
+ if (num_header < 0) {
+ return absl::InvalidArgumentError("num_header cannot be negative");
+ }
+ std::vector<std::pair<std::string, std::string>> ret;
+ for (int i = 0; i < num_header; i++) {
+ int count;
+ RETURN_IF_ERROR(reader->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ std::string key{};
+ if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&key));
+ gpr_log(GPR_INFO, "key = %s", key.c_str());
+ RETURN_IF_ERROR(reader->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ std::string value{};
+ if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&value));
+ gpr_log(GPR_INFO, "value = %s", value.c_str());
+ ret.emplace_back(key, value);
+ }
+ return ret;
+}
+
+} // namespace
+
+WireReaderImpl::WireReaderImpl(
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver,
+ bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ std::function<void()> on_destruct_callback)
+ : transport_stream_receiver_(std::move(transport_stream_receiver)),
+ is_client_(is_client),
+ security_policy_(security_policy),
+ on_destruct_callback_(on_destruct_callback) {}
+
+WireReaderImpl::~WireReaderImpl() {
+ if (on_destruct_callback_) {
+ on_destruct_callback_();
+ }
+}
+
+std::shared_ptr<WireWriter> WireReaderImpl::SetupTransport(
+ std::unique_ptr<Binder> binder) {
+ gpr_log(GPR_INFO, "Setting up transport");
+ if (!is_client_) {
+ SendSetupTransport(binder.get());
+ {
+ grpc_core::MutexLock lock(&mu_);
+ connected_ = true;
+ wire_writer_ = std::make_shared<WireWriterImpl>(std::move(binder));
+ }
+ return wire_writer_;
+ } else {
+ SendSetupTransport(binder.get());
+ auto other_end_binder = RecvSetupTransport();
+ {
+ grpc_core::MutexLock lock(&mu_);
+ connected_ = true;
+ wire_writer_ =
+ std::make_shared<WireWriterImpl>(std::move(other_end_binder));
+ }
+ return wire_writer_;
+ }
+}
+
+void WireReaderImpl::SendSetupTransport(Binder* binder) {
+ binder->Initialize();
+ gpr_log(GPR_INFO, "prepare transaction = %d",
+ binder->PrepareTransaction().ok());
+ WritableParcel* writable_parcel = binder->GetWritableParcel();
+ gpr_log(GPR_INFO, "write int32 = %d",
+ writable_parcel->WriteInt32(kWireFormatVersion).ok());
+ // The lifetime of the transaction receiver is the same as the wire writer's.
+ // The transaction receiver is responsible for not calling the on-transact
+ // callback when it's dead.
+ // Give TransactionReceiver a Ref() since WireReader cannot be destructed
+ // during callback execution. TransactionReceiver should make sure that the
+ // callback owns a Ref() when it's being invoked.
+ tx_receiver_ = binder->ConstructTxReceiver(
+ /*wire_reader_ref=*/Ref(),
+ [this](transaction_code_t code, ReadableParcel* readable_parcel,
+ int uid) {
+ return this->ProcessTransaction(code, readable_parcel, uid);
+ });
+
+ gpr_log(GPR_INFO, "tx_receiver = %p", tx_receiver_->GetRawBinder());
+ gpr_log(GPR_INFO, "AParcel_writeStrongBinder = %d",
+ writable_parcel->WriteBinder(tx_receiver_.get()).ok());
+ gpr_log(GPR_INFO, "AIBinder_transact = %d",
+ binder->Transact(BinderTransportTxCode::SETUP_TRANSPORT).ok());
+}
+
+std::unique_ptr<Binder> WireReaderImpl::RecvSetupTransport() {
+ // TODO(b/191941760): avoid blocking, handle wire_writer_noti lifetime
+ // better
+ gpr_log(GPR_INFO, "start waiting for noti");
+ connection_noti_.WaitForNotification();
+ gpr_log(GPR_INFO, "end waiting for noti");
+ return std::move(other_end_binder_);
+}
+
+absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code,
+ ReadableParcel* parcel,
+ int uid) {
+ gpr_log(GPR_INFO, __func__);
+ gpr_log(GPR_INFO, "tx code = %u", code);
+ if (code >= static_cast<unsigned>(kFirstCallId)) {
+ gpr_log(GPR_INFO, "This is probably a Streaming Tx");
+ return ProcessStreamingTransaction(code, parcel);
+ }
+
+ if (!(code >= static_cast<transaction_code_t>(
+ BinderTransportTxCode::SETUP_TRANSPORT) &&
+ code <= static_cast<transaction_code_t>(
+ BinderTransportTxCode::PING_RESPONSE))) {
+ gpr_log(GPR_INFO,
+ "Received unknown control message. Shutdown transport gracefully.");
+ // TODO(waynetu): Shutdown transport gracefully.
+ return absl::OkStatus();
+ }
+
+ grpc_core::MutexLock lock(&mu_);
+
+ if (BinderTransportTxCode(code) != BinderTransportTxCode::SETUP_TRANSPORT &&
+ !connected_) {
+ return absl::InvalidArgumentError("Transports not connected yet");
+ }
+
+ // TODO(mingcl): See if we want to check the security policy for every RPC
+ // call or just during transport setup.
+
+ switch (BinderTransportTxCode(code)) {
+ case BinderTransportTxCode::SETUP_TRANSPORT: {
+ if (recvd_setup_transport_) {
+ return absl::InvalidArgumentError(
+ "Already received a SETUP_TRANSPORT request");
+ }
+ recvd_setup_transport_ = true;
+
+ gpr_log(GPR_ERROR, "calling uid = %d", uid);
+ if (!security_policy_->IsAuthorized(uid)) {
+ return absl::PermissionDeniedError(
+ "UID " + std::to_string(uid) +
+ " is not allowed to connect to this "
+ "transport according to security policy.");
+ }
+
+ int version;
+ RETURN_IF_ERROR(parcel->ReadInt32(&version));
+ gpr_log(GPR_INFO, "The other end respond with version = %d", version);
+ // We only support this single lowest possible version, so server must
+ // respond that version too.
+ if (version != kWireFormatVersion) {
+ gpr_log(GPR_ERROR,
+ "The other end respond with version = %d, but we requested "
+ "version %d, trying to continue anyway",
+ version, kWireFormatVersion);
+ }
+ std::unique_ptr<Binder> binder{};
+ RETURN_IF_ERROR(parcel->ReadBinder(&binder));
+ if (!binder) {
+ return absl::InternalError("Read NULL binder from the parcel");
+ }
+ binder->Initialize();
+ other_end_binder_ = std::move(binder);
+ connection_noti_.Notify();
+ break;
+ }
+ case BinderTransportTxCode::SHUTDOWN_TRANSPORT: {
+ gpr_log(GPR_ERROR,
+ "Received SHUTDOWN_TRANSPORT request but not implemented yet.");
+ return absl::UnimplementedError("SHUTDOWN_TRANSPORT");
+ }
+ case BinderTransportTxCode::ACKNOWLEDGE_BYTES: {
+ int64_t num_bytes = -1;
+ RETURN_IF_ERROR(parcel->ReadInt64(&num_bytes));
+ gpr_log(GPR_INFO, "received acknowledge bytes = %lld",
+ static_cast<long long>(num_bytes));
+ wire_writer_->OnAckReceived(num_bytes);
+ break;
+ }
+ case BinderTransportTxCode::PING: {
+ if (is_client_) {
+ return absl::FailedPreconditionError("Receive PING request in client");
+ }
+ int ping_id = -1;
+ RETURN_IF_ERROR(parcel->ReadInt32(&ping_id));
+ gpr_log(GPR_INFO, "received ping id = %d", ping_id);
+ // TODO(waynetu): Ping back.
+ break;
+ }
+ case BinderTransportTxCode::PING_RESPONSE: {
+ int value = -1;
+ RETURN_IF_ERROR(parcel->ReadInt32(&value));
+ gpr_log(GPR_INFO, "received ping response = %d", value);
+ break;
+ }
+ }
+ return absl::OkStatus();
+}
+
+absl::Status WireReaderImpl::ProcessStreamingTransaction(
+ transaction_code_t code, ReadableParcel* parcel) {
+ grpc_core::MutexLock lock(&mu_);
+ if (!connected_) {
+ return absl::InvalidArgumentError("Transports not connected yet");
+ }
+
+ // Indicate which callbacks should be cancelled. It will be initialized as the
+ // flags the in-coming transaction carries, and when a particular callback is
+ // completed, the corresponding bit in cancellation_flag will be set to 0 so
+ // that we won't cancel it afterward.
+ int cancellation_flags = 0;
+ absl::Status status =
+ ProcessStreamingTransactionImpl(code, parcel, &cancellation_flags);
+ if (!status.ok()) {
+ gpr_log(GPR_ERROR, "Failed to process streaming transaction: %s",
+ status.ToString().c_str());
+ // Something went wrong when receiving transaction. Cancel failed requests.
+ if (cancellation_flags & kFlagPrefix) {
+ gpr_log(GPR_INFO, "cancelling initial metadata");
+ transport_stream_receiver_->NotifyRecvInitialMetadata(code, status);
+ }
+ if (cancellation_flags & kFlagMessageData) {
+ gpr_log(GPR_INFO, "cancelling message data");
+ transport_stream_receiver_->NotifyRecvMessage(code, status);
+ }
+ if (cancellation_flags & kFlagSuffix) {
+ gpr_log(GPR_INFO, "cancelling trailing metadata");
+ transport_stream_receiver_->NotifyRecvTrailingMetadata(code, status, 0);
+ }
+ }
+ if ((num_incoming_bytes_ - num_acknowledged_bytes_) >= kFlowControlAckBytes) {
+ GPR_ASSERT(wire_writer_);
+ absl::Status ack_status = wire_writer_->SendAck(num_incoming_bytes_);
+ if (status.ok()) {
+ status = ack_status;
+ }
+ num_acknowledged_bytes_ = num_incoming_bytes_;
+ }
+ return status;
+}
+
+absl::Status WireReaderImpl::ProcessStreamingTransactionImpl(
+ transaction_code_t code, ReadableParcel* parcel, int* cancellation_flags) {
+ GPR_ASSERT(cancellation_flags);
+ num_incoming_bytes_ += parcel->GetDataSize();
+
+ int flags;
+ RETURN_IF_ERROR(parcel->ReadInt32(&flags));
+ gpr_log(GPR_INFO, "flags = %d", flags);
+ *cancellation_flags = flags;
+
+ // Ignore in-coming transaction with flag = 0 to match with Java
+ // implementation.
+ // TODO(waynetu): Check with grpc-java team to see whether this is the
+ // intended behavior.
+ // TODO(waynetu): What should be returned here?
+ if (flags == 0) {
+ gpr_log(GPR_INFO, "[WARNING] Receive empty transaction. Ignored.");
+ return absl::OkStatus();
+ }
+
+ int status = flags >> 16;
+ gpr_log(GPR_INFO, "status = %d", status);
+ gpr_log(GPR_INFO, "FLAG_PREFIX = %d", (flags & kFlagPrefix));
+ gpr_log(GPR_INFO, "FLAG_MESSAGE_DATA = %d", (flags & kFlagMessageData));
+ gpr_log(GPR_INFO, "FLAG_SUFFIX = %d", (flags & kFlagSuffix));
+ int seq_num;
+ RETURN_IF_ERROR(parcel->ReadInt32(&seq_num));
+ // TODO(waynetu): For now we'll just assume that the transactions commit in
+ // the same order they're issued. The following assertion detects
+ // out-of-order or missing transactions. WireReaderImpl should be fixed if
+ // we indeed found such behavior.
+ int32_t& expectation = expected_seq_num_[code];
+ if (seq_num < 0 || seq_num != expectation) {
+ // Unexpected sequence number.
+ return absl::InternalError("Unexpected sequence number");
+ }
+ // TODO(waynetu): According to the protocol, "The sequence number will wrap
+ // around to 0 if more than 2^31 messages are sent." For now we'll just
+ // assert that it never reach such circumstances.
+ GPR_ASSERT(expectation < std::numeric_limits<int32_t>::max() &&
+ "Sequence number too large");
+ expectation++;
+ gpr_log(GPR_INFO, "sequence number = %d", seq_num);
+ if (flags & kFlagPrefix) {
+ std::string method_ref;
+ if (!is_client_) {
+ RETURN_IF_ERROR(parcel->ReadString(&method_ref));
+ }
+ absl::StatusOr<Metadata> initial_metadata_or_error = parse_metadata(parcel);
+ if (!initial_metadata_or_error.ok()) {
+ return initial_metadata_or_error.status();
+ }
+ if (!is_client_) {
+ // In BinderChannel wireformat specification, path is not encoded as part
+ // of metadata. So we extract the path and turn it into metadata here
+ // (this is what core API layer expects).
+ initial_metadata_or_error->emplace_back(":path",
+ std::string("/") + method_ref);
+ // Since authority metadata is not part of BinderChannel wireformat
+ // specification, and gRPC core API layer expects the presence of
+ // authority for message sent from client to server, we add one if
+ // missing (it will be missing if client grpc-java).
+ bool has_authority = false;
+ for (const auto& p : *initial_metadata_or_error) {
+ if (p.first == kAuthorityMetadataKey) has_authority = true;
+ }
+ if (!has_authority) {
+ initial_metadata_or_error->emplace_back(kAuthorityMetadataKey,
+ "binder.authority");
+ }
+ }
+ transport_stream_receiver_->NotifyRecvInitialMetadata(
+ code, *initial_metadata_or_error);
+ *cancellation_flags &= ~kFlagPrefix;
+ }
+ if (flags & kFlagMessageData) {
+ int count;
+ RETURN_IF_ERROR(parcel->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ std::string msg_data{};
+ if (count > 0) {
+ RETURN_IF_ERROR(parcel->ReadByteArray(&msg_data));
+ }
+ gpr_log(GPR_INFO, "msg_data = %s", msg_data.c_str());
+ message_buffer_[code] += msg_data;
+ if ((flags & kFlagMessageDataIsPartial) == 0) {
+ std::string s = std::move(message_buffer_[code]);
+ message_buffer_.erase(code);
+ transport_stream_receiver_->NotifyRecvMessage(code, std::move(s));
+ }
+ *cancellation_flags &= ~kFlagMessageData;
+ }
+ if (flags & kFlagSuffix) {
+ if (flags & kFlagStatusDescription) {
+ // FLAG_STATUS_DESCRIPTION set
+ std::string desc;
+ RETURN_IF_ERROR(parcel->ReadString(&desc));
+ gpr_log(GPR_INFO, "description = %s", desc.c_str());
+ }
+ Metadata trailing_metadata;
+ if (is_client_) {
+ absl::StatusOr<Metadata> trailing_metadata_or_error =
+ parse_metadata(parcel);
+ if (!trailing_metadata_or_error.ok()) {
+ return trailing_metadata_or_error.status();
+ }
+ trailing_metadata = *trailing_metadata_or_error;
+ }
+ transport_stream_receiver_->NotifyRecvTrailingMetadata(
+ code, std::move(trailing_metadata), status);
+ *cancellation_flags &= ~kFlagSuffix;
+ }
+ return absl::OkStatus();
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h b/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h
new file mode 100644
index 00000000..24043ac1
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h
@@ -0,0 +1,137 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "absl/container/flat_hash_map.h"
+#include "absl/synchronization/notification.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+
+namespace grpc_binder {
+
+class WireReaderImpl : public WireReader {
+ public:
+ WireReaderImpl(
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver,
+ bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy,
+ std::function<void()> on_destruct_callback = nullptr);
+ ~WireReaderImpl() override;
+
+ void Orphan() override { Unref(); }
+
+ /// Setup the transport between endpoint binders.
+ ///
+ /// The client and the server both call SetupTransport() when constructing
+ /// transport.
+ ///
+ /// High-level overview of transaction setup:
+ /// 0. Client obtains an |endpoint_binder| from the server (in the Android
+ /// setting, this can be achieved by "binding" to the server APK).
+ /// 1. Client creates a binder |client_binder| and hook its on-transaction
+ /// callback to client's ProcessTransaction(). Client then sends
+ /// |client_binder| through |endpoint_binder| to server.
+ /// 2. Server receives |client_binder| via |endpoint_binder|.
+ /// 3. Server creates a binder |server_binder| and hook its on-transaction
+ /// callback to server's ProcessTransaction(). Server then sends
+ /// |server_binder| through |client_binder| back to the client.
+ /// 4. Client receives |server_binder| via |client_binder|'s on-transaction
+ /// callback.
+ ///
+ /// The parameter \p binder here means different things for client nad server.
+ /// For client, \p binder refers to |endpoint_binder|, and for server, \p
+ /// binder refers to |client_binder|. That is, for server-side transport
+ /// setup, we assume that the first half of SETUP_TRANSPORT (up to step 2) is
+ /// already done somewhere else (see test/end2end/binder_transport_test.cc for
+ /// how it's handled in the testing environment).
+ std::shared_ptr<WireWriter> SetupTransport(
+ std::unique_ptr<Binder> binder) override;
+
+ absl::Status ProcessTransaction(transaction_code_t code,
+ ReadableParcel* parcel, int uid);
+
+ /// Send SETUP_TRANSPORT request through \p binder.
+ ///
+ /// This is the one half (for client it's the first half, and for server it's
+ /// the second) of the SETUP_TRANSPORT negotiation process. First, a new
+ /// binder is created. We take its "receiving" part and construct the
+ /// transaction receiver with it, and sends the "sending" part along with the
+ /// SETUP_TRANSPORT message through \p binder.
+ void SendSetupTransport(Binder* binder);
+
+ /// Recv SETUP_TRANSPORT request.
+ ///
+ /// This is the other half of the SETUP_TRANSPORT process. We wait for
+ /// in-coming SETUP_TRANSPORT request with the "sending" part of a binder from
+ /// the other end. For client, the message is coming from the trasnaction
+ /// receiver we just constructed in SendSetupTransport(). For server, we
+ /// assume that this step is already completed.
+ // TODO(waynetu): In the testing environment, we still use this method (on
+ // another WireReader instance) for server-side transport setup, and thus it
+ // is marked as public. Try moving this method back to private, and hopefully
+ // we can also avoid moving |other_end_binder_| out in the implementation.
+ std::unique_ptr<Binder> RecvSetupTransport();
+
+ private:
+ absl::Status ProcessStreamingTransaction(transaction_code_t code,
+ ReadableParcel* parcel);
+ absl::Status ProcessStreamingTransactionImpl(transaction_code_t code,
+ ReadableParcel* parcel,
+ int* cancellation_flags)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver_;
+ absl::Notification connection_noti_;
+ grpc_core::Mutex mu_;
+ bool connected_ ABSL_GUARDED_BY(mu_) = false;
+ bool recvd_setup_transport_ ABSL_GUARDED_BY(mu_) = false;
+ // NOTE: other_end_binder_ will be moved out when RecvSetupTransport() is
+ // called. Be cautious not to access it afterward.
+ std::unique_ptr<Binder> other_end_binder_;
+ absl::flat_hash_map<transaction_code_t, int32_t> expected_seq_num_
+ ABSL_GUARDED_BY(mu_);
+ absl::flat_hash_map<transaction_code_t, std::string> message_buffer_
+ ABSL_GUARDED_BY(mu_);
+ std::unique_ptr<TransactionReceiver> tx_receiver_;
+ bool is_client_;
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+ // When WireReaderImpl gets destructed, call on_destruct_callback_. This is
+ // mostly for decrementing the reference count of its transport.
+ std::function<void()> on_destruct_callback_;
+
+ // ACK every 16k bytes.
+ static constexpr int64_t kFlowControlAckBytes = 16 * 1024;
+ int64_t num_incoming_bytes_ ABSL_GUARDED_BY(mu_) = 0;
+ int64_t num_acknowledged_bytes_ ABSL_GUARDED_BY(mu_) = 0;
+
+ // Used to send ACK.
+ std::shared_ptr<WireWriter> wire_writer_;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
diff --git a/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc b/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc
new file mode 100644
index 00000000..fe796a92
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc
@@ -0,0 +1,184 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/binder/wire_format/wire_writer.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <utility>
+
+#include <grpc/support/log.h>
+
+#define RETURN_IF_ERROR(expr) \
+ do { \
+ const absl::Status status = (expr); \
+ if (!status.ok()) return status; \
+ } while (0)
+
+namespace grpc_binder {
+WireWriterImpl::WireWriterImpl(std::unique_ptr<Binder> binder)
+ : binder_(std::move(binder)) {}
+
+absl::Status WireWriterImpl::WriteInitialMetadata(const Transaction& tx,
+ WritableParcel* parcel) {
+ if (tx.IsClient()) {
+ // Only client sends method ref.
+ RETURN_IF_ERROR(parcel->WriteString(tx.GetMethodRef()));
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetPrefixMetadata().size()));
+ for (const auto& md : tx.GetPrefixMetadata()) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.first));
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.second));
+ }
+ return absl::OkStatus();
+}
+
+absl::Status WireWriterImpl::WriteTrailingMetadata(const Transaction& tx,
+ WritableParcel* parcel) {
+ if (tx.IsServer()) {
+ if (tx.GetFlags() & kFlagStatusDescription) {
+ RETURN_IF_ERROR(parcel->WriteString(tx.GetStatusDesc()));
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetSuffixMetadata().size()));
+ for (const auto& md : tx.GetSuffixMetadata()) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.first));
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.second));
+ }
+ } else {
+ // client suffix currently is always empty according to the wireformat
+ if (!tx.GetSuffixMetadata().empty()) {
+ gpr_log(GPR_ERROR, "Got non-empty suffix metadata from client.");
+ }
+ }
+ return absl::OkStatus();
+}
+
+const int64_t WireWriterImpl::kBlockSize = 16 * 1024;
+const int64_t WireWriterImpl::kFlowControlWindowSize = 128 * 1024;
+
+bool WireWriterImpl::CanBeSentInOneTransaction(const Transaction& tx) const {
+ return (tx.GetFlags() & kFlagMessageData) == 0 ||
+ tx.GetMessageData().size() <= kBlockSize;
+}
+
+absl::Status WireWriterImpl::RpcCallFastPath(const Transaction& tx) {
+ int& seq = seq_num_[tx.GetTxCode()];
+ // Fast path: send data in one transaction.
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetFlags()));
+ RETURN_IF_ERROR(parcel->WriteInt32(seq++));
+ if (tx.GetFlags() & kFlagPrefix) {
+ RETURN_IF_ERROR(WriteInitialMetadata(tx, parcel));
+ }
+ if (tx.GetFlags() & kFlagMessageData) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(tx.GetMessageData()));
+ }
+ if (tx.GetFlags() & kFlagSuffix) {
+ RETURN_IF_ERROR(WriteTrailingMetadata(tx, parcel));
+ }
+ // FIXME(waynetu): Construct BinderTransportTxCode from an arbitrary integer
+ // is an undefined behavior.
+ return binder_->Transact(BinderTransportTxCode(tx.GetTxCode()));
+}
+
+bool WireWriterImpl::WaitForAcknowledgement() {
+ if (num_outgoing_bytes_ < num_acknowledged_bytes_ + kFlowControlWindowSize) {
+ return true;
+ }
+ absl::Time deadline = absl::Now() + absl::Seconds(1);
+ do {
+ if (cv_.WaitWithDeadline(&mu_, deadline)) {
+ return false;
+ }
+ if (absl::Now() >= deadline) {
+ return false;
+ }
+ } while (num_outgoing_bytes_ >=
+ num_acknowledged_bytes_ + kFlowControlWindowSize);
+ return true;
+}
+
+absl::Status WireWriterImpl::RpcCall(const Transaction& tx) {
+ // TODO(mingcl): check tx_code <= last call id
+ grpc_core::MutexLock lock(&mu_);
+ GPR_ASSERT(tx.GetTxCode() >= kFirstCallId);
+ if (CanBeSentInOneTransaction(tx)) {
+ return RpcCallFastPath(tx);
+ }
+ // Slow path: the message data is too large to fit in one transaction.
+ int& seq = seq_num_[tx.GetTxCode()];
+ int original_flags = tx.GetFlags();
+ GPR_ASSERT(original_flags & kFlagMessageData);
+ absl::string_view data = tx.GetMessageData();
+ size_t bytes_sent = 0;
+ while (bytes_sent < data.size()) {
+ if (!WaitForAcknowledgement()) {
+ return absl::InternalError("Timeout waiting for acknowledgement");
+ }
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ size_t size =
+ std::min(static_cast<size_t>(kBlockSize), data.size() - bytes_sent);
+ int flags = kFlagMessageData;
+ if (bytes_sent == 0) {
+ // This is the first transaction. Include initial metadata if there's any.
+ if (original_flags & kFlagPrefix) {
+ flags |= kFlagPrefix;
+ }
+ }
+ if (bytes_sent + kBlockSize >= data.size()) {
+ // This is the last transaction. Include trailing metadata if there's any.
+ if (original_flags & kFlagSuffix) {
+ flags |= kFlagSuffix;
+ }
+ } else {
+ // There are more messages to send.
+ flags |= kFlagMessageDataIsPartial;
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(flags));
+ RETURN_IF_ERROR(parcel->WriteInt32(seq++));
+ if (flags & kFlagPrefix) {
+ RETURN_IF_ERROR(WriteInitialMetadata(tx, parcel));
+ }
+ RETURN_IF_ERROR(
+ parcel->WriteByteArrayWithLength(data.substr(bytes_sent, size)));
+ if (flags & kFlagSuffix) {
+ RETURN_IF_ERROR(WriteTrailingMetadata(tx, parcel));
+ }
+ num_outgoing_bytes_ += parcel->GetDataSize();
+ RETURN_IF_ERROR(binder_->Transact(BinderTransportTxCode(tx.GetTxCode())));
+ bytes_sent += size;
+ }
+ return absl::OkStatus();
+}
+
+absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
+ grpc_core::MutexLock lock(&mu_);
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ RETURN_IF_ERROR(parcel->WriteInt64(num_bytes));
+ return binder_->Transact(BinderTransportTxCode::ACKNOWLEDGE_BYTES);
+}
+
+void WireWriterImpl::OnAckReceived(int64_t num_bytes) {
+ grpc_core::MutexLock lock(&mu_);
+ num_acknowledged_bytes_ = std::max(num_acknowledged_bytes_, num_bytes);
+ cv_.Signal();
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h b/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h
new file mode 100644
index 00000000..52b082b8
--- /dev/null
+++ b/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h
@@ -0,0 +1,84 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+#include <vector>
+
+#include "absl/container/flat_hash_map.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+class WireWriter {
+ public:
+ virtual ~WireWriter() = default;
+ virtual absl::Status RpcCall(const Transaction& call) = 0;
+ virtual absl::Status SendAck(int64_t num_bytes) = 0;
+ virtual void OnAckReceived(int64_t num_bytes) = 0;
+};
+
+class WireWriterImpl : public WireWriter {
+ public:
+ explicit WireWriterImpl(std::unique_ptr<Binder> binder);
+ absl::Status RpcCall(const Transaction& tx) override;
+ absl::Status SendAck(int64_t num_bytes) override;
+ void OnAckReceived(int64_t num_bytes) override;
+
+ // Split long message into chunks of size 16k. This doesn't necessarily have
+ // to be the same as the flow control acknowledgement size, but it should not
+ // exceed 128k.
+ static const int64_t kBlockSize;
+ // Flow control allows sending at most 128k between acknowledgements.
+ static const int64_t kFlowControlWindowSize;
+
+ private:
+ absl::Status WriteInitialMetadata(const Transaction& tx,
+ WritableParcel* parcel)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ absl::Status WriteTrailingMetadata(const Transaction& tx,
+ WritableParcel* parcel)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ bool CanBeSentInOneTransaction(const Transaction& tx) const;
+ absl::Status RpcCallFastPath(const Transaction& tx)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ // Wait for acknowledgement from the other side for a while (the timeout is
+ // currently set to 10ms for debugability). Returns true if we are able to
+ // proceed, and false otherwise.
+ //
+ // TODO(waynetu): Currently, RpcCall() will fail if we are blocked for 10ms.
+ // In the future, we should queue the transactions and release them later when
+ // acknowledgement comes.
+ bool WaitForAcknowledgement() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ grpc_core::Mutex mu_;
+ grpc_core::CondVar cv_;
+ std::unique_ptr<Binder> binder_ ABSL_GUARDED_BY(mu_);
+ absl::flat_hash_map<int, int> seq_num_ ABSL_GUARDED_BY(mu_);
+ int64_t num_outgoing_bytes_ ABSL_GUARDED_BY(mu_) = 0;
+ int64_t num_acknowledged_bytes_ ABSL_GUARDED_BY(mu_) = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
diff --git a/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc b/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
index 1fdab76d..33f76276 100644
--- a/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
+++ b/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/useful.h"
/* in order of preference */
diff --git a/grpc/src/core/ext/transport/chttp2/client/authority.cc b/grpc/src/core/ext/transport/chttp2/client/authority.cc
deleted file mode 100644
index 8e4f8c1b..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/authority.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * 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/client/authority.h"
-
-grpc_channel_args* grpc_default_authority_add_if_not_present(
- const grpc_channel_args* args) {
- const bool has_default_authority =
- grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) != nullptr;
- grpc_arg new_args[1];
- size_t num_new_args = 0;
- std::string default_authority;
- if (!has_default_authority) {
- const grpc_arg* server_uri_arg =
- grpc_channel_args_find(args, GRPC_ARG_SERVER_URI);
- const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
- GPR_ASSERT(server_uri_str != nullptr);
- default_authority =
- grpc_core::ResolverRegistry::GetDefaultAuthority(server_uri_str);
- new_args[num_new_args++] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
- const_cast<char*>(default_authority.c_str()));
- }
- return grpc_channel_args_copy_and_add(args, new_args, num_new_args);
-}
diff --git a/grpc/src/core/ext/transport/chttp2/client/authority.h b/grpc/src/core/ext/transport/chttp2/client/authority.h
deleted file mode 100644
index 642584ef..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/authority.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * 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_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gprpp/memory.h"
-
-/// Returns a copy of \a args with the default authority channel arg set if it
-/// wasn't already present.
-grpc_channel_args* grpc_default_authority_add_if_not_present(
- const grpc_channel_args* args);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H */
diff --git a/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index 8b3d5d75..850dab62 100644
--- a/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
+++ b/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
@@ -20,23 +20,43 @@
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
-#include <grpc/grpc.h>
-
#include <string.h>
+#include <grpc/grpc.h>
+#include <grpc/grpc_posix.h>
#include <grpc/slice_buffer.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/connector.h"
-#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
-#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#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/config/core_configuration.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/insecure/insecure_credentials.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
#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/transport.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
+
+#include <fcntl.h>
+
+#include "src/core/lib/iomgr/tcp_client_posix.h"
+#include "src/core/lib/iomgr/tcp_posix.h"
+
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
namespace grpc_core {
@@ -45,13 +65,13 @@ Chttp2Connector::Chttp2Connector() {
}
Chttp2Connector::~Chttp2Connector() {
- if (endpoint_ != nullptr) grpc_endpoint_destroy(endpoint_);
+ if (endpoint_ != nullptr) {
+ grpc_endpoint_destroy(endpoint_);
+ }
}
void Chttp2Connector::Connect(const Args& args, Result* result,
grpc_closure* notify) {
- grpc_resolved_address addr;
- Subchannel::GetAddressFromSubchannelAddressArg(args.channel_args, &addr);
grpc_endpoint** ep;
{
MutexLock lock(&mu_);
@@ -72,7 +92,7 @@ void Chttp2Connector::Connect(const Args& args, Result* result,
// make sure that we still exist at that point by taking a ref.
Ref().release(); // Ref held by callback.
grpc_tcp_client_connect(&connected_, ep, args.interested_parties,
- args.channel_args, &addr, args.deadline);
+ args.channel_args, args.address, args.deadline);
}
void Chttp2Connector::Shutdown(grpc_error_handle error) {
@@ -120,9 +140,9 @@ void Chttp2Connector::Connected(void* arg, grpc_error_handle error) {
void Chttp2Connector::StartHandshakeLocked() {
handshake_mgr_ = MakeRefCounted<HandshakeManager>();
- HandshakerRegistry::AddHandshakers(HANDSHAKER_CLIENT, args_.channel_args,
- args_.interested_parties,
- handshake_mgr_.get());
+ CoreConfiguration::Get().handshaker_registry().AddHandshakers(
+ HANDSHAKER_CLIENT, args_.channel_args, args_.interested_parties,
+ handshake_mgr_.get());
grpc_endpoint_add_to_pollset_set(endpoint_, args_.interested_parties);
handshake_mgr_->DoHandshake(endpoint_, args_.channel_args, args_.deadline,
nullptr /* acceptor */, OnHandshakeDone, this);
@@ -259,4 +279,217 @@ void Chttp2Connector::MaybeNotify(grpc_error_handle error) {
}
}
+namespace {
+
+class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
+ public:
+ RefCountedPtr<Subchannel> CreateSubchannel(
+ const grpc_resolved_address& address,
+ const grpc_channel_args* args) override {
+ grpc_channel_args* new_args = GetSecureNamingChannelArgs(args);
+ if (new_args == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Failed to create channel args during subchannel creation.");
+ return nullptr;
+ }
+ RefCountedPtr<Subchannel> s = Subchannel::Create(
+ MakeOrphanable<Chttp2Connector>(), address, new_args);
+ grpc_channel_args_destroy(new_args);
+ return s;
+ }
+
+ private:
+ static grpc_channel_args* GetSecureNamingChannelArgs(
+ const grpc_channel_args* args) {
+ grpc_channel_credentials* channel_credentials =
+ grpc_channel_credentials_find_in_args(args);
+ if (channel_credentials == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Can't create subchannel: channel credentials missing for secure "
+ "channel.");
+ return nullptr;
+ }
+ // Make sure security connector does not already exist in args.
+ if (grpc_security_connector_find_in_args(args) != nullptr) {
+ gpr_log(GPR_ERROR,
+ "Can't create subchannel: security connector already present in "
+ "channel args.");
+ return nullptr;
+ }
+ // Find the authority to use in the security connector.
+ const char* authority =
+ grpc_channel_args_find_string(args, GRPC_ARG_DEFAULT_AUTHORITY);
+ GPR_ASSERT(authority != nullptr);
+ // Create the security connector using the credentials and target name.
+ grpc_channel_args* new_args_from_connector = nullptr;
+ RefCountedPtr<grpc_channel_security_connector>
+ subchannel_security_connector =
+ channel_credentials->create_security_connector(
+ /*call_creds=*/nullptr, authority, args,
+ &new_args_from_connector);
+ if (subchannel_security_connector == nullptr) {
+ gpr_log(GPR_ERROR,
+ "Failed to create secure subchannel for secure name '%s'",
+ authority);
+ return nullptr;
+ }
+ grpc_arg new_security_connector_arg =
+ grpc_security_connector_to_arg(subchannel_security_connector.get());
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
+ new_args_from_connector != nullptr ? new_args_from_connector : args,
+ &new_security_connector_arg, 1);
+ subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create");
+ grpc_channel_args_destroy(new_args_from_connector);
+ return new_args;
+ }
+};
+
+grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
+ grpc_error_handle* error) {
+ if (target == nullptr) {
+ gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
+ if (error != nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel target is NULL");
+ }
+ return nullptr;
+ }
+ // Add channel arg containing the server URI.
+ std::string canonical_target =
+ CoreConfiguration::Get().resolver_registry().AddDefaultPrefixIfNeeded(
+ target);
+ grpc_arg arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_SERVER_URI),
+ const_cast<char*>(canonical_target.c_str()));
+ const char* to_remove[] = {GRPC_ARG_SERVER_URI};
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
+ grpc_channel* channel = grpc_channel_create_internal(
+ target, new_args, GRPC_CLIENT_CHANNEL, nullptr, error);
+ grpc_channel_args_destroy(new_args);
+ return channel;
+}
+
+} // namespace
} // namespace grpc_core
+
+namespace {
+
+grpc_core::Chttp2SecureClientChannelFactory* g_factory;
+gpr_once g_factory_once = GPR_ONCE_INIT;
+
+void FactoryInit() {
+ g_factory = new grpc_core::Chttp2SecureClientChannelFactory();
+}
+
+} // namespace
+
+// Create a secure client channel:
+// Asynchronously: - resolve target
+// - connect to it (trying alternatives as presented)
+// - perform handshakes
+grpc_channel* grpc_channel_create(const char* target,
+ grpc_channel_credentials* creds,
+ const grpc_channel_args* args) {
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE("grpc_secure_channel_create(target=%s, creds=%p, args=%p)", 3,
+ (target, (void*)creds, (void*)args));
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel* channel = nullptr;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (creds != nullptr) {
+ // Add channel args containing the client channel factory and channel
+ // credentials.
+ gpr_once_init(&g_factory_once, FactoryInit);
+ grpc_arg channel_factory_arg =
+ grpc_core::ClientChannelFactory::CreateChannelArg(g_factory);
+ grpc_arg args_to_add[] = {channel_factory_arg,
+ grpc_channel_credentials_to_arg(creds)};
+ const char* arg_to_remove = channel_factory_arg.key;
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+ args, &arg_to_remove, 1, args_to_add, GPR_ARRAY_SIZE(args_to_add));
+ new_args = creds->update_arguments(new_args);
+ // Create channel.
+ channel = grpc_core::CreateChannel(target, new_args, &error);
+ // Clean up.
+ grpc_channel_args_destroy(new_args);
+ }
+ grpc_channel_args_destroy(args);
+ if (channel == nullptr) {
+ intptr_t integer;
+ grpc_status_code status = GRPC_STATUS_INTERNAL;
+ if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
+ status = static_cast<grpc_status_code>(integer);
+ }
+ GRPC_ERROR_UNREF(error);
+ channel = grpc_lame_client_channel_create(
+ target, status, "Failed to create secure client channel");
+ }
+ return channel;
+}
+
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
+grpc_channel* grpc_channel_create_from_fd(const char* target, int fd,
+ grpc_channel_credentials* creds,
+ const grpc_channel_args* args) {
+ grpc_core::ExecCtx exec_ctx;
+ GRPC_API_TRACE(
+ "grpc_channel_create_from_fd(target=%p, fd=%d, creds=%p, args=%p)", 4,
+ (target, fd, creds, args));
+ // For now, we only support insecure channel credentials.
+ if (creds == nullptr ||
+ creds->type() != grpc_core::InsecureServerCredentials::Type()) {
+ return grpc_lame_client_channel_create(
+ target, GRPC_STATUS_INTERNAL,
+ "Failed to create client channel due to invalid creds");
+ }
+ grpc_arg default_authority_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>("test.authority"));
+ args = grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ const grpc_channel_args* final_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel_args_destroy(args);
+
+ int flags = fcntl(fd, F_GETFL, 0);
+ GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
+ grpc_endpoint* client = grpc_tcp_client_create_from_fd(
+ grpc_fd_create(fd, "client", true), final_args, "fd-client");
+ grpc_transport* transport =
+ grpc_create_chttp2_transport(final_args, client, true);
+ GPR_ASSERT(transport);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_channel* channel = grpc_channel_create_internal(
+ target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport, &error);
+ grpc_channel_args_destroy(final_args);
+ if (channel != nullptr) {
+ grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
+ grpc_core::ExecCtx::Get()->Flush();
+ } else {
+ intptr_t integer;
+ grpc_status_code status = GRPC_STATUS_INTERNAL;
+ if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
+ status = static_cast<grpc_status_code>(integer);
+ }
+ GRPC_ERROR_UNREF(error);
+ grpc_transport_destroy(transport);
+ channel = grpc_lame_client_channel_create(
+ target, status, "Failed to create client channel");
+ }
+
+ return channel;
+}
+
+#else // !GPR_SUPPORT_CHANNELS_FROM_FD
+
+grpc_channel* grpc_channel_create_from_fd(const char* /* target */,
+ int /* fd */,
+ grpc_channel_credentials* /* creds*/,
+ const grpc_channel_args* /* args */) {
+ GPR_ASSERT(0);
+ return nullptr;
+}
+
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
diff --git a/grpc/src/core/ext/transport/chttp2/client/insecure/README.md b/grpc/src/core/ext/transport/chttp2/client/insecure/README.md
deleted file mode 100644
index fa114633..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/insecure/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Plugin for creating insecure channels using chttp2
diff --git a/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
deleted file mode 100644
index 58f27426..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-
-#include <string.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/resolver_registry.h"
-#include "src/core/ext/transport/chttp2/client/authority.h"
-#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/channel.h"
-
-namespace grpc_core {
-
-class Chttp2InsecureClientChannelFactory : public ClientChannelFactory {
- public:
- RefCountedPtr<Subchannel> CreateSubchannel(
- const grpc_channel_args* args) override {
- grpc_channel_args* new_args =
- grpc_default_authority_add_if_not_present(args);
- RefCountedPtr<Subchannel> s =
- Subchannel::Create(MakeOrphanable<Chttp2Connector>(), new_args);
- grpc_channel_args_destroy(new_args);
- return s;
- }
-};
-
-namespace {
-
-grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
- grpc_error_handle* error) {
- if (target == nullptr) {
- gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
- if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel target is NULL");
- }
- return nullptr;
- }
- // Add channel arg containing the server URI.
- grpc_core::UniquePtr<char> canonical_target =
- ResolverRegistry::AddDefaultPrefixIfNeeded(target);
- grpc_arg arg = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());
- const char* to_remove[] = {GRPC_ARG_SERVER_URI};
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
- grpc_channel* channel = grpc_channel_create(
- target, new_args, GRPC_CLIENT_CHANNEL, nullptr, nullptr, error);
- grpc_channel_args_destroy(new_args);
- return channel;
-}
-
-} // namespace
-
-} // namespace grpc_core
-
-namespace {
-
-grpc_core::Chttp2InsecureClientChannelFactory* g_factory;
-gpr_once g_factory_once = GPR_ONCE_INIT;
-
-void FactoryInit() {
- g_factory = new grpc_core::Chttp2InsecureClientChannelFactory();
-}
-
-} // namespace
-
-/* Create a client channel:
- Asynchronously: - resolve target
- - connect to it (trying alternatives as presented)
- - perform handshakes */
-grpc_channel* grpc_insecure_channel_create(const char* target,
- const grpc_channel_args* args,
- void* reserved) {
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE(
- "grpc_insecure_channel_create(target=%s, args=%p, reserved=%p)", 3,
- (target, args, reserved));
- GPR_ASSERT(reserved == nullptr);
- // Add channel arg containing the client channel factory.
- gpr_once_init(&g_factory_once, FactoryInit);
- grpc_arg arg = grpc_core::ClientChannelFactory::CreateChannelArg(g_factory);
- const char* arg_to_remove = arg.key;
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
- args, &arg_to_remove, 1, &arg, 1);
- grpc_error_handle error = GRPC_ERROR_NONE;
- // Create channel.
- grpc_channel* channel = grpc_core::CreateChannel(target, new_args, &error);
- // Clean up.
- grpc_channel_args_destroy(new_args);
- if (channel == nullptr) {
- intptr_t integer;
- grpc_status_code status = GRPC_STATUS_INTERNAL;
- if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
- status = static_cast<grpc_status_code>(integer);
- }
- GRPC_ERROR_UNREF(error);
- channel = grpc_lame_client_channel_create(
- target, status, "Failed to create client channel");
- }
- return channel;
-}
diff --git a/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc b/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
deleted file mode 100644
index 4700093e..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-#include <grpc/grpc_posix.h>
-#include <grpc/support/log.h>
-
-#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
-
-#include <fcntl.h>
-
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/iomgr/tcp_client_posix.h"
-#include "src/core/lib/iomgr/tcp_posix.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/transport/transport.h"
-
-grpc_channel* grpc_insecure_channel_create_from_fd(
- const char* target, int fd, const grpc_channel_args* args) {
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE("grpc_insecure_channel_create(target=%p, fd=%d, args=%p)", 3,
- (target, fd, args));
-
- grpc_arg default_authority_arg = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
- const_cast<char*>("test.authority"));
- grpc_channel_args* final_args =
- grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
-
- int flags = fcntl(fd, F_GETFL, 0);
- GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
-
- grpc_endpoint* client = grpc_tcp_client_create_from_fd(
- grpc_fd_create(fd, "client", true), args, "fd-client");
-
- grpc_transport* transport =
- grpc_create_chttp2_transport(final_args, client, true);
- GPR_ASSERT(transport);
- grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_channel* channel =
- grpc_channel_create(target, final_args, GRPC_CLIENT_DIRECT_CHANNEL,
- transport, nullptr, &error);
- grpc_channel_args_destroy(final_args);
- if (channel != nullptr) {
- grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
- grpc_core::ExecCtx::Get()->Flush();
- } else {
- intptr_t integer;
- grpc_status_code status = GRPC_STATUS_INTERNAL;
- if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
- status = static_cast<grpc_status_code>(integer);
- }
- GRPC_ERROR_UNREF(error);
- grpc_transport_destroy(transport);
- channel = grpc_lame_client_channel_create(
- target, status, "Failed to create client channel");
- }
-
- return channel;
-}
-
-#else // !GPR_SUPPORT_CHANNELS_FROM_FD
-
-grpc_channel* grpc_insecure_channel_create_from_fd(
- const char* target, int fd, const grpc_channel_args* args) {
- GPR_ASSERT(0);
- return nullptr;
-}
-
-#endif // GPR_SUPPORT_CHANNELS_FROM_FD
diff --git a/grpc/src/core/ext/transport/chttp2/client/secure/README.md b/grpc/src/core/ext/transport/chttp2/client/secure/README.md
deleted file mode 100644
index 405a86e5..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/secure/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Plugin for creating secure channels using chttp2
diff --git a/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
deleted file mode 100644
index 5b00098d..00000000
--- a/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-
-#include <string.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/resolver_registry.h"
-#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/security_connector/security_connector.h"
-#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/uri/uri_parser.h"
-
-namespace grpc_core {
-
-class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
- public:
- RefCountedPtr<Subchannel> CreateSubchannel(
- const grpc_channel_args* args) override {
- grpc_channel_args* new_args = GetSecureNamingChannelArgs(args);
- if (new_args == nullptr) {
- gpr_log(GPR_ERROR,
- "Failed to create channel args during subchannel creation.");
- return nullptr;
- }
- RefCountedPtr<Subchannel> s =
- Subchannel::Create(MakeOrphanable<Chttp2Connector>(), new_args);
- grpc_channel_args_destroy(new_args);
- return s;
- }
-
- private:
- static grpc_channel_args* GetSecureNamingChannelArgs(
- const grpc_channel_args* args) {
- grpc_channel_credentials* channel_credentials =
- grpc_channel_credentials_find_in_args(args);
- if (channel_credentials == nullptr) {
- gpr_log(GPR_ERROR,
- "Can't create subchannel: channel credentials missing for secure "
- "channel.");
- return nullptr;
- }
- // Make sure security connector does not already exist in args.
- if (grpc_security_connector_find_in_args(args) != nullptr) {
- gpr_log(GPR_ERROR,
- "Can't create subchannel: security connector already present in "
- "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.
- std::string authority(FindAuthorityOverrideInArgs(args));
- if (authority.empty()) {
- 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];
- size_t num_args_to_add = 0;
- if (grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) == nullptr) {
- // If the channel args don't already contain GRPC_ARG_DEFAULT_AUTHORITY,
- // add the arg, setting it to the value just obtained.
- args_to_add[num_args_to_add++] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
- const_cast<char*>(authority.c_str()));
- }
- grpc_channel_args* args_with_authority =
- grpc_channel_args_copy_and_add(args, args_to_add, num_args_to_add);
- // Create the security connector using the credentials and target name.
- grpc_channel_args* new_args_from_connector = nullptr;
- RefCountedPtr<grpc_channel_security_connector>
- subchannel_security_connector =
- channel_credentials->create_security_connector(
- /*call_creds=*/nullptr, authority.c_str(), args_with_authority,
- &new_args_from_connector);
- if (subchannel_security_connector == nullptr) {
- gpr_log(GPR_ERROR,
- "Failed to create secure subchannel for secure name '%s'",
- authority.c_str());
- grpc_channel_args_destroy(args_with_authority);
- return nullptr;
- }
- grpc_arg new_security_connector_arg =
- grpc_security_connector_to_arg(subchannel_security_connector.get());
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
- new_args_from_connector != nullptr ? new_args_from_connector
- : args_with_authority,
- &new_security_connector_arg, 1);
- subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create");
- if (new_args_from_connector != nullptr) {
- grpc_channel_args_destroy(new_args_from_connector);
- }
- grpc_channel_args_destroy(args_with_authority);
- return new_args;
- }
-};
-
-namespace {
-
-grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
- grpc_error_handle* error) {
- if (target == nullptr) {
- gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
- if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel target is NULL");
- }
- return nullptr;
- }
- // Add channel arg containing the server URI.
- grpc_core::UniquePtr<char> canonical_target =
- ResolverRegistry::AddDefaultPrefixIfNeeded(target);
- grpc_arg arg = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());
- const char* to_remove[] = {GRPC_ARG_SERVER_URI};
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
- grpc_channel* channel = grpc_channel_create(
- target, new_args, GRPC_CLIENT_CHANNEL, nullptr, nullptr, error);
- grpc_channel_args_destroy(new_args);
- return channel;
-}
-
-} // namespace
-
-} // namespace grpc_core
-
-namespace {
-
-grpc_core::Chttp2SecureClientChannelFactory* g_factory;
-gpr_once g_factory_once = GPR_ONCE_INIT;
-
-void FactoryInit() {
- g_factory = new grpc_core::Chttp2SecureClientChannelFactory();
-}
-
-} // namespace
-
-// Create a secure client channel:
-// Asynchronously: - resolve target
-// - connect to it (trying alternatives as presented)
-// - perform handshakes
-grpc_channel* grpc_secure_channel_create(grpc_channel_credentials* creds,
- const char* target,
- const grpc_channel_args* args,
- void* reserved) {
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE(
- "grpc_secure_channel_create(creds=%p, target=%s, args=%p, "
- "reserved=%p)",
- 4, ((void*)creds, target, (void*)args, (void*)reserved));
- GPR_ASSERT(reserved == nullptr);
- grpc_channel* channel = nullptr;
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (creds != nullptr) {
- // Add channel args containing the client channel factory and channel
- // credentials.
- gpr_once_init(&g_factory_once, FactoryInit);
- grpc_arg channel_factory_arg =
- grpc_core::ClientChannelFactory::CreateChannelArg(g_factory);
- grpc_arg args_to_add[] = {channel_factory_arg,
- grpc_channel_credentials_to_arg(creds)};
- const char* arg_to_remove = channel_factory_arg.key;
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
- args, &arg_to_remove, 1, args_to_add, GPR_ARRAY_SIZE(args_to_add));
- new_args = creds->update_arguments(new_args);
- // Create channel.
- channel = grpc_core::CreateChannel(target, new_args, &error);
- // Clean up.
- grpc_channel_args_destroy(new_args);
- }
- if (channel == nullptr) {
- intptr_t integer;
- grpc_status_code status = GRPC_STATUS_INTERNAL;
- if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
- status = static_cast<grpc_status_code>(integer);
- }
- GRPC_ERROR_UNREF(error);
- channel = grpc_lame_client_channel_create(
- target, status, "Failed to create secure client channel");
- }
- return channel;
-}
diff --git a/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc b/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
index 911af03b..12173a09 100644
--- a/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
+++ b/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
@@ -23,13 +23,16 @@
#include <inttypes.h>
#include <limits.h>
#include <string.h>
+
#include <vector>
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
+#include "absl/strings/strip.h"
#include <grpc/grpc.h>
+#include <grpc/grpc_posix.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -41,17 +44,31 @@
#include "src/core/lib/address_utils/sockaddr_utils.h"
#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/config/core_configuration.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"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/insecure/insecure_credentials.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/surface/completion_queue.h"
+
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
namespace grpc_core {
namespace {
@@ -127,11 +144,11 @@ class Chttp2ServerListener : public Server::ListenerInterface {
static void OnHandshakeDone(void* arg, grpc_error_handle error);
RefCountedPtr<ActiveConnection> const connection_;
grpc_pollset* const accepting_pollset_;
- grpc_tcp_server_acceptor* const acceptor_;
+ grpc_tcp_server_acceptor* acceptor_;
RefCountedPtr<HandshakeManager> handshake_mgr_
ABSL_GUARDED_BY(&connection_->mu_);
// State for enforcing handshake timeout on receiving HTTP/2 settings.
- grpc_millis const deadline_;
+ Timestamp const deadline_;
grpc_timer timer_ ABSL_GUARDED_BY(&connection_->mu_);
grpc_closure on_timeout_ ABSL_GUARDED_BY(&connection_->mu_);
grpc_closure on_receive_settings_ ABSL_GUARDED_BY(&connection_->mu_);
@@ -140,7 +157,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
ActiveConnection(grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor,
- grpc_channel_args* args);
+ grpc_channel_args* args, MemoryOwner memory_owner);
~ActiveConnection() override;
void Orphan() override;
@@ -156,6 +173,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
private:
static void OnClose(void* arg, grpc_error_handle error);
+ static void OnDrainGraceTimeExpiry(void* arg, grpc_error_handle error);
RefCountedPtr<Chttp2ServerListener> listener_;
Mutex mu_ ABSL_ACQUIRED_AFTER(&listener_->mu_);
@@ -166,6 +184,10 @@ class Chttp2ServerListener : public Server::ListenerInterface {
// created.
grpc_chttp2_transport* transport_ ABSL_GUARDED_BY(&mu_) = nullptr;
grpc_closure on_close_;
+ grpc_timer drain_grace_timer_;
+ grpc_closure on_drain_grace_time_expiry_;
+ bool drain_grace_timer_expiry_callback_pending_ ABSL_GUARDED_BY(&mu_) =
+ false;
bool shutdown_ ABSL_GUARDED_BY(&mu_) = false;
};
@@ -216,11 +238,10 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_resolved_address resolved_address_;
Chttp2ServerArgsModifier const args_modifier_;
ConfigFetcherWatcher* config_fetcher_watcher_ = nullptr;
- Mutex channel_args_mu_;
- grpc_channel_args* args_ ABSL_GUARDED_BY(channel_args_mu_);
- RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
- connection_manager_ ABSL_GUARDED_BY(channel_args_mu_);
+ grpc_channel_args* args_;
Mutex mu_;
+ RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
+ connection_manager_ ABSL_GUARDED_BY(mu_);
// Signals whether grpc_tcp_server_start() has been called.
bool started_ ABSL_GUARDED_BY(mu_) = false;
// Signals whether grpc_tcp_server_start() has completed.
@@ -234,6 +255,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_closure tcp_server_shutdown_complete_ ABSL_GUARDED_BY(mu_);
grpc_closure* on_destroy_done_ ABSL_GUARDED_BY(mu_) = nullptr;
RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
+ MemoryQuotaRefPtr memory_quota_;
};
//
@@ -245,13 +267,31 @@ void Chttp2ServerListener::ConfigFetcherWatcher::UpdateConnectionManager(
connection_manager) {
RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
connection_manager_to_destroy;
+ class GracefulShutdownExistingConnections {
+ public:
+ ~GracefulShutdownExistingConnections() {
+ // Send GOAWAYs on the transports so that they get disconnected when
+ // existing RPCs finish, and so that no new RPC is started on them.
+ for (auto& connection : connections_) {
+ connection.first->SendGoAway();
+ }
+ }
+
+ void set_connections(
+ std::map<ActiveConnection*, OrphanablePtr<ActiveConnection>>
+ connections) {
+ GPR_ASSERT(connections_.empty());
+ connections_ = std::move(connections);
+ }
+
+ private:
+ std::map<ActiveConnection*, OrphanablePtr<ActiveConnection>> connections_;
+ } connections_to_shutdown;
{
- MutexLock lock(&listener_->channel_args_mu_);
+ MutexLock lock(&listener_->mu_);
connection_manager_to_destroy = listener_->connection_manager_;
listener_->connection_manager_ = std::move(connection_manager);
- }
- {
- MutexLock lock(&listener_->mu_);
+ connections_to_shutdown.set_connections(std::move(listener_->connections_));
if (listener_->shutdown_) {
return;
}
@@ -295,10 +335,10 @@ void Chttp2ServerListener::ConfigFetcherWatcher::StopServing() {
// Chttp2ServerListener::ActiveConnection::HandshakingState
//
-grpc_millis GetConnectionDeadline(const grpc_channel_args* args) {
- int timeout_ms =
+Timestamp GetConnectionDeadline(const grpc_channel_args* args) {
+ auto timeout_ms = Duration::Milliseconds(
grpc_channel_args_find_integer(args, GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS,
- {120 * GPR_MS_PER_SEC, 1, INT_MAX});
+ {120 * GPR_MS_PER_SEC, 1, INT_MAX}));
return ExecCtx::Get()->Now() + timeout_ms;
}
@@ -313,13 +353,14 @@ Chttp2ServerListener::ActiveConnection::HandshakingState::HandshakingState(
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());
+ CoreConfiguration::Get().handshaker_registry().AddHandshakers(
+ HANDSHAKER_SERVER, args, interested_parties_, handshake_mgr_.get());
}
Chttp2ServerListener::ActiveConnection::HandshakingState::~HandshakingState() {
grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
grpc_pollset_set_destroy(interested_parties_);
+ gpr_free(acceptor_);
}
void Chttp2ServerListener::ActiveConnection::HandshakingState::Orphan() {
@@ -379,16 +420,12 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
OrphanablePtr<HandshakingState> handshaking_state_ref;
RefCountedPtr<HandshakeManager> handshake_mgr;
bool cleanup_connection = false;
- bool free_resource_quota = false;
- grpc_resource_user* resource_user =
- self->connection_->listener_->server_->default_resource_user();
{
MutexLock connection_lock(&self->connection_->mu_);
if (error != GRPC_ERROR_NONE || self->connection_->shutdown_) {
std::string error_str = grpc_error_std_string(error);
gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str.c_str());
cleanup_connection = true;
- free_resource_quota = true;
if (error == GRPC_ERROR_NONE && args->endpoint != nullptr) {
// We were shut down or stopped serving after handshaking completed
// successfully, so destroy the endpoint here.
@@ -407,13 +444,12 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
// 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);
+ grpc_transport* transport =
+ grpc_create_chttp2_transport(args->args, args->endpoint, false);
grpc_error_handle channel_init_err =
self->connection_->listener_->server_->SetupTransport(
transport, self->accepting_pollset_, args->args,
- grpc_chttp2_transport_get_socket_node(transport),
- resource_user);
+ grpc_chttp2_transport_get_socket_node(transport));
if (channel_init_err == GRPC_ERROR_NONE) {
// Use notify_on_receive_settings callback to enforce the
// handshake deadline.
@@ -461,12 +497,10 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
grpc_slice_buffer_destroy_internal(args->read_buffer);
gpr_free(args->read_buffer);
cleanup_connection = true;
- free_resource_quota = true;
grpc_channel_args_destroy(args->args);
}
} else {
cleanup_connection = true;
- free_resource_quota = true;
}
}
// Since the handshake manager is done, the connection no longer needs to
@@ -477,10 +511,8 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
handshaking_state_ref = std::move(self->connection_->handshaking_state_);
}
gpr_free(self->acceptor_);
+ self->acceptor_ = nullptr;
OrphanablePtr<ActiveConnection> connection;
- if (free_resource_quota && resource_user != nullptr) {
- grpc_resource_user_free(resource_user, GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
if (cleanup_connection) {
MutexLock listener_lock(&self->connection_->listener_->mu_);
auto it = self->connection_->listener_->connections_.find(
@@ -499,8 +531,8 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
Chttp2ServerListener::ActiveConnection::ActiveConnection(
grpc_pollset* accepting_pollset, grpc_tcp_server_acceptor* acceptor,
- grpc_channel_args* args)
- : handshaking_state_(MakeOrphanable<HandshakingState>(
+ grpc_channel_args* args, MemoryOwner memory_owner)
+ : handshaking_state_(memory_owner.MakeOrphanable<HandshakingState>(
Ref(), accepting_pollset, acceptor, args)) {
GRPC_CLOSURE_INIT(&on_close_, ActiveConnection::OnClose, this,
grpc_schedule_on_exec_ctx);
@@ -528,7 +560,21 @@ void Chttp2ServerListener::ActiveConnection::SendGoAway() {
grpc_chttp2_transport* transport = nullptr;
{
MutexLock lock(&mu_);
- transport = transport_;
+ if (transport_ != nullptr && !shutdown_) {
+ transport = transport_;
+ Ref().release(); // Ref held by OnDrainGraceTimeExpiry
+ GRPC_CLOSURE_INIT(&on_drain_grace_time_expiry_, OnDrainGraceTimeExpiry,
+ this, nullptr);
+ grpc_timer_init(&drain_grace_timer_,
+ ExecCtx::Get()->Now() +
+ Duration::Milliseconds(grpc_channel_args_find_integer(
+ listener_->args_,
+ GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS,
+ {10 * 60 * GPR_MS_PER_SEC, 0, INT_MAX})),
+ &on_drain_grace_time_expiry_);
+ drain_grace_timer_expiry_callback_pending_ = true;
+ shutdown_ = true;
+ }
}
if (transport != nullptr) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
@@ -568,11 +614,35 @@ void Chttp2ServerListener::ActiveConnection::OnClose(
connection = std::move(it->second);
self->listener_->connections_.erase(it);
}
+ self->shutdown_ = true;
+ }
+ // Cancel the drain_grace_timer_ if needed.
+ if (self->drain_grace_timer_expiry_callback_pending_) {
+ grpc_timer_cancel(&self->drain_grace_timer_);
}
}
self->Unref();
}
+void Chttp2ServerListener::ActiveConnection::OnDrainGraceTimeExpiry(
+ void* arg, grpc_error_handle error) {
+ ActiveConnection* self = static_cast<ActiveConnection*>(arg);
+ // If the drain_grace_timer_ was not cancelled, disconnect the transport
+ // immediately.
+ if (error == GRPC_ERROR_NONE) {
+ grpc_chttp2_transport* transport = nullptr;
+ {
+ MutexLock lock(&self->mu_);
+ transport = self->transport_;
+ }
+ grpc_transport_op* op = grpc_make_transport_op(nullptr);
+ op->disconnect_with_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Drain grace time expired. Closing connection immediately.");
+ grpc_transport_perform_op(&transport->base, op);
+ }
+ self->Unref();
+}
+
//
// Chttp2ServerListener
//
@@ -584,6 +654,7 @@ grpc_error_handle Chttp2ServerListener::Create(
// The bulk of this method is inside of a lambda to make cleanup
// easier without using goto.
grpc_error_handle error = [&]() {
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Create Chttp2ServerListener.
listener = new Chttp2ServerListener(server, args, args_modifier);
error = grpc_tcp_server_create(&listener->tcp_server_shutdown_complete_,
@@ -647,7 +718,10 @@ grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
Chttp2ServerListener::Chttp2ServerListener(
Server* server, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier)
- : server_(server), args_modifier_(args_modifier), args_(args) {
+ : server_(server),
+ args_modifier_(args_modifier),
+ args_(args),
+ memory_quota_(ResourceQuotaFromChannelArgs(args)->memory_quota()) {
GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
this, grpc_schedule_on_exec_ctx);
}
@@ -667,16 +741,10 @@ Chttp2ServerListener::~Chttp2ServerListener() {
void Chttp2ServerListener::Start(
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
if (server_->config_fetcher() != nullptr) {
- grpc_channel_args* args = nullptr;
auto watcher = absl::make_unique<ConfigFetcherWatcher>(Ref());
config_fetcher_watcher_ = watcher.get();
- {
- MutexLock lock(&channel_args_mu_);
- args = grpc_channel_args_copy(args_);
- }
server_->config_fetcher()->StartWatch(
- grpc_sockaddr_to_string(&resolved_address_, false), args,
- std::move(watcher));
+ grpc_sockaddr_to_string(&resolved_address_, false), std::move(watcher));
} else {
{
MutexLock lock(&mu_);
@@ -700,12 +768,12 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor) {
Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
- grpc_channel_args* args = nullptr;
+ grpc_channel_args* args = self->args_;
+ grpc_channel_args* args_to_destroy = nullptr;
RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
connection_manager;
{
- MutexLock lock(&self->channel_args_mu_);
- args = grpc_channel_args_copy(self->args_);
+ MutexLock lock(&self->mu_);
connection_manager = self->connection_manager_;
}
auto endpoint_cleanup = [&](grpc_error_handle error) {
@@ -718,18 +786,19 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"No ConnectionManager configured. Closing connection.");
endpoint_cleanup(error);
- grpc_channel_args_destroy(args);
return;
}
// TODO(yashykt): Maybe combine the following two arg modifiers into a
// single one.
+ // Make a copy of the args so as to avoid destroying the original.
+ args = grpc_channel_args_copy(args);
absl::StatusOr<grpc_channel_args*> args_result =
connection_manager->UpdateChannelArgsForConnection(args, tcp);
if (!args_result.ok()) {
gpr_log(GPR_DEBUG, "Closing connection: %s",
args_result.status().ToString().c_str());
- endpoint_cleanup(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- args_result.status().ToString().c_str()));
+ endpoint_cleanup(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(args_result.status().ToString()));
return;
}
grpc_error_handle error = GRPC_ERROR_NONE;
@@ -741,34 +810,31 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_channel_args_destroy(args);
return;
}
+ args_to_destroy = args;
}
- auto connection =
- MakeOrphanable<ActiveConnection>(accepting_pollset, acceptor, args);
+ auto memory_owner = self->memory_quota_->CreateMemoryOwner(
+ absl::StrCat(grpc_endpoint_get_peer(tcp), ":server_channel"));
+ auto connection = memory_owner.MakeOrphanable<ActiveConnection>(
+ accepting_pollset, acceptor, args, std::move(memory_owner));
+ // We no longer own acceptor
+ acceptor = nullptr;
// Hold a ref to connection to allow starting handshake outside the
// critical region
RefCountedPtr<ActiveConnection> connection_ref = connection->Ref();
RefCountedPtr<Chttp2ServerListener> listener_ref;
{
MutexLock lock(&self->mu_);
- // Shutdown the the connection if listener's stopped serving.
- if (!self->shutdown_ && self->is_serving_) {
- grpc_resource_user* resource_user =
- self->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.");
- } else {
- // This ref needs to be taken in the critical region after having made
- // sure that the listener has not been Orphaned, so as to avoid
- // heap-use-after-free issues where `Ref()` is invoked when the ref of
- // tcp_server_ has already reached 0. (Ref() implementation of
- // Chttp2ServerListener is grpc_tcp_server_ref().)
- listener_ref = self->Ref();
- self->connections_.emplace(connection.get(), std::move(connection));
- }
+ // Shutdown the the connection if listener's stopped serving or if the
+ // connection manager has changed.
+ if (!self->shutdown_ && self->is_serving_ &&
+ connection_manager == self->connection_manager_) {
+ // This ref needs to be taken in the critical region after having made
+ // sure that the listener has not been Orphaned, so as to avoid
+ // heap-use-after-free issues where `Ref()` is invoked when the ref of
+ // tcp_server_ has already reached 0. (Ref() implementation of
+ // Chttp2ServerListener is grpc_tcp_server_ref().)
+ listener_ref = self->Ref();
+ self->connections_.emplace(connection.get(), std::move(connection));
}
}
if (connection != nullptr) {
@@ -776,7 +842,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
} else {
connection_ref->Start(std::move(listener_ref), tcp, args);
}
- grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(args_to_destroy);
}
void Chttp2ServerListener::TcpServerShutdownComplete(void* arg,
@@ -825,36 +891,45 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier,
int* port_num) {
+ if (addr == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid address: addr cannot be a nullptr.");
+ }
if (strncmp(addr, "external:", 9) == 0) {
- return grpc_core::Chttp2ServerListener::CreateWithAcceptor(
- server, addr, args, args_modifier);
+ return Chttp2ServerListener::CreateWithAcceptor(server, addr, args,
+ args_modifier);
}
*port_num = -1;
- grpc_resolved_addresses* resolved = nullptr;
+ absl::StatusOr<std::vector<grpc_resolved_address>> resolved_or;
std::vector<grpc_error_handle> error_list;
+ std::string parsed_addr = URI::PercentDecode(addr);
+ absl::string_view parsed_addr_unprefixed{parsed_addr};
// Using lambda to avoid use of goto.
grpc_error_handle error = [&]() {
- if (absl::StartsWith(addr, kUnixUriPrefix)) {
- error = grpc_resolve_unix_domain_address(
- addr + sizeof(kUnixUriPrefix) - 1, &resolved);
- } else if (absl::StartsWith(addr, kUnixAbstractUriPrefix)) {
- error = grpc_resolve_unix_abstract_domain_address(
- addr + sizeof(kUnixAbstractUriPrefix) - 1, &resolved);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (absl::ConsumePrefix(&parsed_addr_unprefixed, kUnixUriPrefix)) {
+ resolved_or = grpc_resolve_unix_domain_address(parsed_addr_unprefixed);
+ } else if (absl::ConsumePrefix(&parsed_addr_unprefixed,
+ kUnixAbstractUriPrefix)) {
+ resolved_or =
+ grpc_resolve_unix_abstract_domain_address(parsed_addr_unprefixed);
} else {
- error = grpc_blocking_resolve_address(addr, "https", &resolved);
+ resolved_or = GetDNSResolver()->ResolveNameBlocking(parsed_addr, "https");
+ }
+ if (!resolved_or.ok()) {
+ return absl_status_to_grpc_error(resolved_or.status());
}
- if (error != GRPC_ERROR_NONE) return error;
// Create a listener for each resolved address.
- for (size_t i = 0; i < resolved->naddrs; i++) {
+ for (auto& addr : *resolved_or) {
// If address has a wildcard port (0), use the same port as a previous
// listener.
- if (*port_num != -1 && grpc_sockaddr_get_port(&resolved->addrs[i]) == 0) {
- grpc_sockaddr_set_port(&resolved->addrs[i], *port_num);
+ if (*port_num != -1 && grpc_sockaddr_get_port(&addr) == 0) {
+ grpc_sockaddr_set_port(&addr, *port_num);
}
int port_temp = -1;
- error = grpc_core::Chttp2ServerListener::Create(
- server, &resolved->addrs[i], grpc_channel_args_copy(args),
- args_modifier, &port_temp);
+ error = Chttp2ServerListener::Create(server, &addr,
+ grpc_channel_args_copy(args),
+ args_modifier, &port_temp);
if (error != GRPC_ERROR_NONE) {
error_list.push_back(error);
} else {
@@ -865,17 +940,17 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
}
}
}
- if (error_list.size() == resolved->naddrs) {
- std::string msg =
- absl::StrFormat("No address added out of total %" PRIuPTR " resolved",
- resolved->naddrs);
+ if (error_list.size() == resolved_or->size()) {
+ std::string msg = absl::StrFormat(
+ "No address added out of total %" PRIuPTR " resolved for '%s'",
+ resolved_or->size(), addr);
return GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
msg.c_str(), error_list.data(), error_list.size());
} else if (!error_list.empty()) {
std::string msg = absl::StrFormat(
"Only %" PRIuPTR " addresses added out of total %" PRIuPTR
" resolved",
- resolved->naddrs - error_list.size(), resolved->naddrs);
+ resolved_or->size() - error_list.size(), resolved_or->size());
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_std_string(error).c_str());
@@ -884,15 +959,143 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
}
return GRPC_ERROR_NONE;
}(); // lambda end
- for (grpc_error_handle error : error_list) {
+ for (const grpc_error_handle& error : error_list) {
GRPC_ERROR_UNREF(error);
}
grpc_channel_args_destroy(args);
- if (resolved != nullptr) {
- grpc_resolved_addresses_destroy(resolved);
- }
if (error != GRPC_ERROR_NONE) *port_num = 0;
return error;
}
} // namespace grpc_core
+
+namespace {
+
+grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
+ grpc_error_handle* error) {
+ grpc_server_credentials* server_credentials =
+ grpc_find_server_credentials_in_args(args);
+ if (server_credentials == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not find server credentials");
+ return args;
+ }
+ auto security_connector = server_credentials->create_security_connector(args);
+ if (security_connector == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unable to create secure server with credentials of type ",
+ server_credentials->type()));
+ return args;
+ }
+ grpc_arg arg_to_add =
+ grpc_security_connector_to_arg(security_connector.get());
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
+ grpc_channel_args_destroy(args);
+ return new_args;
+}
+
+} // namespace
+
+int grpc_server_add_http2_port(grpc_server* server, const char* addr,
+ grpc_server_credentials* creds) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_error_handle err = GRPC_ERROR_NONE;
+ grpc_core::RefCountedPtr<grpc_server_security_connector> sc;
+ int port_num = 0;
+ grpc_channel_args* args = nullptr;
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
+ GRPC_API_TRACE("grpc_server_add_http2_port(server=%p, addr=%s, creds=%p)", 3,
+ (server, addr, creds));
+ // Create security context.
+ if (creds == nullptr) {
+ err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No credentials specified for secure server port (creds==NULL)");
+ goto done;
+ }
+ // TODO(yashykt): Ideally, we would not want to have different behavior here
+ // based on whether a config fetcher is configured or not. Currently, we have
+ // a feature for SSL credentials reloading with an application callback that
+ // assumes that there is a single security connector. If we delay the creation
+ // of the security connector to after the creation of the listener(s), we
+ // would have potentially multiple security connectors which breaks the
+ // assumption for SSL creds reloading. When the API for SSL creds reloading is
+ // rewritten, we would be able to make this workaround go away by removing
+ // that assumption. As an immediate drawback of this workaround, config
+ // fetchers need to be registered before adding ports to the server.
+ if (core_server->config_fetcher() != nullptr) {
+ // Create channel args.
+ grpc_arg arg_to_add = grpc_server_credentials_to_arg(creds);
+ args = grpc_channel_args_copy_and_add(core_server->channel_args(),
+ &arg_to_add, 1);
+ } else {
+ sc = creds->create_security_connector(nullptr);
+ if (sc == nullptr) {
+ err = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Unable to create secure server with credentials of type ",
+ creds->type()));
+ goto done;
+ }
+ grpc_arg args_to_add[2];
+ 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(
+ core_server->channel_args(), args_to_add, GPR_ARRAY_SIZE(args_to_add));
+ }
+ // Add server port.
+ err = grpc_core::Chttp2ServerAddPort(core_server, addr, args,
+ ModifyArgsForConnection, &port_num);
+done:
+ sc.reset(DEBUG_LOCATION, "server");
+ if (err != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
+
+ GRPC_ERROR_UNREF(err);
+ }
+ return port_num;
+}
+
+#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
+void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
+ grpc_server_credentials* creds) {
+ // For now, we only support insecure server credentials
+ if (creds == nullptr ||
+ creds->type() != grpc_core::InsecureServerCredentials::Type()) {
+ gpr_log(GPR_ERROR, "Failed to create channel due to invalid creds");
+ return;
+ }
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
+
+ const grpc_channel_args* server_args = core_server->channel_args();
+ std::string name = absl::StrCat("fd:", fd);
+ auto memory_quota =
+ grpc_core::ResourceQuotaFromChannelArgs(server_args)->memory_quota();
+ grpc_endpoint* server_endpoint = grpc_tcp_create(
+ grpc_fd_create(fd, name.c_str(), true), server_args, name);
+ grpc_transport* transport = grpc_create_chttp2_transport(
+ server_args, server_endpoint, false /* is_client */
+ );
+ grpc_error_handle error =
+ core_server->SetupTransport(transport, nullptr, server_args, nullptr);
+ if (error == GRPC_ERROR_NONE) {
+ for (grpc_pollset* pollset : core_server->pollsets()) {
+ grpc_endpoint_add_to_pollset(server_endpoint, pollset);
+ }
+ grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
+ } else {
+ gpr_log(GPR_ERROR, "Failed to create channel: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ grpc_transport_destroy(transport);
+ }
+}
+
+#else // !GPR_SUPPORT_CHANNELS_FROM_FD
+
+void grpc_server_add_channel_from_fd(grpc_server* /* server */, int /* fd */,
+ grpc_server_credentials* /* creds */) {
+ GPR_ASSERT(0);
+}
+
+#endif // GPR_SUPPORT_CHANNELS_FROM_FD
diff --git a/grpc/src/core/ext/transport/chttp2/server/insecure/README.md b/grpc/src/core/ext/transport/chttp2/server/insecure/README.md
deleted file mode 100644
index fc0bc14e..00000000
--- a/grpc/src/core/ext/transport/chttp2/server/insecure/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Plugin for creating insecure servers using chttp2
diff --git a/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc b/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
deleted file mode 100644
index e00bc927..00000000
--- a/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/ext/transport/chttp2/server/chttp2_server.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/server.h"
-
-namespace {
-
-grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
- grpc_error_handle* /*error*/) {
- return args;
-}
-
-} // namespace
-
-int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
- grpc_core::ExecCtx exec_ctx;
- int port_num = 0;
- GRPC_API_TRACE("grpc_server_add_insecure_http2_port(server=%p, addr=%s)", 2,
- (server, addr));
- grpc_error_handle err = grpc_core::Chttp2ServerAddPort(
- server->core_server.get(), addr,
- grpc_channel_args_copy(server->core_server->channel_args()),
- ModifyArgsForConnection, &port_num);
- if (err != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
-
- GRPC_ERROR_UNREF(err);
- }
- return port_num;
-}
diff --git a/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
deleted file mode 100644
index fd57939f..00000000
--- a/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-#include <grpc/grpc_posix.h>
-#include <grpc/support/log.h>
-
-#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
-
-#include "absl/strings/str_cat.h"
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/tcp_posix.h"
-#include "src/core/lib/surface/completion_queue.h"
-#include "src/core/lib/surface/server.h"
-
-void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- void* reserved, int fd) {
- GPR_ASSERT(reserved == nullptr);
-
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Server* core_server = server->core_server.get();
-
- const grpc_channel_args* server_args = core_server->channel_args();
- std::string name = 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 */);
-
- grpc_error_handle error =
- core_server->SetupTransport(transport, nullptr, server_args, nullptr);
- if (error == GRPC_ERROR_NONE) {
- for (grpc_pollset* pollset : core_server->pollsets()) {
- grpc_endpoint_add_to_pollset(server_endpoint, pollset);
- }
- grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
- } else {
- gpr_log(GPR_ERROR, "Failed to create channel: %s",
- grpc_error_std_string(error).c_str());
- GRPC_ERROR_UNREF(error);
- grpc_transport_destroy(transport);
- }
-}
-
-#else // !GPR_SUPPORT_CHANNELS_FROM_FD
-
-void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- void* reserved, int fd) {
- GPR_ASSERT(0);
-}
-
-#endif // GPR_SUPPORT_CHANNELS_FROM_FD
diff --git a/grpc/src/core/ext/transport/chttp2/server/secure/README.md b/grpc/src/core/ext/transport/chttp2/server/secure/README.md
deleted file mode 100644
index 6bda696a..00000000
--- a/grpc/src/core/ext/transport/chttp2/server/secure/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Plugin for creating secure servers using chttp2
diff --git a/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc b/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
deleted file mode 100644
index f0a0eed9..00000000
--- a/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * 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 <string.h>
-
-#include "absl/strings/str_cat.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/ext/transport/chttp2/server/chttp2_server.h"
-
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/handshaker.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/server.h"
-
-namespace {
-
-grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
- grpc_error_handle* error) {
- grpc_server_credentials* server_credentials =
- grpc_find_server_credentials_in_args(args);
- if (server_credentials == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Could not find server credentials");
- return args;
- }
- auto security_connector = server_credentials->create_security_connector(args);
- if (security_connector == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Unable to create secure server with credentials of type ",
- server_credentials->type())
- .c_str());
- return args;
- }
- grpc_arg arg_to_add =
- grpc_security_connector_to_arg(security_connector.get());
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
- grpc_channel_args_destroy(args);
- return new_args;
-}
-
-} // namespace
-
-int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
- grpc_server_credentials* creds) {
- grpc_core::ExecCtx exec_ctx;
- grpc_error_handle err = GRPC_ERROR_NONE;
- grpc_core::RefCountedPtr<grpc_server_security_connector> sc;
- int port_num = 0;
- grpc_channel_args* args = nullptr;
- GRPC_API_TRACE(
- "grpc_server_add_secure_http2_port("
- "server=%p, addr=%s, creds=%p)",
- 3, (server, addr, creds));
- // Create security context.
- if (creds == nullptr) {
- err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No credentials specified for secure server port (creds==NULL)");
- goto done;
- }
- // TODO(yashykt): Ideally, we would not want to have different behavior here
- // based on whether a config fetcher is configured or not. Currently, we have
- // a feature for SSL credentials reloading with an application callback that
- // assumes that there is a single security connector. If we delay the creation
- // of the security connector to after the creation of the listener(s), we
- // would have potentially multiple security connectors which breaks the
- // assumption for SSL creds reloading. When the API for SSL creds reloading is
- // rewritten, we would be able to make this workaround go away by removing
- // that assumption. As an immediate drawback of this workaround, config
- // fetchers need to be registered before adding ports to the server.
- if (server->core_server->config_fetcher() != nullptr) {
- // Create channel args.
- grpc_arg arg_to_add = grpc_server_credentials_to_arg(creds);
- args = grpc_channel_args_copy_and_add(server->core_server->channel_args(),
- &arg_to_add, 1);
- } else {
- sc = creds->create_security_connector(nullptr);
- if (sc == nullptr) {
- err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- "Unable to create secure server with credentials of type ",
- creds->type())
- .c_str());
- goto done;
- }
- grpc_arg args_to_add[2];
- 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(),
- args_to_add,
- GPR_ARRAY_SIZE(args_to_add));
- }
- // Add server port.
- err = grpc_core::Chttp2ServerAddPort(server->core_server.get(), addr, args,
- ModifyArgsForConnection, &port_num);
-done:
- sc.reset(DEBUG_LOCATION, "server");
- if (err != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
-
- GRPC_ERROR_UNREF(err);
- }
- return port_num;
-}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc b/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
index 2906a5d2..4be4cc25 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
@@ -18,9 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/transport/chttp2/transport/bin_decoder.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"
@@ -146,7 +148,7 @@ bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) {
switch (input_tail) {
case 3:
ctx->output_cur[1] = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur);
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 2:
ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur);
}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h b/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
index 1cbca033..a2d61420 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
#include <stdbool.h>
+#include <grpc/slice.h>
+
struct grpc_base64_decode_context {
/* input/output: */
const uint8_t* input_cur;
diff --git a/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc b/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
index ba39bbdb..cd92f726 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
@@ -23,6 +23,7 @@
#include <string.h>
#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/huffsyms.h"
static const char alphabet[] =
diff --git a/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc b/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
deleted file mode 100644
index ac13d73d..00000000
--- a/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * 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/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/global_config.h"
-#include "src/core/lib/transport/metadata.h"
-
-GPR_GLOBAL_CONFIG_DEFINE_BOOL(
- grpc_experimental_disable_flow_control, false,
- "If set, flow control will be effectively disabled. Max out all values and "
- "assume the remote peer does the same. Thus we can ignore any flow control "
- "bookkeeping, error checking, and decision making");
-
-void grpc_chttp2_plugin_init(void) {
- g_flow_control_enabled =
- !GPR_GLOBAL_CONFIG_GET(grpc_experimental_disable_flow_control);
-}
-
-void grpc_chttp2_plugin_shutdown(void) {}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index 1ff64756..df180d30 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -18,25 +18,25 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
#include "absl/strings/str_format.h"
#include <grpc/slice_buffer.h>
+#include <grpc/status.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>
-#include <stdio.h>
-#include <string.h>
#include "src/core/ext/transport/chttp2/transport/context_list.h"
#include "src/core/ext/transport/chttp2/transport/frame_data.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/compression/stream_compression.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
@@ -46,17 +46,24 @@
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/trace.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/http2_errors.h"
-#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/timeout_encoding.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/lib/transport/transport_impl.h"
#include "src/core/lib/uri/uri_parser.h"
+GPR_GLOBAL_CONFIG_DEFINE_BOOL(
+ grpc_experimental_disable_flow_control, false,
+ "If set, flow control will be effectively disabled. Max out all values and "
+ "assume the remote peer does the same. Thus we can ignore any flow control "
+ "bookkeeping, error checking, and decision making");
+
#define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024)
#define MAX_WINDOW 0x7fffffffu
#define MAX_WRITE_BUFFER_SIZE (64 * 1024 * 1024)
@@ -126,8 +133,6 @@ static void connectivity_state_set(grpc_chttp2_transport* t,
const absl::Status& status,
const char* reason);
-static void benign_reclaimer(void* arg, grpc_error_handle error);
-static void destructive_reclaimer(void* arg, grpc_error_handle error);
static void benign_reclaimer_locked(void* arg, grpc_error_handle error);
static void destructive_reclaimer_locked(void* arg, grpc_error_handle error);
@@ -164,16 +169,13 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error_handle error);
static void reset_byte_stream(void* arg, grpc_error_handle error);
-// Flow control default enabled. Can be disabled by setting
-// GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
-bool g_flow_control_enabled = true;
-
namespace grpc_core {
namespace {
TestOnlyGlobalHttp2TransportInitCallback test_only_init_callback = nullptr;
TestOnlyGlobalHttp2TransportDestructCallback test_only_destruct_callback =
nullptr;
+bool test_only_disable_transient_failure_state_notification = false;
} // namespace
void TestOnlySetGlobalHttp2TransportInitCallback(
@@ -186,6 +188,11 @@ void TestOnlySetGlobalHttp2TransportDestructCallback(
test_only_destruct_callback = callback;
}
+void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(
+ bool disable) {
+ test_only_disable_transient_failure_state_notification = disable;
+}
+
} // namespace grpc_core
//
@@ -204,7 +211,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
grpc_slice_buffer_destroy_internal(&qbuf);
grpc_slice_buffer_destroy_internal(&outbuf);
- grpc_chttp2_hpack_compressor_destroy(&hpack_compressor);
grpc_error_handle error =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed");
@@ -215,7 +221,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
cl = nullptr;
grpc_slice_buffer_destroy_internal(&read_buffer);
- grpc_chttp2_hpack_parser_destroy(&hpack_parser);
grpc_chttp2_goaway_parser_destroy(&goaway_parser);
for (i = 0; i < STREAM_LIST_COUNT; i++) {
@@ -281,8 +286,7 @@ static bool read_channel_args(grpc_chttp2_transport* t,
const int value =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
if (value >= 0) {
- grpc_chttp2_hpack_compressor_set_max_usable_size(
- &t->hpack_compressor, static_cast<uint32_t>(value));
+ t->hpack_compressor.SetMaxUsableSize(value);
}
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) {
@@ -297,11 +301,11 @@ static bool read_channel_args(grpc_chttp2_transport* t,
strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS)) {
t->ping_policy.min_recv_ping_interval_without_data =
- grpc_channel_arg_get_integer(
+ grpc_core::Duration::Milliseconds(grpc_channel_arg_get_integer(
&channel_args->args[i],
grpc_integer_options{
g_default_min_recv_ping_interval_without_data_ms, 0,
- INT_MAX});
+ INT_MAX}));
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) {
t->write_buffer_size = static_cast<uint32_t>(grpc_channel_arg_get_integer(
@@ -317,7 +321,9 @@ static bool read_channel_args(grpc_chttp2_transport* t,
? g_default_client_keepalive_time_ms
: g_default_server_keepalive_time_ms,
1, INT_MAX});
- t->keepalive_time = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
+ t->keepalive_time = value == INT_MAX
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(value);
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
const int value = grpc_channel_arg_get_integer(
@@ -326,7 +332,9 @@ static bool read_channel_args(grpc_chttp2_transport* t,
? g_default_client_keepalive_timeout_ms
: g_default_server_keepalive_timeout_ms,
0, INT_MAX});
- t->keepalive_timeout = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
+ t->keepalive_timeout = value == INT_MAX
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(value);
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) {
t->keepalive_permit_without_calls = static_cast<uint32_t>(
@@ -402,20 +410,24 @@ static bool read_channel_args(grpc_chttp2_transport* t,
static void init_transport_keepalive_settings(grpc_chttp2_transport* t) {
if (t->is_client) {
t->keepalive_time = g_default_client_keepalive_time_ms == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : g_default_client_keepalive_time_ms;
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(
+ g_default_client_keepalive_time_ms);
t->keepalive_timeout = g_default_client_keepalive_timeout_ms == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : g_default_client_keepalive_timeout_ms;
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(
+ g_default_client_keepalive_timeout_ms);
t->keepalive_permit_without_calls =
g_default_client_keepalive_permit_without_calls;
} else {
t->keepalive_time = g_default_server_keepalive_time_ms == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : g_default_server_keepalive_time_ms;
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(
+ g_default_server_keepalive_time_ms);
t->keepalive_timeout = g_default_server_keepalive_timeout_ms == INT_MAX
- ? GRPC_MILLIS_INF_FUTURE
- : g_default_server_keepalive_timeout_ms;
+ ? grpc_core::Duration::Infinity()
+ : grpc_core::Duration::Milliseconds(
+ g_default_server_keepalive_timeout_ms);
t->keepalive_permit_without_calls =
g_default_server_keepalive_permit_without_calls;
}
@@ -425,11 +437,12 @@ static void configure_transport_ping_policy(grpc_chttp2_transport* t) {
t->ping_policy.max_pings_without_data = g_default_max_pings_without_data;
t->ping_policy.max_ping_strikes = g_default_max_ping_strikes;
t->ping_policy.min_recv_ping_interval_without_data =
- g_default_min_recv_ping_interval_without_data_ms;
+ grpc_core::Duration::Milliseconds(
+ g_default_min_recv_ping_interval_without_data_ms);
}
static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
- if (t->keepalive_time != GRPC_MILLIS_INF_FUTURE) {
+ if (t->keepalive_time != grpc_core::Duration::Infinity()) {
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING;
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
@@ -445,14 +458,18 @@ static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
}
grpc_chttp2_transport::grpc_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user)
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client)
: refs(1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_refcount)
? "chttp2_refcount"
: nullptr),
ep(ep),
peer_string(grpc_endpoint_get_peer(ep)),
- resource_user(resource_user),
+ memory_owner(grpc_core::ResourceQuotaFromChannelArgs(channel_args)
+ ->memory_quota()
+ ->CreateMemoryOwner(absl::StrCat(
+ grpc_endpoint_get_peer(ep), ":client_transport"))),
+ self_reservation(
+ memory_owner.MakeReservation(sizeof(grpc_chttp2_transport))),
combiner(grpc_combiner_create()),
state_tracker(is_client ? "client_transport" : "server_transport",
GRPC_CHANNEL_READY),
@@ -475,7 +492,6 @@ grpc_chttp2_transport::grpc_chttp2_transport(
grpc_slice_buffer_add(&outbuf, grpc_slice_from_copied_string(
GRPC_CHTTP2_CLIENT_CONNECT_STRING));
}
- grpc_chttp2_hpack_compressor_init(&hpack_compressor);
grpc_slice_buffer_init(&qbuf);
// copy in initial settings to all setting sets
size_t i;
@@ -485,7 +501,6 @@ grpc_chttp2_transport::grpc_chttp2_transport(
settings[j][i] = grpc_chttp2_settings_parameters[i].default_value;
}
}
- grpc_chttp2_hpack_parser_init(&hpack_parser);
grpc_chttp2_goaway_parser_init(&goaway_parser);
// configure http2 the way we like it
@@ -506,7 +521,9 @@ grpc_chttp2_transport::grpc_chttp2_transport(
enable_bdp = read_channel_args(this, channel_args, is_client);
}
- if (g_flow_control_enabled) {
+ static const bool kEnableFlowControl =
+ !GPR_GLOBAL_CONFIG_GET(grpc_experimental_disable_flow_control);
+ if (kEnableFlowControl) {
flow_control.Init<grpc_core::chttp2::TransportFlowControl>(this,
enable_bdp);
} else {
@@ -517,9 +534,9 @@ grpc_chttp2_transport::grpc_chttp2_transport(
// 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;
+ ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
- ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
+ ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast();
ping_recv_state.ping_strikes = 0;
init_keepalive_pings_if_enabled(this);
@@ -544,6 +561,7 @@ static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
t, grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed"),
GRPC_ERROR_INT_OCCURRED_DURING_WRITE, t->write_state));
+ t->memory_owner.Reset();
// Must be the last line.
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destroy");
}
@@ -564,7 +582,7 @@ static void close_transport_locked(grpc_chttp2_transport* t,
GRPC_STATUS_UNAVAILABLE);
}
if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
- if (t->close_transport_on_writes_finished == nullptr) {
+ if (t->close_transport_on_writes_finished == GRPC_ERROR_NONE) {
t->close_transport_on_writes_finished =
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Delayed close due to in-progress write");
@@ -649,8 +667,8 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
: t(t),
refcount(refcount),
reffer(this),
- metadata_buffer{grpc_chttp2_incoming_metadata_buffer(arena),
- grpc_chttp2_incoming_metadata_buffer(arena)} {
+ initial_metadata_buffer(arena),
+ trailing_metadata_buffer(arena) {
if (server_data) {
id = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(server_data));
*t->accepting_stream = this;
@@ -688,13 +706,6 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
grpc_slice_buffer_destroy_internal(&unprocessed_incoming_frames_buffer);
grpc_slice_buffer_destroy_internal(&frame_storage);
- if (stream_compression_method != GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
- grpc_slice_buffer_destroy_internal(&compressed_data_buffer);
- }
- if (stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
- grpc_slice_buffer_destroy_internal(&decompressed_data_buffer);
- }
for (int i = 0; i < STREAM_LIST_COUNT; i++) {
if (GPR_UNLIKELY(included[i])) {
@@ -714,13 +725,7 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
GRPC_ERROR_UNREF(read_closed_error);
GRPC_ERROR_UNREF(write_closed_error);
GRPC_ERROR_UNREF(byte_stream_error);
-
flow_control.Destroy();
-
- if (t->resource_user != nullptr) {
- grpc_resource_user_free(t->resource_user, GRPC_RESOURCE_QUOTA_CALL_SIZE);
- }
-
GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, GRPC_ERROR_NONE);
}
@@ -745,18 +750,6 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
GPR_TIMER_SCOPE("destroy_stream", 0);
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
- if (s->stream_compression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS &&
- s->stream_compression_ctx != nullptr) {
- grpc_stream_compression_context_destroy(s->stream_compression_ctx);
- s->stream_compression_ctx = nullptr;
- }
- if (s->stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS &&
- s->stream_decompression_ctx != nullptr) {
- grpc_stream_compression_context_destroy(s->stream_decompression_ctx);
- s->stream_decompression_ctx = nullptr;
- }
s->destroy_stream_arg = then_schedule_closure;
t->combiner->Run(
@@ -769,18 +762,6 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
if (t->accept_stream_cb == nullptr) {
return nullptr;
}
- // Don't accept the stream if memory quota doesn't allow. Note that we should
- // simply refuse the stream here instead of canceling the stream after it's
- // accepted since the latter will create the call which costs much memory.
- if (t->resource_user != nullptr &&
- !grpc_resource_user_safe_alloc(t->resource_user,
- GRPC_RESOURCE_QUOTA_CALL_SIZE)) {
- gpr_log(GPR_ERROR, "Memory exhausted, rejecting the stream.");
- grpc_chttp2_add_rst_stream_to_next_write(t, id, GRPC_HTTP2_REFUSED_STREAM,
- nullptr);
- grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
- return nullptr;
- }
grpc_chttp2_stream* accepting = nullptr;
GPR_ASSERT(t->accepting_stream == nullptr);
t->accepting_stream = &accepting;
@@ -821,9 +802,9 @@ static void set_write_state(grpc_chttp2_transport* t,
// 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) {
+ if (t->close_transport_on_writes_finished != GRPC_ERROR_NONE) {
grpc_error_handle err = t->close_transport_on_writes_finished;
- t->close_transport_on_writes_finished = nullptr;
+ t->close_transport_on_writes_finished = GRPC_ERROR_NONE;
close_transport_locked(t, err);
}
}
@@ -871,6 +852,9 @@ static void inc_initiate_write_reason(
case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS();
break;
+ case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
+ GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK();
+ break;
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING();
break;
@@ -1025,8 +1009,8 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
closed = true;
}
- if (t->sent_goaway_state == GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED) {
- t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SENT;
+ if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED) {
+ t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SENT;
closed = true;
if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
close_transport_locked(
@@ -1070,7 +1054,7 @@ static void queue_setting_update(grpc_chttp2_transport* t,
grpc_chttp2_setting_id id, uint32_t value) {
const grpc_chttp2_setting_parameters* sp =
&grpc_chttp2_settings_parameters[id];
- uint32_t use_value = GPR_CLAMP(value, sp->min_value, sp->max_value);
+ uint32_t use_value = grpc_core::Clamp(value, sp->min_value, sp->max_value);
if (use_value != value) {
gpr_log(GPR_INFO, "Requested parameter %s clamped from %d to %d", sp->name,
value, use_value);
@@ -1081,10 +1065,23 @@ static void queue_setting_update(grpc_chttp2_transport* t,
}
}
+// Cancel out streams that haven't yet started if we have received a GOAWAY
+static void cancel_unstarted_streams(grpc_chttp2_transport* t,
+ grpc_error_handle error) {
+ grpc_chttp2_stream* s;
+ while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcStreamNetworkState(),
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
+ grpc_chttp2_cancel_stream(t, s, GRPC_ERROR_REF(error));
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
- const grpc_slice& goaway_text) {
+ absl::string_view goaway_text) {
// Discard the error from a previous goaway frame (if any)
if (t->goaway_error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(t->goaway_error);
@@ -1106,6 +1103,24 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
goaway_error, grpc_error_std_string(t->goaway_error).c_str());
}
+ if (t->is_client) {
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(t->goaway_error));
+ // Cancel all unseen streams
+ grpc_chttp2_stream_map_for_each(
+ &t->stream_map,
+ [](void* user_data, uint32_t /* key */, void* stream) {
+ uint32_t last_stream_id = *(static_cast<uint32_t*>(user_data));
+ grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
+ if (s->id > last_stream_id) {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcStreamNetworkState(),
+ grpc_core::GrpcStreamNetworkState::kNotSeenByServer);
+ grpc_chttp2_cancel_stream(s->t, s,
+ GRPC_ERROR_REF(s->t->goaway_error));
+ }
+ },
+ &last_stream_id);
+ }
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
@@ -1113,38 +1128,33 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
// 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)) {
+ goaway_text == "too_many_pings")) {
gpr_log(GPR_ERROR,
"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 auto max_keepalive_time = grpc_core::Duration::Milliseconds(
+ INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
t->keepalive_time =
- 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);
+ t->keepalive_time > max_keepalive_time
+ ? grpc_core::Duration::Infinity()
+ : t->keepalive_time * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
- absl::Cord(std::to_string(t->keepalive_time)));
+ absl::Cord(std::to_string(t->keepalive_time.millis())));
}
// lie: use transient failure from the transport to indicate goaway has been
// received.
- connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
- "got_goaway");
+ if (!grpc_core::test_only_disable_transient_failure_state_notification) {
+ 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
+ // maybe 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(
- t, s,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
- }
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(t->goaway_error));
return;
}
// start streams where we have free grpc_chttp2_stream ids and free
@@ -1179,6 +1189,9 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
// 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)) {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcStreamNetworkState(),
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
grpc_chttp2_cancel_stream(
t, s,
grpc_error_set_int(
@@ -1233,36 +1246,49 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
write_state_name(t->write_state));
}
if (error != GRPC_ERROR_NONE) {
- if (closure->error_data.error == GRPC_ERROR_NONE) {
- closure->error_data.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle cl_err =
+ grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
+#else
+ grpc_error_handle cl_err =
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
+#endif
+ if (cl_err == GRPC_ERROR_NONE) {
+ cl_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"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()));
+ cl_err = grpc_error_set_str(cl_err, GRPC_ERROR_STR_TARGET_ADDRESS,
+ t->peer_string);
}
- closure->error_data.error =
- grpc_error_add_child(closure->error_data.error, error);
+ cl_err = grpc_error_add_child(cl_err, error);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(cl_err);
+#else
+ closure->error_data.error = reinterpret_cast<intptr_t>(cl_err);
+#endif
}
if (closure->next_data.scratch < CLOSURE_BARRIER_FIRST_REF_BIT) {
if ((t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
!(closure->next_data.scratch & CLOSURE_BARRIER_MAY_COVER_WRITE)) {
// Using GRPC_CLOSURE_SCHED instead of GRPC_CLOSURE_RUN to avoid running
// closures earlier than when it is safe to do so.
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure,
- closure->error_data.error);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle run_error =
+ grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
+#else
+ grpc_error_handle run_error =
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
+#endif
+ closure->error_data.error = 0;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, run_error);
} else {
- grpc_closure_list_append(&t->run_after_write, closure,
- closure->error_data.error);
+ grpc_closure_list_append(&t->run_after_write, closure);
}
}
}
static bool contains_non_ok_status(grpc_metadata_batch* batch) {
- if (batch->idx.named.grpc_status != nullptr) {
- return !grpc_mdelem_static_value_eq(batch->idx.named.grpc_status->md,
- GRPC_MDELEM_GRPC_STATUS_0);
- }
- return false;
+ return batch->get(grpc_core::GrpcStatusMetadata()).value_or(GRPC_STATUS_OK) !=
+ GRPC_STATUS_OK;
}
static void maybe_become_writable_due_to_send_msg(grpc_chttp2_transport* t,
@@ -1288,7 +1314,6 @@ static void continue_fetching_send_locked(grpc_chttp2_transport* t,
if (s->fetching_send_message == nullptr) {
// Stream was cancelled before message fetch completed
abort(); /* TODO(ctiller): what cleanup here? */
- return; /* early out */
}
if (s->fetched_send_message_length == s->fetching_send_message->length()) {
int64_t notify_offset = s->next_message_end_offset;
@@ -1356,15 +1381,11 @@ static void complete_fetch_locked(void* gs, grpc_error_handle error) {
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
bool is_client, bool is_initial) {
- for (grpc_linked_mdelem* md = md_batch->list.head; md != nullptr;
- md = md->next) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
- gpr_log(GPR_INFO, "HTTP:%d:%s:%s: %s: %s", id, is_initial ? "HDR" : "TRL",
- is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
- }
+ const std::string prefix = absl::StrCat(
+ "HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
+ md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
+ gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
+ });
}
static void perform_stream_op_locked(void* stream_op,
@@ -1383,8 +1404,10 @@ 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=%p; op=%p]: %s; on_complete = %p", s,
+ op, 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);
@@ -1401,7 +1424,7 @@ static void perform_stream_op_locked(void* stream_op,
// This batch has send ops. Use final_data as a barrier until enqueue time;
// the initial counter is dropped at the end of this function.
on_complete->next_data.scratch = CLOSURE_BARRIER_FIRST_REF_BIT;
- on_complete->error_data.error = GRPC_ERROR_NONE;
+ on_complete->error_data.error = 0;
}
if (op->cancel_stream) {
@@ -1417,27 +1440,14 @@ 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
- if (op_payload->send_initial_metadata.send_initial_metadata->idx.named
- .content_encoding == nullptr ||
- grpc_stream_compression_method_parse(
- GRPC_MDVALUE(
- op_payload->send_initial_metadata.send_initial_metadata->idx
- .named.content_encoding->md),
- true, &s->stream_compression_method) == 0) {
- s->stream_compression_method = GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS;
- }
- if (s->stream_compression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
- s->uncompressed_data_size = 0;
- s->stream_compression_ctx = nullptr;
- grpc_slice_buffer_init(&s->compressed_data_buffer);
- }
s->send_initial_metadata_finished = add_closure_barrier(on_complete);
s->send_initial_metadata =
op_payload->send_initial_metadata.send_initial_metadata;
if (t->is_client) {
- s->deadline = GPR_MIN(s->deadline, s->send_initial_metadata->deadline);
+ s->deadline = std::min(
+ s->deadline,
+ s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(grpc_core::Timestamp::InfFuture()));
}
if (contains_non_ok_status(s->send_initial_metadata)) {
s->seen_error = true;
@@ -1449,6 +1459,9 @@ static void perform_stream_op_locked(void* stream_op,
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
maybe_start_some_streams(t);
} else {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcStreamNetworkState(),
+ grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
grpc_chttp2_cancel_stream(
t, s,
grpc_error_set_int(
@@ -1543,8 +1556,7 @@ static void perform_stream_op_locked(void* stream_op,
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)
+ op->payload->send_trailing_metadata.send_trailing_metadata->empty()
? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Attempt to send trailing metadata after "
@@ -1582,6 +1594,8 @@ static void perform_stream_op_locked(void* stream_op,
GPR_ASSERT(!s->pending_byte_stream);
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
s->recv_message = op_payload->recv_message.recv_message;
+ s->call_failed_before_recv_message =
+ op_payload->recv_message.call_failed_before_recv_message;
if (s->id != 0) {
if (!s->read_closed) {
before = s->frame_storage.length +
@@ -1591,8 +1605,7 @@ static void perform_stream_op_locked(void* stream_op,
grpc_chttp2_maybe_complete_recv_message(t, s);
if (s->id != 0) {
if (!s->read_closed && s->frame_storage.length == 0) {
- size_t after = s->frame_storage.length +
- s->unprocessed_incoming_frames_buffer_cached_length;
+ size_t after = s->unprocessed_incoming_frames_buffer_cached_length;
s->flow_control->IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
before - after);
grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
@@ -1629,19 +1642,19 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (!t->is_client) {
if (op->send_initial_metadata) {
- grpc_millis deadline =
- op->payload->send_initial_metadata.send_initial_metadata->deadline;
- GPR_ASSERT(deadline == GRPC_MILLIS_INF_FUTURE);
+ GPR_ASSERT(!op->payload->send_initial_metadata.send_initial_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .has_value());
}
if (op->send_trailing_metadata) {
- grpc_millis deadline =
- op->payload->send_trailing_metadata.send_trailing_metadata->deadline;
- GPR_ASSERT(deadline == GRPC_MILLIS_INF_FUTURE);
+ GPR_ASSERT(!op->payload->send_trailing_metadata.send_trailing_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .has_value());
}
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s,
+ gpr_log(GPR_INFO, "perform_stream_op[s=%p; op=%p]: %s", s, op,
grpc_transport_stream_op_batch_string(op).c_str());
}
@@ -1749,18 +1762,120 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
}
}
+namespace {
+
+// Fire and forget (deletes itself on completion). Does a graceful shutdown by
+// sending a GOAWAY frame with the last stream id set to 2^31-1, sending a ping
+// and waiting for an ack (effective waiting for an RTT) and then sending a
+// final GOAWAY freame with an updated last stream identifier. This helps ensure
+// that a connection can be cleanly shut down without losing requests.
+// In the event, that the client does not respond to the ping for some reason,
+// we add a 20 second deadline, after which we send the second goaway.
+class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
+ public:
+ static void Start(grpc_chttp2_transport* t) { new GracefulGoaway(t); }
+
+ ~GracefulGoaway() override {
+ GRPC_CHTTP2_UNREF_TRANSPORT(t_, "graceful goaway");
+ }
+
+ private:
+ explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t) {
+ t->sent_goaway_state = GRPC_CHTTP2_GRACEFUL_GOAWAY;
+ GRPC_CHTTP2_REF_TRANSPORT(t_, "graceful goaway");
+ grpc_chttp2_goaway_append((1u << 31) - 1, 0, grpc_empty_slice(), &t->qbuf);
+ send_ping_locked(
+ t, nullptr, GRPC_CLOSURE_INIT(&on_ping_ack_, OnPingAck, this, nullptr));
+ grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
+ Ref().release(); // Ref for the timer
+ grpc_timer_init(
+ &timer_,
+ grpc_core::ExecCtx::Get()->Now() + grpc_core::Duration::Seconds(20),
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr));
+ }
+
+ void MaybeSendFinalGoawayLocked() {
+ if (t_->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) {
+ // We already sent the final GOAWAY.
+ return;
+ }
+ if (t_->destroying || t_->closed_with_error != GRPC_ERROR_NONE) {
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
+ GPR_INFO,
+ "transport:%p %s peer:%s Transport already shutting down. "
+ "Graceful GOAWAY abandoned.",
+ t_, t_->is_client ? "CLIENT" : "SERVER", t_->peer_string.c_str()));
+ return;
+ }
+ // Ping completed. Send final goaway.
+ GRPC_CHTTP2_IF_TRACING(
+ gpr_log(GPR_INFO,
+ "transport:%p %s peer:%s Graceful shutdown: Ping received. "
+ "Sending final GOAWAY with stream_id:%d",
+ t_, t_->is_client ? "CLIENT" : "SERVER",
+ t_->peer_string.c_str(), t_->last_new_stream_id));
+ t_->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
+ grpc_chttp2_goaway_append(t_->last_new_stream_id, 0, grpc_empty_slice(),
+ &t_->qbuf);
+ grpc_chttp2_initiate_write(t_, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
+ }
+
+ static void OnPingAck(void* arg, grpc_error_handle /* error */) {
+ auto* self = static_cast<GracefulGoaway*>(arg);
+ self->t_->combiner->Run(
+ GRPC_CLOSURE_INIT(&self->on_ping_ack_, OnPingAckLocked, self, nullptr),
+ GRPC_ERROR_NONE);
+ }
+
+ static void OnPingAckLocked(void* arg, grpc_error_handle /* error */) {
+ auto* self = static_cast<GracefulGoaway*>(arg);
+ grpc_timer_cancel(&self->timer_);
+ self->MaybeSendFinalGoawayLocked();
+ self->Unref();
+ }
+
+ static void OnTimer(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<GracefulGoaway*>(arg);
+ if (error != GRPC_ERROR_NONE) {
+ self->Unref();
+ return;
+ }
+ self->t_->combiner->Run(
+ GRPC_CLOSURE_INIT(&self->on_timer_, OnTimerLocked, self, nullptr),
+ GRPC_ERROR_NONE);
+ }
+
+ static void OnTimerLocked(void* arg, grpc_error_handle /* error */) {
+ auto* self = static_cast<GracefulGoaway*>(arg);
+ self->MaybeSendFinalGoawayLocked();
+ self->Unref();
+ }
+
+ grpc_chttp2_transport* t_;
+ grpc_closure on_ping_ack_;
+ grpc_timer timer_;
+ grpc_closure on_timer_;
+};
+
+} // namespace
+
static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle 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(),
- grpc_error_std_string(error).c_str());
- t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
grpc_http2_error_code http_error;
- grpc_slice slice;
- grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, nullptr, &slice,
- &http_error, nullptr);
- grpc_chttp2_goaway_append(t->last_new_stream_id,
- static_cast<uint32_t>(http_error),
- grpc_slice_ref_internal(slice), &t->qbuf);
+ std::string message;
+ grpc_error_get_status(error, grpc_core::Timestamp::InfFuture(), nullptr,
+ &message, &http_error, nullptr);
+ if (!t->is_client && http_error == GRPC_HTTP2_NO_ERROR) {
+ // Do a graceful shutdown.
+ GracefulGoaway::Start(t);
+ } else {
+ // We want to log this irrespective of whether http tracing is enabled
+ gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
+ grpc_error_std_string(error).c_str());
+ t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
+ grpc_chttp2_goaway_append(
+ t->last_new_stream_id, static_cast<uint32_t>(http_error),
+ grpc_slice_from_cpp_string(std::move(message)), &t->qbuf);
+ }
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
GRPC_ERROR_UNREF(error);
}
@@ -1782,7 +1897,7 @@ 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.last_ping_recv_time = grpc_core::Timestamp::InfPast();
t->ping_recv_state.ping_strikes = 0;
}
t->ping_state.pings_before_data_required =
@@ -1795,7 +1910,7 @@ static void perform_transport_op_locked(void* stream_op,
grpc_chttp2_transport* t =
static_cast<grpc_chttp2_transport*>(op->handler_private.extra_arg);
- if (op->goaway_error) {
+ if (op->goaway_error != GRPC_ERROR_NONE) {
send_goaway(t, op->goaway_error);
}
@@ -1851,8 +1966,8 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
// INPUT PROCESSING - GENERAL
//
-void grpc_chttp2_maybe_complete_recv_initial_metadata(
- grpc_chttp2_transport* /*t*/, grpc_chttp2_stream* s) {
+void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s) {
if (s->recv_initial_metadata_ready != nullptr &&
s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) {
if (s->seen_error) {
@@ -1862,8 +1977,17 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(
&s->unprocessed_incoming_frames_buffer);
}
}
- grpc_chttp2_incoming_metadata_buffer_publish(&s->metadata_buffer[0],
- s->recv_initial_metadata);
+ *s->recv_initial_metadata = std::move(s->initial_metadata_buffer);
+ s->recv_initial_metadata->Set(grpc_core::PeerString(), t->peer_string);
+ // If we didn't receive initial metadata from the wire and instead faked a
+ // status (due to stream cancellations for example), let upper layers know
+ // that trailing metadata is immediately available.
+ if (s->trailing_metadata_available != nullptr &&
+ s->published_metadata[0] != GRPC_METADATA_PUBLISHED_FROM_WIRE &&
+ s->published_metadata[1] == GRPC_METADATA_SYNTHESIZED_FROM_FAKE) {
+ *s->trailing_metadata_available = true;
+ s->trailing_metadata_available = nullptr;
+ }
null_then_sched_closure(&s->recv_initial_metadata_ready);
}
}
@@ -1886,48 +2010,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
if (s->unprocessed_incoming_frames_buffer.length == 0) {
grpc_slice_buffer_swap(&s->unprocessed_incoming_frames_buffer,
&s->frame_storage);
- s->unprocessed_incoming_frames_decompressed = false;
- }
- if (!s->unprocessed_incoming_frames_decompressed &&
- s->stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
- GPR_ASSERT(s->decompressed_data_buffer.length == 0);
- bool end_of_context;
- if (!s->stream_decompression_ctx) {
- s->stream_decompression_ctx =
- grpc_stream_compression_context_create(
- s->stream_decompression_method);
- }
- if (!grpc_stream_decompress(
- s->stream_decompression_ctx,
- &s->unprocessed_incoming_frames_buffer,
- &s->decompressed_data_buffer, nullptr,
- GRPC_HEADER_SIZE_IN_BYTES - s->decompressed_header_bytes,
- &end_of_context)) {
- grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
- grpc_slice_buffer_reset_and_unref_internal(
- &s->unprocessed_incoming_frames_buffer);
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Stream decompression error.");
- } else {
- s->decompressed_header_bytes += s->decompressed_data_buffer.length;
- if (s->decompressed_header_bytes == GRPC_HEADER_SIZE_IN_BYTES) {
- s->decompressed_header_bytes = 0;
- }
- error = grpc_deframe_unprocessed_incoming_frames(
- &s->data_parser, s, &s->decompressed_data_buffer, nullptr,
- s->recv_message);
- if (end_of_context) {
- grpc_stream_compression_context_destroy(
- s->stream_decompression_ctx);
- s->stream_decompression_ctx = nullptr;
- }
- }
- } else {
- error = grpc_deframe_unprocessed_incoming_frames(
- &s->data_parser, s, &s->unprocessed_incoming_frames_buffer,
- nullptr, s->recv_message);
}
+ error = grpc_deframe_unprocessed_incoming_frames(
+ &s->data_parser, s, &s->unprocessed_incoming_frames_buffer, nullptr,
+ s->recv_message);
if (error != GRPC_ERROR_NONE) {
s->seen_error = true;
grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
@@ -1947,6 +2033,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
null_then_sched_closure(&s->recv_message_ready);
} else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) {
*s->recv_message = nullptr;
+ if (s->call_failed_before_recv_message != nullptr) {
+ *s->call_failed_before_recv_message =
+ (s->published_metadata[1] != GRPC_METADATA_PUBLISHED_AT_CLOSE);
+ }
null_then_sched_closure(&s->recv_message_ready);
}
GRPC_ERROR_UNREF(error);
@@ -1971,49 +2061,20 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
!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.
- if (s->stream_decompression_method ==
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
- grpc_slice_buffer_move_first(
- &s->frame_storage,
- GPR_MIN(s->frame_storage.length, GRPC_HEADER_SIZE_IN_BYTES),
- &s->unprocessed_incoming_frames_buffer);
- if (s->unprocessed_incoming_frames_buffer.length > 0) {
- s->unprocessed_incoming_frames_decompressed = true;
- pending_data = true;
- }
- } else {
- bool end_of_context;
- if (!s->stream_decompression_ctx) {
- s->stream_decompression_ctx = grpc_stream_compression_context_create(
- s->stream_decompression_method);
- }
- if (!grpc_stream_decompress(
- s->stream_decompression_ctx, &s->frame_storage,
- &s->unprocessed_incoming_frames_buffer, nullptr,
- GRPC_HEADER_SIZE_IN_BYTES, &end_of_context)) {
- grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
- grpc_slice_buffer_reset_and_unref_internal(
- &s->unprocessed_incoming_frames_buffer);
- s->seen_error = true;
- } else {
- if (s->unprocessed_incoming_frames_buffer.length > 0) {
- s->unprocessed_incoming_frames_decompressed = true;
- pending_data = true;
- }
- if (end_of_context) {
- grpc_stream_compression_context_destroy(
- s->stream_decompression_ctx);
- s->stream_decompression_ctx = nullptr;
- }
- }
+ grpc_slice_buffer_move_first(
+ &s->frame_storage,
+ std::min(s->frame_storage.length, size_t(GRPC_HEADER_SIZE_IN_BYTES)),
+ &s->unprocessed_incoming_frames_buffer);
+ if (s->unprocessed_incoming_frames_buffer.length > 0) {
+ pending_data = true;
}
}
if (s->read_closed && s->frame_storage.length == 0 && !pending_data &&
s->recv_trailing_metadata_finished != nullptr) {
grpc_transport_move_stats(&s->stats, s->collecting_stats);
s->collecting_stats = nullptr;
- grpc_chttp2_incoming_metadata_buffer_publish(&s->metadata_buffer[1],
- s->recv_trailing_metadata);
+ *s->recv_trailing_metadata = std::move(s->trailing_metadata_buffer);
+ s->recv_trailing_metadata->Set(grpc_core::PeerString(), t->peer_string);
null_then_sched_closure(&s->recv_trailing_metadata_finished);
}
}
@@ -2045,7 +2106,7 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
post_benign_reclaimer(t);
- if (t->sent_goaway_state == GRPC_CHTTP2_GOAWAY_SENT) {
+ if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SENT) {
close_transport_locked(
t, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Last stream closed after sending GOAWAY", &error, 1));
@@ -2089,8 +2150,9 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_error_handle error) {
grpc_status_code status;
- grpc_slice slice;
- grpc_error_get_status(error, s->deadline, &status, &slice, nullptr, nullptr);
+ std::string message;
+ grpc_error_get_status(error, s->deadline, &status, &message, nullptr,
+ nullptr);
if (status != GRPC_STATUS_OK) {
s->seen_error = true;
}
@@ -2102,20 +2164,11 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
// 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];
- gpr_ltoa(status, status_string);
- GRPC_LOG_IF_ERROR("add_status",
- grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- &s->metadata_buffer[1],
- grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_STATUS,
- grpc_core::UnmanagedMemorySlice(status_string))));
- if (!GRPC_SLICE_IS_EMPTY(slice)) {
- GRPC_LOG_IF_ERROR(
- "add_status_message",
- grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- &s->metadata_buffer[1],
- grpc_mdelem_create(GRPC_MDSTR_GRPC_MESSAGE, slice, nullptr)));
+ s->trailing_metadata_buffer.Set(grpc_core::GrpcStatusMetadata(), status);
+ if (!message.empty()) {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcMessageMetadata(),
+ grpc_core::Slice::FromCopiedBuffer(message));
}
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
@@ -2255,8 +2308,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
uint8_t* p;
uint32_t len = 0;
grpc_status_code grpc_status;
- grpc_slice slice;
- grpc_error_get_status(error, s->deadline, &grpc_status, &slice, nullptr,
+ std::string message;
+ grpc_error_get_status(error, s->deadline, &grpc_status, &message, nullptr,
nullptr);
GPR_ASSERT(grpc_status >= 0 && (int)grpc_status < 100);
@@ -2349,10 +2402,10 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
GPR_ASSERT(p == GRPC_SLICE_END_PTR(status_hdr));
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(status_hdr);
- size_t msg_len = GRPC_SLICE_LENGTH(slice);
+ size_t msg_len = message.length();
GPR_ASSERT(msg_len <= UINT32_MAX);
- uint32_t msg_len_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)msg_len, 1);
- message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_len);
+ grpc_core::VarintWriter<1> msg_len_writer(msg_len);
+ message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
p = GRPC_SLICE_START_PTR(message_pfx);
*p++ = 0x00; /* literal header, not indexed */
*p++ = 12; /* len(grpc-message) */
@@ -2368,8 +2421,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
*p++ = 'a';
*p++ = 'g';
*p++ = 'e';
- GRPC_CHTTP2_WRITE_VARINT((uint32_t)msg_len, 1, 0, p, (uint32_t)msg_len_len);
- p += msg_len_len;
+ msg_len_writer.Write(0, p);
+ p += msg_len_writer.length();
GPR_ASSERT(p == GRPC_SLICE_END_PTR(message_pfx));
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(message_pfx);
len += static_cast<uint32_t>(msg_len);
@@ -2394,7 +2447,8 @@ 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_slice_buffer_add(&t->qbuf,
+ grpc_slice_from_cpp_string(std::move(message)));
grpc_chttp2_reset_ping_clock(t);
grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR,
&s->stats.outgoing);
@@ -2423,6 +2477,7 @@ static void end_all_the_calls(grpc_chttp2_transport* t,
error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE);
}
+ cancel_unstarted_streams(t, GRPC_ERROR_REF(error));
cancel_stream_cb_args args = {error, t};
grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, &args);
GRPC_ERROR_UNREF(error);
@@ -2441,7 +2496,7 @@ static void WithUrgency(grpc_chttp2_transport* t,
break;
case grpc_core::chttp2::FlowControlAction::Urgency::UPDATE_IMMEDIATELY:
grpc_chttp2_initiate_write(t, reason);
- // fallthrough
+ ABSL_FALLTHROUGH_INTENDED;
case grpc_core::chttp2::FlowControlAction::Urgency::QUEUE_UPDATE:
action();
break;
@@ -2510,7 +2565,7 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
grpc_error_handle err = error;
if (err != GRPC_ERROR_NONE) {
@@ -2519,7 +2574,7 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
t->write_state);
}
- GPR_SWAP(grpc_error_handle, err, error);
+ std::swap(err, error);
GRPC_ERROR_UNREF(err);
if (t->closed_with_error == GRPC_ERROR_NONE) {
GPR_TIMER_SCOPE("reading_action.parse", 0);
@@ -2666,7 +2721,8 @@ static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
return;
}
t->bdp_ping_started = false;
- grpc_millis next_ping = t->flow_control->bdp_estimator()->CompletePing();
+ grpc_core::Timestamp next_ping =
+ t->flow_control->bdp_estimator()->CompletePing();
grpc_chttp2_act_on_flowctl_action(t->flow_control->PeriodicUpdate(), t,
nullptr);
GPR_ASSERT(!t->have_next_bdp_ping_timer);
@@ -2999,12 +3055,10 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
if (s->frame_storage.length > 0) {
grpc_slice_buffer_swap(&s->frame_storage,
&s->unprocessed_incoming_frames_buffer);
- s->unprocessed_incoming_frames_decompressed = false;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
- GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, GRPC_ERROR_NONE);
} else if (s->byte_stream_error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
- GRPC_ERROR_REF(s->byte_stream_error));
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
+ GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref();
s->data_parser.parsing_frame = nullptr;
@@ -3013,8 +3067,8 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
if (bs->remaining_bytes_ != 0) {
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));
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
+ GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref();
s->data_parser.parsing_frame = nullptr;
@@ -3046,45 +3100,10 @@ bool Chttp2IncomingByteStream::Next(size_t max_size_hint,
}
}
-void Chttp2IncomingByteStream::MaybeCreateStreamDecompressionCtx() {
- GPR_DEBUG_ASSERT(stream_->stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS);
- if (!stream_->stream_decompression_ctx) {
- stream_->stream_decompression_ctx = grpc_stream_compression_context_create(
- stream_->stream_decompression_method);
- }
-}
-
grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
GPR_TIMER_SCOPE("incoming_byte_stream_pull", 0);
grpc_error_handle error;
if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
- if (!stream_->unprocessed_incoming_frames_decompressed &&
- stream_->stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
- bool end_of_context;
- MaybeCreateStreamDecompressionCtx();
- if (!grpc_stream_decompress(stream_->stream_decompression_ctx,
- &stream_->unprocessed_incoming_frames_buffer,
- &stream_->decompressed_data_buffer, nullptr,
- MAX_SIZE_T, &end_of_context)) {
- error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream decompression error.");
- return error;
- }
- GPR_ASSERT(stream_->unprocessed_incoming_frames_buffer.length == 0);
- grpc_slice_buffer_swap(&stream_->unprocessed_incoming_frames_buffer,
- &stream_->decompressed_data_buffer);
- stream_->unprocessed_incoming_frames_decompressed = true;
- if (end_of_context) {
- grpc_stream_compression_context_destroy(
- stream_->stream_decompression_ctx);
- stream_->stream_decompression_ctx = nullptr;
- }
- if (stream_->unprocessed_incoming_frames_buffer.length == 0) {
- *slice = grpc_empty_slice();
- }
- }
error = grpc_deframe_unprocessed_incoming_frames(
&stream_->data_parser, stream_,
&stream_->unprocessed_incoming_frames_buffer, slice, nullptr);
@@ -3102,8 +3121,7 @@ grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) {
GPR_ASSERT(error != GRPC_ERROR_NONE);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_->on_next,
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, GRPC_ERROR_REF(error));
stream_->on_next = nullptr;
GRPC_ERROR_UNREF(stream_->byte_stream_error);
stream_->byte_stream_error = GRPC_ERROR_REF(error);
@@ -3157,10 +3175,19 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) {
if (!t->benign_reclaimer_registered) {
t->benign_reclaimer_registered = true;
GRPC_CHTTP2_REF_TRANSPORT(t, "benign_reclaimer");
- GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked, benign_reclaimer, t,
- grpc_schedule_on_exec_ctx);
- grpc_resource_user_post_reclaimer(grpc_endpoint_get_resource_user(t->ep),
- false, &t->benign_reclaimer_locked);
+ t->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kBenign,
+ [t](absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (sweep.has_value()) {
+ GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
+ benign_reclaimer_locked, t,
+ grpc_schedule_on_exec_ctx);
+ t->active_reclamation = std::move(*sweep);
+ t->combiner->Run(&t->benign_reclaimer_locked, GRPC_ERROR_NONE);
+ } else {
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
+ }
+ });
}
}
@@ -3168,20 +3195,22 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
if (!t->destructive_reclaimer_registered) {
t->destructive_reclaimer_registered = true;
GRPC_CHTTP2_REF_TRANSPORT(t, "destructive_reclaimer");
- GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked, destructive_reclaimer,
- t, grpc_schedule_on_exec_ctx);
- grpc_resource_user_post_reclaimer(grpc_endpoint_get_resource_user(t->ep),
- true, &t->destructive_reclaimer_locked);
+ t->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kDestructive,
+ [t](absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (sweep.has_value()) {
+ GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
+ destructive_reclaimer_locked, t,
+ grpc_schedule_on_exec_ctx);
+ t->active_reclamation = std::move(*sweep);
+ t->combiner->Run(&t->destructive_reclaimer_locked, GRPC_ERROR_NONE);
+ } else {
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
+ }
+ });
}
}
-static void benign_reclaimer(void* arg, grpc_error_handle error) {
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
- t->combiner->Run(GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
- benign_reclaimer_locked, t, nullptr),
- GRPC_ERROR_REF(error));
-}
-
static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (error == GRPC_ERROR_NONE &&
@@ -3206,19 +3235,11 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
}
t->benign_reclaimer_registered = false;
if (error != GRPC_ERROR_CANCELLED) {
- grpc_resource_user_finish_reclamation(
- grpc_endpoint_get_resource_user(t->ep));
+ t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
}
-static void destructive_reclaimer(void* arg, grpc_error_handle error) {
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
- t->combiner->Run(GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
- destructive_reclaimer_locked, t, nullptr),
- GRPC_ERROR_REF(error));
-}
-
static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
@@ -3244,8 +3265,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
}
}
if (error != GRPC_ERROR_CANCELLED) {
- grpc_resource_user_finish_reclamation(
- grpc_endpoint_get_resource_user(t->ep));
+ t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
}
@@ -3283,6 +3303,8 @@ const char* grpc_chttp2_initiate_write_reason_string(
return "TRANSPORT_FLOW_CONTROL";
case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
return "SEND_SETTINGS";
+ case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
+ return "SETTINGS_ACK";
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
return "FLOW_CONTROL_UNSTALLED_BY_SETTING";
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE:
@@ -3310,6 +3332,7 @@ static grpc_endpoint* chttp2_get_endpoint(grpc_transport* t) {
static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
"chttp2",
init_stream,
+ nullptr,
set_pollset,
set_pollset_set,
perform_stream_op,
@@ -3328,10 +3351,8 @@ grpc_chttp2_transport_get_socket_node(grpc_transport* transport) {
}
grpc_transport* grpc_create_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user) {
- auto t =
- new grpc_chttp2_transport(channel_args, ep, is_client, resource_user);
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client) {
+ auto t = new grpc_chttp2_transport(channel_args, ep, is_client);
return &t->base;
}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index a72d268d..aab837e4 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -32,11 +32,11 @@ 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;
-extern bool g_flow_control_enabled;
-
+/// Creates a CHTTP2 Transport. This takes ownership of a \a resource_user ref
+/// from the caller; if the caller still needs the resource_user after creating
+/// a transport, the caller must take another ref.
grpc_transport* grpc_create_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user = nullptr);
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client);
grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode>
grpc_chttp2_transport_get_socket_node(grpc_transport* transport);
@@ -58,6 +58,14 @@ void TestOnlySetGlobalHttp2TransportInitCallback(
void TestOnlySetGlobalHttp2TransportDestructCallback(
TestOnlyGlobalHttp2TransportDestructCallback callback);
+
+// If \a disable is true, the HTTP2 transport will not update the connectivity
+// state tracker to TRANSIENT_FAILURE when a goaway is received. This prevents
+// the watchers (eg. client_channel) from noticing the GOAWAY, thereby allowing
+// us to test the racy behavior when a call is sent down the stack around the
+// same time that a GOAWAY is received.
+void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(
+ bool disable);
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/context_list.cc b/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
index afb18abc..70e37746 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
@@ -40,8 +40,7 @@ void ContextList::Append(ContextList** head, grpc_chttp2_stream* s) {
*head = elem;
}
-void ContextList::Execute(void* arg, grpc_core::Timestamps* ts,
- grpc_error_handle error) {
+void ContextList::Execute(void* arg, Timestamps* ts, grpc_error_handle error) {
ContextList* head = static_cast<ContextList*>(arg);
ContextList* to_be_freed;
while (head != nullptr) {
@@ -58,7 +57,7 @@ void ContextList::Execute(void* arg, grpc_core::Timestamps* ts,
}
void grpc_http2_set_write_timestamps_callback(
- void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) {
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
write_timestamps_callback_g = fn;
}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/context_list.h b/grpc/src/core/ext/transport/chttp2/transport/context_list.h
index 54ec87c6..f4963d84 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/context_list.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/context_list.h
@@ -21,9 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/buffer_list.h"
-
#include "src/core/ext/transport/chttp2/transport/internal.h"
+#include "src/core/lib/iomgr/buffer_list.h"
namespace grpc_core {
/** A list of RPC Contexts */
@@ -36,8 +35,7 @@ class ContextList {
/* Executes a function \a fn with each context in the list and \a ts. It also
* frees up the entire list after this operation. It is intended as a callback
* and hence does not take a ref on \a error */
- static void Execute(void* arg, grpc_core::Timestamps* ts,
- grpc_error_handle error);
+ static void Execute(void* arg, Timestamps* ts, grpc_error_handle error);
private:
void* trace_context_ = nullptr;
@@ -46,7 +44,7 @@ class ContextList {
};
void grpc_http2_set_write_timestamps_callback(
- void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error));
+ void (*fn)(void*, Timestamps*, grpc_error_handle error));
void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*));
} /* namespace grpc_core */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc b/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
index 5f5e5515..1ab72ca2 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -43,12 +43,14 @@ namespace chttp2 {
TestOnlyTransportTargetWindowEstimatesMocker*
g_test_only_transport_target_window_estimates_mocker;
+bool g_test_only_transport_flow_control_window_check;
+
namespace {
-static constexpr const int kTracePadding = 30;
-static constexpr const uint32_t kMaxWindowUpdateSize = (1u << 31) - 1;
+constexpr const int kTracePadding = 30;
+constexpr const int64_t kMaxWindowUpdateSize = (1u << 31) - 1;
-static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
+char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
std::string str;
if (old_val != new_val) {
str = absl::StrFormat("%" PRId64 " -> %" PRId64 "", old_val, new_val);
@@ -58,7 +60,7 @@ static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
return gpr_leftpad(str.c_str(), ' ', kTracePadding);
}
-static char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
+char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
std::string str;
if (old_val != new_val) {
str = absl::StrFormat("%" PRIu32 " -> %" PRIu32 "", old_val, new_val);
@@ -179,7 +181,7 @@ TransportFlowControl::TransportFlowControl(const grpc_chttp2_transport* t,
: t_(t),
enable_bdp_probe_(enable_bdp_probe),
bdp_estimator_(t->peer_string.c_str()),
- pid_controller_(grpc_core::PidController::Args()
+ pid_controller_(PidController::Args()
.set_gain_p(4)
.set_gain_i(8)
.set_gain_d(0)
@@ -187,7 +189,7 @@ TransportFlowControl::TransportFlowControl(const grpc_chttp2_transport* t,
.set_min_control_value(-1)
.set_max_control_value(25)
.set_integral_range(10)),
- last_pid_update_(grpc_core::ExecCtx::Get()->Now()) {}
+ last_pid_update_(ExecCtx::Get()->Now()) {}
uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
FlowControlTrace trace("t updt sent", this, nullptr);
@@ -195,8 +197,9 @@ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
static_cast<uint32_t>(target_window());
if ((writing_anyway || announced_window_ <= target_announced_window / 2) &&
announced_window_ != target_announced_window) {
- const uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
- target_announced_window - announced_window_, 0, kMaxWindowUpdateSize);
+ const uint32_t announce =
+ static_cast<uint32_t>(Clamp(target_announced_window - announced_window_,
+ int64_t(0), kMaxWindowUpdateSize));
announced_window_ += announce;
return announce;
}
@@ -206,11 +209,9 @@ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
grpc_error_handle TransportFlowControl::ValidateRecvData(
int64_t incoming_frame_size) {
if (incoming_frame_size > announced_window_) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("frame of size %" PRId64
- " overflows local window of %" PRId64,
- incoming_frame_size, announced_window_)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "frame of size %" PRId64 " overflows local window of %" PRId64,
+ incoming_frame_size, announced_window_));
}
return GRPC_ERROR_NONE;
}
@@ -248,11 +249,9 @@ grpc_error_handle StreamFlowControl::RecvData(int64_t incoming_frame_size) {
"See (for example) https://github.com/netty/netty/issues/6520.",
incoming_frame_size, acked_stream_window, sent_stream_window);
} else {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("frame of size %" PRId64
- " overflows local window of %" PRId64,
- incoming_frame_size, acked_stream_window)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "frame of size %" PRId64 " overflows local window of %" PRId64,
+ incoming_frame_size, acked_stream_window));
}
}
@@ -264,9 +263,27 @@ grpc_error_handle StreamFlowControl::RecvData(int64_t incoming_frame_size) {
uint32_t StreamFlowControl::MaybeSendUpdate() {
FlowControlTrace trace("s updt sent", tfc_, this);
+ // If a recently sent settings frame caused the stream's flow control window
+ // to go in the negative (or < GRPC_HEADER_SIZE_IN_BYTES), update the delta if
+ // one of the following conditions is satisfied -
+ // 1) There is a pending byte_stream and higher layers have expressed interest
+ // in reading additional data through the invokation of `Next()` where the
+ // bytes are to be available asynchronously. 2) There is a pending
+ // recv_message op.
+ // In these cases, we want to make sure that bytes are still flowing.
+ if (local_window_delta_ < GRPC_HEADER_SIZE_IN_BYTES) {
+ if (s_->on_next != nullptr) {
+ GPR_DEBUG_ASSERT(s_->pending_byte_stream);
+ IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES, 0);
+ } else if (s_->recv_message != nullptr) {
+ IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
+ s_->frame_storage.length);
+ }
+ }
if (local_window_delta_ > announced_window_delta_) {
- uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
- local_window_delta_ - announced_window_delta_, 0, kMaxWindowUpdateSize);
+ uint32_t announce = static_cast<uint32_t>(
+ Clamp(local_window_delta_ - announced_window_delta_, int64_t(0),
+ kMaxWindowUpdateSize));
UpdateAnnouncedWindowDelta(tfc_, announce);
return announce;
}
@@ -277,13 +294,10 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
size_t have_already) {
FlowControlTrace trace("app st recv", tfc_, this);
uint32_t max_recv_bytes;
- uint32_t sent_init_window =
- tfc_->transport()->settings[GRPC_SENT_SETTINGS]
- [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 >= kMaxWindowDelta) {
+ max_recv_bytes = kMaxWindowDelta;
} else {
max_recv_bytes = static_cast<uint32_t>(max_size_hint);
}
@@ -296,7 +310,12 @@ 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 -
+ tfc_->transport()
+ ->settings[GRPC_SENT_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
if (local_window_delta_ < max_recv_bytes) {
uint32_t add_max_recv_bytes =
static_cast<uint32_t>(max_recv_bytes - local_window_delta_);
@@ -305,10 +324,8 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
}
// Take in a target and modifies it based on the memory pressure of the system
-static double AdjustForMemoryPressure(grpc_resource_quota* quota,
- double target) {
+static double AdjustForMemoryPressure(double memory_pressure, double target) {
// do not increase window under heavy memory pressure.
- double memory_pressure = grpc_resource_quota_get_memory_pressure(quota);
static const double kLowMemPressure = 0.1;
static const double kZeroTarget = 22;
static const double kHighMemPressure = 0.8;
@@ -317,22 +334,23 @@ static double AdjustForMemoryPressure(grpc_resource_quota* quota,
target = (target - kZeroTarget) * memory_pressure / kLowMemPressure +
kZeroTarget;
} else if (memory_pressure > kHighMemPressure) {
- target *= 1 - GPR_MIN(1, (memory_pressure - kHighMemPressure) /
- (kMaxMemPressure - kHighMemPressure));
+ target *= 1 - std::min(1.0, (memory_pressure - kHighMemPressure) /
+ (kMaxMemPressure - kHighMemPressure));
}
return target;
}
double TransportFlowControl::TargetLogBdp() {
- return AdjustForMemoryPressure(
- grpc_resource_user_quota(grpc_endpoint_get_resource_user(t_->ep)),
- 1 + log2(bdp_estimator_.EstimateBdp()));
+ return AdjustForMemoryPressure(t_->memory_owner.is_valid()
+ ? t_->memory_owner.InstantaneousPressure()
+ : 0.0,
+ 1 + log2(bdp_estimator_.EstimateBdp()));
}
double TransportFlowControl::SmoothLogBdp(double value) {
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
+ Timestamp now = ExecCtx::Get()->Now();
double bdp_error = value - pid_controller_.last_control_value();
- const double dt = static_cast<double>(now - last_pid_update_) * 1e-3;
+ const double dt = (now - last_pid_update_).seconds();
last_pid_update_ = now;
// Limit dt to 100ms
const double kMaxDt = 0.1;
@@ -365,10 +383,10 @@ FlowControlAction TransportFlowControl::PeriodicUpdate() {
->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);
-
+ // Though initial window 'could' drop to 0, we keep the floor at
+ // kMinInitialWindowSize
+ target_initial_window_size_ = static_cast<int32_t>(Clamp(
+ target, double(kMinInitialWindowSize), double(kMaxInitialWindowSize)));
action.set_send_initial_window_update(
DeltaUrgency(target_initial_window_size_,
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE),
@@ -377,10 +395,11 @@ FlowControlAction TransportFlowControl::PeriodicUpdate() {
// get bandwidth estimate and update max_frame accordingly.
double bw_dbl = bdp_estimator_.EstimateBandwidth();
// we target the max of BDP or bandwidth in microseconds.
- int32_t frame_size = static_cast<int32_t> GPR_CLAMP(
- GPR_MAX((int32_t)GPR_CLAMP(bw_dbl, 0, INT_MAX) / 1000,
- target_initial_window_size_),
- 16384, 16777215);
+ int32_t frame_size = static_cast<int32_t>(Clamp(
+ std::max(
+ static_cast<int32_t>(Clamp(bw_dbl, 0.0, double(INT_MAX))) / 1000,
+ static_cast<int32_t>(target_initial_window_size_)),
+ 16384, 16777215));
action.set_send_max_frame_size_update(
DeltaUrgency(static_cast<int64_t>(frame_size),
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE),
diff --git a/grpc/src/core/ext/transport/chttp2/transport/flow_control.h b/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
index e5088964..9bce7c8a 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -47,10 +47,16 @@ static constexpr uint32_t kDefaultWindow = 65535;
static constexpr int64_t kMaxWindow = static_cast<int64_t>((1u << 31) - 1);
// TODO(ncteisen): Tune this
static constexpr uint32_t kFrameSize = 1024 * 1024;
+static constexpr const uint32_t kMinInitialWindowSize = 128;
+static constexpr const uint32_t kMaxInitialWindowSize = (1u << 30);
+// The maximum per-stream flow control window delta to advertise.
+static constexpr const uint32_t kMaxWindowDelta = (1u << 20);
class TransportFlowControl;
class StreamFlowControl;
+extern bool g_test_only_transport_flow_control_window_check;
+
// Encapsulates a collections of actions the transport needs to take with
// regard to flow control. Each action comes with urgencies that tell the
// transport how quickly the action must take place.
@@ -188,7 +194,7 @@ class TransportFlowControlBase {
virtual void TestOnlyForceHugeWindow() {}
protected:
- friend class ::grpc::testing::TrickledCHTTP2;
+ friend class grpc::testing::TrickledCHTTP2;
int64_t remote_window_ = kDefaultWindow;
int64_t target_initial_window_size_ = kDefaultWindow;
int64_t announced_window_ = kDefaultWindow;
@@ -268,10 +274,10 @@ class TransportFlowControl final : public TransportFlowControlBase {
// See comment above announced_stream_total_over_incoming_window_ for the
// logic behind this decision.
int64_t target_window() const override {
- return static_cast<uint32_t> GPR_MIN(
- (int64_t)((1u << 31) - 1),
- announced_stream_total_over_incoming_window_ +
- target_initial_window_size_);
+ return static_cast<uint32_t>(
+ std::min(static_cast<int64_t>((1u << 31) - 1),
+ announced_stream_total_over_incoming_window_ +
+ target_initial_window_size_));
}
const grpc_chttp2_transport* transport() const { return t_; }
@@ -325,11 +331,11 @@ class TransportFlowControl final : public TransportFlowControlBase {
const bool enable_bdp_probe_;
/* bdp estimation */
- grpc_core::BdpEstimator bdp_estimator_;
+ BdpEstimator bdp_estimator_;
/* pid controller */
- grpc_core::PidController pid_controller_;
- grpc_millis last_pid_update_ = 0;
+ PidController pid_controller_;
+ Timestamp last_pid_update_;
};
// Fat interface with all methods a stream flow control implementation needs
@@ -373,12 +379,12 @@ class StreamFlowControlBase {
virtual void TestOnlyForceHugeWindow() {}
// Getters
- int64_t remote_window_delta() { return remote_window_delta_; }
- int64_t local_window_delta() { return local_window_delta_; }
- int64_t announced_window_delta() { return announced_window_delta_; }
+ int64_t remote_window_delta() const { return remote_window_delta_; }
+ int64_t local_window_delta() const { return local_window_delta_; }
+ int64_t announced_window_delta() const { return announced_window_delta_; }
protected:
- friend class ::grpc::testing::TrickledCHTTP2;
+ friend class grpc::testing::TrickledCHTTP2;
int64_t remote_window_delta_ = 0;
int64_t local_window_delta_ = 0;
int64_t announced_window_delta_ = 0;
@@ -479,4 +485,4 @@ extern TestOnlyTransportTargetWindowEstimatesMocker*
} // namespace chttp2
} // namespace grpc_core
-#endif
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
index 745f32a2..21083278 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
@@ -26,6 +26,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
@@ -45,10 +46,10 @@ grpc_error_handle 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(
- 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_CPP_STRING(absl::StrFormat(
+ "unsupported data flags: 0x%02x", flags)),
+ GRPC_ERROR_INT_STREAM_ID,
+ static_cast<intptr_t>(stream_id));
}
if (flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
@@ -128,15 +129,14 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
p->is_frame_compressed = true; /* GPR_TRUE */
break;
default:
- p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type)
- .c_str());
+ p->error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type));
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(
- p->error, GRPC_ERROR_STR_RAW_BYTES,
- grpc_slice_from_moved_string(grpc_core::UniquePtr<char>(
- grpc_dump_slice(*slice, GPR_DUMP_HEX | GPR_DUMP_ASCII))));
+ grpc_core::UniquePtr<char> dmp(
+ grpc_dump_slice(*slice, GPR_DUMP_HEX | GPR_DUMP_ASCII));
+ p->error = grpc_error_set_str(p->error, GRPC_ERROR_STR_RAW_BYTES,
+ dmp.get());
p->error =
grpc_error_set_int(p->error, GRPC_ERROR_INT_OFFSET, cur - beg);
p->state = GRPC_CHTTP2_DATA_ERROR;
@@ -148,7 +148,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_1:
s->stats.incoming.framing_bytes++;
p->frame_size = (static_cast<uint32_t>(*cur)) << 24;
@@ -157,7 +157,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_2:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 16;
@@ -166,7 +166,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_3:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@@ -175,7 +175,7 @@ grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_4:
s->stats.incoming.framing_bytes++;
GPR_ASSERT(stream_out != nullptr);
@@ -290,7 +290,6 @@ grpc_error_handle grpc_chttp2_data_parser_parse(void* /*parser*/,
grpc_slice_buffer_add(&s->unprocessed_incoming_frames_buffer, slice);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->on_next, GRPC_ERROR_NONE);
s->on_next = nullptr;
- s->unprocessed_incoming_frames_decompressed = false;
} else {
grpc_slice_ref_internal(slice);
grpc_slice_buffer_add(&s->frame_storage, slice);
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_data.h b/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
index 5aa4a3e7..6690e5f3 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -25,6 +25,7 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/transport.h"
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
index a139bea1..eb90e2e9 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_goaway.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -28,6 +27,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser* p) {
p->debug_data = nullptr;
}
@@ -39,8 +40,8 @@ void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p) {
grpc_error_handle 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(
- absl::StrFormat("goaway frame too short (%d bytes)", length).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("goaway frame too short (%d bytes)", length));
}
gpr_free(p->debug_data);
@@ -70,7 +71,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id = (static_cast<uint32_t>(*cur)) << 24;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI1;
@@ -78,7 +79,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI2;
@@ -86,7 +87,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI3;
@@ -94,7 +95,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur));
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR0:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR0;
@@ -102,7 +103,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code = (static_cast<uint32_t>(*cur)) << 24;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR1;
@@ -110,7 +111,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR2;
@@ -118,7 +119,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR3;
@@ -126,7 +127,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur));
++cur;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_DEBUG:
if (end != cur) {
memcpy(p->debug_data + p->debug_pos, cur,
@@ -138,7 +139,8 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
if (is_last) {
grpc_chttp2_add_incoming_goaway(
t, p->error_code, p->last_stream_id,
- grpc_slice_new(p->debug_data, p->debug_length, gpr_free));
+ absl::string_view(p->debug_data, p->debug_length));
+ gpr_free(p->debug_data);
p->debug_data = nullptr;
}
return GRPC_ERROR_NONE;
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h b/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
index 674f7423..2ceb6202 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -23,6 +23,7 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
typedef enum {
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
index 9da4a72a..b87c221d 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -28,6 +27,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
static bool g_disable_ping_ack = false;
grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) {
@@ -58,9 +59,8 @@ grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) {
grpc_error_handle 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(
- absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
parser->is_ack = flags;
@@ -90,8 +90,8 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
grpc_chttp2_ack_ping(t, p->opaque_8bytes);
} else {
if (!t->is_client) {
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
- grpc_millis next_allowed_ping =
+ grpc_core::Timestamp now = grpc_core::ExecCtx::Get()->Now();
+ grpc_core::Timestamp next_allowed_ping =
t->ping_recv_state.last_ping_recv_time +
t->ping_policy.min_recv_ping_interval_without_data;
@@ -100,8 +100,8 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
/* According to RFC1122, the interval of TCP Keep-Alive is default to
no less than two hours. When there is no outstanding streams, we
restrict the number of PINGS equivalent to TCP Keep-Alive. */
- next_allowed_ping =
- t->ping_recv_state.last_ping_recv_time + 7200 * GPR_MS_PER_SEC;
+ next_allowed_ping = t->ping_recv_state.last_ping_recv_time +
+ grpc_core::Duration::Hours(2);
}
if (next_allowed_ping > now) {
@@ -112,7 +112,8 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
}
if (!g_disable_ping_ack) {
if (t->ping_ack_count == t->ping_ack_capacity) {
- t->ping_ack_capacity = GPR_MAX(t->ping_ack_capacity * 3 / 2, 3);
+ t->ping_ack_capacity =
+ std::max(t->ping_ack_capacity * 3 / 2, size_t(3));
t->ping_acks = static_cast<uint64_t*>(gpr_realloc(
t->ping_acks, t->ping_ack_capacity * sizeof(*t->ping_acks)));
}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h b/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
index 6b5318e9..c878cff8 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
struct grpc_chttp2_ping_parser {
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
index 03a7c61d..d2365d32 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@@ -28,6 +27,7 @@
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/transport/http2_errors.h"
@@ -71,10 +71,8 @@ void grpc_chttp2_add_rst_stream_to_next_write(
grpc_error_handle 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(
- absl::StrFormat("invalid rst_stream: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "invalid rst_stream: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
return GRPC_ERROR_NONE;
@@ -104,14 +102,18 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
((static_cast<uint32_t>(p->reason_bytes[1])) << 16) |
((static_cast<uint32_t>(p->reason_bytes[2])) << 8) |
((static_cast<uint32_t>(p->reason_bytes[3])));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO,
+ "[chttp2 transport=%p stream=%p] received RST_STREAM(reason=%d)",
+ t, s, reason);
+ }
grpc_error_handle error = GRPC_ERROR_NONE;
- if (reason != GRPC_HTTP2_NO_ERROR || s->metadata_buffer[1].size == 0) {
+ if (reason != GRPC_HTTP2_NO_ERROR || s->trailing_metadata_buffer.empty()) {
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(absl::StrCat(
- "Received RST_STREAM with error code ", reason))),
+ 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/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
index 865e74d9..65813176 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/transport.h"
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
index 576f8158..eefd6d29 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_settings.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -30,6 +29,7 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/frame.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/http2_errors.h"
@@ -110,6 +110,22 @@ grpc_error_handle grpc_chttp2_settings_parser_begin_frame(
}
}
+namespace {
+
+void StreamFlowControlWindowCheck(void* user_data, uint32_t /* key */,
+ void* stream) {
+ bool* error = static_cast<bool*>(user_data);
+ grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
+ if ((s->t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] +
+ s->t->initial_window_update + s->flow_control->remote_window_delta()) >
+ ((1u << 31) - 1)) {
+ *error = true;
+ }
+}
+
+} // namespace
+
grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
grpc_chttp2_transport* t,
grpc_chttp2_stream* /*s*/,
@@ -135,6 +151,8 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
t->num_pending_induced_frames++;
grpc_slice_buffer_add(&t->qbuf, grpc_chttp2_settings_ack_create());
+ grpc_chttp2_initiate_write(t,
+ GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK);
if (t->notify_on_receive_settings != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
t->notify_on_receive_settings,
@@ -146,7 +164,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->id = static_cast<uint16_t>((static_cast<uint16_t>(*cur)) << 8);
cur++;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_ID1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_ID1;
@@ -154,7 +172,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->id = static_cast<uint16_t>(parser->id | (*cur));
cur++;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL0:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL0;
@@ -162,7 +180,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value = (static_cast<uint32_t>(*cur)) << 24;
cur++;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL1;
@@ -170,7 +188,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 16;
cur++;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL2:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL2;
@@ -178,7 +196,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 8;
cur++;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL3:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL3;
@@ -201,18 +219,16 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
if (parser->value < sp->min_value || parser->value > sp->max_value) {
switch (sp->invalid_value_behavior) {
case GRPC_CHTTP2_CLAMP_INVALID_VALUE:
- parser->value =
- GPR_CLAMP(parser->value, sp->min_value, sp->max_value);
+ parser->value = grpc_core::Clamp(parser->value, sp->min_value,
+ sp->max_value);
break;
case GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE:
grpc_chttp2_goaway_append(
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(
- absl::StrFormat("invalid value %u passed for %s",
- parser->value, sp->name)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "invalid value %u passed for %s", parser->value, sp->name));
}
}
if (id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE &&
@@ -225,6 +241,23 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
t->is_client ? "cli" : "svr",
static_cast<int>(t->initial_window_update));
}
+ if (grpc_core::chttp2::
+ g_test_only_transport_flow_control_window_check) {
+ bool error = false;
+ if (parser->value > grpc_core::chttp2::kMaxInitialWindowSize ||
+ parser->value < grpc_core::chttp2::kMinInitialWindowSize) {
+ error = true;
+ } else {
+ grpc_chttp2_stream_map_for_each(
+ &t->stream_map, StreamFlowControlWindowCheck, &error);
+ }
+ if (error) {
+ grpc_chttp2_goaway_append(
+ t->last_new_stream_id, sp->error_value,
+ grpc_slice_from_static_string("HTTP2 settings error"),
+ &t->qbuf);
+ }
+ }
}
parser->incoming_settings[id] = parser->value;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h b/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
index 7268277a..9ec116b7 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
index 37e69ff0..9763e810 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_window_update.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@@ -27,6 +26,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
grpc_slice grpc_chttp2_window_update_create(
uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats* stats) {
static const size_t frame_size = 13;
@@ -56,10 +57,8 @@ grpc_slice grpc_chttp2_window_update_create(
grpc_error_handle 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(
- absl::StrFormat("invalid window update: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "invalid window update: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
parser->amount = 0;
@@ -89,14 +88,20 @@ grpc_error_handle grpc_chttp2_window_update_parser_parse(
// 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(
- absl::StrCat("invalid window update bytes: ", p->amount).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("invalid window update bytes: ", p->amount));
}
GPR_ASSERT(is_last);
if (t->incoming_stream_id != 0) {
if (s != nullptr) {
s->flow_control->RecvUpdate(received_update);
+ if (grpc_core::chttp2::
+ g_test_only_transport_flow_control_window_check &&
+ s->flow_control->remote_window_delta() >
+ grpc_core::chttp2::kMaxWindowDelta) {
+ GPR_ASSERT(false);
+ }
if (grpc_chttp2_list_remove_stalled_by_stream(t, s)) {
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(
diff --git a/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h b/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
index 5a07b9e5..ea414d7a 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/transport.h"
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h
new file mode 100644
index 00000000..f5886529
--- /dev/null
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h
@@ -0,0 +1,41 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+namespace grpc_core {
+namespace hpack_constants {
+// Per entry overhead bytes as per the spec
+static constexpr uint32_t kEntryOverhead = 32;
+// Initial table size as per the spec
+static constexpr uint32_t kInitialTableSize = 4096;
+
+// last index in the static table
+static constexpr uint32_t kLastStaticEntry = 61;
+
+static constexpr uint32_t EntriesForBytes(uint32_t bytes) noexcept {
+ return (bytes + kEntryOverhead - 1) / kEntryOverhead;
+}
+
+static constexpr uint32_t kInitialTableEntries =
+ EntriesForBytes(kInitialTableSize);
+} // namespace hpack_constants
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
index cc1eba96..d9347bb2 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
@@ -23,276 +23,49 @@
#include <assert.h>
#include <string.h>
+#include <cstdint>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h"
+
/* This is here for grpc_is_binary_header
* TODO(murgatroid99): Remove this
*/
#include <grpc/grpc.h>
-
+#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/validate_metadata.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"
-namespace {
-/* (Maybe-cuckoo) hpack encoder hash table implementation.
-
- This hashtable implementation is a subset of a proper cuckoo hash; while we
- have fallback cells that a value can be hashed to if the first cell is full,
- we do not attempt to iteratively rearrange entries into backup cells to get
- things to fit. Instead, if both a cell and the backup cell for a value are
- occupied, the older existing entry is evicted.
-
- Note that we can disable backup-cell picking by setting
- GRPC_HPACK_ENCODER_USE_CUCKOO_HASH to 0. In that case, we simply evict an
- existing entry rather than try to use a backup. Hence, "maybe-cuckoo."
- TODO(arjunroy): Add unit tests for hashtable implementation. */
-#define GRPC_HPACK_ENCODER_USE_CUCKOO_HASH 1
-#define HASH_FRAGMENT_MASK (GRPC_CHTTP2_HPACKC_NUM_VALUES - 1)
-#define HASH_FRAGMENT_1(x) ((x)&HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_2(x) \
- (((x) >> GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS) & HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_3(x) \
- (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 2)) & HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_4(x) \
- (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 3)) & HASH_FRAGMENT_MASK)
-
-/* don't consider adding anything bigger than this to the hpack table */
-constexpr size_t kMaxDecoderSpaceUsage = 512;
-constexpr size_t kDataFrameHeaderSize = 9;
-constexpr uint8_t kMaxFilterValue = 255;
-
-/* if the probability of this item being seen again is < 1/x then don't add
- it to the table */
-#define ONE_ON_ADD_PROBABILITY (GRPC_CHTTP2_HPACKC_NUM_VALUES >> 1)
-/* The hpack index we encode over the wire. Meaningful to the hpack encoder and
- parser on the remote end as well as HTTP2. *Not* the same as
- HpackEncoderSlotHash, which is only meaningful to the hpack encoder
- implementation (HpackEncoderSlotHash is used for the hashtable implementation
- when mapping from metadata to HpackEncoderIndex. */
-typedef uint32_t HpackEncoderIndex;
-/* Internal-table bookkeeping (*not* the hpack index). */
-typedef uint32_t HpackEncoderSlotHash;
-
-struct SliceRefComparator {
- typedef grpc_slice_refcount* Type;
- static grpc_slice_refcount* Null() { return nullptr; }
- static bool IsNull(const grpc_slice_refcount* sref) {
- return sref == nullptr;
- }
- static bool Equals(const grpc_slice_refcount* s1,
- const grpc_slice_refcount* s2) {
- return s1 == s2;
- }
- static void Ref(grpc_slice_refcount* sref) {
- GPR_DEBUG_ASSERT(sref != nullptr);
- sref->Ref();
- }
- static void Unref(grpc_slice_refcount* sref) {
- GPR_DEBUG_ASSERT(sref != nullptr);
- sref->Unref();
- }
-};
-
-struct MetadataComparator {
- typedef grpc_mdelem Type;
- static grpc_mdelem Null() { return {0}; }
- static bool IsNull(const grpc_mdelem md) { return md.payload == 0; }
- static bool Equals(const grpc_mdelem md1, const grpc_mdelem md2) {
- return md1.payload == md2.payload;
- }
- static void Ref(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(md.payload != 0);
- GRPC_MDELEM_REF(md);
- }
- static void Unref(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(md.payload != 0);
- GRPC_MDELEM_UNREF(md);
- }
-};
-
-/* Index table management */
-template <typename Hashtable>
-static HpackEncoderIndex HpackIndex(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return hashtable[hash_index].index;
-}
-
-template <typename ValueType, typename Hashtable>
-static const ValueType& GetEntry(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return hashtable[hash_index].value;
-}
-
-template <typename Cmp, typename Hashtable>
-static bool TableEmptyAt(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return Cmp::Equals(hashtable[hash_index].value, Cmp::Null());
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static bool Matches(const Hashtable* hashtable, const ValueType& value,
- HpackEncoderSlotHash hash_index) {
- return Cmp::Equals(value, hashtable[hash_index].value);
-}
-
-template <typename Hashtable>
-static void UpdateIndex(Hashtable* hashtable, HpackEncoderSlotHash hash_index,
- HpackEncoderIndex hpack_index) {
- hashtable[hash_index].index = hpack_index;
-}
+namespace grpc_core {
-template <typename Hashtable, typename ValueType>
-static void SetIndex(Hashtable* hashtable, HpackEncoderSlotHash hash_index,
- const ValueType& value, HpackEncoderIndex hpack_index) {
- hashtable[hash_index].value = value;
- UpdateIndex(hashtable, hash_index, hpack_index);
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static bool GetMatchingIndex(Hashtable* hashtable, const ValueType& value,
- uint32_t value_hash, HpackEncoderIndex* index) {
- const HpackEncoderSlotHash cuckoo_first = HASH_FRAGMENT_2(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_first)) {
- *index = HpackIndex(hashtable, cuckoo_first);
- return true;
- }
-#if GRPC_HPACK_ENCODER_USE_CUCKOO_HASH
- const HpackEncoderSlotHash cuckoo_second = HASH_FRAGMENT_3(value_hash);
-
- if (Matches<Cmp>(hashtable, value, cuckoo_second)) {
- *index = HpackIndex(hashtable, cuckoo_second);
- return true;
- }
-#endif
- return false;
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static ValueType ReplaceOlderIndex(Hashtable* hashtable, const ValueType& value,
- HpackEncoderSlotHash hash_index_a,
- HpackEncoderSlotHash hash_index_b,
- HpackEncoderIndex new_index) {
- const HpackEncoderIndex hpack_idx_a = hashtable[hash_index_a].index;
- const HpackEncoderIndex hpack_idx_b = hashtable[hash_index_b].index;
- const HpackEncoderSlotHash id =
- hpack_idx_a < hpack_idx_b ? hash_index_a : hash_index_b;
- ValueType old = GetEntry<typename Cmp::Type>(hashtable, id);
- SetIndex(hashtable, id, value, new_index);
- return old;
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static void UpdateAddOrEvict(Hashtable hashtable, const ValueType& value,
- uint32_t value_hash, HpackEncoderIndex new_index) {
- const HpackEncoderSlotHash cuckoo_first = HASH_FRAGMENT_2(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_first)) {
- UpdateIndex(hashtable, cuckoo_first, new_index);
- return;
- }
- if (TableEmptyAt<Cmp>(hashtable, cuckoo_first)) {
- Cmp::Ref(value);
- SetIndex(hashtable, cuckoo_first, value, new_index);
- return;
- }
-#if GRPC_HPACK_ENCODER_USE_CUCKOO_HASH
- const HpackEncoderSlotHash cuckoo_second = HASH_FRAGMENT_3(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_second)) {
- UpdateIndex(hashtable, cuckoo_second, new_index);
- return;
- }
- Cmp::Ref(value);
- if (TableEmptyAt<Cmp>(hashtable, cuckoo_second)) {
- SetIndex(hashtable, cuckoo_second, value, new_index);
- return;
- }
- Cmp::Unref(ReplaceOlderIndex<Cmp>(hashtable, value, cuckoo_first,
- cuckoo_second, new_index));
-#else
- ValueType old = GetEntry<typename Cmp::Type>(hashtable, cuckoo_first);
- SetIndex(hashtable, cuckoo_first, value, new_index);
- Cmp::Unref(old);
-#endif
-}
-
-/* halve all counts because an element reached max */
-static void HalveFilter(uint8_t /*idx*/, uint32_t* sum, uint8_t* elems) {
- *sum = 0;
- for (int i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
- elems[i] /= 2;
- (*sum) += elems[i];
- }
-}
-
-/* increment a filter count, halve all counts if one element reaches max */
-static void IncrementFilter(uint8_t idx, uint32_t* sum, uint8_t* elems) {
- elems[idx]++;
- if (GPR_LIKELY(elems[idx] < kMaxFilterValue)) {
- (*sum)++;
- } else {
- HalveFilter(idx, sum, elems);
- }
-}
+namespace {
-static uint32_t UpdateHashtablePopularity(
- grpc_chttp2_hpack_compressor* hpack_compressor, uint32_t elem_hash) {
- const uint32_t popularity_hash = HASH_FRAGMENT_1(elem_hash);
- IncrementFilter(popularity_hash, &hpack_compressor->filter_elems_sum,
- hpack_compressor->filter_elems);
- return popularity_hash;
-}
+constexpr size_t kDataFrameHeaderSize = 9;
-static bool CanAddToHashtable(grpc_chttp2_hpack_compressor* hpack_compressor,
- uint32_t popularity_hash) {
- const bool can_add =
- hpack_compressor->filter_elems[popularity_hash] >=
- hpack_compressor->filter_elems_sum / ONE_ON_ADD_PROBABILITY;
- return can_add;
-}
} /* namespace */
-struct framer_state {
- int is_first_frame;
- /* number of bytes in 'output' when we started the frame - used to calculate
- frame length */
- size_t output_length_at_start_of_frame;
- /* index (in output) of the header for the current frame */
- size_t header_idx;
-#ifndef NDEBUG
- /* have we seen a regular (non-colon-prefixed) header yet? */
- uint8_t seen_regular_header;
-#endif
- /* output stream id */
- uint32_t stream_id;
- grpc_slice_buffer* output;
- grpc_transport_one_way_stats* stats;
- /* maximum size of a frame */
- size_t max_frame_size;
- bool use_true_binary_metadata;
- bool is_end_of_stream;
-};
/* fills p (which is expected to be kDataFrameHeaderSize bytes long)
* with a data frame header */
-static void fill_header(uint8_t* p, uint8_t type, uint32_t id, size_t len,
- uint8_t flags) {
+static void FillHeader(uint8_t* p, uint8_t type, uint32_t id, size_t len,
+ uint8_t flags) {
/* len is the current frame size (i.e. for the frame we're finishing).
We finish a frame if:
1) We called ensure_space(), (i.e. add_tiny_header_data()) and adding
- 'need_bytes' to the frame would cause us to exceed st->max_frame_size.
+ 'need_bytes' to the frame would cause us to exceed max_frame_size.
2) We called add_header_data, and adding the slice would cause us to exceed
- st->max_frame_size.
+ max_frame_size.
3) We're done encoding the header.
- Thus, len is always <= st->max_frame_size.
- st->max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
+ Thus, len is always <= max_frame_size.
+ max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
which has a max allowable value of 16777215 (see chttp_transport.cc).
Thus, the following assert can be a debug assert. */
GPR_DEBUG_ASSERT(len < 16777316);
@@ -307,594 +80,588 @@ static void fill_header(uint8_t* p, uint8_t type, uint32_t id, size_t len,
*p++ = static_cast<uint8_t>(id);
}
-static size_t current_frame_size(framer_state* st) {
+size_t HPackCompressor::Framer::CurrentFrameSize() const {
const size_t frame_size =
- st->output->length - st->output_length_at_start_of_frame;
- GPR_DEBUG_ASSERT(frame_size <= st->max_frame_size);
+ output_->length - prefix_.output_length_at_start_of_frame;
+ GPR_DEBUG_ASSERT(frame_size <= max_frame_size_);
return frame_size;
}
-/* finish a frame - fill in the previously reserved header */
-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);
- st->stats->framing_bytes += kDataFrameHeaderSize;
- st->is_first_frame = 0;
-}
-
-/* begin a new frame: reserve off header space, remember how many bytes we'd
- output before beginning */
-static void begin_frame(framer_state* st) {
+// finish a frame - fill in the previously reserved header
+void HPackCompressor::Framer::FinishFrame(bool is_header_boundary) {
+ const uint8_t type = is_first_frame_ ? GRPC_CHTTP2_FRAME_HEADER
+ : GRPC_CHTTP2_FRAME_CONTINUATION;
+ uint8_t flags = 0;
+ // 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).
+ if (is_first_frame_ && is_end_of_stream_) {
+ flags |= GRPC_CHTTP2_DATA_FLAG_END_STREAM;
+ }
+ // 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.
+ if (is_header_boundary) {
+ flags |= GRPC_CHTTP2_DATA_FLAG_END_HEADERS;
+ }
+ FillHeader(GRPC_SLICE_START_PTR(output_->slices[prefix_.header_idx]), type,
+ stream_id_, CurrentFrameSize(), flags);
+ stats_->framing_bytes += kDataFrameHeaderSize;
+ is_first_frame_ = false;
+}
+
+// begin a new frame: reserve off header space, remember how many bytes we'd
+// output before beginning
+HPackCompressor::Framer::FramePrefix HPackCompressor::Framer::BeginFrame() {
grpc_slice reserved;
reserved.refcount = nullptr;
reserved.data.inlined.length = kDataFrameHeaderSize;
- st->header_idx = grpc_slice_buffer_add_indexed(st->output, reserved);
- st->output_length_at_start_of_frame = st->output->length;
+ return FramePrefix{grpc_slice_buffer_add_indexed(output_, reserved),
+ output_->length};
}
-/* make sure that the current frame is of the type desired, and has sufficient
- space to add at least about_to_add bytes -- finishes the current frame if
- needed */
-static void ensure_space(framer_state* st, size_t need_bytes) {
- if (GPR_LIKELY(current_frame_size(st) + need_bytes <= st->max_frame_size)) {
+// make sure that the current frame is of the type desired, and has sufficient
+// space to add at least about_to_add bytes -- finishes the current frame if
+// needed
+void HPackCompressor::Framer::EnsureSpace(size_t need_bytes) {
+ if (GPR_LIKELY(CurrentFrameSize() + need_bytes <= max_frame_size_)) {
return;
}
- finish_frame(st, 0);
- begin_frame(st);
+ FinishFrame(false);
+ prefix_ = BeginFrame();
}
-static void add_header_data(framer_state* st, grpc_slice slice) {
- size_t len = GRPC_SLICE_LENGTH(slice);
- size_t remaining;
- if (len == 0) return;
- remaining = st->max_frame_size - current_frame_size(st);
- if (len <= remaining) {
- st->stats->header_bytes += len;
- grpc_slice_buffer_add(st->output, slice);
- } else {
- st->stats->header_bytes += remaining;
- grpc_slice_buffer_add(st->output, grpc_slice_split_head(&slice, remaining));
- finish_frame(st, 0);
- begin_frame(st);
- add_header_data(st, slice);
- }
-}
-
-static uint8_t* add_tiny_header_data(framer_state* st, size_t len) {
- ensure_space(st, len);
- st->stats->header_bytes += len;
- return grpc_slice_buffer_tiny_add(st->output, len);
-}
-
-static void evict_entry(grpc_chttp2_hpack_compressor* c) {
- c->tail_remote_index++;
- GPR_ASSERT(c->tail_remote_index > 0);
- GPR_ASSERT(c->table_size >=
- c->table_elem_size[c->tail_remote_index % c->cap_table_elems]);
- GPR_ASSERT(c->table_elems > 0);
- c->table_size = static_cast<uint16_t>(
- c->table_size -
- c->table_elem_size[c->tail_remote_index % c->cap_table_elems]);
- c->table_elems--;
-}
-
-// Reserve space in table for the new element, evict entries if needed.
-// Return the new index of the element. Return 0 to indicate not adding to
-// table.
-static uint32_t prepare_space_for_new_elem(grpc_chttp2_hpack_compressor* c,
- size_t elem_size) {
- uint32_t new_index = c->tail_remote_index + c->table_elems + 1;
- GPR_DEBUG_ASSERT(elem_size < 65536);
-
- // TODO(arjunroy): Re-examine semantics
- if (elem_size > c->max_table_size) {
- while (c->table_size > 0) {
- evict_entry(c);
+void HPackCompressor::Framer::Add(Slice slice) {
+ while (true) {
+ const size_t len = slice.length();
+ if (len == 0) return;
+ const size_t remaining = max_frame_size_ - CurrentFrameSize();
+ if (len <= remaining) {
+ stats_->header_bytes += len;
+ grpc_slice_buffer_add(output_, slice.TakeCSlice());
+ return;
+ } else {
+ stats_->header_bytes += remaining;
+ Slice tail = slice.Split(remaining);
+ grpc_slice_buffer_add(output_, slice.TakeCSlice());
+ slice = std::move(tail);
+ FinishFrame(false);
+ prefix_ = BeginFrame();
}
- return 0;
- }
-
- /* Reserve space for this element in the remote table: if this overflows
- the current table, drop elements until it fits, matching the decompressor
- algorithm */
- while (c->table_size + elem_size > c->max_table_size) {
- evict_entry(c);
- }
- GPR_ASSERT(c->table_elems < c->max_table_size);
- c->table_elem_size[new_index % c->cap_table_elems] =
- static_cast<uint16_t>(elem_size);
- c->table_size = static_cast<uint16_t>(c->table_size + elem_size);
- c->table_elems++;
-
- return new_index;
-}
-
-// Add a key to the dynamic table. Both key and value will be added to table at
-// the decoder.
-static void AddKeyWithIndex(grpc_chttp2_hpack_compressor* c,
- grpc_slice_refcount* key_ref, uint32_t new_index,
- uint32_t key_hash) {
- UpdateAddOrEvict<SliceRefComparator>(c->key_table.entries, key_ref, key_hash,
- new_index);
-}
-
-/* add an element to the decoder table */
-static void AddElemWithIndex(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- uint32_t new_index, uint32_t elem_hash,
- uint32_t key_hash) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(elem));
- UpdateAddOrEvict<MetadataComparator>(c->elem_table.entries, elem, elem_hash,
- new_index);
- AddKeyWithIndex(c, GRPC_MDKEY(elem).refcount, new_index, key_hash);
-}
-
-static void add_elem(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- size_t elem_size, uint32_t elem_hash, uint32_t key_hash) {
- uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
- if (new_index != 0) {
- AddElemWithIndex(c, elem, new_index, elem_hash, key_hash);
}
}
-static void add_key(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- size_t elem_size, uint32_t key_hash) {
- uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
- if (new_index != 0) {
- AddKeyWithIndex(c, GRPC_MDKEY(elem).refcount, new_index, key_hash);
- }
+uint8_t* HPackCompressor::Framer::AddTiny(size_t len) {
+ EnsureSpace(len);
+ stats_->header_bytes += len;
+ return grpc_slice_buffer_tiny_add(output_, len);
}
-static void emit_indexed(grpc_chttp2_hpack_compressor* /*c*/,
- uint32_t elem_index, framer_state* st) {
+void HPackCompressor::Framer::EmitIndexed(uint32_t elem_index) {
GRPC_STATS_INC_HPACK_SEND_INDEXED();
- uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(elem_index, 1);
- GRPC_CHTTP2_WRITE_VARINT(elem_index, 1, 0x80, add_tiny_header_data(st, len),
- len);
+ VarintWriter<1> w(elem_index);
+ w.Write(0x80, AddTiny(w.length()));
}
-struct wire_value {
- wire_value(uint8_t huffman_prefix, bool insert_null_before_wire_value,
- const grpc_slice& slice)
- : data(slice),
+struct WireValue {
+ WireValue(uint8_t huffman_prefix, bool insert_null_before_wire_value,
+ Slice slice)
+ : data(std::move(slice)),
huffman_prefix(huffman_prefix),
insert_null_before_wire_value(insert_null_before_wire_value),
- length(GRPC_SLICE_LENGTH(slice) +
- (insert_null_before_wire_value ? 1 : 0)) {}
- // While wire_value is const from the POV of hpack encoder code, actually
- // adding it to a slice buffer will possibly split the slice.
- const grpc_slice data;
+ length(data.length() + (insert_null_before_wire_value ? 1 : 0)) {}
+ Slice data;
const uint8_t huffman_prefix;
const bool insert_null_before_wire_value;
const size_t length;
};
-template <bool mdkey_definitely_interned>
-static wire_value get_wire_value(grpc_mdelem elem, bool true_binary_enabled) {
- const bool is_bin_hdr =
- mdkey_definitely_interned
- ? grpc_is_refcounted_slice_binary_header(GRPC_MDKEY(elem))
- : grpc_is_binary_header_internal(GRPC_MDKEY(elem));
- const grpc_slice& value = GRPC_MDVALUE(elem);
+static WireValue GetWireValue(Slice value, bool true_binary_enabled,
+ bool is_bin_hdr) {
if (is_bin_hdr) {
if (true_binary_enabled) {
GRPC_STATS_INC_HPACK_SEND_BINARY();
- return wire_value(0x00, true, grpc_slice_ref_internal(value));
+ return WireValue(0x00, true, std::move(value));
} else {
GRPC_STATS_INC_HPACK_SEND_BINARY_BASE64();
- return wire_value(0x80, false,
- grpc_chttp2_base64_encode_and_huffman_compress(value));
+ return WireValue(0x80, false,
+ Slice(grpc_chttp2_base64_encode_and_huffman_compress(
+ value.c_slice())));
}
} else {
/* TODO(ctiller): opportunistically compress non-binary headers */
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
- return wire_value(0x00, false, grpc_slice_ref_internal(value));
+ return WireValue(0x00, false, std::move(value));
}
}
-static uint32_t wire_value_length(const wire_value& v) {
- GPR_DEBUG_ASSERT(v.length <= UINT32_MAX);
- return static_cast<uint32_t>(v.length);
-}
-
-namespace {
-enum class EmitLitHdrType { INC_IDX, NO_IDX };
+struct DefinitelyInterned {
+ static bool IsBinary(grpc_slice key) {
+ return grpc_is_refcounted_slice_binary_header(key);
+ }
+};
+struct UnsureIfInterned {
+ static bool IsBinary(grpc_slice key) {
+ return grpc_is_binary_header_internal(key);
+ }
+};
-enum class EmitLitHdrVType { INC_IDX_V, NO_IDX_V };
-} // namespace
+class BinaryStringValue {
+ public:
+ explicit BinaryStringValue(Slice value, bool use_true_binary_metadata)
+ : wire_value_(
+ GetWireValue(std::move(value), use_true_binary_metadata, true)),
+ len_val_(wire_value_.length) {}
-template <EmitLitHdrType type>
-static void emit_lithdr(grpc_chttp2_hpack_compressor* /*c*/, uint32_t key_index,
- grpc_mdelem elem, framer_state* st) {
- switch (type) {
- case EmitLitHdrType::INC_IDX:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX();
- break;
- case EmitLitHdrType::NO_IDX:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX();
- break;
+ size_t prefix_length() const {
+ return len_val_.length() +
+ (wire_value_.insert_null_before_wire_value ? 1 : 0);
}
- const uint32_t len_pfx = type == EmitLitHdrType::INC_IDX
- ? GRPC_CHTTP2_VARINT_LENGTH(key_index, 2)
- : GRPC_CHTTP2_VARINT_LENGTH(key_index, 4);
- const wire_value value =
- get_wire_value<true>(elem, st->use_true_binary_metadata);
- const uint32_t len_val = wire_value_length(value);
- const uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
- GPR_DEBUG_ASSERT(len_pfx + len_val_len < GRPC_SLICE_INLINED_SIZE);
- uint8_t* data = add_tiny_header_data(
- st,
- len_pfx + len_val_len + (value.insert_null_before_wire_value ? 1 : 0));
- switch (type) {
- case EmitLitHdrType::INC_IDX:
- GRPC_CHTTP2_WRITE_VARINT(key_index, 2, 0x40, data, len_pfx);
- break;
- case EmitLitHdrType::NO_IDX:
- GRPC_CHTTP2_WRITE_VARINT(key_index, 4, 0x00, data, len_pfx);
- break;
+
+ void WritePrefix(uint8_t* prefix_data) {
+ len_val_.Write(wire_value_.huffman_prefix, prefix_data);
+ if (wire_value_.insert_null_before_wire_value) {
+ prefix_data[len_val_.length()] = 0;
+ }
}
- GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix, &data[len_pfx],
- len_val_len);
- if (value.insert_null_before_wire_value) {
- data[len_pfx + len_val_len] = 0;
+
+ Slice data() { return std::move(wire_value_.data); }
+
+ private:
+ WireValue wire_value_;
+ VarintWriter<1> len_val_;
+};
+
+class NonBinaryStringValue {
+ public:
+ explicit NonBinaryStringValue(Slice value)
+ : value_(std::move(value)), len_val_(value_.length()) {}
+
+ size_t prefix_length() const { return len_val_.length(); }
+
+ void WritePrefix(uint8_t* prefix_data) { len_val_.Write(0x00, prefix_data); }
+
+ Slice data() { return std::move(value_); }
+
+ private:
+ Slice value_;
+ VarintWriter<1> len_val_;
+};
+
+class StringKey {
+ public:
+ explicit StringKey(Slice key)
+ : key_(std::move(key)), len_key_(key_.length()) {}
+
+ size_t prefix_length() const { return 1 + len_key_.length(); }
+
+ void WritePrefix(uint8_t type, uint8_t* data) {
+ data[0] = type;
+ len_key_.Write(0x00, data + 1);
}
- add_header_data(st, value.data);
+
+ Slice key() { return std::move(key_); }
+
+ private:
+ Slice key_;
+ VarintWriter<1> len_key_;
+};
+
+void HPackCompressor::Framer::EmitLitHdrWithNonBinaryStringKeyIncIdx(
+ Slice key_slice, Slice value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(std::move(key_slice));
+ key.WritePrefix(0x40, AddTiny(key.prefix_length()));
+ Add(key.key());
+ NonBinaryStringValue emit(std::move(value_slice));
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
}
-template <EmitLitHdrVType type>
-static void emit_lithdr_v(grpc_chttp2_hpack_compressor* /*c*/, grpc_mdelem elem,
- framer_state* st) {
- switch (type) {
- case EmitLitHdrVType::INC_IDX_V:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
- break;
- case EmitLitHdrVType::NO_IDX_V:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
- break;
- }
+void HPackCompressor::Framer::EmitLitHdrWithBinaryStringKeyNotIdx(
+ Slice key_slice, Slice value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
- const uint32_t len_key =
- static_cast<uint32_t>(GRPC_SLICE_LENGTH(GRPC_MDKEY(elem)));
- const wire_value value =
- type == EmitLitHdrVType::INC_IDX_V
- ? get_wire_value<true>(elem, st->use_true_binary_metadata)
- : get_wire_value<false>(elem, st->use_true_binary_metadata);
- const uint32_t len_val = wire_value_length(value);
- const uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
- const uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
- GPR_DEBUG_ASSERT(len_key <= UINT32_MAX);
- GPR_DEBUG_ASSERT(1 + len_key_len < GRPC_SLICE_INLINED_SIZE);
- uint8_t* key_buf = add_tiny_header_data(st, 1 + len_key_len);
- key_buf[0] = type == EmitLitHdrVType::INC_IDX_V ? 0x40 : 0x00;
- GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00, &key_buf[1], len_key_len);
- add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem)));
- uint8_t* value_buf = add_tiny_header_data(
- st, len_val_len + (value.insert_null_before_wire_value ? 1 : 0));
- GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix, value_buf,
- len_val_len);
- if (value.insert_null_before_wire_value) {
- value_buf[len_val_len] = 0;
- }
- add_header_data(st, value.data);
-}
-
-static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor* c,
- framer_state* st) {
- uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(c->max_table_size, 3);
- GRPC_CHTTP2_WRITE_VARINT(c->max_table_size, 3, 0x20,
- add_tiny_header_data(st, len), len);
- c->advertise_table_size_change = 0;
-}
-
-static void GPR_ATTRIBUTE_NOINLINE hpack_enc_log(grpc_mdelem elem) {
- char* k = grpc_slice_to_c_string(GRPC_MDKEY(elem));
- char* v = nullptr;
- if (grpc_is_binary_header_internal(GRPC_MDKEY(elem))) {
- v = grpc_dump_slice(GRPC_MDVALUE(elem), GPR_DUMP_HEX);
- } else {
- v = grpc_slice_to_c_string(GRPC_MDVALUE(elem));
- }
- gpr_log(
- GPR_INFO,
- "Encode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
- k, v, GRPC_MDELEM_IS_INTERNED(elem), GRPC_MDELEM_STORAGE(elem),
- grpc_slice_is_interned(GRPC_MDKEY(elem)),
- grpc_slice_is_interned(GRPC_MDVALUE(elem)));
- gpr_free(k);
- gpr_free(v);
-}
-
-static uint32_t dynidx(grpc_chttp2_hpack_compressor* c, uint32_t elem_index) {
- return 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY + c->tail_remote_index +
- c->table_elems - elem_index;
-}
-
-struct EmitIndexedStatus {
- EmitIndexedStatus() = default;
- EmitIndexedStatus(uint32_t elem_hash, bool emitted, bool can_add)
- : elem_hash(elem_hash), emitted(emitted), can_add(can_add) {}
- const uint32_t elem_hash = 0;
- const bool emitted = false;
- const bool can_add = false;
-};
+ StringKey key(std::move(key_slice));
+ key.WritePrefix(0x00, AddTiny(key.prefix_length()));
+ Add(key.key());
+ BinaryStringValue emit(std::move(value_slice), use_true_binary_metadata_);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
+}
-static EmitIndexedStatus maybe_emit_indexed(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem elem,
- framer_state* st) {
- const uint32_t elem_hash =
- GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED
- ? reinterpret_cast<grpc_core::InternedMetadata*>(
- GRPC_MDELEM_DATA(elem))
- ->hash()
- : reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(elem))
- ->hash();
- /* Update filter to see if we can perhaps add this elem. */
- const uint32_t popularity_hash = UpdateHashtablePopularity(c, elem_hash);
- /* is this elem currently in the decoders table? */
- HpackEncoderIndex indices_key;
- if (GetMatchingIndex<MetadataComparator>(c->elem_table.entries, elem,
- elem_hash, &indices_key) &&
- indices_key > c->tail_remote_index) {
- emit_indexed(c, dynidx(c, indices_key), st);
- return EmitIndexedStatus(elem_hash, true, false);
- }
- /* Didn't hit either cuckoo index, so no emit. */
- return EmitIndexedStatus(elem_hash, false,
- CanAddToHashtable(c, popularity_hash));
-}
-
-static void emit_maybe_add(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- framer_state* st, uint32_t indices_key,
- bool should_add_elem, size_t decoder_space_usage,
- uint32_t elem_hash, uint32_t key_hash) {
- if (should_add_elem) {
- emit_lithdr<EmitLitHdrType::INC_IDX>(c, dynidx(c, indices_key), elem, st);
- add_elem(c, elem, decoder_space_usage, elem_hash, key_hash);
- } else {
- emit_lithdr<EmitLitHdrType::NO_IDX>(c, dynidx(c, indices_key), elem, st);
- }
-}
-
-/* encode an mdelem */
-static void hpack_enc(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- framer_state* st) {
- const grpc_slice& elem_key = GRPC_MDKEY(elem);
- /* User-provided key len validated in grpc_validate_header_key_is_legal(). */
- GPR_DEBUG_ASSERT(GRPC_SLICE_LENGTH(elem_key) > 0);
- /* Header ordering: all reserved headers (prefixed with ':') must precede
- * regular headers. This can be a debug assert, since:
- * 1) User cannot give us ':' headers (grpc_validate_header_key_is_legal()).
- * 2) grpc filters/core should be checked during debug builds. */
-#ifndef NDEBUG
- if (GRPC_SLICE_START_PTR(elem_key)[0] != ':') { /* regular header */
- st->seen_regular_header = 1;
- } else {
- GPR_DEBUG_ASSERT(
- st->seen_regular_header == 0 &&
- "Reserved header (colon-prefixed) happening after regular ones.");
- }
-#endif
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- hpack_enc_log(elem);
- }
- const bool elem_interned = GRPC_MDELEM_IS_INTERNED(elem);
- const bool key_interned = elem_interned || grpc_slice_is_interned(elem_key);
- /* Key is not interned, emit literals. */
- if (!key_interned) {
- emit_lithdr_v<EmitLitHdrVType::NO_IDX_V>(c, elem, st);
- return;
- }
- /* Interned metadata => maybe already indexed. */
- const EmitIndexedStatus ret =
- elem_interned ? maybe_emit_indexed(c, elem, st) : EmitIndexedStatus();
- if (ret.emitted) {
+void HPackCompressor::Framer::EmitLitHdrWithBinaryStringKeyIncIdx(
+ Slice key_slice, Slice value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(std::move(key_slice));
+ key.WritePrefix(0x40, AddTiny(key.prefix_length()));
+ Add(key.key());
+ BinaryStringValue emit(std::move(value_slice), use_true_binary_metadata_);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithBinaryStringKeyNotIdx(
+ uint32_t key_index, Slice value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ BinaryStringValue emit(std::move(value_slice), use_true_binary_metadata_);
+ VarintWriter<4> key(key_index);
+ uint8_t* data = AddTiny(key.length() + emit.prefix_length());
+ key.Write(0x00, data);
+ emit.WritePrefix(data + key.length());
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ Slice key_slice, Slice value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(std::move(key_slice));
+ key.WritePrefix(0x00, AddTiny(key.prefix_length()));
+ Add(key.key());
+ NonBinaryStringValue emit(std::move(value_slice));
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::AdvertiseTableSizeChange() {
+ VarintWriter<3> w(compressor_->table_.max_size());
+ w.Write(0x20, AddTiny(w.length()));
+}
+
+void HPackCompressor::SliceIndex::EmitTo(absl::string_view key,
+ const Slice& value, Framer* framer) {
+ auto& table = framer->compressor_->table_;
+ using It = std::vector<ValueIndex>::iterator;
+ It prev = values_.end();
+ uint32_t transport_length =
+ key.length() + value.length() + hpack_constants::kEntryOverhead;
+ if (transport_length > HPackEncoderTable::MaxEntrySize()) {
+ framer->EmitLitHdrWithNonBinaryStringKeyNotIdx(Slice::FromStaticString(key),
+ value.Ref());
return;
}
- /* should this elem be in the table? */
- const size_t decoder_space_usage =
- grpc_chttp2_get_size_in_hpack_table(elem, st->use_true_binary_metadata);
- const bool decoder_space_available =
- decoder_space_usage < kMaxDecoderSpaceUsage;
- const bool should_add_elem =
- elem_interned && decoder_space_available && ret.can_add;
- const uint32_t elem_hash = ret.elem_hash;
- /* no hits for the elem... maybe there's a key? */
- const uint32_t key_hash = elem_key.refcount->Hash(elem_key);
- HpackEncoderIndex indices_key;
- if (GetMatchingIndex<SliceRefComparator>(
- c->key_table.entries, elem_key.refcount, key_hash, &indices_key) &&
- indices_key > c->tail_remote_index) {
- emit_maybe_add(c, elem, st, indices_key, should_add_elem,
- decoder_space_usage, elem_hash, key_hash);
- return;
+ // Linear scan through previous values to see if we find the value.
+ for (It it = values_.begin(); it != values_.end(); ++it) {
+ if (value == it->value) {
+ // Got a hit... is it still in the decode table?
+ if (table.ConvertableToDynamicIndex(it->index)) {
+ // Yes, emit the index and proceed to cleanup.
+ framer->EmitIndexed(table.DynamicIndex(it->index));
+ } else {
+ // Not current, emit a new literal and update the index.
+ it->index = table.AllocateIndex(transport_length);
+ framer->EmitLitHdrWithNonBinaryStringKeyIncIdx(
+ Slice::FromStaticString(key), value.Ref());
+ }
+ // Bubble this entry up if we can - ensures that the most used values end
+ // up towards the start of the array.
+ if (prev != values_.end()) std::swap(*prev, *it);
+ // If there are entries at the end of the array, and those entries are no
+ // longer in the table, remove them.
+ while (!values_.empty() &&
+ !table.ConvertableToDynamicIndex(values_.back().index)) {
+ values_.pop_back();
+ }
+ // All done, early out.
+ return;
+ }
+ prev = it;
}
- /* no elem, key in the table... fall back to literal emission */
- const bool should_add_key = !elem_interned && decoder_space_available;
- if (should_add_elem || should_add_key) {
- emit_lithdr_v<EmitLitHdrVType::INC_IDX_V>(c, elem, st);
+ // No hit, emit a new literal and add it to the index.
+ uint32_t index = table.AllocateIndex(transport_length);
+ framer->EmitLitHdrWithNonBinaryStringKeyIncIdx(Slice::FromStaticString(key),
+ value.Ref());
+ values_.emplace_back(value.Ref(), index);
+}
+
+void HPackCompressor::Framer::Encode(const Slice& key, const Slice& value) {
+ if (absl::EndsWith(key.as_string_view(), "-bin")) {
+ EmitLitHdrWithBinaryStringKeyNotIdx(key.Ref(), value.Ref());
} else {
- emit_lithdr_v<EmitLitHdrVType::NO_IDX_V>(c, elem, st);
- }
- if (should_add_elem) {
- add_elem(c, elem, decoder_space_usage, elem_hash, key_hash);
- } else if (should_add_key) {
- add_key(c, elem, decoder_space_usage, key_hash);
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(key.Ref(), value.Ref());
}
}
-#define STRLEN_LIT(x) (sizeof(x) - 1)
-#define TIMEOUT_KEY "grpc-timeout"
+void HPackCompressor::Framer::Encode(HttpPathMetadata, const Slice& value) {
+ compressor_->path_index_.EmitTo(HttpPathMetadata::key(), value, this);
+}
-static void deadline_enc(grpc_chttp2_hpack_compressor* c, grpc_millis deadline,
- framer_state* st) {
- char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
- grpc_mdelem mdelem;
- grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(),
- timeout_str);
- mdelem = grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_TIMEOUT, grpc_core::UnmanagedMemorySlice(timeout_str));
- hpack_enc(c, mdelem, st);
- GRPC_MDELEM_UNREF(mdelem);
+void HPackCompressor::Framer::Encode(HttpAuthorityMetadata,
+ const Slice& value) {
+ compressor_->authority_index_.EmitTo(HttpAuthorityMetadata::key(), value,
+ this);
}
-static uint32_t elems_for_bytes(uint32_t bytes) { return (bytes + 31) / 32; }
+void HPackCompressor::Framer::Encode(TeMetadata, TeMetadata::ValueType value) {
+ GPR_ASSERT(value == TeMetadata::ValueType::kTrailers);
+ EncodeAlwaysIndexed(
+ &compressor_->te_index_, "te", Slice::FromStaticString("trailers"),
+ 2 /* te */ + 8 /* trailers */ + hpack_constants::kEntryOverhead);
+}
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c) {
- memset(c, 0, sizeof(*c));
- c->max_table_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
- c->cap_table_elems = elems_for_bytes(c->max_table_size);
- c->max_table_elems = c->cap_table_elems;
- c->max_usable_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
- const size_t alloc_size = sizeof(*c->table_elem_size) * c->cap_table_elems;
- c->table_elem_size = static_cast<uint16_t*>(gpr_malloc(alloc_size));
- memset(c->table_elem_size, 0, alloc_size);
+void HPackCompressor::Framer::Encode(ContentTypeMetadata,
+ ContentTypeMetadata::ValueType value) {
+ if (value != ContentTypeMetadata::ValueType::kApplicationGrpc) {
+ gpr_log(GPR_ERROR, "Not encoding bad content-type header");
+ return;
+ }
+ EncodeAlwaysIndexed(&compressor_->content_type_index_, "content-type",
+ Slice::FromStaticString("application/grpc"),
+ 12 /* content-type */ + 16 /* application/grpc */ +
+ hpack_constants::kEntryOverhead);
}
-void grpc_chttp2_hpack_compressor_destroy(grpc_chttp2_hpack_compressor* c) {
- for (int i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
- auto* const key = GetEntry<grpc_slice_refcount*>(c->key_table.entries, i);
- if (key != nullptr) {
- key->Unref();
- }
- GRPC_MDELEM_UNREF(GetEntry<grpc_mdelem>(c->elem_table.entries, i));
+void HPackCompressor::Framer::Encode(HttpSchemeMetadata,
+ HttpSchemeMetadata::ValueType value) {
+ switch (value) {
+ case HttpSchemeMetadata::ValueType::kHttp:
+ EmitIndexed(6); // :scheme: http
+ break;
+ case HttpSchemeMetadata::ValueType::kHttps:
+ EmitIndexed(7); // :scheme: https
+ break;
+ case HttpSchemeMetadata::ValueType::kInvalid:
+ GPR_ASSERT(false);
+ break;
}
- gpr_free(c->table_elem_size);
}
-void grpc_chttp2_hpack_compressor_set_max_usable_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
- c->max_usable_size = max_table_size;
- grpc_chttp2_hpack_compressor_set_max_table_size(
- c, GPR_MIN(c->max_table_size, max_table_size));
+void HPackCompressor::Framer::Encode(GrpcTraceBinMetadata, const Slice& slice) {
+ EncodeIndexedKeyWithBinaryValue(&compressor_->grpc_trace_bin_index_,
+ "grpc-trace-bin", slice.Ref());
}
-static void rebuild_elems(grpc_chttp2_hpack_compressor* c, uint32_t new_cap) {
- uint16_t* table_elem_size =
- static_cast<uint16_t*>(gpr_malloc(sizeof(*table_elem_size) * new_cap));
- uint32_t i;
+void HPackCompressor::Framer::Encode(GrpcTagsBinMetadata, const Slice& slice) {
+ EncodeIndexedKeyWithBinaryValue(&compressor_->grpc_tags_bin_index_,
+ "grpc-tags-bin", slice.Ref());
+}
- memset(table_elem_size, 0, sizeof(*table_elem_size) * new_cap);
- GPR_ASSERT(c->table_elems <= new_cap);
+void HPackCompressor::Framer::Encode(HttpStatusMetadata, uint32_t status) {
+ if (status == 200) {
+ EmitIndexed(8); // :status: 200
+ return;
+ }
+ uint8_t index = 0;
+ switch (status) {
+ case 204:
+ index = 9; // :status: 204
+ break;
+ case 206:
+ index = 10; // :status: 206
+ break;
+ case 304:
+ index = 11; // :status: 304
+ break;
+ case 400:
+ index = 12; // :status: 400
+ break;
+ case 404:
+ index = 13; // :status: 404
+ break;
+ case 500:
+ index = 14; // :status: 500
+ break;
+ }
+ if (GPR_LIKELY(index != 0)) {
+ EmitIndexed(index);
+ } else {
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(Slice::FromStaticString(":status"),
+ Slice::FromInt64(status));
+ }
+}
- for (i = 0; i < c->table_elems; i++) {
- uint32_t ofs = c->tail_remote_index + i + 1;
- table_elem_size[ofs % new_cap] =
- c->table_elem_size[ofs % c->cap_table_elems];
+void HPackCompressor::Framer::Encode(HttpMethodMetadata,
+ HttpMethodMetadata::ValueType method) {
+ switch (method) {
+ case HttpMethodMetadata::ValueType::kPost:
+ EmitIndexed(3); // :method: POST
+ break;
+ case HttpMethodMetadata::ValueType::kGet:
+ EmitIndexed(2); // :method: GET
+ break;
+ case HttpMethodMetadata::ValueType::kInvalid:
+ GPR_ASSERT(false);
+ break;
}
+}
- c->cap_table_elems = new_cap;
- gpr_free(c->table_elem_size);
- c->table_elem_size = table_elem_size;
+void HPackCompressor::Framer::EncodeAlwaysIndexed(uint32_t* index,
+ absl::string_view key,
+ Slice value,
+ uint32_t transport_length) {
+ if (compressor_->table_.ConvertableToDynamicIndex(*index)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(*index));
+ } else {
+ *index = compressor_->table_.AllocateIndex(transport_length);
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(Slice::FromStaticString(key),
+ std::move(value));
+ }
}
-void grpc_chttp2_hpack_compressor_set_max_table_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
- max_table_size = GPR_MIN(max_table_size, c->max_usable_size);
- if (max_table_size == c->max_table_size) {
+void HPackCompressor::Framer::EncodeIndexedKeyWithBinaryValue(
+ uint32_t* index, absl::string_view key, Slice value) {
+ if (compressor_->table_.ConvertableToDynamicIndex(*index)) {
+ EmitLitHdrWithBinaryStringKeyNotIdx(
+ compressor_->table_.DynamicIndex(*index), std::move(value));
+ } else {
+ *index = compressor_->table_.AllocateIndex(key.length() + value.length() +
+ hpack_constants::kEntryOverhead);
+ EmitLitHdrWithBinaryStringKeyIncIdx(Slice::FromStaticString(key),
+ std::move(value));
+ }
+}
+
+void HPackCompressor::Framer::Encode(GrpcTimeoutMetadata, Timestamp deadline) {
+ Timeout timeout = Timeout::FromDuration(deadline - ExecCtx::Get()->Now());
+ for (auto it = compressor_->previous_timeouts_.begin();
+ it != compressor_->previous_timeouts_.end(); ++it) {
+ double ratio = timeout.RatioVersus(it->timeout);
+ // If the timeout we're sending is shorter than a previous timeout, but
+ // within 3% of it, we'll consider sending it.
+ if (ratio > -3 && ratio <= 0 &&
+ compressor_->table_.ConvertableToDynamicIndex(it->index)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(it->index));
+ // Put this timeout to the front of the queue - forces common timeouts to
+ // be considered earlier.
+ std::swap(*it, *compressor_->previous_timeouts_.begin());
+ return;
+ }
+ }
+ // Clean out some expired timeouts.
+ while (!compressor_->previous_timeouts_.empty() &&
+ !compressor_->table_.ConvertableToDynamicIndex(
+ compressor_->previous_timeouts_.back().index)) {
+ compressor_->previous_timeouts_.pop_back();
+ }
+ Slice encoded = timeout.Encode();
+ uint32_t index = compressor_->table_.AllocateIndex(
+ GrpcTimeoutMetadata::key().length() + encoded.length() +
+ hpack_constants::kEntryOverhead);
+ compressor_->previous_timeouts_.push_back(PreviousTimeout{timeout, index});
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(
+ Slice::FromStaticString(GrpcTimeoutMetadata::key()), std::move(encoded));
+}
+
+void HPackCompressor::Framer::Encode(UserAgentMetadata, const Slice& slice) {
+ if (slice.length() > HPackEncoderTable::MaxEntrySize()) {
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ Slice::FromStaticString(UserAgentMetadata::key()), slice.Ref());
return;
}
- while (c->table_size > 0 && c->table_size > max_table_size) {
- evict_entry(c);
- }
- c->max_table_size = max_table_size;
- c->max_table_elems = elems_for_bytes(max_table_size);
- if (c->max_table_elems > c->cap_table_elems) {
- rebuild_elems(c, GPR_MAX(c->max_table_elems, 2 * c->cap_table_elems));
- } else if (c->max_table_elems < c->cap_table_elems / 3) {
- uint32_t new_cap = GPR_MAX(c->max_table_elems, 16);
- if (new_cap != c->cap_table_elems) {
- rebuild_elems(c, new_cap);
- }
+ if (!slice.is_equivalent(compressor_->user_agent_)) {
+ compressor_->user_agent_ = slice.Ref();
+ compressor_->user_agent_index_ = 0;
}
- c->advertise_table_size_change = 1;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "set max table size from encoder to %d", max_table_size);
- }
-}
-
-void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem** extra_headers,
- size_t extra_headers_size,
- grpc_metadata_batch* metadata,
- const grpc_encode_header_options* options,
- grpc_slice_buffer* outbuf) {
- /* grpc_chttp2_encode_header is called by FlushInitial/TrailingMetadata in
- writing.cc. Specifically, on streams returned by NextStream(), which
- returns streams from the list GRPC_CHTTP2_LIST_WRITABLE. The only way to be
- added to the list is via grpc_chttp2_list_add_writable_stream(), which
- validates that stream_id is not 0. So, this can be a debug assert. */
- GPR_DEBUG_ASSERT(options->stream_id != 0);
- framer_state st;
-#ifndef NDEBUG
- st.seen_regular_header = 0;
-#endif
- st.stream_id = options->stream_id;
- st.output = outbuf;
- st.is_first_frame = 1;
- 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;
-
- /* Encode a metadata batch; store the returned values, representing
- a metadata element that needs to be unreffed back into the metadata
- slot. THIS MAY NOT BE THE SAME ELEMENT (if a decoder table slot got
- updated). After this loop, we'll do a batch unref of elements. */
- begin_frame(&st);
- if (c->advertise_table_size_change != 0) {
- emit_advertise_table_size_change(c, &st);
- }
- for (size_t i = 0; i < extra_headers_size; ++i) {
- grpc_mdelem md = *extra_headers[i];
- const bool is_static =
- GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC;
- uintptr_t static_index;
- if (is_static &&
- (static_index =
- reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md))
- ->StaticIndex()) < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- emit_indexed(c, static_cast<uint32_t>(static_index + 1), &st);
- } else {
- hpack_enc(c, md, &st);
+ EncodeAlwaysIndexed(
+ &compressor_->user_agent_index_, "user-agent", slice.Ref(),
+ 10 /* user-agent */ + slice.size() + hpack_constants::kEntryOverhead);
+}
+
+void HPackCompressor::Framer::Encode(GrpcStatusMetadata,
+ grpc_status_code status) {
+ const uint32_t code = static_cast<uint32_t>(status);
+ uint32_t* index = nullptr;
+ if (code < kNumCachedGrpcStatusValues) {
+ index = &compressor_->cached_grpc_status_[code];
+ if (compressor_->table_.ConvertableToDynamicIndex(*index)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(*index));
+ return;
}
}
- grpc_metadata_batch_assert_ok(metadata);
- for (grpc_linked_mdelem* l = metadata->list.head; l; l = l->next) {
- const bool is_static =
- GRPC_MDELEM_STORAGE(l->md) == GRPC_MDELEM_STORAGE_STATIC;
- uintptr_t static_index;
- if (is_static &&
- (static_index = reinterpret_cast<grpc_core::StaticMetadata*>(
- GRPC_MDELEM_DATA(l->md))
- ->StaticIndex()) < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- emit_indexed(c, static_cast<uint32_t>(static_index + 1), &st);
- } else {
- hpack_enc(c, l->md, &st);
+ Slice key = Slice::FromStaticString(GrpcStatusMetadata::key());
+ Slice value = Slice::FromInt64(code);
+ const uint32_t transport_length =
+ key.length() + value.length() + hpack_constants::kEntryOverhead;
+ if (index != nullptr) {
+ *index = compressor_->table_.AllocateIndex(transport_length);
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(std::move(key), std::move(value));
+ } else {
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(std::move(key), std::move(value));
+ }
+}
+
+void HPackCompressor::Framer::Encode(GrpcEncodingMetadata,
+ grpc_compression_algorithm value) {
+ uint32_t* index = nullptr;
+ if (value < GRPC_COMPRESS_ALGORITHMS_COUNT) {
+ index = &compressor_->cached_grpc_encoding_[static_cast<uint32_t>(value)];
+ if (compressor_->table_.ConvertableToDynamicIndex(*index)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(*index));
+ return;
}
}
- grpc_millis deadline = metadata->deadline;
- if (deadline != GRPC_MILLIS_INF_FUTURE) {
- deadline_enc(c, deadline, &st);
+ auto key = Slice::FromStaticString(GrpcEncodingMetadata::key());
+ auto encoded_value = GrpcEncodingMetadata::Encode(value);
+ uint32_t transport_length =
+ key.length() + encoded_value.length() + hpack_constants::kEntryOverhead;
+ if (index != nullptr) {
+ *index = compressor_->table_.AllocateIndex(transport_length);
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(std::move(key),
+ std::move(encoded_value));
+ } else {
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(std::move(key),
+ std::move(encoded_value));
}
+}
- finish_frame(&st, 1);
+void HPackCompressor::Framer::Encode(GrpcAcceptEncodingMetadata,
+ CompressionAlgorithmSet value) {
+ if (compressor_->grpc_accept_encoding_index_ != 0 &&
+ value == compressor_->grpc_accept_encoding_ &&
+ compressor_->table_.ConvertableToDynamicIndex(
+ compressor_->grpc_accept_encoding_index_)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(
+ compressor_->grpc_accept_encoding_index_));
+ return;
+ }
+ auto key = Slice::FromStaticString(GrpcAcceptEncodingMetadata::key());
+ auto encoded_value = GrpcAcceptEncodingMetadata::Encode(value);
+ uint32_t transport_length =
+ key.length() + encoded_value.length() + hpack_constants::kEntryOverhead;
+ compressor_->grpc_accept_encoding_index_ =
+ compressor_->table_.AllocateIndex(transport_length);
+ compressor_->grpc_accept_encoding_ = value;
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(std::move(key),
+ std::move(encoded_value));
}
+
+void HPackCompressor::SetMaxUsableSize(uint32_t max_table_size) {
+ max_usable_size_ = max_table_size;
+ SetMaxTableSize(std::min(table_.max_size(), max_table_size));
+}
+
+void HPackCompressor::SetMaxTableSize(uint32_t max_table_size) {
+ if (table_.SetMaxSize(std::min(max_usable_size_, max_table_size))) {
+ advertise_table_size_change_ = true;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "set max table size from encoder to %d",
+ max_table_size);
+ }
+ }
+}
+
+HPackCompressor::Framer::Framer(const EncodeHeaderOptions& options,
+ HPackCompressor* compressor,
+ grpc_slice_buffer* output)
+ : max_frame_size_(options.max_frame_size),
+ use_true_binary_metadata_(options.use_true_binary_metadata),
+ is_end_of_stream_(options.is_end_of_stream),
+ stream_id_(options.stream_id),
+ output_(output),
+ stats_(options.stats),
+ compressor_(compressor),
+ prefix_(BeginFrame()) {
+ if (absl::exchange(compressor_->advertise_table_size_change_, false)) {
+ AdvertiseTableSizeChange();
+ }
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 5093f80a..f44a33b8 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -21,87 +21,199 @@
#include <grpc/support/port_platform.h>
+#include <cstdint>
+
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
-#include "src/core/lib/transport/metadata.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
-// This should be <= 8. We use 6 to save space.
-#define GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS 6
-#define GRPC_CHTTP2_HPACKC_NUM_VALUES (1 << GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS)
-/* initial table size, per spec */
-#define GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE 4096
-/* maximum table size we'll actually use */
-#define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024)
-
extern grpc_core::TraceFlag grpc_http_trace;
-struct grpc_chttp2_hpack_compressor {
- uint32_t max_table_size;
- uint32_t max_table_elems;
- uint32_t cap_table_elems;
- /** maximum number of bytes we'll use for the decode table (to guard against
- peers ooming us by setting decode table size high) */
- uint32_t max_usable_size;
- /* one before the lowest usable table index */
- uint32_t tail_remote_index;
- uint32_t table_size;
- uint32_t table_elems;
- uint16_t* table_elem_size;
- /** if non-zero, advertise to the decoder that we'll start using a table
- of this size */
- uint8_t advertise_table_size_change;
-
- /* filter tables for elems: this tables provides an approximate
- popularity count for particular hashes, and are used to determine whether
- a new literal should be added to the compression table or not.
- They track a single integer that counts how often a particular value has
- been seen. When that count reaches max (255), all values are halved. */
- uint32_t filter_elems_sum;
- uint8_t filter_elems[GRPC_CHTTP2_HPACKC_NUM_VALUES];
-
- /* entry tables for keys & elems: these tables track values that have been
- seen and *may* be in the decompressor table */
- struct {
- struct {
- grpc_mdelem value;
- uint32_t index;
- } entries[GRPC_CHTTP2_HPACKC_NUM_VALUES];
- } elem_table; /* Metadata table management */
- struct {
- struct {
- /* Only store the slice refcount - we do not need the byte buffer or
- length of the slice since we only need to store a mapping between the
- identity of the slice and the corresponding HPACK index. Since the
- slice *must* be static or interned, the refcount is sufficient to
- establish identity. */
- grpc_slice_refcount* value;
+namespace grpc_core {
+
+class HPackCompressor {
+ class SliceIndex;
+
+ public:
+ HPackCompressor() = default;
+ ~HPackCompressor() = default;
+
+ // Maximum table size we'll actually use.
+ static constexpr uint32_t kMaxTableSize = 1024 * 1024;
+
+ void SetMaxTableSize(uint32_t max_table_size);
+ void SetMaxUsableSize(uint32_t max_table_size);
+
+ uint32_t test_only_table_size() const {
+ return table_.test_only_table_size();
+ }
+
+ struct EncodeHeaderOptions {
+ uint32_t stream_id;
+ bool is_end_of_stream;
+ bool use_true_binary_metadata;
+ size_t max_frame_size;
+ grpc_transport_one_way_stats* stats;
+ };
+
+ template <typename HeaderSet>
+ void EncodeHeaders(const EncodeHeaderOptions& options,
+ const HeaderSet& headers, grpc_slice_buffer* output) {
+ Framer framer(options, this, output);
+ headers.Encode(&framer);
+ }
+
+ class Framer {
+ public:
+ Framer(const EncodeHeaderOptions& options, HPackCompressor* compressor,
+ grpc_slice_buffer* output);
+ ~Framer() { FinishFrame(true); }
+
+ Framer(const Framer&) = delete;
+ Framer& operator=(const Framer&) = delete;
+
+ void Encode(const Slice& key, const Slice& value);
+ void Encode(HttpPathMetadata, const Slice& value);
+ void Encode(HttpAuthorityMetadata, const Slice& value);
+ void Encode(HttpStatusMetadata, uint32_t status);
+ void Encode(GrpcTimeoutMetadata, Timestamp deadline);
+ void Encode(TeMetadata, TeMetadata::ValueType value);
+ void Encode(ContentTypeMetadata, ContentTypeMetadata::ValueType value);
+ void Encode(HttpSchemeMetadata, HttpSchemeMetadata::ValueType value);
+ void Encode(HttpMethodMetadata, HttpMethodMetadata::ValueType method);
+ void Encode(UserAgentMetadata, const Slice& slice);
+ void Encode(GrpcStatusMetadata, grpc_status_code status);
+ void Encode(GrpcEncodingMetadata, grpc_compression_algorithm value);
+ void Encode(GrpcAcceptEncodingMetadata, CompressionAlgorithmSet value);
+ void Encode(GrpcTagsBinMetadata, const Slice& slice);
+ void Encode(GrpcTraceBinMetadata, const Slice& slice);
+ void Encode(GrpcMessageMetadata, const Slice& slice) {
+ if (slice.empty()) return;
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ Slice::FromStaticString("grpc-message"), slice.Ref());
+ }
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ const Slice& slice = MetadataValueAsSlice<Which>(value);
+ if (absl::EndsWith(Which::key(), "-bin")) {
+ EmitLitHdrWithBinaryStringKeyNotIdx(
+ Slice::FromStaticString(Which::key()), slice.Ref());
+ } else {
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ Slice::FromStaticString(Which::key()), slice.Ref());
+ }
+ }
+
+ private:
+ friend class SliceIndex;
+
+ struct FramePrefix {
+ // index (in output_) of the header for the frame
+ size_t header_idx;
+ // number of bytes in 'output' when we started the frame - used to
+ // calculate frame length
+ size_t output_length_at_start_of_frame;
+ };
+
+ FramePrefix BeginFrame();
+ void FinishFrame(bool is_header_boundary);
+ void EnsureSpace(size_t need_bytes);
+
+ void AdvertiseTableSizeChange();
+ void EmitIndexed(uint32_t index);
+ void EmitLitHdrWithNonBinaryStringKeyIncIdx(Slice key_slice,
+ Slice value_slice);
+ void EmitLitHdrWithBinaryStringKeyIncIdx(Slice key_slice,
+ Slice value_slice);
+ void EmitLitHdrWithBinaryStringKeyNotIdx(Slice key_slice,
+ Slice value_slice);
+ void EmitLitHdrWithBinaryStringKeyNotIdx(uint32_t key_index,
+ Slice value_slice);
+ void EmitLitHdrWithNonBinaryStringKeyNotIdx(Slice key_slice,
+ Slice value_slice);
+
+ void EncodeAlwaysIndexed(uint32_t* index, absl::string_view key,
+ Slice value, uint32_t transport_length);
+ void EncodeIndexedKeyWithBinaryValue(uint32_t* index, absl::string_view key,
+ Slice value);
+
+ size_t CurrentFrameSize() const;
+ void Add(Slice slice);
+ uint8_t* AddTiny(size_t len);
+
+ // maximum size of a frame
+ const size_t max_frame_size_;
+ bool is_first_frame_ = true;
+ const bool use_true_binary_metadata_;
+ const bool is_end_of_stream_;
+ // output stream id
+ const uint32_t stream_id_;
+ grpc_slice_buffer* const output_;
+ grpc_transport_one_way_stats* const stats_;
+ HPackCompressor* const compressor_;
+ FramePrefix prefix_;
+ };
+
+ private:
+ static constexpr size_t kNumFilterValues = 64;
+ static constexpr uint32_t kNumCachedGrpcStatusValues = 16;
+
+ // maximum number of bytes we'll use for the decode table (to guard against
+ // peers ooming us by setting decode table size high)
+ uint32_t max_usable_size_ = hpack_constants::kInitialTableSize;
+ // if non-zero, advertise to the decoder that we'll start using a table
+ // of this size
+ bool advertise_table_size_change_ = false;
+ HPackEncoderTable table_;
+
+ class SliceIndex {
+ public:
+ void EmitTo(absl::string_view key, const Slice& value, Framer* framer);
+
+ private:
+ struct ValueIndex {
+ ValueIndex(Slice value, uint32_t index)
+ : value(std::move(value)), index(index) {}
+ Slice value;
uint32_t index;
- } entries[GRPC_CHTTP2_HPACKC_NUM_VALUES];
- } key_table; /* Key table management */
-};
+ };
+ std::vector<ValueIndex> values_;
+ };
+
+ struct PreviousTimeout {
+ Timeout timeout;
+ uint32_t index;
+ };
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c);
-void grpc_chttp2_hpack_compressor_destroy(grpc_chttp2_hpack_compressor* c);
-void grpc_chttp2_hpack_compressor_set_max_table_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
-void grpc_chttp2_hpack_compressor_set_max_usable_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
-
-struct grpc_encode_header_options {
- uint32_t stream_id;
- bool is_eof;
- bool use_true_binary_metadata;
- size_t max_frame_size;
- grpc_transport_one_way_stats* stats;
+ // Index into table_ for the te:trailers metadata element
+ uint32_t te_index_ = 0;
+ // Index into table_ for the content-type metadata element
+ uint32_t content_type_index_ = 0;
+ // Index into table_ for the user-agent metadata element
+ uint32_t user_agent_index_ = 0;
+ // Cached grpc-status values
+ uint32_t cached_grpc_status_[kNumCachedGrpcStatusValues] = {};
+ // Cached grpc-encoding values
+ uint32_t cached_grpc_encoding_[GRPC_COMPRESS_ALGORITHMS_COUNT] = {};
+ // Cached grpc-accept-encoding value
+ uint32_t grpc_accept_encoding_index_ = 0;
+ // The grpc-accept-encoding string referred to by grpc_accept_encoding_index_
+ CompressionAlgorithmSet grpc_accept_encoding_;
+ // Index of something that was sent with grpc-tags-bin
+ uint32_t grpc_tags_bin_index_ = 0;
+ // Index of something that was sent with grpc-trace-bin
+ uint32_t grpc_trace_bin_index_ = 0;
+ // The user-agent string referred to by user_agent_index_
+ Slice user_agent_;
+ SliceIndex path_index_;
+ SliceIndex authority_index_;
+ std::vector<PreviousTimeout> previous_timeouts_;
};
-void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem** extra_headers,
- size_t extra_headers_size,
- grpc_metadata_batch* metadata,
- const grpc_encode_header_options* options,
- grpc_slice_buffer* outbuf);
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
new file mode 100644
index 00000000..ef31a019
--- /dev/null
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
@@ -0,0 +1,86 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/hpack_encoder_table.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+uint32_t HPackEncoderTable::AllocateIndex(size_t element_size) {
+ uint32_t new_index = tail_remote_index_ + table_elems_ + 1;
+ GPR_DEBUG_ASSERT(element_size <= MaxEntrySize());
+
+ if (element_size > max_table_size_) {
+ while (table_size_ > 0) {
+ EvictOne();
+ }
+ return 0;
+ }
+
+ // Reserve space for this element in the remote table: if this overflows
+ // the current table, drop elements until it fits, matching the decompressor
+ // algorithm.
+ while (table_size_ + element_size > max_table_size_) {
+ EvictOne();
+ }
+ GPR_ASSERT(table_elems_ < elem_size_.size());
+ elem_size_[new_index % elem_size_.size()] =
+ static_cast<uint16_t>(element_size);
+ table_size_ += element_size;
+ table_elems_++;
+
+ return new_index;
+}
+
+bool HPackEncoderTable::SetMaxSize(uint32_t max_table_size) {
+ if (max_table_size == max_table_size_) {
+ return false;
+ }
+ while (table_size_ > 0 && table_size_ > max_table_size) {
+ EvictOne();
+ }
+ max_table_size_ = max_table_size;
+ const size_t max_table_elems =
+ hpack_constants::EntriesForBytes(max_table_size);
+ // TODO(ctiller): integrate with ResourceQuota to rebuild smaller when we can.
+ if (max_table_elems > elem_size_.size()) {
+ Rebuild(std::max(max_table_elems, 2 * elem_size_.size()));
+ }
+ return true;
+}
+
+void HPackEncoderTable::EvictOne() {
+ tail_remote_index_++;
+ GPR_ASSERT(tail_remote_index_ > 0);
+ GPR_ASSERT(table_elems_ > 0);
+ auto removing_size = elem_size_[tail_remote_index_ % elem_size_.size()];
+ GPR_ASSERT(table_size_ >= removing_size);
+ table_size_ -= removing_size;
+ table_elems_--;
+}
+
+void HPackEncoderTable::Rebuild(uint32_t capacity) {
+ decltype(elem_size_) new_elem_size(capacity);
+ GPR_ASSERT(table_elems_ <= capacity);
+ for (uint32_t i = 0; i < table_elems_; i++) {
+ uint32_t ofs = tail_remote_index_ + i + 1;
+ new_elem_size[ofs % capacity] = elem_size_[ofs % elem_size_.size()];
+ }
+ elem_size_.swap(new_elem_size);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
new file mode 100644
index 00000000..ca876948
--- /dev/null
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
@@ -0,0 +1,71 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/container/inlined_vector.h"
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+
+namespace grpc_core {
+
+// Tracks the values available in the remote HPACK header table, and their
+// sizes.
+class HPackEncoderTable {
+ public:
+ HPackEncoderTable() : elem_size_(hpack_constants::kInitialTableEntries) {}
+
+ static constexpr size_t MaxEntrySize() { return 65535; }
+
+ // Reserve space in table for the new element, evict entries if needed.
+ // Return the new index of the element. Return 0 to indicate not adding to
+ // table.
+ uint32_t AllocateIndex(size_t element_size);
+ // Set the maximum table size. Return true if it changed.
+ bool SetMaxSize(uint32_t max_table_size);
+ // Get the current max table size
+ uint32_t max_size() const { return max_table_size_; }
+ // Get the current table size
+ uint32_t test_only_table_size() const { return table_size_; }
+
+ // Convert an element index into a dynamic index
+ uint32_t DynamicIndex(uint32_t index) const {
+ return 1 + hpack_constants::kLastStaticEntry + tail_remote_index_ +
+ table_elems_ - index;
+ }
+ // Check if an element index is convertable to a dynamic index
+ bool ConvertableToDynamicIndex(uint32_t index) const {
+ return index > tail_remote_index_;
+ }
+
+ private:
+ void EvictOne();
+ void Rebuild(uint32_t capacity);
+
+ // one before the lowest usable table index
+ uint32_t tail_remote_index_ = 0;
+ uint32_t max_table_size_ = hpack_constants::kInitialTableSize;
+ uint32_t table_elems_ = 0;
+ uint32_t table_size_ = 0;
+ // The size of each element in the HPACK table.
+ absl::InlinedVector<uint16_t, hpack_constants::kInitialTableEntries>
+ elem_size_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index 99c308f0..cb17759b 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <assert.h>
#include <stddef.h>
@@ -32,6 +31,7 @@
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/profiling/timers.h"
@@ -40,209 +40,17 @@
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/http2_errors.h"
-grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser(
- false, "chttp2_hpack_parser");
-
-typedef enum {
- NOT_BINARY,
- BINARY_BEGIN,
- B64_BYTE0,
- B64_BYTE1,
- B64_BYTE2,
- B64_BYTE3
-} binary_state;
-
-/* How parsing works:
-
- The parser object keeps track of a function pointer which represents the
- current parse state.
-
- Each time new bytes are presented, we call into the current state, which
- recursively parses until all bytes in the given chunk are exhausted.
-
- The parse state that terminates then saves its function pointer to be the
- current state so that it can resume when more bytes are available.
-
- It's expected that most optimizing compilers will turn this code into
- a set of indirect jumps, and so not waste stack space. */
-
-/* forward declarations for parsing states */
-static grpc_error_handle parse_begin(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end,
- grpc_error_handle error);
-static grpc_error_handle still_parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_illegal_op(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-
-static grpc_error_handle parse_string_prefix(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_key_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_value_string_with_indexed_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value_string_with_literal_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end);
-
-static grpc_error_handle parse_value0(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value1(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value2(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value3(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value4(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error_handle parse_value5up(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-
-static grpc_error_handle parse_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_indexed_field_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_incidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_notidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_nvridx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error_handle parse_max_tbl_size_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-
-/* we translate the first byte of a hpack field into one of these decoding
- cases, then use a lookup table to jump directly to the appropriate parser.
-
- _X => the integer index is all ones, meaning we need to do varint decoding
- _V => the integer index is all zeros, meaning we need to decode an additional
- string value */
-typedef enum {
- INDEXED_FIELD,
- INDEXED_FIELD_X,
- LITHDR_INCIDX,
- LITHDR_INCIDX_X,
- LITHDR_INCIDX_V,
- LITHDR_NOTIDX,
- LITHDR_NOTIDX_X,
- LITHDR_NOTIDX_V,
- LITHDR_NVRIDX,
- LITHDR_NVRIDX_X,
- LITHDR_NVRIDX_V,
- MAX_TBL_SIZE,
- MAX_TBL_SIZE_X,
- ILLEGAL
-} first_byte_type;
-
-/* jump table of parse state functions -- order must match first_byte_type
- above */
-static const grpc_chttp2_hpack_parser_state first_byte_action[] = {
- parse_indexed_field, parse_indexed_field_x, parse_lithdr_incidx,
- parse_lithdr_incidx_x, parse_lithdr_incidx_v, parse_lithdr_notidx,
- parse_lithdr_notidx_x, parse_lithdr_notidx_v, parse_lithdr_nvridx,
- parse_lithdr_nvridx_x, parse_lithdr_nvridx_v, parse_max_tbl_size,
- parse_max_tbl_size_x, parse_illegal_op};
-
-/* indexes the first byte to a parse state function - generated by
- gen_hpack_tables.c */
-static const uint8_t first_byte_lut[256] = {
- LITHDR_NOTIDX_V, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX_X,
- LITHDR_NVRIDX_V, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX_X,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE_X,
- LITHDR_INCIDX_V, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX_X,
- ILLEGAL, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD_X,
-};
+#if __cplusplus > 201103L
+#define GRPC_HPACK_CONSTEXPR_FN constexpr
+#define GRPC_HPACK_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_HPACK_CONSTEXPR_FN
+#define GRPC_HPACK_CONSTEXPR_VALUE const
+#endif
+
+namespace grpc_core {
+
+TraceFlag grpc_trace_chttp2_hpack_parser(false, "chttp2_hpack_parser");
/* state table for huffman decoding: given a state, gives an index/16 into
next_sub_tbl. Taking that index and adding the value of the nibble being
@@ -617,1080 +425,893 @@ static const int16_t emit_sub_tbl[249 * 16] = {
13, 22, 22, 22, 22, 256, 256, 256, 256,
};
-static const uint8_t inverse_base64[256] = {
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255,
- 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255,
- 255, 64, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255,
+namespace {
+// The alphabet used for base64 encoding binary metadata.
+constexpr char kBase64Alphabet[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+
+// An inverted table: for each value in kBase64Alphabet, table contains the
+// index with which it's stored, so we can quickly invert the encoding without
+// any complicated runtime logic.
+struct Base64InverseTable {
+ uint8_t table[256]{};
+ GRPC_HPACK_CONSTEXPR_FN Base64InverseTable() {
+ for (int i = 0; i < 256; i++) {
+ table[i] = 255;
+ }
+ for (const char* p = kBase64Alphabet; *p; p++) {
+ uint8_t idx = *p;
+ uint8_t ofs = p - kBase64Alphabet;
+ table[idx] = ofs;
+ }
+ }
};
-static void GPR_ATTRIBUTE_NOINLINE on_hdr_log(grpc_mdelem md) {
- char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* v = nullptr;
- if (grpc_is_binary_header_internal(GRPC_MDKEY(md))) {
- v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
- } else {
- v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+GRPC_HPACK_CONSTEXPR_VALUE Base64InverseTable kBase64InverseTable;
+} // namespace
+
+// Input tracks the current byte through the input data and provides it
+// via a simple stream interface.
+class HPackParser::Input {
+ public:
+ Input(grpc_slice_refcount* current_slice_refcount, const uint8_t* begin,
+ const uint8_t* end)
+ : current_slice_refcount_(current_slice_refcount),
+ begin_(begin),
+ end_(end),
+ frontier_(begin) {}
+
+ // If input is backed by a slice, retrieve its refcount. If not, return
+ // nullptr.
+ grpc_slice_refcount* slice_refcount() { return current_slice_refcount_; }
+
+ // Have we reached the end of input?
+ bool end_of_stream() const { return begin_ == end_; }
+ // How many bytes until end of input
+ size_t remaining() const { return end_ - begin_; }
+ // Current position, as a pointer
+ const uint8_t* cur_ptr() const { return begin_; }
+ // End position, as a pointer
+ const uint8_t* end_ptr() const { return end_; }
+ // Move read position forward by n, unchecked
+ void Advance(size_t n) { begin_ += n; }
+
+ // Retrieve the current character, or nullopt if end of stream
+ // Do not advance
+ absl::optional<uint8_t> peek() const {
+ if (end_of_stream()) {
+ return {};
+ }
+ return *begin_;
}
- gpr_log(
- GPR_INFO,
- "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
- k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md),
- grpc_slice_is_interned(GRPC_MDKEY(md)),
- grpc_slice_is_interned(GRPC_MDVALUE(md)));
- gpr_free(k);
- gpr_free(v);
-}
-/* emission helpers */
-template <bool do_add>
-static grpc_error_handle on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
- on_hdr_log(md);
- }
- if (do_add) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
- GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
- grpc_error_handle err = grpc_chttp2_hptbl_add(&p->table, md);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) return err;
+ // Retrieve and advance past the current character, or return nullopt if end
+ // of stream
+ absl::optional<uint8_t> Next() {
+ if (end_of_stream()) {
+ return UnexpectedEOF(absl::optional<uint8_t>());
+ }
+ return *begin_++;
}
- return p->on_header(p->on_header_user_data, md);
-}
-static grpc_core::UnmanagedMemorySlice take_string_extern(
- grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) {
- grpc_core::UnmanagedMemorySlice s;
- if (!str->copied) {
- GPR_DEBUG_ASSERT(!grpc_slice_is_interned(str->data.referenced));
- s = static_cast<grpc_core::UnmanagedMemorySlice&>(str->data.referenced);
- str->copied = true;
- str->data.referenced = grpc_core::UnmanagedMemorySlice();
- } else {
- s = grpc_core::UnmanagedMemorySlice(str->data.copied.str,
- str->data.copied.length);
+ // Helper to parse a varint delta on top of value, return nullopt on failure
+ // (setting error)
+ absl::optional<uint32_t> ParseVarint(uint32_t value) {
+ // TODO(ctiller): break out a variant of this when we know there are at
+ // least 5 bytes in input_
+ auto cur = Next();
+ if (!cur) return {};
+ value += *cur & 0x7f;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 7;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 14;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 21;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ uint32_t c = (*cur) & 0x7f;
+ // We might overflow here, so we need to be a little careful about the
+ // addition
+ if (c > 0xf) return ParseVarintOutOfRange(value, *cur);
+ const uint32_t add = c << 28;
+ if (add > 0xffffffffu - value) {
+ return ParseVarintOutOfRange(value, *cur);
+ }
+ value += add;
+ if ((*cur & 0x80) == 0) return value;
+
+ // Spec weirdness: we can add an infinite stream of 0x80 at the end of a
+ // varint and still end up with a correctly encoded varint.
+ do {
+ cur = Next();
+ if (!cur.has_value()) return {};
+ } while (*cur == 0x80);
+
+ // BUT... the last byte needs to be 0x00 or we'll overflow dramatically!
+ if (*cur == 0) return value;
+ return ParseVarintOutOfRange(value, *cur);
}
- str->data.copied.length = 0;
- return s;
-}
-static grpc_core::ManagedMemorySlice take_string_intern(
- grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) {
- grpc_core::ManagedMemorySlice s;
- if (!str->copied) {
- s = grpc_core::ManagedMemorySlice(&str->data.referenced);
- grpc_slice_unref_internal(str->data.referenced);
- str->copied = true;
- str->data.referenced = grpc_empty_slice();
- } else {
- s = grpc_core::ManagedMemorySlice(str->data.copied.str,
- str->data.copied.length);
+ // Prefix for a string
+ struct StringPrefix {
+ // Number of bytes in input for string
+ uint32_t length;
+ // Is it huffman compressed
+ bool huff;
+ };
+
+ // Parse a string prefix
+ absl::optional<StringPrefix> ParseStringPrefix() {
+ auto cur = Next();
+ if (!cur.has_value()) return {};
+ // Huffman if the top bit is 1
+ const bool huff = (*cur & 0x80) != 0;
+ // String length
+ uint32_t strlen = (*cur & 0x7f);
+ if (strlen == 0x7f) {
+ // all ones ==> varint string length
+ auto v = ParseVarint(0x7f);
+ if (!v.has_value()) return {};
+ strlen = *v;
+ }
+ return StringPrefix{strlen, huff};
}
- str->data.copied.length = 0;
- return s;
-}
-/* jump to the next state */
-static grpc_error_handle parse_next(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- p->state = *p->next_state++;
- return p->state(p, cur, end);
-}
+ // Check if we saw an EOF.. must be verified before looking at TakeError
+ bool eof_error() const { return eof_error_; }
-/* begin parsing a header: all functionality is encoded into lookup tables
- above */
-static grpc_error_handle parse_begin(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_begin;
- return GRPC_ERROR_NONE;
+ // Extract the parse error, leaving the current error as NONE.
+ grpc_error_handle TakeError() {
+ grpc_error_handle out = error_;
+ error_ = GRPC_ERROR_NONE;
+ return out;
}
- return first_byte_action[first_byte_lut[*cur]](p, cur, end);
-}
-
-/* stream dependency and prioritization data: we just skip it */
-static grpc_error_handle parse_stream_weight(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_weight;
- return GRPC_ERROR_NONE;
+ // Set the current error - allows the rest of the code not to need to pass
+ // around StatusOr<> which would be prohibitive here.
+ GPR_ATTRIBUTE_NOINLINE void SetError(grpc_error_handle error) {
+ if (error_ != GRPC_ERROR_NONE || eof_error_) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ error_ = error;
+ begin_ = end_;
}
- return p->after_prioritization(p, cur + 1, end);
-}
-
-static grpc_error_handle parse_stream_dep3(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep3;
- return GRPC_ERROR_NONE;
+ // If no error is set, set it to the value produced by error_factory.
+ // Return return_value unchanged.
+ template <typename F, typename T>
+ GPR_ATTRIBUTE_NOINLINE T MaybeSetErrorAndReturn(F error_factory,
+ T return_value) {
+ if (error_ != GRPC_ERROR_NONE || eof_error_) return return_value;
+ error_ = error_factory();
+ begin_ = end_;
+ return return_value;
}
- return parse_stream_weight(p, cur + 1, end);
-}
-
-static grpc_error_handle parse_stream_dep2(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep2;
- return GRPC_ERROR_NONE;
+ // Set the error to an unexpected eof, and return result (code golfed as this
+ // is a common case)
+ template <typename T>
+ T UnexpectedEOF(T return_value) {
+ if (error_ != GRPC_ERROR_NONE) return return_value;
+ eof_error_ = true;
+ return return_value;
}
- return parse_stream_dep3(p, cur + 1, end);
-}
-
-static grpc_error_handle parse_stream_dep1(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep1;
- return GRPC_ERROR_NONE;
+ // Update the frontier - signifies we've successfully parsed another element
+ void UpdateFrontier() { frontier_ = begin_; }
+
+ // Get the frontier - for buffering should we fail due to eof
+ const uint8_t* frontier() const { return frontier_; }
+
+ private:
+ // Helper to set the error to out of range for ParseVarint
+ absl::optional<uint32_t> ParseVarintOutOfRange(uint32_t value,
+ uint8_t last_byte) {
+ return MaybeSetErrorAndReturn(
+ [value, last_byte] {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "integer overflow in hpack integer decoding: have 0x%08x, "
+ "got byte 0x%02x on byte 5",
+ value, last_byte));
+ },
+ absl::optional<uint32_t>());
}
- return parse_stream_dep2(p, cur + 1, end);
-}
+ // Refcount if we are backed by a slice
+ grpc_slice_refcount* current_slice_refcount_;
+ // Current input point
+ const uint8_t* begin_;
+ // End of stream point
+ const uint8_t* const end_;
+ // Frontier denotes the first byte past successfully processed input
+ const uint8_t* frontier_;
+ // Current error
+ grpc_error_handle error_ = GRPC_ERROR_NONE;
+ // If the error was EOF, we flag it here..
+ bool eof_error_ = false;
+};
-static grpc_error_handle parse_stream_dep0(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep0;
- return GRPC_ERROR_NONE;
+// Helper to parse a string and turn it into a slice with appropriate memory
+// management characteristics
+class HPackParser::String {
+ public:
+ String(const String&) = delete;
+ String& operator=(const String&) = delete;
+ String(String&& other) noexcept : value_(std::move(other.value_)) {
+ other.value_ = absl::Span<const uint8_t>();
}
-
- return parse_stream_dep1(p, cur + 1, end);
-}
-
-static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
-on_invalid_hpack_idx(grpc_chttp2_hpack_parser* p) {
- return grpc_error_set_int(
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid HPACK index received"),
- GRPC_ERROR_INT_INDEX, static_cast<intptr_t>(p->index)),
- GRPC_ERROR_INT_SIZE, static_cast<intptr_t>(p->table.num_ents));
-}
-
-/* emit an indexed field; jumps to begin the next field on completion */
-static grpc_error_handle finish_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- grpc_mdelem md = grpc_chttp2_hptbl_lookup<true>(&p->table, p->index);
- if (GPR_UNLIKELY(GRPC_MDISNULL(md))) {
- return on_invalid_hpack_idx(p);
+ String& operator=(String&& other) noexcept {
+ value_ = std::move(other.value_);
+ other.value_ = absl::Span<const uint8_t>();
+ return *this;
}
- GRPC_STATS_INC_HPACK_RECV_INDEXED();
- grpc_error_handle err = on_hdr<false>(p, md);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) return err;
- return parse_begin(p, cur, end);
-}
-/* parse an indexed field with index < 127 */
-static grpc_error_handle parse_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- p->dynamic_table_update_allowed = 0;
- p->index = (*cur) & 0x7f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return finish_indexed_field(p, cur + 1, end);
-}
-
-/* parse an indexed field with index >= 127 */
-static grpc_error_handle parse_indexed_field_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- finish_indexed_field};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0x7f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ // Take the value and leave this empty
+ Slice Take();
+
+ // Return a reference to the value as a string view
+ absl::string_view string_view() const {
+ if (auto* p = absl::get_if<Slice>(&value_)) {
+ return p->as_string_view();
+ } else if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) {
+ return absl::string_view(reinterpret_cast<const char*>(p->data()),
+ p->size());
+ } else if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) {
+ return absl::string_view(reinterpret_cast<const char*>(p->data()),
+ p->size());
+ }
+ GPR_UNREACHABLE_CODE(return absl::string_view());
+ }
-/* When finishing with a header, get the cached md element for this index.
- This is set in parse_value_string(). We ensure (in debug mode) that the
- cached metadata corresponds with the index we are examining. */
-static grpc_mdelem get_precomputed_md_for_idx(grpc_chttp2_hpack_parser* p) {
- GPR_DEBUG_ASSERT(p->md_for_index.payload != 0);
- GPR_DEBUG_ASSERT(static_cast<int64_t>(p->index) == p->precomputed_md_index);
- grpc_mdelem md = p->md_for_index;
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
-#ifndef NDEBUG
- p->precomputed_md_index = -1;
-#endif
- return md;
-}
+ // Parse a non-binary string
+ static absl::optional<String> Parse(Input* input) {
+ auto pfx = input->ParseStringPrefix();
+ if (!pfx.has_value()) return {};
+ if (pfx->huff) {
+ // Huffman coded
+ std::vector<uint8_t> output;
+ auto v = ParseHuff(input, pfx->length,
+ [&output](uint8_t c) { output.push_back(c); });
+ if (!v) return {};
+ return String(std::move(output));
+ }
+ return ParseUncompressed(input, pfx->length);
+ }
-static const grpc_core::ManagedMemorySlice& get_indexed_key(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(md));
- return static_cast<const grpc_core::ManagedMemorySlice&>(
- grpc_slice_ref_internal(GRPC_MDKEY(md)));
-}
+ // Parse a binary string
+ static absl::optional<String> ParseBinary(Input* input) {
+ auto pfx = input->ParseStringPrefix();
+ if (!pfx.has_value()) return {};
+ if (!pfx->huff) {
+ if (pfx->length > 0 && input->peek() == 0) {
+ // 'true-binary'
+ input->Advance(1);
+ return ParseUncompressed(input, pfx->length - 1);
+ }
+ // Base64 encoded... pull out the string, then unbase64 it
+ auto base64 = ParseUncompressed(input, pfx->length);
+ if (!base64.has_value()) return {};
+ return Unbase64(input, std::move(*base64));
+ } else {
+ // Huffman encoded...
+ std::vector<uint8_t> decompressed;
+ // State here says either we don't know if it's base64 or binary, or we do
+ // and what is it.
+ enum class State { kUnsure, kBinary, kBase64 };
+ State state = State::kUnsure;
+ auto decompressed_ok =
+ ParseHuff(input, pfx->length, [&state, &decompressed](uint8_t c) {
+ if (state == State::kUnsure) {
+ // First byte... if it's zero it's binary
+ if (c == 0) {
+ // Save the type, and skip the zero
+ state = State::kBinary;
+ return;
+ } else {
+ // Flag base64, store this value
+ state = State::kBase64;
+ }
+ }
+ // Non-first byte, or base64 first byte
+ decompressed.push_back(c);
+ });
+ if (!decompressed_ok) return {};
+ switch (state) {
+ case State::kUnsure:
+ // No bytes, empty span
+ return String(absl::Span<const uint8_t>());
+ case State::kBinary:
+ // Binary, we're done
+ return String(std::move(decompressed));
+ case State::kBase64:
+ // Base64 - unpack it
+ return Unbase64(input, String(std::move(decompressed)));
+ }
+ GPR_UNREACHABLE_CODE(abort(););
+ }
+ }
-/* finish a literal header with incremental indexing */
-static grpc_error_handle finish_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error_handle err = on_hdr<true>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_intern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ private:
+ void AppendBytes(const uint8_t* data, size_t length);
+ explicit String(std::vector<uint8_t> v) : value_(std::move(v)) {}
+ explicit String(absl::Span<const uint8_t> v) : value_(v) {}
+ String(grpc_slice_refcount* r, const uint8_t* begin, const uint8_t* end)
+ : value_(Slice::FromRefcountAndBytes(r, begin, end)) {}
+
+ // Parse some huffman encoded bytes, using output(uint8_t b) to emit each
+ // decoded byte.
+ template <typename Out>
+ static bool ParseHuff(Input* input, uint32_t length, Out output) {
+ GRPC_STATS_INC_HPACK_RECV_HUFFMAN();
+ int16_t state = 0;
+ // Parse one half byte... we leverage some lookup tables to keep the logic
+ // here really simple.
+ auto nibble = [&output, &state](uint8_t nibble) {
+ int16_t emit = emit_sub_tbl[16 * emit_tbl[state] + nibble];
+ int16_t next = next_sub_tbl[16 * next_tbl[state] + nibble];
+ if (emit != -1) {
+ if (emit >= 0 && emit < 256) {
+ output(static_cast<uint8_t>(emit));
+ } else {
+ assert(emit == 256);
+ }
+ }
+ state = next;
+ };
+ // If there's insufficient bytes remaining, return now.
+ if (input->remaining() < length) {
+ return input->UnexpectedEOF(false);
+ }
+ // Grab the byte range, and iterate through it.
+ const uint8_t* p = input->cur_ptr();
+ input->Advance(length);
+ for (uint32_t i = 0; i < length; i++) {
+ nibble(p[i] >> 4);
+ nibble(p[i] & 0xf);
+ }
+ return true;
+ }
-/* finish a literal header with incremental indexing with no index */
-static grpc_error_handle finish_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V();
- grpc_error_handle err = on_hdr<true>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_intern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ // Parse some uncompressed string bytes.
+ static absl::optional<String> ParseUncompressed(Input* input,
+ uint32_t length) {
+ GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
+ // Check there's enough bytes
+ if (input->remaining() < length) {
+ return input->UnexpectedEOF(absl::optional<String>());
+ }
+ auto* refcount = input->slice_refcount();
+ auto* p = input->cur_ptr();
+ input->Advance(length);
+ if (refcount != nullptr) {
+ return String(refcount, p, p + length);
+ } else {
+ return String(absl::Span<const uint8_t>(p, length));
+ }
+ }
-/* parse a literal header with incremental indexing; index < 63 */
-static grpc_error_handle parse_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_incidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0x3f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ // Turn base64 encoded bytes into not base64 encoded bytes.
+ // Only takes input to set an error on failure.
+ static absl::optional<String> Unbase64(Input* input, String s) {
+ absl::optional<std::vector<uint8_t>> result;
+ if (auto* p = absl::get_if<Slice>(&s.value_)) {
+ result = Unbase64Loop(p->begin(), p->end());
+ }
+ if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&s.value_)) {
+ result = Unbase64Loop(p->begin(), p->end());
+ }
+ if (auto* p = absl::get_if<std::vector<uint8_t>>(&s.value_)) {
+ result = Unbase64Loop(p->data(), p->data() + p->size());
+ }
+ if (!result.has_value()) {
+ return input->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "illegal base64 encoding");
+ },
+ absl::optional<String>());
+ }
+ return String(std::move(*result));
+ }
-/* parse a literal header with incremental indexing; index >= 63 */
-static grpc_error_handle parse_lithdr_incidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_incidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0x3f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ // Main loop for Unbase64
+ static absl::optional<std::vector<uint8_t>> Unbase64Loop(const uint8_t* cur,
+ const uint8_t* end) {
+ while (cur != end && end[-1] == '=') {
+ --end;
+ }
-/* parse a literal header with incremental indexing; index = 0 */
-static grpc_error_handle parse_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_incidx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ std::vector<uint8_t> out;
+ out.reserve(3 * (end - cur) / 4 + 3);
-/* finish a literal header without incremental indexing */
-static grpc_error_handle finish_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error_handle err = on_hdr<false>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ // Decode 4 bytes at a time while we can
+ while (end - cur >= 4) {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
+ ++cur;
-/* finish a literal header without incremental indexing with index = 0 */
-static grpc_error_handle finish_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V();
- grpc_error_handle err = on_hdr<false>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
+ ++cur;
-/* parse a literal header without incremental indexing; index < 15 */
-static grpc_error_handle parse_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_notidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 6;
+ ++cur;
-/* parse a literal header without incremental indexing; index >= 15 */
-static grpc_error_handle parse_lithdr_notidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_notidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits;
+ ++cur;
-/* parse a literal header without incremental indexing; index == 0 */
-static grpc_error_handle parse_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_notidx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ out.insert(out.end(), {static_cast<uint8_t>(buffer >> 16),
+ static_cast<uint8_t>(buffer >> 8),
+ static_cast<uint8_t>(buffer)});
+ }
+ // Deal with the last 0, 1, 2, or 3 bytes.
+ switch (end - cur) {
+ case 0:
+ return out;
+ case 1:
+ return {};
+ case 2: {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
-/* finish a literal header that is never indexed */
-static grpc_error_handle finish_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error_handle err = on_hdr<false>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
-/* finish a literal header that is never indexed with an extra value */
-static grpc_error_handle finish_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V();
- grpc_error_handle err = on_hdr<false>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ if (buffer & 0xffff) return {};
+ out.push_back(static_cast<uint8_t>(buffer >> 16));
+ return out;
+ }
+ case 3: {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
-/* parse a literal header that is never indexed; index < 15 */
-static grpc_error_handle parse_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_nvridx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
-/* parse a literal header that is never indexed; index >= 15 */
-static grpc_error_handle parse_lithdr_nvridx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_nvridx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 6;
-/* parse a literal header that is never indexed; index == 0 */
-static grpc_error_handle parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_nvridx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ ++cur;
+ if (buffer & 0xff) return {};
+ out.push_back(static_cast<uint8_t>(buffer >> 16));
+ out.push_back(static_cast<uint8_t>(buffer >> 8));
+ return out;
+ }
+ }
-/* finish parsing a max table size change */
-static grpc_error_handle finish_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
- gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index);
+ GPR_UNREACHABLE_CODE(return out;);
}
- grpc_error_handle err =
- grpc_chttp2_hptbl_set_current_table_size(&p->table, p->index);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
-/* parse a max table size change, max size < 15 */
-static grpc_error_handle parse_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (p->dynamic_table_update_allowed == 0) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "More than two max table size changes in a single frame"));
- }
- p->dynamic_table_update_allowed--;
- p->index = (*cur) & 0x1f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return finish_max_tbl_size(p, cur + 1, end);
-}
+ absl::variant<Slice, absl::Span<const uint8_t>, std::vector<uint8_t>> value_;
+};
-/* parse a max table size change, max size >= 15 */
-static grpc_error_handle parse_max_tbl_size_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- finish_max_tbl_size};
- if (p->dynamic_table_update_allowed == 0) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "More than two max table size changes in a single frame"));
+// Parser parses one key/value pair from a byte stream.
+class HPackParser::Parser {
+ public:
+ Parser(Input* input, grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, HPackTable* table,
+ uint8_t* dynamic_table_updates_allowed, uint32_t* frame_length,
+ LogInfo log_info)
+ : input_(input),
+ metadata_buffer_(metadata_buffer),
+ table_(table),
+ dynamic_table_updates_allowed_(dynamic_table_updates_allowed),
+ frame_length_(frame_length),
+ metadata_size_limit_(metadata_size_limit),
+ log_info_(log_info) {}
+
+ // Skip any priority bits, or return false on failure
+ bool SkipPriority() {
+ if (input_->remaining() < 5) return input_->UnexpectedEOF(false);
+ input_->Advance(5);
+ return true;
}
- p->dynamic_table_update_allowed--;
- p->next_state = and_then;
- p->index = 0x1f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
-/* a parse error: jam the parse state into parse_error, and return error */
-static grpc_error_handle parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* /*cur*/,
- const uint8_t* /*end*/,
- grpc_error_handle err) {
- GPR_ASSERT(err != GRPC_ERROR_NONE);
- if (p->last_error == GRPC_ERROR_NONE) {
- p->last_error = GRPC_ERROR_REF(err);
+ bool Parse() {
+ auto cur = *input_->Next();
+ switch (cur >> 4) {
+ // Literal header not indexed - First byte format: 0000xxxx
+ // Literal header never indexed - First byte format: 0001xxxx
+ // Where xxxx:
+ // 0000 - literal key
+ // 1111 - indexed key, varint encoded index
+ // other - indexed key, inline encoded index
+ case 0:
+ case 1:
+ switch (cur & 0xf) {
+ case 0: // literal key
+ return FinishHeaderOmitFromTable(ParseLiteralKey());
+ case 0xf: // varint encoded key index
+ return FinishHeaderOmitFromTable(ParseVarIdxKey(0xf));
+ default: // inline encoded key index
+ return FinishHeaderOmitFromTable(ParseIdxKey(cur & 0xf));
+ }
+ // Update max table size.
+ // First byte format: 001xxxxx
+ // Where xxxxx:
+ // 11111 - max size is varint encoded
+ // other - max size is stored inline
+ case 2:
+ // inline encoded max table size
+ return FinishMaxTableSize(cur & 0x1f);
+ case 3:
+ if (cur == 0x3f) {
+ // varint encoded max table size
+ return FinishMaxTableSize(input_->ParseVarint(0x1f));
+ } else {
+ // inline encoded max table size
+ return FinishMaxTableSize(cur & 0x1f);
+ }
+ // Literal header with incremental indexing.
+ // First byte format: 01xxxxxx
+ // Where xxxxxx:
+ // 000000 - literal key
+ // 111111 - indexed key, varint encoded index
+ // other - indexed key, inline encoded index
+ case 4:
+ if (cur == 0x40) {
+ // literal key
+ return FinishHeaderAndAddToTable(ParseLiteralKey());
+ }
+ ABSL_FALLTHROUGH_INTENDED;
+ case 5:
+ case 6:
+ // inline encoded key index
+ return FinishHeaderAndAddToTable(ParseIdxKey(cur & 0x3f));
+ case 7:
+ if (cur == 0x7f) {
+ // varint encoded key index
+ return FinishHeaderAndAddToTable(ParseVarIdxKey(0x3f));
+ } else {
+ // inline encoded key index
+ return FinishHeaderAndAddToTable(ParseIdxKey(cur & 0x3f));
+ }
+ // Indexed Header Field Representation
+ // First byte format: 1xxxxxxx
+ // Where xxxxxxx:
+ // 0000000 - illegal
+ // 1111111 - varint encoded field index
+ // other - inline encoded field index
+ case 8:
+ if (cur == 0x80) {
+ // illegal value.
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Illegal hpack op code");
+ },
+ false);
+ }
+ ABSL_FALLTHROUGH_INTENDED;
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ // inline encoded field index
+ return FinishIndexed(cur & 0x7f);
+ case 15:
+ if (cur == 0xff) {
+ // varint encoded field index
+ return FinishIndexed(input_->ParseVarint(0x7f));
+ } else {
+ // inline encoded field index
+ return FinishIndexed(cur & 0x7f);
+ }
+ }
+ GPR_UNREACHABLE_CODE(abort());
}
- p->state = still_parse_error;
- return err;
-}
-
-static grpc_error_handle still_parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* /*cur*/,
- const uint8_t* /*end*/) {
- return GRPC_ERROR_REF(p->last_error);
-}
-static grpc_error_handle parse_illegal_op(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GPR_ASSERT(cur != end);
- grpc_error_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Illegal hpack op code ", *cur).c_str());
- return parse_error(p, cur, end, err);
-}
-
-/* parse the 1st byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error_handle parse_value0(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value0;
- return GRPC_ERROR_NONE;
+ private:
+ void GPR_ATTRIBUTE_NOINLINE LogHeader(const HPackTable::Memento& memento) {
+ const char* type;
+ switch (log_info_.type) {
+ case LogInfo::kHeaders:
+ type = "HDR";
+ break;
+ case LogInfo::kTrailers:
+ type = "TRL";
+ break;
+ case LogInfo::kDontKnow:
+ type = "???";
+ break;
+ }
+ gpr_log(GPR_DEBUG, "HTTP:%d:%s:%s: %s", log_info_.stream_id, type,
+ log_info_.is_client ? "CLI" : "SVR", memento.DebugString().c_str());
}
- *p->parsing.value += (*cur) & 0x7f;
+ bool EmitHeader(const HPackTable::Memento& md) {
+ // Pass up to the transport
+ if (GPR_UNLIKELY(metadata_buffer_ == nullptr)) return true;
+ *frame_length_ += md.transport_size();
+ if (GPR_UNLIKELY(*frame_length_ > metadata_size_limit_)) {
+ return HandleMetadataSizeLimitExceeded(md);
+ }
- if ((*cur) & 0x80) {
- return parse_value1(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ metadata_buffer_->Set(md);
+ return true;
}
-}
-/* parse the 2nd byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error_handle parse_value1(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value1;
- return GRPC_ERROR_NONE;
+ bool FinishHeaderAndAddToTable(absl::optional<HPackTable::Memento> md) {
+ // Allow higher code to just pass in failures ... simplifies things a bit.
+ if (!md.has_value()) return false;
+ // Log if desired
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
+ LogHeader(*md);
+ }
+ // Emit whilst we own the metadata.
+ auto r = EmitHeader(*md);
+ // Add to the hpack table
+ grpc_error_handle err = table_->Add(std::move(*md));
+ if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
+ input_->SetError(err);
+ return false;
+ };
+ return r;
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 7;
-
- if ((*cur) & 0x80) {
- return parse_value2(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ bool FinishHeaderOmitFromTable(absl::optional<HPackTable::Memento> md) {
+ // Allow higher code to just pass in failures ... simplifies things a bit.
+ if (!md.has_value()) return false;
+ return FinishHeaderOmitFromTable(*md);
}
-}
-/* parse the 3rd byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error_handle parse_value2(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value2;
- return GRPC_ERROR_NONE;
+ bool FinishHeaderOmitFromTable(const HPackTable::Memento& md) {
+ // Log if desired
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
+ LogHeader(md);
+ }
+ return EmitHeader(md);
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 14;
-
- if ((*cur) & 0x80) {
- return parse_value3(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
- }
-}
-
-/* parse the 4th byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error_handle parse_value3(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value3;
- return GRPC_ERROR_NONE;
+ // Parse a string encoded key and a string encoded value
+ absl::optional<HPackTable::Memento> ParseLiteralKey() {
+ auto key = String::Parse(input_);
+ if (!key.has_value()) return {};
+ auto value = ParseValueString(absl::EndsWith(key->string_view(), "-bin"));
+ if (GPR_UNLIKELY(!value.has_value())) {
+ return {};
+ }
+ auto key_string = key->string_view();
+ auto value_slice = value->Take();
+ const auto transport_size = key_string.size() + value_slice.size() +
+ hpack_constants::kEntryOverhead;
+ return grpc_metadata_batch::Parse(
+ key->string_view(), std::move(value_slice), transport_size,
+ [key_string](absl::string_view error, const Slice& value) {
+ ReportMetadataParseError(key_string, error, value.as_string_view());
+ });
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 21;
-
- if ((*cur) & 0x80) {
- return parse_value4(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ // Parse an index encoded key and a string encoded value
+ absl::optional<HPackTable::Memento> ParseIdxKey(uint32_t index) {
+ const auto* elem = table_->Lookup(index);
+ if (GPR_UNLIKELY(elem == nullptr)) {
+ return InvalidHPackIndexError(index,
+ absl::optional<HPackTable::Memento>());
+ }
+ auto value = ParseValueString(elem->is_binary_header());
+ if (GPR_UNLIKELY(!value.has_value())) return {};
+ return elem->WithNewValue(
+ value->Take(), [=](absl::string_view error, const Slice& value) {
+ ReportMetadataParseError(elem->key(), error, value.as_string_view());
+ });
}
-}
-
-/* parse the 5th byte of a varint into p->parsing.value
- depending on the byte, we may overflow, and care must be taken */
-static grpc_error_handle parse_value4(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- uint8_t c;
- uint32_t cur_value;
- uint32_t add_value;
- if (cur == end) {
- p->state = parse_value4;
- return GRPC_ERROR_NONE;
+ // Parse a varint index encoded key and a string encoded value
+ absl::optional<HPackTable::Memento> ParseVarIdxKey(uint32_t offset) {
+ auto index = input_->ParseVarint(offset);
+ if (GPR_UNLIKELY(!index.has_value())) return {};
+ return ParseIdxKey(*index);
}
- c = (*cur) & 0x7f;
- if (c > 0xf) {
- goto error;
+ // Parse a string, figuring out if it's binary or not by the key name.
+ absl::optional<String> ParseValueString(bool is_binary) {
+ if (is_binary) {
+ return String::ParseBinary(input_);
+ } else {
+ return String::Parse(input_);
+ }
}
- cur_value = *p->parsing.value;
- add_value = (static_cast<uint32_t>(c)) << 28;
- if (add_value > 0xffffffffu - cur_value) {
- goto error;
+ // Emit an indexed field
+ bool FinishIndexed(absl::optional<uint32_t> index) {
+ *dynamic_table_updates_allowed_ = 0;
+ if (!index.has_value()) return false;
+ const auto* elem = table_->Lookup(*index);
+ if (GPR_UNLIKELY(elem == nullptr)) {
+ return InvalidHPackIndexError(*index, false);
+ }
+ GRPC_STATS_INC_HPACK_RECV_INDEXED();
+ return FinishHeaderOmitFromTable(*elem);
}
- *p->parsing.value = cur_value + add_value;
-
- if ((*cur) & 0x80) {
- return parse_value5up(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ // finish parsing a max table size change
+ bool FinishMaxTableSize(absl::optional<uint32_t> size) {
+ if (!size.has_value()) return false;
+ if (*dynamic_table_updates_allowed_ == 0) {
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "More than two max table size changes in a single frame");
+ },
+ false);
+ }
+ (*dynamic_table_updates_allowed_)--;
+ grpc_error_handle err = table_->SetCurrentTableSize(*size);
+ if (err != GRPC_ERROR_NONE) {
+ input_->SetError(err);
+ return false;
+ }
+ return true;
}
-error:
- grpc_error_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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);
-}
-
-/* parse any trailing bytes in a varint: it's possible to append an arbitrary
- number of 0x80's and not affect the value - a zero will terminate - and
- anything else will overflow */
-static grpc_error_handle parse_value5up(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- while (cur != end && *cur == 0x80) {
- ++cur;
+ // Set an invalid hpack index error if no error has been set. Returns result
+ // unmodified.
+ template <typename R>
+ R InvalidHPackIndexError(uint32_t index, R result) {
+ return input_->MaybeSetErrorAndReturn(
+ [this, index] {
+ return grpc_error_set_int(
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid HPACK index received"),
+ GRPC_ERROR_INT_INDEX,
+ static_cast<intptr_t>(index)),
+ GRPC_ERROR_INT_SIZE,
+ static_cast<intptr_t>(this->table_->num_entries()));
+ },
+ std::move(result));
}
- if (cur == end) {
- p->state = parse_value5up;
- return GRPC_ERROR_NONE;
+ GPR_ATTRIBUTE_NOINLINE
+ bool HandleMetadataSizeLimitExceeded(const HPackTable::Memento&) {
+ gpr_log(GPR_DEBUG,
+ "received initial metadata size exceeds limit (%" PRIu32
+ " vs. %" PRIu32
+ "). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
+ *frame_length_, metadata_size_limit_);
+ if (metadata_buffer_ != nullptr) metadata_buffer_->Clear();
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "received initial metadata size exceeds limit"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
+ },
+ false);
}
- if (*cur == 0) {
- return parse_next(p, cur + 1, end);
+ static void ReportMetadataParseError(absl::string_view key,
+ absl::string_view error,
+ absl::string_view value) {
+ gpr_log(
+ GPR_ERROR, "Error parsing metadata: %s",
+ absl::StrCat("error=", error, " key=", key, " value=", value).c_str());
}
- grpc_error_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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);
-}
-
-/* parse a string prefix */
-static grpc_error_handle parse_string_prefix(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_string_prefix;
- return GRPC_ERROR_NONE;
- }
+ Input* const input_;
+ grpc_metadata_batch* const metadata_buffer_;
+ HPackTable* const table_;
+ uint8_t* const dynamic_table_updates_allowed_;
+ uint32_t* const frame_length_;
+ const uint32_t metadata_size_limit_;
+ const LogInfo log_info_;
+};
- p->strlen = (*cur) & 0x7f;
- p->huff = (*cur) >> 7;
- if (p->strlen == 0x7f) {
- p->parsing.value = &p->strlen;
- return parse_value0(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+Slice HPackParser::String::Take() {
+ if (auto* p = absl::get_if<Slice>(&value_)) {
+ return p->Copy();
+ } else if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) {
+ return Slice::FromCopiedBuffer(*p);
+ } else if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) {
+ return Slice::FromCopiedBuffer(*p);
}
+ GPR_UNREACHABLE_CODE(return Slice());
}
-/* append some bytes to a string */
-static void append_bytes(grpc_chttp2_hpack_parser_string* str,
- const uint8_t* data, size_t length) {
- if (length == 0) return;
- if (length + str->data.copied.length > str->data.copied.capacity) {
- GPR_ASSERT(str->data.copied.length + length <= UINT32_MAX);
- str->data.copied.capacity =
- static_cast<uint32_t>(str->data.copied.length + length);
- str->data.copied.str = static_cast<char*>(
- gpr_realloc(str->data.copied.str, str->data.copied.capacity));
- }
- memcpy(str->data.copied.str + str->data.copied.length, data, length);
- GPR_ASSERT(length <= UINT32_MAX - str->data.copied.length);
- str->data.copied.length += static_cast<uint32_t>(length);
-}
+/* PUBLIC INTERFACE */
-static grpc_error_handle append_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- grpc_chttp2_hpack_parser_string* str = p->parsing.str;
- uint32_t bits;
- uint8_t decoded[3];
- switch (static_cast<binary_state>(p->binary)) {
- case NOT_BINARY:
- append_bytes(str, cur, static_cast<size_t>(end - cur));
- return GRPC_ERROR_NONE;
- case BINARY_BEGIN:
- if (cur == end) {
- p->binary = BINARY_BEGIN;
- return GRPC_ERROR_NONE;
- }
- if (*cur == 0) {
- /* 'true-binary' case */
- ++cur;
- p->binary = NOT_BINARY;
- GRPC_STATS_INC_HPACK_RECV_BINARY();
- append_bytes(str, cur, static_cast<size_t>(end - cur));
- return GRPC_ERROR_NONE;
- }
- GRPC_STATS_INC_HPACK_RECV_BINARY_BASE64();
- /* fallthrough */
- b64_byte0:
- case B64_BYTE0:
- if (cur == end) {
- p->binary = B64_BYTE0;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte0;
- }
- p->base64_buffer = bits << 18;
- /* fallthrough */
- b64_byte1:
- case B64_BYTE1:
- if (cur == end) {
- p->binary = B64_BYTE1;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte1;
- }
- p->base64_buffer |= bits << 12;
- /* fallthrough */
- b64_byte2:
- case B64_BYTE2:
- if (cur == end) {
- p->binary = B64_BYTE2;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte2;
- }
- p->base64_buffer |= bits << 6;
- /* fallthrough */
- b64_byte3:
- case B64_BYTE3:
- if (cur == end) {
- p->binary = B64_BYTE3;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte3;
- }
- p->base64_buffer |= bits;
- bits = p->base64_buffer;
- decoded[0] = static_cast<uint8_t>(bits >> 16);
- decoded[1] = static_cast<uint8_t>(bits >> 8);
- decoded[2] = static_cast<uint8_t>(bits);
- append_bytes(str, decoded, 3);
- goto b64_byte0;
+HPackParser::HPackParser() = default;
+
+HPackParser::~HPackParser() = default;
+
+void HPackParser::BeginFrame(grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, Boundary boundary,
+ Priority priority, LogInfo log_info) {
+ metadata_buffer_ = metadata_buffer;
+ boundary_ = boundary;
+ priority_ = priority;
+ dynamic_table_updates_allowed_ = 2;
+ frame_length_ = 0;
+ metadata_size_limit_ = metadata_size_limit;
+ log_info_ = log_info;
+}
+
+grpc_error_handle HPackParser::Parse(const grpc_slice& slice, bool is_last) {
+ if (GPR_UNLIKELY(!unparsed_bytes_.empty())) {
+ std::vector<uint8_t> buffer = std::move(unparsed_bytes_);
+ buffer.insert(buffer.end(), GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_END_PTR(slice));
+ return ParseInput(
+ Input(nullptr, buffer.data(), buffer.data() + buffer.size()), is_last);
}
- GPR_UNREACHABLE_CODE(return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here")));
+ return ParseInput(Input(slice.refcount, GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_END_PTR(slice)),
+ is_last);
}
-static grpc_error_handle finish_str(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- uint8_t decoded[2];
- uint32_t bits;
- grpc_chttp2_hpack_parser_string* str = p->parsing.str;
- switch (static_cast<binary_state>(p->binary)) {
- case NOT_BINARY:
- break;
- case BINARY_BEGIN:
- break;
- case B64_BYTE0:
- break;
- case B64_BYTE1:
- return parse_error(p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "illegal base64 encoding")); /* illegal encoding */
- case B64_BYTE2:
- bits = p->base64_buffer;
- if (bits & 0xffff) {
- grpc_error_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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);
- append_bytes(str, decoded, 1);
- break;
- case B64_BYTE3:
- bits = p->base64_buffer;
- if (bits & 0xff) {
- grpc_error_handle err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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);
- decoded[1] = static_cast<uint8_t>(bits >> 8);
- append_bytes(str, decoded, 2);
- break;
+grpc_error_handle HPackParser::ParseInput(Input input, bool is_last) {
+ if (ParseInputInner(&input)) {
+ return GRPC_ERROR_NONE;
}
- return GRPC_ERROR_NONE;
-}
-
-/* decode a nibble from a huffman encoded stream */
-static grpc_error_handle huff_nibble(grpc_chttp2_hpack_parser* p,
- uint8_t nibble) {
- int16_t emit = emit_sub_tbl[16 * emit_tbl[p->huff_state] + nibble];
- int16_t next = next_sub_tbl[16 * next_tbl[p->huff_state] + nibble];
- if (emit != -1) {
- if (emit >= 0 && emit < 256) {
- uint8_t c = static_cast<uint8_t>(emit);
- grpc_error_handle err = append_string(p, &c, (&c) + 1);
- if (err != GRPC_ERROR_NONE) return err;
- } else {
- assert(emit == 256);
+ if (input.eof_error()) {
+ if (GPR_UNLIKELY(is_last && is_boundary())) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Incomplete header at the end of a header/continuation sequence");
}
- }
- p->huff_state = next;
- return GRPC_ERROR_NONE;
-}
-
-/* decode full bytes from a huffman encoded stream */
-static grpc_error_handle add_huff_bytes(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- for (; cur != end; ++cur) {
- grpc_error_handle err = huff_nibble(p, *cur >> 4);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- err = huff_nibble(p, *cur & 0xf);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- }
- return GRPC_ERROR_NONE;
-}
-
-/* decode some string bytes based on the current decoding mode
- (huffman or not) */
-static grpc_error_handle add_str_bytes(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (p->huff) {
- return add_huff_bytes(p, cur, end);
- } else {
- return append_string(p, cur, end);
- }
-}
-
-/* parse a string - tries to do large chunks at a time */
-static grpc_error_handle parse_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- size_t remaining = p->strlen - p->strgot;
- size_t given = static_cast<size_t>(end - cur);
- if (remaining <= given) {
- grpc_error_handle err = add_str_bytes(p, cur, cur + remaining);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- err = finish_str(p, cur + remaining, end);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_next(p, cur + remaining, end);
- } else {
- grpc_error_handle err = add_str_bytes(p, cur, cur + given);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- GPR_ASSERT(given <= UINT32_MAX - p->strgot);
- p->strgot += static_cast<uint32_t>(given);
- p->state = parse_string;
+ unparsed_bytes_ = std::vector<uint8_t>(input.frontier(), input.end_ptr());
return GRPC_ERROR_NONE;
}
+ return input.TakeError();
}
-/* begin parsing a string - performs setup, calls parse_string */
-static grpc_error_handle begin_parse_string(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end,
- uint8_t binary, grpc_chttp2_hpack_parser_string* str) {
- if (!p->huff && binary == NOT_BINARY &&
- static_cast<uint32_t>(end - cur) >= p->strlen &&
- p->current_slice_refcount != nullptr) {
- GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
- str->copied = false;
- str->data.referenced.refcount = p->current_slice_refcount;
- str->data.referenced.data.refcounted.bytes = const_cast<uint8_t*>(cur);
- str->data.referenced.data.refcounted.length = p->strlen;
- grpc_slice_ref_internal(str->data.referenced);
- return parse_next(p, cur + p->strlen, end);
- }
- p->strgot = 0;
- str->copied = true;
- str->data.copied.length = 0;
- p->parsing.str = str;
- p->huff_state = 0;
- p->binary = binary;
- switch (p->binary) {
- case NOT_BINARY:
- if (p->huff) {
- GRPC_STATS_INC_HPACK_RECV_HUFFMAN();
- } else {
- GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
- }
- break;
- case BINARY_BEGIN:
- /* stats incremented later: don't know true binary or not */
+bool HPackParser::ParseInputInner(Input* input) {
+ switch (priority_) {
+ case Priority::None:
break;
- default:
- abort();
+ case Priority::Included: {
+ if (input->remaining() < 5) return input->UnexpectedEOF(false);
+ input->Advance(5);
+ input->UpdateFrontier();
+ priority_ = Priority::None;
+ }
}
- return parse_string(p, cur, end);
-}
-
-/* parse the key string */
-static grpc_error_handle parse_key_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- return begin_parse_string(p, cur, end, NOT_BINARY, &p->key);
-}
-
-/* check if a key represents a binary header or not */
-
-static bool is_binary_literal_header(grpc_chttp2_hpack_parser* p) {
- /* We know that either argument here is a reference counter slice.
- * 1. If it is a grpc_core::StaticSlice, the refcount is set to kNoopRefcount.
- * 2. If it's p->key.data.referenced, then p->key.copied was set to false,
- * which occurs in begin_parse_string() - where the refcount is set to
- * p->current_slice_refcount, which is not null. */
- return grpc_is_refcounted_slice_binary_header(
- p->key.copied ? grpc_core::ExternallyManagedSlice(
- p->key.data.copied.str, p->key.data.copied.length)
- : p->key.data.referenced);
-}
-
-/* Cache the metadata for the given index during initial parsing. This avoids a
- pointless recomputation of the metadata when finishing a header. We read the
- cached value in get_precomputed_md_for_idx(). */
-static void set_precomputed_md_idx(grpc_chttp2_hpack_parser* p,
- grpc_mdelem md) {
- GPR_DEBUG_ASSERT(p->md_for_index.payload == 0);
- GPR_DEBUG_ASSERT(p->precomputed_md_index == -1);
- p->md_for_index = md;
-#ifndef NDEBUG
- p->precomputed_md_index = p->index;
-#endif
-}
-
-/* Determines if a metadata element key associated with the current parser index
- is a binary indexed header during string parsing. We'll need to revisit this
- metadata when we're done parsing, so we cache the metadata for this index
- here using set_precomputed_md_idx(). */
-static grpc_error_handle is_binary_indexed_header(grpc_chttp2_hpack_parser* p,
- bool* is) {
- grpc_mdelem elem = grpc_chttp2_hptbl_lookup(&p->table, p->index);
- if (GPR_UNLIKELY(GRPC_MDISNULL(elem))) {
- return on_invalid_hpack_idx(p);
+ while (!input->end_of_stream()) {
+ if (GPR_UNLIKELY(!Parser(input, metadata_buffer_, metadata_size_limit_,
+ &table_, &dynamic_table_updates_allowed_,
+ &frame_length_, log_info_)
+ .Parse())) {
+ return false;
+ }
+ input->UpdateFrontier();
}
- /* We know that GRPC_MDKEY(elem) points to a reference counted slice since:
- * 1. elem was a result of grpc_chttp2_hptbl_lookup
- * 2. An item in this table is either static (see entries with
- * index < GRPC_CHTTP2_LAST_STATIC_ENTRY or added via
- * grpc_chttp2_hptbl_add).
- * 3. If added via grpc_chttp2_hptbl_add, the entry is either static or
- * interned.
- * 4. Both static and interned element slices have non-null refcounts. */
- *is = grpc_is_refcounted_slice_binary_header(GRPC_MDKEY(elem));
- set_precomputed_md_idx(p, elem);
- return GRPC_ERROR_NONE;
+ return true;
}
-/* parse the value string */
-static grpc_error_handle parse_value_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end,
- bool is_binary) {
- return begin_parse_string(p, cur, end, is_binary ? BINARY_BEGIN : NOT_BINARY,
- &p->value);
-}
+void HPackParser::FinishFrame() { metadata_buffer_ = nullptr; }
-static grpc_error_handle parse_value_string_with_indexed_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) {
- bool is_binary = false;
- grpc_error_handle err = is_binary_indexed_header(p, &is_binary);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_value_string(p, cur, end, is_binary);
-}
+} // namespace grpc_core
-static grpc_error_handle parse_value_string_with_literal_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) {
- return parse_value_string(p, cur, end, is_binary_literal_header(p));
-}
-
-/* "Uninitialized" header parser to save us a branch in on_hdr(). */
-static grpc_error_handle on_header_uninitialized(void* /*user_data*/,
- grpc_mdelem md) {
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("on_header callback not set");
-}
-
-/* PUBLIC INTERFACE */
-
-void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser* p) {
- p->on_header = on_header_uninitialized;
- p->on_header_user_data = nullptr;
- p->state = parse_begin;
- p->key.data.referenced = grpc_empty_slice();
- p->key.data.copied.str = nullptr;
- p->key.data.copied.capacity = 0;
- p->key.data.copied.length = 0;
- p->value.data.referenced = grpc_empty_slice();
- p->value.data.copied.str = nullptr;
- p->value.data.copied.capacity = 0;
- p->value.data.copied.length = 0;
- /* Cached metadata for the current index the parser is handling. This is set
- to 0 initially, invalidated when the index changes, and invalidated when it
- is read (by get_precomputed_md_for_idx()). It is set during string parsing,
- by set_precomputed_md_idx() - which is called by parse_value_string().
- The goal here is to avoid recomputing the metadata for the index when
- finishing with a header as well as the initial parse. */
- p->md_for_index.payload = 0;
-#ifndef NDEBUG
- /* In debug mode, this ensures that the cached metadata we're reading is in
- * fact correct for the index we are examining. */
- p->precomputed_md_index = -1;
-#endif
- p->dynamic_table_update_allowed = 2;
- p->last_error = GRPC_ERROR_NONE;
-}
-
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p) {
- p->after_prioritization = p->state;
- p->state = parse_stream_dep0;
-}
-
-void grpc_chttp2_hpack_parser_destroy(grpc_chttp2_hpack_parser* p) {
- grpc_chttp2_hptbl_destroy(&p->table);
- GRPC_ERROR_UNREF(p->last_error);
- grpc_slice_unref_internal(p->key.data.referenced);
- grpc_slice_unref_internal(p->value.data.referenced);
- gpr_free(p->key.data.copied.str);
- gpr_free(p->value.data.copied.str);
-}
-
-grpc_error_handle grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser* p,
- const grpc_slice& slice) {
-/* max number of bytes to parse at a time... limits call stack depth on
- * compilers without TCO */
-#define MAX_PARSE_LENGTH 1024
- p->current_slice_refcount = slice.refcount;
- const uint8_t* start = GRPC_SLICE_START_PTR(slice);
- const uint8_t* end = GRPC_SLICE_END_PTR(slice);
- grpc_error_handle error = GRPC_ERROR_NONE;
- while (start != end && error == GRPC_ERROR_NONE) {
- const uint8_t* target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
- error = p->state(p, start, target);
- start = target;
- }
- p->current_slice_refcount = nullptr;
- return error;
-}
+// TODO(ctiller): this serves as an eviction notice for the remainder of this
+// file... it belongs elsewhere!
typedef void (*maybe_complete_func_type)(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
@@ -1710,63 +1331,35 @@ static void force_client_rst_stream(void* sp, grpc_error_handle /*error*/) {
GRPC_CHTTP2_STREAM_UNREF(s, "final_rst");
}
-static void parse_stream_compression_md(grpc_chttp2_transport* /*t*/,
- grpc_chttp2_stream* s,
- grpc_metadata_batch* initial_metadata) {
- if (initial_metadata->idx.named.content_encoding == nullptr ||
- grpc_stream_compression_method_parse(
- GRPC_MDVALUE(initial_metadata->idx.named.content_encoding->md), false,
- &s->stream_decompression_method) == 0) {
- s->stream_decompression_method =
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS;
- }
-
- if (s->stream_decompression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
- s->stream_decompression_ctx = nullptr;
- grpc_slice_buffer_init(&s->decompressed_data_buffer);
- }
-}
-
grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
grpc_chttp2_transport* t,
grpc_chttp2_stream* s,
const grpc_slice& slice,
int is_last) {
GPR_TIMER_SCOPE("grpc_chttp2_header_parser_parse", 0);
- grpc_chttp2_hpack_parser* parser =
- static_cast<grpc_chttp2_hpack_parser*>(hpack_parser);
+ auto* parser = static_cast<grpc_core::HPackParser*>(hpack_parser);
if (s != nullptr) {
s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice);
}
- grpc_error_handle error = grpc_chttp2_hpack_parser_parse(parser, slice);
+ grpc_error_handle error = parser->Parse(slice, is_last != 0);
if (error != GRPC_ERROR_NONE) {
return error;
}
if (is_last) {
- if (parser->is_boundary && parser->state != parse_begin) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "end of header frame not aligned with a hpack record boundary");
- }
/* need to check for null stream: this can occur if we receive an invalid
stream id on a header */
if (s != nullptr) {
- if (parser->is_boundary) {
- if (s->header_frames_received == GPR_ARRAY_SIZE(s->metadata_buffer)) {
+ if (parser->is_boundary()) {
+ if (s->header_frames_received == 2) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Too many trailer frames");
}
- /* Process stream compression md element if it exists */
- if (s->header_frames_received ==
- 0) { /* Only acts on initial metadata */
- parse_stream_compression_md(t, s, &s->metadata_buffer[0].batch);
- }
s->published_metadata[s->header_frames_received] =
GRPC_METADATA_PUBLISHED_FROM_WIRE;
maybe_complete_funcs[s->header_frames_received](t, s);
s->header_frames_received++;
}
- if (parser->is_eof) {
+ if (parser->is_eof()) {
if (t->is_client && !s->write_closed) {
/* server eof ==> complete closure; we may need to forcefully close
the stream. Wait until the combiner lock is ready to be released
@@ -1780,11 +1373,7 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
grpc_chttp2_mark_stream_closed(t, s, true, false, GRPC_ERROR_NONE);
}
}
- parser->on_header = on_header_uninitialized;
- parser->on_header_user_data = nullptr;
- parser->is_boundary = 0xde;
- parser->is_eof = 0xde;
- parser->dynamic_table_update_allowed = 2;
+ parser->FinishFrame();
}
return GRPC_ERROR_NONE;
}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 71aa194a..2e520210 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -24,87 +24,105 @@
#include <stddef.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
-#include "src/core/lib/transport/metadata.h"
-
-typedef struct grpc_chttp2_hpack_parser grpc_chttp2_hpack_parser;
-
-typedef grpc_error_handle (*grpc_chttp2_hpack_parser_state)(
- grpc_chttp2_hpack_parser* p, const uint8_t* beg, const uint8_t* end);
-
-struct grpc_chttp2_hpack_parser_string {
- bool copied;
- struct {
- grpc_slice referenced;
- struct {
- char* str;
- uint32_t length;
- uint32_t capacity;
- } copied;
- } data;
-};
-struct grpc_chttp2_hpack_parser {
- /* user specified callback for each header output */
- grpc_error_handle (*on_header)(void* user_data, grpc_mdelem md);
- void* on_header_user_data;
-
- grpc_error_handle last_error;
-
- /* current parse state - or a function that implements it */
- grpc_chttp2_hpack_parser_state state;
- /* future states dependent on the opening op code */
- const grpc_chttp2_hpack_parser_state* next_state;
- /* what to do after skipping prioritization data */
- grpc_chttp2_hpack_parser_state after_prioritization;
- /* the refcount of the slice that we're currently parsing */
- grpc_slice_refcount* current_slice_refcount;
- /* the value we're currently parsing */
- union {
- uint32_t* value;
- grpc_chttp2_hpack_parser_string* str;
- } parsing;
- /* string parameters for each chunk */
- grpc_chttp2_hpack_parser_string key;
- grpc_chttp2_hpack_parser_string value;
- /* parsed index */
- uint32_t index;
- /* When we parse a value string, we determine the metadata element for a
- specific index, which we need again when we're finishing up with that
- header. To avoid calculating the metadata element for that index a second
- time at that stage, we cache (and invalidate) the element here. */
- grpc_mdelem md_for_index;
-#ifndef NDEBUG
- int64_t precomputed_md_index;
-#endif
- /* length of source bytes for the currently parsing string */
- uint32_t strlen;
- /* number of source bytes read for the currently parsing string */
- uint32_t strgot;
- /* huffman decoding state */
- int16_t huff_state;
- /* is the string being decoded binary? */
- uint8_t binary;
- /* is the current string huffman encoded? */
- uint8_t huff;
- /* is a dynamic table update allowed? */
- uint8_t dynamic_table_update_allowed;
- /* set by higher layers, used by grpc_chttp2_header_parser_parse to signal
- it should append a metadata boundary at the end of frame */
- uint8_t is_boundary;
- uint8_t is_eof;
- uint32_t base64_buffer;
-
- /* hpack table */
- grpc_chttp2_hptbl table;
-};
+#include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// Top level interface for parsing a sequence of header, continuation frames.
+class HPackParser {
+ public:
+ // What kind of stream boundary is provided by this frame?
+ enum class Boundary : uint8_t {
+ // More continuations are expected
+ None,
+ // This marks the end of headers, so data frames should follow
+ EndOfHeaders,
+ // This marks the end of headers *and* the end of the stream
+ EndOfStream
+ };
+ // What kind of priority is represented in the next frame
+ enum class Priority : uint8_t {
+ // No priority field
+ None,
+ // Yes there's a priority field
+ Included
+ };
+ // Details about a frame we only need to know for logging
+ struct LogInfo {
+ // The stream ID
+ uint32_t stream_id;
+ // Headers or trailers?
+ enum Type : uint8_t {
+ kHeaders,
+ kTrailers,
+ kDontKnow,
+ };
+ Type type;
+ // Client or server?
+ bool is_client;
+ };
+
+ HPackParser();
+ ~HPackParser();
+
+ // Non-copyable/movable
+ HPackParser(const HPackParser&) = delete;
+ HPackParser& operator=(const HPackParser&) = delete;
-void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser* p);
-void grpc_chttp2_hpack_parser_destroy(grpc_chttp2_hpack_parser* p);
+ // Begin parsing a new frame
+ // Sink receives each parsed header,
+ void BeginFrame(grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, Boundary boundary,
+ Priority priority, LogInfo log_info);
+ // Start throwing away any received headers after parsing them.
+ void StopBufferingFrame() { metadata_buffer_ = nullptr; }
+ // Parse one slice worth of data
+ grpc_error_handle Parse(const grpc_slice& slice, bool is_last);
+ // Reset state ready for the next BeginFrame
+ void FinishFrame();
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p);
+ // Retrieve the associated hpack table (for tests, debugging)
+ HPackTable* hpack_table() { return &table_; }
+ // Is the current frame a boundary of some sort
+ bool is_boundary() const { return boundary_ != Boundary::None; }
+ // Is the current frame the end of a stream
+ bool is_eof() const { return boundary_ == Boundary::EndOfStream; }
+
+ private:
+ // Helper classes: see implementation
+ class Parser;
+ class Input;
+ class String;
+
+ grpc_error_handle ParseInput(Input input, bool is_last);
+ bool ParseInputInner(Input* input);
+
+ // Target metadata buffer
+ grpc_metadata_batch* metadata_buffer_ = nullptr;
+
+ // Bytes that could not be parsed last parsing round
+ std::vector<uint8_t> unparsed_bytes_;
+ // Buffer kind of boundary
+ // TODO(ctiller): see if we can move this argument to Parse, and avoid
+ // buffering.
+ Boundary boundary_;
+ // Buffer priority
+ // TODO(ctiller): see if we can move this argument to Parse, and avoid
+ // buffering.
+ Priority priority_;
+ uint8_t dynamic_table_updates_allowed_;
+ // Length of frame so far.
+ uint32_t frame_length_;
+ uint32_t metadata_size_limit_;
+ // Information for logging
+ LogInfo log_info_;
+
+ // hpack table
+ HPackTable table_;
+};
-grpc_error_handle grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser* p,
- const grpc_slice& slice);
+} // namespace grpc_core
/* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for
the transport */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
new file mode 100644
index 00000000..17dd0a4d
--- /dev/null
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
@@ -0,0 +1,239 @@
+/*
+ *
+ * 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/transport/chttp2/transport/hpack_parser_table.h"
+
+#include <assert.h>
+#include <string.h>
+
+#include "absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/murmur_hash.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/validate_metadata.h"
+
+extern grpc_core::TraceFlag grpc_http_trace;
+
+namespace grpc_core {
+
+HPackTable::HPackTable() : static_metadata_(GetStaticMementos()) {}
+
+HPackTable::~HPackTable() = default;
+
+/* Evict one element from the table */
+void HPackTable::EvictOne() {
+ auto first_entry = std::move(entries_[first_entry_]);
+ GPR_ASSERT(first_entry.transport_size() <= mem_used_);
+ mem_used_ -= first_entry.transport_size();
+ first_entry_ = ((first_entry_ + 1) % entries_.size());
+ num_entries_--;
+}
+
+void HPackTable::Rebuild(uint32_t new_cap) {
+ EntriesVec entries;
+ entries.resize(new_cap);
+ for (size_t i = 0; i < num_entries_; i++) {
+ entries[i] = std::move(entries_[(first_entry_ + i) % entries_.size()]);
+ }
+ first_entry_ = 0;
+ entries_.swap(entries);
+}
+
+void HPackTable::SetMaxBytes(uint32_t max_bytes) {
+ if (max_bytes_ == max_bytes) {
+ return;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
+ }
+ while (mem_used_ > max_bytes) {
+ EvictOne();
+ }
+ max_bytes_ = max_bytes;
+}
+
+grpc_error_handle HPackTable::SetCurrentTableSize(uint32_t bytes) {
+ if (current_table_bytes_ == bytes) {
+ return GRPC_ERROR_NONE;
+ }
+ if (bytes > max_bytes_) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Attempt to make hpack table %d bytes when max is %d bytes", bytes,
+ max_bytes_));
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
+ }
+ while (mem_used_ > bytes) {
+ EvictOne();
+ }
+ current_table_bytes_ = bytes;
+ max_entries_ = hpack_constants::EntriesForBytes(bytes);
+ if (max_entries_ > entries_.size()) {
+ Rebuild(max_entries_);
+ } else if (max_entries_ < entries_.size() / 3) {
+ // TODO(ctiller): move to resource quota system, only shrink under memory
+ // pressure
+ uint32_t new_cap =
+ std::max(max_entries_, static_cast<uint32_t>(kInlineEntries));
+ if (new_cap != entries_.size()) {
+ Rebuild(new_cap);
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle HPackTable::Add(Memento md) {
+ if (current_table_bytes_ > max_bytes_) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "HPACK max table size reduced to %d but not reflected by hpack "
+ "stream (still at %d)",
+ max_bytes_, current_table_bytes_));
+ }
+
+ // we can't add elements bigger than the max table size
+ if (md.transport_size() > current_table_bytes_) {
+ // HPACK draft 10 section 4.4 states:
+ // If the size of the new entry is less than or equal to the maximum
+ // size, that entry is added to the table. It is not an error to
+ // attempt to add an entry that is larger than the maximum size; an
+ // attempt to add an entry larger than the entire table causes
+ // the table to be emptied of all existing entries, and results in an
+ // empty table.
+ while (num_entries_) {
+ EvictOne();
+ }
+ return GRPC_ERROR_NONE;
+ }
+
+ // evict entries to ensure no overflow
+ while (md.transport_size() >
+ static_cast<size_t>(current_table_bytes_) - mem_used_) {
+ EvictOne();
+ }
+
+ // copy the finalized entry in
+ mem_used_ += md.transport_size();
+ entries_[(first_entry_ + num_entries_) % entries_.size()] = std::move(md);
+
+ // update accounting values
+ num_entries_++;
+ return GRPC_ERROR_NONE;
+}
+
+namespace {
+struct StaticTableEntry {
+ const char* key;
+ const char* value;
+};
+
+const StaticTableEntry kStaticTable[hpack_constants::kLastStaticEntry] = {
+ {":authority", ""},
+ {":method", "GET"},
+ {":method", "POST"},
+ {":path", "/"},
+ {":path", "/index.html"},
+ {":scheme", "http"},
+ {":scheme", "https"},
+ {":status", "200"},
+ {":status", "204"},
+ {":status", "206"},
+ {":status", "304"},
+ {":status", "400"},
+ {":status", "404"},
+ {":status", "500"},
+ {"accept-charset", ""},
+ {"accept-encoding", "gzip, deflate"},
+ {"accept-language", ""},
+ {"accept-ranges", ""},
+ {"accept", ""},
+ {"access-control-allow-origin", ""},
+ {"age", ""},
+ {"allow", ""},
+ {"authorization", ""},
+ {"cache-control", ""},
+ {"content-disposition", ""},
+ {"content-encoding", ""},
+ {"content-language", ""},
+ {"content-length", ""},
+ {"content-location", ""},
+ {"content-range", ""},
+ {"content-type", ""},
+ {"cookie", ""},
+ {"date", ""},
+ {"etag", ""},
+ {"expect", ""},
+ {"expires", ""},
+ {"from", ""},
+ {"host", ""},
+ {"if-match", ""},
+ {"if-modified-since", ""},
+ {"if-none-match", ""},
+ {"if-range", ""},
+ {"if-unmodified-since", ""},
+ {"last-modified", ""},
+ {"link", ""},
+ {"location", ""},
+ {"max-forwards", ""},
+ {"proxy-authenticate", ""},
+ {"proxy-authorization", ""},
+ {"range", ""},
+ {"referer", ""},
+ {"refresh", ""},
+ {"retry-after", ""},
+ {"server", ""},
+ {"set-cookie", ""},
+ {"strict-transport-security", ""},
+ {"transfer-encoding", ""},
+ {"user-agent", ""},
+ {"vary", ""},
+ {"via", ""},
+ {"www-authenticate", ""},
+};
+
+GPR_ATTRIBUTE_NOINLINE HPackTable::Memento MakeMemento(size_t i) {
+ auto sm = kStaticTable[i];
+ return grpc_metadata_batch::Parse(
+ sm.key, Slice::FromStaticString(sm.value),
+ strlen(sm.key) + strlen(sm.value) + hpack_constants::kEntryOverhead,
+ [](absl::string_view, const Slice&) {
+ abort(); // not expecting to see this
+ });
+}
+
+} // namespace
+
+const HPackTable::StaticMementos& HPackTable::GetStaticMementos() {
+ static const StaticMementos* const static_mementos = new StaticMementos();
+ return *static_mementos;
+}
+
+HPackTable::StaticMementos::StaticMementos() {
+ for (uint32_t i = 0; i < hpack_constants::kLastStaticEntry; i++) {
+ memento[i] = MakeMemento(i);
+ }
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h
new file mode 100644
index 00000000..5309ecad
--- /dev/null
+++ b/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h
@@ -0,0 +1,115 @@
+/*
+ *
+ * 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_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/slice.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// HPACK header table
+class HPackTable {
+ public:
+ HPackTable();
+ ~HPackTable();
+
+ HPackTable(const HPackTable&) = delete;
+ HPackTable& operator=(const HPackTable&) = delete;
+
+ void SetMaxBytes(uint32_t max_bytes);
+ grpc_error_handle SetCurrentTableSize(uint32_t bytes);
+
+ using Memento = ParsedMetadata<grpc_metadata_batch>;
+
+ // Lookup, but don't ref.
+ const Memento* Lookup(uint32_t index) const {
+ // Static table comes first, just return an entry from it.
+ // NB: This imposes the constraint that the first
+ // GRPC_CHTTP2_LAST_STATIC_ENTRY entries in the core static metadata table
+ // must follow the hpack standard. If that changes, we *must* not rely on
+ // reading the core static metadata table here; at that point we'd need our
+ // own singleton static metadata in the correct order.
+ if (index <= hpack_constants::kLastStaticEntry) {
+ return &static_metadata_.memento[index - 1];
+ } else {
+ return LookupDynamic(index);
+ }
+ }
+
+ // add a table entry to the index
+ grpc_error_handle Add(Memento md) GRPC_MUST_USE_RESULT;
+
+ // Current entry count in the table.
+ uint32_t num_entries() const { return num_entries_; }
+
+ private:
+ struct StaticMementos {
+ StaticMementos();
+ Memento memento[hpack_constants::kLastStaticEntry];
+ };
+ static const StaticMementos& GetStaticMementos() GPR_ATTRIBUTE_NOINLINE;
+
+ enum { kInlineEntries = hpack_constants::kInitialTableEntries };
+ using EntriesVec = absl::InlinedVector<Memento, kInlineEntries>;
+
+ const Memento* LookupDynamic(uint32_t index) const {
+ // Not static - find the value in the list of valid entries
+ const uint32_t tbl_index = index - (hpack_constants::kLastStaticEntry + 1);
+ if (tbl_index < num_entries_) {
+ uint32_t offset =
+ (num_entries_ - 1u - tbl_index + first_entry_) % entries_.size();
+ return &entries_[offset];
+ }
+ // Invalid entry: return error
+ return nullptr;
+ }
+
+ void EvictOne();
+ void Rebuild(uint32_t new_cap);
+
+ // The first used entry in ents.
+ uint32_t first_entry_ = 0;
+ // How many entries are in the table.
+ uint32_t num_entries_ = 0;
+ // The amount of memory used by the table, according to the hpack algorithm
+ uint32_t mem_used_ = 0;
+ // The max memory allowed to be used by the table, according to the hpack
+ // algorithm.
+ uint32_t max_bytes_ = hpack_constants::kInitialTableSize;
+ // The currently agreed size of the table, according to the hpack algorithm.
+ uint32_t current_table_bytes_ = hpack_constants::kInitialTableSize;
+ // Maximum number of entries we could possibly fit in the table, given defined
+ // overheads.
+ uint32_t max_entries_ = hpack_constants::kInitialTableEntries;
+ // HPack table entries
+ EntriesVec entries_{hpack_constants::kInitialTableEntries};
+ // Mementos for static data
+ const StaticMementos& static_metadata_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc b/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
deleted file mode 100644
index 696176b4..00000000
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- *
- * 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/transport/chttp2/transport/hpack_table.h"
-
-#include <assert.h>
-#include <string.h>
-
-#include "absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gpr/murmur_hash.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/validate_metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-extern grpc_core::TraceFlag grpc_http_trace;
-
-void grpc_chttp2_hptbl_destroy(grpc_chttp2_hptbl* tbl) {
- size_t i;
- for (i = 0; i < tbl->num_ents; i++) {
- GRPC_MDELEM_UNREF(tbl->ents[(tbl->first_ent + i) % tbl->cap_entries]);
- }
- gpr_free(tbl->ents);
- tbl->ents = nullptr;
-}
-
-template <bool take_ref>
-static grpc_mdelem lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index) {
- /* Not static - find the value in the list of valid entries */
- tbl_index -= (GRPC_CHTTP2_LAST_STATIC_ENTRY + 1);
- if (tbl_index < tbl->num_ents) {
- uint32_t offset =
- (tbl->num_ents - 1u - tbl_index + tbl->first_ent) % tbl->cap_entries;
- grpc_mdelem md = tbl->ents[offset];
- if (take_ref) {
- GRPC_MDELEM_REF(md);
- }
- return md;
- }
- /* Invalid entry: return error */
- return GRPC_MDNULL;
-}
-
-grpc_mdelem grpc_chttp2_hptbl_lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index) {
- return lookup_dynamic_index<false>(tbl, tbl_index);
-}
-
-grpc_mdelem grpc_chttp2_hptbl_lookup_ref_dynamic_index(
- const grpc_chttp2_hptbl* tbl, uint32_t tbl_index) {
- return lookup_dynamic_index<true>(tbl, tbl_index);
-}
-
-/* Evict one element from the table */
-static void evict1(grpc_chttp2_hptbl* tbl) {
- grpc_mdelem first_ent = tbl->ents[tbl->first_ent];
- size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(first_ent)) +
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(first_ent)) +
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
- GPR_ASSERT(elem_bytes <= tbl->mem_used);
- tbl->mem_used -= static_cast<uint32_t>(elem_bytes);
- tbl->first_ent = ((tbl->first_ent + 1) % tbl->cap_entries);
- tbl->num_ents--;
- GRPC_MDELEM_UNREF(first_ent);
-}
-
-static void rebuild_ents(grpc_chttp2_hptbl* tbl, uint32_t new_cap) {
- grpc_mdelem* ents =
- static_cast<grpc_mdelem*>(gpr_malloc(sizeof(*ents) * new_cap));
- uint32_t i;
-
- for (i = 0; i < tbl->num_ents; i++) {
- ents[i] = tbl->ents[(tbl->first_ent + i) % tbl->cap_entries];
- }
- gpr_free(tbl->ents);
- tbl->ents = ents;
- tbl->cap_entries = new_cap;
- tbl->first_ent = 0;
-}
-
-void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl,
- uint32_t max_bytes) {
- if (tbl->max_bytes == max_bytes) {
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
- }
- while (tbl->mem_used > max_bytes) {
- evict1(tbl);
- }
- tbl->max_bytes = max_bytes;
-}
-
-grpc_error_handle grpc_chttp2_hptbl_set_current_table_size(
- grpc_chttp2_hptbl* tbl, uint32_t bytes) {
- if (tbl->current_table_bytes == bytes) {
- return GRPC_ERROR_NONE;
- }
- if (bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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);
- }
- while (tbl->mem_used > bytes) {
- evict1(tbl);
- }
- tbl->current_table_bytes = bytes;
- tbl->max_entries = grpc_chttp2_hptbl::entries_for_bytes(bytes);
- if (tbl->max_entries > tbl->cap_entries) {
- rebuild_ents(tbl, GPR_MAX(tbl->max_entries, 2 * tbl->cap_entries));
- } else if (tbl->max_entries < tbl->cap_entries / 3) {
- uint32_t new_cap = GPR_MAX(tbl->max_entries, 16u);
- if (new_cap != tbl->cap_entries) {
- rebuild_ents(tbl, new_cap);
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle grpc_chttp2_hptbl_add(grpc_chttp2_hptbl* tbl,
- grpc_mdelem md) {
- /* determine how many bytes of buffer this entry represents */
- size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(md)) +
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(md)) +
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
-
- if (tbl->current_table_bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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 */
- if (elem_bytes > tbl->current_table_bytes) {
- /* HPACK draft 10 section 4.4 states:
- * If the size of the new entry is less than or equal to the maximum
- * size, that entry is added to the table. It is not an error to
- * attempt to add an entry that is larger than the maximum size; an
- * attempt to add an entry larger than the entire table causes
- * the table
- * to be emptied of all existing entries, and results in an
- * empty table.
- */
- while (tbl->num_ents) {
- evict1(tbl);
- }
- return GRPC_ERROR_NONE;
- }
-
- /* evict entries to ensure no overflow */
- while (elem_bytes >
- static_cast<size_t>(tbl->current_table_bytes) - tbl->mem_used) {
- evict1(tbl);
- }
-
- /* copy the finalized entry in */
- tbl->ents[(tbl->first_ent + tbl->num_ents) % tbl->cap_entries] =
- GRPC_MDELEM_REF(md);
-
- /* update accounting values */
- tbl->num_ents++;
- tbl->mem_used += static_cast<uint32_t>(elem_bytes);
- return GRPC_ERROR_NONE;
-}
-
-grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
- const grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
- grpc_chttp2_hptbl_find_result r = {0, 0};
- uint32_t i;
-
- /* See if the string is in the static table */
- for (i = 0; i < GRPC_CHTTP2_LAST_STATIC_ENTRY; i++) {
- grpc_mdelem ent = grpc_static_mdelem_manifested()[i];
- if (!grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDKEY(ent))) continue;
- r.index = i + 1u;
- r.has_value = grpc_slice_eq(GRPC_MDVALUE(md), GRPC_MDVALUE(ent));
- if (r.has_value) return r;
- }
-
- /* Scan the dynamic table */
- for (i = 0; i < tbl->num_ents; i++) {
- uint32_t idx = static_cast<uint32_t>(tbl->num_ents - i +
- GRPC_CHTTP2_LAST_STATIC_ENTRY);
- grpc_mdelem ent = tbl->ents[(tbl->first_ent + i) % tbl->cap_entries];
- if (!grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDKEY(ent))) continue;
- r.index = idx;
- r.has_value = grpc_slice_eq(GRPC_MDVALUE(md), GRPC_MDVALUE(ent));
- if (r.has_value) return r;
- }
-
- return r;
-}
-
-static size_t get_base64_encoded_size(size_t raw_length) {
- static const uint8_t tail_xtra[3] = {0, 2, 3};
- return raw_length / 3 * 4 + tail_xtra[raw_length % 3];
-}
-
-size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
- bool use_true_binary_metadata) {
- const uint8_t* key_buf = GRPC_SLICE_START_PTR(GRPC_MDKEY(elem));
- size_t key_len = GRPC_SLICE_LENGTH(GRPC_MDKEY(elem));
- size_t overhead_and_key = 32 + key_len;
- size_t value_len = GRPC_SLICE_LENGTH(GRPC_MDVALUE(elem));
- if (grpc_key_is_binary_header(key_buf, key_len)) {
- return overhead_and_key + (use_true_binary_metadata
- ? value_len + 1
- : get_base64_encoded_size(value_len));
- } else {
- return overhead_and_key + value_len;
- }
-}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h b/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h
deleted file mode 100644
index 14a77932..00000000
--- a/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * 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_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/slice.h>
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-/* HPACK header table */
-
-/* last index in the static table */
-#define GRPC_CHTTP2_LAST_STATIC_ENTRY 61
-
-/* Initial table size as per the spec */
-#define GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE 4096
-/* Maximum table size that we'll use */
-#define GRPC_CHTTP2_MAX_HPACK_TABLE_SIZE GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE
-/* Per entry overhead bytes as per the spec */
-#define GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD 32
-#if 0
-/* Maximum number of entries we could possibly fit in the table, given defined
- overheads */
-#define GRPC_CHTTP2_MAX_TABLE_COUNT \
- ((GRPC_CHTTP2_MAX_HPACK_TABLE_SIZE + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD - 1) / \
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD)
-#endif
-
-/* hpack decoder table */
-struct grpc_chttp2_hptbl {
- static uint32_t entries_for_bytes(uint32_t bytes) {
- return (bytes + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD - 1) /
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
- }
- static constexpr uint32_t kInitialCapacity =
- (GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD -
- 1) /
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
-
- grpc_chttp2_hptbl() {
- GPR_DEBUG_ASSERT(!ents);
- constexpr uint32_t AllocSize = sizeof(*ents) * kInitialCapacity;
- ents = static_cast<grpc_mdelem*>(gpr_malloc(AllocSize));
- memset(ents, 0, AllocSize);
- }
-
- /* the first used entry in ents */
- uint32_t first_ent = 0;
- /* how many entries are in the table */
- uint32_t num_ents = 0;
- /* the amount of memory used by the table, according to the hpack algorithm */
- uint32_t mem_used = 0;
- /* the max memory allowed to be used by the table, according to the hpack
- algorithm */
- uint32_t max_bytes = GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE;
- /* the currently agreed size of the table, according to the hpack algorithm */
- uint32_t current_table_bytes = GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE;
- /* Maximum number of entries we could possibly fit in the table, given defined
- overheads */
- uint32_t max_entries = kInitialCapacity;
- /* Number of entries allocated in ents */
- uint32_t cap_entries = kInitialCapacity;
- /* a circular buffer of headers - this is stored in the opposite order to
- what hpack specifies, in order to simplify table management a little...
- meaning lookups need to SUBTRACT from the end position */
- grpc_mdelem* ents = nullptr;
-};
-
-void grpc_chttp2_hptbl_destroy(grpc_chttp2_hptbl* tbl);
-void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl,
- uint32_t max_bytes);
-grpc_error_handle grpc_chttp2_hptbl_set_current_table_size(
- grpc_chttp2_hptbl* tbl, uint32_t bytes);
-
-/* lookup a table entry based on its hpack index */
-grpc_mdelem grpc_chttp2_hptbl_lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index);
-grpc_mdelem grpc_chttp2_hptbl_lookup_ref_dynamic_index(
- const grpc_chttp2_hptbl* tbl, uint32_t tbl_index);
-template <bool take_ref = false>
-inline grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl* tbl,
- uint32_t index) {
- /* Static table comes first, just return an entry from it.
- NB: This imposes the constraint that the first
- GRPC_CHTTP2_LAST_STATIC_ENTRY entries in the core static metadata table
- must follow the hpack standard. If that changes, we *must* not rely on
- reading the core static metadata table here; at that point we'd need our
- own singleton static metadata in the correct order. */
- if (index <= GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- return grpc_static_mdelem_manifested()[index - 1];
- } else {
- if (take_ref) {
- return grpc_chttp2_hptbl_lookup_ref_dynamic_index(tbl, index);
- } else {
- return grpc_chttp2_hptbl_lookup_dynamic_index(tbl, index);
- }
- }
-}
-/* add a table entry to the index */
-grpc_error_handle grpc_chttp2_hptbl_add(grpc_chttp2_hptbl* tbl,
- grpc_mdelem md) GRPC_MUST_USE_RESULT;
-
-size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
- bool use_true_binary_metadata);
-
-/* Returns the static hpack table index that corresponds to /a elem. Returns 0
- if /a elem is not statically stored or if it is not in the static hpack
- table */
-inline uintptr_t grpc_chttp2_get_static_hpack_table_index(grpc_mdelem md) {
- uintptr_t index =
- reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table();
- if (index < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- return index + 1; // Hpack static metadata element indices start at 1
- }
- return 0;
-}
-
-/* Find a key/value pair in the table... returns the index in the table of the
- most similar entry, or 0 if the value was not found */
-struct grpc_chttp2_hptbl_find_result {
- uint32_t index;
- int has_value;
-};
-grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
- const grpc_chttp2_hptbl* tbl, grpc_mdelem md);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc b/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
deleted file mode 100644
index 361b7b7e..00000000
--- a/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * 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/transport/chttp2/transport/incoming_metadata.h"
-
-#include <string.h>
-
-#include "src/core/ext/transport/chttp2/transport/internal.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-grpc_error_handle grpc_chttp2_incoming_metadata_buffer_add(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_mdelem elem) {
- buffer->size += GRPC_MDELEM_LENGTH(elem);
- grpc_linked_mdelem* storage;
- if (buffer->count < buffer->kPreallocatedMDElem) {
- storage = &buffer->preallocated_mdelems[buffer->count];
- buffer->count++;
- } else {
- storage = static_cast<grpc_linked_mdelem*>(
- buffer->arena->Alloc(sizeof(grpc_linked_mdelem)));
- }
- storage->md = elem;
- return grpc_metadata_batch_link_tail(&buffer->batch, storage);
-}
-
-grpc_error_handle grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_mdelem elem) {
- for (grpc_linked_mdelem* l = buffer->batch.list.head; l != nullptr;
- l = l->next) {
- if (grpc_slice_eq(GRPC_MDKEY(l->md), GRPC_MDKEY(elem))) {
- GRPC_MDELEM_UNREF(l->md);
- l->md = elem;
- return GRPC_ERROR_NONE;
- }
- }
- return grpc_chttp2_incoming_metadata_buffer_add(buffer, elem);
-}
-
-void grpc_chttp2_incoming_metadata_buffer_set_deadline(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline) {
- buffer->batch.deadline = deadline;
-}
-
-void grpc_chttp2_incoming_metadata_buffer_publish(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_metadata_batch* batch) {
- grpc_metadata_batch_move(&buffer->batch, batch);
-}
diff --git a/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h
deleted file mode 100644
index 68413b06..00000000
--- a/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * 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_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/transport/transport.h"
-
-struct grpc_chttp2_incoming_metadata_buffer {
- explicit grpc_chttp2_incoming_metadata_buffer(grpc_core::Arena* arena)
- : arena(arena) {
- grpc_metadata_batch_init(&batch);
- batch.deadline = GRPC_MILLIS_INF_FUTURE;
- }
- ~grpc_chttp2_incoming_metadata_buffer() {
- grpc_metadata_batch_destroy(&batch);
- }
-
- static constexpr size_t kPreallocatedMDElem = 10;
-
- grpc_core::Arena* arena;
- size_t size = 0; // total size of metadata.
- size_t count = 0; // minimum of count of metadata and kPreallocatedMDElem.
- // These preallocated mdelems are used while count < kPreallocatedMDElem.
- grpc_linked_mdelem preallocated_mdelems[kPreallocatedMDElem];
- grpc_metadata_batch batch;
-};
-
-void grpc_chttp2_incoming_metadata_buffer_publish(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_metadata_batch* batch);
-
-grpc_error_handle grpc_chttp2_incoming_metadata_buffer_add(
- grpc_chttp2_incoming_metadata_buffer* buffer,
- grpc_mdelem elem) GRPC_MUST_USE_RESULT;
-grpc_error_handle grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- grpc_chttp2_incoming_metadata_buffer* buffer,
- grpc_mdelem elem) GRPC_MUST_USE_RESULT;
-void grpc_chttp2_incoming_metadata_buffer_set_deadline(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/internal.h b/grpc/src/core/ext/transport/chttp2/transport/internal.h
index 9c7f5fce..fff63d63 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/internal.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/internal.h
@@ -34,15 +34,15 @@
#include "src/core/ext/transport/chttp2/transport/frame_window_update.h"
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
#include "src/core/ext/transport/chttp2/transport/stream_map.h"
#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/compression/stream_compression.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport_impl.h"
namespace grpc_core {
@@ -98,6 +98,7 @@ typedef enum {
GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL,
GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL,
GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS,
+ GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK,
GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING,
GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE,
GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING,
@@ -118,16 +119,16 @@ struct grpc_chttp2_ping_queue {
struct grpc_chttp2_repeated_ping_policy {
int max_pings_without_data;
int max_ping_strikes;
- grpc_millis min_recv_ping_interval_without_data;
+ grpc_core::Duration min_recv_ping_interval_without_data;
};
struct grpc_chttp2_repeated_ping_state {
- grpc_millis last_ping_sent_time;
+ grpc_core::Timestamp last_ping_sent_time;
int pings_before_data_required;
grpc_timer delayed_ping_timer;
bool is_delayed_ping_timer_set;
};
struct grpc_chttp2_server_ping_recv_state {
- grpc_millis last_ping_recv_time;
+ grpc_core::Timestamp last_ping_recv_time;
int ping_strikes;
};
/* deframer state for the overall http2 stream of bytes */
@@ -196,8 +197,9 @@ typedef enum {
typedef enum {
GRPC_CHTTP2_NO_GOAWAY_SEND,
- GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED,
- GRPC_CHTTP2_GOAWAY_SENT,
+ GRPC_CHTTP2_GRACEFUL_GOAWAY,
+ GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED,
+ GRPC_CHTTP2_FINAL_GOAWAY_SENT,
} grpc_chttp2_sent_goaway_state;
typedef struct grpc_chttp2_write_cb {
@@ -253,12 +255,10 @@ class Chttp2IncomingByteStream : public ByteStream {
static void NextLocked(void* arg, grpc_error_handle error_ignored);
static void OrphanLocked(void* arg, grpc_error_handle error_ignored);
- void MaybeCreateStreamDecompressionCtx();
-
grpc_chttp2_transport* transport_; // Immutable.
grpc_chttp2_stream* stream_; // Immutable.
- grpc_core::RefCount refs_;
+ RefCount refs_;
/* Accessed only by transport thread when stream->pending_byte_stream == false
* Accessed only by application thread when stream->pending_byte_stream ==
@@ -287,8 +287,7 @@ typedef enum {
struct grpc_chttp2_transport {
grpc_chttp2_transport(const grpc_channel_args* channel_args,
- grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user);
+ grpc_endpoint* ep, bool is_client);
~grpc_chttp2_transport();
grpc_transport base; /* must be first */
@@ -296,7 +295,9 @@ struct grpc_chttp2_transport {
grpc_endpoint* ep;
std::string peer_string;
- grpc_resource_user* resource_user;
+ grpc_core::MemoryOwner memory_owner;
+ const grpc_core::MemoryAllocator::Reservation self_reservation;
+ grpc_core::ReclamationSweep active_reclamation;
grpc_core::Combiner* combiner;
@@ -345,7 +346,7 @@ struct grpc_chttp2_transport {
/** data to write now */
grpc_slice_buffer outbuf;
/** hpack encoding */
- grpc_chttp2_hpack_compressor hpack_compressor;
+ grpc_core::HPackCompressor hpack_compressor;
/** is this a client? */
bool is_client;
@@ -394,7 +395,7 @@ struct grpc_chttp2_transport {
grpc_chttp2_server_ping_recv_state ping_recv_state;
/** parser for headers */
- grpc_chttp2_hpack_parser hpack_parser;
+ grpc_core::HPackParser hpack_parser;
/** simple one shot parsers */
union {
grpc_chttp2_window_update_parser window_update;
@@ -478,9 +479,9 @@ struct grpc_chttp2_transport {
/** watchdog to kill the transport when waiting for the keepalive ping */
grpc_timer keepalive_watchdog_timer;
/** time duration in between pings */
- grpc_millis keepalive_time;
+ grpc_core::Duration keepalive_time;
/** grace period for a ping to complete before watchdog kicks in */
- grpc_millis keepalive_timeout;
+ grpc_core::Duration keepalive_timeout;
/** if keepalive pings are allowed when there's no outstanding streams */
bool keepalive_permit_without_calls = false;
/** If start_keepalive_ping_locked has been called */
@@ -555,7 +556,8 @@ struct grpc_chttp2_stream {
grpc_metadata_batch* recv_initial_metadata;
grpc_closure* recv_initial_metadata_ready = nullptr;
bool* trailing_metadata_available = nullptr;
- grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message;
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message = nullptr;
+ bool* call_failed_before_recv_message = nullptr;
grpc_closure* recv_message_ready = nullptr;
grpc_metadata_batch* recv_trailing_metadata;
grpc_closure* recv_trailing_metadata_finished = nullptr;
@@ -588,7 +590,8 @@ struct grpc_chttp2_stream {
grpc_published_metadata_method published_metadata[2] = {};
bool final_metadata_requested = false;
- grpc_chttp2_incoming_metadata_buffer metadata_buffer[2];
+ grpc_metadata_batch initial_metadata_buffer;
+ grpc_metadata_batch trailing_metadata_buffer;
grpc_slice_buffer frame_storage; /* protected by t combiner */
@@ -608,7 +611,7 @@ struct grpc_chttp2_stream {
GRPC_ERROR_NONE; /* protected by t combiner */
bool received_last_frame = false; /* protected by t combiner */
- grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
+ grpc_core::Timestamp deadline = grpc_core::Timestamp::InfFuture();
/** saw some stream level error */
grpc_error_handle forced_close_error = GRPC_ERROR_NONE;
@@ -638,38 +641,10 @@ struct grpc_chttp2_stream {
grpc_chttp2_write_cb* finish_after_write = nullptr;
size_t sending_bytes = 0;
- /* Stream compression method to be used. */
- grpc_stream_compression_method stream_compression_method =
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS;
- /* Stream decompression method to be used. */
- grpc_stream_compression_method stream_decompression_method =
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS;
-
- /** Whether bytes stored in unprocessed_incoming_byte_stream is decompressed
- */
- bool unprocessed_incoming_frames_decompressed = false;
/** Whether the bytes needs to be traced using Fathom */
bool traced = false;
- /** gRPC header bytes that are already decompressed */
- size_t decompressed_header_bytes = 0;
/** Byte counter for number of bytes written */
size_t byte_counter = 0;
-
- /** Amount of uncompressed bytes sent out when compressed_data_buffer is
- * emptied */
- size_t uncompressed_data_size;
- /** Stream compression compress context */
- grpc_stream_compression_context* stream_compression_ctx;
- /** Buffer storing data that is compressed but not sent */
- grpc_slice_buffer compressed_data_buffer;
-
- /** Stream compression decompress context */
- grpc_stream_compression_context* stream_decompression_ctx;
- /** Temporary buffer storing decompressed data.
- * Initialized, used, and destroyed only when stream uses (non-identity)
- * compression.
- */
- grpc_slice_buffer decompressed_data_buffer;
};
/** Transport writing call flow:
@@ -765,7 +740,7 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
- const grpc_slice& goaway_text);
+ absl::string_view goaway_text);
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t);
diff --git a/grpc/src/core/ext/transport/chttp2/transport/parsing.cc b/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
index 68e7c69c..7cac0850 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/transport/chttp2/transport/internal.h"
-
#include <string.h>
#include "absl/strings/str_cat.h"
@@ -28,14 +26,16 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.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"
-#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/transport/http2_errors.h"
-#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/timeout_encoding.h"
+using grpc_core::HPackParser;
+
static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t);
static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
int is_continuation);
@@ -46,8 +46,8 @@ static grpc_error_handle init_window_update_frame_parser(
grpc_chttp2_transport* t);
static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t);
static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t);
-static grpc_error_handle init_skip_frame_parser(grpc_chttp2_transport* t,
- int is_header);
+static grpc_error_handle init_non_header_skip_frame_parser(
+ grpc_chttp2_transport* t);
static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
const grpc_slice& slice,
@@ -89,15 +89,13 @@ grpc_error_handle 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(
- 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_CPP_STRING(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));
}
++cur;
// NOLINTNEXTLINE(bugprone-misplaced-widening-cast)
@@ -107,8 +105,8 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
if (cur == end) {
return GRPC_ERROR_NONE;
}
- /* fallthrough */
dts_fh_0:
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_0:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size = (static_cast<uint32_t>(*cur)) << 16;
@@ -116,7 +114,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_1;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_1:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@@ -124,7 +122,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_2;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_2:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= *cur;
@@ -132,7 +130,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_3;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_3:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_type = *cur;
@@ -140,7 +138,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_4;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_4:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_flags = *cur;
@@ -148,7 +146,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_5;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_5:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id = ((static_cast<uint32_t>(*cur)) & 0x7f) << 24;
@@ -156,7 +154,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_6;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_6:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
@@ -164,7 +162,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_7;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_7:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
@@ -172,7 +170,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_8;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_8:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur));
@@ -196,17 +194,16 @@ grpc_error_handle 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(
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
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());
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]));
}
if (++cur == end) {
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FRAME:
GPR_DEBUG_ASSERT(cur < end);
if (static_cast<uint32_t>(end - cur) == t->incoming_frame_size) {
@@ -246,36 +243,31 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size -= static_cast<uint32_t>(end - cur);
return GRPC_ERROR_NONE;
}
- GPR_UNREACHABLE_CODE(return nullptr);
+ GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
}
- GPR_UNREACHABLE_CODE(return nullptr);
+ GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
}
static grpc_error_handle 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(
- absl::StrCat(
- "Expected SETTINGS frame as the first frame, got frame type ",
- t->incoming_frame_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Expected SETTINGS frame as the first frame, got frame type ",
+ t->incoming_frame_type));
}
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(
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("Expected CONTINUATION frame, got frame type %02x",
- t->incoming_frame_type)
- .c_str());
+ t->incoming_frame_type));
}
if (t->expect_continuation_stream_id != t->incoming_stream_id) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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_CPP_STRING(absl::StrFormat(
+ "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
+ "grpc_chttp2_stream %08x",
+ t->expect_continuation_stream_id, t->incoming_stream_id));
}
return init_header_frame_parser(t, 1);
}
@@ -301,7 +293,7 @@ static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_ERROR, "Unknown frame type %02x", t->incoming_frame_type);
}
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
}
@@ -313,29 +305,54 @@ static grpc_error_handle skip_parser(void* /*parser*/,
return GRPC_ERROR_NONE;
}
-static grpc_error_handle skip_header(void* /*tp*/, grpc_mdelem md) {
- GRPC_MDELEM_UNREF(md);
+static HPackParser::Boundary hpack_boundary_type(grpc_chttp2_transport* t,
+ bool is_eoh) {
+ if (is_eoh) {
+ if (t->header_eof) {
+ return HPackParser::Boundary::EndOfStream;
+ } else {
+ return HPackParser::Boundary::EndOfHeaders;
+ }
+ } else {
+ return HPackParser::Boundary::None;
+ }
+}
+
+static HPackParser::LogInfo hpack_parser_log_info(
+ grpc_chttp2_transport* t, HPackParser::LogInfo::Type type) {
+ return HPackParser::LogInfo{
+ t->incoming_stream_id,
+ type,
+ t->is_client,
+ };
+}
+
+static grpc_error_handle init_header_skip_frame_parser(
+ grpc_chttp2_transport* t, HPackParser::Priority priority_type) {
+ bool is_eoh = t->expect_continuation_stream_id != 0;
+ t->parser = grpc_chttp2_header_parser_parse;
+ t->parser_data = &t->hpack_parser;
+ t->hpack_parser.BeginFrame(
+ nullptr,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
+ hpack_boundary_type(t, is_eoh), priority_type,
+ hpack_parser_log_info(t, HPackParser::LogInfo::kDontKnow));
return GRPC_ERROR_NONE;
}
-static grpc_error_handle init_skip_frame_parser(grpc_chttp2_transport* t,
- int is_header) {
- if (is_header) {
- uint8_t is_eoh = t->expect_continuation_stream_id != 0;
- t->parser = grpc_chttp2_header_parser_parse;
- t->parser_data = &t->hpack_parser;
- t->hpack_parser.on_header = skip_header;
- t->hpack_parser.on_header_user_data = nullptr;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
- } else {
- t->parser = skip_parser;
- }
+static grpc_error_handle init_non_header_skip_frame_parser(
+ grpc_chttp2_transport* t) {
+ t->parser = skip_parser;
return GRPC_ERROR_NONE;
}
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t) {
- init_skip_frame_parser(t, t->parser == grpc_chttp2_header_parser_parse);
+ if (t->parser == grpc_chttp2_header_parser_parse) {
+ t->hpack_parser.StopBufferingFrame();
+ } else {
+ t->parser = skip_parser;
+ }
}
static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) {
@@ -365,12 +382,12 @@ static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) {
goto error_handler;
}
if (s == nullptr) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->received_bytes += t->incoming_frame_size;
s->stats.incoming.framing_bytes += 9;
if (err == GRPC_ERROR_NONE && s->read_closed) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
if (err == GRPC_ERROR_NONE) {
err = grpc_chttp2_data_parser_begin_frame(
@@ -383,7 +400,7 @@ error_handler:
/* t->parser = grpc_chttp2_data_parser_parse;*/
t->parser = grpc_chttp2_data_parser_parse;
t->parser_data = &s->data_parser;
- t->ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
+ t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
return GRPC_ERROR_NONE;
} else if (grpc_error_get_int(err, GRPC_ERROR_INT_STREAM_ID, &unused)) {
/* handle stream errors by closing the stream */
@@ -393,179 +410,15 @@ error_handler:
grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id,
GRPC_HTTP2_PROTOCOL_ERROR,
&s->stats.outgoing);
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
} else {
return err;
}
}
-static void free_timeout(void* p) { gpr_free(p); }
-
-static bool md_key_cmp(grpc_mdelem md, const grpc_slice& reference) {
- GPR_DEBUG_ASSERT(grpc_slice_is_interned(GRPC_MDKEY(md)));
- return GRPC_MDKEY(md).refcount == reference.refcount;
-}
-
-static void GPR_ATTRIBUTE_NOINLINE on_initial_header_log(
- grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_mdelem md) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* value =
- grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "HTTP:%d:HDR:%s: %s: %s", s->id,
- t->is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
-}
-
-static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
-handle_timeout(grpc_chttp2_stream* s, grpc_mdelem md) {
- grpc_millis* cached_timeout =
- static_cast<grpc_millis*>(grpc_mdelem_get_user_data(md, free_timeout));
- grpc_millis timeout;
- if (cached_timeout != nullptr) {
- timeout = *cached_timeout;
- } else {
- if (GPR_UNLIKELY(!grpc_http2_decode_timeout(GRPC_MDVALUE(md), &timeout))) {
- char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
- gpr_free(val);
- timeout = GRPC_MILLIS_INF_FUTURE;
- }
- if (GRPC_MDELEM_IS_INTERNED(md)) {
- /* store the result */
- cached_timeout =
- static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis)));
- *cached_timeout = timeout;
- grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
- }
- }
- if (timeout != GRPC_MILLIS_INF_FUTURE) {
- grpc_chttp2_incoming_metadata_buffer_set_deadline(
- &s->metadata_buffer[0], grpc_core::ExecCtx::Get()->Now() + timeout);
- }
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
-handle_metadata_size_limit_exceeded(grpc_chttp2_transport* t,
- grpc_chttp2_stream* s, grpc_mdelem md,
- 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.",
- new_size, metadata_size_limit);
- grpc_chttp2_cancel_stream(
- t, s,
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "received initial metadata size exceeds limit"),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_RESOURCE_EXHAUSTED));
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
-handle_metadata_add_failure(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_mdelem md, grpc_error_handle error) {
- grpc_chttp2_cancel_stream(t, s, error);
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle on_initial_header(void* tp, grpc_mdelem md) {
- GPR_TIMER_SCOPE("on_initial_header", 0);
-
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- grpc_chttp2_stream* s = t->incoming_stream;
- GPR_DEBUG_ASSERT(s != nullptr);
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- on_initial_header_log(t, s, md);
- }
-
- if (md_key_cmp(md, GRPC_MDSTR_GRPC_TIMEOUT)) {
- return handle_timeout(s, md);
- }
-
- const size_t new_size = s->metadata_buffer[0].size + GRPC_MDELEM_LENGTH(md);
- const size_t metadata_size_limit =
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE];
- if (GPR_UNLIKELY(new_size > metadata_size_limit)) {
- return handle_metadata_size_limit_exceeded(t, s, md, new_size,
- metadata_size_limit);
- } else {
- grpc_error_handle error =
- grpc_chttp2_incoming_metadata_buffer_add(&s->metadata_buffer[0], md);
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- return handle_metadata_add_failure(t, s, md, error);
- }
- }
- // Not timeout-related metadata, and no error occurred.
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle on_trailing_header(void* tp, grpc_mdelem md) {
- GPR_TIMER_SCOPE("on_trailing_header", 0);
-
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- grpc_chttp2_stream* s = t->incoming_stream;
- GPR_DEBUG_ASSERT(s != nullptr);
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* value =
- grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "HTTP:%d:TRL:%s: %s: %s", s->id,
- t->is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
- }
-
- const size_t new_size = s->metadata_buffer[1].size + GRPC_MDELEM_LENGTH(md);
- const size_t metadata_size_limit =
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE];
- 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.",
- new_size, metadata_size_limit);
- grpc_chttp2_cancel_stream(
- t, s,
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "received trailing metadata size exceeds limit"),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_RESOURCE_EXHAUSTED));
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- } else {
- grpc_error_handle error =
- grpc_chttp2_incoming_metadata_buffer_add(&s->metadata_buffer[1], md);
- if (error != GRPC_ERROR_NONE) {
- grpc_chttp2_cancel_stream(t, s, error);
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- }
- }
- return GRPC_ERROR_NONE;
-}
-
static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
int is_continuation) {
- uint8_t is_eoh =
+ const bool is_eoh =
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
grpc_chttp2_stream* s;
@@ -582,7 +435,12 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) != 0;
}
- t->ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
+ const auto priority_type = !is_continuation && (t->incoming_frame_flags &
+ GRPC_CHTTP2_FLAG_HAS_PRIORITY)
+ ? HPackParser::Priority::Included
+ : HPackParser::Priority::None;
+
+ t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
/* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */
s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
@@ -591,7 +449,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR,
"grpc_chttp2_stream disbanded before CONTINUATION received"));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
if (t->is_client) {
if (GPR_LIKELY((t->incoming_stream_id & 1) &&
@@ -601,11 +459,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client"));
}
- grpc_error_handle err = init_skip_frame_parser(t, 1);
- if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY) {
- grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
- }
- return err;
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY(t->last_new_stream_id >= t->incoming_stream_id)) {
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
@@ -613,18 +467,26 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
"last grpc_chttp2_stream "
"id=%d, new grpc_chttp2_stream id=%d",
t->last_new_stream_id, t->incoming_stream_id));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY((t->incoming_stream_id & 1) == 0)) {
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
"ignoring grpc_chttp2_stream with non-client generated index %d",
t->incoming_stream_id));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY(
grpc_chttp2_stream_map_size(&t->stream_map) >=
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS])) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Max stream count exceeded");
+ } else if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SENT) {
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
+ GPR_INFO,
+ "transport:%p SERVER peer:%s Final GOAWAY sent. Ignoring new "
+ "grpc_chttp2_stream request id=%d, last grpc_chttp2_stream id=%d",
+ t, t->peer_string.c_str(), t->incoming_stream_id,
+ t->last_new_stream_id));
+ return init_header_skip_frame_parser(t, priority_type);
}
t->last_new_stream_id = t->incoming_stream_id;
s = t->incoming_stream =
@@ -632,7 +494,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
if (GPR_UNLIKELY(s == nullptr)) {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
if (t->channelz_socket != nullptr) {
t->channelz_socket->RecordStreamStartedFromRemote();
@@ -646,13 +508,15 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR, "skipping already closed grpc_chttp2_stream header"));
t->incoming_stream = nullptr;
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
t->parser = grpc_chttp2_header_parser_parse;
t->parser_data = &t->hpack_parser;
if (t->header_eof) {
s->eos_received = true;
}
+ grpc_metadata_batch* incoming_metadata_buffer = nullptr;
+ HPackParser::LogInfo::Type frame_type = HPackParser::LogInfo::kDontKnow;
switch (s->header_frames_received) {
case 0:
if (t->is_client && t->header_eof) {
@@ -660,27 +524,29 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
if (s->trailing_metadata_available != nullptr) {
*s->trailing_metadata_available = true;
}
- t->hpack_parser.on_header = on_trailing_header;
+ incoming_metadata_buffer = &s->trailing_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kTrailers;
} else {
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing initial_metadata"));
- t->hpack_parser.on_header = on_initial_header;
+ incoming_metadata_buffer = &s->initial_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kHeaders;
}
break;
case 1:
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing trailing_metadata"));
- t->hpack_parser.on_header = on_trailing_header;
+ incoming_metadata_buffer = &s->trailing_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kTrailers;
break;
case 2:
gpr_log(GPR_ERROR, "too many header frames received");
- return init_skip_frame_parser(t, 1);
- }
- t->hpack_parser.on_header_user_data = t;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
- if (!is_continuation &&
- (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY)) {
- grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
+ return init_header_skip_frame_parser(t, priority_type);
}
+ t->hpack_parser.BeginFrame(
+ incoming_metadata_buffer,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
+ hpack_boundary_type(t, is_eoh), priority_type,
+ hpack_parser_log_info(t, frame_type));
return GRPC_ERROR_NONE;
}
@@ -694,7 +560,7 @@ static grpc_error_handle init_window_update_frame_parser(
grpc_chttp2_stream* s = t->incoming_stream =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (s == nullptr) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->stats.incoming.framing_bytes += 9;
}
@@ -719,7 +585,7 @@ static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t) {
grpc_chttp2_stream* s = t->incoming_stream =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (!t->incoming_stream) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->stats.incoming.framing_bytes += 9;
t->parser = grpc_chttp2_rst_stream_parser_parse;
@@ -751,8 +617,7 @@ static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t) {
if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) {
memcpy(t->settings[GRPC_ACKED_SETTINGS], t->settings[GRPC_SENT_SETTINGS],
GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
- grpc_chttp2_hptbl_set_max_bytes(
- &t->hpack_parser.table,
+ t->hpack_parser.hpack_table()->SetMaxBytes(
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
t->sent_local_settings = false;
diff --git a/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc b/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
index db79899d..9c3c3e69 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
-#include <grpc/support/log.h>
-
static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) {
switch (id) {
case GRPC_CHTTP2_LIST_WRITABLE:
diff --git a/grpc/src/core/ext/transport/chttp2/transport/varint.cc b/grpc/src/core/ext/transport/chttp2/transport/varint.cc
index d4b01788..64782354 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/varint.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/varint.cc
@@ -20,7 +20,11 @@
#include "src/core/ext/transport/chttp2/transport/varint.h"
-uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value) {
+#include "absl/base/attributes.h"
+
+namespace grpc_core {
+
+uint32_t VarintLength(uint32_t tail_value) {
if (tail_value < (1 << 7)) {
return 2;
} else if (tail_value < (1 << 14)) {
@@ -34,23 +38,25 @@ uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value) {
}
}
-void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
- uint32_t tail_length) {
+void VarintWriteTail(uint32_t tail_value, uint8_t* target,
+ uint32_t tail_length) {
switch (tail_length) {
case 5:
target[4] = static_cast<uint8_t>((tail_value >> 28) | 0x80);
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 4:
target[3] = static_cast<uint8_t>((tail_value >> 21) | 0x80);
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 3:
target[2] = static_cast<uint8_t>((tail_value >> 14) | 0x80);
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 2:
target[1] = static_cast<uint8_t>((tail_value >> 7) | 0x80);
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 1:
target[0] = static_cast<uint8_t>((tail_value) | 0x80);
}
target[tail_length - 1] &= 0x7f;
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/transport/chttp2/transport/varint.h b/grpc/src/core/ext/transport/chttp2/transport/varint.h
index 5a2b670f..d4ba4875 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/varint.h
+++ b/grpc/src/core/ext/transport/chttp2/transport/varint.h
@@ -23,38 +23,49 @@
/* Helpers for hpack varint encoding */
+namespace grpc_core {
+
+/* maximum value that can be bitpacked with the opcode if the opcode has a
+ prefix of length prefix_bits */
+constexpr uint32_t MaxInVarintPrefix(uint8_t prefix_bits) {
+ return (1 << (8 - prefix_bits)) - 1;
+}
+
/* length of a value that needs varint tail encoding (it's bigger than can be
bitpacked into the opcode byte) - returned value includes the length of the
opcode byte */
-uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value);
+uint32_t VarintLength(uint32_t tail_value);
+void VarintWriteTail(uint32_t tail_value, uint8_t* target,
+ uint32_t tail_length);
-void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
- uint32_t tail_length);
+template <uint8_t kPrefixBits>
+class VarintWriter {
+ public:
+ static constexpr uint32_t kMaxInPrefix = MaxInVarintPrefix(kPrefixBits);
-/* maximum value that can be bitpacked with the opcode if the opcode has a
- prefix
- of length prefix_bits */
-#define GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \
- ((uint32_t)((1 << (8 - (prefix_bits))) - 1))
-
-/* length required to bitpack a value */
-#define GRPC_CHTTP2_VARINT_LENGTH(n, prefix_bits) \
- ((n) < GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \
- ? 1u \
- : grpc_chttp2_hpack_varint_length( \
- (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits)))
-
-#define GRPC_CHTTP2_WRITE_VARINT(n, prefix_bits, prefix_or, target, length) \
- do { \
- uint8_t* tgt = target; \
- if ((length) == 1u) { \
- (tgt)[0] = (uint8_t)((prefix_or) | (n)); \
- } else { \
- (tgt)[0] = \
- (prefix_or) | (uint8_t)GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits); \
- grpc_chttp2_hpack_write_varint_tail( \
- (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits), (tgt) + 1, (length)-1); \
- } \
- } while (0)
+ explicit VarintWriter(uint32_t value)
+ : value_(value),
+ length_(value < kMaxInPrefix ? 1 : VarintLength(value - kMaxInPrefix)) {
+ }
+
+ uint32_t value() const { return value_; }
+ uint32_t length() const { return length_; }
+
+ void Write(uint8_t prefix, uint8_t* target) const {
+ if (length_ == 1) {
+ target[0] = prefix | value_;
+ } else {
+ target[0] = prefix | kMaxInPrefix;
+ VarintWriteTail(value_ - kMaxInPrefix, target + 1, length_ - 1);
+ }
+ }
+
+ private:
+ const uint32_t value_;
+ // length required to bitpack value_
+ const uint32_t length_;
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H */
diff --git a/grpc/src/core/ext/transport/chttp2/transport/writing.cc b/grpc/src/core/ext/transport/chttp2/transport/writing.cc
index e34856ca..7a89986b 100644
--- a/grpc/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/grpc/src/core/ext/transport/chttp2/transport/writing.cc
@@ -18,15 +18,13 @@
#include <grpc/support/port_platform.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"
-
#include <limits.h>
#include <grpc/support/log.h>
-#include "src/core/lib/compression/stream_compression.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"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -62,15 +60,15 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
}
return;
}
- if (t->ping_state.pings_before_data_required == 0 &&
+ if (t->is_client && t->ping_state.pings_before_data_required == 0 &&
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(),
- t->ping_state.pings_before_data_required,
+ gpr_log(GPR_INFO,
+ "CLIENT: Ping delayed [%s]: too many recent pings: %d/%d",
+ t->peer_string.c_str(), t->ping_state.pings_before_data_required,
t->ping_policy.max_pings_without_data);
}
return;
@@ -79,15 +77,26 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
// in a loop while draining the currently-held combiner. Also see
// https://github.com/grpc/grpc/issues/26079.
grpc_core::ExecCtx::Get()->InvalidateNow();
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
-
- grpc_millis next_allowed_ping_interval =
- (t->keepalive_permit_without_calls == 0 &&
- grpc_chttp2_stream_map_size(&t->stream_map) == 0)
- ? 7200 * GPR_MS_PER_SEC
- : (GPR_MS_PER_SEC); /* A second is added to deal with network delays
- and timing imprecision */
- grpc_millis next_allowed_ping =
+ grpc_core::Timestamp now = grpc_core::ExecCtx::Get()->Now();
+
+ grpc_core::Duration next_allowed_ping_interval = grpc_core::Duration::Zero();
+ if (t->is_client) {
+ next_allowed_ping_interval =
+ (t->keepalive_permit_without_calls == 0 &&
+ grpc_chttp2_stream_map_size(&t->stream_map) == 0)
+ ? grpc_core::Duration::Hours(2)
+ : grpc_core::Duration::Seconds(1); /* A second is added to deal with
+ network delays and timing imprecision */
+ } else if (t->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) {
+ // The gRPC keepalive spec doesn't call for any throttling on the server
+ // side, but we are adding some throttling for protection anyway, unless
+ // we are doing a graceful GOAWAY in which case we don't want to wait.
+ next_allowed_ping_interval =
+ t->keepalive_time == grpc_core::Duration::Infinity()
+ ? grpc_core::Duration::Seconds(20)
+ : t->keepalive_time / 2;
+ }
+ grpc_core::Timestamp next_allowed_ping =
t->ping_state.last_ping_sent_time + next_allowed_ping_interval;
if (next_allowed_ping > now) {
@@ -95,12 +104,15 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
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]: 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(),
- static_cast<double>(t->ping_state.last_ping_sent_time),
- static_cast<double>(next_allowed_ping), static_cast<double>(now));
+ gpr_log(
+ GPR_INFO,
+ "%s: Ping delayed [%s]: not enough time elapsed since last "
+ "ping. "
+ " Last ping %" PRId64 ": Next ping %" PRId64 ": Now %" PRId64,
+ t->is_client ? "CLIENT" : "SERVER", t->peer_string.c_str(),
+ t->ping_state.last_ping_sent_time.milliseconds_after_process_epoch(),
+ next_allowed_ping.milliseconds_after_process_epoch(),
+ now.milliseconds_after_process_epoch());
}
if (!t->ping_state.is_delayed_ping_timer_set) {
t->ping_state.is_delayed_ping_timer_set = true;
@@ -113,6 +125,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
}
return;
}
+ t->ping_state.last_ping_sent_time = now;
pq->inflight_id = t->ping_ctr;
t->ping_ctr++;
@@ -123,7 +136,6 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
grpc_slice_buffer_add(&t->outbuf,
grpc_chttp2_ping_create(false, pq->inflight_id));
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)) {
@@ -165,24 +177,19 @@ static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
"%s:%p stream %d moved to stalled list by %s. This is FULLY expected "
"to happen in a healthy program that is not seeing flow control stalls."
" However, if you know that there are unwanted stalls, here is some "
- "helpful data: [fc:pending=%" PRIdPTR ":pending-compressed=%" PRIdPTR
- ":flowed=%" PRId64 ":peer_initwin=%d:t_win=%" PRId64
- ":s_win=%d:s_delta=%" PRId64 "]",
+ "helpful data: [fc:pending=%" 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,
- s->stream_compression_method ==
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
- ? 0
- : s->compressed_data_buffer.length,
- s->flow_controlled_bytes_flowed,
+ s->flow_controlled_buffer.length, s->flow_controlled_bytes_flowed,
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
t->flow_control->remote_window(),
- static_cast<uint32_t> GPR_MAX(
- 0,
+ static_cast<uint32_t>(std::max(
+ int64_t(0),
s->flow_control->remote_window_delta() +
- (int64_t)t->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]),
+ static_cast<int64_t>(
+ t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]))),
s->flow_control->remote_window_delta());
}
}
@@ -192,9 +199,30 @@ static uint32_t target_write_size(grpc_chttp2_transport* /*t*/) {
return 1024 * 1024;
}
+namespace {
+
+class CountDefaultMetadataEncoder {
+ public:
+ size_t count() const { return count_; }
+
+ void Encode(const grpc_core::Slice&, const grpc_core::Slice&) {}
+
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType&) {
+ count_++;
+ }
+
+ private:
+ size_t count_ = 0;
+};
+
+} // namespace
+
// Returns true if initial_metadata contains only default headers.
static bool is_default_initial_metadata(grpc_metadata_batch* initial_metadata) {
- return initial_metadata->list.default_count == initial_metadata->list.count;
+ CountDefaultMetadataEncoder enc;
+ initial_metadata->Encode(&enc);
+ return enc.count() == initial_metadata->count();
}
namespace {
@@ -259,8 +287,7 @@ class WriteContext {
}
void EnactHpackSettings() {
- grpc_chttp2_hpack_compressor_set_max_table_size(
- &t_->hpack_compressor,
+ t_->hpack_compressor.SetMaxTableSize(
t_->settings[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
}
@@ -327,87 +354,36 @@ class DataSendContext {
sending_bytes_before_(s_->sending_bytes) {}
uint32_t stream_remote_window() const {
- return static_cast<uint32_t> GPR_MAX(
- 0, s_->flow_control->remote_window_delta() +
- (int64_t)t_->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
+ return static_cast<uint32_t>(std::max(
+ int64_t(0),
+ s_->flow_control->remote_window_delta() +
+ static_cast<int64_t>(
+ t_->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE])));
}
uint32_t max_outgoing() const {
- return static_cast<uint32_t> GPR_MIN(
+ return static_cast<uint32_t>(std::min(
t_->settings[GRPC_PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- GPR_MIN(stream_remote_window(), t_->flow_control->remote_window()));
+ static_cast<uint32_t>(std::min(int64_t(stream_remote_window()),
+ t_->flow_control->remote_window()))));
}
bool AnyOutgoing() const { return max_outgoing() > 0; }
- void FlushUncompressedBytes() {
- uint32_t send_bytes = static_cast<uint32_t> GPR_MIN(
- max_outgoing(), s_->flow_controlled_buffer.length);
+ void FlushBytes() {
+ uint32_t send_bytes = static_cast<uint32_t>(
+ std::min(size_t(max_outgoing()), s_->flow_controlled_buffer.length));
is_last_frame_ = send_bytes == s_->flow_controlled_buffer.length &&
s_->fetching_send_message == nullptr &&
s_->send_trailing_metadata != nullptr &&
- grpc_metadata_batch_is_empty(s_->send_trailing_metadata);
+ s_->send_trailing_metadata->empty();
grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, send_bytes,
is_last_frame_, &s_->stats.outgoing, &t_->outbuf);
s_->flow_control->SentData(send_bytes);
s_->sending_bytes += send_bytes;
}
- void FlushCompressedBytes() {
- GPR_DEBUG_ASSERT(s_->stream_compression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS);
-
- uint32_t send_bytes = static_cast<uint32_t> GPR_MIN(
- max_outgoing(), s_->compressed_data_buffer.length);
- bool is_last_data_frame =
- (send_bytes == s_->compressed_data_buffer.length &&
- s_->flow_controlled_buffer.length == 0 &&
- s_->fetching_send_message == nullptr);
- if (is_last_data_frame && s_->send_trailing_metadata != nullptr &&
- s_->stream_compression_ctx != nullptr) {
- if (GPR_UNLIKELY(!grpc_stream_compress(
- s_->stream_compression_ctx, &s_->flow_controlled_buffer,
- &s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
- GRPC_STREAM_COMPRESSION_FLUSH_FINISH))) {
- gpr_log(GPR_ERROR, "Stream compression failed.");
- }
- grpc_stream_compression_context_destroy(s_->stream_compression_ctx);
- s_->stream_compression_ctx = nullptr;
- /* After finish, bytes in s->compressed_data_buffer may be
- * more than max_outgoing. Start another round of the current
- * while loop so that send_bytes and is_last_data_frame are
- * recalculated. */
- return;
- }
- is_last_frame_ = is_last_data_frame &&
- s_->send_trailing_metadata != nullptr &&
- grpc_metadata_batch_is_empty(s_->send_trailing_metadata);
- grpc_chttp2_encode_data(s_->id, &s_->compressed_data_buffer, send_bytes,
- is_last_frame_, &s_->stats.outgoing, &t_->outbuf);
- s_->flow_control->SentData(send_bytes);
- if (s_->compressed_data_buffer.length == 0) {
- s_->sending_bytes += s_->uncompressed_data_size;
- }
- }
-
- void CompressMoreBytes() {
- GPR_DEBUG_ASSERT(s_->stream_compression_method !=
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS);
-
- if (s_->stream_compression_ctx == nullptr) {
- s_->stream_compression_ctx =
- grpc_stream_compression_context_create(s_->stream_compression_method);
- }
- s_->uncompressed_data_size = s_->flow_controlled_buffer.length;
- if (GPR_UNLIKELY(!grpc_stream_compress(
- s_->stream_compression_ctx, &s_->flow_controlled_buffer,
- &s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
- GRPC_STREAM_COMPRESSION_FLUSH_SYNC))) {
- gpr_log(GPR_ERROR, "Stream compression failed.");
- }
- }
-
bool is_last_frame() const { return is_last_frame_; }
void CallCallbacks() {
@@ -452,23 +428,24 @@ class StreamWriteContext {
// https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid
if (!t_->is_client && s_->fetching_send_message == nullptr &&
s_->flow_controlled_buffer.length == 0 &&
- compressed_data_buffer_len() == 0 &&
s_->send_trailing_metadata != nullptr &&
is_default_initial_metadata(s_->send_initial_metadata)) {
ConvertInitialMetadataToTrailingMetadata();
} else {
- grpc_encode_header_options hopt = {
- s_->id, // stream_id
- false, // is_eof
- t_->settings[GRPC_PEER_SETTINGS]
+ t_->hpack_compressor.EncodeHeaders(
+ grpc_core::HPackCompressor::EncodeHeaderOptions{
+ s_->id, // stream_id
+ false, // is_eof
+ t_->settings
+ [GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
- 0, // use_true_binary_metadata
- t_->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], // max_frame_size
- &s_->stats.outgoing // stats
- };
- grpc_chttp2_encode_header(&t_->hpack_compressor, nullptr, 0,
- s_->send_initial_metadata, &hopt, &t_->outbuf);
+ 0, // use_true_binary_metadata
+ t_->settings
+ [GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], // max_frame_size
+ &s_->stats.outgoing // stats
+ },
+ *s_->send_initial_metadata, &t_->outbuf);
grpc_chttp2_reset_ping_clock(t_);
write_context_->IncInitialMetadataWrites();
}
@@ -481,13 +458,6 @@ class StreamWriteContext {
"send_initial_metadata_finished");
}
- size_t compressed_data_buffer_len() {
- return s_->stream_compression_method ==
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
- ? 0
- : s_->compressed_data_buffer.length;
- }
-
void FlushWindowUpdates() {
/* send any window updates */
const uint32_t stream_announce = s_->flow_control->MaybeSendUpdate();
@@ -503,8 +473,7 @@ class StreamWriteContext {
void FlushData() {
if (!s_->sent_initial_metadata) return;
- if (s_->flow_controlled_buffer.length == 0 &&
- compressed_data_buffer_len() == 0) {
+ if (s_->flow_controlled_buffer.length == 0) {
return; // early out: nothing to do
}
@@ -521,22 +490,9 @@ class StreamWriteContext {
return; // early out: nothing to do
}
- if (s_->stream_compression_method ==
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
- while (s_->flow_controlled_buffer.length > 0 &&
- data_send_context.max_outgoing() > 0) {
- data_send_context.FlushUncompressedBytes();
- }
- } else {
- while ((s_->flow_controlled_buffer.length > 0 ||
- s_->compressed_data_buffer.length > 0) &&
- data_send_context.max_outgoing() > 0) {
- if (s_->compressed_data_buffer.length > 0) {
- data_send_context.FlushCompressedBytes();
- } else {
- data_send_context.CompressMoreBytes();
- }
- }
+ while (s_->flow_controlled_buffer.length > 0 &&
+ data_send_context.max_outgoing() > 0) {
+ data_send_context.FlushBytes();
}
grpc_chttp2_reset_ping_clock(t_);
if (data_send_context.is_last_frame()) {
@@ -544,8 +500,7 @@ class StreamWriteContext {
}
data_send_context.CallCallbacks();
stream_became_writable_ = true;
- if (s_->flow_controlled_buffer.length > 0 ||
- compressed_data_buffer_len() > 0) {
+ if (s_->flow_controlled_buffer.length > 0) {
GRPC_CHTTP2_STREAM_REF(s_, "chttp2_writing:fork");
grpc_chttp2_list_add_writable_stream(t_, s_);
}
@@ -558,25 +513,31 @@ class StreamWriteContext {
if (s_->send_trailing_metadata == nullptr) return;
if (s_->fetching_send_message != nullptr) return;
if (s_->flow_controlled_buffer.length != 0) return;
- if (compressed_data_buffer_len() != 0) return;
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "sending trailing_metadata"));
- if (grpc_metadata_batch_is_empty(s_->send_trailing_metadata)) {
+ if (s_->send_trailing_metadata->empty()) {
grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, 0, true,
&s_->stats.outgoing, &t_->outbuf);
} else {
- grpc_encode_header_options hopt = {
- s_->id, true,
- t_->settings[GRPC_PEER_SETTINGS]
+ if (send_status_.has_value()) {
+ s_->send_trailing_metadata->Set(grpc_core::HttpStatusMetadata(),
+ *send_status_);
+ }
+ if (send_content_type_.has_value()) {
+ s_->send_trailing_metadata->Set(grpc_core::ContentTypeMetadata(),
+ *send_content_type_);
+ }
+ t_->hpack_compressor.EncodeHeaders(
+ grpc_core::HPackCompressor::EncodeHeaderOptions{
+ s_->id, true,
+ t_->settings
+ [GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
- 0,
-
- t_->settings[GRPC_PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- &s_->stats.outgoing};
- grpc_chttp2_encode_header(&t_->hpack_compressor,
- extra_headers_for_trailing_metadata_,
- num_extra_headers_for_trailing_metadata_,
- s_->send_trailing_metadata, &hopt, &t_->outbuf);
+ 0,
+ t_->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
+ &s_->stats.outgoing},
+ *s_->send_trailing_metadata, &t_->outbuf);
}
write_context_->IncTrailingMetadataWrites();
grpc_chttp2_reset_ping_clock(t_);
@@ -596,16 +557,10 @@ class StreamWriteContext {
gpr_log(GPR_INFO, "not sending initial_metadata (Trailers-Only)"));
// When sending Trailers-Only, we need to move the :status and
// content-type headers to the trailers.
- if (s_->send_initial_metadata->idx.named.status != nullptr) {
- extra_headers_for_trailing_metadata_
- [num_extra_headers_for_trailing_metadata_++] =
- &s_->send_initial_metadata->idx.named.status->md;
- }
- if (s_->send_initial_metadata->idx.named.content_type != nullptr) {
- extra_headers_for_trailing_metadata_
- [num_extra_headers_for_trailing_metadata_++] =
- &s_->send_initial_metadata->idx.named.content_type->md;
- }
+ send_status_ =
+ s_->send_initial_metadata->get(grpc_core::HttpStatusMetadata());
+ send_content_type_ =
+ s_->send_initial_metadata->get(grpc_core::ContentTypeMetadata());
}
void SentLastFrame() {
@@ -630,8 +585,9 @@ class StreamWriteContext {
grpc_chttp2_transport* const t_;
grpc_chttp2_stream* const s_;
bool stream_became_writable_ = false;
- grpc_mdelem* extra_headers_for_trailing_metadata_[2];
- size_t num_extra_headers_for_trailing_metadata_ = 0;
+ absl::optional<uint32_t> send_status_;
+ absl::optional<grpc_core::ContentTypeMetadata::ValueType> send_content_type_ =
+ {};
};
} // namespace
diff --git a/grpc/src/core/ext/transport/cronet/BUILD b/grpc/src/core/ext/transport/cronet/BUILD
index 9c5848b2..4b26895d 100644
--- a/grpc/src/core/ext/transport/cronet/BUILD
+++ b/grpc/src/core/ext/transport/cronet/BUILD
@@ -19,7 +19,7 @@ load(
"grpc_cc_library",
)
-licenses(["notice"]) # Apache v2
+licenses(["notice"])
package(
default_visibility = ["//visibility:public"],
@@ -62,6 +62,6 @@ grpc_cc_library(
":grpc_transport_cronet_client_secure",
"//:grpc_base",
"//:grpc_http_filters",
- "//:grpc_transport_chttp2_client_secure",
+ "//:grpc_transport_chttp2_client_connector",
],
)
diff --git a/grpc/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc b/grpc/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
index c3fc2563..171cee88 100644
--- a/grpc/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
+++ b/grpc/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
@@ -16,7 +16,9 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/cronet/client/secure/cronet_channel_create.h"
#include <stdio.h>
#include <string.h>
@@ -24,8 +26,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/transport/cronet/client/secure/cronet_channel_create.h"
#include "src/core/ext/transport/cronet/transport/cronet_transport.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/transport_impl.h"
@@ -51,6 +53,9 @@ GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
const_cast<char*>(GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER);
disable_client_authority_filter_arg.type = GRPC_ARG_INTEGER;
disable_client_authority_filter_arg.value.integer = 1;
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
args, &disable_client_authority_filter_arg, 1);
@@ -58,8 +63,9 @@ GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
grpc_create_cronet_transport(engine, target, new_args, reserved);
grpc_core::ExecCtx exec_ctx;
- grpc_channel* channel =
- grpc_channel_create(target, new_args, GRPC_CLIENT_DIRECT_CHANNEL, ct);
+ grpc_channel* channel = grpc_channel_create_internal(
+ target, new_args, GRPC_CLIENT_DIRECT_CHANNEL, ct, nullptr);
grpc_channel_args_destroy(new_args);
+ grpc_channel_args_destroy(args);
return channel;
}
diff --git a/grpc/src/core/ext/transport/cronet/transport/cronet_api_phony.cc b/grpc/src/core/ext/transport/cronet/transport/cronet_api_phony.cc
index 3063d06f..0499112b 100644
--- a/grpc/src/core/ext/transport/cronet/transport/cronet_api_phony.cc
+++ b/grpc/src/core/ext/transport/cronet/transport/cronet_api_phony.cc
@@ -23,10 +23,10 @@ library, so we can build it in all environments */
#include <stdbool.h>
-#include <grpc/support/log.h>
-
#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
+#include <grpc/support/log.h>
+
#ifdef GRPC_COMPILE_WITH_CRONET
/* link with the real CRONET library in the build system */
#else
diff --git a/grpc/src/core/ext/transport/cronet/transport/cronet_status.cc b/grpc/src/core/ext/transport/cronet/transport/cronet_status.cc
index 9c047b3a..8b831f2d 100644
--- a/grpc/src/core/ext/transport/cronet/transport/cronet_status.cc
+++ b/grpc/src/core/ext/transport/cronet/transport/cronet_status.cc
@@ -16,7 +16,7 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/cronet/transport/cronet_status.h"
@@ -304,7 +304,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_ENCODING_CONVERSION_FAILED";
case CRONET_NET_ERROR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT:
return "CRONET_NET_ERROR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT";
- return "CRONET_NET_ERROR_INVALID_SPDY_STREAM";
case CRONET_NET_ERROR_NO_SUPPORTED_PROXIES:
return "CRONET_NET_ERROR_NO_SUPPORTED_PROXIES";
case CRONET_NET_ERROR_HTTP2_PROTOCOL_ERROR:
@@ -339,7 +338,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_HTTP2_SERVER_REFUSED_STREAM";
case CRONET_NET_ERROR_HTTP2_PING_FAILED:
return "CRONET_NET_ERROR_HTTP2_PING_FAILED";
- return "CRONET_NET_ERROR_PIPELINE_EVICTION";
case CRONET_NET_ERROR_CONTENT_LENGTH_MISMATCH:
return "CRONET_NET_ERROR_CONTENT_LENGTH_MISMATCH";
case CRONET_NET_ERROR_INCOMPLETE_CHUNKED_ENCODING:
@@ -350,7 +348,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_RESPONSE_HEADERS_TRUNCATED";
case CRONET_NET_ERROR_QUIC_HANDSHAKE_FAILED:
return "CRONET_NET_ERROR_QUIC_HANDSHAKE_FAILED";
- return "CRONET_NET_ERROR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC";
case CRONET_NET_ERROR_HTTP2_INADEQUATE_TRANSPORT_SECURITY:
return "CRONET_NET_ERROR_HTTP2_INADEQUATE_TRANSPORT_SECURITY";
case CRONET_NET_ERROR_HTTP2_FLOW_CONTROL_ERROR:
@@ -367,7 +364,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_PROXY_HTTP_1_1_REQUIRED";
case CRONET_NET_ERROR_PAC_SCRIPT_TERMINATED:
return "CRONET_NET_ERROR_PAC_SCRIPT_TERMINATED";
- return "CRONET_NET_ERROR_TEMPORARY_BACKOFF";
case CRONET_NET_ERROR_INVALID_HTTP_RESPONSE:
return "CRONET_NET_ERROR_INVALID_HTTP_RESPONSE";
case CRONET_NET_ERROR_CONTENT_DECODING_INIT_FAILED:
@@ -522,6 +518,4 @@ grpc_status_code cronet_net_error_to_grpc_error(
default:
return GRPC_STATUS_UNAVAILABLE;
}
-
- return GRPC_STATUS_UNAVAILABLE;
}
diff --git a/grpc/src/core/ext/transport/cronet/transport/cronet_status.h b/grpc/src/core/ext/transport/cronet/transport/cronet_status.h
index ee1262a0..0b4ff3f4 100644
--- a/grpc/src/core/ext/transport/cronet/transport/cronet_status.h
+++ b/grpc/src/core/ext/transport/cronet/transport/cronet_status.h
@@ -19,7 +19,7 @@
#ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H
#define GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include <grpc/status.h>
diff --git a/grpc/src/core/ext/transport/cronet/transport/cronet_transport.cc b/grpc/src/core/ext/transport/cronet/transport/cronet_transport.cc
index 061b2e09..7c6b0196 100644
--- a/grpc/src/core/ext/transport/cronet/transport/cronet_transport.cc
+++ b/grpc/src/core/ext/transport/cronet/transport/cronet_transport.cc
@@ -18,12 +18,15 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/transport/cronet/transport/cronet_transport.h"
+
#include <string.h>
#include <string>
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
+#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
@@ -31,9 +34,7 @@
#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
#include "src/core/ext/transport/cronet/transport/cronet_status.h"
-#include "src/core/ext/transport/cronet/transport/cronet_transport.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
@@ -44,12 +45,9 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/metadata_batch.h"
-#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"
#include "src/core/lib/transport/transport_impl.h"
-#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
-
#define GRPC_HEADER_SIZE_IN_BYTES 5
#define GRPC_FLUSH_READ_SIZE 4096
@@ -138,11 +136,11 @@ struct read_state {
grpc_slice_buffer read_slice_buffer;
/* vars for trailing metadata */
- grpc_chttp2_incoming_metadata_buffer trailing_metadata;
+ grpc_metadata_batch trailing_metadata;
bool trailing_metadata_valid = false;
/* vars for initial metadata */
- grpc_chttp2_incoming_metadata_buffer initial_metadata;
+ grpc_metadata_batch initial_metadata;
};
struct write_state {
@@ -309,13 +307,10 @@ static void read_grpc_header(stream_obj* s) {
static grpc_error_handle make_error_with_desc(int error_code,
int cronet_internal_error_code,
const char* desc) {
- std::string error_message =
- absl::StrFormat("Cronet error code:%d, Cronet error detail:%s",
- cronet_internal_error_code, desc);
- grpc_error_handle error =
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_message.c_str());
- error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS, error_code);
- return error;
+ return grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Cronet error code:%d, Cronet error detail:%s",
+ cronet_internal_error_code, desc)),
+ GRPC_ERROR_INT_GRPC_STATUS, error_code);
}
inline op_and_state::op_and_state(stream_obj* s,
@@ -408,24 +403,26 @@ static void execute_from_storage(stream_obj* s) {
static void convert_cronet_array_to_metadata(
const bidirectional_stream_header_array* header_array,
- grpc_chttp2_incoming_metadata_buffer* mds) {
+ grpc_metadata_batch* mds) {
for (size_t i = 0; i < header_array->count; i++) {
CRONET_LOG(GPR_DEBUG, "header key=%s, value=%s",
header_array->headers[i].key, header_array->headers[i].value);
- grpc_slice key = grpc_slice_intern(
- grpc_slice_from_static_string(header_array->headers[i].key));
grpc_slice value;
- if (grpc_is_refcounted_slice_binary_header(key)) {
+ if (absl::EndsWith(header_array->headers[i].key, "-bin")) {
value = grpc_slice_from_static_string(header_array->headers[i].value);
- value = grpc_slice_intern(grpc_chttp2_base64_decode_with_length(
- value, grpc_chttp2_base64_infer_length_after_decode(value)));
+ value = grpc_chttp2_base64_decode_with_length(
+ value, grpc_chttp2_base64_infer_length_after_decode(value));
} else {
- value = grpc_slice_intern(
- grpc_slice_from_static_string(header_array->headers[i].value));
+ value = grpc_slice_from_static_string(header_array->headers[i].value);
}
- GRPC_LOG_IF_ERROR("convert_cronet_array_to_metadata",
- grpc_chttp2_incoming_metadata_buffer_add(
- mds, grpc_mdelem_from_slices(key, value)));
+ mds->Append(header_array->headers[i].key, grpc_core::Slice(value),
+ [&](absl::string_view error, const grpc_core::Slice& value) {
+ gpr_log(GPR_DEBUG, "Failed to parse metadata: %s",
+ absl::StrCat("key=", header_array->headers[i].key,
+ " error=", error,
+ " value=", value.as_string_view())
+ .c_str());
+ });
}
}
@@ -700,97 +697,98 @@ static void create_grpc_frame(grpc_slice_buffer* write_slice_buffer,
}
}
-/*
- Convert metadata in a format that Cronet can consume
-*/
-static void convert_metadata_to_cronet_headers(
- grpc_metadata_batch* metadata, const char* host, std::string* pp_url,
- bidirectional_stream_header** pp_headers, size_t* p_num_headers,
- const char** method) {
- grpc_linked_mdelem* curr = metadata->list.head;
- /* Walk the linked list and get number of header fields */
- size_t num_headers_available = 0;
- while (curr != nullptr) {
- curr = curr->next;
- num_headers_available++;
+namespace {
+class CronetMetadataEncoder {
+ public:
+ explicit CronetMetadataEncoder(bidirectional_stream_header** pp_headers,
+ size_t* p_count, const char* host,
+ size_t capacity, const char** method,
+ std::string* url)
+ : host_(host),
+ capacity_(capacity),
+ count_(*p_count),
+ headers_(*pp_headers),
+ method_(method),
+ url_(url) {
+ count_ = 0;
+ headers_ = static_cast<bidirectional_stream_header*>(
+ gpr_malloc(sizeof(bidirectional_stream_header) * capacity_));
}
- grpc_millis deadline = metadata->deadline;
- if (deadline != GRPC_MILLIS_INF_FUTURE) {
- num_headers_available++;
+
+ CronetMetadataEncoder(const CronetMetadataEncoder&) = delete;
+ CronetMetadataEncoder& operator=(const CronetMetadataEncoder&) = delete;
+
+ template <class T, class V>
+ void Encode(T, const V& value) {
+ Encode(grpc_core::Slice::FromStaticString(T::key()),
+ grpc_core::Slice(T::Encode(value)));
}
- /* Allocate enough memory. It is freed in the on_stream_ready callback
- */
- bidirectional_stream_header* headers =
- static_cast<bidirectional_stream_header*>(gpr_malloc(
- sizeof(bidirectional_stream_header) * num_headers_available));
- *pp_headers = headers;
-
- /* Walk the linked list again, this time copying the header fields.
- s->num_headers can be less than num_headers_available, as some headers
- are not used for cronet.
- TODO (makdharma): Eliminate need to traverse the LL second time for perf.
- */
- curr = metadata->list.head;
- size_t num_headers = 0;
- while (num_headers < num_headers_available) {
- grpc_mdelem mdelem = curr->md;
- curr = curr->next;
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(mdelem));
+
+ void Encode(grpc_core::HttpSchemeMetadata,
+ grpc_core::HttpSchemeMetadata::ValueType) {
+ /* Cronet populates these fields on its own */
+ }
+ void Encode(grpc_core::HttpAuthorityMetadata,
+ const grpc_core::HttpAuthorityMetadata::ValueType&) {
+ /* Cronet populates these fields on its own */
+ }
+
+ void Encode(grpc_core::HttpMethodMetadata,
+ grpc_core::HttpMethodMetadata::ValueType method) {
+ switch (method) {
+ case grpc_core::HttpMethodMetadata::kPost:
+ *method_ = "POST";
+ break;
+ case grpc_core::HttpMethodMetadata::kInvalid:
+ case grpc_core::HttpMethodMetadata::kGet:
+ abort();
+ }
+ }
+
+ void Encode(grpc_core::HttpPathMetadata,
+ const grpc_core::HttpPathMetadata::ValueType& path) {
+ /* Create URL by appending :path value to the hostname */
+ *url_ = absl::StrCat("https://", host_, path.as_string_view());
+ }
+
+ void Encode(const grpc_core::Slice& key_slice,
+ const grpc_core::Slice& value_slice) {
+ char* key = grpc_slice_to_c_string(key_slice.c_slice());
char* value;
- if (grpc_is_binary_header_internal(GRPC_MDKEY(mdelem))) {
- grpc_slice wire_value = grpc_chttp2_base64_encode(GRPC_MDVALUE(mdelem));
+ if (grpc_is_binary_header_internal(key_slice.c_slice())) {
+ grpc_slice wire_value = grpc_chttp2_base64_encode(value_slice.c_slice());
value = grpc_slice_to_c_string(wire_value);
grpc_slice_unref_internal(wire_value);
} else {
- value = grpc_slice_to_c_string(GRPC_MDVALUE(mdelem));
- }
- if (grpc_slice_eq_static_interned(GRPC_MDKEY(mdelem), GRPC_MDSTR_SCHEME) ||
- grpc_slice_eq_static_interned(GRPC_MDKEY(mdelem),
- GRPC_MDSTR_AUTHORITY)) {
- /* Cronet populates these fields on its own */
- gpr_free(key);
- gpr_free(value);
- continue;
- }
- if (grpc_slice_eq_static_interned(GRPC_MDKEY(mdelem), GRPC_MDSTR_METHOD)) {
- if (grpc_slice_eq_static_interned(GRPC_MDVALUE(mdelem), GRPC_MDSTR_PUT)) {
- *method = "PUT";
- } else {
- /* POST method in default*/
- *method = "POST";
- }
- gpr_free(key);
- gpr_free(value);
- continue;
- }
- if (grpc_slice_eq_static_interned(GRPC_MDKEY(mdelem), GRPC_MDSTR_PATH)) {
- /* Create URL by appending :path value to the hostname */
- *pp_url = absl::StrCat("https://", host, value);
- gpr_free(key);
- gpr_free(value);
- continue;
+ value = grpc_slice_to_c_string(value_slice.c_slice());
}
CRONET_LOG(GPR_DEBUG, "header %s = %s", key, value);
- headers[num_headers].key = key;
- headers[num_headers].value = value;
- num_headers++;
- if (curr == nullptr) {
- break;
- }
- }
- if (deadline != GRPC_MILLIS_INF_FUTURE) {
- char* key = grpc_slice_to_c_string(GRPC_MDSTR_GRPC_TIMEOUT);
- char* value =
- static_cast<char*>(gpr_malloc(GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE));
- grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(),
- value);
- headers[num_headers].key = key;
- headers[num_headers].value = value;
-
- num_headers++;
+ GPR_ASSERT(count_ < capacity_);
+ headers_[count_].key = key;
+ headers_[count_].value = value;
+ ++count_;
}
- *p_num_headers = num_headers;
+ private:
+ const char* host_;
+ size_t capacity_;
+ size_t& count_;
+ bidirectional_stream_header*& headers_;
+ const char** method_;
+ std::string* url_;
+};
+} // namespace
+
+/*
+ Convert metadata in a format that Cronet can consume
+*/
+static void convert_metadata_to_cronet_headers(
+ grpc_metadata_batch* metadata, const char* host, std::string* pp_url,
+ bidirectional_stream_header** pp_headers, size_t* p_num_headers,
+ const char** method) {
+ CronetMetadataEncoder encoder(pp_headers, p_num_headers, host,
+ metadata->count(), method, pp_url);
+ metadata->Encode(&encoder);
}
static void parse_grpc_header(const uint8_t* data, int* length,
@@ -805,15 +803,8 @@ static void parse_grpc_header(const uint8_t* data, int* length,
*length |= (*p++);
}
-static bool header_has_authority(grpc_linked_mdelem* head) {
- while (head != nullptr) {
- if (grpc_slice_eq_static_interned(GRPC_MDKEY(head->md),
- GRPC_MDSTR_AUTHORITY)) {
- return true;
- }
- head = head->next;
- }
- return false;
+static bool header_has_authority(const grpc_metadata_batch* b) {
+ return b->get_pointer(grpc_core::HttpAuthorityMetadata()) != nullptr;
}
/*
@@ -1171,9 +1162,8 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
} else {
- grpc_chttp2_incoming_metadata_buffer_publish(
- &oas->s->state.rs.initial_metadata,
- stream_op->payload->recv_initial_metadata.recv_initial_metadata);
+ *stream_op->payload->recv_initial_metadata.recv_initial_metadata =
+ std::move(oas->s->state.rs.initial_metadata);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
@@ -1327,9 +1317,8 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
error =
make_error_with_desc(grpc_error_code, stream_state->net_error, desc);
} else if (oas->s->state.rs.trailing_metadata_valid) {
- grpc_chttp2_incoming_metadata_buffer_publish(
- &oas->s->state.rs.trailing_metadata,
- stream_op->payload->recv_trailing_metadata.recv_trailing_metadata);
+ *stream_op->payload->recv_trailing_metadata.recv_trailing_metadata =
+ std::move(oas->s->state.rs.trailing_metadata);
stream_state->rs.trailing_metadata_valid = false;
}
grpc_core::ExecCtx::Run(
@@ -1349,7 +1338,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
result = ACTION_TAKEN_NO_CALLBACK;
}
stream_state->state_op_done[OP_CANCEL_ERROR] = true;
- if (!stream_state->cancel_error) {
+ if (stream_state->cancel_error == GRPC_ERROR_NONE) {
stream_state->cancel_error =
GRPC_ERROR_REF(stream_op->payload->cancel_stream.cancel_error);
}
@@ -1441,8 +1430,8 @@ static void perform_stream_op(grpc_transport* /*gt*/, grpc_stream* gs,
grpc_transport_stream_op_batch* op) {
CRONET_LOG(GPR_DEBUG, "perform_stream_op");
if (op->send_initial_metadata &&
- header_has_authority(op->payload->send_initial_metadata
- .send_initial_metadata->list.head)) {
+ header_has_authority(
+ op->payload->send_initial_metadata.send_initial_metadata)) {
/* Cronet does not support :authority header field. We cancel the call when
this field is present in metadata */
if (op->recv_initial_metadata) {
@@ -1489,6 +1478,7 @@ static const grpc_transport_vtable grpc_cronet_vtable = {
sizeof(stream_obj),
"cronet_http",
init_stream,
+ nullptr,
set_pollset_do_nothing,
set_pollset_set_do_nothing,
perform_stream_op,
diff --git a/grpc/src/core/ext/transport/inproc/inproc_plugin.cc b/grpc/src/core/ext/transport/inproc/inproc_plugin.cc
index 8e251fa2..34de19ae 100644
--- a/grpc/src/core/ext/transport/inproc/inproc_plugin.cc
+++ b/grpc/src/core/ext/transport/inproc/inproc_plugin.cc
@@ -22,7 +22,3 @@
#include "src/core/lib/debug/trace.h"
grpc_core::TraceFlag grpc_inproc_trace(false, "inproc");
-
-void grpc_inproc_plugin_init(void) { grpc_inproc_transport_init(); }
-
-void grpc_inproc_plugin_shutdown(void) { grpc_inproc_transport_shutdown(); }
diff --git a/grpc/src/core/ext/transport/inproc/inproc_transport.cc b/grpc/src/core/ext/transport/inproc/inproc_transport.cc
index 0c21db7f..989d4236 100644
--- a/grpc/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/grpc/src/core/ext/transport/inproc/inproc_transport.cc
@@ -18,18 +18,21 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/transport/inproc/inproc_transport.h"
+
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <string.h>
-#include "src/core/ext/transport/inproc/inproc_transport.h"
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/resource_quota/api.h"
#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/surface/channel_stack_type.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
@@ -43,22 +46,15 @@
} while (0)
namespace {
-grpc_slice g_empty_slice;
-grpc_slice g_fake_path_key;
-grpc_slice g_fake_path_value;
-grpc_slice g_fake_auth_key;
-grpc_slice g_fake_auth_value;
-
struct inproc_stream;
bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error);
void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error);
void op_state_machine_locked(inproc_stream* s, grpc_error_handle error);
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
bool is_initial);
-grpc_error_handle fill_in_metadata(inproc_stream* s,
- const grpc_metadata_batch* metadata,
- uint32_t flags, grpc_metadata_batch* out_md,
- uint32_t* outflags, bool* markfilled);
+void fill_in_metadata(inproc_stream* s, const grpc_metadata_batch* metadata,
+ uint32_t flags, grpc_metadata_batch* out_md,
+ uint32_t* outflags, bool* markfilled);
struct shared_mu {
shared_mu() {
@@ -129,11 +125,6 @@ struct inproc_stream {
ref("inproc_init_stream:init");
ref("inproc_init_stream:list");
- grpc_metadata_batch_init(&to_read_initial_md);
- grpc_metadata_batch_init(&to_read_trailing_md);
- grpc_metadata_batch_init(&write_buffer_initial_md);
- grpc_metadata_batch_init(&write_buffer_trailing_md);
-
stream_list_prev = nullptr;
gpr_mu_lock(&t->mu->mu);
stream_list_next = t->stream_list;
@@ -169,18 +160,19 @@ struct inproc_stream {
// Now transfer from the other side's write_buffer if any to the to_read
// buffer
if (cs->write_buffer_initial_md_filled) {
- fill_in_metadata(this, &cs->write_buffer_initial_md,
- cs->write_buffer_initial_md_flags, &to_read_initial_md,
- &to_read_initial_md_flags, &to_read_initial_md_filled);
- deadline = GPR_MIN(deadline, cs->write_buffer_deadline);
- grpc_metadata_batch_clear(&cs->write_buffer_initial_md);
+ (void)fill_in_metadata(this, &cs->write_buffer_initial_md,
+ cs->write_buffer_initial_md_flags,
+ &to_read_initial_md, &to_read_initial_md_flags,
+ &to_read_initial_md_filled);
+ deadline = std::min(deadline, cs->write_buffer_deadline);
+ cs->write_buffer_initial_md.Clear();
cs->write_buffer_initial_md_filled = false;
}
if (cs->write_buffer_trailing_md_filled) {
- fill_in_metadata(this, &cs->write_buffer_trailing_md, 0,
- &to_read_trailing_md, nullptr,
- &to_read_trailing_md_filled);
- grpc_metadata_batch_clear(&cs->write_buffer_trailing_md);
+ (void)fill_in_metadata(this, &cs->write_buffer_trailing_md, 0,
+ &to_read_trailing_md, nullptr,
+ &to_read_trailing_md_filled);
+ cs->write_buffer_trailing_md.Clear();
cs->write_buffer_trailing_md_filled = false;
}
if (cs->write_buffer_cancel_error != GRPC_ERROR_NONE) {
@@ -225,28 +217,29 @@ struct inproc_stream {
#undef STREAM_UNREF
inproc_transport* t;
- grpc_metadata_batch to_read_initial_md;
+ grpc_stream_refcount* refs;
+ grpc_core::Arena* arena;
+
+ grpc_metadata_batch to_read_initial_md{arena};
uint32_t to_read_initial_md_flags = 0;
bool to_read_initial_md_filled = false;
- grpc_metadata_batch to_read_trailing_md;
+ grpc_metadata_batch to_read_trailing_md{arena};
bool to_read_trailing_md_filled = false;
bool ops_needed = false;
// Write buffer used only during gap at init time when client-side
// stream is set up but server side stream is not yet set up
- grpc_metadata_batch write_buffer_initial_md;
+ grpc_metadata_batch write_buffer_initial_md{arena};
bool write_buffer_initial_md_filled = false;
uint32_t write_buffer_initial_md_flags = 0;
- grpc_millis write_buffer_deadline = GRPC_MILLIS_INF_FUTURE;
- grpc_metadata_batch write_buffer_trailing_md;
+ grpc_core::Timestamp write_buffer_deadline =
+ grpc_core::Timestamp::InfFuture();
+ grpc_metadata_batch write_buffer_trailing_md{arena};
bool write_buffer_trailing_md_filled = false;
grpc_error_handle write_buffer_cancel_error = GRPC_ERROR_NONE;
struct inproc_stream* other_side;
bool other_side_closed = false; // won't talk anymore
bool write_buffer_other_side_closed = false; // on hold
- grpc_stream_refcount* refs;
-
- grpc_core::Arena* arena;
grpc_transport_stream_op_batch* send_message_op = nullptr;
grpc_transport_stream_op_batch* send_trailing_md_op = nullptr;
@@ -273,7 +266,7 @@ struct inproc_stream {
grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
grpc_error_handle cancel_other_error = GRPC_ERROR_NONE;
- grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
+ grpc_core::Timestamp deadline = grpc_core::Timestamp::InfFuture();
bool listed = true;
struct inproc_stream* stream_list_prev;
@@ -282,21 +275,43 @@ struct inproc_stream {
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
bool is_initial) {
- for (grpc_linked_mdelem* md = md_batch->list.head; md != nullptr;
- md = md->next) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
- gpr_log(GPR_INFO, "INPROC:%s:%s: %s: %s", is_initial ? "HDR" : "TRL",
- is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
- }
+ std::string prefix = absl::StrCat(
+ "INPROC:", is_initial ? "HDR:" : "TRL:", is_client ? "CLI:" : "SVR:");
+ md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
+ gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
+ });
}
-grpc_error_handle fill_in_metadata(inproc_stream* s,
- const grpc_metadata_batch* metadata,
- uint32_t flags, grpc_metadata_batch* out_md,
- uint32_t* outflags, bool* markfilled) {
+namespace {
+
+class CopySink {
+ public:
+ explicit CopySink(grpc_metadata_batch* dst) : dst_(dst) {}
+
+ void Encode(const grpc_core::Slice& key, const grpc_core::Slice& value) {
+ dst_->Append(key.as_string_view(), value.AsOwned(),
+ [](absl::string_view, const grpc_core::Slice&) {});
+ }
+
+ template <class T, class V>
+ void Encode(T trait, V value) {
+ dst_->Set(trait, value);
+ }
+
+ template <class T>
+ void Encode(T trait, const grpc_core::Slice& value) {
+ dst_->Set(trait, value.AsOwned());
+ }
+
+ private:
+ grpc_metadata_batch* dst_;
+};
+
+} // namespace
+
+void fill_in_metadata(inproc_stream* s, const grpc_metadata_batch* metadata,
+ uint32_t flags, grpc_metadata_batch* out_md,
+ uint32_t* outflags, bool* markfilled) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) {
log_metadata(metadata, s->t->is_client, outflags != nullptr);
}
@@ -307,18 +322,13 @@ grpc_error_handle fill_in_metadata(inproc_stream* s,
if (markfilled != nullptr) {
*markfilled = true;
}
- grpc_error_handle error = GRPC_ERROR_NONE;
- for (grpc_linked_mdelem* elem = metadata->list.head;
- (elem != nullptr) && (error == GRPC_ERROR_NONE); elem = elem->next) {
- grpc_linked_mdelem* nelem =
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*nelem)));
- nelem->md =
- grpc_mdelem_from_slices(grpc_slice_intern(GRPC_MDKEY(elem->md)),
- grpc_slice_intern(GRPC_MDVALUE(elem->md)));
-
- error = grpc_metadata_batch_link_tail(out_md, nelem);
- }
- return error;
+
+ // TODO(ctiller): copy the metadata batch, don't rely on a bespoke copy
+ // function. Can only do this once mdelems are out of the way though, too many
+ // edge cases otherwise.
+ out_md->Clear();
+ CopySink sink(out_md);
+ metadata->Encode(&sink);
}
int init_stream(grpc_transport* gt, grpc_stream* gs,
@@ -333,8 +343,8 @@ int init_stream(grpc_transport* gt, grpc_stream* gs,
void close_stream_locked(inproc_stream* s) {
if (!s->closed) {
// Release the metadata that we would have written out
- grpc_metadata_batch_destroy(&s->write_buffer_initial_md);
- grpc_metadata_batch_destroy(&s->write_buffer_trailing_md);
+ s->write_buffer_initial_md.Clear();
+ s->write_buffer_trailing_md.Clear();
if (s->listed) {
inproc_stream* p = s->stream_list_prev;
@@ -359,8 +369,8 @@ void close_stream_locked(inproc_stream* s) {
void close_other_side_locked(inproc_stream* s, const char* reason) {
if (s->other_side != nullptr) {
// First release the metadata that came from the other side's arena
- grpc_metadata_batch_destroy(&s->to_read_initial_md);
- grpc_metadata_batch_destroy(&s->to_read_trailing_md);
+ s->to_read_initial_md.Clear();
+ s->to_read_trailing_md.Clear();
s->other_side->unref(reason);
s->other_side_closed = true;
@@ -388,7 +398,8 @@ void complete_if_batch_end_locked(inproc_stream* s, grpc_error_handle error,
int is_rtm = static_cast<int>(op == s->recv_trailing_md_op);
if ((is_sm + is_stm + is_rim + is_rm + is_rtm) == 1) {
- INPROC_LOG(GPR_INFO, "%s %p %p %p", msg, s, op, error);
+ INPROC_LOG(GPR_INFO, "%s %p %p %s", msg, s, op,
+ grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
GRPC_ERROR_REF(error));
}
@@ -409,17 +420,14 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
// Send trailing md to the other side indicating cancellation
s->trailing_md_sent = true;
- grpc_metadata_batch fake_md;
- grpc_metadata_batch_init(&fake_md);
-
+ grpc_metadata_batch fake_md(s->arena);
inproc_stream* other = s->other_side;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
- fill_in_metadata(s, &fake_md, 0, dest, nullptr, destfilled);
- grpc_metadata_batch_destroy(&fake_md);
+ (void)fill_in_metadata(s, &fake_md, 0, dest, nullptr, destfilled);
if (other != nullptr) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
@@ -435,26 +443,18 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
if (!s->t->is_client) {
// If this is a server, provide initial metadata with a path and authority
// since it expects that as well as no error yet
- grpc_metadata_batch fake_md;
- grpc_metadata_batch_init(&fake_md);
- grpc_linked_mdelem* path_md =
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*path_md)));
- path_md->md = grpc_mdelem_from_slices(g_fake_path_key, g_fake_path_value);
- GPR_ASSERT(grpc_metadata_batch_link_tail(&fake_md, path_md) ==
- GRPC_ERROR_NONE);
- grpc_linked_mdelem* auth_md =
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*auth_md)));
- auth_md->md = grpc_mdelem_from_slices(g_fake_auth_key, g_fake_auth_value);
- GPR_ASSERT(grpc_metadata_batch_link_tail(&fake_md, auth_md) ==
- GRPC_ERROR_NONE);
+ grpc_metadata_batch fake_md(s->arena);
+ fake_md.Set(grpc_core::HttpPathMetadata(),
+ grpc_core::Slice::FromStaticString("/"));
+ fake_md.Set(grpc_core::HttpAuthorityMetadata(),
+ grpc_core::Slice::FromStaticString("inproc-fail"));
- fill_in_metadata(
+ (void)fill_in_metadata(
s, &fake_md, 0,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata,
s->recv_initial_md_op->payload->recv_initial_metadata.recv_flags,
nullptr);
- grpc_metadata_batch_destroy(&fake_md);
err = GRPC_ERROR_NONE;
} else {
err = GRPC_ERROR_REF(error);
@@ -468,8 +468,9 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
.trailing_metadata_available = true;
}
INPROC_LOG(GPR_INFO,
- "fail_helper %p scheduling initial-metadata-ready %p %p", s,
- error, err);
+ "fail_helper %p scheduling initial-metadata-ready %s %s", s,
+ grpc_error_std_string(error).c_str(),
+ grpc_error_std_string(err).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_initial_md_op->payload->recv_initial_metadata
@@ -483,8 +484,13 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
s->recv_initial_md_op = nullptr;
}
if (s->recv_message_op) {
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %p", s,
- error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %s", s,
+ grpc_error_std_string(error).c_str());
+ if (s->recv_message_op->payload->recv_message
+ .call_failed_before_recv_message != nullptr) {
+ *s->recv_message_op->payload->recv_message
+ .call_failed_before_recv_message = true;
+ }
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_message_op->payload->recv_message.recv_message_ready,
@@ -508,15 +514,15 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
s->send_trailing_md_op = nullptr;
}
if (s->recv_trailing_md_op) {
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %p",
- s, error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
GRPC_ERROR_REF(error));
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %p",
- s, error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %s",
+ s, grpc_error_std_string(error).c_str());
complete_if_batch_end_locked(
s, error, s->recv_trailing_md_op,
"fail_helper scheduling recv-trailing-metadata-on-complete");
@@ -646,10 +652,11 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
goto done;
} else {
if (!other || !other->closed) {
- fill_in_metadata(s,
- s->send_trailing_md_op->payload->send_trailing_metadata
- .send_trailing_metadata,
- 0, dest, nullptr, destfilled);
+ (void)fill_in_metadata(
+ s,
+ s->send_trailing_md_op->payload->send_trailing_metadata
+ .send_trailing_metadata,
+ 0, dest, nullptr, destfilled);
}
s->trailing_md_sent = true;
if (s->send_trailing_md_op->payload->send_trailing_metadata.sent) {
@@ -685,50 +692,42 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
INPROC_LOG(
GPR_INFO,
"op_state_machine %p scheduling on_complete errors for already "
- "recvd initial md %p",
- s, new_err);
+ "recvd initial md %s",
+ s, grpc_error_std_string(new_err).c_str());
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
goto done;
}
if (s->to_read_initial_md_filled) {
s->initial_md_recvd = true;
- new_err = fill_in_metadata(
+ fill_in_metadata(
s, &s->to_read_initial_md, s->to_read_initial_md_flags,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata,
s->recv_initial_md_op->payload->recv_initial_metadata.recv_flags,
nullptr);
- s->recv_initial_md_op->payload->recv_initial_metadata
- .recv_initial_metadata->deadline = s->deadline;
+ if (s->deadline != grpc_core::Timestamp::InfFuture()) {
+ s->recv_initial_md_op->payload->recv_initial_metadata
+ .recv_initial_metadata->Set(grpc_core::GrpcTimeoutMetadata(),
+ s->deadline);
+ }
if (s->recv_initial_md_op->payload->recv_initial_metadata
.trailing_metadata_available != nullptr) {
*s->recv_initial_md_op->payload->recv_initial_metadata
.trailing_metadata_available =
(other != nullptr && other->send_trailing_md_op != nullptr);
}
- grpc_metadata_batch_clear(&s->to_read_initial_md);
+ s->to_read_initial_md.Clear();
s->to_read_initial_md_filled = false;
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling initial-metadata-ready %p", s,
- new_err);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata_ready,
- GRPC_ERROR_REF(new_err));
+ GRPC_ERROR_NONE);
complete_if_batch_end_locked(
- s, new_err, s->recv_initial_md_op,
+ s, GRPC_ERROR_NONE, s->recv_initial_md_op,
"op_state_machine scheduling recv-initial-metadata-on-complete");
s->recv_initial_md_op = nullptr;
-
- if (new_err != GRPC_ERROR_NONE) {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling on_complete errors2 %p", s,
- new_err);
- fail_helper_locked(s, GRPC_ERROR_REF(new_err));
- goto done;
- }
}
}
if (s->recv_message_op) {
@@ -744,7 +743,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
"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.Clear();
s->to_read_trailing_md_filled = false;
s->trailing_md_recvd_implicit_only = false;
} else {
@@ -753,8 +752,8 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
INPROC_LOG(
GPR_INFO,
"op_state_machine %p scheduling on_complete errors for already "
- "recvd trailing md %p",
- s, new_err);
+ "recvd trailing md %s",
+ s, grpc_error_std_string(new_err).c_str());
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
goto done;
}
@@ -786,12 +785,11 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
if (s->recv_trailing_md_op != nullptr) {
// We wanted trailing metadata and we got it
s->trailing_md_recvd = true;
- new_err =
- fill_in_metadata(s, &s->to_read_trailing_md, 0,
- s->recv_trailing_md_op->payload
- ->recv_trailing_metadata.recv_trailing_metadata,
- nullptr, nullptr);
- grpc_metadata_batch_clear(&s->to_read_trailing_md);
+ fill_in_metadata(s, &s->to_read_trailing_md, 0,
+ s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata,
+ nullptr, nullptr);
+ s->to_read_trailing_md.Clear();
s->to_read_trailing_md_filled = false;
// We should schedule the recv_trailing_md_op completion if
@@ -800,24 +798,16 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
// (If the server hasn't already sent its trailing md, it doesn't have
// a final status, so don't mark this op complete)
if (s->t->is_client || s->trailing_md_sent) {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling trailing-md-on-complete %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));
+ GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
s->recv_trailing_md_op->on_complete,
- GRPC_ERROR_REF(new_err));
+ GRPC_ERROR_NONE);
s->recv_trailing_md_op = nullptr;
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) {
INPROC_LOG(
@@ -830,8 +820,8 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
// 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);
+ INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-ready %s",
+ s, grpc_error_std_string(new_err).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
@@ -901,16 +891,14 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error) {
// already have
s->trailing_md_sent = true;
- grpc_metadata_batch cancel_md;
- grpc_metadata_batch_init(&cancel_md);
+ grpc_metadata_batch cancel_md(s->arena);
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
- fill_in_metadata(s, &cancel_md, 0, dest, nullptr, destfilled);
- grpc_metadata_batch_destroy(&cancel_md);
+ (void)fill_in_metadata(s, &cancel_md, 0, dest, nullptr, destfilled);
if (other != nullptr) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
@@ -1015,16 +1003,18 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra initial metadata");
} else {
if (!s->other_side_closed) {
- fill_in_metadata(
+ (void)fill_in_metadata(
s, op->payload->send_initial_metadata.send_initial_metadata,
op->payload->send_initial_metadata.send_initial_metadata_flags,
dest, destflags, destfilled);
}
if (s->t->is_client) {
- grpc_millis* dl =
+ grpc_core::Timestamp* dl =
(other == nullptr) ? &s->write_buffer_deadline : &other->deadline;
- *dl = GPR_MIN(*dl, op->payload->send_initial_metadata
- .send_initial_metadata->deadline);
+ *dl = std::min(
+ *dl, op->payload->send_initial_metadata.send_initial_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(grpc_core::Timestamp::InfFuture()));
s->initial_md_sent = true;
}
}
@@ -1091,8 +1081,8 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
}
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling initial-metadata-ready %p",
- s, error);
+ "perform_stream_op error %p scheduling initial-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_initial_metadata.recv_initial_metadata_ready,
@@ -1101,8 +1091,12 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (op->recv_message) {
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling recv message-ready %p", s,
- error);
+ "perform_stream_op error %p scheduling recv message-ready %s", s,
+ grpc_error_std_string(error).c_str());
+ if (op->payload->recv_message.call_failed_before_recv_message !=
+ nullptr) {
+ *op->payload->recv_message.call_failed_before_recv_message = true;
+ }
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
op->payload->recv_message.recv_message_ready,
GRPC_ERROR_REF(error));
@@ -1110,16 +1104,16 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (op->recv_trailing_metadata) {
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling trailing-metadata-ready %p",
- s, error);
+ "perform_stream_op error %p scheduling trailing-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
GRPC_ERROR_REF(error));
}
}
- INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %p", s,
- error);
+ INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %s", s,
+ grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_complete, GRPC_ERROR_REF(error));
}
gpr_mu_unlock(mu);
@@ -1219,9 +1213,11 @@ void set_pollset_set(grpc_transport* /*gt*/, grpc_stream* /*gs*/,
grpc_endpoint* get_endpoint(grpc_transport* /*t*/) { return nullptr; }
const grpc_transport_vtable inproc_vtable = {
- sizeof(inproc_stream), "inproc", init_stream,
- set_pollset, set_pollset_set, perform_stream_op,
- perform_transport_op, destroy_stream, destroy_transport,
+ sizeof(inproc_stream), "inproc",
+ init_stream, nullptr,
+ set_pollset, set_pollset_set,
+ perform_stream_op, perform_transport_op,
+ destroy_stream, destroy_transport,
get_endpoint};
/*******************************************************************************
@@ -1244,63 +1240,45 @@ void inproc_transports_create(grpc_transport** server_transport,
}
} // namespace
-/*******************************************************************************
- * GLOBAL INIT AND DESTROY
- */
-void grpc_inproc_transport_init(void) {
- grpc_core::ExecCtx exec_ctx;
- g_empty_slice = grpc_core::ExternallyManagedSlice();
-
- grpc_slice key_tmp = grpc_slice_from_static_string(":path");
- g_fake_path_key = grpc_slice_intern(key_tmp);
- grpc_slice_unref_internal(key_tmp);
-
- g_fake_path_value = grpc_slice_from_static_string("/");
-
- grpc_slice auth_tmp = grpc_slice_from_static_string(":authority");
- g_fake_auth_key = grpc_slice_intern(auth_tmp);
- grpc_slice_unref_internal(auth_tmp);
-
- g_fake_auth_value = grpc_slice_from_static_string("inproc-fail");
-}
-
grpc_channel* grpc_inproc_channel_create(grpc_server* server,
- grpc_channel_args* args,
+ const grpc_channel_args* args,
void* /*reserved*/) {
GRPC_API_TRACE("grpc_inproc_channel_create(server=%p, args=%p)", 2,
(server, args));
grpc_core::ExecCtx exec_ctx;
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
// Remove max_connection_idle and max_connection_age channel arguments since
// those do not apply to inproc transports.
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,
+ core_server->channel_args(), args_to_remove,
GPR_ARRAY_SIZE(args_to_remove));
-
// Add a default authority channel argument for the client
grpc_arg default_authority_arg;
default_authority_arg.type = GRPC_ARG_STRING;
default_authority_arg.key = const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY);
default_authority_arg.value.string = const_cast<char*>("inproc.authority");
- grpc_channel_args* client_args =
- grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
-
+ args = grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ const grpc_channel_args* client_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel_args_destroy(args);
grpc_transport* server_transport;
grpc_transport* client_transport;
inproc_transports_create(&server_transport, server_args, &client_transport,
client_args);
// TODO(ncteisen): design and support channelz GetSocket for inproc.
- grpc_error_handle error = server->core_server->SetupTransport(
+ grpc_error_handle error = core_server->SetupTransport(
server_transport, nullptr, server_args, nullptr);
grpc_channel* channel = nullptr;
if (error == GRPC_ERROR_NONE) {
- channel =
- grpc_channel_create("inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL,
- client_transport, nullptr, &error);
+ channel = grpc_channel_create_internal("inproc", client_args,
+ GRPC_CLIENT_DIRECT_CHANNEL,
+ client_transport, &error);
if (error != GRPC_ERROR_NONE) {
GPR_ASSERT(!channel);
gpr_log(GPR_ERROR, "Failed to create client channel: %s",
@@ -1311,7 +1289,8 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
status = static_cast<grpc_status_code>(integer);
}
GRPC_ERROR_UNREF(error);
- // client_transport was destroyed when grpc_channel_create saw an error.
+ // client_transport was destroyed when grpc_channel_create_internal saw an
+ // error.
grpc_transport_destroy(server_transport);
channel = grpc_lame_client_channel_create(
nullptr, status, "Failed to create client channel");
@@ -1340,12 +1319,3 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
return channel;
}
-
-void grpc_inproc_transport_shutdown(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_slice_unref_internal(g_empty_slice);
- grpc_slice_unref_internal(g_fake_path_key);
- grpc_slice_unref_internal(g_fake_path_value);
- grpc_slice_unref_internal(g_fake_auth_key);
- grpc_slice_unref_internal(g_fake_auth_value);
-}
diff --git a/grpc/src/core/ext/transport/inproc/inproc_transport.h b/grpc/src/core/ext/transport/inproc/inproc_transport.h
index 049d1402..0ff22ffa 100644
--- a/grpc/src/core/ext/transport/inproc/inproc_transport.h
+++ b/grpc/src/core/ext/transport/inproc/inproc_transport.h
@@ -24,12 +24,9 @@
#include "src/core/lib/transport/transport_impl.h"
grpc_channel* grpc_inproc_channel_create(grpc_server* server,
- grpc_channel_args* args,
+ const grpc_channel_args* args,
void* reserved);
extern grpc_core::TraceFlag grpc_inproc_trace;
-void grpc_inproc_transport_init(void);
-void grpc_inproc_transport_shutdown(void);
-
#endif /* GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c
new file mode 100644
index 00000000..fb910c35
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c
@@ -0,0 +1,117 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/certs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/certs.upb.h"
+#include "google/protobuf/timestamp.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_admin_v3_Certificates_submsgs[1] = {
+ {.submsg = &envoy_admin_v3_Certificate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_Certificates__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_Certificates_msginit = {
+ &envoy_admin_v3_Certificates_submsgs[0],
+ &envoy_admin_v3_Certificates__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_Certificate_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_CertificateDetails_msginit},
+ {.submsg = &envoy_admin_v3_CertificateDetails_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_Certificate__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_Certificate_msginit = {
+ &envoy_admin_v3_Certificate_submsgs[0],
+ &envoy_admin_v3_Certificate__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_submsgs[4] = {
+ {.submsg = &envoy_admin_v3_SubjectAlternateName_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_CertificateDetails_OcspDetails_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 64), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_CertificateDetails_msginit = {
+ &envoy_admin_v3_CertificateDetails_submsgs[0],
+ &envoy_admin_v3_CertificateDetails__fields[0],
+ UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[2] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails_OcspDetails__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msginit = {
+ &envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[0],
+ &envoy_admin_v3_CertificateDetails_OcspDetails__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_SubjectAlternateName__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msginit = {
+ NULL,
+ &envoy_admin_v3_SubjectAlternateName__fields[0],
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[5] = {
+ &envoy_admin_v3_Certificates_msginit,
+ &envoy_admin_v3_Certificate_msginit,
+ &envoy_admin_v3_CertificateDetails_msginit,
+ &envoy_admin_v3_CertificateDetails_OcspDetails_msginit,
+ &envoy_admin_v3_SubjectAlternateName_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_certs_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 5,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h
new file mode 100644
index 00000000..86ba4772
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h
@@ -0,0 +1,482 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/certs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_Certificates;
+struct envoy_admin_v3_Certificate;
+struct envoy_admin_v3_CertificateDetails;
+struct envoy_admin_v3_CertificateDetails_OcspDetails;
+struct envoy_admin_v3_SubjectAlternateName;
+typedef struct envoy_admin_v3_Certificates envoy_admin_v3_Certificates;
+typedef struct envoy_admin_v3_Certificate envoy_admin_v3_Certificate;
+typedef struct envoy_admin_v3_CertificateDetails envoy_admin_v3_CertificateDetails;
+typedef struct envoy_admin_v3_CertificateDetails_OcspDetails envoy_admin_v3_CertificateDetails_OcspDetails;
+typedef struct envoy_admin_v3_SubjectAlternateName envoy_admin_v3_SubjectAlternateName;
+extern const upb_MiniTable envoy_admin_v3_Certificates_msginit;
+extern const upb_MiniTable envoy_admin_v3_Certificate_msginit;
+extern const upb_MiniTable envoy_admin_v3_CertificateDetails_msginit;
+extern const upb_MiniTable envoy_admin_v3_CertificateDetails_OcspDetails_msginit;
+extern const upb_MiniTable envoy_admin_v3_SubjectAlternateName_msginit;
+struct google_protobuf_Timestamp;
+extern const upb_MiniTable google_protobuf_Timestamp_msginit;
+
+
+
+/* envoy.admin.v3.Certificates */
+
+UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_new(upb_Arena* arena) {
+ return (envoy_admin_v3_Certificates*)_upb_Message_New(&envoy_admin_v3_Certificates_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_Certificates* ret = envoy_admin_v3_Certificates_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_Certificates* ret = envoy_admin_v3_Certificates_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificates_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_Certificates_serialize(const envoy_admin_v3_Certificates* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_Certificates_serialize_ex(const envoy_admin_v3_Certificates* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_Certificates_has_certificates(const envoy_admin_v3_Certificates* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_Certificates_clear_certificates(const envoy_admin_v3_Certificates* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_Certificate* const* envoy_admin_v3_Certificates_certificates(const envoy_admin_v3_Certificates* msg, size_t* len) {
+ return (const envoy_admin_v3_Certificate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_mutable_certificates(envoy_admin_v3_Certificates* msg, size_t* len) {
+ return (envoy_admin_v3_Certificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_admin_v3_Certificate** envoy_admin_v3_Certificates_resize_certificates(envoy_admin_v3_Certificates* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_Certificate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_Certificate* envoy_admin_v3_Certificates_add_certificates(envoy_admin_v3_Certificates* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_Certificate* sub = (struct envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.admin.v3.Certificate */
+
+UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_new(upb_Arena* arena) {
+ return (envoy_admin_v3_Certificate*)_upb_Message_New(&envoy_admin_v3_Certificate_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_Certificate* ret = envoy_admin_v3_Certificate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_Certificate* ret = envoy_admin_v3_Certificate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Certificate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_Certificate_serialize(const envoy_admin_v3_Certificate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_Certificate_serialize_ex(const envoy_admin_v3_Certificate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_Certificate_has_ca_cert(const envoy_admin_v3_Certificate* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_Certificate_clear_ca_cert(const envoy_admin_v3_Certificate* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_ca_cert(const envoy_admin_v3_Certificate* msg, size_t* len) {
+ return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_admin_v3_Certificate_has_cert_chain(const envoy_admin_v3_Certificate* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_admin_v3_Certificate_clear_cert_chain(const envoy_admin_v3_Certificate* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_admin_v3_CertificateDetails* const* envoy_admin_v3_Certificate_cert_chain(const envoy_admin_v3_Certificate* msg, size_t* len) {
+ return (const envoy_admin_v3_CertificateDetails* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+
+UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_ca_cert(envoy_admin_v3_Certificate* msg, size_t* len) {
+ return (envoy_admin_v3_CertificateDetails**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_ca_cert(envoy_admin_v3_Certificate* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_CertificateDetails**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_CertificateDetails* envoy_admin_v3_Certificate_add_ca_cert(envoy_admin_v3_Certificate* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_mutable_cert_chain(envoy_admin_v3_Certificate* msg, size_t* len) {
+ return (envoy_admin_v3_CertificateDetails**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails** envoy_admin_v3_Certificate_resize_cert_chain(envoy_admin_v3_Certificate* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_CertificateDetails**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_CertificateDetails* envoy_admin_v3_Certificate_add_cert_chain(envoy_admin_v3_Certificate* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_CertificateDetails* sub = (struct envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.admin.v3.CertificateDetails */
+
+UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_new(upb_Arena* arena) {
+ return (envoy_admin_v3_CertificateDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_CertificateDetails* ret = envoy_admin_v3_CertificateDetails_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_CertificateDetails* ret = envoy_admin_v3_CertificateDetails_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_CertificateDetails_serialize(const envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_CertificateDetails_serialize_ex(const envoy_admin_v3_CertificateDetails* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_path(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CertificateDetails_path(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_serial_number(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CertificateDetails_serial_number(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE const envoy_admin_v3_SubjectAlternateName* const* envoy_admin_v3_CertificateDetails_subject_alt_names(const envoy_admin_v3_CertificateDetails* msg, size_t* len) {
+ return (const envoy_admin_v3_SubjectAlternateName* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_days_until_expiration(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_CertificateDetails_days_until_expiration(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_valid_from(const envoy_admin_v3_CertificateDetails* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_valid_from(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_valid_from(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_expiration_time(const envoy_admin_v3_CertificateDetails* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_expiration_time(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_expiration_time(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_has_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_clear_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_ocsp_details(const envoy_admin_v3_CertificateDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_admin_v3_CertificateDetails_OcspDetails*);
+}
+
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_path(envoy_admin_v3_CertificateDetails *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_serial_number(envoy_admin_v3_CertificateDetails *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
+}
+UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_mutable_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t* len) {
+ return (envoy_admin_v3_SubjectAlternateName**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE envoy_admin_v3_SubjectAlternateName** envoy_admin_v3_CertificateDetails_resize_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_SubjectAlternateName**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_CertificateDetails_add_subject_alt_names(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_SubjectAlternateName* sub = (struct envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_days_until_expiration(envoy_admin_v3_CertificateDetails *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_valid_from(envoy_admin_v3_CertificateDetails *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_mutable_valid_from(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_valid_from(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CertificateDetails_set_valid_from(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_expiration_time(envoy_admin_v3_CertificateDetails *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_mutable_expiration_time(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_expiration_time(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CertificateDetails_set_expiration_time(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_set_ocsp_details(envoy_admin_v3_CertificateDetails *msg, envoy_admin_v3_CertificateDetails_OcspDetails* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_admin_v3_CertificateDetails_OcspDetails*) = value;
+}
+UPB_INLINE struct envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_mutable_ocsp_details(envoy_admin_v3_CertificateDetails* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_CertificateDetails_OcspDetails* sub = (struct envoy_admin_v3_CertificateDetails_OcspDetails*)envoy_admin_v3_CertificateDetails_ocsp_details(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CertificateDetails_set_ocsp_details(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.admin.v3.CertificateDetails.OcspDetails */
+
+UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_OcspDetails_new(upb_Arena* arena) {
+ return (envoy_admin_v3_CertificateDetails_OcspDetails*)_upb_Message_New(&envoy_admin_v3_CertificateDetails_OcspDetails_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_OcspDetails_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_CertificateDetails_OcspDetails* ret = envoy_admin_v3_CertificateDetails_OcspDetails_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_CertificateDetails_OcspDetails_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_CertificateDetails_OcspDetails* ret = envoy_admin_v3_CertificateDetails_OcspDetails_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_CertificateDetails_OcspDetails_serialize(const envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_CertificateDetails_OcspDetails_serialize_ex(const envoy_admin_v3_CertificateDetails_OcspDetails* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_clear_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_expiration(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
+}
+
+UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_set_valid_from(envoy_admin_v3_CertificateDetails_OcspDetails *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_mutable_valid_from(envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_OcspDetails_valid_from(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CertificateDetails_OcspDetails_set_valid_from(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CertificateDetails_OcspDetails_set_expiration(envoy_admin_v3_CertificateDetails_OcspDetails *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_CertificateDetails_OcspDetails_mutable_expiration(envoy_admin_v3_CertificateDetails_OcspDetails* msg, upb_Arena* arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_CertificateDetails_OcspDetails_expiration(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CertificateDetails_OcspDetails_set_expiration(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.admin.v3.SubjectAlternateName */
+
+UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateName_new(upb_Arena* arena) {
+ return (envoy_admin_v3_SubjectAlternateName*)_upb_Message_New(&envoy_admin_v3_SubjectAlternateName_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateName_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_SubjectAlternateName* ret = envoy_admin_v3_SubjectAlternateName_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateName_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_SubjectAlternateName* ret = envoy_admin_v3_SubjectAlternateName_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SubjectAlternateName_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_SubjectAlternateName_serialize(const envoy_admin_v3_SubjectAlternateName* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_SubjectAlternateName_serialize_ex(const envoy_admin_v3_SubjectAlternateName* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_admin_v3_SubjectAlternateName_name_dns = 1,
+ envoy_admin_v3_SubjectAlternateName_name_uri = 2,
+ envoy_admin_v3_SubjectAlternateName_name_ip_address = 3,
+ envoy_admin_v3_SubjectAlternateName_name_NOT_SET = 0
+} envoy_admin_v3_SubjectAlternateName_name_oneofcases;
+UPB_INLINE envoy_admin_v3_SubjectAlternateName_name_oneofcases envoy_admin_v3_SubjectAlternateName_name_case(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return (envoy_admin_v3_SubjectAlternateName_name_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_dns(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_dns(const envoy_admin_v3_SubjectAlternateName* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_dns(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_uri(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_uri(const envoy_admin_v3_SubjectAlternateName* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_uri(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_admin_v3_SubjectAlternateName_has_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_clear_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_admin_v3_SubjectAlternateName_name_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SubjectAlternateName_ip_address(const envoy_admin_v3_SubjectAlternateName* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
+
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_dns(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_uri(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE void envoy_admin_v3_SubjectAlternateName_set_ip_address(envoy_admin_v3_SubjectAlternateName *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_certs_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_CERTS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
new file mode 100644
index 00000000..f56ea857
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c
@@ -0,0 +1,121 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/clusters.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/clusters.upb.h"
+#include "envoy/admin/v3/metrics.upb.h"
+#include "envoy/config/cluster/v3/circuit_breaker.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 "envoy/type/v3/percent.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_admin_v3_Clusters_submsgs[1] = {
+ {.submsg = &envoy_admin_v3_ClusterStatus_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_Clusters__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_Clusters_msginit = {
+ &envoy_admin_v3_Clusters_submsgs[0],
+ &envoy_admin_v3_Clusters__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_ClusterStatus_submsgs[4] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_admin_v3_HostStatus_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_ClusterStatus__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_ClusterStatus_msginit = {
+ &envoy_admin_v3_ClusterStatus_submsgs[0],
+ &envoy_admin_v3_ClusterStatus__fields[0],
+ UPB_SIZE(36, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_HostStatus_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_admin_v3_SimpleMetric_msginit},
+ {.submsg = &envoy_admin_v3_HostHealthStatus_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_HostStatus__fields[9] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_HostStatus_msginit = {
+ &envoy_admin_v3_HostStatus_submsgs[0],
+ &envoy_admin_v3_HostStatus__fields[0],
+ UPB_SIZE(44, 88), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_HostHealthStatus__fields[8] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(10, 10), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(11, 11), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_HostHealthStatus_msginit = {
+ NULL,
+ &envoy_admin_v3_HostHealthStatus__fields[0],
+ UPB_SIZE(13, 24), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &envoy_admin_v3_Clusters_msginit,
+ &envoy_admin_v3_ClusterStatus_msginit,
+ &envoy_admin_v3_HostStatus_msginit,
+ &envoy_admin_v3_HostHealthStatus_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_clusters_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h
new file mode 100644
index 00000000..1069bc5f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h
@@ -0,0 +1,553 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/clusters.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_Clusters;
+struct envoy_admin_v3_ClusterStatus;
+struct envoy_admin_v3_HostStatus;
+struct envoy_admin_v3_HostHealthStatus;
+typedef struct envoy_admin_v3_Clusters envoy_admin_v3_Clusters;
+typedef struct envoy_admin_v3_ClusterStatus envoy_admin_v3_ClusterStatus;
+typedef struct envoy_admin_v3_HostStatus envoy_admin_v3_HostStatus;
+typedef struct envoy_admin_v3_HostHealthStatus envoy_admin_v3_HostHealthStatus;
+extern const upb_MiniTable envoy_admin_v3_Clusters_msginit;
+extern const upb_MiniTable envoy_admin_v3_ClusterStatus_msginit;
+extern const upb_MiniTable envoy_admin_v3_HostStatus_msginit;
+extern const upb_MiniTable envoy_admin_v3_HostHealthStatus_msginit;
+struct envoy_admin_v3_SimpleMetric;
+struct envoy_config_cluster_v3_CircuitBreakers;
+struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_Locality;
+struct envoy_type_v3_Percent;
+extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Locality_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+
+
+
+/* envoy.admin.v3.Clusters */
+
+UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_new(upb_Arena* arena) {
+ return (envoy_admin_v3_Clusters*)_upb_Message_New(&envoy_admin_v3_Clusters_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_Clusters* ret = envoy_admin_v3_Clusters_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_Clusters* ret = envoy_admin_v3_Clusters_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Clusters_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_Clusters_serialize(const envoy_admin_v3_Clusters* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_Clusters_serialize_ex(const envoy_admin_v3_Clusters* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_Clusters_has_cluster_statuses(const envoy_admin_v3_Clusters* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_Clusters_clear_cluster_statuses(const envoy_admin_v3_Clusters* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_ClusterStatus* const* envoy_admin_v3_Clusters_cluster_statuses(const envoy_admin_v3_Clusters* msg, size_t* len) {
+ return (const envoy_admin_v3_ClusterStatus* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_mutable_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t* len) {
+ return (envoy_admin_v3_ClusterStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_admin_v3_ClusterStatus** envoy_admin_v3_Clusters_resize_cluster_statuses(envoy_admin_v3_Clusters* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ClusterStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_ClusterStatus* envoy_admin_v3_Clusters_add_cluster_statuses(envoy_admin_v3_Clusters* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ClusterStatus* sub = (struct envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.admin.v3.ClusterStatus */
+
+UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ClusterStatus*)_upb_Message_New(&envoy_admin_v3_ClusterStatus_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ClusterStatus* ret = envoy_admin_v3_ClusterStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ClusterStatus* ret = envoy_admin_v3_ClusterStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClusterStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_ClusterStatus_serialize(const envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_ClusterStatus_serialize_ex(const envoy_admin_v3_ClusterStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_name(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ClusterStatus_name(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_added_via_api(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_ClusterStatus_added_via_api(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_host_statuses(const envoy_admin_v3_ClusterStatus* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_host_statuses(const envoy_admin_v3_ClusterStatus* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE const envoy_admin_v3_HostStatus* const* envoy_admin_v3_ClusterStatus_host_statuses(const envoy_admin_v3_ClusterStatus* msg, size_t* len) {
+ return (const envoy_admin_v3_HostStatus* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_local_origin_success_rate_ejection_threshold(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE bool envoy_admin_v3_ClusterStatus_has_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_cluster_v3_CircuitBreakers* envoy_admin_v3_ClusterStatus_circuit_breakers(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_cluster_v3_CircuitBreakers*);
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_clear_observability_name(const envoy_admin_v3_ClusterStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ClusterStatus_observability_name(const envoy_admin_v3_ClusterStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView);
+}
+
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_name(envoy_admin_v3_ClusterStatus *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_added_via_api(envoy_admin_v3_ClusterStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus *msg, struct envoy_type_v3_Percent* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_mutable_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_ClusterStatus_success_rate_ejection_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ClusterStatus_set_success_rate_ejection_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_mutable_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t* len) {
+ return (envoy_admin_v3_HostStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE envoy_admin_v3_HostStatus** envoy_admin_v3_ClusterStatus_resize_host_statuses(envoy_admin_v3_ClusterStatus* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_HostStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_HostStatus* envoy_admin_v3_ClusterStatus_add_host_statuses(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_HostStatus* sub = (struct envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_local_origin_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus *msg, struct envoy_type_v3_Percent* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_ClusterStatus_mutable_local_origin_success_rate_ejection_threshold(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_ClusterStatus_local_origin_success_rate_ejection_threshold(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ClusterStatus_set_local_origin_success_rate_ejection_threshold(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_circuit_breakers(envoy_admin_v3_ClusterStatus *msg, struct envoy_config_cluster_v3_CircuitBreakers* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_cluster_v3_CircuitBreakers*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_admin_v3_ClusterStatus_mutable_circuit_breakers(envoy_admin_v3_ClusterStatus* msg, upb_Arena* arena) {
+ struct envoy_config_cluster_v3_CircuitBreakers* sub = (struct envoy_config_cluster_v3_CircuitBreakers*)envoy_admin_v3_ClusterStatus_circuit_breakers(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ClusterStatus_set_circuit_breakers(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ClusterStatus_set_observability_name(envoy_admin_v3_ClusterStatus *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value;
+}
+
+/* envoy.admin.v3.HostStatus */
+
+UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_new(upb_Arena* arena) {
+ return (envoy_admin_v3_HostStatus*)_upb_Message_New(&envoy_admin_v3_HostStatus_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_HostStatus* ret = envoy_admin_v3_HostStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_HostStatus* ret = envoy_admin_v3_HostStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_HostStatus_serialize(const envoy_admin_v3_HostStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_HostStatus_serialize_ex(const envoy_admin_v3_HostStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_address(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_address(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_admin_v3_HostStatus_address(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Address*);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_stats(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_stats(const envoy_admin_v3_HostStatus* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE const struct envoy_admin_v3_SimpleMetric* const* envoy_admin_v3_HostStatus_stats(const envoy_admin_v3_HostStatus* msg, size_t* len) {
+ return (const struct envoy_admin_v3_SimpleMetric* const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_health_status(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_health_status(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostStatus_health_status(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_admin_v3_HostHealthStatus*);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_weight(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_admin_v3_HostStatus_weight(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_hostname(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_HostStatus_hostname(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_priority(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_admin_v3_HostStatus_priority(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_local_origin_success_rate(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE bool envoy_admin_v3_HostStatus_has_locality(const envoy_admin_v3_HostStatus* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_clear_locality(const envoy_admin_v3_HostStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_admin_v3_HostStatus_locality(const envoy_admin_v3_HostStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct envoy_config_core_v3_Locality*);
+}
+
+UPB_INLINE void envoy_admin_v3_HostStatus_set_address(envoy_admin_v3_HostStatus *msg, struct envoy_config_core_v3_Address* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_admin_v3_HostStatus_mutable_address(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_admin_v3_HostStatus_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_HostStatus_set_address(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_mutable_stats(envoy_admin_v3_HostStatus* msg, size_t* len) {
+ return (struct envoy_admin_v3_SimpleMetric**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE struct envoy_admin_v3_SimpleMetric** envoy_admin_v3_HostStatus_resize_stats(envoy_admin_v3_HostStatus* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_admin_v3_SimpleMetric**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_SimpleMetric* envoy_admin_v3_HostStatus_add_stats(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_SimpleMetric* sub = (struct envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_health_status(envoy_admin_v3_HostStatus *msg, envoy_admin_v3_HostHealthStatus* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_admin_v3_HostHealthStatus*) = value;
+}
+UPB_INLINE struct envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostStatus_mutable_health_status(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_HostHealthStatus* sub = (struct envoy_admin_v3_HostHealthStatus*)envoy_admin_v3_HostStatus_health_status(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_HostStatus_set_health_status(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_success_rate(envoy_admin_v3_HostStatus *msg, struct envoy_type_v3_Percent* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_mutable_success_rate(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_HostStatus_success_rate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_HostStatus_set_success_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_weight(envoy_admin_v3_HostStatus *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_hostname(envoy_admin_v3_HostStatus *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_priority(envoy_admin_v3_HostStatus *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_local_origin_success_rate(envoy_admin_v3_HostStatus *msg, struct envoy_type_v3_Percent* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_admin_v3_HostStatus_mutable_local_origin_success_rate(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_admin_v3_HostStatus_local_origin_success_rate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_HostStatus_set_local_origin_success_rate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_HostStatus_set_locality(envoy_admin_v3_HostStatus *msg, struct envoy_config_core_v3_Locality* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct envoy_config_core_v3_Locality*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Locality* envoy_admin_v3_HostStatus_mutable_locality(envoy_admin_v3_HostStatus* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Locality* sub = (struct envoy_config_core_v3_Locality*)envoy_admin_v3_HostStatus_locality(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Locality*)_upb_Message_New(&envoy_config_core_v3_Locality_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_HostStatus_set_locality(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.admin.v3.HostHealthStatus */
+
+UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_new(upb_Arena* arena) {
+ return (envoy_admin_v3_HostHealthStatus*)_upb_Message_New(&envoy_admin_v3_HostHealthStatus_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_HostHealthStatus* ret = envoy_admin_v3_HostHealthStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_HostHealthStatus* ret = envoy_admin_v3_HostHealthStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_HostHealthStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_HostHealthStatus_serialize(const envoy_admin_v3_HostHealthStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_HostHealthStatus_serialize_ex(const envoy_admin_v3_HostHealthStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_active_health_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_active_health_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_outlier_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_outlier_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_eds_health_status(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_HostHealthStatus_eds_health_status(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_failed_active_degraded_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_failed_active_degraded_check(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_dynamic_removal(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_pending_dynamic_removal(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_pending_active_hc(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_pending_active_hc(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_excluded_via_immediate_hc_fail(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_excluded_via_immediate_hc_fail(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool);
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_clear_active_hc_timeout(const envoy_admin_v3_HostHealthStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_HostHealthStatus_active_hc_timeout(const envoy_admin_v3_HostHealthStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
+}
+
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_active_health_check(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_outlier_check(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_eds_health_status(envoy_admin_v3_HostHealthStatus *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_failed_active_degraded_check(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_pending_dynamic_removal(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_pending_active_hc(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_excluded_via_immediate_hc_fail(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_HostHealthStatus_set_active_hc_timeout(envoy_admin_v3_HostHealthStatus *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_clusters_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
index d230ccb2..c08c2f81 100644
--- a/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/admin/v3/config_dump.upb.h"
#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
#include "google/protobuf/any.upb.h"
@@ -17,389 +17,427 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_admin_v3_ConfigDump_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ConfigDump_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ConfigDump__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_ConfigDump__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_ConfigDump_msginit = {
&envoy_admin_v3_ConfigDump_submsgs[0],
&envoy_admin_v3_ConfigDump__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_UpdateFailureState_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_UpdateFailureState_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_UpdateFailureState__fields[4] = {
- {1, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(24, 48), 2, 1, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_admin_v3_UpdateFailureState__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit = {
+const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit = {
&envoy_admin_v3_UpdateFailureState_submsgs[0],
&envoy_admin_v3_UpdateFailureState__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_BootstrapConfigDump_submsgs[2] = {
- &envoy_config_bootstrap_v3_Bootstrap_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_BootstrapConfigDump_submsgs[2] = {
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_BootstrapConfigDump__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_BootstrapConfigDump__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_BootstrapConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msginit = {
&envoy_admin_v3_BootstrapConfigDump_submsgs[0],
&envoy_admin_v3_BootstrapConfigDump__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_submsgs[2] = {
- &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
- &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit},
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit = {
&envoy_admin_v3_ListenersConfigDump_submsgs[0],
&envoy_admin_v3_ListenersConfigDump__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_StaticListener__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_StaticListener__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ListenersConfigDump_StaticListener_msginit = {
+const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msginit = {
&envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_StaticListener__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit = {
+const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit = {
&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[2] = {
- &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
- &envoy_admin_v3_UpdateFailureState_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[4] = {
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit},
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit},
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 0, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(28, 48), 4, 1, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit = {
+const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit = {
&envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(32, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_submsgs[2] = {
- &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
- &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit},
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit},
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump__fields[4] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit = {
&envoy_admin_v3_ClustersConfigDump_submsgs[0],
&envoy_admin_v3_ClustersConfigDump__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit = {
+const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit = {
&envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[0],
&envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[5] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit = {
+const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit = {
&envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[0],
&envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_submsgs[2] = {
- &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
- &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit},
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit = {
&envoy_admin_v3_RoutesConfigDump_submsgs[0],
&envoy_admin_v3_RoutesConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit = {
+const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit = {
&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[0],
&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[5] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit = {
+const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit = {
&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[0],
&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = {
- &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit},
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit = {
+const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(32, 56), 0, 1, 11, 3},
- {4, UPB_SIZE(24, 40), 1, 2, 11, 1},
- {5, UPB_SIZE(28, 48), 2, 0, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit = {
+const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_submsgs[2] = {
- &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
- &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit},
+ {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit},
+ {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_SecretsConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msginit = {
&envoy_admin_v3_SecretsConfigDump_submsgs[0],
&envoy_admin_v3_SecretsConfigDump__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), 1, 2, 11, 1},
- {4, UPB_SIZE(28, 48), 2, 1, 11, 1},
- {5, UPB_SIZE(32, 56), 3, 0, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit = {
+const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit = {
&envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[0],
&envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit = {
+const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit = {
&envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[0],
&envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_submsgs[2] = {
- &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
- &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit},
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit = {
+const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit = {
&envoy_admin_v3_EndpointsConfigDump_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit = {
+const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit = {
&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
-static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[5] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit = {
+const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit = {
&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[22] = {
+ &envoy_admin_v3_ConfigDump_msginit,
+ &envoy_admin_v3_UpdateFailureState_msginit,
+ &envoy_admin_v3_BootstrapConfigDump_msginit,
+ &envoy_admin_v3_ListenersConfigDump_msginit,
+ &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
+ &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
+ &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
+ &envoy_admin_v3_ClustersConfigDump_msginit,
+ &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
+ &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
+ &envoy_admin_v3_RoutesConfigDump_msginit,
+ &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
+ &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
+ &envoy_admin_v3_SecretsConfigDump_msginit,
+ &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
+ &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_config_dump_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 22,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
index 6f117c66..580f5a71 100644
--- a/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_
#define ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -64,34 +64,34 @@ typedef struct envoy_admin_v3_SecretsConfigDump_StaticSecret envoy_admin_v3_Secr
typedef struct envoy_admin_v3_EndpointsConfigDump envoy_admin_v3_EndpointsConfigDump;
typedef struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig;
typedef struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig;
-extern const upb_msglayout envoy_admin_v3_ConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit;
-extern const upb_msglayout envoy_admin_v3_BootstrapConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_StaticListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit;
+extern const upb_MiniTable envoy_admin_v3_ConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit;
+extern const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_StaticListener_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit;
+extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit;
+extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit;
+extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit;
+extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit;
+extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit;
+extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit;
+extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit;
+extern const upb_MiniTable envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit;
+extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit;
+extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit;
struct envoy_config_bootstrap_v3_Bootstrap;
struct google_protobuf_Any;
struct google_protobuf_Timestamp;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_Timestamp_msginit;
typedef enum {
envoy_admin_v3_UNKNOWN = 0,
@@ -102,78 +102,131 @@ typedef enum {
} envoy_admin_v3_ClientResourceStatus;
+
/* envoy.admin.v3.ConfigDump */
-UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_ConfigDump *)_upb_msg_new(&envoy_admin_v3_ConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ConfigDump*)_upb_Message_New(&envoy_admin_v3_ConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ConfigDump *ret = envoy_admin_v3_ConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ConfigDump* ret = envoy_admin_v3_ConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ConfigDump* ret = envoy_admin_v3_ConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ConfigDump *ret = envoy_admin_v3_ConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ConfigDump_serialize(const envoy_admin_v3_ConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ConfigDump_serialize(const envoy_admin_v3_ConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ConfigDump_serialize_ex(const envoy_admin_v3_ConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_ConfigDump_has_configs(const envoy_admin_v3_ConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_ConfigDump_clear_configs(const envoy_admin_v3_ConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ConfigDump_configs(const envoy_admin_v3_ConfigDump* msg, size_t* len) {
+ return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE bool envoy_admin_v3_ConfigDump_has_configs(const envoy_admin_v3_ConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ConfigDump_configs(const envoy_admin_v3_ConfigDump *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_mutable_configs(envoy_admin_v3_ConfigDump *msg, size_t *len) {
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_mutable_configs(envoy_admin_v3_ConfigDump* msg, size_t* len) {
return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_resize_configs(envoy_admin_v3_ConfigDump *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Any**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ConfigDump_resize_configs(envoy_admin_v3_ConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ConfigDump_add_configs(envoy_admin_v3_ConfigDump *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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ConfigDump_add_configs(envoy_admin_v3_ConfigDump* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.UpdateFailureState */
-UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_new(upb_arena *arena) {
- return (envoy_admin_v3_UpdateFailureState *)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_new(upb_Arena* arena) {
+ return (envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_UpdateFailureState* ret = envoy_admin_v3_UpdateFailureState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_UpdateFailureState* ret = envoy_admin_v3_UpdateFailureState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_UpdateFailureState *ret = envoy_admin_v3_UpdateFailureState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_UpdateFailureState_serialize(const envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, 0, arena, len);
}
-UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_UpdateFailureState *ret = envoy_admin_v3_UpdateFailureState_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_UpdateFailureState_serialize_ex(const envoy_admin_v3_UpdateFailureState* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_UpdateFailureState_serialize(const envoy_admin_v3_UpdateFailureState *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, arena, len);
+UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_last_update_attempt(const envoy_admin_v3_UpdateFailureState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_details(const envoy_admin_v3_UpdateFailureState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_UpdateFailureState_details(const envoy_admin_v3_UpdateFailureState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_clear_version_info(const envoy_admin_v3_UpdateFailureState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_UpdateFailureState_version_info(const envoy_admin_v3_UpdateFailureState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
}
-
-UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_failed_configuration(const envoy_admin_v3_UpdateFailureState *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_failed_configuration(const envoy_admin_v3_UpdateFailureState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_last_update_attempt(const envoy_admin_v3_UpdateFailureState *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_last_update_attempt(const envoy_admin_v3_UpdateFailureState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Timestamp*); }
-UPB_INLINE upb_strview envoy_admin_v3_UpdateFailureState_details(const envoy_admin_v3_UpdateFailureState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_admin_v3_UpdateFailureState_version_info(const envoy_admin_v3_UpdateFailureState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_failed_configuration(envoy_admin_v3_UpdateFailureState *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_mutable_failed_configuration(envoy_admin_v3_UpdateFailureState *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_mutable_failed_configuration(envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_UpdateFailureState_failed_configuration(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_UpdateFailureState_set_failed_configuration(msg, sub);
}
@@ -181,57 +234,82 @@ UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_UpdateFailureState_mutable
}
UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_last_update_attempt(envoy_admin_v3_UpdateFailureState *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_mutable_last_update_attempt(envoy_admin_v3_UpdateFailureState *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_UpdateFailureState_mutable_last_update_attempt(envoy_admin_v3_UpdateFailureState* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_UpdateFailureState_last_update_attempt(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_UpdateFailureState_set_last_update_attempt(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_details(envoy_admin_v3_UpdateFailureState *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_details(envoy_admin_v3_UpdateFailureState *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_version_info(envoy_admin_v3_UpdateFailureState *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_UpdateFailureState_set_version_info(envoy_admin_v3_UpdateFailureState *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
}
/* envoy.admin.v3.BootstrapConfigDump */
-UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_BootstrapConfigDump *)_upb_msg_new(&envoy_admin_v3_BootstrapConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_BootstrapConfigDump*)_upb_Message_New(&envoy_admin_v3_BootstrapConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_BootstrapConfigDump *ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_BootstrapConfigDump* ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_BootstrapConfigDump* ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_BootstrapConfigDump *ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_BootstrapConfigDump_serialize(const envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_BootstrapConfigDump_serialize(const envoy_admin_v3_BootstrapConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_BootstrapConfigDump_serialize_ex(const envoy_admin_v3_BootstrapConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_bootstrap_v3_Bootstrap*);
+}
+UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_clear_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_last_updated(const envoy_admin_v3_BootstrapConfigDump* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
}
-
-UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_bootstrap(const envoy_admin_v3_BootstrapConfigDump *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_bootstrap(const envoy_admin_v3_BootstrapConfigDump *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_bootstrap_v3_Bootstrap*); }
-UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_last_updated(const envoy_admin_v3_BootstrapConfigDump *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_last_updated(const envoy_admin_v3_BootstrapConfigDump *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); }
UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_set_bootstrap(envoy_admin_v3_BootstrapConfigDump *msg, struct envoy_config_bootstrap_v3_Bootstrap* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_bootstrap_v3_Bootstrap*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_mutable_bootstrap(envoy_admin_v3_BootstrapConfigDump *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap* envoy_admin_v3_BootstrapConfigDump_mutable_bootstrap(envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Bootstrap* sub = (struct envoy_config_bootstrap_v3_Bootstrap*)envoy_admin_v3_BootstrapConfigDump_bootstrap(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Bootstrap*)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_BootstrapConfigDump_set_bootstrap(msg, sub);
}
@@ -241,10 +319,10 @@ UPB_INLINE void envoy_admin_v3_BootstrapConfigDump_set_last_updated(envoy_admin_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_mutable_last_updated(envoy_admin_v3_BootstrapConfigDump *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_mutable_last_updated(envoy_admin_v3_BootstrapConfigDump* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_BootstrapConfigDump_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_BootstrapConfigDump_set_last_updated(msg, sub);
}
@@ -253,93 +331,146 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_BootstrapConfigDump_
/* envoy.admin.v3.ListenersConfigDump */
-UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump *)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ListenersConfigDump *ret = envoy_admin_v3_ListenersConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump* ret = envoy_admin_v3_ListenersConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump* ret = envoy_admin_v3_ListenersConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ListenersConfigDump *ret = envoy_admin_v3_ListenersConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_serialize(const envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_serialize(const envoy_admin_v3_ListenersConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_serialize_ex(const envoy_admin_v3_ListenersConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_version_info(const envoy_admin_v3_ListenersConfigDump* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_version_info(const envoy_admin_v3_ListenersConfigDump* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_admin_v3_ListenersConfigDump_StaticListener* const* envoy_admin_v3_ListenersConfigDump_static_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ListenersConfigDump_StaticListener* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_clear_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListener* const* envoy_admin_v3_ListenersConfigDump_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ListenersConfigDump_DynamicListener* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
}
-UPB_INLINE upb_strview envoy_admin_v3_ListenersConfigDump_version_info(const envoy_admin_v3_ListenersConfigDump *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_static_listeners(const envoy_admin_v3_ListenersConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_admin_v3_ListenersConfigDump_StaticListener* const* envoy_admin_v3_ListenersConfigDump_static_listeners(const envoy_admin_v3_ListenersConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ListenersConfigDump_StaticListener* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_has_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListener* const* envoy_admin_v3_ListenersConfigDump_dynamic_listeners(const envoy_admin_v3_ListenersConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ListenersConfigDump_DynamicListener* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void envoy_admin_v3_ListenersConfigDump_set_version_info(envoy_admin_v3_ListenersConfigDump *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_set_version_info(envoy_admin_v3_ListenersConfigDump *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_mutable_static_listeners(envoy_admin_v3_ListenersConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_mutable_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_resize_static_listeners(envoy_admin_v3_ListenersConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener** envoy_admin_v3_ListenersConfigDump_resize_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump_StaticListener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_add_static_listeners(envoy_admin_v3_ListenersConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ListenersConfigDump_StaticListener* sub = (struct envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_add_static_listeners(envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ListenersConfigDump_StaticListener* sub = (struct envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_mutable_dynamic_listeners(envoy_admin_v3_ListenersConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_mutable_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_resize_dynamic_listeners(envoy_admin_v3_ListenersConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener** envoy_admin_v3_ListenersConfigDump_resize_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump_DynamicListener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_add_dynamic_listeners(envoy_admin_v3_ListenersConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ListenersConfigDump_DynamicListener* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_add_dynamic_listeners(envoy_admin_v3_ListenersConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ListenersConfigDump_DynamicListener* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.ListenersConfigDump.StaticListener */
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_ListenersConfigDump_StaticListener_new(upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump_StaticListener *)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_StaticListener_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump_StaticListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_ListenersConfigDump_StaticListener_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ListenersConfigDump_StaticListener *ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_StaticListener_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_StaticListener* ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_ListenersConfigDump_StaticListener_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_StaticListener* ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_ListenersConfigDump_StaticListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ListenersConfigDump_StaticListener *ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_StaticListener_serialize(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_StaticListener_serialize(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_StaticListener_serialize_ex(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_clear_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
}
-
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_last_updated(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); }
UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_set_listener(envoy_admin_v3_ListenersConfigDump_StaticListener *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_listener(envoy_admin_v3_ListenersConfigDump_StaticListener *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_listener(envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ListenersConfigDump_StaticListener_listener(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_StaticListener_set_listener(msg, sub);
}
@@ -349,10 +480,10 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_StaticListener_set_last_updat
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_StaticListener *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_StaticListener_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_StaticListener* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ListenersConfigDump_StaticListener_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_StaticListener_set_last_updated(msg, sub);
}
@@ -361,41 +492,71 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_
/* envoy.admin.v3.ListenersConfigDump.DynamicListenerState */
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump_DynamicListenerState *)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_DynamicListenerState* ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState *ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, 0, arena, len);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState *ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_serialize_ex(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena, len);
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_version_info(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_DynamicListenerState_version_info(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_clear_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Timestamp*);
}
-UPB_INLINE upb_strview envoy_admin_v3_ListenersConfigDump_DynamicListenerState_version_info(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_listener(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListenerState_has_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_last_updated(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Timestamp*); }
-
-UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_version_info(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_version_info(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_listener(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ListenersConfigDump_DynamicListenerState_listener(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_listener(msg, sub);
}
@@ -405,10 +566,10 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_last_updated(envoy_admin_v3_ListenersConfigDump_DynamicListenerState* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ListenersConfigDump_DynamicListenerState_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(msg, sub);
}
@@ -417,46 +578,95 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ListenersConfigDump_
/* envoy.admin.v3.ListenersConfigDump.DynamicListener */
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_ListenersConfigDump_DynamicListener_new(upb_arena *arena) {
- return (envoy_admin_v3_ListenersConfigDump_DynamicListener *)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena);
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_DynamicListener_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ListenersConfigDump_DynamicListener*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_ListenersConfigDump_DynamicListener_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ListenersConfigDump_DynamicListener *ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_DynamicListener_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_DynamicListener* ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_ListenersConfigDump_DynamicListener_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ListenersConfigDump_DynamicListener* ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_ListenersConfigDump_DynamicListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ListenersConfigDump_DynamicListener *ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListener_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_DynamicListener_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ListenersConfigDump_DynamicListener_serialize_ex(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_name(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ListenersConfigDump_DynamicListener_name(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*);
+}
+UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_clear_client_status(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_ListenersConfigDump_DynamicListener_client_status(const envoy_admin_v3_ListenersConfigDump_DynamicListener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_ListenersConfigDump_DynamicListener_name(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_active_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_warming_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_draining_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_ListenersConfigDump_DynamicListenerState*); }
-UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_DynamicListener_has_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_error_state(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_ListenersConfigDump_DynamicListener_client_status(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_name(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_name(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, envoy_admin_v3_ListenersConfigDump_DynamicListenerState* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_active_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) {
struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_active_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
+ sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListener_set_active_state(msg, sub);
}
@@ -466,10 +676,10 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_warming_s
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_warming_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_warming_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) {
struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_warming_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
+ sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListener_set_warming_state(msg, sub);
}
@@ -479,10 +689,10 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_draining_
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_ListenersConfigDump_DynamicListenerState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_draining_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_draining_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) {
struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState* sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_draining_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
+ sub = (struct envoy_admin_v3_ListenersConfigDump_DynamicListenerState*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListener_set_draining_state(msg, sub);
}
@@ -492,10 +702,10 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_sta
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_error_state(envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_error_state(envoy_admin_v3_ListenersConfigDump_DynamicListener* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ListenersConfigDump_DynamicListener_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(msg, sub);
}
@@ -507,108 +717,167 @@ UPB_INLINE void envoy_admin_v3_ListenersConfigDump_DynamicListener_set_client_st
/* envoy.admin.v3.ClustersConfigDump */
-UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump *)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump* ret = envoy_admin_v3_ClustersConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump* ret = envoy_admin_v3_ClustersConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ClustersConfigDump *ret = envoy_admin_v3_ClustersConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_serialize(const envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ClustersConfigDump *ret = envoy_admin_v3_ClustersConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_serialize_ex(const envoy_admin_v3_ClustersConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_serialize(const envoy_admin_v3_ClustersConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, arena, len);
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_version_info(const envoy_admin_v3_ClustersConfigDump* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ClustersConfigDump_version_info(const envoy_admin_v3_ClustersConfigDump* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_admin_v3_ClustersConfigDump_StaticCluster* const* envoy_admin_v3_ClustersConfigDump_static_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ClustersConfigDump_StaticCluster* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_clear_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
}
-UPB_INLINE upb_strview envoy_admin_v3_ClustersConfigDump_version_info(const envoy_admin_v3_ClustersConfigDump *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_static_clusters(const envoy_admin_v3_ClustersConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_admin_v3_ClustersConfigDump_StaticCluster* const* envoy_admin_v3_ClustersConfigDump_static_clusters(const envoy_admin_v3_ClustersConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ClustersConfigDump_StaticCluster* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_active_clusters(const envoy_admin_v3_ClustersConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_has_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const* envoy_admin_v3_ClustersConfigDump_dynamic_warming_clusters(const envoy_admin_v3_ClustersConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ClustersConfigDump_DynamicCluster* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-
-UPB_INLINE void envoy_admin_v3_ClustersConfigDump_set_version_info(envoy_admin_v3_ClustersConfigDump *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_set_version_info(envoy_admin_v3_ClustersConfigDump *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_mutable_static_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_mutable_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_resize_static_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster** envoy_admin_v3_ClustersConfigDump_resize_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump_StaticCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_add_static_clusters(envoy_admin_v3_ClustersConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ClustersConfigDump_StaticCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_add_static_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ClustersConfigDump_StaticCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_active_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_mutable_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster** envoy_admin_v3_ClustersConfigDump_resize_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump_DynamicCluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_add_dynamic_warming_clusters(envoy_admin_v3_ClustersConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ClustersConfigDump_DynamicCluster* sub = (struct envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.ClustersConfigDump.StaticCluster */
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_ClustersConfigDump_StaticCluster_new(upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump_StaticCluster *)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_StaticCluster_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump_StaticCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_ClustersConfigDump_StaticCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ClustersConfigDump_StaticCluster *ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_StaticCluster_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump_StaticCluster* ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_ClustersConfigDump_StaticCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump_StaticCluster* ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_ClustersConfigDump_StaticCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ClustersConfigDump_StaticCluster *ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_StaticCluster_serialize(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_StaticCluster_serialize(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_StaticCluster_serialize_ex(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_clear_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
}
-
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); }
UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_set_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ClustersConfigDump_StaticCluster_cluster(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ClustersConfigDump_StaticCluster_set_cluster(msg, sub);
}
@@ -618,10 +887,10 @@ UPB_INLINE void envoy_admin_v3_ClustersConfigDump_StaticCluster_set_last_updated
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_StaticCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_StaticCluster* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ClustersConfigDump_StaticCluster_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ClustersConfigDump_StaticCluster_set_last_updated(msg, sub);
}
@@ -630,44 +899,86 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_S
/* envoy.admin.v3.ClustersConfigDump.DynamicCluster */
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(upb_arena *arena) {
- return (envoy_admin_v3_ClustersConfigDump_DynamicCluster *)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ClustersConfigDump_DynamicCluster*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ClustersConfigDump_DynamicCluster *ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump_DynamicCluster* ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ClustersConfigDump_DynamicCluster* ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ClustersConfigDump_DynamicCluster *ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_DynamicCluster_serialize(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_DynamicCluster_serialize(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ClustersConfigDump_DynamicCluster_serialize_ex(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_version_info(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ClustersConfigDump_DynamicCluster_version_info(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_clear_client_status(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_ClustersConfigDump_DynamicCluster_client_status(const envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_ClustersConfigDump_DynamicCluster_version_info(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_cluster(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_last_updated(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_DynamicCluster_has_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_error_state(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_ClustersConfigDump_DynamicCluster_client_status(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_version_info(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_version_info(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_cluster(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_cluster(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_cluster(msg, sub);
}
@@ -677,10 +988,10 @@ UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_update
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_last_updated(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(msg, sub);
}
@@ -690,10 +1001,10 @@ UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_error_state(envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_error_state(envoy_admin_v3_ClustersConfigDump_DynamicCluster* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ClustersConfigDump_DynamicCluster_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(msg, sub);
}
@@ -705,89 +1016,137 @@ UPB_INLINE void envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_client_stat
/* envoy.admin.v3.RoutesConfigDump */
-UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_RoutesConfigDump *)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_RoutesConfigDump *ret = envoy_admin_v3_RoutesConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump* ret = envoy_admin_v3_RoutesConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump* ret = envoy_admin_v3_RoutesConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_RoutesConfigDump *ret = envoy_admin_v3_RoutesConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_serialize(const envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_serialize(const envoy_admin_v3_RoutesConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_serialize_ex(const envoy_admin_v3_RoutesConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_has_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const* envoy_admin_v3_RoutesConfigDump_static_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_has_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_clear_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const* envoy_admin_v3_RoutesConfigDump_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_has_static_route_configs(const envoy_admin_v3_RoutesConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const* envoy_admin_v3_RoutesConfigDump_static_route_configs(const envoy_admin_v3_RoutesConfigDump *msg, size_t *len) { return (const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_has_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const* envoy_admin_v3_RoutesConfigDump_dynamic_route_configs(const envoy_admin_v3_RoutesConfigDump *msg, size_t *len) { return (const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_static_route_configs(envoy_admin_v3_RoutesConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* len) {
return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_static_route_configs(envoy_admin_v3_RoutesConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_add_static_route_configs(envoy_admin_v3_RoutesConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_add_static_route_configs(envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_mutable_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t* len) {
return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig** envoy_admin_v3_RoutesConfigDump_resize_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_add_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_add_dynamic_route_configs(envoy_admin_v3_RoutesConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* sub = (struct envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.RoutesConfigDump.StaticRouteConfig */
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(upb_arena *arena) {
- return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena);
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(upb_Arena* arena) {
+ return (envoy_admin_v3_RoutesConfigDump_StaticRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_serialize_ex(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_clear_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
}
-
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); }
UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_route_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_route_config(msg, sub);
}
@@ -797,10 +1156,10 @@ UPB_INLINE void envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_last_updat
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_set_last_updated(msg, sub);
}
@@ -809,44 +1168,86 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_Sta
/* envoy.admin.v3.RoutesConfigDump.DynamicRouteConfig */
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(upb_arena *arena) {
- return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena);
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(upb_Arena* arena) {
+ return (envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_serialize_ex(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_version_info(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_version_info(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_clear_client_status(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_client_status(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_version_info(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_route_config(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_last_updated(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_has_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_error_state(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_client_status(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_version_info(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_version_info(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_route_config(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_route_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_route_config(msg, sub);
}
@@ -856,10 +1257,10 @@ UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_upda
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_last_updated(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(msg, sub);
}
@@ -869,10 +1270,10 @@ UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_sta
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_error_state(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_error_state(envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(msg, sub);
}
@@ -884,106 +1285,158 @@ UPB_INLINE void envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_client_st
/* envoy.admin.v3.ScopedRoutesConfigDump */
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_ScopedRoutesConfigDump *)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ScopedRoutesConfigDump *ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump* ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump* ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ScopedRoutesConfigDump *ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_serialize(const envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_serialize(const envoy_admin_v3_ScopedRoutesConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_serialize_ex(const envoy_admin_v3_ScopedRoutesConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_has_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_has_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_clear_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_has_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_inline_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_has_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const* envoy_admin_v3_ScopedRoutesConfigDump_dynamic_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t *len) { return (const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_inline_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_mutable_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t* len) {
return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs** envoy_admin_v3_ScopedRoutesConfigDump_resize_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_add_dynamic_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.ScopedRoutesConfigDump.InlineScopedRouteConfigs */
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(upb_arena *arena) {
- return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena);
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_serialize_ex(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_name(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t* len) {
+ return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_clear_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Timestamp*);
}
-UPB_INLINE upb_strview envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Timestamp*); }
-
-UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, size_t *len) {
- return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* 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** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Any**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, size_t len, upb_Arena* arena) {
+ return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_set_last_updated(msg, sub);
}
@@ -992,61 +1445,107 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDu
/* envoy.admin.v3.ScopedRoutesConfigDump.DynamicScopedRouteConfigs */
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(upb_arena *arena) {
- return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena);
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_serialize_ex(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_name(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_version_info(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_version_info(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40));
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* len) {
+ return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_clear_client_status(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_client_status(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_name(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_version_info(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE const struct google_protobuf_Any* const* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_scoped_route_configs(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_last_updated(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_has_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_error_state(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_client_status(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_name(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
-UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_version_info(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_version_info(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
-UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, size_t *len) {
- return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t* len) {
+ return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
}
-UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, size_t len, upb_arena *arena) {
- return (struct google_protobuf_Any**)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct google_protobuf_Any** envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_resize_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, size_t len, upb_Arena* arena) {
+ return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *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_accessor2(
- msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_add_scoped_route_configs(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_last_updated(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_last_updated(msg, sub);
}
@@ -1054,12 +1553,12 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_ScopedRoutesConfigDu
}
UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, envoy_admin_v3_UpdateFailureState* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_admin_v3_UpdateFailureState*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_mutable_error_state(envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_set_error_state(msg, sub);
}
@@ -1071,115 +1570,191 @@ UPB_INLINE void envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_
/* envoy.admin.v3.SecretsConfigDump */
-UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump *)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_SecretsConfigDump *ret = envoy_admin_v3_SecretsConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump* ret = envoy_admin_v3_SecretsConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump* ret = envoy_admin_v3_SecretsConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_SecretsConfigDump *ret = envoy_admin_v3_SecretsConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_serialize(const envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_serialize(const envoy_admin_v3_SecretsConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_serialize_ex(const envoy_admin_v3_SecretsConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_SecretsConfigDump_StaticSecret* const* envoy_admin_v3_SecretsConfigDump_static_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_SecretsConfigDump_StaticSecret* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_clear_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_static_secrets(const envoy_admin_v3_SecretsConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_admin_v3_SecretsConfigDump_StaticSecret* const* envoy_admin_v3_SecretsConfigDump_static_secrets(const envoy_admin_v3_SecretsConfigDump *msg, size_t *len) { return (const envoy_admin_v3_SecretsConfigDump_StaticSecret* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_active_secrets(const envoy_admin_v3_SecretsConfigDump *msg, size_t *len) { return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_has_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const* envoy_admin_v3_SecretsConfigDump_dynamic_warming_secrets(const envoy_admin_v3_SecretsConfigDump *msg, size_t *len) { return (const envoy_admin_v3_SecretsConfigDump_DynamicSecret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_mutable_static_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_mutable_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_resize_static_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret** envoy_admin_v3_SecretsConfigDump_resize_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump_StaticSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_add_static_secrets(envoy_admin_v3_SecretsConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_SecretsConfigDump_StaticSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_add_static_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_SecretsConfigDump_StaticSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_active_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_mutable_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t* len) {
return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret** envoy_admin_v3_SecretsConfigDump_resize_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump_DynamicSecret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_add_dynamic_warming_secrets(envoy_admin_v3_SecretsConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_SecretsConfigDump_DynamicSecret* sub = (struct envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.SecretsConfigDump.DynamicSecret */
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump_DynamicSecret *)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump_DynamicSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_SecretsConfigDump_DynamicSecret *ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump_DynamicSecret* ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump_DynamicSecret* ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_SecretsConfigDump_DynamicSecret *ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_DynamicSecret_serialize(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_DynamicSecret_serialize(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_DynamicSecret_serialize_ex(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_name(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_DynamicSecret_name(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_version_info(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_DynamicSecret_version_info(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_clear_client_status(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_SecretsConfigDump_DynamicSecret_client_status(const envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_SecretsConfigDump_DynamicSecret_name(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_admin_v3_SecretsConfigDump_DynamicSecret_version_info(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_secret(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_DynamicSecret_has_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_error_state(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_SecretsConfigDump_DynamicSecret_client_status(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_name(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_name(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
-UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_version_info(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_version_info(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_last_updated(msg, sub);
}
@@ -1189,10 +1764,10 @@ UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_secret(envoy_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_secret(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_secret(msg, sub);
}
@@ -1202,10 +1777,10 @@ UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_error_state(e
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_error_state(envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_SecretsConfigDump_DynamicSecret_mutable_error_state(envoy_admin_v3_SecretsConfigDump_DynamicSecret* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_SecretsConfigDump_DynamicSecret_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_error_state(msg, sub);
}
@@ -1217,41 +1792,71 @@ UPB_INLINE void envoy_admin_v3_SecretsConfigDump_DynamicSecret_set_client_status
/* envoy.admin.v3.SecretsConfigDump.StaticSecret */
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_SecretsConfigDump_StaticSecret_new(upb_arena *arena) {
- return (envoy_admin_v3_SecretsConfigDump_StaticSecret *)_upb_msg_new(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena);
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_StaticSecret_new(upb_Arena* arena) {
+ return (envoy_admin_v3_SecretsConfigDump_StaticSecret*)_upb_Message_New(&envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_SecretsConfigDump_StaticSecret_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_SecretsConfigDump_StaticSecret *ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_StaticSecret_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump_StaticSecret* ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_SecretsConfigDump_StaticSecret_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_SecretsConfigDump_StaticSecret* ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_SecretsConfigDump_StaticSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_SecretsConfigDump_StaticSecret *ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_StaticSecret_serialize(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_StaticSecret_serialize(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_SecretsConfigDump_StaticSecret_serialize_ex(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_name(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SecretsConfigDump_StaticSecret_name(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_clear_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*);
}
-UPB_INLINE upb_strview envoy_admin_v3_SecretsConfigDump_StaticSecret_name(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_last_updated(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_SecretsConfigDump_StaticSecret_has_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_secret(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_name(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_name(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_last_updated(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_SecretsConfigDump_StaticSecret_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_SecretsConfigDump_StaticSecret_set_last_updated(msg, sub);
}
@@ -1261,10 +1866,10 @@ UPB_INLINE void envoy_admin_v3_SecretsConfigDump_StaticSecret_set_secret(envoy_a
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSecret_mutable_secret(envoy_admin_v3_SecretsConfigDump_StaticSecret* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_SecretsConfigDump_StaticSecret_secret(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_SecretsConfigDump_StaticSecret_set_secret(msg, sub);
}
@@ -1273,89 +1878,137 @@ UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_SecretsConfigDump_StaticSe
/* envoy.admin.v3.EndpointsConfigDump */
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDump_new(upb_arena *arena) {
- return (envoy_admin_v3_EndpointsConfigDump *)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_msginit, arena);
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump* ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump* ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDump_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_EndpointsConfigDump *ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_serialize(const envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, 0, arena, len);
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_EndpointsConfigDump *ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_serialize_ex(const envoy_admin_v3_EndpointsConfigDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_serialize(const envoy_admin_v3_EndpointsConfigDump *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, arena, len);
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_has_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_has_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_clear_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) {
+ return (const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_has_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_static_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump *msg, size_t *len) { return (const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_has_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const* envoy_admin_v3_EndpointsConfigDump_dynamic_endpoint_configs(const envoy_admin_v3_EndpointsConfigDump *msg, size_t *len) { return (const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) {
return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_static_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, size_t *len) {
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_mutable_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t* len) {
return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, size_t len, upb_arena *arena) {
- return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig** envoy_admin_v3_EndpointsConfigDump_resize_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump *msg, upb_arena *arena) {
- struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_add_dynamic_endpoint_configs(envoy_admin_v3_EndpointsConfigDump* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* sub = (struct envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.admin.v3.EndpointsConfigDump.StaticEndpointConfig */
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(upb_arena *arena) {
- return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena);
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(upb_Arena* arena) {
+ return (envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_serialize_ex(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_clear_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*);
}
-
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Timestamp*); }
UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_endpoint_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_endpoint_config(msg, sub);
}
@@ -1365,10 +2018,10 @@ UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_last
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_set_last_updated(msg, sub);
}
@@ -1377,44 +2030,86 @@ UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_
/* envoy.admin.v3.EndpointsConfigDump.DynamicEndpointConfig */
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(upb_arena *arena) {
- return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena);
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(upb_Arena* arena) {
+ return (envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena);
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena, len);
+UPB_INLINE char* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_serialize_ex(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_version_info(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_version_info(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_clear_client_status(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_client_status(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_version_info(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_last_updated(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Timestamp*); }
-UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_has_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_error_state(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_admin_v3_UpdateFailureState*); }
-UPB_INLINE int32_t envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_client_status(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_version_info(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_version_info(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_endpoint_config(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_endpoint_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_endpoint_config(msg, sub);
}
@@ -1424,10 +2119,10 @@ UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_las
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Timestamp*) = value;
}
-UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Timestamp* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_last_updated(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) {
struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_last_updated(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(msg, sub);
}
@@ -1437,10 +2132,10 @@ UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_err
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_admin_v3_UpdateFailureState*) = value;
}
-UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_error_state(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_error_state(envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_error_state(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
if (!sub) return NULL;
envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(msg, sub);
}
@@ -1450,6 +2145,8 @@ UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_cli
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+extern const upb_MiniTable_File envoy_admin_v3_config_dump_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c
new file mode 100644
index 00000000..e9fdb19a
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c
@@ -0,0 +1,56 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/init_dump.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/init_dump.upb.h"
+#include "udpa/annotations/status.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_admin_v3_UnreadyTargetsDumps_submsgs[1] = {
+ {.submsg = &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msginit = {
+ &envoy_admin_v3_UnreadyTargetsDumps_submsgs[0],
+ &envoy_admin_v3_UnreadyTargetsDumps__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit = {
+ NULL,
+ &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_admin_v3_UnreadyTargetsDumps_msginit,
+ &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_init_dump_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h
new file mode 100644
index 00000000..2c29c5fb
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h
@@ -0,0 +1,151 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/init_dump.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_UnreadyTargetsDumps;
+struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump;
+typedef struct envoy_admin_v3_UnreadyTargetsDumps envoy_admin_v3_UnreadyTargetsDumps;
+typedef struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump;
+extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_msginit;
+extern const upb_MiniTable envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit;
+
+
+
+/* envoy.admin.v3.UnreadyTargetsDumps */
+
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDumps_new(upb_Arena* arena) {
+ return (envoy_admin_v3_UnreadyTargetsDumps*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDumps_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_UnreadyTargetsDumps* ret = envoy_admin_v3_UnreadyTargetsDumps_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDumps_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_UnreadyTargetsDumps* ret = envoy_admin_v3_UnreadyTargetsDumps_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_serialize(const envoy_admin_v3_UnreadyTargetsDumps* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_serialize_ex(const envoy_admin_v3_UnreadyTargetsDumps* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_UnreadyTargetsDumps_has_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_clear_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const* envoy_admin_v3_UnreadyTargetsDumps_unready_targets_dumps(const envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* len) {
+ return (const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_mutable_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t* len) {
+ return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump** envoy_admin_v3_UnreadyTargetsDumps_resize_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_add_unready_targets_dumps(envoy_admin_v3_UnreadyTargetsDumps* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* sub = (struct envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.admin.v3.UnreadyTargetsDumps.UnreadyTargetsDump */
+
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(upb_Arena* arena) {
+ return (envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump*)_upb_Message_New(&envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* ret = envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* ret = envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_serialize(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_serialize_ex(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_clear_name(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_name(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_clear_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE upb_StringView const* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_target_names(const envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+
+UPB_INLINE void envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_set_name(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_mutable_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_resize_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_add_target_names(envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_init_dump_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c
new file mode 100644
index 00000000..41718acc
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c
@@ -0,0 +1,62 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/listeners.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/listeners.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_admin_v3_Listeners_submsgs[1] = {
+ {.submsg = &envoy_admin_v3_ListenerStatus_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_Listeners__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_Listeners_msginit = {
+ &envoy_admin_v3_Listeners_submsgs[0],
+ &envoy_admin_v3_Listeners__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_ListenerStatus_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_ListenerStatus__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_ListenerStatus_msginit = {
+ &envoy_admin_v3_ListenerStatus_submsgs[0],
+ &envoy_admin_v3_ListenerStatus__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_admin_v3_Listeners_msginit,
+ &envoy_admin_v3_ListenerStatus_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_listeners_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h
new file mode 100644
index 00000000..fc41db49
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h
@@ -0,0 +1,160 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/listeners.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_Listeners;
+struct envoy_admin_v3_ListenerStatus;
+typedef struct envoy_admin_v3_Listeners envoy_admin_v3_Listeners;
+typedef struct envoy_admin_v3_ListenerStatus envoy_admin_v3_ListenerStatus;
+extern const upb_MiniTable envoy_admin_v3_Listeners_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenerStatus_msginit;
+struct envoy_config_core_v3_Address;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+
+
+
+/* envoy.admin.v3.Listeners */
+
+UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_new(upb_Arena* arena) {
+ return (envoy_admin_v3_Listeners*)_upb_Message_New(&envoy_admin_v3_Listeners_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_Listeners* ret = envoy_admin_v3_Listeners_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_Listeners* ret = envoy_admin_v3_Listeners_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Listeners_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_Listeners_serialize(const envoy_admin_v3_Listeners* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_Listeners_serialize_ex(const envoy_admin_v3_Listeners* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_admin_v3_Listeners_has_listener_statuses(const envoy_admin_v3_Listeners* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_admin_v3_Listeners_clear_listener_statuses(const envoy_admin_v3_Listeners* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_admin_v3_ListenerStatus* const* envoy_admin_v3_Listeners_listener_statuses(const envoy_admin_v3_Listeners* msg, size_t* len) {
+ return (const envoy_admin_v3_ListenerStatus* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_mutable_listener_statuses(envoy_admin_v3_Listeners* msg, size_t* len) {
+ return (envoy_admin_v3_ListenerStatus**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_admin_v3_ListenerStatus** envoy_admin_v3_Listeners_resize_listener_statuses(envoy_admin_v3_Listeners* msg, size_t len, upb_Arena* arena) {
+ return (envoy_admin_v3_ListenerStatus**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_admin_v3_ListenerStatus* envoy_admin_v3_Listeners_add_listener_statuses(envoy_admin_v3_Listeners* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_ListenerStatus* sub = (struct envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.admin.v3.ListenerStatus */
+
+UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ListenerStatus*)_upb_Message_New(&envoy_admin_v3_ListenerStatus_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ListenerStatus* ret = envoy_admin_v3_ListenerStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ListenerStatus* ret = envoy_admin_v3_ListenerStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ListenerStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_ListenerStatus_serialize(const envoy_admin_v3_ListenerStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_ListenerStatus_serialize_ex(const envoy_admin_v3_ListenerStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_name(const envoy_admin_v3_ListenerStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ListenerStatus_name(const envoy_admin_v3_ListenerStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ListenerStatus_has_local_address(const envoy_admin_v3_ListenerStatus* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ListenerStatus_clear_local_address(const envoy_admin_v3_ListenerStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_admin_v3_ListenerStatus_local_address(const envoy_admin_v3_ListenerStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_Address*);
+}
+
+UPB_INLINE void envoy_admin_v3_ListenerStatus_set_name(envoy_admin_v3_ListenerStatus *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_ListenerStatus_set_local_address(envoy_admin_v3_ListenerStatus *msg, struct envoy_config_core_v3_Address* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Address*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_admin_v3_ListenerStatus_mutable_local_address(envoy_admin_v3_ListenerStatus* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_admin_v3_ListenerStatus_local_address(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ListenerStatus_set_local_address(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_listeners_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_LISTENERS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c
new file mode 100644
index 00000000..9b6c41f7
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/memory.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/memory.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field envoy_admin_v3_Memory__fields[6] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_Memory_msginit = {
+ NULL,
+ &envoy_admin_v3_Memory__fields[0],
+ UPB_SIZE(48, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_admin_v3_Memory_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_memory_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h
new file mode 100644
index 00000000..e1d6e7b9
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h
@@ -0,0 +1,124 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/memory.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_Memory;
+typedef struct envoy_admin_v3_Memory envoy_admin_v3_Memory;
+extern const upb_MiniTable envoy_admin_v3_Memory_msginit;
+
+
+
+/* envoy.admin.v3.Memory */
+
+UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_new(upb_Arena* arena) {
+ return (envoy_admin_v3_Memory*)_upb_Message_New(&envoy_admin_v3_Memory_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_Memory* ret = envoy_admin_v3_Memory_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_Memory* ret = envoy_admin_v3_Memory_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_Memory_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_Memory_serialize(const envoy_admin_v3_Memory* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Memory_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_Memory_serialize_ex(const envoy_admin_v3_Memory* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_Memory_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_allocated(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_allocated(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_heap_size(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_heap_size(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_unmapped(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_pageheap_unmapped(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_pageheap_free(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_pageheap_free(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_total_thread_cache(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_total_thread_cache(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_Memory_clear_total_physical_bytes(const envoy_admin_v3_Memory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_Memory_total_physical_bytes(const envoy_admin_v3_Memory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t);
+}
+
+UPB_INLINE void envoy_admin_v3_Memory_set_allocated(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_Memory_set_heap_size(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_Memory_set_pageheap_unmapped(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_Memory_set_pageheap_free(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_Memory_set_total_thread_cache(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_Memory_set_total_physical_bytes(envoy_admin_v3_Memory *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_memory_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_MEMORY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c
new file mode 100644
index 00000000..023d1135
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c
@@ -0,0 +1,43 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/metrics.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/metrics.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field envoy_admin_v3_SimpleMetric__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit = {
+ NULL,
+ &envoy_admin_v3_SimpleMetric__fields[0],
+ UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_admin_v3_SimpleMetric_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_metrics_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h
new file mode 100644
index 00000000..f20b5c73
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h
@@ -0,0 +1,102 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/metrics.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_SimpleMetric;
+typedef struct envoy_admin_v3_SimpleMetric envoy_admin_v3_SimpleMetric;
+extern const upb_MiniTable envoy_admin_v3_SimpleMetric_msginit;
+
+typedef enum {
+ envoy_admin_v3_SimpleMetric_COUNTER = 0,
+ envoy_admin_v3_SimpleMetric_GAUGE = 1
+} envoy_admin_v3_SimpleMetric_Type;
+
+
+
+/* envoy.admin.v3.SimpleMetric */
+
+UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_new(upb_Arena* arena) {
+ return (envoy_admin_v3_SimpleMetric*)_upb_Message_New(&envoy_admin_v3_SimpleMetric_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_SimpleMetric* ret = envoy_admin_v3_SimpleMetric_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_SimpleMetric* ret = envoy_admin_v3_SimpleMetric_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_SimpleMetric_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_SimpleMetric_serialize(const envoy_admin_v3_SimpleMetric* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_SimpleMetric_serialize_ex(const envoy_admin_v3_SimpleMetric* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_type(const envoy_admin_v3_SimpleMetric* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_SimpleMetric_type(const envoy_admin_v3_SimpleMetric* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_value(const envoy_admin_v3_SimpleMetric* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_SimpleMetric_value(const envoy_admin_v3_SimpleMetric* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_SimpleMetric_clear_name(const envoy_admin_v3_SimpleMetric* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_SimpleMetric_name(const envoy_admin_v3_SimpleMetric* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+
+UPB_INLINE void envoy_admin_v3_SimpleMetric_set_type(envoy_admin_v3_SimpleMetric *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_SimpleMetric_set_value(envoy_admin_v3_SimpleMetric *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_SimpleMetric_set_name(envoy_admin_v3_SimpleMetric *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_metrics_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_METRICS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c
new file mode 100644
index 00000000..39033342
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c
@@ -0,0 +1,43 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/mutex_stats.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/mutex_stats.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field envoy_admin_v3_MutexStats__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_MutexStats_msginit = {
+ NULL,
+ &envoy_admin_v3_MutexStats__fields[0],
+ UPB_SIZE(24, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_admin_v3_MutexStats_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_mutex_stats_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h
new file mode 100644
index 00000000..abfe6e2f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h
@@ -0,0 +1,97 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/mutex_stats.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_MutexStats;
+typedef struct envoy_admin_v3_MutexStats envoy_admin_v3_MutexStats;
+extern const upb_MiniTable envoy_admin_v3_MutexStats_msginit;
+
+
+
+/* envoy.admin.v3.MutexStats */
+
+UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_new(upb_Arena* arena) {
+ return (envoy_admin_v3_MutexStats*)_upb_Message_New(&envoy_admin_v3_MutexStats_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_MutexStats* ret = envoy_admin_v3_MutexStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_MutexStats* ret = envoy_admin_v3_MutexStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_MutexStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_MutexStats_serialize(const envoy_admin_v3_MutexStats* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_MutexStats_serialize_ex(const envoy_admin_v3_MutexStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_MutexStats_clear_num_contentions(const envoy_admin_v3_MutexStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_MutexStats_num_contentions(const envoy_admin_v3_MutexStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_MutexStats_clear_current_wait_cycles(const envoy_admin_v3_MutexStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_MutexStats_current_wait_cycles(const envoy_admin_v3_MutexStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_MutexStats_clear_lifetime_wait_cycles(const envoy_admin_v3_MutexStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_MutexStats_lifetime_wait_cycles(const envoy_admin_v3_MutexStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t);
+}
+
+UPB_INLINE void envoy_admin_v3_MutexStats_set_num_contentions(envoy_admin_v3_MutexStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_MutexStats_set_current_wait_cycles(envoy_admin_v3_MutexStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_MutexStats_set_lifetime_wait_cycles(envoy_admin_v3_MutexStats *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_mutex_stats_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c
new file mode 100644
index 00000000..dc761de6
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c
@@ -0,0 +1,106 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/server_info.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/server_info.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_admin_v3_ServerInfo_submsgs[4] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_admin_v3_CommandLineOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_ServerInfo__fields[7] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_ServerInfo_msginit = {
+ &envoy_admin_v3_ServerInfo_submsgs[0],
+ &envoy_admin_v3_ServerInfo__fields[0],
+ UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_admin_v3_CommandLineOptions_submsgs[3] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_CommandLineOptions__fields[34] = {
+ {1, UPB_SIZE(168, 288), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(52, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(60, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(68, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(76, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(84, 120), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(92, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(100, 152), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(108, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(116, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(124, 200), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(132, 216), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(136, 224), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(140, 232), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(28, 28), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(29, 29), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(30, 30), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(144, 240), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(31, 31), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {32, UPB_SIZE(148, 248), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {33, UPB_SIZE(36, 36), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {34, UPB_SIZE(40, 40), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {35, UPB_SIZE(156, 264), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {36, UPB_SIZE(44, 44), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {37, UPB_SIZE(48, 48), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {38, UPB_SIZE(164, 280), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_CommandLineOptions_msginit = {
+ &envoy_admin_v3_CommandLineOptions_submsgs[0],
+ &envoy_admin_v3_CommandLineOptions__fields[0],
+ UPB_SIZE(176, 296), 34, kUpb_ExtMode_NonExtendable, 11, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_admin_v3_ServerInfo_msginit,
+ &envoy_admin_v3_CommandLineOptions_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_server_info_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h
new file mode 100644
index 00000000..c6ada103
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h
@@ -0,0 +1,605 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/server_info.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_ServerInfo;
+struct envoy_admin_v3_CommandLineOptions;
+typedef struct envoy_admin_v3_ServerInfo envoy_admin_v3_ServerInfo;
+typedef struct envoy_admin_v3_CommandLineOptions envoy_admin_v3_CommandLineOptions;
+extern const upb_MiniTable envoy_admin_v3_ServerInfo_msginit;
+extern const upb_MiniTable envoy_admin_v3_CommandLineOptions_msginit;
+struct envoy_config_core_v3_Node;
+struct google_protobuf_Duration;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+
+typedef enum {
+ envoy_admin_v3_CommandLineOptions_Gradual = 0,
+ envoy_admin_v3_CommandLineOptions_Immediate = 1
+} envoy_admin_v3_CommandLineOptions_DrainStrategy;
+
+typedef enum {
+ envoy_admin_v3_CommandLineOptions_v4 = 0,
+ envoy_admin_v3_CommandLineOptions_v6 = 1
+} envoy_admin_v3_CommandLineOptions_IpVersion;
+
+typedef enum {
+ envoy_admin_v3_CommandLineOptions_Serve = 0,
+ envoy_admin_v3_CommandLineOptions_Validate = 1,
+ envoy_admin_v3_CommandLineOptions_InitOnly = 2
+} envoy_admin_v3_CommandLineOptions_Mode;
+
+typedef enum {
+ envoy_admin_v3_ServerInfo_LIVE = 0,
+ envoy_admin_v3_ServerInfo_DRAINING = 1,
+ envoy_admin_v3_ServerInfo_PRE_INITIALIZING = 2,
+ envoy_admin_v3_ServerInfo_INITIALIZING = 3
+} envoy_admin_v3_ServerInfo_State;
+
+
+
+/* envoy.admin.v3.ServerInfo */
+
+UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_new(upb_Arena* arena) {
+ return (envoy_admin_v3_ServerInfo*)_upb_Message_New(&envoy_admin_v3_ServerInfo_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_ServerInfo* ret = envoy_admin_v3_ServerInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_ServerInfo* ret = envoy_admin_v3_ServerInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_ServerInfo_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_ServerInfo_serialize(const envoy_admin_v3_ServerInfo* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_ServerInfo_serialize_ex(const envoy_admin_v3_ServerInfo* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_version(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ServerInfo_version(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_state(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_ServerInfo_state(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_uptime_current_epoch(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_admin_v3_ServerInfo_has_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_uptime_all_epochs(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_hot_restart_version(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_ServerInfo_hot_restart_version(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_ServerInfo_has_command_line_options(const envoy_admin_v3_ServerInfo* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_command_line_options(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_admin_v3_CommandLineOptions* envoy_admin_v3_ServerInfo_command_line_options(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_admin_v3_CommandLineOptions*);
+}
+UPB_INLINE bool envoy_admin_v3_ServerInfo_has_node(const envoy_admin_v3_ServerInfo* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_clear_node(const envoy_admin_v3_ServerInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_admin_v3_ServerInfo_node(const envoy_admin_v3_ServerInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_config_core_v3_Node*);
+}
+
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_version(envoy_admin_v3_ServerInfo *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_state(envoy_admin_v3_ServerInfo *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_uptime_current_epoch(envoy_admin_v3_ServerInfo *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_mutable_uptime_current_epoch(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_ServerInfo_uptime_current_epoch(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ServerInfo_set_uptime_current_epoch(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_uptime_all_epochs(envoy_admin_v3_ServerInfo *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_ServerInfo_mutable_uptime_all_epochs(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_ServerInfo_uptime_all_epochs(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ServerInfo_set_uptime_all_epochs(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_hot_restart_version(envoy_admin_v3_ServerInfo *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_command_line_options(envoy_admin_v3_ServerInfo *msg, envoy_admin_v3_CommandLineOptions* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_admin_v3_CommandLineOptions*) = value;
+}
+UPB_INLINE struct envoy_admin_v3_CommandLineOptions* envoy_admin_v3_ServerInfo_mutable_command_line_options(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_CommandLineOptions* sub = (struct envoy_admin_v3_CommandLineOptions*)envoy_admin_v3_ServerInfo_command_line_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ServerInfo_set_command_line_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_ServerInfo_set_node(envoy_admin_v3_ServerInfo *msg, struct envoy_config_core_v3_Node* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_config_core_v3_Node*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_admin_v3_ServerInfo_mutable_node(envoy_admin_v3_ServerInfo* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_admin_v3_ServerInfo_node(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_ServerInfo_set_node(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.admin.v3.CommandLineOptions */
+
+UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_new(upb_Arena* arena) {
+ return (envoy_admin_v3_CommandLineOptions*)_upb_Message_New(&envoy_admin_v3_CommandLineOptions_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_CommandLineOptions* ret = envoy_admin_v3_CommandLineOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_CommandLineOptions* ret = envoy_admin_v3_CommandLineOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_CommandLineOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_CommandLineOptions_serialize(const envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_CommandLineOptions_serialize_ex(const envoy_admin_v3_CommandLineOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_base_id(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_admin_v3_CommandLineOptions_base_id(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(168, 288), uint64_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_concurrency(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_concurrency(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_config_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_config_yaml(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_config_yaml(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_allow_unknown_static_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_allow_unknown_static_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_admin_address_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_admin_address_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_local_address_ip_version(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_local_address_ip_version(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_level(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_level(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_component_log_level(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_component_log_level(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_format(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_log_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_cluster(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_cluster(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_node(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_node(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_service_zone(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_service_zone(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_file_flush_interval(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_drain_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_drain_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_has_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_parent_shutdown_time(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_mode(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_mode(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disable_hot_restart(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_disable_hot_restart(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_mutex_tracing(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_mutex_tracing(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_restart_epoch(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_restart_epoch(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_cpuset_threads(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_cpuset_threads(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_reject_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_reject_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_log_format_escaped(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_log_format_escaped(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(144, 240));
+}
+UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_disabled_extensions(const envoy_admin_v3_CommandLineOptions* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(144, 240), len);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_ignore_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_ignore_unknown_dynamic_fields(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_use_dynamic_base_id(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_use_dynamic_base_id(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_base_id_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_base_id_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_drain_strategy(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_admin_v3_CommandLineOptions_drain_strategy(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_fine_grain_logging(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_fine_grain_logging(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_CommandLineOptions_socket_path(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_socket_mode(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_admin_v3_CommandLineOptions_socket_mode(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_enable_core_dump(const envoy_admin_v3_CommandLineOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = 0;
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_enable_core_dump(const envoy_admin_v3_CommandLineOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_clear_stats_tag(const envoy_admin_v3_CommandLineOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(164, 280));
+}
+UPB_INLINE upb_StringView const* envoy_admin_v3_CommandLineOptions_stats_tag(const envoy_admin_v3_CommandLineOptions* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(164, 280), len);
+}
+
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_base_id(envoy_admin_v3_CommandLineOptions *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), uint64_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_concurrency(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_config_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_config_yaml(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 72), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_allow_unknown_static_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_admin_address_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_local_address_ip_version(envoy_admin_v3_CommandLineOptions *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_level(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_component_log_level(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 120), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_format(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 136), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 152), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_cluster(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_node(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_service_zone(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_file_flush_interval(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_file_flush_interval(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_file_flush_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CommandLineOptions_set_file_flush_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_drain_time(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 224), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_drain_time(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_drain_time(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CommandLineOptions_set_drain_time(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_parent_shutdown_time(envoy_admin_v3_CommandLineOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 232), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_admin_v3_CommandLineOptions_mutable_parent_shutdown_time(envoy_admin_v3_CommandLineOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_admin_v3_CommandLineOptions_parent_shutdown_time(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_CommandLineOptions_set_parent_shutdown_time(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_mode(envoy_admin_v3_CommandLineOptions *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_disable_hot_restart(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_mutex_tracing(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_restart_epoch(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_cpuset_threads(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_reject_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_log_format_escaped(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = value;
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(144, 240), len);
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(144, 240), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_add_disabled_extensions(envoy_admin_v3_CommandLineOptions* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(144, 240), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_ignore_unknown_dynamic_fields(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_use_dynamic_base_id(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_base_id_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_drain_strategy(envoy_admin_v3_CommandLineOptions *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 36), int32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_fine_grain_logging(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 40), bool) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_socket_path(envoy_admin_v3_CommandLineOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_socket_mode(envoy_admin_v3_CommandLineOptions *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 44), uint32_t) = value;
+}
+UPB_INLINE void envoy_admin_v3_CommandLineOptions_set_enable_core_dump(envoy_admin_v3_CommandLineOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_mutable_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(164, 280), len);
+}
+UPB_INLINE upb_StringView* envoy_admin_v3_CommandLineOptions_resize_stats_tag(envoy_admin_v3_CommandLineOptions* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(164, 280), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_admin_v3_CommandLineOptions_add_stats_tag(envoy_admin_v3_CommandLineOptions* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(164, 280), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_server_info_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c b/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c
new file mode 100644
index 00000000..4b0e8e2e
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c
@@ -0,0 +1,48 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/tap.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/admin/v3/tap.upb.h"
+#include "envoy/config/tap/v3/common.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_MiniTable_Sub envoy_admin_v3_TapRequest_submsgs[1] = {
+ {.submsg = &envoy_config_tap_v3_TapConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_admin_v3_TapRequest__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_admin_v3_TapRequest_msginit = {
+ &envoy_admin_v3_TapRequest_submsgs[0],
+ &envoy_admin_v3_TapRequest__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_admin_v3_TapRequest_msginit,
+};
+
+const upb_MiniTable_File envoy_admin_v3_tap_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h b/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h
new file mode 100644
index 00000000..0cb7a3f2
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h
@@ -0,0 +1,103 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/tap.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_
+#define ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_admin_v3_TapRequest;
+typedef struct envoy_admin_v3_TapRequest envoy_admin_v3_TapRequest;
+extern const upb_MiniTable envoy_admin_v3_TapRequest_msginit;
+struct envoy_config_tap_v3_TapConfig;
+extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit;
+
+
+
+/* envoy.admin.v3.TapRequest */
+
+UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_new(upb_Arena* arena) {
+ return (envoy_admin_v3_TapRequest*)_upb_Message_New(&envoy_admin_v3_TapRequest_msginit, arena);
+}
+UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_admin_v3_TapRequest* ret = envoy_admin_v3_TapRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_admin_v3_TapRequest* ret = envoy_admin_v3_TapRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_admin_v3_TapRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_admin_v3_TapRequest_serialize(const envoy_admin_v3_TapRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_admin_v3_TapRequest_serialize_ex(const envoy_admin_v3_TapRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_admin_v3_TapRequest_clear_config_id(const envoy_admin_v3_TapRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_admin_v3_TapRequest_config_id(const envoy_admin_v3_TapRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_admin_v3_TapRequest_has_tap_config(const envoy_admin_v3_TapRequest* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_admin_v3_TapRequest_clear_tap_config(const envoy_admin_v3_TapRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_tap_v3_TapConfig* envoy_admin_v3_TapRequest_tap_config(const envoy_admin_v3_TapRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_tap_v3_TapConfig*);
+}
+
+UPB_INLINE void envoy_admin_v3_TapRequest_set_config_id(envoy_admin_v3_TapRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_admin_v3_TapRequest_set_tap_config(envoy_admin_v3_TapRequest *msg, struct envoy_config_tap_v3_TapConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_tap_v3_TapConfig*) = value;
+}
+UPB_INLINE struct envoy_config_tap_v3_TapConfig* envoy_admin_v3_TapRequest_mutable_tap_config(envoy_admin_v3_TapRequest* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_TapConfig* sub = (struct envoy_config_tap_v3_TapConfig*)envoy_admin_v3_TapRequest_tap_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_admin_v3_TapRequest_set_tap_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_admin_v3_tap_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_TAP_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c b/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
index 007de310..d91566cb 100644
--- a/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
@@ -7,11 +7,54 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/annotations/deprecation.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_ext = {
+ {189503207, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_ext = {
+ {157299826, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_enum_ext = {
+ {70100853, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_enum_ext = {
+ {181198657, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = NULL},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[4] = {
+ &envoy_annotations_disallowed_by_default_ext,
+ &envoy_annotations_deprecated_at_minor_version_ext,
+ &envoy_annotations_disallowed_by_default_enum_ext,
+ &envoy_annotations_deprecated_at_minor_version_enum_ext,
+};
+
+const upb_MiniTable_File envoy_annotations_deprecation_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ extensions_layout,
+ 0,
+ 0,
+ 4,
+};
+
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h b/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
index 1478843b..bec105c1 100644
--- a/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
#define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,57 @@
extern "C" {
#endif
+extern const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_ext;
+extern const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_ext;
+extern const upb_MiniTable_Extension envoy_annotations_disallowed_by_default_enum_ext;
+extern const upb_MiniTable_Extension envoy_annotations_deprecated_at_minor_version_enum_ext;
+struct google_protobuf_EnumValueOptions;
+struct google_protobuf_FieldOptions;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+
+
+UPB_INLINE bool envoy_annotations_has_disallowed_by_default(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_ext) != NULL;
+}
+UPB_INLINE void envoy_annotations_clear_disallowed_by_default(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &envoy_annotations_disallowed_by_default_ext);
+}
+UPB_INLINE bool envoy_annotations_disallowed_by_default(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_ext) != NULL;
+}
+UPB_INLINE void envoy_annotations_clear_deprecated_at_minor_version(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &envoy_annotations_deprecated_at_minor_version_ext);
+}
+UPB_INLINE upb_StringView envoy_annotations_deprecated_at_minor_version(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, upb_StringView) : upb_StringView_FromString("");
+}
+UPB_INLINE bool envoy_annotations_has_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions* msg) {
+ return _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_enum_ext) != NULL;
+}
+UPB_INLINE void envoy_annotations_clear_disallowed_by_default_enum(struct google_protobuf_EnumValueOptions* msg) {
+ _upb_Message_Clearext(msg, &envoy_annotations_disallowed_by_default_enum_ext);
+}
+UPB_INLINE bool envoy_annotations_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_disallowed_by_default_enum_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions* msg) {
+ return _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext) != NULL;
+}
+UPB_INLINE void envoy_annotations_clear_deprecated_at_minor_version_enum(struct google_protobuf_EnumValueOptions* msg) {
+ _upb_Message_Clearext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext);
+}
+UPB_INLINE upb_StringView envoy_annotations_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, upb_StringView) : upb_StringView_FromString("");
+}
+extern const upb_MiniTable_File envoy_annotations_deprecation_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c b/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
index 8f1877d1..9dcb83f1 100644
--- a/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
@@ -7,20 +7,46 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field envoy_annotations_ResourceAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_annotations_ResourceAnnotation_msginit = {
+const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit = {
NULL,
&envoy_annotations_ResourceAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_annotations_ResourceAnnotation_msginit,
+};
+
+extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit;
+extern const upb_MiniTable google_protobuf_ServiceOptions_msginit;
+const upb_MiniTable_Extension envoy_annotations_resource_ext = {
+ {265073217, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_ServiceOptions_msginit,
+ {.submsg = &envoy_annotations_ResourceAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &envoy_annotations_resource_ext,
+};
+
+const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h b/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
index 534eef36..9fed463f 100644
--- a/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
#define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,34 +22,73 @@ extern "C" {
struct envoy_annotations_ResourceAnnotation;
typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation;
-extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
+extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit;
+extern const upb_MiniTable_Extension envoy_annotations_resource_ext;
+struct google_protobuf_ServiceOptions;
+extern const upb_MiniTable google_protobuf_ServiceOptions_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_new(upb_Arena* arena) {
+ return (envoy_annotations_ResourceAnnotation*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_annotations_ResourceAnnotation* ret = envoy_annotations_ResourceAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
}
-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_ex(const envoy_annotations_ResourceAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, options, arena, len);
}
-UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_annotations_ResourceAnnotation *ret = envoy_annotations_ResourceAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE void envoy_annotations_ResourceAnnotation_clear_type(const envoy_annotations_ResourceAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-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_StringView envoy_annotations_ResourceAnnotation_type(const envoy_annotations_ResourceAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
-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;
+UPB_INLINE bool envoy_annotations_has_resource(const struct google_protobuf_ServiceOptions* msg) {
+ return _upb_Message_Getext(msg, &envoy_annotations_resource_ext) != NULL;
+}
+UPB_INLINE void envoy_annotations_clear_resource(struct google_protobuf_ServiceOptions* msg) {
+ _upb_Message_Clearext(msg, &envoy_annotations_resource_ext);
+}
+UPB_INLINE const envoy_annotations_ResourceAnnotation* envoy_annotations_resource(const struct google_protobuf_ServiceOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_resource_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const envoy_annotations_ResourceAnnotation*);
+}
+UPB_INLINE void envoy_annotations_set_resource(struct google_protobuf_ServiceOptions* msg, const envoy_annotations_ResourceAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &envoy_annotations_resource_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const envoy_annotations_ResourceAnnotation*) = ext;
}
+extern const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
index fa6dcbc1..e89226bf 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -21,222 +21,249 @@
#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_MiniTable_Sub envoy_config_accesslog_v3_AccessLog_submsgs[2] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_AccessLog__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_AccessLog__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-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 = {
+ UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = {
+ {.submsg = &envoy_config_accesslog_v3_StatusCodeFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_DurationFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_TraceableFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_RuntimeFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_AndFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_OrFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_HeaderFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_ResponseFlagFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_GrpcStatusFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_ExtensionFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_MetadataFilter_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_accesslog_v3_AccessLogFilter__fields[12] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
- &envoy_config_core_v3_RuntimeUInt32_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_RuntimeUInt32_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msginit = {
&envoy_config_accesslog_v3_StatusCodeFilter_submsgs[0],
&envoy_config_accesslog_v3_StatusCodeFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_DurationFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_DurationFilter__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msginit = {
&envoy_config_accesslog_v3_DurationFilter_submsgs[0],
&envoy_config_accesslog_v3_DurationFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
+ {.submsg = &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), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_RuntimeFilter__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_AndFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msginit = {
&envoy_config_accesslog_v3_AndFilter_submsgs[0],
&envoy_config_accesslog_v3_AndFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_OrFilter__fields[1] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msginit = {
&envoy_config_accesslog_v3_OrFilter_submsgs[0],
&envoy_config_accesslog_v3_OrFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_HeaderFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_HeaderFilter__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msginit = {
&envoy_config_accesslog_v3_HeaderFilter_submsgs[0],
&envoy_config_accesslog_v3_HeaderFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msginit = {
NULL,
&envoy_config_accesslog_v3_ResponseFlagFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msginit = {
NULL,
&envoy_config_accesslog_v3_GrpcStatusFilter__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_accesslog_v3_MetadataFilter__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_MetadataFilter__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit = {
+const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msginit = {
&envoy_config_accesslog_v3_MetadataFilter_submsgs[0],
&envoy_config_accesslog_v3_MetadataFilter__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_accesslog_v3_ExtensionFilter__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[15] = {
+ &envoy_config_accesslog_v3_AccessLog_msginit,
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+ &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+ &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
+ &envoy_config_accesslog_v3_DurationFilter_msginit,
+ &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
+ &envoy_config_accesslog_v3_TraceableFilter_msginit,
+ &envoy_config_accesslog_v3_RuntimeFilter_msginit,
+ &envoy_config_accesslog_v3_AndFilter_msginit,
+ &envoy_config_accesslog_v3_OrFilter_msginit,
+ &envoy_config_accesslog_v3_HeaderFilter_msginit,
+ &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
+ &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
+ &envoy_config_accesslog_v3_MetadataFilter_msginit,
+ &envoy_config_accesslog_v3_ExtensionFilter_msginit,
+};
+
+const upb_MiniTable_File envoy_config_accesslog_v3_accesslog_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 15,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
index 8e33c869..1a6ac6fb 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
#define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -50,33 +50,33 @@ typedef struct envoy_config_accesslog_v3_ResponseFlagFilter envoy_config_accessl
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;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_ComparisonFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_StatusCodeFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_DurationFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_RuntimeFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AndFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_OrFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_HeaderFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_MetadataFilter_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
typedef enum {
envoy_config_accesslog_v3_ComparisonFilter_EQ = 0,
@@ -105,61 +105,93 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_AccessLog*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_AccessLog_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_AccessLog* ret = envoy_config_accesslog_v3_AccessLog_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_accesslog_v3_AccessLog_serialize_ex(const envoy_config_accesslog_v3_AccessLog* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, options, 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(20, 40), 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(20, 40)) == 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(16, 32), UPB_SIZE(20, 40), 4, NULL); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_name(const envoy_config_accesslog_v3_AccessLog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_accesslog_v3_AccessLog_name(const envoy_config_accesslog_v3_AccessLog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_AccessLog_has_filter(const envoy_config_accesslog_v3_AccessLog* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_filter(const envoy_config_accesslog_v3_AccessLog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), 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(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_clear_typed_config(const envoy_config_accesslog_v3_AccessLog* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_accesslog_v3_AccessLog_config_type_NOT_SET);
+}
+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(20, 32), UPB_SIZE(4, 4), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_name(envoy_config_accesslog_v3_AccessLog *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_accesslog_v3_AccessLog_set_filter(envoy_config_accesslog_v3_AccessLog *msg, envoy_config_accesslog_v3_AccessLogFilter* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_accesslog_v3_AccessLogFilter*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_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(16, 32), value, UPB_SIZE(20, 40), 4);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 4);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutable_typed_config(envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_AccessLog_set_typed_config(msg, sub);
}
@@ -168,24 +200,35 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_AccessLog_mutab
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_AccessLogFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_AccessLogFilter* ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_accesslog_v3_AccessLogFilter_serialize_ex(const envoy_config_accesslog_v3_AccessLogFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, options, 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,
@@ -201,172 +244,257 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_status_code_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_duration_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_not_health_check_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_traceable_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_runtime_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_and_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_or_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_header_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_response_flag_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 10;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_grpc_status_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 11;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_extension_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 12;
+}
+UPB_INLINE void envoy_config_accesslog_v3_AccessLogFilter_clear_metadata_filter(const envoy_config_accesslog_v3_AccessLogFilter* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_StatusCodeFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_DurationFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_DurationFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_NotHealthCheckFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_TraceableFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_RuntimeFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_AndFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_AndFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_OrFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_OrFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_HeaderFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ResponseFlagFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_GrpcStatusFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_ExtensionFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_accesslog_v3_MetadataFilter*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_New(&envoy_config_accesslog_v3_MetadataFilter_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_AccessLogFilter_set_metadata_filter(msg, sub);
}
@@ -375,27 +503,50 @@ UPB_INLINE struct envoy_config_accesslog_v3_MetadataFilter* envoy_config_accessl
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3_ComparisonFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_ComparisonFilter* ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_ComparisonFilter_serialize_ex(const envoy_config_accesslog_v3_ComparisonFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_clear_op(const envoy_config_accesslog_v3_ComparisonFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_accesslog_v3_ComparisonFilter_op(const envoy_config_accesslog_v3_ComparisonFilter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_clear_value(const envoy_config_accesslog_v3_ComparisonFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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 int32_t envoy_config_accesslog_v3_ComparisonFilter_op(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_accesslog_v3_ComparisonFilter_has_value(const envoy_config_accesslog_v3_ComparisonFilter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 4), int32_t) = value;
@@ -404,10 +555,10 @@ UPB_INLINE void envoy_config_accesslog_v3_ComparisonFilter_set_value(envoy_confi
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeUInt32*)_upb_Message_New(&envoy_config_core_v3_RuntimeUInt32_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_ComparisonFilter_set_value(msg, sub);
}
@@ -416,35 +567,53 @@ UPB_INLINE struct envoy_config_core_v3_RuntimeUInt32* envoy_config_accesslog_v3_
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_StatusCodeFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3_StatusCodeFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_StatusCodeFilter* ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_StatusCodeFilter_serialize_ex(const envoy_config_accesslog_v3_StatusCodeFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_StatusCodeFilter_clear_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_config_accesslog_v3_ComparisonFilter*);
}
-
-UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_StatusCodeFilter_set_comparison(msg, sub);
}
@@ -453,35 +622,53 @@ UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_acces
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_DurationFilter*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_DurationFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_DurationFilter* ret = envoy_config_accesslog_v3_DurationFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_accesslog_v3_DurationFilter_serialize_ex(const envoy_config_accesslog_v3_DurationFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_DurationFilter_clear_comparison(const envoy_config_accesslog_v3_DurationFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_config_accesslog_v3_ComparisonFilter*);
}
-
-UPB_INLINE bool envoy_config_accesslog_v3_DurationFilter_has_comparison(const envoy_config_accesslog_v3_DurationFilter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_ComparisonFilter*)_upb_Message_New(&envoy_config_accesslog_v3_ComparisonFilter_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_DurationFilter_set_comparison(msg, sub);
}
@@ -490,84 +677,134 @@ UPB_INLINE struct envoy_config_accesslog_v3_ComparisonFilter* envoy_config_acces
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_NotHealthCheckFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslog_v3_NotHealthCheckFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_NotHealthCheckFilter* ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_accesslog_v3_NotHealthCheckFilter_serialize_ex(const envoy_config_accesslog_v3_NotHealthCheckFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_TraceableFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_TraceableFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_TraceableFilter* ret = envoy_config_accesslog_v3_TraceableFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_accesslog_v3_TraceableFilter_serialize_ex(const envoy_config_accesslog_v3_TraceableFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_RuntimeFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_RuntimeFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_RuntimeFilter* ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_RuntimeFilter_serialize_ex(const envoy_config_accesslog_v3_RuntimeFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_runtime_key(const envoy_config_accesslog_v3_RuntimeFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_accesslog_v3_RuntimeFilter_runtime_key(const envoy_config_accesslog_v3_RuntimeFilter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_RuntimeFilter_has_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_clear_percent_sampled(const envoy_config_accesslog_v3_RuntimeFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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 void envoy_config_accesslog_v3_RuntimeFilter_clear_use_independent_randomness(const envoy_config_accesslog_v3_RuntimeFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
}
-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_hasbit(msg, 1); }
-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(1, 1), 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_runtime_key(envoy_config_accesslog_v3_RuntimeFilter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_RuntimeFilter_set_percent_sampled(msg, sub);
}
@@ -579,109 +816,161 @@ UPB_INLINE void envoy_config_accesslog_v3_RuntimeFilter_set_use_independent_rand
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_AndFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_AndFilter* ret = envoy_config_accesslog_v3_AndFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_AndFilter_serialize_ex(const envoy_config_accesslog_v3_AndFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, options, 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 void envoy_config_accesslog_v3_AndFilter_clear_filters(const envoy_config_accesslog_v3_AndFilter* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_OrFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_OrFilter* ret = envoy_config_accesslog_v3_OrFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_OrFilter_serialize_ex(const envoy_config_accesslog_v3_OrFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, options, 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 void envoy_config_accesslog_v3_OrFilter_clear_filters(const envoy_config_accesslog_v3_OrFilter* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_accesslog_v3_AccessLogFilter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_HeaderFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_HeaderFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_HeaderFilter* ret = envoy_config_accesslog_v3_HeaderFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_HeaderFilter_serialize_ex(const envoy_config_accesslog_v3_HeaderFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_HeaderFilter_clear_header(const envoy_config_accesslog_v3_HeaderFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_route_v3_HeaderMatcher*);
}
-
-UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_HeaderFilter_set_header(msg, sub);
}
@@ -690,69 +979,104 @@ UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_accesslog_v3
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_ResponseFlagFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_v3_ResponseFlagFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_ResponseFlagFilter* ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_ResponseFlagFilter_serialize_ex(const envoy_config_accesslog_v3_ResponseFlagFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_accesslog_v3_ResponseFlagFilter_clear_flags(const envoy_config_accesslog_v3_ResponseFlagFilter* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE upb_StringView const* envoy_config_accesslog_v3_ResponseFlagFilter_flags(const envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), 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_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_mutable_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_accesslog_v3_ResponseFlagFilter_resize_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_accesslog_v3_ResponseFlagFilter_add_flags(envoy_config_accesslog_v3_ResponseFlagFilter* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_GrpcStatusFilter*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3_GrpcStatusFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_GrpcStatusFilter* ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_accesslog_v3_GrpcStatusFilter_serialize_ex(const envoy_config_accesslog_v3_GrpcStatusFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, options, arena, len);
}
-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 void envoy_config_accesslog_v3_GrpcStatusFilter_clear_statuses(const envoy_config_accesslog_v3_GrpcStatusFilter* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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 void envoy_config_accesslog_v3_GrpcStatusFilter_clear_exclude(const envoy_config_accesslog_v3_GrpcStatusFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 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) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, 2, 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_accessor2(msg, UPB_SIZE(4, 8), 2, &val,
- 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_accessor2(msg, UPB_SIZE(4, 8), 2, &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;
@@ -760,37 +1084,62 @@ UPB_INLINE void envoy_config_accesslog_v3_GrpcStatusFilter_set_exclude(envoy_con
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_MetadataFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_MetadataFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_MetadataFilter* ret = envoy_config_accesslog_v3_MetadataFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_accesslog_v3_MetadataFilter_serialize_ex(const envoy_config_accesslog_v3_MetadataFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_clear_match_if_key_not_found(const envoy_config_accesslog_v3_MetadataFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_BoolValue*);
}
-
-UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_MetadataFilter_set_matcher(msg, sub);
}
@@ -800,10 +1149,10 @@ UPB_INLINE void envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_fo
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_MetadataFilter_set_match_if_key_not_found(msg, sub);
}
@@ -812,50 +1161,76 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_accesslog_v3_MetadataF
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_accesslog_v3_ExtensionFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ExtensionFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_accesslog_v3_ExtensionFilter* ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_accesslog_v3_ExtensionFilter_serialize_ex(const envoy_config_accesslog_v3_ExtensionFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_name(const envoy_config_accesslog_v3_ExtensionFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_accesslog_v3_ExtensionFilter_name(const envoy_config_accesslog_v3_ExtensionFilter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_accesslog_v3_ExtensionFilter_has_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_accesslog_v3_ExtensionFilter_clear_typed_config(const envoy_config_accesslog_v3_ExtensionFilter* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_accesslog_v3_ExtensionFilter_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter_mutable_typed_config(envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_accesslog_v3_ExtensionFilter_set_typed_config(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_accesslog_v3_accesslog_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
index b7f9387b..f9ef30b4 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
@@ -7,14 +7,16 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
+#include "envoy/config/accesslog/v3/accesslog.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/event_service_config.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/resolver.upb.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "envoy/config/listener/v3/listener.upb.h"
#include "envoy/config/metrics/v3/stats.upb.h"
@@ -25,6 +27,7 @@
#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/security.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -33,317 +36,375 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_submsgs[19] = {
- &envoy_config_bootstrap_v3_Admin_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_msginit,
- &envoy_config_bootstrap_v3_FatalAction_msginit,
- &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
- &envoy_config_bootstrap_v3_Watchdog_msginit,
- &envoy_config_bootstrap_v3_Watchdogs_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_metrics_v3_StatsConfig_msginit,
- &envoy_config_metrics_v3_StatsSink_msginit,
- &envoy_config_overload_v3_OverloadManager_msginit,
- &envoy_config_trace_v3_Tracing_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt64Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap__fields[27] = {
- {1, UPB_SIZE(28, 56), 1, 11, 11, 1},
- {2, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {3, UPB_SIZE(36, 72), 3, 2, 11, 1},
- {4, UPB_SIZE(40, 80), 4, 4, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {6, UPB_SIZE(88, 176), 0, 14, 11, 3},
- {7, UPB_SIZE(44, 88), 5, 17, 11, 1},
- {8, UPB_SIZE(48, 96), 6, 7, 11, 1},
- {9, UPB_SIZE(52, 104), 7, 16, 11, 1},
- {12, UPB_SIZE(56, 112), 8, 0, 11, 1},
- {13, UPB_SIZE(60, 120), 9, 13, 11, 1},
- {14, UPB_SIZE(64, 128), 10, 9, 11, 1},
- {15, UPB_SIZE(68, 136), 11, 15, 11, 1},
- {16, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {17, UPB_SIZE(72, 144), 12, 6, 11, 1},
- {18, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {19, UPB_SIZE(76, 152), 13, 18, 11, 1},
- {20, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {21, UPB_SIZE(92, 184), 0, 12, 11, 3},
- {22, UPB_SIZE(96, 192), 0, 10, 11, 3},
- {23, UPB_SIZE(80, 160), 14, 10, 11, 1},
- {24, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {25, UPB_SIZE(100, 200), 0, 1, 11, _UPB_LABEL_MAP},
- {26, UPB_SIZE(104, 208), 0, 0, 9, 3},
- {27, UPB_SIZE(84, 168), 15, 8, 11, 1},
- {28, UPB_SIZE(108, 216), 0, 5, 11, 3},
- {29, UPB_SIZE(112, 224), UPB_SIZE(-117, -229), 0, 8, 1},
-};
-
-const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit = {
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_submsgs[23] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_ClusterManager_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsSink_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit},
+ {.submsg = &envoy_config_trace_v3_Tracing_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Admin_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsConfig_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_overload_v3_OverloadManager_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_LayeredRuntime_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdogs_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_FatalAction_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_CustomInlineHeader_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap__fields[31] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(44, 80), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(48, 88), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(52, 96), UPB_SIZE(8, 8), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(56, 104), UPB_SIZE(9, 9), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(60, 112), UPB_SIZE(10, 10), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(64, 120), UPB_SIZE(11, 11), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(68, 128), UPB_SIZE(12, 12), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(72, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(80, 152), UPB_SIZE(13, 13), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(5, 5), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(84, 160), UPB_SIZE(0, 0), 14, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(88, 168), UPB_SIZE(0, 0), 15, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(92, 176), UPB_SIZE(14, 14), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(96, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(104, 200), UPB_SIZE(0, 0), 17, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(108, 208), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(112, 216), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(116, 224), UPB_SIZE(0, 0), 19, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {29, UPB_SIZE(3, 3), UPB_SIZE(-9, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(120, 232), UPB_SIZE(16, 16), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(124, 240), UPB_SIZE(17, 17), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {32, UPB_SIZE(128, 248), UPB_SIZE(0, 0), 22, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {33, UPB_SIZE(132, 256), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap__fields[0],
- UPB_SIZE(120, 240), 27, false, 255,
+ UPB_SIZE(140, 280), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = {
- &envoy_config_cluster_v3_Cluster_msginit,
- &envoy_config_listener_v3_Listener_msginit,
- &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = {
+ {.submsg = &envoy_config_listener_v3_Listener_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_Secret_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 2, 11, 3},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[2] = {
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[5] = {
- {1, UPB_SIZE(20, 40), 1, 1, 11, 1},
- {2, UPB_SIZE(24, 48), 2, 1, 11, 1},
- {3, UPB_SIZE(28, 56), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 72), 5, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Admin_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Admin_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Admin__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), 1, 0, 11, 1},
- {4, UPB_SIZE(24, 48), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Admin__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Admin_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Admin_msginit = {
&envoy_config_bootstrap_v3_Admin_submsgs[0],
&envoy_config_bootstrap_v3_Admin__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = {
- &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = {
+ {.submsg = &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit},
+ {.submsg = &envoy_config_core_v3_BindConfig_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_ClusterManager__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(20, 40), 3, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msginit = {
&envoy_config_bootstrap_v3_ClusterManager_submsgs[0],
&envoy_config_bootstrap_v3_ClusterManager__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit = {
&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[0],
&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdogs_submsgs[1] = {
- &envoy_config_bootstrap_v3_Watchdog_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdogs_submsgs[2] = {
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdogs__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdogs__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Watchdogs_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msginit = {
&envoy_config_bootstrap_v3_Watchdogs_submsgs[0],
&envoy_config_bootstrap_v3_Watchdogs__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdog_submsgs[3] = {
- &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_submsgs[7] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdog__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 2, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 2, 11, 1},
- {5, UPB_SIZE(20, 40), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 48), 6, 2, 11, 1},
- {7, UPB_SIZE(28, 56), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Watchdog_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msginit = {
&envoy_config_bootstrap_v3_Watchdog_submsgs[0],
&envoy_config_bootstrap_v3_Watchdog__fields[0],
- UPB_SIZE(32, 64), 7, false, 255,
+ UPB_SIZE(32, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[2] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[2] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit = {
&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[0],
&envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_FatalAction_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_FatalAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_FatalAction__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_FatalAction__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_FatalAction_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msginit = {
&envoy_config_bootstrap_v3_FatalAction_submsgs[0],
&envoy_config_bootstrap_v3_FatalAction__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Runtime_submsgs[1] = {
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Runtime_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Runtime__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, 9, 1},
- {4, UPB_SIZE(28, 56), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_Runtime__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_Runtime_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msginit = {
&envoy_config_bootstrap_v3_Runtime_submsgs[0],
&envoy_config_bootstrap_v3_Runtime__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = {
- &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msginit = {
&envoy_config_bootstrap_v3_RuntimeLayer_submsgs[0],
&envoy_config_bootstrap_v3_RuntimeLayer__fields[0],
- UPB_SIZE(16, 32), 5, false, 255,
+ UPB_SIZE(16, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit = {
NULL,
&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit = {
&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[0],
&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = {
- &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
+static const upb_MiniTable_Sub envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = {
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_LayeredRuntime__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_LayeredRuntime__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit = {
+const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msginit = {
&envoy_config_bootstrap_v3_LayeredRuntime_submsgs[0],
&envoy_config_bootstrap_v3_LayeredRuntime__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_bootstrap_v3_CustomInlineHeader__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msginit = {
+ NULL,
+ &envoy_config_bootstrap_v3_CustomInlineHeader__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[18] = {
+ &envoy_config_bootstrap_v3_Bootstrap_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
+ &envoy_config_bootstrap_v3_Admin_msginit,
+ &envoy_config_bootstrap_v3_ClusterManager_msginit,
+ &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
+ &envoy_config_bootstrap_v3_Watchdogs_msginit,
+ &envoy_config_bootstrap_v3_Watchdog_msginit,
+ &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
+ &envoy_config_bootstrap_v3_FatalAction_msginit,
+ &envoy_config_bootstrap_v3_Runtime_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
+ &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
+ &envoy_config_bootstrap_v3_CustomInlineHeader_msginit,
+};
+
+const upb_MiniTable_File envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 18,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
index 42e4c858..2a51a124 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_
#define ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,6 +37,7 @@ struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer;
struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer;
struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer;
struct envoy_config_bootstrap_v3_LayeredRuntime;
+struct envoy_config_bootstrap_v3_CustomInlineHeader;
typedef struct envoy_config_bootstrap_v3_Bootstrap envoy_config_bootstrap_v3_Bootstrap;
typedef struct envoy_config_bootstrap_v3_Bootstrap_StaticResources envoy_config_bootstrap_v3_Bootstrap_StaticResources;
typedef struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources envoy_config_bootstrap_v3_Bootstrap_DynamicResources;
@@ -54,28 +55,32 @@ typedef struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer envoy_config_boo
typedef struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer;
typedef struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer;
typedef struct envoy_config_bootstrap_v3_LayeredRuntime envoy_config_bootstrap_v3_LayeredRuntime;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Admin_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdogs_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_FatalAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Runtime_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit;
+typedef struct envoy_config_bootstrap_v3_CustomInlineHeader envoy_config_bootstrap_v3_CustomInlineHeader;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Admin_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdogs_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_FatalAction_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_Runtime_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_LayeredRuntime_msginit;
+extern const upb_MiniTable envoy_config_bootstrap_v3_CustomInlineHeader_msginit;
+struct envoy_config_accesslog_v3_AccessLog;
struct envoy_config_cluster_v3_Cluster;
struct envoy_config_core_v3_Address;
struct envoy_config_core_v3_ApiConfigSource;
struct envoy_config_core_v3_BindConfig;
struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_DnsResolutionConfig;
struct envoy_config_core_v3_EventServiceConfig;
struct envoy_config_core_v3_Node;
struct envoy_config_core_v3_SocketOption;
@@ -90,25 +95,34 @@ struct envoy_type_v3_Percent;
struct google_protobuf_Duration;
struct google_protobuf_Struct;
struct google_protobuf_UInt64Value;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_msginit;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_ApiConfigSource_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_EventServiceConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_Node_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_Listener_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit;
+extern const upb_MiniTable envoy_config_trace_v3_Tracing_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_Secret_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable google_protobuf_UInt64Value_msginit;
+
+typedef enum {
+ envoy_config_bootstrap_v3_CustomInlineHeader_REQUEST_HEADER = 0,
+ envoy_config_bootstrap_v3_CustomInlineHeader_REQUEST_TRAILER = 1,
+ envoy_config_bootstrap_v3_CustomInlineHeader_RESPONSE_HEADER = 2,
+ envoy_config_bootstrap_v3_CustomInlineHeader_RESPONSE_TRAILER = 3
+} envoy_config_bootstrap_v3_CustomInlineHeader_InlineHeaderType;
typedef enum {
envoy_config_bootstrap_v3_Watchdog_WatchdogAction_UNKNOWN = 0,
@@ -119,91 +133,318 @@ typedef enum {
} envoy_config_bootstrap_v3_Watchdog_WatchdogAction_WatchdogEvent;
+
/* envoy.config.bootstrap.v3.Bootstrap */
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootstrap_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Bootstrap *)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootstrap_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Bootstrap*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootstrap_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap* ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootstrap_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Bootstrap *ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootstrap_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap* ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootstrap_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Bootstrap *ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_serialize(const envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_serialize(const envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_serialize_ex(const envoy_config_bootstrap_v3_Bootstrap* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_bootstrap_v3_Bootstrap_stats_flush_stats_flush_on_admin = 29,
envoy_config_bootstrap_v3_Bootstrap_stats_flush_NOT_SET = 0
} envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases;
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases envoy_config_bootstrap_v3_Bootstrap_stats_flush_case(const envoy_config_bootstrap_v3_Bootstrap* msg) { return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(116, 228), int32_t); }
-
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_node(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_Node*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_static_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_static_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_config_bootstrap_v3_Bootstrap_StaticResources*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const envoy_config_bootstrap_v3_Bootstrap_DynamicResources*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const envoy_config_bootstrap_v3_ClusterManager*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_flags_path(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 176)); }
-UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_accessor(msg, UPB_SIZE(88, 176), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdog(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_watchdog(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const envoy_config_bootstrap_v3_Watchdog*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_tracing(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE const struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_tracing(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct envoy_config_trace_v3_Tracing*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const envoy_config_bootstrap_v3_Admin*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE const struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_stats_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const struct envoy_config_metrics_v3_StatsConfig*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_hds_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_hds_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const struct envoy_config_core_v3_ApiConfigSource*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_overload_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE const struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_overload_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct envoy_config_overload_v3_OverloadManager*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE const envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const envoy_config_bootstrap_v3_LayeredRuntime*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_header_prefix(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt64Value*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 184)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(92, 184), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 192)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_accessor(msg, UPB_SIZE(96, 192), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_config_source(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_default_config_source(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE size_t envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(const envoy_config_bootstrap_v3_Bootstrap *msg) {return _upb_msg_map_size(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_get(const envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* *val) { return _upb_msg_map_get(msg, UPB_SIZE(100, 200), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_next(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(100, 200), iter); }
-UPB_INLINE upb_strview const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(104, 208), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdogs(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_watchdogs(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const envoy_config_bootstrap_v3_Watchdogs*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 216)); }
-UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_accessor(msg, UPB_SIZE(108, 216), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_getoneofcase(msg, UPB_SIZE(116, 228)) == 29; }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(112, 224), UPB_SIZE(116, 228), 29, false); }
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases envoy_config_bootstrap_v3_Bootstrap_stats_flush_case(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_node(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_Node*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_static_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const envoy_config_bootstrap_v3_Bootstrap_StaticResources*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const envoy_config_bootstrap_v3_Bootstrap_DynamicResources*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const envoy_config_bootstrap_v3_ClusterManager*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_flags_path(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_flags_path(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 64));
+}
+UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_watchdog(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const envoy_config_bootstrap_v3_Watchdog*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_tracing(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct envoy_config_trace_v3_Tracing*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const envoy_config_bootstrap_v3_Admin*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_stats_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct envoy_config_metrics_v3_StatsConfig*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_hds_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const struct envoy_config_core_v3_ApiConfigSource*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_overload_manager(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const struct envoy_config_overload_v3_OverloadManager*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const envoy_config_bootstrap_v3_LayeredRuntime*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_header_prefix(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_header_prefix(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const struct google_protobuf_UInt64Value*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool) = 0;
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 160));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(84, 160));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(84, 160), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 168));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(88, 168));
+}
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_accessor(msg, UPB_SIZE(88, 168), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 176), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_default_config_source(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(92, 176), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 200));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(104, 200));
+}
+UPB_INLINE size_t envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(104, 200));
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_get(const envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key, struct envoy_config_core_v3_TypedExtensionConfig** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(104, 200), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_next(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* iter) {
+ return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(104, 200), iter);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(108, 208));
+}
+UPB_INLINE upb_StringView const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(108, 208), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 216), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_watchdogs(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(112, 216), const envoy_config_bootstrap_v3_Watchdogs*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(116, 224));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(116, 224));
+}
+UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_accessor(msg, UPB_SIZE(116, 224), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 29;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(3, 3), 0, UPB_SIZE(8, 8), envoy_config_bootstrap_v3_Bootstrap_stats_flush_NOT_SET);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(3, 3), UPB_SIZE(8, 8), 29, false);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 232), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(120, 232), const struct envoy_config_core_v3_DnsResolutionConfig*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_hasbit(msg, 17);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 240), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(124, 240), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 248));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(128, 248));
+}
+UPB_INLINE const envoy_config_bootstrap_v3_CustomInlineHeader* const* envoy_config_bootstrap_v3_Bootstrap_inline_headers(const envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (const envoy_config_bootstrap_v3_CustomInlineHeader* const*)_upb_array_accessor(msg, UPB_SIZE(128, 248), len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_clear_perf_tracing_file_path(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_perf_tracing_file_path(const envoy_config_bootstrap_v3_Bootstrap* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView);
+}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_node(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_Node*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_Node*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_mutable_node(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_mutable_node(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_config_bootstrap_v3_Bootstrap_node(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_node(msg, sub);
}
@@ -211,12 +452,12 @@ UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_static_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_StaticResources* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_config_bootstrap_v3_Bootstrap_StaticResources*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), envoy_config_bootstrap_v3_Bootstrap_StaticResources*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_mutable_static_resources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_mutable_static_resources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)envoy_config_bootstrap_v3_Bootstrap_static_resources(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_static_resources(msg, sub);
}
@@ -224,12 +465,12 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_con
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_DynamicResources* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), envoy_config_bootstrap_v3_Bootstrap_DynamicResources*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_bootstrap_v3_Bootstrap_DynamicResources*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_mutable_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_mutable_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(msg, sub);
}
@@ -237,41 +478,40 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_co
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_ClusterManager* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), envoy_config_bootstrap_v3_ClusterManager*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_bootstrap_v3_ClusterManager*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_mutable_cluster_manager(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_mutable_cluster_manager(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_ClusterManager* sub = (struct envoy_config_bootstrap_v3_ClusterManager*)envoy_config_bootstrap_v3_Bootstrap_cluster_manager(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_ClusterManager*)_upb_msg_new(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_flags_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_flags_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value;
}
-UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_mutable_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 176), len);
+UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_mutable_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
}
-UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_resize_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_resize_accessor2(msg, UPB_SIZE(88, 176), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_resize_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_metrics_v3_StatsSink**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_metrics_v3_StatsSink* envoy_config_bootstrap_v3_Bootstrap_add_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
- struct envoy_config_metrics_v3_StatsSink* sub = (struct envoy_config_metrics_v3_StatsSink*)_upb_msg_new(&envoy_config_metrics_v3_StatsSink_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(88, 176), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_metrics_v3_StatsSink* envoy_config_bootstrap_v3_Bootstrap_add_stats_sinks(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_metrics_v3_StatsSink* sub = (struct envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(msg, sub);
}
@@ -279,12 +519,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdog(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdog* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 96), envoy_config_bootstrap_v3_Watchdog*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), envoy_config_bootstrap_v3_Watchdog*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdog(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdog(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Bootstrap_watchdog(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_watchdog(msg, sub);
}
@@ -292,12 +532,12 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_tracing(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_trace_v3_Tracing* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct envoy_config_trace_v3_Tracing*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct envoy_config_trace_v3_Tracing*) = value;
}
-UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_mutable_tracing(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_mutable_tracing(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_trace_v3_Tracing* sub = (struct envoy_config_trace_v3_Tracing*)envoy_config_bootstrap_v3_Bootstrap_tracing(msg);
if (sub == NULL) {
- sub = (struct envoy_config_trace_v3_Tracing*)_upb_msg_new(&envoy_config_trace_v3_Tracing_msginit, arena);
+ sub = (struct envoy_config_trace_v3_Tracing*)_upb_Message_New(&envoy_config_trace_v3_Tracing_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_tracing(msg, sub);
}
@@ -305,12 +545,12 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Boots
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_admin(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Admin* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), envoy_config_bootstrap_v3_Admin*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), envoy_config_bootstrap_v3_Admin*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_mutable_admin(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_mutable_admin(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Admin* sub = (struct envoy_config_bootstrap_v3_Admin*)envoy_config_bootstrap_v3_Bootstrap_admin(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Admin*)_upb_msg_new(&envoy_config_bootstrap_v3_Admin_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_admin(msg, sub);
}
@@ -318,12 +558,12 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Boo
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_metrics_v3_StatsConfig* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 120), struct envoy_config_metrics_v3_StatsConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct envoy_config_metrics_v3_StatsConfig*) = value;
}
-UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_metrics_v3_StatsConfig* sub = (struct envoy_config_metrics_v3_StatsConfig*)envoy_config_bootstrap_v3_Bootstrap_stats_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_metrics_v3_StatsConfig*)_upb_msg_new(&envoy_config_metrics_v3_StatsConfig_msginit, arena);
+ sub = (struct envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_stats_config(msg, sub);
}
@@ -331,12 +571,12 @@ UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_hds_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ApiConfigSource* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), struct envoy_config_core_v3_ApiConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), struct envoy_config_core_v3_ApiConfigSource*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_hds_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_hds_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_Bootstrap_hds_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_hds_config(msg, sub);
}
@@ -344,242 +584,356 @@ UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_overload_v3_OverloadManager* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct envoy_config_overload_v3_OverloadManager*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), struct envoy_config_overload_v3_OverloadManager*) = value;
}
-UPB_INLINE struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_mutable_overload_manager(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_mutable_overload_manager(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_overload_v3_OverloadManager* sub = (struct envoy_config_overload_v3_OverloadManager*)envoy_config_bootstrap_v3_Bootstrap_overload_manager(msg);
if (sub == NULL) {
- sub = (struct envoy_config_overload_v3_OverloadManager*)_upb_msg_new(&envoy_config_overload_v3_OverloadManager_msginit, arena);
+ sub = (struct envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_enable_dispatcher_stats(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_LayeredRuntime* value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 144), envoy_config_bootstrap_v3_LayeredRuntime*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), envoy_config_bootstrap_v3_LayeredRuntime*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_mutable_layered_runtime(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_mutable_layered_runtime(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_LayeredRuntime* sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)envoy_config_bootstrap_v3_Bootstrap_layered_runtime(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)_upb_msg_new(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_header_prefix(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_header_prefix(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_UInt64Value* value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 152), struct google_protobuf_UInt64Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 152), struct google_protobuf_UInt64Value*) = value;
}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_use_tcp_for_dns_lookups(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(5, 5), bool) = value;
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_mutable_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 184), len);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_mutable_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 160), len);
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_resize_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(92, 184), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_resize_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(84, 160), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_add_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *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_accessor2(
- msg, UPB_SIZE(92, 184), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_add_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(84, 160), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_mutable_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_core_v3_ConfigSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 192), len);
+UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_mutable_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (struct envoy_config_core_v3_ConfigSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 168), len);
}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_resize_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_ConfigSource**)_upb_array_resize_accessor2(msg, UPB_SIZE(96, 192), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_resize_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_ConfigSource**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(88, 168), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_add_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
- struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(96, 192), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_add_config_sources(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(88, 168), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 160), struct envoy_config_core_v3_ConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 176), struct envoy_config_core_v3_ConfigSource*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_default_config_source(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_default_config_source(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_default_config_source(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_socket_interface(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_socket_interface(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 184), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap *msg) { _upb_msg_map_clear(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_set(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(100, 200), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_delete(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(100, 200), &key, 0); }
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_nextmutable(envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(100, 200), iter); }
-UPB_INLINE upb_strview* envoy_config_bootstrap_v3_Bootstrap_mutable_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(104, 208), len);
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(104, 200)); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_set(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key, struct envoy_config_core_v3_TypedExtensionConfig* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(104, 200), &key, 0, &val, sizeof(val), a);
}
-UPB_INLINE upb_strview* envoy_config_bootstrap_v3_Bootstrap_resize_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(104, 208), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_delete(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(104, 200), &key, 0);
}
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_add_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(104, 208), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_nextmutable(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* iter) {
+ return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(104, 200), iter);
+}
+UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_mutable_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 208), len);
+}
+UPB_INLINE upb_StringView* envoy_config_bootstrap_v3_Bootstrap_resize_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(108, 208), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_add_node_context_params(envoy_config_bootstrap_v3_Bootstrap* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(108, 208), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdogs* value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 168), envoy_config_bootstrap_v3_Watchdogs*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 216), envoy_config_bootstrap_v3_Watchdogs*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdogs(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdogs(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Watchdogs* sub = (struct envoy_config_bootstrap_v3_Watchdogs*)envoy_config_bootstrap_v3_Bootstrap_watchdogs(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Watchdogs*)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(msg, sub);
}
return sub;
}
-UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_mutable_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 216), len);
+UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_mutable_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(116, 224), len);
}
-UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_resize_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(108, 216), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_resize_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_FatalAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(116, 224), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Bootstrap_add_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
- struct envoy_config_bootstrap_v3_FatalAction* sub = (struct envoy_config_bootstrap_v3_FatalAction*)_upb_msg_new(&envoy_config_bootstrap_v3_FatalAction_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(108, 216), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Bootstrap_add_fatal_actions(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_bootstrap_v3_FatalAction* sub = (struct envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(116, 224), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_on_admin(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(112, 224), value, UPB_SIZE(116, 228), 29);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(3, 3), value, UPB_SIZE(8, 8), 29);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) {
+ _upb_sethas(msg, 16);
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 232), struct envoy_config_core_v3_DnsResolutionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 17);
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 240), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_mutable_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t* len) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(128, 248), len);
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_resize_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(128, 248), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_Bootstrap_add_inline_headers(envoy_config_bootstrap_v3_Bootstrap* msg, upb_Arena* arena) {
+ struct envoy_config_bootstrap_v3_CustomInlineHeader* sub = (struct envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(128, 248), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_perf_tracing_file_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 256), upb_StringView) = value;
}
/* envoy.config.bootstrap.v3.Bootstrap.StaticResources */
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Bootstrap_StaticResources *)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Bootstrap_StaticResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap_StaticResources* ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap_StaticResources* ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Bootstrap_StaticResources *ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_StaticResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Bootstrap_StaticResources *ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_StaticResources_serialize_ex(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_StaticResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena, len);
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const struct envoy_config_listener_v3_Listener* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
+ return (const struct envoy_config_listener_v3_Listener* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const struct envoy_config_cluster_v3_Cluster* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
+ return (const struct envoy_config_cluster_v3_Cluster* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_StaticResources_clear_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_Secret* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
+ return (const struct envoy_extensions_transport_sockets_tls_v3_Secret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const struct envoy_config_listener_v3_Listener* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_listeners(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) { return (const struct envoy_config_listener_v3_Listener* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const struct envoy_config_cluster_v3_Cluster* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_clusters(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) { return (const struct envoy_config_cluster_v3_Cluster* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_StaticResources_has_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_Secret* const* envoy_config_bootstrap_v3_Bootstrap_StaticResources_secrets(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_Secret* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) {
+UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
return (struct envoy_config_listener_v3_Listener**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_listener_v3_Listener**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_listener_v3_Listener** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_listener_v3_Listener**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_listener_v3_Listener* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_Listener* sub = (struct envoy_config_listener_v3_Listener*)_upb_msg_new(&envoy_config_listener_v3_Listener_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_listener_v3_Listener* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_listeners(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) {
+ struct envoy_config_listener_v3_Listener* sub = (struct envoy_config_listener_v3_Listener*)_upb_Message_New(&envoy_config_listener_v3_Listener_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) {
+UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
return (struct envoy_config_cluster_v3_Cluster**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_cluster_v3_Cluster**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_cluster_v3_Cluster** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_cluster_v3_Cluster**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, upb_arena *arena) {
- struct envoy_config_cluster_v3_Cluster* sub = (struct envoy_config_cluster_v3_Cluster*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_cluster_v3_Cluster* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_clusters(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) {
+ struct envoy_config_cluster_v3_Cluster* sub = (struct envoy_config_cluster_v3_Cluster*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t *len) {
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_mutable_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t* len) {
return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, size_t len, upb_arena *arena) {
- return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret** envoy_config_bootstrap_v3_Bootstrap_StaticResources_resize_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_extensions_transport_sockets_tls_v3_Secret**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, upb_arena *arena) {
- struct envoy_extensions_transport_sockets_tls_v3_Secret* sub = (struct envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_Secret* envoy_config_bootstrap_v3_Bootstrap_StaticResources_add_secrets(envoy_config_bootstrap_v3_Bootstrap_StaticResources* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_Secret* sub = (struct envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.config.bootstrap.v3.Bootstrap.DynamicResources */
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Bootstrap_DynamicResources *)_upb_msg_new(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)_upb_Message_New(&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Bootstrap_DynamicResources *ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap_DynamicResources* ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Bootstrap_DynamicResources *ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Bootstrap_DynamicResources* ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_serialize_ex(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ApiConfigSource*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_lds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_clear_cds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_DynamicResources_has_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_ads_config(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_ApiConfigSource*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_resources_locator(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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_bootstrap_v3_Bootstrap_DynamicResources_mutable_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_lds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_lds_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_config(msg, sub);
}
@@ -587,12 +941,12 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_B
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), 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_bootstrap_v3_Bootstrap_DynamicResources_mutable_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_cds_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_cds_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_config(msg, sub);
}
@@ -600,33 +954,35 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_B
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, struct envoy_config_core_v3_ApiConfigSource* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_ApiConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ApiConfigSource*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_DynamicResources_mutable_ads_config(envoy_config_bootstrap_v3_Bootstrap_DynamicResources* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_Bootstrap_DynamicResources_ads_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_ads_config(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_lds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_DynamicResources_set_cds_resources_locator(envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = value;
}
/* envoy.config.bootstrap.v3.Bootstrap.CertificateProviderInstancesEntry */
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_key(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry *msg) {
- upb_strview ret;
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_key(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) {
+ upb_StringView ret;
_upb_msg_map_key(msg, &ret, 0);
return ret;
}
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_has_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry *msg) {
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_has_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_value(const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* msg) {
struct envoy_config_core_v3_TypedExtensionConfig* ret;
_upb_msg_map_value(msg, &ret, sizeof(ret));
return ret;
@@ -638,103 +994,204 @@ UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstances
/* envoy.config.bootstrap.v3.Admin */
-UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Admin *)_upb_msg_new(&envoy_config_bootstrap_v3_Admin_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Admin*)_upb_Message_New(&envoy_config_bootstrap_v3_Admin_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Admin *ret = envoy_config_bootstrap_v3_Admin_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Admin* ret = envoy_config_bootstrap_v3_Admin_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Admin *ret = envoy_config_bootstrap_v3_Admin_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Admin* ret = envoy_config_bootstrap_v3_Admin_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Admin_serialize(const envoy_config_bootstrap_v3_Admin *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Admin_serialize(const envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_Admin_serialize_ex(const envoy_config_bootstrap_v3_Admin* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_access_log_path(const envoy_config_bootstrap_v3_Admin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Admin_access_log_path(const envoy_config_bootstrap_v3_Admin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_profile_path(const envoy_config_bootstrap_v3_Admin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Admin_profile_path(const envoy_config_bootstrap_v3_Admin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_address(const envoy_config_bootstrap_v3_Admin* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_address(const envoy_config_bootstrap_v3_Admin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_address(const envoy_config_bootstrap_v3_Admin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_Address*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_socket_options(const envoy_config_bootstrap_v3_Admin* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_socket_options(const envoy_config_bootstrap_v3_Admin* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_bootstrap_v3_Admin_socket_options(const envoy_config_bootstrap_v3_Admin* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_access_log(const envoy_config_bootstrap_v3_Admin* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_access_log(const envoy_config_bootstrap_v3_Admin* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_bootstrap_v3_Admin_access_log(const envoy_config_bootstrap_v3_Admin* msg, size_t* len) {
+ return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_clear_ignore_global_conn_limit(const envoy_config_bootstrap_v3_Admin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Admin_ignore_global_conn_limit(const envoy_config_bootstrap_v3_Admin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Admin_access_log_path(const envoy_config_bootstrap_v3_Admin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Admin_profile_path(const envoy_config_bootstrap_v3_Admin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_address(const envoy_config_bootstrap_v3_Admin *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_address(const envoy_config_bootstrap_v3_Admin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_Address*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_socket_options(const envoy_config_bootstrap_v3_Admin *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_bootstrap_v3_Admin_socket_options(const envoy_config_bootstrap_v3_Admin *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_access_log_path(envoy_config_bootstrap_v3_Admin *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_access_log_path(envoy_config_bootstrap_v3_Admin *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_profile_path(envoy_config_bootstrap_v3_Admin *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_profile_path(envoy_config_bootstrap_v3_Admin *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_address(envoy_config_bootstrap_v3_Admin *msg, struct envoy_config_core_v3_Address* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_Address*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_mutable_address(envoy_config_bootstrap_v3_Admin *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_mutable_address(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_bootstrap_v3_Admin_address(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Admin_set_address(msg, sub);
}
return sub;
}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_mutable_socket_options(envoy_config_bootstrap_v3_Admin *msg, size_t *len) {
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_mutable_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t* len) {
return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
-UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_resize_socket_options(envoy_config_bootstrap_v3_Admin *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_bootstrap_v3_Admin_resize_socket_options(envoy_config_bootstrap_v3_Admin* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_SocketOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_bootstrap_v3_Admin_add_socket_options(envoy_config_bootstrap_v3_Admin *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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_bootstrap_v3_Admin_add_socket_options(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_mutable_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t* len) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_resize_access_log(envoy_config_bootstrap_v3_Admin* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_bootstrap_v3_Admin_add_access_log(envoy_config_bootstrap_v3_Admin* msg, upb_Arena* arena) {
+ struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_ignore_global_conn_limit(envoy_config_bootstrap_v3_Admin *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
/* envoy.config.bootstrap.v3.ClusterManager */
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_ClusterManager_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_ClusterManager *)_upb_msg_new(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_ClusterManager_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_ClusterManager*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_ClusterManager_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_ClusterManager *ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_ClusterManager_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_ClusterManager* ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_ClusterManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_ClusterManager *ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_ClusterManager_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_ClusterManager* ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_bootstrap_v3_ClusterManager_serialize(const envoy_config_bootstrap_v3_ClusterManager *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_serialize(const envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_serialize_ex(const envoy_config_bootstrap_v3_ClusterManager* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_local_cluster_name(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_ClusterManager_local_cluster_name(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_BindConfig*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_clear_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_ApiConfigSource*);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_ClusterManager_local_cluster_name(const envoy_config_bootstrap_v3_ClusterManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_outlier_detection(const envoy_config_bootstrap_v3_ClusterManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_upstream_bind_config(const envoy_config_bootstrap_v3_ClusterManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_BindConfig*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_has_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_load_stats_config(const envoy_config_bootstrap_v3_ClusterManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_ApiConfigSource*); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_local_cluster_name(envoy_config_bootstrap_v3_ClusterManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_local_cluster_name(envoy_config_bootstrap_v3_ClusterManager *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_outlier_detection(envoy_config_bootstrap_v3_ClusterManager *msg, envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_mutable_outlier_detection(envoy_config_bootstrap_v3_ClusterManager *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_mutable_outlier_detection(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)envoy_config_bootstrap_v3_ClusterManager_outlier_detection(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_msg_new(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_ClusterManager_set_outlier_detection(msg, sub);
}
@@ -744,10 +1201,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_upstream_bind_confi
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_BindConfig*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_mutable_upstream_bind_config(envoy_config_bootstrap_v3_ClusterManager *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_bootstrap_v3_ClusterManager_mutable_upstream_bind_config(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) {
struct envoy_config_core_v3_BindConfig* sub = (struct envoy_config_core_v3_BindConfig*)envoy_config_bootstrap_v3_ClusterManager_upstream_bind_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_BindConfig*)_upb_msg_new(&envoy_config_core_v3_BindConfig_msginit, arena);
+ sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_ClusterManager_set_upstream_bind_config(msg, sub);
}
@@ -757,10 +1214,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_set_load_stats_config(e
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_ApiConfigSource*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_mutable_load_stats_config(envoy_config_bootstrap_v3_ClusterManager *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_ClusterManager_mutable_load_stats_config(envoy_config_bootstrap_v3_ClusterManager* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_ClusterManager_load_stats_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_msg_new(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_New(&envoy_config_core_v3_ApiConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_ClusterManager_set_load_stats_config(msg, sub);
}
@@ -769,39 +1226,62 @@ UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v
/* envoy.config.bootstrap.v3.ClusterManager.OutlierDetection */
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *)_upb_msg_new(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_ClusterManager_OutlierDetection*)_upb_Message_New(&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_serialize(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_serialize(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_serialize_ex(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_clear_event_log_path(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_log_path(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_has_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_clear_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_EventServiceConfig*);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_log_path(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_has_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_service(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_EventServiceConfig*); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_log_path(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_log_path(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, struct envoy_config_core_v3_EventServiceConfig* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_EventServiceConfig*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_mutable_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_mutable_event_service(envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* msg, upb_Arena* arena) {
struct envoy_config_core_v3_EventServiceConfig* sub = (struct envoy_config_core_v3_EventServiceConfig*)envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_event_service(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_msg_new(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
+ sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_set_event_service(msg, sub);
}
@@ -810,37 +1290,62 @@ UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_bootstra
/* envoy.config.bootstrap.v3.Watchdogs */
-UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchdogs_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Watchdogs *)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchdogs_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Watchdogs*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdogs_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchdogs_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdogs* ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchdogs_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Watchdogs *ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchdogs_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdogs* ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchdogs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Watchdogs *ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdogs_serialize(const envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Watchdogs_serialize(const envoy_config_bootstrap_v3_Watchdogs *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdogs_serialize_ex(const envoy_config_bootstrap_v3_Watchdogs* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_bootstrap_v3_Watchdog*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_clear_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_bootstrap_v3_Watchdog*);
}
-
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_bootstrap_v3_Watchdog*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_worker_watchdog(const envoy_config_bootstrap_v3_Watchdogs *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_bootstrap_v3_Watchdog*); }
UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_set_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs *msg, envoy_config_bootstrap_v3_Watchdog* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_bootstrap_v3_Watchdog*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_main_thread_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Watchdogs_main_thread_watchdog(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdogs_set_main_thread_watchdog(msg, sub);
}
@@ -850,10 +1355,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdogs_set_worker_watchdog(envoy_co
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_bootstrap_v3_Watchdog*) = value;
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_worker_watchdog(envoy_config_bootstrap_v3_Watchdogs *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdogs_mutable_worker_watchdog(envoy_config_bootstrap_v3_Watchdogs* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Watchdogs_worker_watchdog(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdogs_set_worker_watchdog(msg, sub);
}
@@ -862,47 +1367,107 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_
/* envoy.config.bootstrap.v3.Watchdog */
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdog_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Watchdog *)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
-}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdog_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Watchdog *ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdog_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Watchdog *ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *envoy_config_bootstrap_v3_Watchdog_serialize(const envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, arena, len);
-}
-
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_miss_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_miss_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_kill_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_kill_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_type_v3_Percent*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_actions(const envoy_config_bootstrap_v3_Watchdog *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const* envoy_config_bootstrap_v3_Watchdog_actions(const envoy_config_bootstrap_v3_Watchdog *msg, size_t *len) { return (const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdog_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Watchdog*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdog_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdog* ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdog_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdog* ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_serialize(const envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_serialize_ex(const envoy_config_bootstrap_v3_Watchdog* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_megamiss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_kill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_multikill_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_multikill_threshold(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_max_kill_timeout_jitter(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_actions(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_clear_actions(const envoy_config_bootstrap_v3_Watchdog* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const* envoy_config_bootstrap_v3_Watchdog_actions(const envoy_config_bootstrap_v3_Watchdog* msg, size_t* len) {
+ return (const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
+}
UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_miss_timeout(envoy_config_bootstrap_v3_Watchdog *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_miss_timeout(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_miss_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_miss_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_miss_timeout(msg, sub);
}
@@ -912,10 +1477,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_megamiss_timeout(envoy_co
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_megamiss_timeout(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_megamiss_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_megamiss_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_megamiss_timeout(msg, sub);
}
@@ -925,10 +1490,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_kill_timeout(envoy_config
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_kill_timeout(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_kill_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_kill_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_kill_timeout(msg, sub);
}
@@ -938,10 +1503,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_multikill_timeout(envoy_c
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_timeout(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_timeout(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_multikill_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_multikill_timeout(msg, sub);
}
@@ -951,10 +1516,10 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_multikill_threshold(envoy
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_type_v3_Percent*) = value;
}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_threshold(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_bootstrap_v3_Watchdog_mutable_multikill_threshold(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_bootstrap_v3_Watchdog_multikill_threshold(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_multikill_threshold(msg, sub);
}
@@ -964,61 +1529,83 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_set_max_kill_timeout_jitter(e
_upb_sethas(msg, 6);
*UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_max_kill_timeout_jitter(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Watchdog_mutable_max_kill_timeout_jitter(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Watchdog_max_kill_timeout_jitter(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_set_max_kill_timeout_jitter(msg, sub);
}
return sub;
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_mutable_actions(envoy_config_bootstrap_v3_Watchdog *msg, size_t *len) {
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_mutable_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t* len) {
return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_resize_actions(envoy_config_bootstrap_v3_Watchdog *msg, size_t len, upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction** envoy_config_bootstrap_v3_Watchdog_resize_actions(envoy_config_bootstrap_v3_Watchdog* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_add_actions(envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena) {
- struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* sub = (struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_add_actions(envoy_config_bootstrap_v3_Watchdog* msg, upb_Arena* arena) {
+ struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction* sub = (struct envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.config.bootstrap.v3.Watchdog.WatchdogAction */
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction *)_upb_msg_new(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Watchdog_WatchdogAction*)_upb_Message_New(&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Watchdog_WatchdogAction *ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdog_WatchdogAction* ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Watchdog_WatchdogAction* ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Watchdog_WatchdogAction *ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_serialize(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_serialize(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_serialize_ex(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_WatchdogAction_has_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_clear_event(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_bootstrap_v3_Watchdog_WatchdogAction_event(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-
-UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_WatchdogAction_has_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-UPB_INLINE int32_t envoy_config_bootstrap_v3_Watchdog_WatchdogAction_event(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_mutable_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Watchdog_WatchdogAction_mutable_config(envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg, upb_Arena* arena) {
struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Watchdog_WatchdogAction_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_config(msg, sub);
}
@@ -1030,35 +1617,53 @@ UPB_INLINE void envoy_config_bootstrap_v3_Watchdog_WatchdogAction_set_event(envo
/* envoy.config.bootstrap.v3.FatalAction */
-UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_FatalAction_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_FatalAction *)_upb_msg_new(&envoy_config_bootstrap_v3_FatalAction_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_FatalAction_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_FatalAction*)_upb_Message_New(&envoy_config_bootstrap_v3_FatalAction_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_FatalAction_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_FatalAction* ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_FatalAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_FatalAction* ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_FatalAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_FatalAction *ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_FatalAction_serialize(const envoy_config_bootstrap_v3_FatalAction* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_FatalAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_FatalAction *ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_FatalAction_serialize_ex(const envoy_config_bootstrap_v3_FatalAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_FatalAction_serialize(const envoy_config_bootstrap_v3_FatalAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, arena, len);
+UPB_INLINE bool envoy_config_bootstrap_v3_FatalAction_has_config(const envoy_config_bootstrap_v3_FatalAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_FatalAction_clear_config(const envoy_config_bootstrap_v3_FatalAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_config(const envoy_config_bootstrap_v3_FatalAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
}
-
-UPB_INLINE bool envoy_config_bootstrap_v3_FatalAction_has_config(const envoy_config_bootstrap_v3_FatalAction *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_config(const envoy_config_bootstrap_v3_FatalAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); }
UPB_INLINE void envoy_config_bootstrap_v3_FatalAction_set_config(envoy_config_bootstrap_v3_FatalAction *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_mutable_config(envoy_config_bootstrap_v3_FatalAction *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_FatalAction_mutable_config(envoy_config_bootstrap_v3_FatalAction* msg, upb_Arena* arena) {
struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_FatalAction_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_FatalAction_set_config(msg, sub);
}
@@ -1067,47 +1672,80 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootst
/* envoy.config.bootstrap.v3.Runtime */
-UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_Runtime *)_upb_msg_new(&envoy_config_bootstrap_v3_Runtime_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_Runtime*)_upb_Message_New(&envoy_config_bootstrap_v3_Runtime_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Runtime* ret = envoy_config_bootstrap_v3_Runtime_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_Runtime *ret = envoy_config_bootstrap_v3_Runtime_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_Runtime* ret = envoy_config_bootstrap_v3_Runtime_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_Runtime *ret = envoy_config_bootstrap_v3_Runtime_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_Runtime_serialize(const envoy_config_bootstrap_v3_Runtime* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_Runtime_serialize(const envoy_config_bootstrap_v3_Runtime *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_Runtime_serialize_ex(const envoy_config_bootstrap_v3_Runtime* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_symlink_root(const envoy_config_bootstrap_v3_Runtime* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_symlink_root(const envoy_config_bootstrap_v3_Runtime* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_override_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_Runtime_override_subdirectory(const envoy_config_bootstrap_v3_Runtime* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_Runtime_has_base(const envoy_config_bootstrap_v3_Runtime* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_clear_base(const envoy_config_bootstrap_v3_Runtime* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_base(const envoy_config_bootstrap_v3_Runtime* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Struct*);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Runtime_symlink_root(const envoy_config_bootstrap_v3_Runtime *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Runtime_subdirectory(const envoy_config_bootstrap_v3_Runtime *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Runtime_override_subdirectory(const envoy_config_bootstrap_v3_Runtime *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Runtime_has_base(const envoy_config_bootstrap_v3_Runtime *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_base(const envoy_config_bootstrap_v3_Runtime *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Struct*); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_symlink_root(envoy_config_bootstrap_v3_Runtime *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_symlink_root(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_override_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_override_subdirectory(envoy_config_bootstrap_v3_Runtime *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Runtime_set_base(envoy_config_bootstrap_v3_Runtime *msg, struct google_protobuf_Struct* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Struct*) = value;
}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_mutable_base(envoy_config_bootstrap_v3_Runtime *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_mutable_base(envoy_config_bootstrap_v3_Runtime* msg, upb_Arena* arena) {
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_bootstrap_v3_Runtime_base(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_Runtime_set_base(msg, sub);
}
@@ -1116,24 +1754,35 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_Runtime_muta
/* envoy.config.bootstrap.v3.RuntimeLayer */
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_RuntimeLayer_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_RuntimeLayer *)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_RuntimeLayer_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_RuntimeLayer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_RuntimeLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_RuntimeLayer_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_RuntimeLayer_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_RuntimeLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_RuntimeLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_serialize_ex(const envoy_config_bootstrap_v3_RuntimeLayer* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_static_layer = 2,
envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_disk_layer = 3,
@@ -1141,64 +1790,98 @@ typedef enum {
envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_rtds_layer = 5,
envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET = 0
} envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases;
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_case(const envoy_config_bootstrap_v3_RuntimeLayer* msg) { return (envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_RuntimeLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer *msg) { return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_case(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_name(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET);
+}
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_static_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_disk_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_admin_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 4, NULL);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_has_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_clear_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_rtds_layer(const envoy_config_bootstrap_v3_RuntimeLayer* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, NULL);
+}
-UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_static_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, struct google_protobuf_Struct* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_mutable_static_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Struct* envoy_config_bootstrap_v3_RuntimeLayer_mutable_static_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) {
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_bootstrap_v3_RuntimeLayer_static_layer(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_RuntimeLayer_set_static_layer(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_disk_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)envoy_config_bootstrap_v3_RuntimeLayer_disk_layer(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_RuntimeLayer_set_disk_layer(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_admin_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)envoy_config_bootstrap_v3_RuntimeLayer_admin_layer(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_RuntimeLayer_set_admin_layer(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_set_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+ UPB_WRITE_ONEOF(msg, envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_mutable_rtds_layer(envoy_config_bootstrap_v3_RuntimeLayer* msg, upb_Arena* arena) {
struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)envoy_config_bootstrap_v3_RuntimeLayer_rtds_layer(msg);
if (sub == NULL) {
- sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena);
+ sub = (struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_RuntimeLayer_set_rtds_layer(msg, sub);
}
@@ -1207,95 +1890,155 @@ UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config
/* envoy.config.bootstrap.v3.RuntimeLayer.DiskLayer */
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_serialize_ex(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_symlink_root(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_symlink_root(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_append_service_cluster(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_append_service_cluster(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_clear_subdirectory(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_subdirectory(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_symlink_root(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_append_service_cluster(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_subdirectory(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_symlink_root(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_symlink_root(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_append_service_cluster(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_subdirectory(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_set_subdirectory(envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
/* envoy.config.bootstrap.v3.RuntimeLayer.AdminLayer */
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize_ex(const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, options, arena, len);
}
-
/* envoy.config.bootstrap.v3.RuntimeLayer.RtdsLayer */
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_serialize_ex(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_clear_name(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_has_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_clear_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*);
}
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_name(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_has_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_rtds_config(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
-
-UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_name(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_mutable_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_mutable_rtds_config(envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_rtds_config(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_set_rtds_config(msg, sub);
}
@@ -1304,41 +2047,111 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_R
/* envoy.config.bootstrap.v3.LayeredRuntime */
-UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_LayeredRuntime_new(upb_arena *arena) {
- return (envoy_config_bootstrap_v3_LayeredRuntime *)_upb_msg_new(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena);
+UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_LayeredRuntime_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_LayeredRuntime*)_upb_Message_New(&envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena);
}
-UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_LayeredRuntime_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_bootstrap_v3_LayeredRuntime *ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_LayeredRuntime_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_LayeredRuntime* ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_LayeredRuntime_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_bootstrap_v3_LayeredRuntime *ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_LayeredRuntime_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_LayeredRuntime* ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_bootstrap_v3_LayeredRuntime_serialize(const envoy_config_bootstrap_v3_LayeredRuntime *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena, len);
+UPB_INLINE char* envoy_config_bootstrap_v3_LayeredRuntime_serialize(const envoy_config_bootstrap_v3_LayeredRuntime* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_LayeredRuntime_serialize_ex(const envoy_config_bootstrap_v3_LayeredRuntime* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_bootstrap_v3_LayeredRuntime_has_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_bootstrap_v3_LayeredRuntime_clear_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer* const* envoy_config_bootstrap_v3_LayeredRuntime_layers(const envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* len) {
+ return (const envoy_config_bootstrap_v3_RuntimeLayer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE bool envoy_config_bootstrap_v3_LayeredRuntime_has_layers(const envoy_config_bootstrap_v3_LayeredRuntime *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_bootstrap_v3_RuntimeLayer* const* envoy_config_bootstrap_v3_LayeredRuntime_layers(const envoy_config_bootstrap_v3_LayeredRuntime *msg, size_t *len) { return (const envoy_config_bootstrap_v3_RuntimeLayer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_mutable_layers(envoy_config_bootstrap_v3_LayeredRuntime *msg, size_t *len) {
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_mutable_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t* len) {
return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_resize_layers(envoy_config_bootstrap_v3_LayeredRuntime *msg, size_t len, upb_arena *arena) {
- return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer** envoy_config_bootstrap_v3_LayeredRuntime_resize_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_RuntimeLayer**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_LayeredRuntime_add_layers(envoy_config_bootstrap_v3_LayeredRuntime *msg, upb_arena *arena) {
- struct envoy_config_bootstrap_v3_RuntimeLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer*)_upb_msg_new(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_LayeredRuntime_add_layers(envoy_config_bootstrap_v3_LayeredRuntime* msg, upb_Arena* arena) {
+ struct envoy_config_bootstrap_v3_RuntimeLayer* sub = (struct envoy_config_bootstrap_v3_RuntimeLayer*)_upb_Message_New(&envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+/* envoy.config.bootstrap.v3.CustomInlineHeader */
+
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_CustomInlineHeader_new(upb_Arena* arena) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_Message_New(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_CustomInlineHeader_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_CustomInlineHeader* ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_CustomInlineHeader_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_bootstrap_v3_CustomInlineHeader* ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_CustomInlineHeader_serialize(const envoy_config_bootstrap_v3_CustomInlineHeader* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_bootstrap_v3_CustomInlineHeader_serialize_ex(const envoy_config_bootstrap_v3_CustomInlineHeader* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_clear_inline_header_name(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_name(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_clear_inline_header_type(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_type(const envoy_config_bootstrap_v3_CustomInlineHeader* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_name(envoy_config_bootstrap_v3_CustomInlineHeader *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_type(envoy_config_bootstrap_v3_CustomInlineHeader *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+extern const upb_MiniTable_File envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
index b3f086de..5944f119 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -18,56 +18,77 @@
#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_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_submsgs[2] = {
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit},
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit = {
&envoy_config_cluster_v3_CircuitBreakers_submsgs[0],
&envoy_config_cluster_v3_CircuitBreakers__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[2] = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 2, 1, 11, 1},
- {4, UPB_SIZE(20, 32), 3, 1, 11, 1},
- {5, UPB_SIZE(24, 40), 4, 1, 11, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(28, 48), 5, 1, 11, 1},
- {8, UPB_SIZE(32, 56), 6, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 48), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 56), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(36, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_config_cluster_v3_CircuitBreakers_msginit,
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
+};
+
+const upb_MiniTable_File envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
index 8d609960..77452f90 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,86 +26,188 @@ 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;
+extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_CircuitBreakers_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_CircuitBreakers* ret = envoy_config_cluster_v3_CircuitBreakers_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_cluster_v3_CircuitBreakers_serialize_ex(const envoy_config_cluster_v3_CircuitBreakers* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, options, arena, len);
}
-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 void envoy_config_cluster_v3_CircuitBreakers_clear_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) {
+ _upb_array_detach(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 bool envoy_config_cluster_v3_CircuitBreakers_has_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_clear_per_host_thresholds(const envoy_config_cluster_v3_CircuitBreakers* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const* envoy_config_cluster_v3_CircuitBreakers_per_host_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(4, 8), 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_mutable_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t* len) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds** envoy_config_cluster_v3_CircuitBreakers_resize_per_host_thresholds(envoy_config_cluster_v3_CircuitBreakers* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_add_per_host_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_Message_New(&envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &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 envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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_hasbit(msg, 5); }
-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_hasbit(msg, 6); }
-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 envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_CircuitBreakers_Thresholds_serialize_ex(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_priority(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_has_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connections(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_pending_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_requests(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_retries(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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 void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_track_remaining(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_max_connection_pools(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_clear_retry_budget(const envoy_config_cluster_v3_CircuitBreakers_Thresholds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(4, 4), int32_t) = value;
@@ -114,10 +216,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_conne
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connections(msg, sub);
}
@@ -127,10 +229,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pendi
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_pending_requests(msg, sub);
}
@@ -140,10 +242,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_reque
_upb_sethas(msg, 3);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_requests(msg, sub);
}
@@ -153,10 +255,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retri
_upb_sethas(msg, 4);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_retries(msg, sub);
}
@@ -169,10 +271,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_conne
_upb_sethas(msg, 5);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_max_connection_pools(msg, sub);
}
@@ -182,10 +284,10 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_set_retry_bud
_upb_sethas(msg, 6);
*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) {
+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);
+ sub = (struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_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);
}
@@ -194,37 +296,62 @@ UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_serialize_ex(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_clear_min_retry_concurrency(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_UInt32Value*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_has_budget_percent(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_CircuitBreakers_Thresholds_RetryBudget_mutable_budget_percent(envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_set_budget_percent(msg, sub);
}
@@ -234,16 +361,18 @@ UPB_INLINE void envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_s
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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;
}
+extern const upb_MiniTable_File envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
index 8854ed02..57b08122 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -18,6 +18,7 @@
#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/core/v3/resolver.upb.h"
#include "envoy/config/endpoint/v3/endpoint.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -25,6 +26,8 @@
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "xds/core/v3/collection_entry.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"
@@ -32,421 +35,508 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
- &xds_core_v3_CollectionEntry_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
+ {.submsg = &xds_core_v3_CollectionEntry_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_ClusterCollection__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_ClusterCollection__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msginit = {
&envoy_config_cluster_v3_ClusterCollection_submsgs[0],
&envoy_config_cluster_v3_ClusterCollection__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_submsgs[32] = {
- &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_PreconnectPolicy_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(24, 24), 0, 0, 9, 1},
- {2, UPB_SIZE(160, 296), UPB_SIZE(-165, -305), 0, 14, 1},
- {3, UPB_SIZE(40, 56), 1, 3, 11, 1},
- {4, UPB_SIZE(44, 64), 2, 30, 11, 1},
- {5, UPB_SIZE(48, 72), 3, 31, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {8, UPB_SIZE(140, 256), 0, 21, 11, 3},
- {9, UPB_SIZE(52, 80), 4, 31, 11, 1},
- {10, UPB_SIZE(56, 88), 5, 0, 11, 1},
- {13, UPB_SIZE(60, 96), 6, 22, 11, 1},
- {14, UPB_SIZE(64, 104), 7, 23, 11, 1},
- {16, UPB_SIZE(68, 112), 8, 30, 11, 1},
- {17, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {18, UPB_SIZE(144, 264), 0, 18, 11, 3},
- {19, UPB_SIZE(72, 120), 9, 15, 11, 1},
- {20, UPB_SIZE(76, 128), 10, 30, 11, 1},
- {21, UPB_SIZE(80, 136), 11, 19, 11, 1},
- {22, UPB_SIZE(84, 144), 12, 4, 11, 1},
- {23, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 10, 11, 1},
- {24, UPB_SIZE(88, 152), 13, 26, 11, 1},
- {25, UPB_SIZE(92, 160), 14, 25, 11, 1},
- {26, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {27, UPB_SIZE(96, 168), 15, 1, 11, 1},
- {28, UPB_SIZE(32, 40), 0, 0, 9, 1},
- {29, UPB_SIZE(100, 176), 16, 24, 11, 1},
- {30, UPB_SIZE(104, 184), 17, 17, 11, 1},
- {31, UPB_SIZE(16, 16), 0, 0, 8, 1},
- {32, UPB_SIZE(17, 17), 0, 0, 8, 1},
- {33, UPB_SIZE(108, 192), 18, 29, 11, 1},
- {34, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 7, 11, 1},
- {36, UPB_SIZE(148, 272), 0, 12, 11, _UPB_LABEL_MAP},
- {37, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 5, 11, 1},
- {38, UPB_SIZE(160, 296), UPB_SIZE(-165, -305), 2, 11, 1},
- {39, UPB_SIZE(18, 18), 0, 0, 8, 1},
- {40, UPB_SIZE(152, 280), 0, 13, 11, 3},
- {41, UPB_SIZE(112, 200), 19, 14, 11, 1},
- {42, UPB_SIZE(116, 208), 20, 20, 11, 1},
- {43, UPB_SIZE(156, 288), 0, 11, 11, 3},
- {44, UPB_SIZE(120, 216), 21, 9, 11, 1},
- {45, UPB_SIZE(19, 19), 0, 0, 8, 1},
- {46, UPB_SIZE(124, 224), 22, 28, 11, 1},
- {47, UPB_SIZE(20, 20), 0, 0, 8, 1},
- {48, UPB_SIZE(128, 232), 23, 27, 11, 1},
- {49, UPB_SIZE(132, 240), 24, 16, 11, 1},
- {50, UPB_SIZE(136, 248), 25, 8, 11, 1},
- {51, UPB_SIZE(21, 21), 0, 0, 8, 1},
- {52, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 6, 11, 1},
-};
-
-const upb_msglayout envoy_config_cluster_v3_Cluster_msginit = {
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_submsgs[39] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msginit},
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_cluster_v3_OutlierDetection_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_BindConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit},
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit},
+ {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit},
+ {.submsg = &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit},
+ {.submsg = &envoy_config_cluster_v3_Filter_msginit},
+ {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RefreshRate_msginit},
+ {.submsg = &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_TrackClusterStats_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster__fields[51] = {
+ {1, UPB_SIZE(40, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(32, 328), UPB_SIZE(-21, -21), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(48, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(52, 56), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(56, 64), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(60, 72), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(64, 80), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(68, 88), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(72, 96), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(76, 104), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(80, 112), UPB_SIZE(8, 8), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(84, 120), UPB_SIZE(0, 0), 9, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(88, 128), UPB_SIZE(9, 9), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(92, 136), UPB_SIZE(10, 10), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(96, 144), UPB_SIZE(11, 11), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(100, 152), UPB_SIZE(12, 12), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(104, 160), UPB_SIZE(13, 13), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(108, 168), UPB_SIZE(14, 14), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(112, 176), UPB_SIZE(15, 15), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(116, 184), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {29, UPB_SIZE(124, 200), UPB_SIZE(16, 16), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(128, 208), UPB_SIZE(17, 17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {32, UPB_SIZE(17, 17), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {33, UPB_SIZE(132, 216), UPB_SIZE(18, 18), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {34, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {36, UPB_SIZE(136, 224), UPB_SIZE(0, 0), 22, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {37, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {38, UPB_SIZE(32, 328), UPB_SIZE(-21, -21), 24, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {39, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {40, UPB_SIZE(140, 232), UPB_SIZE(0, 0), 25, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {41, UPB_SIZE(144, 240), UPB_SIZE(19, 19), 26, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {42, UPB_SIZE(148, 248), UPB_SIZE(20, 20), 27, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {43, UPB_SIZE(152, 256), UPB_SIZE(0, 0), 28, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {44, UPB_SIZE(156, 264), UPB_SIZE(21, 21), 29, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {45, UPB_SIZE(25, 25), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {46, UPB_SIZE(160, 272), UPB_SIZE(22, 22), 30, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {47, UPB_SIZE(26, 26), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {48, UPB_SIZE(164, 280), UPB_SIZE(23, 23), 31, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {49, UPB_SIZE(168, 288), UPB_SIZE(24, 24), 32, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {50, UPB_SIZE(172, 296), UPB_SIZE(25, 25), 33, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {51, UPB_SIZE(27, 27), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {52, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 34, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {53, UPB_SIZE(176, 304), UPB_SIZE(26, 26), 35, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {54, UPB_SIZE(180, 312), UPB_SIZE(27, 27), 36, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {55, UPB_SIZE(184, 320), UPB_SIZE(28, 28), 37, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {56, UPB_SIZE(36, 336), UPB_SIZE(-29, -29), 38, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit = {
&envoy_config_cluster_v3_Cluster_submsgs[0],
&envoy_config_cluster_v3_Cluster__fields[0],
- UPB_SIZE(176, 336), 47, false, 255,
+ UPB_SIZE(188, 344), 51, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit = {
+const upb_MiniTable 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), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[7] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 1, 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},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[7] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(10, 10), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(11, 11), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(20, 40), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {3, UPB_SIZE(12, 16), 0, 0, 9, 3},
- {4, UPB_SIZE(4, 4), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
NULL,
&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0],
- UPB_SIZE(16, 24), 4, false, 255,
+ UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[3] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[0],
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[1] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[3] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[1] = {
- &google_protobuf_UInt64Value_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt64Value_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {4, UPB_SIZE(12, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
- &google_protobuf_UInt64Value_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = {
NULL,
&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[6] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit},
+ {.submsg = &envoy_config_core_v3_HealthStatusSet_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 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), 2, 4, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {7, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[8] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(32, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-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_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit = {
+const upb_MiniTable 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(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = {
- {1, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[1] = {
- &google_protobuf_DoubleValue_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[2] = {
+ {.submsg = &google_protobuf_DoubleValue_msginit},
+ {.submsg = &google_protobuf_DoubleValue_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit = {
&envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[0],
&envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msginit = {
&envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[0],
&envoy_config_cluster_v3_LoadBalancingPolicy__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[1] = {
+ {4, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
- &envoy_config_core_v3_Address_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_UpstreamBindConfig__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_UpstreamBindConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_UpstreamBindConfig_msginit = {
&envoy_config_cluster_v3_UpstreamBindConfig_submsgs[0],
&envoy_config_cluster_v3_UpstreamBindConfig__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
- &envoy_config_core_v3_TcpKeepalive_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TcpKeepalive_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = {
&envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[0],
&envoy_config_cluster_v3_UpstreamConnectionOptions__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_cluster_v3_TrackClusterStats__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msginit = {
NULL,
&envoy_config_cluster_v3_TrackClusterStats__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[25] = {
+ &envoy_config_cluster_v3_ClusterCollection_msginit,
+ &envoy_config_cluster_v3_Cluster_msginit,
+ &envoy_config_cluster_v3_Cluster_TransportSocketMatch_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_LbSubsetConfig_LbSubsetSelector_msginit,
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
+ &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit,
+ &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
+ &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
+ &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
+ &envoy_config_cluster_v3_UpstreamBindConfig_msginit,
+ &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
+ &envoy_config_cluster_v3_TrackClusterStats_msginit,
+};
+
+const upb_MiniTable_File envoy_config_cluster_v3_cluster_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 25,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
index da4d6206..177f3292 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,8 @@ 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_SlowStartConfig;
+struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig;
struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
struct envoy_config_cluster_v3_Cluster_RingHashLbConfig;
struct envoy_config_cluster_v3_Cluster_MaglevLbConfig;
@@ -50,6 +52,8 @@ typedef struct envoy_config_cluster_v3_Cluster_CustomClusterType envoy_config_cl
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_SlowStartConfig envoy_config_cluster_v3_Cluster_SlowStartConfig;
+typedef struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig envoy_config_cluster_v3_Cluster_RoundRobinLbConfig;
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;
@@ -66,36 +70,40 @@ typedef struct envoy_config_cluster_v3_LoadBalancingPolicy_Policy envoy_config_c
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_PreconnectPolicy_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;
+extern const upb_MiniTable envoy_config_cluster_v3_ClusterCollection_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CustomClusterType_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_RefreshRate_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_UpstreamBindConfig_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_UpstreamConnectionOptions_msginit;
+extern const upb_MiniTable 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_DnsResolutionConfig;
struct envoy_config_core_v3_HealthCheck;
+struct envoy_config_core_v3_HealthStatusSet;
struct envoy_config_core_v3_Http1ProtocolOptions;
struct envoy_config_core_v3_Http2ProtocolOptions;
struct envoy_config_core_v3_HttpProtocolOptions;
@@ -108,37 +116,41 @@ struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
struct envoy_config_endpoint_v3_ClusterLoadAssignment;
struct envoy_type_v3_Percent;
struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
struct google_protobuf_DoubleValue;
struct google_protobuf_Duration;
struct google_protobuf_Struct;
struct google_protobuf_UInt32Value;
struct google_protobuf_UInt64Value;
struct xds_core_v3_CollectionEntry;
-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 xds_core_v3_CollectionEntry_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_CircuitBreakers_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_Filter_msginit;
+extern const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_DoubleValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable google_protobuf_UInt64Value_msginit;
+extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit;
typedef enum {
envoy_config_cluster_v3_Cluster_USE_CONFIGURED_PROTOCOL = 0,
@@ -156,7 +168,9 @@ typedef enum {
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_V6_ONLY = 2,
+ envoy_config_cluster_v3_Cluster_V4_PREFERRED = 3,
+ envoy_config_cluster_v3_Cluster_ALL = 4
} envoy_config_cluster_v3_Cluster_DnsLookupFamily;
typedef enum {
@@ -189,37 +203,56 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_ClusterCollection*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_ClusterCollection_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_ClusterCollection* ret = envoy_config_cluster_v3_ClusterCollection_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_ClusterCollection_serialize_ex(const envoy_config_cluster_v3_ClusterCollection* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_clear_entries(const envoy_config_cluster_v3_ClusterCollection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_entries(const envoy_config_cluster_v3_ClusterCollection* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_core_v3_CollectionEntry*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_entries(const envoy_config_cluster_v3_ClusterCollection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_core_v3_CollectionEntry*); }
UPB_INLINE void envoy_config_cluster_v3_ClusterCollection_set_entries(envoy_config_cluster_v3_ClusterCollection *msg, struct xds_core_v3_CollectionEntry* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_core_v3_CollectionEntry*) = value;
}
-UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_mutable_entries(envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCollection_mutable_entries(envoy_config_cluster_v3_ClusterCollection* msg, upb_Arena* arena) {
struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)envoy_config_cluster_v3_ClusterCollection_entries(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_CollectionEntry*)_upb_msg_new(&xds_core_v3_CollectionEntry_msginit, arena);
+ sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_ClusterCollection_set_entries(msg, sub);
}
@@ -228,140 +261,501 @@ UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_cluster_v3_ClusterCo
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster* ret = envoy_config_cluster_v3_Cluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_serialize_ex(const envoy_config_cluster_v3_Cluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msginit, options, 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(164, 304), int32_t); }
-
+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(20, 20), 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_round_robin_lb_config = 56,
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(172, 320), 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(24, 24), 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(164, 304)) == 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(160, 296), UPB_SIZE(164, 304), 2, 0); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 1); }
-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(40, 56), 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_hasbit(msg, 2); }
-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(44, 64), 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_hasbit(msg, 3); }
-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(48, 72), 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(4, 4), 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(140, 256)); }
-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(140, 256), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 4); }
-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(52, 80), 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_hasbit(msg, 5); }
-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(56, 88), 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_hasbit(msg, 6); }
-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(60, 96), 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_hasbit(msg, 7); }
-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(64, 104), 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_hasbit(msg, 8); }
-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(68, 112), 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(144, 264)); }
-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(144, 264), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 9); }
-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(72, 120), 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_hasbit(msg, 10); }
-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(76, 128), 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_hasbit(msg, 11); }
-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(80, 136), 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_hasbit(msg, 12); }
-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(84, 144), 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(172, 320)) == 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(168, 312), UPB_SIZE(172, 320), 23, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 13); }
-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(88, 152), 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_hasbit(msg, 14); }
-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(92, 160), 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(12, 12), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 15); }
-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(96, 168), 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(32, 40), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 16); }
-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(100, 176), 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_hasbit(msg, 17); }
-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(104, 184), 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(16, 16), 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(17, 17), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 18); }
-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(108, 192), 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(172, 320)) == 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(168, 312), UPB_SIZE(172, 320), 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(148, 272)); }
-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(148, 272)); }
-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(148, 272), &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(148, 272), 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(172, 320)) == 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(168, 312), UPB_SIZE(172, 320), 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(164, 304)) == 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(160, 296), UPB_SIZE(164, 304), 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(18, 18), 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(152, 280)); }
-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(152, 280), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 19); }
-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(112, 200), 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_hasbit(msg, 20); }
-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(116, 208), 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(156, 288)); }
-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(156, 288), len); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 21); }
-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(120, 216), 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(19, 19), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 22); }
-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(124, 224), 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(20, 20), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 23); }
-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(128, 232), 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_hasbit(msg, 24); }
-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(132, 240), const envoy_config_cluster_v3_TrackClusterStats*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_preconnect_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 25); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_preconnect_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(136, 248), const envoy_config_cluster_v3_Cluster_PreconnectPolicy*); }
-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(21, 21), 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(172, 320)) == 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(168, 312), UPB_SIZE(172, 320), 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(24, 24), upb_strview) = value;
+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(28, 28), int32_t);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_name(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_name(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 2;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_type(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(32, 328), 0, UPB_SIZE(20, 20), envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET);
+}
+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(32, 328), UPB_SIZE(20, 20), 2, 0);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_eds_cluster_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), const upb_Message*) = NULL;
+}
+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, 48), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connect_timeout(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), const upb_Message*) = NULL;
+}
+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, 56), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 64), const upb_Message*) = NULL;
+}
+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, 64), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), 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(60, 72));
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_health_checks(const envoy_config_cluster_v3_Cluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(60, 72));
+}
+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(60, 72), len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_max_requests_per_connection(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const upb_Message*) = NULL;
+}
+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(64, 80), 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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_circuit_breakers(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const upb_Message*) = NULL;
+}
+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(68, 88), 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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const upb_Message*) = NULL;
+}
+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(72, 96), 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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_http2_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const upb_Message*) = NULL;
+}
+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(76, 104), 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_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 112), const upb_Message*) = NULL;
+}
+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(80, 112), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_lookup_family(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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(84, 120));
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolvers(const envoy_config_cluster_v3_Cluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(84, 120));
+}
+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(84, 120), len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_outlier_detection(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const upb_Message*) = NULL;
+}
+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(88, 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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cleanup_interval(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 136), const upb_Message*) = NULL;
+}
+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(92, 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_bind_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const upb_Message*) = NULL;
+}
+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(96, 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_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lb_subset_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const upb_Message*) = NULL;
+}
+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(100, 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(28, 28)) == 23;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET);
+}
+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(36, 336), UPB_SIZE(28, 28), 23, NULL);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const upb_Message*) = NULL;
+}
+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(104, 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_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_metadata(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 168), const upb_Message*) = NULL;
+}
+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(108, 168), const struct envoy_config_core_v3_Metadata*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_protocol_selection(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+}
+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(12, 12), int32_t);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 176), const upb_Message*) = NULL;
+}
+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(112, 176), const envoy_config_cluster_v3_Cluster_CommonLbConfig*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_alt_stat_name(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_alt_stat_name(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_common_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const upb_Message*) = NULL;
+}
+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(124, 200), 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_hasbit(msg, 17);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_connection_options(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const upb_Message*) = NULL;
+}
+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(128, 208), const envoy_config_cluster_v3_UpstreamConnectionOptions*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_close_connections_on_host_health_failure(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
+}
+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(16, 16), bool);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool) = 0;
+}
+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(17, 17), bool);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 18);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_assignment(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL;
+}
+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(132, 216), 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(28, 28)) == 34;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_original_dst_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET);
+}
+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(36, 336), UPB_SIZE(28, 28), 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(136, 224));
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(136, 224));
+}
+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(136, 224));
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster* msg, upb_StringView key, struct google_protobuf_Any** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(136, 224), &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(136, 224), 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(28, 28)) == 37;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_least_request_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET);
+}
+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(36, 336), UPB_SIZE(28, 28), 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(20, 20)) == 38;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_cluster_type(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(32, 328), 0, UPB_SIZE(20, 20), envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET);
+}
+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(32, 328), UPB_SIZE(20, 20), 38, NULL);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_respect_dns_ttl(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+}
+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(24, 24), 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(140, 232));
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_filters(const envoy_config_cluster_v3_Cluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(140, 232));
+}
+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(140, 232), len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 19);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_load_balancing_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const upb_Message*) = NULL;
+}
+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(144, 240), 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_hasbit(msg, 20);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_lrs_server(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const upb_Message*) = NULL;
+}
+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(148, 248), 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(152, 256));
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_transport_socket_matches(const envoy_config_cluster_v3_Cluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(152, 256));
+}
+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(152, 256), len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 21);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const upb_Message*) = NULL;
+}
+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(156, 264), const envoy_config_cluster_v3_Cluster_RefreshRate*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = 0;
+}
+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(25, 25), bool);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 22);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_http_protocol_options(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const upb_Message*) = NULL;
+}
+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(160, 272), const struct envoy_config_core_v3_UpstreamHttpProtocolOptions*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_timeout_budgets(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = 0;
+}
+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(26, 26), bool);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 23);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_upstream_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const upb_Message*) = NULL;
+}
+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(164, 280), 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_hasbit(msg, 24);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_track_cluster_stats(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const upb_Message*) = NULL;
+}
+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(168, 288), const envoy_config_cluster_v3_TrackClusterStats*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 25);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(172, 296), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_preconnect_policy(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(172, 296), const envoy_config_cluster_v3_Cluster_PreconnectPolicy*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = 0;
+}
+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(27, 27), 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(28, 28)) == 52;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_maglev_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET);
+}
+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(36, 336), UPB_SIZE(28, 28), 52, NULL);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 26);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_dns_resolution_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const struct envoy_config_core_v3_DnsResolutionConfig*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 27);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_hasbit(msg, 28);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(184, 320), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(28, 28)) == 56;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_clear_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), 0, UPB_SIZE(28, 28), envoy_config_cluster_v3_Cluster_lb_config_NOT_SET);
+}
+UPB_INLINE const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_round_robin_lb_config(const envoy_config_cluster_v3_Cluster* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), UPB_SIZE(28, 28), 56, NULL);
+}
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_name(envoy_config_cluster_v3_Cluster *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 32), upb_StringView) = 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(160, 296), value, UPB_SIZE(164, 304), 2);
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(32, 328), value, UPB_SIZE(20, 20), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), envoy_config_cluster_v3_Cluster_EdsClusterConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_eds_cluster_config(msg, sub);
}
@@ -369,12 +763,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connect_timeout(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 64), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_connect_timeout(msg, sub);
}
@@ -382,12 +776,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_muta
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 64), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_per_connection_buffer_limit_bytes(msg, sub);
}
@@ -396,27 +790,26 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_m
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(4, 4), 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(140, 256), len);
+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(60, 72), 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_accessor2(msg, UPB_SIZE(140, 256), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(60, 72), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(140, 256), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HealthCheck_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 72), UPB_SIZE(2, 3), &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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 80), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 80), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_max_requests_per_connection(msg, sub);
}
@@ -424,12 +817,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_m
}
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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), struct envoy_config_cluster_v3_CircuitBreakers*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_CircuitBreakers*)_upb_Message_New(&envoy_config_cluster_v3_CircuitBreakers_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_circuit_breakers(msg, sub);
}
@@ -437,12 +830,12 @@ UPB_INLINE struct envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_
}
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_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 96), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_http_protocol_options(msg, sub);
}
@@ -450,12 +843,12 @@ UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_config_cluste
}
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_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_http2_protocol_options(msg, sub);
}
@@ -463,12 +856,12 @@ UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_cluste
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 112), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_dns_refresh_rate(msg, sub);
}
@@ -477,27 +870,26 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_muta
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(144, 264), len);
+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(84, 120), 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_accessor2(msg, UPB_SIZE(144, 264), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(84, 120), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(144, 264), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(84, 120), UPB_SIZE(2, 3), &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_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), struct envoy_config_cluster_v3_OutlierDetection*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_OutlierDetection*)_upb_Message_New(&envoy_config_cluster_v3_OutlierDetection_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_outlier_detection(msg, sub);
}
@@ -505,12 +897,12 @@ UPB_INLINE struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cleanup_interval(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_cleanup_interval(msg, sub);
}
@@ -518,12 +910,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_muta
}
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_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), struct envoy_config_core_v3_BindConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 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) {
+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);
+ sub = (struct envoy_config_core_v3_BindConfig*)_upb_Message_New(&envoy_config_core_v3_BindConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_upstream_bind_config(msg, sub);
}
@@ -531,24 +923,24 @@ UPB_INLINE struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Clust
}
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_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 144), envoy_config_cluster_v3_Cluster_LbSubsetConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_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(168, 312), value, UPB_SIZE(172, 320), 23);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_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);
}
@@ -556,12 +948,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config
}
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_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(88, 152), struct envoy_config_core_v3_TransportSocket*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 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) {
+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);
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_transport_socket(msg, sub);
}
@@ -569,12 +961,12 @@ UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_metadata(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 160), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_metadata(msg, sub);
}
@@ -585,28 +977,28 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_protocol_selection(envoy_con
}
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_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(96, 168), envoy_config_cluster_v3_Cluster_CommonLbConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_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(32, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_alt_stat_name(envoy_config_cluster_v3_Cluster *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 184), upb_StringView) = 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_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 176), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_HttpProtocolOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_common_http_protocol_options(msg, sub);
}
@@ -614,12 +1006,12 @@ UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_config_cluster
}
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_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(104, 184), envoy_config_cluster_v3_UpstreamConnectionOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 208), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_New(&envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_upstream_connection_options(msg, sub);
}
@@ -633,81 +1025,86 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ignore_health_on_host_remova
}
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_sethas(msg, 18);
- *UPB_PTR_AT(msg, UPB_SIZE(108, 192), struct envoy_config_endpoint_v3_ClusterLoadAssignment*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), 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) {
+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);
+ sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_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(168, 312), value, UPB_SIZE(172, 320), 34);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_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(148, 272)); }
-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(148, 272), &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(148, 272), &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(148, 272), iter); }
+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(136, 224)); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(136, 224), &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_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(136, 224), &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(136, 224), 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(168, 312), value, UPB_SIZE(172, 320), 37);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)_upb_Message_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(160, 296), value, UPB_SIZE(164, 304), 38);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(32, 328), value, UPB_SIZE(20, 20), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_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(18, 18), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), 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(152, 280), len);
+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(140, 232), 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_accessor2(msg, UPB_SIZE(152, 280), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(140, 232), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(152, 280), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_cluster_v3_Filter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(140, 232), UPB_SIZE(2, 3), &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_sethas(msg, 19);
- *UPB_PTR_AT(msg, UPB_SIZE(112, 200), envoy_config_cluster_v3_LoadBalancingPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 240), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_load_balancing_policy(msg, sub);
}
@@ -715,70 +1112,69 @@ UPB_INLINE struct envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_clus
}
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_sethas(msg, 20);
- *UPB_PTR_AT(msg, UPB_SIZE(116, 208), struct envoy_config_core_v3_ConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_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(156, 288), len);
+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(152, 256), 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_accessor2(msg, UPB_SIZE(156, 288), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(152, 256), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(156, 288), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(152, 256), UPB_SIZE(2, 3), &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_sethas(msg, 21);
- *UPB_PTR_AT(msg, UPB_SIZE(120, 216), envoy_config_cluster_v3_Cluster_RefreshRate*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_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(19, 19), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), 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_sethas(msg, 22);
- *UPB_PTR_AT(msg, UPB_SIZE(124, 224), struct envoy_config_core_v3_UpstreamHttpProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(160, 272), 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) {
+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);
+ sub = (struct envoy_config_core_v3_UpstreamHttpProtocolOptions*)_upb_Message_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(20, 20), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(26, 26), 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_sethas(msg, 23);
- *UPB_PTR_AT(msg, UPB_SIZE(128, 232), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(164, 280), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_upstream_config(msg, sub);
}
@@ -786,12 +1182,12 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluste
}
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_sethas(msg, 24);
- *UPB_PTR_AT(msg, UPB_SIZE(132, 240), envoy_config_cluster_v3_TrackClusterStats*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_New(&envoy_config_cluster_v3_TrackClusterStats_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_track_cluster_stats(msg, sub);
}
@@ -799,70 +1195,151 @@ UPB_INLINE struct envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluste
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_preconnect_policy(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_PreconnectPolicy* value) {
_upb_sethas(msg, 25);
- *UPB_PTR_AT(msg, UPB_SIZE(136, 248), envoy_config_cluster_v3_Cluster_PreconnectPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(172, 296), envoy_config_cluster_v3_Cluster_PreconnectPolicy*) = value;
}
-UPB_INLINE struct envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_mutable_preconnect_policy(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_mutable_preconnect_policy(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) {
struct envoy_config_cluster_v3_Cluster_PreconnectPolicy* sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)envoy_config_cluster_v3_Cluster_preconnect_policy(msg);
if (sub == NULL) {
- sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena);
+ sub = (struct envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_set_preconnect_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(21, 21), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(27, 27), 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(168, 312), value, UPB_SIZE(172, 320), 52);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_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;
}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_resolution_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) {
+ _upb_sethas(msg, 26);
+ *UPB_PTR_AT(msg, UPB_SIZE(176, 304), struct envoy_config_core_v3_DnsResolutionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_mutable_dns_resolution_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_cluster_v3_Cluster_dns_resolution_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_dns_resolution_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 27);
+ *UPB_PTR_AT(msg, UPB_SIZE(180, 312), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_mutable_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 28);
+ *UPB_PTR_AT(msg, UPB_SIZE(184, 320), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_typed_dns_resolver_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_typed_dns_resolver_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(36, 336), value, UPB_SIZE(28, 28), 56);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_mutable_round_robin_lb_config(envoy_config_cluster_v3_Cluster* msg, upb_Arena* arena) {
+ struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)envoy_config_cluster_v3_Cluster_round_robin_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_round_robin_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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_TransportSocketMatch* ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_TransportSocketMatch_serialize_ex(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, options, arena, len);
}
-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 void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_name(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_TransportSocketMatch_name(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_clear_transport_socket(const envoy_config_cluster_v3_Cluster_TransportSocketMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct envoy_config_core_v3_TransportSocket*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_TransportSocketMatch_has_match(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_name(envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_match(msg, sub);
}
@@ -872,10 +1349,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transpo
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_New(&envoy_config_core_v3_TransportSocket_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_TransportSocketMatch_set_transport_socket(msg, sub);
}
@@ -884,39 +1361,62 @@ UPB_INLINE struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_CustomClusterType*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_CustomClusterType_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_CustomClusterType* ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_CustomClusterType_serialize_ex(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_clear_name(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_CustomClusterType_name(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_clear_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Any*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CustomClusterType_has_typed_config(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CustomClusterType_set_name(envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_CustomClusterType_set_typed_config(msg, sub);
}
@@ -925,74 +1425,147 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Cluster_CustomClu
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_EdsClusterConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig* ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_EdsClusterConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_clear_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(const envoy_config_cluster_v3_Cluster_EdsClusterConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_EdsClusterConfig_has_eds_config(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview); }
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_cluster_v3_Cluster_EdsClusterConfig_mutable_eds_config(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_cluster_v3_Cluster_EdsClusterConfig_set_service_name(envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_Cluster_LbSubsetConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_subset_selectors(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ _upb_array_detach(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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_locality_weight_aware(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_scale_locality_weight(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+}
+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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_panic_mode_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
+}
+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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_clear_list_as_any(const envoy_config_cluster_v3_Cluster_LbSubsetConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0;
+}
+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 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(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_has_default_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 4), int32_t) = value;
@@ -1001,25 +1574,24 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_default_subse
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_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) {
+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_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -1038,89 +1610,306 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_set_list_as_any(e
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_serialize_ex(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
+}
+UPB_INLINE upb_StringView const* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_policy(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_fallback_keys_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE upb_StringView 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_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_clear_single_host_per_subset(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+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(4, 4), bool);
}
-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(8, 8), 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(12, 16), 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(4, 4), 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(8, 8), len);
+UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), 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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &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(12, 16), len);
+UPB_INLINE upb_StringView* envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), 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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_add_fallback_keys_subset(envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &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(4, 4), bool) = value;
}
-/* envoy.config.cluster.v3.Cluster.LeastRequestLbConfig */
+/* envoy.config.cluster.v3.Cluster.SlowStartConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_SlowStartConfig_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_SlowStartConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_SlowStartConfig* ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_SlowStartConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_SlowStartConfig* ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_SlowStartConfig_serialize(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_SlowStartConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_clear_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_SlowStartConfig_min_weight_percent(const envoy_config_cluster_v3_Cluster_SlowStartConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*);
+}
-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 void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
}
-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 struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(msg, sub);
+ }
+ return sub;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeDouble*) = value;
}
-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 struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_New(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_min_weight_percent(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct envoy_type_v3_Percent* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_v3_Percent*) = value;
+}
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_min_weight_percent(envoy_config_cluster_v3_Cluster_SlowStartConfig* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_cluster_v3_Cluster_SlowStartConfig_min_weight_percent(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_SlowStartConfig_set_min_weight_percent(msg, sub);
+ }
+ return sub;
}
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); }
+/* envoy.config.cluster.v3.Cluster.RoundRobinLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_clear_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_cluster_v3_Cluster_SlowStartConfig*);
+}
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* msg, upb_Arena* arena) {
+ struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(msg, sub);
+ }
+ return sub;
+}
+
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct envoy_config_core_v3_RuntimeDouble*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_clear_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_cluster_v3_Cluster_SlowStartConfig*);
+}
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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(msg, sub);
}
@@ -1130,50 +1919,93 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_active_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_Message_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;
}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* msg, upb_Arena* arena) {
+ struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_RingHashLbConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig* ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_Cluster_RingHashLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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 void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_hash_function(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_clear_maximum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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 bool envoy_config_cluster_v3_Cluster_RingHashLbConfig_has_minimum_ring_size(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 4), 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_hasbit(msg, 2); }
-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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_minimum_ring_size(msg, sub);
}
@@ -1186,10 +2018,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_rin
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_RingHashLbConfig_set_maximum_ring_size(msg, sub);
}
@@ -1198,35 +2030,53 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_R
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_MaglevLbConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_MaglevLbConfig* ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_Cluster_MaglevLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_MaglevLbConfig_has_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_MaglevLbConfig_clear_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_UInt64Value*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_MaglevLbConfig_has_table_size(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_MaglevLbConfig_set_table_size(msg, sub);
}
@@ -1235,25 +2085,41 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_cluster_v3_Cluster_M
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_clear_use_http_header(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 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;
@@ -1261,76 +2127,142 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_set_use_http
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_CommonLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, options, 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(1, 1), 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(2, 2), 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_hasbit(msg, 3); }
-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 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(4, 4), 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_healthy_panic_threshold(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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(12, 16), 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(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_zone_aware_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET);
+}
+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(28, 48), UPB_SIZE(4, 4), 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(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_locality_weighted_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_NOT_SET);
+}
+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(28, 48), UPB_SIZE(4, 4), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_update_merge_window(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_ignore_new_hosts_until_first_hc(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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(8, 8), bool);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_close_connections_on_host_set_change(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+}
+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(9, 9), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_consistent_hashing_lb_config(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_has_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_clear_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_HealthStatusSet* envoy_config_cluster_v3_Cluster_CommonLbConfig_override_host_status(const envoy_config_cluster_v3_Cluster_CommonLbConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_config_core_v3_HealthStatusSet*);
+}
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_Percent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_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);
}
@@ -1338,71 +2270,114 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeighte
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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_cluster_v3_Cluster_CommonLbConfig_mutable_update_merge_window(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(1, 1), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), 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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), 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) {
+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);
+ sub = (struct envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_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;
}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_set_override_host_status(envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, struct envoy_config_core_v3_HealthStatusSet* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_config_core_v3_HealthStatusSet*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HealthStatusSet* envoy_config_cluster_v3_Cluster_CommonLbConfig_mutable_override_host_status(envoy_config_cluster_v3_Cluster_CommonLbConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_HealthStatusSet* sub = (struct envoy_config_core_v3_HealthStatusSet*)envoy_config_cluster_v3_Cluster_CommonLbConfig_override_host_status(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_set_override_host_status(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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_min_cluster_size(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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 void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_clear_fail_traffic_on_panic(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_has_routing_enabled(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(1, 1), 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_routing_enabled(msg, sub);
}
@@ -1412,10 +2387,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_set_min_cluster_size(msg, sub);
}
@@ -1427,49 +2402,83 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_serialize_ex(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_clear_use_hostname_for_hashing(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_clear_hash_balance_factor(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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 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(1, 1), 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_hasbit(msg, 1); }
-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(1, 1), bool) = value;
@@ -1478,10 +2487,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashing
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_set_hash_balance_factor(msg, sub);
}
@@ -1490,37 +2499,62 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_C
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_RefreshRate*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_RefreshRate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_RefreshRate* ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_RefreshRate_serialize_ex(const envoy_config_cluster_v3_Cluster_RefreshRate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_clear_max_interval(const envoy_config_cluster_v3_Cluster_RefreshRate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_RefreshRate_has_base_interval(const envoy_config_cluster_v3_Cluster_RefreshRate *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_base_interval(envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_RefreshRate_set_base_interval(msg, sub);
}
@@ -1530,10 +2564,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(env
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_RefreshRate_set_max_interval(msg, sub);
}
@@ -1542,37 +2576,62 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_Refr
/* envoy.config.cluster.v3.Cluster.PreconnectPolicy */
-UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_PreconnectPolicy *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena);
+UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Cluster_PreconnectPolicy*)_upb_Message_New(&envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena);
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_cluster_v3_Cluster_PreconnectPolicy *ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_PreconnectPolicy* ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_cluster_v3_Cluster_PreconnectPolicy *ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Cluster_PreconnectPolicy* ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_cluster_v3_Cluster_PreconnectPolicy_serialize(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena, len);
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_PreconnectPolicy_serialize(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_Cluster_PreconnectPolicy_serialize_ex(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_clear_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_DoubleValue*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_per_upstream_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_DoubleValue*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_PreconnectPolicy_has_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_predictive_preconnect_ratio(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_DoubleValue*); }
UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, struct google_protobuf_DoubleValue* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_DoubleValue*) = value;
}
-UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_per_upstream_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena) {
struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PreconnectPolicy_per_upstream_preconnect_ratio(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_per_upstream_preconnect_ratio(msg, sub);
}
@@ -1582,10 +2641,10 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_predictive_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_DoubleValue*) = value;
}
-UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_predictive_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_PreconnectPolicy_mutable_predictive_preconnect_ratio(envoy_config_cluster_v3_Cluster_PreconnectPolicy* msg, upb_Arena* arena) {
struct google_protobuf_DoubleValue* sub = (struct google_protobuf_DoubleValue*)envoy_config_cluster_v3_Cluster_PreconnectPolicy_predictive_preconnect_ratio(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_DoubleValue*)_upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
+ sub = (struct google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Cluster_PreconnectPolicy_set_predictive_preconnect_ratio(msg, sub);
}
@@ -1594,13 +2653,15 @@ UPB_INLINE struct google_protobuf_DoubleValue* envoy_config_cluster_v3_Cluster_P
/* 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_INLINE upb_StringView envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_key(const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -1612,113 +2673,162 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEnt
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_LoadBalancingPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_LoadBalancingPolicy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_LoadBalancingPolicy_serialize_ex(const envoy_config_cluster_v3_LoadBalancingPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, options, 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 void envoy_config_cluster_v3_LoadBalancingPolicy_clear_policies(const envoy_config_cluster_v3_LoadBalancingPolicy* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_LoadBalancingPolicy_Policy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_LoadBalancingPolicy_Policy* ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_serialize_ex(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, options, 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) {
+ return _upb_hasbit(msg, 1);
}
-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_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_clear_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+
+UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = 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);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
- envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(msg, sub);
+ envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_UpstreamBindConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig* envoy_config_cluster_v3_UpstreamBindConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_UpstreamBindConfig* ret = envoy_config_cluster_v3_UpstreamBindConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_cluster_v3_UpstreamBindConfig_serialize_ex(const envoy_config_cluster_v3_UpstreamBindConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_UpstreamBindConfig_has_source_address(const envoy_config_cluster_v3_UpstreamBindConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_UpstreamBindConfig_clear_source_address(const envoy_config_cluster_v3_UpstreamBindConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_Address*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_UpstreamBindConfig_has_source_address(const envoy_config_cluster_v3_UpstreamBindConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_UpstreamBindConfig_set_source_address(msg, sub);
}
@@ -1727,63 +2837,111 @@ UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_Upstream
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_UpstreamConnectionOptions*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_cluster_v3_UpstreamConnectionOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_UpstreamConnectionOptions* ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_UpstreamConnectionOptions_serialize_ex(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_TcpKeepalive*);
+}
+UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_clear_set_local_interface_name_on_upstream_connections(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_set_local_interface_name_on_upstream_connections(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TcpKeepalive*)_upb_Message_New(&envoy_config_core_v3_TcpKeepalive_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_UpstreamConnectionOptions_set_tcp_keepalive(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_cluster_v3_UpstreamConnectionOptions_set_set_local_interface_name_on_upstream_connections(envoy_config_cluster_v3_UpstreamConnectionOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_TrackClusterStats*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_TrackClusterStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_TrackClusterStats* ret = envoy_config_cluster_v3_TrackClusterStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_TrackClusterStats_serialize_ex(const envoy_config_cluster_v3_TrackClusterStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_clear_timeout_budgets(const envoy_config_cluster_v3_TrackClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 void envoy_config_cluster_v3_TrackClusterStats_clear_request_response_sizes(const envoy_config_cluster_v3_TrackClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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 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;
@@ -1792,6 +2950,8 @@ UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_request_response_s
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+extern const upb_MiniTable_File envoy_config_cluster_v3_cluster_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
index 14230149..44fb9e5b 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/filter.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,32 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_Filter_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_Filter_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Filter__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_Filter__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_Filter_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_cluster_v3_Filter_msginit,
+};
+
+const upb_MiniTable_File envoy_config_cluster_v3_filter_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
index 1850b2a5..164e46c2 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,52 +22,78 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_cluster_v3_Filter_msginit;
struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_Filter*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_Filter* ret = envoy_config_cluster_v3_Filter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_cluster_v3_Filter_serialize_ex(const envoy_config_cluster_v3_Filter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_Filter_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_cluster_v3_Filter_clear_name(const envoy_config_cluster_v3_Filter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_cluster_v3_Filter_name(const envoy_config_cluster_v3_Filter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_Filter_clear_typed_config(const envoy_config_cluster_v3_Filter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Any*);
}
-UPB_INLINE upb_strview envoy_config_cluster_v3_Filter_name(const envoy_config_cluster_v3_Filter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Filter_has_typed_config(const envoy_config_cluster_v3_Filter *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_cluster_v3_Filter_set_name(envoy_config_cluster_v3_Filter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_cluster_v3_Filter_set_typed_config(envoy_config_cluster_v3_Filter *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_Filter_set_typed_config(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_cluster_v3_filter_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
index f90563f1..e584f53d 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/outlier_detection.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -17,39 +17,72 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_OutlierDetection_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_cluster_v3_OutlierDetection_submsgs[21] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_OutlierDetection__fields[21] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 48), 6, 1, 11, 1},
- {7, UPB_SIZE(28, 56), 7, 1, 11, 1},
- {8, UPB_SIZE(32, 64), 8, 1, 11, 1},
- {9, UPB_SIZE(36, 72), 9, 1, 11, 1},
- {10, UPB_SIZE(40, 80), 10, 1, 11, 1},
- {11, UPB_SIZE(44, 88), 11, 1, 11, 1},
- {12, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {13, UPB_SIZE(48, 96), 12, 1, 11, 1},
- {14, UPB_SIZE(52, 104), 13, 1, 11, 1},
- {15, UPB_SIZE(56, 112), 14, 1, 11, 1},
- {16, UPB_SIZE(60, 120), 15, 1, 11, 1},
- {17, UPB_SIZE(64, 128), 16, 1, 11, 1},
- {18, UPB_SIZE(68, 136), 17, 1, 11, 1},
- {19, UPB_SIZE(72, 144), 18, 1, 11, 1},
- {20, UPB_SIZE(76, 152), 19, 1, 11, 1},
- {21, UPB_SIZE(80, 160), 20, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_cluster_v3_OutlierDetection__fields[22] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 64), UPB_SIZE(8, 8), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 72), UPB_SIZE(9, 9), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(40, 80), UPB_SIZE(10, 10), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(44, 88), UPB_SIZE(11, 11), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(48, 96), UPB_SIZE(12, 12), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(52, 104), UPB_SIZE(13, 13), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(56, 112), UPB_SIZE(14, 14), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(60, 120), UPB_SIZE(15, 15), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(64, 128), UPB_SIZE(16, 16), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(68, 136), UPB_SIZE(17, 17), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(72, 144), UPB_SIZE(18, 18), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(76, 152), UPB_SIZE(19, 19), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(80, 160), UPB_SIZE(20, 20), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(84, 168), UPB_SIZE(21, 21), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit = {
+const upb_MiniTable envoy_config_cluster_v3_OutlierDetection_msginit = {
&envoy_config_cluster_v3_OutlierDetection_submsgs[0],
&envoy_config_cluster_v3_OutlierDetection__fields[0],
- UPB_SIZE(88, 168), 21, false, 255,
+ UPB_SIZE(88, 184), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_cluster_v3_OutlierDetection_msginit,
+};
+
+const upb_MiniTable_File envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
index 70b76232..89d6137e 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,83 +22,249 @@ extern "C" {
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;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_cluster_v3_OutlierDetection*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_OutlierDetection_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_cluster_v3_OutlierDetection* ret = envoy_config_cluster_v3_OutlierDetection_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_cluster_v3_OutlierDetection_serialize_ex(const envoy_config_cluster_v3_OutlierDetection* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_interval(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_base_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_percent(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_success_rate_stdev_factor(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_gateway_failure(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
+}
+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 void envoy_config_cluster_v3_OutlierDetection_clear_split_external_local_origin_errors(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+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(3, 3), bool);
+}
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ return _upb_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_local_origin_success_rate(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_threshold(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 17);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_enforcing_failure_percentage_local_origin(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 18);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_minimum_hosts(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 19);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_failure_percentage_request_volume(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const upb_Message*) = NULL;
+}
+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 bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ return _upb_hasbit(msg, 20);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ return _upb_hasbit(msg, 21);
+}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_clear_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_max_ejection_time_jitter(const envoy_config_cluster_v3_OutlierDetection* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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_hasbit(msg, 5); }
-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_hasbit(msg, 6); }
-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_hasbit(msg, 7); }
-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_hasbit(msg, 8); }
-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_hasbit(msg, 9); }
-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_hasbit(msg, 10); }
-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_hasbit(msg, 11); }
-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(3, 3), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_local_origin_failure(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_hasbit(msg, 12); }
-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_hasbit(msg, 13); }
-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_hasbit(msg, 14); }
-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_hasbit(msg, 15); }
-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_hasbit(msg, 16); }
-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_hasbit(msg, 17); }
-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_hasbit(msg, 18); }
-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_hasbit(msg, 19); }
-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 bool envoy_config_cluster_v3_OutlierDetection_has_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return _upb_hasbit(msg, 20); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_max_ejection_time(const envoy_config_cluster_v3_OutlierDetection *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct google_protobuf_Duration*); }
UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_consecutive_5xx(msg, sub);
}
@@ -108,10 +274,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_interval(envoy_conf
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_interval(msg, sub);
}
@@ -121,10 +287,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(
_upb_sethas(msg, 3);
*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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_base_ejection_time(msg, sub);
}
@@ -134,10 +300,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percen
_upb_sethas(msg, 4);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_max_ejection_percent(msg, sub);
}
@@ -147,10 +313,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecuti
_upb_sethas(msg, 5);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_5xx(msg, sub);
}
@@ -160,10 +326,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_r
_upb_sethas(msg, 6);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_success_rate(msg, sub);
}
@@ -173,10 +339,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimu
_upb_sethas(msg, 7);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_success_rate_minimum_hosts(msg, sub);
}
@@ -186,10 +352,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_reques
_upb_sethas(msg, 8);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_success_rate_request_volume(msg, sub);
}
@@ -199,10 +365,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_
_upb_sethas(msg, 9);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_success_rate_stdev_factor(msg, sub);
}
@@ -212,10 +378,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway
_upb_sethas(msg, 10);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_consecutive_gateway_failure(msg, sub);
}
@@ -225,10 +391,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecuti
_upb_sethas(msg, 11);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_gateway_failure(msg, sub);
}
@@ -241,10 +407,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_o
_upb_sethas(msg, 12);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_consecutive_local_origin_failure(msg, sub);
}
@@ -254,10 +420,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecuti
_upb_sethas(msg, 13);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub);
}
@@ -267,10 +433,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_ori
_upb_sethas(msg, 14);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub);
}
@@ -280,10 +446,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_
_upb_sethas(msg, 15);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_threshold(msg, sub);
}
@@ -293,10 +459,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_p
_upb_sethas(msg, 16);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage(msg, sub);
}
@@ -306,10 +472,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_p
_upb_sethas(msg, 17);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_enforcing_failure_percentage_local_origin(msg, sub);
}
@@ -319,10 +485,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_
_upb_sethas(msg, 18);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_minimum_hosts(msg, sub);
}
@@ -332,10 +498,10 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_
_upb_sethas(msg, 19);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_failure_percentage_request_volume(msg, sub);
}
@@ -345,15 +511,30 @@ UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time(e
_upb_sethas(msg, 20);
*UPB_PTR_AT(msg, UPB_SIZE(80, 160), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_time(envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_max_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_max_ejection_time(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time_jitter(envoy_config_cluster_v3_OutlierDetection *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 21);
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 168), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetection_mutable_max_ejection_time_jitter(envoy_config_cluster_v3_OutlierDetection* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_OutlierDetection_max_ejection_time_jitter(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_OutlierDetection_set_max_ejection_time_jitter(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c
new file mode 100644
index 00000000..86aac42f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c
@@ -0,0 +1,299 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/common/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/common/matcher/v3/matcher.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_submsgs[3] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher__fields[3] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher__fields[0],
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_OnMatch_submsgs[2] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_OnMatch__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_OnMatch_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_OnMatch__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate__fields[0],
+ UPB_SIZE(8, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[0],
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree__fields[0],
+ UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit = {
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[0],
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_MatchPredicate_submsgs[9] = {
+ {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate__fields[10] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit = {
+ &envoy_config_common_matcher_v3_MatchPredicate_submsgs[0],
+ &envoy_config_common_matcher_v3_MatchPredicate__fields[0],
+ UPB_SIZE(8, 24), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate_MatchSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit = {
+ &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[0],
+ &envoy_config_common_matcher_v3_MatchPredicate_MatchSet__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpHeadersMatch__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msginit = {
+ &envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[0],
+ &envoy_config_common_matcher_v3_HttpHeadersMatch__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[1] = {
+ {.submsg = &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyMatch__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit = {
+ &envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[0],
+ &envoy_config_common_matcher_v3_HttpGenericBodyMatch__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit = {
+ NULL,
+ &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[15] = {
+ &envoy_config_common_matcher_v3_Matcher_msginit,
+ &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit,
+ &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit,
+ &envoy_config_common_matcher_v3_MatchPredicate_msginit,
+ &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit,
+ &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit,
+ &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit,
+ &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit,
+};
+
+const upb_MiniTable_File envoy_config_common_matcher_v3_matcher_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 15,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h
new file mode 100644
index 00000000..bfc0bb14
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h
@@ -0,0 +1,1381 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/common/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_
+#define ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_common_matcher_v3_Matcher;
+struct envoy_config_common_matcher_v3_Matcher_OnMatch;
+struct envoy_config_common_matcher_v3_Matcher_MatcherList;
+struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate;
+struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate;
+struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList;
+struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher;
+struct envoy_config_common_matcher_v3_Matcher_MatcherTree;
+struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap;
+struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry;
+struct envoy_config_common_matcher_v3_MatchPredicate;
+struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet;
+struct envoy_config_common_matcher_v3_HttpHeadersMatch;
+struct envoy_config_common_matcher_v3_HttpGenericBodyMatch;
+struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch;
+typedef struct envoy_config_common_matcher_v3_Matcher envoy_config_common_matcher_v3_Matcher;
+typedef struct envoy_config_common_matcher_v3_Matcher_OnMatch envoy_config_common_matcher_v3_Matcher_OnMatch;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList envoy_config_common_matcher_v3_Matcher_MatcherList;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherTree envoy_config_common_matcher_v3_Matcher_MatcherTree;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap;
+typedef struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry;
+typedef struct envoy_config_common_matcher_v3_MatchPredicate envoy_config_common_matcher_v3_MatchPredicate;
+typedef struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet envoy_config_common_matcher_v3_MatchPredicate_MatchSet;
+typedef struct envoy_config_common_matcher_v3_HttpHeadersMatch envoy_config_common_matcher_v3_HttpHeadersMatch;
+typedef struct envoy_config_common_matcher_v3_HttpGenericBodyMatch envoy_config_common_matcher_v3_HttpGenericBodyMatch;
+typedef struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_OnMatch_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_HttpHeadersMatch_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit;
+extern const upb_MiniTable envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_route_v3_HeaderMatcher;
+struct envoy_type_matcher_v3_StringMatcher;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+
+
+
+/* envoy.config.common.matcher.v3.Matcher */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher* ret = envoy_config_common_matcher_v3_Matcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher* ret = envoy_config_common_matcher_v3_Matcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_serialize(const envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_serialize_ex(const envoy_config_common_matcher_v3_Matcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_Matcher_matcher_type_matcher_list = 1,
+ envoy_config_common_matcher_v3_Matcher_matcher_type_matcher_tree = 2,
+ envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET = 0
+} envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases envoy_config_common_matcher_v3_Matcher_matcher_type_case(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return (envoy_config_common_matcher_v3_Matcher_matcher_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_matcher_list(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_matcher_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_matcher_tree(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_has_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_clear_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_on_no_match(const envoy_config_common_matcher_v3_Matcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_config_common_matcher_v3_Matcher_OnMatch*);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_matcher_list(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_mutable_matcher_list(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList*)envoy_config_common_matcher_v3_Matcher_matcher_list(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_set_matcher_list(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_matcher_tree(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_mutable_matcher_tree(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherTree* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree*)envoy_config_common_matcher_v3_Matcher_matcher_tree(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_set_matcher_tree(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_set_on_no_match(envoy_config_common_matcher_v3_Matcher *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_config_common_matcher_v3_Matcher_OnMatch*) = value;
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_mutable_on_no_match(envoy_config_common_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_OnMatch* sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)envoy_config_common_matcher_v3_Matcher_on_no_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_set_on_no_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.OnMatch */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_OnMatch_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_OnMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_OnMatch* ret = envoy_config_common_matcher_v3_Matcher_OnMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_OnMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_OnMatch* ret = envoy_config_common_matcher_v3_Matcher_OnMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_OnMatch_serialize(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_OnMatch_serialize_ex(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_matcher = 1,
+ envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_action = 2,
+ envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET = 0
+} envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_case(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ return (envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_OnMatch_matcher(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_OnMatch_has_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_clear_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_OnMatch_action(const envoy_config_common_matcher_v3_Matcher_OnMatch* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_set_matcher(envoy_config_common_matcher_v3_Matcher_OnMatch *msg, envoy_config_common_matcher_v3_Matcher* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v3_Matcher_OnMatch_mutable_matcher(envoy_config_common_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher* sub = (struct envoy_config_common_matcher_v3_Matcher*)envoy_config_common_matcher_v3_Matcher_OnMatch_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_OnMatch_set_action(envoy_config_common_matcher_v3_Matcher_OnMatch *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_OnMatch_mutable_action(envoy_config_common_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_OnMatch_action(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_OnMatch_set_action(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherList */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_MatcherList_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_MatcherList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_common_matcher_v3_Matcher_MatcherList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_has_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_clear_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const* envoy_config_common_matcher_v3_Matcher_MatcherList_matchers(const envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* len) {
+ return (const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_mutable_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t* len) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher** envoy_config_common_matcher_v3_Matcher_MatcherList_resize_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_add_matchers(envoy_config_common_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_single_predicate = 1,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_or_matcher = 2,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_and_matcher = 3,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_not_matcher = 4,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET = 0
+} envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_case(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_single_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_or_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_and_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_mutable_not_matcher(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_value_match = 2,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_custom_match = 3,
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET = 0
+} envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_case(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_input(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_value_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.PredicateList */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_has_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) {
+ return (const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate** envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_add_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherList.FieldMatcher */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_has_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(const envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_common_matcher_v3_Matcher_OnMatch*);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*) = value;
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_predicate(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_common_matcher_v3_Matcher_OnMatch*) = value;
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_on_match(envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_OnMatch* sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherTree */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_MatcherTree_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_MatcherTree_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherTree* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_common_matcher_v3_Matcher_MatcherTree_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherTree* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherTree_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherTree_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_exact_match_map = 2,
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_prefix_match_map = 3,
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_custom_match = 4,
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET = 0
+} envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_case(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_input(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_exact_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_prefix_match_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_has_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_clear_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_custom_match(const envoy_config_common_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_input(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_input(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherTree_input(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_set_input(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_exact_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_exact_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)envoy_config_common_matcher_v3_Matcher_MatcherTree_exact_match_map(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_prefix_match_map(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)envoy_config_common_matcher_v3_Matcher_MatcherTree_prefix_match_map(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_set_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherTree *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_common_matcher_v3_Matcher_MatcherTree_mutable_custom_match(envoy_config_common_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_common_matcher_v3_Matcher_MatcherTree_custom_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap */
+
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* ret = envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_serialize(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_serialize_ex(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_has_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE size_t envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_get(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, envoy_config_common_matcher_v3_Matcher_OnMatch** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_next(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) {
+ return (const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_set(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, envoy_config_common_matcher_v3_Matcher_OnMatch* 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_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_delete(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0);
+}
+UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_map_nextmutable(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) {
+ return (envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+
+/* envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry */
+
+UPB_INLINE upb_StringView envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_key(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_value(const envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ envoy_config_common_matcher_v3_Matcher_OnMatch* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_set_value(envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry *msg, envoy_config_common_matcher_v3_Matcher_OnMatch* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(envoy_config_common_matcher_v3_Matcher_OnMatch*));
+}
+
+/* envoy.config.common.matcher.v3.MatchPredicate */
+
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_MatchPredicate* ret = envoy_config_common_matcher_v3_MatchPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_MatchPredicate* ret = envoy_config_common_matcher_v3_MatchPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_MatchPredicate_serialize(const envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_MatchPredicate_serialize_ex(const envoy_config_common_matcher_v3_MatchPredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_MatchPredicate_rule_or_match = 1,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_and_match = 2,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_not_match = 3,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_any_match = 4,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_request_headers_match = 5,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_request_trailers_match = 6,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_response_headers_match = 7,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_response_trailers_match = 8,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_request_generic_body_match = 9,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_http_response_generic_body_match = 10,
+ envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET = 0
+} envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases envoy_config_common_matcher_v3_MatchPredicate_rule_case(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return (envoy_config_common_matcher_v3_MatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_or_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_and_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_not_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_any_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_headers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_trailers_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_http_request_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_clear_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_common_matcher_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_http_response_generic_body_match(const envoy_config_common_matcher_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_or_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_mutable_or_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)envoy_config_common_matcher_v3_MatchPredicate_or_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_or_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_and_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_mutable_and_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)envoy_config_common_matcher_v3_MatchPredicate_and_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_and_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_not_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_MatchPredicate* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_MatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_mutable_not_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)envoy_config_common_matcher_v3_MatchPredicate_not_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_not_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_any_match(envoy_config_common_matcher_v3_MatchPredicate *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_headers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_headers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_request_headers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_trailers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_trailers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_request_trailers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_headers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_headers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_headers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_response_headers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_trailers_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_trailers_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpHeadersMatch* sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_trailers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_response_trailers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_request_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_request_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_request_generic_body_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_set_http_response_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate *msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_common_matcher_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_MatchPredicate_mutable_http_response_generic_body_match(envoy_config_common_matcher_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpGenericBodyMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)envoy_config_common_matcher_v3_MatchPredicate_http_response_generic_body_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_common_matcher_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.MatchPredicate.MatchSet */
+
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret = envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_MatchPredicate_MatchSet* ret = envoy_config_common_matcher_v3_MatchPredicate_MatchSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_serialize(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_serialize_ex(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_MatchPredicate_MatchSet_has_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_MatchPredicate_MatchSet_clear_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_MatchPredicate* const* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_rules(const envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* len) {
+ return (const envoy_config_common_matcher_v3_MatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t* len) {
+ return (envoy_config_common_matcher_v3_MatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate** envoy_config_common_matcher_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_MatchPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_matcher_v3_MatchPredicate_MatchSet_add_rules(envoy_config_common_matcher_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.HttpHeadersMatch */
+
+UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_HttpHeadersMatch_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_HttpHeadersMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpHeadersMatch* ret = envoy_config_common_matcher_v3_HttpHeadersMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_matcher_v3_HttpHeadersMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpHeadersMatch* ret = envoy_config_common_matcher_v3_HttpHeadersMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpHeadersMatch_serialize(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpHeadersMatch_serialize_ex(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_HttpHeadersMatch_has_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpHeadersMatch_clear_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_common_matcher_v3_HttpHeadersMatch_headers(const envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* len) {
+ return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_mutable_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t* len) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_common_matcher_v3_HttpHeadersMatch_resize_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_common_matcher_v3_HttpHeadersMatch_add_headers(envoy_config_common_matcher_v3_HttpHeadersMatch* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.HttpGenericBodyMatch */
+
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpGenericBodyMatch_serialize(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpGenericBodyMatch_serialize_ex(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_clear_bytes_limit(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_common_matcher_v3_HttpGenericBodyMatch_bytes_limit(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_has_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_clear_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_common_matcher_v3_HttpGenericBodyMatch_patterns(const envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* len) {
+ return (const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_set_bytes_limit(envoy_config_common_matcher_v3_HttpGenericBodyMatch *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t* len) {
+ return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_common_matcher_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_add_patterns(envoy_config_common_matcher_v3_HttpGenericBodyMatch* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.common.matcher.v3.HttpGenericBodyMatch.GenericTextMatch */
+
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(upb_Arena* arena) {
+ return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_serialize(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_serialize_ex(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_string_match = 1,
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_binary_match = 2,
+ envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET = 0
+} envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases;
+UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_case(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return (envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_string_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_binary_match(const envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_set_string_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE void envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_set_binary_match(envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+
+extern const upb_MiniTable_File envoy_config_common_matcher_v3_matcher_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
index 048fc050..112b414b 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -17,107 +17,128 @@
#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},
+static const upb_MiniTable_Field envoy_config_core_v3_Pipe__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Pipe_msginit = {
+const upb_MiniTable envoy_config_core_v3_Pipe_msginit = {
NULL,
&envoy_config_core_v3_Pipe__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit = {
+const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msginit = {
NULL,
&envoy_config_core_v3_EnvoyInternalAddress__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_SocketAddress__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 13, 1},
- {4, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 9, 1},
- {5, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_SocketAddress__fields[6] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_SocketAddress_msginit = {
+const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit = {
NULL,
&envoy_config_core_v3_SocketAddress__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_TcpKeepalive_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_TcpKeepalive_submsgs[3] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_TcpKeepalive__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_TcpKeepalive__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit = {
+const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit = {
&envoy_config_core_v3_TcpKeepalive_submsgs[0],
&envoy_config_core_v3_TcpKeepalive__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_BindConfig_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_SocketAddress_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_BindConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_BindConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_BindConfig_msginit = {
+const upb_MiniTable envoy_config_core_v3_BindConfig_msginit = {
&envoy_config_core_v3_BindConfig_submsgs[0],
&envoy_config_core_v3_BindConfig__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_Address_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_SocketAddress_msginit},
+ {.submsg = &envoy_config_core_v3_Pipe_msginit},
+ {.submsg = &envoy_config_core_v3_EnvoyInternalAddress_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},
+static const upb_MiniTable_Field envoy_config_core_v3_Address__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Address_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_CidrRange_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_CidrRange_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_CidrRange__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_CidrRange__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_CidrRange_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_config_core_v3_Pipe_msginit,
+ &envoy_config_core_v3_EnvoyInternalAddress_msginit,
+ &envoy_config_core_v3_SocketAddress_msginit,
+ &envoy_config_core_v3_TcpKeepalive_msginit,
+ &envoy_config_core_v3_BindConfig_msginit,
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_core_v3_CidrRange_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_address_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
index c8fdbee2..6bf20937 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -34,19 +34,19 @@ typedef struct envoy_config_core_v3_TcpKeepalive envoy_config_core_v3_TcpKeepali
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;
+extern const upb_MiniTable envoy_config_core_v3_Pipe_msginit;
+extern const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TcpKeepalive_msginit;
+extern const upb_MiniTable envoy_config_core_v3_BindConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_config_core_v3_SocketAddress_TCP = 0,
@@ -54,31 +54,53 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Pipe*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Pipe* ret = envoy_config_core_v3_Pipe_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_Pipe_serialize_ex(const envoy_config_core_v3_Pipe* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Pipe_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_Pipe_clear_path(const envoy_config_core_v3_Pipe* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Pipe_path(const envoy_config_core_v3_Pipe* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Pipe_clear_mode(const envoy_config_core_v3_Pipe* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 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_path(envoy_config_core_v3_Pipe *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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;
@@ -86,127 +108,224 @@ UPB_INLINE void envoy_config_core_v3_Pipe_set_mode(envoy_config_core_v3_Pipe *ms
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_EnvoyInternalAddress_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_EnvoyInternalAddress* ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_EnvoyInternalAddress_serialize_ex(const envoy_config_core_v3_EnvoyInternalAddress* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_clear_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_EnvoyInternalAddress_server_listener_name(const envoy_config_core_v3_EnvoyInternalAddress* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
-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);
+UPB_INLINE void envoy_config_core_v3_EnvoyInternalAddress_set_server_listener_name(envoy_config_core_v3_EnvoyInternalAddress *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_SocketAddress*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddress_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_SocketAddress* ret = envoy_config_core_v3_SocketAddress_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_SocketAddress_serialize_ex(const envoy_config_core_v3_SocketAddress* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msginit, options, 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(32, 56), 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(8, 8), 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(32, 56)) == 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(24, 40), UPB_SIZE(32, 56), 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(32, 56)) == 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(24, 40), UPB_SIZE(32, 56), 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(16, 24), 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(4, 4), bool); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_protocol(const envoy_config_core_v3_SocketAddress* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void envoy_config_core_v3_SocketAddress_clear_address(const envoy_config_core_v3_SocketAddress* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_address(const envoy_config_core_v3_SocketAddress* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_port_value(const envoy_config_core_v3_SocketAddress* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_port_value(const envoy_config_core_v3_SocketAddress* msg) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET);
+}
+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(12, 16), UPB_SIZE(4, 4), 3, _upb_UInt32_FromU(0u));
+}
+UPB_INLINE bool envoy_config_core_v3_SocketAddress_has_named_port(const envoy_config_core_v3_SocketAddress* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_named_port(const envoy_config_core_v3_SocketAddress* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_SocketAddress_port_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_named_port(const envoy_config_core_v3_SocketAddress* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_resolver_name(const envoy_config_core_v3_SocketAddress* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SocketAddress_resolver_name(const envoy_config_core_v3_SocketAddress* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_SocketAddress_clear_ipv4_compat(const envoy_config_core_v3_SocketAddress* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_address(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = 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(24, 40), value, UPB_SIZE(32, 56), 3);
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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(24, 40), value, UPB_SIZE(32, 56), 4);
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_named_port(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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(16, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_SocketAddress_set_resolver_name(envoy_config_core_v3_SocketAddress *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = 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(4, 4), 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_TcpKeepalive*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_TcpKeepalive* ret = envoy_config_core_v3_TcpKeepalive_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_TcpKeepalive_serialize_ex(const envoy_config_core_v3_TcpKeepalive* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_probes(const envoy_config_core_v3_TcpKeepalive* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_time(const envoy_config_core_v3_TcpKeepalive* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_TcpKeepalive_clear_keepalive_interval(const envoy_config_core_v3_TcpKeepalive* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_UInt32Value*);
}
-
-UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_probes(const envoy_config_core_v3_TcpKeepalive *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_sethas(msg, 1);
*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_probes(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_TcpKeepalive_set_keepalive_probes(msg, sub);
}
@@ -216,10 +335,10 @@ UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_time(envoy_confi
_upb_sethas(msg, 2);
*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_time(envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_TcpKeepalive_set_keepalive_time(msg, sub);
}
@@ -229,10 +348,10 @@ UPB_INLINE void envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(envoy_c
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_TcpKeepalive_set_keepalive_interval(msg, sub);
}
@@ -241,39 +360,71 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_TcpKeepalive
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_BindConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_BindConfig* ret = envoy_config_core_v3_BindConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_BindConfig_serialize_ex(const envoy_config_core_v3_BindConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_BindConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_BindConfig_clear_source_address(const envoy_config_core_v3_BindConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_BindConfig_clear_freebind(const envoy_config_core_v3_BindConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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(12, 24));
+}
+UPB_INLINE void envoy_config_core_v3_BindConfig_clear_socket_options(const envoy_config_core_v3_BindConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
}
-
-UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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(12, 24)); }
-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(12, 24), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_BindConfig_set_source_address(msg, sub);
}
@@ -283,95 +434,127 @@ UPB_INLINE void envoy_config_core_v3_BindConfig_set_freebind(envoy_config_core_v
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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) {
+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(12, 24), 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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Address*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Address* ret = envoy_config_core_v3_Address_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_Address_serialize_ex(const envoy_config_core_v3_Address* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Address_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_Address_clear_socket_address(const envoy_config_core_v3_Address* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_Address_clear_pipe(const envoy_config_core_v3_Address* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_Address_clear_envoy_internal_address(const envoy_config_core_v3_Address* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Address_address_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_core_v3_SocketAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_Pipe*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Pipe*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_EnvoyInternalAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_EnvoyInternalAddress*)_upb_Message_New(&envoy_config_core_v3_EnvoyInternalAddress_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Address_set_envoy_internal_address(msg, sub);
}
@@ -380,45 +563,70 @@ UPB_INLINE struct envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_CidrRange*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_CidrRange* ret = envoy_config_core_v3_CidrRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_CidrRange_serialize_ex(const envoy_config_core_v3_CidrRange* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_CidrRange_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_CidrRange_clear_address_prefix(const envoy_config_core_v3_CidrRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_CidrRange_address_prefix(const envoy_config_core_v3_CidrRange* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_CidrRange_clear_prefix_len(const envoy_config_core_v3_CidrRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_UInt32Value*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_CidrRange_has_prefix_len(const envoy_config_core_v3_CidrRange *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_CidrRange_set_address_prefix(envoy_config_core_v3_CidrRange *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_core_v3_CidrRange_set_prefix_len(envoy_config_core_v3_CidrRange *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_CidrRange_set_prefix_len(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_core_v3_address_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
index 8e1174d7..7d1256af 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/backoff.upb.h"
#include "google/protobuf/duration.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,33 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_BackoffStrategy_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_BackoffStrategy_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_BackoffStrategy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_BackoffStrategy__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit = {
+const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit = {
&envoy_config_core_v3_BackoffStrategy_submsgs[0],
&envoy_config_core_v3_BackoffStrategy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_BackoffStrategy_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_backoff_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
index 3601c66c..9b5e6d34 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,44 +22,70 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit;
struct google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_BackoffStrategy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStrategy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_BackoffStrategy* ret = envoy_config_core_v3_BackoffStrategy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_BackoffStrategy_serialize_ex(const envoy_config_core_v3_BackoffStrategy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_BackoffStrategy_clear_max_interval(const envoy_config_core_v3_BackoffStrategy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_base_interval(envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_BackoffStrategy_set_base_interval(msg, sub);
}
@@ -69,16 +95,18 @@ UPB_INLINE void envoy_config_core_v3_BackoffStrategy_set_max_interval(envoy_conf
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_BackoffStrategy_set_max_interval(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_core_v3_backoff_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
index 0baf9e98..3d71a88d 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -17,6 +17,8 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "xds/core/v3/context_params.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"
@@ -24,310 +26,393 @@
#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},
+static const upb_MiniTable_Field envoy_config_core_v3_Locality__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Locality_msginit = {
+const upb_MiniTable envoy_config_core_v3_Locality_msginit = {
NULL,
&envoy_config_core_v3_Locality__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_BuildVersion_submsgs[2] = {
- &envoy_type_v3_SemanticVersion_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_BuildVersion_submsgs[2] = {
+ {.submsg = &envoy_type_v3_SemanticVersion_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_BuildVersion__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_BuildVersion__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_BuildVersion_msginit = {
+const upb_MiniTable envoy_config_core_v3_BuildVersion_msginit = {
&envoy_config_core_v3_BuildVersion_submsgs[0],
&envoy_config_core_v3_BuildVersion__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Extension_submsgs[1] = {
- &envoy_config_core_v3_BuildVersion_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Extension_submsgs[1] = {
+ {.submsg = &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), 1, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_Extension__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Extension_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(32, 72), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_Node_submsgs[6] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_core_v3_BuildVersion_msginit},
+ {.submsg = &envoy_config_core_v3_Extension_msginit},
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_Node_DynamicParametersEntry_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Node__fields[10] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 56), 1, 4, 11, 1},
- {4, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {7, UPB_SIZE(48, 96), UPB_SIZE(-57, -113), 0, 9, 1},
- {8, UPB_SIZE(48, 96), UPB_SIZE(-57, -113), 1, 11, 1},
- {9, UPB_SIZE(36, 72), 0, 2, 11, 3},
- {10, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {11, UPB_SIZE(44, 88), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_Node__fields[11] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(36, 64), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(56, 104), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(60, 112), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Node_msginit = {
+const upb_MiniTable envoy_config_core_v3_Node_msginit = {
&envoy_config_core_v3_Node_submsgs[0],
&envoy_config_core_v3_Node__fields[0],
- UPB_SIZE(64, 128), 10, false, 255,
+ UPB_SIZE(64, 120), 11, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Metadata_submsgs[1] = {
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_Node_DynamicParametersEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msginit = {
+ &envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[0],
+ &envoy_config_core_v3_Node_DynamicParametersEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Metadata__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field envoy_config_core_v3_Metadata__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Metadata_msginit = {
+const upb_MiniTable envoy_config_core_v3_Metadata_msginit = {
&envoy_config_core_v3_Metadata_submsgs[0],
&envoy_config_core_v3_Metadata__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit = {
+static const upb_MiniTable_Field envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit = {
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[0],
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_RuntimeUInt32__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit = {
NULL,
&envoy_config_core_v3_RuntimeUInt32__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimePercent_submsgs[1] = {
- &envoy_type_v3_Percent_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_RuntimePercent_submsgs[1] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RuntimePercent__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RuntimePercent__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RuntimePercent_msginit = {
+const upb_MiniTable envoy_config_core_v3_RuntimePercent_msginit = {
&envoy_config_core_v3_RuntimePercent_submsgs[0],
&envoy_config_core_v3_RuntimePercent__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_RuntimeDouble__fields[2] = {
+ {1, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit = {
+const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit = {
NULL,
&envoy_config_core_v3_RuntimeDouble__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_QueryParameter__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HeaderValue_msginit = {
+const upb_MiniTable envoy_config_core_v3_QueryParameter_msginit = {
+ NULL,
+ &envoy_config_core_v3_QueryParameter__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_HeaderValue__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit = {
NULL,
&envoy_config_core_v3_HeaderValue__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_HeaderValueOption_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_HeaderValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HeaderValueOption__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_HeaderValueOption__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit = {
+const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit = {
&envoy_config_core_v3_HeaderValueOption_submsgs[0],
&envoy_config_core_v3_HeaderValueOption__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_HeaderMap_submsgs[1] = {
- &envoy_config_core_v3_HeaderValue_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_HeaderMap_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_HeaderMap__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HeaderMap_msginit = {
+const upb_MiniTable envoy_config_core_v3_HeaderMap_msginit = {
&envoy_config_core_v3_HeaderMap_submsgs[0],
&envoy_config_core_v3_HeaderMap__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_WatchedDirectory__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_WatchedDirectory__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_WatchedDirectory_msginit = {
+const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit = {
NULL,
&envoy_config_core_v3_WatchedDirectory__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_DataSource__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_DataSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_DataSource_msginit = {
NULL,
&envoy_config_core_v3_DataSource__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(12, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_RetryPolicy_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_BackoffStrategy_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RetryPolicy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RetryPolicy__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit = {
+const upb_MiniTable envoy_config_core_v3_RetryPolicy_msginit = {
&envoy_config_core_v3_RetryPolicy_submsgs[0],
&envoy_config_core_v3_RetryPolicy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_RemoteDataSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_HttpUri_msginit},
+ {.submsg = &envoy_config_core_v3_RetryPolicy_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RemoteDataSource__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RemoteDataSource__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msginit = {
&envoy_config_core_v3_RemoteDataSource_submsgs[0],
&envoy_config_core_v3_RemoteDataSource__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_AsyncDataSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_AsyncDataSource__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_TransportSocket_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_TransportSocket_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_TransportSocket__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_TransportSocket_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_ControlPlane__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_ControlPlane__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_ControlPlane_msginit = {
+const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit = {
NULL,
&envoy_config_core_v3_ControlPlane__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[24] = {
+ &envoy_config_core_v3_Locality_msginit,
+ &envoy_config_core_v3_BuildVersion_msginit,
+ &envoy_config_core_v3_Extension_msginit,
+ &envoy_config_core_v3_Node_msginit,
+ &envoy_config_core_v3_Node_DynamicParametersEntry_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit,
+ &envoy_config_core_v3_RuntimeUInt32_msginit,
+ &envoy_config_core_v3_RuntimePercent_msginit,
+ &envoy_config_core_v3_RuntimeDouble_msginit,
+ &envoy_config_core_v3_RuntimeFeatureFlag_msginit,
+ &envoy_config_core_v3_QueryParameter_msginit,
+ &envoy_config_core_v3_HeaderValue_msginit,
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_HeaderMap_msginit,
+ &envoy_config_core_v3_WatchedDirectory_msginit,
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_config_core_v3_RetryPolicy_msginit,
+ &envoy_config_core_v3_RemoteDataSource_msginit,
+ &envoy_config_core_v3_AsyncDataSource_msginit,
+ &envoy_config_core_v3_TransportSocket_msginit,
+ &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
+ &envoy_config_core_v3_ControlPlane_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_base_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 24,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
index bfb4fd4d..ee49fd14 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,12 +24,15 @@ 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_Node_DynamicParametersEntry;
struct envoy_config_core_v3_Metadata;
struct envoy_config_core_v3_Metadata_FilterMetadataEntry;
+struct envoy_config_core_v3_Metadata_TypedFilterMetadataEntry;
struct envoy_config_core_v3_RuntimeUInt32;
struct envoy_config_core_v3_RuntimePercent;
struct envoy_config_core_v3_RuntimeDouble;
struct envoy_config_core_v3_RuntimeFeatureFlag;
+struct envoy_config_core_v3_QueryParameter;
struct envoy_config_core_v3_HeaderValue;
struct envoy_config_core_v3_HeaderValueOption;
struct envoy_config_core_v3_HeaderMap;
@@ -45,12 +48,15 @@ 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_Node_DynamicParametersEntry envoy_config_core_v3_Node_DynamicParametersEntry;
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_Metadata_TypedFilterMetadataEntry envoy_config_core_v3_Metadata_TypedFilterMetadataEntry;
typedef struct envoy_config_core_v3_RuntimeUInt32 envoy_config_core_v3_RuntimeUInt32;
typedef struct envoy_config_core_v3_RuntimePercent envoy_config_core_v3_RuntimePercent;
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_QueryParameter envoy_config_core_v3_QueryParameter;
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;
@@ -62,27 +68,30 @@ typedef struct envoy_config_core_v3_AsyncDataSource envoy_config_core_v3_AsyncDa
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_RuntimePercent_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_WatchedDirectory_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;
+extern const upb_MiniTable envoy_config_core_v3_Locality_msginit;
+extern const upb_MiniTable envoy_config_core_v3_BuildVersion_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Extension_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Node_DynamicParametersEntry_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimePercent_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeDouble_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msginit;
+extern const upb_MiniTable envoy_config_core_v3_QueryParameter_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderMap_msginit;
+extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RetryPolicy_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RemoteDataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_AsyncDataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit;
struct envoy_config_core_v3_Address;
struct envoy_config_core_v3_BackoffStrategy;
struct envoy_config_core_v3_HttpUri;
@@ -93,16 +102,24 @@ 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_Percent_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;
+struct xds_core_v3_ContextParams;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_BackoffStrategy_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HttpUri_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable envoy_type_v3_SemanticVersion_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable xds_core_v3_ContextParams_msginit;
+
+typedef enum {
+ envoy_config_core_v3_HeaderValueOption_APPEND_IF_EXISTS_OR_ADD = 0,
+ envoy_config_core_v3_HeaderValueOption_ADD_IF_ABSENT = 1,
+ envoy_config_core_v3_HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD = 2
+} envoy_config_core_v3_HeaderValueOption_HeaderAppendAction;
typedef enum {
envoy_config_core_v3_METHOD_UNSPECIFIED = 0,
@@ -129,73 +146,125 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Locality*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Locality* ret = envoy_config_core_v3_Locality_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_Locality_serialize_ex(const envoy_config_core_v3_Locality* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Locality_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_Locality_clear_region(const envoy_config_core_v3_Locality* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Locality_region(const envoy_config_core_v3_Locality* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Locality_clear_zone(const envoy_config_core_v3_Locality* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Locality_zone(const envoy_config_core_v3_Locality* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Locality_clear_sub_zone(const envoy_config_core_v3_Locality* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Locality_sub_zone(const envoy_config_core_v3_Locality* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
}
-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_region(envoy_config_core_v3_Locality *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_zone(envoy_config_core_v3_Locality *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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;
+UPB_INLINE void envoy_config_core_v3_Locality_set_sub_zone(envoy_config_core_v3_Locality *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_BuildVersion*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_BuildVersion* ret = envoy_config_core_v3_BuildVersion_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_BuildVersion_serialize_ex(const envoy_config_core_v3_BuildVersion* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_version(const envoy_config_core_v3_BuildVersion* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_BuildVersion_clear_metadata(const envoy_config_core_v3_BuildVersion* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Struct*);
}
-
-UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_v3_SemanticVersion*)_upb_Message_New(&envoy_type_v3_SemanticVersion_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_BuildVersion_set_version(msg, sub);
}
@@ -205,10 +274,10 @@ UPB_INLINE void envoy_config_core_v3_BuildVersion_set_metadata(envoy_config_core
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_BuildVersion_set_metadata(msg, sub);
}
@@ -217,48 +286,86 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_BuildVersion_muta
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Extension*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Extension* ret = envoy_config_core_v3_Extension_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_Extension_serialize_ex(const envoy_config_core_v3_Extension* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Extension_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_Extension_clear_name(const envoy_config_core_v3_Extension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Extension_name(const envoy_config_core_v3_Extension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Extension_clear_category(const envoy_config_core_v3_Extension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Extension_category(const envoy_config_core_v3_Extension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Extension_clear_type_descriptor(const envoy_config_core_v3_Extension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Extension_type_descriptor(const envoy_config_core_v3_Extension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_Extension_has_version(const envoy_config_core_v3_Extension* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Extension_clear_version(const envoy_config_core_v3_Extension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+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 void envoy_config_core_v3_Extension_clear_disabled(const envoy_config_core_v3_Extension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_Extension_disabled(const envoy_config_core_v3_Extension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-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_hasbit(msg, 1); }
-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(1, 1), 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_name(envoy_config_core_v3_Extension *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_category(envoy_config_core_v3_Extension *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = 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_type_descriptor(envoy_config_core_v3_Extension *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
}
UPB_INLINE void envoy_config_core_v3_Extension_set_version(envoy_config_core_v3_Extension *msg, envoy_config_core_v3_BuildVersion* value) {
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_New(&envoy_config_core_v3_BuildVersion_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Extension_set_version(msg, sub);
}
@@ -270,62 +377,151 @@ UPB_INLINE void envoy_config_core_v3_Extension_set_disabled(envoy_config_core_v3
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Node*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Node* ret = envoy_config_core_v3_Node_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_Node_serialize_ex(const envoy_config_core_v3_Node* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Node_msginit, options, 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(56, 112), 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(4, 8), 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(12, 24), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node *msg) { return _upb_hasbit(msg, 1); }
-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(28, 56), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node *msg) { return _upb_hasbit(msg, 2); }
-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(32, 64), 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(20, 40), 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(56, 112)) == 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(48, 96), UPB_SIZE(56, 112), 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(56, 112)) == 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(48, 96), UPB_SIZE(56, 112), 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(36, 72)); }
-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(36, 72), 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(40, 80), 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(44, 88)); }
-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(44, 88), 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(4, 8), 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(12, 24), upb_strview) = value;
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_id(const envoy_config_core_v3_Node* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Node_id(const envoy_config_core_v3_Node* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_cluster(const envoy_config_core_v3_Node* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Node_cluster(const envoy_config_core_v3_Node* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_Node_has_metadata(const envoy_config_core_v3_Node* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_metadata(const envoy_config_core_v3_Node* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(32, 56), const struct google_protobuf_Struct*);
+}
+UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_locality(const envoy_config_core_v3_Node* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+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(36, 64), const envoy_config_core_v3_Locality*);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_name(const envoy_config_core_v3_Node* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Node_user_agent_name(const envoy_config_core_v3_Node* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView);
+}
+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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_version(const envoy_config_core_v3_Node* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_Node_user_agent_version_type_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString(""));
+}
+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(4, 4)) == 8;
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_user_agent_build_version(const envoy_config_core_v3_Node* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_Node_user_agent_version_type_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(48, 88));
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_extensions(const envoy_config_core_v3_Node* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+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(48, 88), len);
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_client_features(const envoy_config_core_v3_Node* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 96));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), 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(56, 104));
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_listening_addresses(const envoy_config_core_v3_Node* msg) {
+ _upb_array_detach(msg, UPB_SIZE(56, 104));
+}
+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(56, 104), len);
+}
+UPB_INLINE bool envoy_config_core_v3_Node_has_dynamic_parameters(const envoy_config_core_v3_Node* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 112));
+}
+UPB_INLINE void envoy_config_core_v3_Node_clear_dynamic_parameters(const envoy_config_core_v3_Node* msg) {
+ _upb_array_detach(msg, UPB_SIZE(60, 112));
+}
+UPB_INLINE size_t envoy_config_core_v3_Node_dynamic_parameters_size(const envoy_config_core_v3_Node* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(60, 112));
+}
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_get(const envoy_config_core_v3_Node* msg, upb_StringView key, struct xds_core_v3_ContextParams** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(60, 112), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_next(const envoy_config_core_v3_Node* msg, size_t* iter) {
+ return (const envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(60, 112), iter);
+}
+
+UPB_INLINE void envoy_config_core_v3_Node_set_id(envoy_config_core_v3_Node *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_Node_set_cluster(envoy_config_core_v3_Node *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value;
}
UPB_INLINE void envoy_config_core_v3_Node_set_metadata(envoy_config_core_v3_Node *msg, struct google_protobuf_Struct* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Struct*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Node_set_metadata(msg, sub);
}
@@ -333,111 +529,193 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_Node_mutable_meta
}
UPB_INLINE void envoy_config_core_v3_Node_set_locality(envoy_config_core_v3_Node *msg, envoy_config_core_v3_Locality* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_config_core_v3_Locality*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Locality*)_upb_Message_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(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_name(envoy_config_core_v3_Node *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = 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(48, 96), value, UPB_SIZE(56, 112), 7);
+UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_version(envoy_config_core_v3_Node *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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(48, 96), value, UPB_SIZE(56, 112), 8);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_BuildVersion*)_upb_Message_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(36, 72), len);
+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(48, 88), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_Extension_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &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(40, 80), len);
+UPB_INLINE upb_StringView* envoy_config_core_v3_Node_mutable_client_features(envoy_config_core_v3_Node* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), 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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_core_v3_Node_resize_client_features(envoy_config_core_v3_Node* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_core_v3_Node_add_client_features(envoy_config_core_v3_Node* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &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(44, 88), len);
+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(56, 104), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(56, 104), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 104), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_core_v3_Node_dynamic_parameters_clear(envoy_config_core_v3_Node* msg) { _upb_msg_map_clear(msg, UPB_SIZE(60, 112)); }
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_set(envoy_config_core_v3_Node* msg, upb_StringView key, struct xds_core_v3_ContextParams* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(60, 112), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_delete(envoy_config_core_v3_Node* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(60, 112), &key, 0);
+}
+UPB_INLINE envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_nextmutable(envoy_config_core_v3_Node* msg, size_t* iter) {
+ return (envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(60, 112), iter);
+}
-/* envoy.config.core.v3.Metadata */
+/* envoy.config.core.v3.Node.DynamicParametersEntry */
-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 upb_StringView envoy_config_core_v3_Node_DynamicParametersEntry_key(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-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 bool envoy_config_core_v3_Node_DynamicParametersEntry_has_value(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
}
-UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE const struct xds_core_v3_ContextParams* envoy_config_core_v3_Node_DynamicParametersEntry_value(const envoy_config_core_v3_Node_DynamicParametersEntry* msg) {
+ struct xds_core_v3_ContextParams* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
-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 void envoy_config_core_v3_Node_DynamicParametersEntry_set_value(envoy_config_core_v3_Node_DynamicParametersEntry *msg, struct xds_core_v3_ContextParams* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct xds_core_v3_ContextParams*));
}
-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); }
+/* envoy.config.core.v3.Metadata */
-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); }
+UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Metadata*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Metadata* ret = envoy_config_core_v3_Metadata_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_Metadata_serialize_ex(const envoy_config_core_v3_Metadata* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Metadata_msginit, options, 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 void envoy_config_core_v3_Metadata_clear_filter_metadata(const envoy_config_core_v3_Metadata* msg) {
+ _upb_array_detach(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_StringView 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 bool envoy_config_core_v3_Metadata_has_typed_filter_metadata(const envoy_config_core_v3_Metadata* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_core_v3_Metadata_clear_typed_filter_metadata(const envoy_config_core_v3_Metadata* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE size_t envoy_config_core_v3_Metadata_typed_filter_metadata_size(const envoy_config_core_v3_Metadata* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_get(const envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Any** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_next(const envoy_config_core_v3_Metadata* msg, size_t* iter) {
+ return (const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), 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_StringView 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_StringView 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);
+}
+UPB_INLINE void envoy_config_core_v3_Metadata_typed_filter_metadata_clear(envoy_config_core_v3_Metadata* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_set(envoy_config_core_v3_Metadata* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_delete(envoy_config_core_v3_Metadata* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, 0);
+}
+UPB_INLINE envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_nextmutable(envoy_config_core_v3_Metadata* msg, size_t* iter) {
+ return (envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), 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_INLINE upb_StringView envoy_config_core_v3_Metadata_FilterMetadataEntry_key(const envoy_config_core_v3_Metadata_FilterMetadataEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -447,211 +725,422 @@ UPB_INLINE void envoy_config_core_v3_Metadata_FilterMetadataEntry_set_value(envo
_upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Struct*));
}
-/* envoy.config.core.v3.RuntimeUInt32 */
+/* envoy.config.core.v3.Metadata.TypedFilterMetadataEntry */
-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 upb_StringView envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_key(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
}
-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 bool envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
}
-UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
}
-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 void envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
}
-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); }
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt32_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimeUInt32* ret = envoy_config_core_v3_RuntimeUInt32_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_RuntimeUInt32_serialize_ex(const envoy_config_core_v3_RuntimeUInt32* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_clear_default_value(const envoy_config_core_v3_RuntimeUInt32* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 void envoy_config_core_v3_RuntimeUInt32_clear_runtime_key(const envoy_config_core_v3_RuntimeUInt32* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeUInt32_runtime_key(const envoy_config_core_v3_RuntimeUInt32* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
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;
+UPB_INLINE void envoy_config_core_v3_RuntimeUInt32_set_runtime_key(envoy_config_core_v3_RuntimeUInt32 *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
/* envoy.config.core.v3.RuntimePercent */
-UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePercent_new(upb_arena *arena) {
- return (envoy_config_core_v3_RuntimePercent *)_upb_msg_new(&envoy_config_core_v3_RuntimePercent_msginit, arena);
+UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePercent_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RuntimePercent*)_upb_Message_New(&envoy_config_core_v3_RuntimePercent_msginit, arena);
}
-UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePercent_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_RuntimePercent *ret = envoy_config_core_v3_RuntimePercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePercent_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimePercent* ret = envoy_config_core_v3_RuntimePercent_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_core_v3_RuntimePercent *ret = envoy_config_core_v3_RuntimePercent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePercent_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimePercent* ret = envoy_config_core_v3_RuntimePercent_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_core_v3_RuntimePercent_serialize(const envoy_config_core_v3_RuntimePercent *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, arena, len);
+UPB_INLINE char* envoy_config_core_v3_RuntimePercent_serialize(const envoy_config_core_v3_RuntimePercent* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_RuntimePercent_serialize_ex(const envoy_config_core_v3_RuntimePercent* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_RuntimePercent_has_default_value(const envoy_config_core_v3_RuntimePercent* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_default_value(const envoy_config_core_v3_RuntimePercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_RuntimePercent_default_value(const envoy_config_core_v3_RuntimePercent* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimePercent_clear_runtime_key(const envoy_config_core_v3_RuntimePercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RuntimePercent_runtime_key(const envoy_config_core_v3_RuntimePercent* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_core_v3_RuntimePercent_has_default_value(const envoy_config_core_v3_RuntimePercent *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_RuntimePercent_default_value(const envoy_config_core_v3_RuntimePercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); }
-UPB_INLINE upb_strview envoy_config_core_v3_RuntimePercent_runtime_key(const envoy_config_core_v3_RuntimePercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE void envoy_config_core_v3_RuntimePercent_set_default_value(envoy_config_core_v3_RuntimePercent *msg, struct envoy_type_v3_Percent* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_core_v3_RuntimePercent_mutable_default_value(envoy_config_core_v3_RuntimePercent *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_RuntimePercent_mutable_default_value(envoy_config_core_v3_RuntimePercent* msg, upb_Arena* arena) {
struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_core_v3_RuntimePercent_default_value(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_RuntimePercent_set_default_value(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_core_v3_RuntimePercent_set_runtime_key(envoy_config_core_v3_RuntimePercent *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_RuntimePercent_set_runtime_key(envoy_config_core_v3_RuntimePercent *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RuntimeDouble*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDouble_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimeDouble* ret = envoy_config_core_v3_RuntimeDouble_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_RuntimeDouble_serialize_ex(const envoy_config_core_v3_RuntimeDouble* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeDouble_clear_default_value(const envoy_config_core_v3_RuntimeDouble* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double) = 0;
+}
+UPB_INLINE double envoy_config_core_v3_RuntimeDouble_default_value(const envoy_config_core_v3_RuntimeDouble* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeDouble_clear_runtime_key(const envoy_config_core_v3_RuntimeDouble* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeDouble_runtime_key(const envoy_config_core_v3_RuntimeDouble* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-
-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_PTR_AT(msg, UPB_SIZE(8, 16), 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;
+UPB_INLINE void envoy_config_core_v3_RuntimeDouble_set_runtime_key(envoy_config_core_v3_RuntimeDouble *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_RuntimeFeatureFlag_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimeFeatureFlag* ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_RuntimeFeatureFlag_serialize_ex(const envoy_config_core_v3_RuntimeFeatureFlag* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_default_value(const envoy_config_core_v3_RuntimeFeatureFlag* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_clear_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeFeatureFlag_runtime_key(const envoy_config_core_v3_RuntimeFeatureFlag* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_core_v3_RuntimeFeatureFlag_has_default_value(const envoy_config_core_v3_RuntimeFeatureFlag *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_RuntimeFeatureFlag_mutable_default_value(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_runtime_key(envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
-/* envoy.config.core.v3.HeaderValue */
+/* envoy.config.core.v3.QueryParameter */
-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_QueryParameter* envoy_config_core_v3_QueryParameter_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_QueryParameter*)_upb_Message_New(&envoy_config_core_v3_QueryParameter_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 envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParameter_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_QueryParameter* ret = envoy_config_core_v3_QueryParameter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParameter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_QueryParameter* ret = envoy_config_core_v3_QueryParameter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_QueryParameter_serialize(const envoy_config_core_v3_QueryParameter* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, 0, arena, len);
}
-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 char* envoy_config_core_v3_QueryParameter_serialize_ex(const envoy_config_core_v3_QueryParameter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_QueryParameter_clear_key(const envoy_config_core_v3_QueryParameter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_QueryParameter_key(const envoy_config_core_v3_QueryParameter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_QueryParameter_clear_value(const envoy_config_core_v3_QueryParameter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_QueryParameter_value(const envoy_config_core_v3_QueryParameter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-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_QueryParameter_set_key(envoy_config_core_v3_QueryParameter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_QueryParameter_set_value(envoy_config_core_v3_QueryParameter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HeaderValue* ret = envoy_config_core_v3_HeaderValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_HeaderValue_serialize_ex(const envoy_config_core_v3_HeaderValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValue_clear_key(const envoy_config_core_v3_HeaderValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HeaderValue_key(const envoy_config_core_v3_HeaderValue* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValue_clear_value(const envoy_config_core_v3_HeaderValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HeaderValue_value(const envoy_config_core_v3_HeaderValue* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
-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_key(envoy_config_core_v3_HeaderValue *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_config_core_v3_HeaderValue_set_value(envoy_config_core_v3_HeaderValue *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HeaderValueOption*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderValueOption_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HeaderValueOption* ret = envoy_config_core_v3_HeaderValueOption_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_HeaderValueOption_serialize_ex(const envoy_config_core_v3_HeaderValueOption* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_header(const envoy_config_core_v3_HeaderValueOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append(const envoy_config_core_v3_HeaderValueOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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(12, 16), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_clear_append_action(const envoy_config_core_v3_HeaderValueOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_core_v3_HeaderValueOption_append_action(const envoy_config_core_v3_HeaderValueOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-
-UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_HeaderValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HeaderValue*)_upb_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HeaderValueOption_set_header(msg, sub);
}
@@ -659,159 +1148,266 @@ UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderV
}
UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append(envoy_config_core_v3_HeaderValueOption *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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_config_core_v3_HeaderValueOption_mutable_append(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HeaderValueOption_set_append(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append_action(envoy_config_core_v3_HeaderValueOption *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HeaderMap*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HeaderMap* ret = envoy_config_core_v3_HeaderMap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_HeaderMap_serialize_ex(const envoy_config_core_v3_HeaderMap* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_HeaderMap_clear_headers(const envoy_config_core_v3_HeaderMap* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.config.core.v3.WatchedDirectory */
-UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDirectory_new(upb_arena *arena) {
- return (envoy_config_core_v3_WatchedDirectory *)_upb_msg_new(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
+UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDirectory_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
}
-UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDirectory_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_WatchedDirectory *ret = envoy_config_core_v3_WatchedDirectory_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDirectory_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_WatchedDirectory* ret = envoy_config_core_v3_WatchedDirectory_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDirectory_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_core_v3_WatchedDirectory *ret = envoy_config_core_v3_WatchedDirectory_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDirectory_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_WatchedDirectory* ret = envoy_config_core_v3_WatchedDirectory_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_core_v3_WatchedDirectory_serialize(const envoy_config_core_v3_WatchedDirectory *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, arena, len);
+UPB_INLINE char* envoy_config_core_v3_WatchedDirectory_serialize(const envoy_config_core_v3_WatchedDirectory* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_WatchedDirectory_serialize_ex(const envoy_config_core_v3_WatchedDirectory* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_WatchedDirectory_clear_path(const envoy_config_core_v3_WatchedDirectory* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_WatchedDirectory_path(const envoy_config_core_v3_WatchedDirectory* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-UPB_INLINE upb_strview envoy_config_core_v3_WatchedDirectory_path(const envoy_config_core_v3_WatchedDirectory *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void envoy_config_core_v3_WatchedDirectory_set_path(envoy_config_core_v3_WatchedDirectory *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_WatchedDirectory_set_path(envoy_config_core_v3_WatchedDirectory *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_DataSource*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_DataSource* ret = envoy_config_core_v3_DataSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_DataSource_serialize_ex(const envoy_config_core_v3_DataSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_DataSource_msginit, options, 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_environment_variable = 4,
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_clear_filename(const envoy_config_core_v3_DataSource* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_filename(const envoy_config_core_v3_DataSource* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_bytes(const envoy_config_core_v3_DataSource* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_bytes(const envoy_config_core_v3_DataSource* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_inline_bytes(const envoy_config_core_v3_DataSource* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_inline_string(const envoy_config_core_v3_DataSource* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_clear_inline_string(const envoy_config_core_v3_DataSource* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_inline_string(const envoy_config_core_v3_DataSource* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_core_v3_DataSource_has_environment_variable(const envoy_config_core_v3_DataSource* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_clear_environment_variable(const envoy_config_core_v3_DataSource* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_DataSource_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_DataSource_environment_variable(const envoy_config_core_v3_DataSource* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, upb_StringView_FromString(""));
+}
-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_filename(envoy_config_core_v3_DataSource *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE void envoy_config_core_v3_DataSource_set_inline_bytes(envoy_config_core_v3_DataSource *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-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_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
}
-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);
+UPB_INLINE void envoy_config_core_v3_DataSource_set_environment_variable(envoy_config_core_v3_DataSource *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RetryPolicy*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RetryPolicy* ret = envoy_config_core_v3_RetryPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_RetryPolicy_serialize_ex(const envoy_config_core_v3_RetryPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_RetryPolicy_clear_num_retries(const envoy_config_core_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_UInt32Value*);
}
-
-UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_BackoffStrategy*)_upb_Message_New(&envoy_config_core_v3_BackoffStrategy_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_RetryPolicy_set_retry_back_off(msg, sub);
}
@@ -821,10 +1417,10 @@ UPB_INLINE void envoy_config_core_v3_RetryPolicy_set_num_retries(envoy_config_co
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_RetryPolicy_set_num_retries(msg, sub);
}
@@ -833,54 +1429,84 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_RetryPolicy_
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RemoteDataSource*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDataSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RemoteDataSource* ret = envoy_config_core_v3_RemoteDataSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_RemoteDataSource_serialize_ex(const envoy_config_core_v3_RemoteDataSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_HttpUri*);
+}
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_sha256(const envoy_config_core_v3_RemoteDataSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RemoteDataSource_sha256(const envoy_config_core_v3_RemoteDataSource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_clear_retry_policy(const envoy_config_core_v3_RemoteDataSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const envoy_config_core_v3_RetryPolicy*);
}
-
-UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_retry_policy(const envoy_config_core_v3_RemoteDataSource *msg) { return _upb_hasbit(msg, 2); }
-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(16, 32), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_HttpUri*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HttpUri*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_RemoteDataSource_set_sha256(envoy_config_core_v3_RemoteDataSource *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy_config_core_v3_RetryPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_RemoteDataSource_set_retry_policy(msg, sub);
}
@@ -889,55 +1515,81 @@ UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RemoteD
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_AsyncDataSource*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_AsyncDataSource* ret = envoy_config_core_v3_AsyncDataSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_AsyncDataSource_serialize_ex(const envoy_config_core_v3_AsyncDataSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_local(const envoy_config_core_v3_AsyncDataSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_AsyncDataSource_clear_remote(const envoy_config_core_v3_AsyncDataSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_AsyncDataSource_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_core_v3_DataSource*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_RemoteDataSource*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RemoteDataSource*)_upb_Message_New(&envoy_config_core_v3_RemoteDataSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_AsyncDataSource_set_remote(msg, sub);
}
@@ -946,44 +1598,68 @@ UPB_INLINE struct envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_As
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_TransportSocket*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportSocket_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_TransportSocket* ret = envoy_config_core_v3_TransportSocket_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_TransportSocket_serialize_ex(const envoy_config_core_v3_TransportSocket* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_name(const envoy_config_core_v3_TransportSocket* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_TransportSocket_name(const envoy_config_core_v3_TransportSocket* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_TransportSocket_has_typed_config(const envoy_config_core_v3_TransportSocket* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_TransportSocket_clear_typed_config(const envoy_config_core_v3_TransportSocket* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_TransportSocket_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_core_v3_TransportSocket *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_mutable_typed_config(envoy_config_core_v3_TransportSocket *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_TransportSocket_set_typed_config(msg, sub);
}
@@ -992,71 +1668,112 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_TransportSocket_muta
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_RuntimeFractionalPercent_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RuntimeFractionalPercent* ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_RuntimeFractionalPercent_serialize_ex(const envoy_config_core_v3_RuntimeFractionalPercent* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_type_v3_FractionalPercent*);
+}
+UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_clear_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_RuntimeFractionalPercent_runtime_key(const envoy_config_core_v3_RuntimeFractionalPercent* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_core_v3_RuntimeFractionalPercent_mutable_default_value(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_RuntimeFractionalPercent_set_runtime_key(envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_ControlPlane*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_ControlPlane* ret = envoy_config_core_v3_ControlPlane_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_ControlPlane_serialize_ex(const envoy_config_core_v3_ControlPlane* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_ControlPlane_clear_identifier(const envoy_config_core_v3_ControlPlane* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_ControlPlane_identifier(const envoy_config_core_v3_ControlPlane* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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;
+UPB_INLINE void envoy_config_core_v3_ControlPlane_set_identifier(envoy_config_core_v3_ControlPlane *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
+extern const upb_MiniTable_File envoy_config_core_v3_base_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
index 30a2e754..aa4bf0c8 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
@@ -7,9 +7,12 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "xds/core/v3/authority.upb.h"
@@ -20,83 +23,140 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_ApiConfigSource_submsgs[3] = {
- &envoy_config_core_v3_GrpcService_msginit,
- &envoy_config_core_v3_RateLimitSettings_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_ApiConfigSource_submsgs[5] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_RateLimitSettings_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_ApiConfigSource__fields[8] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(28, 40), 0, 0, 9, 3},
- {3, UPB_SIZE(16, 16), 1, 2, 11, 1},
- {4, UPB_SIZE(32, 48), 0, 0, 11, 3},
- {5, UPB_SIZE(20, 24), 2, 2, 11, 1},
- {6, UPB_SIZE(24, 32), 3, 1, 11, 1},
- {7, UPB_SIZE(12, 12), 0, 0, 8, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_ApiConfigSource__fields[9] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 48), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 56), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit = {
&envoy_config_core_v3_ApiConfigSource_submsgs[0],
&envoy_config_core_v3_ApiConfigSource__fields[0],
- UPB_SIZE(40, 56), 8, false, 255,
+ UPB_SIZE(40, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_SelfConfigSource__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_SelfConfigSource__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msginit = {
NULL,
&envoy_config_core_v3_SelfConfigSource__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
- &google_protobuf_DoubleValue_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_DoubleValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_RateLimitSettings__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_RateLimitSettings__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit = {
+const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msginit = {
&envoy_config_core_v3_RateLimitSettings_submsgs[0],
&envoy_config_core_v3_RateLimitSettings__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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,
- &xds_core_v3_Authority_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_PathConfigSource_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_WatchedDirectory_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), 1, 3, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 2, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {7, UPB_SIZE(12, 16), 0, 4, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_PathConfigSource__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_ConfigSource_msginit = {
+const upb_MiniTable envoy_config_core_v3_PathConfigSource_msginit = {
+ &envoy_config_core_v3_PathConfigSource_submsgs[0],
+ &envoy_config_core_v3_PathConfigSource__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_ConfigSource_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_AggregatedConfigSource_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_SelfConfigSource_msginit},
+ {.submsg = &xds_core_v3_Authority_msginit},
+ {.submsg = &envoy_config_core_v3_PathConfigSource_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_ConfigSource__fields[8] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(28, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_ExtensionConfigSource__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit = {
+ &envoy_config_core_v3_ExtensionConfigSource_submsgs[0],
+ &envoy_config_core_v3_ExtensionConfigSource__fields[0],
+ UPB_SIZE(16, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_config_core_v3_ApiConfigSource_msginit,
+ &envoy_config_core_v3_AggregatedConfigSource_msginit,
+ &envoy_config_core_v3_SelfConfigSource_msginit,
+ &envoy_config_core_v3_RateLimitSettings_msginit,
+ &envoy_config_core_v3_PathConfigSource_msginit,
+ &envoy_config_core_v3_ConfigSource_msginit,
+ &envoy_config_core_v3_ExtensionConfigSource_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_config_source_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
index 1fc85348..0f6c5611 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,27 +24,39 @@ 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_PathConfigSource;
struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_ExtensionConfigSource;
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_PathConfigSource envoy_config_core_v3_PathConfigSource;
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;
+typedef struct envoy_config_core_v3_ExtensionConfigSource envoy_config_core_v3_ExtensionConfigSource;
+extern const upb_MiniTable envoy_config_core_v3_ApiConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RateLimitSettings_msginit;
+extern const upb_MiniTable envoy_config_core_v3_PathConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit;
struct envoy_config_core_v3_GrpcService;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_core_v3_WatchedDirectory;
+struct google_protobuf_Any;
struct google_protobuf_DoubleValue;
struct google_protobuf_Duration;
struct google_protobuf_UInt32Value;
struct xds_core_v3_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 xds_core_v3_Authority_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_DoubleValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable xds_core_v3_Authority_msginit;
typedef enum {
envoy_config_core_v3_ApiConfigSource_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0,
@@ -62,86 +74,153 @@ typedef enum {
} 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 envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(4, 4), 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(28, 40), len); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_hasbit(msg, 1); }
-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(16, 16), 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(32, 48)); }
-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(32, 48), len); }
-UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource *msg) { return _upb_hasbit(msg, 2); }
-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(20, 24), 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_hasbit(msg, 3); }
-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(24, 32), 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(12, 12), 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 envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigSource_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_ApiConfigSource*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_ApiConfigSource* ret = envoy_config_core_v3_ApiConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_ApiConfigSource_serialize_ex(const envoy_config_core_v3_ApiConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_api_type(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 16));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_ApiConfigSource_cluster_names(const envoy_config_core_v3_ApiConfigSource* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 16), len);
+}
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_refresh_delay(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const upb_Message*) = NULL;
+}
+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(24, 32));
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_grpc_services(const envoy_config_core_v3_ApiConfigSource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 32));
+}
+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(24, 32), len);
+}
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_request_timeout(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const upb_Message*) = NULL;
+}
+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(28, 40), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_rate_limit_settings(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const upb_Message*) = NULL;
+}
+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(32, 48), const envoy_config_core_v3_RateLimitSettings*);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_set_node_on_first_message_only(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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(8, 8), bool);
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_transport_api_version(const envoy_config_core_v3_ApiConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+}
+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(12, 12), int32_t);
+}
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_has_config_validators(const envoy_config_core_v3_ApiConfigSource* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 56));
+}
+UPB_INLINE void envoy_config_core_v3_ApiConfigSource_clear_config_validators(const envoy_config_core_v3_ApiConfigSource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 56));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_ApiConfigSource_config_validators(const envoy_config_core_v3_ApiConfigSource* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(36, 56), len);
+}
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(4, 4), 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(28, 40), len);
+UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_mutable_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 16), 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_accessor2(msg, UPB_SIZE(28, 40), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_core_v3_ApiConfigSource_resize_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 16), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 40), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_core_v3_ApiConfigSource_add_cluster_names(envoy_config_core_v3_ApiConfigSource* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 16), UPB_SIZE(3, 4), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(32, 48), len);
+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(24, 32), 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_accessor2(msg, UPB_SIZE(32, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 32), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_ApiConfigSource_set_request_timeout(msg, sub);
}
@@ -149,67 +228,106 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_ApiConfigSource
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), envoy_config_core_v3_RateLimitSettings*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RateLimitSettings*)_upb_Message_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(12, 12), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_mutable_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t* len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 56), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_ApiConfigSource_resize_config_validators(envoy_config_core_v3_ApiConfigSource* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 56), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_ApiConfigSource_add_config_validators(envoy_config_core_v3_ApiConfigSource* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 56), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_AggregatedConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_AggregatedConfigSource* ret = envoy_config_core_v3_AggregatedConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_AggregatedConfigSource_serialize_ex(const envoy_config_core_v3_AggregatedConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_SelfConfigSource*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_SelfConfigSource* ret = envoy_config_core_v3_SelfConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_SelfConfigSource_serialize_ex(const envoy_config_core_v3_SelfConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_SelfConfigSource_clear_transport_api_version(const envoy_config_core_v3_SelfConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 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;
@@ -217,37 +335,62 @@ UPB_INLINE void envoy_config_core_v3_SelfConfigSource_set_transport_api_version(
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_RateLimitSettings*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimitSettings_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_RateLimitSettings* ret = envoy_config_core_v3_RateLimitSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_RateLimitSettings_serialize_ex(const envoy_config_core_v3_RateLimitSettings* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_RateLimitSettings_clear_fill_rate(const envoy_config_core_v3_RateLimitSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_DoubleValue*);
}
-
-UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_RateLimitSettings_set_max_tokens(msg, sub);
}
@@ -257,81 +400,214 @@ UPB_INLINE void envoy_config_core_v3_RateLimitSettings_set_fill_rate(envoy_confi
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_DoubleValue*)_upb_Message_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 */
+/* envoy.config.core.v3.PathConfigSource */
-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_PathConfigSource* envoy_config_core_v3_PathConfigSource_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfigSource_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_PathConfigSource* ret = envoy_config_core_v3_PathConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_PathConfigSource* ret = envoy_config_core_v3_PathConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_PathConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_PathConfigSource_serialize(const envoy_config_core_v3_PathConfigSource* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_PathConfigSource_serialize_ex(const envoy_config_core_v3_PathConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_PathConfigSource_clear_path(const envoy_config_core_v3_PathConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-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 upb_StringView envoy_config_core_v3_PathConfigSource_path(const envoy_config_core_v3_PathConfigSource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
}
-UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE bool envoy_config_core_v3_PathConfigSource_has_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) {
+ return _upb_hasbit(msg, 1);
}
-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);
+UPB_INLINE void envoy_config_core_v3_PathConfigSource_clear_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_PathConfigSource_watched_directory(const envoy_config_core_v3_PathConfigSource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_WatchedDirectory*);
}
+UPB_INLINE void envoy_config_core_v3_PathConfigSource_set_path(envoy_config_core_v3_PathConfigSource *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_PathConfigSource_set_watched_directory(envoy_config_core_v3_PathConfigSource *msg, struct envoy_config_core_v3_WatchedDirectory* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_WatchedDirectory*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_PathConfigSource_mutable_watched_directory(envoy_config_core_v3_PathConfigSource* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_config_core_v3_PathConfigSource_watched_directory(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_PathConfigSource_set_watched_directory(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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_ConfigSource* ret = envoy_config_core_v3_ConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_ConfigSource_serialize_ex(const envoy_config_core_v3_ConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msginit, options, arena, len);
+}
typedef enum {
envoy_config_core_v3_ConfigSource_config_source_specifier_path = 1,
+ envoy_config_core_v3_ConfigSource_config_source_specifier_path_config_source = 8,
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_hasbit(msg, 1); }
-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(4, 4), 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 xds_core_v3_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource *msg, size_t *len) { return (const struct xds_core_v3_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 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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path(const envoy_config_core_v3_ConfigSource* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_ConfigSource_path(const envoy_config_core_v3_ConfigSource* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, upb_StringView_FromString(""));
+}
+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(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_api_config_source(const envoy_config_core_v3_ConfigSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET);
+}
+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(12, 16), UPB_SIZE(4, 4), 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(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_ads(const envoy_config_core_v3_ConfigSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET);
+}
+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(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_initial_fetch_timeout(const envoy_config_core_v3_ConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), 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(4, 4)) == 5;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_self(const envoy_config_core_v3_ConfigSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET);
+}
+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(12, 16), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_resource_api_version(const envoy_config_core_v3_ConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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(8, 8), 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(24, 40));
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_authorities(const envoy_config_core_v3_ConfigSource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+UPB_INLINE const struct xds_core_v3_Authority* const* envoy_config_core_v3_ConfigSource_authorities(const envoy_config_core_v3_ConfigSource* msg, size_t* len) {
+ return (const struct xds_core_v3_Authority* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len);
+}
+UPB_INLINE bool envoy_config_core_v3_ConfigSource_has_path_config_source(const envoy_config_core_v3_ConfigSource* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8;
+}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_clear_path_config_source(const envoy_config_core_v3_ConfigSource* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_config_core_v3_ConfigSource_config_source_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_ConfigSource_path_config_source(const envoy_config_core_v3_ConfigSource* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 8, NULL);
+}
+
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path(envoy_config_core_v3_ConfigSource *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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_WRITE_ONEOF(msg, envoy_config_core_v3_ApiConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ApiConfigSource*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_AggregatedConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_AggregatedConfigSource*)_upb_Message_New(&envoy_config_core_v3_AggregatedConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_ConfigSource_set_ads(msg, sub);
}
@@ -339,45 +615,159 @@ UPB_INLINE struct envoy_config_core_v3_AggregatedConfigSource* envoy_config_core
}
UPB_INLINE void envoy_config_core_v3_ConfigSource_set_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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_ConfigSource_mutable_initial_fetch_timeout(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_SelfConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_SelfConfigSource*)_upb_Message_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(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
-UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource *msg, size_t *len) {
- return (struct xds_core_v3_Authority**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
+UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_mutable_authorities(envoy_config_core_v3_ConfigSource* msg, size_t* len) {
+ return (struct xds_core_v3_Authority**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
}
-UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource *msg, size_t len, upb_arena *arena) {
- return (struct xds_core_v3_Authority**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct xds_core_v3_Authority** envoy_config_core_v3_ConfigSource_resize_authorities(envoy_config_core_v3_ConfigSource* msg, size_t len, upb_Arena* arena) {
+ return (struct xds_core_v3_Authority**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct xds_core_v3_Authority* envoy_config_core_v3_ConfigSource_add_authorities(envoy_config_core_v3_ConfigSource *msg, upb_arena *arena) {
- struct xds_core_v3_Authority* sub = (struct xds_core_v3_Authority*)_upb_msg_new(&xds_core_v3_Authority_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct xds_core_v3_Authority* envoy_config_core_v3_ConfigSource_add_authorities(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) {
+ struct xds_core_v3_Authority* sub = (struct xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_core_v3_ConfigSource_set_path_config_source(envoy_config_core_v3_ConfigSource *msg, envoy_config_core_v3_PathConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_PathConfigSource*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 8);
+}
+UPB_INLINE struct envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_ConfigSource_mutable_path_config_source(envoy_config_core_v3_ConfigSource* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_PathConfigSource* sub = (struct envoy_config_core_v3_PathConfigSource*)envoy_config_core_v3_ConfigSource_path_config_source(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_PathConfigSource*)_upb_Message_New(&envoy_config_core_v3_PathConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_ConfigSource_set_path_config_source(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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_ExtensionConfigSource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_ExtensionConfigSource* ret = envoy_config_core_v3_ExtensionConfigSource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_ExtensionConfigSource_serialize_ex(const envoy_config_core_v3_ExtensionConfigSource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const 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 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_default_config(const envoy_config_core_v3_ExtensionConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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 void envoy_config_core_v3_ExtensionConfigSource_clear_apply_default_config_without_warming(const envoy_config_core_v3_ExtensionConfigSource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE void envoy_config_core_v3_ExtensionConfigSource_clear_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_ExtensionConfigSource_type_urls(const envoy_config_core_v3_ExtensionConfigSource* msg, size_t* len) {
+ return (upb_StringView 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, envoy_config_core_v3_ConfigSource* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_Message_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_sethas(msg, 2);
+ *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_Message_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(1, 1), bool) = value;
+}
+UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_mutable_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE upb_StringView* envoy_config_core_v3_ExtensionConfigSource_resize_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_add_type_urls(envoy_config_core_v3_ExtensionConfigSource* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File envoy_config_core_v3_config_source_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
index 3f89247a..65b15a55 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -16,18 +16,31 @@
#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_MiniTable_Sub envoy_config_core_v3_EventServiceConfig_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_EventServiceConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_EventServiceConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_event_service_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
index 3069f4c3..bfc600e5 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,53 +22,75 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit;
struct envoy_config_core_v3_GrpcService;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_EventServiceConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventServiceConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_EventServiceConfig* ret = envoy_config_core_v3_EventServiceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_EventServiceConfig_serialize_ex(const envoy_config_core_v3_EventServiceConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_EventServiceConfig_clear_grpc_service(const envoy_config_core_v3_EventServiceConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_EventServiceConfig_config_source_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_config_core_v3_GrpcService*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_EventServiceConfig_set_grpc_service(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_core_v3_event_service_config_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
index 47b8b32e..1c1215ab 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
@@ -7,46 +7,40 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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_MiniTable_Sub envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_TypedExtensionConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_TypedExtensionConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
};
-static const upb_msglayout_field envoy_config_core_v3_ExtensionConfigSource__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(1, 1), 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, 255,
+const upb_MiniTable_File envoy_config_core_v3_extension_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
index 8499bfc2..1628682b 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -21,124 +21,78 @@ 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;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
struct google_protobuf_Any;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_TypedExtensionConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_TypedExtensionConfig* ret = envoy_config_core_v3_TypedExtensionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_TypedExtensionConfig_serialize_ex(const envoy_config_core_v3_TypedExtensionConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_clear_name(const envoy_config_core_v3_TypedExtensionConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_TypedExtensionConfig_name(const envoy_config_core_v3_TypedExtensionConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_clear_typed_config(const envoy_config_core_v3_TypedExtensionConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Any*);
}
-UPB_INLINE upb_strview envoy_config_core_v3_TypedExtensionConfig_name(const envoy_config_core_v3_TypedExtensionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_TypedExtensionConfig_has_typed_config(const envoy_config_core_v3_TypedExtensionConfig *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_name(envoy_config_core_v3_TypedExtensionConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_core_v3_TypedExtensionConfig_set_typed_config(envoy_config_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_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 envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(1, 1), 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_sethas(msg, 1);
- *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_sethas(msg, 2);
- *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(1, 1), 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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val,
- arena);
-}
+extern const upb_MiniTable_File envoy_config_core_v3_extension_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c
new file mode 100644
index 00000000..d33bc5a8
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c
@@ -0,0 +1,58 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_method_list.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/core/v3/grpc_method_list.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_MiniTable_Sub envoy_config_core_v3_GrpcMethodList_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcMethodList_Service_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msginit = {
+ &envoy_config_core_v3_GrpcMethodList_submsgs[0],
+ &envoy_config_core_v3_GrpcMethodList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList_Service__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msginit = {
+ NULL,
+ &envoy_config_core_v3_GrpcMethodList_Service__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_core_v3_GrpcMethodList_msginit,
+ &envoy_config_core_v3_GrpcMethodList_Service_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_grpc_method_list_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h
new file mode 100644
index 00000000..17e91323
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h
@@ -0,0 +1,151 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_method_list.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_GrpcMethodList;
+struct envoy_config_core_v3_GrpcMethodList_Service;
+typedef struct envoy_config_core_v3_GrpcMethodList envoy_config_core_v3_GrpcMethodList;
+typedef struct envoy_config_core_v3_GrpcMethodList_Service envoy_config_core_v3_GrpcMethodList_Service;
+extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcMethodList_Service_msginit;
+
+
+
+/* envoy.config.core.v3.GrpcMethodList */
+
+UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcMethodList*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_serialize(const envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_serialize_ex(const envoy_config_core_v3_GrpcMethodList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_has_services(const envoy_config_core_v3_GrpcMethodList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_core_v3_GrpcMethodList_clear_services(const envoy_config_core_v3_GrpcMethodList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_core_v3_GrpcMethodList_Service* const* envoy_config_core_v3_GrpcMethodList_services(const envoy_config_core_v3_GrpcMethodList* msg, size_t* len) {
+ return (const envoy_config_core_v3_GrpcMethodList_Service* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_mutable_services(envoy_config_core_v3_GrpcMethodList* msg, size_t* len) {
+ return (envoy_config_core_v3_GrpcMethodList_Service**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_resize_services(envoy_config_core_v3_GrpcMethodList* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcMethodList_Service**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_add_services(envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcMethodList_Service* sub = (struct envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.GrpcMethodList.Service */
+
+UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy_config_core_v3_GrpcMethodList_Service_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcMethodList_Service_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_Service_serialize(const envoy_config_core_v3_GrpcMethodList_Service* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_Service_serialize_ex(const envoy_config_core_v3_GrpcMethodList_Service* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_name(const envoy_config_core_v3_GrpcMethodList_Service* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_GrpcMethodList_Service_name(const envoy_config_core_v3_GrpcMethodList_Service* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_GrpcMethodList_Service_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+
+UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_set_name(envoy_config_core_v3_GrpcMethodList_Service *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_mutable_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_resize_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_Service_add_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File envoy_config_core_v3_grpc_method_list_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
index b2e99df0..6cc07ab4 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/grpc_service.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "google/protobuf/any.upb.h"
@@ -22,219 +22,247 @@
#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_MiniTable_Sub envoy_config_core_v3_GrpcService_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_GrpcService__fields[4] = {
- {1, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1},
- {2, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
- {3, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {5, UPB_SIZE(8, 16), 0, 2, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService__fields[4] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_msginit = {
+const upb_MiniTable envoy_config_core_v3_GrpcService_msginit = {
&envoy_config_core_v3_GrpcService_submsgs[0],
&envoy_config_core_v3_GrpcService__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = {
+const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), 1, 2, 11, 1},
- {3, UPB_SIZE(44, 88), 0, 0, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {7, UPB_SIZE(36, 72), 3, 4, 11, 1},
- {8, UPB_SIZE(40, 80), 4, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 80), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(44, 88), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(48, 104), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit = {
+const upb_MiniTable 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(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = {
+const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit},
+ {.submsg = &google_protobuf_Empty_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = {
+ {.submsg = &google_protobuf_Empty_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(48, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(56, 112), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(64, 128), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(72, 152), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[14] = {
+ &envoy_config_core_v3_GrpcService_msginit,
+ &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
+ &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_StsService_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_grpc_service_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 14,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
index dd9913de..e0e2136c 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -48,20 +48,20 @@ typedef struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsSe
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;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit;
+extern const upb_MiniTable 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;
@@ -69,70 +69,111 @@ 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;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_Empty_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService* ret = envoy_config_core_v3_GrpcService_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_serialize_ex(const envoy_config_core_v3_GrpcService* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_msginit, options, 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(16, 32), 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(16, 32)) == 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(12, 24), UPB_SIZE(16, 32), 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(16, 32)) == 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(12, 24), UPB_SIZE(16, 32), 2, NULL); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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(8, 16)); }
-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(8, 16), len); }
+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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_clear_envoy_grpc(const envoy_config_core_v3_GrpcService* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(16, 24), 0, UPB_SIZE(4, 4), envoy_config_core_v3_GrpcService_target_specifier_NOT_SET);
+}
+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(16, 24), UPB_SIZE(4, 4), 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(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_clear_google_grpc(const envoy_config_core_v3_GrpcService* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(16, 24), 0, UPB_SIZE(4, 4), envoy_config_core_v3_GrpcService_target_specifier_NOT_SET);
+}
+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(16, 24), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcService_has_timeout(const envoy_config_core_v3_GrpcService* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_clear_timeout(const envoy_config_core_v3_GrpcService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), 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(12, 16));
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_clear_initial_metadata(const envoy_config_core_v3_GrpcService* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+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(12, 16), 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(12, 24), value, UPB_SIZE(16, 32), 1);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_EnvoyGrpc*, UPB_SIZE(16, 24), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_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(12, 24), value, UPB_SIZE(16, 32), 2);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc*, UPB_SIZE(16, 24), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc*)_upb_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_set_google_grpc(msg, sub);
}
@@ -140,138 +181,218 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core
}
UPB_INLINE void envoy_config_core_v3_GrpcService_set_timeout(envoy_config_core_v3_GrpcService *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_GrpcService_mutable_timeout(envoy_config_core_v3_GrpcService *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(8, 16), len);
+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(12, 16), 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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValue_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_EnvoyGrpc*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_GrpcService_EnvoyGrpc_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_EnvoyGrpc* ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_GrpcService_EnvoyGrpc_serialize_ex(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_clear_cluster_name(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_clear_authority(const envoy_config_core_v3_GrpcService_EnvoyGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_cluster_name(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_config_core_v3_GrpcService_EnvoyGrpc_set_authority(envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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 envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_hasbit(msg, 1); }
-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(28, 56), 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(44, 88)); }
-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(44, 88), 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(12, 24), 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(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg) { return _upb_hasbit(msg, 2); }
-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(32, 64), 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_hasbit(msg, 3); }
-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(36, 72), 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_hasbit(msg, 4); }
-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(40, 80), 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(4, 8), upb_strview) = value;
+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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_GrpcService_GoogleGrpc_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_target_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_target_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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(16, 32));
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_call_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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(16, 32), len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_stat_prefix(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_credentials_factory_name(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_has_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_config(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+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(36, 72), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_per_stream_buffer_limit_bytes(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
+}
+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(40, 80), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_clear_channel_args(const envoy_config_core_v3_GrpcService_GoogleGrpc* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
+}
+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(44, 88), 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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_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(44, 88), len);
+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(16, 32), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_stat_prefix(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = 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(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_set_credentials_factory_name(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = 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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_Struct*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_set_config(msg, sub);
}
@@ -279,12 +400,12 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_GrpcService_Googl
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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_core_v3_GrpcService_GoogleGrpc_mutable_per_stream_buffer_limit_bytes(envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_set_per_stream_buffer_limit_bytes(msg, sub);
}
@@ -292,12 +413,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_GrpcService_
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_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);
}
@@ -306,39 +427,71 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_private_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_clear_cert_chain(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_config_core_v3_DataSource*);
}
-
-UPB_INLINE bool envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_has_root_certs(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_sethas(msg, 1);
*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_root_certs(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_root_certs(msg, sub);
}
@@ -348,10 +501,10 @@ UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_p
_upb_sethas(msg, 2);
*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_private_key(envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_private_key(msg, sub);
}
@@ -361,10 +514,10 @@ UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_c
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_set_cert_chain(msg, sub);
}
@@ -373,92 +526,136 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_GrpcServ
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_ssl_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_google_default(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_clear_local_credentials(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials*)_upb_Message_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_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Empty*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials*)_upb_Message_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);
}
@@ -467,24 +664,35 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredent
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, options, 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,
@@ -495,84 +703,134 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_access_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_compute_engine(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_refresh_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView 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_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
+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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_service_account_jwt_access(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_google_iam(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_from_plugin(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_clear_sts_service(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 7, NULL);
+}
+
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_set_access_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Empty*)_upb_Message_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_google_refresh_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_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);
}
@@ -581,104 +839,170 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_St
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_clear_json_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_clear_token_lifetime_seconds(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0;
+}
+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(8, 16), uint64_t);
}
-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_json_key(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_clear_authorization_token(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_clear_authority_selector(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_authorization_token(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_set_authority_selector(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_name(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_clear_typed_config(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_set_typed_config(msg, sub);
}
@@ -687,140 +1011,252 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_GrpcService_GoogleGr
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_token_exchange_service_uri(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_resource(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_audience(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_scope(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_requested_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_subject_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_path(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_clear_actor_token_type(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_token_exchange_service_uri(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_resource(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_audience(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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_scope(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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_requested_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = 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_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), upb_StringView) = 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_subject_token_type(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 96), upb_StringView) = 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_path(envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = 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;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 128), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, options, 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 void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_clear_args(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* msg) {
+ _upb_array_detach(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_StringView 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 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); }
+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_StringView 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_StringView 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_serialize_ex(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_string_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView 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_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_clear_int_value(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* msg) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 2, _upb_Int64_FromLL(0ll));
+}
-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_string_value(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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);
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_INLINE upb_StringView envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_key(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -830,6 +1266,8 @@ UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntr
_upb_msg_map_set_value(msg, &value, sizeof(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*));
}
+extern const upb_MiniTable_File envoy_config_core_v3_grpc_service_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
index b0a5a642..16fdade6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -24,146 +24,196 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_submsgs[10] = {
- &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[23] = {
- {1, UPB_SIZE(20, 32), 1, 7, 11, 1},
- {2, UPB_SIZE(24, 40), 2, 7, 11, 1},
- {3, UPB_SIZE(28, 48), 3, 7, 11, 1},
- {4, UPB_SIZE(32, 56), 4, 9, 11, 1},
- {5, UPB_SIZE(36, 64), 5, 9, 11, 1},
- {6, UPB_SIZE(40, 72), 6, 9, 11, 1},
- {7, UPB_SIZE(44, 80), 7, 6, 11, 1},
- {8, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 3, 11, 1},
- {9, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 4, 11, 1},
- {11, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 2, 11, 1},
- {12, UPB_SIZE(48, 88), 8, 7, 11, 1},
- {13, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 1, 11, 1},
- {14, UPB_SIZE(52, 96), 9, 7, 11, 1},
- {15, UPB_SIZE(56, 104), 10, 7, 11, 1},
- {16, UPB_SIZE(60, 112), 11, 7, 11, 1},
- {17, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {18, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {19, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {20, UPB_SIZE(64, 120), 12, 7, 11, 1},
- {21, UPB_SIZE(68, 128), 13, 5, 11, 1},
- {22, UPB_SIZE(72, 136), 14, 0, 11, 1},
- {23, UPB_SIZE(76, 144), 15, 8, 11, 1},
- {24, UPB_SIZE(80, 152), 16, 7, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_HealthCheck_msginit = {
+static const upb_MiniTable_Field envoy_config_core_v3_HealthStatusSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit = {
+ NULL,
+ &envoy_config_core_v3_HealthStatusSet__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_submsgs[20] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_TlsOptions_msginit},
+ {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck__fields[23] = {
+ {1, UPB_SIZE(16, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(20, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 40), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 48), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(36, 56), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 64), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(44, 72), UPB_SIZE(8, 8), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(88, 160), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(48, 80), UPB_SIZE(9, 9), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(52, 88), UPB_SIZE(10, 10), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(56, 96), UPB_SIZE(11, 11), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(60, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(68, 120), UPB_SIZE(12, 12), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(72, 128), UPB_SIZE(13, 13), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(76, 136), UPB_SIZE(14, 14), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(80, 144), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(84, 152), UPB_SIZE(16, 16), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit = {
&envoy_config_core_v3_HealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck__fields[0],
- UPB_SIZE(96, 176), 23, false, 255,
+ UPB_SIZE(92, 168), 23, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_Payload__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit = {
+const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_Payload__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[4] = {
- &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_MiniTable_Sub envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_type_v3_Int64Range_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &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), 1, 1, 11, 1},
- {4, UPB_SIZE(28, 48), 2, 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(4, 4), 0, 0, 14, 1},
- {11, UPB_SIZE(32, 56), 3, 2, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[10] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(40, 72), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(44, 80), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(52, 104), 10, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[1] = {
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = {
+const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = {
- NULL,
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = {
+ &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit = {
+const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_TlsOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[9] = {
+ &envoy_config_core_v3_HealthStatusSet_msginit,
+ &envoy_config_core_v3_HealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_Payload_msginit,
+ &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_health_check_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 9,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
index e4a803ab..8b1aa744 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,7 @@
extern "C" {
#endif
+struct envoy_config_core_v3_HealthStatusSet;
struct envoy_config_core_v3_HealthCheck;
struct envoy_config_core_v3_HealthCheck_Payload;
struct envoy_config_core_v3_HealthCheck_HttpHealthCheck;
@@ -28,6 +29,7 @@ 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_HealthStatusSet envoy_config_core_v3_HealthStatusSet;
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;
@@ -36,14 +38,15 @@ typedef struct envoy_config_core_v3_HealthCheck_RedisHealthCheck envoy_config_co
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;
+extern const upb_MiniTable envoy_config_core_v3_HealthStatusSet_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit;
+extern const upb_MiniTable 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;
@@ -53,15 +56,15 @@ 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;
+extern const upb_MiniTable envoy_config_core_v3_EventServiceConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable envoy_type_v3_Int64Range_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_config_core_v3_UNKNOWN = 0,
@@ -73,26 +76,86 @@ typedef enum {
} 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);
+/* envoy.config.core.v3.HealthStatusSet */
+
+UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStatusSet_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthStatusSet*)_upb_Message_New(&envoy_config_core_v3_HealthStatusSet_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStatusSet_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_HealthStatusSet* ret = envoy_config_core_v3_HealthStatusSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStatusSet_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthStatusSet* ret = envoy_config_core_v3_HealthStatusSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthStatusSet_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_HealthStatusSet_serialize(const envoy_config_core_v3_HealthStatusSet* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, 0, arena, len);
}
-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_HealthStatusSet_serialize_ex(const envoy_config_core_v3_HealthStatusSet* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, options, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_config_core_v3_HealthStatusSet_clear_statuses(const envoy_config_core_v3_HealthStatusSet* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
}
-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);
+UPB_INLINE int32_t const* envoy_config_core_v3_HealthStatusSet_statuses(const envoy_config_core_v3_HealthStatusSet* msg, size_t* len) {
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
}
+UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_mutable_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE int32_t* envoy_config_core_v3_HealthStatusSet_resize_statuses(envoy_config_core_v3_HealthStatusSet* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, 2, arena);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthStatusSet_add_statuses(envoy_config_core_v3_HealthStatusSet* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), 2, &val, arena);
+}
+
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck* ret = envoy_config_core_v3_HealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msginit, options, 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,
@@ -100,60 +163,216 @@ typedef enum {
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(88, 168), int32_t); }
-
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 1); }
-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(20, 32), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 2); }
-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(24, 40), 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_hasbit(msg, 3); }
-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(28, 48), 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_hasbit(msg, 4); }
-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(32, 56), 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_hasbit(msg, 5); }
-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(36, 64), 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_hasbit(msg, 6); }
-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(40, 72), 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_hasbit(msg, 7); }
-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(44, 80), 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(88, 168)) == 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(84, 160), UPB_SIZE(88, 168), 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(88, 168)) == 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(84, 160), UPB_SIZE(88, 168), 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(88, 168)) == 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(84, 160), UPB_SIZE(88, 168), 11, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 8); }
-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(48, 88), 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(88, 168)) == 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(84, 160), UPB_SIZE(88, 168), 13, NULL); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 9); }
-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(52, 96), 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_hasbit(msg, 10); }
-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(56, 104), 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_hasbit(msg, 11); }
-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(60, 112), 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(12, 16), 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(4, 4), 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(8, 8), bool); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 12); }
-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(64, 120), 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_hasbit(msg, 13); }
-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(68, 128), 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_hasbit(msg, 14); }
-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(72, 136), 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_hasbit(msg, 15); }
-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(76, 144), const struct google_protobuf_Struct*); }
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const struct google_protobuf_Duration*); }
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_timeout(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_timeout(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), const upb_Message*) = NULL;
+}
+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, 16), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), const upb_Message*) = NULL;
+}
+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, 24), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const upb_Message*) = NULL;
+}
+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, 32), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_threshold(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const upb_Message*) = NULL;
+}
+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, 40), 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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_threshold(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const upb_Message*) = NULL;
+}
+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, 48), 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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_alt_port(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const upb_Message*) = NULL;
+}
+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, 56), 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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_reuse_connection(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const upb_Message*) = NULL;
+}
+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, 64), 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(4, 4)) == 8;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_http_health_check(const envoy_config_core_v3_HealthCheck* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET);
+}
+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(88, 160), UPB_SIZE(4, 4), 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(4, 4)) == 9;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tcp_health_check(const envoy_config_core_v3_HealthCheck* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET);
+}
+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(88, 160), UPB_SIZE(4, 4), 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(4, 4)) == 11;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_grpc_health_check(const envoy_config_core_v3_HealthCheck* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET);
+}
+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(88, 160), UPB_SIZE(4, 4), 11, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const upb_Message*) = NULL;
+}
+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, 72), 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(4, 4)) == 13;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_custom_health_check(const envoy_config_core_v3_HealthCheck* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(88, 160), 0, UPB_SIZE(4, 4), envoy_config_core_v3_HealthCheck_health_checker_NOT_SET);
+}
+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(88, 160), UPB_SIZE(4, 4), 13, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const upb_Message*) = NULL;
+}
+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, 80), 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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_unhealthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const upb_Message*) = NULL;
+}
+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, 88), 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_healthy_edge_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const upb_Message*) = NULL;
+}
+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, 96), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_log_path(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_event_log_path(const envoy_config_core_v3_HealthCheck* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_interval_jitter_percent(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+}
+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(8, 8), uint32_t);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_always_log_health_check_failures(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+}
+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(12, 12), bool);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_initial_jitter(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const upb_Message*) = NULL;
+}
+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(68, 120), 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_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_tls_options(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const upb_Message*) = NULL;
+}
+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(72, 128), 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_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_event_service(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const upb_Message*) = NULL;
+}
+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(76, 136), 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_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_transport_socket_match_criteria(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const upb_Message*) = NULL;
+}
+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(80, 144), const struct google_protobuf_Struct*);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_has_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ return _upb_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_clear_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_no_traffic_healthy_interval(const envoy_config_core_v3_HealthCheck* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const struct google_protobuf_Duration*);
+}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_timeout(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_timeout(msg, sub);
}
@@ -161,12 +380,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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_HealthCheck_mutable_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_interval(msg, sub);
}
@@ -174,12 +393,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_interval_jitter(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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_HealthCheck_mutable_interval_jitter(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_interval_jitter(msg, sub);
}
@@ -187,12 +406,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_unhealthy_threshold(msg, sub);
}
@@ -200,12 +419,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), 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_core_v3_HealthCheck_mutable_healthy_threshold(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_healthy_threshold(msg, sub);
}
@@ -213,12 +432,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_alt_port(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_alt_port(msg, sub);
}
@@ -226,48 +445,48 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HealthCheck_
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_reuse_connection(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(84, 160), value, UPB_SIZE(88, 168), 8);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_HttpHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_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(84, 160), value, UPB_SIZE(88, 168), 9);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_TcpHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_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(84, 160), value, UPB_SIZE(88, 168), 11);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_GrpcHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_grpc_health_check(msg, sub);
}
@@ -275,24 +494,24 @@ UPB_INLINE struct envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(84, 160), value, UPB_SIZE(88, 168), 13);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_HealthCheck_CustomHealthCheck*, UPB_SIZE(88, 160), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_custom_health_check(msg, sub);
}
@@ -300,12 +519,12 @@ UPB_INLINE struct envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_conf
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_unhealthy_interval(msg, sub);
}
@@ -313,12 +532,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_unhealthy_edge_interval(msg, sub);
}
@@ -326,34 +545,34 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 112), 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_core_v3_HealthCheck_mutable_healthy_edge_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(12, 16), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_HealthCheck_set_event_log_path(envoy_config_core_v3_HealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = 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(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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(8, 8), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), 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_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 120), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_initial_jitter(msg, sub);
}
@@ -361,12 +580,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
}
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_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 128), envoy_config_core_v3_HealthCheck_TlsOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_tls_options(msg, sub);
}
@@ -374,12 +593,12 @@ UPB_INLINE struct envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core
}
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_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 136), struct envoy_config_core_v3_EventServiceConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), 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) {
+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);
+ sub = (struct envoy_config_core_v3_EventServiceConfig*)_upb_Message_New(&envoy_config_core_v3_EventServiceConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_event_service(msg, sub);
}
@@ -387,12 +606,12 @@ UPB_INLINE struct envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_
}
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_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 144), struct google_protobuf_Struct*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 144), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_transport_socket_match_criteria(msg, sub);
}
@@ -400,12 +619,12 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_HealthCheck_mutab
}
UPB_INLINE void envoy_config_core_v3_HealthCheck_set_no_traffic_healthy_interval(envoy_config_core_v3_HealthCheck *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 152), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_healthy_interval(envoy_config_core_v3_HealthCheck *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mutable_no_traffic_healthy_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_healthy_interval(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_set_no_traffic_healthy_interval(msg, sub);
}
@@ -414,92 +633,193 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HealthCheck_mut
/* 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 envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_Payload_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_HealthCheck_Payload_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_Payload* ret = envoy_config_core_v3_HealthCheck_Payload_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_Payload_serialize_ex(const envoy_config_core_v3_HealthCheck_Payload* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_text(const envoy_config_core_v3_HealthCheck_Payload* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_Payload_text(const envoy_config_core_v3_HealthCheck_Payload* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_clear_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_Payload_payload_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_Payload_binary(const envoy_config_core_v3_HealthCheck_Payload* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
-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_text(envoy_config_core_v3_HealthCheck_Payload *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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);
+UPB_INLINE void envoy_config_core_v3_HealthCheck_Payload_set_binary(envoy_config_core_v3_HealthCheck_Payload *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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 envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(4, 4), 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_hasbit(msg, 3); }
-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 envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_HttpHealthCheck*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_HttpHealthCheck* ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_HttpHealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_host(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_path(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_send(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_receive(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(32, 56));
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_add(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+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(32, 56), len);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 64));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_request_headers_to_remove(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), 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(40, 72));
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_expected_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(40, 72));
+}
+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(40, 72), len);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL;
+}
+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(44, 80), const struct envoy_type_matcher_v3_StringMatcher*);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_clear_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_retriable_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(48, 88), len);
+}
+
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_path(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_send(msg, sub);
}
@@ -509,48 +829,45 @@ UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_receive(env
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_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_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(32, 56), 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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &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_StringView* envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), 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_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_request_headers_to_remove(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(3, 4), &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_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(40, 72), 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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_v3_Int64Range_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -559,166 +876,284 @@ UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_codec_clien
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_type_matcher_v3_StringMatcher*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_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;
}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t* len) {
+ return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_type_v3_Int64Range**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_Message_New(&envoy_type_v3_Int64Range_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_TcpHealthCheck*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_TcpHealthCheck* ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_TcpHealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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(8, 16));
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_TcpHealthCheck_clear_receive(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
}
-
-UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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(8, 16)); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HealthCheck_Payload*)_upb_Message_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) {
+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(8, 16), 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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HealthCheck_Payload_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_RedisHealthCheck*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_RedisHealthCheck* ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_RedisHealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck_RedisHealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_HealthCheck_RedisHealthCheck_clear_key(const envoy_config_core_v3_HealthCheck_RedisHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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;
+UPB_INLINE void envoy_config_core_v3_HealthCheck_RedisHealthCheck_set_key(envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_GrpcHealthCheck*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_GrpcHealthCheck* ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_service_name(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_authority(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_GrpcHealthCheck_has_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_clear_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_initial_metadata(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), 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_service_name(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_config_core_v3_HealthCheck_GrpcHealthCheck_set_authority(envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_core_v3_HealthCheck_GrpcHealthCheck_mutable_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* 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_core_v3_HealthCheck_GrpcHealthCheck_resize_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HealthCheck_GrpcHealthCheck_add_initial_metadata(envoy_config_core_v3_HealthCheck_GrpcHealthCheck* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
}
/* 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 envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_CustomHealthCheck*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_CustomHealthCheck* ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_CustomHealthCheck_serialize_ex(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HealthCheck_CustomHealthCheck_name(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_core_v3_HealthCheck_CustomHealthCheck_clear_typed_config(const envoy_config_core_v3_HealthCheck_CustomHealthCheck* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HealthCheck_CustomHealthCheck_set_typed_config(msg, sub);
}
@@ -727,37 +1162,54 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_core_v3_HealthCheck_CustomHe
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HealthCheck_TlsOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_HealthCheck_TlsOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HealthCheck_TlsOptions* ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_HealthCheck_TlsOptions_serialize_ex(const envoy_config_core_v3_HealthCheck_TlsOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, options, arena, len);
}
-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 void envoy_config_core_v3_HealthCheck_TlsOptions_clear_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE upb_StringView const* envoy_config_core_v3_HealthCheck_TlsOptions_alpn_protocols(const envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), 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_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_mutable_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_core_v3_HealthCheck_TlsOptions_resize_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_add_alpn_protocols(envoy_config_core_v3_HealthCheck_TlsOptions* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena);
}
+extern const upb_MiniTable_File envoy_config_core_v3_health_check_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
index c39ebef4..966f3607 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/http_uri.upb.h"
#include "google/protobuf/duration.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,20 +16,33 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_HttpUri_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_HttpUri_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HttpUri__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_HttpUri__fields[3] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HttpUri_msginit = {
+const upb_MiniTable envoy_config_core_v3_HttpUri_msginit = {
&envoy_config_core_v3_HttpUri_submsgs[0],
&envoy_config_core_v3_HttpUri__fields[0],
- UPB_SIZE(32, 64), 3, false, 255,
+ UPB_SIZE(28, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_HttpUri_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_http_uri_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
index c49eec1f..ca883b50 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,63 +22,97 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_HttpUri_msginit;
struct google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_HttpUri*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HttpUri* ret = envoy_config_core_v3_HttpUri_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_HttpUri_serialize_ex(const envoy_config_core_v3_HttpUri* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HttpUri_msginit, options, 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(24, 48), 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(4, 8), 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(24, 48)) == 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(16, 32), UPB_SIZE(24, 48), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), const struct google_protobuf_Duration*); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_HttpUri_clear_uri(const envoy_config_core_v3_HttpUri* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HttpUri_uri(const envoy_config_core_v3_HttpUri* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_HttpUri_has_cluster(const envoy_config_core_v3_HttpUri* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_HttpUri_clear_cluster(const envoy_config_core_v3_HttpUri* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_HttpUri_http_upstream_type_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_HttpUri_cluster(const envoy_config_core_v3_HttpUri* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_core_v3_HttpUri_has_timeout(const envoy_config_core_v3_HttpUri* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HttpUri_clear_timeout(const envoy_config_core_v3_HttpUri* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_HttpUri_set_uri(envoy_config_core_v3_HttpUri *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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(16, 32), value, UPB_SIZE(24, 48), 2);
+UPB_INLINE void envoy_config_core_v3_HttpUri_set_cluster(envoy_config_core_v3_HttpUri *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
}
UPB_INLINE void envoy_config_core_v3_HttpUri_set_timeout(envoy_config_core_v3_HttpUri *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_HttpUri_mutable_timeout(envoy_config_core_v3_HttpUri *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HttpUri_set_timeout(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_core_v3_http_uri_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
index 67c9b102..92da0805 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
@@ -7,175 +7,315 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "xds/annotations/v3/status.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"
-const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit = {
+const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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},
+static const upb_MiniTable_Sub envoy_config_core_v3_QuicKeepAliveSettings_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = {
+static const upb_MiniTable_Field envoy_config_core_v3_QuicKeepAliveSettings__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msginit = {
+ &envoy_config_core_v3_QuicKeepAliveSettings_submsgs[0],
+ &envoy_config_core_v3_QuicKeepAliveSettings__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_QuicProtocolOptions_submsgs[5] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_QuicKeepAliveSettings_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_QuicProtocolOptions__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit = {
+ &envoy_config_core_v3_QuicProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_QuicProtocolOptions__fields[0],
+ UPB_SIZE(24, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = {
NULL,
&envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_HttpProtocolOptions_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[3] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HttpProtocolOptions__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(20, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit = {
+const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit = {
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[0],
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[0],
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit = {
+ NULL,
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_HttpProtocolOptions_submsgs[5] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_HttpProtocolOptions__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(28, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_submsgs[2] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_submsgs[3] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions__fields[7] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {7, UPB_SIZE(20, 40), 3, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 56), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[1] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_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},
+static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = {
+const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_KeepaliveSettings_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_KeepaliveSettings_submsgs[4] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_KeepaliveSettings__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_KeepaliveSettings__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit = {
+const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msginit = {
&envoy_config_core_v3_KeepaliveSettings_submsgs[0],
&envoy_config_core_v3_KeepaliveSettings__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_submsgs[4] = {
- &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(8, 8), 1, 3, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 3, 11, 1},
- {4, UPB_SIZE(20, 32), 4, 3, 11, 1},
- {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {7, UPB_SIZE(24, 40), 5, 3, 11, 1},
- {8, UPB_SIZE(28, 48), 6, 3, 11, 1},
- {9, UPB_SIZE(32, 56), 7, 3, 11, 1},
- {10, UPB_SIZE(36, 64), 8, 3, 11, 1},
- {11, UPB_SIZE(40, 72), 9, 3, 11, 1},
- {12, UPB_SIZE(4, 4), 0, 0, 8, 1},
- {13, UPB_SIZE(52, 96), 0, 0, 11, 3},
- {14, UPB_SIZE(44, 80), 10, 2, 11, 1},
- {15, UPB_SIZE(48, 88), 11, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit = {
+static const upb_MiniTable_Sub envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_KeepaliveSettings_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_Http2ProtocolOptions__fields[15] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(32, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(36, 64), UPB_SIZE(8, 8), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(40, 72), UPB_SIZE(9, 9), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 9, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(48, 88), UPB_SIZE(10, 10), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(52, 96), UPB_SIZE(11, 11), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit = {
&envoy_config_core_v3_Http2ProtocolOptions_submsgs[0],
&envoy_config_core_v3_Http2ProtocolOptions__fields[0],
- UPB_SIZE(56, 104), 15, false, 255,
+ UPB_SIZE(56, 104), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit = {
+const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msginit = {
&envoy_config_core_v3_GrpcProtocolOptions_submsgs[0],
&envoy_config_core_v3_GrpcProtocolOptions__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_Http3ProtocolOptions_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_Http3ProtocolOptions__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit = {
+ &envoy_config_core_v3_Http3ProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_Http3ProtocolOptions__fields[0],
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_SchemeHeaderTransformation__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit = {
+ NULL,
+ &envoy_config_core_v3_SchemeHeaderTransformation__fields[0],
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[16] = {
+ &envoy_config_core_v3_TcpProtocolOptions_msginit,
+ &envoy_config_core_v3_QuicKeepAliveSettings_msginit,
+ &envoy_config_core_v3_QuicProtocolOptions_msginit,
+ &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit,
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit,
+ &envoy_config_core_v3_HttpProtocolOptions_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
+ &envoy_config_core_v3_KeepaliveSettings_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
+ &envoy_config_core_v3_GrpcProtocolOptions_msginit,
+ &envoy_config_core_v3_Http3ProtocolOptions_msginit,
+ &envoy_config_core_v3_SchemeHeaderTransformation_msginit,
};
-const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit = {
+const upb_MiniTable_File envoy_config_core_v3_protocol_proto_upb_file_layout = {
+ messages_layout,
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 16,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
index 8bfcae6c..09e6ebd7 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -21,7 +21,11 @@ extern "C" {
#endif
struct envoy_config_core_v3_TcpProtocolOptions;
+struct envoy_config_core_v3_QuicKeepAliveSettings;
+struct envoy_config_core_v3_QuicProtocolOptions;
struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
+struct envoy_config_core_v3_AlternateProtocolsCacheOptions;
+struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry;
struct envoy_config_core_v3_HttpProtocolOptions;
struct envoy_config_core_v3_Http1ProtocolOptions;
struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
@@ -31,8 +35,13 @@ struct envoy_config_core_v3_Http2ProtocolOptions;
struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
struct envoy_config_core_v3_GrpcProtocolOptions;
struct envoy_config_core_v3_Http3ProtocolOptions;
+struct envoy_config_core_v3_SchemeHeaderTransformation;
typedef struct envoy_config_core_v3_TcpProtocolOptions envoy_config_core_v3_TcpProtocolOptions;
+typedef struct envoy_config_core_v3_QuicKeepAliveSettings envoy_config_core_v3_QuicKeepAliveSettings;
+typedef struct envoy_config_core_v3_QuicProtocolOptions envoy_config_core_v3_QuicProtocolOptions;
typedef struct envoy_config_core_v3_UpstreamHttpProtocolOptions envoy_config_core_v3_UpstreamHttpProtocolOptions;
+typedef struct envoy_config_core_v3_AlternateProtocolsCacheOptions envoy_config_core_v3_AlternateProtocolsCacheOptions;
+typedef struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry;
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;
@@ -42,25 +51,33 @@ typedef struct envoy_config_core_v3_Http2ProtocolOptions envoy_config_core_v3_Ht
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;
typedef struct envoy_config_core_v3_Http3ProtocolOptions envoy_config_core_v3_Http3ProtocolOptions;
-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;
-extern const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit;
+typedef struct envoy_config_core_v3_SchemeHeaderTransformation envoy_config_core_v3_SchemeHeaderTransformation;
+extern const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_QuicKeepAliveSettings_msginit;
+extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit;
+extern const upb_MiniTable envoy_config_core_v3_KeepaliveSettings_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit;
+struct envoy_config_core_v3_TypedExtensionConfig;
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;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_config_core_v3_HttpProtocolOptions_ALLOW = 0,
@@ -69,50 +86,309 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_TcpProtocolOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_TcpProtocolOptions* ret = envoy_config_core_v3_TcpProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_TcpProtocolOptions_serialize_ex(const envoy_config_core_v3_TcpProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, options, arena, len);
+}
+
+
+/* envoy.config.core.v3.QuicKeepAliveSettings */
+
+UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicKeepAliveSettings_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicKeepAliveSettings_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_QuicKeepAliveSettings* ret = envoy_config_core_v3_QuicKeepAliveSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicKeepAliveSettings_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_QuicKeepAliveSettings* ret = envoy_config_core_v3_QuicKeepAliveSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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_QuicKeepAliveSettings_serialize(const envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_QuicKeepAliveSettings_serialize_ex(const envoy_config_core_v3_QuicKeepAliveSettings* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, options, arena, len);
}
-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);
+UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_clear_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_initial_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*);
}
+UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_set_max_interval(envoy_config_core_v3_QuicKeepAliveSettings *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_mutable_max_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_QuicKeepAliveSettings_max_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicKeepAliveSettings_set_max_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicKeepAliveSettings_set_initial_interval(envoy_config_core_v3_QuicKeepAliveSettings *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_QuicKeepAliveSettings_mutable_initial_interval(envoy_config_core_v3_QuicKeepAliveSettings* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_QuicKeepAliveSettings_initial_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicKeepAliveSettings_set_initial_interval(msg, sub);
+ }
+ return sub;
+}
+/* envoy.config.core.v3.QuicProtocolOptions */
-/* envoy.config.core.v3.UpstreamHttpProtocolOptions */
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicProtocolOptions_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_QuicProtocolOptions* ret = envoy_config_core_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_QuicProtocolOptions* ret = envoy_config_core_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_QuicProtocolOptions_serialize(const envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_QuicProtocolOptions_serialize_ex(const envoy_config_core_v3_QuicProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_num_timeouts_to_trigger_port_migration(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_clear_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicProtocolOptions_connection_keepalive(const envoy_config_core_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_core_v3_QuicKeepAliveSettings*);
+}
-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 void envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
}
-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 struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(msg, sub);
+ }
+ return sub;
}
-UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
}
-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 struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_num_timeouts_to_trigger_port_migration(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_num_timeouts_to_trigger_port_migration(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_num_timeouts_to_trigger_port_migration(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_num_timeouts_to_trigger_port_migration(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_connection_keepalive(envoy_config_core_v3_QuicProtocolOptions *msg, envoy_config_core_v3_QuicKeepAliveSettings* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_core_v3_QuicKeepAliveSettings*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_QuicProtocolOptions_mutable_connection_keepalive(envoy_config_core_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_QuicKeepAliveSettings* sub = (struct envoy_config_core_v3_QuicKeepAliveSettings*)envoy_config_core_v3_QuicProtocolOptions_connection_keepalive(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_QuicKeepAliveSettings*)_upb_Message_New(&envoy_config_core_v3_QuicKeepAliveSettings_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_connection_keepalive(msg, sub);
+ }
+ return sub;
}
-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); }
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v3_UpstreamHttpProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_UpstreamHttpProtocolOptions* ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize_ex(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_auto_sni(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 void envoy_config_core_v3_UpstreamHttpProtocolOptions_clear_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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_clear_override_auto_sni_header(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_UpstreamHttpProtocolOptions_override_auto_sni_header(const envoy_config_core_v3_UpstreamHttpProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
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;
@@ -120,45 +396,259 @@ UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(en
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;
}
+UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_override_auto_sni_header(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
-/* envoy.config.core.v3.HttpProtocolOptions */
+/* envoy.config.core.v3.AlternateProtocolsCacheOptions */
-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_AlternateProtocolsCacheOptions* envoy_config_core_v3_AlternateProtocolsCacheOptions_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_AlternateProtocolsCacheOptions*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_core_v3_AlternateProtocolsCacheOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_core_v3_AlternateProtocolsCacheOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_serialize(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_serialize_ex(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_name(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_AlternateProtocolsCacheOptions_name(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return _upb_hasbit(msg, 1);
}
-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 void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
}
-UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*);
}
-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_AlternateProtocolsCacheOptions_has_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_clear_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const* envoy_config_core_v3_AlternateProtocolsCacheOptions_prepopulated_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) {
+ return (const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
}
-UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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(4, 4), int32_t); }
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_name(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t* len) {
+ return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry** envoy_config_core_v3_AlternateProtocolsCacheOptions_resize_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_add_prepopulated_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* sub = (struct envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.core.v3.AlternateProtocolsCacheOptions.AlternateProtocolsCacheEntry */
+
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry*)_upb_Message_New(&envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_serialize(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_serialize_ex(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_clear_hostname(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_hostname(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_clear_port(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_port(const envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t);
+}
+
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_set_hostname(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_set_port(envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_HttpProtocolOptions* ret = envoy_config_core_v3_HttpProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_HttpProtocolOptions_serialize_ex(const envoy_config_core_v3_HttpProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_headers_count(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_connection_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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 void envoy_config_core_v3_HttpProtocolOptions_clear_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_clear_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*);
+}
UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(msg, sub);
}
@@ -168,10 +658,10 @@ UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(e
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HttpProtocolOptions_set_max_headers_count(msg, sub);
}
@@ -181,10 +671,10 @@ UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_connection_dura
_upb_sethas(msg, 3);
*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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HttpProtocolOptions_set_max_connection_duration(msg, sub);
}
@@ -194,10 +684,10 @@ UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration
_upb_sethas(msg, 4);
*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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_HttpProtocolOptions_set_max_stream_duration(msg, sub);
}
@@ -206,46 +696,111 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOpt
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(4, 4), int32_t) = value;
}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(msg, sub);
+ }
+ return sub;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1ProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http1ProtocolOptions* ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_serialize_ex(const envoy_config_core_v3_Http1ProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_accept_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_Http1ProtocolOptions_default_host_for_http_10(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_header_key_format(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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 void envoy_config_core_v3_Http1ProtocolOptions_clear_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_enable_trailers(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_allow_chunked_length(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+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(3, 3), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http1ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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 bool envoy_config_core_v3_Http1ProtocolOptions_has_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
-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(1, 1), 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_hasbit(msg, 2); }
-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(2, 2), 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(3, 3), 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_hasbit(msg, 3); }
-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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_Http1ProtocolOptions_mutable_allow_absolute_url(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http1ProtocolOptions_set_allow_absolute_url(msg, sub);
}
@@ -254,17 +809,17 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolO
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(1, 1), 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_default_host_for_http_10(envoy_config_core_v3_Http1ProtocolOptions *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_sethas(msg, 2);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_New(&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http1ProtocolOptions_set_header_key_format(msg, sub);
}
@@ -280,10 +835,10 @@ UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_set_override_stream_er
_upb_sethas(msg, 3);
*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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -292,103 +847,196 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http1ProtocolO
/* 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 envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_serialize_ex(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_proper_case_words = 1,
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_stateful_formatter = 8,
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_clear_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, 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_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*)_upb_Message_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;
}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(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 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_serialize_ex(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_KeepaliveSettings*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_KeepaliveSettings_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_KeepaliveSettings* ret = envoy_config_core_v3_KeepaliveSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_KeepaliveSettings_serialize_ex(const envoy_config_core_v3_KeepaliveSettings* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_timeout(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_interval_jitter(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_type_v3_Percent*);
+}
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_clear_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_sethas(msg, 1);
*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_interval(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_KeepaliveSettings_set_interval(msg, sub);
}
@@ -398,10 +1046,10 @@ UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_timeout(envoy_config_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_KeepaliveSettings_set_timeout(msg, sub);
}
@@ -411,72 +1059,195 @@ UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(envoy
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_KeepaliveSettings_set_interval_jitter(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(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 envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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(8, 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_hasbit(msg, 2); }
-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(12, 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_hasbit(msg, 3); }
-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(16, 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_hasbit(msg, 4); }
-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(20, 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(2, 2), 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(3, 3), bool); }
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions *msg) { return _upb_hasbit(msg, 5); }
-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(24, 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_hasbit(msg, 6); }
-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(28, 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_hasbit(msg, 7); }
-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(32, 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_hasbit(msg, 8); }
-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(36, 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_hasbit(msg, 9); }
-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(40, 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(4, 4), 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(52, 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(52, 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_hasbit(msg, 10); }
-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(44, 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_hasbit(msg, 11); }
-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(48, 88), const envoy_config_core_v3_KeepaliveSettings*); }
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2ProtocolOptions_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2ProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http2ProtocolOptions* ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_Http2ProtocolOptions_serialize_ex(const envoy_config_core_v3_Http2ProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_concurrent_streams(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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(12, 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_stream_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_initial_connection_window_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_connect(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_allow_metadata(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
+}
+UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_outbound_control_frames(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_consecutive_inbound_frames_with_empty_payload(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(32, 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_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_priority_frames_per_stream(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+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(36, 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_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_max_inbound_window_update_frames_per_data_frame_sent(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+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(40, 72), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_stream_error_on_invalid_http_messaging(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+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(4, 4), 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(44, 80));
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_custom_settings_parameters(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(44, 80));
+}
+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(44, 80), 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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL;
+}
+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(48, 88), 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_clear_connection_keepalive(const envoy_config_core_v3_Http2ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL;
+}
+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(52, 96), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_hpack_table_size(msg, sub);
}
@@ -486,10 +1257,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_str
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(12, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_max_concurrent_streams(msg, sub);
}
@@ -499,10 +1270,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_win
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(16, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_initial_stream_window_size(msg, sub);
}
@@ -512,10 +1283,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(20, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_initial_connection_window_size(msg, sub);
}
@@ -531,10 +1302,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frame
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(24, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_frames(msg, sub);
}
@@ -544,10 +1315,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_contr
_upb_sethas(msg, 6);
*UPB_PTR_AT(msg, UPB_SIZE(28, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub);
}
@@ -557,10 +1328,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_consecutive_in
_upb_sethas(msg, 7);
*UPB_PTR_AT(msg, UPB_SIZE(32, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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);
}
@@ -570,10 +1341,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priori
_upb_sethas(msg, 8);
*UPB_PTR_AT(msg, UPB_SIZE(36, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub);
}
@@ -583,10 +1354,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_max_inbound_window
_upb_sethas(msg, 9);
*UPB_PTR_AT(msg, UPB_SIZE(40, 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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);
}
@@ -595,27 +1366,26 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2Protoco
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(4, 4), 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(52, 96), len);
+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(44, 80), 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_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &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_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -623,12 +1393,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http2ProtocolO
}
UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(envoy_config_core_v3_Http2ProtocolOptions *msg, envoy_config_core_v3_KeepaliveSettings* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 88), envoy_config_core_v3_KeepaliveSettings*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), 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) {
+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);
+ sub = (struct envoy_config_core_v3_KeepaliveSettings*)_upb_Message_New(&envoy_config_core_v3_KeepaliveSettings_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_set_connection_keepalive(msg, sub);
}
@@ -637,37 +1407,62 @@ UPB_INLINE struct envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_H
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_serialize_ex(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_clear_value(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_UInt32Value*);
}
-
-UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_identifier(envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_identifier(msg, sub);
}
@@ -677,10 +1472,10 @@ UPB_INLINE void envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_set_value(msg, sub);
}
@@ -689,35 +1484,53 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_Http2Protoco
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_GrpcProtocolOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_GrpcProtocolOptions* ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_GrpcProtocolOptions_serialize_ex(const envoy_config_core_v3_GrpcProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_GrpcProtocolOptions_clear_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_config_core_v3_Http2ProtocolOptions*);
}
-
-UPB_INLINE bool envoy_config_core_v3_GrpcProtocolOptions_has_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http2ProtocolOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_GrpcProtocolOptions_set_http2_protocol_options(msg, sub);
}
@@ -726,25 +1539,143 @@ UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v
/* envoy.config.core.v3.Http3ProtocolOptions */
-UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3ProtocolOptions_new(upb_arena *arena) {
- return (envoy_config_core_v3_Http3ProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena);
+UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_Http3ProtocolOptions* ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_Http3ProtocolOptions* ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_Http3ProtocolOptions_serialize(const envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_Http3ProtocolOptions_serialize_ex(const envoy_config_core_v3_Http3ProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_QuicProtocolOptions*);
+}
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_clear_allow_extended_connect(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_allow_extended_connect(const envoy_config_core_v3_Http3ProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions *msg, envoy_config_core_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_QuicProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_mutable_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_allow_extended_connect(envoy_config_core_v3_Http3ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.core.v3.SchemeHeaderTransformation */
+
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3_SchemeHeaderTransformation_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3_SchemeHeaderTransformation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_SchemeHeaderTransformation* ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3_SchemeHeaderTransformation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_SchemeHeaderTransformation* ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3ProtocolOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_core_v3_Http3ProtocolOptions *ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_SchemeHeaderTransformation_serialize(const envoy_config_core_v3_SchemeHeaderTransformation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_core_v3_Http3ProtocolOptions *ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_core_v3_SchemeHeaderTransformation_serialize_ex(const envoy_config_core_v3_SchemeHeaderTransformation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_config_core_v3_Http3ProtocolOptions_serialize(const envoy_config_core_v3_Http3ProtocolOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena, len);
+typedef enum {
+ envoy_config_core_v3_SchemeHeaderTransformation_transformation_scheme_to_overwrite = 1,
+ envoy_config_core_v3_SchemeHeaderTransformation_transformation_NOT_SET = 0
+} envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases;
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases envoy_config_core_v3_SchemeHeaderTransformation_transformation_case(const envoy_config_core_v3_SchemeHeaderTransformation* msg) {
+ return (envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_core_v3_SchemeHeaderTransformation_has_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_clear_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_SchemeHeaderTransformation_transformation_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SchemeHeaderTransformation_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
}
+UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_set_scheme_to_overwrite(envoy_config_core_v3_SchemeHeaderTransformation *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+extern const upb_MiniTable_File envoy_config_core_v3_protocol_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
index 4c56e07b..38eddac6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
@@ -7,20 +7,33 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/proxy_protocol.upb.h"
#include "udpa/annotations/status.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},
+static const upb_MiniTable_Field envoy_config_core_v3_ProxyProtocolConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit = {
+const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit = {
NULL,
&envoy_config_core_v3_ProxyProtocolConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_ProxyProtocolConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_proxy_protocol_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
index bd56a644..f76bb45b 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,7 +22,7 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit;
typedef enum {
envoy_config_core_v3_ProxyProtocolConfig_V1 = 0,
@@ -30,32 +30,51 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyProtocolConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_ProxyProtocolConfig* ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_ProxyProtocolConfig_serialize_ex(const envoy_config_core_v3_ProxyProtocolConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_clear_version(const envoy_config_core_v3_ProxyProtocolConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 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;
}
+extern const upb_MiniTable_File envoy_config_core_v3_proxy_protocol_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c
new file mode 100644
index 00000000..06be5724
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c
@@ -0,0 +1,60 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/core/v3/resolver.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field envoy_config_core_v3_DnsResolverOptions__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msginit = {
+ NULL,
+ &envoy_config_core_v3_DnsResolverOptions__fields[0],
+ UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_core_v3_DnsResolutionConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolverOptions_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_DnsResolutionConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit = {
+ &envoy_config_core_v3_DnsResolutionConfig_submsgs[0],
+ &envoy_config_core_v3_DnsResolutionConfig__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_core_v3_DnsResolverOptions_msginit,
+ &envoy_config_core_v3_DnsResolutionConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_resolver_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h
new file mode 100644
index 00000000..4b486d3c
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h
@@ -0,0 +1,169 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_DnsResolverOptions;
+struct envoy_config_core_v3_DnsResolutionConfig;
+typedef struct envoy_config_core_v3_DnsResolverOptions envoy_config_core_v3_DnsResolverOptions;
+typedef struct envoy_config_core_v3_DnsResolutionConfig envoy_config_core_v3_DnsResolutionConfig;
+extern const upb_MiniTable envoy_config_core_v3_DnsResolverOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DnsResolutionConfig_msginit;
+struct envoy_config_core_v3_Address;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+
+
+
+/* envoy.config.core.v3.DnsResolverOptions */
+
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolverOptions_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolverOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_DnsResolverOptions* ret = envoy_config_core_v3_DnsResolverOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolverOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_DnsResolverOptions* ret = envoy_config_core_v3_DnsResolverOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_DnsResolverOptions_serialize(const envoy_config_core_v3_DnsResolverOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_DnsResolverOptions_serialize_ex(const envoy_config_core_v3_DnsResolverOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_clear_use_tcp_for_dns_lookups(const envoy_config_core_v3_DnsResolverOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_use_tcp_for_dns_lookups(const envoy_config_core_v3_DnsResolverOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_clear_no_default_search_domain(const envoy_config_core_v3_DnsResolverOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_no_default_search_domain(const envoy_config_core_v3_DnsResolverOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_use_tcp_for_dns_lookups(envoy_config_core_v3_DnsResolverOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_no_default_search_domain(envoy_config_core_v3_DnsResolverOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.core.v3.DnsResolutionConfig */
+
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsResolutionConfig_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_DnsResolutionConfig*)_upb_Message_New(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsResolutionConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_DnsResolutionConfig* ret = envoy_config_core_v3_DnsResolutionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsResolutionConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_DnsResolutionConfig* ret = envoy_config_core_v3_DnsResolutionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_DnsResolutionConfig_serialize(const envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_DnsResolutionConfig_serialize_ex(const envoy_config_core_v3_DnsResolutionConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_DnsResolutionConfig_resolvers(const envoy_config_core_v3_DnsResolutionConfig* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_clear_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_core_v3_DnsResolverOptions*);
+}
+
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_mutable_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t* len) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_resize_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_Address**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_DnsResolutionConfig_add_resolvers(envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig *msg, envoy_config_core_v3_DnsResolverOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_core_v3_DnsResolverOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_mutable_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DnsResolverOptions* sub = (struct envoy_config_core_v3_DnsResolverOptions*)envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolverOptions*)_upb_Message_New(&envoy_config_core_v3_DnsResolverOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_core_v3_resolver_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
index d4c2ea14..9a753214 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,19 +15,32 @@
#include "upb/port_def.inc"
-static const upb_msglayout_field envoy_config_core_v3_SocketOption__fields[6] = {
- {1, UPB_SIZE(20, 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},
+static const upb_MiniTable_Field envoy_config_core_v3_SocketOption__fields[6] = {
+ {1, UPB_SIZE(8, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_SocketOption_msginit = {
+const upb_MiniTable envoy_config_core_v3_SocketOption_msginit = {
NULL,
&envoy_config_core_v3_SocketOption__fields[0],
- UPB_SIZE(48, 64), 6, false, 255,
+ UPB_SIZE(40, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_SocketOption_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_socket_option_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
index 03474430..2bfceeb4 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,7 +22,7 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit;
typedef enum {
envoy_config_core_v3_SocketOption_STATE_PREBIND = 0,
@@ -31,61 +31,110 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_SocketOption*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_SocketOption* ret = envoy_config_core_v3_SocketOption_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_SocketOption_serialize_ex(const envoy_config_core_v3_SocketOption* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SocketOption_msginit, options, 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(20, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_description(const envoy_config_core_v3_SocketOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SocketOption_description(const envoy_config_core_v3_SocketOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_level(const envoy_config_core_v3_SocketOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t) = 0;
+}
+UPB_INLINE int64_t envoy_config_core_v3_SocketOption_level(const envoy_config_core_v3_SocketOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), int64_t);
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_name(const envoy_config_core_v3_SocketOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), int64_t) = 0;
+}
+UPB_INLINE int64_t envoy_config_core_v3_SocketOption_name(const envoy_config_core_v3_SocketOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_int_value(const envoy_config_core_v3_SocketOption* msg) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(16, 8), 0, UPB_SIZE(0, 0), envoy_config_core_v3_SocketOption_value_NOT_SET);
+}
+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(16, 8), UPB_SIZE(0, 0), 4, _upb_Int64_FromLL(0ll));
+}
+UPB_INLINE bool envoy_config_core_v3_SocketOption_has_buf_value(const envoy_config_core_v3_SocketOption* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_buf_value(const envoy_config_core_v3_SocketOption* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_core_v3_SocketOption_value_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SocketOption_buf_value(const envoy_config_core_v3_SocketOption* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), UPB_SIZE(0, 0), 5, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_core_v3_SocketOption_clear_state(const envoy_config_core_v3_SocketOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_core_v3_SocketOption_state(const envoy_config_core_v3_SocketOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(20, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_core_v3_SocketOption_set_description(envoy_config_core_v3_SocketOption *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 24), upb_StringView) = 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_PTR_AT(msg, UPB_SIZE(24, 40), 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_PTR_AT(msg, UPB_SIZE(32, 48), 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_WRITE_ONEOF(msg, int64_t, UPB_SIZE(16, 8), value, UPB_SIZE(0, 0), 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_buf_value(envoy_config_core_v3_SocketOption *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(16, 8), value, UPB_SIZE(0, 0), 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+extern const upb_MiniTable_File envoy_config_core_v3_socket_option_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
index 71781640..2c9504a5 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
@@ -7,35 +7,49 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/substitution_format_string.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
#include "google/protobuf/struct.upb.h"
+#include "envoy/annotations/deprecation.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[3] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub envoy_config_core_v3_SubstitutionFormatString_submsgs[3] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_SubstitutionFormatString__fields[6] = {
- {1, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 2, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {5, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 11, 1},
- {6, UPB_SIZE(12, 24), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_config_core_v3_SubstitutionFormatString__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit = {
+const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit = {
&envoy_config_core_v3_SubstitutionFormatString_submsgs[0],
&envoy_config_core_v3_SubstitutionFormatString__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(28, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_SubstitutionFormatString_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_substitution_format_string_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
index 3f450e9a..1b16e8fe 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,64 +22,115 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit;
struct envoy_config_core_v3_DataSource;
struct envoy_config_core_v3_TypedExtensionConfig;
struct google_protobuf_Struct;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout google_protobuf_Struct_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_SubstitutionFormatString_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_SubstitutionFormatString* ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_core_v3_SubstitutionFormatString_serialize_ex(const envoy_config_core_v3_SubstitutionFormatString* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, options, 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_text_format_source = 5,
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(24, 48), 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(24, 48)) == 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(16, 32), UPB_SIZE(24, 48), 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(24, 48)) == 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(16, 32), UPB_SIZE(24, 48), 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 bool envoy_config_core_v3_SubstitutionFormatString_has_text_format_source(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 48)) == 5; }
-UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_text_format_source(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_DataSource*, UPB_SIZE(16, 32), UPB_SIZE(24, 48), 5, NULL); }
-UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_formatters(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_SubstitutionFormatString_formatters(const envoy_config_core_v3_SubstitutionFormatString *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SubstitutionFormatString_text_format(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_json_format(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 void envoy_config_core_v3_SubstitutionFormatString_clear_content_type(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_core_v3_SubstitutionFormatString_content_type(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_text_format_source(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 40));
+}
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_clear_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_SubstitutionFormatString_formatters(const envoy_config_core_v3_SubstitutionFormatString* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len);
+}
-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(16, 32), value, UPB_SIZE(24, 48), 1);
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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(16, 32), value, UPB_SIZE(24, 48), 2);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
}
-UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_mutable_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub);
}
@@ -88,35 +139,36 @@ UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionForma
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;
+UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_content_type(envoy_config_core_v3_SubstitutionFormatString *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(envoy_config_core_v3_SubstitutionFormatString *msg, struct envoy_config_core_v3_DataSource* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(16, 32), value, UPB_SIZE(24, 48), 5);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5);
}
-UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_mutable_text_format_source(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_mutable_text_format_source(envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena) {
struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_SubstitutionFormatString_text_format_source(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(msg, sub);
}
return sub;
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_mutable_formatters(envoy_config_core_v3_SubstitutionFormatString *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_core_v3_SubstitutionFormatString_mutable_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t* len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len);
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_resize_formatters(envoy_config_core_v3_SubstitutionFormatString *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_resize_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_SubstitutionFormatString_add_formatters(envoy_config_core_v3_SubstitutionFormatString *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_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_SubstitutionFormatString_add_formatters(envoy_config_core_v3_SubstitutionFormatString* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File envoy_config_core_v3_substitution_format_string_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c
new file mode 100644
index 00000000..440948b6
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c
@@ -0,0 +1,48 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_config_core_v3_UdpSocketConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt64Value_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_core_v3_UdpSocketConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit = {
+ &envoy_config_core_v3_UdpSocketConfig_submsgs[0],
+ &envoy_config_core_v3_UdpSocketConfig__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_core_v3_UdpSocketConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_core_v3_udp_socket_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h
new file mode 100644
index 00000000..66b2b602
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h
@@ -0,0 +1,118 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_UdpSocketConfig;
+typedef struct envoy_config_core_v3_UdpSocketConfig envoy_config_core_v3_UdpSocketConfig;
+extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit;
+struct google_protobuf_BoolValue;
+struct google_protobuf_UInt64Value;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_UInt64Value_msginit;
+
+
+
+/* envoy.config.core.v3.UdpSocketConfig */
+
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_new(upb_Arena* arena) {
+ return (envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_core_v3_UdpSocketConfig* ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_core_v3_UdpSocketConfig_serialize(const envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_core_v3_UdpSocketConfig_serialize_ex(const envoy_config_core_v3_UdpSocketConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt64Value*);
+}
+UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_clear_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_prefer_gro(const envoy_config_core_v3_UdpSocketConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*);
+}
+
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_UInt64Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_mutable_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_mutable_prefer_gro(envoy_config_core_v3_UdpSocketConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_UdpSocketConfig_prefer_gro(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_core_v3_udp_socket_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
index 3f9c789b..b57f5fc7 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -19,71 +19,87 @@
#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_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 2, 11, 3},
- {4, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = {
- {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit = {
+const upb_MiniTable 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(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
- &envoy_config_endpoint_v3_Endpoint_msginit,
+static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
+};
+
+const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
index c89e4a45..cc81a556 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -28,134 +28,212 @@ typedef struct envoy_config_endpoint_v3_ClusterLoadAssignment envoy_config_endpo
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;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint_v3_ClusterLoadAssignment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_endpoint_v3_ClusterLoadAssignment_serialize_ex(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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 void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) {
+ _upb_array_detach(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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), 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(20, 40));
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_clear_named_endpoints(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40));
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_get(const envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key, struct envoy_config_endpoint_v3_Endpoint** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &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(20, 40), iter);
}
-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(4, 8), 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(16, 32)); }
-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(16, 32), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_has_policy(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(20, 40)); }
-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(20, 40)); }
-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(20, 40), &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(20, 40), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(16, 32), len);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_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(20, 40)); }
-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(20, 40), &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(20, 40), &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(20, 40), iter); }
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_clear(envoy_config_endpoint_v3_ClusterLoadAssignment* msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_set(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key, struct envoy_config_endpoint_v3_Endpoint* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_named_endpoints_delete(envoy_config_endpoint_v3_ClusterLoadAssignment* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &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(20, 40), 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_serialize_ex(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, options, 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(4, 8));
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_drop_overloads(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_clear_endpoint_stale_after(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Duration*);
}
-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(12, 24)); }
-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(12, 24), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_has_overprovisioning_factor(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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(12, 24), len);
+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(4, 8), 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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_ClusterLoadAssignment_Policy_mutable_overprovisioning_factor(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_overprovisioning_factor(msg, sub);
}
@@ -163,12 +241,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_ClusterL
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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_endpoint_v3_ClusterLoadAssignment_Policy_mutable_endpoint_stale_after(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_set_endpoint_stale_after(msg, sub);
}
@@ -177,39 +255,62 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_endpoint_v3_ClusterLoad
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_serialize_ex(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_clear_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_has_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_clear_drop_percentage(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_type_v3_FractionalPercent*);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_category(envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_set_drop_percentage(msg, sub);
}
@@ -218,13 +319,15 @@ UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_config_endpoint_v3_Clus
/* 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_INLINE upb_StringView envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_key(const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -234,6 +337,8 @@ UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEnt
_upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_endpoint_v3_Endpoint*));
}
+extern const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
index f12e49bd..baaf31e8 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
@@ -7,10 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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/config_source.upb.h"
#include "envoy/config/core/v3/health_check.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -19,72 +20,124 @@
#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_MiniTable_Sub envoy_config_endpoint_v3_Endpoint_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit = {
&envoy_config_endpoint_v3_Endpoint_submsgs[0],
&envoy_config_endpoint_v3_Endpoint__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = {
NULL,
&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_Endpoint_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &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(4, 4), 0, 0, 14, 1},
- {3, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {4, UPB_SIZE(12, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_LbEndpoint__fields[5] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-9, -9), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(-9, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[3] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_endpoint_v3_LbEndpoint_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit = {
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[0],
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(20, 32), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {6, UPB_SIZE(16, 24), 3, 2, 11, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[7] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 48), UPB_SIZE(-9, -9), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 48), UPB_SIZE(-9, -9), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = {
&envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[0],
&envoy_config_endpoint_v3_LocalityLbEndpoints__fields[0],
- UPB_SIZE(24, 40), 5, false, 255,
+ UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[1] = {
+ {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit = {
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[0],
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[6] = {
+ &envoy_config_endpoint_v3_Endpoint_msginit,
+ &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
+ &envoy_config_endpoint_v3_LbEndpoint_msginit,
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit,
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit,
+};
+
+const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 6,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
index b6ad981c..b6122230 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,59 +23,98 @@ extern "C" {
struct envoy_config_endpoint_v3_Endpoint;
struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
struct envoy_config_endpoint_v3_LbEndpoint;
+struct envoy_config_endpoint_v3_LedsClusterLocalityConfig;
struct envoy_config_endpoint_v3_LocalityLbEndpoints;
+struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList;
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_LedsClusterLocalityConfig envoy_config_endpoint_v3_LedsClusterLocalityConfig;
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;
+typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList;
+extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_LbEndpoint_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit;
struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_ConfigSource;
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;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Locality_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_Endpoint*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_Endpoint* ret = envoy_config_endpoint_v3_Endpoint_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_Endpoint_serialize_ex(const envoy_config_endpoint_v3_Endpoint* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_address(const envoy_config_endpoint_v3_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_health_check_config(const envoy_config_endpoint_v3_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_clear_hostname(const envoy_config_endpoint_v3_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_Endpoint_hostname(const envoy_config_endpoint_v3_Endpoint* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
}
-
-UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_address(const envoy_config_endpoint_v3_Endpoint *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_Address*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_Endpoint_set_address(msg, sub);
}
@@ -83,95 +122,161 @@ UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_endpoint_v3_Endpoin
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_set_hostname(envoy_config_endpoint_v3_Endpoint *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_Endpoint_HealthCheckConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_serialize_ex(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, options, arena, len);
}
-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 void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_port_value(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_clear_hostname(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-
-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;
+UPB_INLINE void envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_set_hostname(envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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 envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpoint_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpoint_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LbEndpoint* ret = envoy_config_endpoint_v3_LbEndpoint_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_endpoint_v3_LbEndpoint_serialize_ex(const envoy_config_endpoint_v3_LbEndpoint* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, options, 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(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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 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(8, 8), 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(8, 8)) == 1;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(12, 16), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET);
+}
+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(12, 16), UPB_SIZE(8, 8), 1, NULL);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_health_status(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LbEndpoint_has_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_metadata(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_load_balancing_weight(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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(8, 8)) == 5;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_clear_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(8, 8), envoy_config_endpoint_v3_LbEndpoint_host_identifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_LbEndpoint_endpoint_name(const envoy_config_endpoint_v3_LbEndpoint* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), UPB_SIZE(8, 8), 5, upb_StringView_FromString(""));
+}
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_WRITE_ONEOF(msg, envoy_config_endpoint_v3_Endpoint*, UPB_SIZE(12, 16), value, UPB_SIZE(8, 8), 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) {
+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);
+ sub = (struct envoy_config_endpoint_v3_Endpoint*)_upb_Message_New(&envoy_config_endpoint_v3_Endpoint_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_LbEndpoint_set_endpoint(msg, sub);
}
@@ -182,12 +287,12 @@ UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_health_status(envoy_conf
}
UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_metadata(envoy_config_endpoint_v3_LbEndpoint *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_LbEndpoint_set_metadata(msg, sub);
}
@@ -195,85 +300,218 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_endpoint_v3_LbEndp
}
UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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_endpoint_v3_LbEndpoint_mutable_load_balancing_weight(envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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);
+UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint_name(envoy_config_endpoint_v3_LbEndpoint *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(12, 16), value, UPB_SIZE(8, 8), 5);
}
-/* envoy.config.endpoint.v3.LocalityLbEndpoints */
+/* envoy.config.endpoint.v3.LedsClusterLocalityConfig */
-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_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LedsClusterLocalityConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig* ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LedsClusterLocalityConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig* ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_endpoint_v3_LedsClusterLocalityConfig_serialize(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_endpoint_v3_LedsClusterLocalityConfig_serialize_ex(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, options, arena, len);
}
-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 bool envoy_config_endpoint_v3_LedsClusterLocalityConfig_has_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) {
+ return _upb_hasbit(msg, 1);
}
-UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = 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 const struct envoy_config_core_v3_ConfigSource* envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_clear_leds_collection_name(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_collection_name(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ _upb_sethas(msg, 1);
+ *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_endpoint_v3_LedsClusterLocalityConfig_mutable_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_collection_name(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_hasbit(msg, 1); }
-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(8, 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(20, 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(20, 32), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_hasbit(msg, 2); }
-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(12, 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(4, 4), uint32_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_hasbit(msg, 3); }
-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(16, 24), const struct google_protobuf_UInt32Value*); }
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v3_LocalityLbEndpoints_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_endpoint_v3_LocalityLbEndpoints_serialize_ex(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_load_balancer_endpoints = 7,
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_leds_cluster_locality_config = 8,
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET = 0
+} envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases;
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_case(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return (envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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(12, 16), 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, 24));
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+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, 24), len);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancing_weight(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 7;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET);
+}
+UPB_INLINE const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), UPB_SIZE(8, 8), 7, NULL);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(8, 8)) == 8;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_clear_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(8, 8), envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET);
+}
+UPB_INLINE const envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), UPB_SIZE(8, 8), 8, NULL);
+}
UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct envoy_config_core_v3_Locality* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_config_core_v3_Locality*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Locality*)_upb_Message_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(20, 32), len);
+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, 24), 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_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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_endpoint_v3_LocalityLbEndpoints_mutable_load_balancing_weight(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancing_weight(msg, sub);
}
@@ -284,17 +522,97 @@ UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_priority(envoy_
}
UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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_endpoint_v3_LocalityLbEndpoints_mutable_proximity(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_endpoint_v3_LocalityLbEndpoints_set_proximity(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(28, 48), value, UPB_SIZE(8, 8), 7);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) {
+ struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(8, 8), 8);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints* msg, upb_Arena* arena) {
+ struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_Message_New(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList */
+
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_Message_New(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_serialize_ex(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_clear_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* len) {
+ return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t* len) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* msg, upb_Arena* arena) {
+ struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_Message_New(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
index 560826ed..927b2bf3 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -19,93 +19,110 @@
#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_MiniTable_Sub envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit},
+ {.submsg = &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = {
- {1, UPB_SIZE(44, 48), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 4, 1},
- {5, UPB_SIZE(48, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(40, 40), 0, 0, 13, 1},
- {7, UPB_SIZE(52, 64), 0, 2, 11, 3},
- {8, UPB_SIZE(32, 32), 0, 0, 4, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(48, 56), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
&envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[0],
&envoy_config_endpoint_v3_UpstreamLocalityStats__fields[0],
- UPB_SIZE(56, 72), 8, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-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_MiniTable_Sub envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = {
- {1, UPB_SIZE(40, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 4, 1},
- {5, UPB_SIZE(48, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(44, 48), 2, 2, 11, 1},
- {7, UPB_SIZE(32, 32), 0, 0, 4, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 56), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = {
&envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[0],
&envoy_config_endpoint_v3_UpstreamEndpointStats__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(48, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
NULL,
&envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0],
- UPB_SIZE(24, 32), 3, false, 255,
+ UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_config_endpoint_v3_ClusterStats_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats__fields[6] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(36, 56), 0, 1, 11, 3},
- {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {4, UPB_SIZE(32, 48), 1, 2, 11, 1},
- {5, UPB_SIZE(40, 64), 0, 0, 11, 3},
- {6, UPB_SIZE(24, 32), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterStats__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit = {
&envoy_config_endpoint_v3_ClusterStats_submsgs[0],
&envoy_config_endpoint_v3_ClusterStats__fields[0],
- UPB_SIZE(48, 80), 6, false, 255,
+ UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
+const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
NULL,
&envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[5] = {
+ &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
+ &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
+ &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
+ &envoy_config_endpoint_v3_ClusterStats_msginit,
+ &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
+};
+
+const upb_MiniTable_File envoy_config_endpoint_v3_load_report_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 5,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
index d986e182..2ba305aa 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -30,334 +30,535 @@ typedef struct envoy_config_endpoint_v3_UpstreamEndpointStats envoy_config_endpo
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;
+extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamLocalityStats_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_UpstreamEndpointStats_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Locality_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_UpstreamLocalityStats*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint_v3_UpstreamLocalityStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_UpstreamLocalityStats* ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_UpstreamLocalityStats_serialize_ex(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), const struct envoy_config_core_v3_Locality*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_successful_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0;
+}
+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(24, 32), uint64_t);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0;
+}
+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(32, 40), uint64_t);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_error_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0;
+}
+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(40, 48), 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(12, 16));
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_load_metric_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+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(12, 16), len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_endpoint_v3_UpstreamLocalityStats_priority(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(16, 24));
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_upstream_endpoint_stats(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+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(16, 24), len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamLocalityStats_clear_total_issued_requests(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0;
+}
+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(48, 56), uint64_t);
}
-
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg) { return _upb_hasbit(msg, 1); }
-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(44, 48), 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(8, 8), 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(16, 16), 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(24, 24), 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(48, 56)); }
-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(48, 56), 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(40, 40), 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(52, 64)); }
-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(52, 64), 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(32, 32), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 48), struct envoy_config_core_v3_Locality*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Locality*)_upb_Message_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(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), 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(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), 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(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), 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(48, 56), len);
+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(12, 16), 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_accessor2(msg, UPB_SIZE(48, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(48, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &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(40, 40), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(52, 64), len);
+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(16, 24), 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_accessor2(msg, UPB_SIZE(52, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(52, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &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(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_UpstreamEndpointStats*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint_v3_UpstreamEndpointStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_UpstreamEndpointStats* ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_UpstreamEndpointStats_serialize_ex(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_address(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_Address*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_successful_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), uint64_t) = 0;
+}
+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(16, 32), uint64_t);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_requests_in_progress(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), uint64_t) = 0;
+}
+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(24, 40), uint64_t);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_error_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), uint64_t) = 0;
+}
+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(32, 48), 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(8, 16));
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_load_metric_stats(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Struct*);
+}
+UPB_INLINE void envoy_config_endpoint_v3_UpstreamEndpointStats_clear_total_issued_requests(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), uint64_t) = 0;
+}
+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(40, 56), uint64_t);
}
-
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_address(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_hasbit(msg, 1); }
-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(40, 40), 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(8, 8), 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(16, 16), 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(24, 24), 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(48, 56)); }
-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(48, 56), len); }
-UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_metadata(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg) { return _upb_hasbit(msg, 2); }
-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(44, 48), 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(32, 32), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), struct envoy_config_core_v3_Address*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_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(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), 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(48, 56), len);
+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(8, 16), 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_accessor2(msg, UPB_SIZE(48, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(48, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 48), struct google_protobuf_Struct*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Struct*)_upb_Message_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(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_EndpointLoadMetricStats*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoint_v3_EndpointLoadMetricStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_EndpointLoadMetricStats* ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_EndpointLoadMetricStats_serialize_ex(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, options, arena, len);
}
-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 void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_metric_name(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_EndpointLoadMetricStats_metric_name(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_num_requests_finished_with_metric(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0;
+}
+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(8, 16), uint64_t);
+}
+UPB_INLINE void envoy_config_endpoint_v3_EndpointLoadMetricStats_clear_total_metric_value(const envoy_config_endpoint_v3_EndpointLoadMetricStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = 0;
+}
+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(16, 24), double);
}
-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_metric_name(envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_PTR_AT(msg, UPB_SIZE(8, 16), 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_ClusterStats*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_ClusterStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_ClusterStats* ret = envoy_config_endpoint_v3_ClusterStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_ClusterStats_serialize_ex(const envoy_config_endpoint_v3_ClusterStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, options, arena, len);
}
-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 void envoy_config_endpoint_v3_ClusterStats_clear_cluster_name(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_cluster_name(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(12, 24));
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_upstream_locality_stats(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_total_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0;
+}
+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(32, 64), uint64_t);
+}
+UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_load_report_interval(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), 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(20, 40));
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_dropped_requests(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40), len);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_clear_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_cluster_service_name(const envoy_config_endpoint_v3_ClusterStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
}
-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(16, 16), 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(36, 56)); }
-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(36, 56), 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(8, 8), uint64_t); }
-UPB_INLINE bool envoy_config_endpoint_v3_ClusterStats_has_load_report_interval(const envoy_config_endpoint_v3_ClusterStats *msg) { return _upb_hasbit(msg, 1); }
-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(32, 48), 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(40, 64)); }
-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(40, 64), 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(24, 32), 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(16, 16), upb_strview) = value;
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(36, 56), len);
+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(12, 24), 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_accessor2(msg, UPB_SIZE(36, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), 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_endpoint_v3_ClusterStats_mutable_load_report_interval(envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(40, 64), len);
+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(20, 40), 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_accessor2(msg, UPB_SIZE(40, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(40, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &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(24, 32), upb_strview) = value;
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_set_cluster_service_name(envoy_config_endpoint_v3_ClusterStats *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_endpoint_v3_ClusterStats_DroppedRequests*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_endpoint_v3_ClusterStats_DroppedRequests* ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_endpoint_v3_ClusterStats_DroppedRequests_serialize_ex(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, options, arena, len);
}
-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 void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_clear_category(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_endpoint_v3_ClusterStats_DroppedRequests_category(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_clear_dropped_count(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0;
+}
+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(8, 16), uint64_t);
}
-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_category(envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = value;
}
+extern const upb_MiniTable_File envoy_config_endpoint_v3_load_report_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
index e016fffa..c031cac2 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/api_listener.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -15,18 +15,31 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_ApiListener_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_ApiListener_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_ApiListener__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_ApiListener__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_ApiListener_msginit = {
+const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit = {
&envoy_config_listener_v3_ApiListener_submsgs[0],
&envoy_config_listener_v3_ApiListener__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_listener_v3_ApiListener_msginit,
+};
+
+const upb_MiniTable_File envoy_config_listener_v3_api_listener_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
index 9d1372b4..4f47814f 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,48 +22,69 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit;
struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ApiListener*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiListener_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ApiListener* ret = envoy_config_listener_v3_ApiListener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_listener_v3_ApiListener_serialize_ex(const envoy_config_listener_v3_ApiListener* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_ApiListener_clear_api_listener(const envoy_config_listener_v3_ApiListener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Any*);
}
-
-UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_ApiListener_set_api_listener(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_listener_v3_api_listener_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
index e7e0cad8..2c075ecc 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
@@ -7,12 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -20,6 +19,7 @@
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "xds/core/v3/collection_entry.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/security.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -27,103 +27,138 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
- &xds_core_v3_CollectionEntry_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
+ {.submsg = &xds_core_v3_CollectionEntry_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_ListenerCollection__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_listener_v3_ListenerCollection__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit = {
+const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msginit = {
&envoy_config_listener_v3_ListenerCollection_submsgs[0],
&envoy_config_listener_v3_ListenerCollection__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_submsgs[14] = {
- &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[25] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 32), 1, 1, 11, 1},
- {3, UPB_SIZE(88, 160), 0, 6, 11, 3},
- {4, UPB_SIZE(28, 40), 2, 11, 11, 1},
- {5, UPB_SIZE(32, 48), 3, 13, 11, 1},
- {6, UPB_SIZE(36, 56), 4, 2, 11, 1},
- {7, UPB_SIZE(40, 64), 5, 8, 11, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {9, UPB_SIZE(92, 168), 0, 9, 11, 3},
- {10, UPB_SIZE(44, 72), 6, 11, 11, 1},
- {11, UPB_SIZE(48, 80), 7, 11, 11, 1},
- {12, UPB_SIZE(52, 88), 8, 13, 11, 1},
- {13, UPB_SIZE(96, 176), 0, 3, 11, 3},
- {15, UPB_SIZE(56, 96), 9, 12, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(12, 12), 0, 0, 8, 1},
- {18, UPB_SIZE(60, 104), 10, 10, 11, 1},
- {19, UPB_SIZE(64, 112), 11, 5, 11, 1},
- {20, UPB_SIZE(68, 120), 12, 7, 11, 1},
- {21, UPB_SIZE(13, 13), 0, 0, 8, 1},
- {22, UPB_SIZE(100, 184), 0, 0, 11, 3},
- {23, UPB_SIZE(72, 128), 13, 4, 11, 1},
- {24, UPB_SIZE(76, 136), 14, 13, 11, 1},
- {25, UPB_SIZE(80, 144), 15, 6, 11, 1},
- {26, UPB_SIZE(84, 152), 16, 11, 11, 1},
-};
-
-const upb_msglayout envoy_config_listener_v3_Listener_msginit = {
+static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_submsgs[21] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChain_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_DeprecatedV1_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_listener_v3_UdpListenerConfig_msginit},
+ {.submsg = &envoy_config_listener_v3_ApiListener_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit},
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChain_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_listener_v3_Listener__fields[29] = {
+ {1, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(32, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(36, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 56), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(44, 64), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(48, 72), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(52, 80), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(56, 88), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(60, 96), UPB_SIZE(6, 6), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(64, 104), UPB_SIZE(7, 7), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(68, 112), UPB_SIZE(8, 8), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(72, 120), UPB_SIZE(0, 0), 10, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(76, 128), UPB_SIZE(9, 9), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(80, 136), UPB_SIZE(10, 10), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(84, 144), UPB_SIZE(11, 11), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(88, 152), UPB_SIZE(12, 12), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(13, 13), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(92, 160), UPB_SIZE(0, 0), 15, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(96, 168), UPB_SIZE(13, 13), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(100, 176), UPB_SIZE(14, 14), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(104, 184), UPB_SIZE(15, 15), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(120, 216), UPB_SIZE(-17, -17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(108, 192), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {29, UPB_SIZE(116, 208), UPB_SIZE(16, 16), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_listener_v3_Listener_msginit = {
&envoy_config_listener_v3_Listener_submsgs[0],
&envoy_config_listener_v3_Listener__fields[0],
- UPB_SIZE(104, 192), 25, false, 255,
+ UPB_SIZE(124, 232), 29, kUpb_ExtMode_NonExtendable, 13, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[6] = {
+ &envoy_config_listener_v3_ListenerCollection_msginit,
+ &envoy_config_listener_v3_Listener_msginit,
+ &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
+ &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit,
};
-const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = {
+const upb_MiniTable_File envoy_config_listener_v3_listener_proto_upb_file_layout = {
+ messages_layout,
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 6,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
index 1d133733..34708518 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
#define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,21 +25,23 @@ 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;
+struct envoy_config_listener_v3_Listener_InternalListenerConfig;
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;
+typedef struct envoy_config_listener_v3_Listener_InternalListenerConfig envoy_config_listener_v3_Listener_InternalListenerConfig;
+extern const upb_MiniTable envoy_config_listener_v3_ListenerCollection_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_DeprecatedV1_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_Listener_InternalListenerConfig_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;
@@ -48,19 +50,18 @@ struct google_protobuf_BoolValue;
struct google_protobuf_Duration;
struct google_protobuf_UInt32Value;
struct xds_core_v3_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 xds_core_v3_CollectionEntry_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SocketOption_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ApiListener_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit;
typedef enum {
envoy_config_listener_v3_Listener_DEFAULT = 0,
@@ -68,146 +69,373 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ListenerCollection*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3_ListenerCollection_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ListenerCollection* ret = envoy_config_listener_v3_ListenerCollection_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_listener_v3_ListenerCollection_serialize_ex(const envoy_config_listener_v3_ListenerCollection* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, options, arena, len);
}
-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 void envoy_config_listener_v3_ListenerCollection_clear_entries(const envoy_config_listener_v3_ListenerCollection* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const struct xds_core_v3_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection* msg, size_t* len) {
+ return (const struct xds_core_v3_CollectionEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), 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 xds_core_v3_CollectionEntry* const* envoy_config_listener_v3_ListenerCollection_entries(const envoy_config_listener_v3_ListenerCollection *msg, size_t *len) { return (const struct xds_core_v3_CollectionEntry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t *len) {
+UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_mutable_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t* len) {
return (struct xds_core_v3_CollectionEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection *msg, size_t len, upb_arena *arena) {
- return (struct xds_core_v3_CollectionEntry**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct xds_core_v3_CollectionEntry** envoy_config_listener_v3_ListenerCollection_resize_entries(envoy_config_listener_v3_ListenerCollection* msg, size_t len, upb_Arena* arena) {
+ return (struct xds_core_v3_CollectionEntry**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_listener_v3_ListenerCollection_add_entries(envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena) {
- struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)_upb_msg_new(&xds_core_v3_CollectionEntry_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct xds_core_v3_CollectionEntry* envoy_config_listener_v3_ListenerCollection_add_entries(envoy_config_listener_v3_ListenerCollection* msg, upb_Arena* arena) {
+ struct xds_core_v3_CollectionEntry* sub = (struct xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Listener*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener* ret = envoy_config_listener_v3_Listener_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
}
-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_ex(const envoy_config_listener_v3_Listener* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_msginit, options, arena, len);
}
-UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+typedef enum {
+ envoy_config_listener_v3_Listener_listener_specifier_internal_listener = 27,
+ envoy_config_listener_v3_Listener_listener_specifier_NOT_SET = 0
+} envoy_config_listener_v3_Listener_listener_specifier_oneofcases;
+UPB_INLINE envoy_config_listener_v3_Listener_listener_specifier_oneofcases envoy_config_listener_v3_Listener_listener_specifier_case(const envoy_config_listener_v3_Listener* msg) {
+ return (envoy_config_listener_v3_Listener_listener_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t);
}
-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 void envoy_config_listener_v3_Listener_clear_name(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_address(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const upb_Message*) = NULL;
+}
+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(32, 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(36, 48));
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_filter_chains(const envoy_config_listener_v3_Listener* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 48));
+}
+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(36, 48), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_use_original_dst(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_use_original_dst(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_use_original_dst(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const upb_Message*) = NULL;
+}
+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(44, 64), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_metadata(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const upb_Message*) = NULL;
+}
+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(48, 72), 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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_deprecated_v1(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const upb_Message*) = NULL;
+}
+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(52, 80), const envoy_config_listener_v3_Listener_DeprecatedV1*);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_drain_type(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), 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(56, 88));
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters(const envoy_config_listener_v3_Listener* msg) {
+ _upb_array_detach(msg, UPB_SIZE(56, 88));
+}
+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(56, 88), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_transparent(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const upb_Message*) = NULL;
+}
+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(60, 96), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_freebind(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const upb_Message*) = NULL;
+}
+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(64, 104), 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_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const upb_Message*) = NULL;
+}
+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(68, 112), 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(72, 120));
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_socket_options(const envoy_config_listener_v3_Listener* msg) {
+ _upb_array_detach(msg, UPB_SIZE(72, 120));
+}
+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(72, 120), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const upb_Message*) = NULL;
+}
+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(76, 128), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_traffic_direction(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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 void envoy_config_listener_v3_Listener_clear_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+}
+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(12, 12), bool);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_udp_listener_config(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const upb_Message*) = NULL;
+}
+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(80, 136), 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_api_listener(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const upb_Message*) = NULL;
+}
+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(84, 144), 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_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_connection_balance_config(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 152), const upb_Message*) = NULL;
+}
+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(88, 152), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_reuse_port(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0;
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_reuse_port(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), 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, 160));
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_access_log(const envoy_config_listener_v3_Listener* msg) {
+ _upb_array_detach(msg, UPB_SIZE(92, 160));
+}
+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, 160), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_tcp_backlog_size(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const upb_Message*) = NULL;
+}
+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(96, 168), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_default_filter_chain(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 176), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_default_filter_chain(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), const struct envoy_config_listener_v3_FilterChain*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_bind_to_port(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_bind_to_port(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_internal_listener(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 27;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_internal_listener(const envoy_config_listener_v3_Listener* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(120, 216), 0, UPB_SIZE(16, 16), envoy_config_listener_v3_Listener_listener_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_internal_listener(const envoy_config_listener_v3_Listener* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(120, 216), UPB_SIZE(16, 16), 27, NULL);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_stat_prefix(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_Listener_stat_prefix(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) {
+ return _upb_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_enable_reuse_port(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_enable_mptcp(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_enable_mptcp(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_clear_ignore_global_conn_limit(const envoy_config_listener_v3_Listener* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0;
+}
+UPB_INLINE bool envoy_config_listener_v3_Listener_ignore_global_conn_limit(const envoy_config_listener_v3_Listener* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool);
}
-UPB_INLINE upb_strview envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 1); }
-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(24, 32), 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(88, 160)); }
-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(88, 160), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_use_original_dst(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_use_original_dst(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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_hasbit(msg, 5); }
-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(4, 4), 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(92, 168)); }
-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(92, 168), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 6); }
-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_hasbit(msg, 7); }
-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_hasbit(msg, 8); }
-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(96, 176)); }
-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(96, 176), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 9); }
-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(12, 12), bool); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 10); }
-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_hasbit(msg, 11); }
-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_hasbit(msg, 12); }
-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(13, 13), 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(100, 184)); }
-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(100, 184), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 13); }
-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_hasbit(msg, 14); }
-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 bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE const struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const struct envoy_config_listener_v3_FilterChain*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const struct google_protobuf_BoolValue*); }
-
-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(16, 16), upb_strview) = value;
+UPB_INLINE void envoy_config_listener_v3_Listener_set_name(envoy_config_listener_v3_Listener *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct envoy_config_core_v3_Address*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 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) {
+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);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_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(88, 160), len);
+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(36, 48), 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_accessor2(msg, UPB_SIZE(88, 160), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 48), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(88, 160), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_listener_v3_FilterChain_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_use_original_dst(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), struct google_protobuf_BoolValue*) = value;
}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_use_original_dst(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_use_original_dst(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_use_original_dst(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_use_original_dst(msg, sub);
}
@@ -215,12 +443,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(msg, sub);
}
@@ -228,12 +456,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_metadata(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_metadata(msg, sub);
}
@@ -241,12 +469,12 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listen
}
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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_listener_v3_Listener_DeprecatedV1*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 80), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_New(&envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_deprecated_v1(msg, sub);
}
@@ -255,27 +483,26 @@ UPB_INLINE struct envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_l
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(4, 4), 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(92, 168), len);
+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(56, 88), 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_accessor2(msg, UPB_SIZE(92, 168), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(56, 88), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(92, 168), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 88), UPB_SIZE(2, 3), &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_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_transparent(msg, sub);
}
@@ -283,12 +510,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_freebind(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 104), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_freebind(msg, sub);
}
@@ -296,38 +523,37 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
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_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), 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_listener_v3_Listener_mutable_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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(96, 176), len);
+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(72, 120), 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_accessor2(msg, UPB_SIZE(96, 176), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(72, 120), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(96, 176), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_SocketOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(72, 120), UPB_SIZE(2, 3), &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_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_listener_filters_timeout(msg, sub);
}
@@ -341,12 +567,12 @@ UPB_INLINE void envoy_config_listener_v3_Listener_set_continue_on_listener_filte
}
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_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct envoy_config_listener_v3_UdpListenerConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_UdpListenerConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_udp_listener_config(msg, sub);
}
@@ -354,12 +580,12 @@ UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_liste
}
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_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct envoy_config_listener_v3_ApiListener*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_ApiListener*)_upb_Message_New(&envoy_config_listener_v3_ApiListener_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_api_listener(msg, sub);
}
@@ -367,12 +593,12 @@ UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3
}
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_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 152), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_set_connection_balance_config(msg, sub);
}
@@ -381,103 +607,141 @@ UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* env
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(13, 13), 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(100, 184), len);
+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, 160), 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_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(92, 160), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(92, 160), UPB_SIZE(2, 3), &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_INLINE void envoy_config_listener_v3_Listener_set_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 128), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 168), struct google_protobuf_UInt32Value*) = 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);
+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 envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_udp_writer_config(msg, sub);
+ envoy_config_listener_v3_Listener_set_tcp_backlog_size(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_INLINE void envoy_config_listener_v3_Listener_set_default_filter_chain(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_FilterChain* value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 176), struct envoy_config_listener_v3_FilterChain*) = 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);
+UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_mutable_default_filter_chain(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) {
+ struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)envoy_config_listener_v3_Listener_default_filter_chain(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ sub = (struct envoy_config_listener_v3_FilterChain*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_tcp_backlog_size(msg, sub);
+ envoy_config_listener_v3_Listener_set_default_filter_chain(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_default_filter_chain(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_FilterChain* value) {
+UPB_INLINE void envoy_config_listener_v3_Listener_set_bind_to_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 144), struct envoy_config_listener_v3_FilterChain*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 184), struct google_protobuf_BoolValue*) = value;
}
-UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_mutable_default_filter_chain(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)envoy_config_listener_v3_Listener_default_filter_chain(msg);
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_bind_to_port(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_bind_to_port(msg);
if (sub == NULL) {
- sub = (struct envoy_config_listener_v3_FilterChain*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_default_filter_chain(msg, sub);
+ envoy_config_listener_v3_Listener_set_bind_to_port(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_bind_to_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
+UPB_INLINE void envoy_config_listener_v3_Listener_set_internal_listener(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_InternalListenerConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(120, 216), value, UPB_SIZE(16, 16), 27);
+}
+UPB_INLINE struct envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_mutable_internal_listener(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) {
+ struct envoy_config_listener_v3_Listener_InternalListenerConfig* sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)envoy_config_listener_v3_Listener_internal_listener(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_internal_listener(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_stat_prefix(envoy_config_listener_v3_Listener *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 192), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_enable_reuse_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 152), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 208), struct google_protobuf_BoolValue*) = value;
}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_bind_to_port(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_bind_to_port(msg);
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_enable_reuse_port(envoy_config_listener_v3_Listener* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_enable_reuse_port(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_bind_to_port(msg, sub);
+ envoy_config_listener_v3_Listener_set_enable_reuse_port(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_enable_mptcp(envoy_config_listener_v3_Listener *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_ignore_global_conn_limit(envoy_config_listener_v3_Listener *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Listener_DeprecatedV1*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_DeprecatedV1_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener_DeprecatedV1* ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_listener_v3_Listener_DeprecatedV1_serialize_ex(const envoy_config_listener_v3_Listener_DeprecatedV1* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_DeprecatedV1_clear_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_BoolValue*);
}
-
-UPB_INLINE bool envoy_config_listener_v3_Listener_DeprecatedV1_has_bind_to_port(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Listener_DeprecatedV1_set_bind_to_port(msg, sub);
}
@@ -486,40 +750,59 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_D
/* 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 envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_serialize_ex(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_ConnectionBalanceConfig_clear_exact_balance(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_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);
}
@@ -528,25 +811,71 @@ UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_Exac
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
}
-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_ex(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, options, arena, len);
+}
+
+
+/* envoy.config.listener.v3.Listener.InternalListenerConfig */
+
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_InternalListenerConfig_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_Message_New(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_InternalListenerConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener_InternalListenerConfig* ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_InternalListenerConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Listener_InternalListenerConfig* ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_listener_v3_Listener_InternalListenerConfig_serialize(const envoy_config_listener_v3_Listener_InternalListenerConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_Listener_InternalListenerConfig_serialize_ex(const envoy_config_listener_v3_Listener_InternalListenerConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, options, arena, len);
}
+extern const upb_MiniTable_File envoy_config_listener_v3_listener_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
index 303b6ab7..e83a340a 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
@@ -7,152 +7,179 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
#include "envoy/type/v3/range.upb.h"
#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.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_listener_v3_Filter_submsgs[2] = {
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_Filter_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_Filter__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},
+static const upb_MiniTable_Field envoy_config_listener_v3_Filter__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_Filter_msginit = {
+const upb_MiniTable envoy_config_listener_v3_Filter_msginit = {
&envoy_config_listener_v3_Filter_submsgs[0],
&envoy_config_listener_v3_Filter__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChainMatch_submsgs[2] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChainMatch_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_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), 1, 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), 2, 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(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_FilterChainMatch__fields[11] = {
+ {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 56), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(52, 96), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(56, 104), 11, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_submsgs[7] = {
- &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,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChain_submsgs[7] = {
+ {.submsg = &envoy_config_listener_v3_FilterChainMatch_msginit},
+ {.submsg = &envoy_config_listener_v3_Filter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_FilterChain__fields[8] = {
- {1, UPB_SIZE(12, 24), 1, 4, 11, 1},
- {3, UPB_SIZE(36, 72), 0, 2, 11, 3},
- {4, UPB_SIZE(16, 32), 2, 5, 11, 1},
- {5, UPB_SIZE(20, 40), 3, 0, 11, 1},
- {6, UPB_SIZE(24, 48), 4, 1, 11, 1},
- {7, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {8, UPB_SIZE(28, 56), 5, 3, 11, 1},
- {9, UPB_SIZE(32, 64), 6, 6, 11, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain__fields[8] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(20, 40), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 64), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 72), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_FilterChain_msginit = {
+const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit = {
&envoy_config_listener_v3_FilterChain_submsgs[0],
&envoy_config_listener_v3_FilterChain__fields[0],
- UPB_SIZE(40, 80), 8, false, 255,
+ UPB_SIZE(40, 88), 8, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[3] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
- &envoy_type_v3_Int32Range_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = {
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit},
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_listener_v3_ListenerFilter_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit},
+ {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_ListenerFilter__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
- {4, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilter__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_config_listener_v3_Filter_msginit,
+ &envoy_config_listener_v3_FilterChainMatch_msginit,
+ &envoy_config_listener_v3_FilterChain_msginit,
+ &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
+ &envoy_config_listener_v3_ListenerFilter_msginit,
+};
+
+const upb_MiniTable_File envoy_config_listener_v3_listener_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
index b8ef3826..7b7e3b78 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -34,13 +34,13 @@ typedef struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration envoy_
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;
+extern const upb_MiniTable envoy_config_listener_v3_Filter_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_FilterChainMatch_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_FilterChain_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ListenerFilter_msginit;
struct envoy_config_core_v3_CidrRange;
struct envoy_config_core_v3_ExtensionConfigSource;
struct envoy_config_core_v3_Metadata;
@@ -50,15 +50,15 @@ 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_ExtensionConfigSource_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;
+extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TransportSocket_msginit;
+extern const upb_MiniTable envoy_type_v3_Int32Range_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_config_listener_v3_FilterChainMatch_ANY = 0,
@@ -67,61 +67,93 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_Filter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_Filter* ret = envoy_config_listener_v3_Filter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_Filter_serialize_ex(const envoy_config_listener_v3_Filter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_Filter_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_listener_v3_Filter_config_type_typed_config = 4,
envoy_config_listener_v3_Filter_config_type_config_discovery = 5,
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 bool envoy_config_listener_v3_Filter_has_config_discovery(const envoy_config_listener_v3_Filter *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_config_discovery(const envoy_config_listener_v3_Filter *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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_listener_v3_Filter_clear_name(const envoy_config_listener_v3_Filter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_Filter_name(const envoy_config_listener_v3_Filter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_Filter_has_typed_config(const envoy_config_listener_v3_Filter* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_listener_v3_Filter_clear_typed_config(const envoy_config_listener_v3_Filter* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Filter_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 4, NULL);
+}
+UPB_INLINE bool envoy_config_listener_v3_Filter_has_config_discovery(const envoy_config_listener_v3_Filter* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_listener_v3_Filter_clear_config_discovery(const envoy_config_listener_v3_Filter* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_Filter_config_type_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_config_discovery(const envoy_config_listener_v3_Filter* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 5, 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_name(envoy_config_listener_v3_Filter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 4);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_Filter_mutable_typed_config(envoy_config_listener_v3_Filter *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Filter_set_typed_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Filter_set_config_discovery(envoy_config_listener_v3_Filter *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_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 5);
}
-UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_mutable_config_discovery(envoy_config_listener_v3_Filter *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_Filter_mutable_config_discovery(envoy_config_listener_v3_Filter* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_config_listener_v3_Filter_config_discovery(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_msg_new(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
+ sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_Filter_set_config_discovery(msg, sub);
}
@@ -130,201 +162,350 @@ UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_liste
/* 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 envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(4, 4), 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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChainMatch_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_FilterChainMatch*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_FilterChainMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_FilterChainMatch* ret = envoy_config_listener_v3_FilterChainMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_listener_v3_FilterChainMatch_serialize_ex(const envoy_config_listener_v3_FilterChainMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, options, 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(8, 8));
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
+}
+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(8, 8), len);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_address_suffix(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChainMatch_address_suffix(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_suffix_len(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), 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(24, 40));
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+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(24, 40), len);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_ports(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 48));
+}
+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(28, 48), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_destination_port(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(32, 56), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_transport_protocol(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChainMatch_transport_protocol(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(44, 80));
+}
+UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_server_names(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE upb_StringView const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_source_type(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96));
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_clear_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 96));
+}
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_direct_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(52, 96), len);
+}
+
+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(8, 8), 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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), 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_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &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_address_suffix(envoy_config_listener_v3_FilterChainMatch *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value;
}
UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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_listener_v3_FilterChainMatch_mutable_suffix_len(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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_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(24, 40), 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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &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_mutable_source_ports(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), 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_accessor2(msg, UPB_SIZE(40, 72), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(28, 48), len, 2, 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_accessor2(msg, UPB_SIZE(40, 72), 2, &val,
- 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_accessor2(msg, UPB_SIZE(28, 48), 2, &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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_listener_v3_FilterChainMatch_mutable_destination_port(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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 void envoy_config_listener_v3_FilterChainMatch_set_transport_protocol(envoy_config_listener_v3_FilterChainMatch *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = 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_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_application_protocols(envoy_config_listener_v3_FilterChainMatch* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(3, 4), &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_StringView* envoy_config_listener_v3_FilterChainMatch_mutable_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_listener_v3_FilterChainMatch_resize_server_names(envoy_config_listener_v3_FilterChainMatch* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_server_names(envoy_config_listener_v3_FilterChainMatch* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(3, 4), &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(4, 4), int32_t) = value;
}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_direct_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(52, 96), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_direct_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_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_direct_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_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
/* 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 envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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(12, 24), 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(36, 72)); }
-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(36, 72), len); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain *msg) { return _upb_hasbit(msg, 2); }
-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(16, 32), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_metadata(const envoy_config_listener_v3_FilterChain *msg) { return _upb_hasbit(msg, 3); }
-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(20, 40), 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_hasbit(msg, 4); }
-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(24, 48), 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain *msg) { return _upb_hasbit(msg, 5); }
-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(28, 56), const envoy_config_listener_v3_FilterChain_OnDemandConfiguration*); }
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct google_protobuf_Duration*); }
+UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_FilterChain_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_FilterChain*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_FilterChain_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_FilterChain* ret = envoy_config_listener_v3_FilterChain_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_listener_v3_FilterChain_serialize_ex(const envoy_config_listener_v3_FilterChain* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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(8, 16));
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_filters(const envoy_config_listener_v3_FilterChain* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_use_proxy_proto(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_metadata(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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 void envoy_config_listener_v3_FilterChain_clear_name(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_FilterChain_name(const envoy_config_listener_v3_FilterChain* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_on_demand_configuration(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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(32, 64), const envoy_config_listener_v3_FilterChain_OnDemandConfiguration*);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_clear_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_transport_socket_connect_timeout(const envoy_config_listener_v3_FilterChain* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct google_protobuf_Duration*);
+}
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_listener_v3_FilterChainMatch*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_FilterChainMatch*)_upb_Message_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(36, 72), len);
+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(8, 16), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_listener_v3_Filter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_FilterChain_set_use_proxy_proto(msg, sub);
}
@@ -332,12 +513,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_FilterChai
}
UPB_INLINE void envoy_config_listener_v3_FilterChain_set_metadata(envoy_config_listener_v3_FilterChain *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_FilterChain_set_metadata(msg, sub);
}
@@ -345,28 +526,28 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Filter
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TransportSocket*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_listener_v3_FilterChain_set_name(envoy_config_listener_v3_FilterChain *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_config_listener_v3_FilterChain_OnDemandConfiguration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_New(&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_FilterChain_set_on_demand_configuration(msg, sub);
}
@@ -374,12 +555,12 @@ UPB_INLINE struct envoy_config_listener_v3_FilterChain_OnDemandConfiguration* en
}
UPB_INLINE void envoy_config_listener_v3_FilterChain_set_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_mutable_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain_mutable_transport_socket_connect_timeout(envoy_config_listener_v3_FilterChain* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_FilterChain_transport_socket_connect_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_FilterChain_set_transport_socket_connect_timeout(msg, sub);
}
@@ -388,35 +569,53 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_FilterChain_OnDemandConfiguration*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_FilterChain_OnDemandConfiguration* ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_listener_v3_FilterChain_OnDemandConfiguration_serialize_ex(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_listener_v3_FilterChain_OnDemandConfiguration_has_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_FilterChain_OnDemandConfiguration_clear_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_listener_v3_FilterChain_OnDemandConfiguration_has_rebuild_timeout(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_FilterChain_OnDemandConfiguration_set_rebuild_timeout(msg, sub);
}
@@ -425,24 +624,35 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_FilterChain
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_serialize_ex(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_or_match = 1,
envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_and_match = 2,
@@ -451,65 +661,101 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_or_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_and_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_not_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_any_match(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_clear_destination_port_range(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_ListenerFilterChainMatchPredicate_set_destination_port_range(msg, sub);
}
@@ -518,83 +764,141 @@ UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_listener_v3_ListenerFil
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_serialize_ex(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, options, 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 void envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_clear_rules(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ListenerFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_ListenerFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ListenerFilter* ret = envoy_config_listener_v3_ListenerFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_ListenerFilter_serialize_ex(const envoy_config_listener_v3_ListenerFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_listener_v3_ListenerFilter_config_type_typed_config = 3,
+ envoy_config_listener_v3_ListenerFilter_config_type_config_discovery = 5,
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(20, 40), 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(4, 8), 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(20, 40)) == 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(16, 32), UPB_SIZE(20, 40), 3, NULL); }
-UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_name(const envoy_config_listener_v3_ListenerFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_listener_v3_ListenerFilter_name(const envoy_config_listener_v3_ListenerFilter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_typed_config(const envoy_config_listener_v3_ListenerFilter* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET);
+}
+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(20, 32), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_filter_disabled(const envoy_config_listener_v3_ListenerFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), const envoy_config_listener_v3_ListenerFilterChainMatchPredicate*);
+}
+UPB_INLINE bool envoy_config_listener_v3_ListenerFilter_has_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_clear_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_listener_v3_ListenerFilter_config_type_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_ListenerFilter_config_discovery(const envoy_config_listener_v3_ListenerFilter* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 5, NULL);
+}
-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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_name(envoy_config_listener_v3_ListenerFilter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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(16, 32), value, UPB_SIZE(20, 40), 3);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_mutable_typed_config(envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_ListenerFilter_set_typed_config(msg, sub);
}
@@ -602,17 +906,31 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ListenerFilter_m
}
UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_filter_disabled(envoy_config_listener_v3_ListenerFilter *msg, envoy_config_listener_v3_ListenerFilterChainMatchPredicate* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_listener_v3_ListenerFilterChainMatchPredicate*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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) {
+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);
+ sub = (struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate*)_upb_Message_New(&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena);
if (!sub) return NULL;
envoy_config_listener_v3_ListenerFilter_set_filter_disabled(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_listener_v3_ListenerFilter_set_config_discovery(envoy_config_listener_v3_ListenerFilter *msg, struct envoy_config_core_v3_ExtensionConfigSource* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 5);
+}
+UPB_INLINE struct envoy_config_core_v3_ExtensionConfigSource* envoy_config_listener_v3_ListenerFilter_mutable_config_discovery(envoy_config_listener_v3_ListenerFilter* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_ExtensionConfigSource* sub = (struct envoy_config_core_v3_ExtensionConfigSource*)envoy_config_listener_v3_ListenerFilter_config_discovery(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_New(&envoy_config_core_v3_ExtensionConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_ListenerFilter_set_config_discovery(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_listener_v3_listener_components_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c
new file mode 100644
index 00000000..be4fb5fd
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c
@@ -0,0 +1,63 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/listener/v3/quic_config.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/protocol.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_MiniTable_Sub envoy_config_listener_v3_QuicProtocolOptions_submsgs[7] = {
+ {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFeatureFlag_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_listener_v3_QuicProtocolOptions__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(6, 6), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(7, 7), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msginit = {
+ &envoy_config_listener_v3_QuicProtocolOptions_submsgs[0],
+ &envoy_config_listener_v3_QuicProtocolOptions__fields[0],
+ UPB_SIZE(32, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_listener_v3_QuicProtocolOptions_msginit,
+};
+
+const upb_MiniTable_File envoy_config_listener_v3_quic_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h
new file mode 100644
index 00000000..ddaa535f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h
@@ -0,0 +1,234 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_QuicProtocolOptions;
+typedef struct envoy_config_listener_v3_QuicProtocolOptions envoy_config_listener_v3_QuicProtocolOptions;
+extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_msginit;
+struct envoy_config_core_v3_QuicProtocolOptions;
+struct envoy_config_core_v3_RuntimeFeatureFlag;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_MiniTable envoy_config_core_v3_QuicProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeFeatureFlag_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+
+
+
+/* envoy.config.listener.v3.QuicProtocolOptions */
+
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_listener_v3_QuicProtocolOptions* ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_QuicProtocolOptions* ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_listener_v3_QuicProtocolOptions_serialize(const envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_listener_v3_QuicProtocolOptions_serialize_ex(const envoy_config_listener_v3_QuicProtocolOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_QuicProtocolOptions*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_enabled(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_RuntimeFeatureFlag*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_clear_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_QuicProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_mutable_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_enabled(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_RuntimeFeatureFlag* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_RuntimeFeatureFlag*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_mutable_enabled(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_RuntimeFeatureFlag* sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)envoy_config_listener_v3_QuicProtocolOptions_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)_upb_Message_New(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_mutable_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 7);
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_listener_v3_quic_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
index 34696f6c..403aa194 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
@@ -7,33 +7,49 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-#include "google/protobuf/any.upb.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+#include "envoy/config/listener/v3/quic_config.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_MiniTable_Sub envoy_config_listener_v3_UdpListenerConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_UdpSocketConfig_msginit},
+ {.submsg = &envoy_config_listener_v3_QuicProtocolOptions_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},
+static const upb_MiniTable_Field envoy_config_listener_v3_UdpListenerConfig__fields[2] = {
+ {5, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = {
+const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_listener_v3_UdpListenerConfig_msginit,
+ &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
index 3de7e08d..b765c97f 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,79 +24,126 @@ 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;
+extern const upb_MiniTable envoy_config_listener_v3_UdpListenerConfig_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
+struct envoy_config_core_v3_UdpSocketConfig;
+struct envoy_config_listener_v3_QuicProtocolOptions;
+extern const upb_MiniTable envoy_config_core_v3_UdpSocketConfig_msginit;
+extern const upb_MiniTable envoy_config_listener_v3_QuicProtocolOptions_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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_UdpListenerConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_UdpListenerConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_UdpListenerConfig* ret = envoy_config_listener_v3_UdpListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_listener_v3_UdpListenerConfig_serialize_ex(const envoy_config_listener_v3_UdpListenerConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_UdpSocketConfig*);
+}
+UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_clear_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_quic_options(const envoy_config_listener_v3_UdpListenerConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_listener_v3_QuicProtocolOptions*);
}
-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_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_core_v3_UdpSocketConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_UdpSocketConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_mutable_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_UdpSocketConfig* sub = (struct envoy_config_core_v3_UdpSocketConfig*)envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_UdpSocketConfig*)_upb_Message_New(&envoy_config_core_v3_UdpSocketConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(msg, sub);
+ }
+ return sub;
}
-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 void envoy_config_listener_v3_UdpListenerConfig_set_quic_options(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_listener_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_listener_v3_QuicProtocolOptions*) = value;
}
-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);
+UPB_INLINE struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_mutable_quic_options(envoy_config_listener_v3_UdpListenerConfig* msg, upb_Arena* arena) {
+ struct envoy_config_listener_v3_QuicProtocolOptions* sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)envoy_config_listener_v3_UdpListenerConfig_quic_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)_upb_Message_New(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_UdpListenerConfig_set_typed_config(msg, sub);
+ envoy_config_listener_v3_UdpListenerConfig_set_quic_options(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_new(upb_Arena* arena) {
+ return (envoy_config_listener_v3_ActiveRawUdpListenerConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_listener_v3_ActiveRawUdpListenerConfig* ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize_ex(const envoy_config_listener_v3_ActiveRawUdpListenerConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, options, arena, len);
}
+extern const upb_MiniTable_File envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c
new file mode 100644
index 00000000..482880a2
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/metrics/v3/metrics_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/metrics/v3/metrics_service.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/grpc_service.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_MiniTable_Sub envoy_config_metrics_v3_MetricsServiceConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_metrics_v3_MetricsServiceConfig__fields[4] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msginit = {
+ &envoy_config_metrics_v3_MetricsServiceConfig_submsgs[0],
+ &envoy_config_metrics_v3_MetricsServiceConfig__fields[0],
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_metrics_v3_MetricsServiceConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_metrics_v3_metrics_service_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h
new file mode 100644
index 00000000..051c7126
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h
@@ -0,0 +1,136 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/metrics/v3/metrics_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_
+#define ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_metrics_v3_MetricsServiceConfig;
+typedef struct envoy_config_metrics_v3_MetricsServiceConfig envoy_config_metrics_v3_MetricsServiceConfig;
+extern const upb_MiniTable envoy_config_metrics_v3_MetricsServiceConfig_msginit;
+struct envoy_config_core_v3_GrpcService;
+struct google_protobuf_BoolValue;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+
+
+
+/* envoy.config.metrics.v3.MetricsServiceConfig */
+
+UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3_MetricsServiceConfig_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_MetricsServiceConfig*)_upb_Message_New(&envoy_config_metrics_v3_MetricsServiceConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3_MetricsServiceConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_MetricsServiceConfig* ret = envoy_config_metrics_v3_MetricsServiceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3_MetricsServiceConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_MetricsServiceConfig* ret = envoy_config_metrics_v3_MetricsServiceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_metrics_v3_MetricsServiceConfig_serialize(const envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_metrics_v3_MetricsServiceConfig_serialize_ex(const envoy_config_metrics_v3_MetricsServiceConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_metrics_v3_MetricsServiceConfig_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_GrpcService*);
+}
+UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_metrics_v3_MetricsServiceConfig_report_counters_as_deltas(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_transport_api_version(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_metrics_v3_MetricsServiceConfig_transport_api_version(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_clear_emit_tags_as_labels(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_emit_tags_as_labels(const envoy_config_metrics_v3_MetricsServiceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_grpc_service(envoy_config_metrics_v3_MetricsServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_metrics_v3_MetricsServiceConfig_mutable_grpc_service(envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_metrics_v3_MetricsServiceConfig_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_metrics_v3_MetricsServiceConfig_set_grpc_service(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_report_counters_as_deltas(envoy_config_metrics_v3_MetricsServiceConfig *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_metrics_v3_MetricsServiceConfig_mutable_report_counters_as_deltas(envoy_config_metrics_v3_MetricsServiceConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_metrics_v3_MetricsServiceConfig_report_counters_as_deltas(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_metrics_v3_MetricsServiceConfig_set_report_counters_as_deltas(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_transport_api_version(envoy_config_metrics_v3_MetricsServiceConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_config_metrics_v3_MetricsServiceConfig_set_emit_tags_as_labels(envoy_config_metrics_v3_MetricsServiceConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+
+extern const upb_MiniTable_File envoy_config_metrics_v3_metrics_service_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
index 26d00f14..6d846205 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/metrics/v3/stats.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
@@ -19,125 +19,146 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_metrics_v3_StatsSink_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsSink_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_StatsSink__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_StatsSink__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit = {
&envoy_config_metrics_v3_StatsSink_submsgs[0],
&envoy_config_metrics_v3_StatsSink__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsConfig_submsgs[4] = {
- &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
- &envoy_config_metrics_v3_StatsMatcher_msginit,
- &envoy_config_metrics_v3_TagSpecifier_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsConfig_submsgs[4] = {
+ {.submsg = &envoy_config_metrics_v3_TagSpecifier_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsMatcher_msginit},
+ {.submsg = &envoy_config_metrics_v3_HistogramBucketSettings_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_StatsConfig__fields[4] = {
- {1, UPB_SIZE(12, 24), 0, 2, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {3, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_metrics_v3_StatsConfig__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit = {
&envoy_config_metrics_v3_StatsConfig_submsgs[0],
&envoy_config_metrics_v3_StatsConfig__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_ListStringMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_StatsMatcher__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_StatsMatcher__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_StatsMatcher_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msginit = {
&envoy_config_metrics_v3_StatsMatcher_submsgs[0],
&envoy_config_metrics_v3_StatsMatcher__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout_field envoy_config_metrics_v3_TagSpecifier__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_TagSpecifier__fields[3] = {
+ {1, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_TagSpecifier_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msginit = {
NULL,
&envoy_config_metrics_v3_TagSpecifier__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_HistogramBucketSettings__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, _UPB_LABEL_PACKED},
+static const upb_MiniTable_Field envoy_config_metrics_v3_HistogramBucketSettings__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_HistogramBucketSettings_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msginit = {
&envoy_config_metrics_v3_HistogramBucketSettings_submsgs[0],
&envoy_config_metrics_v3_HistogramBucketSettings__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsdSink_submsgs[1] = {
- &envoy_config_core_v3_Address_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsdSink_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_StatsdSink__fields[3] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 11, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_StatsdSink__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_StatsdSink_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msginit = {
&envoy_config_metrics_v3_StatsdSink_submsgs[0],
&envoy_config_metrics_v3_StatsdSink__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &google_protobuf_UInt64Value_msginit,
+static const upb_MiniTable_Sub envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
-static const upb_msglayout_field envoy_config_metrics_v3_DogStatsdSink__fields[3] = {
- {1, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_DogStatsdSink__fields[3] = {
+ {1, UPB_SIZE(20, 32), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_DogStatsdSink_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msginit = {
&envoy_config_metrics_v3_DogStatsdSink_submsgs[0],
&envoy_config_metrics_v3_DogStatsdSink__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_metrics_v3_HystrixSink__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+static const upb_MiniTable_Field envoy_config_metrics_v3_HystrixSink__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_metrics_v3_HystrixSink_msginit = {
+const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msginit = {
NULL,
&envoy_config_metrics_v3_HystrixSink__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[8] = {
+ &envoy_config_metrics_v3_StatsSink_msginit,
+ &envoy_config_metrics_v3_StatsConfig_msginit,
+ &envoy_config_metrics_v3_StatsMatcher_msginit,
+ &envoy_config_metrics_v3_TagSpecifier_msginit,
+ &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
+ &envoy_config_metrics_v3_StatsdSink_msginit,
+ &envoy_config_metrics_v3_DogStatsdSink_msginit,
+ &envoy_config_metrics_v3_HystrixSink_msginit,
+};
+
+const upb_MiniTable_File envoy_config_metrics_v3_stats_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 8,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
index dab0415e..7928e493 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_
#define ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -36,68 +36,93 @@ typedef struct envoy_config_metrics_v3_HistogramBucketSettings envoy_config_metr
typedef struct envoy_config_metrics_v3_StatsdSink envoy_config_metrics_v3_StatsdSink;
typedef struct envoy_config_metrics_v3_DogStatsdSink envoy_config_metrics_v3_DogStatsdSink;
typedef struct envoy_config_metrics_v3_HystrixSink envoy_config_metrics_v3_HystrixSink;
-extern const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsMatcher_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_TagSpecifier_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HistogramBucketSettings_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_DogStatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HystrixSink_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsSink_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsConfig_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsMatcher_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_HistogramBucketSettings_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_StatsdSink_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_DogStatsdSink_msginit;
+extern const upb_MiniTable envoy_config_metrics_v3_HystrixSink_msginit;
struct envoy_config_core_v3_Address;
struct envoy_type_matcher_v3_ListStringMatcher;
struct envoy_type_matcher_v3_StringMatcher;
struct google_protobuf_Any;
struct google_protobuf_BoolValue;
struct google_protobuf_UInt64Value;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_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;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Address_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_UInt64Value_msginit;
+
/* envoy.config.metrics.v3.StatsSink */
-UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_StatsSink *)_upb_msg_new(&envoy_config_metrics_v3_StatsSink_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_StatsSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsSink_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_StatsSink *ret = envoy_config_metrics_v3_StatsSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsSink* ret = envoy_config_metrics_v3_StatsSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsSink* ret = envoy_config_metrics_v3_StatsSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_StatsSink *ret = envoy_config_metrics_v3_StatsSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_StatsSink_serialize(const envoy_config_metrics_v3_StatsSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_StatsSink_serialize(const envoy_config_metrics_v3_StatsSink *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_StatsSink_serialize_ex(const envoy_config_metrics_v3_StatsSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_metrics_v3_StatsSink_config_type_typed_config = 3,
envoy_config_metrics_v3_StatsSink_config_type_NOT_SET = 0
} envoy_config_metrics_v3_StatsSink_config_type_oneofcases;
-UPB_INLINE envoy_config_metrics_v3_StatsSink_config_type_oneofcases envoy_config_metrics_v3_StatsSink_config_type_case(const envoy_config_metrics_v3_StatsSink* msg) { return (envoy_config_metrics_v3_StatsSink_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_metrics_v3_StatsSink_name(const envoy_config_metrics_v3_StatsSink *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsSink_has_typed_config(const envoy_config_metrics_v3_StatsSink *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_typed_config(const envoy_config_metrics_v3_StatsSink *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE envoy_config_metrics_v3_StatsSink_config_type_oneofcases envoy_config_metrics_v3_StatsSink_config_type_case(const envoy_config_metrics_v3_StatsSink* msg) {
+ return (envoy_config_metrics_v3_StatsSink_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_name(const envoy_config_metrics_v3_StatsSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsSink_name(const envoy_config_metrics_v3_StatsSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsSink_has_typed_config(const envoy_config_metrics_v3_StatsSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsSink_clear_typed_config(const envoy_config_metrics_v3_StatsSink* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsSink_config_type_NOT_SET);
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_typed_config(const envoy_config_metrics_v3_StatsSink* msg) {
+ return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL);
+}
-UPB_INLINE void envoy_config_metrics_v3_StatsSink_set_name(envoy_config_metrics_v3_StatsSink *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_metrics_v3_StatsSink_set_name(envoy_config_metrics_v3_StatsSink *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_metrics_v3_StatsSink_set_typed_config(envoy_config_metrics_v3_StatsSink *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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_mutable_typed_config(envoy_config_metrics_v3_StatsSink *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_mutable_typed_config(envoy_config_metrics_v3_StatsSink* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_metrics_v3_StatsSink_typed_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsSink_set_typed_config(msg, sub);
}
@@ -106,54 +131,92 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_metrics_v3_StatsSink_mutable
/* envoy.config.metrics.v3.StatsConfig */
-UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsConfig_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_StatsConfig *)_upb_msg_new(&envoy_config_metrics_v3_StatsConfig_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsConfig_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_StatsConfig*)_upb_Message_New(&envoy_config_metrics_v3_StatsConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsConfig* ret = envoy_config_metrics_v3_StatsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsConfig* ret = envoy_config_metrics_v3_StatsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_StatsConfig *ret = envoy_config_metrics_v3_StatsConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_StatsConfig_serialize(const envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_StatsConfig *ret = envoy_config_metrics_v3_StatsConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_StatsConfig_serialize_ex(const envoy_config_metrics_v3_StatsConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_StatsConfig_serialize(const envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, arena, len);
+UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_config_metrics_v3_TagSpecifier* const* envoy_config_metrics_v3_StatsConfig_stats_tags(const envoy_config_metrics_v3_StatsConfig* msg, size_t* len) {
+ return (const envoy_config_metrics_v3_TagSpecifier* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_stats_matcher(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_metrics_v3_StatsMatcher*);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsConfig_clear_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE const envoy_config_metrics_v3_HistogramBucketSettings* const* envoy_config_metrics_v3_StatsConfig_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig* msg, size_t* len) {
+ return (const envoy_config_metrics_v3_HistogramBucketSettings* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
}
-UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_tags(const envoy_config_metrics_v3_StatsConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_metrics_v3_TagSpecifier* const* envoy_config_metrics_v3_StatsConfig_stats_tags(const envoy_config_metrics_v3_StatsConfig *msg, size_t *len) { return (const envoy_config_metrics_v3_TagSpecifier* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig_use_all_default_tags(const envoy_config_metrics_v3_StatsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_stats_matcher(const envoy_config_metrics_v3_StatsConfig *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_stats_matcher(const envoy_config_metrics_v3_StatsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_metrics_v3_StatsMatcher*); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsConfig_has_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_metrics_v3_HistogramBucketSettings* const* envoy_config_metrics_v3_StatsConfig_histogram_bucket_settings(const envoy_config_metrics_v3_StatsConfig *msg, size_t *len) { return (const envoy_config_metrics_v3_HistogramBucketSettings* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_mutable_stats_tags(envoy_config_metrics_v3_StatsConfig *msg, size_t *len) {
- return (envoy_config_metrics_v3_TagSpecifier**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_mutable_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t* len) {
+ return (envoy_config_metrics_v3_TagSpecifier**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_resize_stats_tags(envoy_config_metrics_v3_StatsConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_config_metrics_v3_TagSpecifier**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier** envoy_config_metrics_v3_StatsConfig_resize_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_metrics_v3_TagSpecifier**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_StatsConfig_add_stats_tags(envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena) {
- struct envoy_config_metrics_v3_TagSpecifier* sub = (struct envoy_config_metrics_v3_TagSpecifier*)_upb_msg_new(&envoy_config_metrics_v3_TagSpecifier_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_StatsConfig_add_stats_tags(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) {
+ struct envoy_config_metrics_v3_TagSpecifier* sub = (struct envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_metrics_v3_StatsConfig_set_use_all_default_tags(envoy_config_metrics_v3_StatsConfig *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_metrics_v3_StatsConfig_mutable_use_all_default_tags(envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig_mutable_use_all_default_tags(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_metrics_v3_StatsConfig_use_all_default_tags(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsConfig_set_use_all_default_tags(msg, sub);
}
@@ -161,88 +224,120 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_metrics_v3_StatsConfig
}
UPB_INLINE void envoy_config_metrics_v3_StatsConfig_set_stats_matcher(envoy_config_metrics_v3_StatsConfig *msg, envoy_config_metrics_v3_StatsMatcher* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_metrics_v3_StatsMatcher*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_metrics_v3_StatsMatcher*) = value;
}
-UPB_INLINE struct envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_mutable_stats_matcher(envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsConfig_mutable_stats_matcher(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) {
struct envoy_config_metrics_v3_StatsMatcher* sub = (struct envoy_config_metrics_v3_StatsMatcher*)envoy_config_metrics_v3_StatsConfig_stats_matcher(msg);
if (sub == NULL) {
- sub = (struct envoy_config_metrics_v3_StatsMatcher*)_upb_msg_new(&envoy_config_metrics_v3_StatsMatcher_msginit, arena);
+ sub = (struct envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsConfig_set_stats_matcher(msg, sub);
}
return sub;
}
-UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_mutable_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig *msg, size_t *len) {
+UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_mutable_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t* len) {
return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
-UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_resize_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings** envoy_config_metrics_v3_StatsConfig_resize_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_metrics_v3_HistogramBucketSettings**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_StatsConfig_add_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena) {
- struct envoy_config_metrics_v3_HistogramBucketSettings* sub = (struct envoy_config_metrics_v3_HistogramBucketSettings*)_upb_msg_new(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_StatsConfig_add_histogram_bucket_settings(envoy_config_metrics_v3_StatsConfig* msg, upb_Arena* arena) {
+ struct envoy_config_metrics_v3_HistogramBucketSettings* sub = (struct envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.config.metrics.v3.StatsMatcher */
-UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMatcher_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_StatsMatcher *)_upb_msg_new(&envoy_config_metrics_v3_StatsMatcher_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMatcher_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_StatsMatcher*)_upb_Message_New(&envoy_config_metrics_v3_StatsMatcher_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_StatsMatcher *ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsMatcher* ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsMatcher* ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_StatsMatcher *ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_StatsMatcher_serialize(const envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_StatsMatcher_serialize(const envoy_config_metrics_v3_StatsMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_StatsMatcher_serialize_ex(const envoy_config_metrics_v3_StatsMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_metrics_v3_StatsMatcher_stats_matcher_reject_all = 1,
envoy_config_metrics_v3_StatsMatcher_stats_matcher_exclusion_list = 2,
envoy_config_metrics_v3_StatsMatcher_stats_matcher_inclusion_list = 3,
envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET = 0
} envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases;
-UPB_INLINE envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases envoy_config_metrics_v3_StatsMatcher_stats_matcher_case(const envoy_config_metrics_v3_StatsMatcher* msg) { return (envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_reject_all(const envoy_config_metrics_v3_StatsMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_reject_all(const envoy_config_metrics_v3_StatsMatcher *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, false); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_exclusion_list(const envoy_config_metrics_v3_StatsMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_exclusion_list(const envoy_config_metrics_v3_StatsMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_inclusion_list(const envoy_config_metrics_v3_StatsMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
-UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_inclusion_list(const envoy_config_metrics_v3_StatsMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+UPB_INLINE envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases envoy_config_metrics_v3_StatsMatcher_stats_matcher_case(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return (envoy_config_metrics_v3_StatsMatcher_stats_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_reject_all(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, false);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_exclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsMatcher_has_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_clear_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsMatcher_stats_matcher_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_inclusion_list(const envoy_config_metrics_v3_StatsMatcher* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_reject_all(envoy_config_metrics_v3_StatsMatcher *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_exclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, struct envoy_type_matcher_v3_ListStringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_exclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_exclusion_list(envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_ListStringMatcher* sub = (struct envoy_type_matcher_v3_ListStringMatcher*)envoy_config_metrics_v3_StatsMatcher_exclusion_list(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsMatcher_set_exclusion_list(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_metrics_v3_StatsMatcher_set_inclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, struct envoy_type_matcher_v3_ListStringMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_ListStringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_inclusion_list(envoy_config_metrics_v3_StatsMatcher *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_v3_StatsMatcher_mutable_inclusion_list(envoy_config_metrics_v3_StatsMatcher* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_ListStringMatcher* sub = (struct envoy_type_matcher_v3_ListStringMatcher*)envoy_config_metrics_v3_StatsMatcher_inclusion_list(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListStringMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsMatcher_set_inclusion_list(msg, sub);
}
@@ -251,202 +346,317 @@ UPB_INLINE struct envoy_type_matcher_v3_ListStringMatcher* envoy_config_metrics_
/* envoy.config.metrics.v3.TagSpecifier */
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpecifier_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_TagSpecifier *)_upb_msg_new(&envoy_config_metrics_v3_TagSpecifier_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpecifier_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_TagSpecifier*)_upb_Message_New(&envoy_config_metrics_v3_TagSpecifier_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpecifier_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_TagSpecifier *ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpecifier_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_TagSpecifier* ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpecifier_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_TagSpecifier* ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpecifier_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_TagSpecifier *ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_TagSpecifier_serialize(const envoy_config_metrics_v3_TagSpecifier* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_TagSpecifier_serialize(const envoy_config_metrics_v3_TagSpecifier *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_TagSpecifier_serialize_ex(const envoy_config_metrics_v3_TagSpecifier* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_metrics_v3_TagSpecifier_tag_value_regex = 2,
envoy_config_metrics_v3_TagSpecifier_tag_value_fixed_value = 3,
envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET = 0
} envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases;
-UPB_INLINE envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases envoy_config_metrics_v3_TagSpecifier_tag_value_case(const envoy_config_metrics_v3_TagSpecifier* msg) { return (envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_metrics_v3_TagSpecifier_tag_name(const envoy_config_metrics_v3_TagSpecifier *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_regex(const envoy_config_metrics_v3_TagSpecifier *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 2; }
-UPB_INLINE upb_strview envoy_config_metrics_v3_TagSpecifier_regex(const envoy_config_metrics_v3_TagSpecifier *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), UPB_SIZE(16, 32), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_fixed_value(const envoy_config_metrics_v3_TagSpecifier *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 3; }
-UPB_INLINE upb_strview envoy_config_metrics_v3_TagSpecifier_fixed_value(const envoy_config_metrics_v3_TagSpecifier *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), UPB_SIZE(16, 32), 3, upb_strview_make("", strlen(""))); }
+UPB_INLINE envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases envoy_config_metrics_v3_TagSpecifier_tag_value_case(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return (envoy_config_metrics_v3_TagSpecifier_tag_value_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_tag_name(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_tag_name(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_regex(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_regex(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_regex(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_metrics_v3_TagSpecifier_has_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_clear_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_TagSpecifier_tag_value_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_TagSpecifier_fixed_value(const envoy_config_metrics_v3_TagSpecifier* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
-UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_tag_name(envoy_config_metrics_v3_TagSpecifier *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_tag_name(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_regex(envoy_config_metrics_v3_TagSpecifier *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), value, UPB_SIZE(16, 32), 2);
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_regex(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_fixed_value(envoy_config_metrics_v3_TagSpecifier *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), value, UPB_SIZE(16, 32), 3);
+UPB_INLINE void envoy_config_metrics_v3_TagSpecifier_set_fixed_value(envoy_config_metrics_v3_TagSpecifier *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
}
/* envoy.config.metrics.v3.HistogramBucketSettings */
-UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics_v3_HistogramBucketSettings_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_HistogramBucketSettings *)_upb_msg_new(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_HistogramBucketSettings_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_HistogramBucketSettings*)_upb_Message_New(&envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics_v3_HistogramBucketSettings_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_HistogramBucketSettings *ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_HistogramBucketSettings_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_HistogramBucketSettings* ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics_v3_HistogramBucketSettings_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_HistogramBucketSettings* ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics_v3_HistogramBucketSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_HistogramBucketSettings *ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_HistogramBucketSettings_serialize(const envoy_config_metrics_v3_HistogramBucketSettings* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_HistogramBucketSettings_serialize(const envoy_config_metrics_v3_HistogramBucketSettings *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_HistogramBucketSettings_serialize_ex(const envoy_config_metrics_v3_HistogramBucketSettings* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_has_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*);
+}
+UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_clear_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE double const* envoy_config_metrics_v3_HistogramBucketSettings_buckets(const envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* len) {
+ return (double const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-
-UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_has_match(const envoy_config_metrics_v3_HistogramBucketSettings *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_match(const envoy_config_metrics_v3_HistogramBucketSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*); }
-UPB_INLINE double const* envoy_config_metrics_v3_HistogramBucketSettings_buckets(const envoy_config_metrics_v3_HistogramBucketSettings *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE void envoy_config_metrics_v3_HistogramBucketSettings_set_match(envoy_config_metrics_v3_HistogramBucketSettings *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_StringMatcher*) = value;
}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_mutable_match(envoy_config_metrics_v3_HistogramBucketSettings *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_metrics_v3_HistogramBucketSettings_mutable_match(envoy_config_metrics_v3_HistogramBucketSettings* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_metrics_v3_HistogramBucketSettings_match(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_HistogramBucketSettings_set_match(msg, sub);
}
return sub;
}
-UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_mutable_buckets(envoy_config_metrics_v3_HistogramBucketSettings *msg, size_t *len) {
+UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_mutable_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t* len) {
return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_resize_buckets(envoy_config_metrics_v3_HistogramBucketSettings *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
+UPB_INLINE double* envoy_config_metrics_v3_HistogramBucketSettings_resize_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, size_t len, upb_Arena* arena) {
+ return (double*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_add_buckets(envoy_config_metrics_v3_HistogramBucketSettings *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(8, 16), 3, &val,
- arena);
+UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_add_buckets(envoy_config_metrics_v3_HistogramBucketSettings* msg, double val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
}
/* envoy.config.metrics.v3.StatsdSink */
-UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSink_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_StatsdSink *)_upb_msg_new(&envoy_config_metrics_v3_StatsdSink_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSink_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_StatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_StatsdSink_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSink_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_StatsdSink *ret = envoy_config_metrics_v3_StatsdSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsdSink* ret = envoy_config_metrics_v3_StatsdSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_StatsdSink* ret = envoy_config_metrics_v3_StatsdSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_StatsdSink *ret = envoy_config_metrics_v3_StatsdSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_StatsdSink_serialize(const envoy_config_metrics_v3_StatsdSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_StatsdSink_serialize(const envoy_config_metrics_v3_StatsdSink *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_StatsdSink_serialize_ex(const envoy_config_metrics_v3_StatsdSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_metrics_v3_StatsdSink_statsd_specifier_address = 1,
envoy_config_metrics_v3_StatsdSink_statsd_specifier_tcp_cluster_name = 2,
envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET = 0
} envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases;
-UPB_INLINE envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases envoy_config_metrics_v3_StatsdSink_statsd_specifier_case(const envoy_config_metrics_v3_StatsdSink* msg) { return (envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(16, 32), int32_t); }
-
-UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_address(const envoy_config_metrics_v3_StatsdSink *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 1; }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_address(const envoy_config_metrics_v3_StatsdSink *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(8, 16), UPB_SIZE(16, 32), 1, NULL); }
-UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink *msg) { return _upb_getoneofcase(msg, UPB_SIZE(16, 32)) == 2; }
-UPB_INLINE upb_strview envoy_config_metrics_v3_StatsdSink_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), UPB_SIZE(16, 32), 2, upb_strview_make("", strlen(""))); }
-UPB_INLINE upb_strview envoy_config_metrics_v3_StatsdSink_prefix(const envoy_config_metrics_v3_StatsdSink *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases envoy_config_metrics_v3_StatsdSink_statsd_specifier_case(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return (envoy_config_metrics_v3_StatsdSink_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_address(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_address(const envoy_config_metrics_v3_StatsdSink* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_address(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_metrics_v3_StatsdSink_has_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_metrics_v3_StatsdSink_statsd_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsdSink_tcp_cluster_name(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_metrics_v3_StatsdSink_clear_prefix(const envoy_config_metrics_v3_StatsdSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_StatsdSink_prefix(const envoy_config_metrics_v3_StatsdSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_address(envoy_config_metrics_v3_StatsdSink *msg, struct envoy_config_core_v3_Address* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(8, 16), value, UPB_SIZE(16, 32), 1);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_mutable_address(envoy_config_metrics_v3_StatsdSink *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_StatsdSink_mutable_address(envoy_config_metrics_v3_StatsdSink* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_metrics_v3_StatsdSink_address(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_StatsdSink_set_address(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_tcp_cluster_name(envoy_config_metrics_v3_StatsdSink *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(8, 16), value, UPB_SIZE(16, 32), 2);
+UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_tcp_cluster_name(envoy_config_metrics_v3_StatsdSink *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_prefix(envoy_config_metrics_v3_StatsdSink *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_metrics_v3_StatsdSink_set_prefix(envoy_config_metrics_v3_StatsdSink *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
/* envoy.config.metrics.v3.DogStatsdSink */
-UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogStatsdSink_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_DogStatsdSink *)_upb_msg_new(&envoy_config_metrics_v3_DogStatsdSink_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogStatsdSink_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_DogStatsdSink*)_upb_Message_New(&envoy_config_metrics_v3_DogStatsdSink_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogStatsdSink_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_DogStatsdSink *ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogStatsdSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_DogStatsdSink* ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogStatsdSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_DogStatsdSink* ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogStatsdSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_DogStatsdSink *ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_DogStatsdSink_serialize(const envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_DogStatsdSink_serialize(const envoy_config_metrics_v3_DogStatsdSink *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_DogStatsdSink_serialize_ex(const envoy_config_metrics_v3_DogStatsdSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_address = 1,
envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_NOT_SET = 0
} envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases;
-UPB_INLINE envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_case(const envoy_config_metrics_v3_DogStatsdSink* msg) { return (envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
-
-UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_address(const envoy_config_metrics_v3_DogStatsdSink *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 1; }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_address(const envoy_config_metrics_v3_DogStatsdSink *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(16, 32), UPB_SIZE(20, 40), 1, NULL); }
-UPB_INLINE upb_strview envoy_config_metrics_v3_DogStatsdSink_prefix(const envoy_config_metrics_v3_DogStatsdSink *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt64Value*); }
+UPB_INLINE envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_case(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return (envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_address(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_address(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), 0, UPB_SIZE(4, 4), envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_address(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), UPB_SIZE(4, 4), 1, NULL);
+}
+UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_prefix(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_metrics_v3_DogStatsdSink_prefix(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_metrics_v3_DogStatsdSink_has_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_clear_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_max_bytes_per_datagram(const envoy_config_metrics_v3_DogStatsdSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt64Value*);
+}
UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_address(envoy_config_metrics_v3_DogStatsdSink *msg, struct envoy_config_core_v3_Address* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(16, 32), value, UPB_SIZE(20, 40), 1);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_Address*, UPB_SIZE(20, 32), value, UPB_SIZE(4, 4), 1);
}
-UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_mutable_address(envoy_config_metrics_v3_DogStatsdSink *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_metrics_v3_DogStatsdSink_mutable_address(envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_metrics_v3_DogStatsdSink_address(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ sub = (struct envoy_config_core_v3_Address*)_upb_Message_New(&envoy_config_core_v3_Address_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_DogStatsdSink_set_address(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_prefix(envoy_config_metrics_v3_DogStatsdSink *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_prefix(envoy_config_metrics_v3_DogStatsdSink *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_metrics_v3_DogStatsdSink_set_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink *msg, struct google_protobuf_UInt64Value* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt64Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_UInt64Value*) = value;
}
-UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_mutable_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsdSink_mutable_max_bytes_per_datagram(envoy_config_metrics_v3_DogStatsdSink* msg, upb_Arena* arena) {
struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_metrics_v3_DogStatsdSink_max_bytes_per_datagram(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
if (!sub) return NULL;
envoy_config_metrics_v3_DogStatsdSink_set_max_bytes_per_datagram(msg, sub);
}
@@ -455,30 +665,48 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_metrics_v3_DogStatsd
/* envoy.config.metrics.v3.HystrixSink */
-UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixSink_new(upb_arena *arena) {
- return (envoy_config_metrics_v3_HystrixSink *)_upb_msg_new(&envoy_config_metrics_v3_HystrixSink_msginit, arena);
+UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixSink_new(upb_Arena* arena) {
+ return (envoy_config_metrics_v3_HystrixSink*)_upb_Message_New(&envoy_config_metrics_v3_HystrixSink_msginit, arena);
}
-UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixSink_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_metrics_v3_HystrixSink *ret = envoy_config_metrics_v3_HystrixSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_metrics_v3_HystrixSink* ret = envoy_config_metrics_v3_HystrixSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_metrics_v3_HystrixSink* ret = envoy_config_metrics_v3_HystrixSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_metrics_v3_HystrixSink *ret = envoy_config_metrics_v3_HystrixSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_metrics_v3_HystrixSink_serialize(const envoy_config_metrics_v3_HystrixSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_metrics_v3_HystrixSink_serialize(const envoy_config_metrics_v3_HystrixSink *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, arena, len);
+UPB_INLINE char* envoy_config_metrics_v3_HystrixSink_serialize_ex(const envoy_config_metrics_v3_HystrixSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_metrics_v3_HystrixSink_clear_num_buckets(const envoy_config_metrics_v3_HystrixSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0;
+}
+UPB_INLINE int64_t envoy_config_metrics_v3_HystrixSink_num_buckets(const envoy_config_metrics_v3_HystrixSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t);
}
-
-UPB_INLINE int64_t envoy_config_metrics_v3_HystrixSink_num_buckets(const envoy_config_metrics_v3_HystrixSink *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
UPB_INLINE void envoy_config_metrics_v3_HystrixSink_set_num_buckets(envoy_config_metrics_v3_HystrixSink *msg, int64_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
+extern const upb_MiniTable_File envoy_config_metrics_v3_stats_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
index a306e71e..0583c32c 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/overload/v3/overload.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -18,123 +18,156 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_overload_v3_ResourceMonitor_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_overload_v3_ResourceMonitor_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_ResourceMonitor__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_overload_v3_ResourceMonitor__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit = {
+const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msginit = {
&envoy_config_overload_v3_ResourceMonitor_submsgs[0],
&envoy_config_overload_v3_ResourceMonitor__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_overload_v3_ThresholdTrigger__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+static const upb_MiniTable_Field envoy_config_overload_v3_ThresholdTrigger__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit = {
+const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msginit = {
NULL,
&envoy_config_overload_v3_ThresholdTrigger__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_overload_v3_ScaledTrigger__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
+static const upb_MiniTable_Field envoy_config_overload_v3_ScaledTrigger__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit = {
+const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msginit = {
NULL,
&envoy_config_overload_v3_ScaledTrigger__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_overload_v3_Trigger_submsgs[2] = {
- &envoy_config_overload_v3_ScaledTrigger_msginit,
- &envoy_config_overload_v3_ThresholdTrigger_msginit,
+static const upb_MiniTable_Sub envoy_config_overload_v3_Trigger_submsgs[2] = {
+ {.submsg = &envoy_config_overload_v3_ThresholdTrigger_msginit},
+ {.submsg = &envoy_config_overload_v3_ScaledTrigger_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_Trigger__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},
+static const upb_MiniTable_Field envoy_config_overload_v3_Trigger__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_Trigger_msginit = {
+const upb_MiniTable envoy_config_overload_v3_Trigger_msginit = {
&envoy_config_overload_v3_Trigger_submsgs[0],
&envoy_config_overload_v3_Trigger__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = {
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
+static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = {
+ {.submsg = &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit = {
+const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit = {
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[0],
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 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},
+static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit = {
+const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit = {
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[0],
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_overload_v3_OverloadAction_submsgs[2] = {
- &envoy_config_overload_v3_Trigger_msginit,
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadAction_submsgs[2] = {
+ {.submsg = &envoy_config_overload_v3_Trigger_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_OverloadAction__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_overload_v3_OverloadAction__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit = {
+const upb_MiniTable envoy_config_overload_v3_OverloadAction_msginit = {
&envoy_config_overload_v3_OverloadAction_submsgs[0],
&envoy_config_overload_v3_OverloadAction__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_overload_v3_OverloadManager_submsgs[3] = {
- &envoy_config_overload_v3_OverloadAction_msginit,
- &envoy_config_overload_v3_ResourceMonitor_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Field envoy_config_overload_v3_BufferFactoryConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-static const upb_msglayout_field envoy_config_overload_v3_OverloadManager__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msginit = {
+ NULL,
+ &envoy_config_overload_v3_BufferFactoryConfig__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadManager_submsgs[4] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_overload_v3_ResourceMonitor_msginit},
+ {.submsg = &envoy_config_overload_v3_OverloadAction_msginit},
+ {.submsg = &envoy_config_overload_v3_BufferFactoryConfig_msginit},
};
-const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit = {
+static const upb_MiniTable_Field envoy_config_overload_v3_OverloadManager__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit = {
&envoy_config_overload_v3_OverloadManager_submsgs[0],
&envoy_config_overload_v3_OverloadManager__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[9] = {
+ &envoy_config_overload_v3_ResourceMonitor_msginit,
+ &envoy_config_overload_v3_ThresholdTrigger_msginit,
+ &envoy_config_overload_v3_ScaledTrigger_msginit,
+ &envoy_config_overload_v3_Trigger_msginit,
+ &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit,
+ &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
+ &envoy_config_overload_v3_OverloadAction_msginit,
+ &envoy_config_overload_v3_BufferFactoryConfig_msginit,
+ &envoy_config_overload_v3_OverloadManager_msginit,
+};
+
+const upb_MiniTable_File envoy_config_overload_v3_overload_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 9,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
index d800aa97..70555b69 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_
#define ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,7 @@ struct envoy_config_overload_v3_Trigger;
struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig;
struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer;
struct envoy_config_overload_v3_OverloadAction;
+struct envoy_config_overload_v3_BufferFactoryConfig;
struct envoy_config_overload_v3_OverloadManager;
typedef struct envoy_config_overload_v3_ResourceMonitor envoy_config_overload_v3_ResourceMonitor;
typedef struct envoy_config_overload_v3_ThresholdTrigger envoy_config_overload_v3_ThresholdTrigger;
@@ -35,21 +36,23 @@ typedef struct envoy_config_overload_v3_Trigger envoy_config_overload_v3_Trigger
typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig envoy_config_overload_v3_ScaleTimersOverloadActionConfig;
typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer;
typedef struct envoy_config_overload_v3_OverloadAction envoy_config_overload_v3_OverloadAction;
+typedef struct envoy_config_overload_v3_BufferFactoryConfig envoy_config_overload_v3_BufferFactoryConfig;
typedef struct envoy_config_overload_v3_OverloadManager envoy_config_overload_v3_OverloadManager;
-extern const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_Trigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_ResourceMonitor_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_ThresholdTrigger_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_Trigger_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_OverloadAction_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_BufferFactoryConfig_msginit;
+extern const upb_MiniTable envoy_config_overload_v3_OverloadManager_msginit;
struct envoy_type_v3_Percent;
struct google_protobuf_Any;
struct google_protobuf_Duration;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
typedef enum {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_UNSPECIFIED = 0,
@@ -59,46 +62,71 @@ typedef enum {
} envoy_config_overload_v3_ScaleTimersOverloadActionConfig_TimerType;
+
/* envoy.config.overload.v3.ResourceMonitor */
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_new(upb_arena *arena) {
- return (envoy_config_overload_v3_ResourceMonitor *)_upb_msg_new(&envoy_config_overload_v3_ResourceMonitor_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_ResourceMonitor_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_ResourceMonitor *ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_ResourceMonitor_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_ResourceMonitor* ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_ResourceMonitor_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_ResourceMonitor* ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_ResourceMonitor *ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_ResourceMonitor_serialize(const envoy_config_overload_v3_ResourceMonitor* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_ResourceMonitor_serialize(const envoy_config_overload_v3_ResourceMonitor *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_ResourceMonitor_serialize_ex(const envoy_config_overload_v3_ResourceMonitor* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_overload_v3_ResourceMonitor_config_type_typed_config = 3,
envoy_config_overload_v3_ResourceMonitor_config_type_NOT_SET = 0
} envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases;
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases envoy_config_overload_v3_ResourceMonitor_config_type_case(const envoy_config_overload_v3_ResourceMonitor* msg) { return (envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_overload_v3_ResourceMonitor_name(const envoy_config_overload_v3_ResourceMonitor *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_overload_v3_ResourceMonitor_has_typed_config(const envoy_config_overload_v3_ResourceMonitor *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_typed_config(const envoy_config_overload_v3_ResourceMonitor *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases envoy_config_overload_v3_ResourceMonitor_config_type_case(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ return (envoy_config_overload_v3_ResourceMonitor_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_name(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_overload_v3_ResourceMonitor_name(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_overload_v3_ResourceMonitor_has_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_clear_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_ResourceMonitor_config_type_NOT_SET);
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_typed_config(const envoy_config_overload_v3_ResourceMonitor* msg) {
+ return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL);
+}
-UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_name(envoy_config_overload_v3_ResourceMonitor *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_name(envoy_config_overload_v3_ResourceMonitor *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_overload_v3_ResourceMonitor_set_typed_config(envoy_config_overload_v3_ResourceMonitor *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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_mutable_typed_config(envoy_config_overload_v3_ResourceMonitor *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_mutable_typed_config(envoy_config_overload_v3_ResourceMonitor* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_ResourceMonitor_typed_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_ResourceMonitor_set_typed_config(msg, sub);
}
@@ -107,25 +135,41 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_ResourceMonitor_
/* envoy.config.overload.v3.ThresholdTrigger */
-UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_new(upb_arena *arena) {
- return (envoy_config_overload_v3_ThresholdTrigger *)_upb_msg_new(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_ThresholdTrigger_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_ThresholdTrigger *ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_ThresholdTrigger_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_ThresholdTrigger* ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_ThresholdTrigger_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_ThresholdTrigger* ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_ThresholdTrigger *ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_ThresholdTrigger_serialize(const envoy_config_overload_v3_ThresholdTrigger* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_ThresholdTrigger_serialize(const envoy_config_overload_v3_ThresholdTrigger *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_ThresholdTrigger_serialize_ex(const envoy_config_overload_v3_ThresholdTrigger* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_clear_value(const envoy_config_overload_v3_ThresholdTrigger* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+UPB_INLINE double envoy_config_overload_v3_ThresholdTrigger_value(const envoy_config_overload_v3_ThresholdTrigger* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double);
}
-
-UPB_INLINE double envoy_config_overload_v3_ThresholdTrigger_value(const envoy_config_overload_v3_ThresholdTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_set_value(envoy_config_overload_v3_ThresholdTrigger *msg, double value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
@@ -133,26 +177,47 @@ UPB_INLINE void envoy_config_overload_v3_ThresholdTrigger_set_value(envoy_config
/* envoy.config.overload.v3.ScaledTrigger */
-UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_new(upb_arena *arena) {
- return (envoy_config_overload_v3_ScaledTrigger *)_upb_msg_new(&envoy_config_overload_v3_ScaledTrigger_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_ScaledTrigger_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_ScaledTrigger *ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_ScaledTrigger_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaledTrigger* ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_ScaledTrigger_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaledTrigger* ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_ScaledTrigger *ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_ScaledTrigger_serialize(const envoy_config_overload_v3_ScaledTrigger* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_ScaledTrigger_serialize(const envoy_config_overload_v3_ScaledTrigger *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_ScaledTrigger_serialize_ex(const envoy_config_overload_v3_ScaledTrigger* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_clear_scaling_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_scaling_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double);
+}
+UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_clear_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = 0;
+}
+UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double);
}
-
-UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_scaling_threshold(const envoy_config_overload_v3_ScaledTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-UPB_INLINE double envoy_config_overload_v3_ScaledTrigger_saturation_threshold(const envoy_config_overload_v3_ScaledTrigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_set_scaling_threshold(envoy_config_overload_v3_ScaledTrigger *msg, double value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
@@ -163,59 +228,90 @@ UPB_INLINE void envoy_config_overload_v3_ScaledTrigger_set_saturation_threshold(
/* envoy.config.overload.v3.Trigger */
-UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_new(upb_arena *arena) {
- return (envoy_config_overload_v3_Trigger *)_upb_msg_new(&envoy_config_overload_v3_Trigger_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_Trigger *ret = envoy_config_overload_v3_Trigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_Trigger* ret = envoy_config_overload_v3_Trigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_Trigger* ret = envoy_config_overload_v3_Trigger_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_Trigger *ret = envoy_config_overload_v3_Trigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_Trigger_serialize(const envoy_config_overload_v3_Trigger* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_Trigger_serialize(const envoy_config_overload_v3_Trigger *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_Trigger_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_Trigger_serialize_ex(const envoy_config_overload_v3_Trigger* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_overload_v3_Trigger_trigger_oneof_threshold = 2,
envoy_config_overload_v3_Trigger_trigger_oneof_scaled = 3,
envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET = 0
} envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases;
-UPB_INLINE envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases envoy_config_overload_v3_Trigger_trigger_oneof_case(const envoy_config_overload_v3_Trigger* msg) { return (envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_overload_v3_Trigger_name(const envoy_config_overload_v3_Trigger *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_overload_v3_Trigger_has_threshold(const envoy_config_overload_v3_Trigger *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE const envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_threshold(const envoy_config_overload_v3_Trigger *msg) { return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); }
-UPB_INLINE bool envoy_config_overload_v3_Trigger_has_scaled(const envoy_config_overload_v3_Trigger *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_scaled(const envoy_config_overload_v3_Trigger *msg) { return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases envoy_config_overload_v3_Trigger_trigger_oneof_case(const envoy_config_overload_v3_Trigger* msg) {
+ return (envoy_config_overload_v3_Trigger_trigger_oneof_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_overload_v3_Trigger_clear_name(const envoy_config_overload_v3_Trigger* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_overload_v3_Trigger_name(const envoy_config_overload_v3_Trigger* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_overload_v3_Trigger_has_threshold(const envoy_config_overload_v3_Trigger* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_overload_v3_Trigger_clear_threshold(const envoy_config_overload_v3_Trigger* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET);
+}
+UPB_INLINE const envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_threshold(const envoy_config_overload_v3_Trigger* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_overload_v3_Trigger_has_scaled(const envoy_config_overload_v3_Trigger* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_overload_v3_Trigger_clear_scaled(const envoy_config_overload_v3_Trigger* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_overload_v3_Trigger_trigger_oneof_NOT_SET);
+}
+UPB_INLINE const envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_scaled(const envoy_config_overload_v3_Trigger* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 3, NULL);
+}
-UPB_INLINE void envoy_config_overload_v3_Trigger_set_name(envoy_config_overload_v3_Trigger *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_overload_v3_Trigger_set_name(envoy_config_overload_v3_Trigger *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_overload_v3_Trigger_set_threshold(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ThresholdTrigger* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+ UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ThresholdTrigger*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_mutable_threshold(envoy_config_overload_v3_Trigger *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_Trigger_mutable_threshold(envoy_config_overload_v3_Trigger* msg, upb_Arena* arena) {
struct envoy_config_overload_v3_ThresholdTrigger* sub = (struct envoy_config_overload_v3_ThresholdTrigger*)envoy_config_overload_v3_Trigger_threshold(msg);
if (sub == NULL) {
- sub = (struct envoy_config_overload_v3_ThresholdTrigger*)_upb_msg_new(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena);
+ sub = (struct envoy_config_overload_v3_ThresholdTrigger*)_upb_Message_New(&envoy_config_overload_v3_ThresholdTrigger_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_Trigger_set_threshold(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_overload_v3_Trigger_set_scaled(envoy_config_overload_v3_Trigger *msg, envoy_config_overload_v3_ScaledTrigger* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+ UPB_WRITE_ONEOF(msg, envoy_config_overload_v3_ScaledTrigger*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_mutable_scaled(envoy_config_overload_v3_Trigger *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Trigger_mutable_scaled(envoy_config_overload_v3_Trigger* msg, upb_Arena* arena) {
struct envoy_config_overload_v3_ScaledTrigger* sub = (struct envoy_config_overload_v3_ScaledTrigger*)envoy_config_overload_v3_Trigger_scaled(msg);
if (sub == NULL) {
- sub = (struct envoy_config_overload_v3_ScaledTrigger*)_upb_msg_new(&envoy_config_overload_v3_ScaledTrigger_msginit, arena);
+ sub = (struct envoy_config_overload_v3_ScaledTrigger*)_upb_Message_New(&envoy_config_overload_v3_ScaledTrigger_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_Trigger_set_scaled(msg, sub);
}
@@ -224,96 +320,144 @@ UPB_INLINE struct envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_
/* envoy.config.overload.v3.ScaleTimersOverloadActionConfig */
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(upb_arena *arena) {
- return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig *)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_ScaleTimersOverloadActionConfig *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaleTimersOverloadActionConfig* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaleTimersOverloadActionConfig* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_ScaleTimersOverloadActionConfig *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize_ex(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_has_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_clear_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* len) {
+ return (const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_has_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_timer_scale_factors(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t *len) { return (const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_mutable_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t *len) {
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_mutable_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t* len) {
return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_resize_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer** envoy_config_overload_v3_ScaleTimersOverloadActionConfig_resize_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_add_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, upb_arena *arena) {
- struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* sub = (struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_add_timer_scale_factors(envoy_config_overload_v3_ScaleTimersOverloadActionConfig* msg, upb_Arena* arena) {
+ struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* sub = (struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer */
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(upb_arena *arena) {
- return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *)_upb_msg_new(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer*)_upb_Message_New(&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize_ex(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_min_timeout = 2,
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_min_scale = 3,
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET = 0
} envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases;
-UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_case(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) { return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE int32_t envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 2, NULL); }
-UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
-UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Percent*, UPB_SIZE(4, 8), UPB_SIZE(8, 16), 3, NULL); }
+UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_case(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return (envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_timer(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET);
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_has_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_clear_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL);
+}
UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_timer(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct google_protobuf_Duration* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 2);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_timeout(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_timeout(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, struct envoy_type_v3_Percent* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(4, 8), value, UPB_SIZE(8, 16), 3);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Percent*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_mutable_min_scale(envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* msg, upb_Arena* arena) {
struct envoy_type_v3_Percent* sub = (struct envoy_type_v3_Percent*)envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_min_scale(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_Percent*)_upb_msg_new(&envoy_type_v3_Percent_msginit, arena);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_New(&envoy_type_v3_Percent_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_set_min_scale(msg, sub);
}
@@ -322,126 +466,251 @@ UPB_INLINE struct envoy_type_v3_Percent* envoy_config_overload_v3_ScaleTimersOve
/* envoy.config.overload.v3.OverloadAction */
-UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_new(upb_arena *arena) {
- return (envoy_config_overload_v3_OverloadAction *)_upb_msg_new(&envoy_config_overload_v3_OverloadAction_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadAction_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msginit, arena);
}
-UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_OverloadAction *ret = envoy_config_overload_v3_OverloadAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadAction_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_OverloadAction* ret = envoy_config_overload_v3_OverloadAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_OverloadAction* ret = envoy_config_overload_v3_OverloadAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_OverloadAction *ret = envoy_config_overload_v3_OverloadAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_overload_v3_OverloadAction_serialize(const envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_config_overload_v3_OverloadAction_serialize(const envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, arena, len);
+UPB_INLINE char* envoy_config_overload_v3_OverloadAction_serialize_ex(const envoy_config_overload_v3_OverloadAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_name(const envoy_config_overload_v3_OverloadAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_overload_v3_OverloadAction_name(const envoy_config_overload_v3_OverloadAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_triggers(const envoy_config_overload_v3_OverloadAction* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_triggers(const envoy_config_overload_v3_OverloadAction* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const envoy_config_overload_v3_Trigger* const* envoy_config_overload_v3_OverloadAction_triggers(const envoy_config_overload_v3_OverloadAction* msg, size_t* len) {
+ return (const envoy_config_overload_v3_Trigger* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_typed_config(const envoy_config_overload_v3_OverloadAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadAction_clear_typed_config(const envoy_config_overload_v3_OverloadAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_typed_config(const envoy_config_overload_v3_OverloadAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*);
}
-UPB_INLINE upb_strview envoy_config_overload_v3_OverloadAction_name(const envoy_config_overload_v3_OverloadAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_triggers(const envoy_config_overload_v3_OverloadAction *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
-UPB_INLINE const envoy_config_overload_v3_Trigger* const* envoy_config_overload_v3_OverloadAction_triggers(const envoy_config_overload_v3_OverloadAction *msg, size_t *len) { return (const envoy_config_overload_v3_Trigger* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadAction_has_typed_config(const envoy_config_overload_v3_OverloadAction *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_typed_config(const envoy_config_overload_v3_OverloadAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); }
-
-UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_name(envoy_config_overload_v3_OverloadAction *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_name(envoy_config_overload_v3_OverloadAction *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_mutable_triggers(envoy_config_overload_v3_OverloadAction *msg, size_t *len) {
- return (envoy_config_overload_v3_Trigger**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_mutable_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t* len) {
+ return (envoy_config_overload_v3_Trigger**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
-UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_resize_triggers(envoy_config_overload_v3_OverloadAction *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_Trigger**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_overload_v3_Trigger** envoy_config_overload_v3_OverloadAction_resize_triggers(envoy_config_overload_v3_OverloadAction* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_overload_v3_Trigger**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_overload_v3_Trigger* envoy_config_overload_v3_OverloadAction_add_triggers(envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena) {
- struct envoy_config_overload_v3_Trigger* sub = (struct envoy_config_overload_v3_Trigger*)_upb_msg_new(&envoy_config_overload_v3_Trigger_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_overload_v3_Trigger* envoy_config_overload_v3_OverloadAction_add_triggers(envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena) {
+ struct envoy_config_overload_v3_Trigger* sub = (struct envoy_config_overload_v3_Trigger*)_upb_Message_New(&envoy_config_overload_v3_Trigger_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_overload_v3_OverloadAction_set_typed_config(envoy_config_overload_v3_OverloadAction *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_config_overload_v3_OverloadAction_mutable_typed_config(envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_mutable_typed_config(envoy_config_overload_v3_OverloadAction* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_overload_v3_OverloadAction_typed_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_OverloadAction_set_typed_config(msg, sub);
}
return sub;
}
-/* envoy.config.overload.v3.OverloadManager */
+/* envoy.config.overload.v3.BufferFactoryConfig */
-UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_new(upb_arena *arena) {
- return (envoy_config_overload_v3_OverloadManager *)_upb_msg_new(&envoy_config_overload_v3_OverloadManager_msginit, arena);
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_BufferFactoryConfig_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_BufferFactoryConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_BufferFactoryConfig* ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_BufferFactoryConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_BufferFactoryConfig* ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_overload_v3_BufferFactoryConfig_serialize(const envoy_config_overload_v3_BufferFactoryConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_overload_v3_BufferFactoryConfig_serialize_ex(const envoy_config_overload_v3_BufferFactoryConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, options, arena, len);
}
-UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena)) ? ret : NULL;
+UPB_INLINE void envoy_config_overload_v3_BufferFactoryConfig_clear_minimum_account_to_track_power_of_two(const envoy_config_overload_v3_BufferFactoryConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
}
-UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE uint32_t envoy_config_overload_v3_BufferFactoryConfig_minimum_account_to_track_power_of_two(const envoy_config_overload_v3_BufferFactoryConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t);
}
-UPB_INLINE char *envoy_config_overload_v3_OverloadManager_serialize(const envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, arena, len);
+
+UPB_INLINE void envoy_config_overload_v3_BufferFactoryConfig_set_minimum_account_to_track_power_of_two(envoy_config_overload_v3_BufferFactoryConfig *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
}
-UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+/* envoy.config.overload.v3.OverloadManager */
+
+UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_OverloadManager_new(upb_Arena* arena) {
+ return (envoy_config_overload_v3_OverloadManager*)_upb_Message_New(&envoy_config_overload_v3_OverloadManager_msginit, arena);
+}
+UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_OverloadManager_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_overload_v3_OverloadManager* ret = envoy_config_overload_v3_OverloadManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_OverloadManager_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_overload_v3_OverloadManager* ret = envoy_config_overload_v3_OverloadManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_overload_v3_OverloadManager_serialize(const envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_overload_v3_OverloadManager_serialize_ex(const envoy_config_overload_v3_OverloadManager* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager* msg, size_t* len) {
+ return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_actions(const envoy_config_overload_v3_OverloadManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager* msg, size_t* len) {
+ return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_clear_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_buffer_factory_config(const envoy_config_overload_v3_OverloadManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_overload_v3_BufferFactoryConfig*);
+}
UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_mutable_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_mutable_refresh_interval(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_overload_v3_OverloadManager_refresh_interval(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_overload_v3_OverloadManager_set_refresh_interval(msg, sub);
}
return sub;
}
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t *len) {
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t* len) {
return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_overload_v3_ResourceMonitor**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_OverloadManager_add_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
- struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_msg_new(&envoy_config_overload_v3_ResourceMonitor_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_OverloadManager_add_resource_monitors(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) {
+ struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_Message_New(&envoy_config_overload_v3_ResourceMonitor_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager *msg, size_t *len) {
+UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager* msg, size_t* len) {
return (envoy_config_overload_v3_OverloadAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
-UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_OverloadAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_overload_v3_OverloadAction**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadManager_add_actions(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
- struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_msg_new(&envoy_config_overload_v3_OverloadAction_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadManager_add_actions(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) {
+ struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_Message_New(&envoy_config_overload_v3_OverloadAction_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, envoy_config_overload_v3_BufferFactoryConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_overload_v3_BufferFactoryConfig*) = value;
+}
+UPB_INLINE struct envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_mutable_buffer_factory_config(envoy_config_overload_v3_OverloadManager* msg, upb_Arena* arena) {
+ struct envoy_config_overload_v3_BufferFactoryConfig* sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)envoy_config_overload_v3_OverloadManager_buffer_factory_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)_upb_Message_New(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_overload_v3_overload_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
index f8ac2daa..70fa2815 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
@@ -7,15 +7,18 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/rbac/v3/rbac.upb.h"
#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/extension.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 "envoy/type/v3/range.upb.h"
#include "google/api/expr/v1alpha1/checked.upb.h"
#include "google/api/expr/v1alpha1/syntax.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"
@@ -23,155 +26,183 @@
#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_MiniTable_Sub envoy_config_rbac_v3_RBAC_submsgs[1] = {
+ {.submsg = &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(4, 8), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_RBAC_msginit = {
+const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit = {
&envoy_config_rbac_v3_RBAC_submsgs[0],
&envoy_config_rbac_v3_RBAC__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
- &envoy_config_rbac_v3_Policy_msginit,
+static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_rbac_v3_Policy_submsgs[4] = {
+ {.submsg = &envoy_config_rbac_v3_Permission_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msginit},
};
-static const upb_msglayout_field envoy_config_rbac_v3_Policy__fields[4] = {
- {1, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {2, UPB_SIZE(16, 32), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 2, 11, 1},
+static const upb_MiniTable_Field envoy_config_rbac_v3_Policy__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_Policy_msginit = {
+const upb_MiniTable envoy_config_rbac_v3_Policy_msginit = {
&envoy_config_rbac_v3_Policy_submsgs[0],
&envoy_config_rbac_v3_Policy__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_submsgs[7] = {
- &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 = {
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_submsgs[10] = {
+ {.submsg = &envoy_config_rbac_v3_Permission_Set_msginit},
+ {.submsg = &envoy_config_rbac_v3_Permission_Set_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &envoy_config_rbac_v3_Permission_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit},
+ {.submsg = &envoy_type_v3_Int32Range_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_rbac_v3_Permission__fields[12] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Permission_msginit,
+static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_rbac_v3_Permission_Set__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_submsgs[7] = {
- &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 = {
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_submsgs[10] = {
+ {.submsg = &envoy_config_rbac_v3_Principal_Set_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_Set_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_Authenticated_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_msginit},
+ {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_rbac_v3_Principal__fields[11] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 11, kUpb_ExtMode_NonExtendable, 11, 255, 0,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Principal_msginit,
+static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Set__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = {
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[8] = {
+ &envoy_config_rbac_v3_RBAC_msginit,
+ &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
+ &envoy_config_rbac_v3_Policy_msginit,
+ &envoy_config_rbac_v3_Permission_msginit,
+ &envoy_config_rbac_v3_Permission_Set_msginit,
+ &envoy_config_rbac_v3_Principal_msginit,
+ &envoy_config_rbac_v3_Principal_Set_msginit,
+ &envoy_config_rbac_v3_Principal_Authenticated_msginit,
+};
+
+const upb_MiniTable_File envoy_config_rbac_v3_rbac_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 8,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
index befa31f6..b91e34d8 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
#define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -36,28 +36,32 @@ typedef struct envoy_config_rbac_v3_Permission_Set envoy_config_rbac_v3_Permissi
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;
+extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Policy_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Permission_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Permission_Set_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Principal_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Principal_Set_msginit;
+extern const upb_MiniTable envoy_config_rbac_v3_Principal_Authenticated_msginit;
struct envoy_config_core_v3_CidrRange;
+struct envoy_config_core_v3_TypedExtensionConfig;
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 envoy_type_v3_Int32Range;
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;
+extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable envoy_type_v3_Int32Range_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit;
typedef enum {
envoy_config_rbac_v3_RBAC_ALLOW = 0,
@@ -66,49 +70,85 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_RBAC*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_RBAC* ret = envoy_config_rbac_v3_RBAC_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_rbac_v3_RBAC_serialize_ex(const envoy_config_rbac_v3_RBAC* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msginit, options, arena, len);
}
-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 void envoy_config_rbac_v3_RBAC_clear_action(const envoy_config_rbac_v3_RBAC* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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(4, 8));
+}
+UPB_INLINE void envoy_config_rbac_v3_RBAC_clear_policies(const envoy_config_rbac_v3_RBAC* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 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(4, 8));
+}
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_get(const envoy_config_rbac_v3_RBAC* msg, upb_StringView key, envoy_config_rbac_v3_Policy** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(4, 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(4, 8), iter);
}
-
-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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 8), iter); }
+UPB_INLINE void envoy_config_rbac_v3_RBAC_policies_clear(envoy_config_rbac_v3_RBAC* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_set(envoy_config_rbac_v3_RBAC* msg, upb_StringView key, envoy_config_rbac_v3_Policy* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool envoy_config_rbac_v3_RBAC_policies_delete(envoy_config_rbac_v3_RBAC* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(4, 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(4, 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_INLINE upb_StringView envoy_config_rbac_v3_RBAC_PoliciesEntry_key(const envoy_config_rbac_v3_RBAC_PoliciesEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -120,67 +160,104 @@ UPB_INLINE void envoy_config_rbac_v3_RBAC_PoliciesEntry_set_value(envoy_config_r
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Policy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Policy* ret = envoy_config_rbac_v3_Policy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_rbac_v3_Policy_serialize_ex(const envoy_config_rbac_v3_Policy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Policy_msginit, options, 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(4, 8));
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_clear_permissions(const envoy_config_rbac_v3_Policy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), 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(8, 16));
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_clear_principals(const envoy_config_rbac_v3_Policy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_clear_condition(const envoy_config_rbac_v3_Policy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_rbac_v3_Policy_clear_checked_condition(const envoy_config_rbac_v3_Policy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct google_api_expr_v1alpha1_CheckedExpr*);
}
-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(12, 24)); }
-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(12, 24), 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(16, 32)); }
-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(16, 32), len); }
-UPB_INLINE bool envoy_config_rbac_v3_Policy_has_condition(const envoy_config_rbac_v3_Policy *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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(12, 24), len);
+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(4, 8), 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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &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(16, 32), len);
+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(8, 16), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_Expr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
envoy_config_rbac_v3_Policy_set_condition(msg, sub);
}
@@ -188,12 +265,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* envoy_config_rbac_v3_Policy_mut
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_api_expr_v1alpha1_CheckedExpr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
if (!sub) return NULL;
envoy_config_rbac_v3_Policy_set_checked_condition(msg, sub);
}
@@ -202,24 +279,35 @@ UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* envoy_config_rbac_v3_Pol
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Permission*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Permission* ret = envoy_config_rbac_v3_Permission_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_rbac_v3_Permission_serialize_ex(const envoy_config_rbac_v3_Permission* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Permission_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_rbac_v3_Permission_rule_and_rules = 1,
envoy_config_rbac_v3_Permission_rule_or_rules = 2,
@@ -228,194 +316,337 @@ typedef enum {
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_destination_port_range = 11,
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_matcher = 12,
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_and_rules(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_or_rules(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_any(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Permission_any(const envoy_config_rbac_v3_Permission* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_header(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_ip(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 6, _upb_UInt32_FromU(0u));
+}
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_metadata(const envoy_config_rbac_v3_Permission* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_metadata(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_not_rule(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_requested_server_name(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 10;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_url_path(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 10, NULL);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port_range(const envoy_config_rbac_v3_Permission* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_destination_port_range(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_destination_port_range(const envoy_config_rbac_v3_Permission* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 11, NULL);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_matcher(const envoy_config_rbac_v3_Permission* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 12;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_clear_matcher(const envoy_config_rbac_v3_Permission* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Permission_rule_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_matcher(const envoy_config_rbac_v3_Permission* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 12, 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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Permission_Set*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_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_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Permission*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_New(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_rbac_v3_Permission_set_url_path(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port_range(envoy_config_rbac_v3_Permission *msg, struct envoy_type_v3_Int32Range* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 11);
+}
+UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_mutable_destination_port_range(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) {
+ struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_rbac_v3_Permission_destination_port_range(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Int32Range*)_upb_Message_New(&envoy_type_v3_Int32Range_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_destination_port_range(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_matcher(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_mutable_matcher(envoy_config_rbac_v3_Permission* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_rbac_v3_Permission_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_matcher(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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Permission_Set*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_Set_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Permission_Set* ret = envoy_config_rbac_v3_Permission_Set_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_rbac_v3_Permission_Set_serialize_ex(const envoy_config_rbac_v3_Permission_Set* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, options, arena, len);
}
-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 void envoy_config_rbac_v3_Permission_Set_clear_rules(const envoy_config_rbac_v3_Permission_Set* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_rbac_v3_Permission_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Principal*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Principal* ret = envoy_config_rbac_v3_Principal_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_rbac_v3_Principal_serialize_ex(const envoy_config_rbac_v3_Principal* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Principal_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_rbac_v3_Principal_identifier_and_ids = 1,
envoy_config_rbac_v3_Principal_identifier_or_ids = 2,
@@ -430,149 +661,227 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_and_ids(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_or_ids(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_any(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Principal_any(const envoy_config_rbac_v3_Principal* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_authenticated(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_source_ip(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_header(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_metadata(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_not_id(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_url_path(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 10;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_direct_remote_ip(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 11;
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_clear_remote_ip(const envoy_config_rbac_v3_Principal* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_rbac_v3_Principal_identifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Set*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Principal_Set*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal_Authenticated*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_config_route_v3_HeaderMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_MetadataMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_rbac_v3_Principal*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_rbac_v3_Principal*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_PathMatcher*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_config_core_v3_CidrRange*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
if (!sub) return NULL;
envoy_config_rbac_v3_Principal_set_remote_ip(msg, sub);
}
@@ -581,78 +890,115 @@ UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_rbac_v3_Principal
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Principal_Set*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Set_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Principal_Set* ret = envoy_config_rbac_v3_Principal_Set_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_rbac_v3_Principal_Set_serialize_ex(const envoy_config_rbac_v3_Principal_Set* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, options, 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 void envoy_config_rbac_v3_Principal_Set_clear_ids(const envoy_config_rbac_v3_Principal_Set* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_rbac_v3_Principal_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_rbac_v3_Principal_Authenticated*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Principal_Authenticated_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_rbac_v3_Principal_Authenticated* ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_rbac_v3_Principal_Authenticated_serialize_ex(const envoy_config_rbac_v3_Principal_Authenticated* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_rbac_v3_Principal_Authenticated_has_principal_name(const envoy_config_rbac_v3_Principal_Authenticated* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_rbac_v3_Principal_Authenticated_clear_principal_name(const envoy_config_rbac_v3_Principal_Authenticated* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_type_matcher_v3_StringMatcher*);
}
-
-UPB_INLINE bool envoy_config_rbac_v3_Principal_Authenticated_has_principal_name(const envoy_config_rbac_v3_Principal_Authenticated *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_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;
}
+extern const upb_MiniTable_File envoy_config_rbac_v3_rbac_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
index d34e1c50..655df8bb 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
@@ -7,10 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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/core/v3/extension.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -19,46 +20,81 @@
#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,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteConfiguration_submsgs[8] = {
+ {.submsg = &envoy_config_route_v3_VirtualHost_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_route_v3_Vhds_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteConfiguration__fields[11] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 2, 11, 3},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(32, 64), 0, 0, 11, 3},
- {5, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {6, UPB_SIZE(40, 80), 0, 0, 11, 3},
- {7, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {8, UPB_SIZE(44, 88), 0, 0, 9, 3},
- {9, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {10, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {11, UPB_SIZE(20, 40), 3, 4, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteConfiguration__fields[13] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 64), UPB_SIZE(1, 1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(40, 80), UPB_SIZE(2, 2), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(44, 88), UPB_SIZE(3, 3), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(48, 96), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(52, 104), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit = {
&envoy_config_route_v3_RouteConfiguration_submsgs[0],
&envoy_config_route_v3_RouteConfiguration__fields[0],
- UPB_SIZE(48, 96), 11, false, 255,
+ UPB_SIZE(56, 120), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_ClusterSpecifierPlugin__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msginit = {
+ &envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[0],
+ &envoy_config_route_v3_ClusterSpecifierPlugin__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_Vhds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_Vhds_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_Vhds__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_Vhds__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_Vhds_msginit = {
+const upb_MiniTable envoy_config_route_v3_Vhds_msginit = {
&envoy_config_route_v3_Vhds_submsgs[0],
&envoy_config_route_v3_Vhds__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_config_route_v3_RouteConfiguration_msginit,
+ &envoy_config_route_v3_ClusterSpecifierPlugin_msginit,
+ &envoy_config_route_v3_Vhds_msginit,
+};
+
+const upb_MiniTable_File envoy_config_route_v3_route_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
index b8d009fd..61ae7c06 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
#define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -21,154 +21,252 @@ extern "C" {
#endif
struct envoy_config_route_v3_RouteConfiguration;
+struct envoy_config_route_v3_ClusterSpecifierPlugin;
struct envoy_config_route_v3_Vhds;
typedef struct envoy_config_route_v3_RouteConfiguration envoy_config_route_v3_RouteConfiguration;
+typedef struct envoy_config_route_v3_ClusterSpecifierPlugin envoy_config_route_v3_ClusterSpecifierPlugin;
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;
+extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit;
+extern const upb_MiniTable envoy_config_route_v3_ClusterSpecifierPlugin_msginit;
+extern const upb_MiniTable envoy_config_route_v3_Vhds_msginit;
struct envoy_config_core_v3_ConfigSource;
struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy;
struct envoy_config_route_v3_VirtualHost;
struct google_protobuf_BoolValue;
struct google_protobuf_UInt32Value;
-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;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_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 envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(24, 48)); }
-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(24, 48), 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(28, 56), 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(32, 64)); }
-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(32, 64), 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(36, 72), 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(40, 80)); }
-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(40, 80), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_hasbit(msg, 1); }
-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(44, 88), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_hasbit(msg, 2); }
-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(1, 1), bool); }
-UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
-
-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(24, 48), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_RouteConfiguration_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteConfiguration*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_RouteConfiguration_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteConfiguration* ret = envoy_config_route_v3_RouteConfiguration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RouteConfiguration_serialize_ex(const envoy_config_route_v3_RouteConfiguration* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_name(const envoy_config_route_v3_RouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteConfiguration_name(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(12, 24));
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_virtual_hosts(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_internal_only_headers(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), 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(20, 40));
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40), len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_response_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), 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(28, 56));
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_add(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+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(28, 56), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_validate_clusters(const envoy_config_route_v3_RouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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(32, 64), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 72));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_RouteConfiguration_request_headers_to_remove(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_vhds(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_vhds(const envoy_config_route_v3_RouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
+}
+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(40, 80), const envoy_config_route_v3_Vhds*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96));
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 96));
+}
+UPB_INLINE const envoy_config_route_v3_ClusterSpecifierPlugin* const* envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (const envoy_config_route_v3_ClusterSpecifierPlugin* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 104));
+}
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_clear_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 104));
+}
+UPB_INLINE const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_RouteConfiguration_request_mirror_policies(const envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (const struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(52, 104), len);
+}
+
+UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_name(envoy_config_route_v3_RouteConfiguration *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(12, 24), 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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_Message_New(&envoy_config_route_v3_VirtualHost_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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(28, 56), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_internal_only_headers(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &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(32, 64), len);
+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(20, 40), 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &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(36, 72), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_response_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &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(40, 80), len);
+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(28, 56), 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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_RouteConfiguration_mutable_validate_clusters(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(44, 88), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_mutable_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_RouteConfiguration_resize_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_add_request_headers_to_remove(envoy_config_route_v3_RouteConfiguration* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_Vhds*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), 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) {
+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);
+ sub = (struct envoy_config_route_v3_Vhds*)_upb_Message_New(&envoy_config_route_v3_Vhds_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteConfiguration_set_vhds(msg, sub);
}
@@ -179,55 +277,163 @@ UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_most_specific_heade
}
UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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_route_v3_RouteConfiguration_mutable_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_mutable_max_direct_response_body_size_bytes(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteConfiguration_set_max_direct_response_body_size_bytes(msg, sub);
}
return sub;
}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_mutable_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_resize_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_RouteConfiguration_add_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_ClusterSpecifierPlugin* sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_mutable_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t* len) {
+ return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_RouteConfiguration_resize_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteConfiguration_add_request_mirror_policies(envoy_config_route_v3_RouteConfiguration* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
-/* envoy.config.route.v3.Vhds */
+/* envoy.config.route.v3.ClusterSpecifierPlugin */
-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_ClusterSpecifierPlugin* envoy_config_route_v3_ClusterSpecifierPlugin_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_Message_New(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_ClusterSpecifierPlugin_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_route_v3_ClusterSpecifierPlugin* ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_ClusterSpecifierPlugin_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_ClusterSpecifierPlugin* ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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_ClusterSpecifierPlugin_serialize(const envoy_config_route_v3_ClusterSpecifierPlugin* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_ClusterSpecifierPlugin_serialize_ex(const envoy_config_route_v3_ClusterSpecifierPlugin* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, options, arena, len);
}
-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_ClusterSpecifierPlugin_has_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_clear_is_optional(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_ClusterSpecifierPlugin_is_optional(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(envoy_config_route_v3_ClusterSpecifierPlugin *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_mutable_extension(envoy_config_route_v3_ClusterSpecifierPlugin* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_ClusterSpecifierPlugin_extension(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_set_is_optional(envoy_config_route_v3_ClusterSpecifierPlugin *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_Vhds* ret = envoy_config_route_v3_Vhds_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_Vhds_serialize_ex(const envoy_config_route_v3_Vhds* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_Vhds_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_Vhds_clear_config_source(const envoy_config_route_v3_Vhds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_sethas(msg, 1);
*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_route_v3_Vhds_mutable_config_source(envoy_config_route_v3_Vhds *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Vhds_set_config_source(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_route_v3_route_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
index a5c1d65d..4192dddd 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
@@ -7,11 +7,12 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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/metadata.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"
@@ -21,6 +22,8 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "xds/type/matcher/v3/matcher.upb.h"
#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -29,912 +32,1019 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_submsgs[10] = {
- &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(4, 4), 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), 1, 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), 2, 4, 11, 1},
- {17, UPB_SIZE(28, 48), 3, 2, 11, 1},
- {18, UPB_SIZE(32, 56), 4, 9, 11, 1},
- {19, UPB_SIZE(9, 9), 0, 0, 8, 1},
- {20, UPB_SIZE(36, 64), 5, 8, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_VirtualHost_msginit = {
+static const upb_MiniTable_Sub envoy_config_route_v3_VirtualHost_submsgs[13] = {
+ {.submsg = &envoy_config_route_v3_Route_msginit},
+ {.submsg = &envoy_config_route_v3_VirtualCluster_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_CorsPolicy_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_HedgePolicy_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_VirtualHost__fields[20] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(56, 104), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(60, 112), UPB_SIZE(2, 2), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(64, 120), UPB_SIZE(3, 3), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(68, 128), UPB_SIZE(4, 4), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(9, 9), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(72, 136), UPB_SIZE(5, 5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(76, 144), UPB_SIZE(6, 6), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(80, 152), UPB_SIZE(0, 0), 12, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(84, 168), 20, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_FilterAction_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_FilterAction_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_FilterAction__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_FilterAction__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_FilterAction_msginit = {
+const upb_MiniTable envoy_config_route_v3_FilterAction_msginit = {
&envoy_config_route_v3_FilterAction_submsgs[0],
&envoy_config_route_v3_FilterAction__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Route_submsgs[11] = {
- &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(12, 24), 1, 8, 11, 1},
- {2, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 7, 11, 1},
- {3, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 5, 11, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 3, 2, 11, 1},
- {7, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 3, 11, 1},
- {9, UPB_SIZE(32, 64), 0, 0, 11, 3},
- {10, UPB_SIZE(36, 72), 0, 0, 11, 3},
- {11, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {12, UPB_SIZE(44, 88), 0, 0, 9, 3},
- {13, UPB_SIZE(48, 96), 0, 6, 11, _UPB_LABEL_MAP},
- {14, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {15, UPB_SIZE(24, 48), 4, 9, 11, 1},
- {16, UPB_SIZE(28, 56), 5, 10, 11, 1},
- {17, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 4, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_Route_msginit = {
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_Route_submsgs[13] = {
+ {.submsg = &envoy_config_route_v3_RouteMatch_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_msginit},
+ {.submsg = &envoy_config_route_v3_RedirectAction_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_route_v3_Decorator_msginit},
+ {.submsg = &envoy_config_route_v3_DirectResponseAction_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit},
+ {.submsg = &envoy_config_route_v3_Tracing_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_route_v3_FilterAction_msginit},
+ {.submsg = &envoy_config_route_v3_NonForwardingAction_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_Route__fields[16] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(48, 88), UPB_SIZE(4, 4), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(52, 96), UPB_SIZE(5, 5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(56, 104), UPB_SIZE(-5, -5), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_route_v3_Route_msginit = {
&envoy_config_route_v3_Route_submsgs[0],
&envoy_config_route_v3_Route__fields[0],
- UPB_SIZE(64, 128), 15, false, 255,
+ UPB_SIZE(60, 120), 16, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_WeightedCluster_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster__fields[3] = {
- {1, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster__fields[4] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(28, 48), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit = {
+const upb_MiniTable envoy_config_route_v3_WeightedCluster_msginit = {
&envoy_config_route_v3_WeightedCluster_submsgs[0],
&envoy_config_route_v3_WeightedCluster__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[4] = {
- &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_MiniTable_Sub envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[5] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[8] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {5, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {6, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {9, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {10, UPB_SIZE(36, 72), 0, 2, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[10] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(36, 64), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(60, 120), 10, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-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(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {2, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {4, UPB_SIZE(4, 8), 1, 7, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 1, 11, 3},
- {7, UPB_SIZE(24, 48), 0, 2, 11, 3},
- {8, UPB_SIZE(8, 16), 2, 4, 11, 1},
- {9, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {10, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 6, 11, 1},
- {11, UPB_SIZE(16, 32), 4, 5, 11, 1},
- {12, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 3, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteMatch_msginit = {
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteMatch_submsgs[9] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch__fields[11] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(40, 72), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(44, 88), 11, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_CorsPolicy_submsgs[3] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_CorsPolicy_submsgs[4] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_CorsPolicy__fields[8] = {
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(28, 56), 0, 0, 9, 1},
- {6, UPB_SIZE(36, 72), 1, 2, 11, 1},
- {9, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 0, 11, 1},
- {10, UPB_SIZE(40, 80), 2, 0, 11, 1},
- {11, UPB_SIZE(44, 88), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_config_route_v3_CorsPolicy__fields[8] = {
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(52, 96), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(44, 80), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_submsgs[16] = {
- &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(96, 176), UPB_SIZE(-105, -193), 0, 9, 1},
- {2, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, 1},
- {3, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 10, 11, 1},
- {4, UPB_SIZE(24, 32), 1, 0, 11, 1},
- {5, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {6, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, 1},
- {7, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 13, 11, 1},
- {8, UPB_SIZE(28, 40), 2, 14, 11, 1},
- {9, UPB_SIZE(32, 48), 3, 5, 11, 1},
- {11, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {13, UPB_SIZE(80, 144), 0, 4, 11, 3},
- {14, UPB_SIZE(36, 56), 4, 13, 11, 1},
- {15, UPB_SIZE(84, 152), 0, 6, 11, 3},
- {17, UPB_SIZE(40, 64), 5, 1, 11, 1},
- {20, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {23, UPB_SIZE(44, 72), 6, 14, 11, 1},
- {24, UPB_SIZE(48, 80), 7, 14, 11, 1},
- {25, UPB_SIZE(88, 160), 0, 9, 11, 3},
- {26, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {27, UPB_SIZE(52, 88), 8, 2, 11, 1},
- {28, UPB_SIZE(56, 96), 9, 14, 11, 1},
- {29, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, 1},
- {30, UPB_SIZE(92, 168), 0, 8, 11, 3},
- {31, UPB_SIZE(60, 104), 10, 15, 11, 1},
- {32, UPB_SIZE(64, 112), 11, 11, 11, 1},
- {33, UPB_SIZE(68, 120), 12, 12, 11, 1},
- {34, UPB_SIZE(72, 128), 13, 3, 11, 1},
- {35, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 11, 11, 1},
- {36, UPB_SIZE(76, 136), 14, 7, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RouteAction_msginit = {
+ UPB_SIZE(56, 104), 8, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_submsgs[21] = {
+ {.submsg = &envoy_config_route_v3_WeightedCluster_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_CorsPolicy_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit},
+ {.submsg = &envoy_config_route_v3_HedgePolicy_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_config_route_v3_InternalRedirectPolicy_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction__fields[31] = {
+ {1, UPB_SIZE(36, 48), UPB_SIZE(-21, -21), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(36, 48), UPB_SIZE(-21, -21), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(36, 48), UPB_SIZE(-21, -21), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(44, 64), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(56, 88), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(60, 96), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(64, 104), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(68, 112), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(72, 120), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(76, 128), UPB_SIZE(5, 5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(80, 136), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(84, 144), UPB_SIZE(7, 7), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(88, 152), UPB_SIZE(0, 0), 11, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(92, 160), UPB_SIZE(8, 8), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(96, 168), UPB_SIZE(9, 9), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {29, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(100, 176), UPB_SIZE(0, 0), 14, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(104, 184), UPB_SIZE(10, 10), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {32, UPB_SIZE(108, 192), UPB_SIZE(11, 11), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {33, UPB_SIZE(112, 200), UPB_SIZE(12, 12), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {34, UPB_SIZE(116, 208), UPB_SIZE(13, 13), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {35, UPB_SIZE(28, 32), UPB_SIZE(-17, -17), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {36, UPB_SIZE(120, 216), UPB_SIZE(14, 14), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {37, UPB_SIZE(36, 48), UPB_SIZE(-21, -21), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {38, UPB_SIZE(24, 24), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_route_v3_RouteAction_msginit = {
&envoy_config_route_v3_RouteAction_submsgs[0],
&envoy_config_route_v3_RouteAction__fields[0],
- UPB_SIZE(120, 224), 29, false, 255,
+ UPB_SIZE(124, 232), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = {
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_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},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit = {
+const upb_MiniTable 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(16, 24), 6, false, 255,
+ UPB_SIZE(12, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = {
+const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
- &envoy_config_core_v3_ProxyProtocolConfig_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ProxyProtocolConfig_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit = {
+const upb_MiniTable 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(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit = {
+const upb_MiniTable 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(16, 32), 3, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_submsgs[7] = {
- &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(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 32), 1, 6, 11, 1},
- {3, UPB_SIZE(28, 40), 2, 5, 11, 1},
- {4, UPB_SIZE(32, 48), 3, 4, 11, 1},
- {5, UPB_SIZE(44, 72), 0, 3, 11, 3},
- {6, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {7, UPB_SIZE(48, 80), 0, 0, 13, _UPB_LABEL_PACKED},
- {8, UPB_SIZE(36, 56), 4, 2, 11, 1},
- {9, UPB_SIZE(52, 88), 0, 0, 11, 3},
- {10, UPB_SIZE(56, 96), 0, 0, 11, 3},
- {11, UPB_SIZE(40, 64), 5, 1, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit = {
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_submsgs[10] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy__fields[13] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(56, 112), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(44, 88), UPB_SIZE(5, 5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(48, 96), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(52, 104), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_route_v3_RetryPolicy_msginit = {
&envoy_config_route_v3_RetryPolicy_submsgs[0],
&envoy_config_route_v3_RetryPolicy__fields[0],
- UPB_SIZE(64, 112), 11, false, 255,
+ UPB_SIZE(64, 120), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = {
+const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = {
NULL,
&envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_HedgePolicy_submsgs[2] = {
- &envoy_type_v3_FractionalPercent_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_HedgePolicy_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_HedgePolicy__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_HedgePolicy__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit = {
+const upb_MiniTable envoy_config_route_v3_HedgePolicy_msginit = {
&envoy_config_route_v3_HedgePolicy_submsgs[0],
&envoy_config_route_v3_HedgePolicy__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RedirectAction_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RedirectAction_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RedirectAction__fields[9] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {4, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 8, 1},
- {5, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 9, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {9, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RedirectAction__fields[9] = {
+ {1, UPB_SIZE(36, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 24), UPB_SIZE(-9, -9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(20, 24), UPB_SIZE(-9, -9), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(28, 40), UPB_SIZE(-17, -17), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RedirectAction_msginit = {
+const upb_MiniTable envoy_config_route_v3_RedirectAction_msginit = {
&envoy_config_route_v3_RedirectAction_submsgs[0],
&envoy_config_route_v3_RedirectAction__fields[0],
- UPB_SIZE(48, 80), 9, false, 255,
+ UPB_SIZE(44, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_DirectResponseAction__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {2, UPB_SIZE(8, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_DirectResponseAction__fields[2] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit = {
+const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msginit = {
&envoy_config_route_v3_DirectResponseAction_submsgs[0],
&envoy_config_route_v3_DirectResponseAction__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_Decorator_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout_field envoy_config_route_v3_Decorator__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Sub envoy_config_route_v3_Decorator_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-const upb_msglayout envoy_config_route_v3_Decorator_msginit = {
+static const upb_MiniTable_Field envoy_config_route_v3_Decorator__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_Tracing_submsgs[2] = {
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_Tracing_submsgs[4] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_Tracing__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_route_v3_Tracing__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_Tracing_msginit = {
+const upb_MiniTable envoy_config_route_v3_Tracing_msginit = {
&envoy_config_route_v3_Tracing_submsgs[0],
&envoy_config_route_v3_Tracing__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_VirtualCluster_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_VirtualCluster_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_VirtualCluster__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RateLimit_submsgs[3] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Override_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RateLimit__fields[4] = {
- {1, UPB_SIZE(12, 24), 1, 2, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_submsgs[9] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &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_MetaData_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[9] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
-};
-
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit = {
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_submsgs[9] = {
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_MetaData_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action__fields[9] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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), 9, false, 255,
+ UPB_SIZE(8, 24), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = {
NULL,
&envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = {
NULL,
&envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_MetaData__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_MetaData__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Action_MetaData_msginit = {
+const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msginit = {
&envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[0],
&envoy_config_route_v3_RateLimit_Action_MetaData__fields[0],
- UPB_SIZE(32, 48), 4, false, 255,
+ UPB_SIZE(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_HeaderMatcher_submsgs[3] = {
+ {.submsg = &envoy_type_v3_Int64Range_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_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},
+static const upb_MiniTable_Field envoy_config_route_v3_HeaderMatcher__fields[10] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 40), 10, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_QueryParameterMatcher__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 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(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_FilterConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_FilterConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_FilterConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_FilterConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_FilterConfig_msginit = {
+const upb_MiniTable envoy_config_route_v3_FilterConfig_msginit = {
&envoy_config_route_v3_FilterConfig_submsgs[0],
&envoy_config_route_v3_FilterConfig__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[53] = {
+ &envoy_config_route_v3_VirtualHost_msginit,
+ &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_FilterAction_msginit,
+ &envoy_config_route_v3_Route_msginit,
+ &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_WeightedCluster_msginit,
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_RouteMatch_msginit,
+ &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
+ &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
+ &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
+ &envoy_config_route_v3_CorsPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_msginit,
+ &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
+ &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
+ &envoy_config_route_v3_RetryPolicy_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
+ &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
+ &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
+ &envoy_config_route_v3_HedgePolicy_msginit,
+ &envoy_config_route_v3_RedirectAction_msginit,
+ &envoy_config_route_v3_DirectResponseAction_msginit,
+ &envoy_config_route_v3_NonForwardingAction_msginit,
+ &envoy_config_route_v3_Decorator_msginit,
+ &envoy_config_route_v3_Tracing_msginit,
+ &envoy_config_route_v3_VirtualCluster_msginit,
+ &envoy_config_route_v3_RateLimit_msginit,
+ &envoy_config_route_v3_RateLimit_Action_msginit,
+ &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
+ &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
+ &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
+ &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
+ &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
+ &envoy_config_route_v3_RateLimit_Action_MetaData_msginit,
+ &envoy_config_route_v3_RateLimit_Override_msginit,
+ &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_config_route_v3_QueryParameterMatcher_msginit,
+ &envoy_config_route_v3_InternalRedirectPolicy_msginit,
+ &envoy_config_route_v3_FilterConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_route_v3_route_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 53,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
index 4f98c015..ec0d1c0e 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -53,6 +53,7 @@ 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_NonForwardingAction;
struct envoy_config_route_v3_Decorator;
struct envoy_config_route_v3_Tracing;
struct envoy_config_route_v3_VirtualCluster;
@@ -105,6 +106,7 @@ typedef struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff envoy_c
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_NonForwardingAction envoy_config_route_v3_NonForwardingAction;
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;
@@ -124,64 +126,66 @@ typedef struct envoy_config_route_v3_HeaderMatcher envoy_config_route_v3_HeaderM
typedef struct envoy_config_route_v3_QueryParameterMatcher envoy_config_route_v3_QueryParameterMatcher;
typedef struct envoy_config_route_v3_InternalRedirectPolicy envoy_config_route_v3_InternalRedirectPolicy;
typedef struct envoy_config_route_v3_FilterConfig envoy_config_route_v3_FilterConfig;
-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_Action_MetaData_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;
-extern const upb_msglayout envoy_config_route_v3_FilterConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_VirtualHost_msginit;
+extern const upb_MiniTable envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit;
+extern const upb_MiniTable envoy_config_route_v3_FilterAction_msginit;
+extern const upb_MiniTable envoy_config_route_v3_Route_msginit;
+extern const upb_MiniTable envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit;
+extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_msginit;
+extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit;
+extern const upb_MiniTable envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteMatch_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit;
+extern const upb_MiniTable envoy_config_route_v3_CorsPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryPriority_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HedgePolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RedirectAction_msginit;
+extern const upb_MiniTable envoy_config_route_v3_DirectResponseAction_msginit;
+extern const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msginit;
+extern const upb_MiniTable envoy_config_route_v3_Decorator_msginit;
+extern const upb_MiniTable envoy_config_route_v3_Tracing_msginit;
+extern const upb_MiniTable envoy_config_route_v3_VirtualCluster_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Action_MetaData_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable envoy_config_route_v3_QueryParameterMatcher_msginit;
+extern const upb_MiniTable envoy_config_route_v3_InternalRedirectPolicy_msginit;
+extern const upb_MiniTable envoy_config_route_v3_FilterConfig_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_MetadataMatcher;
struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
struct envoy_type_matcher_v3_RegexMatcher;
struct envoy_type_matcher_v3_StringMatcher;
@@ -193,23 +197,26 @@ 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;
+struct xds_type_matcher_v3_Matcher;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Metadata_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable envoy_type_v3_Int64Range_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit;
typedef enum {
envoy_config_route_v3_RateLimit_Action_MetaData_DYNAMIC = 0,
@@ -246,187 +253,331 @@ typedef enum {
} 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 envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(4, 4), 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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_hasbit(msg, 5); }
-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_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_VirtualHost*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_VirtualHost* ret = envoy_config_route_v3_VirtualHost_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_VirtualHost_serialize_ex(const envoy_config_route_v3_VirtualHost* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_name(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_VirtualHost_name(const envoy_config_route_v3_VirtualHost* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_domains(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 32));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_domains(const envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), 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(24, 40));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_routes(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+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(24, 40), len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_require_tls(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), 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(28, 48));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_virtual_clusters(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 48));
+}
+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(28, 48), 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(32, 56));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_rate_limits(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+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(32, 56), 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(36, 64));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 64));
+}
+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(36, 64), len);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_cors(const envoy_config_route_v3_VirtualHost* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_cors(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+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(40, 72), 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(44, 80));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_add(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(44, 80));
+}
+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(44, 80), len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_response_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 96));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_VirtualHost_request_headers_to_remove(const envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_request_attempt_count(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+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(56, 104));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_typed_per_filter_config(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(56, 104));
+}
+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(56, 104));
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_get(const envoy_config_route_v3_VirtualHost* msg, upb_StringView key, struct google_protobuf_Any** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(56, 104), &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(56, 104), iter);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_retry_policy(const envoy_config_route_v3_VirtualHost* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const upb_Message*) = NULL;
+}
+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(60, 112), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_hedge_policy(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const upb_Message*) = NULL;
+}
+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(64, 120), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_per_request_buffer_limit_bytes(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const upb_Message*) = NULL;
+}
+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(68, 128), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_include_attempt_count_in_response(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+}
+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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_retry_policy_typed_config(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const upb_Message*) = NULL;
+}
+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(72, 136), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_matcher(const envoy_config_route_v3_VirtualHost* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_matcher(const envoy_config_route_v3_VirtualHost* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 144), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_type_matcher_v3_Matcher* envoy_config_route_v3_VirtualHost_matcher(const envoy_config_route_v3_VirtualHost* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(76, 144), const struct xds_type_matcher_v3_Matcher*);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_has_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(80, 152));
+}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_clear_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg) {
+ _upb_array_detach(msg, UPB_SIZE(80, 152));
+}
+UPB_INLINE const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const* envoy_config_route_v3_VirtualHost_request_mirror_policies(const envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* const*)_upb_array_accessor(msg, UPB_SIZE(80, 152), len);
+}
+
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_name(envoy_config_route_v3_VirtualHost *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value;
+}
+UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_mutable_domains(envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len);
+}
+UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_domains(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_domains(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(3, 4), &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(24, 40), 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_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), 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_Message_New(&envoy_config_route_v3_Route_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &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(4, 4), 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_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(28, 48), 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_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_VirtualCluster_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(2, 3), &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_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(32, 56), 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_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RateLimit_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &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_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(36, 64), 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_accessor2(msg, UPB_SIZE(56, 104), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(56, 104), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), envoy_config_route_v3_CorsPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), 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) {
+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);
+ sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_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_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(44, 80), 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_accessor2(msg, UPB_SIZE(60, 112), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(60, 112), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &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_StringView* envoy_config_route_v3_VirtualHost_mutable_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), 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_accessor2(msg, UPB_SIZE(64, 120), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(64, 120), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_response_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(3, 4), &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_StringView* envoy_config_route_v3_VirtualHost_mutable_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), 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_accessor2(msg, UPB_SIZE(68, 128), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_VirtualHost_resize_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(68, 128), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_add_request_headers_to_remove(envoy_config_route_v3_VirtualHost* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &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_typed_per_filter_config_clear(envoy_config_route_v3_VirtualHost* msg) { _upb_msg_map_clear(msg, UPB_SIZE(56, 104)); }
+UPB_INLINE bool envoy_config_route_v3_VirtualHost_typed_per_filter_config_set(envoy_config_route_v3_VirtualHost* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(56, 104), &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_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(56, 104), &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(56, 104), 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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), envoy_config_route_v3_RetryPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_VirtualHost_set_retry_policy(msg, sub);
}
@@ -434,12 +585,12 @@ UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_Virtu
}
UPB_INLINE void envoy_config_route_v3_VirtualHost_set_hedge_policy(envoy_config_route_v3_VirtualHost *msg, envoy_config_route_v3_HedgePolicy* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), envoy_config_route_v3_HedgePolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), 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) {
+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);
+ sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_VirtualHost_set_hedge_policy(msg, sub);
}
@@ -447,12 +598,12 @@ UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_Virtu
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_VirtualHost_set_per_request_buffer_limit_bytes(msg, sub);
}
@@ -463,27 +614,54 @@ UPB_INLINE void envoy_config_route_v3_VirtualHost_set_include_attempt_count_in_r
}
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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_VirtualHost_set_retry_policy_typed_config(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_route_v3_VirtualHost_set_matcher(envoy_config_route_v3_VirtualHost *msg, struct xds_type_matcher_v3_Matcher* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 144), struct xds_type_matcher_v3_Matcher*) = value;
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher* envoy_config_route_v3_VirtualHost_mutable_matcher(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)envoy_config_route_v3_VirtualHost_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_VirtualHost_set_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_mutable_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t* len) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_array_mutable_accessor(msg, UPB_SIZE(80, 152), len);
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy** envoy_config_route_v3_VirtualHost_resize_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(80, 152), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_VirtualHost_add_request_mirror_policies(envoy_config_route_v3_VirtualHost* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy* sub = (struct envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(80, 152), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ 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_INLINE upb_StringView envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -495,35 +673,53 @@ UPB_INLINE void envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_set_
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_FilterAction*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_FilterAction* ret = envoy_config_route_v3_FilterAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_FilterAction_serialize_ex(const envoy_config_route_v3_FilterAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_FilterAction_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_FilterAction_clear_action(const envoy_config_route_v3_FilterAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Any*);
}
-
-UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_FilterAction_set_action(msg, sub);
}
@@ -532,95 +728,220 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterAction_mutabl
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_Route*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_Route* ret = envoy_config_route_v3_Route_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_Route_serialize_ex(const envoy_config_route_v3_Route* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_Route_msginit, options, 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_non_forwarding_action = 18,
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(56, 112), int32_t); }
-
-UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(56, 112)) == 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(52, 104), UPB_SIZE(56, 112), 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(56, 112)) == 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(52, 104), UPB_SIZE(56, 112), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route *msg) { return _upb_hasbit(msg, 2); }
-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(16, 32), 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_hasbit(msg, 3); }
-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(20, 40), 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(56, 112)) == 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(52, 104), UPB_SIZE(56, 112), 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(32, 64)); }
-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(32, 64), 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(36, 72)); }
-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(36, 72), 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(40, 80), 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(44, 88), 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(48, 96)); }
-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(48, 96)); }
-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(48, 96), &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(48, 96), 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route *msg) { return _upb_hasbit(msg, 4); }
-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(24, 48), 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_hasbit(msg, 5); }
-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(28, 56), 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(56, 112)) == 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(52, 104), UPB_SIZE(56, 112), 17, NULL); }
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_has_match(const envoy_config_route_v3_Route* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_match(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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, 8), 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(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_route(const envoy_config_route_v3_Route* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET);
+}
+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(56, 104), UPB_SIZE(4, 4), 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(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_redirect(const envoy_config_route_v3_Route* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET);
+}
+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(56, 104), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_has_metadata(const envoy_config_route_v3_Route* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_metadata(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_decorator(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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, 24), 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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_direct_response(const envoy_config_route_v3_Route* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET);
+}
+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(56, 104), UPB_SIZE(4, 4), 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(20, 32));
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_add(const envoy_config_route_v3_Route* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 32));
+}
+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(20, 32), 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(24, 40));
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_add(const envoy_config_route_v3_Route* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 40));
+}
+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(24, 40), len);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_response_headers_to_remove(const envoy_config_route_v3_Route* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 48));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_response_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_request_headers_to_remove(const envoy_config_route_v3_Route* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_Route_request_headers_to_remove(const envoy_config_route_v3_Route* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), 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(36, 64));
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_typed_per_filter_config(const envoy_config_route_v3_Route* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 64));
+}
+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(36, 64));
+}
+UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_get(const envoy_config_route_v3_Route* msg, upb_StringView key, struct google_protobuf_Any** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(36, 64), &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(36, 64), iter);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_name(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_Route_name(const envoy_config_route_v3_Route* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_has_tracing(const envoy_config_route_v3_Route* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_tracing(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const upb_Message*) = NULL;
+}
+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(48, 88), 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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL;
+}
+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(52, 96), 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(4, 4)) == 17;
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_filter_action(const envoy_config_route_v3_Route* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET);
+}
+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(56, 104), UPB_SIZE(4, 4), 17, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_Route_has_non_forwarding_action(const envoy_config_route_v3_Route* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18;
+}
+UPB_INLINE void envoy_config_route_v3_Route_clear_non_forwarding_action(const envoy_config_route_v3_Route* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(56, 104), 0, UPB_SIZE(4, 4), envoy_config_route_v3_Route_action_NOT_SET);
+}
+UPB_INLINE const envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_non_forwarding_action(const envoy_config_route_v3_Route* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(56, 104), UPB_SIZE(4, 4), 18, NULL);
+}
UPB_INLINE void envoy_config_route_v3_Route_set_match(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteMatch* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_route_v3_RouteMatch*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteMatch*)_upb_Message_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(52, 104), value, UPB_SIZE(56, 112), 2);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction*)_upb_Message_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(52, 104), value, UPB_SIZE(56, 112), 3);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RedirectAction*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RedirectAction*)_upb_Message_New(&envoy_config_route_v3_RedirectAction_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Route_set_redirect(msg, sub);
}
@@ -628,12 +949,12 @@ UPB_INLINE struct envoy_config_route_v3_RedirectAction* envoy_config_route_v3_Ro
}
UPB_INLINE void envoy_config_route_v3_Route_set_metadata(envoy_config_route_v3_Route *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_New(&envoy_config_core_v3_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Route_set_metadata(msg, sub);
}
@@ -641,90 +962,92 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_Route_mut
}
UPB_INLINE void envoy_config_route_v3_Route_set_decorator(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Decorator* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_route_v3_Decorator*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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) {
+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);
+ sub = (struct envoy_config_route_v3_Decorator*)_upb_Message_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(52, 104), value, UPB_SIZE(56, 112), 7);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_DirectResponseAction*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_DirectResponseAction*)_upb_Message_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(32, 64), len);
+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(20, 32), 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &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(36, 72), len);
+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(24, 40), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &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(40, 80), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), 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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_response_headers_to_remove(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_Route_add_response_headers_to_remove(envoy_config_route_v3_Route* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(3, 4), &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(44, 88), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_Route_mutable_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_config_route_v3_Route_resize_request_headers_to_remove(envoy_config_route_v3_Route* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_Route_add_request_headers_to_remove(envoy_config_route_v3_Route* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(3, 4), &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(48, 96)); }
-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(48, 96), &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(48, 96), &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(48, 96), 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(4, 8), upb_strview) = value;
+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(36, 64)); }
+UPB_INLINE bool envoy_config_route_v3_Route_typed_per_filter_config_set(envoy_config_route_v3_Route* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(36, 64), &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_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(36, 64), &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(36, 64), iter);
+}
+UPB_INLINE void envoy_config_route_v3_Route_set_name(envoy_config_route_v3_Route *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_Route_set_tracing(envoy_config_route_v3_Route *msg, envoy_config_route_v3_Tracing* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), envoy_config_route_v3_Tracing*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), 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) {
+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);
+ sub = (struct envoy_config_route_v3_Tracing*)_upb_Message_New(&envoy_config_route_v3_Tracing_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Route_set_tracing(msg, sub);
}
@@ -732,39 +1055,53 @@ UPB_INLINE struct envoy_config_route_v3_Tracing* envoy_config_route_v3_Route_mut
}
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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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(52, 104), value, UPB_SIZE(56, 112), 17);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_FilterAction*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_FilterAction*)_upb_Message_New(&envoy_config_route_v3_FilterAction_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Route_set_filter_action(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_route_v3_Route_set_non_forwarding_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_NonForwardingAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(56, 104), value, UPB_SIZE(4, 4), 18);
+}
+UPB_INLINE struct envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_mutable_non_forwarding_action(envoy_config_route_v3_Route* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_NonForwardingAction* sub = (struct envoy_config_route_v3_NonForwardingAction*)envoy_config_route_v3_Route_non_forwarding_action(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_non_forwarding_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_INLINE upb_StringView envoy_config_route_v3_Route_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_Route_TypedPerFilterConfigEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -776,107 +1113,242 @@ UPB_INLINE void envoy_config_route_v3_Route_TypedPerFilterConfigEntry_set_value(
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_WeightedCluster*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_WeightedCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_WeightedCluster* ret = envoy_config_route_v3_WeightedCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_WeightedCluster_serialize_ex(const envoy_config_route_v3_WeightedCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_route_v3_WeightedCluster_random_value_specifier_header_name = 4,
+ envoy_config_route_v3_WeightedCluster_random_value_specifier_NOT_SET = 0
+} envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases envoy_config_route_v3_WeightedCluster_random_value_specifier_case(const envoy_config_route_v3_WeightedCluster* msg) {
+ return (envoy_config_route_v3_WeightedCluster_random_value_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+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(16, 24));
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_clusters(const envoy_config_route_v3_WeightedCluster* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 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(16, 24), len);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_runtime_key_prefix(const envoy_config_route_v3_WeightedCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_total_weight(const envoy_config_route_v3_WeightedCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 48), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_header_name(const envoy_config_route_v3_WeightedCluster* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_clear_header_name(const envoy_config_route_v3_WeightedCluster* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_WeightedCluster_random_value_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_header_name(const envoy_config_route_v3_WeightedCluster* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 4, upb_StringView_FromString(""));
}
-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(16, 32)); }
-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(16, 32), 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_has_total_weight(const envoy_config_route_v3_WeightedCluster *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(16, 32), len);
+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(16, 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(2, 3), &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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_runtime_key_prefix(envoy_config_route_v3_WeightedCluster *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_total_weight(envoy_config_route_v3_WeightedCluster *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_route_v3_WeightedCluster_mutable_total_weight(envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_WeightedCluster_set_total_weight(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_set_header_name(envoy_config_route_v3_WeightedCluster *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 4);
+}
/* 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 envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(20, 40)); }
-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(20, 40), 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(24, 48)); }
-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(24, 48), 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(28, 56), 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(32, 64), 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(36, 72)); }
-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(36, 72)); }
-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(36, 72), &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(36, 72), 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(4, 8), upb_strview) = value;
+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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_route_v3_WeightedCluster_ClusterWeight_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_WeightedCluster_ClusterWeight* ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_WeightedCluster_ClusterWeight_serialize_ex(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_host_rewrite_literal = 11,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_NOT_SET = 0
+} envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_case(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return (envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 48), 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(32, 56));
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+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(32, 56), 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(36, 64));
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 64));
+}
+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(36, 64), len);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ _upb_array_detach(msg, UPB_SIZE(40, 72));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ _upb_array_detach(msg, UPB_SIZE(44, 80));
+}
+UPB_INLINE upb_StringView const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), 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(48, 88));
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+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(48, 88));
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key, struct google_protobuf_Any** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(48, 88), &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(48, 88), iter);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11;
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 11, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_clear_cluster_header(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_cluster_header(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView);
+}
+
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_name(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_route_v3_WeightedCluster_ClusterWeight_mutable_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(msg, sub);
}
@@ -884,77 +1356,87 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedClu
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_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(20, 40), len);
+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(32, 56), 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &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(24, 48), len);
+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(36, 64), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &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(28, 56), len);
+UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE upb_StringView* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
+}
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 80), UPB_SIZE(3, 4), &val, arena);
}
-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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), 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(48, 88)); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key, struct google_protobuf_Any* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(48, 88), &key, 0, &val, sizeof(val), a);
}
-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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(48, 88), &key, 0);
}
-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(32, 64), len);
+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(48, 88), iter);
}
-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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_host_rewrite_literal(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 11);
}
-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_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_cluster_header(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), upb_StringView) = value;
}
-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(36, 72)); }
-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(36, 72), &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(36, 72), &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(36, 72), 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_INLINE upb_StringView envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_key(const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -966,24 +1448,35 @@ UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilt
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteMatch*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteMatch* ret = envoy_config_route_v3_RouteMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RouteMatch_serialize_ex(const envoy_config_route_v3_RouteMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_route_v3_RouteMatch_path_specifier_prefix = 1,
envoy_config_route_v3_RouteMatch_path_specifier_path = 2,
@@ -991,82 +1484,160 @@ typedef enum {
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(36, 72), 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(36, 72)) == 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(28, 56), UPB_SIZE(36, 72), 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(36, 72)) == 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(28, 56), UPB_SIZE(36, 72), 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_hasbit(msg, 1); }
-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(4, 8), 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(20, 40)); }
-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(20, 40), 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(24, 48)); }
-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(24, 48), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch *msg) { return _upb_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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(36, 72)) == 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(28, 56), UPB_SIZE(36, 72), 10, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return _upb_hasbit(msg, 4); }
-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(16, 32), 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(36, 72)) == 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(28, 56), UPB_SIZE(36, 72), 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(28, 56), value, UPB_SIZE(36, 72), 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(28, 56), value, UPB_SIZE(36, 72), 2);
+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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_prefix(const envoy_config_route_v3_RouteMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_path(const envoy_config_route_v3_RouteMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_case_sensitive(const envoy_config_route_v3_RouteMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), 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(20, 32));
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_headers(const envoy_config_route_v3_RouteMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 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(20, 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(24, 40));
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_query_parameters(const envoy_config_route_v3_RouteMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 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(24, 40), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_route_v3_RouteMatch* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_grpc(const envoy_config_route_v3_RouteMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 48), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_runtime_fraction(const envoy_config_route_v3_RouteMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(32, 56), 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(4, 4)) == 10;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_safe_regex(const envoy_config_route_v3_RouteMatch* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 10, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_tls_context(const envoy_config_route_v3_RouteMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+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(36, 64), 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(4, 4)) == 12;
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_connect_matcher(const envoy_config_route_v3_RouteMatch* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 12, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(40, 72));
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_clear_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(40, 72));
+}
+UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* const* envoy_config_route_v3_RouteMatch_dynamic_metadata(const envoy_config_route_v3_RouteMatch* msg, size_t* len) {
+ return (const struct envoy_type_matcher_v3_MetadataMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len);
+}
+
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_prefix(envoy_config_route_v3_RouteMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path(envoy_config_route_v3_RouteMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
}
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_case_sensitive(envoy_config_route_v3_RouteMatch *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_config_route_v3_RouteMatch_mutable_case_sensitive(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(20, 40), len);
+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(20, 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &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(24, 48), len);
+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(24, 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_QueryParameterMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 40), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_New(&envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteMatch_set_grpc(msg, sub);
}
@@ -1074,24 +1645,24 @@ UPB_INLINE struct envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_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(28, 56), value, UPB_SIZE(36, 72), 10);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteMatch_set_safe_regex(msg, sub);
}
@@ -1099,85 +1670,133 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_Rout
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_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(28, 56), value, UPB_SIZE(36, 72), 12);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_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;
}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_mutable_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t* len) {
+ return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_resize_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_route_v3_RouteMatch_add_dynamic_metadata(envoy_config_route_v3_RouteMatch* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_New(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serialize_ex(const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_serialize_ex(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_clear_validated(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_BoolValue*);
}
-
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_presented(envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_presented(msg, sub);
}
@@ -1187,10 +1806,10 @@ UPB_INLINE void envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_vali
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_set_validated(msg, sub);
}
@@ -1199,97 +1818,168 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_Tl
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteMatch_ConnectMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_ConnectMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteMatch_ConnectMatcher* ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize_ex(const envoy_config_route_v3_RouteMatch_ConnectMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_CorsPolicy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_CorsPolicy* ret = envoy_config_route_v3_CorsPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_CorsPolicy_serialize_ex(const envoy_config_route_v3_CorsPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, options, 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(52, 104), 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(4, 8), 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(12, 24), 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(20, 40), 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(28, 56), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_hasbit(msg, 1); }
-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(36, 72), 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(52, 104)) == 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(48, 96), UPB_SIZE(52, 104), 9, NULL); }
-UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy *msg) { return _upb_hasbit(msg, 2); }
-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(40, 80), 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(44, 88)); }
-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(44, 88), len); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_methods(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_allow_methods(const envoy_config_route_v3_CorsPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_headers(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_allow_headers(const envoy_config_route_v3_CorsPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_expose_headers(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_expose_headers(const envoy_config_route_v3_CorsPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_max_age(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_CorsPolicy_max_age(const envoy_config_route_v3_CorsPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_credentials(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+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(40, 72), 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(4, 4)) == 9;
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_filter_enabled(const envoy_config_route_v3_CorsPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(52, 96), 0, UPB_SIZE(4, 4), envoy_config_route_v3_CorsPolicy_enabled_specifier_NOT_SET);
+}
+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(52, 96), UPB_SIZE(4, 4), 9, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_CorsPolicy_has_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_shadow_enabled(const envoy_config_route_v3_CorsPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL;
+}
+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(44, 80), 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(48, 88));
+}
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_clear_allow_origin_string_match(const envoy_config_route_v3_CorsPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+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(48, 88), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_methods(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_headers(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_expose_headers(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = 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(28, 56), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_max_age(envoy_config_route_v3_CorsPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_CorsPolicy_set_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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_route_v3_CorsPolicy_mutable_allow_credentials(envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(48, 96), value, UPB_SIZE(52, 104), 9);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_RuntimeFractionalPercent*, UPB_SIZE(52, 96), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_CorsPolicy_set_filter_enabled(msg, sub);
}
@@ -1297,59 +1987,71 @@ UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_ro
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_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(44, 88), len);
+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(48, 88), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction* ret = envoy_config_route_v3_RouteAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RouteAction_serialize_ex(const envoy_config_route_v3_RouteAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_msginit, options, 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_cluster_specifier_plugin = 37,
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(104, 192), int32_t); }
-
+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(20, 20), 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,
@@ -1357,76 +2059,287 @@ typedef enum {
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(116, 216), 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(104, 192)) == 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(96, 176), UPB_SIZE(104, 192), 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(104, 192)) == 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(96, 176), UPB_SIZE(104, 192), 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(104, 192)) == 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(96, 176), UPB_SIZE(104, 192), 3, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 1); }
-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(24, 32), 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(16, 16), 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(116, 216)) == 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(108, 200), UPB_SIZE(116, 216), 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(116, 216)) == 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(108, 200), UPB_SIZE(116, 216), 7, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 2); }
-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(28, 40), 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_hasbit(msg, 3); }
-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(32, 48), 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(4, 4), 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(80, 144)); }
-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(80, 144), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 4); }
-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(36, 56), 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(84, 152)); }
-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(84, 152), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 5); }
-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(40, 64), 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_hasbit(msg, 6); }
-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(44, 72), 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_hasbit(msg, 7); }
-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(48, 80), 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(88, 160)); }
-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(88, 160), 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(12, 12), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 8); }
-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(52, 88), 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_hasbit(msg, 9); }
-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(56, 96), 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(116, 216)) == 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(108, 200), UPB_SIZE(116, 216), 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(92, 168)); }
-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(92, 168), len); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_internal_redirects(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 10); }
-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(60, 104), 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_hasbit(msg, 11); }
-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(64, 112), 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_hasbit(msg, 12); }
-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(68, 120), 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_hasbit(msg, 13); }
-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(72, 128), 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(116, 216)) == 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(108, 200), UPB_SIZE(116, 216), 35, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 14); }
-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(76, 136), 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(96, 176), value, UPB_SIZE(104, 192), 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(96, 176), value, UPB_SIZE(104, 192), 2);
+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(16, 16), 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(20, 20)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(20, 20), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster(const envoy_config_route_v3_RouteAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(20, 20), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_header(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_header(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(20, 20), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster_header(const envoy_config_route_v3_RouteAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(20, 20), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_weighted_clusters(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(36, 48), 0, UPB_SIZE(20, 20), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET);
+}
+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(36, 48), UPB_SIZE(20, 20), 3, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_metadata_match(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_metadata_match(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), const upb_Message*) = NULL;
+}
+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(44, 64), const struct envoy_config_core_v3_Metadata*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_prefix_rewrite(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_prefix_rewrite(const envoy_config_route_v3_RouteAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView);
+}
+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(16, 16)) == 6;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_host_rewrite_literal(const envoy_config_route_v3_RouteAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 6, upb_StringView_FromString(""));
+}
+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(16, 16)) == 7;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_auto_host_rewrite(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(28, 32), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET);
+}
+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(28, 32), UPB_SIZE(16, 16), 7, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_timeout(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_timeout(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL;
+}
+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(56, 88), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const upb_Message*) = NULL;
+}
+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(60, 96), const envoy_config_route_v3_RetryPolicy*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_priority(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_route_v3_RouteAction_priority(const envoy_config_route_v3_RouteAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(64, 104));
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_rate_limits(const envoy_config_route_v3_RouteAction* msg) {
+ _upb_array_detach(msg, UPB_SIZE(64, 104));
+}
+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(64, 104), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_include_vh_rate_limits(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const upb_Message*) = NULL;
+}
+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(68, 112), 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(72, 120));
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hash_policy(const envoy_config_route_v3_RouteAction* msg) {
+ _upb_array_detach(msg, UPB_SIZE(72, 120));
+}
+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(72, 120), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cors(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cors(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const upb_Message*) = NULL;
+}
+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(76, 128), const envoy_config_route_v3_CorsPolicy*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_not_found_response_code(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_grpc_timeout(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const upb_Message*) = NULL;
+}
+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(80, 136), 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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_idle_timeout(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const upb_Message*) = NULL;
+}
+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(84, 144), 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(88, 152));
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_upgrade_configs(const envoy_config_route_v3_RouteAction* msg) {
+ _upb_array_detach(msg, UPB_SIZE(88, 152));
+}
+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(88, 152), len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_action(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+}
+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(12, 12), int32_t);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_hedge_policy(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_hedge_policy(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 160), const upb_Message*) = NULL;
+}
+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(92, 160), 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_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_grpc_timeout_offset(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const upb_Message*) = NULL;
+}
+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(96, 168), 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(16, 16)) == 29;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_host_rewrite_header(const envoy_config_route_v3_RouteAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), UPB_SIZE(16, 16), 29, upb_StringView_FromString(""));
+}
+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 void envoy_config_route_v3_RouteAction_clear_request_mirror_policies(const envoy_config_route_v3_RouteAction* msg) {
+ _upb_array_detach(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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_internal_redirects(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const upb_Message*) = NULL;
+}
+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(104, 184), 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_regex_rewrite(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 192), const upb_Message*) = NULL;
+}
+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(108, 192), 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_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_retry_policy_typed_config(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 200), const upb_Message*) = NULL;
+}
+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(112, 200), 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_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_internal_redirect_policy(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const upb_Message*) = NULL;
+}
+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(116, 208), 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(16, 16)) == 35;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 32), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RouteAction_host_rewrite_specifier_NOT_SET);
+}
+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(28, 32), UPB_SIZE(16, 16), 35, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_max_stream_duration(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const upb_Message*) = NULL;
+}
+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(120, 216), const envoy_config_route_v3_RouteAction_MaxStreamDuration*);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(20, 20)) == 37;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(20, 20), envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), UPB_SIZE(20, 20), 37, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_clear_append_x_forwarded_host(const envoy_config_route_v3_RouteAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_append_x_forwarded_host(const envoy_config_route_v3_RouteAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
+
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(20, 20), 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_header(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(20, 20), 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(96, 176), value, UPB_SIZE(104, 192), 3);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_WeightedCluster*, UPB_SIZE(36, 48), value, UPB_SIZE(20, 20), 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) {
+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);
+ sub = (struct envoy_config_route_v3_WeightedCluster*)_upb_Message_New(&envoy_config_route_v3_WeightedCluster_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_weighted_clusters(msg, sub);
}
@@ -1434,30 +2347,30 @@ UPB_INLINE struct envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_R
}
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 64), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Metadata*)_upb_Message_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(16, 16), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_prefix_rewrite(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = 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(108, 200), value, UPB_SIZE(116, 216), 6);
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_literal(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 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(108, 200), value, UPB_SIZE(116, 216), 7);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_BoolValue*, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_auto_host_rewrite(msg, sub);
}
@@ -1465,12 +2378,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_m
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), 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_timeout(envoy_config_route_v3_RouteAction *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_timeout(msg, sub);
}
@@ -1478,12 +2391,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mu
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_retry_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_RetryPolicy* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), envoy_config_route_v3_RetryPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RetryPolicy*)_upb_Message_New(&envoy_config_route_v3_RetryPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_retry_policy(msg, sub);
}
@@ -1492,53 +2405,51 @@ UPB_INLINE struct envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_Route
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(4, 4), 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(80, 144), len);
+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(64, 104), 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_accessor2(msg, UPB_SIZE(80, 144), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(64, 104), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(80, 144), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RateLimit_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(64, 104), UPB_SIZE(2, 3), &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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 112), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(84, 152), len);
+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(72, 120), 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_accessor2(msg, UPB_SIZE(84, 152), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(72, 120), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(84, 152), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(72, 120), UPB_SIZE(2, 3), &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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_route_v3_CorsPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 128), 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) {
+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);
+ sub = (struct envoy_config_route_v3_CorsPolicy*)_upb_Message_New(&envoy_config_route_v3_CorsPolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_cors(msg, sub);
}
@@ -1549,12 +2460,12 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_not_found_response
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_max_grpc_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_max_grpc_timeout(msg, sub);
}
@@ -1562,27 +2473,26 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_mu
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_idle_timeout(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 144), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(88, 160), len);
+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(88, 152), 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_accessor2(msg, UPB_SIZE(88, 160), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(88, 152), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(88, 160), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(88, 152), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -1591,12 +2501,12 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_set_internal_redirect_action(e
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_hedge_policy(envoy_config_route_v3_RouteAction *msg, envoy_config_route_v3_HedgePolicy* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), envoy_config_route_v3_HedgePolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 160), 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) {
+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);
+ sub = (struct envoy_config_route_v3_HedgePolicy*)_upb_Message_New(&envoy_config_route_v3_HedgePolicy_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_hedge_policy(msg, sub);
}
@@ -1604,41 +2514,40 @@ UPB_INLINE struct envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_Route
}
UPB_INLINE void envoy_config_route_v3_RouteAction_set_grpc_timeout_offset(envoy_config_route_v3_RouteAction *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 168), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(108, 200), value, UPB_SIZE(116, 216), 29);
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_host_rewrite_header(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 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(92, 168), len);
+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_accessor2(msg, UPB_SIZE(92, 168), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(100, 176), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(92, 168), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(100, 176), UPB_SIZE(2, 3), &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_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 184), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_max_internal_redirects(msg, sub);
}
@@ -1646,12 +2555,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteAction
}
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_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct envoy_type_matcher_v3_RegexMatchAndSubstitute*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 192), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_regex_rewrite(msg, sub);
}
@@ -1659,12 +2568,12 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro
}
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_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 200), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_retry_policy_typed_config(msg, sub);
}
@@ -1672,24 +2581,24 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RouteAction_mutable
}
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_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 128), envoy_config_route_v3_InternalRedirectPolicy*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 208), 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) {
+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);
+ sub = (struct envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_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(108, 200), value, UPB_SIZE(116, 216), 35);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 32), value, UPB_SIZE(16, 16), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_set_host_rewrite_path_regex(msg, sub);
}
@@ -1697,55 +2606,91 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro
}
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_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), envoy_config_route_v3_RouteAction_MaxStreamDuration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 216), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_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;
}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_specifier_plugin(envoy_config_route_v3_RouteAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(36, 48), value, UPB_SIZE(20, 20), 37);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_append_x_forwarded_host(envoy_config_route_v3_RouteAction *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_RequestMirrorPolicy*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_RequestMirrorPolicy* ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RouteAction_RequestMirrorPolicy_serialize_ex(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_cluster(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_RequestMirrorPolicy_cluster(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_clear_trace_sampled(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct google_protobuf_BoolValue*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_RequestMirrorPolicy_has_runtime_fraction(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_cluster(envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_runtime_fraction(msg, sub);
}
@@ -1755,10 +2700,10 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_RequestMirrorPolicy_set_trace_sampled(msg, sub);
}
@@ -1767,24 +2712,35 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_RouteAction_R
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_RouteAction_HashPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy* ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RouteAction_HashPolicy_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, options, arena, len);
}
-
typedef enum {
envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_header = 1,
envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_cookie = 2,
@@ -1793,51 +2749,92 @@ typedef enum {
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 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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_header(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_cookie(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_connection_properties(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_terminal(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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(4, 4)) == 5;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_query_parameter(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(4, 4)) == 6;
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_clear_filter_state(const envoy_config_route_v3_RouteAction_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Header*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_Cookie*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_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);
}
@@ -1847,24 +2844,24 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_set_terminal(envoy_
*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_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RouteAction_HashPolicy_FilterState*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_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);
}
@@ -1873,39 +2870,62 @@ UPB_INLINE struct envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envo
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_Header*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_route_v3_RouteAction_HashPolicy_Header_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_Header* ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RouteAction_HashPolicy_Header_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_clear_header_name(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Header_has_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_clear_regex_rewrite(const envoy_config_route_v3_RouteAction_HashPolicy_Header* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Header_set_header_name(envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_HashPolicy_Header_set_regex_rewrite(msg, sub);
}
@@ -1914,70 +2934,114 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_Cookie*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_Cookie* ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RouteAction_HashPolicy_Cookie_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_name(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_Cookie_name(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_HashPolicy_Cookie_has_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_ttl(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_clear_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_HashPolicy_Cookie_path(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(20, 40), 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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_name(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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_route_v3_RouteAction_HashPolicy_Cookie_mutable_ttl(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_Cookie_set_path(envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, options, arena, len);
}
-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 void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_clear_source_ip(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 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;
@@ -1985,93 +3049,155 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_ConnectionPropertie
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, options, arena, len);
}
-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 void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_clear_name(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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;
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_set_name(envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_HashPolicy_FilterState*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_HashPolicy_FilterState* ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_RouteAction_HashPolicy_FilterState_serialize_ex(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, options, arena, len);
}
-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 void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_clear_key(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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;
+UPB_INLINE void envoy_config_route_v3_RouteAction_HashPolicy_FilterState_set_key(envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_UpgradeConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RouteAction_UpgradeConfig_serialize_ex(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_upgrade_type(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RouteAction_UpgradeConfig_upgrade_type(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_clear_connect_config(const envoy_config_route_v3_RouteAction_UpgradeConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_has_enabled(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_upgrade_type(envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_UpgradeConfig_set_enabled(msg, sub);
}
@@ -2081,10 +3207,10 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_set_connect_conf
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_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);
}
@@ -2093,36 +3219,59 @@ UPB_INLINE struct envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_serialize_ex(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_proxy_protocol_config(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_ProxyProtocolConfig*);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_clear_allow_post(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_allow_post(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-
-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_hasbit(msg, 1); }
-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(4, 8), const struct envoy_config_core_v3_ProxyProtocolConfig*); }
-UPB_INLINE bool envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_allow_post(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ProxyProtocolConfig*)_upb_Message_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);
}
@@ -2134,39 +3283,71 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_se
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RouteAction_MaxStreamDuration*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_MaxStreamDuration_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RouteAction_MaxStreamDuration* ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_RouteAction_MaxStreamDuration_serialize_ex(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_max(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_clear_grpc_timeout_header_offset(const envoy_config_route_v3_RouteAction_MaxStreamDuration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_route_v3_RouteAction_MaxStreamDuration_has_max_stream_duration(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_sethas(msg, 1);
*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_max_stream_duration(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_MaxStreamDuration_set_max_stream_duration(msg, sub);
}
@@ -2176,10 +3357,10 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_tim
_upb_sethas(msg, 2);
*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_max(envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_max(msg, sub);
}
@@ -2189,10 +3370,10 @@ UPB_INLINE void envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_tim
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RouteAction_MaxStreamDuration_set_grpc_timeout_header_offset(msg, sub);
}
@@ -2201,55 +3382,155 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RouteAction_Ma
/* 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 envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(16, 16), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 1); }
-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(24, 32), 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_hasbit(msg, 2); }
-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(28, 40), 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_hasbit(msg, 3); }
-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(32, 48), 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(44, 72)); }
-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(44, 72), 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(8, 8), 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(48, 80), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 4); }
-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(36, 56), 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(52, 88)); }
-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(52, 88), 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(56, 96)); }
-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(56, 96), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 5); }
-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(40, 64), 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(16, 16), upb_strview) = value;
+UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy* ret = envoy_config_route_v3_RetryPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RetryPolicy_serialize_ex(const envoy_config_route_v3_RetryPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_on(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_retry_on(const envoy_config_route_v3_RetryPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_num_retries(const envoy_config_route_v3_RetryPolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_num_retries(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_timeout(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_priority(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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(20, 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(24, 48));
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_host_predicate(const envoy_config_route_v3_RetryPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+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(24, 48), len);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), int64_t) = 0;
+}
+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(56, 112), int64_t);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_status_codes(const envoy_config_route_v3_RetryPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+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(28, 56), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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(32, 64), 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(36, 72));
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_headers(const envoy_config_route_v3_RetryPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 72));
+}
+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(36, 72), 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(40, 80));
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retriable_request_headers(const envoy_config_route_v3_RetryPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(40, 80));
+}
+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(40, 80), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
+}
+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(44, 88), const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96));
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 96));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_RetryPolicy_retry_options_predicates(const envoy_config_route_v3_RetryPolicy* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_clear_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct google_protobuf_Duration*);
+}
+
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_on(envoy_config_route_v3_RetryPolicy *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_num_retries(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), 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_route_v3_RetryPolicy_mutable_num_retries(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_set_num_retries(msg, sub);
}
@@ -2257,12 +3538,12 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RetryPolicy
}
UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), 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_RetryPolicy_mutable_per_try_timeout(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_set_per_try_timeout(msg, sub);
}
@@ -2270,136 +3551,181 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mu
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), envoy_config_route_v3_RetryPolicy_RetryPriority*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 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) {
+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);
+ sub = (struct envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_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(44, 72), len);
+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(24, 48), 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_accessor2(msg, UPB_SIZE(44, 72), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(44, 72), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &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(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), 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(48, 80), len);
+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(28, 56), 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_accessor2(msg, UPB_SIZE(48, 80), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, 2, 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_accessor2(msg, UPB_SIZE(48, 80), 2, &val,
- 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_accessor2(msg, UPB_SIZE(28, 56), 2, &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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), envoy_config_route_v3_RetryPolicy_RetryBackOff*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_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(52, 88), len);
+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(36, 72), 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_accessor2(msg, UPB_SIZE(52, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(52, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &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(56, 96), len);
+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(40, 80), 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_accessor2(msg, UPB_SIZE(56, 96), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(56, 96), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_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;
}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_mutable_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t* len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_resize_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RetryPolicy_add_retry_options_predicates(envoy_config_route_v3_RetryPolicy* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_idle_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_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryPriority*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_RetryPriority_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy_RetryPriority* ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RetryPriority_serialize_ex(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_name(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_RetryPriority_name(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryPriority_clear_typed_config(const envoy_config_route_v3_RetryPolicy_RetryPriority* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_RetryPriority_set_typed_config(msg, sub);
}
@@ -2408,44 +3734,68 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryPr
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy_RetryHostPredicate* ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RetryHostPredicate_serialize_ex(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_RetryHostPredicate_name(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryHostPredicate_clear_typed_config(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_RetryHostPredicate_set_typed_config(msg, sub);
}
@@ -2454,37 +3804,62 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_RetryPolicy_RetryHo
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy_RetryBackOff*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_RetryBackOff_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy_RetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RetryPolicy_RetryBackOff_serialize_ex(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_clear_max_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Duration*);
}
-
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RetryBackOff_has_base_interval(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_base_interval(envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_RetryBackOff_set_base_interval(msg, sub);
}
@@ -2494,10 +3869,10 @@ UPB_INLINE void envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_RetryBackOff_set_max_interval(msg, sub);
}
@@ -2506,29 +3881,50 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_Re
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy_ResetHeader*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_RetryPolicy_ResetHeader_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy_ResetHeader* ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RetryPolicy_ResetHeader_serialize_ex(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_clear_name(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RetryPolicy_ResetHeader_name(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_clear_format(const envoy_config_route_v3_RetryPolicy_ResetHeader* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 upb_strview envoy_config_route_v3_RetryPolicy_ResetHeader_name(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_name(envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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;
@@ -2536,50 +3932,74 @@ UPB_INLINE void envoy_config_route_v3_RetryPolicy_ResetHeader_set_format(envoy_c
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_serialize_ex(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, options, 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 void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_reset_headers(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) {
+ _upb_array_detach(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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_clear_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Duration*);
}
-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(8, 16)); }
-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(8, 16), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_has_max_interval(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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(8, 16), len);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_RetryPolicy_RateLimitedRetryBackOff_mutable_max_interval(envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_set_max_interval(msg, sub);
}
@@ -2588,38 +4008,68 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_Ra
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_HedgePolicy*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_HedgePolicy* ret = envoy_config_route_v3_HedgePolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_HedgePolicy_serialize_ex(const envoy_config_route_v3_HedgePolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_HedgePolicy_clear_additional_request_chance(const envoy_config_route_v3_HedgePolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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 void envoy_config_route_v3_HedgePolicy_clear_hedge_on_per_try_timeout(const envoy_config_route_v3_HedgePolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
}
-
-UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy *msg) { return _upb_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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(1, 1), bool); }
UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_initial_requests(envoy_config_route_v3_HedgePolicy *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_HedgePolicy_set_initial_requests(msg, sub);
}
@@ -2629,10 +4079,10 @@ UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_additional_request_chance(
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_HedgePolicy_set_additional_request_chance(msg, sub);
}
@@ -2644,85 +4094,153 @@ UPB_INLINE void envoy_config_route_v3_HedgePolicy_set_hedge_on_per_try_timeout(e
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RedirectAction*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RedirectAction* ret = envoy_config_route_v3_RedirectAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RedirectAction_serialize_ex(const envoy_config_route_v3_RedirectAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msginit, options, 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(40, 72), int32_t); }
-
+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(8, 8), 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_regex_rewrite = 9,
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(28, 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(12, 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(28, 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(20, 32), UPB_SIZE(28, 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(40, 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(32, 56), UPB_SIZE(40, 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(28, 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(20, 32), UPB_SIZE(28, 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(8, 8), 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(40, 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(32, 56), UPB_SIZE(40, 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(4, 4), uint32_t); }
-UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_regex_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 9; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_regex_rewrite(const envoy_config_route_v3_RedirectAction *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(20, 32), UPB_SIZE(28, 48), 9, NULL); }
-
-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(12, 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(20, 32), value, UPB_SIZE(28, 48), 2);
+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(16, 16), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_host_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_host_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_path_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_path_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_path_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_response_code(const envoy_config_route_v3_RedirectAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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(8, 8)) == 4;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_https_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(20, 24), 0, UPB_SIZE(8, 8), envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET);
+}
+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(20, 24), UPB_SIZE(8, 8), 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(16, 16)) == 5;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_prefix_rewrite(const envoy_config_route_v3_RedirectAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 5, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_strip_query(const envoy_config_route_v3_RedirectAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_strip_query(const envoy_config_route_v3_RedirectAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(8, 8)) == 7;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(8, 8), envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RedirectAction_scheme_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), UPB_SIZE(8, 8), 7, upb_StringView_FromString(""));
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_port_redirect(const envoy_config_route_v3_RedirectAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0;
+}
+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(12, 12), uint32_t);
+}
+UPB_INLINE bool envoy_config_route_v3_RedirectAction_has_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(16, 16)) == 9;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_clear_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), 0, UPB_SIZE(16, 16), envoy_config_route_v3_RedirectAction_path_rewrite_specifier_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_regex_rewrite(const envoy_config_route_v3_RedirectAction* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), UPB_SIZE(16, 16), 9, NULL);
+}
+
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_host_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_path_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 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(32, 56), value, UPB_SIZE(40, 72), 4);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(20, 24), value, UPB_SIZE(8, 8), 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(20, 32), value, UPB_SIZE(28, 48), 5);
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_prefix_rewrite(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 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(8, 8), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(32, 56), value, UPB_SIZE(40, 72), 7);
+UPB_INLINE void envoy_config_route_v3_RedirectAction_set_scheme_redirect(envoy_config_route_v3_RedirectAction *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(20, 24), value, UPB_SIZE(8, 8), 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(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = value;
}
UPB_INLINE void envoy_config_route_v3_RedirectAction_set_regex_rewrite(envoy_config_route_v3_RedirectAction *msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(20, 32), value, UPB_SIZE(28, 48), 9);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(28, 40), value, UPB_SIZE(16, 16), 9);
}
-UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_mutable_regex_rewrite(envoy_config_route_v3_RedirectAction *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RedirectAction_mutable_regex_rewrite(envoy_config_route_v3_RedirectAction* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_RegexMatchAndSubstitute* sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)envoy_config_route_v3_RedirectAction_regex_rewrite(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RedirectAction_set_regex_rewrite(msg, sub);
}
@@ -2731,27 +4249,50 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_ro
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_DirectResponseAction*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_DirectResponseAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_DirectResponseAction* ret = envoy_config_route_v3_DirectResponseAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_DirectResponseAction_serialize_ex(const envoy_config_route_v3_DirectResponseAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, options, arena, len);
}
-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 void envoy_config_route_v3_DirectResponseAction_clear_status(const envoy_config_route_v3_DirectResponseAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_route_v3_DirectResponseAction_status(const envoy_config_route_v3_DirectResponseAction* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_DirectResponseAction_clear_body(const envoy_config_route_v3_DirectResponseAction* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), const struct envoy_config_core_v3_DataSource*);
}
-
-UPB_INLINE uint32_t envoy_config_route_v3_DirectResponseAction_status(const envoy_config_route_v3_DirectResponseAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
-UPB_INLINE bool envoy_config_route_v3_DirectResponseAction_has_body(const envoy_config_route_v3_DirectResponseAction *msg) { return _upb_hasbit(msg, 1); }
-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(8, 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(4, 4), uint32_t) = value;
@@ -2760,51 +4301,107 @@ UPB_INLINE void envoy_config_route_v3_DirectResponseAction_set_body(envoy_config
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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 */
+/* envoy.config.route.v3.NonForwardingAction */
-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_NonForwardingAction* envoy_config_route_v3_NonForwardingAction_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_NonForwardingAction*)_upb_Message_New(&envoy_config_route_v3_NonForwardingAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonForwardingAction_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_route_v3_NonForwardingAction* ret = envoy_config_route_v3_NonForwardingAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonForwardingAction_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_NonForwardingAction* ret = envoy_config_route_v3_NonForwardingAction_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_NonForwardingAction_serialize(const envoy_config_route_v3_NonForwardingAction* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, 0, arena, len);
}
-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 char* envoy_config_route_v3_NonForwardingAction_serialize_ex(const envoy_config_route_v3_NonForwardingAction* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, options, 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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_Decorator* ret = envoy_config_route_v3_Decorator_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_Decorator_serialize_ex(const envoy_config_route_v3_Decorator* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_Decorator_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_Decorator_clear_operation(const envoy_config_route_v3_Decorator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_Decorator_operation(const envoy_config_route_v3_Decorator* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_Decorator_has_propagate(const envoy_config_route_v3_Decorator* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_Decorator_clear_propagate(const envoy_config_route_v3_Decorator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_BoolValue*);
+}
+
+UPB_INLINE void envoy_config_route_v3_Decorator_set_operation(envoy_config_route_v3_Decorator *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_Decorator_set_propagate(envoy_config_route_v3_Decorator *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Decorator_set_propagate(msg, sub);
}
@@ -2813,41 +4410,80 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_route_v3_Decorator_mut
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_Tracing*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_Tracing* ret = envoy_config_route_v3_Tracing_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_Tracing_serialize_ex(const envoy_config_route_v3_Tracing* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_Tracing_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_clear_client_sampling(const envoy_config_route_v3_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_clear_random_sampling(const envoy_config_route_v3_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_clear_overall_sampling(const envoy_config_route_v3_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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(16, 32));
+}
+UPB_INLINE void envoy_config_route_v3_Tracing_clear_custom_tags(const envoy_config_route_v3_Tracing* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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(16, 32), len);
}
-
-UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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(16, 32)); }
-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(16, 32), 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_sethas(msg, 1);
*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_client_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Tracing_set_client_sampling(msg, sub);
}
@@ -2857,10 +4493,10 @@ UPB_INLINE void envoy_config_route_v3_Tracing_set_random_sampling(envoy_config_r
_upb_sethas(msg, 2);
*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_random_sampling(envoy_config_route_v3_Tracing *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_Tracing_set_random_sampling(msg, sub);
}
@@ -2870,135 +4506,192 @@ UPB_INLINE void envoy_config_route_v3_Tracing_set_overall_sampling(envoy_config_
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_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) {
+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(16, 32), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_tracing_v3_CustomTag_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_VirtualCluster*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_VirtualCluster* ret = envoy_config_route_v3_VirtualCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_VirtualCluster_serialize_ex(const envoy_config_route_v3_VirtualCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_VirtualCluster_clear_name(const envoy_config_route_v3_VirtualCluster* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_VirtualCluster_name(const envoy_config_route_v3_VirtualCluster* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+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 void envoy_config_route_v3_VirtualCluster_clear_headers(const envoy_config_route_v3_VirtualCluster* msg) {
+ _upb_array_detach(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 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 void envoy_config_route_v3_VirtualCluster_set_name(envoy_config_route_v3_VirtualCluster *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_VirtualCluster_mutable_headers(envoy_config_route_v3_VirtualCluster *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit* ret = envoy_config_route_v3_RateLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_serialize_ex(const envoy_config_route_v3_RateLimit* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_clear_stage(const envoy_config_route_v3_RateLimit* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_clear_disable_key(const envoy_config_route_v3_RateLimit* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_disable_key(const envoy_config_route_v3_RateLimit* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+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 void envoy_config_route_v3_RateLimit_clear_actions(const envoy_config_route_v3_RateLimit* msg) {
+ _upb_array_detach(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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_clear_limit(const envoy_config_route_v3_RateLimit* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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(20, 40), const envoy_config_route_v3_RateLimit_Override*);
}
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), 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(20, 40)); }
-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(20, 40), len); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_has_limit(const envoy_config_route_v3_RateLimit *msg) { return _upb_hasbit(msg, 2); }
-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(16, 32), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_RateLimit_mutable_stage(envoy_config_route_v3_RateLimit *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_set_disable_key(envoy_config_route_v3_RateLimit *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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(20, 40), len);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_RateLimit_Action_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), envoy_config_route_v3_RateLimit_Override*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Override*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Override_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RateLimit_set_limit(msg, sub);
}
@@ -3007,24 +4700,35 @@ UPB_INLINE struct envoy_config_route_v3_RateLimit_Override* envoy_config_route_v
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLimit_Action_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action* ret = envoy_config_route_v3_RateLimit_Action_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_serialize_ex(const envoy_config_route_v3_RateLimit_Action* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, options, 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,
@@ -3037,130 +4741,194 @@ typedef enum {
envoy_config_route_v3_RateLimit_Action_action_specifier_extension = 9,
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 bool envoy_config_route_v3_RateLimit_Action_has_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
-UPB_INLINE const envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_metadata(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_extension(const envoy_config_route_v3_RateLimit_Action *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 9; }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_extension(const envoy_config_route_v3_RateLimit_Action *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
+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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_source_cluster(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_destination_cluster(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_request_headers(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_remote_address(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_generic_key(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_header_value_match(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_dynamic_metadata(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 7, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_metadata(const envoy_config_route_v3_RateLimit_Action* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_metadata(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_metadata(const envoy_config_route_v3_RateLimit_Action* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_has_extension(const envoy_config_route_v3_RateLimit_Action* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_clear_extension(const envoy_config_route_v3_RateLimit_Action* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Action_action_specifier_NOT_SET);
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_extension(const envoy_config_route_v3_RateLimit_Action* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, 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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_SourceCluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DestinationCluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RequestHeaders*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_RemoteAddress*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_GenericKey*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_DynamicMetaData*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_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;
}
UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_metadata(envoy_config_route_v3_RateLimit_Action *msg, envoy_config_route_v3_RateLimit_Action_MetaData* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Action_MetaData*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8);
}
-UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_mutable_metadata(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_mutable_metadata(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) {
struct envoy_config_route_v3_RateLimit_Action_MetaData* sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)envoy_config_route_v3_RateLimit_Action_metadata(msg);
if (sub == NULL) {
- sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena);
+ sub = (struct envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RateLimit_Action_set_metadata(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_config_route_v3_RateLimit_Action_set_extension(envoy_config_route_v3_RateLimit_Action *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 9);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9);
}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_mutable_extension(envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RateLimit_Action_mutable_extension(envoy_config_route_v3_RateLimit_Action* msg, upb_Arena* arena) {
struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_RateLimit_Action_extension(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RateLimit_Action_set_extension(msg, sub);
}
@@ -3169,77 +4937,125 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_SourceCluster*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_route_v3_RateLimit_Action_SourceCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_SourceCluster* ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_SourceCluster_serialize_ex(const envoy_config_route_v3_RateLimit_Action_SourceCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_DestinationCluster*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_DestinationCluster* ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_DestinationCluster_serialize_ex(const envoy_config_route_v3_RateLimit_Action_DestinationCluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_RequestHeaders*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_RequestHeaders* ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_RequestHeaders_serialize_ex(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_header_name(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_clear_skip_if_absent(const envoy_config_route_v3_RateLimit_Action_RequestHeaders* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 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_header_name(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_descriptor_key(envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = 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;
@@ -3247,201 +5063,332 @@ UPB_INLINE void envoy_config_route_v3_RateLimit_Action_RequestHeaders_set_skip_i
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_RemoteAddress*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_RemoteAddress* ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_RemoteAddress_serialize_ex(const envoy_config_route_v3_RateLimit_Action_RemoteAddress* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_GenericKey*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route_v3_RateLimit_Action_GenericKey_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_GenericKey* ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_GenericKey_serialize_ex(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_clear_descriptor_value(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_GenericKey* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_value(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_GenericKey_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_HeaderValueMatch*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_serialize_ex(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_descriptor_value(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_has_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_expect_match(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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(16, 32));
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_headers(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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(16, 32), len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_descriptor_key(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(12, 24), 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(16, 32)); }
-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(16, 32), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_value(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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) {
+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(16, 32), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_DynamicMetaData*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_DynamicMetaData* ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RateLimit_Action_DynamicMetaData_serialize_ex(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_DynamicMetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_metadata_key(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_type_metadata_v3_MetadataKey*);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_clear_default_value(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(16, 32), upb_StringView);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(20, 40), 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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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_config_route_v3_RateLimit_Action_DynamicMetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_DynamicMetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
}
/* envoy.config.route.v3.RateLimit.Action.MetaData */
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v3_RateLimit_Action_MetaData_new(upb_arena *arena) {
- return (envoy_config_route_v3_RateLimit_Action_MetaData *)_upb_msg_new(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena);
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_MetaData_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Action_MetaData*)_upb_Message_New(&envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena);
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v3_RateLimit_Action_MetaData_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_RateLimit_Action_MetaData *ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_MetaData_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_MetaData* ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v3_RateLimit_Action_MetaData_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_route_v3_RateLimit_Action_MetaData *ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v3_RateLimit_Action_MetaData_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Action_MetaData* ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_MetaData_serialize(const envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena, len);
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_MetaData_serialize(const envoy_config_route_v3_RateLimit_Action_MetaData* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Action_MetaData_serialize_ex(const envoy_config_route_v3_RateLimit_Action_MetaData* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_descriptor_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_MetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct envoy_type_metadata_v3_MetadataKey*);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_default_value(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_RateLimit_Action_MetaData_default_value(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_clear_source(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_route_v3_RateLimit_Action_MetaData_source(const envoy_config_route_v3_RateLimit_Action_MetaData* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_MetaData_descriptor_key(const envoy_config_route_v3_RateLimit_Action_MetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Action_MetaData_has_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_metadata_key(const envoy_config_route_v3_RateLimit_Action_MetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_type_metadata_v3_MetadataKey*); }
-UPB_INLINE upb_strview envoy_config_route_v3_RateLimit_Action_MetaData_default_value(const envoy_config_route_v3_RateLimit_Action_MetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
-UPB_INLINE int32_t envoy_config_route_v3_RateLimit_Action_MetaData_source(const envoy_config_route_v3_RateLimit_Action_MetaData *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_descriptor_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, struct envoy_type_metadata_v3_MetadataKey* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_type_metadata_v3_MetadataKey*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct envoy_type_metadata_v3_MetadataKey*) = value;
}
-UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_RateLimit_Action_MetaData_mutable_metadata_key(envoy_config_route_v3_RateLimit_Action_MetaData* msg, upb_Arena* arena) {
struct envoy_type_metadata_v3_MetadataKey* sub = (struct envoy_type_metadata_v3_MetadataKey*)envoy_config_route_v3_RateLimit_Action_MetaData_metadata_key(msg);
if (sub == NULL) {
- sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_msg_new(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RateLimit_Action_MetaData_set_metadata_key(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
+UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_default_value(envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value;
}
UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_source(envoy_config_route_v3_RateLimit_Action_MetaData *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
@@ -3449,40 +5396,59 @@ UPB_INLINE void envoy_config_route_v3_RateLimit_Action_MetaData_set_source(envoy
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Override*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateLimit_Override_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Override* ret = envoy_config_route_v3_RateLimit_Override_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_RateLimit_Override_serialize_ex(const envoy_config_route_v3_RateLimit_Override* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Override_clear_dynamic_metadata(const envoy_config_route_v3_RateLimit_Override* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_route_v3_RateLimit_Override_override_specifier_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_config_route_v3_RateLimit_Override_DynamicMetadata*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_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);
}
@@ -3491,35 +5457,53 @@ UPB_INLINE struct envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envo
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_RateLimit_Override_DynamicMetadata*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_RateLimit_Override_DynamicMetadata* ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_RateLimit_Override_DynamicMetadata_serialize_ex(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_RateLimit_Override_DynamicMetadata_clear_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_type_metadata_v3_MetadataKey*);
}
-
-UPB_INLINE bool envoy_config_route_v3_RateLimit_Override_DynamicMetadata_has_metadata_key(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKey_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_RateLimit_Override_DynamicMetadata_set_metadata_key(msg, sub);
}
@@ -3528,24 +5512,35 @@ UPB_INLINE struct envoy_type_metadata_v3_MetadataKey* envoy_config_route_v3_Rate
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_HeaderMatcher*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_HeaderMatcher* ret = envoy_config_route_v3_HeaderMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_HeaderMatcher_serialize_ex(const envoy_config_route_v3_HeaderMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, options, 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,
@@ -3554,185 +5549,331 @@ typedef enum {
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_string_match = 13,
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 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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_name(const envoy_config_route_v3_HeaderMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_name(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_exact_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 4, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_range_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_range_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_present_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 7, false);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_invert_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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(4, 4)) == 9;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_prefix_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 9, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_suffix_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 10, upb_StringView_FromString(""));
+}
+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(4, 4)) == 11;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_safe_regex_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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(4, 4)) == 12;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_HeaderMatcher_contains_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 12, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_string_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_clear_string_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET);
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_string_match(const envoy_config_route_v3_HeaderMatcher* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 13, NULL);
+}
+
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_name(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_exact_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_WRITE_ONEOF(msg, struct envoy_type_v3_Int64Range*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_type_v3_Int64Range*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_prefix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_suffix_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_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);
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_contains_match(envoy_config_route_v3_HeaderMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 12);
+}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_string_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 13);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_mutable_string_match(envoy_config_route_v3_HeaderMatcher* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_HeaderMatcher_string_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HeaderMatcher_set_string_match(msg, sub);
+ }
+ return sub;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_QueryParameterMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_QueryParameterMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_QueryParameterMatcher* ret = envoy_config_route_v3_QueryParameterMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_QueryParameterMatcher_serialize_ex(const envoy_config_route_v3_QueryParameterMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_name(const envoy_config_route_v3_QueryParameterMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_QueryParameterMatcher_name(const envoy_config_route_v3_QueryParameterMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_QueryParameterMatcher_has_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_string_match(const envoy_config_route_v3_QueryParameterMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_route_v3_QueryParameterMatcher_clear_present_match(const envoy_config_route_v3_QueryParameterMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_route_v3_QueryParameterMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_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);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_InternalRedirectPolicy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_InternalRedirectPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_InternalRedirectPolicy* ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_InternalRedirectPolicy_serialize_ex(const envoy_config_route_v3_InternalRedirectPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_clear_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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 void envoy_config_route_v3_InternalRedirectPolicy_clear_redirect_response_codes(const envoy_config_route_v3_InternalRedirectPolicy* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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 void envoy_config_route_v3_InternalRedirectPolicy_clear_predicates(const envoy_config_route_v3_InternalRedirectPolicy* msg) {
+ _upb_array_detach(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 void envoy_config_route_v3_InternalRedirectPolicy_clear_allow_cross_scheme_redirect(const envoy_config_route_v3_InternalRedirectPolicy* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
}
-
-UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy *msg) { return _upb_hasbit(msg, 1); }
-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(1, 1), 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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) {
+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_accessor2(msg, UPB_SIZE(8, 16), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, 2, 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_accessor2(msg, UPB_SIZE(8, 16), 2, &val,
- 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_accessor2(msg, UPB_SIZE(8, 16), 2, &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) {
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -3742,36 +5883,59 @@ UPB_INLINE void envoy_config_route_v3_InternalRedirectPolicy_set_allow_cross_sch
/* envoy.config.route.v3.FilterConfig */
-UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfig_new(upb_arena *arena) {
- return (envoy_config_route_v3_FilterConfig *)_upb_msg_new(&envoy_config_route_v3_FilterConfig_msginit, arena);
+UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfig_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_FilterConfig*)_upb_Message_New(&envoy_config_route_v3_FilterConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_route_v3_FilterConfig* ret = envoy_config_route_v3_FilterConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_FilterConfig* ret = envoy_config_route_v3_FilterConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_config_route_v3_FilterConfig *ret = envoy_config_route_v3_FilterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_FilterConfig_serialize(const envoy_config_route_v3_FilterConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, 0, arena, len);
}
-UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_config_route_v3_FilterConfig *ret = envoy_config_route_v3_FilterConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_config_route_v3_FilterConfig_serialize_ex(const envoy_config_route_v3_FilterConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_config_route_v3_FilterConfig_serialize(const envoy_config_route_v3_FilterConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_config_route_v3_FilterConfig_msginit, arena, len);
+UPB_INLINE bool envoy_config_route_v3_FilterConfig_has_config(const envoy_config_route_v3_FilterConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_config(const envoy_config_route_v3_FilterConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_config(const envoy_config_route_v3_FilterConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*);
+}
+UPB_INLINE void envoy_config_route_v3_FilterConfig_clear_is_optional(const envoy_config_route_v3_FilterConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_FilterConfig_is_optional(const envoy_config_route_v3_FilterConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-
-UPB_INLINE bool envoy_config_route_v3_FilterConfig_has_config(const envoy_config_route_v3_FilterConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_config(const envoy_config_route_v3_FilterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Any*); }
-UPB_INLINE bool envoy_config_route_v3_FilterConfig_is_optional(const envoy_config_route_v3_FilterConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void envoy_config_route_v3_FilterConfig_set_config(envoy_config_route_v3_FilterConfig *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_mutable_config(envoy_config_route_v3_FilterConfig *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* envoy_config_route_v3_FilterConfig_mutable_config(envoy_config_route_v3_FilterConfig* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_route_v3_FilterConfig_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_FilterConfig_set_config(msg, sub);
}
@@ -3781,6 +5945,8 @@ UPB_INLINE void envoy_config_route_v3_FilterConfig_set_is_optional(envoy_config_
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+extern const upb_MiniTable_File envoy_config_route_v3_route_components_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
index 301441e3..3f94b789 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
@@ -7,53 +7,72 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/route/v3/scoped_route.upb.h"
+#include "envoy/config/route/v3/route.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_ScopedRouteConfiguration_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_ScopedRouteConfiguration_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit},
+ {.submsg = &envoy_config_route_v3_RouteConfiguration_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), 1, 0, 11, 1},
- {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
+static const upb_MiniTable_Sub envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = {
+const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = {
NULL,
&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
+};
+
+const upb_MiniTable_File envoy_config_route_v3_scoped_route_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
index 72d16228..1710be85 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,51 +26,96 @@ 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;
+extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msginit;
+extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit;
+extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit;
+struct envoy_config_route_v3_RouteConfiguration;
+extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration* ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_ScopedRouteConfiguration_serialize_ex(const envoy_config_route_v3_ScopedRouteConfiguration* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_ScopedRouteConfiguration_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration_name(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_key(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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 void envoy_config_route_v3_ScopedRouteConfiguration_clear_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_on_demand(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool envoy_config_route_v3_ScopedRouteConfiguration_has_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_clear_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_route_configuration(const envoy_config_route_v3_ScopedRouteConfiguration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_route_v3_RouteConfiguration*);
}
-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_hasbit(msg, 1); }
-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(1, 1), 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_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_route_configuration_name(envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena);
if (!sub) return NULL;
envoy_config_route_v3_ScopedRouteConfiguration_set_key(msg, sub);
}
@@ -79,77 +124,128 @@ UPB_INLINE struct envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_conf
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(1, 1), bool) = value;
}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration(envoy_config_route_v3_ScopedRouteConfiguration *msg, struct envoy_config_route_v3_RouteConfiguration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_route_v3_RouteConfiguration*) = value;
+}
+UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_ScopedRouteConfiguration_mutable_route_configuration(envoy_config_route_v3_ScopedRouteConfiguration* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_config_route_v3_ScopedRouteConfiguration_route_configuration(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_New(&envoy_config_route_v3_RouteConfiguration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_ScopedRouteConfiguration_set_route_configuration(msg, sub);
+ }
+ return sub;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_route_v3_ScopedRouteConfiguration_Key_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration_Key* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_config_route_v3_ScopedRouteConfiguration_Key_serialize_ex(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, options, 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 void envoy_config_route_v3_ScopedRouteConfiguration_Key_clear_fragments(const envoy_config_route_v3_ScopedRouteConfiguration_Key* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_serialize_ex(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_clear_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_string_key(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
-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);
+UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_set_string_key(envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
+extern const upb_MiniTable_File envoy_config_route_v3_scoped_route_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c
new file mode 100644
index 00000000..b4371188
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c
@@ -0,0 +1,222 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/tap/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/tap/v3/common.upb.h"
+#include "envoy/config/common/matcher/v3/matcher.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "envoy/config/route/v3/route_components.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_MiniTable_Sub envoy_config_tap_v3_TapConfig_submsgs[4] = {
+ {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit},
+ {.submsg = &envoy_config_tap_v3_OutputConfig_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_config_common_matcher_v3_MatchPredicate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_TapConfig__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit = {
+ &envoy_config_tap_v3_TapConfig_submsgs[0],
+ &envoy_config_tap_v3_TapConfig__fields[0],
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_submsgs[9] = {
+ {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpHeadersMatch_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msginit},
+ {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate__fields[10] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msginit = {
+ &envoy_config_tap_v3_MatchPredicate_submsgs[0],
+ &envoy_config_tap_v3_MatchPredicate__fields[0],
+ UPB_SIZE(8, 24), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[1] = {
+ {.submsg = &envoy_config_tap_v3_MatchPredicate_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate_MatchSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msginit = {
+ &envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[0],
+ &envoy_config_tap_v3_MatchPredicate_MatchSet__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_HttpHeadersMatch_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_HttpHeadersMatch__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msginit = {
+ &envoy_config_tap_v3_HttpHeadersMatch_submsgs[0],
+ &envoy_config_tap_v3_HttpHeadersMatch__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[1] = {
+ {.submsg = &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msginit = {
+ &envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[0],
+ &envoy_config_tap_v3_HttpGenericBodyMatch__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit = {
+ NULL,
+ &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_OutputConfig_submsgs[3] = {
+ {.submsg = &envoy_config_tap_v3_OutputSink_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_OutputConfig__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_OutputConfig_msginit = {
+ &envoy_config_tap_v3_OutputConfig_submsgs[0],
+ &envoy_config_tap_v3_OutputConfig__fields[0],
+ UPB_SIZE(16, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_OutputSink_submsgs[3] = {
+ {.submsg = &envoy_config_tap_v3_StreamingAdminSink_msginit},
+ {.submsg = &envoy_config_tap_v3_FilePerTapSink_msginit},
+ {.submsg = &envoy_config_tap_v3_StreamingGrpcSink_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_OutputSink__fields[4] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_OutputSink_msginit = {
+ &envoy_config_tap_v3_OutputSink_submsgs[0],
+ &envoy_config_tap_v3_OutputSink__fields[0],
+ UPB_SIZE(12, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_FilePerTapSink__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msginit = {
+ NULL,
+ &envoy_config_tap_v3_FilePerTapSink__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_tap_v3_StreamingGrpcSink_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_tap_v3_StreamingGrpcSink__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msginit = {
+ &envoy_config_tap_v3_StreamingGrpcSink_submsgs[0],
+ &envoy_config_tap_v3_StreamingGrpcSink__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[11] = {
+ &envoy_config_tap_v3_TapConfig_msginit,
+ &envoy_config_tap_v3_MatchPredicate_msginit,
+ &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit,
+ &envoy_config_tap_v3_HttpHeadersMatch_msginit,
+ &envoy_config_tap_v3_HttpGenericBodyMatch_msginit,
+ &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit,
+ &envoy_config_tap_v3_OutputConfig_msginit,
+ &envoy_config_tap_v3_OutputSink_msginit,
+ &envoy_config_tap_v3_StreamingAdminSink_msginit,
+ &envoy_config_tap_v3_FilePerTapSink_msginit,
+ &envoy_config_tap_v3_StreamingGrpcSink_msginit,
+};
+
+const upb_MiniTable_File envoy_config_tap_v3_common_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 11,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h
new file mode 100644
index 00000000..284483a1
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h
@@ -0,0 +1,1052 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/tap/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_
+#define ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_tap_v3_TapConfig;
+struct envoy_config_tap_v3_MatchPredicate;
+struct envoy_config_tap_v3_MatchPredicate_MatchSet;
+struct envoy_config_tap_v3_HttpHeadersMatch;
+struct envoy_config_tap_v3_HttpGenericBodyMatch;
+struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch;
+struct envoy_config_tap_v3_OutputConfig;
+struct envoy_config_tap_v3_OutputSink;
+struct envoy_config_tap_v3_StreamingAdminSink;
+struct envoy_config_tap_v3_FilePerTapSink;
+struct envoy_config_tap_v3_StreamingGrpcSink;
+typedef struct envoy_config_tap_v3_TapConfig envoy_config_tap_v3_TapConfig;
+typedef struct envoy_config_tap_v3_MatchPredicate envoy_config_tap_v3_MatchPredicate;
+typedef struct envoy_config_tap_v3_MatchPredicate_MatchSet envoy_config_tap_v3_MatchPredicate_MatchSet;
+typedef struct envoy_config_tap_v3_HttpHeadersMatch envoy_config_tap_v3_HttpHeadersMatch;
+typedef struct envoy_config_tap_v3_HttpGenericBodyMatch envoy_config_tap_v3_HttpGenericBodyMatch;
+typedef struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch;
+typedef struct envoy_config_tap_v3_OutputConfig envoy_config_tap_v3_OutputConfig;
+typedef struct envoy_config_tap_v3_OutputSink envoy_config_tap_v3_OutputSink;
+typedef struct envoy_config_tap_v3_StreamingAdminSink envoy_config_tap_v3_StreamingAdminSink;
+typedef struct envoy_config_tap_v3_FilePerTapSink envoy_config_tap_v3_FilePerTapSink;
+typedef struct envoy_config_tap_v3_StreamingGrpcSink envoy_config_tap_v3_StreamingGrpcSink;
+extern const upb_MiniTable envoy_config_tap_v3_TapConfig_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_MatchPredicate_MatchSet_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_HttpHeadersMatch_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_OutputConfig_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_OutputSink_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_StreamingAdminSink_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_FilePerTapSink_msginit;
+extern const upb_MiniTable envoy_config_tap_v3_StreamingGrpcSink_msginit;
+struct envoy_config_common_matcher_v3_MatchPredicate;
+struct envoy_config_core_v3_GrpcService;
+struct envoy_config_core_v3_RuntimeFractionalPercent;
+struct envoy_config_route_v3_HeaderMatcher;
+struct google_protobuf_UInt32Value;
+extern const upb_MiniTable envoy_config_common_matcher_v3_MatchPredicate_msginit;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable envoy_config_core_v3_RuntimeFractionalPercent_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+
+typedef enum {
+ envoy_config_tap_v3_OutputSink_JSON_BODY_AS_BYTES = 0,
+ envoy_config_tap_v3_OutputSink_JSON_BODY_AS_STRING = 1,
+ envoy_config_tap_v3_OutputSink_PROTO_BINARY = 2,
+ envoy_config_tap_v3_OutputSink_PROTO_BINARY_LENGTH_DELIMITED = 3,
+ envoy_config_tap_v3_OutputSink_PROTO_TEXT = 4
+} envoy_config_tap_v3_OutputSink_Format;
+
+
+
+/* envoy.config.tap.v3.TapConfig */
+
+UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_TapConfig*)_upb_Message_New(&envoy_config_tap_v3_TapConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_TapConfig* ret = envoy_config_tap_v3_TapConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_TapConfig* ret = envoy_config_tap_v3_TapConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_TapConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_TapConfig_serialize(const envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_TapConfig_serialize_ex(const envoy_config_tap_v3_TapConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match_config(const envoy_config_tap_v3_TapConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match_config(const envoy_config_tap_v3_TapConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_match_config(const envoy_config_tap_v3_TapConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_tap_v3_MatchPredicate*);
+}
+UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_output_config(const envoy_config_tap_v3_TapConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_output_config(const envoy_config_tap_v3_TapConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_TapConfig_output_config(const envoy_config_tap_v3_TapConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_tap_v3_OutputConfig*);
+}
+UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_tap_v3_TapConfig_tap_enabled(const envoy_config_tap_v3_TapConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_RuntimeFractionalPercent*);
+}
+UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match(const envoy_config_tap_v3_TapConfig* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_clear_match(const envoy_config_tap_v3_TapConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_match(const envoy_config_tap_v3_TapConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_common_matcher_v3_MatchPredicate*);
+}
+
+UPB_INLINE void envoy_config_tap_v3_TapConfig_set_match_config(envoy_config_tap_v3_TapConfig *msg, envoy_config_tap_v3_MatchPredicate* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_tap_v3_MatchPredicate*) = value;
+}
+UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_mutable_match_config(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)envoy_config_tap_v3_TapConfig_match_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_TapConfig_set_match_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_set_output_config(envoy_config_tap_v3_TapConfig *msg, envoy_config_tap_v3_OutputConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_tap_v3_OutputConfig*) = value;
+}
+UPB_INLINE struct envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_TapConfig_mutable_output_config(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_OutputConfig* sub = (struct envoy_config_tap_v3_OutputConfig*)envoy_config_tap_v3_TapConfig_output_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_TapConfig_set_output_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_set_tap_enabled(envoy_config_tap_v3_TapConfig *msg, struct envoy_config_core_v3_RuntimeFractionalPercent* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_RuntimeFractionalPercent*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_tap_v3_TapConfig_mutable_tap_enabled(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_RuntimeFractionalPercent* sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)envoy_config_tap_v3_TapConfig_tap_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFractionalPercent*)_upb_Message_New(&envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_TapConfig_set_tap_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_TapConfig_set_match(envoy_config_tap_v3_TapConfig *msg, struct envoy_config_common_matcher_v3_MatchPredicate* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_common_matcher_v3_MatchPredicate*) = value;
+}
+UPB_INLINE struct envoy_config_common_matcher_v3_MatchPredicate* envoy_config_tap_v3_TapConfig_mutable_match(envoy_config_tap_v3_TapConfig* msg, upb_Arena* arena) {
+ struct envoy_config_common_matcher_v3_MatchPredicate* sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)envoy_config_tap_v3_TapConfig_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_common_matcher_v3_MatchPredicate*)_upb_Message_New(&envoy_config_common_matcher_v3_MatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_TapConfig_set_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.tap.v3.MatchPredicate */
+
+UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_MatchPredicate* ret = envoy_config_tap_v3_MatchPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_MatchPredicate* ret = envoy_config_tap_v3_MatchPredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_serialize(const envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_serialize_ex(const envoy_config_tap_v3_MatchPredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_tap_v3_MatchPredicate_rule_or_match = 1,
+ envoy_config_tap_v3_MatchPredicate_rule_and_match = 2,
+ envoy_config_tap_v3_MatchPredicate_rule_not_match = 3,
+ envoy_config_tap_v3_MatchPredicate_rule_any_match = 4,
+ envoy_config_tap_v3_MatchPredicate_rule_http_request_headers_match = 5,
+ envoy_config_tap_v3_MatchPredicate_rule_http_request_trailers_match = 6,
+ envoy_config_tap_v3_MatchPredicate_rule_http_response_headers_match = 7,
+ envoy_config_tap_v3_MatchPredicate_rule_http_response_trailers_match = 8,
+ envoy_config_tap_v3_MatchPredicate_rule_http_request_generic_body_match = 9,
+ envoy_config_tap_v3_MatchPredicate_rule_http_response_generic_body_match = 10,
+ envoy_config_tap_v3_MatchPredicate_rule_NOT_SET = 0
+} envoy_config_tap_v3_MatchPredicate_rule_oneofcases;
+UPB_INLINE envoy_config_tap_v3_MatchPredicate_rule_oneofcases envoy_config_tap_v3_MatchPredicate_rule_case(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return (envoy_config_tap_v3_MatchPredicate_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_or_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_or_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_or_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_and_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_and_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_and_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_not_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_not_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_not_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_any_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_any_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_any_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, false);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_request_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_request_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_response_headers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 7, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_http_response_trailers_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 8, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 9;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_http_request_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_has_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_clear_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_config_tap_v3_MatchPredicate_rule_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_http_response_generic_body_match(const envoy_config_tap_v3_MatchPredicate* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, NULL);
+}
+
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_or_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_mutable_or_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)envoy_config_tap_v3_MatchPredicate_or_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_or_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_and_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate_MatchSet* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate_MatchSet*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_mutable_and_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_MatchPredicate_MatchSet* sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)envoy_config_tap_v3_MatchPredicate_and_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_and_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_not_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_MatchPredicate* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_MatchPredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_mutable_not_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)envoy_config_tap_v3_MatchPredicate_not_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_not_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_any_match(envoy_config_tap_v3_MatchPredicate *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_headers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_headers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_request_headers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_request_headers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_trailers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_trailers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_request_trailers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_request_trailers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_headers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 7);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_headers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_response_headers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_response_headers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_trailers_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpHeadersMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpHeadersMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_trailers_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpHeadersMatch* sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)envoy_config_tap_v3_MatchPredicate_http_response_trailers_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_response_trailers_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_request_generic_body_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpGenericBodyMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 9);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_request_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpGenericBodyMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)envoy_config_tap_v3_MatchPredicate_http_request_generic_body_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_request_generic_body_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_set_http_response_generic_body_match(envoy_config_tap_v3_MatchPredicate *msg, envoy_config_tap_v3_HttpGenericBodyMatch* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_HttpGenericBodyMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 10);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_MatchPredicate_mutable_http_response_generic_body_match(envoy_config_tap_v3_MatchPredicate* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpGenericBodyMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)envoy_config_tap_v3_MatchPredicate_http_response_generic_body_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_MatchPredicate_set_http_response_generic_body_match(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.tap.v3.MatchPredicate.MatchSet */
+
+UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_MatchSet_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_MatchPredicate_MatchSet*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_MatchSet_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_MatchPredicate_MatchSet* ret = envoy_config_tap_v3_MatchPredicate_MatchSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_MatchPredicate_MatchSet_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_MatchPredicate_MatchSet* ret = envoy_config_tap_v3_MatchPredicate_MatchSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_MatchSet_serialize(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_MatchPredicate_MatchSet_serialize_ex(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_tap_v3_MatchPredicate_MatchSet_has_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_tap_v3_MatchPredicate_MatchSet_clear_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_config_tap_v3_MatchPredicate* const* envoy_config_tap_v3_MatchPredicate_MatchSet_rules(const envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* len) {
+ return (const envoy_config_tap_v3_MatchPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_mutable_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t* len) {
+ return (envoy_config_tap_v3_MatchPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_tap_v3_MatchPredicate** envoy_config_tap_v3_MatchPredicate_MatchSet_resize_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_tap_v3_MatchPredicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicate_MatchSet_add_rules(envoy_config_tap_v3_MatchPredicate_MatchSet* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_MatchPredicate* sub = (struct envoy_config_tap_v3_MatchPredicate*)_upb_Message_New(&envoy_config_tap_v3_MatchPredicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.tap.v3.HttpHeadersMatch */
+
+UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeadersMatch_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_HttpHeadersMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpHeadersMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeadersMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpHeadersMatch* ret = envoy_config_tap_v3_HttpHeadersMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeadersMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpHeadersMatch* ret = envoy_config_tap_v3_HttpHeadersMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpHeadersMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpHeadersMatch_serialize(const envoy_config_tap_v3_HttpHeadersMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpHeadersMatch_serialize_ex(const envoy_config_tap_v3_HttpHeadersMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_tap_v3_HttpHeadersMatch_has_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_config_tap_v3_HttpHeadersMatch_clear_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_config_tap_v3_HttpHeadersMatch_headers(const envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* len) {
+ return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_mutable_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t* len) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_config_tap_v3_HttpHeadersMatch_resize_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_tap_v3_HttpHeadersMatch_add_headers(envoy_config_tap_v3_HttpHeadersMatch* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.tap.v3.HttpGenericBodyMatch */
+
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGenericBodyMatch_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_HttpGenericBodyMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGenericBodyMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpGenericBodyMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGenericBodyMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpGenericBodyMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_serialize(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_serialize_ex(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_clear_bytes_limit(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_config_tap_v3_HttpGenericBodyMatch_bytes_limit(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t);
+}
+UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_has_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_clear_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const* envoy_config_tap_v3_HttpGenericBodyMatch_patterns(const envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* len) {
+ return (const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_set_bytes_limit(envoy_config_tap_v3_HttpGenericBodyMatch *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_mutable_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t* len) {
+ return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch** envoy_config_tap_v3_HttpGenericBodyMatch_resize_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_add_patterns(envoy_config_tap_v3_HttpGenericBodyMatch* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* sub = (struct envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.tap.v3.HttpGenericBodyMatch.GenericTextMatch */
+
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch*)_upb_Message_New(&envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* ret = envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_serialize(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_serialize_ex(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_string_match = 1,
+ envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_binary_match = 2,
+ envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET = 0
+} envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases;
+UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_case(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return (envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_string_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_has_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_clear_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_binary_match(const envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_set_string_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE void envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_set_binary_match(envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+
+/* envoy.config.tap.v3.OutputConfig */
+
+UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_OutputConfig*)_upb_Message_New(&envoy_config_tap_v3_OutputConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_OutputConfig* ret = envoy_config_tap_v3_OutputConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_OutputConfig* ret = envoy_config_tap_v3_OutputConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_OutputConfig_serialize(const envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_OutputConfig_serialize_ex(const envoy_config_tap_v3_OutputConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_sinks(const envoy_config_tap_v3_OutputConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_sinks(const envoy_config_tap_v3_OutputConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_config_tap_v3_OutputSink* const* envoy_config_tap_v3_OutputConfig_sinks(const envoy_config_tap_v3_OutputConfig* msg, size_t* len) {
+ return (const envoy_config_tap_v3_OutputSink* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_max_buffered_rx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputConfig_has_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_max_buffered_tx_bytes(const envoy_config_tap_v3_OutputConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_clear_streaming(const envoy_config_tap_v3_OutputConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputConfig_streaming(const envoy_config_tap_v3_OutputConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+
+UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_mutable_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t* len) {
+ return (envoy_config_tap_v3_OutputSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE envoy_config_tap_v3_OutputSink** envoy_config_tap_v3_OutputConfig_resize_sinks(envoy_config_tap_v3_OutputConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_config_tap_v3_OutputSink**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputConfig_add_sinks(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_OutputSink* sub = (struct envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_max_buffered_rx_bytes(envoy_config_tap_v3_OutputConfig *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_mutable_max_buffered_rx_bytes(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_tap_v3_OutputConfig_max_buffered_rx_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_OutputConfig_set_max_buffered_rx_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_max_buffered_tx_bytes(envoy_config_tap_v3_OutputConfig *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_tap_v3_OutputConfig_mutable_max_buffered_tx_bytes(envoy_config_tap_v3_OutputConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_tap_v3_OutputConfig_max_buffered_tx_bytes(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_OutputConfig_set_max_buffered_tx_bytes(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputConfig_set_streaming(envoy_config_tap_v3_OutputConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.tap.v3.OutputSink */
+
+UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_OutputSink*)_upb_Message_New(&envoy_config_tap_v3_OutputSink_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_OutputSink* ret = envoy_config_tap_v3_OutputSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_OutputSink* ret = envoy_config_tap_v3_OutputSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_OutputSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_OutputSink_serialize(const envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_OutputSink_serialize_ex(const envoy_config_tap_v3_OutputSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_tap_v3_OutputSink_output_sink_type_streaming_admin = 2,
+ envoy_config_tap_v3_OutputSink_output_sink_type_file_per_tap = 3,
+ envoy_config_tap_v3_OutputSink_output_sink_type_streaming_grpc = 4,
+ envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET = 0
+} envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases;
+UPB_INLINE envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases envoy_config_tap_v3_OutputSink_output_sink_type_case(const envoy_config_tap_v3_OutputSink* msg) {
+ return (envoy_config_tap_v3_OutputSink_output_sink_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_format(const envoy_config_tap_v3_OutputSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_tap_v3_OutputSink_format(const envoy_config_tap_v3_OutputSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_OutputSink_streaming_admin(const envoy_config_tap_v3_OutputSink* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_OutputSink_file_per_tap(const envoy_config_tap_v3_OutputSink* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_config_tap_v3_OutputSink_has_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_clear_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_config_tap_v3_OutputSink_output_sink_type_NOT_SET);
+}
+UPB_INLINE const envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_OutputSink_streaming_grpc(const envoy_config_tap_v3_OutputSink* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 4, NULL);
+}
+
+UPB_INLINE void envoy_config_tap_v3_OutputSink_set_format(envoy_config_tap_v3_OutputSink *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_set_streaming_admin(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_StreamingAdminSink* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingAdminSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_OutputSink_mutable_streaming_admin(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_StreamingAdminSink* sub = (struct envoy_config_tap_v3_StreamingAdminSink*)envoy_config_tap_v3_OutputSink_streaming_admin(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_OutputSink_set_streaming_admin(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_set_file_per_tap(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_FilePerTapSink* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_FilePerTapSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE struct envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_OutputSink_mutable_file_per_tap(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_FilePerTapSink* sub = (struct envoy_config_tap_v3_FilePerTapSink*)envoy_config_tap_v3_OutputSink_file_per_tap(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_OutputSink_set_file_per_tap(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_tap_v3_OutputSink_set_streaming_grpc(envoy_config_tap_v3_OutputSink *msg, envoy_config_tap_v3_StreamingGrpcSink* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_tap_v3_StreamingGrpcSink*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 4);
+}
+UPB_INLINE struct envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_OutputSink_mutable_streaming_grpc(envoy_config_tap_v3_OutputSink* msg, upb_Arena* arena) {
+ struct envoy_config_tap_v3_StreamingGrpcSink* sub = (struct envoy_config_tap_v3_StreamingGrpcSink*)envoy_config_tap_v3_OutputSink_streaming_grpc(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_OutputSink_set_streaming_grpc(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.tap.v3.StreamingAdminSink */
+
+UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_StreamingAdminSink_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_StreamingAdminSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingAdminSink_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_StreamingAdminSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_StreamingAdminSink* ret = envoy_config_tap_v3_StreamingAdminSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_StreamingAdminSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_StreamingAdminSink* ret = envoy_config_tap_v3_StreamingAdminSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingAdminSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_StreamingAdminSink_serialize(const envoy_config_tap_v3_StreamingAdminSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_StreamingAdminSink_serialize_ex(const envoy_config_tap_v3_StreamingAdminSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, options, arena, len);
+}
+
+
+/* envoy.config.tap.v3.FilePerTapSink */
+
+UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSink_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_FilePerTapSink*)_upb_Message_New(&envoy_config_tap_v3_FilePerTapSink_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_FilePerTapSink* ret = envoy_config_tap_v3_FilePerTapSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_FilePerTapSink* ret = envoy_config_tap_v3_FilePerTapSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_FilePerTapSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_FilePerTapSink_serialize(const envoy_config_tap_v3_FilePerTapSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_FilePerTapSink_serialize_ex(const envoy_config_tap_v3_FilePerTapSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_tap_v3_FilePerTapSink_clear_path_prefix(const envoy_config_tap_v3_FilePerTapSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_tap_v3_FilePerTapSink_path_prefix(const envoy_config_tap_v3_FilePerTapSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_config_tap_v3_FilePerTapSink_set_path_prefix(envoy_config_tap_v3_FilePerTapSink *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+/* envoy.config.tap.v3.StreamingGrpcSink */
+
+UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingGrpcSink_new(upb_Arena* arena) {
+ return (envoy_config_tap_v3_StreamingGrpcSink*)_upb_Message_New(&envoy_config_tap_v3_StreamingGrpcSink_msginit, arena);
+}
+UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingGrpcSink_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_tap_v3_StreamingGrpcSink* ret = envoy_config_tap_v3_StreamingGrpcSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingGrpcSink_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_tap_v3_StreamingGrpcSink* ret = envoy_config_tap_v3_StreamingGrpcSink_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_tap_v3_StreamingGrpcSink_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_tap_v3_StreamingGrpcSink_serialize(const envoy_config_tap_v3_StreamingGrpcSink* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_tap_v3_StreamingGrpcSink_serialize_ex(const envoy_config_tap_v3_StreamingGrpcSink* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_clear_tap_id(const envoy_config_tap_v3_StreamingGrpcSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_tap_v3_StreamingGrpcSink_tap_id(const envoy_config_tap_v3_StreamingGrpcSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_tap_v3_StreamingGrpcSink_has_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_clear_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_tap_v3_StreamingGrpcSink_grpc_service(const envoy_config_tap_v3_StreamingGrpcSink* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_GrpcService*);
+}
+
+UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_set_tap_id(envoy_config_tap_v3_StreamingGrpcSink *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_tap_v3_StreamingGrpcSink_set_grpc_service(envoy_config_tap_v3_StreamingGrpcSink *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_tap_v3_StreamingGrpcSink_mutable_grpc_service(envoy_config_tap_v3_StreamingGrpcSink* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_tap_v3_StreamingGrpcSink_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_tap_v3_StreamingGrpcSink_set_grpc_service(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_tap_v3_common_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c
new file mode 100644
index 00000000..e5101344
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c
@@ -0,0 +1,44 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/datadog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/datadog.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_MiniTable_Field envoy_config_trace_v3_DatadogConfig__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msginit = {
+ NULL,
+ &envoy_config_trace_v3_DatadogConfig__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_DatadogConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_datadog_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h
new file mode 100644
index 00000000..838ac9a8
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h
@@ -0,0 +1,88 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/datadog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_DatadogConfig;
+typedef struct envoy_config_trace_v3_DatadogConfig envoy_config_trace_v3_DatadogConfig;
+extern const upb_MiniTable envoy_config_trace_v3_DatadogConfig_msginit;
+
+
+
+/* envoy.config.trace.v3.DatadogConfig */
+
+UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_DatadogConfig*)_upb_Message_New(&envoy_config_trace_v3_DatadogConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_DatadogConfig* ret = envoy_config_trace_v3_DatadogConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_DatadogConfig* ret = envoy_config_trace_v3_DatadogConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DatadogConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_DatadogConfig_serialize(const envoy_config_trace_v3_DatadogConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_DatadogConfig_serialize_ex(const envoy_config_trace_v3_DatadogConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_collector_cluster(const envoy_config_trace_v3_DatadogConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_DatadogConfig_collector_cluster(const envoy_config_trace_v3_DatadogConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_DatadogConfig_clear_service_name(const envoy_config_trace_v3_DatadogConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_DatadogConfig_service_name(const envoy_config_trace_v3_DatadogConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+
+UPB_INLINE void envoy_config_trace_v3_DatadogConfig_set_collector_cluster(envoy_config_trace_v3_DatadogConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_DatadogConfig_set_service_name(envoy_config_trace_v3_DatadogConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_datadog_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c
new file mode 100644
index 00000000..08a099d8
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c
@@ -0,0 +1,49 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/dynamic_ot.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/dynamic_ot.upb.h"
+#include "google/protobuf/struct.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_MiniTable_Sub envoy_config_trace_v3_DynamicOtConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_DynamicOtConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msginit = {
+ &envoy_config_trace_v3_DynamicOtConfig_submsgs[0],
+ &envoy_config_trace_v3_DynamicOtConfig__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_DynamicOtConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h
new file mode 100644
index 00000000..ea0d6ff6
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h
@@ -0,0 +1,103 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/dynamic_ot.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_DynamicOtConfig;
+typedef struct envoy_config_trace_v3_DynamicOtConfig envoy_config_trace_v3_DynamicOtConfig;
+extern const upb_MiniTable envoy_config_trace_v3_DynamicOtConfig_msginit;
+struct google_protobuf_Struct;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+
+
+
+/* envoy.config.trace.v3.DynamicOtConfig */
+
+UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicOtConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_DynamicOtConfig*)_upb_Message_New(&envoy_config_trace_v3_DynamicOtConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicOtConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_DynamicOtConfig* ret = envoy_config_trace_v3_DynamicOtConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicOtConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_DynamicOtConfig* ret = envoy_config_trace_v3_DynamicOtConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_DynamicOtConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_DynamicOtConfig_serialize(const envoy_config_trace_v3_DynamicOtConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_DynamicOtConfig_serialize_ex(const envoy_config_trace_v3_DynamicOtConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_clear_library(const envoy_config_trace_v3_DynamicOtConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_DynamicOtConfig_library(const envoy_config_trace_v3_DynamicOtConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_trace_v3_DynamicOtConfig_has_config(const envoy_config_trace_v3_DynamicOtConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_clear_config(const envoy_config_trace_v3_DynamicOtConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_trace_v3_DynamicOtConfig_config(const envoy_config_trace_v3_DynamicOtConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_set_library(envoy_config_trace_v3_DynamicOtConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_DynamicOtConfig_set_config(envoy_config_trace_v3_DynamicOtConfig *msg, struct google_protobuf_Struct* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_trace_v3_DynamicOtConfig_mutable_config(envoy_config_trace_v3_DynamicOtConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_trace_v3_DynamicOtConfig_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_DynamicOtConfig_set_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
index 52cb6b72..ae191c5a 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/trace/v3/http_tracer.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,33 +16,47 @@
#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_MiniTable_Sub envoy_config_trace_v3_Tracing_submsgs[1] = {
+ {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit},
};
-static const upb_msglayout_field envoy_config_trace_v3_Tracing__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_config_trace_v3_Tracing__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_trace_v3_Tracing_msginit = {
+const upb_MiniTable envoy_config_trace_v3_Tracing_msginit = {
&envoy_config_trace_v3_Tracing_submsgs[0],
&envoy_config_trace_v3_Tracing__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_config_trace_v3_Tracing_Http__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_trace_v3_Tracing_msginit,
+ &envoy_config_trace_v3_Tracing_Http_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_http_tracer_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
index 21240fa0..0c03e768 100644
--- a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,43 +24,62 @@ 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;
+extern const upb_MiniTable envoy_config_trace_v3_Tracing_msginit;
+extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msginit;
struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_Tracing*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_Tracing* ret = envoy_config_trace_v3_Tracing_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_Tracing_serialize_ex(const envoy_config_trace_v3_Tracing* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_Tracing_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_Tracing_clear_http(const envoy_config_trace_v3_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_config_trace_v3_Tracing_Http*);
}
-
-UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_New(&envoy_config_trace_v3_Tracing_Http_msginit, arena);
if (!sub) return NULL;
envoy_config_trace_v3_Tracing_set_http(msg, sub);
}
@@ -69,50 +88,76 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Trac
/* 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_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_Tracing_Http*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Http_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_Tracing_Http* ret = envoy_config_trace_v3_Tracing_Http_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_config_trace_v3_Tracing_Http_serialize_ex(const envoy_config_trace_v3_Tracing_Http* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_name(const envoy_config_trace_v3_Tracing_Http* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_Tracing_Http_name(const envoy_config_trace_v3_Tracing_Http* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_config_trace_v3_Tracing_Http_clear_typed_config(const envoy_config_trace_v3_Tracing_Http* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_config_trace_v3_Tracing_Http_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_config_trace_v3_Tracing_Http *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_config_trace_v3_Tracing_Http_set_typed_config(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_config_trace_v3_http_tracer_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c
new file mode 100644
index 00000000..f237054c
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/lightstep.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/lightstep.upb.h"
+#include "envoy/config/core/v3/base.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_MiniTable_Sub envoy_config_trace_v3_LightstepConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_LightstepConfig__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msginit = {
+ &envoy_config_trace_v3_LightstepConfig_submsgs[0],
+ &envoy_config_trace_v3_LightstepConfig__fields[0],
+ UPB_SIZE(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_LightstepConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_lightstep_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h
new file mode 100644
index 00000000..0f70e712
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h
@@ -0,0 +1,134 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/lightstep.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_LightstepConfig;
+typedef struct envoy_config_trace_v3_LightstepConfig envoy_config_trace_v3_LightstepConfig;
+extern const upb_MiniTable envoy_config_trace_v3_LightstepConfig_msginit;
+struct envoy_config_core_v3_DataSource;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+
+typedef enum {
+ envoy_config_trace_v3_LightstepConfig_ENVOY = 0,
+ envoy_config_trace_v3_LightstepConfig_LIGHTSTEP = 1,
+ envoy_config_trace_v3_LightstepConfig_B3 = 2,
+ envoy_config_trace_v3_LightstepConfig_TRACE_CONTEXT = 3
+} envoy_config_trace_v3_LightstepConfig_PropagationMode;
+
+
+
+/* envoy.config.trace.v3.LightstepConfig */
+
+UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_LightstepConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_LightstepConfig*)_upb_Message_New(&envoy_config_trace_v3_LightstepConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_LightstepConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_LightstepConfig* ret = envoy_config_trace_v3_LightstepConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_LightstepConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_LightstepConfig* ret = envoy_config_trace_v3_LightstepConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_LightstepConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_LightstepConfig_serialize(const envoy_config_trace_v3_LightstepConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_LightstepConfig_serialize_ex(const envoy_config_trace_v3_LightstepConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_collector_cluster(const envoy_config_trace_v3_LightstepConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_LightstepConfig_collector_cluster(const envoy_config_trace_v3_LightstepConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token_file(const envoy_config_trace_v3_LightstepConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_LightstepConfig_access_token_file(const envoy_config_trace_v3_LightstepConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE int32_t const* envoy_config_trace_v3_LightstepConfig_propagation_modes(const envoy_config_trace_v3_LightstepConfig* msg, size_t* len) {
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_has_access_token(const envoy_config_trace_v3_LightstepConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_clear_access_token(const envoy_config_trace_v3_LightstepConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_LightstepConfig_access_token(const envoy_config_trace_v3_LightstepConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_DataSource*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_collector_cluster(envoy_config_trace_v3_LightstepConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_access_token_file(envoy_config_trace_v3_LightstepConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_mutable_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_LightstepConfig_resize_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, 2, arena);
+}
+UPB_INLINE bool envoy_config_trace_v3_LightstepConfig_add_propagation_modes(envoy_config_trace_v3_LightstepConfig* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), 2, &val, arena);
+}
+UPB_INLINE void envoy_config_trace_v3_LightstepConfig_set_access_token(envoy_config_trace_v3_LightstepConfig *msg, struct envoy_config_core_v3_DataSource* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_LightstepConfig_mutable_access_token(envoy_config_trace_v3_LightstepConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_trace_v3_LightstepConfig_access_token(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_LightstepConfig_set_access_token(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_lightstep_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c
new file mode 100644
index 00000000..55ec9ed4
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c
@@ -0,0 +1,63 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/opencensus.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/opencensus.upb.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "opencensus/proto/trace/v1/trace_config.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 "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_config_trace_v3_OpenCensusConfig_submsgs[3] = {
+ {.submsg = &opencensus_proto_trace_v1_TraceConfig_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_OpenCensusConfig__fields[13] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(44, 80), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(52, 96), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(56, 104), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msginit = {
+ &envoy_config_trace_v3_OpenCensusConfig_submsgs[0],
+ &envoy_config_trace_v3_OpenCensusConfig__fields[0],
+ UPB_SIZE(60, 120), 13, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_OpenCensusConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_opencensus_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h
new file mode 100644
index 00000000..5f46c709
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h
@@ -0,0 +1,250 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/opencensus.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_OpenCensusConfig;
+typedef struct envoy_config_trace_v3_OpenCensusConfig envoy_config_trace_v3_OpenCensusConfig;
+extern const upb_MiniTable envoy_config_trace_v3_OpenCensusConfig_msginit;
+struct envoy_config_core_v3_GrpcService;
+struct opencensus_proto_trace_v1_TraceConfig;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit;
+
+typedef enum {
+ envoy_config_trace_v3_OpenCensusConfig_NONE = 0,
+ envoy_config_trace_v3_OpenCensusConfig_TRACE_CONTEXT = 1,
+ envoy_config_trace_v3_OpenCensusConfig_GRPC_TRACE_BIN = 2,
+ envoy_config_trace_v3_OpenCensusConfig_CLOUD_TRACE_CONTEXT = 3,
+ envoy_config_trace_v3_OpenCensusConfig_B3 = 4
+} envoy_config_trace_v3_OpenCensusConfig_TraceContext;
+
+
+
+/* envoy.config.trace.v3.OpenCensusConfig */
+
+UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCensusConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_OpenCensusConfig*)_upb_Message_New(&envoy_config_trace_v3_OpenCensusConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCensusConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_OpenCensusConfig* ret = envoy_config_trace_v3_OpenCensusConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCensusConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_OpenCensusConfig* ret = envoy_config_trace_v3_OpenCensusConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_OpenCensusConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_OpenCensusConfig_serialize(const envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_OpenCensusConfig_serialize_ex(const envoy_config_trace_v3_OpenCensusConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct opencensus_proto_trace_v1_TraceConfig* envoy_config_trace_v3_OpenCensusConfig_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct opencensus_proto_trace_v1_TraceConfig*);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stdout_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_stdout_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_stackdriver_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_project_id(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_stackdriver_project_id(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_zipkin_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_zipkin_url(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_zipkin_url(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 48));
+}
+UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_incoming_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) {
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+UPB_INLINE int32_t const* envoy_config_trace_v3_OpenCensusConfig_outgoing_trace_context(const envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) {
+ return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_address(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_stackdriver_address(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_ocagent_exporter_enabled(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_address(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_OpenCensusConfig_ocagent_address(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView);
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_stackdriver_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const struct envoy_config_core_v3_GrpcService*);
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_clear_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_ocagent_grpc_service(const envoy_config_trace_v3_OpenCensusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct envoy_config_core_v3_GrpcService*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_trace_config(envoy_config_trace_v3_OpenCensusConfig *msg, struct opencensus_proto_trace_v1_TraceConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct opencensus_proto_trace_v1_TraceConfig*) = value;
+}
+UPB_INLINE struct opencensus_proto_trace_v1_TraceConfig* envoy_config_trace_v3_OpenCensusConfig_mutable_trace_config(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) {
+ struct opencensus_proto_trace_v1_TraceConfig* sub = (struct opencensus_proto_trace_v1_TraceConfig*)envoy_config_trace_v3_OpenCensusConfig_trace_config(msg);
+ if (sub == NULL) {
+ sub = (struct opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_OpenCensusConfig_set_trace_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stdout_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_project_id(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_zipkin_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_zipkin_url(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value;
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 48), len, 2, arena);
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_add_incoming_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 48), 2, &val, arena);
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_mutable_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+}
+UPB_INLINE int32_t* envoy_config_trace_v3_OpenCensusConfig_resize_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, 2, arena);
+}
+UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_add_outgoing_trace_context(envoy_config_trace_v3_OpenCensusConfig* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), 2, &val, arena);
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_address(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_exporter_enabled(envoy_config_trace_v3_OpenCensusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_address(envoy_config_trace_v3_OpenCensusConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_grpc_service(envoy_config_trace_v3_OpenCensusConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_mutable_stackdriver_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_OpenCensusConfig_stackdriver_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_OpenCensusConfig_set_stackdriver_grpc_service(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_OpenCensusConfig_set_ocagent_grpc_service(envoy_config_trace_v3_OpenCensusConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_OpenCensusConfig_mutable_ocagent_grpc_service(envoy_config_trace_v3_OpenCensusConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_OpenCensusConfig_ocagent_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_OpenCensusConfig_set_ocagent_grpc_service(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_opencensus_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c
new file mode 100644
index 00000000..a8334a5f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c
@@ -0,0 +1,47 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/service.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_MiniTable_Sub envoy_config_trace_v3_TraceServiceConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_TraceServiceConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msginit = {
+ &envoy_config_trace_v3_TraceServiceConfig_submsgs[0],
+ &envoy_config_trace_v3_TraceServiceConfig__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_TraceServiceConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_service_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h
new file mode 100644
index 00000000..206356c2
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h
@@ -0,0 +1,94 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_TraceServiceConfig;
+typedef struct envoy_config_trace_v3_TraceServiceConfig envoy_config_trace_v3_TraceServiceConfig;
+extern const upb_MiniTable envoy_config_trace_v3_TraceServiceConfig_msginit;
+struct envoy_config_core_v3_GrpcService;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+
+
+
+/* envoy.config.trace.v3.TraceServiceConfig */
+
+UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_TraceServiceConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_TraceServiceConfig*)_upb_Message_New(&envoy_config_trace_v3_TraceServiceConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_TraceServiceConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_TraceServiceConfig* ret = envoy_config_trace_v3_TraceServiceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_TraceServiceConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_TraceServiceConfig* ret = envoy_config_trace_v3_TraceServiceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_TraceServiceConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_TraceServiceConfig_serialize(const envoy_config_trace_v3_TraceServiceConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_TraceServiceConfig_serialize_ex(const envoy_config_trace_v3_TraceServiceConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_trace_v3_TraceServiceConfig_has_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_TraceServiceConfig_clear_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_TraceServiceConfig_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_GrpcService*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_TraceServiceConfig_set_grpc_service(envoy_config_trace_v3_TraceServiceConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_TraceServiceConfig_mutable_grpc_service(envoy_config_trace_v3_TraceServiceConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_TraceServiceConfig_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_TraceServiceConfig_set_grpc_service(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_service_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c
new file mode 100644
index 00000000..949a0969
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c
@@ -0,0 +1,69 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/skywalking.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/skywalking.upb.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/migrate.upb.h"
+#include "udpa/annotations/sensitive.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_config_trace_v3_SkyWalkingConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+ {.submsg = &envoy_config_trace_v3_ClientConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_SkyWalkingConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msginit = {
+ &envoy_config_trace_v3_SkyWalkingConfig_submsgs[0],
+ &envoy_config_trace_v3_SkyWalkingConfig__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_trace_v3_ClientConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_ClientConfig__fields[4] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_ClientConfig_msginit = {
+ &envoy_config_trace_v3_ClientConfig_submsgs[0],
+ &envoy_config_trace_v3_ClientConfig__fields[0],
+ UPB_SIZE(36, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_trace_v3_SkyWalkingConfig_msginit,
+ &envoy_config_trace_v3_ClientConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_skywalking_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h
new file mode 100644
index 00000000..cf85456c
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h
@@ -0,0 +1,213 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/skywalking.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_SkyWalkingConfig;
+struct envoy_config_trace_v3_ClientConfig;
+typedef struct envoy_config_trace_v3_SkyWalkingConfig envoy_config_trace_v3_SkyWalkingConfig;
+typedef struct envoy_config_trace_v3_ClientConfig envoy_config_trace_v3_ClientConfig;
+extern const upb_MiniTable envoy_config_trace_v3_SkyWalkingConfig_msginit;
+extern const upb_MiniTable envoy_config_trace_v3_ClientConfig_msginit;
+struct envoy_config_core_v3_GrpcService;
+struct google_protobuf_UInt32Value;
+extern const upb_MiniTable envoy_config_core_v3_GrpcService_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+
+
+
+/* envoy.config.trace.v3.SkyWalkingConfig */
+
+UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalkingConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_SkyWalkingConfig*)_upb_Message_New(&envoy_config_trace_v3_SkyWalkingConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalkingConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_SkyWalkingConfig* ret = envoy_config_trace_v3_SkyWalkingConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalkingConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_SkyWalkingConfig* ret = envoy_config_trace_v3_SkyWalkingConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_SkyWalkingConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_SkyWalkingConfig_serialize(const envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_SkyWalkingConfig_serialize_ex(const envoy_config_trace_v3_SkyWalkingConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_SkyWalkingConfig_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_GrpcService*);
+}
+UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_clear_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_SkyWalkingConfig_client_config(const envoy_config_trace_v3_SkyWalkingConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_trace_v3_ClientConfig*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_set_grpc_service(envoy_config_trace_v3_SkyWalkingConfig *msg, struct envoy_config_core_v3_GrpcService* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_GrpcService*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_trace_v3_SkyWalkingConfig_mutable_grpc_service(envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_GrpcService* sub = (struct envoy_config_core_v3_GrpcService*)envoy_config_trace_v3_SkyWalkingConfig_grpc_service(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_GrpcService*)_upb_Message_New(&envoy_config_core_v3_GrpcService_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_SkyWalkingConfig_set_grpc_service(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_SkyWalkingConfig_set_client_config(envoy_config_trace_v3_SkyWalkingConfig *msg, envoy_config_trace_v3_ClientConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_trace_v3_ClientConfig*) = value;
+}
+UPB_INLINE struct envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_SkyWalkingConfig_mutable_client_config(envoy_config_trace_v3_SkyWalkingConfig* msg, upb_Arena* arena) {
+ struct envoy_config_trace_v3_ClientConfig* sub = (struct envoy_config_trace_v3_ClientConfig*)envoy_config_trace_v3_SkyWalkingConfig_client_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_SkyWalkingConfig_set_client_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.trace.v3.ClientConfig */
+
+UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_ClientConfig*)_upb_Message_New(&envoy_config_trace_v3_ClientConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_ClientConfig* ret = envoy_config_trace_v3_ClientConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_ClientConfig* ret = envoy_config_trace_v3_ClientConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ClientConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_ClientConfig_serialize(const envoy_config_trace_v3_ClientConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_ClientConfig_serialize_ex(const envoy_config_trace_v3_ClientConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_config_trace_v3_ClientConfig_backend_token_specifier_backend_token = 3,
+ envoy_config_trace_v3_ClientConfig_backend_token_specifier_NOT_SET = 0
+} envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases;
+UPB_INLINE envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases envoy_config_trace_v3_ClientConfig_backend_token_specifier_case(const envoy_config_trace_v3_ClientConfig* msg) {
+ return (envoy_config_trace_v3_ClientConfig_backend_token_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_service_name(const envoy_config_trace_v3_ClientConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_service_name(const envoy_config_trace_v3_ClientConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_instance_name(const envoy_config_trace_v3_ClientConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_instance_name(const envoy_config_trace_v3_ClientConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_backend_token(const envoy_config_trace_v3_ClientConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_backend_token(const envoy_config_trace_v3_ClientConfig* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_config_trace_v3_ClientConfig_backend_token_specifier_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ClientConfig_backend_token(const envoy_config_trace_v3_ClientConfig* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_config_trace_v3_ClientConfig_has_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_clear_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_trace_v3_ClientConfig_max_cache_size(const envoy_config_trace_v3_ClientConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct google_protobuf_UInt32Value*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_service_name(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_instance_name(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_backend_token(envoy_config_trace_v3_ClientConfig *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE void envoy_config_trace_v3_ClientConfig_set_max_cache_size(envoy_config_trace_v3_ClientConfig *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_trace_v3_ClientConfig_mutable_max_cache_size(envoy_config_trace_v3_ClientConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_trace_v3_ClientConfig_max_cache_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_ClientConfig_set_max_cache_size(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_skywalking_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c
new file mode 100644
index 00000000..4dd1cf20
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c
@@ -0,0 +1,32 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/trace.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/datadog.upb.h"
+#include "envoy/config/trace/v3/dynamic_ot.upb.h"
+#include "envoy/config/trace/v3/http_tracer.upb.h"
+#include "envoy/config/trace/v3/lightstep.upb.h"
+#include "envoy/config/trace/v3/opencensus.upb.h"
+#include "envoy/config/trace/v3/service.upb.h"
+#include "envoy/config/trace/v3/zipkin.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h
new file mode 100644
index 00000000..8d53fd14
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h
@@ -0,0 +1,42 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/trace.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+/* Public Imports. */
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+extern const upb_MiniTable_File envoy_config_trace_v3_trace_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c
new file mode 100644
index 00000000..b44a6134
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c
@@ -0,0 +1,71 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/xray.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/xray.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "google/protobuf/struct.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_MiniTable_Sub envoy_config_trace_v3_XRayConfig_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_SocketAddress_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_XRayConfig_msginit = {
+ &envoy_config_trace_v3_XRayConfig_submsgs[0],
+ &envoy_config_trace_v3_XRayConfig__fields[0],
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig_SegmentFields__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msginit = {
+ &envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[0],
+ &envoy_config_trace_v3_XRayConfig_SegmentFields__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_config_trace_v3_XRayConfig_msginit,
+ &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_xray_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h
new file mode 100644
index 00000000..e04e9e66
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h
@@ -0,0 +1,218 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/xray.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_XRayConfig;
+struct envoy_config_trace_v3_XRayConfig_SegmentFields;
+typedef struct envoy_config_trace_v3_XRayConfig envoy_config_trace_v3_XRayConfig;
+typedef struct envoy_config_trace_v3_XRayConfig_SegmentFields envoy_config_trace_v3_XRayConfig_SegmentFields;
+extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_msginit;
+extern const upb_MiniTable envoy_config_trace_v3_XRayConfig_SegmentFields_msginit;
+struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_SocketAddress;
+struct google_protobuf_Struct;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+
+
+
+/* envoy.config.trace.v3.XRayConfig */
+
+UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_XRayConfig*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_XRayConfig* ret = envoy_config_trace_v3_XRayConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_XRayConfig* ret = envoy_config_trace_v3_XRayConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_XRayConfig_serialize(const envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_XRayConfig_serialize_ex(const envoy_config_trace_v3_XRayConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_SocketAddress* envoy_config_trace_v3_XRayConfig_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_SocketAddress*);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_name(const envoy_config_trace_v3_XRayConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_XRayConfig_segment_name(const envoy_config_trace_v3_XRayConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_XRayConfig_sampling_rule_manifest(const envoy_config_trace_v3_XRayConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_DataSource*);
+}
+UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_clear_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_segment_fields(const envoy_config_trace_v3_XRayConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const envoy_config_trace_v3_XRayConfig_SegmentFields*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_daemon_endpoint(envoy_config_trace_v3_XRayConfig *msg, struct envoy_config_core_v3_SocketAddress* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_SocketAddress*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SocketAddress* envoy_config_trace_v3_XRayConfig_mutable_daemon_endpoint(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_SocketAddress* sub = (struct envoy_config_core_v3_SocketAddress*)envoy_config_trace_v3_XRayConfig_daemon_endpoint(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SocketAddress*)_upb_Message_New(&envoy_config_core_v3_SocketAddress_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_XRayConfig_set_daemon_endpoint(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_segment_name(envoy_config_trace_v3_XRayConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_sampling_rule_manifest(envoy_config_trace_v3_XRayConfig *msg, struct envoy_config_core_v3_DataSource* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_trace_v3_XRayConfig_mutable_sampling_rule_manifest(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_trace_v3_XRayConfig_sampling_rule_manifest(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_XRayConfig_set_sampling_rule_manifest(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_set_segment_fields(envoy_config_trace_v3_XRayConfig *msg, envoy_config_trace_v3_XRayConfig_SegmentFields* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_config_trace_v3_XRayConfig_SegmentFields*) = value;
+}
+UPB_INLINE struct envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_mutable_segment_fields(envoy_config_trace_v3_XRayConfig* msg, upb_Arena* arena) {
+ struct envoy_config_trace_v3_XRayConfig_SegmentFields* sub = (struct envoy_config_trace_v3_XRayConfig_SegmentFields*)envoy_config_trace_v3_XRayConfig_segment_fields(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_XRayConfig_set_segment_fields(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.trace.v3.XRayConfig.SegmentFields */
+
+UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_SegmentFields_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_XRayConfig_SegmentFields*)_upb_Message_New(&envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_SegmentFields_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_XRayConfig_SegmentFields* ret = envoy_config_trace_v3_XRayConfig_SegmentFields_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3_XRayConfig_SegmentFields_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_XRayConfig_SegmentFields* ret = envoy_config_trace_v3_XRayConfig_SegmentFields_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_XRayConfig_SegmentFields_serialize(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_XRayConfig_SegmentFields_serialize_ex(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_clear_origin(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_XRayConfig_SegmentFields_origin(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_config_trace_v3_XRayConfig_SegmentFields_has_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_clear_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Struct* envoy_config_trace_v3_XRayConfig_SegmentFields_aws(const envoy_config_trace_v3_XRayConfig_SegmentFields* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*);
+}
+
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_set_origin(envoy_config_trace_v3_XRayConfig_SegmentFields *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_XRayConfig_SegmentFields_set_aws(envoy_config_trace_v3_XRayConfig_SegmentFields *msg, struct google_protobuf_Struct* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* envoy_config_trace_v3_XRayConfig_SegmentFields_mutable_aws(envoy_config_trace_v3_XRayConfig_SegmentFields* msg, upb_Arena* arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_trace_v3_XRayConfig_SegmentFields_aws(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_XRayConfig_SegmentFields_set_aws(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_xray_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c
new file mode 100644
index 00000000..4717205a
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c
@@ -0,0 +1,54 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/zipkin.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/trace/v3/zipkin.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_MiniTable_Sub envoy_config_trace_v3_ZipkinConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_MiniTable_Field envoy_config_trace_v3_ZipkinConfig__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msginit = {
+ &envoy_config_trace_v3_ZipkinConfig_submsgs[0],
+ &envoy_config_trace_v3_ZipkinConfig__fields[0],
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_config_trace_v3_ZipkinConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_config_trace_v3_zipkin_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h
new file mode 100644
index 00000000..aa00f7ca
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h
@@ -0,0 +1,146 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/zipkin.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_
+#define ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_trace_v3_ZipkinConfig;
+typedef struct envoy_config_trace_v3_ZipkinConfig envoy_config_trace_v3_ZipkinConfig;
+extern const upb_MiniTable envoy_config_trace_v3_ZipkinConfig_msginit;
+struct google_protobuf_BoolValue;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+
+typedef enum {
+ envoy_config_trace_v3_ZipkinConfig_DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0,
+ envoy_config_trace_v3_ZipkinConfig_HTTP_JSON = 1,
+ envoy_config_trace_v3_ZipkinConfig_HTTP_PROTO = 2,
+ envoy_config_trace_v3_ZipkinConfig_GRPC = 3
+} envoy_config_trace_v3_ZipkinConfig_CollectorEndpointVersion;
+
+
+
+/* envoy.config.trace.v3.ZipkinConfig */
+
+UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfig_new(upb_Arena* arena) {
+ return (envoy_config_trace_v3_ZipkinConfig*)_upb_Message_New(&envoy_config_trace_v3_ZipkinConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_config_trace_v3_ZipkinConfig* ret = envoy_config_trace_v3_ZipkinConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_config_trace_v3_ZipkinConfig* ret = envoy_config_trace_v3_ZipkinConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_config_trace_v3_ZipkinConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_config_trace_v3_ZipkinConfig_serialize(const envoy_config_trace_v3_ZipkinConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_config_trace_v3_ZipkinConfig_serialize_ex(const envoy_config_trace_v3_ZipkinConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_cluster(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_cluster(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_endpoint(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_trace_id_128bit(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_trace_id_128bit(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool envoy_config_trace_v3_ZipkinConfig_has_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_trace_v3_ZipkinConfig_shared_span_context(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_endpoint_version(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_config_trace_v3_ZipkinConfig_collector_endpoint_version(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_clear_collector_hostname(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_config_trace_v3_ZipkinConfig_collector_hostname(const envoy_config_trace_v3_ZipkinConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView);
+}
+
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_cluster(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_endpoint(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_trace_id_128bit(envoy_config_trace_v3_ZipkinConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_shared_span_context(envoy_config_trace_v3_ZipkinConfig *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_trace_v3_ZipkinConfig_mutable_shared_span_context(envoy_config_trace_v3_ZipkinConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_trace_v3_ZipkinConfig_shared_span_context(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_trace_v3_ZipkinConfig_set_shared_span_context(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_endpoint_version(envoy_config_trace_v3_ZipkinConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_config_trace_v3_ZipkinConfig_set_collector_hostname(envoy_config_trace_v3_ZipkinConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_config_trace_v3_zipkin_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
index 308e8b53..8372af07 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,14 +15,27 @@
#include "upb/port_def.inc"
-static const upb_msglayout_field envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+static const upb_MiniTable_Field envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = {
+const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = {
NULL,
&envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
index ffa4ccbc..77d79ff2 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,42 +22,60 @@ extern "C" {
struct envoy_extensions_clusters_aggregate_v3_ClusterConfig;
typedef struct envoy_extensions_clusters_aggregate_v3_ClusterConfig envoy_extensions_clusters_aggregate_v3_ClusterConfig;
-extern const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
+extern const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
+
/* envoy.extensions.clusters.aggregate.v3.ClusterConfig */
-UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(upb_arena *arena) {
- return (envoy_extensions_clusters_aggregate_v3_ClusterConfig *)_upb_msg_new(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena);
+UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(upb_Arena* arena) {
+ return (envoy_extensions_clusters_aggregate_v3_ClusterConfig*)_upb_Message_New(&envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena);
}
-UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig* ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize_ex(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_clusters_aggregate_v3_ClusterConfig_clear_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE upb_strview const* envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE upb_strview* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_mutable_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE upb_strview* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_extensions_clusters_aggregate_v3_ClusterConfig_resize_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_clusters(envoy_extensions_clusters_aggregate_v3_ClusterConfig* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena);
}
+extern const upb_MiniTable_File envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
index 5f92b8d0..bf3012c1 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/duration.upb.h"
@@ -17,62 +17,79 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = {
- &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultDelay__fields[3] = {
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {4, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultDelay__fields[3] = {
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit = {
+const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit = {
&envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[0],
&envoy_extensions_filters_common_fault_v3_FaultDelay__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit = {
+const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = {
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = {
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[3] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {2, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[3] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit = {
+const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit = {
&envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[0],
&envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 4, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit = {
+const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit = {
NULL,
&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[5] = {
+ &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
};
-const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit = {
+const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout = {
+ messages_layout,
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 5,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
index 8c609170..4ef74bd5 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -30,62 +30,96 @@ typedef struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay e
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit;
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit;
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit;
struct envoy_type_v3_FractionalPercent;
struct google_protobuf_Duration;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
typedef enum {
envoy_extensions_filters_common_fault_v3_FaultDelay_FIXED = 0
} envoy_extensions_filters_common_fault_v3_FaultDelay_FaultDelayType;
+
/* envoy.extensions.filters.common.fault.v3.FaultDelay */
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_new(upb_arena *arena) {
- return (envoy_extensions_filters_common_fault_v3_FaultDelay *)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena);
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena);
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_common_fault_v3_FaultDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_common_fault_v3_FaultDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, options, arena, len);
}
-
typedef enum {
envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_fixed_delay = 3,
envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_header_delay = 5,
envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET = 0
} envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases;
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_case(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) { return (envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, NULL); }
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_case(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return (envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET);
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET);
+}
+UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL);
+}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct google_protobuf_Duration* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(msg, sub);
}
@@ -93,24 +127,24 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_common_faul
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct envoy_type_v3_FractionalPercent* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value;
}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5);
}
-UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
+ sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(msg, sub);
}
@@ -119,67 +153,111 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDela
/* envoy.extensions.filters.common.fault.v3.FaultDelay.HeaderDelay */
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(upb_arena *arena) {
- return (envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, options, arena, len);
}
-
/* envoy.extensions.filters.common.fault.v3.FaultRateLimit */
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(upb_arena *arena) {
- return (envoy_extensions_filters_common_fault_v3_FaultRateLimit *)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena);
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena);
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, options, arena, len);
}
-
typedef enum {
envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_fixed_limit = 1,
envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_header_limit = 3,
envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET = 0
} envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases;
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_case(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) { return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
-UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_case(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET);
+}
+UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*);
+}
+UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET);
+}
+UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1);
}
-UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
+ sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(msg, sub);
}
@@ -187,24 +265,24 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedL
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, struct envoy_type_v3_FractionalPercent* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value;
}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
+ sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(msg, sub);
}
@@ -213,25 +291,41 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_Header
/* envoy.extensions.filters.common.fault.v3.FaultRateLimit.FixedLimit */
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(upb_arena *arena) {
- return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_clear_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0;
+}
+UPB_INLINE uint64_t envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t);
}
-
-UPB_INLINE uint64_t envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t); }
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_set_limit_kbps(envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg, uint64_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
@@ -239,25 +333,38 @@ UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLim
/* envoy.extensions.filters.common.fault.v3.FaultRateLimit.HeaderLimit */
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(upb_arena *arena) {
- return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, options, arena, len);
}
+extern const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
index ca5144c5..a8958537 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/http/fault/v3/fault.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
@@ -19,59 +19,75 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = {
- &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_http_fault_v3_FaultAbort__fields[4] = {
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, 1},
- {3, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_http_fault_v3_FaultAbort__fields[4] = {
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-5, -5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_msginit = {
+const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msginit = {
&envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[0],
&envoy_extensions_filters_http_fault_v3_FaultAbort__fields[0],
- UPB_SIZE(16, 32), 4, false, 255,
+ UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit = {
+const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
- &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = {
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit},
+ {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_http_fault_v3_HTTPFault__fields[14] = {
- {1, UPB_SIZE(68, 136), 1, 1, 11, 1},
- {2, UPB_SIZE(72, 144), 2, 3, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(84, 168), 0, 0, 11, 3},
- {5, UPB_SIZE(88, 176), 0, 0, 9, 3},
- {6, UPB_SIZE(76, 152), 3, 4, 11, 1},
- {7, UPB_SIZE(80, 160), 4, 2, 11, 1},
- {8, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {9, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {10, UPB_SIZE(28, 56), 0, 0, 9, 1},
- {11, UPB_SIZE(36, 72), 0, 0, 9, 1},
- {12, UPB_SIZE(44, 88), 0, 0, 9, 1},
- {13, UPB_SIZE(52, 104), 0, 0, 9, 1},
- {14, UPB_SIZE(60, 120), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_http_fault_v3_HTTPFault__fields[15] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(44, 88), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(52, 104), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(60, 120), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(68, 136), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(76, 152), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(84, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_http_fault_v3_HTTPFault_msginit = {
+const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit = {
&envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[0],
&envoy_extensions_filters_http_fault_v3_HTTPFault__fields[0],
- UPB_SIZE(96, 192), 14, false, 255,
+ UPB_SIZE(92, 184), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
+ &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
+ &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
index fc618c9a..56b3a3e6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,160 +26,309 @@ struct envoy_extensions_filters_http_fault_v3_HTTPFault;
typedef struct envoy_extensions_filters_http_fault_v3_FaultAbort envoy_extensions_filters_http_fault_v3_FaultAbort;
typedef struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort;
typedef struct envoy_extensions_filters_http_fault_v3_HTTPFault envoy_extensions_filters_http_fault_v3_HTTPFault;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_HTTPFault_msginit;
+extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msginit;
+extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit;
+extern const upb_MiniTable envoy_extensions_filters_http_fault_v3_HTTPFault_msginit;
struct envoy_config_route_v3_HeaderMatcher;
struct envoy_extensions_filters_common_fault_v3_FaultDelay;
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit;
struct envoy_type_v3_FractionalPercent;
struct google_protobuf_UInt32Value;
-extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable envoy_config_route_v3_HeaderMatcher_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
+extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+
/* envoy.extensions.filters.http.fault.v3.FaultAbort */
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_new(upb_arena *arena) {
- return (envoy_extensions_filters_http_fault_v3_FaultAbort *)_upb_msg_new(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_http_fault_v3_FaultAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_FaultAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_FaultAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_http_fault_v3_FaultAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_FaultAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_http_fault_v3_FaultAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_FaultAbort_serialize_ex(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, options, arena, len);
}
-
typedef enum {
envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_http_status = 2,
envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_grpc_status = 5,
envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_header_abort = 4,
envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET = 0
} envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases;
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_case(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) { return (envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
-UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, 0); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_v3_FractionalPercent*); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 4; }
-UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 4, NULL); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
-UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg) { return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 5, 0); }
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_case(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return (envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET);
+}
+UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_http_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 2, _upb_UInt32_FromU(0u));
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 8), const struct envoy_type_v3_FractionalPercent*);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET);
+}
+UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_header_abort(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 4, NULL);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_FaultAbort_has_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_clear_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_NOT_SET);
+}
+UPB_INLINE uint32_t envoy_extensions_filters_http_fault_v3_FaultAbort_grpc_status(const envoy_extensions_filters_http_fault_v3_FaultAbort* msg) {
+ return UPB_READ_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), UPB_SIZE(4, 4), 5, _upb_UInt32_FromU(0u));
+}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_http_status(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, uint32_t value) {
- UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2);
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 2);
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, struct envoy_type_v3_FractionalPercent* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_v3_FractionalPercent*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 8), struct envoy_type_v3_FractionalPercent*) = value;
}
-UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_percentage(envoy_extensions_filters_http_fault_v3_FaultAbort* msg, upb_Arena* arena) {
struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_http_fault_v3_FaultAbort_percentage(msg);
if (sub == NULL) {
- sub = (struct envoy_type_v3_FractionalPercent*)_upb_msg_new(&envoy_type_v3_FractionalPercent_msginit, arena);
+ sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_FaultAbort_set_percentage(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 4);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 4);
}
-UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_mutable_header_abort(envoy_extensions_filters_http_fault_v3_FaultAbort* msg, upb_Arena* arena) {
struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)envoy_extensions_filters_http_fault_v3_FaultAbort_header_abort(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_msg_new(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena);
+ sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_FaultAbort_set_header_abort(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_FaultAbort_set_grpc_status(envoy_extensions_filters_http_fault_v3_FaultAbort *msg, uint32_t value) {
- UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 5);
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(8, 16), value, UPB_SIZE(4, 4), 5);
}
/* envoy.extensions.filters.http.fault.v3.FaultAbort.HeaderAbort */
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(upb_arena *arena) {
- return (envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *)_upb_msg_new(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena);
-}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_serialize_ex(const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, options, arena, len);
}
-
/* envoy.extensions.filters.http.fault.v3.HTTPFault */
-UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_filters_http_fault_v3_HTTPFault_new(upb_arena *arena) {
- return (envoy_extensions_filters_http_fault_v3_HTTPFault *)_upb_msg_new(&envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena);
+UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_filters_http_fault_v3_HTTPFault_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_fault_v3_HTTPFault*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_filters_http_fault_v3_HTTPFault_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_HTTPFault* ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_filters_http_fault_v3_HTTPFault_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_fault_v3_HTTPFault* ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_filters_http_fault_v3_HTTPFault_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_http_fault_v3_HTTPFault *ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_HTTPFault_serialize(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, 0, arena, len);
}
-UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_filters_http_fault_v3_HTTPFault_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_http_fault_v3_HTTPFault *ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_http_fault_v3_HTTPFault_serialize_ex(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_http_fault_v3_HTTPFault_serialize(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena, len);
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_filters_common_fault_v3_FaultDelay*);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_filters_http_fault_v3_FaultAbort*);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_upstream_cluster(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_upstream_cluster(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_extensions_filters_http_fault_v3_HTTPFault_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) {
+ return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_filters_http_fault_v3_HTTPFault_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_delay_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_delay_duration_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_delay_duration_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_http_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_http_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_fault_v3_HTTPFault_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_clear_disable_downstream_cluster_stats(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_disable_downstream_cluster_stats(const envoy_extensions_filters_http_fault_v3_HTTPFault* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_delay(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct envoy_extensions_filters_common_fault_v3_FaultDelay*); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_abort(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const envoy_extensions_filters_http_fault_v3_FaultAbort*); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_upstream_cluster(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(84, 168)); }
-UPB_INLINE const struct envoy_config_route_v3_HeaderMatcher* const* envoy_extensions_filters_http_fault_v3_HTTPFault_headers(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t *len) { return (const struct envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(84, 168), len); }
-UPB_INLINE upb_strview const* envoy_extensions_filters_http_fault_v3_HTTPFault_downstream_nodes(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(88, 176), len); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_has_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_delay_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_abort_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_delay_duration_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_abort_http_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_strview); }
-UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_strview); }
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct envoy_extensions_filters_common_fault_v3_FaultDelay* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct envoy_extensions_filters_common_fault_v3_FaultDelay*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_filters_common_fault_v3_FaultDelay*) = value;
}
-UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_delay(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_delay(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) {
struct envoy_extensions_filters_common_fault_v3_FaultDelay* sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)envoy_extensions_filters_http_fault_v3_HTTPFault_delay(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena);
+ sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(msg, sub);
}
@@ -187,51 +336,49 @@ UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_ext
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, envoy_extensions_filters_http_fault_v3_FaultAbort* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 144), envoy_extensions_filters_http_fault_v3_FaultAbort*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_filters_http_fault_v3_FaultAbort*) = value;
}
-UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_abort(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_abort(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) {
struct envoy_extensions_filters_http_fault_v3_FaultAbort* sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)envoy_extensions_filters_http_fault_v3_HTTPFault_abort(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_msg_new(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena);
+ sub = (struct envoy_extensions_filters_http_fault_v3_FaultAbort*)_upb_Message_New(&envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_upstream_cluster(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_upstream_cluster(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_headers(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t *len) {
- return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(84, 168), len);
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_resize_headers(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(84, 168), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher** envoy_extensions_filters_http_fault_v3_HTTPFault_resize_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_route_v3_HeaderMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_extensions_filters_http_fault_v3_HTTPFault_add_headers(envoy_extensions_filters_http_fault_v3_HTTPFault *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_accessor2(
- msg, UPB_SIZE(84, 168), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_extensions_filters_http_fault_v3_HTTPFault_add_headers(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) {
+ struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_Message_New(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE upb_strview* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 176), len);
+UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
-UPB_INLINE upb_strview* envoy_extensions_filters_http_fault_v3_HTTPFault_resize_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(88, 176), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_extensions_filters_http_fault_v3_HTTPFault_resize_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_add_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(88, 176), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_add_downstream_nodes(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 152), 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_extensions_filters_http_fault_v3_HTTPFault_mutable_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_max_active_faults(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults(msg, sub);
}
@@ -239,39 +386,44 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_http_fau
}
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 160), struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*) = value;
}
-UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_http_fault_v3_HTTPFault_mutable_response_rate_limit(envoy_extensions_filters_http_fault_v3_HTTPFault* msg, upb_Arena* arena) {
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit(msg);
if (sub == NULL) {
- sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_msg_new(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena);
+ sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit(msg, sub);
}
return sub;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = value;
+}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_duration_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay_duration_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_http_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_http_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 136), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_max_active_faults_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 152), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_rate_limit_percent_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_grpc_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 168), upb_StringView) = value;
}
-UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_grpc_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_strview) = value;
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_disable_downstream_cluster_stats(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+extern const upb_MiniTable_File envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c
new file mode 100644
index 00000000..0749b5ec
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c
@@ -0,0 +1,64 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[2] = {
+ {.submsg = &envoy_config_rbac_v3_RBAC_msginit},
+ {.submsg = &envoy_config_rbac_v3_RBAC_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBAC__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit = {
+ &envoy_extensions_filters_http_rbac_v3_RBAC_submsgs[0],
+ &envoy_extensions_filters_http_rbac_v3_RBAC__fields[0],
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_http_rbac_v3_RBAC_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[1] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit = {
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[0],
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_extensions_filters_http_rbac_v3_RBAC_msginit,
+ &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h
new file mode 100644
index 00000000..566f8db1
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h
@@ -0,0 +1,183 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_filters_http_rbac_v3_RBAC;
+struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute;
+typedef struct envoy_extensions_filters_http_rbac_v3_RBAC envoy_extensions_filters_http_rbac_v3_RBAC;
+typedef struct envoy_extensions_filters_http_rbac_v3_RBACPerRoute envoy_extensions_filters_http_rbac_v3_RBACPerRoute;
+extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBAC_msginit;
+extern const upb_MiniTable envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit;
+struct envoy_config_rbac_v3_RBAC;
+extern const upb_MiniTable envoy_config_rbac_v3_RBAC_msginit;
+
+
+
+/* envoy.extensions.filters.http.rbac.v3.RBAC */
+
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_rbac_v3_RBAC* ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_rbac_v3_RBAC* ret = envoy_extensions_filters_http_rbac_v3_RBAC_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_filters_http_rbac_v3_RBAC_serialize(const envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_http_rbac_v3_RBAC_serialize_ex(const envoy_extensions_filters_http_rbac_v3_RBAC* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_rbac_v3_RBAC*);
+}
+UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBAC_has_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_rbac_v3_RBAC*);
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_clear_shadow_rules_stat_prefix(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules_stat_prefix(const envoy_extensions_filters_http_rbac_v3_RBAC* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_rbac_v3_RBAC*) = value;
+}
+UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) {
+ struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_rules(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_http_rbac_v3_RBAC_set_rules(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC *msg, struct envoy_config_rbac_v3_RBAC* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_rbac_v3_RBAC*) = value;
+}
+UPB_INLINE struct envoy_config_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBAC_mutable_shadow_rules(envoy_extensions_filters_http_rbac_v3_RBAC* msg, upb_Arena* arena) {
+ struct envoy_config_rbac_v3_RBAC* sub = (struct envoy_config_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBAC_shadow_rules(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_rbac_v3_RBAC*)_upb_Message_New(&envoy_config_rbac_v3_RBAC_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBAC_set_shadow_rules_stat_prefix(envoy_extensions_filters_http_rbac_v3_RBAC *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
+}
+
+/* envoy.extensions.filters.http.rbac.v3.RBACPerRoute */
+
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_rbac_v3_RBACPerRoute*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute* ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute* ret = envoy_extensions_filters_http_rbac_v3_RBACPerRoute_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_serialize(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_serialize_ex(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_filters_http_rbac_v3_RBACPerRoute_has_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_clear_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(const envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_http_rbac_v3_RBAC*);
+}
+
+UPB_INLINE void envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute *msg, envoy_extensions_filters_http_rbac_v3_RBAC* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_http_rbac_v3_RBAC*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_http_rbac_v3_RBACPerRoute_mutable_rbac(envoy_extensions_filters_http_rbac_v3_RBACPerRoute* msg, upb_Arena* arena) {
+ struct envoy_extensions_filters_http_rbac_v3_RBAC* sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_http_rbac_v3_RBAC*)_upb_Message_New(&envoy_extensions_filters_http_rbac_v3_RBAC_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute_set_rbac(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
index 8e6ff697..cc8cffbe 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -17,24 +17,38 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_http_router_v3_Router_submsgs[2] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_http_router_v3_Router_submsgs[2] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_http_router_v3_Router__fields[6] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {5, UPB_SIZE(12, 24), 0, 0, 9, 3},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_http_router_v3_Router__fields[7] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit = {
+const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit = {
&envoy_extensions_filters_http_router_v3_Router_submsgs[0],
&envoy_extensions_filters_http_router_v3_Router__fields[0],
- UPB_SIZE(16, 32), 6, false, 255,
+ UPB_SIZE(20, 40), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_extensions_filters_http_router_v3_Router_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
index 2e7084ac..0dd9b54e 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,50 +22,102 @@ extern "C" {
struct envoy_extensions_filters_http_router_v3_Router;
typedef struct envoy_extensions_filters_http_router_v3_Router envoy_extensions_filters_http_router_v3_Router;
-extern const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit;
+extern const upb_MiniTable envoy_extensions_filters_http_router_v3_Router_msginit;
struct envoy_config_accesslog_v3_AccessLog;
struct google_protobuf_BoolValue;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+
/* envoy.extensions.filters.http.router.v3.Router */
-UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_new(upb_arena *arena) {
- return (envoy_extensions_filters_http_router_v3_Router *)_upb_msg_new(&envoy_extensions_filters_http_router_v3_Router_msginit, arena);
+UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filters_http_router_v3_Router_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_http_router_v3_Router*)_upb_Message_New(&envoy_extensions_filters_http_router_v3_Router_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filters_http_router_v3_Router_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_http_router_v3_Router* ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filters_http_router_v3_Router_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_http_router_v3_Router* ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_http_router_v3_Router_serialize(const envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_extensions_filters_http_router_v3_Router_serialize(const envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, len);
+UPB_INLINE char* envoy_extensions_filters_http_router_v3_Router_serialize_ex(const envoy_extensions_filters_http_router_v3_Router* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_start_child_span(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_start_child_span(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) {
+ return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
+}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_clear_suppress_grpc_request_failure_code_stats(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_grpc_request_failure_code_stats(const envoy_extensions_filters_http_router_v3_Router* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
}
-
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_start_child_span(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE upb_strview const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_BoolValue*) = value;
}
-UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_mutable_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_mutable_dynamic_stats(envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_http_router_v3_Router_dynamic_stats(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(msg, sub);
}
@@ -74,35 +126,38 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_route
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_start_child_span(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_http_router_v3_Router_add_upstream_log(envoy_extensions_filters_http_router_v3_Router *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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_http_router_v3_Router_add_upstream_log(envoy_extensions_filters_http_router_v3_Router* msg, upb_Arena* arena) {
+ struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_envoy_headers(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
-UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
}
-UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_add_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_add_strict_check_headers(envoy_extensions_filters_http_router_v3_Router* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_respect_expected_rq_timeout(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_grpc_request_failure_code_stats(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+
+extern const upb_MiniTable_File envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
index 6b2b6c15..c32836f8 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -18,6 +18,7 @@
#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/http/v3/path_transformation.upb.h"
#include "envoy/type/tracing/v3/custom_tag.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -31,331 +32,431 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[17] = {
- &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[40] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(28, 32), 0, 0, 9, 1},
- {3, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 11, 11, 1},
- {4, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 4, 11, 1},
- {5, UPB_SIZE(128, 232), 0, 9, 11, 3},
- {6, UPB_SIZE(52, 80), 1, 14, 11, 1},
- {7, UPB_SIZE(56, 88), 2, 7, 11, 1},
- {8, UPB_SIZE(60, 96), 3, 1, 11, 1},
- {9, UPB_SIZE(64, 104), 4, 2, 11, 1},
- {10, UPB_SIZE(36, 48), 0, 0, 9, 1},
- {12, UPB_SIZE(68, 112), 5, 15, 11, 1},
- {13, UPB_SIZE(132, 240), 0, 0, 11, 3},
- {14, UPB_SIZE(72, 120), 6, 14, 11, 1},
- {15, UPB_SIZE(76, 128), 7, 14, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(80, 136), 8, 6, 11, 1},
- {18, UPB_SIZE(20, 20), 0, 0, 8, 1},
- {19, UPB_SIZE(16, 16), 0, 0, 13, 1},
- {20, UPB_SIZE(21, 21), 0, 0, 8, 1},
- {21, UPB_SIZE(22, 22), 0, 0, 8, 1},
- {22, UPB_SIZE(44, 64), 0, 0, 9, 1},
- {23, UPB_SIZE(136, 248), 0, 8, 11, 3},
- {24, UPB_SIZE(84, 144), 9, 15, 11, 1},
- {25, UPB_SIZE(88, 152), 10, 5, 11, 1},
- {26, UPB_SIZE(92, 160), 11, 15, 11, 1},
- {28, UPB_SIZE(96, 168), 12, 15, 11, 1},
- {29, UPB_SIZE(100, 176), 13, 16, 11, 1},
- {30, UPB_SIZE(104, 184), 14, 14, 11, 1},
- {31, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 13, 11, 1},
- {32, UPB_SIZE(23, 23), 0, 0, 8, 1},
- {33, UPB_SIZE(24, 24), 0, 0, 8, 1},
- {34, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {35, UPB_SIZE(108, 192), 15, 3, 11, 1},
- {36, UPB_SIZE(112, 200), 16, 12, 11, 1},
- {37, UPB_SIZE(25, 25), 0, 0, 8, 1},
- {38, UPB_SIZE(116, 208), 17, 10, 11, 1},
- {39, UPB_SIZE(26, 26), 0, 0, 8, 1},
- {40, UPB_SIZE(120, 216), 18, 14, 11, 1},
- {41, UPB_SIZE(124, 224), 19, 15, 11, 1},
- {42, UPB_SIZE(148, 268), UPB_SIZE(-153, -273), 0, 8, 1},
-};
-
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = {
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[30] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit},
+ {.submsg = &envoy_config_route_v3_RouteConfiguration_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit},
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit},
+ {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http3ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_SchemeHeaderTransformation_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[47] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(52, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(184, 320), UPB_SIZE(-25, -25), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(184, 320), UPB_SIZE(-25, -25), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(60, 72), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(64, 80), UPB_SIZE(1, 1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(68, 88), UPB_SIZE(2, 2), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(72, 96), UPB_SIZE(3, 3), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(76, 104), UPB_SIZE(4, 4), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(80, 112), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(88, 128), UPB_SIZE(5, 5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(92, 136), UPB_SIZE(0, 0), 8, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(96, 144), UPB_SIZE(6, 6), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(100, 152), UPB_SIZE(7, 7), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(104, 160), UPB_SIZE(8, 8), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(20, 20), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(21, 21), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(108, 168), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(116, 184), UPB_SIZE(0, 0), 12, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(120, 192), UPB_SIZE(9, 9), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(124, 200), UPB_SIZE(10, 10), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(128, 208), UPB_SIZE(11, 11), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {28, UPB_SIZE(132, 216), UPB_SIZE(12, 12), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {29, UPB_SIZE(136, 224), UPB_SIZE(13, 13), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {30, UPB_SIZE(140, 232), UPB_SIZE(14, 14), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(184, 320), UPB_SIZE(-25, -25), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {32, UPB_SIZE(28, 28), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {33, UPB_SIZE(29, 29), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {34, UPB_SIZE(32, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {35, UPB_SIZE(144, 240), UPB_SIZE(15, 15), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {36, UPB_SIZE(148, 248), UPB_SIZE(16, 16), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {37, UPB_SIZE(36, 36), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {38, UPB_SIZE(152, 256), UPB_SIZE(17, 17), 22, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {39, UPB_SIZE(37, 37), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {40, UPB_SIZE(156, 264), UPB_SIZE(18, 18), 23, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {41, UPB_SIZE(160, 272), UPB_SIZE(19, 19), 24, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {42, UPB_SIZE(188, 328), UPB_SIZE(-41, -41), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {43, UPB_SIZE(164, 280), UPB_SIZE(20, 20), 25, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {44, UPB_SIZE(168, 288), UPB_SIZE(21, 21), 26, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {45, UPB_SIZE(44, 44), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {46, UPB_SIZE(172, 296), UPB_SIZE(0, 0), 27, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {47, UPB_SIZE(48, 48), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {48, UPB_SIZE(176, 304), UPB_SIZE(22, 22), 28, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {49, UPB_SIZE(180, 312), UPB_SIZE(23, 23), 29, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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(160, 288), 40, false, 255,
+ UPB_SIZE(192, 344), 47, kUpb_ExtMode_NonExtendable, 10, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[4] = {
- &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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_msginit},
+ {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = {
- {3, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(12, 24), 3, 2, 11, 1},
- {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {7, UPB_SIZE(16, 32), 4, 3, 11, 1},
- {8, UPB_SIZE(24, 48), 0, 1, 11, 3},
- {9, UPB_SIZE(20, 40), 5, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = {
+ {3, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(24, 48), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit = {
+const upb_MiniTable 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(32, 56), 7, false, 255,
+ UPB_SIZE(28, 56), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {5, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit = {
+const upb_MiniTable 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(16, 16), 5, false, 255,
+ UPB_SIZE(12, 24), 5, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[2] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_msginit},
+ {.submsg = &envoy_type_http_v3_PathTransformation_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig__fields[6] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(3, 3), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit = {
+ NULL,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig__fields[0],
+ UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit},
+ {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 4, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 3, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 2, 11, 3},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit = {
+const upb_MiniTable 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(24, 48), 5, false, 255,
+ UPB_SIZE(24, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit = {
+const upb_MiniTable 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), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {4, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 2, 11, 1},
- {5, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 1, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit = {
+const upb_MiniTable 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(32, 64), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 40), UPB_SIZE(-1, -1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 40), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = {
+ {.submsg = &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(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
- {5, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit = {
+const upb_MiniTable 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(24, 48), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[20] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_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_UpgradeConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
+ &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_KvElement_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 20,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
index 668fa854..7da08721 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,6 +25,8 @@ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectio
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_HttpConnectionManager_PathNormalizationOptions;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig;
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;
@@ -37,11 +39,14 @@ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_
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;
+struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager;
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_HttpConnectionManager_PathNormalizationOptions envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig;
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;
@@ -54,23 +59,27 @@ typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Scope
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;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit;
+extern const upb_MiniTable envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit;
struct envoy_config_accesslog_v3_AccessLog;
struct envoy_config_accesslog_v3_AccessLogFilter;
struct envoy_config_core_v3_ConfigSource;
@@ -79,36 +88,44 @@ 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_Http3ProtocolOptions;
struct envoy_config_core_v3_HttpProtocolOptions;
+struct envoy_config_core_v3_SchemeHeaderTransformation;
struct envoy_config_core_v3_SubstitutionFormatString;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_route_v3_RouteConfiguration;
struct envoy_config_route_v3_ScopedRouteConfiguration;
struct envoy_config_trace_v3_Tracing_Http;
+struct envoy_type_http_v3_PathTransformation;
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;
-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_MiniTable envoy_config_accesslog_v3_AccessLog_msginit;
+extern const upb_MiniTable envoy_config_accesslog_v3_AccessLogFilter_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ExtensionConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Http3ProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SchemeHeaderTransformation_msginit;
+extern const upb_MiniTable envoy_config_core_v3_SubstitutionFormatString_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_route_v3_RouteConfiguration_msginit;
+extern const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_msginit;
+extern const upb_MiniTable envoy_config_trace_v3_Tracing_Http_msginit;
+extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_AUTO = 0,
@@ -126,6 +143,14 @@ typedef enum {
} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ForwardClientCertDetails;
typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_IMPLEMENTATION_SPECIFIC_DEFAULT = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_KEEP_UNCHANGED = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_REJECT_REQUEST = 2,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UNESCAPE_AND_REDIRECT = 3,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UNESCAPE_AND_FORWARD = 4
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathWithEscapedSlashesAction;
+
+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
@@ -137,158 +162,480 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, options, 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(144, 264), int32_t); }
-
+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(24, 24), int32_t);
+}
typedef enum {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_strip_any_host_port = 42,
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_NOT_SET = 0
} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(152, 272), 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(4, 4), 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(28, 32), 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(144, 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(140, 256), UPB_SIZE(144, 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(144, 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(140, 256), UPB_SIZE(144, 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(128, 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(128, 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_hasbit(msg, 1); }
-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(52, 80), 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_hasbit(msg, 2); }
-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(56, 88), 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_hasbit(msg, 3); }
-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(60, 96), 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_hasbit(msg, 4); }
-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(64, 104), 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(36, 48), 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_hasbit(msg, 5); }
-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(68, 112), 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(132, 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(132, 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_hasbit(msg, 6); }
-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(72, 120), 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_hasbit(msg, 7); }
-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(76, 128), 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_hasbit(msg, 8); }
-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(80, 136), 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(20, 20), 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(16, 16), 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(21, 21), 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(22, 22), 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(44, 64), 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(136, 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(136, 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_hasbit(msg, 9); }
-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(84, 144), 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_hasbit(msg, 10); }
-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(88, 152), 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_hasbit(msg, 11); }
-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(92, 160), 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_hasbit(msg, 12); }
-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(96, 168), 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_hasbit(msg, 13); }
-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(100, 176), 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_hasbit(msg, 14); }
-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(104, 184), 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(144, 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(140, 256), UPB_SIZE(144, 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(23, 23), 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(24, 24), 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(12, 12), 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_hasbit(msg, 15); }
-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(108, 192), 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_hasbit(msg, 16); }
-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(112, 200), 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(25, 25), 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_hasbit(msg, 17); }
-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(116, 208), 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(26, 26), 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_hasbit(msg, 18); }
-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(120, 216), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 19); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 224), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(152, 272)) == 42; }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(148, 268), UPB_SIZE(152, 272), 42, false); }
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 40), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(52, 56), upb_StringView);
+}
+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(24, 24)) == 3;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(184, 320), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET);
+}
+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(184, 320), UPB_SIZE(24, 24), 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(24, 24)) == 4;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(184, 320), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET);
+}
+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(184, 320), UPB_SIZE(24, 24), 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(60, 72));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(60, 72));
+}
+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(60, 72), 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 80), const upb_Message*) = NULL;
+}
+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(64, 80), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), const upb_Message*) = NULL;
+}
+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(68, 88), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 96), const upb_Message*) = NULL;
+}
+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(72, 96), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), const upb_Message*) = NULL;
+}
+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(76, 104), const struct envoy_config_core_v3_Http2ProtocolOptions*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(80, 112), upb_StringView);
+}
+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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 128), const upb_Message*) = NULL;
+}
+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(88, 128), 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(92, 136));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(92, 136));
+}
+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(92, 136), 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_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 144), const upb_Message*) = NULL;
+}
+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(96, 144), 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_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 152), const upb_Message*) = NULL;
+}
+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(100, 152), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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_hasbit(msg, 8);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 160), const upb_Message*) = NULL;
+}
+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(104, 160), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+}
+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(12, 12), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0;
+}
+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(16, 16), uint32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
+}
+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(20, 20), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = 0;
+}
+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(21, 21), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(108, 168), upb_StringView);
+}
+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(116, 184));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(116, 184));
+}
+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(116, 184), 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_hasbit(msg, 9);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 192), const upb_Message*) = NULL;
+}
+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(120, 192), 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_hasbit(msg, 10);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), const upb_Message*) = NULL;
+}
+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(124, 200), 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_hasbit(msg, 11);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 208), const upb_Message*) = NULL;
+}
+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(128, 208), 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_hasbit(msg, 12);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), const upb_Message*) = NULL;
+}
+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(132, 216), 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_hasbit(msg, 13);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 224), const upb_Message*) = NULL;
+}
+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(136, 224), 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_hasbit(msg, 14);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 232), const upb_Message*) = NULL;
+}
+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(140, 232), 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(24, 24)) == 31;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(184, 320), 0, UPB_SIZE(24, 24), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET);
+}
+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(184, 320), UPB_SIZE(24, 24), 31, NULL);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = 0;
+}
+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(28, 28), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = 0;
+}
+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(29, 29), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int32_t) = 0;
+}
+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(32, 32), 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_hasbit(msg, 15);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 240), const upb_Message*) = NULL;
+}
+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(144, 240), 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_hasbit(msg, 16);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), const upb_Message*) = NULL;
+}
+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(148, 248), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 36), bool) = 0;
+}
+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(36, 36), 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_hasbit(msg, 17);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(152, 256), const upb_Message*) = NULL;
+}
+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(152, 256), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(37, 37), bool) = 0;
+}
+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(37, 37), 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_hasbit(msg, 18);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), const upb_Message*) = NULL;
+}
+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(156, 264), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 19);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(160, 272), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(40, 40)) == 42;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(188, 328), 0, UPB_SIZE(40, 40), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_NOT_SET);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(188, 328), UPB_SIZE(40, 40), 42, false);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 20);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(164, 280), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 21);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(168, 288), const struct envoy_config_core_v3_Http3ProtocolOptions*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_path_with_escaped_slashes_action(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_with_escaped_slashes_action(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(172, 296));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ _upb_array_detach(msg, UPB_SIZE(172, 296));
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(172, 296), len);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_strip_trailing_host_dot(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_trailing_host_dot(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 22);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(176, 304), const struct envoy_config_core_v3_SchemeHeaderTransformation*);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 23);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_clear_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_status_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(180, 312), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*);
+}
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(4, 4), 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(28, 32), upb_strview) = 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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 56), upb_StringView) = 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(140, 256), value, UPB_SIZE(144, 264), 3);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(184, 320), value, UPB_SIZE(24, 24), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_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(140, 256), value, UPB_SIZE(144, 264), 4);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(184, 320), value, UPB_SIZE(24, 24), 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) {
+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);
+ sub = (struct envoy_config_route_v3_RouteConfiguration*)_upb_Message_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(128, 232), len);
+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(60, 72), 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_accessor2(msg, UPB_SIZE(128, 232), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(60, 72), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(128, 232), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 72), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 80), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -296,12 +643,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 88), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)_upb_Message_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);
}
@@ -309,12 +656,12 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Ht
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 96), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)_upb_Message_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);
}
@@ -322,54 +669,53 @@ UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_fi
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 104), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)_upb_Message_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(36, 48), upb_strview) = value;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 112), upb_StringView) = 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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 128), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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(132, 240), len);
+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(92, 136), 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_accessor2(msg, UPB_SIZE(132, 240), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(92, 136), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(132, 240), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(92, 136), UPB_SIZE(2, 3), &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_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 144), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -377,12 +723,12 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
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_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 152), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -393,53 +739,52 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
}
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_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 160), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_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(20, 20), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), 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(16, 16), 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(21, 21), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), 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(22, 22), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(21, 21), 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(44, 64), upb_strview) = 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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 168), upb_StringView) = 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(136, 248), len);
+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(116, 184), 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_accessor2(msg, UPB_SIZE(136, 248), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(116, 184), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(136, 248), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(116, 184), UPB_SIZE(2, 3), &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_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 144), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 192), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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);
}
@@ -447,12 +792,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
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_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(88, 152), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 200), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_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);
}
@@ -460,12 +805,12 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Ht
}
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_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 160), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 208), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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);
}
@@ -473,12 +818,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
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_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(96, 168), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 216), 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) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(msg, sub);
}
@@ -486,12 +831,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
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_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 176), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 224), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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);
}
@@ -499,46 +844,46 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_
}
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_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(104, 184), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 232), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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(140, 256), value, UPB_SIZE(144, 264), 31);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(184, 320), value, UPB_SIZE(24, 24), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_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(23, 23), 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_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), 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_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), 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_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(108, 192), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 240), 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) {
+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);
+ sub = (struct envoy_config_core_v3_HttpProtocolOptions*)_upb_Message_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);
}
@@ -546,44 +891,44 @@ UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_fil
}
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_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(112, 200), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 248), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_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(25, 25), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 36), 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_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(116, 208), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(152, 256), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)_upb_Message_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(26, 26), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(37, 37), 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_sethas(msg, 18);
- *UPB_PTR_AT(msg, UPB_SIZE(120, 216), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(156, 264), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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);
}
@@ -591,63 +936,191 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 19);
- *UPB_PTR_AT(msg, UPB_SIZE(124, 224), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(160, 272), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_headers_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_headers_timeout(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_any_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(148, 268), value, UPB_SIZE(152, 272), 42);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(188, 328), value, UPB_SIZE(40, 40), 42);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* value) {
+ _upb_sethas(msg, 20);
+ *UPB_PTR_AT(msg, UPB_SIZE(164, 280), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http3ProtocolOptions* value) {
+ _upb_sethas(msg, 21);
+ *UPB_PTR_AT(msg, UPB_SIZE(168, 288), struct envoy_config_core_v3_Http3ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_Http3ProtocolOptions* sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)_upb_Message_New(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_with_escaped_slashes_action(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 44), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t* len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(172, 296), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(172, 296), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(172, 296), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_trailing_host_dot(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_SchemeHeaderTransformation* value) {
+ _upb_sethas(msg, 22);
+ *UPB_PTR_AT(msg, UPB_SIZE(176, 304), struct envoy_config_core_v3_SchemeHeaderTransformation*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_SchemeHeaderTransformation* sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)_upb_Message_New(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_status_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* value) {
+ _upb_sethas(msg, 23);
+ *UPB_PTR_AT(msg, UPB_SIZE(180, 312), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_proxy_status_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_status_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_status_config(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 envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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(1, 1), 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_hasbit(msg, 4); }
-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_hasbit(msg, 5); }
-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 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_client_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_random_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_overall_sampling(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_verbose(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_max_path_tag_length(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(20, 40));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_custom_tags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40), 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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_clear_provider(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+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(24, 48), 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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_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);
}
@@ -657,10 +1130,10 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_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);
}
@@ -670,10 +1143,10 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
_upb_sethas(msg, 3);
*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) {
+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);
+ sub = (struct envoy_type_v3_Percent*)_upb_Message_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);
}
@@ -686,36 +1159,35 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
_upb_sethas(msg, 4);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_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_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(20, 40), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_tracing_v3_CustomTag_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_trace_v3_Tracing_Http*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), 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) {
+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);
+ sub = (struct envoy_config_trace_v3_Tracing_Http*)_upb_Message_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);
}
@@ -724,25 +1196,41 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing_Http* envoy_extensions_filters_n
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_clear_unix_sockets(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 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;
@@ -750,39 +1238,77 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_subject(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), const struct google_protobuf_BoolValue*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_cert(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_dns(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+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(2, 2), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_uri(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+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(3, 3), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_clear_chain(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+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(4, 4), bool);
}
-
-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_hasbit(msg, 1); }
-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(8, 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(1, 1), 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(2, 2), 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(3, 3), 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(4, 4), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(8, 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_set_subject(msg, sub);
}
@@ -803,106 +1329,337 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, options, arena, len);
}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_upgrade_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) {
+ _upb_array_detach(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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_clear_enabled(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct google_protobuf_BoolValue*);
}
-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(4, 8), 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(16, 32)); }
-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(16, 32), 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_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(16, 32), len);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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 */
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_http_v3_PathTransformation*);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_clear_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_http_v3_PathTransformation*);
+}
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_http_v3_PathTransformation*) = value;
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, upb_Arena* arena) {
+ struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_http_v3_PathTransformation*) = value;
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* msg, upb_Arena* arena) {
+ struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ProxyStatusConfig */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_use_node_id = 5,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_literal_proxy_name = 6,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET = 0
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases;
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_connection_termination_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_connection_termination_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_remove_response_flags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_remove_response_flags(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_set_recommended_response_code(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_recommended_response_code(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_use_node_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, false);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_has_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_clear_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_literal_proxy_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 6, upb_StringView_FromString(""));
+}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_remove_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *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_ProxyStatusConfig_set_remove_connection_termination_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_remove_response_flags(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *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_ProxyStatusConfig_set_set_recommended_response_code(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_use_node_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5);
}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_set_literal_proxy_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 6);
}
-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(8, 16)); }
-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(8, 16), 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_hasbit(msg, 1); }
-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(4, 8), const struct envoy_config_core_v3_SubstitutionFormatString*); }
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, options, 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 void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_mappers(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) {
+ _upb_array_detach(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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_clear_body_format(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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(8, 16), len);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_SubstitutionFormatString*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_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);
}
@@ -911,43 +1668,89 @@ UPB_INLINE struct envoy_config_core_v3_SubstitutionFormatString* envoy_extension
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_filter(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_status_code(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_body_format_override(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), 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(20, 40));
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_clear_headers_to_add(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40), 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_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_hasbit(msg, 4); }
-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(16, 32), 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(20, 40)); }
-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(20, 40), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_accesslog_v3_AccessLogFilter*)_upb_Message_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);
}
@@ -957,10 +1760,10 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Resp
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_set_status_code(msg, sub);
}
@@ -970,10 +1773,10 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Resp
_upb_sethas(msg, 3);
*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_filters_network_http_connection_manager_v3_ResponseMapper_mutable_body(envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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);
}
@@ -983,155 +1786,239 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Resp
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_SubstitutionFormatString*)_upb_Message_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) {
+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(20, 40), 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_Rds*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds* ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_Rds_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Rds_clear_route_config_name(const envoy_extensions_filters_network_http_connection_manager_v3_Rds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(8, 16), upb_StringView);
}
-
-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_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview); }
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_extensions_filters_network_http_connection_manager_v3_Rds_mutable_config_source(envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_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(4, 8), upb_strview) = value;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, options, arena, len);
}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_clear_scoped_route_configurations(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, options, 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(24, 48), 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(4, 8), 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_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(24, 48)) == 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(20, 40), UPB_SIZE(24, 48), 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(24, 48)) == 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(20, 40), UPB_SIZE(24, 48), 5, NULL); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(8, 8), upb_StringView);
+}
+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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scope_key_builder(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), 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(4, 4)) == 4;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_route_configurations_list(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(24, 40), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET);
+}
+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(24, 40), UPB_SIZE(4, 4), 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(4, 4)) == 5;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_clear_scoped_rds(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(24, 40), 0, UPB_SIZE(4, 4), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_NOT_SET);
+}
+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(24, 40), UPB_SIZE(4, 4), 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(4, 8), upb_strview) = value;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_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);
}
@@ -1139,36 +2026,36 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_ConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_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(20, 40), value, UPB_SIZE(24, 48), 4);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*, UPB_SIZE(24, 40), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList*)_upb_Message_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(20, 40), value, UPB_SIZE(24, 48), 5);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*, UPB_SIZE(24, 40), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_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);
}
@@ -1177,77 +2064,113 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, options, 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 void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_clear_fragments(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_clear_header_value_extractor(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_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);
}
@@ -1256,54 +2179,90 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(8, 8), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(16, 24), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_index(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) {
+ UPB_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 40), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET);
+}
+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(4, 40), UPB_SIZE(0, 0), 3, _upb_UInt32_FromU(0u));
+}
+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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_clear_element(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(4, 40), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_NOT_SET);
+}
+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(4, 40), UPB_SIZE(0, 0), 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_name(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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_element_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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_WRITE_ONEOF(msg, uint32_t, UPB_SIZE(4, 40), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*, UPB_SIZE(4, 40), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_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);
}
@@ -1312,173 +2271,332 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-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_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, options, arena, len);
}
-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 void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_clear_separator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_clear_key(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_separator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_ConfigSource*);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_clear_srds_resources_locator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_srds_resources_locator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-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_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_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;
}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_srds_resources_locator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, options, 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(16, 32), 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(4, 8), 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(16, 32)) == 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(12, 24), UPB_SIZE(16, 32), 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(16, 32)) == 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(12, 24), UPB_SIZE(16, 32), 5, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(8, 8), upb_StringView);
+}
+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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(16, 24), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET);
+}
+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(16, 24), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_config_discovery(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(16, 24), 0, UPB_SIZE(0, 0), envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_NOT_SET);
+}
+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(16, 24), UPB_SIZE(0, 0), 5, NULL);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_clear_is_optional(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool);
+}
-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(4, 8), upb_strview) = value;
+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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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(12, 24), value, UPB_SIZE(16, 32), 4);
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(16, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_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(12, 24), value, UPB_SIZE(16, 32), 5);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_ExtensionConfigSource*, UPB_SIZE(16, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ExtensionConfigSource*)_upb_Message_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;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_set_is_optional(envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_clear_typed_config(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Any*);
}
-
-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_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_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;
}
+/* envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(upb_Arena* arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_serialize_ex(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_has_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_clear_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*);
+}
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_mutable_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager* msg, upb_Arena* arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_Message_New(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
index 44d63a49..ee06e884 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
@@ -15,5 +15,14 @@
#include "upb/port_def.inc"
+const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+};
+
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
index f1b24af9..aa472be6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
@@ -9,15 +9,15 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.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 "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
#include "upb/port_def.inc"
@@ -26,6 +26,9 @@ extern "C" {
#endif
+
+extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
index 247f262e..894076fd 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@@ -7,12 +7,15 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "google/protobuf/any.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.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"
@@ -20,93 +23,152 @@
#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(4, 4), 0, 0, 14, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 16), 0, 0, 9, 3},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[4] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = {
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = {
NULL,
&envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[0],
- UPB_SIZE(16, 24), 4, false, 255,
+ UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[3] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[8] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit},
+ {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(28, 56), 0, 0, 11, 3},
- {6, UPB_SIZE(20, 40), 5, 2, 11, 1},
- {7, UPB_SIZE(24, 48), 6, 1, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[8] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 56), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 64), UPB_SIZE(7, 7), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit = {
+const upb_MiniTable 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(32, 64), 7, false, 255,
+ UPB_SIZE(36, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit = {
+ NULL,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher__fields[2] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[4] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[9] = {
- {1, UPB_SIZE(12, 16), 1, 0, 11, 1},
- {2, UPB_SIZE(28, 48), 0, 0, 9, 3},
- {3, UPB_SIZE(32, 56), 0, 0, 9, 3},
- {6, UPB_SIZE(16, 24), 2, 3, 11, 1},
- {7, UPB_SIZE(20, 32), 3, 0, 11, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {9, UPB_SIZE(36, 64), 0, 2, 11, 3},
- {10, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {11, UPB_SIZE(24, 40), 4, 1, 11, 1},
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[8] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit = {
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[13] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 48), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(40, 72), UPB_SIZE(5, 5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(44, 80), UPB_SIZE(6, 6), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(48, 88), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 72), 9, false, 255,
+ UPB_SIZE(52, 104), 13, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
index 73b534aa..5e3220aa 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,27 +24,35 @@ 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_CertificateProviderPluginInstance;
+struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher;
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_CertificateProviderPluginInstance envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance;
+typedef struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher;
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;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_core_v3_WatchedDirectory;
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_config_core_v3_WatchedDirectory_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;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
typedef enum {
envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_VERIFY_TRUST_CHAIN = 0,
@@ -52,6 +60,14 @@ typedef enum {
} envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_TrustChainVerification;
typedef enum {
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_SAN_TYPE_UNSPECIFIED = 0,
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_EMAIL = 1,
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_DNS = 2,
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_URI = 3,
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_IP_ADDRESS = 4
+} envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_SanType;
+
+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,
@@ -60,30 +76,62 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsParameters* ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_transport_sockets_tls_v3_TlsParameters_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_tls_minimum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_tls_maximum_protocol_version(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_cipher_suites(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_clear_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_TlsParameters_ecdh_curves(const envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), 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(4, 4), 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(8, 8), 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(12, 16), 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;
@@ -91,67 +139,89 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsParameters_set_tls_
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(4, 4), 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(8, 8), len);
+UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), 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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_cipher_suites(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &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(12, 16), len);
+UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_TlsParameters_mutable_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), 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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsParameters_add_ecdh_curves(envoy_extensions_transport_sockets_tls_v3_TlsParameters* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_provider_name(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_clear_typed_config(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_provider_name(envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_set_typed_config(msg, sub);
}
@@ -160,47 +230,116 @@ UPB_INLINE struct google_protobuf_Any* envoy_extensions_transport_sockets_tls_v3
/* 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 envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_hasbit(msg, 4); }
-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(16, 32), 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(28, 56)); }
-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(28, 56), 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_hasbit(msg, 5); }
-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(20, 40), const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_WatchedDirectory*); }
+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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate* ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_certificate_chain(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_password(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_ocsp_staple(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), 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 void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ _upb_array_detach(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_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_private_key_provider(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+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(24, 48), const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_watched_directory(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_WatchedDirectory*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsCertificate_has_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_clear_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_pkcs12(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const struct envoy_config_core_v3_DataSource*);
+}
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_sethas(msg, 1);
*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_certificate_chain(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_certificate_chain(msg, sub);
}
@@ -210,10 +349,10 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pri
_upb_sethas(msg, 2);
*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_private_key(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_private_key(msg, sub);
}
@@ -223,10 +362,10 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pas
_upb_sethas(msg, 3);
*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_password(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_password(msg, sub);
}
@@ -236,36 +375,35 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_ocs
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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(28, 56), len);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &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_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*)_upb_Message_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);
}
@@ -273,131 +411,373 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider*
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_WatchedDirectory* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_WatchedDirectory*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_WatchedDirectory*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_TlsCertificate* msg, upb_Arena* arena) {
struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_extensions_transport_sockets_tls_v3_TlsCertificate_watched_directory(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_msg_new(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
+ sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_watched_directory(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pkcs12(envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, struct envoy_config_core_v3_DataSource* value) {
+ _upb_sethas(msg, 7);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct envoy_config_core_v3_DataSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_TlsCertificate_mutable_pkcs12(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_pkcs12(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_TlsCertificate_set_pkcs12(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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, options, 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 void envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_clear_keys(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+/* envoy.extensions.transport_sockets.tls.v3.CertificateProviderPluginInstance */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_serialize(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_clear_instance_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_clear_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.SubjectAltNameMatcher */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* ret = envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* ret = envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_serialize(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_clear_san_type(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_san_type(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_has_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_clear_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_matcher(const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_matcher_v3_StringMatcher*);
+}
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_san_type(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_matcher(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_matcher_v3_StringMatcher*) = value;
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_mutable_matcher(envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_set_matcher(msg, sub);
+ }
+ 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 envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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(28, 48), 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(32, 56), 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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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(36, 64)); }
-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(36, 64), 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(4, 4), int32_t); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_config_core_v3_WatchedDirectory*); }
+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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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 void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE upb_StringView 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_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 32));
+}
+UPB_INLINE upb_StringView 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_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 48), const struct envoy_config_core_v3_DataSource*);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), 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 void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ _upb_array_detach(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 void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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(4, 4), int32_t);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_config_core_v3_WatchedDirectory*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_only_verify_leaf_cert_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_only_verify_leaf_cert_crl(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_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_clear_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 88));
+}
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_typed_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) {
+ return (const envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len);
+}
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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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(28, 48), len);
+UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), 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_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &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(32, 56), len);
+UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), 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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(3, 4), &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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(msg, sub);
}
@@ -405,30 +785,29 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), struct envoy_config_core_v3_DataSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_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_PTR_AT(msg, UPB_SIZE(1, 1), 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(36, 64), len);
+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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -437,17 +816,60 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationC
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_WatchedDirectory* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct envoy_config_core_v3_WatchedDirectory*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_config_core_v3_WatchedDirectory*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_watched_directory(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) {
struct envoy_config_core_v3_WatchedDirectory* sub = (struct envoy_config_core_v3_WatchedDirectory*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_msg_new(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
+ sub = (struct envoy_config_core_v3_WatchedDirectory*)_upb_Message_New(&envoy_config_core_v3_WatchedDirectory_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_watched_directory(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_New(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_only_verify_leaf_cert_crl(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t* len) {
+ return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, size_t len, upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_typed_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* sub = (struct envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
index 6717a17a..f4870335 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -19,54 +19,69 @@
#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_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit = {
+const upb_MiniTable 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), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_GenericSecret_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},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
index c576e0ad..3f8a571d 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,52 +26,71 @@ 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;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
+extern const upb_MiniTable 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;
-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_MiniTable envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_GenericSecret* ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_GenericSecret_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, options, 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_GenericSecret_clear_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_DataSource*);
}
-
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_GenericSecret_has_secret(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*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_GenericSecret_mutable_secret(envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_GenericSecret_set_secret(msg, sub);
}
@@ -80,39 +99,62 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_so
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_clear_name(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_name(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_has_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_clear_sds_config(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_config_core_v3_ConfigSource*);
}
-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(4, 8), 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_hasbit(msg, 1); }
-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(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
-
-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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_name(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
*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_transport_sockets_tls_v3_SdsSecretConfig_mutable_sds_config(envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_Message_New(&envoy_config_core_v3_ConfigSource_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_set_sds_config(msg, sub);
}
@@ -121,24 +163,35 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_transport_
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_Secret*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_transport_sockets_tls_v3_Secret_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_Secret* ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_Secret_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_Secret* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, options, 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,
@@ -146,70 +199,106 @@ typedef enum {
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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_name(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_Secret_name(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_tls_certificate(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_validation_context(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_Secret_clear_generic_secret(const envoy_extensions_transport_sockets_tls_v3_Secret* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_Secret_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_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_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_GenericSecret*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_GenericSecret*)_upb_Message_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;
}
+extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
index ad5494ce..350ecab6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
@@ -7,139 +7,184 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "envoy/config/core/v3/address.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/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/migrate.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_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[5] = {
- &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_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[6] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[8] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 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), 4, 4, 11, 1},
- {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 0, 8, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[8] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 32), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(28, 48), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[8] = {
- &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(4, 8), 1, 7, 11, 1},
- {2, UPB_SIZE(20, 40), 0, 6, 11, 3},
- {3, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 1, 11, 1},
- {4, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {6, UPB_SIZE(28, 56), 0, 5, 11, 3},
- {7, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 5, 11, 1},
- {8, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 4, 11, 1},
- {9, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {10, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 2, 11, 1},
- {11, UPB_SIZE(12, 24), 3, 3, 11, 1},
- {12, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 3, 11, 1},
- {13, UPB_SIZE(16, 32), 4, 0, 11, 1},
-};
-
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit = {
+ UPB_SIZE(32, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsKeyLog__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog__fields[0],
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[13] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[14] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(24, 40), UPB_SIZE(2, 2), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(28, 48), UPB_SIZE(3, 3), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(44, 80), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(32, 56), UPB_SIZE(4, 4), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(36, 64), UPB_SIZE(5, 5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(40, 72), UPB_SIZE(6, 6), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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(40, 80), 12, false, 255,
+ UPB_SIZE(48, 88), 14, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 2, 11, 1},
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit = {
+const upb_MiniTable 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(24, 40), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_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,
+};
+
+const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
index 8a8ba90b..d7451380 100644
--- a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,23 +22,28 @@ extern "C" {
struct envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext;
struct envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext;
+struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog;
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_TlsKeyLog envoy_extensions_transport_sockets_tls_v3_TlsKeyLog;
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;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit;
+struct envoy_config_core_v3_CidrRange;
struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance;
struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
@@ -47,15 +52,17 @@ 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;
+extern const upb_MiniTable envoy_config_core_v3_CidrRange_msginit;
+extern const upb_MiniTable envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
typedef enum {
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING = 0,
@@ -64,48 +71,84 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_sni(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_allow_renegotiation(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_clear_max_session_keys(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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 bool envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_has_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg) { return _upb_hasbit(msg, 1); }
-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(1, 1), 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_hasbit(msg, 2); }
-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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 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_UpstreamTlsContext_mutable_common_tls_context(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_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_sni(envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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(1, 1), bool) = value;
@@ -114,10 +157,10 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set
_upb_sethas(msg, 2);
*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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_set_max_session_keys(msg, sub);
}
@@ -126,56 +169,122 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_transport_socket
/* 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 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, options, 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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(4, 4), int32_t); }
+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(4, 4), 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_common_tls_context(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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(12, 16), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_client_certificate(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_require_sni(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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(20, 32), 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(4, 4)) == 4;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET);
+}
+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(28, 48), UPB_SIZE(4, 4), 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(4, 4)) == 5;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_ticket_keys_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET);
+}
+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(28, 48), UPB_SIZE(4, 4), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_session_timeout(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_disable_stateless_session_resumption(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(28, 48), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_NOT_SET);
+}
+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(28, 48), UPB_SIZE(4, 4), 7, false);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_clear_ocsp_staple_policy(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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(8, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*)_upb_Message_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);
}
@@ -183,12 +292,12 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* en
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), 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_client_certificate(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_set_require_client_certificate(msg, sub);
}
@@ -196,36 +305,36 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), 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) {
+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);
+ sub = (struct google_protobuf_BoolValue*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_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);
}
@@ -233,44 +342,139 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* env
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), 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_extensions_transport_sockets_tls_v3_DownstreamTlsContext_mutable_session_timeout(envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(28, 48), value, UPB_SIZE(4, 4), 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(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
-/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext */
+/* envoy.extensions.transport_sockets.tls.v3.TlsKeyLog */
-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_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* ret = envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* ret = envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_path(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_path(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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 bool envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_has_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
}
-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);
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_local_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_has_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_clear_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_remote_address_range(const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) {
+ return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_set_path(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_add_local_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_mutable_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t* len) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_resize_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_add_remote_address_range(envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_Message_New(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, options, 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,
@@ -279,112 +483,210 @@ typedef enum {
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(36, 72), 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_hasbit(msg, 1); }
-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(4, 8), 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(20, 40)); }
-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(20, 40), 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(36, 72)) == 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(32, 64), UPB_SIZE(36, 72), 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(24, 48), 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(28, 56)); }
-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(28, 56), 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(36, 72)) == 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(32, 64), UPB_SIZE(36, 72), 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(36, 72)) == 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(32, 64), UPB_SIZE(36, 72), 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_hasbit(msg, 2); }
-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(8, 16), 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(36, 72)) == 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(32, 64), UPB_SIZE(36, 72), 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_hasbit(msg, 3); }
-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(12, 24), 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(36, 72)) == 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(32, 64), UPB_SIZE(36, 72), 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_hasbit(msg, 4); }
-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(16, 32), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+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(4, 4), 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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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(8, 8), 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(12, 16));
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+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(12, 16), 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(4, 4)) == 3;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET);
+}
+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(44, 80), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE upb_StringView const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), 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(20, 32));
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 32));
+}
+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(20, 32), 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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET);
+}
+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(44, 80), UPB_SIZE(4, 4), 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(4, 4)) == 8;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET);
+}
+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(44, 80), UPB_SIZE(4, 4), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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(24, 40), 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(4, 4)) == 10;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET);
+}
+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(44, 80), UPB_SIZE(4, 4), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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(28, 48), 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(4, 4)) == 12;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(44, 80), 0, UPB_SIZE(4, 4), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET);
+}
+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(44, 80), UPB_SIZE(4, 4), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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(32, 56), const struct envoy_config_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_clear_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_key_log(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*);
+}
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*)_upb_Message_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(20, 40), len);
+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(12, 16), 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &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(32, 64), value, UPB_SIZE(36, 72), 3);
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_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(24, 48), len);
+UPB_INLINE upb_StringView* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &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(28, 56), len);
+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(20, 32), 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &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(32, 64), value, UPB_SIZE(36, 72), 7);
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_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(32, 64), value, UPB_SIZE(36, 72), 8);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_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);
}
@@ -392,24 +694,24 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Com
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_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(32, 64), value, UPB_SIZE(36, 72), 10);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_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);
}
@@ -417,24 +719,24 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Cer
}
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_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_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(32, 64), value, UPB_SIZE(36, 72), 12);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(44, 80), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_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);
}
@@ -442,58 +744,108 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Cer
}
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_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_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;
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_key_log(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_key_log(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_key_log(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsKeyLog*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_key_log(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 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_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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(4, 8), upb_StringView);
+}
+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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_clear_typed_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_Message_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);
}
@@ -502,71 +854,131 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_tr
/* 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, options, arena, len);
}
-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 void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_clear_instance_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_clear_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_instance_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_default_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), 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_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 4);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_clear_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*);
}
-
-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_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_hasbit(msg, 3); }
-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(12, 24), 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_hasbit(msg, 4); }
-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(16, 32), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)_upb_Message_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);
}
@@ -576,10 +988,10 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Combi
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_Message_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);
}
@@ -589,10 +1001,10 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Combi
_upb_sethas(msg, 3);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)_upb_Message_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);
}
@@ -602,16 +1014,18 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Combi
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)_upb_Message_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;
}
+extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c
new file mode 100644
index 00000000..791a8934
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c
@@ -0,0 +1,62 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_submsgs[1] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+};
+
+static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit = {
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[0],
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit,
+};
+
+const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h
new file mode 100644
index 00000000..067f4c1d
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h
@@ -0,0 +1,160 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig;
+struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain;
+typedef struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig;
+typedef struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit;
+extern const upb_MiniTable envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit;
+struct envoy_config_core_v3_DataSource;
+extern const upb_MiniTable envoy_config_core_v3_DataSource_msginit;
+
+
+
+/* envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_serialize(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_has_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_clear_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_trust_domains(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* len) {
+ return (const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_mutable_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t* len) {
+ return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain** envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_resize_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_add_trust_domains(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* msg, upb_Arena* arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* sub = (struct envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig.TrustDomain */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(upb_Arena* arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain*)_upb_Message_New(&envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* ret = envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_serialize(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_serialize_ex(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_clear_name(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_name(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_has_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_clear_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_trust_bundle(const envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_DataSource*);
+}
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_name(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_trust_bundle(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain *msg, struct envoy_config_core_v3_DataSource* value) {
+ _upb_sethas(msg, 1);
+ *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_SPIFFECertValidatorConfig_TrustDomain_mutable_trust_bundle(envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain* msg, upb_Arena* arena) {
+ struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_trust_bundle(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DataSource*)_upb_Message_New(&envoy_config_core_v3_DataSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_set_trust_bundle(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
deleted file mode 100644
index cc8dcc4f..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
deleted file mode 100644
index 86fa3022..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 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/decode_fast.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 envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
index 7fb8ac99..1aaf0190 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/discovery/v3/ads.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -15,10 +15,23 @@
#include "upb/port_def.inc"
-const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit = {
+const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_service_discovery_v3_AdsDummy_msginit,
+};
+
+const upb_MiniTable_File envoy_service_discovery_v3_ads_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
index 0d26bd97..4d226a3c 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
#define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,30 +22,44 @@ extern "C" {
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;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_AdsDummy*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDummy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_AdsDummy* ret = envoy_service_discovery_v3_AdsDummy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_service_discovery_v3_AdsDummy_serialize_ex(const envoy_service_discovery_v3_AdsDummy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, options, arena, len);
}
+extern const upb_MiniTable_File envoy_service_discovery_v3_ads_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
index a5b6ac46..48888287 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "google/protobuf/any.upb.h"
@@ -18,128 +18,147 @@
#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_MiniTable_Sub envoy_service_discovery_v3_DiscoveryRequest_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &google_rpc_Status_msginit},
};
-static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryRequest__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), 1, 0, 11, 1},
- {3, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(32, 64), 2, 1, 11, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryRequest__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(40, 88), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-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_MiniTable_Sub envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &envoy_config_core_v3_ControlPlane_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(1, 1), 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), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryResponse__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 64), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[3] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
- &google_rpc_Status_msginit,
+static const upb_MiniTable_Sub envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit},
+ {.submsg = &google_rpc_Status_msginit},
};
-static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[7] = {
- {1, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {5, UPB_SIZE(36, 72), 0, 1, 11, _UPB_LABEL_MAP},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {7, UPB_SIZE(24, 48), 2, 2, 11, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 72), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = {
+const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = {
&envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[0],
&envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[0],
- UPB_SIZE(40, 80), 7, false, 255,
+ UPB_SIZE(40, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = {
+const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = {
NULL,
&envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
- &envoy_config_core_v3_ControlPlane_msginit,
- &envoy_service_discovery_v3_Resource_msginit,
+static const upb_MiniTable_Sub envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
+ {.submsg = &envoy_service_discovery_v3_Resource_msginit},
+ {.submsg = &envoy_config_core_v3_ControlPlane_msginit},
};
-static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(32, 64), 0, 1, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {7, UPB_SIZE(28, 56), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 72), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(40, 88), 6, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_service_discovery_v3_Resource_submsgs[3] = {
- &envoy_service_discovery_v3_Resource_CacheControl_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_service_discovery_v3_Resource_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &envoy_service_discovery_v3_Resource_CacheControl_msginit},
};
-static const upb_msglayout_field envoy_service_discovery_v3_Resource__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {6, UPB_SIZE(24, 48), 2, 2, 11, 1},
- {7, UPB_SIZE(28, 56), 3, 0, 11, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_Resource__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 64), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_Resource_msginit = {
+const upb_MiniTable envoy_service_discovery_v3_Resource_msginit = {
&envoy_service_discovery_v3_Resource_submsgs[0],
&envoy_service_discovery_v3_Resource__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout_field envoy_service_discovery_v3_Resource_CacheControl__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_service_discovery_v3_Resource_CacheControl__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_discovery_v3_Resource_CacheControl_msginit = {
+const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msginit = {
NULL,
&envoy_service_discovery_v3_Resource_CacheControl__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_service_discovery_v3_DiscoveryRequest_msginit,
+ &envoy_service_discovery_v3_DiscoveryResponse_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit,
+ &envoy_service_discovery_v3_Resource_msginit,
+ &envoy_service_discovery_v3_Resource_CacheControl_msginit,
+};
+
+const upb_MiniTable_File envoy_service_discovery_v3_discovery_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
index def27876..4995ce95 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
#define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -34,94 +34,139 @@ typedef struct envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceV
typedef struct envoy_service_discovery_v3_DeltaDiscoveryResponse envoy_service_discovery_v3_DeltaDiscoveryResponse;
typedef struct envoy_service_discovery_v3_Resource envoy_service_discovery_v3_Resource;
typedef struct envoy_service_discovery_v3_Resource_CacheControl envoy_service_discovery_v3_Resource_CacheControl;
-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;
-extern const upb_msglayout envoy_service_discovery_v3_Resource_CacheControl_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryRequest_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_DiscoveryResponse_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_Resource_msginit;
+extern const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msginit;
struct envoy_config_core_v3_ControlPlane;
struct envoy_config_core_v3_Node;
struct google_protobuf_Any;
struct google_protobuf_Duration;
struct google_rpc_Status;
-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_protobuf_Duration_msginit;
-extern const upb_msglayout google_rpc_Status_msginit;
+extern const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_rpc_Status_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_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_DiscoveryRequest*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_v3_DiscoveryRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_DiscoveryRequest* ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_service_discovery_v3_DiscoveryRequest_serialize_ex(const envoy_service_discovery_v3_DiscoveryRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_version_info(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_version_info(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_node(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct envoy_config_core_v3_Node*);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DiscoveryRequest_resource_names(const envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_type_url(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_type_url(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_clear_error_detail(const envoy_service_discovery_v3_DiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+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(36, 72), const struct google_rpc_Status*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_node(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_hasbit(msg, 1); }
-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(28, 56), 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(36, 72), 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(12, 24), 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(20, 40), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DiscoveryRequest *msg) { return _upb_hasbit(msg, 2); }
-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(32, 64), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_version_info(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_Node*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_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(36, 72), len);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_mutable_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DiscoveryRequest_resize_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(envoy_service_discovery_v3_DiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_type_url(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = 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(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DiscoveryRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value;
}
UPB_INLINE void envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DiscoveryRequest *msg, struct google_rpc_Status* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), struct google_rpc_Status*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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) {
+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);
+ sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_DiscoveryRequest_set_error_detail(msg, sub);
}
@@ -130,66 +175,110 @@ UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DiscoveryRequest
/* 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_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_DiscoveryResponse*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery_v3_DiscoveryResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_DiscoveryResponse* ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_discovery_v3_DiscoveryResponse_serialize_ex(const envoy_service_discovery_v3_DiscoveryResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_version_info(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_version_info(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(12, 24));
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_resources(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_canary(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_canary(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_type_url(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_type_url(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_nonce(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DiscoveryResponse_nonce(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_discovery_v3_DiscoveryResponse_clear_control_plane(const envoy_service_discovery_v3_DiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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(32, 64), const struct envoy_config_core_v3_ControlPlane*);
}
-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(1, 1), 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_hasbit(msg, 1); }
-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 void envoy_service_discovery_v3_DiscoveryResponse_set_version_info(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_mutable_resources(envoy_service_discovery_v3_DiscoveryResponse* 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** 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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(1, 1), 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_type_url(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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_nonce(envoy_service_discovery_v3_DiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_ControlPlane*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), 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) {
+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);
+ sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_DiscoveryResponse_set_control_plane(msg, sub);
}
@@ -198,88 +287,148 @@ UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_
/* 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 envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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_hasbit(msg, 1); }
-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(20, 40), 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(4, 8), 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(28, 56), 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(32, 64), 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(36, 72)); }
-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(36, 72)); }
-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(36, 72), &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(36, 72), 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(12, 24), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg) { return _upb_hasbit(msg, 2); }
-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(24, 48), const struct google_rpc_Status*); }
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_discovery_v3_DeltaDiscoveryRequest_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_DeltaDiscoveryRequest*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_discovery_v3_DeltaDiscoveryRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_DeltaDiscoveryRequest* ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_discovery_v3_DeltaDiscoveryRequest_serialize_ex(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct envoy_config_core_v3_Node*);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_type_url(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_subscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryRequest_resource_names_unsubscribe(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), 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(24, 48));
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_initial_resource_versions(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+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(24, 48));
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_get(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(24, 48), &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(24, 48), iter);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_response_nonce(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_clear_error_detail(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+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(36, 72), const struct google_rpc_Status*);
+}
UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_node(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_config_core_v3_Node*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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(28, 56), len);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_subscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &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(32, 64), len);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_mutable_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryRequest_resize_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_add_resource_names_unsubscribe(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &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(36, 72)); }
-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(36, 72), &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(36, 72), &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(36, 72), 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(12, 24), upb_strview) = value;
+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(24, 48)); }
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_set(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(24, 48), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_initial_resource_versions_delete(envoy_service_discovery_v3_DeltaDiscoveryRequest* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(24, 48), &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(24, 48), iter);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_response_nonce(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), upb_StringView) = value;
}
UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, struct google_rpc_Status* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_rpc_Status*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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) {
+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);
+ sub = (struct google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_DeltaDiscoveryRequest_set_error_detail(msg, sub);
}
@@ -288,90 +437,133 @@ UPB_INLINE struct google_rpc_Status* envoy_service_discovery_v3_DeltaDiscoveryRe
/* 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_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_key(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* msg) {
+ upb_StringView 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_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_value(const envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry* msg) {
+ upb_StringView 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_INLINE void envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_set_value(envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry *msg, upb_StringView 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_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_DeltaDiscoveryResponse*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_discovery_v3_DeltaDiscoveryResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_DeltaDiscoveryResponse* ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_discovery_v3_DeltaDiscoveryResponse_serialize_ex(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_system_version_info(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_system_version_info(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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(12, 24));
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_type_url(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_DeltaDiscoveryResponse_nonce(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 64));
+}
+UPB_INLINE upb_StringView const* envoy_service_discovery_v3_DeltaDiscoveryResponse_removed_resources(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_clear_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const struct envoy_config_core_v3_ControlPlane*);
}
-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(4, 8), 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(32, 64)); }
-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(32, 64), 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(12, 24), 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(20, 40), 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(36, 72), len); }
-UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_has_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_control_plane(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_ControlPlane*); }
-
-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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_system_version_info(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(32, 64), len);
+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(12, 24), 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_service_discovery_v3_Resource_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_type_url(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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(20, 40), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_nonce(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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(36, 72), len);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_DeltaDiscoveryResponse_resize_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryResponse_add_removed_resources(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void envoy_service_discovery_v3_DeltaDiscoveryResponse_set_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, struct envoy_config_core_v3_ControlPlane* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_ControlPlane*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), struct envoy_config_core_v3_ControlPlane*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_DeltaDiscoveryResponse_mutable_control_plane(envoy_service_discovery_v3_DeltaDiscoveryResponse* msg, upb_Arena* arena) {
struct envoy_config_core_v3_ControlPlane* sub = (struct envoy_config_core_v3_ControlPlane*)envoy_service_discovery_v3_DeltaDiscoveryResponse_control_plane(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_ControlPlane*)_upb_msg_new(&envoy_config_core_v3_ControlPlane_msginit, arena);
+ sub = (struct envoy_config_core_v3_ControlPlane*)_upb_Message_New(&envoy_config_core_v3_ControlPlane_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_DeltaDiscoveryResponse_set_control_plane(msg, sub);
}
@@ -380,71 +572,117 @@ UPB_INLINE struct envoy_config_core_v3_ControlPlane* envoy_service_discovery_v3_
/* 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_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_Resource*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_Resource* ret = envoy_service_discovery_v3_Resource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_service_discovery_v3_Resource_serialize_ex(const envoy_service_discovery_v3_Resource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_Resource_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_version(const envoy_service_discovery_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_Resource_version(const envoy_service_discovery_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_resource(const envoy_service_discovery_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const struct google_protobuf_Any*);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_name(const envoy_service_discovery_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_discovery_v3_Resource_name(const envoy_service_discovery_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_aliases(const envoy_service_discovery_v3_Resource* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE upb_StringView const* envoy_service_discovery_v3_Resource_aliases(const envoy_service_discovery_v3_Resource* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len);
+}
+UPB_INLINE bool envoy_service_discovery_v3_Resource_has_ttl(const envoy_service_discovery_v3_Resource* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_ttl(const envoy_service_discovery_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_ttl(const envoy_service_discovery_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool envoy_service_discovery_v3_Resource_has_cache_control(const envoy_service_discovery_v3_Resource* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_clear_cache_control(const envoy_service_discovery_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_cache_control(const envoy_service_discovery_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_service_discovery_v3_Resource_CacheControl*);
}
-UPB_INLINE upb_strview envoy_service_discovery_v3_Resource_version(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_service_discovery_v3_Resource_has_resource(const envoy_service_discovery_v3_Resource *msg) { return _upb_hasbit(msg, 1); }
-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(20, 40), 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(12, 24), 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(32, 64), len); }
-UPB_INLINE bool envoy_service_discovery_v3_Resource_has_ttl(const envoy_service_discovery_v3_Resource *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_ttl(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_service_discovery_v3_Resource_has_cache_control(const envoy_service_discovery_v3_Resource *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_cache_control(const envoy_service_discovery_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const envoy_service_discovery_v3_Resource_CacheControl*); }
-
-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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_version(envoy_service_discovery_v3_Resource *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
UPB_INLINE void envoy_service_discovery_v3_Resource_set_resource(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_protobuf_Any*)_upb_Message_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(12, 24), upb_strview) = value;
+UPB_INLINE void envoy_service_discovery_v3_Resource_set_name(envoy_service_discovery_v3_Resource *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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(32, 64), len);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_mutable_aliases(envoy_service_discovery_v3_Resource* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_discovery_v3_Resource_resize_aliases(envoy_service_discovery_v3_Resource* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_discovery_v3_Resource_add_aliases(envoy_service_discovery_v3_Resource* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void envoy_service_discovery_v3_Resource_set_ttl(envoy_service_discovery_v3_Resource *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Duration*) = value;
}
-UPB_INLINE struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_mutable_ttl(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_mutable_ttl(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_service_discovery_v3_Resource_ttl(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_Resource_set_ttl(msg, sub);
}
@@ -452,12 +690,12 @@ UPB_INLINE struct google_protobuf_Duration* envoy_service_discovery_v3_Resource_
}
UPB_INLINE void envoy_service_discovery_v3_Resource_set_cache_control(envoy_service_discovery_v3_Resource *msg, envoy_service_discovery_v3_Resource_CacheControl* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), envoy_service_discovery_v3_Resource_CacheControl*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_service_discovery_v3_Resource_CacheControl*) = value;
}
-UPB_INLINE struct envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_mutable_cache_control(envoy_service_discovery_v3_Resource *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_mutable_cache_control(envoy_service_discovery_v3_Resource* msg, upb_Arena* arena) {
struct envoy_service_discovery_v3_Resource_CacheControl* sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)envoy_service_discovery_v3_Resource_cache_control(msg);
if (sub == NULL) {
- sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)_upb_msg_new(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena);
+ sub = (struct envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena);
if (!sub) return NULL;
envoy_service_discovery_v3_Resource_set_cache_control(msg, sub);
}
@@ -466,30 +704,48 @@ UPB_INLINE struct envoy_service_discovery_v3_Resource_CacheControl* envoy_servic
/* envoy.service.discovery.v3.Resource.CacheControl */
-UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_discovery_v3_Resource_CacheControl_new(upb_arena *arena) {
- return (envoy_service_discovery_v3_Resource_CacheControl *)_upb_msg_new(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena);
+UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_CacheControl_new(upb_Arena* arena) {
+ return (envoy_service_discovery_v3_Resource_CacheControl*)_upb_Message_New(&envoy_service_discovery_v3_Resource_CacheControl_msginit, arena);
}
-UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_discovery_v3_Resource_CacheControl_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_discovery_v3_Resource_CacheControl *ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_CacheControl_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_discovery_v3_Resource_CacheControl* ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_discovery_v3_Resource_CacheControl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_service_discovery_v3_Resource_CacheControl *ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_discovery_v3_Resource_CacheControl_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_discovery_v3_Resource_CacheControl* ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_service_discovery_v3_Resource_CacheControl_serialize(const envoy_service_discovery_v3_Resource_CacheControl *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena, len);
+UPB_INLINE char* envoy_service_discovery_v3_Resource_CacheControl_serialize(const envoy_service_discovery_v3_Resource_CacheControl* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_discovery_v3_Resource_CacheControl_serialize_ex(const envoy_service_discovery_v3_Resource_CacheControl* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_discovery_v3_Resource_CacheControl_clear_do_not_cache(const envoy_service_discovery_v3_Resource_CacheControl* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool envoy_service_discovery_v3_Resource_CacheControl_do_not_cache(const envoy_service_discovery_v3_Resource_CacheControl* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
}
-
-UPB_INLINE bool envoy_service_discovery_v3_Resource_CacheControl_do_not_cache(const envoy_service_discovery_v3_Resource_CacheControl *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
UPB_INLINE void envoy_service_discovery_v3_Resource_CacheControl_set_do_not_cache(envoy_service_discovery_v3_Resource_CacheControl *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
}
+extern const upb_MiniTable_File envoy_service_discovery_v3_discovery_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
deleted file mode 100644
index 0af04804..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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 "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_endpoint_v3_EdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
deleted file mode 100644
index 1b1fd3d0..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 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/decode_fast.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 envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
deleted file mode 100644
index 404bfa41..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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 "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_listener_v3_LdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
deleted file mode 100644
index 9b8988c1..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 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/decode_fast.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 envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
index 68fe078f..fcc3275e 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -17,37 +17,51 @@
#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_MiniTable_Sub envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterStats_msginit},
};
-static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
+ {.submsg = &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), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
+static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(2, 2), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit = {
+const upb_MiniTable 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(16, 24), 4, false, 255,
+ UPB_SIZE(12, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_service_load_stats_v3_LoadStatsRequest_msginit,
+ &envoy_service_load_stats_v3_LoadStatsResponse_msginit,
+};
+
+const upb_MiniTable_File envoy_service_load_stats_v3_lrs_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
index f74a0231..ca56b9a3 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,112 +24,169 @@ 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;
+extern const upb_MiniTable envoy_service_load_stats_v3_LoadStatsRequest_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable envoy_config_endpoint_v3_ClusterStats_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_service_load_stats_v3_LoadStatsRequest*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stats_v3_LoadStatsRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_load_stats_v3_LoadStatsRequest* ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_service_load_stats_v3_LoadStatsRequest_serialize_ex(const envoy_service_load_stats_v3_LoadStatsRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_node(const envoy_service_load_stats_v3_LoadStatsRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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(8, 16));
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsRequest_clear_cluster_stats(const envoy_service_load_stats_v3_LoadStatsRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
}
-
-UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_node(const envoy_service_load_stats_v3_LoadStatsRequest *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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(8, 16)); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_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) {
+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(8, 16), 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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_config_endpoint_v3_ClusterStats_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_service_load_stats_v3_LoadStatsResponse*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_stats_v3_LoadStatsResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_load_stats_v3_LoadStatsResponse* ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_service_load_stats_v3_LoadStatsResponse_serialize_ex(const envoy_service_load_stats_v3_LoadStatsResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE upb_StringView const* envoy_service_load_stats_v3_LoadStatsResponse_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_has_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_load_reporting_interval(const envoy_service_load_stats_v3_LoadStatsResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_report_endpoint_granularity(const envoy_service_load_stats_v3_LoadStatsResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_clear_send_all_clusters(const envoy_service_load_stats_v3_LoadStatsResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+}
+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(2, 2), bool);
}
-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_hasbit(msg, 1); }
-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(1, 1), 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(2, 2), 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_StringView* envoy_service_load_stats_v3_LoadStatsResponse_mutable_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), 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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* envoy_service_load_stats_v3_LoadStatsResponse_resize_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsResponse_add_clusters(envoy_service_load_stats_v3_LoadStatsResponse* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_service_load_stats_v3_LoadStatsResponse_mutable_load_reporting_interval(envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
envoy_service_load_stats_v3_LoadStatsResponse_set_load_reporting_interval(msg, sub);
}
@@ -142,6 +199,8 @@ UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_send_all_clust
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
+extern const upb_MiniTable_File envoy_service_load_stats_v3_lrs_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
deleted file mode 100644
index 07d17f61..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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 "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_RdsDummy_msginit = {
- NULL,
- NULL,
- UPB_SIZE(0, 0), 0, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
deleted file mode 100644
index 40a6d425..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 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/decode_fast.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 envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
deleted file mode 100644
index 6dbaa817..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* 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, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
deleted file mode 100644
index e86154b7..00000000
--- a/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 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/decode_fast.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 envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c b/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
index 40e086cb..620d5b66 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
@@ -7,86 +7,131 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/status/v3/csds.upb.h"
#include "envoy/admin/v3/config_dump.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/type/matcher/v3/node.upb.h"
#include "google/api/annotations.upb.h"
-#include "udpa/annotations/migrate.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/timestamp.upb.h"
+#include "envoy/annotations/deprecation.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_status_v3_ClientStatusRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_type_matcher_v3_NodeMatcher_msginit,
+static const upb_MiniTable_Sub envoy_service_status_v3_ClientStatusRequest_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_NodeMatcher_msginit},
+ {.submsg = &envoy_config_core_v3_Node_msginit},
};
-static const upb_msglayout_field envoy_service_status_v3_ClientStatusRequest__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusRequest__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit = {
+const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msginit = {
&envoy_service_status_v3_ClientStatusRequest_submsgs[0],
&envoy_service_status_v3_ClientStatusRequest__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_service_status_v3_PerXdsConfig_submsgs[5] = {
- &envoy_admin_v3_ClustersConfigDump_msginit,
- &envoy_admin_v3_EndpointsConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_msginit,
- &envoy_admin_v3_RoutesConfigDump_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
+static const upb_MiniTable_Sub envoy_service_status_v3_PerXdsConfig_submsgs[5] = {
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_msginit},
};
-static const upb_msglayout_field envoy_service_status_v3_PerXdsConfig__fields[7] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, 1},
- {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, 1},
- {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, 1},
- {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, 1},
- {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, 1},
- {7, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_service_status_v3_PerXdsConfig__fields[7] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit = {
+const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msginit = {
&envoy_service_status_v3_PerXdsConfig_submsgs[0],
&envoy_service_status_v3_PerXdsConfig__fields[0],
- UPB_SIZE(16, 24), 7, false, 255,
+ UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout *const envoy_service_status_v3_ClientConfig_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_service_status_v3_PerXdsConfig_msginit,
+static const upb_MiniTable_Sub envoy_service_status_v3_ClientConfig_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_service_status_v3_PerXdsConfig_msginit},
+ {.submsg = &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit},
};
-static const upb_msglayout_field envoy_service_status_v3_ClientConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_status_v3_ClientConfig_msginit = {
+const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit = {
&envoy_service_status_v3_ClientConfig_submsgs[0],
&envoy_service_status_v3_ClientConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_service_status_v3_ClientStatusResponse_submsgs[1] = {
- &envoy_service_status_v3_ClientConfig_msginit,
+static const upb_MiniTable_Sub envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[3] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+};
+
+static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[9] = {
+ {1, UPB_SIZE(16, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 64), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(44, 72), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(48, 80), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(12, 12), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit = {
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[0],
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[0],
+ UPB_SIZE(52, 88), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_service_status_v3_ClientStatusResponse_submsgs[1] = {
+ {.submsg = &envoy_service_status_v3_ClientConfig_msginit},
};
-static const upb_msglayout_field envoy_service_status_v3_ClientStatusResponse__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusResponse__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit = {
+const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msginit = {
&envoy_service_status_v3_ClientStatusResponse_submsgs[0],
&envoy_service_status_v3_ClientStatusResponse__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[5] = {
+ &envoy_service_status_v3_ClientStatusRequest_msginit,
+ &envoy_service_status_v3_PerXdsConfig_msginit,
+ &envoy_service_status_v3_ClientConfig_msginit,
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit,
+ &envoy_service_status_v3_ClientStatusResponse_msginit,
+};
+
+const upb_MiniTable_File envoy_service_status_v3_csds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 5,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h b/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
index 87f807cd..72c75dcd 100644
--- a/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_
#define ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,29 +23,38 @@ extern "C" {
struct envoy_service_status_v3_ClientStatusRequest;
struct envoy_service_status_v3_PerXdsConfig;
struct envoy_service_status_v3_ClientConfig;
+struct envoy_service_status_v3_ClientConfig_GenericXdsConfig;
struct envoy_service_status_v3_ClientStatusResponse;
typedef struct envoy_service_status_v3_ClientStatusRequest envoy_service_status_v3_ClientStatusRequest;
typedef struct envoy_service_status_v3_PerXdsConfig envoy_service_status_v3_PerXdsConfig;
typedef struct envoy_service_status_v3_ClientConfig envoy_service_status_v3_ClientConfig;
+typedef struct envoy_service_status_v3_ClientConfig_GenericXdsConfig envoy_service_status_v3_ClientConfig_GenericXdsConfig;
typedef struct envoy_service_status_v3_ClientStatusResponse envoy_service_status_v3_ClientStatusResponse;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit;
-extern const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit;
+extern const upb_MiniTable envoy_service_status_v3_ClientStatusRequest_msginit;
+extern const upb_MiniTable envoy_service_status_v3_PerXdsConfig_msginit;
+extern const upb_MiniTable envoy_service_status_v3_ClientConfig_msginit;
+extern const upb_MiniTable envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit;
+extern const upb_MiniTable envoy_service_status_v3_ClientStatusResponse_msginit;
struct envoy_admin_v3_ClustersConfigDump;
struct envoy_admin_v3_EndpointsConfigDump;
struct envoy_admin_v3_ListenersConfigDump;
struct envoy_admin_v3_RoutesConfigDump;
struct envoy_admin_v3_ScopedRoutesConfigDump;
+struct envoy_admin_v3_UpdateFailureState;
struct envoy_config_core_v3_Node;
struct envoy_type_matcher_v3_NodeMatcher;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit;
-extern const upb_msglayout envoy_config_core_v3_Node_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit;
+struct google_protobuf_Any;
+struct google_protobuf_Timestamp;
+extern const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit;
+extern const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit;
+extern const upb_MiniTable envoy_config_core_v3_Node_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable google_protobuf_Timestamp_msginit;
typedef enum {
envoy_service_status_v3_CLIENT_UNKNOWN = 0,
@@ -63,52 +72,77 @@ typedef enum {
} envoy_service_status_v3_ConfigStatus;
+
/* envoy.service.status.v3.ClientStatusRequest */
-UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_ClientStatusRequest_new(upb_arena *arena) {
- return (envoy_service_status_v3_ClientStatusRequest *)_upb_msg_new(&envoy_service_status_v3_ClientStatusRequest_msginit, arena);
+UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ClientStatusRequest_new(upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientStatusRequest*)_upb_Message_New(&envoy_service_status_v3_ClientStatusRequest_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ClientStatusRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_status_v3_ClientStatusRequest* ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ClientStatusRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_status_v3_ClientStatusRequest* ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_ClientStatusRequest_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_status_v3_ClientStatusRequest *ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_service_status_v3_ClientStatusRequest_serialize(const envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, 0, arena, len);
}
-UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_ClientStatusRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_service_status_v3_ClientStatusRequest *ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_service_status_v3_ClientStatusRequest_serialize_ex(const envoy_service_status_v3_ClientStatusRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_service_status_v3_ClientStatusRequest_serialize(const envoy_service_status_v3_ClientStatusRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, arena, len);
+UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const struct envoy_type_matcher_v3_NodeMatcher* const* envoy_service_status_v3_ClientStatusRequest_node_matchers(const envoy_service_status_v3_ClientStatusRequest* msg, size_t* len) {
+ return (const struct envoy_type_matcher_v3_NodeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node(const envoy_service_status_v3_ClientStatusRequest* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_clear_node(const envoy_service_status_v3_ClientStatusRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_node(const envoy_service_status_v3_ClientStatusRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_Node*);
}
-UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node_matchers(const envoy_service_status_v3_ClientStatusRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_matcher_v3_NodeMatcher* const* envoy_service_status_v3_ClientStatusRequest_node_matchers(const envoy_service_status_v3_ClientStatusRequest *msg, size_t *len) { return (const struct envoy_type_matcher_v3_NodeMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_service_status_v3_ClientStatusRequest_has_node(const envoy_service_status_v3_ClientStatusRequest *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_node(const envoy_service_status_v3_ClientStatusRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); }
-
-UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_mutable_node_matchers(envoy_service_status_v3_ClientStatusRequest *msg, size_t *len) {
- return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_mutable_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t* len) {
+ return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_resize_node_matchers(envoy_service_status_v3_ClientStatusRequest *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher** envoy_service_status_v3_ClientStatusRequest_resize_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_type_matcher_v3_NodeMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher* envoy_service_status_v3_ClientStatusRequest_add_node_matchers(envoy_service_status_v3_ClientStatusRequest *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_NodeMatcher* sub = (struct envoy_type_matcher_v3_NodeMatcher*)_upb_msg_new(&envoy_type_matcher_v3_NodeMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_type_matcher_v3_NodeMatcher* envoy_service_status_v3_ClientStatusRequest_add_node_matchers(envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_NodeMatcher* sub = (struct envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_service_status_v3_ClientStatusRequest_set_node(envoy_service_status_v3_ClientStatusRequest *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Node*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_Node*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_mutable_node(envoy_service_status_v3_ClientStatusRequest *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatusRequest_mutable_node(envoy_service_status_v3_ClientStatusRequest* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_status_v3_ClientStatusRequest_node(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_ClientStatusRequest_set_node(msg, sub);
}
@@ -117,24 +151,35 @@ UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientStatu
/* envoy.service.status.v3.PerXdsConfig */
-UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsConfig_new(upb_arena *arena) {
- return (envoy_service_status_v3_PerXdsConfig *)_upb_msg_new(&envoy_service_status_v3_PerXdsConfig_msginit, arena);
-}
-UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_status_v3_PerXdsConfig *ret = envoy_service_status_v3_PerXdsConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsConfig_new(upb_Arena* arena) {
+ return (envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_status_v3_PerXdsConfig* ret = envoy_service_status_v3_PerXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_status_v3_PerXdsConfig* ret = envoy_service_status_v3_PerXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_service_status_v3_PerXdsConfig *ret = envoy_service_status_v3_PerXdsConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_service_status_v3_PerXdsConfig_serialize(const envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_service_status_v3_PerXdsConfig_serialize(const envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, arena, len);
+UPB_INLINE char* envoy_service_status_v3_PerXdsConfig_serialize_ex(const envoy_service_status_v3_PerXdsConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, options, arena, len);
}
-
typedef enum {
envoy_service_status_v3_PerXdsConfig_per_xds_config_listener_config = 2,
envoy_service_status_v3_PerXdsConfig_per_xds_config_cluster_config = 3,
@@ -143,177 +188,440 @@ typedef enum {
envoy_service_status_v3_PerXdsConfig_per_xds_config_endpoint_config = 6,
envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET = 0
} envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases;
-UPB_INLINE envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases envoy_service_status_v3_PerXdsConfig_per_xds_config_case(const envoy_service_status_v3_PerXdsConfig* msg) { return (envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 16), int32_t); }
-
-UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_status(const envoy_service_status_v3_PerXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_listener_config(const envoy_service_status_v3_PerXdsConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 2; }
-UPB_INLINE const struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_listener_config(const envoy_service_status_v3_PerXdsConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 2, NULL); }
-UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_cluster_config(const envoy_service_status_v3_PerXdsConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 3; }
-UPB_INLINE const struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_cluster_config(const envoy_service_status_v3_PerXdsConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 3, NULL); }
-UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_route_config(const envoy_service_status_v3_PerXdsConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 4; }
-UPB_INLINE const struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_route_config(const envoy_service_status_v3_PerXdsConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 4, NULL); }
-UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_scoped_route_config(const envoy_service_status_v3_PerXdsConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 5; }
-UPB_INLINE const struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_scoped_route_config(const envoy_service_status_v3_PerXdsConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 5, NULL); }
-UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_endpoint_config(const envoy_service_status_v3_PerXdsConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 16)) == 6; }
-UPB_INLINE const struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_endpoint_config(const envoy_service_status_v3_PerXdsConfig *msg) { return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(8, 8), UPB_SIZE(12, 16), 6, NULL); }
-UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_client_status(const envoy_service_status_v3_PerXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases envoy_service_status_v3_PerXdsConfig_per_xds_config_case(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return (envoy_service_status_v3_PerXdsConfig_per_xds_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_status(const envoy_service_status_v3_PerXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_status(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET);
+}
+UPB_INLINE const struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_listener_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET);
+}
+UPB_INLINE const struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_cluster_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET);
+}
+UPB_INLINE const struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL);
+}
+UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET);
+}
+UPB_INLINE const struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_scoped_route_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE bool envoy_service_status_v3_PerXdsConfig_has_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6;
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_service_status_v3_PerXdsConfig_per_xds_config_NOT_SET);
+}
+UPB_INLINE const struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_endpoint_config(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return UPB_READ_ONEOF(msg, const struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 6, NULL);
+}
+UPB_INLINE void envoy_service_status_v3_PerXdsConfig_clear_client_status(const envoy_service_status_v3_PerXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_service_status_v3_PerXdsConfig_client_status(const envoy_service_status_v3_PerXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
+}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_status(envoy_service_status_v3_PerXdsConfig *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_listener_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ListenersConfigDump* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 2);
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ListenersConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
}
-UPB_INLINE struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_listener_config(envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ListenersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_listener_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_ListenersConfigDump* sub = (struct envoy_admin_v3_ListenersConfigDump*)envoy_service_status_v3_PerXdsConfig_listener_config(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ListenersConfigDump*)_upb_msg_new(&envoy_admin_v3_ListenersConfigDump_msginit, arena);
+ sub = (struct envoy_admin_v3_ListenersConfigDump*)_upb_Message_New(&envoy_admin_v3_ListenersConfigDump_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_PerXdsConfig_set_listener_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_cluster_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ClustersConfigDump* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 3);
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ClustersConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_cluster_config(envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ClustersConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_cluster_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_ClustersConfigDump* sub = (struct envoy_admin_v3_ClustersConfigDump*)envoy_service_status_v3_PerXdsConfig_cluster_config(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ClustersConfigDump*)_upb_msg_new(&envoy_admin_v3_ClustersConfigDump_msginit, arena);
+ sub = (struct envoy_admin_v3_ClustersConfigDump*)_upb_Message_New(&envoy_admin_v3_ClustersConfigDump_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_PerXdsConfig_set_cluster_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_route_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_RoutesConfigDump* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 4);
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_RoutesConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4);
}
-UPB_INLINE struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_route_config(envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_RoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_route_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_RoutesConfigDump* sub = (struct envoy_admin_v3_RoutesConfigDump*)envoy_service_status_v3_PerXdsConfig_route_config(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_RoutesConfigDump*)_upb_msg_new(&envoy_admin_v3_RoutesConfigDump_msginit, arena);
+ sub = (struct envoy_admin_v3_RoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_RoutesConfigDump_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_PerXdsConfig_set_route_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_scoped_route_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_ScopedRoutesConfigDump* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 5);
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_ScopedRoutesConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5);
}
-UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_scoped_route_config(envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_ScopedRoutesConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_scoped_route_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_ScopedRoutesConfigDump* sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)envoy_service_status_v3_PerXdsConfig_scoped_route_config(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)_upb_msg_new(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena);
+ sub = (struct envoy_admin_v3_ScopedRoutesConfigDump*)_upb_Message_New(&envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_PerXdsConfig_set_scoped_route_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_endpoint_config(envoy_service_status_v3_PerXdsConfig *msg, struct envoy_admin_v3_EndpointsConfigDump* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(8, 8), value, UPB_SIZE(12, 16), 6);
+ UPB_WRITE_ONEOF(msg, struct envoy_admin_v3_EndpointsConfigDump*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 6);
}
-UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_endpoint_config(envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_admin_v3_EndpointsConfigDump* envoy_service_status_v3_PerXdsConfig_mutable_endpoint_config(envoy_service_status_v3_PerXdsConfig* msg, upb_Arena* arena) {
struct envoy_admin_v3_EndpointsConfigDump* sub = (struct envoy_admin_v3_EndpointsConfigDump*)envoy_service_status_v3_PerXdsConfig_endpoint_config(msg);
if (sub == NULL) {
- sub = (struct envoy_admin_v3_EndpointsConfigDump*)_upb_msg_new(&envoy_admin_v3_EndpointsConfigDump_msginit, arena);
+ sub = (struct envoy_admin_v3_EndpointsConfigDump*)_upb_Message_New(&envoy_admin_v3_EndpointsConfigDump_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_PerXdsConfig_set_endpoint_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_service_status_v3_PerXdsConfig_set_client_status(envoy_service_status_v3_PerXdsConfig *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
/* envoy.service.status.v3.ClientConfig */
-UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientConfig_new(upb_arena *arena) {
- return (envoy_service_status_v3_ClientConfig *)_upb_msg_new(&envoy_service_status_v3_ClientConfig_msginit, arena);
+UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientConfig_new(upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_status_v3_ClientConfig* ret = envoy_service_status_v3_ClientConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_status_v3_ClientConfig* ret = envoy_service_status_v3_ClientConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientConfig_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_status_v3_ClientConfig *ret = envoy_service_status_v3_ClientConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* envoy_service_status_v3_ClientConfig_serialize(const envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, 0, arena, len);
}
-UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_service_status_v3_ClientConfig *ret = envoy_service_status_v3_ClientConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_service_status_v3_ClientConfig_serialize_ex(const envoy_service_status_v3_ClientConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, options, arena, len);
}
-UPB_INLINE char *envoy_service_status_v3_ClientConfig_serialize(const envoy_service_status_v3_ClientConfig *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_status_v3_ClientConfig_msginit, arena, len);
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_node(const envoy_service_status_v3_ClientConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_node(const envoy_service_status_v3_ClientConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_node(const envoy_service_status_v3_ClientConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_xds_config(const envoy_service_status_v3_ClientConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_xds_config(const envoy_service_status_v3_ClientConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const envoy_service_status_v3_PerXdsConfig* const* envoy_service_status_v3_ClientConfig_xds_config(const envoy_service_status_v3_ClientConfig* msg, size_t* len) {
+ return (const envoy_service_status_v3_PerXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_clear_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const* envoy_service_status_v3_ClientConfig_generic_xds_configs(const envoy_service_status_v3_ClientConfig* msg, size_t* len) {
+ return (const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
}
-
-UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_node(const envoy_service_status_v3_ClientConfig *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_node(const envoy_service_status_v3_ClientConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); }
-UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_xds_config(const envoy_service_status_v3_ClientConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_service_status_v3_PerXdsConfig* const* envoy_service_status_v3_ClientConfig_xds_config(const envoy_service_status_v3_ClientConfig *msg, size_t *len) { return (const envoy_service_status_v3_PerXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE void envoy_service_status_v3_ClientConfig_set_node(envoy_service_status_v3_ClientConfig *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_Node*) = value;
}
-UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_mutable_node(envoy_service_status_v3_ClientConfig *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_mutable_node(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) {
struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_service_status_v3_ClientConfig_node(msg);
if (sub == NULL) {
- sub = (struct envoy_config_core_v3_Node*)_upb_msg_new(&envoy_config_core_v3_Node_msginit, arena);
+ sub = (struct envoy_config_core_v3_Node*)_upb_Message_New(&envoy_config_core_v3_Node_msginit, arena);
if (!sub) return NULL;
envoy_service_status_v3_ClientConfig_set_node(msg, sub);
}
return sub;
}
-UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig *msg, size_t *len) {
+UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t* len) {
return (envoy_service_status_v3_PerXdsConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_resize_xds_config(envoy_service_status_v3_ClientConfig *msg, size_t len, upb_arena *arena) {
- return (envoy_service_status_v3_PerXdsConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_service_status_v3_PerXdsConfig** envoy_service_status_v3_ClientConfig_resize_xds_config(envoy_service_status_v3_ClientConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_service_status_v3_PerXdsConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_ClientConfig_add_xds_config(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) {
+ struct envoy_service_status_v3_PerXdsConfig* sub = (struct envoy_service_status_v3_PerXdsConfig*)_upb_Message_New(&envoy_service_status_v3_PerXdsConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_mutable_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t* len) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_resize_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, size_t len, upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_ClientConfig_add_xds_config(envoy_service_status_v3_ClientConfig *msg, upb_arena *arena) {
- struct envoy_service_status_v3_PerXdsConfig* sub = (struct envoy_service_status_v3_PerXdsConfig*)_upb_msg_new(&envoy_service_status_v3_PerXdsConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_add_generic_xds_configs(envoy_service_status_v3_ClientConfig* msg, upb_Arena* arena) {
+ struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* sub = (struct envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-/* envoy.service.status.v3.ClientStatusResponse */
+/* envoy.service.status.v3.ClientConfig.GenericXdsConfig */
-UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3_ClientStatusResponse_new(upb_arena *arena) {
- return (envoy_service_status_v3_ClientStatusResponse *)_upb_msg_new(&envoy_service_status_v3_ClientStatusResponse_msginit, arena);
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_GenericXdsConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig* ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_GenericXdsConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig* ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_service_status_v3_ClientConfig_GenericXdsConfig_serialize(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_status_v3_ClientConfig_GenericXdsConfig_serialize_ex(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, options, arena, len);
}
-UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3_ClientStatusResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_service_status_v3_ClientStatusResponse *ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, arena)) ? ret : NULL;
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_type_url(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3_ClientStatusResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_service_status_v3_ClientStatusResponse *ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_type_url(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView);
}
-UPB_INLINE char *envoy_service_status_v3_ClientStatusResponse_serialize(const envoy_service_status_v3_ClientStatusResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, arena, len);
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_name(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_name(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_version_info(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_service_status_v3_ClientConfig_GenericXdsConfig_version_info(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const struct google_protobuf_Any*);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_config_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_config_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_client_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_client_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct envoy_admin_v3_UpdateFailureState*);
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_clear_is_static_resource(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+}
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_is_static_resource(const envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
+}
+
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_type_url(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_name(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_version_info(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Any* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_config_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_client_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct envoy_admin_v3_UpdateFailureState* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct envoy_admin_v3_UpdateFailureState*) = value;
+}
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig* msg, upb_Arena* arena) {
+ struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_Message_New(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_is_static_resource(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
}
-UPB_INLINE bool envoy_service_status_v3_ClientStatusResponse_has_config(const envoy_service_status_v3_ClientStatusResponse *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE const envoy_service_status_v3_ClientConfig* const* envoy_service_status_v3_ClientStatusResponse_config(const envoy_service_status_v3_ClientStatusResponse *msg, size_t *len) { return (const envoy_service_status_v3_ClientConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+/* envoy.service.status.v3.ClientStatusResponse */
+
+UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3_ClientStatusResponse_new(upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientStatusResponse*)_upb_Message_New(&envoy_service_status_v3_ClientStatusResponse_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3_ClientStatusResponse_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_service_status_v3_ClientStatusResponse* ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3_ClientStatusResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_service_status_v3_ClientStatusResponse* ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_service_status_v3_ClientStatusResponse_serialize(const envoy_service_status_v3_ClientStatusResponse* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_service_status_v3_ClientStatusResponse_serialize_ex(const envoy_service_status_v3_ClientStatusResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_service_status_v3_ClientStatusResponse_has_config(const envoy_service_status_v3_ClientStatusResponse* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_service_status_v3_ClientStatusResponse_clear_config(const envoy_service_status_v3_ClientStatusResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_service_status_v3_ClientConfig* const* envoy_service_status_v3_ClientStatusResponse_config(const envoy_service_status_v3_ClientStatusResponse* msg, size_t* len) {
+ return (const envoy_service_status_v3_ClientConfig* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
-UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_mutable_config(envoy_service_status_v3_ClientStatusResponse *msg, size_t *len) {
+UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_mutable_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t* len) {
return (envoy_service_status_v3_ClientConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
-UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_resize_config(envoy_service_status_v3_ClientStatusResponse *msg, size_t len, upb_arena *arena) {
- return (envoy_service_status_v3_ClientConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_service_status_v3_ClientConfig** envoy_service_status_v3_ClientStatusResponse_resize_config(envoy_service_status_v3_ClientStatusResponse* msg, size_t len, upb_Arena* arena) {
+ return (envoy_service_status_v3_ClientConfig**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientStatusResponse_add_config(envoy_service_status_v3_ClientStatusResponse *msg, upb_arena *arena) {
- struct envoy_service_status_v3_ClientConfig* sub = (struct envoy_service_status_v3_ClientConfig*)_upb_msg_new(&envoy_service_status_v3_ClientConfig_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientStatusResponse_add_config(envoy_service_status_v3_ClientStatusResponse* msg, upb_Arena* arena) {
+ struct envoy_service_status_v3_ClientConfig* sub = (struct envoy_service_status_v3_ClientConfig*)_upb_Message_New(&envoy_service_status_v3_ClientConfig_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File envoy_service_status_v3_csds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c
new file mode 100644
index 00000000..f0c0870e
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c
@@ -0,0 +1,48 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/cookie.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/http/v3/cookie.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_type_http_v3_Cookie_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_type_http_v3_Cookie__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_http_v3_Cookie_msginit = {
+ &envoy_type_http_v3_Cookie_submsgs[0],
+ &envoy_type_http_v3_Cookie__fields[0],
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_http_v3_Cookie_msginit,
+};
+
+const upb_MiniTable_File envoy_type_http_v3_cookie_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h
new file mode 100644
index 00000000..2c4dcc57
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h
@@ -0,0 +1,112 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/cookie.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_
+#define ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_http_v3_Cookie;
+typedef struct envoy_type_http_v3_Cookie envoy_type_http_v3_Cookie;
+extern const upb_MiniTable envoy_type_http_v3_Cookie_msginit;
+struct google_protobuf_Duration;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+
+
+
+/* envoy.type.http.v3.Cookie */
+
+UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_new(upb_Arena* arena) {
+ return (envoy_type_http_v3_Cookie*)_upb_Message_New(&envoy_type_http_v3_Cookie_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_http_v3_Cookie* ret = envoy_type_http_v3_Cookie_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_http_v3_Cookie* ret = envoy_type_http_v3_Cookie_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_Cookie_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_http_v3_Cookie_serialize(const envoy_type_http_v3_Cookie* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_http_v3_Cookie_serialize_ex(const envoy_type_http_v3_Cookie* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_http_v3_Cookie_clear_name(const envoy_type_http_v3_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_http_v3_Cookie_name(const envoy_type_http_v3_Cookie* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_type_http_v3_Cookie_has_ttl(const envoy_type_http_v3_Cookie* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_http_v3_Cookie_clear_ttl(const envoy_type_http_v3_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_type_http_v3_Cookie_ttl(const envoy_type_http_v3_Cookie* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void envoy_type_http_v3_Cookie_clear_path(const envoy_type_http_v3_Cookie* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_http_v3_Cookie_path(const envoy_type_http_v3_Cookie* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_http_v3_Cookie_set_name(envoy_type_http_v3_Cookie *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void envoy_type_http_v3_Cookie_set_ttl(envoy_type_http_v3_Cookie *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_type_http_v3_Cookie_mutable_ttl(envoy_type_http_v3_Cookie* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_type_http_v3_Cookie_ttl(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_http_v3_Cookie_set_ttl(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_http_v3_Cookie_set_path(envoy_type_http_v3_Cookie *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_type_http_v3_cookie_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
new file mode 100644
index 00000000..26a55699
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
@@ -0,0 +1,76 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/http/v3/path_transformation.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub envoy_type_http_v3_PathTransformation_submsgs[1] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_msginit},
+};
+
+static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit = {
+ &envoy_type_http_v3_PathTransformation_submsgs[0],
+ &envoy_type_http_v3_PathTransformation__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub envoy_type_http_v3_PathTransformation_Operation_submsgs[2] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit},
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit},
+};
+
+static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation_Operation__fields[2] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msginit = {
+ &envoy_type_http_v3_PathTransformation_Operation_submsgs[0],
+ &envoy_type_http_v3_PathTransformation_Operation__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &envoy_type_http_v3_PathTransformation_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit,
+};
+
+const upb_MiniTable_File envoy_type_http_v3_path_transformation_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h
new file mode 100644
index 00000000..7690351f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h
@@ -0,0 +1,249 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_
+#define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_http_v3_PathTransformation;
+struct envoy_type_http_v3_PathTransformation_Operation;
+struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986;
+struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes;
+typedef struct envoy_type_http_v3_PathTransformation envoy_type_http_v3_PathTransformation;
+typedef struct envoy_type_http_v3_PathTransformation_Operation envoy_type_http_v3_PathTransformation_Operation;
+typedef struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986;
+typedef struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes envoy_type_http_v3_PathTransformation_Operation_MergeSlashes;
+extern const upb_MiniTable envoy_type_http_v3_PathTransformation_msginit;
+extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_msginit;
+extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit;
+extern const upb_MiniTable envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit;
+
+
+
+/* envoy.type.http.v3.PathTransformation */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransformation_new(upb_Arena* arena) {
+ return (envoy_type_http_v3_PathTransformation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransformation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation* ret = envoy_type_http_v3_PathTransformation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransformation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation* ret = envoy_type_http_v3_PathTransformation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_serialize(const envoy_type_http_v3_PathTransformation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_serialize_ex(const envoy_type_http_v3_PathTransformation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_has_operations(const envoy_type_http_v3_PathTransformation* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void envoy_type_http_v3_PathTransformation_clear_operations(const envoy_type_http_v3_PathTransformation* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation* const* envoy_type_http_v3_PathTransformation_operations(const envoy_type_http_v3_PathTransformation* msg, size_t* len) {
+ return (const envoy_type_http_v3_PathTransformation_Operation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_mutable_operations(envoy_type_http_v3_PathTransformation* msg, size_t* len) {
+ return (envoy_type_http_v3_PathTransformation_Operation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_resize_operations(envoy_type_http_v3_PathTransformation* msg, size_t len, upb_Arena* arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_add_operations(envoy_type_http_v3_PathTransformation* msg, upb_Arena* arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation* sub = (struct envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.type.http.v3.PathTransformation.Operation */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_Operation_new(upb_Arena* arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_Operation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation* ret = envoy_type_http_v3_PathTransformation_Operation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_Operation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation* ret = envoy_type_http_v3_PathTransformation_Operation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_serialize(const envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_serialize_ex(const envoy_type_http_v3_PathTransformation_Operation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_normalize_path_rfc_3986 = 2,
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_merge_slashes = 3,
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET = 0
+} envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases;
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases envoy_type_http_v3_PathTransformation_Operation_operation_specifier_case(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ return (envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_clear_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_mutable_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_mutable_merge_slashes(envoy_type_http_v3_PathTransformation_Operation* msg, upb_Arena* arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)envoy_type_http_v3_PathTransformation_Operation_merge_slashes(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986 */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(upb_Arena* arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_serialize(const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_serialize_ex(const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, options, arena, len);
+}
+
+
+/* envoy.type.http.v3.PathTransformation.Operation.MergeSlashes */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(upb_Arena* arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_Message_New(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_serialize(const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_serialize_ex(const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, options, arena, len);
+}
+
+
+extern const upb_MiniTable_File envoy_type_http_v3_path_transformation_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c
new file mode 100644
index 00000000..870febe0
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c
@@ -0,0 +1,74 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/http_inputs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/matcher/v3/http_inputs.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestHeaderMatchInput__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit = {
+ NULL,
+ &envoy_type_matcher_v3_HttpRequestHeaderMatchInput__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit = {
+ NULL,
+ &envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit = {
+ NULL,
+ &envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit = {
+ NULL,
+ &envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit,
+ &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit,
+ &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit,
+ &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_http_inputs_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h
new file mode 100644
index 00000000..e694dbcb
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h
@@ -0,0 +1,214 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/http_inputs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_
+#define ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_matcher_v3_HttpRequestHeaderMatchInput;
+struct envoy_type_matcher_v3_HttpRequestTrailerMatchInput;
+struct envoy_type_matcher_v3_HttpResponseHeaderMatchInput;
+struct envoy_type_matcher_v3_HttpResponseTrailerMatchInput;
+typedef struct envoy_type_matcher_v3_HttpRequestHeaderMatchInput envoy_type_matcher_v3_HttpRequestHeaderMatchInput;
+typedef struct envoy_type_matcher_v3_HttpRequestTrailerMatchInput envoy_type_matcher_v3_HttpRequestTrailerMatchInput;
+typedef struct envoy_type_matcher_v3_HttpResponseHeaderMatchInput envoy_type_matcher_v3_HttpResponseHeaderMatchInput;
+typedef struct envoy_type_matcher_v3_HttpResponseTrailerMatchInput envoy_type_matcher_v3_HttpResponseTrailerMatchInput;
+extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit;
+
+
+
+/* envoy.type.matcher.v3.HttpRequestHeaderMatchInput */
+
+UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_HttpRequestHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpRequestHeaderMatchInput* ret = envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpRequestHeaderMatchInput* ret = envoy_type_matcher_v3_HttpRequestHeaderMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_serialize(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpRequestHeaderMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_matcher_v3_HttpRequestHeaderMatchInput_clear_header_name(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpRequestHeaderMatchInput_header_name(const envoy_type_matcher_v3_HttpRequestHeaderMatchInput* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_matcher_v3_HttpRequestHeaderMatchInput_set_header_name(envoy_type_matcher_v3_HttpRequestHeaderMatchInput *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+/* envoy.type.matcher.v3.HttpRequestTrailerMatchInput */
+
+UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_HttpRequestTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpRequestTrailerMatchInput* ret = envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpRequestTrailerMatchInput* ret = envoy_type_matcher_v3_HttpRequestTrailerMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_serialize(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpRequestTrailerMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_matcher_v3_HttpRequestTrailerMatchInput_clear_header_name(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpRequestTrailerMatchInput_header_name(const envoy_type_matcher_v3_HttpRequestTrailerMatchInput* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_matcher_v3_HttpRequestTrailerMatchInput_set_header_name(envoy_type_matcher_v3_HttpRequestTrailerMatchInput *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+/* envoy.type.matcher.v3.HttpResponseHeaderMatchInput */
+
+UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_HttpResponseHeaderMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpResponseHeaderMatchInput* ret = envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpResponseHeaderMatchInput* ret = envoy_type_matcher_v3_HttpResponseHeaderMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpResponseHeaderMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_matcher_v3_HttpResponseHeaderMatchInput_clear_header_name(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpResponseHeaderMatchInput_header_name(const envoy_type_matcher_v3_HttpResponseHeaderMatchInput* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_matcher_v3_HttpResponseHeaderMatchInput_set_header_name(envoy_type_matcher_v3_HttpResponseHeaderMatchInput *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+/* envoy.type.matcher.v3.HttpResponseTrailerMatchInput */
+
+UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_HttpResponseTrailerMatchInput*)_upb_Message_New(&envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpResponseTrailerMatchInput* ret = envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_HttpResponseTrailerMatchInput* ret = envoy_type_matcher_v3_HttpResponseTrailerMatchInput_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_serialize(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_HttpResponseTrailerMatchInput_serialize_ex(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_matcher_v3_HttpResponseTrailerMatchInput_clear_header_name(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_HttpResponseTrailerMatchInput_header_name(const envoy_type_matcher_v3_HttpResponseTrailerMatchInput* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_matcher_v3_HttpResponseTrailerMatchInput_set_header_name(envoy_type_matcher_v3_HttpResponseTrailerMatchInput *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_type_matcher_v3_http_inputs_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
index 7fdf5b9f..e8e9c471 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/metadata.upb.h"
#include "envoy/type/matcher/v3/value.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,31 +16,46 @@
#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_MiniTable_Sub envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit},
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit = {
&envoy_type_matcher_v3_MetadataMatcher_submsgs[0],
&envoy_type_matcher_v3_MetadataMatcher__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = {
NULL,
&envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_type_matcher_v3_MetadataMatcher_msginit,
+ &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_metadata_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
index a7f17c14..8fe5bb85 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,101 +24,161 @@ 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;
+extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit;
struct envoy_type_matcher_v3_ValueMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_MetadataMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_MetadataMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_MetadataMatcher* ret = envoy_type_matcher_v3_MetadataMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_MetadataMatcher_serialize_ex(const envoy_type_matcher_v3_MetadataMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_filter(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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 void envoy_type_matcher_v3_MetadataMatcher_clear_path(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ _upb_array_detach(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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_value(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct envoy_type_matcher_v3_ValueMatcher*);
+}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_clear_invert(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_invert(const envoy_type_matcher_v3_MetadataMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
}
-UPB_INLINE upb_strview envoy_type_matcher_v3_MetadataMatcher_filter(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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(16, 32)); }
-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(16, 32), len); }
-UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(16, 32), len);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_matcher_v3_ValueMatcher*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_MetadataMatcher_set_value(msg, sub);
}
return sub;
}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_invert(envoy_type_matcher_v3_MetadataMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_MetadataMatcher_PathSegment*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_MetadataMatcher_PathSegment* ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize_ex(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_clear_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_MetadataMatcher_PathSegment_key(const envoy_type_matcher_v3_MetadataMatcher_PathSegment* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
-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);
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_metadata_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
index 8ef51fb9..768bd260 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/node.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "envoy/type/matcher/v3/struct.upb.h"
@@ -16,20 +16,33 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_NodeMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_StructMatcher_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_NodeMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StructMatcher_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_NodeMatcher__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+static const upb_MiniTable_Field envoy_type_matcher_v3_NodeMatcher__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit = {
&envoy_type_matcher_v3_NodeMatcher_submsgs[0],
&envoy_type_matcher_v3_NodeMatcher__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_matcher_v3_NodeMatcher_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_node_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
index 94e2257f..1c2cd1d7 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,65 +22,92 @@ extern "C" {
struct envoy_type_matcher_v3_NodeMatcher;
typedef struct envoy_type_matcher_v3_NodeMatcher envoy_type_matcher_v3_NodeMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_NodeMatcher_msginit;
struct envoy_type_matcher_v3_StringMatcher;
struct envoy_type_matcher_v3_StructMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit;
+
/* envoy.type.matcher.v3.NodeMatcher */
-UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_NodeMatcher *)_upb_msg_new(&envoy_type_matcher_v3_NodeMatcher_msginit, arena);
+UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_NodeMatcher*)_upb_Message_New(&envoy_type_matcher_v3_NodeMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_NodeMatcher* ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_NodeMatcher *ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_NodeMatcher* ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_matcher_v3_NodeMatcher *ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_matcher_v3_NodeMatcher_serialize(const envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_type_matcher_v3_NodeMatcher_serialize(const envoy_type_matcher_v3_NodeMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, arena, len);
+UPB_INLINE char* envoy_type_matcher_v3_NodeMatcher_serialize_ex(const envoy_type_matcher_v3_NodeMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*);
+}
+UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_clear_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const struct envoy_type_matcher_v3_StructMatcher* const* envoy_type_matcher_v3_NodeMatcher_node_metadatas(const envoy_type_matcher_v3_NodeMatcher* msg, size_t* len) {
+ return (const struct envoy_type_matcher_v3_StructMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
}
-
-UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_id(const envoy_type_matcher_v3_NodeMatcher *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_node_id(const envoy_type_matcher_v3_NodeMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_StringMatcher*); }
-UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_metadatas(const envoy_type_matcher_v3_NodeMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StructMatcher* const* envoy_type_matcher_v3_NodeMatcher_node_metadatas(const envoy_type_matcher_v3_NodeMatcher *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StructMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE void envoy_type_matcher_v3_NodeMatcher_set_node_id(envoy_type_matcher_v3_NodeMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_StringMatcher*) = value;
}
-UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_mutable_node_id(envoy_type_matcher_v3_NodeMatcher *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_NodeMatcher_mutable_node_id(envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_NodeMatcher_node_id(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_NodeMatcher_set_node_id(msg, sub);
}
return sub;
}
-UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_mutable_node_metadatas(envoy_type_matcher_v3_NodeMatcher *msg, size_t *len) {
+UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_mutable_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t* len) {
return (struct envoy_type_matcher_v3_StructMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
-UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_resize_node_metadatas(envoy_type_matcher_v3_NodeMatcher *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_matcher_v3_StructMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE struct envoy_type_matcher_v3_StructMatcher** envoy_type_matcher_v3_NodeMatcher_resize_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, size_t len, upb_Arena* arena) {
+ return (struct envoy_type_matcher_v3_StructMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_NodeMatcher_add_node_metadatas(envoy_type_matcher_v3_NodeMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StructMatcher* sub = (struct envoy_type_matcher_v3_StructMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_NodeMatcher_add_node_metadatas(envoy_type_matcher_v3_NodeMatcher* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_StructMatcher* sub = (struct envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_node_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
index 516755b0..13ca6457 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/number.upb.h"
#include "envoy/type/v3/range.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,32 @@
#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_MiniTable_Sub envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_DoubleMatcher__fields[2] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_matcher_v3_DoubleMatcher_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_number_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
index ebca3037..8242e7a3 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,59 +22,88 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msginit;
struct envoy_type_v3_DoubleRange;
-extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_DoubleMatcher* ret = envoy_type_matcher_v3_DoubleMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_DoubleMatcher_serialize_ex(const envoy_type_matcher_v3_DoubleMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_range(const envoy_type_matcher_v3_DoubleMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_clear_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_DoubleMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE double envoy_type_matcher_v3_DoubleMatcher_exact(const envoy_type_matcher_v3_DoubleMatcher* msg) {
+ return UPB_READ_ONEOF(msg, double, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_type_v3_DoubleRange*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct envoy_type_v3_DoubleRange* envoy_type_matcher_v3_DoubleMatcher_mutable_range(envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena) {
+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);
+ sub = (struct envoy_type_v3_DoubleRange*)_upb_Message_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);
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 2);
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_number_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
index caef3395..0293b407 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/path.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,18 +16,31 @@
#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_MiniTable_Sub envoy_type_matcher_v3_PathMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_PathMatcher__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_matcher_v3_PathMatcher_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_path_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
index defbcf02..85f433dc 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,53 +22,75 @@ extern "C" {
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;
+extern const upb_MiniTable envoy_type_matcher_v3_PathMatcher_msginit;
struct envoy_type_matcher_v3_StringMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_PathMatcher*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_PathMatcher* ret = envoy_type_matcher_v3_PathMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_matcher_v3_PathMatcher_serialize_ex(const envoy_type_matcher_v3_PathMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_PathMatcher_clear_path(const envoy_type_matcher_v3_PathMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_PathMatcher_rule_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_PathMatcher_set_path(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_path_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
index 1e4232bc..29399dc5 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
@@ -7,57 +7,73 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/regex.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_type_matcher_v3_RegexMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher__fields[2] = {
+ {1, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+ &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_regex_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
index 5e00d13f..9b87e555 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,90 +26,133 @@ 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;
+extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
struct google_protobuf_UInt32Value;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_RegexMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_RegexMatcher* ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_matcher_v3_RegexMatcher_serialize_ex(const envoy_type_matcher_v3_RegexMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_google_re2(const envoy_type_matcher_v3_RegexMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_clear_regex(const envoy_type_matcher_v3_RegexMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
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_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_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;
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_RegexMatcher_GoogleRE2* ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize_ex(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_clear_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_UInt32Value*);
}
-
-UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub);
}
@@ -118,45 +161,70 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatche
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_RegexMatchAndSubstitute*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_RegexMatchAndSubstitute_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_RegexMatchAndSubstitute* ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize_ex(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const envoy_type_matcher_v3_RegexMatcher*);
+}
+UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_clear_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-
-UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_type_matcher_v3_RegexMatcher*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_regex_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
index e84e4f7c..37bfaa05 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "envoy/type/matcher/v3/regex.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,37 +16,51 @@
#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_MiniTable_Sub envoy_type_matcher_v3_StringMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_StringMatcher__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_ListStringMatcher__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit = {
&envoy_type_matcher_v3_ListStringMatcher_submsgs[0],
&envoy_type_matcher_v3_ListStringMatcher__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &envoy_type_matcher_v3_ListStringMatcher_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_string_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
index 4bce450c..7698ad35 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,32 +24,44 @@ 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;
+extern const upb_MiniTable envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_ListStringMatcher_msginit;
struct envoy_type_matcher_v3_RegexMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_StringMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_StringMatcher* ret = envoy_type_matcher_v3_StringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_matcher_v3_StringMatcher_serialize_ex(const envoy_type_matcher_v3_StringMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, options, arena, len);
}
-
typedef enum {
envoy_type_matcher_v3_StringMatcher_match_pattern_exact = 1,
envoy_type_matcher_v3_StringMatcher_match_pattern_prefix = 2,
@@ -58,36 +70,77 @@ typedef enum {
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 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(4, 4), 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(4, 4)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_exact(const envoy_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_prefix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_suffix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_safe_regex(const envoy_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_ignore_case(const envoy_type_matcher_v3_StringMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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(4, 4)) == 7;
+}
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_clear_contains(const envoy_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString(""));
+}
-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_exact(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_prefix(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_suffix(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_Message_New(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub);
}
@@ -96,47 +149,66 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_Stri
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);
+UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_contains(envoy_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_ListStringMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListStringMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_ListStringMatcher* ret = envoy_type_matcher_v3_ListStringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* envoy_type_matcher_v3_ListStringMatcher_serialize_ex(const envoy_type_matcher_v3_ListStringMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, options, 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 void envoy_type_matcher_v3_ListStringMatcher_clear_patterns(const envoy_type_matcher_v3_ListStringMatcher* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_string_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
index 05ea6a3f..71661bb1 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/struct.upb.h"
#include "envoy/type/matcher/v3/value.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,30 +16,44 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_StructMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
- &envoy_type_matcher_v3_ValueMatcher_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_StructMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit},
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_StructMatcher__fields[2] = {
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 1, 11, 1},
+static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher__fields[2] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit = {
&envoy_type_matcher_v3_StructMatcher_submsgs[0],
&envoy_type_matcher_v3_StructMatcher__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout_field envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msginit = {
NULL,
&envoy_type_matcher_v3_StructMatcher_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_type_matcher_v3_StructMatcher_msginit,
+ &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
index 53e52138..d525b8e2 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,58 +24,83 @@ struct envoy_type_matcher_v3_StructMatcher;
struct envoy_type_matcher_v3_StructMatcher_PathSegment;
typedef struct envoy_type_matcher_v3_StructMatcher envoy_type_matcher_v3_StructMatcher;
typedef struct envoy_type_matcher_v3_StructMatcher_PathSegment envoy_type_matcher_v3_StructMatcher_PathSegment;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
struct envoy_type_matcher_v3_ValueMatcher;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit;
+
/* envoy.type.matcher.v3.StructMatcher */
-UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_StructMatcher *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
+UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatcher_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_StructMatcher*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
+}
+UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_StructMatcher* ret = envoy_type_matcher_v3_StructMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_StructMatcher* ret = envoy_type_matcher_v3_StructMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, 0, arena, len);
}
-UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, arena, len);
+UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_serialize_ex(const envoy_type_matcher_v3_StructMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, options, arena, len);
+}
+UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_path(const envoy_type_matcher_v3_StructMatcher* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher* msg, size_t* len) {
+ return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_matcher_v3_StructMatcher_clear_value(const envoy_type_matcher_v3_StructMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_matcher_v3_ValueMatcher*);
}
-UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_ValueMatcher*); }
-
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher *msg, size_t *len) {
- return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher* msg, size_t* len) {
+ return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher *msg, size_t len, upb_arena *arena) {
- return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher* msg, size_t len, upb_Arena* arena) {
+ return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
- struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena) {
+ struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_type_matcher_v3_StructMatcher_set_value(envoy_type_matcher_v3_StructMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
+UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher* msg, upb_Arena* arena) {
struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_StructMatcher_value(msg);
if (sub == NULL) {
- sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
+ sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_StructMatcher_set_value(msg, sub);
}
@@ -84,37 +109,58 @@ UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_Stru
/* envoy.type.matcher.v3.StructMatcher.PathSegment */
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_arena *arena) {
- return (envoy_type_matcher_v3_StructMatcher_PathSegment *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_Message_New(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
}
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char *buf, size_t size,
- upb_arena *arena) {
- envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_matcher_v3_StructMatcher_PathSegment* ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_StructMatcher_PathSegment* ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, len);
+UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_StructMatcher_PathSegment_serialize_ex(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, options, arena, len);
}
-
typedef enum {
envoy_type_matcher_v3_StructMatcher_PathSegment_segment_key = 1,
envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET = 0
} envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases;
-UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE upb_strview envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) {
+ return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_clear_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
-UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_struct_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
index 0195307d..528abf06 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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"
@@ -17,46 +17,61 @@
#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_MiniTable_Sub envoy_type_matcher_v3_ValueMatcher_submsgs[4] = {
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit},
+ {.submsg = &envoy_type_matcher_v3_DoubleMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_ListMatcher_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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_ValueMatcher__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = {
+const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_ValueMatcher_msginit,
+static const upb_MiniTable_Sub envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_matcher_v3_ListMatcher__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_type_matcher_v3_ValueMatcher_msginit,
+ &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
+ &envoy_type_matcher_v3_ListMatcher_msginit,
+};
+
+const upb_MiniTable_File envoy_type_matcher_v3_value_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
index dc44445f..3572aaed 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,35 +26,47 @@ 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;
+extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_msginit;
+extern const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_type_matcher_v3_DoubleMatcher_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_ValueMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_ValueMatcher* ret = envoy_type_matcher_v3_ValueMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_ValueMatcher_serialize_ex(const envoy_type_matcher_v3_ValueMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, options, arena, len);
}
-
typedef enum {
envoy_type_matcher_v3_ValueMatcher_match_pattern_null_match = 1,
envoy_type_matcher_v3_ValueMatcher_match_pattern_double_match = 2,
@@ -64,70 +76,113 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_null_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_double_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_string_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_bool_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_present_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void envoy_type_matcher_v3_ValueMatcher_clear_list_match(const envoy_type_matcher_v3_ValueMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ValueMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher_NullMatch*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_DoubleMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_DoubleMatcher*)_upb_Message_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_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_Message_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_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, bool, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_type_matcher_v3_ListMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_ListMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ListMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_ValueMatcher_set_list_match(msg, sub);
}
@@ -136,68 +191,100 @@ UPB_INLINE struct envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_Value
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_ValueMatcher_NullMatch*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_ValueMatcher_NullMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_ValueMatcher_NullMatch* ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize_ex(const envoy_type_matcher_v3_ValueMatcher_NullMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_type_matcher_v3_ListMatcher*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_matcher_v3_ListMatcher* ret = envoy_type_matcher_v3_ListMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_matcher_v3_ListMatcher_serialize_ex(const envoy_type_matcher_v3_ListMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_matcher_v3_ListMatcher_clear_one_of(const envoy_type_matcher_v3_ListMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_matcher_v3_ListMatcher_match_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_type_matcher_v3_ValueMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_Message_New(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
if (!sub) return NULL;
envoy_type_matcher_v3_ListMatcher_set_one_of(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File envoy_type_matcher_v3_value_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
index e692eda9..c1ccdf93 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/metadata/v3/metadata.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,73 +15,92 @@
#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_MiniTable_Sub envoy_type_metadata_v3_MetadataKey_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = {
+const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = {
NULL,
&envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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_MiniTable_Sub envoy_type_metadata_v3_MetadataKind_submsgs[4] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Request_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Route_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Cluster_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Host_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},
+static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKind__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(8, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit = {
+const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit = {
+const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit = {
+const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[7] = {
+ &envoy_type_metadata_v3_MetadataKey_msginit,
+ &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
+ &envoy_type_metadata_v3_MetadataKind_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Request_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Route_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Host_msginit,
};
-const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit = {
+const upb_MiniTable_File envoy_type_metadata_v3_metadata_proto_upb_file_layout = {
+ messages_layout,
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 7,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
index 83ac93cf..4311d4b9 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
#define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -34,109 +34,162 @@ typedef struct envoy_type_metadata_v3_MetadataKind_Request envoy_type_metadata_v
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;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Request_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msginit;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKey*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKey_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKey* ret = envoy_type_metadata_v3_MetadataKey_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKey_serialize_ex(const envoy_type_metadata_v3_MetadataKey* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, options, arena, len);
}
-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 void envoy_type_metadata_v3_MetadataKey_clear_key(const envoy_type_metadata_v3_MetadataKey* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_metadata_v3_MetadataKey_key(const envoy_type_metadata_v3_MetadataKey* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+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 void envoy_type_metadata_v3_MetadataKey_clear_path(const envoy_type_metadata_v3_MetadataKey* msg) {
+ _upb_array_detach(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 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 void envoy_type_metadata_v3_MetadataKey_set_key(envoy_type_metadata_v3_MetadataKey *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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) {
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKey_PathSegment*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v3_MetadataKey_PathSegment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKey_PathSegment* ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKey_PathSegment_serialize_ex(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, options, 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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_clear_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKey_PathSegment_segment_NOT_SET);
+}
+UPB_INLINE upb_StringView envoy_type_metadata_v3_MetadataKey_PathSegment_key(const envoy_type_metadata_v3_MetadataKey_PathSegment* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
-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);
+UPB_INLINE void envoy_type_metadata_v3_MetadataKey_PathSegment_set_key(envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKind*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataKind_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKind* ret = envoy_type_metadata_v3_MetadataKind_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_serialize_ex(const envoy_type_metadata_v3_MetadataKind* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, options, arena, len);
}
-
typedef enum {
envoy_type_metadata_v3_MetadataKind_kind_request = 1,
envoy_type_metadata_v3_MetadataKind_kind_route = 2,
@@ -144,60 +197,89 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_request(const envoy_type_metadata_v3_MetadataKind* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_route(const envoy_type_metadata_v3_MetadataKind* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_cluster(const envoy_type_metadata_v3_MetadataKind* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_type_metadata_v3_MetadataKind_clear_host(const envoy_type_metadata_v3_MetadataKind* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_metadata_v3_MetadataKind_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Request*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Route*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Cluster*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_metadata_v3_MetadataKind_Host*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_Host_msginit, arena);
if (!sub) return NULL;
envoy_type_metadata_v3_MetadataKind_set_host(msg, sub);
}
@@ -206,91 +288,137 @@ UPB_INLINE struct envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Request*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_MetadataKind_Request_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKind_Request* ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Request_serialize_ex(const envoy_type_metadata_v3_MetadataKind_Request* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Route*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_MetadataKind_Route_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKind_Route* ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Route_serialize_ex(const envoy_type_metadata_v3_MetadataKind_Route* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Cluster*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_MetadataKind_Cluster_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKind_Cluster* ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Cluster_serialize_ex(const envoy_type_metadata_v3_MetadataKind_Cluster* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, options, 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_new(upb_Arena* arena) {
+ return (envoy_type_metadata_v3_MetadataKind_Host*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_MetadataKind_Host_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_metadata_v3_MetadataKind_Host* ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_metadata_v3_MetadataKind_Host_serialize_ex(const envoy_type_metadata_v3_MetadataKind_Host* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, options, arena, len);
}
+extern const upb_MiniTable_File envoy_type_metadata_v3_metadata_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
index fa53e431..00cb672f 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/tracing/v3/custom_tag.upb.h"
#include "envoy/type/metadata/v3/metadata.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,74 +16,91 @@
#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_MiniTable_Sub envoy_type_tracing_v3_CustomTag_submsgs[4] = {
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Literal_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Environment_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Header_msginit},
+ {.submsg = &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},
+static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit = {
+const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Literal__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit = {
+const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Environment__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Header__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit = {
+const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Header__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
-static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[5] = {
+ &envoy_type_tracing_v3_CustomTag_msginit,
+ &envoy_type_tracing_v3_CustomTag_Literal_msginit,
+ &envoy_type_tracing_v3_CustomTag_Environment_msginit,
+ &envoy_type_tracing_v3_CustomTag_Header_msginit,
+ &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
+};
+
+const upb_MiniTable_File envoy_type_tracing_v3_custom_tag_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 5,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
index 666ed7b1..cf906dc4 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
@@ -9,7 +9,7 @@
#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/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -30,37 +30,49 @@ typedef struct envoy_type_tracing_v3_CustomTag_Literal envoy_type_tracing_v3_Cus
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;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_msginit;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msginit;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msginit;
+extern const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable envoy_type_metadata_v3_MetadataKey_msginit;
+extern const upb_MiniTable 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 envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_new(upb_Arena* arena) {
+ return (envoy_type_tracing_v3_CustomTag*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_tracing_v3_CustomTag* ret = envoy_type_tracing_v3_CustomTag_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* envoy_type_tracing_v3_CustomTag_serialize_ex(const envoy_type_tracing_v3_CustomTag* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, options, arena, len);
}
-
typedef enum {
envoy_type_tracing_v3_CustomTag_type_literal = 2,
envoy_type_tracing_v3_CustomTag_type_environment = 3,
@@ -68,64 +80,98 @@ typedef enum {
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 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(0, 0), int32_t);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_tag(const envoy_type_tracing_v3_CustomTag* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_tag(const envoy_type_tracing_v3_CustomTag* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool envoy_type_tracing_v3_CustomTag_has_literal(const envoy_type_tracing_v3_CustomTag* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_literal(const envoy_type_tracing_v3_CustomTag* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_environment(const envoy_type_tracing_v3_CustomTag* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_request_header(const envoy_type_tracing_v3_CustomTag* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_clear_metadata(const envoy_type_tracing_v3_CustomTag* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), envoy_type_tracing_v3_CustomTag_type_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_tag(envoy_type_tracing_v3_CustomTag *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Literal*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Environment*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Header*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_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_WRITE_ONEOF(msg, envoy_type_tracing_v3_CustomTag_Metadata*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_New(&envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena);
if (!sub) return NULL;
envoy_type_tracing_v3_CustomTag_set_metadata(msg, sub);
}
@@ -134,124 +180,212 @@ UPB_INLINE struct envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_tracing_v3_CustomTag_Literal*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_CustomTag_Literal_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_tracing_v3_CustomTag_Literal* ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Literal_serialize_ex(const envoy_type_tracing_v3_CustomTag_Literal* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, options, arena, len);
}
-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 void envoy_type_tracing_v3_CustomTag_Literal_clear_value(const envoy_type_tracing_v3_CustomTag_Literal* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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;
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Literal_set_value(envoy_type_tracing_v3_CustomTag_Literal *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_type_tracing_v3_CustomTag_Environment*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_CustomTag_Environment_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_tracing_v3_CustomTag_Environment* ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Environment_serialize_ex(const envoy_type_tracing_v3_CustomTag_Environment* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, options, arena, len);
}
-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 void envoy_type_tracing_v3_CustomTag_Environment_clear_name(const envoy_type_tracing_v3_CustomTag_Environment* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_clear_default_value(const envoy_type_tracing_v3_CustomTag_Environment* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_name(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Environment_set_default_value(envoy_type_tracing_v3_CustomTag_Environment *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_type_tracing_v3_CustomTag_Header*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomTag_Header_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_tracing_v3_CustomTag_Header* ret = envoy_type_tracing_v3_CustomTag_Header_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Header_serialize_ex(const envoy_type_tracing_v3_CustomTag_Header* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, options, arena, len);
}
-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 void envoy_type_tracing_v3_CustomTag_Header_clear_name(const envoy_type_tracing_v3_CustomTag_Header* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_clear_default_value(const envoy_type_tracing_v3_CustomTag_Header* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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_name(envoy_type_tracing_v3_CustomTag_Header *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Header_set_default_value(envoy_type_tracing_v3_CustomTag_Header *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (envoy_type_tracing_v3_CustomTag_Metadata*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_CustomTag_Metadata_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_tracing_v3_CustomTag_Metadata* ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* envoy_type_tracing_v3_CustomTag_Metadata_serialize_ex(const envoy_type_tracing_v3_CustomTag_Metadata* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_kind(const envoy_type_tracing_v3_CustomTag_Metadata* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_metadata_key(const envoy_type_tracing_v3_CustomTag_Metadata* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct envoy_type_metadata_v3_MetadataKey*);
+}
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_clear_default_value(const envoy_type_tracing_v3_CustomTag_Metadata* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_tracing_v3_CustomTag_Metadata_default_value(const envoy_type_tracing_v3_CustomTag_Metadata* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
}
-
-UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_kind(const envoy_type_tracing_v3_CustomTag_Metadata *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_type_metadata_v3_MetadataKind*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKind*)_upb_Message_New(&envoy_type_metadata_v3_MetadataKind_msginit, arena);
if (!sub) return NULL;
envoy_type_tracing_v3_CustomTag_Metadata_set_kind(msg, sub);
}
@@ -259,21 +393,23 @@ UPB_INLINE struct envoy_type_metadata_v3_MetadataKind* envoy_type_tracing_v3_Cus
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_type_metadata_v3_MetadataKey*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct envoy_type_metadata_v3_MetadataKey*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_default_value(envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
+extern const upb_MiniTable_File envoy_type_tracing_v3_custom_tag_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c
new file mode 100644
index 00000000..43503147
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c
@@ -0,0 +1,66 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/hash_policy.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/v3/hash_policy.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_MiniTable_Sub envoy_type_v3_HashPolicy_submsgs[2] = {
+ {.submsg = &envoy_type_v3_HashPolicy_SourceIp_msginit},
+ {.submsg = &envoy_type_v3_HashPolicy_FilterState_msginit},
+};
+
+static const upb_MiniTable_Field envoy_type_v3_HashPolicy__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_v3_HashPolicy_msginit = {
+ &envoy_type_v3_HashPolicy_submsgs[0],
+ &envoy_type_v3_HashPolicy__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable_Field envoy_type_v3_HashPolicy_FilterState__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msginit = {
+ NULL,
+ &envoy_type_v3_HashPolicy_FilterState__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_type_v3_HashPolicy_msginit,
+ &envoy_type_v3_HashPolicy_SourceIp_msginit,
+ &envoy_type_v3_HashPolicy_FilterState_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_hash_policy_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h
new file mode 100644
index 00000000..d28b2894
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h
@@ -0,0 +1,201 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/hash_policy.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_HashPolicy;
+struct envoy_type_v3_HashPolicy_SourceIp;
+struct envoy_type_v3_HashPolicy_FilterState;
+typedef struct envoy_type_v3_HashPolicy envoy_type_v3_HashPolicy;
+typedef struct envoy_type_v3_HashPolicy_SourceIp envoy_type_v3_HashPolicy_SourceIp;
+typedef struct envoy_type_v3_HashPolicy_FilterState envoy_type_v3_HashPolicy_FilterState;
+extern const upb_MiniTable envoy_type_v3_HashPolicy_msginit;
+extern const upb_MiniTable envoy_type_v3_HashPolicy_SourceIp_msginit;
+extern const upb_MiniTable envoy_type_v3_HashPolicy_FilterState_msginit;
+
+
+
+/* envoy.type.v3.HashPolicy */
+
+UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_new(upb_Arena* arena) {
+ return (envoy_type_v3_HashPolicy*)_upb_Message_New(&envoy_type_v3_HashPolicy_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy* ret = envoy_type_v3_HashPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy* ret = envoy_type_v3_HashPolicy_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_serialize(const envoy_type_v3_HashPolicy* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_serialize_ex(const envoy_type_v3_HashPolicy* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, options, arena, len);
+}
+typedef enum {
+ envoy_type_v3_HashPolicy_policy_specifier_source_ip = 1,
+ envoy_type_v3_HashPolicy_policy_specifier_filter_state = 2,
+ envoy_type_v3_HashPolicy_policy_specifier_NOT_SET = 0
+} envoy_type_v3_HashPolicy_policy_specifier_oneofcases;
+UPB_INLINE envoy_type_v3_HashPolicy_policy_specifier_oneofcases envoy_type_v3_HashPolicy_policy_specifier_case(const envoy_type_v3_HashPolicy* msg) {
+ return (envoy_type_v3_HashPolicy_policy_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool envoy_type_v3_HashPolicy_has_source_ip(const envoy_type_v3_HashPolicy* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void envoy_type_v3_HashPolicy_clear_source_ip(const envoy_type_v3_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_HashPolicy_policy_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_source_ip(const envoy_type_v3_HashPolicy* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool envoy_type_v3_HashPolicy_has_filter_state(const envoy_type_v3_HashPolicy* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void envoy_type_v3_HashPolicy_clear_filter_state(const envoy_type_v3_HashPolicy* msg) {
+ UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), envoy_type_v3_HashPolicy_policy_specifier_NOT_SET);
+}
+UPB_INLINE const envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_filter_state(const envoy_type_v3_HashPolicy* msg) {
+ return UPB_READ_ONEOF(msg, const envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+
+UPB_INLINE void envoy_type_v3_HashPolicy_set_source_ip(envoy_type_v3_HashPolicy *msg, envoy_type_v3_HashPolicy_SourceIp* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_SourceIp*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_mutable_source_ip(envoy_type_v3_HashPolicy* msg, upb_Arena* arena) {
+ struct envoy_type_v3_HashPolicy_SourceIp* sub = (struct envoy_type_v3_HashPolicy_SourceIp*)envoy_type_v3_HashPolicy_source_ip(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_v3_HashPolicy_set_source_ip(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_v3_HashPolicy_set_filter_state(envoy_type_v3_HashPolicy *msg, envoy_type_v3_HashPolicy_FilterState* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_v3_HashPolicy_FilterState*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_mutable_filter_state(envoy_type_v3_HashPolicy* msg, upb_Arena* arena) {
+ struct envoy_type_v3_HashPolicy_FilterState* sub = (struct envoy_type_v3_HashPolicy_FilterState*)envoy_type_v3_HashPolicy_filter_state(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_v3_HashPolicy_set_filter_state(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.v3.HashPolicy.SourceIp */
+
+UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_new(upb_Arena* arena) {
+ return (envoy_type_v3_HashPolicy_SourceIp*)_upb_Message_New(&envoy_type_v3_HashPolicy_SourceIp_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy_SourceIp* ret = envoy_type_v3_HashPolicy_SourceIp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy_SourceIp* ret = envoy_type_v3_HashPolicy_SourceIp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_SourceIp_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_SourceIp_serialize(const envoy_type_v3_HashPolicy_SourceIp* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_SourceIp_serialize_ex(const envoy_type_v3_HashPolicy_SourceIp* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, options, arena, len);
+}
+
+
+/* envoy.type.v3.HashPolicy.FilterState */
+
+UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_FilterState_new(upb_Arena* arena) {
+ return (envoy_type_v3_HashPolicy_FilterState*)_upb_Message_New(&envoy_type_v3_HashPolicy_FilterState_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_FilterState_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy_FilterState* ret = envoy_type_v3_HashPolicy_FilterState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_FilterState_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_HashPolicy_FilterState* ret = envoy_type_v3_HashPolicy_FilterState_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HashPolicy_FilterState_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_FilterState_serialize(const envoy_type_v3_HashPolicy_FilterState* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_HashPolicy_FilterState_serialize_ex(const envoy_type_v3_HashPolicy_FilterState* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_HashPolicy_FilterState_clear_key(const envoy_type_v3_HashPolicy_FilterState* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView envoy_type_v3_HashPolicy_FilterState_key(const envoy_type_v3_HashPolicy_FilterState* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void envoy_type_v3_HashPolicy_FilterState_set_key(envoy_type_v3_HashPolicy_FilterState *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+extern const upb_MiniTable_File envoy_type_v3_hash_policy_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
index c4a03ae8..44ea84b6 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
@@ -7,11 +7,20 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/http.upb.h"
#include "udpa/annotations/status.upb.h"
#include "upb/port_def.inc"
+const upb_MiniTable_File envoy_type_v3_http_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+};
+
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
index 25b033f2..48c5f2f9 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
#define ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,9 @@ typedef enum {
} envoy_type_v3_CodecClientType;
+
+extern const upb_MiniTable_File envoy_type_v3_http_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c
new file mode 100644
index 00000000..b6585e05
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c
@@ -0,0 +1,42 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http_status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/v3/http_status.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_MiniTable_Field envoy_type_v3_HttpStatus__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_v3_HttpStatus_msginit = {
+ NULL,
+ &envoy_type_v3_HttpStatus__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_v3_HttpStatus_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_http_status_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h
new file mode 100644
index 00000000..fbeab3f6
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h
@@ -0,0 +1,139 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http_status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_HttpStatus;
+typedef struct envoy_type_v3_HttpStatus envoy_type_v3_HttpStatus;
+extern const upb_MiniTable envoy_type_v3_HttpStatus_msginit;
+
+typedef enum {
+ envoy_type_v3_Empty = 0,
+ envoy_type_v3_Continue = 100,
+ envoy_type_v3_OK = 200,
+ envoy_type_v3_Created = 201,
+ envoy_type_v3_Accepted = 202,
+ envoy_type_v3_NonAuthoritativeInformation = 203,
+ envoy_type_v3_NoContent = 204,
+ envoy_type_v3_ResetContent = 205,
+ envoy_type_v3_PartialContent = 206,
+ envoy_type_v3_MultiStatus = 207,
+ envoy_type_v3_AlreadyReported = 208,
+ envoy_type_v3_IMUsed = 226,
+ envoy_type_v3_MultipleChoices = 300,
+ envoy_type_v3_MovedPermanently = 301,
+ envoy_type_v3_Found = 302,
+ envoy_type_v3_SeeOther = 303,
+ envoy_type_v3_NotModified = 304,
+ envoy_type_v3_UseProxy = 305,
+ envoy_type_v3_TemporaryRedirect = 307,
+ envoy_type_v3_PermanentRedirect = 308,
+ envoy_type_v3_BadRequest = 400,
+ envoy_type_v3_Unauthorized = 401,
+ envoy_type_v3_PaymentRequired = 402,
+ envoy_type_v3_Forbidden = 403,
+ envoy_type_v3_NotFound = 404,
+ envoy_type_v3_MethodNotAllowed = 405,
+ envoy_type_v3_NotAcceptable = 406,
+ envoy_type_v3_ProxyAuthenticationRequired = 407,
+ envoy_type_v3_RequestTimeout = 408,
+ envoy_type_v3_Conflict = 409,
+ envoy_type_v3_Gone = 410,
+ envoy_type_v3_LengthRequired = 411,
+ envoy_type_v3_PreconditionFailed = 412,
+ envoy_type_v3_PayloadTooLarge = 413,
+ envoy_type_v3_URITooLong = 414,
+ envoy_type_v3_UnsupportedMediaType = 415,
+ envoy_type_v3_RangeNotSatisfiable = 416,
+ envoy_type_v3_ExpectationFailed = 417,
+ envoy_type_v3_MisdirectedRequest = 421,
+ envoy_type_v3_UnprocessableEntity = 422,
+ envoy_type_v3_Locked = 423,
+ envoy_type_v3_FailedDependency = 424,
+ envoy_type_v3_UpgradeRequired = 426,
+ envoy_type_v3_PreconditionRequired = 428,
+ envoy_type_v3_TooManyRequests = 429,
+ envoy_type_v3_RequestHeaderFieldsTooLarge = 431,
+ envoy_type_v3_InternalServerError = 500,
+ envoy_type_v3_NotImplemented = 501,
+ envoy_type_v3_BadGateway = 502,
+ envoy_type_v3_ServiceUnavailable = 503,
+ envoy_type_v3_GatewayTimeout = 504,
+ envoy_type_v3_HTTPVersionNotSupported = 505,
+ envoy_type_v3_VariantAlsoNegotiates = 506,
+ envoy_type_v3_InsufficientStorage = 507,
+ envoy_type_v3_LoopDetected = 508,
+ envoy_type_v3_NotExtended = 510,
+ envoy_type_v3_NetworkAuthenticationRequired = 511
+} envoy_type_v3_StatusCode;
+
+
+
+/* envoy.type.v3.HttpStatus */
+
+UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_new(upb_Arena* arena) {
+ return (envoy_type_v3_HttpStatus*)_upb_Message_New(&envoy_type_v3_HttpStatus_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_v3_HttpStatus* ret = envoy_type_v3_HttpStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_HttpStatus* ret = envoy_type_v3_HttpStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_HttpStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_v3_HttpStatus_serialize(const envoy_type_v3_HttpStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_HttpStatus_serialize_ex(const envoy_type_v3_HttpStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_HttpStatus_clear_code(const envoy_type_v3_HttpStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_type_v3_HttpStatus_code(const envoy_type_v3_HttpStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+
+UPB_INLINE void envoy_type_v3_HttpStatus_set_code(envoy_type_v3_HttpStatus *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+extern const upb_MiniTable_File envoy_type_v3_http_status_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
index 9e4a87c3..fdb7e4d9 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/percent.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,25 +15,39 @@
#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},
+static const upb_MiniTable_Field envoy_type_v3_Percent__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_Percent_msginit = {
+const upb_MiniTable envoy_type_v3_Percent_msginit = {
NULL,
&envoy_type_v3_Percent__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field envoy_type_v3_FractionalPercent__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field envoy_type_v3_FractionalPercent__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_FractionalPercent_msginit = {
+const upb_MiniTable envoy_type_v3_FractionalPercent_msginit = {
NULL,
&envoy_type_v3_FractionalPercent__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &envoy_type_v3_Percent_msginit,
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_percent_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
index 6155e239..bd05c3b9 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
#define ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,8 +24,8 @@ 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;
+extern const upb_MiniTable envoy_type_v3_Percent_msginit;
+extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
typedef enum {
envoy_type_v3_FractionalPercent_HUNDRED = 0,
@@ -34,27 +34,44 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_Percent*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_Percent* ret = envoy_type_v3_Percent_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Percent_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_Percent_serialize_ex(const envoy_type_v3_Percent* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_Percent_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_Percent_clear_value(const envoy_type_v3_Percent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+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 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;
@@ -62,34 +79,57 @@ UPB_INLINE void envoy_type_v3_Percent_set_value(envoy_type_v3_Percent *msg, doub
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_FractionalPercent*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_FractionalPercent* ret = envoy_type_v3_FractionalPercent_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_FractionalPercent_serialize_ex(const envoy_type_v3_FractionalPercent* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_FractionalPercent_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_FractionalPercent_clear_numerator(const envoy_type_v3_FractionalPercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t);
+}
+UPB_INLINE void envoy_type_v3_FractionalPercent_clear_denominator(const envoy_type_v3_FractionalPercent* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t envoy_type_v3_FractionalPercent_denominator(const envoy_type_v3_FractionalPercent* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-
-UPB_INLINE uint32_t envoy_type_v3_FractionalPercent_numerator(const envoy_type_v3_FractionalPercent *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(4, 4), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+extern const upb_MiniTable_File envoy_type_v3_percent_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
index e4222bef..1f3dd992 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
@@ -7,44 +7,59 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field envoy_type_v3_Int64Range__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_Int64Range_msginit = {
+const upb_MiniTable envoy_type_v3_Int64Range_msginit = {
NULL,
&envoy_type_v3_Int64Range__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_v3_Int32Range__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_Int32Range_msginit = {
+const upb_MiniTable envoy_type_v3_Int32Range_msginit = {
NULL,
&envoy_type_v3_Int32Range__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field envoy_type_v3_DoubleRange__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_DoubleRange_msginit = {
+const upb_MiniTable envoy_type_v3_DoubleRange_msginit = {
NULL,
&envoy_type_v3_DoubleRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &envoy_type_v3_Int64Range_msginit,
+ &envoy_type_v3_Int32Range_msginit,
+ &envoy_type_v3_DoubleRange_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_range_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
index 9ff396d9..44cab47f 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
#define ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,33 +26,55 @@ 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;
+extern const upb_MiniTable envoy_type_v3_Int64Range_msginit;
+extern const upb_MiniTable envoy_type_v3_Int32Range_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_Int64Range*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_Int64Range *ret = envoy_type_v3_Int64Range_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_Int64Range* ret = envoy_type_v3_Int64Range_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_Int64Range_serialize_ex(const envoy_type_v3_Int64Range* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_Int64Range_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_Int64Range_clear_start(const envoy_type_v3_Int64Range* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0;
+}
+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 void envoy_type_v3_Int64Range_clear_end(const envoy_type_v3_Int64Range* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0;
+}
+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 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;
@@ -63,26 +85,47 @@ UPB_INLINE void envoy_type_v3_Int64Range_set_end(envoy_type_v3_Int64Range *msg,
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_Int32Range*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_Int32Range *ret = envoy_type_v3_Int32Range_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_Int32Range* ret = envoy_type_v3_Int32Range_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_Int32Range_serialize_ex(const envoy_type_v3_Int32Range* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_Int32Range_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_Int32Range_clear_start(const envoy_type_v3_Int32Range* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void envoy_type_v3_Int32Range_clear_end(const envoy_type_v3_Int32Range* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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 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;
@@ -93,26 +136,47 @@ UPB_INLINE void envoy_type_v3_Int32Range_set_end(envoy_type_v3_Int32Range *msg,
/* 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_DoubleRange*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_DoubleRange *ret = envoy_type_v3_DoubleRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_DoubleRange* ret = envoy_type_v3_DoubleRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_DoubleRange_serialize_ex(const envoy_type_v3_DoubleRange* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_DoubleRange_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_DoubleRange_clear_start(const envoy_type_v3_DoubleRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+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 void envoy_type_v3_DoubleRange_clear_end(const envoy_type_v3_DoubleRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = 0;
+}
+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 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;
@@ -121,6 +185,8 @@ UPB_INLINE void envoy_type_v3_DoubleRange_set_end(envoy_type_v3_DoubleRange *msg
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
}
+extern const upb_MiniTable_File envoy_type_v3_range_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c
new file mode 100644
index 00000000..4af6515f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c
@@ -0,0 +1,26 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/ratelimit_unit.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/v3/ratelimit_unit.upb.h"
+#include "udpa/annotations/status.upb.h"
+
+#include "upb/port_def.inc"
+
+const upb_MiniTable_File envoy_type_v3_ratelimit_unit_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h
new file mode 100644
index 00000000..4f403d65
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h
@@ -0,0 +1,41 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/ratelimit_unit.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ envoy_type_v3_UNKNOWN = 0,
+ envoy_type_v3_SECOND = 1,
+ envoy_type_v3_MINUTE = 2,
+ envoy_type_v3_HOUR = 3,
+ envoy_type_v3_DAY = 4
+} envoy_type_v3_RateLimitUnit;
+
+
+
+extern const upb_MiniTable_File envoy_type_v3_ratelimit_unit_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
index 8984ac7f..7303c3bd 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
@@ -7,23 +7,36 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field envoy_type_v3_SemanticVersion__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout envoy_type_v3_SemanticVersion_msginit = {
+const upb_MiniTable envoy_type_v3_SemanticVersion_msginit = {
NULL,
&envoy_type_v3_SemanticVersion__fields[0],
- UPB_SIZE(16, 16), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_v3_SemanticVersion_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_semantic_version_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
index e1dd3297..6b432685 100644
--- a/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
#define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,32 +22,59 @@ extern "C" {
struct envoy_type_v3_SemanticVersion;
typedef struct envoy_type_v3_SemanticVersion envoy_type_v3_SemanticVersion;
-extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (envoy_type_v3_SemanticVersion*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- envoy_type_v3_SemanticVersion *ret = envoy_type_v3_SemanticVersion_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_SemanticVersion* ret = envoy_type_v3_SemanticVersion_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_SemanticVersion_serialize_ex(const envoy_type_v3_SemanticVersion* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_SemanticVersion_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_SemanticVersion_clear_major_number(const envoy_type_v3_SemanticVersion* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 void envoy_type_v3_SemanticVersion_clear_minor_number(const envoy_type_v3_SemanticVersion* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+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 void envoy_type_v3_SemanticVersion_clear_patch(const envoy_type_v3_SemanticVersion* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+}
+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 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;
@@ -59,6 +86,8 @@ UPB_INLINE void envoy_type_v3_SemanticVersion_set_patch(envoy_type_v3_SemanticVe
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
}
+extern const upb_MiniTable_File envoy_type_v3_semantic_version_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c b/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c
new file mode 100644
index 00000000..f5b2a2dd
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c
@@ -0,0 +1,51 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/token_bucket.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/v3/token_bucket.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_MiniTable_Sub envoy_type_v3_TokenBucket_submsgs[2] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field envoy_type_v3_TokenBucket__fields[3] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable envoy_type_v3_TokenBucket_msginit = {
+ &envoy_type_v3_TokenBucket_submsgs[0],
+ &envoy_type_v3_TokenBucket__fields[0],
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &envoy_type_v3_TokenBucket_msginit,
+};
+
+const upb_MiniTable_File envoy_type_v3_token_bucket_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h b/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h
new file mode 100644
index 00000000..f942f7a1
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h
@@ -0,0 +1,127 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/token_bucket.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_
+#define ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_v3_TokenBucket;
+typedef struct envoy_type_v3_TokenBucket envoy_type_v3_TokenBucket;
+extern const upb_MiniTable envoy_type_v3_TokenBucket_msginit;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+
+
+
+/* envoy.type.v3.TokenBucket */
+
+UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_new(upb_Arena* arena) {
+ return (envoy_type_v3_TokenBucket*)_upb_Message_New(&envoy_type_v3_TokenBucket_msginit, arena);
+}
+UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse(const char* buf, size_t size, upb_Arena* arena) {
+ envoy_type_v3_TokenBucket* ret = envoy_type_v3_TokenBucket_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ envoy_type_v3_TokenBucket* ret = envoy_type_v3_TokenBucket_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &envoy_type_v3_TokenBucket_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* envoy_type_v3_TokenBucket_serialize(const envoy_type_v3_TokenBucket* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, 0, arena, len);
+}
+UPB_INLINE char* envoy_type_v3_TokenBucket_serialize_ex(const envoy_type_v3_TokenBucket* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, options, arena, len);
+}
+UPB_INLINE void envoy_type_v3_TokenBucket_clear_max_tokens(const envoy_type_v3_TokenBucket* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t envoy_type_v3_TokenBucket_max_tokens(const envoy_type_v3_TokenBucket* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE bool envoy_type_v3_TokenBucket_has_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void envoy_type_v3_TokenBucket_clear_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_v3_TokenBucket_tokens_per_fill(const envoy_type_v3_TokenBucket* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_UInt32Value*);
+}
+UPB_INLINE bool envoy_type_v3_TokenBucket_has_fill_interval(const envoy_type_v3_TokenBucket* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void envoy_type_v3_TokenBucket_clear_fill_interval(const envoy_type_v3_TokenBucket* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* envoy_type_v3_TokenBucket_fill_interval(const envoy_type_v3_TokenBucket* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_Duration*);
+}
+
+UPB_INLINE void envoy_type_v3_TokenBucket_set_max_tokens(envoy_type_v3_TokenBucket *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
+}
+UPB_INLINE void envoy_type_v3_TokenBucket_set_tokens_per_fill(envoy_type_v3_TokenBucket *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_v3_TokenBucket_mutable_tokens_per_fill(envoy_type_v3_TokenBucket* msg, upb_Arena* arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_v3_TokenBucket_tokens_per_fill(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_v3_TokenBucket_set_tokens_per_fill(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_v3_TokenBucket_set_fill_interval(envoy_type_v3_TokenBucket *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_type_v3_TokenBucket_mutable_fill_interval(envoy_type_v3_TokenBucket* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_type_v3_TokenBucket_fill_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_v3_TokenBucket_set_fill_interval(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File envoy_type_v3_token_bucket_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c b/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
index a1385cc3..c446cfd2 100644
--- a/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
@@ -7,12 +7,34 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/annotations.upb.h"
#include "google/api/http.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_MiniTable google_api_HttpRule_msginit;
+extern const upb_MiniTable google_protobuf_MethodOptions_msginit;
+const upb_MiniTable_Extension google_api_http_ext = {
+ {72295728, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MethodOptions_msginit,
+ {.submsg = &google_api_HttpRule_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &google_api_http_ext,
+};
+
+const upb_MiniTable_File google_api_annotations_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ extensions_layout,
+ 0,
+ 0,
+ 1,
+};
+
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h b/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
index fcbe640d..30b3d2dd 100644
--- a/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_
#define GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,29 @@
extern "C" {
#endif
+extern const upb_MiniTable_Extension google_api_http_ext;
+struct google_protobuf_MethodOptions;
+extern const upb_MiniTable google_protobuf_MethodOptions_msginit;
+
+
+UPB_INLINE bool google_api_has_http(const struct google_protobuf_MethodOptions* msg) {
+ return _upb_Message_Getext(msg, &google_api_http_ext) != NULL;
+}
+UPB_INLINE void google_api_clear_http(struct google_protobuf_MethodOptions* msg) {
+ _upb_Message_Clearext(msg, &google_api_http_ext);
+}
+UPB_INLINE const struct google_api_HttpRule* google_api_http(const struct google_protobuf_MethodOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &google_api_http_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const struct google_api_HttpRule*);
+}
+UPB_INLINE void google_api_set_http(struct google_protobuf_MethodOptions* msg, const struct google_api_HttpRule* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &google_api_http_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const struct google_api_HttpRule*) = ext;
+}
+extern const upb_MiniTable_File google_api_annotations_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
index 16fd52a0..47168707 100644
--- a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/expr/v1alpha1/checked.upb.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "google/protobuf/empty.upb.h"
@@ -15,227 +15,256 @@
#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_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = {
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr__fields[4] = {
- {2, UPB_SIZE(12, 24), 0, 0, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(16, 32), 0, 1, 11, _UPB_LABEL_MAP},
- {4, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {5, UPB_SIZE(8, 16), 2, 3, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr__fields[4] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit = {
&google_api_expr_v1alpha1_CheckedExpr_submsgs[0],
&google_api_expr_v1alpha1_CheckedExpr__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Reference_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit = {
+const upb_MiniTable 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, 255,
-};
-
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_submsgs[6] = {
- &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 = {
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_submsgs[7] = {
+ {.submsg = &google_protobuf_Empty_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_ListType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_MapType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_FunctionType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &google_protobuf_Empty_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_AbstractType_msginit},
+};
+
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Type__fields[13] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 13, kUpb_ExtMode_NonExtendable, 12, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_ListType__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_ListType__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit = {
+const upb_MiniTable 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(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_MapType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_MapType_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_MapType__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_MapType__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_FunctionType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit = {
+const upb_MiniTable 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(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_AbstractType__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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_MiniTable_Sub google_api_expr_v1alpha1_Decl_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Decl_IdentDecl_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Decl_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &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), 1, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(32, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Reference_submsgs[1] = {
- &google_api_expr_v1alpha1_Constant_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Reference_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Reference__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Reference__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Reference_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_Reference_msginit = {
&google_api_expr_v1alpha1_Reference_submsgs[0],
&google_api_expr_v1alpha1_Reference__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[13] = {
+ &google_api_expr_v1alpha1_CheckedExpr_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
+ &google_api_expr_v1alpha1_Type_msginit,
+ &google_api_expr_v1alpha1_Type_ListType_msginit,
+ &google_api_expr_v1alpha1_Type_MapType_msginit,
+ &google_api_expr_v1alpha1_Type_FunctionType_msginit,
+ &google_api_expr_v1alpha1_Type_AbstractType_msginit,
+ &google_api_expr_v1alpha1_Decl_msginit,
+ &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
+ &google_api_expr_v1alpha1_Reference_msginit,
+};
+
+const upb_MiniTable_File google_api_expr_v1alpha1_checked_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 13,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
index 43a88f70..d7398c3d 100644
--- a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -46,27 +46,27 @@ typedef struct google_api_expr_v1alpha1_Decl_IdentDecl google_api_expr_v1alpha1_
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;
+extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Type_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Type_ListType_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Type_MapType_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Type_FunctionType_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Type_AbstractType_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Decl_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Decl_IdentDecl_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit;
+extern const upb_MiniTable google_protobuf_Empty_msginit;
typedef enum {
google_api_expr_v1alpha1_Type_PRIMITIVE_TYPE_UNSPECIFIED = 0,
@@ -86,55 +86,115 @@ typedef enum {
} 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 google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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(12, 24)); }
-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(12, 24)); }
-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(12, 24), &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(12, 24), 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(16, 32)); }
-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(16, 32)); }
-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(16, 32), &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(16, 32), iter); }
-UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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(12, 24)); }
-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(12, 24), &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(12, 24), &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(12, 24), 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(16, 32)); }
-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(16, 32), &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(16, 32), &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(16, 32), iter); }
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_CheckedExpr_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_CheckedExpr_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_CheckedExpr* ret = google_api_expr_v1alpha1_CheckedExpr_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_CheckedExpr_serialize_ex(const google_api_expr_v1alpha1_CheckedExpr* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, options, 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(4, 8));
+}
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_reference_map(const google_api_expr_v1alpha1_CheckedExpr* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8));
+}
+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(4, 8), &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(4, 8), 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(8, 16));
+}
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_type_map(const google_api_expr_v1alpha1_CheckedExpr* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16));
+}
+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(8, 16), &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(8, 16), iter);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_CheckedExpr_has_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_expr(const google_api_expr_v1alpha1_CheckedExpr* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), 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_hasbit(msg, 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_clear_source_info(const google_api_expr_v1alpha1_CheckedExpr* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), 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(4, 8)); }
+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(4, 8), &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(4, 8), &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(4, 8), 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(8, 16)); }
+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(8, 16), &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(8, 16), &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(8, 16), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_api_expr_v1alpha1_Expr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_CheckedExpr_set_expr(msg, sub);
}
@@ -142,12 +202,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Checke
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_api_expr_v1alpha1_SourceInfo*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_CheckedExpr_set_source_info(msg, sub);
}
@@ -156,13 +216,15 @@ UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_
/* 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) {
+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) {
+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;
@@ -174,13 +236,15 @@ UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_set_value
/* 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) {
+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) {
+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;
@@ -192,24 +256,35 @@ UPB_INLINE void google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_set_value(goog
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Type*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Type* ret = google_api_expr_v1alpha1_Type_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* google_api_expr_v1alpha1_Type_serialize_ex(const google_api_expr_v1alpha1_Type* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Type_msginit, options, arena, len);
}
-
typedef enum {
google_api_expr_v1alpha1_Type_type_kind_dyn = 1,
google_api_expr_v1alpha1_Type_type_kind_null = 2,
@@ -226,132 +301,224 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_dyn(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_null(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_primitive(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_wrapper(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_well_known(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_list_type(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_map_type(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 8;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_function(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_message_type(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Type_message_type(const google_api_expr_v1alpha1_Type* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 9, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type_param(const google_api_expr_v1alpha1_Type* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 10;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type_param(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Type_type_param(const google_api_expr_v1alpha1_Type* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 10, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Type_has_type(const google_api_expr_v1alpha1_Type* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 11;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_type(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 12;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_error(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 14;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_clear_abstract_type(const google_api_expr_v1alpha1_Type* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Type_type_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_dyn(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Empty*)_upb_Message_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_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, int32_t, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_ListType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type_ListType*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_MapType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type_MapType*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_FunctionType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_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_message_type(google_api_expr_v1alpha1_Type *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_param(google_api_expr_v1alpha1_Type *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_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_WRITE_ONEOF(msg, struct google_protobuf_Empty*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 12);
}
-UPB_INLINE struct google_protobuf_Empty* google_api_expr_v1alpha1_Type_mutable_error(google_api_expr_v1alpha1_Type *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Empty*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Type_AbstractType*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_New(&google_api_expr_v1alpha1_Type_AbstractType_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Type_set_abstract_type(msg, sub);
}
@@ -360,35 +527,53 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Type_ListType*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type_ListType_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Type_ListType* ret = google_api_expr_v1alpha1_Type_ListType_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_Type_ListType_serialize_ex(const google_api_expr_v1alpha1_Type_ListType* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, options, arena, len);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Type_ListType_has_elem_type(const google_api_expr_v1alpha1_Type_ListType* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_ListType_clear_elem_type(const google_api_expr_v1alpha1_Type_ListType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const google_api_expr_v1alpha1_Type*);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_ListType_has_elem_type(const google_api_expr_v1alpha1_Type_ListType *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_sethas(msg, 1);
*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_ListType_mutable_elem_type(google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Type_ListType_set_elem_type(msg, sub);
}
@@ -397,37 +582,62 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_L
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Type_MapType*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_MapType_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Type_MapType* ret = google_api_expr_v1alpha1_Type_MapType_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_Type_MapType_serialize_ex(const google_api_expr_v1alpha1_Type_MapType* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, options, arena, len);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_key_type(const google_api_expr_v1alpha1_Type_MapType* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_key_type(const google_api_expr_v1alpha1_Type_MapType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_clear_value_type(const google_api_expr_v1alpha1_Type_MapType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const google_api_expr_v1alpha1_Type*);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_MapType_has_key_type(const google_api_expr_v1alpha1_Type_MapType *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*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_key_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Type_MapType_set_key_type(msg, sub);
}
@@ -437,10 +647,10 @@ UPB_INLINE void google_api_expr_v1alpha1_Type_MapType_set_value_type(google_api_
_upb_sethas(msg, 2);
*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_Type_MapType_mutable_value_type(google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Type_MapType_set_value_type(msg, sub);
}
@@ -449,152 +659,229 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_M
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Type_FunctionType*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_Type_FunctionType_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Type_FunctionType* ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_expr_v1alpha1_Type_FunctionType_serialize_ex(const google_api_expr_v1alpha1_Type_FunctionType* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_result_type(const google_api_expr_v1alpha1_Type_FunctionType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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(8, 16));
+}
+UPB_INLINE void google_api_expr_v1alpha1_Type_FunctionType_clear_arg_types(const google_api_expr_v1alpha1_Type_FunctionType* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Type_FunctionType_has_result_type(const google_api_expr_v1alpha1_Type_FunctionType *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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(8, 16)); }
-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(8, 16), 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_sethas(msg, 1);
*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_FunctionType_mutable_result_type(google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_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) {
+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(8, 16), 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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Type_AbstractType*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_Type_AbstractType_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Type_AbstractType* ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_expr_v1alpha1_Type_AbstractType_serialize_ex(const google_api_expr_v1alpha1_Type_AbstractType* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, options, arena, len);
}
-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 void google_api_expr_v1alpha1_Type_AbstractType_clear_name(const google_api_expr_v1alpha1_Type_AbstractType* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+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 void google_api_expr_v1alpha1_Type_AbstractType_clear_parameter_types(const google_api_expr_v1alpha1_Type_AbstractType* msg) {
+ _upb_array_detach(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 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 void google_api_expr_v1alpha1_Type_AbstractType_set_name(google_api_expr_v1alpha1_Type_AbstractType *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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) {
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Decl*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Decl* ret = google_api_expr_v1alpha1_Decl_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* google_api_expr_v1alpha1_Decl_serialize_ex(const google_api_expr_v1alpha1_Decl* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msginit, options, 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 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(0, 0), int32_t);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_name(const google_api_expr_v1alpha1_Decl* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_name(const google_api_expr_v1alpha1_Decl* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_has_ident(const google_api_expr_v1alpha1_Decl* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_ident(const google_api_expr_v1alpha1_Decl* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_clear_function(const google_api_expr_v1alpha1_Decl* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Decl_decl_kind_NOT_SET);
+}
+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(12, 24), UPB_SIZE(0, 0), 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_name(google_api_expr_v1alpha1_Decl *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_IdentDecl*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Decl_FunctionDecl*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Decl_set_function(msg, sub);
}
@@ -603,38 +890,68 @@ UPB_INLINE struct google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Decl_IdentDecl*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Decl_IdentDecl_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Decl_IdentDecl* ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_expr_v1alpha1_Decl_IdentDecl_serialize_ex(const google_api_expr_v1alpha1_Decl_IdentDecl* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, options, arena, len);
}
-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_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_type(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_value(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const struct google_api_expr_v1alpha1_Constant*);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_clear_doc(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_IdentDecl_doc(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_type(const google_api_expr_v1alpha1_Decl_IdentDecl *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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_hasbit(msg, 2); }
-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(16, 32), 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(4, 8), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), 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_Decl_IdentDecl_mutable_type(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Decl_IdentDecl_set_type(msg, sub);
}
@@ -642,121 +959,181 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_I
}
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_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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_Decl_IdentDecl_mutable_value(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void google_api_expr_v1alpha1_Decl_IdentDecl_set_doc(google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_Decl_FunctionDecl_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Decl_FunctionDecl* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_expr_v1alpha1_Decl_FunctionDecl_serialize_ex(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, options, arena, len);
}
-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 void google_api_expr_v1alpha1_Decl_FunctionDecl_clear_overloads(const google_api_expr_v1alpha1_Decl_FunctionDecl* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Decl_FunctionDecl_Overload*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_serialize_ex(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, options, arena, len);
}
-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 void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_overload_id(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+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(12, 24));
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_type_params(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), 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_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_result_type(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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 void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_is_instance_function(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_clear_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_doc(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
}
-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_hasbit(msg, 1); }
-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(1, 1), 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 void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_overload_id(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_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(12, 24), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &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_StringView* google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_mutable_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* 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_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_add_type_params(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &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_sethas(msg, 1);
*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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Type*)_upb_Message_New(&google_api_expr_v1alpha1_Type_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_result_type(msg, sub);
}
@@ -765,62 +1142,91 @@ UPB_INLINE struct google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Decl_F
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(1, 1), 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;
+UPB_INLINE void google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_set_doc(google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Reference*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Reference_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Reference* ret = google_api_expr_v1alpha1_Reference_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_Reference_serialize_ex(const google_api_expr_v1alpha1_Reference* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_name(const google_api_expr_v1alpha1_Reference* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Reference_name(const google_api_expr_v1alpha1_Reference* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_overload_id(const google_api_expr_v1alpha1_Reference* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE upb_StringView const* google_api_expr_v1alpha1_Reference_overload_id(const google_api_expr_v1alpha1_Reference* msg, size_t* len) {
+ return (upb_StringView 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_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Reference_clear_value(const google_api_expr_v1alpha1_Reference* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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(16, 32), const struct google_api_expr_v1alpha1_Constant*);
}
-UPB_INLINE upb_strview google_api_expr_v1alpha1_Reference_name(const google_api_expr_v1alpha1_Reference *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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(16, 32), len); }
-UPB_INLINE bool google_api_expr_v1alpha1_Reference_has_value(const google_api_expr_v1alpha1_Reference *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+UPB_INLINE void google_api_expr_v1alpha1_Reference_set_name(google_api_expr_v1alpha1_Reference *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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(16, 32), len);
+UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_mutable_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* google_api_expr_v1alpha1_Reference_resize_overload_id(google_api_expr_v1alpha1_Reference* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_api_expr_v1alpha1_Reference_add_overload_id(google_api_expr_v1alpha1_Reference* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_api_expr_v1alpha1_Constant*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_New(&google_api_expr_v1alpha1_Constant_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Reference_set_value(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File google_api_expr_v1alpha1_checked_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
index 4bbf5758..ac2cacd3 100644
--- a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/struct.upb.h"
@@ -15,236 +15,268 @@
#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_MiniTable_Sub google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_ParsedExpr__fields[2] = {
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_ParsedExpr__fields[2] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit = {
&google_api_expr_v1alpha1_ParsedExpr_submsgs[0],
&google_api_expr_v1alpha1_ParsedExpr__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-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_MiniTable_Sub google_api_expr_v1alpha1_Expr_submsgs[7] = {
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Ident_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Select_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Call_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_CreateList_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Comprehension_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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr__fields[8] = {
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 8, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Ident__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Ident__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msginit = {
NULL,
&google_api_expr_v1alpha1_Expr_Ident__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Select__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Select__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Call_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Call_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Call__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Call__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit = {
+const upb_MiniTable 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(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit = {
+const upb_MiniTable 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(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {2, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 9, 1},
- {3, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 11, 1},
- {4, UPB_SIZE(16, 16), 1, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = {
+ {1, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit = {
+const upb_MiniTable 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(32, 48), 4, false, 255,
+ UPB_SIZE(32, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Comprehension_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Comprehension_submsgs[5] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(24, 48), 2, 0, 11, 1},
- {5, UPB_SIZE(28, 56), 3, 0, 11, 1},
- {6, UPB_SIZE(32, 64), 4, 0, 11, 1},
- {7, UPB_SIZE(36, 72), 5, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 64), UPB_SIZE(4, 4), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 72), UPB_SIZE(5, 5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(40, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Constant_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_Constant_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_Constant__fields[9] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_Constant_msginit = {
+const upb_MiniTable 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, 255,
+ UPB_SIZE(16, 24), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_submsgs[2] = {
- &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit,
- &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_SourceInfo_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo__fields[5] = {
- {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, 1, 11, _UPB_LABEL_MAP},
- {5, UPB_SIZE(24, 48), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo__fields[5] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit = {
&google_api_expr_v1alpha1_SourceInfo_submsgs[0],
&google_api_expr_v1alpha1_SourceInfo__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = {
NULL,
&google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_MiniTable_Sub google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
-static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit = {
&google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[0],
&google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-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},
+static const upb_MiniTable_Field google_api_expr_v1alpha1_SourcePosition__fields[4] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit = {
+const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msginit = {
NULL,
&google_api_expr_v1alpha1_SourcePosition__fields[0],
- UPB_SIZE(24, 32), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[14] = {
+ &google_api_expr_v1alpha1_ParsedExpr_msginit,
+ &google_api_expr_v1alpha1_Expr_msginit,
+ &google_api_expr_v1alpha1_Expr_Ident_msginit,
+ &google_api_expr_v1alpha1_Expr_Select_msginit,
+ &google_api_expr_v1alpha1_Expr_Call_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateList_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
+ &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
+ &google_api_expr_v1alpha1_Constant_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit,
+ &google_api_expr_v1alpha1_SourcePosition_msginit,
+};
+
+const upb_MiniTable_File google_api_expr_v1alpha1_syntax_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 14,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
index ffa7925a..6867838d 100644
--- a/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -48,59 +48,85 @@ typedef struct google_api_expr_v1alpha1_SourceInfo google_api_expr_v1alpha1_Sour
typedef struct google_api_expr_v1alpha1_SourceInfo_PositionsEntry google_api_expr_v1alpha1_SourceInfo_PositionsEntry;
typedef struct google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry;
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_SourceInfo_MacroCallsEntry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Select_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Call_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateList_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Expr_Comprehension_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_Constant_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit;
+extern const upb_MiniTable google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit;
+extern const upb_MiniTable 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;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedExpr_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_ParsedExpr* ret = google_api_expr_v1alpha1_ParsedExpr_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_ParsedExpr_serialize_ex(const google_api_expr_v1alpha1_ParsedExpr* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, options, arena, len);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), 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_hasbit(msg, 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_clear_source_info(const google_api_expr_v1alpha1_ParsedExpr* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const google_api_expr_v1alpha1_SourceInfo*);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), 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_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_ParsedExpr_set_expr(msg, sub);
}
@@ -110,10 +136,10 @@ UPB_INLINE void google_api_expr_v1alpha1_ParsedExpr_set_source_info(google_api_e
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_SourceInfo*)_upb_Message_New(&google_api_expr_v1alpha1_SourceInfo_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_ParsedExpr_set_source_info(msg, sub);
}
@@ -122,24 +148,35 @@ UPB_INLINE struct google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr* ret = google_api_expr_v1alpha1_Expr_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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);
+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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_serialize_ex(const google_api_expr_v1alpha1_Expr* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msginit, options, arena, len);
}
-
typedef enum {
google_api_expr_v1alpha1_Expr_expr_kind_const_expr = 3,
google_api_expr_v1alpha1_Expr_expr_kind_ident_expr = 4,
@@ -150,106 +187,161 @@ typedef enum {
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 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(0, 0), int32_t);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_id(const google_api_expr_v1alpha1_Expr* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0;
+}
+UPB_INLINE int64_t google_api_expr_v1alpha1_Expr_id(const google_api_expr_v1alpha1_Expr* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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(0, 0)) == 3;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_const_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 4;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_ident_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 5;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_select_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_call_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 7;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_list_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 8;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_struct_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_clear_comprehension_expr(const google_api_expr_v1alpha1_Expr* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Expr_expr_kind_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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_PTR_AT(msg, UPB_SIZE(8, 16), 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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Constant*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Constant*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Ident*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Select*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_Select*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Call*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_Call*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_CreateStruct*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_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_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr_Comprehension*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_set_comprehension_expr(msg, sub);
}
@@ -258,70 +350,114 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_Ident*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Ident_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_Ident* ret = google_api_expr_v1alpha1_Expr_Ident_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_Ident_serialize_ex(const google_api_expr_v1alpha1_Expr_Ident* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_clear_name(const google_api_expr_v1alpha1_Expr_Ident* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
}
-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;
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Ident_set_name(google_api_expr_v1alpha1_Expr_Ident *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_Select*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_Select_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_Select* ret = google_api_expr_v1alpha1_Expr_Select_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_Select_serialize_ex(const google_api_expr_v1alpha1_Expr_Select* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, options, arena, len);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_operand(const google_api_expr_v1alpha1_Expr_Select* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const google_api_expr_v1alpha1_Expr*);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_field(const google_api_expr_v1alpha1_Expr_Select* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Select_field(const google_api_expr_v1alpha1_Expr_Select* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_clear_test_only(const google_api_expr_v1alpha1_Expr_Select* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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(1, 1), bool);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select *msg) { return _upb_hasbit(msg, 1); }
-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(1, 1), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_api_expr_v1alpha1_Expr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_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_field(google_api_expr_v1alpha1_Expr_Select *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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(1, 1), bool) = value;
@@ -329,186 +465,292 @@ UPB_INLINE void google_api_expr_v1alpha1_Expr_Select_set_test_only(google_api_ex
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_Call*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Call_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_Call* ret = google_api_expr_v1alpha1_Expr_Call_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_Call_serialize_ex(const google_api_expr_v1alpha1_Expr_Call* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, options, arena, len);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_target(const google_api_expr_v1alpha1_Expr_Call* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const google_api_expr_v1alpha1_Expr*);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_function(const google_api_expr_v1alpha1_Expr_Call* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Call_function(const google_api_expr_v1alpha1_Expr_Call* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+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(16, 32));
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_clear_args(const google_api_expr_v1alpha1_Expr_Call* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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(16, 32), len);
}
-
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), 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(16, 32)); }
-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(16, 32), 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), google_api_expr_v1alpha1_Expr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_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(4, 8), upb_strview) = value;
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Call_set_function(google_api_expr_v1alpha1_Expr_Call *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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) {
+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(16, 32), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateList*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Expr_CreateList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_CreateList* ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_Expr_CreateList_serialize_ex(const google_api_expr_v1alpha1_Expr_CreateList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, options, 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 void google_api_expr_v1alpha1_Expr_CreateList_clear_elements(const google_api_expr_v1alpha1_Expr_CreateList* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_Expr_CreateStruct_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_CreateStruct* ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_Expr_CreateStruct_serialize_ex(const google_api_expr_v1alpha1_Expr_CreateStruct* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_clear_message_name(const google_api_expr_v1alpha1_Expr_CreateStruct* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView 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_StringView);
+}
+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 void google_api_expr_v1alpha1_Expr_CreateStruct_clear_entries(const google_api_expr_v1alpha1_Expr_CreateStruct* msg) {
+ _upb_array_detach(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 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 void google_api_expr_v1alpha1_Expr_CreateStruct_set_message_name(google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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) {
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_CreateStruct_Entry*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_CreateStruct_Entry* ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_CreateStruct_Entry_serialize_ex(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, options, 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(28, 40), 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(8, 8), 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(28, 40)) == 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(20, 24), UPB_SIZE(28, 40), 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(28, 40)) == 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(20, 24), UPB_SIZE(28, 40), 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_hasbit(msg, 1); }
-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(16, 16), const google_api_expr_v1alpha1_Expr*); }
+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(4, 4), int32_t);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_id(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+}
+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(24, 32), 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(4, 4)) == 2;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_CreateStruct_Entry_field_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString(""));
+}
+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(4, 4)) == 3;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_map_key(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(4, 4), 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_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_clear_value(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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(16, 24), 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(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), 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(20, 24), value, UPB_SIZE(28, 40), 2);
+UPB_INLINE void google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_field_key(google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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(20, 24), value, UPB_SIZE(28, 40), 3);
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_Expr*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_map_key(msg, sub);
}
@@ -516,12 +758,12 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_C
}
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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), google_api_expr_v1alpha1_Expr*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_CreateStruct_Entry_set_value(msg, sub);
}
@@ -530,64 +772,120 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_C
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Expr_Comprehension*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? ret : NULL;
+UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1_Expr_Comprehension_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Expr_Comprehension* ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 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, 0, arena, len);
+}
+UPB_INLINE char* google_api_expr_v1alpha1_Expr_Comprehension_serialize_ex(const google_api_expr_v1alpha1_Expr_Comprehension* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_iter_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Comprehension_iter_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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(12, 24), const google_api_expr_v1alpha1_Expr*);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Expr_Comprehension_accu_var(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+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(24, 48), 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_hasbit(msg, 3);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_condition(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+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(28, 56), 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_hasbit(msg, 4);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_loop_step(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+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(32, 64), 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_hasbit(msg, 5);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_clear_result(const google_api_expr_v1alpha1_Expr_Comprehension* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const upb_Message*) = NULL;
+}
+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(36, 72), const google_api_expr_v1alpha1_Expr*);
}
-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(4, 8), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_iter_range(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_hasbit(msg, 1); }
-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(20, 40), 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(12, 24), upb_strview); }
-UPB_INLINE bool google_api_expr_v1alpha1_Expr_Comprehension_has_accu_init(const google_api_expr_v1alpha1_Expr_Comprehension *msg) { return _upb_hasbit(msg, 2); }
-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(24, 48), 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_hasbit(msg, 3); }
-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(28, 56), 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_hasbit(msg, 4); }
-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(32, 64), 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_hasbit(msg, 5); }
-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(36, 72), 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(4, 8), upb_strview) = value;
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_iter_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), 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_Comprehension_mutable_iter_range(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_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(12, 24), upb_strview) = value;
+UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_accu_var(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = 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_sethas(msg, 2);
*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_accu_init(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_Comprehension_set_accu_init(msg, sub);
}
@@ -597,10 +895,10 @@ UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(g
_upb_sethas(msg, 3);
*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_condition(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_Comprehension_set_loop_condition(msg, sub);
}
@@ -610,10 +908,10 @@ UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(google
_upb_sethas(msg, 4);
*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_loop_step(google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_Comprehension_set_loop_step(msg, sub);
}
@@ -623,10 +921,10 @@ UPB_INLINE void google_api_expr_v1alpha1_Expr_Comprehension_set_result(google_ap
_upb_sethas(msg, 5);
*UPB_PTR_AT(msg, UPB_SIZE(36, 72), 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) {
+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);
+ sub = (struct google_api_expr_v1alpha1_Expr*)_upb_Message_New(&google_api_expr_v1alpha1_Expr_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Expr_Comprehension_set_result(msg, sub);
}
@@ -635,24 +933,35 @@ UPB_INLINE struct google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_C
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_Constant*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_Constant* ret = google_api_expr_v1alpha1_Constant_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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);
+UPB_INLINE char* google_api_expr_v1alpha1_Constant_serialize_ex(const google_api_expr_v1alpha1_Constant* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msginit, options, arena, len);
}
-
typedef enum {
google_api_expr_v1alpha1_Constant_constant_kind_null_value = 1,
google_api_expr_v1alpha1_Constant_constant_kind_bool_value = 2,
@@ -665,67 +974,131 @@ typedef enum {
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 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(0, 0), 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(0, 0)) == 1;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_null_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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(0, 0)) == 2;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bool_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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(0, 0)) == 3;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_int64_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 3, _upb_Int64_FromLL(0ll));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_uint64_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_uint64_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 4, _upb_UInt64_FromULL(0ull));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_double_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_double_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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(0, 0)) == 6;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_string_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Constant_string_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 6, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_bytes_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 7;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_bytes_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_Constant_bytes_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 7, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_Constant_has_duration_value(const google_api_expr_v1alpha1_Constant* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_duration_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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(0, 0)) == 9;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Constant_clear_timestamp_value(const google_api_expr_v1alpha1_Constant* msg) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_api_expr_v1alpha1_Constant_constant_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, int64_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_string_value(google_api_expr_v1alpha1_Constant *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_bytes_value(google_api_expr_v1alpha1_Constant *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 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_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 8);
}
-UPB_INLINE struct google_protobuf_Duration* google_api_expr_v1alpha1_Constant_mutable_duration_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Duration*)_upb_Message_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_WRITE_ONEOF(msg, struct google_protobuf_Timestamp*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 9);
}
-UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_mutable_timestamp_value(google_api_expr_v1alpha1_Constant *msg, upb_arena *arena) {
+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);
+ sub = (struct google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
google_api_expr_v1alpha1_Constant_set_timestamp_value(msg, sub);
}
@@ -734,69 +1107,128 @@ UPB_INLINE struct google_protobuf_Timestamp* google_api_expr_v1alpha1_Constant_m
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_SourceInfo*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceInfo_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_SourceInfo* ret = google_api_expr_v1alpha1_SourceInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_SourceInfo_serialize_ex(const google_api_expr_v1alpha1_SourceInfo* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_syntax_version(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourceInfo_syntax_version(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_location(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourceInfo_location(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_line_offsets(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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 void google_api_expr_v1alpha1_SourceInfo_clear_positions(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ _upb_array_detach(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 bool google_api_expr_v1alpha1_SourceInfo_has_macro_calls(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_clear_macro_calls(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_macro_calls_size(const google_api_expr_v1alpha1_SourceInfo* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_get(const google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, google_api_expr_v1alpha1_Expr** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(24, 48), &key, sizeof(key), val, sizeof(*val));
+}
+UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_next(const google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) {
+ return (const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter);
}
-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 bool google_api_expr_v1alpha1_SourceInfo_has_macro_calls(const google_api_expr_v1alpha1_SourceInfo *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE size_t google_api_expr_v1alpha1_SourceInfo_macro_calls_size(const google_api_expr_v1alpha1_SourceInfo *msg) {return _upb_msg_map_size(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_get(const google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, google_api_expr_v1alpha1_Expr* *val) { return _upb_msg_map_get(msg, UPB_SIZE(24, 48), &key, sizeof(key), val, sizeof(*val)); }
-UPB_INLINE const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_next(const google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), 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_syntax_version(google_api_expr_v1alpha1_SourceInfo *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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 void google_api_expr_v1alpha1_SourceInfo_set_location(google_api_expr_v1alpha1_SourceInfo *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
-UPB_INLINE int32_t* google_api_expr_v1alpha1_SourceInfo_mutable_line_offsets(google_api_expr_v1alpha1_SourceInfo *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(16, 32), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, 2, 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_accessor2(msg, UPB_SIZE(16, 32), 2, &val, 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_accessor2(msg, UPB_SIZE(16, 32), 2, &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);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_macro_calls_clear(google_api_expr_v1alpha1_SourceInfo* msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_set(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key, google_api_expr_v1alpha1_Expr* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(24, 48), &key, sizeof(key), &val, sizeof(val), a);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_delete(google_api_expr_v1alpha1_SourceInfo* msg, int64_t key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(24, 48), &key, sizeof(key));
+}
+UPB_INLINE google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_nextmutable(google_api_expr_v1alpha1_SourceInfo* msg, size_t* iter) {
+ return (google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), iter);
}
-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); }
-UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_macro_calls_clear(google_api_expr_v1alpha1_SourceInfo *msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_set(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key, google_api_expr_v1alpha1_Expr* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(24, 48), &key, sizeof(key), &val, sizeof(val), a); }
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_macro_calls_delete(google_api_expr_v1alpha1_SourceInfo *msg, int64_t key) { return _upb_msg_map_delete(msg, UPB_SIZE(24, 48), &key, sizeof(key)); }
-UPB_INLINE google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* google_api_expr_v1alpha1_SourceInfo_macro_calls_nextmutable(google_api_expr_v1alpha1_SourceInfo *msg, size_t* iter) { return (google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 48), 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) {
+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) {
+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;
@@ -808,13 +1240,15 @@ UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_PositionsEntry_set_value(goo
/* google.api.expr.v1alpha1.SourceInfo.MacroCallsEntry */
-UPB_INLINE int64_t google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_key(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry *msg) {
+UPB_INLINE int64_t google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_key(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) {
int64_t ret;
_upb_msg_map_key(msg, &ret, sizeof(ret));
return ret;
}
-UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_has_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry *msg) {
+UPB_INLINE bool google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_has_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_value(const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry* msg) {
google_api_expr_v1alpha1_Expr* ret;
_upb_msg_map_value(msg, &ret, sizeof(ret));
return ret;
@@ -826,31 +1260,62 @@ UPB_INLINE void google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_set_value(go
/* 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_new(upb_Arena* arena) {
+ return (google_api_expr_v1alpha1_SourcePosition*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_SourcePosition_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_expr_v1alpha1_SourcePosition* ret = google_api_expr_v1alpha1_SourcePosition_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- 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, options))
- ? 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, 0, arena, len);
}
-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 char* google_api_expr_v1alpha1_SourcePosition_serialize_ex(const google_api_expr_v1alpha1_SourcePosition* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_location(const google_api_expr_v1alpha1_SourcePosition* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_expr_v1alpha1_SourcePosition_location(const google_api_expr_v1alpha1_SourcePosition* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
+}
+UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_clear_offset(const google_api_expr_v1alpha1_SourcePosition* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void google_api_expr_v1alpha1_SourcePosition_clear_line(const google_api_expr_v1alpha1_SourcePosition* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+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 void google_api_expr_v1alpha1_SourcePosition_clear_column(const google_api_expr_v1alpha1_SourcePosition* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+}
+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 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_location(google_api_expr_v1alpha1_SourcePosition *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = 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;
@@ -862,6 +1327,8 @@ UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_column(google_api_ex
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_MiniTable_File google_api_expr_v1alpha1_syntax_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/api/http.upb.c b/grpc/src/core/ext/upb-generated/google/api/http.upb.c
index f17613ac..803a0976 100644
--- a/grpc/src/core/ext/upb-generated/google/api/http.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/api/http.upb.c
@@ -7,59 +7,74 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/http.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_api_Http_submsgs[1] = {
- &google_api_HttpRule_msginit,
+static const upb_MiniTable_Sub google_api_Http_submsgs[1] = {
+ {.submsg = &google_api_HttpRule_msginit},
};
-static const upb_msglayout_field google_api_Http__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field google_api_Http__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_Http_msginit = {
+const upb_MiniTable google_api_Http_msginit = {
&google_api_Http_submsgs[0],
&google_api_Http__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_api_HttpRule_submsgs[2] = {
- &google_api_CustomHttpPattern_msginit,
- &google_api_HttpRule_msginit,
+static const upb_MiniTable_Sub google_api_HttpRule_submsgs[2] = {
+ {.submsg = &google_api_CustomHttpPattern_msginit},
+ {.submsg = &google_api_HttpRule_msginit},
};
-static const upb_msglayout_field google_api_HttpRule__fields[10] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {3, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {4, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {5, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {6, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {7, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {8, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 11, 1},
- {11, UPB_SIZE(24, 48), 0, 1, 11, 3},
- {12, UPB_SIZE(16, 32), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_api_HttpRule__fields[10] = {
+ {1, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_HttpRule_msginit = {
+const upb_MiniTable google_api_HttpRule_msginit = {
&google_api_HttpRule_submsgs[0],
&google_api_HttpRule__fields[0],
- UPB_SIZE(40, 80), 10, false, 255,
+ UPB_SIZE(40, 88), 10, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field google_api_CustomHttpPattern__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_api_CustomHttpPattern__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_api_CustomHttpPattern_msginit = {
+const upb_MiniTable google_api_CustomHttpPattern_msginit = {
NULL,
&google_api_CustomHttpPattern__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &google_api_Http_msginit,
+ &google_api_HttpRule_msginit,
+ &google_api_CustomHttpPattern_msginit,
+};
+
+const upb_MiniTable_File google_api_http_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/api/http.upb.h b/grpc/src/core/ext/upb-generated/google/api/http.upb.h
index ed4e6d10..4b8cb177 100644
--- a/grpc/src/core/ext/upb-generated/google/api/http.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/api/http.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_HTTP_PROTO_UPB_H_
#define GOOGLE_API_HTTP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,45 +26,68 @@ struct google_api_CustomHttpPattern;
typedef struct google_api_Http google_api_Http;
typedef struct google_api_HttpRule google_api_HttpRule;
typedef struct google_api_CustomHttpPattern google_api_CustomHttpPattern;
-extern const upb_msglayout google_api_Http_msginit;
-extern const upb_msglayout google_api_HttpRule_msginit;
-extern const upb_msglayout google_api_CustomHttpPattern_msginit;
+extern const upb_MiniTable google_api_Http_msginit;
+extern const upb_MiniTable google_api_HttpRule_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_api_Http* google_api_Http_new(upb_Arena* arena) {
+ return (google_api_Http*)_upb_Message_New(&google_api_Http_msginit, arena);
}
-UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_Http *ret = google_api_Http_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_api_Http* google_api_Http_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_api_Http* ret = google_api_Http_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_Http_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_Http *google_api_Http_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_api_Http *ret = google_api_Http_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_Http_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_api_Http* google_api_Http_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_Http* ret = google_api_Http_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_Http_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_Http_msginit, arena, len);
+UPB_INLINE char* google_api_Http_serialize(const google_api_Http* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_Http_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_api_Http_serialize_ex(const google_api_Http* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_Http_msginit, options, 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 void google_api_Http_clear_rules(const google_api_Http* msg) {
+ _upb_array_detach(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 void google_api_Http_clear_fully_decode_reserved_expansion(const google_api_Http* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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_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 google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_HttpRule_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -74,24 +97,35 @@ UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_H
/* 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);
+UPB_INLINE google_api_HttpRule* google_api_HttpRule_new(upb_Arena* arena) {
+ return (google_api_HttpRule*)_upb_Message_New(&google_api_HttpRule_msginit, arena);
}
-UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_HttpRule *ret = google_api_HttpRule_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_api_HttpRule* ret = google_api_HttpRule_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_HttpRule_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_api_HttpRule *ret = google_api_HttpRule_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_HttpRule* ret = google_api_HttpRule_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_HttpRule_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_HttpRule_msginit, arena, len);
+UPB_INLINE char* google_api_HttpRule_serialize(const google_api_HttpRule* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_HttpRule_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_api_HttpRule_serialize_ex(const google_api_HttpRule* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_HttpRule_msginit, options, arena, len);
}
-
typedef enum {
google_api_HttpRule_pattern_get = 2,
google_api_HttpRule_pattern_put = 3,
@@ -101,106 +135,193 @@ 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 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 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 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 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 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 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 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 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_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);
-}
-UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 3);
-}
-UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 4);
-}
-UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 5);
-}
-UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value) {
- 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_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(0, 0), int32_t);
+}
+UPB_INLINE void google_api_HttpRule_clear_selector(const google_api_HttpRule* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_selector(const google_api_HttpRule* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void google_api_HttpRule_clear_get(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_get(const google_api_HttpRule* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void google_api_HttpRule_clear_put(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_put(const google_api_HttpRule* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void google_api_HttpRule_clear_post(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_post(const google_api_HttpRule* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void google_api_HttpRule_clear_delete(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_delete(const google_api_HttpRule* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 5, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6;
+}
+UPB_INLINE void google_api_HttpRule_clear_patch(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_patch(const google_api_HttpRule* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 6, upb_StringView_FromString(""));
+}
+UPB_INLINE void google_api_HttpRule_clear_body(const google_api_HttpRule* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_body(const google_api_HttpRule* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 8;
+}
+UPB_INLINE void google_api_HttpRule_clear_custom(const google_api_HttpRule* msg) {
+ UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), google_api_HttpRule_pattern_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 8, NULL);
+}
+UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE void google_api_HttpRule_clear_additional_bindings(const google_api_HttpRule* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+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(28, 56), len);
+}
+UPB_INLINE void google_api_HttpRule_clear_response_body(const google_api_HttpRule* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_HttpRule_response_body(const google_api_HttpRule* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView);
+}
+
+UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
+}
+UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
+}
+UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 5);
+}
+UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 6);
+}
+UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = 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);
+ UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 8);
}
-UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena) {
+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_Message_New(&google_api_CustomHttpPattern_msginit, arena);
if (!sub) return NULL;
google_api_HttpRule_set_custom(msg, sub);
}
return sub;
}
-UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule *msg, size_t *len) {
- return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule* msg, size_t* len) {
+ return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_api_HttpRule_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &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_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), upb_StringView) = 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);
+UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_new(upb_Arena* arena) {
+ return (google_api_CustomHttpPattern*)_upb_Message_New(&google_api_CustomHttpPattern_msginit, arena);
+}
+UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_CustomHttpPattern_msginit, 0, arena, len);
}
-UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
+UPB_INLINE char* google_api_CustomHttpPattern_serialize_ex(const google_api_CustomHttpPattern* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_CustomHttpPattern_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_CustomHttpPattern_clear_kind(const google_api_CustomHttpPattern* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void google_api_CustomHttpPattern_clear_path(const google_api_CustomHttpPattern* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-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_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
+extern const upb_MiniTable_File google_api_http_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.c b/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.c
new file mode 100644
index 00000000..adccaf3b
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/httpbody.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "google/api/httpbody.upb.h"
+#include "google/protobuf/any.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub google_api_HttpBody_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
+};
+
+static const upb_MiniTable_Field google_api_HttpBody__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable google_api_HttpBody_msginit = {
+ &google_api_HttpBody_submsgs[0],
+ &google_api_HttpBody__fields[0],
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_api_HttpBody_msginit,
+};
+
+const upb_MiniTable_File google_api_httpbody_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.h b/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.h
new file mode 100644
index 00000000..0a5b1d26
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/google/api/httpbody.upb.h
@@ -0,0 +1,111 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/httpbody.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_HTTPBODY_PROTO_UPB_H_
+#define GOOGLE_API_HTTPBODY_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_HttpBody;
+typedef struct google_api_HttpBody google_api_HttpBody;
+extern const upb_MiniTable google_api_HttpBody_msginit;
+struct google_protobuf_Any;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+
+
+
+/* google.api.HttpBody */
+
+UPB_INLINE google_api_HttpBody* google_api_HttpBody_new(upb_Arena* arena) {
+ return (google_api_HttpBody*)_upb_Message_New(&google_api_HttpBody_msginit, arena);
+}
+UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_api_HttpBody* ret = google_api_HttpBody_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_HttpBody_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_api_HttpBody* ret = google_api_HttpBody_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_api_HttpBody_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_api_HttpBody_serialize(const google_api_HttpBody* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_HttpBody_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_api_HttpBody_serialize_ex(const google_api_HttpBody* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_api_HttpBody_msginit, options, arena, len);
+}
+UPB_INLINE void google_api_HttpBody_clear_content_type(const google_api_HttpBody* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_HttpBody_content_type(const google_api_HttpBody* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void google_api_HttpBody_clear_data(const google_api_HttpBody* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_api_HttpBody_data(const google_api_HttpBody* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool google_api_HttpBody_has_extensions(const google_api_HttpBody* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void google_api_HttpBody_clear_extensions(const google_api_HttpBody* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE const struct google_protobuf_Any* const* google_api_HttpBody_extensions(const google_api_HttpBody* msg, size_t* len) {
+ return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len);
+}
+
+UPB_INLINE void google_api_HttpBody_set_content_type(google_api_HttpBody *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void google_api_HttpBody_set_data(google_api_HttpBody *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_mutable_extensions(google_api_HttpBody* msg, size_t* len) {
+ return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
+}
+UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_resize_extensions(google_api_HttpBody* msg, size_t len, upb_Arena* arena) {
+ return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_protobuf_Any* google_api_HttpBody_add_extensions(google_api_HttpBody* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+extern const upb_MiniTable_File google_api_httpbody_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_HTTPBODY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
index 93eaa603..37c4cb88 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
@@ -7,20 +7,33 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/any.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field google_protobuf_Any__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 12, 1},
+static const upb_MiniTable_Field google_protobuf_Any__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Any_msginit = {
+const upb_MiniTable google_protobuf_Any_msginit = {
NULL,
&google_protobuf_Any__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_any_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
index 2bd44f76..110ecef6 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,39 +22,63 @@ extern "C" {
struct google_protobuf_Any;
typedef struct google_protobuf_Any google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_protobuf_Any* google_protobuf_Any_new(upb_Arena* arena) {
+ return (google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
}
-UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Any *ret = google_protobuf_Any_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Any* ret = google_protobuf_Any_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Any_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Any *ret = google_protobuf_Any_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Any* ret = google_protobuf_Any_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Any_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Any_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Any_serialize(const google_protobuf_Any* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Any_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Any_serialize_ex(const google_protobuf_Any* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Any_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_Any_clear_type_url(const google_protobuf_Any* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_protobuf_Any_type_url(const google_protobuf_Any* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void google_protobuf_Any_clear_value(const google_protobuf_Any* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_protobuf_Any_value(const google_protobuf_Any* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-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_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
+extern const upb_MiniTable_File google_protobuf_any_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
index 339fafac..8e627c16 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
@@ -7,479 +7,570 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_protobuf_FileDescriptorSet_submsgs[1] = {
- &google_protobuf_FileDescriptorProto_msginit,
+static const upb_MiniTable_Sub google_protobuf_FileDescriptorSet_submsgs[1] = {
+ {.submsg = &google_protobuf_FileDescriptorProto_msginit},
};
-static const upb_msglayout_field google_protobuf_FileDescriptorSet__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_FileDescriptorSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_FileDescriptorSet_msginit = {
+const upb_MiniTable google_protobuf_FileDescriptorSet_msginit = {
&google_protobuf_FileDescriptorSet_submsgs[0],
&google_protobuf_FileDescriptorSet__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_FileOptions_msginit,
- &google_protobuf_ServiceDescriptorProto_msginit,
- &google_protobuf_SourceCodeInfo_msginit,
-};
-
-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},
- {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},
- {7, UPB_SIZE(52, 104), 0, 2, 11, 3},
- {8, UPB_SIZE(28, 56), 3, 3, 11, 1},
- {9, UPB_SIZE(32, 64), 4, 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), 5, 0, 12, 1},
-};
-
-const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub google_protobuf_FileDescriptorProto_submsgs[6] = {
+ {.submsg = &google_protobuf_DescriptorProto_msginit},
+ {.submsg = &google_protobuf_EnumDescriptorProto_msginit},
+ {.submsg = &google_protobuf_ServiceDescriptorProto_msginit},
+ {.submsg = &google_protobuf_FieldDescriptorProto_msginit},
+ {.submsg = &google_protobuf_FileOptions_msginit},
+ {.submsg = &google_protobuf_SourceCodeInfo_msginit},
+};
+
+static const upb_MiniTable_Field google_protobuf_FileDescriptorProto__fields[12] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 64), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(40, 80), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(44, 88), UPB_SIZE(4, 4), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(48, 96), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(52, 104), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(56, 112), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable google_protobuf_FileDescriptorProto_msginit = {
&google_protobuf_FileDescriptorProto_submsgs[0],
&google_protobuf_FileDescriptorProto__fields[0],
- UPB_SIZE(64, 128), 12, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[7] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_DescriptorProto_ExtensionRange_msginit,
- &google_protobuf_DescriptorProto_ReservedRange_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_MessageOptions_msginit,
- &google_protobuf_OneofDescriptorProto_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = {
- {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},
- {5, UPB_SIZE(28, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(32, 64), 0, 4, 11, 3},
- {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},
-};
-
-const upb_msglayout google_protobuf_DescriptorProto_msginit = {
+ UPB_SIZE(64, 136), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0,
+};
+
+static const upb_MiniTable_Sub google_protobuf_DescriptorProto_submsgs[8] = {
+ {.submsg = &google_protobuf_FieldDescriptorProto_msginit},
+ {.submsg = &google_protobuf_DescriptorProto_msginit},
+ {.submsg = &google_protobuf_EnumDescriptorProto_msginit},
+ {.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msginit},
+ {.submsg = &google_protobuf_FieldDescriptorProto_msginit},
+ {.submsg = &google_protobuf_MessageOptions_msginit},
+ {.submsg = &google_protobuf_OneofDescriptorProto_msginit},
+ {.submsg = &google_protobuf_DescriptorProto_ReservedRange_msginit},
+};
+
+static const upb_MiniTable_Field google_protobuf_DescriptorProto__fields[10] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 4, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 64), UPB_SIZE(2, 2), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 72), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(40, 80), UPB_SIZE(0, 0), 7, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(44, 88), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable google_protobuf_DescriptorProto_msginit = {
&google_protobuf_DescriptorProto_submsgs[0],
&google_protobuf_DescriptorProto__fields[0],
- UPB_SIZE(48, 96), 10, false, 255,
+ UPB_SIZE(48, 104), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0,
};
-static const upb_msglayout *const google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
- &google_protobuf_ExtensionRangeOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
+ {.submsg = &google_protobuf_ExtensionRangeOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
- {3, UPB_SIZE(12, 16), 3, 0, 11, 1},
+static const upb_MiniTable_Field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(3, 3), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit = {
+const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit = {
&google_protobuf_DescriptorProto_ExtensionRange_submsgs[0],
&google_protobuf_DescriptorProto_ExtensionRange__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout_field google_protobuf_DescriptorProto_ReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_DescriptorProto_ReservedRange__fields[2] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit = {
+const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit = {
NULL,
&google_protobuf_DescriptorProto_ReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_protobuf_ExtensionRangeOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_ExtensionRangeOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_ExtensionRangeOptions__fields[1] = {
+ {999, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit = {
+const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit = {
&google_protobuf_ExtensionRangeOptions_submsgs[0],
&google_protobuf_ExtensionRangeOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0,
};
-static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1] = {
- &google_protobuf_FieldOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_FieldDescriptorProto_submsgs[3] = {
+ {.subenum = &google_protobuf_FieldDescriptorProto_Label_enuminit},
+ {.subenum = &google_protobuf_FieldDescriptorProto_Type_enuminit},
+ {.submsg = &google_protobuf_FieldOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = {
- {1, UPB_SIZE(24, 24), 1, 0, 12, 1},
- {2, UPB_SIZE(32, 40), 2, 0, 12, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 5, 1},
- {4, UPB_SIZE(4, 4), 4, 0, 14, 1},
- {5, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {6, UPB_SIZE(40, 56), 6, 0, 12, 1},
- {7, UPB_SIZE(48, 72), 7, 0, 12, 1},
- {8, UPB_SIZE(64, 104), 8, 0, 11, 1},
- {9, UPB_SIZE(16, 16), 9, 0, 5, 1},
- {10, UPB_SIZE(56, 88), 10, 0, 12, 1},
- {17, UPB_SIZE(20, 20), 11, 0, 8, 1},
+static const upb_MiniTable_Field google_protobuf_FieldDescriptorProto__fields[11] = {
+ {1, UPB_SIZE(24, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(32, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 12), UPB_SIZE(5, 5), 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 56), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(48, 72), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(56, 88), UPB_SIZE(8, 8), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(16, 16), UPB_SIZE(9, 9), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(60, 96), UPB_SIZE(10, 10), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(20, 20), UPB_SIZE(11, 11), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit = {
&google_protobuf_FieldDescriptorProto_submsgs[0],
&google_protobuf_FieldDescriptorProto__fields[0],
- UPB_SIZE(72, 112), 11, false, 255,
+ UPB_SIZE(68, 120), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0,
};
-static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = {
- &google_protobuf_OneofOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_OneofDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_OneofOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 11, 1},
+static const upb_MiniTable_Field google_protobuf_OneofDescriptorProto__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_OneofDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit = {
&google_protobuf_OneofDescriptorProto_submsgs[0],
&google_protobuf_OneofDescriptorProto__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3] = {
- &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
- &google_protobuf_EnumOptions_msginit,
- &google_protobuf_EnumValueDescriptorProto_msginit,
+static const upb_MiniTable_Sub google_protobuf_EnumDescriptorProto_submsgs[3] = {
+ {.submsg = &google_protobuf_EnumValueDescriptorProto_msginit},
+ {.submsg = &google_protobuf_EnumOptions_msginit},
+ {.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit},
};
-static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5] = {
- {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},
+static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit = {
&google_protobuf_EnumDescriptorProto_submsgs[0],
&google_protobuf_EnumDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout_field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = {
+const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = {
NULL,
&google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
- &google_protobuf_EnumValueOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_EnumValueOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = {
- {1, UPB_SIZE(8, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {3, UPB_SIZE(16, 24), 3, 0, 11, 1},
+static const upb_MiniTable_Field google_protobuf_EnumValueDescriptorProto__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(3, 3), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit = {
&google_protobuf_EnumValueDescriptorProto_submsgs[0],
&google_protobuf_EnumValueDescriptorProto__fields[0],
- UPB_SIZE(24, 32), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs[2] = {
- &google_protobuf_MethodDescriptorProto_msginit,
- &google_protobuf_ServiceOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_ServiceDescriptorProto_submsgs[2] = {
+ {.submsg = &google_protobuf_MethodDescriptorProto_msginit},
+ {.submsg = &google_protobuf_ServiceOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3] = {
- {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},
+static const upb_MiniTable_Field google_protobuf_ServiceDescriptorProto__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit = {
&google_protobuf_ServiceDescriptorProto_submsgs[0],
&google_protobuf_ServiceDescriptorProto__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[1] = {
- &google_protobuf_MethodOptions_msginit,
+static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_MethodOptions_msginit},
};
-static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {3, UPB_SIZE(20, 40), 3, 0, 12, 1},
- {4, UPB_SIZE(28, 56), 4, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 5, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 6, 0, 8, 1},
+static const upb_MiniTable_Field google_protobuf_MethodDescriptorProto__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(3, 3), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 56), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(1, 1), UPB_SIZE(5, 5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(2, 2), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = {
+const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit = {
&google_protobuf_MethodDescriptorProto_submsgs[0],
&google_protobuf_MethodDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
- {1, UPB_SIZE(20, 24), 1, 0, 12, 1},
- {8, UPB_SIZE(28, 40), 2, 0, 12, 1},
- {9, UPB_SIZE(4, 4), 3, 0, 14, 1},
- {10, UPB_SIZE(8, 8), 4, 0, 8, 1},
- {11, UPB_SIZE(36, 56), 5, 0, 12, 1},
- {16, UPB_SIZE(9, 9), 6, 0, 8, 1},
- {17, UPB_SIZE(10, 10), 7, 0, 8, 1},
- {18, UPB_SIZE(11, 11), 8, 0, 8, 1},
- {20, UPB_SIZE(12, 12), 9, 0, 8, 1},
- {23, UPB_SIZE(13, 13), 10, 0, 8, 1},
- {27, UPB_SIZE(14, 14), 11, 0, 8, 1},
- {31, UPB_SIZE(15, 15), 12, 0, 8, 1},
- {36, UPB_SIZE(44, 72), 13, 0, 12, 1},
- {37, UPB_SIZE(52, 88), 14, 0, 12, 1},
- {39, UPB_SIZE(60, 104), 15, 0, 12, 1},
- {40, UPB_SIZE(68, 120), 16, 0, 12, 1},
- {41, UPB_SIZE(76, 136), 17, 0, 12, 1},
- {42, UPB_SIZE(16, 16), 18, 0, 8, 1},
- {44, UPB_SIZE(84, 152), 19, 0, 12, 1},
- {45, UPB_SIZE(92, 168), 20, 0, 12, 1},
- {999, UPB_SIZE(100, 184), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_FileOptions_msginit = {
+ UPB_SIZE(32, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
+};
+
+static const upb_MiniTable_Sub google_protobuf_FileOptions_submsgs[2] = {
+ {.subenum = &google_protobuf_FileOptions_OptimizeMode_enuminit},
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
+};
+
+static const upb_MiniTable_Field google_protobuf_FileOptions__fields[21] = {
+ {1, UPB_SIZE(20, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(4, 4), UPB_SIZE(3, 3), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(8, 8), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(36, 56), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(9, 9), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(10, 10), UPB_SIZE(7, 7), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(11, 11), UPB_SIZE(8, 8), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(12, 12), UPB_SIZE(9, 9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(13, 13), UPB_SIZE(10, 10), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {27, UPB_SIZE(14, 14), UPB_SIZE(11, 11), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {31, UPB_SIZE(15, 15), UPB_SIZE(12, 12), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {36, UPB_SIZE(44, 72), UPB_SIZE(13, 13), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {37, UPB_SIZE(52, 88), UPB_SIZE(14, 14), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {39, UPB_SIZE(60, 104), UPB_SIZE(15, 15), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {40, UPB_SIZE(68, 120), UPB_SIZE(16, 16), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {41, UPB_SIZE(76, 136), UPB_SIZE(17, 17), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {42, UPB_SIZE(16, 16), UPB_SIZE(18, 18), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {44, UPB_SIZE(84, 152), UPB_SIZE(19, 19), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {45, UPB_SIZE(92, 168), UPB_SIZE(20, 20), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(100, 184), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable google_protobuf_FileOptions_msginit = {
&google_protobuf_FileOptions_submsgs[0],
&google_protobuf_FileOptions__fields[0],
- UPB_SIZE(104, 192), 21, false, 255,
+ UPB_SIZE(104, 200), 21, kUpb_ExtMode_Extendable, 1, 255, 0,
};
-static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_MessageOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_MessageOptions__fields[5] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {3, UPB_SIZE(3, 3), 3, 0, 8, 1},
- {7, UPB_SIZE(4, 4), 4, 0, 8, 1},
- {999, UPB_SIZE(8, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_MessageOptions__fields[5] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(3, 3), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 4), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_MessageOptions_msginit = {
+const upb_MiniTable google_protobuf_MessageOptions_msginit = {
&google_protobuf_MessageOptions_submsgs[0],
&google_protobuf_MessageOptions__fields[0],
- UPB_SIZE(16, 16), 5, false, 255,
+ UPB_SIZE(12, 24), 5, kUpb_ExtMode_Extendable, 3, 255, 0,
};
-static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_FieldOptions_submsgs[3] = {
+ {.subenum = &google_protobuf_FieldOptions_CType_enuminit},
+ {.subenum = &google_protobuf_FieldOptions_JSType_enuminit},
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 14, 1},
- {2, UPB_SIZE(12, 12), 2, 0, 8, 1},
- {3, UPB_SIZE(13, 13), 3, 0, 8, 1},
- {5, UPB_SIZE(14, 14), 4, 0, 8, 1},
- {6, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {10, UPB_SIZE(15, 15), 6, 0, 8, 1},
- {999, UPB_SIZE(16, 16), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_FieldOptions__fields[7] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(9, 9), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(10, 10), UPB_SIZE(4, 4), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(12, 12), UPB_SIZE(5, 5), 1, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(16, 16), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(20, 24), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_FieldOptions_msginit = {
+const upb_MiniTable google_protobuf_FieldOptions_msginit = {
&google_protobuf_FieldOptions_submsgs[0],
&google_protobuf_FieldOptions__fields[0],
- UPB_SIZE(24, 24), 7, false, 255,
+ UPB_SIZE(24, 40), 7, kUpb_ExtMode_Extendable, 3, 255, 0,
};
-static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_OneofOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_OneofOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_OneofOptions__fields[1] = {
+ {999, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_OneofOptions_msginit = {
+const upb_MiniTable google_protobuf_OneofOptions_msginit = {
&google_protobuf_OneofOptions_submsgs[0],
&google_protobuf_OneofOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0,
};
-static const upb_msglayout *const google_protobuf_EnumOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_EnumOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_EnumOptions__fields[3] = {
- {2, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {3, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_EnumOptions__fields[3] = {
+ {2, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_EnumOptions_msginit = {
+const upb_MiniTable google_protobuf_EnumOptions_msginit = {
&google_protobuf_EnumOptions_submsgs[0],
&google_protobuf_EnumOptions__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_Extendable, 0, 255, 0,
};
-static const upb_msglayout *const google_protobuf_EnumValueOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_EnumValueOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_EnumValueOptions__fields[2] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_EnumValueOptions_msginit = {
+const upb_MiniTable google_protobuf_EnumValueOptions_msginit = {
&google_protobuf_EnumValueOptions_submsgs[0],
&google_protobuf_EnumValueOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_Extendable, 1, 255, 0,
};
-static const upb_msglayout *const google_protobuf_ServiceOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_ServiceOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2] = {
- {33, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_ServiceOptions__fields[2] = {
+ {33, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_ServiceOptions_msginit = {
+const upb_MiniTable google_protobuf_ServiceOptions_msginit = {
&google_protobuf_ServiceOptions_submsgs[0],
&google_protobuf_ServiceOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_Extendable, 0, 255, 0,
};
-static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_MiniTable_Sub google_protobuf_MethodOptions_submsgs[2] = {
+ {.subenum = &google_protobuf_MethodOptions_IdempotencyLevel_enuminit},
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
-static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = {
- {33, UPB_SIZE(8, 8), 1, 0, 8, 1},
- {34, UPB_SIZE(4, 4), 2, 0, 14, 1},
- {999, UPB_SIZE(12, 16), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_MethodOptions__fields[3] = {
+ {33, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {34, UPB_SIZE(4, 4), UPB_SIZE(2, 2), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {999, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_MethodOptions_msginit = {
+const upb_MiniTable google_protobuf_MethodOptions_msginit = {
&google_protobuf_MethodOptions_submsgs[0],
&google_protobuf_MethodOptions__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_Extendable, 0, 255, 0,
};
-static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1] = {
- &google_protobuf_UninterpretedOption_NamePart_msginit,
+static const upb_MiniTable_Sub google_protobuf_UninterpretedOption_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_NamePart_msginit},
};
-static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = {
- {2, UPB_SIZE(56, 80), 0, 0, 11, 3},
- {3, UPB_SIZE(32, 32), 1, 0, 12, 1},
- {4, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {5, UPB_SIZE(16, 16), 3, 0, 3, 1},
- {6, UPB_SIZE(24, 24), 4, 0, 1, 1},
- {7, UPB_SIZE(40, 48), 5, 0, 12, 1},
- {8, UPB_SIZE(48, 64), 6, 0, 12, 1},
+static const upb_MiniTable_Field google_protobuf_UninterpretedOption__fields[7] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(32, 64), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(40, 72), UPB_SIZE(3, 3), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(48, 80), UPB_SIZE(4, 4), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(16, 32), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 48), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
+const upb_MiniTable google_protobuf_UninterpretedOption_msginit = {
&google_protobuf_UninterpretedOption_submsgs[0],
&google_protobuf_UninterpretedOption__fields[0],
- UPB_SIZE(64, 96), 7, false, 255,
+ UPB_SIZE(56, 88), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 2},
- {2, UPB_SIZE(1, 1), 2, 0, 8, 2},
+static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = {
+const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit = {
NULL,
&google_protobuf_UninterpretedOption_NamePart__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2,
};
-static const upb_msglayout *const google_protobuf_SourceCodeInfo_submsgs[1] = {
- &google_protobuf_SourceCodeInfo_Location_msginit,
+static const upb_MiniTable_Sub google_protobuf_SourceCodeInfo_submsgs[1] = {
+ {.submsg = &google_protobuf_SourceCodeInfo_Location_msginit},
};
-static const upb_msglayout_field google_protobuf_SourceCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_SourceCodeInfo__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_SourceCodeInfo_msginit = {
+const upb_MiniTable google_protobuf_SourceCodeInfo_msginit = {
&google_protobuf_SourceCodeInfo_submsgs[0],
&google_protobuf_SourceCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field google_protobuf_SourceCodeInfo_Location__fields[5] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(2, 2), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = {
+const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit = {
NULL,
&google_protobuf_SourceCodeInfo_Location__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 72), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout *const google_protobuf_GeneratedCodeInfo_submsgs[1] = {
- &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
+static const upb_MiniTable_Sub google_protobuf_GeneratedCodeInfo_submsgs[1] = {
+ {.submsg = &google_protobuf_GeneratedCodeInfo_Annotation_msginit},
};
-static const upb_msglayout_field google_protobuf_GeneratedCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = {
+const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit = {
&google_protobuf_GeneratedCodeInfo_submsgs[0],
&google_protobuf_GeneratedCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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), 1, 0, 12, 1},
- {3, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {4, UPB_SIZE(8, 8), 3, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | kUpb_LabelFlags_IsPacked | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
+const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
NULL,
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[27] = {
+ &google_protobuf_FileDescriptorSet_msginit,
+ &google_protobuf_FileDescriptorProto_msginit,
+ &google_protobuf_DescriptorProto_msginit,
+ &google_protobuf_DescriptorProto_ExtensionRange_msginit,
+ &google_protobuf_DescriptorProto_ReservedRange_msginit,
+ &google_protobuf_ExtensionRangeOptions_msginit,
+ &google_protobuf_FieldDescriptorProto_msginit,
+ &google_protobuf_OneofDescriptorProto_msginit,
+ &google_protobuf_EnumDescriptorProto_msginit,
+ &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
+ &google_protobuf_EnumValueDescriptorProto_msginit,
+ &google_protobuf_ServiceDescriptorProto_msginit,
+ &google_protobuf_MethodDescriptorProto_msginit,
+ &google_protobuf_FileOptions_msginit,
+ &google_protobuf_MessageOptions_msginit,
+ &google_protobuf_FieldOptions_msginit,
+ &google_protobuf_OneofOptions_msginit,
+ &google_protobuf_EnumOptions_msginit,
+ &google_protobuf_EnumValueOptions_msginit,
+ &google_protobuf_ServiceOptions_msginit,
+ &google_protobuf_MethodOptions_msginit,
+ &google_protobuf_UninterpretedOption_msginit,
+ &google_protobuf_UninterpretedOption_NamePart_msginit,
+ &google_protobuf_SourceCodeInfo_msginit,
+ &google_protobuf_SourceCodeInfo_Location_msginit,
+ &google_protobuf_GeneratedCodeInfo_msginit,
+ &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
+};
+
+const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit = {
+ NULL,
+ 0x7fffeULL,
+ 0,
+};
+
+const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit = {
+ NULL,
+ 0xeULL,
+ 0,
+};
+
+const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit = {
+ NULL,
+ 0xeULL,
+ 0,
+};
+
+const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit = {
+ NULL,
+ 0x7ULL,
+ 0,
+};
+
+const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit = {
+ NULL,
+ 0x7ULL,
+ 0,
+};
+
+const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit = {
+ NULL,
+ 0x7ULL,
+ 0,
+};
+
+static const upb_MiniTable_Enum *enums_layout[6] = {
+ &google_protobuf_FieldDescriptorProto_Type_enuminit,
+ &google_protobuf_FieldDescriptorProto_Label_enuminit,
+ &google_protobuf_FileOptions_OptimizeMode_enuminit,
+ &google_protobuf_FieldOptions_CType_enuminit,
+ &google_protobuf_FieldOptions_JSType_enuminit,
+ &google_protobuf_MethodOptions_IdempotencyLevel_enuminit,
+};
+
+const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout = {
+ messages_layout,
+ enums_layout,
+ NULL,
+ 27,
+ 6,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
index a8ed71a6..0a7b892f 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -74,33 +74,33 @@ typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo;
typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location;
typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo;
typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation;
-extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
-extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
-extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
-extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_FileOptions_msginit;
-extern const upb_msglayout google_protobuf_MessageOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldOptions_msginit;
-extern const upb_msglayout google_protobuf_OneofOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
-extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
-extern const upb_msglayout google_protobuf_MethodOptions_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
+extern const upb_MiniTable google_protobuf_FileDescriptorSet_msginit;
+extern const upb_MiniTable google_protobuf_FileDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_DescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_DescriptorProto_ExtensionRange_msginit;
+extern const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit;
+extern const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_OneofOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_ServiceOptions_msginit;
+extern const upb_MiniTable google_protobuf_MethodOptions_msginit;
+extern const upb_MiniTable google_protobuf_UninterpretedOption_msginit;
+extern const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit;
+extern const upb_MiniTable google_protobuf_SourceCodeInfo_msginit;
+extern const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit;
+extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit;
+extern const upb_MiniTable google_protobuf_GeneratedCodeInfo_Annotation_msginit;
typedef enum {
google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
@@ -154,163 +154,274 @@ typedef enum {
} google_protobuf_MethodOptions_IdempotencyLevel;
+extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit;
+extern const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit;
+extern const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit;
+extern const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit;
+extern const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit;
+extern const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit;
+
/* 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);
+UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_new(upb_Arena* arena) {
+ return (google_protobuf_FileDescriptorSet*)_upb_Message_New(&google_protobuf_FileDescriptorSet_msginit, arena);
}
-UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FileDescriptorSet* ret = google_protobuf_FileDescriptorSet_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
+UPB_INLINE char* google_protobuf_FileDescriptorSet_serialize_ex(const google_protobuf_FileDescriptorSet* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, options, 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 void google_protobuf_FileDescriptorSet_clear_file(const google_protobuf_FileDescriptorSet* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
-}
-UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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 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 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 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, 3); }
-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, 4); }
-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, 5); }
-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_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_FileDescriptorProto*)_upb_Message_New(&google_protobuf_FileDescriptorProto_msginit, arena);
+}
+UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FileDescriptorProto* ret = google_protobuf_FileDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_FileDescriptorProto_serialize_ex(const google_protobuf_FileDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_name(const google_protobuf_FileDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_name(const google_protobuf_FileDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_package(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_package(const google_protobuf_FileDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_package(const google_protobuf_FileDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE upb_StringView const* google_protobuf_FileDescriptorProto_dependency(const google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_message_type(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_message_type(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+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(24, 48), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_enum_type(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_enum_type(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+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(28, 56), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_service(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64));
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_service(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 64));
+}
+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(32, 64), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_extension(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72));
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_extension(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(36, 72));
+}
+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(36, 72), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_options(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_options(const google_protobuf_FileDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_options(const google_protobuf_FileDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const google_protobuf_FileOptions*);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_source_code_info(const google_protobuf_FileDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const google_protobuf_SourceCodeInfo*);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_public_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(48, 96));
+}
+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(48, 96), len);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_weak_dependency(const google_protobuf_FileDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 104));
+}
+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(52, 104), len);
+}
+UPB_INLINE bool google_protobuf_FileDescriptorProto_has_syntax(const google_protobuf_FileDescriptorProto* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void google_protobuf_FileDescriptorProto_clear_syntax(const google_protobuf_FileDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE upb_StringView google_protobuf_FileDescriptorProto_syntax(const google_protobuf_FileDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView);
+}
+
+UPB_INLINE void google_protobuf_FileDescriptorProto_set_name(google_protobuf_FileDescriptorProto *msg, upb_StringView 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_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileDescriptorProto_set_package(google_protobuf_FileDescriptorProto *msg, upb_StringView 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_StringView) = 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_StringView* google_protobuf_FileDescriptorProto_mutable_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* google_protobuf_FileDescriptorProto_resize_dependency(google_protobuf_FileDescriptorProto* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(3, 4), &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_mutable_message_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), 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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
+UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
+UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_ServiceDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), 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_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), len);
+UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), 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_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), google_protobuf_FileOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 80), google_protobuf_FileOptions*) = value;
}
-UPB_INLINE struct google_protobuf_FileOptions* google_protobuf_FileDescriptorProto_mutable_options(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_FileOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_FileDescriptorProto_set_options(msg, sub);
}
@@ -318,227 +429,331 @@ 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, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), google_protobuf_SourceCodeInfo*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 88), google_protobuf_SourceCodeInfo*) = value;
}
-UPB_INLINE struct google_protobuf_SourceCodeInfo* google_protobuf_FileDescriptorProto_mutable_source_code_info(google_protobuf_FileDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena);
if (!sub) return NULL;
google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
}
return sub;
}
-UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 112), len);
+UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), 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_accessor2(msg, UPB_SIZE(56, 112), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(48, 96), len, 2, arena);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(56, 112), 2, &val,
- arena);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(48, 96), 2, &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_mutable_weak_dependency(google_protobuf_FileDescriptorProto* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 104), 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_accessor2(msg, UPB_SIZE(60, 120), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(52, 104), len, 2, arena);
}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(60, 120), 2, &val,
- arena);
+UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 104), 2, &val, arena);
}
-UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 112), upb_StringView) = 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);
-}
-UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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 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 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 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 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 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_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_DescriptorProto*)_upb_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
+}
+UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_DescriptorProto* ret = google_protobuf_DescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_DescriptorProto_serialize_ex(const google_protobuf_DescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_name(const google_protobuf_DescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_DescriptorProto_name(const google_protobuf_DescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_field(const google_protobuf_DescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_field(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_nested_type(const google_protobuf_DescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_nested_type(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+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(16, 32), len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_enum_type(const google_protobuf_DescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40));
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_enum_type(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 40));
+}
+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(20, 40), len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension_range(const google_protobuf_DescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension_range(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+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(24, 48), len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_extension(const google_protobuf_DescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_extension(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+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(28, 56), len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_has_options(const google_protobuf_DescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_DescriptorProto_clear_options(const google_protobuf_DescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_MessageOptions* google_protobuf_DescriptorProto_options(const google_protobuf_DescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), 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 void google_protobuf_DescriptorProto_clear_oneof_decl(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(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 void google_protobuf_DescriptorProto_clear_reserved_range(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(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 void google_protobuf_DescriptorProto_clear_reserved_name(const google_protobuf_DescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(44, 88));
+}
+UPB_INLINE upb_StringView const* google_protobuf_DescriptorProto_reserved_name(const google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len);
+}
+
+UPB_INLINE void google_protobuf_DescriptorProto_set_name(google_protobuf_DescriptorProto *msg, upb_StringView 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_StringView) = 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_mutable_field(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto *msg, size_t *len) {
- return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (google_protobuf_DescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_DescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto *msg, size_t *len) {
- return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (google_protobuf_EnumDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto *msg, size_t *len) {
- return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (google_protobuf_DescriptorProto_ExtensionRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_DescriptorProto_ExtensionRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto *msg, size_t *len) {
- return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (google_protobuf_FieldDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
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(32, 64), google_protobuf_MessageOptions*) = value;
}
-UPB_INLINE struct google_protobuf_MessageOptions* google_protobuf_DescriptorProto_mutable_options(google_protobuf_DescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_MessageOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_DescriptorProto_set_options(msg, sub);
}
return sub;
}
-UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto *msg, size_t *len) {
+UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto* msg, size_t* len) {
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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto *msg, size_t *len) {
+UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto* msg, size_t* len) {
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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_DescriptorProto_ReservedRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 88), len);
+UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* google_protobuf_DescriptorProto_resize_reserved_name(google_protobuf_DescriptorProto* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &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);
+UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_new(upb_Arena* arena) {
+ return (google_protobuf_DescriptorProto_ExtensionRange*)_upb_Message_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) {
- google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_DescriptorProto_ExtensionRange* ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
+UPB_INLINE char* google_protobuf_DescriptorProto_ExtensionRange_serialize_ex(const google_protobuf_DescriptorProto_ExtensionRange* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_clear_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void google_protobuf_DescriptorProto_ExtensionRange_clear_end(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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 void google_protobuf_DescriptorProto_ExtensionRange_clear_options(const google_protobuf_DescriptorProto_ExtensionRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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);
@@ -552,10 +767,10 @@ UPB_INLINE void google_protobuf_DescriptorProto_ExtensionRange_set_options(googl
_upb_sethas(msg, 3);
*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) {
+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_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
}
@@ -564,28 +779,55 @@ 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);
+UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_new(upb_Arena* arena) {
+ return (google_protobuf_DescriptorProto_ReservedRange*)_upb_Message_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) {
- google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_DescriptorProto_ReservedRange* ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
+UPB_INLINE char* google_protobuf_DescriptorProto_ReservedRange_serialize_ex(const google_protobuf_DescriptorProto_ReservedRange* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_clear_start(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void google_protobuf_DescriptorProto_ReservedRange_clear_end(const google_protobuf_DescriptorProto_ReservedRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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);
@@ -598,120 +840,235 @@ UPB_INLINE void google_protobuf_DescriptorProto_ReservedRange_set_end(google_pro
/* 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);
+UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_new(upb_Arena* arena) {
+ return (google_protobuf_ExtensionRangeOptions*)_upb_Message_New(&google_protobuf_ExtensionRangeOptions_msginit, arena);
+}
+UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRangeOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_ExtensionRangeOptions* ret = google_protobuf_ExtensionRangeOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, 0, arena, len);
}
-UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_ExtensionRangeOptions_serialize_ex(const google_protobuf_ExtensionRangeOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, options, arena, len);
}
-UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
- 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 void google_protobuf_ExtensionRangeOptions_clear_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), 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(12, 12), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const google_protobuf_FieldOptions*); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(56, 88), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
-
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
+UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_FieldDescriptorProto*)_upb_Message_New(&google_protobuf_FieldDescriptorProto_msginit, arena);
+}
+UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FieldDescriptorProto* ret = google_protobuf_FieldDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_FieldDescriptorProto_serialize_ex(const google_protobuf_FieldDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_name(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_extendee(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_number(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_number(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_number(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_label(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto* msg) {
+ return google_protobuf_FieldDescriptorProto_has_label(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) : 1;
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto* msg) {
+ return google_protobuf_FieldDescriptorProto_has_type(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) : 1;
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_type_name(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_default_value(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 7);
+}
+UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_options(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const google_protobuf_FieldOptions*);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
+ _upb_clearhas(msg, 9);
+}
+UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_json_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 10);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_json_name(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 10);
+}
+UPB_INLINE upb_StringView google_protobuf_FieldDescriptorProto_json_name(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
+ return _upb_hasbit(msg, 11);
+}
+UPB_INLINE void google_protobuf_FieldDescriptorProto_clear_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = 0;
+ _upb_clearhas(msg, 11);
+}
+UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool);
+}
+
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), upb_StringView) = 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(12, 12), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), google_protobuf_FieldOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 88), google_protobuf_FieldOptions*) = value;
}
-UPB_INLINE struct google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_mutable_options(google_protobuf_FieldDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_FieldOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_FieldDescriptorProto_set_options(msg, sub);
}
@@ -721,9 +1078,9 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_prot
_upb_sethas(msg, 9);
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FieldDescriptorProto_set_json_name(google_protobuf_FieldDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 96), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
_upb_sethas(msg, 11);
@@ -732,41 +1089,67 @@ UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_
/* 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);
+UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_OneofDescriptorProto*)_upb_Message_New(&google_protobuf_OneofDescriptorProto_msginit, arena);
}
-UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_OneofDescriptorProto* ret = google_protobuf_OneofDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
+UPB_INLINE char* google_protobuf_OneofDescriptorProto_serialize_ex(const google_protobuf_OneofDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_name(const google_protobuf_OneofDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_OneofDescriptorProto_name(const google_protobuf_OneofDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_options(const google_protobuf_OneofDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_OneofDescriptorProto_clear_options(const google_protobuf_OneofDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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_INLINE void google_protobuf_OneofDescriptorProto_set_name(google_protobuf_OneofDescriptorProto *msg, upb_StringView 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_StringView) = 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_INLINE struct google_protobuf_OneofOptions* google_protobuf_OneofDescriptorProto_mutable_options(google_protobuf_OneofDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_OneofOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_OneofDescriptorProto_set_options(msg, sub);
}
@@ -775,112 +1158,181 @@ 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);
+UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_EnumDescriptorProto*)_upb_Message_New(&google_protobuf_EnumDescriptorProto_msginit, arena);
}
-UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_EnumDescriptorProto* ret = google_protobuf_EnumDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
+UPB_INLINE char* google_protobuf_EnumDescriptorProto_serialize_ex(const google_protobuf_EnumDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_name(const google_protobuf_EnumDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_EnumDescriptorProto_name(const google_protobuf_EnumDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_value(const google_protobuf_EnumDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_value(const google_protobuf_EnumDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_options(const google_protobuf_EnumDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_clear_options(const google_protobuf_EnumDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_options(const google_protobuf_EnumDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), 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 void google_protobuf_EnumDescriptorProto_clear_reserved_range(const google_protobuf_EnumDescriptorProto* msg) {
+ _upb_array_detach(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 void google_protobuf_EnumDescriptorProto_clear_reserved_name(const google_protobuf_EnumDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(24, 48));
+}
+UPB_INLINE upb_StringView const* google_protobuf_EnumDescriptorProto_reserved_name(const google_protobuf_EnumDescriptorProto* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), 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 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 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_INLINE void google_protobuf_EnumDescriptorProto_set_name(google_protobuf_EnumDescriptorProto *msg, upb_StringView 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_StringView) = 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_mutable_value(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_EnumValueDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
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(16, 32), google_protobuf_EnumOptions*) = value;
}
-UPB_INLINE struct google_protobuf_EnumOptions* google_protobuf_EnumDescriptorProto_mutable_options(google_protobuf_EnumDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_EnumOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_EnumDescriptorProto_set_options(msg, sub);
}
return sub;
}
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
+UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* google_protobuf_EnumDescriptorProto_resize_reserved_name(google_protobuf_EnumDescriptorProto* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &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);
+UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_new(upb_Arena* arena) {
+ return (google_protobuf_EnumDescriptorProto_EnumReservedRange*)_upb_Message_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) {
- google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_EnumDescriptorProto_EnumReservedRange* ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
+UPB_INLINE char* google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize_ex(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void google_protobuf_EnumDescriptorProto_EnumReservedRange_clear_end(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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);
@@ -893,34 +1345,68 @@ UPB_INLINE void google_protobuf_EnumDescriptorProto_EnumReservedRange_set_end(go
/* 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);
+UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_EnumValueDescriptorProto*)_upb_Message_New(&google_protobuf_EnumValueDescriptorProto_msginit, arena);
}
-UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_EnumValueDescriptorProto* ret = google_protobuf_EnumValueDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
+UPB_INLINE char* google_protobuf_EnumValueDescriptorProto_serialize_ex(const google_protobuf_EnumValueDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_name(const google_protobuf_EnumValueDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_EnumValueDescriptorProto_name(const google_protobuf_EnumValueDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_number(const google_protobuf_EnumValueDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_EnumValueDescriptorProto_clear_number(const google_protobuf_EnumValueDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+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 void google_protobuf_EnumValueDescriptorProto_clear_options(const google_protobuf_EnumValueDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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, 1); }
-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, 2); }
-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_INLINE void google_protobuf_EnumValueDescriptorProto_set_name(google_protobuf_EnumValueDescriptorProto *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_number(google_protobuf_EnumValueDescriptorProto *msg, int32_t value) {
_upb_sethas(msg, 2);
@@ -930,10 +1416,10 @@ UPB_INLINE void google_protobuf_EnumValueDescriptorProto_set_options(google_prot
_upb_sethas(msg, 3);
*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) {
+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_Message_New(&google_protobuf_EnumValueOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
}
@@ -942,56 +1428,88 @@ 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);
+UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_ServiceDescriptorProto*)_upb_Message_New(&google_protobuf_ServiceDescriptorProto_msginit, arena);
}
-UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_ServiceDescriptorProto* ret = google_protobuf_ServiceDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
+UPB_INLINE char* google_protobuf_ServiceDescriptorProto_serialize_ex(const google_protobuf_ServiceDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_name(const google_protobuf_ServiceDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_ServiceDescriptorProto_name(const google_protobuf_ServiceDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_method(const google_protobuf_ServiceDescriptorProto* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_method(const google_protobuf_ServiceDescriptorProto* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+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(12, 24), len);
+}
+UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_options(const google_protobuf_ServiceDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_clear_options(const google_protobuf_ServiceDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_options(const google_protobuf_ServiceDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const google_protobuf_ServiceOptions*);
}
-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 void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_ServiceDescriptorProto_set_name(google_protobuf_ServiceDescriptorProto *msg, upb_StringView 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_StringView) = 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_mutable_method(google_protobuf_ServiceDescriptorProto* msg, size_t* len) {
+ return (google_protobuf_MethodDescriptorProto**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), 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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
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(16, 32), google_protobuf_ServiceOptions*) = value;
}
-UPB_INLINE struct google_protobuf_ServiceOptions* google_protobuf_ServiceDescriptorProto_mutable_options(google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_ServiceOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
}
@@ -1000,57 +1518,115 @@ 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);
-}
-UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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, 5); }
-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, 6); }
-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_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_new(upb_Arena* arena) {
+ return (google_protobuf_MethodDescriptorProto*)_upb_Message_New(&google_protobuf_MethodDescriptorProto_msginit, arena);
+}
+UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescriptorProto_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_MethodDescriptorProto* ret = google_protobuf_MethodDescriptorProto_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_MethodDescriptorProto_serialize_ex(const google_protobuf_MethodDescriptorProto* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_name(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_name(const google_protobuf_MethodDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_input_type(const google_protobuf_MethodDescriptorProto* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_input_type(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_input_type(const google_protobuf_MethodDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_output_type(const google_protobuf_MethodDescriptorProto* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_output_type(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE upb_StringView google_protobuf_MethodDescriptorProto_output_type(const google_protobuf_MethodDescriptorProto* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_options(const google_protobuf_MethodDescriptorProto* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_options(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+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, 5);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_client_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 5);
+}
+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, 6);
+}
+UPB_INLINE void google_protobuf_MethodDescriptorProto_clear_server_streaming(const google_protobuf_MethodDescriptorProto* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+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_StringView 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_StringView) = value;
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_MethodDescriptorProto_set_input_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView 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_StringView) = value;
}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_MethodDescriptorProto_set_output_type(google_protobuf_MethodDescriptorProto *msg, upb_StringView 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_StringView) = value;
}
UPB_INLINE void google_protobuf_MethodDescriptorProto_set_options(google_protobuf_MethodDescriptorProto *msg, google_protobuf_MethodOptions* value) {
_upb_sethas(msg, 4);
*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) {
+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_Message_New(&google_protobuf_MethodOptions_msginit, arena);
if (!sub) return NULL;
google_protobuf_MethodDescriptorProto_set_options(msg, sub);
}
@@ -1067,74 +1643,252 @@ UPB_INLINE void google_protobuf_MethodDescriptorProto_set_server_streaming(googl
/* 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);
-}
-UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
-UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(84, 152), 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(92, 168), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); }
-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(100, 184), len); }
-
-UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_new(upb_Arena* arena) {
+ return (google_protobuf_FileOptions*)_upb_Message_New(&google_protobuf_FileOptions_msginit, arena);
+}
+UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FileOptions* ret = google_protobuf_FileOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FileOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_FileOptions_serialize_ex(const google_protobuf_FileOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FileOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_package(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_outer_classname(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_optimize_for(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions* msg) {
+ return google_protobuf_FileOptions_has_optimize_for(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) : 1;
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_multiple_files(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_go_package(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_generic_services(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generic_services(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
+ _upb_clearhas(msg, 7);
+}
+UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_py_generic_services(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = 0;
+ _upb_clearhas(msg, 8);
+}
+UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = 0;
+ _upb_clearhas(msg, 9);
+}
+UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 10);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_deprecated(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = 0;
+ _upb_clearhas(msg, 10);
+}
+UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 11);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = 0;
+ _upb_clearhas(msg, 11);
+}
+UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 12);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = 0;
+ _upb_clearhas(msg, 12);
+}
+UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions* msg) {
+ return google_protobuf_FileOptions_has_cc_enable_arenas(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) : true;
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 13);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_objc_class_prefix(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 13);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 14);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_csharp_namespace(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 14);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 15);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_swift_prefix(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 15);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 16);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_php_class_prefix(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 16);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 17);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_php_namespace(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 17);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 18);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_php_generic_services(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
+ _upb_clearhas(msg, 18);
+}
+UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 19);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 19);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_php_metadata_namespace(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_ruby_package(const google_protobuf_FileOptions* msg) {
+ return _upb_hasbit(msg, 20);
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_ruby_package(const google_protobuf_FileOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 20);
+}
+UPB_INLINE upb_StringView google_protobuf_FileOptions_ruby_package(const google_protobuf_FileOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184));
+}
+UPB_INLINE void google_protobuf_FileOptions_clear_uninterpreted_option(const google_protobuf_FileOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(100, 184));
+}
+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(100, 184), len);
+}
+
+UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
_upb_sethas(msg, 3);
@@ -1144,9 +1898,9 @@ UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_proto
_upb_sethas(msg, 4);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 6);
@@ -1176,82 +1930,131 @@ UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf
_upb_sethas(msg, 12);
*UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
_upb_sethas(msg, 18);
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_php_metadata_namespace(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 19);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_FileOptions_set_ruby_package(google_protobuf_FileOptions *msg, upb_StringView value) {
_upb_sethas(msg, 20);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 168), upb_StringView) = value;
}
-UPB_INLINE google_protobuf_UninterpretedOption** google_protobuf_FileOptions_mutable_uninterpreted_option(google_protobuf_FileOptions *msg, size_t *len) {
+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(100, 184), 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_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_new(upb_Arena* arena) {
+ return (google_protobuf_MessageOptions*)_upb_Message_New(&google_protobuf_MessageOptions_msginit, arena);
}
-UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_MessageOptions* ret = google_protobuf_MessageOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MessageOptions_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
+UPB_INLINE char* google_protobuf_MessageOptions_serialize_ex(const google_protobuf_MessageOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MessageOptions_msginit, options, 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 void google_protobuf_MessageOptions_clear_message_set_wire_format(const google_protobuf_MessageOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_MessageOptions_clear_no_standard_descriptor_accessor(const google_protobuf_MessageOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_MessageOptions_clear_deprecated(const google_protobuf_MessageOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_MessageOptions_clear_map_entry(const google_protobuf_MessageOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_MessageOptions_clear_uninterpreted_option(const google_protobuf_MessageOptions* msg) {
+ _upb_array_detach(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 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);
@@ -1269,54 +2072,119 @@ UPB_INLINE void google_protobuf_MessageOptions_set_map_entry(google_protobuf_Mes
_upb_sethas(msg, 4);
*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) {
+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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
-}
-UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
- 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(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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(15, 15), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 16)); }
-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(16, 16), len); }
+UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_new(upb_Arena* arena) {
+ return (google_protobuf_FieldOptions*)_upb_Message_New(&google_protobuf_FieldOptions_msginit, arena);
+}
+UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FieldOptions* ret = google_protobuf_FieldOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FieldOptions_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_FieldOptions_serialize_ex(const google_protobuf_FieldOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FieldOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_ctype(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE int32_t google_protobuf_FieldOptions_ctype(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_packed(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_deprecated(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_lazy(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_jstype(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_weak(const google_protobuf_FieldOptions* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_weak(const google_protobuf_FieldOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_weak(const google_protobuf_FieldOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), bool);
+}
+UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 24));
+}
+UPB_INLINE void google_protobuf_FieldOptions_clear_uninterpreted_option(const google_protobuf_FieldOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 24));
+}
+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(20, 24), len);
+}
UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOptions *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -1324,101 +2192,151 @@ UPB_INLINE void google_protobuf_FieldOptions_set_ctype(google_protobuf_FieldOpti
}
UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
}
UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), 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(15, 15), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(16, 16), len);
+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(20, 24), 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_accessor2(msg, UPB_SIZE(16, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 24), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_new(upb_Arena* arena) {
+ return (google_protobuf_OneofOptions*)_upb_Message_New(&google_protobuf_OneofOptions_msginit, arena);
}
-UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_OneofOptions* ret = google_protobuf_OneofOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_OneofOptions_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
+UPB_INLINE char* google_protobuf_OneofOptions_serialize_ex(const google_protobuf_OneofOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_OneofOptions_msginit, options, 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 void google_protobuf_OneofOptions_clear_uninterpreted_option(const google_protobuf_OneofOptions* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_new(upb_Arena* arena) {
+ return (google_protobuf_EnumOptions*)_upb_Message_New(&google_protobuf_EnumOptions_msginit, arena);
}
-UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_EnumOptions* ret = google_protobuf_EnumOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumOptions_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
+UPB_INLINE char* google_protobuf_EnumOptions_serialize_ex(const google_protobuf_EnumOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_EnumOptions_clear_allow_alias(const google_protobuf_EnumOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_EnumOptions_clear_deprecated(const google_protobuf_EnumOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_EnumOptions_clear_uninterpreted_option(const google_protobuf_EnumOptions* msg) {
+ _upb_array_detach(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 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);
@@ -1428,256 +2346,430 @@ UPB_INLINE void google_protobuf_EnumOptions_set_deprecated(google_protobuf_EnumO
_upb_sethas(msg, 2);
*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) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_new(upb_Arena* arena) {
+ return (google_protobuf_EnumValueOptions*)_upb_Message_New(&google_protobuf_EnumValueOptions_msginit, arena);
}
-UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_EnumValueOptions* ret = google_protobuf_EnumValueOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
+UPB_INLINE char* google_protobuf_EnumValueOptions_serialize_ex(const google_protobuf_EnumValueOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_EnumValueOptions_clear_deprecated(const google_protobuf_EnumValueOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_EnumValueOptions_clear_uninterpreted_option(const google_protobuf_EnumValueOptions* msg) {
+ _upb_array_detach(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 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_INLINE google_protobuf_UninterpretedOption** google_protobuf_EnumValueOptions_mutable_uninterpreted_option(google_protobuf_EnumValueOptions *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_new(upb_Arena* arena) {
+ return (google_protobuf_ServiceOptions*)_upb_Message_New(&google_protobuf_ServiceOptions_msginit, arena);
+}
+UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_ServiceOptions* ret = google_protobuf_ServiceOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, 0, arena, len);
}
-UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_ServiceOptions_serialize_ex(const google_protobuf_ServiceOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, options, arena, len);
}
-UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
- 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 void google_protobuf_ServiceOptions_clear_deprecated(const google_protobuf_ServiceOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void google_protobuf_ServiceOptions_clear_uninterpreted_option(const google_protobuf_ServiceOptions* msg) {
+ _upb_array_detach(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 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_INLINE google_protobuf_UninterpretedOption** google_protobuf_ServiceOptions_mutable_uninterpreted_option(google_protobuf_ServiceOptions *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_new(upb_Arena* arena) {
+ return (google_protobuf_MethodOptions*)_upb_Message_New(&google_protobuf_MethodOptions_msginit, arena);
}
-UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_MethodOptions* ret = google_protobuf_MethodOptions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MethodOptions_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
+UPB_INLINE char* google_protobuf_MethodOptions_serialize_ex(const google_protobuf_MethodOptions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_MethodOptions_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_MethodOptions_clear_deprecated(const google_protobuf_MethodOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_MethodOptions_clear_idempotency_level(const google_protobuf_MethodOptions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 8));
+}
+UPB_INLINE void google_protobuf_MethodOptions_clear_uninterpreted_option(const google_protobuf_MethodOptions* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
+}
+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(8, 8), len);
}
-
-UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-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(12, 16), len); }
UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(12, 16), len);
+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(8, 8), 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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
-}
-UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
- 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 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, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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_accessor2(msg, UPB_SIZE(56, 80), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(56, 80), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_new(upb_Arena* arena) {
+ return (google_protobuf_UninterpretedOption*)_upb_Message_New(&google_protobuf_UninterpretedOption_msginit, arena);
+}
+UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOption_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_UninterpretedOption* ret = google_protobuf_UninterpretedOption_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_UninterpretedOption_serialize_ex(const google_protobuf_UninterpretedOption* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, options, arena, len);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_name(const google_protobuf_UninterpretedOption* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_identifier_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_identifier_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_identifier_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t google_protobuf_UninterpretedOption_positive_int_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int64_t google_protobuf_UninterpretedOption_negative_int_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_double_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_double_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE double google_protobuf_UninterpretedOption_double_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_string_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_string_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_string_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_has_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_clear_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_aggregate_value(const google_protobuf_UninterpretedOption* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView);
+}
+
+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(4, 8), 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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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_Message_New(&google_protobuf_UninterpretedOption_NamePart_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_positive_int_value(google_protobuf_UninterpretedOption *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 64), uint64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_negative_int_value(google_protobuf_UninterpretedOption *msg, int64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), int64_t) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_set_double_value(google_protobuf_UninterpretedOption *msg, double value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), double) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), double) = value;
}
-UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_UninterpretedOption_set_string_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_UninterpretedOption_set_aggregate_value(google_protobuf_UninterpretedOption *msg, upb_StringView value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), upb_StringView) = 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);
+UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_new(upb_Arena* arena) {
+ return (google_protobuf_UninterpretedOption_NamePart*)_upb_Message_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) {
+ google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_UninterpretedOption_NamePart_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_UninterpretedOption_NamePart* ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, 0, arena, len);
}
-UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_UninterpretedOption_NamePart_serialize_ex(const google_protobuf_UninterpretedOption_NamePart* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, options, arena, len);
}
-UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
- 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, 1);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_UninterpretedOption_NamePart_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_clear_is_extension(const google_protobuf_UninterpretedOption_NamePart* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 2);
+}
+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, 1); }
-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, 2); }
-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_INLINE void google_protobuf_UninterpretedOption_NamePart_set_name_part(google_protobuf_UninterpretedOption_NamePart *msg, upb_StringView 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_StringView) = value;
}
UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(google_protobuf_UninterpretedOption_NamePart *msg, bool value) {
_upb_sethas(msg, 2);
@@ -1686,186 +2778,298 @@ UPB_INLINE void google_protobuf_UninterpretedOption_NamePart_set_is_extension(go
/* 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);
+UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_new(upb_Arena* arena) {
+ return (google_protobuf_SourceCodeInfo*)_upb_Message_New(&google_protobuf_SourceCodeInfo_msginit, arena);
+}
+UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_SourceCodeInfo* ret = google_protobuf_SourceCodeInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, 0, arena, len);
}
-UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_SourceCodeInfo_serialize_ex(const google_protobuf_SourceCodeInfo* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, options, arena, len);
}
-UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
- 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 void google_protobuf_SourceCodeInfo_clear_location(const google_protobuf_SourceCodeInfo* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_SourceCodeInfo_Location_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_new(upb_Arena* arena) {
+ return (google_protobuf_SourceCodeInfo_Location*)_upb_Message_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) {
- google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeInfo_Location_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_SourceCodeInfo_Location* ret = google_protobuf_SourceCodeInfo_Location_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
+UPB_INLINE char* google_protobuf_SourceCodeInfo_Location_serialize_ex(const google_protobuf_SourceCodeInfo_Location* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_span(const google_protobuf_SourceCodeInfo_Location* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_leading_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_has_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE upb_StringView google_protobuf_SourceCodeInfo_Location_trailing_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 56));
+}
+UPB_INLINE upb_StringView const* google_protobuf_SourceCodeInfo_Location_leading_detached_comments(const google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len);
}
-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 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_mutable_path(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), 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_accessor2(msg, UPB_SIZE(20, 40), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, 2, 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_accessor2(msg, UPB_SIZE(20, 40), 2, &val,
- 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_accessor2(msg, UPB_SIZE(4, 8), 2, &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_mutable_span(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), 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_accessor2(msg, UPB_SIZE(24, 48), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, 2, 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_accessor2(msg, UPB_SIZE(24, 48), 2, &val,
- 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_accessor2(msg, UPB_SIZE(8, 16), 2, &val, arena);
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_leading_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_SourceCodeInfo_Location_set_trailing_comments(google_protobuf_SourceCodeInfo_Location *msg, upb_StringView value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = 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_StringView* google_protobuf_SourceCodeInfo_Location_mutable_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* google_protobuf_SourceCodeInfo_Location_resize_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool google_protobuf_SourceCodeInfo_Location_add_leading_detached_comments(google_protobuf_SourceCodeInfo_Location* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &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);
+UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_new(upb_Arena* arena) {
+ return (google_protobuf_GeneratedCodeInfo*)_upb_Message_New(&google_protobuf_GeneratedCodeInfo_msginit, arena);
}
-UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_GeneratedCodeInfo* ret = google_protobuf_GeneratedCodeInfo_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
+UPB_INLINE char* google_protobuf_GeneratedCodeInfo_serialize_ex(const google_protobuf_GeneratedCodeInfo* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, options, 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 void google_protobuf_GeneratedCodeInfo_clear_annotation(const google_protobuf_GeneratedCodeInfo* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_new(upb_Arena* arena) {
+ return (google_protobuf_GeneratedCodeInfo_Annotation*)_upb_Message_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) {
- google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_GeneratedCodeInfo_Annotation* ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
+UPB_INLINE char* google_protobuf_GeneratedCodeInfo_Annotation_serialize_ex(const google_protobuf_GeneratedCodeInfo_Annotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+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(12, 16), len);
+}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView google_protobuf_GeneratedCodeInfo_Annotation_source_file(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool google_protobuf_GeneratedCodeInfo_Annotation_has_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_begin(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+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, 3);
+}
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_end(const google_protobuf_GeneratedCodeInfo_Annotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+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 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, 1); }
-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, 2); }
-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, 3); }
-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_mutable_path(google_protobuf_GeneratedCodeInfo_Annotation* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), 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_accessor2(msg, UPB_SIZE(20, 32), len, 2, arena);
+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_accessor2(msg, UPB_SIZE(12, 16), len, 2, 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_accessor2(msg, UPB_SIZE(20, 32), 2, &val,
- 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_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena);
}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
+UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_begin(google_protobuf_GeneratedCodeInfo_Annotation *msg, int32_t value) {
_upb_sethas(msg, 2);
@@ -1876,6 +3080,12 @@ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_prot
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_MiniTable_File google_protobuf_descriptor_proto_upb_file_layout;
+
+/* Max size 32 is google.protobuf.FileOptions */
+/* Max size 64 is google.protobuf.FileOptions */
+#define _UPB_MAXOPT_SIZE UPB_SIZE(104, 200)
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
index 03d463a0..1ff707e4 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
@@ -7,20 +7,33 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/duration.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field google_protobuf_Duration__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_Duration__fields[2] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Duration_msginit = {
+const upb_MiniTable google_protobuf_Duration_msginit = {
NULL,
&google_protobuf_Duration__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_duration_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
index 4692fd70..f012f1dc 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,39 +22,63 @@ extern "C" {
struct google_protobuf_Duration;
typedef struct google_protobuf_Duration google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_new(upb_Arena* arena) {
+ return (google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
}
-UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Duration *ret = google_protobuf_Duration_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Duration* ret = google_protobuf_Duration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Duration *ret = google_protobuf_Duration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Duration* ret = google_protobuf_Duration_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Duration_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Duration_serialize(const google_protobuf_Duration* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Duration_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Duration_serialize_ex(const google_protobuf_Duration* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Duration_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_Duration_clear_seconds(const google_protobuf_Duration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0;
+}
+UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t);
+}
+UPB_INLINE void google_protobuf_Duration_clear_nanos(const google_protobuf_Duration* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), 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(8, 8), 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(0, 0), int32_t) = value;
}
+extern const upb_MiniTable_File google_protobuf_duration_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
index f634b2be..be9a6612 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
@@ -7,15 +7,28 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/empty.upb.h"
#include "upb/port_def.inc"
-const upb_msglayout google_protobuf_Empty_msginit = {
+const upb_MiniTable google_protobuf_Empty_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_protobuf_Empty_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_empty_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
index 9202b832..0194b9aa 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,30 +22,44 @@ extern "C" {
struct google_protobuf_Empty;
typedef struct google_protobuf_Empty google_protobuf_Empty;
-extern const upb_msglayout google_protobuf_Empty_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_new(upb_Arena* arena) {
+ return (google_protobuf_Empty*)_upb_Message_New(&google_protobuf_Empty_msginit, arena);
+}
+UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Empty* ret = google_protobuf_Empty_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Empty *ret = google_protobuf_Empty_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Empty* ret = google_protobuf_Empty_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Empty_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Empty *ret = google_protobuf_Empty_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_Empty_serialize(const google_protobuf_Empty* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Empty_msginit, 0, arena, len);
}
-UPB_INLINE char *google_protobuf_Empty_serialize(const google_protobuf_Empty *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Empty_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Empty_serialize_ex(const google_protobuf_Empty* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Empty_msginit, options, arena, len);
}
+extern const upb_MiniTable_File google_protobuf_empty_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
index 04b91670..09b3813e 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
@@ -7,72 +7,88 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/struct.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_protobuf_Struct_submsgs[1] = {
- &google_protobuf_Struct_FieldsEntry_msginit,
+static const upb_MiniTable_Sub google_protobuf_Struct_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_FieldsEntry_msginit},
};
-static const upb_msglayout_field google_protobuf_Struct__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field google_protobuf_Struct__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Struct_msginit = {
+const upb_MiniTable google_protobuf_Struct_msginit = {
&google_protobuf_Struct_submsgs[0],
&google_protobuf_Struct__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const google_protobuf_Struct_FieldsEntry_submsgs[1] = {
- &google_protobuf_Value_msginit,
+static const upb_MiniTable_Sub google_protobuf_Struct_FieldsEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Value_msginit},
};
-static const upb_msglayout_field google_protobuf_Struct_FieldsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+static const upb_MiniTable_Field google_protobuf_Struct_FieldsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit = {
+const upb_MiniTable google_protobuf_Struct_FieldsEntry_msginit = {
&google_protobuf_Struct_FieldsEntry_submsgs[0],
&google_protobuf_Struct_FieldsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const google_protobuf_Value_submsgs[2] = {
- &google_protobuf_ListValue_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_MiniTable_Sub google_protobuf_Value_submsgs[2] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &google_protobuf_ListValue_msginit},
};
-static const upb_msglayout_field google_protobuf_Value__fields[6] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+static const upb_MiniTable_Field google_protobuf_Value__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Value_msginit = {
+const upb_MiniTable google_protobuf_Value_msginit = {
&google_protobuf_Value_submsgs[0],
&google_protobuf_Value__fields[0],
- UPB_SIZE(16, 32), 6, false, 255,
+ UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const google_protobuf_ListValue_submsgs[1] = {
- &google_protobuf_Value_msginit,
+static const upb_MiniTable_Sub google_protobuf_ListValue_submsgs[1] = {
+ {.submsg = &google_protobuf_Value_msginit},
};
-static const upb_msglayout_field google_protobuf_ListValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_protobuf_ListValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_ListValue_msginit = {
+const upb_MiniTable google_protobuf_ListValue_msginit = {
&google_protobuf_ListValue_submsgs[0],
&google_protobuf_ListValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &google_protobuf_Struct_msginit,
+ &google_protobuf_Struct_FieldsEntry_msginit,
+ &google_protobuf_Value_msginit,
+ &google_protobuf_ListValue_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
index 29fec82b..29cfef15 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -28,55 +28,86 @@ typedef struct google_protobuf_Struct google_protobuf_Struct;
typedef struct google_protobuf_Struct_FieldsEntry google_protobuf_Struct_FieldsEntry;
typedef struct google_protobuf_Value google_protobuf_Value;
typedef struct google_protobuf_ListValue google_protobuf_ListValue;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit;
-extern const upb_msglayout google_protobuf_Value_msginit;
-extern const upb_msglayout google_protobuf_ListValue_msginit;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+extern const upb_MiniTable google_protobuf_Struct_FieldsEntry_msginit;
+extern const upb_MiniTable google_protobuf_Value_msginit;
+extern const upb_MiniTable google_protobuf_ListValue_msginit;
typedef enum {
google_protobuf_NULL_VALUE = 0
} google_protobuf_NullValue;
+
/* 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);
+UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_new(upb_Arena* arena) {
+ return (google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
}
-UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Struct *ret = google_protobuf_Struct_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Struct* ret = google_protobuf_Struct_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Struct *ret = google_protobuf_Struct_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Struct* ret = google_protobuf_Struct_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Struct_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Struct_serialize(const google_protobuf_Struct *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Struct_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Struct_serialize(const google_protobuf_Struct* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Struct_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Struct_serialize_ex(const google_protobuf_Struct* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Struct_msginit, options, 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 void google_protobuf_Struct_clear_fields(const google_protobuf_Struct* msg) {
+ _upb_array_detach(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_StringView 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_StringView 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_StringView 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_INLINE upb_StringView google_protobuf_Struct_FieldsEntry_key(const google_protobuf_Struct_FieldsEntry* msg) {
+ upb_StringView 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) {
+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;
@@ -88,24 +119,35 @@ UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Str
/* 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);
+UPB_INLINE google_protobuf_Value* google_protobuf_Value_new(upb_Arena* arena) {
+ return (google_protobuf_Value*)_upb_Message_New(&google_protobuf_Value_msginit, arena);
}
-UPB_INLINE google_protobuf_Value *google_protobuf_Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Value *ret = google_protobuf_Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Value_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Value* ret = google_protobuf_Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Value *google_protobuf_Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Value *ret = google_protobuf_Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Value_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Value* ret = google_protobuf_Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Value_serialize(const google_protobuf_Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Value_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Value_serialize(const google_protobuf_Value* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Value_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Value_serialize_ex(const google_protobuf_Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Value_msginit, options, arena, len);
}
-
typedef enum {
google_protobuf_Value_kind_null_value = 1,
google_protobuf_Value_kind_number_value = 2,
@@ -115,52 +157,95 @@ 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 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 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_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 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 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 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(0, 0), int32_t);
+}
+UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void google_protobuf_Value_clear_null_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+UPB_INLINE int32_t google_protobuf_Value_null_value(const google_protobuf_Value* msg) {
+ return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 1, 0);
+}
+UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void google_protobuf_Value_clear_number_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+UPB_INLINE double google_protobuf_Value_number_value(const google_protobuf_Value* msg) {
+ return UPB_READ_ONEOF(msg, double, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 2, 0);
+}
+UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void google_protobuf_Value_clear_string_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+UPB_INLINE upb_StringView google_protobuf_Value_string_value(const google_protobuf_Value* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void google_protobuf_Value_clear_bool_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+UPB_INLINE bool google_protobuf_Value_bool_value(const google_protobuf_Value* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(8, 8), UPB_SIZE(0, 0), 4, false);
+}
+UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 5;
+}
+UPB_INLINE void google_protobuf_Value_clear_struct_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 5, NULL);
+}
+UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 6;
+}
+UPB_INLINE void google_protobuf_Value_clear_list_value(const google_protobuf_Value* msg) {
+ UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(8, 8), 0, UPB_SIZE(0, 0), google_protobuf_Value_kind_NOT_SET);
+}
+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(8, 8), UPB_SIZE(0, 0), 6, NULL);
+}
UPB_INLINE void google_protobuf_Value_set_null_value(google_protobuf_Value *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 1);
}
UPB_INLINE void google_protobuf_Value_set_number_value(google_protobuf_Value *msg, double value) {
- UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE void google_protobuf_Value_set_string_value(google_protobuf_Value *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+UPB_INLINE void google_protobuf_Value_set_string_value(google_protobuf_Value *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 3);
}
UPB_INLINE void google_protobuf_Value_set_bool_value(google_protobuf_Value *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 4);
}
UPB_INLINE void google_protobuf_Value_set_struct_value(google_protobuf_Value *msg, google_protobuf_Struct* value) {
- UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
+ UPB_WRITE_ONEOF(msg, google_protobuf_Struct*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 5);
}
-UPB_INLINE struct google_protobuf_Struct* google_protobuf_Value_mutable_struct_value(google_protobuf_Value *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
google_protobuf_Value_set_struct_value(msg, sub);
}
return sub;
}
UPB_INLINE void google_protobuf_Value_set_list_value(google_protobuf_Value *msg, google_protobuf_ListValue* value) {
- UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
+ UPB_WRITE_ONEOF(msg, google_protobuf_ListValue*, UPB_SIZE(8, 8), value, UPB_SIZE(0, 0), 6);
}
-UPB_INLINE struct google_protobuf_ListValue* google_protobuf_Value_mutable_list_value(google_protobuf_Value *msg, upb_arena *arena) {
+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_Message_New(&google_protobuf_ListValue_msginit, arena);
if (!sub) return NULL;
google_protobuf_Value_set_list_value(msg, sub);
}
@@ -169,41 +254,60 @@ 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);
+UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_new(upb_Arena* arena) {
+ return (google_protobuf_ListValue*)_upb_Message_New(&google_protobuf_ListValue_msginit, arena);
+}
+UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_ListValue* ret = google_protobuf_ListValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_ListValue* ret = google_protobuf_ListValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_ListValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ListValue *ret = google_protobuf_ListValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* google_protobuf_ListValue_serialize(const google_protobuf_ListValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ListValue_msginit, 0, arena, len);
}
-UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ListValue *ret = google_protobuf_ListValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* google_protobuf_ListValue_serialize_ex(const google_protobuf_ListValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_ListValue_msginit, options, arena, len);
}
-UPB_INLINE char *google_protobuf_ListValue_serialize(const google_protobuf_ListValue *msg, upb_arena *arena, size_t *len) {
- 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 void google_protobuf_ListValue_clear_values(const google_protobuf_ListValue* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_Value_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File google_protobuf_struct_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
index 718ce3b9..ab4d5880 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
@@ -7,20 +7,33 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/timestamp.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field google_protobuf_Timestamp__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_Timestamp__fields[2] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Timestamp_msginit = {
+const upb_MiniTable google_protobuf_Timestamp_msginit = {
NULL,
&google_protobuf_Timestamp__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_protobuf_Timestamp_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
index 31c1145a..24060dae 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,39 +22,63 @@ extern "C" {
struct google_protobuf_Timestamp;
typedef struct google_protobuf_Timestamp google_protobuf_Timestamp;
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_new(upb_Arena* arena) {
+ return (google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
}
-UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Timestamp *ret = google_protobuf_Timestamp_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Timestamp *ret = google_protobuf_Timestamp_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Timestamp_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Timestamp_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Timestamp_serialize_ex(const google_protobuf_Timestamp* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Timestamp_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_Timestamp_clear_seconds(const google_protobuf_Timestamp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0;
+}
+UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t);
+}
+UPB_INLINE void google_protobuf_Timestamp_clear_nanos(const google_protobuf_Timestamp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), 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(8, 8), 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(0, 0), int32_t) = value;
}
+extern const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c b/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
index aabc1740..cff3e1c5 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
@@ -7,99 +7,120 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/wrappers.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field google_protobuf_DoubleValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+static const upb_MiniTable_Field google_protobuf_DoubleValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_DoubleValue_msginit = {
+const upb_MiniTable google_protobuf_DoubleValue_msginit = {
NULL,
&google_protobuf_DoubleValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_FloatValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 2, 1},
+static const upb_MiniTable_Field google_protobuf_FloatValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_FloatValue_msginit = {
+const upb_MiniTable google_protobuf_FloatValue_msginit = {
NULL,
&google_protobuf_FloatValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_Int64Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+static const upb_MiniTable_Field google_protobuf_Int64Value__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Int64Value_msginit = {
+const upb_MiniTable google_protobuf_Int64Value_msginit = {
NULL,
&google_protobuf_Int64Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_UInt64Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 4, 1},
+static const upb_MiniTable_Field google_protobuf_UInt64Value__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_UInt64Value_msginit = {
+const upb_MiniTable google_protobuf_UInt64Value_msginit = {
NULL,
&google_protobuf_UInt64Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_Int32Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
+static const upb_MiniTable_Field google_protobuf_Int32Value__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_Int32Value_msginit = {
+const upb_MiniTable google_protobuf_Int32Value_msginit = {
NULL,
&google_protobuf_Int32Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_UInt32Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
+static const upb_MiniTable_Field google_protobuf_UInt32Value__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_UInt32Value_msginit = {
+const upb_MiniTable google_protobuf_UInt32Value_msginit = {
NULL,
&google_protobuf_UInt32Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_BoolValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+static const upb_MiniTable_Field google_protobuf_BoolValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_BoolValue_msginit = {
+const upb_MiniTable google_protobuf_BoolValue_msginit = {
NULL,
&google_protobuf_BoolValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_StringValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field google_protobuf_StringValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_StringValue_msginit = {
+const upb_MiniTable google_protobuf_StringValue_msginit = {
NULL,
&google_protobuf_StringValue__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field google_protobuf_BytesValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 12, 1},
+static const upb_MiniTable_Field google_protobuf_BytesValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_protobuf_BytesValue_msginit = {
+const upb_MiniTable google_protobuf_BytesValue_msginit = {
NULL,
&google_protobuf_BytesValue__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[9] = {
+ &google_protobuf_DoubleValue_msginit,
+ &google_protobuf_FloatValue_msginit,
+ &google_protobuf_Int64Value_msginit,
+ &google_protobuf_UInt64Value_msginit,
+ &google_protobuf_Int32Value_msginit,
+ &google_protobuf_UInt32Value_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_StringValue_msginit,
+ &google_protobuf_BytesValue_msginit,
+};
+
+const upb_MiniTable_File google_protobuf_wrappers_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 9,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h b/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
index c184b805..31541a0c 100644
--- a/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,38 +38,55 @@ typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value;
typedef struct google_protobuf_BoolValue google_protobuf_BoolValue;
typedef struct google_protobuf_StringValue google_protobuf_StringValue;
typedef struct google_protobuf_BytesValue google_protobuf_BytesValue;
-extern const upb_msglayout google_protobuf_DoubleValue_msginit;
-extern const upb_msglayout google_protobuf_FloatValue_msginit;
-extern const upb_msglayout google_protobuf_Int64Value_msginit;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
-extern const upb_msglayout google_protobuf_Int32Value_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_StringValue_msginit;
-extern const upb_msglayout google_protobuf_BytesValue_msginit;
+extern const upb_MiniTable google_protobuf_DoubleValue_msginit;
+extern const upb_MiniTable google_protobuf_FloatValue_msginit;
+extern const upb_MiniTable google_protobuf_Int64Value_msginit;
+extern const upb_MiniTable google_protobuf_UInt64Value_msginit;
+extern const upb_MiniTable google_protobuf_Int32Value_msginit;
+extern const upb_MiniTable google_protobuf_UInt32Value_msginit;
+extern const upb_MiniTable google_protobuf_BoolValue_msginit;
+extern const upb_MiniTable google_protobuf_StringValue_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_new(upb_Arena* arena) {
+ return (google_protobuf_DoubleValue*)_upb_Message_New(&google_protobuf_DoubleValue_msginit, arena);
}
-UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_DoubleValue* ret = google_protobuf_DoubleValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len);
+UPB_INLINE char* google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DoubleValue_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_DoubleValue_serialize_ex(const google_protobuf_DoubleValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_DoubleValue_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_DoubleValue_clear_value(const google_protobuf_DoubleValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+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;
@@ -77,25 +94,41 @@ UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValu
/* 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);
+UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_new(upb_Arena* arena) {
+ return (google_protobuf_FloatValue*)_upb_Message_New(&google_protobuf_FloatValue_msginit, arena);
}
-UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_FloatValue* ret = google_protobuf_FloatValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_FloatValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len);
+UPB_INLINE char* google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FloatValue_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_FloatValue_serialize_ex(const google_protobuf_FloatValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_FloatValue_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_FloatValue_clear_value(const google_protobuf_FloatValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float) = 0;
+}
+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;
@@ -103,25 +136,41 @@ UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue
/* 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);
+UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_new(upb_Arena* arena) {
+ return (google_protobuf_Int64Value*)_upb_Message_New(&google_protobuf_Int64Value_msginit, arena);
}
-UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Int64Value* ret = google_protobuf_Int64Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Int64Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Int64Value_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Int64Value_serialize_ex(const google_protobuf_Int64Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Int64Value_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_Int64Value_clear_value(const google_protobuf_Int64Value* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0;
+}
+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;
@@ -129,25 +178,41 @@ UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value
/* 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);
+UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_new(upb_Arena* arena) {
+ return (google_protobuf_UInt64Value*)_upb_Message_New(&google_protobuf_UInt64Value_msginit, arena);
}
-UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_UInt64Value* ret = google_protobuf_UInt64Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len);
+UPB_INLINE char* google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UInt64Value_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_UInt64Value_serialize_ex(const google_protobuf_UInt64Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UInt64Value_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_UInt64Value_clear_value(const google_protobuf_UInt64Value* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0;
+}
+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;
@@ -155,25 +220,41 @@ UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Valu
/* 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);
+UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_new(upb_Arena* arena) {
+ return (google_protobuf_Int32Value*)_upb_Message_New(&google_protobuf_Int32Value_msginit, arena);
}
-UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_Int32Value* ret = google_protobuf_Int32Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_Int32Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len);
+UPB_INLINE char* google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Int32Value_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_Int32Value_serialize_ex(const google_protobuf_Int32Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_Int32Value_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_Int32Value_clear_value(const google_protobuf_Int32Value* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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;
@@ -181,25 +262,41 @@ UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value
/* 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);
+UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_new(upb_Arena* arena) {
+ return (google_protobuf_UInt32Value*)_upb_Message_New(&google_protobuf_UInt32Value_msginit, arena);
}
-UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_UInt32Value* ret = google_protobuf_UInt32Value_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len);
+UPB_INLINE char* google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UInt32Value_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_UInt32Value_serialize_ex(const google_protobuf_UInt32Value* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_UInt32Value_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_UInt32Value_clear_value(const google_protobuf_UInt32Value* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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;
@@ -207,25 +304,41 @@ UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Valu
/* 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);
+UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_new(upb_Arena* arena) {
+ return (google_protobuf_BoolValue*)_upb_Message_New(&google_protobuf_BoolValue_msginit, arena);
}
-UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_BoolValue* ret = google_protobuf_BoolValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_BoolValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len);
+UPB_INLINE char* google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_BoolValue_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_BoolValue_serialize_ex(const google_protobuf_BoolValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_BoolValue_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_BoolValue_clear_value(const google_protobuf_BoolValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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;
@@ -233,56 +346,90 @@ UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *m
/* 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);
+UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_new(upb_Arena* arena) {
+ return (google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msginit, arena);
}
-UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_StringValue* ret = google_protobuf_StringValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_StringValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_StringValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len);
+UPB_INLINE char* google_protobuf_StringValue_serialize(const google_protobuf_StringValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_StringValue_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_StringValue_serialize_ex(const google_protobuf_StringValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_StringValue_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_StringValue_clear_value(const google_protobuf_StringValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_protobuf_StringValue_value(const google_protobuf_StringValue* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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);
+UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_new(upb_Arena* arena) {
+ return (google_protobuf_BytesValue*)_upb_Message_New(&google_protobuf_BytesValue_msginit, arena);
}
-UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_protobuf_BytesValue* ret = google_protobuf_BytesValue_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_protobuf_BytesValue_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len);
+UPB_INLINE char* google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_BytesValue_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_protobuf_BytesValue_serialize_ex(const google_protobuf_BytesValue* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_protobuf_BytesValue_msginit, options, arena, len);
+}
+UPB_INLINE void google_protobuf_BytesValue_clear_value(const google_protobuf_BytesValue* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_protobuf_BytesValue_value(const google_protobuf_BytesValue* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
+extern const upb_MiniTable_File google_protobuf_wrappers_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c b/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
index e276a0dc..7222380d 100644
--- a/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
+++ b/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
@@ -7,26 +7,39 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/rpc/status.upb.h"
#include "google/protobuf/any.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_rpc_Status_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub google_rpc_Status_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field google_rpc_Status__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+static const upb_MiniTable_Field google_rpc_Status__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout google_rpc_Status_msginit = {
+const upb_MiniTable google_rpc_Status_msginit = {
&google_rpc_Status_submsgs[0],
&google_rpc_Status__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &google_rpc_Status_msginit,
+};
+
+const upb_MiniTable_File google_rpc_status_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h b/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
index 4cc29b3d..65bcadd4 100644
--- a/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
+++ b/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_RPC_STATUS_PROTO_UPB_H_
#define GOOGLE_RPC_STATUS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,56 +22,86 @@ extern "C" {
struct google_rpc_Status;
typedef struct google_rpc_Status google_rpc_Status;
-extern const upb_msglayout google_rpc_Status_msginit;
+extern const upb_MiniTable google_rpc_Status_msginit;
struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE google_rpc_Status* google_rpc_Status_new(upb_Arena* arena) {
+ return (google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena);
}
-UPB_INLINE google_rpc_Status *google_rpc_Status_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_rpc_Status *ret = google_rpc_Status_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena)) ? ret : NULL;
+UPB_INLINE google_rpc_Status* google_rpc_Status_parse(const char* buf, size_t size, upb_Arena* arena) {
+ google_rpc_Status* ret = google_rpc_Status_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE google_rpc_Status *google_rpc_Status_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_rpc_Status *ret = google_rpc_Status_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE google_rpc_Status* google_rpc_Status_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ google_rpc_Status* ret = google_rpc_Status_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *google_rpc_Status_serialize(const google_rpc_Status *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_rpc_Status_msginit, arena, len);
+UPB_INLINE char* google_rpc_Status_serialize(const google_rpc_Status* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_rpc_Status_msginit, 0, arena, len);
+}
+UPB_INLINE char* google_rpc_Status_serialize_ex(const google_rpc_Status* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &google_rpc_Status_msginit, options, arena, len);
+}
+UPB_INLINE void google_rpc_Status_clear_code(const google_rpc_Status* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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 void google_rpc_Status_clear_message(const google_rpc_Status* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView google_rpc_Status_message(const google_rpc_Status* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+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 void google_rpc_Status_clear_details(const google_rpc_Status* msg) {
+ _upb_array_detach(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 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_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_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_Any_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+extern const upb_MiniTable_File google_rpc_status_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c b/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c
new file mode 100644
index 00000000..7537d2e3
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c
@@ -0,0 +1,84 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * opencensus/proto/trace/v1/trace_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "opencensus/proto/trace/v1/trace_config.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub opencensus_proto_trace_v1_TraceConfig_submsgs[3] = {
+ {.submsg = &opencensus_proto_trace_v1_ProbabilitySampler_msginit},
+ {.submsg = &opencensus_proto_trace_v1_ConstantSampler_msginit},
+ {.submsg = &opencensus_proto_trace_v1_RateLimitingSampler_msginit},
+};
+
+static const upb_MiniTable_Field opencensus_proto_trace_v1_TraceConfig__fields[7] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit = {
+ &opencensus_proto_trace_v1_TraceConfig_submsgs[0],
+ &opencensus_proto_trace_v1_TraceConfig__fields[0],
+ UPB_SIZE(40, 56), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
+};
+
+static const upb_MiniTable_Field opencensus_proto_trace_v1_ProbabilitySampler__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msginit = {
+ NULL,
+ &opencensus_proto_trace_v1_ProbabilitySampler__fields[0],
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field opencensus_proto_trace_v1_ConstantSampler__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msginit = {
+ NULL,
+ &opencensus_proto_trace_v1_ConstantSampler__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field opencensus_proto_trace_v1_RateLimitingSampler__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msginit = {
+ NULL,
+ &opencensus_proto_trace_v1_RateLimitingSampler__fields[0],
+ UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &opencensus_proto_trace_v1_TraceConfig_msginit,
+ &opencensus_proto_trace_v1_ProbabilitySampler_msginit,
+ &opencensus_proto_trace_v1_ConstantSampler_msginit,
+ &opencensus_proto_trace_v1_RateLimitingSampler_msginit,
+};
+
+const upb_MiniTable_File opencensus_proto_trace_v1_trace_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 4,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h b/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h
new file mode 100644
index 00000000..a6c68c0a
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h
@@ -0,0 +1,319 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * opencensus/proto/trace/v1/trace_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_
+#define OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct opencensus_proto_trace_v1_TraceConfig;
+struct opencensus_proto_trace_v1_ProbabilitySampler;
+struct opencensus_proto_trace_v1_ConstantSampler;
+struct opencensus_proto_trace_v1_RateLimitingSampler;
+typedef struct opencensus_proto_trace_v1_TraceConfig opencensus_proto_trace_v1_TraceConfig;
+typedef struct opencensus_proto_trace_v1_ProbabilitySampler opencensus_proto_trace_v1_ProbabilitySampler;
+typedef struct opencensus_proto_trace_v1_ConstantSampler opencensus_proto_trace_v1_ConstantSampler;
+typedef struct opencensus_proto_trace_v1_RateLimitingSampler opencensus_proto_trace_v1_RateLimitingSampler;
+extern const upb_MiniTable opencensus_proto_trace_v1_TraceConfig_msginit;
+extern const upb_MiniTable opencensus_proto_trace_v1_ProbabilitySampler_msginit;
+extern const upb_MiniTable opencensus_proto_trace_v1_ConstantSampler_msginit;
+extern const upb_MiniTable opencensus_proto_trace_v1_RateLimitingSampler_msginit;
+
+typedef enum {
+ opencensus_proto_trace_v1_ConstantSampler_ALWAYS_OFF = 0,
+ opencensus_proto_trace_v1_ConstantSampler_ALWAYS_ON = 1,
+ opencensus_proto_trace_v1_ConstantSampler_ALWAYS_PARENT = 2
+} opencensus_proto_trace_v1_ConstantSampler_ConstantDecision;
+
+
+
+/* opencensus.proto.trace.v1.TraceConfig */
+
+UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_TraceConfig_new(upb_Arena* arena) {
+ return (opencensus_proto_trace_v1_TraceConfig*)_upb_Message_New(&opencensus_proto_trace_v1_TraceConfig_msginit, arena);
+}
+UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_TraceConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ opencensus_proto_trace_v1_TraceConfig* ret = opencensus_proto_trace_v1_TraceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_TraceConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ opencensus_proto_trace_v1_TraceConfig* ret = opencensus_proto_trace_v1_TraceConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_TraceConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* opencensus_proto_trace_v1_TraceConfig_serialize(const opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* opencensus_proto_trace_v1_TraceConfig_serialize_ex(const opencensus_proto_trace_v1_TraceConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, options, arena, len);
+}
+typedef enum {
+ opencensus_proto_trace_v1_TraceConfig_sampler_probability_sampler = 1,
+ opencensus_proto_trace_v1_TraceConfig_sampler_constant_sampler = 2,
+ opencensus_proto_trace_v1_TraceConfig_sampler_rate_limiting_sampler = 3,
+ opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET = 0
+} opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases;
+UPB_INLINE opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases opencensus_proto_trace_v1_TraceConfig_sampler_case(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return (opencensus_proto_trace_v1_TraceConfig_sampler_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET);
+}
+UPB_INLINE const opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_TraceConfig_probability_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET);
+}
+UPB_INLINE const opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_TraceConfig_constant_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool opencensus_proto_trace_v1_TraceConfig_has_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), opencensus_proto_trace_v1_TraceConfig_sampler_NOT_SET);
+}
+UPB_INLINE const opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_TraceConfig_rate_limiting_sampler(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return UPB_READ_ONEOF(msg, const opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_attributes(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0;
+}
+UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_attributes(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t);
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_annotations(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0;
+}
+UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_annotations(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t);
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_message_events(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+}
+UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_message_events(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t);
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_clear_max_number_of_links(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0;
+}
+UPB_INLINE int64_t opencensus_proto_trace_v1_TraceConfig_max_number_of_links(const opencensus_proto_trace_v1_TraceConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t);
+}
+
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_probability_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_ProbabilitySampler* value) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ProbabilitySampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_TraceConfig_mutable_probability_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) {
+ struct opencensus_proto_trace_v1_ProbabilitySampler* sub = (struct opencensus_proto_trace_v1_ProbabilitySampler*)opencensus_proto_trace_v1_TraceConfig_probability_sampler(msg);
+ if (sub == NULL) {
+ sub = (struct opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msginit, arena);
+ if (!sub) return NULL;
+ opencensus_proto_trace_v1_TraceConfig_set_probability_sampler(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_constant_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_ConstantSampler* value) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_ConstantSampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_TraceConfig_mutable_constant_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) {
+ struct opencensus_proto_trace_v1_ConstantSampler* sub = (struct opencensus_proto_trace_v1_ConstantSampler*)opencensus_proto_trace_v1_TraceConfig_constant_sampler(msg);
+ if (sub == NULL) {
+ sub = (struct opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msginit, arena);
+ if (!sub) return NULL;
+ opencensus_proto_trace_v1_TraceConfig_set_constant_sampler(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_rate_limiting_sampler(opencensus_proto_trace_v1_TraceConfig *msg, opencensus_proto_trace_v1_RateLimitingSampler* value) {
+ UPB_WRITE_ONEOF(msg, opencensus_proto_trace_v1_RateLimitingSampler*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_TraceConfig_mutable_rate_limiting_sampler(opencensus_proto_trace_v1_TraceConfig* msg, upb_Arena* arena) {
+ struct opencensus_proto_trace_v1_RateLimitingSampler* sub = (struct opencensus_proto_trace_v1_RateLimitingSampler*)opencensus_proto_trace_v1_TraceConfig_rate_limiting_sampler(msg);
+ if (sub == NULL) {
+ sub = (struct opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msginit, arena);
+ if (!sub) return NULL;
+ opencensus_proto_trace_v1_TraceConfig_set_rate_limiting_sampler(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_attributes(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = value;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_annotations(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = value;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_message_events(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = value;
+}
+UPB_INLINE void opencensus_proto_trace_v1_TraceConfig_set_max_number_of_links(opencensus_proto_trace_v1_TraceConfig *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = value;
+}
+
+/* opencensus.proto.trace.v1.ProbabilitySampler */
+
+UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_ProbabilitySampler_new(upb_Arena* arena) {
+ return (opencensus_proto_trace_v1_ProbabilitySampler*)_upb_Message_New(&opencensus_proto_trace_v1_ProbabilitySampler_msginit, arena);
+}
+UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_ProbabilitySampler_parse(const char* buf, size_t size, upb_Arena* arena) {
+ opencensus_proto_trace_v1_ProbabilitySampler* ret = opencensus_proto_trace_v1_ProbabilitySampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_v1_ProbabilitySampler_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ opencensus_proto_trace_v1_ProbabilitySampler* ret = opencensus_proto_trace_v1_ProbabilitySampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* opencensus_proto_trace_v1_ProbabilitySampler_serialize(const opencensus_proto_trace_v1_ProbabilitySampler* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, 0, arena, len);
+}
+UPB_INLINE char* opencensus_proto_trace_v1_ProbabilitySampler_serialize_ex(const opencensus_proto_trace_v1_ProbabilitySampler* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, options, arena, len);
+}
+UPB_INLINE void opencensus_proto_trace_v1_ProbabilitySampler_clear_samplingProbability(const opencensus_proto_trace_v1_ProbabilitySampler* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0;
+}
+UPB_INLINE double opencensus_proto_trace_v1_ProbabilitySampler_samplingProbability(const opencensus_proto_trace_v1_ProbabilitySampler* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double);
+}
+
+UPB_INLINE void opencensus_proto_trace_v1_ProbabilitySampler_set_samplingProbability(opencensus_proto_trace_v1_ProbabilitySampler *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+}
+
+/* opencensus.proto.trace.v1.ConstantSampler */
+
+UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ConstantSampler_new(upb_Arena* arena) {
+ return (opencensus_proto_trace_v1_ConstantSampler*)_upb_Message_New(&opencensus_proto_trace_v1_ConstantSampler_msginit, arena);
+}
+UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ConstantSampler_parse(const char* buf, size_t size, upb_Arena* arena) {
+ opencensus_proto_trace_v1_ConstantSampler* ret = opencensus_proto_trace_v1_ConstantSampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ConstantSampler_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ opencensus_proto_trace_v1_ConstantSampler* ret = opencensus_proto_trace_v1_ConstantSampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_ConstantSampler_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* opencensus_proto_trace_v1_ConstantSampler_serialize(const opencensus_proto_trace_v1_ConstantSampler* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, 0, arena, len);
+}
+UPB_INLINE char* opencensus_proto_trace_v1_ConstantSampler_serialize_ex(const opencensus_proto_trace_v1_ConstantSampler* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, options, arena, len);
+}
+UPB_INLINE void opencensus_proto_trace_v1_ConstantSampler_clear_decision(const opencensus_proto_trace_v1_ConstantSampler* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t opencensus_proto_trace_v1_ConstantSampler_decision(const opencensus_proto_trace_v1_ConstantSampler* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+
+UPB_INLINE void opencensus_proto_trace_v1_ConstantSampler_set_decision(opencensus_proto_trace_v1_ConstantSampler *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* opencensus.proto.trace.v1.RateLimitingSampler */
+
+UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_RateLimitingSampler_new(upb_Arena* arena) {
+ return (opencensus_proto_trace_v1_RateLimitingSampler*)_upb_Message_New(&opencensus_proto_trace_v1_RateLimitingSampler_msginit, arena);
+}
+UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_RateLimitingSampler_parse(const char* buf, size_t size, upb_Arena* arena) {
+ opencensus_proto_trace_v1_RateLimitingSampler* ret = opencensus_proto_trace_v1_RateLimitingSampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace_v1_RateLimitingSampler_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ opencensus_proto_trace_v1_RateLimitingSampler* ret = opencensus_proto_trace_v1_RateLimitingSampler_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* opencensus_proto_trace_v1_RateLimitingSampler_serialize(const opencensus_proto_trace_v1_RateLimitingSampler* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, 0, arena, len);
+}
+UPB_INLINE char* opencensus_proto_trace_v1_RateLimitingSampler_serialize_ex(const opencensus_proto_trace_v1_RateLimitingSampler* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, options, arena, len);
+}
+UPB_INLINE void opencensus_proto_trace_v1_RateLimitingSampler_clear_qps(const opencensus_proto_trace_v1_RateLimitingSampler* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0;
+}
+UPB_INLINE int64_t opencensus_proto_trace_v1_RateLimitingSampler_qps(const opencensus_proto_trace_v1_RateLimitingSampler* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t);
+}
+
+UPB_INLINE void opencensus_proto_trace_v1_RateLimitingSampler_set_qps(opencensus_proto_trace_v1_RateLimitingSampler *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+
+extern const upb_MiniTable_File opencensus_proto_trace_v1_trace_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.c
deleted file mode 100644
index 62947d66..00000000
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/auth/v1/authz_policy.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "src/proto/grpc/auth/v1/authz_policy.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout_field grpc_auth_v1_Peer__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
-};
-
-const upb_msglayout grpc_auth_v1_Peer_msginit = {
- NULL,
- &grpc_auth_v1_Peer__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout_field grpc_auth_v1_Header__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 3},
-};
-
-const upb_msglayout grpc_auth_v1_Header_msginit = {
- NULL,
- &grpc_auth_v1_Header__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-static const upb_msglayout *const grpc_auth_v1_Request_submsgs[1] = {
- &grpc_auth_v1_Header_msginit,
-};
-
-static const upb_msglayout_field grpc_auth_v1_Request__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
- {3, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout grpc_auth_v1_Request_msginit = {
- &grpc_auth_v1_Request_submsgs[0],
- &grpc_auth_v1_Request__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
-};
-
-static const upb_msglayout *const grpc_auth_v1_Rule_submsgs[2] = {
- &grpc_auth_v1_Peer_msginit,
- &grpc_auth_v1_Request_msginit,
-};
-
-static const upb_msglayout_field grpc_auth_v1_Rule__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
-};
-
-const upb_msglayout grpc_auth_v1_Rule_msginit = {
- &grpc_auth_v1_Rule_submsgs[0],
- &grpc_auth_v1_Rule__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
-};
-
-static const upb_msglayout *const grpc_auth_v1_AuthorizationPolicy_submsgs[1] = {
- &grpc_auth_v1_Rule_msginit,
-};
-
-static const upb_msglayout_field grpc_auth_v1_AuthorizationPolicy__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
-};
-
-const upb_msglayout grpc_auth_v1_AuthorizationPolicy_msginit = {
- &grpc_auth_v1_AuthorizationPolicy_submsgs[0],
- &grpc_auth_v1_AuthorizationPolicy__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.h
deleted file mode 100644
index 2177b9df..00000000
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/auth/v1/authz_policy.upb.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/auth/v1/authz_policy.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_
-#define SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct grpc_auth_v1_Peer;
-struct grpc_auth_v1_Header;
-struct grpc_auth_v1_Request;
-struct grpc_auth_v1_Rule;
-struct grpc_auth_v1_AuthorizationPolicy;
-typedef struct grpc_auth_v1_Peer grpc_auth_v1_Peer;
-typedef struct grpc_auth_v1_Header grpc_auth_v1_Header;
-typedef struct grpc_auth_v1_Request grpc_auth_v1_Request;
-typedef struct grpc_auth_v1_Rule grpc_auth_v1_Rule;
-typedef struct grpc_auth_v1_AuthorizationPolicy grpc_auth_v1_AuthorizationPolicy;
-extern const upb_msglayout grpc_auth_v1_Peer_msginit;
-extern const upb_msglayout grpc_auth_v1_Header_msginit;
-extern const upb_msglayout grpc_auth_v1_Request_msginit;
-extern const upb_msglayout grpc_auth_v1_Rule_msginit;
-extern const upb_msglayout grpc_auth_v1_AuthorizationPolicy_msginit;
-
-
-/* grpc.auth.v1.Peer */
-
-UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_new(upb_arena *arena) {
- return (grpc_auth_v1_Peer *)_upb_msg_new(&grpc_auth_v1_Peer_msginit, arena);
-}
-UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_auth_v1_Peer *ret = grpc_auth_v1_Peer_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Peer_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_auth_v1_Peer *grpc_auth_v1_Peer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_auth_v1_Peer *ret = grpc_auth_v1_Peer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Peer_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_auth_v1_Peer_serialize(const grpc_auth_v1_Peer *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_auth_v1_Peer_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* grpc_auth_v1_Peer_principals(const grpc_auth_v1_Peer *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE upb_strview* grpc_auth_v1_Peer_mutable_principals(grpc_auth_v1_Peer *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE upb_strview* grpc_auth_v1_Peer_resize_principals(grpc_auth_v1_Peer *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool grpc_auth_v1_Peer_add_principals(grpc_auth_v1_Peer *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
-}
-
-/* grpc.auth.v1.Header */
-
-UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_new(upb_arena *arena) {
- return (grpc_auth_v1_Header *)_upb_msg_new(&grpc_auth_v1_Header_msginit, arena);
-}
-UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_auth_v1_Header *ret = grpc_auth_v1_Header_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Header_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_auth_v1_Header *grpc_auth_v1_Header_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_auth_v1_Header *ret = grpc_auth_v1_Header_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Header_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_auth_v1_Header_serialize(const grpc_auth_v1_Header *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_auth_v1_Header_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview grpc_auth_v1_Header_key(const grpc_auth_v1_Header *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE upb_strview const* grpc_auth_v1_Header_values(const grpc_auth_v1_Header *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-
-UPB_INLINE void grpc_auth_v1_Header_set_key(grpc_auth_v1_Header *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE upb_strview* grpc_auth_v1_Header_mutable_values(grpc_auth_v1_Header *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE upb_strview* grpc_auth_v1_Header_resize_values(grpc_auth_v1_Header *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool grpc_auth_v1_Header_add_values(grpc_auth_v1_Header *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val,
- arena);
-}
-
-/* grpc.auth.v1.Request */
-
-UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_new(upb_arena *arena) {
- return (grpc_auth_v1_Request *)_upb_msg_new(&grpc_auth_v1_Request_msginit, arena);
-}
-UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_auth_v1_Request *ret = grpc_auth_v1_Request_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Request_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_auth_v1_Request *grpc_auth_v1_Request_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_auth_v1_Request *ret = grpc_auth_v1_Request_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Request_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_auth_v1_Request_serialize(const grpc_auth_v1_Request *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_auth_v1_Request_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* grpc_auth_v1_Request_paths(const grpc_auth_v1_Request *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-UPB_INLINE bool grpc_auth_v1_Request_has_headers(const grpc_auth_v1_Request *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
-UPB_INLINE const grpc_auth_v1_Header* const* grpc_auth_v1_Request_headers(const grpc_auth_v1_Request *msg, size_t *len) { return (const grpc_auth_v1_Header* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
-
-UPB_INLINE upb_strview* grpc_auth_v1_Request_mutable_paths(grpc_auth_v1_Request *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE upb_strview* grpc_auth_v1_Request_resize_paths(grpc_auth_v1_Request *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool grpc_auth_v1_Request_add_paths(grpc_auth_v1_Request *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
-}
-UPB_INLINE grpc_auth_v1_Header** grpc_auth_v1_Request_mutable_headers(grpc_auth_v1_Request *msg, size_t *len) {
- return (grpc_auth_v1_Header**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
-}
-UPB_INLINE grpc_auth_v1_Header** grpc_auth_v1_Request_resize_headers(grpc_auth_v1_Request *msg, size_t len, upb_arena *arena) {
- return (grpc_auth_v1_Header**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
-}
-UPB_INLINE struct grpc_auth_v1_Header* grpc_auth_v1_Request_add_headers(grpc_auth_v1_Request *msg, upb_arena *arena) {
- struct grpc_auth_v1_Header* sub = (struct grpc_auth_v1_Header*)_upb_msg_new(&grpc_auth_v1_Header_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* grpc.auth.v1.Rule */
-
-UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_new(upb_arena *arena) {
- return (grpc_auth_v1_Rule *)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
-}
-UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_auth_v1_Rule *ret = grpc_auth_v1_Rule_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_Rule_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_auth_v1_Rule *grpc_auth_v1_Rule_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_auth_v1_Rule *ret = grpc_auth_v1_Rule_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_Rule_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_auth_v1_Rule_serialize(const grpc_auth_v1_Rule *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_auth_v1_Rule_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview grpc_auth_v1_Rule_name(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool grpc_auth_v1_Rule_has_source(const grpc_auth_v1_Rule *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const grpc_auth_v1_Peer* grpc_auth_v1_Rule_source(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_auth_v1_Peer*); }
-UPB_INLINE bool grpc_auth_v1_Rule_has_request(const grpc_auth_v1_Rule *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const grpc_auth_v1_Request* grpc_auth_v1_Rule_request(const grpc_auth_v1_Rule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const grpc_auth_v1_Request*); }
-
-UPB_INLINE void grpc_auth_v1_Rule_set_name(grpc_auth_v1_Rule *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void grpc_auth_v1_Rule_set_source(grpc_auth_v1_Rule *msg, grpc_auth_v1_Peer* value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_auth_v1_Peer*) = value;
-}
-UPB_INLINE struct grpc_auth_v1_Peer* grpc_auth_v1_Rule_mutable_source(grpc_auth_v1_Rule *msg, upb_arena *arena) {
- struct grpc_auth_v1_Peer* sub = (struct grpc_auth_v1_Peer*)grpc_auth_v1_Rule_source(msg);
- if (sub == NULL) {
- sub = (struct grpc_auth_v1_Peer*)_upb_msg_new(&grpc_auth_v1_Peer_msginit, arena);
- if (!sub) return NULL;
- grpc_auth_v1_Rule_set_source(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void grpc_auth_v1_Rule_set_request(grpc_auth_v1_Rule *msg, grpc_auth_v1_Request* value) {
- _upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), grpc_auth_v1_Request*) = value;
-}
-UPB_INLINE struct grpc_auth_v1_Request* grpc_auth_v1_Rule_mutable_request(grpc_auth_v1_Rule *msg, upb_arena *arena) {
- struct grpc_auth_v1_Request* sub = (struct grpc_auth_v1_Request*)grpc_auth_v1_Rule_request(msg);
- if (sub == NULL) {
- sub = (struct grpc_auth_v1_Request*)_upb_msg_new(&grpc_auth_v1_Request_msginit, arena);
- if (!sub) return NULL;
- grpc_auth_v1_Rule_set_request(msg, sub);
- }
- return sub;
-}
-
-/* grpc.auth.v1.AuthorizationPolicy */
-
-UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_new(upb_arena *arena) {
- return (grpc_auth_v1_AuthorizationPolicy *)_upb_msg_new(&grpc_auth_v1_AuthorizationPolicy_msginit, arena);
-}
-UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_auth_v1_AuthorizationPolicy *ret = grpc_auth_v1_AuthorizationPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_auth_v1_AuthorizationPolicy_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_auth_v1_AuthorizationPolicy *grpc_auth_v1_AuthorizationPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_auth_v1_AuthorizationPolicy *ret = grpc_auth_v1_AuthorizationPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_auth_v1_AuthorizationPolicy_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_auth_v1_AuthorizationPolicy_serialize(const grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_auth_v1_AuthorizationPolicy_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview grpc_auth_v1_AuthorizationPolicy_name(const grpc_auth_v1_AuthorizationPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool grpc_auth_v1_AuthorizationPolicy_has_deny_rules(const grpc_auth_v1_AuthorizationPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const grpc_auth_v1_Rule* const* grpc_auth_v1_AuthorizationPolicy_deny_rules(const grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) { return (const grpc_auth_v1_Rule* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool grpc_auth_v1_AuthorizationPolicy_has_allow_rules(const grpc_auth_v1_AuthorizationPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const grpc_auth_v1_Rule* const* grpc_auth_v1_AuthorizationPolicy_allow_rules(const grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) { return (const grpc_auth_v1_Rule* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
-
-UPB_INLINE void grpc_auth_v1_AuthorizationPolicy_set_name(grpc_auth_v1_AuthorizationPolicy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
-}
-UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_mutable_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) {
- return (grpc_auth_v1_Rule**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
-}
-UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_resize_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t len, upb_arena *arena) {
- return (grpc_auth_v1_Rule**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
-}
-UPB_INLINE struct grpc_auth_v1_Rule* grpc_auth_v1_AuthorizationPolicy_add_deny_rules(grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena) {
- struct grpc_auth_v1_Rule* sub = (struct grpc_auth_v1_Rule*)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_mutable_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t *len) {
- return (grpc_auth_v1_Rule**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
-}
-UPB_INLINE grpc_auth_v1_Rule** grpc_auth_v1_AuthorizationPolicy_resize_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, size_t len, upb_arena *arena) {
- return (grpc_auth_v1_Rule**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
-}
-UPB_INLINE struct grpc_auth_v1_Rule* grpc_auth_v1_AuthorizationPolicy_add_allow_rules(grpc_auth_v1_AuthorizationPolicy *msg, upb_arena *arena) {
- struct grpc_auth_v1_Rule* sub = (struct grpc_auth_v1_Rule*)_upb_msg_new(&grpc_auth_v1_Rule_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
index 8b6de3fb..265b5c22 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
@@ -7,42 +7,56 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/altscontext.upb.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_gcp_AltsContext_submsgs[2] = {
- &grpc_gcp_AltsContext_PeerAttributesEntry_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_MiniTable_Sub grpc_gcp_AltsContext_submsgs[2] = {
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
+ {.submsg = &grpc_gcp_AltsContext_PeerAttributesEntry_msginit},
};
-static const upb_msglayout_field grpc_gcp_AltsContext__fields[7] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {4, UPB_SIZE(24, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 56), 0, 0, 9, 1},
- {6, UPB_SIZE(40, 72), 1, 1, 11, 1},
- {7, UPB_SIZE(44, 80), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field grpc_gcp_AltsContext__fields[7] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(32, 56), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(40, 72), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(44, 80), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_AltsContext_msginit = {
+const upb_MiniTable grpc_gcp_AltsContext_msginit = {
&grpc_gcp_AltsContext_submsgs[0],
&grpc_gcp_AltsContext__fields[0],
- UPB_SIZE(48, 96), 7, false, 255,
+ UPB_SIZE(48, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout_field grpc_gcp_AltsContext_PeerAttributesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+static const upb_MiniTable_Field grpc_gcp_AltsContext_PeerAttributesEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_AltsContext_PeerAttributesEntry_msginit = {
+const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msginit = {
NULL,
&grpc_gcp_AltsContext_PeerAttributesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &grpc_gcp_AltsContext_msginit,
+ &grpc_gcp_AltsContext_PeerAttributesEntry_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_gcp_altscontext_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
index 3a91b53d..ec0a6082 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,94 +24,157 @@ struct grpc_gcp_AltsContext;
struct grpc_gcp_AltsContext_PeerAttributesEntry;
typedef struct grpc_gcp_AltsContext grpc_gcp_AltsContext;
typedef struct grpc_gcp_AltsContext_PeerAttributesEntry grpc_gcp_AltsContext_PeerAttributesEntry;
-extern const upb_msglayout grpc_gcp_AltsContext_msginit;
-extern const upb_msglayout grpc_gcp_AltsContext_PeerAttributesEntry_msginit;
+extern const upb_MiniTable grpc_gcp_AltsContext_msginit;
+extern const upb_MiniTable grpc_gcp_AltsContext_PeerAttributesEntry_msginit;
struct grpc_gcp_RpcProtocolVersions;
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_new(upb_Arena* arena) {
+ return (grpc_gcp_AltsContext*)_upb_Message_New(&grpc_gcp_AltsContext_msginit, arena);
+}
+UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_AltsContext* ret = grpc_gcp_AltsContext_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_AltsContext_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_AltsContext_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_AltsContext_serialize_ex(const grpc_gcp_AltsContext* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_AltsContext_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_application_protocol(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_AltsContext_application_protocol(const grpc_gcp_AltsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_record_protocol(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_AltsContext_record_protocol(const grpc_gcp_AltsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_security_level(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t grpc_gcp_AltsContext_security_level(const grpc_gcp_AltsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_peer_service_account(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_AltsContext_peer_service_account(const grpc_gcp_AltsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_local_service_account(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_AltsContext_local_service_account(const grpc_gcp_AltsContext* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView);
+}
+UPB_INLINE bool grpc_gcp_AltsContext_has_peer_rpc_versions(const grpc_gcp_AltsContext* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_AltsContext_clear_peer_rpc_versions(const grpc_gcp_AltsContext* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+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 void grpc_gcp_AltsContext_clear_peer_attributes(const grpc_gcp_AltsContext* msg) {
+ _upb_array_detach(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_StringView key, upb_StringView* 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(4, 4), 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_hasbit(msg, 1); }
-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_INLINE void grpc_gcp_AltsContext_set_application_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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_INLINE void grpc_gcp_AltsContext_set_record_protocol(grpc_gcp_AltsContext *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_security_level(grpc_gcp_AltsContext *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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_INLINE void grpc_gcp_AltsContext_set_peer_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = 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_INLINE void grpc_gcp_AltsContext_set_local_service_account(grpc_gcp_AltsContext *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_AltsContext_set_peer_rpc_versions(grpc_gcp_AltsContext *msg, struct grpc_gcp_RpcProtocolVersions* value) {
_upb_sethas(msg, 1);
*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) {
+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_Message_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_StringView key, upb_StringView 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_StringView 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_INLINE upb_StringView grpc_gcp_AltsContext_PeerAttributesEntry_key(const grpc_gcp_AltsContext_PeerAttributesEntry* msg) {
+ upb_StringView 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_INLINE upb_StringView grpc_gcp_AltsContext_PeerAttributesEntry_value(const grpc_gcp_AltsContext_PeerAttributesEntry* msg) {
+ upb_StringView 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_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_AltsContext_PeerAttributesEntry *msg, upb_StringView value) {
_upb_msg_map_set_value(msg, &value, 0);
}
+extern const upb_MiniTable_File src_proto_grpc_gcp_altscontext_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
index 998f2d81..d35f3007 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
@@ -7,205 +7,233 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/handshaker.upb.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field grpc_gcp_Endpoint__fields[3] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 5, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field grpc_gcp_Endpoint__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_Endpoint_msginit = {
+const upb_MiniTable grpc_gcp_Endpoint_msginit = {
NULL,
&grpc_gcp_Endpoint__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_Identity_submsgs[1] = {
- &grpc_gcp_Identity_AttributesEntry_msginit,
+static const upb_MiniTable_Sub grpc_gcp_Identity_submsgs[1] = {
+ {.submsg = &grpc_gcp_Identity_AttributesEntry_msginit},
};
-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},
+static const upb_MiniTable_Field grpc_gcp_Identity__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_Identity_msginit = {
+const upb_MiniTable grpc_gcp_Identity_msginit = {
&grpc_gcp_Identity_submsgs[0],
&grpc_gcp_Identity__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout_field grpc_gcp_Identity_AttributesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+static const upb_MiniTable_Field grpc_gcp_Identity_AttributesEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_Identity_AttributesEntry_msginit = {
+const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msginit = {
NULL,
&grpc_gcp_Identity_AttributesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_StartClientHandshakeReq_submsgs[3] = {
- &grpc_gcp_Endpoint_msginit,
- &grpc_gcp_Identity_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_MiniTable_Sub grpc_gcp_StartClientHandshakeReq_submsgs[5] = {
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
-static const upb_msglayout_field grpc_gcp_StartClientHandshakeReq__fields[10] = {
- {1, UPB_SIZE(4, 4), 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), 1, 1, 11, 1},
- {6, UPB_SIZE(24, 40), 2, 0, 11, 1},
- {7, UPB_SIZE(28, 48), 3, 0, 11, 1},
- {8, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {9, UPB_SIZE(32, 56), 4, 2, 11, 1},
- {10, UPB_SIZE(8, 8), 0, 0, 13, 1},
+static const upb_MiniTable_Field grpc_gcp_StartClientHandshakeReq__fields[10] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(36, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(44, 80), UPB_SIZE(4, 4), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_StartClientHandshakeReq_msginit = {
+const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit = {
&grpc_gcp_StartClientHandshakeReq_submsgs[0],
&grpc_gcp_StartClientHandshakeReq__fields[0],
- UPB_SIZE(48, 96), 10, false, 255,
+ UPB_SIZE(48, 88), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_ServerHandshakeParameters_submsgs[1] = {
- &grpc_gcp_Identity_msginit,
+static const upb_MiniTable_Sub grpc_gcp_ServerHandshakeParameters_submsgs[1] = {
+ {.submsg = &grpc_gcp_Identity_msginit},
};
-static const upb_msglayout_field grpc_gcp_ServerHandshakeParameters__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+static const upb_MiniTable_Field grpc_gcp_ServerHandshakeParameters__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_ServerHandshakeParameters_msginit = {
+const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit = {
&grpc_gcp_ServerHandshakeParameters_submsgs[0],
&grpc_gcp_ServerHandshakeParameters__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_submsgs[3] = {
- &grpc_gcp_Endpoint_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
- &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
+static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_submsgs[4] = {
+ {.submsg = &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit},
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
-static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq__fields[7] = {
- {1, UPB_SIZE(28, 48), 0, 0, 9, 3},
- {2, UPB_SIZE(32, 56), 0, 2, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {4, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {5, UPB_SIZE(20, 32), 2, 0, 11, 1},
- {6, UPB_SIZE(24, 40), 3, 1, 11, 1},
- {7, UPB_SIZE(4, 4), 0, 0, 13, 1},
+static const upb_MiniTable_Field grpc_gcp_StartServerHandshakeReq__fields[7] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(1, 1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(2, 2), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 56), UPB_SIZE(3, 3), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_StartServerHandshakeReq_msginit = {
+const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit = {
&grpc_gcp_StartServerHandshakeReq_submsgs[0],
&grpc_gcp_StartServerHandshakeReq__fields[0],
- UPB_SIZE(40, 64), 7, false, 255,
+ UPB_SIZE(36, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = {
- &grpc_gcp_ServerHandshakeParameters_msginit,
+static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = {
+ {.submsg = &grpc_gcp_ServerHandshakeParameters_msginit},
};
-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},
+static const upb_MiniTable_Field grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit = {
+const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit = {
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[0],
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field grpc_gcp_NextHandshakeMessageReq__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 12, 1},
+static const upb_MiniTable_Field grpc_gcp_NextHandshakeMessageReq__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_NextHandshakeMessageReq_msginit = {
+const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit = {
NULL,
&grpc_gcp_NextHandshakeMessageReq__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_HandshakerReq_submsgs[3] = {
- &grpc_gcp_NextHandshakeMessageReq_msginit,
- &grpc_gcp_StartClientHandshakeReq_msginit,
- &grpc_gcp_StartServerHandshakeReq_msginit,
+static const upb_MiniTable_Sub grpc_gcp_HandshakerReq_submsgs[3] = {
+ {.submsg = &grpc_gcp_StartClientHandshakeReq_msginit},
+ {.submsg = &grpc_gcp_StartServerHandshakeReq_msginit},
+ {.submsg = &grpc_gcp_NextHandshakeMessageReq_msginit},
};
-static const upb_msglayout_field grpc_gcp_HandshakerReq__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_MiniTable_Field grpc_gcp_HandshakerReq__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_HandshakerReq_msginit = {
+const upb_MiniTable grpc_gcp_HandshakerReq_msginit = {
&grpc_gcp_HandshakerReq_submsgs[0],
&grpc_gcp_HandshakerReq__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_HandshakerResult_submsgs[2] = {
- &grpc_gcp_Identity_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_MiniTable_Sub grpc_gcp_HandshakerResult_submsgs[3] = {
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
-static const upb_msglayout_field grpc_gcp_HandshakerResult__fields[8] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 32), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 48), 0, 0, 12, 1},
- {4, UPB_SIZE(36, 64), 1, 0, 11, 1},
- {5, UPB_SIZE(40, 72), 2, 0, 11, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(44, 80), 3, 1, 11, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 13, 1},
+static const upb_MiniTable_Field grpc_gcp_HandshakerResult__fields[8] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(32, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(36, 64), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 72), UPB_SIZE(3, 3), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_HandshakerResult_msginit = {
+const upb_MiniTable grpc_gcp_HandshakerResult_msginit = {
&grpc_gcp_HandshakerResult_submsgs[0],
&grpc_gcp_HandshakerResult__fields[0],
- UPB_SIZE(48, 96), 8, false, 255,
+ UPB_SIZE(44, 88), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field grpc_gcp_HandshakerStatus__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+static const upb_MiniTable_Field grpc_gcp_HandshakerStatus__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_HandshakerStatus_msginit = {
+const upb_MiniTable grpc_gcp_HandshakerStatus_msginit = {
NULL,
&grpc_gcp_HandshakerStatus__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const grpc_gcp_HandshakerResp_submsgs[2] = {
- &grpc_gcp_HandshakerResult_msginit,
- &grpc_gcp_HandshakerStatus_msginit,
+static const upb_MiniTable_Sub grpc_gcp_HandshakerResp_submsgs[2] = {
+ {.submsg = &grpc_gcp_HandshakerResult_msginit},
+ {.submsg = &grpc_gcp_HandshakerStatus_msginit},
};
-static const upb_msglayout_field grpc_gcp_HandshakerResp__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {3, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(20, 32), 2, 1, 11, 1},
+static const upb_MiniTable_Field grpc_gcp_HandshakerResp__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_HandshakerResp_msginit = {
+const upb_MiniTable grpc_gcp_HandshakerResp_msginit = {
&grpc_gcp_HandshakerResp_submsgs[0],
&grpc_gcp_HandshakerResp__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[12] = {
+ &grpc_gcp_Endpoint_msginit,
+ &grpc_gcp_Identity_msginit,
+ &grpc_gcp_Identity_AttributesEntry_msginit,
+ &grpc_gcp_StartClientHandshakeReq_msginit,
+ &grpc_gcp_ServerHandshakeParameters_msginit,
+ &grpc_gcp_StartServerHandshakeReq_msginit,
+ &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
+ &grpc_gcp_NextHandshakeMessageReq_msginit,
+ &grpc_gcp_HandshakerReq_msginit,
+ &grpc_gcp_HandshakerResult_msginit,
+ &grpc_gcp_HandshakerStatus_msginit,
+ &grpc_gcp_HandshakerResp_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_gcp_handshaker_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 12,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
index e4c5bf63..78020198 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -44,20 +44,20 @@ typedef struct grpc_gcp_HandshakerReq grpc_gcp_HandshakerReq;
typedef struct grpc_gcp_HandshakerResult grpc_gcp_HandshakerResult;
typedef struct grpc_gcp_HandshakerStatus grpc_gcp_HandshakerStatus;
typedef struct grpc_gcp_HandshakerResp grpc_gcp_HandshakerResp;
-extern const upb_msglayout grpc_gcp_Endpoint_msginit;
-extern const upb_msglayout grpc_gcp_Identity_msginit;
-extern const upb_msglayout grpc_gcp_Identity_AttributesEntry_msginit;
-extern const upb_msglayout grpc_gcp_StartClientHandshakeReq_msginit;
-extern const upb_msglayout grpc_gcp_ServerHandshakeParameters_msginit;
-extern const upb_msglayout grpc_gcp_StartServerHandshakeReq_msginit;
-extern const upb_msglayout grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit;
-extern const upb_msglayout grpc_gcp_NextHandshakeMessageReq_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerReq_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerResult_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerStatus_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerResp_msginit;
+extern const upb_MiniTable grpc_gcp_Endpoint_msginit;
+extern const upb_MiniTable grpc_gcp_Identity_msginit;
+extern const upb_MiniTable grpc_gcp_Identity_AttributesEntry_msginit;
+extern const upb_MiniTable grpc_gcp_StartClientHandshakeReq_msginit;
+extern const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit;
+extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit;
+extern const upb_MiniTable grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit;
+extern const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit;
+extern const upb_MiniTable grpc_gcp_HandshakerReq_msginit;
+extern const upb_MiniTable grpc_gcp_HandshakerResult_msginit;
+extern const upb_MiniTable grpc_gcp_HandshakerStatus_msginit;
+extern const upb_MiniTable grpc_gcp_HandshakerResp_msginit;
struct grpc_gcp_RpcProtocolVersions;
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
+extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit;
typedef enum {
grpc_gcp_HANDSHAKE_PROTOCOL_UNSPECIFIED = 0,
@@ -72,184 +72,322 @@ typedef enum {
} grpc_gcp_NetworkProtocol;
+
/* 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);
+UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_new(upb_Arena* arena) {
+ return (grpc_gcp_Endpoint*)_upb_Message_New(&grpc_gcp_Endpoint_msginit, arena);
+}
+UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_Endpoint* ret = grpc_gcp_Endpoint_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_Endpoint *ret = grpc_gcp_Endpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_Endpoint* ret = grpc_gcp_Endpoint_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_Endpoint *ret = grpc_gcp_Endpoint_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_Endpoint_serialize(const grpc_gcp_Endpoint* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_Endpoint_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_Endpoint_serialize(const grpc_gcp_Endpoint *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_Endpoint_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_Endpoint_serialize_ex(const grpc_gcp_Endpoint* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_Endpoint_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_Endpoint_clear_ip_address(const grpc_gcp_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_Endpoint_ip_address(const grpc_gcp_Endpoint* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_Endpoint_clear_port(const grpc_gcp_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t grpc_gcp_Endpoint_port(const grpc_gcp_Endpoint* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void grpc_gcp_Endpoint_clear_protocol(const grpc_gcp_Endpoint* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t grpc_gcp_Endpoint_protocol(const grpc_gcp_Endpoint* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-UPB_INLINE upb_strview grpc_gcp_Endpoint_ip_address(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE int32_t grpc_gcp_Endpoint_port(const grpc_gcp_Endpoint *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(8, 8), upb_strview) = value;
+UPB_INLINE void grpc_gcp_Endpoint_set_ip_address(grpc_gcp_Endpoint *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_Endpoint_set_port(grpc_gcp_Endpoint *msg, int32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), 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(4, 4), 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);
+UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_new(upb_Arena* arena) {
+ return (grpc_gcp_Identity*)_upb_Message_New(&grpc_gcp_Identity_msginit, arena);
+}
+UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_Identity* ret = grpc_gcp_Identity_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_Identity *ret = grpc_gcp_Identity_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_Identity* ret = grpc_gcp_Identity_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_Identity_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_Identity *ret = grpc_gcp_Identity_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_Identity_serialize(const grpc_gcp_Identity* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_Identity_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_Identity_serialize(const grpc_gcp_Identity *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_Identity_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_Identity_serialize_ex(const grpc_gcp_Identity* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_Identity_msginit, options, arena, len);
}
-
typedef enum {
grpc_gcp_Identity_identity_oneof_service_account = 1,
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 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 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 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(0, 0), int32_t);
+}
+UPB_INLINE bool grpc_gcp_Identity_has_service_account(const grpc_gcp_Identity* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void grpc_gcp_Identity_clear_service_account(const grpc_gcp_Identity* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), grpc_gcp_Identity_identity_oneof_NOT_SET);
+}
+UPB_INLINE upb_StringView grpc_gcp_Identity_service_account(const grpc_gcp_Identity* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool grpc_gcp_Identity_has_hostname(const grpc_gcp_Identity* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void grpc_gcp_Identity_clear_hostname(const grpc_gcp_Identity* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), grpc_gcp_Identity_identity_oneof_NOT_SET);
+}
+UPB_INLINE upb_StringView grpc_gcp_Identity_hostname(const grpc_gcp_Identity* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool grpc_gcp_Identity_has_attributes(const grpc_gcp_Identity* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void grpc_gcp_Identity_clear_attributes(const grpc_gcp_Identity* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE size_t grpc_gcp_Identity_attributes_size(const grpc_gcp_Identity* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE bool grpc_gcp_Identity_attributes_get(const grpc_gcp_Identity* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &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(12, 24), 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);
+UPB_INLINE void grpc_gcp_Identity_set_service_account(grpc_gcp_Identity *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE void grpc_gcp_Identity_set_hostname(grpc_gcp_Identity *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-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(12, 24)); }
+UPB_INLINE bool grpc_gcp_Identity_attributes_set(grpc_gcp_Identity* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool grpc_gcp_Identity_attributes_delete(grpc_gcp_Identity* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &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(12, 24), 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_INLINE upb_StringView grpc_gcp_Identity_AttributesEntry_key(const grpc_gcp_Identity_AttributesEntry* msg) {
+ upb_StringView 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_INLINE upb_StringView grpc_gcp_Identity_AttributesEntry_value(const grpc_gcp_Identity_AttributesEntry* msg) {
+ upb_StringView 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_INLINE void grpc_gcp_Identity_AttributesEntry_set_value(grpc_gcp_Identity_AttributesEntry *msg, upb_StringView value) {
_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);
-}
-UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_StartClientHandshakeReq *ret = grpc_gcp_StartClientHandshakeReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_StartClientHandshakeReq *ret = grpc_gcp_StartClientHandshakeReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_gcp_StartClientHandshakeReq_serialize(const grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena, size_t *len) {
- 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(4, 4), 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_hasbit(msg, 1); }
-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_hasbit(msg, 2); }
-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_hasbit(msg, 3); }
-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_hasbit(msg, 4); }
-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 grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_new(upb_Arena* arena) {
+ return (grpc_gcp_StartClientHandshakeReq*)_upb_Message_New(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
+}
+UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_StartClientHandshakeReq* ret = grpc_gcp_StartClientHandshakeReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_StartClientHandshakeReq* ret = grpc_gcp_StartClientHandshakeReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_gcp_StartClientHandshakeReq_serialize(const grpc_gcp_StartClientHandshakeReq* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_gcp_StartClientHandshakeReq_serialize_ex(const grpc_gcp_StartClientHandshakeReq* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t grpc_gcp_StartClientHandshakeReq_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+UPB_INLINE upb_StringView const* grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len);
+}
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_target_identities(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32));
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_identities(const grpc_gcp_StartClientHandshakeReq* msg) {
+ _upb_array_detach(msg, UPB_SIZE(20, 32));
+}
+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(20, 32), len);
+}
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_local_identity(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Identity*);
+}
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_local_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*);
+}
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_remote_endpoint(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const grpc_gcp_Endpoint*);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_target_name(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_StartClientHandshakeReq_target_name(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView);
+}
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_has_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_rpc_versions(const grpc_gcp_StartClientHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const struct grpc_gcp_RpcProtocolVersions*);
+}
+UPB_INLINE void grpc_gcp_StartClientHandshakeReq_clear_max_frame_size(const grpc_gcp_StartClientHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+}
+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(4, 4), 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);
+UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), 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_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_application_protocols(grpc_gcp_StartClientHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_application_protocols(grpc_gcp_StartClientHandshakeReq* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), UPB_SIZE(3, 4), &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);
+UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_mutable_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), 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_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* grpc_gcp_StartClientHandshakeReq_resize_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_record_protocols(grpc_gcp_StartClientHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool grpc_gcp_StartClientHandshakeReq_add_record_protocols(grpc_gcp_StartClientHandshakeReq* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &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);
+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(20, 32), 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_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(20, 32), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, 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_Message_New(&grpc_gcp_Identity_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(20, 32), UPB_SIZE(2, 3), &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_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_Identity*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Identity*) = value;
}
-UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_mutable_local_identity(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_Identity_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_local_identity(msg, sub);
}
@@ -257,12 +395,12 @@ UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_StartClientHandshakeReq_mutable_lo
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_local_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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_local_endpoint(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_local_endpoint(msg, sub);
}
@@ -270,28 +408,28 @@ UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_lo
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_remote_endpoint(grpc_gcp_StartClientHandshakeReq *msg, grpc_gcp_Endpoint* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), grpc_gcp_Endpoint*) = value;
}
-UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartClientHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
+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_Message_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_INLINE void grpc_gcp_StartClientHandshakeReq_set_target_name(grpc_gcp_StartClientHandshakeReq *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_rpc_versions(grpc_gcp_StartClientHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct grpc_gcp_RpcProtocolVersions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), struct grpc_gcp_RpcProtocolVersions*) = value;
}
-UPB_INLINE struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartClientHandshakeReq_mutable_rpc_versions(grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartClientHandshakeReq_set_rpc_versions(msg, sub);
}
@@ -303,111 +441,195 @@ UPB_INLINE void grpc_gcp_StartClientHandshakeReq_set_max_frame_size(grpc_gcp_Sta
/* 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);
+UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameters_new(upb_Arena* arena) {
+ return (grpc_gcp_ServerHandshakeParameters*)_upb_Message_New(&grpc_gcp_ServerHandshakeParameters_msginit, arena);
+}
+UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameters_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_ServerHandshakeParameters* ret = grpc_gcp_ServerHandshakeParameters_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_ServerHandshakeParameters *ret = grpc_gcp_ServerHandshakeParameters_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameters_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_ServerHandshakeParameters* ret = grpc_gcp_ServerHandshakeParameters_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_ServerHandshakeParameters *ret = grpc_gcp_ServerHandshakeParameters_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_ServerHandshakeParameters_serialize(const grpc_gcp_ServerHandshakeParameters* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_ServerHandshakeParameters_serialize(const grpc_gcp_ServerHandshakeParameters *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_ServerHandshakeParameters_serialize_ex(const grpc_gcp_ServerHandshakeParameters* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_ServerHandshakeParameters_clear_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE upb_StringView const* grpc_gcp_ServerHandshakeParameters_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg, size_t* len) {
+ return (upb_StringView 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 void grpc_gcp_ServerHandshakeParameters_clear_local_identities(const grpc_gcp_ServerHandshakeParameters* msg) {
+ _upb_array_detach(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 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 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_StringView* grpc_gcp_ServerHandshakeParameters_mutable_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* grpc_gcp_ServerHandshakeParameters_resize_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_add_record_protocols(grpc_gcp_ServerHandshakeParameters *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool grpc_gcp_ServerHandshakeParameters_add_record_protocols(grpc_gcp_ServerHandshakeParameters* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena);
}
-UPB_INLINE grpc_gcp_Identity** grpc_gcp_ServerHandshakeParameters_mutable_local_identities(grpc_gcp_ServerHandshakeParameters *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, 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_Message_New(&grpc_gcp_Identity_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
-}
-UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_StartServerHandshakeReq *ret = grpc_gcp_StartServerHandshakeReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_StartServerHandshakeReq *ret = grpc_gcp_StartServerHandshakeReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_gcp_StartServerHandshakeReq_serialize(const grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena, size_t *len) {
- 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(28, 48), len); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56)); }
-UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq *msg) {return _upb_msg_map_size(msg, UPB_SIZE(32, 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(32, 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(32, 56), iter); }
-UPB_INLINE upb_strview grpc_gcp_StartServerHandshakeReq_in_bytes(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_local_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const grpc_gcp_Endpoint*); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_remote_endpoint(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const grpc_gcp_Endpoint*); }
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 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(4, 4), 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(28, 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_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_add_application_protocols(grpc_gcp_StartServerHandshakeReq *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(3, 4), &val,
- arena);
-}
-UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq *msg) { _upb_msg_map_clear(msg, UPB_SIZE(32, 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(32, 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(32, 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(32, 56), iter); }
-UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_in_bytes(grpc_gcp_StartServerHandshakeReq *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
+UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_new(upb_Arena* arena) {
+ return (grpc_gcp_StartServerHandshakeReq*)_upb_Message_New(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
+}
+UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_StartServerHandshakeReq* ret = grpc_gcp_StartServerHandshakeReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_StartServerHandshakeReq* ret = grpc_gcp_StartServerHandshakeReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_gcp_StartServerHandshakeReq_serialize(const grpc_gcp_StartServerHandshakeReq* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_gcp_StartServerHandshakeReq_serialize_ex(const grpc_gcp_StartServerHandshakeReq* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 8));
+}
+UPB_INLINE upb_StringView const* grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len);
+}
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_handshake_parameters(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_handshake_parameters(const grpc_gcp_StartServerHandshakeReq* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(12, 16));
+}
+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(12, 16), &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(12, 16), iter);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_in_bytes(const grpc_gcp_StartServerHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_StartServerHandshakeReq_in_bytes(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_local_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const grpc_gcp_Endpoint*);
+}
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_remote_endpoint(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const grpc_gcp_Endpoint*);
+}
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_has_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct grpc_gcp_RpcProtocolVersions* grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct grpc_gcp_RpcProtocolVersions*);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_max_frame_size(const grpc_gcp_StartServerHandshakeReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t grpc_gcp_StartServerHandshakeReq_max_frame_size(const grpc_gcp_StartServerHandshakeReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+
+UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_mutable_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len);
+}
+UPB_INLINE upb_StringView* grpc_gcp_StartServerHandshakeReq_resize_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_add_application_protocols(grpc_gcp_StartServerHandshakeReq* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 8), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_handshake_parameters_clear(grpc_gcp_StartServerHandshakeReq* msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 16)); }
+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(12, 16), &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(12, 16), &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(12, 16), iter);
+}
+UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_in_bytes(grpc_gcp_StartServerHandshakeReq *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_local_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 24), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), grpc_gcp_Endpoint*) = value;
}
-UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_local_endpoint(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_local_endpoint(msg, sub);
}
@@ -415,12 +637,12 @@ UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_lo
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(grpc_gcp_StartServerHandshakeReq *msg, grpc_gcp_Endpoint* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_Endpoint*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), grpc_gcp_Endpoint*) = value;
}
-UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_remote_endpoint(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_Endpoint_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_remote_endpoint(msg, sub);
}
@@ -428,12 +650,12 @@ UPB_INLINE struct grpc_gcp_Endpoint* grpc_gcp_StartServerHandshakeReq_mutable_re
}
UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_rpc_versions(grpc_gcp_StartServerHandshakeReq *msg, struct grpc_gcp_RpcProtocolVersions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 40), 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_StartServerHandshakeReq_mutable_rpc_versions(grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_StartServerHandshakeReq_set_rpc_versions(msg, sub);
}
@@ -445,13 +667,15 @@ UPB_INLINE void grpc_gcp_StartServerHandshakeReq_set_max_frame_size(grpc_gcp_Sta
/* grpc.gcp.StartServerHandshakeReq.HandshakeParametersEntry */
-UPB_INLINE int32_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key(const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry *msg) {
+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) {
+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;
@@ -463,96 +687,145 @@ UPB_INLINE void grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_va
/* 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);
+UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_new(upb_Arena* arena) {
+ return (grpc_gcp_NextHandshakeMessageReq*)_upb_Message_New(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
+}
+UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_NextHandshakeMessageReq* ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_NextHandshakeMessageReq *ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_NextHandshakeMessageReq* ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_NextHandshakeMessageReq *ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_NextHandshakeMessageReq_serialize(const grpc_gcp_NextHandshakeMessageReq* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_NextHandshakeMessageReq_serialize(const grpc_gcp_NextHandshakeMessageReq *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_NextHandshakeMessageReq_serialize_ex(const grpc_gcp_NextHandshakeMessageReq* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_NextHandshakeMessageReq_clear_in_bytes(const grpc_gcp_NextHandshakeMessageReq* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_NextHandshakeMessageReq_in_bytes(const grpc_gcp_NextHandshakeMessageReq* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_INLINE void grpc_gcp_NextHandshakeMessageReq_set_in_bytes(grpc_gcp_NextHandshakeMessageReq *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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);
+UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_new(upb_Arena* arena) {
+ return (grpc_gcp_HandshakerReq*)_upb_Message_New(&grpc_gcp_HandshakerReq_msginit, arena);
+}
+UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_HandshakerReq* ret = grpc_gcp_HandshakerReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_HandshakerReq *ret = grpc_gcp_HandshakerReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_HandshakerReq* ret = grpc_gcp_HandshakerReq_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_HandshakerReq *ret = grpc_gcp_HandshakerReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerReq_serialize(const grpc_gcp_HandshakerReq* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_HandshakerReq_serialize(const grpc_gcp_HandshakerReq *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_HandshakerReq_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_HandshakerReq_serialize_ex(const grpc_gcp_HandshakerReq* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, options, arena, len);
}
-
typedef enum {
grpc_gcp_HandshakerReq_req_oneof_client_start = 1,
grpc_gcp_HandshakerReq_req_oneof_server_start = 2,
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 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 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 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 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(0, 0), int32_t);
+}
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_client_start(const grpc_gcp_HandshakerReq* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void grpc_gcp_HandshakerReq_clear_client_start(const grpc_gcp_HandshakerReq* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_server_start(const grpc_gcp_HandshakerReq* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void grpc_gcp_HandshakerReq_clear_server_start(const grpc_gcp_HandshakerReq* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool grpc_gcp_HandshakerReq_has_next(const grpc_gcp_HandshakerReq* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void grpc_gcp_HandshakerReq_clear_next(const grpc_gcp_HandshakerReq* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_gcp_HandshakerReq_req_oneof_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
UPB_INLINE void grpc_gcp_HandshakerReq_set_client_start(grpc_gcp_HandshakerReq *msg, grpc_gcp_StartClientHandshakeReq* value) {
- UPB_WRITE_ONEOF(msg, grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+ UPB_WRITE_ONEOF(msg, grpc_gcp_StartClientHandshakeReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct grpc_gcp_StartClientHandshakeReq* grpc_gcp_HandshakerReq_mutable_client_start(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_StartClientHandshakeReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_client_start(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_HandshakerReq_set_server_start(grpc_gcp_HandshakerReq *msg, grpc_gcp_StartServerHandshakeReq* value) {
- UPB_WRITE_ONEOF(msg, grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+ UPB_WRITE_ONEOF(msg, grpc_gcp_StartServerHandshakeReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct grpc_gcp_StartServerHandshakeReq* grpc_gcp_HandshakerReq_mutable_server_start(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_StartServerHandshakeReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_server_start(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_gcp_HandshakerReq_set_next(grpc_gcp_HandshakerReq *msg, grpc_gcp_NextHandshakeMessageReq* value) {
- UPB_WRITE_ONEOF(msg, grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+ UPB_WRITE_ONEOF(msg, grpc_gcp_NextHandshakeMessageReq*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct grpc_gcp_NextHandshakeMessageReq* grpc_gcp_HandshakerReq_mutable_next(grpc_gcp_HandshakerReq *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_NextHandshakeMessageReq_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerReq_set_next(msg, sub);
}
@@ -561,53 +834,110 @@ 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);
+UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_new(upb_Arena* arena) {
+ return (grpc_gcp_HandshakerResult*)_upb_Message_New(&grpc_gcp_HandshakerResult_msginit, arena);
+}
+UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_HandshakerResult* ret = grpc_gcp_HandshakerResult_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_HandshakerResult *ret = grpc_gcp_HandshakerResult_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_HandshakerResult* ret = grpc_gcp_HandshakerResult_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_HandshakerResult *ret = grpc_gcp_HandshakerResult_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerResult_serialize(const grpc_gcp_HandshakerResult* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_gcp_HandshakerResult_serialize(const grpc_gcp_HandshakerResult *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_HandshakerResult_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_HandshakerResult_serialize_ex(const grpc_gcp_HandshakerResult* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_application_protocol(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_application_protocol(const grpc_gcp_HandshakerResult* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_record_protocol(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_record_protocol(const grpc_gcp_HandshakerResult* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_key_data(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_HandshakerResult_key_data(const grpc_gcp_HandshakerResult* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_identity(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const upb_Message*) = NULL;
+}
+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_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_local_identity(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const upb_Message*) = NULL;
+}
+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 void grpc_gcp_HandshakerResult_clear_keep_channel_open(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool grpc_gcp_HandshakerResult_keep_channel_open(const grpc_gcp_HandshakerResult* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void grpc_gcp_HandshakerResult_clear_peer_rpc_versions(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const upb_Message*) = NULL;
+}
+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 void grpc_gcp_HandshakerResult_clear_max_frame_size(const grpc_gcp_HandshakerResult* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t grpc_gcp_HandshakerResult_max_frame_size(const grpc_gcp_HandshakerResult* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
}
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_application_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_record_protocol(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview); }
-UPB_INLINE upb_strview grpc_gcp_HandshakerResult_key_data(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_strview); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_peer_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_has_local_identity(const grpc_gcp_HandshakerResult *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const grpc_gcp_Identity* grpc_gcp_HandshakerResult_local_identity(const grpc_gcp_HandshakerResult *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), 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(8, 8), bool); }
-UPB_INLINE bool grpc_gcp_HandshakerResult_has_peer_rpc_versions(const grpc_gcp_HandshakerResult *msg) { return _upb_hasbit(msg, 3); }
-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(44, 80), 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(4, 4), uint32_t); }
-
-UPB_INLINE void grpc_gcp_HandshakerResult_set_application_protocol(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_strview) = value;
+UPB_INLINE void grpc_gcp_HandshakerResult_set_application_protocol(grpc_gcp_HandshakerResult *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
-UPB_INLINE void grpc_gcp_HandshakerResult_set_record_protocol(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_strview) = value;
+UPB_INLINE void grpc_gcp_HandshakerResult_set_record_protocol(grpc_gcp_HandshakerResult *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
-UPB_INLINE void grpc_gcp_HandshakerResult_set_key_data(grpc_gcp_HandshakerResult *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_strview) = value;
+UPB_INLINE void grpc_gcp_HandshakerResult_set_key_data(grpc_gcp_HandshakerResult *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 64), 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) {
+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_Message_New(&grpc_gcp_Identity_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResult_set_peer_identity(msg, sub);
}
@@ -615,28 +945,28 @@ UPB_INLINE struct grpc_gcp_Identity* grpc_gcp_HandshakerResult_mutable_peer_iden
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_local_identity(grpc_gcp_HandshakerResult *msg, grpc_gcp_Identity* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 72), 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) {
+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_Message_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(8, 8), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResult_set_peer_rpc_versions(grpc_gcp_HandshakerResult *msg, struct grpc_gcp_RpcProtocolVersions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 80), 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) {
+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_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResult_set_peer_rpc_versions(msg, sub);
}
@@ -648,63 +978,119 @@ UPB_INLINE void grpc_gcp_HandshakerResult_set_max_frame_size(grpc_gcp_Handshaker
/* 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);
+UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_new(upb_Arena* arena) {
+ return (grpc_gcp_HandshakerStatus*)_upb_Message_New(&grpc_gcp_HandshakerStatus_msginit, arena);
+}
+UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_HandshakerStatus* ret = grpc_gcp_HandshakerStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_HandshakerStatus* ret = grpc_gcp_HandshakerStatus_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_HandshakerStatus *ret = grpc_gcp_HandshakerStatus_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerStatus_serialize(const grpc_gcp_HandshakerStatus* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, 0, arena, len);
}
-UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_HandshakerStatus *ret = grpc_gcp_HandshakerStatus_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerStatus_serialize_ex(const grpc_gcp_HandshakerStatus* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, options, arena, len);
}
-UPB_INLINE char *grpc_gcp_HandshakerStatus_serialize(const grpc_gcp_HandshakerStatus *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_HandshakerStatus_msginit, arena, len);
+UPB_INLINE void grpc_gcp_HandshakerStatus_clear_code(const grpc_gcp_HandshakerStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 void grpc_gcp_HandshakerStatus_clear_details(const grpc_gcp_HandshakerStatus* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_HandshakerStatus_details(const grpc_gcp_HandshakerStatus* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
}
-
-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_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_INLINE void grpc_gcp_HandshakerStatus_set_details(grpc_gcp_HandshakerStatus *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = 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);
+UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_new(upb_Arena* arena) {
+ return (grpc_gcp_HandshakerResp*)_upb_Message_New(&grpc_gcp_HandshakerResp_msginit, arena);
+}
+UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_HandshakerResp* ret = grpc_gcp_HandshakerResp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_HandshakerResp* ret = grpc_gcp_HandshakerResp_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_HandshakerResp *ret = grpc_gcp_HandshakerResp_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerResp_serialize(const grpc_gcp_HandshakerResp* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, 0, arena, len);
}
-UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_HandshakerResp *ret = grpc_gcp_HandshakerResp_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_gcp_HandshakerResp_serialize_ex(const grpc_gcp_HandshakerResp* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, options, arena, len);
}
-UPB_INLINE char *grpc_gcp_HandshakerResp_serialize(const grpc_gcp_HandshakerResp *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_HandshakerResp_msginit, arena, len);
+UPB_INLINE void grpc_gcp_HandshakerResp_clear_out_frames(const grpc_gcp_HandshakerResp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_gcp_HandshakerResp_out_frames(const grpc_gcp_HandshakerResp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void grpc_gcp_HandshakerResp_clear_bytes_consumed(const grpc_gcp_HandshakerResp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+UPB_INLINE uint32_t grpc_gcp_HandshakerResp_bytes_consumed(const grpc_gcp_HandshakerResp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t);
+}
+UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_HandshakerResp_clear_result(const grpc_gcp_HandshakerResp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_result(const grpc_gcp_HandshakerResp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const grpc_gcp_HandshakerResult*);
+}
+UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_gcp_HandshakerResp_clear_status(const grpc_gcp_HandshakerResp* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_status(const grpc_gcp_HandshakerResp* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 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(8, 8), upb_strview); }
-UPB_INLINE uint32_t grpc_gcp_HandshakerResp_bytes_consumed(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
-UPB_INLINE bool grpc_gcp_HandshakerResp_has_result(const grpc_gcp_HandshakerResp *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_result(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const grpc_gcp_HandshakerResult*); }
-UPB_INLINE bool grpc_gcp_HandshakerResp_has_status(const grpc_gcp_HandshakerResp *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_status(const grpc_gcp_HandshakerResp *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 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(8, 8), upb_strview) = value;
+UPB_INLINE void grpc_gcp_HandshakerResp_set_out_frames(grpc_gcp_HandshakerResp *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
UPB_INLINE void grpc_gcp_HandshakerResp_set_bytes_consumed(grpc_gcp_HandshakerResp *msg, uint32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
@@ -713,10 +1099,10 @@ UPB_INLINE void grpc_gcp_HandshakerResp_set_result(grpc_gcp_HandshakerResp *msg,
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(16, 24), grpc_gcp_HandshakerResult*) = value;
}
-UPB_INLINE struct grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResp_mutable_result(grpc_gcp_HandshakerResp *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_HandshakerResult_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResp_set_result(msg, sub);
}
@@ -726,16 +1112,18 @@ UPB_INLINE void grpc_gcp_HandshakerResp_set_status(grpc_gcp_HandshakerResp *msg,
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(20, 32), grpc_gcp_HandshakerStatus*) = value;
}
-UPB_INLINE struct grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_mutable_status(grpc_gcp_HandshakerResp *msg, upb_arena *arena) {
+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_Message_New(&grpc_gcp_HandshakerStatus_msginit, arena);
if (!sub) return NULL;
grpc_gcp_HandshakerResp_set_status(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File src_proto_grpc_gcp_handshaker_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
index 136c30da..1f9b52e4 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
@@ -7,35 +7,50 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_gcp_RpcProtocolVersions_submsgs[1] = {
- &grpc_gcp_RpcProtocolVersions_Version_msginit,
+static const upb_MiniTable_Sub grpc_gcp_RpcProtocolVersions_submsgs[2] = {
+ {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msginit},
};
-static const upb_msglayout_field grpc_gcp_RpcProtocolVersions__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit = {
+const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit = {
&grpc_gcp_RpcProtocolVersions_submsgs[0],
&grpc_gcp_RpcProtocolVersions__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field grpc_gcp_RpcProtocolVersions_Version__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
+static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions_Version__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_gcp_RpcProtocolVersions_Version_msginit = {
+const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit = {
NULL,
&grpc_gcp_RpcProtocolVersions_Version__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &grpc_gcp_RpcProtocolVersions_msginit,
+ &grpc_gcp_RpcProtocolVersions_Version_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
index 9e02e0b5..6699d531 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,8 +24,8 @@ struct grpc_gcp_RpcProtocolVersions;
struct grpc_gcp_RpcProtocolVersions_Version;
typedef struct grpc_gcp_RpcProtocolVersions grpc_gcp_RpcProtocolVersions;
typedef struct grpc_gcp_RpcProtocolVersions_Version grpc_gcp_RpcProtocolVersions_Version;
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_Version_msginit;
+extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit;
+extern const upb_MiniTable grpc_gcp_RpcProtocolVersions_Version_msginit;
typedef enum {
grpc_gcp_SECURITY_NONE = 0,
@@ -34,39 +34,65 @@ typedef enum {
} grpc_gcp_SecurityLevel;
+
/* 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);
+UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_new(upb_Arena* arena) {
+ return (grpc_gcp_RpcProtocolVersions*)_upb_Message_New(&grpc_gcp_RpcProtocolVersions_msginit, arena);
}
-UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_RpcProtocolVersions* ret = grpc_gcp_RpcProtocolVersions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_RpcProtocolVersions* ret = grpc_gcp_RpcProtocolVersions_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_gcp_RpcProtocolVersions_serialize_ex(const grpc_gcp_RpcProtocolVersions* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const grpc_gcp_RpcProtocolVersions_Version*);
+}
+UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_gcp_RpcProtocolVersions_clear_min_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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(8, 16), const grpc_gcp_RpcProtocolVersions_Version*);
}
-
-UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_hasbit(msg, 1); }
-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(4, 8), const grpc_gcp_RpcProtocolVersions_Version*); }
-UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg) { return _upb_hasbit(msg, 2); }
-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(8, 16), 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_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
if (!sub) return NULL;
grpc_gcp_RpcProtocolVersions_set_max_rpc_version(msg, sub);
}
@@ -76,10 +102,10 @@ UPB_INLINE void grpc_gcp_RpcProtocolVersions_set_min_rpc_version(grpc_gcp_RpcPro
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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) {
+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_Message_New(&grpc_gcp_RpcProtocolVersions_Version_msginit, arena);
if (!sub) return NULL;
grpc_gcp_RpcProtocolVersions_set_min_rpc_version(msg, sub);
}
@@ -88,26 +114,47 @@ 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);
+UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Version_new(upb_Arena* arena) {
+ return (grpc_gcp_RpcProtocolVersions_Version*)_upb_Message_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) {
- grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Version_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_gcp_RpcProtocolVersions_Version* ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Version_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_gcp_RpcProtocolVersions_Version* ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, len);
+UPB_INLINE char* grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_gcp_RpcProtocolVersions_Version_serialize_ex(const grpc_gcp_RpcProtocolVersions_Version* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_clear_major(const grpc_gcp_RpcProtocolVersions_Version* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0;
+}
+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 void grpc_gcp_RpcProtocolVersions_Version_clear_minor(const grpc_gcp_RpcProtocolVersions_Version* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+}
+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;
@@ -116,6 +163,8 @@ UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProto
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
}
+extern const upb_MiniTable_File src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
index df8d8466..6869668e 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
@@ -7,29 +7,43 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/health/v1/health.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field grpc_health_v1_HealthCheckRequest__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field grpc_health_v1_HealthCheckRequest__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_health_v1_HealthCheckRequest_msginit = {
+const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit = {
NULL,
&grpc_health_v1_HealthCheckRequest__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field grpc_health_v1_HealthCheckResponse__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field grpc_health_v1_HealthCheckResponse__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_health_v1_HealthCheckResponse_msginit = {
+const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit = {
NULL,
&grpc_health_v1_HealthCheckResponse__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &grpc_health_v1_HealthCheckRequest_msginit,
+ &grpc_health_v1_HealthCheckResponse_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_health_v1_health_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
index 361b221f..cff014e4 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_
#define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,8 +24,8 @@ struct grpc_health_v1_HealthCheckRequest;
struct grpc_health_v1_HealthCheckResponse;
typedef struct grpc_health_v1_HealthCheckRequest grpc_health_v1_HealthCheckRequest;
typedef struct grpc_health_v1_HealthCheckResponse grpc_health_v1_HealthCheckResponse;
-extern const upb_msglayout grpc_health_v1_HealthCheckRequest_msginit;
-extern const upb_msglayout grpc_health_v1_HealthCheckResponse_msginit;
+extern const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit;
+extern const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit;
typedef enum {
grpc_health_v1_HealthCheckResponse_UNKNOWN = 0,
@@ -35,58 +35,93 @@ typedef enum {
} grpc_health_v1_HealthCheckResponse_ServingStatus;
+
/* 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);
+UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_new(upb_Arena* arena) {
+ return (grpc_health_v1_HealthCheckRequest*)_upb_Message_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) {
- grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_health_v1_HealthCheckRequest* ret = grpc_health_v1_HealthCheckRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_health_v1_HealthCheckRequest* ret = grpc_health_v1_HealthCheckRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, arena, len);
+UPB_INLINE char* grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_health_v1_HealthCheckRequest_serialize_ex(const grpc_health_v1_HealthCheckRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_health_v1_HealthCheckRequest_clear_service(const grpc_health_v1_HealthCheckRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_INLINE void grpc_health_v1_HealthCheckRequest_set_service(grpc_health_v1_HealthCheckRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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);
+UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckResponse_new(upb_Arena* arena) {
+ return (grpc_health_v1_HealthCheckResponse*)_upb_Message_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) {
- grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckResponse_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_health_v1_HealthCheckResponse* ret = grpc_health_v1_HealthCheckResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_health_v1_HealthCheckResponse* ret = grpc_health_v1_HealthCheckResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, arena, len);
+UPB_INLINE char* grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_health_v1_HealthCheckResponse_serialize_ex(const grpc_health_v1_HealthCheckResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_health_v1_HealthCheckResponse_clear_status(const grpc_health_v1_HealthCheckResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+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;
}
+extern const upb_MiniTable_File src_proto_grpc_health_v1_health_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
index 3ecf09f1..bb7a9361 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
@@ -7,134 +7,154 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/lb/v1/load_balancer.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/timestamp.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_lb_v1_LoadBalanceRequest_submsgs[2] = {
- &grpc_lb_v1_ClientStats_msginit,
- &grpc_lb_v1_InitialLoadBalanceRequest_msginit,
+static const upb_MiniTable_Sub grpc_lb_v1_LoadBalanceRequest_submsgs[2] = {
+ {.submsg = &grpc_lb_v1_InitialLoadBalanceRequest_msginit},
+ {.submsg = &grpc_lb_v1_ClientStats_msginit},
};
-static const upb_msglayout_field grpc_lb_v1_LoadBalanceRequest__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},
+static const upb_MiniTable_Field grpc_lb_v1_LoadBalanceRequest__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_LoadBalanceRequest_msginit = {
+const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit = {
&grpc_lb_v1_LoadBalanceRequest_submsgs[0],
&grpc_lb_v1_LoadBalanceRequest__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_InitialLoadBalanceRequest_msginit = {
+const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit = {
NULL,
&grpc_lb_v1_InitialLoadBalanceRequest__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field grpc_lb_v1_ClientStatsPerToken__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
+static const upb_MiniTable_Field grpc_lb_v1_ClientStatsPerToken__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_ClientStatsPerToken_msginit = {
+const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit = {
NULL,
&grpc_lb_v1_ClientStatsPerToken__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const grpc_lb_v1_ClientStats_submsgs[2] = {
- &google_protobuf_Timestamp_msginit,
- &grpc_lb_v1_ClientStatsPerToken_msginit,
+static const upb_MiniTable_Sub grpc_lb_v1_ClientStats_submsgs[2] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &grpc_lb_v1_ClientStatsPerToken_msginit},
};
-static const upb_msglayout_field grpc_lb_v1_ClientStats__fields[6] = {
- {1, UPB_SIZE(40, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 3, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 3, 1},
- {7, UPB_SIZE(32, 32), 0, 0, 3, 1},
- {8, UPB_SIZE(44, 48), 0, 1, 11, 3},
+static const upb_MiniTable_Field grpc_lb_v1_ClientStats__fields[6] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(40, 48), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_ClientStats_msginit = {
+const upb_MiniTable grpc_lb_v1_ClientStats_msginit = {
&grpc_lb_v1_ClientStats_submsgs[0],
&grpc_lb_v1_ClientStats__fields[0],
- UPB_SIZE(48, 56), 6, false, 255,
+ UPB_SIZE(48, 56), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-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_MiniTable_Sub grpc_lb_v1_LoadBalanceResponse_submsgs[3] = {
+ {.submsg = &grpc_lb_v1_InitialLoadBalanceResponse_msginit},
+ {.submsg = &grpc_lb_v1_ServerList_msginit},
+ {.submsg = &grpc_lb_v1_FallbackResponse_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_MiniTable_Field grpc_lb_v1_LoadBalanceResponse__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit = {
+const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit = {
&grpc_lb_v1_LoadBalanceResponse_submsgs[0],
&grpc_lb_v1_LoadBalanceResponse__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+const upb_MiniTable grpc_lb_v1_FallbackResponse_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field grpc_lb_v1_InitialLoadBalanceResponse__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceResponse__fields[1] = {
+ {2, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_InitialLoadBalanceResponse_msginit = {
+const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msginit = {
&grpc_lb_v1_InitialLoadBalanceResponse_submsgs[0],
&grpc_lb_v1_InitialLoadBalanceResponse__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
};
-static const upb_msglayout *const grpc_lb_v1_ServerList_submsgs[1] = {
- &grpc_lb_v1_Server_msginit,
+static const upb_MiniTable_Sub grpc_lb_v1_ServerList_submsgs[1] = {
+ {.submsg = &grpc_lb_v1_Server_msginit},
};
-static const upb_msglayout_field grpc_lb_v1_ServerList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+static const upb_MiniTable_Field grpc_lb_v1_ServerList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_ServerList_msginit = {
+const upb_MiniTable grpc_lb_v1_ServerList_msginit = {
&grpc_lb_v1_ServerList_submsgs[0],
&grpc_lb_v1_ServerList__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field grpc_lb_v1_Server__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(4, 4), 0, 0, 8, 1},
+static const upb_MiniTable_Field grpc_lb_v1_Server__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout grpc_lb_v1_Server_msginit = {
+const upb_MiniTable grpc_lb_v1_Server_msginit = {
NULL,
&grpc_lb_v1_Server__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[9] = {
+ &grpc_lb_v1_LoadBalanceRequest_msginit,
+ &grpc_lb_v1_InitialLoadBalanceRequest_msginit,
+ &grpc_lb_v1_ClientStatsPerToken_msginit,
+ &grpc_lb_v1_ClientStats_msginit,
+ &grpc_lb_v1_LoadBalanceResponse_msginit,
+ &grpc_lb_v1_FallbackResponse_msginit,
+ &grpc_lb_v1_InitialLoadBalanceResponse_msginit,
+ &grpc_lb_v1_ServerList_msginit,
+ &grpc_lb_v1_Server_msginit,
};
-const upb_msglayout grpc_lb_v1_FallbackResponse_msginit = {
+const upb_MiniTable_File src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout = {
+ messages_layout,
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 9,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
index c8c352ce..9209dc56 100644
--- a/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
#define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,85 +25,112 @@ struct grpc_lb_v1_InitialLoadBalanceRequest;
struct grpc_lb_v1_ClientStatsPerToken;
struct grpc_lb_v1_ClientStats;
struct grpc_lb_v1_LoadBalanceResponse;
+struct grpc_lb_v1_FallbackResponse;
struct grpc_lb_v1_InitialLoadBalanceResponse;
struct grpc_lb_v1_ServerList;
struct grpc_lb_v1_Server;
-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;
typedef struct grpc_lb_v1_ClientStats grpc_lb_v1_ClientStats;
typedef struct grpc_lb_v1_LoadBalanceResponse grpc_lb_v1_LoadBalanceResponse;
+typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
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;
-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;
-extern const upb_msglayout grpc_lb_v1_ClientStats_msginit;
-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_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit;
+extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit;
+extern const upb_MiniTable grpc_lb_v1_ClientStatsPerToken_msginit;
+extern const upb_MiniTable grpc_lb_v1_ClientStats_msginit;
+extern const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit;
+extern const upb_MiniTable grpc_lb_v1_FallbackResponse_msginit;
+extern const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msginit;
+extern const upb_MiniTable grpc_lb_v1_ServerList_msginit;
+extern const upb_MiniTable grpc_lb_v1_Server_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;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable 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);
+UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_new(upb_Arena* arena) {
+ return (grpc_lb_v1_LoadBalanceRequest*)_upb_Message_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) {
- grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_LoadBalanceRequest* ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_LoadBalanceRequest* ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_LoadBalanceRequest_serialize(const grpc_lb_v1_LoadBalanceRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_LoadBalanceRequest_serialize(const grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_LoadBalanceRequest_serialize_ex(const grpc_lb_v1_LoadBalanceRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, options, arena, len);
}
-
typedef enum {
grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_initial_request = 1,
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 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 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 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(0, 0), int32_t);
+}
+UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_initial_request(const grpc_lb_v1_LoadBalanceRequest* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_clear_client_stats(const grpc_lb_v1_LoadBalanceRequest* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_InitialLoadBalanceRequest* value) {
- UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
+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_Message_New(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceRequest_set_initial_request(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_ClientStats* value) {
- UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
+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_Message_New(&grpc_lb_v1_ClientStats_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceRequest_set_client_stats(msg, sub);
}
@@ -112,235 +139,396 @@ 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);
+UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRequest_new(upb_Arena* arena) {
+ return (grpc_lb_v1_InitialLoadBalanceRequest*)_upb_Message_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) {
- grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_InitialLoadBalanceRequest* ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_InitialLoadBalanceRequest* ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1_InitialLoadBalanceRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceRequest_serialize_ex(const grpc_lb_v1_InitialLoadBalanceRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_clear_name(const grpc_lb_v1_InitialLoadBalanceRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lb_v1_InitialLoadBalanceRequest_name(const grpc_lb_v1_InitialLoadBalanceRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_set_name(grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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);
+UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_new(upb_Arena* arena) {
+ return (grpc_lb_v1_ClientStatsPerToken*)_upb_Message_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) {
+ grpc_lb_v1_ClientStatsPerToken* ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_ClientStatsPerToken* ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_ClientStatsPerToken* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, 0, arena, len);
}
-UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_ClientStatsPerToken_serialize_ex(const grpc_lb_v1_ClientStatsPerToken* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, options, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_ClientStatsPerToken *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, len);
+UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_clear_load_balance_token(const grpc_lb_v1_ClientStatsPerToken* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lb_v1_ClientStatsPerToken_load_balance_token(const grpc_lb_v1_ClientStatsPerToken* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_clear_num_calls(const grpc_lb_v1_ClientStatsPerToken* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), int64_t) = 0;
+}
+UPB_INLINE int64_t grpc_lb_v1_ClientStatsPerToken_num_calls(const grpc_lb_v1_ClientStatsPerToken* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), 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_INLINE void grpc_lb_v1_ClientStatsPerToken_set_load_balance_token(grpc_lb_v1_ClientStatsPerToken *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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(8, 16), 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);
+UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_new(upb_Arena* arena) {
+ return (grpc_lb_v1_ClientStats*)_upb_Message_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) {
- grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_ClientStats* ret = grpc_lb_v1_ClientStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_ClientStats* ret = grpc_lb_v1_ClientStats_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_ClientStats_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_ClientStats_serialize_ex(const grpc_lb_v1_ClientStats* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_timestamp(const grpc_lb_v1_ClientStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Timestamp*);
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_started(const grpc_lb_v1_ClientStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0;
+}
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_started(const grpc_lb_v1_ClientStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t);
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished(const grpc_lb_v1_ClientStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+}
+UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished(const grpc_lb_v1_ClientStats* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t);
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0;
+}
+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(32, 40), int64_t);
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_num_calls_finished_known_received(const grpc_lb_v1_ClientStats* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0;
+}
+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(40, 48), 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(8, 16));
+}
+UPB_INLINE void grpc_lb_v1_ClientStats_clear_calls_finished_with_drop(const grpc_lb_v1_ClientStats* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
}
-
-UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats *msg) { return _upb_hasbit(msg, 1); }
-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(40, 40), 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(8, 8), 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(16, 16), 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(24, 24), 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(32, 32), 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(44, 48)); }
-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(44, 48), len); }
UPB_INLINE void grpc_lb_v1_ClientStats_set_timestamp(grpc_lb_v1_ClientStats *msg, struct google_protobuf_Timestamp* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), struct google_protobuf_Timestamp*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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_Message_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(8, 8), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), 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(16, 16), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), 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(24, 24), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), 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(32, 32), int64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), 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(44, 48), len);
+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(8, 16), 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_accessor2(msg, UPB_SIZE(44, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(44, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_new(upb_Arena* arena) {
+ return (grpc_lb_v1_LoadBalanceResponse*)_upb_Message_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) {
- grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_LoadBalanceResponse* ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_LoadBalanceResponse* ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadBalanceResponse* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_LoadBalanceResponse_serialize_ex(const grpc_lb_v1_LoadBalanceResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, options, arena, len);
}
-
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_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 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 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 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(0, 0), int32_t);
+}
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_initial_response(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_server_list(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_clear_fallback_response(const grpc_lb_v1_LoadBalanceResponse* msg) {
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET);
+}
+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(4, 8), UPB_SIZE(0, 0), 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);
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_mutable_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
+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_Message_New(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_LoadBalanceResponse_set_initial_response(msg, sub);
}
return sub;
}
UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_server_list(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_ServerList* value) {
- UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+ UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_mutable_server_list(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
+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_Message_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_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
}
-UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mutable_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
+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);
+ sub = (struct grpc_lb_v1_FallbackResponse*)_upb_Message_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 */
+/* grpc.lb.v1.FallbackResponse */
-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);
+UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_new(upb_Arena* arena) {
+ return (grpc_lb_v1_FallbackResponse*)_upb_Message_New(&grpc_lb_v1_FallbackResponse_msginit, arena);
}
-UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena)) ? ret : NULL;
+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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_FallbackResponse* ret = grpc_lb_v1_FallbackResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, options))
- ? 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, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_FallbackResponse_serialize_ex(const grpc_lb_v1_FallbackResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msginit, options, 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(4, 8), upb_strview); }
-UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return _upb_hasbit(msg, 1); }
-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(12, 24), 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(4, 8), upb_strview) = value;
+/* grpc.lb.v1.InitialLoadBalanceResponse */
+
+UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceResponse_new(upb_Arena* arena) {
+ return (grpc_lb_v1_InitialLoadBalanceResponse*)_upb_Message_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) {
+ grpc_lb_v1_InitialLoadBalanceResponse* ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_InitialLoadBalanceResponse* ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v1_InitialLoadBalanceResponse* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, 0, arena, len);
}
+UPB_INLINE char* grpc_lb_v1_InitialLoadBalanceResponse_serialize_ex(const grpc_lb_v1_InitialLoadBalanceResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_clear_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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(4, 8), const struct google_protobuf_Duration*);
+}
+
UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), 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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(msg, sub);
}
@@ -349,100 +537,128 @@ 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);
+UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_new(upb_Arena* arena) {
+ return (grpc_lb_v1_ServerList*)_upb_Message_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) {
- grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_ServerList* ret = grpc_lb_v1_ServerList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_ServerList* ret = grpc_lb_v1_ServerList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_ServerList_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_ServerList_serialize_ex(const grpc_lb_v1_ServerList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, options, 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 void grpc_lb_v1_ServerList_clear_servers(const grpc_lb_v1_ServerList* msg) {
+ _upb_array_detach(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 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) {
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, 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_Message_New(&grpc_lb_v1_Server_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* 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);
+UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_new(upb_Arena* arena) {
+ return (grpc_lb_v1_Server*)_upb_Message_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) {
- grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena)) ? ret : NULL;
+UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lb_v1_Server* ret = grpc_lb_v1_Server_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lb_v1_Server* ret = grpc_lb_v1_Server_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lb_v1_Server_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_Server_msginit, 0, arena, len);
}
-UPB_INLINE char *grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_Server_msginit, arena, len);
+UPB_INLINE char* grpc_lb_v1_Server_serialize_ex(const grpc_lb_v1_Server* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lb_v1_Server_msginit, options, 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 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_INLINE void grpc_lb_v1_Server_clear_ip_address(const grpc_lb_v1_Server* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-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_INLINE upb_StringView grpc_lb_v1_Server_ip_address(const grpc_lb_v1_Server* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
}
-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_INLINE void grpc_lb_v1_Server_clear_port(const grpc_lb_v1_Server* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
}
-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;
+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);
}
-
-/* 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 void grpc_lb_v1_Server_clear_load_balance_token(const grpc_lb_v1_Server* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-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 upb_StringView grpc_lb_v1_Server_load_balance_token(const grpc_lb_v1_Server* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
}
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE void grpc_lb_v1_Server_clear_drop(const grpc_lb_v1_Server* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
}
-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_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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = 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_INLINE void grpc_lb_v1_Server_set_load_balance_token(grpc_lb_v1_Server *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = 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;
+}
+extern const upb_MiniTable_File src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
new file mode 100644
index 00000000..74baa3e9
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
@@ -0,0 +1,70 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "src/proto/grpc/lookup/v1/rls.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupRequest_submsgs[1] = {
+ {.submsg = &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit},
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest__fields[4] = {
+ {3, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit = {
+ &grpc_lookup_v1_RouteLookupRequest_submsgs[0],
+ &grpc_lookup_v1_RouteLookupRequest__fields[0],
+ UPB_SIZE(24, 56), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit = {
+ NULL,
+ &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupResponse__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit = {
+ NULL,
+ &grpc_lookup_v1_RouteLookupResponse__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &grpc_lookup_v1_RouteLookupRequest_msginit,
+ &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit,
+ &grpc_lookup_v1_RouteLookupResponse_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
new file mode 100644
index 00000000..09700e5d
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
@@ -0,0 +1,208 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_
+#define SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct grpc_lookup_v1_RouteLookupRequest;
+struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry;
+struct grpc_lookup_v1_RouteLookupResponse;
+typedef struct grpc_lookup_v1_RouteLookupRequest grpc_lookup_v1_RouteLookupRequest;
+typedef struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry grpc_lookup_v1_RouteLookupRequest_KeyMapEntry;
+typedef struct grpc_lookup_v1_RouteLookupResponse grpc_lookup_v1_RouteLookupResponse;
+extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_msginit;
+extern const upb_MiniTable grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit;
+extern const upb_MiniTable grpc_lookup_v1_RouteLookupResponse_msginit;
+
+typedef enum {
+ grpc_lookup_v1_RouteLookupRequest_REASON_UNKNOWN = 0,
+ grpc_lookup_v1_RouteLookupRequest_REASON_MISS = 1,
+ grpc_lookup_v1_RouteLookupRequest_REASON_STALE = 2
+} grpc_lookup_v1_RouteLookupRequest_Reason;
+
+
+
+/* grpc.lookup.v1.RouteLookupRequest */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_RouteLookupRequest*)_upb_Message_New(&grpc_lookup_v1_RouteLookupRequest_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupRequest_serialize(const grpc_lookup_v1_RouteLookupRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupRequest_serialize_ex(const grpc_lookup_v1_RouteLookupRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_target_type(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_target_type(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_has_key_map(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_key_map(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE size_t grpc_lookup_v1_RouteLookupRequest_key_map_size(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_get(const grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(12, 24), &key, 0, val, 0);
+}
+UPB_INLINE const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_next(const grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) {
+ return (const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_reason(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t grpc_lookup_v1_RouteLookupRequest_reason(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_stale_header_data(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_stale_header_data(const grpc_lookup_v1_RouteLookupRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_target_type(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest* msg) { _upb_msg_map_clear(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_set(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(12, 24), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_delete(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(12, 24), &key, 0);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_nextmutable(grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) {
+ return (grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(12, 24), iter);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_reason(grpc_lookup_v1_RouteLookupRequest *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
+}
+
+/* grpc.lookup.v1.RouteLookupRequest.KeyMapEntry */
+
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_key(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_value(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_set_value(grpc_lookup_v1_RouteLookupRequest_KeyMapEntry *msg, upb_StringView value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+/* grpc.lookup.v1.RouteLookupResponse */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_RouteLookupResponse*)_upb_Message_New(&grpc_lookup_v1_RouteLookupResponse_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupResponse_serialize(const grpc_lookup_v1_RouteLookupResponse* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupResponse_serialize_ex(const grpc_lookup_v1_RouteLookupResponse* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_header_data(const grpc_lookup_v1_RouteLookupResponse* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupResponse_header_data(const grpc_lookup_v1_RouteLookupResponse* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_targets(const grpc_lookup_v1_RouteLookupResponse* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_set_header_data(grpc_lookup_v1_RouteLookupResponse *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupResponse_add_targets(grpc_lookup_v1_RouteLookupResponse* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c
new file mode 100644
index 00000000..32cfcff3
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c
@@ -0,0 +1,175 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "src/proto/grpc/lookup/v1/rls_config.upb.h"
+#include "google/protobuf/duration.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field grpc_lookup_v1_NameMatcher__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_NameMatcher_msginit = {
+ NULL,
+ &grpc_lookup_v1_NameMatcher__fields[0],
+ UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub grpc_lookup_v1_GrpcKeyBuilder_submsgs[4] = {
+ {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit},
+ {.submsg = &grpc_lookup_v1_NameMatcher_msginit},
+ {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit},
+ {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit},
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 3, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msginit = {
+ &grpc_lookup_v1_GrpcKeyBuilder_submsgs[0],
+ &grpc_lookup_v1_GrpcKeyBuilder__fields[0],
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_Name__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msginit = {
+ NULL,
+ &grpc_lookup_v1_GrpcKeyBuilder_Name__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit = {
+ NULL,
+ &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[0],
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit = {
+ NULL,
+ &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub grpc_lookup_v1_HttpKeyBuilder_submsgs[3] = {
+ {.submsg = &grpc_lookup_v1_NameMatcher_msginit},
+ {.submsg = &grpc_lookup_v1_NameMatcher_msginit},
+ {.submsg = &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit},
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder__fields[5] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(0, 0), 2, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msginit = {
+ &grpc_lookup_v1_HttpKeyBuilder_submsgs[0],
+ &grpc_lookup_v1_HttpKeyBuilder__fields[0],
+ UPB_SIZE(20, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit = {
+ NULL,
+ &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupConfig_submsgs[5] = {
+ {.submsg = &grpc_lookup_v1_HttpKeyBuilder_msginit},
+ {.submsg = &grpc_lookup_v1_GrpcKeyBuilder_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupConfig__fields[9] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(24, 48), UPB_SIZE(2, 2), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(3, 3), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(48, 88), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(32, 64), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(36, 72), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msginit = {
+ &grpc_lookup_v1_RouteLookupConfig_submsgs[0],
+ &grpc_lookup_v1_RouteLookupConfig__fields[0],
+ UPB_SIZE(56, 104), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
+};
+
+static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[1] = {
+ {.submsg = &grpc_lookup_v1_RouteLookupConfig_msginit},
+};
+
+static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupClusterSpecifier__fields[1] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit = {
+ &grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[0],
+ &grpc_lookup_v1_RouteLookupClusterSpecifier__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[9] = {
+ &grpc_lookup_v1_NameMatcher_msginit,
+ &grpc_lookup_v1_GrpcKeyBuilder_msginit,
+ &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit,
+ &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit,
+ &grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit,
+ &grpc_lookup_v1_HttpKeyBuilder_msginit,
+ &grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit,
+ &grpc_lookup_v1_RouteLookupConfig_msginit,
+ &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit,
+};
+
+const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 9,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h
new file mode 100644
index 00000000..e84e3144
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h
@@ -0,0 +1,764 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_
+#define SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct grpc_lookup_v1_NameMatcher;
+struct grpc_lookup_v1_GrpcKeyBuilder;
+struct grpc_lookup_v1_GrpcKeyBuilder_Name;
+struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys;
+struct grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry;
+struct grpc_lookup_v1_HttpKeyBuilder;
+struct grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry;
+struct grpc_lookup_v1_RouteLookupConfig;
+struct grpc_lookup_v1_RouteLookupClusterSpecifier;
+typedef struct grpc_lookup_v1_NameMatcher grpc_lookup_v1_NameMatcher;
+typedef struct grpc_lookup_v1_GrpcKeyBuilder grpc_lookup_v1_GrpcKeyBuilder;
+typedef struct grpc_lookup_v1_GrpcKeyBuilder_Name grpc_lookup_v1_GrpcKeyBuilder_Name;
+typedef struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys;
+typedef struct grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry;
+typedef struct grpc_lookup_v1_HttpKeyBuilder grpc_lookup_v1_HttpKeyBuilder;
+typedef struct grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry;
+typedef struct grpc_lookup_v1_RouteLookupConfig grpc_lookup_v1_RouteLookupConfig;
+typedef struct grpc_lookup_v1_RouteLookupClusterSpecifier grpc_lookup_v1_RouteLookupClusterSpecifier;
+extern const upb_MiniTable grpc_lookup_v1_NameMatcher_msginit;
+extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_msginit;
+extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_Name_msginit;
+extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit;
+extern const upb_MiniTable grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_msginit;
+extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_msginit;
+extern const upb_MiniTable grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_msginit;
+extern const upb_MiniTable grpc_lookup_v1_RouteLookupConfig_msginit;
+extern const upb_MiniTable grpc_lookup_v1_RouteLookupClusterSpecifier_msginit;
+struct google_protobuf_Duration;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+
+
+
+/* grpc.lookup.v1.NameMatcher */
+
+UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_NameMatcher* ret = grpc_lookup_v1_NameMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_NameMatcher* ret = grpc_lookup_v1_NameMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_NameMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_NameMatcher_serialize(const grpc_lookup_v1_NameMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_NameMatcher_serialize_ex(const grpc_lookup_v1_NameMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_key(const grpc_lookup_v1_NameMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_NameMatcher_key(const grpc_lookup_v1_NameMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_names(const grpc_lookup_v1_NameMatcher* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE upb_StringView const* grpc_lookup_v1_NameMatcher_names(const grpc_lookup_v1_NameMatcher* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE void grpc_lookup_v1_NameMatcher_clear_required_match(const grpc_lookup_v1_NameMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool grpc_lookup_v1_NameMatcher_required_match(const grpc_lookup_v1_NameMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+
+UPB_INLINE void grpc_lookup_v1_NameMatcher_set_key(grpc_lookup_v1_NameMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_mutable_names(grpc_lookup_v1_NameMatcher* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_NameMatcher_resize_names(grpc_lookup_v1_NameMatcher* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_NameMatcher_add_names(grpc_lookup_v1_NameMatcher* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE void grpc_lookup_v1_NameMatcher_set_required_match(grpc_lookup_v1_NameMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* grpc.lookup.v1.GrpcKeyBuilder */
+
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder* ret = grpc_lookup_v1_GrpcKeyBuilder_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder* ret = grpc_lookup_v1_GrpcKeyBuilder_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_serialize(const grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_serialize_ex(const grpc_lookup_v1_GrpcKeyBuilder* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_names(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_names(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_Name* const* grpc_lookup_v1_GrpcKeyBuilder_names(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) {
+ return (const grpc_lookup_v1_GrpcKeyBuilder_Name* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_GrpcKeyBuilder_headers(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) {
+ return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_extra_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*);
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_has_constant_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_clear_constant_keys(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE size_t grpc_lookup_v1_GrpcKeyBuilder_constant_keys_size(const grpc_lookup_v1_GrpcKeyBuilder* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_get(const grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, 0);
+}
+UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_GrpcKeyBuilder_constant_keys_next(const grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* iter) {
+ return (const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter);
+}
+
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_mutable_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) {
+ return (grpc_lookup_v1_GrpcKeyBuilder_Name**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name** grpc_lookup_v1_GrpcKeyBuilder_resize_names(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_GrpcKeyBuilder_Name**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_add_names(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_GrpcKeyBuilder_Name* sub = (struct grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_mutable_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* len) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_GrpcKeyBuilder_resize_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_GrpcKeyBuilder_add_headers(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_set_extra_keys(grpc_lookup_v1_GrpcKeyBuilder *msg, grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*) = value;
+}
+UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_mutable_extra_keys(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* sub = (struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)grpc_lookup_v1_GrpcKeyBuilder_extra_keys(msg);
+ if (sub == NULL) {
+ sub = (struct grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lookup_v1_GrpcKeyBuilder_set_extra_keys(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_constant_keys_clear(grpc_lookup_v1_GrpcKeyBuilder* msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_set(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool grpc_lookup_v1_GrpcKeyBuilder_constant_keys_delete(grpc_lookup_v1_GrpcKeyBuilder* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_GrpcKeyBuilder_constant_keys_nextmutable(grpc_lookup_v1_GrpcKeyBuilder* msg, size_t* iter) {
+ return (grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter);
+}
+
+/* grpc.lookup.v1.GrpcKeyBuilder.Name */
+
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Name_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_GrpcKeyBuilder_Name*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Name_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder_Name* ret = grpc_lookup_v1_GrpcKeyBuilder_Name_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Name_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder_Name* ret = grpc_lookup_v1_GrpcKeyBuilder_Name_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_Name_serialize(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_Name_serialize_ex(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_clear_service(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_Name_service(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_clear_method(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_Name_method(const grpc_lookup_v1_GrpcKeyBuilder_Name* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_set_service(grpc_lookup_v1_GrpcKeyBuilder_Name *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_Name_set_method(grpc_lookup_v1_GrpcKeyBuilder_Name *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+
+/* grpc.lookup.v1.GrpcKeyBuilder.ExtraKeys */
+
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* ret = grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* ret = grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_serialize(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_serialize_ex(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_host(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_host(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_service(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_service(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_clear_method(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_method(const grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView);
+}
+
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_host(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_service(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_set_method(grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_StringView) = value;
+}
+
+/* grpc.lookup.v1.GrpcKeyBuilder.ConstantKeysEntry */
+
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_key(const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_value(const grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_set_value(grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry *msg, upb_StringView value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+/* grpc.lookup.v1.HttpKeyBuilder */
+
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_HttpKeyBuilder* ret = grpc_lookup_v1_HttpKeyBuilder_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_HttpKeyBuilder* ret = grpc_lookup_v1_HttpKeyBuilder_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_HttpKeyBuilder_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_HttpKeyBuilder_serialize(const grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_HttpKeyBuilder_serialize_ex(const grpc_lookup_v1_HttpKeyBuilder* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, options, arena, len);
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE upb_StringView const* grpc_lookup_v1_HttpKeyBuilder_path_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_query_parameters(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_headers(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_headers(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 24));
+}
+UPB_INLINE const grpc_lookup_v1_NameMatcher* const* grpc_lookup_v1_HttpKeyBuilder_headers(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (const grpc_lookup_v1_NameMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_has_constant_keys(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_constant_keys(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE size_t grpc_lookup_v1_HttpKeyBuilder_constant_keys_size(const grpc_lookup_v1_HttpKeyBuilder* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(16, 32));
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_get(const grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(16, 32), &key, 0, val, 0);
+}
+UPB_INLINE const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_HttpKeyBuilder_constant_keys_next(const grpc_lookup_v1_HttpKeyBuilder* msg, size_t* iter) {
+ return (const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter);
+}
+
+UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_add_host_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_mutable_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_HttpKeyBuilder_resize_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_add_path_patterns(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_HttpKeyBuilder_add_query_parameters(grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_mutable_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* len) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE grpc_lookup_v1_NameMatcher** grpc_lookup_v1_HttpKeyBuilder_resize_headers(grpc_lookup_v1_HttpKeyBuilder* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_NameMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_NameMatcher* grpc_lookup_v1_HttpKeyBuilder_add_headers(grpc_lookup_v1_HttpKeyBuilder* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_NameMatcher* sub = (struct grpc_lookup_v1_NameMatcher*)_upb_Message_New(&grpc_lookup_v1_NameMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_constant_keys_clear(grpc_lookup_v1_HttpKeyBuilder* msg) { _upb_msg_map_clear(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_set(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(16, 32), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool grpc_lookup_v1_HttpKeyBuilder_constant_keys_delete(grpc_lookup_v1_HttpKeyBuilder* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(16, 32), &key, 0);
+}
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* grpc_lookup_v1_HttpKeyBuilder_constant_keys_nextmutable(grpc_lookup_v1_HttpKeyBuilder* msg, size_t* iter) {
+ return (grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry*)_upb_msg_map_next(msg, UPB_SIZE(16, 32), iter);
+}
+
+/* grpc.lookup.v1.HttpKeyBuilder.ConstantKeysEntry */
+
+UPB_INLINE upb_StringView grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_key(const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_value(const grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_set_value(grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry *msg, upb_StringView value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+/* grpc.lookup.v1.RouteLookupConfig */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupConfig* ret = grpc_lookup_v1_RouteLookupConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupConfig* ret = grpc_lookup_v1_RouteLookupConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupConfig_serialize(const grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupConfig_serialize_ex(const grpc_lookup_v1_RouteLookupConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE const grpc_lookup_v1_HttpKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_http_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (const grpc_lookup_v1_HttpKeyBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const grpc_lookup_v1_GrpcKeyBuilder* const* grpc_lookup_v1_RouteLookupConfig_grpc_keybuilders(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (const grpc_lookup_v1_GrpcKeyBuilder* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupConfig_lookup_service(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_lookup_service_timeout(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_max_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct google_protobuf_Duration*);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_has_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_stale_age(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_cache_size_bytes(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t) = 0;
+}
+UPB_INLINE int64_t grpc_lookup_v1_RouteLookupConfig_cache_size_bytes(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 64));
+}
+UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupConfig_valid_targets(const grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_clear_default_target(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupConfig_default_target(const grpc_lookup_v1_RouteLookupConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView);
+}
+
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (grpc_lookup_v1_HttpKeyBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE grpc_lookup_v1_HttpKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_HttpKeyBuilder**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_RouteLookupConfig_add_http_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_HttpKeyBuilder* sub = (struct grpc_lookup_v1_HttpKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_HttpKeyBuilder_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_mutable_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (grpc_lookup_v1_GrpcKeyBuilder**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder** grpc_lookup_v1_RouteLookupConfig_resize_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) {
+ return (grpc_lookup_v1_GrpcKeyBuilder**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_RouteLookupConfig_add_grpc_keybuilders(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_GrpcKeyBuilder* sub = (struct grpc_lookup_v1_GrpcKeyBuilder*)_upb_Message_New(&grpc_lookup_v1_GrpcKeyBuilder_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_lookup_service(grpc_lookup_v1_RouteLookupConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_lookup_service_timeout(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_lookup_service_timeout(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_lookup_service_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lookup_v1_RouteLookupConfig_set_lookup_service_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_max_age(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_max_age(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_max_age(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lookup_v1_RouteLookupConfig_set_max_age(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_stale_age(grpc_lookup_v1_RouteLookupConfig *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* grpc_lookup_v1_RouteLookupConfig_mutable_stale_age(grpc_lookup_v1_RouteLookupConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lookup_v1_RouteLookupConfig_stale_age(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lookup_v1_RouteLookupConfig_set_stale_age(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_cache_size_bytes(grpc_lookup_v1_RouteLookupConfig *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), int64_t) = value;
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_mutable_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+}
+UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupConfig_resize_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupConfig_add_valid_targets(grpc_lookup_v1_RouteLookupConfig* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val, arena);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupConfig_set_default_target(grpc_lookup_v1_RouteLookupConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 72), upb_StringView) = value;
+}
+
+/* grpc.lookup.v1.RouteLookupClusterSpecifier */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLookupClusterSpecifier_new(upb_Arena* arena) {
+ return (grpc_lookup_v1_RouteLookupClusterSpecifier*)_upb_Message_New(&grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLookupClusterSpecifier_parse(const char* buf, size_t size, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupClusterSpecifier* ret = grpc_lookup_v1_RouteLookupClusterSpecifier_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLookupClusterSpecifier_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ grpc_lookup_v1_RouteLookupClusterSpecifier* ret = grpc_lookup_v1_RouteLookupClusterSpecifier_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupClusterSpecifier_serialize(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, 0, arena, len);
+}
+UPB_INLINE char* grpc_lookup_v1_RouteLookupClusterSpecifier_serialize_ex(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, options, arena, len);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupClusterSpecifier_has_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupClusterSpecifier_clear_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupClusterSpecifier_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const grpc_lookup_v1_RouteLookupConfig*);
+}
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupClusterSpecifier_set_route_lookup_config(grpc_lookup_v1_RouteLookupClusterSpecifier *msg, grpc_lookup_v1_RouteLookupConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), grpc_lookup_v1_RouteLookupConfig*) = value;
+}
+UPB_INLINE struct grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupClusterSpecifier_mutable_route_lookup_config(grpc_lookup_v1_RouteLookupClusterSpecifier* msg, upb_Arena* arena) {
+ struct grpc_lookup_v1_RouteLookupConfig* sub = (struct grpc_lookup_v1_RouteLookupConfig*)grpc_lookup_v1_RouteLookupClusterSpecifier_route_lookup_config(msg);
+ if (sub == NULL) {
+ sub = (struct grpc_lookup_v1_RouteLookupConfig*)_upb_Message_New(&grpc_lookup_v1_RouteLookupConfig_msginit, arena);
+ if (!sub) return NULL;
+ grpc_lookup_v1_RouteLookupClusterSpecifier_set_route_lookup_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.c b/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.c
deleted file mode 100644
index a4d95cc6..00000000
--- a/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * third_party/istio/security/proto/providers/google/meshca.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "third_party/istio/security/proto/providers/google/meshca.upb.h"
-#include "google/protobuf/duration.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const google_security_meshca_v1_MeshCertificateRequest_submsgs[1] = {
- &google_protobuf_Duration_msginit,
-};
-
-static const upb_msglayout_field google_security_meshca_v1_MeshCertificateRequest__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 1, 0, 11, 1},
-};
-
-const upb_msglayout google_security_meshca_v1_MeshCertificateRequest_msginit = {
- &google_security_meshca_v1_MeshCertificateRequest_submsgs[0],
- &google_security_meshca_v1_MeshCertificateRequest__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
-};
-
-static const upb_msglayout_field google_security_meshca_v1_MeshCertificateResponse__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
-};
-
-const upb_msglayout google_security_meshca_v1_MeshCertificateResponse_msginit = {
- NULL,
- &google_security_meshca_v1_MeshCertificateResponse__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.h b/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.h
deleted file mode 100644
index f301a028..00000000
--- a/grpc/src/core/ext/upb-generated/third_party/istio/security/proto/providers/google/meshca.upb.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * third_party/istio/security/proto/providers/google/meshca.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPB_H_
-#define THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct google_security_meshca_v1_MeshCertificateRequest;
-struct google_security_meshca_v1_MeshCertificateResponse;
-typedef struct google_security_meshca_v1_MeshCertificateRequest google_security_meshca_v1_MeshCertificateRequest;
-typedef struct google_security_meshca_v1_MeshCertificateResponse google_security_meshca_v1_MeshCertificateResponse;
-extern const upb_msglayout google_security_meshca_v1_MeshCertificateRequest_msginit;
-extern const upb_msglayout google_security_meshca_v1_MeshCertificateResponse_msginit;
-struct google_protobuf_Duration;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-
-/* google.security.meshca.v1.MeshCertificateRequest */
-
-UPB_INLINE google_security_meshca_v1_MeshCertificateRequest *google_security_meshca_v1_MeshCertificateRequest_new(upb_arena *arena) {
- return (google_security_meshca_v1_MeshCertificateRequest *)_upb_msg_new(&google_security_meshca_v1_MeshCertificateRequest_msginit, arena);
-}
-UPB_INLINE google_security_meshca_v1_MeshCertificateRequest *google_security_meshca_v1_MeshCertificateRequest_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_security_meshca_v1_MeshCertificateRequest *ret = google_security_meshca_v1_MeshCertificateRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_security_meshca_v1_MeshCertificateRequest_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_security_meshca_v1_MeshCertificateRequest *google_security_meshca_v1_MeshCertificateRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_security_meshca_v1_MeshCertificateRequest *ret = google_security_meshca_v1_MeshCertificateRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_security_meshca_v1_MeshCertificateRequest_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_security_meshca_v1_MeshCertificateRequest_serialize(const google_security_meshca_v1_MeshCertificateRequest *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_security_meshca_v1_MeshCertificateRequest_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview google_security_meshca_v1_MeshCertificateRequest_request_id(const google_security_meshca_v1_MeshCertificateRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview google_security_meshca_v1_MeshCertificateRequest_csr(const google_security_meshca_v1_MeshCertificateRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool google_security_meshca_v1_MeshCertificateRequest_has_validity(const google_security_meshca_v1_MeshCertificateRequest *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Duration* google_security_meshca_v1_MeshCertificateRequest_validity(const google_security_meshca_v1_MeshCertificateRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Duration*); }
-
-UPB_INLINE void google_security_meshca_v1_MeshCertificateRequest_set_request_id(google_security_meshca_v1_MeshCertificateRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void google_security_meshca_v1_MeshCertificateRequest_set_csr(google_security_meshca_v1_MeshCertificateRequest *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
-}
-UPB_INLINE void google_security_meshca_v1_MeshCertificateRequest_set_validity(google_security_meshca_v1_MeshCertificateRequest *msg, struct google_protobuf_Duration* value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Duration*) = value;
-}
-UPB_INLINE struct google_protobuf_Duration* google_security_meshca_v1_MeshCertificateRequest_mutable_validity(google_security_meshca_v1_MeshCertificateRequest *msg, upb_arena *arena) {
- struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)google_security_meshca_v1_MeshCertificateRequest_validity(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
- if (!sub) return NULL;
- google_security_meshca_v1_MeshCertificateRequest_set_validity(msg, sub);
- }
- return sub;
-}
-
-/* google.security.meshca.v1.MeshCertificateResponse */
-
-UPB_INLINE google_security_meshca_v1_MeshCertificateResponse *google_security_meshca_v1_MeshCertificateResponse_new(upb_arena *arena) {
- return (google_security_meshca_v1_MeshCertificateResponse *)_upb_msg_new(&google_security_meshca_v1_MeshCertificateResponse_msginit, arena);
-}
-UPB_INLINE google_security_meshca_v1_MeshCertificateResponse *google_security_meshca_v1_MeshCertificateResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_security_meshca_v1_MeshCertificateResponse *ret = google_security_meshca_v1_MeshCertificateResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_security_meshca_v1_MeshCertificateResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_security_meshca_v1_MeshCertificateResponse *google_security_meshca_v1_MeshCertificateResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_security_meshca_v1_MeshCertificateResponse *ret = google_security_meshca_v1_MeshCertificateResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_security_meshca_v1_MeshCertificateResponse_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_security_meshca_v1_MeshCertificateResponse_serialize(const google_security_meshca_v1_MeshCertificateResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_security_meshca_v1_MeshCertificateResponse_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview const* google_security_meshca_v1_MeshCertificateResponse_cert_chain(const google_security_meshca_v1_MeshCertificateResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
-
-UPB_INLINE upb_strview* google_security_meshca_v1_MeshCertificateResponse_mutable_cert_chain(google_security_meshca_v1_MeshCertificateResponse *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
-}
-UPB_INLINE upb_strview* google_security_meshca_v1_MeshCertificateResponse_resize_cert_chain(google_security_meshca_v1_MeshCertificateResponse *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool google_security_meshca_v1_MeshCertificateResponse_add_cert_chain(google_security_meshca_v1_MeshCertificateResponse *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(3, 4), &val,
- arena);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c b/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
index 5f5f1edd..37433b60 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
@@ -7,41 +7,103 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field udpa_annotations_MigrateAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_MigrateAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit = {
NULL,
&udpa_annotations_MigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-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},
+static const upb_MiniTable_Field udpa_annotations_FieldMigrateAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit = {
NULL,
&udpa_annotations_FieldMigrateAnnotation__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout_field udpa_annotations_FileMigrateAnnotation__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field udpa_annotations_FileMigrateAnnotation__fields[1] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit = {
NULL,
&udpa_annotations_FileMigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &udpa_annotations_MigrateAnnotation_msginit,
+ &udpa_annotations_FieldMigrateAnnotation_msginit,
+ &udpa_annotations_FileMigrateAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit;
+const upb_MiniTable_Extension udpa_annotations_message_migrate_ext = {
+ {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension udpa_annotations_field_migrate_ext = {
+ {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &udpa_annotations_FieldMigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension udpa_annotations_enum_migrate_ext = {
+ {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension udpa_annotations_enum_value_migrate_ext = {
+ {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension udpa_annotations_file_migrate_ext = {
+ {171962766, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &udpa_annotations_FileMigrateAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[5] = {
+ &udpa_annotations_message_migrate_ext,
+ &udpa_annotations_field_migrate_ext,
+ &udpa_annotations_enum_migrate_ext,
+ &udpa_annotations_enum_value_migrate_ext,
+ &udpa_annotations_file_migrate_ext,
+};
+
+const upb_MiniTable_File udpa_annotations_migrate_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 3,
+ 0,
+ 5,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h b/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
index 8d55a775..bf07294a 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,92 +26,248 @@ 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;
+extern const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit;
+extern const upb_MiniTable_Extension udpa_annotations_message_migrate_ext;
+extern const upb_MiniTable_Extension udpa_annotations_field_migrate_ext;
+extern const upb_MiniTable_Extension udpa_annotations_enum_migrate_ext;
+extern const upb_MiniTable_Extension udpa_annotations_enum_value_migrate_ext;
+extern const upb_MiniTable_Extension udpa_annotations_file_migrate_ext;
+struct google_protobuf_EnumOptions;
+struct google_protobuf_EnumValueOptions;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_FileOptions;
+struct google_protobuf_MessageOptions;
+extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_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_new(upb_Arena* arena) {
+ return (udpa_annotations_MigrateAnnotation*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_MigrateAnnotation *ret = udpa_annotations_MigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_MigrateAnnotation* ret = udpa_annotations_MigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 char* udpa_annotations_MigrateAnnotation_serialize(const udpa_annotations_MigrateAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* udpa_annotations_MigrateAnnotation_serialize_ex(const udpa_annotations_MigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void udpa_annotations_MigrateAnnotation_clear_rename(const udpa_annotations_MigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView udpa_annotations_MigrateAnnotation_rename(const udpa_annotations_MigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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;
+UPB_INLINE void udpa_annotations_MigrateAnnotation_set_rename(udpa_annotations_MigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (udpa_annotations_FieldMigrateAnnotation*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_FieldMigrateAnnotation *ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_FieldMigrateAnnotation* ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 char* udpa_annotations_FieldMigrateAnnotation_serialize(const udpa_annotations_FieldMigrateAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* udpa_annotations_FieldMigrateAnnotation_serialize_ex(const udpa_annotations_FieldMigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_clear_rename(const udpa_annotations_FieldMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView udpa_annotations_FieldMigrateAnnotation_rename(const udpa_annotations_FieldMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_clear_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView udpa_annotations_FieldMigrateAnnotation_oneof_promotion(const udpa_annotations_FieldMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
}
-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_rename(udpa_annotations_FieldMigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = 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;
+UPB_INLINE void udpa_annotations_FieldMigrateAnnotation_set_oneof_promotion(udpa_annotations_FieldMigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = 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_new(upb_Arena* arena) {
+ return (udpa_annotations_FileMigrateAnnotation*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_FileMigrateAnnotation* ret = udpa_annotations_FileMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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, 0, arena, len);
}
-UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_FileMigrateAnnotation *ret = udpa_annotations_FileMigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* udpa_annotations_FileMigrateAnnotation_serialize_ex(const udpa_annotations_FileMigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, options, arena, len);
}
-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 void udpa_annotations_FileMigrateAnnotation_clear_move_to_package(const udpa_annotations_FileMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView udpa_annotations_FileMigrateAnnotation_move_to_package(const udpa_annotations_FileMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
-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;
+UPB_INLINE bool udpa_annotations_has_message_migrate(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_message_migrate_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_message_migrate(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_message_migrate_ext);
+}
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_message_migrate(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_message_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_message_migrate(struct google_protobuf_MessageOptions* msg, const udpa_annotations_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_message_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool udpa_annotations_has_field_migrate(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_field_migrate_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_field_migrate(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_field_migrate_ext);
+}
+UPB_INLINE const udpa_annotations_FieldMigrateAnnotation* udpa_annotations_field_migrate(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_field_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_field_migrate(struct google_protobuf_FieldOptions* msg, const udpa_annotations_FieldMigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_field_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*) = ext;
+}
+UPB_INLINE bool udpa_annotations_has_enum_migrate(const struct google_protobuf_EnumOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_enum_migrate_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_enum_migrate(struct google_protobuf_EnumOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_enum_migrate_ext);
+}
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_migrate(const struct google_protobuf_EnumOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_enum_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_enum_migrate(struct google_protobuf_EnumOptions* msg, const udpa_annotations_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_enum_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool udpa_annotations_has_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_enum_value_migrate_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_enum_value_migrate_ext);
+}
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_enum_value_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg, const udpa_annotations_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_enum_value_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool udpa_annotations_has_file_migrate(const struct google_protobuf_FileOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_file_migrate_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_file_migrate(struct google_protobuf_FileOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_file_migrate_ext);
+}
+UPB_INLINE const udpa_annotations_FileMigrateAnnotation* udpa_annotations_file_migrate(const struct google_protobuf_FileOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_file_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FileMigrateAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_file_migrate(struct google_protobuf_FileOptions* msg, const udpa_annotations_FileMigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_file_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FileMigrateAnnotation*) = ext;
}
+extern const upb_MiniTable_File udpa_annotations_migrate_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c b/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
index d135d4f7..e5b92547 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
@@ -7,24 +7,48 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field udpa_annotations_FieldSecurityAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit = {
NULL,
&udpa_annotations_FieldSecurityAnnotation__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &udpa_annotations_FieldSecurityAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit;
+const upb_MiniTable_Extension udpa_annotations_security_ext = {
+ {11122993, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &udpa_annotations_FieldSecurityAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &udpa_annotations_security_ext,
+};
+
+const upb_MiniTable_File udpa_annotations_security_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h b/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
index 415ba045..67cbd426 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,31 +22,56 @@ extern "C" {
struct udpa_annotations_FieldSecurityAnnotation;
typedef struct udpa_annotations_FieldSecurityAnnotation udpa_annotations_FieldSecurityAnnotation;
-extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit;
+extern const upb_MiniTable_Extension udpa_annotations_security_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_MiniTable google_protobuf_FieldOptions_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_new(upb_Arena* arena) {
+ return (udpa_annotations_FieldSecurityAnnotation*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_FieldSecurityAnnotation *ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecurityAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_FieldSecurityAnnotation* ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 char* udpa_annotations_FieldSecurityAnnotation_serialize(const udpa_annotations_FieldSecurityAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* udpa_annotations_FieldSecurityAnnotation_serialize_ex(const udpa_annotations_FieldSecurityAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(const udpa_annotations_FieldSecurityAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+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 void udpa_annotations_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(const udpa_annotations_FieldSecurityAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+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 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;
@@ -55,6 +80,25 @@ UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untru
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+UPB_INLINE bool udpa_annotations_has_security(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_security_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_security(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_security_ext);
+}
+UPB_INLINE const udpa_annotations_FieldSecurityAnnotation* udpa_annotations_security(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_security_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_security(struct google_protobuf_FieldOptions* msg, const udpa_annotations_FieldSecurityAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_security_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*) = ext;
+}
+extern const upb_MiniTable_File udpa_annotations_security_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c b/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
index ca1fcb59..146c5e6f 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
@@ -7,11 +7,32 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/sensitive.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+const upb_MiniTable_Extension udpa_annotations_sensitive_ext = {
+ {76569463, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &udpa_annotations_sensitive_ext,
+};
+
+const upb_MiniTable_File udpa_annotations_sensitive_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ extensions_layout,
+ 0,
+ 0,
+ 1,
+};
+
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h b/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
index 69f2a862..187013e6 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,22 @@
extern "C" {
#endif
+extern const upb_MiniTable_Extension udpa_annotations_sensitive_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+
+
+UPB_INLINE bool udpa_annotations_has_sensitive(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_sensitive_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_sensitive(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_sensitive_ext);
+}
+UPB_INLINE bool udpa_annotations_sensitive(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_sensitive_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+extern const upb_MiniTable_File udpa_annotations_sensitive_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c b/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
index 16b0181a..d09e49dd 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
@@ -7,21 +7,47 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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(4, 4), 0, 0, 8, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+static const upb_MiniTable_Field udpa_annotations_StatusAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_StatusAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_StatusAnnotation_msginit = {
NULL,
&udpa_annotations_StatusAnnotation__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &udpa_annotations_StatusAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable udpa_annotations_StatusAnnotation_msginit;
+const upb_MiniTable_Extension udpa_annotations_file_status_ext = {
+ {222707719, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &udpa_annotations_StatusAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &udpa_annotations_file_status_ext,
+};
+
+const upb_MiniTable_File udpa_annotations_status_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h b/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
index a55570df..97fe972d 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,7 +22,10 @@ extern "C" {
struct udpa_annotations_StatusAnnotation;
typedef struct udpa_annotations_StatusAnnotation udpa_annotations_StatusAnnotation;
-extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_StatusAnnotation_msginit;
+extern const upb_MiniTable_Extension udpa_annotations_file_status_ext;
+struct google_protobuf_FileOptions;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
typedef enum {
udpa_annotations_UNKNOWN = 0,
@@ -32,35 +35,76 @@ typedef enum {
} 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_new(upb_Arena* arena) {
+ return (udpa_annotations_StatusAnnotation*)_upb_Message_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 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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_StatusAnnotation *ret = udpa_annotations_StatusAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_StatusAnnotation* ret = udpa_annotations_StatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-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 char* udpa_annotations_StatusAnnotation_serialize(const udpa_annotations_StatusAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* udpa_annotations_StatusAnnotation_serialize_ex(const udpa_annotations_StatusAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void udpa_annotations_StatusAnnotation_clear_work_in_progress(const udpa_annotations_StatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool udpa_annotations_StatusAnnotation_work_in_progress(const udpa_annotations_StatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void udpa_annotations_StatusAnnotation_clear_package_version_status(const udpa_annotations_StatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t udpa_annotations_StatusAnnotation_package_version_status(const udpa_annotations_StatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
-
-UPB_INLINE bool udpa_annotations_StatusAnnotation_work_in_progress(const udpa_annotations_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(4, 4), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), 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;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+
+UPB_INLINE bool udpa_annotations_has_file_status(const struct google_protobuf_FileOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_file_status_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_file_status(struct google_protobuf_FileOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_file_status_ext);
+}
+UPB_INLINE const udpa_annotations_StatusAnnotation* udpa_annotations_file_status(const struct google_protobuf_FileOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_file_status_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_StatusAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_file_status(struct google_protobuf_FileOptions* msg, const udpa_annotations_StatusAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_file_status_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_StatusAnnotation*) = ext;
}
+extern const upb_MiniTable_File udpa_annotations_status_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c b/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
index 253afc85..ff259714 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
@@ -7,20 +7,46 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.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},
+static const upb_MiniTable_Field udpa_annotations_VersioningAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout udpa_annotations_VersioningAnnotation_msginit = {
+const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit = {
NULL,
&udpa_annotations_VersioningAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &udpa_annotations_VersioningAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit;
+const upb_MiniTable_Extension udpa_annotations_versioning_ext = {
+ {7881811, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &udpa_annotations_VersioningAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &udpa_annotations_versioning_ext,
+};
+
+const upb_MiniTable_File udpa_annotations_versioning_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h b/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
index e39f8c39..4762bda2 100644
--- a/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
+++ b/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,34 +22,73 @@ extern "C" {
struct udpa_annotations_VersioningAnnotation;
typedef struct udpa_annotations_VersioningAnnotation udpa_annotations_VersioningAnnotation;
-extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
+extern const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit;
+extern const upb_MiniTable_Extension udpa_annotations_versioning_ext;
+struct google_protobuf_MessageOptions;
+extern const upb_MiniTable google_protobuf_MessageOptions_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_new(upb_Arena* arena) {
+ return (udpa_annotations_VersioningAnnotation*)_upb_Message_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);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ udpa_annotations_VersioningAnnotation* ret = udpa_annotations_VersioningAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+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, 0, arena, len);
}
-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_ex(const udpa_annotations_VersioningAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msginit, options, arena, len);
}
-UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_annotations_VersioningAnnotation *ret = udpa_annotations_VersioningAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE void udpa_annotations_VersioningAnnotation_clear_previous_message_type(const udpa_annotations_VersioningAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
}
-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_StringView udpa_annotations_VersioningAnnotation_previous_message_type(const udpa_annotations_VersioningAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-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_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
-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;
+UPB_INLINE bool udpa_annotations_has_versioning(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &udpa_annotations_versioning_ext) != NULL;
+}
+UPB_INLINE void udpa_annotations_clear_versioning(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &udpa_annotations_versioning_ext);
+}
+UPB_INLINE const udpa_annotations_VersioningAnnotation* udpa_annotations_versioning(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &udpa_annotations_versioning_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_VersioningAnnotation*);
+}
+UPB_INLINE void udpa_annotations_set_versioning(struct google_protobuf_MessageOptions* msg, const udpa_annotations_VersioningAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &udpa_annotations_versioning_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_VersioningAnnotation*) = ext;
}
+extern const upb_MiniTable_File udpa_annotations_versioning_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c b/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
deleted file mode 100644
index e5069b7f..00000000
--- a/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/data/orca/v1/orca_load_report.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_data_orca_v1_OrcaLoadReport_submsgs[2] = {
- &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit,
- &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit,
-};
-
-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},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = {
- &udpa_data_orca_v1_OrcaLoadReport_submsgs[0],
- &udpa_data_orca_v1_OrcaLoadReport__fields[0],
- UPB_SIZE(32, 40), 5, false, 255,
-};
-
-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},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit = {
- NULL,
- &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-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},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit = {
- NULL,
- &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h b/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
deleted file mode 100644
index e5923cc5..00000000
--- a/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
-#define UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_data_orca_v1_OrcaLoadReport;
-struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
-struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
-typedef struct udpa_data_orca_v1_OrcaLoadReport udpa_data_orca_v1_OrcaLoadReport;
-typedef struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
-typedef struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit;
-
-
-/* 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);
-}
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_serialize(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena, size_t *len) {
- 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 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_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_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_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 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));
-}
-
-/* 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 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));
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c b/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
deleted file mode 100644
index 24407fa6..00000000
--- a/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/type/v1/typed_struct.upb.h"
-#include "validate/validate.upb.h"
-#include "google/protobuf/struct.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_type_v1_TypedStruct_submsgs[1] = {
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field udpa_type_v1_TypedStruct__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
-};
-
-const upb_msglayout udpa_type_v1_TypedStruct_msginit = {
- &udpa_type_v1_TypedStruct_submsgs[0],
- &udpa_type_v1_TypedStruct__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h b/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
deleted file mode 100644
index 2dd03ff1..00000000
--- a/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
-#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_type_v1_TypedStruct;
-typedef struct udpa_type_v1_TypedStruct udpa_type_v1_TypedStruct;
-extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
-struct google_protobuf_Struct;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-
-
-/* udpa.type.v1.TypedStruct */
-
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_new(upb_arena *arena) {
- return (udpa_type_v1_TypedStruct *)_upb_msg_new(&udpa_type_v1_TypedStruct_msginit, arena);
-}
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_type_v1_TypedStruct_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Struct* udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
-
-UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct *msg, struct google_protobuf_Struct* value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)udpa_type_v1_TypedStruct_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- udpa_type_v1_TypedStruct_set_value(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/validate/validate.upb.c b/grpc/src/core/ext/upb-generated/validate/validate.upb.c
index ec2888ee..a41a2f75 100644
--- a/grpc/src/core/ext/upb-generated/validate/validate.upb.c
+++ b/grpc/src/core/ext/upb-generated/validate/validate.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "validate/validate.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "google/protobuf/duration.upb.h"
@@ -15,433 +15,545 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const validate_FieldRules_submsgs[22] = {
- &validate_AnyRules_msginit,
- &validate_BoolRules_msginit,
- &validate_BytesRules_msginit,
- &validate_DoubleRules_msginit,
- &validate_DurationRules_msginit,
- &validate_EnumRules_msginit,
- &validate_Fixed32Rules_msginit,
- &validate_Fixed64Rules_msginit,
- &validate_FloatRules_msginit,
- &validate_Int32Rules_msginit,
- &validate_Int64Rules_msginit,
- &validate_MapRules_msginit,
- &validate_MessageRules_msginit,
- &validate_RepeatedRules_msginit,
- &validate_SFixed32Rules_msginit,
- &validate_SFixed64Rules_msginit,
- &validate_SInt32Rules_msginit,
- &validate_SInt64Rules_msginit,
- &validate_StringRules_msginit,
- &validate_TimestampRules_msginit,
- &validate_UInt32Rules_msginit,
- &validate_UInt64Rules_msginit,
-};
-
-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},
-};
-
-const upb_msglayout validate_FieldRules_msginit = {
+static const upb_MiniTable_Sub validate_FieldRules_submsgs[22] = {
+ {.submsg = &validate_FloatRules_msginit},
+ {.submsg = &validate_DoubleRules_msginit},
+ {.submsg = &validate_Int32Rules_msginit},
+ {.submsg = &validate_Int64Rules_msginit},
+ {.submsg = &validate_UInt32Rules_msginit},
+ {.submsg = &validate_UInt64Rules_msginit},
+ {.submsg = &validate_SInt32Rules_msginit},
+ {.submsg = &validate_SInt64Rules_msginit},
+ {.submsg = &validate_Fixed32Rules_msginit},
+ {.submsg = &validate_Fixed64Rules_msginit},
+ {.submsg = &validate_SFixed32Rules_msginit},
+ {.submsg = &validate_SFixed64Rules_msginit},
+ {.submsg = &validate_BoolRules_msginit},
+ {.submsg = &validate_StringRules_msginit},
+ {.submsg = &validate_BytesRules_msginit},
+ {.submsg = &validate_EnumRules_msginit},
+ {.submsg = &validate_MessageRules_msginit},
+ {.submsg = &validate_RepeatedRules_msginit},
+ {.submsg = &validate_MapRules_msginit},
+ {.submsg = &validate_AnyRules_msginit},
+ {.submsg = &validate_DurationRules_msginit},
+ {.submsg = &validate_TimestampRules_msginit},
+};
+
+static const upb_MiniTable_Field validate_FieldRules__fields[22] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 6, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 7, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 8, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 9, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 10, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 11, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 12, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 13, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 14, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 15, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 16, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 17, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 18, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 19, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 20, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 21, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable validate_FieldRules_msginit = {
&validate_FieldRules_submsgs[0],
&validate_FieldRules__fields[0],
- UPB_SIZE(16, 32), 22, false, 255,
+ UPB_SIZE(16, 24), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0,
};
-static const upb_msglayout_field validate_FloatRules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 2, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 2, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 2, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 2, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 2, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 2, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 2, 3},
+static const upb_MiniTable_Field validate_FloatRules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 2, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 2, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_FloatRules_msginit = {
+const upb_MiniTable validate_FloatRules_msginit = {
NULL,
&validate_FloatRules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_DoubleRules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 1, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 1, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 1, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 1, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 1, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 1, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 1, 3},
+static const upb_MiniTable_Field validate_DoubleRules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_DoubleRules_msginit = {
+const upb_MiniTable validate_DoubleRules_msginit = {
NULL,
&validate_DoubleRules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_Int32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 5, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 5, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 5, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 5, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 5, 3},
+static const upb_MiniTable_Field validate_Int32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_Int32Rules_msginit = {
+const upb_MiniTable validate_Int32Rules_msginit = {
NULL,
&validate_Int32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_Int64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 3, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 3, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 3, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 3, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 3, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 3, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 3, 3},
+static const upb_MiniTable_Field validate_Int64Rules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 3, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 3, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_Int64Rules_msginit = {
+const upb_MiniTable validate_Int64Rules_msginit = {
NULL,
&validate_Int64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_UInt32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 13, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 13, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 13, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 13, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 13, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 13, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 13, 3},
+static const upb_MiniTable_Field validate_UInt32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 13, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 13, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_UInt32Rules_msginit = {
+const upb_MiniTable validate_UInt32Rules_msginit = {
NULL,
&validate_UInt32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_UInt64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 4, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 4, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 4, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 4, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 4, 3},
+static const upb_MiniTable_Field validate_UInt64Rules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_UInt64Rules_msginit = {
+const upb_MiniTable validate_UInt64Rules_msginit = {
NULL,
&validate_UInt64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_SInt32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 17, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 17, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 17, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 17, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 17, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 17, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 17, 3},
+static const upb_MiniTable_Field validate_SInt32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 17, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 17, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 17, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_SInt32Rules_msginit = {
+const upb_MiniTable validate_SInt32Rules_msginit = {
NULL,
&validate_SInt32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_SInt64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 18, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 18, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 18, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 18, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 18, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 18, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 18, 3},
+static const upb_MiniTable_Field validate_SInt64Rules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 18, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 18, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 18, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_SInt64Rules_msginit = {
+const upb_MiniTable validate_SInt64Rules_msginit = {
NULL,
&validate_SInt64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_Fixed32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 7, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 7, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 7, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 7, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 7, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 7, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 7, 3},
+static const upb_MiniTable_Field validate_Fixed32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 7, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 7, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 7, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_Fixed32Rules_msginit = {
+const upb_MiniTable validate_Fixed32Rules_msginit = {
NULL,
&validate_Fixed32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_Fixed64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 6, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 6, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 6, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 6, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 6, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 6, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 6, 3},
+static const upb_MiniTable_Field validate_Fixed64Rules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 6, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 6, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 6, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_Fixed64Rules_msginit = {
+const upb_MiniTable validate_Fixed64Rules_msginit = {
NULL,
&validate_Fixed64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_SFixed32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 15, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 15, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 15, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 15, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 15, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 15, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 15, 3},
+static const upb_MiniTable_Field validate_SFixed32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 12), UPB_SIZE(3, 3), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 16), UPB_SIZE(4, 4), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 20), UPB_SIZE(5, 5), kUpb_NoSub, 15, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(28, 32), UPB_SIZE(0, 0), kUpb_NoSub, 15, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 40), UPB_SIZE(0, 0), kUpb_NoSub, 15, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(24, 24), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_SFixed32Rules_msginit = {
+const upb_MiniTable validate_SFixed32Rules_msginit = {
NULL,
&validate_SFixed32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_SFixed64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 16, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 16, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 16, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 16, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 16, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 16, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 16, 3},
+static const upb_MiniTable_Field validate_SFixed64Rules__fields[8] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(32, 40), UPB_SIZE(3, 3), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(40, 48), UPB_SIZE(4, 4), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(48, 56), UPB_SIZE(5, 5), kUpb_NoSub, 16, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 16, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 16, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(1, 1), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_SFixed64Rules_msginit = {
+const upb_MiniTable validate_SFixed64Rules_msginit = {
NULL,
&validate_SFixed64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout_field validate_BoolRules__fields[1] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
+static const upb_MiniTable_Field validate_BoolRules__fields[1] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_BoolRules_msginit = {
+const upb_MiniTable validate_BoolRules_msginit = {
NULL,
&validate_BoolRules__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout_field validate_StringRules__fields[25] = {
- {1, UPB_SIZE(60, 64), 1, 0, 12, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 3, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 4, 0, 4, 1},
- {5, UPB_SIZE(32, 32), 5, 0, 4, 1},
- {6, UPB_SIZE(68, 80), 6, 0, 12, 1},
- {7, UPB_SIZE(76, 96), 7, 0, 12, 1},
- {8, UPB_SIZE(84, 112), 8, 0, 12, 1},
- {9, UPB_SIZE(92, 128), 9, 0, 12, 1},
- {10, UPB_SIZE(108, 160), 0, 0, 12, 3},
- {11, UPB_SIZE(112, 168), 0, 0, 12, 3},
- {12, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {13, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {14, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {15, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {16, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {17, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {18, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {19, UPB_SIZE(40, 40), 10, 0, 4, 1},
- {20, UPB_SIZE(48, 48), 11, 0, 4, 1},
- {21, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {22, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {23, UPB_SIZE(100, 144), 12, 0, 12, 1},
- {24, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 14, 1},
- {25, UPB_SIZE(56, 56), 13, 0, 8, 1},
-};
-
-const upb_msglayout validate_StringRules_msginit = {
- NULL,
+ UPB_SIZE(2, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub validate_StringRules_submsgs[1] = {
+ {.subenum = &validate_KnownRegex_enuminit},
+};
+
+static const upb_MiniTable_Field validate_StringRules__fields[26] = {
+ {1, UPB_SIZE(16, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(72, 128), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(80, 136), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(88, 144), UPB_SIZE(4, 4), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(96, 152), UPB_SIZE(5, 5), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 32), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(32, 48), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(40, 64), UPB_SIZE(8, 8), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(48, 80), UPB_SIZE(9, 9), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(56, 96), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(60, 104), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {15, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {16, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {17, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {18, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {19, UPB_SIZE(104, 160), UPB_SIZE(10, 10), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {20, UPB_SIZE(112, 168), UPB_SIZE(11, 11), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {21, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {22, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {23, UPB_SIZE(64, 112), UPB_SIZE(12, 12), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {24, UPB_SIZE(12, 12), UPB_SIZE(-5, -5), 0, 14, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {25, UPB_SIZE(8, 8), UPB_SIZE(13, 13), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {26, UPB_SIZE(9, 9), UPB_SIZE(14, 14), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable validate_StringRules_msginit = {
+ &validate_StringRules_submsgs[0],
&validate_StringRules__fields[0],
- UPB_SIZE(128, 192), 25, false, 255,
-};
-
-static const upb_msglayout_field validate_BytesRules__fields[13] = {
- {1, UPB_SIZE(32, 32), 1, 0, 12, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 3, 0, 4, 1},
- {4, UPB_SIZE(40, 48), 4, 0, 12, 1},
- {5, UPB_SIZE(48, 64), 5, 0, 12, 1},
- {6, UPB_SIZE(56, 80), 6, 0, 12, 1},
- {7, UPB_SIZE(64, 96), 7, 0, 12, 1},
- {8, UPB_SIZE(72, 112), 0, 0, 12, 3},
- {9, UPB_SIZE(76, 120), 0, 0, 12, 3},
- {10, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {11, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {12, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {13, UPB_SIZE(24, 24), 8, 0, 4, 1},
-};
-
-const upb_msglayout validate_BytesRules_msginit = {
+ UPB_SIZE(120, 184), 26, kUpb_ExtMode_NonExtendable, 26, 255, 0,
+};
+
+static const upb_MiniTable_Field validate_BytesRules__fields[14] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(1, 1), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(64, 112), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(72, 120), UPB_SIZE(3, 3), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(20, 32), UPB_SIZE(4, 4), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(28, 48), UPB_SIZE(5, 5), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(36, 64), UPB_SIZE(6, 6), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(44, 80), UPB_SIZE(7, 7), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(52, 96), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(56, 104), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {10, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {11, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {12, UPB_SIZE(2, 2), UPB_SIZE(-5, -5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {13, UPB_SIZE(80, 128), UPB_SIZE(8, 8), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {14, UPB_SIZE(8, 8), UPB_SIZE(9, 9), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable validate_BytesRules_msginit = {
NULL,
&validate_BytesRules__fields[0],
- UPB_SIZE(88, 144), 13, false, 255,
+ UPB_SIZE(88, 136), 14, kUpb_ExtMode_NonExtendable, 14, 255, 0,
};
-static const upb_msglayout_field validate_EnumRules__fields[4] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 8, 1},
- {3, UPB_SIZE(12, 16), 0, 0, 5, 3},
- {4, UPB_SIZE(16, 24), 0, 0, 5, 3},
+static const upb_MiniTable_Field validate_EnumRules__fields[4] = {
+ {1, UPB_SIZE(4, 4), UPB_SIZE(1, 1), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_EnumRules_msginit = {
+const upb_MiniTable validate_EnumRules_msginit = {
NULL,
&validate_EnumRules__fields[0],
- UPB_SIZE(24, 32), 4, false, 255,
+ UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
};
-static const upb_msglayout_field validate_MessageRules__fields[2] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(2, 2), 2, 0, 8, 1},
+static const upb_MiniTable_Field validate_MessageRules__fields[2] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(2, 2), UPB_SIZE(2, 2), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_MessageRules_msginit = {
+const upb_MiniTable validate_MessageRules_msginit = {
NULL,
&validate_MessageRules__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(3, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const validate_RepeatedRules_submsgs[1] = {
- &validate_FieldRules_msginit,
+static const upb_MiniTable_Sub validate_RepeatedRules_submsgs[1] = {
+ {.submsg = &validate_FieldRules_msginit},
};
-static const upb_msglayout_field validate_RepeatedRules__fields[4] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 8, 1},
- {4, UPB_SIZE(28, 32), 4, 0, 11, 1},
+static const upb_MiniTable_Field validate_RepeatedRules__fields[5] = {
+ {1, UPB_SIZE(8, 16), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(2, 2), UPB_SIZE(5, 5), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_RepeatedRules_msginit = {
+const upb_MiniTable validate_RepeatedRules_msginit = {
&validate_RepeatedRules_submsgs[0],
&validate_RepeatedRules__fields[0],
- UPB_SIZE(32, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
};
-static const upb_msglayout *const validate_MapRules_submsgs[1] = {
- &validate_FieldRules_msginit,
+static const upb_MiniTable_Sub validate_MapRules_submsgs[2] = {
+ {.submsg = &validate_FieldRules_msginit},
+ {.submsg = &validate_FieldRules_msginit},
};
-static const upb_msglayout_field validate_MapRules__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 8, 1},
- {4, UPB_SIZE(28, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(32, 40), 5, 0, 11, 1},
+static const upb_MiniTable_Field validate_MapRules__fields[6] = {
+ {1, UPB_SIZE(16, 24), UPB_SIZE(1, 1), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(24, 32), UPB_SIZE(2, 2), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(1, 1), UPB_SIZE(3, 3), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(4, 4), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(5, 5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(2, 2), UPB_SIZE(6, 6), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_MapRules_msginit = {
+const upb_MiniTable validate_MapRules_msginit = {
&validate_MapRules_submsgs[0],
&validate_MapRules__fields[0],
- UPB_SIZE(40, 48), 5, false, 255,
+ UPB_SIZE(32, 40), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-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},
+static const upb_MiniTable_Field validate_AnyRules__fields[3] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_AnyRules_msginit = {
+const upb_MiniTable validate_AnyRules_msginit = {
NULL,
&validate_AnyRules__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
};
-static const upb_msglayout *const validate_DurationRules_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_MiniTable_Sub validate_DurationRules_submsgs[7] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field validate_DurationRules__fields[8] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 2, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 3, 0, 11, 1},
- {4, UPB_SIZE(12, 24), 4, 0, 11, 1},
- {5, UPB_SIZE(16, 32), 5, 0, 11, 1},
- {6, UPB_SIZE(20, 40), 6, 0, 11, 1},
- {7, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {8, UPB_SIZE(28, 56), 0, 0, 11, 3},
+static const upb_MiniTable_Field validate_DurationRules__fields[8] = {
+ {1, UPB_SIZE(1, 1), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(3, 3), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(4, 4), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(5, 5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(20, 40), UPB_SIZE(6, 6), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(24, 48), UPB_SIZE(0, 0), 5, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(28, 56), UPB_SIZE(0, 0), 6, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_DurationRules_msginit = {
+const upb_MiniTable validate_DurationRules_msginit = {
&validate_DurationRules_submsgs[0],
&validate_DurationRules__fields[0],
- UPB_SIZE(32, 64), 8, false, 255,
+ UPB_SIZE(32, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0,
};
-static const upb_msglayout *const validate_TimestampRules_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_MiniTable_Sub validate_TimestampRules_submsgs[6] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field validate_TimestampRules__fields[9] = {
- {1, UPB_SIZE(2, 2), 1, 0, 8, 1},
- {2, UPB_SIZE(8, 8), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 16), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 24), 4, 1, 11, 1},
- {5, UPB_SIZE(20, 32), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 40), 6, 1, 11, 1},
- {7, UPB_SIZE(3, 3), 7, 0, 8, 1},
- {8, UPB_SIZE(4, 4), 8, 0, 8, 1},
- {9, UPB_SIZE(28, 48), 9, 0, 11, 1},
+static const upb_MiniTable_Field validate_TimestampRules__fields[9] = {
+ {1, UPB_SIZE(2, 2), UPB_SIZE(1, 1), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(2, 2), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(3, 3), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(16, 24), UPB_SIZE(4, 4), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(20, 32), UPB_SIZE(5, 5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(24, 40), UPB_SIZE(6, 6), 4, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(3, 3), UPB_SIZE(7, 7), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {8, UPB_SIZE(4, 4), UPB_SIZE(8, 8), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {9, UPB_SIZE(28, 48), UPB_SIZE(9, 9), 5, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout validate_TimestampRules_msginit = {
+const upb_MiniTable validate_TimestampRules_msginit = {
&validate_TimestampRules_submsgs[0],
&validate_TimestampRules__fields[0],
- UPB_SIZE(32, 56), 9, false, 255,
+ UPB_SIZE(32, 56), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[23] = {
+ &validate_FieldRules_msginit,
+ &validate_FloatRules_msginit,
+ &validate_DoubleRules_msginit,
+ &validate_Int32Rules_msginit,
+ &validate_Int64Rules_msginit,
+ &validate_UInt32Rules_msginit,
+ &validate_UInt64Rules_msginit,
+ &validate_SInt32Rules_msginit,
+ &validate_SInt64Rules_msginit,
+ &validate_Fixed32Rules_msginit,
+ &validate_Fixed64Rules_msginit,
+ &validate_SFixed32Rules_msginit,
+ &validate_SFixed64Rules_msginit,
+ &validate_BoolRules_msginit,
+ &validate_StringRules_msginit,
+ &validate_BytesRules_msginit,
+ &validate_EnumRules_msginit,
+ &validate_MessageRules_msginit,
+ &validate_RepeatedRules_msginit,
+ &validate_MapRules_msginit,
+ &validate_AnyRules_msginit,
+ &validate_DurationRules_msginit,
+ &validate_TimestampRules_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable google_protobuf_OneofOptions_msginit;
+extern const upb_MiniTable validate_FieldRules_msginit;
+const upb_MiniTable_Extension validate_disabled_ext = {
+ {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension validate_ignored_ext = {
+ {1072, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension validate_required_ext = {
+ {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_OneofOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_MiniTable_Extension validate_rules_ext = {
+ {1071, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &validate_FieldRules_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[4] = {
+ &validate_disabled_ext,
+ &validate_ignored_ext,
+ &validate_required_ext,
+ &validate_rules_ext,
+};
+
+const upb_MiniTable_Enum validate_KnownRegex_enuminit = {
+ NULL,
+ 0x7ULL,
+ 0,
+};
+
+static const upb_MiniTable_Enum *enums_layout[1] = {
+ &validate_KnownRegex_enuminit,
+};
+
+const upb_MiniTable_File validate_validate_proto_upb_file_layout = {
+ messages_layout,
+ enums_layout,
+ extensions_layout,
+ 23,
+ 1,
+ 4,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/validate/validate.upb.h b/grpc/src/core/ext/upb-generated/validate/validate.upb.h
index dcde0a9b..6276dee4 100644
--- a/grpc/src/core/ext/upb-generated/validate/validate.upb.h
+++ b/grpc/src/core/ext/upb-generated/validate/validate.upb.h
@@ -9,7 +9,7 @@
#ifndef VALIDATE_VALIDATE_PROTO_UPB_H_
#define VALIDATE_VALIDATE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -66,33 +66,43 @@ typedef struct validate_MapRules validate_MapRules;
typedef struct validate_AnyRules validate_AnyRules;
typedef struct validate_DurationRules validate_DurationRules;
typedef struct validate_TimestampRules validate_TimestampRules;
-extern const upb_msglayout validate_FieldRules_msginit;
-extern const upb_msglayout validate_FloatRules_msginit;
-extern const upb_msglayout validate_DoubleRules_msginit;
-extern const upb_msglayout validate_Int32Rules_msginit;
-extern const upb_msglayout validate_Int64Rules_msginit;
-extern const upb_msglayout validate_UInt32Rules_msginit;
-extern const upb_msglayout validate_UInt64Rules_msginit;
-extern const upb_msglayout validate_SInt32Rules_msginit;
-extern const upb_msglayout validate_SInt64Rules_msginit;
-extern const upb_msglayout validate_Fixed32Rules_msginit;
-extern const upb_msglayout validate_Fixed64Rules_msginit;
-extern const upb_msglayout validate_SFixed32Rules_msginit;
-extern const upb_msglayout validate_SFixed64Rules_msginit;
-extern const upb_msglayout validate_BoolRules_msginit;
-extern const upb_msglayout validate_StringRules_msginit;
-extern const upb_msglayout validate_BytesRules_msginit;
-extern const upb_msglayout validate_EnumRules_msginit;
-extern const upb_msglayout validate_MessageRules_msginit;
-extern const upb_msglayout validate_RepeatedRules_msginit;
-extern const upb_msglayout validate_MapRules_msginit;
-extern const upb_msglayout validate_AnyRules_msginit;
-extern const upb_msglayout validate_DurationRules_msginit;
-extern const upb_msglayout validate_TimestampRules_msginit;
+extern const upb_MiniTable validate_FieldRules_msginit;
+extern const upb_MiniTable validate_FloatRules_msginit;
+extern const upb_MiniTable validate_DoubleRules_msginit;
+extern const upb_MiniTable validate_Int32Rules_msginit;
+extern const upb_MiniTable validate_Int64Rules_msginit;
+extern const upb_MiniTable validate_UInt32Rules_msginit;
+extern const upb_MiniTable validate_UInt64Rules_msginit;
+extern const upb_MiniTable validate_SInt32Rules_msginit;
+extern const upb_MiniTable validate_SInt64Rules_msginit;
+extern const upb_MiniTable validate_Fixed32Rules_msginit;
+extern const upb_MiniTable validate_Fixed64Rules_msginit;
+extern const upb_MiniTable validate_SFixed32Rules_msginit;
+extern const upb_MiniTable validate_SFixed64Rules_msginit;
+extern const upb_MiniTable validate_BoolRules_msginit;
+extern const upb_MiniTable validate_StringRules_msginit;
+extern const upb_MiniTable validate_BytesRules_msginit;
+extern const upb_MiniTable validate_EnumRules_msginit;
+extern const upb_MiniTable validate_MessageRules_msginit;
+extern const upb_MiniTable validate_RepeatedRules_msginit;
+extern const upb_MiniTable validate_MapRules_msginit;
+extern const upb_MiniTable validate_AnyRules_msginit;
+extern const upb_MiniTable validate_DurationRules_msginit;
+extern const upb_MiniTable validate_TimestampRules_msginit;
+extern const upb_MiniTable_Extension validate_disabled_ext;
+extern const upb_MiniTable_Extension validate_ignored_ext;
+extern const upb_MiniTable_Extension validate_required_ext;
+extern const upb_MiniTable_Extension validate_rules_ext;
struct google_protobuf_Duration;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_MessageOptions;
+struct google_protobuf_OneofOptions;
struct google_protobuf_Timestamp;
-extern const upb_msglayout google_protobuf_Duration_msginit;
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable google_protobuf_OneofOptions_msginit;
+extern const upb_MiniTable google_protobuf_Timestamp_msginit;
typedef enum {
validate_UNKNOWN = 0,
@@ -101,26 +111,39 @@ typedef enum {
} validate_KnownRegex;
+extern const upb_MiniTable_Enum validate_KnownRegex_enuminit;
+
/* validate.FieldRules */
-UPB_INLINE validate_FieldRules *validate_FieldRules_new(upb_arena *arena) {
- return (validate_FieldRules *)_upb_msg_new(&validate_FieldRules_msginit, arena);
+UPB_INLINE validate_FieldRules* validate_FieldRules_new(upb_Arena* arena) {
+ return (validate_FieldRules*)_upb_Message_New(&validate_FieldRules_msginit, arena);
}
-UPB_INLINE validate_FieldRules *validate_FieldRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_FieldRules *ret = validate_FieldRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_FieldRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_FieldRules* validate_FieldRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_FieldRules* ret = validate_FieldRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_FieldRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_FieldRules* validate_FieldRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_FieldRules* ret = validate_FieldRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_FieldRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_FieldRules *validate_FieldRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_FieldRules *ret = validate_FieldRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_FieldRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_FieldRules_serialize(const validate_FieldRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_FieldRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_FieldRules_serialize(const validate_FieldRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_FieldRules_msginit, arena, len);
+UPB_INLINE char* validate_FieldRules_serialize_ex(const validate_FieldRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_FieldRules_msginit, options, arena, len);
}
-
typedef enum {
validate_FieldRules_type_float = 1,
validate_FieldRules_type_double = 2,
@@ -145,240 +168,395 @@ 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(4, 4), int32_t);
+}
+UPB_INLINE bool validate_FieldRules_has_float(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void validate_FieldRules_clear_float(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_FloatRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_FloatRules* validate_FieldRules_float(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_FloatRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_double(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void validate_FieldRules_clear_double(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_DoubleRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_DoubleRules* validate_FieldRules_double(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_DoubleRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_int32(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void validate_FieldRules_clear_int32(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_Int32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_Int32Rules* validate_FieldRules_int32(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_Int32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_int64(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void validate_FieldRules_clear_int64(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_Int64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_Int64Rules* validate_FieldRules_int64(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_Int64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_uint32(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void validate_FieldRules_clear_uint32(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_UInt32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_UInt32Rules* validate_FieldRules_uint32(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_UInt32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_uint64(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 6;
+}
+UPB_INLINE void validate_FieldRules_clear_uint64(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_UInt64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_UInt64Rules* validate_FieldRules_uint64(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_UInt64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 6, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_sint32(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7;
+}
+UPB_INLINE void validate_FieldRules_clear_sint32(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_SInt32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_SInt32Rules* validate_FieldRules_sint32(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_SInt32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 7, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_sint64(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 8;
+}
+UPB_INLINE void validate_FieldRules_clear_sint64(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_SInt64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_SInt64Rules* validate_FieldRules_sint64(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_SInt64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 8, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_fixed32(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 9;
+}
+UPB_INLINE void validate_FieldRules_clear_fixed32(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_Fixed32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_Fixed32Rules* validate_FieldRules_fixed32(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_Fixed32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 9, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_fixed64(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10;
+}
+UPB_INLINE void validate_FieldRules_clear_fixed64(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_Fixed64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_Fixed64Rules* validate_FieldRules_fixed64(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_Fixed64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 10, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_sfixed32(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11;
+}
+UPB_INLINE void validate_FieldRules_clear_sfixed32(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_SFixed32Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_SFixed32Rules* validate_FieldRules_sfixed32(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_SFixed32Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 11, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_sfixed64(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12;
+}
+UPB_INLINE void validate_FieldRules_clear_sfixed64(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_SFixed64Rules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_SFixed64Rules* validate_FieldRules_sfixed64(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_SFixed64Rules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 12, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_bool(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13;
+}
+UPB_INLINE void validate_FieldRules_clear_bool(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_BoolRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_BoolRules* validate_FieldRules_bool(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_BoolRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 13, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_string(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 14;
+}
+UPB_INLINE void validate_FieldRules_clear_string(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_StringRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_StringRules* validate_FieldRules_string(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_StringRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 14, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_bytes(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 15;
+}
+UPB_INLINE void validate_FieldRules_clear_bytes(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_BytesRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_BytesRules* validate_FieldRules_bytes(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_BytesRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 15, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_enum(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 16;
+}
+UPB_INLINE void validate_FieldRules_clear_enum(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_EnumRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_EnumRules* validate_FieldRules_enum(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_EnumRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 16, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_message(const validate_FieldRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_FieldRules_clear_message(const validate_FieldRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const validate_MessageRules* validate_FieldRules_message(const validate_FieldRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const validate_MessageRules*);
+}
+UPB_INLINE bool validate_FieldRules_has_repeated(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18;
+}
+UPB_INLINE void validate_FieldRules_clear_repeated(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_RepeatedRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_RepeatedRules* validate_FieldRules_repeated(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_RepeatedRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 18, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_map(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 19;
+}
+UPB_INLINE void validate_FieldRules_clear_map(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_MapRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_MapRules* validate_FieldRules_map(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_MapRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 19, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_any(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 20;
+}
+UPB_INLINE void validate_FieldRules_clear_any(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_AnyRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_AnyRules* validate_FieldRules_any(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_AnyRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 20, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_duration(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 21;
+}
+UPB_INLINE void validate_FieldRules_clear_duration(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_DurationRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_DurationRules* validate_FieldRules_duration(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_DurationRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 21, NULL);
+}
+UPB_INLINE bool validate_FieldRules_has_timestamp(const validate_FieldRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 22;
+}
+UPB_INLINE void validate_FieldRules_clear_timestamp(const validate_FieldRules* msg) {
+ UPB_WRITE_ONEOF(msg, validate_TimestampRules*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), validate_FieldRules_type_NOT_SET);
+}
+UPB_INLINE const validate_TimestampRules* validate_FieldRules_timestamp(const validate_FieldRules* msg) {
+ return UPB_READ_ONEOF(msg, const validate_TimestampRules*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 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(12, 16), value, UPB_SIZE(4, 4), 1);
}
-UPB_INLINE struct validate_FloatRules* validate_FieldRules_mutable_float(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 2);
}
-UPB_INLINE struct validate_DoubleRules* validate_FieldRules_mutable_double(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 3);
}
-UPB_INLINE struct validate_Int32Rules* validate_FieldRules_mutable_int32(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 4);
}
-UPB_INLINE struct validate_Int64Rules* validate_FieldRules_mutable_int64(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 5);
}
-UPB_INLINE struct validate_UInt32Rules* validate_FieldRules_mutable_uint32(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 6);
}
-UPB_INLINE struct validate_UInt64Rules* validate_FieldRules_mutable_uint64(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 7);
}
-UPB_INLINE struct validate_SInt32Rules* validate_FieldRules_mutable_sint32(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 8);
}
-UPB_INLINE struct validate_SInt64Rules* validate_FieldRules_mutable_sint64(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 9);
}
-UPB_INLINE struct validate_Fixed32Rules* validate_FieldRules_mutable_fixed32(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 10);
}
-UPB_INLINE struct validate_Fixed64Rules* validate_FieldRules_mutable_fixed64(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 11);
}
-UPB_INLINE struct validate_SFixed32Rules* validate_FieldRules_mutable_sfixed32(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 12);
}
-UPB_INLINE struct validate_SFixed64Rules* validate_FieldRules_mutable_sfixed64(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 13);
}
-UPB_INLINE struct validate_BoolRules* validate_FieldRules_mutable_bool(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 14);
}
-UPB_INLINE struct validate_StringRules* validate_FieldRules_mutable_string(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 15);
}
-UPB_INLINE struct validate_BytesRules* validate_FieldRules_mutable_bytes(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 16);
}
-UPB_INLINE struct validate_EnumRules* validate_FieldRules_mutable_enum(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_New(&validate_EnumRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_enum(msg, sub);
}
@@ -386,72 +564,72 @@ UPB_INLINE struct validate_EnumRules* validate_FieldRules_mutable_enum(validate_
}
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_PTR_AT(msg, UPB_SIZE(8, 8), validate_MessageRules*) = value;
}
-UPB_INLINE struct validate_MessageRules* validate_FieldRules_mutable_message(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 18);
}
-UPB_INLINE struct validate_RepeatedRules* validate_FieldRules_mutable_repeated(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 19);
}
-UPB_INLINE struct validate_MapRules* validate_FieldRules_mutable_map(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 20);
}
-UPB_INLINE struct validate_AnyRules* validate_FieldRules_mutable_any(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 21);
}
-UPB_INLINE struct validate_DurationRules* validate_FieldRules_mutable_duration(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_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(12, 16), value, UPB_SIZE(4, 4), 22);
}
-UPB_INLINE struct validate_TimestampRules* validate_FieldRules_mutable_timestamp(validate_FieldRules *msg, upb_arena *arena) {
+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_Message_New(&validate_TimestampRules_msginit, arena);
if (!sub) return NULL;
validate_FieldRules_set_timestamp(msg, sub);
}
@@ -460,36 +638,107 @@ 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);
-}
-UPB_INLINE validate_FloatRules *validate_FloatRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_FloatRules *ret = validate_FloatRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_FloatRules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_FloatRules *validate_FloatRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_FloatRules *ret = validate_FloatRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_FloatRules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_FloatRules_serialize(const validate_FloatRules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_FloatRules* validate_FloatRules_new(upb_Arena* arena) {
+ return (validate_FloatRules*)_upb_Message_New(&validate_FloatRules_msginit, arena);
+}
+UPB_INLINE validate_FloatRules* validate_FloatRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_FloatRules* ret = validate_FloatRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_FloatRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_FloatRules* validate_FloatRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_FloatRules* ret = validate_FloatRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_FloatRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_FloatRules_serialize(const validate_FloatRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_FloatRules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_FloatRules_serialize_ex(const validate_FloatRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_FloatRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_FloatRules_clear_const(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), float) = 0;
+ _upb_clearhas(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 void validate_FloatRules_clear_lt(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), float) = 0;
+ _upb_clearhas(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 void validate_FloatRules_clear_lte(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), float) = 0;
+ _upb_clearhas(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 void validate_FloatRules_clear_gt(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float) = 0;
+ _upb_clearhas(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 void validate_FloatRules_clear_gte(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE float validate_FloatRules_gte(const validate_FloatRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float);
+}
+UPB_INLINE void validate_FloatRules_clear_in(const validate_FloatRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+UPB_INLINE float const* validate_FloatRules_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_clear_not_in(const validate_FloatRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules* msg, size_t* len) {
+ return (float const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len);
+}
+UPB_INLINE bool validate_FloatRules_has_ignore_empty(const validate_FloatRules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_FloatRules_clear_ignore_empty(const validate_FloatRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_FloatRules_ignore_empty(const validate_FloatRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_FloatRules_set_const(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 1);
@@ -511,133 +760,279 @@ UPB_INLINE void validate_FloatRules_set_gte(validate_FloatRules *msg, float valu
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_FloatRules* msg, size_t len, upb_Arena* arena) {
+ return (float*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE float* validate_FloatRules_resize_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE bool validate_FloatRules_add_in(validate_FloatRules* msg, float val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &val, arena);
}
-UPB_INLINE bool validate_FloatRules_add_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &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(32, 40), len);
}
-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_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE float* validate_FloatRules_resize_not_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE bool validate_FloatRules_add_not_in(validate_FloatRules* msg, float val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
}
-UPB_INLINE bool validate_FloatRules_add_not_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE void validate_FloatRules_set_ignore_empty(validate_FloatRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.DoubleRules */
-UPB_INLINE validate_DoubleRules *validate_DoubleRules_new(upb_arena *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) {
- validate_DoubleRules *ret = validate_DoubleRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_DoubleRules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_DoubleRules *validate_DoubleRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_DoubleRules *ret = validate_DoubleRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_DoubleRules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_DoubleRules_serialize(const validate_DoubleRules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_DoubleRules* validate_DoubleRules_new(upb_Arena* arena) {
+ return (validate_DoubleRules*)_upb_Message_New(&validate_DoubleRules_msginit, arena);
+}
+UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_DoubleRules* ret = validate_DoubleRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_DoubleRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_DoubleRules* ret = validate_DoubleRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_DoubleRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_DoubleRules_serialize(const validate_DoubleRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_DoubleRules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_DoubleRules_serialize_ex(const validate_DoubleRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_DoubleRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_DoubleRules_clear_const(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE double validate_DoubleRules_const(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double);
+}
+UPB_INLINE bool validate_DoubleRules_has_lt(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_DoubleRules_clear_lt(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE double validate_DoubleRules_lt(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), double);
+}
+UPB_INLINE bool validate_DoubleRules_has_lte(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_DoubleRules_clear_lte(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), double) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE double validate_DoubleRules_lte(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), double);
+}
+UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_DoubleRules_clear_gt(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE double validate_DoubleRules_gt(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), double);
+}
+UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_DoubleRules_clear_gte(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE double validate_DoubleRules_gte(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), double);
+}
+UPB_INLINE void validate_DoubleRules_clear_in(const validate_DoubleRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules* msg, size_t* len) {
+ return (double const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE void validate_DoubleRules_clear_not_in(const validate_DoubleRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules* msg, size_t* len) {
+ return (double const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE bool validate_DoubleRules_has_ignore_empty(const validate_DoubleRules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_DoubleRules_clear_ignore_empty(const validate_DoubleRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_DoubleRules_ignore_empty(const validate_DoubleRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), double) = value;
+}
+UPB_INLINE double* validate_DoubleRules_mutable_in(validate_DoubleRules* msg, size_t* len) {
+ return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-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_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE double* validate_DoubleRules_resize_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE bool validate_DoubleRules_add_in(validate_DoubleRules* msg, double val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena);
}
-UPB_INLINE bool validate_DoubleRules_add_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &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(8, 16), len);
}
-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_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE double* validate_DoubleRules_resize_not_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE bool validate_DoubleRules_add_not_in(validate_DoubleRules* msg, double val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
}
-UPB_INLINE bool validate_DoubleRules_add_not_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE void validate_DoubleRules_set_ignore_empty(validate_DoubleRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.Int32Rules */
-UPB_INLINE validate_Int32Rules *validate_Int32Rules_new(upb_arena *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) {
- validate_Int32Rules *ret = validate_Int32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Int32Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_Int32Rules *validate_Int32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_Int32Rules *ret = validate_Int32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Int32Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_Int32Rules_serialize(const validate_Int32Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_Int32Rules* validate_Int32Rules_new(upb_Arena* arena) {
+ return (validate_Int32Rules*)_upb_Message_New(&validate_Int32Rules_msginit, arena);
+}
+UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_Int32Rules* ret = validate_Int32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Int32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_Int32Rules* ret = validate_Int32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Int32Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_Int32Rules_serialize(const validate_Int32Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Int32Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_Int32Rules_serialize_ex(const validate_Int32Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Int32Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_Int32Rules_clear_const(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void validate_Int32Rules_clear_lt(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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 void validate_Int32Rules_clear_lte(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+ _upb_clearhas(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 void validate_Int32Rules_clear_gt(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
+ _upb_clearhas(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 void validate_Int32Rules_clear_gte(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0;
+ _upb_clearhas(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 void validate_Int32Rules_clear_in(const validate_Int32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+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(28, 32), len);
+}
+UPB_INLINE void validate_Int32Rules_clear_not_in(const validate_Int32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+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(32, 40), len);
+}
+UPB_INLINE bool validate_Int32Rules_has_ignore_empty(const validate_Int32Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_Int32Rules_clear_ignore_empty(const validate_Int32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_Int32Rules_ignore_empty(const validate_Int32Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_Int32Rules_set_const(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -659,133 +1054,279 @@ UPB_INLINE void validate_Int32Rules_set_gte(validate_Int32Rules *msg, int32_t va
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_Int32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE int32_t* validate_Int32Rules_resize_in(validate_Int32Rules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE bool validate_Int32Rules_add_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_Int32Rules_add_in(validate_Int32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &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_mutable_not_in(validate_Int32Rules* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), 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_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE int32_t* validate_Int32Rules_resize_not_in(validate_Int32Rules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE bool validate_Int32Rules_add_not_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE bool validate_Int32Rules_add_not_in(validate_Int32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
+}
+UPB_INLINE void validate_Int32Rules_set_ignore_empty(validate_Int32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.Int64Rules */
-UPB_INLINE validate_Int64Rules *validate_Int64Rules_new(upb_arena *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) {
- validate_Int64Rules *ret = validate_Int64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Int64Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_Int64Rules *validate_Int64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_Int64Rules *ret = validate_Int64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Int64Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_Int64Rules_serialize(const validate_Int64Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_Int64Rules* validate_Int64Rules_new(upb_Arena* arena) {
+ return (validate_Int64Rules*)_upb_Message_New(&validate_Int64Rules_msginit, arena);
+}
+UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_Int64Rules* ret = validate_Int64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Int64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_Int64Rules* ret = validate_Int64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Int64Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_Int64Rules_serialize(const validate_Int64Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Int64Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_Int64Rules_serialize_ex(const validate_Int64Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Int64Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_Int64Rules_clear_const(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE int64_t validate_Int64Rules_const(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t);
+}
+UPB_INLINE bool validate_Int64Rules_has_lt(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_Int64Rules_clear_lt(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE int64_t validate_Int64Rules_lt(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t);
+}
+UPB_INLINE bool validate_Int64Rules_has_lte(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_Int64Rules_clear_lte(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int64_t validate_Int64Rules_lte(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t);
+}
+UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_Int64Rules_clear_gt(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE int64_t validate_Int64Rules_gt(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t);
+}
+UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_Int64Rules_clear_gte(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE int64_t validate_Int64Rules_gte(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t);
+}
+UPB_INLINE void validate_Int64Rules_clear_in(const validate_Int64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void validate_Int64Rules_clear_not_in(const validate_Int64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool validate_Int64Rules_has_ignore_empty(const validate_Int64Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_Int64Rules_clear_ignore_empty(const validate_Int64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_Int64Rules_ignore_empty(const validate_Int64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), 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(4, 8), len);
}
-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_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE int64_t* validate_Int64Rules_resize_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE bool validate_Int64Rules_add_in(validate_Int64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena);
}
-UPB_INLINE bool validate_Int64Rules_add_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &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(8, 16), len);
}
-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_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE int64_t* validate_Int64Rules_resize_not_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE bool validate_Int64Rules_add_not_in(validate_Int64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
}
-UPB_INLINE bool validate_Int64Rules_add_not_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE void validate_Int64Rules_set_ignore_empty(validate_Int64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.UInt32Rules */
-UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_new(upb_arena *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) {
- validate_UInt32Rules *ret = validate_UInt32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_UInt32Rules *ret = validate_UInt32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_UInt32Rules_serialize(const validate_UInt32Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_UInt32Rules* validate_UInt32Rules_new(upb_Arena* arena) {
+ return (validate_UInt32Rules*)_upb_Message_New(&validate_UInt32Rules_msginit, arena);
+}
+UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_UInt32Rules* ret = validate_UInt32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_UInt32Rules* ret = validate_UInt32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_UInt32Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_UInt32Rules_serialize(const validate_UInt32Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_UInt32Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_UInt32Rules_serialize_ex(const validate_UInt32Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_UInt32Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_UInt32Rules_clear_const(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+ _upb_clearhas(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 void validate_UInt32Rules_clear_lt(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+ _upb_clearhas(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 void validate_UInt32Rules_clear_lte(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0;
+ _upb_clearhas(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 void validate_UInt32Rules_clear_gt(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0;
+ _upb_clearhas(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 void validate_UInt32Rules_clear_gte(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = 0;
+ _upb_clearhas(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 void validate_UInt32Rules_clear_in(const validate_UInt32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+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(28, 32), len);
+}
+UPB_INLINE void validate_UInt32Rules_clear_not_in(const validate_UInt32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+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(32, 40), len);
+}
+UPB_INLINE bool validate_UInt32Rules_has_ignore_empty(const validate_UInt32Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_UInt32Rules_clear_ignore_empty(const validate_UInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_UInt32Rules_ignore_empty(const validate_UInt32Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_UInt32Rules_set_const(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
@@ -807,133 +1348,279 @@ UPB_INLINE void validate_UInt32Rules_set_gte(validate_UInt32Rules *msg, uint32_t
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_UInt32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE uint32_t* validate_UInt32Rules_resize_in(validate_UInt32Rules* msg, size_t len, upb_Arena* arena) {
+ return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE bool validate_UInt32Rules_add_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_UInt32Rules_add_in(validate_UInt32Rules* msg, uint32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &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_mutable_not_in(validate_UInt32Rules* msg, size_t* len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), 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_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE uint32_t* validate_UInt32Rules_resize_not_in(validate_UInt32Rules* msg, size_t len, upb_Arena* arena) {
+ return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE bool validate_UInt32Rules_add_not_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE bool validate_UInt32Rules_add_not_in(validate_UInt32Rules* msg, uint32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
+}
+UPB_INLINE void validate_UInt32Rules_set_ignore_empty(validate_UInt32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.UInt64Rules */
-UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_new(upb_arena *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) {
- validate_UInt64Rules *ret = validate_UInt64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_UInt64Rules *ret = validate_UInt64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_UInt64Rules_serialize(const validate_UInt64Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_UInt64Rules* validate_UInt64Rules_new(upb_Arena* arena) {
+ return (validate_UInt64Rules*)_upb_Message_New(&validate_UInt64Rules_msginit, arena);
+}
+UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_UInt64Rules* ret = validate_UInt64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_UInt64Rules* ret = validate_UInt64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_UInt64Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_UInt64Rules_serialize(const validate_UInt64Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_UInt64Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_UInt64Rules_serialize_ex(const validate_UInt64Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_UInt64Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_UInt64Rules_clear_const(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE uint64_t validate_UInt64Rules_const(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t);
+}
+UPB_INLINE bool validate_UInt64Rules_has_lt(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_UInt64Rules_clear_lt(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_UInt64Rules_lt(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t);
+}
+UPB_INLINE bool validate_UInt64Rules_has_lte(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_UInt64Rules_clear_lte(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE uint64_t validate_UInt64Rules_lte(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t);
+}
+UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_UInt64Rules_clear_gt(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE uint64_t validate_UInt64Rules_gt(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t);
+}
+UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_UInt64Rules_clear_gte(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE uint64_t validate_UInt64Rules_gte(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t);
+}
+UPB_INLINE void validate_UInt64Rules_clear_in(const validate_UInt64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void validate_UInt64Rules_clear_not_in(const validate_UInt64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool validate_UInt64Rules_has_ignore_empty(const validate_UInt64Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_UInt64Rules_clear_ignore_empty(const validate_UInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_UInt64Rules_ignore_empty(const validate_UInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), 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(4, 8), len);
}
-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_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE uint64_t* validate_UInt64Rules_resize_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE bool validate_UInt64Rules_add_in(validate_UInt64Rules* msg, uint64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena);
}
-UPB_INLINE bool validate_UInt64Rules_add_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &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(8, 16), len);
}
-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_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE uint64_t* validate_UInt64Rules_resize_not_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE bool validate_UInt64Rules_add_not_in(validate_UInt64Rules* msg, uint64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
}
-UPB_INLINE bool validate_UInt64Rules_add_not_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE void validate_UInt64Rules_set_ignore_empty(validate_UInt64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.SInt32Rules */
-UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_new(upb_arena *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) {
- validate_SInt32Rules *ret = validate_SInt32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_SInt32Rules *ret = validate_SInt32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_SInt32Rules_serialize(const validate_SInt32Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_SInt32Rules* validate_SInt32Rules_new(upb_Arena* arena) {
+ return (validate_SInt32Rules*)_upb_Message_New(&validate_SInt32Rules_msginit, arena);
+}
+UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_SInt32Rules* ret = validate_SInt32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_SInt32Rules* ret = validate_SInt32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SInt32Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_SInt32Rules_serialize(const validate_SInt32Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SInt32Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_SInt32Rules_serialize_ex(const validate_SInt32Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SInt32Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_SInt32Rules_clear_const(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void validate_SInt32Rules_clear_lt(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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 void validate_SInt32Rules_clear_lte(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+ _upb_clearhas(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 void validate_SInt32Rules_clear_gt(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
+ _upb_clearhas(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 void validate_SInt32Rules_clear_gte(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0;
+ _upb_clearhas(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 void validate_SInt32Rules_clear_in(const validate_SInt32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+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(28, 32), len);
+}
+UPB_INLINE void validate_SInt32Rules_clear_not_in(const validate_SInt32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+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(32, 40), len);
+}
+UPB_INLINE bool validate_SInt32Rules_has_ignore_empty(const validate_SInt32Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_SInt32Rules_clear_ignore_empty(const validate_SInt32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_SInt32Rules_ignore_empty(const validate_SInt32Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_SInt32Rules_set_const(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -955,133 +1642,279 @@ UPB_INLINE void validate_SInt32Rules_set_gte(validate_SInt32Rules *msg, int32_t
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE int32_t* validate_SInt32Rules_resize_in(validate_SInt32Rules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE bool validate_SInt32Rules_add_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_SInt32Rules_add_in(validate_SInt32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &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_mutable_not_in(validate_SInt32Rules* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), 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_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE int32_t* validate_SInt32Rules_resize_not_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE bool validate_SInt32Rules_add_not_in(validate_SInt32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
}
-UPB_INLINE bool validate_SInt32Rules_add_not_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE void validate_SInt32Rules_set_ignore_empty(validate_SInt32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.SInt64Rules */
-UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_new(upb_arena *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) {
- validate_SInt64Rules *ret = validate_SInt64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_SInt64Rules *ret = validate_SInt64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_SInt64Rules_serialize(const validate_SInt64Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_SInt64Rules* validate_SInt64Rules_new(upb_Arena* arena) {
+ return (validate_SInt64Rules*)_upb_Message_New(&validate_SInt64Rules_msginit, arena);
+}
+UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_SInt64Rules* ret = validate_SInt64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_SInt64Rules* ret = validate_SInt64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SInt64Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_SInt64Rules_serialize(const validate_SInt64Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SInt64Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_SInt64Rules_serialize_ex(const validate_SInt64Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SInt64Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_SInt64Rules_clear_const(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE int64_t validate_SInt64Rules_const(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t);
+}
+UPB_INLINE bool validate_SInt64Rules_has_lt(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_SInt64Rules_clear_lt(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE int64_t validate_SInt64Rules_lt(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t);
+}
+UPB_INLINE bool validate_SInt64Rules_has_lte(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_SInt64Rules_clear_lte(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int64_t validate_SInt64Rules_lte(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t);
+}
+UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_SInt64Rules_clear_gt(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE int64_t validate_SInt64Rules_gt(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t);
+}
+UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_SInt64Rules_clear_gte(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE int64_t validate_SInt64Rules_gte(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t);
+}
+UPB_INLINE void validate_SInt64Rules_clear_in(const validate_SInt64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void validate_SInt64Rules_clear_not_in(const validate_SInt64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool validate_SInt64Rules_has_ignore_empty(const validate_SInt64Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_SInt64Rules_clear_ignore_empty(const validate_SInt64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_SInt64Rules_ignore_empty(const validate_SInt64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), 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_mutable_in(validate_SInt64Rules* msg, size_t* len) {
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules* msg, size_t len, upb_Arena* arena) {
+ return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE bool validate_SInt64Rules_add_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
- arena);
+UPB_INLINE bool validate_SInt64Rules_add_in(validate_SInt64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &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_mutable_not_in(validate_SInt64Rules* msg, size_t* len) {
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), 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_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE int64_t* validate_SInt64Rules_resize_not_in(validate_SInt64Rules* msg, size_t len, upb_Arena* arena) {
+ return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE bool validate_SInt64Rules_add_not_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE bool validate_SInt64Rules_add_not_in(validate_SInt64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
+}
+UPB_INLINE void validate_SInt64Rules_set_ignore_empty(validate_SInt64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.Fixed32Rules */
-UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_new(upb_arena *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) {
- validate_Fixed32Rules *ret = validate_Fixed32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_Fixed32Rules *ret = validate_Fixed32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_Fixed32Rules_serialize(const validate_Fixed32Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_Fixed32Rules* validate_Fixed32Rules_new(upb_Arena* arena) {
+ return (validate_Fixed32Rules*)_upb_Message_New(&validate_Fixed32Rules_msginit, arena);
+}
+UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_Fixed32Rules* ret = validate_Fixed32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_Fixed32Rules* ret = validate_Fixed32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Fixed32Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_Fixed32Rules_serialize(const validate_Fixed32Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Fixed32Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_Fixed32Rules_serialize_ex(const validate_Fixed32Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Fixed32Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_Fixed32Rules_clear_const(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = 0;
+ _upb_clearhas(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 void validate_Fixed32Rules_clear_lt(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = 0;
+ _upb_clearhas(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 void validate_Fixed32Rules_clear_lte(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), uint32_t) = 0;
+ _upb_clearhas(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 void validate_Fixed32Rules_clear_gt(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = 0;
+ _upb_clearhas(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 void validate_Fixed32Rules_clear_gte(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = 0;
+ _upb_clearhas(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 void validate_Fixed32Rules_clear_in(const validate_Fixed32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+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(28, 32), len);
+}
+UPB_INLINE void validate_Fixed32Rules_clear_not_in(const validate_Fixed32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+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(32, 40), len);
+}
+UPB_INLINE bool validate_Fixed32Rules_has_ignore_empty(const validate_Fixed32Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_Fixed32Rules_clear_ignore_empty(const validate_Fixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_Fixed32Rules_ignore_empty(const validate_Fixed32Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_Fixed32Rules_set_const(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
@@ -1103,133 +1936,279 @@ UPB_INLINE void validate_Fixed32Rules_set_gte(validate_Fixed32Rules *msg, uint32
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE uint32_t* validate_Fixed32Rules_resize_in(validate_Fixed32Rules* msg, size_t len, upb_Arena* arena) {
+ return (uint32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE bool validate_Fixed32Rules_add_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_Fixed32Rules_add_in(validate_Fixed32Rules* msg, uint32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &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_mutable_not_in(validate_Fixed32Rules* msg, size_t* len) {
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), 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_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE uint32_t* validate_Fixed32Rules_resize_not_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE bool validate_Fixed32Rules_add_not_in(validate_Fixed32Rules* msg, uint32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
}
-UPB_INLINE bool validate_Fixed32Rules_add_not_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE void validate_Fixed32Rules_set_ignore_empty(validate_Fixed32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.Fixed64Rules */
-UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_new(upb_arena *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) {
- validate_Fixed64Rules *ret = validate_Fixed64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_Fixed64Rules *ret = validate_Fixed64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_Fixed64Rules_serialize(const validate_Fixed64Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_Fixed64Rules* validate_Fixed64Rules_new(upb_Arena* arena) {
+ return (validate_Fixed64Rules*)_upb_Message_New(&validate_Fixed64Rules_msginit, arena);
+}
+UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_Fixed64Rules* ret = validate_Fixed64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_Fixed64Rules* ret = validate_Fixed64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_Fixed64Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_Fixed64Rules_serialize(const validate_Fixed64Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Fixed64Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_Fixed64Rules_serialize_ex(const validate_Fixed64Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_Fixed64Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_const(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE uint64_t validate_Fixed64Rules_const(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_lt(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_lt(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_Fixed64Rules_lt(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_lte(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_lte(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE uint64_t validate_Fixed64Rules_lte(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), uint64_t);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_gt(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE uint64_t validate_Fixed64Rules_gt(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), uint64_t);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_gte(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE uint64_t validate_Fixed64Rules_gte(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), uint64_t);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_in(const validate_Fixed64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_not_in(const validate_Fixed64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool validate_Fixed64Rules_has_ignore_empty(const validate_Fixed64Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_Fixed64Rules_clear_ignore_empty(const validate_Fixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_Fixed64Rules_ignore_empty(const validate_Fixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), 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(4, 8), len);
}
-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_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE uint64_t* validate_Fixed64Rules_resize_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE bool validate_Fixed64Rules_add_in(validate_Fixed64Rules* msg, uint64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &val, arena);
}
-UPB_INLINE bool validate_Fixed64Rules_add_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &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(8, 16), len);
}
-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_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE uint64_t* validate_Fixed64Rules_resize_not_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE bool validate_Fixed64Rules_add_not_in(validate_Fixed64Rules* msg, uint64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
}
-UPB_INLINE bool validate_Fixed64Rules_add_not_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE void validate_Fixed64Rules_set_ignore_empty(validate_Fixed64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.SFixed32Rules */
-UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_new(upb_arena *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) {
- validate_SFixed32Rules *ret = validate_SFixed32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_SFixed32Rules *ret = validate_SFixed32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_SFixed32Rules_serialize(const validate_SFixed32Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_SFixed32Rules* validate_SFixed32Rules_new(upb_Arena* arena) {
+ return (validate_SFixed32Rules*)_upb_Message_New(&validate_SFixed32Rules_msginit, arena);
+}
+UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_SFixed32Rules* ret = validate_SFixed32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_SFixed32Rules* ret = validate_SFixed32Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SFixed32Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_SFixed32Rules_serialize(const validate_SFixed32Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SFixed32Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_SFixed32Rules_serialize_ex(const validate_SFixed32Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SFixed32Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_SFixed32Rules_clear_const(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void validate_SFixed32Rules_clear_lt(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = 0;
+ _upb_clearhas(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 void validate_SFixed32Rules_clear_lte(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = 0;
+ _upb_clearhas(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 void validate_SFixed32Rules_clear_gt(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = 0;
+ _upb_clearhas(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 void validate_SFixed32Rules_clear_gte(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = 0;
+ _upb_clearhas(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 void validate_SFixed32Rules_clear_in(const validate_SFixed32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(28, 32));
+}
+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(28, 32), len);
+}
+UPB_INLINE void validate_SFixed32Rules_clear_not_in(const validate_SFixed32Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 40));
+}
+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(32, 40), len);
+}
+UPB_INLINE bool validate_SFixed32Rules_has_ignore_empty(const validate_SFixed32Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_SFixed32Rules_clear_ignore_empty(const validate_SFixed32Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_SFixed32Rules_ignore_empty(const validate_SFixed32Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool);
+}
UPB_INLINE void validate_SFixed32Rules_set_const(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -1251,123 +2230,217 @@ UPB_INLINE void validate_SFixed32Rules_set_gte(validate_SFixed32Rules *msg, int3
_upb_sethas(msg, 5);
*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_mutable_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_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+UPB_INLINE int32_t* validate_SFixed32Rules_resize_in(validate_SFixed32Rules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
-UPB_INLINE bool validate_SFixed32Rules_add_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_SFixed32Rules_add_in(validate_SFixed32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 32), 2, &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_mutable_not_in(validate_SFixed32Rules* msg, size_t* len) {
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), 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_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
-UPB_INLINE int32_t* validate_SFixed32Rules_resize_not_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+UPB_INLINE bool validate_SFixed32Rules_add_not_in(validate_SFixed32Rules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 40), 2, &val, arena);
}
-UPB_INLINE bool validate_SFixed32Rules_add_not_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
- arena);
+UPB_INLINE void validate_SFixed32Rules_set_ignore_empty(validate_SFixed32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
/* validate.SFixed64Rules */
-UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_new(upb_arena *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) {
- validate_SFixed64Rules *ret = validate_SFixed64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_SFixed64Rules *ret = validate_SFixed64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_SFixed64Rules_serialize(const validate_SFixed64Rules *msg, upb_arena *arena, size_t *len) {
- 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 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 validate_SFixed64Rules* validate_SFixed64Rules_new(upb_Arena* arena) {
+ return (validate_SFixed64Rules*)_upb_Message_New(&validate_SFixed64Rules_msginit, arena);
+}
+UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_SFixed64Rules* ret = validate_SFixed64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_SFixed64Rules* ret = validate_SFixed64Rules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_SFixed64Rules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_SFixed64Rules_serialize(const validate_SFixed64Rules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SFixed64Rules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_SFixed64Rules_serialize_ex(const validate_SFixed64Rules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_SFixed64Rules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_const(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE int64_t validate_SFixed64Rules_const(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), int64_t);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_lt(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_lt(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE int64_t validate_SFixed64Rules_lt(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), int64_t);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_lte(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_lte(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE int64_t validate_SFixed64Rules_lte(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), int64_t);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_gt(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE int64_t validate_SFixed64Rules_gt(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), int64_t);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_gte(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE int64_t validate_SFixed64Rules_gte(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 56), int64_t);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_in(const validate_SFixed64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+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(4, 8), len);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_not_in(const validate_SFixed64Rules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+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(8, 16), len);
+}
+UPB_INLINE bool validate_SFixed64Rules_has_ignore_empty(const validate_SFixed64Rules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_SFixed64Rules_clear_ignore_empty(const validate_SFixed64Rules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_SFixed64Rules_ignore_empty(const validate_SFixed64Rules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
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(16, 24), 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(24, 32), 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(32, 40), 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(40, 48), 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(48, 56), 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_mutable_in(validate_SFixed64Rules* msg, size_t* len) {
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
-UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules* msg, size_t len, upb_Arena* arena) {
+ return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, 3, arena);
}
-UPB_INLINE bool validate_SFixed64Rules_add_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
- arena);
+UPB_INLINE bool validate_SFixed64Rules_add_in(validate_SFixed64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), 3, &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_mutable_not_in(validate_SFixed64Rules* msg, size_t* len) {
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), 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_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+UPB_INLINE int64_t* validate_SFixed64Rules_resize_not_in(validate_SFixed64Rules* msg, size_t len, upb_Arena* arena) {
+ return (int64_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, 3, arena);
}
-UPB_INLINE bool validate_SFixed64Rules_add_not_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
- arena);
+UPB_INLINE bool validate_SFixed64Rules_add_not_in(validate_SFixed64Rules* msg, int64_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), 3, &val, arena);
+}
+UPB_INLINE void validate_SFixed64Rules_set_ignore_empty(validate_SFixed64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
/* validate.BoolRules */
-UPB_INLINE validate_BoolRules *validate_BoolRules_new(upb_arena *arena) {
- return (validate_BoolRules *)_upb_msg_new(&validate_BoolRules_msginit, arena);
+UPB_INLINE validate_BoolRules* validate_BoolRules_new(upb_Arena* arena) {
+ return (validate_BoolRules*)_upb_Message_New(&validate_BoolRules_msginit, arena);
}
-UPB_INLINE validate_BoolRules *validate_BoolRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_BoolRules *ret = validate_BoolRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_BoolRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_BoolRules* validate_BoolRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_BoolRules* ret = validate_BoolRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_BoolRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_BoolRules* validate_BoolRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_BoolRules* ret = validate_BoolRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_BoolRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_BoolRules *validate_BoolRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_BoolRules *ret = validate_BoolRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_BoolRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_BoolRules_serialize(const validate_BoolRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_BoolRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_BoolRules_serialize(const validate_BoolRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_BoolRules_msginit, arena, len);
+UPB_INLINE char* validate_BoolRules_serialize_ex(const validate_BoolRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_BoolRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_BoolRules_clear_const(const validate_BoolRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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);
@@ -1376,24 +2449,35 @@ UPB_INLINE void validate_BoolRules_set_const(validate_BoolRules *msg, bool value
/* validate.StringRules */
-UPB_INLINE validate_StringRules *validate_StringRules_new(upb_arena *arena) {
- return (validate_StringRules *)_upb_msg_new(&validate_StringRules_msginit, arena);
+UPB_INLINE validate_StringRules* validate_StringRules_new(upb_Arena* arena) {
+ return (validate_StringRules*)_upb_Message_New(&validate_StringRules_msginit, arena);
}
-UPB_INLINE validate_StringRules *validate_StringRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_StringRules *ret = validate_StringRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_StringRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_StringRules* validate_StringRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_StringRules* ret = validate_StringRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_StringRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_StringRules* validate_StringRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_StringRules* ret = validate_StringRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_StringRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_StringRules *validate_StringRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_StringRules *ret = validate_StringRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_StringRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_StringRules_serialize(const validate_StringRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_StringRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_StringRules_serialize(const validate_StringRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_StringRules_msginit, arena, len);
+UPB_INLINE char* validate_StringRules_serialize_ex(const validate_StringRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_StringRules_msginit, options, arena, len);
}
-
typedef enum {
validate_StringRules_well_known_email = 12,
validate_StringRules_well_known_hostname = 13,
@@ -1407,301 +2491,654 @@ typedef enum {
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(120, 180), int32_t); }
-
-UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules *msg) { return _upb_hasbit(msg, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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, 5); }
-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, 6); }
-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, 7); }
-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, 8); }
-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, 9); }
-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(120, 180)) == 12; }
-UPB_INLINE bool validate_StringRules_email(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 12, false); }
-UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 13; }
-UPB_INLINE bool validate_StringRules_hostname(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 13, false); }
-UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 14; }
-UPB_INLINE bool validate_StringRules_ip(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 14, false); }
-UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 15; }
-UPB_INLINE bool validate_StringRules_ipv4(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 15, false); }
-UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 16; }
-UPB_INLINE bool validate_StringRules_ipv6(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 16, false); }
-UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 17; }
-UPB_INLINE bool validate_StringRules_uri(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 17, false); }
-UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 18; }
-UPB_INLINE bool validate_StringRules_uri_ref(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 18, false); }
-UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules *msg) { return _upb_hasbit(msg, 10); }
-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, 11); }
-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(120, 180)) == 21; }
-UPB_INLINE bool validate_StringRules_address(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 21, false); }
-UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(120, 180)) == 22; }
-UPB_INLINE bool validate_StringRules_uuid(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 22, false); }
-UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules *msg) { return _upb_hasbit(msg, 12); }
-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(120, 180)) == 24; }
-UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 24, 0); }
-UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules *msg) { return _upb_hasbit(msg, 13); }
-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_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(4, 4), int32_t);
+}
+UPB_INLINE bool validate_StringRules_has_const(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_StringRules_clear_const(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView validate_StringRules_const(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView);
+}
+UPB_INLINE bool validate_StringRules_has_min_len(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_StringRules_clear_min_len(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_StringRules_min_len(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_max_len(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_StringRules_clear_max_len(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE uint64_t validate_StringRules_max_len(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_min_bytes(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_StringRules_clear_min_bytes(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t) = 0;
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE uint64_t validate_StringRules_min_bytes(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_max_bytes(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_StringRules_clear_max_bytes(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE uint64_t validate_StringRules_max_bytes(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_pattern(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_StringRules_clear_pattern(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE upb_StringView validate_StringRules_pattern(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView);
+}
+UPB_INLINE bool validate_StringRules_has_prefix(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void validate_StringRules_clear_prefix(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 7);
+}
+UPB_INLINE upb_StringView validate_StringRules_prefix(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView);
+}
+UPB_INLINE bool validate_StringRules_has_suffix(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void validate_StringRules_clear_suffix(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 8);
+}
+UPB_INLINE upb_StringView validate_StringRules_suffix(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView);
+}
+UPB_INLINE bool validate_StringRules_has_contains(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void validate_StringRules_clear_contains(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 9);
+}
+UPB_INLINE upb_StringView validate_StringRules_contains(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView);
+}
+UPB_INLINE void validate_StringRules_clear_in(const validate_StringRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(56, 96));
+}
+UPB_INLINE upb_StringView const* validate_StringRules_in(const validate_StringRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(56, 96), len);
+}
+UPB_INLINE void validate_StringRules_clear_not_in(const validate_StringRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(60, 104));
+}
+UPB_INLINE upb_StringView const* validate_StringRules_not_in(const validate_StringRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(60, 104), len);
+}
+UPB_INLINE bool validate_StringRules_has_email(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12;
+}
+UPB_INLINE void validate_StringRules_clear_email(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_email(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 12, false);
+}
+UPB_INLINE bool validate_StringRules_has_hostname(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 13;
+}
+UPB_INLINE void validate_StringRules_clear_hostname(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_hostname(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 13, false);
+}
+UPB_INLINE bool validate_StringRules_has_ip(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 14;
+}
+UPB_INLINE void validate_StringRules_clear_ip(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_ip(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 14, false);
+}
+UPB_INLINE bool validate_StringRules_has_ipv4(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 15;
+}
+UPB_INLINE void validate_StringRules_clear_ipv4(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_ipv4(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 15, false);
+}
+UPB_INLINE bool validate_StringRules_has_ipv6(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 16;
+}
+UPB_INLINE void validate_StringRules_clear_ipv6(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_ipv6(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 16, false);
+}
+UPB_INLINE bool validate_StringRules_has_uri(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 17;
+}
+UPB_INLINE void validate_StringRules_clear_uri(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_uri(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 17, false);
+}
+UPB_INLINE bool validate_StringRules_has_uri_ref(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 18;
+}
+UPB_INLINE void validate_StringRules_clear_uri_ref(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_uri_ref(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 18, false);
+}
+UPB_INLINE bool validate_StringRules_has_len(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 10);
+}
+UPB_INLINE void validate_StringRules_clear_len(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t) = 0;
+ _upb_clearhas(msg, 10);
+}
+UPB_INLINE uint64_t validate_StringRules_len(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_len_bytes(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 11);
+}
+UPB_INLINE void validate_StringRules_clear_len_bytes(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t) = 0;
+ _upb_clearhas(msg, 11);
+}
+UPB_INLINE uint64_t validate_StringRules_len_bytes(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t);
+}
+UPB_INLINE bool validate_StringRules_has_address(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 21;
+}
+UPB_INLINE void validate_StringRules_clear_address(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_address(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 21, false);
+}
+UPB_INLINE bool validate_StringRules_has_uuid(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 22;
+}
+UPB_INLINE void validate_StringRules_clear_uuid(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_StringRules_uuid(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 22, false);
+}
+UPB_INLINE bool validate_StringRules_has_not_contains(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 12);
+}
+UPB_INLINE void validate_StringRules_clear_not_contains(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 12);
+}
+UPB_INLINE upb_StringView validate_StringRules_not_contains(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView);
+}
+UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 24;
+}
+UPB_INLINE void validate_StringRules_clear_well_known_regex(const validate_StringRules* msg) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(12, 12), 0, UPB_SIZE(4, 4), validate_StringRules_well_known_NOT_SET);
+}
+UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules* msg) {
+ return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(12, 12), UPB_SIZE(4, 4), 24, 0);
+}
+UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 13);
+}
+UPB_INLINE void validate_StringRules_clear_strict(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+ _upb_clearhas(msg, 13);
+}
+UPB_INLINE bool validate_StringRules_strict(const validate_StringRules* msg) {
+ return validate_StringRules_has_strict(msg) ? *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) : true;
+}
+UPB_INLINE bool validate_StringRules_has_ignore_empty(const validate_StringRules* msg) {
+ return _upb_hasbit(msg, 14);
+}
+UPB_INLINE void validate_StringRules_clear_ignore_empty(const validate_StringRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = 0;
+ _upb_clearhas(msg, 14);
+}
+UPB_INLINE bool validate_StringRules_ignore_empty(const validate_StringRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool);
+}
+
+UPB_INLINE void validate_StringRules_set_const(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_StringView) = value;
}
UPB_INLINE void validate_StringRules_set_min_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_max_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 136), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_min_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 144), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_max_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 152), uint64_t) = value;
}
-UPB_INLINE void validate_StringRules_set_pattern(validate_StringRules *msg, upb_strview value) {
+UPB_INLINE void validate_StringRules_set_pattern(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 80), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_StringView) = value;
}
-UPB_INLINE void validate_StringRules_set_prefix(validate_StringRules *msg, upb_strview value) {
+UPB_INLINE void validate_StringRules_set_prefix(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 96), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_StringView) = value;
}
-UPB_INLINE void validate_StringRules_set_suffix(validate_StringRules *msg, upb_strview value) {
+UPB_INLINE void validate_StringRules_set_suffix(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 112), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), upb_StringView) = value;
}
-UPB_INLINE void validate_StringRules_set_contains(validate_StringRules *msg, upb_strview value) {
+UPB_INLINE void validate_StringRules_set_contains(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 128), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), upb_StringView) = 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);
+UPB_INLINE upb_StringView* validate_StringRules_mutable_in(validate_StringRules* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 96), len);
}
-UPB_INLINE upb_strview* validate_StringRules_resize_in(validate_StringRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(108, 160), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_StringRules_resize_in(validate_StringRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 96), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_StringRules_add_in(validate_StringRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(108, 160), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_StringRules_add_in(validate_StringRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 96), UPB_SIZE(3, 4), &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);
+UPB_INLINE upb_StringView* validate_StringRules_mutable_not_in(validate_StringRules* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 104), 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_accessor2(msg, UPB_SIZE(112, 168), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_StringRules_resize_not_in(validate_StringRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(60, 104), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_StringRules_add_not_in(validate_StringRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(112, 168), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_StringRules_add_not_in(validate_StringRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(60, 104), UPB_SIZE(3, 4), &val, arena);
}
UPB_INLINE void validate_StringRules_set_email(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 12);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 12);
}
UPB_INLINE void validate_StringRules_set_hostname(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 13);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 13);
}
UPB_INLINE void validate_StringRules_set_ip(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 14);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 14);
}
UPB_INLINE void validate_StringRules_set_ipv4(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 15);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 15);
}
UPB_INLINE void validate_StringRules_set_ipv6(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 16);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 16);
}
UPB_INLINE void validate_StringRules_set_uri(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 17);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 17);
}
UPB_INLINE void validate_StringRules_set_uri_ref(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 18);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 18);
}
UPB_INLINE void validate_StringRules_set_len(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 160), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_len_bytes(validate_StringRules *msg, uint64_t value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 48), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 168), uint64_t) = value;
}
UPB_INLINE void validate_StringRules_set_address(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 21);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 21);
}
UPB_INLINE void validate_StringRules_set_uuid(validate_StringRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 22);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 22);
}
-UPB_INLINE void validate_StringRules_set_not_contains(validate_StringRules *msg, upb_strview value) {
+UPB_INLINE void validate_StringRules_set_not_contains(validate_StringRules *msg, upb_StringView value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 144), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), upb_StringView) = value;
}
UPB_INLINE void validate_StringRules_set_well_known_regex(validate_StringRules *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(116, 176), value, UPB_SIZE(120, 180), 24);
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(12, 12), value, UPB_SIZE(4, 4), 24);
}
UPB_INLINE void validate_StringRules_set_strict(validate_StringRules *msg, bool value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
+}
+UPB_INLINE void validate_StringRules_set_ignore_empty(validate_StringRules *msg, bool value) {
+ _upb_sethas(msg, 14);
+ *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
}
/* validate.BytesRules */
-UPB_INLINE validate_BytesRules *validate_BytesRules_new(upb_arena *arena) {
- return (validate_BytesRules *)_upb_msg_new(&validate_BytesRules_msginit, arena);
+UPB_INLINE validate_BytesRules* validate_BytesRules_new(upb_Arena* arena) {
+ return (validate_BytesRules*)_upb_Message_New(&validate_BytesRules_msginit, arena);
}
-UPB_INLINE validate_BytesRules *validate_BytesRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_BytesRules *ret = validate_BytesRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_BytesRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_BytesRules* validate_BytesRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_BytesRules* ret = validate_BytesRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_BytesRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_BytesRules* validate_BytesRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_BytesRules* ret = validate_BytesRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_BytesRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_BytesRules *validate_BytesRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_BytesRules *ret = validate_BytesRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_BytesRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_BytesRules_serialize(const validate_BytesRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_BytesRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_BytesRules_serialize(const validate_BytesRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_BytesRules_msginit, arena, len);
+UPB_INLINE char* validate_BytesRules_serialize_ex(const validate_BytesRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_BytesRules_msginit, options, arena, len);
}
-
typedef enum {
validate_BytesRules_well_known_ip = 10,
validate_BytesRules_well_known_ipv4 = 11,
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, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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, 5); }
-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, 6); }
-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, 7); }
-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_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_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_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, 8); }
-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_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(4, 4), int32_t);
+}
+UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_BytesRules_clear_const(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE upb_StringView validate_BytesRules_const(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView);
+}
+UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_BytesRules_clear_min_len(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_BytesRules_min_len(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t);
+}
+UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_BytesRules_clear_max_len(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE uint64_t validate_BytesRules_max_len(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t);
+}
+UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_BytesRules_clear_pattern(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 4);
+}
+UPB_INLINE upb_StringView validate_BytesRules_pattern(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView);
+}
+UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_BytesRules_clear_prefix(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE upb_StringView validate_BytesRules_prefix(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView);
+}
+UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_BytesRules_clear_suffix(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE upb_StringView validate_BytesRules_suffix(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView);
+}
+UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 7);
+}
+UPB_INLINE void validate_BytesRules_clear_contains(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, 7);
+}
+UPB_INLINE upb_StringView validate_BytesRules_contains(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView);
+}
+UPB_INLINE void validate_BytesRules_clear_in(const validate_BytesRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(52, 96));
+}
+UPB_INLINE upb_StringView const* validate_BytesRules_in(const validate_BytesRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len);
+}
+UPB_INLINE void validate_BytesRules_clear_not_in(const validate_BytesRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(56, 104));
+}
+UPB_INLINE upb_StringView const* validate_BytesRules_not_in(const validate_BytesRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(56, 104), len);
+}
+UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 10;
+}
+UPB_INLINE void validate_BytesRules_clear_ip(const validate_BytesRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_BytesRules_ip(const validate_BytesRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 10, false);
+}
+UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 11;
+}
+UPB_INLINE void validate_BytesRules_clear_ipv4(const validate_BytesRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_BytesRules_ipv4(const validate_BytesRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 11, false);
+}
+UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 12;
+}
+UPB_INLINE void validate_BytesRules_clear_ipv6(const validate_BytesRules* msg) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), 0, UPB_SIZE(4, 4), validate_BytesRules_well_known_NOT_SET);
+}
+UPB_INLINE bool validate_BytesRules_ipv6(const validate_BytesRules* msg) {
+ return UPB_READ_ONEOF(msg, bool, UPB_SIZE(2, 2), UPB_SIZE(4, 4), 12, false);
+}
+UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 8);
+}
+UPB_INLINE void validate_BytesRules_clear_len(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t) = 0;
+ _upb_clearhas(msg, 8);
+}
+UPB_INLINE uint64_t validate_BytesRules_len(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t);
+}
+UPB_INLINE bool validate_BytesRules_has_ignore_empty(const validate_BytesRules* msg) {
+ return _upb_hasbit(msg, 9);
+}
+UPB_INLINE void validate_BytesRules_clear_ignore_empty(const validate_BytesRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+ _upb_clearhas(msg, 9);
+}
+UPB_INLINE bool validate_BytesRules_ignore_empty(const validate_BytesRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool);
+}
+
+UPB_INLINE void validate_BytesRules_set_const(validate_BytesRules *msg, upb_StringView value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), upb_StringView) = value;
}
UPB_INLINE void validate_BytesRules_set_min_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), uint64_t) = value;
}
UPB_INLINE void validate_BytesRules_set_max_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 120), uint64_t) = value;
}
-UPB_INLINE void validate_BytesRules_set_pattern(validate_BytesRules *msg, upb_strview value) {
+UPB_INLINE void validate_BytesRules_set_pattern(validate_BytesRules *msg, upb_StringView value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), upb_StringView) = value;
}
-UPB_INLINE void validate_BytesRules_set_prefix(validate_BytesRules *msg, upb_strview value) {
+UPB_INLINE void validate_BytesRules_set_prefix(validate_BytesRules *msg, upb_StringView value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), upb_StringView) = value;
}
-UPB_INLINE void validate_BytesRules_set_suffix(validate_BytesRules *msg, upb_strview value) {
+UPB_INLINE void validate_BytesRules_set_suffix(validate_BytesRules *msg, upb_StringView value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), upb_StringView) = value;
}
-UPB_INLINE void validate_BytesRules_set_contains(validate_BytesRules *msg, upb_strview value) {
+UPB_INLINE void validate_BytesRules_set_contains(validate_BytesRules *msg, upb_StringView value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), upb_StringView) = 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_StringView* validate_BytesRules_mutable_in(validate_BytesRules* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len);
}
-UPB_INLINE upb_strview* validate_BytesRules_resize_in(validate_BytesRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(72, 112), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_BytesRules_resize_in(validate_BytesRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_BytesRules_add_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(72, 112), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_BytesRules_add_in(validate_BytesRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(52, 96), UPB_SIZE(3, 4), &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_StringView* validate_BytesRules_mutable_not_in(validate_BytesRules* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 104), 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_accessor2(msg, UPB_SIZE(76, 120), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_BytesRules_resize_not_in(validate_BytesRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(56, 104), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_BytesRules_add_not_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(76, 120), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_BytesRules_add_not_in(validate_BytesRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(56, 104), UPB_SIZE(3, 4), &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);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 10);
}
UPB_INLINE void validate_BytesRules_set_ipv4(validate_BytesRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 11);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 11);
}
UPB_INLINE void validate_BytesRules_set_ipv6(validate_BytesRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 12);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(2, 2), value, UPB_SIZE(4, 4), 12);
}
UPB_INLINE void validate_BytesRules_set_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 128), uint64_t) = value;
+}
+UPB_INLINE void validate_BytesRules_set_ignore_empty(validate_BytesRules *msg, bool value) {
+ _upb_sethas(msg, 9);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
/* validate.EnumRules */
-UPB_INLINE validate_EnumRules *validate_EnumRules_new(upb_arena *arena) {
- return (validate_EnumRules *)_upb_msg_new(&validate_EnumRules_msginit, arena);
+UPB_INLINE validate_EnumRules* validate_EnumRules_new(upb_Arena* arena) {
+ return (validate_EnumRules*)_upb_Message_New(&validate_EnumRules_msginit, arena);
+}
+UPB_INLINE validate_EnumRules* validate_EnumRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_EnumRules* ret = validate_EnumRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_EnumRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_EnumRules* validate_EnumRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_EnumRules* ret = validate_EnumRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_EnumRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_EnumRules *validate_EnumRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_EnumRules *ret = validate_EnumRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_EnumRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* validate_EnumRules_serialize(const validate_EnumRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_EnumRules_msginit, 0, arena, len);
}
-UPB_INLINE validate_EnumRules *validate_EnumRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_EnumRules *ret = validate_EnumRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_EnumRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_EnumRules_serialize_ex(const validate_EnumRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_EnumRules_msginit, options, arena, len);
}
-UPB_INLINE char *validate_EnumRules_serialize(const validate_EnumRules *msg, upb_arena *arena, size_t *len) {
- 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 void validate_EnumRules_clear_const(const validate_EnumRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+ _upb_clearhas(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 void validate_EnumRules_clear_defined_only(const validate_EnumRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = 0;
+ _upb_clearhas(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 void validate_EnumRules_clear_in(const validate_EnumRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(12, 16));
+}
+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 void validate_EnumRules_clear_not_in(const validate_EnumRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(16, 24));
+}
+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 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);
@@ -1711,51 +3148,76 @@ UPB_INLINE void validate_EnumRules_set_defined_only(validate_EnumRules *msg, boo
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
-UPB_INLINE int32_t* validate_EnumRules_mutable_in(validate_EnumRules *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena);
+UPB_INLINE int32_t* validate_EnumRules_resize_in(validate_EnumRules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 16), len, 2, arena);
}
-UPB_INLINE bool validate_EnumRules_add_in(validate_EnumRules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(12, 16), 2, &val,
- arena);
+UPB_INLINE bool validate_EnumRules_add_in(validate_EnumRules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 16), 2, &val, arena);
}
-UPB_INLINE int32_t* validate_EnumRules_mutable_not_in(validate_EnumRules *msg, size_t *len) {
+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_accessor2(msg, UPB_SIZE(16, 24), len, 2, arena);
+UPB_INLINE int32_t* validate_EnumRules_resize_not_in(validate_EnumRules* msg, size_t len, upb_Arena* arena) {
+ return (int32_t*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(16, 24), len, 2, arena);
}
-UPB_INLINE bool validate_EnumRules_add_not_in(validate_EnumRules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(16, 24), 2, &val,
- arena);
+UPB_INLINE bool validate_EnumRules_add_not_in(validate_EnumRules* msg, int32_t val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(16, 24), 2, &val, arena);
}
/* validate.MessageRules */
-UPB_INLINE validate_MessageRules *validate_MessageRules_new(upb_arena *arena) {
- return (validate_MessageRules *)_upb_msg_new(&validate_MessageRules_msginit, arena);
+UPB_INLINE validate_MessageRules* validate_MessageRules_new(upb_Arena* arena) {
+ return (validate_MessageRules*)_upb_Message_New(&validate_MessageRules_msginit, arena);
}
-UPB_INLINE validate_MessageRules *validate_MessageRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_MessageRules *ret = validate_MessageRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_MessageRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_MessageRules* validate_MessageRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_MessageRules* ret = validate_MessageRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_MessageRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_MessageRules* validate_MessageRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_MessageRules* ret = validate_MessageRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_MessageRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_MessageRules *validate_MessageRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_MessageRules *ret = validate_MessageRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_MessageRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_MessageRules_serialize(const validate_MessageRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_MessageRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_MessageRules_serialize(const validate_MessageRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_MessageRules_msginit, arena, len);
+UPB_INLINE char* validate_MessageRules_serialize_ex(const validate_MessageRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_MessageRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_MessageRules_clear_skip(const validate_MessageRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void validate_MessageRules_clear_required(const validate_MessageRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(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);
@@ -1768,110 +3230,225 @@ UPB_INLINE void validate_MessageRules_set_required(validate_MessageRules *msg, b
/* validate.RepeatedRules */
-UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_new(upb_arena *arena) {
- return (validate_RepeatedRules *)_upb_msg_new(&validate_RepeatedRules_msginit, arena);
+UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_new(upb_Arena* arena) {
+ return (validate_RepeatedRules*)_upb_Message_New(&validate_RepeatedRules_msginit, arena);
+}
+UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_RepeatedRules* ret = validate_RepeatedRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_RepeatedRules* ret = validate_RepeatedRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_RepeatedRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_RepeatedRules *ret = validate_RepeatedRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE char* validate_RepeatedRules_serialize(const validate_RepeatedRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_RepeatedRules_msginit, 0, arena, len);
}
-UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_RepeatedRules *ret = validate_RepeatedRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_RepeatedRules_serialize_ex(const validate_RepeatedRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_RepeatedRules_msginit, options, arena, len);
}
-UPB_INLINE char *validate_RepeatedRules_serialize(const validate_RepeatedRules *msg, upb_arena *arena, size_t *len) {
- 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 void validate_RepeatedRules_clear_min_items(const validate_RepeatedRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE uint64_t validate_RepeatedRules_min_items(const validate_RepeatedRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), uint64_t);
+}
+UPB_INLINE bool validate_RepeatedRules_has_max_items(const validate_RepeatedRules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_RepeatedRules_clear_max_items(const validate_RepeatedRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_RepeatedRules_max_items(const validate_RepeatedRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t);
+}
+UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_RepeatedRules_clear_unique(const validate_RepeatedRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE bool validate_RepeatedRules_unique(const validate_RepeatedRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_RepeatedRules_clear_items(const validate_RepeatedRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const validate_FieldRules* validate_RepeatedRules_items(const validate_RepeatedRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_FieldRules*);
+}
+UPB_INLINE bool validate_RepeatedRules_has_ignore_empty(const validate_RepeatedRules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_RepeatedRules_clear_ignore_empty(const validate_RepeatedRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(msg, 5);
+}
+UPB_INLINE bool validate_RepeatedRules_ignore_empty(const validate_RepeatedRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
}
-
-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, 16), 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, 24), 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(1, 1), 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(4, 8), validate_FieldRules*) = value;
}
-UPB_INLINE struct validate_FieldRules* validate_RepeatedRules_mutable_items(validate_RepeatedRules *msg, upb_arena *arena) {
+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_Message_New(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_RepeatedRules_set_items(msg, sub);
}
return sub;
}
+UPB_INLINE void validate_RepeatedRules_set_ignore_empty(validate_RepeatedRules *msg, bool value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
/* validate.MapRules */
-UPB_INLINE validate_MapRules *validate_MapRules_new(upb_arena *arena) {
- return (validate_MapRules *)_upb_msg_new(&validate_MapRules_msginit, arena);
+UPB_INLINE validate_MapRules* validate_MapRules_new(upb_Arena* arena) {
+ return (validate_MapRules*)_upb_Message_New(&validate_MapRules_msginit, arena);
}
-UPB_INLINE validate_MapRules *validate_MapRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_MapRules *ret = validate_MapRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_MapRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_MapRules* validate_MapRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_MapRules* ret = validate_MapRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_MapRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_MapRules* validate_MapRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_MapRules* ret = validate_MapRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_MapRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_MapRules *validate_MapRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_MapRules *ret = validate_MapRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_MapRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_MapRules_serialize(const validate_MapRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_MapRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_MapRules_serialize(const validate_MapRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_MapRules_msginit, arena, len);
+UPB_INLINE char* validate_MapRules_serialize_ex(const validate_MapRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_MapRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_MapRules_clear_min_pairs(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE uint64_t validate_MapRules_min_pairs(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), uint64_t);
+}
+UPB_INLINE bool validate_MapRules_has_max_pairs(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void validate_MapRules_clear_max_pairs(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0;
+ _upb_clearhas(msg, 2);
+}
+UPB_INLINE uint64_t validate_MapRules_max_pairs(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t);
+}
+UPB_INLINE bool validate_MapRules_has_no_sparse(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 3);
+}
+UPB_INLINE void validate_MapRules_clear_no_sparse(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 3);
+}
+UPB_INLINE bool validate_MapRules_no_sparse(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 4);
+}
+UPB_INLINE void validate_MapRules_clear_keys(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const validate_FieldRules* validate_MapRules_keys(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const validate_FieldRules*);
+}
+UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 5);
+}
+UPB_INLINE void validate_MapRules_clear_values(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const validate_FieldRules* validate_MapRules_values(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const validate_FieldRules*);
+}
+UPB_INLINE bool validate_MapRules_has_ignore_empty(const validate_MapRules* msg) {
+ return _upb_hasbit(msg, 6);
+}
+UPB_INLINE void validate_MapRules_clear_ignore_empty(const validate_MapRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(msg, 6);
+}
+UPB_INLINE bool validate_MapRules_ignore_empty(const validate_MapRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool);
}
-
-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(16, 24), 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(24, 32), 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(1, 1), 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(4, 8), validate_FieldRules*) = value;
}
-UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_keys(validate_MapRules *msg, upb_arena *arena) {
+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_Message_New(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_MapRules_set_keys(msg, sub);
}
@@ -1879,104 +3456,203 @@ 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(8, 16), validate_FieldRules*) = value;
}
-UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_values(validate_MapRules *msg, upb_arena *arena) {
+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_Message_New(&validate_FieldRules_msginit, arena);
if (!sub) return NULL;
validate_MapRules_set_values(msg, sub);
}
return sub;
}
+UPB_INLINE void validate_MapRules_set_ignore_empty(validate_MapRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+}
/* validate.AnyRules */
-UPB_INLINE validate_AnyRules *validate_AnyRules_new(upb_arena *arena) {
- return (validate_AnyRules *)_upb_msg_new(&validate_AnyRules_msginit, arena);
+UPB_INLINE validate_AnyRules* validate_AnyRules_new(upb_Arena* arena) {
+ return (validate_AnyRules*)_upb_Message_New(&validate_AnyRules_msginit, arena);
}
-UPB_INLINE validate_AnyRules *validate_AnyRules_parse(const char *buf, size_t size,
- upb_arena *arena) {
- validate_AnyRules *ret = validate_AnyRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_AnyRules_msginit, arena)) ? ret : NULL;
+UPB_INLINE validate_AnyRules* validate_AnyRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_AnyRules* ret = validate_AnyRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_AnyRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_AnyRules* validate_AnyRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_AnyRules* ret = validate_AnyRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_AnyRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE validate_AnyRules *validate_AnyRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_AnyRules *ret = validate_AnyRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_AnyRules_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* validate_AnyRules_serialize(const validate_AnyRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_AnyRules_msginit, 0, arena, len);
}
-UPB_INLINE char *validate_AnyRules_serialize(const validate_AnyRules *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &validate_AnyRules_msginit, arena, len);
+UPB_INLINE char* validate_AnyRules_serialize_ex(const validate_AnyRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_AnyRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_AnyRules_clear_required(const validate_AnyRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(msg, 1);
+}
+UPB_INLINE bool validate_AnyRules_required(const validate_AnyRules* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+UPB_INLINE void validate_AnyRules_clear_in(const validate_AnyRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE upb_StringView const* validate_AnyRules_in(const validate_AnyRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE void validate_AnyRules_clear_not_in(const validate_AnyRules* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE upb_StringView const* validate_AnyRules_not_in(const validate_AnyRules* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), 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 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_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_StringView* validate_AnyRules_mutable_in(validate_AnyRules* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_AnyRules_resize_in(validate_AnyRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_AnyRules_add_in(validate_AnyRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_AnyRules_add_in(validate_AnyRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(4, 8), UPB_SIZE(3, 4), &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_StringView* validate_AnyRules_mutable_not_in(validate_AnyRules* msg, size_t* len) {
+ return (upb_StringView*)_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_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+UPB_INLINE upb_StringView* validate_AnyRules_resize_not_in(validate_AnyRules* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
}
-UPB_INLINE bool validate_AnyRules_add_not_in(validate_AnyRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val,
- arena);
+UPB_INLINE bool validate_AnyRules_add_not_in(validate_AnyRules* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena);
}
/* validate.DurationRules */
-UPB_INLINE validate_DurationRules *validate_DurationRules_new(upb_arena *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) {
- validate_DurationRules *ret = validate_DurationRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_DurationRules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_DurationRules *validate_DurationRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_DurationRules *ret = validate_DurationRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_DurationRules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_DurationRules_serialize(const validate_DurationRules *msg, upb_arena *arena, size_t *len) {
- 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 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 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 validate_DurationRules* validate_DurationRules_new(upb_Arena* arena) {
+ return (validate_DurationRules*)_upb_Message_New(&validate_DurationRules_msginit, arena);
+}
+UPB_INLINE validate_DurationRules* validate_DurationRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_DurationRules* ret = validate_DurationRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_DurationRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_DurationRules* validate_DurationRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_DurationRules* ret = validate_DurationRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_DurationRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_DurationRules_serialize(const validate_DurationRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_DurationRules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_DurationRules_serialize_ex(const validate_DurationRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_DurationRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_DurationRules_clear_required(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+ _upb_clearhas(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 void validate_DurationRules_clear_const(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+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 void validate_DurationRules_clear_lt(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+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 void validate_DurationRules_clear_lte(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+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 void validate_DurationRules_clear_gt(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+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 void validate_DurationRules_clear_gte(const validate_DurationRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+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 void validate_DurationRules_clear_in(const validate_DurationRules* msg) {
+ _upb_array_detach(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 void validate_DurationRules_clear_not_in(const validate_DurationRules* msg) {
+ _upb_array_detach(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);
@@ -1986,10 +3662,10 @@ UPB_INLINE void validate_DurationRules_set_const(validate_DurationRules *msg, st
_upb_sethas(msg, 2);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_const(msg, sub);
}
@@ -1999,10 +3675,10 @@ UPB_INLINE void validate_DurationRules_set_lt(validate_DurationRules *msg, struc
_upb_sethas(msg, 3);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_lt(msg, sub);
}
@@ -2012,10 +3688,10 @@ UPB_INLINE void validate_DurationRules_set_lte(validate_DurationRules *msg, stru
_upb_sethas(msg, 4);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_lte(msg, sub);
}
@@ -2025,10 +3701,10 @@ UPB_INLINE void validate_DurationRules_set_gt(validate_DurationRules *msg, struc
_upb_sethas(msg, 5);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_gt(msg, sub);
}
@@ -2038,80 +3714,155 @@ UPB_INLINE void validate_DurationRules_set_gte(validate_DurationRules *msg, stru
_upb_sethas(msg, 6);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_DurationRules_set_gte(msg, sub);
}
return sub;
}
-UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_in(validate_DurationRules *msg, size_t *len) {
+UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_in(validate_DurationRules* msg, size_t* len) {
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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_Duration_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_not_in(validate_DurationRules *msg, size_t *len) {
+UPB_INLINE struct google_protobuf_Duration** validate_DurationRules_mutable_not_in(validate_DurationRules* msg, size_t* len) {
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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, 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_Message_New(&google_protobuf_Duration_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* validate.TimestampRules */
-UPB_INLINE validate_TimestampRules *validate_TimestampRules_new(upb_arena *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) {
- validate_TimestampRules *ret = validate_TimestampRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_TimestampRules_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE validate_TimestampRules *validate_TimestampRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- validate_TimestampRules *ret = validate_TimestampRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_TimestampRules_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *validate_TimestampRules_serialize(const validate_TimestampRules *msg, upb_arena *arena, size_t *len) {
- 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, 2); }
-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, 3); }
-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, 4); }
-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, 5); }
-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, 6); }
-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, 7); }
-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, 8); }
-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 validate_TimestampRules* validate_TimestampRules_new(upb_Arena* arena) {
+ return (validate_TimestampRules*)_upb_Message_New(&validate_TimestampRules_msginit, arena);
+}
+UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse(const char* buf, size_t size, upb_Arena* arena) {
+ validate_TimestampRules* ret = validate_TimestampRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_TimestampRules_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ validate_TimestampRules* ret = validate_TimestampRules_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &validate_TimestampRules_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* validate_TimestampRules_serialize(const validate_TimestampRules* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_TimestampRules_msginit, 0, arena, len);
+}
+UPB_INLINE char* validate_TimestampRules_serialize_ex(const validate_TimestampRules* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &validate_TimestampRules_msginit, options, arena, len);
+}
+UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void validate_TimestampRules_clear_required(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = 0;
+ _upb_clearhas(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, 2);
+}
+UPB_INLINE void validate_TimestampRules_clear_const(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+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, 3);
+}
+UPB_INLINE void validate_TimestampRules_clear_lt(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const upb_Message*) = NULL;
+}
+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, 4);
+}
+UPB_INLINE void validate_TimestampRules_clear_lte(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const upb_Message*) = NULL;
+}
+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, 5);
+}
+UPB_INLINE void validate_TimestampRules_clear_gt(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const upb_Message*) = NULL;
+}
+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, 6);
+}
+UPB_INLINE void validate_TimestampRules_clear_gte(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const upb_Message*) = NULL;
+}
+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, 7);
+}
+UPB_INLINE void validate_TimestampRules_clear_lt_now(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = 0;
+ _upb_clearhas(msg, 7);
+}
+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, 8);
+}
+UPB_INLINE void validate_TimestampRules_clear_gt_now(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = 0;
+ _upb_clearhas(msg, 8);
+}
+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 void validate_TimestampRules_clear_within(const validate_TimestampRules* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const upb_Message*) = NULL;
+}
+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);
@@ -2121,10 +3872,10 @@ UPB_INLINE void validate_TimestampRules_set_const(validate_TimestampRules *msg,
_upb_sethas(msg, 2);
*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) {
+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_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_const(msg, sub);
}
@@ -2134,10 +3885,10 @@ UPB_INLINE void validate_TimestampRules_set_lt(validate_TimestampRules *msg, str
_upb_sethas(msg, 3);
*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) {
+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_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_lt(msg, sub);
}
@@ -2147,10 +3898,10 @@ UPB_INLINE void validate_TimestampRules_set_lte(validate_TimestampRules *msg, st
_upb_sethas(msg, 4);
*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) {
+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_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_lte(msg, sub);
}
@@ -2160,10 +3911,10 @@ UPB_INLINE void validate_TimestampRules_set_gt(validate_TimestampRules *msg, str
_upb_sethas(msg, 5);
*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) {
+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_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_gt(msg, sub);
}
@@ -2173,10 +3924,10 @@ UPB_INLINE void validate_TimestampRules_set_gte(validate_TimestampRules *msg, st
_upb_sethas(msg, 6);
*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) {
+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_Message_New(&google_protobuf_Timestamp_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_gte(msg, sub);
}
@@ -2194,16 +3945,65 @@ UPB_INLINE void validate_TimestampRules_set_within(validate_TimestampRules *msg,
_upb_sethas(msg, 9);
*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) {
+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_Message_New(&google_protobuf_Duration_msginit, arena);
if (!sub) return NULL;
validate_TimestampRules_set_within(msg, sub);
}
return sub;
}
+UPB_INLINE bool validate_has_disabled(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &validate_disabled_ext) != NULL;
+}
+UPB_INLINE void validate_clear_disabled(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &validate_disabled_ext);
+}
+UPB_INLINE bool validate_disabled(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_disabled_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+UPB_INLINE bool validate_has_ignored(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &validate_ignored_ext) != NULL;
+}
+UPB_INLINE void validate_clear_ignored(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &validate_ignored_ext);
+}
+UPB_INLINE bool validate_ignored(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_ignored_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+UPB_INLINE bool validate_has_required(const struct google_protobuf_OneofOptions* msg) {
+ return _upb_Message_Getext(msg, &validate_required_ext) != NULL;
+}
+UPB_INLINE void validate_clear_required(struct google_protobuf_OneofOptions* msg) {
+ _upb_Message_Clearext(msg, &validate_required_ext);
+}
+UPB_INLINE bool validate_required(const struct google_protobuf_OneofOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_required_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+UPB_INLINE bool validate_has_rules(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &validate_rules_ext) != NULL;
+}
+UPB_INLINE void validate_clear_rules(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &validate_rules_ext);
+}
+UPB_INLINE const validate_FieldRules* validate_rules(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &validate_rules_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const validate_FieldRules*);
+}
+UPB_INLINE void validate_set_rules(struct google_protobuf_FieldOptions* msg, const validate_FieldRules* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &validate_rules_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const validate_FieldRules*) = ext;
+}
+extern const upb_MiniTable_File validate_validate_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c b/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c
new file mode 100644
index 00000000..cbd41bf3
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c
@@ -0,0 +1,110 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/migrate.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field xds_annotations_v3_MigrateAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_MigrateAnnotation__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_annotations_v3_FieldMigrateAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FieldMigrateAnnotation__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_annotations_v3_FileMigrateAnnotation__fields[1] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FileMigrateAnnotation__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &xds_annotations_v3_MigrateAnnotation_msginit,
+ &xds_annotations_v3_FieldMigrateAnnotation_msginit,
+ &xds_annotations_v3_FileMigrateAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit;
+const upb_MiniTable_Extension xds_annotations_v3_message_migrate_ext = {
+ {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_field_migrate_ext = {
+ {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &xds_annotations_v3_FieldMigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_enum_migrate_ext = {
+ {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumOptions_msginit,
+ {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_enum_value_migrate_ext = {
+ {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = &xds_annotations_v3_MigrateAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_file_migrate_ext = {
+ {112948430, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &xds_annotations_v3_FileMigrateAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[5] = {
+ &xds_annotations_v3_message_migrate_ext,
+ &xds_annotations_v3_field_migrate_ext,
+ &xds_annotations_v3_enum_migrate_ext,
+ &xds_annotations_v3_enum_value_migrate_ext,
+ &xds_annotations_v3_file_migrate_ext,
+};
+
+const upb_MiniTable_File xds_annotations_v3_migrate_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 3,
+ 0,
+ 5,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h b/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h
new file mode 100644
index 00000000..b419b075
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h
@@ -0,0 +1,278 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_annotations_v3_MigrateAnnotation;
+struct xds_annotations_v3_FieldMigrateAnnotation;
+struct xds_annotations_v3_FileMigrateAnnotation;
+typedef struct xds_annotations_v3_MigrateAnnotation xds_annotations_v3_MigrateAnnotation;
+typedef struct xds_annotations_v3_FieldMigrateAnnotation xds_annotations_v3_FieldMigrateAnnotation;
+typedef struct xds_annotations_v3_FileMigrateAnnotation xds_annotations_v3_FileMigrateAnnotation;
+extern const upb_MiniTable xds_annotations_v3_MigrateAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_FieldMigrateAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_FileMigrateAnnotation_msginit;
+extern const upb_MiniTable_Extension xds_annotations_v3_message_migrate_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_field_migrate_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_enum_migrate_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_enum_value_migrate_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_file_migrate_ext;
+struct google_protobuf_EnumOptions;
+struct google_protobuf_EnumValueOptions;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_FileOptions;
+struct google_protobuf_MessageOptions;
+extern const upb_MiniTable google_protobuf_EnumOptions_msginit;
+extern const upb_MiniTable google_protobuf_EnumValueOptions_msginit;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+
+
+
+/* xds.annotations.v3.MigrateAnnotation */
+
+UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_MigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_MigrateAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_MigrateAnnotation* ret = xds_annotations_v3_MigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_MigrateAnnotation* ret = xds_annotations_v3_MigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_MigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_MigrateAnnotation_serialize(const xds_annotations_v3_MigrateAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_MigrateAnnotation_serialize_ex(const xds_annotations_v3_MigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_MigrateAnnotation_clear_rename(const xds_annotations_v3_MigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_annotations_v3_MigrateAnnotation_rename(const xds_annotations_v3_MigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void xds_annotations_v3_MigrateAnnotation_set_rename(xds_annotations_v3_MigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+/* xds.annotations.v3.FieldMigrateAnnotation */
+
+UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMigrateAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_FieldMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldMigrateAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_FieldMigrateAnnotation* ret = xds_annotations_v3_FieldMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_FieldMigrateAnnotation* ret = xds_annotations_v3_FieldMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldMigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_FieldMigrateAnnotation_serialize(const xds_annotations_v3_FieldMigrateAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_FieldMigrateAnnotation_serialize_ex(const xds_annotations_v3_FieldMigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_clear_rename(const xds_annotations_v3_FieldMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_annotations_v3_FieldMigrateAnnotation_rename(const xds_annotations_v3_FieldMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_clear_oneof_promotion(const xds_annotations_v3_FieldMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_annotations_v3_FieldMigrateAnnotation_oneof_promotion(const xds_annotations_v3_FieldMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+
+UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_set_rename(xds_annotations_v3_FieldMigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+UPB_INLINE void xds_annotations_v3_FieldMigrateAnnotation_set_oneof_promotion(xds_annotations_v3_FieldMigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
+}
+
+/* xds.annotations.v3.FileMigrateAnnotation */
+
+UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigrateAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_FileMigrateAnnotation*)_upb_Message_New(&xds_annotations_v3_FileMigrateAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigrateAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_FileMigrateAnnotation* ret = xds_annotations_v3_FileMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigrateAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_FileMigrateAnnotation* ret = xds_annotations_v3_FileMigrateAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileMigrateAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_FileMigrateAnnotation_serialize(const xds_annotations_v3_FileMigrateAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_FileMigrateAnnotation_serialize_ex(const xds_annotations_v3_FileMigrateAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_FileMigrateAnnotation_clear_move_to_package(const xds_annotations_v3_FileMigrateAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_annotations_v3_FileMigrateAnnotation_move_to_package(const xds_annotations_v3_FileMigrateAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void xds_annotations_v3_FileMigrateAnnotation_set_move_to_package(xds_annotations_v3_FileMigrateAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+UPB_INLINE bool xds_annotations_v3_has_message_migrate(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_message_migrate_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_message_migrate(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_message_migrate_ext);
+}
+UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_message_migrate(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_message_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_message_migrate(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_message_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_field_migrate(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_field_migrate_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_field_migrate(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_field_migrate_ext);
+}
+UPB_INLINE const xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_field_migrate(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_field_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldMigrateAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_field_migrate(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldMigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_field_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FieldMigrateAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_enum_migrate(const struct google_protobuf_EnumOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_enum_migrate_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_enum_migrate(struct google_protobuf_EnumOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_enum_migrate_ext);
+}
+UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_migrate(const struct google_protobuf_EnumOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_enum_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_enum_migrate(struct google_protobuf_EnumOptions* msg, const xds_annotations_v3_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_enum_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_enum_value_migrate_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_enum_value_migrate_ext);
+}
+UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_value_migrate(const struct google_protobuf_EnumValueOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_enum_value_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MigrateAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_enum_value_migrate(struct google_protobuf_EnumValueOptions* msg, const xds_annotations_v3_MigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_enum_value_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_MigrateAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_file_migrate(const struct google_protobuf_FileOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_file_migrate_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_file_migrate(struct google_protobuf_FileOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_file_migrate_ext);
+}
+UPB_INLINE const xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_file_migrate(const struct google_protobuf_FileOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_file_migrate_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FileMigrateAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_file_migrate(struct google_protobuf_FileOptions* msg, const xds_annotations_v3_FileMigrateAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_file_migrate_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FileMigrateAnnotation*) = ext;
+}
+extern const upb_MiniTable_File xds_annotations_v3_migrate_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c b/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c
new file mode 100644
index 00000000..2fb3e910
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c
@@ -0,0 +1,55 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/security.upb.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field xds_annotations_v3_FieldSecurityAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(1, 1), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FieldSecurityAnnotation__fields[0],
+ UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_annotations_v3_FieldSecurityAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit;
+const upb_MiniTable_Extension xds_annotations_v3_security_ext = {
+ {99044135, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &xds_annotations_v3_FieldSecurityAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &xds_annotations_v3_security_ext,
+};
+
+const upb_MiniTable_File xds_annotations_v3_security_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h b/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h
new file mode 100644
index 00000000..1da6a1ae
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h
@@ -0,0 +1,108 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_annotations_v3_FieldSecurityAnnotation;
+typedef struct xds_annotations_v3_FieldSecurityAnnotation xds_annotations_v3_FieldSecurityAnnotation;
+extern const upb_MiniTable xds_annotations_v3_FieldSecurityAnnotation_msginit;
+extern const upb_MiniTable_Extension xds_annotations_v3_security_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+
+
+
+/* xds.annotations.v3.FieldSecurityAnnotation */
+
+UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_FieldSecurityAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldSecurityAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldSecurityAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_FieldSecurityAnnotation* ret = xds_annotations_v3_FieldSecurityAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldSecurityAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_FieldSecurityAnnotation_serialize(const xds_annotations_v3_FieldSecurityAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_FieldSecurityAnnotation_serialize_ex(const xds_annotations_v3_FieldSecurityAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_downstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_downstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_clear_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_FieldSecurityAnnotation_configure_for_untrusted_upstream(const xds_annotations_v3_FieldSecurityAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool);
+}
+
+UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_downstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void xds_annotations_v3_FieldSecurityAnnotation_set_configure_for_untrusted_upstream(xds_annotations_v3_FieldSecurityAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+UPB_INLINE bool xds_annotations_v3_has_security(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_security_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_security(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_security_ext);
+}
+UPB_INLINE const xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_security(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_security_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldSecurityAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_security(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldSecurityAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_security_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FieldSecurityAnnotation*) = ext;
+}
+extern const upb_MiniTable_File xds_annotations_v3_security_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c b/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c
new file mode 100644
index 00000000..792bbd4f
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c
@@ -0,0 +1,38 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/sensitive.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+const upb_MiniTable_Extension xds_annotations_v3_sensitive_ext = {
+ {61008053, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &xds_annotations_v3_sensitive_ext,
+};
+
+const upb_MiniTable_File xds_annotations_v3_sensitive_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ extensions_layout,
+ 0,
+ 0,
+ 1,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h b/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h
new file mode 100644
index 00000000..696ee5eb
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const upb_MiniTable_Extension xds_annotations_v3_sensitive_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+
+
+UPB_INLINE bool xds_annotations_v3_has_sensitive(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_sensitive_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_sensitive(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_sensitive_ext);
+}
+UPB_INLINE bool xds_annotations_v3_sensitive(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_sensitive_ext);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false;
+}
+extern const upb_MiniTable_File xds_annotations_v3_sensitive_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c b/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
new file mode 100644
index 00000000..56aa30db
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
@@ -0,0 +1,105 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field xds_annotations_v3_FileStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FileStatusAnnotation__fields[0],
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_annotations_v3_MessageStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_MessageStatusAnnotation__fields[0],
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_annotations_v3_FieldStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FieldStatusAnnotation__fields[0],
+ UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_annotations_v3_StatusAnnotation__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 4), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_StatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_StatusAnnotation__fields[0],
+ UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[4] = {
+ &xds_annotations_v3_FileStatusAnnotation_msginit,
+ &xds_annotations_v3_MessageStatusAnnotation_msginit,
+ &xds_annotations_v3_FieldStatusAnnotation_msginit,
+ &xds_annotations_v3_StatusAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit;
+const upb_MiniTable_Extension xds_annotations_v3_file_status_ext = {
+ {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &xds_annotations_v3_FileStatusAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_message_status_ext = {
+ {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &xds_annotations_v3_MessageStatusAnnotation_msginit},
+
+};
+const upb_MiniTable_Extension xds_annotations_v3_field_status_ext = {
+ {226829418, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &xds_annotations_v3_FieldStatusAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[3] = {
+ &xds_annotations_v3_file_status_ext,
+ &xds_annotations_v3_message_status_ext,
+ &xds_annotations_v3_field_status_ext,
+};
+
+const upb_MiniTable_File xds_annotations_v3_status_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 4,
+ 0,
+ 3,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h b/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h
new file mode 100644
index 00000000..dc5c2cb5
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h
@@ -0,0 +1,290 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_annotations_v3_FileStatusAnnotation;
+struct xds_annotations_v3_MessageStatusAnnotation;
+struct xds_annotations_v3_FieldStatusAnnotation;
+struct xds_annotations_v3_StatusAnnotation;
+typedef struct xds_annotations_v3_FileStatusAnnotation xds_annotations_v3_FileStatusAnnotation;
+typedef struct xds_annotations_v3_MessageStatusAnnotation xds_annotations_v3_MessageStatusAnnotation;
+typedef struct xds_annotations_v3_FieldStatusAnnotation xds_annotations_v3_FieldStatusAnnotation;
+typedef struct xds_annotations_v3_StatusAnnotation xds_annotations_v3_StatusAnnotation;
+extern const upb_MiniTable xds_annotations_v3_FileStatusAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_MessageStatusAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_FieldStatusAnnotation_msginit;
+extern const upb_MiniTable xds_annotations_v3_StatusAnnotation_msginit;
+extern const upb_MiniTable_Extension xds_annotations_v3_file_status_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_message_status_ext;
+extern const upb_MiniTable_Extension xds_annotations_v3_field_status_ext;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_FileOptions;
+struct google_protobuf_MessageOptions;
+extern const upb_MiniTable google_protobuf_FieldOptions_msginit;
+extern const upb_MiniTable google_protobuf_FileOptions_msginit;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+
+typedef enum {
+ xds_annotations_v3_UNKNOWN = 0,
+ xds_annotations_v3_FROZEN = 1,
+ xds_annotations_v3_ACTIVE = 2,
+ xds_annotations_v3_NEXT_MAJOR_VERSION_CANDIDATE = 3
+} xds_annotations_v3_PackageVersionStatus;
+
+
+
+/* xds.annotations.v3.FileStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatusAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_FileStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FileStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_FileStatusAnnotation* ret = xds_annotations_v3_FileStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatusAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_FileStatusAnnotation* ret = xds_annotations_v3_FileStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_FileStatusAnnotation_serialize(const xds_annotations_v3_FileStatusAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_FileStatusAnnotation_serialize_ex(const xds_annotations_v3_FileStatusAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_FileStatusAnnotation_clear_work_in_progress(const xds_annotations_v3_FileStatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_FileStatusAnnotation_work_in_progress(const xds_annotations_v3_FileStatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+
+UPB_INLINE void xds_annotations_v3_FileStatusAnnotation_set_work_in_progress(xds_annotations_v3_FileStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.MessageStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_MessageStatusAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_MessageStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_MessageStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_MessageStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_MessageStatusAnnotation* ret = xds_annotations_v3_MessageStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_MessageStatusAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_MessageStatusAnnotation* ret = xds_annotations_v3_MessageStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_MessageStatusAnnotation_serialize(const xds_annotations_v3_MessageStatusAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_MessageStatusAnnotation_serialize_ex(const xds_annotations_v3_MessageStatusAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_MessageStatusAnnotation_clear_work_in_progress(const xds_annotations_v3_MessageStatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_MessageStatusAnnotation_work_in_progress(const xds_annotations_v3_MessageStatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+
+UPB_INLINE void xds_annotations_v3_MessageStatusAnnotation_set_work_in_progress(xds_annotations_v3_MessageStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.FieldStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldStatusAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_FieldStatusAnnotation*)_upb_Message_New(&xds_annotations_v3_FieldStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldStatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_FieldStatusAnnotation* ret = xds_annotations_v3_FieldStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldStatusAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_FieldStatusAnnotation* ret = xds_annotations_v3_FieldStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_FieldStatusAnnotation_serialize(const xds_annotations_v3_FieldStatusAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_FieldStatusAnnotation_serialize_ex(const xds_annotations_v3_FieldStatusAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_FieldStatusAnnotation_clear_work_in_progress(const xds_annotations_v3_FieldStatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_FieldStatusAnnotation_work_in_progress(const xds_annotations_v3_FieldStatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+
+UPB_INLINE void xds_annotations_v3_FieldStatusAnnotation_set_work_in_progress(xds_annotations_v3_FieldStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.StatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_StatusAnnotation*)_upb_Message_New(&xds_annotations_v3_StatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_StatusAnnotation* ret = xds_annotations_v3_StatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_StatusAnnotation* ret = xds_annotations_v3_StatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_StatusAnnotation_serialize(const xds_annotations_v3_StatusAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_StatusAnnotation_serialize_ex(const xds_annotations_v3_StatusAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_clear_work_in_progress(const xds_annotations_v3_StatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_annotations_v3_StatusAnnotation_work_in_progress(const xds_annotations_v3_StatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_clear_package_version_status(const xds_annotations_v3_StatusAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0;
+}
+UPB_INLINE int32_t xds_annotations_v3_StatusAnnotation_package_version_status(const xds_annotations_v3_StatusAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_work_in_progress(xds_annotations_v3_StatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_package_version_status(xds_annotations_v3_StatusAnnotation *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+
+UPB_INLINE bool xds_annotations_v3_has_file_status(const struct google_protobuf_FileOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_file_status_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_file_status(struct google_protobuf_FileOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_file_status_ext);
+}
+UPB_INLINE const xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_file_status(const struct google_protobuf_FileOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_file_status_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FileStatusAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_file_status(struct google_protobuf_FileOptions* msg, const xds_annotations_v3_FileStatusAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_file_status_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FileStatusAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_message_status(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_message_status_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_message_status(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_message_status_ext);
+}
+UPB_INLINE const xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_message_status(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_message_status_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MessageStatusAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_message_status(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_MessageStatusAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_message_status_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_MessageStatusAnnotation*) = ext;
+}
+UPB_INLINE bool xds_annotations_v3_has_field_status(const struct google_protobuf_FieldOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_field_status_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_field_status(struct google_protobuf_FieldOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_field_status_ext);
+}
+UPB_INLINE const xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_field_status(const struct google_protobuf_FieldOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_field_status_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldStatusAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_field_status(struct google_protobuf_FieldOptions* msg, const xds_annotations_v3_FieldStatusAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_field_status_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FieldStatusAnnotation*) = ext;
+}
+extern const upb_MiniTable_File xds_annotations_v3_status_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c b/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c
new file mode 100644
index 00000000..d3534604
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/versioning.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Field xds_annotations_v3_VersioningAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_VersioningAnnotation__fields[0],
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_annotations_v3_VersioningAnnotation_msginit,
+};
+
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit;
+const upb_MiniTable_Extension xds_annotations_v3_versioning_ext = {
+ {92389011, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | kUpb_LabelFlags_IsExtension | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &xds_annotations_v3_VersioningAnnotation_msginit},
+
+};
+
+static const upb_MiniTable_Extension *extensions_layout[1] = {
+ &xds_annotations_v3_versioning_ext,
+};
+
+const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ extensions_layout,
+ 1,
+ 0,
+ 1,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h b/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h
new file mode 100644
index 00000000..20eff571
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h
@@ -0,0 +1,99 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_annotations_v3_VersioningAnnotation;
+typedef struct xds_annotations_v3_VersioningAnnotation xds_annotations_v3_VersioningAnnotation;
+extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit;
+extern const upb_MiniTable_Extension xds_annotations_v3_versioning_ext;
+struct google_protobuf_MessageOptions;
+extern const upb_MiniTable google_protobuf_MessageOptions_msginit;
+
+
+
+/* xds.annotations.v3.VersioningAnnotation */
+
+UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_new(upb_Arena* arena) {
+ return (xds_annotations_v3_VersioningAnnotation*)_upb_Message_New(&xds_annotations_v3_VersioningAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize(const xds_annotations_v3_VersioningAnnotation* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize_ex(const xds_annotations_v3_VersioningAnnotation* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, options, arena, len);
+}
+UPB_INLINE void xds_annotations_v3_VersioningAnnotation_clear_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_annotations_v3_VersioningAnnotation_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
+}
+
+UPB_INLINE void xds_annotations_v3_VersioningAnnotation_set_previous_message_type(xds_annotations_v3_VersioningAnnotation *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
+}
+
+UPB_INLINE bool xds_annotations_v3_has_versioning(const struct google_protobuf_MessageOptions* msg) {
+ return _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext) != NULL;
+}
+UPB_INLINE void xds_annotations_v3_clear_versioning(struct google_protobuf_MessageOptions* msg) {
+ _upb_Message_Clearext(msg, &xds_annotations_v3_versioning_ext);
+}
+UPB_INLINE const xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_versioning(const struct google_protobuf_MessageOptions* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_VersioningAnnotation*);
+}
+UPB_INLINE void xds_annotations_v3_set_versioning(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_VersioningAnnotation* ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &xds_annotations_v3_versioning_ext, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_VersioningAnnotation*) = ext;
+}
+extern const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
index 6c6da7d7..edadf420 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
@@ -7,21 +7,34 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/authority.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout_field xds_core_v3_Authority__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+static const upb_MiniTable_Field xds_core_v3_Authority__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_Authority_msginit = {
+const upb_MiniTable xds_core_v3_Authority_msginit = {
NULL,
&xds_core_v3_Authority__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_core_v3_Authority_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_authority_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
index 2f1ff445..8f7c8bd5 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_
#define XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,35 +22,54 @@ extern "C" {
struct xds_core_v3_Authority;
typedef struct xds_core_v3_Authority xds_core_v3_Authority;
-extern const upb_msglayout xds_core_v3_Authority_msginit;
+extern const upb_MiniTable xds_core_v3_Authority_msginit;
+
/* xds.core.v3.Authority */
-UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_new(upb_arena *arena) {
- return (xds_core_v3_Authority *)_upb_msg_new(&xds_core_v3_Authority_msginit, arena);
+UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_new(upb_Arena* arena) {
+ return (xds_core_v3_Authority*)_upb_Message_New(&xds_core_v3_Authority_msginit, arena);
}
-UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_Authority *ret = xds_core_v3_Authority_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_Authority* ret = xds_core_v3_Authority_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_Authority *ret = xds_core_v3_Authority_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_Authority* ret = xds_core_v3_Authority_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_Authority_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *xds_core_v3_Authority_serialize(const xds_core_v3_Authority *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_Authority_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_Authority_serialize(const xds_core_v3_Authority* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_Authority_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_core_v3_Authority_serialize_ex(const xds_core_v3_Authority* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_Authority_msginit, options, arena, len);
+}
+UPB_INLINE void xds_core_v3_Authority_clear_name(const xds_core_v3_Authority* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_Authority_name(const xds_core_v3_Authority* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView);
}
-UPB_INLINE upb_strview xds_core_v3_Authority_name(const xds_core_v3_Authority *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-
-UPB_INLINE void xds_core_v3_Authority_set_name(xds_core_v3_Authority *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void xds_core_v3_Authority_set_name(xds_core_v3_Authority *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value;
}
+extern const upb_MiniTable_File xds_core_v3_authority_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
index 20cc2970..c3b012c6 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
@@ -7,45 +7,59 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/collection_entry.upb.h"
#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/resource_locator.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_CollectionEntry_submsgs[2] = {
- &xds_core_v3_CollectionEntry_InlineEntry_msginit,
- &xds_core_v3_ResourceLocator_msginit,
+static const upb_MiniTable_Sub xds_core_v3_CollectionEntry_submsgs[2] = {
+ {.submsg = &xds_core_v3_ResourceLocator_msginit},
+ {.submsg = &xds_core_v3_CollectionEntry_InlineEntry_msginit},
};
-static const upb_msglayout_field xds_core_v3_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},
+static const upb_MiniTable_Field xds_core_v3_CollectionEntry__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_CollectionEntry_msginit = {
+const upb_MiniTable xds_core_v3_CollectionEntry_msginit = {
&xds_core_v3_CollectionEntry_submsgs[0],
&xds_core_v3_CollectionEntry__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
};
-static const upb_msglayout *const xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_MiniTable_Sub xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field xds_core_v3_CollectionEntry_InlineEntry__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 1, 0, 11, 1},
+static const upb_MiniTable_Field xds_core_v3_CollectionEntry_InlineEntry__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit = {
+const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msginit = {
&xds_core_v3_CollectionEntry_InlineEntry_submsgs[0],
&xds_core_v3_CollectionEntry_InlineEntry__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &xds_core_v3_CollectionEntry_msginit,
+ &xds_core_v3_CollectionEntry_InlineEntry_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_collection_entry_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
index 983a3455..249ee2e7 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
#define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,65 +24,92 @@ struct xds_core_v3_CollectionEntry;
struct xds_core_v3_CollectionEntry_InlineEntry;
typedef struct xds_core_v3_CollectionEntry xds_core_v3_CollectionEntry;
typedef struct xds_core_v3_CollectionEntry_InlineEntry xds_core_v3_CollectionEntry_InlineEntry;
-extern const upb_msglayout xds_core_v3_CollectionEntry_msginit;
-extern const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit;
+extern const upb_MiniTable xds_core_v3_CollectionEntry_msginit;
+extern const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msginit;
struct google_protobuf_Any;
struct xds_core_v3_ResourceLocator;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable xds_core_v3_ResourceLocator_msginit;
+
/* xds.core.v3.CollectionEntry */
-UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_new(upb_arena *arena) {
- return (xds_core_v3_CollectionEntry *)_upb_msg_new(&xds_core_v3_CollectionEntry_msginit, arena);
+UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_new(upb_Arena* arena) {
+ return (xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msginit, arena);
}
-UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, 0, arena, len);
}
-UPB_INLINE char *xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_CollectionEntry_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_CollectionEntry_serialize_ex(const xds_core_v3_CollectionEntry* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, options, arena, len);
}
-
typedef enum {
xds_core_v3_CollectionEntry_resource_specifier_locator = 1,
xds_core_v3_CollectionEntry_resource_specifier_inline_entry = 2,
xds_core_v3_CollectionEntry_resource_specifier_NOT_SET = 0
} xds_core_v3_CollectionEntry_resource_specifier_oneofcases;
-UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry* msg) { return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
-
-UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
-UPB_INLINE const struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const struct xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
-UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
-UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry *msg) { return UPB_READ_ONEOF(msg, const xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry* msg) {
+ return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void xds_core_v3_CollectionEntry_clear_locator(const xds_core_v3_CollectionEntry* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_CollectionEntry_resource_specifier_NOT_SET);
+}
+UPB_INLINE const struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void xds_core_v3_CollectionEntry_clear_inline_entry(const xds_core_v3_CollectionEntry* msg) {
+ UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_CollectionEntry_resource_specifier_NOT_SET);
+}
+UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry* msg) {
+ return UPB_READ_ONEOF(msg, const xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
UPB_INLINE void xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry *msg, struct xds_core_v3_ResourceLocator* value) {
- UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) {
struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_CollectionEntry_locator(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_ResourceLocator*)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
+ sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena);
if (!sub) return NULL;
xds_core_v3_CollectionEntry_set_locator(msg, sub);
}
return sub;
}
UPB_INLINE void xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry *msg, xds_core_v3_CollectionEntry_InlineEntry* value) {
- UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+ UPB_WRITE_ONEOF(msg, xds_core_v3_CollectionEntry_InlineEntry*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
-UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) {
struct xds_core_v3_CollectionEntry_InlineEntry* sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)xds_core_v3_CollectionEntry_inline_entry(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_msg_new(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
+ sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
if (!sub) return NULL;
xds_core_v3_CollectionEntry_set_inline_entry(msg, sub);
}
@@ -91,49 +118,79 @@ UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_Collectio
/* xds.core.v3.CollectionEntry.InlineEntry */
-UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_new(upb_arena *arena) {
- return (xds_core_v3_CollectionEntry_InlineEntry *)_upb_msg_new(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
+UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_new(upb_Arena* arena) {
+ return (xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msginit, arena);
}
-UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, 0, arena, len);
}
-UPB_INLINE char *xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_CollectionEntry_InlineEntry_serialize_ex(const xds_core_v3_CollectionEntry_InlineEntry* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, options, arena, len);
+}
+UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_name(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_version(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*);
}
-UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_Any*); }
-
-UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_CollectionEntry_InlineEntry_resource(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
xds_core_v3_CollectionEntry_InlineEntry_set_resource(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File xds_core_v3_collection_entry_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
index 17c3c61c..b9acaff4 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
@@ -7,35 +7,49 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/context_params.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ContextParams_submsgs[1] = {
- &xds_core_v3_ContextParams_ParamsEntry_msginit,
+static const upb_MiniTable_Sub xds_core_v3_ContextParams_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_ParamsEntry_msginit},
};
-static const upb_msglayout_field xds_core_v3_ContextParams__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_MiniTable_Field xds_core_v3_ContextParams__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_ContextParams_msginit = {
+const upb_MiniTable xds_core_v3_ContextParams_msginit = {
&xds_core_v3_ContextParams_submsgs[0],
&xds_core_v3_ContextParams__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
};
-static const upb_msglayout_field xds_core_v3_ContextParams_ParamsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+static const upb_MiniTable_Field xds_core_v3_ContextParams_ParamsEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_ContextParams_ParamsEntry_msginit = {
+const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msginit = {
NULL,
&xds_core_v3_ContextParams_ParamsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &xds_core_v3_ContextParams_msginit,
+ &xds_core_v3_ContextParams_ParamsEntry_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_context_params_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
index 0bcd2425..89ec9d86 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_
#define XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,57 +24,88 @@ struct xds_core_v3_ContextParams;
struct xds_core_v3_ContextParams_ParamsEntry;
typedef struct xds_core_v3_ContextParams xds_core_v3_ContextParams;
typedef struct xds_core_v3_ContextParams_ParamsEntry xds_core_v3_ContextParams_ParamsEntry;
-extern const upb_msglayout xds_core_v3_ContextParams_msginit;
-extern const upb_msglayout xds_core_v3_ContextParams_ParamsEntry_msginit;
+extern const upb_MiniTable xds_core_v3_ContextParams_msginit;
+extern const upb_MiniTable xds_core_v3_ContextParams_ParamsEntry_msginit;
+
/* xds.core.v3.ContextParams */
-UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_new(upb_arena *arena) {
- return (xds_core_v3_ContextParams *)_upb_msg_new(&xds_core_v3_ContextParams_msginit, arena);
+UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_new(upb_Arena* arena) {
+ return (xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena);
}
-UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_ContextParams *ret = xds_core_v3_ContextParams_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_ContextParams* ret = xds_core_v3_ContextParams_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_ContextParams *ret = xds_core_v3_ContextParams_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_ContextParams* ret = xds_core_v3_ContextParams_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *xds_core_v3_ContextParams_serialize(const xds_core_v3_ContextParams *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_ContextParams_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_ContextParams_serialize(const xds_core_v3_ContextParams* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ContextParams_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_core_v3_ContextParams_serialize_ex(const xds_core_v3_ContextParams* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ContextParams_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_core_v3_ContextParams_has_params(const xds_core_v3_ContextParams* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_core_v3_ContextParams_clear_params(const xds_core_v3_ContextParams* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE size_t xds_core_v3_ContextParams_params_size(const xds_core_v3_ContextParams* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE bool xds_core_v3_ContextParams_params_get(const xds_core_v3_ContextParams* msg, upb_StringView key, upb_StringView* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, 0);
+}
+UPB_INLINE const xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_next(const xds_core_v3_ContextParams* msg, size_t* iter) {
+ return (const xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
}
-UPB_INLINE bool xds_core_v3_ContextParams_has_params(const xds_core_v3_ContextParams *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE size_t xds_core_v3_ContextParams_params_size(const xds_core_v3_ContextParams *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool xds_core_v3_ContextParams_params_get(const xds_core_v3_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 xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_next(const xds_core_v3_ContextParams *msg, size_t* iter) { return (const xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
-
-UPB_INLINE void xds_core_v3_ContextParams_params_clear(xds_core_v3_ContextParams *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
-UPB_INLINE bool xds_core_v3_ContextParams_params_set(xds_core_v3_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 xds_core_v3_ContextParams_params_delete(xds_core_v3_ContextParams *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
-UPB_INLINE xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_nextmutable(xds_core_v3_ContextParams *msg, size_t* iter) { return (xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE void xds_core_v3_ContextParams_params_clear(xds_core_v3_ContextParams* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool xds_core_v3_ContextParams_params_set(xds_core_v3_ContextParams* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, 0, a);
+}
+UPB_INLINE bool xds_core_v3_ContextParams_params_delete(xds_core_v3_ContextParams* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0);
+}
+UPB_INLINE xds_core_v3_ContextParams_ParamsEntry* xds_core_v3_ContextParams_params_nextmutable(xds_core_v3_ContextParams* msg, size_t* iter) {
+ return (xds_core_v3_ContextParams_ParamsEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
/* xds.core.v3.ContextParams.ParamsEntry */
-UPB_INLINE upb_strview xds_core_v3_ContextParams_ParamsEntry_key(const xds_core_v3_ContextParams_ParamsEntry *msg) {
- upb_strview ret;
+UPB_INLINE upb_StringView xds_core_v3_ContextParams_ParamsEntry_key(const xds_core_v3_ContextParams_ParamsEntry* msg) {
+ upb_StringView ret;
_upb_msg_map_key(msg, &ret, 0);
return ret;
}
-UPB_INLINE upb_strview xds_core_v3_ContextParams_ParamsEntry_value(const xds_core_v3_ContextParams_ParamsEntry *msg) {
- upb_strview ret;
+UPB_INLINE upb_StringView xds_core_v3_ContextParams_ParamsEntry_value(const xds_core_v3_ContextParams_ParamsEntry* msg) {
+ upb_StringView ret;
_upb_msg_map_value(msg, &ret, 0);
return ret;
}
-UPB_INLINE void xds_core_v3_ContextParams_ParamsEntry_set_value(xds_core_v3_ContextParams_ParamsEntry *msg, upb_strview value) {
+UPB_INLINE void xds_core_v3_ContextParams_ParamsEntry_set_value(xds_core_v3_ContextParams_ParamsEntry *msg, upb_StringView value) {
_upb_msg_map_set_value(msg, &value, 0);
}
+extern const upb_MiniTable_File xds_core_v3_context_params_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.c
new file mode 100644
index 00000000..53a02981
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/core/v3/extension.upb.h"
+#include "validate/validate.upb.h"
+#include "google/protobuf/any.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_core_v3_TypedExtensionConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
+};
+
+static const upb_MiniTable_Field xds_core_v3_TypedExtensionConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit = {
+ &xds_core_v3_TypedExtensionConfig_submsgs[0],
+ &xds_core_v3_TypedExtensionConfig__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_core_v3_TypedExtensionConfig_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_extension_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.h
new file mode 100644
index 00000000..f5de2207
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/extension.upb.h
@@ -0,0 +1,103 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_CORE_V3_EXTENSION_PROTO_UPB_H_
+#define XDS_CORE_V3_EXTENSION_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_core_v3_TypedExtensionConfig;
+typedef struct xds_core_v3_TypedExtensionConfig xds_core_v3_TypedExtensionConfig;
+extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit;
+struct google_protobuf_Any;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+
+
+
+/* xds.core.v3.TypedExtensionConfig */
+
+UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_new(upb_Arena* arena) {
+ return (xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+}
+UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_TypedExtensionConfig* ret = xds_core_v3_TypedExtensionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_TypedExtensionConfig* ret = xds_core_v3_TypedExtensionConfig_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_TypedExtensionConfig_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_core_v3_TypedExtensionConfig_serialize(const xds_core_v3_TypedExtensionConfig* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_core_v3_TypedExtensionConfig_serialize_ex(const xds_core_v3_TypedExtensionConfig* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, options, arena, len);
+}
+UPB_INLINE void xds_core_v3_TypedExtensionConfig_clear_name(const xds_core_v3_TypedExtensionConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_TypedExtensionConfig_name(const xds_core_v3_TypedExtensionConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool xds_core_v3_TypedExtensionConfig_has_typed_config(const xds_core_v3_TypedExtensionConfig* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_core_v3_TypedExtensionConfig_clear_typed_config(const xds_core_v3_TypedExtensionConfig* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* xds_core_v3_TypedExtensionConfig_typed_config(const xds_core_v3_TypedExtensionConfig* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*);
+}
+
+UPB_INLINE void xds_core_v3_TypedExtensionConfig_set_name(xds_core_v3_TypedExtensionConfig *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void xds_core_v3_TypedExtensionConfig_set_typed_config(xds_core_v3_TypedExtensionConfig *msg, struct google_protobuf_Any* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* xds_core_v3_TypedExtensionConfig_mutable_typed_config(xds_core_v3_TypedExtensionConfig* msg, upb_Arena* arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_TypedExtensionConfig_typed_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ xds_core_v3_TypedExtensionConfig_set_typed_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File xds_core_v3_extension_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_CORE_V3_EXTENSION_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
index fa2375e9..d3d04c66 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
@@ -7,29 +7,42 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource.upb.h"
#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/resource_name.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_Resource_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &xds_core_v3_ResourceName_msginit,
+static const upb_MiniTable_Sub xds_core_v3_Resource_submsgs[2] = {
+ {.submsg = &xds_core_v3_ResourceName_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
-static const upb_msglayout_field xds_core_v3_Resource__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+static const upb_MiniTable_Field xds_core_v3_Resource__fields[3] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_Resource_msginit = {
+const upb_MiniTable xds_core_v3_Resource_msginit = {
&xds_core_v3_Resource_submsgs[0],
&xds_core_v3_Resource__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_core_v3_Resource_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_resource_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
index ab8e2df4..7e0df11c 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,69 +22,102 @@ extern "C" {
struct xds_core_v3_Resource;
typedef struct xds_core_v3_Resource xds_core_v3_Resource;
-extern const upb_msglayout xds_core_v3_Resource_msginit;
+extern const upb_MiniTable xds_core_v3_Resource_msginit;
struct google_protobuf_Any;
struct xds_core_v3_ResourceName;
-extern const upb_msglayout google_protobuf_Any_msginit;
-extern const upb_msglayout xds_core_v3_ResourceName_msginit;
+extern const upb_MiniTable google_protobuf_Any_msginit;
+extern const upb_MiniTable xds_core_v3_ResourceName_msginit;
+
/* xds.core.v3.Resource */
-UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_new(upb_arena *arena) {
- return (xds_core_v3_Resource *)_upb_msg_new(&xds_core_v3_Resource_msginit, arena);
+UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_new(upb_Arena* arena) {
+ return (xds_core_v3_Resource*)_upb_Message_New(&xds_core_v3_Resource_msginit, arena);
}
-UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_Resource *ret = xds_core_v3_Resource_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_Resource* ret = xds_core_v3_Resource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_Resource *ret = xds_core_v3_Resource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_Resource* ret = xds_core_v3_Resource_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_Resource_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *xds_core_v3_Resource_serialize(const xds_core_v3_Resource *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_Resource_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_Resource_serialize(const xds_core_v3_Resource* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_Resource_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_core_v3_Resource_serialize_ex(const xds_core_v3_Resource* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_Resource_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_core_v3_Resource_has_name(const xds_core_v3_Resource* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_core_v3_Resource_clear_name(const xds_core_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_core_v3_ResourceName* xds_core_v3_Resource_name(const xds_core_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_core_v3_ResourceName*);
+}
+UPB_INLINE void xds_core_v3_Resource_clear_version(const xds_core_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_Resource_version(const xds_core_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView);
+}
+UPB_INLINE bool xds_core_v3_Resource_has_resource(const xds_core_v3_Resource* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void xds_core_v3_Resource_clear_resource(const xds_core_v3_Resource* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Any* xds_core_v3_Resource_resource(const xds_core_v3_Resource* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*);
}
-
-UPB_INLINE bool xds_core_v3_Resource_has_name(const xds_core_v3_Resource *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct xds_core_v3_ResourceName* xds_core_v3_Resource_name(const xds_core_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct xds_core_v3_ResourceName*); }
-UPB_INLINE upb_strview xds_core_v3_Resource_version(const xds_core_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool xds_core_v3_Resource_has_resource(const xds_core_v3_Resource *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_Any* xds_core_v3_Resource_resource(const xds_core_v3_Resource *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Any*); }
UPB_INLINE void xds_core_v3_Resource_set_name(xds_core_v3_Resource *msg, struct xds_core_v3_ResourceName* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct xds_core_v3_ResourceName*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_core_v3_ResourceName*) = value;
}
-UPB_INLINE struct xds_core_v3_ResourceName* xds_core_v3_Resource_mutable_name(xds_core_v3_Resource *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_ResourceName* xds_core_v3_Resource_mutable_name(xds_core_v3_Resource* msg, upb_Arena* arena) {
struct xds_core_v3_ResourceName* sub = (struct xds_core_v3_ResourceName*)xds_core_v3_Resource_name(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_ResourceName*)_upb_msg_new(&xds_core_v3_ResourceName_msginit, arena);
+ sub = (struct xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msginit, arena);
if (!sub) return NULL;
xds_core_v3_Resource_set_name(msg, sub);
}
return sub;
}
-UPB_INLINE void xds_core_v3_Resource_set_version(xds_core_v3_Resource *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void xds_core_v3_Resource_set_version(xds_core_v3_Resource *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_StringView) = value;
}
UPB_INLINE void xds_core_v3_Resource_set_resource(xds_core_v3_Resource *msg, struct google_protobuf_Any* value) {
_upb_sethas(msg, 2);
*UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Any*) = value;
}
-UPB_INLINE struct google_protobuf_Any* xds_core_v3_Resource_mutable_resource(xds_core_v3_Resource *msg, upb_arena *arena) {
+UPB_INLINE struct google_protobuf_Any* xds_core_v3_Resource_mutable_resource(xds_core_v3_Resource* msg, upb_Arena* arena) {
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_Resource_resource(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena);
if (!sub) return NULL;
xds_core_v3_Resource_set_resource(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File xds_core_v3_resource_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
index 2bd099a5..5f26ef67 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
@@ -7,47 +7,61 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource_locator.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/context_params.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ResourceLocator_submsgs[2] = {
- &xds_core_v3_ContextParams_msginit,
- &xds_core_v3_ResourceLocator_Directive_msginit,
+static const upb_MiniTable_Sub xds_core_v3_ResourceLocator_submsgs[2] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
+ {.submsg = &xds_core_v3_ResourceLocator_Directive_msginit},
};
-static const upb_msglayout_field xds_core_v3_ResourceLocator__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 0, 11, 1},
- {6, UPB_SIZE(28, 56), 0, 1, 11, 3},
+static const upb_MiniTable_Field xds_core_v3_ResourceLocator__fields[6] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 5, kUpb_FieldMode_Scalar | (kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(36, 64), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(32, 56), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_ResourceLocator_msginit = {
+const upb_MiniTable xds_core_v3_ResourceLocator_msginit = {
&xds_core_v3_ResourceLocator_submsgs[0],
&xds_core_v3_ResourceLocator__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0,
};
-static const upb_msglayout *const xds_core_v3_ResourceLocator_Directive_submsgs[1] = {
- &xds_core_v3_ResourceLocator_msginit,
+static const upb_MiniTable_Sub xds_core_v3_ResourceLocator_Directive_submsgs[1] = {
+ {.submsg = &xds_core_v3_ResourceLocator_msginit},
};
-static const upb_msglayout_field xds_core_v3_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},
+static const upb_MiniTable_Field xds_core_v3_ResourceLocator_Directive__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit = {
+const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msginit = {
&xds_core_v3_ResourceLocator_Directive_submsgs[0],
&xds_core_v3_ResourceLocator_Directive__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &xds_core_v3_ResourceLocator_msginit,
+ &xds_core_v3_ResourceLocator_Directive_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_resource_locator_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
index da7442bd..2122a000 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,10 +24,10 @@ struct xds_core_v3_ResourceLocator;
struct xds_core_v3_ResourceLocator_Directive;
typedef struct xds_core_v3_ResourceLocator xds_core_v3_ResourceLocator;
typedef struct xds_core_v3_ResourceLocator_Directive xds_core_v3_ResourceLocator_Directive;
-extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit;
+extern const upb_MiniTable xds_core_v3_ResourceLocator_msginit;
+extern const upb_MiniTable xds_core_v3_ResourceLocator_Directive_msginit;
struct xds_core_v3_ContextParams;
-extern const upb_msglayout xds_core_v3_ContextParams_msginit;
+extern const upb_MiniTable xds_core_v3_ContextParams_msginit;
typedef enum {
xds_core_v3_ResourceLocator_XDSTP = 0,
@@ -36,127 +36,201 @@ typedef enum {
} xds_core_v3_ResourceLocator_Scheme;
+
/* xds.core.v3.ResourceLocator */
-UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_new(upb_arena *arena) {
- return (xds_core_v3_ResourceLocator *)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
+UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_new(upb_Arena* arena) {
+ return (xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena);
}
-UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_ResourceLocator* ret = xds_core_v3_ResourceLocator_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_ResourceLocator* ret = xds_core_v3_ResourceLocator_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, 0, arena, len);
}
-UPB_INLINE char *xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_ResourceLocator_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_ResourceLocator_serialize_ex(const xds_core_v3_ResourceLocator* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, options, arena, len);
}
-
typedef enum {
xds_core_v3_ResourceLocator_context_param_specifier_exact_context = 5,
xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET = 0
} xds_core_v3_ResourceLocator_context_param_specifier_oneofcases;
-UPB_INLINE xds_core_v3_ResourceLocator_context_param_specifier_oneofcases xds_core_v3_ResourceLocator_context_param_specifier_case(const xds_core_v3_ResourceLocator* msg) { return (xds_core_v3_ResourceLocator_context_param_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
-
-UPB_INLINE int32_t xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
-UPB_INLINE upb_strview xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
-UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator *msg) { return UPB_READ_ONEOF(msg, const struct xds_core_v3_ContextParams*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 5, NULL); }
-UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const xds_core_v3_ResourceLocator_Directive* const* xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator *msg, size_t *len) { return (const xds_core_v3_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE xds_core_v3_ResourceLocator_context_param_specifier_oneofcases xds_core_v3_ResourceLocator_context_param_specifier_case(const xds_core_v3_ResourceLocator* msg) {
+ return (xds_core_v3_ResourceLocator_context_param_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_scheme(const xds_core_v3_ResourceLocator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
+}
+UPB_INLINE int32_t xds_core_v3_ResourceLocator_scheme(const xds_core_v3_ResourceLocator* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_id(const xds_core_v3_ResourceLocator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_id(const xds_core_v3_ResourceLocator* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView);
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_authority(const xds_core_v3_ResourceLocator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_authority(const xds_core_v3_ResourceLocator* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView);
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_resource_type(const xds_core_v3_ResourceLocator* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_resource_type(const xds_core_v3_ResourceLocator* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView);
+}
+UPB_INLINE bool xds_core_v3_ResourceLocator_has_exact_context(const xds_core_v3_ResourceLocator* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_exact_context(const xds_core_v3_ResourceLocator* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), 0, UPB_SIZE(4, 4), xds_core_v3_ResourceLocator_context_param_specifier_NOT_SET);
+}
+UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_exact_context(const xds_core_v3_ResourceLocator* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE bool xds_core_v3_ResourceLocator_has_directives(const xds_core_v3_ResourceLocator* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 56));
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_clear_directives(const xds_core_v3_ResourceLocator* msg) {
+ _upb_array_detach(msg, UPB_SIZE(32, 56));
+}
+UPB_INLINE const xds_core_v3_ResourceLocator_Directive* const* xds_core_v3_ResourceLocator_directives(const xds_core_v3_ResourceLocator* msg, size_t* len) {
+ return (const xds_core_v3_ResourceLocator_Directive* const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len);
+}
UPB_INLINE void xds_core_v3_ResourceLocator_set_scheme(xds_core_v3_ResourceLocator *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
-UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceLocator_set_id(xds_core_v3_ResourceLocator *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_StringView) = value;
}
-UPB_INLINE void xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceLocator_set_authority(xds_core_v3_ResourceLocator *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_StringView) = value;
}
-UPB_INLINE void xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceLocator_set_resource_type(xds_core_v3_ResourceLocator *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_StringView) = value;
}
UPB_INLINE void xds_core_v3_ResourceLocator_set_exact_context(xds_core_v3_ResourceLocator *msg, struct xds_core_v3_ContextParams* value) {
- UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 5);
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_ContextParams*, UPB_SIZE(36, 64), value, UPB_SIZE(4, 4), 5);
}
-UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceLocator_mutable_exact_context(xds_core_v3_ResourceLocator* msg, upb_Arena* arena) {
struct xds_core_v3_ContextParams* sub = (struct xds_core_v3_ContextParams*)xds_core_v3_ResourceLocator_exact_context(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_ContextParams*)_upb_msg_new(&xds_core_v3_ContextParams_msginit, arena);
+ sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena);
if (!sub) return NULL;
xds_core_v3_ResourceLocator_set_exact_context(msg, sub);
}
return sub;
}
-UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator *msg, size_t *len) {
- return (xds_core_v3_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_mutable_directives(xds_core_v3_ResourceLocator* msg, size_t* len) {
+ return (xds_core_v3_ResourceLocator_Directive**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
}
-UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator *msg, size_t len, upb_arena *arena) {
- return (xds_core_v3_ResourceLocator_Directive**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+UPB_INLINE xds_core_v3_ResourceLocator_Directive** xds_core_v3_ResourceLocator_resize_directives(xds_core_v3_ResourceLocator* msg, size_t len, upb_Arena* arena) {
+ return (xds_core_v3_ResourceLocator_Directive**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(2, 3), arena);
}
-UPB_INLINE struct xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator *msg, upb_arena *arena) {
- struct xds_core_v3_ResourceLocator_Directive* sub = (struct xds_core_v3_ResourceLocator_Directive*)_upb_msg_new(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+UPB_INLINE struct xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_add_directives(xds_core_v3_ResourceLocator* msg, upb_Arena* arena) {
+ struct xds_core_v3_ResourceLocator_Directive* sub = (struct xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
/* xds.core.v3.ResourceLocator.Directive */
-UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_new(upb_arena *arena) {
- return (xds_core_v3_ResourceLocator_Directive *)_upb_msg_new(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
+UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Directive_new(upb_Arena* arena) {
+ return (xds_core_v3_ResourceLocator_Directive*)_upb_Message_New(&xds_core_v3_ResourceLocator_Directive_msginit, arena);
}
-UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Directive_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_ResourceLocator_Directive* ret = xds_core_v3_ResourceLocator_Directive_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Directive_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_ResourceLocator_Directive* ret = xds_core_v3_ResourceLocator_Directive_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE char* xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, 0, arena, len);
}
-UPB_INLINE char *xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_ResourceLocator_Directive_serialize_ex(const xds_core_v3_ResourceLocator_Directive* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, options, arena, len);
}
-
typedef enum {
xds_core_v3_ResourceLocator_Directive_directive_alt = 1,
xds_core_v3_ResourceLocator_Directive_directive_entry = 2,
xds_core_v3_ResourceLocator_Directive_directive_NOT_SET = 0
} xds_core_v3_ResourceLocator_Directive_directive_oneofcases;
-UPB_INLINE xds_core_v3_ResourceLocator_Directive_directive_oneofcases xds_core_v3_ResourceLocator_Directive_directive_case(const xds_core_v3_ResourceLocator_Directive* msg) { return (xds_core_v3_ResourceLocator_Directive_directive_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
-
-UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
-UPB_INLINE const xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive *msg) { return UPB_READ_ONEOF(msg, const xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, NULL); }
-UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
-UPB_INLINE upb_strview xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_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 xds_core_v3_ResourceLocator_Directive_directive_oneofcases xds_core_v3_ResourceLocator_Directive_directive_case(const xds_core_v3_ResourceLocator_Directive* msg) {
+ return (xds_core_v3_ResourceLocator_Directive_directive_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_alt(const xds_core_v3_ResourceLocator_Directive* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_alt(const xds_core_v3_ResourceLocator_Directive* msg) {
+ UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_core_v3_ResourceLocator_Directive_directive_NOT_SET);
+}
+UPB_INLINE const xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_alt(const xds_core_v3_ResourceLocator_Directive* msg) {
+ return UPB_READ_ONEOF(msg, const xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool xds_core_v3_ResourceLocator_Directive_has_entry(const xds_core_v3_ResourceLocator_Directive* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void xds_core_v3_ResourceLocator_Directive_clear_entry(const xds_core_v3_ResourceLocator_Directive* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(0, 0), xds_core_v3_ResourceLocator_Directive_directive_NOT_SET);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceLocator_Directive_entry(const xds_core_v3_ResourceLocator_Directive* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, upb_StringView_FromString(""));
+}
UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_alt(xds_core_v3_ResourceLocator_Directive *msg, xds_core_v3_ResourceLocator* value) {
- UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+ UPB_WRITE_ONEOF(msg, xds_core_v3_ResourceLocator*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
-UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_Directive_mutable_alt(xds_core_v3_ResourceLocator_Directive* msg, upb_Arena* arena) {
struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_ResourceLocator_Directive_alt(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_ResourceLocator*)_upb_msg_new(&xds_core_v3_ResourceLocator_msginit, arena);
+ sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msginit, arena);
if (!sub) return NULL;
xds_core_v3_ResourceLocator_Directive_set_alt(msg, sub);
}
return sub;
}
-UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_ResourceLocator_Directive *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
+extern const upb_MiniTable_File xds_core_v3_resource_locator_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
index ff645f68..5881000d 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
@@ -7,29 +7,42 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource_name.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/context_params.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ResourceName_submsgs[1] = {
- &xds_core_v3_ContextParams_msginit,
+static const upb_MiniTable_Sub xds_core_v3_ResourceName_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
};
-static const upb_msglayout_field xds_core_v3_ResourceName__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, 9, 1},
- {4, UPB_SIZE(28, 56), 1, 0, 11, 1},
+static const upb_MiniTable_Field xds_core_v3_ResourceName__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(20, 40), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(28, 56), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
};
-const upb_msglayout xds_core_v3_ResourceName_msginit = {
+const upb_MiniTable xds_core_v3_ResourceName_msginit = {
&xds_core_v3_ResourceName_submsgs[0],
&xds_core_v3_ResourceName__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_core_v3_ResourceName_msginit,
+};
+
+const upb_MiniTable_File xds_core_v3_resource_name_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
index 3f38cc51..637a6a15 100644
--- a/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
+++ b/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -22,60 +22,96 @@ extern "C" {
struct xds_core_v3_ResourceName;
typedef struct xds_core_v3_ResourceName xds_core_v3_ResourceName;
-extern const upb_msglayout xds_core_v3_ResourceName_msginit;
+extern const upb_MiniTable xds_core_v3_ResourceName_msginit;
struct xds_core_v3_ContextParams;
-extern const upb_msglayout xds_core_v3_ContextParams_msginit;
+extern const upb_MiniTable xds_core_v3_ContextParams_msginit;
+
/* xds.core.v3.ResourceName */
-UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_new(upb_arena *arena) {
- return (xds_core_v3_ResourceName *)_upb_msg_new(&xds_core_v3_ResourceName_msginit, arena);
+UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_new(upb_Arena* arena) {
+ return (xds_core_v3_ResourceName*)_upb_Message_New(&xds_core_v3_ResourceName_msginit, arena);
}
-UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_parse(const char *buf, size_t size,
- upb_arena *arena) {
- xds_core_v3_ResourceName *ret = xds_core_v3_ResourceName_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, arena)) ? ret : NULL;
+UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_core_v3_ResourceName* ret = xds_core_v3_ResourceName_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- xds_core_v3_ResourceName *ret = xds_core_v3_ResourceName_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, arena, options))
- ? ret : NULL;
+UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_core_v3_ResourceName* ret = xds_core_v3_ResourceName_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
}
-UPB_INLINE char *xds_core_v3_ResourceName_serialize(const xds_core_v3_ResourceName *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &xds_core_v3_ResourceName_msginit, arena, len);
+UPB_INLINE char* xds_core_v3_ResourceName_serialize(const xds_core_v3_ResourceName* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceName_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_core_v3_ResourceName_serialize_ex(const xds_core_v3_ResourceName* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_core_v3_ResourceName_msginit, options, arena, len);
+}
+UPB_INLINE void xds_core_v3_ResourceName_clear_id(const xds_core_v3_ResourceName* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceName_id(const xds_core_v3_ResourceName* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE void xds_core_v3_ResourceName_clear_authority(const xds_core_v3_ResourceName* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceName_authority(const xds_core_v3_ResourceName* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView);
+}
+UPB_INLINE void xds_core_v3_ResourceName_clear_resource_type(const xds_core_v3_ResourceName* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_core_v3_ResourceName_resource_type(const xds_core_v3_ResourceName* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView);
+}
+UPB_INLINE bool xds_core_v3_ResourceName_has_context(const xds_core_v3_ResourceName* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_core_v3_ResourceName_clear_context(const xds_core_v3_ResourceName* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_context(const xds_core_v3_ResourceName* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct xds_core_v3_ContextParams*);
}
-UPB_INLINE upb_strview xds_core_v3_ResourceName_id(const xds_core_v3_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE upb_strview xds_core_v3_ResourceName_authority(const xds_core_v3_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
-UPB_INLINE upb_strview xds_core_v3_ResourceName_resource_type(const xds_core_v3_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool xds_core_v3_ResourceName_has_context(const xds_core_v3_ResourceName *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_context(const xds_core_v3_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct xds_core_v3_ContextParams*); }
-
-UPB_INLINE void xds_core_v3_ResourceName_set_id(xds_core_v3_ResourceName *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceName_set_id(xds_core_v3_ResourceName *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
}
-UPB_INLINE void xds_core_v3_ResourceName_set_authority(xds_core_v3_ResourceName *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceName_set_authority(xds_core_v3_ResourceName *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_StringView) = value;
}
-UPB_INLINE void xds_core_v3_ResourceName_set_resource_type(xds_core_v3_ResourceName *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+UPB_INLINE void xds_core_v3_ResourceName_set_resource_type(xds_core_v3_ResourceName *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_StringView) = value;
}
UPB_INLINE void xds_core_v3_ResourceName_set_context(xds_core_v3_ResourceName *msg, struct xds_core_v3_ContextParams* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct xds_core_v3_ContextParams*) = value;
}
-UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_mutable_context(xds_core_v3_ResourceName *msg, upb_arena *arena) {
+UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_mutable_context(xds_core_v3_ResourceName* msg, upb_Arena* arena) {
struct xds_core_v3_ContextParams* sub = (struct xds_core_v3_ContextParams*)xds_core_v3_ResourceName_context(msg);
if (sub == NULL) {
- sub = (struct xds_core_v3_ContextParams*)_upb_msg_new(&xds_core_v3_ContextParams_msginit, arena);
+ sub = (struct xds_core_v3_ContextParams*)_upb_Message_New(&xds_core_v3_ContextParams_msginit, arena);
if (!sub) return NULL;
xds_core_v3_ResourceName_set_context(msg, sub);
}
return sub;
}
+extern const upb_MiniTable_File xds_core_v3_resource_name_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c b/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
new file mode 100644
index 00000000..8607c621
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
@@ -0,0 +1,73 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/data/orca/v3/orca_load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_data_orca_v3_OrcaLoadReport_submsgs[2] = {
+ {.submsg = &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit},
+ {.submsg = &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit},
+};
+
+static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport__fields[5] = {
+ {1, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(24, 32), UPB_SIZE(0, 0), kUpb_NoSub, 4, kUpb_FieldMode_Scalar | (kUpb_FieldRep_8Byte << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit = {
+ &xds_data_orca_v3_OrcaLoadReport_submsgs[0],
+ &xds_data_orca_v3_OrcaLoadReport__fields[0],
+ UPB_SIZE(32, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit = {
+ NULL,
+ &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Field xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 1, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit = {
+ NULL,
+ &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[3] = {
+ &xds_data_orca_v3_OrcaLoadReport_msginit,
+ &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit,
+ &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit,
+};
+
+const upb_MiniTable_File xds_data_orca_v3_orca_load_report_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 3,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h b/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
new file mode 100644
index 00000000..e38d6d25
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
@@ -0,0 +1,187 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/data/orca/v3/orca_load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_
+#define XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_data_orca_v3_OrcaLoadReport;
+struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry;
+struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry;
+typedef struct xds_data_orca_v3_OrcaLoadReport xds_data_orca_v3_OrcaLoadReport;
+typedef struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry xds_data_orca_v3_OrcaLoadReport_RequestCostEntry;
+typedef struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry xds_data_orca_v3_OrcaLoadReport_UtilizationEntry;
+extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_msginit;
+extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit;
+extern const upb_MiniTable xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit;
+
+
+
+/* xds.data.orca.v3.OrcaLoadReport */
+
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_new(upb_Arena* arena) {
+ return (xds_data_orca_v3_OrcaLoadReport*)_upb_Message_New(&xds_data_orca_v3_OrcaLoadReport_msginit, arena);
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_data_orca_v3_OrcaLoadReport* ret = xds_data_orca_v3_OrcaLoadReport_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_data_orca_v3_OrcaLoadReport* ret = xds_data_orca_v3_OrcaLoadReport_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_data_orca_v3_OrcaLoadReport_serialize(const xds_data_orca_v3_OrcaLoadReport* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_data_orca_v3_OrcaLoadReport_serialize_ex(const xds_data_orca_v3_OrcaLoadReport* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, options, arena, len);
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_cpu_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double) = 0;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_cpu_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double);
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_mem_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = 0;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_mem_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double);
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_rps(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = 0;
+}
+UPB_INLINE uint64_t xds_data_orca_v3_OrcaLoadReport_rps(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t);
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_request_cost(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_request_cost(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_request_cost_size(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_get(const xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_next(const xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) {
+ return (const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_clear_utilization(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ _upb_array_detach(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_utilization_size(const xds_data_orca_v3_OrcaLoadReport* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(4, 8));
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_get(const xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double* val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_next(const xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) {
+ return (const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter);
+}
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_cpu_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), double) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_mem_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), double) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_rps(xds_data_orca_v3_OrcaLoadReport *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), uint64_t) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_request_cost_clear(xds_data_orca_v3_OrcaLoadReport* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_set(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_delete(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0);
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_nextmutable(xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) {
+ return (xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_utilization_clear(xds_data_orca_v3_OrcaLoadReport* msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_set(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key, double val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_delete(xds_data_orca_v3_OrcaLoadReport* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, 0);
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_nextmutable(xds_data_orca_v3_OrcaLoadReport* msg, size_t* iter) {
+ return (xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter);
+}
+
+/* xds.data.orca.v3.OrcaLoadReport.RequestCostEntry */
+
+UPB_INLINE upb_StringView xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_key(const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_value(const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_set_value(xds_data_orca_v3_OrcaLoadReport_RequestCostEntry *msg, double value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
+}
+
+/* xds.data.orca.v3.OrcaLoadReport.UtilizationEntry */
+
+UPB_INLINE upb_StringView xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_key(const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_value(const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_set_value(xds_data_orca_v3_OrcaLoadReport_UtilizationEntry *msg, double value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
+}
+
+extern const upb_MiniTable_File xds_data_orca_v3_orca_load_report_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c b/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c
new file mode 100644
index 00000000..cd2350cc
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c
@@ -0,0 +1,47 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/service/orca/v3/orca.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/service/orca/v3/orca.upb.h"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_service_orca_v3_OrcaLoadReportRequest_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_MiniTable_Field xds_service_orca_v3_OrcaLoadReportRequest__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit = {
+ &xds_service_orca_v3_OrcaLoadReportRequest_submsgs[0],
+ &xds_service_orca_v3_OrcaLoadReportRequest__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_service_orca_v3_OrcaLoadReportRequest_msginit,
+};
+
+const upb_MiniTable_File xds_service_orca_v3_orca_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h b/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h
new file mode 100644
index 00000000..53f348f2
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h
@@ -0,0 +1,109 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/service/orca/v3/orca.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_
+#define XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_service_orca_v3_OrcaLoadReportRequest;
+typedef struct xds_service_orca_v3_OrcaLoadReportRequest xds_service_orca_v3_OrcaLoadReportRequest;
+extern const upb_MiniTable xds_service_orca_v3_OrcaLoadReportRequest_msginit;
+struct google_protobuf_Duration;
+extern const upb_MiniTable google_protobuf_Duration_msginit;
+
+
+
+/* xds.service.orca.v3.OrcaLoadReportRequest */
+
+UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLoadReportRequest_new(upb_Arena* arena) {
+ return (xds_service_orca_v3_OrcaLoadReportRequest*)_upb_Message_New(&xds_service_orca_v3_OrcaLoadReportRequest_msginit, arena);
+}
+UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLoadReportRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_service_orca_v3_OrcaLoadReportRequest* ret = xds_service_orca_v3_OrcaLoadReportRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLoadReportRequest_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_service_orca_v3_OrcaLoadReportRequest* ret = xds_service_orca_v3_OrcaLoadReportRequest_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_service_orca_v3_OrcaLoadReportRequest_serialize(const xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_service_orca_v3_OrcaLoadReportRequest_serialize_ex(const xds_service_orca_v3_OrcaLoadReportRequest* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_has_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Duration* xds_service_orca_v3_OrcaLoadReportRequest_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*);
+}
+UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_clear_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg) {
+ _upb_array_detach(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE upb_StringView const* xds_service_orca_v3_OrcaLoadReportRequest_request_cost_names(const xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* len) {
+ return (upb_StringView const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len);
+}
+
+UPB_INLINE void xds_service_orca_v3_OrcaLoadReportRequest_set_report_interval(xds_service_orca_v3_OrcaLoadReportRequest *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* xds_service_orca_v3_OrcaLoadReportRequest_mutable_report_interval(xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_Arena* arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)xds_service_orca_v3_OrcaLoadReportRequest_report_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ xds_service_orca_v3_OrcaLoadReportRequest_set_report_interval(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_mutable_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t* len) {
+ return (upb_StringView*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_StringView* xds_service_orca_v3_OrcaLoadReportRequest_resize_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, size_t len, upb_Arena* arena) {
+ return (upb_StringView*)_upb_Array_Resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_add_request_cost_names(xds_service_orca_v3_OrcaLoadReportRequest* msg, upb_StringView val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val, arena);
+}
+
+extern const upb_MiniTable_File xds_service_orca_v3_orca_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_SERVICE_ORCA_V3_ORCA_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c
new file mode 100644
index 00000000..6696f4d7
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c
@@ -0,0 +1,207 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/type/matcher/v3/matcher.upb.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "xds/core/v3/extension.upb.h"
+#include "xds/type/matcher/v3/string.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_submsgs[3] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher__fields[3] = {
+ {1, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_msginit = {
+ &xds_type_matcher_v3_Matcher_submsgs[0],
+ &xds_type_matcher_v3_Matcher__fields[0],
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_OnMatch_submsgs[2] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_msginit},
+ {.submsg = &xds_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_OnMatch__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit = {
+ &xds_type_matcher_v3_Matcher_OnMatch_submsgs[0],
+ &xds_type_matcher_v3_Matcher_OnMatch__fields[0],
+ UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherList_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate__fields[4] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(4, 8), UPB_SIZE(-1, -1), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate__fields[0],
+ UPB_SIZE(8, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = {
+ {.submsg = &xds_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &xds_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &xds_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[3] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate__fields[0],
+ UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(2, 2), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher__fields[0],
+ UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_submsgs[4] = {
+ {.submsg = &xds_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit},
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit},
+ {.submsg = &xds_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree__fields[4] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 1, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 2, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {4, UPB_SIZE(12, 16), UPB_SIZE(-5, -5), 3, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherTree_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherTree__fields[0],
+ UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree_MatchMap__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_Matcher_OnMatch_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit = {
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[0],
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[10] = {
+ &xds_type_matcher_v3_Matcher_msginit,
+ &xds_type_matcher_v3_Matcher_OnMatch_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherList_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherTree_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit,
+ &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit,
+};
+
+const upb_MiniTable_File xds_type_matcher_v3_matcher_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 10,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h
new file mode 100644
index 00000000..9b7f673c
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h
@@ -0,0 +1,878 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_
+#define XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_type_matcher_v3_Matcher;
+struct xds_type_matcher_v3_Matcher_OnMatch;
+struct xds_type_matcher_v3_Matcher_MatcherList;
+struct xds_type_matcher_v3_Matcher_MatcherList_Predicate;
+struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate;
+struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList;
+struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher;
+struct xds_type_matcher_v3_Matcher_MatcherTree;
+struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap;
+struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry;
+typedef struct xds_type_matcher_v3_Matcher xds_type_matcher_v3_Matcher;
+typedef struct xds_type_matcher_v3_Matcher_OnMatch xds_type_matcher_v3_Matcher_OnMatch;
+typedef struct xds_type_matcher_v3_Matcher_MatcherList xds_type_matcher_v3_Matcher_MatcherList;
+typedef struct xds_type_matcher_v3_Matcher_MatcherList_Predicate xds_type_matcher_v3_Matcher_MatcherList_Predicate;
+typedef struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate;
+typedef struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList;
+typedef struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher;
+typedef struct xds_type_matcher_v3_Matcher_MatcherTree xds_type_matcher_v3_Matcher_MatcherTree;
+typedef struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap xds_type_matcher_v3_Matcher_MatcherTree_MatchMap;
+typedef struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_OnMatch_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_msginit;
+struct xds_core_v3_TypedExtensionConfig;
+struct xds_type_matcher_v3_StringMatcher;
+extern const upb_MiniTable xds_core_v3_TypedExtensionConfig_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit;
+
+
+
+/* xds.type.matcher.v3.Matcher */
+
+UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher* ret = xds_type_matcher_v3_Matcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher* ret = xds_type_matcher_v3_Matcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_serialize(const xds_type_matcher_v3_Matcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_serialize_ex(const xds_type_matcher_v3_Matcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_Matcher_matcher_type_matcher_list = 1,
+ xds_type_matcher_v3_Matcher_matcher_type_matcher_tree = 2,
+ xds_type_matcher_v3_Matcher_matcher_type_NOT_SET = 0
+} xds_type_matcher_v3_Matcher_matcher_type_oneofcases;
+UPB_INLINE xds_type_matcher_v3_Matcher_matcher_type_oneofcases xds_type_matcher_v3_Matcher_matcher_type_case(const xds_type_matcher_v3_Matcher* msg) {
+ return (xds_type_matcher_v3_Matcher_matcher_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_list(const xds_type_matcher_v3_Matcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_list(const xds_type_matcher_v3_Matcher* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_matcher_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_matcher_list(const xds_type_matcher_v3_Matcher* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_has_matcher_tree(const xds_type_matcher_v3_Matcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_clear_matcher_tree(const xds_type_matcher_v3_Matcher* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_matcher_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_matcher_tree(const xds_type_matcher_v3_Matcher* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_has_on_no_match(const xds_type_matcher_v3_Matcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_clear_on_no_match(const xds_type_matcher_v3_Matcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_on_no_match(const xds_type_matcher_v3_Matcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const xds_type_matcher_v3_Matcher_OnMatch*);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_set_matcher_list(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_MatcherList* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_mutable_matcher_list(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList*)xds_type_matcher_v3_Matcher_matcher_list(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_set_matcher_list(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_set_matcher_tree(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_MatcherTree* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_mutable_matcher_tree(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherTree* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree*)xds_type_matcher_v3_Matcher_matcher_tree(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_set_matcher_tree(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_set_on_no_match(xds_type_matcher_v3_Matcher *msg, xds_type_matcher_v3_Matcher_OnMatch* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), xds_type_matcher_v3_Matcher_OnMatch*) = value;
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_mutable_on_no_match(xds_type_matcher_v3_Matcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Matcher_on_no_match(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_set_on_no_match(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.OnMatch */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMatch_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMatch_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_OnMatch* ret = xds_type_matcher_v3_Matcher_OnMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMatch_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_OnMatch* ret = xds_type_matcher_v3_Matcher_OnMatch_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_OnMatch_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_OnMatch_serialize(const xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_OnMatch_serialize_ex(const xds_type_matcher_v3_Matcher_OnMatch* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_Matcher_OnMatch_on_match_matcher = 1,
+ xds_type_matcher_v3_Matcher_OnMatch_on_match_action = 2,
+ xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET = 0
+} xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases;
+UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases xds_type_matcher_v3_Matcher_OnMatch_on_match_case(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ return (xds_type_matcher_v3_Matcher_OnMatch_on_match_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_OnMatch_matcher(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_OnMatch_has_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_clear_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_OnMatch_on_match_NOT_SET);
+}
+UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_OnMatch_action(const xds_type_matcher_v3_Matcher_OnMatch* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_set_matcher(xds_type_matcher_v3_Matcher_OnMatch *msg, xds_type_matcher_v3_Matcher* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_OnMatch_mutable_matcher(xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher* sub = (struct xds_type_matcher_v3_Matcher*)xds_type_matcher_v3_Matcher_OnMatch_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_OnMatch_set_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_OnMatch_set_action(xds_type_matcher_v3_Matcher_OnMatch *msg, struct xds_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_OnMatch_mutable_action(xds_type_matcher_v3_Matcher_OnMatch* msg, upb_Arena* arena) {
+ struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_OnMatch_action(msg);
+ if (sub == NULL) {
+ sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_OnMatch_set_action(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherList */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_MatcherList_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_MatcherList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList* ret = xds_type_matcher_v3_Matcher_MatcherList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_MatcherList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList* ret = xds_type_matcher_v3_Matcher_MatcherList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_serialize(const xds_type_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_has_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_clear_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const* xds_type_matcher_v3_Matcher_MatcherList_matchers(const xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* len) {
+ return (const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_mutable_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t* len) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher** xds_type_matcher_v3_Matcher_MatcherList_resize_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, size_t len, upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_add_matchers(xds_type_matcher_v3_Matcher_MatcherList* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherList.Predicate */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_serialize(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_single_predicate = 1,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_or_matcher = 2,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_and_matcher = 3,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_not_matcher = 4,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET = 0
+} xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases;
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_case(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 3;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 3, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_has_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 4;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_clear_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(const xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 4, NULL);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_single_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_single_predicate(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_single_predicate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_or_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_or_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_or_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 3);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_and_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_and_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_and_matcher(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 4);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_mutable_not_matcher(xds_type_matcher_v3_Matcher_MatcherList_Predicate* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_not_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_set_not_matcher(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_serialize(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_value_match = 2,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_custom_match = 3,
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET = 0
+} xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases;
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_case(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct xds_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET);
+}
+UPB_INLINE const struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_clear_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_NOT_SET);
+}
+UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct xds_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_input(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_input(msg);
+ if (sub == NULL) {
+ sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_input(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_value_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_StringMatcher* sub = (struct xds_type_matcher_v3_StringMatcher*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_value_match(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_value_match(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate *msg, struct xds_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_mutable_custom_match(xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* msg, upb_Arena* arena) {
+ struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_custom_match(msg);
+ if (sub == NULL) {
+ sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_set_custom_match(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherList.Predicate.PredicateList */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* ret = xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_serialize(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_has_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_clear_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_predicate(const xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) {
+ return (const xds_type_matcher_v3_Matcher_MatcherList_Predicate* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_mutable_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t* len) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate** xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_resize_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, size_t len, upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_Predicate**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_add_predicate(xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherList.FieldMatcher */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* ret = xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_serialize(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_has_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const xds_type_matcher_v3_Matcher_MatcherList_Predicate*);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_has_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return _upb_hasbit(msg, 2);
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_clear_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(const xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const xds_type_matcher_v3_Matcher_OnMatch*);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, xds_type_matcher_v3_Matcher_MatcherList_Predicate* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), xds_type_matcher_v3_Matcher_MatcherList_Predicate*) = value;
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_predicate(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherList_Predicate* sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_predicate(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherList_Predicate*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_predicate(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher *msg, xds_type_matcher_v3_Matcher_OnMatch* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), xds_type_matcher_v3_Matcher_OnMatch*) = value;
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_mutable_on_match(xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_OnMatch* sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_on_match(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_OnMatch*)_upb_Message_New(&xds_type_matcher_v3_Matcher_OnMatch_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_set_on_match(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherTree */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_MatcherTree_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherTree*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_MatcherTree_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherTree* ret = xds_type_matcher_v3_Matcher_MatcherTree_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_MatcherTree_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherTree* ret = xds_type_matcher_v3_Matcher_MatcherTree_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherTree_serialize(const xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherTree_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherTree* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_Matcher_MatcherTree_tree_type_exact_match_map = 2,
+ xds_type_matcher_v3_Matcher_MatcherTree_tree_type_prefix_match_map = 3,
+ xds_type_matcher_v3_Matcher_MatcherTree_tree_type_custom_match = 4,
+ xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET = 0
+} xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases;
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases xds_type_matcher_v3_Matcher_MatcherTree_tree_type_case(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return (xds_type_matcher_v3_Matcher_MatcherTree_tree_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_input(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct xds_core_v3_TypedExtensionConfig*);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_exact_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 2, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_prefix_match_map(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_has_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 4;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_clear_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_Matcher_MatcherTree_tree_type_NOT_SET);
+}
+UPB_INLINE const struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_custom_match(const xds_type_matcher_v3_Matcher_MatcherTree* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 4, NULL);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_input(xds_type_matcher_v3_Matcher_MatcherTree *msg, struct xds_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct xds_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_mutable_input(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherTree_input(msg);
+ if (sub == NULL) {
+ sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherTree_set_input(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_exact_match_map(xds_type_matcher_v3_Matcher_MatcherTree *msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_mutable_exact_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)xds_type_matcher_v3_Matcher_MatcherTree_exact_match_map(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherTree_set_exact_match_map(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(xds_type_matcher_v3_Matcher_MatcherTree *msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_mutable_prefix_match_map(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)xds_type_matcher_v3_Matcher_MatcherTree_prefix_match_map(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherTree_set_prefix_match_map(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_set_custom_match(xds_type_matcher_v3_Matcher_MatcherTree *msg, struct xds_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct xds_core_v3_TypedExtensionConfig*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 4);
+}
+UPB_INLINE struct xds_core_v3_TypedExtensionConfig* xds_type_matcher_v3_Matcher_MatcherTree_mutable_custom_match(xds_type_matcher_v3_Matcher_MatcherTree* msg, upb_Arena* arena) {
+ struct xds_core_v3_TypedExtensionConfig* sub = (struct xds_core_v3_TypedExtensionConfig*)xds_type_matcher_v3_Matcher_MatcherTree_custom_match(msg);
+ if (sub == NULL) {
+ sub = (struct xds_core_v3_TypedExtensionConfig*)_upb_Message_New(&xds_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_Matcher_MatcherTree_set_custom_match(msg, sub);
+ }
+ return sub;
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherTree.MatchMap */
+
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap*)_upb_Message_New(&xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret = xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* ret = xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_serialize(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_serialize_ex(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_has_map(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_clear_map(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE size_t xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_size(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) {
+ return _upb_msg_map_size(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_get(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, xds_type_matcher_v3_Matcher_OnMatch** val) {
+ return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val));
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_next(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) {
+ return (const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_clear(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_set(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key, xds_type_matcher_v3_Matcher_OnMatch* val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a);
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_delete(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, upb_StringView key) {
+ return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0);
+}
+UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_map_nextmutable(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* msg, size_t* iter) {
+ return (xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter);
+}
+
+/* xds.type.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry */
+
+UPB_INLINE upb_StringView xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_key(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ upb_StringView ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_has_value(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16));
+}
+UPB_INLINE const xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_value(const xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry* msg) {
+ xds_type_matcher_v3_Matcher_OnMatch* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_set_value(xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry *msg, xds_type_matcher_v3_Matcher_OnMatch* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(xds_type_matcher_v3_Matcher_OnMatch*));
+}
+
+extern const upb_MiniTable_File xds_type_matcher_v3_matcher_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c
new file mode 100644
index 00000000..45a111f0
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/type/matcher/v3/regex.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_RegexMatcher_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_RegexMatcher__fields[2] = {
+ {1, UPB_SIZE(12, 24), UPB_SIZE(-1, -1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit = {
+ &xds_type_matcher_v3_RegexMatcher_submsgs[0],
+ &xds_type_matcher_v3_RegexMatcher__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &xds_type_matcher_v3_RegexMatcher_msginit,
+ &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+};
+
+const upb_MiniTable_File xds_type_matcher_v3_regex_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h
new file mode 100644
index 00000000..77456aa3
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h
@@ -0,0 +1,143 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
+#define XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_type_matcher_v3_RegexMatcher;
+struct xds_type_matcher_v3_RegexMatcher_GoogleRE2;
+typedef struct xds_type_matcher_v3_RegexMatcher xds_type_matcher_v3_RegexMatcher;
+typedef struct xds_type_matcher_v3_RegexMatcher_GoogleRE2 xds_type_matcher_v3_RegexMatcher_GoogleRE2;
+extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
+
+
+
+/* xds.type.matcher.v3.RegexMatcher */
+
+UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_RegexMatcher* ret = xds_type_matcher_v3_RegexMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_RegexMatcher* ret = xds_type_matcher_v3_RegexMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_serialize(const xds_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_serialize_ex(const xds_type_matcher_v3_RegexMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1,
+ xds_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0
+} xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases;
+UPB_INLINE xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases xds_type_matcher_v3_RegexMatcher_engine_type_case(const xds_type_matcher_v3_RegexMatcher* msg) {
+ return (xds_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_RegexMatcher_has_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
+}
+UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), 0, UPB_SIZE(0, 0), xds_type_matcher_v3_RegexMatcher_engine_type_NOT_SET);
+}
+UPB_INLINE const xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_google_re2(const xds_type_matcher_v3_RegexMatcher* msg) {
+ return UPB_READ_ONEOF(msg, const xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), UPB_SIZE(0, 0), 1, NULL);
+}
+UPB_INLINE void xds_type_matcher_v3_RegexMatcher_clear_regex(const xds_type_matcher_v3_RegexMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_type_matcher_v3_RegexMatcher_regex(const xds_type_matcher_v3_RegexMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+
+UPB_INLINE void xds_type_matcher_v3_RegexMatcher_set_google_re2(xds_type_matcher_v3_RegexMatcher *msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2* value) {
+ UPB_WRITE_ONEOF(msg, xds_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(12, 24), value, UPB_SIZE(0, 0), 1);
+}
+UPB_INLINE struct xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_mutable_google_re2(xds_type_matcher_v3_RegexMatcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct xds_type_matcher_v3_RegexMatcher_GoogleRE2*)xds_type_matcher_v3_RegexMatcher_google_re2(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_RegexMatcher_set_regex(xds_type_matcher_v3_RegexMatcher *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+
+/* xds.type.matcher.v3.RegexMatcher.GoogleRE2 */
+
+UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_RegexMatcher_GoogleRE2* ret = xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_RegexMatcher_GoogleRE2* ret = xds_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const xds_type_matcher_v3_RegexMatcher_GoogleRE2* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_RegexMatcher_GoogleRE2_serialize_ex(const xds_type_matcher_v3_RegexMatcher_GoogleRE2* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, len);
+}
+
+
+extern const upb_MiniTable_File xds_type_matcher_v3_regex_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c
new file mode 100644
index 00000000..207adefc
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c
@@ -0,0 +1,65 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/type/matcher/v3/string.upb.h"
+#include "xds/type/matcher/v3/regex.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_StringMatcher_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_RegexMatcher_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_StringMatcher__fields[6] = {
+ {1, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(0, 0), kUpb_NoSub, 8, kUpb_FieldMode_Scalar | (kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-5, -5), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit = {
+ &xds_type_matcher_v3_StringMatcher_submsgs[0],
+ &xds_type_matcher_v3_StringMatcher__fields[0],
+ UPB_SIZE(16, 24), 6, kUpb_ExtMode_NonExtendable, 3, 255, 0,
+};
+
+static const upb_MiniTable_Sub xds_type_matcher_v3_ListStringMatcher_submsgs[1] = {
+ {.submsg = &xds_type_matcher_v3_StringMatcher_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_matcher_v3_ListStringMatcher__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(0, 0), 0, 11, kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msginit = {
+ &xds_type_matcher_v3_ListStringMatcher_submsgs[0],
+ &xds_type_matcher_v3_ListStringMatcher__fields[0],
+ UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[2] = {
+ &xds_type_matcher_v3_StringMatcher_msginit,
+ &xds_type_matcher_v3_ListStringMatcher_msginit,
+};
+
+const upb_MiniTable_File xds_type_matcher_v3_string_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 2,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h
new file mode 100644
index 00000000..375fdcd9
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h
@@ -0,0 +1,218 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
+#define XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_type_matcher_v3_StringMatcher;
+struct xds_type_matcher_v3_ListStringMatcher;
+typedef struct xds_type_matcher_v3_StringMatcher xds_type_matcher_v3_StringMatcher;
+typedef struct xds_type_matcher_v3_ListStringMatcher xds_type_matcher_v3_ListStringMatcher;
+extern const upb_MiniTable xds_type_matcher_v3_StringMatcher_msginit;
+extern const upb_MiniTable xds_type_matcher_v3_ListStringMatcher_msginit;
+struct xds_type_matcher_v3_RegexMatcher;
+extern const upb_MiniTable xds_type_matcher_v3_RegexMatcher_msginit;
+
+
+
+/* xds.type.matcher.v3.StringMatcher */
+
+UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_StringMatcher* ret = xds_type_matcher_v3_StringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_StringMatcher* ret = xds_type_matcher_v3_StringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_StringMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_StringMatcher_serialize(const xds_type_matcher_v3_StringMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_StringMatcher_serialize_ex(const xds_type_matcher_v3_StringMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, options, arena, len);
+}
+typedef enum {
+ xds_type_matcher_v3_StringMatcher_match_pattern_exact = 1,
+ xds_type_matcher_v3_StringMatcher_match_pattern_prefix = 2,
+ xds_type_matcher_v3_StringMatcher_match_pattern_suffix = 3,
+ xds_type_matcher_v3_StringMatcher_match_pattern_safe_regex = 5,
+ xds_type_matcher_v3_StringMatcher_match_pattern_contains = 7,
+ xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET = 0
+} xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases;
+UPB_INLINE xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases xds_type_matcher_v3_StringMatcher_match_pattern_case(const xds_type_matcher_v3_StringMatcher* msg) {
+ return (xds_type_matcher_v3_StringMatcher_match_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_exact(const xds_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_exact(const xds_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_exact(const xds_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 1, upb_StringView_FromString(""));
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_prefix(const xds_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 2;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_prefix(const xds_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_prefix(const xds_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 2, upb_StringView_FromString(""));
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_suffix(const xds_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_suffix(const xds_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_suffix(const xds_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 3, upb_StringView_FromString(""));
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), 0, UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE const struct xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_StringMatcher_safe_regex(const xds_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, const struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 5, NULL);
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_ignore_case(const xds_type_matcher_v3_StringMatcher* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0;
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_ignore_case(const xds_type_matcher_v3_StringMatcher* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool);
+}
+UPB_INLINE bool xds_type_matcher_v3_StringMatcher_has_contains(const xds_type_matcher_v3_StringMatcher* msg) {
+ return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 7;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_clear_contains(const xds_type_matcher_v3_StringMatcher* msg) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), upb_StringView_FromDataAndSize(NULL, 0), UPB_SIZE(4, 4), xds_type_matcher_v3_StringMatcher_match_pattern_NOT_SET);
+}
+UPB_INLINE upb_StringView xds_type_matcher_v3_StringMatcher_contains(const xds_type_matcher_v3_StringMatcher* msg) {
+ return UPB_READ_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), UPB_SIZE(4, 4), 7, upb_StringView_FromString(""));
+}
+
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_exact(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 1);
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_prefix(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 2);
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_suffix(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 3);
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_safe_regex(xds_type_matcher_v3_StringMatcher *msg, struct xds_type_matcher_v3_RegexMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct xds_type_matcher_v3_RegexMatcher*, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 5);
+}
+UPB_INLINE struct xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_StringMatcher_mutable_safe_regex(xds_type_matcher_v3_StringMatcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_RegexMatcher* sub = (struct xds_type_matcher_v3_RegexMatcher*)xds_type_matcher_v3_StringMatcher_safe_regex(msg);
+ if (sub == NULL) {
+ sub = (struct xds_type_matcher_v3_RegexMatcher*)_upb_Message_New(&xds_type_matcher_v3_RegexMatcher_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_matcher_v3_StringMatcher_set_safe_regex(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_ignore_case(xds_type_matcher_v3_StringMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void xds_type_matcher_v3_StringMatcher_set_contains(xds_type_matcher_v3_StringMatcher *msg, upb_StringView value) {
+ UPB_WRITE_ONEOF(msg, upb_StringView, UPB_SIZE(8, 8), value, UPB_SIZE(4, 4), 7);
+}
+
+/* xds.type.matcher.v3.ListStringMatcher */
+
+UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListStringMatcher_new(upb_Arena* arena) {
+ return (xds_type_matcher_v3_ListStringMatcher*)_upb_Message_New(&xds_type_matcher_v3_ListStringMatcher_msginit, arena);
+}
+UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListStringMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_matcher_v3_ListStringMatcher* ret = xds_type_matcher_v3_ListStringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListStringMatcher_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_matcher_v3_ListStringMatcher* ret = xds_type_matcher_v3_ListStringMatcher_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_ListStringMatcher_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_matcher_v3_ListStringMatcher_serialize(const xds_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_matcher_v3_ListStringMatcher_serialize_ex(const xds_type_matcher_v3_ListStringMatcher* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, options, arena, len);
+}
+UPB_INLINE bool xds_type_matcher_v3_ListStringMatcher_has_patterns(const xds_type_matcher_v3_ListStringMatcher* msg) {
+ return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE void xds_type_matcher_v3_ListStringMatcher_clear_patterns(const xds_type_matcher_v3_ListStringMatcher* msg) {
+ _upb_array_detach(msg, UPB_SIZE(0, 0));
+}
+UPB_INLINE const xds_type_matcher_v3_StringMatcher* const* xds_type_matcher_v3_ListStringMatcher_patterns(const xds_type_matcher_v3_ListStringMatcher* msg, size_t* len) {
+ return (const xds_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len);
+}
+
+UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_mutable_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t* len) {
+ return (xds_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE xds_type_matcher_v3_StringMatcher** xds_type_matcher_v3_ListStringMatcher_resize_patterns(xds_type_matcher_v3_ListStringMatcher* msg, size_t len, upb_Arena* arena) {
+ return (xds_type_matcher_v3_StringMatcher**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_ListStringMatcher_add_patterns(xds_type_matcher_v3_ListStringMatcher* msg, upb_Arena* arena) {
+ struct xds_type_matcher_v3_StringMatcher* sub = (struct xds_type_matcher_v3_StringMatcher*)_upb_Message_New(&xds_type_matcher_v3_StringMatcher_msginit, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+extern const upb_MiniTable_File xds_type_matcher_v3_string_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c b/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
new file mode 100644
index 00000000..5a1335e8
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/type/v3/typed_struct.upb.h"
+#include "validate/validate.upb.h"
+#include "google/protobuf/struct.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_MiniTable_Sub xds_type_v3_TypedStruct_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+};
+
+static const upb_MiniTable_Field xds_type_v3_TypedStruct__fields[2] = {
+ {1, UPB_SIZE(4, 8), UPB_SIZE(0, 0), kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(1, 1), 0, 11, kUpb_FieldMode_Scalar | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift)},
+};
+
+const upb_MiniTable xds_type_v3_TypedStruct_msginit = {
+ &xds_type_v3_TypedStruct_submsgs[0],
+ &xds_type_v3_TypedStruct__fields[0],
+ UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0,
+};
+
+static const upb_MiniTable *messages_layout[1] = {
+ &xds_type_v3_TypedStruct_msginit,
+};
+
+const upb_MiniTable_File xds_type_v3_typed_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ NULL,
+ 1,
+ 0,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h b/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h
new file mode 100644
index 00000000..2a0ceed6
--- /dev/null
+++ b/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h
@@ -0,0 +1,103 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_
+#define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_type_v3_TypedStruct;
+typedef struct xds_type_v3_TypedStruct xds_type_v3_TypedStruct;
+extern const upb_MiniTable xds_type_v3_TypedStruct_msginit;
+struct google_protobuf_Struct;
+extern const upb_MiniTable google_protobuf_Struct_msginit;
+
+
+
+/* xds.type.v3.TypedStruct */
+
+UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_new(upb_Arena* arena) {
+ return (xds_type_v3_TypedStruct*)_upb_Message_New(&xds_type_v3_TypedStruct_msginit, arena);
+}
+UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse(const char* buf, size_t size, upb_Arena* arena) {
+ xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char* xds_type_v3_TypedStruct_serialize(const xds_type_v3_TypedStruct* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, 0, arena, len);
+}
+UPB_INLINE char* xds_type_v3_TypedStruct_serialize_ex(const xds_type_v3_TypedStruct* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, options, arena, len);
+}
+UPB_INLINE void xds_type_v3_TypedStruct_clear_type_url(const xds_type_v3_TypedStruct* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0);
+}
+UPB_INLINE upb_StringView xds_type_v3_TypedStruct_type_url(const xds_type_v3_TypedStruct* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView);
+}
+UPB_INLINE bool xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct* msg) {
+ return _upb_hasbit(msg, 1);
+}
+UPB_INLINE void xds_type_v3_TypedStruct_clear_value(const xds_type_v3_TypedStruct* msg) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const upb_Message*) = NULL;
+}
+UPB_INLINE const struct google_protobuf_Struct* xds_type_v3_TypedStruct_value(const xds_type_v3_TypedStruct* msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*);
+}
+
+UPB_INLINE void xds_type_v3_TypedStruct_set_type_url(xds_type_v3_TypedStruct *msg, upb_StringView value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value;
+}
+UPB_INLINE void xds_type_v3_TypedStruct_set_value(xds_type_v3_TypedStruct *msg, struct google_protobuf_Struct* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* xds_type_v3_TypedStruct_mutable_value(xds_type_v3_TypedStruct* msg, upb_Arena* arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)xds_type_v3_TypedStruct_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_Message_New(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_v3_TypedStruct_set_value(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_MiniTable_File xds_type_v3_typed_struct_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c
new file mode 100644
index 00000000..2a6e09ee
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c
@@ -0,0 +1,84 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/certs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/certs.upbdefs.h"
+#include "envoy/admin/v3/certs.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[1336] = {'\n', '\032', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'c', 'e', 'r', 't', 's', '.', 'p', 'r',
+'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\037', 'g', 'o', 'o', 'g',
+'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', 'x', '\n', '\014', 'C', 'e', 'r',
+'t', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\022', '?', '\n', '\014', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's',
+'\030', '\001', ' ', '\003', '(', '\013', '2', '\033', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', '\014', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', ':',
+'\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p',
+'h', 'a', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\"', '\265', '\001', '\n', '\013', 'C', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', '\022', ';', '\n', '\007', 'c', 'a', '_', 'c', 'e', 'r', 't', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
+'t', 'e', 'D', 'e', 't', 'a', 'i', 'l', 's', 'R', '\006', 'c', 'a', 'C', 'e', 'r', 't', '\022', 'A', '\n', '\n', 'c', 'e', 'r', 't',
+'_', 'c', 'h', 'a', 'i', 'n', '\030', '\002', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i',
+'n', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'D', 'e', 't', 'a', 'i', 'l', 's', 'R', '\t',
+'c', 'e', 'r', 't', 'C', 'h', 'a', 'i', 'n', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'d', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\"',
+'\334', '\004', '\n', '\022', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\022', '\n',
+'\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'p', 'a', 't', 'h', '\022', '#', '\n', '\r', 's', 'e', 'r', 'i',
+'a', 'l', '_', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'e', 'r', 'i', 'a', 'l', 'N', 'u',
+'m', 'b', 'e', 'r', '\022', 'P', '\n', '\021', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 's',
+'\030', '\003', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'S',
+'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'N', 'a', 'm', 'e', 'R', '\017', 's', 'u', 'b', 'j',
+'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 's', '\022', '2', '\n', '\025', 'd', 'a', 'y', 's', '_', 'u', 'n', 't', 'i', 'l',
+'_', 'e', 'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\023', 'd', 'a', 'y', 's', 'U', 'n',
+'t', 'i', 'l', 'E', 'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', '\022', '9', '\n', '\n', 'v', 'a', 'l', 'i', 'd', '_', 'f', 'r',
+'o', 'm', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\t', 'v', 'a', 'l', 'i', 'd', 'F', 'r', 'o', 'm', '\022', 'C', '\n',
+'\017', 'e', 'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
+'R', '\016', 'e', 'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', 'T', 'i', 'm', 'e', '\022', 'Q', '\n', '\014', 'o', 'c', 's', 'p', '_',
+'d', 'e', 't', 'a', 'i', 'l', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm',
+'i', 'n', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'D', 'e', 't', 'a', 'i', 'l', 's', '.',
+'O', 'c', 's', 'p', 'D', 'e', 't', 'a', 'i', 'l', 's', 'R', '\013', 'o', 'c', 's', 'p', 'D', 'e', 't', 'a', 'i', 'l', 's', '\032',
+'\204', '\001', '\n', '\013', 'O', 'c', 's', 'p', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '9', '\n', '\n', 'v', 'a', 'l', 'i', 'd', '_',
+'f', 'r', 'o', 'm', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\t', 'v', 'a', 'l', 'i', 'd', 'F', 'r', 'o', 'm', '\022',
+':', '\n', '\n', 'e', 'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\n', 'e',
+'x', 'p', 'i', 'r', 'a', 't', 'i', 'o', 'n', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'d', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'D',
+'e', 't', 'a', 'i', 'l', 's', '\"', '\230', '\001', '\n', '\024', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'e', 'r', 'n', 'a',
+'t', 'e', 'N', 'a', 'm', 'e', '\022', '\022', '\n', '\003', 'd', 'n', 's', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\003', 'd', 'n',
+'s', '\022', '\022', '\n', '\003', 'u', 'r', 'i', '\030', '\002', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\003', 'u', 'r', 'i', '\022', '\037', '\n', '\n',
+'i', 'p', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\003', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\t', 'i', 'p', 'A', 'd', 'd',
+'r', 'e', 's', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.',
+'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'N',
+'a', 'm', 'e', 'B', '\006', '\n', '\004', 'n', 'a', 'm', 'e', 'B', 's', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\n', 'C', 'e', 'r', 't', 's',
+'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n',
+'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &google_protobuf_timestamp_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_certs_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_certs_proto_upb_file_layout,
+ "envoy/admin/v3/certs.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1336)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h
new file mode 100644
index 00000000..a00cc0ec
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h
@@ -0,0 +1,55 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/certs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_certs_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_Certificates_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_certs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.Certificates");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_Certificate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_certs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.Certificate");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_CertificateDetails_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_certs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.CertificateDetails");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_CertificateDetails_OcspDetails_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_certs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.CertificateDetails.OcspDetails");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_SubjectAlternateName_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_certs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.SubjectAlternateName");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_CERTS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c
new file mode 100644
index 00000000..643bde21
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c
@@ -0,0 +1,127 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/clusters.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/clusters.upbdefs.h"
+#include "envoy/admin/v3/clusters.upb.h"
+
+extern _upb_DefPool_Init envoy_admin_v3_metrics_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[2157] = {'\n', '\035', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\034', 'e',
+'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/',
+'v', '3', '/', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd',
+'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
+'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h',
+'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/',
+'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p',
+'r', 'o', 't', 'o', '\"', 'y', '\n', '\010', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'H', '\n', '\020', 'c', 'l', 'u', 's', 't',
+'e', 'r', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', 'R', '\017',
+'c', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', 'e', 's', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'l', 'u', 's', 't', 'e',
+'r', 's', '\"', '\214', '\004', '\n', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\004', 'n',
+'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\"', '\n', '\r', 'a', 'd', 'd', 'e', 'd', '_',
+'v', 'i', 'a', '_', 'a', 'p', 'i', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\013', 'a', 'd', 'd', 'e', 'd', 'V', 'i', 'a', 'A', 'p',
+'i', '\022', ']', '\n', '\037', 's', 'u', 'c', 'c', 'e', 's', 's', '_', 'r', 'a', 't', 'e', '_', 'e', 'j', 'e', 'c', 't', 'i', 'o',
+'n', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\034', 's', 'u', 'c', 'c', 'e', 's', 's',
+'R', 'a', 't', 'e', 'E', 'j', 'e', 'c', 't', 'i', 'o', 'n', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\022', '?', '\n', '\r',
+'h', 'o', 's', 't', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '\032', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'H', 'o', 's', 't', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'h',
+'o', 's', 't', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'u', '\n', ',', 'l', 'o', 'c', 'a', 'l', '_', 'o', 'r', 'i', 'g',
+'i', 'n', '_', 's', 'u', 'c', 'c', 'e', 's', 's', '_', 'r', 'a', 't', 'e', '_', 'e', 'j', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'t', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\'', 'l', 'o', 'c', 'a', 'l', 'O', 'r', 'i', 'g',
+'i', 'n', 'S', 'u', 'c', 'c', 'e', 's', 's', 'R', 'a', 't', 'e', 'E', 'j', 'e', 'c', 't', 'i', 'o', 'n', 'T', 'h', 'r', 'e',
+'s', 'h', 'o', 'l', 'd', '\022', 'S', '\n', '\020', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', 's',
+'\030', '\006', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', 'R', '\017',
+'c', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\022', '-', '\n', '\022', 'o', 'b', 's', 'e', 'r', 'v',
+'a', 'b', 'i', 'l', 'i', 't', 'y', '_', 'n', 'a', 'm', 'e', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\021', 'o', 'b', 's', 'e', 'r',
+'v', 'a', 'b', 'i', 'l', 'i', 't', 'y', 'N', 'a', 'm', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't',
+'a', 't', 'u', 's', '\"', '\201', '\004', '\n', '\n', 'H', 'o', 's', 't', 'S', 't', 'a', 't', 'u', 's', '\022', '7', '\n', '\007', 'a', 'd',
+'d', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's',
+'s', '\022', '2', '\n', '\005', 's', 't', 'a', 't', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\034', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'S', 'i', 'm', 'p', 'l', 'e', 'M', 'e', 't', 'r', 'i', 'c', 'R', '\005', 's', 't',
+'a', 't', 's', '\022', 'E', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\003', ' ', '\001', '(',
+'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'H', 'o', 's', 't', 'H', 'e',
+'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022',
+'9', '\n', '\014', 's', 'u', 'c', 'c', 'e', 's', 's', '_', 'r', 'a', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\026', '.', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\013', 's', 'u', 'c',
+'c', 'e', 's', 's', 'R', 'a', 't', 'e', '\022', '\026', '\n', '\006', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\005', ' ', '\001', '(', '\r', 'R',
+'\006', 'w', 'e', 'i', 'g', 'h', 't', '\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t',
+'R', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\007', ' ',
+'\001', '(', '\r', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'Q', '\n', '\031', 'l', 'o', 'c', 'a', 'l', '_', 'o', 'r',
+'i', 'g', 'i', 'n', '_', 's', 'u', 'c', 'c', 'e', 's', 's', '_', 'r', 'a', 't', 'e', '\030', '\010', ' ', '\001', '(', '\013', '2', '\026',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\026', 'l',
+'o', 'c', 'a', 'l', 'O', 'r', 'i', 'g', 'i', 'n', 'S', 'u', 'c', 'c', 'e', 's', 's', 'R', 'a', 't', 'e', '\022', ':', '\n', '\010',
+'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\t', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o',
+'c', 'a', 'l', 'i', 't', 'y', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i',
+'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'H', 'o', 's', 't', 'S', 't', 'a', 't', 'u', 's', '\"', '\223', '\004', '\n', '\020',
+'H', 'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', ';', '\n', '\032', 'f', 'a', 'i', 'l', 'e',
+'d', '_', 'a', 'c', 't', 'i', 'v', 'e', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\001', ' ', '\001',
+'(', '\010', 'R', '\027', 'f', 'a', 'i', 'l', 'e', 'd', 'A', 'c', 't', 'i', 'v', 'e', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
+'c', 'k', '\022', '0', '\n', '\024', 'f', 'a', 'i', 'l', 'e', 'd', '_', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'c', 'h', 'e', 'c',
+'k', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\022', 'f', 'a', 'i', 'l', 'e', 'd', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'C', 'h', 'e',
+'c', 'k', '\022', '?', '\n', '\034', 'f', 'a', 'i', 'l', 'e', 'd', '_', 'a', 'c', 't', 'i', 'v', 'e', '_', 'd', 'e', 'g', 'r', 'a',
+'d', 'e', 'd', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\031', 'f', 'a', 'i', 'l', 'e', 'd', 'A', 'c',
+'t', 'i', 'v', 'e', 'D', 'e', 'g', 'r', 'a', 'd', 'e', 'd', 'C', 'h', 'e', 'c', 'k', '\022', '6', '\n', '\027', 'p', 'e', 'n', 'd',
+'i', 'n', 'g', '_', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r', 'e', 'm', 'o', 'v', 'a', 'l', '\030', '\005', ' ', '\001', '(', '\010',
+'R', '\025', 'p', 'e', 'n', 'd', 'i', 'n', 'g', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 'm', 'o', 'v', 'a', 'l', '\022', '*',
+'\n', '\021', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '_', 'a', 'c', 't', 'i', 'v', 'e', '_', 'h', 'c', '\030', '\006', ' ', '\001', '(', '\010',
+'R', '\017', 'p', 'e', 'n', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'v', 'e', 'H', 'c', '\022', 'B', '\n', '\036', 'e', 'x', 'c', 'l',
+'u', 'd', 'e', 'd', '_', 'v', 'i', 'a', '_', 'i', 'm', 'm', 'e', 'd', 'i', 'a', 't', 'e', '_', 'h', 'c', '_', 'f', 'a', 'i',
+'l', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\032', 'e', 'x', 'c', 'l', 'u', 'd', 'e', 'd', 'V', 'i', 'a', 'I', 'm', 'm', 'e', 'd',
+'i', 'a', 't', 'e', 'H', 'c', 'F', 'a', 'i', 'l', '\022', '*', '\n', '\021', 'a', 'c', 't', 'i', 'v', 'e', '_', 'h', 'c', '_', 't',
+'i', 'm', 'e', 'o', 'u', 't', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\017', 'a', 'c', 't', 'i', 'v', 'e', 'H', 'c', 'T', 'i', 'm',
+'e', 'o', 'u', 't', '\022', 'N', '\n', '\021', 'e', 'd', 's', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 's', 't', 'a', 't', 'u', 's',
+'\030', '\003', ' ', '\001', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'R', '\017', 'e', 'd', 's', 'H', 'e', 'a',
+'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'d', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'H', 'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't',
+'a', 't', 'u', 's', 'B', 'v', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[9] = {
+ &envoy_admin_v3_metrics_proto_upbdefinit,
+ &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit,
+ &envoy_config_core_v3_address_proto_upbdefinit,
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_health_check_proto_upbdefinit,
+ &envoy_type_v3_percent_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_clusters_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_clusters_proto_upb_file_layout,
+ "envoy/admin/v3/clusters.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 2157)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h
new file mode 100644
index 00000000..ba8fe80d
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/clusters.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_clusters_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_Clusters_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_clusters_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.Clusters");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ClusterStatus_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_clusters_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ClusterStatus");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_HostStatus_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_clusters_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.HostStatus");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_HostHealthStatus_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_clusters_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.HostHealthStatus");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_CLUSTERS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
index 8418d1e9..e44d929d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
@@ -8,61 +8,14 @@
#include "upb/def.h"
#include "envoy/admin/v3/config_dump.upbdefs.h"
+#include "envoy/admin/v3/config_dump.upb.h"
-extern upb_def_init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_admin_v3_ConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit;
-extern const upb_msglayout envoy_admin_v3_BootstrapConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_StaticListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit;
-
-static const upb_msglayout *layouts[22] = {
- &envoy_admin_v3_ConfigDump_msginit,
- &envoy_admin_v3_UpdateFailureState_msginit,
- &envoy_admin_v3_BootstrapConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
- &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
- &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
- &envoy_admin_v3_ClustersConfigDump_msginit,
- &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
- &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
- &envoy_admin_v3_RoutesConfigDump_msginit,
- &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
- &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
- &envoy_admin_v3_SecretsConfigDump_msginit,
- &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
- &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
- &envoy_admin_v3_EndpointsConfigDump_msginit,
- &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
- &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
-};
-
-static const char descriptor[6802] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd',
+extern _upb_DefPool_Init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[6865] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd',
'u', 'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
'\032', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
'v', '3', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l',
@@ -331,13 +284,15 @@ static const char descriptor[6802] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', '
'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N',
'\020', '\000', '\022', '\r', '\n', '\t', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', 'E', 'D', '\020', '\001', '\022', '\022', '\n', '\016', 'D', 'O', 'E', 'S',
'_', 'N', 'O', 'T', '_', 'E', 'X', 'I', 'S', 'T', '\020', '\002', '\022', '\t', '\n', '\005', 'A', 'C', 'K', 'E', 'D', '\020', '\003', '\022', '\n',
-'\n', '\006', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\004', 'B', '9', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'\n', '\006', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\004', 'B', 'x', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\017', 'C', 'o', 'n', 'f', 'i', 'g',
-'D', 'u', 'm', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
-'o', '3',
+'D', 'u', 'm', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n',
+'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_timestamp_proto_upbdefinit,
@@ -346,9 +301,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_admin_v3_config_dump_proto_upbdefinit = {
+_upb_DefPool_Init envoy_admin_v3_config_dump_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_admin_v3_config_dump_proto_upb_file_layout,
"envoy/admin/v3/config_dump.proto",
- UPB_STRVIEW_INIT(descriptor, 6802)
+ UPB_STRINGVIEW_INIT(descriptor, 6865)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h
index 8e62d4e4..48e15c88 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h
@@ -19,116 +19,116 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_admin_v3_config_dump_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_admin_v3_config_dump_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_UpdateFailureState_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.UpdateFailureState");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_UpdateFailureState_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.UpdateFailureState");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_BootstrapConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.BootstrapConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_BootstrapConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.BootstrapConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ListenersConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ListenersConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenersConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ListenersConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ListenersConfigDump_StaticListener_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ListenersConfigDump.StaticListener");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenersConfigDump_StaticListener_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ListenersConfigDump.StaticListener");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ListenersConfigDump.DynamicListenerState");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ListenersConfigDump.DynamicListenerState");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ListenersConfigDump_DynamicListener_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ListenersConfigDump.DynamicListener");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenersConfigDump_DynamicListener_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ListenersConfigDump.DynamicListener");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ClustersConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ClustersConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ClustersConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ClustersConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ClustersConfigDump_StaticCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ClustersConfigDump.StaticCluster");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ClustersConfigDump_StaticCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ClustersConfigDump.StaticCluster");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ClustersConfigDump_DynamicCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ClustersConfigDump.DynamicCluster");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ClustersConfigDump_DynamicCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ClustersConfigDump.DynamicCluster");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_RoutesConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.RoutesConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_RoutesConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.RoutesConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.RoutesConfigDump.StaticRouteConfig");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.RoutesConfigDump.StaticRouteConfig");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.RoutesConfigDump.DynamicRouteConfig");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.RoutesConfigDump.DynamicRouteConfig");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ScopedRoutesConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ScopedRoutesConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ScopedRoutesConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ScopedRoutesConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ScopedRoutesConfigDump.InlineScopedRouteConfigs");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ScopedRoutesConfigDump.InlineScopedRouteConfigs");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.ScopedRoutesConfigDump.DynamicScopedRouteConfigs");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ScopedRoutesConfigDump.DynamicScopedRouteConfigs");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_SecretsConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.SecretsConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_SecretsConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.SecretsConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_SecretsConfigDump_DynamicSecret_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.SecretsConfigDump.DynamicSecret");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_SecretsConfigDump_DynamicSecret_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.SecretsConfigDump.DynamicSecret");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_SecretsConfigDump_StaticSecret_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.SecretsConfigDump.StaticSecret");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_SecretsConfigDump_StaticSecret_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.SecretsConfigDump.StaticSecret");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_EndpointsConfigDump_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.EndpointsConfigDump");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_EndpointsConfigDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.EndpointsConfigDump");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.EndpointsConfigDump.StaticEndpointConfig");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.EndpointsConfigDump.StaticEndpointConfig");
}
-UPB_INLINE const upb_msgdef *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.admin.v3.EndpointsConfigDump.DynamicEndpointConfig");
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_config_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.EndpointsConfigDump.DynamicEndpointConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c
new file mode 100644
index 00000000..6f6f1551
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c
@@ -0,0 +1,43 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/init_dump.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/init_dump.upbdefs.h"
+#include "envoy/admin/v3/init_dump.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+static const char descriptor[416] = {'\n', '\036', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'i', 'n', 'i', 't', '_', 'd', 'u', 'm',
+'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\035',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\"', '\316', '\001', '\n', '\023', 'U', 'n', 'r', 'e', 'a', 'd', 'y', 'T', 'a', 'r', 'g', 'e', 't', 's', 'D', 'u',
+'m', 'p', 's', '\022', 'j', '\n', '\025', 'u', 'n', 'r', 'e', 'a', 'd', 'y', '_', 't', 'a', 'r', 'g', 'e', 't', 's', '_', 'd', 'u',
+'m', 'p', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v',
+'3', '.', 'U', 'n', 'r', 'e', 'a', 'd', 'y', 'T', 'a', 'r', 'g', 'e', 't', 's', 'D', 'u', 'm', 'p', 's', '.', 'U', 'n', 'r',
+'e', 'a', 'd', 'y', 'T', 'a', 'r', 'g', 'e', 't', 's', 'D', 'u', 'm', 'p', 'R', '\023', 'u', 'n', 'r', 'e', 'a', 'd', 'y', 'T',
+'a', 'r', 'g', 'e', 't', 's', 'D', 'u', 'm', 'p', 's', '\032', 'K', '\n', '\022', 'U', 'n', 'r', 'e', 'a', 'd', 'y', 'T', 'a', 'r',
+'g', 'e', 't', 's', 'D', 'u', 'm', 'p', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n',
+'a', 'm', 'e', '\022', '!', '\n', '\014', 't', 'a', 'r', 'g', 'e', 't', '_', 'n', 'a', 'm', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t',
+'R', '\013', 't', 'a', 'r', 'g', 'e', 't', 'N', 'a', 'm', 'e', 's', 'B', 'v', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\r', 'I', 'n', 'i',
+'t', 'D', 'u', 'm', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/',
+'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a',
+'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3',
+'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_init_dump_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_init_dump_proto_upb_file_layout,
+ "envoy/admin/v3/init_dump.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 416)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h
new file mode 100644
index 00000000..0bfc412e
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/init_dump.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_init_dump_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_UnreadyTargetsDumps_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_init_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.UnreadyTargetsDumps");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_init_dump_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.UnreadyTargetsDumps.UnreadyTargetsDump");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_INIT_DUMP_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c
new file mode 100644
index 00000000..0e18d593
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/listeners.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/listeners.upbdefs.h"
+#include "envoy/admin/v3/listeners.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[557] = {'\n', '\036', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\"',
+'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r',
+'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
+'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o',
+'\"', '~', '\n', '\t', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', 'K', '\n', '\021', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'d', 'm', 'i', 'n', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', 'R', '\020', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', 'e', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'L', 'i', 's', 't', 'e', 'n',
+'e', 'r', 's', '\"', '\223', '\001', '\n', '\016', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'B', '\n', '\r', 'l', 'o', 'c', 'a',
+'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\014', 'l', 'o',
+'c', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'S', 't', 'a',
+'t', 'u', 's', 'B', 'w', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\016', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &envoy_config_core_v3_address_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_listeners_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_listeners_proto_upb_file_layout,
+ "envoy/admin/v3/listeners.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 557)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h
new file mode 100644
index 00000000..2ff04fa5
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/listeners.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_listeners_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_Listeners_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_listeners_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.Listeners");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ListenerStatus_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_listeners_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ListenerStatus");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_LISTENERS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c
new file mode 100644
index 00000000..4ca19acc
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c
@@ -0,0 +1,49 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/memory.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/memory.upbdefs.h"
+#include "envoy/admin/v3/memory.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[520] = {'\n', '\033', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'm', 'e', 'm', 'o', 'r', 'y', '.', 'p',
+'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
+'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\230', '\002', '\n', '\006', 'M', 'e', 'm', 'o', 'r', 'y', '\022', '\034', '\n',
+'\t', 'a', 'l', 'l', 'o', 'c', 'a', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\t', 'a', 'l', 'l', 'o', 'c', 'a', 't',
+'e', 'd', '\022', '\033', '\n', '\t', 'h', 'e', 'a', 'p', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001', '(', '\004', 'R', '\010', 'h', 'e',
+'a', 'p', 'S', 'i', 'z', 'e', '\022', '+', '\n', '\021', 'p', 'a', 'g', 'e', 'h', 'e', 'a', 'p', '_', 'u', 'n', 'm', 'a', 'p', 'p',
+'e', 'd', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'a', 'g', 'e', 'h', 'e', 'a', 'p', 'U', 'n', 'm', 'a', 'p', 'p', 'e',
+'d', '\022', '#', '\n', '\r', 'p', 'a', 'g', 'e', 'h', 'e', 'a', 'p', '_', 'f', 'r', 'e', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R',
+'\014', 'p', 'a', 'g', 'e', 'h', 'e', 'a', 'p', 'F', 'r', 'e', 'e', '\022', ',', '\n', '\022', 't', 'o', 't', 'a', 'l', '_', 't', 'h',
+'r', 'e', 'a', 'd', '_', 'c', 'a', 'c', 'h', 'e', '\030', '\005', ' ', '\001', '(', '\004', 'R', '\020', 't', 'o', 't', 'a', 'l', 'T', 'h',
+'r', 'e', 'a', 'd', 'C', 'a', 'c', 'h', 'e', '\022', '0', '\n', '\024', 't', 'o', 't', 'a', 'l', '_', 'p', 'h', 'y', 's', 'i', 'c',
+'a', 'l', '_', 'b', 'y', 't', 'e', 's', '\030', '\006', ' ', '\001', '(', '\004', 'R', '\022', 't', 'o', 't', 'a', 'l', 'P', 'h', 'y', 's',
+'i', 'c', 'a', 'l', 'B', 'y', 't', 'e', 's', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'d', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'M', 'e', 'm', 'o', 'r', 'y', 'B', 't', '\n', '\034', 'i', 'o',
+'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v',
+'3', 'B', '\013', 'M', 'e', 'm', 'o', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.',
+'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l',
+'-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm',
+'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_memory_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_memory_proto_upb_file_layout,
+ "envoy/admin/v3/memory.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 520)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h
new file mode 100644
index 00000000..26e81046
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/memory.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_memory_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_Memory_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_memory_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.Memory");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_MEMORY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c
new file mode 100644
index 00000000..4cbc9efe
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/metrics.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/metrics.upbdefs.h"
+#include "envoy/admin/v3/metrics.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[426] = {'\n', '\034', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '.',
+'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', '\035', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's',
+'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\270', '\001', '\n', '\014', 'S', 'i', 'm', 'p', 'l', 'e', 'M', 'e',
+'t', 'r', 'i', 'c', '\022', '5', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '!', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'S', 'i', 'm', 'p', 'l', 'e', 'M', 'e', 't', 'r', 'i', 'c', '.', 'T',
+'y', 'p', 'e', 'R', '\004', 't', 'y', 'p', 'e', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\004', 'R',
+'\005', 'v', 'a', 'l', 'u', 'e', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm',
+'e', '\"', '\036', '\n', '\004', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'C', 'O', 'U', 'N', 'T', 'E', 'R', '\020', '\000', '\022', '\t', '\n',
+'\005', 'G', 'A', 'U', 'G', 'E', '\020', '\001', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd',
+'m', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'S', 'i', 'm', 'p', 'l', 'e', 'M', 'e', 't', 'r', 'i', 'c', 'B',
+'u', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd',
+'m', 'i', 'n', '.', 'v', '3', 'B', '\014', 'M', 'e', 't', 'r', 'i', 'c', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g',
+'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c',
+'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/',
+'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_metrics_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_metrics_proto_upb_file_layout,
+ "envoy/admin/v3/metrics.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 426)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h
new file mode 100644
index 00000000..4cdfb751
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/metrics.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_metrics_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_SimpleMetric_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_metrics_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.SimpleMetric");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_METRICS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c
new file mode 100644
index 00000000..49e37fb8
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/mutex_stats.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/mutex_stats.upbdefs.h"
+#include "envoy/admin/v3/mutex_stats.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[439] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'm', 'u', 't', 'e', 'x', '_', 's', 't',
+'a', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
+'\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\276', '\001', '\n', '\n', 'M', 'u', 't', 'e',
+'x', 'S', 't', 'a', 't', 's', '\022', '\'', '\n', '\017', 'n', 'u', 'm', '_', 'c', 'o', 'n', 't', 'e', 'n', 't', 'i', 'o', 'n', 's',
+'\030', '\001', ' ', '\001', '(', '\004', 'R', '\016', 'n', 'u', 'm', 'C', 'o', 'n', 't', 'e', 'n', 't', 'i', 'o', 'n', 's', '\022', '.', '\n',
+'\023', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'w', 'a', 'i', 't', '_', 'c', 'y', 'c', 'l', 'e', 's', '\030', '\002', ' ', '\001', '(',
+'\004', 'R', '\021', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'W', 'a', 'i', 't', 'C', 'y', 'c', 'l', 'e', 's', '\022', '0', '\n', '\024', 'l',
+'i', 'f', 'e', 't', 'i', 'm', 'e', '_', 'w', 'a', 'i', 't', '_', 'c', 'y', 'c', 'l', 'e', 's', '\030', '\003', ' ', '\001', '(', '\004',
+'R', '\022', 'l', 'i', 'f', 'e', 't', 'i', 'm', 'e', 'W', 'a', 'i', 't', 'C', 'y', 'c', 'l', 'e', 's', ':', '%', '\232', '\305', '\210',
+'\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'M',
+'u', 't', 'e', 'x', 'S', 't', 'a', 't', 's', 'B', 'x', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\017', 'M', 'u', 't', 'e', 'x', 'S', 't',
+'a', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e',
+'/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200',
+'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_mutex_stats_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_mutex_stats_proto_upb_file_layout,
+ "envoy/admin/v3/mutex_stats.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 439)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h
new file mode 100644
index 00000000..67fef393
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/mutex_stats.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_mutex_stats_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_MutexStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_mutex_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.MutexStats");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_MUTEX_STATS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c
new file mode 100644
index 00000000..d6274701
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c
@@ -0,0 +1,142 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/server_info.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/server_info.upbdefs.h"
+#include "envoy/admin/v3/server_info.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[2736] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 's', 'e', 'r', 'v', 'e', 'r', '_', 'i',
+'n', 'f', 'o', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
+'\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
+'s', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\"', '\230', '\004', '\n', '\n', 'S', 'e', 'r', 'v', 'e', 'r', 'I', 'n', 'f', 'o', '\022', '\030', '\n', '\007',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '6', '\n',
+'\005', 's', 't', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i',
+'n', '.', 'v', '3', '.', 'S', 'e', 'r', 'v', 'e', 'r', 'I', 'n', 'f', 'o', '.', 'S', 't', 'a', 't', 'e', 'R', '\005', 's', 't',
+'a', 't', 'e', '\022', 'K', '\n', '\024', 'u', 'p', 't', 'i', 'm', 'e', '_', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'e', 'p', 'o',
+'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\022', 'u', 'p', 't', 'i', 'm', 'e', 'C', 'u', 'r', 'r', 'e', 'n', 't',
+'E', 'p', 'o', 'c', 'h', '\022', 'E', '\n', '\021', 'u', 'p', 't', 'i', 'm', 'e', '_', 'a', 'l', 'l', '_', 'e', 'p', 'o', 'c', 'h',
+'s', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'u', 'p', 't', 'i', 'm', 'e', 'A', 'l', 'l', 'E', 'p', 'o', 'c', 'h',
+'s', '\022', '.', '\n', '\023', 'h', 'o', 't', '_', 'r', 'e', 's', 't', 'a', 'r', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030',
+'\005', ' ', '\001', '(', '\t', 'R', '\021', 'h', 'o', 't', 'R', 'e', 's', 't', 'a', 'r', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022',
+'T', '\n', '\024', 'c', 'o', 'm', 'm', 'a', 'n', 'd', '_', 'l', 'i', 'n', 'e', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\006',
+' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'o', 'm',
+'m', 'a', 'n', 'd', 'L', 'i', 'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\022', 'c', 'o', 'm', 'm', 'a', 'n', 'd', 'L',
+'i', 'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2',
+'\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o',
+'d', 'e', 'R', '\004', 'n', 'o', 'd', 'e', '\"', 'G', '\n', '\005', 'S', 't', 'a', 't', 'e', '\022', '\010', '\n', '\004', 'L', 'I', 'V', 'E',
+'\020', '\000', '\022', '\014', '\n', '\010', 'D', 'R', 'A', 'I', 'N', 'I', 'N', 'G', '\020', '\001', '\022', '\024', '\n', '\020', 'P', 'R', 'E', '_', 'I',
+'N', 'I', 'T', 'I', 'A', 'L', 'I', 'Z', 'I', 'N', 'G', '\020', '\002', '\022', '\020', '\n', '\014', 'I', 'N', 'I', 'T', 'I', 'A', 'L', 'I',
+'Z', 'I', 'N', 'G', '\020', '\003', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i',
+'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'S', 'e', 'r', 'v', 'e', 'r', 'I', 'n', 'f', 'o', '\"', '\333', '\016', '\n', '\022',
+'C', 'o', 'm', 'm', 'a', 'n', 'd', 'L', 'i', 'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\027', '\n', '\007', 'b', 'a', 's',
+'e', '_', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\006', 'b', 'a', 's', 'e', 'I', 'd', '\022', '-', '\n', '\023', 'u', 's', 'e',
+'_', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'b', 'a', 's', 'e', '_', 'i', 'd', '\030', '\037', ' ', '\001', '(', '\010', 'R', '\020', 'u',
+'s', 'e', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'B', 'a', 's', 'e', 'I', 'd', '\022', ' ', '\n', '\014', 'b', 'a', 's', 'e', '_', 'i',
+'d', '_', 'p', 'a', 't', 'h', '\030', ' ', ' ', '\001', '(', '\t', 'R', '\n', 'b', 'a', 's', 'e', 'I', 'd', 'P', 'a', 't', 'h', '\022',
+' ', '\n', '\013', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\013', 'c', 'o', 'n',
+'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', '\022', '\037', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'p', 'a', 't', 'h', '\030', '\003',
+' ', '\001', '(', '\t', 'R', '\n', 'c', 'o', 'n', 'f', 'i', 'g', 'P', 'a', 't', 'h', '\022', '\037', '\n', '\013', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 'y', 'a', 'm', 'l', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\n', 'c', 'o', 'n', 'f', 'i', 'g', 'Y', 'a', 'm', 'l', '\022',
+'=', '\n', '\033', 'a', 'l', 'l', 'o', 'w', '_', 'u', 'n', 'k', 'n', 'o', 'w', 'n', '_', 's', 't', 'a', 't', 'i', 'c', '_', 'f',
+'i', 'e', 'l', 'd', 's', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\030', 'a', 'l', 'l', 'o', 'w', 'U', 'n', 'k', 'n', 'o', 'w', 'n',
+'S', 't', 'a', 't', 'i', 'c', 'F', 'i', 'e', 'l', 'd', 's', '\022', 'A', '\n', '\035', 'r', 'e', 'j', 'e', 'c', 't', '_', 'u', 'n',
+'k', 'n', 'o', 'w', 'n', '_', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'f', 'i', 'e', 'l', 'd', 's', '\030', '\032', ' ', '\001', '(',
+'\010', 'R', '\032', 'r', 'e', 'j', 'e', 'c', 't', 'U', 'n', 'k', 'n', 'o', 'w', 'n', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'F', 'i',
+'e', 'l', 'd', 's', '\022', 'A', '\n', '\035', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'u', 'n', 'k', 'n', 'o', 'w', 'n', '_', 'd', 'y',
+'n', 'a', 'm', 'i', 'c', '_', 'f', 'i', 'e', 'l', 'd', 's', '\030', '\036', ' ', '\001', '(', '\010', 'R', '\032', 'i', 'g', 'n', 'o', 'r',
+'e', 'U', 'n', 'k', 'n', 'o', 'w', 'n', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'F', 'i', 'e', 'l', 'd', 's', '\022', ',', '\n', '\022',
+'a', 'd', 'm', 'i', 'n', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'p', 'a', 't', 'h', '\030', '\006', ' ', '\001', '(', '\t', 'R',
+'\020', 'a', 'd', 'm', 'i', 'n', 'A', 'd', 'd', 'r', 'e', 's', 's', 'P', 'a', 't', 'h', '\022', 'e', '\n', '\030', 'l', 'o', 'c', 'a',
+'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'i', 'p', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(',
+'\016', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'a', 'n',
+'d', 'L', 'i', 'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'I', 'p', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\025', 'l',
+'o', 'c', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'I', 'p', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\033', '\n', '\t', 'l',
+'o', 'g', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\010', 'l', 'o', 'g', 'L', 'e', 'v', 'e', 'l', '\022',
+'.', '\n', '\023', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', '_', 'l', 'o', 'g', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\t', ' ',
+'\001', '(', '\t', 'R', '\021', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 'L', 'o', 'g', 'L', 'e', 'v', 'e', 'l', '\022', '\035', '\n',
+'\n', 'l', 'o', 'g', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\n', ' ', '\001', '(', '\t', 'R', '\t', 'l', 'o', 'g', 'F', 'o', 'r',
+'m', 'a', 't', '\022', ',', '\n', '\022', 'l', 'o', 'g', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 'e', 's', 'c', 'a', 'p', 'e', 'd',
+'\030', '\033', ' ', '\001', '(', '\010', 'R', '\020', 'l', 'o', 'g', 'F', 'o', 'r', 'm', 'a', 't', 'E', 's', 'c', 'a', 'p', 'e', 'd', '\022',
+'\031', '\n', '\010', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\013', ' ', '\001', '(', '\t', 'R', '\007', 'l', 'o', 'g', 'P', 'a', 't',
+'h', '\022', '\'', '\n', '\017', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\r', ' ', '\001', '(',
+'\t', 'R', '\016', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v',
+'i', 'c', 'e', '_', 'n', 'o', 'd', 'e', '\030', '\016', ' ', '\001', '(', '\t', 'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'o',
+'d', 'e', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'z', 'o', 'n', 'e', '\030', '\017', ' ', '\001', '(', '\t', 'R',
+'\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'Z', 'o', 'n', 'e', '\022', 'I', '\n', '\023', 'f', 'i', 'l', 'e', '_', 'f', 'l', 'u', 's',
+'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'f', 'i', 'l', 'e', 'F',
+'l', 'u', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '8', '\n', '\n', 'd', 'r', 'a', 'i', 'n', '_', 't', 'i', 'm',
+'e', '\030', '\021', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\t', 'd', 'r', 'a', 'i', 'n', 'T', 'i', 'm', 'e', '\022', 'W', '\n', '\016', 'd',
+'r', 'a', 'i', 'n', '_', 's', 't', 'r', 'a', 't', 'e', 'g', 'y', '\030', '!', ' ', '\001', '(', '\016', '2', '0', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'a', 'n', 'd', 'L', 'i', 'n', 'e', 'O', 'p',
+'t', 'i', 'o', 'n', 's', '.', 'D', 'r', 'a', 'i', 'n', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', 'R', '\r', 'd', 'r', 'a', 'i',
+'n', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', '\022', 'K', '\n', '\024', 'p', 'a', 'r', 'e', 'n', 't', '_', 's', 'h', 'u', 't', 'd',
+'o', 'w', 'n', '_', 't', 'i', 'm', 'e', '\030', '\022', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\022', 'p', 'a', 'r', 'e', 'n', 't', 'S',
+'h', 'u', 't', 'd', 'o', 'w', 'n', 'T', 'i', 'm', 'e', '\022', ';', '\n', '\004', 'm', 'o', 'd', 'e', '\030', '\023', ' ', '\001', '(', '\016',
+'2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'a', 'n', 'd',
+'L', 'i', 'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'M', 'o', 'd', 'e', 'R', '\004', 'm', 'o', 'd', 'e', '\022', '.', '\n',
+'\023', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'h', 'o', 't', '_', 'r', 'e', 's', 't', 'a', 'r', 't', '\030', '\026', ' ', '\001', '(',
+'\010', 'R', '\021', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'H', 'o', 't', 'R', 'e', 's', 't', 'a', 'r', 't', '\022', '0', '\n', '\024', 'e',
+'n', 'a', 'b', 'l', 'e', '_', 'm', 'u', 't', 'e', 'x', '_', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030', '\027', ' ', '\001', '(', '\010',
+'R', '\022', 'e', 'n', 'a', 'b', 'l', 'e', 'M', 'u', 't', 'e', 'x', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '#', '\n', '\r', 'r',
+'e', 's', 't', 'a', 'r', 't', '_', 'e', 'p', 'o', 'c', 'h', '\030', '\030', ' ', '\001', '(', '\r', 'R', '\014', 'r', 'e', 's', 't', 'a',
+'r', 't', 'E', 'p', 'o', 'c', 'h', '\022', '%', '\n', '\016', 'c', 'p', 'u', 's', 'e', 't', '_', 't', 'h', 'r', 'e', 'a', 'd', 's',
+'\030', '\031', ' ', '\001', '(', '\010', 'R', '\r', 'c', 'p', 'u', 's', 'e', 't', 'T', 'h', 'r', 'e', 'a', 'd', 's', '\022', '/', '\n', '\023',
+'d', 'i', 's', 'a', 'b', 'l', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\034', ' ', '\003', '(', '\t',
+'R', '\022', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '9', '\n', '\031', 'e',
+'n', 'a', 'b', 'l', 'e', '_', 'f', 'i', 'n', 'e', '_', 'g', 'r', 'a', 'i', 'n', '_', 'l', 'o', 'g', 'g', 'i', 'n', 'g', '\030',
+'\"', ' ', '\001', '(', '\010', 'R', '\026', 'e', 'n', 'a', 'b', 'l', 'e', 'F', 'i', 'n', 'e', 'G', 'r', 'a', 'i', 'n', 'L', 'o', 'g',
+'g', 'i', 'n', 'g', '\022', '\037', '\n', '\013', 's', 'o', 'c', 'k', 'e', 't', '_', 'p', 'a', 't', 'h', '\030', '#', ' ', '\001', '(', '\t',
+'R', '\n', 's', 'o', 'c', 'k', 'e', 't', 'P', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'o',
+'d', 'e', '\030', '$', ' ', '\001', '(', '\r', 'R', '\n', 's', 'o', 'c', 'k', 'e', 't', 'M', 'o', 'd', 'e', '\022', '(', '\n', '\020', 'e',
+'n', 'a', 'b', 'l', 'e', '_', 'c', 'o', 'r', 'e', '_', 'd', 'u', 'm', 'p', '\030', '%', ' ', '\001', '(', '\010', 'R', '\016', 'e', 'n',
+'a', 'b', 'l', 'e', 'C', 'o', 'r', 'e', 'D', 'u', 'm', 'p', '\022', '\033', '\n', '\t', 's', 't', 'a', 't', 's', '_', 't', 'a', 'g',
+'\030', '&', ' ', '\003', '(', '\t', 'R', '\010', 's', 't', 'a', 't', 's', 'T', 'a', 'g', '\"', '\033', '\n', '\t', 'I', 'p', 'V', 'e', 'r',
+'s', 'i', 'o', 'n', '\022', '\006', '\n', '\002', 'v', '4', '\020', '\000', '\022', '\006', '\n', '\002', 'v', '6', '\020', '\001', '\"', '-', '\n', '\004', 'M',
+'o', 'd', 'e', '\022', '\t', '\n', '\005', 'S', 'e', 'r', 'v', 'e', '\020', '\000', '\022', '\014', '\n', '\010', 'V', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '\020', '\001', '\022', '\014', '\n', '\010', 'I', 'n', 'i', 't', 'O', 'n', 'l', 'y', '\020', '\002', '\"', '+', '\n', '\r', 'D', 'r', 'a', 'i',
+'n', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', '\022', '\013', '\n', '\007', 'G', 'r', 'a', 'd', 'u', 'a', 'l', '\020', '\000', '\022', '\r', '\n',
+'\t', 'I', 'm', 'm', 'e', 'd', 'i', 'a', 't', 'e', '\020', '\001', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'o', 'm', 'm', 'a', 'n', 'd', 'L', 'i',
+'n', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', 'J', '\004', '\010', '\014', '\020', '\r', 'J', '\004', '\010', '\024', '\020', '\025', 'J', '\004', '\010', '\025',
+'\020', '\026', 'J', '\004', '\010', '\035', '\020', '\036', 'R', '\t', 'm', 'a', 'x', '_', 's', 't', 'a', 't', 's', 'R', '\020', 'm', 'a', 'x', '_',
+'o', 'b', 'j', '_', 'n', 'a', 'm', 'e', '_', 'l', 'e', 'n', 'R', '\021', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '_', 'v',
+'e', 'r', 's', 'i', 'o', 'n', 'B', 'x', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\017', 'S', 'e', 'r', 'v', 'e', 'r', 'I', 'n', 'f', 'o',
+'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n',
+'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[5] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &google_protobuf_duration_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_server_info_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_server_info_proto_upb_file_layout,
+ "envoy/admin/v3/server_info.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 2736)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h
new file mode 100644
index 00000000..029dcdfd
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/server_info.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_server_info_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_ServerInfo_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_server_info_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.ServerInfo");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_CommandLineOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_server_info_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.CommandLineOptions");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_SERVER_INFO_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c
new file mode 100644
index 00000000..a7c160fe
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c
@@ -0,0 +1,51 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/tap.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/admin/v3/tap.upbdefs.h"
+#include "envoy/admin/v3/tap.upb.h"
+
+extern _upb_DefPool_Init envoy_config_tap_v3_common_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[455] = {'\n', '\030', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 't', 'a', 'p', '.', 'p', 'r', 'o', 't',
+'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/',
+'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'a', 'p', '/', 'v', '3', '/', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\242', '\001', '\n', '\n', 'T', 'a', 'p',
+'R', 'e', 'q', 'u', 'e', 's', 't', '\022', '$', '\n', '\t', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'i', 'd', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\010', 'c', 'o', 'n', 'f', 'i', 'g', 'I', 'd', '\022', 'G', '\n', '\n', 't',
+'a', 'p', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'T', 'a', 'p', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\t', 't', 'a', 'p', 'C', 'o', 'n', 'f', 'i', 'g', ':', '%', '\232', '\305', '\210', '\036', ' ',
+'\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'T', 'a', 'p',
+'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'q', '\n', '\034', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', 'B', '\010', 'T', 'a', 'p', 'P', 'r', 'o', 't', 'o', 'P',
+'\001', 'Z', '=', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/',
+'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd',
+'m', 'i', 'n', '/', 'v', '3', ';', 'a', 'd', 'm', 'i', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p',
+'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[5] = {
+ &envoy_config_tap_v3_common_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_admin_v3_tap_proto_upbdefinit = {
+ deps,
+ &envoy_admin_v3_tap_proto_upb_file_layout,
+ "envoy/admin/v3/tap.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 455)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h
new file mode 100644
index 00000000..3ba0e5ae
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/admin/v3/tap.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_
+#define ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_admin_v3_tap_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_admin_v3_TapRequest_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_admin_v3_tap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.admin.v3.TapRequest");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_ADMIN_V3_TAP_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
index ffb00770..39ee7d76 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
@@ -8,31 +8,41 @@
#include "upb/def.h"
#include "envoy/annotations/deprecation.upbdefs.h"
+#include "envoy/annotations/deprecation.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
-static const char descriptor[283] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[550] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e',
'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'n', 'n', 'o', 't',
'a', 't', 'i', 'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd',
'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', ':', 'T', '\n', '\025', 'd', 'i', 's', 'a', 'l', 'l',
'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\347', '\255', '\256',
'Z', ' ', '\001', '(', '\010', 'R', '\023', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l',
-'t', ':', 'a', '\n', '\032', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l',
-'t', '_', 'e', 'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\365', '\316', '\266', '!', ' ', '\001', '(', '\010',
-'R', '\027', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'E', 'n', 'u', 'm',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'t', ':', '_', '\n', '\033', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'a', 't', '_', 'm', 'i', 'n', 'o', 'r', '_',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\362', '\350', '\200', 'K', ' ', '\001', '(', '\t', 'R', '\030', 'd',
+'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'A', 't', 'M', 'i', 'n', 'o', 'r', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', 'a',
+'\n', '\032', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'e',
+'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u',
+'m', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\365', '\316', '\266', '!', ' ', '\001', '(', '\010', 'R', '\027', 'd',
+'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'E', 'n', 'u', 'm', ':', 'l', '\n',
+' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'a', 't', '_', 'm', 'i', 'n', 'o', 'r', '_', 'v', 'e', 'r', 's',
+'i', 'o', 'n', '_', 'e', 'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\301', '\276', '\263', 'V', ' ', '\001',
+'(', '\t', 'R', '\034', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'A', 't', 'M', 'i', 'n', 'o', 'r', 'V', 'e', 'r', 's',
+'i', 'o', 'n', 'E', 'n', 'u', 'm', 'B', ':', 'Z', '8', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/',
+'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init envoy_annotations_deprecation_proto_upbdefinit = {
+_upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_annotations_deprecation_proto_upb_file_layout,
"envoy/annotations/deprecation.proto",
- UPB_STRVIEW_INIT(descriptor, 283)
+ UPB_STRINGVIEW_INIT(descriptor, 550)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h
index 012d961e..f5beac8e 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h
@@ -19,7 +19,7 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
index 5a3b9652..f5357814 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "envoy/annotations/resource.upbdefs.h"
+#include "envoy/annotations/resource.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_annotations_ResourceAnnotation_msginit,
-};
-
-static const char descriptor[240] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[300] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u',
'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '(', '\n', '\022', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'A',
@@ -25,17 +20,19 @@ static const char descriptor[240] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a
'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030',
'\301', '\344', '\262', '~', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
'o', 'n', 's', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'r',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', ':', 'Z', '8', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/',
+'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init envoy_annotations_resource_proto_upbdefinit = {
+_upb_DefPool_Init envoy_annotations_resource_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_annotations_resource_proto_upb_file_layout,
"envoy/annotations/resource.proto",
- UPB_STRVIEW_INIT(descriptor, 240)
+ UPB_STRINGVIEW_INIT(descriptor, 300)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h
index bb778390..f775b381 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_resource_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_annotations_ResourceAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_annotations_resource_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.annotations.ResourceAnnotation");
+UPB_INLINE const upb_MessageDef *envoy_annotations_ResourceAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_annotations_resource_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.annotations.ResourceAnnotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
index d9e63439..a2b3b342 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
@@ -8,51 +8,18 @@
#include "upb/def.h"
#include "envoy/config/accesslog/v3/accesslog.upbdefs.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[15] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
- &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
- &envoy_config_accesslog_v3_DurationFilter_msginit,
- &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
- &envoy_config_accesslog_v3_TraceableFilter_msginit,
- &envoy_config_accesslog_v3_RuntimeFilter_msginit,
- &envoy_config_accesslog_v3_AndFilter_msginit,
- &envoy_config_accesslog_v3_OrFilter_msginit,
- &envoy_config_accesslog_v3_HeaderFilter_msginit,
- &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
- &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
- &envoy_config_accesslog_v3_MetadataFilter_msginit,
- &envoy_config_accesslog_v3_ExtensionFilter_msginit,
-};
-
-static const char descriptor[4388] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[4481] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/',
'v', '3', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
@@ -178,59 +145,63 @@ static const char descriptor[4388] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', '
'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005',
'\212', '\001', '\002', '\020', '\001', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o',
-'g', '.', 'v', '2', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\334', '\001', '\n', '\022', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\211', '\001', '\n', '\005', 'f', 'l', 'a', 'g', 's',
-'\030', '\001', ' ', '\003', '(', '\t', 'B', 's', '\372', 'B', 'p', '\222', '\001', 'm', '\"', 'k', 'r', 'i', 'R', '\002', 'L', 'H', 'R', '\002', 'U',
-'H', 'R', '\002', 'U', 'T', 'R', '\002', 'L', 'R', 'R', '\002', 'U', 'R', 'R', '\002', 'U', 'F', 'R', '\002', 'U', 'C', 'R', '\002', 'U', 'O',
-'R', '\002', 'N', 'R', 'R', '\002', 'D', 'I', 'R', '\002', 'F', 'I', 'R', '\002', 'R', 'L', 'R', '\004', 'U', 'A', 'E', 'X', 'R', '\004', 'R',
-'L', 'S', 'E', 'R', '\002', 'D', 'C', 'R', '\003', 'U', 'R', 'X', 'R', '\002', 'S', 'I', 'R', '\002', 'I', 'H', 'R', '\003', 'D', 'P', 'E',
-'R', '\005', 'U', 'M', 'S', 'D', 'R', 'R', '\004', 'R', 'F', 'C', 'F', 'R', '\004', 'N', 'F', 'C', 'F', 'R', '\002', 'D', 'T', 'R', '\005',
-'f', 'l', 'a', 'g', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\200', '\004', '\n', '\020', 'G', 'r', 'p', 'c', 'S',
-'t', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '\022', ']', '\n', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001',
-' ', '\003', '(', '\016', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's',
-'s', 'l', 'o', 'g', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '.',
-'S', 't', 'a', 't', 'u', 's', 'B', '\r', '\372', 'B', '\n', '\222', '\001', '\007', '\"', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 's', 't',
-'a', 't', 'u', 's', 'e', 's', '\022', '\030', '\n', '\007', 'e', 'x', 'c', 'l', 'u', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\007',
-'e', 'x', 'c', 'l', 'u', 'd', 'e', '\"', '\270', '\002', '\n', '\006', 'S', 't', 'a', 't', 'u', 's', '\022', '\006', '\n', '\002', 'O', 'K', '\020',
-'\000', '\022', '\014', '\n', '\010', 'C', 'A', 'N', 'C', 'E', 'L', 'E', 'D', '\020', '\001', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W',
-'N', '\020', '\002', '\022', '\024', '\n', '\020', 'I', 'N', 'V', 'A', 'L', 'I', 'D', '_', 'A', 'R', 'G', 'U', 'M', 'E', 'N', 'T', '\020', '\003',
-'\022', '\025', '\n', '\021', 'D', 'E', 'A', 'D', 'L', 'I', 'N', 'E', '_', 'E', 'X', 'C', 'E', 'E', 'D', 'E', 'D', '\020', '\004', '\022', '\r',
-'\n', '\t', 'N', 'O', 'T', '_', 'F', 'O', 'U', 'N', 'D', '\020', '\005', '\022', '\022', '\n', '\016', 'A', 'L', 'R', 'E', 'A', 'D', 'Y', '_',
-'E', 'X', 'I', 'S', 'T', 'S', '\020', '\006', '\022', '\025', '\n', '\021', 'P', 'E', 'R', 'M', 'I', 'S', 'S', 'I', 'O', 'N', '_', 'D', 'E',
-'N', 'I', 'E', 'D', '\020', '\007', '\022', '\026', '\n', '\022', 'R', 'E', 'S', 'O', 'U', 'R', 'C', 'E', '_', 'E', 'X', 'H', 'A', 'U', 'S',
-'T', 'E', 'D', '\020', '\010', '\022', '\027', '\n', '\023', 'F', 'A', 'I', 'L', 'E', 'D', '_', 'P', 'R', 'E', 'C', 'O', 'N', 'D', 'I', 'T',
-'I', 'O', 'N', '\020', '\t', '\022', '\013', '\n', '\007', 'A', 'B', 'O', 'R', 'T', 'E', 'D', '\020', '\n', '\022', '\020', '\n', '\014', 'O', 'U', 'T',
-'_', 'O', 'F', '_', 'R', 'A', 'N', 'G', 'E', '\020', '\013', '\022', '\021', '\n', '\r', 'U', 'N', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N',
-'T', 'E', 'D', '\020', '\014', '\022', '\014', '\n', '\010', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '\020', '\r', '\022', '\017', '\n', '\013', 'U', 'N',
-'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\016', '\022', '\r', '\n', '\t', 'D', 'A', 'T', 'A', '_', 'L', 'O', 'S', 'S', '\020',
-'\017', '\022', '\023', '\n', '\017', 'U', 'N', 'A', 'U', 'T', 'H', 'E', 'N', 'T', 'I', 'C', 'A', 'T', 'E', 'D', '\020', '\020', ':', '8', '\232',
-'\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F',
-'i', 'l', 't', 'e', 'r', '\"', '\332', '\001', '\n', '\016', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\022',
-'@', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M',
-'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'N', '\n', '\026', 'm', 'a', 't', 'c', 'h', '_',
-'i', 'f', '_', 'k', 'e', 'y', '_', 'n', 'o', 't', '_', 'f', 'o', 'u', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\022', 'm', 'a', 't', 'c', 'h', 'I', 'f', 'K', 'e', 'y', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', ':', '6', '\232', '\305', '\210',
-'\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a',
-'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e',
-'r', '\"', '\266', '\001', '\n', '\017', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\022', '\n', '\004',
-'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
-':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l',
-'t', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010',
-'\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
-'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o',
-'g', '.', 'v', '3', 'B', '\016', 'A', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'g', '.', 'v', '2', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\352', '\001', '\n', '\022', 'R', 'e', 's',
+'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\227', '\001', '\n', '\005', 'f', 'l', 'a', 'g', 's',
+'\030', '\001', ' ', '\003', '(', '\t', 'B', '\200', '\001', '\372', 'B', '}', '\222', '\001', 'z', '\"', 'x', 'r', 'v', 'R', '\002', 'L', 'H', 'R', '\002',
+'U', 'H', 'R', '\002', 'U', 'T', 'R', '\002', 'L', 'R', 'R', '\002', 'U', 'R', 'R', '\002', 'U', 'F', 'R', '\002', 'U', 'C', 'R', '\002', 'U',
+'O', 'R', '\002', 'N', 'R', 'R', '\002', 'D', 'I', 'R', '\002', 'F', 'I', 'R', '\002', 'R', 'L', 'R', '\004', 'U', 'A', 'E', 'X', 'R', '\004',
+'R', 'L', 'S', 'E', 'R', '\002', 'D', 'C', 'R', '\003', 'U', 'R', 'X', 'R', '\002', 'S', 'I', 'R', '\002', 'I', 'H', 'R', '\003', 'D', 'P',
+'E', 'R', '\005', 'U', 'M', 'S', 'D', 'R', 'R', '\004', 'R', 'F', 'C', 'F', 'R', '\004', 'N', 'F', 'C', 'F', 'R', '\002', 'D', 'T', 'R',
+'\003', 'U', 'P', 'E', 'R', '\002', 'N', 'C', 'R', '\002', 'O', 'M', 'R', '\005', 'f', 'l', 'a', 'g', 's', ':', ':', '\232', '\305', '\210', '\036',
+'5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c',
+'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i',
+'l', 't', 'e', 'r', '\"', '\200', '\004', '\n', '\020', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r',
+'\022', ']', '\n', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001', ' ', '\003', '(', '\016', '2', '2', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'G', 'r', 'p',
+'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '.', 'S', 't', 'a', 't', 'u', 's', 'B', '\r', '\372', 'B', '\n',
+'\222', '\001', '\007', '\"', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\022', '\030', '\n', '\007', 'e',
+'x', 'c', 'l', 'u', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\007', 'e', 'x', 'c', 'l', 'u', 'd', 'e', '\"', '\270', '\002', '\n',
+'\006', 'S', 't', 'a', 't', 'u', 's', '\022', '\006', '\n', '\002', 'O', 'K', '\020', '\000', '\022', '\014', '\n', '\010', 'C', 'A', 'N', 'C', 'E', 'L',
+'E', 'D', '\020', '\001', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\002', '\022', '\024', '\n', '\020', 'I', 'N', 'V', 'A',
+'L', 'I', 'D', '_', 'A', 'R', 'G', 'U', 'M', 'E', 'N', 'T', '\020', '\003', '\022', '\025', '\n', '\021', 'D', 'E', 'A', 'D', 'L', 'I', 'N',
+'E', '_', 'E', 'X', 'C', 'E', 'E', 'D', 'E', 'D', '\020', '\004', '\022', '\r', '\n', '\t', 'N', 'O', 'T', '_', 'F', 'O', 'U', 'N', 'D',
+'\020', '\005', '\022', '\022', '\n', '\016', 'A', 'L', 'R', 'E', 'A', 'D', 'Y', '_', 'E', 'X', 'I', 'S', 'T', 'S', '\020', '\006', '\022', '\025', '\n',
+'\021', 'P', 'E', 'R', 'M', 'I', 'S', 'S', 'I', 'O', 'N', '_', 'D', 'E', 'N', 'I', 'E', 'D', '\020', '\007', '\022', '\026', '\n', '\022', 'R',
+'E', 'S', 'O', 'U', 'R', 'C', 'E', '_', 'E', 'X', 'H', 'A', 'U', 'S', 'T', 'E', 'D', '\020', '\010', '\022', '\027', '\n', '\023', 'F', 'A',
+'I', 'L', 'E', 'D', '_', 'P', 'R', 'E', 'C', 'O', 'N', 'D', 'I', 'T', 'I', 'O', 'N', '\020', '\t', '\022', '\013', '\n', '\007', 'A', 'B',
+'O', 'R', 'T', 'E', 'D', '\020', '\n', '\022', '\020', '\n', '\014', 'O', 'U', 'T', '_', 'O', 'F', '_', 'R', 'A', 'N', 'G', 'E', '\020', '\013',
+'\022', '\021', '\n', '\r', 'U', 'N', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N', 'T', 'E', 'D', '\020', '\014', '\022', '\014', '\n', '\010', 'I', 'N',
+'T', 'E', 'R', 'N', 'A', 'L', '\020', '\r', '\022', '\017', '\n', '\013', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\016',
+'\022', '\r', '\n', '\t', 'D', 'A', 'T', 'A', '_', 'L', 'O', 'S', 'S', '\020', '\017', '\022', '\023', '\n', '\017', 'U', 'N', 'A', 'U', 'T', 'H',
+'E', 'N', 'T', 'I', 'C', 'A', 'T', 'E', 'D', '\020', '\020', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.',
+'v', '2', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\332', '\001', '\n', '\016', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\022', '@', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '\022', 'N', '\n', '\026', 'm', 'a', 't', 'c', 'h', '_', 'i', 'f', '_', 'k', 'e', 'y', '_', 'n', 'o', 't', '_',
+'f', 'o', 'u', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 't', 'c', 'h', 'I', 'f', 'K', 'e',
+'y', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', ':', '6', '\232', '\305', '\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\266', '\001', '\n', '\017', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R',
+'\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001',
+'(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H',
+'\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l',
+'o', 'g', '.', 'v', '2', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013',
+'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g',
+'B', '\221', '\001', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', 'B', '\016', 'A', 'c', 'c', 'e',
+'s', 's', 'l', 'o', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'L', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/',
+'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a',
+'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g',
+'/', 'v', '3', ';', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
+'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[10] = {
+static _upb_DefPool_Init *deps[10] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_route_v3_route_components_proto_upbdefinit,
&envoy_type_matcher_v3_metadata_proto_upbdefinit,
@@ -243,9 +214,9 @@ static upb_def_init *deps[10] = {
NULL
};
-upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_accesslog_v3_accesslog_proto_upb_file_layout,
"envoy/config/accesslog/v3/accesslog.proto",
- UPB_STRVIEW_INIT(descriptor, 4388)
+ UPB_STRINGVIEW_INIT(descriptor, 4481)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h
index e868f90b..6d6c12e3 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h
@@ -19,81 +19,81 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_AccessLog_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.AccessLog");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_AccessLog_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.AccessLog");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_AccessLogFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.AccessLogFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_AccessLogFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.AccessLogFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_ComparisonFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.ComparisonFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_ComparisonFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.ComparisonFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_StatusCodeFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.StatusCodeFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_StatusCodeFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.StatusCodeFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_DurationFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.DurationFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_DurationFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.DurationFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_NotHealthCheckFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.NotHealthCheckFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_NotHealthCheckFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.NotHealthCheckFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_TraceableFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.TraceableFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_TraceableFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.TraceableFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_RuntimeFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.RuntimeFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_RuntimeFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.RuntimeFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_AndFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.AndFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_AndFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.AndFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_OrFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.OrFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_OrFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.OrFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_HeaderFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.HeaderFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_HeaderFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.HeaderFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_ResponseFlagFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.ResponseFlagFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_ResponseFlagFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.ResponseFlagFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_GrpcStatusFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.GrpcStatusFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_GrpcStatusFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.GrpcStatusFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_MetadataFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.MetadataFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_MetadataFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.MetadataFilter");
}
-UPB_INLINE const upb_msgdef *envoy_config_accesslog_v3_ExtensionFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.accesslog.v3.ExtensionFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_accesslog_v3_ExtensionFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_accesslog_v3_accesslog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.accesslog.v3.ExtensionFilter");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
index f86bfe76..11df2bf2 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
@@ -8,355 +8,364 @@
#include "upb/def.h"
#include "envoy/config/bootstrap/v3/bootstrap.upbdefs.h"
+#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
-extern upb_def_init envoy_config_cluster_v3_cluster_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
-extern upb_def_init envoy_config_listener_v3_listener_proto_upbdefinit;
-extern upb_def_init envoy_config_metrics_v3_stats_proto_upbdefinit;
-extern upb_def_init envoy_config_overload_v3_overload_proto_upbdefinit;
-extern upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_security_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Admin_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdogs_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_FatalAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Runtime_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit;
-
-static const upb_msglayout *layouts[17] = {
- &envoy_config_bootstrap_v3_Bootstrap_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
- &envoy_config_bootstrap_v3_Admin_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
- &envoy_config_bootstrap_v3_Watchdogs_msginit,
- &envoy_config_bootstrap_v3_Watchdog_msginit,
- &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
- &envoy_config_bootstrap_v3_FatalAction_msginit,
- &envoy_config_bootstrap_v3_Runtime_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
- &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
-};
-
-static const char descriptor[6993] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
+extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_cluster_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_event_service_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_resolver_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_listener_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_metrics_v3_stats_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_overload_v3_overload_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[8017] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
'v', '3', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '\032', '%', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
-'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
-'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
-'/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v', 'e', 'n', 't', '_', 's',
-'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o',
-'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
-'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3',
-'/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
-'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd',
-'/', 'v', '3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y',
-'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 't', 'r', 'a',
-'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/',
-'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y',
-'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g',
-'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w',
-'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
-'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i',
-'d', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\341', '\026', '\n', '\t', 'B',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e',
-'R', '\004', 'n', 'o', 'd', 'e', '\022', '.', '\n', '\023', 'n', 'o', 'd', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a',
-'r', 'a', 'm', 's', '\030', '\032', ' ', '\003', '(', '\t', 'R', '\021', 'n', 'o', 'd', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a',
-'r', 'a', 'm', 's', '\022', '_', '\n', '\020', 's', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
-'s', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c',
-'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'R', '\017', 's', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
-'s', '\022', 'b', '\n', '\021', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\003', ' ',
-'\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
-'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'R', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
-'s', '\022', 'R', '\n', '\017', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\004', ' ', '\001', '(',
-'\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\016', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\n', 'h', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\016', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'h', 'd', 's', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'f', 'l', 'a', 'g', 's', '_', 'p', 'a', 't', 'h', '\030', '\005', ' ', '\001', '(', '\t',
-'R', '\t', 'f', 'l', 'a', 'g', 's', 'P', 'a', 't', 'h', '\022', 'C', '\n', '\013', 's', 't', 'a', 't', 's', '_', 's', 'i', 'n', 'k',
-'s', '\030', '\006', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e',
-'t', 'r', 'i', 'c', 's', '.', 'v', '3', '.', 'S', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 'R', '\n', 's', 't', 'a', 't', 's',
-'S', 'i', 'n', 'k', 's', '\022', 'G', '\n', '\014', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\001',
-'(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's',
-'.', 'v', '3', '.', 'S', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 's', 't', 'a', 't', 's', 'C', 'o', 'n',
-'f', 'i', 'g', '\022', 'q', '\n', '\024', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v',
-'a', 'l', '\030', '\007', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '$', '\372', 'B', '\016', '\252', '\001', '\013', '\032', '\003', '\010', '\254', '\002', '2', '\004',
-'\020', '\300', '\204', '=', '\362', '\230', '\376', '\217', '\005', '\r', '\022', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'R', '\022',
-'s', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', ':', '\n', '\024', 's', 't', 'a',
-'t', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'o', 'n', '_', 'a', 'd', 'm', 'i', 'n', '\030', '\035', ' ', '\001', '(', '\010', 'B', '\007',
-'\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\021', 's', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'O', 'n', 'A', 'd',
-'m', 'i', 'n', '\022', 'C', '\n', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '#', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.',
-'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'B', '\002', '\030', '\001', 'R', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'B', '\n',
-'\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\030', '\033', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h',
-'d', 'o', 'g', 's', 'R', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', '<', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n',
-'g', '\030', '\t', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
-'a', 'c', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '\002', '\030', '\001', 'R', '\007', 't', 'r', 'a', 'c', 'i',
-'n', 'g', '\022', 'R', '\n', '\017', 'l', 'a', 'y', 'e', 'r', 'e', 'd', '_', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\030', '\021', ' ', '\001',
-'(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r',
-'a', 'p', '.', 'v', '3', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'R', '\016', 'l', 'a', 'y',
-'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '6', '\n', '\005', 'a', 'd', 'm', 'i', 'n', '\030', '\014', ' ', '\001', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'A', 'd', 'm', 'i', 'n', 'R', '\005', 'a', 'd', 'm', 'i', 'n', '\022', 'd', '\n', '\020', 'o', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\017', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\016', '\212', '\223', '\267', '*', '\002', '\010', '\001', '\212', '\223', '\267', '*', '\002',
-'\020', '\001', 'R', '\017', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', '6', '\n', '\027', 'e', 'n',
-'a', 'b', 'l', 'e', '_', 'd', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '\020', ' ', '\001',
-'(', '\010', 'R', '\025', 'e', 'n', 'a', 'b', 'l', 'e', 'D', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r', 'S', 't', 'a', 't', 's',
-'\022', '#', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\022', ' ', '\001', '(', '\t', 'R', '\014',
-'h', 'e', 'a', 'd', 'e', 'r', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '_', '\n', '\035', 's', 't', 'a', 't', 's', '_', 's', 'e', 'r',
-'v', 'e', 'r', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030', '\023', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6',
-'4', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 's', 't', 'a', 't', 's', 'S', 'e', 'r', 'v', 'e', 'r', 'V', 'e', 'r', 's', 'i', 'o',
-'n', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', '4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_',
-'d', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '\024', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p',
-'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', ']', '\n', '\024', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', 'K', '\n', '\r', 'f', 'a', 't', 'a', 'l', '_', 'a', 'c', 't', 'i', 'o', 'n', 's',
-'\030', '\034', ' ', '\003', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o',
-'t', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'F', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\014', 'f', 'a',
-'t', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 's', '\022', 'I', '\n', '\016', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r',
-'c', 'e', 's', '\030', '\026', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\r', 'c', 'o', 'n',
-'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'V', '\n', '\025', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\027', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r',
-'c', 'e', 'R', '\023', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8',
-'\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'i', 'n', 't', 'e', 'r', 'f', 'a', 'c',
-'e', '\030', '\030', ' ', '\001', '(', '\t', 'R', '\026', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'o', 'c', 'k', 'e', 't', 'I', 'n', 't',
-'e', 'r', 'f', 'a', 'c', 'e', '\022', '\214', '\001', '\n', '\036', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r',
-'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', 'F', '.',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '\032', ')', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/', 'v', '3', '/', 'a', 'c',
+'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
+'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g',
+'_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v', 'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n',
+'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', '/', 's', 't', 'a', 't',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e',
+'r', 'l', 'o', 'a', 'd', '/', 'v', '3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'',
+'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h', 't', 't',
+'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's',
+'/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v',
+'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's',
+'t', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm',
+'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
+'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\336', '\031', '\n', '\t', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
+'\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e', '\022', '.',
+'\n', '\023', 'n', 'o', 'd', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\032', ' ', '\003',
+'(', '\t', 'R', '\021', 'n', 'o', 'd', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '_', '\n', '\020',
+'s', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '4', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3',
-'.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o',
-'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\034', 'c', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\032',
-'\232', '\002', '\n', '\017', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', '@', '\n', '\t', 'l', 'i',
-'s', 't', 'e', 'n', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'R',
-'\t', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', '<', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\002', ' ',
-'\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e',
-'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'K', '\n',
-'\007', 's', 'e', 'c', 'r', 'e', 't', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
-'s', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'e', 'c', 'r', 'e', 't', 'R', '\007', 's', 'e', 'c', 'r', 'e', 't', 's', ':',
-':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
-'s', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c',
-'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\032', '\211', '\003', '\n', '\020', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o',
-'u', 'r', 'c', 'e', 's', '\022', 'A', '\n', '\n', 'l', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013',
+'.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+'s', 'R', '\017', 's', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'b', '\n', '\021', 'd', 'y', 'n',
+'a', 'm', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B',
+'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's',
+'R', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'R', '\n', '\017', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g',
+'e', 'r', '\022', 'D', '\n', '\n', 'h', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\016', ' ', '\001', '(', '\013', '2', '%', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'h', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n',
+'\n', 'f', 'l', 'a', 'g', 's', '_', 'p', 'a', 't', 'h', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\t', 'f', 'l', 'a', 'g', 's', 'P',
+'a', 't', 'h', '\022', 'C', '\n', '\013', 's', 't', 'a', 't', 's', '_', 's', 'i', 'n', 'k', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+'\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3',
+'.', 'S', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 'R', '\n', 's', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 's', '\022', 'G', '\n',
+'\014', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', '.', 'S', 't', 'a', 't',
+'s', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 's', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'q', '\n', '\024', 's',
+'t', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\007', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'B', '$', '\372', 'B', '\016', '\252', '\001', '\013', '\032', '\003', '\010', '\254', '\002', '2', '\004', '\020', '\300', '\204', '=', '\362', '\230', '\376', '\217',
+'\005', '\r', '\022', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'R', '\022', 's', 't', 'a', 't', 's', 'F', 'l', 'u',
+'s', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', ':', '\n', '\024', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h',
+'_', 'o', 'n', '_', 'a', 'd', 'm', 'i', 'n', '\030', '\035', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H',
+'\000', 'R', '\021', 's', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'O', 'n', 'A', 'd', 'm', 'i', 'n', '\022', 'L', '\n', '\010', 'w',
+'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g',
+'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'B',
+'\n', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\030', '\033', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c',
+'h', 'd', 'o', 'g', 's', 'R', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'E', '\n', '\007', 't', 'r', 'a', 'c', 'i',
+'n', 'g', '\030', '\t', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't',
+'r', 'a', 'c', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003',
+'3', '.', '0', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 'R', '\n', '\017', 'l', 'a', 'y', 'e', 'r', 'e', 'd', '_', 'r',
+'u', 'n', 't', 'i', 'm', 'e', '\030', '\021', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u',
+'n', 't', 'i', 'm', 'e', 'R', '\016', 'l', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '6', '\n', '\005',
+'a', 'd', 'm', 'i', 'n', '\030', '\014', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'A', 'd', 'm', 'i', 'n', 'R', '\005', 'a', 'd', 'm',
+'i', 'n', '\022', 'd', '\n', '\020', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\017', ' ',
+'\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o',
+'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\016', '\212', '\223',
+'\267', '*', '\002', '\010', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\017', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n',
+'a', 'g', 'e', 'r', '\022', '6', '\n', '\027', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'd', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r',
+'_', 's', 't', 'a', 't', 's', '\030', '\020', ' ', '\001', '(', '\010', 'R', '\025', 'e', 'n', 'a', 'b', 'l', 'e', 'D', 'i', 's', 'p', 'a',
+'t', 'c', 'h', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '#', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'p', 'r', 'e', 'f',
+'i', 'x', '\030', '\022', ' ', '\001', '(', '\t', 'R', '\014', 'h', 'e', 'a', 'd', 'e', 'r', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '_', '\n',
+'\035', 's', 't', 'a', 't', 's', '_', 's', 'e', 'r', 'v', 'e', 'r', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'o', 'v', 'e',
+'r', 'r', 'i', 'd', 'e', '\030', '\023', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 's', 't', 'a', 't', 's', 'S', 'e',
+'r', 'v', 'e', 'r', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'A', '\n', '\027', 'u', 's',
+'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '\024', ' ', '\001',
+'(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o',
+'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', 'j', '\n', '\025', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'u',
+'t', 'i', 'o', 'n', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\036', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u',
+'t', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023',
+'d', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\031', 't', 'y',
+'p', 'e', 'd', '_', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\037',
+' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\026',
+'t', 'y', 'p', 'e', 'd', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ']', '\n',
+'\024', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\003',
+'(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'o',
+'o', 't', 's', 't', 'r', 'a', 'p', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', 'K', '\n', '\r', 'f', 'a', 't', 'a',
+'l', '_', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\034', ' ', '\003', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'F', 'a', 't', 'a', 'l', 'A',
+'c', 't', 'i', 'o', 'n', 'R', '\014', 'f', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 's', '\022', 'I', '\n', '\016', 'c', 'o',
+'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\026', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o',
+'u', 'r', 'c', 'e', 'R', '\r', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'V', '\n', '\025', 'd', 'e',
+'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\027', ' ', '\001', '(', '\013',
'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n',
-'\025', 'l', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\005', ' ',
-'\001', '(', '\t', 'R', '\023', 'l', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022',
-'A', '\n', '\n', 'c', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S',
-'o', 'u', 'r', 'c', 'e', 'R', '\t', 'c', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n', '\025', 'c', 'd', 's', '_', 'r',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\023', 'c',
-'d', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'D', '\n', '\n', 'a', 'd', 's',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r',
-'c', 'e', 'R', '\t', 'a', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o',
-'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'J',
-'\004', '\010', '\004', '\020', '\005', '\032', '{', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i',
-'d', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '@', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T',
-'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\005', 'v', 'a', 'l', 'u',
-'e', ':', '\002', '8', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'B',
-'\r', '\n', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'J', '\004', '\010', '\n', '\020', '\013', 'J', '\004', '\010', '\013', '\020',
-'\014', 'R', '\007', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\376', '\001', '\n', '\005', 'A', 'd', 'm', 'i', 'n', '\022', '&', '\n', '\017', 'a',
-'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\r', 'a', 'c', 'c',
-'e', 's', 's', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', '!', '\n', '\014', 'p', 'r', 'o', 'f', 'i', 'l', 'e', '_', 'p', 'a', 't',
-'h', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 'p', 'r', 'o', 'f', 'i', 'l', 'e', 'P', 'a', 't', 'h', '\022', '7', '\n', '\007', 'a',
-'d', 'd', 'r', 'e', 's', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e',
-'s', 's', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\003', '(',
-'\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o',
-'n', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'A', 'd', 'm', 'i', 'n', '\"', '\313', '\004', '\n', '\016', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', ',', '\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'c', 'l', 'u', 's',
-'t', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\020', 'l', 'o', 'c', 'a', 'l', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'g', '\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't',
-'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l',
-'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_',
-'b', 'i', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i',
-'g', 'R', '\022', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Q', '\n', '\021',
-'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '%',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i',
-'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\017', 'l', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'C', 'o',
-'n', 'f', 'i', 'g', '\032', '\311', '\001', '\n', '\020', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
-'\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R',
-'\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't', '_', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n',
-'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', ':', '@', '\232', '\305', '\210', '\036', ';', '\n',
-'9', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
-'2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D',
-'e', 't', 'e', 'c', 't', 'i', 'o', 'n', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
-'M', 'a', 'n', 'a', 'g', 'e', 'r', '\"', '\260', '\001', '\n', '\t', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'U', '\n', '\024',
-'m', 'a', 'i', 'n', '_', 't', 'h', 'r', 'e', 'a', 'd', '_', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\001', ' ', '\001', '(',
-'\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\022', 'm', 'a', 'i', 'n', 'T', 'h', 'r', 'e', 'a', 'd',
-'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n', '\017', 'w', 'o', 'r', 'k', 'e', 'r', '_', 'w', 'a', 't', 'c', 'h', 'd',
-'o', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\016', 'w', 'o', 'r',
-'k', 'e', 'r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\"', '\272', '\006', '\n', '\010', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022',
-'L', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h',
-'d', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o',
-'n', 's', '\022', '<', '\n', '\014', 'm', 'i', 's', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'R', '\013', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'D', '\n', '\020', 'm', 'e', 'g', 'a', 'm', 'i', 's',
-'s', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'm', 'e', 'g', 'a', 'm', 'i',
-'s', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't',
-'\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'k', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Z', '\n', '\027',
-'m', 'a', 'x', '_', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\006',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000', 'R', '\024', 'm', 'a', 'x', 'K', 'i', 'l', 'l',
-'T', 'i', 'm', 'e', 'o', 'u', 't', 'J', 'i', 't', 't', 'e', 'r', '\022', 'F', '\n', '\021', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l',
-'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\020', 'm', 'u', 'l', 't', 'i', 'k',
-'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'G', '\n', '\023', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't',
-'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\022', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T',
-'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\032', '\205', '\002', '\n', '\016', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i',
-'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '`', '\n', '\005', 'e',
-'v', 'e', 'n', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a',
-'t', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n',
-'t', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\005', 'e', 'v', 'e', 'n', 't', '\"', 'M', '\n', '\r', 'W', 'a', 't',
-'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\010',
-'\n', '\004', 'K', 'I', 'L', 'L', '\020', '\001', '\022', '\r', '\n', '\t', 'M', 'U', 'L', 'T', 'I', 'K', 'I', 'L', 'L', '\020', '\002', '\022', '\014',
-'\n', '\010', 'M', 'E', 'G', 'A', 'M', 'I', 'S', 'S', '\020', '\003', '\022', '\010', '\n', '\004', 'M', 'I', 'S', 'S', '\020', '\004', ':', ')', '\232',
-'\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
-'r', 'a', 'p', '.', 'v', '2', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\"', 'Q', '\n', '\013', 'F', 'a', 't', 'a', 'l', 'A',
-'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd',
-'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\334',
-'\001', '\n', '\007', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '!', '\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\023', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i',
+'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
+'_', 'i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', '\030', '\030', ' ', '\001', '(', '\t', 'R', '\026', 'd', 'e', 'f', 'a', 'u', 'l', 't',
+'S', 'o', 'c', 'k', 'e', 't', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', '\022', '\214', '\001', '\n', '\036', 'c', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 's',
+'\030', '\031', ' ', '\003', '(', '\013', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o',
+'t', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'C', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n',
+'t', 'r', 'y', 'R', '\034', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I',
+'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\022', 'T', '\n', '\016', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
+'s', '\030', ' ', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o',
+'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e',
+'a', 'd', 'e', 'r', 'R', '\r', 'i', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '3', '\n', '\026', 'p', 'e',
+'r', 'f', '_', 't', 'r', 'a', 'c', 'i', 'n', 'g', '_', 'f', 'i', 'l', 'e', '_', 'p', 'a', 't', 'h', '\030', '!', ' ', '\001', '(',
+'\t', 'R', '\023', 'p', 'e', 'r', 'f', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'F', 'i', 'l', 'e', 'P', 'a', 't', 'h', '\032', '\232', '\002',
+'\n', '\017', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', '@', '\n', '\t', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'R', '\t', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', '<', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\002', ' ', '\003', '(',
+'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
+'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'K', '\n', '\007', 's',
+'e', 'c', 'r', 'e', 't', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', '.', 'S', 'e', 'c', 'r', 'e', 't', 'R', '\007', 's', 'e', 'c', 'r', 'e', 't', 's', ':', ':', '\232',
+'\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
+'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', 's', '\032', '\211', '\003', '\n', '\020', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r',
+'c', 'e', 's', '\022', 'A', '\n', '\n', 'l', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n',
+'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n', '\025', 'l',
+'d', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\005', ' ', '\001', '(',
+'\t', 'R', '\023', 'l', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'A', '\n',
+'\n', 'c', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u',
+'r', 'c', 'e', 'R', '\t', 'c', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n', '\025', 'c', 'd', 's', '_', 'r', 'e', 's',
+'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\023', 'c', 'd', 's',
+'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'D', '\n', '\n', 'a', 'd', 's', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e',
+'R', '\t', 'a', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't',
+'s', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'J', '\004', '\010',
+'\004', '\020', '\005', '\032', '{', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e',
+'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ',
+'\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '@', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '*',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p',
+'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':',
+'\002', '8', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'B', '\r', '\n',
+'\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'J', '\004', '\010', '\n', '\020', '\013', 'J', '\004', '\010', '\013', '\020', '\014', 'R',
+'\007', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\211', '\003', '\n', '\005', 'A', 'd', 'm', 'i', 'n', '\022', 'C', '\n', '\n', 'a', 'c', 'c',
+'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\005', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o',
+'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', '3', '\n', '\017', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o',
+'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'R', '\r', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', '!', '\n', '\014', 'p', 'r', 'o', 'f', 'i', 'l',
+'e', '_', 'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 'p', 'r', 'o', 'f', 'i', 'l', 'e', 'P', 'a', 't', 'h',
+'\022', '7', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007',
+'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's',
+'\030', '\004', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't',
+'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '7', '\n', '\030', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'g', 'l', 'o', 'b', 'a', 'l', '_',
+'c', 'o', 'n', 'n', '_', 'l', 'i', 'm', 'i', 't', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\025', 'i', 'g', 'n', 'o', 'r', 'e', 'G',
+'l', 'o', 'b', 'a', 'l', 'C', 'o', 'n', 'n', 'L', 'i', 'm', 'i', 't', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'A',
+'d', 'm', 'i', 'n', '\"', '\313', '\004', '\n', '\016', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', ',',
+'\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'R', '\020', 'l', 'o', 'c', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'g', '\n', '\021', 'o', 'u',
+'t', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.',
+'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't',
+'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022',
+'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003',
+' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i',
+'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Q', '\n', '\021', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '_', 'c', 'o',
+'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R',
+'\017', 'l', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\311', '\001', '\n', '\020', 'O', 'u', 't', 'l',
+'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l', 'o', 'g',
+'_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a', 't', 'h',
+'\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '(',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'v', 'e',
+'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S', 'e', 'r',
+'v', 'i', 'c', 'e', ':', '@', '\232', '\305', '\210', '\036', ';', '\n', '9', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a',
+'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', ':', '/', '\232', '\305', '\210',
+'\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
+'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\"', '\260', '\001', '\n', '\t', 'W',
+'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'U', '\n', '\024', 'm', 'a', 'i', 'n', '_', 't', 'h', 'r', 'e', 'a', 'd', '_', 'w',
+'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g',
+'R', '\022', 'm', 'a', 'i', 'n', 'T', 'h', 'r', 'e', 'a', 'd', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n', '\017', 'w',
+'o', 'r', 'k', 'e', 'r', '_', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W',
+'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\016', 'w', 'o', 'r', 'k', 'e', 'r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\"', '\272',
+'\006', '\n', '\010', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ',
+'\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
+'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A',
+'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'm', 'i', 's', 's', '_', 't', 'i',
+'m', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e', 'o', 'u',
+'t', '\022', 'D', '\n', '\020', 'm', 'e', 'g', 'a', 'm', 'i', 's', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'R', '\017', 'm', 'e', 'g', 'a', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014',
+'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'k', 'i', 'l',
+'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Z', '\n', '\027', 'm', 'a', 'x', '_', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e',
+'o', 'u', 't', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001',
+'\002', '2', '\000', 'R', '\024', 'm', 'a', 'x', 'K', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'J', 'i', 't', 't', 'e', 'r',
+'\022', 'F', '\n', '\021', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'R', '\020', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'G', '\n',
+'\023', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(',
+'\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't',
+'R', '\022', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\032', '\205', '\002', '\n', '\016',
+'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
+'\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '`', '\n', '\005', 'e', 'v', 'e', 'n', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '@', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3',
+'.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', '.',
+'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\005',
+'e', 'v', 'e', 'n', 't', '\"', 'M', '\n', '\r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', '\022', '\013', '\n',
+'\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\010', '\n', '\004', 'K', 'I', 'L', 'L', '\020', '\001', '\022', '\r', '\n', '\t', 'M',
+'U', 'L', 'T', 'I', 'K', 'I', 'L', 'L', '\020', '\002', '\022', '\014', '\n', '\010', 'M', 'E', 'G', 'A', 'M', 'I', 'S', 'S', '\020', '\003', '\022',
+'\010', '\n', '\004', 'M', 'I', 'S', 'S', '\020', '\004', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'W', 'a', 't', 'c', 'h', 'd',
+'o', 'g', '\"', 'Q', '\n', '\013', 'F', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\334', '\001', '\n', '\007', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '!', '\n',
+'\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm', 'l',
+'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\002',
+' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '3', '\n', '\025', 'o', 'v', 'e',
+'r', 'r', 'i', 'd', 'e', '_', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R',
+'\024', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '+', '\n', '\004',
+'b', 'a', 's', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\004', 'b', 'a', 's', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2',
+'.', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\333', '\006', '\n', '\014', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r',
+'\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004',
+'n', 'a', 'm', 'e', '\022', '<', '\n', '\014', 's', 't', 'a', 't', 'i', 'c', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\002', ' ', '\001', '(',
+'\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c',
+'t', 'H', '\000', 'R', '\013', 's', 't', 'a', 't', 'i', 'c', 'L', 'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'd', 'i', 's', 'k', '_',
+'l', 'a', 'y', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y',
+'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t', 'd', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r',
+'\022', 'U', '\n', '\013', 'a', 'd', 'm', 'i', 'n', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '2', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.',
+'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', 'H', '\000',
+'R', '\n', 'a', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'r', 't', 'd', 's', '_', 'l', 'a', 'y', 'e',
+'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o',
+'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'R',
+'t', 'd', 's', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t', 'r', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\032', '\301', '\001', '\n',
+'\t', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', '!', '\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o',
't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm', 'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's',
-'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r',
-'e', 'c', 't', 'o', 'r', 'y', '\022', '3', '\n', '\025', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'u', 'b', 'd', 'i', 'r',
-'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\024', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 'u', 'b',
-'d', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '+', '\n', '\004', 'b', 'a', 's', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\027',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\004',
-'b', 'a', 's', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\333', '\006', '\n',
-'\014', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
-'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '<', '\n', '\014', 's', 't', 'a', 't',
-'i', 'c', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'H', '\000', 'R', '\013', 's', 't', 'a', 't', 'i', 'c', 'L',
-'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'd', 'i', 's', 'k', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2',
-'1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.',
-'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r',
-'H', '\000', 'R', '\t', 'd', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', 'U', '\n', '\013', 'a', 'd', 'm', 'i', 'n', '_', 'l', 'a',
-'y', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r',
-'.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\n', 'a', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r',
-'\022', 'R', '\n', '\n', 'r', 't', 'd', 's', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t',
-'r', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\032', '\301', '\001', '\n', '\t', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', '!',
-'\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm',
-'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030',
-'\003', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '4', '\n', '\026', 'a', 'p',
-'p', 'e', 'n', 'd', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(',
-'\010', 'R', '\024', 'a', 'p', 'p', 'e', 'n', 'd', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '7',
-'\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's',
-'t', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k',
-'L', 'a', 'y', 'e', 'r', '\032', 'F', '\n', '\n', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', ':', '8', '\232', '\305', '\210', '\036',
-'3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
-'.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y',
-'e', 'r', '\032', '\235', '\001', '\n', '\t', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'C', '\n', '\013', 'r', 't', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'r', 't', 'd', 's', 'C',
-'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y',
-'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'B', '\026', '\n', '\017', 'l', 'a', 'y', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f',
-'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\202', '\001', '\n', '\016', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i',
-'m', 'e', '\022', '?', '\n', '\006', 'l', 'a', 'y', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'R', '\006', 'l', 'a', 'y', 'e', 'r', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n',
-'(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
-'2', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n',
-'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o',
-'t', 's', 't', 'r', 'a', 'p', '.', 'v', '3', 'B', '\016', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'P', 'r', 'o', 't', 'o',
-'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r',
+'e', 'c', 't', 'o', 'r', 'y', '\022', '4', '\n', '\026', 'a', 'p', 'p', 'e', 'n', 'd', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_',
+'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\024', 'a', 'p', 'p', 'e', 'n', 'd', 'S', 'e', 'r', 'v',
+'i', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i',
+'m', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\032', 'F', '\n', '\n', 'A', 'd', 'm', 'i',
+'n', 'L', 'a', 'y', 'e', 'r', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a',
+'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', '\032', '\235', '\001', '\n', '\t', 'R', 't', 'd', 's', 'L', 'a',
+'y', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'C',
+'\n', '\013', 'r', 't', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S',
+'o', 'u', 'r', 'c', 'e', 'R', '\n', 'r', 't', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n',
+'0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
+'2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', ':',
+'-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
+'s', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'B', '\026', '\n', '\017',
+'l', 'a', 'y', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\202', '\001', '\n', '\016',
+'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '?', '\n', '\006', 'l', 'a', 'y', 'e', 'r', 's', '\030',
+'\001', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
+'s', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'R', '\006', 'l', 'a',
+'y', 'e', 'r', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't',
+'i', 'm', 'e', '\"', '\261', '\002', '\n', '\022', 'C', 'u', 's', 't', 'o', 'm', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e',
+'r', '\022', ';', '\n', '\022', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001',
+' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\020', 'i', 'n', 'l', 'i',
+'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'v', '\n', '\022', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'h', 'e',
+'a', 'd', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm',
+'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '.', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r',
+'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\020', 'i', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a',
+'d', 'e', 'r', 'T', 'y', 'p', 'e', '\"', 'f', '\n', '\020', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'y',
+'p', 'e', '\022', '\022', '\n', '\016', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\000', '\022', '\023', '\n',
+'\017', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '_', 'T', 'R', 'A', 'I', 'L', 'E', 'R', '\020', '\001', '\022', '\023', '\n', '\017', 'R', 'E', 'S',
+'P', 'O', 'N', 'S', 'E', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\002', '\022', '\024', '\n', '\020', 'R', 'E', 'S', 'P', 'O', 'N', 'S',
+'E', '_', 'T', 'R', 'A', 'I', 'L', 'E', 'R', '\020', '\003', 'B', '\221', '\001', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r',
+'a', 'p', '.', 'v', '3', 'B', '\016', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'L',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-',
+'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/', 'v', '3', ';', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'v',
+'3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[22] = {
+static _upb_DefPool_Init *deps[25] = {
+ &envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_cluster_v3_cluster_proto_upbdefinit,
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_config_core_v3_event_service_config_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_core_v3_resolver_proto_upbdefinit,
&envoy_config_core_v3_socket_option_proto_upbdefinit,
&envoy_config_listener_v3_listener_proto_upbdefinit,
&envoy_config_metrics_v3_stats_proto_upbdefinit,
@@ -367,6 +376,7 @@ static upb_def_init *deps[22] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -375,9 +385,9 @@ static upb_def_init *deps[22] = {
NULL
};
-upb_def_init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout,
"envoy/config/bootstrap/v3/bootstrap.proto",
- UPB_STRVIEW_INIT(descriptor, 6993)
+ UPB_STRINGVIEW_INIT(descriptor, 8017)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
index 666cbed1..d176854c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
@@ -19,91 +19,96 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Bootstrap_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Bootstrap");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Bootstrap_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Bootstrap");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Bootstrap_StaticResources_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Bootstrap.StaticResources");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Bootstrap_StaticResources_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Bootstrap.StaticResources");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Bootstrap.DynamicResources");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Bootstrap.DynamicResources");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Bootstrap.CertificateProviderInstancesEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Bootstrap.CertificateProviderInstancesEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Admin_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Admin");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Admin_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Admin");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_ClusterManager_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.ClusterManager");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_ClusterManager_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.ClusterManager");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.ClusterManager.OutlierDetection");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.ClusterManager.OutlierDetection");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Watchdogs_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Watchdogs");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Watchdogs_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Watchdogs");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Watchdog_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Watchdog");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Watchdog_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Watchdog");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Watchdog.WatchdogAction");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Watchdog.WatchdogAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_FatalAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.FatalAction");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_FatalAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.FatalAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_Runtime_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.Runtime");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_Runtime_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.Runtime");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_RuntimeLayer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.RuntimeLayer");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_RuntimeLayer_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.RuntimeLayer");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.RuntimeLayer.DiskLayer");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.RuntimeLayer.DiskLayer");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.RuntimeLayer.AdminLayer");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.RuntimeLayer.AdminLayer");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.RuntimeLayer.RtdsLayer");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.RuntimeLayer.RtdsLayer");
}
-UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_LayeredRuntime_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.LayeredRuntime");
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_LayeredRuntime_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.LayeredRuntime");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_bootstrap_v3_CustomInlineHeader_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.bootstrap.v3.CustomInlineHeader");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
index baca9f3e..0390b67c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
@@ -8,24 +8,15 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/circuit_breaker.upbdefs.h"
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_config_cluster_v3_CircuitBreakers_msginit,
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
-};
-
-static const char descriptor[1364] = {'\n', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1540] = {'\n', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '\037', 'e',
'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.',
@@ -35,54 +26,61 @@ static const char descriptor[1364] = {'\n', '-', 'e', 'n', 'v', 'o', 'y', '/', '
'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\200', '\010', '\n', '\017', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\345', '\010', '\n', '\017', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e',
'r', 's', '\022', 'S', '\n', '\n', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '3', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's',
-'R', '\n', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '\032', '\352', '\006', '\n', '\n', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l',
-'d', 's', '\022', 'K', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'i', 'n',
-'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 'p', 'r', 'i', 'o',
-'r', 'i', 't', 'y', '\022', 'E', '\n', '\017', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '\030', '\002',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's',
-'\022', 'N', '\n', '\024', 'm', 'a', 'x', '_', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030',
-'\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 'x', 'P', 'e', 'n', 'd', 'i', 'n', 'g', 'R', 'e', 'q',
-'u', 'e', 's', 't', 's', '\022', '?', '\n', '\014', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\004', ' ', '\001',
-'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
-'3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '=', '\n', '\013', 'm',
-'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'm', 'a',
-'x', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022', 'b', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'b', 'u', 'd', 'g', 'e', 't', '\030',
-'\010', ' ', '\001', '(', '\013', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T', 'h',
-'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '.', 'R', 'e', 't', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', 'R', '\013', 'r', 'e', 't',
-'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', '\022', '\'', '\n', '\017', 't', 'r', 'a', 'c', 'k', '_', 'r', 'e', 'm', 'a', 'i', 'n', 'i',
-'n', 'g', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\016', 't', 'r', 'a', 'c', 'k', 'R', 'e', 'm', 'a', 'i', 'n', 'i', 'n', 'g', '\022',
-'N', '\n', '\024', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'o', 'o', 'l', 's', '\030', '\007',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P',
-'o', 'o', 'l', 's', '\032', '\342', '\001', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', '\022', '=', '\n', '\016', 'b',
-'u', 'd', 'g', 'e', 't', '_', 'p', 'e', 'r', 'c', 'e', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v',
-'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\r', 'b', 'u', 'd', 'g', 'e',
-'t', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'P', '\n', '\025', 'm', 'i', 'n', '_', 'r', 'e', 't', 'r', 'y', '_', 'c', 'o', 'n',
-'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\023', 'm', 'i', 'n', 'R',
-'e', 't', 'r', 'y', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', ':', 'B', '\232', '\305', '\210', '\036', '=', '\n', ';', 'e',
+'R', '\n', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '\022', 'c', '\n', '\023', 'p', 'e', 'r', '_', 'h', 'o', 's', 't', '_',
+'t', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't',
+'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', 'R', '\021', 'p', 'e', 'r', 'H',
+'o', 's', 't', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '\032', '\352', '\006', '\n', '\n', 'T', 'h', 'r', 'e', 's', 'h', 'o',
+'l', 'd', 's', '\022', 'K', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'i',
+'n', 'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 'p', 'r', 'i',
+'o', 'r', 'i', 't', 'y', '\022', 'E', '\n', '\017', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'s', '\022', 'N', '\n', '\024', 'm', 'a', 'x', '_', 'p', 'e', 'n', 'd', 'i', 'n', 'g', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 'x', 'P', 'e', 'n', 'd', 'i', 'n', 'g', 'R', 'e',
+'q', 'u', 'e', 's', 't', 's', '\022', '?', '\n', '\014', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\004', ' ',
+'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
+'t', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '=', '\n', '\013',
+'m', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'm',
+'a', 'x', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022', 'b', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'b', 'u', 'd', 'g', 'e', 't',
+'\030', '\010', ' ', '\001', '(', '\013', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T',
+'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '.', 'R', 'e', 't', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', 'R', '\013', 'r', 'e',
+'t', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', '\022', '\'', '\n', '\017', 't', 'r', 'a', 'c', 'k', '_', 'r', 'e', 'm', 'a', 'i', 'n',
+'i', 'n', 'g', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\016', 't', 'r', 'a', 'c', 'k', 'R', 'e', 'm', 'a', 'i', 'n', 'i', 'n', 'g',
+'\022', 'N', '\n', '\024', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'o', 'o', 'l', 's', '\030',
+'\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'P', 'o', 'o', 'l', 's', '\032', '\342', '\001', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', '\022', '=', '\n', '\016',
+'b', 'u', 'd', 'g', 'e', 't', '_', 'p', 'e', 'r', 'c', 'e', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\r', 'b', 'u', 'd', 'g',
+'e', 't', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'P', '\n', '\025', 'm', 'i', 'n', '_', 'r', 'e', 't', 'r', 'y', '_', 'c', 'o',
+'n', 'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\023', 'm', 'i', 'n',
+'R', 'e', 't', 'r', 'y', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', ':', 'B', '\232', '\305', '\210', '\036', '=', '\n', ';',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'i', 'r', 'c',
+'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '.', 'R', 'e',
+'t', 'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', ':', '6', '\232', '\305', '\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a',
+'k', 'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e',
'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'i', 'r', 'c', 'u',
-'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', '.', 'R', 'e', 't',
-'r', 'y', 'B', 'u', 'd', 'g', 'e', 't', ':', '6', '\232', '\305', '\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k',
-'e', 'r', 's', '.', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'i', 'r', 'c', 'u', 'i',
-'t', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', 'B', 'F', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
-'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
-'B', '\023', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', 'B', '\220', '\001', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
+'v', '3', 'B', '\023', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', ';', 'c', 'l', 'u', 's', 't', 'e', 'r', 'v', '3', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[7] = {
+static _upb_DefPool_Init *deps[7] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
@@ -92,9 +90,9 @@ static upb_def_init *deps[7] = {
NULL
};
-upb_def_init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout,
"envoy/config/cluster/v3/circuit_breaker.proto",
- UPB_STRVIEW_INIT(descriptor, 1364)
+ UPB_STRINGVIEW_INIT(descriptor, 1540)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h
index f6b6032b..e5150bb5 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_CircuitBreakers_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.CircuitBreakers");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_CircuitBreakers_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.CircuitBreakers");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_CircuitBreakers_Thresholds_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.CircuitBreakers.Thresholds");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_CircuitBreakers_Thresholds_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.CircuitBreakers.Thresholds");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.CircuitBreakers.Thresholds.RetryBudget");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.CircuitBreakers.Thresholds.RetryBudget");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
index 18db991b..01ad671b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
@@ -8,78 +8,32 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/cluster.upbdefs.h"
+#include "envoy/config/cluster/v3/cluster.upb.h"
-extern upb_def_init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
-extern upb_def_init envoy_config_cluster_v3_filter_proto_upbdefinit;
-extern upb_def_init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit;
-extern upb_def_init envoy_config_endpoint_v3_endpoint_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init xds_core_v3_collection_entry_proto_upbdefinit;
-extern upb_def_init udpa_annotations_security_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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_PreconnectPolicy_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;
-
-static const upb_msglayout *layouts[23] = {
- &envoy_config_cluster_v3_ClusterCollection_msginit,
- &envoy_config_cluster_v3_Cluster_msginit,
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch_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_LbSubsetConfig_LbSubsetSelector_msginit,
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
- &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit,
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
- &envoy_config_cluster_v3_UpstreamBindConfig_msginit,
- &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
- &envoy_config_cluster_v3_TrackClusterStats_msginit,
-};
-
-static const char descriptor[10750] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
+extern _upb_DefPool_Init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_filter_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_resolver_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_collection_entry_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[12169] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r',
@@ -96,422 +50,479 @@ static const char descriptor[10750] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/',
'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't',
'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o',
-'\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
-'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't',
-'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g',
-'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p',
-'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r',
-'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r',
-'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u',
-'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
-'o', '\"', 'K', '\n', '\021', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', '6', '\n',
-'\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'R', '\007', 'e', 'n', 't', 'r',
-'i', 'e', 's', '\"', '\246', 'G', '\n', '\007', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'o', '\n', '\030', 't', 'r', 'a', 'n', 's', 'p',
-'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 's', '\030', '+', ' ', '\003', '(', '\013', '2',
-'5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
-'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M',
-'a', 't', 'c', 'h', 'R', '\026', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c',
-'h', 'e', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\"', '\n', '\r', 'a', 'l', 't', '_', 's', 't', 'a', 't', '_', 'n', 'a', 'm', 'e', '\030',
-'\034', ' ', '\001', '(', '\t', 'R', '\013', 'a', 'l', 't', 'S', 't', 'a', 't', 'N', 'a', 'm', 'e', '\022', 'N', '\n', '\004', 't', 'y', 'p',
-'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r',
-'y', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\004', 't', 'y', 'p', 'e', '\022', 'W',
-'\n', '\014', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '&', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u',
-'s', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', 'H', '\000', 'R',
-'\013', 'c', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\022', '_', '\n', '\022', 'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't',
-'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'e', 'd', 's', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\017', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e',
-'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\016', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'o', '\n', '!', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030',
-'\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\035', 'p', 'e', 'r', 'C',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's',
-'\022', 'R', '\n', '\t', 'l', 'b', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\006', ' ', '\001', '(', '\016', '2', ')', '.', 'e', 'n', 'v',
+'\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v', '3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n',
+'t', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
+'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
+'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
+'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'K', '\n', '\021', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\341', 'O', '\n', '\007', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'o', '\n', '\030',
+'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 's', '\030',
+'+', ' ', '\003', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S',
+'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', 'R', '\026', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
+'e', 't', 'M', 'a', 't', 'c', 'h', 'e', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
+'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '>', '\n', '\r', 'a', 'l', 't', '_', 's', 't', 'a', 't',
+'_', 'n', 'a', 'm', 'e', '\030', '\034', ' ', '\001', '(', '\t', 'B', '\032', '\362', '\230', '\376', '\217', '\005', '\024', '\n', '\022', 'o', 'b', 's', 'e',
+'r', 'v', 'a', 'b', 'i', 'l', 'i', 't', 'y', '_', 'n', 'a', 'm', 'e', 'R', '\013', 'a', 'l', 't', 'S', 't', 'a', 't', 'N', 'a',
+'m', 'e', '\022', 'N', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'H',
+'\000', 'R', '\004', 't', 'y', 'p', 'e', '\022', 'W', '\n', '\014', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '&',
+' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
+'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'T', 'y', 'p', 'e', 'H', '\000', 'R', '\013', 'c', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\022', '_', '\n', '\022',
+'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\020', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\017', 'c', 'o', 'n',
+'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\252', '\001', '\002', '*', '\000', 'R', '\016', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'o', '\n', '!',
+'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm',
+'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*',
+'\002', '\020', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L',
+'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', 'P', '\n', '\t', 'l', 'b', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\006', ' ',
+'\001', '(', '\016', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e',
+'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B',
+'\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 'l', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', '\017', 'l', 'o', 'a', 'd', '_',
+'a', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', '\030', '!', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
+'r', 'L', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'R', '\016', 'l', 'o', 'a', 'd', 'A', 's', 's', 'i',
+'g', 'n', 'm', 'e', 'n', 't', '\022', 'F', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 's', '\030', '\010',
+' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
+'c', 'k', 's', '\022', 'h', '\n', '\033', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '_', 'p', 'e', 'r', '_', 'c',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222',
+'\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\030', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', 'P', 'e', 'r', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'S', '\n', '\020', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a',
+'k', 'e', 'r', 's', '\030', '\n', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e',
+'r', 's', 'R', '\017', 'c', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\022', '\203', '\001', '\n', '\036', 'u',
+'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't',
+'i', 'o', 'n', 's', '\030', '.', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R',
+'\033', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i',
+'o', 'n', 's', '\022', 'w', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c',
+'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\035', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\031', 'c',
+'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'k', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030',
+'\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B',
+'\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 't', '\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o',
+'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\022', '\030', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004',
+'\003', '3', '.', '0', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '\214', '\001', '\n', ' ', 't', 'y', 'p', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '$', ' ', '\003', '(', '\013', '2', 'C', '.', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\n', '\372', 'B', '\007', '\202', '\001', '\004', '\020', '\001', ' ', '\007', 'R',
-'\010', 'l', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', '\017', 'l', 'o', 'a', 'd', '_', 'a', 's', 's', 'i', 'g', 'n', 'm',
-'e', 'n', 't', '\030', '!', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o', 'a', 'd', 'A', 's',
-'s', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'R', '\016', 'l', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', '\022',
-'F', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', '!', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l',
-'t', 'h', 'C', 'h', 'e', 'c', 'k', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 's', '\022', '[', '\n', '\033',
-'m', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '_', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\030', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't',
-'s', 'P', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'S', '\n', '\020', 'c', 'i', 'r', 'c', 'u', 'i', 't',
-'_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\030', '\n', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B',
-'r', 'e', 'a', 'k', 'e', 'r', 's', 'R', '\017', 'c', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\022',
-'z', '\n', '\036', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '.', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\033', 'u', 'p', 's', 't',
-'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'n',
-'\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p',
-'t', 'i', 'o', 'n', 's', '\030', '\035', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
-'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\031', 'c', 'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'b', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c',
-'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'k', '\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o',
-'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't',
-'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\t', '\030', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\024', 'h',
-'t', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\214', '\001', '\n', ' ', 't',
-'y', 'p', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o',
-'p', 't', 'i', 'o', 'n', 's', '\030', '$', ' ', '\003', '(', '\013', '2', 'C', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'y', 'p',
-'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', 'E', 'n', 't', 'r', 'y', 'R', '\035', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'Q', '\n', '\020', 'd', 'n', 's', '_', 'r', 'e', 'f', 'r', 'e',
-'s', 'h', '_', 'r', 'a', 't', 'e', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006', '*', '\004',
-'\020', '\300', '\204', '=', 'R', '\016', 'd', 'n', 's', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', 'e', '\n', '\030', 'd',
-'n', 's', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'r', 'a', 't', 'e', '\030', ',',
-' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
-'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e',
-'R', '\025', 'd', 'n', 's', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', '&',
-'\n', '\017', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'd', 'n', 's', '_', 't', 't', 'l', '\030', '\'', ' ', '\001', '(', '\010', 'R', '\r',
-'r', 'e', 's', 'p', 'e', 'c', 't', 'D', 'n', 's', 'T', 't', 'l', '\022', 'f', '\n', '\021', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k',
-'u', 'p', '_', 'f', 'a', 'm', 'i', 'l', 'y', '\030', '\021', ' ', '\001', '(', '\016', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001',
-'R', '\017', 'd', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022', 'B', '\n', '\r', 'd', 'n', 's', '_',
-'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\022', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\014', 'd', 'n',
-'s', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\022', '4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r',
-'_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '-', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c',
-'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', 'V', '\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r',
-'_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\023', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r',
-'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i',
-'o', 'n', '\022', 'N', '\n', '\020', 'c', 'l', 'e', 'a', 'n', 'u', 'p', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\024', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\017', 'c', 'l', 'e', 'a', 'n', 'u', 'p', 'I',
-'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\025', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p',
-'s', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020', 'l', 'b', '_', 's', 'u',
-'b', 's', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\026', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'l', 'b', 'S', 'u', 'b', 's', 'e',
-'t', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'b', '\n', '\023', 'r', 'i', 'n', 'g', '_', 'h', 'a', 's', 'h', '_', 'l', 'b', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g',
-'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\020', 'r', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '[', '\n', '\020', 'm', 'a', 'g', 'l', 'e', 'v', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '\030', '4', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'M', 'a', 'g', 'l', 'e', 'v', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\016', 'm', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g',
-'\022', 'k', '\n', '\026', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\"', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l',
-'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\023', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's',
-'t', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'l', 'e', 'a', 's', 't', '_', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '%', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R',
-'\024', 'l', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020',
-'c', 'o', 'm', 'm', 'o', 'n', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\033', ' ', '\001', '(', '\013', '2', '/', '.',
+'t', 'e', 'r', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', 'R', '\035', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'Q', '\n', '\020', 'd', 'n',
+'s', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'r', 'a', 't', 'e', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372',
+'B', '\t', '\252', '\001', '\006', '*', '\004', '\020', '\300', '\204', '=', 'R', '\016', 'd', 'n', 's', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a',
+'t', 'e', '\022', 'e', '\n', '\030', 'd', 'n', 's', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h',
+'_', 'r', 'a', 't', 'e', '\030', ',', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r',
+'e', 's', 'h', 'R', 'a', 't', 'e', 'R', '\025', 'd', 'n', 's', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'R', 'e', 'f', 'r', 'e', 's',
+'h', 'R', 'a', 't', 'e', '\022', '&', '\n', '\017', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'd', 'n', 's', '_', 't', 't', 'l', '\030',
+'\'', ' ', '\001', '(', '\010', 'R', '\r', 'r', 'e', 's', 'p', 'e', 'c', 't', 'D', 'n', 's', 'T', 't', 'l', '\022', 'f', '\n', '\021', 'd',
+'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', '_', 'f', 'a', 'm', 'i', 'l', 'y', '\030', '\021', ' ', '\001', '(', '\016', '2', '0', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
-'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'c', 'o',
-'m', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
-'_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
-'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', ':', '\n', '\010', 'm', 'e',
-'t', 'a', 'd', 'a', 't', 'a', '\030', '\031', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\022', 'l', '\n', '\022', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o',
-'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'B', '\002', '\030', '\001', 'R', '\021', 'p', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'r', '\n', '\033', 'u', 'p', 's', 't', 'r', 'e', 'a',
-'m', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\036', ' ', '\001', '(',
-'\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
-'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i',
-'o', 'n', 's', 'R', '\031', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', 'U', '\n', '(', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'s', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '\030',
-'\037', ' ', '\001', '(', '\010', 'R', '#', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n',
-'H', 'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'F', 'a', 'i', 'l', 'u', 'r', 'e', '\022', '@', '\n', '\035', 'i', 'g', 'n', 'o',
-'r', 'e', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'm', 'o', 'v', 'a', 'l',
-'\030', ' ', ' ', '\001', '(', '\010', 'R', '\031', 'i', 'g', 'n', 'o', 'r', 'e', 'H', 'e', 'a', 'l', 't', 'h', 'O', 'n', 'H', 'o', 's',
-'t', 'R', 'e', 'm', 'o', 'v', 'a', 'l', '\022', '9', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '(', ' ', '\003', '(', '\013',
-'2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
-'3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '`', '\n', '\025', 'l', 'o', 'a', 'd',
-'_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', ')', ' ', '\001', '(', '\013', '2', ',',
+'l', 'u', 's', 't', 'e', 'r', '.', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', 'B', '\010', '\372',
+'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'd', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022',
+'O', '\n', '\r', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\022', ' ', '\003', '(', '\013', '2', '\035', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r',
+'e', 's', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'd', 'n', 's', 'R', 'e', 's', 'o',
+'l', 'v', 'e', 'r', 's', '\022', 'A', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_',
+'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '-', ' ', '\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.',
+'0', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', 'j', '\n',
+'\025', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '5', ' ',
+'\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\013', '\030', '\001',
+'\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'd', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\031', 't', 'y', 'p', 'e', 'd', '_', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v',
+'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '7', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\026', 't', 'y', 'p', 'e', 'd', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v',
+'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\025', 'w', 'a', 'i', 't', '_', 'f', 'o', 'r', '_', 'w', 'a', 'r', 'm',
+'_', 'o', 'n', '_', 'i', 'n', 'i', 't', '\030', '6', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\021', 'w', 'a', 'i', 't', 'F', 'o',
+'r', 'W', 'a', 'r', 'm', 'O', 'n', 'I', 'n', 'i', 't', '\022', 'V', '\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e',
+'t', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\023', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't',
+'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022',
+'N', '\n', '\020', 'c', 'l', 'e', 'a', 'n', 'u', 'p', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\024', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\017', 'c', 'l', 'e', 'a', 'n', 'u', 'p', 'I', 'n', 't', 'e',
+'r', 'v', 'a', 'l', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\025', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p', 's', 't', 'r',
+'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020', 'l', 'b', '_', 's', 'u', 'b', 's', 'e',
+'t', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\026', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L',
+'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'l', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', 'b', '\n', '\023', 'r', 'i', 'n', 'g', '_', 'h', 'a', 's', 'h', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's',
+'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\020', 'r', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', '[', '\n', '\020', 'm', 'a', 'g', 'l', 'e', 'v', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'4', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'M', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o',
+'n', 'f', 'i', 'g', 'H', '\001', 'R', '\016', 'm', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'k', '\n',
+'\026', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\"',
+' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
+'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\023', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'l', 'e', 'a', 's', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'l',
+'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '%', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L',
+'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\024', 'l', 'e',
+'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'h', '\n', '\025', 'r', 'o', 'u',
+'n', 'd', '_', 'r', 'o', 'b', 'i', 'n', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '8', ' ', '\001', '(', '\013', '2',
+'3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'o', 'u', 'n', 'd', 'R', 'o', 'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f',
+'i', 'g', 'H', '\001', 'R', '\022', 'r', 'o', 'u', 'n', 'd', 'R', 'o', 'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
+'Y', '\n', '\020', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\033', ' ', '\001', '(', '\013',
+'2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
+'3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
+'\016', 'c', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S',
+'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', ':', '\n',
+'\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\031', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'u', '\n', '\022', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 's', 'e', 'l', 'e', 'c',
+'t', 'i', 'o', 'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307',
+'\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\021', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o',
+'n', '\022', 'r', '\n', '\033', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\036', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\031', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
+'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'U', '\n', '(', 'c', 'l', 'o', 's',
+'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'h', 'e', 'a',
+'l', 't', 'h', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '\030', '\037', ' ', '\001', '(', '\010', 'R', '#', 'c', 'l', 'o', 's', 'e', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H', 'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'F', 'a', 'i',
+'l', 'u', 'r', 'e', '\022', '@', '\n', '\035', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'o', 'n', '_',
+'h', 'o', 's', 't', '_', 'r', 'e', 'm', 'o', 'v', 'a', 'l', '\030', ' ', ' ', '\001', '(', '\010', 'R', '\031', 'i', 'g', 'n', 'o', 'r',
+'e', 'H', 'e', 'a', 'l', 't', 'h', 'O', 'n', 'H', 'o', 's', 't', 'R', 'e', 'm', 'o', 'v', 'a', 'l', '\022', '9', '\n', '\007', 'f',
+'i', 'l', 't', 'e', 'r', 's', '\030', '(', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l',
+'t', 'e', 'r', 's', '\022', '`', '\n', '\025', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'p', 'o',
+'l', 'i', 'c', 'y', '\030', ')', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g',
+'P', 'o', 'l', 'i', 'c', 'y', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i',
+'c', 'y', '\022', 'A', '\n', '\n', 'l', 'r', 's', '_', 's', 'e', 'r', 'v', 'e', 'r', '\030', '*', ' ', '\001', '(', '\013', '2', '\"', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f',
+'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'r', 's', 'S', 'e', 'r', 'v', 'e', 'r', '\022', '?', '\n', '\025', 't', 'r',
+'a', 'c', 'k', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'b', 'u', 'd', 'g', 'e', 't', 's', '\030', '/', ' ', '\001', '(', '\010',
+'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 't', 'r', 'a', 'c', 'k', 'T', 'i', 'm', 'e', 'o',
+'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', 'S', '\n', '\017', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '0', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n',
+'f', 'i', 'g', 'R', '\016', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z', '\n', '\023', 't', 'r',
+'a', 'c', 'k', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '1', ' ', '\001', '(', '\013', '2', '*',
'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.',
-'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\023', 'l', 'o', 'a', 'd',
-'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'A', '\n', '\n', 'l', 'r', 's', '_', 's', 'e',
-'r', 'v', 'e', 'r', '\030', '*', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'r',
-'s', 'S', 'e', 'r', 'v', 'e', 'r', '\022', '6', '\n', '\025', 't', 'r', 'a', 'c', 'k', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_',
-'b', 'u', 'd', 'g', 'e', 't', 's', '\030', '/', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\023', 't', 'r', 'a', 'c', 'k', 'T',
-'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', 'S', '\n', '\017', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '0', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z',
-'\n', '\023', 't', 'r', 'a', 'c', 'k', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '1', ' ', '\001',
-'(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', 'R', '\021', 't', 'r',
-'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '^', '\n', '\021', 'p', 'r', 'e', 'c', 'o', 'n',
-'n', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '2', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\020', 'p', 'r', 'e', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', ')', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'p', 'o', 'o', 'l', '_', 'p', 'e', 'r', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'n',
-'e', 'c', 't', 'i', 'o', 'n', '\030', '3', ' ', '\001', '(', '\010', 'R', '%', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P',
-'o', 'o', 'l', 'P', 'e', 'r', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
-'n', '\032', '\346', '\001', '\n', '\024', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c',
-'h', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\004', 'n', 'a', 'm', 'e', '\022', '-', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'm', 'a', 't',
-'c', 'h', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\003', ' ',
-'\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p',
-'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o',
-'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', '\032', '\230', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'T', 'y', 'p', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '-', '\232', '\305', '\210', '\036', '(', '\n',
-'&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'u', 's',
-'t', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\032', '\246', '\001', '\n', '\020', 'E', 'd', 's', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\n', 'e', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'e', 'd', 's', 'C', 'o', 'n', 'f',
-'i', 'g', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
-'\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'E', 'd', 's', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\300', '\010', '\n', '\016', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f',
-'i', 'g', '\022', 'y', '\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\001', ' ', '\001',
-'(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B',
-'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '>', '\n', '\016', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\002', ' ', '\001', '(', '\013', '2',
-'\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R',
-'\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'u', 'b', 's', 'e', 't', '\022', 'k', '\n', '\020', 's', 'u', 'b', 's', 'e', 't', '_',
-'s', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e',
-'l', 'e', 'c', 't', 'o', 'r', 'R', '\017', 's', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\022', '2',
-'\n', '\025', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', '_', 'a', 'w', 'a', 'r', 'e', '\030', '\004',
-' ', '\001', '(', '\010', 'R', '\023', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'A', 'w', 'a', 'r', 'e',
-'\022', '2', '\n', '\025', 's', 'c', 'a', 'l', 'e', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't',
-'\030', '\005', ' ', '\001', '(', '\010', 'R', '\023', 's', 'c', 'a', 'l', 'e', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g',
-'h', 't', '\022', '$', '\n', '\016', 'p', 'a', 'n', 'i', 'c', '_', 'm', 'o', 'd', 'e', '_', 'a', 'n', 'y', '\030', '\006', ' ', '\001', '(',
-'\010', 'R', '\014', 'p', 'a', 'n', 'i', 'c', 'M', 'o', 'd', 'e', 'A', 'n', 'y', '\022', '\036', '\n', '\013', 'l', 'i', 's', 't', '_', 'a',
-'s', '_', 'a', 'n', 'y', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\t', 'l', 'i', 's', 't', 'A', 's', 'A', 'n', 'y', '\032', '\332', '\003',
-'\n', '\020', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\022', '\022', '\n', '\004', 'k', 'e', 'y',
-'s', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\004', 'k', 'e', 'y', 's', '\022', '3', '\n', '\026', 's', 'i', 'n', 'g', 'l', 'e', '_', 'h',
-'o', 's', 't', '_', 'p', 'e', 'r', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\023', 's', 'i', 'n',
-'g', 'l', 'e', 'H', 'o', 's', 't', 'P', 'e', 'r', 'S', 'u', 'b', 's', 'e', 't', '\022', '\222', '\001', '\n', '\017', 'f', 'a', 'l', 'l',
-'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\016', '2', '_', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't',
-'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r',
-'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
-'\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '0', '\n', '\024', 'f', 'a', 'l', 'l', 'b', 'a',
-'c', 'k', '_', 'k', 'e', 'y', 's', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\022', 'f', 'a', 'l',
-'l', 'b', 'a', 'c', 'k', 'K', 'e', 'y', 's', 'S', 'u', 'b', 's', 'e', 't', '\"', 'y', '\n', '\036', 'L', 'b', 'S', 'u', 'b', 's',
-'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022',
-'\017', '\n', '\013', 'N', 'O', 'T', '_', 'D', 'E', 'F', 'I', 'N', 'E', 'D', '\020', '\000', '\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A',
-'L', 'L', 'B', 'A', 'C', 'K', '\020', '\001', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020',
-'\002', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\003', '\022', '\017', '\n', '\013',
-'K', 'E', 'Y', 'S', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\004', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e',
-'t', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\"',
-'O', '\n', '\026', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A', 'C', 'K', '\020', '\000', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_',
-'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020', '\001', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B',
-'S', 'E', 'T', '\020', '\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\347', '\001', '\n', '\024', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'H', '\n', '\014', 'c', 'h', 'o', 'i', 'c', 'e', '_', 'c', 'o', 'u', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', 'R', '\021', 't', 'r', 'a', 'c', 'k', 'C',
+'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '^', '\n', '\021', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '2', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'P', 'r',
+'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\020', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c',
+'t', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', ')', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'o', 'o',
+'l', '_', 'p', 'e', 'r', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', '\030', '3', ' ', '\001', '(', '\010', 'R', '%', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'o', 'o', 'l', 'P',
+'e', 'r', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\032', '\346', '\001',
+'\n', '\024', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', '\022', '\033', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm',
+'e', '\022', '-', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'm', 'a', 't', 'c', 'h', '\022', 'P',
+'\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S',
+'o', 'c', 'k', 'e', 't', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't',
+'M', 'a', 't', 'c', 'h', '\032', '\230', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y',
+'p', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
+'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y',
+'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C',
+'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\032', '\246', '\001', '\n', '\020', 'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\n', 'e', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'e', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!',
+'\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 's', 'e', 'r',
+'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o',
+'n', 'f', 'i', 'g', '\032', '\300', '\010', '\n', '\016', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'y',
+'\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\001', ' ', '\001', '(', '\016', '2', 'F',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.',
+'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b',
+'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005',
+'\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '>', '\n', '\016',
+'d', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\r', 'd', 'e', 'f',
+'a', 'u', 'l', 't', 'S', 'u', 'b', 's', 'e', 't', '\022', 'k', '\n', '\020', 's', 'u', 'b', 's', 'e', 't', '_', 's', 'e', 'l', 'e',
+'c', 't', 'o', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u',
+'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't',
+'o', 'r', 'R', '\017', 's', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\022', '2', '\n', '\025', 'l', 'o',
+'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', '_', 'a', 'w', 'a', 'r', 'e', '\030', '\004', ' ', '\001', '(', '\010',
+'R', '\023', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'A', 'w', 'a', 'r', 'e', '\022', '2', '\n', '\025',
+'s', 'c', 'a', 'l', 'e', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\005', ' ', '\001',
+'(', '\010', 'R', '\023', 's', 'c', 'a', 'l', 'e', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', '\022', '$',
+'\n', '\016', 'p', 'a', 'n', 'i', 'c', '_', 'm', 'o', 'd', 'e', '_', 'a', 'n', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\014', 'p',
+'a', 'n', 'i', 'c', 'M', 'o', 'd', 'e', 'A', 'n', 'y', '\022', '\036', '\n', '\013', 'l', 'i', 's', 't', '_', 'a', 's', '_', 'a', 'n',
+'y', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\t', 'l', 'i', 's', 't', 'A', 's', 'A', 'n', 'y', '\032', '\332', '\003', '\n', '\020', 'L', 'b',
+'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\022', '\022', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ',
+'\003', '(', '\t', 'R', '\004', 'k', 'e', 'y', 's', '\022', '3', '\n', '\026', 's', 'i', 'n', 'g', 'l', 'e', '_', 'h', 'o', 's', 't', '_',
+'p', 'e', 'r', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\023', 's', 'i', 'n', 'g', 'l', 'e', 'H',
+'o', 's', 't', 'P', 'e', 'r', 'S', 'u', 'b', 's', 'e', 't', '\022', '\222', '\001', '\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k',
+'_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\016', '2', '_', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b',
+'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e',
+'c', 't', 'o', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l',
+'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l',
+'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '0', '\n', '\024', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'k',
+'e', 'y', 's', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\022', 'f', 'a', 'l', 'l', 'b', 'a', 'c',
+'k', 'K', 'e', 'y', 's', 'S', 'u', 'b', 's', 'e', 't', '\"', 'y', '\n', '\036', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e',
+'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'N',
+'O', 'T', '_', 'D', 'E', 'F', 'I', 'N', 'E', 'D', '\020', '\000', '\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A',
+'C', 'K', '\020', '\001', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020', '\002', '\022', '\022', '\n',
+'\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\003', '\022', '\017', '\n', '\013', 'K', 'E', 'Y', 'S',
+'_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\004', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n',
+'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\"', 'O', '\n', '\026', 'L',
+'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013',
+'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A', 'C', 'K', '\020', '\000', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E', 'N', 'D', 'P',
+'O', 'I', 'N', 'T', '\020', '\001', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020',
+'\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l',
+'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\343', '\001', '\n', '\017',
+'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\021', 's', 'l', 'o', 'w', '_', 's',
+'t', 'a', 'r', 't', '_', 'w', 'i', 'n', 'd', 'o', 'w', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 's', 'l', 'o', 'w',
+'S', 't', 'a', 'r', 't', 'W', 'i', 'n', 'd', 'o', 'w', '\022', 'C', '\n', '\n', 'a', 'g', 'g', 'r', 'e', 's', 's', 'i', 'o', 'n',
+'\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', 'R', '\n', 'a', 'g', 'g', 'r', 'e',
+'s', 's', 'i', 'o', 'n', '\022', 'D', '\n', '\022', 'm', 'i', 'n', '_', 'w', 'e', 'i', 'g', 'h', 't', '_', 'p', 'e', 'r', 'c', 'e',
+'n', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\020', 'm', 'i', 'n', 'W', 'e', 'i', 'g', 'h', 't', 'P', 'e', 'r', 'c', 'e', 'n', 't',
+'\032', 'r', '\n', '\022', 'R', 'o', 'u', 'n', 'd', 'R', 'o', 'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\\', '\n',
+'\021', 's', 'l', 'o', 'w', '_', 's', 't', 'a', 'r', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
+'\017', 's', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\305', '\002', '\n', '\024', 'L', 'e', 'a', 's',
+'t', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014', 'c', 'h', 'o', 'i', 'c',
+'e', '_', 'c', 'o', 'u', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002',
+'(', '\002', 'R', '\013', 'c', 'h', 'o', 'i', 'c', 'e', 'C', 'o', 'u', 'n', 't', '\022', 'S', '\n', '\023', 'a', 'c', 't', 'i', 'v', 'e',
+'_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e',
+'D', 'o', 'u', 'b', 'l', 'e', 'R', '\021', 'a', 'c', 't', 'i', 'v', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'i', 'a', 's',
+'\022', '\\', '\n', '\021', 's', 'l', 'o', 'w', '_', 's', 't', 'a', 'r', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001',
+'(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\017', 's', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', ':', '0', '\232', '\305', '\210', '\036',
+'+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L',
+'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\221', '\003', '\n', '\020', 'R',
+'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'T', '\n', '\021', 'm', 'i', 'n', 'i', 'm', 'u',
+'m', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372',
+'B', '\007', '2', '\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017', 'm', 'i', 'n', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z',
+'e', '\022', 'm', '\n', '\r', 'h', 'a', 's', 'h', '_', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2',
+'>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g',
+'.', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014',
+'h', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i', 'o', 'n', '\022', 'T', '\n', '\021', 'm', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'r',
+'i', 'n', 'g', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2',
+'\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017', 'm', 'a', 'x', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\"', '.',
+'\n', '\014', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i', 'o', 'n', '\022', '\013', '\n', '\007', 'X', 'X', '_', 'H', 'A', 'S', 'H',
+'\020', '\000', '\022', '\021', '\n', '\r', 'M', 'U', 'R', 'M', 'U', 'R', '_', 'H', 'A', 'S', 'H', '_', '2', '\020', '\001', ':', ',', '\232', '\305',
+'\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\002', '\020', '\003', '\032', 'Y',
+'\n', '\016', 'M', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'G', '\n', '\n', 't', 'a', 'b', 'l', 'e',
+'_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\313',
+'\226', '\261', '\002', 'R', '\t', 't', 'a', 'b', 'l', 'e', 'S', 'i', 'z', 'e', '\032', 'n', '\n', '\023', 'O', 'r', 'i', 'g', 'i', 'n', 'a',
+'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 'u', 's', 'e', '_', 'h', 't', 't', 'p', '_',
+'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\r', 'u', 's', 'e', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd',
+'e', 'r', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C',
+'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i',
+'g', '\032', '\325', '\013', '\n', '\016', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\027', 'h',
+'e', 'a', 'l', 't', 'h', 'y', '_', 'p', 'a', 'n', 'i', 'c', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e',
+'n', 't', 'R', '\025', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'P', 'a', 'n', 'i', 'c', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd',
+'\022', 't', '\n', '\024', 'z', 'o', 'n', 'e', '_', 'a', 'w', 'a', 'r', 'e', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\002', ' ', '\001', '(', '\013', '2', 'A', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o',
+'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R',
+'\021', 'z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\211', '\001', '\n', '\033', 'l', 'o',
+'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\003', ' ', '\001', '(', '\013', '2', 'H', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C',
+'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C',
+'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\030', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'I', '\n', '\023', 'u', 'p', 'd', 'a', 't', 'e', '_', 'm', 'e', 'r', 'g', 'e', '_',
+'w', 'i', 'n', 'd', 'o', 'w', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'u', 'p', 'd', 'a', 't', 'e', 'M', 'e', 'r',
+'g', 'e', 'W', 'i', 'n', 'd', 'o', 'w', '\022', 'C', '\n', '\037', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'n', 'e', 'w', '_', 'h', 'o',
+'s', 't', 's', '_', 'u', 'n', 't', 'i', 'l', '_', 'f', 'i', 'r', 's', 't', '_', 'h', 'c', '\030', '\005', ' ', '\001', '(', '\010', 'R',
+'\032', 'i', 'g', 'n', 'o', 'r', 'e', 'N', 'e', 'w', 'H', 'o', 's', 't', 's', 'U', 'n', 't', 'i', 'l', 'F', 'i', 'r', 's', 't',
+'H', 'c', '\022', 'M', '\n', '$', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '_', 'o',
+'n', '_', 'h', 'o', 's', 't', '_', 's', 'e', 't', '_', 'c', 'h', 'a', 'n', 'g', 'e', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\037',
+'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H', 'o', 's', 't', 'S', 'e', 't',
+'C', 'h', 'a', 'n', 'g', 'e', '\022', '\212', '\001', '\n', '\034', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', '_', 'h', 'a', 's',
+'h', 'i', 'n', 'g', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'I', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 's', 'i',
+'s', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\031', 'c', 'o', 'n',
+'s', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'W', '\n',
+'\024', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 'h', 'o', 's', 't', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\010', ' ', '\001',
+'(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'S', 'e', 't', 'R', '\022', 'o', 'v', 'e', 'r', 'r', 'i', 'd',
+'e', 'H', 'o', 's', 't', 'S', 't', 'a', 't', 'u', 's', '\032', '\215', '\002', '\n', '\021', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\017', 'r', 'o', 'u', 't', 'i', 'n', 'g', '_', 'e', 'n', 'a', 'b', 'l',
+'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'o', 'u', 't', 'i', 'n', 'g', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'F',
+'\n', '\020', 'm', 'i', 'n', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V',
+'a', 'l', 'u', 'e', 'R', '\016', 'm', 'i', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'i', 'z', 'e', '\022', '1', '\n', '\025', 'f',
+'a', 'i', 'l', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'o', 'n', '_', 'p', 'a', 'n', 'i', 'c', '\030', '\003', ' ', '\001', '(',
+'\010', 'R', '\022', 'f', 'a', 'i', 'l', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'O', 'n', 'P', 'a', 'n', 'i', 'c', ':', '<', '\232', '\305',
+'\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '_', '\n', '\030', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h',
+'t', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'C', '\232', '\305', '\210', '\036', '>', '\n', '<', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C',
+'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C',
+'o', 'n', 'f', 'i', 'g', '\032', '\361', '\001', '\n', '\031', 'C', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i',
+'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '7', '\n', '\030', 'u', 's', 'e', '_', 'h', 'o', 's', 't', 'n', 'a', 'm',
+'e', '_', 'f', 'o', 'r', '_', 'h', 'a', 's', 'h', 'i', 'n', 'g', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\025', 'u', 's', 'e', 'H',
+'o', 's', 't', 'n', 'a', 'm', 'e', 'F', 'o', 'r', 'H', 'a', 's', 'h', 'i', 'n', 'g', '\022', 'U', '\n', '\023', 'h', 'a', 's', 'h',
+'_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'f', 'a', 'c', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
-'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\002', 'R', '\013', 'c', 'h', 'o', 'i', 'c', 'e', 'C', 'o', 'u', 'n', 't', '\022', 'S',
-'\n', '\023', 'a', 'c', 't', 'i', 'v', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'i', 'a', 's', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', 'R', '\021', 'a', 'c', 't', 'i', 'v', 'e', 'R', 'e', 'q',
-'u', 'e', 's', 't', 'B', 'i', 'a', 's', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't',
-'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\221', '\003', '\n', '\020', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', 'T', '\n', '\021', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e',
-'\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017',
-'m', 'i', 'n', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\022', 'm', '\n', '\r', 'h', 'a', 's', 'h', '_', 'f',
-'u', 'n', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i',
-'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i',
-'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'h', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i', 'o',
-'n', '\022', 'T', '\n', '\021', 'm', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ',
-'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
-'t', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017', 'm', 'a', 'x',
-'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\"', '.', '\n', '\014', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't',
-'i', 'o', 'n', '\022', '\013', '\n', '\007', 'X', 'X', '_', 'H', 'A', 'S', 'H', '\020', '\000', '\022', '\021', '\n', '\r', 'M', 'U', 'R', 'M', 'U',
-'R', '_', 'H', 'A', 'S', 'H', '_', '2', '\020', '\001', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\002', '\020', '\003', '\032', 'M', '\n', '\016', 'M', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', ';', '\n', '\n', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4',
-'V', 'a', 'l', 'u', 'e', 'R', '\t', 't', 'a', 'b', 'l', 'e', 'S', 'i', 'z', 'e', '\032', 'n', '\n', '\023', 'O', 'r', 'i', 'g', 'i',
-'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 'u', 's', 'e', '_', 'h', 't', 't',
-'p', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\r', 'u', 's', 'e', 'H', 't', 't', 'p', 'H', 'e',
-'a', 'd', 'e', 'r', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
-'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n',
-'f', 'i', 'g', '\032', '\374', '\n', '\n', '\016', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n',
-'\027', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'p', 'a', 'n', 'i', 'c', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r',
-'c', 'e', 'n', 't', 'R', '\025', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'P', 'a', 'n', 'i', 'c', 'T', 'h', 'r', 'e', 's', 'h', 'o',
-'l', 'd', '\022', 't', '\n', '\024', 'z', 'o', 'n', 'e', '_', 'a', 'w', 'a', 'r', 'e', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', 'A', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H',
-'\000', 'R', '\021', 'z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\211', '\001', '\n', '\033',
-'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', 'H', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\030', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't',
-'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'I', '\n', '\023', 'u', 'p', 'd', 'a', 't', 'e', '_', 'm', 'e', 'r', 'g',
-'e', '_', 'w', 'i', 'n', 'd', 'o', 'w', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'u', 'p', 'd', 'a', 't', 'e', 'M',
-'e', 'r', 'g', 'e', 'W', 'i', 'n', 'd', 'o', 'w', '\022', 'C', '\n', '\037', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'n', 'e', 'w', '_',
-'h', 'o', 's', 't', 's', '_', 'u', 'n', 't', 'i', 'l', '_', 'f', 'i', 'r', 's', 't', '_', 'h', 'c', '\030', '\005', ' ', '\001', '(',
-'\010', 'R', '\032', 'i', 'g', 'n', 'o', 'r', 'e', 'N', 'e', 'w', 'H', 'o', 's', 't', 's', 'U', 'n', 't', 'i', 'l', 'F', 'i', 'r',
-'s', 't', 'H', 'c', '\022', 'M', '\n', '$', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's',
-'_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 's', 'e', 't', '_', 'c', 'h', 'a', 'n', 'g', 'e', '\030', '\006', ' ', '\001', '(', '\010',
-'R', '\037', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H', 'o', 's', 't', 'S',
-'e', 't', 'C', 'h', 'a', 'n', 'g', 'e', '\022', '\212', '\001', '\n', '\034', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', '_', 'h',
-'a', 's', 'h', 'i', 'n', 'g', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'I', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
-'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n',
-'s', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\031', 'c',
-'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\215', '\002', '\n', '\021', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\017',
-'r', 'o', 'u', 't', 'i', 'n', 'g', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e',
-'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'o', 'u',
-'t', 'i', 'n', 'g', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'F', '\n', '\020', 'm', 'i', 'n', '_', 'c', 'l', 'u', 's', 't', 'e',
-'r', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'i', 'n', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'S', 'i', 'z', 'e', '\022', '1', '\n', '\025', 'f', 'a', 'i', 'l', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_',
-'o', 'n', '_', 'p', 'a', 'n', 'i', 'c', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\022', 'f', 'a', 'i', 'l', 'T', 'r', 'a', 'f', 'f',
-'i', 'c', 'O', 'n', 'P', 'a', 'n', 'i', 'c', ':', '<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n',
-'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '_', '\n', '\030',
-'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':',
-'C', '\232', '\305', '\210', '\036', '>', '\n', '<', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i',
-'t', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\361', '\001', '\n', '\031', 'C', 'o',
-'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '7',
-'\n', '\030', 'u', 's', 'e', '_', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '_', 'f', 'o', 'r', '_', 'h', 'a', 's', 'h', 'i', 'n',
-'g', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\025', 'u', 's', 'e', 'H', 'o', 's', 't', 'n', 'a', 'm', 'e', 'F', 'o', 'r', 'H', 'a',
-'s', 'h', 'i', 'n', 'g', '\022', 'U', '\n', '\023', 'h', 'a', 's', 'h', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'f', 'a', 'c',
-'t', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', 'd', 'R', '\021',
-'h', 'a', 's', 'h', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'F', 'a', 'c', 't', 'o', 'r', ':', 'D', '\232', '\305', '\210', '\036', '?', '\n',
-'=', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm',
-'m', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's',
-'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', 'B', '\033', '\n', '\031', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g',
-'_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\032', '\322', '\001', '\n', '\013', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't',
-'e', '\022', 'N', '\n', '\r', 'b', 'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '*', '\004', '\020', '\300', '\204', '=', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n',
-'t', 'e', 'r', 'v', 'a', 'l', '\022', 'J', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006', '*', '\004', '\020', '\300', '\204', '=', 'R', '\013', 'm', 'a', 'x', 'I',
-'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\032', '\203',
-'\002', '\n', '\020', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'x', '\n', '\035', 'p', 'e',
-'r', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't',
-'i', 'o', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000',
-'\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\032', 'p', 'e', 'r', 'U', 'p', 's', 't', 'r', 'e', 'a',
-'m', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o', '\022', 'u', '\n', '\033', 'p', 'r', 'e', 'd', 'i',
-'c', 't', 'i', 'v', 'e', '_', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u',
-'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')',
-'\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\031', 'p', 'r', 'e', 'd', 'i', 'c', 't', 'i', 'v', 'e', 'P', 'r', 'e', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o', '\032', 'f', '\n', '\"', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020',
-'\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e',
-'\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', 'W', '\n', '\r', 'D', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'A', 'T', 'I', 'C', '\020', '\000', '\022', '\016', '\n', '\n', 'S', 'T', 'R',
-'I', 'C', 'T', '_', 'D', 'N', 'S', '\020', '\001', '\022', '\017', '\n', '\013', 'L', 'O', 'G', 'I', 'C', 'A', 'L', '_', 'D', 'N', 'S', '\020',
-'\002', '\022', '\007', '\n', '\003', 'E', 'D', 'S', '\020', '\003', '\022', '\020', '\n', '\014', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S',
-'T', '\020', '\004', '\"', '\244', '\001', '\n', '\010', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'N', 'D',
-'_', 'R', 'O', 'B', 'I', 'N', '\020', '\000', '\022', '\021', '\n', '\r', 'L', 'E', 'A', 'S', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T',
-'\020', '\001', '\022', '\r', '\n', '\t', 'R', 'I', 'N', 'G', '_', 'H', 'A', 'S', 'H', '\020', '\002', '\022', '\n', '\n', '\006', 'R', 'A', 'N', 'D',
-'O', 'M', '\020', '\003', '\022', '\n', '\n', '\006', 'M', 'A', 'G', 'L', 'E', 'V', '\020', '\005', '\022', '\024', '\n', '\020', 'C', 'L', 'U', 'S', 'T',
-'E', 'R', '_', 'P', 'R', 'O', 'V', 'I', 'D', 'E', 'D', '\020', '\006', '\022', ' ', '\n', '\034', 'L', 'O', 'A', 'D', '_', 'B', 'A', 'L',
-'A', 'N', 'C', 'I', 'N', 'G', '_', 'P', 'O', 'L', 'I', 'C', 'Y', '_', 'C', 'O', 'N', 'F', 'I', 'G', '\020', '\007', '\"', '\004', '\010',
-'\004', '\020', '\004', '*', '\017', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S', 'T', '_', 'L', 'B', '\"', '5', '\n', '\017', 'D',
-'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022',
-'\013', '\n', '\007', 'V', '4', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\013', '\n', '\007', 'V', '6', '_', 'O', 'N', 'L', 'Y', '\020', '\002',
-'\"', 'T', '\n', '\030', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't',
-'i', 'o', 'n', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'C', 'O', 'N', 'F', 'I', 'G', 'U', 'R', 'E', 'D', '_', 'P', 'R', 'O',
-'T', 'O', 'C', 'O', 'L', '\020', '\000', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'D', 'O', 'W', 'N', 'S', 'T', 'R', 'E', 'A', 'M',
-'_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\001', ':', '\033', '\232', '\305', '\210', '\036', '\026', '\n', '\024', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'B', '\030', '\n', '\026', 'c', 'l', 'u', 's', 't', 'e',
-'r', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '_', 't', 'y', 'p', 'e', 'B', '\013', '\n', '\t', 'l', 'b', '_', 'c', 'o',
-'n', 'f', 'i', 'g', 'J', '\004', '\010', '\014', '\020', '\r', 'J', '\004', '\010', '\017', '\020', '\020', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010',
-'\013', '\020', '\014', 'J', '\004', '\010', '#', '\020', '$', 'R', '\005', 'h', 'o', 's', 't', 's', 'R', '\013', 't', 'l', 's', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', 'R', '\032', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_',
-'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\245', '\002', '\n', '\023', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g',
-'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
-'3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
-'.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'P', 'o', 'l', 'i',
-'c', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', '\223', '\001', '\n', '\006', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\022',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p',
-'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
-':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a',
-'d', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'P', 'o', 'l', 'i', 'c', 'y', 'J', '\004',
-'\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l',
-'i', 'c', 'y', '\"', '\202', '\001', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', 'D', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A',
-'d', 'd', 'r', 'e', 's', 's', 'R', '\r', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '&', '\232', '\305',
-'\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a',
-'m', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\223', '\001', '\n', '\031', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'G', '\n', '\r', 't', 'c', 'p', '_', 'k',
-'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e',
-'R', '\014', 't', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c',
-'t', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', 'r', '\n', '\021', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'S', 't', 'a', 't', 's', '\022', '\'', '\n', '\017', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'b', 'u', 'd', 'g', 'e', 't',
-'s', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 't', 'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', '4',
-'\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 's', 'i', 'z', 'e', 's', '\030',
-'\002', ' ', '\001', '(', '\010', 'R', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'S', 'i', 'z',
-'e', 's', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', 'd', 'R', '\021', 'h', 'a', 's', 'h', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'F', 'a',
+'c', 't', 'o', 'r', ':', 'D', '\232', '\305', '\210', '\036', '?', '\n', '=', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C',
+'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':',
+'*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\033', '\n', '\031', 'l', 'o', 'c',
+'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\032', '\322', '\001',
+'\n', '\013', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', 'N', '\n', '\r', 'b', 'a', 's', 'e', '_', 'i', 'n', 't',
+'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '*', '\004',
+'\020', '\300', '\204', '=', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'J', '\n', '\014', 'm', 'a', 'x',
+'_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006',
+'*', '\004', '\020', '\300', '\204', '=', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '\'', '\232', '\305', '\210', '\036',
+'\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R',
+'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\032', '\203', '\002', '\n', '\020', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'P', 'o', 'l', 'i', 'c', 'y', '\022', 'x', '\n', '\035', 'p', 'e', 'r', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'p', 'r',
+'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e',
+'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?',
+'R', '\032', 'p', 'e', 'r', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'R', 'a',
+'t', 'i', 'o', '\022', 'u', '\n', '\033', 'p', 'r', 'e', 'd', 'i', 'c', 't', 'i', 'v', 'e', '_', 'p', 'r', 'e', 'c', 'o', 'n', 'n',
+'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024',
+'\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\031', 'p', 'r', 'e',
+'d', 'i', 'c', 't', 'i', 'v', 'e', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o', '\032', 'f', '\n',
+'\"', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003',
+'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8',
+'\001', '\"', 'W', '\n', '\r', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'A',
+'T', 'I', 'C', '\020', '\000', '\022', '\016', '\n', '\n', 'S', 'T', 'R', 'I', 'C', 'T', '_', 'D', 'N', 'S', '\020', '\001', '\022', '\017', '\n', '\013',
+'L', 'O', 'G', 'I', 'C', 'A', 'L', '_', 'D', 'N', 'S', '\020', '\002', '\022', '\007', '\n', '\003', 'E', 'D', 'S', '\020', '\003', '\022', '\020', '\n',
+'\014', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S', 'T', '\020', '\004', '\"', '\244', '\001', '\n', '\010', 'L', 'b', 'P', 'o', 'l',
+'i', 'c', 'y', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'N', 'D', '_', 'R', 'O', 'B', 'I', 'N', '\020', '\000', '\022', '\021', '\n', '\r', 'L',
+'E', 'A', 'S', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020', '\001', '\022', '\r', '\n', '\t', 'R', 'I', 'N', 'G', '_', 'H', 'A',
+'S', 'H', '\020', '\002', '\022', '\n', '\n', '\006', 'R', 'A', 'N', 'D', 'O', 'M', '\020', '\003', '\022', '\n', '\n', '\006', 'M', 'A', 'G', 'L', 'E',
+'V', '\020', '\005', '\022', '\024', '\n', '\020', 'C', 'L', 'U', 'S', 'T', 'E', 'R', '_', 'P', 'R', 'O', 'V', 'I', 'D', 'E', 'D', '\020', '\006',
+'\022', ' ', '\n', '\034', 'L', 'O', 'A', 'D', '_', 'B', 'A', 'L', 'A', 'N', 'C', 'I', 'N', 'G', '_', 'P', 'O', 'L', 'I', 'C', 'Y',
+'_', 'C', 'O', 'N', 'F', 'I', 'G', '\020', '\007', '\"', '\004', '\010', '\004', '\020', '\004', '*', '\017', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L',
+'_', 'D', 'S', 'T', '_', 'L', 'B', '\"', 'P', '\n', '\017', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l',
+'y', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'V', '4', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022',
+'\013', '\n', '\007', 'V', '6', '_', 'O', 'N', 'L', 'Y', '\020', '\002', '\022', '\020', '\n', '\014', 'V', '4', '_', 'P', 'R', 'E', 'F', 'E', 'R',
+'R', 'E', 'D', '\020', '\003', '\022', '\007', '\n', '\003', 'A', 'L', 'L', '\020', '\004', '\"', 'T', '\n', '\030', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_',
+'C', 'O', 'N', 'F', 'I', 'G', 'U', 'R', 'E', 'D', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\000', '\022', '\033', '\n', '\027',
+'U', 'S', 'E', '_', 'D', 'O', 'W', 'N', 'S', 'T', 'R', 'E', 'A', 'M', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\001',
+':', '\033', '\232', '\305', '\210', '\036', '\026', '\n', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', 'B', '\030', '\n', '\026', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
+'_', 't', 'y', 'p', 'e', 'B', '\013', '\n', '\t', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\014', '\020', '\r', 'J',
+'\004', '\010', '\017', '\020', '\020', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\013', '\020', '\014', 'J', '\004', '\010', '#', '\020', '$', 'R', '\005',
+'h', 'o', 's', 't', 's', 'R', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', '\032', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\332', '\002', '\n',
+'\023', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\010', 'p',
+'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c',
+'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e',
+'s', '\032', '\310', '\001', '\n', '\006', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '`', '\n', '\026', 't', 'y', 'p', 'e', 'd', '_', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c',
+'y', '.', 'P', 'o', 'l', 'i', 'c', 'y', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\003', '\020',
+'\004', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'R', '\004', 'n', 'a', 'm', 'e', 'R', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o',
+'n', 'f', 'i', 'g', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\202', '\001', '\n', '\022',
+'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'D', '\n', '\016', 's', 'o', 'u',
+'r', 'c', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\r',
+'s', 'o', 'u', 'r', 'c', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n',
+'f', 'i', 'g', '\"', '\371', '\001', '\n', '\031', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'G', '\n', '\r', 't', 'c', 'p', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'T', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'R', '\014', 't', 'c', 'p', 'K', 'e', 'e',
+'p', 'a', 'l', 'i', 'v', 'e', '\022', 'd', '\n', '0', 's', 'e', 't', '_', 'l', 'o', 'c', 'a', 'l', '_', 'i', 'n', 't', 'e', 'r',
+'f', 'a', 'c', 'e', '_', 'n', 'a', 'm', 'e', '_', 'o', 'n', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '*', 's', 'e', 't', 'L', 'o', 'c', 'a', 'l', 'I',
+'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 'N', 'a', 'm', 'e', 'O', 'n', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 's', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p',
+'t', 'i', 'o', 'n', 's', '\"', 'r', '\n', '\021', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't',
+'s', '\022', '\'', '\n', '\017', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'b', 'u', 'd', 'g', 'e', 't', 's', '\030', '\001', ' ', '\001', '(',
+'\010', 'R', '\016', 't', 'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', '4', '\n', '\026', 'r', 'e', 'q', 'u',
+'e', 's', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 's', 'i', 'z', 'e', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R',
+'\024', 'r', 'e', 'q', 'u', 'e', 's', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'S', 'i', 'z', 'e', 's', 'B', '\211', '\001', '\n',
+'%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o',
+'t', 'o', 'P', '\001', 'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', ';', 'c', 'l', 'u', 's', 't', 'e',
+'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[21] = {
+static _upb_DefPool_Init *deps[24] = {
&envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit,
&envoy_config_cluster_v3_filter_proto_upbdefinit,
&envoy_config_cluster_v3_outlier_detection_proto_upbdefinit,
@@ -521,6 +532,7 @@ static upb_def_init *deps[21] = {
&envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_health_check_proto_upbdefinit,
&envoy_config_core_v3_protocol_proto_upbdefinit,
+ &envoy_config_core_v3_resolver_proto_upbdefinit,
&envoy_config_endpoint_v3_endpoint_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
@@ -528,6 +540,8 @@ static upb_def_init *deps[21] = {
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&xds_core_v3_collection_entry_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -535,9 +549,9 @@ static upb_def_init *deps[21] = {
NULL
};
-upb_def_init envoy_config_cluster_v3_cluster_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_cluster_v3_cluster_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_cluster_proto_upb_file_layout,
"envoy/config/cluster/v3/cluster.proto",
- UPB_STRVIEW_INIT(descriptor, 10750)
+ UPB_STRINGVIEW_INIT(descriptor, 12169)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
index 1bbc8997..8a7f1075 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
@@ -19,121 +19,131 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_cluster_v3_cluster_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_cluster_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_ClusterCollection_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.ClusterCollection");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_ClusterCollection_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.ClusterCollection");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_TransportSocketMatch_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.TransportSocketMatch");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_TransportSocketMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.TransportSocketMatch");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_CustomClusterType_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.CustomClusterType");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_CustomClusterType_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.CustomClusterType");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_EdsClusterConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.EdsClusterConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_EdsClusterConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.EdsClusterConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_LbSubsetConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.LbSubsetConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_LbSubsetConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.LbSubsetConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.LeastRequestLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_SlowStartConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.SlowStartConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_RingHashLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.RingHashLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.RoundRobinLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_MaglevLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.MaglevLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.LeastRequestLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.OriginalDstLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_RingHashLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.RingHashLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_CommonLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_MaglevLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.MaglevLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.OriginalDstLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_CommonLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.ZoneAwareLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_RefreshRate_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.RefreshRate");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.LocalityWeightedLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_PreconnectPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.PreconnectPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.CommonLbConfig.ConsistentHashingLbConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.TypedExtensionProtocolOptionsEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_RefreshRate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.RefreshRate");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_LoadBalancingPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.LoadBalancingPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_PreconnectPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.PreconnectPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.LoadBalancingPolicy.Policy");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Cluster.TypedExtensionProtocolOptionsEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_UpstreamBindConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.UpstreamBindConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_LoadBalancingPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.LoadBalancingPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_UpstreamConnectionOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.UpstreamConnectionOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.LoadBalancingPolicy.Policy");
}
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_TrackClusterStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.TrackClusterStats");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_UpstreamBindConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.UpstreamBindConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_UpstreamConnectionOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.UpstreamConnectionOptions");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_TrackClusterStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.TrackClusterStats");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
index fbd5db06..1c7aef3d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/filter.upbdefs.h"
+#include "envoy/config/cluster/v3/filter.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_cluster_v3_Filter_msginit,
-};
-
-static const char descriptor[386] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[461] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'f', 'i', 'l', 't', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
@@ -31,13 +26,16 @@ static const char descriptor[386] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c
't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g',
'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n',
'f', 'i', 'g', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '>', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o',
-'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
-'e', 'r', '.', 'v', '3', 'B', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006',
+'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\210', '\001', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'v', '3', 'B', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'H', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o',
+'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
+'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', ';', 'c', 'l', 'u', 's', 't', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006',
'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&google_protobuf_any_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -45,9 +43,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_config_cluster_v3_filter_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_cluster_v3_filter_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_filter_proto_upb_file_layout,
"envoy/config/cluster/v3/filter.proto",
- UPB_STRVIEW_INIT(descriptor, 386)
+ UPB_STRINGVIEW_INIT(descriptor, 461)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h
index 2d4c0258..64607f5d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_cluster_v3_filter_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_filter_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Filter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_filter_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Filter");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_Filter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_filter_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.Filter");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
index 8ab795d9..59be3337 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
@@ -8,19 +8,14 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/outlier_detection.upbdefs.h"
+#include "envoy/config/cluster/v3/outlier_detection.upb.h"
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_cluster_v3_OutlierDetection_msginit,
-};
-
-static const char descriptor[2423] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2582] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022',
'\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032',
'\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n',
@@ -29,7 +24,7 @@ static const char descriptor[2423] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', '
'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a',
'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p',
'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p',
-'r', 'o', 't', 'o', '\"', '\275', '\020', '\n', '\020', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
+'r', 'o', 't', 'o', '\"', '\221', '\021', '\n', '\020', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
'\022', 'E', '\n', '\017', 'c', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', '_', '5', 'x', 'x', '\030', '\001', ' ', '\001', '(', '\013',
'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
'V', 'a', 'l', 'u', 'e', 'R', '\016', 'c', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', '5', 'x', 'x', '\022', '?', '\n', '\010',
@@ -111,15 +106,22 @@ static const char descriptor[2423] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', '
'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'V', 'o', 'l', 'u', 'm', 'e', '\022', 'O', '\n', '\021', 'm', 'a', 'x', '_', 'e', 'j', 'e',
'c', 't', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', '\030', '\025', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001',
-'\002', '*', '\000', 'R', '\017', 'm', 'a', 'x', 'E', 'j', 'e', 'c', 't', 'i', 'o', 'n', 'T', 'i', 'm', 'e', ':', ',', '\232', '\305', '\210',
-'\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
-'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'H', '\n', '%', 'i', 'o', '.', 'e', 'n',
-'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u',
-'s', 't', 'e', 'r', '.', 'v', '3', 'B', '\025', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\002', '*', '\000', 'R', '\017', 'm', 'a', 'x', 'E', 'j', 'e', 'c', 't', 'i', 'o', 'n', 'T', 'i', 'm', 'e', '\022', 'R', '\n', '\030', 'm',
+'a', 'x', '_', 'e', 'j', 'e', 'c', 't', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\026',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\025', 'm', 'a', 'x', 'E', 'j', 'e', 'c', 't', 'i', 'o', 'n', 'T', 'i', 'm', 'e', 'J', 'i',
+'t', 't', 'e', 'r', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
+'B', '\222', '\001', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', 'B', '\025', 'O', 'u', 't', 'l', 'i', 'e',
+'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o',
+'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '/', 'v', '3', ';', 'c', 'l', 'u', 's', 't', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -128,9 +130,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout,
"envoy/config/cluster/v3/outlier_detection.proto",
- UPB_STRVIEW_INIT(descriptor, 2423)
+ UPB_STRINGVIEW_INIT(descriptor, 2582)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h
index 1f055118..f78dba87 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_OutlierDetection_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_outlier_detection_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.OutlierDetection");
+UPB_INLINE const upb_MessageDef *envoy_config_cluster_v3_OutlierDetection_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_cluster_v3_outlier_detection_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.cluster.v3.OutlierDetection");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c
new file mode 100644
index 00000000..3b56230e
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c
@@ -0,0 +1,206 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/common/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/common/matcher/v3/matcher.upbdefs.h"
+#include "envoy/config/common/matcher/v3/matcher.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[4235] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'm', 'm', 'o', 'n', '/', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\036', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'v', '3', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+'/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p',
+'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037',
+'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'s', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\344', '\021', '\n', '\007', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022',
+'X', '\n', '\014', 'm', 'a', 't', 'c', 'h', 'e', 'r', '_', 'l', 'i', 's', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '3', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', 'H',
+'\000', 'R', '\013', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '\022', 'X', '\n', '\014', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'_', 't', 'r', 'e', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', 'H', '\000', 'R', '\013', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'T', 'r', 'e', 'e', '\022', 'O', '\n', '\013', 'o', 'n', '_', 'n', 'o', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013',
+'2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O', 'n', 'M', 'a', 't', 'c', 'h', 'R',
+'\t', 'o', 'n', 'N', 'o', 'M', 'a', 't', 'c', 'h', '\032', '\245', '\001', '\n', '\007', 'O', 'n', 'M', 'a', 't', 'c', 'h', '\022', 'C', '\n',
+'\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a',
+'t', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'D', '\n', '\006', 'a', 'c', 't', 'i', 'o',
+'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i',
+'g', 'H', '\000', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n', 'B', '\017', '\n', '\010', 'o', 'n', '_', 'm', 'a', 't', 'c', 'h', '\022', '\003',
+'\370', 'B', '\001', '\032', '\242', '\t', '\n', '\013', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '\022', 'f', '\n', '\010', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'm', 'a', 't', 'c', 'h', 'e', 'r', 's', '\032', '\334',
+'\006', '\n', '\t', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'z', '\n', '\020', 's', 'i', 'n', 'g', 'l', 'e', '_', 'p', 'r',
+'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', 'M', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '.', 'S', 'i', 'n', 'g', 'l', 'e', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\017', 's', 'i', 'n', 'g',
+'l', 'e', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'l', '\n', '\n', 'o', 'r', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'\030', '\002', ' ', '\001', '(', '\013', '2', 'K', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm',
+'m', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a',
+'t', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'P', 'r', 'e', 'd', 'i',
+'c', 'a', 't', 'e', 'L', 'i', 's', 't', 'H', '\000', 'R', '\t', 'o', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'n', '\n', '\013',
+'a', 'n', 'd', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', 'K', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3',
+'.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd',
+'i', 'c', 'a', 't', 'e', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'L', 'i', 's', 't', 'H', '\000', 'R', '\n', 'a', 'n',
+'d', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '`', '\n', '\013', 'n', 'o', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\004',
+' ', '\001', '(', '\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o',
+'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\n', 'n', 'o', 't', 'M',
+'a', 't', 'c', 'h', 'e', 'r', '\032', '\207', '\002', '\n', '\017', 'S', 'i', 'n', 'g', 'l', 'e', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '\022', 'J', '\n', '\005', 'i', 'n', 'p', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'i', 'n', 'p',
+'u', 't', '\022', 'G', '\n', '\013', 'v', 'a', 'l', 'u', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '$',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't',
+'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\n', 'v', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h',
+'\022', 'O', '\n', '\014', 'c', 'u', 's', 't', 'o', 'm', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '*', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e',
+'d', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\013', 'c', 'u', 's', 't', 'o',
+'m', 'M', 'a', 't', 'c', 'h', 'B', '\016', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032', 'v', '\n',
+'\r', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'L', 'i', 's', 't', '\022', 'e', '\n', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a',
+'t', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.',
+'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372', 'B',
+'\005', '\222', '\001', '\002', '\010', '\002', 'R', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\021', '\n', '\n', 'm', 'a', 't', 'c',
+'h', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\032', '\313', '\001', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 't', 'c',
+'h', 'e', 'r', '\022', 'e', '\n', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '=', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't',
+'.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\t', 'p', 'r', 'e',
+'d', 'i', 'c', 'a', 't', 'e', '\022', 'T', '\n', '\010', 'o', 'n', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O', 'n', 'M', 'a', 't', 'c', 'h', 'B', '\010',
+'\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'o', 'n', 'M', 'a', 't', 'c', 'h', '\032', '\347', '\004', '\n', '\013', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '\022', 'J', '\n', '\005', 'i', 'n', 'p', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '*',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p',
+'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002',
+'\020', '\001', 'R', '\005', 'i', 'n', 'p', 'u', 't', '\022', 'f', '\n', '\017', 'e', 'x', 'a', 'c', 't', '_', 'm', 'a', 't', 'c', 'h', '_',
+'m', 'a', 'p', '\030', '\002', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '.', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', 'H', '\000', 'R', '\r',
+'e', 'x', 'a', 'c', 't', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '\022', 'h', '\n', '\020', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm',
+'a', 't', 'c', 'h', '_', 'm', 'a', 'p', '\030', '\003', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '.', 'M', 'a', 't', 'c', 'h', 'M', 'a',
+'p', 'H', '\000', 'R', '\016', 'p', 'r', 'e', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '\022', 'O', '\n', '\014', 'c', 'u',
+'s', 't', 'o', 'm', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\013', 'c', 'u', 's', 't', 'o', 'm', 'M', 'a', 't', 'c', 'h',
+'\032', '\326', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '\022', 'a', '\n', '\003', 'm', 'a', 'p', '\030', '\001', ' ', '\003', '(',
+'\013', '2', 'E', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'T', 'r', 'e', 'e', '.', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '.', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y', 'B', '\010', '\372',
+'B', '\005', '\232', '\001', '\002', '\010', '\001', 'R', '\003', 'm', 'a', 'p', '\032', 'g', '\n', '\010', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y', '\022',
+'\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', 'E', '\n', '\005', 'v', 'a', 'l', 'u',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'m', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O',
+'n', 'M', 'a', 't', 'c', 'h', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', '\020', '\n', '\t', 't', 'r', 'e', 'e',
+'_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', '\010', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'B', '\023', '\n', '\014', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\350', '\010', '\n', '\016', 'M', 'a', 't', 'c',
+'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'T', '\n', '\010', 'o', 'r', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c', 'h', '\022', 'V', '\n', '\t',
+'a', 'n', 'd', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M',
+'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R',
+'\010', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', '\022', 'M', '\n', '\t', 'n', 'o', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ',
+'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', 'H', '\000', 'R', '\010', 'n', 'o', 't', 'M', 'a', 't', 'c', 'h', '\022', '&', '\n', '\t', 'a', 'n', 'y', '_', 'm', 'a', 't', 'c',
+'h', '\030', '\004', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a',
+'t', 'c', 'h', '\022', 'o', '\n', '\032', 'h', 't', 't', 'p', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e',
+'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't',
+'t', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\027', 'h', 't', 't', 'p', 'R', 'e', 'q',
+'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', 'q', '\n', '\033', 'h', 't', 't', 'p', '_',
+'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ',
+'\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a',
+'t', 'c', 'h', 'H', '\000', 'R', '\030', 'h', 't', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's', 't', 'T', 'r', 'a', 'i', 'l', 'e', 'r',
+'s', 'M', 'a', 't', 'c', 'h', '\022', 'q', '\n', '\033', 'h', 't', 't', 'p', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\007', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\030', 'h', 't', 't',
+'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', 's', '\n', '\034',
+'h', 't', 't', 'p', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\010', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'H', 'e', 'a',
+'d', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\031', 'h', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e',
+'T', 'r', 'a', 'i', 'l', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', '|', '\n', '\037', 'h', 't', 't', 'p', '_', 'r', 'e', 'q',
+'u', 'e', 's', 't', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'b', 'o', 'd', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t',
+' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o',
+'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B',
+'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\033', 'h', 't', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's', 't', 'G', 'e',
+'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '\022', '~', '\n', ' ', 'h', 't', 't', 'p', '_', 'r', 'e',
+'s', 'p', 'o', 'n', 's', 'e', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'b', 'o', 'd', 'y', '_', 'm', 'a', 't', 'c', 'h',
+'\030', '\n', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm',
+'m', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r', 'i',
+'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\034', 'h', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's',
+'e', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '\032', 'Z', '\n', '\010', 'M', 'a', 't', 'c',
+'h', 'S', 'e', 't', '\022', 'N', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '.', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
+'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002',
+'\010', '\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', 'R', '\n',
+'\020', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', '>', '\n', '\007', 'h', 'e', 'a', 'd',
+'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '\"', '\241', '\002', '\n', '\024', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd',
+'y', 'M', 'a', 't', 'c', 'h', '\022', '\037', '\n', '\013', 'b', 'y', 't', 'e', 's', '_', 'l', 'i', 'm', 'i', 't', '\030', '\001', ' ', '\001',
+'(', '\r', 'R', '\n', 'b', 'y', 't', 'e', 's', 'L', 'i', 'm', 'i', 't', '\022', 'k', '\n', '\010', 'p', 'a', 't', 't', 'e', 'r', 'n',
+'s', '\030', '\002', ' ', '\003', '(', '\013', '2', 'E', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'m', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r',
+'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'T', 'e', 'x', 't', 'M', 'a',
+'t', 'c', 'h', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'p', 'a', 't', 't', 'e', 'r', 'n', 's', '\032', '{',
+'\n', '\020', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'T', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', '\022', ',', '\n', '\014', 's', 't', 'r',
+'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H',
+'\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022', ',', '\n', '\014', 'b', 'i', 'n', 'a', 'r', 'y', '_',
+'m', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\014', 'B', '\007', '\372', 'B', '\004', 'z', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 'b',
+'i', 'n', 'a', 'r', 'y', 'M', 'a', 't', 'c', 'h', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\227',
+'\001', '\n', ',', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\014', 'M',
+'a', 't', 'c', 'h', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'O', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l',
+'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'm', 'm', 'o', 'n', '/', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_route_v3_route_components_proto_upbdefinit,
+ &envoy_type_matcher_v3_string_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_common_matcher_v3_matcher_proto_upbdefinit = {
+ deps,
+ &envoy_config_common_matcher_v3_matcher_proto_upb_file_layout,
+ "envoy/config/common/matcher/v3/matcher.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 4235)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h
new file mode 100644
index 00000000..ad829ed7
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h
@@ -0,0 +1,105 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/common/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_common_matcher_v3_matcher_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_OnMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.OnMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherList");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherList.Predicate.PredicateList");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherList.FieldMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherTree_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherTree");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_MatchPredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.MatchPredicate");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_MatchPredicate_MatchSet_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.MatchPredicate.MatchSet");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_HttpHeadersMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.HttpHeadersMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_HttpGenericBodyMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.HttpGenericBodyMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_common_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.common.matcher.v3.HttpGenericBodyMatch.GenericTextMatch");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_COMMON_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
index 25a383a1..ff75af01 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
@@ -8,31 +8,14 @@
#include "upb/def.h"
#include "envoy/config/core/v3/address.upbdefs.h"
+#include "envoy/config/core/v3/address.upb.h"
-extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_config_core_v3_Pipe_msginit,
- &envoy_config_core_v3_EnvoyInternalAddress_msginit,
- &envoy_config_core_v3_SocketAddress_msginit,
- &envoy_config_core_v3_TcpKeepalive_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_CidrRange_msginit,
-};
-
-static const char descriptor[1878] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd',
+extern _upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1947] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd',
'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
'r', 'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
@@ -104,13 +87,15 @@ static const char descriptor[1878] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/',
'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
'e', 'B', '\010', '\372', 'B', '\005', '*', '\003', '\030', '\200', '\001', 'R', '\t', 'p', 'r', 'e', 'f', 'i', 'x', 'L', 'e', 'n', ':', '\"', '\232',
'\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C',
-'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'B', '<', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014', 'A', 'd',
-'d', 'r', 'e', 's', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
-'t', 'o', '3',
+'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'B', '\200', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014', 'A',
+'d', 'd', 'r', 'e', 's', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l',
+'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';',
+'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_config_core_v3_socket_option_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -119,9 +104,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_config_core_v3_address_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_address_proto_upb_file_layout,
"envoy/config/core/v3/address.proto",
- UPB_STRVIEW_INIT(descriptor, 1878)
+ UPB_STRINGVIEW_INIT(descriptor, 1947)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h
index 0bc0604e..050c71e1 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h
@@ -19,41 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Pipe_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Pipe");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Pipe_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Pipe");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_EnvoyInternalAddress_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.EnvoyInternalAddress");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_EnvoyInternalAddress_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.EnvoyInternalAddress");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_SocketAddress_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.SocketAddress");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SocketAddress_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SocketAddress");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_TcpKeepalive_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.TcpKeepalive");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TcpKeepalive_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.TcpKeepalive");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_BindConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.BindConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_BindConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.BindConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Address_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Address");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Address_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Address");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_CidrRange_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_address_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.CidrRange");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_CidrRange_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_address_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.CidrRange");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
index 0b0bbdd4..85af331a 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/config/core/v3/backoff.upbdefs.h"
+#include "envoy/config/core/v3/backoff.upb.h"
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_BackoffStrategy_msginit,
-};
-
-static const char descriptor[465] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[534] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
'c', 'k', 'o', 'f', 'f', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
'/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
@@ -34,13 +29,16 @@ static const char descriptor[465] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', '
'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r',
'v', 'a', 'l', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'o', 'r', 'e', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', 'B', '<', '\n', '\"', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'o', 'r', 'e', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', 'B', '\200', '\001', '\n', '\"',
+'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&google_protobuf_duration_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -48,9 +46,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_config_core_v3_backoff_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_backoff_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_backoff_proto_upb_file_layout,
"envoy/config/core/v3/backoff.proto",
- UPB_STRVIEW_INIT(descriptor, 465)
+ UPB_STRINGVIEW_INIT(descriptor, 534)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h
index e6351d5f..22b9e1fd 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_backoff_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_backoff_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_BackoffStrategy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_backoff_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.BackoffStrategy");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_BackoffStrategy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_backoff_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.BackoffStrategy");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
index a91ff3d6..28442200 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
@@ -8,66 +8,23 @@
#include "upb/def.h"
#include "envoy/config/core/v3/base.upbdefs.h"
+#include "envoy/config/core/v3/base.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_backoff_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_http_uri_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_semantic_version_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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_RuntimePercent_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_WatchedDirectory_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;
-
-static const upb_msglayout *layouts[21] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_core_v3_BuildVersion_msginit,
- &envoy_config_core_v3_Extension_msginit,
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
- &envoy_config_core_v3_RuntimeUInt32_msginit,
- &envoy_config_core_v3_RuntimePercent_msginit,
- &envoy_config_core_v3_RuntimeDouble_msginit,
- &envoy_config_core_v3_RuntimeFeatureFlag_msginit,
- &envoy_config_core_v3_HeaderValue_msginit,
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_HeaderMap_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_RetryPolicy_msginit,
- &envoy_config_core_v3_RemoteDataSource_msginit,
- &envoy_config_core_v3_AsyncDataSource_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_config_core_v3_ControlPlane_msginit,
-};
-
-static const char descriptor[4473] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_backoff_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_http_uri_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_semantic_version_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[5358] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
'r', 'e', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/',
'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c',
@@ -79,176 +36,212 @@ static const char descriptor[4473] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/'
'.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a',
'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
'/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
-'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 't', '\n', '\010', 'L', 'o', 'c',
-'a', 'l', 'i', 't', 'y', '\022', '\026', '\n', '\006', 'r', 'e', 'g', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\006', 'r', 'e',
-'g', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'z', 'o', 'n', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\004', 'z', 'o', 'n', 'e', '\022',
-'\031', '\n', '\010', 's', 'u', 'b', '_', 'z', 'o', 'n', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\007', 's', 'u', 'b', 'Z', 'o', 'n',
-'e', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
-'r', 'e', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\"', '\244', '\001', '\n', '\014', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's',
-'i', 'o', 'n', '\022', '8', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n',
-'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i',
-'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\002',
-' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't',
-'r', 'u', 'c', 't', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's',
-'i', 'o', 'n', '\"', '\342', '\001', '\n', '\t', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e',
-'\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\030',
-'\002', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\022', '\'', '\n', '\017', 't', 'y', 'p', 'e', '_', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\016', 't', 'y', 'p', 'e', 'D', 'e', 's', 'c',
-'r', 'i', 'p', 't', 'o', 'r', '\022', '<', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\"',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i',
-'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\032', '\n', '\010', 'd', 'i', 's',
-'a', 'b', 'l', 'e', 'd', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '\"', '\232', '\305',
-'\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\345', '\004', '\n', '\004', 'N', 'o', 'd', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ',
-'\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\030', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R',
-'\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c',
-'t', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\004',
-' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', '&', '\n', '\017',
-'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\r', 'u', 's',
-'e', 'r', 'A', 'g', 'e', 'n', 't', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\022', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't',
-'_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\020', 'u', 's', 'e', 'r', 'A', 'g', 'e',
-'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', ']', '\n', '\030', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'b',
-'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', 'H', '\000', 'R', '\025', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', '\022', '?', '\n', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\003', '(', '\013', '2',
-'\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'c', 'l',
-'i', 'e', 'n', 't', '_', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\016', 'c', 'l', 'i', 'e',
-'n', 't', 'F', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'R', '\n', '\023', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', '_', 'a',
-'d', 'd', 'r', 'e', 's', 's', 'e', 's', '\030', '\013', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\002', '\030', '\001', 'R',
-'\022', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', 'A', 'd', 'd', 'r', 'e', 's', 's', 'e', 's', ':', '\035', '\232', '\305', '\210', '\036',
-'\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'N', 'o', 'd', 'e',
-'B', '\031', '\n', '\027', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 't', 'y',
-'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\r', 'b', 'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\"', '\346',
-'\001', '\n', '\010', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '[', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e', 't',
-'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'F', 'i', 'l', 't', 'e', 'r',
-'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\032', 'Z', '\n', '\023', 'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't',
-'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '-', '\n', '\005', 'v',
-'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '!', '\232', '\305',
-'\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\022',
-'#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\014', 'd',
-'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e',
-'y', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e',
-'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\"', 'w', '\n', '\016', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', ';', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a',
-'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
-'.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n',
-'\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
-'\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm',
-'e', 'D', 'o', 'u', 'b', 'l', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030',
-'\001', ' ', '\001', '(', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u',
-'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l',
-'e', '\"', '\266', '\001', '\n', '\022', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\022',
-'I', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022',
-'(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e',
-'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\"', '\177', '\n', '\013', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
-'e', '\022', '#', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\021', '\372', 'B', '\016', 'r', '\014', '\020', '\001', '(', '\200',
-'\200', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\003', 'k', 'e', 'y', '\022', '%', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ',
-'\001', '(', '\t', 'B', '\017', '\372', 'B', '\014', 'r', '\n', '(', '\200', '\200', '\001', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\005', 'v', 'a', 'l',
-'u', 'e', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c',
-'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\"', '\270', '\001', '\n', '\021', 'H', 'e', 'a', 'd', 'e',
-'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'C', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\006',
-'h', 'e', 'a', 'd', 'e', 'r', '\022', '2', '\n', '\006', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\006', 'a', 'p', 'p', 'e', 'n', 'd', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i',
-'o', 'n', '\"', 'l', '\n', '\t', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\022', ';', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '\030', '\001', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
-'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\"', '/', '\n', '\020', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i',
-'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '\033', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
-'\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\"', '\266', '\001', '\n', '\n', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c',
-'e', '\022', '%', '\n', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'H', '\000', 'R', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\022', '#', '\n', '\014', 'i', 'n', 'l', 'i', 'n', 'e',
-'_', 'b', 'y', 't', 'e', 's', '\030', '\002', ' ', '\001', '(', '\014', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'B', 'y', 't',
-'e', 's', '\022', '%', '\n', '\r', 'i', 'n', 'l', 'i', 'n', 'e', '_', 's', 't', 'r', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\t',
-'H', '\000', 'R', '\014', 'i', 'n', 'l', 'i', 'n', 'e', 'S', 't', 'r', 'i', 'n', 'g', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u',
-'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\324', '\001', '\n',
-'\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'K', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c',
-'k', '_', 'o', 'f', 'f', '\030', '\001', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y',
-'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't',
-'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013',
-'m', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', ':', '$',
+'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's',
+'/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd',
+'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e',
+'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 't', '\n', '\010', 'L', 'o', 'c', 'a', 'l', 'i', 't',
+'y', '\022', '\026', '\n', '\006', 'r', 'e', 'g', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\006', 'r', 'e', 'g', 'i', 'o', 'n',
+'\022', '\022', '\n', '\004', 'z', 'o', 'n', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\004', 'z', 'o', 'n', 'e', '\022', '\031', '\n', '\010', 's',
+'u', 'b', '_', 'z', 'o', 'n', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\007', 's', 'u', 'b', 'Z', 'o', 'n', 'e', ':', '!', '\232',
+'\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'L',
+'o', 'c', 'a', 'l', 'i', 't', 'y', '\"', '\244', '\001', '\n', '\014', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022',
+'8', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'t', 'y', 'p', 'e', '.', 'v', '3', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\007',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't',
+'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\"',
+'\342', '\001', '\n', '\t', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\030', '\002', ' ', '\001', '(',
+'\t', 'R', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\022', '\'', '\n', '\017', 't', 'y', 'p', 'e', '_', 'd', 'e', 's', 'c', 'r',
+'i', 'p', 't', 'o', 'r', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\016', 't', 'y', 'p', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't',
+'o', 'r', '\022', '<', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e',
+'r', 's', 'i', 'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\032', '\n', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e',
+'d', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n',
+'\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'E', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', '\"', '\262', '\006', '\n', '\004', 'N', 'o', 'd', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R',
+'\002', 'i', 'd', '\022', '\030', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(', '\013', '2', '\027', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\010', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '`', '\n', '\022', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'p', 'a', 'r', 'a', 'm', 'e',
+'t', 'e', 'r', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a',
+'m', 'e', 't', 'e', 'r', 's', 'E', 'n', 't', 'r', 'y', 'R', '\021', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c',
+'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', '&', '\n', '\017', 'u', 's', 'e', 'r', '_', 'a',
+'g', 'e', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\r', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n',
+'t', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\022', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i',
+'o', 'n', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\020', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'V', 'e', 'r', 's',
+'i', 'o', 'n', '\022', ']', '\n', '\030', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'b', 'u', 'i', 'l', 'd', '_', 'v',
+'e', 'r', 's', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'H', '\000',
+'R', '\025', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '?',
+'\n', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 'R', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'c', 'l', 'i', 'e', 'n', 't', '_', 'f',
+'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't', 'F', 'e', 'a', 't',
+'u', 'r', 'e', 's', '\022', '[', '\n', '\023', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', '_', 'a', 'd', 'd', 'r', 'e', 's', 's',
+'e', 's', '\030', '\013', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3',
+'.', '0', 'R', '\022', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', 'A', 'd', 'd', 'r', 'e', 's', 's', 'e', 's', '\032', '`', '\n',
+'\026', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020',
+'\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '0', '\n', '\005', 'v', 'a', 'l', 'u', 'e',
+'\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't',
+'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '\035', '\232', '\305', '\210',
+'\036', '\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'N', 'o', 'd',
+'e', 'B', '\031', '\n', '\027', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 't',
+'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\r', 'b', 'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\"',
+'\261', '\003', '\n', '\010', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '[', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e',
+'t', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'F', 'i', 'l', 't', 'e',
+'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\022', 'k', '\n', '\025', 't', 'y', 'p', 'e', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\030', '\002', ' ', '\003', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'T', 'y', 'p', 'e', 'd', 'F',
+'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\023', 't', 'y', 'p', 'e', 'd',
+'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'Z', '\n', '\023', 'F', 'i', 'l', 't', 'e', 'r', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\003', 'k', 'e', 'y', '\022', '-', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l',
+'u', 'e', ':', '\002', '8', '\001', '\032', '\\', '\n', '\030', 'T', 'y', 'p', 'e', 'd', 'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a',
+'d', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k',
+'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001',
+':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r',
+'e', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n',
+'t', '3', '2', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(',
+'\r', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm',
+'e', '_', 'k', 'e', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n',
+'t', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\"', 'w', '\n',
+'\016', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', ';', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l',
+'t', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u',
+'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372',
+'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', '\"', '\206', '\001', '\n', '\r', 'R', 'u',
+'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a',
+'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(',
+'\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
+'\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D',
+'o', 'u', 'b', 'l', 'e', '\"', '\266', '\001', '\n', '\022', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F',
+'l', 'a', 'g', '\022', 'I', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V',
+'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a',
+'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '+', '\232', '\305', '\210',
+'\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n',
+'t', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\"', 'A', '\n', '\016', 'Q', 'u', 'e', 'r', 'y', 'P',
+'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t',
+'R', '\005', 'v', 'a', 'l', 'u', 'e', '\"', '\177', '\n', '\013', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '#', '\n',
+'\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\021', '\372', 'B', '\016', 'r', '\014', '\020', '\001', '(', '\200', '\200', '\001', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\003', 'k', 'e', 'y', '\022', '%', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B',
+'\017', '\372', 'B', '\014', 'r', '\n', '(', '\200', '\200', '\001', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '$',
'\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
-'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\350', '\001', '\n', '\020', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't',
-'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'B', '\n', '\010', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H',
-'t', 't', 'p', 'U', 'r', 'i', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'h', 't', 't', 'p', 'U', 'r', 'i',
-'\022', '\037', '\n', '\006', 's', 'h', 'a', '2', '5', '6', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
-'R', '\006', 's', 'h', 'a', '2', '5', '6', '\022', 'D', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030',
-'\003', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l',
-'i', 'c', 'y', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'o', 'r', 'e', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\311', '\001', '\n',
-'\017', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\005', 'l', 'o', 'c', 'a', 'l',
-'\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
-'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\005', 'l', 'o', 'c', 'a', 'l', '\022',
-'@', '\n', '\006', 'r', 'e', 'm', 'o', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S',
-'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\006', 'r', 'e', 'm', 'o', 't', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't',
-'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001',
-'\"', '\260', '\001', '\n', '\017', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', '\033', '\n', '\004', 'n',
-'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022',
-'9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p',
-'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't',
-'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o',
-'n', 'f', 'i', 'g', '\"', '\277', '\001', '\n', '\030', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a',
-'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'O', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e',
-'\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r',
-'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e',
-'_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '1', '\232',
-'\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\"', 'U',
-'\n', '\014', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '\022', '\036', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f',
-'i', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', ':', '%', '\232', '\305',
-'\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o',
-'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '*', '(', '\n', '\017', 'R', 'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o',
-'r', 'i', 't', 'y', '\022', '\013', '\n', '\007', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\010', '\n', '\004', 'H', 'I', 'G', 'H',
-'\020', '\001', '*', '\211', '\001', '\n', '\r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'e', 't', 'h', 'o', 'd', '\022', '\026', '\n', '\022', 'M',
-'E', 'T', 'H', 'O', 'D', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\007', '\n', '\003', 'G', 'E',
-'T', '\020', '\001', '\022', '\010', '\n', '\004', 'H', 'E', 'A', 'D', '\020', '\002', '\022', '\010', '\n', '\004', 'P', 'O', 'S', 'T', '\020', '\003', '\022', '\007',
-'\n', '\003', 'P', 'U', 'T', '\020', '\004', '\022', '\n', '\n', '\006', 'D', 'E', 'L', 'E', 'T', 'E', '\020', '\005', '\022', '\013', '\n', '\007', 'C', 'O',
-'N', 'N', 'E', 'C', 'T', '\020', '\006', '\022', '\013', '\n', '\007', 'O', 'P', 'T', 'I', 'O', 'N', 'S', '\020', '\007', '\022', '\t', '\n', '\005', 'T',
-'R', 'A', 'C', 'E', '\020', '\010', '\022', '\t', '\n', '\005', 'P', 'A', 'T', 'C', 'H', '\020', '\t', '*', '>', '\n', '\020', 'T', 'r', 'a', 'f',
-'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\022', '\017', '\n', '\013', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I',
-'E', 'D', '\020', '\000', '\022', '\013', '\n', '\007', 'I', 'N', 'B', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\014', '\n', '\010', 'O', 'U', 'T', 'B',
-'O', 'U', 'N', 'D', '\020', '\002', 'B', '9', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\t', 'B', 'a', 's', 'e',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\"', '\211', '\003', '\n', '\021', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'C', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e',
+'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\006', 'h', 'e', 'a', 'd',
+'e', 'r', '\022', '2', '\n', '\006', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\006', 'a', 'p',
+'p', 'e', 'n', 'd', '\022', 'i', '\n', '\r', 'a', 'p', 'p', 'e', 'n', 'd', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001',
+'(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r',
+'A', 'p', 'p', 'e', 'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'a',
+'p', 'p', 'e', 'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'd', '\n', '\022', 'H', 'e', 'a', 'd', 'e', 'r', 'A', 'p', 'p', 'e',
+'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\033', '\n', '\027', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'I', 'F', '_', 'E', 'X', 'I',
+'S', 'T', 'S', '_', 'O', 'R', '_', 'A', 'D', 'D', '\020', '\000', '\022', '\021', '\n', '\r', 'A', 'D', 'D', '_', 'I', 'F', '_', 'A', 'B',
+'S', 'E', 'N', 'T', '\020', '\001', '\022', '\036', '\n', '\032', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T', 'E', '_', 'I', 'F', '_', 'E', 'X',
+'I', 'S', 'T', 'S', '_', 'O', 'R', '_', 'A', 'D', 'D', '\020', '\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
+'e', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'l', '\n', '\t', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\022', ';', '\n', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\"', '/', '\n', '\020', 'W', 'a', 't', 'c',
+'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '\033', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\"', '\364', '\001', '\n', '\n', 'D', 'a', 't', 'a',
+'S', 'o', 'u', 'r', 'c', 'e', '\022', '%', '\n', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\022', '#', '\n', '\014', 'i',
+'n', 'l', 'i', 'n', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\002', ' ', '\001', '(', '\014', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i',
+'n', 'e', 'B', 'y', 't', 'e', 's', '\022', '%', '\n', '\r', 'i', 'n', 'l', 'i', 'n', 'e', '_', 's', 't', 'r', 'i', 'n', 'g', '\030',
+'\003', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\014', 'i', 'n', 'l', 'i', 'n', 'e', 'S', 't', 'r', 'i', 'n', 'g', '\022', '<', '\n', '\024',
+'e', 'n', 'v', 'i', 'r', 'o', 'n', 'm', 'e', 'n', 't', '_', 'v', 'a', 'r', 'i', 'a', 'b', 'l', 'e', '\030', '\004', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\023', 'e', 'n', 'v', 'i', 'r', 'o', 'n', 'm', 'e', 'n', 't',
+'V', 'a', 'r', 'i', 'a', 'b', 'l', 'e', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\020', '\n', '\t', 's',
+'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\324', '\001', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o',
+'l', 'i', 'c', 'y', '\022', 'K', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y', 'R', '\014', 'r', 'e', 't', 'r', 'y', 'B',
+'a', 'c', 'k', 'O', 'f', 'f', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
+'3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r',
+'i', 'e', 's', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l',
+'i', 'c', 'y', '\"', '\350', '\001', '\n', '\020', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022',
+'B', '\n', '\010', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'U', 'r', 'i', 'B', '\010',
+'\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'h', 't', 't', 'p', 'U', 'r', 'i', '\022', '\037', '\n', '\006', 's', 'h', 'a', '2',
+'5', '6', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\006', 's', 'h', 'a', '2', '5', '6',
+'\022', 'D', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r',
+'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', ':', ')', '\232', '\305', '\210',
+'\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'e', 'm',
+'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\311', '\001', '\n', '\017', 'A', 's', 'y', 'n', 'c', 'D', 'a',
+'t', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\005', 'l', 'o', 'c', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't',
+'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\005', 'l', 'o', 'c', 'a', 'l', '\022', '@', '\n', '\006', 'r', 'e', 'm', 'o', 't',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R',
+'\006', 'r', 'e', 'm', 'o', 't', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B',
+'\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\260', '\001', '\n', '\017', 'T', 'r', 'a',
+'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
+':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r',
+'e', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f',
+'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\277', '\001', '\n',
+'\030', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't',
+'\022', 'O', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l',
+'t', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001',
+'(', '\t', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r',
+'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\"', 'U', '\n', '\014', 'C', 'o', 'n', 't', 'r', 'o',
+'l', 'P', 'l', 'a', 'n', 'e', '\022', '\036', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\030', '\001', ' ', '\001', '(',
+'\t', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'P', 'l', 'a',
+'n', 'e', '*', '(', '\n', '\017', 'R', 'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', '\013', '\n', '\007',
+'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\010', '\n', '\004', 'H', 'I', 'G', 'H', '\020', '\001', '*', '\211', '\001', '\n', '\r', 'R',
+'e', 'q', 'u', 'e', 's', 't', 'M', 'e', 't', 'h', 'o', 'd', '\022', '\026', '\n', '\022', 'M', 'E', 'T', 'H', 'O', 'D', '_', 'U', 'N',
+'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\007', '\n', '\003', 'G', 'E', 'T', '\020', '\001', '\022', '\010', '\n', '\004', 'H',
+'E', 'A', 'D', '\020', '\002', '\022', '\010', '\n', '\004', 'P', 'O', 'S', 'T', '\020', '\003', '\022', '\007', '\n', '\003', 'P', 'U', 'T', '\020', '\004', '\022',
+'\n', '\n', '\006', 'D', 'E', 'L', 'E', 'T', 'E', '\020', '\005', '\022', '\013', '\n', '\007', 'C', 'O', 'N', 'N', 'E', 'C', 'T', '\020', '\006', '\022',
+'\013', '\n', '\007', 'O', 'P', 'T', 'I', 'O', 'N', 'S', '\020', '\007', '\022', '\t', '\n', '\005', 'T', 'R', 'A', 'C', 'E', '\020', '\010', '\022', '\t',
+'\n', '\005', 'P', 'A', 'T', 'C', 'H', '\020', '\t', '*', '>', '\n', '\020', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c',
+'t', 'i', 'o', 'n', '\022', '\017', '\n', '\013', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\013', '\n', '\007',
+'I', 'N', 'B', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\014', '\n', '\010', 'O', 'U', 'T', 'B', 'O', 'U', 'N', 'D', '\020', '\002', 'B', '}',
+'\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\t', 'B', 'a', 's', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[13] = {
+static _upb_DefPool_Init *deps[15] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_backoff_proto_upbdefinit,
&envoy_config_core_v3_http_uri_proto_upbdefinit,
@@ -257,6 +250,8 @@ static upb_def_init *deps[13] = {
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &xds_core_v3_context_params_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -264,9 +259,9 @@ static upb_def_init *deps[13] = {
NULL
};
-upb_def_init envoy_config_core_v3_base_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_base_proto_upb_file_layout,
"envoy/config/core/v3/base.proto",
- UPB_STRVIEW_INIT(descriptor, 4473)
+ UPB_STRINGVIEW_INIT(descriptor, 5358)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
index 4464edaf..93f5696e 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
@@ -19,111 +19,126 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Locality_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Locality");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Locality_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Locality");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_BuildVersion_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.BuildVersion");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_BuildVersion_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.BuildVersion");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Extension_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Extension");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Extension_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Extension");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Node_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Node");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Node_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Node");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Metadata_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Metadata");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Node_DynamicParametersEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Node.DynamicParametersEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Metadata_FilterMetadataEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Metadata.FilterMetadataEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Metadata_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Metadata");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeUInt32_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeUInt32");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Metadata_FilterMetadataEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Metadata.FilterMetadataEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimePercent_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimePercent");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Metadata.TypedFilterMetadataEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeDouble_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeDouble");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RuntimeUInt32_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RuntimeUInt32");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeFeatureFlag_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeFeatureFlag");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RuntimePercent_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RuntimePercent");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HeaderValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HeaderValue");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RuntimeDouble_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RuntimeDouble");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HeaderValueOption_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HeaderValueOption");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RuntimeFeatureFlag_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RuntimeFeatureFlag");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HeaderMap_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HeaderMap");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_QueryParameter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.QueryParameter");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_WatchedDirectory_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.WatchedDirectory");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HeaderValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HeaderValue");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_DataSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.DataSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HeaderValueOption_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HeaderValueOption");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RetryPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RetryPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HeaderMap_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HeaderMap");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RemoteDataSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RemoteDataSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_WatchedDirectory_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.WatchedDirectory");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_AsyncDataSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.AsyncDataSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_DataSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.DataSource");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_TransportSocket_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.TransportSocket");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RetryPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RetryPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeFractionalPercent_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeFractionalPercent");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RemoteDataSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RemoteDataSource");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_ControlPlane_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.ControlPlane");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AsyncDataSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AsyncDataSource");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TransportSocket_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.TransportSocket");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RuntimeFractionalPercent_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RuntimeFractionalPercent");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ControlPlane_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.ControlPlane");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
index 6eb77098..cf5de8ff 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
@@ -8,123 +8,148 @@
#include "upb/def.h"
#include "envoy/config/core/v3/config_source.upbdefs.h"
+#include "envoy/config/core/v3/config_source.upb.h"
-extern upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init xds_core_v3_authority_proto_upbdefinit;
-extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_AggregatedConfigSource_msginit,
- &envoy_config_core_v3_SelfConfigSource_msginit,
- &envoy_config_core_v3_RateLimitSettings_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
-};
-
-static const char descriptor[2238] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_authority_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[3037] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
-'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
-'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u',
-'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'x', 'd', 's', '/',
-'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#',
-'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
-'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
-'o', '\"', '\233', '\006', '\n', '\017', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'R', '\n', '\010',
-'a', 'p', 'i', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u',
-'r', 'c', 'e', '.', 'A', 'p', 'i', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\007', 'a', 'p',
-'i', 'T', 'y', 'p', 'e', '\022', '^', '\n', '\025', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'a', 'p', 'i', '_', 'v', 'e',
-'r', 's', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
-'\202', '\001', '\002', '\020', '\001', 'R', '\023', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o',
-'n', '\022', '#', '\n', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'n', 'a', 'm', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t', 'R',
-'\014', 'c', 'l', 'u', 's', 't', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', 'F', '\n', '\r', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r',
-'v', 'i', 'c', 'e', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'R', '\014', 'g', 'r',
-'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '>', '\n', '\r', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'd', 'e', 'l',
-'a', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\014', 'r', 'e', 'f', 'r', 'e', 's', 'h', 'D', 'e', 'l', 'a', 'y', '\022',
-'L', '\n', '\017', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\005', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i', 'm', 'e', 'o',
-'u', 't', '\022', 'W', '\n', '\023', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's',
-'\030', '\006', ' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
-'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\021', 'r',
-'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022', 'A', '\n', '\036', 's', 'e', 't', '_', 'n',
-'o', 'd', 'e', '_', 'o', 'n', '_', 'f', 'i', 'r', 's', 't', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 'o', 'n', 'l', 'y',
-'\030', '\007', ' ', '\001', '(', '\010', 'R', '\031', 's', 'e', 't', 'N', 'o', 'd', 'e', 'O', 'n', 'F', 'i', 'r', 's', 't', 'M', 'e', 's',
-'s', 'a', 'g', 'e', 'O', 'n', 'l', 'y', '\"', '\222', '\001', '\n', '\007', 'A', 'p', 'i', 'T', 'y', 'p', 'e', '\022', '3', '\n', '%', 'D',
-'E', 'P', 'R', 'E', 'C', 'A', 'T', 'E', 'D', '_', 'A', 'N', 'D', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E',
-'_', 'D', 'O', '_', 'N', 'O', 'T', '_', 'U', 'S', 'E', '\020', '\000', '\032', '\010', '\010', '\001', '\250', '\367', '\264', '\213', '\002', '\001', '\022', '\010',
-'\n', '\004', 'R', 'E', 'S', 'T', '\020', '\001', '\022', '\010', '\n', '\004', 'G', 'R', 'P', 'C', '\020', '\002', '\022', '\016', '\n', '\n', 'D', 'E', 'L',
-'T', 'A', '_', 'G', 'R', 'P', 'C', '\020', '\003', '\022', '\023', '\n', '\017', 'A', 'G', 'G', 'R', 'E', 'G', 'A', 'T', 'E', 'D', '_', 'G',
-'R', 'P', 'C', '\020', '\005', '\022', '\031', '\n', '\025', 'A', 'G', 'G', 'R', 'E', 'G', 'A', 'T', 'E', 'D', '_', 'D', 'E', 'L', 'T', 'A',
-'_', 'G', 'R', 'P', 'C', '\020', '\006', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"',
-'I', '\n', '\026', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e',
-':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r',
-'e', '.', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"',
-'\235', '\001', '\n', '\020', 'S', 'e', 'l', 'f', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '^', '\n', '\025', 't',
-'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'a', 'p', 'i', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(',
-'\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\023', 't', 'r', 'a',
-'n', 's', 'p', 'o', 'r', 't', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'S', 'e', 'l', 'f', 'C', 'o', 'n',
-'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\307', '\001', '\n', '\021', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e',
-'t', 't', 'i', 'n', 'g', 's', '\022', ';', '\n', '\n', 'm', 'a', 'x', '_', 't', 'o', 'k', 'e', 'n', 's', '\030', '\001', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'm', 'a', 'x', 'T', 'o', 'k', 'e', 'n', 's', '\022', 'I', '\n', '\t', 'f', 'i', 'l', 'l',
-'_', 'r', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\016', '\372', 'B', '\013', '\022', '\t', '!', '\000',
-'\000', '\000', '\000', '\000', '\000', '\000', '\000', 'R', '\010', 'f', 'i', 'l', 'l', 'R', 'a', 't', 'e', ':', '*', '\232', '\305', '\210', '\036', '%', '\n',
-'#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i',
-'m', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\"', '\247', '\004', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u',
-'r', 'c', 'e', '\022', '8', '\n', '\013', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'i', 'e', 's', '\030', '\007', ' ', '\003', '(', '\013', '2',
-'\026', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', 'R', '\013',
-'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'i', 'e', 's', '\022', '\024', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t',
-'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'S', '\n', '\021', 'a', 'p', 'i', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o',
-'u', 'r', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H',
-'\000', 'R', '\017', 'a', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '@', '\n', '\003', 'a', 'd', 's',
-'\030', '\003', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
-'e', '.', 'v', '3', '.', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r',
-'c', 'e', 'H', '\000', 'R', '\003', 'a', 'd', 's', '\022', '<', '\n', '\004', 's', 'e', 'l', 'f', '\030', '\005', ' ', '\001', '(', '\013', '2', '&',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'e', 'l',
-'f', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\004', 's', 'e', 'l', 'f', '\022', 'M', '\n', '\025',
-'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'f', 'e', 't', 'c', 'h', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001',
-'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'R', '\023', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'F', 'e', 't', 'c', 'h', 'T', 'i', 'm', 'e', 'o', 'u', 't',
-'\022', '\\', '\n', '\024', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'a', 'p', 'i', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030',
-'\006', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
-'\022', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', '%', '\232', '\305', '\210', '\036',
-' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o', 'n', 'f',
-'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\036', '\n', '\027', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e',
-'_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '*', '.', '\n', '\n', 'A', 'p', 'i', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', '\022', '\014', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\032', '\002', '\010', '\001', '\022', '\n', '\n', '\002', 'V', '2', '\020',
-'\001', '\032', '\002', '\010', '\001', '\022', '\006', '\n', '\002', 'V', '3', '\020', '\002', 'B', 'A', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
-'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', 'B', '\021', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e',
+'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
+'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'x', 'd', 's', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n',
+'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i',
+'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"',
+'\364', '\006', '\n', '\017', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'R', '\n', '\010', 'a', 'p',
+'i', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c',
+'e', '.', 'A', 'p', 'i', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\007', 'a', 'p', 'i', 'T',
+'y', 'p', 'e', '\022', '^', '\n', '\025', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'a', 'p', 'i', '_', 'v', 'e', 'r', 's',
+'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001',
+'\002', '\020', '\001', 'R', '\023', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022',
+'#', '\n', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'n', 'a', 'm', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\014', 'c',
+'l', 'u', 's', 't', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', 'F', '\n', '\r', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i',
+'c', 'e', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'R', '\014', 'g', 'r', 'p', 'c',
+'S', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\022', '>', '\n', '\r', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'd', 'e', 'l', 'a', 'y',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\014', 'r', 'e', 'f', 'r', 'e', 's', 'h', 'D', 'e', 'l', 'a', 'y', '\022', 'L', '\n',
+'\017', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B',
+'\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't',
+'\022', 'W', '\n', '\023', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's', '\030', '\006',
+' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\021', 'r', 'a', 't',
+'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022', 'A', '\n', '\036', 's', 'e', 't', '_', 'n', 'o', 'd',
+'e', '_', 'o', 'n', '_', 'f', 'i', 'r', 's', 't', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 'o', 'n', 'l', 'y', '\030', '\007',
+' ', '\001', '(', '\010', 'R', '\031', 's', 'e', 't', 'N', 'o', 'd', 'e', 'O', 'n', 'F', 'i', 'r', 's', 't', 'M', 'e', 's', 's', 'a',
+'g', 'e', 'O', 'n', 'l', 'y', '\022', 'W', '\n', '\021', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'o',
+'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\020', 'c', 'o', 'n', 'f', 'i', 'g', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', 's', '\"', '\222', '\001', '\n', '\007',
+'A', 'p', 'i', 'T', 'y', 'p', 'e', '\022', '3', '\n', '%', 'D', 'E', 'P', 'R', 'E', 'C', 'A', 'T', 'E', 'D', '_', 'A', 'N', 'D',
+'_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '_', 'D', 'O', '_', 'N', 'O', 'T', '_', 'U', 'S', 'E', '\020', '\000',
+'\032', '\010', '\010', '\001', '\250', '\367', '\264', '\213', '\002', '\001', '\022', '\010', '\n', '\004', 'R', 'E', 'S', 'T', '\020', '\001', '\022', '\010', '\n', '\004', 'G',
+'R', 'P', 'C', '\020', '\002', '\022', '\016', '\n', '\n', 'D', 'E', 'L', 'T', 'A', '_', 'G', 'R', 'P', 'C', '\020', '\003', '\022', '\023', '\n', '\017',
+'A', 'G', 'G', 'R', 'E', 'G', 'A', 'T', 'E', 'D', '_', 'G', 'R', 'P', 'C', '\020', '\005', '\022', '\031', '\n', '\025', 'A', 'G', 'G', 'R',
+'E', 'G', 'A', 'T', 'E', 'D', '_', 'D', 'E', 'L', 'T', 'A', '_', 'G', 'R', 'P', 'C', '\020', '\006', ':', '(', '\232', '\305', '\210', '\036',
+'#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 'p', 'i', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"', 'I', '\n', '\026', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd',
+'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\235', '\001', '\n', '\020', 'S', 'e', 'l', 'f', 'C', 'o', 'n', 'f', 'i',
+'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '^', '\n', '\025', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'a', 'p', 'i', '_',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372',
+'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\023', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'A', 'p', 'i', 'V', 'e', 'r', 's',
+'i', 'o', 'n', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'c', 'o', 'r', 'e', '.', 'S', 'e', 'l', 'f', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\307', '\001', '\n',
+'\021', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022', ';', '\n', '\n', 'm', 'a', 'x',
+'_', 't', 'o', 'k', 'e', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'm', 'a', 'x', 'T', 'o',
+'k', 'e', 'n', 's', '\022', 'I', '\n', '\t', 'f', 'i', 'l', 'l', '_', 'r', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a',
+'l', 'u', 'e', 'B', '\016', '\372', 'B', '\013', '\022', '\t', '!', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', 'R', '\010', 'f', 'i', 'l', 'l',
+'R', 'a', 't', 'e', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'c', 'o', 'r', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\"', '\204',
+'\001', '\n', '\020', 'P', 'a', 't', 'h', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '\033', '\n', '\004', 'p', 'a',
+'t', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'S',
+'\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W',
+'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D',
+'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\"', '\214', '\005', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e',
+'\022', '8', '\n', '\013', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'i', 'e', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', '\026', '.', 'x',
+'d', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', 'R', '\013', 'a', 'u', 't',
+'h', 'o', 'r', 'i', 't', 'i', 'e', 's', '\022', '!', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\030',
+'\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'V', '\n', '\022', 'p', 'a', 't',
+'h', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\010', ' ', '\001', '(', '\013', '2', '&', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\020', 'p', 'a', 't', 'h', 'C', 'o', 'n', 'f', 'i', 'g',
+'S', 'o', 'u', 'r', 'c', 'e', '\022', 'S', '\n', '\021', 'a', 'p', 'i', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r',
+'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R',
+'\017', 'a', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '@', '\n', '\003', 'a', 'd', 's', '\030', '\003',
+' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'A', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e',
+'H', '\000', 'R', '\003', 'a', 'd', 's', '\022', '<', '\n', '\004', 's', 'e', 'l', 'f', '\030', '\005', ' ', '\001', '(', '\013', '2', '&', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'e', 'l', 'f', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\004', 's', 'e', 'l', 'f', '\022', 'M', '\n', '\025', 'i', 'n',
+'i', 't', 'i', 'a', 'l', '_', 'f', 'e', 't', 'c', 'h', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'R', '\023', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'F', 'e', 't', 'c', 'h', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\\',
+'\n', '\024', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'a', 'p', 'i', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\006', ' ',
+'\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\022', 'r',
+'e', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n',
+'\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o', 'n', 'f', 'i', 'g',
+'S', 'o', 'u', 'r', 'c', 'e', 'B', '\036', '\n', '\027', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '_', 's',
+'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\236', '\002', '\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_',
+'s', 'o', 'u', 'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010',
+'\372', 'B', '\005', '\242', '\001', '\002', '\010', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', ';', '\n',
+'\016', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\r', 'd', 'e', 'f', 'a', 'u',
+'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '$', 'a', 'p', 'p', 'l', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'w', 'i', 't', 'h', 'o', 'u', 't', '_', 'w', 'a', 'r', 'm', 'i', 'n', 'g', '\030', '\003',
+' ', '\001', '(', '\010', 'R', ' ', 'a', 'p', 'p', 'l', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'W',
+'i', 't', 'h', 'o', 'u', 't', 'W', 'a', 'r', 'm', 'i', 'n', 'g', '\022', '%', '\n', '\t', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l',
+'s', '\030', '\004', ' ', '\003', '(', '\t', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 't', 'y', 'p', 'e', 'U', 'r',
+'l', 's', '*', '@', '\n', '\n', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\025', '\n', '\004', 'A', 'U', 'T', 'O', '\020',
+'\000', '\032', '\013', '\010', '\001', '\212', '\364', '\233', '\263', '\005', '\003', '3', '.', '0', '\022', '\023', '\n', '\002', 'V', '2', '\020', '\001', '\032', '\013', '\010',
+'\001', '\212', '\364', '\233', '\263', '\005', '\003', '3', '.', '0', '\022', '\006', '\n', '\002', 'V', '3', '\020', '\002', 'B', '\205', '\001', '\n', '\"', 'i', 'o',
+'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\021', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321',
+'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[9] = {
+static _upb_DefPool_Init *deps[12] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&xds_core_v3_authority_proto_upbdefinit,
@@ -135,9 +160,9 @@ static upb_def_init *deps[9] = {
NULL
};
-upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_config_source_proto_upb_file_layout,
"envoy/config/core/v3/config_source.proto",
- UPB_STRVIEW_INIT(descriptor, 2238)
+ UPB_STRINGVIEW_INIT(descriptor, 3037)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h
index c61a3a63..14694493 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h
@@ -19,31 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_ApiConfigSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.ApiConfigSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ApiConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.ApiConfigSource");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_AggregatedConfigSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.AggregatedConfigSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AggregatedConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AggregatedConfigSource");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_SelfConfigSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.SelfConfigSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SelfConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SelfConfigSource");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_RateLimitSettings_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RateLimitSettings");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_RateLimitSettings_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.RateLimitSettings");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_ConfigSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.ConfigSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_PathConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.PathConfigSource");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.ConfigSource");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ExtensionConfigSource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_config_source_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.ExtensionConfigSource");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
index 3de56597..4e05b6d4 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/config/core/v3/event_service_config.upbdefs.h"
+#include "envoy/config/core/v3/event_service_config.upb.h"
-extern upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
-};
-
-static const char descriptor[456] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v',
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[525] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v',
'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022',
'\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n',
'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's',
@@ -34,13 +29,15 @@ static const char descriptor[456] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c
'\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\036', '\n', '\027', 'c', 'o', 'n',
'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001',
-'B', 'G', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\027', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i',
-'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
-'p', 'r', 'o', 't', 'o', '3',
+'B', '\213', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\027', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v',
+'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.',
+'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l',
+'-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/',
+'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_config_core_v3_grpc_service_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -48,9 +45,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_event_service_config_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_event_service_config_proto_upb_file_layout,
"envoy/config/core/v3/event_service_config.proto",
- UPB_STRVIEW_INIT(descriptor, 456)
+ UPB_STRINGVIEW_INIT(descriptor, 525)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h
index b51d7e45..aeb42872 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_event_service_config_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_EventServiceConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_event_service_config_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.EventServiceConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_EventServiceConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_event_service_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.EventServiceConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
index 3518a9a7..b602a97c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
@@ -8,59 +8,40 @@
#include "upb/def.h"
#include "envoy/config/core/v3/extension.upbdefs.h"
+#include "envoy/config/core/v3/extension.upb.h"
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
-};
-
-static const char descriptor[666] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[404] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x',
't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
-'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p',
-'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't',
-'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i',
-'d', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'v', '\n', '\024', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\010', '\372', 'B', '\005', '\242', '\001', '\002', '\010', '\001', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C',
-'o', 'n', 'f', 'i', 'g', '\"', '\236', '\002', '\n', '\025', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g',
-'S', 'o', 'u', 'r', 'c', 'e', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\242', '\001', '\002', '\010', '\001',
-'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', ';', '\n', '\016', 'd', 'e', 'f', 'a', 'u', 'l', 't',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g',
-'\022', 'N', '\n', '$', 'a', 'p', 'p', 'l', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_',
-'w', 'i', 't', 'h', 'o', 'u', 't', '_', 'w', 'a', 'r', 'm', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\010', 'R', ' ', 'a', 'p',
-'p', 'l', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'W', 'i', 't', 'h', 'o', 'u', 't', 'W', 'a',
-'r', 'm', 'i', 'n', 'g', '\022', '%', '\n', '\t', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', 's', '\030', '\004', ' ', '\003', '(', '\t', 'B',
-'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 't', 'y', 'p', 'e', 'U', 'r', 'l', 's', 'B', '>', '\n', '\"', 'i', 'o',
-'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001',
-'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'v', '\n', '\024', 'T', 'y', 'p',
+'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\014',
+'t', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\010', '\372', 'B', '\005', '\242', '\001', '\002', '\010', '\001',
+'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\202', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', 'B', '\016', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n',
+'t', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
+'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
- &envoy_config_core_v3_config_source_proto_upbdefinit,
+static _upb_DefPool_Init *deps[4] = {
&google_protobuf_any_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_core_v3_extension_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_extension_proto_upb_file_layout,
"envoy/config/core/v3/extension.proto",
- UPB_STRVIEW_INIT(descriptor, 666)
+ UPB_STRINGVIEW_INIT(descriptor, 404)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h
index e60f9421..b13c47cb 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h
@@ -19,16 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_TypedExtensionConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_extension_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.TypedExtensionConfig");
-}
-
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_ExtensionConfigSource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_extension_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.ExtensionConfigSource");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TypedExtensionConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_extension_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.TypedExtensionConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c
new file mode 100644
index 00000000..f1497476
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_method_list.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/core/v3/grpc_method_list.upbdefs.h"
+#include "envoy/config/core/v3/grpc_method_list.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[573] = {'\n', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r',
+'p', 'c', '_', 'm', 'e', 't', 'h', 'o', 'd', '_', 'l', 'i', 's', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
+'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\212', '\002', '\n', '\016', 'G', 'r', 'p', 'c', 'M', 'e', 't', 'h', 'o', 'd', 'L', 'i',
+'s', 't', '\022', 'H', '\n', '\010', 's', 'e', 'r', 'v', 'i', 'c', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ',', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'M', 'e',
+'t', 'h', 'o', 'd', 'L', 'i', 's', 't', '.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'R', '\010', 's', 'e', 'r', 'v', 'i', 'c', 'e',
+'s', '\032', '\204', '\001', '\n', '\007', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\014', 'm', 'e', 't', 'h',
+'o', 'd', '_', 'n', 'a', 'm', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R',
+'\013', 'm', 'e', 't', 'h', 'o', 'd', 'N', 'a', 'm', 'e', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'M', 'e', 't', 'h', 'o', 'd', 'L',
+'i', 's', 't', '.', 'S', 'e', 'r', 'v', 'i', 'c', 'e', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'M', 'e', 't', 'h', 'o', 'd', 'L', 'i',
+'s', 't', 'B', '\207', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\023', 'G', 'r', 'p', 'c', 'M', 'e', 't',
+'h', 'o', 'd', 'L', 'i', 's', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_core_v3_grpc_method_list_proto_upbdefinit = {
+ deps,
+ &envoy_config_core_v3_grpc_method_list_proto_upb_file_layout,
+ "envoy/config/core/v3/grpc_method_list.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 573)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h
new file mode 100644
index 00000000..8681e514
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/grpc_method_list.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_method_list_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcMethodList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_method_list_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcMethodList");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcMethodList_Service_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_method_list_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcMethodList.Service");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
index 17f95e90..ab59beee 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
@@ -8,50 +8,19 @@
#include "upb/def.h"
#include "envoy/config/core/v3/grpc_service.upbdefs.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_empty_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[14] = {
- &envoy_config_core_v3_GrpcService_msginit,
- &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
- &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_StsService_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
-};
-
-static const char descriptor[4684] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_empty_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[4753] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r',
'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o',
@@ -235,13 +204,16 @@ static const char descriptor[4684] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'r', 'v', 'i', 'c', 'e', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'G', 'r', 'p', 'c', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035',
'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r',
'v', 'i', 'c', 'e', 'B', '\027', '\n', '\020', 't', 'a', 'r', 'g', 'e', 't', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022',
-'\003', '\370', 'B', '\001', 'J', '\004', '\010', '\004', '\020', '\005', 'B', '@', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
-'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\020',
-'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\003', '\370', 'B', '\001', 'J', '\004', '\010', '\004', '\020', '\005', 'B', '\204', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
+'\020', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h',
+'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't',
+'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[11] = {
+static _upb_DefPool_Init *deps[11] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -255,9 +227,9 @@ static upb_def_init *deps[11] = {
NULL
};
-upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_grpc_service_proto_upb_file_layout,
"envoy/config/core/v3/grpc_service.proto",
- UPB_STRVIEW_INIT(descriptor, 4684)
+ UPB_STRINGVIEW_INIT(descriptor, 4753)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h
index 5b0b8657..be2c84d2 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h
@@ -19,76 +19,76 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_EnvoyGrpc_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.EnvoyGrpc");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_EnvoyGrpc_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.EnvoyGrpc");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.SslCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.SslCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.GoogleLocalCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.GoogleLocalCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.ServiceAccountJWTAccessCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.ServiceAccountJWTAccessCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.GoogleIAMCredentials");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.GoogleIAMCredentials");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.MetadataCredentialsFromPlugin");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.MetadataCredentialsFromPlugin");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.StsService");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.CallCredentials.StsService");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.Value");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.ArgsEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_grpc_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcService.GoogleGrpc.ChannelArgs.ArgsEntry");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
index 469acd3f..b8a59d8c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
@@ -8,40 +8,21 @@
#include "upb/def.h"
#include "envoy/config/core/v3/health_check.upbdefs.h"
+#include "envoy/config/core/v3/health_check.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_http_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_core_v3_HealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
-};
-
-static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_event_service_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_http_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[4483] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e',
'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n',
@@ -58,158 +39,172 @@ static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's',
't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\306', '\033', '\n',
-'\013', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '?', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\007', 't', 'i', 'm', 'e', 'o',
-'u', 't', '\022', 'A', '\n', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372',
-'B', '\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '@', '\n', '\016', 'i', 'n',
-'i', 't', 'i', 'a', 'l', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\024', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'i', 'n', 'i',
-'t', 'i', 'a', 'l', 'J', 'i', 't', 't', 'e', 'r', '\022', 'B', '\n', '\017', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '_', 'j', 'i',
-'t', 't', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i', 't',
-'t', 'e', 'r', '\022', '6', '\n', '\027', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '_', 'j', 'i', 't', 't', 'e', 'r', '_', 'p', 'e',
-'r', 'c', 'e', 'n', 't', '\030', '\022', ' ', '\001', '(', '\r', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i', 't', 't',
-'e', 'r', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'W', '\n', '\023', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 't', 'h',
-'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001',
-'\002', '\020', '\001', 'R', '\022', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\022', 'S',
-'\n', '\021', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(', '\013',
-'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
-'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\020', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'T',
-'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\022', '7', '\n', '\010', 'a', 'l', 't', '_', 'p', 'o', 'r', 't', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'a', 'l', 't', 'P', 'o', 'r', 't', '\022', 'E', '\n', '\020', 'r', 'e', 'u', 's', 'e', '_',
-'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\017', 'r', 'e', 'u', 's',
-'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', '_', '\n', '\021', 'h', 't', 't', 'p', '_', 'h', 'e', 'a', 'l', 't',
-'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\010', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'H',
-'t', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\017', 'h', 't', 't', 'p', 'H', 'e', 'a',
-'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\\', '\n', '\020', 't', 'c', 'p', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h',
-'e', 'c', 'k', '\030', '\t', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'c', 'p', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\016', 't', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', '\022', '_', '\n', '\021', 'g', 'r', 'p', 'c', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\013',
-' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h',
-'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\017', 'g', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022',
-'e', '\n', '\023', 'c', 'u', 's', 't', 'o', 'm', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\r', ' ',
-'\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't',
-'h', 'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\021', 'c', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', '\022', 'S', '\n', '\023', 'n', 'o', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l',
-'\030', '\014', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\021', 'n', 'o', 'T', 'r', 'a',
-'f', 'f', 'i', 'c', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'b', '\n', '\033', 'n', 'o', '_', 't', 'r', 'a', 'f', 'f', 'i',
-'c', '_', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\030', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\030', 'n', 'o', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'H', 'e', 'a',
-'l', 't', 'h', 'y', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\022', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y',
-'_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\016', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002',
-'*', '\000', 'R', '\021', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '[', '\n', '\027',
-'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'e', 'd', 'g', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\017',
+'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '`', '\n', '\017',
+'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'S', 'e', 't', '\022', 'M', '\n', '\010', 's', 't', 'a', 't', 'u', 's',
+'e', 's', '\030', '\001', ' ', '\003', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'B', '\r', '\372', 'B', '\n', '\222',
+'\001', '\007', '\"', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\"', '\357', '\034', '\n', '\013', 'H',
+'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '?', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't',
+'\022', 'A', '\n', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007',
+'\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '@', '\n', '\016', 'i', 'n', 'i', 't',
+'i', 'a', 'l', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\024', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'i', 'n', 'i', 't', 'i',
+'a', 'l', 'J', 'i', 't', 't', 'e', 'r', '\022', 'B', '\n', '\017', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '_', 'j', 'i', 't', 't',
+'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i', 't', 't', 'e',
+'r', '\022', '6', '\n', '\027', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '_', 'j', 'i', 't', 't', 'e', 'r', '_', 'p', 'e', 'r', 'c',
+'e', 'n', 't', '\030', '\022', ' ', '\001', '(', '\r', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i', 't', 't', 'e', 'r',
+'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'W', '\n', '\023', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 't', 'h', 'r', 'e',
+'s', 'h', 'o', 'l', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020',
+'\001', 'R', '\022', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\022', 'S', '\n', '\021',
+'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a',
+'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\020', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'T', 'h', 'r',
+'e', 's', 'h', 'o', 'l', 'd', '\022', '7', '\n', '\010', 'a', 'l', 't', '_', 'p', 'o', 'r', 't', '\030', '\006', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'R', '\007', 'a', 'l', 't', 'P', 'o', 'r', 't', '\022', 'E', '\n', '\020', 'r', 'e', 'u', 's', 'e', '_', 'c', 'o',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\017', 'r', 'e', 'u', 's', 'e', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', '_', '\n', '\021', 'h', 't', 't', 'p', '_', 'h', 'e', 'a', 'l', 't', 'h', '_',
+'c', 'h', 'e', 'c', 'k', '\030', '\010', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'H', 't', 't',
+'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\017', 'h', 't', 't', 'p', 'H', 'e', 'a', 'l', 't',
+'h', 'C', 'h', 'e', 'c', 'k', '\022', '\\', '\n', '\020', 't', 'c', 'p', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c',
+'k', '\030', '\t', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'c', 'p', 'H', 'e', 'a', 'l',
+'t', 'h', 'C', 'h', 'e', 'c', 'k', 'H', '\000', 'R', '\016', 't', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'\022', '_', '\n', '\021', 'g', 'r', 'p', 'c', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\013', ' ', '\001',
+'(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h',
+'e', 'c', 'k', 'H', '\000', 'R', '\017', 'g', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', 'e', '\n',
+'\023', 'c', 'u', 's', 't', 'o', 'm', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '\030', '\r', ' ', '\001', '(',
+'\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C',
+'h', 'e', 'c', 'k', 'H', '\000', 'R', '\021', 'c', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'\022', 'S', '\n', '\023', 'n', 'o', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\014',
' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\025', 'u', 'n', 'h', 'e', 'a', 'l', 't',
-'h', 'y', 'E', 'd', 'g', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'W', '\n', '\025', 'h', 'e', 'a', 'l', 't', 'h', 'y',
-'_', 'e', 'd', 'g', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372',
-'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\023', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'E', 'd', 'g', 'e', 'I', 'n', 't', 'e', 'r',
-'v', 'a', 'l', '\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\021', ' ', '\001',
-'(', '\t', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't',
-'_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\026', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e',
-'C', 'o', 'n', 'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'F', '\n', ' ', 'a',
-'l', 'w', 'a', 'y', 's', '_', 'l', 'o', 'g', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'f', 'a',
-'i', 'l', 'u', 'r', 'e', 's', '\030', '\023', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y', 's', 'L', 'o', 'g', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 's', '\022', 'M', '\n', '\013', 't', 'l', 's', '_',
-'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T',
-'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\n', 't', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '^', '\n', '\037',
-'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', '_', 'c', 'r',
-'i', 't', 'e', 'r', 'i', 'a', '\030', '\027', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\034', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o',
-'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', 'C', 'r', 'i', 't', 'e', 'r', 'i', 'a', '\032', '\200', '\001', '\n', '\007', 'P', 'a', 'y',
-'l', 'o', 'a', 'd', '\022', '\035', '\n', '\004', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
-'\020', '\001', 'H', '\000', 'R', '\004', 't', 'e', 'x', 't', '\022', '\030', '\n', '\006', 'b', 'i', 'n', 'a', 'r', 'y', '\030', '\002', ' ', '\001', '(',
-'\014', 'H', '\000', 'R', '\006', 'b', 'i', 'n', 'a', 'r', 'y', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.',
-'P', 'a', 'y', 'l', 'o', 'a', 'd', 'B', '\016', '\n', '\007', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\022', '\003', '\370', 'B', '\001', '\032', '\340',
-'\005', '\n', '\017', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\037', '\n', '\004', 'h', 'o', 's',
-'t', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\004', 'h', 'o', 's',
-'t', '\022', '!', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300',
-'\001', '\002', '\310', '\001', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\003', ' ', '\001', '(', '\013',
-'2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H',
-'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022',
-'C', '\n', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c',
-'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', '\022', 'g', '\n', '\026', 'r', 'e', 'q',
-'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\006', ' ', '\003', '(', '\013',
-'2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H',
-'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020',
-'\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K',
-'\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o',
-'v', 'e', '\030', '\010', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001',
-'\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e',
-'\022', 'F', '\n', '\021', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\t', ' ', '\003',
-'(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R',
-'a', 'n', 'g', 'e', 'R', '\020', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'T', '\n',
-'\021', 'c', 'o', 'd', 'e', 'c', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\n', ' ', '\001', '(', '\016', '2',
-'\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'C', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e',
-'n', 't', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'c', 'o', 'd', 'e', 'c', 'C', 'l',
-'i', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', 'V', '\n', '\024', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '_',
-'m', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\013', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
-'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'R', '\022', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '4', '\232', '\305',
-'\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
-'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm',
-'e', 'R', '\t', 'u', 's', 'e', '_', 'h', 't', 't', 'p', '2', '\032', '\311', '\001', '\n', '\016', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't',
-'h', 'C', 'h', 'e', 'c', 'k', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h',
-'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022', 'C', '\n', '\007', 'r', 'e',
-'c', 'e', 'i', 'v', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y',
-'l', 'o', 'a', 'd', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v',
+'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\021', 'n', 'o', 'T', 'r', 'a', 'f', 'f',
+'i', 'c', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'b', '\n', '\033', 'n', 'o', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_',
+'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B',
+'\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\030', 'n', 'o', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'H', 'e', 'a', 'l', 't',
+'h', 'y', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\022', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'i',
+'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\016', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000',
+'R', '\021', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '[', '\n', '\027', 'u', 'n',
+'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'e', 'd', 'g', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\017', ' ', '\001',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\025', 'u', 'n', 'h', 'e', 'a', 'l', 't', 'h', 'y',
+'E', 'd', 'g', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'W', '\n', '\025', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'e',
+'d', 'g', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\252', '\001', '\002', '*', '\000', 'R', '\023', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'E', 'd', 'g', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a',
+'l', '\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\021', ' ', '\001', '(', '\t',
+'R', '\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't', '_', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '\030', '\026', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'F', '\n', ' ', 'a', 'l', 'w',
+'a', 'y', 's', '_', 'l', 'o', 'g', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'f', 'a', 'i', 'l',
+'u', 'r', 'e', 's', '\030', '\023', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y', 's', 'L', 'o', 'g', 'H', 'e', 'a', 'l',
+'t', 'h', 'C', 'h', 'e', 'c', 'k', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 's', '\022', 'M', '\n', '\013', 't', 'l', 's', '_', 'o', 'p',
+'t', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'l', 's',
+'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\n', 't', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '^', '\n', '\037', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', '_', 'c', 'r', 'i', 't',
+'e', 'r', 'i', 'a', '\030', '\027', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\034', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
+'e', 't', 'M', 'a', 't', 'c', 'h', 'C', 'r', 'i', 't', 'e', 'r', 'i', 'a', '\032', '\200', '\001', '\n', '\007', 'P', 'a', 'y', 'l', 'o',
+'a', 'd', '\022', '\035', '\n', '\004', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
+'H', '\000', 'R', '\004', 't', 'e', 'x', 't', '\022', '\030', '\n', '\006', 'b', 'i', 'n', 'a', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\014', 'H',
+'\000', 'R', '\006', 'b', 'i', 'n', 'a', 'r', 'y', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a',
+'y', 'l', 'o', 'a', 'd', 'B', '\016', '\n', '\007', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\022', '\003', '\370', 'B', '\001', '\032', '\252', '\006', '\n',
+'\017', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\037', '\n', '\004', 'h', 'o', 's', 't', '\030',
+'\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\004', 'h', 'o', 's', 't', '\022',
+'!', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\002',
+'\310', '\001', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\003', ' ', '\001', '(', '\013', '2', ')',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a',
+'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022', 'C', '\n',
+'\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.',
+'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e',
+'s', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\006', ' ', '\003', '(', '\013', '2', '\'',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a',
+'d', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007',
+'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K', '\n', '\031',
+'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e',
+'\030', '\010', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R',
+'\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'F',
+'\n', '\021', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\t', ' ', '\003', '(', '\013',
+'2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a', 'n',
+'g', 'e', 'R', '\020', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'H', '\n', '\022', 'r',
+'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '\031',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a', 'n', 'g', 'e',
+'R', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'T', '\n', '\021', 'c', 'o',
+'d', 'e', 'c', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\n', ' ', '\001', '(', '\016', '2', '\036', '.', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'C', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e', 'n', 't', 'T',
+'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'c', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e', 'n',
+'t', 'T', 'y', 'p', 'e', '\022', 'V', '\n', '\024', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '_', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '\030', '\013', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\022',
+'s', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '4', '\232', '\305', '\210', '\036', '/',
+'\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't',
+'h', 'C', 'h', 'e', 'c', 'k', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'J', '\004', '\010',
+'\005', '\020', '\006', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', 'R', '\t',
+'u', 's', 'e', '_', 'h', 't', 't', 'p', '2', '\032', '\311', '\001', '\n', '\016', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h',
+'e', 'c', 'k', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
+'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022', 'C', '\n', '\007', 'r', 'e', 'c', 'e', 'i',
+'v', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a',
+'d', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T',
+'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '[', '\n', '\020', 'R', 'e', 'd', 'i', 's', 'H', 'e', 'a',
+'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e',
+'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
+'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'R', 'e', 'd', 'i', 's', 'H', 'e', 'a', 'l', 't',
+'h', 'C', 'h', 'e', 'c', 'k', '\032', '\364', '\001', '\n', '\017', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c',
+'k', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013',
+'s', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030',
+'\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\t', 'a', 'u', 't', 'h', 'o',
+'r', 'i', 't', 'y', '\022', ']', '\n', '\020', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030',
+'\003', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B',
+'\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', ':',
+'4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e',
+'.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h',
+'e', 'c', 'k', '\032', '\300', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004',
+'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000',
+'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '6', '\232', '\305', '\210', '\036', '1', '\n', '/', 'e', 'n', 'v',
'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c',
-'k', '.', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '[', '\n', '\020', 'R', 'e', 'd', 'i', 's',
-'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R',
-'\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
-'.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'R', 'e', 'd', 'i', 's', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\225', '\001', '\n', '\017', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C',
-'h', 'e', 'c', 'k', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
-'\t', 'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i',
-'t', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\t', 'a', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c',
-'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\300', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a',
-'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '6', '\232', '\305',
-'\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006',
-'c', 'o', 'n', 'f', 'i', 'g', '\032', 'd', '\n', '\n', 'T', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\016', 'a',
-'l', 'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'l',
-'s', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'B', '\025', '\n', '\016',
-'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\n', '\020', '\013',
-'*', '`', '\n', '\014', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O',
-'W', 'N', '\020', '\000', '\022', '\013', '\n', '\007', 'H', 'E', 'A', 'L', 'T', 'H', 'Y', '\020', '\001', '\022', '\r', '\n', '\t', 'U', 'N', 'H', 'E',
-'A', 'L', 'T', 'H', 'Y', '\020', '\002', '\022', '\014', '\n', '\010', 'D', 'R', 'A', 'I', 'N', 'I', 'N', 'G', '\020', '\003', '\022', '\013', '\n', '\007',
-'T', 'I', 'M', 'E', 'O', 'U', 'T', '\020', '\004', '\022', '\014', '\n', '\010', 'D', 'E', 'G', 'R', 'A', 'D', 'E', 'D', '\020', '\005', 'B', '@',
-'\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\020', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'P',
-'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'B', '\r', '\n', '\013', 'c', 'o',
+'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\032', 'd',
+'\n', '\n', 'T', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\016', 'a', 'l', 'p', 'n', '_', 'p', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
+'s', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
+'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's',
+':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r',
+'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'B', '\025', '\n', '\016', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c',
+'h', 'e', 'c', 'k', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\n', '\020', '\013', '*', '`', '\n', '\014', 'H', 'e', 'a', 'l',
+'t', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\013', '\n', '\007',
+'H', 'E', 'A', 'L', 'T', 'H', 'Y', '\020', '\001', '\022', '\r', '\n', '\t', 'U', 'N', 'H', 'E', 'A', 'L', 'T', 'H', 'Y', '\020', '\002', '\022',
+'\014', '\n', '\010', 'D', 'R', 'A', 'I', 'N', 'I', 'N', 'G', '\020', '\003', '\022', '\013', '\n', '\007', 'T', 'I', 'M', 'E', 'O', 'U', 'T', '\020',
+'\004', '\022', '\014', '\n', '\010', 'D', 'E', 'G', 'R', 'A', 'D', 'E', 'D', '\020', '\005', 'B', '\204', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', 'B', '\020', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[13] = {
+static _upb_DefPool_Init *deps[13] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_event_service_config_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
@@ -225,9 +220,9 @@ static upb_def_init *deps[13] = {
NULL
};
-upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_health_check_proto_upb_file_layout,
"envoy/config/core/v3/health_check.proto",
- UPB_STRVIEW_INIT(descriptor, 4147)
+ UPB_STRINGVIEW_INIT(descriptor, 4483)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h
index 56f62d7b..1ddc0a52 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h
@@ -19,46 +19,51 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthStatusSet_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthStatusSet");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_Payload_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.Payload");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_HttpHealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.HttpHealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_Payload_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.Payload");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_TcpHealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.TcpHealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_HttpHealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.HttpHealthCheck");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_RedisHealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.RedisHealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_TcpHealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.TcpHealthCheck");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.GrpcHealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_RedisHealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.RedisHealthCheck");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_CustomHealthCheck_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.CustomHealthCheck");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.GrpcHealthCheck");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HealthCheck_TlsOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HealthCheck.TlsOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_CustomHealthCheck_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.CustomHealthCheck");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HealthCheck_TlsOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_health_check_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HealthCheck.TlsOptions");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
index 3afce108..ecd17bf4 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/config/core/v3/http_uri.upbdefs.h"
+#include "envoy/config/core/v3/http_uri.upb.h"
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_HttpUri_msginit,
-};
-
-static const char descriptor[454] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 't',
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[523] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 't',
't', 'p', '_', 'u', 'r', 'i', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
@@ -34,13 +29,15 @@ static const char descriptor[454] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c
'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '2', '\000', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', ':', ' ',
'\232', '\305', '\210', '\036', '\033', '\n', '\031', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
'H', 't', 't', 'p', 'U', 'r', 'i', 'B', '\031', '\n', '\022', 'h', 't', 't', 'p', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_',
-'t', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '<', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
-'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014', 'H',
-'t', 't', 'p', 'U', 'r', 'i', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'t', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\200', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\014',
+'H', 't', 't', 'p', 'U', 'r', 'i', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&google_protobuf_duration_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -48,9 +45,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_config_core_v3_http_uri_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_http_uri_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_http_uri_proto_upb_file_layout,
"envoy/config/core/v3/http_uri.proto",
- UPB_STRVIEW_INIT(descriptor, 454)
+ UPB_STRINGVIEW_INIT(descriptor, 523)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h
index 730b4350..0e1eac8b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_http_uri_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_http_uri_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HttpUri_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_http_uri_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HttpUri");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HttpUri_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_http_uri_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HttpUri");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
index 0f1096b5..43374eaa 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
@@ -8,224 +8,291 @@
#include "upb/def.h"
#include "envoy/config/core/v3/protocol.upbdefs.h"
+#include "envoy/config/core/v3/protocol.upb.h"
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-extern const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit;
-
-static const upb_msglayout *layouts[11] = {
- &envoy_config_core_v3_TcpProtocolOptions_msginit,
- &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
- &envoy_config_core_v3_KeepaliveSettings_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
- &envoy_config_core_v3_GrpcProtocolOptions_msginit,
- &envoy_config_core_v3_Http3ProtocolOptions_msginit,
-};
-
-static const char descriptor[4229] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[6385] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/',
-'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
-'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'A', '\n', '\022', 'T', 'c', 'p',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'T', 'c', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\236', '\001', '\n', '\033', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't',
-'t', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\031', '\n', '\010', 'a', 'u', 't', 'o',
-'_', 's', 'n', 'i', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\007', 'a', 'u', 't', 'o', 'S', 'n', 'i', '\022', '.', '\n', '\023', 'a', 'u',
-'t', 'o', '_', 's', 'a', 'n', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\021',
-'a', 'u', 't', 'o', 'S', 'a', 'n', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', ':', '4', '\232', '\305', '\210', '\036', '/', '\n',
-'-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'U', 'p', 's', 't', 'r', 'e',
-'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\322', '\004', '\n',
-'\023', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'i',
-'d', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e',
-'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Q', '\n', '\027', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\025', 'm', 'a', 'x', 'C', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'Q', '\n', '\021', 'm', 'a', 'x', '_', 'h', 'e',
-'a', 'd', 'e', 'r', 's', '_', 'c', 'o', 'u', 'n', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372',
-'B', '\004', '*', '\002', '(', '\001', 'R', '\017', 'm', 'a', 'x', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'C', 'o', 'u', 'n', 't', '\022', 'I',
-'\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001',
-'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\215',
-'\001', '\n', '\037', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'w', 'i', 't', 'h', '_', 'u', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r',
-'e', 's', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\005', ' ', '\001', '(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o',
-'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r',
-'s', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\034', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h',
-'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'N', '\n', '\034', 'H', 'e', 'a', 'd',
-'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022',
-'\t', '\n', '\005', 'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\022', '\n', '\016', 'R', 'E', 'J', 'E', 'C', 'T', '_', 'R', 'E', 'Q', 'U',
-'E', 'S', 'T', '\020', '\001', '\022', '\017', '\n', '\013', 'D', 'R', 'O', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\002', ':', ',', '\232',
-'\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H',
-'t', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\361', '\006', '\n', '\024', 'H', 't',
-'t', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'H', '\n', '\022', 'a', 'l', 'l',
-'o', 'w', '_', 'a', 'b', 's', 'o', 'l', 'u', 't', 'e', '_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R',
-'\020', 'a', 'l', 'l', 'o', 'w', 'A', 'b', 's', 'o', 'l', 'u', 't', 'e', 'U', 'r', 'l', '\022', '$', '\n', '\016', 'a', 'c', 'c', 'e',
-'p', 't', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\014', 'a', 'c', 'c', 'e', 'p', 't', 'H',
-'t', 't', 'p', '1', '0', '\022', '6', '\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'h', 'o', 's', 't', '_', 'f', 'o', 'r',
-'_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'H', 'o',
-'s', 't', 'F', 'o', 'r', 'H', 't', 't', 'p', '1', '0', '\022', 'f', '\n', '\021', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'k', 'e', 'y',
-'_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e',
+'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#',
+'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\"', 'A', '\n', '\022', 'T', 'c', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '+',
+'\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
+'T', 'c', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\267', '\001', '\n', '\025', 'Q', 'u',
+'i', 'c', 'K', 'e', 'e', 'p', 'A', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022', 'J', '\n', '\014', 'm', 'a',
+'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001',
+'\006', '\"', '\000', '2', '\002', '\010', '\001', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\020', 'i',
+'n', 'i', 't', 'i', 'a', 'l', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014',
+'\372', 'B', '\t', '\252', '\001', '\006', '\"', '\000', '2', '\002', '\010', '\001', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'I', 'n', 't', 'e',
+'r', 'v', 'a', 'l', '\"', '\250', '\004', '\n', '\023', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i',
+'o', 'n', 's', '\022', '[', '\n', '\026', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r',
+'e', 'a', 'm', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R',
+'\024', 'm', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 's', '\022', 'g', '\n', '\032',
+'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\014', '\372', 'B', '\t', '*', '\007', '\030', '\200', '\200', '\200', '\010', '(',
+'\001', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z',
+'e', '\022', 'o', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'w',
+'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\014', '\372', 'B',
+'\t', '*', '\007', '\030', '\200', '\200', '\200', '\014', '(', '\001', 'R', '\033', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022', 'z', '\n', '&', 'n', 'u', 'm', '_', 't', 'i', 'm',
+'e', 'o', 'u', 't', 's', '_', 't', 'o', '_', 't', 'r', 'i', 'g', 'g', 'e', 'r', '_', 'p', 'o', 'r', 't', '_', 'm', 'i', 'g',
+'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030',
+'\005', '(', '\000', 'R', '!', 'n', 'u', 'm', 'T', 'i', 'm', 'e', 'o', 'u', 't', 's', 'T', 'o', 'T', 'r', 'i', 'g', 'g', 'e', 'r',
+'P', 'o', 'r', 't', 'M', 'i', 'g', 'r', 'a', 't', 'i', 'o', 'n', '\022', '^', '\n', '\024', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'Q', 'u', 'i', 'c', 'K', 'e', 'e', 'p',
+'A', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\023', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\"', '\344', '\001', '\n', '\033', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't',
+'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\031', '\n', '\010', 'a', 'u', 't', 'o', '_',
+'s', 'n', 'i', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\007', 'a', 'u', 't', 'o', 'S', 'n', 'i', '\022', '.', '\n', '\023', 'a', 'u', 't',
+'o', '_', 's', 'a', 'n', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\021', 'a',
+'u', 't', 'o', 'S', 'a', 'n', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\022', 'D', '\n', '\030', 'o', 'v', 'e', 'r', 'r',
+'i', 'd', 'e', '_', 'a', 'u', 't', 'o', '_', 's', 'n', 'i', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\t',
+'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\320', '\001', '\001', 'R', '\025', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'A', 'u',
+'t', 'o', 'S', 'n', 'i', 'H', 'e', 'a', 'd', 'e', 'r', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p',
+'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\327', '\003', '\n', '\036', 'A', 'l', 't', 'e', 'r',
+'n', 'a', 't', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', 'C', 'a', 'c', 'h', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004',
+'n', 'a', 'm', 'e', '\022', 'F', '\n', '\013', 'm', 'a', 'x', '_', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
+'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', ' ', '\000', 'R', '\n', 'm', 'a', 'x', 'E', 'n', 't', 'r', 'i', 'e',
+'s', '\022', '_', '\n', '\026', 'k', 'e', 'y', '_', 'v', 'a', 'l', 'u', 'e', '_', 's', 't', 'o', 'r', 'e', '_', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\023', 'k', 'e', 'y', 'V', 'a', 'l', 'u', 'e', 'S', 't', 'o', 'r', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\204',
+'\001', '\n', '\024', 'p', 'r', 'e', 'p', 'o', 'p', 'u', 'l', 'a', 't', 'e', 'd', '_', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\004',
+' ', '\003', '(', '\013', '2', 'Q', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', 'C', 'a', 'c', 'h',
+'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 's', 'C', 'a', 'c', 'h', 'e', 'E', 'n', 't', 'r', 'y', 'R', '\023', 'p', 'r', 'e', 'p', 'o', 'p', 'u', 'l', 'a', 't', 'e',
+'d', 'E', 'n', 't', 'r', 'i', 'e', 's', '\032', 'h', '\n', '\034', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 's', 'C', 'a', 'c', 'h', 'e', 'E', 'n', 't', 'r', 'y', '\022', '\'', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a',
+'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\320', '\001', '\001', 'R', '\010', 'h', 'o',
+'s', 't', 'n', 'a', 'm', 'e', '\022', '\037', '\n', '\004', 'p', 'o', 'r', 't', '\030', '\002', ' ', '\001', '(', '\r', 'B', '\013', '\372', 'B', '\010',
+'*', '\006', '\020', '\377', '\377', '\003', ' ', '\000', 'R', '\004', 'p', 'o', 'r', 't', '\"', '\257', '\005', '\n', '\023', 'H', 't', 't', 'p', 'P', 'r',
+'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm',
+'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't',
+'\022', 'Q', '\n', '\027', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'd', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\025', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'Q', '\n', '\021', 'm', 'a', 'x', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'c',
+'o', 'u', 'n', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R',
+'\017', 'm', 'a', 'x', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'C', 'o', 'u', 'n', 't', '\022', 'I', '\n', '\023', 'm', 'a', 'x', '_', 's',
+'t', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm',
+'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\215', '\001', '\n', '\037', 'h', 'e', 'a', 'd',
+'e', 'r', 's', '_', 'w', 'i', 't', 'h', '_', 'u', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', '_', 'a', 'c', 't', 'i',
+'o', 'n', '\030', '\005', ' ', '\001', '(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '.', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A',
+'c', 't', 'i', 'o', 'n', 'R', '\034', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c',
+'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022', '[', '\n', '\033', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't',
+'s', '_', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
+'u', 'e', 'R', '\030', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', 'P', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '\"', 'N', '\n', '\034', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c',
+'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\t', '\n', '\005', 'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\022', '\n', '\016',
+'R', 'E', 'J', 'E', 'C', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020', '\001', '\022', '\017', '\n', '\013', 'D', 'R', 'O', 'P', '_',
+'H', 'E', 'A', 'D', 'E', 'R', '\020', '\002', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
+'i', 'o', 'n', 's', '\"', '\316', '\007', '\n', '\024', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
+'i', 'o', 'n', 's', '\022', 'H', '\n', '\022', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'b', 's', 'o', 'l', 'u', 't', 'e', '_', 'u', 'r',
+'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l', 'o', 'w', 'A', 'b', 's', 'o', 'l', 'u', 't', 'e',
+'U', 'r', 'l', '\022', '$', '\n', '\016', 'a', 'c', 'c', 'e', 'p', 't', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\002', ' ', '\001',
+'(', '\010', 'R', '\014', 'a', 'c', 'c', 'e', 'p', 't', 'H', 't', 't', 'p', '1', '0', '\022', '6', '\n', '\030', 'd', 'e', 'f', 'a', 'u',
+'l', 't', '_', 'h', 'o', 's', 't', '_', 'f', 'o', 'r', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\003', ' ', '\001', '(', '\t',
+'R', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'H', 'o', 's', 't', 'F', 'o', 'r', 'H', 't', 't', 'p', '1', '0', '\022', 'f', '\n',
+'\021', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'k', 'e', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\004', ' ', '\001', '(', '\013', '2',
+':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't',
+'t', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r',
+'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'R', '\017', 'h', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a',
+'t', '\022', '\'', '\n', '\017', 'e', 'n', 'a', 'b', 'l', 'e', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\030', '\005', ' ', '\001', '(',
+'\010', 'R', '\016', 'e', 'n', 'a', 'b', 'l', 'e', 'T', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\022', '0', '\n', '\024', 'a', 'l', 'l', 'o',
+'w', '_', 'c', 'h', 'u', 'n', 'k', 'e', 'd', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\022', 'a',
+'l', 'l', 'o', 'w', 'C', 'h', 'u', 'n', 'k', 'e', 'd', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r',
+'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a',
+'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
+'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n',
+'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e', '\032', '\237', '\003', '\n', '\017', 'H', 'e', 'a', 'd',
+'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'x', '\n', '\021', 'p', 'r', 'o', 'p', 'e', 'r', '_', 'c', 'a', 's',
+'e', '_', 'w', 'o', 'r', 'd', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', 'J', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'R', '\017',
-'h', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\'', '\n', '\017', 'e', 'n', 'a', 'b', 'l', 'e',
-'_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\016', 'e', 'n', 'a', 'b', 'l', 'e', 'T', 'r',
-'a', 'i', 'l', 'e', 'r', 's', '\022', '0', '\n', '\024', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'h', 'u', 'n', 'k', 'e', 'd', '_', 'l',
-'e', 'n', 'g', 't', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l', 'o', 'w', 'C', 'h', 'u', 'n', 'k', 'e', 'd',
-'L', 'e', 'n', 'g', 't', 'h', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm',
-'_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e',
-'s', 's', 'a', 'g', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S',
-'t', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e',
-'s', 's', 'a', 'g', 'e', '\032', '\302', '\002', '\n', '\017', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't',
-'\022', 'x', '\n', '\021', 'p', 'r', 'o', 'p', 'e', 'r', '_', 'c', 'a', 's', 'e', '_', 'w', 'o', 'r', 'd', 's', '\030', '\001', ' ', '\001',
-'(', '\013', '2', 'J', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a',
-'d', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o',
-'r', 'd', 's', 'H', '\000', 'R', '\017', 'p', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', '\032', '`', '\n',
-'\017', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', 'M', '\232', '\305', '\210', '\036', 'H', '\n', 'F',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o',
-'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', '=', '\232', '\305', '\210',
-'\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't',
+'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '.', 'P',
+'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', 'H', '\000', 'R', '\017', 'p', 'r', 'o', 'p', 'e', 'r', 'C',
+'a', 's', 'e', 'W', 'o', 'r', 'd', 's', '\022', '[', '\n', '\022', 's', 't', 'a', 't', 'e', 'f', 'u', 'l', '_', 'f', 'o', 'r', 'm',
+'a', 't', 't', 'e', 'r', '\030', '\010', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C',
+'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\021', 's', 't', 'a', 't', 'e', 'f', 'u', 'l', 'F', 'o', 'r', 'm', 'a', 't', 't', 'e',
+'r', '\032', '`', '\n', '\017', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', 'M', '\232', '\305', '\210',
+'\036', 'H', '\n', 'F', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't',
'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K',
-'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\024', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'f', 'o', 'r', 'm', 'a', 't',
-'\022', '\003', '\370', 'B', '\001', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', '\"', '\340', '\001', '\n', '\021', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022',
-'E', '\n', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252',
-'\001', '\010', '\010', '\001', '2', '\004', '\020', '\300', '\204', '=', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'C', '\n', '\007', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '2',
-'\004', '\020', '\300', '\204', '=', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '?', '\n', '\017', 'i', 'n', 't', 'e', 'r', 'v', 'a',
-'l', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i',
-'t', 't', 'e', 'r', '\"', '\370', '\r', '\n', '\024', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
-'i', 'o', 'n', 's', '\022', 'F', '\n', '\020', 'h', 'p', 'a', 'c', 'k', '_', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'h', 'p', 'a', 'c', 'k', 'T', 'a', 'b', 'l', 'e', 'S', 'i', 'z',
-'e', '\022', 'a', '\n', '\026', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a',
-'m', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\r', '\372', 'B', '\n', '*', '\010', '\030', '\377', '\377', '\377', '\377',
-'\007', '(', '\001', 'R', '\024', 'm', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 's',
-'\022', 'j', '\n', '\032', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o', 'w',
-'_', 's', 'i', 'z', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377',
-'\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W', 'i',
-'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022', 'r', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a',
-'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377', '\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\033', 'i', 'n', 'i',
-'t', 'i', 'a', 'l', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022',
-'#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\014', 'a',
-'l', 'l', 'o', 'w', 'C', 'o', 'n', 'n', 'e', 'c', 't', '\022', '%', '\n', '\016', 'a', 'l', 'l', 'o', 'w', '_', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\r', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'\022', 'U', '\n', '\023', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\007',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\021', 'm', 'a', 'x', 'O', 'u',
-'t', 'b', 'o', 'u', 'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', '\022', 'd', '\n', '\033', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o',
-'u', 'n', 'd', '_', 'c', 'o', 'n', 't', 'r', 'o', 'l', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\010', ' ', '\001', '(', '\013', '2',
-'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
-'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\030', 'm', 'a', 'x', 'O', 'u', 't', 'b', 'o', 'u', 'n',
-'d', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'F', 'r', 'a', 'm', 'e', 's', '\022', '\204', '\001', '\n', '1', 'm', 'a', 'x', '_', 'c', 'o',
-'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '_',
-'w', 'i', 't', 'h', '_', 'e', 'm', 'p', 't', 'y', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\030', '\t', ' ', '\001', '(', '\013', '2',
+'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':',
+'=', '\232', '\305', '\210', '\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e',
+'.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a',
+'d', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\024', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'f', 'o',
+'r', 'm', 'a', 't', '\022', '\003', '\370', 'B', '\001', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O',
+'p', 't', 'i', 'o', 'n', 's', '\"', '\301', '\002', '\n', '\021', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i',
+'n', 'g', 's', '\022', 'C', '\n', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014',
+'\372', 'B', '\t', '\252', '\001', '\006', '2', '\004', '\020', '\300', '\204', '=', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'C', '\n',
+'\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010',
+'\001', '2', '\004', '\020', '\300', '\204', '=', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '?', '\n', '\017', 'i', 'n', 't', 'e', 'r',
+'v', 'a', 'l', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'t', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l',
+'J', 'i', 't', 't', 'e', 'r', '\022', 'a', '\n', '\030', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'i', 'd', 'l', 'e',
+'_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006',
+'2', '\004', '\020', '\300', '\204', '=', 'R', '\026', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'I', 'd', 'l', 'e', 'I', 'n', 't',
+'e', 'r', 'v', 'a', 'l', '\"', '\201', '\016', '\n', '\024', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', '\022', 'F', '\n', '\020', 'h', 'p', 'a', 'c', 'k', '_', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'h', 'p', 'a', 'c', 'k', 'T', 'a', 'b', 'l', 'e', 'S', 'i',
+'z', 'e', '\022', 'a', '\n', '\026', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r', 'e',
+'a', 'm', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\r', '\372', 'B', '\n', '*', '\010', '\030', '\377', '\377', '\377',
+'\377', '\007', '(', '\001', 'R', '\024', 'm', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm',
+'s', '\022', 'j', '\n', '\032', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o',
+'w', '_', 's', 'i', 'z', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030',
+'\377', '\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W',
+'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022', 'r', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2',
'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
-'a', 'l', 'u', 'e', 'R', '+', 'm', 'a', 'x', 'C', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', 'I', 'n', 'b', 'o', 'u',
-'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', 'W', 'i', 't', 'h', 'E', 'm', 'p', 't', 'y', 'P', 'a', 'y', 'l', 'o', 'a', 'd', '\022',
-'o', '\n', '&', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '_', 'f',
-'r', 'a', 'm', 'e', 's', '_', 'p', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', '\030', '\n', ' ', '\001', '(', '\013', '2', '\034', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
-'u', 'e', 'R', '!', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'F', 'r', 'a',
-'m', 'e', 's', 'P', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', '\022', '\221', '\001', '\n', '4', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o',
-'u', 'n', 'd', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's', '_',
-'p', 'e', 'r', '_', 'd', 'a', 't', 'a', '_', 'f', 'r', 'a', 'm', 'e', '_', 's', 'e', 'n', 't', '\030', '\013', ' ', '\001', '(', '\013',
+'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377', '\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\033', 'i', 'n',
+'i', 't', 'i', 'a', 'l', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e',
+'\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\014',
+'a', 'l', 'l', 'o', 'w', 'C', 'o', 'n', 'n', 'e', 'c', 't', '\022', '%', '\n', '\016', 'a', 'l', 'l', 'o', 'w', '_', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\r', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'a', 'd', 'a', 't',
+'a', '\022', 'U', '\n', '\023', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030',
+'\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\021', 'm', 'a', 'x', 'O',
+'u', 't', 'b', 'o', 'u', 'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', '\022', 'd', '\n', '\033', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b',
+'o', 'u', 'n', 'd', '_', 'c', 'o', 'n', 't', 'r', 'o', 'l', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\010', ' ', '\001', '(', '\013',
'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
-'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', ',', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n',
-'d', 'W', 'i', 'n', 'd', 'o', 'w', 'U', 'p', 'd', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 's', 'P', 'e', 'r', 'D', 'a', 't',
-'a', 'F', 'r', 'a', 'm', 'e', 'S', 'e', 'n', 't', '\022', 'U', '\n', '&', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o',
-'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'i',
-'n', 'g', '\030', '\014', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '!', 's', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r',
-'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'i', 'n', 'g', '\022', 'z', '\n',
-'-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n',
-'_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '\016', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o',
-'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e', '\022', 'z', '\n', '\032',
-'c', 'u', 's', 't', 'o', 'm', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
-'s', '\030', '\r', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'R', '\030', 'c', 'u', 's', 't',
-'o', 'm', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', 'Z', '\n', '\024', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\017', ' ', '\001', '(', '\013',
-'2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'K',
-'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\023', 'c', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\032', '\345', '\001', '\n', '\021', 'S', 'e', 't', 't', 'i', 'n', 'g', 's',
-'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', 'Q', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\000', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\022', '<', '\n', '\005', 'v', 'a', 'l', 'u',
-'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v',
-'a', 'l', 'u', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\030', 'm', 'a', 'x', 'O', 'u', 't', 'b', 'o', 'u',
+'n', 'd', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'F', 'r', 'a', 'm', 'e', 's', '\022', '\204', '\001', '\n', '1', 'm', 'a', 'x', '_', 'c',
+'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's',
+'_', 'w', 'i', 't', 'h', '_', 'e', 'm', 'p', 't', 'y', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\030', '\t', ' ', '\001', '(', '\013',
+'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
+'V', 'a', 'l', 'u', 'e', 'R', '+', 'm', 'a', 'x', 'C', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', 'I', 'n', 'b', 'o',
+'u', 'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', 'W', 'i', 't', 'h', 'E', 'm', 'p', 't', 'y', 'P', 'a', 'y', 'l', 'o', 'a', 'd',
+'\022', 'o', '\n', '&', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '_',
+'f', 'r', 'a', 'm', 'e', 's', '_', 'p', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', '\030', '\n', ' ', '\001', '(', '\013', '2', '\034',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a',
+'l', 'u', 'e', 'R', '!', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'F', 'r',
+'a', 'm', 'e', 's', 'P', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', '\022', '\221', '\001', '\n', '4', 'm', 'a', 'x', '_', 'i', 'n', 'b',
+'o', 'u', 'n', 'd', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's',
+'_', 'p', 'e', 'r', '_', 'd', 'a', 't', 'a', '_', 'f', 'r', 'a', 'm', 'e', '_', 's', 'e', 'n', 't', '\030', '\013', ' ', '\001', '(',
+'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
+'2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', ',', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u',
+'n', 'd', 'W', 'i', 'n', 'd', 'o', 'w', 'U', 'p', 'd', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 's', 'P', 'e', 'r', 'D', 'a',
+'t', 'a', 'F', 'r', 'a', 'm', 'e', 'S', 'e', 'n', 't', '\022', '^', '\n', '&', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r',
+'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g',
+'i', 'n', 'g', '\030', '\014', ' ', '\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '!', 's',
+'t', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e',
+'s', 's', 'a', 'g', 'i', 'n', 'g', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a',
+'m', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm',
+'e', 's', 's', 'a', 'g', 'e', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e',
+'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M',
+'e', 's', 's', 'a', 'g', 'e', '\022', 'z', '\n', '\032', 'c', 'u', 's', 't', 'o', 'm', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's',
+'_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', 'R', '\030', 'c', 'u', 's', 't', 'o', 'm', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', 's', '\022', 'Z', '\n', '\024', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'k', 'e', 'e', 'p', 'a',
+'l', 'i', 'v', 'e', '\030', '\017', ' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g',
+'s', 'R', '\023', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\032', '\345', '\001',
+'\n', '\021', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', 'Q', '\n', '\n', 'i', 'd',
+'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\372', 'B', '\010', '*',
+'\006', '\030', '\377', '\377', '\003', '(', '\000', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i',
+'e', 'r', '\022', '<', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
'.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ':', '-', '\232', '\305', '\210', '\036',
-'(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p',
-'2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\245', '\001', '\n', '\023', 'G', 'r', 'p', 'c',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '`', '\n', '\026', 'h', 't', 't', 'p', '2', '_',
-'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p',
-'2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c',
-'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\026', '\n', '\024', 'H', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o',
-'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '=', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'s', '\"', '\245', '\001', '\n', '\023', 'G', 'r', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'\022', '`', '\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n',
+'s', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ',',
+'\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
+'G', 'r', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\261', '\002', '\n', '\024', 'H',
+'t', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\025', 'q', 'u',
+'i', 'c', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013',
+'2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'Q',
+'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\023', 'q', 'u', 'i', 'c', 'P',
+'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd',
+'e', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd',
+'_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o',
+'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l',
+'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e', '\022', '>', '\n', '\026', 'a', 'l', 'l', 'o', 'w', '_', 'e', 'x',
+'t', 'e', 'n', 'd', 'e', 'd', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'B', '\010', '\322', '\306', '\244',
+'\341', '\006', '\002', '\010', '\001', 'R', '\024', 'a', 'l', 'l', 'o', 'w', 'E', 'x', 't', 'e', 'n', 'd', 'e', 'd', 'C', 'o', 'n', 'n', 'e',
+'c', 't', '\"', 't', '\n', '\032', 'S', 'c', 'h', 'e', 'm', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o',
+'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', 'D', '\n', '\023', 's', 'c', 'h', 'e', 'm', 'e', '_', 't', 'o', '_', 'o', 'v', 'e', 'r',
+'w', 'r', 'i', 't', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\022', '\372', 'B', '\017', 'r', '\r', 'R', '\004', 'h', 't', 't', 'p', 'R',
+'\005', 'h', 't', 't', 'p', 's', 'H', '\000', 'R', '\021', 's', 'c', 'h', 'e', 'm', 'e', 'T', 'o', 'O', 'v', 'e', 'r', 'w', 'r', 'i',
+'t', 'e', 'B', '\020', '\n', '\016', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'B', '\201', '\001', '\n', '\"',
+'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'P', 'r', 'o', 't', 'o', 'P',
+'\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/',
+'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
+'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[7] = {
+static _upb_DefPool_Init *deps[10] = {
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_protocol_proto_upb_file_layout,
"envoy/config/core/v3/protocol.proto",
- UPB_STRVIEW_INIT(descriptor, 4229)
+ UPB_STRINGVIEW_INIT(descriptor, 6385)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
index ddc54578..6e4bd83a 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
@@ -19,61 +19,86 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_TcpProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.TcpProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TcpProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.TcpProtocolOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_UpstreamHttpProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.UpstreamHttpProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_QuicKeepAliveSettings_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.QuicKeepAliveSettings");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_HttpProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HttpProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_QuicProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.QuicProtocolOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http1ProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http1ProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_UpstreamHttpProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.UpstreamHttpProtocolOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AlternateProtocolsCacheOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AlternateProtocolsCacheOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AlternateProtocolsCacheOptions.AlternateProtocolsCacheEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_KeepaliveSettings_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.KeepaliveSettings");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HttpProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HttpProtocolOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http2ProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http2ProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_GrpcProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.GrpcProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords");
}
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http3ProtocolOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http3ProtocolOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_KeepaliveSettings_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.KeepaliveSettings");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http2ProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http2ProtocolOptions");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcProtocolOptions");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http3ProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http3ProtocolOptions");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SchemeHeaderTransformation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SchemeHeaderTransformation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
index f1c19dc7..878bc542 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "envoy/config/core/v3/proxy_protocol.upbdefs.h"
+#include "envoy/config/core/v3/proxy_protocol.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_ProxyProtocolConfig_msginit,
-};
-
-static const char descriptor[299] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+static const char descriptor[368] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\"', '}', '\n', '\023',
@@ -24,20 +19,23 @@ static const char descriptor[299] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c
'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o',
'n', 'f', 'i', 'g', '.', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\"', '\031', '\n', '\007',
-'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\006', '\n', '\002', 'V', '1', '\020', '\000', '\022', '\006', '\n', '\002', 'V', '2', '\020', '\001', 'B', 'B',
-'\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\022', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o',
-'l', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\006', '\n', '\002', 'V', '1', '\020', '\000', '\022', '\006', '\n', '\002', 'V', '2', '\020', '\001', 'B', '\206',
+'\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\022', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/',
+'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e',
+'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&udpa_annotations_status_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_core_v3_proxy_protocol_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_proxy_protocol_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_proxy_protocol_proto_upb_file_layout,
"envoy/config/core/v3/proxy_protocol.proto",
- UPB_STRVIEW_INIT(descriptor, 299)
+ UPB_STRINGVIEW_INIT(descriptor, 368)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h
index 5f9c1a6c..cf152946 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_proxy_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_proxy_protocol_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_ProxyProtocolConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_proxy_protocol_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.ProxyProtocolConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_ProxyProtocolConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_proxy_protocol_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.ProxyProtocolConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
new file mode 100644
index 00000000..5f115884
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
@@ -0,0 +1,55 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/core/v3/resolver.upbdefs.h"
+#include "envoy/config/core/v3/resolver.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[612] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\"', '\203', '\001', '\n', '\022', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p',
+'s', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k',
+'u', 'p', 's', '\022', '7', '\n', '\030', 'n', 'o', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'e', 'a', 'r', 'c', 'h', '_',
+'d', 'o', 'm', 'a', 'i', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\025', 'n', 'o', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'e',
+'a', 'r', 'c', 'h', 'D', 'o', 'm', 'a', 'i', 'n', '\"', '\270', '\001', '\n', '\023', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't',
+'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\t', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\001', ' ',
+'\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'r', 'e', 's', 'o',
+'l', 'v', 'e', 'r', 's', '\022', 'Z', '\n', '\024', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', '_', 'o', 'p', 't',
+'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o',
+'n', 's', 'R', '\022', 'd', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\201', '\001',
+'\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321',
+'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &envoy_config_core_v3_address_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_core_v3_resolver_proto_upbdefinit = {
+ deps,
+ &envoy_config_core_v3_resolver_proto_upb_file_layout,
+ "envoy/config/core/v3/resolver.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 612)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h
new file mode 100644
index 00000000..ef6e1695
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_core_v3_resolver_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_DnsResolverOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_resolver_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.DnsResolverOptions");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_DnsResolutionConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_resolver_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.DnsResolutionConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
index 1ea0575c..6922a95a 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/core/v3/socket_option.upbdefs.h"
+#include "envoy/config/core/v3/socket_option.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_SocketOption_msginit,
-};
-
-static const char descriptor[590] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[659] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o',
'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
@@ -38,22 +33,25 @@ static const char descriptor[590] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c
'\017', '\n', '\013', 'S', 'T', 'A', 'T', 'E', '_', 'B', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\023', '\n', '\017', 'S', 'T', 'A', 'T', 'E',
'_', 'L', 'I', 'S', 'T', 'E', 'N', 'I', 'N', 'G', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o',
'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o',
-'n', 'B', '\014', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '\003', '\370', 'B', '\001', 'B', 'A', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v',
-'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', 'B', '\021', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'n', 'B', '\014', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\205', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', 'B', '\021', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_socket_option_proto_upb_file_layout,
"envoy/config/core/v3/socket_option.proto",
- UPB_STRVIEW_INIT(descriptor, 590)
+ UPB_STRINGVIEW_INIT(descriptor, 659)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h
index 200f4a3b..a6416a3c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_SocketOption_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_socket_option_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.SocketOption");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SocketOption_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_socket_option_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SocketOption");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
index 82062b66..4b16bc02 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
@@ -8,61 +8,63 @@
#include "upb/def.h"
#include "envoy/config/core/v3/substitution_format_string.upbdefs.h"
+#include "envoy/config/core/v3/substitution_format_string.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
-};
-
-static const char descriptor[711] = {'\n', '5', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'u',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[826] = {'\n', '5', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'u',
'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 't', 'r', 'i', 'n', 'g', '.',
'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034',
'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\203', '\003', '\n', '\030', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o',
-'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', '\022', '%', '\n', '\013', 't', 'e', 'x', 't', '_', 'f', 'o', 'r',
-'m', 'a', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\002', '\030', '\001', 'H', '\000', 'R', '\n', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm',
-'a', 't', '\022', 'D', '\n', '\013', 'j', 's', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'B', '\010',
-'\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\n', 'j', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'P', '\n',
-'\022', 't', 'e', 'x', 't', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\005', ' ', '\001', '(', '\013',
-'2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D',
-'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\020', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', 'S', 'o',
-'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'o', 'm', 'i', 't', '_', 'e', 'm', 'p', 't', 'y', '_', 'v', 'a', 'l', 'u', 'e', 's',
-'\030', '\003', ' ', '\001', '(', '\010', 'R', '\017', 'o', 'm', 'i', 't', 'E', 'm', 'p', 't', 'y', 'V', 'a', 'l', 'u', 'e', 's', '\022', '!',
-'\n', '\014', 'c', 'o', 'n', 't', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\013', 'c', 'o', 'n',
-'t', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', 'J', '\n', '\n', 'f', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', '\030', '\006', ' ',
-'\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'f',
-'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', 'B', '\r', '\n', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\022', '\003', '\370', 'B', '\001', 'B',
-'M', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\035', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o',
-'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006',
-'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e',
+'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\214', '\003', '\n',
+'\030', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g',
+'\022', '.', '\n', '\013', 't', 'e', 'x', 't', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001',
+'\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\n', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'D',
+'\n', '\013', 'j', 's', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'B', '\010', '\372', 'B', '\005', '\212',
+'\001', '\002', '\020', '\001', 'H', '\000', 'R', '\n', 'j', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'P', '\n', '\022', 't', 'e', 'x',
+'t', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S',
+'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\020', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', 'S', 'o', 'u', 'r', 'c', 'e',
+'\022', '*', '\n', '\021', 'o', 'm', 'i', 't', '_', 'e', 'm', 'p', 't', 'y', '_', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\003', ' ', '\001',
+'(', '\010', 'R', '\017', 'o', 'm', 'i', 't', 'E', 'm', 'p', 't', 'y', 'V', 'a', 'l', 'u', 'e', 's', '\022', '!', '\n', '\014', 'c', 'o',
+'n', 't', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\013', 'c', 'o', 'n', 't', 'e', 'n', 't',
+'T', 'y', 'p', 'e', '\022', 'J', '\n', '\n', 'f', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'f', 'o', 'r', 'm', 'a',
+'t', 't', 'e', 'r', 's', 'B', '\r', '\n', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\022', '\003', '\370', 'B', '\001', 'B', '\221', '\001', '\n', '\"',
+'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\035', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o',
+'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o',
+'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e',
+'/', 'v', '3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[7] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_core_v3_substitution_format_string_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_core_v3_substitution_format_string_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_substitution_format_string_proto_upb_file_layout,
"envoy/config/core/v3/substitution_format_string.proto",
- UPB_STRVIEW_INIT(descriptor, 711)
+ UPB_STRINGVIEW_INIT(descriptor, 826)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h
index c3196bd3..7530fb23 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_core_v3_substitution_format_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_substitution_format_string_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_core_v3_SubstitutionFormatString_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_core_v3_substitution_format_string_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.core.v3.SubstitutionFormatString");
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SubstitutionFormatString_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_substitution_format_string_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SubstitutionFormatString");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
new file mode 100644
index 00000000..a5b3f3bc
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
@@ -0,0 +1,49 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/core/v3/udp_socket_config.upbdefs.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[474] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'u', 'd',
+'p', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l',
+'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', '\250', '\001', '\n', '\017', 'U', 'd', 'p', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o', 'n', 'f', 'i',
+'g', '\022', 'Z', '\n', '\024', 'm', 'a', 'x', '_', 'r', 'x', '_', 'd', 'a', 't', 'a', 'g', 'r', 'a', 'm', '_', 's', 'i', 'z', 'e',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '2', '\006', '\020', '\200', '\200', '\004', ' ', '\000', 'R',
+'\021', 'm', 'a', 'x', 'R', 'x', 'D', 'a', 't', 'a', 'g', 'r', 'a', 'm', 'S', 'i', 'z', 'e', '\022', '9', '\n', '\n', 'p', 'r', 'e',
+'f', 'e', 'r', '_', 'g', 'r', 'o', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'e', 'f', 'e', 'r', 'G',
+'r', 'o', 'B', '\210', '\001', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'U', 'd', 'p', 'S', 'o', 'c', 'k',
+'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c',
+'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-',
+'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
+'3', ';', 'c', 'o', 'r', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_core_v3_udp_socket_config_proto_upbdefinit = {
+ deps,
+ &envoy_config_core_v3_udp_socket_config_proto_upb_file_layout,
+ "envoy/config/core/v3/udp_socket_config.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 474)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h
new file mode 100644
index 00000000..5539f729
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_core_v3_udp_socket_config_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_core_v3_UdpSocketConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_udp_socket_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.UdpSocketConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
index a140da45..66eedd93 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
@@ -8,27 +8,16 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/endpoint.upbdefs.h"
+#include "envoy/config/endpoint/v3/endpoint.upb.h"
-extern upb_def_init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
-};
-
-static const char descriptor[1443] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
+extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1520] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/',
'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v', '3', '/', 'e', 'n', 'd', 'p', 'o', 'i',
@@ -82,13 +71,16 @@ static const char descriptor[1443] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i',
'n', 't', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001',
':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'L', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'B', 'A', '\n', '&', 'i', 'o', '.',
-'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e',
-'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'P', 'r', 'o', 't', 'o',
-'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', 't', 'e', 'r', 'L', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'B', '\215', '\001', '\n', '&', 'i', 'o',
+'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v', '3', ';', 'e', 'n', 'd', 'p', 'o', 'i',
+'n', 't', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[8] = {
&envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -99,9 +91,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_config_endpoint_v3_endpoint_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_endpoint_v3_endpoint_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_endpoint_proto_upb_file_layout,
"envoy/config/endpoint/v3/endpoint.proto",
- UPB_STRVIEW_INIT(descriptor, 1443)
+ UPB_STRINGVIEW_INIT(descriptor, 1520)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h
index 9ac7a0e9..a886c79f 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h
@@ -19,26 +19,26 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_endpoint_v3_endpoint_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterLoadAssignment");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterLoadAssignment");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.Policy");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.Policy");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.Policy.DropOverload");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.Policy.DropOverload");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.NamedEndpointsEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterLoadAssignment.NamedEndpointsEntry");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
index ea1dc96f..df8b151c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
@@ -8,95 +8,110 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/endpoint_components.upbdefs.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_config_endpoint_v3_Endpoint_msginit,
- &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
- &envoy_config_endpoint_v3_LbEndpoint_msginit,
- &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
-};
-
-static const char descriptor[1584] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_health_check_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2196] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't',
'.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
'/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
-'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e',
-'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't',
-'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
-'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
-'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\201', '\003', '\n', '\010', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022',
-'7', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a',
-'d', 'd', 'r', 'e', 's', 's', '\022', 'd', '\n', '\023', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a',
-'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\003', ' ', '\001', '(',
-'\t', 'R', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\032', '\222', '\001', '\n', '\021', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '(', '\n', '\n', 'p', 'o', 'r', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ',
-'\001', '(', '\r', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '\377', '\377', '\003', 'R', '\t', 'p', 'o', 'r', 't', 'V', 'a', 'l', 'u', 'e',
-'\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n',
-'a', 'm', 'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C',
-'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\"',
-'\221', '\003', '\n', '\n', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '@', '\n', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n',
-'d', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'H', '\000', 'R', '\010', 'e', 'n', 'd',
-'p', 'o', 'i', 'n', 't', '\022', '%', '\n', '\r', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ',
-'\001', '(', '\t', 'H', '\000', 'R', '\014', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'N', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'h', 'e',
-'a', 'l', 't', 'h', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a',
-'t', 'u', 's', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g',
-'h', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l',
-'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h', 't', ':', '\'', '\232', '\305', '\210', '\036', '\"',
-'\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'L',
-'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'B', '\021', '\n', '\017', 'h', 'o', 's', 't', '_', 'i', 'd', 'e', 'n', 't', 'i', 'f',
-'i', 'e', 'r', '\"', '\211', '\003', '\n', '\023', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i',
-'t', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', 'G', '\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i',
-'n', 't', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l',
-'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c',
-'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B',
-'\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h',
-'t', '\022', '$', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\005', ' ', '\001', '(', '\r', 'B', '\010', '\372', 'B', '\005', '*',
-'\003', '\030', '\200', '\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', ':', '\n', '\t', 'p', 'r', 'o', 'x', 'i', 'm', 'i',
-'t', 'y', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'o', 'x', 'i', 'm', 'i', 't', 'y', ':',
-'0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p',
-'o', 'i', 'n', 't', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'B',
-'K', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\027', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e',
+'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r',
+'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\"', '\201', '\003', '\n', '\010', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '7', '\n', '\007', 'a', 'd', 'd', 'r', 'e',
+'s', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'd',
+'\n', '\023', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n',
+'a', 'm', 'e', '\032', '\222', '\001', '\n', '\021', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '(', '\n', '\n', 'p', 'o', 'r', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\t', '\372', 'B', '\006',
+'*', '\004', '\030', '\377', '\377', '\003', 'R', '\t', 'p', 'o', 'r', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\032', '\n', '\010', 'h', 'o', 's', 't',
+'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', ':', '7', '\232', '\305', '\210',
+'\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't',
+'.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f',
+'i', 'g', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\"', '\221', '\003', '\n', '\n', 'L', 'b', 'E', 'n',
+'d', 'p', 'o', 'i', 'n', 't', '\022', '@', '\n', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v',
+'3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'H', '\000', 'R', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '%', '\n',
+'\r', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\014', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', 'N', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 's', 't', 'a',
+'t', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'h', 'e', 'a',
+'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001',
+'(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'Y', '\n', '\025', 'l', 'o',
+'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\004', ' ', '\001', '(', '\013',
+'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
+'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n',
+'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h', 't', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', 'B', '\021', '\n', '\017', 'h', 'o', 's', 't', '_', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\"', '\222', '\001', '\n', '\031',
+'L', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'C', '\n', '\013', 'l', 'e', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i',
+'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'l', 'e', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '0', '\n', '\024', 'l', 'e',
+'d', 's', '_', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
+'\022', 'l', 'e', 'd', 's', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\"', '\341', '\005', '\n', '\023', 'L',
+'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c',
+'a', 'l', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l',
+'i', 't', 'y', '\022', 'G', '\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\030', '\002', ' ', '\003', '(', '\013',
+'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.',
+'v', '3', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't',
+'s', '\022', 'v', '\n', '\027', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '_', 'e', 'n', 'd', 'p', 'o', 'i',
+'n', 't', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd',
+'p', 'o', 'i', 'n', 't', 's', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'L', 'i', 's', 't', 'H', '\000', 'R', '\025',
+'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', 'v', '\n', '\034',
+'l', 'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o',
+'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\031', 'l', 'e', 'd', 's', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_',
+'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
+'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n',
+'g', 'W', 'e', 'i', 'g', 'h', 't', '\022', '$', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\005', ' ', '\001', '(', '\r',
+'B', '\010', '\372', 'B', '\005', '*', '\003', '\030', '\200', '\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', ':', '\n', '\t', 'p',
+'r', 'o', 'x', 'i', 'm', 'i', 't', 'y', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'o', 'x',
+'i', 'm', 'i', 't', 'y', '\032', 'Y', '\n', '\016', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'L', 'i', 's', 't', '\022', 'G',
+'\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'b',
+'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', ':', '0', '\232', '\305',
+'\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'B', '\013', '\n', '\t',
+'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'B', '\227', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.',
+'v', '3', 'B', '\027', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o',
+'t', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v', '3', ';', 'e', 'n', 'd', 'p', 'o',
+'i', 'n', 't', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[9] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_config_core_v3_health_check_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -105,9 +120,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout,
"envoy/config/endpoint/v3/endpoint_components.proto",
- UPB_STRVIEW_INIT(descriptor, 1584)
+ UPB_STRINGVIEW_INIT(descriptor, 2196)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
index 0173282c..eb25da59 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
@@ -19,26 +19,36 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_Endpoint_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.Endpoint");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_Endpoint_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.Endpoint");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.Endpoint.HealthCheckConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.Endpoint.HealthCheckConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LbEndpoint_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LbEndpoint");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_LbEndpoint_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.LbEndpoint");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LocalityLbEndpoints_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LocalityLbEndpoints");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_LedsClusterLocalityConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.LedsClusterLocalityConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_LocalityLbEndpoints_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.LocalityLbEndpoints");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
index a0fb711a..f5b6c582 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
@@ -8,29 +8,16 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/load_report.upbdefs.h"
+#include "envoy/config/endpoint/v3/load_report.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
- &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &envoy_config_endpoint_v3_ClusterStats_msginit,
- &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
-};
-
-static const char descriptor[2351] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2428] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'l', 'o', 'a', 'd', '_', 'r', 'e', 'p', 'o', 'r', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o',
'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's',
@@ -121,13 +108,16 @@ static const char descriptor[2351] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', '
'n', 't', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '.', 'D', 'r', 'o', 'p', 'p', 'e', 'd', 'R', 'e',
'q', 'u', 'e', 's', 't', 's', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', 'B',
-'C', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\017', 'L', 'o', 'a', 'd', 'R', 'e', 'p',
-'o', 'r', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
+'\217', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\017', 'L', 'o', 'a', 'd', 'R', 'e',
+'p', 'o', 'r', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n',
+'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
+'3', ';', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[8] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -138,9 +128,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_config_endpoint_v3_load_report_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_endpoint_v3_load_report_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_load_report_proto_upb_file_layout,
"envoy/config/endpoint/v3/load_report.proto",
- UPB_STRVIEW_INIT(descriptor, 2351)
+ UPB_STRINGVIEW_INIT(descriptor, 2428)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h
index 0a9b3047..8ef3ed05 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h
@@ -19,31 +19,31 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_endpoint_v3_load_report_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_endpoint_v3_load_report_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_UpstreamLocalityStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.UpstreamLocalityStats");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_UpstreamLocalityStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.UpstreamLocalityStats");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_UpstreamEndpointStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.UpstreamEndpointStats");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_UpstreamEndpointStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.UpstreamEndpointStats");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_EndpointLoadMetricStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.EndpointLoadMetricStats");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_EndpointLoadMetricStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.EndpointLoadMetricStats");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterStats");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterStats_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterStats");
}
-UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.ClusterStats.DroppedRequests");
+UPB_INLINE const upb_MessageDef *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_endpoint_v3_load_report_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.endpoint.v3.ClusterStats.DroppedRequests");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
index 088a1389..68183a06 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/api_listener.upbdefs.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_listener_v3_ApiListener_msginit,
-};
-
-static const char descriptor[359] = {'\n', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[436] = {'\n', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '\031', 'g', 'o',
'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035',
@@ -29,22 +24,25 @@ static const char descriptor[359] = {'\n', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c
'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013',
'a', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '2', '.', 'A', 'p', 'i', 'L', 'i',
-'s', 't', 'e', 'n', 'e', 'r', 'B', 'D', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\020',
-'A', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', 't', 'e', 'n', 'e', 'r', 'B', '\220', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B',
+'\020', 'A', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h',
+'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't',
+'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', ';', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&google_protobuf_any_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_listener_v3_api_listener_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_listener_v3_api_listener_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_api_listener_proto_upb_file_layout,
"envoy/config/listener/v3/api_listener.proto",
- UPB_STRVIEW_INIT(descriptor, 359)
+ UPB_STRINGVIEW_INIT(descriptor, 436)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h
index 54558997..b1b94eb6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_listener_v3_api_listener_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_api_listener_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ApiListener_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_api_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ApiListener");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ApiListener_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_api_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ApiListener");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
index f1d684a8..306f8cd8 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
@@ -8,171 +8,172 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/listener.upbdefs.h"
+#include "envoy/config/listener/v3/listener.upb.h"
-extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
-extern upb_def_init envoy_config_listener_v3_api_listener_proto_upbdefinit;
-extern upb_def_init envoy_config_listener_v3_listener_components_proto_upbdefinit;
-extern upb_def_init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init xds_core_v3_collection_entry_proto_upbdefinit;
-extern upb_def_init udpa_annotations_security_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_listener_v3_ListenerCollection_msginit,
- &envoy_config_listener_v3_Listener_msginit,
- &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
-};
-
-static const char descriptor[3185] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_socket_option_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_api_listener_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_listener_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_collection_entry_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[3552] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', ')', 'e', 'n', 'v', 'o', 'y', '/',
'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/', 'v', '3', '/', 'a', 'c', 'c', 'e', 's',
's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n',
'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p',
-'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
-'3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/',
-'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't',
-'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p',
-'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x',
-'d', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't',
-'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
-'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'L', '\n', '\022', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c',
-'t', 'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\034', '.', 'x',
-'d', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r',
-'y', 'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\335', '\022', '\n', '\010', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', '\022',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\007', 'a', 'd', 'd',
-'r', 'e', 's', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020',
-'\001', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i',
-'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'R', '\014', 'f',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 's', '\022', 'D', '\n', '\020', 'u', 's', 'e', '_', 'o', 'r', 'i', 'g', 'i', 'n',
-'a', 'l', '_', 'd', 's', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'u', 's', 'e', 'O', 'r', 'i', 'g', 'i',
-'n', 'a', 'l', 'D', 's', 't', '\022', 'W', '\n', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'f', 'i', 'l', 't', 'e', 'r', '_',
-'c', 'h', 'a', 'i', 'n', '\030', '\031', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
-'R', '\022', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '\022', 'o', '\n', '!', 'p',
-'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i',
-'t', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002',
-'\010', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i',
-'m', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'X', '\n', '\r', 'd', 'e', 'p',
-'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'v', '1', '\030', '\007', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', 'B', '\002', '\030', '\001', 'R', '\014', 'd', 'e', 'p', 'r',
-'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022', 'K', '\n', '\n', 'd', 'r', 'a', 'i', 'n', '_', 't', 'y', 'p', 'e', '\030', '\010', ' ',
-'\001', '(', '\016', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', 'R',
-'\t', 'd', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', '\022', 'S', '\n', '\020', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i',
-'l', 't', 'e', 'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l',
-'t', 'e', 'r', 'R', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', 'S', '\n', '\030', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\017',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'R', '\026', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i',
-'m', 'e', 'o', 'u', 't', '\022', 'N', '\n', '$', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '_', 'o', 'n', '_', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\021', ' ', '\001', '(',
-'\010', 'R', ' ', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', 'O', 'n', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't',
-'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't',
-'\030', '\n', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\022', '6', '\n',
-'\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd', '\030', '\013', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\010', 'f', 'r', 'e', 'e', 'b',
-'i', 'n', 'd', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\003',
-'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i',
-'o', 'n', 's', '\022', 'X', '\n', '\032', 't', 'c', 'p', '_', 'f', 'a', 's', 't', '_', 'o', 'p', 'e', 'n', '_', 'q', 'u', 'e', 'u',
-'e', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\014', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\026', 't', 'c', 'p', 'F',
-'a', 's', 't', 'O', 'p', 'e', 'n', 'Q', 'u', 'e', 'u', 'e', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'S', '\n', '\021', 't', 'r', 'a',
-'f', 'f', 'i', 'c', '_', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\020', ' ', '\001', '(', '\016', '2', '&', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'f', 'f', 'i',
-'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 't', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't',
-'i', 'o', 'n', '\022', '[', '\n', '\023', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\022', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i',
-'s', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f',
-'i', 'g', 'R', '\021', 'u', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014',
-'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '\030', '\023', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'A', 'p', 'i', 'L',
-'i', 's', 't', 'e', 'n', 'e', 'r', 'R', '\013', 'a', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', 'v', '\n', '\031', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\024', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\027', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'r', 'e', 'u', 's', 'e', '_',
-'p', 'o', 'r', 't', '\030', '\025', ' ', '\001', '(', '\010', 'R', '\t', 'r', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't', '\022', 'C', '\n', '\n',
-'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\026', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's',
-'s', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'V', '\n', '\021', 'u', 'd', 'p', '_', 'w', 'r',
-'i', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e',
-'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\017', 'u', 'd', 'p', 'W', 'r', 'i', 't', 'e', 'r', 'C', 'o', 'n',
-'f', 'i', 'g', '\022', 'F', '\n', '\020', 't', 'c', 'p', '_', 'b', 'a', 'c', 'k', 'l', 'o', 'g', '_', 's', 'i', 'z', 'e', '\030', '\030',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 't', 'c', 'p', 'B', 'a', 'c', 'k', 'l', 'o', 'g', 'S', 'i', 'z', 'e',
-'\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_', 'p', 'o', 'r', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\032', '.',
+'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
+'3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '+', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'a', 'p',
+'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'u', 'd', 'p', '_', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
+'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p',
+'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
+'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v',
+'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o',
+'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', 'L', '\n', '\022', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\034', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\200', '\025', '\n', '\010', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', '\022', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\007', 'a', 'd', 'd', 'r',
+'e', 's', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
+'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\037', '\n', '\013', 's', 't', 'a', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030',
+'\034', ' ', '\001', '(', '\t', 'R', '\n', 's', 't', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't',
+'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C',
+'h', 'a', 'i', 'n', 'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 's', '\022', 'D', '\n', '\020', 'u', 's', 'e',
+'_', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'u',
+'s', 'e', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', '\022', 'W', '\n', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_',
+'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', '\030', '\031', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't',
+'e', 'r', 'C', 'h', 'a', 'i', 'n', 'R', '\022', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', '\022', 'o', '\n', '!', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f',
+'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e',
+'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B',
+'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a',
+'t', 'a', '\030', '\006', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'\022', 'a', '\n', '\r', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'v', '1', '\030', '\007', ' ', '\001', '(', '\013', '2', '/',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', 'B', '\013', '\030',
+'\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022',
+'K', '\n', '\n', 'd', 'r', 'a', 'i', 'n', '_', 't', 'y', 'p', 'e', '\030', '\010', ' ', '\001', '(', '\016', '2', ',', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', 'R', '\t', 'd', 'r', 'a', 'i', 'n', 'T', 'y', 'p',
+'e', '\022', 'S', '\n', '\020', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\t', ' ', '\003',
+'(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\017', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', 'S', '\n', '\030', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f',
+'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\017', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\026', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'N', '\n', '$',
+'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '_', 'o', 'n', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't',
+'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\021', ' ', '\001', '(', '\010', 'R', ' ', 'c', 'o', 'n', 't', 'i', 'n',
+'u', 'e', 'O', 'n', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u',
+'t', '\022', '<', '\n', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\030', '\n', ' ', '\001', '(', '\013', '2', '\032', '.',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't', '\032', 'w', '\n', '\014', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e',
-'d', 'V', '1', '\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_', 'p', 'o', 'r', 't', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r',
-'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\032', '\247', '\002', '\n', '\027', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a',
-'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\r', 'e', 'x', 'a', 'c', 't', '_', 'b', 'a', 'l', 'a',
-'n', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n',
-'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't',
-'B', 'a', 'l', 'a', 'n', 'c', 'e', 'H', '\000', 'R', '\014', 'e', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', '\032', 'Q',
-'\n', '\014', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B',
-'a', 'l', 'a', 'n', 'c', 'e', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
-'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l',
-'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\023', '\n', '\014', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 't', 'y', 'p',
-'e', '\022', '\003', '\370', 'B', '\001', '\"', ')', '\n', '\t', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'D', 'E',
-'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\017', '\n', '\013', 'M', 'O', 'D', 'I', 'F', 'Y', '_', 'O', 'N', 'L', 'Y', '\020', '\001', ':',
-'\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'J', '\004', '\010', '\016', '\020', '\017', 'B', 'A', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
-'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
-'v', '3', 'B', '\r', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002',
-'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\022', '6', '\n', '\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd',
+'\030', '\013', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd', '\022', 'I', '\n', '\016', 's', 'o',
+'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p',
+'t', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\032', 't', 'c',
+'p', '_', 'f', 'a', 's', 't', '_', 'o', 'p', 'e', 'n', '_', 'q', 'u', 'e', 'u', 'e', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030',
+'\014', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\026', 't', 'c', 'p', 'F', 'a', 's', 't', 'O', 'p', 'e', 'n', 'Q', 'u',
+'e', 'u', 'e', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'S', '\n', '\021', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'd', 'i', 'r', 'e',
+'c', 't', 'i', 'o', 'n', '\030', '\020', ' ', '\001', '(', '\016', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o',
+'n', 'R', '\020', 't', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\022', '[', '\n', '\023', 'u', 'd',
+'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\022', ' ', '\001', '(', '\013', '2', '+',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'u', 'd', 'p', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e',
+'n', 'e', 'r', '\030', '\023', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'A', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'R', '\013',
+'a', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', 'v', '\n', '\031', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', ':', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L',
+'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\027', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '*', '\n', '\n', 'r', 'e', 'u', 's', 'e', '_', 'p', 'o', 'r', 't', '\030', '\025', ' ', '\001', '(',
+'\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\t', 'r', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't',
+'\022', 'F', '\n', '\021', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'u', 's', 'e', '_', 'p', 'o', 'r', 't', '\030', '\035', ' ', '\001',
+'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
+'V', 'a', 'l', 'u', 'e', 'R', '\017', 'e', 'n', 'a', 'b', 'l', 'e', 'R', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't', '\022', 'C', '\n',
+'\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\026', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e',
+'s', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'F', '\n', '\020', 't', 'c', 'p', '_', 'b',
+'a', 'c', 'k', 'l', 'o', 'g', '_', 's', 'i', 'z', 'e', '\030', '\030', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 't',
+'c', 'p', 'B', 'a', 'c', 'k', 'l', 'o', 'g', 'S', 'i', 'z', 'e', '\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_',
+'p', 'o', 'r', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't',
+'\022', 'h', '\n', '\021', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '\030', '\033', ' ', '\001',
+'(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\020', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '\022', '!', '\n', '\014', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'm', 'p', 't', 'c', 'p', '\030', '\036', ' ',
+'\001', '(', '\010', 'R', '\013', 'e', 'n', 'a', 'b', 'l', 'e', 'M', 'p', 't', 'c', 'p', '\022', '7', '\n', '\030', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'g', 'l', 'o', 'b', 'a', 'l', '_', 'c', 'o', 'n', 'n', '_', 'l', 'i', 'm', 'i', 't', '\030', '\037', ' ', '\001', '(', '\010',
+'R', '\025', 'i', 'g', 'n', 'o', 'r', 'e', 'G', 'l', 'o', 'b', 'a', 'l', 'C', 'o', 'n', 'n', 'L', 'i', 'm', 'i', 't', '\032', 'w',
+'\n', '\014', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o',
+'_', 'p', 'o', 'r', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r',
+'t', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\032', '\247', '\002', '\n', '\027', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n',
+'\r', 'e', 'x', 'a', 'c', 't', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'H', '\000', 'R', '\014', 'e', 'x', 'a',
+'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', '\032', 'Q', '\n', '\014', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', ':', '4', '\232', '\305', '\210', '\036', '/', '\n',
+'-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\023', '\n', '\014',
+'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\032', '\030', '\n', '\026', 'I', 'n', 't', 'e',
+'r', 'n', 'a', 'l', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\"', ')', '\n', '\t', 'D', 'r', 'a',
+'i', 'n', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\017', '\n', '\013', 'M', 'O',
+'D', 'I', 'F', 'Y', '_', 'O', 'N', 'L', 'Y', '\020', '\001', ':', '\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'B', '\024', '\n', '\022', 'l', 'i', 's', 't', 'e',
+'n', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\016', '\020', '\017', 'J', '\004', '\010', '\027', '\020', '\030',
+'B', '\215', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\r', 'L', 'i', 's', 't', 'e',
+'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e',
+'/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3',
+';', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
};
-static upb_def_init *deps[16] = {
+static _upb_DefPool_Init *deps[16] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
- &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_socket_option_proto_upbdefinit,
&envoy_config_listener_v3_api_listener_proto_upbdefinit,
&envoy_config_listener_v3_listener_components_proto_upbdefinit,
@@ -180,6 +181,7 @@ static upb_def_init *deps[16] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&xds_core_v3_collection_entry_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -187,9 +189,9 @@ static upb_def_init *deps[16] = {
NULL
};
-upb_def_init envoy_config_listener_v3_listener_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_listener_v3_listener_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_listener_proto_upb_file_layout,
"envoy/config/listener/v3/listener.proto",
- UPB_STRVIEW_INIT(descriptor, 3185)
+ UPB_STRINGVIEW_INIT(descriptor, 3552)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
index 535d37a3..3ca9dedf 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
@@ -19,31 +19,36 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_listener_v3_listener_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_listener_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ListenerCollection_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ListenerCollection");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ListenerCollection_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ListenerCollection");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Listener_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Listener");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_DeprecatedV1_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener.DeprecatedV1");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Listener_DeprecatedV1_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Listener.DeprecatedV1");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener.ConnectionBalanceConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Listener.ConnectionBalanceConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Listener_InternalListenerConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Listener.InternalListenerConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
index ffe22ce9..85bb66c7 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
@@ -8,186 +8,183 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/listener_components.upbdefs.h"
+#include "envoy/config/listener/v3/listener_components.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_config_listener_v3_Filter_msginit,
- &envoy_config_listener_v3_FilterChainMatch_msginit,
- &envoy_config_listener_v3_FilterChain_msginit,
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
- &envoy_config_listener_v3_ListenerFilter_msginit,
-};
-
-static const char descriptor[3284] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[3597] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
'.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
'/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
-'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e',
-'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3',
-'/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
-'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i',
-'d', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\202', '\002', '\n', '\006', 'F',
-'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g',
-'\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n',
-'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c',
-'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c',
-'o', 'n', 'f', 'i', 'g', '\"', '\212', '\006', '\n', '\020', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c',
-'h', '\022', 'T', '\n', '\020', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\010', ' ', '\001',
-'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
-'3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\017', 'd', 'e', 's',
-'t', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r', 't', '\022', 'D', '\n', '\r', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a',
-'n', 'g', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\014', 'p', 'r', 'e', 'f', 'i',
-'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '%', '\n', '\016', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 's', 'u', 'f', 'f', 'i', 'x',
-'\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'a', 'd', 'd', 'r', 'e', 's', 's', 'S', 'u', 'f', 'f', 'i', 'x', '\022', ';', '\n', '\n',
-'s', 'u', 'f', 'f', 'i', 'x', '_', 'l', 'e', 'n', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 's', 'u',
-'f', 'f', 'i', 'x', 'L', 'e', 'n', '\022', 'j', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\014', ' ',
-'\001', '(', '\016', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '.', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001',
-'\002', '\020', '\001', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', 'Q', '\n', '\024', 's', 'o', 'u', 'r', 'c', 'e',
-'_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a',
-'n', 'g', 'e', 'R', '\022', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '3',
-'\n', '\014', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'o', 'r', 't', 's', '\030', '\007', ' ', '\003', '(', '\r', 'B', '\020', '\372', 'B', '\r',
-'\222', '\001', '\n', '\"', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\013', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'o', 'r', 't',
-'s', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', 's', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\013',
-'s', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', '-', '\n', '\022', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_',
-'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\021', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '3', '\n', '\025', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '_', 'p',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\024', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i',
-'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\"', 'F', '\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '\007', '\n', '\003', 'A', 'N', 'Y', '\020', '\000', '\022', '\027', '\n', '\023', 'S', 'A',
-'M', 'E', '_', 'I', 'P', '_', 'O', 'R', '_', 'L', 'O', 'O', 'P', 'B', 'A', 'C', 'K', '\020', '\001', '\022', '\014', '\n', '\010', 'E', 'X',
-'T', 'E', 'R', 'N', 'A', 'L', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
-'M', 'a', 't', 'c', 'h', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\200', '\006', '\n', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
-'i', 'n', '\022', 'X', '\n', '\022', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', '_', 'm', 'a', 't', 'c', 'h', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'R',
-'\020', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '\022', ':', '\n', '\007', 'f', 'i', 'l', 't',
-'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e',
-'r', 's', '\022', 'F', '\n', '\017', 'u', 's', 'e', '_', 'p', 'r', 'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', '\030', '\004', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\r', 'u', 's', 'e', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', '\022',
-':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R',
-'\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R',
-'\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', 'b', '\n', ' ', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o',
-'u', 't', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\035', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
-'e', 't', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\007', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 's', '\n', '\027', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l',
-'t', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '.', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\025', 'o', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\032', '[', '\n', '\025', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\022', 'B', '\n', '\017', 'r', 'e', 'b', 'u', 'i', 'l', 'd', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\016', 'r', 'e', 'b', 'u', 'i', 'l', 'd', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '(', '\232', '\305',
-'\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
-'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 't', 'l', 's', '_',
-'c', 'o', 'n', 't', 'e', 'x', 't', '\"', '\302', '\005', '\n', '!', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
-'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'a', '\n', '\010', 'o',
-'r', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.',
-'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c', 'h', '\022', 'c', '\n', '\t', 'a', 'n',
-'d', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.',
-'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', '\022', 'Z', '\n', '\t', 'n',
-'o', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
-'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
-'H', '\000', 'R', '\010', 'n', 'o', 't', 'M', 'a', 't', 'c', 'h', '\022', '&', '\n', '\t', 'a', 'n', 'y', '_', 'm', 'a', 't', 'c', 'h',
-'\030', '\004', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a', 't',
-'c', 'h', '\022', 'Q', '\n', '\026', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '_', 'r', 'a',
-'n', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
-'.', 'I', 'n', 't', '3', '2', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\024', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o',
-'n', 'P', 'o', 'r', 't', 'R', 'a', 'n', 'g', 'e', '\032', '\260', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', '\022', '[',
-'\n', '\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e',
+'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p',
+'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l',
+'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
+'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i',
+'d', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\202', '\002', '\n', '\006', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004',
+'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e',
+'\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y',
+'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o',
+'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S',
+'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':',
+'#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p',
+'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\352', '\006', '\n',
+'\020', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '\022', 'T', '\n', '\020', 'd', 'e', 's', 't',
+'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013',
+'\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\017', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P',
+'o', 'r', 't', '\022', 'D', '\n', '\r', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's', '\030', '\003', ' ', '\003', '(',
+'\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\014', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '%',
+'\n', '\016', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'a',
+'d', 'd', 'r', 'e', 's', 's', 'S', 'u', 'f', 'f', 'i', 'x', '\022', ';', '\n', '\n', 's', 'u', 'f', 'f', 'i', 'x', '_', 'l', 'e',
+'n', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 's', 'u', 'f', 'f', 'i', 'x', 'L', 'e', 'n', '\022', '^',
+'\n', '\033', 'd', 'i', 'r', 'e', 'c', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a',
+'n', 'g', 'e', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\030', 'd', 'i', 'r', 'e', 'c',
+'t', 'S', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', 'j', '\n', '\013', 's', 'o',
+'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\014', ' ', '\001', '(', '\016', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C',
+'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c',
+'e', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y',
+'p', 'e', '\022', 'Q', '\n', '\024', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e',
+'s', '\030', '\006', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\022', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r',
+'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '3', '\n', '\014', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'o', 'r', 't',
+'s', '\030', '\007', ' ', '\003', '(', '\r', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001',
+'R', '\013', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'o', 'r', 't', 's', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n',
+'a', 'm', 'e', 's', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\013', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', '-',
+'\n', '\022', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\t', ' ', '\001', '(',
+'\t', 'R', '\021', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '3', '\n', '\025', 'a',
+'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\n', ' ', '\003', '(',
+'\t', 'R', '\024', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\"', 'F',
+'\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '\007', '\n',
+'\003', 'A', 'N', 'Y', '\020', '\000', '\022', '\027', '\n', '\023', 'S', 'A', 'M', 'E', '_', 'I', 'P', '_', 'O', 'R', '_', 'L', 'O', 'O', 'P',
+'B', 'A', 'C', 'K', '\020', '\001', '\022', '\014', '\n', '\010', 'E', 'X', 'T', 'E', 'R', 'N', 'A', 'L', '\020', '\002', ':', '-', '\232', '\305', '\210',
+'\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\211',
+'\006', '\n', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '\022', 'X', '\n', '\022', 'f', 'i', 'l', 't', 'e', 'r', '_',
+'c', 'h', 'a', 'i', 'n', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'R', '\020', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M',
+'a', 't', 'c', 'h', '\022', ':', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F',
+'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', 'O', '\n', '\017', 'u', 's', 'e', '_', 'p', 'r', 'o',
+'x', 'y', '_', 'p', 'r', 'o', 't', 'o', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330',
+'\004', '\003', '3', '.', '0', 'R', '\r', 'u', 's', 'e', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', '\022', ':', '\n', '\010', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
+'\030', '\006', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a',
+'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', 'b', '\n', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
+'_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\t',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\035', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o',
+'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\007', ' ', '\001', '(',
+'\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 's', '\n', '\027', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '_', 'c', 'o', 'n', 'f',
+'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C',
+'h', 'a', 'i', 'n', '.', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\025', 'o', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\032',
+'[', '\n', '\025', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022',
+'B', '\n', '\017', 'r', 'e', 'b', 'u', 'i', 'l', 'd', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\016', 'r', 'e', 'b', 'u', 'i', 'l', 'd', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '(', '\232', '\305', '\210', '\036', '#', '\n',
+'!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i',
+'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't',
+'e', 'x', 't', '\"', '\302', '\005', '\n', '!', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'a', '\n', '\010', 'o', 'r', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c',
+'h', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c', 'h', '\022', 'c', '\n', '\t', 'a', 'n', 'd', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c',
+'h', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', '\022', 'Z', '\n', '\t', 'n', 'o', 't', '_', 'm',
+'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't',
+'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\010',
+'n', 'o', 't', 'M', 'a', 't', 'c', 'h', '\022', '&', '\n', '\t', 'a', 'n', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001',
+'(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a', 't', 'c', 'h', '\022', 'Q',
+'\n', '\026', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '_', 'r', 'a', 'n', 'g', 'e', '\030',
+'\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't',
+'3', '2', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\024', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r',
+'t', 'R', 'a', 'n', 'g', 'e', '\032', '\260', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', '\022', '[', '\n', '\005', 'r', 'u',
+'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372', 'B', '\005',
+'\222', '\001', '\002', '\010', '\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e',
+'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', ':', '>', '\232', '\305', '\210', '\036', '9', '\n', '7', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B',
-'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's',
-'t', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd',
-'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', ':', '>', '\232', '\305', '\210', '\036', '9', '\n', '7', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e',
-'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c',
-'a', 't', 'e', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\230', '\002', '\n', '\016', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'd',
-'\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', ';',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
-'.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h',
-'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'D', 'i', 's', 'a', 'b', 'l', 'e', 'd',
-':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's',
-'t', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c',
-'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B',
-'K', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\027', 'L', 'i', 's', 't', 'e', 'n', 'e',
-'r', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\362', '\002', '\n', '\016', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i',
+'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o',
+'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g',
+'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\022', 'd', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b',
+'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'R', '\016', 'f', 'i', 'l',
+'t', 'e', 'r', 'D', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002',
+'\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', '\227', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'.', 'v', '3', 'B', '\027', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r',
+'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o',
+'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', ';', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[11] = {
+static _upb_DefPool_Init *deps[12] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
- &envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_type_v3_range_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_listener_v3_listener_components_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_listener_v3_listener_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_listener_components_proto_upb_file_layout,
"envoy/config/listener/v3/listener_components.proto",
- UPB_STRVIEW_INIT(descriptor, 3284)
+ UPB_STRINGVIEW_INIT(descriptor, 3597)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h
index a09ef60c..46bd8406 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h
@@ -19,41 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_listener_v3_listener_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_listener_components_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Filter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Filter");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_Filter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.Filter");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_FilterChainMatch_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.FilterChainMatch");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_FilterChainMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.FilterChainMatch");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_FilterChain_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.FilterChain");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_FilterChain_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.FilterChain");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.FilterChain.OnDemandConfiguration");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.FilterChain.OnDemandConfiguration");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ListenerFilterChainMatchPredicate");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ListenerFilterChainMatchPredicate");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ListenerFilterChainMatchPredicate.MatchSet");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ListenerFilterChainMatchPredicate.MatchSet");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ListenerFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ListenerFilter");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ListenerFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_listener_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ListenerFilter");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
new file mode 100644
index 00000000..a40b98ab
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
@@ -0,0 +1,88 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/listener/v3/quic_config.upbdefs.h"
+#include "envoy/config/listener/v3/quic_config.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1184] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+'3', '/', 'q', 'u', 'i', 'c', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+'/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
+'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\266', '\005', '\n', '\023', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
+'O', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\025', 'q', 'u', 'i', 'c', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_',
+'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O',
+'p', 't', 'i', 'o', 'n', 's', 'R', '\023', 'q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
+'n', 's', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'S', '\n', '\030', 'c', 'r', 'y', 'p', 't', 'o', '_',
+'h', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'R', '\026', 'c', 'r', 'y', 'p', 't', 'o', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022',
+'B', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a',
+'t', 'u', 'r', 'e', 'F', 'l', 'a', 'g', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', '}', '\n', ')', 'p', 'a', 'c', 'k',
+'e', 't', 's', '_', 't', 'o', '_', 'r', 'e', 'a', 'd', '_', 't', 'o', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'c', 'o', 'u', 'n', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007',
+'\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '#', 'p', 'a', 'c', 'k', 'e', 't', 's', 'T', 'o', 'R', 'e', 'a', 'd', 'T', 'o', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'C', 'o', 'u', 'n', 't', 'R', 'a', 't', 'i', 'o', '\022', '\\', '\n', '\024', 'c', 'r',
+'y', 'p', 't', 'o', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'c', 'r', 'y', 'p', 't',
+'o', 'S', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z', '\n', '\023', 'p', 'r', 'o', 'o', 'f', '_', 's', 'o',
+'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'p', 'r', 'o', 'o', 'f', 'S', 'o', 'u', 'r', 'c', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', 'B', '\217', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\017',
+'Q', 'u', 'i', 'c', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o',
+'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', '/', 'v', '3', ';', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[9] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_core_v3_protocol_proto_upbdefinit,
+ &google_protobuf_duration_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_listener_v3_quic_config_proto_upbdefinit = {
+ deps,
+ &envoy_config_listener_v3_quic_config_proto_upb_file_layout,
+ "envoy/config/listener/v3/quic_config.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1184)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h
new file mode 100644
index 00000000..d59f0703
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_listener_v3_quic_config_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_QuicProtocolOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_quic_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.QuicProtocolOptions");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
index 525a38a5..8aa00526 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
@@ -8,52 +8,56 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/udp_listener_config.upbdefs.h"
+#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_listener_v3_UdpListenerConfig_msginit,
- &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit,
-};
-
-static const char descriptor[544] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+extern _upb_DefPool_Init envoy_config_core_v3_udp_socket_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_quic_config_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[769] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
-'.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.',
-'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's',
-'t', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\307', '\001', '\n',
-'\021', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '*', '\n', '\021', 'u', 'd', 'p',
-'_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\017', 'u', 'd', 'p',
-'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '.', '\232', '\305',
-'\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
-'r', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\013', 'c', 'o',
-'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'U',
-'\n', '\032', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n',
-'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', 'J', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
-'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
-'v', '3', 'B', '\026', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't',
-'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'.', 'v', '3', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+'/', 'u', 'd', 'p', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3',
+'/', 'q', 'u', 'i', 'c', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n',
+'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\234', '\002', '\n', '\021', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '_', '\n', '\030', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 's', 'o', 'c', 'k',
+'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'd', 'p', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o',
+'n', 'f', 'i', 'g', 'R', '\026', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', 'P', '\n', '\014', 'q', 'u', 'i', 'c', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\001', '(', '\013',
+'2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
+'v', '3', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\013', 'q',
+'u', 'i', 'c', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n',
+'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020',
+'\004', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\006', '\020', '\007', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'U', '\n', '\032',
+'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
+'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '.', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n',
+'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\226', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v',
+'3', 'B', '\026', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o',
+'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', ';', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
- &google_protobuf_any_proto_upbdefinit,
+static _upb_DefPool_Init *deps[5] = {
+ &envoy_config_core_v3_udp_socket_config_proto_upbdefinit,
+ &envoy_config_listener_v3_quic_config_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout,
"envoy/config/listener/v3/udp_listener_config.proto",
- UPB_STRVIEW_INIT(descriptor, 544)
+ UPB_STRINGVIEW_INIT(descriptor, 769)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h
index 3246d916..2257f36d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_UdpListenerConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_udp_listener_config_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.UdpListenerConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_UdpListenerConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_udp_listener_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.UdpListenerConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_listener_v3_ActiveRawUdpListenerConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_udp_listener_config_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.ActiveRawUdpListenerConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_listener_v3_ActiveRawUdpListenerConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_listener_v3_udp_listener_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.listener.v3.ActiveRawUdpListenerConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c
new file mode 100644
index 00000000..41d1add7
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c
@@ -0,0 +1,69 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/metrics/v3/metrics_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/metrics/v3/metrics_service.upbdefs.h"
+#include "envoy/config/metrics/v3/metrics_service.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[821] = {'\n', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3',
+'/', 'm', 'e', 't', 'r', 'i', 'c', 's', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', '\032', '(', 'e',
+'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r',
+'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\"', '\201', '\003', '\n', '\024', 'M', 'e', 't', 'r', 'i', 'c', 's', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', 'N', '\n', '\014', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013',
+'2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G',
+'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'g', 'r', 'p',
+'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '^', '\n', '\025', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'a', 'p', 'i',
+'_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '\010',
+'\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\023', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'A', 'p', 'i', 'V', 'e', 'r',
+'s', 'i', 'o', 'n', '\022', 'U', '\n', '\031', 'r', 'e', 'p', 'o', 'r', 't', '_', 'c', 'o', 'u', 'n', 't', 'e', 'r', 's', '_', 'a',
+'s', '_', 'd', 'e', 'l', 't', 'a', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\026', 'r', 'e', 'p', 'o', 'r', 't',
+'C', 'o', 'u', 'n', 't', 'e', 'r', 's', 'A', 's', 'D', 'e', 'l', 't', 'a', 's', '\022', '-', '\n', '\023', 'e', 'm', 'i', 't', '_',
+'t', 'a', 'g', 's', '_', 'a', 's', '_', 'l', 'a', 'b', 'e', 'l', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\020', 'e', 'm', 'i',
+'t', 'T', 'a', 'g', 's', 'A', 's', 'L', 'a', 'b', 'e', 'l', 's', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '2', '.', 'M', 'e', 't', 'r',
+'i', 'c', 's', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\220', '\001', '\n', '%', 'i', 'o', '.', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e',
+'t', 'r', 'i', 'c', 's', '.', 'v', '3', 'B', '\023', 'M', 'e', 't', 'r', 'i', 'c', 's', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'P',
+'r', 'o', 't', 'o', 'P', '\001', 'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', ';', 'm', 'e', 't', 'r',
+'i', 'c', 's', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &envoy_config_core_v3_config_source_proto_upbdefinit,
+ &envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_metrics_v3_metrics_service_proto_upbdefinit = {
+ deps,
+ &envoy_config_metrics_v3_metrics_service_proto_upb_file_layout,
+ "envoy/config/metrics/v3/metrics_service.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 821)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h
new file mode 100644
index 00000000..736343f8
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/metrics/v3/metrics_service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_metrics_v3_metrics_service_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_MetricsServiceConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_metrics_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.MetricsServiceConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_METRICS_V3_METRICS_SERVICE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
index e49149aa..cfd0ca4b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
@@ -8,35 +8,16 @@
#include "upb/def.h"
#include "envoy/config/metrics/v3/stats.upbdefs.h"
+#include "envoy/config/metrics/v3/stats.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsMatcher_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_TagSpecifier_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HistogramBucketSettings_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_DogStatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HystrixSink_msginit;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_metrics_v3_StatsSink_msginit,
- &envoy_config_metrics_v3_StatsConfig_msginit,
- &envoy_config_metrics_v3_StatsMatcher_msginit,
- &envoy_config_metrics_v3_TagSpecifier_msginit,
- &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
- &envoy_config_metrics_v3_StatsdSink_msginit,
- &envoy_config_metrics_v3_DogStatsdSink_msginit,
- &envoy_config_metrics_v3_HystrixSink_msginit,
-};
-
-static const char descriptor[2091] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2166] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3',
'/', 's', 't', 'a', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"',
@@ -116,13 +97,16 @@ static const char descriptor[2091] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', '
'\002', '\020', '\003', '\"', 'Z', '\n', '\013', 'H', 'y', 's', 't', 'r', 'i', 'x', 'S', 'i', 'n', 'k', '\022', '\037', '\n', '\013', 'n', 'u', 'm',
'_', 'b', 'u', 'c', 'k', 'e', 't', 's', '\030', '\001', ' ', '\001', '(', '\003', 'R', '\n', 'n', 'u', 'm', 'B', 'u', 'c', 'k', 'e', 't',
's', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e',
-'t', 'r', 'i', 'c', 's', '.', 'v', '2', '.', 'H', 'y', 's', 't', 'r', 'i', 'x', 'S', 'i', 'n', 'k', 'B', '=', '\n', '%', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', 'B', '\n', 'S', 't', 'a', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'t', 'r', 'i', 'c', 's', '.', 'v', '2', '.', 'H', 'y', 's', 't', 'r', 'i', 'x', 'S', 'i', 'n', 'k', 'B', '\207', '\001', '\n', '%',
+'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', 'B', '\n', 'S', 't', 'a', 't', 's', 'P', 'r', 'o', 't', 'o', 'P',
+'\001', 'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/',
+'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
+'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', ';', 'm', 'e', 't', 'r', 'i', 'c', 's', 'v', '3',
'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[8] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
@@ -133,9 +117,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_config_metrics_v3_stats_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_metrics_v3_stats_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_metrics_v3_stats_proto_upb_file_layout,
"envoy/config/metrics/v3/stats.proto",
- UPB_STRVIEW_INIT(descriptor, 2091)
+ UPB_STRINGVIEW_INIT(descriptor, 2166)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h
index 0432cfd1..c3bcb26d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h
@@ -19,46 +19,46 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_metrics_v3_stats_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_metrics_v3_stats_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_StatsSink_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.StatsSink");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_StatsSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.StatsSink");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_StatsConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.StatsConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_StatsConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.StatsConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_StatsMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.StatsMatcher");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_StatsMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.StatsMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_TagSpecifier_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.TagSpecifier");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_TagSpecifier_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.TagSpecifier");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_HistogramBucketSettings_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.HistogramBucketSettings");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_HistogramBucketSettings_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.HistogramBucketSettings");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_StatsdSink_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.StatsdSink");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_StatsdSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.StatsdSink");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_DogStatsdSink_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.DogStatsdSink");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_DogStatsdSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.DogStatsdSink");
}
-UPB_INLINE const upb_msgdef *envoy_config_metrics_v3_HystrixSink_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.metrics.v3.HystrixSink");
+UPB_INLINE const upb_MessageDef *envoy_config_metrics_v3_HystrixSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_metrics_v3_stats_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.metrics.v3.HystrixSink");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
index e189d990..4d351053 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
@@ -8,34 +8,15 @@
#include "upb/def.h"
#include "envoy/config/overload/v3/overload.upbdefs.h"
+#include "envoy/config/overload/v3/overload.upb.h"
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_Trigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_overload_v3_ResourceMonitor_msginit,
- &envoy_config_overload_v3_ThresholdTrigger_msginit,
- &envoy_config_overload_v3_ScaledTrigger_msginit,
- &envoy_config_overload_v3_Trigger_msginit,
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit,
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
- &envoy_config_overload_v3_OverloadAction_msginit,
- &envoy_config_overload_v3_OverloadManager_msginit,
-};
-
-static const char descriptor[2145] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '/', 'v',
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2435] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '/', 'v',
'3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/',
't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o',
@@ -105,25 +86,37 @@ static const char descriptor[2145] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e',
'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\263', '\002', '\n', '\017', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a',
-'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\020', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l',
-'\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'r', 'e', 'f', 'r', 'e', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l',
-'\022', '`', '\n', '\021', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'm', 'o', 'n', 'i', 't', 'o', 'r', 's', '\030', '\002', ' ', '\003',
-'(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a',
-'d', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 'B', '\010', '\372', 'B', '\005',
-'\222', '\001', '\002', '\010', '\001', 'R', '\020', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 's', '\022', 'B',
-'\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a',
-'d', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a',
-'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', 'A', '\n', '&', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', 'B', '\r', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'P', 'r', 'o',
-'t', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'p', '\n', '\023', 'B', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o',
+'r', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '%', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'a', 'c', 'c', 'o', 'u',
+'n', 't', '_', 't', 'o', '_', 't', 'r', 'a', 'c', 'k', '_', 'p', 'o', 'w', 'e', 'r', '_', 'o', 'f', '_', 't', 'w', 'o', '\030',
+'\001', ' ', '\001', '(', '\r', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '8', '(', '\n', 'R', '\037', 'm', 'i', 'n', 'i', 'm', 'u', 'm',
+'A', 'c', 'c', 'o', 'u', 'n', 't', 'T', 'o', 'T', 'r', 'a', 'c', 'k', 'P', 'o', 'w', 'e', 'r', 'O', 'f', 'T', 'w', 'o', '\"',
+'\226', '\003', '\n', '\017', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\020', 'r', 'e',
+'f', 'r', 'e', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'r',
+'e', 'f', 'r', 'e', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '`', '\n', '\021', 'r', 'e', 's', 'o', 'u', 'r', 'c',
+'e', '_', 'm', 'o', 'n', 'i', 't', 'o', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r',
+'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\020', 'r', 'e', 's', 'o',
+'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 's', '\022', 'B', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\003',
+' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l',
+'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c',
+'t', 'i', 'o', 'n', 's', '\022', 'a', '\n', '\025', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'f', 'a', 'c', 't', 'o', 'r', 'y', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'B', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o',
+'r', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o', 'r', 'y', 'C', 'o',
+'n', 'f', 'i', 'g', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a',
+'d', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\215', '\001', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v',
+'3', 'B', '\r', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'J', 'g', 'i', 't', 'h', 'u',
+'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r',
+'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e',
+'r', 'l', 'o', 'a', 'd', '/', 'v', '3', ';', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[7] = {
+static _upb_DefPool_Init *deps[7] = {
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -133,9 +126,9 @@ static upb_def_init *deps[7] = {
NULL
};
-upb_def_init envoy_config_overload_v3_overload_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_overload_v3_overload_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_overload_v3_overload_proto_upb_file_layout,
"envoy/config/overload/v3/overload.proto",
- UPB_STRVIEW_INIT(descriptor, 2145)
+ UPB_STRINGVIEW_INIT(descriptor, 2435)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
index ca1dc517..76225a89 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
@@ -19,46 +19,51 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_overload_v3_overload_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_overload_v3_overload_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_ResourceMonitor_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.ResourceMonitor");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_ResourceMonitor_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.ResourceMonitor");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_ThresholdTrigger_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.ThresholdTrigger");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_ThresholdTrigger_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.ThresholdTrigger");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_ScaledTrigger_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.ScaledTrigger");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_ScaledTrigger_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.ScaledTrigger");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_Trigger_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.Trigger");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_Trigger_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.Trigger");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.ScaleTimersOverloadActionConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.ScaleTimersOverloadActionConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.ScaleTimersOverloadActionConfig.ScaleTimer");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_OverloadAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.OverloadAction");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_OverloadAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.OverloadAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_overload_v3_OverloadManager_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.OverloadManager");
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_BufferFactoryConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.BufferFactoryConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_overload_v3_OverloadManager_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.overload.v3.OverloadManager");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c
index de6422d1..32084af5 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c
@@ -8,173 +8,173 @@
#include "upb/def.h"
#include "envoy/config/rbac/v3/rbac.upbdefs.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
-extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
-extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_path_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init google_api_expr_v1alpha1_checked_proto_upbdefinit;
-extern upb_def_init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_rbac_v3_RBAC_msginit,
- &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
- &envoy_config_rbac_v3_Policy_msginit,
- &envoy_config_rbac_v3_Permission_msginit,
- &envoy_config_rbac_v3_Permission_Set_msginit,
- &envoy_config_rbac_v3_Principal_msginit,
- &envoy_config_rbac_v3_Principal_Set_msginit,
- &envoy_config_rbac_v3_Principal_Authenticated_msginit,
-};
-
-static const char descriptor[3112] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'b', 'a', 'c', '/', 'v', '3', '/', 'r', 'b',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_path_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_expr_v1alpha1_checked_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[3446] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'b', 'a', 'c', '/', 'v', '3', '/', 'r', 'b',
'a', 'c', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b',
'a', 'c', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/',
-'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c',
-'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p',
-'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/',
-'m', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o',
-'\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'p',
-'a', 't', 'h', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't',
-'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x', 'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '/', 'c', 'h', 'e',
-'c', 'k', 'e', 'd', '.', 'p', 'r', 'o', 't', 'o', '\032', '%', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x',
-'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '/', 's', 'y', 'n', 't', 'a', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
-'s', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
-'t', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\266', '\002',
-'\n', '\004', 'R', 'B', 'A', 'C', '\022', 'C', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', '!', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C',
-'.', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n',
-'\022', 'D', '\n', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C', '.', 'P', 'o', 'l',
-'i', 'c', 'i', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', 'Y', '\n', '\r', 'P',
-'o', 'l', 'i', 'c', 'i', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t',
-'R', '\003', 'k', 'e', 'y', '\022', '2', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'o', 'l', 'i', 'c', 'y',
-'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', '&', '\n', '\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\t', '\n', '\005',
-'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\010', '\n', '\004', 'D', 'E', 'N', 'Y', '\020', '\001', '\022', '\007', '\n', '\003', 'L', 'O', 'G', '\020',
-'\002', ':', ' ', '\232', '\305', '\210', '\036', '\033', '\n', '\031', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b',
-'a', 'c', '.', 'v', '2', '.', 'R', 'B', 'A', 'C', '\"', '\223', '\003', '\n', '\006', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'L', '\n', '\013',
-'p', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\013', 'p', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 's', '\022',
-'I', '\n', '\n', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p',
-'a', 'l', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\n', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 's', '\022',
-'Z', '\n', '\t', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'a', 'p', 'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '.', 'E', 'x', 'p', 'r',
-'B', '\034', '\362', '\230', '\376', '\217', '\005', '\026', '\022', '\024', 'e', 'x', 'p', 'r', 'e', 's', 's', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c',
-'i', 'f', 'i', 'e', 'r', 'R', '\t', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\022', 'p', '\n', '\021', 'c', 'h', 'e', 'c', 'k',
-'e', 'd', '_', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '%', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'a', 'p', 'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '.', 'C', 'h', 'e', 'c',
-'k', 'e', 'd', 'E', 'x', 'p', 'r', 'B', '\034', '\362', '\230', '\376', '\217', '\005', '\026', '\022', '\024', 'e', 'x', 'p', 'r', 'e', 's', 's', 'i',
-'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\020', 'c', 'h', 'e', 'c', 'k', 'e', 'd', 'C', 'o', 'n', 'd',
-'i', 't', 'i', 'o', 'n', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\277', '\006', '\n', '\n', 'P', 'e', 'r', 'm',
-'i', 's', 's', 'i', 'o', 'n', '\022', 'C', '\n', '\t', 'a', 'n', 'd', '_', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P',
-'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', '.', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'R', 'u', 'l', 'e', 's',
-'\022', 'A', '\n', '\010', 'o', 'r', '_', 'r', 'u', 'l', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i',
-'o', 'n', '.', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\003', 'a', 'n', 'y', '\030',
-'\003', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\003', 'a', 'n', 'y', '\022', '>', '\n', '\006',
-'h', 'e', 'a', 'd', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
-'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', '?', '\n', '\010', 'u', 'r', 'l', '_', 'p', 'a', 't', 'h', '\030', '\n', ' ',
-'\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'P', 'a', 't', 'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\007', 'u', 'r', 'l', 'P', 'a', 't', 'h',
-'\022', 'H', '\n', '\016', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'i', 'p', '\030', '\005', ' ', '\001', '(', '\013', '2',
-'\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i',
-'d', 'r', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\r', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'I', 'p', '\022',
-'6', '\n', '\020', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\006', ' ', '\001', '(', '\r',
-'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '\377', '\377', '\003', 'H', '\000', 'R', '\017', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o',
-'n', 'P', 'o', 'r', 't', '\022', 'D', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ', '\001', '(', '\013', '2', '&',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'\022', '=', '\n', '\010', 'n', 'o', 't', '_', 'r', 'u', 'l', 'e', '\030', '\010', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i',
-'o', 'n', 'H', '\000', 'R', '\007', 'n', 'o', 't', 'R', 'u', 'l', 'e', '\022', 'Z', '\n', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'e',
-'d', '_', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\t', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v',
-'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g',
-'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'e', 'd', 'S', 'e', 'r', 'v', 'e',
-'r', 'N', 'a', 'm', 'e', '\032', 's', '\n', '\003', 'S', 'e', 't', '\022', '@', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\003',
-'(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3',
-'.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\005', 'r', 'u',
-'l', 'e', 's', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', '.', 'S', 'e', 't', ':', '&', '\232',
-'\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v',
-'2', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001',
-'\"', '\222', '\010', '\n', '\t', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '\022', '>', '\n', '\007', 'a', 'n', 'd', '_', 'i', 'd', 's',
-'\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a',
-'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'S', 'e', 't', 'H', '\000', 'R', '\006', 'a', 'n', 'd',
-'I', 'd', 's', '\022', '<', '\n', '\006', 'o', 'r', '_', 'i', 'd', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p',
-'a', 'l', '.', 'S', 'e', 't', 'H', '\000', 'R', '\005', 'o', 'r', 'I', 'd', 's', '\022', '\033', '\n', '\003', 'a', 'n', 'y', '\030', '\003', ' ',
-'\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\003', 'a', 'n', 'y', '\022', 'U', '\n', '\r', 'a', 'u',
-'t', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
-'.', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', 'H', '\000', 'R', '\r', 'a', 'u', 't', 'h', 'e', 'n', 't',
-'i', 'c', 'a', 't', 'e', 'd', '\022', 'B', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\005', ' ', '\001', '(', '\013',
-'2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'B', '\002', '\030', '\001', 'H', '\000', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', '\022',
-'K', '\n', '\020', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\013',
-'2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\016', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 'm', 'o', 't', 'e', 'I',
-'p', '\022', '>', '\n', '\t', 'r', 'e', 'm', 'o', 't', 'e', '_', 'i', 'p', '\030', '\013', ' ', '\001', '(', '\013', '2', '\037', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a',
-'n', 'g', 'e', 'H', '\000', 'R', '\010', 'r', 'e', 'm', 'o', 't', 'e', 'I', 'p', '\022', '>', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r',
-'\030', '\006', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e',
-'a', 'd', 'e', 'r', '\022', '?', '\n', '\010', 'u', 'r', 'l', '_', 'p', 'a', 't', 'h', '\030', '\t', ' ', '\001', '(', '\013', '2', '\"', '.',
-'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'P', 'a', 't',
-'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\007', 'u', 'r', 'l', 'P', 'a', 't', 'h', '\022', 'D', '\n', '\010', 'm', 'e',
-'t', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h',
-'e', 'r', 'H', '\000', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '8', '\n', '\006', 'n', 'o', 't', '_', 'i', 'd', '\030',
-'\010', ' ', '\001', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c',
-'.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 'H', '\000', 'R', '\005', 'n', 'o', 't', 'I', 'd', '\032', 'm', '\n',
-'\003', 'S', 'e', 't', '\022', ';', '\n', '\003', 'i', 'd', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
-'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\003', 'i', 'd', 's', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'r', 'i', 'n', 'c',
-'i', 'p', 'a', 'l', '.', 'S', 'e', 't', '\032', '\227', '\001', '\n', '\r', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e',
-'d', '\022', 'K', '\n', '\016', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.',
-'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\r', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 'N',
-'a', 'm', 'e', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'A', 'u', 't', 'h', 'e', 'n', 't',
-'i', 'c', 'a', 't', 'e', 'd', 'J', '\004', '\010', '\001', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a',
-'l', 'B', '\021', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '9', '\n', '\"', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'b', 'a', 'c', '.', 'v', '3', 'B', '\t', 'R', 'b', 'a', 'c', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321',
-'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p',
+'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/',
+'v', '3', '/', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e',
+'/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'p', 'a', 't', 'h', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e',
+'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i',
+'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r',
+'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x',
+'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '/', 'c', 'h', 'e', 'c', 'k', 'e', 'd', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '%', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x', 'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a',
+'1', '/', 's', 'y', 'n', 't', 'a', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"',
+'\266', '\002', '\n', '\004', 'R', 'B', 'A', 'C', '\022', 'C', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2',
+'!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B',
+'A', 'C', '.', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 'a', 'c', 't', 'i',
+'o', 'n', '\022', 'D', '\n', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C', '.', 'P',
+'o', 'l', 'i', 'c', 'i', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', 'Y', '\n',
+'\r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001',
+'(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '2', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'o', 'l', 'i',
+'c', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', '&', '\n', '\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\t',
+'\n', '\005', 'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\010', '\n', '\004', 'D', 'E', 'N', 'Y', '\020', '\001', '\022', '\007', '\n', '\003', 'L', 'O',
+'G', '\020', '\002', ':', ' ', '\232', '\305', '\210', '\036', '\033', '\n', '\031', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'R', 'B', 'A', 'C', '\"', '\223', '\003', '\n', '\006', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'L',
+'\n', '\013', 'p', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's',
+'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\013', 'p', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n',
+'s', '\022', 'I', '\n', '\n', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\037', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c',
+'i', 'p', 'a', 'l', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\n', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
+'s', '\022', 'Z', '\n', '\t', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '.', 'E', 'x',
+'p', 'r', 'B', '\034', '\362', '\230', '\376', '\217', '\005', '\026', '\022', '\024', 'e', 'x', 'p', 'r', 'e', 's', 's', 'i', 'o', 'n', '_', 's', 'p',
+'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\t', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\022', 'p', '\n', '\021', 'c', 'h', 'e',
+'c', 'k', 'e', 'd', '_', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '%', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '.', 'C', 'h',
+'e', 'c', 'k', 'e', 'd', 'E', 'x', 'p', 'r', 'B', '\034', '\362', '\230', '\376', '\217', '\005', '\026', '\022', '\024', 'e', 'x', 'p', 'r', 'e', 's',
+'s', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\020', 'c', 'h', 'e', 'c', 'k', 'e', 'd', 'C', 'o',
+'n', 'd', 'i', 't', 'i', 'o', 'n', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\332', '\007', '\n', '\n', 'P', 'e',
+'r', 'm', 'i', 's', 's', 'i', 'o', 'n', '\022', 'C', '\n', '\t', 'a', 'n', 'd', '_', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\001',
+'(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3',
+'.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', '.', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'R', 'u', 'l',
+'e', 's', '\022', 'A', '\n', '\010', 'o', 'r', '_', 'r', 'u', 'l', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's',
+'s', 'i', 'o', 'n', '.', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\003', 'a', 'n',
+'y', '\030', '\003', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\003', 'a', 'n', 'y', '\022', '>',
+'\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h',
+'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', '?', '\n', '\010', 'u', 'r', 'l', '_', 'p', 'a', 't', 'h', '\030',
+'\n', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\007', 'u', 'r', 'l', 'P', 'a',
+'t', 'h', '\022', 'H', '\n', '\016', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'i', 'p', '\030', '\005', ' ', '\001', '(',
+'\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\r', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'I',
+'p', '\022', '6', '\n', '\020', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\006', ' ', '\001',
+'(', '\r', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '\377', '\377', '\003', 'H', '\000', 'R', '\017', 'd', 'e', 's', 't', 'i', 'n', 'a', 't',
+'i', 'o', 'n', 'P', 'o', 'r', 't', '\022', 'Q', '\n', '\026', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o',
+'r', 't', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\013', ' ', '\001', '(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '3', '2', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\024', 'd', 'e', 's', 't', 'i',
+'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r', 't', 'R', 'a', 'n', 'g', 'e', '\022', 'D', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a',
+'t', 'a', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000',
+'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '=', '\n', '\010', 'n', 'o', 't', '_', 'r', 'u', 'l', 'e', '\030', '\010', ' ',
+'\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v',
+'3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'H', '\000', 'R', '\007', 'n', 'o', 't', 'R', 'u', 'l', 'e', '\022', 'Z',
+'\n', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'e', 'd', '_', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\t',
+' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\023', 'r', 'e', 'q', 'u',
+'e', 's', 't', 'e', 'd', 'S', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'F', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '\030', '\014', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i',
+'g', 'H', '\000', 'R', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\032', 's', '\n', '\003', 'S', 'e', 't', '\022', '@', '\n', '\005', 'r', 'u',
+'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001',
+'\002', '\010', '\001', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n',
+'.', 'S', 'e', 't', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'B', '\013', '\n', '\004', 'r', 'u',
+'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\233', '\010', '\n', '\t', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '\022', '>', '\n', '\007',
+'a', 'n', 'd', '_', 'i', 'd', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'S', 'e', 't',
+'H', '\000', 'R', '\006', 'a', 'n', 'd', 'I', 'd', 's', '\022', '<', '\n', '\006', 'o', 'r', '_', 'i', 'd', 's', '\030', '\002', ' ', '\001', '(',
+'\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.',
+'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'S', 'e', 't', 'H', '\000', 'R', '\005', 'o', 'r', 'I', 'd', 's', '\022', '\033', '\n',
+'\003', 'a', 'n', 'y', '\030', '\003', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\003', 'a', 'n',
+'y', '\022', 'U', '\n', '\r', 'a', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2',
+'-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r',
+'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', 'H', '\000', 'R', '\r',
+'a', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', '\022', 'K', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i',
+'p', '\030', '\005', ' ', '\001', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003',
+'3', '.', '0', 'H', '\000', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', '\022', 'K', '\n', '\020', 'd', 'i', 'r', 'e', 'c', 't',
+'_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'H',
+'\000', 'R', '\016', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 'm', 'o', 't', 'e', 'I', 'p', '\022', '>', '\n', '\t', 'r', 'e', 'm', 'o',
+'t', 'e', '_', 'i', 'p', '\030', '\013', ' ', '\001', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\010', 'r', 'e',
+'m', 'o', 't', 'e', 'I', 'p', '\022', '>', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\006', ' ', '\001', '(', '\013', '2', '$', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a',
+'d', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', '?', '\n', '\010', 'u',
+'r', 'l', '_', 'p', 'a', 't', 'h', '\030', '\t', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H',
+'\000', 'R', '\007', 'u', 'r', 'l', 'P', 'a', 't', 'h', '\022', 'D', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ',
+'\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
+'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\010', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\022', '8', '\n', '\006', 'n', 'o', 't', '_', 'i', 'd', '\030', '\010', ' ', '\001', '(', '\013', '2', '\037', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c',
+'i', 'p', 'a', 'l', 'H', '\000', 'R', '\005', 'n', 'o', 't', 'I', 'd', '\032', 'm', '\n', '\003', 'S', 'e', 't', '\022', ';', '\n', '\003', 'i',
+'d', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r',
+'b', 'a', 'c', '.', 'v', '3', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010',
+'\001', 'R', '\003', 'i', 'd', 's', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'S', 'e', 't', '\032',
+'\227', '\001', '\n', '\r', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', '\022', 'K', '\n', '\016', 'p', 'r', 'i', 'n',
+'c', 'i', 'p', 'a', 'l', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'R', '\r', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 'N', 'a', 'm', 'e', ':', '3', '\232', '\305', '\210', '\036',
+'.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P',
+'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', '.', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'e', 'd', 'J', '\004', '\010',
+'\001', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'P', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 'B', '\021', '\n', '\n', 'i', 'd', 'e', 'n',
+'t', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '}', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', 'B',
+'\t', 'R', 'b', 'a', 'c', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/',
+'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a',
+'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'b', 'a', 'c', '/', 'v', '3', ';', 'r',
+'b', 'a', 'c', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[12] = {
+static _upb_DefPool_Init *deps[15] = {
&envoy_config_core_v3_address_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_route_v3_route_components_proto_upbdefinit,
&envoy_type_matcher_v3_metadata_proto_upbdefinit,
&envoy_type_matcher_v3_path_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
+ &envoy_type_v3_range_proto_upbdefinit,
&google_api_expr_v1alpha1_checked_proto_upbdefinit,
&google_api_expr_v1alpha1_syntax_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -182,9 +182,9 @@ static upb_def_init *deps[12] = {
NULL
};
-upb_def_init envoy_config_rbac_v3_rbac_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_rbac_v3_rbac_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_rbac_v3_rbac_proto_upb_file_layout,
"envoy/config/rbac/v3/rbac.proto",
- UPB_STRVIEW_INIT(descriptor, 3112)
+ UPB_STRINGVIEW_INIT(descriptor, 3446)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h
index 47efd41e..12c81ea6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h
@@ -19,46 +19,46 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_rbac_v3_rbac_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_rbac_v3_rbac_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_RBAC_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.RBAC");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_RBAC_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.RBAC");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_RBAC_PoliciesEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.RBAC.PoliciesEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_RBAC_PoliciesEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.RBAC.PoliciesEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Policy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Policy");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Policy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Policy");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Permission_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Permission");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Permission_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Permission");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Permission_Set_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Permission.Set");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Permission_Set_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Permission.Set");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Principal_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Principal");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Principal_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Principal");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Principal_Set_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Principal.Set");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Principal_Set_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Principal.Set");
}
-UPB_INLINE const upb_msgdef *envoy_config_rbac_v3_Principal_Authenticated_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.rbac.v3.Principal.Authenticated");
+UPB_INLINE const upb_MessageDef *envoy_config_rbac_v3_Principal_Authenticated_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.rbac.v3.Principal.Authenticated");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
index 8e6490aa..da50a893 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
@@ -8,83 +8,97 @@
#include "upb/def.h"
#include "envoy/config/route/v3/route.upbdefs.h"
+#include "envoy/config/route/v3/route.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_Vhds_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_route_v3_RouteConfiguration_msginit,
- &envoy_config_route_v3_Vhds_msginit,
-};
-
-static const char descriptor[1389] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1851] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c',
'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r',
-'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o',
-'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p',
-'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a',
-'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\"', '\202', '\007', '\n', '\022', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'v',
-'i', 'r', 't', 'u', 'a', 'l', '_', 'h', 'o', 's', 't', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l',
-'H', 'o', 's', 't', 'R', '\014', 'v', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 's', '\022', '/', '\n', '\004', 'v', 'h', 'd',
-'s', '\030', '\t', ' ', '\001', '(', '\013', '2', '\033', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
-'u', 't', 'e', '.', 'v', '3', '.', 'V', 'h', 'd', 's', 'R', '\004', 'v', 'h', 'd', 's', '\022', 'D', '\n', '\025', 'i', 'n', 't', 'e',
-'r', 'n', 'a', 'l', '_', 'o', 'n', 'l', 'y', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\020',
-'\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\023', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', 'O', 'n', 'l', 'y', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r',
-'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r',
-'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e',
-'s', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030',
-'\005', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027',
-'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'g',
-'\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030',
-'\006', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B',
-'\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o',
-'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o',
-'_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\010', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006',
-'\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R',
-'e', 'm', 'o', 'v', 'e', '\022', 'L', '\n', '#', 'm', 'o', 's', 't', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'c', '_', 'h', 'e',
-'a', 'd', 'e', 'r', '_', 'm', 'u', 't', 'a', 't', 'i', 'o', 'n', 's', '_', 'w', 'i', 'n', 's', '\030', '\n', ' ', '\001', '(', '\010',
-'R', '\037', 'm', 'o', 's', 't', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'c', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'u', 't', 'a', 't',
-'i', 'o', 'n', 's', 'W', 'i', 'n', 's', '\022', 'G', '\n', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '_', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'C', 'l',
-'u', 's', 't', 'e', 'r', 's', '\022', 'i', '\n', '#', 'm', 'a', 'x', '_', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p',
-'o', 'n', 's', 'e', '_', 'b', 'o', 'd', 'y', '_', 's', 'i', 'z', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\013', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'R', '\036', 'm', 'a', 'x', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e',
-'B', 'o', 'd', 'y', 'S', 'i', 'z', 'e', 'B', 'y', 't', 'e', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\"', 's', '\n', '\004', 'V', 'h', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u',
-'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', '\030', '\232', '\305', '\210', '\036',
-'\023', '\n', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'V', 'h', 'd', 's', 'B', ';', '\n', '#', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\n', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e',
+'_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
+'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
+'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\335', '\010', '\n', '\022', 'R', 'o', 'u', 't', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'h', 'o', 's', 't', 's',
+'\030', '\002', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 'R', '\014', 'v', 'i', 'r', 't', 'u', 'a',
+'l', 'H', 'o', 's', 't', 's', '\022', '/', '\n', '\004', 'v', 'h', 'd', 's', '\030', '\t', ' ', '\001', '(', '\013', '2', '\033', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'h', 'd', 's', 'R',
+'\004', 'v', 'h', 'd', 's', '\022', 'D', '\n', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'o', 'n', 'l', 'y', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\023', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'O', 'n', 'l', 'y', 'H', 'e', 'a', 'd', 'e', 'r', 's',
+'\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a',
+'d', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B',
+'\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e',
+'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e',
+'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\005', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001',
+'\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd',
+'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\006', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
+'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q',
+'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e',
+'s', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\010', ' ', '\003', '(',
+'\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u',
+'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'L', '\n', '#', 'm', 'o', 's',
+'t', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'c', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'u', 't', 'a', 't', 'i', 'o',
+'n', 's', '_', 'w', 'i', 'n', 's', '\030', '\n', ' ', '\001', '(', '\010', 'R', '\037', 'm', 'o', 's', 't', 'S', 'p', 'e', 'c', 'i', 'f',
+'i', 'c', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'u', 't', 'a', 't', 'i', 'o', 'n', 's', 'W', 'i', 'n', 's', '\022', 'G', '\n', '\021',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u',
+'e', 'R', '\020', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'i', '\n', '#', 'm', 'a',
+'x', '_', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'b', 'o', 'd', 'y', '_', 's', 'i',
+'z', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\013', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\036', 'm', 'a', 'x', 'D',
+'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'B', 'o', 'd', 'y', 'S', 'i', 'z', 'e', 'B', 'y', 't', 'e',
+'s', '\022', 'i', '\n', '\031', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '_', 'p', 'l',
+'u', 'g', 'i', 'n', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i',
+'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', 'R', '\027', 'c', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
+'r', 'P', 'l', 'u', 'g', 'i', 'n', 's', '\022', 'n', '\n', '\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r', 'o',
+'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i',
+'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\025', 'r',
+'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', ':', '&', '\232', '\305', '\210',
+'\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\"', '\203', '\001', '\n', '\026', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e',
+'c', 'i', 'f', 'i', 'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', '\022', 'H', '\n', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a',
+'l', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\"', 's', '\n', '\004', 'V', 'h',
+'d', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013',
+'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o',
+'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', '\030', '\232', '\305', '\210', '\036', '\023', '\n', '\021', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'V', 'h', 'd', 's', 'B', '\201', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', 'B', '\n', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c',
+'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-',
+'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/',
+'v', '3', ';', 'r', 'o', 'u', 't', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[9] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_route_v3_route_components_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -93,9 +107,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_config_route_v3_route_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_route_v3_route_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_route_proto_upb_file_layout,
"envoy/config/route/v3/route.proto",
- UPB_STRVIEW_INIT(descriptor, 1389)
+ UPB_STRINGVIEW_INIT(descriptor, 1851)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
index 30b5dd5e..7b5c39a6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
@@ -19,16 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_route_v3_route_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteConfiguration_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteConfiguration");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteConfiguration_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteConfiguration");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_Vhds_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Vhds");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_ClusterSpecifierPlugin_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.ClusterSpecifierPlugin");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Vhds_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.Vhds");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
index b9e23161..e805fbf5 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
@@ -8,717 +8,656 @@
#include "upb/def.h"
#include "envoy/config/route/v3/route_components.upbdefs.h"
+#include "envoy/config/route/v3/route_components.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_proxy_protocol_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit;
-extern upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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_Action_MetaData_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;
-extern const upb_msglayout envoy_config_route_v3_FilterConfig_msginit;
-
-static const upb_msglayout *layouts[52] = {
- &envoy_config_route_v3_VirtualHost_msginit,
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_FilterAction_msginit,
- &envoy_config_route_v3_Route_msginit,
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_WeightedCluster_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_RouteMatch_msginit,
- &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_RouteAction_msginit,
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
- &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_RedirectAction_msginit,
- &envoy_config_route_v3_DirectResponseAction_msginit,
- &envoy_config_route_v3_Decorator_msginit,
- &envoy_config_route_v3_Tracing_msginit,
- &envoy_config_route_v3_VirtualCluster_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RateLimit_Action_msginit,
- &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
- &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
- &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
- &envoy_config_route_v3_RateLimit_Action_MetaData_msginit,
- &envoy_config_route_v3_RateLimit_Override_msginit,
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_QueryParameterMatcher_msginit,
- &envoy_config_route_v3_InternalRedirectPolicy_msginit,
- &envoy_config_route_v3_FilterConfig_msginit,
-};
-
-static const char descriptor[19463] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_proxy_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_regex_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_metadata_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_type_matcher_v3_matcher_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[20791] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n',
'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o',
'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o',
't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c',
-'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
-'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p',
-'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't',
-'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p',
-'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/',
-'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036',
-'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
-'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\324', '\014', '\n', '\013', 'V', 'i', 'r', 't', 'u',
-'a', 'l', 'H', 'o', 's', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ',', '\n', '\007', 'd', 'o', 'm', 'a', 'i', 'n', 's', '\030', '\002', ' ', '\003',
-'(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\010', '\001', '\"', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\007', 'd',
-'o', 'm', 'a', 'i', 'n', 's', '\022', '4', '\n', '\006', 'r', 'o', 'u', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\034', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u',
-'t', 'e', 'R', '\006', 'r', 'o', 'u', 't', 'e', 's', '\022', '`', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 't', 'l', 's',
-'\030', '\004', ' ', '\001', '(', '\016', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '.', 'T', 'l', 's', 'R', 'e', 'q', 'u',
-'i', 'r', 'e', 'm', 'e', 'n', 't', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 'r', 'e',
-'q', 'u', 'i', 'r', 'e', 'T', 'l', 's', '\022', 'P', '\n', '\020', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'c', 'l', 'u', 's', 't',
-'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\017',
-'v', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l',
-'i', 'm', 'i', 't', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't',
-'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\007', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O',
-'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't',
-'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h',
-'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\r', ' ', '\003', '(', '\t', 'B', '\022', '\372',
-'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's',
-'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o',
-'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2',
-'\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e',
-'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350',
-'\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O',
-'\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm',
-'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
-'\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e',
-'m', 'o', 'v', 'e', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l',
-'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 's', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i',
-'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\017', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H',
-'o', 's', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E',
-'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', 'A', '\n', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'a', 't', 't', 'e',
-'m', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '\030', '\016', ' ', '\001', '(', '\010', 'R', '\032', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'R',
-'e', 'q', 'u', 'e', 's', 't', 'A', 't', 't', 'e', 'm', 'p', 't', 'C', 'o', 'u', 'n', 't', '\022', 'H', '\n', '!', 'i', 'n', 'c',
-'l', 'u', 'd', 'e', '_', 'a', 't', 't', 'e', 'm', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '_', 'i', 'n', '_', 'r', 'e', 's',
-'p', 'o', 'n', 's', 'e', '\030', '\023', ' ', '\001', '(', '\010', 'R', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'A', 't', 't', 'e', 'm',
-'p', 't', 'C', 'o', 'u', 'n', 't', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'E', '\n', '\014', 'r', 'e', 't', 'r',
-'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\020', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y',
-'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o',
-'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', '\024',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e', 't',
-'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'h', 'e',
-'d', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\021', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i',
-'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e',
-'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030',
-'\022', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f',
-'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r',
-'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v',
-'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', ':', '\n', '\022', 'T', 'l', 's', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'm', 'e', 'n',
-'t', 'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\021', '\n', '\r', 'E', 'X', 'T', 'E', 'R', 'N',
-'A', 'L', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\007', '\n', '\003', 'A', 'L', 'L', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ',
-'\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't',
-'u', 'a', 'l', 'H', 'o', 's', 't', 'J', '\004', '\010', '\t', '\020', '\n', 'J', '\004', '\010', '\014', '\020', '\r', 'R', '\021', 'p', 'e', 'r', '_',
-'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'd', '\n', '\014', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c',
-'t', 'i', 'o', 'n', '\022', ',', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n',
-':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\254', '\n', '\n', '\005', 'R', 'o', 'u', 't', 'e',
-'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\016', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\005', 'm',
-'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\010', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\005', 'm', 'a', 't', 'c', 'h', '\022', ':', '\n', '\005', 'r', 'o', 'u', 't', 'e', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\005', 'r', 'o', 'u', 't', 'e', '\022', 'C', '\n',
-'\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
-'t', 'i', 'o', 'n', 'H', '\000', 'R', '\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', 'V', '\n', '\017', 'd', 'i', 'r', 'e', 'c',
-'t', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\016', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p',
-'o', 'n', 's', 'e', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't', 'e', 'r', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'A',
-'c', 't', 'i', 'o', 'n', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't',
-'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '>', '\n', '\t', 'd', 'e', 'c', 'o', 'r', 'a',
-'t', 'o', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', 'R', '\t', 'd', 'e', 'c', 'o', 'r',
-'a', 't', 'o', 'r', '\022', 'm', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e',
-'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd',
-'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\t', ' ', '\003', '(', '\013', '2', '\'', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R',
-'\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r',
-'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030',
-'\014', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000',
-'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022',
-'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd',
-'d', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t',
-'\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r',
-'s', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014',
-'\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a',
-'d', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '8', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030', '\017',
-' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '`', '\n', '\036', 'p',
-'e', 'r', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b',
-'y', 't', 'e', 's', '\030', '\020', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e',
-'s', 't', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\032', ']', '\n', '\031', 'T', 'y', 'p',
-'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n',
-'\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A',
-'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '\037', '\232', '\305', '\210', '\036', '\032', '\n', '\030', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'B', '\r', '\n', '\006',
-'a', 'c', 't', 'i', 'o', 'n', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021',
-'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\353', '\010', '\n', '\017', 'W', 'e', 'i',
-'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Z', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030',
-'\001', ' ', '\003', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 's', '\022', 'H', '\n', '\014', 't', 'o', 't', 'a', 'l', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\013', 't', 'o', 't', 'a', 'l', 'W', 'e', 'i',
-'g', 'h', 't', '\022', ',', '\n', '\022', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'e', 'f', 'i', 'x',
-'\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', 'P', 'r', 'e', 'f', 'i', 'x', '\032',
-'\330', '\006', '\n', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e',
-'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '4', '\n', '\006',
-'w', 'e', 'i', 'g', 'h', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\006', 'w', 'e', 'i', 'g', 'h', 't',
-'\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2',
-'\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022', 'g', '\n', '\026',
-'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\004', ' ',
-'\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222',
-'\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd',
-'d', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r',
-'e', 'm', 'o', 'v', 'e', '\030', '\t', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001',
-'\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm',
-'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't',
-'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
+'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g', 'e', 'x',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/',
+'t', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n',
+'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r',
+'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'x', 'd', 's', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '!', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's',
+'t', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\206', '\016', '\n',
+'\013', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ',', '\n', '\007', 'd', 'o', 'm', 'a', 'i',
+'n', 's', '\030', '\002', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\010', '\001', '\"', '\010', 'r', '\006', '\300', '\001', '\002',
+'\310', '\001', '\000', 'R', '\007', 'd', 'o', 'm', 'a', 'i', 'n', 's', '\022', '4', '\n', '\006', 'r', 'o', 'u', 't', 'e', 's', '\030', '\003', ' ',
+'\003', '(', '\013', '2', '\034', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'R', '\006', 'r', 'o', 'u', 't', 'e', 's', '\022', '@', '\n', '\007', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '\030', '\025', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'R', '\007',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '\022', '`', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 't', 'l', 's', '\030', '\004', ' ',
+'\001', '(', '\016', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '.', 'T', 'l', 's', 'R', 'e', 'q', 'u', 'i', 'r', 'e',
+'m', 'e', 'n', 't', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 'r', 'e', 'q', 'u', 'i',
+'r', 'e', 'T', 'l', 's', '\022', 'P', '\n', '\020', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', 's',
+'\030', '\005', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\017', 'v', 'i', 'r',
+'t', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i',
+'t', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r',
+'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i',
+'m', 'i', 't', 's', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't',
+'o', '_', 'a', 'd', 'd', '\030', '\007', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i',
-'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e',
-'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e',
-'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\006', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B',
-'\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H',
-'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '\205', '\001', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_',
-'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\n', ' ', '\003', '(', '\013', '2', 'N',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e',
-'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g',
-'h', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n',
-'t', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g',
+'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a',
+'d', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd',
+'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\r', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222',
+'\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e',
+'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e',
+'_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e',
+'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024',
+'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r',
+'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e',
+'\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001',
+'\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v',
+'e', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y',
+'R', '\004', 'c', 'o', 'r', 's', '\022', 's', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e',
+'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\017', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't',
+'.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r',
+'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A',
+'\n', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'a', 't', 't', 'e', 'm', 'p', 't',
+'_', 'c', 'o', 'u', 'n', 't', '\030', '\016', ' ', '\001', '(', '\010', 'R', '\032', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'R', 'e', 'q', 'u',
+'e', 's', 't', 'A', 't', 't', 'e', 'm', 'p', 't', 'C', 'o', 'u', 'n', 't', '\022', 'H', '\n', '!', 'i', 'n', 'c', 'l', 'u', 'd',
+'e', '_', 'a', 't', 't', 'e', 'm', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o', 'n',
+'s', 'e', '\030', '\023', ' ', '\001', '(', '\010', 'R', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'A', 't', 't', 'e', 'm', 'p', 't', 'C',
+'o', 'u', 'n', 't', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'E', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p',
+'o', 'l', 'i', 'c', 'y', '\030', '\020', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r',
+'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c',
+'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e', 't', 'r', 'y', 'P',
+'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e',
+'_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\021', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R',
+'\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e', 'q', 'u', 'e',
+'s', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\022', ' ', '\001',
+'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
+'3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f', 'f', 'e', 'r',
+'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', 'n', '\n', '\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r',
+'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\026', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
+'t', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R',
+'\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', ']', '\n',
+'\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r',
+'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a',
+'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', ':', '\n', '\022', 'T', 'l', 's', 'R',
+'e', 'q', 'u', 'i', 'r', 'e', 'm', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022',
+'\021', '\n', '\r', 'E', 'X', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\007', '\n', '\003', 'A', 'L', 'L',
+'\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
+'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 'J', '\004', '\010', '\t', '\020', '\n', 'J', '\004', '\010',
+'\014', '\020', '\r', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'd', '\n',
+'\014', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\022', ',', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n',
+'y', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\"',
+'\216', '\013', '\n', '\005', 'R', 'o', 'u', 't', 'e', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\016', ' ', '\001', '(', '\t', 'R', '\004',
+'n', 'a', 'm', 'e', '\022', 'A', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M',
+'a', 't', 'c', 'h', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'm', 'a', 't', 'c', 'h', '\022', ':', '\n', '\005',
+'r', 'o', 'u', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R',
+'\005', 'r', 'o', 'u', 't', 'e', '\022', 'C', '\n', '\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
+'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't',
+'\022', 'V', '\n', '\017', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\007', ' ', '\001', '(', '\013',
+'2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
+'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\016', 'd',
+'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't', 'e', 'r', '_', 'a',
+'c', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000',
+'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\022', '`', '\n', '\025', 'n', 'o', 'n', '_', 'f', 'o', 'r',
+'w', 'a', 'r', 'd', 'i', 'n', 'g', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\022', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'N', 'o', 'n', 'F', 'o',
+'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\023', 'n', 'o', 'n', 'F', 'o', 'r', 'w',
+'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030',
+'\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '>', '\n',
+'\t', 'd', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r',
+'R', '\t', 'd', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\022', 'm', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_',
+'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', '.',
+'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y',
+'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'g', '\n',
+'\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\t',
+' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006',
+'\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A',
+'d', 'd', '\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_',
+'r', 'e', 'm', 'o', 'v', 'e', '\030', '\014', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020',
+'\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o',
+'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
+'s', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O',
+'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's',
+'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e',
+'_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B',
+'\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p',
+'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '8', '\n', '\007', 't', 'r',
+'a', 'c', 'i', 'n', 'g', '\030', '\017', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't', 'r', 'a', 'c', 'i',
+'n', 'g', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_',
+'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\020', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p',
+'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's',
'\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E',
'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n',
'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '7', '\232', '\305', '\210',
-'\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e',
-'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g',
-'h', 't', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e',
-'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e',
-'r', '\"', '\313', '\010', '\n', '\n', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '\022', '\030', '\n', '\006', 'p', 'r', 'e', 'f', 'i',
-'x', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\024', '\n', '\004', 'p', 'a', 't', 'h',
-'\030', '\002', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'N', '\n', '\n', 's', 'a', 'f', 'e', '_', 'r', 'e',
-'g', 'e', 'x', '\030', '\n', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', '\022', '[', '\n', '\017', 'c', 'o',
-'n', 'n', 'e', 'c', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\014', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M',
-'a', 't', 'c', 'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\016', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'A', '\n', '\016', 'c', 'a', 's', 'e', '_', 's', 'e', 'n', 's',
-'i', 't', 'i', 'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'c', 'a', 's', 'e', 'S', 'e', 'n', 's', 'i',
-'t', 'i', 'v', 'e', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\030',
-'\t', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c',
-'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022', '>', '\n', '\007', 'h',
-'e', 'a', 'd', 'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
-'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'W', '\n', '\020', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e',
-'t', 'e', 'r', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'M',
-'a', 't', 'c', 'h', 'e', 'r', 'R', '\017', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', 'K',
-'\n', '\004', 'g', 'r', 'p', 'c', '\030', '\010', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'G', 'r',
-'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\004', 'g', 'r', 'p', 'c',
-'\022', 'Y', '\n', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\013', ' ', '\001', '(', '\013', '2', '8', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't',
-'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't',
-'i', 'o', 'n', 's', 'R', '\n', 't', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\032', 'S', '\n', '\025', 'G', 'r', 'p', 'c', 'R',
-'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M',
-'a', 't', 'c', 'h', '.', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '\032', '\311', '\001', '\n', '\026', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i',
-'o', 'n', 's', '\022', '8', '\n', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\022', '8', '\n', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', ':', ';', '\232', '\305', '\210', '\036',
-'6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u',
-'t', 'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\032', '\020', '\n', '\016', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '$',
-'\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\025', '\n', '\016', 'p', 'a', 't', 'h', '_', 's', 'p', 'e', 'c', 'i',
-'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\005', 'r', 'e',
-'g', 'e', 'x', '\"', '\350', '\004', '\n', '\n', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '_', '\n', '\031', 'a', 'l', 'l',
-'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\013', ' ',
-'\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\026', 'a', 'l', 'l', 'o', 'w', 'O', 'r',
-'i', 'g', 'i', 'n', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_',
-'m', 'e', 't', 'h', 'o', 'd', 's', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'h', 'o',
-'d', 's', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\t',
-'R', '\014', 'a', 'l', 'l', 'o', 'w', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '%', '\n', '\016', 'e', 'x', 'p', 'o', 's', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'e', 'x', 'p', 'o', 's', 'e', 'H', 'e', 'a', 'd',
-'e', 'r', 's', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'a', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\006', 'm', 'a', 'x',
-'A', 'g', 'e', '\022', 'G', '\n', '\021', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's', '\030',
-'\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l', 'o', 'w', 'C', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l',
-'s', '\022', 'W', '\n', '\016', 'f', 'i', 'l', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\t', ' ', '\001', '(', '\013',
-'2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'H', '\000',
-'R', '\r', 'f', 'i', 'l', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'U', '\n', '\016', 's', 'h', 'a', 'd', 'o', 'w',
-'_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\n', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't',
-'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\r', 's', 'h', 'a', 'd', 'o', 'w', 'E', 'n', 'a', 'b', 'l',
-'e', 'd', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
-'o', 'u', 't', 'e', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\023', '\n', '\021', 'e', 'n', 'a', 'b', 'l', 'e',
-'d', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004',
-'\010', '\007', '\020', '\010', 'R', '\014', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', 'R', '\022', 'a', 'l', 'l', 'o', 'w',
-'_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 'r', 'e', 'g', 'e', 'x', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\"', '\310', '&',
-'\n', '\013', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022', '#', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030',
-'\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'\022', '6', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'B',
-'\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'H', '\000', 'R', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'H', 'e', 'a', 'd', 'e', 'r', '\022', 'U', '\n', '\021', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'c', 'l', 'u', 's', 't', 'e',
-'r', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r',
-'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H', '\000',
-'R', '\020', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', '\216', '\001', '\n', '\037', 'c', 'l',
-'u', 's', 't', 'e', 'r', '_', 'n', 'o', 't', '_', 'f', 'o', 'u', 'n', 'd', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_',
-'c', 'o', 'd', 'e', '\030', '\024', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 'B',
-'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\033', 'c', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n',
-'d', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i',
-'t', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\r', 'p', 'r',
-'e', 'f', 'i', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r',
-'i', 't', 'e', '\030', ' ', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b',
-'s', 't', 'i', 't', 'u', 't', 'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '?', '\n', '\024',
-'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\030', '\006', ' ', '\001', '(',
-'\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w',
-'r', 'i', 't', 'e', 'L', 'i', 't', 'e', 'r', 'a', 'l', '\022', 'H', '\n', '\021', 'a', 'u', 't', 'o', '_', 'h', 'o', 's', 't', '_',
-'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'H', '\001', 'R', '\017', 'a', 'u', 't', 'o', 'H',
-'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '=', '\n', '\023', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't',
-'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\035', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310',
-'\001', '\000', 'H', '\001', 'R', '\021', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'g',
-'\n', '\027', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'e', 'g', 'e', 'x',
-'\030', '#', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
-'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i',
-'t', 'u', 't', 'e', 'H', '\001', 'R', '\024', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'P', 'a', 't', 'h', 'R', 'e',
-'g', 'e', 'x', '\022', '3', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\007', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'E', '\n', '\014', 'r', 'e', 't',
-'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\t', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
-'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p',
-'o', 'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '!', ' ', '\001', '(', '\013', '2',
-'\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e',
-'t', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'r',
-'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\036', ' ',
-'\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r',
-'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P',
-'o', 'l', 'i', 'c', 'i', 'e', 's', '\022', 'K', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\013', ' ', '\001', '(', '\016',
-'2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
-'\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 's', '\030',
-'\r', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
-'s', '\022', 'S', '\n', '\026', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'v', 'h', '_', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i',
-'t', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\023', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'V',
-'h', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'N', '\n', '\013', 'h', 'a', 's', 'h', '_', 'p', 'o', 'l', 'i', 'c',
-'y', '\030', '\017', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
-'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o',
-'l', 'i', 'c', 'y', 'R', '\n', 'h', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030',
-'\021', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 'G', '\n', '\020',
-'m', 'a', 'x', '_', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\027', ' ', '\001', '(', '\013', '2', '\031', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B',
-'\002', '\030', '\001', 'R', '\016', 'm', 'a', 'x', 'G', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\023', 'g', 'r',
-'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'o', 'f', 'f', 's', 'e', 't', '\030', '\034', ' ', '\001', '(', '\013', '2', '\031',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'B', '\002', '\030', '\001', 'R', '\021', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'O', 'f', 'f', 's', 'e', 't', '\022', 'Y',
-'\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', '0',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '\037', '\232', '\305', '\210',
+'\036', '\032', '\n', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o',
+'u', 't', 'e', 'B', '\r', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\006', '\020', '\007', 'J',
+'\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"',
+'\342', '\n', '\n', '\017', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Z', '\n', '\010', 'c', 'l',
+'u', 's', 't', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't',
+'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010',
+'\001', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'H', '\n', '\014', 't', 'o', 't', 'a', 'l', '_', 'w', 'e', 'i', 'g',
+'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\013', 't',
+'o', 't', 'a', 'l', 'W', 'e', 'i', 'g', 'h', 't', '\022', ',', '\n', '\022', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y',
+'_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y',
+'P', 'r', 'e', 'f', 'i', 'x', '\022', '!', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\004', ' ', '\001',
+'(', '\t', 'H', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\032', '\222', '\010', '\n', '\r', 'C', 'l', 'u', 's',
+'t', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', '\022', '-', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\031',
+'\362', '\230', '\376', '\217', '\005', '\023', '\022', '\021', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'R', '\004', 'n', 'a', 'm', 'e', '\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030',
+'\014', ' ', '\001', '(', '\t', 'B', '$', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', '\362', '\230', '\376', '\217', '\005', '\023', '\022',
+'\021', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\r', 'c', 'l', 'u', 's', 't',
+'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '4', '\n', '\006', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'R', '\006', 'w', 'e', 'i', 'g', 'h', 't', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_',
+'m', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd',
+'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e',
+'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
+'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's',
+'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_',
+'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\t', ' ', '\003', '(', '\t', 'B', '\020',
+'\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't',
+'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n',
+'s', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a',
+'d', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007',
+'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n',
+'\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o',
+'v', 'e', '\030', '\006', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001',
+'\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v',
+'e', '\022', '\205', '\001', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o',
+'n', 'f', 'i', 'g', '\030', '\n', ' ', '\003', '(', '\013', '2', 'N', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i',
+'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r',
+'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\024', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r',
+'i', 't', 'e', '_', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\030', '\013', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300',
+'\001', '\002', '\310', '\001', '\000', 'H', '\000', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'L', 'i', 't', 'e', 'r',
+'a', 'l', '\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
+'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022',
+'*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '7', '\232',
+'\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
+'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e',
+'i', 'g', 'h', 't', 'B', '\030', '\n', '\026', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c',
+'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i',
+'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u',
+'s', 't', 'e', 'r', 'B', '\030', '\n', '\026', 'r', 'a', 'n', 'd', 'o', 'm', '_', 'v', 'a', 'l', 'u', 'e', '_', 's', 'p', 'e', 'c',
+'i', 'f', 'i', 'e', 'r', '\"', '\236', '\t', '\n', '\n', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '\022', '\030', '\n', '\006', 'p',
+'r', 'e', 'f', 'i', 'x', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\024', '\n', '\004',
+'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'N', '\n', '\n', 's', 'a', 'f',
+'e', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\n', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', '\022', '[',
+'\n', '\017', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\014', ' ', '\001', '(', '\013', '2', '0',
'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
-'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016',
-'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', 'g', '\n', '\030', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\"', ' ', '\001', '(', '\013', '2', '-',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'I', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\026', 'i', 'n', 't',
-'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'w', '\n', '\030', 'i', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\032', ' ',
-'\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e',
-'d', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\002', '\030', '\001', 'R', '\026', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'V', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\030', '\037', ' ', '\001', '(', '\013', '2', '\034', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
-'u', 'e', 'B', '\002', '\030', '\001', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e',
-'c', 't', 's', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\033', ' ', '\001', '(', '\013',
-'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022',
-'d', '\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '$', ' ',
-'\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D',
-'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', '\032', '\242', '\002', '\n', '\023', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '!', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a',
-'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n',
-'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o',
-'n', '\022', '?', '\n', '\r', 't', 'r', 'a', 'c', 'e', '_', 's', 'a', 'm', 'p', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2',
-'\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l',
-'u', 'e', 'R', '\014', 't', 'r', 'a', 'c', 'e', 'S', 'a', 'm', 'p', 'l', 'e', 'd', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y',
-'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\032', '\226', '\n', '\n', '\n', 'H',
-'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'N', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e',
-'a', 'd', 'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', 'N', '\n', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i',
-'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', 'H', '\000', 'R', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\022', 'y', '\n', '\025', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013',
-'2', 'B', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 'H', '\000', 'R', '\024', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', 'g', '\n', '\017', 'q', 'u', 'e', 'r',
-'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't',
-'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm',
-'e', 't', 'e', 'r', 'H', '\000', 'R', '\016', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '^', '\n',
-'\014', 'f', 'i', 'l', 't', 'e', 'r', '_', 's', 't', 'a', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't',
-'a', 't', 'e', 'H', '\000', 'R', '\013', 'f', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\032', '\n', '\010', 't', 'e', 'r',
-'m', 'i', 'n', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\010', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l', '\032', '\306', '\001', '\n',
-'\006', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
-'\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e',
-'r', 'N', 'a', 'm', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\002', ' ',
+'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000',
+'R', '\016', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'A', '\n', '\016', 'c', 'a', 's', 'e', '_',
+'s', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'c', 'a', 's', 'e', 'S',
+'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't',
+'i', 'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022',
+'>', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'W', '\n', '\020', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a',
+'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e',
+'t', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\017', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
+'r', 's', '\022', 'K', '\n', '\004', 'g', 'r', 'p', 'c', '\030', '\010', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c',
+'h', '.', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\004',
+'g', 'r', 'p', 'c', '\022', 'Y', '\n', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\013', ' ', '\001', '(', '\013',
+'2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
+'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c',
+'h', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\n', 't', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'Q', '\n', '\020', 'd',
+'y', 'n', 'a', 'm', 'i', 'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\r', ' ', '\003', '(', '\013', '2', '&', '.', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a',
+'d', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd',
+'a', 't', 'a', '\032', 'S', '\n', '\025', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i',
+'o', 'n', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't',
+'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', '\032', '\311', '\001', '\n', '\026', 'T', 'l', 's', 'C', 'o', 'n', 't',
+'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '8', '\n', '\t', 'p', 'r', 'e', 's', 'e', 'n',
+'t', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\022', '8',
+'\n', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', 'd', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o',
+'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', '\032', '\020', '\n', '\016', 'C', 'o', 'n', 'n',
+'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\025',
+'\n', '\016', 'p', 'a', 't', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\005',
+'\020', '\006', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\"', '\350', '\004', '\n', '\n', 'C', 'o', 'r', 's', 'P',
+'o', 'l', 'i', 'c', 'y', '\022', '_', '\n', '\031', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 's', 't', 'r',
+'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\013', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'R', '\026', 'a', 'l', 'l', 'o', 'w', 'O', 'r', 'i', 'g', 'i', 'n', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't',
+'c', 'h', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'm', 'e', 't', 'h', 'o', 'd', 's', '\030', '\002', ' ', '\001', '(', '\t',
+'R', '\014', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'h', 'o', 'd', 's', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'a', 'l', 'l', 'o', 'w', 'H', 'e', 'a', 'd', 'e', 'r',
+'s', '\022', '%', '\n', '\016', 'e', 'x', 'p', 'o', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\001', '(', '\t',
+'R', '\r', 'e', 'x', 'p', 'o', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'a', 'g',
+'e', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\006', 'm', 'a', 'x', 'A', 'g', 'e', '\022', 'G', '\n', '\021', 'a', 'l', 'l', 'o', 'w', '_',
+'c', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l',
+'o', 'w', 'C', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's', '\022', 'W', '\n', '\016', 'f', 'i', 'l', 't', 'e', 'r', '_', 'e',
+'n', 'a', 'b', 'l', 'e', 'd', '\030', '\t', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o',
+'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'H', '\000', 'R', '\r', 'f', 'i', 'l', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l',
+'e', 'd', '\022', 'U', '\n', '\016', 's', 'h', 'a', 'd', 'o', 'w', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\n', ' ', '\001', '(',
+'\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R',
+'\r', 's', 'h', 'a', 'd', 'o', 'w', 'E', 'n', 'a', 'b', 'l', 'e', 'd', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i',
+'c', 'y', 'B', '\023', '\n', '\021', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004',
+'\010', '\001', '\020', '\002', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 'a', 'l', 'l', 'o', 'w', '_', 'o',
+'r', 'i', 'g', 'i', 'n', 'R', '\022', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 'r', 'e', 'g', 'e', 'x',
+'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\"', '\351', '\'', '\n', '\013', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n',
+'\022', '#', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
+'\001', 'H', '\000', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', '6', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h',
+'e', 'a', 'd', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001',
+'\000', 'H', '\000', 'R', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'U', '\n', '\021', 'w', 'e', 'i',
+'g', 'h', 't', 'e', 'd', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h',
+'t', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H', '\000', 'R', '\020', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u',
+'s', 't', 'e', 'r', 's', '\022', ':', '\n', '\030', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
+'r', '_', 'p', 'l', 'u', 'g', 'i', 'n', '\030', '%', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\026', 'c', 'l', 'u', 's', 't', 'e', 'r',
+'S', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', '\022', '\216', '\001', '\n', '\037', 'c', 'l', 'u', 's', 't',
+'e', 'r', '_', 'n', 'o', 't', '_', 'f', 'o', 'u', 'n', 'd', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd',
+'e', '\030', '\024', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
+'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'C', 'l', 'u', 's', 't', 'e',
+'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 'B', '\010', '\372', 'B',
+'\005', '\202', '\001', '\002', '\020', '\001', 'R', '\033', 'c', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e',
+'s', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd', 'a', 't',
+'a', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030',
+'\005', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\r', 'p', 'r', 'e', 'f', 'i',
+'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e',
+'\030', ' ', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i',
+'t', 'u', 't', 'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '?', '\n', '\024', 'h', 'o', 's',
+'t', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\t', 'B', '\013',
+'\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't',
+'e', 'L', 'i', 't', 'e', 'r', 'a', 'l', '\022', 'H', '\n', '\021', 'a', 'u', 't', 'o', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'w',
+'r', 'i', 't', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'H', '\001', 'R', '\017', 'a', 'u', 't', 'o', 'H', 'o', 's', 't',
+'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '=', '\n', '\023', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'h',
+'e', 'a', 'd', 'e', 'r', '\030', '\035', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'H',
+'\001', 'R', '\021', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'g', '\n', '\027', 'h',
+'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'e', 'g', 'e', 'x', '\030', '#', ' ',
'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't',
-'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
-'t', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e', 'a', 'd', 'e', 'r', '\032', '\237', '\001',
-'\n', '\006', 'C', 'o', 'o', 'k', 'i', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\003', 't', 't', 'l', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
-'o', 'n', 'R', '\003', 't', 't', 'l', '\022', '\022', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 'p', 'a',
-'t', 'h', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
-'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i',
-'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', '\032', 'z', '\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r',
-'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', '\033', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\001', ' ', '\001',
-'(', '\010', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', ':', 'E', '\232', '\305', '\210', '\036', '@', '\n', '>', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
-'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r',
-'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\032', 'n', '\n', '\016', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
-'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\004', 'n', 'a', 'm', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P',
-'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\032', 'f', '\n', '\013', 'F',
-'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', ':', '<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
-'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', ':',
-'0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
-'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'B',
-'\027', '\n', '\020', 'p', 'o', 'l', 'i', 'c', 'y', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032',
-'\243', '\003', '\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '0', '\n', '\014', 'u', 'p', 'g', 'r',
-'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
-'\002', '\310', '\001', '\000', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b',
-'l', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'e', '\n', '\016',
-'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '>', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e',
-'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 'n',
-'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\r', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\215', '\001', '\n', '\r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ']', '\n', '\025', 'p', 'r', 'o', 'x',
-'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ')',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'r', 'o',
-'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'p', 'r', 'o', 'x', 'y', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'a', 'l', 'l', 'o', 'w', '_', 'p', 'o', 's',
-'t', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\t', 'a', 'l', 'l', 'o', 'w', 'P', 'o', 's', 't', ':', '3', '\232', '\305', '\210', '\036', '.',
-'\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't',
-'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\210', '\002', '\n',
-'\021', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'I', '\n', '\023', 'm', 'a', 'x',
-'_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.',
+'e', 'H', '\001', 'R', '\024', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'P', 'a', 't', 'h', 'R', 'e', 'g', 'e', 'x',
+'\022', '5', '\n', '\027', 'a', 'p', 'p', 'e', 'n', 'd', '_', 'x', '_', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'e', 'd', '_', 'h', 'o',
+'s', 't', '\030', '&', ' ', '\001', '(', '\010', 'R', '\024', 'a', 'p', 'p', 'e', 'n', 'd', 'X', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'e',
+'d', 'H', 'o', 's', 't', '\022', '3', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\031', '.',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R',
-'\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'P', '\n', '\027', 'g', 'r', 'p',
-'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 'x', '\030', '\002', ' ', '\001', '(',
-'\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't',
-'i', 'o', 'n', 'R', '\024', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'x',
-'\022', 'V', '\n', '\032', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'o',
-'f', 'f', 's', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\027', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u',
-'t', 'H', 'e', 'a', 'd', 'e', 'r', 'O', 'f', 'f', 's', 'e', 't', '\"', 'E', '\n', '\033', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N',
-'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\027', '\n', '\023', 'S', 'E',
-'R', 'V', 'I', 'C', 'E', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\000', '\022', '\r', '\n', '\t', 'N', 'O',
-'T', '_', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\"', '^', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i',
-'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\"', '\n', '\036', 'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G',
-'H', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\000', '\022', '\034', '\n', '\030',
-'H', 'A', 'N', 'D', 'L', 'E', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020',
-'\001', '\032', '\002', '\030', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\030', '\n', '\021', 'c', 'l',
-'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\030', '\n', '\026', 'h',
-'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\014',
-'\020', '\r', 'J', '\004', '\010', '\022', '\020', '\023', 'J', '\004', '\010', '\023', '\020', '\024', 'J', '\004', '\010', '\020', '\020', '\021', 'J', '\004', '\010', '\026', '\020',
-'\027', 'J', '\004', '\010', '\025', '\020', '\026', 'J', '\004', '\010', '\n', '\020', '\013', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i',
-'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\"', '\215', '\017', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i',
-'c', 'y', '\022', '\031', '\n', '\010', 'r', 'e', 't', 'r', 'y', '_', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'r', 'e', 't',
-'r', 'y', 'O', 'n', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
-'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e',
-'s', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022', 'A', '\n', '\017', 'p', 'e', 'r', '_', 't', 'r', 'y', '_',
-'t', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'p', 'e', 'r', 'T', 'r', 'y', 'T', 'i',
-'m', 'e', 'o', 'u', 't', '\022', 'W', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\004',
-' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o',
-'r', 'i', 't', 'y', 'R', '\r', 'r', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'g', '\n', '\024', 'r', 'e',
-'t', 'r', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\005', ' ', '\003', '(', '\013', '2',
-'5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
-'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i',
-'c', 'a', 't', 'e', 'R', '\022', 'r', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022',
-'H', '\n', '!', 'h', 'o', 's', 't', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'r', 'e', 't', 'r', 'y', '_', 'm',
-'a', 'x', '_', 'a', 't', 't', 'e', 'm', 'p', 't', 's', '\030', '\006', ' ', '\001', '(', '\003', 'R', '\035', 'h', 'o', 's', 't', 'S', 'e',
-'l', 'e', 'c', 't', 'i', 'o', 'n', 'R', 'e', 't', 'r', 'y', 'M', 'a', 'x', 'A', 't', 't', 'e', 'm', 'p', 't', 's', '\022', '4',
-'\n', '\026', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e', 's', '\030',
-'\007', ' ', '\003', '(', '\r', 'R', '\024', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'd',
-'e', 's', '\022', 'U', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\010', ' ', '\001', '(',
-'\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f',
-'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'x', '\n', '\033', 'r', 'a', 't', 'e', '_', 'l', 'i',
-'m', 'i', 't', 'e', 'd', '_', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\013', ' ', '\001', '(',
-'\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R',
-'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', 'R', '\027', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R',
-'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'Q', '\n', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'R', '\020', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '`', '\n', '\031', 'r', 'e',
-'t', 'r', 'i', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\n',
-' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\027', 'r', 'e', 't', 'r', 'i', 'a',
-'b', 'l', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\032', '\271', '\001', '\n', '\r', 'R', 'e', 't',
-'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '3',
-'\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't',
-'y', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c',
-'o', 'n', 'f', 'i', 'g', '\032', '\303', '\001', '\n', '\022', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c',
-'a', 't', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003',
-' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n',
-'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P',
-'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B',
-'\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n',
-'f', 'i', 'g', '\032', '\326', '\001', '\n', '\014', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'J', '\n', '\r', 'b',
-'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007',
-'\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'F', '\n', '\014',
-'m', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
-'\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '2', '\232', '\305', '\210', '\036', '-',
-'\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r',
-'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\032', '\210', '\001', '\n', '\013',
-'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'V', '\n', '\006',
-'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R',
-'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020',
-'\001', 'R', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\032', '\300', '\001', '\n', '\027', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd',
-'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', ']', '\n', '\r', 'r', 'e', 's', 'e', 't', '_', 'h', 'e', 'a',
-'d', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 's',
-'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\014', 'r', 'e', 's', 'e', 't',
-'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'F', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e',
-'r', 'v', 'a', 'l', '\"', '4', '\n', '\021', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't',
-'\022', '\013', '\n', '\007', 'S', 'E', 'C', 'O', 'N', 'D', 'S', '\020', '\000', '\022', '\022', '\n', '\016', 'U', 'N', 'I', 'X', '_', 'T', 'I', 'M',
-'E', 'S', 'T', 'A', 'M', 'P', '\020', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\234', '\002',
-'\n', '\013', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'P', '\n', '\020', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_',
-'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*',
-'\002', '(', '\001', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '\\', '\n', '\031', 'a',
-'d', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'c', 'h', 'a', 'n', 'c', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a',
-'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\027', 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a',
-'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'h', 'a', 'n', 'c', 'e', '\022', '6', '\n', '\030', 'h', 'e', 'd', 'g', 'e', '_', 'o',
-'n', '_', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\024',
-'h', 'e', 'd', 'g', 'e', 'O', 'n', 'P', 'e', 'r', 'T', 'r', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '%', '\232', '\305', '\210',
-'\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e',
-'d', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\341', '\005', '\n', '\016', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't',
-'i', 'o', 'n', '\022', '\'', '\n', '\016', 'h', 't', 't', 'p', 's', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001',
-'(', '\010', 'H', '\000', 'R', '\r', 'h', 't', 't', 'p', 's', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', ')', '\n', '\017', 's', 'c',
-'h', 'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\016', 's', 'c',
-'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '0', '\n', '\r', 'h', 'o', 's', 't', '_', 'r', 'e', 'd', 'i',
-'r', 'e', 'c', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\014',
-'h', 'o', 's', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '#', '\n', '\r', 'p', 'o', 'r', 't', '_', 'r', 'e', 'd', 'i',
-'r', 'e', 'c', 't', '\030', '\010', ' ', '\001', '(', '\r', 'R', '\014', 'p', 'o', 'r', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022',
-'2', '\n', '\r', 'p', 'a', 't', 'h', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372',
-'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\014', 'p', 'a', 't', 'h', 'R', 'e', 'd', 'i', 'r', 'e', 'c',
-'t', '\022', '4', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\005', ' ', '\001', '(', '\t',
-'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\r', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'e',
-'w', 'r', 'i', 't', 'e', '\022', 'U', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\t', ' ',
-'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't',
-'e', 'H', '\001', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'i', '\n', '\r', 'r', 'e', 's', 'p',
-'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\003', ' ', '\001', '(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
-'t', 'i', 'o', 'n', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022',
-'\037', '\n', '\013', 's', 't', 'r', 'i', 'p', '_', 'q', 'u', 'e', 'r', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 's', 't', 'r',
-'i', 'p', 'Q', 'u', 'e', 'r', 'y', '\"', 'w', '\n', '\024', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', 'C', 'o', 'd', 'e', '\022', '\025', '\n', '\021', 'M', 'O', 'V', 'E', 'D', '_', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T',
-'L', 'Y', '\020', '\000', '\022', '\t', '\n', '\005', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'S', 'E', 'E', '_', 'O', 'T',
-'H', 'E', 'R', '\020', '\002', '\022', '\026', '\n', '\022', 'T', 'E', 'M', 'P', 'O', 'R', 'A', 'R', 'Y', '_', 'R', 'E', 'D', 'I', 'R', 'E',
-'C', 'T', '\020', '\003', '\022', '\026', '\n', '\022', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C',
-'T', '\020', '\004', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\032', '\n', '\030', 's',
-'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\030',
-'\n', '\026', 'p', 'a', 't', 'h', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\"',
-'\240', '\001', '\n', '\024', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022',
-'\"', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\n', '\372', 'B', '\007', '*', '\005', '\020', '\330', '\004',
-'(', 'd', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2',
-' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a',
-'t', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e',
-'s', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\221', '\001', '\n', '\t', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o',
+'\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030',
+'\030', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'E', '\n', '\014', 'r',
+'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\t', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l',
+'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y',
+'_', 'p', 'o', 'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '!', ' ', '\001', '(',
+'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026',
+'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n',
+'\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030',
+'\036', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M',
+'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o',
+'r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\022', 'K', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\013', ' ', '\001',
+'(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020',
+'\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't',
+'s', '\030', '\r', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
+'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i', 'm',
+'i', 't', 's', '\022', '\\', '\n', '\026', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'v', 'h', '_', 'r', 'a', 't', 'e', '_', 'l', 'i',
+'m', 'i', 't', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.',
+'0', 'R', '\023', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'V', 'h', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'N', '\n',
+'\013', 'h', 'a', 's', 'h', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\017', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
+'t', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\n', 'h', 'a', 's', 'h', 'P', 'o', 'l', 'i',
+'c', 'y', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030', '\021', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c',
+'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 'P', '\n', '\020', 'm', 'a', 'x', '_', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o',
+'u', 't', '\030', '\027', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\016',
+'m', 'a', 'x', 'G', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'V', '\n', '\023', 'g', 'r', 'p', 'c', '_', 't', 'i',
+'m', 'e', 'o', 'u', 't', '_', 'o', 'f', 'f', 's', 'e', 't', '\030', '\034', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222',
+'\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\021', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'O', 'f', 'f', 's',
+'e', 't', '\022', 'Y', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\031', ' ', '\003',
+'(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', 'g', '\n', '\030', 'i', 'n', 't',
+'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\"', ' ', '\001',
+'(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R',
+'\026', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\200',
+'\001', '\n', '\030', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'a', 'c', 't', 'i',
+'o', 'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r',
+'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'I', 'n', 't', 'e', 'r',
+'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330',
+'\004', '\003', '3', '.', '0', 'R', '\026', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
+'t', 'i', 'o', 'n', '\022', '_', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i',
+'r', 'e', 'c', 't', 's', '\030', '\037', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004',
+'\003', '3', '.', '0', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't',
+'s', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\033', ' ', '\001', '(', '\013', '2', '\"',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e',
+'d', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'd', '\n',
+'\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(',
+'\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
+'.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r',
+'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\032',
+'\242', '\002', '\n', '\023', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '!',
+'\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't',
+'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022',
+'?', '\n', '\r', 't', 'r', 'a', 'c', 'e', '_', 's', 'a', 'm', 'p', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
+'R', '\014', 't', 'r', 'a', 'c', 'e', 'S', 'a', 'm', 'p', 'l', 'e', 'd', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't',
+'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'J', '\004',
+'\010', '\002', '\020', '\003', 'R', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\032', '\226', '\n', '\n', '\n', 'H', 'a', 's',
+'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'N', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '4',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
+'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e', 'a', 'd',
+'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', 'N', '\n', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y',
+'.', 'C', 'o', 'o', 'k', 'i', 'e', 'H', '\000', 'R', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\022', 'y', '\n', '\025', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', 'B',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
+'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 'H', '\000', 'R', '\024', 'c', 'o', 'n', 'n', 'e',
+'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', 'g', '\n', '\017', 'q', 'u', 'e', 'r', 'y', '_',
+'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
+'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't',
+'e', 'r', 'H', '\000', 'R', '\016', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '^', '\n', '\014', 'f',
+'i', 'l', 't', 'e', 'r', '_', 's', 't', 'a', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't',
+'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't',
+'e', 'H', '\000', 'R', '\013', 'f', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\032', '\n', '\010', 't', 'e', 'r', 'm', 'i',
+'n', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\010', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l', '\032', '\306', '\001', '\n', '\006', 'H',
+'e', 'a', 'd', 'e', 'r', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N',
+'a', 'm', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\002', ' ', '\001', '(',
+'\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3',
+'.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', 'R',
+'\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i',
+'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e', 'a', 'd', 'e', 'r', '\032', '\237', '\001', '\n', '\006',
+'C', 'o', 'o', 'k', 'i', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\003', 't', 't', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'R', '\003', 't', 't', 'l', '\022', '\022', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 'p', 'a', 't', 'h',
+':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y',
+'.', 'C', 'o', 'o', 'k', 'i', 'e', '\032', 'z', '\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p',
+'e', 'r', 't', 'i', 'e', 's', '\022', '\033', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\001', ' ', '\001', '(', '\010',
+'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', ':', 'E', '\232', '\305', '\210', '\036', '@', '\n', '>', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.',
+'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p',
+'e', 'r', 't', 'i', 'e', 's', '\032', 'n', '\n', '\016', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022',
+'\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n',
+'a', 'm', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l',
+'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\032', 'f', '\n', '\013', 'F', 'i', 'l',
+'t', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', ':', '<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.',
+'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', ':', '0', '\232',
+'\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
+'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\027', '\n',
+'\020', 'p', 'o', 'l', 'i', 'c', 'y', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032', '\243', '\003',
+'\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '0', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd',
+'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\002', '\310',
+'\001', '\000', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e',
+'d', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'e', '\n', '\016', 'c', 'o',
+'n', 'n', 'e', 'c', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '>', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
+'t', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\r', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\215', '\001',
+'\n', '\r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ']', '\n', '\025', 'p', 'r', 'o', 'x', 'y', '_',
+'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'r', 'o', 'x', 'y',
+'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'p', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'a', 'l', 'l', 'o', 'w', '_', 'p', 'o', 's', 't', '\030',
+'\002', ' ', '\001', '(', '\010', 'R', '\t', 'a', 'l', 'l', 'o', 'w', 'P', 'o', 's', 't', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A',
+'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\210', '\002', '\n', '\021', 'M',
+'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'I', '\n', '\023', 'm', 'a', 'x', '_', 's',
+'t', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm',
+'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'P', '\n', '\027', 'g', 'r', 'p', 'c', '_',
+'t', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 'x', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\024', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'x', '\022', 'V',
+'\n', '\032', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'o', 'f', 'f',
+'s', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\027', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'H',
+'e', 'a', 'd', 'e', 'r', 'O', 'f', 'f', 's', 'e', 't', '\"', 'E', '\n', '\033', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't',
+'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\027', '\n', '\023', 'S', 'E', 'R', 'V',
+'I', 'C', 'E', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\000', '\022', '\r', '\n', '\t', 'N', 'O', 'T', '_',
+'F', 'O', 'U', 'N', 'D', '\020', '\001', '\"', '^', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e',
+'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\"', '\n', '\036', 'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G', 'H', '_',
+'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\000', '\022', '\034', '\n', '\030', 'H', 'A',
+'N', 'D', 'L', 'E', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\001', '\032',
+'\002', '\030', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\030', '\n', '\021', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\030', '\n', '\026', 'h', 'o', 's',
+'t', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\014', '\020', '\r',
+'J', '\004', '\010', '\022', '\020', '\023', 'J', '\004', '\010', '\023', '\020', '\024', 'J', '\004', '\010', '\020', '\020', '\021', 'J', '\004', '\010', '\026', '\020', '\027', 'J',
+'\004', '\010', '\025', '\020', '\026', 'J', '\004', '\010', '\n', '\020', '\013', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r',
+'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\"', '\277', '\020', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y',
+'\022', '\031', '\n', '\010', 'r', 'e', 't', 'r', 'y', '_', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'r', 'e', 't', 'r', 'y',
+'O', 'n', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a',
+'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R',
+'\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022', 'A', '\n', '\017', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't', 'i',
+'m', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'p', 'e', 'r', 'T', 'r', 'y', 'T', 'i', 'm', 'e',
+'o', 'u', 't', '\022', 'J', '\n', '\024', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o',
+'u', 't', '\030', '\r', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'p', 'e', 'r', 'T', 'r', 'y', 'I', 'd', 'l', 'e', 'T', 'i', 'm',
+'e', 'o', 'u', 't', '\022', 'W', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\004', ' ',
+'\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r',
+'i', 't', 'y', 'R', '\r', 'r', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'g', '\n', '\024', 'r', 'e', 't',
+'r', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\005', ' ', '\003', '(', '\013', '2', '5',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e',
+'t', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c',
+'a', 't', 'e', 'R', '\022', 'r', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'd',
+'\n', '\030', 'r', 'e', 't', 'r', 'y', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '_', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
+'s', '\030', '\014', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i',
+'g', 'R', '\026', 'r', 'e', 't', 'r', 'y', 'O', 'p', 't', 'i', 'o', 'n', 's', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's',
+'\022', 'H', '\n', '!', 'h', 'o', 's', 't', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'r', 'e', 't', 'r', 'y', '_',
+'m', 'a', 'x', '_', 'a', 't', 't', 'e', 'm', 'p', 't', 's', '\030', '\006', ' ', '\001', '(', '\003', 'R', '\035', 'h', 'o', 's', 't', 'S',
+'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'R', 'e', 't', 'r', 'y', 'M', 'a', 'x', 'A', 't', 't', 'e', 'm', 'p', 't', 's', '\022',
+'4', '\n', '\026', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e', 's',
+'\030', '\007', ' ', '\003', '(', '\r', 'R', '\024', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'C', 'o',
+'d', 'e', 's', '\022', 'U', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\010', ' ', '\001',
+'(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f',
+'f', 'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'x', '\n', '\033', 'r', 'a', 't', 'e', '_', 'l',
+'i', 'm', 'i', 't', 'e', 'd', '_', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\013', ' ', '\001',
+'(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd',
+'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', 'R', '\027', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd',
+'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'Q', '\n', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e',
+'_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h',
+'e', 'r', 'R', '\020', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '`', '\n', '\031', 'r',
+'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030',
+'\n', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\027', 'r', 'e', 't', 'r', 'i',
+'a', 'b', 'l', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\032', '\271', '\001', '\n', '\r', 'R', 'e',
+'t', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':',
+'3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
+'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i',
+'t', 'y', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006',
+'c', 'o', 'n', 'f', 'i', 'g', '\032', '\303', '\001', '\n', '\022', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i',
+'c', 'a', 't', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A',
+'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '8', '\232', '\305', '\210', '\036', '3', '\n',
+'1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y',
+'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
+'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o',
+'n', 'f', 'i', 'g', '\032', '\326', '\001', '\n', '\014', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'J', '\n', '\r',
+'b', 'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B',
+'\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'F', '\n',
+'\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B',
+'\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '2', '\232', '\305', '\210', '\036',
+'-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't',
+'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\032', '\210', '\001', '\n',
+'\013', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'V', '\n',
+'\006', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.',
+'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002',
+'\020', '\001', 'R', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\032', '\300', '\001', '\n', '\027', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e',
+'d', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', ']', '\n', '\r', 'r', 'e', 's', 'e', 't', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e',
+'s', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\014', 'r', 'e', 's', 'e',
+'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'F', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't',
+'e', 'r', 'v', 'a', 'l', '\"', '4', '\n', '\021', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a',
+'t', '\022', '\013', '\n', '\007', 'S', 'E', 'C', 'O', 'N', 'D', 'S', '\020', '\000', '\022', '\022', '\n', '\016', 'U', 'N', 'I', 'X', '_', 'T', 'I',
+'M', 'E', 'S', 'T', 'A', 'M', 'P', '\020', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\234',
+'\002', '\n', '\013', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'P', '\n', '\020', 'i', 'n', 'i', 't', 'i', 'a', 'l',
+'_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004',
+'*', '\002', '(', '\001', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '\\', '\n', '\031',
+'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'c', 'h', 'a', 'n', 'c', 'e',
+'\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r',
+'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\027', 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n',
+'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'h', 'a', 'n', 'c', 'e', '\022', '6', '\n', '\030', 'h', 'e', 'd', 'g', 'e', '_',
+'o', 'n', '_', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R',
+'\024', 'h', 'e', 'd', 'g', 'e', 'O', 'n', 'P', 'e', 'r', 'T', 'r', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '%', '\232', '\305',
+'\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H',
+'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\341', '\005', '\n', '\016', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
+'t', 'i', 'o', 'n', '\022', '\'', '\n', '\016', 'h', 't', 't', 'p', 's', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ',
+'\001', '(', '\010', 'H', '\000', 'R', '\r', 'h', 't', 't', 'p', 's', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', ')', '\n', '\017', 's',
+'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\016', 's',
+'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '0', '\n', '\r', 'h', 'o', 's', 't', '_', 'r', 'e', 'd',
+'i', 'r', 'e', 'c', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R',
+'\014', 'h', 'o', 's', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '#', '\n', '\r', 'p', 'o', 'r', 't', '_', 'r', 'e', 'd',
+'i', 'r', 'e', 'c', 't', '\030', '\010', ' ', '\001', '(', '\r', 'R', '\014', 'p', 'o', 'r', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't',
+'\022', '2', '\n', '\r', 'p', 'a', 't', 'h', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013',
+'\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\014', 'p', 'a', 't', 'h', 'R', 'e', 'd', 'i', 'r', 'e',
+'c', 't', '\022', '4', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\005', ' ', '\001', '(',
+'\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\r', 'p', 'r', 'e', 'f', 'i', 'x', 'R',
+'e', 'w', 'r', 'i', 't', 'e', '\022', 'U', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\t',
+' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u',
+'t', 'e', 'H', '\001', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'i', '\n', '\r', 'r', 'e', 's',
+'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\003', ' ', '\001', '(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A',
+'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd',
+'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e',
+'\022', '\037', '\n', '\013', 's', 't', 'r', 'i', 'p', '_', 'q', 'u', 'e', 'r', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 's', 't',
+'r', 'i', 'p', 'Q', 'u', 'e', 'r', 'y', '\"', 'w', '\n', '\024', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o',
+'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\025', '\n', '\021', 'M', 'O', 'V', 'E', 'D', '_', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N',
+'T', 'L', 'Y', '\020', '\000', '\022', '\t', '\n', '\005', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'S', 'E', 'E', '_', 'O',
+'T', 'H', 'E', 'R', '\020', '\002', '\022', '\026', '\n', '\022', 'T', 'E', 'M', 'P', 'O', 'R', 'A', 'R', 'Y', '_', 'R', 'E', 'D', 'I', 'R',
+'E', 'C', 'T', '\020', '\003', '\022', '\026', '\n', '\022', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T', '_', 'R', 'E', 'D', 'I', 'R', 'E',
+'C', 'T', '\020', '\004', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\032', '\n', '\030',
+'s', 'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B',
+'\030', '\n', '\026', 'p', 'a', 't', 'h', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'\"', '\241', '\001', '\n', '\024', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n',
+'\022', '#', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\020', '\330',
+'\004', '(', '\310', '\001', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\002', ' ', '\001', '(',
+'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'D', 'i', 'r', 'e', 'c', 't',
+'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\025', '\n', '\023', 'N', 'o', 'n', 'F', 'o', 'r', 'w',
+'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\221', '\001', '\n', '\t', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o',
'r', '\022', '%', '\n', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
'r', '\002', '\020', '\001', 'R', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\022', '8', '\n', '\t', 'p', 'r', 'o', 'p', 'a', 'g',
'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
@@ -745,7 +684,7 @@ static const char descriptor[19463] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/',
'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v',
'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l',
'u', 's', 't', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r',
-'n', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\"', '\241', '\026', '\n', '\t', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\022', ';',
+'n', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\"', '\321', '\026', '\n', '\t', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\022', ';',
'\n', '\005', 's', 't', 'a', 'g', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002',
'\030', '\n', 'R', '\005', 's', 't', 'a', 'g', 'e', '\022', '\037', '\n', '\013', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'k', 'e', 'y', '\030',
@@ -755,7 +694,7 @@ static const char descriptor[19463] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/',
'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\022', '?', '\n', '\005', 'l', 'i',
'm', 'i', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'O', 'v', 'e', 'r', 'r', 'i',
-'d', 'e', 'R', '\005', 'l', 'i', 'm', 'i', 't', '\032', '\215', '\022', '\n', '\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '^', '\n', '\016', 's',
+'d', 'e', 'R', '\005', 'l', 'i', 'm', 'i', 't', '\032', '\275', '\022', '\n', '\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '^', '\n', '\016', 's',
'o', 'u', 'r', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i',
'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H',
@@ -779,146 +718,157 @@ static const char descriptor[19463] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/',
'_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't',
'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\020', 'h',
-'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', 'n', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i',
+'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', 'w', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i',
'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
-'.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'B', '\010',
-'\030', '\001', '\270', '\356', '\362', '\322', '\005', '\001', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '\022', 'N', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\010', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
-'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'H', '\000', 'R', '\010', 'm',
-'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'J', '\n', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(',
-'\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\t', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\032', 'I', '\n', '\r', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r',
-':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c',
-'e', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', 'S', '\n', '\022', 'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l',
-'u', 's', 't', 'e', 'r', ':', '=', '\232', '\305', '\210', '\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'B', '\021',
+'\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', '\270', '\356', '\362', '\322', '\005', '\001', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a',
+'m', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'N', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\010',
+' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a',
+'D', 'a', 't', 'a', 'H', '\000', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'J', '\n', '\t', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o',
+'n', 'f', 'i', 'g', 'H', '\000', 'R', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\032', 'I', '\n', '\r', 'S', 'o', 'u', 'r',
+'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't',
+'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', 'S', '\n', '\022', 'D', 'e', 's', 't',
+'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '=', '\232', '\305', '\210', '\036', '8', '\n', '6', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i',
+'t', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't',
+'e', 'r', '\032', '\321', '\001', '\n', '\016', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '.', '\n', '\013',
+'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020',
+'\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\016', 'd', 'e',
+'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', '$', '\n', '\016', 's', 'k', 'i', 'p',
+'_', 'i', 'f', '_', 'a', 'b', 's', 'e', 'n', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\014', 's', 'k', 'i', 'p', 'I', 'f', 'A',
+'b', 's', 'e', 'n', 't', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.',
-'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', '\321', '\001', '\n', '\016', 'R', 'e',
-'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a',
-'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n',
-'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_',
-'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r',
-'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', '$', '\n', '\016', 's', 'k', 'i', 'p', '_', 'i', 'f', '_', 'a', 'b', 's', 'e', 'n',
-'t', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\014', 's', 'k', 'i', 'p', 'I', 'f', 'A', 'b', 's', 'e', 'n', 't', ':', '9', '\232', '\305',
-'\210', '\036', '4', '\n', '2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R',
-'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e',
-'a', 'd', 'e', 'r', 's', '\032', 'I', '\n', '\r', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '8', '\232',
-'\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
-'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd',
-'d', 'r', 'e', 's', 's', '\032', '\236', '\001', '\n', '\n', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\022', '2', '\n', '\020', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
-'\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '%', '\n',
-'\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e',
-'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\032', '\214', '\002', '\n', '\020', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
-'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '=', '\n', '\014', 'e', 'x', 'p', 'e', 'c', 't', '_',
-'m', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'e', 'x', 'p', 'e', 'c', 't', 'M', 'a', 't',
-'c', 'h', '\022', 'H', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r',
-'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o',
-'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\032', '\270', '\001', '\n', '\017', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M',
-'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y',
-'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't',
-'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.',
-'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R',
-'\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v',
-'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\032',
-'\264', '\002', '\n', '\010', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
-'r', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's',
-'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e',
-'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212',
-'\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a',
-'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V',
-'a', 'l', 'u', 'e', '\022', 'Y', '\n', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\016', '2', '7', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
-'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '.', 'S', 'o', 'u', 'r',
-'c', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\"', '&', '\n', '\006', 'S',
-'o', 'u', 'r', 'c', 'e', '\022', '\013', '\n', '\007', 'D', 'Y', 'N', 'A', 'M', 'I', 'C', '\020', '\000', '\022', '\017', '\n', '\013', 'R', 'O', 'U',
-'T', 'E', '_', 'E', 'N', 'T', 'R', 'Y', '\020', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c',
-'t', 'i', 'o', 'n', 'B', '\027', '\n', '\020', 'a', 'c', 't', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022',
-'\003', '\370', 'B', '\001', '\032', '\362', '\001', '\n', '\010', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'f', '\n', '\020', 'd', 'y', 'n', 'a',
-'m', 'i', 'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o',
+'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\032', 'I', '\n', '\r', 'R', 'e', 'm', 'o', 't', 'e', 'A',
+'d', 'd', 'r', 'e', 's', 's', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n',
+'.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', '\032', '\236', '\001', '\n', '\n', 'G', 'e', 'n', 'e', 'r', 'i',
+'c', 'K', 'e', 'y', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030',
+'\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
+'r', 'V', 'a', 'l', 'u', 'e', '\022', '%', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030',
+'\002', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', ':', '5', '\232', '\305', '\210',
+'\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a',
+'t', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y',
+'\032', '\263', '\002', '\n', '\020', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\016',
+'d', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e', 's',
+'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_',
+'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd', 'e', 's',
+'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '=', '\n', '\014', 'e', 'x', 'p', 'e', 'c', 't', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'e', 'x', 'p', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h',
+'\022', 'H', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a',
+'t', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', ':',
+';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
+'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r',
+'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\032', '\270', '\001', '\n', '\017', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't',
+'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\001',
+' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r',
+'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l',
+'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\032', '\264', '\002',
+'\n', '\010', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_',
+'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r',
+'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a',
+'t', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002',
+'\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l',
+'t', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l',
+'u', 'e', '\022', 'Y', '\n', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\016', '2', '7', '.', 'e', 'n', 'v', 'o',
'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm',
-'i', 't', '.', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a',
-'t', 'a', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'c', '\n', '\017',
-'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\031', '\n',
-'\022', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', ':',
-'#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
-'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\"', '\236', '\004', '\n', '\r', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't',
-'c', 'h', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010',
-'\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '!', '\n', '\013', 'e', 'x', 'a', 'c', 't', '_', 'm',
-'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\n', 'e', 'x', 'a', 'c', 't', 'M', 'a', 't', 'c', 'h', '\022',
-'O', '\n', '\020', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\013', ' ', '\001', '(', '\013',
-'2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.',
-'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\016', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x',
-'M', 'a', 't', 'c', 'h', '\022', '<', '\n', '\013', 'r', 'a', 'n', 'g', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a',
-'n', 'g', 'e', 'H', '\000', 'R', '\n', 'r', 'a', 'n', 'g', 'e', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's',
-'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n',
-'t', 'M', 'a', 't', 'c', 'h', '\022', ',', '\n', '\014', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t', ' ',
-'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 'p', 'r', 'e', 'f', 'i', 'x', 'M', 'a', 't',
-'c', 'h', '\022', ',', '\n', '\014', 's', 'u', 'f', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\n', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 'u', 'f', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', '0',
-'\n', '\016', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\014', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\r', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', 'M', 'a', 't', 'c', 'h', '\022', '!',
-'\n', '\014', 'i', 'n', 'v', 'e', 'r', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'n', 'v',
-'e', 'r', 't', 'M', 'a', 't', 'c', 'h', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\030', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
-'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\013', 'r', 'e', 'g', 'e', 'x',
-'_', 'm', 'a', 't', 'c', 'h', '\"', '\241', '\002', '\n', '\025', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
-'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\036', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\n', '\372', 'B',
-'\007', 'r', '\005', '\020', '\001', '(', '\200', '\010', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'S', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_',
-'m', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
-'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022',
-'%', '\n', '\r', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'H', '\000', 'R',
-'\014', 'p', 'r', 'e', 's', 'e', 'n', 't', 'M', 'a', 't', 'c', 'h', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a',
-'m', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '!', '\n', '\037', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r',
-'a', 'm', 'e', 't', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010',
-'\003', '\020', '\004', 'J', '\004', '\010', '\004', '\020', '\005', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\"', '\271',
-'\002', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', 'R', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't',
-'s', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l',
-'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\022', '@', '\n', '\027', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's',
-'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', 's', '\030', '\002', ' ', '\003', '(', '\r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002',
-'\020', '\005', 'R', '\025', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 's',
-'\022', 'J', '\n', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
-'s', '\022', '=', '\n', '\033', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'o', 's', 's', '_', 's', 'c', 'h', 'e', 'm', 'e', '_', 'r',
-'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\030', 'a', 'l', 'l', 'o', 'w', 'C', 'r', 'o', 's', 's',
-'S', 'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\"', ']', '\n', '\014', 'F', 'i', 'l', 't', 'e', 'r', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', ',', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\006', 'c', 'o', 'n', 'f', 'i',
-'g', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'i',
-'s', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', 'B', 'E', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
-'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\024',
-'R', 'o', 'u', 't', 'e', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '.', 'S', 'o', 'u', 'r', 'c', 'e',
+'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\"', '&', '\n', '\006', 'S', 'o', 'u',
+'r', 'c', 'e', '\022', '\013', '\n', '\007', 'D', 'Y', 'N', 'A', 'M', 'I', 'C', '\020', '\000', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'T', 'E',
+'_', 'E', 'N', 'T', 'R', 'Y', '\020', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i',
+'o', 'n', 'B', '\027', '\n', '\020', 'a', 'c', 't', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370',
+'B', '\001', '\032', '\362', '\001', '\n', '\010', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'f', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i',
+'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
+'.', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'c', '\n', '\017', 'D', 'y',
+'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'_', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\031', '\n', '\022', 'o',
+'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', ':', '#', '\232',
+'\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
+'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\"', '\244', '\005', '\n', '\r', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h',
+'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001',
+'\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '.', '\n', '\013', 'e', 'x', 'a', 'c', 't', '_', 'm', 'a', 't',
+'c', 'h', '\030', '\004', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\n',
+'e', 'x', 'a', 'c', 't', 'M', 'a', 't', 'c', 'h', '\022', '\\', '\n', '\020', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x', '_',
+'m', 'a', 't', 'c', 'h', '\030', '\013', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\013',
+'\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\016', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', 'M',
+'a', 't', 'c', 'h', '\022', '<', '\n', '\013', 'r', 'a', 'n', 'g', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a', 'n',
+'g', 'e', 'H', '\000', 'R', '\n', 'r', 'a', 'n', 'g', 'e', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's', 'e',
+'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n', 't',
+'M', 'a', 't', 'c', 'h', '\022', '7', '\n', '\014', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t', ' ', '\001',
+'(', '\t', 'B', '\022', '\030', '\001', '\372', 'B', '\004', 'r', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R',
+'\013', 'p', 'r', 'e', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', '7', '\n', '\014', 's', 'u', 'f', 'f', 'i', 'x', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\n', ' ', '\001', '(', '\t', 'B', '\022', '\030', '\001', '\372', 'B', '\004', 'r', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004',
+'\003', '3', '.', '0', 'H', '\000', 'R', '\013', 's', 'u', 'f', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', ';', '\n', '\016', 'c', 'o',
+'n', 't', 'a', 'i', 'n', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\014', ' ', '\001', '(', '\t', 'B', '\022', '\030', '\001', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\r', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's',
+'M', 'a', 't', 'c', 'h', '\022', 'I', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\r', ' ', '\001',
+'(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g',
+'M', 'a', 't', 'c', 'h', '\022', '!', '\n', '\014', 'i', 'n', 'v', 'e', 'r', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\010', ' ', '\001',
+'(', '\010', 'R', '\013', 'i', 'n', 'v', 'e', 'r', 't', 'M', 'a', 't', 'c', 'h', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M',
+'a', 't', 'c', 'h', 'e', 'r', 'B', '\030', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p',
+'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\005', '\020', '\006',
+'R', '\013', 'r', 'e', 'g', 'e', 'x', '_', 'm', 'a', 't', 'c', 'h', '\"', '\241', '\002', '\n', '\025', 'Q', 'u', 'e', 'r', 'y', 'P', 'a',
+'r', 'a', 'm', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\036', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\n', '\372', 'B', '\007', 'r', '\005', '\020', '\001', '(', '\200', '\010', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'S', '\n', '\014',
+'s', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o',
+'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M',
+'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n',
+'g', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006',
+' ', '\001', '(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n', 't', 'M', 'a', 't', 'c', 'h', ':', '/', '\232', '\305', '\210',
+'\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'Q', 'u',
+'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '!', '\n', '\037', 'q', 'u',
+'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i',
+'f', 'i', 'e', 'r', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\004', '\020', '\005', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'R', '\005',
+'r', 'e', 'g', 'e', 'x', '\"', '\271', '\002', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c',
+'t', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'R', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r',
+'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\024', 'm', 'a', 'x', 'I',
+'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\022', '@', '\n', '\027', 'r', 'e', 'd', 'i', 'r',
+'e', 'c', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', 's', '\030', '\002', ' ', '\003', '(', '\r', 'B',
+'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\020', '\005', 'R', '\025', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n',
+'s', 'e', 'C', 'o', 'd', 'e', 's', '\022', 'J', '\n', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\030', '\003', ' ', '\003',
+'(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'p', 'r',
+'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\022', '=', '\n', '\033', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'o', 's', 's', '_', 's',
+'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\030', 'a', 'l', 'l',
+'o', 'w', 'C', 'r', 'o', 's', 's', 'S', 'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\"', ']', '\n', '\014',
+'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ',', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y',
+'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\002',
+' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', 'B', '\213', '\001', '\n', '#', 'i', 'o', '.', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
+'u', 't', 'e', '.', 'v', '3', 'B', '\024', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r',
+'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o',
+'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', ';', 'r', 'o', 'u', 't', 'e', 'v', '3',
+'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[18] = {
+static _upb_DefPool_Init *deps[21] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_proxy_protocol_proto_upbdefinit,
+ &envoy_type_matcher_v3_metadata_proto_upbdefinit,
&envoy_type_matcher_v3_regex_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&envoy_type_metadata_v3_metadata_proto_upbdefinit,
@@ -928,6 +878,8 @@ static upb_def_init *deps[18] = {
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &xds_type_matcher_v3_matcher_proto_upbdefinit,
&envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -936,9 +888,9 @@ static upb_def_init *deps[18] = {
NULL
};
-upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_route_components_proto_upb_file_layout,
"envoy/config/route/v3/route_components.proto",
- UPB_STRVIEW_INIT(descriptor, 19463)
+ UPB_STRINGVIEW_INIT(descriptor, 20791)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
index a3cce451..a7ae82d8 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
@@ -19,266 +19,271 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_VirtualHost_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.VirtualHost");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_VirtualHost_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.VirtualHost");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.VirtualHost.TypedPerFilterConfigEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.VirtualHost.TypedPerFilterConfigEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_FilterAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.FilterAction");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_FilterAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.FilterAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_Route_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Route");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Route_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.Route");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_Route_TypedPerFilterConfigEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Route.TypedPerFilterConfigEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Route_TypedPerFilterConfigEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.Route.TypedPerFilterConfigEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_WeightedCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.WeightedCluster");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_WeightedCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.WeightedCluster");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_WeightedCluster_ClusterWeight_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.WeightedCluster.ClusterWeight");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_WeightedCluster_ClusterWeight_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.WeightedCluster.ClusterWeight");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteMatch_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteMatch");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteMatch");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteMatch.TlsContextMatchOptions");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteMatch.TlsContextMatchOptions");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteMatch_ConnectMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteMatch.ConnectMatcher");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteMatch_ConnectMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteMatch.ConnectMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_CorsPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.CorsPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_CorsPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.CorsPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.RequestMirrorPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.RequestMirrorPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_Header_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy.Header");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_Header_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy.Header");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy.Cookie");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy.Cookie");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy.ConnectionProperties");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy.QueryParameter");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.HashPolicy.FilterState");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.HashPolicy.FilterState");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_UpgradeConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.UpgradeConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_UpgradeConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.UpgradeConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.UpgradeConfig.ConnectConfig");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteAction_MaxStreamDuration_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteAction.MaxStreamDuration");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RouteAction_MaxStreamDuration_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RouteAction.MaxStreamDuration");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_RetryPriority_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy.RetryPriority");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_RetryPriority_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy.RetryPriority");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy.RetryHostPredicate");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy.RetryHostPredicate");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_RetryBackOff_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy.RetryBackOff");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_RetryBackOff_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy.RetryBackOff");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_ResetHeader_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy.ResetHeader");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_ResetHeader_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy.ResetHeader");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RetryPolicy.RateLimitedRetryBackOff");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_HedgePolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.HedgePolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_HedgePolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.HedgePolicy");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RedirectAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RedirectAction");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RedirectAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RedirectAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_DirectResponseAction_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.DirectResponseAction");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_DirectResponseAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.DirectResponseAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_Decorator_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Decorator");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_NonForwardingAction_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.NonForwardingAction");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_Tracing_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Tracing");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Decorator_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.Decorator");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_VirtualCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.VirtualCluster");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_Tracing_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.Tracing");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_VirtualCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.VirtualCluster");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_SourceCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.SourceCluster");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_DestinationCluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.DestinationCluster");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_SourceCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.SourceCluster");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_RequestHeaders_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.RequestHeaders");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_DestinationCluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.DestinationCluster");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_RemoteAddress_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.RemoteAddress");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_RequestHeaders_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.RequestHeaders");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_GenericKey_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.GenericKey");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_RemoteAddress_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.RemoteAddress");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.HeaderValueMatch");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_GenericKey_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.GenericKey");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.DynamicMetaData");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.HeaderValueMatch");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Action_MetaData_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Action.MetaData");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.DynamicMetaData");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Override_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Override");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Action_MetaData_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Action.MetaData");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RateLimit.Override.DynamicMetadata");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Override_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Override");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_HeaderMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.HeaderMatcher");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.RateLimit.Override.DynamicMetadata");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_QueryParameterMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.QueryParameterMatcher");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_HeaderMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.HeaderMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_InternalRedirectPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.InternalRedirectPolicy");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_QueryParameterMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.QueryParameterMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_FilterConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.FilterConfig");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_InternalRedirectPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.InternalRedirectPolicy");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_FilterConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.FilterConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
index 202945e8..6744b8ac 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
@@ -8,64 +8,70 @@
#include "upb/def.h"
#include "envoy/config/route/v3/scoped_route.upbdefs.h"
+#include "envoy/config/route/v3/scoped_route.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
-};
-
-static const char descriptor[789] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 's',
+extern _upb_DefPool_Init envoy_config_route_v3_route_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1054] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 's',
'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
-'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
-'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'.', 'p', 'r', 'o', 't', 'o', '\"', '\253', '\004', '\n', '\030', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
-'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\033', '\n', '\t', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '\030', '\004',
-' ', '\001', '(', '\010', 'R', '\010', 'o', 'n', 'D', 'e', 'm', 'a', 'n', 'd', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
-'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\030', 'r', 'o', 'u',
-'t', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001',
-'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\026', 'r', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', 'O', '\n', '\003', 'k', 'e', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '3',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'S', 'c',
-'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e',
-'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', '\032', '\222', '\002', '\n', '\003', 'K', 'e', 'y', '\022',
-'d', '\n', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
-'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', '.', 'F', 'r', 'a',
-'g', 'm', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't',
-'s', '\032', 's', '\n', '\010', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', '\022', '\037', '\n', '\n', 's', 't', 'r', 'i', 'n', 'g', '_', 'k',
-'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\t', 's', 't', 'r', 'i', 'n', 'g', 'K', 'e', 'y', ':', '9', '\232', '\305',
-'\210', '\036', '4', '\n', '2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
-'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', '.', 'F', 'r', 'a',
-'g', 'm', 'e', 'n', 't', 'B', '\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', '0', '\232', '\305', '\210', '\036', '+',
-'\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't',
-'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', ':', ',', '\232', '\305', '\210', '\036', '\'',
-'\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't',
-'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', 'A', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o',
-'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', 'B', '\020', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
+'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\252',
+'\005', '\n', '\030', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '\022', '\033', '\n', '\t', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\010', 'o', 'n',
+'D', 'e', 'm', 'a', 'n', 'd', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'N', '\n', '\030', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i',
+'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\024', '\362', '\230', '\376', '\217',
+'\005', '\016', '\022', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'R', '\026', 'r', 'o', 'u', 't', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', 'p', '\n', '\023', 'r', 'o', 'u', 't', 'e', '_',
+'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\005', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\024', '\362', '\230', '\376', '\217', '\005', '\016', '\022', '\014', 'r', 'o', 'u',
+'t', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'r', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '\022', 'O', '\n', '\003', 'k', 'e', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o',
+'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005',
+'\212', '\001', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', '\032', '\222', '\002', '\n', '\003', 'K', 'e', 'y', '\022', 'd', '\n', '\t', 'f', 'r', 'a',
+'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B',
+'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\032', 's', '\n', '\010', 'F',
+'r', 'a', 'g', 'm', 'e', 'n', 't', '\022', '\037', '\n', '\n', 's', 't', 'r', 'i', 'n', 'g', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001',
+'(', '\t', 'H', '\000', 'R', '\t', 's', 't', 'r', 'i', 'n', 'g', 'K', 'e', 'y', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B',
+'\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i',
+'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'K', 'e', 'y', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i',
+'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\207', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\020',
+'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u',
+'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r',
+'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u',
+'t', 'e', '/', 'v', '3', ';', 'r', 'o', 'u', 't', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
+'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[6] = {
+ &envoy_config_route_v3_route_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_config_route_v3_scoped_route_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_route_v3_scoped_route_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_scoped_route_proto_upb_file_layout,
"envoy/config/route/v3/scoped_route.proto",
- UPB_STRVIEW_INIT(descriptor, 789)
+ UPB_STRINGVIEW_INIT(descriptor, 1054)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
index 2c3d4d02..76b17548 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_route_v3_scoped_route_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_scoped_route_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_ScopedRouteConfiguration_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.ScopedRouteConfiguration");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_ScopedRouteConfiguration_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.ScopedRouteConfiguration");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_ScopedRouteConfiguration_Key_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.ScopedRouteConfiguration.Key");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_ScopedRouteConfiguration_Key_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.ScopedRouteConfiguration.Key");
}
-UPB_INLINE const upb_msgdef *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment");
+UPB_INLINE const upb_MessageDef *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_route_v3_scoped_route_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.route.v3.ScopedRouteConfiguration.Key.Fragment");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c
new file mode 100644
index 00000000..3405635f
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c
@@ -0,0 +1,188 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/tap/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/tap/v3/common.upbdefs.h"
+#include "envoy/config/tap/v3/common.upb.h"
+
+extern _upb_DefPool_Init envoy_config_common_matcher_v3_matcher_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[3646] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'a', 'p', '/', 'v', '3', '/', 'c', 'o', 'm',
+'m', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\023', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't',
+'a', 'p', '.', 'v', '3', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'm', 'm', 'o',
+'n', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b',
+'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
+'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
+'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
+'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e',
+'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', '\365', '\002', '\n', '\t', 'T', 'a', 'p', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'S', '\n', '\014', 'm',
+'a', 't', 'c', 'h', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i',
+'c', 'a', 't', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\013', 'm', 'a', 't', 'c', 'h', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'D', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'R', '\005', 'm', 'a', 't', 'c', 'h',
+'\022', 'P', '\n', '\r', 'o', 'u', 't', 'p', 'u', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '!',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'O', 'u', 't', 'p',
+'u', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'o', 'u', 't', 'p', 'u',
+'t', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'O', '\n', '\013', 't', 'a', 'p', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\003', ' ',
+'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n',
+'t', 'R', '\n', 't', 'a', 'p', 'E', 'n', 'a', 'b', 'l', 'e', 'd', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v',
+'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'T', 'a',
+'p', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\346', '\010', '\n', '\016', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '\022', 'I', '\n', '\010', 'o', 'r', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e',
+'d', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c',
+'h', '\022', 'K', '\n', '\t', 'a', 'n', 'd', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r',
+'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'M', 'a',
+'t', 'c', 'h', '\022', 'B', '\n', '\t', 'n', 'o', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '#', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h',
+'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\010', 'n', 'o', 't', 'M', 'a', 't', 'c', 'h', '\022', '&', '\n', '\t',
+'a', 'n', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H',
+'\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a', 't', 'c', 'h', '\022', 'd', '\n', '\032', 'h', 't', 't', 'p', '_', 'r', 'e', 'q', 'u', 'e',
+'s', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '%', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'H',
+'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\027', 'h', 't', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's',
+'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', 'f', '\n', '\033', 'h', 't', 't', 'p', '_', 'r', 'e', 'q',
+'u', 'e', 's', 't', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013',
+'2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'H', 't',
+'t', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\030', 'h', 't', 't', 'p', 'R', 'e', 'q',
+'u', 'e', 's', 't', 'T', 'r', 'a', 'i', 'l', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', 'f', '\n', '\033', 'h', 't', 't', 'p',
+'_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\007',
+' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v',
+'3', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\030', 'h', 't', 't',
+'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\022', 'h', '\n', '\034',
+'h', 't', 't', 'p', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\010', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'t', 'a', 'p', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', 'H', '\000',
+'R', '\031', 'h', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'T', 'r', 'a', 'i', 'l', 'e', 'r', 's', 'M', 'a', 't',
+'c', 'h', '\022', 'q', '\n', '\037', 'h', 't', 't', 'p', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'g', 'e', 'n', 'e', 'r', 'i',
+'c', '_', 'b', 'o', 'd', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r',
+'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\033', 'h', 't', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's',
+'t', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '\022', 's', '\n', ' ', 'h', 't', 't', 'p',
+'_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'b', 'o', 'd', 'y', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\n', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'t', 'a', 'p', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't',
+'c', 'h', 'H', '\000', 'R', '\034', 'h', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'G', 'e', 'n', 'e', 'r', 'i', 'c',
+'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '\032', '\211', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', '\022', 'C', '\n',
+'\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B',
+'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1',
+'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a',
+'.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', ':',
+'/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p',
+'.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\013',
+'\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\205', '\001', '\n', '\020', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e',
+'r', 's', 'M', 'a', 't', 'c', 'h', '\022', '>', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
+'$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H',
+'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', ':', '1', '\232', '\305',
+'\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2',
+'a', 'l', 'p', 'h', 'a', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'M', 'a', 't', 'c', 'h', '\"', '\226', '\002',
+'\n', '\024', 'H', 't', 't', 'p', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '\022', '\037', '\n',
+'\013', 'b', 'y', 't', 'e', 's', '_', 'l', 'i', 'm', 'i', 't', '\030', '\001', ' ', '\001', '(', '\r', 'R', '\n', 'b', 'y', 't', 'e', 's',
+'L', 'i', 'm', 'i', 't', '\022', '`', '\n', '\010', 'p', 'a', 't', 't', 'e', 'r', 'n', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', ':',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'H', 't', 't', 'p',
+'G', 'e', 'n', 'e', 'r', 'i', 'c', 'B', 'o', 'd', 'y', 'M', 'a', 't', 'c', 'h', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'T',
+'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'p', 'a', 't', 't', 'e',
+'r', 'n', 's', '\032', '{', '\n', '\020', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'T', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', '\022', ',',
+'\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022', ',', '\n', '\014', 'b', 'i',
+'n', 'a', 'r', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\014', 'B', '\007', '\372', 'B', '\004', 'z', '\002', '\020', '\001',
+'H', '\000', 'R', '\013', 'b', 'i', 'n', 'a', 'r', 'y', 'M', 'a', 't', 'c', 'h', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003',
+'\370', 'B', '\001', '\"', '\300', '\002', '\n', '\014', 'O', 'u', 't', 'p', 'u', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\005', 's',
+'i', 'n', 'k', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 't', 'a', 'p', '.', 'v', '3', '.', 'O', 'u', 't', 'p', 'u', 't', 'S', 'i', 'n', 'k', 'B', '\n', '\372', 'B', '\007', '\222', '\001',
+'\004', '\010', '\001', '\020', '\001', 'R', '\005', 's', 'i', 'n', 'k', 's', '\022', 'O', '\n', '\025', 'm', 'a', 'x', '_', 'b', 'u', 'f', 'f', 'e',
+'r', 'e', 'd', '_', 'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\022',
+'m', 'a', 'x', 'B', 'u', 'f', 'f', 'e', 'r', 'e', 'd', 'R', 'x', 'B', 'y', 't', 'e', 's', '\022', 'O', '\n', '\025', 'm', 'a', 'x',
+'_', 'b', 'u', 'f', 'f', 'e', 'r', 'e', 'd', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 'x', 'B', 'u', 'f', 'f', 'e', 'r', 'e', 'd', 'T', 'x', 'B', 'y', 't', 'e', 's', '\022',
+'\034', '\n', '\t', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\t', 's', 't', 'r', 'e', 'a',
+'m', 'i', 'n', 'g', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
+'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'u', 't', 'p', 'u', 't', 'C', 'o', 'n', 'f', 'i',
+'g', '\"', '\212', '\004', '\n', '\n', 'O', 'u', 't', 'p', 'u', 't', 'S', 'i', 'n', 'k', '\022', 'H', '\n', '\006', 'f', 'o', 'r', 'm', 'a',
+'t', '\030', '\001', ' ', '\001', '(', '\016', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a',
+'p', '.', 'v', '3', '.', 'O', 'u', 't', 'p', 'u', 't', 'S', 'i', 'n', 'k', '.', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\010', '\372',
+'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\022', 'R', '\n', '\017', 's', 't', 'r', 'e', 'a', 'm',
+'i', 'n', 'g', '_', 'a', 'd', 'm', 'i', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'A', 'd', 'm',
+'i', 'n', 'S', 'i', 'n', 'k', 'H', '\000', 'R', '\016', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'A', 'd', 'm', 'i', 'n', '\022',
+'G', '\n', '\014', 'f', 'i', 'l', 'e', '_', 'p', 'e', 'r', '_', 't', 'a', 'p', '\030', '\003', ' ', '\001', '(', '\013', '2', '#', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'F', 'i', 'l', 'e', 'P', 'e',
+'r', 'T', 'a', 'p', 'S', 'i', 'n', 'k', 'H', '\000', 'R', '\n', 'f', 'i', 'l', 'e', 'P', 'e', 'r', 'T', 'a', 'p', '\022', 'O', '\n',
+'\016', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', '_', 'g', 'r', 'p', 'c', '\030', '\004', ' ', '\001', '(', '\013', '2', '&', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', '.', 'S', 't', 'r', 'e', 'a', 'm',
+'i', 'n', 'g', 'G', 'r', 'p', 'c', 'S', 'i', 'n', 'k', 'H', '\000', 'R', '\r', 's', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'G',
+'r', 'p', 'c', '\"', '~', '\n', '\006', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\026', '\n', '\022', 'J', 'S', 'O', 'N', '_', 'B', 'O', 'D',
+'Y', '_', 'A', 'S', '_', 'B', 'Y', 'T', 'E', 'S', '\020', '\000', '\022', '\027', '\n', '\023', 'J', 'S', 'O', 'N', '_', 'B', 'O', 'D', 'Y',
+'_', 'A', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022', '\020', '\n', '\014', 'P', 'R', 'O', 'T', 'O', '_', 'B', 'I', 'N',
+'A', 'R', 'Y', '\020', '\002', '\022', '!', '\n', '\035', 'P', 'R', 'O', 'T', 'O', '_', 'B', 'I', 'N', 'A', 'R', 'Y', '_', 'L', 'E', 'N',
+'G', 'T', 'H', '_', 'D', 'E', 'L', 'I', 'M', 'I', 'T', 'E', 'D', '\020', '\003', '\022', '\016', '\n', '\n', 'P', 'R', 'O', 'T', 'O', '_',
+'T', 'E', 'X', 'T', '\020', '\004', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v',
+'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'u', 't', 'p', 'u', 't', 'S', 'i', 'n',
+'k', 'B', '\027', '\n', '\020', 'o', 'u', 't', 'p', 'u', 't', '_', 's', 'i', 'n', 'k', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B',
+'\001', '\"', 'I', '\n', '\022', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'A', 'd', 'm', 'i', 'n', 'S', 'i', 'n', 'k', ':', '3',
+'\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.',
+'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'A', 'd', 'm', 'i', 'n', 'S', 'i', 'n',
+'k', '\"', 'k', '\n', '\016', 'F', 'i', 'l', 'e', 'P', 'e', 'r', 'T', 'a', 'p', 'S', 'i', 'n', 'k', '\022', '(', '\n', '\013', 'p', 'a',
+'t', 'h', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\n', 'p', 'a', 't', 'h', 'P', 'r', 'e', 'f', 'i', 'x', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y',
+'.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'F', 'i', 'l', 'e',
+'P', 'e', 'r', 'T', 'a', 'p', 'S', 'i', 'n', 'k', '\"', '\256', '\001', '\n', '\021', 'S', 't', 'r', 'e', 'a', 'm', 'i', 'n', 'g', 'G',
+'r', 'p', 'c', 'S', 'i', 'n', 'k', '\022', '\025', '\n', '\006', 't', 'a', 'p', '_', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\005',
+'t', 'a', 'p', 'I', 'd', '\022', 'N', '\n', '\014', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'g',
+'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', ':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.',
+'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 't', 'a', 'p', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'S', 't', 'r', 'e', 'a',
+'m', 'i', 'n', 'g', 'G', 'r', 'p', 'c', 'S', 'i', 'n', 'k', 'B', '|', '\n', '!', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'a', 'p', '.', 'v', '3', 'B',
+'\013', 'C', 'o', 'm', 'm', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '@', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'a', 'p', '/', 'v', '3', ';',
+'t', 'a', 'p', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[10] = {
+ &envoy_config_common_matcher_v3_matcher_proto_upbdefinit,
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &envoy_config_route_v3_route_components_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_tap_v3_common_proto_upbdefinit = {
+ deps,
+ &envoy_config_tap_v3_common_proto_upb_file_layout,
+ "envoy/config/tap/v3/common.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 3646)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h
new file mode 100644
index 00000000..209a99e2
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h
@@ -0,0 +1,85 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/tap/v3/common.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_tap_v3_common_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_TapConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.TapConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_MatchPredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.MatchPredicate");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_MatchPredicate_MatchSet_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.MatchPredicate.MatchSet");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_HttpHeadersMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.HttpHeadersMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_HttpGenericBodyMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.HttpGenericBodyMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.HttpGenericBodyMatch.GenericTextMatch");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_OutputConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.OutputConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_OutputSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.OutputSink");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_StreamingAdminSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.StreamingAdminSink");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_FilePerTapSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.FilePerTapSink");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_tap_v3_StreamingGrpcSink_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_tap_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.tap.v3.StreamingGrpcSink");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TAP_V3_COMMON_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c
new file mode 100644
index 00000000..ba60b00c
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c
@@ -0,0 +1,54 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/datadog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/datadog.upbdefs.h"
+#include "envoy/config/trace/v3/datadog.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[533] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'd',
+'a', 't', 'a', 'd', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
+'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\235', '\001', '\n', '\r', 'D', 'a', 't', 'a', 'd', 'o', 'g', 'C', 'o', 'n', 'f', 'i',
+'g', '\022', '4', '\n', '\021', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\020', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', 'C', 'l',
+'u', 's', 't', 'e', 'r', '\022', '*', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', ':',
+'*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c',
+'e', '.', 'v', '2', '.', 'D', 'a', 't', 'a', 'd', 'o', 'g', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\263', '\001', '\n', '#', 'i', 'o',
+'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'t', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\014', 'D', 'a', 't', 'a', 'd', 'o', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', '*',
+'\022', '(', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r',
+'s', '.', 'd', 'a', 't', 'a', 'd', 'o', 'g', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[5] = {
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_datadog_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_datadog_proto_upb_file_layout,
+ "envoy/config/trace/v3/datadog.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 533)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h
new file mode 100644
index 00000000..0c60980a
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/datadog.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_datadog_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_DatadogConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_datadog_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.DatadogConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_DATADOG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c
new file mode 100644
index 00000000..4569a9a7
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c
@@ -0,0 +1,57 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/dynamic_ot.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/dynamic_ot.upbdefs.h"
+#include "envoy/config/trace/v3/dynamic_ot.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[561] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'd',
+'y', 'n', 'a', 'm', 'i', 'c', '_', 'o', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\223', '\001', '\n', '\017', 'D', 'y', 'n', 'a',
+'m', 'i', 'c', 'O', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\007', 'l', 'i', 'b', 'r', 'a', 'r', 'y', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\007', 'l', 'i', 'b', 'r', 'a', 'r', 'y', '\022', '/', '\n', '\006',
+'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', ',', '\232', '\305', '\210',
+'\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2',
+'.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'O', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\270', '\001', '\n', '#', 'i', 'o', '.', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
+'a', 'c', 'e', '.', 'v', '3', 'B', '\016', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'O', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', '-',
+'\022', '+', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r',
+'s', '.', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'o', 't', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[6] = {
+ &google_protobuf_struct_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_dynamic_ot_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_dynamic_ot_proto_upb_file_layout,
+ "envoy/config/trace/v3/dynamic_ot.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 561)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h
new file mode 100644
index 00000000..b64a008b
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/dynamic_ot.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_dynamic_ot_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_DynamicOtConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_dynamic_ot_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.DynamicOtConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_DYNAMIC_OT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
index 3817a572..4d08265c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
@@ -8,20 +8,13 @@
#include "upb/def.h"
#include "envoy/config/trace/v3/http_tracer.upbdefs.h"
+#include "envoy/config/trace/v3/http_tracer.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_msginit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_trace_v3_Tracing_msginit,
- &envoy_config_trace_v3_Tracing_Http_msginit,
-};
-
-static const char descriptor[532] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[603] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h',
't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
@@ -39,13 +32,16 @@ static const char descriptor[532] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', '
'.', 'v', '2', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'H', 't', 't', 'p', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i',
'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '$', '\232', '\305', '\210',
'\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2',
-'.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '@', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\017', 'H',
-'t', 't', 'p', 'T', 'r', 'a', 'c', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
+'.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '\206', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\017',
+'H', 't', 't', 'p', 'T', 'r', 'a', 'c', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o',
+'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c',
+'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&google_protobuf_any_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -53,9 +49,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit = {
+_upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_trace_v3_http_tracer_proto_upb_file_layout,
"envoy/config/trace/v3/http_tracer.proto",
- UPB_STRVIEW_INIT(descriptor, 532)
+ UPB_STRINGVIEW_INIT(descriptor, 603)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
index 39ffc138..b07852f0 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_config_trace_v3_Tracing_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_trace_v3_http_tracer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.trace.v3.Tracing");
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_Tracing_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_http_tracer_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.Tracing");
}
-UPB_INLINE const upb_msgdef *envoy_config_trace_v3_Tracing_Http_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_config_trace_v3_http_tracer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.config.trace.v3.Tracing.Http");
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_Tracing_Http_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_http_tracer_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.Tracing.Http");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c
new file mode 100644
index 00000000..28f21211
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c
@@ -0,0 +1,72 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/lightstep.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/lightstep.upbdefs.h"
+#include "envoy/config/trace/v3/lightstep.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[883] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'l',
+'i', 'g', 'h', 't', 's', 't', 'e', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v',
+'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o',
+'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\257', '\003', '\n', '\017', 'L', 'i', 'g', 'h', 't', 's', 't', 'e', 'p', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '4', '\n', '\021', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\020', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', 'C', 'l', 'u',
+'s', 't', 'e', 'r', '\022', '7', '\n', '\021', 'a', 'c', 'c', 'e', 's', 's', '_', 't', 'o', 'k', 'e', 'n', '_', 'f', 'i', 'l', 'e',
+'\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\017', 'a', 'c', 'c', 'e',
+'s', 's', 'T', 'o', 'k', 'e', 'n', 'F', 'i', 'l', 'e', '\022', 'C', '\n', '\014', 'a', 'c', 'c', 'e', 's', 's', '_', 't', 'o', 'k',
+'e', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\013', 'a', 'c', 'c', 'e', 's', 's',
+'T', 'o', 'k', 'e', 'n', '\022', 'r', '\n', '\021', 'p', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'i', 'o', 'n', '_', 'm', 'o', 'd', 'e',
+'s', '\030', '\003', ' ', '\003', '(', '\016', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
+'a', 'c', 'e', '.', 'v', '3', '.', 'L', 'i', 'g', 'h', 't', 's', 't', 'e', 'p', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'P', 'r',
+'o', 'p', 'a', 'g', 'a', 't', 'i', 'o', 'n', 'M', 'o', 'd', 'e', 'B', '\r', '\372', 'B', '\n', '\222', '\001', '\007', '\"', '\005', '\202', '\001',
+'\002', '\020', '\001', 'R', '\020', 'p', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'i', 'o', 'n', 'M', 'o', 'd', 'e', 's', '\"', 'F', '\n', '\017',
+'P', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'i', 'o', 'n', 'M', 'o', 'd', 'e', '\022', '\t', '\n', '\005', 'E', 'N', 'V', 'O', 'Y', '\020',
+'\000', '\022', '\r', '\n', '\t', 'L', 'I', 'G', 'H', 'T', 'S', 'T', 'E', 'P', '\020', '\001', '\022', '\006', '\n', '\002', 'B', '3', '\020', '\002', '\022',
+'\021', '\n', '\r', 'T', 'R', 'A', 'C', 'E', '_', 'C', 'O', 'N', 'T', 'E', 'X', 'T', '\020', '\003', ':', ',', '\232', '\305', '\210', '\036', '\'',
+'\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2', '.', 'L',
+'i', 'g', 'h', 't', 's', 't', 'e', 'p', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\267', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c',
+'e', '.', 'v', '3', 'B', '\016', 'L', 'i', 'g', 'h', 't', 's', 't', 'e', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g',
+'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c',
+'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g',
+'/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', ',', '\022', '*',
+'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r', 's', '.',
+'l', 'i', 'g', 'h', 't', 's', 't', 'e', 'p', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_lightstep_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_lightstep_proto_upb_file_layout,
+ "envoy/config/trace/v3/lightstep.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 883)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h
new file mode 100644
index 00000000..ef0adf48
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/lightstep.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_lightstep_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_LightstepConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_lightstep_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.LightstepConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_LIGHTSTEP_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c
new file mode 100644
index 00000000..1b429cf3
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c
@@ -0,0 +1,99 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/opencensus.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/opencensus.upbdefs.h"
+#include "envoy/config/trace/v3/opencensus.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init opencensus_proto_trace_v1_trace_config_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[1559] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'o',
+'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p',
+'r', 'o', 't', 'o', '\032', ',', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '/', 'p', 'r', 'o', 't', 'o', '/', 't', 'r',
+'a', 'c', 'e', '/', 'v', '1', '/', 't', 'r', 'a', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e',
+'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
+'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\263', '\010', '\n', '\020', 'O', 'p', 'e', 'n', 'C', 'e', 'n', 's', 'u', 's',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', 'I', '\n', '\014', 't', 'r', 'a', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '&', '.', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r',
+'a', 'c', 'e', '.', 'v', '1', '.', 'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 't', 'r', 'a', 'c', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '6', '\n', '\027', 's', 't', 'd', 'o', 'u', 't', '_', 'e', 'x', 'p', 'o', 'r', 't', 'e', 'r',
+'_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\025', 's', 't', 'd', 'o', 'u', 't', 'E', 'x', 'p',
+'o', 'r', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', '@', '\n', '\034', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v',
+'e', 'r', '_', 'e', 'x', 'p', 'o', 'r', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010',
+'R', '\032', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', 'E', 'x', 'p', 'o', 'r', 't', 'e', 'r', 'E', 'n', 'a', 'b',
+'l', 'e', 'd', '\022', '4', '\n', '\026', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', '_', 'p', 'r', 'o', 'j', 'e', 'c',
+'t', '_', 'i', 'd', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\024', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', 'P', 'r',
+'o', 'j', 'e', 'c', 't', 'I', 'd', '\022', '/', '\n', '\023', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', '_', 'a', 'd',
+'d', 'r', 'e', 's', 's', '\030', '\n', ' ', '\001', '(', '\t', 'R', '\022', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', 'A',
+'d', 'd', 'r', 'e', 's', 's', '\022', '[', '\n', '\030', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', '_', 'g', 'r', 'p',
+'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\r', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e',
+'R', '\026', 's', 't', 'a', 'c', 'k', 'd', 'r', 'i', 'v', 'e', 'r', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022',
+'C', '\n', '\027', 'z', 'i', 'p', 'k', 'i', 'n', '_', 'e', 'x', 'p', 'o', 'r', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e',
+'d', '\030', '\005', ' ', '\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\025', 'z', 'i', 'p',
+'k', 'i', 'n', 'E', 'x', 'p', 'o', 'r', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', '*', '\n', '\n', 'z', 'i', 'p',
+'k', 'i', 'n', '_', 'u', 'r', 'l', '\030', '\006', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.',
+'0', 'R', '\t', 'z', 'i', 'p', 'k', 'i', 'n', 'U', 'r', 'l', '\022', '8', '\n', '\030', 'o', 'c', 'a', 'g', 'e', 'n', 't', '_', 'e',
+'x', 'p', 'o', 'r', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\013', ' ', '\001', '(', '\010', 'R', '\026', 'o', 'c',
+'a', 'g', 'e', 'n', 't', 'E', 'x', 'p', 'o', 'r', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', '\'', '\n', '\017', 'o',
+'c', 'a', 'g', 'e', 'n', 't', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\014', ' ', '\001', '(', '\t', 'R', '\016', 'o', 'c', 'a',
+'g', 'e', 'n', 't', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', 'S', '\n', '\024', 'o', 'c', 'a', 'g', 'e', 'n', 't', '_', 'g', 'r',
+'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\016', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c',
+'e', 'R', '\022', 'o', 'c', 'a', 'g', 'e', 'n', 't', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'j', '\n', '\026',
+'i', 'n', 'c', 'o', 'm', 'i', 'n', 'g', '_', 't', 'r', 'a', 'c', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\010', ' ',
+'\003', '(', '\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.',
+'v', '3', '.', 'O', 'p', 'e', 'n', 'C', 'e', 'n', 's', 'u', 's', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'T', 'r', 'a', 'c', 'e',
+'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\024', 'i', 'n', 'c', 'o', 'm', 'i', 'n', 'g', 'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n',
+'t', 'e', 'x', 't', '\022', 'j', '\n', '\026', 'o', 'u', 't', 'g', 'o', 'i', 'n', 'g', '_', 't', 'r', 'a', 'c', 'e', '_', 'c', 'o',
+'n', 't', 'e', 'x', 't', '\030', '\t', ' ', '\003', '(', '\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '.', 'O', 'p', 'e', 'n', 'C', 'e', 'n', 's', 'u', 's', 'C', 'o', 'n', 'f',
+'i', 'g', '.', 'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\024', 'o', 'u', 't', 'g', 'o', 'i', 'n', 'g',
+'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', '\"', '`', '\n', '\014', 'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n', 't',
+'e', 'x', 't', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\021', '\n', '\r', 'T', 'R', 'A', 'C', 'E', '_', 'C', 'O',
+'N', 'T', 'E', 'X', 'T', '\020', '\001', '\022', '\022', '\n', '\016', 'G', 'R', 'P', 'C', '_', 'T', 'R', 'A', 'C', 'E', '_', 'B', 'I', 'N',
+'\020', '\002', '\022', '\027', '\n', '\023', 'C', 'L', 'O', 'U', 'D', '_', 'T', 'R', 'A', 'C', 'E', '_', 'C', 'O', 'N', 'T', 'E', 'X', 'T',
+'\020', '\003', '\022', '\006', '\n', '\002', 'B', '3', '\020', '\004', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2', '.', 'O', 'p', 'e', 'n', 'C', 'e', 'n', 's', 'u',
+'s', 'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\007', '\020', '\010', 'B', '\271', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e',
+'.', 'v', '3', 'B', '\017', 'O', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g',
+'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c',
+'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g',
+'/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', '-', '\022', '+',
+'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r', 's', '.',
+'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &opencensus_proto_trace_v1_trace_config_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_opencensus_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_opencensus_proto_upb_file_layout,
+ "envoy/config/trace/v3/opencensus.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1559)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h
new file mode 100644
index 00000000..b9e28687
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/opencensus.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_opencensus_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_OpenCensusConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_opencensus_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.OpenCensusConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_OPENCENSUS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c
new file mode 100644
index 00000000..cee13e62
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/service.upbdefs.h"
+#include "envoy/config/trace/v3/service.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[486] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
+'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\225', '\001', '\n', '\022', 'T', 'r', 'a',
+'c', 'e', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\014', 'g', 'r', 'p', 'c', '_', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'g', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', ':', '/', '\232', '\305', '\210',
+'\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2',
+'.', 'T', 'r', 'a', 'c', 'e', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\203', '\001', '\n', '#', 'i',
+'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\014', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[5] = {
+ &envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_service_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_service_proto_upb_file_layout,
+ "envoy/config/trace/v3/service.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 486)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h
new file mode 100644
index 00000000..d427898f
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/service.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_service_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_TraceServiceConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_service_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.TraceServiceConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_SERVICE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c
new file mode 100644
index 00000000..f1784856
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c
@@ -0,0 +1,71 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/skywalking.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/skywalking.upbdefs.h"
+#include "envoy/config/trace/v3/skywalking.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_grpc_service_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[860] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 's',
+'k', 'y', 'w', 'a', 'l', 'k', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a',
+'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\254', '\001', '\n', '\020', 'S', 'k', 'y', 'W', 'a', 'l', 'k', 'i', 'n', 'g', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', 'N', '\n', '\014', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'G', 'r', 'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'g', 'r',
+'p', 'c', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'H', '\n', '\r', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'o', 'n', 'f', 'i',
+'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
+'a', 'c', 'e', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\014', 'c', 'l', 'i', 'e',
+'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\344', '\001', '\n', '\014', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's',
+'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '_', 'n', 'a',
+'m', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e', '\022', '-', '\n',
+'\r', 'b', 'a', 'c', 'k', 'e', 'n', 'd', '_', 't', 'o', 'k', 'e', 'n', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\006', '\270', '\267', '\213',
+'\244', '\002', '\001', 'H', '\000', 'R', '\014', 'b', 'a', 'c', 'k', 'e', 'n', 'd', 'T', 'o', 'k', 'e', 'n', '\022', 'B', '\n', '\016', 'm', 'a',
+'x', '_', 'c', 'a', 'c', 'h', 'e', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\014',
+'m', 'a', 'x', 'C', 'a', 'c', 'h', 'e', 'S', 'i', 'z', 'e', 'B', '\031', '\n', '\027', 'b', 'a', 'c', 'k', 'e', 'n', 'd', '_', 't',
+'o', 'k', 'e', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\271', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c',
+'e', '.', 'v', '3', 'B', '\017', 'S', 'k', 'y', 'w', 'a', 'l', 'k', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-',
+'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', '-', '\022',
+'+', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r', 's',
+'.', 's', 'k', 'y', 'w', 'a', 'l', 'k', 'i', 'n', 'g', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &envoy_config_core_v3_grpc_service_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_sensitive_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_skywalking_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_skywalking_proto_upb_file_layout,
+ "envoy/config/trace/v3/skywalking.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 860)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h
new file mode 100644
index 00000000..b02a71ce
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/skywalking.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_skywalking_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_SkyWalkingConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_skywalking_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.SkyWalkingConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_ClientConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_skywalking_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.ClientConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_SKYWALKING_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c
new file mode 100644
index 00000000..60cfbd87
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c
@@ -0,0 +1,57 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/trace.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/trace.upbdefs.h"
+#include "envoy/config/trace/v3/trace.upb.h"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_datadog_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_dynamic_ot_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_lightstep_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_opencensus_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_service_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_zipkin_proto_upbdefinit;
+static const char descriptor[473] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 't',
+'r', 'a', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'t', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r',
+'a', 'c', 'e', '/', 'v', '3', '/', 'd', 'a', 't', 'a', 'd', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'd', 'y', 'n', 'a', 'm', 'i',
+'c', '_', 'o', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
+'t', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't',
+'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/',
+'l', 'i', 'g', 'h', 't', 's', 't', 'e', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
+'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.',
+'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e',
+'/', 'v', '3', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/',
+'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'z', 'i', 'p', 'k', 'i', 'n', '.', 'p', 'r',
+'o', 't', 'o', 'B', 'y', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\n', 'T', 'r', 'a', 'c', 'e', 'P',
+'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v',
+'3', 'P', '\000', 'P', '\001', 'P', '\002', 'P', '\003', 'P', '\004', 'P', '\005', 'P', '\006', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[8] = {
+ &envoy_config_trace_v3_datadog_proto_upbdefinit,
+ &envoy_config_trace_v3_dynamic_ot_proto_upbdefinit,
+ &envoy_config_trace_v3_http_tracer_proto_upbdefinit,
+ &envoy_config_trace_v3_lightstep_proto_upbdefinit,
+ &envoy_config_trace_v3_opencensus_proto_upbdefinit,
+ &envoy_config_trace_v3_service_proto_upbdefinit,
+ &envoy_config_trace_v3_zipkin_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_trace_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_trace_proto_upb_file_layout,
+ "envoy/config/trace/v3/trace.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 473)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h
new file mode 100644
index 00000000..29800681
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h
@@ -0,0 +1,30 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/trace.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_trace_proto_upbdefinit;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_TRACE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c
new file mode 100644
index 00000000..a4d7e5de
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c
@@ -0,0 +1,75 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/xray.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/xray.upbdefs.h"
+#include "envoy/config/trace/v3/xray.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[906] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'x',
+'r', 'a', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't',
+'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
+'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'m', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p',
+'r', 'o', 't', 'o', '\"', '\270', '\003', '\n', '\n', 'X', 'R', 'a', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\017', 'd', 'a',
+'e', 'm', 'o', 'n', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'o', 'c', 'k', 'e', 't', 'A',
+'d', 'd', 'r', 'e', 's', 's', 'R', '\016', 'd', 'a', 'e', 'm', 'o', 'n', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '*', '\n',
+'\014', 's', 'e', 'g', 'm', 'e', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
+'\002', '\020', '\001', 'R', '\013', 's', 'e', 'g', 'm', 'e', 'n', 't', 'N', 'a', 'm', 'e', '\022', 'V', '\n', '\026', 's', 'a', 'm', 'p', 'l',
+'i', 'n', 'g', '_', 'r', 'u', 'l', 'e', '_', 'm', 'a', 'n', 'i', 'f', 'e', 's', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't',
+'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\024', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', 'R', 'u', 'l', 'e', 'M', 'a', 'n', 'i',
+'f', 'e', 's', 't', '\022', 'V', '\n', '\016', 's', 'e', 'g', 'm', 'e', 'n', 't', '_', 'f', 'i', 'e', 'l', 'd', 's', '\030', '\004', ' ',
+'\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.',
+'v', '3', '.', 'X', 'R', 'a', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'F', 'i', 'e', 'l',
+'d', 's', 'R', '\r', 's', 'e', 'g', 'm', 'e', 'n', 't', 'F', 'i', 'e', 'l', 'd', 's', '\032', 'R', '\n', '\r', 'S', 'e', 'g', 'm',
+'e', 'n', 't', 'F', 'i', 'e', 'l', 'd', 's', '\022', '\026', '\n', '\006', 'o', 'r', 'i', 'g', 'i', 'n', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\006', 'o', 'r', 'i', 'g', 'i', 'n', '\022', ')', '\n', '\003', 'a', 'w', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\003', 'a', 'w',
+'s', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
+'a', 'c', 'e', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'X', 'R', 'a', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\255', '\001',
+'\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\t', 'X', 'r', 'a', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r', 'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005',
+'\'', '\022', '%', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e',
+'r', 's', '.', 'x', 'r', 'a', 'y', '.', 'v', '4', 'a', 'l', 'p', 'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
+'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[8] = {
+ &envoy_config_core_v3_address_proto_upbdefinit,
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &google_protobuf_struct_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_xray_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_xray_proto_upb_file_layout,
+ "envoy/config/trace/v3/xray.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 906)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h
new file mode 100644
index 00000000..2f09f1ba
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/xray.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_xray_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_XRayConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_xray_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.XRayConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_XRayConfig_SegmentFields_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_xray_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.XRayConfig.SegmentFields");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_XRAY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c
new file mode 100644
index 00000000..2a4b7238
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c
@@ -0,0 +1,77 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/zipkin.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/trace/v3/zipkin.upbdefs.h"
+#include "envoy/config/trace/v3/zipkin.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1018] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'z',
+'i', 'p', 'k', 'i', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g',
+'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\"', '\300', '\004', '\n', '\014', 'Z', 'i', 'p', 'k', 'i', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '4', '\n', '\021', 'c', 'o', 'l',
+'l', 'e', 'c', 't', 'o', 'r', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
+'r', '\002', '\020', '\001', 'R', '\020', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', '6', '\n',
+'\022', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\002', ' ', '\001', '(', '\t',
+'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\021', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'o', 'r', 'E', 'n', 'd', 'p', 'o',
+'i', 'n', 't', '\022', '&', '\n', '\017', 't', 'r', 'a', 'c', 'e', '_', 'i', 'd', '_', '1', '2', '8', 'b', 'i', 't', '\030', '\003', ' ',
+'\001', '(', '\010', 'R', '\r', 't', 'r', 'a', 'c', 'e', 'I', 'd', '1', '2', '8', 'b', 'i', 't', '\022', 'J', '\n', '\023', 's', 'h', 'a',
+'r', 'e', 'd', '_', 's', 'p', 'a', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
+'R', '\021', 's', 'h', 'a', 'r', 'e', 'd', 'S', 'p', 'a', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'z', '\n', '\032', 'c', 'o',
+'l', 'l', 'e', 'c', 't', 'o', 'r', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030',
+'\005', ' ', '\001', '(', '\016', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c',
+'e', '.', 'v', '3', '.', 'Z', 'i', 'p', 'k', 'i', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+'o', 'r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\030', 'c', 'o', 'l', 'l', 'e', 'c',
+'t', 'o', 'r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '-', '\n', '\022', 'c', 'o', 'l',
+'l', 'e', 'c', 't', 'o', 'r', '_', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\021', 'c', 'o',
+'l', 'l', 'e', 'c', 't', 'o', 'r', 'H', 'o', 's', 't', 'n', 'a', 'm', 'e', '\"', 'x', '\n', '\030', 'C', 'o', 'l', 'l', 'e', 'c',
+'t', 'o', 'r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '3', '\n', '%', 'D', 'E', 'P',
+'R', 'E', 'C', 'A', 'T', 'E', 'D', '_', 'A', 'N', 'D', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '_', 'D',
+'O', '_', 'N', 'O', 'T', '_', 'U', 'S', 'E', '\020', '\000', '\032', '\010', '\010', '\001', '\250', '\367', '\264', '\213', '\002', '\001', '\022', '\r', '\n', '\t',
+'H', 'T', 'T', 'P', '_', 'J', 'S', 'O', 'N', '\020', '\001', '\022', '\016', '\n', '\n', 'H', 'T', 'T', 'P', '_', 'P', 'R', 'O', 'T', 'O',
+'\020', '\002', '\022', '\010', '\n', '\004', 'G', 'R', 'P', 'C', '\020', '\003', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '2', '.', 'Z', 'i', 'p', 'k', 'i', 'n', 'C',
+'o', 'n', 'f', 'i', 'g', 'B', '\261', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', 'B', '\013', 'Z', 'i', 'p',
+'k', 'i', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'D', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e',
+'/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', ';', 't', 'r',
+'a', 'c', 'e', 'v', '3', '\362', '\230', '\376', '\217', '\005', ')', '\022', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'c', 'e', 'r', 's', '.', 'z', 'i', 'p', 'k', 'i', 'n', '.', 'v', '4', 'a', 'l', 'p',
+'h', 'a', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[7] = {
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_config_trace_v3_zipkin_proto_upbdefinit = {
+ deps,
+ &envoy_config_trace_v3_zipkin_proto_upb_file_layout,
+ "envoy/config/trace/v3/zipkin.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1018)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h
new file mode 100644
index 00000000..29dbd24f
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/trace/v3/zipkin.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_config_trace_v3_zipkin_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_config_trace_v3_ZipkinConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_config_trace_v3_zipkin_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.config.trace.v3.ZipkinConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_TRACE_V3_ZIPKIN_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
index d159a992..ae5023a6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h"
+#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit,
-};
-
-static const char descriptor[389] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'c', 'l', 'u', 's', 't', 'e',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[481] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'c', 'l', 'u', 's', 't', 'e',
'r', 's', '/', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p',
'r', 'o', 't', 'o', '\022', '&', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l',
'u', 's', 't', 'e', 'r', 's', '.', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a',
@@ -30,22 +25,26 @@ static const char descriptor[389] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'\222', '\001', '\002', '\010', '\001', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'a', 'g', 'g', 'r', 'e',
'g', 'a', 't', 'e', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
-'g', 'B', 'N', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '.', 'a', 'g', 'g', 'r', 'e',
-'g', 'a', 't', 'e', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'g', 'B', '\251', '\001', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '.', 'a', 'g', 'g', 'r',
+'e', 'g', 'a', 't', 'e', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'Y', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '/', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e',
+'/', 'v', '3', ';', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
+'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout,
"envoy/extensions/clusters/aggregate/v3/cluster.proto",
- UPB_STRVIEW_INIT(descriptor, 389)
+ UPB_STRINGVIEW_INIT(descriptor, 481)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
index fd6d1b87..2e7ac1d6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_clusters_aggregate_v3_ClusterConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.clusters.aggregate.v3.ClusterConfig");
+UPB_INLINE const upb_MessageDef *envoy_extensions_clusters_aggregate_v3_ClusterConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.clusters.aggregate.v3.ClusterConfig");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
index 1ee8a911..6a8aeb9b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
@@ -8,27 +8,14 @@
#include "upb/def.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upbdefs.h"
+#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
-};
-
-static const char descriptor[1354] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1444] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'c', 'o', 'm', 'm', 'o', 'n', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', '/', 'f', 'a', 'u', 'l', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', '(', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i',
'l', 't', 'e', 'r', 's', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', '\032', '\033', 'e', 'n',
@@ -78,14 +65,17 @@ static const char descriptor[1354] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', '
'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'L', 'i', 'm', 'i', 't', ':', '2', '\232', '\305', '\210',
'\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'f',
'a', 'u', 'l', 't', '.', 'v', '2', '.', 'F', 'a', 'u', 'l', 't', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'B', '\021', '\n',
-'\n', 'l', 'i', 'm', 'i', 't', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', 'N', '\n', '6', 'i', 'o', '.', 'e', 'n',
-'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
-'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', 'B',
-'\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'\n', 'l', 'i', 'm', 'i', 't', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\247', '\001', '\n', '6', 'i', 'o', '.', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
+'s', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3',
+'B', '\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'W', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l',
+'t', 'e', 'r', 's', '/', 'c', 'o', 'm', 'm', 'o', 'n', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', ';', 'f', 'a', 'u', 'l',
+'t', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -94,9 +84,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout,
"envoy/extensions/filters/common/fault/v3/fault.proto",
- UPB_STRVIEW_INIT(descriptor, 1354)
+ UPB_STRINGVIEW_INIT(descriptor, 1444)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h
index f3d64b4f..10c7aad7 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h
@@ -19,31 +19,31 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_common_fault_v3_FaultDelay_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.common.fault.v3.FaultDelay");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultDelay_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.common.fault.v3.FaultDelay");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.common.fault.v3.FaultDelay.HeaderDelay");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.common.fault.v3.FaultDelay.HeaderDelay");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit.FixedLimit");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit.FixedLimit");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit.HeaderLimit");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.common.fault.v3.FaultRateLimit.HeaderLimit");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
index cd46e935..80db92e7 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
@@ -8,25 +8,16 @@
#include "upb/def.h"
#include "envoy/extensions/filters/http/fault/v3/fault.upbdefs.h"
+#include "envoy/extensions/filters/http/fault/v3/fault.upb.h"
-extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
-extern upb_def_init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_HTTPFault_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
- &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
- &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit,
-};
-
-static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+extern _upb_DefPool_Init envoy_config_route_v3_route_components_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1973] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'h', 't', 't', 'p', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', '/', 'f', 'a', 'u', 'l', 't', '.', 'p', 'r', 'o',
't', 'o', '\022', '&', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/',
@@ -56,7 +47,7 @@ static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', '
'r', 't', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'A', 'b', 'o', 'r', 't', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n',
'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h', 't', 't', 'p', '.', 'f', 'a',
'u', 'l', 't', '.', 'v', '2', '.', 'F', 'a', 'u', 'l', 't', 'A', 'b', 'o', 'r', 't', 'B', '\021', '\n', '\n', 'e', 'r', 'r', 'o',
-'r', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\274', '\007', '\n', '\t', 'H', 'T', 'T',
+'r', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\205', '\010', '\n', '\t', 'H', 'T', 'T',
'P', 'F', 'a', 'u', 'l', 't', '\022', 'J', '\n', '\005', 'd', 'e', 'l', 'a', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '4', '.', 'e',
'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'c',
'o', 'm', 'm', 'o', 'n', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', '.', 'F', 'a', 'u', 'l', 't', 'D', 'e', 'l', 'a', 'y',
@@ -92,16 +83,22 @@ static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', '
'e', '\030', '\r', ' ', '\001', '(', '\t', 'R', '\037', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i',
't', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '9', '\n', '\031', 'a', 'b', 'o', 'r', 't', '_',
'g', 'r', 'p', 'c', '_', 's', 't', 'a', 't', 'u', 's', '_', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\030', '\016', ' ', '\001', '(', '\t',
-'R', '\026', 'a', 'b', 'o', 'r', 't', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'R', 'u', 'n', 't', 'i', 'm', 'e', ':',
-'2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't',
-'e', 'r', '.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '2', '.', 'H', 'T', 'T', 'P', 'F', 'a', 'u', 'l',
-'t', 'B', 'L', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f',
-'a', 'u', 'l', 't', '.', 'v', '3', 'B', '\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321',
-'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\026', 'a', 'b', 'o', 'r', 't', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022',
+'G', '\n', ' ', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '\017', ' ', '\001', '(', '\010', 'R', '\035', 'd', 'i', 's', 'a', 'b', 'l', 'e',
+'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', ':', '2', '\232',
+'\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '2', '.', 'H', 'T', 'T', 'P', 'F', 'a', 'u', 'l', 't', 'B',
+'\243', '\001', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
+'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f', 'a',
+'u', 'l', 't', '.', 'v', '3', 'B', '\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'U', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n',
+'t', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r', 's', '/', 'h', 't', 't', 'p', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', ';',
+'f', 'a', 'u', 'l', 't', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[8] = {
&envoy_config_route_v3_route_components_proto_upbdefinit,
&envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
@@ -112,9 +109,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout,
"envoy/extensions/filters/http/fault/v3/fault.proto",
- UPB_STRVIEW_INIT(descriptor, 1812)
+ UPB_STRINGVIEW_INIT(descriptor, 1973)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h
index 0beb986b..36ef3015 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_http_fault_v3_FaultAbort_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.http.fault.v3.FaultAbort");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_fault_v3_FaultAbort_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.fault.v3.FaultAbort");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.http.fault.v3.FaultAbort.HeaderAbort");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.fault.v3.FaultAbort.HeaderAbort");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_http_fault_v3_HTTPFault_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.http.fault.v3.HTTPFault");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_fault_v3_HTTPFault_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.fault.v3.HTTPFault");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
new file mode 100644
index 00000000..97a37efd
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
@@ -0,0 +1,59 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h"
+#include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h"
+
+extern _upb_DefPool_Init envoy_config_rbac_v3_rbac_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[725] = {'\n', '0', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+'s', '/', 'h', 't', 't', 'p', '/', 'r', 'b', 'a', 'c', '/', 'v', '3', '/', 'r', 'b', 'a', 'c', '.', 'p', 'r', 'o', 't', 'o',
+'\022', '%', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'s', '.', 'h', 't', 't', 'p', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'r', 'b', 'a', 'c', '/', 'v', '3', '/', 'r', 'b', 'a', 'c', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u',
+'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
+'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r',
+'s', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\336', '\001', '\n', '\004', 'R', 'B', 'A', 'C', '\022', '0', '\n',
+'\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C', 'R', '\005', 'r', 'u', 'l', 'e', 's', '\022', '=', '\n',
+'\014', 's', 'h', 'a', 'd', 'o', 'w', '_', 'r', 'u', 'l', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C', 'R', '\013', 's',
+'h', 'a', 'd', 'o', 'w', 'R', 'u', 'l', 'e', 's', '\022', '7', '\n', '\030', 's', 'h', 'a', 'd', 'o', 'w', '_', 'r', 'u', 'l', 'e',
+'s', '_', 's', 't', 'a', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\025', 's', 'h', 'a', 'd',
+'o', 'w', 'R', 'u', 'l', 'e', 's', 'S', 't', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n',
+'%', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h', 't', 't', 'p',
+'.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'R', 'B', 'A', 'C', '\"', '\213', '\001', '\n', '\014', 'R', 'B', 'A', 'C', 'P', 'e', 'r',
+'R', 'o', 'u', 't', 'e', '\022', '?', '\n', '\004', 'r', 'b', 'a', 'c', '\030', '\002', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't',
+'p', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', '.', 'R', 'B', 'A', 'C', 'R', '\004', 'r', 'b', 'a', 'c', ':', '4', '\232', '\305', '\210',
+'\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h',
+'t', 't', 'p', '.', 'r', 'b', 'a', 'c', '.', 'v', '2', '.', 'R', 'B', 'A', 'C', 'P', 'e', 'r', 'R', 'o', 'u', 't', 'e', 'J',
+'\004', '\010', '\001', '\020', '\002', 'B', '\237', '\001', '\n', '3', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h',
+'t', 't', 'p', '.', 'r', 'b', 'a', 'c', '.', 'v', '3', 'B', '\t', 'R', 'b', 'a', 'c', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'S', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r', 's', '/', 'h', 't', 't', 'p', '/', 'r', 'b', 'a', 'c', '/',
+'v', '3', ';', 'r', 'b', 'a', 'c', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &envoy_config_rbac_v3_rbac_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_extensions_filters_http_rbac_v3_rbac_proto_upbdefinit = {
+ deps,
+ &envoy_extensions_filters_http_rbac_v3_rbac_proto_upb_file_layout,
+ "envoy/extensions/filters/http/rbac/v3/rbac.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 725)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h
new file mode 100644
index 00000000..94c0a4f7
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/filters/http/rbac/v3/rbac.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_
+#define ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_extensions_filters_http_rbac_v3_rbac_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_rbac_v3_RBAC_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.rbac.v3.RBAC");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_rbac_v3_RBACPerRoute_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_rbac_v3_rbac_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.rbac.v3.RBACPerRoute");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_RBAC_V3_RBAC_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
index f1d9a578..f300fcbf 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
@@ -8,19 +8,14 @@
#include "upb/def.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
+#include "envoy/extensions/filters/http/router/v3/router.upb.h"
-extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_extensions_filters_http_router_v3_Router_msginit,
-};
-
-static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1086] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'h', 't', 't', 'p', '/', 'r', 'o', 'u', 't', 'e', 'r', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', 'r', '.', 'p',
'r', 'o', 't', 'o', '\022', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i',
'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '3', '\032', ')', 'e', 'n', 'v',
@@ -30,7 +25,7 @@ static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\255', '\004', '\n', '\006', 'R', 'o', 'u', 't', 'e', 'r', '\022', '?', '\n',
+'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\204', '\005', '\n', '\006', 'R', 'o', 'u', 't', 'e', 'r', '\022', '?', '\n',
'\r', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 's', 't', 'a', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\014',
'd', 'y', 'n', 'a', 'm', 'i', 'c', 'S', 't', 'a', 't', 's', '\022', '(', '\n', '\020', 's', 't', 'a', 'r', 't', '_', 'c', 'h', 'i',
@@ -50,16 +45,23 @@ static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'n', 'v', 'o', 'y', '-', 'r', 'e', 't', 'r', 'y', '-', 'o', 'n', 'R', '\022', 's', 't', 'r', 'i', 'c', 't', 'C', 'h', 'e', 'c',
'k', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '=', '\n', '\033', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'e', 'x', 'p', 'e', 'c',
't', 'e', 'd', '_', 'r', 'q', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\030', 'r', 'e', 's',
-'p', 'e', 'c', 't', 'E', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'R', 'q', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '0', '\232', '\305',
-'\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
-'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'r', 'B', 'N', '\n', '5',
-'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r',
-'.', 'v', '3', 'B', '\013', 'R', 'o', 'u', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'p', 'e', 'c', 't', 'E', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'R', 'q', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'U', '\n', '(',
+'s', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'g', 'r', 'p', 'c', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'f', 'a', 'i',
+'l', 'u', 'r', 'e', '_', 'c', 'o', 'd', 'e', '_', 's', 't', 'a', 't', 's', '\030', '\007', ' ', '\001', '(', '\010', 'R', '#', 's', 'u',
+'p', 'p', 'r', 'e', 's', 's', 'G', 'r', 'p', 'c', 'R', 'e', 'q', 'u', 'e', 's', 't', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'C',
+'o', 'd', 'e', 'S', 't', 'a', 't', 's', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v',
+'2', '.', 'R', 'o', 'u', 't', 'e', 'r', 'B', '\247', '\001', '\n', '5', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'s', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '3', 'B', '\013', 'R', 'o', 'u', 't', 'e', 'r', 'P',
+'r', 'o', 't', 'o', 'P', '\001', 'Z', 'W', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v',
+'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r', 's', '/', 'h', 't', 't',
+'p', '/', 'r', 'o', 'u', 't', 'e', 'r', '/', 'v', '3', ';', 'r', 'o', 'u', 't', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -68,9 +70,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout,
"envoy/extensions/filters/http/router/v3/router.proto",
- UPB_STRVIEW_INIT(descriptor, 909)
+ UPB_STRINGVIEW_INIT(descriptor, 1086)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
index dc91890e..323d4873 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_http_router_v3_Router_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_http_router_v3_router_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.http.router.v3.Router");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_router_v3_Router_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_router_v3_router_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.router.v3.Router");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
index 916044e9..421b18e3 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
@@ -8,65 +8,29 @@
#include "upb/def.h"
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
-extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_substitution_format_string_proto_upbdefinit;
-extern upb_def_init envoy_config_route_v3_route_proto_upbdefinit;
-extern upb_def_init envoy_config_route_v3_scoped_route_proto_upbdefinit;
-extern upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
-extern upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_security_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[17] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_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_UpgradeConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
- &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_KvElement_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
-};
-
-static const char descriptor[10141] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+extern _upb_DefPool_Init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_substitution_format_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_route_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_route_v3_scoped_route_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_http_v3_path_transformation_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[12166] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'n', 'e', 't', 'w', 'o', 'r', 'k', '/', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', ';', 'e', 'n', 'v', 'o', 'y', '.', 'e',
@@ -86,395 +50,476 @@ static const char descriptor[10141] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/',
'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '.', 'p', 'r', 'o',
't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3',
-'/', 'h', 't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't',
-'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p',
-'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
-'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g',
-'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n',
-'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\222', '+', '\n', '\025', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', '\205', '\001', '\n', '\n', 'c', 'o', 'd', 'e', 'c', '_', 't', 'y', 'p', 'e',
-'\030', '\001', ' ', '\001', '(', '\016', '2', '\\', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
-'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\t', 'c', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', '\022', '(', '\n', '\013',
-'s', 't', 'a', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\n', 's', 't', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'T', '\n', '\003', 'r', 'd', 's', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'd', 's', 'H', '\000', 'R', '\003', 'r', 'd', 's', '\022',
-'N', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't',
-'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', 'p', '\n', '\r', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', 's', '\030', '\037', ' ', '\001',
-'(', '\013', '2', 'I', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
+'/', 'h', 't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y',
+'/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', '/', 'p', 'a', 't', 'h', '_', 't', 'r', 'a', 'n', 's', 'f',
+'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p',
+'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e',
+'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'s', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\221', '8', '\n', '\025', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
+'a', 'n', 'a', 'g', 'e', 'r', '\022', '\205', '\001', '\n', '\n', 'c', 'o', 'd', 'e', 'c', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001',
+'(', '\016', '2', '\\', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't',
-'e', 's', 'H', '\000', 'R', '\014', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', 'j', '\n', '\014', 'h', 't', 't',
-'p', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
-'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '3', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\013', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r',
-'s', '\022', '@', '\n', '\016', 'a', 'd', 'd', '_', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '\030', '\006', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\014', 'a', 'd', 'd', 'U', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', '\022', 't', '\n', '\007', 't', 'r', 'a', 'c',
-'i', 'n', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B',
+'\005', '\202', '\001', '\002', '\020', '\001', 'R', '\t', 'c', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', '\022', '(', '\n', '\013', 's', 't', 'a', 't',
+'_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 's',
+'t', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'T', '\n', '\003', 'r', 'd', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '@', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.',
+'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'd', 's', 'H', '\000', 'R', '\003', 'r', 'd', 's', '\022', 'N', '\n', '\014', 'r',
+'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'p', '\n', '\r', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', 's', '\030', '\037', ' ', '\001', '(', '\013', '2', 'I',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's',
+'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'H', '\000',
+'R', '\014', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', 'j', '\n', '\014', 'h', 't', 't', 'p', '_', 'f', 'i',
+'l', 't', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't',
+'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H',
+'t', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\013', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', '@', '\n',
+'\016', 'a', 'd', 'd', '_', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R',
+'\014', 'a', 'd', 'd', 'U', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', '\022', 't', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030',
+'\007', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't',
+'r', 'a', 'c', 'i', 'n', 'g', '\022', 's', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '#', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\031', 'c', 'o',
+'m', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '^',
+'\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\010',
+' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\023',
+'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'i', '\n', '\026', 'h', 't',
+'t', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\001', '(',
+'\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267',
+'*', '\002', '\010', '\001', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '`', '\n', '\026', 'h', 't', 't', 'p', '3', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o',
+'n', 's', '\030', ',', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
+'n', 's', 'R', '\024', 'h', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+',', '\n', '\013', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010',
+'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\n', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '\271', '\001', '\n', '\034',
+'s', 'e', 'r', 'v', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't',
+'i', 'o', 'n', '\030', '\"', ' ', '\001', '(', '\016', '2', 'm', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_',
'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't',
-'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n',
-'g', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 's', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p',
-'_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '#', ' ', '\001', '(', '\013', '2', ')',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't',
-'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001',
-'R', '\031', 'c', 'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', '\022', '^', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o',
-'n', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'i',
-'\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030',
-'\t', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B',
-'\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', ',', '\n', '\013', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(',
-'\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\n', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm',
-'e', '\022', '\271', '\001', '\n', '\034', 's', 'e', 'r', 'v', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 't', 'r', 'a', 'n', 's',
-'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\030', '\"', ' ', '\001', '(', '\016', '2', 'm', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
+'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S', 'e', 'r', 'v', 'e', 'r',
+'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\202', '\001', '\002', '\020', '\001', 'R', '\032', 's', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f',
+'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', 'r', '\n', '\034', 's', 'c', 'h', 'e', 'm', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
+'_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\030', '0', ' ', '\001', '(', '\013', '2', '0', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'c', 'h', 'e', 'm',
+'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'R', '\032', 's', 'c',
+'h', 'e', 'm', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022',
+']', '\n', '\026', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'k', 'b',
+'\030', '\035', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '*', '\005', '\030', '\200', '@', ' ', '\000', 'R', '\023',
+'m', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'K', 'b', '\022', 'R', '\n', '\023', 's', 't',
+'r', 'e', 'a', 'm', '_', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\021', 's', 't', 'r', 'e', 'a', 'm', 'I', 'd', 'l', 'e', 'T', 'i', 'm', 'e',
+'o', 'u', 't', '\022', 'K', '\n', '\017', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\034', ' ',
+'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
+'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i',
+'m', 'e', 'o', 'u', 't', '\022', 'b', '\n', '\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_',
+'t', 'i', 'm', 'e', 'o', 'u', 't', '\030', ')', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\017', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000',
+'\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'i',
+'m', 'e', 'o', 'u', 't', '\022', '>', '\n', '\r', 'd', 'r', 'a', 'i', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\014', ' ',
+'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
+'a', 't', 'i', 'o', 'n', 'R', '\014', 'd', 'r', 'a', 'i', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\025', 'd', 'e',
+'l', 'a', 'y', 'e', 'd', '_', 'c', 'l', 'o', 's', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\032', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'R', '\023', 'd', 'e', 'l', 'a', 'y', 'e', 'd', 'C', 'l', 'o', 's', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'C',
+'\n', '\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c',
+'e', 's', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'Q', '\n', '\022', 'u', 's', 'e', '_',
+'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\007',
+'\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\020', 'u', 's', 'e', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's',
+'\022', '/', '\n', '\024', 'x', 'f', 'f', '_', 'n', 'u', 'm', '_', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'h', 'o', 'p', 's', '\030',
+'\023', ' ', '\001', '(', '\r', 'R', '\021', 'x', 'f', 'f', 'N', 'u', 'm', 'T', 'r', 'u', 's', 't', 'e', 'd', 'H', 'o', 'p', 's', '\022',
+'s', '\n', ' ', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'i', 'p', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '.', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\035', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'I', 'p', 'D', 'e', 't',
+'e', 'c', 't', 'i', 'o', 'n', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\240', '\001', '\n', '\027', 'i', 'n', 't', 'e',
+'r', 'n', 'a', 'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\031', ' ', '\001', '(', '\013',
+'2', 'h', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 's', 'k', 'i', 'p', '_', 'x', 'f', 'f', '_', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\025',
+' ', '\001', '(', '\010', 'R', '\r', 's', 'k', 'i', 'p', 'X', 'f', 'f', 'A', 'p', 'p', 'e', 'n', 'd', '\022', '\035', '\n', '\003', 'v', 'i',
+'a', '\030', '\026', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\003', 'v', 'i', 'a',
+'\022', 'J', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', '\017',
+' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o',
+'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\021', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I',
+'d', '\022', '?', '\n', '\034', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', '_', 'e', 'x', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e',
+'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', ' ', ' ', '\001', '(', '\010', 'R', '\031', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'E',
+'x', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', '\022', 'G', '\n', '!', 'a', 'l', 'w', 'a', 'y',
+'s', '_', 's', 'e', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o',
+'n', 's', 'e', '\030', '%', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y', 's', 'S', 'e', 't', 'R', 'e', 'q', 'u', 'e',
+'s', 't', 'I', 'd', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '\264', '\001', '\n', '\033', 'f', 'o', 'r', 'w', 'a', 'r',
+'d', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\020', ' ', '\001',
+'(', '\016', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
+'t', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't',
+'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\030', 'f', 'o',
+'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\264', '\001',
+'\n', '\037', 's', 'e', 't', '_', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't',
+'_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\021', ' ', '\001', '(', '\013', '2', 'n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
+'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
+'3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S',
+'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l',
+'s', 'R', '\033', 's', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e',
+'t', 'a', 'i', 'l', 's', '\022', ',', '\n', '\022', 'p', 'r', 'o', 'x', 'y', '_', '1', '0', '0', '_', 'c', 'o', 'n', 't', 'i', 'n',
+'u', 'e', '\030', '\022', ' ', '\001', '(', '\010', 'R', '\020', 'p', 'r', 'o', 'x', 'y', '1', '0', '0', 'C', 'o', 'n', 't', 'i', 'n', 'u',
+'e', '\022', 'e', '\n', '1', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'i', 'p', 'v', '4', '_', 'r', 'e', 'm', 'o', 't',
+'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'a', 's', '_', 'i', 'p', 'v', '4', '_', 'm', 'a', 'p', 'p', 'e', 'd', '_',
+'i', 'p', 'v', '6', '\030', '\024', ' ', '\001', '(', '\010', 'R', '*', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', 'I', 'p', 'v', '4',
+'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', 'A', 's', 'I', 'p', 'v', '4', 'M', 'a', 'p', 'p', 'e', 'd',
+'I', 'p', 'v', '6', '\022', '\211', '\001', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030',
+'\027', ' ', '\003', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', 'A', '\n', '\016', 'n', 'o',
+'r', 'm', 'a', 'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '\030', '\036', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'n', 'o',
+'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', '\022', '#', '\n', '\r', 'm', 'e', 'r', 'g', 'e', '_', 's', 'l', 'a', 's',
+'h', 'e', 's', '\030', '!', ' ', '\001', '(', '\010', 'R', '\014', 'm', 'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', '\022', '\267',
+'\001', '\n', ' ', 'p', 'a', 't', 'h', '_', 'w', 'i', 't', 'h', '_', 'e', 's', 'c', 'a', 'p', 'e', 'd', '_', 's', 'l', 'a', 's',
+'h', 'e', 's', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '-', ' ', '\001', '(', '\016', '2', 'o', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r',
+'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'P', 'a', 't', 'h', 'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's', 'h', 'e', 's', 'A', 'c',
+'t', 'i', 'o', 'n', 'R', '\034', 'p', 'a', 't', 'h', 'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's',
+'h', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\201', '\001', '\n', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'S', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\032', 's', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r',
-'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', '\\', '\n', '\026', 'm', 'a', 'x', '_', 'r', 'e', 'q',
-'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'k', 'b', '\030', '\035', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
-'e', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '`', ' ', '\000', 'R', '\023', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H',
-'e', 'a', 'd', 'e', 'r', 's', 'K', 'b', '\022', 'R', '\n', '\023', 's', 't', 'r', 'e', 'a', 'm', '_', 'i', 'd', 'l', 'e', '_', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\021',
-'s', 't', 'r', 'e', 'a', 'm', 'I', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'K', '\n', '\017', 'r', 'e', 'q', 'u',
-'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\034', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*',
-'\002', '\010', '\001', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'b', '\n', '\027', 'r', 'e',
-'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', ')', ' ', '\001',
-'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'B', '\017', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\025', 'r', 'e',
-'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '>', '\n', '\r', 'd', 'r',
-'a', 'i', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\014', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\014', 'd', 'r', 'a', 'i',
-'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\025', 'd', 'e', 'l', 'a', 'y', 'e', 'd', '_', 'c', 'l', 'o', 's', 'e',
-'_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\023', 'd', 'e', 'l', 'a', 'y', 'e', 'd',
-'C', 'l', 'o', 's', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'C', '\n', '\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o',
-'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c',
-'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c',
-'e', 's', 's', 'L', 'o', 'g', '\022', 'Q', '\n', '\022', 'u', 's', 'e', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r',
-'e', 's', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\020', 'u', 's',
-'e', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', '/', '\n', '\024', 'x', 'f', 'f', '_', 'n', 'u', 'm',
-'_', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'h', 'o', 'p', 's', '\030', '\023', ' ', '\001', '(', '\r', 'R', '\021', 'x', 'f', 'f', 'N',
-'u', 'm', 'T', 'r', 'u', 's', 't', 'e', 'd', 'H', 'o', 'p', 's', '\022', '\240', '\001', '\n', '\027', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\031', ' ', '\001', '(', '\013', '2', 'h', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.',
-'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n',
-'f', 'i', 'g', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', '&', '\n', '\017', 's', 'k', 'i', 'p', '_', 'x', 'f', 'f', '_', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\025', ' ', '\001', '(',
-'\010', 'R', '\r', 's', 'k', 'i', 'p', 'X', 'f', 'f', 'A', 'p', 'p', 'e', 'n', 'd', '\022', '\020', '\n', '\003', 'v', 'i', 'a', '\030', '\026',
-' ', '\001', '(', '\t', 'R', '\003', 'v', 'i', 'a', '\022', 'J', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'r', 'e', 'q',
-'u', 'e', 's', 't', '_', 'i', 'd', '\030', '\017', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\021', 'g', 'e', 'n', 'e', 'r', 'a', 't',
-'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', '\022', '?', '\n', '\034', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', '_', 'e', 'x',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', ' ', ' ', '\001', '(', '\010', 'R', '\031',
-'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'E', 'x', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd',
-'\022', 'G', '\n', '!', 'a', 'l', 'w', 'a', 'y', 's', '_', 's', 'e', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd',
-'_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '%', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y',
-'s', 'S', 'e', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '\264',
-'\001', '\n', '\033', 'f', 'o', 'r', 'w', 'a', 'r', 'd', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e',
-'t', 'a', 'i', 'l', 's', '\030', '\020', ' ', '\001', '(', '\016', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
+'v', '3', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\022', 'r', 'e',
+'q', 'u', 'e', 's', 't', 'I', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '{', '\n', '\022', 'l', 'o', 'c', 'a', 'l',
+'_', 'r', 'e', 'p', 'l', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '&', ' ', '\001', '(', '\013', '2', 'M', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't',
+'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a',
+'g', 'e', 'r', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020',
+'l', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\030', 's', 't', 'r', 'i', 'p',
+'_', 'm', 'a', 't', 'c', 'h', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '\'', ' ', '\001', '(', '\010',
+'B', '\027', '\362', '\230', '\376', '\217', '\005', '\021', '\022', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o', 'r', 't', '_', 'm', 'o', 'd', 'e',
+'R', '\025', 's', 't', 'r', 'i', 'p', 'M', 'a', 't', 'c', 'h', 'i', 'n', 'g', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', '/',
+'\n', '\023', 's', 't', 'r', 'i', 'p', '_', 'a', 'n', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '*', ' ', '\001',
+'(', '\010', 'H', '\001', 'R', '\020', 's', 't', 'r', 'i', 'p', 'A', 'n', 'y', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', 'i', '\n',
+'$', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_',
+'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '(', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\037', 's', 't',
+'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's',
+'s', 'a', 'g', 'e', '\022', '\251', '\001', '\n', '\032', 'p', 'a', 't', 'h', '_', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i',
+'o', 'n', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '+', ' ', '\001', '(', '\013', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r',
+'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'P', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'R', '\030', 'p', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '5', '\n', '\027', 's', 't', 'r', 'i', 'p', '_', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_',
+'d', 'o', 't', '\030', '/', ' ', '\001', '(', '\010', 'R', '\024', 's', 't', 'r', 'i', 'p', 'T', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'H',
+'o', 's', 't', 'D', 'o', 't', '\022', '\224', '\001', '\n', '\023', 'p', 'r', 'o', 'x', 'y', '_', 's', 't', 'a', 't', 'u', 's', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '1', ' ', '\001', '(', '\013', '2', 'd', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't',
'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H',
-'t', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'F', 'o', 'r', 'w',
-'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'B', '\010', '\372', 'B', '\005',
-'\202', '\001', '\002', '\020', '\001', 'R', '\030', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D',
-'e', 't', 'a', 'i', 'l', 's', '\022', '\264', '\001', '\n', '\037', 's', 'e', 't', '_', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'c', 'l',
-'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\021', ' ', '\001', '(', '\013', '2', 'n',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's',
+'t', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'P', 'r', 'o', 'x',
+'y', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'p', 'r', 'o', 'x', 'y', 'S', 't', 'a', 't', 'u',
+'s', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\366', '\004', '\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'c', 'l',
+'i', 'e', 'n', 't', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v',
+'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n',
+'t', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l',
+'i', 'n', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
+'.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o', 'm', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022',
+'A', '\n', '\020', 'o', 'v', 'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\013',
+'2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R',
+'\017', 'o', 'v', 'e', 'r', 'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 'b', 'o',
+'s', 'e', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\022', 'K', '\n', '\023', 'm', 'a', 'x', '_',
+'p', 'a', 't', 'h', '_', 't', 'a', 'g', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'R', '\020', 'm', 'a', 'x', 'P', 'a', 't', 'h', 'T', 'a', 'g', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'A', '\n', '\013', 'c', 'u',
+'s', 't', 'o', 'm', '_', 't', 'a', 'g', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'R',
+'\n', 'c', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 's', '\022', '?', '\n', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t',
+' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e',
+'.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'H', 't', 't', 'p', 'R', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e',
+'r', '\"', '(', '\n', '\r', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '\013', '\n', '\007', 'I', 'N', 'G',
+'R', 'E', 'S', 'S', '\020', '\000', '\022', '\n', '\n', '\006', 'E', 'G', 'R', 'E', 'S', 'S', '\020', '\001', ':', '[', '\232', '\305', '\210', '\036', 'V',
+'\n', 'T', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't',
+'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a',
+'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a',
+'g', 'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\016',
+'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '_', 'f', 'o', 'r', '_', 't', 'a', 'g', 's', '\032', '\245', '\001', '\n', '\025', 'I', 'n', 't', 'e', 'r',
+'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'n', 'i', 'x', '_',
+'s', 'o', 'c', 'k', 'e', 't', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\013', 'u', 'n', 'i', 'x', 'S', 'o', 'c', 'k', 'e', 't',
+'s', ':', 'i', '\232', '\305', '\210', '\036', 'd', '\n', 'b', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i',
+'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e',
+'s', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\230', '\002', '\n', '\033', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l',
+'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '4', '\n', '\007', 's', 'u', 'b', 'j', 'e', 'c',
+'t', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\022', '\022', '\n', '\004', 'c', 'e',
+'r', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\004', 'c', 'e', 'r', 't', '\022', '\024', '\n', '\005', 'c', 'h', 'a', 'i', 'n', '\030', '\006',
+' ', '\001', '(', '\010', 'R', '\005', 'c', 'h', 'a', 'i', 'n', '\022', '\020', '\n', '\003', 'd', 'n', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R',
+'\003', 'd', 'n', 's', '\022', '\020', '\n', '\003', 'u', 'r', 'i', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\003', 'u', 'r', 'i', ':', 'o', '\232',
+'\305', '\210', '\036', 'j', '\n', 'h', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'R', '\033', 's', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i',
-'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', ',', '\n', '\022', 'p', 'r', 'o', 'x', 'y', '_', '1',
-'0', '0', '_', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '\030', '\022', ' ', '\001', '(', '\010', 'R', '\020', 'p', 'r', 'o', 'x', 'y', '1',
-'0', '0', 'C', 'o', 'n', 't', 'i', 'n', 'u', 'e', '\022', 'e', '\n', '1', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'i',
-'p', 'v', '4', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'a', 's', '_', 'i', 'p', 'v',
-'4', '_', 'm', 'a', 'p', 'p', 'e', 'd', '_', 'i', 'p', 'v', '6', '\030', '\024', ' ', '\001', '(', '\010', 'R', '*', 'r', 'e', 'p', 'r',
-'e', 's', 'e', 'n', 't', 'I', 'p', 'v', '4', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', 'A', 's', 'I',
-'p', 'v', '4', 'M', 'a', 'p', 'p', 'e', 'd', 'I', 'p', 'v', '6', '\022', '\211', '\001', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\027', ' ', '\003', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
-'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'U',
-'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f',
-'i', 'g', 's', '\022', 'A', '\n', '\016', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '\030', '\036', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\r', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', '\022', '#', '\n', '\r', 'm',
-'e', 'r', 'g', 'e', '_', 's', 'l', 'a', 's', 'h', 'e', 's', '\030', '!', ' ', '\001', '(', '\010', 'R', '\014', 'm', 'e', 'r', 'g', 'e',
-'S', 'l', 'a', 's', 'h', 'e', 's', '\022', '\201', '\001', '\n', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h',
-'t', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3',
-'.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\022', 'r', 'e', 'q', 'u',
-'e', 's', 't', 'I', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '{', '\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'r',
-'e', 'p', 'l', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '&', ' ', '\001', '(', '\013', '2', 'M', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o',
-'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e',
-'r', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'l', 'o',
-'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\030', 's', 't', 'r', 'i', 'p', '_', 'm',
-'a', 't', 'c', 'h', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '\'', ' ', '\001', '(', '\010', 'B', '\027',
-'\362', '\230', '\376', '\217', '\005', '\021', '\022', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o', 'r', 't', '_', 'm', 'o', 'd', 'e', 'R', '\025',
-'s', 't', 'r', 'i', 'p', 'M', 'a', 't', 'c', 'h', 'i', 'n', 'g', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', '/', '\n', '\023',
-'s', 't', 'r', 'i', 'p', '_', 'a', 'n', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '*', ' ', '\001', '(', '\010',
-'H', '\001', 'R', '\020', 's', 't', 'r', 'i', 'p', 'A', 'n', 'y', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', 'i', '\n', '$', 's',
-'t', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't',
-'t', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '(', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\037', 's', 't', 'r', 'e',
-'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a',
-'g', 'e', '\032', '\366', '\004', '\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'c', 'l', 'i', 'e', 'n', 't', '_',
-'s', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't', 'S', 'a', 'm', 'p',
-'l', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\004',
-' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c',
-'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o', 'm', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'A', '\n', '\020', 'o', 'v',
-'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n',
-'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'o', 'v', 'e', 'r',
-'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\030', '\006', ' ',
-'\001', '(', '\010', 'R', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\022', 'K', '\n', '\023', 'm', 'a', 'x', '_', 'p', 'a', 't', 'h', '_',
-'t', 'a', 'g', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'm', 'a',
-'x', 'P', 'a', 't', 'h', 'T', 'a', 'g', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'A', '\n', '\013', 'c', 'u', 's', 't', 'o', 'm', '_',
-'t', 'a', 'g', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 't',
-'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'R', '\n', 'c', 'u', 's', 't',
-'o', 'm', 'T', 'a', 'g', 's', '\022', '?', '\n', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001', '(', '\013', '2',
-'#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '.', 'T',
-'r', 'a', 'c', 'i', 'n', 'g', '.', 'H', 't', 't', 'p', 'R', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\"', '(', '\n', '\r',
-'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '\013', '\n', '\007', 'I', 'N', 'G', 'R', 'E', 'S', 'S', '\020',
-'\000', '\022', '\n', '\n', '\006', 'E', 'G', 'R', 'E', 'S', 'S', '\020', '\001', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
-'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T',
-'r', 'a', 'c', 'i', 'n', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\016', 'o', 'p', 'e', 'r', 'a',
-'t', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 'f', 'o', 'r', '_', 't', 'a', 'g', 's', '\032', '\245', '\001', '\n', '\025', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd',
-'d', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'n', 'i', 'x', '_', 's', 'o', 'c', 'k', 'e',
-'t', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\013', 'u', 'n', 'i', 'x', 'S', 'o', 'c', 'k', 'e', 't', 's', ':', 'i', '\232', '\305',
-'\210', '\036', 'd', '\n', 'b', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
-'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n',
-'f', 'i', 'g', '\032', '\230', '\002', '\n', '\033', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '4', '\n', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\030', '\001', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\022', '\022', '\n', '\004', 'c', 'e', 'r', 't', '\030', '\003', ' ',
-'\001', '(', '\010', 'R', '\004', 'c', 'e', 'r', 't', '\022', '\024', '\n', '\005', 'c', 'h', 'a', 'i', 'n', '\030', '\006', ' ', '\001', '(', '\010', 'R',
-'\005', 'c', 'h', 'a', 'i', 'n', '\022', '\020', '\n', '\003', 'd', 'n', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\003', 'd', 'n', 's', '\022',
-'\020', '\n', '\003', 'u', 'r', 'i', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\003', 'u', 'r', 'i', ':', 'o', '\232', '\305', '\210', '\036', 'j', '\n',
-'h', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
-'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e',
-'t', 'a', 'i', 'l', 's', 'J', '\004', '\010', '\002', '\020', '\003', '\032', '\256', '\002', '\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(',
-'\t', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', 'a', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's',
-'\030', '\002', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
-'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'F', 'i',
-'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030',
-'\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', ':', 'a', '\232', '\305', '\210', '\036', '\\', '\n',
-'Z', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
-'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '6', '\n', '\t', 'C', 'o', 'd', 'e', 'c',
-'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '1', '\020', '\001',
-'\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '2', '\020', '\002', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '3', '\020', '\003', '\"', 'S', '\n',
-'\032', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i',
-'o', 'n', '\022', '\r', '\n', '\t', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T', 'E', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'P', 'P', 'E',
-'N', 'D', '_', 'I', 'F', '_', 'A', 'B', 'S', 'E', 'N', 'T', '\020', '\001', '\022', '\020', '\n', '\014', 'P', 'A', 'S', 'S', '_', 'T', 'H',
-'R', 'O', 'U', 'G', 'H', '\020', '\002', '\"', 'y', '\n', '\030', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\014', '\n', '\010', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '\020', '\000', '\022',
-'\020', '\n', '\014', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\022', '\n', '\016', 'A', 'P', 'P', 'E',
-'N', 'D', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '\020', '\002', '\022', '\020', '\n', '\014', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '_',
-'S', 'E', 'T', '\020', '\003', '\022', '\027', '\n', '\023', 'A', 'L', 'W', 'A', 'Y', 'S', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O',
-'N', 'L', 'Y', '\020', '\004', ':', 'S', '\232', '\305', '\210', '\036', 'N', '\n', 'L', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\026', '\n', '\017', 'r', 'o', 'u', 't', 'e', '_',
-'s', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\021', '\n', '\017', 's', 't', 'r', 'i', 'p', '_', 'p',
-'o', 'r', 't', '_', 'm', 'o', 'd', 'e', 'J', '\004', '\010', '\033', '\020', '\034', 'J', '\004', '\010', '\013', '\020', '\014', 'R', '\014', 'i', 'd', 'l',
-'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\"', '\312', '\001', '\n', '\020', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', 'K', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.',
-'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'M', 'a', 'p', 'p', 'e', 'r', 'R',
-'\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\022', 'O', '\n', '\013', 'b', 'o', 'd', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002',
-' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i',
-'n', 'g', 'R', '\n', 'b', 'o', 'd', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\"', '\234', '\003', '\n', '\016', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', 'M', 'a', 'p', 'p', 'e', 'r', '\022', 'L', '\n', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.',
-'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001',
-'\002', '\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'J', '\n', '\013', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd',
-'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\020', '\330', '\004', '(', '\310', '\001',
-'R', '\n', 's', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\003', ' ', '\001', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', '\022', '`', '\n', '\024', 'b', 'o', 'd', 'y', '_',
-'f', 'o', 'r', 'm', 'a', 't', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '.', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'u', 'b', 's', 't',
-'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'R', '\022', 'b', 'o', 'd', 'y',
-'F', 'o', 'r', 'm', 'a', 't', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'X', '\n', '\016', 'h', 'e', 'a', 'd', 'e', 'r', 's',
-'_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p',
-'t', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\014', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'T',
-'o', 'A', 'd', 'd', '\"', '\307', '\001', '\n', '\003', 'R', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o',
-'u', 'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'r',
-'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'r',
-'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'N', 'a', 'm', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n',
+'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'J', '\004', '\010', '\002', '\020', '\003', '\032', '\256', '\002', '\n', '\r', 'U', 'p', 'g', 'r',
+'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 't', 'y', 'p', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', 'a', '\n', '\007', 'f', 'i',
+'l', 't', 'e', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't',
+'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H',
+'t', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '4', '\n', '\007', 'e', 'n', 'a',
+'b', 'l', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', ':', 'a', '\232',
+'\305', '\210', '\036', '\\', '\n', 'Z', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\345', '\001', '\n',
+'\030', 'P', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'\022', 'c', '\n', '\031', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a',
+'t', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h',
+'t', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n',
+'R', '\030', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
+'n', '\022', 'd', '\n', '\032', 'h', 't', 't', 'p', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r',
+'m', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
+'.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i',
+'o', 'n', 'R', '\030', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't',
+'i', 'o', 'n', '\032', '\344', '\002', '\n', '\021', 'P', 'r', 'o', 'x', 'y', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '%', '\n', '\016', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R',
+'\r', 'r', 'e', 'm', 'o', 'v', 'e', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', 'Q', '\n', '%', 'r', 'e', 'm', 'o', 'v', 'e', '_',
+'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 't', 'e', 'r', 'm', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'd', 'e',
+'t', 'a', 'i', 'l', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\"', 'r', 'e', 'm', 'o', 'v', 'e', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'T', 'e', 'r', 'm', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '2', '\n',
+'\025', 'r', 'e', 'm', 'o', 'v', 'e', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'f', 'l', 'a', 'g', 's', '\030', '\003', ' ',
+'\001', '(', '\010', 'R', '\023', 'r', 'e', 'm', 'o', 'v', 'e', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 's', '\022',
+'A', '\n', '\035', 's', 'e', 't', '_', 'r', 'e', 'c', 'o', 'm', 'm', 'e', 'n', 'd', 'e', 'd', '_', 'r', 'e', 's', 'p', 'o', 'n',
+'s', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\032', 's', 'e', 't', 'R', 'e', 'c', 'o', 'm', 'm', 'e',
+'n', 'd', 'e', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', ' ', '\n', '\013', 'u', 's', 'e', '_', 'n',
+'o', 'd', 'e', '_', 'i', 'd', '\030', '\005', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\t', 'u', 's', 'e', 'N', 'o', 'd', 'e', 'I', 'd',
+'\022', '.', '\n', '\022', 'l', 'i', 't', 'e', 'r', 'a', 'l', '_', 'p', 'r', 'o', 'x', 'y', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ',
+'\001', '(', '\t', 'H', '\000', 'R', '\020', 'l', 'i', 't', 'e', 'r', 'a', 'l', 'P', 'r', 'o', 'x', 'y', 'N', 'a', 'm', 'e', 'B', '\014',
+'\n', '\n', 'p', 'r', 'o', 'x', 'y', '_', 'n', 'a', 'm', 'e', '\"', '6', '\n', '\t', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e',
+'\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '1', '\020', '\001', '\022', '\t', '\n', '\005',
+'H', 'T', 'T', 'P', '2', '\020', '\002', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '3', '\020', '\003', '\"', 'S', '\n', '\032', 'S', 'e', 'r',
+'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', '\r',
+'\n', '\t', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T', 'E', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'I',
+'F', '_', 'A', 'B', 'S', 'E', 'N', 'T', '\020', '\001', '\022', '\020', '\n', '\014', 'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G',
+'H', '\020', '\002', '\"', 'y', '\n', '\030', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D',
+'e', 't', 'a', 'i', 'l', 's', '\022', '\014', '\n', '\010', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '\020', '\000', '\022', '\020', '\n', '\014', 'F',
+'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\022', '\n', '\016', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'F',
+'O', 'R', 'W', 'A', 'R', 'D', '\020', '\002', '\022', '\020', '\n', '\014', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '_', 'S', 'E', 'T', '\020',
+'\003', '\022', '\027', '\n', '\023', 'A', 'L', 'W', 'A', 'Y', 'S', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L', 'Y', '\020',
+'\004', '\"', '\240', '\001', '\n', '\034', 'P', 'a', 't', 'h', 'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's',
+'h', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022', '#', '\n', '\037', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N', 'T', 'A', 'T', 'I',
+'O', 'N', '_', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'C', '_', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\022', '\n', '\016',
+'K', 'E', 'E', 'P', '_', 'U', 'N', 'C', 'H', 'A', 'N', 'G', 'E', 'D', '\020', '\001', '\022', '\022', '\n', '\016', 'R', 'E', 'J', 'E', 'C',
+'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020', '\002', '\022', '\031', '\n', '\025', 'U', 'N', 'E', 'S', 'C', 'A', 'P', 'E', '_', 'A',
+'N', 'D', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\003', '\022', '\030', '\n', '\024', 'U', 'N', 'E', 'S', 'C', 'A', 'P', 'E',
+'_', 'A', 'N', 'D', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '\020', '\004', ':', 'S', '\232', '\305', '\210', '\036', 'N', '\n', 'L', 'e', 'n',
'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '2', '.', 'R', 'd', 's', '\"', '\367', '\001', '\n', '\035', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
-'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', '\022', 'y', '\n', '\033', 's', 'c', 'o', 'p', 'e', 'd',
-'_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003',
-'(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\031', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C',
-'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
+'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B',
+'\026', '\n', '\017', 'r', 'o', 'u', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\021',
+'\n', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o', 'r', 't', '_', 'm', 'o', 'd', 'e', 'J', '\004', '\010', '\033', '\020', '\034', 'J', '\004',
+'\010', '\013', '\020', '\014', 'R', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\"', '\312', '\001', '\n', '\020', 'L', 'o',
+'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\007', 'm', 'a', 'p', 'p', 'e', 'r', 's',
+'\030', '\001', ' ', '\003', '(', '\013', '2', 'K', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 's', 'p', 'o', 'n',
+'s', 'e', 'M', 'a', 'p', 'p', 'e', 'r', 'R', '\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\022', 'O', '\n', '\013', 'b', 'o', 'd', 'y',
+'_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F',
+'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'R', '\n', 'b', 'o', 'd', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\"', '\234',
+'\003', '\n', '\016', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'M', 'a', 'p', 'p', 'e', 'r', '\022', 'L', '\n', '\006', 'f', 'i', 'l', 't',
+'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a',
+'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'F', 'i', 'l', 't',
+'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'J', '\n', '\013', 's',
+'t', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B',
+'\010', '*', '\006', '\020', '\330', '\004', '(', '\310', '\001', 'R', '\n', 's', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', '\022', '4', '\n', '\004',
+'b', 'o', 'd', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y',
+'\022', '`', '\n', '\024', 'b', 'o', 'd', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030',
+'\004', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r',
+'i', 'n', 'g', 'R', '\022', 'b', 'o', 'd', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'X',
+'\n', '\016', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd',
+'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R',
+'\014', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\"', '\307', '\001', '\n', '\003', 'R', 'd', 's', '\022', 'Q', '\n', '\r',
+'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S',
+'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o',
+'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'n', 'a', 'm', 'e',
+'\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'r', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'N', 'a', 'm', 'e', ':', 'A',
+'\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e',
+'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'R', 'd', 's', '\"', '\367', '\001', '\n', '\035', 'S', 'c', 'o', 'p', 'e',
+'d', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', '\022',
+'y', '\n', '\033', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\031', 's', 'c', 'o',
+'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', ':', '[', '\232',
+'\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', '\"', '\337', '\016', '\n', '\014', 'S', 'c', 'o', 'p', 'e',
+'d', 'R', 'o', 'u', 't', 'e', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\217', '\001', '\n', '\021', 's', 'c', 'o', 'p', 'e', '_', 'k', 'e', 'y',
+'_', 'b', 'u', 'i', 'l', 'd', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', 'Y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 's', 'L', 'i', 's', 't', '\"', '\351', '\016', '\n', '\014', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', '\033',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a',
-'m', 'e', '\022', '\217', '\001', '\n', '\021', 's', 'c', 'o', 'p', 'e', '_', 'k', 'e', 'y', '_', 'b', 'u', 'i', 'l', 'd', 'e', 'r', '\030',
-'\002', ' ', '\001', '(', '\013', '2', 'Y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u',
+'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 's', 'c', 'o', 'p', 'e', 'K', 'e', 'y',
+'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', 'N', '\n', '\021', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u',
+'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\017', 'r', 'd', 's',
+'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '\245', '\001', '\n', ' ', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r',
+'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '_', 'l', 'i', 's', 't', '\030',
+'\004', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
-'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 's', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', 'X',
-'\n', '\021', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013',
-'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 'r', 'd',
-'s', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '\245', '\001', '\n', ' ', 's', 'c', 'o', 'p', 'e', 'd', '_',
-'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '_', 'l', 'i', 's', 't',
-'\030', '\004', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', 'H', '\000', 'R',
+'\035', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'s', 'L', 'i', 's', 't', '\022', 'g', '\n', '\n', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '\030', '\005', ' ', '\001', '(', '\013',
+'2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'H', '\000', 'R',
+'\t', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\032', '\331', '\t', '\n', '\017', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u',
+'i', 'l', 'd', 'e', 'r', '\022', '\221', '\001', '\n', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013',
+'2', 'i', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's',
+'.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't',
+'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm', 'e',
+'n', 't', 's', '\032', '\325', '\007', '\n', '\017', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', '\266',
+'\001', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '_', 'e', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '~', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd',
-'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', 'H', '\000',
-'R', '\035', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 's', 'L', 'i', 's', 't', '\022', 'g', '\n', '\n', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '\030', '\005', ' ', '\001', '(',
-'\013', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'H', '\000',
-'R', '\t', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\032', '\331', '\t', '\n', '\017', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B',
-'u', 'i', 'l', 'd', 'e', 'r', '\022', '\221', '\001', '\n', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(',
-'\013', '2', 'i', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e',
-'s', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n',
-'t', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm',
-'e', 'n', 't', 's', '\032', '\325', '\007', '\n', '\017', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022',
-'\266', '\001', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '_', 'e', 'x', 't', 'r', 'a', 'c', 't', 'o',
-'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '~', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
+'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r',
+'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
+'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', 'H', '\000', 'R', '\024', 'h', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E',
+'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\032', '\217', '\005', '\n', '\024', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E',
+'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
+'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\021', 'e', 'l', 'e', 'm', 'e', 'n', 't', '_', 's',
+'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'e', 'l', 'e', 'm', 'e', 'n', 't', 'S', 'e',
+'p', 'a', 'r', 'a', 't', 'o', 'r', '\022', '\026', '\n', '\005', 'i', 'n', 'd', 'e', 'x', '\030', '\003', ' ', '\001', '(', '\r', 'H', '\000', 'R',
+'\005', 'i', 'n', 'd', 'e', 'x', '\022', '\245', '\001', '\n', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\030', '\004', ' ', '\001', '(', '\013', '2',
+'\210', '\001', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's',
+'.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't',
+'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c',
+'t', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', 'H', '\000', 'R', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\032',
+'\333', '\001', '\n', '\t', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', '\022', '%', '\n', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't', 'o',
+'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't',
+'o', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\003', 'k', 'e', 'y', ':', '\213', '\001', '\232', '\305', '\210', '\036', '\205', '\001', '\n', '\202', '\001', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p',
+'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.',
+'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', ':', '\177', '\232', '\305',
+'\210', '\036', 'z', '\n', 'x', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
+'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c',
+'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i',
+'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r',
+'B', '\016', '\n', '\014', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 't', 'y', 'p', 'e', ':', 'j', '\232', '\305', '\210', '\036', 'e', '\n', 'c',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o',
+'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e',
+'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e',
+'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B',
+'\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', 'Z', '\232', '\305', '\210', '\036', 'U', '\n', 'S', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h',
+'t', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2',
+'.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i',
+'l', 'd', 'e', 'r', ':', 'J', '\232', '\305', '\210', '\036', 'E', '\n', 'C', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
+'o', 'u', 't', 'e', 's', 'B', '\027', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'\022', '\003', '\370', 'B', '\001', '\"', '\361', '\001', '\n', '\t', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\022', 'e', '\n', '\030', 's', 'c',
+'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R',
+'\025', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '4', '\n',
+'\026', 's', 'r', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\002',
+' ', '\001', '(', '\t', 'R', '\024', 's', 'r', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o',
+'r', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i',
+'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\"',
+'\314', '\002', '\n', '\n', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p',
+'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f',
+'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ',
+'\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000',
+'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o',
+'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l',
+':', 'H', '\232', '\305', '\210', '\036', 'C', '\n', 'A', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l',
+'t', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'B',
+'\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020',
+'\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\237', '\001', '\n', '\022', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n',
+'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'P', '\232', '\305', '\210', '\036', 'K', '\n', 'I', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
+'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
+'v', '2', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\216', '\001', '\n',
+' ', 'E', 'n', 'v', 'o', 'y', 'M', 'o', 'b', 'i', 'l', 'e', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'j', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'R', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'s', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', '\357', '\001', '\n', 'I', 'i', 'o', '.', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e',
-'d', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F',
-'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
-'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', 'H', '\000', 'R', '\024', 'h', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
-'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\032', '\217', '\005', '\n', '\024', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
-'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\021', 'e', 'l', 'e', 'm', 'e', 'n', 't', '_',
-'s', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'e', 'l', 'e', 'm', 'e', 'n', 't', 'S',
-'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\022', '\026', '\n', '\005', 'i', 'n', 'd', 'e', 'x', '\030', '\003', ' ', '\001', '(', '\r', 'H', '\000',
-'R', '\005', 'i', 'n', 'd', 'e', 'x', '\022', '\245', '\001', '\n', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\030', '\004', ' ', '\001', '(', '\013',
-'2', '\210', '\001', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e',
-'s', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n',
-'t', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a',
-'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', 'H', '\000', 'R', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't',
-'\032', '\333', '\001', '\n', '\t', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', '\022', '%', '\n', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't',
-'o', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\t', 's', 'e', 'p', 'a', 'r', 'a',
-'t', 'o', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
-'R', '\003', 'k', 'e', 'y', ':', '\213', '\001', '\232', '\305', '\210', '\036', '\205', '\001', '\n', '\202', '\001', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_',
-'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o',
-'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r',
-'.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
-'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', ':', '\177', '\232',
-'\305', '\210', '\036', 'z', '\n', 'x', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S',
-'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u',
-'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o',
-'r', 'B', '\016', '\n', '\014', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 't', 'y', 'p', 'e', ':', 'j', '\232', '\305', '\210', '\036', 'e', '\n',
-'c', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
-'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K',
-'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r',
-'B', '\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', 'Z', '\232', '\305', '\210', '\036', 'U', '\n', 'S', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
-'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u',
-'i', 'l', 'd', 'e', 'r', ':', 'J', '\232', '\305', '\210', '\036', 'E', '\n', 'C', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd',
-'R', 'o', 'u', 't', 'e', 's', 'B', '\027', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
-'r', '\022', '\003', '\370', 'B', '\001', '\"', '\273', '\001', '\n', '\t', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\022', 'e', '\n', '\030', 's',
-'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'R', '\025', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', 'G',
-'\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e',
-'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\"', '\314', '\002', '\n',
-'\n', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013',
-'2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c',
-'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i',
-'o', 'n', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', ':', 'H', '\232',
-'\305', '\210', '\036', 'C', '\n', 'A', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013',
-'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006',
-'c', 'o', 'n', 'f', 'i', 'g', '\"', '\237', '\001', '\n', '\022', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(',
-'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013',
-'t', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'P', '\232', '\305', '\210', '\036', 'K', '\n', 'I', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't',
-'t', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.',
-'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'B', 'q', '\n', 'I', 'i', 'o', '.',
-'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', 'B', '\032', 'H', 't', 't',
-'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', 'B', '\032', 'H', 't', 't', 'p',
+'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'|', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r', 's', '/', 'n', 'e', 't', 'w', 'o', 'r', 'k', '/', 'h', 't',
+'t', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '/', 'v', '3', ';',
+'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', 'v', '3',
'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[20] = {
+static _upb_DefPool_Init *deps[21] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
@@ -484,6 +529,7 @@ static upb_def_init *deps[20] = {
&envoy_config_route_v3_route_proto_upbdefinit,
&envoy_config_route_v3_scoped_route_proto_upbdefinit,
&envoy_config_trace_v3_http_tracer_proto_upbdefinit,
+ &envoy_type_http_v3_path_transformation_proto_upbdefinit,
&envoy_type_tracing_v3_custom_tag_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
@@ -497,9 +543,9 @@ static upb_def_init *deps[20] = {
NULL
};
-upb_def_init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout,
"envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto",
- UPB_STRVIEW_INIT(descriptor, 10141)
+ UPB_STRINGVIEW_INIT(descriptor, 12166)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
index bf8b017a..1d34eb98 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
@@ -19,91 +19,106 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.InternalAddressConfig");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.SetCurrentClientCertDetails");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.ProxyStatusConfig");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_Rds_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.Rds");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ResponseMapper");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_Rds_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.Rds");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRouteConfigurationsList");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRoutes.ScopeKeyBuilder.FragmentBuilder.HeaderValueExtractor.KvElement");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension");
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.ScopedRds");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
index c5af2614..d2b3c9da 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
@@ -8,12 +8,12 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit;
-
-static const char descriptor[348] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit;
+static const char descriptor[437] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 'c', 'e', 'r', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032', '6', 'e',
@@ -23,22 +23,26 @@ static const char descriptor[348] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c',
'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '3', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/',
-'v', '3', '/', 't', 'l', 's', '.', 'p', 'r', 'o', 't', 'o', 'B', 'F', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
-'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
-'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\t', 'C', 'e',
-'r', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'P', '\000', 'P', '\001', 'P', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'v', '3', '/', 't', 'l', 's', '.', 'p', 'r', 'o', 't', 'o', 'B', '\236', '\001', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\t', 'C',
+'e', 'r', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'V', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e',
+'/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o',
+'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', ';', 't', 'l', 's', 'v', '3', 'P', '\000',
+'P', '\001', 'P', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit,
&envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit,
&envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit,
NULL
};
-upb_def_init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/cert.proto",
- UPB_STRVIEW_INIT(descriptor, 348)
+ UPB_STRINGVIEW_INIT(descriptor, 437)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
index 524d994a..dee4061f 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
@@ -19,7 +19,7 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
index dbf238cb..50f4e41b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@@ -8,153 +8,193 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
-};
-
-static const char descriptor[2914] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[4092] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 'c', 'o', 'm', 'm', 'o', 'n',
'.', 'p', 'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032',
'\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
-'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l',
-'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's',
-'i', 't', 'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\"', '\362', '\003', '\n', '\r', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', '\217', '\001', '\n', '\034',
-'t', 'l', 's', '_', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's',
-'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's',
-'.', 'v', '3', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't',
-'o', 'c', 'o', 'l', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'i', 'n', 'i', 'm', 'u',
-'m', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\217', '\001', '\n', '\034', 't', 'l', 's', '_',
-'m', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030',
-'\002', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
-'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
-'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'a', 'x', 'i', 'm', 'u', 'm', 'P', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '#', '\n', '\r', 'c', 'i', 'p', 'h', 'e', 'r', '_', 's', 'u',
-'i', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\014', 'c', 'i', 'p', 'h', 'e', 'r', 'S', 'u', 'i', 't', 'e', 's', '\022',
-'\037', '\n', '\013', 'e', 'c', 'd', 'h', '_', 'c', 'u', 'r', 'v', 'e', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\n', 'e', 'c', 'd',
-'h', 'C', 'u', 'r', 'v', 'e', 's', '\"', 'O', '\n', '\013', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\014', '\n',
-'\010', 'T', 'L', 'S', '_', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '0', '\020', '\001', '\022',
-'\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '1', '\020', '\002', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '2', '\020', '\003',
-'\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '3', '\020', '\004', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't',
-'e', 'r', 's', '\"', '\317', '\001', '\n', '\022', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e',
-'r', '\022', ',', '\n', '\r', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'A', '\n',
-'\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o',
-'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'H',
-'\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e',
-'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J',
-'\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\206', '\005', '\n', '\016', 'T', 'l', 's', 'C', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', 'M', '\n', '\021', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'h',
-'a', 'i', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\020', 'c', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'C', 'h', 'a', 'i', 'n', '\022', 'I', '\n', '\013', 'p', 'r', 'i', 'v', 'a', 't', 'e', '_', 'k', 'e',
-'y', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R',
-'\n', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i',
-'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't',
-'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'o', '\n', '\024',
-'p', 'r', 'i', 'v', 'a', 't', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
-'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'P', 'r', 'i', 'v',
-'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R', '\022', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e',
-'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', 'D', '\n', '\010', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '\030', '\003', ' ', '\001',
-'(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\010', 'p', 'a', 's', 's',
-'w', 'o', 'r', 'd', '\022', 'A', '\n', '\013', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '\030', '\004', ' ', '\001', '(', '\013',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
+'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v',
+'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a',
+'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r',
+'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
+'n', 's', '/', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n',
+'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\362', '\003', '\n', '\r', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
+'r', 's', '\022', '\217', '\001', '\n', '\034', 't', 'l', 's', '_', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c',
+'o', 'l', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
+'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.',
+'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l',
+'s', 'M', 'i', 'n', 'i', 'm', 'u', 'm', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\217',
+'\001', '\n', '\034', 't', 'l', 's', '_', 'm', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v',
+'e', 'r', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P',
+'r', 'o', 't', 'o', 'c', 'o', 'l', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'a', 'x',
+'i', 'm', 'u', 'm', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '#', '\n', '\r', 'c', 'i',
+'p', 'h', 'e', 'r', '_', 's', 'u', 'i', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\014', 'c', 'i', 'p', 'h', 'e', 'r',
+'S', 'u', 'i', 't', 'e', 's', '\022', '\037', '\n', '\013', 'e', 'c', 'd', 'h', '_', 'c', 'u', 'r', 'v', 'e', 's', '\030', '\004', ' ', '\003',
+'(', '\t', 'R', '\n', 'e', 'c', 'd', 'h', 'C', 'u', 'r', 'v', 'e', 's', '\"', 'O', '\n', '\013', 'T', 'l', 's', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', '\022', '\014', '\n', '\010', 'T', 'L', 'S', '_', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'T', 'L', 'S',
+'v', '1', '_', '0', '\020', '\001', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '1', '\020', '\002', '\022', '\013', '\n', '\007', 'T', 'L',
+'S', 'v', '1', '_', '2', '\020', '\003', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '3', '\020', '\004', ':', '&', '\232', '\305', '\210',
+'\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's',
+'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\"', '\317', '\001', '\n', '\022', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y',
+'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', ',', '\n', '\r', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
+'N', 'a', 'm', 'e', '\022', 'A', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\006',
+'\270', '\267', '\213', '\244', '\002', '\001', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '+', '\232', '\305',
+'\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'P', 'r',
+'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\310', '\005', '\n', '\016',
+'T', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', 'M', '\n', '\021', 'c', 'e', 'r', 't', 'i', 'f', 'i',
+'c', 'a', 't', 'e', '_', 'c', 'h', 'a', 'i', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e',
+'R', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'h', 'a', 'i', 'n', '\022', 'I', '\n', '\013', 'p', 'r', 'i',
+'v', 'a', 't', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006',
+'\270', '\267', '\213', '\244', '\002', '\001', 'R', '\n', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', '\022', '@', '\n', '\006', 'p', 'k', 'c',
+'s', '1', '2', '\030', '\010', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002',
+'\001', 'R', '\006', 'p', 'k', 'c', 's', '1', '2', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i', 'r', 'e',
+'c', 't', 'o', 'r', 'y', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r',
+'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'o', '\n', '\024', 'p', 'r',
+'i', 'v', 'a', 't', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\006', ' ', '\001', '(', '\013', '2',
+'=', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'P', 'r', 'i', 'v', 'a', 't',
+'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R', '\022', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P',
+'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', 'D', '\n', '\010', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '\030', '\003', ' ', '\001', '(', '\013',
'2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D',
-'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', '\022', 'b', '\n', '\034',
-'s', 'i', 'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't',
-'a', 'm', 'p', '\030', '\005', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\032', 's', 'i', 'g', 'n', 'e',
-'d', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', ':', '\'', '\232', '\305',
-'\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l',
-'s', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\"', '\213', '\001', '\n', '\024', 'T', 'l', 's', 'S', 'e', 's', 's', 'i',
-'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\022', 'D', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ', '\003', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\016', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', '\270', '\267', '\213', '\244', '\002',
-'\001', 'R', '\004', 'k', 'e', 'y', 's', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't',
-'K', 'e', 'y', 's', '\"', '\307', '\007', '\n', '\034', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '?', '\n', '\n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'c',
-'a', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 't', 'r', 'u', 's', 't', 'e', 'd',
-'C', 'a', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\013',
-' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c',
-'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'F', '\n', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e',
-'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'p', 'k', 'i', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013',
-'\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', ',', '(', ',', 'R', '\025', 'v', 'e', 'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'S', 'p', 'k', 'i', '\022', 'F', '\n', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', '_', 'h', 'a', 's', 'h', '\030', '\002', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010',
-'\"', '\006', 'r', '\004', '\020', '@', '(', '_', 'R', '\025', 'v', 'e', 'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'H', 'a', 's', 'h', '\022', '[', '\n', '\027', 'm', 'a', 't', 'c', 'h', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a',
-'l', 't', '_', 'n', 'a', 'm', 'e', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h',
-'e', 'r', 'R', '\024', 'm', 'a', 't', 'c', 'h', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 's', '\022',
-'k', '\n', '$', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'i', 'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '!',
-'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'i', 'g', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T',
-'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '2', '\n', '\003', 'c', 'r', 'l', '\030', '\007', ' ', '\001', '(', '\013', '2', ' ', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S',
-'o', 'u', 'r', 'c', 'e', 'R', '\003', 'c', 'r', 'l', '\022', ':', '\n', '\031', 'a', 'l', 'l', 'o', 'w', '_', 'e', 'x', 'p', 'i', 'r',
-'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\027', 'a', 'l', 'l',
-'o', 'w', 'E', 'x', 'p', 'i', 'r', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', '\242', '\001', '\n', '\030',
-'t', 'r', 'u', 's', 't', '_', 'c', 'h', 'a', 'i', 'n', '_', 'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\030',
-'\n', ' ', '\001', '(', '\016', '2', '^', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
-'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
-'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't',
-'e', 'x', 't', '.', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\026', 't', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e',
-'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\"', 'F', '\n', '\026', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V',
-'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\022', 'V', 'E', 'R', 'I', 'F', 'Y', '_', 'T', 'R', 'U',
-'S', 'T', '_', 'C', 'H', 'A', 'I', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'C', 'C', 'E', 'P', 'T', '_', 'U', 'N', 'T', 'R',
-'U', 'S', 'T', 'E', 'D', '\020', '\001', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'R',
-'\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 'B',
-'P', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
-'s', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\013', 'C', 'o', 'm', 'm', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\010', 'p', 'a', 's', 's', 'w', 'o',
+'r', 'd', '\022', 'A', '\n', '\013', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', ' ',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't',
+'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', '\022', 'b', '\n', '\034', 's', 'i',
+'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm',
+'p', '\030', '\005', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\032', 's', 'i', 'g', 'n', 'e', 'd', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', ':', '\'', '\232', '\305', '\210', '\036',
+'\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\"', '\213', '\001', '\n', '\024', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n',
+'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\022', 'D', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
+' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a',
+'t', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\016', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', '\270', '\267', '\213', '\244', '\002', '\001', 'R',
+'\004', 'k', 'e', 'y', 's', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e',
+'y', 's', '\"', 's', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
+'P', 'l', 'u', 'g', 'i', 'n', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c',
+'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm',
+'e', '\022', ')', '\n', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001',
+'(', '\t', 'R', '\017', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'N', 'a', 'm', 'e', '\"', '\244', '\002', '\n', '\025', 'S',
+'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'o', '\n', '\010', 's',
+'a', 'n', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', 'H', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's',
+'.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 'M', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'S', 'a', 'n', 'T', 'y', 'p', 'e', 'B', '\n', '\372', 'B', '\007', '\202', '\001', '\004', '\020', '\001', ' ', '\000', 'R',
+'\007', 's', 'a', 'n', 'T', 'y', 'p', 'e', '\022', 'H', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.',
+'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '\"', 'P', '\n', '\007', 'S', 'a', 'n', 'T', 'y', 'p', 'e', '\022', '\030', '\n', '\024', 'S', 'A', 'N',
+'_', 'T', 'Y', 'P', 'E', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\t', '\n', '\005', 'E', 'M',
+'A', 'I', 'L', '\020', '\001', '\022', '\007', '\n', '\003', 'D', 'N', 'S', '\020', '\002', '\022', '\007', '\n', '\003', 'U', 'R', 'I', '\020', '\003', '\022', '\016',
+'\n', '\n', 'I', 'P', '_', 'A', 'D', 'D', 'R', 'E', 'S', 'S', '\020', '\004', '\"', '\277', '\013', '\n', '\034', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'W', '\n',
+'\n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'c', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c',
+'e', 'B', '\026', '\362', '\230', '\376', '\217', '\005', '\020', '\022', '\016', 'c', 'a', '_', 'c', 'e', 'r', 't', '_', 's', 'o', 'u', 'r', 'c', 'e',
+'R', '\t', 't', 'r', 'u', 's', 't', 'e', 'd', 'C', 'a', '\022', '\255', '\001', '\n', ' ', 'c', 'a', '_', 'c', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\r',
+' ', '\001', '(', '\013', '2', 'L', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't',
+'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', 'I',
+'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\026', '\362', '\230', '\376', '\217', '\005', '\020', '\022', '\016', 'c', 'a', '_', 'c', 'e', 'r', 't', '_',
+'s', 'o', 'u', 'r', 'c', 'e', 'R', '\035', 'c', 'a', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd',
+'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\013', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c',
+'t', 'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'F', '\n',
+'\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'p', 'k', 'i', '\030',
+'\003', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', ',', '(', ',', 'R', '\025', 'v', 'e',
+'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'S', 'p', 'k', 'i', '\022', 'F', '\n', '\027', 'v', 'e',
+'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'h', 'a', 's', 'h', '\030', '\002', ' ', '\003',
+'(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', '@', '(', '_', 'R', '\025', 'v', 'e', 'r', 'i', 'f',
+'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'H', 'a', 's', 'h', '\022', '\202', '\001', '\n', '\035', 'm', 'a', 't', 'c',
+'h', '_', 't', 'y', 'p', 'e', 'd', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 's',
+'\030', '\017', ' ', '\003', '(', '\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3',
+'.', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\031', 'm',
+'a', 't', 'c', 'h', 'T', 'y', 'p', 'e', 'd', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 's', '\022',
+'h', '\n', '\027', 'm', 'a', 't', 'c', 'h', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e',
+'s', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c',
+'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\013', '\030', '\001', '\222',
+'\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\024', 'm', 'a', 't', 'c', 'h', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't',
+'N', 'a', 'm', 'e', 's', '\022', 'k', '\n', '$', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'i', 'g', 'n', 'e', 'd', '_', 'c',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\030', '\006', ' ', '\001', '(',
+'\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V',
+'a', 'l', 'u', 'e', 'R', '!', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'i', 'g', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '2', '\n', '\003', 'c', 'r', 'l', '\030', '\007', ' ', '\001',
+'(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\003', 'c', 'r', 'l', '\022', ':', '\n', '\031', 'a', 'l', 'l', 'o', 'w',
+'_', 'e', 'x', 'p', 'i', 'r', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\010', ' ', '\001', '(',
+'\010', 'R', '\027', 'a', 'l', 'l', 'o', 'w', 'E', 'x', 'p', 'i', 'r', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', '\022', '\242', '\001', '\n', '\030', 't', 'r', 'u', 's', 't', '_', 'c', 'h', 'a', 'i', 'n', '_', 'v', 'e', 'r', 'i', 'f', 'i', 'c',
+'a', 't', 'i', 'o', 'n', '\030', '\n', ' ', '\001', '(', '\016', '2', '^', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't',
+'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i',
+'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f',
+'i', 'c', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\026', 't', 'r', 'u', 's', 't', 'C',
+'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\022', 'b', '\n', '\027', 'c', 'u', 's', 't', 'o',
+'m', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\014', ' ', '\001', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\025', 'c', 'u', 's', 't', 'o',
+'m', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '8', '\n', '\031', 'o', 'n', 'l', 'y', '_',
+'v', 'e', 'r', 'i', 'f', 'y', '_', 'l', 'e', 'a', 'f', '_', 'c', 'e', 'r', 't', '_', 'c', 'r', 'l', '\030', '\016', ' ', '\001', '(',
+'\010', 'R', '\025', 'o', 'n', 'l', 'y', 'V', 'e', 'r', 'i', 'f', 'y', 'L', 'e', 'a', 'f', 'C', 'e', 'r', 't', 'C', 'r', 'l', '\"',
+'F', '\n', '\026', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n',
+'\022', '\026', '\n', '\022', 'V', 'E', 'R', 'I', 'F', 'Y', '_', 'T', 'R', 'U', 'S', 'T', '_', 'C', 'H', 'A', 'I', 'N', '\020', '\000', '\022',
+'\024', '\n', '\020', 'A', 'C', 'C', 'E', 'P', 'T', '_', 'U', 'N', 'T', 'R', 'U', 'S', 'T', 'E', 'D', '\020', '\001', ':', '5', '\232', '\305',
+'\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'e',
+'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x',
+'t', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 's', 'u', 'b',
+'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 'B', '\250', '\001', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't',
+'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\013',
+'C', 'o', 'm', 'm', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'V', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l',
+'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', ';', 't', 'l', 's', 'v',
+'3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[9] = {
+static _upb_DefPool_Init *deps[12] = {
&envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_sensitive_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -162,9 +202,9 @@ static upb_def_init *deps[9] = {
NULL
};
-upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/common.proto",
- UPB_STRVIEW_INIT(descriptor, 2914)
+ UPB_STRINGVIEW_INIT(descriptor, 4092)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
index b289899d..e7d82faa 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
@@ -19,31 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_TlsParameters_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.TlsParameters");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_TlsParameters_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.TlsParameters");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.PrivateKeyProvider");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.PrivateKeyProvider");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.TlsCertificate");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.TlsCertificate");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CertificateProviderPluginInstance");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.SubjectAltNameMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
index 5623e1bc..d4254367 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
@@ -8,25 +8,16 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
-extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
-};
-
-static const char descriptor[1236] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1325] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't',
'.', 'p', 'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032',
@@ -71,14 +62,17 @@ static const char descriptor[1236] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', '
't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
'G', 'e', 'n', 'e', 'r', 'i', 'c', 'S', 'e', 'c', 'r', 'e', 't', 'H', '\000', 'R', '\r', 'g', 'e', 'n', 'e', 'r', 'i', 'c', 'S',
'e', 'c', 'r', 'e', 't', ':', '\037', '\232', '\305', '\210', '\036', '\032', '\n', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'a', 'u', 't', 'h', '.', 'S', 'e', 'c', 'r', 'e', 't', 'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', 'B', 'P', '\n', '7',
-'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't',
-'l', 's', '.', 'v', '3', 'B', '\013', 'S', 'e', 'c', 'r', 'e', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006',
-'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'2', '.', 'a', 'u', 't', 'h', '.', 'S', 'e', 'c', 'r', 'e', 't', 'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', 'B', '\250', '\001', '\n',
+'7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', 'B', '\013', 'S', 'e', 'c', 'r', 'e', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'V', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o',
+'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's',
+'/', 'v', '3', ';', 't', 'l', 's', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[8] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit,
@@ -89,9 +83,9 @@ static upb_def_init *deps[8] = {
NULL
};
-upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/secret.proto",
- UPB_STRVIEW_INIT(descriptor, 1236)
+ UPB_STRINGVIEW_INIT(descriptor, 1325)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h
index 40daa22f..d135a24d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_GenericSecret_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.GenericSecret");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_GenericSecret_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.GenericSecret");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.SdsSecretConfig");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_Secret_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.Secret");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_Secret_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.Secret");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
index a4651fcd..d398493d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
@@ -8,239 +8,247 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[6] = {
- &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_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,
-};
-
-static const char descriptor[4707] = {'\n', '3', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+extern _upb_DefPool_Init envoy_config_core_v3_address_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[5249] = {'\n', '3', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 't', 'l', 's', '.', 'p', 'r',
'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
-'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032', '$', 'e', 'n',
-'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/',
-'v', '3', '/', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
-'s', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
-'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p',
-'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
-'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
-'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
-'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\301', '\002', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C',
-'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n', 't',
-'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's',
-'.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o', 'm',
-'m', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\032', '\n', '\003', 's', 'n', 'i', '\030', '\002', ' ', '\001', '(',
-'\t', 'B', '\010', '\372', 'B', '\005', 'r', '\003', '(', '\377', '\001', 'R', '\003', 's', 'n', 'i', '\022', '/', '\n', '\023', 'a', 'l', 'l', 'o', 'w',
-'_', 'r', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l',
-'o', 'w', 'R', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\022', 'F', '\n', '\020', 'm', 'a', 'x', '_', 's', 'e',
-'s', 's', 'i', 'o', 'n', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'a',
-'x', 'S', 'e', 's', 's', 'i', 'o', 'n', 'K', 'e', 'y', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '\"', '\352', '\007', '\n', '\024', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
+'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032', '\"', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
+'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v',
+'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
+'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o', 't',
+'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's',
+'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e',
+'t', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'d', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n',
+'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i',
+'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"',
+'\301', '\002', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n',
+'\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013',
+'2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
+'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o',
+'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n',
+'t', 'e', 'x', 't', '\022', '\032', '\n', '\003', 's', 'n', 'i', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\010', '\372', 'B', '\005', 'r', '\003', '(',
+'\377', '\001', 'R', '\003', 's', 'n', 'i', '\022', '/', '\n', '\023', 'a', 'l', 'l', 'o', 'w', '_', 'r', 'e', 'n', 'e', 'g', 'o', 't', 'i',
+'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l', 'o', 'w', 'R', 'e', 'n', 'e', 'g', 'o', 't',
+'i', 'a', 't', 'i', 'o', 'n', '\022', 'F', '\n', '\020', 'm', 'a', 'x', '_', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 'k', 'e', 'y',
+'s', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'a', 'x', 'S', 'e', 's', 's', 'i', 'o', 'n', 'K',
+'e', 'y', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'a', 'u', 't', 'h', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\"', '\352',
+'\007', '\n', '\024', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i',
+'\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(',
+'\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm',
+'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o',
+'n', 't', 'e', 'x', 't', '\022', 'X', '\n', '\032', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\030', 'r', 'e', 'q', 'u',
+'i', 'r', 'e', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', ';', '\n', '\013', 'r',
+'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'n', 'i', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'r', 'e', 'q', 'u',
+'i', 'r', 'e', 'S', 'n', 'i', '\022', 'q', '\n', '\023', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_',
+'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
-'s', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o',
-'m', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'X', '\n', '\032', 'r', 'e', 'q', 'u', 'i', 'r', 'e',
-'_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '\022', ';', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'n', 'i', '\030', '\003', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\n', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'n', 'i', '\022', 'q', '\n', '\023', 's', 'e', 's', 's', 'i', 'o',
-'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '?', '.', 'e', 'n', 'v',
+'s', '.', 'v', '3', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's',
+'H', '\000', 'R', '\021', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\022', '\215', '\001', '\n',
+'%', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '_', 's', 'd', 's', '_',
+'s', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v',
'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
-'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T',
-'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'H', '\000', 'R', '\021', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e',
-'t', 'K', 'e', 'y', 's', '\022', '\215', '\001', '\n', '%', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_',
-'k', 'e', 'y', 's', '_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\005', ' ',
-'\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
-'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd',
-'s', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 's', 'e', 's', 's', 'i', 'o', 'n', 'T',
-'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'Q', '\n', '$', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'e', 'l', 'e', 's', 's', '_', 's', 'e', 's', 's',
-'i', 'o', 'n', '_', 'r', 'e', 's', 'u', 'm', 'p', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '!', 'd',
-'i', 's', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'e', 'l', 'e', 's', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'R', 'e', 's',
-'u', 'm', 'p', 't', 'i', 'o', 'n', '\022', 'T', '\n', '\017', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u',
-'t', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\020', '\372', 'B', '\r', '\252', '\001', '\n', '\032', '\006', '\010', '\200', '\200', '\200', '\200', '\020',
-'2', '\000', 'R', '\016', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\210', '\001', '\n', '\022', 'o', 'c',
-'s', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\010', ' ', '\001', '(', '\016', '2', 'P', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r',
-'t', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e',
-'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o',
-'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\020', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l',
-'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', 'N', '\n', '\020', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i',
-'c', 'y', '\022', '\024', '\n', '\020', 'L', 'E', 'N', 'I', 'E', 'N', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\000', '\022',
-'\023', '\n', '\017', 'S', 'T', 'R', 'I', 'C', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\001', '\022', '\017', '\n', '\013', 'M',
-'U', 'S', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'E', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T',
-'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\032', '\n', '\030', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k',
-'e', 't', '_', 'k', 'e', 'y', 's', '_', 't', 'y', 'p', 'e', '\"', '\247', '\026', '\n', '\020', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l',
-'s', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'W', '\n', '\n', 't', 'l', 's', '_', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
-'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l',
-'s', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'R', '\t', 't', 'l', 's', 'P', 'a', 'r', 'a', 'm', 's', '\022', 'd', '\n',
-'\020', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '9',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o',
-'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'C', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', '\017', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\022',
-'\220', '\001', '\n', '\"', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'd', 's', '_', 's',
-'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ':', '.', 'e', 'n', 'v',
+'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
+'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's',
+'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Q', '\n', '$', 'd', 'i', 's', 'a', 'b', 'l',
+'e', '_', 's', 't', 'a', 't', 'e', 'l', 'e', 's', 's', '_', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 'r', 'e', 's', 'u', 'm',
+'p', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '!', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'S', 't', 'a',
+'t', 'e', 'l', 'e', 's', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'R', 'e', 's', 'u', 'm', 'p', 't', 'i', 'o', 'n', '\022', 'T',
+'\n', '\017', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'B', '\020', '\372', 'B', '\r', '\252', '\001', '\n', '\032', '\006', '\010', '\200', '\200', '\200', '\200', '\020', '2', '\000', 'R', '\016', 's', 'e', 's', 's', 'i',
+'o', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\210', '\001', '\n', '\022', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e',
+'_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\010', ' ', '\001', '(', '\016', '2', 'P', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's',
+'.', 't', 'l', 's', '.', 'v', '3', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't',
+'e', 'x', 't', '.', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005',
+'\202', '\001', '\002', '\020', '\001', 'R', '\020', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', 'N',
+'\n', '\020', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\024', '\n', '\020', 'L', 'E', 'N',
+'I', 'E', 'N', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\000', '\022', '\023', '\n', '\017', 'S', 'T', 'R', 'I', 'C', 'T',
+'_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\001', '\022', '\017', '\n', '\013', 'M', 'U', 'S', 'T', '_', 'S', 'T', 'A', 'P', 'L',
+'E', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'a', 'u', 't', 'h', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't',
+'B', '\032', '\n', '\030', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '_', 't',
+'y', 'p', 'e', '\"', '\314', '\001', '\n', '\t', 'T', 'l', 's', 'K', 'e', 'y', 'L', 'o', 'g', '\022', '\033', '\n', '\004', 'p', 'a', 't', 'h',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'O', '\n', '\023',
+'l', 'o', 'c', 'a', 'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\002', ' ', '\003', '(', '\013',
+'2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
+'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\021', 'l', 'o', 'c', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', 'a', 'n',
+'g', 'e', '\022', 'Q', '\n', '\024', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'r', 'a', 'n', 'g',
+'e', '\030', '\003', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\022', 'r', 'e', 'm', 'o', 't', 'e', 'A', 'd',
+'d', 'r', 'e', 's', 's', 'R', 'a', 'n', 'g', 'e', '\"', '\364', '\027', '\n', '\020', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C',
+'o', 'n', 't', 'e', 'x', 't', '\022', 'W', '\n', '\n', 't', 'l', 's', '_', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'P',
+'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'R', '\t', 't', 'l', 's', 'P', 'a', 'r', 'a', 'm', 's', '\022', 'd', '\n', '\020', 't',
+'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '9', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
+'_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'R', '\017', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\022', '\220', '\001',
+'\n', '\"', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'd', 's', '_', 's', 'e', 'c',
+'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c',
+'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f',
+'i', 'g', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\020', '\002', 'R', '\036', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', '\227', '\001', '\n', '!', 't',
+'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i',
+'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\016', ' ', '\001', '(', '\013', '2', 'L', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's',
+'.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd',
+'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', '\036', 't', 'l', 's', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '\255',
+'\001', '\n', '$', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_',
+'s', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C',
+'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e',
+'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '!', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022',
+'\306', '\001', '\n', '-', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030',
+'\013', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
+'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\013', '\030', '\001', '\222', '\307',
+'\206', '\330', '\004', '\003', '3', '.', '0', 'R', ')', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e',
+'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e',
+'\022', 'x', '\n', '\022', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\003', ' ',
+'\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e',
+'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x',
+'t', 'H', '\000', 'R', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\214', '\001',
+'\n', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 's', 'd', 's', '_',
+'s', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v',
'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
-'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\020', '\001', 'R', '\036', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', '\240', '\001', '\n',
-'$', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o',
+'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't',
+'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\242', '\001', '\n', '\033', 'c', 'o', 'm', 'b', 'i',
+'n', 'e', 'd', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\010', ' ',
+'\001', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o',
+'m', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e',
+'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x',
+'t', 'H', '\000', 'R', '\031', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o',
+'n', 't', 'e', 'x', 't', '\022', '\265', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't',
+'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030',
+'\n', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
+'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H',
+'\000', 'R', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\316', '\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_',
+'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\014', ' ', '\001', '(', '\013', '2', 'W',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o',
+'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T',
+'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'H', '\000', 'R', ',', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '%',
+'\n', '\016', 'a', 'l', 'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\r', 'a',
+'l', 'p', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', 'W', '\n', '\021', 'c', 'u', 's', 't', 'o', 'm', '_', 'h', 'a',
+'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'c', 'u', 's', 't', 'o', 'm', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e',
+'r', '\022', 'M', '\n', '\007', 'k', 'e', 'y', '_', 'l', 'o', 'g', '\030', '\017', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o',
'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n',
-'t', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R',
-'!', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
-'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\271', '\001', '\n', '-', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
-'_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\013', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e',
-'t', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x',
-'t', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't',
-'a', 'n', 'c', 'e', 'R', ')', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', 'x', '\n',
-'\022', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\003', ' ', '\001', '(', '\013',
-'2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000',
-'R', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\214', '\001', '\n', '$', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c',
-'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
-'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', 'H', '\000', 'R', ' ', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's',
-'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\242', '\001', '\n', '\033', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd',
-'_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\010', ' ', '\001', '(', '\013',
-'2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o',
-'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000',
-'R', '\031', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e',
-'x', 't', '\022', '\250', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't',
-'_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\n', ' ', '\001',
-'(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
-'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm',
-'m', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e',
-'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'H', '\000', 'R', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n',
-'t', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\301',
-'\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r',
-'t', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c',
-'e', '\030', '\014', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
-'s', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v',
-'3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'H', '\000', 'R', ',',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '%', '\n', '\016', 'a', 'l',
-'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n', 'P',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', 'W', '\n', '\021', 'c', 'u', 's', 't', 'o', 'm', '_', 'h', 'a', 'n', 'd', 's', 'h',
-'a', 'k', 'e', 'r', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o',
-'n', 'f', 'i', 'g', 'R', '\020', 'c', 'u', 's', 't', 'o', 'm', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', '\032', '\222', '\001',
-'\n', '\023', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\033', '\n', '\004',
-'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e',
-'\022', 'O', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e',
-'d', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd',
-'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '\003', '\370', 'B', '\001', '\032', 'm', '\n', '\033',
-'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n',
-'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', 'N', 'a', 'm', 'e', '\032', '\364', '\006', '\n', '$', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\217',
-'\001', '\n', '\032', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
-'s', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
-'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\030', 'd', 'e', 'f', 'a', 'u',
-'l', 't', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\266', '\001', '\n', '$', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c',
-'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
-'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', 'B', '*', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm', 'i',
-'c', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', ' ', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '\312', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e',
-'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\003',
-' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't',
-'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C',
-'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\"', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm',
-'i', 'c', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', '$', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
-'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\343', '\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_',
-'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i',
-'d', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o',
+'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'K', 'e', 'y', 'L', 'o', 'g', 'R', '\006', 'k',
+'e', 'y', 'L', 'o', 'g', '\032', '\222', '\001', '\n', '\023', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'O', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H',
+'\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022',
+'\003', '\370', 'B', '\001', '\032', 'm', '\n', '\033', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd',
+'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '_', 'n', 'a',
+'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n',
+'\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017',
+'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'N', 'a', 'm', 'e', '\032', '\244', '\006', '\n', '$', 'C', 'o', 'm', 'b', 'i',
+'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C',
+'o', 'n', 't', 'e', 'x', 't', '\022', '\217', '\001', '\n', '\032', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o',
'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n',
-'t', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I',
-'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\"', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', ',', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r',
-'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', ':', 'N', '\232', '\305', '\210', '\036', 'I', '\n', 'G', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', ':', ')', '\232', '\305', '\210', '\036',
-'$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm', 'm',
-'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\031', '\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
-'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'B', 'M', '\n', '7', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
-'s', '.', 'v', '3', 'B', '\010', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V',
+'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020',
+'\001', 'R', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e',
+'x', 't', '\022', '\224', '\001', '\n', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't',
+'_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2',
+':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c',
+'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', ' ', 'v', 'a', 'l', 'i',
+'d', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', '\263', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x',
+'t', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\003', ' ',
+'\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o',
+'m', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '$', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
+'t', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\314', '\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n',
+'_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
+'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o',
+'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
+'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', ',', 'v', 'a',
+'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', ':', 'N', '\232', '\305', '\210', '\036', 'I', '\n',
+'G', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm', 'm', 'o', 'n',
+'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', ':', ')', '\232',
+'\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C',
+'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\031', '\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'B', '\245',
+'\001', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
+'s', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\010', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'V', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n',
+'t', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/',
+'v', '3', ';', 't', 'l', 's', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[10] = {
+static _upb_DefPool_Init *deps[11] = {
+ &envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit,
&envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
- &udpa_annotations_migrate_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit = {
+_upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/tls.proto",
- UPB_STRVIEW_INIT(descriptor, 4707)
+ UPB_STRINGVIEW_INIT(descriptor, 5249)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h
index c11d6752..5b410820 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h
@@ -19,36 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.TlsKeyLog");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProviderInstance");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider");
}
-UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CombinedCertificateValidationContext");
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProviderInstance");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CombinedCertificateValidationContext");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c
new file mode 100644
index 00000000..17c6be1e
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c
@@ -0,0 +1,58 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h"
+
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[678] = {'\n', 'K', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 't', 'l', 's', '_', 's', 'p',
+'i', 'f', 'f', 'e', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o',
+'t', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
+'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\215', '\002', '\n', '\031', 'S', 'P', 'I', 'F', 'F', 'E', 'C', 'e', 'r', 't', 'V',
+'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\177', '\n', '\r', 't', 'r', 'u', 's', 't', '_', 'd',
+'o', 'm', 'a', 'i', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', 'P', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', '.', 'S', 'P', 'I', 'F', 'F', 'E', 'C', 'e', 'r', 't', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'o',
+'r', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'T', 'r', 'u', 's', 't', 'D', 'o', 'm', 'a', 'i', 'n', 'B', '\010', '\372', 'B', '\005', '\222',
+'\001', '\002', '\010', '\001', 'R', '\014', 't', 'r', 'u', 's', 't', 'D', 'o', 'm', 'a', 'i', 'n', 's', '\032', 'o', '\n', '\013', 'T', 'r', 'u',
+'s', 't', 'D', 'o', 'm', 'a', 'i', 'n', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
+'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'C', '\n', '\014', 't', 'r', 'u', 's', 't', '_', 'b', 'u', 'n',
+'d', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\013', 't', 'r', 'u', 's', 't',
+'B', 'u', 'n', 'd', 'l', 'e', 'B', '\272', '\001', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r',
+'t', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\035', 'T', 'l', 's', 'S', 'p', 'i', 'f',
+'f', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z',
+'V', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o',
+'-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/',
+'t', 'l', 's', '/', 'v', '3', ';', 't', 'l', 's', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upbdefinit = {
+ deps,
+ &envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upb_file_layout,
+ "envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 678)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h
new file mode 100644
index 00000000..ffd02efc
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_
+#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_extensions_transport_sockets_tls_v3_tls_spiffe_validator_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.extensions.transport_sockets.tls.v3.SPIFFECertValidatorConfig.TrustDomain");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_SPIFFE_VALIDATOR_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
deleted file mode 100644
index 6fbd46bf..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* 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 "upb/def.h"
-#include "envoy/service/cluster/v3/cds.upbdefs.h"
-
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_cluster_v3_CdsDummy_msginit,
-};
-
-static const char descriptor[815] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v',
-'3', '/', 'c', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
-'e', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i',
-'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o', 't', 'a',
-'t', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a',
-'t', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
-'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
-'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '(', '\n', '\010', 'C', 'd', 's', 'D', 'u', 'm', 'm', 'y', ':', '\034',
-'\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'd', 's', 'D', 'u',
-'m', 'm', 'y', '2', '\315', '\003', '\n', '\027', 'C', 'l', 'u', 's', 't', 'e', 'r', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S',
-'e', 'r', 'v', 'i', 'c', 'e', '\022', 's', '\n', '\016', 'S', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022',
-',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
-'.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n',
-'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.',
-'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '|',
-'\n', '\r', 'D', 'e', 'l', 't', 'a', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
-'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a',
-'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't',
-'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022',
-'\225', '\001', '\n', '\r', 'F', 'e', 't', 'c', 'h', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's',
-'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r',
-'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\'', '\202', '\323', '\344', '\223', '\002', '\030', '\"', '\026', '/', 'v', '3', '/', 'd',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\202', '\323', '\344', '\223', '\002', '\003', ':', '\001',
-'*', '\032', '\'', '\212', '\244', '\226', '\363', '\007', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'B', '?', '\n', '&', 'i', 'o', '.', 'e',
-'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', 'B', '\010', 'C', 'd', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[6] = {
- &envoy_service_discovery_v3_discovery_proto_upbdefinit,
- &google_api_annotations_proto_upbdefinit,
- &envoy_annotations_resource_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
- &udpa_annotations_versioning_proto_upbdefinit,
- NULL
-};
-
-upb_def_init envoy_service_cluster_v3_cds_proto_upbdefinit = {
- deps,
- layouts,
- "envoy/service/cluster/v3/cds.proto",
- UPB_STRVIEW_INIT(descriptor, 815)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h
deleted file mode 100644
index dd296493..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_UPBDEFS_H_
-#define ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init envoy_service_cluster_v3_cds_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *envoy_service_cluster_v3_CdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_cluster_v3_cds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.cluster.v3.CdsDummy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
index f741848c..f7ce2ecb 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/service/discovery/v3/ads.upbdefs.h"
+#include "envoy/service/discovery/v3/ads.upb.h"
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_discovery_v3_AdsDummy_msginit,
-};
-
-static const char descriptor[604] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
+extern _upb_DefPool_Init envoy_service_discovery_v3_discovery_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[684] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
'/', 'v', '3', '/', 'a', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\032', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v',
'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's',
'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o',
@@ -39,22 +34,25 @@ static const char descriptor[604] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 's
'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'e',
'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3',
'.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000',
-'(', '\001', '0', '\001', 'B', 'A', '\n', '(', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
-'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', 'B', '\010',
-'A', 'd', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'(', '\001', '0', '\001', 'B', '\220', '\001', '\n', '(', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n',
+'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', 'B',
+'\010', 'A', 'd', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'M', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n',
+'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
+'/', 'v', '3', ';', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'v', '3', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&envoy_service_discovery_v3_discovery_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_service_discovery_v3_ads_proto_upbdefinit = {
+_upb_DefPool_Init envoy_service_discovery_v3_ads_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_discovery_v3_ads_proto_upb_file_layout,
"envoy/service/discovery/v3/ads.proto",
- UPB_STRVIEW_INIT(descriptor, 604)
+ UPB_STRINGVIEW_INIT(descriptor, 684)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h
index de50c9f6..fa40716b 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_service_discovery_v3_ads_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_service_discovery_v3_ads_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_AdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_ads_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.AdsDummy");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_AdsDummy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_ads_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.AdsDummy");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
index 0df3b7b3..52810bbb 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
@@ -8,32 +8,15 @@
#include "upb/def.h"
#include "envoy/service/discovery/v3/discovery.upbdefs.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_rpc_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-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;
-extern const upb_msglayout envoy_service_discovery_v3_Resource_CacheControl_msginit;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_service_discovery_v3_DiscoveryRequest_msginit,
- &envoy_service_discovery_v3_DiscoveryResponse_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit,
- &envoy_service_discovery_v3_Resource_msginit,
- &envoy_service_discovery_v3_Resource_CacheControl_msginit,
-};
-
-static const char descriptor[2206] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_rpc_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[2286] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
'/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\032', 'e', 'n', 'v', 'o',
'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '\032', '\037', 'e',
'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.',
@@ -118,13 +101,16 @@ static const char descriptor[2206] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', '
'\n', '\014', 'C', 'a', 'c', 'h', 'e', 'C', 'o', 'n', 't', 'r', 'o', 'l', '\022', ' ', '\n', '\014', 'd', 'o', '_', 'n', 'o', 't', '_',
'c', 'a', 'c', 'h', 'e', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\n', 'd', 'o', 'N', 'o', 't', 'C', 'a', 'c', 'h', 'e', ':', '\034',
'\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'R', 'e', 's', 'o', 'u',
-'r', 'c', 'e', 'B', 'D', '\n', '(', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
-'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', 'B', '\016', 'D',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
-'p', 'r', 'o', 't', 'o', '3',
+'r', 'c', 'e', 'B', '\223', '\001', '\n', '(', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
+'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', 'B', '\016',
+'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'M', 'g', 'i', 't', 'h', 'u', 'b', '.',
+'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l',
+'-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c',
+'o', 'v', 'e', 'r', 'y', '/', 'v', '3', ';', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[7] = {
+static _upb_DefPool_Init *deps[7] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -134,9 +120,9 @@ static upb_def_init *deps[7] = {
NULL
};
-upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit = {
+_upb_DefPool_Init envoy_service_discovery_v3_discovery_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_discovery_v3_discovery_proto_upb_file_layout,
"envoy/service/discovery/v3/discovery.proto",
- UPB_STRVIEW_INIT(descriptor, 2206)
+ UPB_STRINGVIEW_INIT(descriptor, 2286)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h
index 770d46d6..48612592 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h
@@ -19,41 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_DiscoveryRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.DiscoveryRequest");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DiscoveryRequest_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DiscoveryRequest");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_DiscoveryResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.DiscoveryResponse");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DiscoveryResponse_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DiscoveryResponse");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_DeltaDiscoveryRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryRequest_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest.InitialResourceVersionsEntry");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryRequest.InitialResourceVersionsEntry");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_DeltaDiscoveryResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.DeltaDiscoveryResponse");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_DeltaDiscoveryResponse_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.DeltaDiscoveryResponse");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_Resource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.Resource");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_Resource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.Resource");
}
-UPB_INLINE const upb_msgdef *envoy_service_discovery_v3_Resource_CacheControl_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.discovery.v3.Resource.CacheControl");
+UPB_INLINE const upb_MessageDef *envoy_service_discovery_v3_Resource_CacheControl_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_discovery_v3_discovery_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.discovery.v3.Resource.CacheControl");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
deleted file mode 100644
index c7667879..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* 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 "upb/def.h"
-#include "envoy/service/endpoint/v3/eds.upbdefs.h"
-
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_endpoint_v3_EdsDummy_msginit,
-};
-
-static const char descriptor[838] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/',
-'v', '3', '/', 'e', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
-'c', 'e', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r',
-'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o',
-'t', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o',
-'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r',
-'s', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '(', '\n', '\010', 'E', 'd', 's', 'D', 'u', 'm', 'm', 'y',
-':', '\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'E', 'd', 's',
-'D', 'u', 'm', 'm', 'y', '2', '\341', '\003', '\n', '\030', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'D', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 't', '\n', '\017', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'n', 'd', 'p', 'o', 'i',
-'n', 't', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o',
-'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032',
-'-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
-'.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001',
-'0', '\001', '\022', '}', '\n', '\016', 'D', 'e', 'l', 't', 'a', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', '1', '.', 'e', 'n',
-'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.',
-'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'e',
-'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3',
-'.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000',
-'(', '\001', '0', '\001', '\022', '\227', '\001', '\n', '\016', 'F', 'e', 't', 'c', 'h', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', ',',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.',
-'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v',
-'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '(', '\202', '\323', '\344', '\223', '\002', '\031', '\"',
-'\027', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\202',
-'\323', '\344', '\223', '\002', '\003', ':', '\001', '*', '\032', '6', '\212', '\244', '\226', '\363', '\007', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
-'L', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'B', '@', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o',
-'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'e', 'n', 'd', 'p',
-'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\010', 'E', 'd', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[6] = {
- &envoy_service_discovery_v3_discovery_proto_upbdefinit,
- &google_api_annotations_proto_upbdefinit,
- &envoy_annotations_resource_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
- &udpa_annotations_versioning_proto_upbdefinit,
- NULL
-};
-
-upb_def_init envoy_service_endpoint_v3_eds_proto_upbdefinit = {
- deps,
- layouts,
- "envoy/service/endpoint/v3/eds.proto",
- UPB_STRVIEW_INIT(descriptor, 838)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h
deleted file mode 100644
index c2804136..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_UPBDEFS_H_
-#define ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init envoy_service_endpoint_v3_eds_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *envoy_service_endpoint_v3_EdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_endpoint_v3_eds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.endpoint.v3.EdsDummy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
deleted file mode 100644
index c0a99342..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* 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 "upb/def.h"
-#include "envoy/service/listener/v3/lds.upbdefs.h"
-
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_listener_v3_LdsDummy_msginit,
-};
-
-static const char descriptor[825] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/',
-'v', '3', '/', 'l', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
-'c', 'e', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r',
-'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o',
-'t', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o',
-'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r',
-'s', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '(', '\n', '\010', 'L', 'd', 's', 'D', 'u', 'm', 'm', 'y',
-':', '\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'd', 's',
-'D', 'u', 'm', 'm', 'y', '2', '\324', '\003', '\n', '\030', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'D', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '}', '\n', '\016', 'D', 'e', 'l', 't', 'a', 'L', 'i', 's', 't', 'e', 'n', 'e',
-'r', 's', '\022', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v',
-'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u',
-'e', 's', 't', '\032', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o',
-'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', 't', '\n', '\017', 'S', 't', 'r', 'e', 'a', 'm', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's',
-'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's',
-'t', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000',
-'(', '\001', '0', '\001', '\022', '\227', '\001', '\n', '\016', 'F', 'e', 't', 'c', 'h', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', ',',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.',
-'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v',
-'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '(', '\202', '\323', '\344', '\223', '\002', '\031', '\"',
-'\027', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\202',
-'\323', '\344', '\223', '\002', '\003', ':', '\001', '*', '\032', ')', '\212', '\244', '\226', '\363', '\007', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e',
-'r', 'B', '@', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\010', 'L', 'd', 's', 'P',
-'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[6] = {
- &envoy_service_discovery_v3_discovery_proto_upbdefinit,
- &google_api_annotations_proto_upbdefinit,
- &envoy_annotations_resource_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
- &udpa_annotations_versioning_proto_upbdefinit,
- NULL
-};
-
-upb_def_init envoy_service_listener_v3_lds_proto_upbdefinit = {
- deps,
- layouts,
- "envoy/service/listener/v3/lds.proto",
- UPB_STRVIEW_INIT(descriptor, 825)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h
deleted file mode 100644
index 7c153003..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_UPBDEFS_H_
-#define ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init envoy_service_listener_v3_lds_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *envoy_service_listener_v3_LdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_listener_v3_lds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.listener.v3.LdsDummy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
index 830b3987..d32aff62 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
@@ -8,21 +8,14 @@
#include "upb/def.h"
#include "envoy/service/load_stats/v3/lrs.upbdefs.h"
+#include "envoy/service/load_stats/v3/lrs.upb.h"
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_endpoint_v3_load_report_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_service_load_stats_v3_LoadStatsRequest_msginit,
- &envoy_service_load_stats_v3_LoadStatsResponse_msginit,
-};
-
-static const char descriptor[958] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't',
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_endpoint_v3_load_report_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[1040] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't',
's', '/', 'v', '3', '/', 'l', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\033', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r',
'v', 'i', 'c', 'e', '.', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y',
'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't',
@@ -57,13 +50,16 @@ static const char descriptor[958] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 's
'a', 'd', '_', 's', 't', 'a', 't', 's', '.', 'v', '3', '.', 'L', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'R', 'e', 'q', 'u',
'e', 's', 't', '\032', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'l', 'o', 'a', 'd', '_',
's', 't', 'a', 't', 's', '.', 'v', '3', '.', 'L', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'R', 'e', 's', 'p', 'o', 'n', 's',
-'e', '\"', '\000', '(', '\001', '0', '\001', 'B', 'B', '\n', ')', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
-'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '.',
-'v', '3', 'B', '\010', 'L', 'r', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'e', '\"', '\000', '(', '\001', '0', '\001', 'B', '\223', '\001', '\n', ')', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's',
+'.', 'v', '3', 'B', '\010', 'L', 'r', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'O', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c',
+'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-',
+'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'o', 'a', 'd', '_',
+'s', 't', 'a', 't', 's', '/', 'v', '3', ';', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', 'v', '3', '\210', '\001', '\001', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_endpoint_v3_load_report_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
@@ -72,9 +68,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_service_load_stats_v3_lrs_proto_upbdefinit = {
+_upb_DefPool_Init envoy_service_load_stats_v3_lrs_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_load_stats_v3_lrs_proto_upb_file_layout,
"envoy/service/load_stats/v3/lrs.proto",
- UPB_STRVIEW_INIT(descriptor, 958)
+ UPB_STRINGVIEW_INIT(descriptor, 1040)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h
index ac71694d..a7f65b49 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_service_load_stats_v3_lrs_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_service_load_stats_v3_lrs_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_service_load_stats_v3_LoadStatsRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_load_stats_v3_lrs_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.load_stats.v3.LoadStatsRequest");
+UPB_INLINE const upb_MessageDef *envoy_service_load_stats_v3_LoadStatsRequest_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_load_stats_v3_lrs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.load_stats.v3.LoadStatsRequest");
}
-UPB_INLINE const upb_msgdef *envoy_service_load_stats_v3_LoadStatsResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_load_stats_v3_lrs_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.load_stats.v3.LoadStatsResponse");
+UPB_INLINE const upb_MessageDef *envoy_service_load_stats_v3_LoadStatsResponse_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_load_stats_v3_lrs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.load_stats.v3.LoadStatsResponse");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
deleted file mode 100644
index d6f94655..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* 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 "upb/def.h"
-#include "envoy/service/route/v3/rds.upbdefs.h"
-
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_route_v3_RdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_route_v3_RdsDummy_msginit,
-};
-
-static const char descriptor[1014] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/',
-'r', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
-'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '(', '\n', '\010', 'R', 'd', 's', 'D', 'u', 'm', 'm', 'y', ':', '\034', '\232', '\305', '\210', '\036',
-'\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'R', 'd', 's', 'D', 'u', 'm', 'm', 'y', '2',
-'\314', '\003', '\n', '\025', 'R', 'o', 'u', 't', 'e', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e',
-'\022', 'q', '\n', '\014', 'S', 't', 'r', 'e', 'a', 'm', 'R', 'o', 'u', 't', 'e', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c',
-'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v',
-'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r',
-'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', 'z', '\n', '\013', 'D', 'e', 'l', 't', 'a', 'R',
-'o', 'u', 't', 'e', 's', '\022', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's',
-'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R',
-'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i',
-'s', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
-'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\221', '\001', '\n', '\013', 'F', 'e', 't', 'c', 'h', 'R',
-'o', 'u', 't', 'e', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's',
-'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's',
-'t', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '%',
-'\202', '\323', '\344', '\223', '\002', '\026', '\"', '\024', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', 'r', 'o', 'u',
-'t', 'e', 's', '\202', '\323', '\344', '\223', '\002', '\003', ':', '\001', '*', '\032', '0', '\212', '\244', '\226', '\363', '\007', '*', '\n', '(', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'C',
-'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '2', '\313', '\001', '\n', '\033', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H',
-'o', 's', 't', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '\200', '\001', '\n', '\021', 'D',
-'e', 'l', 't', 'a', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 's', '\022', '1', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't',
-'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l',
-'t', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001',
-'\032', ')', '\212', '\244', '\226', '\363', '\007', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
-'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 'B', '=', '\n', '$', 'i', 'o', '.',
-'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\010', 'R', 'd', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[6] = {
- &envoy_service_discovery_v3_discovery_proto_upbdefinit,
- &google_api_annotations_proto_upbdefinit,
- &envoy_annotations_resource_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
- &udpa_annotations_versioning_proto_upbdefinit,
- NULL
-};
-
-upb_def_init envoy_service_route_v3_rds_proto_upbdefinit = {
- deps,
- layouts,
- "envoy/service/route/v3/rds.proto",
- UPB_STRVIEW_INIT(descriptor, 1014)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h
deleted file mode 100644
index c302bdc0..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_UPBDEFS_H_
-#define ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init envoy_service_route_v3_rds_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *envoy_service_route_v3_RdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_route_v3_rds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.route.v3.RdsDummy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
deleted file mode 100644
index a0609a2f..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* 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 "upb/def.h"
-#include "envoy/service/route/v3/srds.upbdefs.h"
-
-extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_route_v3_SrdsDummy_msginit,
-};
-
-static const char descriptor[851] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/',
-'s', 'r', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/',
-'d', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
-'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
-'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '*', '\n', '\t', 'S', 'r', 'd', 's', 'D', 'u', 'm', 'm', 'y', ':', '\035', '\232', '\305',
-'\210', '\036', '\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'S', 'r', 'd', 's', 'D', 'u', 'm',
-'m', 'y', '2', '\363', '\003', '\n', '\034', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'D', 'i', 's', 'c', 'o', 'v',
-'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'w', '\n', '\022', 'S', 't', 'r', 'e', 'a', 'm', 'S', 'c', 'o', 'p', 'e',
-'d', 'R', 'o', 'u', 't', 'e', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q', 'u',
-'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o',
-'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e',
-'\"', '\000', '(', '\001', '0', '\001', '\022', '\200', '\001', '\n', '\021', 'D', 'e', 'l', 't', 'a', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u',
-'t', 'e', 's', '\022', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o',
-'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 'q',
-'u', 'e', 's', 't', '\032', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c',
-'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'e', 'l', 't', 'a', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e',
-'s', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\236', '\001', '\n', '\021', 'F', 'e', 't', 'c', 'h', 'S', 'c', 'o',
-'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e',
-'.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e',
-'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's',
-'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', '\"', ',', '\202', '\323', '\344', '\223', '\002', '\035', '\"', '\033', '/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
-':', 's', 'c', 'o', 'p', 'e', 'd', '-', 'r', 'o', 'u', 't', 'e', 's', '\202', '\323', '\344', '\223', '\002', '\003', ':', '\001', '*', '\032', '6',
-'\212', '\244', '\226', '\363', '\007', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'B', '>', '\n', '$', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
-'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\t', 'S', 'r', 'd', 's',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
-};
-
-static upb_def_init *deps[6] = {
- &envoy_service_discovery_v3_discovery_proto_upbdefinit,
- &google_api_annotations_proto_upbdefinit,
- &envoy_annotations_resource_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
- &udpa_annotations_versioning_proto_upbdefinit,
- NULL
-};
-
-upb_def_init envoy_service_route_v3_srds_proto_upbdefinit = {
- deps,
- layouts,
- "envoy/service/route/v3/srds.proto",
- UPB_STRVIEW_INIT(descriptor, 851)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h
deleted file mode 100644
index 3e2be9dc..00000000
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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_UPBDEFS_H_
-#define ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init envoy_service_route_v3_srds_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *envoy_service_route_v3_SrdsDummy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_route_v3_srds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.route.v3.SrdsDummy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
index 2673ebbb..f66d8369 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
@@ -8,123 +8,146 @@
#include "upb/def.h"
#include "envoy/service/status/v3/csds.upbdefs.h"
+#include "envoy/service/status/v3/csds.upb.h"
-extern upb_def_init envoy_admin_v3_config_dump_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_node_proto_upbdefinit;
-extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit;
-extern const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_service_status_v3_ClientStatusRequest_msginit,
- &envoy_service_status_v3_PerXdsConfig_msginit,
- &envoy_service_status_v3_ClientConfig_msginit,
- &envoy_service_status_v3_ClientStatusResponse_msginit,
-};
-
-static const char descriptor[2001] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 's', 't', 'a', 't', 'u', 's', '/', 'v', '3',
+extern _upb_DefPool_Init envoy_admin_v3_config_dump_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_node_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_annotations_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[2751] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 's', 't', 'a', 't', 'u', 's', '/', 'v', '3',
'/', 'c', 's', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/',
'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'u', 'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v',
'3', '/', 'n', 'o', 'd', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
-'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\302', '\001', '\n', '\023', 'C', 'l', 'i', 'e', 'n',
-'t', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022', 'G', '\n', '\r', 'n', 'o', 'd', 'e', '_', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\014',
-'n', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 's', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\002', ' ', '\001', '(',
-'\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e', ':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\"', '\360', '\004', '\n', '\014', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '=', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n',
-'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n',
-'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022', 'T', '\n', '\r', 'c', 'l', 'i', 'e',
-'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\007', ' ', '\001', '(', '\016', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'g', 'o', 'o', 'g',
+'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p',
+'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\302', '\001', '\n', '\023', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q',
+'u', 'e', 's', 't', '\022', 'G', '\n', '\r', 'n', 'o', 'd', 'e', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003',
+'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\014', 'n', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e',
+'r', 's', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e',
+':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e',
+'s', 't', '\"', '\371', '\004', '\n', '\014', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '=', '\n', '\006', 's', 't',
+'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
+'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R',
+'\006', 's', 't', 'a', 't', 'u', 's', '\022', ']', '\n', '\r', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\030',
+'\007', ' ', '\001', '(', '\016', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a',
+'t', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's',
+'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't',
+'u', 's', '\022', 'N', '\n', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e',
+'n', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C',
+'l', 'u', 's', 't', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\r', 'c', 'l', 'u', 's',
+'t', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'R',
+'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\023', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v',
+'3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H',
+'\000', 'R', '\021', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\017', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'C', 'o', 'n',
+'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\020', '\n', '\016', 'p',
+'e', 'r', '_', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\213', '\006', '\n', '\014', 'C', 'l', 'i', 'e', 'n', 't', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n',
+'o', 'd', 'e', '\022', 'Q', '\n', '\n', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\003', '(', '\013', '2', '%',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.',
+'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'f', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'x', 'd',
+'s', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o',
-'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'B', '\002', '\030', '\001', 'R', '\014', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', '\022', 'N', '\n', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.',
-'C', 'l', 'u', 's', 't', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\r', 'c', 'l', 'u',
-'s', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e',
-'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\023', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.',
-'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p',
-'H', '\000', 'R', '\021', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\017',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2', '#', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'C', 'o',
-'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'n', 'f', 'i',
-'g', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's',
-'t', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\020', '\n', '\016',
-'p', 'e', 'r', '_', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\261', '\001', '\n', '\014', 'C', 'l', 'i', 'e', 'n', 't',
-'C', 'o', 'n', 'f', 'i', 'g', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004',
-'n', 'o', 'd', 'e', '\022', 'D', '\n', '\n', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\003', '(', '\013', '2',
-'%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3',
-'.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':',
-'+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a',
-'t', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\212', '\001', '\n', '\024', 'C',
-'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '=', '\n', '\006', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\001', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
-'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
-'\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r',
-'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't',
-'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '*', 'K', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u',
-'s', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'S', 'Y', 'N', 'C', 'E', 'D', '\020',
-'\001', '\022', '\014', '\n', '\010', 'N', 'O', 'T', '_', 'S', 'E', 'N', 'T', '\020', '\002', '\022', '\t', '\n', '\005', 'S', 'T', 'A', 'L', 'E', '\020',
-'\003', '\022', '\t', '\n', '\005', 'E', 'R', 'R', 'O', 'R', '\020', '\004', '*', 'c', '\n', '\022', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n',
-'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\016', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'U', 'N', 'K', 'N', 'O',
-'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', 'E', 'D', '\020',
-'\001', '\022', '\020', '\n', '\014', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'A', 'C', 'K', 'E', 'D', '\020', '\002', '\022', '\021', '\n', '\r', 'C', 'L',
-'I', 'E', 'N', 'T', '_', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\003', '2', '\270', '\002', '\n', '\034', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 'u', 's', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'w', '\n', '\022',
-'S', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o',
-'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n',
-'t', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\236', '\001', '\n', '\021', 'F', 'e', 't',
-'c', 'h', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
-'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R',
-'e', 's', 'p', 'o', 'n', 's', 'e', '\"', ',', '\202', '\323', '\344', '\223', '\002', '\035', '\"', '\033', '/', 'v', '3', '/', 'd', 'i', 's', 'c',
-'o', 'v', 'e', 'r', 'y', ':', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\202', '\323', '\344', '\223', '\002', '\003',
-':', '\001', '*', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
-'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', 'B', '\t', 'C', 's', 'd', 's',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'n', 'f', 'i', 'g', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'g', 'e',
+'n', 'e', 'r', 'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\032', '\342', '\003', '\n', '\020', 'G', 'e', 'n', 'e', 'r',
+'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\001',
+' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '!', '\n', '\014', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'i', 'n', 'f', 'o', '\030',
+'\003', ' ', '\001', '(', '\t', 'R', '\013', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'f', 'o', '\022', '3', '\n', '\n', 'x', 'd', 's',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '=', '\n', '\014',
+'l', 'a', 's', 't', '_', 'u', 'p', 'd', 'a', 't', 'e', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\013', 'l', 'a',
+'s', 't', 'U', 'p', 'd', 'a', 't', 'e', 'd', '\022', 'J', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 't', 'a', 't', 'u',
+'s', '\030', '\006', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's',
+'t', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'c', 'o',
+'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', 'I', '\n', '\r', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't',
+'u', 's', '\030', '\007', ' ', '\001', '(', '\016', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
+'.', 'C', 'l', 'i', 'e', 'n', 't', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'c', 'l',
+'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', 'C', '\n', '\013', 'e', 'r', 'r', 'o', 'r', '_', 's', 't', 'a', 't', 'e',
+'\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'U',
+'p', 'd', 'a', 't', 'e', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'S', 't', 'a', 't', 'e', 'R', '\n', 'e', 'r', 'r', 'o', 'r', 'S',
+'t', 'a', 't', 'e', '\022', ',', '\n', '\022', 'i', 's', '_', 's', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c',
+'e', '\030', '\t', ' ', '\001', '(', '\010', 'R', '\020', 'i', 's', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\212', '\001', '\n', '\024',
+'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '=', '\n', '\006', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
+'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
+'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
+'t', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '*', 'K', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't',
+'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'S', 'Y', 'N', 'C', 'E', 'D',
+'\020', '\001', '\022', '\014', '\n', '\010', 'N', 'O', 'T', '_', 'S', 'E', 'N', 'T', '\020', '\002', '\022', '\t', '\n', '\005', 'S', 'T', 'A', 'L', 'E',
+'\020', '\003', '\022', '\t', '\n', '\005', 'E', 'R', 'R', 'O', 'R', '\020', '\004', '*', 'c', '\n', '\022', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o',
+'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\016', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'U', 'N', 'K', 'N',
+'O', 'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', 'E', 'D',
+'\020', '\001', '\022', '\020', '\n', '\014', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'A', 'C', 'K', 'E', 'D', '\020', '\002', '\022', '\021', '\n', '\r', 'C',
+'L', 'I', 'E', 'N', 'T', '_', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\003', '2', '\270', '\002', '\n', '\034', 'C', 'l', 'i', 'e', 'n', 't',
+'S', 't', 'a', 't', 'u', 's', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'w', '\n',
+'\022', 'S', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v',
+'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e',
+'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't',
+'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\236', '\001', '\n', '\021', 'F', 'e',
+'t', 'c', 'h', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't',
+'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
+'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's',
+'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', ',', '\202', '\323', '\344', '\223', '\002', '\035', '\"', '\033', '/', 'v', '3', '/', 'd', 'i', 's',
+'c', 'o', 'v', 'e', 'r', 'y', ':', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\202', '\323', '\344', '\223', '\002',
+'\003', ':', '\001', '*', 'B', '\210', '\001', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n',
+'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', 'B', '\t', 'C', 's',
+'d', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'G', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/',
+'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 's', 't', 'a', 't', 'u', 's', '/', 'v', '3', ';', 's',
+'t', 'a', 't', 'u', 's', 'v', '3', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
'3',
};
-static upb_def_init *deps[8] = {
+static _upb_DefPool_Init *deps[10] = {
&envoy_admin_v3_config_dump_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_type_matcher_v3_node_proto_upbdefinit,
&google_api_annotations_proto_upbdefinit,
- &udpa_annotations_migrate_proto_upbdefinit,
+ &google_protobuf_any_proto_upbdefinit,
+ &google_protobuf_timestamp_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_service_status_v3_csds_proto_upbdefinit = {
+_upb_DefPool_Init envoy_service_status_v3_csds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_status_v3_csds_proto_upb_file_layout,
"envoy/service/status/v3/csds.proto",
- UPB_STRVIEW_INIT(descriptor, 2001)
+ UPB_STRINGVIEW_INIT(descriptor, 2751)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
index 91723cc1..e0e1f347 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
@@ -19,26 +19,31 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_service_status_v3_csds_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_service_status_v3_csds_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientStatusRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientStatusRequest");
+UPB_INLINE const upb_MessageDef *envoy_service_status_v3_ClientStatusRequest_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.status.v3.ClientStatusRequest");
}
-UPB_INLINE const upb_msgdef *envoy_service_status_v3_PerXdsConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.status.v3.PerXdsConfig");
+UPB_INLINE const upb_MessageDef *envoy_service_status_v3_PerXdsConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.status.v3.PerXdsConfig");
}
-UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientConfig_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientConfig");
+UPB_INLINE const upb_MessageDef *envoy_service_status_v3_ClientConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.status.v3.ClientConfig");
}
-UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientStatusResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientStatusResponse");
+UPB_INLINE const upb_MessageDef *envoy_service_status_v3_ClientConfig_GenericXdsConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.status.v3.ClientConfig.GenericXdsConfig");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_service_status_v3_ClientStatusResponse_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.service.status.v3.ClientStatusResponse");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c
new file mode 100644
index 00000000..3f2dd34e
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/cookie.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/http/v3/cookie.upbdefs.h"
+#include "envoy/type/http/v3/cookie.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[388] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', '/', 'c', 'o', 'o', 'k',
+'i', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p',
+'.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'p', '\n', '\006', 'C', 'o', 'o', 'k', 'i',
+'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\004', 'n', 'a', 'm', 'e', '\022', '5', '\n', '\003', 't', 't', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\252', '\001', '\002', '2', '\000', 'R', '\003', 't', 't', 'l', '\022', '\022', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\003', ' ', '\001', '(', '\t', 'R',
+'\004', 'p', 'a', 't', 'h', 'B', '{', '\n', ' ', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', 'B', '\013', 'C', 'o', 'o', 'k', 'i', 'e', 'P',
+'r', 'o', 't', 'o', 'P', '\001', 'Z', '@', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v',
+'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', ';', 'h', 't', 't', 'p', 'v', '3', '\272', '\200', '\310',
+'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &google_protobuf_duration_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_http_v3_cookie_proto_upbdefinit = {
+ deps,
+ &envoy_type_http_v3_cookie_proto_upb_file_layout,
+ "envoy/type/http/v3/cookie.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 388)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h
new file mode 100644
index 00000000..88eaa0b1
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/cookie.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_http_v3_cookie_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_http_v3_Cookie_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_http_v3_cookie_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.http.v3.Cookie");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_COOKIE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
new file mode 100644
index 00000000..67cc5a53
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
@@ -0,0 +1,56 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/http/v3/path_transformation.upbdefs.h"
+#include "envoy/type/http/v3/path_transformation.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[685] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', '/', 'p', 'a', 't', 'h',
+'_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\236', '\003',
+'\n', '\022', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', 'P', '\n', '\n', 'o',
+'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm',
+'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o',
+'n', 's', '\032', '\265', '\002', '\n', '\t', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\022', '~', '\n', '\027', 'n', 'o', 'r', 'm', 'a',
+'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'f', 'c', '_', '3', '9', '8', '6', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'E', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h',
+'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '.',
+'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'F', 'C', '3', '9', '8', '6', 'H', '\000', 'R', '\024', 'n',
+'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'f', 'c', '3', '9', '8', '6', '\022', 'd', '\n', '\r', 'm', 'e',
+'r', 'g', 'e', '_', 's', 'l', 'a', 's', 'h', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o',
+'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '.', 'M', 'e', 'r', 'g', 'e', 'S', 'l',
+'a', 's', 'h', 'e', 's', 'H', '\000', 'R', '\014', 'm', 'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', '\032', '\026', '\n', '\024',
+'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'F', 'C', '3', '9', '8', '6', '\032', '\016', '\n', '\014', 'M',
+'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', 'B', '\032', '\n', '\023', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '_',
+'s', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\207', '\001', '\n', ' ', 'i', 'o', '.', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v',
+'3', 'B', '\027', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't',
+'o', 'P', '\001', 'Z', '@', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/',
+'t', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', ';', 'h', 't', 't', 'p', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_http_v3_path_transformation_proto_upbdefinit = {
+ deps,
+ &envoy_type_http_v3_path_transformation_proto_upb_file_layout,
+ "envoy/type/http/v3/path_transformation.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 685)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h
new file mode 100644
index 00000000..42cefd9f
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_http_v3_path_transformation_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_http_v3_PathTransformation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.http.v3.PathTransformation");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_http_v3_PathTransformation_Operation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.http.v3.PathTransformation.Operation");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.http.v3.PathTransformation.Operation.MergeSlashes");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c
new file mode 100644
index 00000000..50facfcd
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/http_inputs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/matcher/v3/http_inputs.upbdefs.h"
+#include "envoy/type/matcher/v3/http_inputs.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[579] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'h',
+'t', 't', 'p', '_', 'i', 'n', 'p', 'u', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'K', '\n', '\033', 'H',
+'t', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'I', 'n', 'p', 'u',
+'t', '\022', ',', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372',
+'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\"', 'L', '\n',
+'\034', 'H', 't', 't', 'p', 'R', 'e', 'q', 'u', 'e', 's', 't', 'T', 'r', 'a', 'i', 'l', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'I',
+'n', 'p', 'u', 't', '\022', ',', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e',
+'\"', 'L', '\n', '\034', 'H', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't',
+'c', 'h', 'I', 'n', 'p', 'u', 't', '\022', ',', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N',
+'a', 'm', 'e', '\"', 'M', '\n', '\035', 'H', 't', 't', 'p', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'T', 'r', 'a', 'i', 'l', 'e',
+'r', 'M', 'a', 't', 'c', 'h', 'I', 'n', 'p', 'u', 't', '\022', ',', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm',
+'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a',
+'d', 'e', 'r', 'N', 'a', 'm', 'e', 'B', '\210', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\017', 'H',
+'t', 't', 'p', 'I', 'n', 'p', 'u', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.',
+'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l',
+'-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
+'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_matcher_v3_http_inputs_proto_upbdefinit = {
+ deps,
+ &envoy_type_matcher_v3_http_inputs_proto_upb_file_layout,
+ "envoy/type/matcher/v3/http_inputs.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 579)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h
new file mode 100644
index 00000000..b78331cd
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/matcher/v3/http_inputs.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_matcher_v3_http_inputs_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpRequestHeaderMatchInput_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_http_inputs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.HttpRequestHeaderMatchInput");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpRequestTrailerMatchInput_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_http_inputs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.HttpRequestTrailerMatchInput");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpResponseHeaderMatchInput_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_http_inputs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.HttpResponseHeaderMatchInput");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_HttpResponseTrailerMatchInput_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_http_inputs_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.HttpResponseTrailerMatchInput");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_MATCHER_V3_HTTP_INPUTS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
index f4afda70..0548bd3f 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
@@ -8,27 +8,20 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/metadata.upbdefs.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
-extern upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
-};
-
-static const char descriptor[621] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm',
+extern _upb_DefPool_Init envoy_type_matcher_v3_value_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[718] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm',
'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm',
'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v', 'a', 'l', 'u', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd',
'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o',
't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's',
'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\347', '\002', '\n', '\017', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\377', '\002', '\n', '\017', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\037', '\n', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'P', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002',
' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
@@ -36,19 +29,23 @@ static const char descriptor[621] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't
'e', 'g', 'm', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'C', '\n',
'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\032', 'q', '\n', '\013', 'P', 'a', 't', 'h', 'S',
-'e', 'g', 'm', 'e', 'n', 't', '\022', '\033', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'H', '\000', 'R', '\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c',
-'h', 'e', 'r', '.', 'P', 'a', 't', 'h', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'B', '\016', '\n', '\007', 's', 'e', 'g', 'm', 'e', 'n',
-'t', '\022', '\003', '\370', 'B', '\001', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'>', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '\026', '\n', '\006', 'i', 'n', 'v', 'e', 'r',
+'t', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\006', 'i', 'n', 'v', 'e', 'r', 't', '\032', 'q', '\n', '\013', 'P', 'a', 't', 'h', 'S', 'e',
+'g', 'm', 'e', 'n', 't', '\022', '\033', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', 'H', '\000', 'R', '\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'P', 'a', 't', 'h', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'B', '\016', '\n', '\007', 's', 'e', 'g', 'm', 'e', 'n', 't',
+'\022', '\003', '\370', 'B', '\001', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\206',
+'\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'P', 'r',
-'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o',
+'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_matcher_v3_value_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -56,9 +53,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_metadata_proto_upb_file_layout,
"envoy/type/matcher/v3/metadata.proto",
- UPB_STRVIEW_INIT(descriptor, 621)
+ UPB_STRINGVIEW_INIT(descriptor, 718)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h
index c7154a71..a2685f79 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_metadata_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_MetadataMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.MetadataMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_MetadataMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.MetadataMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_MetadataMatcher_PathSegment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.MetadataMatcher.PathSegment");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_MetadataMatcher_PathSegment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.MetadataMatcher.PathSegment");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
index 8b0ecb58..9085c0d9 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/node.upbdefs.h"
+#include "envoy/type/matcher/v3/node.upb.h"
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_struct_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_NodeMatcher_msginit,
-};
-
-static const char descriptor[458] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_struct_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[531] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
'o', 'd', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y',
@@ -34,13 +29,16 @@ static const char descriptor[458] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't
'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't',
'r', 'u', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\r', 'n', 'o', 'd', 'e', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
's', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c',
-'h', 'e', 'r', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', ':', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v',
-'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
-'r', '.', 'v', '3', 'B', '\t', 'N', 'o', 'd', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'h', 'e', 'r', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\202', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', 'B', '\t', 'N', 'o', 'd', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u',
+'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r',
+'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
+'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_matcher_v3_string_proto_upbdefinit,
&envoy_type_matcher_v3_struct_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -48,9 +46,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_node_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_node_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_node_proto_upb_file_layout,
"envoy/type/matcher/v3/node.proto",
- UPB_STRVIEW_INIT(descriptor, 458)
+ UPB_STRINGVIEW_INIT(descriptor, 531)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h
index 9ec4a6de..8955d8cd 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_node_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_node_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_NodeMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_node_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.NodeMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_NodeMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_node_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.NodeMatcher");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
index a7f8fda0..5349417d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/number.upbdefs.h"
+#include "envoy/type/matcher/v3/number.upb.h"
-extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_DoubleMatcher_msginit,
-};
-
-static const char descriptor[404] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[477] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
'u', 'm', 'b', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/',
'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
@@ -32,13 +27,16 @@ static const char descriptor[404] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', '
'\005', 'e', 'x', 'a', 'c', 't', '\030', '\002', ' ', '\001', '(', '\001', 'H', '\000', 'R', '\005', 'e', 'x', 'a', 'c', 't', ':', '\'', '\232', '\305',
'\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'D',
'o', 'u', 'b', 'l', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\024', '\n', '\r', 'm', 'a', 't', 'c', 'h', '_', 'p', 'a', 't',
-'t', 'e', 'r', 'n', '\022', '\003', '\370', 'B', '\001', 'B', '<', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
-'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\013',
-'N', 'u', 'm', 'b', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'t', 'e', 'r', 'n', '\022', '\003', '\370', 'B', '\001', 'B', '\204', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
+'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B',
+'\013', 'N', 'u', 'm', 'b', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v',
+'3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_v3_range_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -46,9 +44,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_number_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_number_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_number_proto_upb_file_layout,
"envoy/type/matcher/v3/number.proto",
- UPB_STRVIEW_INIT(descriptor, 404)
+ UPB_STRINGVIEW_INIT(descriptor, 477)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h
index 0700bd6b..37c32c76 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_number_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_number_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_DoubleMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_number_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.DoubleMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_DoubleMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_number_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.DoubleMatcher");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
index f003b046..cd946fd5 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/path.upbdefs.h"
+#include "envoy/type/matcher/v3/path.upb.h"
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_PathMatcher_msginit,
-};
-
-static const char descriptor[390] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'p',
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[463] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'p',
'a', 't', 'h', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
@@ -31,13 +26,16 @@ static const char descriptor[390] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't
'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h',
'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', ':', '%', '\232', '\305', '\210',
'\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'P', 'a',
-'t', 'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', 'B', ':', '\n',
-'#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\t', 'P', 'a', 't', 'h', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'t', 'h', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\202', '\001',
+'\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\t', 'P', 'a', 't', 'h', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p',
+'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310',
+'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_matcher_v3_string_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -45,9 +43,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_path_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_path_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_path_proto_upb_file_layout,
"envoy/type/matcher/v3/path.proto",
- UPB_STRVIEW_INIT(descriptor, 390)
+ UPB_STRINGVIEW_INIT(descriptor, 463)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h
index a73daa4c..c1d13208 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_path_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_path_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_PathMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_path_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.PathMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_PathMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_path_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.PathMatcher");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
index 8805d24c..997ed6f0 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
@@ -8,66 +8,63 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/regex.upbdefs.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
-};
-
-static const char descriptor[776] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r',
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[895] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r',
'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
-'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
-'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'.', 'p', 'r', 'o', 't', 'o', '\"', '\317', '\002', '\n', '\014', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'X',
-'\n', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '_', 'r', 'e', '2', '\030', '\001', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o',
-'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'H', '\000', 'R', '\t', 'g', 'o', 'o', 'g', 'l', 'e', 'R', 'e', '2', '\022', '\035', '\n', '\005', 'r', 'e', 'g', 'e', 'x', '\030', '\002', ' ',
-'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\032', '\211', '\001', '\n', '\t', 'G',
-'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', '\022', 'J', '\n', '\020', 'm', 'a', 'x', '_', 'p', 'r', 'o', 'g', 'r', 'a', 'm', '_', 's',
-'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\016', 'm', 'a', 'x', 'P', 'r',
-'o', 'g', 'r', 'a', 'm', 'S', 'i', 'z', 'e', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 't',
-'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 't',
-'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\022', '\n', '\013', 'e', 'n', 'g', 'i', 'n', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\271', '\001', '\n', '\027', 'R',
-'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', '\022', 'G', '\n',
-'\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\"', '\n', '\014', 's',
-'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 's', 't', 'i',
-'t', 'u', 't', 'i', 'o', 'n', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b',
-'s', 't', 'i', 't', 'u', 't', 'e', 'B', ';', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
-'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'R', 'e',
-'g', 'e', 'x', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\330', '\002', '\n', '\014', 'R', 'e',
+'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'X', '\n', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '_', 'r', 'e', '2', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'R',
+'E', '2', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 'g', 'o', 'o', 'g', 'l', 'e', 'R', 'e', '2',
+'\022', '\035', '\n', '\005', 'r', 'e', 'g', 'e', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\005', 'r', 'e', 'g', 'e', 'x', '\032', '\222', '\001', '\n', '\t', 'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', '\022', 'S', '\n', '\020', 'm',
+'a', 'x', '_', 'p', 'r', 'o', 'g', 'r', 'a', 'm', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\016', 'm', 'a', 'x', 'P', 'r', 'o', 'g', 'r', 'a',
+'m', 'S', 'i', 'z', 'e', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g',
+'l', 'e', 'R', 'E', '2', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\022', '\n', '\013', 'e',
+'n', 'g', 'i', 'n', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\271', '\001', '\n', '\027', 'R', 'e', 'g', 'e', 'x',
+'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', '\022', 'G', '\n', '\007', 'p', 'a', 't',
+'t', 'e', 'r', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\"', '\n', '\014', 's', 'u', 'b', 's', 't',
+'i', 't', 'u', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i',
+'o', 'n', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't',
+'u', 't', 'e', 'B', '\203', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
+'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'R', 'e', 'g', 'e', 'x',
+'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h',
+'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[6] = {
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_regex_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_regex_proto_upb_file_layout,
"envoy/type/matcher/v3/regex.proto",
- UPB_STRVIEW_INIT(descriptor, 776)
+ UPB_STRINGVIEW_INIT(descriptor, 895)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h
index 200737c6..29e40fae 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_regex_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_RegexMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.RegexMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_RegexMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.RegexMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.RegexMatcher.GoogleRE2");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.RegexMatcher.GoogleRE2");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_RegexMatchAndSubstitute_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.RegexMatchAndSubstitute");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_RegexMatchAndSubstitute_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_regex_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.RegexMatchAndSubstitute");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
index 4844b106..c7d47a36 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
@@ -8,20 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/string.upbdefs.h"
+#include "envoy/type/matcher/v3/string.upb.h"
-extern upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_ListStringMatcher_msginit,
-};
-
-static const char descriptor[738] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
+extern _upb_DefPool_Init envoy_type_matcher_v3_regex_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[811] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't',
'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a',
@@ -47,13 +40,16 @@ static const char descriptor[738] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', '
'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c',
'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'p', 'a', 't', 't', 'e', 'r', 'n', 's', ':', '+',
'\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
-'.', 'L', 'i', 's', 't', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '<', '\n', '#', 'i', 'o', '.',
-'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
-'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'.', 'L', 'i', 's', 't', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\204', '\001', '\n', '#', 'i', 'o',
+'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-',
+'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_matcher_v3_regex_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -61,9 +57,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_string_proto_upb_file_layout,
"envoy/type/matcher/v3/string.proto",
- UPB_STRVIEW_INIT(descriptor, 738)
+ UPB_STRINGVIEW_INIT(descriptor, 811)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h
index b0da1e7d..f06fa7fa 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_StringMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_string_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.StringMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_StringMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_string_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.StringMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_ListStringMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_string_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.ListStringMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ListStringMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_string_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.ListStringMatcher");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
index 6660ffad..0b63c1e1 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
@@ -8,20 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/struct.upbdefs.h"
+#include "envoy/type/matcher/v3/struct.upb.h"
-extern upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_StructMatcher_msginit,
- &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
-};
-
-static const char descriptor[576] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
+extern _upb_DefPool_Init envoy_type_matcher_v3_value_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[649] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't',
'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v', 'a', 'l', 'u', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a',
@@ -41,13 +34,15 @@ static const char descriptor[576] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', '
't', 'r', 'u', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'P', 'a', 't', 'h', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'B',
'\016', '\n', '\007', 's', 'e', 'g', 'm', 'e', 'n', 't', '\022', '\003', '\370', 'B', '\001', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e',
'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'S', 't', 'r', 'u', 'c', 't', 'M',
-'a', 't', 'c', 'h', 'e', 'r', 'B', '<', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
-'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\013', 'S', 't', 'r',
-'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
+'a', 't', 'c', 'h', 'e', 'r', 'B', '\204', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
+'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\013', 'S', 't',
+'r', 'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e',
+'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n',
+'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm',
+'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_matcher_v3_value_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -55,9 +50,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_struct_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_struct_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_struct_proto_upb_file_layout,
"envoy/type/matcher/v3/struct.proto",
- UPB_STRVIEW_INIT(descriptor, 576)
+ UPB_STRINGVIEW_INIT(descriptor, 649)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h
index 472d486a..7cc209af 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_struct_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_struct_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_StructMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.StructMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_StructMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.StructMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_StructMatcher_PathSegment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.StructMatcher.PathSegment");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_StructMatcher_PathSegment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.StructMatcher.PathSegment");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
index ae878994..53d8f45c 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
@@ -8,23 +8,14 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/value.upbdefs.h"
+#include "envoy/type/matcher/v3/value.upb.h"
-extern upb_def_init envoy_type_matcher_v3_number_proto_upbdefinit;
-extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_matcher_v3_ValueMatcher_msginit,
- &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
- &envoy_type_matcher_v3_ListMatcher_msginit,
-};
-
-static const char descriptor[942] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v',
+extern _upb_DefPool_Init envoy_type_matcher_v3_number_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1015] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v',
'a', 'l', 'u', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
'h', 'e', 'r', '/', 'v', '3', '/', 'n', 'u', 'm', 'b', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o',
@@ -58,13 +49,16 @@ static const char descriptor[942] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't
't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c',
'h', 'e', 'r', 'H', '\000', 'R', '\005', 'o', 'n', 'e', 'O', 'f', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o',
'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'L', 'i', 's', 't', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'B', '\024', '\n', '\r', 'm', 'a', 't', 'c', 'h', '_', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\003', '\370', 'B', '\001', 'B', ';',
-'\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
-'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'V', 'a', 'l', 'u', 'e', 'P', 'r', 'o', 't', 'o', 'P',
-'\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'r', 'B', '\024', '\n', '\r', 'm', 'a', 't', 'c', 'h', '_', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\003', '\370', 'B', '\001', 'B', '\203',
+'\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'V', 'a', 'l', 'u', 'e', 'P', 'r', 'o', 't', 'o',
+'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't',
+'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', ';', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'v', '3', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static _upb_DefPool_Init *deps[6] = {
&envoy_type_matcher_v3_number_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -73,9 +67,9 @@ static upb_def_init *deps[6] = {
NULL
};
-upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_matcher_v3_value_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_value_proto_upb_file_layout,
"envoy/type/matcher/v3/value.proto",
- UPB_STRVIEW_INIT(descriptor, 942)
+ UPB_STRINGVIEW_INIT(descriptor, 1015)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h
index c049f62f..c673e1df 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_matcher_v3_value_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_ValueMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.ValueMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ValueMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.ValueMatcher");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_ValueMatcher_NullMatch_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.ValueMatcher.NullMatch");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ValueMatcher_NullMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.ValueMatcher.NullMatch");
}
-UPB_INLINE const upb_msgdef *envoy_type_matcher_v3_ListMatcher_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.matcher.v3.ListMatcher");
+UPB_INLINE const upb_MessageDef *envoy_type_matcher_v3_ListMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_matcher_v3_value_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.matcher.v3.ListMatcher");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
index 9b08fcaf..6bdc6042 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
@@ -8,29 +8,12 @@
#include "upb/def.h"
#include "envoy/type/metadata/v3/metadata.upbdefs.h"
+#include "envoy/type/metadata/v3/metadata.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
- &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
- &envoy_type_metadata_v3_MetadataKind_msginit,
- &envoy_type_metadata_v3_MetadataKind_Request_msginit,
- &envoy_type_metadata_v3_MetadataKind_Route_msginit,
- &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
- &envoy_type_metadata_v3_MetadataKind_Host_msginit,
-};
-
-static const char descriptor[1104] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1179] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/',
'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a',
@@ -71,22 +54,25 @@ static const char descriptor[1104] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', '
'a', 't', 'a', '.', 'v', '2', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'i', 'n', 'd', '.', 'H', 'o', 's', 't', ':',
'*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a',
't', 'a', '.', 'v', '2', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'i', 'n', 'd', 'B', '\013', '\n', '\004', 'k', 'i', 'n',
-'d', '\022', '\003', '\370', 'B', '\001', 'B', '?', '\n', '$', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
-'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', 'B', '\r', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
+'d', '\022', '\003', '\370', 'B', '\001', 'B', '\211', '\001', '\n', '$', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
+'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', 'B', '\r', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'H', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p',
+'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/',
+'v', '3', ';', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_metadata_v3_metadata_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_metadata_v3_metadata_proto_upb_file_layout,
"envoy/type/metadata/v3/metadata.proto",
- UPB_STRVIEW_INIT(descriptor, 1104)
+ UPB_STRINGVIEW_INIT(descriptor, 1179)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h
index f263f942..dd7fbeee 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h
@@ -19,41 +19,41 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_metadata_v3_metadata_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKey_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKey");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKey_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKey");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKey_PathSegment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKey.PathSegment");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKey_PathSegment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKey.PathSegment");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKind_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKind");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKind");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKind_Request_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKind.Request");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_Request_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKind.Request");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKind_Route_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKind.Route");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_Route_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKind.Route");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKind_Cluster_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKind.Cluster");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_Cluster_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKind.Cluster");
}
-UPB_INLINE const upb_msgdef *envoy_type_metadata_v3_MetadataKind_Host_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.metadata.v3.MetadataKind.Host");
+UPB_INLINE const upb_MessageDef *envoy_type_metadata_v3_MetadataKind_Host_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_metadata_v3_metadata_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.metadata.v3.MetadataKind.Host");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
index 27c5118a..b32d0d42 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
@@ -8,26 +8,13 @@
#include "upb/def.h"
#include "envoy/type/tracing/v3/custom_tag.upbdefs.h"
+#include "envoy/type/tracing/v3/custom_tag.upb.h"
-extern upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_tracing_v3_CustomTag_Literal_msginit,
- &envoy_type_tracing_v3_CustomTag_Environment_msginit,
- &envoy_type_tracing_v3_CustomTag_Header_msginit,
- &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
-};
-
-static const char descriptor[1249] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c',
+extern _upb_DefPool_Init envoy_type_metadata_v3_metadata_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1322] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c',
'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e',
'/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o',
@@ -74,12 +61,15 @@ static const char descriptor[1249] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', '
'g', '.', 'v', '2', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', ':', '&',
'\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g',
'.', 'v', '2', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'B', '\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B',
-'\001', 'B', '?', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'t', 'y', 'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', 'B', '\016', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a',
-'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\001', 'B', '\207', '\001', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', 'B', '\016', 'C', 'u', 's', 't', 'o', 'm', 'T',
+'a', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'F', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/',
+'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', ';', 't', 'r', 'a',
+'c', 'i', 'n', 'g', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&envoy_type_metadata_v3_metadata_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -87,9 +77,9 @@ static upb_def_init *deps[5] = {
NULL
};
-upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_tracing_v3_custom_tag_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_tracing_v3_custom_tag_proto_upb_file_layout,
"envoy/type/tracing/v3/custom_tag.proto",
- UPB_STRVIEW_INIT(descriptor, 1249)
+ UPB_STRINGVIEW_INIT(descriptor, 1322)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h
index 96203233..725360e6 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h
@@ -19,31 +19,31 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_tracing_v3_CustomTag_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.tracing.v3.CustomTag");
+UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.tracing.v3.CustomTag");
}
-UPB_INLINE const upb_msgdef *envoy_type_tracing_v3_CustomTag_Literal_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.tracing.v3.CustomTag.Literal");
+UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_Literal_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.tracing.v3.CustomTag.Literal");
}
-UPB_INLINE const upb_msgdef *envoy_type_tracing_v3_CustomTag_Environment_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.tracing.v3.CustomTag.Environment");
+UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_Environment_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.tracing.v3.CustomTag.Environment");
}
-UPB_INLINE const upb_msgdef *envoy_type_tracing_v3_CustomTag_Header_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.tracing.v3.CustomTag.Header");
+UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_Header_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.tracing.v3.CustomTag.Header");
}
-UPB_INLINE const upb_msgdef *envoy_type_tracing_v3_CustomTag_Metadata_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.tracing.v3.CustomTag.Metadata");
+UPB_INLINE const upb_MessageDef *envoy_type_tracing_v3_CustomTag_Metadata_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_tracing_v3_custom_tag_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.tracing.v3.CustomTag.Metadata");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c
new file mode 100644
index 00000000..1fb85ce3
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/hash_policy.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/v3/hash_policy.upbdefs.h"
+#include "envoy/type/v3/hash_policy.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[572] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'h', 'a', 's', 'h', '_', 'p', 'o', 'l', 'i',
+'c', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e',
+'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\002', '\n', '\n', 'H', 'a', 's', 'h', 'P', 'o',
+'l', 'i', 'c', 'y', '\022', 'A', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y',
+'.', 'S', 'o', 'u', 'r', 'c', 'e', 'I', 'p', 'H', '\000', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', '\022', 'J', '\n', '\014',
+'f', 'i', 'l', 't', 'e', 'r', '_', 's', 't', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o',
+'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't',
+'e', 'r', 'S', 't', 'a', 't', 'e', 'H', '\000', 'R', '\013', 'f', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\032', '1', '\n',
+'\010', 'S', 'o', 'u', 'r', 'c', 'e', 'I', 'p', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'I', 'p', '\032', '(',
+'\n', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', ':', '\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\027', '\n', '\020', 'p',
+'o', 'l', 'i', 'c', 'y', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', 'u', '\n', '\033', 'i',
+'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v',
+'3', 'B', '\017', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n',
+'t', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', ';',
+'t', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_v3_hash_policy_proto_upbdefinit = {
+ deps,
+ &envoy_type_v3_hash_policy_proto_upb_file_layout,
+ "envoy/type/v3/hash_policy.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 572)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h
new file mode 100644
index 00000000..eb0bb343
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h
@@ -0,0 +1,45 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/hash_policy.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_v3_hash_policy_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_v3_HashPolicy_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_hash_policy_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.HashPolicy");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_v3_HashPolicy_SourceIp_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_hash_policy_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.HashPolicy.SourceIp");
+}
+
+UPB_INLINE const upb_MessageDef *envoy_type_v3_HashPolicy_FilterState_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_hash_policy_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.HashPolicy.FilterState");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_HASH_POLICY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
index 4dd38687..091b8453 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
@@ -8,27 +8,29 @@
#include "upb/def.h"
#include "envoy/type/v3/http.upbdefs.h"
+#include "envoy/type/v3/http.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-
-static const char descriptor[184] = {'\n', '\030', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+static const char descriptor[245] = {'\n', '\030', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't',
'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '*', '2', '\n',
'\017', 'C', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '1',
'\020', '\000', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '2', '\020', '\001', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '3', '\020', '\002', 'B',
-'2', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', 'B', '\t', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 'v', '3', 'B', '\t', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i', 't', 'h', 'u',
+'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r',
+'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', ';', 't', 'y',
+'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&udpa_annotations_status_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_v3_http_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_v3_http_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_type_v3_http_proto_upb_file_layout,
"envoy/type/v3/http.proto",
- UPB_STRVIEW_INIT(descriptor, 184)
+ UPB_STRINGVIEW_INIT(descriptor, 245)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h
index c71ed1bb..10dfa7bb 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h
@@ -19,7 +19,7 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_v3_http_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_http_proto_upbdefinit;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c
new file mode 100644
index 00000000..9bf68dd9
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c
@@ -0,0 +1,94 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http_status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/v3/http_status.upbdefs.h"
+#include "envoy/type/v3/http_status.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[1577] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e',
+'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'e', '\n', '\n', 'H', 't', 't', 'p', 'S', 't', 'a',
+'t', 'u', 's', '\022', '9', '\n', '\004', 'c', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', 'B', '\n', '\372', 'B', '\007', '\202',
+'\001', '\004', '\020', '\001', ' ', '\000', 'R', '\004', 'c', 'o', 'd', 'e', ':', '\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o',
+'y', '.', 't', 'y', 'p', 'e', '.', 'H', 't', 't', 'p', 'S', 't', 'a', 't', 'u', 's', '*', '\265', '\t', '\n', '\n', 'S', 't', 'a',
+'t', 'u', 's', 'C', 'o', 'd', 'e', '\022', '\t', '\n', '\005', 'E', 'm', 'p', 't', 'y', '\020', '\000', '\022', '\014', '\n', '\010', 'C', 'o', 'n',
+'t', 'i', 'n', 'u', 'e', '\020', 'd', '\022', '\007', '\n', '\002', 'O', 'K', '\020', '\310', '\001', '\022', '\014', '\n', '\007', 'C', 'r', 'e', 'a', 't',
+'e', 'd', '\020', '\311', '\001', '\022', '\r', '\n', '\010', 'A', 'c', 'c', 'e', 'p', 't', 'e', 'd', '\020', '\312', '\001', '\022', ' ', '\n', '\033', 'N',
+'o', 'n', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'a', 't', 'i', 'v', 'e', 'I', 'n', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
+'n', '\020', '\313', '\001', '\022', '\016', '\n', '\t', 'N', 'o', 'C', 'o', 'n', 't', 'e', 'n', 't', '\020', '\314', '\001', '\022', '\021', '\n', '\014', 'R',
+'e', 's', 'e', 't', 'C', 'o', 'n', 't', 'e', 'n', 't', '\020', '\315', '\001', '\022', '\023', '\n', '\016', 'P', 'a', 'r', 't', 'i', 'a', 'l',
+'C', 'o', 'n', 't', 'e', 'n', 't', '\020', '\316', '\001', '\022', '\020', '\n', '\013', 'M', 'u', 'l', 't', 'i', 'S', 't', 'a', 't', 'u', 's',
+'\020', '\317', '\001', '\022', '\024', '\n', '\017', 'A', 'l', 'r', 'e', 'a', 'd', 'y', 'R', 'e', 'p', 'o', 'r', 't', 'e', 'd', '\020', '\320', '\001',
+'\022', '\013', '\n', '\006', 'I', 'M', 'U', 's', 'e', 'd', '\020', '\342', '\001', '\022', '\024', '\n', '\017', 'M', 'u', 'l', 't', 'i', 'p', 'l', 'e',
+'C', 'h', 'o', 'i', 'c', 'e', 's', '\020', '\254', '\002', '\022', '\025', '\n', '\020', 'M', 'o', 'v', 'e', 'd', 'P', 'e', 'r', 'm', 'a', 'n',
+'e', 'n', 't', 'l', 'y', '\020', '\255', '\002', '\022', '\n', '\n', '\005', 'F', 'o', 'u', 'n', 'd', '\020', '\256', '\002', '\022', '\r', '\n', '\010', 'S',
+'e', 'e', 'O', 't', 'h', 'e', 'r', '\020', '\257', '\002', '\022', '\020', '\n', '\013', 'N', 'o', 't', 'M', 'o', 'd', 'i', 'f', 'i', 'e', 'd',
+'\020', '\260', '\002', '\022', '\r', '\n', '\010', 'U', 's', 'e', 'P', 'r', 'o', 'x', 'y', '\020', '\261', '\002', '\022', '\026', '\n', '\021', 'T', 'e', 'm',
+'p', 'o', 'r', 'a', 'r', 'y', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\020', '\263', '\002', '\022', '\026', '\n', '\021', 'P', 'e', 'r', 'm',
+'a', 'n', 'e', 'n', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\020', '\264', '\002', '\022', '\017', '\n', '\n', 'B', 'a', 'd', 'R', 'e',
+'q', 'u', 'e', 's', 't', '\020', '\220', '\003', '\022', '\021', '\n', '\014', 'U', 'n', 'a', 'u', 't', 'h', 'o', 'r', 'i', 'z', 'e', 'd', '\020',
+'\221', '\003', '\022', '\024', '\n', '\017', 'P', 'a', 'y', 'm', 'e', 'n', 't', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\020', '\222', '\003', '\022',
+'\016', '\n', '\t', 'F', 'o', 'r', 'b', 'i', 'd', 'd', 'e', 'n', '\020', '\223', '\003', '\022', '\r', '\n', '\010', 'N', 'o', 't', 'F', 'o', 'u',
+'n', 'd', '\020', '\224', '\003', '\022', '\025', '\n', '\020', 'M', 'e', 't', 'h', 'o', 'd', 'N', 'o', 't', 'A', 'l', 'l', 'o', 'w', 'e', 'd',
+'\020', '\225', '\003', '\022', '\022', '\n', '\r', 'N', 'o', 't', 'A', 'c', 'c', 'e', 'p', 't', 'a', 'b', 'l', 'e', '\020', '\226', '\003', '\022', ' ',
+'\n', '\033', 'P', 'r', 'o', 'x', 'y', 'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'R', 'e', 'q', 'u',
+'i', 'r', 'e', 'd', '\020', '\227', '\003', '\022', '\023', '\n', '\016', 'R', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't',
+'\020', '\230', '\003', '\022', '\r', '\n', '\010', 'C', 'o', 'n', 'f', 'l', 'i', 'c', 't', '\020', '\231', '\003', '\022', '\t', '\n', '\004', 'G', 'o', 'n',
+'e', '\020', '\232', '\003', '\022', '\023', '\n', '\016', 'L', 'e', 'n', 'g', 't', 'h', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\020', '\233', '\003',
+'\022', '\027', '\n', '\022', 'P', 'r', 'e', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', 'F', 'a', 'i', 'l', 'e', 'd', '\020', '\234', '\003',
+'\022', '\024', '\n', '\017', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'T', 'o', 'o', 'L', 'a', 'r', 'g', 'e', '\020', '\235', '\003', '\022', '\017', '\n',
+'\n', 'U', 'R', 'I', 'T', 'o', 'o', 'L', 'o', 'n', 'g', '\020', '\236', '\003', '\022', '\031', '\n', '\024', 'U', 'n', 's', 'u', 'p', 'p', 'o',
+'r', 't', 'e', 'd', 'M', 'e', 'd', 'i', 'a', 'T', 'y', 'p', 'e', '\020', '\237', '\003', '\022', '\030', '\n', '\023', 'R', 'a', 'n', 'g', 'e',
+'N', 'o', 't', 'S', 'a', 't', 'i', 's', 'f', 'i', 'a', 'b', 'l', 'e', '\020', '\240', '\003', '\022', '\026', '\n', '\021', 'E', 'x', 'p', 'e',
+'c', 't', 'a', 't', 'i', 'o', 'n', 'F', 'a', 'i', 'l', 'e', 'd', '\020', '\241', '\003', '\022', '\027', '\n', '\022', 'M', 'i', 's', 'd', 'i',
+'r', 'e', 'c', 't', 'e', 'd', 'R', 'e', 'q', 'u', 'e', 's', 't', '\020', '\245', '\003', '\022', '\030', '\n', '\023', 'U', 'n', 'p', 'r', 'o',
+'c', 'e', 's', 's', 'a', 'b', 'l', 'e', 'E', 'n', 't', 'i', 't', 'y', '\020', '\246', '\003', '\022', '\013', '\n', '\006', 'L', 'o', 'c', 'k',
+'e', 'd', '\020', '\247', '\003', '\022', '\025', '\n', '\020', 'F', 'a', 'i', 'l', 'e', 'd', 'D', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'y',
+'\020', '\250', '\003', '\022', '\024', '\n', '\017', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\020', '\252', '\003',
+'\022', '\031', '\n', '\024', 'P', 'r', 'e', 'c', 'o', 'n', 'd', 'i', 't', 'i', 'o', 'n', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\020',
+'\254', '\003', '\022', '\024', '\n', '\017', 'T', 'o', 'o', 'M', 'a', 'n', 'y', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\020', '\255', '\003', '\022',
+' ', '\n', '\033', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'i', 'e', 'l', 'd', 's', 'T', 'o', 'o',
+'L', 'a', 'r', 'g', 'e', '\020', '\257', '\003', '\022', '\030', '\n', '\023', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'S', 'e', 'r', 'v', 'e',
+'r', 'E', 'r', 'r', 'o', 'r', '\020', '\364', '\003', '\022', '\023', '\n', '\016', 'N', 'o', 't', 'I', 'm', 'p', 'l', 'e', 'm', 'e', 'n', 't',
+'e', 'd', '\020', '\365', '\003', '\022', '\017', '\n', '\n', 'B', 'a', 'd', 'G', 'a', 't', 'e', 'w', 'a', 'y', '\020', '\366', '\003', '\022', '\027', '\n',
+'\022', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'U', 'n', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', '\020', '\367', '\003', '\022', '\023', '\n',
+'\016', 'G', 'a', 't', 'e', 'w', 'a', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\020', '\370', '\003', '\022', '\034', '\n', '\027', 'H', 'T', 'T',
+'P', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'N', 'o', 't', 'S', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', '\020', '\371', '\003', '\022', '\032',
+'\n', '\025', 'V', 'a', 'r', 'i', 'a', 'n', 't', 'A', 'l', 's', 'o', 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', 's', '\020', '\372',
+'\003', '\022', '\030', '\n', '\023', 'I', 'n', 's', 'u', 'f', 'f', 'i', 'c', 'i', 'e', 'n', 't', 'S', 't', 'o', 'r', 'a', 'g', 'e', '\020',
+'\373', '\003', '\022', '\021', '\n', '\014', 'L', 'o', 'o', 'p', 'D', 'e', 't', 'e', 'c', 't', 'e', 'd', '\020', '\374', '\003', '\022', '\020', '\n', '\013',
+'N', 'o', 't', 'E', 'x', 't', 'e', 'n', 'd', 'e', 'd', '\020', '\376', '\003', '\022', '\"', '\n', '\035', 'N', 'e', 't', 'w', 'o', 'r', 'k',
+'A', 'u', 't', 'h', 'e', 'n', 't', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\020', '\377', '\003',
+'B', 'u', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'v', '3', 'B', '\017', 'H', 't', 't', 'p', 'S', 't', 'a', 't', 'u', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001',
+'Z', ';', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g',
+'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p',
+'e', '/', 'v', '3', ';', 't', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
+};
+
+static _upb_DefPool_Init *deps[4] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_v3_http_status_proto_upbdefinit = {
+ deps,
+ &envoy_type_v3_http_status_proto_upb_file_layout,
+ "envoy/type/v3/http_status.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1577)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h
new file mode 100644
index 00000000..25e28fbb
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/http_status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_v3_http_status_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_v3_HttpStatus_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_http_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.HttpStatus");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_HTTP_STATUS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
index d15de820..bb83bb47 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
@@ -8,19 +8,12 @@
#include "upb/def.h"
#include "envoy/type/v3/percent.upbdefs.h"
+#include "envoy/type/v3/percent.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_v3_Percent_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
-static const char descriptor[529] = {'\n', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[590] = {'\n', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a',
'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
'\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
@@ -38,22 +31,24 @@ static const char descriptor[529] = {'\n', '\033', 'e', 'n', 'v', 'o', 'y', '/',
'i', 'n', 'a', 't', 'o', 'r', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'H', 'U', 'N', 'D', 'R', 'E', 'D', '\020', '\000', '\022', '\020',
'\n', '\014', 'T', 'E', 'N', '_', 'T', 'H', 'O', 'U', 'S', 'A', 'N', 'D', '\020', '\001', '\022', '\013', '\n', '\007', 'M', 'I', 'L', 'L', 'I',
'O', 'N', '\020', '\002', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'F',
-'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', '5', '\n', '\033', 'i', 'o', '.', 'e', 'n',
+'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', 'r', '\n', '\033', 'i', 'o', '.', 'e', 'n',
'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\014', 'P',
-'e', 'r', 'c', 'e', 'n', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'e', 'r', 'c', 'e', 'n', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l',
+'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', ';', 't', 'y', 'p', 'e', 'v', '3', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_v3_percent_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_percent_proto_upb_file_layout,
"envoy/type/v3/percent.proto",
- UPB_STRVIEW_INIT(descriptor, 529)
+ UPB_STRINGVIEW_INIT(descriptor, 590)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h
index 67987c9e..e0254c94 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_percent_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_v3_Percent_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_percent_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.Percent");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_Percent_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_percent_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.Percent");
}
-UPB_INLINE const upb_msgdef *envoy_type_v3_FractionalPercent_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_percent_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.FractionalPercent");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_FractionalPercent_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_percent_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.FractionalPercent");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
index 5a4db5c4..de8a95dc 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
@@ -8,20 +8,11 @@
#include "upb/def.h"
#include "envoy/type/v3/range.upbdefs.h"
+#include "envoy/type/v3/range.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_v3_Int64Range_msginit,
- &envoy_type_v3_Int32Range_msginit,
- &envoy_type_v3_DoubleRange_msginit,
-};
-
-static const char descriptor[423] = {'\n', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[484] = {'\n', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o',
't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
@@ -35,20 +26,23 @@ static const char descriptor[423] = {'\n', '\031', 'e', 'n', 'v', 'o', 'y', '/',
'e', '\"', 'T', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'a', 'n', 'g', 'e', '\022', '\024', '\n', '\005', 's', 't', 'a', 'r', 't',
'\030', '\001', ' ', '\001', '(', '\001', 'R', '\005', 's', 't', 'a', 'r', 't', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(',
'\001', 'R', '\003', 'e', 'n', 'd', ':', '\035', '\232', '\305', '\210', '\036', '\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'a', 'n', 'g', 'e', 'B', '3', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'.', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'a', 'n', 'g', 'e', 'B', 'p', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\n', 'R', 'a', 'n', 'g', 'e',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', ';', 't', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[3] = {
+static _upb_DefPool_Init *deps[3] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_v3_range_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_range_proto_upb_file_layout,
"envoy/type/v3/range.proto",
- UPB_STRVIEW_INIT(descriptor, 423)
+ UPB_STRINGVIEW_INIT(descriptor, 484)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h
index 403b7c5d..22a905d2 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_range_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_v3_Int64Range_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_range_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.Int64Range");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_Int64Range_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_range_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.Int64Range");
}
-UPB_INLINE const upb_msgdef *envoy_type_v3_Int32Range_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_range_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.Int32Range");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_Int32Range_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_range_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.Int32Range");
}
-UPB_INLINE const upb_msgdef *envoy_type_v3_DoubleRange_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_range_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.DoubleRange");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_DoubleRange_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_range_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.DoubleRange");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c
new file mode 100644
index 00000000..6404b369
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c
@@ -0,0 +1,38 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/ratelimit_unit.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/v3/ratelimit_unit.upbdefs.h"
+#include "envoy/type/v3/ratelimit_unit.upb.h"
+
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+static const char descriptor[285] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 't', 'e', 'l', 'i', 'm', 'i', 't',
+'_', 'u', 'n', 'i', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v',
+'3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '*', 'G', '\n', '\r', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'U', 'n', 'i', 't', '\022',
+'\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'S', 'E', 'C', 'O', 'N', 'D', '\020', '\001', '\022',
+'\n', '\n', '\006', 'M', 'I', 'N', 'U', 'T', 'E', '\020', '\002', '\022', '\010', '\n', '\004', 'H', 'O', 'U', 'R', '\020', '\003', '\022', '\007', '\n', '\003',
+'D', 'A', 'Y', '\020', '\004', 'B', 'x', '\n', '\033', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\022', 'R', 'a', 't', 'e', 'l', 'i', 'm', 'i', 't', 'U', 'n', 'i',
+'t', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e',
+'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', ';', 't', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_v3_ratelimit_unit_proto_upbdefinit = {
+ deps,
+ &envoy_type_v3_ratelimit_unit_proto_upb_file_layout,
+ "envoy/type/v3/ratelimit_unit.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 285)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h
new file mode 100644
index 00000000..0c75338a
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h
@@ -0,0 +1,30 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/ratelimit_unit.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_v3_ratelimit_unit_proto_upbdefinit;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_RATELIMIT_UNIT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
index f97b1b4f..b95907bc 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
@@ -8,16 +8,11 @@
#include "upb/def.h"
#include "envoy/type/v3/semantic_version.upbdefs.h"
+#include "envoy/type/v3/semantic_version.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_v3_SemanticVersion_msginit,
-};
-
-static const char descriptor[337] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '_',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+static const char descriptor[398] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '_',
'v', 'e', 'r', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
@@ -27,21 +22,23 @@ static const char descriptor[337] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't
'!', '\n', '\014', 'm', 'i', 'n', 'o', 'r', '_', 'n', 'u', 'm', 'b', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\013', 'm', 'i',
'n', 'o', 'r', 'N', 'u', 'm', 'b', 'e', 'r', '\022', '\024', '\n', '\005', 'p', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\r', 'R',
'\005', 'p', 'a', 't', 'c', 'h', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', '=', '\n', '\033', 'i', 'o', '.', 'e', 'n',
+'.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'B', 'z', '\n', '\033', 'i', 'o', '.', 'e', 'n',
'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\024', 'S',
-'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321',
-'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o',
+'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3',
+';', 't', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[3] = {
+static _upb_DefPool_Init *deps[3] = {
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
};
-upb_def_init envoy_type_v3_semantic_version_proto_upbdefinit = {
+_upb_DefPool_Init envoy_type_v3_semantic_version_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_semantic_version_proto_upb_file_layout,
"envoy/type/v3/semantic_version.proto",
- UPB_STRVIEW_INIT(descriptor, 337)
+ UPB_STRINGVIEW_INIT(descriptor, 398)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h
index ca21dbd9..ce20299d 100644
--- a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init envoy_type_v3_semantic_version_proto_upbdefinit;
+extern _upb_DefPool_Init envoy_type_v3_semantic_version_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *envoy_type_v3_SemanticVersion_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &envoy_type_v3_semantic_version_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "envoy.type.v3.SemanticVersion");
+UPB_INLINE const upb_MessageDef *envoy_type_v3_SemanticVersion_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_semantic_version_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.SemanticVersion");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c
new file mode 100644
index 00000000..cd386503
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c
@@ -0,0 +1,57 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/token_bucket.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/v3/token_bucket.upbdefs.h"
+#include "envoy/type/v3/token_bucket.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[574] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 't', 'o', 'k', 'e', 'n', '_', 'b', 'u', 'c',
+'k', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032',
+'\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w',
+'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p',
+'r', 'o', 't', 'o', '\"', '\357', '\001', '\n', '\013', 'T', 'o', 'k', 'e', 'n', 'B', 'u', 'c', 'k', 'e', 't', '\022', '&', '\n', '\n', 'm',
+'a', 'x', '_', 't', 'o', 'k', 'e', 'n', 's', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\007', '\372', 'B', '\004', '*', '\002', ' ', '\000', 'R',
+'\t', 'm', 'a', 'x', 'T', 'o', 'k', 'e', 'n', 's', '\022', 'M', '\n', '\017', 't', 'o', 'k', 'e', 'n', 's', '_', 'p', 'e', 'r', '_',
+'f', 'i', 'l', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', ' ', '\000', 'R',
+'\r', 't', 'o', 'k', 'e', 'n', 's', 'P', 'e', 'r', 'F', 'i', 'l', 'l', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 'l', '_', 'i', 'n',
+'t', 'e', 'r', 'v', 'a', 'l', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '*',
+'\000', 'R', '\014', 'f', 'i', 'l', 'l', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '\035', '\232', '\305', '\210', '\036', '\030', '\n', '\026', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'T', 'o', 'k', 'e', 'n', 'B', 'u', 'c', 'k', 'e', 't', 'B', 'v', '\n', '\033',
+'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'v', '3', 'B', '\020', 'T', 'o', 'k', 'e', 'n', 'B', 'u', 'c', 'k', 'e', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g',
+'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c',
+'o', 'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v',
+'3', ';', 't', 'y', 'p', 'e', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[6] = {
+ &google_protobuf_duration_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init envoy_type_v3_token_bucket_proto_upbdefinit = {
+ deps,
+ &envoy_type_v3_token_bucket_proto_upb_file_layout,
+ "envoy/type/v3/token_bucket.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 574)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h
new file mode 100644
index 00000000..ab11878d
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/v3/token_bucket.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init envoy_type_v3_token_bucket_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *envoy_type_v3_TokenBucket_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &envoy_type_v3_token_bucket_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "envoy.type.v3.TokenBucket");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_V3_TOKEN_BUCKET_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
index f1b69216..45a64bd2 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
@@ -8,10 +8,10 @@
#include "upb/def.h"
#include "google/api/annotations.upbdefs.h"
+#include "google/api/annotations.upb.h"
-extern upb_def_init google_api_http_proto_upbdefinit;
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
+extern _upb_DefPool_Init google_api_http_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
static const char descriptor[296] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.',
'p', 'r', 'o', 't', 'o', '\022', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '\032', '\025', 'g', 'o', 'o', 'g', 'l', 'e',
'/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p',
@@ -26,15 +26,15 @@ static const char descriptor[296] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e',
'a', 't', 'i', 'o', 'n', 's', '\242', '\002', '\004', 'G', 'A', 'P', 'I', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[3] = {
+static _upb_DefPool_Init *deps[3] = {
&google_api_http_proto_upbdefinit,
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init google_api_annotations_proto_upbdefinit = {
+_upb_DefPool_Init google_api_annotations_proto_upbdefinit = {
deps,
- NULL,
+ &google_api_annotations_proto_upb_file_layout,
"google/api/annotations.proto",
- UPB_STRVIEW_INIT(descriptor, 296)
+ UPB_STRINGVIEW_INIT(descriptor, 296)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h
index 8b5f25a4..69ceac64 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h
@@ -19,7 +19,7 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_api_annotations_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_annotations_proto_upbdefinit;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c
index 4eb1bb8a..88643a95 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c
@@ -8,40 +8,11 @@
#include "upb/def.h"
#include "google/api/expr/v1alpha1/checked.upbdefs.h"
+#include "google/api/expr/v1alpha1/checked.upb.h"
-extern upb_def_init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
-extern upb_def_init google_protobuf_empty_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-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;
-
-static const upb_msglayout *layouts[13] = {
- &google_api_expr_v1alpha1_CheckedExpr_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
- &google_api_expr_v1alpha1_Type_msginit,
- &google_api_expr_v1alpha1_Type_ListType_msginit,
- &google_api_expr_v1alpha1_Type_MapType_msginit,
- &google_api_expr_v1alpha1_Type_FunctionType_msginit,
- &google_api_expr_v1alpha1_Type_AbstractType_msginit,
- &google_api_expr_v1alpha1_Decl_msginit,
- &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
- &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
- &google_api_expr_v1alpha1_Reference_msginit,
-};
-
+extern _upb_DefPool_Init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_empty_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
static const char descriptor[3089] = {'\n', '&', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x', 'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a',
'1', '/', 'c', 'h', 'e', 'c', 'k', 'e', 'd', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'a',
'p', 'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '\032', '%', 'g', 'o', 'o', 'g', 'l', 'e', '/',
@@ -168,16 +139,16 @@ static const char descriptor[3089] = {'\n', '&', 'g', 'o', 'o', 'g', 'l', 'e', '
'x', 'p', 'r', '\370', '\001', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&google_api_expr_v1alpha1_syntax_proto_upbdefinit,
&google_protobuf_empty_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
NULL
};
-upb_def_init google_api_expr_v1alpha1_checked_proto_upbdefinit = {
+_upb_DefPool_Init google_api_expr_v1alpha1_checked_proto_upbdefinit = {
deps,
- layouts,
+ &google_api_expr_v1alpha1_checked_proto_upb_file_layout,
"google/api/expr/v1alpha1/checked.proto",
- UPB_STRVIEW_INIT(descriptor, 3089)
+ UPB_STRINGVIEW_INIT(descriptor, 3089)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h
index 539e255c..bf296098 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h
@@ -19,71 +19,71 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_api_expr_v1alpha1_checked_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_expr_v1alpha1_checked_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_CheckedExpr_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.CheckedExpr");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_CheckedExpr_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.CheckedExpr");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.CheckedExpr.ReferenceMapEntry");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.CheckedExpr.ReferenceMapEntry");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.CheckedExpr.TypeMapEntry");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.CheckedExpr.TypeMapEntry");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Type_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Type");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Type_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Type");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Type_ListType_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Type.ListType");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Type_ListType_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Type.ListType");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Type_MapType_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Type.MapType");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Type_MapType_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Type.MapType");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Type_FunctionType_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Type.FunctionType");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Type_FunctionType_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Type.FunctionType");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Type_AbstractType_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Type.AbstractType");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Type_AbstractType_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Type.AbstractType");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Decl_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Decl");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Decl_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Decl");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Decl_IdentDecl_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Decl.IdentDecl");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Decl_IdentDecl_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Decl.IdentDecl");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Decl_FunctionDecl_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Decl.FunctionDecl");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Decl_FunctionDecl_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Decl.FunctionDecl");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Decl.FunctionDecl.Overload");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Decl.FunctionDecl.Overload");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Reference_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Reference");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Reference_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_checked_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Reference");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c
index 3ad38ed1..cafb767e 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c
@@ -8,42 +8,11 @@
#include "upb/def.h"
#include "google/api/expr/v1alpha1/syntax.upbdefs.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
-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_SourceInfo_MacroCallsEntry_msginit;
-extern const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit;
-
-static const upb_msglayout *layouts[14] = {
- &google_api_expr_v1alpha1_ParsedExpr_msginit,
- &google_api_expr_v1alpha1_Expr_msginit,
- &google_api_expr_v1alpha1_Expr_Ident_msginit,
- &google_api_expr_v1alpha1_Expr_Select_msginit,
- &google_api_expr_v1alpha1_Expr_Call_msginit,
- &google_api_expr_v1alpha1_Expr_CreateList_msginit,
- &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
- &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
- &google_api_expr_v1alpha1_Constant_msginit,
- &google_api_expr_v1alpha1_SourceInfo_msginit,
- &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
- &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit,
- &google_api_expr_v1alpha1_SourcePosition_msginit,
-};
-
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
static const char descriptor[3059] = {'\n', '%', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'e', 'x', 'p', 'r', '/', 'v', '1', 'a', 'l', 'p', 'h', 'a',
'1', '/', 's', 'y', 'n', 't', 'a', 'x', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p',
'i', '.', 'e', 'x', 'p', 'r', '.', 'v', '1', 'a', 'l', 'p', 'h', 'a', '1', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p',
@@ -169,16 +138,16 @@ static const char descriptor[3059] = {'\n', '%', 'g', 'o', 'o', 'g', 'l', 'e', '
'\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_timestamp_proto_upbdefinit,
NULL
};
-upb_def_init google_api_expr_v1alpha1_syntax_proto_upbdefinit = {
+_upb_DefPool_Init google_api_expr_v1alpha1_syntax_proto_upbdefinit = {
deps,
- layouts,
+ &google_api_expr_v1alpha1_syntax_proto_upb_file_layout,
"google/api/expr/v1alpha1/syntax.proto",
- UPB_STRVIEW_INIT(descriptor, 3059)
+ UPB_STRINGVIEW_INIT(descriptor, 3059)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h
index 750f563f..89c09507 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h
@@ -19,76 +19,76 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_expr_v1alpha1_syntax_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_ParsedExpr_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.ParsedExpr");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_ParsedExpr_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.ParsedExpr");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_Ident_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.Ident");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_Ident_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.Ident");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_Select_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.Select");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_Select_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.Select");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_Call_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.Call");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_Call_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.Call");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_CreateList_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.CreateList");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_CreateList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.CreateList");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_CreateStruct_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.CreateStruct");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_CreateStruct_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.CreateStruct");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.CreateStruct.Entry");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.CreateStruct.Entry");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Expr_Comprehension_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Expr.Comprehension");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Expr_Comprehension_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Expr.Comprehension");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_Constant_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.Constant");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_Constant_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.Constant");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_SourceInfo_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.SourceInfo");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_SourceInfo_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.SourceInfo");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_SourceInfo_PositionsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.SourceInfo.PositionsEntry");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_SourceInfo_PositionsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.SourceInfo.PositionsEntry");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.SourceInfo.MacroCallsEntry");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.SourceInfo.MacroCallsEntry");
}
-UPB_INLINE const upb_msgdef *google_api_expr_v1alpha1_SourcePosition_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.expr.v1alpha1.SourcePosition");
+UPB_INLINE const upb_MessageDef *google_api_expr_v1alpha1_SourcePosition_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_expr_v1alpha1_syntax_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.expr.v1alpha1.SourcePosition");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
index 232fd18d..99df28fa 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
@@ -8,16 +8,7 @@
#include "upb/def.h"
#include "google/api/http.upbdefs.h"
-
-extern const upb_msglayout google_api_Http_msginit;
-extern const upb_msglayout google_api_HttpRule_msginit;
-extern const upb_msglayout google_api_CustomHttpPattern_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &google_api_Http_msginit,
- &google_api_HttpRule_msginit,
- &google_api_CustomHttpPattern_msginit,
-};
+#include "google/api/http.upb.h"
static const char descriptor[684] = {'\n', '\025', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\n',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '\"', 'y', '\n', '\004', 'H', 't', 't', 'p', '\022', '*', '\n', '\005', 'r', 'u', 'l',
@@ -49,13 +40,13 @@ static const char descriptor[684] = {'\n', '\025', 'g', 'o', 'o', 'g', 'l', 'e',
'I', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_api_http_proto_upbdefinit = {
+_upb_DefPool_Init google_api_http_proto_upbdefinit = {
deps,
- layouts,
+ &google_api_http_proto_upb_file_layout,
"google/api/http.proto",
- UPB_STRVIEW_INIT(descriptor, 684)
+ UPB_STRINGVIEW_INIT(descriptor, 684)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h
index 872706b4..be3134fa 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_api_http_proto_upbdefinit;
+extern _upb_DefPool_Init google_api_http_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_api_Http_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_http_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.Http");
+UPB_INLINE const upb_MessageDef *google_api_Http_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_http_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.Http");
}
-UPB_INLINE const upb_msgdef *google_api_HttpRule_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_http_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.HttpRule");
+UPB_INLINE const upb_MessageDef *google_api_HttpRule_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_http_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.HttpRule");
}
-UPB_INLINE const upb_msgdef *google_api_CustomHttpPattern_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_api_http_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.api.CustomHttpPattern");
+UPB_INLINE const upb_MessageDef *google_api_CustomHttpPattern_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_http_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.CustomHttpPattern");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c
new file mode 100644
index 00000000..1487a0c6
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c
@@ -0,0 +1,39 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/httpbody.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "google/api/httpbody.upbdefs.h"
+#include "google/api/httpbody.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+static const char descriptor[301] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', 'b', 'o', 'd', 'y', '.', 'p', 'r', 'o',
+'t', 'o', '\022', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\"', 'w', '\n', '\010', 'H', 't', 't', 'p', 'B',
+'o', 'd', 'y', '\022', '!', '\n', '\014', 'c', 'o', 'n', 't', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\013', 'c', 'o', 'n', 't', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', '\022', '\n', '\004', 'd', 'a', 't', 'a', '\030', '\002', ' ', '\001',
+'(', '\014', 'R', '\004', 'd', 'a', 't', 'a', '\022', '4', '\n', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\003', ' ',
+'\003', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y',
+'R', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', 'B', 'h', '\n', '\016', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'a', 'p', 'i', 'B', '\r', 'H', 't', 't', 'p', 'B', 'o', 'd', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ';', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'e', 'n', 'p', 'r', 'o', 't', 'o',
+'/', 'g', 'o', 'o', 'g', 'l', 'e', 'a', 'p', 'i', 's', '/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', 'b', 'o', 'd', 'y', ';',
+'h', 't', 't', 'p', 'b', 'o', 'd', 'y', '\370', '\001', '\001', '\242', '\002', '\004', 'G', 'A', 'P', 'I', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_any_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init google_api_httpbody_proto_upbdefinit = {
+ deps,
+ &google_api_httpbody_proto_upb_file_layout,
+ "google/api/httpbody.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 301)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h
new file mode 100644
index 00000000..336d4a53
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/httpbody.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_
+#define GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init google_api_httpbody_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *google_api_HttpBody_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_api_httpbody_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.api.HttpBody");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_HTTPBODY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
index 7db34832..c5ee7cb6 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/any.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Any_msginit,
-};
+#include "google/protobuf/any.upb.h"
static const char descriptor[228] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o',
't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '6', '\n', '\003', 'A', 'n',
@@ -27,13 +22,13 @@ static const char descriptor[228] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e',
't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_any_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_any_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_any_proto_upb_file_layout,
"google/protobuf/any.proto",
- UPB_STRVIEW_INIT(descriptor, 228)
+ UPB_STRINGVIEW_INIT(descriptor, 228)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h
index 35fb1915..a4a8dce6 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_Any_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_any_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Any");
+UPB_INLINE const upb_MessageDef *google_protobuf_Any_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_any_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Any");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
index 9026d56d..4a9e1307 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
@@ -8,66 +8,9 @@
#include "upb/def.h"
#include "google/protobuf/descriptor.upbdefs.h"
+#include "google/protobuf/descriptor.upb.h"
-extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
-extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
-extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
-extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_FileOptions_msginit;
-extern const upb_msglayout google_protobuf_MessageOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldOptions_msginit;
-extern const upb_msglayout google_protobuf_OneofOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
-extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
-extern const upb_msglayout google_protobuf_MethodOptions_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
-
-static const upb_msglayout *layouts[27] = {
- &google_protobuf_FileDescriptorSet_msginit,
- &google_protobuf_FileDescriptorProto_msginit,
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_DescriptorProto_ExtensionRange_msginit,
- &google_protobuf_DescriptorProto_ReservedRange_msginit,
- &google_protobuf_ExtensionRangeOptions_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_OneofDescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
- &google_protobuf_EnumValueDescriptorProto_msginit,
- &google_protobuf_ServiceDescriptorProto_msginit,
- &google_protobuf_MethodDescriptorProto_msginit,
- &google_protobuf_FileOptions_msginit,
- &google_protobuf_MessageOptions_msginit,
- &google_protobuf_FieldOptions_msginit,
- &google_protobuf_OneofOptions_msginit,
- &google_protobuf_EnumOptions_msginit,
- &google_protobuf_EnumValueOptions_msginit,
- &google_protobuf_ServiceOptions_msginit,
- &google_protobuf_MethodOptions_msginit,
- &google_protobuf_UninterpretedOption_msginit,
- &google_protobuf_UninterpretedOption_NamePart_msginit,
- &google_protobuf_SourceCodeInfo_msginit,
- &google_protobuf_SourceCodeInfo_Location_msginit,
- &google_protobuf_GeneratedCodeInfo_msginit,
- &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
-};
-
-static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
+static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n',
'\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
@@ -256,7 +199,7 @@ static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '
'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o',
'd', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z',
'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', '\350',
-'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\321', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e',
+'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\343', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e',
'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i',
'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm',
'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', 'o',
@@ -269,118 +212,118 @@ static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '
'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g',
'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O',
-'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010',
-'\t', '\020', '\n', '\"', '\342', '\003', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c',
-'t', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S',
-'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ',
-'\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001',
-'(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l',
-'d', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A',
-'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005',
-'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd',
-'\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd',
-'\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e',
-'a', 'k', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o',
-'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n',
-'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p',
-'e', '\022', '\n', '\n', '\006', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020',
-'\n', '\014', 'S', 'T', 'R', 'I', 'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p',
-'e', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T',
-'R', 'I', 'N', 'G', '\020', '\001', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350',
-'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't',
-'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't',
-'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023',
-'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020',
-'\200', '\200', '\200', '\200', '\002', '\"', '\300', '\001', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013',
-'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A',
-'l', 'i', 'a', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':',
-'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i',
-'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2',
-'$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r',
-'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
-'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006',
-'\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
+'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010',
+'\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\342', '\003', '\n',
+'\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ',
+'\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e',
+'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005',
+'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a',
+'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y',
+'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004',
+'l', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':',
+'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a',
+'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', 'X', '\n', '\024', 'u',
+'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(',
+'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't',
+'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r',
+'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T',
+'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', 'N',
+'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', 'S',
+'_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022',
+'\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002',
+'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n',
+'\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ',
+'\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i',
+'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r',
+'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\300',
+'\001', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a',
+'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n',
+'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R',
+'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
+'t', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O',
+'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o',
+'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n',
+'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i',
+'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u',
+'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200',
+'\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%',
+'\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e',
+'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r',
+'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd',
+'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i',
+'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O',
+'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(',
+'\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i',
+'d', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't',
+'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D',
+'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o',
+'t', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e',
'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p',
't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n',
-'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010',
-':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n',
-'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013',
-'2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e',
-'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
-'t', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r',
-'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't',
-'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't',
-'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"',
-' ', '\001', '(', '\016', '2', '/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e',
-'t', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e',
-'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R',
-'\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n',
-'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p',
-'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e',
-'d', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v',
-'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N',
-'\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016',
-'\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002',
-'\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022',
-'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o',
-'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't',
-'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i',
-'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't',
-'_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't',
-'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l',
-'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u',
-'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013',
-'d', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l',
-'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017',
-'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g',
-'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022',
-'\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P',
-'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010',
-'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C',
-'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013',
-'2', '(', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e',
-'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i',
-'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001',
-' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ',
-'\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_',
-'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o',
-'m', 'm', 'e', 'n', 't', 's', '\022', '+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n',
-'t', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't',
-'s', '\022', ':', '\n', '\031', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm',
-'m', 'e', 'n', 't', 's', '\030', '\006', ' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c',
-'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\"', '\321', '\001', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd',
-'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ',
-'\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n',
-'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\032', 'm', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h',
-'\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o',
-'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005',
-'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~',
-'\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e',
-'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's',
-'/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032',
-'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o',
-'n',
+'\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I',
+'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N',
+'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P',
+'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n',
+'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e',
+'\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P',
+'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v',
+'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030',
+'\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',',
+'\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(',
+'\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o',
+'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V',
+'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(',
+'\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a',
+'t', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e',
+'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e',
+'_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014',
+'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o',
+'\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f',
+'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010',
+'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020',
+'\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001',
+'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't',
+'s', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022',
+'+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(',
+'\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e',
+'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006',
+' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm',
+'e', 'n', 't', 's', '\"', '\321', '\001', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f',
+'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C',
+'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', '\032', 'm', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a',
+'t', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u',
+'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l',
+'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020',
+'\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
+'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.',
+'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', 'i',
+'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.',
+'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_descriptor_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_descriptor_proto_upb_file_layout,
"google/protobuf/descriptor.proto",
- UPB_STRVIEW_INIT(descriptor, 7601)
+ UPB_STRINGVIEW_INIT(descriptor, 7619)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h
index 285d84e9..058c7593 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h
@@ -19,141 +19,141 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_FileDescriptorSet_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FileDescriptorSet");
+UPB_INLINE const upb_MessageDef *google_protobuf_FileDescriptorSet_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FileDescriptorSet");
}
-UPB_INLINE const upb_msgdef *google_protobuf_FileDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FileDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_FileDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FileDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto.ExtensionRange");
+UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_ExtensionRange_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto.ExtensionRange");
}
-UPB_INLINE const upb_msgdef *google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto.ReservedRange");
+UPB_INLINE const upb_MessageDef *google_protobuf_DescriptorProto_ReservedRange_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.DescriptorProto.ReservedRange");
}
-UPB_INLINE const upb_msgdef *google_protobuf_ExtensionRangeOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.ExtensionRangeOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_ExtensionRangeOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.ExtensionRangeOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_FieldDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FieldDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_FieldDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_OneofDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.OneofDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_OneofDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.OneofDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_EnumDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.EnumDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_EnumDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.EnumDescriptorProto.EnumReservedRange");
+UPB_INLINE const upb_MessageDef *google_protobuf_EnumDescriptorProto_EnumReservedRange_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumDescriptorProto.EnumReservedRange");
}
-UPB_INLINE const upb_msgdef *google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.EnumValueDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_EnumValueDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumValueDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_ServiceDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.ServiceDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_ServiceDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.ServiceDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_MethodDescriptorProto_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.MethodDescriptorProto");
+UPB_INLINE const upb_MessageDef *google_protobuf_MethodDescriptorProto_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.MethodDescriptorProto");
}
-UPB_INLINE const upb_msgdef *google_protobuf_FileOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FileOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_FileOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FileOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_MessageOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.MessageOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_MessageOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.MessageOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_FieldOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FieldOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_FieldOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FieldOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_OneofOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.OneofOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_OneofOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.OneofOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_EnumOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.EnumOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_EnumOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_EnumValueOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.EnumValueOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_EnumValueOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.EnumValueOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_ServiceOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.ServiceOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_ServiceOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.ServiceOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_MethodOptions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.MethodOptions");
+UPB_INLINE const upb_MessageDef *google_protobuf_MethodOptions_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.MethodOptions");
}
-UPB_INLINE const upb_msgdef *google_protobuf_UninterpretedOption_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.UninterpretedOption");
+UPB_INLINE const upb_MessageDef *google_protobuf_UninterpretedOption_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.UninterpretedOption");
}
-UPB_INLINE const upb_msgdef *google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.UninterpretedOption.NamePart");
+UPB_INLINE const upb_MessageDef *google_protobuf_UninterpretedOption_NamePart_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.UninterpretedOption.NamePart");
}
-UPB_INLINE const upb_msgdef *google_protobuf_SourceCodeInfo_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.SourceCodeInfo");
+UPB_INLINE const upb_MessageDef *google_protobuf_SourceCodeInfo_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.SourceCodeInfo");
}
-UPB_INLINE const upb_msgdef *google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.SourceCodeInfo.Location");
+UPB_INLINE const upb_MessageDef *google_protobuf_SourceCodeInfo_Location_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.SourceCodeInfo.Location");
}
-UPB_INLINE const upb_msgdef *google_protobuf_GeneratedCodeInfo_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.GeneratedCodeInfo");
+UPB_INLINE const upb_MessageDef *google_protobuf_GeneratedCodeInfo_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.GeneratedCodeInfo");
}
-UPB_INLINE const upb_msgdef *google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_descriptor_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.GeneratedCodeInfo.Annotation");
+UPB_INLINE const upb_MessageDef *google_protobuf_GeneratedCodeInfo_Annotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_descriptor_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.GeneratedCodeInfo.Annotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
index 4cfdc758..c8d10ff5 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/duration.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Duration_msginit,
-};
+#include "google/protobuf/duration.upb.h"
static const char descriptor[251] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o',
'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"',
@@ -28,13 +23,13 @@ static const char descriptor[251] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
'3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_duration_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_duration_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_duration_proto_upb_file_layout,
"google/protobuf/duration.proto",
- UPB_STRVIEW_INIT(descriptor, 251)
+ UPB_STRINGVIEW_INIT(descriptor, 251)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h
index 8cc191bf..e50c557d 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_Duration_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_duration_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Duration");
+UPB_INLINE const upb_MessageDef *google_protobuf_Duration_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_duration_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Duration");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
index 8f974d96..d0cc8401 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/empty.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Empty_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Empty_msginit,
-};
+#include "google/protobuf/empty.upb.h"
static const char descriptor[190] = {'\n', '\033', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'e', 'm', 'p', 't', 'y', '.', 'p',
'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\007', '\n', '\005',
@@ -25,13 +20,13 @@ static const char descriptor[190] = {'\n', '\033', 'g', 'o', 'o', 'g', 'l', 'e',
'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_empty_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_empty_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_empty_proto_upb_file_layout,
"google/protobuf/empty.proto",
- UPB_STRVIEW_INIT(descriptor, 190)
+ UPB_STRINGVIEW_INIT(descriptor, 190)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h
index 9e6b0d05..66fafcc9 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_empty_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_empty_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_Empty_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_empty_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Empty");
+UPB_INLINE const upb_MessageDef *google_protobuf_Empty_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_empty_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Empty");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
index 6f2f13c5..3c4eea79 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
@@ -8,18 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/struct.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit;
-extern const upb_msglayout google_protobuf_Value_msginit;
-extern const upb_msglayout google_protobuf_ListValue_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &google_protobuf_Struct_msginit,
- &google_protobuf_Struct_FieldsEntry_msginit,
- &google_protobuf_Value_msginit,
- &google_protobuf_ListValue_msginit,
-};
+#include "google/protobuf/struct.upb.h"
static const char descriptor[738] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.',
'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\230', '\001',
@@ -53,13 +42,13 @@ static const char descriptor[738] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e',
'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_struct_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_struct_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_struct_proto_upb_file_layout,
"google/protobuf/struct.proto",
- UPB_STRVIEW_INIT(descriptor, 738)
+ UPB_STRINGVIEW_INIT(descriptor, 738)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h
index 4e170213..b4052f45 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h
@@ -19,26 +19,26 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_Struct_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Struct");
+UPB_INLINE const upb_MessageDef *google_protobuf_Struct_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Struct");
}
-UPB_INLINE const upb_msgdef *google_protobuf_Struct_FieldsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Struct.FieldsEntry");
+UPB_INLINE const upb_MessageDef *google_protobuf_Struct_FieldsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Struct.FieldsEntry");
}
-UPB_INLINE const upb_msgdef *google_protobuf_Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Value");
+UPB_INLINE const upb_MessageDef *google_protobuf_Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Value");
}
-UPB_INLINE const upb_msgdef *google_protobuf_ListValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.ListValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_ListValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.ListValue");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
index bc2f7af6..b4770b88 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/timestamp.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Timestamp_msginit,
-};
+#include "google/protobuf/timestamp.upb.h"
static const char descriptor[255] = {'\n', '\037', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a',
'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
@@ -28,13 +23,13 @@ static const char descriptor[255] = {'\n', '\037', 'g', 'o', 'o', 'g', 'l', 'e',
'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_timestamp_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_timestamp_proto_upb_file_layout,
"google/protobuf/timestamp.proto",
- UPB_STRVIEW_INIT(descriptor, 255)
+ UPB_STRINGVIEW_INIT(descriptor, 255)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h
index 0e375559..15d26414 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_Timestamp_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_timestamp_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Timestamp");
+UPB_INLINE const upb_MessageDef *google_protobuf_Timestamp_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_timestamp_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Timestamp");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
index 59a598ad..36a469a7 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
@@ -8,28 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/wrappers.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_DoubleValue_msginit;
-extern const upb_msglayout google_protobuf_FloatValue_msginit;
-extern const upb_msglayout google_protobuf_Int64Value_msginit;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
-extern const upb_msglayout google_protobuf_Int32Value_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_StringValue_msginit;
-extern const upb_msglayout google_protobuf_BytesValue_msginit;
-
-static const upb_msglayout *layouts[9] = {
- &google_protobuf_DoubleValue_msginit,
- &google_protobuf_FloatValue_msginit,
- &google_protobuf_Int64Value_msginit,
- &google_protobuf_UInt64Value_msginit,
- &google_protobuf_Int32Value_msginit,
- &google_protobuf_UInt32Value_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_StringValue_msginit,
- &google_protobuf_BytesValue_msginit,
-};
+#include "google/protobuf/wrappers.upb.h"
static const char descriptor[518] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r',
's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"',
@@ -54,13 +33,13 @@ static const char descriptor[518] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
'K', 'n', 'o', 'w', 'n', 'T', 'y', 'p', 'e', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[1] = {
+static _upb_DefPool_Init *deps[1] = {
NULL
};
-upb_def_init google_protobuf_wrappers_proto_upbdefinit = {
+_upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_wrappers_proto_upb_file_layout,
"google/protobuf/wrappers.proto",
- UPB_STRVIEW_INIT(descriptor, 518)
+ UPB_STRINGVIEW_INIT(descriptor, 518)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h
index 9cfcb290..41fdf43c 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h
@@ -19,51 +19,51 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_protobuf_DoubleValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.DoubleValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_DoubleValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.DoubleValue");
}
-UPB_INLINE const upb_msgdef *google_protobuf_FloatValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.FloatValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_FloatValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.FloatValue");
}
-UPB_INLINE const upb_msgdef *google_protobuf_Int64Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Int64Value");
+UPB_INLINE const upb_MessageDef *google_protobuf_Int64Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Int64Value");
}
-UPB_INLINE const upb_msgdef *google_protobuf_UInt64Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.UInt64Value");
+UPB_INLINE const upb_MessageDef *google_protobuf_UInt64Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.UInt64Value");
}
-UPB_INLINE const upb_msgdef *google_protobuf_Int32Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.Int32Value");
+UPB_INLINE const upb_MessageDef *google_protobuf_Int32Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.Int32Value");
}
-UPB_INLINE const upb_msgdef *google_protobuf_UInt32Value_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.UInt32Value");
+UPB_INLINE const upb_MessageDef *google_protobuf_UInt32Value_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.UInt32Value");
}
-UPB_INLINE const upb_msgdef *google_protobuf_BoolValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.BoolValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_BoolValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.BoolValue");
}
-UPB_INLINE const upb_msgdef *google_protobuf_StringValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.StringValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_StringValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.StringValue");
}
-UPB_INLINE const upb_msgdef *google_protobuf_BytesValue_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_protobuf_wrappers_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.protobuf.BytesValue");
+UPB_INLINE const upb_MessageDef *google_protobuf_BytesValue_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_protobuf_wrappers_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.protobuf.BytesValue");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
index a4300a1e..42ddb607 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
@@ -8,35 +8,30 @@
#include "upb/def.h"
#include "google/rpc/status.upbdefs.h"
+#include "google/rpc/status.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern const upb_msglayout google_rpc_Status_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_rpc_Status_msginit,
-};
-
-static const char descriptor[272] = {'\n', '\027', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+static const char descriptor[275] = {'\n', '\027', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
'\022', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'r', 'p', 'c', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\"', 'f', '\n', '\006', 'S', 't', 'a', 't', 'u', 's', '\022',
'\022', '\n', '\004', 'c', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\004', 'c', 'o', 'd', 'e', '\022', '\030', '\n', '\007', 'm', 'e',
's', 's', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'm', 'e', 's', 's', 'a', 'g', 'e', '\022', '.', '\n', '\007', 'd',
'e', 't', 'a', 'i', 'l', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\007', 'd', 'e', 't', 'a', 'i', 'l', 's', 'B', '^', '\n', '\016', 'c', 'o', 'm',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\007', 'd', 'e', 't', 'a', 'i', 'l', 's', 'B', 'a', '\n', '\016', 'c', 'o', 'm',
'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'r', 'p', 'c', 'B', '\013', 'S', 't', 'a', 't', 'u', 's', 'P', 'r', 'o', 't', 'o', 'P',
'\001', 'Z', '7', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'e', 'n', 'p',
'r', 'o', 't', 'o', '/', 'g', 'o', 'o', 'g', 'l', 'e', 'a', 'p', 'i', 's', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u',
-'s', ';', 's', 't', 'a', 't', 'u', 's', '\242', '\002', '\003', 'R', 'P', 'C', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', ';', 's', 't', 'a', 't', 'u', 's', '\370', '\001', '\001', '\242', '\002', '\003', 'R', 'P', 'C', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_any_proto_upbdefinit,
NULL
};
-upb_def_init google_rpc_status_proto_upbdefinit = {
+_upb_DefPool_Init google_rpc_status_proto_upbdefinit = {
deps,
- layouts,
+ &google_rpc_status_proto_upb_file_layout,
"google/rpc/status.proto",
- UPB_STRVIEW_INIT(descriptor, 272)
+ UPB_STRINGVIEW_INIT(descriptor, 275)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h
index 6a39edd9..6ed28188 100644
--- a/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init google_rpc_status_proto_upbdefinit;
+extern _upb_DefPool_Init google_rpc_status_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *google_rpc_Status_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &google_rpc_status_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.rpc.Status");
+UPB_INLINE const upb_MessageDef *google_rpc_Status_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &google_rpc_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "google.rpc.Status");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c
new file mode 100644
index 00000000..607a78ce
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c
@@ -0,0 +1,67 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * opencensus/proto/trace/v1/trace_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "opencensus/proto/trace/v1/trace_config.upbdefs.h"
+#include "opencensus/proto/trace/v1/trace_config.upb.h"
+
+static const char descriptor[1065] = {'\n', ',', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '/', 'p', 'r', 'o', 't', 'o', '/', 't', 'r', 'a', 'c', 'e', '/',
+'v', '1', '/', 't', 'r', 'a', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'o', 'p',
+'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '1', '\"', '\234',
+'\004', '\n', '\013', 'T', 'r', 'a', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '`', '\n', '\023', 'p', 'r', 'o', 'b', 'a', 'b', 'i',
+'l', 'i', 't', 'y', '_', 's', 'a', 'm', 'p', 'l', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '-', '.', 'o', 'p', 'e', 'n',
+'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '1', '.', 'P', 'r', 'o',
+'b', 'a', 'b', 'i', 'l', 'i', 't', 'y', 'S', 'a', 'm', 'p', 'l', 'e', 'r', 'H', '\000', 'R', '\022', 'p', 'r', 'o', 'b', 'a', 'b',
+'i', 'l', 'i', 't', 'y', 'S', 'a', 'm', 'p', 'l', 'e', 'r', '\022', 'W', '\n', '\020', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', '_',
+'s', 'a', 'm', 'p', 'l', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '1', '.', 'C', 'o', 'n', 's', 't', 'a', 'n', 't',
+'S', 'a', 'm', 'p', 'l', 'e', 'r', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', 'S', 'a', 'm', 'p', 'l', 'e',
+'r', '\022', 'd', '\n', '\025', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 'i', 'n', 'g', '_', 's', 'a', 'm', 'p', 'l', 'e',
+'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '.', '.', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '1', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'i', 'n', 'g', 'S', 'a',
+'m', 'p', 'l', 'e', 'r', 'H', '\000', 'R', '\023', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'i', 'n', 'g', 'S', 'a', 'm', 'p',
+'l', 'e', 'r', '\022', '7', '\n', '\030', 'm', 'a', 'x', '_', 'n', 'u', 'm', 'b', 'e', 'r', '_', 'o', 'f', '_', 'a', 't', 't', 'r',
+'i', 'b', 'u', 't', 'e', 's', '\030', '\004', ' ', '\001', '(', '\003', 'R', '\025', 'm', 'a', 'x', 'N', 'u', 'm', 'b', 'e', 'r', 'O', 'f',
+'A', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', '\022', '9', '\n', '\031', 'm', 'a', 'x', '_', 'n', 'u', 'm', 'b', 'e', 'r', '_',
+'o', 'f', '_', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\026', 'm', 'a', 'x',
+'N', 'u', 'm', 'b', 'e', 'r', 'O', 'f', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\022', '>', '\n', '\034', 'm', 'a',
+'x', '_', 'n', 'u', 'm', 'b', 'e', 'r', '_', 'o', 'f', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 'e', 'v', 'e', 'n', 't',
+'s', '\030', '\006', ' ', '\001', '(', '\003', 'R', '\030', 'm', 'a', 'x', 'N', 'u', 'm', 'b', 'e', 'r', 'O', 'f', 'M', 'e', 's', 's', 'a',
+'g', 'e', 'E', 'v', 'e', 'n', 't', 's', '\022', '-', '\n', '\023', 'm', 'a', 'x', '_', 'n', 'u', 'm', 'b', 'e', 'r', '_', 'o', 'f',
+'_', 'l', 'i', 'n', 'k', 's', '\030', '\007', ' ', '\001', '(', '\003', 'R', '\020', 'm', 'a', 'x', 'N', 'u', 'm', 'b', 'e', 'r', 'O', 'f',
+'L', 'i', 'n', 'k', 's', 'B', '\t', '\n', '\007', 's', 'a', 'm', 'p', 'l', 'e', 'r', '\"', 'F', '\n', '\022', 'P', 'r', 'o', 'b', 'a',
+'b', 'i', 'l', 'i', 't', 'y', 'S', 'a', 'm', 'p', 'l', 'e', 'r', '\022', '0', '\n', '\023', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g',
+'P', 'r', 'o', 'b', 'a', 'b', 'i', 'l', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\023', 's', 'a', 'm', 'p', 'l', 'i',
+'n', 'g', 'P', 'r', 'o', 'b', 'a', 'b', 'i', 'l', 'i', 't', 'y', '\"', '\260', '\001', '\n', '\017', 'C', 'o', 'n', 's', 't', 'a', 'n',
+'t', 'S', 'a', 'm', 'p', 'l', 'e', 'r', '\022', 'W', '\n', '\010', 'd', 'e', 'c', 'i', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(',
+'\016', '2', ';', '.', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r', 'a', 'c',
+'e', '.', 'v', '1', '.', 'C', 'o', 'n', 's', 't', 'a', 'n', 't', 'S', 'a', 'm', 'p', 'l', 'e', 'r', '.', 'C', 'o', 'n', 's',
+'t', 'a', 'n', 't', 'D', 'e', 'c', 'i', 's', 'i', 'o', 'n', 'R', '\010', 'd', 'e', 'c', 'i', 's', 'i', 'o', 'n', '\"', 'D', '\n',
+'\020', 'C', 'o', 'n', 's', 't', 'a', 'n', 't', 'D', 'e', 'c', 'i', 's', 'i', 'o', 'n', '\022', '\016', '\n', '\n', 'A', 'L', 'W', 'A',
+'Y', 'S', '_', 'O', 'F', 'F', '\020', '\000', '\022', '\r', '\n', '\t', 'A', 'L', 'W', 'A', 'Y', 'S', '_', 'O', 'N', '\020', '\001', '\022', '\021',
+'\n', '\r', 'A', 'L', 'W', 'A', 'Y', 'S', '_', 'P', 'A', 'R', 'E', 'N', 'T', '\020', '\002', '\"', '\'', '\n', '\023', 'R', 'a', 't', 'e',
+'L', 'i', 'm', 'i', 't', 'i', 'n', 'g', 'S', 'a', 'm', 'p', 'l', 'e', 'r', '\022', '\020', '\n', '\003', 'q', 'p', 's', '\030', '\001', ' ',
+'\001', '(', '\003', 'R', '\003', 'q', 'p', 's', 'B', '\222', '\001', '\n', '\034', 'i', 'o', '.', 'o', 'p', 'e', 'n', 'c', 'e', 'n', 's', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '1', 'B', '\020', 'T', 'r', 'a', 'c', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', 'B', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c',
+'e', 'n', 's', 'u', 's', '-', 'i', 'n', 's', 't', 'r', 'u', 'm', 'e', 'n', 't', 'a', 't', 'i', 'o', 'n', '/', 'o', 'p', 'e',
+'n', 'c', 'e', 'n', 's', 'u', 's', '-', 'p', 'r', 'o', 't', 'o', '/', 'g', 'e', 'n', '-', 'g', 'o', '/', 't', 'r', 'a', 'c',
+'e', '/', 'v', '1', '\352', '\002', '\031', 'O', 'p', 'e', 'n', 'C', 'e', 'n', 's', 'u', 's', '.', 'P', 'r', 'o', 't', 'o', '.', 'T',
+'r', 'a', 'c', 'e', '.', 'V', '1', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[1] = {
+ NULL
+};
+
+_upb_DefPool_Init opencensus_proto_trace_v1_trace_config_proto_upbdefinit = {
+ deps,
+ &opencensus_proto_trace_v1_trace_config_proto_upb_file_layout,
+ "opencensus/proto/trace/v1/trace_config.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1065)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h
new file mode 100644
index 00000000..e7810095
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * opencensus/proto/trace/v1/trace_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_
+#define OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init opencensus_proto_trace_v1_trace_config_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *opencensus_proto_trace_v1_TraceConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &opencensus_proto_trace_v1_trace_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "opencensus.proto.trace.v1.TraceConfig");
+}
+
+UPB_INLINE const upb_MessageDef *opencensus_proto_trace_v1_ProbabilitySampler_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &opencensus_proto_trace_v1_trace_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "opencensus.proto.trace.v1.ProbabilitySampler");
+}
+
+UPB_INLINE const upb_MessageDef *opencensus_proto_trace_v1_ConstantSampler_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &opencensus_proto_trace_v1_trace_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "opencensus.proto.trace.v1.ConstantSampler");
+}
+
+UPB_INLINE const upb_MessageDef *opencensus_proto_trace_v1_RateLimitingSampler_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &opencensus_proto_trace_v1_trace_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "opencensus.proto.trace.v1.RateLimitingSampler");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* OPENCENSUS_PROTO_TRACE_V1_TRACE_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.c
deleted file mode 100644
index 7f317ae5..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/auth/v1/authz_policy.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/auth/v1/authz_policy.upbdefs.h"
-
-extern const upb_msglayout grpc_auth_v1_Peer_msginit;
-extern const upb_msglayout grpc_auth_v1_Header_msginit;
-extern const upb_msglayout grpc_auth_v1_Request_msginit;
-extern const upb_msglayout grpc_auth_v1_Rule_msginit;
-extern const upb_msglayout grpc_auth_v1_AuthorizationPolicy_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &grpc_auth_v1_Peer_msginit,
- &grpc_auth_v1_Header_msginit,
- &grpc_auth_v1_Request_msginit,
- &grpc_auth_v1_Rule_msginit,
- &grpc_auth_v1_AuthorizationPolicy_msginit,
-};
-
-static const char descriptor[507] = {'\n', ')', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'a', 'u', 't', 'h', '/', 'v', '1', '/',
-'a', 'u', 't', 'h', 'z', '_', 'p', 'o', 'l', 'i', 'c', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\014', 'g', 'r', 'p', 'c', '.',
-'a', 'u', 't', 'h', '.', 'v', '1', '\"', '&', '\n', '\004', 'P', 'e', 'e', 'r', '\022', '\036', '\n', '\n', 'p', 'r', 'i', 'n', 'c', 'i',
-'p', 'a', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\n', 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l', 's', '\"', '2', '\n',
-'\006', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y',
-'\022', '\026', '\n', '\006', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\006', 'v', 'a', 'l', 'u', 'e', 's', '\"',
-'O', '\n', '\007', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022', '\024', '\n', '\005', 'p', 'a', 't', 'h', 's', '\030', '\001', ' ', '\003', '(', '\t',
-'R', '\005', 'p', 'a', 't', 'h', 's', '\022', '.', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2',
-'\024', '.', 'g', 'r', 'p', 'c', '.', 'a', 'u', 't', 'h', '.', 'v', '1', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'R', '\007', 'h', 'e',
-'a', 'd', 'e', 'r', 's', '\"', 'w', '\n', '\004', 'R', 'u', 'l', 'e', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
-'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '*', '\n', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2',
-'\022', '.', 'g', 'r', 'p', 'c', '.', 'a', 'u', 't', 'h', '.', 'v', '1', '.', 'P', 'e', 'e', 'r', 'R', '\006', 's', 'o', 'u', 'r',
-'c', 'e', '\022', '/', '\n', '\007', 'r', 'e', 'q', 'u', 'e', 's', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\025', '.', 'g', 'r', 'p',
-'c', '.', 'a', 'u', 't', 'h', '.', 'v', '1', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'R', '\007', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '\"', '\221', '\001', '\n', '\023', 'A', 'u', 't', 'h', 'o', 'r', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '1', '\n', '\n', 'd',
-'e', 'n', 'y', '_', 'r', 'u', 'l', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'a', 'u',
-'t', 'h', '.', 'v', '1', '.', 'R', 'u', 'l', 'e', 'R', '\t', 'd', 'e', 'n', 'y', 'R', 'u', 'l', 'e', 's', '\022', '3', '\n', '\013',
-'a', 'l', 'l', 'o', 'w', '_', 'r', 'u', 'l', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.',
-'a', 'u', 't', 'h', '.', 'v', '1', '.', 'R', 'u', 'l', 'e', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'R', 'u', 'l', 'e', 's', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[1] = {
- NULL
-};
-
-upb_def_init src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/auth/v1/authz_policy.proto",
- UPB_STRVIEW_INIT(descriptor, 507)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.h
deleted file mode 100644
index c06fb251..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/auth/v1/authz_policy.upbdefs.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/auth/v1/authz_policy.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_auth_v1_Peer_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.auth.v1.Peer");
-}
-
-UPB_INLINE const upb_msgdef *grpc_auth_v1_Header_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.auth.v1.Header");
-}
-
-UPB_INLINE const upb_msgdef *grpc_auth_v1_Request_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.auth.v1.Request");
-}
-
-UPB_INLINE const upb_msgdef *grpc_auth_v1_Rule_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.auth.v1.Rule");
-}
-
-UPB_INLINE const upb_msgdef *grpc_auth_v1_AuthorizationPolicy_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_auth_v1_authz_policy_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.auth.v1.AuthorizationPolicy");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_AUTH_V1_AUTHZ_POLICY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.c
deleted file mode 100644
index c4fe57ea..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/altscontext.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/gcp/altscontext.upbdefs.h"
-
-extern upb_def_init src_proto_grpc_gcp_transport_security_common_proto_upbdefinit;
-extern const upb_msglayout grpc_gcp_AltsContext_msginit;
-extern const upb_msglayout grpc_gcp_AltsContext_PeerAttributesEntry_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &grpc_gcp_AltsContext_msginit,
- &grpc_gcp_AltsContext_PeerAttributesEntry_msginit,
-};
-
-static const char descriptor[718] = {'\n', '$', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'g', 'c', 'p', '/', 'a', 'l', 't', 's',
-'c', 'o', 'n', 't', 'e', 'x', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\010', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '\032', '2',
-'s', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'g', 'c', 'p', '/', 't', 'r', 'a', 'n', 's', 'p',
-'o', 'r', 't', '_', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '_', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
-'\"', '\361', '\003', '\n', '\013', 'A', 'l', 't', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '1', '\n', '\024', 'a', 'p', 'p', 'l', 'i',
-'c', 'a', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\023', 'a', 'p',
-'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\'', '\n', '\017', 'r', 'e', 'c', 'o',
-'r', 'd', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\016', 'r', 'e', 'c', 'o', 'r', 'd',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '>', '\n', '\016', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '_', 'l', 'e', 'v', 'e',
-'l', '\030', '\003', ' ', '\001', '(', '\016', '2', '\027', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'S', 'e', 'c', 'u', 'r', 'i',
-'t', 'y', 'L', 'e', 'v', 'e', 'l', 'R', '\r', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '0', '\n',
-'\024', 'p', 'e', 'e', 'r', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'a', 'c', 'c', 'o', 'u', 'n', 't', '\030', '\004', ' ', '\001',
-'(', '\t', 'R', '\022', 'p', 'e', 'e', 'r', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'A', 'c', 'c', 'o', 'u', 'n', 't', '\022', '2', '\n',
-'\025', 'l', 'o', 'c', 'a', 'l', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'a', 'c', 'c', 'o', 'u', 'n', 't', '\030', '\005', ' ',
-'\001', '(', '\t', 'R', '\023', 'l', 'o', 'c', 'a', 'l', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'A', 'c', 'c', 'o', 'u', 'n', 't', '\022',
-'I', '\n', '\021', 'p', 'e', 'e', 'r', '_', 'r', 'p', 'c', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', 's', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\035', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V',
-'e', 'r', 's', 'i', 'o', 'n', 's', 'R', '\017', 'p', 'e', 'e', 'r', 'R', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '\022',
-'R', '\n', '\017', 'p', 'e', 'e', 'r', '_', 'a', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', '\030', '\007', ' ', '\003', '(', '\013', '2',
-')', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'A', 'l', 't', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'P', 'e',
-'e', 'r', 'A', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\016', 'p', 'e', 'e', 'r', 'A', 't',
-'t', 'r', 'i', 'b', 'u', 't', 'e', 's', '\032', 'A', '\n', '\023', 'P', 'e', 'e', 'r', 'A', 't', 't', 'r', 'i', 'b', 'u', 't', 'e',
-'s', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022',
-'\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001',
-'B', 'l', '\n', '\025', 'i', 'o', '.', 'g', 'r', 'p', 'c', '.', 'a', 'l', 't', 's', '.', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l',
-'B', '\020', 'A', 'l', 't', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '?', 'g', 'o', 'o',
-'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'r', 'p', 'c', '/', 'c', 'r', 'e', 'd', 'e',
-'n', 't', 'i', 'a', 'l', 's', '/', 'a', 'l', 't', 's', '/', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '/', 'p', 'r', 'o', 't',
-'o', '/', 'g', 'r', 'p', 'c', '_', 'g', 'c', 'p', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[2] = {
- &src_proto_grpc_gcp_transport_security_common_proto_upbdefinit,
- NULL
-};
-
-upb_def_init src_proto_grpc_gcp_altscontext_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/gcp/altscontext.proto",
- UPB_STRVIEW_INIT(descriptor, 718)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.h
deleted file mode 100644
index 6c4d6113..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/altscontext.upbdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/altscontext.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_gcp_altscontext_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_gcp_AltsContext_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_altscontext_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.AltsContext");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_AltsContext_PeerAttributesEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_altscontext_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.AltsContext.PeerAttributesEntry");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.c
deleted file mode 100644
index e2f69459..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/handshaker.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/gcp/handshaker.upbdefs.h"
-
-extern upb_def_init src_proto_grpc_gcp_transport_security_common_proto_upbdefinit;
-extern const upb_msglayout grpc_gcp_Endpoint_msginit;
-extern const upb_msglayout grpc_gcp_Identity_msginit;
-extern const upb_msglayout grpc_gcp_Identity_AttributesEntry_msginit;
-extern const upb_msglayout grpc_gcp_StartClientHandshakeReq_msginit;
-extern const upb_msglayout grpc_gcp_ServerHandshakeParameters_msginit;
-extern const upb_msglayout grpc_gcp_StartServerHandshakeReq_msginit;
-extern const upb_msglayout grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit;
-extern const upb_msglayout grpc_gcp_NextHandshakeMessageReq_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerReq_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerResult_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerStatus_msginit;
-extern const upb_msglayout grpc_gcp_HandshakerResp_msginit;
-
-static const upb_msglayout *layouts[12] = {
- &grpc_gcp_Endpoint_msginit,
- &grpc_gcp_Identity_msginit,
- &grpc_gcp_Identity_AttributesEntry_msginit,
- &grpc_gcp_StartClientHandshakeReq_msginit,
- &grpc_gcp_ServerHandshakeParameters_msginit,
- &grpc_gcp_StartServerHandshakeReq_msginit,
- &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
- &grpc_gcp_NextHandshakeMessageReq_msginit,
- &grpc_gcp_HandshakerReq_msginit,
- &grpc_gcp_HandshakerResult_msginit,
- &grpc_gcp_HandshakerStatus_msginit,
- &grpc_gcp_HandshakerResp_msginit,
-};
-
-static const char descriptor[3053] = {'\n', '#', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'g', 'c', 'p', '/', 'h', 'a', 'n', 'd',
-'s', 'h', 'a', 'k', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\010', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '\032', '2', 's',
-'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'g', 'c', 'p', '/', 't', 'r', 'a', 'n', 's', 'p', 'o',
-'r', 't', '_', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '_', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\"',
-'t', '\n', '\010', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '\035', '\n', '\n', 'i', 'p', '_', 'a', 'd', 'd', 'r', 'e', 's', 's',
-'\030', '\001', ' ', '\001', '(', '\t', 'R', '\t', 'i', 'p', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', '\022', '\n', '\004', 'p', 'o', 'r', 't',
-'\030', '\002', ' ', '\001', '(', '\005', 'R', '\004', 'p', 'o', 'r', 't', '\022', '5', '\n', '\010', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030',
-'\003', ' ', '\001', '(', '\016', '2', '\031', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'N', 'e', 't', 'w', 'o', 'r', 'k', 'P',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 'R', '\010', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\"', '\350', '\001', '\n', '\010', 'I', 'd', 'e',
-'n', 't', 'i', 't', 'y', '\022', ')', '\n', '\017', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'a', 'c', 'c', 'o', 'u', 'n', 't', '\030',
-'\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\016', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'A', 'c', 'c', 'o', 'u', 'n', 't', '\022', '\034',
-'\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\010', 'h', 'o', 's', 't', 'n',
-'a', 'm', 'e', '\022', 'B', '\n', '\n', 'a', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\"',
-'.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', '.', 'A', 't', 't', 'r', 'i', 'b',
-'u', 't', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\n', 'a', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', '\032', '=', '\n', '\017',
-'A', 't', 't', 'r', 'i', 'b', 'u', 't', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ',
-'\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005',
-'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', '\020', '\n', '\016', 'i', 'd', 'e', 'n', 't', 'i', 't', 'y', '_', 'o', 'n', 'e',
-'o', 'f', '\"', '\323', '\004', '\n', '\027', 'S', 't', 'a', 'r', 't', 'C', 'l', 'i', 'e', 'n', 't', 'H', 'a', 'n', 'd', 's', 'h', 'a',
-'k', 'e', 'R', 'e', 'q', '\022', '[', '\n', '\033', 'h', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', '_', 's', 'e', 'c', 'u', 'r', 'i',
-'t', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\001', ' ', '\001', '(', '\016', '2', '\033', '.', 'g', 'r', 'p', 'c', '.',
-'g', 'c', 'p', '.', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'R', '\031', 'h', 'a',
-'n', 'd', 's', 'h', 'a', 'k', 'e', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '3',
-'\n', '\025', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\002',
-' ', '\003', '(', '\t', 'R', '\024', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'s', '\022', ')', '\n', '\020', 'r', 'e', 'c', 'o', 'r', 'd', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\003', ' ', '\003',
-'(', '\t', 'R', '\017', 'r', 'e', 'c', 'o', 'r', 'd', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', '?', '\n', '\021', 't', 'a',
-'r', 'g', 'e', 't', '_', 'i', 'd', 'e', 'n', 't', 'i', 't', 'i', 'e', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '\022', '.', 'g',
-'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', 'R', '\020', 't', 'a', 'r', 'g', 'e', 't', 'I',
-'d', 'e', 'n', 't', 'i', 't', 'i', 'e', 's', '\022', '9', '\n', '\016', 'l', 'o', 'c', 'a', 'l', '_', 'i', 'd', 'e', 'n', 't', 'i',
-'t', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'I', 'd', 'e', 'n', 't',
-'i', 't', 'y', 'R', '\r', 'l', 'o', 'c', 'a', 'l', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', '\022', '9', '\n', '\016', 'l', 'o', 'c',
-'a', 'l', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.',
-'g', 'c', 'p', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\r', 'l', 'o', 'c', 'a', 'l', 'E', 'n', 'd', 'p', 'o', 'i',
-'n', 't', '\022', ';', '\n', '\017', 'r', 'e', 'm', 'o', 't', 'e', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\007', ' ', '\001',
-'(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\016', 'r',
-'e', 'm', 'o', 't', 'e', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '\037', '\n', '\013', 't', 'a', 'r', 'g', 'e', 't', '_', 'n',
-'a', 'm', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\n', 't', 'a', 'r', 'g', 'e', 't', 'N', 'a', 'm', 'e', '\022', '@', '\n', '\014',
-'r', 'p', 'c', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\001', '(', '\013', '2', '\035', '.', 'g', 'r', 'p', 'c',
-'.', 'g', 'c', 'p', '.', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', 'R',
-'\013', 'r', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '\022', '$', '\n', '\016', 'm', 'a', 'x', '_', 'f', 'r', 'a', 'm', 'e',
-'_', 's', 'i', 'z', 'e', '\030', '\n', ' ', '\001', '(', '\r', 'R', '\014', 'm', 'a', 'x', 'F', 'r', 'a', 'm', 'e', 'S', 'i', 'z', 'e',
-'\"', '\205', '\001', '\n', '\031', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'a', 'r', 'a', 'm',
-'e', 't', 'e', 'r', 's', '\022', ')', '\n', '\020', 'r', 'e', 'c', 'o', 'r', 'd', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's',
-'\030', '\001', ' ', '\003', '(', '\t', 'R', '\017', 'r', 'e', 'c', 'o', 'r', 'd', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', '=',
-'\n', '\020', 'l', 'o', 'c', 'a', 'l', '_', 'i', 'd', 'e', 'n', 't', 'i', 't', 'i', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2',
-'\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', 'R', '\017', 'l', 'o', 'c', 'a',
-'l', 'I', 'd', 'e', 'n', 't', 'i', 't', 'i', 'e', 's', '\"', '\245', '\004', '\n', '\027', 'S', 't', 'a', 'r', 't', 'S', 'e', 'r', 'v',
-'e', 'r', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'R', 'e', 'q', '\022', '3', '\n', '\025', 'a', 'p', 'p', 'l', 'i', 'c', 'a',
-'t', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\024', 'a', 'p', 'p',
-'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', 'm', '\n', '\024', 'h', 'a', 'n', 'd',
-'s', 'h', 'a', 'k', 'e', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', ':', '.',
-'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'S', 't', 'a', 'r', 't', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'a', 'n', 'd', 's',
-'h', 'a', 'k', 'e', 'R', 'e', 'q', '.', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
-'r', 's', 'E', 'n', 't', 'r', 'y', 'R', '\023', 'h', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'a', 'r', 'a', 'm', 'e', 't',
-'e', 'r', 's', '\022', '\031', '\n', '\010', 'i', 'n', '_', 'b', 'y', 't', 'e', 's', '\030', '\003', ' ', '\001', '(', '\014', 'R', '\007', 'i', 'n',
-'B', 'y', 't', 'e', 's', '\022', '9', '\n', '\016', 'l', 'o', 'c', 'a', 'l', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\004',
-' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R',
-'\r', 'l', 'o', 'c', 'a', 'l', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', ';', '\n', '\017', 'r', 'e', 'm', 'o', 't', 'e', '_',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p',
-'.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\016', 'r', 'e', 'm', 'o', 't', 'e', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't',
-'\022', '@', '\n', '\014', 'r', 'p', 'c', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', 's', '\030', '\006', ' ', '\001', '(', '\013', '2', '\035', '.',
-'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i',
-'o', 'n', 's', 'R', '\013', 'r', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '\022', '$', '\n', '\016', 'm', 'a', 'x', '_', 'f',
-'r', 'a', 'm', 'e', '_', 's', 'i', 'z', 'e', '\030', '\007', ' ', '\001', '(', '\r', 'R', '\014', 'm', 'a', 'x', 'F', 'r', 'a', 'm', 'e',
-'S', 'i', 'z', 'e', '\032', 'k', '\n', '\030', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
-'r', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\003', 'k', 'e', 'y',
-'\022', '9', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c',
-'p', '.', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
-'r', 's', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', '4', '\n', '\027', 'N', 'e', 'x', 't', 'H', 'a', 'n', 'd',
-'s', 'h', 'a', 'k', 'e', 'M', 'e', 's', 's', 'a', 'g', 'e', 'R', 'e', 'q', '\022', '\031', '\n', '\010', 'i', 'n', '_', 'b', 'y', 't',
-'e', 's', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\007', 'i', 'n', 'B', 'y', 't', 'e', 's', '\"', '\345', '\001', '\n', '\r', 'H', 'a', 'n',
-'d', 's', 'h', 'a', 'k', 'e', 'r', 'R', 'e', 'q', '\022', 'F', '\n', '\014', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 'r',
-'t', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'S', 't', 'a', 'r', 't', 'C',
-'l', 'i', 'e', 'n', 't', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'R', 'e', 'q', 'H', '\000', 'R', '\013', 'c', 'l', 'i', 'e',
-'n', 't', 'S', 't', 'a', 'r', 't', '\022', 'F', '\n', '\014', 's', 'e', 'r', 'v', 'e', 'r', '_', 's', 't', 'a', 'r', 't', '\030', '\002',
-' ', '\001', '(', '\013', '2', '!', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'S', 't', 'a', 'r', 't', 'S', 'e', 'r', 'v',
-'e', 'r', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'R', 'e', 'q', 'H', '\000', 'R', '\013', 's', 'e', 'r', 'v', 'e', 'r', 'S',
-'t', 'a', 'r', 't', '\022', '7', '\n', '\004', 'n', 'e', 'x', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'r', 'p', 'c',
-'.', 'g', 'c', 'p', '.', 'N', 'e', 'x', 't', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'M', 'e', 's', 's', 'a', 'g', 'e',
-'R', 'e', 'q', 'H', '\000', 'R', '\004', 'n', 'e', 'x', 't', 'B', '\013', '\n', '\t', 'r', 'e', 'q', '_', 'o', 'n', 'e', 'o', 'f', '\"',
-'\232', '\003', '\n', '\020', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', 'R', 'e', 's', 'u', 'l', 't', '\022', '1', '\n', '\024', 'a',
-'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\001', ' ', '\001', '(', '\t',
-'R', '\023', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\'', '\n', '\017',
-'r', 'e', 'c', 'o', 'r', 'd', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\016', 'r', 'e',
-'c', 'o', 'r', 'd', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\031', '\n', '\010', 'k', 'e', 'y', '_', 'd', 'a', 't', 'a', '\030',
-'\003', ' ', '\001', '(', '\014', 'R', '\007', 'k', 'e', 'y', 'D', 'a', 't', 'a', '\022', '7', '\n', '\r', 'p', 'e', 'e', 'r', '_', 'i', 'd',
-'e', 'n', 't', 'i', 't', 'y', '\030', '\004', ' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'I',
-'d', 'e', 'n', 't', 'i', 't', 'y', 'R', '\014', 'p', 'e', 'e', 'r', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', '\022', '9', '\n', '\016',
-'l', 'o', 'c', 'a', 'l', '_', 'i', 'd', 'e', 'n', 't', 'i', 't', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '\022', '.', 'g', 'r',
-'p', 'c', '.', 'g', 'c', 'p', '.', 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', 'R', '\r', 'l', 'o', 'c', 'a', 'l', 'I', 'd', 'e',
-'n', 't', 'i', 't', 'y', '\022', '*', '\n', '\021', 'k', 'e', 'e', 'p', '_', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '_', 'o', 'p', 'e',
-'n', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\017', 'k', 'e', 'e', 'p', 'C', 'h', 'a', 'n', 'n', 'e', 'l', 'O', 'p', 'e', 'n', '\022',
-'I', '\n', '\021', 'p', 'e', 'e', 'r', '_', 'r', 'p', 'c', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\001', '(',
-'\013', '2', '\035', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V',
-'e', 'r', 's', 'i', 'o', 'n', 's', 'R', '\017', 'p', 'e', 'e', 'r', 'R', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '\022',
-'$', '\n', '\016', 'm', 'a', 'x', '_', 'f', 'r', 'a', 'm', 'e', '_', 's', 'i', 'z', 'e', '\030', '\010', ' ', '\001', '(', '\r', 'R', '\014',
-'m', 'a', 'x', 'F', 'r', 'a', 'm', 'e', 'S', 'i', 'z', 'e', '\"', '@', '\n', '\020', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e',
-'r', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\004', 'c', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\r', 'R', '\004', 'c', 'o',
-'d', 'e', '\022', '\030', '\n', '\007', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'd', 'e', 't', 'a',
-'i', 'l', 's', '\"', '\276', '\001', '\n', '\016', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', 'R', 'e', 's', 'p', '\022', '\035', '\n',
-'\n', 'o', 'u', 't', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\t', 'o', 'u', 't', 'F', 'r', 'a',
-'m', 'e', 's', '\022', '%', '\n', '\016', 'b', 'y', 't', 'e', 's', '_', 'c', 'o', 'n', 's', 'u', 'm', 'e', 'd', '\030', '\002', ' ', '\001',
-'(', '\r', 'R', '\r', 'b', 'y', 't', 'e', 's', 'C', 'o', 'n', 's', 'u', 'm', 'e', 'd', '\022', '2', '\n', '\006', 'r', 'e', 's', 'u',
-'l', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'H', 'a', 'n', 'd', 's',
-'h', 'a', 'k', 'e', 'r', 'R', 'e', 's', 'u', 'l', 't', 'R', '\006', 'r', 'e', 's', 'u', 'l', 't', '\022', '2', '\n', '\006', 's', 't',
-'a', 't', 'u', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'H', 'a', 'n',
-'d', 's', 'h', 'a', 'k', 'e', 'r', 'S', 't', 'a', 't', 'u', 's', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '*', 'J', '\n', '\021',
-'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\"', '\n', '\036', 'H', 'A', 'N', 'D',
-'S', 'H', 'A', 'K', 'E', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E',
-'D', '\020', '\000', '\022', '\007', '\n', '\003', 'T', 'L', 'S', '\020', '\001', '\022', '\010', '\n', '\004', 'A', 'L', 'T', 'S', '\020', '\002', '*', 'E', '\n',
-'\017', 'N', 'e', 't', 'w', 'o', 'r', 'k', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', ' ', '\n', '\034', 'N', 'E', 'T', 'W', 'O',
-'R', 'K', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000',
-'\022', '\007', '\n', '\003', 'T', 'C', 'P', '\020', '\001', '\022', '\007', '\n', '\003', 'U', 'D', 'P', '\020', '\002', '2', '[', '\n', '\021', 'H', 'a', 'n',
-'d', 's', 'h', 'a', 'k', 'e', 'r', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'F', '\n', '\013', 'D', 'o', 'H', 'a', 'n', 'd', 's',
-'h', 'a', 'k', 'e', '\022', '\027', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e',
-'r', 'R', 'e', 'q', '\032', '\030', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e',
-'r', 'R', 'e', 's', 'p', '\"', '\000', '(', '\001', '0', '\001', 'B', 'k', '\n', '\025', 'i', 'o', '.', 'g', 'r', 'p', 'c', '.', 'a', 'l',
-'t', 's', '.', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'B', '\017', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', 'P', 'r',
-'o', 't', 'o', 'P', '\001', 'Z', '?', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/',
-'g', 'r', 'p', 'c', '/', 'c', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's', '/', 'a', 'l', 't', 's', '/', 'i', 'n', 't',
-'e', 'r', 'n', 'a', 'l', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '_', 'g', 'c', 'p', 'b', '\006', 'p', 'r', 'o',
-'t', 'o', '3',
-};
-
-static upb_def_init *deps[2] = {
- &src_proto_grpc_gcp_transport_security_common_proto_upbdefinit,
- NULL
-};
-
-upb_def_init src_proto_grpc_gcp_handshaker_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/gcp/handshaker.proto",
- UPB_STRVIEW_INIT(descriptor, 3053)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.h
deleted file mode 100644
index 41bf499d..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/handshaker.upbdefs.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/handshaker.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_gcp_handshaker_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_gcp_Endpoint_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.Endpoint");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_Identity_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.Identity");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_Identity_AttributesEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.Identity.AttributesEntry");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_StartClientHandshakeReq_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.StartClientHandshakeReq");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_ServerHandshakeParameters_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.ServerHandshakeParameters");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_StartServerHandshakeReq_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.StartServerHandshakeReq");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.StartServerHandshakeReq.HandshakeParametersEntry");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_NextHandshakeMessageReq_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.NextHandshakeMessageReq");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_HandshakerReq_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.HandshakerReq");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_HandshakerResult_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.HandshakerResult");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_HandshakerStatus_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.HandshakerStatus");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_HandshakerResp_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_handshaker_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.HandshakerResp");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.c
deleted file mode 100644
index 0ae0baf8..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/transport_security_common.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/gcp/transport_security_common.upbdefs.h"
-
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit;
-extern const upb_msglayout grpc_gcp_RpcProtocolVersions_Version_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &grpc_gcp_RpcProtocolVersions_msginit,
- &grpc_gcp_RpcProtocolVersions_Version_msginit,
-};
-
-static const char descriptor[512] = {'\n', '2', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'g', 'c', 'p', '/', 't', 'r', 'a', 'n',
-'s', 'p', 'o', 'r', 't', '_', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '_', 'c', 'o', 'm', 'm', 'o', 'n', '.', 'p', 'r', 'o',
-'t', 'o', '\022', '\010', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '\"', '\352', '\001', '\n', '\023', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '\022', 'M', '\n', '\017', 'm', 'a', 'x', '_', 'r', 'p', 'c', '_', 'v', 'e',
-'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '%', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c', 'p', '.', 'R', 'p',
-'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '.', 'V', 'e', 'r', 's', 'i', 'o', 'n',
-'R', '\r', 'm', 'a', 'x', 'R', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', 'M', '\n', '\017', 'm', 'i', 'n', '_', 'r', 'p',
-'c', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '%', '.', 'g', 'r', 'p', 'c', '.', 'g', 'c',
-'p', '.', 'R', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', 's', '.', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', 'R', '\r', 'm', 'i', 'n', 'R', 'p', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\032', '5', '\n', '\007', 'V', 'e',
-'r', 's', 'i', 'o', 'n', '\022', '\024', '\n', '\005', 'm', 'a', 'j', 'o', 'r', '\030', '\001', ' ', '\001', '(', '\r', 'R', '\005', 'm', 'a', 'j',
-'o', 'r', '\022', '\024', '\n', '\005', 'm', 'i', 'n', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\005', 'm', 'i', 'n', 'o', 'r', '*',
-'Q', '\n', '\r', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\021', '\n', '\r', 'S', 'E', 'C', 'U', 'R',
-'I', 'T', 'Y', '_', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\022', '\n', '\016', 'I', 'N', 'T', 'E', 'G', 'R', 'I', 'T', 'Y', '_', 'O',
-'N', 'L', 'Y', '\020', '\001', '\022', '\031', '\n', '\025', 'I', 'N', 'T', 'E', 'G', 'R', 'I', 'T', 'Y', '_', 'A', 'N', 'D', '_', 'P', 'R',
-'I', 'V', 'A', 'C', 'Y', '\020', '\002', 'B', 'x', '\n', '\025', 'i', 'o', '.', 'g', 'r', 'p', 'c', '.', 'a', 'l', 't', 's', '.', 'i',
-'n', 't', 'e', 'r', 'n', 'a', 'l', 'B', '\034', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'e', 'c', 'u', 'r', 'i', 't',
-'y', 'C', 'o', 'm', 'm', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '?', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o',
-'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'r', 'p', 'c', '/', 'c', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's',
-'/', 'a', 'l', 't', 's', '/', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c',
-'_', 'g', 'c', 'p', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[1] = {
- NULL
-};
-
-upb_def_init src_proto_grpc_gcp_transport_security_common_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/gcp/transport_security_common.proto",
- UPB_STRVIEW_INIT(descriptor, 512)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.h
deleted file mode 100644
index cf79d2e5..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/gcp/transport_security_common.upbdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/gcp/transport_security_common.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_gcp_transport_security_common_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_gcp_RpcProtocolVersions_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_transport_security_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.RpcProtocolVersions");
-}
-
-UPB_INLINE const upb_msgdef *grpc_gcp_RpcProtocolVersions_Version_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_gcp_transport_security_common_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.gcp.RpcProtocolVersions.Version");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.c
deleted file mode 100644
index 4f63972d..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/health/v1/health.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/health/v1/health.upbdefs.h"
-
-extern const upb_msglayout grpc_health_v1_HealthCheckRequest_msginit;
-extern const upb_msglayout grpc_health_v1_HealthCheckResponse_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &grpc_health_v1_HealthCheckRequest_msginit,
- &grpc_health_v1_HealthCheckResponse_msginit,
-};
-
-static const char descriptor[567] = {'\n', '%', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'h', 'e', 'a', 'l', 't', 'h', '/', 'v',
-'1', '/', 'h', 'e', 'a', 'l', 't', 'h', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'g', 'r', 'p', 'c', '.', 'h', 'e', 'a', 'l',
-'t', 'h', '.', 'v', '1', '\"', '.', '\n', '\022', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 'q', 'u', 'e',
-'s', 't', '\022', '\030', '\n', '\007', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 's', 'e', 'r', 'v',
-'i', 'c', 'e', '\"', '\261', '\001', '\n', '\023', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', '\022', 'I', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\016', '2', '1', '.', 'g', 'r', 'p', 'c',
-'.', 'h', 'e', 'a', 'l', 't', 'h', '.', 'v', '1', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', '.', 'S', 'e', 'r', 'v', 'i', 'n', 'g', 'S', 't', 'a', 't', 'u', 's', 'R', '\006', 's', 't', 'a', 't',
-'u', 's', '\"', 'O', '\n', '\r', 'S', 'e', 'r', 'v', 'i', 'n', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N',
-'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\013', '\n', '\007', 'S', 'E', 'R', 'V', 'I', 'N', 'G', '\020', '\001', '\022', '\017', '\n', '\013', 'N',
-'O', 'T', '_', 'S', 'E', 'R', 'V', 'I', 'N', 'G', '\020', '\002', '\022', '\023', '\n', '\017', 'S', 'E', 'R', 'V', 'I', 'C', 'E', '_', 'U',
-'N', 'K', 'N', 'O', 'W', 'N', '\020', '\003', '2', '\256', '\001', '\n', '\006', 'H', 'e', 'a', 'l', 't', 'h', '\022', 'P', '\n', '\005', 'C', 'h',
-'e', 'c', 'k', '\022', '\"', '.', 'g', 'r', 'p', 'c', '.', 'h', 'e', 'a', 'l', 't', 'h', '.', 'v', '1', '.', 'H', 'e', 'a', 'l',
-'t', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '#', '.', 'g', 'r', 'p', 'c', '.', 'h', 'e', 'a',
-'l', 't', 'h', '.', 'v', '1', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 's', 'p', 'o', 'n', 's',
-'e', '\022', 'R', '\n', '\005', 'W', 'a', 't', 'c', 'h', '\022', '\"', '.', 'g', 'r', 'p', 'c', '.', 'h', 'e', 'a', 'l', 't', 'h', '.',
-'v', '1', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '#', '.', 'g',
-'r', 'p', 'c', '.', 'h', 'e', 'a', 'l', 't', 'h', '.', 'v', '1', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
-'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '0', '\001', 'B', 'a', '\n', '\021', 'i', 'o', '.', 'g', 'r', 'p', 'c', '.', 'h', 'e', 'a',
-'l', 't', 'h', '.', 'v', '1', 'B', '\013', 'H', 'e', 'a', 'l', 't', 'h', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ',', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'r', 'p', 'c', '/', 'h', 'e', 'a', 'l',
-'t', 'h', '/', 'g', 'r', 'p', 'c', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'v', '1', '\252', '\002', '\016', 'G', 'r', 'p', 'c', '.',
-'H', 'e', 'a', 'l', 't', 'h', '.', 'V', '1', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[1] = {
- NULL
-};
-
-upb_def_init src_proto_grpc_health_v1_health_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/health/v1/health.proto",
- UPB_STRVIEW_INIT(descriptor, 567)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.h
deleted file mode 100644
index 50a1021d..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/health/v1/health.upbdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/health/v1/health.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_health_v1_health_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_health_v1_HealthCheckRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_health_v1_health_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.health.v1.HealthCheckRequest");
-}
-
-UPB_INLINE const upb_msgdef *grpc_health_v1_HealthCheckResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_health_v1_health_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.health.v1.HealthCheckResponse");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.c
deleted file mode 100644
index 99b925cc..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/lb/v1/load_balancer.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "src/proto/grpc/lb/v1/load_balancer.upbdefs.h"
-
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
-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;
-extern const upb_msglayout grpc_lb_v1_ClientStats_msginit;
-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;
-
-static const upb_msglayout *layouts[9] = {
- &grpc_lb_v1_LoadBalanceRequest_msginit,
- &grpc_lb_v1_InitialLoadBalanceRequest_msginit,
- &grpc_lb_v1_ClientStatsPerToken_msginit,
- &grpc_lb_v1_ClientStats_msginit,
- &grpc_lb_v1_LoadBalanceResponse_msginit,
- &grpc_lb_v1_InitialLoadBalanceResponse_msginit,
- &grpc_lb_v1_ServerList_msginit,
- &grpc_lb_v1_Server_msginit,
- &grpc_lb_v1_FallbackResponse_msginit,
-};
-
-static const char descriptor[1767] = {'\n', '(', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'l', 'b', '/', 'v', '1', '/', 'l', 'o',
-'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\n', 'g', 'r', 'p', 'c', '.', 'l',
-'b', '.', 'v', '1', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r',
-'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\"', '\301', '\001', '\n', '\022', 'L',
-'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022', 'P', '\n', '\017', 'i', 'n', 'i', 't',
-'i', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '%', '.', 'g', 'r', 'p', 'c', '.',
-'l', 'b', '.', 'v', '1', '.', 'I', 'n', 'i', 't', 'i', 'a', 'l', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R',
-'e', 'q', 'u', 'e', 's', 't', 'H', '\000', 'R', '\016', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022',
-'<', '\n', '\014', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g',
-'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 's', 'H', '\000', 'R', '\013',
-'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 's', 'B', '\033', '\n', '\031', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n',
-'c', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'y', 'p', 'e', '\"', '/', '\n', '\031', 'I', 'n', 'i', 't', 'i', 'a',
-'l', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022', '\022', '\n', '\004', 'n', 'a',
-'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\"', '`', '\n', '\023', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 's', 'P', 'e', 'r', 'T', 'o', 'k', 'e', 'n', '\022', ',', '\n', '\022', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a',
-'n', 'c', 'e', '_', 't', 'o', 'k', 'e', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\020', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a',
-'n', 'c', 'e', 'T', 'o', 'k', 'e', 'n', '\022', '\033', '\n', '\t', 'n', 'u', 'm', '_', 'c', 'a', 'l', 'l', 's', '\030', '\002', ' ', '\001',
-'(', '\003', 'R', '\010', 'n', 'u', 'm', 'C', 'a', 'l', 'l', 's', '\"', '\260', '\003', '\n', '\013', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't',
-'a', 't', 's', '\022', '8', '\n', '\t', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
-'R', '\t', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '*', '\n', '\021', 'n', 'u', 'm', '_', 'c', 'a', 'l', 'l', 's', '_',
-'s', 't', 'a', 'r', 't', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\003', 'R', '\017', 'n', 'u', 'm', 'C', 'a', 'l', 'l', 's', 'S', 't',
-'a', 'r', 't', 'e', 'd', '\022', ',', '\n', '\022', 'n', 'u', 'm', '_', 'c', 'a', 'l', 'l', 's', '_', 'f', 'i', 'n', 'i', 's', 'h',
-'e', 'd', '\030', '\003', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'u', 'm', 'C', 'a', 'l', 'l', 's', 'F', 'i', 'n', 'i', 's', 'h', 'e',
-'d', '\022', ']', '\n', '-', 'n', 'u', 'm', '_', 'c', 'a', 'l', 'l', 's', '_', 'f', 'i', 'n', 'i', 's', 'h', 'e', 'd', '_', 'w',
-'i', 't', 'h', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'f', 'a', 'i', 'l', 'e', 'd', '_', 't', 'o', '_', 's', 'e', 'n', 'd',
-'\030', '\006', ' ', '\001', '(', '\003', 'R', '&', 'n', 'u', 'm', 'C', 'a', 'l', 'l', 's', 'F', 'i', 'n', 'i', 's', 'h', 'e', 'd', 'W',
-'i', 't', 'h', 'C', 'l', 'i', 'e', 'n', 't', 'F', 'a', 'i', 'l', 'e', 'd', 'T', 'o', 'S', 'e', 'n', 'd', '\022', 'H', '\n', '!',
-'n', 'u', 'm', '_', 'c', 'a', 'l', 'l', 's', '_', 'f', 'i', 'n', 'i', 's', 'h', 'e', 'd', '_', 'k', 'n', 'o', 'w', 'n', '_',
-'r', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\030', '\007', ' ', '\001', '(', '\003', 'R', '\035', 'n', 'u', 'm', 'C', 'a', 'l', 'l', 's', 'F',
-'i', 'n', 'i', 's', 'h', 'e', 'd', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'c', 'e', 'i', 'v', 'e', 'd', '\022', 'X', '\n', '\030', 'c',
-'a', 'l', 'l', 's', '_', 'f', 'i', 'n', 'i', 's', 'h', 'e', 'd', '_', 'w', 'i', 't', 'h', '_', 'd', 'r', 'o', 'p', '\030', '\010',
-' ', '\003', '(', '\013', '2', '\037', '.', 'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 's', 'P', 'e', 'r', 'T', 'o', 'k', 'e', 'n', 'R', '\025', 'c', 'a', 'l', 'l', 's', 'F', 'i', 'n', 'i', 's', 'h',
-'e', 'd', 'W', 'i', 't', 'h', 'D', 'r', 'o', 'p', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\220', '\002',
-'\n', '\023', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'S', '\n', '\020',
-'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '&', '.',
-'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'I', 'n', 'i', 't', 'i', 'a', 'l', 'L', 'o', 'a', 'd', 'B', 'a', 'l',
-'a', 'n', 'c', 'e', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', '\000', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'R', 'e',
-'s', 'p', 'o', 'n', 's', 'e', '\022', '9', '\n', '\013', 's', 'e', 'r', 'v', 'e', 'r', '_', 'l', 'i', 's', 't', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '\026', '.', 'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'S', 'e', 'r', 'v', 'e', 'r', 'L', 'i', 's',
-'t', 'H', '\000', 'R', '\n', 's', 'e', 'r', 'v', 'e', 'r', 'L', 'i', 's', 't', '\022', 'K', '\n', '\021', 'f', 'a', 'l', 'l', 'b', 'a',
-'c', 'k', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'r', 'p', 'c', '.',
-'l', 'b', '.', 'v', '1', '.', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', '\000', 'R',
-'\020', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'B', '\034', '\n', '\032', 'l', 'o', 'a', 'd',
-'_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 't', 'y', 'p', 'e', '\"', '\256', '\001',
-'\n', '\032', 'I', 'n', 'i', 't', 'i', 'a', 'l', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R', 'e', 's', 'p', 'o',
-'n', 's', 'e', '\022', '4', '\n', '\026', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '_', 'd', 'e', 'l', 'e',
-'g', 'a', 't', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\024', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'r', 'D',
-'e', 'l', 'e', 'g', 'a', 't', 'e', '\022', 'Z', '\n', '\034', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 's', '_', 'r',
-'e', 'p', 'o', 'r', 't', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\031', 'c',
-'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 's', 'R', 'e', 'p', 'o', 'r', 't', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\"',
-'@', '\n', '\n', 'S', 'e', 'r', 'v', 'e', 'r', 'L', 'i', 's', 't', '\022', ',', '\n', '\007', 's', 'e', 'r', 'v', 'e', 'r', 's', '\030',
-'\001', ' ', '\003', '(', '\013', '2', '\022', '.', 'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'S', 'e', 'r', 'v', 'e', 'r',
-'R', '\007', 's', 'e', 'r', 'v', 'e', 'r', 's', 'J', '\004', '\010', '\003', '\020', '\004', '\"', '\203', '\001', '\n', '\006', 'S', 'e', 'r', 'v', 'e',
-'r', '\022', '\035', '\n', '\n', 'i', 'p', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\t', 'i', 'p',
-'A', 'd', 'd', 'r', 'e', 's', 's', '\022', '\022', '\n', '\004', 'p', 'o', 'r', 't', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\004', 'p', 'o',
-'r', 't', '\022', ',', '\n', '\022', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 't', 'o', 'k', 'e', 'n', '\030',
-'\003', ' ', '\001', '(', '\t', 'R', '\020', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'T', 'o', 'k', 'e', 'n', '\022', '\022',
-'\n', '\004', 'd', 'r', 'o', 'p', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\004', 'd', 'r', 'o', 'p', 'J', '\004', '\010', '\005', '\020', '\006', '\"',
-'\022', '\n', '\020', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '2', 'b', '\n', '\014', 'L', 'o',
-'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '\022', 'R', '\n', '\013', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'L', 'o', 'a', 'd',
-'\022', '\036', '.', 'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
-'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '\037', '.', 'g', 'r', 'p', 'c', '.', 'l', 'b', '.', 'v', '1', '.', 'L', 'o', 'a', 'd',
-'B', 'a', 'l', 'a', 'n', 'c', 'e', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '(', '\001', '0', '\001', 'B', 'X', '\n', '\016', 'i', 'o',
-'.', 'g', 'r', 'p', 'c', '.', 'g', 'r', 'p', 'c', 'l', 'b', 'B', '\021', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
-'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '1', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o',
-'r', 'g', '/', 'g', 'r', 'p', 'c', '/', 'b', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '/', 'g', 'r', 'p', 'c', 'l', 'b', '/', 'g',
-'r', 'p', 'c', '_', 'l', 'b', '_', 'v', '1', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[3] = {
- &google_protobuf_duration_proto_upbdefinit,
- &google_protobuf_timestamp_proto_upbdefinit,
- NULL
-};
-
-upb_def_init src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit = {
- deps,
- layouts,
- "src/proto/grpc/lb/v1/load_balancer.proto",
- UPB_STRVIEW_INIT(descriptor, 1767)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.h
deleted file mode 100644
index 87949a24..00000000
--- a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lb/v1/load_balancer.upbdefs.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * src/proto/grpc/lb/v1/load_balancer.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPBDEFS_H_
-#define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_LoadBalanceRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.LoadBalanceRequest");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_InitialLoadBalanceRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.InitialLoadBalanceRequest");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_ClientStatsPerToken_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.ClientStatsPerToken");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_ClientStats_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.ClientStats");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_LoadBalanceResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.LoadBalanceResponse");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_InitialLoadBalanceResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.InitialLoadBalanceResponse");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_ServerList_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.ServerList");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_Server_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.Server");
-}
-
-UPB_INLINE const upb_msgdef *grpc_lb_v1_FallbackResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &src_proto_grpc_lb_v1_load_balancer_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "grpc.lb.v1.FallbackResponse");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c
new file mode 100644
index 00000000..92c529b6
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c
@@ -0,0 +1,99 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "src/proto/grpc/lookup/v1/rls_config.upbdefs.h"
+#include "src/proto/grpc/lookup/v1/rls_config.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+static const char descriptor[1816] = {'\n', ')', 's', 'r', 'c', '/', 'p', 'r', 'o', 't', 'o', '/', 'g', 'r', 'p', 'c', '/', 'l', 'o', 'o', 'k', 'u', 'p', '/', 'v',
+'1', '/', 'r', 'l', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'g', 'r', 'p', 'c', '.',
+'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\"', '\\', '\n', '\013', 'N', 'a', 'm', 'e', 'M',
+'a', 't', 'c', 'h', 'e', 'r', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022',
+'\024', '\n', '\005', 'n', 'a', 'm', 'e', 's', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\005', 'n', 'a', 'm', 'e', 's', '\022', '%', '\n', '\016',
+'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\r', 'r', 'e', 'q',
+'u', 'i', 'r', 'e', 'd', 'M', 'a', 't', 'c', 'h', '\"', '\360', '\003', '\n', '\016', 'G', 'r', 'p', 'c', 'K', 'e', 'y', 'B', 'u', 'i',
+'l', 'd', 'e', 'r', '\022', '9', '\n', '\005', 'n', 'a', 'm', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '#', '.', 'g', 'r', 'p',
+'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'G', 'r', 'p', 'c', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e',
+'r', '.', 'N', 'a', 'm', 'e', 'R', '\005', 'n', 'a', 'm', 'e', 's', '\022', 'G', '\n', '\n', 'e', 'x', 't', 'r', 'a', '_', 'k', 'e',
+'y', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '(', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1',
+'.', 'G', 'r', 'p', 'c', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'E', 'x', 't', 'r', 'a', 'K', 'e', 'y', 's',
+'R', '\t', 'e', 'x', 't', 'r', 'a', 'K', 'e', 'y', 's', '\022', '5', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\002', ' ',
+'\003', '(', '\013', '2', '\033', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'N', 'a', 'm', 'e',
+'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'U', '\n', '\r', 'c', 'o', 'n', 's', 't',
+'a', 'n', 't', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '0', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o',
+'k', 'u', 'p', '.', 'v', '1', '.', 'G', 'r', 'p', 'c', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'C', 'o', 'n',
+'s', 't', 'a', 'n', 't', 'K', 'e', 'y', 's', 'E', 'n', 't', 'r', 'y', 'R', '\014', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', 'K',
+'e', 'y', 's', '\032', '8', '\n', '\004', 'N', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'R', '\007', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '\026', '\n', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\030', '\002', ' ',
+'\001', '(', '\t', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\032', 'Q', '\n', '\t', 'E', 'x', 't', 'r', 'a', 'K', 'e', 'y', 's', '\022',
+'\022', '\n', '\004', 'h', 'o', 's', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'h', 'o', 's', 't', '\022', '\030', '\n', '\007', 's', 'e',
+'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '\026', '\n', '\006', 'm',
+'e', 't', 'h', 'o', 'd', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\032', '?', '\n', '\021', 'C', 'o',
+'n', 's', 't', 'a', 'n', 't', 'K', 'e', 'y', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ',
+'\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005',
+'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', '\361', '\002', '\n', '\016', 'H', 't', 't', 'p', 'K', 'e', 'y', 'B', 'u', 'i', 'l',
+'d', 'e', 'r', '\022', '#', '\n', '\r', 'h', 'o', 's', 't', '_', 'p', 'a', 't', 't', 'e', 'r', 'n', 's', '\030', '\001', ' ', '\003', '(',
+'\t', 'R', '\014', 'h', 'o', 's', 't', 'P', 'a', 't', 't', 'e', 'r', 'n', 's', '\022', '#', '\n', '\r', 'p', 'a', 't', 'h', '_', 'p',
+'a', 't', 't', 'e', 'r', 'n', 's', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\014', 'p', 'a', 't', 'h', 'P', 'a', 't', 't', 'e', 'r',
+'n', 's', '\022', 'F', '\n', '\020', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\030', '\003', ' ',
+'\003', '(', '\013', '2', '\033', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'N', 'a', 'm', 'e',
+'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\017', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022',
+'5', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '\033', '.', 'g', 'r', 'p', 'c', '.', 'l',
+'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h', 'e', 'a',
+'d', 'e', 'r', 's', '\022', 'U', '\n', '\r', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', '_', 'k', 'e', 'y', 's', '\030', '\005', ' ', '\003',
+'(', '\013', '2', '0', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'H', 't', 't', 'p', 'K',
+'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'C', 'o', 'n', 's', 't', 'a', 'n', 't', 'K', 'e', 'y', 's', 'E', 'n', 't',
+'r', 'y', 'R', '\014', 'c', 'o', 'n', 's', 't', 'a', 'n', 't', 'K', 'e', 'y', 's', '\032', '?', '\n', '\021', 'C', 'o', 'n', 's', 't',
+'a', 'n', 't', 'K', 'e', 'y', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l',
+'u', 'e', ':', '\002', '8', '\001', '\"', '\246', '\004', '\n', '\021', 'R', 'o', 'u', 't', 'e', 'L', 'o', 'o', 'k', 'u', 'p', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', 'I', '\n', '\020', 'h', 't', 't', 'p', '_', 'k', 'e', 'y', 'b', 'u', 'i', 'l', 'd', 'e', 'r', 's', '\030', '\001',
+' ', '\003', '(', '\013', '2', '\036', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'H', 't', 't',
+'p', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'R', '\017', 'h', 't', 't', 'p', 'K', 'e', 'y', 'b', 'u', 'i', 'l', 'd',
+'e', 'r', 's', '\022', 'I', '\n', '\020', 'g', 'r', 'p', 'c', '_', 'k', 'e', 'y', 'b', 'u', 'i', 'l', 'd', 'e', 'r', 's', '\030', '\002',
+' ', '\003', '(', '\013', '2', '\036', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'G', 'r', 'p',
+'c', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'R', '\017', 'g', 'r', 'p', 'c', 'K', 'e', 'y', 'b', 'u', 'i', 'l', 'd',
+'e', 'r', 's', '\022', '%', '\n', '\016', 'l', 'o', 'o', 'k', 'u', 'p', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\003', ' ', '\001',
+'(', '\t', 'R', '\r', 'l', 'o', 'o', 'k', 'u', 'p', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'O', '\n', '\026', 'l', 'o', 'o', 'k',
+'u', 'p', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\024', 'l', 'o', 'o', 'k', 'u', 'p', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '2',
+'\n', '\007', 'm', 'a', 'x', '_', 'a', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\006', 'm', 'a', 'x', 'A', 'g', 'e',
+'\022', '6', '\n', '\t', 's', 't', 'a', 'l', 'e', '_', 'a', 'g', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's', 't',
+'a', 'l', 'e', 'A', 'g', 'e', '\022', '(', '\n', '\020', 'c', 'a', 'c', 'h', 'e', '_', 's', 'i', 'z', 'e', '_', 'b', 'y', 't', 'e',
+'s', '\030', '\007', ' ', '\001', '(', '\003', 'R', '\016', 'c', 'a', 'c', 'h', 'e', 'S', 'i', 'z', 'e', 'B', 'y', 't', 'e', 's', '\022', '#',
+'\n', '\r', 'v', 'a', 'l', 'i', 'd', '_', 't', 'a', 'r', 'g', 'e', 't', 's', '\030', '\010', ' ', '\003', '(', '\t', 'R', '\014', 'v', 'a',
+'l', 'i', 'd', 'T', 'a', 'r', 'g', 'e', 't', 's', '\022', '%', '\n', '\016', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 't', 'a', 'r',
+'g', 'e', 't', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'T', 'a', 'r', 'g', 'e', 't', 'J',
+'\004', '\010', '\n', '\020', '\013', 'R', '\033', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'p', 'r', 'o', 'c', 'e', 's', 's', 'i', 'n', 'g',
+'_', 's', 't', 'r', 'a', 't', 'e', 'g', 'y', '\"', 'p', '\n', '\033', 'R', 'o', 'u', 't', 'e', 'L', 'o', 'o', 'k', 'u', 'p', 'C',
+'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', 'Q', '\n', '\023', 'r', 'o', 'u', 't', 'e', '_',
+'l', 'o', 'o', 'k', 'u', 'p', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'g', 'r', 'p',
+'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', '.', 'R', 'o', 'u', 't', 'e', 'L', 'o', 'o', 'k', 'u', 'p', 'C', 'o',
+'n', 'f', 'i', 'g', 'R', '\021', 'r', 'o', 'u', 't', 'e', 'L', 'o', 'o', 'k', 'u', 'p', 'C', 'o', 'n', 'f', 'i', 'g', 'B', 'S',
+'\n', '\021', 'i', 'o', '.', 'g', 'r', 'p', 'c', '.', 'l', 'o', 'o', 'k', 'u', 'p', '.', 'v', '1', 'B', '\016', 'R', 'l', 's', 'C',
+'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ',', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a',
+'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'r', 'p', 'c', '/', 'l', 'o', 'o', 'k', 'u', 'p', '/', 'g', 'r', 'p', 'c', '_', 'l',
+'o', 'o', 'k', 'u', 'p', '_', 'v', '1', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_duration_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit = {
+ deps,
+ &src_proto_grpc_lookup_v1_rls_config_proto_upb_file_layout,
+ "src/proto/grpc/lookup/v1/rls_config.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 1816)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h
new file mode 100644
index 00000000..3a7591fa
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h
@@ -0,0 +1,75 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_
+#define SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_NameMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.NameMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_GrpcKeyBuilder_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.GrpcKeyBuilder");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_GrpcKeyBuilder_Name_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.GrpcKeyBuilder.Name");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.GrpcKeyBuilder.ExtraKeys");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.GrpcKeyBuilder.ConstantKeysEntry");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_HttpKeyBuilder_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.HttpKeyBuilder");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.HttpKeyBuilder.ConstantKeysEntry");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_RouteLookupConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.RouteLookupConfig");
+}
+
+UPB_INLINE const upb_MessageDef *grpc_lookup_v1_RouteLookupClusterSpecifier_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &src_proto_grpc_lookup_v1_rls_config_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "grpc.lookup.v1.RouteLookupClusterSpecifier");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.c
deleted file mode 100644
index 2d8e43b7..00000000
--- a/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * third_party/istio/security/proto/providers/google/meshca.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "third_party/istio/security/proto/providers/google/meshca.upbdefs.h"
-
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern const upb_msglayout google_security_meshca_v1_MeshCertificateRequest_msginit;
-extern const upb_msglayout google_security_meshca_v1_MeshCertificateResponse_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &google_security_meshca_v1_MeshCertificateRequest_msginit,
- &google_security_meshca_v1_MeshCertificateResponse_msginit,
-};
-
-static const char descriptor[521] = {'\n', '>', 't', 'h', 'i', 'r', 'd', '_', 'p', 'a', 'r', 't', 'y', '/', 'i', 's', 't', 'i', 'o', '/', 's', 'e', 'c', 'u', 'r',
-'i', 't', 'y', '/', 'p', 'r', 'o', 't', 'o', '/', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 's', '/', 'g', 'o', 'o', 'g', 'l',
-'e', '/', 'm', 'e', 's', 'h', 'c', 'a', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '.', 's', 'e',
-'c', 'u', 'r', 'i', 't', 'y', '.', 'm', 'e', 's', 'h', 'c', 'a', '.', 'v', '1', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\"', '\200',
-'\001', '\n', '\026', 'M', 'e', 's', 'h', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't',
-'\022', '\035', '\n', '\n', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\t', 'r', 'e', 'q',
-'u', 'e', 's', 't', 'I', 'd', '\022', '\020', '\n', '\003', 'c', 's', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\003', 'c', 's', 'r', '\022',
-'5', '\n', '\010', 'v', 'a', 'l', 'i', 'd', 'i', 't', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'v', 'a', 'l', 'i',
-'d', 'i', 't', 'y', '\"', '8', '\n', '\027', 'M', 'e', 's', 'h', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', 'e',
-'s', 'p', 'o', 'n', 's', 'e', '\022', '\035', '\n', '\n', 'c', 'e', 'r', 't', '_', 'c', 'h', 'a', 'i', 'n', '\030', '\001', ' ', '\003', '(',
-'\t', 'R', '\t', 'c', 'e', 'r', 't', 'C', 'h', 'a', 'i', 'n', '2', '\226', '\001', '\n', '\026', 'M', 'e', 's', 'h', 'C', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', '|', '\n', '\021', 'C', 'r', 'e', 'a', 't', 'e', 'C',
-'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', '1', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 's', 'e', 'c', 'u', 'r',
-'i', 't', 'y', '.', 'm', 'e', 's', 'h', 'c', 'a', '.', 'v', '1', '.', 'M', 'e', 's', 'h', 'C', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '2', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 's', 'e', 'c', 'u',
-'r', 'i', 't', 'y', '.', 'm', 'e', 's', 'h', 'c', 'a', '.', 'v', '1', '.', 'M', 'e', 's', 'h', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', 'B', '.', '\n', '\035', 'c', 'o', 'm', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'm', 'e', 's', 'h', 'c', 'a', '.', 'v', '1', 'B', '\013',
-'M', 'e', 's', 'h', 'C', 'a', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[2] = {
- &google_protobuf_duration_proto_upbdefinit,
- NULL
-};
-
-upb_def_init third_party_istio_security_proto_providers_google_meshca_proto_upbdefinit = {
- deps,
- layouts,
- "third_party/istio/security/proto/providers/google/meshca.proto",
- UPB_STRVIEW_INIT(descriptor, 521)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.h
deleted file mode 100644
index 55362eac..00000000
--- a/grpc/src/core/ext/upbdefs-generated/third_party/istio/security/proto/providers/google/meshca.upbdefs.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * third_party/istio/security/proto/providers/google/meshca.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPBDEFS_H_
-#define THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init third_party_istio_security_proto_providers_google_meshca_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *google_security_meshca_v1_MeshCertificateRequest_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &third_party_istio_security_proto_providers_google_meshca_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.security.meshca.v1.MeshCertificateRequest");
-}
-
-UPB_INLINE const upb_msgdef *google_security_meshca_v1_MeshCertificateResponse_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &third_party_istio_security_proto_providers_google_meshca_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "google.security.meshca.v1.MeshCertificateResponse");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* THIRD_PARTY_ISTIO_SECURITY_PROTO_PROVIDERS_GOOGLE_MESHCA_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
index 6cfd7ee4..5d127acf 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
@@ -8,19 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/migrate.upbdefs.h"
+#include "udpa/annotations/migrate.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &udpa_annotations_MigrateAnnotation_msginit,
- &udpa_annotations_FieldMigrateAnnotation_msginit,
- &udpa_annotations_FileMigrateAnnotation_msginit,
-};
-
-static const char descriptor[855] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[893] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't',
'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
'\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '+', '\n', '\021', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't',
@@ -53,18 +44,19 @@ static const char descriptor[855] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a',
'r', 'a', 't', 'e', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i',
'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\216', '\343', '\377', 'Q', ' ', '\001', '(', '\013', '2', '\'', '.', 'u', 'd', 'p', 'a',
'.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'b', '\006', 'p',
-'r', 'o', 't', 'o', '3',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'B', '$', 'Z',
+'\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init udpa_annotations_migrate_proto_upbdefinit = {
+_upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_migrate_proto_upb_file_layout,
"udpa/annotations/migrate.proto",
- UPB_STRVIEW_INIT(descriptor, 855)
+ UPB_STRINGVIEW_INIT(descriptor, 893)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h
index a12d772f..a929d1ae 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h
@@ -19,21 +19,21 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_migrate_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *udpa_annotations_MigrateAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_migrate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.MigrateAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_MigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.MigrateAnnotation");
}
-UPB_INLINE const upb_msgdef *udpa_annotations_FieldMigrateAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_migrate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.FieldMigrateAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_FieldMigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.FieldMigrateAnnotation");
}
-UPB_INLINE const upb_msgdef *udpa_annotations_FileMigrateAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_migrate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.FileMigrateAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_FileMigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.FileMigrateAnnotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
index 6616936e..d65650e0 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
@@ -8,49 +8,40 @@
#include "upb/def.h"
#include "udpa/annotations/security.upbdefs.h"
+#include "udpa/annotations/security.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_FieldSecurityAnnotation_msginit,
-};
-
-static const char descriptor[469] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i',
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[453] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i',
't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
's', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
-'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
-'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\001', '\n', '\027', 'F', 'i',
-'e', 'l', 'd', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', 'K', '\n', '\"',
-'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'd',
-'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\022', 'G',
-'\n', ' ', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd',
-'_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\035', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', ':', 'g', '\n', '\010',
-'s', 'e', 'c', 'u', 'r', 'i', 't', 'y', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\261', '\362', '\246', '\005', ' ', '\001', '(', '\013', '2', ')',
-'.', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'e', 'l', 'd', 'S', 'e',
-'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's', 'e', 'c', 'u', 'r', 'i', 't',
-'y', 'B', '\010', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'d', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\001', '\n', '\027', 'F', 'i', 'e', 'l',
+'d', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', 'K', '\n', '\"', 'c', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'd', 'o', 'w',
+'n', 's', 't', 'r', 'e', 'a', 'm', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', 'F',
+'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\022', 'G', '\n', ' ',
+'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'u',
+'p', 's', 't', 'r', 'e', 'a', 'm', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\035', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', 'F',
+'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', ':', 'g', '\n', '\010', 's', 'e',
+'c', 'u', 'r', 'i', 't', 'y', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\261', '\362', '\246', '\005', ' ', '\001', '(', '\013', '2', ')', '.', 'u',
+'d', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'e', 'l', 'd', 'S', 'e', 'c', 'u',
+'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'B',
+',', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[3] = {
&udpa_annotations_status_proto_upbdefinit,
- &google_protobuf_any_proto_upbdefinit,
&google_protobuf_descriptor_proto_upbdefinit,
- &validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init udpa_annotations_security_proto_upbdefinit = {
+_upb_DefPool_Init udpa_annotations_security_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_security_proto_upb_file_layout,
"udpa/annotations/security.proto",
- UPB_STRVIEW_INIT(descriptor, 469)
+ UPB_STRINGVIEW_INIT(descriptor, 453)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h
index c5cc8fec..018e42a8 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init udpa_annotations_security_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_security_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *udpa_annotations_FieldSecurityAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_security_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.FieldSecurityAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_FieldSecurityAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_security_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.FieldSecurityAnnotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
index 4e6416b2..ddad6c8f 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
@@ -8,26 +8,27 @@
#include "upb/def.h"
#include "udpa/annotations/sensitive.upbdefs.h"
+#include "udpa/annotations/sensitive.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
-static const char descriptor[158] = {'\n', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[196] = {'\n', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't',
'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r',
'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', ':', '>', '\n', '\t', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '\022',
'\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p',
't', 'i', 'o', 'n', 's', '\030', '\367', '\266', '\301', '$', ' ', '\001', '(', '\010', 'R', '\t', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'B', '$', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g',
+'o', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init udpa_annotations_sensitive_proto_upbdefinit = {
+_upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit = {
deps,
- NULL,
+ &udpa_annotations_sensitive_proto_upb_file_layout,
"udpa/annotations/sensitive.proto",
- UPB_STRVIEW_INIT(descriptor, 158)
+ UPB_STRINGVIEW_INIT(descriptor, 196)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h
index 099a5782..596979eb 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h
@@ -19,7 +19,7 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_sensitive_proto_upbdefinit;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
index f130145d..882e46d3 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/status.upbdefs.h"
+#include "udpa/annotations/status.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_StatusAnnotation_msginit,
-};
-
-static const char descriptor[445] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[483] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
'.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\032',
' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't',
'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '\232', '\001', '\n', '\020', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a',
@@ -33,17 +28,19 @@ static const char descriptor[445] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a',
'\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p',
't', 'i', 'o', 'n', 's', '\030', '\207', '\200', '\231', 'j', ' ', '\001', '(', '\013', '2', '\"', '.', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n',
'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'B', '$', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init udpa_annotations_status_proto_upbdefinit = {
+_upb_DefPool_Init udpa_annotations_status_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_status_proto_upb_file_layout,
"udpa/annotations/status.proto",
- UPB_STRVIEW_INIT(descriptor, 445)
+ UPB_STRINGVIEW_INIT(descriptor, 483)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h
index 80f165f2..7857d080 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *udpa_annotations_StatusAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_status_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.StatusAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_StatusAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.StatusAnnotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
index b6de8fb0..153b3cf1 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/versioning.upbdefs.h"
+#include "udpa/annotations/versioning.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_VersioningAnnotation_msginit,
-};
-
-static const char descriptor[279] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[317] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', 'J', '\n', '\024', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
@@ -26,18 +21,19 @@ static const char descriptor[279] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n
'n', 'g', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's',
'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\323', '\210', '\341', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'u', 'd', 'p',
'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'A',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'B', '$', 'Z', '\"',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
+static _upb_DefPool_Init *deps[2] = {
&google_protobuf_descriptor_proto_upbdefinit,
NULL
};
-upb_def_init udpa_annotations_versioning_proto_upbdefinit = {
+_upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_versioning_proto_upb_file_layout,
"udpa/annotations/versioning.proto",
- UPB_STRVIEW_INIT(descriptor, 279)
+ UPB_STRINGVIEW_INIT(descriptor, 317)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h
index c354431b..53ffd45b 100644
--- a/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
+extern _upb_DefPool_Init udpa_annotations_versioning_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *udpa_annotations_VersioningAnnotation_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_annotations_versioning_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.annotations.VersioningAnnotation");
+UPB_INLINE const upb_MessageDef *udpa_annotations_VersioningAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &udpa_annotations_versioning_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "udpa.annotations.VersioningAnnotation");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.c
deleted file mode 100644
index 86f430ca..00000000
--- a/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "udpa/data/orca/v1/orca_load_report.upbdefs.h"
-
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &udpa_data_orca_v1_OrcaLoadReport_msginit,
- &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit,
- &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit,
-};
-
-static const char descriptor[674] = {'\n', '(', 'u', 'd', 'p', 'a', '/', 'd', 'a', 't', 'a', '/', 'o', 'r', 'c', 'a', '/', 'v', '1', '/', 'o', 'r', 'c', 'a', '_',
-'l', 'o', 'a', 'd', '_', 'r', 'e', 'p', 'o', 'r', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\021', 'u', 'd', 'p', 'a', '.', 'd',
-'a', 't', 'a', '.', 'o', 'r', 'c', 'a', '.', 'v', '1', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\205', '\004', '\n', '\016', 'O', 'r', 'c', 'a', 'L', 'o', 'a', 'd', 'R',
-'e', 'p', 'o', 'r', 't', '\022', 'E', '\n', '\017', 'c', 'p', 'u', '_', 'u', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', '\030',
-'\001', ' ', '\001', '(', '\001', 'B', '\034', '\372', 'B', '\013', '\022', '\t', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\372', 'B', '\013', '\022',
-'\t', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\016', 'c', 'p', 'u', 'U', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o',
-'n', '\022', 'E', '\n', '\017', 'm', 'e', 'm', '_', 'u', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(',
-'\001', 'B', '\034', '\372', 'B', '\013', '\022', '\t', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\372', 'B', '\013', '\022', '\t', '\031', '\000', '\000',
-'\000', '\000', '\000', '\000', '\360', '?', 'R', '\016', 'm', 'e', 'm', 'U', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', '\022', '\020', '\n',
-'\003', 'r', 'p', 's', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\003', 'r', 'p', 's', '\022', 'U', '\n', '\014', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '_', 'c', 'o', 's', 't', '\030', '\004', ' ', '\003', '(', '\013', '2', '2', '.', 'u', 'd', 'p', 'a', '.', 'd', 'a', 't', 'a', '.',
-'o', 'r', 'c', 'a', '.', 'v', '1', '.', 'O', 'r', 'c', 'a', 'L', 'o', 'a', 'd', 'R', 'e', 'p', 'o', 'r', 't', '.', 'R', 'e',
-'q', 'u', 'e', 's', 't', 'C', 'o', 's', 't', 'E', 'n', 't', 'r', 'y', 'R', '\013', 'r', 'e', 'q', 'u', 'e', 's', 't', 'C', 'o',
-'s', 't', '\022', '|', '\n', '\013', 'u', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', '\030', '\005', ' ', '\003', '(', '\013', '2', '2',
-'.', 'u', 'd', 'p', 'a', '.', 'd', 'a', 't', 'a', '.', 'o', 'r', 'c', 'a', '.', 'v', '1', '.', 'O', 'r', 'c', 'a', 'L', 'o',
-'a', 'd', 'R', 'e', 'p', 'o', 'r', 't', '.', 'U', 't', 'i', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
-'B', '&', '\372', 'B', '\020', '\232', '\001', '\r', '*', '\013', '\022', '\t', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\000', '\372', 'B', '\020', '\232',
-'\001', '\r', '*', '\013', '\022', '\t', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\013', 'u', 't', 'i', 'l', 'i', 'z', 'a', 't',
-'i', 'o', 'n', '\032', '>', '\n', '\020', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'o', 's', 't', 'E', 'n', 't', 'r', 'y', '\022', '\020',
-'\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e',
-'\030', '\002', ' ', '\001', '(', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\032', '>', '\n', '\020', 'U', 't', 'i', 'l',
-'i', 'z', 'a', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t',
-'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\001', 'R', '\005', 'v', 'a', 'l',
-'u', 'e', ':', '\002', '8', '\001', 'B', ':', '\n', '!', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a',
-'.', 'u', 'd', 'p', 'a', '.', 'd', 'a', 't', 'a', '.', 'o', 'r', 'c', 'a', '.', 'v', '1', 'B', '\023', 'O', 'r', 'c', 'a', 'L',
-'o', 'a', 'd', 'R', 'e', 'p', 'o', 'r', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
-};
-
-static upb_def_init *deps[2] = {
- &validate_validate_proto_upbdefinit,
- NULL
-};
-
-upb_def_init udpa_data_orca_v1_orca_load_report_proto_upbdefinit = {
- deps,
- layouts,
- "udpa/data/orca/v1/orca_load_report.proto",
- UPB_STRVIEW_INIT(descriptor, 674)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.h
deleted file mode 100644
index f923742c..00000000
--- a/grpc/src/core/ext/upbdefs-generated/udpa/data/orca/v1/orca_load_report.upbdefs.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPBDEFS_H_
-#define UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init udpa_data_orca_v1_orca_load_report_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *udpa_data_orca_v1_OrcaLoadReport_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_data_orca_v1_orca_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.data.orca.v1.OrcaLoadReport");
-}
-
-UPB_INLINE const upb_msgdef *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_data_orca_v1_orca_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry");
-}
-
-UPB_INLINE const upb_msgdef *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_data_orca_v1_orca_load_report_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
deleted file mode 100644
index f786bff3..00000000
--- a/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "udpa/type/v1/typed_struct.upbdefs.h"
-
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_type_v1_TypedStruct_msginit,
-};
-
-static const char descriptor[251] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 't', 'y', 'p', 'e', '/', 'v', '1', '/', 't', 'y', 'p', 'e', 'd', '_', 's', 't', 'r', 'u',
-'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\014', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', '\032', '\027', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g',
-'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o',
-'t', 'o', '\"', 'W', '\n', '\013', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e',
-'_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '-', '\n', '\005', 'v', 'a',
-'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'B', '2', '\n', '\034', 'c', 'o', 'm', '.', 'g',
-'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', 'B', '\020',
-'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
-};
-
-static upb_def_init *deps[3] = {
- &validate_validate_proto_upbdefinit,
- &google_protobuf_struct_proto_upbdefinit,
- NULL
-};
-
-upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit = {
- deps,
- layouts,
- "udpa/type/v1/typed_struct.proto",
- UPB_STRVIEW_INIT(descriptor, 251)
-};
diff --git a/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
deleted file mode 100644
index d30baef2..00000000
--- a/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
-#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *udpa_type_v1_TypedStruct_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_type_v1_typed_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.type.v1.TypedStruct");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
index dc751fa6..77b91818 100644
--- a/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
@@ -8,61 +8,12 @@
#include "upb/def.h"
#include "validate/validate.upbdefs.h"
+#include "validate/validate.upb.h"
-extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern upb_def_init google_protobuf_duration_proto_upbdefinit;
-extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
-extern const upb_msglayout validate_FieldRules_msginit;
-extern const upb_msglayout validate_FloatRules_msginit;
-extern const upb_msglayout validate_DoubleRules_msginit;
-extern const upb_msglayout validate_Int32Rules_msginit;
-extern const upb_msglayout validate_Int64Rules_msginit;
-extern const upb_msglayout validate_UInt32Rules_msginit;
-extern const upb_msglayout validate_UInt64Rules_msginit;
-extern const upb_msglayout validate_SInt32Rules_msginit;
-extern const upb_msglayout validate_SInt64Rules_msginit;
-extern const upb_msglayout validate_Fixed32Rules_msginit;
-extern const upb_msglayout validate_Fixed64Rules_msginit;
-extern const upb_msglayout validate_SFixed32Rules_msginit;
-extern const upb_msglayout validate_SFixed64Rules_msginit;
-extern const upb_msglayout validate_BoolRules_msginit;
-extern const upb_msglayout validate_StringRules_msginit;
-extern const upb_msglayout validate_BytesRules_msginit;
-extern const upb_msglayout validate_EnumRules_msginit;
-extern const upb_msglayout validate_MessageRules_msginit;
-extern const upb_msglayout validate_RepeatedRules_msginit;
-extern const upb_msglayout validate_MapRules_msginit;
-extern const upb_msglayout validate_AnyRules_msginit;
-extern const upb_msglayout validate_DurationRules_msginit;
-extern const upb_msglayout validate_TimestampRules_msginit;
-
-static const upb_msglayout *layouts[23] = {
- &validate_FieldRules_msginit,
- &validate_FloatRules_msginit,
- &validate_DoubleRules_msginit,
- &validate_Int32Rules_msginit,
- &validate_Int64Rules_msginit,
- &validate_UInt32Rules_msginit,
- &validate_UInt64Rules_msginit,
- &validate_SInt32Rules_msginit,
- &validate_SInt64Rules_msginit,
- &validate_Fixed32Rules_msginit,
- &validate_Fixed64Rules_msginit,
- &validate_SFixed32Rules_msginit,
- &validate_SFixed64Rules_msginit,
- &validate_BoolRules_msginit,
- &validate_StringRules_msginit,
- &validate_BytesRules_msginit,
- &validate_EnumRules_msginit,
- &validate_MessageRules_msginit,
- &validate_RepeatedRules_msginit,
- &validate_MapRules_msginit,
- &validate_AnyRules_msginit,
- &validate_DurationRules_msginit,
- &validate_TimestampRules_msginit,
-};
-
-static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_timestamp_proto_upbdefinit;
+static const char descriptor[6319] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
'\022', '\010', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g',
'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
@@ -111,131 +62,152 @@ static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a'
'R', 'u', 'l', 'e', 's', 'H', '\000', 'R', '\010', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '8', '\n', '\t', 't', 'i', 'm', 'e',
's', 't', 'a', 'm', 'p', '\030', '\026', ' ', '\001', '(', '\013', '2', '\030', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'T', 'i',
'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l', 'e', 's', 'H', '\000', 'R', '\t', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
-'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', '\"', '\215', '\001', '\n', '\n', 'F', 'l', 'o', 'a', 't', 'R', 'u', 'l', 'e', 's', '\022', '\024',
+'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', '\"', '\260', '\001', '\n', '\n', 'F', 'l', 'o', 'a', 't', 'R', 'u', 'l', 'e', 's', '\022', '\024',
'\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\002', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l',
't', '\030', '\002', ' ', '\001', '(', '\002', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\002', 'R',
'\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\002', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g',
't', 'e', '\030', '\005', ' ', '\001', '(', '\002', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\002',
'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\002', 'R', '\005', 'n', 'o', 't',
-'I', 'n', '\"', '\216', '\001', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
-'s', 't', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001',
-'(', '\001', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\001', 'R', '\003', 'l', 't', 'e', '\022',
-'\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\001', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ',
-'\001', '(', '\001', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\001', 'R', '\002', 'i', 'n', '\022',
-'\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\001', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\215', '\001',
-'\n', '\n', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001',
-'(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\002', 'l', 't',
-'\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030',
-'\004', ' ', '\001', '(', '\005', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\005', 'R', '\003', 'g',
-'t', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't',
-'_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\215', '\001', '\n', '\n', 'I', 'n', 't', '6',
-'4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\003', 'R', '\005', 'c', 'o',
-'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\003', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't',
-'e', '\030', '\003', ' ', '\001', '(', '\003', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\003', 'R',
-'\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002',
-'i', 'n', '\030', '\006', ' ', '\003', '(', '\003', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ',
-'\003', '(', '\003', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013', 'U', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e',
-'s', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\r', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016',
-'\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001',
-'(', '\r', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\r', 'R', '\002', 'g', 't', '\022', '\020',
-'\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\r', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ',
-'\003', '(', '\r', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\r', 'R', '\005',
-'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013', 'U', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005',
+'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R',
+'\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'u',
+'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\005', 'c', 'o', 'n', 's', 't',
+'\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\001', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003',
+' ', '\001', '(', '\001', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\001', 'R', '\002', 'g', 't',
+'\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\001', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030',
+'\006', ' ', '\003', '(', '\001', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\001',
+'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010',
+' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\260', '\001', '\n', '\n', 'I', 'n', 't',
+'3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 'c',
+'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
+'t', 'e', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\005',
+'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\005', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
+'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
+' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p',
+'t', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\260', '\001', '\n',
+'\n', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(',
+'\003', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\003', 'R', '\002', 'l', 't', '\022',
+'\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\003', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004',
+' ', '\001', '(', '\003', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\003', 'g', 't',
+'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\003', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_',
+'i', 'n', '\030', '\007', ' ', '\003', '(', '\003', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e',
+'_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y',
+'\"', '\261', '\001', '\n', '\013', 'U', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't',
+'\030', '\001', ' ', '\001', '(', '\r', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\r',
+'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\r', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n',
+'\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\r', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(',
+'\r', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\r', 'R', '\002', 'i', 'n', '\022', '\025', '\n',
+'\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\r', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i',
+'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e',
+'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'U', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005',
'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030',
'\002', ' ', '\001', '(', '\004', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\003', 'l',
't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e',
'\030', '\005', ' ', '\001', '(', '\004', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\004', 'R', '\002',
'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\004', 'R', '\005', 'n', 'o', 't', 'I', 'n',
-'\"', '\216', '\001', '\n', '\013', 'S', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't',
-'\030', '\001', ' ', '\001', '(', '\021', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\021',
-'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\021', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n',
-'\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\021', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(',
-'\021', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\021', 'R', '\002', 'i', 'n', '\022', '\025', '\n',
-'\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\021', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013',
-'S', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(',
-'\022', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\022', 'R', '\002', 'l', 't', '\022',
-'\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\022', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004',
-' ', '\001', '(', '\022', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\022', 'R', '\003', 'g', 't',
-'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\022', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_',
-'i', 'n', '\030', '\007', ' ', '\003', '(', '\022', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\217', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd',
-'3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\007', 'R', '\005', 'c',
-'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\007', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
-'t', 'e', '\030', '\003', ' ', '\001', '(', '\007', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\007',
-'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\007', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
-'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\007', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
-' ', '\003', '(', '\007', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\217', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u',
-'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\006', 'R', '\005', 'c', 'o', 'n', 's', 't',
-'\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\006', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003',
-' ', '\001', '(', '\006', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\006', 'R', '\002', 'g', 't',
-'\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\006', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030',
-'\006', ' ', '\003', '(', '\006', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\006',
-'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\220', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's',
+'\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i',
+'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'S', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e',
+'s', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\021', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016',
+'\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\021', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001',
+'(', '\021', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\021', 'R', '\002', 'g', 't', '\022', '\020',
+'\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\021', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ',
+'\003', '(', '\021', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\021', 'R', '\005',
+'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001',
+'(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'S', 'I', 'n', 't', '6',
+'4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\022', 'R', '\005', 'c', 'o',
+'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\022', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't',
+'e', '\030', '\003', ' ', '\001', '(', '\022', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\022', 'R',
+'\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\022', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002',
+'i', 'n', '\030', '\006', ' ', '\003', '(', '\022', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ',
+'\003', '(', '\022', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't',
+'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\262', '\001', '\n', '\014',
+'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001',
+'(', '\007', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\007', 'R', '\002', 'l', 't',
+'\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\007', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030',
+'\004', ' ', '\001', '(', '\007', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\007', 'R', '\003', 'g',
+'t', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\007', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't',
+'_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\007', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't',
+'y', '\"', '\262', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
+'s', 't', '\030', '\001', ' ', '\001', '(', '\006', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001',
+'(', '\006', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\006', 'R', '\003', 'l', 't', 'e', '\022',
+'\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\006', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ',
+'\001', '(', '\006', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\006', 'R', '\002', 'i', 'n', '\022',
+'\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\006', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n',
+'\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o',
+'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\263', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's',
'\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\017', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n',
'\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\017', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(',
'\017', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\017', 'R', '\002', 'g', 't', '\022', '\020', '\n',
'\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\017', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003',
'(', '\017', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\017', 'R', '\005', 'n',
-'o', 't', 'I', 'n', '\"', '\220', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n',
-'\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\020', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't',
-'\030', '\002', ' ', '\001', '(', '\020', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\020', 'R', '\003',
-'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\020', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't',
-'e', '\030', '\005', ' ', '\001', '(', '\020', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\020', 'R',
-'\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\020', 'R', '\005', 'n', 'o', 't', 'I',
-'n', '\"', '!', '\n', '\t', 'B', 'o', 'o', 'l', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001',
-' ', '\001', '(', '\010', 'R', '\005', 'c', 'o', 'n', 's', 't', '\"', '\261', '\005', '\n', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'R', 'u', 'l',
-'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022',
-'\020', '\n', '\003', 'l', 'e', 'n', '\030', '\023', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_',
-'l', 'e', 'n', '\030', '\002', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_',
-'l', 'e', 'n', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\033', '\n', '\t', 'l', 'e', 'n', '_',
-'b', 'y', 't', 'e', 's', '\030', '\024', ' ', '\001', '(', '\004', 'R', '\010', 'l', 'e', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t',
-'m', 'i', 'n', '_', 'b', 'y', 't', 'e', 's', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'B', 'y', 't', 'e', 's',
-'\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'B',
-'y', 't', 'e', 's', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a',
-'t', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\006', 'p', 'r',
-'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\006', 's', 'u', 'f',
-'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'o',
-'n', 't', 'a', 'i', 'n', 's', '\022', '!', '\n', '\014', 'n', 'o', 't', '_', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\027', ' ',
-'\001', '(', '\t', 'R', '\013', 'n', 'o', 't', 'C', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\n', ' ',
-'\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\005',
-'n', 'o', 't', 'I', 'n', '\022', '\026', '\n', '\005', 'e', 'm', 'a', 'i', 'l', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\005', 'e',
-'m', 'a', 'i', 'l', '\022', '\034', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\r', ' ', '\001', '(', '\010', 'H', '\000', 'R',
-'\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\016', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002',
-'i', 'p', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '4', '\030', '\017', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022',
-'\024', '\n', '\004', 'i', 'p', 'v', '6', '\030', '\020', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '\022', '\n', '\003',
-'u', 'r', 'i', '\030', '\021', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\003', 'u', 'r', 'i', '\022', '\031', '\n', '\007', 'u', 'r', 'i', '_', 'r',
-'e', 'f', '\030', '\022', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\006', 'u', 'r', 'i', 'R', 'e', 'f', '\022', '\032', '\n', '\007', 'a', 'd', 'd',
-'r', 'e', 's', 's', '\030', '\025', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\024', '\n', '\004',
-'u', 'u', 'i', 'd', '\030', '\026', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'u', 'u', 'i', 'd', '\022', '@', '\n', '\020', 'w', 'e', 'l',
-'l', '_', 'k', 'n', 'o', 'w', 'n', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\030', ' ', '\001', '(', '\016', '2', '\024', '.', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', 'H', '\000', 'R', '\016', 'w', 'e', 'l', 'l', 'K',
-'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\034', '\n', '\006', 's', 't', 'r', 'i', 'c', 't', '\030', '\031', ' ', '\001', '(', '\010',
-':', '\004', 't', 'r', 'u', 'e', 'R', '\006', 's', 't', 'r', 'i', 'c', 't', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n',
-'o', 'w', 'n', '\"', '\277', '\002', '\n', '\n', 'B', 'y', 't', 'e', 's', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
-'s', 't', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l', 'e', 'n', '\030', '\r', ' ',
-'\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030', '\002', ' ', '\001', '(', '\004',
-'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030', '\003', ' ', '\001', '(', '\004',
-'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\004', ' ', '\001', '(', '\t',
-'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\005', ' ', '\001', '(', '\014',
-'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\006', ' ', '\001', '(', '\014', 'R',
-'\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\007', ' ', '\001', '(', '\014',
-'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\014', 'R', '\002', 'i',
-'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\t', ' ', '\003', '(', '\014', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022',
-'\020', '\n', '\002', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '4',
-'\030', '\013', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '6', '\030', '\014', ' ',
-'\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o', 'w', 'n',
-'\"', 'k', '\n', '\t', 'E', 'n', 'u', 'm', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ',
-'\001', '(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '!', '\n', '\014', 'd', 'e', 'f', 'i', 'n', 'e', 'd', '_', 'o', 'n', 'l',
-'y', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\013', 'd', 'e', 'f', 'i', 'n', 'e', 'd', 'O', 'n', 'l', 'y', '\022', '\016', '\n', '\002', 'i',
-'n', '\030', '\003', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\004', ' ', '\003',
-'(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '>', '\n', '\014', 'M', 'e', 's', 's', 'a', 'g', 'e', 'R', 'u', 'l', 'e', 's',
-'\022', '\022', '\n', '\004', 's', 'k', 'i', 'p', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\004', 's', 'k', 'i', 'p', '\022', '\032', '\n', '\010', 'r',
-'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\"', '\215',
-'\001', '\n', '\r', 'R', 'e', 'p', 'e', 'a', 't', 'e', 'd', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'i',
-'t', 'e', 'm', 's', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'I', 't', 'e', 'm', 's', '\022', '\033', '\n', '\t', 'm',
-'a', 'x', '_', 'i', 't', 'e', 'm', 's', '\030', '\002', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'I', 't', 'e', 'm', 's', '\022',
-'\026', '\n', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\022', '*',
-'\n', '\005', 'i', 't', 'e', 'm', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.',
-'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\005', 'i', 't', 'e', 'm', 's', '\"', '\271', '\001', '\n', '\010', 'M', 'a', 'p',
+'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(',
+'\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\263', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd',
+'6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\020', 'R', '\005', 'c',
+'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\020', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
+'t', 'e', '\030', '\003', ' ', '\001', '(', '\020', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\020',
+'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\020', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
+'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\020', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
+' ', '\003', '(', '\020', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p',
+'t', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '!', '\n', '\t',
+'B', 'o', 'o', 'l', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\010', 'R',
+'\005', 'c', 'o', 'n', 's', 't', '\"', '\324', '\005', '\n', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n',
+'\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l', 'e',
+'n', '\030', '\023', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030', '\002',
+' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030', '\003',
+' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\033', '\n', '\t', 'l', 'e', 'n', '_', 'b', 'y', 't', 'e', 's',
+'\030', '\024', ' ', '\001', '(', '\004', 'R', '\010', 'l', 'e', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'b',
+'y', 't', 'e', 's', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t', 'm',
+'a', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'B', 'y', 't', 'e', 's', '\022',
+'\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n',
+'\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022',
+'\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032',
+'\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n',
+'s', '\022', '!', '\n', '\014', 'n', 'o', 't', '_', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\027', ' ', '\001', '(', '\t', 'R', '\013',
+'n', 'o', 't', 'C', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\002',
+'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n',
+'\022', '\026', '\n', '\005', 'e', 'm', 'a', 'i', 'l', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\005', 'e', 'm', 'a', 'i', 'l', '\022',
+'\034', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\r', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\010', 'h', 'o', 's', 't',
+'n', 'a', 'm', 'e', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\016', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n',
+'\004', 'i', 'p', 'v', '4', '\030', '\017', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p',
+'v', '6', '\030', '\020', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '\022', '\n', '\003', 'u', 'r', 'i', '\030', '\021',
+' ', '\001', '(', '\010', 'H', '\000', 'R', '\003', 'u', 'r', 'i', '\022', '\031', '\n', '\007', 'u', 'r', 'i', '_', 'r', 'e', 'f', '\030', '\022', ' ',
+'\001', '(', '\010', 'H', '\000', 'R', '\006', 'u', 'r', 'i', 'R', 'e', 'f', '\022', '\032', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030',
+'\025', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\024', '\n', '\004', 'u', 'u', 'i', 'd', '\030',
+'\026', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'u', 'u', 'i', 'd', '\022', '@', '\n', '\020', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o',
+'w', 'n', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\030', ' ', '\001', '(', '\016', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', 'H', '\000', 'R', '\016', 'w', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'R',
+'e', 'g', 'e', 'x', '\022', '\034', '\n', '\006', 's', 't', 'r', 'i', 'c', 't', '\030', '\031', ' ', '\001', '(', '\010', ':', '\004', 't', 'r', 'u',
+'e', 'R', '\006', 's', 't', 'r', 'i', 'c', 't', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y',
+'\030', '\032', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', 'B', '\014', '\n', '\n', 'w', 'e',
+'l', 'l', '_', 'k', 'n', 'o', 'w', 'n', '\"', '\342', '\002', '\n', '\n', 'B', 'y', 't', 'e', 's', 'R', 'u', 'l', 'e', 's', '\022', '\024',
+'\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l',
+'e', 'n', '\030', '\r', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030',
+'\002', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030',
+'\003', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030',
+'\004', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030',
+'\005', ' ', '\001', '(', '\014', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\006',
+' ', '\001', '(', '\014', 'R', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030',
+'\007', ' ', '\001', '(', '\014', 'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\010', ' ', '\003',
+'(', '\014', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\t', ' ', '\003', '(', '\014', 'R', '\005', 'n',
+'o', 't', 'I', 'n', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n',
+'\004', 'i', 'p', 'v', '4', '\030', '\013', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p',
+'v', '6', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\016', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't',
+'y', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o', 'w', 'n', '\"', 'k', '\n', '\t', 'E', 'n', 'u', 'm', 'R', 'u',
+'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't',
+'\022', '!', '\n', '\014', 'd', 'e', 'f', 'i', 'n', 'e', 'd', '_', 'o', 'n', 'l', 'y', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\013', 'd',
+'e', 'f', 'i', 'n', 'e', 'd', 'O', 'n', 'l', 'y', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\003', ' ', '\003', '(', '\005', 'R', '\002', 'i',
+'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\004', ' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"',
+'>', '\n', '\014', 'M', 'e', 's', 's', 'a', 'g', 'e', 'R', 'u', 'l', 'e', 's', '\022', '\022', '\n', '\004', 's', 'k', 'i', 'p', '\030', '\001',
+' ', '\001', '(', '\010', 'R', '\004', 's', 'k', 'i', 'p', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\002', ' ',
+'\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\"', '\260', '\001', '\n', '\r', 'R', 'e', 'p', 'e', 'a', 't', 'e',
+'d', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'i', 't', 'e', 'm', 's', '\030', '\001', ' ', '\001', '(', '\004',
+'R', '\010', 'm', 'i', 'n', 'I', 't', 'e', 'm', 's', '\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'i', 't', 'e', 'm', 's', '\030', '\002',
+' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'I', 't', 'e', 'm', 's', '\022', '\026', '\n', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\030',
+'\003', ' ', '\001', '(', '\010', 'R', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\022', '*', '\n', '\005', 'i', 't', 'e', 'm', 's', '\030', '\004', ' ',
+'\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's',
+'R', '\005', 'i', 't', 'e', 'm', 's', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\005',
+' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\334', '\001', '\n', '\010', 'M', 'a', 'p',
'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'p', 'a', 'i', 'r', 's', '\030', '\001', ' ', '\001', '(', '\004', 'R',
'\010', 'm', 'i', 'n', 'P', 'a', 'i', 'r', 's', '\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'p', 'a', 'i', 'r', 's', '\030', '\002', ' ',
'\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'P', 'a', 'i', 'r', 's', '\022', '\033', '\n', '\t', 'n', 'o', '_', 's', 'p', 'a', 'r', 's',
@@ -243,68 +215,69 @@ static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a'
'\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u',
'l', 'e', 's', 'R', '\004', 'k', 'e', 'y', 's', '\022', ',', '\n', '\006', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013',
'2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\006', 'v',
-'a', 'l', 'u', 'e', 's', '\"', 'M', '\n', '\010', 'A', 'n', 'y', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u',
-'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '\016', '\n', '\002', 'i',
-'n', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\003', ' ', '\003',
-'(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\351', '\002', '\n', '\r', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', 'u', 'l',
+'a', 'l', 'u', 'e', 's', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\006', ' ', '\001',
+'(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', 'M', '\n', '\010', 'A', 'n', 'y', 'R', 'u', 'l',
+'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q',
+'u', 'i', 'r', 'e', 'd', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006',
+'n', 'o', 't', '_', 'i', 'n', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\351', '\002', '\n', '\r', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030',
+'\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '/', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', ')', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't',
+'i', 'o', 'n', 'R', '\002', 'l', 't', '\022', '+', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'l',
+'t', 'e', '\022', ')', '\n', '\002', 'g', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'g', 't', '\022', '+', '\n', '\003', 'g',
+'t', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'g', 't', 'e', '\022', ')', '\n', '\002', 'i', 'n', '\030', '\007', ' ', '\003',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'R', '\002', 'i', 'n', '\022', '0', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\363', '\002', '\n', '\016', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l',
'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q',
-'u', 'i', 'r', 'e', 'd', '\022', '/', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'c',
-'o', 'n', 's', 't', '\022', ')', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'l', 't', '\022', '+', '\n',
-'\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'l', 't', 'e', '\022', ')', '\n', '\002', 'g', 't', '\030', '\005',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'g', 't', '\022', '+', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'R', '\003', 'g', 't', 'e', '\022', ')', '\n', '\002', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'i', 'n', '\022', '0',
-'\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\363',
-'\002', '\n', '\016', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u',
-'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '0', '\n', '\005', 'c',
-'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '*', '\n', '\002', 'l',
-'t', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'l', 't', '\022', ',', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001',
+'u', 'i', 'r', 'e', 'd', '\022', '0', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\005',
+'c', 'o', 'n', 's', 't', '\022', '*', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'l', 't', '\022',
+',', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\003', 'l', 't', 'e', '\022', '*', '\n', '\002', 'g',
+'t', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'g', 't', '\022', ',', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001',
'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e',
-'s', 't', 'a', 'm', 'p', 'R', '\003', 'l', 't', 'e', '\022', '*', '\n', '\002', 'g', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
-'R', '\002', 'g', 't', '\022', ',', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\003', 'g', 't', 'e',
-'\022', '\025', '\n', '\006', 'l', 't', '_', 'n', 'o', 'w', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\005', 'l', 't', 'N', 'o', 'w', '\022', '\025',
-'\n', '\006', 'g', 't', '_', 'n', 'o', 'w', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\005', 'g', 't', 'N', 'o', 'w', '\022', '1', '\n', '\006',
-'w', 'i', 't', 'h', 'i', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\006', 'w', 'i', 't', 'h', 'i', 'n', '*', 'F', '\n',
-'\n', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022',
-'\024', '\n', '\020', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'N', 'A', 'M', 'E', '\020', '\001', '\022', '\025', '\n', '\021',
-'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'V', 'A', 'L', 'U', 'E', '\020', '\002', ':', '<', '\n', '\010', 'd', 'i',
-'s', 'a', 'b', 'l', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i',
-'s', 'a', 'b', 'l', 'e', 'd', ':', ':', '\n', '\007', 'i', 'g', 'n', 'o', 'r', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's',
-'\030', '\260', '\010', ' ', '\001', '(', '\010', 'R', '\007', 'i', 'g', 'n', 'o', 'r', 'e', 'd', ':', ':', '\n', '\010', 'r', 'e', 'q', 'u', 'i',
-'r', 'e', 'd', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e',
-'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e',
-'d', ':', 'J', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\013', '2', '\024',
-'.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\005', 'r', 'u', 'l',
-'e', 's', 'B', 'P', '\n', '\032', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'p', 'g', 'v', '.', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'e', 'Z', '2', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
-'p', 'r', 'o', 'x', 'y', '/', 'p', 'r', 'o', 't', 'o', 'c', '-', 'g', 'e', 'n', '-', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'s', 't', 'a', 'm', 'p', 'R', '\003', 'g', 't', 'e', '\022', '\025', '\n', '\006', 'l', 't', '_', 'n', 'o', 'w', '\030', '\007', ' ', '\001', '(',
+'\010', 'R', '\005', 'l', 't', 'N', 'o', 'w', '\022', '\025', '\n', '\006', 'g', 't', '_', 'n', 'o', 'w', '\030', '\010', ' ', '\001', '(', '\010', 'R',
+'\005', 'g', 't', 'N', 'o', 'w', '\022', '1', '\n', '\006', 'w', 'i', 't', 'h', 'i', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R',
+'\006', 'w', 'i', 't', 'h', 'i', 'n', '*', 'F', '\n', '\n', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\013', '\n', '\007',
+'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_',
+'N', 'A', 'M', 'E', '\020', '\001', '\022', '\025', '\n', '\021', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'V', 'A', 'L',
+'U', 'E', '\020', '\002', ':', '<', '\n', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030',
+'\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', ':', '\n', '\007', 'i', 'g', 'n', 'o', 'r',
+'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's',
+'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\260', '\010', ' ', '\001', '(', '\010', 'R', '\007', 'i', 'g', 'n', 'o', 'r', 'e',
+'d', ':', ':', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(',
+'\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', ':', 'J', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\022', '\035', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\030', '\257', '\010', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd',
+'R', 'u', 'l', 'e', 's', 'R', '\005', 'r', 'u', 'l', 'e', 's', 'B', 'P', '\n', '\032', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '.', 'p', 'g', 'v', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'Z', '2', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'p', 'r', 'o', 't', 'o', 'c', '-', 'g', 'e',
+'n', '-', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&google_protobuf_descriptor_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_timestamp_proto_upbdefinit,
NULL
};
-upb_def_init validate_validate_proto_upbdefinit = {
+_upb_DefPool_Init validate_validate_proto_upbdefinit = {
deps,
- layouts,
+ &validate_validate_proto_upb_file_layout,
"validate/validate.proto",
- UPB_STRVIEW_INIT(descriptor, 5759)
+ UPB_STRINGVIEW_INIT(descriptor, 6319)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h
index 2637121f..9889c2d3 100644
--- a/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h
@@ -19,121 +19,121 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init validate_validate_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *validate_FieldRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.FieldRules");
+UPB_INLINE const upb_MessageDef *validate_FieldRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.FieldRules");
}
-UPB_INLINE const upb_msgdef *validate_FloatRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.FloatRules");
+UPB_INLINE const upb_MessageDef *validate_FloatRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.FloatRules");
}
-UPB_INLINE const upb_msgdef *validate_DoubleRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.DoubleRules");
+UPB_INLINE const upb_MessageDef *validate_DoubleRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.DoubleRules");
}
-UPB_INLINE const upb_msgdef *validate_Int32Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.Int32Rules");
+UPB_INLINE const upb_MessageDef *validate_Int32Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.Int32Rules");
}
-UPB_INLINE const upb_msgdef *validate_Int64Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.Int64Rules");
+UPB_INLINE const upb_MessageDef *validate_Int64Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.Int64Rules");
}
-UPB_INLINE const upb_msgdef *validate_UInt32Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.UInt32Rules");
+UPB_INLINE const upb_MessageDef *validate_UInt32Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.UInt32Rules");
}
-UPB_INLINE const upb_msgdef *validate_UInt64Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.UInt64Rules");
+UPB_INLINE const upb_MessageDef *validate_UInt64Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.UInt64Rules");
}
-UPB_INLINE const upb_msgdef *validate_SInt32Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.SInt32Rules");
+UPB_INLINE const upb_MessageDef *validate_SInt32Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.SInt32Rules");
}
-UPB_INLINE const upb_msgdef *validate_SInt64Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.SInt64Rules");
+UPB_INLINE const upb_MessageDef *validate_SInt64Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.SInt64Rules");
}
-UPB_INLINE const upb_msgdef *validate_Fixed32Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.Fixed32Rules");
+UPB_INLINE const upb_MessageDef *validate_Fixed32Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.Fixed32Rules");
}
-UPB_INLINE const upb_msgdef *validate_Fixed64Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.Fixed64Rules");
+UPB_INLINE const upb_MessageDef *validate_Fixed64Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.Fixed64Rules");
}
-UPB_INLINE const upb_msgdef *validate_SFixed32Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.SFixed32Rules");
+UPB_INLINE const upb_MessageDef *validate_SFixed32Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.SFixed32Rules");
}
-UPB_INLINE const upb_msgdef *validate_SFixed64Rules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.SFixed64Rules");
+UPB_INLINE const upb_MessageDef *validate_SFixed64Rules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.SFixed64Rules");
}
-UPB_INLINE const upb_msgdef *validate_BoolRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.BoolRules");
+UPB_INLINE const upb_MessageDef *validate_BoolRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.BoolRules");
}
-UPB_INLINE const upb_msgdef *validate_StringRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.StringRules");
+UPB_INLINE const upb_MessageDef *validate_StringRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.StringRules");
}
-UPB_INLINE const upb_msgdef *validate_BytesRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.BytesRules");
+UPB_INLINE const upb_MessageDef *validate_BytesRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.BytesRules");
}
-UPB_INLINE const upb_msgdef *validate_EnumRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.EnumRules");
+UPB_INLINE const upb_MessageDef *validate_EnumRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.EnumRules");
}
-UPB_INLINE const upb_msgdef *validate_MessageRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.MessageRules");
+UPB_INLINE const upb_MessageDef *validate_MessageRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.MessageRules");
}
-UPB_INLINE const upb_msgdef *validate_RepeatedRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.RepeatedRules");
+UPB_INLINE const upb_MessageDef *validate_RepeatedRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.RepeatedRules");
}
-UPB_INLINE const upb_msgdef *validate_MapRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.MapRules");
+UPB_INLINE const upb_MessageDef *validate_MapRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.MapRules");
}
-UPB_INLINE const upb_msgdef *validate_AnyRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.AnyRules");
+UPB_INLINE const upb_MessageDef *validate_AnyRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.AnyRules");
}
-UPB_INLINE const upb_msgdef *validate_DurationRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.DurationRules");
+UPB_INLINE const upb_MessageDef *validate_DurationRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.DurationRules");
}
-UPB_INLINE const upb_msgdef *validate_TimestampRules_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &validate_validate_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "validate.TimestampRules");
+UPB_INLINE const upb_MessageDef *validate_TimestampRules_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &validate_validate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "validate.TimestampRules");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c
new file mode 100644
index 00000000..e5f99a77
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c
@@ -0,0 +1,63 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/migrate.upbdefs.h"
+#include "xds/annotations/v3/migrate.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[914] = {'\n', ' ', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 'm', 'i', 'g', 'r',
+'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '.', 'v', '3', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's',
+'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '+', '\n', '\021', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\006', 'r', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\006', 'r', 'e', 'n', 'a', 'm', 'e', '\"', 'Y', '\n', '\026', 'F', 'i', 'e', 'l', 'd', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\006', 'r', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\006', 'r', 'e', 'n', 'a', 'm', 'e', '\022', '\'', '\n', '\017', 'o', 'n', 'e', 'o', 'f', '_', 'p', 'r', 'o', 'm', 'o', 't', 'i',
+'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\016', 'o', 'n', 'e', 'o', 'f', 'P', 'r', 'o', 'm', 'o', 't', 'i', 'o', 'n', '\"',
+'?', '\n', '\025', 'F', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022',
+'&', '\n', '\017', 'm', 'o', 'v', 'e', '_', 't', 'o', '_', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
+'\r', 'm', 'o', 'v', 'e', 'T', 'o', 'P', 'a', 'c', 'k', 'a', 'g', 'e', ':', 'r', '\n', '\017', 'm', 'e', 's', 's', 'a', 'g', 'e',
+'_', 'm', 'i', 'g', 'r', 'a', 't', 'e', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\316', '\351', '\355', '5', ' ', '\001', '(', '\013',
+'2', '%', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'M', 'i', 'g',
+'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\016', 'm', 'e', 's', 's', 'a', 'g', 'e', 'M', 'i',
+'g', 'r', 'a', 't', 'e', ':', 'q', '\n', '\r', 'f', 'i', 'e', 'l', 'd', '_', 'm', 'i', 'g', 'r', 'a', 't', 'e', '\022', '\035', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i',
+'o', 'n', 's', '\030', '\316', '\351', '\355', '5', ' ', '\001', '(', '\013', '2', '*', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F', 'i', 'e', 'l', 'd', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 'R', '\014', 'f', 'i', 'e', 'l', 'd', 'M', 'i', 'g', 'r', 'a', 't', 'e', ':', 'i', '\n', '\014', 'e',
+'n', 'u', 'm', '_', 'm', 'i', 'g', 'r', 'a', 't', 'e', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\316', '\351', '\355', '5', ' ', '\001', '(', '\013',
+'2', '%', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'M', 'i', 'g',
+'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'e', 'n', 'u', 'm', 'M', 'i', 'g', 'r', 'a',
+'t', 'e', ':', 'y', '\n', '\022', 'e', 'n', 'u', 'm', '_', 'v', 'a', 'l', 'u', 'e', '_', 'm', 'i', 'g', 'r', 'a', 't', 'e', '\022',
+'!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l',
+'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\316', '\351', '\355', '5', ' ', '\001', '(', '\013', '2', '%', '.', 'x', 'd', 's', '.',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\020', 'e', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e',
+':', 'm', '\n', '\014', 'f', 'i', 'l', 'e', '_', 'm', 'i', 'g', 'r', 'a', 't', 'e', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\316', '\351', '\355',
+'5', ' ', '\001', '(', '\013', '2', ')', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v',
+'3', '.', 'F', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013',
+'f', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'B', '+', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_annotations_v3_migrate_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_migrate_proto_upb_file_layout,
+ "xds/annotations/v3/migrate.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 914)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h
new file mode 100644
index 00000000..67c1d40f
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h
@@ -0,0 +1,45 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/migrate.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_annotations_v3_migrate_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_MigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.MigrateAnnotation");
+}
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_FieldMigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.FieldMigrateAnnotation");
+}
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_FileMigrateAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_migrate_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.FileMigrateAnnotation");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_MIGRATE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c
new file mode 100644
index 00000000..d27375d4
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c
@@ -0,0 +1,47 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/security.upbdefs.h"
+#include "xds/annotations/v3/security.upb.h"
+
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[468] = {'\n', '!', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'u',
+'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
+'n', 's', '.', 'v', '3', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3',
+'/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\001',
+'\n', '\027', 'F', 'i', 'e', 'l', 'd', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'\022', 'K', '\n', '\"', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't',
+'e', 'd', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'o', 'n', 'f',
+'i', 'g', 'u', 'r', 'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e',
+'a', 'm', '\022', 'G', '\n', ' ', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u',
+'s', 't', 'e', 'd', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\035', 'c', 'o', 'n', 'f',
+'i', 'g', 'u', 'r', 'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm',
+':', 'i', '\n', '\010', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\247', '\226', '\235', '/', ' ', '\001',
+'(', '\013', '2', '+', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F',
+'i', 'e', 'l', 'd', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's',
+'e', 'c', 'u', 'r', 'i', 't', 'y', 'B', '3', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c',
+'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_annotations_v3_security_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_security_proto_upb_file_layout,
+ "xds/annotations/v3/security.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 468)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h
new file mode 100644
index 00000000..2eb3df50
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/security.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_annotations_v3_security_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_FieldSecurityAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_security_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.FieldSecurityAnnotation");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_SECURITY_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c
new file mode 100644
index 00000000..b4e39d05
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/sensitive.upbdefs.h"
+#include "xds/annotations/v3/sensitive.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[207] = {'\n', '\"', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 'e', 'n', 's',
+'i', 't', 'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '.', 'v', '3', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd',
+'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', ':', '>', '\n', '\t', 's', 'e', 'n', 's', 'i', 't',
+'i', 'v', 'e', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e',
+'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\265', '\321', '\213', '\035', ' ', '\001', '(', '\010', 'R', '\t', 's', 'e', 'n', 's', 'i',
+'t', 'i', 'v', 'e', 'B', '+', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x',
+'d', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_annotations_v3_sensitive_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_sensitive_proto_upb_file_layout,
+ "xds/annotations/v3/sensitive.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 207)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h
new file mode 100644
index 00000000..e12dff62
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h
@@ -0,0 +1,30 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/sensitive.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_annotations_v3_sensitive_proto_upbdefinit;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_SENSITIVE_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
new file mode 100644
index 00000000..54755b2c
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
@@ -0,0 +1,64 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/status.upbdefs.h"
+#include "xds/annotations/v3/status.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[936] = {'\n', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'.', 'v', '3', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
+'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '@', '\n', '\024', 'F', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u',
+'s', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r',
+'o', 'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r',
+'e', 's', 's', '\"', 'C', '\n', '\027', 'M', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o', 'g', 'r', 'e', 's', 's',
+'\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e', 's', 's', '\"', 'A', '\n',
+'\025', 'F', 'i', 'e', 'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n',
+'\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o', 'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016',
+'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e', 's', 's', '\"', '\234', '\001', '\n', '\020', 'S', 't', 'a', 't', 'u', 's',
+'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o',
+'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e',
+'s', 's', '\022', '^', '\n', '\026', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 's', 't', 'a',
+'t', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '(', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
+'n', 's', '.', 'v', '3', '.', 'P', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u',
+'s', 'R', '\024', 'p', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u', 's', '*', ']',
+'\n', '\024', 'P', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n',
+'\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'F', 'R', 'O', 'Z', 'E', 'N', '\020', '\001', '\022', '\n', '\n',
+'\006', 'A', 'C', 'T', 'I', 'V', 'E', '\020', '\002', '\022', ' ', '\n', '\034', 'N', 'E', 'X', 'T', '_', 'M', 'A', 'J', 'O', 'R', '_', 'V',
+'E', 'R', 'S', 'I', 'O', 'N', '_', 'C', 'A', 'N', 'D', 'I', 'D', 'A', 'T', 'E', '\020', '\003', ':', 'j', '\n', '\013', 'f', 'i', 'l',
+'e', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001', '(', '\013', '2', '(', '.',
+'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F', 'i', 'l', 'e', 'S', 't',
+'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u',
+'s', ':', 'v', '\n', '\016', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\037', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o',
+'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001', '(', '\013', '2', '+', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '.', 'v', '3', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'm', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', ':', 'n', '\n', '\014',
+'f', 'i', 'e', 'l', 'd', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001',
+'(', '\013', '2', ')', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F',
+'i', 'e', 'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'e',
+'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'B', '+', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n',
+'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_status_proto_upb_file_layout,
+ "xds/annotations/v3/status.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 936)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h
new file mode 100644
index 00000000..353a125b
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_FileStatusAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.FileStatusAnnotation");
+}
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_MessageStatusAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.MessageStatusAnnotation");
+}
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_FieldStatusAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.FieldStatusAnnotation");
+}
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_StatusAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.StatusAnnotation");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c
new file mode 100644
index 00000000..a7e1275e
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/versioning.upbdefs.h"
+#include "xds/annotations/v3/versioning.upb.h"
+
+extern _upb_DefPool_Init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[330] = {'\n', '#', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 'v', 'e', 'r', 's',
+'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '.', 'v', '3', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'d', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', 'J', '\n', '\024', 'V', 'e', 'r', 's', 'i',
+'o', 'n', 'i', 'n', 'g', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '2', '\n', '\025', 'p', 'r', 'e', 'v', 'i', 'o',
+'u', 's', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\023', 'p', 'r',
+'e', 'v', 'i', 'o', 'u', 's', 'M', 'e', 's', 's', 'a', 'g', 'e', 'T', 'y', 'p', 'e', ':', 'l', '\n', '\n', 'v', 'e', 'r', 's',
+'i', 'o', 'n', 'i', 'n', 'g', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\223', '\375', '\206', ',', ' ', '\001', '(', '\013', '2', '(',
+'.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'V', 'e', 'r', 's', 'i',
+'o', 'n', 'i', 'n', 'g', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
+'n', 'g', 'B', '+', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's',
+'/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', 'b', '\006', 'p',
+'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_annotations_v3_versioning_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_versioning_proto_upb_file_layout,
+ "xds/annotations/v3/versioning.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 330)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h
new file mode 100644
index 00000000..f80d5c05
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/versioning.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_annotations_v3_versioning_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_annotations_v3_VersioningAnnotation_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_annotations_v3_versioning_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.annotations.v3.VersioningAnnotation");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
index 699ae7d9..3f7c5fd9 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
@@ -8,35 +8,31 @@
#include "upb/def.h"
#include "xds/core/v3/authority.upbdefs.h"
+#include "xds/core/v3/authority.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_Authority_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_Authority_msginit,
-};
-
-static const char descriptor[205] = {'\n', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p',
-'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '(',
-'\n', '\t', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', 'B', '7', '\n', '\033', 'c', 'o', 'm', '.', 'g', 'i',
-'t', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'A', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p',
-'r', 'o', 't', 'o', '3',
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[238] = {'\n', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p',
+'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'\"', '(', '\n', '\t', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', 'B', 'V', '\n', '\026', 'c', 'o', 'm', '.',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'A', 'u', 't', 'h', 'o',
+'r', 'i', 't', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c',
+'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244',
+'\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[3] = {
- &udpa_annotations_status_proto_upbdefinit,
+static _upb_DefPool_Init *deps[3] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_authority_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_authority_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_authority_proto_upb_file_layout,
"xds/core/v3/authority.proto",
- UPB_STRVIEW_INIT(descriptor, 205)
+ UPB_STRINGVIEW_INIT(descriptor, 238)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h
index 191ee65b..69de0780 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_authority_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_authority_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_Authority_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_authority_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.Authority");
+UPB_INLINE const upb_MessageDef *xds_core_v3_Authority_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_authority_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.Authority");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
index 93d0581f..1142c202 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
@@ -8,55 +8,49 @@
#include "upb/def.h"
#include "xds/core/v3/collection_entry.upbdefs.h"
+#include "xds/core/v3/collection_entry.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init xds_core_v3_resource_locator_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_CollectionEntry_msginit;
-extern const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_CollectionEntry_msginit,
- &xds_core_v3_CollectionEntry_InlineEntry_msginit,
-};
-
-static const char descriptor[565] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_resource_locator_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[598] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_',
'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032',
'\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
-'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\303', '\002', '\n', '\017', 'C', 'o',
-'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '\022', '8', '\n', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u',
-'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'M', '\n', '\014',
-'i', 'n', 'l', 'i', 'n', 'e', '_', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd', 's', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '.', 'I',
-'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y',
-'\032', '\213', '\001', '\n', '\013', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', '\022', '0', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\001', ' ', '\001', '(', '\t', 'B', '\034', '\372', 'B', '\031', 'r', '\027', '2', '\025', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z',
-'_', '\\', '-', '\\', '.', '~', ':', ']', '+', '$', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 's', 'i',
-'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '\031', '\n', '\022', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '=', '\n', '\033', 'c', 'o',
-'m', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'B', '\024', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a',
+'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\303', '\002', '\n', '\017',
+'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '\022', '8', '\n', '\007', 'l', 'o', 'c', 'a', 't', 'o',
+'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's',
+'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'M',
+'\n', '\014', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'.', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't',
+'r', 'y', '\032', '\213', '\001', '\n', '\013', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', '\022', '0', '\n', '\004', 'n', 'a', 'm',
+'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\034', '\372', 'B', '\031', 'r', '\027', '2', '\025', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A',
+'-', 'Z', '_', '\\', '-', '\\', '.', '~', ':', ']', '+', '$', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r',
+'s', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '\031', '\n', '\022', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\\', '\n', '\026',
+'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'C',
+'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/',
+'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static _upb_DefPool_Init *deps[5] = {
&google_protobuf_any_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_resource_locator_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_collection_entry_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_collection_entry_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_collection_entry_proto_upb_file_layout,
"xds/core/v3/collection_entry.proto",
- UPB_STRVIEW_INIT(descriptor, 565)
+ UPB_STRINGVIEW_INIT(descriptor, 598)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h
index 3efc4531..c5145475 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_collection_entry_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_collection_entry_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_CollectionEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_collection_entry_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.CollectionEntry");
+UPB_INLINE const upb_MessageDef *xds_core_v3_CollectionEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_collection_entry_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.CollectionEntry");
}
-UPB_INLINE const upb_msgdef *xds_core_v3_CollectionEntry_InlineEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_collection_entry_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.CollectionEntry.InlineEntry");
+UPB_INLINE const upb_MessageDef *xds_core_v3_CollectionEntry_InlineEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_collection_entry_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.CollectionEntry.InlineEntry");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
index 0c6584b0..a30d846b 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
@@ -8,38 +8,32 @@
#include "upb/def.h"
#include "xds/core/v3/context_params.upbdefs.h"
+#include "xds/core/v3/context_params.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ContextParams_msginit;
-extern const upb_msglayout xds_core_v3_ContextParams_ParamsEntry_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_ContextParams_msginit,
- &xds_core_v3_ContextParams_ParamsEntry_msginit,
-};
-
-static const char descriptor[288] = {'\n', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r',
-'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
-'o', 't', 'o', '\"', '\212', '\001', '\n', '\r', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '>', '\n', '\006',
-'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '.', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't',
-'r', 'y', 'R', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\032', '9', '\n', '\013', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't', 'r', 'y',
-'\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l',
-'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', ';', '\n', '\033', 'c', 'o',
-'m', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'B', '\022', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+static const char descriptor[321] = {'\n', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r',
+'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x',
+'d', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\212', '\001', '\n', '\r', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '>',
+'\n', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '.', 'P', 'a', 'r', 'a', 'm', 's', 'E',
+'n', 't', 'r', 'y', 'R', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\032', '9', '\n', '\013', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't',
+'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v',
+'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', 'Z', '\n', '\026',
+'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\022', 'C',
+'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h',
+'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[2] = {
- &udpa_annotations_status_proto_upbdefinit,
+static _upb_DefPool_Init *deps[2] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_context_params_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_context_params_proto_upb_file_layout,
"xds/core/v3/context_params.proto",
- UPB_STRVIEW_INIT(descriptor, 288)
+ UPB_STRINGVIEW_INIT(descriptor, 321)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h
index e52928d4..d970656b 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_ContextParams_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_context_params_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.ContextParams");
+UPB_INLINE const upb_MessageDef *xds_core_v3_ContextParams_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_context_params_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.ContextParams");
}
-UPB_INLINE const upb_msgdef *xds_core_v3_ContextParams_ParamsEntry_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_context_params_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.ContextParams.ParamsEntry");
+UPB_INLINE const upb_MessageDef *xds_core_v3_ContextParams_ParamsEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_context_params_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.ContextParams.ParamsEntry");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c
new file mode 100644
index 00000000..bbb93ab3
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c
@@ -0,0 +1,41 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/core/v3/extension.upbdefs.h"
+#include "xds/core/v3/extension.upb.h"
+
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+static const char descriptor[302] = {'\n', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p',
+'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\"', 'v', '\n', '\024', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\033', '\n', '\004', 'n', 'a', 'm',
+'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n',
+'\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\010', '\372', 'B', '\005', '\242', '\001', '\002', '\010',
+'\001', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'B', 'N', '\n', '\026', 'c', 'o', 'm', '.', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f',
+'/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &validate_validate_proto_upbdefinit,
+ &google_protobuf_any_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_core_v3_extension_proto_upbdefinit = {
+ deps,
+ &xds_core_v3_extension_proto_upb_file_layout,
+ "xds/core/v3/extension.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 302)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h
new file mode 100644
index 00000000..7f86bef7
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/core/v3/extension.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_
+#define XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_core_v3_extension_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_core_v3_TypedExtensionConfig_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_extension_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.TypedExtensionConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_CORE_V3_EXTENSION_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
index d299981d..a6fe5cc5 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
@@ -8,42 +8,38 @@
#include "upb/def.h"
#include "xds/core/v3/resource.upbdefs.h"
+#include "xds/core/v3/resource.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init xds_core_v3_resource_name_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_Resource_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_Resource_msginit,
-};
-
-static const char descriptor[332] = {'\n', '\032', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r',
+extern _upb_DefPool_Init google_protobuf_any_proto_upbdefinit;
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_resource_name_proto_upbdefinit;
+static const char descriptor[365] = {'\n', '\032', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r',
'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a', 'm',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\205', '\001', '\n', '\010', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', '\022', '-', '\n', '\004', 'n',
-'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 's',
-'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e', 's',
-'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '6', '\n', '\033', 'c', 'o', 'm',
-'.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
-'\r', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'x', 'd', 's', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n',
+'a', 'm', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\205', '\001', '\n', '\010', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', '\022', '-', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e',
+'r', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r',
+'e', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', 'U', '\n', '\026', 'c',
+'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'R', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322',
+'\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
+static _upb_DefPool_Init *deps[4] = {
&google_protobuf_any_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_resource_name_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_resource_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_resource_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_proto_upb_file_layout,
"xds/core/v3/resource.proto",
- UPB_STRVIEW_INIT(descriptor, 332)
+ UPB_STRINGVIEW_INIT(descriptor, 365)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h
index d508465e..fb079f1e 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_resource_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_resource_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_Resource_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_resource_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.Resource");
+UPB_INLINE const upb_MessageDef *xds_core_v3_Resource_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_resource_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.Resource");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
index fefa5a28..c8255cea 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
@@ -8,60 +8,54 @@
#include "upb/def.h"
#include "xds/core/v3/resource_locator.upbdefs.h"
+#include "xds/core/v3/resource_locator.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_ResourceLocator_msginit,
- &xds_core_v3_ResourceLocator_Directive_msginit,
-};
-
-static const char descriptor[739] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o',
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[772] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o',
'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x',
-'t', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\216', '\004', '\n', '\017', 'R', 'e', 's', 'o', 'u', 'r',
-'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'E', '\n', '\006', 's', 'c', 'h', 'e', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\016',
-'2', '#', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o',
-'c', 'a', 't', 'o', 'r', '.', 'S', 'c', 'h', 'e', 'm', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's',
-'c', 'h', 'e', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t',
-'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't',
-'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', 'A', '\n',
-'\r', 'e', 'x', 'a', 'c', 't', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd',
-'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'H', '\000',
-'R', '\014', 'e', 'x', 'a', 'c', 't', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'F', '\n', '\n', 'd', 'i', 'r', 'e', 'c', 't', 'i',
-'v', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 'R',
-'\n', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 's', '\032', '\210', '\001', '\n', '\t', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e',
-'\022', '0', '\n', '\003', 'a', 'l', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\003', 'a', 'l', 't',
-'\022', '7', '\n', '\005', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\037', '\372', 'B', '\034', 'r', '\032', '\020', '\001', '2',
-'\026', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z', '_', '\\', '-', '\\', '.', '/', '~', ':', ']', '+', '$', 'H', '\000',
-'R', '\005', 'e', 'n', 't', 'r', 'y', 'B', '\020', '\n', '\t', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', '\022', '\003', '\370', 'B', '\001',
-'\"', '\'', '\n', '\006', 'S', 'c', 'h', 'e', 'm', 'e', '\022', '\t', '\n', '\005', 'X', 'D', 'S', 'T', 'P', '\020', '\000', '\022', '\010', '\n', '\004',
-'H', 'T', 'T', 'P', '\020', '\001', '\022', '\010', '\n', '\004', 'F', 'I', 'L', 'E', '\020', '\002', 'B', '\031', '\n', '\027', 'c', 'o', 'n', 't', 'e',
-'x', 't', '_', 'p', 'a', 'r', 'a', 'm', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '=', '\n', '\033', 'c', 'o', 'm',
-'.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
-'\024', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't',
+'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\216', '\004', '\n', '\017', 'R', 'e', 's', 'o',
+'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'E', '\n', '\006', 's', 'c', 'h', 'e', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\016', '2', '#', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'S', 'c', 'h', 'e', 'm', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
+'\006', 's', 'c', 'h', 'e', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034',
+'\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r',
+'i', 't', 'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022',
+'A', '\n', '\r', 'e', 'x', 'a', 'c', 't', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.',
+'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's',
+'H', '\000', 'R', '\014', 'e', 'x', 'a', 'c', 't', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'F', '\n', '\n', 'd', 'i', 'r', 'e', 'c',
+'t', 'i', 'v', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v',
+'e', 'R', '\n', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 's', '\032', '\210', '\001', '\n', '\t', 'D', 'i', 'r', 'e', 'c', 't', 'i',
+'v', 'e', '\022', '0', '\n', '\003', 'a', 'l', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\003', 'a',
+'l', 't', '\022', '7', '\n', '\005', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\037', '\372', 'B', '\034', 'r', '\032', '\020',
+'\001', '2', '\026', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z', '_', '\\', '-', '\\', '.', '/', '~', ':', ']', '+', '$',
+'H', '\000', 'R', '\005', 'e', 'n', 't', 'r', 'y', 'B', '\020', '\n', '\t', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', '\022', '\003', '\370',
+'B', '\001', '\"', '\'', '\n', '\006', 'S', 'c', 'h', 'e', 'm', 'e', '\022', '\t', '\n', '\005', 'X', 'D', 'S', 'T', 'P', '\020', '\000', '\022', '\010',
+'\n', '\004', 'H', 'T', 'T', 'P', '\020', '\001', '\022', '\010', '\n', '\004', 'F', 'I', 'L', 'E', '\020', '\002', 'B', '\031', '\n', '\027', 'c', 'o', 'n',
+'t', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\\', '\n', '\026', 'c',
+'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'R', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
- &udpa_annotations_status_proto_upbdefinit,
+static _upb_DefPool_Init *deps[4] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_context_params_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_resource_locator_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_resource_locator_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_locator_proto_upb_file_layout,
"xds/core/v3/resource_locator.proto",
- UPB_STRVIEW_INIT(descriptor, 739)
+ UPB_STRINGVIEW_INIT(descriptor, 772)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h
index 32e622a7..09d9c5a3 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h
@@ -19,16 +19,16 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_resource_locator_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_resource_locator_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_ResourceLocator_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_resource_locator_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.ResourceLocator");
+UPB_INLINE const upb_MessageDef *xds_core_v3_ResourceLocator_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_resource_locator_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.ResourceLocator");
}
-UPB_INLINE const upb_msgdef *xds_core_v3_ResourceLocator_Directive_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_resource_locator_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.ResourceLocator.Directive");
+UPB_INLINE const upb_MessageDef *xds_core_v3_ResourceLocator_Directive_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_resource_locator_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.ResourceLocator.Directive");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
index 7b27e3db..062d4286 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
@@ -8,43 +8,39 @@
#include "upb/def.h"
#include "xds/core/v3/resource_name.upbdefs.h"
+#include "xds/core/v3/resource_name.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ResourceName_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_ResourceName_msginit,
-};
-
-static const char descriptor[367] = {'\n', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a',
-'m', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd',
-'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p',
-'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\240', '\001', '\n', '\014', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N',
-'a', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t', 'a', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022',
-',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n', '\007', 'c',
-'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\007', 'c', 'o', 'n', 't', 'e', 'x', 't', 'B',
-':', '\n', '\033', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', 'B', '\021', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'P', 'r', 'o', 't', 'o', 'P',
-'\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_context_params_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[400] = {'\n', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a',
+'m', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x', 'd',
+'s', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't',
+'_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\240', '\001', '\n', '\014', 'R', 'e', 's', 'o', 'u', 'r', 'c',
+'e', 'N', 'a', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t',
+'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't',
+'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n',
+'\007', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\007', 'c', 'o', 'n', 't', 'e', 'x',
+'t', 'B', 'Y', '\n', '\026', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', 'B', '\021', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd',
+'s', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
- &udpa_annotations_status_proto_upbdefinit,
+static _upb_DefPool_Init *deps[4] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_context_params_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
-upb_def_init xds_core_v3_resource_name_proto_upbdefinit = {
+_upb_DefPool_Init xds_core_v3_resource_name_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_name_proto_upb_file_layout,
"xds/core/v3/resource_name.proto",
- UPB_STRVIEW_INIT(descriptor, 367)
+ UPB_STRINGVIEW_INIT(descriptor, 400)
};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h
index b52df056..a8e65b17 100644
--- a/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h
+++ b/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h
@@ -19,11 +19,11 @@ extern "C" {
#include "upb/port_def.inc"
-extern upb_def_init xds_core_v3_resource_name_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_resource_name_proto_upbdefinit;
-UPB_INLINE const upb_msgdef *xds_core_v3_ResourceName_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &xds_core_v3_resource_name_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "xds.core.v3.ResourceName");
+UPB_INLINE const upb_MessageDef *xds_core_v3_ResourceName_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_core_v3_resource_name_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.core.v3.ResourceName");
}
#ifdef __cplusplus
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c
new file mode 100644
index 00000000..437b8bcc
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c
@@ -0,0 +1,126 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/type/matcher/v3/matcher.upbdefs.h"
+#include "xds/type/matcher/v3/matcher.upb.h"
+
+extern _upb_DefPool_Init xds_annotations_v3_status_proto_upbdefinit;
+extern _upb_DefPool_Init xds_core_v3_extension_proto_upbdefinit;
+extern _upb_DefPool_Init xds_type_matcher_v3_string_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[2335] = {'\n', '!', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\023', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c',
+'h', 'e', 'r', '.', 'v', '3', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
+'3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/',
+'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 't',
+'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o',
+'t', 'o', '\"', '\205', '\020', '\n', '\007', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'M', '\n', '\014', 'm', 'a', 't', 'c', 'h', 'e', 'r',
+'_', 'l', 'i', 's', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L',
+'i', 's', 't', 'H', '\000', 'R', '\013', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '\022', 'M', '\n', '\014', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '_', 't', 'r', 'e', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd', 's', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'T', 'r', 'e', 'e', 'H', '\000', 'R', '\013', 'm', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '\022', 'D', '\n',
+'\013', 'o', 'n', '_', 'n', 'o', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '$', '.', 'x', 'd', 's', '.',
+'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O',
+'n', 'M', 'a', 't', 'c', 'h', 'R', '\t', 'o', 'n', 'N', 'o', 'M', 'a', 't', 'c', 'h', '\032', '\221', '\001', '\n', '\007', 'O', 'n', 'M',
+'a', 't', 'c', 'h', '\022', '8', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x',
+'d', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e',
+'r', 'H', '\000', 'R', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\022', ';', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '!', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n', 'B', '\017',
+'\n', '\010', 'o', 'n', '_', 'm', 'a', 't', 'c', 'h', '\022', '\003', '\370', 'B', '\001', '\032', '\266', '\010', '\n', '\013', 'M', 'a', 't', 'c', 'h',
+'e', 'r', 'L', 'i', 's', 't', '\022', '[', '\n', '\010', 'm', 'a', 't', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
+'5', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'm', 'a', 't', 'c', 'h', 'e', 'r', 's', '\032',
+'\221', '\006', '\n', '\t', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'o', '\n', '\020', 's', 'i', 'n', 'g', 'l', 'e', '_', 'p',
+'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', 'B', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h',
+'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'S', 'i', 'n', 'g', 'l', 'e', 'P', 'r',
+'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\017', 's', 'i', 'n', 'g', 'l', 'e', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', '\022', 'a', '\n', '\n', 'o', 'r', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '@', '.', 'x',
+'d', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'P',
+'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'L', 'i', 's', 't', 'H', '\000', 'R', '\t', 'o', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'\022', 'c', '\n', '\013', 'a', 'n', 'd', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '@', '.', 'x',
+'d', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'P',
+'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'L', 'i', 's', 't', 'H', '\000', 'R', '\n', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', 'e',
+'r', '\022', 'U', '\n', '\013', 'n', 'o', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '2', '.',
+'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H',
+'\000', 'R', '\n', 'n', 'o', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\032', '\363', '\001', '\n', '\017', 'S', 'i', 'n', 'g', 'l', 'e', 'P',
+'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'A', '\n', '\005', 'i', 'n', 'p', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '!',
+'.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'i', 'n', 'p', 'u', 't',
+'\022', 'E', '\n', '\013', 'v', 'a', 'l', 'u', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'x',
+'d', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g',
+'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\n', 'v', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', 'F', '\n', '\014',
+'c', 'u', 's', 't', 'o', 'm', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'x', 'd', 's', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n',
+'f', 'i', 'g', 'H', '\000', 'R', '\013', 'c', 'u', 's', 't', 'o', 'm', 'M', 'a', 't', 'c', 'h', 'B', '\016', '\n', '\007', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032', 'k', '\n', '\r', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'L', 'i', 's',
+'t', '\022', 'Z', '\n', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '2', '.', 'x', 'd',
+'s', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372',
+'B', '\005', '\222', '\001', '\002', '\010', '\002', 'R', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\021', '\n', '\n', 'm', 'a', 't',
+'c', 'h', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\032', '\265', '\001', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'M', 'a', 't',
+'c', 'h', 'e', 'r', '\022', 'Z', '\n', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '2',
+'.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'L', 'i', 's', 't', '.', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
+'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\t', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'I', '\n', '\010',
+'o', 'n', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '$', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O', 'n', 'M', 'a', 't',
+'c', 'h', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'o', 'n', 'M', 'a', 't', 'c', 'h', '\032', '\251', '\004', '\n',
+'\013', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '\022', 'A', '\n', '\005', 'i', 'n', 'p', 'u', 't', '\030', '\001', ' ', '\001',
+'(', '\013', '2', '!', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'i',
+'n', 'p', 'u', 't', '\022', '[', '\n', '\017', 'e', 'x', 'a', 'c', 't', '_', 'm', 'a', 't', 'c', 'h', '_', 'm', 'a', 'p', '\030', '\002',
+' ', '\001', '(', '\013', '2', '1', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '.', 'M', 'a', 't',
+'c', 'h', 'M', 'a', 'p', 'H', '\000', 'R', '\r', 'e', 'x', 'a', 'c', 't', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '\022', ']', '\n',
+'\020', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '_', 'm', 'a', 'p', '\030', '\003', ' ', '\001', '(', '\013', '2', '1',
+'.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'T', 'r', 'e', 'e', '.', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', 'H',
+'\000', 'R', '\016', 'p', 'r', 'e', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '\022', 'F', '\n', '\014', 'c', 'u', 's', 't',
+'o', 'm', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '!', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H',
+'\000', 'R', '\013', 'c', 'u', 's', 't', 'o', 'm', 'M', 'a', 't', 'c', 'h', '\032', '\300', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'M',
+'a', 'p', '\022', 'V', '\n', '\003', 'm', 'a', 'p', '\030', '\001', ' ', '\003', '(', '\013', '2', ':', '.', 'x', 'd', 's', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'T', 'r', 'e', 'e', '.', 'M', 'a', 't', 'c', 'h', 'M', 'a', 'p', '.', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y',
+'B', '\010', '\372', 'B', '\005', '\232', '\001', '\002', '\010', '\001', 'R', '\003', 'm', 'a', 'p', '\032', '\\', '\n', '\010', 'M', 'a', 'p', 'E', 'n', 't',
+'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', ':', '\n', '\005', 'v',
+'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '$', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'O', 'n', 'M', 'a', 't', 'c', 'h', 'R', '\005',
+'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', '\020', '\n', '\t', 't', 'r', 'e', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370',
+'B', '\001', ':', '\010', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'B', '\023', '\n', '\014', 'm', 'a', 't', 'c', 'h', 'e', 'r', '_', 't',
+'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', '\\', '\n', '\036', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd',
+'s', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\014', 'M', 'a', 't', 'c', 'h', 'e',
+'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '*', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f',
+'/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/',
+'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[5] = {
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &xds_core_v3_extension_proto_upbdefinit,
+ &xds_type_matcher_v3_string_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_type_matcher_v3_matcher_proto_upbdefinit = {
+ deps,
+ &xds_type_matcher_v3_matcher_proto_upb_file_layout,
+ "xds/type/matcher/v3/matcher.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 2335)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h
new file mode 100644
index 00000000..13e0e593
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h
@@ -0,0 +1,80 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/matcher.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_
+#define XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_type_matcher_v3_matcher_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_OnMatch_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.OnMatch");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherList");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherList_Predicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherList.Predicate");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherList.Predicate.SinglePredicate");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherList.Predicate.PredicateList");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherList.FieldMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherTree_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherTree");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherTree.MatchMap");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_matcher_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.Matcher.MatcherTree.MatchMap.MapEntry");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_MATCHER_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c
new file mode 100644
index 00000000..2607bf81
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/type/matcher/v3/regex.upbdefs.h"
+#include "xds/type/matcher/v3/regex.upb.h"
+
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[348] = {'\n', '\037', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g',
+'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\022', '\023', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p',
+'r', 'o', 't', 'o', '\"', '\246', '\001', '\n', '\014', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'V', '\n', '\n',
+'g', 'o', 'o', 'g', 'l', 'e', '_', 'r', 'e', '2', '\030', '\001', ' ', '\001', '(', '\013', '2', '+', '.', 'x', 'd', 's', '.', 't', 'y',
+'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t',
+'g', 'o', 'o', 'g', 'l', 'e', 'R', 'e', '2', '\022', '\035', '\n', '\005', 'r', 'e', 'g', 'e', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\032', '\013', '\n', '\t', 'G', 'o', 'o', 'g', 'l', 'e',
+'R', 'E', '2', 'B', '\022', '\n', '\013', 'e', 'n', 'g', 'i', 'n', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'B', 'Z',
+'\n', '\036', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'R', 'e', 'g', 'e', 'x', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '*', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/',
+'t', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[2] = {
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_type_matcher_v3_regex_proto_upbdefinit = {
+ deps,
+ &xds_type_matcher_v3_regex_proto_upb_file_layout,
+ "xds/type/matcher/v3/regex.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 348)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h
new file mode 100644
index 00000000..7e9f9e5d
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/regex.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_
+#define XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_type_matcher_v3_regex_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_RegexMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_regex_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.RegexMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_RegexMatcher_GoogleRE2_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_regex_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.RegexMatcher.GoogleRE2");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_REGEX_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c
new file mode 100644
index 00000000..7aac82fa
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/type/matcher/v3/string.upbdefs.h"
+#include "xds/type/matcher/v3/string.upb.h"
+
+extern _upb_DefPool_Init xds_type_matcher_v3_regex_proto_upbdefinit;
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+static const char descriptor[593] = {'\n', ' ', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r',
+'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\023', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', '\032', '\037', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v',
+'3', '/', 'r', 'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\231', '\002', '\n', '\r', 'S', 't', 'r', 'i', 'n', 'g', 'M',
+'a', 't', 'c', 'h', 'e', 'r', '\022', '\026', '\n', '\005', 'e', 'x', 'a', 'c', 't', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\005',
+'e', 'x', 'a', 'c', 't', '\022', '!', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '!', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x',
+'\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\006', 's', 'u', 'f', 'f', 'i', 'x',
+'\022', 'L', '\n', '\n', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\005', ' ', '\001', '(', '\013', '2', '!', '.', 'x', 'd',
+'s', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a',
+'t', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 's', 'a', 'f', 'e', 'R', 'e',
+'g', 'e', 'x', '\022', '%', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\007', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\037', '\n', '\013', 'i', 'g', 'n', 'o',
+'r', 'e', '_', 'c', 'a', 's', 'e', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 'i', 'g', 'n', 'o', 'r', 'e', 'C', 'a', 's', 'e',
+'B', '\024', '\n', '\r', 'm', 'a', 't', 'c', 'h', '_', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\003', '\370', 'B', '\001', '\"', ']', '\n',
+'\021', 'L', 'i', 's', 't', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'H', '\n', '\010', 'p', 'a', 't',
+'t', 'e', 'r', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372',
+'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'p', 'a', 't', 't', 'e', 'r', 'n', 's', 'B', '[', '\n', '\036', 'c', 'o', 'm', '.',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', 'B', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '*', 'g', 'i', 't', 'h', 'u', 'b', '.',
+'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &xds_type_matcher_v3_regex_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_type_matcher_v3_string_proto_upbdefinit = {
+ deps,
+ &xds_type_matcher_v3_string_proto_upb_file_layout,
+ "xds/type/matcher/v3/string.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 593)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h
new file mode 100644
index 00000000..f83b2a0a
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/matcher/v3/string.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_
+#define XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_type_matcher_v3_string_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_StringMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_string_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.StringMatcher");
+}
+
+UPB_INLINE const upb_MessageDef *xds_type_matcher_v3_ListStringMatcher_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_matcher_v3_string_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.matcher.v3.ListStringMatcher");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_MATCHER_V3_STRING_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c b/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
new file mode 100644
index 00000000..31d4ec18
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/type/v3/typed_struct.upbdefs.h"
+#include "xds/type/v3/typed_struct.upb.h"
+
+extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
+extern _upb_DefPool_Init google_protobuf_struct_proto_upbdefinit;
+static const char descriptor[279] = {'\n', '\036', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 't', 'y', 'p', 'e', 'd', '_', 's', 't', 'r', 'u', 'c',
+'t', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o',
+'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o',
+'\"', 'W', '\n', '\013', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u',
+'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '-', '\n', '\005', 'v', 'a', 'l', 'u',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'B', 'P', '\n', '\026', 'c', 'o', 'm', '.', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\020', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r',
+'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n',
+'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'v', '3', 'b', '\006', 'p', 'r',
+'o', 't', 'o', '3',
+};
+
+static _upb_DefPool_Init *deps[3] = {
+ &validate_validate_proto_upbdefinit,
+ &google_protobuf_struct_proto_upbdefinit,
+ NULL
+};
+
+_upb_DefPool_Init xds_type_v3_typed_struct_proto_upbdefinit = {
+ deps,
+ &xds_type_v3_typed_struct_proto_upb_file_layout,
+ "xds/type/v3/typed_struct.proto",
+ UPB_STRINGVIEW_INIT(descriptor, 279)
+};
diff --git a/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h b/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
new file mode 100644
index 00000000..99ed3b5d
--- /dev/null
+++ b/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_
+#define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern _upb_DefPool_Init xds_type_v3_typed_struct_proto_upbdefinit;
+
+UPB_INLINE const upb_MessageDef *xds_type_v3_TypedStruct_getmsgdef(upb_DefPool *s) {
+ _upb_DefPool_LoadDefInit(s, &xds_type_v3_typed_struct_proto_upbdefinit);
+ return upb_DefPool_FindMessageByName(s, "xds.type.v3.TypedStruct");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_ */
diff --git a/grpc/src/core/ext/xds/certificate_provider_registry.cc b/grpc/src/core/ext/xds/certificate_provider_registry.cc
index 0d7950d5..8802f2be 100644
--- a/grpc/src/core/ext/xds/certificate_provider_registry.cc
+++ b/grpc/src/core/ext/xds/certificate_provider_registry.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include "absl/container/inlined_vector.h"
-
#include "src/core/ext/xds/certificate_provider_registry.h"
+#include "absl/container/inlined_vector.h"
+
namespace grpc_core {
namespace {
@@ -58,7 +58,7 @@ class RegistryState {
factories_;
};
-static RegistryState* g_state = nullptr;
+RegistryState* g_state = nullptr;
} // namespace
diff --git a/grpc/src/core/ext/xds/certificate_provider_store.cc b/grpc/src/core/ext/xds/certificate_provider_store.cc
index dd66b97a..83001972 100644
--- a/grpc/src/core/ext/xds/certificate_provider_store.cc
+++ b/grpc/src/core/ext/xds/certificate_provider_store.cc
@@ -24,6 +24,14 @@
namespace grpc_core {
+//
+// CertificateProviderStore::CertificateProviderWrapper
+//
+
+const char* CertificateProviderStore::CertificateProviderWrapper::type() const {
+ return "Wrapper";
+}
+
// If a certificate provider is created, the CertificateProviderStore
// maintains a raw pointer to the created CertificateProviderWrapper so that
// future calls to `CreateOrGetCertificateProvider()` with the same key result
diff --git a/grpc/src/core/ext/xds/certificate_provider_store.h b/grpc/src/core/ext/xds/certificate_provider_store.h
index fb6ca72d..9618625c 100644
--- a/grpc/src/core/ext/xds/certificate_provider_store.h
+++ b/grpc/src/core/ext/xds/certificate_provider_store.h
@@ -74,7 +74,7 @@ class CertificateProviderStore
store_->ReleaseCertificateProvider(key_, this);
}
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor()
const override {
return certificate_provider_->distributor();
}
@@ -83,6 +83,15 @@ class CertificateProviderStore
return certificate_provider_->interested_parties();
}
+ int CompareImpl(const grpc_tls_certificate_provider* other) const override {
+ // TODO(yashykt): This should probably delegate to the `Compare` method of
+ // the wrapped certificate_provider_ object.
+ return QsortCompare(
+ static_cast<const grpc_tls_certificate_provider*>(this), other);
+ }
+
+ const char* type() const override;
+
absl::string_view key() const { return key_; }
private:
@@ -101,7 +110,7 @@ class CertificateProviderStore
Mutex mu_;
// Map of plugin configurations
- PluginDefinitionMap plugin_config_map_ ABSL_GUARDED_BY(mu_);
+ const PluginDefinitionMap plugin_config_map_;
// Underlying map for the providers.
std::map<absl::string_view, CertificateProviderWrapper*>
certificate_providers_map_ ABSL_GUARDED_BY(mu_);
diff --git a/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc b/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
index 7a793b06..939eec24 100644
--- a/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
+++ b/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
@@ -58,7 +58,7 @@ std::string FileWatcherCertificateProviderFactory::Config::ToString() const {
absl::StrFormat("ca_certificate_file=\"%s\", ", root_cert_file_));
}
parts.push_back(
- absl::StrFormat("refresh_interval=%ldms}", refresh_interval_ms_));
+ absl::StrFormat("refresh_interval=%ldms}", refresh_interval_.millis()));
return absl::StrJoin(parts, "");
}
@@ -91,8 +91,8 @@ FileWatcherCertificateProviderFactory::Config::Parse(const Json& config_json,
}
if (!ParseJsonObjectFieldAsDuration(
config_json.object_value(), "refresh_interval",
- &config->refresh_interval_ms_, &error_list, false)) {
- config->refresh_interval_ms_ = 10 * 60 * 1000; // 10 minutes default
+ &config->refresh_interval_, &error_list, false)) {
+ config->refresh_interval_ = Duration::Minutes(10); // 10 minutes default
}
if (!error_list.empty()) {
*error = GRPC_ERROR_CREATE_FROM_VECTOR(
@@ -131,7 +131,7 @@ FileWatcherCertificateProviderFactory::CreateCertificateProvider(
file_watcher_config->private_key_file(),
file_watcher_config->identity_cert_file(),
file_watcher_config->root_cert_file(),
- file_watcher_config->refresh_interval_ms() / GPR_MS_PER_SEC);
+ file_watcher_config->refresh_interval().millis() / GPR_MS_PER_SEC);
}
void FileWatcherCertificateProviderInit() {
diff --git a/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h b/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
index 13e10deb..10b0037e 100644
--- a/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
+++ b/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
@@ -45,13 +45,13 @@ class FileWatcherCertificateProviderFactory
const std::string& root_cert_file() const { return root_cert_file_; }
- grpc_millis refresh_interval_ms() const { return refresh_interval_ms_; }
+ Duration refresh_interval() const { return refresh_interval_; }
private:
std::string identity_cert_file_;
std::string private_key_file_;
std::string root_cert_file_;
- grpc_millis refresh_interval_ms_;
+ Duration refresh_interval_;
};
const char* name() const override;
diff --git a/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc b/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
index 6e63ae4e..95137bb3 100644
--- a/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
+++ b/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.cc
@@ -153,7 +153,7 @@ GoogleMeshCaCertificateProviderFactory::Config::ParseJsonObjectGrpcServices(
}
if (!ParseJsonObjectFieldAsDuration(grpc_service, "timeout", &timeout_,
&error_list_grpc_services, false)) {
- timeout_ = 10 * 1000; // 10sec default
+ timeout_ = Duration::Seconds(10); // 10sec default
}
return error_list_grpc_services;
}
@@ -216,12 +216,12 @@ GoogleMeshCaCertificateProviderFactory::Config::Parse(
if (!ParseJsonObjectFieldAsDuration(
config_json.object_value(), "certificate_lifetime",
&config->certificate_lifetime_, &error_list, false)) {
- config->certificate_lifetime_ = 24 * 60 * 60 * 1000; // 24hrs default
+ config->certificate_lifetime_ = Duration::Hours(24); // 24hrs default
}
if (!ParseJsonObjectFieldAsDuration(
config_json.object_value(), "renewal_grace_period",
&config->renewal_grace_period_, &error_list, false)) {
- config->renewal_grace_period_ = 12 * 60 * 60 * 1000; // 12hrs default
+ config->renewal_grace_period_ = Duration::Hours(12); // 12hrs default
}
std::string key_type;
if (ParseJsonObjectField(config_json.object_value(), "key_type", &key_type,
diff --git a/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h b/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
index 7a33f977..8d1f19a8 100644
--- a/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
+++ b/grpc/src/core/ext/xds/google_mesh_ca_certificate_provider_factory.h
@@ -52,11 +52,11 @@ class GoogleMeshCaCertificateProviderFactory
const StsConfig& sts_config() const { return sts_config_; }
- grpc_millis timeout() const { return timeout_; }
+ Duration timeout() const { return timeout_; }
- grpc_millis certificate_lifetime() const { return certificate_lifetime_; }
+ Duration certificate_lifetime() const { return certificate_lifetime_; }
- grpc_millis renewal_grace_period() const { return renewal_grace_period_; }
+ Duration renewal_grace_period() const { return renewal_grace_period_; }
uint32_t key_size() const { return key_size_; }
@@ -80,9 +80,9 @@ class GoogleMeshCaCertificateProviderFactory
std::string endpoint_;
StsConfig sts_config_;
- grpc_millis timeout_;
- grpc_millis certificate_lifetime_;
- grpc_millis renewal_grace_period_;
+ Duration timeout_;
+ Duration certificate_lifetime_;
+ Duration renewal_grace_period_;
uint32_t key_size_;
std::string location_;
};
diff --git a/grpc/src/core/ext/xds/upb_utils.h b/grpc/src/core/ext/xds/upb_utils.h
new file mode 100644
index 00000000..be1d7ebb
--- /dev/null
+++ b/grpc/src/core/ext/xds/upb_utils.h
@@ -0,0 +1,67 @@
+//
+// 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_UPB_UTILS_H
+#define GRPC_CORE_EXT_XDS_UPB_UTILS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include "absl/strings/string_view.h"
+#include "upb/text_encode.h"
+#include "upb/upb.h"
+#include "upb/upb.hpp"
+
+#include "src/core/ext/xds/certificate_provider_store.h"
+#include "src/core/ext/xds/xds_bootstrap.h"
+#include "src/core/lib/debug/trace.h"
+
+namespace grpc_core {
+
+class XdsClient;
+
+// TODO(roth): Rethink this. All fields except symtab and arena should come
+// from XdsClient, injected into XdsResourceType::Decode() somehow without
+// passing through XdsApi code, maybe via the AdsResponseParser.
+struct XdsEncodingContext {
+ XdsClient* client; // Used only for logging. Unsafe for dereferencing.
+ const XdsBootstrap::XdsServer& server;
+ TraceFlag* tracer;
+ upb_DefPool* symtab;
+ upb_Arena* arena;
+ bool use_v3;
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map;
+};
+
+// Works for both std::string and absl::string_view.
+template <typename T>
+inline upb_StringView StdStringToUpbString(const T& str) {
+ return upb_StringView_FromDataAndSize(str.data(), str.size());
+}
+
+inline absl::string_view UpbStringToAbsl(const upb_StringView& str) {
+ return absl::string_view(str.data, str.size);
+}
+
+inline std::string UpbStringToStdString(const upb_StringView& str) {
+ return std::string(str.data, str.size);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_UPB_UTILS_H
diff --git a/grpc/src/core/ext/xds/xds_api.cc b/grpc/src/core/ext/xds/xds_api.cc
index e51bc07c..026d53fb 100644
--- a/grpc/src/core/ext/xds/xds_api.cc
+++ b/grpc/src/core/ext/xds/xds_api.cc
@@ -1,86 +1,42 @@
-/*
- *
- * 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 <algorithm>
-#include <cctype>
-#include <cstdint>
-#include <cstdlib>
+#include "src/core/ext/xds/xds_api.h"
+
+#include <set>
#include <string>
+#include <vector>
#include "absl/strings/str_cat.h"
-#include "absl/strings/str_format.h"
-#include "absl/strings/str_join.h"
-#include "absl/strings/str_split.h"
#include "envoy/admin/v3/config_dump.upb.h"
-#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
-#include "envoy/config/cluster/v3/cluster.upb.h"
-#include "envoy/config/cluster/v3/cluster.upbdefs.h"
-#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/base.upbdefs.h"
-#include "envoy/config/core/v3/config_source.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/config/endpoint/v3/endpoint.upbdefs.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/listener/v3/listener.upbdefs.h"
-#include "envoy/config/listener/v3/listener_components.upb.h"
-#include "envoy/config/route/v3/route.upb.h"
-#include "envoy/config/route/v3/route.upbdefs.h"
-#include "envoy/config/route/v3/route_components.upb.h"
-#include "envoy/config/route/v3/route_components.upbdefs.h"
-#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
-#include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h"
-#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
-#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h"
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h"
-#include "envoy/service/cluster/v3/cds.upb.h"
-#include "envoy/service/cluster/v3/cds.upbdefs.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "envoy/service/discovery/v3/discovery.upbdefs.h"
-#include "envoy/service/endpoint/v3/eds.upb.h"
-#include "envoy/service/endpoint/v3/eds.upbdefs.h"
-#include "envoy/service/listener/v3/lds.upb.h"
#include "envoy/service/load_stats/v3/lrs.upb.h"
#include "envoy/service/load_stats/v3/lrs.upbdefs.h"
-#include "envoy/service/route/v3/rds.upb.h"
-#include "envoy/service/route/v3/rds.upbdefs.h"
#include "envoy/service/status/v3/csds.upb.h"
#include "envoy/service/status/v3/csds.upbdefs.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/timestamp.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "google/rpc/status.upb.h"
-#include "udpa/type/v1/typed_struct.upb.h"
#include "upb/text_encode.h"
#include "upb/upb.h"
#include "upb/upb.hpp"
@@ -89,793 +45,68 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/ext/xds/xds_resource_type.h"
+#include "src/core/ext/xds/xds_routing.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.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/gprpp/host_port.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
-// TODO(donnadionne): Check to see if cluster types aggregate_cluster and
-// logical_dns are enabled, this will be
-// removed once the cluster types are fully integration-tested and enabled by
-// default.
-bool XdsAggregateAndLogicalDnsClusterEnabled() {
- char* value = gpr_getenv(
- "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
- gpr_free(value);
- return parse_succeeded && parsed_value;
-}
-
-// TODO(donnadionne): Check to see if ring hash policy is enabled, this will be
-// removed once ring hash policy is fully integration-tested and enabled by
-// default.
-bool XdsRingHashEnabled() {
- char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH");
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
- gpr_free(value);
- return parse_succeeded && parsed_value;
-}
-
-// TODO(yashykt): Check to see if xDS security is enabled. This will be
-// removed once this feature is fully integration-tested and enabled by
-// default.
-bool XdsSecurityEnabled() {
- char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT");
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
- gpr_free(value);
- return parse_succeeded && parsed_value;
-}
-
-//
-// XdsApi::Route::HashPolicy
-//
-
-XdsApi::Route::HashPolicy::HashPolicy(const HashPolicy& other)
- : type(other.type),
- header_name(other.header_name),
- regex_substitution(other.regex_substitution) {
- if (other.regex != nullptr) {
- regex =
- absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
- }
-}
-
-XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
- const HashPolicy& other) {
- type = other.type;
- header_name = other.header_name;
- if (other.regex != nullptr) {
- regex =
- absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
- }
- regex_substitution = other.regex_substitution;
- return *this;
-}
-
-XdsApi::Route::HashPolicy::HashPolicy(HashPolicy&& other) noexcept
- : type(other.type),
- header_name(std::move(other.header_name)),
- regex(std::move(other.regex)),
- regex_substitution(std::move(other.regex_substitution)) {}
-
-XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
- HashPolicy&& other) noexcept {
- type = other.type;
- header_name = std::move(other.header_name);
- regex = std::move(other.regex);
- regex_substitution = std::move(other.regex_substitution);
- return *this;
-}
-
-bool XdsApi::Route::HashPolicy::HashPolicy::operator==(
- const HashPolicy& other) const {
- if (type != other.type) return false;
- if (type == Type::HEADER) {
- if (regex == nullptr) {
- if (other.regex != nullptr) return false;
- } else {
- if (other.regex == nullptr) return false;
- return header_name == other.header_name &&
- regex->pattern() == other.regex->pattern() &&
- regex_substitution == other.regex_substitution;
- }
- }
- return true;
-}
-
-std::string XdsApi::Route::HashPolicy::ToString() const {
- std::vector<std::string> contents;
- switch (type) {
- case Type::HEADER:
- contents.push_back("type=HEADER");
- break;
- case Type::CHANNEL_ID:
- contents.push_back("type=CHANNEL_ID");
- break;
- }
- contents.push_back(
- absl::StrFormat("terminal=%s", terminal ? "true" : "false"));
- if (type == Type::HEADER) {
- contents.push_back(absl::StrFormat(
- "Header %s:/%s/%s", header_name,
- (regex == nullptr) ? "" : regex->pattern(), regex_substitution));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::Route
-//
-
-std::string XdsApi::Route::Matchers::ToString() const {
- std::vector<std::string> contents;
- contents.push_back(
- absl::StrFormat("PathMatcher{%s}", 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(absl::StrFormat("Fraction Per Million %d",
- fraction_per_million.value()));
- }
- return absl::StrJoin(contents, "\n");
-}
-
-std::string XdsApi::Route::ClusterWeight::ToString() const {
- std::vector<std::string> contents;
- contents.push_back(absl::StrCat("cluster=", name));
- contents.push_back(absl::StrCat("weight=", weight));
- if (!typed_per_filter_config.empty()) {
- std::vector<std::string> parts;
- for (const auto& p : typed_per_filter_config) {
- const std::string& key = p.first;
- const auto& config = p.second;
- parts.push_back(absl::StrCat(key, "=", config.ToString()));
- }
- contents.push_back(absl::StrCat("typed_per_filter_config={",
- absl::StrJoin(parts, ", "), "}"));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-std::string XdsApi::Route::ToString() const {
- std::vector<std::string> contents;
- contents.push_back(matchers.ToString());
- for (const HashPolicy& hash_policy : hash_policies) {
- contents.push_back(absl::StrCat("hash_policy=", hash_policy.ToString()));
- }
- if (!cluster_name.empty()) {
- contents.push_back(absl::StrFormat("Cluster name: %s", cluster_name));
- }
- for (const ClusterWeight& cluster_weight : weighted_clusters) {
- contents.push_back(cluster_weight.ToString());
- }
- if (max_stream_duration.has_value()) {
- contents.push_back(max_stream_duration->ToString());
- }
- if (!typed_per_filter_config.empty()) {
- contents.push_back("typed_per_filter_config={");
- for (const auto& p : typed_per_filter_config) {
- const std::string& name = p.first;
- const auto& config = p.second;
- contents.push_back(absl::StrCat(" ", name, "=", config.ToString()));
- }
- contents.push_back("}");
- }
- return absl::StrJoin(contents, "\n");
-}
-
-//
-// XdsApi::RdsUpdate
-//
-
-std::string XdsApi::RdsUpdate::ToString() const {
- std::vector<std::string> vhosts;
- for (const VirtualHost& vhost : virtual_hosts) {
- vhosts.push_back(
- absl::StrCat("vhost={\n"
- " domains=[",
- 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(" typed_per_filter_config={\n");
- for (const auto& p : vhost.typed_per_filter_config) {
- const std::string& name = p.first;
- const auto& config = p.second;
- vhosts.push_back(
- absl::StrCat(" ", name, "=", config.ToString(), "\n"));
- }
- vhosts.push_back(" }\n");
- vhosts.push_back("]\n");
- }
- return 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, const std::string& domain_pattern_in,
- const std::string& expected_host_name_in) {
- // Normalize the args to lower-case. Domain matching is case-insensitive.
- std::string domain_pattern = domain_pattern_in;
- std::string expected_host_name = expected_host_name_in;
- std::transform(domain_pattern.begin(), domain_pattern.end(),
- domain_pattern.begin(),
- [](unsigned char c) { return std::tolower(c); });
- std::transform(expected_host_name.begin(), expected_host_name.end(),
- 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;
- absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
- 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;
- absl::string_view pattern_prefix(domain_pattern.c_str(),
- domain_pattern.size() - 1);
- 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 std::string& domain_pattern) {
- if (domain_pattern.empty()) return INVALID_MATCH;
- if (domain_pattern.find('*') == std::string::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 std::string& 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 std::string& 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::CommonTlsContext::CertificateValidationContext
-//
-
-std::string XdsApi::CommonTlsContext::CertificateValidationContext::ToString()
- const {
- std::vector<std::string> contents;
- for (const auto& match : match_subject_alt_names) {
- contents.push_back(match.ToString());
- }
- return absl::StrFormat("{match_subject_alt_names=[%s]}",
- absl::StrJoin(contents, ", "));
-}
-
-bool XdsApi::CommonTlsContext::CertificateValidationContext::Empty() const {
- return match_subject_alt_names.empty();
-}
-
-//
-// XdsApi::CommonTlsContext::CertificateValidationContext
-//
-
-std::string XdsApi::CommonTlsContext::CertificateProviderInstance::ToString()
- const {
- absl::InlinedVector<std::string, 2> contents;
- if (!instance_name.empty()) {
- contents.push_back(absl::StrFormat("instance_name=%s", instance_name));
- }
- if (!certificate_name.empty()) {
- contents.push_back(
- absl::StrFormat("certificate_name=%s", certificate_name));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-bool XdsApi::CommonTlsContext::CertificateProviderInstance::Empty() const {
- return instance_name.empty() && certificate_name.empty();
-}
-
-//
-// XdsApi::CommonTlsContext::CombinedCertificateValidationContext
-//
-
-std::string
-XdsApi::CommonTlsContext::CombinedCertificateValidationContext::ToString()
- const {
- absl::InlinedVector<std::string, 2> contents;
- if (!default_validation_context.Empty()) {
- contents.push_back(absl::StrFormat("default_validation_context=%s",
- default_validation_context.ToString()));
- }
- if (!validation_context_certificate_provider_instance.Empty()) {
- contents.push_back(absl::StrFormat(
- "validation_context_certificate_provider_instance=%s",
- validation_context_certificate_provider_instance.ToString()));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-bool XdsApi::CommonTlsContext::CombinedCertificateValidationContext::Empty()
- const {
- return default_validation_context.Empty() &&
- validation_context_certificate_provider_instance.Empty();
-}
-
-//
-// XdsApi::CommonTlsContext
-//
-
-std::string XdsApi::CommonTlsContext::ToString() const {
- absl::InlinedVector<std::string, 2> contents;
- if (!tls_certificate_certificate_provider_instance.Empty()) {
- contents.push_back(absl::StrFormat(
- "tls_certificate_certificate_provider_instance=%s",
- tls_certificate_certificate_provider_instance.ToString()));
- }
- if (!combined_validation_context.Empty()) {
- contents.push_back(absl::StrFormat("combined_validation_context=%s",
- combined_validation_context.ToString()));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-bool XdsApi::CommonTlsContext::Empty() const {
- return tls_certificate_certificate_provider_instance.Empty() &&
- combined_validation_context.Empty();
-}
-
-//
-// XdsApi::DownstreamTlsContext
-//
-
-std::string XdsApi::DownstreamTlsContext::ToString() const {
- return absl::StrFormat("common_tls_context=%s, require_client_certificate=%s",
- common_tls_context.ToString(),
- require_client_certificate ? "true" : "false");
-}
-
-bool XdsApi::DownstreamTlsContext::Empty() const {
- return common_tls_context.Empty();
-}
-
-//
-// XdsApi::LdsUpdate::HttpConnectionManager
-//
-
-std::string XdsApi::LdsUpdate::HttpConnectionManager::ToString() const {
- absl::InlinedVector<std::string, 4> contents;
- contents.push_back(absl::StrFormat(
- "route_config_name=%s",
- !route_config_name.empty() ? route_config_name.c_str() : "<inlined>"));
- contents.push_back(absl::StrFormat("http_max_stream_duration=%s",
- http_max_stream_duration.ToString()));
- if (rds_update.has_value()) {
- contents.push_back(
- absl::StrFormat("rds_update=%s", rds_update->ToString()));
- }
- if (!http_filters.empty()) {
- std::vector<std::string> filter_strings;
- for (const auto& http_filter : http_filters) {
- filter_strings.push_back(http_filter.ToString());
- }
- contents.push_back(absl::StrCat("http_filters=[",
- absl::StrJoin(filter_strings, ", "), "]"));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::LdsUpdate::HttpFilter
-//
-
-std::string XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter::ToString()
- const {
- return absl::StrCat("{name=", name, ", config=", config.ToString(), "}");
-}
-
-//
-// XdsApi::LdsUpdate::FilterChainData
-//
-
-std::string XdsApi::LdsUpdate::FilterChainData::ToString() const {
- return absl::StrCat(
- "{downstream_tls_context=", downstream_tls_context.ToString(),
- " http_connection_manager=", http_connection_manager.ToString(), "}");
-}
-
-//
-// XdsApi::LdsUpdate::FilterChainMap::CidrRange
-//
-
-std::string XdsApi::LdsUpdate::FilterChainMap::CidrRange::ToString() const {
- return absl::StrCat(
- "{address_prefix=", grpc_sockaddr_to_string(&address, false),
- ", prefix_len=", prefix_len, "}");
-}
-
-//
-// FilterChain
-//
-
-struct FilterChain {
- struct FilterChainMatch {
- uint32_t destination_port = 0;
- std::vector<XdsApi::LdsUpdate::FilterChainMap::CidrRange> prefix_ranges;
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType source_type =
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType::kAny;
- std::vector<XdsApi::LdsUpdate::FilterChainMap::CidrRange>
- source_prefix_ranges;
- std::vector<uint32_t> source_ports;
- std::vector<std::string> server_names;
- std::string transport_protocol;
- std::vector<std::string> application_protocols;
-
- std::string ToString() const;
- } filter_chain_match;
-
- std::shared_ptr<XdsApi::LdsUpdate::FilterChainData> filter_chain_data;
-};
-
-std::string FilterChain::FilterChainMatch::ToString() const {
- absl::InlinedVector<std::string, 8> contents;
- if (destination_port != 0) {
- contents.push_back(absl::StrCat("destination_port=", destination_port));
- }
- if (!prefix_ranges.empty()) {
- std::vector<std::string> prefix_ranges_content;
- for (const auto& range : prefix_ranges) {
- prefix_ranges_content.push_back(range.ToString());
- }
- contents.push_back(absl::StrCat(
- "prefix_ranges={", absl::StrJoin(prefix_ranges_content, ", "), "}"));
- }
- if (source_type == XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType::
- kSameIpOrLoopback) {
- contents.push_back("source_type=SAME_IP_OR_LOOPBACK");
- } else if (source_type == XdsApi::LdsUpdate::FilterChainMap::
- ConnectionSourceType::kExternal) {
- contents.push_back("source_type=EXTERNAL");
- }
- if (!source_prefix_ranges.empty()) {
- std::vector<std::string> source_prefix_ranges_content;
- for (const auto& range : source_prefix_ranges) {
- source_prefix_ranges_content.push_back(range.ToString());
- }
- contents.push_back(
- absl::StrCat("source_prefix_ranges={",
- absl::StrJoin(source_prefix_ranges_content, ", "), "}"));
- }
- if (!source_ports.empty()) {
- contents.push_back(
- absl::StrCat("source_ports={", absl::StrJoin(source_ports, ", "), "}"));
- }
- if (!server_names.empty()) {
- contents.push_back(
- absl::StrCat("server_names={", absl::StrJoin(server_names, ", "), "}"));
- }
- if (!transport_protocol.empty()) {
- contents.push_back(absl::StrCat("transport_protocol=", transport_protocol));
- }
- if (!application_protocols.empty()) {
- contents.push_back(absl::StrCat("application_protocols={",
- absl::StrJoin(application_protocols, ", "),
- "}"));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::LdsUpdate::FilterChainMap
-//
-
-std::string XdsApi::LdsUpdate::FilterChainMap::ToString() const {
- std::vector<std::string> contents;
- for (const auto& destination_ip : destination_ip_vector) {
- for (int source_type = 0; source_type < 3; ++source_type) {
- for (const auto& source_ip :
- destination_ip.source_types_array[source_type]) {
- for (const auto& source_port_pair : source_ip.ports_map) {
- FilterChain::FilterChainMatch filter_chain_match;
- if (destination_ip.prefix_range.has_value()) {
- filter_chain_match.prefix_ranges.push_back(
- *destination_ip.prefix_range);
- }
- filter_chain_match.source_type = static_cast<
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType>(
- source_type);
- if (source_ip.prefix_range.has_value()) {
- filter_chain_match.source_prefix_ranges.push_back(
- *source_ip.prefix_range);
- }
- if (source_port_pair.first != 0) {
- filter_chain_match.source_ports.push_back(source_port_pair.first);
- }
- contents.push_back(absl::StrCat(
- "{filter_chain_match=", filter_chain_match.ToString(),
- ", filter_chain=", source_port_pair.second.data->ToString(),
- "}"));
- }
- }
- }
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::LdsUpdate
-//
-
-std::string XdsApi::LdsUpdate::ToString() const {
- absl::InlinedVector<std::string, 4> contents;
- if (type == ListenerType::kTcpListener) {
- contents.push_back(absl::StrCat("address=", address));
- contents.push_back(
- absl::StrCat("filter_chain_map=", filter_chain_map.ToString()));
- if (default_filter_chain.has_value()) {
- contents.push_back(absl::StrCat("default_filter_chain=",
- default_filter_chain->ToString()));
- }
- } else if (type == ListenerType::kHttpApiListener) {
- contents.push_back(absl::StrFormat("http_connection_manager=%s",
- http_connection_manager.ToString()));
- }
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::CdsUpdate
-//
-
-std::string XdsApi::CdsUpdate::ToString() const {
- absl::InlinedVector<std::string, 4> contents;
- if (!eds_service_name.empty()) {
- contents.push_back(
- absl::StrFormat("eds_service_name=%s", eds_service_name));
- }
- if (!common_tls_context.Empty()) {
- contents.push_back(absl::StrFormat("common_tls_context=%s",
- common_tls_context.ToString()));
- }
- if (lrs_load_reporting_server_name.has_value()) {
- contents.push_back(absl::StrFormat("lrs_load_reporting_server_name=%s",
- lrs_load_reporting_server_name.value()));
- }
- contents.push_back(
- absl::StrFormat("max_concurrent_requests=%d", max_concurrent_requests));
- return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
-}
-
-//
-// XdsApi::EdsUpdate
-//
-
-std::string XdsApi::EdsUpdate::Priority::Locality::ToString() const {
- std::vector<std::string> endpoint_strings;
- for (const ServerAddress& endpoint : endpoints) {
- endpoint_strings.emplace_back(endpoint.ToString());
- }
- return absl::StrCat("{name=", name->AsHumanReadableString(),
- ", lb_weight=", lb_weight, ", endpoints=[",
- 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;
-}
-
-std::string XdsApi::EdsUpdate::Priority::ToString() const {
- std::vector<std::string> locality_strings;
- for (const auto& p : localities) {
- locality_strings.emplace_back(p.second.ToString());
- }
- return absl::StrCat("[", absl::StrJoin(locality_strings, ", "), "]");
-}
-
-bool XdsApi::EdsUpdate::DropConfig::ShouldDrop(
- const std::string** 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;
-}
-
-std::string XdsApi::EdsUpdate::DropConfig::ToString() const {
- std::vector<std::string> category_strings;
- for (const DropCategory& category : drop_category_list_) {
- category_strings.emplace_back(
- absl::StrCat(category.name, "=", category.parts_per_million));
- }
- return absl::StrCat("{[", absl::StrJoin(category_strings, ", "),
- "], drop_all=", drop_all_, "}");
-}
-
-std::string XdsApi::EdsUpdate::ToString() const {
- std::vector<std::string> priority_strings;
- for (size_t i = 0; i < priorities.size(); ++i) {
- const Priority& priority = priorities[i];
- priority_strings.emplace_back(
- absl::StrCat("priority ", i, ": ", priority.ToString()));
- }
- return absl::StrCat("priorities=[", 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(absl::string_view type_url, bool* is_v2 = nullptr) {
- if (type_url == XdsApi::kLdsTypeUrl) return true;
- if (type_url == kLdsV2TypeUrl) {
- if (is_v2 != nullptr) *is_v2 = true;
- return true;
- }
- return false;
-}
-
-bool IsRds(absl::string_view type_url) {
- return type_url == XdsApi::kRdsTypeUrl || type_url == kRdsV2TypeUrl;
-}
-
-bool IsCds(absl::string_view type_url) {
- return type_url == XdsApi::kCdsTypeUrl || type_url == kCdsV2TypeUrl;
-}
-
-bool IsEds(absl::string_view type_url) {
- return type_url == XdsApi::kEdsTypeUrl || type_url == kEdsV2TypeUrl;
-}
-
-} // namespace
+// If gRPC is built with -DGRPC_XDS_USER_AGENT_NAME_SUFFIX="...", that string
+// will be appended to the user agent name reported to the xDS server.
+#ifdef GRPC_XDS_USER_AGENT_NAME_SUFFIX
+#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING \
+ " " GRPC_XDS_USER_AGENT_NAME_SUFFIX
+#else
+#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING ""
+#endif
+
+// If gRPC is built with -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="...", that string
+// will be appended to the user agent version reported to the xDS server.
+#ifdef GRPC_XDS_USER_AGENT_VERSION_SUFFIX
+#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING \
+ " " GRPC_XDS_USER_AGENT_VERSION_SUFFIX
+#else
+#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING ""
+#endif
XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
- const XdsBootstrap::Node* node)
+ const XdsBootstrap::Node* node,
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map,
+ upb::SymbolTable* symtab)
: client_(client),
tracer_(tracer),
node_(node),
+ certificate_provider_definition_map_(certificate_provider_definition_map),
+ symtab_(symtab),
build_version_(absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, " ",
- grpc_version_string())),
- user_agent_name_(absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING)) {
- // Populate upb symtab with xDS proto messages that we want to print
- // properly in logs.
- // Note: This won't actually work properly until upb adds support for
- // Any fields in textproto printing (internal b/178821188).
- envoy_config_listener_v3_Listener_getmsgdef(symtab_.ptr());
- envoy_config_route_v3_RouteConfiguration_getmsgdef(symtab_.ptr());
- envoy_config_cluster_v3_Cluster_getmsgdef(symtab_.ptr());
- envoy_extensions_clusters_aggregate_v3_ClusterConfig_getmsgdef(symtab_.ptr());
- envoy_config_cluster_v3_Cluster_getmsgdef(symtab_.ptr());
- envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(symtab_.ptr());
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_getmsgdef(
- symtab_.ptr());
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(
- symtab_.ptr());
- // Load HTTP filter proto messages into the upb symtab.
- XdsHttpFilterRegistry::PopulateSymtab(symtab_.ptr());
-}
+ grpc_version_string(),
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
+ GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)),
+ user_agent_name_(absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING,
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING)),
+ user_agent_version_(
+ absl::StrCat("C-core ", grpc_version_string(),
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
+ GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)) {}
namespace {
-struct EncodingContext {
- XdsClient* client;
- TraceFlag* tracer;
- upb_symtab* symtab;
- upb_arena* arena;
- bool use_v3;
-};
-
-// Works for both std::string and absl::string_view.
-template <typename T>
-inline upb_strview StdStringToUpbString(const T& str) {
- return upb_strview_make(str.data(), str.size());
-}
-
-void PopulateMetadataValue(const EncodingContext& context,
+void PopulateMetadataValue(const XdsEncodingContext& context,
google_protobuf_Value* value_pb, const Json& value);
-void PopulateListValue(const EncodingContext& context,
+void PopulateListValue(const XdsEncodingContext& context,
google_protobuf_ListValue* list_value,
const Json::Array& values) {
for (const auto& value : values) {
@@ -885,7 +116,7 @@ void PopulateListValue(const EncodingContext& context,
}
}
-void PopulateMetadata(const EncodingContext& context,
+void PopulateMetadata(const XdsEncodingContext& context,
google_protobuf_Struct* metadata_pb,
const Json::Object& metadata) {
for (const auto& p : metadata) {
@@ -896,7 +127,7 @@ void PopulateMetadata(const EncodingContext& context,
}
}
-void PopulateMetadataValue(const EncodingContext& context,
+void PopulateMetadataValue(const XdsEncodingContext& context,
google_protobuf_Value* value_pb, const Json& value) {
switch (value.type()) {
case Json::Type::JSON_NULL:
@@ -952,22 +183,23 @@ std::string EncodeStringField(uint32_t field_number, const std::string& str) {
EncodeVarint(str.size()) + str;
}
-void PopulateBuildVersion(const EncodingContext& context,
+void PopulateBuildVersion(const XdsEncodingContext& context,
envoy_config_core_v3_Node* node_msg,
const std::string& build_version) {
std::string encoded_build_version = EncodeStringField(5, build_version);
- // TODO(roth): This should use upb_msg_addunknown(), but that API is
+ // TODO(roth): This should use upb_Message_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(), context.arena);
+ _upb_Message_AddUnknown(node_msg, encoded_build_version.data(),
+ encoded_build_version.size(), context.arena);
}
-void PopulateNode(const EncodingContext& context,
+void PopulateNode(const XdsEncodingContext& context,
const XdsBootstrap::Node* node,
const std::string& build_version,
const std::string& user_agent_name,
+ const std::string& user_agent_version,
envoy_config_core_v3_Node* node_msg) {
if (node != nullptr) {
if (!node->id.empty()) {
@@ -1007,36 +239,29 @@ void PopulateNode(const EncodingContext& context,
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()));
+ node_msg, StdStringToUpbString(user_agent_version));
envoy_config_core_v3_Node_add_client_features(
- node_msg, upb_strview_makez("envoy.lb.does_not_support_overprovisioning"),
+ node_msg,
+ upb_StringView_FromString("envoy.lb.does_not_support_overprovisioning"),
context.arena);
}
-inline absl::string_view UpbStringToAbsl(const upb_strview& str) {
- return absl::string_view(str.data, str.size);
-}
-
-inline std::string UpbStringToStdString(const upb_strview& str) {
- return std::string(str.data, str.size);
-}
-
void MaybeLogDiscoveryRequest(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
const envoy_service_discovery_v3_DiscoveryRequest* request) {
if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
+ const upb_MessageDef* msg_type =
envoy_service_discovery_v3_DiscoveryRequest_getmsgdef(context.symtab);
char buf[10240];
- upb_text_encode(request, msg_type, nullptr, 0, buf, sizeof(buf));
+ upb_TextEncode(request, msg_type, nullptr, 0, buf, sizeof(buf));
gpr_log(GPR_DEBUG, "[xds_client %p] constructed ADS request: %s",
context.client, buf);
}
}
grpc_slice SerializeDiscoveryRequest(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
envoy_service_discovery_v3_DiscoveryRequest* request) {
size_t output_length;
char* output = envoy_service_discovery_v3_DiscoveryRequest_serialize(
@@ -1044,43 +269,28 @@ grpc_slice SerializeDiscoveryRequest(
return grpc_slice_from_copied_buffer(output, output_length);
}
-absl::string_view TypeUrlExternalToInternal(bool use_v3,
- const std::string& 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 XdsBootstrap::XdsServer& server, const std::string& type_url,
- const std::set<absl::string_view>& resource_names,
- const std::string& version, const std::string& nonce,
- grpc_error_handle error, bool populate_node) {
+ const XdsBootstrap::XdsServer& server, absl::string_view type_url,
+ absl::string_view version, absl::string_view nonce,
+ const std::vector<std::string>& resource_names, grpc_error_handle error,
+ bool populate_node) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const XdsEncodingContext context = {client_,
+ server,
+ tracer_,
+ symtab_->ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// Create a request.
envoy_service_discovery_v3_DiscoveryRequest* request =
envoy_service_discovery_v3_DiscoveryRequest_new(arena.ptr());
// Set type_url.
- absl::string_view real_type_url =
- TypeUrlExternalToInternal(server.ShouldUseV3(), type_url);
+ std::string type_url_str = absl::StrCat("type.googleapis.com/", type_url);
envoy_service_discovery_v3_DiscoveryRequest_set_type_url(
- request, StdStringToUpbString(real_type_url));
+ request, StdStringToUpbString(type_url_str));
// Set version_info.
if (!version.empty()) {
envoy_service_discovery_v3_DiscoveryRequest_set_version_info(
@@ -1104,7 +314,8 @@ grpc_slice XdsApi::CreateAdsRequest(
google_rpc_Status_set_code(error_detail, GRPC_STATUS_INVALID_ARGUMENT);
// Error description comes from the error that was passed in.
error_string_storage = grpc_error_std_string(error);
- upb_strview error_description = StdStringToUpbString(error_string_storage);
+ upb_StringView error_description =
+ StdStringToUpbString(error_string_storage);
google_rpc_Status_set_message(error_detail, error_description);
GRPC_ERROR_UNREF(error);
}
@@ -1113,10 +324,14 @@ grpc_slice XdsApi::CreateAdsRequest(
envoy_config_core_v3_Node* node_msg =
envoy_service_discovery_v3_DiscoveryRequest_mutable_node(request,
arena.ptr());
- PopulateNode(context, node_, build_version_, user_agent_name_, node_msg);
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node_msg);
+ envoy_config_core_v3_Node_add_client_features(
+ node_msg, upb_StringView_FromString("xds.config.resource-in-sotw"),
+ context.arena);
}
// Add resource_names.
- for (const auto& resource_name : resource_names) {
+ for (const std::string& resource_name : resource_names) {
envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(
request, StdStringToUpbString(resource_name), arena.ptr());
}
@@ -1127,2220 +342,106 @@ grpc_slice XdsApi::CreateAdsRequest(
namespace {
void MaybeLogDiscoveryResponse(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
const envoy_service_discovery_v3_DiscoveryResponse* response) {
if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
+ const upb_MessageDef* msg_type =
envoy_service_discovery_v3_DiscoveryResponse_getmsgdef(context.symtab);
char buf[10240];
- upb_text_encode(response, msg_type, nullptr, 0, buf, sizeof(buf));
+ upb_TextEncode(response, msg_type, nullptr, 0, buf, sizeof(buf));
gpr_log(GPR_DEBUG, "[xds_client %p] received response: %s", context.client,
buf);
}
}
-void MaybeLogHttpConnectionManager(
- const EncodingContext& context,
- const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
- http_connection_manager_config) {
- if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(
- context.symtab);
- char buf[10240];
- upb_text_encode(http_connection_manager_config, msg_type, nullptr, 0, buf,
- sizeof(buf));
- gpr_log(GPR_DEBUG, "[xds_client %p] HttpConnectionManager: %s",
- context.client, buf);
- }
-}
-
-void MaybeLogRouteConfiguration(
- const EncodingContext& context,
- const envoy_config_route_v3_RouteConfiguration* route_config) {
- if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
- envoy_config_route_v3_RouteConfiguration_getmsgdef(context.symtab);
- char buf[10240];
- upb_text_encode(route_config, msg_type, nullptr, 0, buf, sizeof(buf));
- gpr_log(GPR_DEBUG, "[xds_client %p] RouteConfiguration: %s", context.client,
- buf);
- }
-}
-
-void MaybeLogCluster(const EncodingContext& context,
- const envoy_config_cluster_v3_Cluster* cluster) {
- if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
- envoy_config_cluster_v3_Cluster_getmsgdef(context.symtab);
- char buf[10240];
- upb_text_encode(cluster, msg_type, nullptr, 0, buf, sizeof(buf));
- gpr_log(GPR_DEBUG, "[xds_client %p] Cluster: %s", context.client, buf);
- }
-}
-
-void MaybeLogClusterLoadAssignment(
- const EncodingContext& context,
- const envoy_config_endpoint_v3_ClusterLoadAssignment* cla) {
- if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
- gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
- envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(
- context.symtab);
- char buf[10240];
- upb_text_encode(cla, msg_type, nullptr, 0, buf, sizeof(buf));
- gpr_log(GPR_DEBUG, "[xds_client %p] ClusterLoadAssignment: %s",
- context.client, buf);
- }
-}
-
-grpc_error_handle RoutePathMatchParse(
- const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route,
- bool* ignore_route) {
- auto* case_sensitive_ptr =
- envoy_config_route_v3_RouteMatch_case_sensitive(match);
- bool case_sensitive = true;
- if (case_sensitive_ptr != nullptr) {
- case_sensitive = google_protobuf_BoolValue_value(case_sensitive_ptr);
- }
- StringMatcher::Type type;
- std::string match_string;
- if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
- absl::string_view prefix =
- UpbStringToAbsl(envoy_config_route_v3_RouteMatch_prefix(match));
- // Empty prefix "" is accepted.
- if (!prefix.empty()) {
- // 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<absl::string_view> prefix_elements =
- absl::StrSplit(prefix.substr(1), 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;
- }
- }
- type = StringMatcher::Type::kPrefix;
- match_string = std::string(prefix);
- } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
- absl::string_view path =
- UpbStringToAbsl(envoy_config_route_v3_RouteMatch_path(match));
- if (path.empty()) {
- // 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<absl::string_view> path_elements =
- absl::StrSplit(path.substr(1), 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;
- }
- type = StringMatcher::Type::kExact;
- match_string = std::string(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);
- type = StringMatcher::Type::kSafeRegex;
- match_string = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid route path specifier specified.");
- }
- absl::StatusOr<StringMatcher> string_matcher =
- StringMatcher::Create(type, match_string, case_sensitive);
- if (!string_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("path matcher: ", string_matcher.status().message())
- .c_str());
- ;
- }
- route->matchers.path_matcher = std::move(string_matcher.value());
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle 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];
- const std::string name =
- UpbStringToStdString(envoy_config_route_v3_HeaderMatcher_name(header));
- HeaderMatcher::Type type;
- std::string match_string;
- int64_t range_start = 0;
- int64_t range_end = 0;
- bool present_match = false;
- if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
- type = HeaderMatcher::Type::kExact;
- match_string = 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);
- type = HeaderMatcher::Type::kSafeRegex;
- match_string = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- } else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
- type = HeaderMatcher::Type::kRange;
- const envoy_type_v3_Int64Range* range_matcher =
- envoy_config_route_v3_HeaderMatcher_range_match(header);
- range_start = envoy_type_v3_Int64Range_start(range_matcher);
- range_end = envoy_type_v3_Int64Range_end(range_matcher);
- } else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
- type = HeaderMatcher::Type::kPresent;
- present_match = envoy_config_route_v3_HeaderMatcher_present_match(header);
- } else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
- type = HeaderMatcher::Type::kPrefix;
- match_string = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_prefix_match(header));
- } else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
- type = HeaderMatcher::Type::kSuffix;
- match_string = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_suffix_match(header));
- } else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
- type = HeaderMatcher::Type::kContains;
- match_string = UpbStringToStdString(
- envoy_config_route_v3_HeaderMatcher_contains_match(header));
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid route header matcher specified.");
- }
- bool invert_match =
- envoy_config_route_v3_HeaderMatcher_invert_match(header);
- absl::StatusOr<HeaderMatcher> header_matcher =
- HeaderMatcher::Create(name, type, match_string, range_start, range_end,
- present_match, invert_match);
- if (!header_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("header matcher: ", header_matcher.status().message())
- .c_str());
- }
- route->matchers.header_matchers.emplace_back(
- std::move(header_matcher.value()));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle 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_handle ExtractHttpFilterTypeName(const EncodingContext& context,
- const google_protobuf_Any* any,
- absl::string_view* filter_type) {
- *filter_type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
- if (*filter_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
- upb_strview any_value = google_protobuf_Any_value(any);
- const auto* typed_struct = udpa_type_v1_TypedStruct_parse(
- any_value.data, any_value.size, context.arena);
- if (typed_struct == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "could not parse TypedStruct from filter config");
- }
- *filter_type =
- UpbStringToAbsl(udpa_type_v1_TypedStruct_type_url(typed_struct));
- }
- *filter_type = absl::StripPrefix(*filter_type, "type.googleapis.com/");
- return GRPC_ERROR_NONE;
-}
-
-template <typename ParentType, typename EntryType>
-grpc_error_handle ParseTypedPerFilterConfig(
- const EncodingContext& context, const ParentType* parent,
- const EntryType* (*entry_func)(const ParentType*, size_t*),
- upb_strview (*key_func)(const EntryType*),
- const google_protobuf_Any* (*value_func)(const EntryType*),
- XdsApi::TypedPerFilterConfig* typed_per_filter_config) {
- size_t filter_it = UPB_MAP_BEGIN;
- while (true) {
- const auto* filter_entry = entry_func(parent, &filter_it);
- if (filter_entry == nullptr) break;
- absl::string_view key = UpbStringToAbsl(key_func(filter_entry));
- if (key.empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("empty filter name in map");
- }
- const google_protobuf_Any* any = value_func(filter_entry);
- GPR_ASSERT(any != nullptr);
- absl::string_view filter_type =
- UpbStringToAbsl(google_protobuf_Any_type_url(any));
- if (filter_type.empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("no filter config specified for filter name ", key)
- .c_str());
- }
- bool is_optional = false;
- if (filter_type ==
- "type.googleapis.com/envoy.config.route.v3.FilterConfig") {
- upb_strview any_value = google_protobuf_Any_value(any);
- const auto* filter_config = envoy_config_route_v3_FilterConfig_parse(
- any_value.data, any_value.size, context.arena);
- if (filter_config == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("could not parse FilterConfig wrapper for ", key)
- .c_str());
- }
- is_optional =
- envoy_config_route_v3_FilterConfig_is_optional(filter_config);
- any = envoy_config_route_v3_FilterConfig_config(filter_config);
- if (any == nullptr) {
- if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("no filter config specified for filter name ", key)
- .c_str());
- }
- }
- grpc_error_handle error =
- ExtractHttpFilterTypeName(context, any, &filter_type);
- if (error != GRPC_ERROR_NONE) return error;
- const XdsHttpFilterImpl* filter_impl =
- XdsHttpFilterRegistry::GetFilterForType(filter_type);
- if (filter_impl == nullptr) {
- if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("no filter registered for config type ", filter_type)
- .c_str());
- }
- absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
- filter_impl->GenerateFilterConfigOverride(
- google_protobuf_Any_value(any), context.arena);
- if (!filter_config.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("filter config for type ", filter_type,
- " failed to parse: ", filter_config.status().ToString())
- .c_str());
- }
- (*typed_per_filter_config)[std::string(key)] = std::move(*filter_config);
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle RouteActionParse(const EncodingContext& context,
- 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.empty()) {
- 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);
- if (cluster.weight == 0) continue;
- sum_of_weights += cluster.weight;
- if (context.use_v3) {
- grpc_error_handle error = ParseTypedPerFilterConfig<
- envoy_config_route_v3_WeightedCluster_ClusterWeight,
- envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
- context, cluster_weight,
- envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next,
- envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_key,
- envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_value,
- &cluster.typed_per_filter_config);
- if (error != GRPC_ERROR_NONE) return error;
- }
- 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;
- }
- if (!*ignore_route) {
- const envoy_config_route_v3_RouteAction_MaxStreamDuration*
- max_stream_duration =
- envoy_config_route_v3_RouteAction_max_stream_duration(route_action);
- if (max_stream_duration != nullptr) {
- const google_protobuf_Duration* duration =
- envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(
- max_stream_duration);
- if (duration == nullptr) {
- duration =
- envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(
- max_stream_duration);
- }
- if (duration != nullptr) {
- XdsApi::Duration duration_in_route;
- duration_in_route.seconds = google_protobuf_Duration_seconds(duration);
- duration_in_route.nanos = google_protobuf_Duration_nanos(duration);
- route->max_stream_duration = duration_in_route;
- }
- }
- }
- // Get HashPolicy from RouteAction
- if (XdsRingHashEnabled()) {
- size_t size = 0;
- const envoy_config_route_v3_RouteAction_HashPolicy* const* hash_policies =
- envoy_config_route_v3_RouteAction_hash_policy(route_action, &size);
- for (size_t i = 0; i < size; ++i) {
- const envoy_config_route_v3_RouteAction_HashPolicy* hash_policy =
- hash_policies[i];
- XdsApi::Route::HashPolicy policy;
- policy.terminal =
- envoy_config_route_v3_RouteAction_HashPolicy_terminal(hash_policy);
- const envoy_config_route_v3_RouteAction_HashPolicy_Header* header;
- const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*
- filter_state;
- if ((header = envoy_config_route_v3_RouteAction_HashPolicy_header(
- hash_policy)) != nullptr) {
- policy.type = XdsApi::Route::HashPolicy::Type::HEADER;
- policy.header_name = UpbStringToStdString(
- envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(
- header));
- const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*
- regex_rewrite =
- envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(
- header);
- if (regex_rewrite == nullptr) {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier Header with "
- "RegexMatchAndSubstitution but Regex is missing");
- continue;
- }
- const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
- envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(
- regex_rewrite);
- if (regex_matcher == nullptr) {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier Header with "
- "RegexMatchAndSubstitution but RegexMatcher pattern is "
- "missing");
- continue;
- }
- RE2::Options options;
- policy.regex = absl::make_unique<RE2>(
- UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)),
- options);
- if (!policy.regex->ok()) {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier Header with "
- "RegexMatchAndSubstitution but RegexMatcher pattern does not "
- "compile");
- continue;
- }
- policy.regex_substitution = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(
- regex_rewrite));
- } else if ((filter_state =
- envoy_config_route_v3_RouteAction_HashPolicy_filter_state(
- hash_policy)) != nullptr) {
- std::string key = UpbStringToStdString(
- envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(
- filter_state));
- if (key == "io.grpc.channel_id") {
- policy.type = XdsApi::Route::HashPolicy::Type::CHANNEL_ID;
- } else {
- gpr_log(GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier "
- "FilterState but "
- "key is not io.grpc.channel_id.");
- continue;
- }
- } else {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains unsupported policy specifier.");
- continue;
- }
- route->hash_policies.emplace_back(std::move(policy));
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle RouteConfigParse(
- const EncodingContext& context,
- const envoy_config_route_v3_RouteConfiguration* route_config,
- XdsApi::RdsUpdate* rds_update) {
- MaybeLogRouteConfiguration(context, route_config);
- // Get the 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) {
- 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) {
- std::string domain_pattern = UpbStringToStdString(domains[j]);
- const MatchType match_type = DomainPatternMatchType(domain_pattern);
- if (match_type == INVALID_MATCH) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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 typed_per_filter_config.
- if (context.use_v3) {
- grpc_error_handle error = ParseTypedPerFilterConfig<
- envoy_config_route_v3_VirtualHost,
- envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
- context, virtual_hosts[i],
- envoy_config_route_v3_VirtualHost_typed_per_filter_config_next,
- envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_key,
- envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_value,
- &vhost.typed_per_filter_config);
- if (error != GRPC_ERROR_NONE) return error;
- }
- // 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]);
- if (match == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Match can't be null.");
- }
- 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_handle 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(context, routes[j], &route, &ignore_route);
- if (error != GRPC_ERROR_NONE) return error;
- if (ignore_route) continue;
- if (context.use_v3) {
- grpc_error_handle error = ParseTypedPerFilterConfig<
- envoy_config_route_v3_Route,
- envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
- context, routes[j],
- envoy_config_route_v3_Route_typed_per_filter_config_next,
- envoy_config_route_v3_Route_TypedPerFilterConfigEntry_key,
- envoy_config_route_v3_Route_TypedPerFilterConfigEntry_value,
- &route.typed_per_filter_config);
- if (error != GRPC_ERROR_NONE) return error;
- }
- 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;
-}
-
-XdsApi::CommonTlsContext::CertificateProviderInstance
-CertificateProviderInstanceParse(
- const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*
- certificate_provider_instance_proto) {
- return {
- UpbStringToStdString(
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
- certificate_provider_instance_proto)),
- UpbStringToStdString(
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(
- certificate_provider_instance_proto))};
-}
-
-grpc_error_handle CommonTlsContextParse(
- const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
- common_tls_context_proto,
- XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
-grpc_error_handle 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) {
- StringMatcher::Type type;
- std::string matcher;
- if (envoy_type_matcher_v3_StringMatcher_has_exact(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::kExact;
- 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])) {
- type = StringMatcher::Type::kPrefix;
- 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])) {
- type = StringMatcher::Type::kSuffix;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_contains(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::kContains;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::kSafeRegex;
- auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
- subject_alt_names_matchers[i]);
- matcher = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid StringMatcher specified");
- }
- bool ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
- subject_alt_names_matchers[i]);
- absl::StatusOr<StringMatcher> string_matcher =
- StringMatcher::Create(type, matcher,
- /*case_sensitive=*/!ignore_case);
- if (!string_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("string matcher: ",
- string_matcher.status().message())
- .c_str());
- }
- if (type == StringMatcher::Type::kSafeRegex && ignore_case) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "StringMatcher: ignore_case has no effect for SAFE_REGEX.");
- }
- common_tls_context->combined_validation_context
- .default_validation_context.match_subject_alt_names.push_back(
- std::move(string_matcher.value()));
- }
- }
- 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 =
- CertificateProviderInstanceParse(
- 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 =
- CertificateProviderInstanceParse(
- tls_certificate_certificate_provider_instance);
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle HttpConnectionManagerParse(
- bool is_client, const EncodingContext& context,
- const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
- http_connection_manager_proto,
- bool is_v2,
- XdsApi::LdsUpdate::HttpConnectionManager* http_connection_manager) {
- MaybeLogHttpConnectionManager(context, http_connection_manager_proto);
- // Obtain max_stream_duration from Http Protocol Options.
- const envoy_config_core_v3_HttpProtocolOptions* options =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(
- http_connection_manager_proto);
- if (options != nullptr) {
- const google_protobuf_Duration* duration =
- envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(options);
- if (duration != nullptr) {
- http_connection_manager->http_max_stream_duration.seconds =
- google_protobuf_Duration_seconds(duration);
- http_connection_manager->http_max_stream_duration.nanos =
- google_protobuf_Duration_nanos(duration);
- }
- }
- // Parse filters.
- if (!is_v2) {
- size_t num_filters = 0;
- const auto* http_filters =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(
- http_connection_manager_proto, &num_filters);
- std::set<absl::string_view> names_seen;
- for (size_t i = 0; i < num_filters; ++i) {
- const auto* http_filter = http_filters[i];
- absl::string_view name = UpbStringToAbsl(
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(
- http_filter));
- if (name.empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("empty filter name at index ", i).c_str());
- }
- if (names_seen.find(name) != names_seen.end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("duplicate HTTP filter name: ", name).c_str());
- }
- names_seen.insert(name);
- const bool is_optional =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(
- http_filter);
- const google_protobuf_Any* any =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(
- http_filter);
- if (any == nullptr) {
- if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("no filter config specified for filter name ", name)
- .c_str());
- }
- absl::string_view filter_type;
- grpc_error_handle error =
- ExtractHttpFilterTypeName(context, any, &filter_type);
- if (error != GRPC_ERROR_NONE) return error;
- const XdsHttpFilterImpl* filter_impl =
- XdsHttpFilterRegistry::GetFilterForType(filter_type);
- if (filter_impl == nullptr) {
- if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("no filter registered for config type ", filter_type)
- .c_str());
- }
- if ((is_client && !filter_impl->IsSupportedOnClients()) ||
- (!is_client && !filter_impl->IsSupportedOnServers())) {
- if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Filter %s is not supported on %s", filter_type,
- is_client ? "clients" : "servers")
- .c_str());
- }
- absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
- filter_impl->GenerateFilterConfig(google_protobuf_Any_value(any),
- context.arena);
- if (!filter_config.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- "filter config for type ", filter_type,
- " failed to parse: ", filter_config.status().ToString())
- .c_str());
- }
- http_connection_manager->http_filters.emplace_back(
- XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
- std::string(name), std::move(*filter_config)});
- }
- } else {
- // If using a v2 config, we just hard-code a list containing only the
- // router filter without actually looking at the config. This ensures
- // that the right thing happens in the xds resolver without having
- // to expose whether the resource we received was v2 or v3.
- http_connection_manager->http_filters.emplace_back(
- XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
- "router", {kXdsHttpRouterFilterConfigName, Json()}});
- }
- if (is_client) {
- // 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_proto)) {
- const envoy_config_route_v3_RouteConfiguration* route_config =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
- http_connection_manager_proto);
- XdsApi::RdsUpdate rds_update;
- grpc_error_handle error =
- RouteConfigParse(context, route_config, &rds_update);
- if (error != GRPC_ERROR_NONE) return error;
- http_connection_manager->rds_update = std::move(rds_update);
- return GRPC_ERROR_NONE;
- }
- // Validate that RDS must be used to get the route_config dynamically.
- const envoy_extensions_filters_network_http_connection_manager_v3_Rds* rds =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(
- http_connection_manager_proto);
- if (rds == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "HttpConnectionManager neither has inlined route_config nor RDS.");
- }
- // 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.
- http_connection_manager->route_config_name = UpbStringToStdString(
- envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(
- rds));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle LdsResponseParseClient(
- const EncodingContext& context,
- const envoy_config_listener_v3_ApiListener* api_listener, bool is_v2,
- XdsApi::LdsUpdate* lds_update) {
- lds_update->type = XdsApi::LdsUpdate::ListenerType::kHttpApiListener;
- const upb_strview encoded_api_listener = google_protobuf_Any_value(
- envoy_config_listener_v3_ApiListener_api_listener(api_listener));
- const auto* http_connection_manager =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
- encoded_api_listener.data, encoded_api_listener.size, context.arena);
- if (http_connection_manager == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Could not parse HttpConnectionManager config from ApiListener");
- }
- return HttpConnectionManagerParse(true /* is_client */, context,
- http_connection_manager, is_v2,
- &lds_update->http_connection_manager);
-}
-
-grpc_error_handle DownstreamTlsContextParse(
- const EncodingContext& context,
- const envoy_config_core_v3_TransportSocket* transport_socket,
- XdsApi::DownstreamTlsContext* downstream_tls_context) {
- absl::string_view name = UpbStringToAbsl(
- envoy_config_core_v3_TransportSocket_name(transport_socket));
- if (name == "envoy.transport_sockets.tls") {
- auto* typed_config =
- envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
- if (typed_config != nullptr) {
- const upb_strview encoded_downstream_tls_context =
- google_protobuf_Any_value(typed_config);
- auto* downstream_tls_context_proto =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(
- encoded_downstream_tls_context.data,
- encoded_downstream_tls_context.size, context.arena);
- if (downstream_tls_context_proto == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Can't decode downstream tls context.");
- }
- auto* common_tls_context =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
- downstream_tls_context_proto);
- if (common_tls_context != nullptr) {
- grpc_error_handle error = CommonTlsContextParse(
- common_tls_context, &downstream_tls_context->common_tls_context);
- if (error != GRPC_ERROR_NONE) return error;
- }
- auto* require_client_certificate =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(
- downstream_tls_context_proto);
- if (require_client_certificate != nullptr) {
- downstream_tls_context->require_client_certificate =
- google_protobuf_BoolValue_value(require_client_certificate);
- }
- }
- if (downstream_tls_context->common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name
- .empty()) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "TLS configuration provided but no "
- "tls_certificate_certificate_provider_instance found.");
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle CidrRangeParse(
- const envoy_config_core_v3_CidrRange* cidr_range_proto,
- XdsApi::LdsUpdate::FilterChainMap::CidrRange* cidr_range) {
- std::string address_prefix = UpbStringToStdString(
- envoy_config_core_v3_CidrRange_address_prefix(cidr_range_proto));
- grpc_error_handle error =
- grpc_string_to_sockaddr(&cidr_range->address, address_prefix.c_str(), 0);
- if (error != GRPC_ERROR_NONE) return error;
- cidr_range->prefix_len = 0;
- auto* prefix_len_proto =
- envoy_config_core_v3_CidrRange_prefix_len(cidr_range_proto);
- if (prefix_len_proto != nullptr) {
- cidr_range->prefix_len = std::min(
- google_protobuf_UInt32Value_value(prefix_len_proto),
- (reinterpret_cast<const grpc_sockaddr*>(cidr_range->address.addr))
- ->sa_family == GRPC_AF_INET
- ? uint32_t(32)
- : uint32_t(128));
- }
- // Normalize the network address by masking it with prefix_len
- grpc_sockaddr_mask_bits(&cidr_range->address, cidr_range->prefix_len);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle FilterChainMatchParse(
- const envoy_config_listener_v3_FilterChainMatch* filter_chain_match_proto,
- FilterChain::FilterChainMatch* filter_chain_match) {
- auto* destination_port =
- envoy_config_listener_v3_FilterChainMatch_destination_port(
- filter_chain_match_proto);
- if (destination_port != nullptr) {
- filter_chain_match->destination_port =
- google_protobuf_UInt32Value_value(destination_port);
- }
- size_t size = 0;
- auto* prefix_ranges = envoy_config_listener_v3_FilterChainMatch_prefix_ranges(
- filter_chain_match_proto, &size);
- filter_chain_match->prefix_ranges.reserve(size);
- for (size_t i = 0; i < size; i++) {
- XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
- grpc_error_handle error = CidrRangeParse(prefix_ranges[i], &cidr_range);
- if (error != GRPC_ERROR_NONE) return error;
- filter_chain_match->prefix_ranges.push_back(cidr_range);
- }
- filter_chain_match->source_type =
- static_cast<XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType>(
- envoy_config_listener_v3_FilterChainMatch_source_type(
- filter_chain_match_proto));
- auto* source_prefix_ranges =
- envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(
- filter_chain_match_proto, &size);
- filter_chain_match->source_prefix_ranges.reserve(size);
- for (size_t i = 0; i < size; i++) {
- XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
- grpc_error_handle error =
- CidrRangeParse(source_prefix_ranges[i], &cidr_range);
- if (error != GRPC_ERROR_NONE) return error;
- filter_chain_match->source_prefix_ranges.push_back(cidr_range);
- }
- auto* source_ports = envoy_config_listener_v3_FilterChainMatch_source_ports(
- filter_chain_match_proto, &size);
- filter_chain_match->source_ports.reserve(size);
- for (size_t i = 0; i < size; i++) {
- filter_chain_match->source_ports.push_back(source_ports[i]);
- }
- auto* server_names = envoy_config_listener_v3_FilterChainMatch_server_names(
- filter_chain_match_proto, &size);
- for (size_t i = 0; i < size; i++) {
- filter_chain_match->server_names.push_back(
- UpbStringToStdString(server_names[i]));
- }
- filter_chain_match->transport_protocol = UpbStringToStdString(
- envoy_config_listener_v3_FilterChainMatch_transport_protocol(
- filter_chain_match_proto));
- auto* application_protocols =
- envoy_config_listener_v3_FilterChainMatch_application_protocols(
- filter_chain_match_proto, &size);
- for (size_t i = 0; i < size; i++) {
- filter_chain_match->application_protocols.push_back(
- UpbStringToStdString(application_protocols[i]));
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle FilterChainParse(
- const EncodingContext& context,
- const envoy_config_listener_v3_FilterChain* filter_chain_proto, bool is_v2,
- FilterChain* filter_chain) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- auto* filter_chain_match =
- envoy_config_listener_v3_FilterChain_filter_chain_match(
- filter_chain_proto);
- if (filter_chain_match != nullptr) {
- error = FilterChainMatchParse(filter_chain_match,
- &filter_chain->filter_chain_match);
- if (error != GRPC_ERROR_NONE) return error;
- }
- // Parse the filters list. Currently we only support HttpConnectionManager.
- size_t size = 0;
- auto* filters =
- envoy_config_listener_v3_FilterChain_filters(filter_chain_proto, &size);
- if (size != 1) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "FilterChain should have exactly one filter: HttpConnectionManager; no "
- "other filter is supported at the moment");
- }
- auto* typed_config = envoy_config_listener_v3_Filter_typed_config(filters[0]);
- if (typed_config == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No typed_config found in filter.");
- }
- absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(typed_config));
- if (type_url !=
- "type.googleapis.com/"
- "envoy.extensions.filters.network.http_connection_manager.v3."
- "HttpConnectionManager") {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Unsupported filter type ", type_url).c_str());
- }
- const upb_strview encoded_http_connection_manager =
- google_protobuf_Any_value(typed_config);
- const auto* http_connection_manager =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
- encoded_http_connection_manager.data,
- encoded_http_connection_manager.size, context.arena);
- if (http_connection_manager == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Could not parse HttpConnectionManager config from filter "
- "typed_config");
- }
- filter_chain->filter_chain_data =
- std::make_shared<XdsApi::LdsUpdate::FilterChainData>();
- error = HttpConnectionManagerParse(
- false /* is_client */, context, http_connection_manager, is_v2,
- &filter_chain->filter_chain_data->http_connection_manager);
- if (error != GRPC_ERROR_NONE) return error;
- // Get the DownstreamTlsContext for the filter chain
- if (XdsSecurityEnabled()) {
- auto* transport_socket =
- envoy_config_listener_v3_FilterChain_transport_socket(
- filter_chain_proto);
- if (transport_socket != nullptr) {
- error = DownstreamTlsContextParse(
- context, transport_socket,
- &filter_chain->filter_chain_data->downstream_tls_context);
- }
- }
- return error;
-}
-
-grpc_error_handle AddressParse(
- const envoy_config_core_v3_Address* address_proto, std::string* address) {
- const auto* socket_address =
- envoy_config_core_v3_Address_socket_address(address_proto);
- if (socket_address == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- "Address does not have socket_address");
- }
- if (envoy_config_core_v3_SocketAddress_protocol(socket_address) !=
- envoy_config_core_v3_SocketAddress_TCP) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "SocketAddress protocol is not TCP");
- }
- uint32_t port = envoy_config_core_v3_SocketAddress_port_value(socket_address);
- if (port > 65535) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port");
- }
- *address = JoinHostPort(
- UpbStringToAbsl(
- envoy_config_core_v3_SocketAddress_address(socket_address)),
- port);
- return GRPC_ERROR_NONE;
-}
-
-// An intermediate map for filter chains that we create to validate the list of
-// filter chains received from the control plane and to finally create
-// XdsApi::LdsUpdate::FilterChainMap
-struct InternalFilterChainMap {
- using SourceIpMap =
- std::map<std::string, XdsApi::LdsUpdate::FilterChainMap::SourceIp>;
- using ConnectionSourceTypesArray = std::array<SourceIpMap, 3>;
- struct DestinationIp {
- absl::optional<XdsApi::LdsUpdate::FilterChainMap::CidrRange> prefix_range;
- bool transport_protocol_raw_buffer_provided = false;
- ConnectionSourceTypesArray source_types_array;
- };
- using DestinationIpMap = std::map<std::string, DestinationIp>;
- DestinationIpMap destination_ip_map;
-};
-
-grpc_error_handle AddFilterChainDataForSourcePort(
- const FilterChain& filter_chain,
- XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map,
- uint32_t port) {
- auto insert_result = ports_map->emplace(
- port, XdsApi::LdsUpdate::FilterChainMap::FilterChainDataSharedPtr{
- filter_chain.filter_chain_data});
- if (!insert_result.second) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- "Duplicate matching rules detected when adding filter chain: ",
- filter_chain.filter_chain_match.ToString())
- .c_str());
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle AddFilterChainDataForSourcePorts(
- const FilterChain& filter_chain,
- XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map) {
- if (filter_chain.filter_chain_match.source_ports.empty()) {
- return AddFilterChainDataForSourcePort(filter_chain, ports_map, 0);
- } else {
- for (uint32_t port : filter_chain.filter_chain_match.source_ports) {
- grpc_error_handle error =
- AddFilterChainDataForSourcePort(filter_chain, ports_map, port);
- if (error != GRPC_ERROR_NONE) return error;
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle AddFilterChainDataForSourceIpRange(
- const FilterChain& filter_chain,
- InternalFilterChainMap::SourceIpMap* source_ip_map) {
- if (filter_chain.filter_chain_match.source_prefix_ranges.empty()) {
- auto insert_result = source_ip_map->emplace(
- "", XdsApi::LdsUpdate::FilterChainMap::SourceIp());
- return AddFilterChainDataForSourcePorts(
- filter_chain, &insert_result.first->second.ports_map);
- } else {
- for (const auto& prefix_range :
- filter_chain.filter_chain_match.source_prefix_ranges) {
- auto insert_result = source_ip_map->emplace(
- absl::StrCat(grpc_sockaddr_to_string(&prefix_range.address, false),
- "/", prefix_range.prefix_len),
- XdsApi::LdsUpdate::FilterChainMap::SourceIp());
- if (insert_result.second) {
- insert_result.first->second.prefix_range.emplace(prefix_range);
- }
- grpc_error_handle error = AddFilterChainDataForSourcePorts(
- filter_chain, &insert_result.first->second.ports_map);
- if (error != GRPC_ERROR_NONE) return error;
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle AddFilterChainDataForSourceType(
- const FilterChain& filter_chain,
- InternalFilterChainMap::DestinationIp* destination_ip) {
- GPR_ASSERT(static_cast<unsigned int>(
- filter_chain.filter_chain_match.source_type) < 3);
- return AddFilterChainDataForSourceIpRange(
- filter_chain, &destination_ip->source_types_array[static_cast<int>(
- filter_chain.filter_chain_match.source_type)]);
-}
-
-grpc_error_handle AddFilterChainDataForApplicationProtocols(
- const FilterChain& filter_chain,
- InternalFilterChainMap::DestinationIp* destination_ip) {
- // Only allow filter chains that do not mention application protocols
- if (!filter_chain.filter_chain_match.application_protocols.empty()) {
- return GRPC_ERROR_NONE;
- }
- return AddFilterChainDataForSourceType(filter_chain, destination_ip);
-}
-
-grpc_error_handle AddFilterChainDataForTransportProtocol(
- const FilterChain& filter_chain,
- InternalFilterChainMap::DestinationIp* destination_ip) {
- const std::string& transport_protocol =
- filter_chain.filter_chain_match.transport_protocol;
- // Only allow filter chains with no transport protocol or "raw_buffer"
- if (!transport_protocol.empty() && transport_protocol != "raw_buffer") {
- return GRPC_ERROR_NONE;
- }
- // If for this configuration, we've already seen filter chains that mention
- // the transport protocol as "raw_buffer", we will never match filter chains
- // that do not mention it.
- if (destination_ip->transport_protocol_raw_buffer_provided &&
- transport_protocol.empty()) {
- return GRPC_ERROR_NONE;
- }
- if (!transport_protocol.empty() &&
- !destination_ip->transport_protocol_raw_buffer_provided) {
- destination_ip->transport_protocol_raw_buffer_provided = true;
- // Clear out the previous entries if any since those entries did not mention
- // "raw_buffer"
- destination_ip->source_types_array =
- InternalFilterChainMap::ConnectionSourceTypesArray();
- }
- return AddFilterChainDataForApplicationProtocols(filter_chain,
- destination_ip);
-}
-
-grpc_error_handle AddFilterChainDataForServerNames(
- const FilterChain& filter_chain,
- InternalFilterChainMap::DestinationIp* destination_ip) {
- // Don't continue adding filter chains with server names mentioned
- if (!filter_chain.filter_chain_match.server_names.empty()) {
- return GRPC_ERROR_NONE;
- }
- return AddFilterChainDataForTransportProtocol(filter_chain, destination_ip);
-}
-
-grpc_error_handle AddFilterChainDataForDestinationIpRange(
- const FilterChain& filter_chain,
- InternalFilterChainMap::DestinationIpMap* destination_ip_map) {
- if (filter_chain.filter_chain_match.prefix_ranges.empty()) {
- auto insert_result = destination_ip_map->emplace(
- "", InternalFilterChainMap::DestinationIp());
- return AddFilterChainDataForServerNames(filter_chain,
- &insert_result.first->second);
- } else {
- for (const auto& prefix_range :
- filter_chain.filter_chain_match.prefix_ranges) {
- auto insert_result = destination_ip_map->emplace(
- absl::StrCat(grpc_sockaddr_to_string(&prefix_range.address, false),
- "/", prefix_range.prefix_len),
- InternalFilterChainMap::DestinationIp());
- if (insert_result.second) {
- insert_result.first->second.prefix_range.emplace(prefix_range);
- }
- grpc_error_handle error = AddFilterChainDataForServerNames(
- filter_chain, &insert_result.first->second);
- if (error != GRPC_ERROR_NONE) return error;
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-XdsApi::LdsUpdate::FilterChainMap BuildFromInternalFilterChainMap(
- InternalFilterChainMap* internal_filter_chain_map) {
- XdsApi::LdsUpdate::FilterChainMap filter_chain_map;
- for (auto& destination_ip_pair :
- internal_filter_chain_map->destination_ip_map) {
- XdsApi::LdsUpdate::FilterChainMap::DestinationIp destination_ip;
- destination_ip.prefix_range = destination_ip_pair.second.prefix_range;
- for (int i = 0; i < 3; i++) {
- auto& source_ip_map = destination_ip_pair.second.source_types_array[i];
- for (auto& source_ip_pair : source_ip_map) {
- destination_ip.source_types_array[i].push_back(
- std::move(source_ip_pair.second));
- }
- }
- filter_chain_map.destination_ip_vector.push_back(std::move(destination_ip));
- }
- return filter_chain_map;
-}
-
-grpc_error_handle BuildFilterChainMap(
- const std::vector<FilterChain>& filter_chains,
- XdsApi::LdsUpdate::FilterChainMap* filter_chain_map) {
- InternalFilterChainMap internal_filter_chain_map;
- for (const auto& filter_chain : filter_chains) {
- // Discard filter chain entries that specify destination port
- if (filter_chain.filter_chain_match.destination_port != 0) continue;
- grpc_error_handle error = AddFilterChainDataForDestinationIpRange(
- filter_chain, &internal_filter_chain_map.destination_ip_map);
- if (error != GRPC_ERROR_NONE) return error;
- }
- *filter_chain_map =
- BuildFromInternalFilterChainMap(&internal_filter_chain_map);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle LdsResponseParseServer(
- const EncodingContext& context,
- const envoy_config_listener_v3_Listener* listener, bool is_v2,
- XdsApi::LdsUpdate* lds_update) {
- lds_update->type = XdsApi::LdsUpdate::ListenerType::kTcpListener;
- grpc_error_handle error =
- AddressParse(envoy_config_listener_v3_Listener_address(listener),
- &lds_update->address);
- if (error != GRPC_ERROR_NONE) return error;
- const auto* use_original_dst =
- envoy_config_listener_v3_Listener_use_original_dst(listener);
- if (use_original_dst != nullptr) {
- if (google_protobuf_BoolValue_value(use_original_dst)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Field \'use_original_dst\' is not supported.");
- }
- }
- size_t size = 0;
- auto* filter_chains =
- envoy_config_listener_v3_Listener_filter_chains(listener, &size);
- std::vector<FilterChain> parsed_filter_chains;
- parsed_filter_chains.reserve(size);
- for (size_t i = 0; i < size; i++) {
- FilterChain filter_chain;
- error = FilterChainParse(context, filter_chains[i], is_v2, &filter_chain);
- if (error != GRPC_ERROR_NONE) return error;
- parsed_filter_chains.push_back(std::move(filter_chain));
- }
- error =
- BuildFilterChainMap(parsed_filter_chains, &lds_update->filter_chain_map);
- if (error != GRPC_ERROR_NONE) return error;
- auto* default_filter_chain =
- envoy_config_listener_v3_Listener_default_filter_chain(listener);
- if (default_filter_chain != nullptr) {
- FilterChain filter_chain;
- error =
- FilterChainParse(context, default_filter_chain, is_v2, &filter_chain);
- if (error != GRPC_ERROR_NONE) return error;
- if (filter_chain.filter_chain_data != nullptr) {
- lds_update->default_filter_chain =
- std::move(*filter_chain.filter_chain_data);
- }
- }
- if (size == 0 && default_filter_chain == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No filter chain provided.");
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle LdsResponseParse(
- const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<absl::string_view>& expected_listener_names,
- XdsApi::LdsUpdateMap* lds_update_map,
- std::set<std::string>* resource_names_failed) {
- std::vector<grpc_error_handle> errors;
- // 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.
- absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- bool is_v2 = false;
- if (!IsLds(type_url, &is_v2)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Resource is not LDS.")
- .c_str()));
- continue;
- }
- // 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, context.arena);
- if (listener == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Can't decode listener.")
- .c_str()));
- continue;
- }
- // Check listener name. Ignore unexpected listeners.
- std::string 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()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("duplicate listener name \"", listener_name, "\"")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- // Serialize into JSON and store it in the LdsUpdateMap
- XdsApi::LdsResourceData& lds_resource_data =
- (*lds_update_map)[listener_name];
- XdsApi::LdsUpdate& lds_update = lds_resource_data.resource;
- lds_resource_data.serialized_proto = UpbStringToStdString(encoded_listener);
- // Check whether it's a client or server listener.
- const envoy_config_listener_v3_ApiListener* api_listener =
- envoy_config_listener_v3_Listener_api_listener(listener);
- const envoy_config_core_v3_Address* address =
- envoy_config_listener_v3_Listener_address(listener);
- if (api_listener != nullptr && address != nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(listener_name,
- ": Listener has both address and ApiListener")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- if (api_listener == nullptr && address == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(listener_name,
- ": Listener has neither address nor ApiListener")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (api_listener != nullptr) {
- error = LdsResponseParseClient(context, api_listener, is_v2, &lds_update);
- } else {
- error = LdsResponseParseServer(context, listener, is_v2, &lds_update);
- }
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(listener_name, ": validation error").c_str()),
- error));
- resource_names_failed->insert(listener_name);
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing LDS response", &errors);
-}
-
-grpc_error_handle RdsResponseParse(
- const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<absl::string_view>& expected_route_configuration_names,
- XdsApi::RdsUpdateMap* rds_update_map,
- std::set<std::string>* resource_names_failed) {
- std::vector<grpc_error_handle> errors;
- // 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.
- absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsRds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Resource is not RDS.")
- .c_str()));
- continue;
- }
- // 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,
- context.arena);
- if (route_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Can't decode route_config.")
- .c_str()));
- continue;
- }
- // Check route_config_name. Ignore unexpected route_config.
- std::string 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()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("duplicate route config name \"", route_config_name,
- "\"")
- .c_str()));
- resource_names_failed->insert(route_config_name);
- continue;
- }
- // Serialize into JSON and store it in the RdsUpdateMap
- XdsApi::RdsResourceData& rds_resource_data =
- (*rds_update_map)[route_config_name];
- XdsApi::RdsUpdate& rds_update = rds_resource_data.resource;
- rds_resource_data.serialized_proto =
- UpbStringToStdString(encoded_route_config);
- // Parse the route_config.
- grpc_error_handle error =
- RouteConfigParse(context, route_config, &rds_update);
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(route_config_name, ": validation error").c_str()),
- error));
- resource_names_failed->insert(route_config_name);
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing RDS response", &errors);
-}
-
-grpc_error_handle CdsResponseParse(
- const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<absl::string_view>& expected_cluster_names,
- XdsApi::CdsUpdateMap* cds_update_map,
- std::set<std::string>* resource_names_failed) {
- std::vector<grpc_error_handle> errors;
- // 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.
- absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsCds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Resource is not CDS.")
- .c_str()));
- continue;
- }
- // 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, context.arena);
- if (cluster == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Can't decode cluster.")
- .c_str()));
- continue;
- }
- MaybeLogCluster(context, cluster);
- // Ignore unexpected cluster names.
- std::string 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()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("duplicate resource name \"", cluster_name, "\"")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- // Serialize into JSON and store it in the CdsUpdateMap
- XdsApi::CdsResourceData& cds_resource_data =
- (*cds_update_map)[cluster_name];
- XdsApi::CdsUpdate& cds_update = cds_resource_data.resource;
- cds_resource_data.serialized_proto = UpbStringToStdString(encoded_cluster);
- // Check the cluster_discovery_type.
- if (!envoy_config_cluster_v3_Cluster_has_type(cluster) &&
- !envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": DiscoveryType not found.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- if (envoy_config_cluster_v3_Cluster_type(cluster) ==
- envoy_config_cluster_v3_Cluster_EDS) {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::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)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": EDS ConfigSource is not ADS.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- // 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);
- }
- } else if (!XdsAggregateAndLogicalDnsClusterEnabled()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": DiscoveryType is not valid.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
- envoy_config_cluster_v3_Cluster_LOGICAL_DNS) {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS;
- } else {
- if (envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
- const envoy_config_cluster_v3_Cluster_CustomClusterType*
- custom_cluster_type =
- envoy_config_cluster_v3_Cluster_cluster_type(cluster);
- upb_strview type_name =
- envoy_config_cluster_v3_Cluster_CustomClusterType_name(
- custom_cluster_type);
- if (UpbStringToAbsl(type_name) == "envoy.clusters.aggregate") {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::AGGREGATE;
- // Retrieve aggregate clusters.
- const google_protobuf_Any* typed_config =
- envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(
- custom_cluster_type);
- const upb_strview aggregate_cluster_config_upb_strview =
- google_protobuf_Any_value(typed_config);
- const envoy_extensions_clusters_aggregate_v3_ClusterConfig*
- aggregate_cluster_config =
- envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(
- aggregate_cluster_config_upb_strview.data,
- aggregate_cluster_config_upb_strview.size, context.arena);
- if (aggregate_cluster_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": Can't parse aggregate cluster.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- size_t size;
- const upb_strview* clusters =
- envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(
- aggregate_cluster_config, &size);
- for (size_t i = 0; i < size; ++i) {
- const upb_strview cluster = clusters[i];
- cds_update.prioritized_cluster_names.emplace_back(
- UpbStringToStdString(cluster));
- }
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": DiscoveryType is not valid.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": DiscoveryType is not valid.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- // Check the LB policy.
- if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
- envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
- cds_update.lb_policy = "ROUND_ROBIN";
- } else if (XdsRingHashEnabled() &&
- envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
- envoy_config_cluster_v3_Cluster_RING_HASH) {
- cds_update.lb_policy = "RING_HASH";
- // Record ring hash lb config
- auto* ring_hash_config =
- envoy_config_cluster_v3_Cluster_ring_hash_lb_config(cluster);
- if (ring_hash_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name,
- ": ring hash lb config required but not present.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- const google_protobuf_UInt64Value* max_ring_size =
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(
- ring_hash_config);
- if (max_ring_size != nullptr) {
- cds_update.max_ring_size =
- google_protobuf_UInt64Value_value(max_ring_size);
- if (cds_update.max_ring_size > 8388608 ||
- cds_update.max_ring_size == 0) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- cluster_name,
- ": max_ring_size is not in the range of 1 to 8388608.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- const google_protobuf_UInt64Value* min_ring_size =
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(
- ring_hash_config);
- if (min_ring_size != nullptr) {
- cds_update.min_ring_size =
- google_protobuf_UInt64Value_value(min_ring_size);
- if (cds_update.min_ring_size > 8388608 ||
- cds_update.min_ring_size == 0) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- cluster_name,
- ": min_ring_size is not in the range of 1 to 8388608.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- if (cds_update.min_ring_size > cds_update.max_ring_size) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(
- cluster_name,
- ": min_ring_size cannot be greater than max_ring_size.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- if (envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
- ring_hash_config) ==
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH) {
- cds_update.hash_function = XdsApi::CdsUpdate::HashFunction::XX_HASH;
- } else if (
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
- ring_hash_config) ==
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_MURMUR_HASH_2) {
- cds_update.hash_function =
- XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2;
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name,
- ": ring hash lb config has invalid hash function.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": LB policy is not supported.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- if (XdsSecurityEnabled()) {
- // Record Upstream tls context
- auto* transport_socket =
- envoy_config_cluster_v3_Cluster_transport_socket(cluster);
- if (transport_socket != nullptr) {
- absl::string_view name = UpbStringToAbsl(
- envoy_config_core_v3_TransportSocket_name(transport_socket));
- if (name == "envoy.transport_sockets.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, context.arena);
- if (upstream_tls_context == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name,
- ": Can't decode upstream tls context.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- auto* common_tls_context =
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
- upstream_tls_context);
- if (common_tls_context != nullptr) {
- grpc_error_handle error = CommonTlsContextParse(
- common_tls_context, &cds_update.common_tls_context);
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": error in TLS context")
- .c_str()),
- error));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- }
- if (cds_update.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance
- .instance_name.empty()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name,
- "TLS configuration provided but no "
- "validation_context_certificate_provider_instance "
- "found.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- }
- }
- // 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)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(cluster_name, ": LRS ConfigSource is not self.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- 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_CREATE_FROM_VECTOR("errors parsing CDS response", &errors);
-}
-
-grpc_error_handle 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);
- std::string 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_error_handle error =
- grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
- if (error != GRPC_ERROR_NONE) return error;
- // Append the address to the list.
- list->emplace_back(addr, nullptr);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle 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);
- if (locality == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty locality.");
- }
- std::string region =
- UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
- std::string zone =
- UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
- std::string 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_handle 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_handle DropParseAndAppend(
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
- drop_overload,
- XdsApi::EdsUpdate::DropConfig* drop_config) {
- // Get the category.
- std::string category = UpbStringToStdString(
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
- drop_overload));
- if (category.empty()) {
- 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_handle EdsResponseParse(
- const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<absl::string_view>& expected_eds_service_names,
- XdsApi::EdsUpdateMap* eds_update_map,
- std::set<std::string>* resource_names_failed) {
- std::vector<grpc_error_handle> errors;
- // 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.
- absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsEds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i, ": Resource is not EDS.")
- .c_str()));
- continue;
- }
- // 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, context.arena);
- if (cluster_load_assignment == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("resource index ", i,
- ": Can't parse cluster_load_assignment.")
- .c_str()));
- continue;
- }
- MaybeLogClusterLoadAssignment(context, cluster_load_assignment);
- // Check the EDS service name. Ignore unexpected names.
- std::string 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()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("duplicate resource name \"", eds_service_name, "\"")
- .c_str()));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
- // Serialize into JSON and store it in the EdsUpdateMap
- XdsApi::EdsResourceData& eds_resource_data =
- (*eds_update_map)[eds_service_name];
- XdsApi::EdsUpdate& eds_update = eds_resource_data.resource;
- eds_resource_data.serialized_proto =
- UpbStringToStdString(encoded_cluster_load_assignment);
- // 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);
- grpc_error_handle error = GRPC_ERROR_NONE;
- for (size_t j = 0; j < locality_size; ++j) {
- size_t priority;
- XdsApi::EdsUpdate::Priority::Locality locality;
- error = LocalityParse(endpoints[j], &locality, &priority);
- if (error != GRPC_ERROR_NONE) break;
- // 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));
- }
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(eds_service_name, ": locality validation error")
- .c_str()),
- error));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
- for (const auto& priority : eds_update.priorities) {
- if (priority.localities.empty()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(eds_service_name, ": sparse priority list").c_str()));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
- }
- // 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) {
- error =
- DropParseAndAppend(drop_overload[j], eds_update.drop_config.get());
- if (error != GRPC_ERROR_NONE) break;
- }
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat(eds_service_name, ": drop config validation error")
- .c_str()),
- error));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing EDS response", &errors);
-}
-
-std::string TypeUrlInternalToExternal(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 std::string(type_url);
-}
-
-template <typename UpdateMap>
-void MoveUpdatesToFailedSet(UpdateMap* update_map,
- std::set<std::string>* resource_names_failed) {
- for (const auto& p : *update_map) {
- resource_names_failed->insert(p.first);
- }
- update_map->clear();
-}
-
} // namespace
-XdsApi::AdsParseResult XdsApi::ParseAdsResponse(
- const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
- const std::set<absl::string_view>& expected_listener_names,
- const std::set<absl::string_view>& expected_route_configuration_names,
- const std::set<absl::string_view>& expected_cluster_names,
- const std::set<absl::string_view>& expected_eds_service_names) {
- AdsParseResult result;
+absl::Status XdsApi::ParseAdsResponse(const XdsBootstrap::XdsServer& server,
+ const grpc_slice& encoded_response,
+ AdsResponseParserInterface* parser) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const XdsEncodingContext context = {client_,
+ server,
+ tracer_,
+ symtab_->ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// 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 decoding fails, report a fatal error and return.
if (response == nullptr) {
- result.parse_error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Can't decode DiscoveryResponse.");
- return result;
+ return absl::InvalidArgumentError("Can't decode DiscoveryResponse.");
}
MaybeLogDiscoveryResponse(context, 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(
+ // Report the type_url, version, nonce, and number of resources to the parser.
+ AdsResponseParserInterface::AdsResponseFields fields;
+ fields.type_url = std::string(absl::StripPrefix(
+ UpbStringToAbsl(
+ envoy_service_discovery_v3_DiscoveryResponse_type_url(response)),
+ "type.googleapis.com/"));
+ fields.version = UpbStringToStdString(
envoy_service_discovery_v3_DiscoveryResponse_version_info(response));
- result.nonce = UpbStringToStdString(
+ fields.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(context, response, expected_listener_names,
- &result.lds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.lds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsRds(result.type_url)) {
- result.parse_error =
- RdsResponseParse(context, response, expected_route_configuration_names,
- &result.rds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.rds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsCds(result.type_url)) {
- result.parse_error =
- CdsResponseParse(context, response, expected_cluster_names,
- &result.cds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.cds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsEds(result.type_url)) {
- result.parse_error =
- EdsResponseParse(context, response, expected_eds_service_names,
- &result.eds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.eds_update_map,
- &result.resource_names_failed);
- }
- }
- return result;
+ size_t num_resources;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response,
+ &num_resources);
+ fields.num_resources = num_resources;
+ absl::Status status = parser->ProcessAdsResponseFields(std::move(fields));
+ if (!status.ok()) return status;
+ // Process each resource.
+ for (size_t i = 0; i < num_resources; ++i) {
+ absl::string_view type_url = absl::StripPrefix(
+ UpbStringToAbsl(google_protobuf_Any_type_url(resources[i])),
+ "type.googleapis.com/");
+ absl::string_view serialized_resource =
+ UpbStringToAbsl(google_protobuf_Any_value(resources[i]));
+ // Unwrap Resource messages, if so wrapped.
+ if (type_url == "envoy.api.v2.Resource" ||
+ type_url == "envoy.service.discovery.v3.Resource") {
+ const auto* resource_wrapper = envoy_service_discovery_v3_Resource_parse(
+ serialized_resource.data(), serialized_resource.size(), arena.ptr());
+ if (resource_wrapper == nullptr) {
+ return absl::InvalidArgumentError(
+ "Can't decode Resource proto wrapper");
+ }
+ const auto* resource =
+ envoy_service_discovery_v3_Resource_resource(resource_wrapper);
+ type_url = absl::StripPrefix(
+ UpbStringToAbsl(google_protobuf_Any_type_url(resource)),
+ "type.googleapis.com/");
+ serialized_resource =
+ UpbStringToAbsl(google_protobuf_Any_value(resource));
+ }
+ parser->ParseResource(context, i, type_url, serialized_resource);
+ }
+ return absl::OkStatus();
}
namespace {
void MaybeLogLrsRequest(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
const envoy_service_load_stats_v3_LoadStatsRequest* request) {
if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
- const upb_msgdef* msg_type =
+ const upb_MessageDef* msg_type =
envoy_service_load_stats_v3_LoadStatsRequest_getmsgdef(context.symtab);
char buf[10240];
- upb_text_encode(request, msg_type, nullptr, 0, buf, sizeof(buf));
+ upb_TextEncode(request, msg_type, nullptr, 0, buf, sizeof(buf));
gpr_log(GPR_DEBUG, "[xds_client %p] constructed LRS request: %s",
context.client, buf);
}
}
grpc_slice SerializeLrsRequest(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
const envoy_service_load_stats_v3_LoadStatsRequest* request) {
size_t output_length;
char* output = envoy_service_load_stats_v3_LoadStatsRequest_serialize(
@@ -3353,8 +454,13 @@ grpc_slice SerializeLrsRequest(
grpc_slice XdsApi::CreateLrsInitialRequest(
const XdsBootstrap::XdsServer& server) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const XdsEncodingContext context = {client_,
+ server,
+ tracer_,
+ symtab_->ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// Create a request.
envoy_service_load_stats_v3_LoadStatsRequest* request =
envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
@@ -3362,9 +468,11 @@ grpc_slice XdsApi::CreateLrsInitialRequest(
envoy_config_core_v3_Node* node_msg =
envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(request,
arena.ptr());
- PopulateNode(context, node_, build_version_, user_agent_name_, node_msg);
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node_msg);
envoy_config_core_v3_Node_add_client_features(
- node_msg, upb_strview_makez("envoy.lrs.supports_send_all_clusters"),
+ node_msg,
+ upb_StringView_FromString("envoy.lrs.supports_send_all_clusters"),
arena.ptr());
MaybeLogLrsRequest(context, request);
return SerializeLrsRequest(context, request);
@@ -3373,7 +481,7 @@ grpc_slice XdsApi::CreateLrsInitialRequest(
namespace {
void LocalityStatsPopulate(
- const EncodingContext& context,
+ const XdsEncodingContext& context,
envoy_config_endpoint_v3_UpstreamLocalityStats* output,
const XdsLocalityName& locality_name,
const XdsClusterLocalityStats::Snapshot& snapshot) {
@@ -3423,8 +531,16 @@ void LocalityStatsPopulate(
grpc_slice XdsApi::CreateLrsRequest(
ClusterLoadReportMap cluster_load_report_map) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- false};
+ // The xDS server info is not actually needed here, so we seed it with an
+ // empty value.
+ XdsBootstrap::XdsServer empty_server;
+ const XdsEncodingContext context = {client_,
+ empty_server,
+ tracer_,
+ symtab_->ptr(),
+ arena.ptr(),
+ false,
+ certificate_provider_definition_map_};
// Create a request.
envoy_service_load_stats_v3_LoadStatsRequest* request =
envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
@@ -3472,8 +588,7 @@ grpc_slice XdsApi::CreateLrsRequest(
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);
+ gpr_timespec timespec = load_report.load_report_interval.as_timespec();
google_protobuf_Duration* load_report_interval =
envoy_config_endpoint_v3_ClusterStats_mutable_load_report_interval(
cluster_stats, arena.ptr());
@@ -3484,10 +599,10 @@ grpc_slice XdsApi::CreateLrsRequest(
return SerializeLrsRequest(context, request);
}
-grpc_error_handle XdsApi::ParseLrsResponse(
- const grpc_slice& encoded_response, bool* send_all_clusters,
- std::set<std::string>* cluster_names,
- grpc_millis* load_reporting_interval) {
+grpc_error_handle XdsApi::ParseLrsResponse(const grpc_slice& encoded_response,
+ bool* send_all_clusters,
+ std::set<std::string>* cluster_names,
+ Duration* load_reporting_interval) {
upb::Arena arena;
// Decode the response.
const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
@@ -3505,7 +620,7 @@ grpc_error_handle XdsApi::ParseLrsResponse(
} else {
// Store the cluster names.
size_t size;
- const upb_strview* clusters =
+ const upb_StringView* clusters =
envoy_service_load_stats_v3_LoadStatsResponse_clusters(decoded_response,
&size);
for (size_t i = 0; i < size; ++i) {
@@ -3516,237 +631,24 @@ grpc_error_handle XdsApi::ParseLrsResponse(
const google_protobuf_Duration* load_reporting_interval_duration =
envoy_service_load_stats_v3_LoadStatsResponse_load_reporting_interval(
decoded_response);
- gpr_timespec timespec{
+ *load_reporting_interval = Duration::FromSecondsAndNanoseconds(
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);
+ google_protobuf_Duration_nanos(load_reporting_interval_duration));
return GRPC_ERROR_NONE;
}
namespace {
-google_protobuf_Timestamp* GrpcMillisToTimestamp(const EncodingContext& context,
- grpc_millis value) {
+
+google_protobuf_Timestamp* EncodeTimestamp(const XdsEncodingContext& context,
+ Timestamp value) {
google_protobuf_Timestamp* timestamp =
google_protobuf_Timestamp_new(context.arena);
- gpr_timespec timespec = grpc_millis_to_timespec(value, GPR_CLOCK_REALTIME);
+ gpr_timespec timespec = value.as_timespec(GPR_CLOCK_REALTIME);
google_protobuf_Timestamp_set_seconds(timestamp, timespec.tv_sec);
google_protobuf_Timestamp_set_nanos(timestamp, timespec.tv_nsec);
return timestamp;
}
-envoy_admin_v3_UpdateFailureState* CreateUpdateFailureStateUpb(
- const EncodingContext& context,
- const XdsApi::ResourceMetadata* resource_metadata) {
- auto* update_failure_state =
- envoy_admin_v3_UpdateFailureState_new(context.arena);
- envoy_admin_v3_UpdateFailureState_set_details(
- update_failure_state,
- StdStringToUpbString(resource_metadata->failed_details));
- envoy_admin_v3_UpdateFailureState_set_version_info(
- update_failure_state,
- StdStringToUpbString(resource_metadata->failed_version));
- envoy_admin_v3_UpdateFailureState_set_last_update_attempt(
- update_failure_state,
- GrpcMillisToTimestamp(context, resource_metadata->failed_update_time));
- return update_failure_state;
-}
-
-void DumpLdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kLdsTypeUrlUpb = upb_strview_makez(XdsApi::kLdsTypeUrl);
- auto* listener_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_listener_config(
- per_xds_config, context.arena);
- envoy_admin_v3_ListenersConfigDump_set_version_info(
- listener_config_dump,
- StdStringToUpbString(resource_type_metadata.version));
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_listener =
- envoy_admin_v3_ListenersConfigDump_add_dynamic_listeners(
- listener_config_dump, context.arena);
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_name(
- dynamic_listener, name_upb);
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_client_status(
- dynamic_listener, meta->client_status);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective listeners
- auto* dynamic_listener_state =
- envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_active_state(
- dynamic_listener, context.arena);
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_version_info(
- dynamic_listener_state, StdStringToUpbString(meta->version));
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(
- dynamic_listener_state,
- GrpcMillisToTimestamp(context, meta->update_time));
- auto* listener_any =
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_listener(
- dynamic_listener_state, context.arena);
- google_protobuf_Any_set_type_url(listener_any, kLdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- listener_any, StdStringToUpbString(meta->serialized_proto));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(
- dynamic_listener, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpRdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kRdsTypeUrlUpb = upb_strview_makez(XdsApi::kRdsTypeUrl);
- auto* route_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_route_config(per_xds_config,
- context.arena);
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_route_config =
- envoy_admin_v3_RoutesConfigDump_add_dynamic_route_configs(
- route_config_dump, context.arena);
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_client_status(
- dynamic_route_config, meta->client_status);
- auto* route_config_any =
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_route_config(
- dynamic_route_config, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective route configs
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_version_info(
- dynamic_route_config, StdStringToUpbString(meta->version));
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(
- dynamic_route_config,
- GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(route_config_any, kRdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- route_config_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working route config, we still need to print the
- // name.
- auto* route_config =
- envoy_config_route_v3_RouteConfiguration_new(context.arena);
- envoy_config_route_v3_RouteConfiguration_set_name(route_config, name_upb);
- size_t length;
- char* bytes = envoy_config_route_v3_RouteConfiguration_serialize(
- route_config, context.arena, &length);
- google_protobuf_Any_set_type_url(route_config_any, kRdsTypeUrlUpb);
- google_protobuf_Any_set_value(route_config_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(
- dynamic_route_config, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpCdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kCdsTypeUrlUpb = upb_strview_makez(XdsApi::kCdsTypeUrl);
- auto* cluster_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_cluster_config(
- per_xds_config, context.arena);
- envoy_admin_v3_ClustersConfigDump_set_version_info(
- cluster_config_dump,
- StdStringToUpbString(resource_type_metadata.version));
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_cluster =
- envoy_admin_v3_ClustersConfigDump_add_dynamic_active_clusters(
- cluster_config_dump, context.arena);
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_client_status(
- dynamic_cluster, meta->client_status);
- auto* cluster_any =
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_cluster(
- dynamic_cluster, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective clusters
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_version_info(
- dynamic_cluster, StdStringToUpbString(meta->version));
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(
- dynamic_cluster, GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(cluster_any, kCdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- cluster_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working cluster, we still need to print the name.
- auto* cluster = envoy_config_cluster_v3_Cluster_new(context.arena);
- envoy_config_cluster_v3_Cluster_set_name(cluster, name_upb);
- size_t length;
- char* bytes = envoy_config_cluster_v3_Cluster_serialize(
- cluster, context.arena, &length);
- google_protobuf_Any_set_type_url(cluster_any, kCdsTypeUrlUpb);
- google_protobuf_Any_set_value(cluster_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(
- dynamic_cluster, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpEdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kEdsTypeUrlUpb = upb_strview_makez(XdsApi::kEdsTypeUrl);
- auto* endpoint_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_endpoint_config(
- per_xds_config, context.arena);
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_endpoint =
- envoy_admin_v3_EndpointsConfigDump_add_dynamic_endpoint_configs(
- endpoint_config_dump, context.arena);
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_client_status(
- dynamic_endpoint, meta->client_status);
- auto* endpoint_any =
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_endpoint_config(
- dynamic_endpoint, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective endpoints
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_version_info(
- dynamic_endpoint, StdStringToUpbString(meta->version));
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(
- dynamic_endpoint, GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(endpoint_any, kEdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- endpoint_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working endpoint, we still need to print the name.
- auto* cluster_load_assignment =
- envoy_config_endpoint_v3_ClusterLoadAssignment_new(context.arena);
- envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(
- cluster_load_assignment, name_upb);
- size_t length;
- char* bytes = envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(
- cluster_load_assignment, context.arena, &length);
- google_protobuf_Any_set_type_url(endpoint_any, kEdsTypeUrlUpb);
- google_protobuf_Any_set_value(endpoint_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(
- dynamic_endpoint, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
} // namespace
std::string XdsApi::AssembleClientConfig(
@@ -3757,36 +659,65 @@ std::string XdsApi::AssembleClientConfig(
// Fill-in the node information
auto* node = envoy_service_status_v3_ClientConfig_mutable_node(client_config,
arena.ptr());
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- true};
- PopulateNode(context, node_, build_version_, user_agent_name_, node);
- // Dump each xDS-type config into PerXdsConfig
- for (auto& p : resource_type_metadata_map) {
+ // The xDS server info is not actually needed here, so we seed it with an
+ // empty value.
+ XdsBootstrap::XdsServer empty_server;
+ const XdsEncodingContext context = {client_,
+ empty_server,
+ tracer_,
+ symtab_->ptr(),
+ arena.ptr(),
+ true,
+ certificate_provider_definition_map_};
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node);
+ // Dump each resource.
+ std::vector<std::string> type_url_storage;
+ for (const auto& p : resource_type_metadata_map) {
absl::string_view type_url = p.first;
- const ResourceTypeMetadata& resource_type_metadata = p.second;
- if (type_url == kLdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpLdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kRdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpRdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kCdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpCdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kEdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpEdsConfig(context, resource_type_metadata, per_xds_config);
- } else {
- gpr_log(GPR_ERROR, "invalid type_url %s", std::string(type_url).c_str());
- return "";
+ const ResourceMetadataMap& resource_metadata_map = p.second;
+ type_url_storage.emplace_back(
+ absl::StrCat("type.googleapis.com/", type_url));
+ for (const auto& q : resource_metadata_map) {
+ absl::string_view resource_name = q.first;
+ const ResourceMetadata& metadata = *q.second;
+ auto* entry =
+ envoy_service_status_v3_ClientConfig_add_generic_xds_configs(
+ client_config, context.arena);
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_type_url(
+ entry, StdStringToUpbString(type_url_storage.back()));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_name(
+ entry, StdStringToUpbString(resource_name));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_client_status(
+ entry, metadata.client_status);
+ if (!metadata.serialized_proto.empty()) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_version_info(
+ entry, StdStringToUpbString(metadata.version));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(
+ entry, EncodeTimestamp(context, metadata.update_time));
+ auto* any_field =
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_xds_config(
+ entry, context.arena);
+ google_protobuf_Any_set_type_url(
+ any_field, StdStringToUpbString(type_url_storage.back()));
+ google_protobuf_Any_set_value(
+ any_field, StdStringToUpbString(metadata.serialized_proto));
+ }
+ if (metadata.client_status == XdsApi::ResourceMetadata::NACKED) {
+ auto* update_failure_state =
+ envoy_admin_v3_UpdateFailureState_new(context.arena);
+ envoy_admin_v3_UpdateFailureState_set_details(
+ update_failure_state,
+ StdStringToUpbString(metadata.failed_details));
+ envoy_admin_v3_UpdateFailureState_set_version_info(
+ update_failure_state,
+ StdStringToUpbString(metadata.failed_version));
+ envoy_admin_v3_UpdateFailureState_set_last_update_attempt(
+ update_failure_state,
+ EncodeTimestamp(context, metadata.failed_update_time));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(
+ entry, update_failure_state);
+ }
}
}
// Serialize the upb message to bytes
diff --git a/grpc/src/core/ext/xds/xds_api.h b/grpc/src/core/ext/xds/xds_api.h
index e7bf1cd1..959c2d5a 100644
--- a/grpc/src/core/ext/xds/xds_api.h
+++ b/grpc/src/core/ext/xds/xds_api.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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.
+//
#ifndef GRPC_CORE_EXT_XDS_XDS_API_H
#define GRPC_CORE_EXT_XDS_XDS_API_H
@@ -25,517 +23,59 @@
#include <set>
-#include "absl/container/inlined_vector.h"
-#include "absl/types/optional.h"
-#include "re2/re2.h"
-
+#include "envoy/admin/v3/config_dump.upb.h"
#include "upb/def.hpp"
-#include <grpc/slice_buffer.h>
+#include <grpc/slice.h>
-#include "envoy/admin/v3/config_dump.upb.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/ext/xds/upb_utils.h"
#include "src/core/ext/xds/xds_bootstrap.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/matchers/matchers.h"
+#include "src/core/lib/resolver/server_address.h"
namespace grpc_core {
-// TODO(yashykt): Check to see if xDS security is enabled. This will be
-// removed once this feature is fully integration-tested and enabled by
-// default.
-bool XdsSecurityEnabled();
-
class XdsClient;
+// TODO(roth): When we have time, split this into multiple pieces:
+// - a common upb-based parsing framework (combine with XdsEncodingContext)
+// - ADS request/response handling
+// - LRS request/response handling
+// - CSDS response generation
class XdsApi {
public:
- static const char* kLdsTypeUrl;
- static const char* kRdsTypeUrl;
- static const char* kCdsTypeUrl;
- static const char* kEdsTypeUrl;
-
- struct Duration {
- int64_t seconds = 0;
- int32_t nanos = 0;
- bool operator==(const Duration& other) const {
- return seconds == other.seconds && nanos == other.nanos;
- }
- std::string ToString() const {
- return absl::StrFormat("Duration seconds: %ld, nanos %d", seconds, nanos);
- }
- };
-
- using TypedPerFilterConfig =
- std::map<std::string, XdsHttpFilterImpl::FilterConfig>;
-
- // TODO(donnadionne): When we can use absl::variant<>, consider using that
- // for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
- struct Route {
- // Matchers for this route.
- struct Matchers {
- StringMatcher path_matcher;
- std::vector<HeaderMatcher> header_matchers;
- 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;
- }
- std::string ToString() const;
- };
-
- struct HashPolicy {
- enum Type { HEADER, CHANNEL_ID };
- Type type;
- bool terminal = false;
- // Fields used for type HEADER.
- std::string header_name;
- std::unique_ptr<RE2> regex = nullptr;
- std::string regex_substitution;
-
- HashPolicy() {}
-
- // Copyable.
- HashPolicy(const HashPolicy& other);
- HashPolicy& operator=(const HashPolicy& other);
-
- // Moveable.
- HashPolicy(HashPolicy&& other) noexcept;
- HashPolicy& operator=(HashPolicy&& other) noexcept;
-
- bool operator==(const HashPolicy& other) const;
- std::string ToString() const;
- };
-
- Matchers matchers;
- std::vector<HashPolicy> hash_policies;
-
- // Action for this route.
- // TODO(roth): When we can use absl::variant<>, consider using that
- // here, to enforce the fact that only one of the two fields can be set.
- std::string cluster_name;
- struct ClusterWeight {
- std::string name;
- uint32_t weight;
- TypedPerFilterConfig typed_per_filter_config;
-
- bool operator==(const ClusterWeight& other) const {
- return name == other.name && weight == other.weight &&
- typed_per_filter_config == other.typed_per_filter_config;
- }
- std::string ToString() const;
- };
- std::vector<ClusterWeight> weighted_clusters;
- // Storing the timeout duration from route action:
- // RouteAction.max_stream_duration.grpc_timeout_header_max or
- // RouteAction.max_stream_duration.max_stream_duration if the former is
- // not set.
- absl::optional<Duration> max_stream_duration;
-
- TypedPerFilterConfig typed_per_filter_config;
-
- bool operator==(const Route& other) const {
- return matchers == other.matchers && cluster_name == other.cluster_name &&
- weighted_clusters == other.weighted_clusters &&
- max_stream_duration == other.max_stream_duration &&
- typed_per_filter_config == other.typed_per_filter_config;
- }
- std::string ToString() const;
- };
-
- struct RdsUpdate {
- struct VirtualHost {
- std::vector<std::string> domains;
- std::vector<Route> routes;
- TypedPerFilterConfig typed_per_filter_config;
-
- bool operator==(const VirtualHost& other) const {
- return domains == other.domains && routes == other.routes &&
- typed_per_filter_config == other.typed_per_filter_config;
- }
- };
-
- std::vector<VirtualHost> virtual_hosts;
-
- bool operator==(const RdsUpdate& other) const {
- return virtual_hosts == other.virtual_hosts;
- }
- std::string ToString() const;
- VirtualHost* FindVirtualHostForDomain(const std::string& domain);
- };
-
- 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;
- }
-
- std::string ToString() const;
- bool Empty() const;
- };
-
- struct CertificateProviderInstance {
- std::string instance_name;
- std::string certificate_name;
-
- bool operator==(const CertificateProviderInstance& other) const {
- return instance_name == other.instance_name &&
- certificate_name == other.certificate_name;
- }
-
- std::string ToString() const;
- bool Empty() const;
- };
-
- struct CombinedCertificateValidationContext {
- CertificateValidationContext default_validation_context;
- CertificateProviderInstance
- 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;
- }
-
- std::string ToString() const;
- bool Empty() const;
- };
-
- CertificateProviderInstance 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;
- }
-
- std::string ToString() const;
- bool Empty() const;
- };
-
- struct DownstreamTlsContext {
- CommonTlsContext common_tls_context;
- bool require_client_certificate = false;
-
- bool operator==(const DownstreamTlsContext& other) const {
- return common_tls_context == other.common_tls_context &&
- require_client_certificate == other.require_client_certificate;
- }
-
- std::string ToString() const;
- bool Empty() const;
- };
-
- // TODO(roth): When we can use absl::variant<>, consider using that
- // here, to enforce the fact that only one of the two fields can be set.
- struct LdsUpdate {
- enum class ListenerType {
- kTcpListener = 0,
- kHttpApiListener,
- } type;
-
- struct HttpConnectionManager {
- // The name to use in the RDS request.
- std::string route_config_name;
- // Storing the Http Connection Manager Common Http Protocol Option
- // max_stream_duration
- Duration http_max_stream_duration;
- // The RouteConfiguration to use for this listener.
- // Present only if it is inlined in the LDS response.
- absl::optional<RdsUpdate> rds_update;
-
- struct HttpFilter {
- std::string name;
- XdsHttpFilterImpl::FilterConfig config;
-
- bool operator==(const HttpFilter& other) const {
- return name == other.name && config == other.config;
- }
-
- std::string ToString() const;
- };
- std::vector<HttpFilter> http_filters;
-
- bool operator==(const HttpConnectionManager& other) const {
- return route_config_name == other.route_config_name &&
- http_max_stream_duration == other.http_max_stream_duration &&
- rds_update == other.rds_update &&
- http_filters == other.http_filters;
- }
-
- std::string ToString() const;
+ // Interface defined by caller and passed to ParseAdsResponse().
+ class AdsResponseParserInterface {
+ public:
+ struct AdsResponseFields {
+ std::string type_url;
+ std::string version;
+ std::string nonce;
+ size_t num_resources;
};
- // Populated for type=kHttpApiListener.
- HttpConnectionManager http_connection_manager;
+ virtual ~AdsResponseParserInterface() = default;
- // Populated for type=kTcpListener.
- // host:port listening_address set when type is kTcpListener
- std::string address;
+ // Called when the top-level ADS fields are parsed.
+ // If this returns non-OK, parsing will stop, and the individual
+ // resources will not be processed.
+ virtual absl::Status ProcessAdsResponseFields(AdsResponseFields fields) = 0;
- struct FilterChainData {
- DownstreamTlsContext downstream_tls_context;
- // This is in principle the filter list.
- // We currently require exactly one filter, which is the HCM.
- HttpConnectionManager http_connection_manager;
-
- bool operator==(const FilterChainData& other) const {
- return downstream_tls_context == other.downstream_tls_context &&
- http_connection_manager == other.http_connection_manager;
- }
-
- std::string ToString() const;
- } filter_chain_data;
-
- // A multi-level map used to determine which filter chain to use for a given
- // incoming connection. Determining the right filter chain for a given
- // connection checks the following properties, in order:
- // - destination port (never matched, so not present in map)
- // - destination IP address
- // - server name (never matched, so not present in map)
- // - transport protocol (allows only "raw_buffer" or unset, prefers the
- // former, so only one of those two types is present in map)
- // - application protocol (never matched, so not present in map)
- // - connection source type (any, local or external)
- // - source IP address
- // - source port
- // https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener_components.proto#config-listener-v3-filterchainmatch
- // for more details
- struct FilterChainMap {
- struct FilterChainDataSharedPtr {
- std::shared_ptr<FilterChainData> data;
- bool operator==(const FilterChainDataSharedPtr& other) const {
- return *data == *other.data;
- }
- };
- struct CidrRange {
- grpc_resolved_address address;
- uint32_t prefix_len;
-
- bool operator==(const CidrRange& other) const {
- return memcmp(&address, &other.address, sizeof(address)) == 0 &&
- prefix_len == other.prefix_len;
- }
-
- std::string ToString() const;
- };
- using SourcePortsMap = std::map<uint16_t, FilterChainDataSharedPtr>;
- struct SourceIp {
- absl::optional<CidrRange> prefix_range;
- SourcePortsMap ports_map;
-
- bool operator==(const SourceIp& other) const {
- return prefix_range == other.prefix_range &&
- ports_map == other.ports_map;
- }
- };
- using SourceIpVector = std::vector<SourceIp>;
- enum class ConnectionSourceType {
- kAny = 0,
- kSameIpOrLoopback,
- kExternal
- };
- using ConnectionSourceTypesArray = std::array<SourceIpVector, 3>;
- struct DestinationIp {
- absl::optional<CidrRange> prefix_range;
- // We always fail match on server name, so those filter chains are not
- // included here.
- ConnectionSourceTypesArray source_types_array;
-
- bool operator==(const DestinationIp& other) const {
- return prefix_range == other.prefix_range &&
- source_types_array == other.source_types_array;
- }
- };
- // We always fail match on destination ports map
- using DestinationIpVector = std::vector<DestinationIp>;
- DestinationIpVector destination_ip_vector;
-
- bool operator==(const FilterChainMap& other) const {
- return destination_ip_vector == other.destination_ip_vector;
- }
-
- std::string ToString() const;
- } filter_chain_map;
-
- absl::optional<FilterChainData> default_filter_chain;
-
- bool operator==(const LdsUpdate& other) const {
- return http_connection_manager == other.http_connection_manager &&
- address == other.address &&
- filter_chain_map == other.filter_chain_map &&
- default_filter_chain == other.default_filter_chain;
- }
-
- std::string ToString() const;
- };
-
- struct LdsResourceData {
- LdsUpdate resource;
- std::string serialized_proto;
- };
-
- using LdsUpdateMap = std::map<std::string /*server_name*/, LdsResourceData>;
-
- struct RdsResourceData {
- RdsUpdate resource;
- std::string serialized_proto;
- };
-
- using RdsUpdateMap =
- std::map<std::string /*route_config_name*/, RdsResourceData>;
-
- struct CdsUpdate {
- enum ClusterType { EDS, LOGICAL_DNS, AGGREGATE };
- ClusterType cluster_type;
- // For cluster type EDS.
- // The name to use in the EDS request.
- // If empty, the cluster name will be used.
- std::string 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.
- absl::optional<std::string> lrs_load_reporting_server_name;
- // The LB policy to use (e.g., "ROUND_ROBIN" or "RING_HASH").
- std::string lb_policy;
- // Used for RING_HASH LB policy only.
- uint64_t min_ring_size = 1024;
- uint64_t max_ring_size = 8388608;
- enum HashFunction { XX_HASH, MURMUR_HASH_2 };
- HashFunction hash_function;
- // Maximum number of outstanding requests can be made to the upstream
- // cluster.
- uint32_t max_concurrent_requests = 1024;
- // For cluster type AGGREGATE.
- // The prioritized list of cluster names.
- std::vector<std::string> prioritized_cluster_names;
-
- bool operator==(const CdsUpdate& other) const {
- return cluster_type == other.cluster_type &&
- 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 &&
- prioritized_cluster_names == other.prioritized_cluster_names &&
- max_concurrent_requests == other.max_concurrent_requests;
- }
-
- std::string ToString() const;
- };
-
- struct CdsResourceData {
- CdsUpdate resource;
- std::string serialized_proto;
- };
-
- using CdsUpdateMap = std::map<std::string /*cluster_name*/, CdsResourceData>;
-
- 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);
- }
- std::string ToString() const;
- };
-
- std::map<XdsLocalityName*, Locality, XdsLocalityName::Less> localities;
-
- bool operator==(const Priority& other) const;
- std::string ToString() const;
- };
- using PriorityList = 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;
- }
-
- std::string name;
- const uint32_t parts_per_million;
- };
-
- using DropCategoryList = absl::InlinedVector<DropCategory, 2>;
-
- void AddCategory(std::string 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 std::string** 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);
- }
-
- std::string 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;
- }
- std::string ToString() const;
- };
-
- struct EdsResourceData {
- EdsUpdate resource;
- std::string serialized_proto;
+ // Called to parse each individual resource in the ADS response.
+ virtual void ParseResource(const XdsEncodingContext& context, size_t idx,
+ absl::string_view type_url,
+ absl::string_view serialized_resource) = 0;
};
- using EdsUpdateMap =
- std::map<std::string /*eds_service_name*/, EdsResourceData>;
-
struct ClusterLoadReport {
XdsClusterDropStats::Snapshot dropped_requests;
std::map<RefCountedPtr<XdsLocalityName>, XdsClusterLocalityStats::Snapshot,
XdsLocalityName::Less>
locality_stats;
- grpc_millis load_report_interval;
+ Duration load_report_interval;
};
using ClusterLoadReportMap = std::map<
std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
@@ -566,7 +106,7 @@ class XdsApi {
// The serialized bytes of the last successfully updated raw xDS resource.
std::string serialized_proto;
// The timestamp when the resource was last successfully updated.
- grpc_millis update_time = 0;
+ Timestamp update_time;
// The last successfully updated version of the resource.
std::string version;
// The rejected version string of the last failed update attempt.
@@ -574,16 +114,12 @@ class XdsApi {
// Details about the last failed update attempt.
std::string failed_details;
// Timestamp of the last failed update attempt.
- grpc_millis failed_update_time = 0;
+ Timestamp failed_update_time;
};
using ResourceMetadataMap =
- std::map<absl::string_view /*resource_name*/, const ResourceMetadata*>;
- struct ResourceTypeMetadata {
- absl::string_view version;
- ResourceMetadataMap resource_metadata_map;
- };
+ std::map<std::string /*resource_name*/, const ResourceMetadata*>;
using ResourceTypeMetadataMap =
- std::map<absl::string_view /*type_url*/, ResourceTypeMetadata>;
+ std::map<absl::string_view /*type_url*/, ResourceMetadataMap>;
static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
envoy_admin_v3_REQUESTED) ==
ResourceMetadata::ClientResourceStatus::REQUESTED,
@@ -601,43 +137,24 @@ class XdsApi {
ResourceMetadata::ClientResourceStatus::NACKED,
"");
- // If the response can't be parsed at the top level, the resulting
- // type_url will be empty.
- // If there is any other type of validation error, the parse_error
- // field will be set to something other than GRPC_ERROR_NONE and the
- // resource_names_failed field will be populated.
- // Otherwise, one of the *_update_map fields will be populated, based
- // on the type_url field.
- struct AdsParseResult {
- grpc_error_handle parse_error = GRPC_ERROR_NONE;
- std::string version;
- std::string nonce;
- std::string type_url;
- LdsUpdateMap lds_update_map;
- RdsUpdateMap rds_update_map;
- CdsUpdateMap cds_update_map;
- EdsUpdateMap eds_update_map;
- std::set<std::string> resource_names_failed;
- };
-
- XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap::Node* node);
+ XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap::Node* node,
+ const CertificateProviderStore::PluginDefinitionMap* map,
+ upb::SymbolTable* symtab);
// Creates an ADS request.
// Takes ownership of \a error.
grpc_slice CreateAdsRequest(const XdsBootstrap::XdsServer& server,
- const std::string& type_url,
- const std::set<absl::string_view>& resource_names,
- const std::string& version,
- const std::string& nonce, grpc_error_handle error,
- bool populate_node);
-
- // Parses an ADS response.
- AdsParseResult ParseAdsResponse(
- const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
- const std::set<absl::string_view>& expected_listener_names,
- const std::set<absl::string_view>& expected_route_configuration_names,
- const std::set<absl::string_view>& expected_cluster_names,
- const std::set<absl::string_view>& expected_eds_service_names);
+ absl::string_view type_url,
+ absl::string_view version,
+ absl::string_view nonce,
+ const std::vector<std::string>& resource_names,
+ grpc_error_handle error, bool populate_node);
+
+ // Returns non-OK when failing to deserialize response message.
+ // Otherwise, all events are reported to the parser.
+ absl::Status ParseAdsResponse(const XdsBootstrap::XdsServer& server,
+ const grpc_slice& encoded_response,
+ AdsResponseParserInterface* parser);
// Creates an initial LRS request.
grpc_slice CreateLrsInitialRequest(const XdsBootstrap::XdsServer& server);
@@ -651,7 +168,7 @@ class XdsApi {
grpc_error_handle ParseLrsResponse(const grpc_slice& encoded_response,
bool* send_all_clusters,
std::set<std::string>* cluster_names,
- grpc_millis* load_reporting_interval);
+ Duration* load_reporting_interval);
// Assemble the client config proto message and return the serialized result.
std::string AssembleClientConfig(
@@ -661,11 +178,14 @@ class XdsApi {
XdsClient* client_;
TraceFlag* tracer_;
const XdsBootstrap::Node* node_; // Do not own.
- upb::SymbolTable symtab_;
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map_; // Do not own.
+ upb::SymbolTable* symtab_; // Do not own.
const std::string build_version_;
const std::string user_agent_name_;
+ const std::string user_agent_version_;
};
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_XDS_XDS_API_H */
+#endif // GRPC_CORE_EXT_XDS_XDS_API_H
diff --git a/grpc/src/core/ext/xds/xds_bootstrap.cc b/grpc/src/core/ext/xds/xds_bootstrap.cc
index 33cf276d..b61a58e1 100644
--- a/grpc/src/core/ext/xds/xds_bootstrap.cc
+++ b/grpc/src/core/ext/xds/xds_bootstrap.cc
@@ -18,60 +18,146 @@
#include "src/core/ext/xds/xds_bootstrap.h"
-#include <vector>
-
#include <errno.h>
#include <stdlib.h>
+#include <vector>
+
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
+#include <grpc/grpc_security.h>
+
#include "src/core/ext/xds/certificate_provider_registry.h"
#include "src/core/ext/xds/xds_api.h"
+#include "src/core/lib/config/core_configuration.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/json/json_util.h"
+#include "src/core/lib/security/credentials/channel_creds_registry.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"
namespace grpc_core {
-//
-// XdsChannelCredsRegistry
-//
-
-bool XdsChannelCredsRegistry::IsSupported(const std::string& creds_type) {
- return creds_type == "google_default" || creds_type == "insecure" ||
- creds_type == "fake";
+// TODO(donnadionne): check to see if federation is enabled, this will be
+// removed once federation is fully integrated and enabled by default.
+bool XdsFederationEnabled() {
+ char* value = gpr_getenv("GRPC_EXPERIMENTAL_XDS_FEDERATION");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
}
-bool XdsChannelCredsRegistry::IsValidConfig(const std::string& /*creds_type*/,
- const Json& /*config*/) {
- // Currently, none of the creds types actually take a config, but we
- // ignore whatever might be specified in the bootstrap file for
- // forward compatibility reasons.
- return true;
+namespace {
+
+grpc_error_handle ParseChannelCreds(const Json::Object& json, size_t idx,
+ XdsBootstrap::XdsServer* server) {
+ std::vector<grpc_error_handle> error_list;
+ std::string type;
+ ParseJsonObjectField(json, "type", &type, &error_list);
+ const Json::Object* config_ptr = nullptr;
+ ParseJsonObjectField(json, "config", &config_ptr, &error_list,
+ /*required=*/false);
+ // Select the first channel creds type that we support.
+ if (server->channel_creds_type.empty() &&
+ CoreConfiguration::Get().channel_creds_registry().IsSupported(type)) {
+ Json config;
+ if (config_ptr != nullptr) config = *config_ptr;
+ if (!CoreConfiguration::Get().channel_creds_registry().IsValidConfig(
+ type, config)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "invalid config for channel creds type \"", type, "\"")));
+ }
+ server->channel_creds_type = std::move(type);
+ server->channel_creds_config = std::move(config);
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("errors parsing index ", idx), &error_list);
}
-RefCountedPtr<grpc_channel_credentials>
-XdsChannelCredsRegistry::MakeChannelCreds(const std::string& creds_type,
- const Json& /*config*/) {
- if (creds_type == "google_default") {
- return grpc_google_default_credentials_create(nullptr);
- } else if (creds_type == "insecure") {
- return grpc_insecure_credentials_create();
- } else if (creds_type == "fake") {
- return grpc_fake_transport_security_credentials_create();
+grpc_error_handle ParseChannelCredsArray(const Json::Array& json,
+ XdsBootstrap::XdsServer* server) {
+ std::vector<grpc_error_handle> error_list;
+ for (size_t i = 0; i < json.size(); ++i) {
+ const Json& child = json.at(i);
+ if (child.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("array element ", i, " is not an object")));
+ } else {
+ grpc_error_handle parse_error =
+ ParseChannelCreds(child.object_value(), i, server);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
}
- return nullptr;
+ if (server->channel_creds_type.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "no known creds type found in \"channel_creds\""));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"channel_creds\" array",
+ &error_list);
}
+} // namespace
+
//
// XdsBootstrap::XdsServer
//
+XdsBootstrap::XdsServer XdsBootstrap::XdsServer::Parse(
+ const Json& json, grpc_error_handle* error) {
+ std::vector<grpc_error_handle> error_list;
+ XdsServer server;
+ ParseJsonObjectField(json.object_value(), "server_uri", &server.server_uri,
+ &error_list);
+ const Json::Array* creds_array = nullptr;
+ ParseJsonObjectField(json.object_value(), "channel_creds", &creds_array,
+ &error_list);
+ if (creds_array != nullptr) {
+ grpc_error_handle parse_error =
+ ParseChannelCredsArray(*creds_array, &server);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ const Json::Array* server_features_array = nullptr;
+ ParseJsonObjectField(json.object_value(), "server_features",
+ &server_features_array, &error_list, /*required=*/false);
+ if (server_features_array != nullptr) {
+ for (const Json& feature_json : *server_features_array) {
+ if (feature_json.type() == Json::Type::STRING &&
+ feature_json.string_value() == "xds_v3") {
+ server.server_features.insert(feature_json.string_value());
+ }
+ }
+ }
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ "errors parsing xds server", &error_list);
+ return server;
+}
+
+Json::Object XdsBootstrap::XdsServer::ToJson() const {
+ Json::Object channel_creds_json{{"type", channel_creds_type}};
+ if (channel_creds_config.type() != Json::Type::JSON_NULL) {
+ channel_creds_json["config"] = channel_creds_config;
+ }
+ Json::Object json{
+ {"server_uri", server_uri},
+ {"channel_creds", Json::Array{std::move(channel_creds_json)}},
+ };
+ if (!server_features.empty()) {
+ Json::Array server_features_json;
+ for (auto& feature : server_features) {
+ server_features_json.emplace_back(feature);
+ }
+ json["server_features"] = std::move(server_features_json);
+ }
+ return json;
+}
+
bool XdsBootstrap::XdsServer::ShouldUseV3() const {
return server_features.find("xds_v3") != server_features.end();
}
@@ -109,7 +195,7 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error_handle* error) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"xds_servers\" field is not an array"));
} else {
- grpc_error_handle parse_error = ParseXdsServerList(&it->second);
+ grpc_error_handle parse_error = ParseXdsServerList(&it->second, &servers_);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
it = json.mutable_object()->find("node");
@@ -122,6 +208,30 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error_handle* error) {
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
+ if (XdsFederationEnabled()) {
+ it = json.mutable_object()->find("authorities");
+ if (it != json.mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"authorities\" field is not an object"));
+ } else {
+ grpc_error_handle parse_error = ParseAuthorities(&it->second);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ }
+ }
+ it = json.mutable_object()->find(
+ "client_default_listener_resource_name_template");
+ if (it != json.mutable_object()->end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"client_default_listener_resource_name_template\" field is not a "
+ "string"));
+ } else {
+ client_default_listener_resource_name_template_ =
+ std::move(*it->second.mutable_string_value());
+ }
+ }
+ }
it = json.mutable_object()->find("server_listener_resource_name_template");
if (it != json.mutable_object()->end()) {
if (it->second.type() != Json::Type::STRING) {
@@ -132,165 +242,116 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error_handle* error) {
std::move(*it->second.mutable_string_value());
}
}
- if (XdsSecurityEnabled()) {
- it = json.mutable_object()->find("certificate_providers");
- if (it != json.mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"certificate_providers\" field is not an object"));
- } else {
- grpc_error_handle parse_error = ParseCertificateProviders(&it->second);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
+ it = json.mutable_object()->find("certificate_providers");
+ if (it != json.mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"certificate_providers\" field is not an object"));
+ } else {
+ grpc_error_handle parse_error = ParseCertificateProviders(&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_handle XdsBootstrap::ParseXdsServerList(Json* json) {
- std::vector<grpc_error_handle> 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(
- absl::StrCat("array element ", i, " is not an object").c_str()));
- } else {
- grpc_error_handle parse_error = ParseXdsServer(&child, i);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
+const XdsBootstrap::Authority* XdsBootstrap::LookupAuthority(
+ const std::string& name) const {
+ auto it = authorities_.find(name);
+ if (it != authorities_.end()) {
+ return &it->second;
}
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
- &error_list);
+ return nullptr;
}
-grpc_error_handle XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
- std::vector<grpc_error_handle> 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()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"channel_creds\" field not present"));
- } else 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_handle 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_handle parse_error =
- ParseServerFeaturesArray(&it->second, &server);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+bool XdsBootstrap::XdsServerExists(
+ const XdsBootstrap::XdsServer& server) const {
+ if (server == servers_[0]) return true;
+ for (auto& authority : authorities_) {
+ for (auto& xds_server : authority.second.xds_servers) {
+ if (server == xds_server) return true;
}
}
- // 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_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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;
+ return false;
}
-grpc_error_handle XdsBootstrap::ParseChannelCredsArray(Json* json,
- XdsServer* server) {
+grpc_error_handle XdsBootstrap::ParseXdsServerList(
+ Json* json, absl::InlinedVector<XdsServer, 1>* servers) {
std::vector<grpc_error_handle> 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(
- absl::StrCat("array element ", i, " is not an object").c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("array element ", i, " is not an object")));
} else {
- grpc_error_handle parse_error = ParseChannelCreds(&child, i, server);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
+ grpc_error_handle parse_error;
+ servers->emplace_back(XdsServer::Parse(child, &parse_error));
+ if (parse_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("errors parsing index ", i)));
+ error_list.push_back(parse_error);
+ }
}
}
- if (server->channel_creds_type.empty()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "no known creds type found in \"channel_creds\""));
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"channel_creds\" array",
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"xds_servers\" array",
&error_list);
}
-grpc_error_handle XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
- XdsServer* server) {
+grpc_error_handle XdsBootstrap::ParseAuthorities(Json* json) {
std::vector<grpc_error_handle> error_list;
- std::string type;
- 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 {
- type = std::move(*it->second.mutable_string_value());
+ for (auto& p : *(json->mutable_object())) {
+ if (p.second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ "field:authorities element error: element is not a object"));
+ continue;
+ }
+ grpc_error_handle parse_error = ParseAuthority(&p.second, p.first);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
- Json config;
- it = json->mutable_object()->find("config");
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing \"authorities\"",
+ &error_list);
+}
+
+grpc_error_handle XdsBootstrap::ParseAuthority(Json* json,
+ const std::string& name) {
+ std::vector<grpc_error_handle> error_list;
+ Authority authority;
+ auto it =
+ json->mutable_object()->find("client_listener_resource_name_template");
if (it != json->mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
+ if (it->second.type() != Json::Type::STRING) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"config\" field is not an object"));
+ "\"client_listener_resource_name_template\" field is not a string"));
} else {
- config = std::move(it->second);
+ std::string expected_prefix = absl::StrCat("xdstp://", name, "/");
+ if (!absl::StartsWith(it->second.string_value(), expected_prefix)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("\"client_listener_resource_name_template\" field "
+ "must begin with \"",
+ expected_prefix, "\"")));
+ } else {
+ authority.client_listener_resource_name_template =
+ std::move(*it->second.mutable_string_value());
+ }
}
}
- // Select the first channel creds type that we support.
- if (server->channel_creds_type.empty() &&
- XdsChannelCredsRegistry::IsSupported(type)) {
- if (!XdsChannelCredsRegistry::IsValidConfig(type, config)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("invalid config for channel creds type \"", type, "\"")
- .c_str()));
+ it = json->mutable_object()->find("xds_servers");
+ if (it != json->mutable_object()->end()) {
+ 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_handle parse_error =
+ ParseXdsServerList(&it->second, &authority.xds_servers);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
- server->channel_creds_type = std::move(type);
- server->channel_creds_config = std::move(config);
- }
- // 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_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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_handle XdsBootstrap::ParseServerFeaturesArray(Json* json,
- XdsServer* server) {
- std::vector<grpc_error_handle> 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") {
- server->server_features.insert(std::move(*child.mutable_string_value()));
- }
+ if (error_list.empty()) {
+ authorities_[name] = std::move(authority);
}
- return GRPC_ERROR_CREATE_FROM_VECTOR(
- "errors parsing \"server_features\" array", &error_list);
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("errors parsing authority ", name), &error_list);
}
grpc_error_handle XdsBootstrap::ParseNode(Json* json) {
@@ -374,10 +435,8 @@ grpc_error_handle XdsBootstrap::ParseCertificateProviders(Json* json) {
std::vector<grpc_error_handle> error_list;
for (auto& certificate_provider : *(json->mutable_object())) {
if (certificate_provider.second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("element \"", certificate_provider.first,
- "\" is not an object")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "element \"", certificate_provider.first, "\" is not an object")));
} else {
grpc_error_handle parse_error = ParseCertificateProvider(
certificate_provider.first, &certificate_provider.second);
@@ -403,7 +462,10 @@ grpc_error_handle XdsBootstrap::ParseCertificateProvider(
CertificateProviderFactory* factory =
CertificateProviderRegistry::LookupCertificateProviderFactory(
plugin_name);
- if (factory != nullptr) {
+ if (factory == nullptr) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unrecognized plugin name: ", plugin_name)));
+ } else {
RefCountedPtr<CertificateProviderFactory::Config> config;
it = certificate_provider_json->mutable_object()->find("config");
if (it != certificate_provider_json->mutable_object()->end()) {
@@ -427,15 +489,9 @@ grpc_error_handle XdsBootstrap::ParseCertificateProvider(
{instance_name, {std::move(plugin_name), std::move(config)}});
}
}
- // 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_handle error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("errors parsing element \"", instance_name, "\"").c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
- }
- return error;
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ absl::StrCat("errors parsing element \"", instance_name, "\""),
+ &error_list);
}
std::string XdsBootstrap::ToString() const {
@@ -471,11 +527,32 @@ std::string XdsBootstrap::ToString() const {
"],\n"));
}
parts.push_back(" }\n],\n");
+ if (!client_default_listener_resource_name_template_.empty()) {
+ parts.push_back(absl::StrFormat(
+ "client_default_listener_resource_name_template=\"%s\",\n",
+ client_default_listener_resource_name_template_));
+ }
if (!server_listener_resource_name_template_.empty()) {
parts.push_back(
absl::StrFormat("server_listener_resource_name_template=\"%s\",\n",
server_listener_resource_name_template_));
}
+ parts.push_back("authorities={\n");
+ for (const auto& entry : authorities_) {
+ parts.push_back(absl::StrFormat(" %s={\n", entry.first));
+ parts.push_back(
+ absl::StrFormat(" client_listener_resource_name_template=\"%s\",\n",
+ entry.second.client_listener_resource_name_template));
+ parts.push_back(
+ absl::StrFormat(" servers=[\n"
+ " {\n"
+ " uri=\"%s\",\n"
+ " creds_type=%s,\n",
+ entry.second.xds_servers[0].server_uri,
+ entry.second.xds_servers[0].channel_creds_type));
+ parts.push_back(" },\n");
+ }
+ parts.push_back("}");
parts.push_back("certificate_providers={\n");
for (const auto& entry : certificate_providers_) {
parts.push_back(
diff --git a/grpc/src/core/ext/xds/xds_bootstrap.h b/grpc/src/core/ext/xds/xds_bootstrap.h
index eff5e7ab..36f38d99 100644
--- a/grpc/src/core/ext/xds/xds_bootstrap.h
+++ b/grpc/src/core/ext/xds/xds_bootstrap.h
@@ -37,15 +37,9 @@
namespace grpc_core {
-class XdsClient;
+bool XdsFederationEnabled();
-class XdsChannelCredsRegistry {
- public:
- static bool IsSupported(const std::string& creds_type);
- static bool IsValidConfig(const std::string& creds_type, const Json& config);
- static RefCountedPtr<grpc_channel_credentials> MakeChannelCreds(
- const std::string& creds_type, const Json& config);
-};
+class XdsClient;
class XdsBootstrap {
public:
@@ -64,9 +58,35 @@ class XdsBootstrap {
Json channel_creds_config;
std::set<std::string> server_features;
+ static XdsServer Parse(const Json& json, grpc_error_handle* error);
+
+ bool operator==(const XdsServer& other) const {
+ return (server_uri == other.server_uri &&
+ channel_creds_type == other.channel_creds_type &&
+ channel_creds_config == other.channel_creds_config &&
+ server_features == other.server_features);
+ }
+
+ bool operator<(const XdsServer& other) const {
+ if (server_uri < other.server_uri) return true;
+ if (channel_creds_type < other.channel_creds_type) return true;
+ if (channel_creds_config.Dump() < other.channel_creds_config.Dump()) {
+ return true;
+ }
+ if (server_features < other.server_features) return true;
+ return false;
+ }
+
+ Json::Object ToJson() const;
+
bool ShouldUseV3() const;
};
+ struct Authority {
+ std::string client_listener_resource_name_template;
+ absl::InlinedVector<XdsServer, 1> xds_servers;
+ };
+
// Creates bootstrap object from json_string.
// If *error is not GRPC_ERROR_NONE after returning, then there was an
// error parsing the contents.
@@ -82,22 +102,28 @@ class XdsBootstrap {
// add support for fallback for the xds channel.
const XdsServer& server() const { return servers_[0]; }
const Node* node() const { return node_.get(); }
+ const std::string& client_default_listener_resource_name_template() const {
+ return client_default_listener_resource_name_template_;
+ }
const std::string& server_listener_resource_name_template() const {
return server_listener_resource_name_template_;
}
-
+ const std::map<std::string, Authority>& authorities() const {
+ return authorities_;
+ }
+ const Authority* LookupAuthority(const std::string& name) const;
const CertificateProviderStore::PluginDefinitionMap& certificate_providers()
const {
return certificate_providers_;
}
+ // A util method to check that an xds server exists in this bootstrap file.
+ bool XdsServerExists(const XdsServer& server) const;
private:
- grpc_error_handle ParseXdsServerList(Json* json);
- grpc_error_handle ParseXdsServer(Json* json, size_t idx);
- grpc_error_handle ParseChannelCredsArray(Json* json, XdsServer* server);
- grpc_error_handle ParseChannelCreds(Json* json, size_t idx,
- XdsServer* server);
- grpc_error_handle ParseServerFeaturesArray(Json* json, XdsServer* server);
+ grpc_error_handle ParseXdsServerList(
+ Json* json, absl::InlinedVector<XdsServer, 1>* servers);
+ grpc_error_handle ParseAuthorities(Json* json);
+ grpc_error_handle ParseAuthority(Json* json, const std::string& name);
grpc_error_handle ParseNode(Json* json);
grpc_error_handle ParseLocality(Json* json);
grpc_error_handle ParseCertificateProviders(Json* json);
@@ -106,7 +132,9 @@ class XdsBootstrap {
absl::InlinedVector<XdsServer, 1> servers_;
std::unique_ptr<Node> node_;
+ std::string client_default_listener_resource_name_template_;
std::string server_listener_resource_name_template_;
+ std::map<std::string, Authority> authorities_;
CertificateProviderStore::PluginDefinitionMap certificate_providers_;
};
diff --git a/grpc/src/core/ext/xds/xds_certificate_provider.cc b/grpc/src/core/ext/xds/xds_certificate_provider.cc
index ce1ba673..903d4cf3 100644
--- a/grpc/src/core/ext/xds/xds_certificate_provider.cc
+++ b/grpc/src/core/ext/xds/xds_certificate_provider.cc
@@ -23,8 +23,6 @@
#include "absl/functional/bind_front.h"
#include "absl/strings/str_cat.h"
-#include "src/core/lib/gpr/useful.h"
-
namespace grpc_core {
namespace {
@@ -265,6 +263,8 @@ XdsCertificateProvider::~XdsCertificateProvider() {
distributor_->SetWatchStatusCallback(nullptr);
}
+const char* XdsCertificateProvider::type() const { return "Xds"; }
+
bool XdsCertificateProvider::ProvidesRootCerts(const std::string& cert_name) {
MutexLock lock(&mu_);
auto it = certificate_state_map_.find(cert_name);
@@ -379,7 +379,9 @@ void XdsCertificateProviderArgDestroy(void* p) {
xds_certificate_provider->Unref();
}
-int XdsCertificateProviderArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int XdsCertificateProviderArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
const grpc_arg_pointer_vtable kChannelArgVtable = {
XdsCertificateProviderArgCopy, XdsCertificateProviderArgDestroy,
diff --git a/grpc/src/core/ext/xds/xds_certificate_provider.h b/grpc/src/core/ext/xds/xds_certificate_provider.h
index 2f508830..d0f58548 100644
--- a/grpc/src/core/ext/xds/xds_certificate_provider.h
+++ b/grpc/src/core/ext/xds/xds_certificate_provider.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/xds/xds_api.h"
+#include "src/core/lib/matchers/matchers.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
#define GRPC_ARG_XDS_CERTIFICATE_PROVIDER \
@@ -34,11 +35,12 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
XdsCertificateProvider();
~XdsCertificateProvider() override;
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
- const override {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
return distributor_;
}
+ const char* type() const override;
+
bool ProvidesRootCerts(const std::string& cert_name);
void UpdateRootCertNameAndDistributor(
const std::string& cert_name, absl::string_view root_cert_name,
@@ -124,6 +126,12 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
bool require_client_certificate_ = false;
};
+ int CompareImpl(const grpc_tls_certificate_provider* other) const override {
+ // TODO(yashykt): Maybe do something better here.
+ return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
+ other);
+ }
+
void WatchStatusCallback(std::string cert_name, bool root_being_watched,
bool identity_being_watched);
diff --git a/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc b/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc
new file mode 100644
index 00000000..194350ec
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc
@@ -0,0 +1,109 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_channel_stack_modifier.h"
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/channel_init.h"
+
+namespace grpc_core {
+namespace {
+
+void* XdsChannelStackModifierArgCopy(void* p) {
+ XdsChannelStackModifier* arg = static_cast<XdsChannelStackModifier*>(p);
+ return arg->Ref().release();
+}
+
+void XdsChannelStackModifierArgDestroy(void* p) {
+ XdsChannelStackModifier* arg = static_cast<XdsChannelStackModifier*>(p);
+ arg->Unref();
+}
+
+int XdsChannelStackModifierArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
+
+const grpc_arg_pointer_vtable kChannelArgVtable = {
+ XdsChannelStackModifierArgCopy, XdsChannelStackModifierArgDestroy,
+ XdsChannelStackModifierArgCmp};
+
+const char* kXdsChannelStackModifierChannelArgName =
+ "grpc.internal.xds_channel_stack_modifier";
+
+} // namespace
+
+bool XdsChannelStackModifier::ModifyChannelStack(ChannelStackBuilder* builder) {
+ // Insert the filters after the census filter if present.
+ auto it = builder->mutable_stack()->begin();
+ while (it != builder->mutable_stack()->end()) {
+ const char* filter_name_at_it = it->filter->name;
+ if (strcmp("census_server", filter_name_at_it) == 0 ||
+ strcmp("opencensus_server", filter_name_at_it) == 0) {
+ break;
+ }
+ ++it;
+ }
+ if (it == builder->mutable_stack()->end()) {
+ // No census filter found. Reset iterator to the beginning. This will result
+ // in prepending the list of xDS HTTP filters to the current stack. Note
+ // that this stage is run before the stage that adds the top server filter,
+ // resulting in these filters being finally placed after the `server`
+ // filter.
+ it = builder->mutable_stack()->begin();
+ } else {
+ ++it;
+ }
+ for (const grpc_channel_filter* filter : filters_) {
+ it = builder->mutable_stack()->insert(
+ it, ChannelStackBuilder::StackEntry{filter, nullptr});
+ ++it;
+ }
+ return true;
+}
+
+grpc_arg XdsChannelStackModifier::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(kXdsChannelStackModifierChannelArgName),
+ const_cast<XdsChannelStackModifier*>(this), &kChannelArgVtable);
+}
+
+RefCountedPtr<XdsChannelStackModifier>
+XdsChannelStackModifier::GetFromChannelArgs(const grpc_channel_args& args) {
+ XdsChannelStackModifier* config_selector_provider =
+ grpc_channel_args_find_pointer<XdsChannelStackModifier>(
+ &args, kXdsChannelStackModifierChannelArgName);
+ return config_selector_provider != nullptr ? config_selector_provider->Ref()
+ : nullptr;
+}
+
+void RegisterXdsChannelStackModifier(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX, [](ChannelStackBuilder* builder) {
+ RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier =
+ XdsChannelStackModifier::GetFromChannelArgs(
+ *builder->channel_args());
+ if (channel_stack_modifier != nullptr) {
+ return channel_stack_modifier->ModifyChannelStack(builder);
+ }
+ return true;
+ });
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_channel_stack_modifier.h b/grpc/src/core/ext/xds/xds_channel_stack_modifier.h
new file mode 100644
index 00000000..0a164c2c
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_channel_stack_modifier.h
@@ -0,0 +1,53 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_STACK_MODIFIER_H
+#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+
+namespace grpc_core {
+
+// XdsChannelStackModifier allows for inserting xDS HTTP filters into the
+// channel stack. It is registered to mutate the
+// `ChannelStackBuilder` object via
+// ChannelInit::Builder::RegisterStage.
+class XdsChannelStackModifier : public RefCounted<XdsChannelStackModifier> {
+ public:
+ explicit XdsChannelStackModifier(
+ std::vector<const grpc_channel_filter*> filters)
+ : filters_(std::move(filters)) {}
+ // Returns true on success, false otherwise.
+ bool ModifyChannelStack(ChannelStackBuilder* builder);
+ grpc_arg MakeChannelArg() const;
+ static RefCountedPtr<XdsChannelStackModifier> GetFromChannelArgs(
+ const grpc_channel_args& args);
+
+ private:
+ std::vector<const grpc_channel_filter*> filters_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H */
diff --git a/grpc/src/core/ext/xds/xds_client.cc b/grpc/src/core/ext/xds/xds_client.cc
index d3549997..a085d46e 100644
--- a/grpc/src/core/ext/xds/xds_client.cc
+++ b/grpc/src/core/ext/xds/xds_client.cc
@@ -16,6 +16,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/xds/xds_client.h"
+
#include <inttypes.h>
#include <limits.h>
#include <string.h>
@@ -31,17 +33,20 @@
#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_bootstrap.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/ext/xds/xds_cluster.h"
+#include "src/core/ext/xds/xds_cluster_specifier_plugin.h"
+#include "src/core/ext/xds/xds_endpoint.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/ext/xds/xds_listener.h"
#include "src/core/lib/address_utils/sockaddr_utils.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/config/core_configuration.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
@@ -50,12 +55,13 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/security/credentials/channel_creds_registry.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"
+#include "src/core/lib/surface/lame_client.h"
+#include "src/core/lib/uri/uri_parser.h"
#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -71,6 +77,7 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
namespace {
Mutex* g_mu = nullptr;
+
const grpc_channel_args* g_channel_args ABSL_GUARDED_BY(*g_mu) = nullptr;
XdsClient* g_xds_client ABSL_GUARDED_BY(*g_mu) = nullptr;
char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr;
@@ -87,7 +94,7 @@ template <typename T>
class XdsClient::ChannelState::RetryableCall
: public InternallyRefCounted<RetryableCall<T>> {
public:
- explicit RetryableCall(RefCountedPtr<ChannelState> chand);
+ explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
void Orphan() override;
@@ -108,7 +115,7 @@ class XdsClient::ChannelState::RetryableCall
// every time we start a new call. It's null during call retry backoff.
OrphanablePtr<T> calld_;
// The owning xds channel.
- RefCountedPtr<ChannelState> chand_;
+ WeakRefCountedPtr<ChannelState> chand_;
// Retry state.
BackOff backoff_;
@@ -134,34 +141,66 @@ class XdsClient::ChannelState::AdsCallState
XdsClient* xds_client() const { return chand()->xds_client(); }
bool seen_response() const { return seen_response_; }
- void SubscribeLocked(const std::string& type_url, const std::string& name)
+ void SubscribeLocked(const XdsResourceType* type, const XdsResourceName& name,
+ bool delay_send)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
- void UnsubscribeLocked(const std::string& type_url, const std::string& name,
- bool delay_unsubscription)
+ void UnsubscribeLocked(const XdsResourceType* type,
+ const XdsResourceName& name, bool delay_unsubscription)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool HasSubscribedResources() const;
private:
- class ResourceState : public InternallyRefCounted<ResourceState> {
+ class AdsResponseParser : public XdsApi::AdsResponseParserInterface {
public:
- ResourceState(const std::string& type_url, const std::string& name,
- bool sent_initial_request)
- : type_url_(type_url),
- name_(name),
- sent_initial_request_(sent_initial_request) {
+ struct Result {
+ const XdsResourceType* type;
+ std::string type_url;
+ std::string version;
+ std::string nonce;
+ std::vector<std::string> errors;
+ std::map<std::string /*authority*/, std::set<XdsResourceKey>>
+ resources_seen;
+ bool have_valid_resources = false;
+ };
+
+ explicit AdsResponseParser(AdsCallState* ads_call_state)
+ : ads_call_state_(ads_call_state) {}
+
+ absl::Status ProcessAdsResponseFields(AdsResponseFields fields) override
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ void ParseResource(const XdsEncodingContext& context, size_t idx,
+ absl::string_view type_url,
+ absl::string_view serialized_resource) override
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ Result TakeResult() { return std::move(result_); }
+
+ private:
+ XdsClient* xds_client() const { return ads_call_state_->xds_client(); }
+
+ AdsCallState* ads_call_state_;
+ const Timestamp update_time_ = ExecCtx::Get()->Now();
+ Result result_;
+ };
+
+ class ResourceTimer : public InternallyRefCounted<ResourceTimer> {
+ public:
+ ResourceTimer(const XdsResourceType* type, const XdsResourceName& name)
+ : type_(type), name_(name) {
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
grpc_schedule_on_exec_ctx);
}
void Orphan() override {
- Finish();
+ MaybeCancelTimer();
Unref(DEBUG_LOCATION, "Orphan");
}
- void Start(RefCountedPtr<AdsCallState> ads_calld) {
- if (sent_initial_request_) return;
- sent_initial_request_ = true;
+ void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld) {
+ if (timer_started_) return;
+ timer_started_ = true;
ads_calld_ = std::move(ads_calld);
Ref(DEBUG_LOCATION, "timer").release();
timer_pending_ = true;
@@ -171,7 +210,7 @@ class XdsClient::ChannelState::AdsCallState
&timer_callback_);
}
- void Finish() {
+ void MaybeCancelTimer() {
if (timer_pending_) {
grpc_timer_cancel(&timer_);
timer_pending_ = false;
@@ -180,11 +219,12 @@ class XdsClient::ChannelState::AdsCallState
private:
static void OnTimer(void* arg, grpc_error_handle error) {
- ResourceState* self = static_cast<ResourceState*>(arg);
+ ResourceTimer* self = static_cast<ResourceTimer*>(arg);
{
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
self->OnTimerLocked(GRPC_ERROR_REF(error));
}
+ self->ads_calld_->xds_client()->work_serializer_.DrainQueue();
self->ads_calld_.reset();
self->Unref(DEBUG_LOCATION, "timer");
}
@@ -193,55 +233,32 @@ class XdsClient::ChannelState::AdsCallState
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
if (error == GRPC_ERROR_NONE && timer_pending_) {
timer_pending_ = false;
- grpc_error_handle watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat(
- "timeout obtaining resource {type=%s name=%s} from xds server",
- type_url_, name_)
- .c_str());
- watcher_error = grpc_error_set_int(
- watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ absl::Status watcher_error = absl::UnavailableError(absl::StrFormat(
+ "timeout obtaining resource {type=%s name=%s} from xds server",
+ type_->type_url(),
+ XdsClient::ConstructFullXdsResourceName(
+ name_.authority, type_->type_url(), name_.key)));
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
- grpc_error_std_string(watcher_error).c_str());
- }
- if (type_url_ == XdsApi::kLdsTypeUrl) {
- ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
- state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- 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_];
- state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- 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_];
- state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- 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_];
- state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
- } else {
- GPR_UNREACHABLE_CODE(return );
+ gpr_log(GPR_INFO, "[xds_client %p] xds server %s: %s",
+ ads_calld_->xds_client(),
+ ads_calld_->chand()->server_.server_uri.c_str(),
+ watcher_error.ToString().c_str());
}
- GRPC_ERROR_UNREF(watcher_error);
+ auto& authority_state =
+ ads_calld_->xds_client()->authority_state_map_[name_.authority];
+ ResourceState& state = authority_state.resource_map[type_][name_.key];
+ state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
+ ads_calld_->xds_client()->NotifyWatchersOnErrorLocked(state.watchers,
+ watcher_error);
}
GRPC_ERROR_UNREF(error);
}
- const std::string type_url_;
- const std::string name_;
+ const XdsResourceType* type_;
+ const XdsResourceName name_;
RefCountedPtr<AdsCallState> ads_calld_;
- bool sent_initial_request_;
+ bool timer_started_ = false;
bool timer_pending_ = false;
grpc_timer timer_;
grpc_closure timer_callback_;
@@ -255,24 +272,12 @@ class XdsClient::ChannelState::AdsCallState
grpc_error_handle error = GRPC_ERROR_NONE;
// Subscribed resources of this type.
- std::map<std::string /* name */, OrphanablePtr<ResourceState>>
+ std::map<std::string /*authority*/,
+ std::map<XdsResourceKey, OrphanablePtr<ResourceTimer>>>
subscribed_resources;
};
- void SendMessageLocked(const std::string& type_url)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
-
- void AcceptLdsUpdateLocked(std::string version, grpc_millis update_time,
- XdsApi::LdsUpdateMap lds_update_map)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
- void AcceptRdsUpdateLocked(std::string version, grpc_millis update_time,
- XdsApi::RdsUpdateMap rds_update_map)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
- void AcceptCdsUpdateLocked(std::string version, grpc_millis update_time,
- XdsApi::CdsUpdateMap cds_update_map)
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
- void AcceptEdsUpdateLocked(std::string version, grpc_millis update_time,
- XdsApi::EdsUpdateMap eds_update_map)
+ void SendMessageLocked(const XdsResourceType* type)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
static void OnRequestSent(void* arg, grpc_error_handle error);
@@ -287,8 +292,9 @@ class XdsClient::ChannelState::AdsCallState
bool IsCurrentCallOnChannel() const;
- std::set<absl::string_view> ResourceNamesForRequest(
- const std::string& type_url);
+ // Constructs a list of resource names of a given type for an ADS
+ // request. Also starts the timer for each resource if needed.
+ std::vector<std::string> ResourceNamesForRequest(const XdsResourceType* type);
// The owning RetryableCall<>.
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
@@ -317,10 +323,10 @@ class XdsClient::ChannelState::AdsCallState
grpc_closure on_status_received_;
// Resource types for which requests need to be sent.
- std::set<std::string /*type_url*/> buffered_requests_;
+ std::set<const XdsResourceType*> buffered_requests_;
// State for each resource type.
- std::map<std::string /*type_url*/, ResourceTypeState> state_map_;
+ std::map<const XdsResourceType*, ResourceTypeState> state_map_;
};
// Contains an LRS call to the xds server.
@@ -344,7 +350,7 @@ class XdsClient::ChannelState::LrsCallState
// Reports client-side load stats according to a fixed interval.
class Reporter : public InternallyRefCounted<Reporter> {
public:
- Reporter(RefCountedPtr<LrsCallState> parent, grpc_millis report_interval)
+ Reporter(RefCountedPtr<LrsCallState> parent, Duration report_interval)
: parent_(std::move(parent)), report_interval_(report_interval) {
GRPC_CLOSURE_INIT(&on_next_report_timer_, OnNextReportTimer, this,
grpc_schedule_on_exec_ctx);
@@ -375,7 +381,7 @@ class XdsClient::ChannelState::LrsCallState
RefCountedPtr<LrsCallState> parent_;
// The load reporting state.
- const grpc_millis report_interval_;
+ const Duration report_interval_;
bool last_report_counters_were_zero_ = false;
bool next_report_timer_callback_pending_ = false;
grpc_timer next_report_timer_;
@@ -422,7 +428,7 @@ class XdsClient::ChannelState::LrsCallState
// Load reporting state.
bool send_all_clusters_ = false;
std::set<std::string> cluster_names_; // Asked for by the LRS server.
- grpc_millis load_reporting_interval_ = 0;
+ Duration load_reporting_interval_;
OrphanablePtr<Reporter> reporter_;
};
@@ -433,27 +439,32 @@ class XdsClient::ChannelState::LrsCallState
class XdsClient::ChannelState::StateWatcher
: public AsyncConnectivityStateWatcherInterface {
public:
- explicit StateWatcher(RefCountedPtr<ChannelState> parent)
+ explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
: parent_(std::move(parent)) {}
private:
void OnConnectivityStateChange(grpc_connectivity_state new_state,
const 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"));
+ {
+ 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 for server %s in "
+ "state TRANSIENT_FAILURE: %s",
+ parent_->xds_client(), parent_->server_.server_uri.c_str(),
+ status.ToString().c_str());
+ parent_->xds_client_->NotifyOnErrorLocked(
+ absl::UnavailableError(absl::StrCat(
+ "xds channel in TRANSIENT_FAILURE, connectivity error: ",
+ status.ToString())));
+ }
}
+ parent_->xds_client()->work_serializer_.DrainQueue();
}
- RefCountedPtr<ChannelState> parent_;
+ WeakRefCountedPtr<ChannelState> parent_;
};
//
@@ -465,17 +476,17 @@ namespace {
grpc_channel* CreateXdsChannel(grpc_channel_args* args,
const XdsBootstrap::XdsServer& server) {
RefCountedPtr<grpc_channel_credentials> channel_creds =
- XdsChannelCredsRegistry::MakeChannelCreds(server.channel_creds_type,
- server.channel_creds_config);
- return grpc_secure_channel_create(channel_creds.get(),
- server.server_uri.c_str(), args, nullptr);
+ CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
+ server.channel_creds_type, server.channel_creds_config);
+ return grpc_channel_create(server.server_uri.c_str(), channel_creds.get(),
+ args);
}
} // namespace
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
const XdsBootstrap::XdsServer& server)
- : InternallyRefCounted<ChannelState>(
+ : DualRefCounted<ChannelState>(
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
? "ChannelState"
: nullptr),
@@ -492,19 +503,26 @@ XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
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);
+ gpr_log(GPR_INFO, "[xds_client %p] destroying xds channel %p for server %s",
+ xds_client(), this, server_.server_uri.c_str());
}
grpc_channel_destroy(channel_);
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
}
-void XdsClient::ChannelState::Orphan() {
+// This method should only ever be called when holding the lock, but we can't
+// use a ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
+// called from DualRefCounted::Unref, which cannot have a lock annotation for a
+// lock in this subclass.
+void XdsClient::ChannelState::Orphan() ABSL_NO_THREAD_SAFETY_ANALYSIS {
shutting_down_ = true;
CancelConnectivityWatchLocked();
+ // At this time, all strong refs are removed, remove from channel map to
+ // prevent subsequent subscription from trying to use this ChannelState as it
+ // is shutting down.
+ xds_client_->xds_server_channel_map_.erase(server_);
ads_calld_.reset();
lrs_calld_.reset();
- Unref(DEBUG_LOCATION, "ChannelState+orphaned");
}
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
@@ -523,33 +541,54 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
void XdsClient::ChannelState::MaybeStartLrsCall() {
if (lrs_calld_ != nullptr) return;
- lrs_calld_.reset(
- new RetryableCall<LrsCallState>(Ref(DEBUG_LOCATION, "ChannelState+lrs")));
+ lrs_calld_.reset(new RetryableCall<LrsCallState>(
+ WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
+}
+
+void XdsClient::ChannelState::StopLrsCallLocked() {
+ xds_client_->xds_load_report_server_map_.erase(server_);
+ lrs_calld_.reset();
+}
+
+namespace {
+
+bool IsLameChannel(grpc_channel* channel) {
+ grpc_channel_element* elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
+ return elem->filter == &grpc_lame_filter;
}
-void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
+} // namespace
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
+ if (IsLameChannel(channel_)) {
+ xds_client()->NotifyOnErrorLocked(
+ absl::UnavailableError("xds client has a lame channel"));
+ return;
+ }
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
GPR_ASSERT(client_channel != nullptr);
- watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
+ watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
client_channel->AddConnectivityWatcher(
GRPC_CHANNEL_IDLE,
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
}
void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
+ if (IsLameChannel(channel_)) {
+ return;
+ }
ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
GPR_ASSERT(client_channel != nullptr);
client_channel->RemoveConnectivityWatcher(watcher_);
}
-void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
- const std::string& name) {
+void XdsClient::ChannelState::SubscribeLocked(const XdsResourceType* type,
+ const XdsResourceName& 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")));
+ WeakRef(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.
@@ -559,17 +598,19 @@ void XdsClient::ChannelState::SubscribeLocked(const std::string& type_url,
// 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()->SubscribeLocked(type_url, name);
+ ads_calld()->SubscribeLocked(type, name, /*delay_send=*/false);
}
-void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
- const std::string& name,
+void XdsClient::ChannelState::UnsubscribeLocked(const XdsResourceType* type,
+ const XdsResourceName& name,
bool delay_unsubscription) {
if (ads_calld_ != nullptr) {
auto* calld = ads_calld_->calld();
if (calld != nullptr) {
- calld->UnsubscribeLocked(type_url, name, delay_unsubscription);
- if (!calld->HasSubscribedResources()) ads_calld_.reset();
+ calld->UnsubscribeLocked(type, name, delay_unsubscription);
+ if (!calld->HasSubscribedResources()) {
+ ads_calld_.reset();
+ }
}
}
}
@@ -580,15 +621,15 @@ void XdsClient::ChannelState::UnsubscribeLocked(const std::string& type_url,
template <typename T>
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
- RefCountedPtr<ChannelState> chand)
+ WeakRefCountedPtr<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)) {
+ backoff_(BackOff::Options()
+ .set_initial_backoff(Duration::Seconds(
+ GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS))
+ .set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER)
+ .set_jitter(GRPC_XDS_RECONNECT_JITTER)
+ .set_max_backoff(Duration::Seconds(
+ GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS))) {
// Closure Initialization
GRPC_CLOSURE_INIT(&on_retry_timer_, OnRetryTimer, this,
grpc_schedule_on_exec_ctx);
@@ -605,17 +646,11 @@ void XdsClient::ChannelState::RetryableCall<T>::Orphan() {
template <typename T>
void XdsClient::ChannelState::RetryableCall<T>::OnCallFinishedLocked() {
- const bool seen_response = calld_->seen_response();
+ // If we saw a response on the current stream, reset backoff.
+ if (calld_->seen_response()) backoff_.Reset();
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();
- }
+ // Start retry timer.
+ StartRetryTimerLocked();
}
template <typename T>
@@ -624,10 +659,10 @@ void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
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);
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] xds server %s: start new call from retryable call %p",
+ chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
}
calld_ = MakeOrphanable<T>(
this->Ref(DEBUG_LOCATION, "RetryableCall+start_new_call"));
@@ -636,13 +671,15 @@ void XdsClient::ChannelState::RetryableCall<T>::StartNewCallLocked() {
template <typename T>
void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
if (shutting_down_) return;
- const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
+ const Timestamp 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);
+ Duration timeout =
+ std::max(next_attempt_time - ExecCtx::Get()->Now(), Duration::Zero());
gpr_log(GPR_INFO,
- "[xds_client %p] Failed to connect to xds server (chand: %p) "
+ "[xds_client %p] xds server %s: call attempt failed; "
"retry timer will fire in %" PRId64 "ms.",
- chand()->xds_client(), chand(), timeout);
+ chand()->xds_client(), chand()->server_.server_uri.c_str(),
+ timeout.millis());
}
this->Ref(DEBUG_LOCATION, "RetryableCall+retry_timer_start").release();
grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_);
@@ -666,10 +703,10 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
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);
+ gpr_log(GPR_INFO,
+ "[xds_client %p] xds server %s: retry timer fired (retryable "
+ "call: %p)",
+ chand()->xds_client(), chand()->server_.server_uri.c_str(), this);
}
StartNewCallLocked();
}
@@ -677,6 +714,169 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
}
//
+// XdsClient::ChannelState::AdsCallState::AdsResponseParser
+//
+
+absl::Status XdsClient::ChannelState::AdsCallState::AdsResponseParser::
+ ProcessAdsResponseFields(AdsResponseFields fields) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] xds server %s: received ADS response: type_url=%s, "
+ "version=%s, nonce=%s, num_resources=%" PRIuPTR,
+ ads_call_state_->xds_client(),
+ ads_call_state_->chand()->server_.server_uri.c_str(),
+ fields.type_url.c_str(), fields.version.c_str(), fields.nonce.c_str(),
+ fields.num_resources);
+ }
+ result_.type =
+ ads_call_state_->xds_client()->GetResourceTypeLocked(fields.type_url);
+ if (result_.type == nullptr) {
+ return absl::InvalidArgumentError(
+ absl::StrCat("unknown resource type ", fields.type_url));
+ }
+ result_.type_url = std::move(fields.type_url);
+ result_.version = std::move(fields.version);
+ result_.nonce = std::move(fields.nonce);
+ return absl::OkStatus();
+}
+
+namespace {
+
+// Build a resource metadata struct for ADS result accepting methods and CSDS.
+XdsApi::ResourceMetadata CreateResourceMetadataAcked(
+ std::string serialized_proto, std::string version, Timestamp update_time) {
+ XdsApi::ResourceMetadata resource_metadata;
+ resource_metadata.serialized_proto = std::move(serialized_proto);
+ resource_metadata.update_time = update_time;
+ resource_metadata.version = std::move(version);
+ resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
+ return resource_metadata;
+}
+
+// Update resource_metadata for NACK.
+void UpdateResourceMetadataNacked(const std::string& version,
+ const std::string& details,
+ Timestamp update_time,
+ XdsApi::ResourceMetadata* resource_metadata) {
+ resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
+ resource_metadata->failed_version = version;
+ resource_metadata->failed_details = details;
+ resource_metadata->failed_update_time = update_time;
+}
+
+} // namespace
+
+void XdsClient::ChannelState::AdsCallState::AdsResponseParser::ParseResource(
+ const XdsEncodingContext& context, size_t idx, absl::string_view type_url,
+ absl::string_view serialized_resource) {
+ // Check the type_url of the resource.
+ bool is_v2 = false;
+ if (!result_.type->IsType(type_url, &is_v2)) {
+ result_.errors.emplace_back(
+ absl::StrCat("resource index ", idx, ": incorrect resource type ",
+ type_url, " (should be ", result_.type_url, ")"));
+ return;
+ }
+ // Parse the resource.
+ absl::StatusOr<XdsResourceType::DecodeResult> result =
+ result_.type->Decode(context, serialized_resource, is_v2);
+ if (!result.ok()) {
+ result_.errors.emplace_back(
+ absl::StrCat("resource index ", idx, ": ", result.status().ToString()));
+ return;
+ }
+ // Check the resource name.
+ auto resource_name =
+ xds_client()->ParseXdsResourceName(result->name, result_.type);
+ if (!resource_name.ok()) {
+ result_.errors.emplace_back(absl::StrCat(
+ "resource index ", idx, ": Cannot parse xDS resource name \"",
+ result->name, "\""));
+ return;
+ }
+ // Cancel resource-does-not-exist timer, if needed.
+ auto timer_it = ads_call_state_->state_map_.find(result_.type);
+ if (timer_it != ads_call_state_->state_map_.end()) {
+ auto it =
+ timer_it->second.subscribed_resources.find(resource_name->authority);
+ if (it != timer_it->second.subscribed_resources.end()) {
+ auto res_it = it->second.find(resource_name->key);
+ if (res_it != it->second.end()) {
+ res_it->second->MaybeCancelTimer();
+ }
+ }
+ }
+ // Lookup the authority in the cache.
+ auto authority_it =
+ xds_client()->authority_state_map_.find(resource_name->authority);
+ if (authority_it == xds_client()->authority_state_map_.end()) {
+ return; // Skip resource -- we don't have a subscription for it.
+ }
+ // Found authority, so look up type.
+ AuthorityState& authority_state = authority_it->second;
+ auto type_it = authority_state.resource_map.find(result_.type);
+ if (type_it == authority_state.resource_map.end()) {
+ return; // Skip resource -- we don't have a subscription for it.
+ }
+ auto& type_map = type_it->second;
+ // Found type, so look up resource key.
+ auto it = type_map.find(resource_name->key);
+ if (it == type_map.end()) {
+ return; // Skip resource -- we don't have a subscription for it.
+ }
+ ResourceState& resource_state = it->second;
+ // If needed, record that we've seen this resource.
+ if (result_.type->AllResourcesRequiredInSotW()) {
+ result_.resources_seen[resource_name->authority].insert(resource_name->key);
+ }
+ // Update resource state based on whether the resource is valid.
+ if (!result->resource.ok()) {
+ result_.errors.emplace_back(absl::StrCat(
+ "resource index ", idx, ": ", result->name,
+ ": validation error: ", result->resource.status().ToString()));
+ xds_client()->NotifyWatchersOnErrorLocked(
+ resource_state.watchers,
+ absl::UnavailableError(absl::StrCat(
+ "invalid resource: ", result->resource.status().ToString())));
+ UpdateResourceMetadataNacked(result_.version,
+ result->resource.status().ToString(),
+ update_time_, &resource_state.meta);
+ return;
+ }
+ // Resource is valid.
+ result_.have_valid_resources = true;
+ // If it didn't change, ignore it.
+ if (resource_state.resource != nullptr &&
+ result_.type->ResourcesEqual(resource_state.resource.get(),
+ result->resource->get())) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] %s resource %s identical to current, ignoring.",
+ xds_client(), result_.type_url.c_str(), result->name.c_str());
+ }
+ return;
+ }
+ // Update the resource state.
+ resource_state.resource = std::move(*result->resource);
+ resource_state.meta = CreateResourceMetadataAcked(
+ std::string(serialized_resource), result_.version, update_time_);
+ // Notify watchers.
+ auto& watchers_list = resource_state.watchers;
+ auto* value =
+ result_.type->CopyResource(resource_state.resource.get()).release();
+ xds_client()->work_serializer_.Schedule(
+ [watchers_list, value]()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnGenericResourceChanged(value);
+ }
+ delete value;
+ },
+ DEBUG_LOCATION);
+}
+
+//
// XdsClient::ChannelState::AdsCallState
//
@@ -692,14 +892,17 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
// the polling entities from client_channel.
GPR_ASSERT(xds_client() != nullptr);
// Create a call with the specified method name.
- const auto& method =
+ const char* method =
chand()->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;
+ ? "/envoy.service.discovery.v3.AggregatedDiscoveryService/"
+ "StreamAggregatedResources"
+ : "/envoy.service.discovery.v2.AggregatedDiscoveryService/"
+ "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);
+ xds_client()->interested_parties_,
+ StaticSlice::FromStaticString(method).c_slice(), nullptr,
+ Timestamp::InfFuture(), nullptr);
GPR_ASSERT(call_ != nullptr);
// Init data associated with the call.
grpc_metadata_array_init(&initial_metadata_recv_);
@@ -707,9 +910,9 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
// 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_);
+ "[xds_client %p] xds server %s: starting ADS call "
+ "(calld: %p, call: %p)",
+ xds_client(), chand()->server_.server_uri.c_str(), this, call_);
}
// Create the ops.
grpc_call_error call_error;
@@ -729,17 +932,20 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
// 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_) {
- SubscribeLocked(XdsApi::kLdsTypeUrl, std::string(p.first));
- }
- for (const auto& p : xds_client()->route_config_map_) {
- SubscribeLocked(XdsApi::kRdsTypeUrl, std::string(p.first));
- }
- for (const auto& p : xds_client()->cluster_map_) {
- SubscribeLocked(XdsApi::kCdsTypeUrl, std::string(p.first));
+ for (const auto& a : xds_client()->authority_state_map_) {
+ const std::string& authority = a.first;
+ // Skip authorities that are not using this xDS channel.
+ if (a.second.channel_state != chand()) continue;
+ for (const auto& t : a.second.resource_map) {
+ const XdsResourceType* type = t.first;
+ for (const auto& r : t.second) {
+ const XdsResourceKey& resource_key = r.first;
+ SubscribeLocked(type, {authority, resource_key}, /*delay_send=*/true);
+ }
+ }
}
- for (const auto& p : xds_client()->endpoint_map_) {
- SubscribeLocked(XdsApi::kEdsTypeUrl, std::string(p.first));
+ for (const auto& p : state_map_) {
+ SendMessageLocked(p.first);
}
// Op: recv initial metadata.
op = ops;
@@ -803,34 +1009,30 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
}
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
- const std::string& type_url)
+ const XdsResourceType* type)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
// Buffer message sending if an existing message is in flight.
if (send_message_payload_ != nullptr) {
- buffered_requests_.insert(type_url);
+ buffered_requests_.insert(type);
return;
}
- auto& state = state_map_[type_url];
+ auto& state = state_map_[type];
grpc_slice request_payload_slice;
- std::set<absl::string_view> resource_names =
- ResourceNamesForRequest(type_url);
request_payload_slice = xds_client()->api_.CreateAdsRequest(
- chand()->server_, type_url, resource_names,
- xds_client()->resource_version_map_[type_url], 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);
- }
+ chand()->server_,
+ chand()->server_.ShouldUseV3() ? type->type_url() : type->v2_type_url(),
+ chand()->resource_type_version_map_[type], state.nonce,
+ ResourceNamesForRequest(type), GRPC_ERROR_REF(state.error),
+ !sent_initial_message_);
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(),
- xds_client()->resource_version_map_[type_url].c_str(),
- state.nonce.c_str(), grpc_error_std_string(state.error).c_str(),
- absl::StrJoin(resource_names, " ").c_str());
+ "[xds_client %p] xds server %s: sending ADS request: type=%s "
+ "version=%s nonce=%s error=%s",
+ xds_client(), chand()->server_.server_uri.c_str(),
+ std::string(type->type_url()).c_str(),
+ chand()->resource_type_version_map_[type].c_str(),
+ state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
}
GRPC_ERROR_UNREF(state.error);
state.error = GRPC_ERROR_NONE;
@@ -850,27 +1052,33 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
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);
+ "[xds_client %p] xds server %s: error starting ADS send_message "
+ "batch on calld=%p: call_error=%d",
+ xds_client(), chand()->server_.server_uri.c_str(), this,
+ call_error);
GPR_ASSERT(GRPC_CALL_OK == call_error);
}
}
void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
- const std::string& type_url, const std::string& name) {
- auto& state = state_map_[type_url].subscribed_resources[name];
+ const XdsResourceType* type, const XdsResourceName& name, bool delay_send) {
+ auto& state = state_map_[type].subscribed_resources[name.authority][name.key];
if (state == nullptr) {
- state = MakeOrphanable<ResourceState>(
- type_url, name, !xds_client()->resource_version_map_[type_url].empty());
- SendMessageLocked(type_url);
+ state = MakeOrphanable<ResourceTimer>(type, name);
+ if (!delay_send) SendMessageLocked(type);
}
}
void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
- const std::string& type_url, const std::string& name,
+ const XdsResourceType* type, const XdsResourceName& name,
bool delay_unsubscription) {
- state_map_[type_url].subscribed_resources.erase(name);
- if (!delay_unsubscription) SendMessageLocked(type_url);
+ auto& type_state_map = state_map_[type];
+ auto& authority_map = type_state_map.subscribed_resources[name.authority];
+ authority_map.erase(name.key);
+ if (authority_map.empty()) {
+ type_state_map.subscribed_resources.erase(name.authority);
+ }
+ if (!delay_unsubscription) SendMessageLocked(type);
}
bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
@@ -880,271 +1088,6 @@ bool XdsClient::ChannelState::AdsCallState::HasSubscribedResources() const {
return false;
}
-namespace {
-
-// Build a resource metadata struct for ADS result accepting methods and CSDS.
-XdsApi::ResourceMetadata CreateResourceMetadataAcked(
- std::string serialized_proto, std::string version,
- grpc_millis update_time) {
- XdsApi::ResourceMetadata resource_metadata;
- resource_metadata.serialized_proto = std::move(serialized_proto);
- resource_metadata.update_time = update_time;
- resource_metadata.version = std::move(version);
- resource_metadata.client_status = XdsApi::ResourceMetadata::ACKED;
- return resource_metadata;
-}
-
-} // namespace
-
-void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
- std::string version, grpc_millis update_time,
- 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<std::string> rds_resource_names_seen;
- for (auto& p : lds_update_map) {
- const std::string& listener_name = p.first;
- XdsApi::LdsUpdate& lds_update = p.second.resource;
- 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: %s", xds_client(),
- listener_name.c_str(), lds_update.ToString().c_str());
- }
- // Record the RDS resource names seen.
- if (!lds_update.http_connection_manager.route_config_name.empty()) {
- rds_resource_names_seen.insert(
- lds_update.http_connection_manager.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);
- listener_state.meta = CreateResourceMetadataAcked(
- std::move(p.second.serialized_proto), version, update_time);
- // 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 std::string& 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 std::string& 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::AcceptRdsUpdateLocked(
- std::string version, grpc_millis update_time,
- 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 std::string& route_config_name = p.first;
- XdsApi::RdsUpdate& rds_update = p.second.resource;
- 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);
- route_config_state.meta = CreateResourceMetadataAcked(
- std::move(p.second.serialized_proto), version, update_time);
- // Notify all watchers.
- for (const auto& p : route_config_state.watchers) {
- p.first->OnRouteConfigChanged(*route_config_state.update);
- }
- }
-}
-
-void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
- std::string version, grpc_millis update_time,
- 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<std::string> eds_resource_names_seen;
- for (auto& p : cds_update_map) {
- const char* cluster_name = p.first.c_str();
- XdsApi::CdsUpdate& cds_update = p.second.resource;
- 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: %s", xds_client(),
- cluster_name, cds_update.ToString().c_str());
- }
- // 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);
- cluster_state.meta = CreateResourceMetadataAcked(
- std::move(p.second.serialized_proto), version, update_time);
- // 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 std::string& 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 std::string& 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::AcceptEdsUpdateLocked(
- std::string version, grpc_millis update_time,
- 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.resource;
- 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);
- endpoint_state.meta = CreateResourceMetadataAcked(
- std::move(p.second.serialized_proto), version, update_time);
- // 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_handle error) {
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
@@ -1187,6 +1130,7 @@ void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
MutexLock lock(&ads_calld->xds_client()->mu_);
done = ads_calld->OnResponseReceivedLocked();
}
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
}
@@ -1203,58 +1147,75 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
grpc_byte_buffer_destroy(recv_message_payload_);
recv_message_payload_ = nullptr;
// Parse and validate the response.
- XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
- chand()->server_, response_slice,
- ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
- ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
+ AdsResponseParser parser(this);
+ absl::Status status = xds_client()->api_.ParseAdsResponse(
+ chand()->server_, response_slice, &parser);
grpc_slice_unref_internal(response_slice);
- if (result.type_url.empty()) {
+ if (!status.ok()) {
// Ignore unparsable response.
gpr_log(GPR_ERROR,
- "[xds_client %p] Error parsing ADS response (%s) -- ignoring",
- xds_client(), grpc_error_std_string(result.parse_error).c_str());
- GRPC_ERROR_UNREF(result.parse_error);
+ "[xds_client %p] xds server %s: error parsing ADS response (%s) "
+ "-- ignoring",
+ xds_client(), chand()->server_.server_uri.c_str(),
+ status.ToString().c_str());
} else {
- grpc_millis update_time = grpc_core::ExecCtx::Get()->Now();
+ seen_response_ = true;
+ AdsResponseParser::Result result = parser.TakeResult();
// 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) {
- xds_client()->UpdateResourceMetadataWithFailedParseResultLocked(
- update_time, result);
+ auto& state = state_map_[result.type];
+ state.nonce = result.nonce;
+ // If we got an error, set state.error so that we'll NACK the update.
+ if (!result.errors.empty()) {
+ std::string error = absl::StrJoin(result.errors, "; ");
+ gpr_log(
+ GPR_ERROR,
+ "[xds_client %p] xds server %s: ADS response invalid for resource "
+ "type %s version %s, will NACK: nonce=%s error=%s",
+ xds_client(), chand()->server_.server_uri.c_str(),
+ result.type_url.c_str(), result.version.c_str(), state.nonce.c_str(),
+ error.c_str());
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_std_string(result.parse_error).c_str());
- SendMessageLocked(result.type_url);
- } else {
- seen_response_ = true;
- // Accept the ADS response according to the type_url.
- if (result.type_url == XdsApi::kLdsTypeUrl) {
- AcceptLdsUpdateLocked(result.version, update_time,
- std::move(result.lds_update_map));
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
- AcceptRdsUpdateLocked(result.version, update_time,
- std::move(result.rds_update_map));
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
- AcceptCdsUpdateLocked(result.version, update_time,
- std::move(result.cds_update_map));
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
- AcceptEdsUpdateLocked(result.version, update_time,
- std::move(result.eds_update_map));
+ state.error = grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(error),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAVAILABLE);
+ }
+ // Delete resources not seen in update if needed.
+ if (result.type->AllResourcesRequiredInSotW()) {
+ for (auto& a : xds_client()->authority_state_map_) {
+ const std::string& authority = a.first;
+ AuthorityState& authority_state = a.second;
+ // Skip authorities that are not using this xDS channel.
+ if (authority_state.channel_state != chand()) continue;
+ auto seen_authority_it = result.resources_seen.find(authority);
+ // Find this resource type.
+ auto type_it = authority_state.resource_map.find(result.type);
+ if (type_it == authority_state.resource_map.end()) continue;
+ // Iterate over resource ids.
+ for (auto& r : type_it->second) {
+ const XdsResourceKey& resource_key = r.first;
+ ResourceState& resource_state = r.second;
+ if (seen_authority_it == result.resources_seen.end() ||
+ seen_authority_it->second.find(resource_key) ==
+ seen_authority_it->second.end()) {
+ // 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 ADS 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 (resource_state.resource == nullptr) continue;
+ resource_state.resource.reset();
+ xds_client()->NotifyWatchersOnResourceDoesNotExist(
+ resource_state.watchers);
+ }
+ }
}
- xds_client()->resource_version_map_[result.type_url] =
+ }
+ // If we had valid resources, update the version.
+ if (result.have_valid_resources) {
+ chand()->resource_type_version_map_[result.type] =
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) {
@@ -1262,6 +1223,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
}
}
+ // Send ACK or NACK.
+ SendMessageLocked(result.type);
}
if (xds_client()->shutting_down_) return true;
// Keep listening for updates.
@@ -1286,6 +1249,7 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
MutexLock lock(&ads_calld->xds_client()->mu_);
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
}
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
}
@@ -1294,9 +1258,11 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
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_,
+ "[xds_client %p] xds server %s: ADS call status received "
+ "(chand=%p, ads_calld=%p, call=%p): "
+ "status=%d, details='%s', error='%s'",
+ xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
+ call_, status_code_, status_details,
grpc_error_std_string(error).c_str());
gpr_free(status_details);
}
@@ -1305,8 +1271,11 @@ void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
// Try to restart the call.
parent_->OnCallFinishedLocked();
// Send error to all watchers.
- xds_client()->NotifyOnErrorLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("xds call failed"));
+ xds_client()->NotifyOnErrorLocked(absl::UnavailableError(absl::StrFormat(
+ "xDS call failed: xDS server: %s, ADS call status code=%d, "
+ "details='%s', error='%s'",
+ chand()->server_.server_uri, status_code_,
+ StringViewFromSlice(status_details_), grpc_error_std_string(error))));
}
GRPC_ERROR_UNREF(error);
}
@@ -1318,16 +1287,21 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
return this == chand()->ads_calld_->calld();
}
-std::set<absl::string_view>
+std::vector<std::string>
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
- const std::string& type_url) {
- std::set<absl::string_view> resource_names;
- auto it = state_map_.find(type_url);
+ const XdsResourceType* type) {
+ std::vector<std::string> resource_names;
+ auto it = state_map_.find(type);
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"));
+ for (auto& a : it->second.subscribed_resources) {
+ const std::string& authority = a.first;
+ for (auto& p : a.second) {
+ const XdsResourceKey& resource_key = p.first;
+ resource_names.emplace_back(XdsClient::ConstructFullXdsResourceName(
+ authority, type->type_url(), resource_key));
+ OrphanablePtr<ResourceTimer>& resource_timer = p.second;
+ resource_timer->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceTimer"));
+ }
}
}
return resource_names;
@@ -1345,7 +1319,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::Orphan() {
void XdsClient::ChannelState::LrsCallState::Reporter::
ScheduleNextReportLocked() {
- const grpc_millis next_report_time = ExecCtx::Get()->Now() + report_interval_;
+ const Timestamp 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;
@@ -1391,15 +1365,19 @@ bool LoadReportCountersAreZero(const XdsApi::ClusterLoadReportMap& snapshot) {
bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
// Construct snapshot from all reported stats.
XdsApi::ClusterLoadReportMap snapshot =
- xds_client()->BuildLoadReportSnapshotLocked(parent_->send_all_clusters_,
+ xds_client()->BuildLoadReportSnapshotLocked(parent_->chand()->server_,
+ 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_) {
- if (xds_client()->load_report_map_.empty()) {
- parent_->chand()->StopLrsCall();
+ auto it = xds_client()->xds_load_report_server_map_.find(
+ parent_->chand()->server_);
+ if (it == xds_client()->xds_load_report_server_map_.end() ||
+ it->second.load_report_map.empty()) {
+ it->second.channel_state->StopLrsCallLocked();
return true;
}
ScheduleNextReportLocked();
@@ -1420,8 +1398,10 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
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);
+ "[xds_client %p] xds server %s: error starting LRS send_message "
+ "batch on calld=%p: call_error=%d",
+ xds_client(), parent_->chand()->server_.server_uri.c_str(), this,
+ call_error);
GPR_ASSERT(GRPC_CALL_OK == call_error);
}
return false;
@@ -1443,8 +1423,11 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
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();
+ auto it =
+ xds_client()->xds_load_report_server_map_.find(parent_->chand()->server_);
+ if (it == xds_client()->xds_load_report_server_map_.end() ||
+ it->second.load_report_map.empty()) {
+ it->second.channel_state->StopLrsCallLocked();
GRPC_ERROR_UNREF(error);
return true;
}
@@ -1476,14 +1459,15 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
// activity in xds_client()->interested_parties_, which is comprised of
// the polling entities from client_channel.
GPR_ASSERT(xds_client() != nullptr);
- const auto& method =
+ const char* method =
chand()->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;
+ ? "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats"
+ : "/envoy.service.load_stats.v2.LoadReportingService/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);
+ xds_client()->interested_parties_,
+ Slice::FromStaticString(method).c_slice(), nullptr,
+ Timestamp::InfFuture(), nullptr);
GPR_ASSERT(call_ != nullptr);
// Init the request payload.
grpc_slice request_payload_slice =
@@ -1496,10 +1480,10 @@ XdsClient::ChannelState::LrsCallState::LrsCallState(
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_);
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] xds server %s: starting LRS call (calld=%p, call=%p)",
+ xds_client(), chand()->server_.server_uri.c_str(), this, call_);
}
// Create the ops.
grpc_call_error call_error;
@@ -1653,14 +1637,15 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
// Parse the response.
bool send_all_clusters = false;
std::set<std::string> new_cluster_names;
- grpc_millis new_load_reporting_interval;
+ Duration new_load_reporting_interval;
grpc_error_handle 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_std_string(parse_error).c_str());
+ "[xds_client %p] xds server %s: LRS response parsing failed: %s",
+ xds_client(), chand()->server_.server_uri.c_str(),
+ grpc_error_std_string(parse_error).c_str());
GRPC_ERROR_UNREF(parse_error);
return;
}
@@ -1668,11 +1653,12 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(
GPR_INFO,
- "[xds_client %p] LRS response received, %" PRIuPTR
+ "[xds_client %p] xds server %s: 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);
+ xds_client(), chand()->server_.server_uri.c_str(),
+ new_cluster_names.size(), send_all_clusters,
+ new_load_reporting_interval.millis());
size_t i = 0;
for (const auto& name : new_cluster_names) {
gpr_log(GPR_INFO, "[xds_client %p] cluster_name %" PRIuPTR ": %s",
@@ -1680,14 +1666,16 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
}
}
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;
+ Duration::Milliseconds(
+ GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS)) {
+ new_load_reporting_interval = Duration::Milliseconds(
+ 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);
+ "[xds_client %p] xds server %s: increased load_report_interval "
+ "to minimum value %dms",
+ xds_client(), chand()->server_.server_uri.c_str(),
+ GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS);
}
}
// Ignore identical update.
@@ -1695,10 +1683,11 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
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());
+ gpr_log(
+ GPR_INFO,
+ "[xds_client %p] xds server %s: incoming LRS response identical "
+ "to current, ignoring.",
+ xds_client(), chand()->server_.server_uri.c_str());
}
return;
}
@@ -1744,15 +1733,16 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
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_,
+ "[xds_client %p] xds server %s: LRS call status received "
+ "(chand=%p, calld=%p, call=%p): "
+ "status=%d, details='%s', error='%s'",
+ xds_client(), chand()->server_.server_uri.c_str(), chand(), this,
+ call_, status_code_, status_details,
grpc_error_std_string(error).c_str());
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();
}
@@ -1772,19 +1762,17 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
namespace {
-grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
- return grpc_channel_args_find_integer(
+Duration GetRequestTimeout(const grpc_channel_args* args) {
+ return Duration::Milliseconds(grpc_channel_args_find_integer(
args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
- {15000, 0, INT_MAX});
+ {15000, 0, INT_MAX}));
}
grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
- absl::InlinedVector<grpc_arg, 2> args_to_add = {
+ absl::InlinedVector<grpc_arg, 1> 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),
};
return grpc_channel_args_copy_and_add(args, args_to_add.data(),
args_to_add.size());
@@ -1800,16 +1788,18 @@ XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
bootstrap_(std::move(bootstrap)),
args_(ModifyChannelArgs(args)),
request_timeout_(GetRequestTimeout(args)),
+ xds_federation_enabled_(XdsFederationEnabled()),
interested_parties_(grpc_pollset_set_create()),
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
bootstrap_->certificate_providers())),
- api_(this, &grpc_xds_client_trace, bootstrap_->node()) {
+ api_(this, &grpc_xds_client_trace, bootstrap_->node(),
+ &bootstrap_->certificate_providers(), &symtab_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
}
- // Create ChannelState object.
- chand_ = MakeOrphanable<ChannelState>(
- WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
+ // Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
+ // destroyed.
+ grpc_init();
}
XdsClient::~XdsClient() {
@@ -1818,26 +1808,9 @@ XdsClient::~XdsClient() {
}
grpc_channel_args_destroy(args_);
grpc_pollset_set_destroy(interested_parties_);
-}
-
-void XdsClient::AddChannelzLinkage(
- channelz::ChannelNode* parent_channelz_node) {
- MutexLock lock(&mu_);
- 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) {
- MutexLock lock(&mu_);
- 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());
- }
+ // Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
+ // is destroyed.
+ grpc_shutdown();
}
void XdsClient::Orphan() {
@@ -1851,191 +1824,225 @@ void XdsClient::Orphan() {
{
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(
- absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher) {
- std::string listener_name_str = std::string(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_->SubscribeLocked(XdsApi::kLdsTypeUrl, listener_name_str);
-}
-
-void XdsClient::CancelListenerDataWatch(absl::string_view listener_name,
- ListenerWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- std::string listener_name_str = std::string(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_->UnsubscribeLocked(XdsApi::kLdsTypeUrl, listener_name_str,
- delay_unsubscription);
- }
+ // Clear cache and any remaining watchers that may not have been cancelled.
+ authority_state_map_.clear();
+ invalid_watchers_.clear();
+ }
+}
+
+RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
+ const XdsBootstrap::XdsServer& server) {
+ auto it = xds_server_channel_map_.find(server);
+ if (it != xds_server_channel_map_.end()) {
+ return it->second->Ref(DEBUG_LOCATION, "Authority");
+ }
+ // Channel not found, so create a new one.
+ auto channel_state = MakeRefCounted<ChannelState>(
+ WeakRef(DEBUG_LOCATION, "ChannelState"), server);
+ xds_server_channel_map_[server] = channel_state.get();
+ return channel_state;
+}
+
+void XdsClient::WatchResource(const XdsResourceType* type,
+ absl::string_view name,
+ RefCountedPtr<ResourceWatcherInterface> watcher) {
+ ResourceWatcherInterface* w = watcher.get();
+ // Lambda for handling failure cases.
+ auto fail = [&](absl::Status status) mutable {
+ {
+ MutexLock lock(&mu_);
+ MaybeRegisterResourceTypeLocked(type);
+ invalid_watchers_[w] = watcher;
+ }
+ work_serializer_.Run(
+ // TODO(yashykt): When we move to C++14, capture watcher using
+ // std::move()
+ [watcher, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ watcher->OnError(status);
+ },
+ DEBUG_LOCATION);
+ };
+ auto resource_name = ParseXdsResourceName(name, type);
+ if (!resource_name.ok()) {
+ fail(absl::UnavailableError(absl::StrFormat(
+ "Unable to parse resource name for listener %s", name)));
+ return;
}
-}
-
-void XdsClient::WatchRouteConfigData(
- absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher) {
- std::string route_config_name_str = std::string(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());
+ // Find server to use.
+ const XdsBootstrap::XdsServer* xds_server = nullptr;
+ absl::string_view authority_name = resource_name->authority;
+ if (absl::ConsumePrefix(&authority_name, "xdstp:")) {
+ auto* authority = bootstrap_->LookupAuthority(std::string(authority_name));
+ if (authority == nullptr) {
+ fail(absl::UnavailableError(
+ absl::StrCat("authority \"", authority_name,
+ "\" not present in bootstrap config")));
+ return;
}
- w->OnRouteConfigChanged(*route_config_state.update);
- }
- chand_->SubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str);
-}
-
-void XdsClient::CancelRouteConfigDataWatch(absl::string_view route_config_name,
- RouteConfigWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- std::string route_config_name_str = std::string(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_->UnsubscribeLocked(XdsApi::kRdsTypeUrl, route_config_name_str,
- delay_unsubscription);
+ if (!authority->xds_servers.empty()) {
+ xds_server = &authority->xds_servers[0];
}
}
-}
-
-void XdsClient::WatchClusterData(
- absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher) {
- std::string cluster_name_str = std::string(cluster_name);
+ if (xds_server == nullptr) xds_server = &bootstrap_->server();
+ {
+ MutexLock lock(&mu_);
+ MaybeRegisterResourceTypeLocked(type);
+ AuthorityState& authority_state =
+ authority_state_map_[resource_name->authority];
+ ResourceState& resource_state =
+ authority_state.resource_map[type][resource_name->key];
+ resource_state.watchers[w] = watcher;
+ // If we already have a cached value for the resource, notify the new
+ // watcher immediately.
+ if (resource_state.resource != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached listener data for %s", this,
+ std::string(name).c_str());
+ }
+ auto* value = type->CopyResource(resource_state.resource.get()).release();
+ work_serializer_.Schedule(
+ [watcher, value]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ watcher->OnGenericResourceChanged(value);
+ delete value;
+ },
+ DEBUG_LOCATION);
+ }
+ // If the authority doesn't yet have a channel, set it, creating it if
+ // needed.
+ if (authority_state.channel_state == nullptr) {
+ authority_state.channel_state =
+ GetOrCreateChannelStateLocked(*xds_server);
+ }
+ authority_state.channel_state->SubscribeLocked(type, *resource_name);
+ }
+ work_serializer_.DrainQueue();
+}
+
+void XdsClient::CancelResourceWatch(const XdsResourceType* type,
+ absl::string_view name,
+ ResourceWatcherInterface* watcher,
+ bool delay_unsubscription) {
+ auto resource_name = ParseXdsResourceName(name, type);
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());
+ if (!resource_name.ok()) {
+ invalid_watchers_.erase(watcher);
+ return;
}
- chand_->SubscribeLocked(XdsApi::kCdsTypeUrl, cluster_name_str);
-}
-
-void XdsClient::CancelClusterDataWatch(absl::string_view cluster_name,
- ClusterWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
if (shutting_down_) return;
- std::string cluster_name_str = std::string(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_->UnsubscribeLocked(XdsApi::kCdsTypeUrl, cluster_name_str,
- delay_unsubscription);
- }
- }
-}
-
-void XdsClient::WatchEndpointData(
- absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher) {
- std::string eds_service_name_str = std::string(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());
+ // Find authority.
+ if (!resource_name.ok()) return;
+ auto authority_it = authority_state_map_.find(resource_name->authority);
+ if (authority_it == authority_state_map_.end()) return;
+ AuthorityState& authority_state = authority_it->second;
+ // Find type map.
+ auto type_it = authority_state.resource_map.find(type);
+ if (type_it == authority_state.resource_map.end()) return;
+ auto& type_map = type_it->second;
+ // Find resource key.
+ auto resource_it = type_map.find(resource_name->key);
+ if (resource_it == type_map.end()) return;
+ ResourceState& resource_state = resource_it->second;
+ // Remove watcher.
+ resource_state.watchers.erase(watcher);
+ // Clean up empty map entries, if any.
+ if (resource_state.watchers.empty()) {
+ authority_state.channel_state->UnsubscribeLocked(type, *resource_name,
+ delay_unsubscription);
+ type_map.erase(resource_it);
+ if (type_map.empty()) {
+ authority_state.resource_map.erase(type_it);
+ if (authority_state.resource_map.empty()) {
+ authority_state.channel_state.reset();
+ }
}
- w->OnEndpointChanged(endpoint_state.update.value());
}
- chand_->SubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str);
}
-void XdsClient::CancelEndpointDataWatch(absl::string_view eds_service_name,
- EndpointWatcherInterface* watcher,
- bool delay_unsubscription) {
- MutexLock lock(&mu_);
- if (shutting_down_) return;
- std::string eds_service_name_str = std::string(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_->UnsubscribeLocked(XdsApi::kEdsTypeUrl, eds_service_name_str,
- delay_unsubscription);
- }
+void XdsClient::MaybeRegisterResourceTypeLocked(
+ const XdsResourceType* resource_type) {
+ auto it = resource_types_.find(resource_type->type_url());
+ if (it != resource_types_.end()) {
+ GPR_ASSERT(it->second == resource_type);
+ return;
}
+ resource_types_.emplace(resource_type->type_url(), resource_type);
+ v2_resource_types_.emplace(resource_type->v2_type_url(), resource_type);
+ resource_type->InitUpbSymtab(symtab_.ptr());
+}
+
+const XdsResourceType* XdsClient::GetResourceTypeLocked(
+ absl::string_view resource_type) {
+ auto it = resource_types_.find(resource_type);
+ if (it != resource_types_.end()) return it->second;
+ auto it2 = v2_resource_types_.find(resource_type);
+ if (it2 != v2_resource_types_.end()) return it2->second;
+ return nullptr;
+}
+
+absl::StatusOr<XdsClient::XdsResourceName> XdsClient::ParseXdsResourceName(
+ absl::string_view name, const XdsResourceType* type) {
+ // Old-style names use the empty string for authority.
+ // authority is prefixed with "old:" to indicate that it's an old-style name.
+ if (!xds_federation_enabled_ || !absl::StartsWith(name, "xdstp:")) {
+ return XdsResourceName{"old:", {std::string(name), {}}};
+ }
+ // New style name. Parse URI.
+ auto uri = URI::Parse(name);
+ if (!uri.ok()) return uri.status();
+ // Split the resource type off of the path to get the id.
+ std::pair<absl::string_view, absl::string_view> path_parts = absl::StrSplit(
+ absl::StripPrefix(uri->path(), "/"), absl::MaxSplits('/', 1));
+ if (!type->IsType(path_parts.first, nullptr)) {
+ return absl::InvalidArgumentError(
+ "xdstp URI path must indicate valid xDS resource type");
+ }
+ // Canonicalize order of query params.
+ std::vector<URI::QueryParam> query_params;
+ for (const auto& p : uri->query_parameter_map()) {
+ query_params.emplace_back(
+ URI::QueryParam{std::string(p.first), std::string(p.second)});
+ }
+ return XdsResourceName{
+ absl::StrCat("xdstp:", uri->authority()),
+ {std::string(path_parts.second), std::move(query_params)}};
+}
+
+std::string XdsClient::ConstructFullXdsResourceName(
+ absl::string_view authority, absl::string_view resource_type,
+ const XdsResourceKey& key) {
+ if (absl::ConsumePrefix(&authority, "xdstp:")) {
+ auto uri = URI::Create("xdstp", std::string(authority),
+ absl::StrCat("/", resource_type, "/", key.id),
+ key.query_params, /*fragment=*/"");
+ GPR_ASSERT(uri.ok());
+ return uri->ToString();
+ }
+ // Old-style name.
+ return key.id;
}
RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
- absl::string_view lrs_server, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name) {
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
+ if (!bootstrap_->XdsServerExists(xds_server)) return nullptr;
auto key =
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
MutexLock lock(&mu_);
- // We jump through some hoops here to make sure that the absl::string_views
- // stored in the XdsClusterDropStats object point to the strings
+ // We jump through some hoops here to make sure that the const
+ // XdsBootstrap::XdsServer& and absl::string_views
+ // stored in the XdsClusterDropStats object point to the
+ // XdsBootstrap::XdsServer and 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;
- LoadReportState& load_report_state = it->second;
+ auto server_it =
+ xds_load_report_server_map_.emplace(xds_server, LoadReportServer()).first;
+ if (server_it->second.channel_state == nullptr) {
+ server_it->second.channel_state = GetOrCreateChannelStateLocked(xds_server);
+ }
+ auto load_report_it = server_it->second.load_report_map
+ .emplace(std::move(key), LoadReportState())
+ .first;
+ LoadReportState& load_report_state = load_report_it->second;
RefCountedPtr<XdsClusterDropStats> cluster_drop_stats;
if (load_report_state.drop_stats != nullptr) {
cluster_drop_stats = load_report_state.drop_stats->RefIfNonZero();
@@ -2046,26 +2053,26 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
load_report_state.drop_stats->GetSnapshotAndReset();
}
cluster_drop_stats = MakeRefCounted<XdsClusterDropStats>(
- Ref(DEBUG_LOCATION, "DropStats"), lrs_server,
- it->first.first /*cluster_name*/,
- it->first.second /*eds_service_name*/);
+ Ref(DEBUG_LOCATION, "DropStats"), server_it->first,
+ load_report_it->first.first /*cluster_name*/,
+ load_report_it->first.second /*eds_service_name*/);
load_report_state.drop_stats = cluster_drop_stats.get();
}
- chand_->MaybeStartLrsCall();
+ server_it->second.channel_state->MaybeStartLrsCall();
return cluster_drop_stats;
}
void XdsClient::RemoveClusterDropStats(
- absl::string_view /*lrs_server*/, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name,
XdsClusterDropStats* cluster_drop_stats) {
MutexLock lock(&mu_);
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto it = load_report_map_.find(
+ auto server_it = xds_load_report_server_map_.find(xds_server);
+ if (server_it == xds_load_report_server_map_.end()) return;
+ auto load_report_it = server_it->second.load_report_map.find(
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
- if (it == load_report_map_.end()) return;
- LoadReportState& load_report_state = it->second;
+ if (load_report_it == server_it->second.load_report_map.end()) return;
+ LoadReportState& load_report_state = load_report_it->second;
if (load_report_state.drop_stats == cluster_drop_stats) {
// Record final snapshot in deleted_drop_stats, which will be
// added to the next load report.
@@ -2076,21 +2083,27 @@ void XdsClient::RemoveClusterDropStats(
}
RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
- absl::string_view lrs_server, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
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.
+ if (!bootstrap_->XdsServerExists(xds_server)) return nullptr;
auto key =
std::make_pair(std::string(cluster_name), std::string(eds_service_name));
MutexLock lock(&mu_);
- // We jump through some hoops here to make sure that the absl::string_views
- // stored in the XdsClusterLocalityStats object point to the strings
+ // We jump through some hoops here to make sure that the const
+ // XdsBootstrap::XdsServer& and absl::string_views
+ // stored in the XdsClusterDropStats object point to the
+ // XdsBootstrap::XdsServer and 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;
- LoadReportState& load_report_state = it->second;
+ auto server_it =
+ xds_load_report_server_map_.emplace(xds_server, LoadReportServer()).first;
+ if (server_it->second.channel_state == nullptr) {
+ server_it->second.channel_state = GetOrCreateChannelStateLocked(xds_server);
+ }
+ auto load_report_it = server_it->second.load_report_map
+ .emplace(std::move(key), LoadReportState())
+ .first;
+ LoadReportState& load_report_state = load_report_it->second;
LoadReportState::LocalityState& locality_state =
load_report_state.locality_stats[locality];
RefCountedPtr<XdsClusterLocalityStats> cluster_locality_stats;
@@ -2103,27 +2116,27 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
locality_state.locality_stats->GetSnapshotAndReset();
}
cluster_locality_stats = MakeRefCounted<XdsClusterLocalityStats>(
- Ref(DEBUG_LOCATION, "LocalityStats"), lrs_server,
- it->first.first /*cluster_name*/, it->first.second /*eds_service_name*/,
- std::move(locality));
+ Ref(DEBUG_LOCATION, "LocalityStats"), server_it->first,
+ load_report_it->first.first /*cluster_name*/,
+ load_report_it->first.second /*eds_service_name*/, std::move(locality));
locality_state.locality_stats = cluster_locality_stats.get();
}
- chand_->MaybeStartLrsCall();
+ server_it->second.channel_state->MaybeStartLrsCall();
return cluster_locality_stats;
}
void XdsClient::RemoveClusterLocalityStats(
- absl::string_view /*lrs_server*/, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name,
const RefCountedPtr<XdsLocalityName>& locality,
XdsClusterLocalityStats* cluster_locality_stats) {
MutexLock lock(&mu_);
- // TODO(roth): When we add support for direct federation, use the
- // server name specified in lrs_server.
- auto it = load_report_map_.find(
+ auto server_it = xds_load_report_server_map_.find(xds_server);
+ if (server_it == xds_load_report_server_map_.end()) return;
+ auto load_report_it = server_it->second.load_report_map.find(
std::make_pair(std::string(cluster_name), std::string(eds_service_name)));
- if (it == load_report_map_.end()) return;
- LoadReportState& load_report_state = it->second;
+ if (load_report_it == server_it->second.load_report_map.end()) return;
+ LoadReportState& load_report_state = load_report_it->second;
auto locality_it = load_report_state.locality_stats.find(locality);
if (locality_it == load_report_state.locality_stats.end()) return;
LoadReportState::LocalityState& locality_state = locality_it->second;
@@ -2138,47 +2151,82 @@ void XdsClient::RemoveClusterLocalityStats(
void XdsClient::ResetBackoff() {
MutexLock lock(&mu_);
- if (chand_ != nullptr) {
- grpc_channel_reset_connect_backoff(chand_->channel());
+ for (auto& p : xds_server_channel_map_) {
+ grpc_channel_reset_connect_backoff(p.second->channel());
}
}
-void XdsClient::NotifyOnErrorLocked(grpc_error_handle 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));
- }
+void XdsClient::NotifyOnErrorLocked(absl::Status status) {
+ const auto* node = bootstrap_->node();
+ if (node != nullptr) {
+ status = absl::Status(
+ status.code(), absl::StrCat(status.message(),
+ " (node ID:", bootstrap_->node()->id, ")"));
}
- 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));
+ std::set<RefCountedPtr<ResourceWatcherInterface>> watchers;
+ for (const auto& a : authority_state_map_) { // authority
+ for (const auto& t : a.second.resource_map) { // type
+ for (const auto& r : t.second) { // resource id
+ for (const auto& w : r.second.watchers) { // watchers
+ watchers.insert(w.second);
+ }
+ }
}
}
- GRPC_ERROR_UNREF(error);
+ work_serializer_.Schedule(
+ // TODO(yashykt): When we move to C++14, capture watchers using
+ // std::move()
+ [watchers, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ for (const auto& watcher : watchers) {
+ watcher->OnError(status);
+ }
+ },
+ DEBUG_LOCATION);
+}
+
+void XdsClient::NotifyWatchersOnErrorLocked(
+ const std::map<ResourceWatcherInterface*,
+ RefCountedPtr<ResourceWatcherInterface>>& watchers,
+ absl::Status status) {
+ const auto* node = bootstrap_->node();
+ if (node != nullptr) {
+ status = absl::Status(
+ status.code(), absl::StrCat(status.message(),
+ " (node ID:", bootstrap_->node()->id, ")"));
+ }
+ work_serializer_.Schedule(
+ [watchers, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ for (const auto& p : watchers) {
+ p.first->OnError(status);
+ }
+ },
+ DEBUG_LOCATION);
+}
+
+void XdsClient::NotifyWatchersOnResourceDoesNotExist(
+ const std::map<ResourceWatcherInterface*,
+ RefCountedPtr<ResourceWatcherInterface>>& watchers) {
+ work_serializer_.Schedule(
+ [watchers]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ for (const auto& p : watchers) {
+ p.first->OnResourceDoesNotExist();
+ }
+ },
+ DEBUG_LOCATION);
}
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
- bool send_all_clusters, const std::set<std::string>& clusters) {
+ const XdsBootstrap::XdsServer& xds_server, bool send_all_clusters,
+ const std::set<std::string>& clusters) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] start building load report", this);
}
XdsApi::ClusterLoadReportMap snapshot_map;
- for (auto load_report_it = load_report_map_.begin();
- load_report_it != load_report_map_.end();) {
+ auto server_it = xds_load_report_server_map_.find(xds_server);
+ if (server_it == xds_load_report_server_map_.end()) return snapshot_map;
+ auto& load_report_map = server_it->second.load_report_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;
@@ -2233,7 +2281,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
}
}
// Compute load report interval.
- const grpc_millis now = ExecCtx::Get()->Now();
+ const Timestamp now = ExecCtx::Get()->Now();
snapshot.load_report_interval = now - load_report.last_report_time;
load_report.last_report_time = now;
// Record snapshot.
@@ -2244,7 +2292,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
// deleted stats objects, remove the entry.
if (load_report.locality_stats.empty() &&
load_report.drop_stats == nullptr) {
- load_report_it = load_report_map_.erase(load_report_it);
+ load_report_it = load_report_map.erase(load_report_it);
} else {
++load_report_it;
}
@@ -2252,75 +2300,22 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
return snapshot_map;
}
-void XdsClient::UpdateResourceMetadataWithFailedParseResultLocked(
- grpc_millis update_time, const XdsApi::AdsParseResult& result) {
- // ADS update is rejected and the resource names in the failed update is
- // available.
- std::string details = grpc_error_std_string(result.parse_error);
- for (auto& name : result.resource_names_failed) {
- XdsApi::ResourceMetadata* resource_metadata = nullptr;
- if (result.type_url == XdsApi::kLdsTypeUrl) {
- auto it = listener_map_.find(name);
- if (it != listener_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
- auto it = route_config_map_.find(name);
- if (route_config_map_.find(name) != route_config_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
- auto it = cluster_map_.find(name);
- if (cluster_map_.find(name) != cluster_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
- auto it = endpoint_map_.find(name);
- if (endpoint_map_.find(name) != endpoint_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- }
- if (resource_metadata == nullptr) {
- return;
- }
- resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
- resource_metadata->failed_version = result.version;
- resource_metadata->failed_details = details;
- resource_metadata->failed_update_time = update_time;
- }
-}
-
std::string XdsClient::DumpClientConfigBinary() {
MutexLock lock(&mu_);
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
- // Update per-xds-type version if available, this version corresponding to the
- // last successful ADS update version.
- for (auto& p : resource_version_map_) {
- resource_type_metadata_map[p.first].version = p.second;
- }
- // Collect resource metadata from listeners
- auto& lds_map =
- resource_type_metadata_map[XdsApi::kLdsTypeUrl].resource_metadata_map;
- for (auto& p : listener_map_) {
- lds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from route configs
- auto& rds_map =
- resource_type_metadata_map[XdsApi::kRdsTypeUrl].resource_metadata_map;
- for (auto& p : route_config_map_) {
- rds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from clusters
- auto& cds_map =
- resource_type_metadata_map[XdsApi::kCdsTypeUrl].resource_metadata_map;
- for (auto& p : cluster_map_) {
- cds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from endpoints
- auto& eds_map =
- resource_type_metadata_map[XdsApi::kEdsTypeUrl].resource_metadata_map;
- for (auto& p : endpoint_map_) {
- eds_map[p.first] = &p.second.meta;
+ for (const auto& a : authority_state_map_) { // authority
+ const std::string& authority = a.first;
+ for (const auto& t : a.second.resource_map) { // type
+ const XdsResourceType* type = t.first;
+ auto& resource_metadata_map =
+ resource_type_metadata_map[type->type_url()];
+ for (const auto& r : t.second) { // resource id
+ const XdsResourceKey& resource_key = r.first;
+ const ResourceState& resource_state = r.second;
+ resource_metadata_map[ConstructFullXdsResourceName(
+ authority, type->type_url(), resource_key)] = &resource_state.meta;
+ }
+ }
}
// Assemble config dump messages
return api_.AssembleClientConfig(resource_type_metadata_map);
@@ -2333,6 +2328,7 @@ std::string XdsClient::DumpClientConfigBinary() {
void XdsClientGlobalInit() {
g_mu = new Mutex;
XdsHttpFilterRegistry::Init();
+ XdsClusterSpecifierPluginRegistry::Init();
}
// TODO(roth): Find a better way to clear the fallback config that does
@@ -2343,6 +2339,7 @@ void XdsClientGlobalShutdown() ABSL_NO_THREAD_SAFETY_ANALYSIS {
delete g_mu;
g_mu = nullptr;
XdsHttpFilterRegistry::Shutdown();
+ XdsClusterSpecifierPluginRegistry::Shutdown();
}
namespace {
@@ -2350,7 +2347,7 @@ namespace {
std::string GetBootstrapContents(const char* fallback_config,
grpc_error_handle* error) {
// First, try GRPC_XDS_BOOTSTRAP env var.
- grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
+ UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
if (path != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
@@ -2367,8 +2364,7 @@ std::string GetBootstrapContents(const char* fallback_config,
return contents_str;
}
// Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
- grpc_core::UniquePtr<char> env_config(
- gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
+ UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
if (env_config != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
@@ -2478,7 +2474,7 @@ void XdsClientArgDestroy(void* p) {
xds_client->Unref(DEBUG_LOCATION, "channel arg");
}
-int XdsClientArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kXdsClientArgVtable = {
XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
diff --git a/grpc/src/core/ext/xds/xds_client.h b/grpc/src/core/ext/xds/xds_client.h
index 0ee84e78..5fe050cc 100644
--- a/grpc/src/core/ext/xds/xds_client.h
+++ b/grpc/src/core/ext/xds/xds_client.h
@@ -28,6 +28,7 @@
#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/ext/xds/xds_resource_type.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/memory.h"
@@ -35,6 +36,8 @@
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
@@ -43,40 +46,19 @@ extern TraceFlag grpc_xds_client_refcount_trace;
class XdsClient : public DualRefCounted<XdsClient> {
public:
- // Listener data watcher interface. Implemented by callers.
- class ListenerWatcherInterface {
+ // Resource watcher interface. Implemented by callers.
+ // Note: Most callers will not use this API directly but rather via a
+ // resource-type-specific wrapper API provided by the relevant
+ // XdsResourceType implementation.
+ class ResourceWatcherInterface : public RefCounted<ResourceWatcherInterface> {
public:
- virtual ~ListenerWatcherInterface() = default;
- virtual void OnListenerChanged(XdsApi::LdsUpdate listener) = 0;
- virtual void OnError(grpc_error_handle 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_handle 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_handle 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_handle error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
+ virtual void OnGenericResourceChanged(
+ const XdsResourceType::ResourceData* resource)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnError(absl::Status status)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnResourceDoesNotExist()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
};
// Factory function to get or create the global XdsClient instance.
@@ -102,78 +84,39 @@ class XdsClient : public DualRefCounted<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(absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher);
- void CancelListenerDataWatch(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(
- absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher);
- void CancelRouteConfigDataWatch(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(absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher);
- void CancelClusterDataWatch(absl::string_view cluster_name,
- ClusterWatcherInterface* watcher,
- bool delay_unsubscription = false);
-
- // Start and cancel endpoint data watch for a cluster.
+ // Start and cancel watch for a resource.
+ //
// 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(absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher);
- void CancelEndpointDataWatch(absl::string_view eds_service_name,
- EndpointWatcherInterface* watcher,
- bool delay_unsubscription = false);
+ //
+ // The resource type object must be a global singleton, since the first
+ // time the XdsClient sees a particular resource type object, it will
+ // store the pointer to that object as the authoritative implementation for
+ // its type URLs. The resource type object must outlive the XdsClient object,
+ // and it is illegal to start a subsequent watch for the same type URLs using
+ // a different resource type object.
+ //
+ // Note: Most callers will not use this API directly but rather via a
+ // resource-type-specific wrapper API provided by the relevant
+ // XdsResourceType implementation.
+ void WatchResource(const XdsResourceType* type, absl::string_view name,
+ RefCountedPtr<ResourceWatcherInterface> watcher);
+ void CancelResourceWatch(const XdsResourceType* type,
+ absl::string_view listener_name,
+ ResourceWatcherInterface* watcher,
+ bool delay_unsubscription = false);
// Adds and removes drop stats for cluster_name and eds_service_name.
RefCountedPtr<XdsClusterDropStats> AddClusterDropStats(
- absl::string_view lrs_server, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name);
- void RemoveClusterDropStats(absl::string_view /*lrs_server*/,
+ void RemoveClusterDropStats(const XdsBootstrap::XdsServer& xds_server,
absl::string_view cluster_name,
absl::string_view eds_service_name,
XdsClusterDropStats* cluster_drop_stats);
@@ -181,11 +124,11 @@ class XdsClient : public DualRefCounted<XdsClient> {
// Adds and removes locality stats for cluster_name and eds_service_name
// for the specified locality.
RefCountedPtr<XdsClusterLocalityStats> AddClusterLocalityStats(
- absl::string_view lrs_server, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name,
RefCountedPtr<XdsLocalityName> locality);
void RemoveClusterLocalityStats(
- absl::string_view /*lrs_server*/, absl::string_view cluster_name,
+ const XdsBootstrap::XdsServer& xds_server, absl::string_view cluster_name,
absl::string_view eds_service_name,
const RefCountedPtr<XdsLocalityName>& locality,
XdsClusterLocalityStats* cluster_locality_stats);
@@ -208,14 +151,25 @@ class XdsClient : public DualRefCounted<XdsClient> {
const grpc_channel_args& args);
private:
+ struct XdsResourceKey {
+ std::string id;
+ std::vector<URI::QueryParam> query_params;
+
+ bool operator<(const XdsResourceKey& other) const {
+ int c = id.compare(other.id);
+ if (c != 0) return c < 0;
+ return query_params < other.query_params;
+ }
+ };
+
+ struct XdsResourceName {
+ std::string authority;
+ XdsResourceKey key;
+ };
+
// 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> {
+ class ChannelState : public DualRefCounted<ChannelState> {
public:
template <typename T>
class RetryableCall;
@@ -235,17 +189,20 @@ class XdsClient : public DualRefCounted<XdsClient> {
LrsCallState* lrs_calld() const;
void MaybeStartLrsCall();
- void StopLrsCall();
+ void StopLrsCallLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool HasAdsCall() const;
bool HasActiveAdsCall() const;
- void StartConnectivityWatchLocked();
+ void StartConnectivityWatchLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
void CancelConnectivityWatchLocked();
- void SubscribeLocked(const std::string& type_url, const std::string& name)
+ void SubscribeLocked(const XdsResourceType* type,
+ const XdsResourceName& name)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
- void UnsubscribeLocked(const std::string& type_url, const std::string& name,
+ void UnsubscribeLocked(const XdsResourceType* type,
+ const XdsResourceName& name,
bool delay_unsubscription)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
@@ -260,46 +217,29 @@ class XdsClient : public DualRefCounted<XdsClient> {
// The channel and its status.
grpc_channel* channel_;
bool shutting_down_ = false;
- StateWatcher* watcher_ = nullptr;
+ StateWatcher* watcher_;
// 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.
- absl::optional<XdsApi::LdsUpdate> update;
- XdsApi::ResourceMetadata meta;
- };
-
- struct RouteConfigState {
- std::map<RouteConfigWatcherInterface*,
- std::unique_ptr<RouteConfigWatcherInterface>>
- watchers;
- // The latest data seen from RDS.
- absl::optional<XdsApi::RdsUpdate> update;
- XdsApi::ResourceMetadata meta;
+ // Stores the most recent accepted resource version for each resource type.
+ std::map<const XdsResourceType*, std::string /*version*/>
+ resource_type_version_map_;
};
- struct ClusterState {
- std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
+ struct ResourceState {
+ std::map<ResourceWatcherInterface*, RefCountedPtr<ResourceWatcherInterface>>
watchers;
- // The latest data seen from CDS.
- absl::optional<XdsApi::CdsUpdate> update;
+ // The latest data seen for the resource.
+ std::unique_ptr<XdsResourceType::ResourceData> resource;
XdsApi::ResourceMetadata meta;
};
- struct EndpointState {
- std::map<EndpointWatcherInterface*,
- std::unique_ptr<EndpointWatcherInterface>>
- watchers;
- // The latest data seen from EDS.
- absl::optional<XdsApi::EdsUpdate> update;
- XdsApi::ResourceMetadata meta;
+ struct AuthorityState {
+ RefCountedPtr<ChannelState> channel_state;
+ std::map<const XdsResourceType*, std::map<XdsResourceKey, ResourceState>>
+ resource_map;
};
struct LoadReportState {
@@ -313,55 +253,84 @@ class XdsClient : public DualRefCounted<XdsClient> {
std::map<RefCountedPtr<XdsLocalityName>, LocalityState,
XdsLocalityName::Less>
locality_stats;
- grpc_millis last_report_time = ExecCtx::Get()->Now();
+ Timestamp last_report_time = ExecCtx::Get()->Now();
+ };
+
+ // Load report data.
+ using LoadReportMap = std::map<
+ std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
+ LoadReportState>;
+
+ struct LoadReportServer {
+ RefCountedPtr<ChannelState> channel_state;
+ LoadReportMap load_report_map;
};
// Sends an error notification to all watchers.
- void NotifyOnErrorLocked(grpc_error_handle error)
+ void NotifyOnErrorLocked(absl::Status status)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
-
- XdsApi::ClusterLoadReportMap BuildLoadReportSnapshotLocked(
- bool send_all_clusters, const std::set<std::string>& clusters)
+ // Sends an error notification to a specific set of watchers.
+ void NotifyWatchersOnErrorLocked(
+ const std::map<ResourceWatcherInterface*,
+ RefCountedPtr<ResourceWatcherInterface>>& watchers,
+ absl::Status status);
+ // Sends a resource-does-not-exist notification to a specific set of watchers.
+ void NotifyWatchersOnResourceDoesNotExist(
+ const std::map<ResourceWatcherInterface*,
+ RefCountedPtr<ResourceWatcherInterface>>& watchers);
+
+ void MaybeRegisterResourceTypeLocked(const XdsResourceType* resource_type)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- void UpdateResourceMetadataWithFailedParseResultLocked(
- grpc_millis update_time, const XdsApi::AdsParseResult& result)
+ // Gets the type for resource_type, or null if the type is unknown.
+ const XdsResourceType* GetResourceTypeLocked(absl::string_view resource_type)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ absl::StatusOr<XdsResourceName> ParseXdsResourceName(
+ absl::string_view name, const XdsResourceType* type);
+ static std::string ConstructFullXdsResourceName(
+ absl::string_view authority, absl::string_view resource_type,
+ const XdsResourceKey& key);
+
+ XdsApi::ClusterLoadReportMap BuildLoadReportSnapshotLocked(
+ const XdsBootstrap::XdsServer& xds_server, bool send_all_clusters,
+ const std::set<std::string>& clusters) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ RefCountedPtr<ChannelState> GetOrCreateChannelStateLocked(
+ const XdsBootstrap::XdsServer& server) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
std::unique_ptr<XdsBootstrap> bootstrap_;
grpc_channel_args* args_;
- const grpc_millis request_timeout_;
+ const Duration request_timeout_;
+ const bool xds_federation_enabled_;
grpc_pollset_set* interested_parties_;
OrphanablePtr<CertificateProviderStore> certificate_provider_store_;
XdsApi api_;
+ WorkSerializer work_serializer_;
Mutex mu_;
- // The channel for communicating with the xds server.
- OrphanablePtr<ChannelState> chand_ ABSL_GUARDED_BY(mu_);
+ // Stores resource type objects seen by type URL.
+ std::map<absl::string_view /*resource_type*/, const XdsResourceType*>
+ resource_types_ ABSL_GUARDED_BY(mu_);
+ std::map<absl::string_view /*v2_resource_type*/, const XdsResourceType*>
+ v2_resource_types_ ABSL_GUARDED_BY(mu_);
+ upb::SymbolTable symtab_ ABSL_GUARDED_BY(mu_);
- // One entry for each watched LDS resource.
- std::map<std::string /*listener_name*/, ListenerState> listener_map_
- ABSL_GUARDED_BY(mu_);
- // One entry for each watched RDS resource.
- std::map<std::string /*route_config_name*/, RouteConfigState>
- route_config_map_ ABSL_GUARDED_BY(mu_);
- // One entry for each watched CDS resource.
- std::map<std::string /*cluster_name*/, ClusterState> cluster_map_
+ // Map of existing xDS server channels.
+ std::map<XdsBootstrap::XdsServer, ChannelState*> xds_server_channel_map_
ABSL_GUARDED_BY(mu_);
- // One entry for each watched EDS resource.
- std::map<std::string /*eds_service_name*/, EndpointState> endpoint_map_
+
+ std::map<std::string /*authority*/, AuthorityState> authority_state_map_
ABSL_GUARDED_BY(mu_);
- // Load report data.
- std::map<
- std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
- LoadReportState>
- load_report_map_ ABSL_GUARDED_BY(mu_);
+ std::map<XdsBootstrap::XdsServer, LoadReportServer>
+ xds_load_report_server_map_ ABSL_GUARDED_BY(mu_);
- // Stores the most recent accepted resource version for each resource type.
- std::map<std::string /*type*/, std::string /*version*/> resource_version_map_
- ABSL_GUARDED_BY(mu_);
+ // Stores started watchers whose resource name was not parsed successfully,
+ // waiting to be cancelled or reset in Orphan().
+ std::map<ResourceWatcherInterface*, RefCountedPtr<ResourceWatcherInterface>>
+ invalid_watchers_ ABSL_GUARDED_BY(mu_);
bool shutting_down_ ABSL_GUARDED_BY(mu_) = false;
};
diff --git a/grpc/src/core/ext/xds/xds_client_stats.cc b/grpc/src/core/ext/xds/xds_client_stats.cc
index c38ded23..3cd26527 100644
--- a/grpc/src/core/ext/xds/xds_client_stats.cc
+++ b/grpc/src/core/ext/xds/xds_client_stats.cc
@@ -31,8 +31,8 @@ namespace grpc_core {
namespace {
-uint64_t GetAndResetCounter(Atomic<uint64_t>* from) {
- return from->Exchange(0, MemoryOrder::RELAXED);
+uint64_t GetAndResetCounter(std::atomic<uint64_t>* from) {
+ return from->exchange(0, std::memory_order_relaxed);
}
} // namespace
@@ -41,20 +41,20 @@ uint64_t GetAndResetCounter(Atomic<uint64_t>* from) {
// XdsClusterDropStats
//
-XdsClusterDropStats::XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
- absl::string_view lrs_server_name,
- absl::string_view cluster_name,
- absl::string_view eds_service_name)
+XdsClusterDropStats::XdsClusterDropStats(
+ RefCountedPtr<XdsClient> xds_client,
+ const XdsBootstrap::XdsServer& lrs_server, absl::string_view cluster_name,
+ absl::string_view eds_service_name)
: RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
? "XdsClusterDropStats"
: nullptr),
xds_client_(std::move(xds_client)),
- lrs_server_name_(lrs_server_name),
+ lrs_server_(lrs_server),
cluster_name_(cluster_name),
eds_service_name_(eds_service_name) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] created drop stats %p for {%s, %s, %s}",
- xds_client_.get(), this, std::string(lrs_server_name_).c_str(),
+ xds_client_.get(), this, lrs_server_.server_uri.c_str(),
std::string(cluster_name_).c_str(),
std::string(eds_service_name_).c_str());
}
@@ -64,11 +64,11 @@ XdsClusterDropStats::~XdsClusterDropStats() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] destroying drop stats %p for {%s, %s, %s}",
- xds_client_.get(), this, std::string(lrs_server_name_).c_str(),
+ xds_client_.get(), this, lrs_server_.server_uri.c_str(),
std::string(cluster_name_).c_str(),
std::string(eds_service_name_).c_str());
}
- xds_client_->RemoveClusterDropStats(lrs_server_name_, cluster_name_,
+ xds_client_->RemoveClusterDropStats(lrs_server_, cluster_name_,
eds_service_name_, this);
xds_client_.reset(DEBUG_LOCATION, "DropStats");
}
@@ -82,7 +82,7 @@ XdsClusterDropStats::Snapshot XdsClusterDropStats::GetSnapshotAndReset() {
}
void XdsClusterDropStats::AddUncategorizedDrops() {
- uncategorized_drops_.FetchAdd(1);
+ uncategorized_drops_.fetch_add(1);
}
void XdsClusterDropStats::AddCallDropped(const std::string& category) {
@@ -95,21 +95,21 @@ void XdsClusterDropStats::AddCallDropped(const std::string& category) {
//
XdsClusterLocalityStats::XdsClusterLocalityStats(
- RefCountedPtr<XdsClient> xds_client, absl::string_view lrs_server_name,
- absl::string_view cluster_name, absl::string_view eds_service_name,
- RefCountedPtr<XdsLocalityName> name)
+ RefCountedPtr<XdsClient> xds_client,
+ const XdsBootstrap::XdsServer& lrs_server, absl::string_view cluster_name,
+ absl::string_view eds_service_name, RefCountedPtr<XdsLocalityName> name)
: RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
? "XdsClusterLocalityStats"
: nullptr),
xds_client_(std::move(xds_client)),
- lrs_server_name_(lrs_server_name),
+ lrs_server_(lrs_server),
cluster_name_(cluster_name),
eds_service_name_(eds_service_name),
name_(std::move(name)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] created locality stats %p for {%s, %s, %s, %s}",
- xds_client_.get(), this, std::string(lrs_server_name_).c_str(),
+ xds_client_.get(), this, lrs_server_.server_uri.c_str(),
std::string(cluster_name_).c_str(),
std::string(eds_service_name_).c_str(),
name_->AsHumanReadableString().c_str());
@@ -120,40 +120,41 @@ XdsClusterLocalityStats::~XdsClusterLocalityStats() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] destroying locality stats %p for {%s, %s, %s, %s}",
- xds_client_.get(), this, std::string(lrs_server_name_).c_str(),
+ xds_client_.get(), this, lrs_server_.server_uri.c_str(),
std::string(cluster_name_).c_str(),
std::string(eds_service_name_).c_str(),
name_->AsHumanReadableString().c_str());
}
- xds_client_->RemoveClusterLocalityStats(lrs_server_name_, cluster_name_,
+ xds_client_->RemoveClusterLocalityStats(lrs_server_, 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_),
- {}};
+ 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(std::memory_order_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);
+ total_issued_requests_.fetch_add(1, std::memory_order_relaxed);
+ total_requests_in_progress_.fetch_add(1, std::memory_order_relaxed);
}
void XdsClusterLocalityStats::AddCallFinished(bool fail) {
- Atomic<uint64_t>& to_increment =
+ std::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);
+ to_increment.fetch_add(1, std::memory_order_relaxed);
+ total_requests_in_progress_.fetch_add(-1, std::memory_order_acq_rel);
}
} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_client_stats.h b/grpc/src/core/ext/xds/xds_client_stats.h
index b300fc59..9ed5cf4a 100644
--- a/grpc/src/core/ext/xds/xds_client_stats.h
+++ b/grpc/src/core/ext/xds/xds_client_stats.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <map>
#include <string>
@@ -28,8 +29,8 @@
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
+#include "src/core/ext/xds/xds_bootstrap.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"
@@ -46,7 +47,7 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
struct Less {
bool operator()(const XdsLocalityName* lhs,
const XdsLocalityName* rhs) const {
- if (lhs == nullptr || rhs == nullptr) return GPR_ICMP(lhs, rhs);
+ if (lhs == nullptr || rhs == nullptr) return QsortCompare(lhs, rhs);
return lhs->Compare(*rhs) < 0;
}
@@ -128,7 +129,7 @@ class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
};
XdsClusterDropStats(RefCountedPtr<XdsClient> xds_client,
- absl::string_view lrs_server_name,
+ const XdsBootstrap::XdsServer& lrs_server,
absl::string_view cluster_name,
absl::string_view eds_service_name);
~XdsClusterDropStats() override;
@@ -141,10 +142,10 @@ class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
private:
RefCountedPtr<XdsClient> xds_client_;
- absl::string_view lrs_server_name_;
+ const XdsBootstrap::XdsServer& lrs_server_;
absl::string_view cluster_name_;
absl::string_view eds_service_name_;
- Atomic<uint64_t> uncategorized_drops_{0};
+ std::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).
@@ -202,7 +203,7 @@ class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
};
XdsClusterLocalityStats(RefCountedPtr<XdsClient> xds_client,
- absl::string_view lrs_server_name,
+ const XdsBootstrap::XdsServer& lrs_server_,
absl::string_view cluster_name,
absl::string_view eds_service_name,
RefCountedPtr<XdsLocalityName> name);
@@ -216,15 +217,15 @@ class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
private:
RefCountedPtr<XdsClient> xds_client_;
- absl::string_view lrs_server_name_;
+ const XdsBootstrap::XdsServer& lrs_server_;
absl::string_view cluster_name_;
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};
+ std::atomic<uint64_t> total_successful_requests_{0};
+ std::atomic<uint64_t> total_requests_in_progress_{0};
+ std::atomic<uint64_t> total_error_requests_{0};
+ std::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
diff --git a/grpc/src/core/ext/xds/xds_cluster.cc b/grpc/src/core/ext/xds/xds_cluster.cc
new file mode 100644
index 00000000..20b56317
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_cluster.cc
@@ -0,0 +1,453 @@
+//
+// 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_cluster.h"
+
+#include "absl/container/inlined_vector.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
+#include "absl/strings/str_join.h"
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
+#include "envoy/config/cluster/v3/cluster.upb.h"
+#include "envoy/config/cluster/v3/cluster.upbdefs.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/endpoint/v3/endpoint.upb.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
+#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/host_port.h"
+
+namespace grpc_core {
+
+//
+// XdsClusterResource
+//
+
+std::string XdsClusterResource::ToString() const {
+ absl::InlinedVector<std::string, 8> contents;
+ switch (cluster_type) {
+ case EDS:
+ contents.push_back("cluster_type=EDS");
+ if (!eds_service_name.empty()) {
+ contents.push_back(
+ absl::StrFormat("eds_service_name=%s", eds_service_name));
+ }
+ break;
+ case LOGICAL_DNS:
+ contents.push_back("cluster_type=LOGICAL_DNS");
+ contents.push_back(absl::StrFormat("dns_hostname=%s", dns_hostname));
+ break;
+ case AGGREGATE:
+ contents.push_back("cluster_type=AGGREGATE");
+ contents.push_back(
+ absl::StrFormat("prioritized_cluster_names=[%s]",
+ absl::StrJoin(prioritized_cluster_names, ", ")));
+ }
+ if (!common_tls_context.Empty()) {
+ contents.push_back(absl::StrFormat("common_tls_context=%s",
+ common_tls_context.ToString()));
+ }
+ if (lrs_load_reporting_server.has_value()) {
+ contents.push_back(absl::StrFormat("lrs_load_reporting_server_name=%s",
+ lrs_load_reporting_server->server_uri));
+ }
+ contents.push_back(absl::StrCat("lb_policy=", lb_policy));
+ if (lb_policy == "RING_HASH") {
+ contents.push_back(absl::StrCat("min_ring_size=", min_ring_size));
+ contents.push_back(absl::StrCat("max_ring_size=", max_ring_size));
+ }
+ contents.push_back(
+ absl::StrFormat("max_concurrent_requests=%d", max_concurrent_requests));
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsClusterResourceType
+//
+
+namespace {
+
+grpc_error_handle UpstreamTlsContextParse(
+ const XdsEncodingContext& context,
+ const envoy_config_core_v3_TransportSocket* transport_socket,
+ CommonTlsContext* common_tls_context) {
+ // Record Upstream tls context
+ absl::string_view name = UpbStringToAbsl(
+ envoy_config_core_v3_TransportSocket_name(transport_socket));
+ if (name != "envoy.transport_sockets.tls") {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unrecognized transport socket: ", name));
+ }
+ auto* typed_config =
+ envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
+ if (typed_config != nullptr) {
+ const upb_StringView 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, context.arena);
+ if (upstream_tls_context == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't decode upstream tls context.");
+ }
+ auto* common_tls_context_proto =
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
+ upstream_tls_context);
+ if (common_tls_context_proto != nullptr) {
+ grpc_error_handle error = CommonTlsContext::Parse(
+ context, common_tls_context_proto, common_tls_context);
+ if (error != GRPC_ERROR_NONE) {
+ return grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Error parsing UpstreamTlsContext"),
+ error);
+ }
+ }
+ }
+ if (common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance.instance_name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "UpstreamTlsContext: TLS configuration provided but no "
+ "ca_certificate_provider_instance found.");
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle CdsLogicalDnsParse(
+ const envoy_config_cluster_v3_Cluster* cluster,
+ XdsClusterResource* cds_update) {
+ const auto* load_assignment =
+ envoy_config_cluster_v3_Cluster_load_assignment(cluster);
+ if (load_assignment == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "load_assignment not present for LOGICAL_DNS cluster");
+ }
+ size_t num_localities;
+ const auto* const* localities =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(load_assignment,
+ &num_localities);
+ if (num_localities != 1) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("load_assignment for LOGICAL_DNS cluster must have "
+ "exactly one locality, found ",
+ num_localities));
+ }
+ size_t num_endpoints;
+ const auto* const* endpoints =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(localities[0],
+ &num_endpoints);
+ if (num_endpoints != 1) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("locality for LOGICAL_DNS cluster must have "
+ "exactly one endpoint, found ",
+ num_endpoints));
+ }
+ const auto* endpoint =
+ envoy_config_endpoint_v3_LbEndpoint_endpoint(endpoints[0]);
+ if (endpoint == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LbEndpoint endpoint field not set");
+ }
+ const auto* address = envoy_config_endpoint_v3_Endpoint_address(endpoint);
+ if (address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Endpoint address field not set");
+ }
+ const auto* socket_address =
+ envoy_config_core_v3_Address_socket_address(address);
+ if (socket_address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Address socket_address field not set");
+ }
+ if (envoy_config_core_v3_SocketAddress_resolver_name(socket_address).size !=
+ 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LOGICAL_DNS clusters must NOT have a custom resolver name set");
+ }
+ absl::string_view address_str = UpbStringToAbsl(
+ envoy_config_core_v3_SocketAddress_address(socket_address));
+ if (address_str.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "SocketAddress address field not set");
+ }
+ if (!envoy_config_core_v3_SocketAddress_has_port_value(socket_address)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "SocketAddress port_value field not set");
+ }
+ cds_update->dns_hostname = JoinHostPort(
+ address_str,
+ envoy_config_core_v3_SocketAddress_port_value(socket_address));
+ return GRPC_ERROR_NONE;
+}
+
+// TODO(donnadionne): Check to see if cluster types aggregate_cluster and
+// logical_dns are enabled, this will be
+// removed once the cluster types are fully integration-tested and enabled by
+// default.
+bool XdsAggregateAndLogicalDnsClusterEnabled() {
+ char* value = gpr_getenv(
+ "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
+}
+
+grpc_error_handle CdsResourceParse(
+ const XdsEncodingContext& context,
+ const envoy_config_cluster_v3_Cluster* cluster, bool /*is_v2*/,
+ XdsClusterResource* cds_update) {
+ std::vector<grpc_error_handle> errors;
+ // Check the cluster_discovery_type.
+ if (!envoy_config_cluster_v3_Cluster_has_type(cluster) &&
+ !envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType not found."));
+ } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
+ envoy_config_cluster_v3_Cluster_EDS) {
+ cds_update->cluster_type = XdsClusterResource::ClusterType::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) &&
+ !envoy_config_core_v3_ConfigSource_has_self(eds_config)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "EDS ConfigSource is not ADS or SELF."));
+ }
+ // Record EDS service_name (if any).
+ upb_StringView 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);
+ }
+ } else if (!XdsAggregateAndLogicalDnsClusterEnabled()) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not valid."));
+ } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
+ envoy_config_cluster_v3_Cluster_LOGICAL_DNS) {
+ cds_update->cluster_type = XdsClusterResource::ClusterType::LOGICAL_DNS;
+ grpc_error_handle error = CdsLogicalDnsParse(cluster, cds_update);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ if (!envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not valid."));
+ } else {
+ const envoy_config_cluster_v3_Cluster_CustomClusterType*
+ custom_cluster_type =
+ envoy_config_cluster_v3_Cluster_cluster_type(cluster);
+ upb_StringView type_name =
+ envoy_config_cluster_v3_Cluster_CustomClusterType_name(
+ custom_cluster_type);
+ if (UpbStringToAbsl(type_name) != "envoy.clusters.aggregate") {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "DiscoveryType is not valid."));
+ } else {
+ cds_update->cluster_type = XdsClusterResource::ClusterType::AGGREGATE;
+ // Retrieve aggregate clusters.
+ const google_protobuf_Any* typed_config =
+ envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(
+ custom_cluster_type);
+ const upb_StringView aggregate_cluster_config_upb_stringview =
+ google_protobuf_Any_value(typed_config);
+ const envoy_extensions_clusters_aggregate_v3_ClusterConfig*
+ aggregate_cluster_config =
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(
+ aggregate_cluster_config_upb_stringview.data,
+ aggregate_cluster_config_upb_stringview.size,
+ context.arena);
+ if (aggregate_cluster_config == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't parse aggregate cluster."));
+ } else {
+ size_t size;
+ const upb_StringView* clusters =
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(
+ aggregate_cluster_config, &size);
+ for (size_t i = 0; i < size; ++i) {
+ const upb_StringView cluster = clusters[i];
+ cds_update->prioritized_cluster_names.emplace_back(
+ UpbStringToStdString(cluster));
+ }
+ }
+ }
+ }
+ }
+ // Check the LB policy.
+ if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
+ envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
+ cds_update->lb_policy = "ROUND_ROBIN";
+ } else if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
+ envoy_config_cluster_v3_Cluster_RING_HASH) {
+ cds_update->lb_policy = "RING_HASH";
+ // Record ring hash lb config
+ auto* ring_hash_config =
+ envoy_config_cluster_v3_Cluster_ring_hash_lb_config(cluster);
+ if (ring_hash_config != nullptr) {
+ const google_protobuf_UInt64Value* max_ring_size =
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(
+ ring_hash_config);
+ if (max_ring_size != nullptr) {
+ cds_update->max_ring_size =
+ google_protobuf_UInt64Value_value(max_ring_size);
+ if (cds_update->max_ring_size > 8388608 ||
+ cds_update->max_ring_size == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "max_ring_size is not in the range of 1 to 8388608."));
+ }
+ }
+ const google_protobuf_UInt64Value* min_ring_size =
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(
+ ring_hash_config);
+ if (min_ring_size != nullptr) {
+ cds_update->min_ring_size =
+ google_protobuf_UInt64Value_value(min_ring_size);
+ if (cds_update->min_ring_size > 8388608 ||
+ cds_update->min_ring_size == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "min_ring_size is not in the range of 1 to 8388608."));
+ }
+ if (cds_update->min_ring_size > cds_update->max_ring_size) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "min_ring_size cannot be greater than max_ring_size."));
+ }
+ }
+ if (envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
+ ring_hash_config) !=
+ envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ring hash lb config has invalid hash function."));
+ }
+ }
+ } else {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("LB policy is not supported."));
+ }
+ auto* transport_socket =
+ envoy_config_cluster_v3_Cluster_transport_socket(cluster);
+ if (transport_socket != nullptr) {
+ grpc_error_handle error = UpstreamTlsContextParse(
+ context, transport_socket, &cds_update->common_tls_context);
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(
+ grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Error parsing security configuration"),
+ 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)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ ": LRS ConfigSource is not self."));
+ }
+ cds_update->lrs_load_reporting_server.emplace(context.server);
+ }
+ // 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_CREATE_FROM_VECTOR("errors parsing CDS resource", &errors);
+}
+
+void MaybeLogCluster(const XdsEncodingContext& context,
+ const envoy_config_cluster_v3_Cluster* cluster) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_MessageDef* msg_type =
+ envoy_config_cluster_v3_Cluster_getmsgdef(context.symtab);
+ char buf[10240];
+ upb_TextEncode(cluster, msg_type, nullptr, 0, buf, sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] Cluster: %s", context.client, buf);
+ }
+}
+
+} // namespace
+
+absl::StatusOr<XdsResourceType::DecodeResult> XdsClusterResourceType::Decode(
+ const XdsEncodingContext& context, absl::string_view serialized_resource,
+ bool is_v2) const {
+ // Parse serialized proto.
+ auto* resource = envoy_config_cluster_v3_Cluster_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return absl::InvalidArgumentError("Can't parse Cluster resource.");
+ }
+ MaybeLogCluster(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name =
+ UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(resource));
+ auto cluster_data = absl::make_unique<ResourceDataSubclass>();
+ grpc_error_handle error =
+ CdsResourceParse(context, resource, is_v2, &cluster_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ std::string error_str = grpc_error_std_string(error);
+ GRPC_ERROR_UNREF(error);
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_ERROR, "[xds_client %p] invalid Cluster %s: %s",
+ context.client, result.name.c_str(), error_str.c_str());
+ }
+ result.resource = absl::InvalidArgumentError(error_str);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "[xds_client %p] parsed Cluster %s: %s", context.client,
+ result.name.c_str(), cluster_data->resource.ToString().c_str());
+ }
+ result.resource = std::move(cluster_data);
+ }
+ return std::move(result);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_cluster.h b/grpc/src/core/ext/xds/xds_cluster.h
new file mode 100644
index 00000000..5ac020fe
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_cluster.h
@@ -0,0 +1,108 @@
+//
+// 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_CLUSTER_H
+#define GRPC_CORE_EXT_XDS_XDS_CLUSTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+#include <vector>
+
+#include "absl/types/optional.h"
+#include "envoy/config/cluster/v3/cluster.upbdefs.h"
+#include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h"
+
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/ext/xds/xds_resource_type_impl.h"
+
+namespace grpc_core {
+
+struct XdsClusterResource {
+ enum ClusterType { EDS, LOGICAL_DNS, AGGREGATE };
+ ClusterType cluster_type;
+ // For cluster type EDS.
+ // The name to use in the EDS request.
+ // If empty, the cluster name will be used.
+ std::string eds_service_name;
+ // For cluster type LOGICAL_DNS.
+ // The hostname to lookup in DNS.
+ std::string dns_hostname;
+ // For cluster type AGGREGATE.
+ // The prioritized list of cluster names.
+ std::vector<std::string> prioritized_cluster_names;
+
+ // 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.
+ absl::optional<XdsBootstrap::XdsServer> lrs_load_reporting_server;
+
+ // The LB policy to use (e.g., "ROUND_ROBIN" or "RING_HASH").
+ std::string lb_policy;
+ // Used for RING_HASH LB policy only.
+ uint64_t min_ring_size = 1024;
+ uint64_t max_ring_size = 8388608;
+ // Maximum number of outstanding requests can be made to the upstream
+ // cluster.
+ uint32_t max_concurrent_requests = 1024;
+
+ bool operator==(const XdsClusterResource& other) const {
+ return cluster_type == other.cluster_type &&
+ eds_service_name == other.eds_service_name &&
+ dns_hostname == other.dns_hostname &&
+ prioritized_cluster_names == other.prioritized_cluster_names &&
+ common_tls_context == other.common_tls_context &&
+ lrs_load_reporting_server == other.lrs_load_reporting_server &&
+ lb_policy == other.lb_policy &&
+ min_ring_size == other.min_ring_size &&
+ max_ring_size == other.max_ring_size &&
+ max_concurrent_requests == other.max_concurrent_requests;
+ }
+
+ std::string ToString() const;
+};
+
+class XdsClusterResourceType
+ : public XdsResourceTypeImpl<XdsClusterResourceType, XdsClusterResource> {
+ public:
+ absl::string_view type_url() const override {
+ return "envoy.config.cluster.v3.Cluster";
+ }
+ absl::string_view v2_type_url() const override {
+ return "envoy.api.v2.Cluster";
+ }
+
+ absl::StatusOr<DecodeResult> Decode(const XdsEncodingContext& context,
+ absl::string_view serialized_resource,
+ bool is_v2) const override;
+
+ bool AllResourcesRequiredInSotW() const override { return true; }
+
+ void InitUpbSymtab(upb_DefPool* symtab) const override {
+ envoy_config_cluster_v3_Cluster_getmsgdef(symtab);
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig_getmsgdef(symtab);
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_getmsgdef(
+ symtab);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_CLUSTER_H
diff --git a/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.cc b/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.cc
new file mode 100644
index 00000000..e13f2283
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.cc
@@ -0,0 +1,142 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_cluster_specifier_plugin.h"
+
+#include "absl/strings/str_format.h"
+#include "envoy/extensions/filters/http/router/v3/router.upb.h"
+#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
+#include "google/protobuf/duration.upb.h"
+#include "upb/json_encode.h"
+
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/proto/grpc/lookup/v1/rls_config.upb.h"
+#include "src/proto/grpc/lookup/v1/rls_config.upbdefs.h"
+
+namespace grpc_core {
+
+const char* kXdsRouteLookupClusterSpecifierPluginConfigName =
+ "grpc.lookup.v1.RouteLookupClusterSpecifier";
+
+void XdsRouteLookupClusterSpecifierPlugin::PopulateSymtab(
+ upb_DefPool* symtab) const {
+ grpc_lookup_v1_RouteLookupConfig_getmsgdef(symtab);
+}
+
+absl::StatusOr<std::string>
+XdsRouteLookupClusterSpecifierPlugin::GenerateLoadBalancingPolicyConfig(
+ upb_StringView serialized_plugin_config, upb_Arena* arena,
+ upb_DefPool* symtab) const {
+ const auto* specifier = grpc_lookup_v1_RouteLookupClusterSpecifier_parse(
+ serialized_plugin_config.data, serialized_plugin_config.size, arena);
+ if (specifier == nullptr) {
+ return absl::InvalidArgumentError("Could not parse plugin config");
+ }
+ const auto* plugin_config =
+ grpc_lookup_v1_RouteLookupClusterSpecifier_route_lookup_config(specifier);
+ if (plugin_config == nullptr) {
+ return absl::InvalidArgumentError(
+ "Could not get route lookup config from route lookup cluster "
+ "specifier");
+ }
+ upb::Status status;
+ const upb_MessageDef* msg_type =
+ grpc_lookup_v1_RouteLookupConfig_getmsgdef(symtab);
+ size_t json_size = upb_JsonEncode(plugin_config, msg_type, symtab, 0, nullptr,
+ 0, status.ptr());
+ if (json_size == static_cast<size_t>(-1)) {
+ return absl::InvalidArgumentError(
+ absl::StrCat("failed to dump proto to JSON: ",
+ upb_Status_ErrorMessage(status.ptr())));
+ }
+ void* buf = upb_Arena_Malloc(arena, json_size + 1);
+ upb_JsonEncode(plugin_config, msg_type, symtab, 0,
+ reinterpret_cast<char*>(buf), json_size + 1, status.ptr());
+ Json::Object rls_policy;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ rls_policy["routeLookupConfig"] =
+ Json::Parse(reinterpret_cast<char*>(buf), &error);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ Json::Object cds_policy;
+ cds_policy["cds_experimental"] = Json::Object();
+ Json::Array child_policy;
+ child_policy.emplace_back(std::move(cds_policy));
+ rls_policy["childPolicy"] = std::move(child_policy);
+ rls_policy["childPolicyConfigTargetFieldName"] = "cluster";
+ Json::Object policy;
+ policy["rls_experimental"] = std::move(rls_policy);
+ Json::Array policies;
+ policies.emplace_back(std::move(policy));
+ Json lb_policy_config(std::move(policies));
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
+ // TODO(roth): If/when we ever add a second plugin, refactor this code
+ // somehow such that we automatically validate the resulting config against
+ // the gRPC LB policy registry instead of requiring each plugin to do that
+ // itself.
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(lb_policy_config,
+ &parse_error);
+ if (parse_error != GRPC_ERROR_NONE) {
+ absl::Status status = absl::InvalidArgumentError(absl::StrCat(
+ kXdsRouteLookupClusterSpecifierPluginConfigName,
+ " ClusterSpecifierPlugin returned invalid LB policy config: ",
+ grpc_error_std_string(parse_error)));
+ GRPC_ERROR_UNREF(parse_error);
+ return status;
+ }
+ return lb_policy_config.Dump();
+}
+
+namespace {
+
+using PluginRegistryMap =
+ std::map<absl::string_view, std::unique_ptr<XdsClusterSpecifierPluginImpl>>;
+
+PluginRegistryMap* g_plugin_registry = nullptr;
+
+} // namespace
+
+const XdsClusterSpecifierPluginImpl*
+XdsClusterSpecifierPluginRegistry::GetPluginForType(
+ absl::string_view config_proto_type_name) {
+ auto it = g_plugin_registry->find(config_proto_type_name);
+ if (it == g_plugin_registry->end()) return nullptr;
+ return it->second.get();
+}
+
+void XdsClusterSpecifierPluginRegistry::PopulateSymtab(upb_DefPool* symtab) {
+ for (const auto& p : *g_plugin_registry) {
+ p.second->PopulateSymtab(symtab);
+ }
+}
+
+void XdsClusterSpecifierPluginRegistry::RegisterPlugin(
+ std::unique_ptr<XdsClusterSpecifierPluginImpl> plugin,
+ absl::string_view config_proto_type_name) {
+ (*g_plugin_registry)[config_proto_type_name] = std::move(plugin);
+}
+
+void XdsClusterSpecifierPluginRegistry::Init() {
+ g_plugin_registry = new PluginRegistryMap;
+ RegisterPlugin(absl::make_unique<XdsRouteLookupClusterSpecifierPlugin>(),
+ kXdsRouteLookupClusterSpecifierPluginConfigName);
+}
+
+void XdsClusterSpecifierPluginRegistry::Shutdown() { delete g_plugin_registry; }
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.h b/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.h
new file mode 100644
index 00000000..54513b02
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_cluster_specifier_plugin.h
@@ -0,0 +1,79 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CLUSTER_SPECIFIER_PLUGIN_H
+#define GRPC_CORE_EXT_XDS_XDS_CLUSTER_SPECIFIER_PLUGIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <set>
+#include <string>
+
+#include "absl/status/statusor.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+#include "google/protobuf/any.upb.h"
+#include "upb/def.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/json/json.h"
+
+namespace grpc_core {
+
+class XdsClusterSpecifierPluginImpl {
+ public:
+ virtual ~XdsClusterSpecifierPluginImpl() = default;
+
+ // Loads the proto message into the upb symtab.
+ virtual void PopulateSymtab(upb_DefPool* symtab) const = 0;
+
+ // Returns the LB policy config in JSON form.
+ virtual absl::StatusOr<std::string> GenerateLoadBalancingPolicyConfig(
+ upb_StringView serialized_plugin_config, upb_Arena* arena,
+ upb_DefPool* symtab) const = 0;
+};
+
+class XdsRouteLookupClusterSpecifierPlugin
+ : public XdsClusterSpecifierPluginImpl {
+ void PopulateSymtab(upb_DefPool* symtab) const override;
+
+ absl::StatusOr<std::string> GenerateLoadBalancingPolicyConfig(
+ upb_StringView serialized_plugin_config, upb_Arena* arena,
+ upb_DefPool* symtab) const override;
+};
+
+class XdsClusterSpecifierPluginRegistry {
+ public:
+ static void RegisterPlugin(
+ std::unique_ptr<XdsClusterSpecifierPluginImpl> plugin,
+ absl::string_view config_proto_type_name);
+
+ static void PopulateSymtab(upb_DefPool* symtab);
+
+ static const XdsClusterSpecifierPluginImpl* GetPluginForType(
+ absl::string_view config_proto_type_name);
+
+ // Global init and shutdown.
+ static void Init();
+ static void Shutdown();
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_CLUSTER_SPECIFIER_PLUGIN_H
diff --git a/grpc/src/core/ext/xds/xds_common_types.cc b/grpc/src/core/ext/xds/xds_common_types.cc
new file mode 100644
index 00000000..37083181
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_common_types.cc
@@ -0,0 +1,388 @@
+//
+// 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_common_types.h"
+
+#include "absl/container/inlined_vector.h"
+#include "absl/status/statusor.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
+#include "absl/strings/str_join.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "xds/type/v3/typed_struct.upb.h"
+
+namespace grpc_core {
+
+//
+// CommonTlsContext::CertificateValidationContext
+//
+
+std::string CommonTlsContext::CertificateValidationContext::ToString() const {
+ std::vector<std::string> contents;
+ for (const auto& match : match_subject_alt_names) {
+ contents.push_back(match.ToString());
+ }
+ return absl::StrFormat("{match_subject_alt_names=[%s]}",
+ absl::StrJoin(contents, ", "));
+}
+
+bool CommonTlsContext::CertificateValidationContext::Empty() const {
+ return match_subject_alt_names.empty();
+}
+
+//
+// CommonTlsContext::CertificateProviderPluginInstance
+//
+
+std::string CommonTlsContext::CertificateProviderPluginInstance::ToString()
+ const {
+ absl::InlinedVector<std::string, 2> contents;
+ if (!instance_name.empty()) {
+ contents.push_back(absl::StrFormat("instance_name=%s", instance_name));
+ }
+ if (!certificate_name.empty()) {
+ contents.push_back(
+ absl::StrFormat("certificate_name=%s", certificate_name));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+bool CommonTlsContext::CertificateProviderPluginInstance::Empty() const {
+ return instance_name.empty() && certificate_name.empty();
+}
+
+//
+// CommonTlsContext
+//
+
+std::string CommonTlsContext::ToString() const {
+ absl::InlinedVector<std::string, 2> contents;
+ if (!tls_certificate_provider_instance.Empty()) {
+ contents.push_back(
+ absl::StrFormat("tls_certificate_provider_instance=%s",
+ tls_certificate_provider_instance.ToString()));
+ }
+ if (!certificate_validation_context.Empty()) {
+ contents.push_back(
+ absl::StrFormat("certificate_validation_context=%s",
+ certificate_validation_context.ToString()));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+bool CommonTlsContext::Empty() const {
+ return tls_certificate_provider_instance.Empty() &&
+ certificate_validation_context.Empty();
+}
+
+namespace {
+
+// CertificateProviderInstance is deprecated but we are still supporting it for
+// backward compatibility reasons. Note that we still parse the data into the
+// same CertificateProviderPluginInstance struct since the fields are the same.
+// TODO(yashykt): Remove this once we stop supporting the old way of fetching
+// certificate provider instances.
+grpc_error_handle CertificateProviderInstanceParse(
+ const XdsEncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*
+ certificate_provider_instance_proto,
+ CommonTlsContext::CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance) {
+ *certificate_provider_plugin_instance = {
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
+ certificate_provider_instance_proto)),
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(
+ certificate_provider_instance_proto))};
+ if (context.certificate_provider_definition_map->find(
+ certificate_provider_plugin_instance->instance_name) ==
+ context.certificate_provider_definition_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unrecognized certificate provider instance name: ",
+ certificate_provider_plugin_instance->instance_name));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle CertificateProviderPluginInstanceParse(
+ const XdsEncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance_proto,
+ CommonTlsContext::CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance) {
+ *certificate_provider_plugin_instance = {
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_instance_name(
+ certificate_provider_plugin_instance_proto)),
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_certificate_name(
+ certificate_provider_plugin_instance_proto))};
+ if (context.certificate_provider_definition_map->find(
+ certificate_provider_plugin_instance->instance_name) ==
+ context.certificate_provider_definition_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unrecognized certificate provider instance name: ",
+ certificate_provider_plugin_instance->instance_name));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle CertificateValidationContextParse(
+ const XdsEncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*
+ certificate_validation_context_proto,
+ CommonTlsContext::CertificateValidationContext*
+ certificate_validation_context) {
+ std::vector<grpc_error_handle> errors;
+ size_t len = 0;
+ auto* subject_alt_names_matchers =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(
+ certificate_validation_context_proto, &len);
+ for (size_t i = 0; i < len; ++i) {
+ StringMatcher::Type type;
+ std::string matcher;
+ if (envoy_type_matcher_v3_StringMatcher_has_exact(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kExact;
+ 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])) {
+ type = StringMatcher::Type::kPrefix;
+ 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])) {
+ type = StringMatcher::Type::kSuffix;
+ matcher = UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_contains(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kContains;
+ matcher =
+ UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kSafeRegex;
+ auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
+ subject_alt_names_matchers[i]);
+ matcher = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ } else {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid StringMatcher specified"));
+ continue;
+ }
+ bool ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
+ subject_alt_names_matchers[i]);
+ absl::StatusOr<StringMatcher> string_matcher =
+ StringMatcher::Create(type, matcher,
+ /*case_sensitive=*/!ignore_case);
+ if (!string_matcher.ok()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("string matcher: ", string_matcher.status().message())));
+ continue;
+ }
+ if (type == StringMatcher::Type::kSafeRegex && ignore_case) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "StringMatcher: ignore_case has no effect for SAFE_REGEX."));
+ continue;
+ }
+ certificate_validation_context->match_subject_alt_names.push_back(
+ std::move(string_matcher.value()));
+ }
+ auto* ca_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(
+ certificate_validation_context_proto);
+ if (ca_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderPluginInstanceParse(
+ context, ca_certificate_provider_instance,
+ &certificate_validation_context->ca_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(
+ certificate_validation_context_proto, nullptr) != nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: verify_certificate_spki "
+ "unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(
+ certificate_validation_context_proto, nullptr) != nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: verify_certificate_hash "
+ "unsupported"));
+ }
+ auto* require_signed_certificate_timestamp =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(
+ certificate_validation_context_proto);
+ if (require_signed_certificate_timestamp != nullptr &&
+ google_protobuf_BoolValue_value(require_signed_certificate_timestamp)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: "
+ "require_signed_certificate_timestamp unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(
+ certificate_validation_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: crl unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(
+ certificate_validation_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: custom_validator_config "
+ "unsupported"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR(
+ "Error parsing CertificateValidationContext", &errors);
+}
+
+} // namespace
+
+grpc_error_handle CommonTlsContext::Parse(
+ const XdsEncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
+ common_tls_context_proto,
+ CommonTlsContext* common_tls_context) {
+ std::vector<grpc_error_handle> errors;
+ // The validation context is derived from the oneof in
+ // 'validation_context_type'. 'validation_context_sds_secret_config' is not
+ // supported.
+ 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) {
+ grpc_error_handle error = CertificateValidationContextParse(
+ context, default_validation_context,
+ &common_tls_context->certificate_validation_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ // If after parsing default_validation_context,
+ // common_tls_context->certificate_validation_context.ca_certificate_provider_instance
+ // is empty, fall back onto
+ // 'validation_context_certificate_provider_instance' inside
+ // 'combined_validation_context'. Note that this way of fetching root
+ // certificates is deprecated and will be removed in the future.
+ // TODO(yashykt): Remove this once it's no longer needed.
+ auto* validation_context_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(
+ combined_validation_context);
+ if (common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance.Empty() &&
+ validation_context_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderInstanceParse(
+ context, validation_context_certificate_provider_instance,
+ &common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ } else {
+ auto* validation_context =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(
+ common_tls_context_proto);
+ if (validation_context != nullptr) {
+ grpc_error_handle error = CertificateValidationContextParse(
+ context, validation_context,
+ &common_tls_context->certificate_validation_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else if (
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "validation_context_sds_secret_config unsupported"));
+ }
+ }
+ auto* tls_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(
+ common_tls_context_proto);
+ if (tls_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderPluginInstanceParse(
+ context, tls_certificate_provider_instance,
+ &common_tls_context->tls_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ // Fall back onto 'tls_certificate_certificate_provider_instance'. Note that
+ // this way of fetching identity certificates is deprecated and will be
+ // removed in the future.
+ // TODO(yashykt): Remove this once it's no longer needed.
+ 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) {
+ grpc_error_handle error = CertificateProviderInstanceParse(
+ context, tls_certificate_certificate_provider_instance,
+ &common_tls_context->tls_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "tls_certificates unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "tls_certificate_sds_secret_configs unsupported"));
+ }
+ }
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(
+ common_tls_context_proto)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("tls_params unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(
+ common_tls_context_proto)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("custom_handshaker unsupported"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing CommonTlsContext",
+ &errors);
+}
+
+grpc_error_handle ExtractExtensionTypeName(const XdsEncodingContext& context,
+ const google_protobuf_Any* any,
+ absl::string_view* extension_type) {
+ *extension_type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
+ if (*extension_type == "type.googleapis.com/xds.type.v3.TypedStruct" ||
+ *extension_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
+ upb_StringView any_value = google_protobuf_Any_value(any);
+ const auto* typed_struct = xds_type_v3_TypedStruct_parse(
+ any_value.data, any_value.size, context.arena);
+ if (typed_struct == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "could not parse TypedStruct from extension");
+ }
+ *extension_type =
+ UpbStringToAbsl(xds_type_v3_TypedStruct_type_url(typed_struct));
+ }
+ *extension_type = absl::StripPrefix(*extension_type, "type.googleapis.com/");
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_common_types.h b/grpc/src/core/ext/xds/xds_common_types.h
new file mode 100644
index 00000000..c5e118bd
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_common_types.h
@@ -0,0 +1,95 @@
+//
+// 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_COMMON_TYPES_H
+#define GRPC_CORE_EXT_XDS_XDS_COMMON_TYPES_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+#include <vector>
+
+#include "absl/strings/str_format.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/duration.upb.h"
+
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/core/lib/matchers/matchers.h"
+
+namespace grpc_core {
+
+inline Duration ParseDuration(const google_protobuf_Duration* proto_duration) {
+ return Duration::FromSecondsAndNanoseconds(
+ google_protobuf_Duration_seconds(proto_duration),
+ google_protobuf_Duration_nanos(proto_duration));
+}
+
+struct CommonTlsContext {
+ struct CertificateProviderPluginInstance {
+ std::string instance_name;
+ std::string certificate_name;
+
+ bool operator==(const CertificateProviderPluginInstance& other) const {
+ return instance_name == other.instance_name &&
+ certificate_name == other.certificate_name;
+ }
+
+ std::string ToString() const;
+ bool Empty() const;
+ };
+
+ struct CertificateValidationContext {
+ CertificateProviderPluginInstance ca_certificate_provider_instance;
+ std::vector<StringMatcher> match_subject_alt_names;
+
+ bool operator==(const CertificateValidationContext& other) const {
+ return ca_certificate_provider_instance ==
+ other.ca_certificate_provider_instance &&
+ match_subject_alt_names == other.match_subject_alt_names;
+ }
+
+ std::string ToString() const;
+ bool Empty() const;
+ };
+
+ CertificateValidationContext certificate_validation_context;
+ CertificateProviderPluginInstance tls_certificate_provider_instance;
+
+ bool operator==(const CommonTlsContext& other) const {
+ return certificate_validation_context ==
+ other.certificate_validation_context &&
+ tls_certificate_provider_instance ==
+ other.tls_certificate_provider_instance;
+ }
+
+ std::string ToString() const;
+ bool Empty() const;
+
+ static grpc_error_handle Parse(
+ const XdsEncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
+ common_tls_context_proto,
+ CommonTlsContext* common_tls_context);
+};
+
+grpc_error_handle ExtractExtensionTypeName(const XdsEncodingContext& context,
+ const google_protobuf_Any* any,
+ absl::string_view* extension_type);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_COMMON_TYPES_H
diff --git a/grpc/src/core/ext/xds/xds_endpoint.cc b/grpc/src/core/ext/xds/xds_endpoint.cc
new file mode 100644
index 00000000..89f433f6
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_endpoint.cc
@@ -0,0 +1,371 @@
+//
+// 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_endpoint.h"
+
+#include "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_join.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 "envoy/config/endpoint/v3/endpoint.upb.h"
+#include "envoy/config/endpoint/v3/endpoint.upbdefs.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
+#include "envoy/type/v3/percent.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "upb/text_encode.h"
+#include "upb/upb.h"
+#include "upb/upb.hpp"
+
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+
+namespace grpc_core {
+
+//
+// XdsEndpointResource
+//
+
+std::string XdsEndpointResource::Priority::Locality::ToString() const {
+ std::vector<std::string> endpoint_strings;
+ for (const ServerAddress& endpoint : endpoints) {
+ endpoint_strings.emplace_back(endpoint.ToString());
+ }
+ return absl::StrCat("{name=", name->AsHumanReadableString(),
+ ", lb_weight=", lb_weight, ", endpoints=[",
+ absl::StrJoin(endpoint_strings, ", "), "]}");
+}
+
+bool XdsEndpointResource::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;
+}
+
+std::string XdsEndpointResource::Priority::ToString() const {
+ std::vector<std::string> locality_strings;
+ for (const auto& p : localities) {
+ locality_strings.emplace_back(p.second.ToString());
+ }
+ return absl::StrCat("[", absl::StrJoin(locality_strings, ", "), "]");
+}
+
+bool XdsEndpointResource::DropConfig::ShouldDrop(
+ const std::string** 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;
+}
+
+std::string XdsEndpointResource::DropConfig::ToString() const {
+ std::vector<std::string> category_strings;
+ for (const DropCategory& category : drop_category_list_) {
+ category_strings.emplace_back(
+ absl::StrCat(category.name, "=", category.parts_per_million));
+ }
+ return absl::StrCat("{[", absl::StrJoin(category_strings, ", "),
+ "], drop_all=", drop_all_, "}");
+}
+
+std::string XdsEndpointResource::ToString() const {
+ std::vector<std::string> priority_strings;
+ for (size_t i = 0; i < priorities.size(); ++i) {
+ const Priority& priority = priorities[i];
+ priority_strings.emplace_back(
+ absl::StrCat("priority ", i, ": ", priority.ToString()));
+ }
+ return absl::StrCat("priorities=[", absl::StrJoin(priority_strings, ", "),
+ "], drop_config=", drop_config->ToString());
+}
+
+//
+// XdsEndpointResourceType
+//
+
+namespace {
+
+void MaybeLogClusterLoadAssignment(
+ const XdsEncodingContext& context,
+ const envoy_config_endpoint_v3_ClusterLoadAssignment* cla) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_MessageDef* msg_type =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(
+ context.symtab);
+ char buf[10240];
+ upb_TextEncode(cla, msg_type, nullptr, 0, buf, sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] ClusterLoadAssignment: %s",
+ context.client, buf);
+ }
+}
+
+grpc_error_handle 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);
+ std::string 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.");
+ }
+ // Find load_balancing_weight for the endpoint.
+ const google_protobuf_UInt32Value* load_balancing_weight =
+ envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(lb_endpoint);
+ const int32_t weight =
+ load_balancing_weight != nullptr
+ ? google_protobuf_UInt32Value_value(load_balancing_weight)
+ : 500;
+ if (weight == 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid endpoint weight of 0.");
+ }
+ // Populate grpc_resolved_address.
+ grpc_resolved_address addr;
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Append the address to the list.
+ std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
+ attributes;
+ attributes[ServerAddressWeightAttribute::kServerAddressWeightAttributeKey] =
+ absl::make_unique<ServerAddressWeightAttribute>(weight);
+ list->emplace_back(addr, nullptr, std::move(attributes));
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle LocalityParse(
+ const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
+ XdsEndpointResource::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);
+ if (locality == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty locality.");
+ }
+ std::string region =
+ UpbStringToStdString(envoy_config_core_v3_Locality_region(locality));
+ std::string zone =
+ UpbStringToStdString(envoy_config_core_v3_Locality_zone(locality));
+ std::string 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_handle 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_handle DropParseAndAppend(
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
+ drop_overload,
+ XdsEndpointResource::DropConfig* drop_config) {
+ // Get the category.
+ std::string category = UpbStringToStdString(
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_category(
+ drop_overload));
+ if (category.empty()) {
+ 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 = std::min(numerator, 1000000u);
+ drop_config->AddCategory(std::move(category), numerator);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle EdsResourceParse(
+ const XdsEncodingContext& /*context*/,
+ const envoy_config_endpoint_v3_ClusterLoadAssignment*
+ cluster_load_assignment,
+ bool /*is_v2*/, XdsEndpointResource* eds_update) {
+ std::vector<grpc_error_handle> errors;
+ // 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;
+ XdsEndpointResource::Priority::Locality locality;
+ grpc_error_handle error = LocalityParse(endpoints[j], &locality, &priority);
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(error);
+ continue;
+ }
+ // 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.
+ if (eds_update->priorities.size() < priority + 1) {
+ eds_update->priorities.resize(priority + 1);
+ }
+ auto& locality_map = eds_update->priorities[priority].localities;
+ auto it = locality_map.find(locality.name.get());
+ if (it != locality_map.end()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "duplicate locality ", locality.name->AsHumanReadableString(),
+ " found in priority ", priority)));
+ } else {
+ locality_map.emplace(locality.name.get(), std::move(locality));
+ }
+ }
+ for (const auto& priority : eds_update->priorities) {
+ if (priority.localities.empty()) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("sparse priority list"));
+ }
+ }
+ // Get the drop config.
+ eds_update->drop_config = MakeRefCounted<XdsEndpointResource::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_handle error =
+ DropParseAndAppend(drop_overload[j], eds_update->drop_config.get());
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(
+ grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "drop config validation error"),
+ error));
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing EDS resource", &errors);
+}
+
+} // namespace
+
+absl::StatusOr<XdsResourceType::DecodeResult> XdsEndpointResourceType::Decode(
+ const XdsEncodingContext& context, absl::string_view serialized_resource,
+ bool is_v2) const {
+ // Parse serialized proto.
+ auto* resource = envoy_config_endpoint_v3_ClusterLoadAssignment_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return absl::InvalidArgumentError(
+ "Can't parse ClusterLoadAssignment resource.");
+ }
+ MaybeLogClusterLoadAssignment(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name = UpbStringToStdString(
+ envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(resource));
+ auto endpoint_data = absl::make_unique<ResourceDataSubclass>();
+ grpc_error_handle error =
+ EdsResourceParse(context, resource, is_v2, &endpoint_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ std::string error_str = grpc_error_std_string(error);
+ GRPC_ERROR_UNREF(error);
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_ERROR, "[xds_client %p] invalid ClusterLoadAssignment %s: %s",
+ context.client, result.name.c_str(), error_str.c_str());
+ }
+ result.resource = absl::InvalidArgumentError(error_str);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "[xds_client %p] parsed ClusterLoadAssignment %s: %s",
+ context.client, result.name.c_str(),
+ endpoint_data->resource.ToString().c_str());
+ }
+ result.resource = std::move(endpoint_data);
+ }
+ return std::move(result);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_endpoint.h b/grpc/src/core/ext/xds/xds_endpoint.h
new file mode 100644
index 00000000..d3ce9cb0
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_endpoint.h
@@ -0,0 +1,135 @@
+//
+// 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_ENDPOINT_H
+#define GRPC_CORE_EXT_XDS_XDS_ENDPOINT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "absl/container/inlined_vector.h"
+#include "envoy/config/endpoint/v3/endpoint.upbdefs.h"
+
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_client_stats.h"
+#include "src/core/ext/xds/xds_resource_type_impl.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/resolver/server_address.h"
+
+namespace grpc_core {
+
+struct XdsEndpointResource {
+ 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); }
+ std::string ToString() const;
+ };
+
+ std::map<XdsLocalityName*, Locality, XdsLocalityName::Less> localities;
+
+ bool operator==(const Priority& other) const;
+ std::string ToString() const;
+ };
+ using PriorityList = 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;
+ }
+
+ std::string name;
+ const uint32_t parts_per_million;
+ };
+
+ using DropCategoryList = absl::InlinedVector<DropCategory, 2>;
+
+ void AddCategory(std::string 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 std::string** 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); }
+
+ std::string ToString() const;
+
+ private:
+ DropCategoryList drop_category_list_;
+ bool drop_all_ = false;
+ };
+
+ PriorityList priorities;
+ RefCountedPtr<DropConfig> drop_config;
+
+ bool operator==(const XdsEndpointResource& other) const {
+ return priorities == other.priorities && *drop_config == *other.drop_config;
+ }
+ std::string ToString() const;
+};
+
+class XdsEndpointResourceType
+ : public XdsResourceTypeImpl<XdsEndpointResourceType, XdsEndpointResource> {
+ public:
+ absl::string_view type_url() const override {
+ return "envoy.config.endpoint.v3.ClusterLoadAssignment";
+ }
+ absl::string_view v2_type_url() const override {
+ return "envoy.api.v2.ClusterLoadAssignment";
+ }
+
+ absl::StatusOr<DecodeResult> Decode(const XdsEncodingContext& context,
+ absl::string_view serialized_resource,
+ bool is_v2) const override;
+
+ void InitUpbSymtab(upb_DefPool* symtab) const override {
+ envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef(symtab);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_ENDPOINT_H
diff --git a/grpc/src/core/ext/xds/xds_http_fault_filter.cc b/grpc/src/core/ext/xds/xds_http_fault_filter.cc
index 64b7a2b4..4c7e826c 100644
--- a/grpc/src/core/ext/xds/xds_http_fault_filter.cc
+++ b/grpc/src/core/ext/xds/xds_http_fault_filter.cc
@@ -18,8 +18,6 @@
#include "src/core/ext/xds/xds_http_fault_filter.h"
-#include <grpc/grpc.h>
-
#include <string>
#include "absl/status/statusor.h"
@@ -33,6 +31,10 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "upb/def.h"
+
+#include <grpc/grpc.h>
+
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
#include "src/core/ext/xds/xds_http_filters.h"
#include "src/core/lib/channel/channel_args.h"
@@ -40,7 +42,6 @@
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/transport/status_conversion.h"
-#include "upb/def.h"
namespace grpc_core {
@@ -68,8 +69,8 @@ uint32_t GetDenominator(const envoy_type_v3_FractionalPercent* fraction) {
return 100;
}
-absl::StatusOr<Json> ParseHttpFaultIntoJson(upb_strview serialized_http_fault,
- upb_arena* arena) {
+absl::StatusOr<Json> ParseHttpFaultIntoJson(
+ upb_StringView serialized_http_fault, upb_Arena* arena) {
auto* http_fault = envoy_extensions_filters_http_fault_v3_HTTPFault_parse(
serialized_http_fault.data, serialized_http_fault.size, arena);
if (http_fault == nullptr) {
@@ -173,13 +174,13 @@ absl::StatusOr<Json> ParseHttpFaultIntoJson(upb_strview serialized_http_fault,
} // namespace
-void XdsHttpFaultFilter::PopulateSymtab(upb_symtab* symtab) const {
+void XdsHttpFaultFilter::PopulateSymtab(upb_DefPool* symtab) const {
envoy_extensions_filters_http_fault_v3_HTTPFault_getmsgdef(symtab);
}
absl::StatusOr<XdsHttpFilterImpl::FilterConfig>
-XdsHttpFaultFilter::GenerateFilterConfig(upb_strview serialized_filter_config,
- upb_arena* arena) const {
+XdsHttpFaultFilter::GenerateFilterConfig(
+ upb_StringView serialized_filter_config, upb_Arena* arena) const {
absl::StatusOr<Json> parse_result =
ParseHttpFaultIntoJson(serialized_filter_config, arena);
if (!parse_result.ok()) {
@@ -190,14 +191,14 @@ XdsHttpFaultFilter::GenerateFilterConfig(upb_strview serialized_filter_config,
absl::StatusOr<XdsHttpFilterImpl::FilterConfig>
XdsHttpFaultFilter::GenerateFilterConfigOverride(
- upb_strview serialized_filter_config, upb_arena* arena) const {
+ upb_StringView serialized_filter_config, upb_Arena* arena) const {
// HTTPFault filter has the same message type in HTTP connection manager's
// filter config and in overriding filter config field.
return GenerateFilterConfig(serialized_filter_config, arena);
}
const grpc_channel_filter* XdsHttpFaultFilter::channel_filter() const {
- return &FaultInjectionFilterVtable;
+ return &FaultInjectionFilter::kFilter;
}
grpc_channel_args* XdsHttpFaultFilter::ModifyChannelArgs(
diff --git a/grpc/src/core/ext/xds/xds_http_fault_filter.h b/grpc/src/core/ext/xds/xds_http_fault_filter.h
index 60c49524..edc46e12 100644
--- a/grpc/src/core/ext/xds/xds_http_fault_filter.h
+++ b/grpc/src/core/ext/xds/xds_http_fault_filter.h
@@ -19,11 +19,12 @@
#include <grpc/support/port_platform.h>
+#include "absl/status/statusor.h"
+#include "upb/def.h"
+
#include <grpc/grpc.h>
-#include "absl/status/statusor.h"
#include "src/core/ext/xds/xds_http_filters.h"
-#include "upb/def.h"
namespace grpc_core {
@@ -32,15 +33,15 @@ extern const char* kXdsHttpFaultFilterConfigName;
class XdsHttpFaultFilter : public XdsHttpFilterImpl {
public:
// Overrides the PopulateSymtab method
- void PopulateSymtab(upb_symtab* symtab) const override;
+ void PopulateSymtab(upb_DefPool* symtab) const override;
// Overrides the GenerateFilterConfig method
absl::StatusOr<FilterConfig> GenerateFilterConfig(
- upb_strview serialized_filter_config, upb_arena* arena) const override;
+ upb_StringView serialized_filter_config, upb_Arena* arena) const override;
// Overrides the GenerateFilterConfigOverride method
absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
- upb_strview serialized_filter_config, upb_arena* arena) const override;
+ upb_StringView serialized_filter_config, upb_Arena* arena) const override;
// Overrides the channel_filter method
const grpc_channel_filter* channel_filter() const override;
diff --git a/grpc/src/core/ext/xds/xds_http_filters.cc b/grpc/src/core/ext/xds/xds_http_filters.cc
index 9bd4858b..f2f28144 100644
--- a/grpc/src/core/ext/xds/xds_http_filters.cc
+++ b/grpc/src/core/ext/xds/xds_http_filters.cc
@@ -20,7 +20,9 @@
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
+
#include "src/core/ext/xds/xds_http_fault_filter.h"
+#include "src/core/ext/xds/xds_http_rbac_filter.h"
namespace grpc_core {
@@ -31,12 +33,13 @@ namespace {
class XdsHttpRouterFilter : public XdsHttpFilterImpl {
public:
- void PopulateSymtab(upb_symtab* symtab) const override {
+ void PopulateSymtab(upb_DefPool* symtab) const override {
envoy_extensions_filters_http_router_v3_Router_getmsgdef(symtab);
}
absl::StatusOr<FilterConfig> GenerateFilterConfig(
- upb_strview serialized_filter_config, upb_arena* arena) const override {
+ upb_StringView serialized_filter_config,
+ upb_Arena* arena) const override {
if (envoy_extensions_filters_http_router_v3_Router_parse(
serialized_filter_config.data, serialized_filter_config.size,
arena) == nullptr) {
@@ -46,16 +49,15 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl {
}
absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
- upb_strview /*serialized_filter_config*/,
- upb_arena* /*arena*/) const override {
+ upb_StringView /*serialized_filter_config*/,
+ upb_Arena* /*arena*/) const override {
return absl::InvalidArgumentError(
"router filter does not support config override");
}
- // No-op -- this filter is special-cased by the xds resolver.
const grpc_channel_filter* channel_filter() const override { return nullptr; }
- // No-op -- this filter is special-cased by the xds resolver.
+ // No-op. This will never be called, since channel_filter() returns null.
absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
const FilterConfig& /*hcm_filter_config*/,
const FilterConfig* /*filter_config_override*/) const override {
@@ -65,6 +67,8 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl {
bool IsSupportedOnClients() const override { return true; }
bool IsSupportedOnServers() const override { return true; }
+
+ bool IsTerminalFilter() const override { return true; }
};
using FilterOwnerList = std::vector<std::unique_ptr<XdsHttpFilterImpl>>;
@@ -91,7 +95,7 @@ const XdsHttpFilterImpl* XdsHttpFilterRegistry::GetFilterForType(
return it->second;
}
-void XdsHttpFilterRegistry::PopulateSymtab(upb_symtab* symtab) {
+void XdsHttpFilterRegistry::PopulateSymtab(upb_DefPool* symtab) {
for (const auto& filter : *g_filters) {
filter->PopulateSymtab(symtab);
}
@@ -104,6 +108,10 @@ void XdsHttpFilterRegistry::Init() {
{kXdsHttpRouterFilterConfigName});
RegisterFilter(absl::make_unique<XdsHttpFaultFilter>(),
{kXdsHttpFaultFilterConfigName});
+ RegisterFilter(absl::make_unique<XdsHttpRbacFilter>(),
+ {kXdsHttpRbacFilterConfigName});
+ RegisterFilter(absl::make_unique<XdsHttpRbacFilter>(),
+ {kXdsHttpRbacFilterConfigOverrideName});
}
void XdsHttpFilterRegistry::Shutdown() {
diff --git a/grpc/src/core/ext/xds/xds_http_filters.h b/grpc/src/core/ext/xds/xds_http_filters.h
index 33241968..5500bff2 100644
--- a/grpc/src/core/ext/xds/xds_http_filters.h
+++ b/grpc/src/core/ext/xds/xds_http_filters.h
@@ -70,17 +70,17 @@ class XdsHttpFilterImpl {
virtual ~XdsHttpFilterImpl() = default;
// Loads the proto message into the upb symtab.
- virtual void PopulateSymtab(upb_symtab* symtab) const = 0;
+ virtual void PopulateSymtab(upb_DefPool* symtab) const = 0;
// Generates a Config from the xDS filter config proto.
// Used for the top-level config in the HCM HTTP filter list.
virtual absl::StatusOr<FilterConfig> GenerateFilterConfig(
- upb_strview serialized_filter_config, upb_arena* arena) const = 0;
+ upb_StringView serialized_filter_config, upb_Arena* arena) const = 0;
// Generates a Config from the xDS filter config proto.
// Used for the typed_per_filter_config override in VirtualHost and Route.
virtual absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
- upb_strview serialized_filter_config, upb_arena* arena) const = 0;
+ upb_StringView serialized_filter_config, upb_Arena* arena) const = 0;
// C-core channel filter implementation.
virtual const grpc_channel_filter* channel_filter() const = 0;
@@ -107,6 +107,9 @@ class XdsHttpFilterImpl {
// Returns true if the filter is supported on servers; false otherwise
virtual bool IsSupportedOnServers() const = 0;
+
+ // Returns true if the filter must be the last filter in the chain.
+ virtual bool IsTerminalFilter() const { return false; }
};
class XdsHttpFilterRegistry {
@@ -118,7 +121,7 @@ class XdsHttpFilterRegistry {
static const XdsHttpFilterImpl* GetFilterForType(
absl::string_view proto_type_name);
- static void PopulateSymtab(upb_symtab* symtab);
+ static void PopulateSymtab(upb_DefPool* symtab);
// Global init and shutdown.
static void Init();
diff --git a/grpc/src/core/ext/xds/xds_http_rbac_filter.cc b/grpc/src/core/ext/xds/xds_http_rbac_filter.cc
new file mode 100644
index 00000000..14cbbd30
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_http_rbac_filter.cc
@@ -0,0 +1,563 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_http_rbac_filter.h"
+
+#include "absl/strings/str_format.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/extensions/filters/http/rbac/v3/rbac.upb.h"
+#include "envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
+#include "envoy/type/matcher/v3/path.upb.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
+#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/v3/range.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+
+#include "src/core/ext/filters/rbac/rbac_filter.h"
+#include "src/core/ext/filters/rbac/rbac_service_config_parser.h"
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+
+const char* kXdsHttpRbacFilterConfigName =
+ "envoy.extensions.filters.http.rbac.v3.RBAC";
+
+const char* kXdsHttpRbacFilterConfigOverrideName =
+ "envoy.extensions.filters.http.rbac.v3.RBACPerRoute";
+
+namespace {
+
+Json ParseRegexMatcherToJson(
+ const envoy_type_matcher_v3_RegexMatcher* regex_matcher) {
+ return Json::Object(
+ {{"regex", UpbStringToStdString(envoy_type_matcher_v3_RegexMatcher_regex(
+ regex_matcher))}});
+}
+
+Json ParseInt64RangeToJson(const envoy_type_v3_Int64Range* range) {
+ return Json::Object{{"start", envoy_type_v3_Int64Range_start(range)},
+ {"end", envoy_type_v3_Int64Range_end(range)}};
+}
+
+absl::StatusOr<Json> ParseHeaderMatcherToJson(
+ const envoy_config_route_v3_HeaderMatcher* header) {
+ Json::Object header_json;
+ std::vector<absl::Status> error_list;
+ std::string name =
+ UpbStringToStdString(envoy_config_route_v3_HeaderMatcher_name(header));
+ if (name == ":scheme") {
+ error_list.push_back(
+ absl::InvalidArgumentError("':scheme' not allowed in header"));
+ } else if (absl::StartsWith(name, "grpc-")) {
+ error_list.push_back(
+ absl::InvalidArgumentError("'grpc-' prefixes not allowed in header"));
+ }
+ header_json.emplace("name", std::move(name));
+ if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
+ header_json.emplace(
+ "exactMatch",
+ UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_exact_match(header)));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(header)) {
+ header_json.emplace(
+ "safeRegexMatch",
+ ParseRegexMatcherToJson(
+ envoy_config_route_v3_HeaderMatcher_safe_regex_match(header)));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
+ header_json.emplace(
+ "rangeMatch",
+ ParseInt64RangeToJson(
+ envoy_config_route_v3_HeaderMatcher_range_match(header)));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
+ header_json.emplace(
+ "presentMatch",
+ envoy_config_route_v3_HeaderMatcher_present_match(header));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
+ header_json.emplace(
+ "prefixMatch",
+ UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_prefix_match(header)));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
+ header_json.emplace(
+ "suffixMatch",
+ UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_suffix_match(header)));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
+ header_json.emplace(
+ "containsMatch",
+ UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_contains_match(header)));
+ } else {
+ error_list.push_back(
+ absl::InvalidArgumentError("Invalid route header matcher specified."));
+ }
+ if (!error_list.empty()) {
+ return StatusCreate(absl::StatusCode::kInvalidArgument,
+ "Error parsing HeaderMatcher", DEBUG_LOCATION,
+ std::move(error_list));
+ }
+ header_json.emplace("invertMatch",
+ envoy_config_route_v3_HeaderMatcher_invert_match(header));
+ return header_json;
+}
+
+absl::StatusOr<Json> ParseStringMatcherToJson(
+ const envoy_type_matcher_v3_StringMatcher* matcher) {
+ Json::Object json;
+ if (envoy_type_matcher_v3_StringMatcher_has_exact(matcher)) {
+ json.emplace("exact",
+ UpbStringToStdString(
+ envoy_type_matcher_v3_StringMatcher_exact(matcher)));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(matcher)) {
+ json.emplace("prefix",
+ UpbStringToStdString(
+ envoy_type_matcher_v3_StringMatcher_prefix(matcher)));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(matcher)) {
+ json.emplace("suffix",
+ UpbStringToStdString(
+ envoy_type_matcher_v3_StringMatcher_suffix(matcher)));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(matcher)) {
+ json.emplace("safeRegex",
+ ParseRegexMatcherToJson(
+ envoy_type_matcher_v3_StringMatcher_safe_regex(matcher)));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_contains(matcher)) {
+ json.emplace("contains",
+ UpbStringToStdString(
+ envoy_type_matcher_v3_StringMatcher_contains(matcher)));
+ } else {
+ return absl::InvalidArgumentError("StringMatcher: Invalid match pattern");
+ }
+ json.emplace("ignoreCase",
+ envoy_type_matcher_v3_StringMatcher_ignore_case(matcher));
+ return json;
+}
+
+absl::StatusOr<Json> ParsePathMatcherToJson(
+ const envoy_type_matcher_v3_PathMatcher* matcher) {
+ const auto* path = envoy_type_matcher_v3_PathMatcher_path(matcher);
+ if (path == nullptr) {
+ return absl::InvalidArgumentError("PathMatcher has empty path");
+ }
+ Json::Object json;
+ auto path_json = ParseStringMatcherToJson(path);
+ if (!path_json.ok()) {
+ return path_json;
+ }
+ json.emplace("path", std::move(*path_json));
+ return json;
+}
+
+Json ParseUInt32ValueToJson(const google_protobuf_UInt32Value* value) {
+ return Json::Object{{"value", google_protobuf_UInt32Value_value(value)}};
+}
+
+Json ParseCidrRangeToJson(const envoy_config_core_v3_CidrRange* range) {
+ Json::Object json;
+ json.emplace("addressPrefix",
+ UpbStringToStdString(
+ envoy_config_core_v3_CidrRange_address_prefix(range)));
+ const auto* prefix_len = envoy_config_core_v3_CidrRange_prefix_len(range);
+ if (prefix_len != nullptr) {
+ json.emplace("prefixLen", ParseUInt32ValueToJson(prefix_len));
+ }
+ return json;
+}
+
+Json ParseMetadataMatcherToJson(
+ const envoy_type_matcher_v3_MetadataMatcher* metadata_matcher) {
+ Json::Object json;
+ // The fields "filter", "path" and "value" are irrelevant to gRPC as per
+ // https://github.com/grpc/proposal/blob/master/A41-xds-rbac.md and are not
+ // being parsed.
+ json.emplace("invert",
+ envoy_type_matcher_v3_MetadataMatcher_invert(metadata_matcher));
+ return json;
+}
+
+absl::StatusOr<Json> ParsePermissionToJson(
+ const envoy_config_rbac_v3_Permission* permission) {
+ Json::Object permission_json;
+ // Helper function to parse Permission::Set to JSON. Used by `and_rules` and
+ // `or_rules`.
+ auto parse_permission_set_to_json =
+ [](const envoy_config_rbac_v3_Permission_Set* set)
+ -> absl::StatusOr<Json> {
+ std::vector<absl::Status> error_list;
+ Json::Array rules_json;
+ size_t size;
+ const envoy_config_rbac_v3_Permission* const* rules =
+ envoy_config_rbac_v3_Permission_Set_rules(set, &size);
+ for (size_t i = 0; i < size; ++i) {
+ auto permission_json = ParsePermissionToJson(rules[i]);
+ if (!permission_json.ok()) {
+ error_list.push_back(permission_json.status());
+ } else {
+ rules_json.emplace_back(std::move(*permission_json));
+ }
+ }
+ if (!error_list.empty()) {
+ return StatusCreate(absl::StatusCode::kInvalidArgument,
+ "Error parsing Set", DEBUG_LOCATION,
+ std::move(error_list));
+ }
+ return Json::Object({{"rules", std::move(rules_json)}});
+ };
+ if (envoy_config_rbac_v3_Permission_has_and_rules(permission)) {
+ const auto* and_rules =
+ envoy_config_rbac_v3_Permission_and_rules(permission);
+ auto permission_set_json = parse_permission_set_to_json(and_rules);
+ if (!permission_set_json.ok()) {
+ return permission_set_json;
+ }
+ permission_json.emplace("andRules", std::move(*permission_set_json));
+ } else if (envoy_config_rbac_v3_Permission_has_or_rules(permission)) {
+ const auto* or_rules = envoy_config_rbac_v3_Permission_or_rules(permission);
+ auto permission_set_json = parse_permission_set_to_json(or_rules);
+ if (!permission_set_json.ok()) {
+ return permission_set_json;
+ }
+ permission_json.emplace("orRules", std::move(*permission_set_json));
+ } else if (envoy_config_rbac_v3_Permission_has_any(permission)) {
+ permission_json.emplace("any",
+ envoy_config_rbac_v3_Permission_any(permission));
+ } else if (envoy_config_rbac_v3_Permission_has_header(permission)) {
+ auto header_json = ParseHeaderMatcherToJson(
+ envoy_config_rbac_v3_Permission_header(permission));
+ if (!header_json.ok()) {
+ return header_json;
+ }
+ permission_json.emplace("header", std::move(*header_json));
+ } else if (envoy_config_rbac_v3_Permission_has_url_path(permission)) {
+ auto url_path_json = ParsePathMatcherToJson(
+ envoy_config_rbac_v3_Permission_url_path(permission));
+ if (!url_path_json.ok()) {
+ return url_path_json;
+ }
+ permission_json.emplace("urlPath", std::move(*url_path_json));
+ } else if (envoy_config_rbac_v3_Permission_has_destination_ip(permission)) {
+ permission_json.emplace(
+ "destinationIp",
+ ParseCidrRangeToJson(
+ envoy_config_rbac_v3_Permission_destination_ip(permission)));
+ } else if (envoy_config_rbac_v3_Permission_has_destination_port(permission)) {
+ permission_json.emplace(
+ "destinationPort",
+ envoy_config_rbac_v3_Permission_destination_port(permission));
+ } else if (envoy_config_rbac_v3_Permission_has_metadata(permission)) {
+ permission_json.emplace(
+ "metadata", ParseMetadataMatcherToJson(
+ envoy_config_rbac_v3_Permission_metadata(permission)));
+ } else if (envoy_config_rbac_v3_Permission_has_not_rule(permission)) {
+ auto not_rule_json = ParsePermissionToJson(
+ envoy_config_rbac_v3_Permission_not_rule(permission));
+ if (!not_rule_json.ok()) {
+ return not_rule_json;
+ }
+ permission_json.emplace("notRule", std::move(*not_rule_json));
+ } else if (envoy_config_rbac_v3_Permission_has_requested_server_name(
+ permission)) {
+ auto requested_server_name_json = ParseStringMatcherToJson(
+ envoy_config_rbac_v3_Permission_requested_server_name(permission));
+ if (!requested_server_name_json.ok()) {
+ return requested_server_name_json;
+ }
+ permission_json.emplace("requestedServerName",
+ std::move(*requested_server_name_json));
+ } else {
+ return absl::InvalidArgumentError("Permission: Invalid rule");
+ }
+ return permission_json;
+}
+
+absl::StatusOr<Json> ParsePrincipalToJson(
+ const envoy_config_rbac_v3_Principal* principal) {
+ Json::Object principal_json;
+ // Helper function to parse Principal::Set to JSON. Used by `and_ids` and
+ // `or_ids`.
+ auto parse_principal_set_to_json =
+ [](const envoy_config_rbac_v3_Principal_Set* set)
+ -> absl::StatusOr<Json> {
+ Json::Object json;
+ std::vector<absl::Status> error_list;
+ Json::Array ids_json;
+ size_t size;
+ const envoy_config_rbac_v3_Principal* const* ids =
+ envoy_config_rbac_v3_Principal_Set_ids(set, &size);
+ for (size_t i = 0; i < size; ++i) {
+ auto principal_json = ParsePrincipalToJson(ids[i]);
+ if (!principal_json.ok()) {
+ error_list.push_back(principal_json.status());
+ } else {
+ ids_json.emplace_back(std::move(*principal_json));
+ }
+ }
+ if (!error_list.empty()) {
+ return StatusCreate(absl::StatusCode::kInvalidArgument,
+ "Error parsing Set", DEBUG_LOCATION,
+ std::move(error_list));
+ }
+ return Json::Object({{"ids", std::move(ids_json)}});
+ };
+ if (envoy_config_rbac_v3_Principal_has_and_ids(principal)) {
+ const auto* and_rules = envoy_config_rbac_v3_Principal_and_ids(principal);
+ auto principal_set_json = parse_principal_set_to_json(and_rules);
+ if (!principal_set_json.ok()) {
+ return principal_set_json;
+ }
+ principal_json.emplace("andIds", std::move(*principal_set_json));
+ } else if (envoy_config_rbac_v3_Principal_has_or_ids(principal)) {
+ const auto* or_rules = envoy_config_rbac_v3_Principal_or_ids(principal);
+ auto principal_set_json = parse_principal_set_to_json(or_rules);
+ if (!principal_set_json.ok()) {
+ return principal_set_json;
+ }
+ principal_json.emplace("orIds", std::move(*principal_set_json));
+ } else if (envoy_config_rbac_v3_Principal_has_any(principal)) {
+ principal_json.emplace("any",
+ envoy_config_rbac_v3_Principal_any(principal));
+ } else if (envoy_config_rbac_v3_Principal_has_authenticated(principal)) {
+ auto* authenticated_json =
+ principal_json.emplace("authenticated", Json::Object())
+ .first->second.mutable_object();
+ const auto* principal_name =
+ envoy_config_rbac_v3_Principal_Authenticated_principal_name(
+ envoy_config_rbac_v3_Principal_authenticated(principal));
+ if (principal_name != nullptr) {
+ auto principal_name_json = ParseStringMatcherToJson(principal_name);
+ if (!principal_name_json.ok()) {
+ return principal_name_json;
+ }
+ authenticated_json->emplace("principalName",
+ std::move(*principal_name_json));
+ }
+ } else if (envoy_config_rbac_v3_Principal_has_source_ip(principal)) {
+ principal_json.emplace(
+ "sourceIp", ParseCidrRangeToJson(
+ envoy_config_rbac_v3_Principal_source_ip(principal)));
+ } else if (envoy_config_rbac_v3_Principal_has_direct_remote_ip(principal)) {
+ principal_json.emplace(
+ "directRemoteIp",
+ ParseCidrRangeToJson(
+ envoy_config_rbac_v3_Principal_direct_remote_ip(principal)));
+ } else if (envoy_config_rbac_v3_Principal_has_remote_ip(principal)) {
+ principal_json.emplace(
+ "remoteIp", ParseCidrRangeToJson(
+ envoy_config_rbac_v3_Principal_remote_ip(principal)));
+ } else if (envoy_config_rbac_v3_Principal_has_header(principal)) {
+ auto header_json = ParseHeaderMatcherToJson(
+ envoy_config_rbac_v3_Principal_header(principal));
+ if (!header_json.ok()) {
+ return header_json;
+ }
+ principal_json.emplace("header", std::move(*header_json));
+ } else if (envoy_config_rbac_v3_Principal_has_url_path(principal)) {
+ auto url_path_json = ParsePathMatcherToJson(
+ envoy_config_rbac_v3_Principal_url_path(principal));
+ if (!url_path_json.ok()) {
+ return url_path_json;
+ }
+ principal_json.emplace("urlPath", std::move(*url_path_json));
+ } else if (envoy_config_rbac_v3_Principal_has_metadata(principal)) {
+ principal_json.emplace(
+ "metadata", ParseMetadataMatcherToJson(
+ envoy_config_rbac_v3_Principal_metadata(principal)));
+ } else if (envoy_config_rbac_v3_Principal_has_not_id(principal)) {
+ auto not_id_json =
+ ParsePrincipalToJson(envoy_config_rbac_v3_Principal_not_id(principal));
+ if (!not_id_json.ok()) {
+ return not_id_json;
+ }
+ principal_json.emplace("notId", std::move(*not_id_json));
+ } else {
+ return absl::InvalidArgumentError("Principal: Invalid rule");
+ }
+ return principal_json;
+}
+
+absl::StatusOr<Json> ParsePolicyToJson(
+ const envoy_config_rbac_v3_Policy* policy) {
+ Json::Object policy_json;
+ std::vector<absl::Status> error_list;
+ size_t size;
+ Json::Array permissions_json;
+ const envoy_config_rbac_v3_Permission* const* permissions =
+ envoy_config_rbac_v3_Policy_permissions(policy, &size);
+ for (size_t i = 0; i < size; ++i) {
+ auto permission_json = ParsePermissionToJson(permissions[i]);
+ if (!permission_json.ok()) {
+ error_list.push_back(permission_json.status());
+ } else {
+ permissions_json.emplace_back(std::move(*permission_json));
+ }
+ }
+ policy_json.emplace("permissions", std::move(permissions_json));
+ Json::Array principals_json;
+ const envoy_config_rbac_v3_Principal* const* principals =
+ envoy_config_rbac_v3_Policy_principals(policy, &size);
+ for (size_t i = 0; i < size; ++i) {
+ auto principal_json = ParsePrincipalToJson(principals[i]);
+ if (!principal_json.ok()) {
+ error_list.push_back(principal_json.status());
+ } else {
+ principals_json.emplace_back(std::move(*principal_json));
+ }
+ }
+ policy_json.emplace("principals", std::move(principals_json));
+ if (envoy_config_rbac_v3_Policy_has_condition(policy)) {
+ error_list.push_back(
+ absl::InvalidArgumentError("Policy: condition not supported"));
+ }
+ if (envoy_config_rbac_v3_Policy_has_checked_condition(policy)) {
+ error_list.push_back(
+ absl::InvalidArgumentError("Policy: checked condition not supported"));
+ }
+ if (!error_list.empty()) {
+ return StatusCreate(absl::StatusCode::kInvalidArgument,
+ "Error parsing Policy", DEBUG_LOCATION,
+ std::move(error_list));
+ }
+ return policy_json;
+}
+
+absl::StatusOr<Json> ParseHttpRbacToJson(
+ const envoy_extensions_filters_http_rbac_v3_RBAC* rbac) {
+ Json::Object rbac_json;
+ std::vector<absl::Status> error_list;
+ const auto* rules = envoy_extensions_filters_http_rbac_v3_RBAC_rules(rbac);
+ if (rules != nullptr) {
+ int action = envoy_config_rbac_v3_RBAC_action(rules);
+ // Treat Log action as RBAC being absent
+ if (action == envoy_config_rbac_v3_RBAC_LOG) {
+ return rbac_json;
+ }
+ Json::Object inner_rbac_json;
+ inner_rbac_json.emplace("action", envoy_config_rbac_v3_RBAC_action(rules));
+ if (envoy_config_rbac_v3_RBAC_has_policies(rules)) {
+ Json::Object policies_object;
+ size_t iter = kUpb_Map_Begin;
+ while (true) {
+ auto* entry = envoy_config_rbac_v3_RBAC_policies_next(rules, &iter);
+ if (entry == nullptr) {
+ break;
+ }
+ auto policy = ParsePolicyToJson(
+ envoy_config_rbac_v3_RBAC_PoliciesEntry_value(entry));
+ if (!policy.ok()) {
+ error_list.push_back(StatusCreate(
+ absl::StatusCode::kInvalidArgument,
+ absl::StrFormat(
+ "RBAC PoliciesEntry key:%s",
+ UpbStringToStdString(
+ envoy_config_rbac_v3_RBAC_PoliciesEntry_key(entry))),
+ DEBUG_LOCATION, {policy.status()}));
+ } else {
+ policies_object.emplace(
+ UpbStringToStdString(
+ envoy_config_rbac_v3_RBAC_PoliciesEntry_key(entry)),
+ std::move(*policy));
+ }
+ }
+ inner_rbac_json.emplace("policies", std::move(policies_object));
+ }
+ rbac_json.emplace("rules", std::move(inner_rbac_json));
+ }
+ if (!error_list.empty()) {
+ return StatusCreate(absl::StatusCode::kInvalidArgument,
+ "Error parsing RBAC", DEBUG_LOCATION,
+ std::move(error_list));
+ }
+ return rbac_json;
+}
+
+} // namespace
+
+void XdsHttpRbacFilter::PopulateSymtab(upb_DefPool* symtab) const {
+ envoy_extensions_filters_http_rbac_v3_RBAC_getmsgdef(symtab);
+}
+
+absl::StatusOr<XdsHttpFilterImpl::FilterConfig>
+XdsHttpRbacFilter::GenerateFilterConfig(upb_StringView serialized_filter_config,
+ upb_Arena* arena) const {
+ absl::StatusOr<Json> rbac_json;
+ auto* rbac = envoy_extensions_filters_http_rbac_v3_RBAC_parse(
+ serialized_filter_config.data, serialized_filter_config.size, arena);
+ if (rbac == nullptr) {
+ return absl::InvalidArgumentError(
+ "could not parse HTTP RBAC filter config");
+ }
+ rbac_json = ParseHttpRbacToJson(rbac);
+ if (!rbac_json.ok()) {
+ return rbac_json.status();
+ }
+ return FilterConfig{kXdsHttpRbacFilterConfigName, std::move(*rbac_json)};
+}
+
+absl::StatusOr<XdsHttpFilterImpl::FilterConfig>
+XdsHttpRbacFilter::GenerateFilterConfigOverride(
+ upb_StringView serialized_filter_config, upb_Arena* arena) const {
+ auto* rbac_per_route =
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute_parse(
+ serialized_filter_config.data, serialized_filter_config.size, arena);
+ if (rbac_per_route == nullptr) {
+ return absl::InvalidArgumentError("could not parse RBACPerRoute");
+ }
+ absl::StatusOr<Json> rbac_json;
+ const auto* rbac =
+ envoy_extensions_filters_http_rbac_v3_RBACPerRoute_rbac(rbac_per_route);
+ if (rbac == nullptr) {
+ rbac_json = Json::Object();
+ } else {
+ rbac_json = ParseHttpRbacToJson(rbac);
+ if (!rbac_json.ok()) {
+ return rbac_json.status();
+ }
+ }
+ return FilterConfig{kXdsHttpRbacFilterConfigOverrideName,
+ std::move(*rbac_json)};
+}
+
+const grpc_channel_filter* XdsHttpRbacFilter::channel_filter() const {
+ return &RbacFilter::kFilterVtable;
+}
+
+grpc_channel_args* XdsHttpRbacFilter::ModifyChannelArgs(
+ grpc_channel_args* args) const {
+ grpc_arg arg_to_add = grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_PARSE_RBAC_METHOD_CONFIG), 1);
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
+ grpc_channel_args_destroy(args);
+ return new_args;
+}
+
+absl::StatusOr<XdsHttpFilterImpl::ServiceConfigJsonEntry>
+XdsHttpRbacFilter::GenerateServiceConfig(
+ const FilterConfig& hcm_filter_config,
+ const FilterConfig* filter_config_override) const {
+ Json policy_json = filter_config_override != nullptr
+ ? filter_config_override->config
+ : hcm_filter_config.config;
+ // The policy JSON may be empty, that's allowed.
+ return ServiceConfigJsonEntry{"rbacPolicy", policy_json.Dump()};
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_http_rbac_filter.h b/grpc/src/core/ext/xds/xds_http_rbac_filter.h
new file mode 100644
index 00000000..785cd5db
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_http_rbac_filter.h
@@ -0,0 +1,54 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_HTTP_RBAC_FILTER_H
+#define GRPC_CORE_EXT_XDS_XDS_HTTP_RBAC_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/xds_http_filters.h"
+
+namespace grpc_core {
+
+extern const char* kXdsHttpRbacFilterConfigName;
+extern const char* kXdsHttpRbacFilterConfigOverrideName;
+
+class XdsHttpRbacFilter : public XdsHttpFilterImpl {
+ public:
+ void PopulateSymtab(upb_DefPool* symtab) const override;
+
+ absl::StatusOr<FilterConfig> GenerateFilterConfig(
+ upb_StringView serialized_filter_config, upb_Arena* arena) const override;
+
+ absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
+ upb_StringView serialized_filter_config, upb_Arena* arena) const override;
+
+ const grpc_channel_filter* channel_filter() const override;
+
+ grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) const override;
+
+ absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
+ const FilterConfig& hcm_filter_config,
+ const FilterConfig* filter_config_override) const override;
+
+ bool IsSupportedOnClients() const override { return false; }
+
+ bool IsSupportedOnServers() const override { return true; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_HTTP_RBAC_FILTER_H
diff --git a/grpc/src/core/ext/xds/xds_listener.cc b/grpc/src/core/ext/xds/xds_listener.cc
new file mode 100644
index 00000000..14847e31
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_listener.cc
@@ -0,0 +1,1039 @@
+//
+// 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_listener.h"
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
+#include "absl/strings/str_join.h"
+#include "absl/strings/str_split.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/protocol.upb.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
+#include "envoy/config/listener/v3/listener.upb.h"
+#include "envoy/config/listener/v3/listener.upbdefs.h"
+#include "envoy/config/listener/v3/listener_components.upb.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "upb/text_encode.h"
+#include "upb/upb.h"
+#include "upb/upb.hpp"
+
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+
+namespace grpc_core {
+
+//
+// XdsListenerResource::DownstreamTlsContext
+//
+
+std::string XdsListenerResource::DownstreamTlsContext::ToString() const {
+ return absl::StrFormat("common_tls_context=%s, require_client_certificate=%s",
+ common_tls_context.ToString(),
+ require_client_certificate ? "true" : "false");
+}
+
+bool XdsListenerResource::DownstreamTlsContext::Empty() const {
+ return common_tls_context.Empty();
+}
+
+//
+// XdsListenerResource::HttpConnectionManager
+//
+
+std::string XdsListenerResource::HttpConnectionManager::ToString() const {
+ absl::InlinedVector<std::string, 4> contents;
+ contents.push_back(absl::StrFormat(
+ "route_config_name=%s",
+ !route_config_name.empty() ? route_config_name.c_str() : "<inlined>"));
+ contents.push_back(absl::StrFormat("http_max_stream_duration=%s",
+ http_max_stream_duration.ToString()));
+ if (rds_update.has_value()) {
+ contents.push_back(
+ absl::StrFormat("rds_update=%s", rds_update->ToString()));
+ }
+ if (!http_filters.empty()) {
+ std::vector<std::string> filter_strings;
+ for (const auto& http_filter : http_filters) {
+ filter_strings.push_back(http_filter.ToString());
+ }
+ contents.push_back(absl::StrCat("http_filters=[",
+ absl::StrJoin(filter_strings, ", "), "]"));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsListenerResource::HttpFilter
+//
+
+std::string XdsListenerResource::HttpConnectionManager::HttpFilter::ToString()
+ const {
+ return absl::StrCat("{name=", name, ", config=", config.ToString(), "}");
+}
+
+//
+// XdsListenerResource::FilterChainData
+//
+
+std::string XdsListenerResource::FilterChainData::ToString() const {
+ return absl::StrCat(
+ "{downstream_tls_context=", downstream_tls_context.ToString(),
+ " http_connection_manager=", http_connection_manager.ToString(), "}");
+}
+
+//
+// XdsListenerResource::FilterChainMap::CidrRange
+//
+
+std::string XdsListenerResource::FilterChainMap::CidrRange::ToString() const {
+ return absl::StrCat(
+ "{address_prefix=", grpc_sockaddr_to_string(&address, false),
+ ", prefix_len=", prefix_len, "}");
+}
+
+//
+// FilterChain
+//
+
+struct FilterChain {
+ struct FilterChainMatch {
+ uint32_t destination_port = 0;
+ std::vector<XdsListenerResource::FilterChainMap::CidrRange> prefix_ranges;
+ XdsListenerResource::FilterChainMap::ConnectionSourceType source_type =
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::kAny;
+ std::vector<XdsListenerResource::FilterChainMap::CidrRange>
+ source_prefix_ranges;
+ std::vector<uint32_t> source_ports;
+ std::vector<std::string> server_names;
+ std::string transport_protocol;
+ std::vector<std::string> application_protocols;
+
+ std::string ToString() const;
+ } filter_chain_match;
+
+ std::shared_ptr<XdsListenerResource::FilterChainData> filter_chain_data;
+};
+
+std::string FilterChain::FilterChainMatch::ToString() const {
+ absl::InlinedVector<std::string, 8> contents;
+ if (destination_port != 0) {
+ contents.push_back(absl::StrCat("destination_port=", destination_port));
+ }
+ if (!prefix_ranges.empty()) {
+ std::vector<std::string> prefix_ranges_content;
+ for (const auto& range : prefix_ranges) {
+ prefix_ranges_content.push_back(range.ToString());
+ }
+ contents.push_back(absl::StrCat(
+ "prefix_ranges={", absl::StrJoin(prefix_ranges_content, ", "), "}"));
+ }
+ if (source_type == XdsListenerResource::FilterChainMap::ConnectionSourceType::
+ kSameIpOrLoopback) {
+ contents.push_back("source_type=SAME_IP_OR_LOOPBACK");
+ } else if (source_type == XdsListenerResource::FilterChainMap::
+ ConnectionSourceType::kExternal) {
+ contents.push_back("source_type=EXTERNAL");
+ }
+ if (!source_prefix_ranges.empty()) {
+ std::vector<std::string> source_prefix_ranges_content;
+ for (const auto& range : source_prefix_ranges) {
+ source_prefix_ranges_content.push_back(range.ToString());
+ }
+ contents.push_back(
+ absl::StrCat("source_prefix_ranges={",
+ absl::StrJoin(source_prefix_ranges_content, ", "), "}"));
+ }
+ if (!source_ports.empty()) {
+ contents.push_back(
+ absl::StrCat("source_ports={", absl::StrJoin(source_ports, ", "), "}"));
+ }
+ if (!server_names.empty()) {
+ contents.push_back(
+ absl::StrCat("server_names={", absl::StrJoin(server_names, ", "), "}"));
+ }
+ if (!transport_protocol.empty()) {
+ contents.push_back(absl::StrCat("transport_protocol=", transport_protocol));
+ }
+ if (!application_protocols.empty()) {
+ contents.push_back(absl::StrCat("application_protocols={",
+ absl::StrJoin(application_protocols, ", "),
+ "}"));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsListenerResource::FilterChainMap
+//
+
+std::string XdsListenerResource::FilterChainMap::ToString() const {
+ std::vector<std::string> contents;
+ for (const auto& destination_ip : destination_ip_vector) {
+ for (int source_type = 0; source_type < 3; ++source_type) {
+ for (const auto& source_ip :
+ destination_ip.source_types_array[source_type]) {
+ for (const auto& source_port_pair : source_ip.ports_map) {
+ FilterChain::FilterChainMatch filter_chain_match;
+ if (destination_ip.prefix_range.has_value()) {
+ filter_chain_match.prefix_ranges.push_back(
+ *destination_ip.prefix_range);
+ }
+ filter_chain_match.source_type = static_cast<
+ XdsListenerResource::FilterChainMap::ConnectionSourceType>(
+ source_type);
+ if (source_ip.prefix_range.has_value()) {
+ filter_chain_match.source_prefix_ranges.push_back(
+ *source_ip.prefix_range);
+ }
+ if (source_port_pair.first != 0) {
+ filter_chain_match.source_ports.push_back(source_port_pair.first);
+ }
+ contents.push_back(absl::StrCat(
+ "{filter_chain_match=", filter_chain_match.ToString(),
+ ", filter_chain=", source_port_pair.second.data->ToString(),
+ "}"));
+ }
+ }
+ }
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsListenerResource
+//
+
+std::string XdsListenerResource::ToString() const {
+ absl::InlinedVector<std::string, 4> contents;
+ if (type == ListenerType::kTcpListener) {
+ contents.push_back(absl::StrCat("address=", address));
+ contents.push_back(
+ absl::StrCat("filter_chain_map=", filter_chain_map.ToString()));
+ if (default_filter_chain.has_value()) {
+ contents.push_back(absl::StrCat("default_filter_chain=",
+ default_filter_chain->ToString()));
+ }
+ } else if (type == ListenerType::kHttpApiListener) {
+ contents.push_back(absl::StrFormat("http_connection_manager=%s",
+ http_connection_manager.ToString()));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsListenerResourceType
+//
+
+namespace {
+
+void MaybeLogHttpConnectionManager(
+ const XdsEncodingContext& context,
+ const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
+ http_connection_manager_config) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_MessageDef* msg_type =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(
+ context.symtab);
+ char buf[10240];
+ upb_TextEncode(http_connection_manager_config, msg_type, nullptr, 0, buf,
+ sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] HttpConnectionManager: %s",
+ context.client, buf);
+ }
+}
+
+grpc_error_handle HttpConnectionManagerParse(
+ bool is_client, const XdsEncodingContext& context,
+ const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
+ http_connection_manager_proto,
+ bool is_v2,
+ XdsListenerResource::HttpConnectionManager* http_connection_manager) {
+ MaybeLogHttpConnectionManager(context, http_connection_manager_proto);
+ // NACK a non-zero `xff_num_trusted_hops` and a `non-empty
+ // original_ip_detection_extensions` as mentioned in
+ // https://github.com/grpc/proposal/blob/master/A41-xds-rbac.md
+ if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(
+ http_connection_manager_proto) != 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "'xff_num_trusted_hops' must be zero");
+ }
+ if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_original_ip_detection_extensions(
+ http_connection_manager_proto)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "'original_ip_detection_extensions' must be empty");
+ }
+ // Obtain max_stream_duration from Http Protocol Options.
+ const envoy_config_core_v3_HttpProtocolOptions* options =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(
+ http_connection_manager_proto);
+ if (options != nullptr) {
+ const google_protobuf_Duration* duration =
+ envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(options);
+ if (duration != nullptr) {
+ http_connection_manager->http_max_stream_duration =
+ ParseDuration(duration);
+ }
+ }
+ // Parse filters.
+ if (!is_v2) {
+ size_t num_filters = 0;
+ const auto* http_filters =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(
+ http_connection_manager_proto, &num_filters);
+ std::set<absl::string_view> names_seen;
+ for (size_t i = 0; i < num_filters; ++i) {
+ const auto* http_filter = http_filters[i];
+ absl::string_view name = UpbStringToAbsl(
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(
+ http_filter));
+ if (name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("empty filter name at index ", i));
+ }
+ if (names_seen.find(name) != names_seen.end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("duplicate HTTP filter name: ", name));
+ }
+ names_seen.insert(name);
+ const bool is_optional =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(
+ http_filter);
+ const google_protobuf_Any* any =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(
+ http_filter);
+ if (any == nullptr) {
+ if (is_optional) continue;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("no filter config specified for filter name ", name));
+ }
+ absl::string_view filter_type;
+ grpc_error_handle error =
+ ExtractExtensionTypeName(context, any, &filter_type);
+ if (error != GRPC_ERROR_NONE) return error;
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(filter_type);
+ if (filter_impl == nullptr) {
+ if (is_optional) continue;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("no filter registered for config type ", filter_type));
+ }
+ if ((is_client && !filter_impl->IsSupportedOnClients()) ||
+ (!is_client && !filter_impl->IsSupportedOnServers())) {
+ if (is_optional) continue;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("Filter %s is not supported on %s", filter_type,
+ is_client ? "clients" : "servers"));
+ }
+ absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
+ filter_impl->GenerateFilterConfig(google_protobuf_Any_value(any),
+ context.arena);
+ if (!filter_config.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "filter config for type ", filter_type,
+ " failed to parse: ", StatusToString(filter_config.status())));
+ }
+ http_connection_manager->http_filters.emplace_back(
+ XdsListenerResource::HttpConnectionManager::HttpFilter{
+ std::string(name), std::move(*filter_config)});
+ }
+ if (http_connection_manager->http_filters.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Expected at least one HTTP filter");
+ }
+ // Make sure that the last filter is terminal and non-last filters are
+ // non-terminal. Note that this check is being performed in a separate loop
+ // to take care of the case where there are two terminal filters in the list
+ // out of which only one gets added in the final list.
+ for (const auto& http_filter : http_connection_manager->http_filters) {
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ http_filter.config.config_proto_type_name);
+ if (&http_filter != &http_connection_manager->http_filters.back()) {
+ // Filters before the last filter must not be terminal.
+ if (filter_impl->IsTerminalFilter()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("terminal filter for config type ",
+ http_filter.config.config_proto_type_name,
+ " must be the last filter in the chain"));
+ }
+ } else {
+ // The last filter must be terminal.
+ if (!filter_impl->IsTerminalFilter()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("non-terminal filter for config type ",
+ http_filter.config.config_proto_type_name,
+ " is the last filter in the chain"));
+ }
+ }
+ }
+ } else {
+ // If using a v2 config, we just hard-code a list containing only the
+ // router filter without actually looking at the config. This ensures
+ // that the right thing happens in the xds resolver without having
+ // to expose whether the resource we received was v2 or v3.
+ http_connection_manager->http_filters.emplace_back(
+ XdsListenerResource::HttpConnectionManager::HttpFilter{
+ "router", {kXdsHttpRouterFilterConfigName, Json()}});
+ }
+ // Guarding parsing of RouteConfig on the server side with the environmental
+ // variable since that's the first feature on the server side that will be
+ // using this.
+ if (is_client || XdsRbacEnabled()) {
+ // 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_proto)) {
+ const envoy_config_route_v3_RouteConfiguration* route_config =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
+ http_connection_manager_proto);
+ XdsRouteConfigResource rds_update;
+ grpc_error_handle error =
+ XdsRouteConfigResource::Parse(context, route_config, &rds_update);
+ if (error != GRPC_ERROR_NONE) return error;
+ http_connection_manager->rds_update = std::move(rds_update);
+ return GRPC_ERROR_NONE;
+ }
+ // Validate that RDS must be used to get the route_config dynamically.
+ const envoy_extensions_filters_network_http_connection_manager_v3_Rds* rds =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(
+ http_connection_manager_proto);
+ if (rds == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HttpConnectionManager neither has inlined route_config nor RDS.");
+ }
+ // 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) &&
+ !envoy_config_core_v3_ConfigSource_has_self(config_source)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HttpConnectionManager ConfigSource for RDS does not specify ADS "
+ "or SELF.");
+ }
+ // Get the route_config_name.
+ http_connection_manager->route_config_name = UpbStringToStdString(
+ envoy_extensions_filters_network_http_connection_manager_v3_Rds_route_config_name(
+ rds));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle LdsResourceParseClient(
+ const XdsEncodingContext& context,
+ const envoy_config_listener_v3_ApiListener* api_listener, bool is_v2,
+ XdsListenerResource* lds_update) {
+ lds_update->type = XdsListenerResource::ListenerType::kHttpApiListener;
+ const upb_StringView encoded_api_listener = google_protobuf_Any_value(
+ envoy_config_listener_v3_ApiListener_api_listener(api_listener));
+ const auto* http_connection_manager =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
+ encoded_api_listener.data, encoded_api_listener.size, context.arena);
+ if (http_connection_manager == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not parse HttpConnectionManager config from ApiListener");
+ }
+ return HttpConnectionManagerParse(true /* is_client */, context,
+ http_connection_manager, is_v2,
+ &lds_update->http_connection_manager);
+}
+
+grpc_error_handle DownstreamTlsContextParse(
+ const XdsEncodingContext& context,
+ const envoy_config_core_v3_TransportSocket* transport_socket,
+ XdsListenerResource::DownstreamTlsContext* downstream_tls_context) {
+ absl::string_view name = UpbStringToAbsl(
+ envoy_config_core_v3_TransportSocket_name(transport_socket));
+ if (name != "envoy.transport_sockets.tls") {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unrecognized transport socket: ", name));
+ }
+ auto* typed_config =
+ envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
+ std::vector<grpc_error_handle> errors;
+ if (typed_config != nullptr) {
+ const upb_StringView encoded_downstream_tls_context =
+ google_protobuf_Any_value(typed_config);
+ auto* downstream_tls_context_proto =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(
+ encoded_downstream_tls_context.data,
+ encoded_downstream_tls_context.size, context.arena);
+ if (downstream_tls_context_proto == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't decode downstream tls context.");
+ }
+ auto* common_tls_context =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
+ downstream_tls_context_proto);
+ if (common_tls_context != nullptr) {
+ grpc_error_handle error =
+ CommonTlsContext::Parse(context, common_tls_context,
+ &downstream_tls_context->common_tls_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ auto* require_client_certificate =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(
+ downstream_tls_context_proto);
+ if (require_client_certificate != nullptr) {
+ downstream_tls_context->require_client_certificate =
+ google_protobuf_BoolValue_value(require_client_certificate);
+ }
+ auto* require_sni =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(
+ downstream_tls_context_proto);
+ if (require_sni != nullptr &&
+ google_protobuf_BoolValue_value(require_sni)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("require_sni: unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_ocsp_staple_policy(
+ downstream_tls_context_proto) !=
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ocsp_staple_policy: Only LENIENT_STAPLING supported"));
+ }
+ }
+ if (downstream_tls_context->common_tls_context
+ .tls_certificate_provider_instance.instance_name.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TLS configuration provided but no "
+ "tls_certificate_provider_instance found."));
+ }
+ if (downstream_tls_context->require_client_certificate &&
+ downstream_tls_context->common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.instance_name.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TLS configuration requires client certificates but no certificate "
+ "provider instance specified for validation."));
+ }
+ if (!downstream_tls_context->common_tls_context.certificate_validation_context
+ .match_subject_alt_names.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "match_subject_alt_names not supported on servers"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing DownstreamTlsContext",
+ &errors);
+}
+
+grpc_error_handle CidrRangeParse(
+ const envoy_config_core_v3_CidrRange* cidr_range_proto,
+ XdsListenerResource::FilterChainMap::CidrRange* cidr_range) {
+ std::string address_prefix = UpbStringToStdString(
+ envoy_config_core_v3_CidrRange_address_prefix(cidr_range_proto));
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&cidr_range->address, address_prefix.c_str(), 0);
+ if (error != GRPC_ERROR_NONE) return error;
+ cidr_range->prefix_len = 0;
+ auto* prefix_len_proto =
+ envoy_config_core_v3_CidrRange_prefix_len(cidr_range_proto);
+ if (prefix_len_proto != nullptr) {
+ cidr_range->prefix_len = std::min(
+ google_protobuf_UInt32Value_value(prefix_len_proto),
+ (reinterpret_cast<const grpc_sockaddr*>(cidr_range->address.addr))
+ ->sa_family == GRPC_AF_INET
+ ? uint32_t(32)
+ : uint32_t(128));
+ }
+ // Normalize the network address by masking it with prefix_len
+ grpc_sockaddr_mask_bits(&cidr_range->address, cidr_range->prefix_len);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle FilterChainMatchParse(
+ const envoy_config_listener_v3_FilterChainMatch* filter_chain_match_proto,
+ FilterChain::FilterChainMatch* filter_chain_match) {
+ auto* destination_port =
+ envoy_config_listener_v3_FilterChainMatch_destination_port(
+ filter_chain_match_proto);
+ if (destination_port != nullptr) {
+ filter_chain_match->destination_port =
+ google_protobuf_UInt32Value_value(destination_port);
+ }
+ size_t size = 0;
+ auto* prefix_ranges = envoy_config_listener_v3_FilterChainMatch_prefix_ranges(
+ filter_chain_match_proto, &size);
+ filter_chain_match->prefix_ranges.reserve(size);
+ for (size_t i = 0; i < size; i++) {
+ XdsListenerResource::FilterChainMap::CidrRange cidr_range;
+ grpc_error_handle error = CidrRangeParse(prefix_ranges[i], &cidr_range);
+ if (error != GRPC_ERROR_NONE) return error;
+ filter_chain_match->prefix_ranges.push_back(cidr_range);
+ }
+ filter_chain_match->source_type =
+ static_cast<XdsListenerResource::FilterChainMap::ConnectionSourceType>(
+ envoy_config_listener_v3_FilterChainMatch_source_type(
+ filter_chain_match_proto));
+ auto* source_prefix_ranges =
+ envoy_config_listener_v3_FilterChainMatch_source_prefix_ranges(
+ filter_chain_match_proto, &size);
+ filter_chain_match->source_prefix_ranges.reserve(size);
+ for (size_t i = 0; i < size; i++) {
+ XdsListenerResource::FilterChainMap::CidrRange cidr_range;
+ grpc_error_handle error =
+ CidrRangeParse(source_prefix_ranges[i], &cidr_range);
+ if (error != GRPC_ERROR_NONE) return error;
+ filter_chain_match->source_prefix_ranges.push_back(cidr_range);
+ }
+ auto* source_ports = envoy_config_listener_v3_FilterChainMatch_source_ports(
+ filter_chain_match_proto, &size);
+ filter_chain_match->source_ports.reserve(size);
+ for (size_t i = 0; i < size; i++) {
+ filter_chain_match->source_ports.push_back(source_ports[i]);
+ }
+ auto* server_names = envoy_config_listener_v3_FilterChainMatch_server_names(
+ filter_chain_match_proto, &size);
+ for (size_t i = 0; i < size; i++) {
+ filter_chain_match->server_names.push_back(
+ UpbStringToStdString(server_names[i]));
+ }
+ filter_chain_match->transport_protocol = UpbStringToStdString(
+ envoy_config_listener_v3_FilterChainMatch_transport_protocol(
+ filter_chain_match_proto));
+ auto* application_protocols =
+ envoy_config_listener_v3_FilterChainMatch_application_protocols(
+ filter_chain_match_proto, &size);
+ for (size_t i = 0; i < size; i++) {
+ filter_chain_match->application_protocols.push_back(
+ UpbStringToStdString(application_protocols[i]));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle FilterChainParse(
+ const XdsEncodingContext& context,
+ const envoy_config_listener_v3_FilterChain* filter_chain_proto, bool is_v2,
+ FilterChain* filter_chain) {
+ std::vector<grpc_error_handle> errors;
+ auto* filter_chain_match =
+ envoy_config_listener_v3_FilterChain_filter_chain_match(
+ filter_chain_proto);
+ if (filter_chain_match != nullptr) {
+ grpc_error_handle error = FilterChainMatchParse(
+ filter_chain_match, &filter_chain->filter_chain_match);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ filter_chain->filter_chain_data =
+ std::make_shared<XdsListenerResource::FilterChainData>();
+ // Parse the filters list. Currently we only support HttpConnectionManager.
+ size_t size = 0;
+ auto* filters =
+ envoy_config_listener_v3_FilterChain_filters(filter_chain_proto, &size);
+ if (size != 1) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "FilterChain should have exactly one filter: HttpConnectionManager; no "
+ "other filter is supported at the moment"));
+ } else {
+ auto* typed_config =
+ envoy_config_listener_v3_Filter_typed_config(filters[0]);
+ if (typed_config == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No typed_config found in filter."));
+ } else {
+ absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(typed_config));
+ if (type_url !=
+ "type.googleapis.com/"
+ "envoy.extensions.filters.network.http_connection_manager.v3."
+ "HttpConnectionManager") {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unsupported filter type ", type_url)));
+ } else {
+ const upb_StringView encoded_http_connection_manager =
+ google_protobuf_Any_value(typed_config);
+ const auto* http_connection_manager =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
+ encoded_http_connection_manager.data,
+ encoded_http_connection_manager.size, context.arena);
+ if (http_connection_manager == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not parse HttpConnectionManager config from filter "
+ "typed_config"));
+ } else {
+ grpc_error_handle error = HttpConnectionManagerParse(
+ false /* is_client */, context, http_connection_manager, is_v2,
+ &filter_chain->filter_chain_data->http_connection_manager);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ }
+ }
+ }
+ auto* transport_socket =
+ envoy_config_listener_v3_FilterChain_transport_socket(filter_chain_proto);
+ if (transport_socket != nullptr) {
+ grpc_error_handle error = DownstreamTlsContextParse(
+ context, transport_socket,
+ &filter_chain->filter_chain_data->downstream_tls_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing FilterChain", &errors);
+}
+
+grpc_error_handle AddressParse(
+ const envoy_config_core_v3_Address* address_proto, std::string* address) {
+ const auto* socket_address =
+ envoy_config_core_v3_Address_socket_address(address_proto);
+ if (socket_address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Address does not have socket_address");
+ }
+ if (envoy_config_core_v3_SocketAddress_protocol(socket_address) !=
+ envoy_config_core_v3_SocketAddress_TCP) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "SocketAddress protocol is not TCP");
+ }
+ uint32_t port = envoy_config_core_v3_SocketAddress_port_value(socket_address);
+ if (port > 65535) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port");
+ }
+ *address = JoinHostPort(
+ UpbStringToAbsl(
+ envoy_config_core_v3_SocketAddress_address(socket_address)),
+ port);
+ return GRPC_ERROR_NONE;
+}
+
+// An intermediate map for filter chains that we create to validate the list of
+// filter chains received from the control plane and to finally create
+// XdsListenerResource::FilterChainMap
+struct InternalFilterChainMap {
+ using SourceIpMap =
+ std::map<std::string, XdsListenerResource::FilterChainMap::SourceIp>;
+ using ConnectionSourceTypesArray = std::array<SourceIpMap, 3>;
+ struct DestinationIp {
+ absl::optional<XdsListenerResource::FilterChainMap::CidrRange> prefix_range;
+ bool transport_protocol_raw_buffer_provided = false;
+ ConnectionSourceTypesArray source_types_array;
+ };
+ using DestinationIpMap = std::map<std::string, DestinationIp>;
+ DestinationIpMap destination_ip_map;
+};
+
+grpc_error_handle AddFilterChainDataForSourcePort(
+ const FilterChain& filter_chain,
+ XdsListenerResource::FilterChainMap::SourcePortsMap* ports_map,
+ uint32_t port) {
+ auto insert_result = ports_map->emplace(
+ port, XdsListenerResource::FilterChainMap::FilterChainDataSharedPtr{
+ filter_chain.filter_chain_data});
+ if (!insert_result.second) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Duplicate matching rules detected when adding filter chain: ",
+ filter_chain.filter_chain_match.ToString()));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle AddFilterChainDataForSourcePorts(
+ const FilterChain& filter_chain,
+ XdsListenerResource::FilterChainMap::SourcePortsMap* ports_map) {
+ if (filter_chain.filter_chain_match.source_ports.empty()) {
+ return AddFilterChainDataForSourcePort(filter_chain, ports_map, 0);
+ } else {
+ for (uint32_t port : filter_chain.filter_chain_match.source_ports) {
+ grpc_error_handle error =
+ AddFilterChainDataForSourcePort(filter_chain, ports_map, port);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle AddFilterChainDataForSourceIpRange(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::SourceIpMap* source_ip_map) {
+ if (filter_chain.filter_chain_match.source_prefix_ranges.empty()) {
+ auto insert_result = source_ip_map->emplace(
+ "", XdsListenerResource::FilterChainMap::SourceIp());
+ return AddFilterChainDataForSourcePorts(
+ filter_chain, &insert_result.first->second.ports_map);
+ } else {
+ for (const auto& prefix_range :
+ filter_chain.filter_chain_match.source_prefix_ranges) {
+ auto insert_result = source_ip_map->emplace(
+ absl::StrCat(grpc_sockaddr_to_string(&prefix_range.address, false),
+ "/", prefix_range.prefix_len),
+ XdsListenerResource::FilterChainMap::SourceIp());
+ if (insert_result.second) {
+ insert_result.first->second.prefix_range.emplace(prefix_range);
+ }
+ grpc_error_handle error = AddFilterChainDataForSourcePorts(
+ filter_chain, &insert_result.first->second.ports_map);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle AddFilterChainDataForSourceType(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::DestinationIp* destination_ip) {
+ GPR_ASSERT(static_cast<unsigned int>(
+ filter_chain.filter_chain_match.source_type) < 3);
+ return AddFilterChainDataForSourceIpRange(
+ filter_chain, &destination_ip->source_types_array[static_cast<int>(
+ filter_chain.filter_chain_match.source_type)]);
+}
+
+grpc_error_handle AddFilterChainDataForApplicationProtocols(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::DestinationIp* destination_ip) {
+ // Only allow filter chains that do not mention application protocols
+ if (!filter_chain.filter_chain_match.application_protocols.empty()) {
+ return GRPC_ERROR_NONE;
+ }
+ return AddFilterChainDataForSourceType(filter_chain, destination_ip);
+}
+
+grpc_error_handle AddFilterChainDataForTransportProtocol(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::DestinationIp* destination_ip) {
+ const std::string& transport_protocol =
+ filter_chain.filter_chain_match.transport_protocol;
+ // Only allow filter chains with no transport protocol or "raw_buffer"
+ if (!transport_protocol.empty() && transport_protocol != "raw_buffer") {
+ return GRPC_ERROR_NONE;
+ }
+ // If for this configuration, we've already seen filter chains that mention
+ // the transport protocol as "raw_buffer", we will never match filter chains
+ // that do not mention it.
+ if (destination_ip->transport_protocol_raw_buffer_provided &&
+ transport_protocol.empty()) {
+ return GRPC_ERROR_NONE;
+ }
+ if (!transport_protocol.empty() &&
+ !destination_ip->transport_protocol_raw_buffer_provided) {
+ destination_ip->transport_protocol_raw_buffer_provided = true;
+ // Clear out the previous entries if any since those entries did not mention
+ // "raw_buffer"
+ destination_ip->source_types_array =
+ InternalFilterChainMap::ConnectionSourceTypesArray();
+ }
+ return AddFilterChainDataForApplicationProtocols(filter_chain,
+ destination_ip);
+}
+
+grpc_error_handle AddFilterChainDataForServerNames(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::DestinationIp* destination_ip) {
+ // Don't continue adding filter chains with server names mentioned
+ if (!filter_chain.filter_chain_match.server_names.empty()) {
+ return GRPC_ERROR_NONE;
+ }
+ return AddFilterChainDataForTransportProtocol(filter_chain, destination_ip);
+}
+
+grpc_error_handle AddFilterChainDataForDestinationIpRange(
+ const FilterChain& filter_chain,
+ InternalFilterChainMap::DestinationIpMap* destination_ip_map) {
+ if (filter_chain.filter_chain_match.prefix_ranges.empty()) {
+ auto insert_result = destination_ip_map->emplace(
+ "", InternalFilterChainMap::DestinationIp());
+ return AddFilterChainDataForServerNames(filter_chain,
+ &insert_result.first->second);
+ } else {
+ for (const auto& prefix_range :
+ filter_chain.filter_chain_match.prefix_ranges) {
+ auto insert_result = destination_ip_map->emplace(
+ absl::StrCat(grpc_sockaddr_to_string(&prefix_range.address, false),
+ "/", prefix_range.prefix_len),
+ InternalFilterChainMap::DestinationIp());
+ if (insert_result.second) {
+ insert_result.first->second.prefix_range.emplace(prefix_range);
+ }
+ grpc_error_handle error = AddFilterChainDataForServerNames(
+ filter_chain, &insert_result.first->second);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+XdsListenerResource::FilterChainMap BuildFromInternalFilterChainMap(
+ InternalFilterChainMap* internal_filter_chain_map) {
+ XdsListenerResource::FilterChainMap filter_chain_map;
+ for (auto& destination_ip_pair :
+ internal_filter_chain_map->destination_ip_map) {
+ XdsListenerResource::FilterChainMap::DestinationIp destination_ip;
+ destination_ip.prefix_range = destination_ip_pair.second.prefix_range;
+ for (int i = 0; i < 3; i++) {
+ auto& source_ip_map = destination_ip_pair.second.source_types_array[i];
+ for (auto& source_ip_pair : source_ip_map) {
+ destination_ip.source_types_array[i].push_back(
+ std::move(source_ip_pair.second));
+ }
+ }
+ filter_chain_map.destination_ip_vector.push_back(std::move(destination_ip));
+ }
+ return filter_chain_map;
+}
+
+grpc_error_handle BuildFilterChainMap(
+ const std::vector<FilterChain>& filter_chains,
+ XdsListenerResource::FilterChainMap* filter_chain_map) {
+ InternalFilterChainMap internal_filter_chain_map;
+ for (const auto& filter_chain : filter_chains) {
+ // Discard filter chain entries that specify destination port
+ if (filter_chain.filter_chain_match.destination_port != 0) continue;
+ grpc_error_handle error = AddFilterChainDataForDestinationIpRange(
+ filter_chain, &internal_filter_chain_map.destination_ip_map);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ *filter_chain_map =
+ BuildFromInternalFilterChainMap(&internal_filter_chain_map);
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle LdsResourceParseServer(
+ const XdsEncodingContext& context,
+ const envoy_config_listener_v3_Listener* listener, bool is_v2,
+ XdsListenerResource* lds_update) {
+ lds_update->type = XdsListenerResource::ListenerType::kTcpListener;
+ grpc_error_handle error =
+ AddressParse(envoy_config_listener_v3_Listener_address(listener),
+ &lds_update->address);
+ if (error != GRPC_ERROR_NONE) return error;
+ const auto* use_original_dst =
+ envoy_config_listener_v3_Listener_use_original_dst(listener);
+ if (use_original_dst != nullptr) {
+ if (google_protobuf_BoolValue_value(use_original_dst)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Field \'use_original_dst\' is not supported.");
+ }
+ }
+ size_t size = 0;
+ auto* filter_chains =
+ envoy_config_listener_v3_Listener_filter_chains(listener, &size);
+ std::vector<FilterChain> parsed_filter_chains;
+ parsed_filter_chains.reserve(size);
+ for (size_t i = 0; i < size; i++) {
+ FilterChain filter_chain;
+ error = FilterChainParse(context, filter_chains[i], is_v2, &filter_chain);
+ if (error != GRPC_ERROR_NONE) return error;
+ parsed_filter_chains.push_back(std::move(filter_chain));
+ }
+ error =
+ BuildFilterChainMap(parsed_filter_chains, &lds_update->filter_chain_map);
+ if (error != GRPC_ERROR_NONE) return error;
+ auto* default_filter_chain =
+ envoy_config_listener_v3_Listener_default_filter_chain(listener);
+ if (default_filter_chain != nullptr) {
+ FilterChain filter_chain;
+ error =
+ FilterChainParse(context, default_filter_chain, is_v2, &filter_chain);
+ if (error != GRPC_ERROR_NONE) return error;
+ if (filter_chain.filter_chain_data != nullptr) {
+ lds_update->default_filter_chain =
+ std::move(*filter_chain.filter_chain_data);
+ }
+ }
+ if (size == 0 && default_filter_chain == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No filter chain provided.");
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle LdsResourceParse(
+ const XdsEncodingContext& context,
+ const envoy_config_listener_v3_Listener* listener, bool is_v2,
+ XdsListenerResource* lds_update) {
+ // Check whether it's a client or server listener.
+ const envoy_config_listener_v3_ApiListener* api_listener =
+ envoy_config_listener_v3_Listener_api_listener(listener);
+ const envoy_config_core_v3_Address* address =
+ envoy_config_listener_v3_Listener_address(listener);
+ if (api_listener != nullptr && address != nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Listener has both address and ApiListener");
+ }
+ if (api_listener == nullptr && address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Listener has neither address nor ApiListener");
+ }
+ // Validate Listener fields.
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (api_listener != nullptr) {
+ error = LdsResourceParseClient(context, api_listener, is_v2, lds_update);
+ } else {
+ error = LdsResourceParseServer(context, listener, is_v2, lds_update);
+ }
+ return error;
+}
+
+void MaybeLogListener(const XdsEncodingContext& context,
+ const envoy_config_listener_v3_Listener* listener) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_MessageDef* msg_type =
+ envoy_config_listener_v3_Listener_getmsgdef(context.symtab);
+ char buf[10240];
+ upb_TextEncode(listener, msg_type, nullptr, 0, buf, sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] Listener: %s", context.client, buf);
+ }
+}
+
+} // namespace
+
+absl::StatusOr<XdsResourceType::DecodeResult> XdsListenerResourceType::Decode(
+ const XdsEncodingContext& context, absl::string_view serialized_resource,
+ bool is_v2) const {
+ // Parse serialized proto.
+ auto* resource = envoy_config_listener_v3_Listener_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return absl::InvalidArgumentError("Can't parse Listener resource.");
+ }
+ MaybeLogListener(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name =
+ UpbStringToStdString(envoy_config_listener_v3_Listener_name(resource));
+ auto listener_data = absl::make_unique<ResourceDataSubclass>();
+ grpc_error_handle error =
+ LdsResourceParse(context, resource, is_v2, &listener_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ std::string error_str = grpc_error_std_string(error);
+ GRPC_ERROR_UNREF(error);
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_ERROR, "[xds_client %p] invalid Listener %s: %s",
+ context.client, result.name.c_str(), error_str.c_str());
+ }
+ result.resource = absl::InvalidArgumentError(error_str);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "[xds_client %p] parsed Listener %s: %s",
+ context.client, result.name.c_str(),
+ listener_data->resource.ToString().c_str());
+ }
+ result.resource = std::move(listener_data);
+ }
+ return std::move(result);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_listener.h b/grpc/src/core/ext/xds/xds_listener.h
new file mode 100644
index 00000000..dd9bb450
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_listener.h
@@ -0,0 +1,220 @@
+//
+// 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_LISTENER_H
+#define GRPC_CORE_EXT_XDS_XDS_LISTENER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <array>
+#include <map>
+#include <string>
+#include <vector>
+
+#include "absl/status/statusor.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "envoy/config/listener/v3/listener.upbdefs.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h"
+
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/ext/xds/xds_resource_type_impl.h"
+#include "src/core/ext/xds/xds_route_config.h"
+
+namespace grpc_core {
+
+// TODO(roth): When we can use absl::variant<>, consider using that
+// here, to enforce the fact that only one of the two fields can be set.
+struct XdsListenerResource {
+ struct DownstreamTlsContext {
+ CommonTlsContext common_tls_context;
+ bool require_client_certificate = false;
+
+ bool operator==(const DownstreamTlsContext& other) const {
+ return common_tls_context == other.common_tls_context &&
+ require_client_certificate == other.require_client_certificate;
+ }
+
+ std::string ToString() const;
+ bool Empty() const;
+ };
+
+ enum class ListenerType {
+ kTcpListener = 0,
+ kHttpApiListener,
+ } type;
+
+ struct HttpConnectionManager {
+ // The name to use in the RDS request.
+ std::string route_config_name;
+ // Storing the Http Connection Manager Common Http Protocol Option
+ // max_stream_duration
+ Duration http_max_stream_duration;
+ // The RouteConfiguration to use for this listener.
+ // Present only if it is inlined in the LDS response.
+ absl::optional<XdsRouteConfigResource> rds_update;
+
+ struct HttpFilter {
+ std::string name;
+ XdsHttpFilterImpl::FilterConfig config;
+
+ bool operator==(const HttpFilter& other) const {
+ return name == other.name && config == other.config;
+ }
+
+ std::string ToString() const;
+ };
+ std::vector<HttpFilter> http_filters;
+
+ bool operator==(const HttpConnectionManager& other) const {
+ return route_config_name == other.route_config_name &&
+ http_max_stream_duration == other.http_max_stream_duration &&
+ rds_update == other.rds_update &&
+ http_filters == other.http_filters;
+ }
+
+ std::string ToString() const;
+ };
+
+ // Populated for type=kHttpApiListener.
+ HttpConnectionManager http_connection_manager;
+
+ // Populated for type=kTcpListener.
+ // host:port listening_address set when type is kTcpListener
+ std::string address;
+
+ struct FilterChainData {
+ DownstreamTlsContext downstream_tls_context;
+ // This is in principle the filter list.
+ // We currently require exactly one filter, which is the HCM.
+ HttpConnectionManager http_connection_manager;
+
+ bool operator==(const FilterChainData& other) const {
+ return downstream_tls_context == other.downstream_tls_context &&
+ http_connection_manager == other.http_connection_manager;
+ }
+
+ std::string ToString() const;
+ };
+
+ // A multi-level map used to determine which filter chain to use for a given
+ // incoming connection. Determining the right filter chain for a given
+ // connection checks the following properties, in order:
+ // - destination port (never matched, so not present in map)
+ // - destination IP address
+ // - server name (never matched, so not present in map)
+ // - transport protocol (allows only "raw_buffer" or unset, prefers the
+ // former, so only one of those two types is present in map)
+ // - application protocol (never matched, so not present in map)
+ // - connection source type (any, local or external)
+ // - source IP address
+ // - source port
+ // https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener_components.proto#config-listener-v3-filterchainmatch
+ // for more details
+ struct FilterChainMap {
+ struct FilterChainDataSharedPtr {
+ std::shared_ptr<FilterChainData> data;
+ bool operator==(const FilterChainDataSharedPtr& other) const {
+ return *data == *other.data;
+ }
+ };
+ struct CidrRange {
+ grpc_resolved_address address;
+ uint32_t prefix_len;
+
+ bool operator==(const CidrRange& other) const {
+ return memcmp(&address, &other.address, sizeof(address)) == 0 &&
+ prefix_len == other.prefix_len;
+ }
+
+ std::string ToString() const;
+ };
+ using SourcePortsMap = std::map<uint16_t, FilterChainDataSharedPtr>;
+ struct SourceIp {
+ absl::optional<CidrRange> prefix_range;
+ SourcePortsMap ports_map;
+
+ bool operator==(const SourceIp& other) const {
+ return prefix_range == other.prefix_range &&
+ ports_map == other.ports_map;
+ }
+ };
+ using SourceIpVector = std::vector<SourceIp>;
+ enum class ConnectionSourceType { kAny = 0, kSameIpOrLoopback, kExternal };
+ using ConnectionSourceTypesArray = std::array<SourceIpVector, 3>;
+ struct DestinationIp {
+ absl::optional<CidrRange> prefix_range;
+ // We always fail match on server name, so those filter chains are not
+ // included here.
+ ConnectionSourceTypesArray source_types_array;
+
+ bool operator==(const DestinationIp& other) const {
+ return prefix_range == other.prefix_range &&
+ source_types_array == other.source_types_array;
+ }
+ };
+ // We always fail match on destination ports map
+ using DestinationIpVector = std::vector<DestinationIp>;
+ DestinationIpVector destination_ip_vector;
+
+ bool operator==(const FilterChainMap& other) const {
+ return destination_ip_vector == other.destination_ip_vector;
+ }
+
+ std::string ToString() const;
+ } filter_chain_map;
+
+ absl::optional<FilterChainData> default_filter_chain;
+
+ bool operator==(const XdsListenerResource& other) const {
+ return http_connection_manager == other.http_connection_manager &&
+ address == other.address &&
+ filter_chain_map == other.filter_chain_map &&
+ default_filter_chain == other.default_filter_chain;
+ }
+
+ std::string ToString() const;
+};
+
+class XdsListenerResourceType
+ : public XdsResourceTypeImpl<XdsListenerResourceType, XdsListenerResource> {
+ public:
+ absl::string_view type_url() const override {
+ return "envoy.config.listener.v3.Listener";
+ }
+ absl::string_view v2_type_url() const override {
+ return "envoy.api.v2.Listener";
+ }
+
+ absl::StatusOr<DecodeResult> Decode(const XdsEncodingContext& context,
+ absl::string_view serialized_resource,
+ bool is_v2) const override;
+
+ bool AllResourcesRequiredInSotW() const override { return true; }
+
+ void InitUpbSymtab(upb_DefPool* symtab) const override {
+ envoy_config_listener_v3_Listener_getmsgdef(symtab);
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef(
+ symtab);
+ XdsHttpFilterRegistry::PopulateSymtab(symtab);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_LISTENER_H
diff --git a/grpc/src/core/ext/xds/xds_resource_type.cc b/grpc/src/core/ext/xds/xds_resource_type.cc
new file mode 100644
index 00000000..5dbb36b3
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_resource_type.cc
@@ -0,0 +1,33 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_resource_type.h"
+
+namespace grpc_core {
+
+bool XdsResourceType::IsType(absl::string_view resource_type,
+ bool* is_v2) const {
+ if (resource_type == type_url()) return true;
+ if (resource_type == v2_type_url()) {
+ if (is_v2 != nullptr) *is_v2 = true;
+ return true;
+ }
+ return false;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_resource_type.h b/grpc/src/core/ext/xds/xds_resource_type.h
new file mode 100644
index 00000000..ddaf56d4
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_resource_type.h
@@ -0,0 +1,98 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <memory>
+#include <string>
+
+#include "absl/status/statusor.h"
+#include "absl/strings/string_view.h"
+
+#include "src/core/ext/xds/upb_utils.h"
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_H
+#define GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_H
+
+namespace grpc_core {
+
+// Interface for an xDS resource type.
+// Used to inject type-specific logic into XdsClient.
+class XdsResourceType {
+ public:
+ // A base type for resource data.
+ // Subclasses will extend this, and their DecodeResults will be
+ // downcastable to their extended type.
+ struct ResourceData {
+ virtual ~ResourceData() = default;
+ };
+
+ // Result returned by Decode().
+ struct DecodeResult {
+ std::string name;
+ absl::StatusOr<std::unique_ptr<ResourceData>> resource;
+ };
+
+ virtual ~XdsResourceType() = default;
+
+ // Returns v3 resource type.
+ virtual absl::string_view type_url() const = 0;
+
+ // Returns v2 resource type.
+ virtual absl::string_view v2_type_url() const = 0;
+
+ // Decodes and validates a serialized resource proto.
+ // If the resource fails protobuf deserialization, returns non-OK status.
+ // If the deserialized resource fails validation, returns a DecodeResult
+ // whose resource field is set to a non-OK status.
+ // Otherwise, returns a DecodeResult with a valid resource.
+ virtual absl::StatusOr<DecodeResult> Decode(
+ const XdsEncodingContext& context, absl::string_view serialized_resource,
+ bool is_v2) const = 0;
+
+ // Returns true if r1 and r2 are equal.
+ // Must be invoked only on resources returned by this object's Decode()
+ // method.
+ virtual bool ResourcesEqual(const ResourceData* r1,
+ const ResourceData* r2) const = 0;
+
+ // Returns a copy of resource.
+ // Must be invoked only on resources returned by this object's Decode()
+ // method.
+ virtual std::unique_ptr<ResourceData> CopyResource(
+ const ResourceData* resource) const = 0;
+
+ // Indicates whether the resource type requires that all resources must
+ // be present in every SotW response from the server. If true, a
+ // response that does not include a previously seen resource will be
+ // interpreted as a deletion of that resource.
+ virtual bool AllResourcesRequiredInSotW() const { return false; }
+
+ // Populate upb symtab with xDS proto messages that we want to print
+ // properly in logs.
+ // Note: This won't actually work properly until upb adds support for
+ // Any fields in textproto printing (internal b/178821188).
+ virtual void InitUpbSymtab(upb_DefPool* symtab) const = 0;
+
+ // Convenience method for checking if resource_type matches this type.
+ // Checks against both type_url() and v2_type_url().
+ // If is_v2 is non-null, it will be set to true if matching v2_type_url().
+ bool IsType(absl::string_view resource_type, bool* is_v2) const;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_H
diff --git a/grpc/src/core/ext/xds/xds_resource_type_impl.h b/grpc/src/core/ext/xds/xds_resource_type_impl.h
new file mode 100644
index 00000000..94ebe8ed
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_resource_type_impl.h
@@ -0,0 +1,87 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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.h"
+#include "src/core/ext/xds/xds_resource_type.h"
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_IMPL_H
+#define GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_IMPL_H
+
+namespace grpc_core {
+
+// Base class for XdsResourceType implementations.
+// Handles all down-casting logic for a particular resource type struct.
+template <typename Subclass, typename ResourceTypeStruct>
+class XdsResourceTypeImpl : public XdsResourceType {
+ public:
+ struct ResourceDataSubclass : public ResourceData {
+ ResourceTypeStruct resource;
+ };
+
+ // XdsClient watcher that handles down-casting.
+ class WatcherInterface : public XdsClient::ResourceWatcherInterface {
+ public:
+ virtual void OnResourceChanged(ResourceTypeStruct listener) = 0;
+
+ private:
+ // Get result from XdsClient generic watcher interface, perform
+ // down-casting, and invoke the caller's OnListenerChanged() method.
+ void OnGenericResourceChanged(
+ const XdsResourceType::ResourceData* resource) override {
+ OnResourceChanged(
+ static_cast<const ResourceDataSubclass*>(resource)->resource);
+ }
+ };
+
+ static const Subclass* Get() {
+ static const Subclass* g_instance = new Subclass();
+ return g_instance;
+ }
+
+ // Convenient wrappers around XdsClient generic watcher API that provide
+ // type-safety.
+ static void StartWatch(XdsClient* xds_client, absl::string_view resource_name,
+ RefCountedPtr<WatcherInterface> watcher) {
+ xds_client->WatchResource(Get(), resource_name, std::move(watcher));
+ }
+ static void CancelWatch(XdsClient* xds_client,
+ absl::string_view resource_name,
+ WatcherInterface* watcher,
+ bool delay_unsubscription = false) {
+ xds_client->CancelResourceWatch(Get(), resource_name, watcher,
+ delay_unsubscription);
+ }
+
+ bool ResourcesEqual(const ResourceData* r1,
+ const ResourceData* r2) const override {
+ return static_cast<const ResourceDataSubclass*>(r1)->resource ==
+ static_cast<const ResourceDataSubclass*>(r2)->resource;
+ }
+
+ std::unique_ptr<ResourceData> CopyResource(
+ const ResourceData* resource) const override {
+ auto* resource_copy = new ResourceDataSubclass();
+ resource_copy->resource =
+ static_cast<const ResourceDataSubclass*>(resource)->resource;
+ return std::unique_ptr<ResourceData>(resource_copy);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_RESOURCE_TYPE_IMPL_H
diff --git a/grpc/src/core/ext/xds/xds_route_config.cc b/grpc/src/core/ext/xds/xds_route_config.cc
new file mode 100644
index 00000000..0e572c77
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_route_config.cc
@@ -0,0 +1,1122 @@
+//
+// 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 "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
+#include "absl/strings/str_join.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/route/v3/route.upb.h"
+#include "envoy/config/route/v3/route.upbdefs.h"
+#include "envoy/config/route/v3/route_components.upb.h"
+#include "envoy/config/route/v3/route_components.upbdefs.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/wrappers.upb.h"
+#include "upb/text_encode.h"
+#include "upb/upb.h"
+#include "upb/upb.hpp"
+
+#include "src/core/ext/xds/upb_utils.h"
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/xds_cluster_specifier_plugin.h"
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/ext/xds/xds_resource_type.h"
+#include "src/core/ext/xds/xds_routing.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+// TODO(yashykt): Remove once RBAC is no longer experimental
+bool XdsRbacEnabled() {
+ char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_RBAC");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
+}
+
+// TODO(donnadionne): Remove once RLS is no longer experimental
+bool XdsRlsEnabled() {
+ char* value = gpr_getenv("GRPC_EXPERIMENTAL_XDS_RLS_LB");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
+}
+
+//
+// XdsRouteConfigResource::RetryPolicy
+//
+
+std::string XdsRouteConfigResource::RetryPolicy::RetryBackOff::ToString()
+ const {
+ std::vector<std::string> contents;
+ contents.push_back(
+ absl::StrCat("RetryBackOff Base: ", base_interval.ToString()));
+ contents.push_back(
+ absl::StrCat("RetryBackOff max: ", max_interval.ToString()));
+ return absl::StrJoin(contents, ",");
+}
+
+std::string XdsRouteConfigResource::RetryPolicy::ToString() const {
+ std::vector<std::string> contents;
+ contents.push_back(absl::StrFormat("num_retries=%d", num_retries));
+ contents.push_back(retry_back_off.ToString());
+ return absl::StrCat("{", absl::StrJoin(contents, ","), "}");
+}
+
+//
+// XdsRouteConfigResource::Route::Matchers
+//
+
+std::string XdsRouteConfigResource::Route::Matchers::ToString() const {
+ std::vector<std::string> contents;
+ contents.push_back(
+ absl::StrFormat("PathMatcher{%s}", 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(absl::StrFormat("Fraction Per Million %d",
+ fraction_per_million.value()));
+ }
+ return absl::StrJoin(contents, "\n");
+}
+
+//
+// XdsRouteConfigResource::Route::RouteAction::HashPolicy
+//
+
+XdsRouteConfigResource::Route::RouteAction::HashPolicy::HashPolicy(
+ const HashPolicy& other)
+ : type(other.type),
+ header_name(other.header_name),
+ regex_substitution(other.regex_substitution) {
+ if (other.regex != nullptr) {
+ regex =
+ absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
+ }
+}
+
+XdsRouteConfigResource::Route::RouteAction::HashPolicy&
+XdsRouteConfigResource::Route::RouteAction::HashPolicy::operator=(
+ const HashPolicy& other) {
+ type = other.type;
+ header_name = other.header_name;
+ if (other.regex != nullptr) {
+ regex =
+ absl::make_unique<RE2>(other.regex->pattern(), other.regex->options());
+ }
+ regex_substitution = other.regex_substitution;
+ return *this;
+}
+
+XdsRouteConfigResource::Route::RouteAction::HashPolicy::HashPolicy(
+ HashPolicy&& other) noexcept
+ : type(other.type),
+ header_name(std::move(other.header_name)),
+ regex(std::move(other.regex)),
+ regex_substitution(std::move(other.regex_substitution)) {}
+
+XdsRouteConfigResource::Route::RouteAction::HashPolicy&
+XdsRouteConfigResource::Route::RouteAction::HashPolicy::operator=(
+ HashPolicy&& other) noexcept {
+ type = other.type;
+ header_name = std::move(other.header_name);
+ regex = std::move(other.regex);
+ regex_substitution = std::move(other.regex_substitution);
+ return *this;
+}
+
+bool XdsRouteConfigResource::Route::RouteAction::HashPolicy::HashPolicy::
+operator==(const HashPolicy& other) const {
+ if (type != other.type) return false;
+ if (type == Type::HEADER) {
+ if (regex == nullptr) {
+ if (other.regex != nullptr) return false;
+ } else {
+ if (other.regex == nullptr) return false;
+ return header_name == other.header_name &&
+ regex->pattern() == other.regex->pattern() &&
+ regex_substitution == other.regex_substitution;
+ }
+ }
+ return true;
+}
+
+std::string XdsRouteConfigResource::Route::RouteAction::HashPolicy::ToString()
+ const {
+ std::vector<std::string> contents;
+ switch (type) {
+ case Type::HEADER:
+ contents.push_back("type=HEADER");
+ break;
+ case Type::CHANNEL_ID:
+ contents.push_back("type=CHANNEL_ID");
+ break;
+ }
+ contents.push_back(
+ absl::StrFormat("terminal=%s", terminal ? "true" : "false"));
+ if (type == Type::HEADER) {
+ contents.push_back(absl::StrFormat(
+ "Header %s:/%s/%s", header_name,
+ (regex == nullptr) ? "" : regex->pattern(), regex_substitution));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsRouteConfigResource::Route::RouteAction::ClusterWeight
+//
+
+std::string
+XdsRouteConfigResource::Route::RouteAction::ClusterWeight::ToString() const {
+ std::vector<std::string> contents;
+ contents.push_back(absl::StrCat("cluster=", name));
+ contents.push_back(absl::StrCat("weight=", weight));
+ if (!typed_per_filter_config.empty()) {
+ std::vector<std::string> parts;
+ for (const auto& p : typed_per_filter_config) {
+ const std::string& key = p.first;
+ const auto& config = p.second;
+ parts.push_back(absl::StrCat(key, "=", config.ToString()));
+ }
+ contents.push_back(absl::StrCat("typed_per_filter_config={",
+ absl::StrJoin(parts, ", "), "}"));
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsRouteConfigResource::Route::RouteAction
+//
+
+std::string XdsRouteConfigResource::Route::RouteAction::ToString() const {
+ std::vector<std::string> contents;
+ for (const HashPolicy& hash_policy : hash_policies) {
+ contents.push_back(absl::StrCat("hash_policy=", hash_policy.ToString()));
+ }
+ if (retry_policy.has_value()) {
+ contents.push_back(absl::StrCat("retry_policy=", retry_policy->ToString()));
+ }
+ if (action.index() == kClusterIndex) {
+ contents.push_back(
+ absl::StrFormat("Cluster name: %s", absl::get<kClusterIndex>(action)));
+ } else if (action.index() == kWeightedClustersIndex) {
+ auto& action_weighted_clusters = absl::get<kWeightedClustersIndex>(action);
+ for (const ClusterWeight& cluster_weight : action_weighted_clusters) {
+ contents.push_back(cluster_weight.ToString());
+ }
+ } else if (action.index() == kClusterSpecifierPluginIndex) {
+ contents.push_back(
+ absl::StrFormat("Cluster specifier plugin name: %s",
+ absl::get<kClusterSpecifierPluginIndex>(action)));
+ }
+ if (max_stream_duration.has_value()) {
+ contents.push_back(max_stream_duration->ToString());
+ }
+ return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsRouteConfigResource::Route
+//
+
+std::string XdsRouteConfigResource::Route::ToString() const {
+ std::vector<std::string> contents;
+ contents.push_back(matchers.ToString());
+ auto* route_action =
+ absl::get_if<XdsRouteConfigResource::Route::RouteAction>(&action);
+ if (route_action != nullptr) {
+ contents.push_back(absl::StrCat("route=", route_action->ToString()));
+ } else if (absl::holds_alternative<
+ XdsRouteConfigResource::Route::NonForwardingAction>(action)) {
+ contents.push_back("non_forwarding_action={}");
+ } else {
+ contents.push_back("unknown_action={}");
+ }
+ if (!typed_per_filter_config.empty()) {
+ contents.push_back("typed_per_filter_config={");
+ for (const auto& p : typed_per_filter_config) {
+ const std::string& name = p.first;
+ const auto& config = p.second;
+ contents.push_back(absl::StrCat(" ", name, "=", config.ToString()));
+ }
+ contents.push_back("}");
+ }
+ return absl::StrJoin(contents, "\n");
+}
+
+//
+// XdsRouteConfigResource
+//
+
+std::string XdsRouteConfigResource::ToString() const {
+ std::vector<std::string> parts;
+ for (const VirtualHost& vhost : virtual_hosts) {
+ parts.push_back(
+ absl::StrCat("vhost={\n"
+ " domains=[",
+ absl::StrJoin(vhost.domains, ", "),
+ "]\n"
+ " routes=[\n"));
+ for (const XdsRouteConfigResource::Route& route : vhost.routes) {
+ parts.push_back(" {\n");
+ parts.push_back(route.ToString());
+ parts.push_back("\n }\n");
+ }
+ parts.push_back(" ]\n");
+ parts.push_back(" typed_per_filter_config={\n");
+ for (const auto& p : vhost.typed_per_filter_config) {
+ const std::string& name = p.first;
+ const auto& config = p.second;
+ parts.push_back(absl::StrCat(" ", name, "=", config.ToString(), "\n"));
+ }
+ parts.push_back(" }\n");
+ parts.push_back("]\n");
+ }
+ parts.push_back("cluster_specifier_plugins={\n");
+ for (const auto& it : cluster_specifier_plugin_map) {
+ parts.push_back(absl::StrFormat("%s={%s}\n", it.first, it.second));
+ }
+ parts.push_back("}");
+ return absl::StrJoin(parts, "");
+}
+
+namespace {
+
+grpc_error_handle ClusterSpecifierPluginParse(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_RouteConfiguration* route_config,
+ XdsRouteConfigResource* rds_update) {
+ size_t num_cluster_specifier_plugins;
+ const envoy_config_route_v3_ClusterSpecifierPlugin* const*
+ cluster_specifier_plugin =
+ envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(
+ route_config, &num_cluster_specifier_plugins);
+ for (size_t i = 0; i < num_cluster_specifier_plugins; ++i) {
+ const envoy_config_core_v3_TypedExtensionConfig* extension =
+ envoy_config_route_v3_ClusterSpecifierPlugin_extension(
+ cluster_specifier_plugin[i]);
+ std::string name = UpbStringToStdString(
+ envoy_config_core_v3_TypedExtensionConfig_name(extension));
+ if (rds_update->cluster_specifier_plugin_map.find(name) !=
+ rds_update->cluster_specifier_plugin_map.end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Duplicated definition of cluster_specifier_plugin ", name));
+ }
+ const google_protobuf_Any* any =
+ envoy_config_core_v3_TypedExtensionConfig_typed_config(extension);
+ if (any == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not obtrain TypedExtensionConfig for plugin config.");
+ }
+ absl::string_view plugin_type;
+ grpc_error_handle error =
+ ExtractExtensionTypeName(context, any, &plugin_type);
+ if (error != GRPC_ERROR_NONE) return error;
+ bool is_optional = envoy_config_route_v3_ClusterSpecifierPlugin_is_optional(
+ cluster_specifier_plugin[i]);
+ const XdsClusterSpecifierPluginImpl* cluster_specifier_plugin_impl =
+ XdsClusterSpecifierPluginRegistry::GetPluginForType(plugin_type);
+ std::string lb_policy_config;
+ if (cluster_specifier_plugin_impl == nullptr) {
+ if (!is_optional) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Unknown ClusterSpecifierPlugin type ", plugin_type));
+ }
+ // Optional plugin, leave lb_policy_config empty.
+ } else {
+ auto config =
+ cluster_specifier_plugin_impl->GenerateLoadBalancingPolicyConfig(
+ google_protobuf_Any_value(any), context.arena, context.symtab);
+ if (!config.ok()) {
+ return absl_status_to_grpc_error(config.status());
+ }
+ lb_policy_config = std::move(*config);
+ }
+ rds_update->cluster_specifier_plugin_map[std::move(name)] =
+ std::move(lb_policy_config);
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle RoutePathMatchParse(
+ const envoy_config_route_v3_RouteMatch* match,
+ XdsRouteConfigResource::Route* route, bool* ignore_route) {
+ auto* case_sensitive_ptr =
+ envoy_config_route_v3_RouteMatch_case_sensitive(match);
+ bool case_sensitive = true;
+ if (case_sensitive_ptr != nullptr) {
+ case_sensitive = google_protobuf_BoolValue_value(case_sensitive_ptr);
+ }
+ StringMatcher::Type type;
+ std::string match_string;
+ if (envoy_config_route_v3_RouteMatch_has_prefix(match)) {
+ absl::string_view prefix =
+ UpbStringToAbsl(envoy_config_route_v3_RouteMatch_prefix(match));
+ // Empty prefix "" is accepted.
+ if (!prefix.empty()) {
+ // 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<absl::string_view> prefix_elements =
+ absl::StrSplit(prefix.substr(1), 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;
+ }
+ }
+ type = StringMatcher::Type::kPrefix;
+ match_string = std::string(prefix);
+ } else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
+ absl::string_view path =
+ UpbStringToAbsl(envoy_config_route_v3_RouteMatch_path(match));
+ if (path.empty()) {
+ // 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<absl::string_view> path_elements =
+ absl::StrSplit(path.substr(1), 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;
+ }
+ type = StringMatcher::Type::kExact;
+ match_string = std::string(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);
+ type = StringMatcher::Type::kSafeRegex;
+ match_string = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid route path specifier specified.");
+ }
+ absl::StatusOr<StringMatcher> string_matcher =
+ StringMatcher::Create(type, match_string, case_sensitive);
+ if (!string_matcher.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("path matcher: ", string_matcher.status().message()));
+ }
+ route->matchers.path_matcher = std::move(string_matcher.value());
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle RouteHeaderMatchersParse(
+ const envoy_config_route_v3_RouteMatch* match,
+ XdsRouteConfigResource::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];
+ const std::string name =
+ UpbStringToStdString(envoy_config_route_v3_HeaderMatcher_name(header));
+ HeaderMatcher::Type type;
+ std::string match_string;
+ int64_t range_start = 0;
+ int64_t range_end = 0;
+ bool present_match = false;
+ if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
+ type = HeaderMatcher::Type::kExact;
+ match_string = 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);
+ type = HeaderMatcher::Type::kSafeRegex;
+ match_string = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
+ type = HeaderMatcher::Type::kRange;
+ const envoy_type_v3_Int64Range* range_matcher =
+ envoy_config_route_v3_HeaderMatcher_range_match(header);
+ range_start = envoy_type_v3_Int64Range_start(range_matcher);
+ range_end = envoy_type_v3_Int64Range_end(range_matcher);
+ } else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
+ type = HeaderMatcher::Type::kPresent;
+ present_match = envoy_config_route_v3_HeaderMatcher_present_match(header);
+ } else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
+ type = HeaderMatcher::Type::kPrefix;
+ match_string = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_prefix_match(header));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
+ type = HeaderMatcher::Type::kSuffix;
+ match_string = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_suffix_match(header));
+ } else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
+ type = HeaderMatcher::Type::kContains;
+ match_string = UpbStringToStdString(
+ envoy_config_route_v3_HeaderMatcher_contains_match(header));
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid route header matcher specified.");
+ }
+ bool invert_match =
+ envoy_config_route_v3_HeaderMatcher_invert_match(header);
+ absl::StatusOr<HeaderMatcher> header_matcher =
+ HeaderMatcher::Create(name, type, match_string, range_start, range_end,
+ present_match, invert_match);
+ if (!header_matcher.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("header matcher: ", header_matcher.status().message()));
+ }
+ route->matchers.header_matchers.emplace_back(
+ std::move(header_matcher.value()));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle RouteRuntimeFractionParse(
+ const envoy_config_route_v3_RouteMatch* match,
+ XdsRouteConfigResource::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;
+}
+
+template <typename ParentType, typename EntryType>
+grpc_error_handle ParseTypedPerFilterConfig(
+ const XdsEncodingContext& context, const ParentType* parent,
+ const EntryType* (*entry_func)(const ParentType*, size_t*),
+ upb_StringView (*key_func)(const EntryType*),
+ const google_protobuf_Any* (*value_func)(const EntryType*),
+ XdsRouteConfigResource::TypedPerFilterConfig* typed_per_filter_config) {
+ size_t filter_it = kUpb_Map_Begin;
+ while (true) {
+ const auto* filter_entry = entry_func(parent, &filter_it);
+ if (filter_entry == nullptr) break;
+ absl::string_view key = UpbStringToAbsl(key_func(filter_entry));
+ if (key.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("empty filter name in map");
+ }
+ const google_protobuf_Any* any = value_func(filter_entry);
+ GPR_ASSERT(any != nullptr);
+ absl::string_view filter_type =
+ UpbStringToAbsl(google_protobuf_Any_type_url(any));
+ if (filter_type.empty()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("no filter config specified for filter name ", key));
+ }
+ bool is_optional = false;
+ if (filter_type ==
+ "type.googleapis.com/envoy.config.route.v3.FilterConfig") {
+ upb_StringView any_value = google_protobuf_Any_value(any);
+ const auto* filter_config = envoy_config_route_v3_FilterConfig_parse(
+ any_value.data, any_value.size, context.arena);
+ if (filter_config == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("could not parse FilterConfig wrapper for ", key));
+ }
+ is_optional =
+ envoy_config_route_v3_FilterConfig_is_optional(filter_config);
+ any = envoy_config_route_v3_FilterConfig_config(filter_config);
+ if (any == nullptr) {
+ if (is_optional) continue;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("no filter config specified for filter name ", key));
+ }
+ }
+ grpc_error_handle error =
+ ExtractExtensionTypeName(context, any, &filter_type);
+ if (error != GRPC_ERROR_NONE) return error;
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(filter_type);
+ if (filter_impl == nullptr) {
+ if (is_optional) continue;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("no filter registered for config type ", filter_type));
+ }
+ absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
+ filter_impl->GenerateFilterConfigOverride(
+ google_protobuf_Any_value(any), context.arena);
+ if (!filter_config.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "filter config for type ", filter_type,
+ " failed to parse: ", StatusToString(filter_config.status())));
+ }
+ (*typed_per_filter_config)[std::string(key)] = std::move(*filter_config);
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle RetryPolicyParse(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_RetryPolicy* retry_policy,
+ absl::optional<XdsRouteConfigResource::RetryPolicy>* retry) {
+ std::vector<grpc_error_handle> errors;
+ XdsRouteConfigResource::RetryPolicy retry_to_return;
+ auto retry_on = UpbStringToStdString(
+ envoy_config_route_v3_RetryPolicy_retry_on(retry_policy));
+ std::vector<absl::string_view> codes = absl::StrSplit(retry_on, ',');
+ for (const auto& code : codes) {
+ if (code == "cancelled") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_CANCELLED);
+ } else if (code == "deadline-exceeded") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_DEADLINE_EXCEEDED);
+ } else if (code == "internal") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_INTERNAL);
+ } else if (code == "resource-exhausted") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_RESOURCE_EXHAUSTED);
+ } else if (code == "unavailable") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_UNAVAILABLE);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "Unsupported retry_on policy %s.",
+ std::string(code).c_str());
+ }
+ }
+ }
+ const google_protobuf_UInt32Value* num_retries =
+ envoy_config_route_v3_RetryPolicy_num_retries(retry_policy);
+ if (num_retries != nullptr) {
+ uint32_t num_retries_value = google_protobuf_UInt32Value_value(num_retries);
+ if (num_retries_value == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction RetryPolicy num_retries set to invalid value 0."));
+ } else {
+ retry_to_return.num_retries = num_retries_value;
+ }
+ } else {
+ retry_to_return.num_retries = 1;
+ }
+ const envoy_config_route_v3_RetryPolicy_RetryBackOff* backoff =
+ envoy_config_route_v3_RetryPolicy_retry_back_off(retry_policy);
+ if (backoff != nullptr) {
+ const google_protobuf_Duration* base_interval =
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(backoff);
+ if (base_interval == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction RetryPolicy RetryBackoff missing base interval."));
+ } else {
+ retry_to_return.retry_back_off.base_interval =
+ ParseDuration(base_interval);
+ }
+ const google_protobuf_Duration* max_interval =
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(backoff);
+ Duration max;
+ if (max_interval != nullptr) {
+ max = ParseDuration(max_interval);
+ } else {
+ // if max interval is not set, it is 10x the base.
+ max = 10 * retry_to_return.retry_back_off.base_interval;
+ }
+ retry_to_return.retry_back_off.max_interval = max;
+ } else {
+ retry_to_return.retry_back_off.base_interval = Duration::Milliseconds(25);
+ retry_to_return.retry_back_off.max_interval = Duration::Milliseconds(250);
+ }
+ if (errors.empty()) {
+ *retry = retry_to_return;
+ return GRPC_ERROR_NONE;
+ } else {
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing retry policy",
+ &errors);
+ }
+}
+
+grpc_error_handle RouteActionParse(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_Route* route_msg,
+ const std::map<std::string /*cluster_specifier_plugin_name*/,
+ std::string /*LB policy config*/>&
+ cluster_specifier_plugin_map,
+ XdsRouteConfigResource::Route::RouteAction* route, bool* ignore_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)) {
+ std::string cluster_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_cluster(route_action));
+ if (cluster_name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction cluster contains empty cluster name.");
+ }
+ route->action
+ .emplace<XdsRouteConfigResource::Route::RouteAction::kClusterIndex>(
+ std::move(cluster_name));
+ } else if (envoy_config_route_v3_RouteAction_has_weighted_clusters(
+ route_action)) {
+ std::vector<XdsRouteConfigResource::Route::RouteAction::ClusterWeight>
+ action_weighted_clusters;
+ 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];
+ XdsRouteConfigResource::Route::RouteAction::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);
+ if (cluster.weight == 0) continue;
+ sum_of_weights += cluster.weight;
+ if (context.use_v3) {
+ grpc_error_handle error = ParseTypedPerFilterConfig<
+ envoy_config_route_v3_WeightedCluster_ClusterWeight,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
+ context, cluster_weight,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_key,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_value,
+ &cluster.typed_per_filter_config);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ action_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 (action_weighted_clusters.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction weighted_cluster has no valid clusters specified.");
+ }
+ route->action = std::move(action_weighted_clusters);
+ } else if (XdsRlsEnabled() &&
+ envoy_config_route_v3_RouteAction_has_cluster_specifier_plugin(
+ route_action)) {
+ std::string plugin_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_cluster_specifier_plugin(
+ route_action));
+ if (plugin_name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction cluster contains empty cluster specifier plugin name.");
+ }
+ auto it = cluster_specifier_plugin_map.find(plugin_name);
+ if (it == cluster_specifier_plugin_map.end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("RouteAction cluster contains cluster specifier plugin "
+ "name not configured: ",
+ plugin_name));
+ }
+ if (it->second.empty()) *ignore_route = true;
+ route->action.emplace<XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex>(
+ std::move(plugin_name));
+ } else {
+ // No cluster or weighted_clusters or plugin found in RouteAction, ignore
+ // this route.
+ *ignore_route = true;
+ }
+ if (!*ignore_route) {
+ const envoy_config_route_v3_RouteAction_MaxStreamDuration*
+ max_stream_duration =
+ envoy_config_route_v3_RouteAction_max_stream_duration(route_action);
+ if (max_stream_duration != nullptr) {
+ const google_protobuf_Duration* duration =
+ envoy_config_route_v3_RouteAction_MaxStreamDuration_grpc_timeout_header_max(
+ max_stream_duration);
+ if (duration == nullptr) {
+ duration =
+ envoy_config_route_v3_RouteAction_MaxStreamDuration_max_stream_duration(
+ max_stream_duration);
+ }
+ if (duration != nullptr) {
+ route->max_stream_duration = ParseDuration(duration);
+ }
+ }
+ }
+ // Get HashPolicy from RouteAction
+ size_t size = 0;
+ const envoy_config_route_v3_RouteAction_HashPolicy* const* hash_policies =
+ envoy_config_route_v3_RouteAction_hash_policy(route_action, &size);
+ for (size_t i = 0; i < size; ++i) {
+ const envoy_config_route_v3_RouteAction_HashPolicy* hash_policy =
+ hash_policies[i];
+ XdsRouteConfigResource::Route::RouteAction::HashPolicy policy;
+ policy.terminal =
+ envoy_config_route_v3_RouteAction_HashPolicy_terminal(hash_policy);
+ const envoy_config_route_v3_RouteAction_HashPolicy_Header* header;
+ const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*
+ filter_state;
+ if ((header = envoy_config_route_v3_RouteAction_HashPolicy_header(
+ hash_policy)) != nullptr) {
+ policy.type =
+ XdsRouteConfigResource::Route::RouteAction::HashPolicy::Type::HEADER;
+ policy.header_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(
+ header));
+ const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*
+ regex_rewrite =
+ envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(
+ header);
+ if (regex_rewrite != nullptr) {
+ const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
+ envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(
+ regex_rewrite);
+ if (regex_matcher == nullptr) {
+ gpr_log(
+ GPR_DEBUG,
+ "RouteAction HashPolicy contains policy specifier Header with "
+ "RegexMatchAndSubstitution but RegexMatcher pattern is "
+ "missing");
+ continue;
+ }
+ RE2::Options options;
+ policy.regex = absl::make_unique<RE2>(
+ UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher)),
+ options);
+ if (!policy.regex->ok()) {
+ gpr_log(
+ GPR_DEBUG,
+ "RouteAction HashPolicy contains policy specifier Header with "
+ "RegexMatchAndSubstitution but RegexMatcher pattern does not "
+ "compile");
+ continue;
+ }
+ policy.regex_substitution = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(
+ regex_rewrite));
+ }
+ } else if ((filter_state =
+ envoy_config_route_v3_RouteAction_HashPolicy_filter_state(
+ hash_policy)) != nullptr) {
+ std::string key = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(
+ filter_state));
+ if (key == "io.grpc.channel_id") {
+ policy.type = XdsRouteConfigResource::Route::RouteAction::HashPolicy::
+ Type::CHANNEL_ID;
+ } else {
+ gpr_log(GPR_DEBUG,
+ "RouteAction HashPolicy contains policy specifier "
+ "FilterState but "
+ "key is not io.grpc.channel_id.");
+ continue;
+ }
+ } else {
+ gpr_log(GPR_DEBUG,
+ "RouteAction HashPolicy contains unsupported policy specifier.");
+ continue;
+ }
+ route->hash_policies.emplace_back(std::move(policy));
+ }
+ // Get retry policy
+ const envoy_config_route_v3_RetryPolicy* retry_policy =
+ envoy_config_route_v3_RouteAction_retry_policy(route_action);
+ if (retry_policy != nullptr) {
+ absl::optional<XdsRouteConfigResource::RetryPolicy> retry;
+ grpc_error_handle error = RetryPolicyParse(context, retry_policy, &retry);
+ if (error != GRPC_ERROR_NONE) return error;
+ route->retry_policy = retry;
+ }
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace
+
+grpc_error_handle XdsRouteConfigResource::Parse(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_RouteConfiguration* route_config,
+ XdsRouteConfigResource* rds_update) {
+ // Get the cluster spcifier plugins
+ if (XdsRlsEnabled()) {
+ grpc_error_handle error =
+ ClusterSpecifierPluginParse(context, route_config, rds_update);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ // Get the 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) {
+ rds_update->virtual_hosts.emplace_back();
+ XdsRouteConfigResource::VirtualHost& vhost =
+ rds_update->virtual_hosts.back();
+ // Parse domains.
+ size_t domain_size;
+ upb_StringView const* domains = envoy_config_route_v3_VirtualHost_domains(
+ virtual_hosts[i], &domain_size);
+ for (size_t j = 0; j < domain_size; ++j) {
+ std::string domain_pattern = UpbStringToStdString(domains[j]);
+ if (!XdsRouting::IsValidDomainPattern(domain_pattern)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Invalid domain pattern \"", domain_pattern, "\"."));
+ }
+ vhost.domains.emplace_back(std::move(domain_pattern));
+ }
+ if (vhost.domains.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("VirtualHost has no domains");
+ }
+ // Parse typed_per_filter_config.
+ if (context.use_v3) {
+ grpc_error_handle error = ParseTypedPerFilterConfig<
+ envoy_config_route_v3_VirtualHost,
+ envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
+ context, virtual_hosts[i],
+ envoy_config_route_v3_VirtualHost_typed_per_filter_config_next,
+ envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_key,
+ envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_value,
+ &vhost.typed_per_filter_config);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ // Parse retry policy.
+ absl::optional<XdsRouteConfigResource::RetryPolicy>
+ virtual_host_retry_policy;
+ const envoy_config_route_v3_RetryPolicy* retry_policy =
+ envoy_config_route_v3_VirtualHost_retry_policy(virtual_hosts[i]);
+ if (retry_policy != nullptr) {
+ grpc_error_handle error =
+ RetryPolicyParse(context, retry_policy, &virtual_host_retry_policy);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ // 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.");
+ }
+ // Build a set of cluster_specifier_plugin configured to make sure each is
+ // actually referenced by a route action.
+ std::set<absl::string_view> cluster_specifier_plugins;
+ for (auto& plugin : rds_update->cluster_specifier_plugin_map) {
+ cluster_specifier_plugins.emplace(plugin.first);
+ }
+ // 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]);
+ if (match == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Match can't be null.");
+ }
+ 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;
+ }
+ XdsRouteConfigResource::Route route;
+ bool ignore_route = false;
+ grpc_error_handle 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;
+ if (envoy_config_route_v3_Route_has_route(routes[j])) {
+ route.action.emplace<XdsRouteConfigResource::Route::RouteAction>();
+ auto& route_action =
+ absl::get<XdsRouteConfigResource::Route::RouteAction>(route.action);
+ error = RouteActionParse(context, routes[j],
+ rds_update->cluster_specifier_plugin_map,
+ &route_action, &ignore_route);
+ if (error != GRPC_ERROR_NONE) return error;
+ if (ignore_route) continue;
+ if (route_action.retry_policy == absl::nullopt &&
+ retry_policy != nullptr) {
+ route_action.retry_policy = virtual_host_retry_policy;
+ }
+ // Mark off plugins used in route action.
+ std::string* cluster_specifier_action =
+ absl::get_if<XdsRouteConfigResource::Route::RouteAction::
+ kClusterSpecifierPluginIndex>(
+ &route_action.action);
+ if (cluster_specifier_action != nullptr) {
+ cluster_specifier_plugins.erase(*cluster_specifier_action);
+ }
+ } else if (envoy_config_route_v3_Route_has_non_forwarding_action(
+ routes[j])) {
+ route.action
+ .emplace<XdsRouteConfigResource::Route::NonForwardingAction>();
+ }
+ if (context.use_v3) {
+ grpc_error_handle error = ParseTypedPerFilterConfig<
+ envoy_config_route_v3_Route,
+ envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
+ context, routes[j],
+ envoy_config_route_v3_Route_typed_per_filter_config_next,
+ envoy_config_route_v3_Route_TypedPerFilterConfigEntry_key,
+ envoy_config_route_v3_Route_TypedPerFilterConfigEntry_value,
+ &route.typed_per_filter_config);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
+ vhost.routes.emplace_back(std::move(route));
+ }
+ if (vhost.routes.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No valid routes specified.");
+ }
+ // For plugins not used in route action, delete from the update to prevent
+ // further use.
+ for (auto& unused_plugin : cluster_specifier_plugins) {
+ rds_update->cluster_specifier_plugin_map.erase(
+ std::string(unused_plugin));
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+//
+// XdsRouteConfigResourceType
+//
+
+namespace {
+
+void MaybeLogRouteConfiguration(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_RouteConfiguration* route_config) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_MessageDef* msg_type =
+ envoy_config_route_v3_RouteConfiguration_getmsgdef(context.symtab);
+ char buf[10240];
+ upb_TextEncode(route_config, msg_type, nullptr, 0, buf, sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] RouteConfiguration: %s", context.client,
+ buf);
+ }
+}
+
+} // namespace
+
+absl::StatusOr<XdsResourceType::DecodeResult>
+XdsRouteConfigResourceType::Decode(const XdsEncodingContext& context,
+ absl::string_view serialized_resource,
+ bool /*is_v2*/) const {
+ // Parse serialized proto.
+ auto* resource = envoy_config_route_v3_RouteConfiguration_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return absl::InvalidArgumentError(
+ "Can't parse RouteConfiguration resource.");
+ }
+ MaybeLogRouteConfiguration(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name = UpbStringToStdString(
+ envoy_config_route_v3_RouteConfiguration_name(resource));
+ auto route_config_data = absl::make_unique<ResourceDataSubclass>();
+ grpc_error_handle error = XdsRouteConfigResource::Parse(
+ context, resource, &route_config_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ std::string error_str = grpc_error_std_string(error);
+ GRPC_ERROR_UNREF(error);
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_ERROR, "[xds_client %p] invalid RouteConfiguration %s: %s",
+ context.client, result.name.c_str(), error_str.c_str());
+ }
+ result.resource = absl::InvalidArgumentError(error_str);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "[xds_client %p] parsed RouteConfiguration %s: %s",
+ context.client, result.name.c_str(),
+ route_config_data->resource.ToString().c_str());
+ }
+ result.resource = std::move(route_config_data);
+ }
+ return std::move(result);
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_route_config.h b/grpc/src/core/ext/xds/xds_route_config.h
new file mode 100644
index 00000000..dd719b0c
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_route_config.h
@@ -0,0 +1,218 @@
+//
+// 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_ROUTE_CONFIG_H
+#define GRPC_CORE_EXT_XDS_XDS_ROUTE_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+#include "envoy/config/route/v3/route.upb.h"
+#include "envoy/config/route/v3/route.upbdefs.h"
+#include "re2/re2.h"
+
+#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_cluster_specifier_plugin.h"
+#include "src/core/ext/xds/xds_common_types.h"
+#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/ext/xds/xds_resource_type_impl.h"
+#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/matchers/matchers.h"
+
+namespace grpc_core {
+
+bool XdsRbacEnabled();
+
+struct XdsRouteConfigResource {
+ using TypedPerFilterConfig =
+ std::map<std::string, XdsHttpFilterImpl::FilterConfig>;
+
+ struct RetryPolicy {
+ internal::StatusCodeSet retry_on;
+ uint32_t num_retries;
+
+ struct RetryBackOff {
+ Duration base_interval;
+ Duration max_interval;
+
+ bool operator==(const RetryBackOff& other) const {
+ return base_interval == other.base_interval &&
+ max_interval == other.max_interval;
+ }
+ std::string ToString() const;
+ };
+ RetryBackOff retry_back_off;
+
+ bool operator==(const RetryPolicy& other) const {
+ return (retry_on == other.retry_on && num_retries == other.num_retries &&
+ retry_back_off == other.retry_back_off);
+ }
+ std::string ToString() const;
+ };
+
+ struct Route {
+ // Matchers for this route.
+ struct Matchers {
+ StringMatcher path_matcher;
+ std::vector<HeaderMatcher> header_matchers;
+ 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;
+ }
+ std::string ToString() const;
+ };
+
+ Matchers matchers;
+
+ struct UnknownAction {
+ bool operator==(const UnknownAction& /* other */) const { return true; }
+ };
+
+ struct RouteAction {
+ struct HashPolicy {
+ enum Type { HEADER, CHANNEL_ID };
+ Type type;
+ bool terminal = false;
+ // Fields used for type HEADER.
+ std::string header_name;
+ std::unique_ptr<RE2> regex = nullptr;
+ std::string regex_substitution;
+
+ HashPolicy() {}
+
+ // Copyable.
+ HashPolicy(const HashPolicy& other);
+ HashPolicy& operator=(const HashPolicy& other);
+
+ // Moveable.
+ HashPolicy(HashPolicy&& other) noexcept;
+ HashPolicy& operator=(HashPolicy&& other) noexcept;
+
+ bool operator==(const HashPolicy& other) const;
+ std::string ToString() const;
+ };
+
+ struct ClusterWeight {
+ std::string name;
+ uint32_t weight;
+ TypedPerFilterConfig typed_per_filter_config;
+
+ bool operator==(const ClusterWeight& other) const {
+ return name == other.name && weight == other.weight &&
+ typed_per_filter_config == other.typed_per_filter_config;
+ }
+ std::string ToString() const;
+ };
+
+ std::vector<HashPolicy> hash_policies;
+ absl::optional<RetryPolicy> retry_policy;
+
+ // Action for this route.
+ static constexpr size_t kClusterIndex = 0;
+ static constexpr size_t kWeightedClustersIndex = 1;
+ static constexpr size_t kClusterSpecifierPluginIndex = 2;
+ absl::variant<std::string, std::vector<ClusterWeight>, std::string>
+ action;
+ // Storing the timeout duration from route action:
+ // RouteAction.max_stream_duration.grpc_timeout_header_max or
+ // RouteAction.max_stream_duration.max_stream_duration if the former is
+ // not set.
+ absl::optional<Duration> max_stream_duration;
+
+ bool operator==(const RouteAction& other) const {
+ return hash_policies == other.hash_policies &&
+ retry_policy == other.retry_policy && action == other.action &&
+ max_stream_duration == other.max_stream_duration;
+ }
+ std::string ToString() const;
+ };
+
+ struct NonForwardingAction {
+ bool operator==(const NonForwardingAction& /* other */) const {
+ return true;
+ }
+ };
+
+ absl::variant<UnknownAction, RouteAction, NonForwardingAction> action;
+ TypedPerFilterConfig typed_per_filter_config;
+
+ bool operator==(const Route& other) const {
+ return matchers == other.matchers && action == other.action &&
+ typed_per_filter_config == other.typed_per_filter_config;
+ }
+ std::string ToString() const;
+ };
+
+ struct VirtualHost {
+ std::vector<std::string> domains;
+ std::vector<Route> routes;
+ TypedPerFilterConfig typed_per_filter_config;
+
+ bool operator==(const VirtualHost& other) const {
+ return domains == other.domains && routes == other.routes &&
+ typed_per_filter_config == other.typed_per_filter_config;
+ }
+ };
+
+ std::vector<VirtualHost> virtual_hosts;
+ std::map<std::string /*cluster_specifier_plugin_name*/,
+ std::string /*LB policy config*/>
+ cluster_specifier_plugin_map;
+
+ bool operator==(const XdsRouteConfigResource& other) const {
+ return virtual_hosts == other.virtual_hosts &&
+ cluster_specifier_plugin_map == other.cluster_specifier_plugin_map;
+ }
+ std::string ToString() const;
+
+ static grpc_error_handle Parse(
+ const XdsEncodingContext& context,
+ const envoy_config_route_v3_RouteConfiguration* route_config,
+ XdsRouteConfigResource* rds_update);
+};
+
+class XdsRouteConfigResourceType
+ : public XdsResourceTypeImpl<XdsRouteConfigResourceType,
+ XdsRouteConfigResource> {
+ public:
+ absl::string_view type_url() const override {
+ return "envoy.config.route.v3.RouteConfiguration";
+ }
+ absl::string_view v2_type_url() const override {
+ return "envoy.api.v2.RouteConfiguration";
+ }
+
+ absl::StatusOr<DecodeResult> Decode(const XdsEncodingContext& context,
+ absl::string_view serialized_resource,
+ bool /*is_v2*/) const override;
+
+ void InitUpbSymtab(upb_DefPool* symtab) const override {
+ envoy_config_route_v3_RouteConfiguration_getmsgdef(symtab);
+ XdsClusterSpecifierPluginRegistry::PopulateSymtab(symtab);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_ROUTE_CONFIG_H
diff --git a/grpc/src/core/ext/xds/xds_routing.cc b/grpc/src/core/ext/xds/xds_routing.cc
new file mode 100644
index 00000000..f075bfc0
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_routing.cc
@@ -0,0 +1,250 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_routing.h"
+
+#include <cctype>
+
+namespace grpc_core {
+
+namespace {
+enum MatchType {
+ EXACT_MATCH,
+ SUFFIX_MATCH,
+ PREFIX_MATCH,
+ UNIVERSE_MATCH,
+ INVALID_MATCH,
+};
+
+// Returns true if match succeeds.
+bool DomainMatch(MatchType match_type, absl::string_view domain_pattern_in,
+ absl::string_view expected_host_name_in) {
+ // Normalize the args to lower-case. Domain matching is case-insensitive.
+ std::string domain_pattern = std::string(domain_pattern_in);
+ std::string expected_host_name = std::string(expected_host_name_in);
+ std::transform(domain_pattern.begin(), domain_pattern.end(),
+ domain_pattern.begin(),
+ [](unsigned char c) { return std::tolower(c); });
+ std::transform(expected_host_name.begin(), expected_host_name.end(),
+ 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;
+ absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
+ 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;
+ absl::string_view pattern_prefix(domain_pattern.c_str(),
+ domain_pattern.size() - 1);
+ 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(absl::string_view domain_pattern) {
+ if (domain_pattern.empty()) return INVALID_MATCH;
+ if (!absl::StrContains(domain_pattern, '*')) 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
+
+absl::optional<size_t> XdsRouting::FindVirtualHostForDomain(
+ const VirtualHostListIterator& vhost_iterator, absl::string_view 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.
+ absl::optional<size_t> target_index;
+ 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 (size_t i = 0; i < vhost_iterator.Size(); ++i) {
+ const auto& domains = vhost_iterator.GetDomainsForVirtualHost(i);
+ for (const std::string& domain_pattern : 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_index = i;
+ 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_index;
+}
+
+namespace {
+
+bool HeadersMatch(const std::vector<HeaderMatcher>& header_matchers,
+ grpc_metadata_batch* initial_metadata) {
+ for (const auto& header_matcher : header_matchers) {
+ std::string concatenated_value;
+ if (!header_matcher.Match(XdsRouting::GetHeaderValue(
+ initial_metadata, header_matcher.name(), &concatenated_value))) {
+ 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;
+}
+
+} // namespace
+
+absl::optional<size_t> XdsRouting::GetRouteForRequest(
+ const RouteListIterator& route_list_iterator, absl::string_view path,
+ grpc_metadata_batch* initial_metadata) {
+ for (size_t i = 0; i < route_list_iterator.Size(); ++i) {
+ const XdsRouteConfigResource::Route::Matchers& matchers =
+ route_list_iterator.GetMatchersForRoute(i);
+ if (matchers.path_matcher.Match(path) &&
+ HeadersMatch(matchers.header_matchers, initial_metadata) &&
+ (!matchers.fraction_per_million.has_value() ||
+ UnderFraction(*matchers.fraction_per_million))) {
+ return i;
+ }
+ }
+ return absl::nullopt;
+}
+
+bool XdsRouting::IsValidDomainPattern(absl::string_view domain_pattern) {
+ return DomainPatternMatchType(domain_pattern) != INVALID_MATCH;
+}
+
+absl::optional<absl::string_view> XdsRouting::GetHeaderValue(
+ grpc_metadata_batch* initial_metadata, absl::string_view header_name,
+ std::string* concatenated_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 (absl::EndsWith(header_name, "-bin")) {
+ return absl::nullopt;
+ } else if (header_name == "content-type") {
+ return "application/grpc";
+ }
+ return initial_metadata->GetStringValue(header_name, concatenated_value);
+}
+
+namespace {
+
+const XdsHttpFilterImpl::FilterConfig* FindFilterConfigOverride(
+ const std::string& instance_name,
+ const XdsRouteConfigResource::VirtualHost& vhost,
+ const XdsRouteConfigResource::Route& route,
+ const XdsRouteConfigResource::Route::RouteAction::ClusterWeight*
+ cluster_weight) {
+ // Check ClusterWeight, if any.
+ if (cluster_weight != nullptr) {
+ auto it = cluster_weight->typed_per_filter_config.find(instance_name);
+ if (it != cluster_weight->typed_per_filter_config.end()) return &it->second;
+ }
+ // Check Route.
+ auto it = route.typed_per_filter_config.find(instance_name);
+ if (it != route.typed_per_filter_config.end()) return &it->second;
+ // Check VirtualHost.
+ it = vhost.typed_per_filter_config.find(instance_name);
+ if (it != vhost.typed_per_filter_config.end()) return &it->second;
+ // Not found.
+ return nullptr;
+}
+
+} // namespace
+
+XdsRouting::GeneratePerHttpFilterConfigsResult
+XdsRouting::GeneratePerHTTPFilterConfigs(
+ const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
+ http_filters,
+ const XdsRouteConfigResource::VirtualHost& vhost,
+ const XdsRouteConfigResource::Route& route,
+ const XdsRouteConfigResource::Route::RouteAction::ClusterWeight*
+ cluster_weight,
+ grpc_channel_args* args) {
+ GeneratePerHttpFilterConfigsResult result;
+ result.args = args;
+ for (const auto& http_filter : http_filters) {
+ // Find filter. This is guaranteed to succeed, because it's checked
+ // at config validation time in the XdsApi code.
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ http_filter.config.config_proto_type_name);
+ GPR_ASSERT(filter_impl != nullptr);
+ // If there is not actually any C-core filter associated with this
+ // xDS filter, then it won't need any config, so skip it.
+ if (filter_impl->channel_filter() == nullptr) continue;
+ // Allow filter to add channel args that may affect service config
+ // parsing.
+ result.args = filter_impl->ModifyChannelArgs(result.args);
+ // Find config override, if any.
+ const XdsHttpFilterImpl::FilterConfig* config_override =
+ FindFilterConfigOverride(http_filter.name, vhost, route,
+ cluster_weight);
+ // Generate service config for filter.
+ auto method_config_field =
+ filter_impl->GenerateServiceConfig(http_filter.config, config_override);
+ if (!method_config_field.ok()) {
+ grpc_channel_args_destroy(result.args);
+ result.args = nullptr;
+ result.error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "failed to generate method config for HTTP filter ", http_filter.name,
+ ": ", method_config_field.status().ToString()));
+ break;
+ }
+ result.per_filter_configs[method_config_field->service_config_field_name]
+ .push_back(method_config_field->element);
+ }
+ return result;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/ext/xds/xds_routing.h b/grpc/src/core/ext/xds/xds_routing.h
new file mode 100644
index 00000000..18df4ce4
--- /dev/null
+++ b/grpc/src/core/ext/xds/xds_routing.h
@@ -0,0 +1,101 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_ROUTING_H
+#define GRPC_CORE_EXT_XDS_XDS_ROUTING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "absl/strings/string_view.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/xds/xds_listener.h"
+#include "src/core/ext/xds/xds_route_config.h"
+#include "src/core/lib/matchers/matchers.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+class XdsRouting {
+ public:
+ class VirtualHostListIterator {
+ public:
+ virtual ~VirtualHostListIterator() = default;
+ // Returns the number of virtual hosts in the list.
+ virtual size_t Size() const = 0;
+ // Returns the domain list for the virtual host at the specified index.
+ virtual const std::vector<std::string>& GetDomainsForVirtualHost(
+ size_t index) const = 0;
+ };
+
+ class RouteListIterator {
+ public:
+ virtual ~RouteListIterator() = default;
+ // Number of routes.
+ virtual size_t Size() const = 0;
+ // Returns the matchers for the route at the specified index.
+ virtual const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
+ size_t index) const = 0;
+ };
+
+ // Returns the index of the selected virtual host in the list.
+ static absl::optional<size_t> FindVirtualHostForDomain(
+ const VirtualHostListIterator& vhost_iterator, absl::string_view domain);
+
+ // Returns the index in route_list_iterator to use for a request with
+ // the specified path and metadata, or nullopt if no route matches.
+ static absl::optional<size_t> GetRouteForRequest(
+ const RouteListIterator& route_list_iterator, absl::string_view path,
+ grpc_metadata_batch* initial_metadata);
+
+ // Returns true if \a domain_pattern is a valid domain pattern, false
+ // otherwise.
+ static bool IsValidDomainPattern(absl::string_view domain_pattern);
+
+ // Returns the metadata value(s) for the specified key.
+ // As special cases, binary headers return a value of absl::nullopt, and
+ // "content-type" header returns "application/grpc".
+ static absl::optional<absl::string_view> GetHeaderValue(
+ grpc_metadata_batch* initial_metadata, absl::string_view header_name,
+ std::string* concatenated_value);
+
+ struct GeneratePerHttpFilterConfigsResult {
+ // Map of field name to list of elements for that field
+ std::map<std::string, std::vector<std::string>> per_filter_configs;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ // Guaranteed to be nullptr if error is GRPC_ERROR_NONE
+ grpc_channel_args* args = nullptr;
+ };
+
+ // Generates a map of per_filter_configs. \a args is consumed.
+ static GeneratePerHttpFilterConfigsResult GeneratePerHTTPFilterConfigs(
+ const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
+ http_filters,
+ const XdsRouteConfigResource::VirtualHost& vhost,
+ const XdsRouteConfigResource::Route& route,
+ const XdsRouteConfigResource::Route::RouteAction::ClusterWeight*
+ cluster_weight,
+ grpc_channel_args* args);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_ROUTING_H
diff --git a/grpc/src/core/ext/xds/xds_server_config_fetcher.cc b/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
index 962731f9..9bae129d 100644
--- a/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
+++ b/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
@@ -18,46 +18,151 @@
#include <grpc/support/port_platform.h>
+#include "absl/strings/str_join.h"
#include "absl/strings/str_replace.h"
+#include "src/core/ext/filters/server_config_selector/server_config_selector.h"
+#include "src/core/ext/filters/server_config_selector/server_config_selector_filter.h"
#include "src/core/ext/xds/xds_certificate_provider.h"
+#include "src/core/ext/xds/xds_channel_stack_modifier.h"
#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_listener.h"
+#include "src/core/ext/xds/xds_route_config.h"
+#include "src/core/ext/xds/xds_routing.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/security/credentials/xds/xds_credentials.h"
+#include "src/core/lib/service_config/service_config_impl.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
+namespace {
TraceFlag grpc_xds_server_config_fetcher_trace(false,
"xds_server_config_fetcher");
-namespace {
+// A server config fetcher that fetches the information for configuring server
+// listeners from the xDS control plane.
+class XdsServerConfigFetcher : public grpc_server_config_fetcher {
+ public:
+ XdsServerConfigFetcher(RefCountedPtr<XdsClient> xds_client,
+ grpc_server_xds_status_notifier notifier);
+
+ void StartWatch(std::string listening_address,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ watcher) override;
+
+ void CancelWatch(
+ grpc_server_config_fetcher::WatcherInterface* watcher) override;
+
+ // Return the interested parties from the xds client so that it can be polled.
+ grpc_pollset_set* interested_parties() override {
+ return xds_client_->interested_parties();
+ }
+
+ private:
+ class ListenerWatcher;
+
+ const RefCountedPtr<XdsClient> xds_client_;
+ const grpc_server_xds_status_notifier serving_status_notifier_;
+ Mutex mu_;
+ std::map<grpc_server_config_fetcher::WatcherInterface*, ListenerWatcher*>
+ listener_watchers_ ABSL_GUARDED_BY(mu_);
+};
+
+// A watcher implementation for listening on LDS updates from the xDS control
+// plane. When a good LDS update is received, it creates a
+// FilterChainMatchManager object that would replace the existing (if any)
+// FilterChainMatchManager object after all referenced RDS resources are
+// fetched. Note that a good update also causes the server listener to start
+// listening if it isn't already. If an error LDS update is received (NACKed
+// resource, timeouts), the previous good FilterChainMatchManager, if any,
+// continues to be used. If there isn't any previous good update or if the
+// update received was a fatal error (resource does not exist), the server
+// listener is made to stop listening.
+class XdsServerConfigFetcher::ListenerWatcher
+ : public XdsListenerResourceType::WatcherInterface {
+ public:
+ ListenerWatcher(RefCountedPtr<XdsClient> xds_client,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher,
+ grpc_server_xds_status_notifier serving_status_notifier,
+ std::string listening_address);
+
+ void OnResourceChanged(XdsListenerResource listener) override;
+
+ void OnError(absl::Status status) override;
+
+ void OnResourceDoesNotExist() override;
+
+ const std::string& listening_address() const { return listening_address_; }
+
+ private:
+ class FilterChainMatchManager;
+
+ void OnFatalError(absl::Status status) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ // Invoked by FilterChainMatchManager that is done fetching all referenced RDS
+ // resources. If the calling FilterChainMatchManager is the
+ // pending_filter_chain_match_manager_, it is promoted to be the
+ // filter_chain_match_manager_ in use.
+ void PendingFilterChainMatchManagerReady(
+ FilterChainMatchManager* filter_chain_match_manager) {
+ MutexLock lock(&mu_);
+ PendingFilterChainMatchManagerReadyLocked(filter_chain_match_manager);
+ }
+ void PendingFilterChainMatchManagerReadyLocked(
+ FilterChainMatchManager* filter_chain_match_manager)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
+
+ const RefCountedPtr<XdsClient> xds_client_;
+ const std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher_;
+ const grpc_server_xds_status_notifier serving_status_notifier_;
+ const std::string listening_address_;
+ Mutex mu_;
+ RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_
+ ABSL_GUARDED_BY(mu_);
+ RefCountedPtr<FilterChainMatchManager> pending_filter_chain_match_manager_
+ ABSL_GUARDED_BY(mu_);
+};
-class FilterChainMatchManager
+// A connection manager used by the server listener code to inject channel args
+// to be used for each incoming connection. This implementation chooses the
+// appropriate filter chain from the xDS Listener resource and injects channel
+// args that configure the right mTLS certs and cause the right set of HTTP
+// filters to be injected.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
: public grpc_server_config_fetcher::ConnectionManager {
public:
- FilterChainMatchManager(
- RefCountedPtr<XdsClient> xds_client,
- XdsApi::LdsUpdate::FilterChainMap filter_chain_map,
- absl::optional<XdsApi::LdsUpdate::FilterChainData> default_filter_chain)
- : xds_client_(xds_client),
- filter_chain_map_(std::move(filter_chain_map)),
- default_filter_chain_(std::move(default_filter_chain)) {}
+ FilterChainMatchManager(RefCountedPtr<XdsClient> xds_client,
+ XdsListenerResource::FilterChainMap filter_chain_map,
+ absl::optional<XdsListenerResource::FilterChainData>
+ default_filter_chain);
absl::StatusOr<grpc_channel_args*> UpdateChannelArgsForConnection(
grpc_channel_args* args, grpc_endpoint* tcp) override;
- const XdsApi::LdsUpdate::FilterChainMap& filter_chain_map() const {
+ void Orphan() override;
+
+ // Invoked by ListenerWatcher to start fetching referenced RDS resources.
+ void StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ListenerWatcher::mu_);
+
+ const XdsListenerResource::FilterChainMap& filter_chain_map() const {
return filter_chain_map_;
}
- const absl::optional<XdsApi::LdsUpdate::FilterChainData>&
+ const absl::optional<XdsListenerResource::FilterChainData>&
default_filter_chain() const {
return default_filter_chain_;
}
@@ -72,41 +177,651 @@ class FilterChainMatchManager
RefCountedPtr<XdsCertificateProvider> xds;
};
+ class RouteConfigWatcher;
+ struct RdsUpdateState {
+ RouteConfigWatcher* watcher;
+ absl::optional<absl::StatusOr<XdsRouteConfigResource>> rds_update;
+ };
+
+ class XdsServerConfigSelector;
+ class StaticXdsServerConfigSelectorProvider;
+ class DynamicXdsServerConfigSelectorProvider;
+
absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
CreateOrGetXdsCertificateProviderFromFilterChainData(
- const XdsApi::LdsUpdate::FilterChainData* filter_chain);
+ const XdsListenerResource::FilterChainData* filter_chain);
- const RefCountedPtr<XdsClient> xds_client_;
- const XdsApi::LdsUpdate::FilterChainMap filter_chain_map_;
- const absl::optional<XdsApi::LdsUpdate::FilterChainData>
- default_filter_chain_;
+ // Helper functions invoked by RouteConfigWatcher when there are updates to
+ // RDS resources.
+ void OnRouteConfigChanged(const std::string& resource_name,
+ XdsRouteConfigResource route_config);
+ void OnError(const std::string& resource_name, absl::Status status);
+ void OnResourceDoesNotExist(const std::string& resource_name);
+
+ RefCountedPtr<XdsClient> xds_client_;
+ // This ref is only kept around till the FilterChainMatchManager becomes
+ // ready.
+ RefCountedPtr<ListenerWatcher> listener_watcher_;
+ XdsListenerResource::FilterChainMap filter_chain_map_;
+ absl::optional<XdsListenerResource::FilterChainData> default_filter_chain_;
Mutex mu_;
- std::map<const XdsApi::LdsUpdate::FilterChainData*, CertificateProviders>
+ size_t rds_resources_yet_to_fetch_ ABSL_GUARDED_BY(mu_) = 0;
+ std::map<std::string /* resource_name */, RdsUpdateState> rds_map_
+ ABSL_GUARDED_BY(mu_);
+ std::map<const XdsListenerResource::FilterChainData*, CertificateProviders>
certificate_providers_map_ ABSL_GUARDED_BY(mu_);
};
-bool IsLoopbackIp(const grpc_resolved_address* address) {
- const grpc_sockaddr* sock_addr =
- reinterpret_cast<const grpc_sockaddr*>(&address->addr);
- if (sock_addr->sa_family == GRPC_AF_INET) {
- const grpc_sockaddr_in* addr4 =
- reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
- if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
- return true;
+// A watcher implementation for listening on RDS updates referenced to by a
+// FilterChainMatchManager object. After all referenced RDS resources are
+// fetched (errors are allowed), the FilterChainMatchManager tries to replace
+// the current object. The watcher continues to update the referenced RDS
+// resources so that new XdsServerConfigSelectorProvider objects are created
+// with the latest updates and new connections do not need to wait for the RDS
+// resources to be fetched.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ RouteConfigWatcher : public XdsRouteConfigResourceType::WatcherInterface {
+ public:
+ RouteConfigWatcher(
+ std::string resource_name,
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager)
+ : resource_name_(std::move(resource_name)),
+ filter_chain_match_manager_(std::move(filter_chain_match_manager)) {}
+
+ void OnResourceChanged(XdsRouteConfigResource route_config) override {
+ filter_chain_match_manager_->OnRouteConfigChanged(resource_name_,
+ std::move(route_config));
+ }
+
+ void OnError(absl::Status status) override {
+ filter_chain_match_manager_->OnError(resource_name_, status);
+ }
+
+ void OnResourceDoesNotExist() override {
+ filter_chain_match_manager_->OnResourceDoesNotExist(resource_name_);
+ }
+
+ private:
+ std::string resource_name_;
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
+};
+
+// An implementation of ServerConfigSelector used by
+// StaticXdsServerConfigSelectorProvider and
+// DynamicXdsServerConfigSelectorProvider to parse the RDS update and get
+// per-call configuration based on incoming metadata.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ XdsServerConfigSelector : public ServerConfigSelector {
+ public:
+ static absl::StatusOr<RefCountedPtr<XdsServerConfigSelector>> Create(
+ XdsRouteConfigResource rds_update,
+ const std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>&
+ http_filters);
+ ~XdsServerConfigSelector() override = default;
+
+ CallConfig GetCallConfig(grpc_metadata_batch* metadata) override;
+
+ private:
+ struct VirtualHost {
+ struct Route {
+ // true if an action other than kNonForwardingAction is configured.
+ bool unsupported_action;
+ XdsRouteConfigResource::Route::Matchers matchers;
+ RefCountedPtr<ServiceConfig> method_config;
+ };
+
+ class RouteListIterator : public XdsRouting::RouteListIterator {
+ public:
+ explicit RouteListIterator(const std::vector<Route>* routes)
+ : routes_(routes) {}
+
+ size_t Size() const override { return routes_->size(); }
+
+ const XdsRouteConfigResource::Route::Matchers& GetMatchersForRoute(
+ size_t index) const override {
+ return (*routes_)[index].matchers;
+ }
+
+ private:
+ const std::vector<Route>* routes_;
+ };
+
+ std::vector<std::string> domains;
+ std::vector<Route> routes;
+ };
+
+ class VirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
+ public:
+ explicit VirtualHostListIterator(
+ const std::vector<VirtualHost>* virtual_hosts)
+ : virtual_hosts_(virtual_hosts) {}
+
+ size_t Size() const override { return virtual_hosts_->size(); }
+
+ const std::vector<std::string>& GetDomainsForVirtualHost(
+ size_t index) const override {
+ return (*virtual_hosts_)[index].domains;
}
- } else if (sock_addr->sa_family == GRPC_AF_INET6) {
- const grpc_sockaddr_in6* addr6 =
- reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
- if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
- sizeof(in6addr_loopback)) == 0) {
- return true;
+
+ private:
+ const std::vector<VirtualHost>* virtual_hosts_;
+ };
+
+ std::vector<VirtualHost> virtual_hosts_;
+};
+
+// An XdsServerConfigSelectorProvider implementation for when the
+// RouteConfiguration is available inline.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ StaticXdsServerConfigSelectorProvider
+ : public ServerConfigSelectorProvider {
+ public:
+ StaticXdsServerConfigSelectorProvider(
+ absl::StatusOr<XdsRouteConfigResource> static_resource,
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
+ http_filters)
+ : static_resource_(std::move(static_resource)),
+ http_filters_(std::move(http_filters)) {}
+
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) override {
+ GPR_ASSERT(watcher_ == nullptr);
+ watcher_ = std::move(watcher);
+ if (!static_resource_.ok()) {
+ return static_resource_.status();
}
+ return XdsServerConfigSelector::Create(static_resource_.value(),
+ http_filters_);
}
- return false;
+
+ void Orphan() override {}
+
+ void CancelWatch() override { watcher_.reset(); }
+
+ private:
+ absl::StatusOr<XdsRouteConfigResource> static_resource_;
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
+ http_filters_;
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher_;
+};
+
+// An XdsServerConfigSelectorProvider implementation for when the
+// RouteConfiguration is to be fetched separately via RDS.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider
+ : public ServerConfigSelectorProvider {
+ public:
+ DynamicXdsServerConfigSelectorProvider(
+ RefCountedPtr<XdsClient> xds_client, std::string resource_name,
+ absl::StatusOr<XdsRouteConfigResource> initial_resource,
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
+ http_filters);
+
+ void Orphan() override;
+
+ absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) override;
+ void CancelWatch() override;
+
+ private:
+ class RouteConfigWatcher;
+
+ void OnRouteConfigChanged(XdsRouteConfigResource rds_update);
+ void OnError(absl::Status status);
+ void OnResourceDoesNotExist();
+
+ RefCountedPtr<XdsClient> xds_client_;
+ std::string resource_name_;
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
+ http_filters_;
+ RouteConfigWatcher* route_config_watcher_ = nullptr;
+ Mutex mu_;
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher_ ABSL_GUARDED_BY(mu_);
+ absl::StatusOr<XdsRouteConfigResource> resource_ ABSL_GUARDED_BY(mu_);
+};
+
+// A watcher implementation for updating the RDS resource used by
+// DynamicXdsServerConfigSelectorProvider
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher
+ : public XdsRouteConfigResourceType::WatcherInterface {
+ public:
+ explicit RouteConfigWatcher(
+ WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent)
+ : parent_(std::move(parent)) {}
+
+ void OnResourceChanged(XdsRouteConfigResource route_config) override {
+ parent_->OnRouteConfigChanged(std::move(route_config));
+ }
+
+ void OnError(absl::Status status) override { parent_->OnError(status); }
+
+ void OnResourceDoesNotExist() override { parent_->OnResourceDoesNotExist(); }
+
+ private:
+ WeakRefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent_;
+};
+
+//
+// XdsServerConfigFetcher
+//
+
+XdsServerConfigFetcher::XdsServerConfigFetcher(
+ RefCountedPtr<XdsClient> xds_client,
+ grpc_server_xds_status_notifier notifier)
+ : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
+ GPR_ASSERT(xds_client_ != nullptr);
+}
+
+std::string ListenerResourceName(absl::string_view resource_name_template,
+ absl::string_view listening_address) {
+ std::string tmp;
+ if (absl::StartsWith(resource_name_template, "xdstp:")) {
+ tmp = URI::PercentEncodePath(listening_address);
+ listening_address = tmp;
+ }
+ return absl::StrReplaceAll(resource_name_template,
+ {{"%s", listening_address}});
+}
+
+void XdsServerConfigFetcher::StartWatch(
+ std::string listening_address,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface> watcher) {
+ grpc_server_config_fetcher::WatcherInterface* watcher_ptr = watcher.get();
+ auto listener_watcher = MakeRefCounted<ListenerWatcher>(
+ xds_client_, std::move(watcher), serving_status_notifier_,
+ listening_address);
+ auto* listener_watcher_ptr = listener_watcher.get();
+ XdsListenerResourceType::StartWatch(
+ xds_client_.get(),
+ ListenerResourceName(
+ xds_client_->bootstrap().server_listener_resource_name_template(),
+ listening_address),
+ std::move(listener_watcher));
+ MutexLock lock(&mu_);
+ listener_watchers_.emplace(watcher_ptr, listener_watcher_ptr);
+}
+
+void XdsServerConfigFetcher::CancelWatch(
+ grpc_server_config_fetcher::WatcherInterface* watcher) {
+ MutexLock lock(&mu_);
+ auto it = listener_watchers_.find(watcher);
+ if (it != listener_watchers_.end()) {
+ // Cancel the watch on the listener before erasing
+ XdsListenerResourceType::CancelWatch(
+ xds_client_.get(),
+ ListenerResourceName(
+ xds_client_->bootstrap().server_listener_resource_name_template(),
+ it->second->listening_address()),
+ it->second, false /* delay_unsubscription */);
+ listener_watchers_.erase(it);
+ }
+}
+
+//
+// XdsServerConfigFetcher::ListenerWatcher
+//
+
+XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher(
+ RefCountedPtr<XdsClient> xds_client,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher,
+ grpc_server_xds_status_notifier serving_status_notifier,
+ std::string listening_address)
+ : xds_client_(std::move(xds_client)),
+ server_config_watcher_(std::move(server_config_watcher)),
+ serving_status_notifier_(serving_status_notifier),
+ listening_address_(std::move(listening_address)) {}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged(
+ XdsListenerResource listener) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_server_config_fetcher_trace)) {
+ gpr_log(GPR_INFO,
+ "[ListenerWatcher %p] Received LDS update from xds client %p: %s",
+ this, xds_client_.get(), listener.ToString().c_str());
+ }
+ if (listener.address != listening_address_) {
+ MutexLock lock(&mu_);
+ OnFatalError(absl::FailedPreconditionError(
+ "Address in LDS update does not match listening address"));
+ return;
+ }
+ auto new_filter_chain_match_manager = MakeRefCounted<FilterChainMatchManager>(
+ xds_client_, std::move(listener.filter_chain_map),
+ std::move(listener.default_filter_chain));
+ MutexLock lock(&mu_);
+ if (filter_chain_match_manager_ == nullptr ||
+ !(new_filter_chain_match_manager->filter_chain_map() ==
+ filter_chain_match_manager_->filter_chain_map() &&
+ new_filter_chain_match_manager->default_filter_chain() ==
+ filter_chain_match_manager_->default_filter_chain())) {
+ pending_filter_chain_match_manager_ =
+ std::move(new_filter_chain_match_manager);
+ if (XdsRbacEnabled()) {
+ pending_filter_chain_match_manager_->StartRdsWatch(Ref());
+ } else {
+ PendingFilterChainMatchManagerReadyLocked(
+ pending_filter_chain_match_manager_.get());
+ }
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnError(absl::Status status) {
+ MutexLock lock(&mu_);
+ if (filter_chain_match_manager_ != nullptr ||
+ pending_filter_chain_match_manager_ != nullptr) {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p XdsClient reports error: %s for %s; "
+ "ignoring in favor of existing resource",
+ this, status.ToString().c_str(), listening_address_.c_str());
+ } else {
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {GRPC_STATUS_UNAVAILABLE, status.ToString().c_str()});
+ } else {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
+ "not serving on %s",
+ this, status.ToString().c_str(), listening_address_.c_str());
+ }
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
+ absl::Status status) {
+ pending_filter_chain_match_manager_.reset();
+ if (filter_chain_match_manager_ != nullptr) {
+ // The server has started listening already, so we need to gracefully
+ // stop serving.
+ server_config_watcher_->StopServing();
+ filter_chain_match_manager_.reset();
+ }
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {static_cast<grpc_status_code>(status.raw_code()),
+ std::string(status.message()).c_str()});
+ } else {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
+ this, status.ToString().c_str(), listening_address_.c_str());
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnResourceDoesNotExist() {
+ MutexLock lock(&mu_);
+ OnFatalError(absl::NotFoundError("Requested listener does not exist"));
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::
+ PendingFilterChainMatchManagerReadyLocked(
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager*
+ filter_chain_match_manager) {
+ if (pending_filter_chain_match_manager_ != filter_chain_match_manager) {
+ // This FilterChainMatchManager is no longer the current pending resource.
+ // It should get cleaned up eventually. Ignore this update.
+ return;
+ }
+ // Let the logger know about the update if there was no previous good update.
+ if (filter_chain_match_manager_ == nullptr) {
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {GRPC_STATUS_OK, ""});
+ } else {
+ gpr_log(GPR_INFO,
+ "xDS Listener resource obtained; will start serving on %s",
+ listening_address_.c_str());
+ }
+ }
+ // Promote the pending FilterChainMatchManager
+ filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
+ // TODO(yashykt): Right now, the server_config_watcher_ does not invoke
+ // XdsServerConfigFetcher while holding a lock, but that might change in the
+ // future in which case we would want to execute this update outside the
+ // critical region through a WorkSerializer similar to XdsClient.
+ server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
+}
+
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
+//
+
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ FilterChainMatchManager(
+ RefCountedPtr<XdsClient> xds_client,
+ XdsListenerResource::FilterChainMap filter_chain_map,
+ absl::optional<XdsListenerResource::FilterChainData>
+ default_filter_chain)
+ : xds_client_(std::move(xds_client)),
+ filter_chain_map_(std::move(filter_chain_map)),
+ default_filter_chain_(std::move(default_filter_chain)) {}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher) {
+ // Get the set of RDS resources to watch on. Also get the set of
+ // FilterChainData so that we can reverse the list of HTTP filters since
+ // received data moves *up* the stack in Core.
+ std::set<std::string> resource_names;
+ std::set<XdsListenerResource::FilterChainData*> filter_chain_data_set;
+ for (const auto& destination_ip : filter_chain_map_.destination_ip_vector) {
+ for (const auto& source_type : destination_ip.source_types_array) {
+ for (const auto& source_ip : source_type) {
+ for (const auto& source_port_pair : source_ip.ports_map) {
+ if (!source_port_pair.second.data->http_connection_manager
+ .route_config_name.empty()) {
+ resource_names.insert(
+ source_port_pair.second.data->http_connection_manager
+ .route_config_name);
+ }
+ filter_chain_data_set.insert(source_port_pair.second.data.get());
+ }
+ }
+ }
+ }
+ if (default_filter_chain_.has_value()) {
+ if (!default_filter_chain_->http_connection_manager.route_config_name
+ .empty()) {
+ resource_names.insert(
+ default_filter_chain_->http_connection_manager.route_config_name);
+ }
+ std::reverse(
+ default_filter_chain_->http_connection_manager.http_filters.begin(),
+ default_filter_chain_->http_connection_manager.http_filters.end());
+ }
+ // Reverse the lists of HTTP filters in all the filter chains
+ for (auto* filter_chain_data : filter_chain_data_set) {
+ std::reverse(
+ filter_chain_data->http_connection_manager.http_filters.begin(),
+ filter_chain_data->http_connection_manager.http_filters.end());
+ }
+ // Start watching on referenced RDS resources
+ struct WatcherToStart {
+ std::string resource_name;
+ RefCountedPtr<RouteConfigWatcher> watcher;
+ };
+ std::vector<WatcherToStart> watchers_to_start;
+ watchers_to_start.reserve(resource_names.size());
+ {
+ MutexLock lock(&mu_);
+ for (const auto& resource_name : resource_names) {
+ ++rds_resources_yet_to_fetch_;
+ auto route_config_watcher =
+ MakeRefCounted<RouteConfigWatcher>(resource_name, WeakRef());
+ rds_map_.emplace(resource_name, RdsUpdateState{route_config_watcher.get(),
+ absl::nullopt});
+ watchers_to_start.push_back(
+ WatcherToStart{resource_name, std::move(route_config_watcher)});
+ }
+ if (rds_resources_yet_to_fetch_ != 0) {
+ listener_watcher_ = std::move(listener_watcher);
+ listener_watcher = nullptr;
+ }
+ }
+ for (auto& watcher_to_start : watchers_to_start) {
+ XdsRouteConfigResourceType::StartWatch(xds_client_.get(),
+ watcher_to_start.resource_name,
+ std::move(watcher_to_start.watcher));
+ }
+ // Promote this filter chain match manager if all referenced resources are
+ // fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReadyLocked(this);
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ Orphan() {
+ MutexLock lock(&mu_);
+ // Cancel the RDS watches to clear up the weak refs
+ for (const auto& entry : rds_map_) {
+ XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), entry.first,
+ entry.second.watcher,
+ false /* delay_unsubscription */);
+ }
+ // Also give up the ref on ListenerWatcher since it won't be needed anymore
+ listener_watcher_.reset();
+}
+
+absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ CreateOrGetXdsCertificateProviderFromFilterChainData(
+ const XdsListenerResource::FilterChainData* filter_chain) {
+ MutexLock lock(&mu_);
+ auto it = certificate_providers_map_.find(filter_chain);
+ if (it != certificate_providers_map_.end()) {
+ return it->second.xds;
+ }
+ CertificateProviders certificate_providers;
+ // Configure root cert.
+ absl::string_view root_provider_instance_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .certificate_validation_context.ca_certificate_provider_instance
+ .instance_name;
+ absl::string_view root_provider_cert_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .certificate_validation_context.ca_certificate_provider_instance
+ .certificate_name;
+ if (!root_provider_instance_name.empty()) {
+ certificate_providers.root =
+ xds_client_->certificate_provider_store()
+ .CreateOrGetCertificateProvider(root_provider_instance_name);
+ if (certificate_providers.root == nullptr) {
+ return absl::NotFoundError(
+ absl::StrCat("Certificate provider instance name: \"",
+ root_provider_instance_name, "\" not recognized."));
+ }
+ }
+ // Configure identity cert.
+ absl::string_view identity_provider_instance_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .tls_certificate_provider_instance.instance_name;
+ absl::string_view identity_provider_cert_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .tls_certificate_provider_instance.certificate_name;
+ if (!identity_provider_instance_name.empty()) {
+ certificate_providers.instance =
+ xds_client_->certificate_provider_store()
+ .CreateOrGetCertificateProvider(identity_provider_instance_name);
+ if (certificate_providers.instance == nullptr) {
+ return absl::NotFoundError(
+ absl::StrCat("Certificate provider instance name: \"",
+ identity_provider_instance_name, "\" not recognized."));
+ }
+ }
+ certificate_providers.xds = MakeRefCounted<XdsCertificateProvider>();
+ certificate_providers.xds->UpdateRootCertNameAndDistributor(
+ "", root_provider_cert_name,
+ certificate_providers.root == nullptr
+ ? nullptr
+ : certificate_providers.root->distributor());
+ certificate_providers.xds->UpdateIdentityCertNameAndDistributor(
+ "", identity_provider_cert_name,
+ certificate_providers.instance == nullptr
+ ? nullptr
+ : certificate_providers.instance->distributor());
+ certificate_providers.xds->UpdateRequireClientCertificate(
+ "", filter_chain->downstream_tls_context.require_client_certificate);
+ auto xds_certificate_provider = certificate_providers.xds;
+ certificate_providers_map_.emplace(filter_chain,
+ std::move(certificate_providers));
+ return xds_certificate_provider;
}
-const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourcePort(
- const XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap& source_ports_map,
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ OnRouteConfigChanged(const std::string& resource_name,
+ XdsRouteConfigResource route_config) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ }
+ state.rds_update = std::move(route_config);
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::OnError(
+ const std::string& resource_name, absl::Status status) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ state.rds_update = status;
+ } else {
+ // Prefer existing good version over current errored version
+ if (!state.rds_update->ok()) {
+ state.rds_update = status;
+ }
+ }
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ OnResourceDoesNotExist(const std::string& resource_name) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ }
+ state.rds_update =
+ absl::NotFoundError("Requested route config does not exist");
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
+ }
+}
+
+const XdsListenerResource::FilterChainData* FindFilterChainDataForSourcePort(
+ const XdsListenerResource::FilterChainMap::SourcePortsMap& source_ports_map,
absl::string_view port_str) {
int port = 0;
if (!absl::SimpleAtoi(port_str, &port)) return nullptr;
@@ -122,10 +837,10 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourcePort(
return nullptr;
}
-const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceIp(
- const XdsApi::LdsUpdate::FilterChainMap::SourceIpVector& source_ip_vector,
+const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceIp(
+ const XdsListenerResource::FilterChainMap::SourceIpVector& source_ip_vector,
const grpc_resolved_address* source_ip, absl::string_view port) {
- const XdsApi::LdsUpdate::FilterChainMap::SourceIp* best_match = nullptr;
+ const XdsListenerResource::FilterChainMap::SourceIp* best_match = nullptr;
for (const auto& entry : source_ip_vector) {
// Special case for catch-all
if (!entry.prefix_range.has_value()) {
@@ -148,8 +863,28 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceIp(
return FindFilterChainDataForSourcePort(best_match->ports_map, port);
}
-const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceType(
- const XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceTypesArray&
+bool IsLoopbackIp(const grpc_resolved_address* address) {
+ const grpc_sockaddr* sock_addr =
+ reinterpret_cast<const grpc_sockaddr*>(&address->addr);
+ if (sock_addr->sa_family == GRPC_AF_INET) {
+ const grpc_sockaddr_in* addr4 =
+ reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
+ if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
+ return true;
+ }
+ } else if (sock_addr->sa_family == GRPC_AF_INET6) {
+ const grpc_sockaddr_in6* addr6 =
+ reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
+ if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
+ sizeof(in6addr_loopback)) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
+const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceType(
+ const XdsListenerResource::FilterChainMap::ConnectionSourceTypesArray&
source_types_array,
grpc_endpoint* tcp, absl::string_view destination_ip) {
auto source_uri = URI::Parse(grpc_endpoint_get_peer(tcp));
@@ -173,34 +908,34 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceType(
}
// Use kAny only if kSameIporLoopback and kExternal are empty
if (source_types_array[static_cast<int>(
- XdsApi::LdsUpdate::FilterChainMap::
+ XdsListenerResource::FilterChainMap::
ConnectionSourceType::kSameIpOrLoopback)]
.empty() &&
- source_types_array[static_cast<int>(XdsApi::LdsUpdate::FilterChainMap::
+ source_types_array[static_cast<int>(XdsListenerResource::FilterChainMap::
ConnectionSourceType::kExternal)]
.empty()) {
return FindFilterChainDataForSourceIp(
source_types_array[static_cast<int>(
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType::kAny)],
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::kAny)],
&source_addr, port);
}
if (IsLoopbackIp(&source_addr) || host == destination_ip) {
return FindFilterChainDataForSourceIp(
source_types_array[static_cast<int>(
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType::
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::
kSameIpOrLoopback)],
&source_addr, port);
} else {
return FindFilterChainDataForSourceIp(
source_types_array[static_cast<int>(
- XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceType::
+ XdsListenerResource::FilterChainMap::ConnectionSourceType::
kExternal)],
&source_addr, port);
}
}
-const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForDestinationIp(
- const XdsApi::LdsUpdate::FilterChainMap::DestinationIpVector
+const XdsListenerResource::FilterChainData* FindFilterChainDataForDestinationIp(
+ const XdsListenerResource::FilterChainMap::DestinationIpVector
destination_ip_vector,
grpc_endpoint* tcp) {
auto destination_uri = URI::Parse(grpc_endpoint_get_local_address(tcp));
@@ -222,7 +957,8 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForDestinationIp(
GRPC_ERROR_UNREF(error);
return nullptr;
}
- const XdsApi::LdsUpdate::FilterChainMap::DestinationIp* best_match = nullptr;
+ const XdsListenerResource::FilterChainMap::DestinationIp* best_match =
+ nullptr;
for (const auto& entry : destination_ip_vector) {
// Special case for catch-all
if (!entry.prefix_range.has_value()) {
@@ -247,73 +983,9 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForDestinationIp(
host);
}
-absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
-FilterChainMatchManager::CreateOrGetXdsCertificateProviderFromFilterChainData(
- const XdsApi::LdsUpdate::FilterChainData* filter_chain) {
- MutexLock lock(&mu_);
- auto it = certificate_providers_map_.find(filter_chain);
- if (it != certificate_providers_map_.end()) {
- return it->second.xds;
- }
- CertificateProviders certificate_providers;
- // Configure root cert.
- absl::string_view root_provider_instance_name =
- filter_chain->downstream_tls_context.common_tls_context
- .combined_validation_context
- .validation_context_certificate_provider_instance.instance_name;
- absl::string_view root_provider_cert_name =
- filter_chain->downstream_tls_context.common_tls_context
- .combined_validation_context
- .validation_context_certificate_provider_instance.certificate_name;
- if (!root_provider_instance_name.empty()) {
- certificate_providers.root =
- xds_client_->certificate_provider_store()
- .CreateOrGetCertificateProvider(root_provider_instance_name);
- if (certificate_providers.root == nullptr) {
- return absl::NotFoundError(
- absl::StrCat("Certificate provider instance name: \"",
- root_provider_instance_name, "\" not recognized."));
- }
- }
- // Configure identity cert.
- absl::string_view identity_provider_instance_name =
- filter_chain->downstream_tls_context.common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name;
- absl::string_view identity_provider_cert_name =
- filter_chain->downstream_tls_context.common_tls_context
- .tls_certificate_certificate_provider_instance.certificate_name;
- if (!identity_provider_instance_name.empty()) {
- certificate_providers.instance =
- xds_client_->certificate_provider_store()
- .CreateOrGetCertificateProvider(identity_provider_instance_name);
- if (certificate_providers.instance == nullptr) {
- return absl::NotFoundError(
- absl::StrCat("Certificate provider instance name: \"",
- identity_provider_instance_name, "\" not recognized."));
- }
- }
- certificate_providers.xds = MakeRefCounted<XdsCertificateProvider>();
- certificate_providers.xds->UpdateRootCertNameAndDistributor(
- "", root_provider_cert_name,
- certificate_providers.root == nullptr
- ? nullptr
- : certificate_providers.root->distributor());
- certificate_providers.xds->UpdateIdentityCertNameAndDistributor(
- "", identity_provider_cert_name,
- certificate_providers.instance == nullptr
- ? nullptr
- : certificate_providers.instance->distributor());
- certificate_providers.xds->UpdateRequireClientCertificate(
- "", filter_chain->downstream_tls_context.require_client_certificate);
- auto xds_certificate_provider = certificate_providers.xds;
- certificate_providers_map_.emplace(filter_chain,
- std::move(certificate_providers));
- return xds_certificate_provider;
-}
-
-absl::StatusOr<grpc_channel_args*>
-FilterChainMatchManager::UpdateChannelArgsForConnection(grpc_channel_args* args,
- grpc_endpoint* tcp) {
+absl::StatusOr<grpc_channel_args*> XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::UpdateChannelArgsForConnection(
+ grpc_channel_args* args, grpc_endpoint* tcp) {
const auto* filter_chain = FindFilterChainDataForDestinationIp(
filter_chain_map_.destination_ip_vector, tcp);
if (filter_chain == nullptr && default_filter_chain_.has_value()) {
@@ -323,199 +995,288 @@ FilterChainMatchManager::UpdateChannelArgsForConnection(grpc_channel_args* args,
grpc_channel_args_destroy(args);
return absl::UnavailableError("No matching filter chain found");
}
- // Nothing to update if credentials are not xDS.
+ absl::InlinedVector<grpc_arg, 3> args_to_add;
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider;
+ RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier;
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider;
+ // Add config selector filter
+ if (XdsRbacEnabled()) {
+ std::vector<const grpc_channel_filter*> filters;
+ // Iterate the list of HTTP filters in reverse since in Core, received data
+ // flows *up* the stack.
+ for (const auto& http_filter :
+ filter_chain->http_connection_manager.http_filters) {
+ // Find filter. This is guaranteed to succeed, because it's checked
+ // at config validation time in the XdsApi code.
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ http_filter.config.config_proto_type_name);
+ GPR_ASSERT(filter_impl != nullptr);
+ // Some filters like the router filter are no-op filters and do not have
+ // an implementation.
+ if (filter_impl->channel_filter() != nullptr) {
+ filters.push_back(filter_impl->channel_filter());
+ }
+ }
+ filters.push_back(&kServerConfigSelectorFilter);
+ channel_stack_modifier =
+ MakeRefCounted<XdsChannelStackModifier>(std::move(filters));
+ if (filter_chain->http_connection_manager.rds_update.has_value()) {
+ server_config_selector_provider =
+ MakeRefCounted<StaticXdsServerConfigSelectorProvider>(
+ filter_chain->http_connection_manager.rds_update.value(),
+ filter_chain->http_connection_manager.http_filters);
+ } else {
+ absl::StatusOr<XdsRouteConfigResource> initial_resource;
+ {
+ MutexLock lock(&mu_);
+ initial_resource =
+ rds_map_[filter_chain->http_connection_manager.route_config_name]
+ .rds_update.value();
+ }
+ server_config_selector_provider =
+ MakeRefCounted<DynamicXdsServerConfigSelectorProvider>(
+ xds_client_,
+ filter_chain->http_connection_manager.route_config_name,
+ std::move(initial_resource),
+ filter_chain->http_connection_manager.http_filters);
+ }
+ args_to_add.emplace_back(server_config_selector_provider->MakeChannelArg());
+ args_to_add.emplace_back(channel_stack_modifier->MakeChannelArg());
+ }
+ // Add XdsCertificateProvider if credentials are xDS.
grpc_server_credentials* server_creds =
grpc_find_server_credentials_in_args(args);
- if (server_creds == nullptr || server_creds->type() != kCredentialsTypeXds) {
- return args;
+ if (server_creds != nullptr &&
+ server_creds->type() == XdsServerCredentials::Type()) {
+ absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
+ CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
+ if (!result.ok()) {
+ grpc_channel_args_destroy(args);
+ return result.status();
+ }
+ xds_certificate_provider = std::move(*result);
+ GPR_ASSERT(xds_certificate_provider != nullptr);
+ args_to_add.emplace_back(xds_certificate_provider->MakeChannelArg());
}
- absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
- CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
- if (!result.ok()) {
+ if (!args_to_add.empty()) {
+ grpc_channel_args* updated_args = grpc_channel_args_copy_and_add(
+ args, args_to_add.data(), args_to_add.size());
grpc_channel_args_destroy(args);
- return result.status();
- }
- RefCountedPtr<XdsCertificateProvider> xds_certificate_provider =
- std::move(*result);
- GPR_ASSERT(xds_certificate_provider != nullptr);
- grpc_arg arg_to_add = xds_certificate_provider->MakeChannelArg();
- grpc_channel_args* updated_args =
- grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
- grpc_channel_args_destroy(args);
- return updated_args;
+ args = updated_args;
+ }
+ return args;
}
-class XdsServerConfigFetcher : public grpc_server_config_fetcher {
- public:
- explicit XdsServerConfigFetcher(RefCountedPtr<XdsClient> xds_client,
- grpc_server_xds_status_notifier notifier)
- : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
- GPR_ASSERT(xds_client_ != nullptr);
- }
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::XdsServerConfigSelector
+//
- void StartWatch(std::string listening_address, grpc_channel_args* args,
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- watcher) override {
- grpc_server_config_fetcher::WatcherInterface* watcher_ptr = watcher.get();
- auto listener_watcher = absl::make_unique<ListenerWatcher>(
- std::move(watcher), args, xds_client_, serving_status_notifier_,
- listening_address);
- auto* listener_watcher_ptr = listener_watcher.get();
- listening_address = absl::StrReplaceAll(
- xds_client_->bootstrap().server_listener_resource_name_template(),
- {{"%s", listening_address}});
- xds_client_->WatchListenerData(listening_address,
- std::move(listener_watcher));
- MutexLock lock(&mu_);
- auto& watcher_state = watchers_[watcher_ptr];
- watcher_state.listening_address = listening_address;
- watcher_state.listener_watcher = listener_watcher_ptr;
+absl::StatusOr<
+ RefCountedPtr<XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::XdsServerConfigSelector>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ XdsServerConfigSelector::Create(
+ XdsRouteConfigResource rds_update,
+ const std::vector<
+ XdsListenerResource::HttpConnectionManager::HttpFilter>&
+ http_filters) {
+ auto config_selector = MakeRefCounted<XdsServerConfigSelector>();
+ for (auto& vhost : rds_update.virtual_hosts) {
+ config_selector->virtual_hosts_.emplace_back();
+ auto& virtual_host = config_selector->virtual_hosts_.back();
+ virtual_host.domains = std::move(vhost.domains);
+ for (auto& route : vhost.routes) {
+ virtual_host.routes.emplace_back();
+ auto& config_selector_route = virtual_host.routes.back();
+ config_selector_route.matchers = std::move(route.matchers);
+ config_selector_route.unsupported_action =
+ absl::get_if<XdsRouteConfigResource::Route::NonForwardingAction>(
+ &route.action) == nullptr;
+ XdsRouting::GeneratePerHttpFilterConfigsResult result =
+ XdsRouting::GeneratePerHTTPFilterConfigs(http_filters, vhost, route,
+ nullptr, nullptr);
+ if (result.error != GRPC_ERROR_NONE) {
+ return grpc_error_to_absl_status(result.error);
+ }
+ std::vector<std::string> fields;
+ fields.reserve(result.per_filter_configs.size());
+ for (const auto& p : result.per_filter_configs) {
+ fields.emplace_back(absl::StrCat(" \"", p.first, "\": [\n",
+ absl::StrJoin(p.second, ",\n"),
+ "\n ]"));
+ }
+ if (!fields.empty()) {
+ std::string json = absl::StrCat(
+ "{\n"
+ " \"methodConfig\": [ {\n"
+ " \"name\": [\n"
+ " {}\n"
+ " ],\n"
+ " ",
+ absl::StrJoin(fields, ",\n"),
+ "\n } ]\n"
+ "}");
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ config_selector_route.method_config =
+ ServiceConfigImpl::Create(result.args, json.c_str(), &error);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ }
+ grpc_channel_args_destroy(result.args);
+ }
}
+ return config_selector;
+}
- void CancelWatch(
- grpc_server_config_fetcher::WatcherInterface* watcher) override {
- MutexLock lock(&mu_);
- auto it = watchers_.find(watcher);
- if (it != watchers_.end()) {
- // Cancel the watch on the listener before erasing
- xds_client_->CancelListenerDataWatch(it->second.listening_address,
- it->second.listener_watcher,
- false /* delay_unsubscription */);
- watchers_.erase(it);
+ServerConfigSelector::CallConfig XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::XdsServerConfigSelector::GetCallConfig(
+ grpc_metadata_batch* metadata) {
+ CallConfig call_config;
+ if (metadata->get_pointer(HttpPathMetadata()) == nullptr) {
+ call_config.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("No path found");
+ return call_config;
+ }
+ absl::string_view path =
+ metadata->get_pointer(HttpPathMetadata())->as_string_view();
+ if (metadata->get_pointer(HttpAuthorityMetadata()) == nullptr) {
+ call_config.error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No authority found");
+ return call_config;
+ }
+ absl::string_view authority =
+ metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
+ auto vhost_index = XdsRouting::FindVirtualHostForDomain(
+ VirtualHostListIterator(&virtual_hosts_), authority);
+ if (!vhost_index.has_value()) {
+ call_config.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "could not find VirtualHost for ", authority,
+ " in RouteConfiguration")),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+ }
+ auto& virtual_host = virtual_hosts_[vhost_index.value()];
+ auto route_index = XdsRouting::GetRouteForRequest(
+ VirtualHost::RouteListIterator(&virtual_host.routes), path, metadata);
+ if (route_index.has_value()) {
+ auto& route = virtual_host.routes[route_index.value()];
+ // Found the matching route
+ if (route.unsupported_action) {
+ call_config.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Matching route has unsupported action"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+ }
+ if (route.method_config != nullptr) {
+ call_config.method_configs =
+ route.method_config->GetMethodParsedConfigVector(grpc_empty_slice());
+ call_config.service_config = route.method_config;
}
+ return call_config;
}
+ call_config.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No route matched"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+}
- // Return the interested parties from the xds client so that it can be polled.
- grpc_pollset_set* interested_parties() override {
- return xds_client_->interested_parties();
- }
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::DynamicXdsServerConfigSelectorProvider
+//
- private:
- class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
- public:
- explicit ListenerWatcher(
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- server_config_watcher,
- grpc_channel_args* args, RefCountedPtr<XdsClient> xds_client,
- grpc_server_xds_status_notifier serving_status_notifier,
- std::string listening_address)
- : server_config_watcher_(std::move(server_config_watcher)),
- args_(args),
- xds_client_(std::move(xds_client)),
- serving_status_notifier_(serving_status_notifier),
- listening_address_(std::move(listening_address)) {}
-
- ~ListenerWatcher() override { grpc_channel_args_destroy(args_); }
-
- // Deleted due to special handling required for args_. Copy the channel args
- // if we ever need these.
- ListenerWatcher(const ListenerWatcher&) = delete;
- ListenerWatcher& operator=(const ListenerWatcher&) = delete;
-
- void OnListenerChanged(XdsApi::LdsUpdate listener) override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_server_config_fetcher_trace)) {
- gpr_log(
- GPR_INFO,
- "[ListenerWatcher %p] Received LDS update from xds client %p: %s",
- this, xds_client_.get(), listener.ToString().c_str());
- }
- if (listener.address != listening_address_) {
- OnFatalError(absl::FailedPreconditionError(
- "Address in LDS update does not match listening address"));
- return;
- }
- if (filter_chain_match_manager_ == nullptr) {
- if (serving_status_notifier_.on_serving_status_update != nullptr) {
- serving_status_notifier_.on_serving_status_update(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- GRPC_STATUS_OK, "");
- } else {
- gpr_log(GPR_INFO,
- "xDS Listener resource obtained; will start serving on %s",
- listening_address_.c_str());
- }
- }
- if (filter_chain_match_manager_ == nullptr ||
- !(listener.filter_chain_map ==
- filter_chain_match_manager_->filter_chain_map() &&
- listener.default_filter_chain ==
- filter_chain_match_manager_->default_filter_chain())) {
- filter_chain_match_manager_ = MakeRefCounted<FilterChainMatchManager>(
- xds_client_, std::move(listener.filter_chain_map),
- std::move(listener.default_filter_chain));
- server_config_watcher_->UpdateConnectionManager(
- filter_chain_match_manager_);
- }
- }
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::
+ DynamicXdsServerConfigSelectorProvider(
+ RefCountedPtr<XdsClient> xds_client, std::string resource_name,
+ absl::StatusOr<XdsRouteConfigResource> initial_resource,
+ std::vector<XdsListenerResource::HttpConnectionManager::HttpFilter>
+ http_filters)
+ : xds_client_(std::move(xds_client)),
+ resource_name_(std::move(resource_name)),
+ http_filters_(std::move(http_filters)),
+ resource_(std::move(initial_resource)) {
+ GPR_ASSERT(!resource_name_.empty());
+ // RouteConfigWatcher is being created here instead of in Watch() to avoid
+ // deadlocks from invoking XdsRouteConfigResourceType::StartWatch whilst in a
+ // critical region.
+ auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(WeakRef());
+ route_config_watcher_ = route_config_watcher.get();
+ XdsRouteConfigResourceType::StartWatch(xds_client_.get(), resource_name_,
+ std::move(route_config_watcher));
+}
- void OnError(grpc_error_handle error) override {
- if (filter_chain_match_manager_ != nullptr) {
- gpr_log(GPR_ERROR,
- "ListenerWatcher:%p XdsClient reports error: %s for %s; "
- "ignoring in favor of existing resource",
- this, grpc_error_std_string(error).c_str(),
- listening_address_.c_str());
- } else {
- if (serving_status_notifier_.on_serving_status_update != nullptr) {
- serving_status_notifier_.on_serving_status_update(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- GRPC_STATUS_UNAVAILABLE, grpc_error_std_string(error).c_str());
- } else {
- gpr_log(
- GPR_ERROR,
- "ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
- "not serving on %s",
- this, grpc_error_std_string(error).c_str(),
- listening_address_.c_str());
- }
- }
- GRPC_ERROR_UNREF(error);
- }
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::Orphan() {
+ XdsRouteConfigResourceType::CancelWatch(xds_client_.get(), resource_name_,
+ route_config_watcher_,
+ false /* delay_unsubscription */);
+}
- void OnFatalError(absl::Status status) {
- gpr_log(
- GPR_ERROR,
- "ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
- this, status.ToString().c_str(), listening_address_.c_str());
- if (filter_chain_match_manager_ != nullptr) {
- // The server has started listening already, so we need to gracefully
- // stop serving.
- server_config_watcher_->StopServing();
- filter_chain_match_manager_.reset();
- }
- if (serving_status_notifier_.on_serving_status_update != nullptr) {
- serving_status_notifier_.on_serving_status_update(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- static_cast<grpc_status_code>(status.raw_code()),
- std::string(status.message()).c_str());
- }
- }
+absl::StatusOr<RefCountedPtr<ServerConfigSelector>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::Watch(
+ std::unique_ptr<
+ ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) {
+ absl::StatusOr<XdsRouteConfigResource> resource;
+ {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(watcher_ == nullptr);
+ watcher_ = std::move(watcher);
+ resource = resource_;
+ }
+ if (!resource.ok()) {
+ return resource.status();
+ }
+ return XdsServerConfigSelector::Create(resource.value(), http_filters_);
+}
- void OnResourceDoesNotExist() override {
- OnFatalError(absl::NotFoundError("Requested listener does not exist"));
- }
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::CancelWatch() {
+ MutexLock lock(&mu_);
+ watcher_.reset();
+}
- private:
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- server_config_watcher_;
- grpc_channel_args* args_;
- RefCountedPtr<XdsClient> xds_client_;
- grpc_server_xds_status_notifier serving_status_notifier_;
- std::string listening_address_;
- RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
- };
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnRouteConfigChanged(
+ XdsRouteConfigResource rds_update) {
+ MutexLock lock(&mu_);
+ resource_ = std::move(rds_update);
+ if (watcher_ == nullptr) {
+ return;
+ }
+ // Currently server_config_selector_filter does not call into
+ // DynamicXdsServerConfigSelectorProvider while holding a lock, but if that
+ // ever changes, we would want to invoke the update outside the critical
+ // region with the use of a WorkSerializer.
+ watcher_->OnServerConfigSelectorUpdate(
+ XdsServerConfigSelector::Create(*resource_, http_filters_));
+}
- struct WatcherState {
- std::string listening_address;
- ListenerWatcher* listener_watcher = nullptr;
- };
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnError(absl::Status status) {
+ MutexLock lock(&mu_);
+ // Prefer existing good update.
+ if (resource_.ok()) {
+ return;
+ }
+ resource_ = status;
+ if (watcher_ == nullptr) {
+ return;
+ }
+ watcher_->OnServerConfigSelectorUpdate(resource_.status());
+}
- RefCountedPtr<XdsClient> xds_client_;
- grpc_server_xds_status_notifier serving_status_notifier_;
- Mutex mu_;
- std::map<grpc_server_config_fetcher::WatcherInterface*, WatcherState>
- watchers_ ABSL_GUARDED_BY(mu_);
-};
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnResourceDoesNotExist() {
+ MutexLock lock(&mu_);
+ resource_ = absl::NotFoundError("Requested route config does not exist");
+ if (watcher_ == nullptr) {
+ return;
+ }
+ watcher_->OnServerConfigSelectorUpdate(resource_.status());
+}
} // namespace
} // namespace grpc_core
@@ -524,10 +1285,17 @@ grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create(
grpc_server_xds_status_notifier notifier, const grpc_channel_args* args) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE("grpc_server_config_fetcher_xds_create()", 0, ());
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ GRPC_API_TRACE(
+ "grpc_server_config_fetcher_xds_create(notifier={on_serving_status_"
+ "update=%p, user_data=%p}, args=%p)",
+ 3, (notifier.on_serving_status_update, notifier.user_data, args));
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::RefCountedPtr<grpc_core::XdsClient> xds_client =
grpc_core::XdsClient::GetOrCreate(args, &error);
+ grpc_channel_args_destroy(args);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Failed to create xds client: %s",
grpc_error_std_string(error).c_str());
diff --git a/grpc/src/core/lib/address_utils/parse_address.cc b/grpc/src/core/lib/address_utils/parse_address.cc
index 98dd1bcb..340bab96 100644
--- a/grpc/src/core/lib/address_utils/parse_address.cc
+++ b/grpc/src/core/lib/address_utils/parse_address.cc
@@ -37,6 +37,7 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
@@ -83,14 +84,13 @@ namespace grpc_core {
grpc_error_handle UnixSockaddrPopulate(absl::string_view path,
grpc_resolved_address* resolved_addr) {
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
struct sockaddr_un* un =
reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
const size_t maxlen = sizeof(un->sun_path) - 1;
if (path.size() > maxlen) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Path name should not have more than ", maxlen,
- " characters")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Path name should not have more than ", maxlen, " characters"));
}
un->sun_family = AF_UNIX;
path.copy(un->sun_path, path.size());
@@ -101,14 +101,13 @@ grpc_error_handle UnixSockaddrPopulate(absl::string_view path,
grpc_error_handle UnixAbstractSockaddrPopulate(
absl::string_view path, grpc_resolved_address* resolved_addr) {
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
struct sockaddr_un* un =
reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
const size_t maxlen = sizeof(un->sun_path) - 1;
if (path.size() > maxlen) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Path name should not have more than ", maxlen,
- " characters")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Path name should not have more than ", maxlen, " characters"));
}
un->sun_family = AF_UNIX;
un->sun_path[0] = '\0';
@@ -320,3 +319,22 @@ uint16_t grpc_strhtons(const char* port) {
}
return htons(static_cast<unsigned short>(atoi(port)));
}
+
+grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
+ const char* addr, int port) {
+ memset(out, 0, sizeof(grpc_resolved_address));
+ grpc_sockaddr_in6* addr6 = reinterpret_cast<grpc_sockaddr_in6*>(out->addr);
+ grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(out->addr);
+ if (grpc_inet_pton(GRPC_AF_INET6, addr, &addr6->sin6_addr) == 1) {
+ addr6->sin6_family = GRPC_AF_INET6;
+ out->len = sizeof(grpc_sockaddr_in6);
+ } else if (grpc_inet_pton(GRPC_AF_INET, addr, &addr4->sin_addr) == 1) {
+ addr4->sin_family = GRPC_AF_INET;
+ out->len = sizeof(grpc_sockaddr_in);
+ } else {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Failed to parse address:", addr));
+ }
+ grpc_sockaddr_set_port(out, port);
+ return GRPC_ERROR_NONE;
+}
diff --git a/grpc/src/core/lib/address_utils/parse_address.h b/grpc/src/core/lib/address_utils/parse_address.h
index 92409b7e..4b18ed6d 100644
--- a/grpc/src/core/lib/address_utils/parse_address.h
+++ b/grpc/src/core/lib/address_utils/parse_address.h
@@ -61,6 +61,11 @@ bool grpc_parse_ipv6_hostport(absl::string_view hostport,
/* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */
uint16_t grpc_strhtons(const char* port);
+// Newer form of grpc_string_to_sockaddr which returns an error instead of
+// crashing if \a addr is not IPv6/IPv6
+grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
+ const char* addr, int port);
+
namespace grpc_core {
/** Populate \a resolved_addr to be a unix socket at |path| */
diff --git a/grpc/src/core/lib/address_utils/sockaddr_utils.cc b/grpc/src/core/lib/address_utils/sockaddr_utils.cc
index 888cd1aa..ac84a144 100644
--- a/grpc/src/core/lib/address_utils/sockaddr_utils.cc
+++ b/grpc/src/core/lib/address_utils/sockaddr_utils.cc
@@ -36,7 +36,35 @@
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+static std::string 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 "";
+ }
+ const auto* unix_addr = reinterpret_cast<const struct sockaddr_un*>(addr);
+ if (unix_addr->sun_path[0] == '\0' && unix_addr->sun_path[1] != '\0') {
+ return absl::StrCat(
+ "unix-abstract:",
+ absl::string_view(
+ unix_addr->sun_path + 1,
+ resolved_addr->len - sizeof(unix_addr->sun_family) - 1));
+ }
+ return absl::StrCat("unix:", unix_addr->sun_path);
+}
+#else
+static std::string grpc_sockaddr_to_uri_unix_if_possible(
+ const grpc_resolved_address* /* addr */) {
+ return "";
+}
+#endif
static const uint8_t kV4MappedPrefix[] = {0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xff, 0xff};
@@ -198,25 +226,6 @@ std::string grpc_sockaddr_to_string(const grpc_resolved_address* resolved_addr,
return out;
}
-grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
- const char* addr, int port) {
- memset(out, 0, sizeof(grpc_resolved_address));
- grpc_sockaddr_in6* addr6 = reinterpret_cast<grpc_sockaddr_in6*>(out->addr);
- grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(out->addr);
- if (grpc_inet_pton(GRPC_AF_INET6, addr, &addr6->sin6_addr) == 1) {
- addr6->sin6_family = GRPC_AF_INET6;
- out->len = sizeof(grpc_sockaddr_in6);
- } else if (grpc_inet_pton(GRPC_AF_INET, addr, &addr4->sin_addr) == 1) {
- addr4->sin_family = GRPC_AF_INET;
- out->len = sizeof(grpc_sockaddr_in);
- } else {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Failed to parse address:", addr).c_str());
- }
- grpc_sockaddr_set_port(out, port);
- return GRPC_ERROR_NONE;
-}
-
std::string grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
if (resolved_addr->len == 0) return "";
grpc_resolved_address addr_normalized;
@@ -267,10 +276,11 @@ int grpc_sockaddr_get_port(const grpc_resolved_address* resolved_addr) {
case GRPC_AF_INET6:
return grpc_ntohs(
(reinterpret_cast<const grpc_sockaddr_in6*>(addr))->sin6_port);
+#ifdef GRPC_HAVE_UNIX_SOCKET
+ case AF_UNIX:
+ return 1;
+#endif
default:
- if (grpc_is_unix_socket(resolved_addr)) {
- return 1;
- }
gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port",
addr->sa_family);
return 0;
diff --git a/grpc/src/core/lib/address_utils/sockaddr_utils.h b/grpc/src/core/lib/address_utils/sockaddr_utils.h
index e8bf79fd..159fd661 100644
--- a/grpc/src/core/lib/address_utils/sockaddr_utils.h
+++ b/grpc/src/core/lib/address_utils/sockaddr_utils.h
@@ -23,7 +23,7 @@
#include <string>
-#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolved_address.h"
/* Returns true if addr is an IPv4-mapped IPv6 address within the
::ffff:0.0.0.0/96 range, or false otherwise.
@@ -66,11 +66,6 @@ int grpc_sockaddr_set_port(grpc_resolved_address* addr, int port);
std::string grpc_sockaddr_to_string(const grpc_resolved_address* addr,
bool normalize) GRPC_MUST_USE_RESULT;
-// Newer form of grpc_string_to_sockaddr which returns an error instead of
-// crashing if \a addr is not IPv6/IPv6
-grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
- const char* addr, int port);
-
/* Returns the URI string corresponding to \a addr */
std::string grpc_sockaddr_to_uri(const grpc_resolved_address* addr);
diff --git a/grpc/src/core/lib/avl/avl.cc b/grpc/src/core/lib/avl/avl.cc
deleted file mode 100644
index e04fe35b..00000000
--- a/grpc/src/core/lib/avl/avl.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- *
- * 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/lib/avl/avl.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/useful.h"
-
-grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable) {
- grpc_avl out;
- out.vtable = vtable;
- out.root = nullptr;
- return out;
-}
-
-static grpc_avl_node* ref_node(grpc_avl_node* node) {
- if (node) {
- gpr_ref(&node->refs);
- }
- return node;
-}
-
-static void unref_node(const grpc_avl_vtable* vtable, grpc_avl_node* node,
- void* user_data) {
- if (node == nullptr) {
- return;
- }
- if (gpr_unref(&node->refs)) {
- vtable->destroy_key(node->key, user_data);
- vtable->destroy_value(node->value, user_data);
- unref_node(vtable, node->left, user_data);
- unref_node(vtable, node->right, user_data);
- gpr_free(node);
- }
-}
-
-static long node_height(grpc_avl_node* node) {
- return node == nullptr ? 0 : node->height;
-}
-
-#ifndef NDEBUG
-static long calculate_height(grpc_avl_node* node) {
- return node == nullptr ? 0
- : 1 + GPR_MAX(calculate_height(node->left),
- calculate_height(node->right));
-}
-
-static grpc_avl_node* assert_invariants(grpc_avl_node* n) {
- if (n == nullptr) return nullptr;
- assert_invariants(n->left);
- assert_invariants(n->right);
- assert(calculate_height(n) == n->height);
- assert(labs(node_height(n->left) - node_height(n->right)) <= 1);
- return n;
-}
-#else
-static grpc_avl_node* assert_invariants(grpc_avl_node* n) { return n; }
-#endif
-
-grpc_avl_node* new_node(void* key, void* value, grpc_avl_node* left,
- grpc_avl_node* right) {
- grpc_avl_node* node = static_cast<grpc_avl_node*>(gpr_malloc(sizeof(*node)));
- gpr_ref_init(&node->refs, 1);
- node->key = key;
- node->value = value;
- node->left = assert_invariants(left);
- node->right = assert_invariants(right);
- node->height = 1 + GPR_MAX(node_height(left), node_height(right));
- return node;
-}
-
-static grpc_avl_node* get(const grpc_avl_vtable* vtable, grpc_avl_node* node,
- void* key, void* user_data) {
- long cmp;
-
- if (node == nullptr) {
- return nullptr;
- }
-
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- return node;
- } else if (cmp > 0) {
- return get(vtable, node->left, key, user_data);
- } else {
- return get(vtable, node->right, key, user_data);
- }
-}
-
-void* grpc_avl_get(grpc_avl avl, void* key, void* user_data) {
- grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
- return node ? node->value : nullptr;
-}
-
-int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data) {
- grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
- if (node != nullptr) {
- *value = node->value;
- return 1;
- }
- return 0;
-}
-
-static grpc_avl_node* rotate_left(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- grpc_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
- vtable->copy_value(right->value, user_data),
- new_node(key, value, left, ref_node(right->left)),
- ref_node(right->right));
- unref_node(vtable, right, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_right(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- grpc_avl_node* n =
- new_node(vtable->copy_key(left->key, user_data),
- vtable->copy_value(left->value, user_data), ref_node(left->left),
- new_node(key, value, ref_node(left->right), right));
- unref_node(vtable, left, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_left_right(const grpc_avl_vtable* vtable,
- void* key, void* value,
- grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- /* rotate_right(..., rotate_left(left), right) */
- grpc_avl_node* n =
- new_node(vtable->copy_key(left->right->key, user_data),
- vtable->copy_value(left->right->value, user_data),
- new_node(vtable->copy_key(left->key, user_data),
- vtable->copy_value(left->value, user_data),
- ref_node(left->left), ref_node(left->right->left)),
- new_node(key, value, ref_node(left->right->right), right));
- unref_node(vtable, left, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_right_left(const grpc_avl_vtable* vtable,
- void* key, void* value,
- grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- /* rotate_left(..., left, rotate_right(right)) */
- grpc_avl_node* n =
- new_node(vtable->copy_key(right->left->key, user_data),
- vtable->copy_value(right->left->value, user_data),
- new_node(key, value, left, ref_node(right->left->left)),
- new_node(vtable->copy_key(right->key, user_data),
- vtable->copy_value(right->value, user_data),
- ref_node(right->left->right), ref_node(right->right)));
- unref_node(vtable, right, user_data);
- return n;
-}
-
-static grpc_avl_node* rebalance(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- switch (node_height(left) - node_height(right)) {
- case 2:
- if (node_height(left->left) - node_height(left->right) == -1) {
- return assert_invariants(
- rotate_left_right(vtable, key, value, left, right, user_data));
- } else {
- return assert_invariants(
- rotate_right(vtable, key, value, left, right, user_data));
- }
- case -2:
- if (node_height(right->left) - node_height(right->right) == 1) {
- return assert_invariants(
- rotate_right_left(vtable, key, value, left, right, user_data));
- } else {
- return assert_invariants(
- rotate_left(vtable, key, value, left, right, user_data));
- }
- default:
- return assert_invariants(new_node(key, value, left, right));
- }
-}
-
-static grpc_avl_node* add_key(const grpc_avl_vtable* vtable,
- grpc_avl_node* node, void* key, void* value,
- void* user_data) {
- long cmp;
- if (node == nullptr) {
- return new_node(key, value, nullptr, nullptr);
- }
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- return new_node(key, value, ref_node(node->left), ref_node(node->right));
- } else if (cmp > 0) {
- return rebalance(vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data),
- add_key(vtable, node->left, key, value, user_data),
- ref_node(node->right), user_data);
- } else {
- return rebalance(
- vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data), ref_node(node->left),
- add_key(vtable, node->right, key, value, user_data), user_data);
- }
-}
-
-grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data) {
- grpc_avl_node* old_root = avl.root;
- avl.root = add_key(avl.vtable, avl.root, key, value, user_data);
- assert_invariants(avl.root);
- unref_node(avl.vtable, old_root, user_data);
- return avl;
-}
-
-static grpc_avl_node* in_order_head(grpc_avl_node* node) {
- while (node->left != nullptr) {
- node = node->left;
- }
- return node;
-}
-
-static grpc_avl_node* in_order_tail(grpc_avl_node* node) {
- while (node->right != nullptr) {
- node = node->right;
- }
- return node;
-}
-
-static grpc_avl_node* remove_key(const grpc_avl_vtable* vtable,
- grpc_avl_node* node, void* key,
- void* user_data) {
- long cmp;
- if (node == nullptr) {
- return nullptr;
- }
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- if (node->left == nullptr) {
- return ref_node(node->right);
- } else if (node->right == nullptr) {
- return ref_node(node->left);
- } else if (node->left->height < node->right->height) {
- grpc_avl_node* h = in_order_head(node->right);
- return rebalance(
- vtable, vtable->copy_key(h->key, user_data),
- vtable->copy_value(h->value, user_data), ref_node(node->left),
- remove_key(vtable, node->right, h->key, user_data), user_data);
- } else {
- grpc_avl_node* h = in_order_tail(node->left);
- return rebalance(vtable, vtable->copy_key(h->key, user_data),
- vtable->copy_value(h->value, user_data),
- remove_key(vtable, node->left, h->key, user_data),
- ref_node(node->right), user_data);
- }
- } else if (cmp > 0) {
- return rebalance(vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data),
- remove_key(vtable, node->left, key, user_data),
- ref_node(node->right), user_data);
- } else {
- return rebalance(
- vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data), ref_node(node->left),
- remove_key(vtable, node->right, key, user_data), user_data);
- }
-}
-
-grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data) {
- grpc_avl_node* old_root = avl.root;
- avl.root = remove_key(avl.vtable, avl.root, key, user_data);
- assert_invariants(avl.root);
- unref_node(avl.vtable, old_root, user_data);
- return avl;
-}
-
-grpc_avl grpc_avl_ref(grpc_avl avl, void* /*user_data*/) {
- ref_node(avl.root);
- return avl;
-}
-
-void grpc_avl_unref(grpc_avl avl, void* user_data) {
- unref_node(avl.vtable, avl.root, user_data);
-}
-
-int grpc_avl_is_empty(grpc_avl avl) { return avl.root == nullptr; }
diff --git a/grpc/src/core/lib/avl/avl.h b/grpc/src/core/lib/avl/avl.h
index 15a9d569..a1712a36 100644
--- a/grpc/src/core/lib/avl/avl.h
+++ b/grpc/src/core/lib/avl/avl.h
@@ -1,94 +1,458 @@
-/*
- *
- * 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 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_AVL_AVL_H
#define GRPC_CORE_LIB_AVL_AVL_H
#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-
-/** internal node of an AVL tree */
-typedef struct grpc_avl_node {
- gpr_refcount refs;
- void* key;
- void* value;
- struct grpc_avl_node* left;
- struct grpc_avl_node* right;
- long height;
-} grpc_avl_node;
-
-/** vtable for the AVL tree
- * The optional user_data is propagated from the top level grpc_avl_XXX API.
- * From the same API call, multiple vtable functions may be called multiple
- * times.
- */
-typedef struct grpc_avl_vtable {
- /** destroy a key */
- void (*destroy_key)(void* key, void* user_data);
- /** copy a key, returning new value */
- void* (*copy_key)(void* key, void* user_data);
- /** compare key1, key2; return <0 if key1 < key2,
- >0 if key1 > key2, 0 if key1 == key2 */
- long (*compare_keys)(void* key1, void* key2, void* user_data);
- /** destroy a value */
- void (*destroy_value)(void* value, void* user_data);
- /** copy a value */
- void* (*copy_value)(void* value, void* user_data);
-} grpc_avl_vtable;
-
-/** "pointer" to an AVL tree - this is a reference
- counted object - use grpc_avl_ref to add a reference,
- grpc_avl_unref when done with a reference */
-typedef struct grpc_avl {
- const grpc_avl_vtable* vtable;
- grpc_avl_node* root;
-} grpc_avl;
-
-/** Create an immutable AVL tree. */
-grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable);
-/** Add a reference to an existing tree - returns
- the tree as a convenience. The optional user_data will be passed to vtable
- functions. */
-grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data);
-/** Remove a reference to a tree - destroying it if there
- are no references left. The optional user_data will be passed to vtable
- functions. */
-void grpc_avl_unref(grpc_avl avl, void* user_data);
-/** Return a new tree with (key, value) added to avl.
- implicitly unrefs avl to allow easy chaining.
- if key exists in avl, the new tree's key entry updated
- (i.e. a duplicate is not created). The optional user_data will be passed to
- vtable functions. */
-grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data);
-/** Return a new tree with key deleted
- implicitly unrefs avl to allow easy chaining. The optional user_data will be
- passed to vtable functions. */
-grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data);
-/** Lookup key, and return the associated value.
- Does not mutate avl.
- Returns NULL if key is not found. The optional user_data will be passed to
- vtable functions.*/
-void* grpc_avl_get(grpc_avl avl, void* key, void* user_data);
-/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
- its value. The optional user_data will be passed to vtable functions. */
-int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data);
-/** Return 1 if avl is empty, 0 otherwise */
-int grpc_avl_is_empty(grpc_avl avl);
-
-#endif /* GRPC_CORE_LIB_AVL_AVL_H */
+#include <stdlib.h>
+
+#include <algorithm>
+#include <memory>
+
+#include "absl/container/inlined_vector.h"
+
+namespace grpc_core {
+
+template <class K, class V = void>
+class AVL {
+ public:
+ AVL() {}
+
+ AVL Add(K key, V value) const {
+ return AVL(AddKey(root_, std::move(key), std::move(value)));
+ }
+ template <typename SomethingLikeK>
+ AVL Remove(const SomethingLikeK& key) const {
+ return AVL(RemoveKey(root_, key));
+ }
+ template <typename SomethingLikeK>
+ const V* Lookup(const SomethingLikeK& key) const {
+ NodePtr n = Get(root_, key);
+ return n ? &n->kv.second : nullptr;
+ }
+
+ const std::pair<K, V>* LookupBelow(const K& key) const {
+ NodePtr n = GetBelow(root_, *key);
+ return n ? &n->kv : nullptr;
+ }
+
+ bool Empty() const { return root_ == nullptr; }
+
+ template <class F>
+ void ForEach(F&& f) const {
+ ForEachImpl(root_.get(), std::forward<F>(f));
+ }
+
+ bool SameIdentity(const AVL& avl) const { return root_ == avl.root_; }
+
+ bool operator==(const AVL& other) const {
+ Iterator a(root_);
+ Iterator b(other.root_);
+ for (;;) {
+ Node* p = a.current();
+ Node* q = b.current();
+ if (p == nullptr) return q == nullptr;
+ if (q == nullptr) return false;
+ if (p->kv != q->kv) return false;
+ a.MoveNext();
+ b.MoveNext();
+ }
+ }
+
+ bool operator<(const AVL& other) const {
+ Iterator a(root_);
+ Iterator b(other.root_);
+ for (;;) {
+ Node* p = a.current();
+ Node* q = b.current();
+ if (p == nullptr) return q != nullptr;
+ if (q == nullptr) return false;
+ if (p->kv < q->kv) return true;
+ if (p->kv != q->kv) return false;
+ a.MoveNext();
+ b.MoveNext();
+ }
+ }
+
+ private:
+ struct Node;
+ typedef std::shared_ptr<Node> NodePtr;
+ struct Node : public std::enable_shared_from_this<Node> {
+ Node(K k, V v, NodePtr l, NodePtr r, long h)
+ : kv(std::move(k), std::move(v)),
+ left(std::move(l)),
+ right(std::move(r)),
+ height(h) {}
+ const std::pair<K, V> kv;
+ const NodePtr left;
+ const NodePtr right;
+ const long height;
+ };
+ NodePtr root_;
+
+ class Iterator {
+ public:
+ explicit Iterator(const NodePtr& root) {
+ auto* n = root.get();
+ while (n != nullptr) {
+ stack_.push_back(n);
+ n = n->left.get();
+ }
+ }
+ Node* current() const { return stack_.empty() ? nullptr : stack_.back(); }
+ void MoveNext() {
+ auto* n = stack_.back();
+ stack_.pop_back();
+ if (n->right != nullptr) {
+ n = n->right.get();
+ while (n != nullptr) {
+ stack_.push_back(n);
+ n = n->left.get();
+ }
+ }
+ }
+
+ private:
+ absl::InlinedVector<Node*, 8> stack_;
+ };
+
+ explicit AVL(NodePtr root) : root_(std::move(root)) {}
+
+ template <class F>
+ static void ForEachImpl(const Node* n, F&& f) {
+ if (n == nullptr) return;
+ ForEachImpl(n->left.get(), std::forward<F>(f));
+ f(const_cast<const K&>(n->kv.first), const_cast<const V&>(n->kv.second));
+ ForEachImpl(n->right.get(), std::forward<F>(f));
+ }
+
+ static long Height(const NodePtr& n) { return n ? n->height : 0; }
+
+ static NodePtr MakeNode(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return std::make_shared<Node>(std::move(key), std::move(value), left, right,
+ 1 + std::max(Height(left), Height(right)));
+ }
+
+ template <typename SomethingLikeK>
+ static NodePtr Get(const NodePtr& node, const SomethingLikeK& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+
+ if (node->kv.first > key) {
+ return Get(node->left, key);
+ } else if (node->kv.first < key) {
+ return Get(node->right, key);
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr GetBelow(const NodePtr& node, const K& key) {
+ if (!node) return nullptr;
+ if (node->kv.first > key) {
+ return GetBelow(node->left, key);
+ } else if (node->kv.first < key) {
+ NodePtr n = GetBelow(node->right, key);
+ if (n == nullptr) n = node;
+ return n;
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr RotateLeft(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return MakeNode(
+ right->kv.first, right->kv.second,
+ MakeNode(std::move(key), std::move(value), left, right->left),
+ right->right);
+ }
+
+ static NodePtr RotateRight(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return MakeNode(
+ left->kv.first, left->kv.second, left->left,
+ MakeNode(std::move(key), std::move(value), left->right, right));
+ }
+
+ static NodePtr RotateLeftRight(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_right(..., rotate_left(left), right) */
+ return MakeNode(
+ left->right->kv.first, left->right->kv.second,
+ MakeNode(left->kv.first, left->kv.second, left->left,
+ left->right->left),
+ MakeNode(std::move(key), std::move(value), left->right->right, right));
+ }
+
+ static NodePtr RotateRightLeft(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_left(..., left, rotate_right(right)) */
+ return MakeNode(
+ right->left->kv.first, right->left->kv.second,
+ MakeNode(std::move(key), std::move(value), left, right->left->left),
+ MakeNode(right->kv.first, right->kv.second, right->left->right,
+ right->right));
+ }
+
+ static NodePtr Rebalance(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ switch (Height(left) - Height(right)) {
+ case 2:
+ if (Height(left->left) - Height(left->right) == -1) {
+ return RotateLeftRight(std::move(key), std::move(value), left, right);
+ } else {
+ return RotateRight(std::move(key), std::move(value), left, right);
+ }
+ case -2:
+ if (Height(right->left) - Height(right->right) == 1) {
+ return RotateRightLeft(std::move(key), std::move(value), left, right);
+ } else {
+ return RotateLeft(std::move(key), std::move(value), left, right);
+ }
+ default:
+ return MakeNode(key, value, left, right);
+ }
+ }
+
+ static NodePtr AddKey(const NodePtr& node, K key, V value) {
+ if (!node) {
+ return MakeNode(std::move(key), std::move(value), nullptr, nullptr);
+ }
+ if (node->kv.first < key) {
+ return Rebalance(node->kv.first, node->kv.second, node->left,
+ AddKey(node->right, std::move(key), std::move(value)));
+ }
+ if (key < node->kv.first) {
+ return Rebalance(node->kv.first, node->kv.second,
+ AddKey(node->left, std::move(key), std::move(value)),
+ node->right);
+ }
+ return MakeNode(std::move(key), std::move(value), node->left, node->right);
+ }
+
+ static NodePtr InOrderHead(NodePtr node) {
+ while (node->left != nullptr) {
+ node = node->left;
+ }
+ return node;
+ }
+
+ static NodePtr InOrderTail(NodePtr node) {
+ while (node->right != nullptr) {
+ node = node->right;
+ }
+ return node;
+ }
+
+ template <typename SomethingLikeK>
+ static NodePtr RemoveKey(const NodePtr& node, const SomethingLikeK& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+ if (key < node->kv.first) {
+ return Rebalance(node->kv.first, node->kv.second,
+ RemoveKey(node->left, key), node->right);
+ } else if (node->kv.first < key) {
+ return Rebalance(node->kv.first, node->kv.second, node->left,
+ RemoveKey(node->right, key));
+ } else {
+ if (node->left == nullptr) {
+ return node->right;
+ } else if (node->right == nullptr) {
+ return node->left;
+ } else if (node->left->height < node->right->height) {
+ NodePtr h = InOrderHead(node->right);
+ return Rebalance(h->kv.first, h->kv.second, node->left,
+ RemoveKey(node->right, h->kv.first));
+ } else {
+ NodePtr h = InOrderTail(node->left);
+ return Rebalance(h->kv.first, h->kv.second,
+ RemoveKey(node->left, h->kv.first), node->right);
+ }
+ }
+ abort();
+ }
+};
+
+template <class K>
+class AVL<K, void> {
+ public:
+ AVL() {}
+
+ AVL Add(K key) const { return AVL(AddKey(root_, std::move(key))); }
+ AVL Remove(const K& key) const { return AVL(RemoveKey(root_, key)); }
+ bool Lookup(const K& key) const { return Get(root_, key) != nullptr; }
+ bool Empty() const { return root_ == nullptr; }
+
+ template <class F>
+ void ForEach(F&& f) const {
+ ForEachImpl(root_.get(), std::forward<F>(f));
+ }
+
+ bool SameIdentity(AVL avl) const { return root_ == avl.root_; }
+
+ private:
+ struct Node;
+ typedef std::shared_ptr<Node> NodePtr;
+ struct Node : public std::enable_shared_from_this<Node> {
+ Node(K k, NodePtr l, NodePtr r, long h)
+ : key(std::move(k)),
+ left(std::move(l)),
+ right(std::move(r)),
+ height(h) {}
+ const K key;
+ const NodePtr left;
+ const NodePtr right;
+ const long height;
+ };
+ NodePtr root_;
+
+ explicit AVL(NodePtr root) : root_(std::move(root)) {}
+
+ template <class F>
+ static void ForEachImpl(const Node* n, F&& f) {
+ if (n == nullptr) return;
+ ForEachImpl(n->left.get(), std::forward<F>(f));
+ f(const_cast<const K&>(n->key));
+ ForEachImpl(n->right.get(), std::forward<F>(f));
+ }
+
+ static long Height(const NodePtr& n) { return n ? n->height : 0; }
+
+ static NodePtr MakeNode(K key, const NodePtr& left, const NodePtr& right) {
+ return std::make_shared<Node>(std::move(key), left, right,
+ 1 + std::max(Height(left), Height(right)));
+ }
+
+ static NodePtr Get(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+
+ if (node->key > key) {
+ return Get(node->left, key);
+ } else if (node->key < key) {
+ return Get(node->right, key);
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr RotateLeft(K key, const NodePtr& left, const NodePtr& right) {
+ return MakeNode(right->key, MakeNode(std::move(key), left, right->left),
+ right->right);
+ }
+
+ static NodePtr RotateRight(K key, const NodePtr& left, const NodePtr& right) {
+ return MakeNode(left->key, left->left,
+ MakeNode(std::move(key), left->right, right));
+ }
+
+ static NodePtr RotateLeftRight(K key, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_right(..., rotate_left(left), right) */
+ return MakeNode(left->right->key,
+ MakeNode(left->key, left->left, left->right->left),
+ MakeNode(std::move(key), left->right->right, right));
+ }
+
+ static NodePtr RotateRightLeft(K key, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_left(..., left, rotate_right(right)) */
+ return MakeNode(right->left->key,
+ MakeNode(std::move(key), left, right->left->left),
+ MakeNode(right->key, right->left->right, right->right));
+ }
+
+ static NodePtr Rebalance(K key, const NodePtr& left, const NodePtr& right) {
+ switch (Height(left) - Height(right)) {
+ case 2:
+ if (Height(left->left) - Height(left->right) == -1) {
+ return RotateLeftRight(std::move(key), left, right);
+ } else {
+ return RotateRight(std::move(key), left, right);
+ }
+ case -2:
+ if (Height(right->left) - Height(right->right) == 1) {
+ return RotateRightLeft(std::move(key), left, right);
+ } else {
+ return RotateLeft(std::move(key), left, right);
+ }
+ default:
+ return MakeNode(key, left, right);
+ }
+ }
+
+ static NodePtr AddKey(const NodePtr& node, K key) {
+ if (!node) {
+ return MakeNode(std::move(key), nullptr, nullptr);
+ }
+ if (node->key < key) {
+ return Rebalance(node->key, node->left,
+ AddKey(node->right, std::move(key)));
+ }
+ if (key < node->key) {
+ return Rebalance(node->key, AddKey(node->left, std::move(key)),
+ node->right);
+ }
+ return MakeNode(std::move(key), node->left, node->right);
+ }
+
+ static NodePtr InOrderHead(NodePtr node) {
+ while (node->left != nullptr) {
+ node = node->left;
+ }
+ return node;
+ }
+
+ static NodePtr InOrderTail(NodePtr node) {
+ while (node->right != nullptr) {
+ node = node->right;
+ }
+ return node;
+ }
+
+ static NodePtr RemoveKey(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+ if (key < node->key) {
+ return Rebalance(node->key, RemoveKey(node->left, key), node->right);
+ } else if (node->key < key) {
+ return Rebalance(node->key, node->left, RemoveKey(node->right, key));
+ } else {
+ if (node->left == nullptr) {
+ return node->right;
+ } else if (node->right == nullptr) {
+ return node->left;
+ } else if (node->left->height < node->right->height) {
+ NodePtr h = InOrderHead(node->right);
+ return Rebalance(h->key, node->left, RemoveKey(node->right, h->key));
+ } else {
+ NodePtr h = InOrderTail(node->left);
+ return Rebalance(h->key, RemoveKey(node->left, h->key), node->right);
+ }
+ }
+ abort();
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_AVL_AVL_H
diff --git a/grpc/src/core/lib/backoff/backoff.cc b/grpc/src/core/lib/backoff/backoff.cc
index e536abde..c3b7e856 100644
--- a/grpc/src/core/lib/backoff/backoff.cc
+++ b/grpc/src/core/lib/backoff/backoff.cc
@@ -26,46 +26,19 @@
namespace grpc_core {
-namespace {
+BackOff::BackOff(const Options& options) : options_(options) { Reset(); }
-/* Generate a random number between 0 and 1. We roll our own RNG because seeding
- * rand() modifies a global variable we have no control over. */
-double generate_uniform_random_number(uint32_t* rng_state) {
- constexpr uint32_t two_raise_31 = uint32_t(1) << 31;
- *rng_state = (1103515245 * *rng_state + 12345) % two_raise_31;
- return *rng_state / static_cast<double>(two_raise_31);
-}
-
-double generate_uniform_random_number_between(uint32_t* rng_state, double a,
- double b) {
- if (a == b) return a;
- if (a > b) GPR_SWAP(double, a, b); // make sure a < b
- const double range = b - a;
- return a + generate_uniform_random_number(rng_state) * range;
-}
-
-} // namespace
-
-BackOff::BackOff(const Options& options)
- : options_(options),
- rng_state_(static_cast<uint32_t>(gpr_now(GPR_CLOCK_REALTIME).tv_nsec)) {
- Reset();
-}
-
-grpc_millis BackOff::NextAttemptTime() {
+Timestamp BackOff::NextAttemptTime() {
if (initial_) {
initial_ = false;
- return current_backoff_ + grpc_core::ExecCtx::Get()->Now();
+ return current_backoff_ + ExecCtx::Get()->Now();
}
- current_backoff_ = static_cast<grpc_millis>(
- std::min(current_backoff_ * options_.multiplier(),
- static_cast<double>(options_.max_backoff())));
- const double jitter = generate_uniform_random_number_between(
- &rng_state_, -options_.jitter() * current_backoff_,
- options_.jitter() * current_backoff_);
- const grpc_millis next_timeout =
- static_cast<grpc_millis>(current_backoff_ + jitter);
- return next_timeout + grpc_core::ExecCtx::Get()->Now();
+ current_backoff_ = std::min(current_backoff_ * options_.multiplier(),
+ options_.max_backoff());
+ const Duration jitter = Duration::FromSecondsAsDouble(
+ absl::Uniform(rand_gen_, -options_.jitter() * current_backoff_.seconds(),
+ options_.jitter() * current_backoff_.seconds()));
+ return ExecCtx::Get()->Now() + current_backoff_ + jitter;
}
void BackOff::Reset() {
@@ -73,6 +46,4 @@ void BackOff::Reset() {
initial_ = true;
}
-void BackOff::SetRandomSeed(uint32_t seed) { rng_state_ = seed; }
-
} // namespace grpc_core
diff --git a/grpc/src/core/lib/backoff/backoff.h b/grpc/src/core/lib/backoff/backoff.h
index e769d150..f94c2df2 100644
--- a/grpc/src/core/lib/backoff/backoff.h
+++ b/grpc/src/core/lib/backoff/backoff.h
@@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h>
+#include "absl/random/random.h"
+
#include "src/core/lib/iomgr/exec_ctx.h"
namespace grpc_core {
@@ -35,17 +37,15 @@ class BackOff {
explicit BackOff(const Options& options);
/// Returns the time at which the next attempt should start.
- grpc_millis NextAttemptTime();
+ Timestamp NextAttemptTime();
/// Reset the backoff, so the next value returned by NextAttemptTime()
/// will be the time of the second attempt (rather than the Nth).
void Reset();
- void SetRandomSeed(unsigned int seed);
-
class Options {
public:
- Options& set_initial_backoff(grpc_millis initial_backoff) {
+ Options& set_initial_backoff(Duration initial_backoff) {
initial_backoff_ = initial_backoff;
return *this;
}
@@ -57,32 +57,32 @@ class BackOff {
jitter_ = jitter;
return *this;
}
- Options& set_max_backoff(grpc_millis max_backoff) {
+ Options& set_max_backoff(Duration max_backoff) {
max_backoff_ = max_backoff;
return *this;
}
/// how long to wait after the first failure before retrying
- grpc_millis initial_backoff() const { return initial_backoff_; }
+ Duration initial_backoff() const { return initial_backoff_; }
/// factor with which to multiply backoff after a failed retry
double multiplier() const { return multiplier_; }
/// amount to randomize backoffs
double jitter() const { return jitter_; }
/// maximum time between retries
- grpc_millis max_backoff() const { return max_backoff_; }
+ Duration max_backoff() const { return max_backoff_; }
private:
- grpc_millis initial_backoff_;
+ Duration initial_backoff_;
double multiplier_;
double jitter_;
- grpc_millis max_backoff_;
+ Duration max_backoff_;
}; // class Options
private:
const Options options_;
- uint32_t rng_state_;
+ absl::BitGen rand_gen_;
bool initial_;
/// current delay before retries
- grpc_millis current_backoff_;
+ Duration current_backoff_;
};
} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/call_finalization.h b/grpc/src/core/lib/channel/call_finalization.h
new file mode 100644
index 00000000..503f8c7c
--- /dev/null
+++ b/grpc/src/core/lib/channel/call_finalization.h
@@ -0,0 +1,86 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_CALL_FINALIZATION_H
+#define GRPC_CORE_LIB_CHANNEL_CALL_FINALIZATION_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/promise/context.h"
+#include "src/core/lib/resource_quota/arena.h"
+
+namespace grpc_core {
+
+// Call finalization context.
+// Sometimes a filter needs to perform some operation after the last byte of
+// data is flushed to the wire. This context is used to perform that
+// finalization.
+// Filters can register a finalizer by calling Add().
+// The finalizer will be called before the call is destroyed but after
+// the top level promise is completed.
+class CallFinalization {
+ public:
+ // Add a step to the finalization context.
+ // Takes a callable with a signature compatible with:
+ // (const grpc_call_final_info&) -> void.
+ // Finalizers are run in the reverse order they are added.
+ template <typename F>
+ void Add(F&& t) {
+ first_ =
+ GetContext<Arena>()->New<FuncFinalizer<F>>(std::forward<F>(t), first_);
+ }
+
+ void Run(const grpc_call_final_info* final_info) {
+ if (Finalizer* f = absl::exchange(first_, nullptr)) f->Run(final_info);
+ }
+
+ private:
+ // Base class for finalizer implementations.
+ class Finalizer {
+ public:
+ // Run the finalizer and call the destructor of this Finalizer.
+ virtual void Run(const grpc_call_final_info* final_info) = 0;
+
+ protected:
+ ~Finalizer() {}
+ };
+ // Specialization for callable objects.
+ template <typename F>
+ class FuncFinalizer final : public Finalizer {
+ public:
+ FuncFinalizer(F&& f, Finalizer* next)
+ : next_(next), f_(std::forward<F>(f)) {}
+
+ void Run(const grpc_call_final_info* final_info) override {
+ f_(final_info);
+ Finalizer* next = next_;
+ this->~FuncFinalizer();
+ if (next != nullptr) next->Run(final_info);
+ }
+
+ private:
+ Finalizer* next_;
+ F f_;
+ };
+ // The first finalizer in the chain.
+ Finalizer* first_ = nullptr;
+};
+
+template <>
+struct ContextType<CallFinalization> {};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CALL_FINALIZATION_H
diff --git a/grpc/src/core/lib/channel/call_tracer.h b/grpc/src/core/lib/channel/call_tracer.h
new file mode 100644
index 00000000..403ea7c5
--- /dev/null
+++ b/grpc/src/core/lib/channel/call_tracer.h
@@ -0,0 +1,88 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_CALL_TRACER_H
+#define GRPC_CORE_LIB_CHANNEL_CALL_TRACER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/strings/string_view.h"
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/transport/byte_stream.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// Interface for a tracer that records activities on a call. Actual attempts for
+// this call are traced with CallAttemptTracer after invoking RecordNewAttempt()
+// on the CallTracer object.
+class CallTracer {
+ public:
+ // Interface for a tracer that records activities on a particular call
+ // attempt.
+ // (A single RPC can have multiple attempts due to retry/hedging policies or
+ // as transparent retry attempts.)
+ class CallAttemptTracer {
+ public:
+ virtual ~CallAttemptTracer() {}
+ // Please refer to `grpc_transport_stream_op_batch_payload` for details on
+ // arguments.
+ virtual void RecordSendInitialMetadata(
+ grpc_metadata_batch* send_initial_metadata, uint32_t flags) = 0;
+ // TODO(yashkt): We are using gpr_atm here instead of absl::string_view
+ // since that's what the transport API uses, and performing an atomic load
+ // is unnecessary if the census tracer does not need it at present. Fix this
+ // when the transport API changes.
+ virtual void RecordOnDoneSendInitialMetadata(gpr_atm* peer_string) = 0;
+ virtual void RecordSendTrailingMetadata(
+ grpc_metadata_batch* send_trailing_metadata) = 0;
+ virtual void RecordSendMessage(const ByteStream& send_message) = 0;
+ // The `RecordReceivedInitialMetadata()` and `RecordReceivedMessage()`
+ // methods should only be invoked when the metadata/message was
+ // successfully received, i.e., without any error.
+ virtual void RecordReceivedInitialMetadata(
+ grpc_metadata_batch* recv_initial_metadata, uint32_t flags) = 0;
+ virtual void RecordReceivedMessage(const ByteStream& recv_message) = 0;
+ // If the call was cancelled before the recv_trailing_metadata op
+ // was started, recv_trailing_metadata and transport_stream_stats
+ // will be null.
+ virtual void RecordReceivedTrailingMetadata(
+ absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
+ const grpc_transport_stream_stats* transport_stream_stats) = 0;
+ virtual void RecordCancel(grpc_error_handle cancel_error) = 0;
+ // Should be the last API call to the object. Once invoked, the tracer
+ // library is free to destroy the object.
+ virtual void RecordEnd(const gpr_timespec& latency) = 0;
+ };
+
+ virtual ~CallTracer() {}
+
+ // Records a new attempt for the associated call. \a transparent denotes
+ // whether the attempt is being made as a transparent retry or as a
+ // non-transparent retry/heding attempt. (There will be at least one attempt
+ // even if the call is not being retried.) The `CallTracer` object retains
+ // ownership to the newly created `CallAttemptTracer` object. RecordEnd()
+ // serves as an indication that the call stack is done with all API calls, and
+ // the tracer library is free to destroy it after that.
+ virtual CallAttemptTracer* StartNewAttempt(bool is_transparent_retry) = 0;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CALL_TRACER_H
diff --git a/grpc/src/core/lib/channel/channel_args.cc b/grpc/src/core/lib/channel/channel_args.cc
index a383e5a0..d27b7d45 100644
--- a/grpc/src/core/lib/channel/channel_args.cc
+++ b/grpc/src/core/lib/channel/channel_args.cc
@@ -18,24 +18,149 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/channel/channel_args.h"
+
#include <limits.h>
#include <string.h>
+#include <map>
#include <vector>
+#include "absl/strings/match.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
-#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
-#include <grpc/impl/codegen/log.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/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/match.h"
+
+namespace {
+
+int PointerCompare(void* a_ptr, const grpc_arg_pointer_vtable* a_vtable,
+ void* b_ptr, const grpc_arg_pointer_vtable* b_vtable) {
+ int c = grpc_core::QsortCompare(a_ptr, b_ptr);
+ if (c == 0) return 0;
+ c = grpc_core::QsortCompare(a_vtable, b_vtable);
+ if (c != 0) return c;
+ return a_vtable->cmp(a_ptr, b_ptr);
+}
+
+} // namespace
+
+namespace grpc_core {
+
+bool ChannelArgs::Pointer::operator==(const Pointer& rhs) const {
+ return PointerCompare(p_, vtable_, rhs.p_, rhs.vtable_) == 0;
+}
+
+bool ChannelArgs::Pointer::operator<(const Pointer& rhs) const {
+ return PointerCompare(p_, vtable_, rhs.p_, rhs.vtable_) < 0;
+}
+
+ChannelArgs::ChannelArgs() = default;
+
+ChannelArgs ChannelArgs::Set(grpc_arg arg) const {
+ switch (arg.type) {
+ case GRPC_ARG_INTEGER:
+ return Set(arg.key, arg.value.integer);
+ case GRPC_ARG_STRING:
+ if (arg.value.string != nullptr) return Set(arg.key, arg.value.string);
+ return Set(arg.key, "");
+ case GRPC_ARG_POINTER:
+ return Set(arg.key,
+ Pointer(arg.value.pointer.vtable->copy(arg.value.pointer.p),
+ arg.value.pointer.vtable));
+ }
+ GPR_UNREACHABLE_CODE(return ChannelArgs());
+}
+
+ChannelArgs ChannelArgs::FromC(const grpc_channel_args* args) {
+ ChannelArgs result;
+ if (args != nullptr) {
+ for (size_t i = 0; i < args->num_args; i++) {
+ result = result.Set(args->args[i]);
+ }
+ }
+ return result;
+}
+
+const grpc_channel_args* ChannelArgs::ToC() const {
+ std::vector<grpc_arg> c_args;
+ args_.ForEach([&c_args](const std::string& key, const Value& value) {
+ char* name = const_cast<char*>(key.c_str());
+ c_args.push_back(Match(
+ value,
+ [name](int i) { return grpc_channel_arg_integer_create(name, i); },
+ [name](const std::string& s) {
+ return grpc_channel_arg_string_create(name,
+ const_cast<char*>(s.c_str()));
+ },
+ [name](const Pointer& p) {
+ return grpc_channel_arg_pointer_create(name, p.c_pointer(),
+ p.c_vtable());
+ }));
+ });
+ return grpc_channel_args_copy_and_add(nullptr, c_args.data(), c_args.size());
+}
+
+ChannelArgs ChannelArgs::Set(absl::string_view key, Value value) const {
+ return ChannelArgs(args_.Add(std::string(key), std::move(value)));
+}
+
+ChannelArgs ChannelArgs::Set(absl::string_view key,
+ absl::string_view value) const {
+ return Set(key, std::string(value));
+}
+
+ChannelArgs ChannelArgs::Set(absl::string_view key, const char* value) const {
+ return Set(key, std::string(value));
+}
+
+ChannelArgs ChannelArgs::Set(absl::string_view key, std::string value) const {
+ return Set(key, Value(std::move(value)));
+}
+
+ChannelArgs ChannelArgs::Remove(absl::string_view key) const {
+ return ChannelArgs(args_.Remove(key));
+}
+
+absl::optional<int> ChannelArgs::GetInt(absl::string_view name) const {
+ auto* v = Get(name);
+ if (v == nullptr) return absl::nullopt;
+ if (!absl::holds_alternative<int>(*v)) return absl::nullopt;
+ return absl::get<int>(*v);
+}
+
+absl::optional<Duration> ChannelArgs::GetDurationFromIntMillis(
+ absl::string_view name) const {
+ auto ms = GetInt(name);
+ if (!ms.has_value()) return absl::nullopt;
+ if (*ms == INT_MAX) return Duration::Infinity();
+ if (*ms == INT_MIN) return Duration::NegativeInfinity();
+ return Duration::Milliseconds(*ms);
+}
+
+absl::optional<absl::string_view> ChannelArgs::GetString(
+ absl::string_view name) const {
+ auto* v = Get(name);
+ if (v == nullptr) return absl::nullopt;
+ if (!absl::holds_alternative<std::string>(*v)) return absl::nullopt;
+ return absl::get<std::string>(*v);
+}
+
+void* ChannelArgs::GetVoidPointer(absl::string_view name) const {
+ auto* v = Get(name);
+ if (v == nullptr) return nullptr;
+ if (!absl::holds_alternative<Pointer>(*v)) return nullptr;
+ return absl::get<Pointer>(*v).c_pointer();
+}
+
+} // namespace grpc_core
static grpc_arg copy_arg(const grpc_arg* src) {
grpc_arg dst;
@@ -145,7 +270,7 @@ grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a,
}
static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {
- int c = GPR_ICMP(a->type, b->type);
+ int c = grpc_core::QsortCompare(a->type, b->type);
if (c != 0) return c;
c = strcmp(a->key, b->key);
if (c != 0) return c;
@@ -153,17 +278,10 @@ static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {
case GRPC_ARG_STRING:
return strcmp(a->value.string, b->value.string);
case GRPC_ARG_INTEGER:
- return GPR_ICMP(a->value.integer, b->value.integer);
+ return grpc_core::QsortCompare(a->value.integer, b->value.integer);
case GRPC_ARG_POINTER:
- c = GPR_ICMP(a->value.pointer.p, b->value.pointer.p);
- if (c != 0) {
- c = GPR_ICMP(a->value.pointer.vtable, b->value.pointer.vtable);
- if (c == 0) {
- c = a->value.pointer.vtable->cmp(a->value.pointer.p,
- b->value.pointer.p);
- }
- }
- return c;
+ return PointerCompare(a->value.pointer.p, a->value.pointer.vtable,
+ b->value.pointer.p, b->value.pointer.vtable);
}
GPR_UNREACHABLE_CODE(return 0);
}
@@ -174,7 +292,7 @@ static int cmp_key_stable(const void* ap, const void* bp) {
const grpc_arg* const* a = static_cast<const grpc_arg* const*>(ap);
const grpc_arg* const* b = static_cast<const grpc_arg* const*>(bp);
int c = strcmp((*a)->key, (*b)->key);
- if (c == 0) c = GPR_ICMP(*a, *b);
+ if (c == 0) c = grpc_core::QsortCompare(*a, *b);
return c;
}
@@ -224,7 +342,7 @@ int grpc_channel_args_compare(const grpc_channel_args* a,
const grpc_channel_args* b) {
if (a == nullptr && b == nullptr) return 0;
if (a == nullptr || b == nullptr) return a == nullptr ? -1 : 1;
- int c = GPR_ICMP(a->num_args, b->num_args);
+ int c = grpc_core::QsortCompare(a->num_args, b->num_args);
if (c != 0) return c;
for (size_t i = 0; i < a->num_args; i++) {
c = cmp_arg(&a->args[i], &b->args[i]);
@@ -366,6 +484,45 @@ std::string grpc_channel_args_string(const grpc_channel_args* args) {
return absl::StrJoin(arg_strings, ", ");
}
+namespace grpc_core {
+ChannelArgs ChannelArgsBuiltinPrecondition(const grpc_channel_args* src) {
+ if (src == nullptr) return ChannelArgs();
+ ChannelArgs output;
+ std::map<absl::string_view, std::vector<absl::string_view>>
+ concatenated_values;
+ for (size_t i = 0; i < src->num_args; i++) {
+ absl::string_view key = src->args[i].key;
+ // User-agent strings were traditionally multi-valued and concatenated.
+ // We preserve this behavior for backwards compatibility.
+ if (key == GRPC_ARG_PRIMARY_USER_AGENT_STRING ||
+ key == GRPC_ARG_SECONDARY_USER_AGENT_STRING) {
+ if (src->args[i].type != GRPC_ARG_STRING) {
+ gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
+ std::string(key).c_str());
+ } else {
+ concatenated_values[key].push_back(src->args[i].value.string);
+ }
+ continue;
+ } else if (absl::StartsWith(key, "grpc.internal.")) {
+ continue;
+ }
+ if (!output.Contains(key)) {
+ output = output.Set(src->args[i]);
+ } else {
+ // Traditional grpc_channel_args_find behavior was to pick the first
+ // value.
+ // For compatibility with existing users, we will do the same here.
+ }
+ }
+ // Concatenate the concatenated values.
+ for (const auto& concatenated_value : concatenated_values) {
+ output = output.Set(concatenated_value.first,
+ absl::StrJoin(concatenated_value.second, " "));
+ }
+ return output;
+}
+} // namespace grpc_core
+
namespace {
grpc_channel_args_client_channel_creation_mutator g_mutator = nullptr;
} // namespace
diff --git a/grpc/src/core/lib/channel/channel_args.h b/grpc/src/core/lib/channel/channel_args.h
index d95ae60b..a5883407 100644
--- a/grpc/src/core/lib/channel/channel_args.h
+++ b/grpc/src/core/lib/channel/channel_args.h
@@ -23,12 +23,218 @@
#include <string>
-#include <grpc/grpc.h>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+#include "absl/utility/utility.h"
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/avl/avl.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/surface/channel_stack_type.h"
// Channel args are intentionally immutable, to avoid the need for locking.
+namespace grpc_core {
+
+// Define a traits object for vtable lookup - allows us to integrate with
+// existing code easily (just define the trait!) and allows some magic in
+// ChannelArgs to automatically derive a vtable from a T*.
+// To participate as a pointer, instances should expose the function:
+// // Gets the vtable for this type
+// static const grpc_channel_arg_vtable* VTable();
+// // Performs any mutations required for channel args to own a pointer
+// // Only needed if ChannelArgs::Set is to be called with a raw pointer.
+// static void* TakeUnownedPointer(T* p);
+template <typename T, typename Ignored = void /* for SFINAE */>
+struct ChannelArgTypeTraits;
+
+// Specialization for ref-counted pointers.
+// Types should expose:
+// static int ChannelArgsCompare(const T* a, const T* b);
+template <typename T>
+struct ChannelArgTypeTraits<
+ T,
+ absl::enable_if_t<
+ std::is_base_of<RefCounted<T>, T>::value ||
+ std::is_base_of<RefCounted<T, NonPolymorphicRefCount>, T>::value ||
+ std::is_base_of<DualRefCounted<T>, T>::value,
+ void>> {
+ static const grpc_arg_pointer_vtable* VTable() {
+ static const grpc_arg_pointer_vtable tbl = {
+ // copy
+ [](void* p) -> void* { return static_cast<T*>(p)->Ref().release(); },
+ // destroy
+ [](void* p) { static_cast<T*>(p)->Unref(); },
+ // compare
+ [](void* p1, void* p2) {
+ return T::ChannelArgsCompare(static_cast<const T*>(p1),
+ static_cast<const T*>(p2));
+ },
+ };
+ return &tbl;
+ };
+};
+
+template <typename T>
+struct ChannelArgTypeTraits<T,
+ absl::void_t<typename T::RawPointerChannelArgTag>> {
+ static void* TakeUnownedPointer(T* p) { return p; }
+ static const grpc_arg_pointer_vtable* VTable() {
+ static const grpc_arg_pointer_vtable tbl = {
+ // copy
+ [](void* p) -> void* { return p; },
+ // destroy
+ [](void*) {},
+ // compare
+ [](void* p1, void* p2) { return QsortCompare(p1, p2); },
+ };
+ return &tbl;
+ };
+};
+
+class ChannelArgs {
+ public:
+ class Pointer {
+ public:
+ Pointer(void* p, const grpc_arg_pointer_vtable* vtable)
+ : p_(p), vtable_(vtable == nullptr ? EmptyVTable() : vtable) {}
+ ~Pointer() { vtable_->destroy(p_); }
+
+ Pointer(const Pointer& other)
+ : p_(other.vtable_->copy(other.p_)), vtable_(other.vtable_) {}
+ Pointer& operator=(Pointer other) {
+ std::swap(p_, other.p_);
+ std::swap(vtable_, other.vtable_);
+ return *this;
+ }
+ Pointer(Pointer&& other) noexcept : p_(other.p_), vtable_(other.vtable_) {
+ other.p_ = nullptr;
+ other.vtable_ = EmptyVTable();
+ }
+ Pointer& operator=(Pointer&& other) noexcept {
+ std::swap(p_, other.p_);
+ std::swap(vtable_, other.vtable_);
+ return *this;
+ }
+
+ bool operator==(const Pointer& rhs) const;
+ bool operator<(const Pointer& rhs) const;
+ bool operator!=(const Pointer& rhs) const { return !(*this == rhs); }
+
+ void* c_pointer() const { return p_; }
+
+ const grpc_arg_pointer_vtable* c_vtable() const { return vtable_; }
+
+ private:
+ static const grpc_arg_pointer_vtable* EmptyVTable() {
+ static const grpc_arg_pointer_vtable vtable = {
+ // copy
+ [](void* p) { return p; },
+ // destroy
+ [](void*) {},
+ // cmp
+ [](void* p1, void* p2) -> int { return QsortCompare(p1, p2); },
+ };
+ return &vtable;
+ }
+
+ void* p_;
+ const grpc_arg_pointer_vtable* vtable_;
+ };
+ using Value = absl::variant<int, std::string, Pointer>;
+
+ ChannelArgs();
+
+ static ChannelArgs FromC(const grpc_channel_args* args);
+ // Construct a new grpc_channel_args struct which the caller will own.
+ // It should be destroyed with grpc_channel_args_destroy.
+ const grpc_channel_args* ToC() const;
+
+ const Value* Get(absl::string_view name) const { return args_.Lookup(name); }
+ GRPC_MUST_USE_RESULT ChannelArgs Set(absl::string_view name,
+ Value value) const;
+ GRPC_MUST_USE_RESULT ChannelArgs Set(absl::string_view name,
+ absl::string_view value) const;
+ GRPC_MUST_USE_RESULT ChannelArgs Set(absl::string_view name,
+ std::string value) const;
+ GRPC_MUST_USE_RESULT ChannelArgs Set(absl::string_view name,
+ const char* value) const;
+ GRPC_MUST_USE_RESULT ChannelArgs Set(grpc_arg arg) const;
+ template <typename T>
+ GRPC_MUST_USE_RESULT absl::enable_if_t<
+ std::is_same<const grpc_arg_pointer_vtable*,
+ decltype(ChannelArgTypeTraits<T>::VTable())>::value,
+ ChannelArgs>
+ Set(absl::string_view name, T* value) const {
+ return Set(name, Pointer(ChannelArgTypeTraits<T>::TakeUnownedPointer(value),
+ ChannelArgTypeTraits<T>::VTable()));
+ }
+ template <typename T>
+ GRPC_MUST_USE_RESULT auto Set(absl::string_view name,
+ const RefCountedPtr<T>& value) const
+ -> absl::enable_if_t<
+ std::is_same<
+ const grpc_arg_pointer_vtable*,
+ decltype(ChannelArgTypeTraits<absl::remove_cvref_t<
+ decltype(*value->Ref())>>::VTable())>::value,
+ ChannelArgs> {
+ auto store_value = value->Ref();
+ return Set(
+ name,
+ Pointer(store_value.release(),
+ ChannelArgTypeTraits<
+ absl::remove_cvref_t<decltype(*store_value)>>::VTable()));
+ }
+ GRPC_MUST_USE_RESULT ChannelArgs Remove(absl::string_view name) const;
+ bool Contains(absl::string_view name) const { return Get(name) != nullptr; }
+
+ absl::optional<int> GetInt(absl::string_view name) const;
+ absl::optional<absl::string_view> GetString(absl::string_view name) const;
+ void* GetVoidPointer(absl::string_view name) const;
+ template <typename T>
+ T* GetPointer(absl::string_view name) const {
+ return static_cast<T*>(GetVoidPointer(name));
+ }
+ absl::optional<Duration> GetDurationFromIntMillis(
+ absl::string_view name) const;
+
+ // Object based get/set.
+ // Deal with the common case that we set a pointer to an object under
+ // the same name in every usage.
+ // Expects ChannelArgTypeTraits to exist for T, and T to expose:
+ // static string_view ChannelArgName();
+ template <typename T>
+ GRPC_MUST_USE_RESULT ChannelArgs SetObject(T* p) const {
+ return Set(T::ChannelArgName(), p);
+ }
+ template <typename T>
+ GRPC_MUST_USE_RESULT ChannelArgs SetObject(RefCountedPtr<T> p) const {
+ return Set(T::ChannelArgName(), std::move(p));
+ }
+ template <typename T>
+ T* GetObject() {
+ return GetPointer<T>(T::ChannelArgName());
+ }
+
+ bool operator<(const ChannelArgs& other) const { return args_ < other.args_; }
+ bool operator==(const ChannelArgs& other) const {
+ return args_ == other.args_;
+ }
+
+ private:
+ explicit ChannelArgs(AVL<std::string, Value> args) : args_(std::move(args)) {}
+
+ AVL<std::string, Value> args_;
+};
+
+} // namespace grpc_core
+
/** Copy the arguments in \a src into a new instance */
grpc_channel_args* grpc_channel_args_copy(const grpc_channel_args* src);
@@ -119,6 +325,13 @@ grpc_arg grpc_channel_arg_pointer_create(char* name, void* value,
// Returns a string representing channel args in human-readable form.
std::string grpc_channel_args_string(const grpc_channel_args* args);
+namespace grpc_core {
+// Ensure no duplicate channel args (with some backwards compatibility hacks).
+// Eliminate any grpc.internal.* args.
+// Return a C++ object.
+ChannelArgs ChannelArgsBuiltinPrecondition(const grpc_channel_args* src);
+} // namespace grpc_core
+
// Takes ownership of the old_args
typedef grpc_channel_args* (*grpc_channel_args_client_channel_creation_mutator)(
const char* target, grpc_channel_args* old_args,
diff --git a/grpc/src/core/lib/channel/channel_args_preconditioning.cc b/grpc/src/core/lib/channel/channel_args_preconditioning.cc
new file mode 100644
index 00000000..3e431a97
--- /dev/null
+++ b/grpc/src/core/lib/channel/channel_args_preconditioning.cc
@@ -0,0 +1,42 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_preconditioning.h"
+
+#include <grpc/support/alloc.h>
+
+namespace grpc_core {
+
+void ChannelArgsPreconditioning::Builder::RegisterStage(Stage stage) {
+ stages_.emplace_back(std::move(stage));
+}
+
+ChannelArgsPreconditioning ChannelArgsPreconditioning::Builder::Build() {
+ ChannelArgsPreconditioning preconditioning;
+ preconditioning.stages_ = std::move(stages_);
+ return preconditioning;
+}
+
+const grpc_channel_args* ChannelArgsPreconditioning::PreconditionChannelArgs(
+ const grpc_channel_args* args) const {
+ ChannelArgs channel_args = ChannelArgsBuiltinPrecondition(args);
+ for (auto& stage : stages_) {
+ channel_args = stage(std::move(channel_args));
+ }
+ return channel_args.ToC();
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/channel_args_preconditioning.h b/grpc/src/core/lib/channel/channel_args_preconditioning.h
new file mode 100644
index 00000000..06a4b5e7
--- /dev/null
+++ b/grpc/src/core/lib/channel/channel_args_preconditioning.h
@@ -0,0 +1,61 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
+#define GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <vector>
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+
+// Registry of mutators for channel args.
+// Surface APIs should call into this with channel args received from outside
+// of gRPC, in order to prepare those channel args for the expections of the
+// gRPC internals.
+class ChannelArgsPreconditioning {
+ public:
+ // Take channel args and mutate them.
+ // Does not take ownership of the channel args passed in.
+ // Returns a new channel args object that is owned by the caller.
+ using Stage = std::function<ChannelArgs(ChannelArgs)>;
+
+ class Builder {
+ public:
+ // Register a new channel args preconditioner.
+ void RegisterStage(Stage stage);
+ // Build out the preconditioners.
+ ChannelArgsPreconditioning Build();
+
+ private:
+ std::vector<Stage> stages_;
+ };
+
+ // Take channel args and precondition them.
+ // Does not take ownership of the channel args passed in.
+ // Returns a new channel args object that is owned by the caller.
+ const grpc_channel_args* PreconditionChannelArgs(
+ const grpc_channel_args* args) const;
+
+ private:
+ std::vector<Stage> stages_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
diff --git a/grpc/src/core/lib/channel/channel_stack.cc b/grpc/src/core/lib/channel/channel_stack.cc
index 122d7a91..3d02f19f 100644
--- a/grpc/src/core/lib/channel/channel_stack.cc
+++ b/grpc/src/core/lib/channel/channel_stack.cc
@@ -18,15 +18,18 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/gpr/alloc.h"
#include <stdlib.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/alloc.h"
+
grpc_core::TraceFlag grpc_trace_channel(false, "channel");
+grpc_core::TraceFlag grpc_trace_channel_stack(false, "channel_stack");
/* Memory layouts.
@@ -101,8 +104,15 @@ grpc_call_element* grpc_call_stack_element(grpc_call_stack* call_stack,
grpc_error_handle grpc_channel_stack_init(
int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg,
const grpc_channel_filter** filters, size_t filter_count,
- const grpc_channel_args* channel_args, grpc_transport* optional_transport,
- const char* name, grpc_channel_stack* stack) {
+ const grpc_channel_args* channel_args, const char* name,
+ grpc_channel_stack* stack) {
+ if (grpc_trace_channel_stack.enabled()) {
+ gpr_log(GPR_INFO, "CHANNEL_STACK: init %s", name);
+ for (size_t i = 0; i < filter_count; i++) {
+ gpr_log(GPR_INFO, "CHANNEL_STACK: filter %s", filters[i]->name);
+ }
+ }
+
size_t call_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call_stack)) +
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(filter_count * sizeof(grpc_call_element));
@@ -124,7 +134,6 @@ grpc_error_handle grpc_channel_stack_init(
for (i = 0; i < filter_count; i++) {
args.channel_stack = stack;
args.channel_args = channel_args;
- args.optional_transport = optional_transport;
args.is_first = i == 0;
args.is_last = i == (filter_count - 1);
elems[i].filter = filters[i];
diff --git a/grpc/src/core/lib/channel/channel_stack.h b/grpc/src/core/lib/channel/channel_stack.h
index 4832303c..5120a98a 100644
--- a/grpc/src/core/lib/channel/channel_stack.h
+++ b/grpc/src/core/lib/channel/channel_stack.h
@@ -48,15 +48,19 @@
#include <stddef.h>
+#include <functional>
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
typedef struct grpc_channel_element grpc_channel_element;
@@ -68,8 +72,6 @@ typedef struct grpc_call_stack grpc_call_stack;
struct grpc_channel_element_args {
grpc_channel_stack* channel_stack;
const grpc_channel_args* channel_args;
- /** Transport, iff it is known */
- grpc_transport* optional_transport;
int is_first;
int is_last;
};
@@ -78,8 +80,8 @@ struct grpc_call_element_args {
const void* server_transport_data;
grpc_call_context_element* context;
const grpc_slice& path;
- gpr_cycle_counter start_time;
- grpc_millis deadline;
+ gpr_cycle_counter start_time; // Note: not populated in subchannel stack.
+ grpc_core::Timestamp deadline;
grpc_core::Arena* arena;
grpc_core::CallCombiner* call_combiner;
};
@@ -109,6 +111,18 @@ struct grpc_channel_filter {
See grpc_call_next_op on how to call the next element in the stack */
void (*start_transport_stream_op_batch)(grpc_call_element* elem,
grpc_transport_stream_op_batch* op);
+ /* Create a promise to execute one call.
+ If this is non-null, it may be used in preference to
+ start_transport_stream_op_batch.
+ If this is used in preference to start_transport_stream_op_batch, the
+ following can be omitted also:
+ - calling init_call_elem, destroy_call_elem, set_pollset_or_pollset_set
+ - allocation of memory for call data
+ There is an on-going migration to move all filters to providing this, and
+ then to drop start_transport_stream_op_batch. */
+ grpc_core::ArenaPromise<grpc_core::ServerMetadataHandle> (*make_call_promise)(
+ grpc_channel_element* elem, grpc_core::CallArgs call_args,
+ grpc_core::NextPromiseFactory next_promise_factory);
/* Called to handle channel level operations - e.g. new calls, or transport
closure.
See grpc_channel_next_op on how to call the next element in the stack */
@@ -185,6 +199,18 @@ struct grpc_channel_stack {
/* Memory required for a call stack (computed at channel stack
initialization) */
size_t call_stack_size;
+
+ // Minimal infrastructure to act like a RefCounted thing without converting
+ // everything.
+ // It's likely that we'll want to replace grpc_channel_stack with something
+ // less regimented once the promise conversion completes, so avoiding doing a
+ // full C++-ification for now.
+ void IncrementRefCount();
+ void Unref();
+ grpc_core::RefCountedPtr<grpc_channel_stack> Ref() {
+ IncrementRefCount();
+ return grpc_core::RefCountedPtr<grpc_channel_stack>(this);
+ }
};
/* A call stack tracks a set of related filters for one call, and guarantees
@@ -221,8 +247,7 @@ size_t grpc_channel_stack_size(const grpc_channel_filter** filters,
grpc_error_handle grpc_channel_stack_init(
int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg,
const grpc_channel_filter** filters, size_t filter_count,
- const grpc_channel_args* args, grpc_transport* optional_transport,
- const char* name, grpc_channel_stack* stack);
+ const grpc_channel_args* args, const char* name, grpc_channel_stack* stack);
/* Destroy a channel stack */
void grpc_channel_stack_destroy(grpc_channel_stack* stack);
@@ -271,6 +296,14 @@ void grpc_call_stack_set_pollset_or_pollset_set(grpc_call_stack* call_stack,
} while (0);
#endif
+inline void grpc_channel_stack::IncrementRefCount() {
+ GRPC_CHANNEL_STACK_REF(this, "smart_pointer");
+}
+
+inline void grpc_channel_stack::Unref() {
+ GRPC_CHANNEL_STACK_UNREF(this, "smart_pointer");
+}
+
/* Destroy a call stack */
void grpc_call_stack_destroy(grpc_call_stack* stack,
const grpc_call_final_info* final_info,
diff --git a/grpc/src/core/lib/channel/channel_stack_builder.cc b/grpc/src/core/lib/channel/channel_stack_builder.cc
index 7f7cf753..3022efef 100644
--- a/grpc/src/core/lib/channel/channel_stack_builder.cc
+++ b/grpc/src/core/lib/channel/channel_stack_builder.cc
@@ -25,299 +25,40 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-typedef struct filter_node {
- struct filter_node* next;
- struct filter_node* prev;
- const grpc_channel_filter* filter;
- grpc_post_filter_create_init_func init;
- void* init_arg;
-} filter_node;
-
-struct grpc_channel_stack_builder {
- // sentinel nodes for filters that have been added
- filter_node begin;
- filter_node end;
- // various set/get-able parameters
- grpc_channel_args* args;
- grpc_transport* transport;
- grpc_resource_user* resource_user;
- char* target;
- const char* name;
-};
-
-struct grpc_channel_stack_builder_iterator {
- grpc_channel_stack_builder* builder;
- filter_node* node;
-};
-
-grpc_channel_stack_builder* grpc_channel_stack_builder_create(void) {
- grpc_channel_stack_builder* b =
- static_cast<grpc_channel_stack_builder*>(gpr_zalloc(sizeof(*b)));
-
- b->begin.filter = nullptr;
- b->end.filter = nullptr;
- b->begin.next = &b->end;
- b->begin.prev = &b->end;
- b->end.next = &b->begin;
- b->end.prev = &b->begin;
-
- return b;
-}
-
-void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
- const char* target) {
- gpr_free(b->target);
- b->target = gpr_strdup(target);
-}
-
-const char* grpc_channel_stack_builder_get_target(
- grpc_channel_stack_builder* b) {
- return b->target;
-}
-
-static grpc_channel_stack_builder_iterator* create_iterator_at_filter_node(
- grpc_channel_stack_builder* builder, filter_node* node) {
- grpc_channel_stack_builder_iterator* it =
- static_cast<grpc_channel_stack_builder_iterator*>(
- gpr_malloc(sizeof(*it)));
- it->builder = builder;
- it->node = node;
- return it;
-}
-
-void grpc_channel_stack_builder_iterator_destroy(
- grpc_channel_stack_builder_iterator* it) {
- gpr_free(it);
-}
-
-grpc_channel_stack_builder_iterator*
-grpc_channel_stack_builder_create_iterator_at_first(
- grpc_channel_stack_builder* builder) {
- return create_iterator_at_filter_node(builder, &builder->begin);
-}
-
-grpc_channel_stack_builder_iterator*
-grpc_channel_stack_builder_create_iterator_at_last(
- grpc_channel_stack_builder* builder) {
- return create_iterator_at_filter_node(builder, &builder->end);
-}
-
-bool grpc_channel_stack_builder_iterator_is_end(
- grpc_channel_stack_builder_iterator* iterator) {
- return iterator->node == &iterator->builder->end;
-}
-
-const char* grpc_channel_stack_builder_iterator_filter_name(
- grpc_channel_stack_builder_iterator* iterator) {
- if (iterator->node->filter == nullptr) return nullptr;
- return iterator->node->filter->name;
-}
-
-bool grpc_channel_stack_builder_move_next(
- grpc_channel_stack_builder_iterator* iterator) {
- if (iterator->node == &iterator->builder->end) return false;
- iterator->node = iterator->node->next;
- return true;
-}
-
-bool grpc_channel_stack_builder_move_prev(
- grpc_channel_stack_builder_iterator* iterator) {
- if (iterator->node == &iterator->builder->begin) return false;
- iterator->node = iterator->node->prev;
- return true;
-}
-
-grpc_channel_stack_builder_iterator* grpc_channel_stack_builder_iterator_find(
- grpc_channel_stack_builder* builder, const char* filter_name) {
- GPR_ASSERT(filter_name != nullptr);
- grpc_channel_stack_builder_iterator* it =
- grpc_channel_stack_builder_create_iterator_at_first(builder);
- while (grpc_channel_stack_builder_move_next(it)) {
- if (grpc_channel_stack_builder_iterator_is_end(it)) break;
- const char* filter_name_at_it =
- grpc_channel_stack_builder_iterator_filter_name(it);
- if (strcmp(filter_name, filter_name_at_it) == 0) break;
- }
- return it;
-}
-
-bool grpc_channel_stack_builder_move_prev(
- grpc_channel_stack_builder_iterator* iterator);
-
-void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder* builder,
- const char* name) {
- GPR_ASSERT(builder->name == nullptr);
- builder->name = name;
-}
-
-void grpc_channel_stack_builder_set_channel_arguments(
- grpc_channel_stack_builder* builder, const grpc_channel_args* args) {
- if (builder->args != nullptr) {
- grpc_channel_args_destroy(builder->args);
- }
- builder->args = grpc_channel_args_copy(args);
-}
-
-const grpc_channel_args* grpc_channel_stack_builder_get_channel_arguments(
- grpc_channel_stack_builder* builder) {
- return builder->args;
-}
-
-void grpc_channel_stack_builder_set_transport(
- grpc_channel_stack_builder* builder, grpc_transport* transport) {
- GPR_ASSERT(builder->transport == nullptr);
- builder->transport = transport;
-}
-
-grpc_transport* grpc_channel_stack_builder_get_transport(
- grpc_channel_stack_builder* builder) {
- return builder->transport;
-}
-
-void grpc_channel_stack_builder_set_resource_user(
- grpc_channel_stack_builder* builder, grpc_resource_user* resource_user) {
- GPR_ASSERT(builder->resource_user == nullptr);
- builder->resource_user = resource_user;
-}
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/gprpp/memory.h"
-grpc_resource_user* grpc_channel_stack_builder_get_resource_user(
- grpc_channel_stack_builder* builder) {
- return builder->resource_user;
-}
+namespace grpc_core {
-bool grpc_channel_stack_builder_append_filter(
- grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func, void* user_data) {
- grpc_channel_stack_builder_iterator* it =
- grpc_channel_stack_builder_create_iterator_at_last(builder);
- bool ok = grpc_channel_stack_builder_add_filter_before(
- it, filter, post_init_func, user_data);
- grpc_channel_stack_builder_iterator_destroy(it);
- return ok;
+ChannelStackBuilder::~ChannelStackBuilder() {
+ grpc_channel_args_destroy(args_);
}
-bool grpc_channel_stack_builder_remove_filter(
- grpc_channel_stack_builder* builder, const char* filter_name) {
- grpc_channel_stack_builder_iterator* it =
- grpc_channel_stack_builder_iterator_find(builder, filter_name);
- if (grpc_channel_stack_builder_iterator_is_end(it)) {
- grpc_channel_stack_builder_iterator_destroy(it);
- return false;
+ChannelStackBuilder& ChannelStackBuilder::SetTarget(const char* target) {
+ if (target == nullptr) {
+ target_ = unknown_target();
+ } else {
+ target_ = target;
}
- it->node->prev->next = it->node->next;
- it->node->next->prev = it->node->prev;
- gpr_free(it->node);
- grpc_channel_stack_builder_iterator_destroy(it);
- return true;
-}
-
-bool grpc_channel_stack_builder_prepend_filter(
- grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func, void* user_data) {
- grpc_channel_stack_builder_iterator* it =
- grpc_channel_stack_builder_create_iterator_at_first(builder);
- bool ok = grpc_channel_stack_builder_add_filter_after(
- it, filter, post_init_func, user_data);
- grpc_channel_stack_builder_iterator_destroy(it);
- return ok;
+ return *this;
}
-static void add_after(filter_node* before, const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func,
- void* user_data) {
- filter_node* new_node =
- static_cast<filter_node*>(gpr_malloc(sizeof(*new_node)));
- new_node->next = before->next;
- new_node->prev = before;
- new_node->next->prev = new_node->prev->next = new_node;
- new_node->filter = filter;
- new_node->init = post_init_func;
- new_node->init_arg = user_data;
+ChannelStackBuilder& ChannelStackBuilder::SetChannelArgs(
+ const grpc_channel_args* args) {
+ grpc_channel_args_destroy(args_);
+ args_ = grpc_channel_args_copy(args);
+ return *this;
}
-bool grpc_channel_stack_builder_add_filter_before(
- grpc_channel_stack_builder_iterator* iterator,
- const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func, void* user_data) {
- if (iterator->node == &iterator->builder->begin) return false;
- add_after(iterator->node->prev, filter, post_init_func, user_data);
- return true;
+void ChannelStackBuilder::PrependFilter(const grpc_channel_filter* filter,
+ PostInitFunc post_init) {
+ stack_.insert(stack_.begin(), {filter, std::move(post_init)});
}
-bool grpc_channel_stack_builder_add_filter_after(
- grpc_channel_stack_builder_iterator* iterator,
- const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func, void* user_data) {
- if (iterator->node == &iterator->builder->end) return false;
- add_after(iterator->node, filter, post_init_func, user_data);
- return true;
+void ChannelStackBuilder::AppendFilter(const grpc_channel_filter* filter,
+ PostInitFunc post_init) {
+ stack_.push_back({filter, std::move(post_init)});
}
-void grpc_channel_stack_builder_destroy(grpc_channel_stack_builder* builder) {
- filter_node* p = builder->begin.next;
- while (p != &builder->end) {
- filter_node* next = p->next;
- gpr_free(p);
- p = next;
- }
- if (builder->args != nullptr) {
- grpc_channel_args_destroy(builder->args);
- }
- gpr_free(builder->target);
- gpr_free(builder);
-}
-
-grpc_error_handle grpc_channel_stack_builder_finish(
- grpc_channel_stack_builder* builder, size_t prefix_bytes, int initial_refs,
- grpc_iomgr_cb_func destroy, void* destroy_arg, void** result) {
- // count the number of filters
- size_t num_filters = 0;
- for (filter_node* p = builder->begin.next; p != &builder->end; p = p->next) {
- num_filters++;
- }
-
- // create an array of filters
- const grpc_channel_filter** filters =
- static_cast<const grpc_channel_filter**>(
- gpr_malloc(sizeof(*filters) * num_filters));
- size_t i = 0;
- for (filter_node* p = builder->begin.next; p != &builder->end; p = p->next) {
- filters[i++] = p->filter;
- }
-
- // calculate the size of the channel stack
- size_t channel_stack_size = grpc_channel_stack_size(filters, num_filters);
-
- // allocate memory, with prefix_bytes followed by channel_stack_size
- *result = gpr_zalloc(prefix_bytes + channel_stack_size);
- // fetch a pointer to the channel stack
- grpc_channel_stack* channel_stack = reinterpret_cast<grpc_channel_stack*>(
- static_cast<char*>(*result) + prefix_bytes);
- // and initialize it
- grpc_error_handle error = grpc_channel_stack_init(
- initial_refs, destroy, destroy_arg == nullptr ? *result : destroy_arg,
- filters, num_filters, builder->args, builder->transport, builder->name,
- channel_stack);
-
- if (error != GRPC_ERROR_NONE) {
- grpc_channel_stack_destroy(channel_stack);
- gpr_free(*result);
- *result = nullptr;
- } else {
- // run post-initialization functions
- i = 0;
- for (filter_node* p = builder->begin.next; p != &builder->end;
- p = p->next) {
- if (p->init != nullptr) {
- p->init(channel_stack, grpc_channel_stack_element(channel_stack, i),
- p->init_arg);
- }
- i++;
- }
- }
-
- grpc_channel_stack_builder_destroy(builder);
- gpr_free(const_cast<grpc_channel_filter**>(filters));
-
- return error;
-}
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/channel_stack_builder.h b/grpc/src/core/lib/channel/channel_stack_builder.h
index 6782a148..41049d71 100644
--- a/grpc/src/core/lib/channel/channel_stack_builder.h
+++ b/grpc/src/core/lib/channel/channel_stack_builder.h
@@ -1,20 +1,16 @@
-/*
- *
- * 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.
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H
#define GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H
@@ -23,144 +19,109 @@
#include <stdbool.h>
+#include <functional>
+#include <vector>
+
+#include "absl/strings/string_view.h"
+
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/channel_stack.h"
-
-/// grpc_channel_stack_builder offers a programmatic interface to selected
-/// and order channel filters
-typedef struct grpc_channel_stack_builder grpc_channel_stack_builder;
-typedef struct grpc_channel_stack_builder_iterator
- grpc_channel_stack_builder_iterator;
-
-/// Create a new channel stack builder
-grpc_channel_stack_builder* grpc_channel_stack_builder_create(void);
-
-/// Assign a name to the channel stack: \a name must be statically allocated
-void grpc_channel_stack_builder_set_name(grpc_channel_stack_builder* builder,
- const char* name);
-
-/// Set the target uri
-void grpc_channel_stack_builder_set_target(grpc_channel_stack_builder* b,
- const char* target);
-
-const char* grpc_channel_stack_builder_get_target(
- grpc_channel_stack_builder* b);
-
-/// Attach \a transport to the builder (does not take ownership)
-void grpc_channel_stack_builder_set_transport(
- grpc_channel_stack_builder* builder, grpc_transport* transport);
-
-/// Fetch attached transport
-grpc_transport* grpc_channel_stack_builder_get_transport(
- grpc_channel_stack_builder* builder);
-
-/// Attach \a resource_user to the builder (does not take ownership)
-void grpc_channel_stack_builder_set_resource_user(
- grpc_channel_stack_builder* builder, grpc_resource_user* resource_user);
-
-/// Fetch attached resource user
-grpc_resource_user* grpc_channel_stack_builder_get_resource_user(
- grpc_channel_stack_builder* builder);
-
-/// Set channel arguments: copies args
-void grpc_channel_stack_builder_set_channel_arguments(
- grpc_channel_stack_builder* builder, const grpc_channel_args* args);
-
-/// Return a borrowed pointer to the channel arguments
-const grpc_channel_args* grpc_channel_stack_builder_get_channel_arguments(
- grpc_channel_stack_builder* builder);
-
-/// Begin iterating over already defined filters in the builder at the beginning
-grpc_channel_stack_builder_iterator*
-grpc_channel_stack_builder_create_iterator_at_first(
- grpc_channel_stack_builder* builder);
-
-/// Begin iterating over already defined filters in the builder at the end
-grpc_channel_stack_builder_iterator*
-grpc_channel_stack_builder_create_iterator_at_last(
- grpc_channel_stack_builder* builder);
-
-/// Is an iterator at the first element?
-bool grpc_channel_stack_builder_iterator_is_first(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// Is an iterator at the end?
-bool grpc_channel_stack_builder_iterator_is_end(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// What is the name of the filter at this iterator position?
-const char* grpc_channel_stack_builder_iterator_filter_name(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// Move an iterator to the next item
-bool grpc_channel_stack_builder_move_next(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// Move an iterator to the previous item
-bool grpc_channel_stack_builder_move_prev(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// Return an iterator at \a filter_name, or at the end of the list if not
-/// found.
-grpc_channel_stack_builder_iterator* grpc_channel_stack_builder_iterator_find(
- grpc_channel_stack_builder* builder, const char* filter_name);
-
-typedef void (*grpc_post_filter_create_init_func)(
- grpc_channel_stack* channel_stack, grpc_channel_element* elem, void* arg);
-
-/// Add \a filter to the stack, after \a iterator.
-/// Call \a post_init_func(..., \a user_data) once the channel stack is
-/// created.
-bool grpc_channel_stack_builder_add_filter_after(
- grpc_channel_stack_builder_iterator* iterator,
- const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func,
- void* user_data) GRPC_MUST_USE_RESULT;
-
-/// Add \a filter to the stack, before \a iterator.
-/// Call \a post_init_func(..., \a user_data) once the channel stack is
-/// created.
-bool grpc_channel_stack_builder_add_filter_before(
- grpc_channel_stack_builder_iterator* iterator,
- const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func,
- void* user_data) GRPC_MUST_USE_RESULT;
-
-/// Add \a filter to the beginning of the filter list.
-/// Call \a post_init_func(..., \a user_data) once the channel stack is
-/// created.
-bool grpc_channel_stack_builder_prepend_filter(
- grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func,
- void* user_data) GRPC_MUST_USE_RESULT;
-
-/// Add \a filter to the end of the filter list.
-/// Call \a post_init_func(..., \a user_data) once the channel stack is
-/// created.
-bool grpc_channel_stack_builder_append_filter(
- grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
- grpc_post_filter_create_init_func post_init_func,
- void* user_data) GRPC_MUST_USE_RESULT;
-
-/// Remove any filter whose name is \a filter_name from \a builder. Returns true
-/// if \a filter_name was not found.
-bool grpc_channel_stack_builder_remove_filter(
- grpc_channel_stack_builder* builder, const char* filter_name);
-
-/// Terminate iteration and destroy \a iterator
-void grpc_channel_stack_builder_iterator_destroy(
- grpc_channel_stack_builder_iterator* iterator);
-
-/// Destroy the builder, return the freshly minted channel stack in \a result.
-/// Allocates \a prefix_bytes bytes before the channel stack
-/// Returns the base pointer of the allocated block
-/// \a initial_refs, \a destroy, \a destroy_arg are as per
-/// grpc_channel_stack_init
-grpc_error_handle grpc_channel_stack_builder_finish(
- grpc_channel_stack_builder* builder, size_t prefix_bytes, int initial_refs,
- grpc_iomgr_cb_func destroy, void* destroy_arg, void** result);
-
-/// Destroy the builder without creating a channel stack
-void grpc_channel_stack_builder_destroy(grpc_channel_stack_builder* builder);
-
-#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H */
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/surface/channel_stack_type.h"
+
+typedef struct grpc_channel_stack grpc_channel_stack;
+typedef struct grpc_channel_element grpc_channel_element;
+typedef struct grpc_channel_filter grpc_channel_filter;
+typedef struct grpc_transport grpc_transport;
+
+namespace grpc_core {
+
+// Build a channel stack.
+// Allows interested parties to add filters to the stack, and to query an
+// in-progress build.
+// Carries some useful context for the channel stack, such as a target string
+// and a transport.
+class ChannelStackBuilder {
+ public:
+ // A function that will be called after the channel stack is successfully
+ // built.
+ using PostInitFunc = std::function<void(grpc_channel_stack* channel_stack,
+ grpc_channel_element* elem)>;
+
+ // One filter in the currently building stack.
+ struct StackEntry {
+ const grpc_channel_filter* filter;
+ PostInitFunc post_init;
+ };
+
+ // Initialize with a name.
+ ChannelStackBuilder(const char* name, grpc_channel_stack_type type)
+ : name_(name), type_(type) {}
+
+ const char* name() const { return name_; }
+
+ // Set the target string.
+ ChannelStackBuilder& SetTarget(const char* target);
+
+ // Query the target.
+ absl::string_view target() const { return target_; }
+
+ // Set the transport.
+ ChannelStackBuilder& SetTransport(grpc_transport* transport) {
+ GPR_ASSERT(transport_ == nullptr);
+ transport_ = transport;
+ return *this;
+ }
+
+ // Query the transport.
+ grpc_transport* transport() const { return transport_; }
+
+ // Set channel args (takes a copy of them).
+ ChannelStackBuilder& SetChannelArgs(const grpc_channel_args* args);
+
+ // Query the channel args.
+ const grpc_channel_args* channel_args() const { return args_; }
+
+ // Mutable vector of proposed stack entries.
+ std::vector<StackEntry>* mutable_stack() { return &stack_; }
+
+ // The type of channel stack being built.
+ grpc_channel_stack_type channel_stack_type() const { return type_; }
+
+ // Helper to add a filter to the front of the stack.
+ void PrependFilter(const grpc_channel_filter* filter, PostInitFunc post_init);
+
+ // Helper to add a filter to the end of the stack.
+ void AppendFilter(const grpc_channel_filter* filter, PostInitFunc post_init);
+
+ // Build the channel stack.
+ // After success, *result holds the new channel stack,
+ // prefix_bytes are allocated before the channel stack,
+ // initial_refs, destroy, destroy_arg are as per grpc_channel_stack_init
+ // On failure, *result is nullptr.
+ virtual grpc_error_handle Build(size_t prefix_bytes, int initial_refs,
+ grpc_iomgr_cb_func destroy, void* destroy_arg,
+ void** result) = 0;
+
+ protected:
+ ~ChannelStackBuilder();
+
+ private:
+ static std::string unknown_target() { return "unknown"; }
+
+ // The name of the stack
+ const char* const name_;
+ // The type of stack being built
+ const grpc_channel_stack_type type_;
+ // The target
+ std::string target_{unknown_target()};
+ // The transport
+ grpc_transport* transport_ = nullptr;
+ // Channel args
+ const grpc_channel_args* args_ = nullptr;
+ // The in-progress stack
+ std::vector<StackEntry> stack_;
+};
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H
diff --git a/grpc/src/core/lib/channel/channel_stack_builder_impl.cc b/grpc/src/core/lib/channel/channel_stack_builder_impl.cc
new file mode 100644
index 00000000..39c9bd36
--- /dev/null
+++ b/grpc/src/core/lib/channel/channel_stack_builder_impl.cc
@@ -0,0 +1,102 @@
+/*
+ *
+ * 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/channel/channel_stack_builder_impl.h"
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/gprpp/memory.h"
+
+namespace grpc_core {
+
+grpc_error_handle ChannelStackBuilderImpl::Build(size_t prefix_bytes,
+ int initial_refs,
+ grpc_iomgr_cb_func destroy,
+ void* destroy_arg,
+ void** result) {
+ auto* stack = mutable_stack();
+
+ // create an array of filters
+ std::vector<const grpc_channel_filter*> filters;
+ filters.reserve(stack->size());
+ for (const auto& elem : *stack) {
+ filters.push_back(elem.filter);
+ }
+
+ // calculate the size of the channel stack
+ size_t channel_stack_size =
+ grpc_channel_stack_size(filters.data(), filters.size());
+
+ // allocate memory, with prefix_bytes followed by channel_stack_size
+ *result = gpr_zalloc(prefix_bytes + channel_stack_size);
+ // fetch a pointer to the channel stack
+ grpc_channel_stack* channel_stack = reinterpret_cast<grpc_channel_stack*>(
+ static_cast<char*>(*result) + prefix_bytes);
+
+ const grpc_channel_args* final_args;
+ if (transport() != nullptr) {
+ static const grpc_arg_pointer_vtable vtable = {
+ // copy
+ [](void* p) { return p; },
+ // destroy
+ [](void*) {},
+ // cmp
+ [](void* a, void* b) { return QsortCompare(a, b); },
+ };
+ grpc_arg arg = grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_TRANSPORT), transport(), &vtable);
+ final_args = grpc_channel_args_copy_and_add(channel_args(), &arg, 1);
+ } else {
+ final_args = channel_args();
+ }
+
+ // and initialize it
+ grpc_error_handle error = grpc_channel_stack_init(
+ initial_refs, destroy, destroy_arg == nullptr ? *result : destroy_arg,
+ filters.data(), filters.size(), final_args, name(), channel_stack);
+
+ if (final_args != channel_args()) {
+ grpc_channel_args_destroy(final_args);
+ }
+
+ if (error != GRPC_ERROR_NONE) {
+ grpc_channel_stack_destroy(channel_stack);
+ gpr_free(*result);
+ *result = nullptr;
+ return error;
+ }
+
+ // run post-initialization functions
+ for (size_t i = 0; i < filters.size(); i++) {
+ if ((*stack)[i].post_init != nullptr) {
+ (*stack)[i].post_init(channel_stack,
+ grpc_channel_stack_element(channel_stack, i));
+ }
+ }
+
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/channel_stack_builder_impl.h b/grpc/src/core/lib/channel/channel_stack_builder_impl.h
new file mode 100644
index 00000000..4290f2f5
--- /dev/null
+++ b/grpc/src/core/lib/channel/channel_stack_builder_impl.h
@@ -0,0 +1,48 @@
+// 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_LIB_CHANNEL_CHANNEL_STACK_BUILDER_IMPL_H
+#define GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdbool.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"
+
+namespace grpc_core {
+
+// Build a channel stack.
+// Allows interested parties to add filters to the stack, and to query an
+// in-progress build.
+// Carries some useful context for the channel stack, such as a target string
+// and a transport.
+class ChannelStackBuilderImpl final : public ChannelStackBuilder {
+ public:
+ using ChannelStackBuilder::ChannelStackBuilder;
+
+ // Build the channel stack.
+ // After success, *result holds the new channel stack,
+ // prefix_bytes are allocated before the channel stack,
+ // initial_refs, destroy, destroy_arg are as per grpc_channel_stack_init
+ // On failure, *result is nullptr.
+ grpc_error_handle Build(size_t prefix_bytes, int initial_refs,
+ grpc_iomgr_cb_func destroy, void* destroy_arg,
+ void** result) override;
+};
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_IMPL_H
diff --git a/grpc/src/core/lib/channel/channel_trace.cc b/grpc/src/core/lib/channel/channel_trace.cc
index 5fc0f9a0..2d9e747c 100644
--- a/grpc/src/core/lib/channel/channel_trace.cc
+++ b/grpc/src/core/lib/channel/channel_trace.cc
@@ -16,17 +16,18 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_trace.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
@@ -45,8 +46,7 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity)
: severity_(severity),
data_(data),
- timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME)),
+ timestamp_(ExecCtx::Get()->Now().as_timespec(GPR_CLOCK_REALTIME)),
next_(nullptr),
referenced_entity_(std::move(referenced_entity)),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@@ -54,8 +54,7 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data)
: severity_(severity),
data_(data),
- timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME)),
+ timestamp_(ExecCtx::Get()->Now().as_timespec(GPR_CLOCK_REALTIME)),
next_(nullptr),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@@ -71,8 +70,7 @@ ChannelTrace::ChannelTrace(size_t max_event_memory)
return; // tracing is disabled if max_event_memory_ == 0
}
gpr_mu_init(&tracer_mu_);
- time_created_ = grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME);
+ time_created_ = ExecCtx::Get()->Now().as_timespec(GPR_CLOCK_REALTIME);
}
ChannelTrace::~ChannelTrace() {
diff --git a/grpc/src/core/lib/channel/channel_trace.h b/grpc/src/core/lib/channel/channel_trace.h
index 126abc7e..deff60a6 100644
--- a/grpc/src/core/lib/channel/channel_trace.h
+++ b/grpc/src/core/lib/channel/channel_trace.h
@@ -19,9 +19,10 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
#define GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include <grpc/grpc.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"
diff --git a/grpc/src/core/lib/channel/channelz.cc b/grpc/src/core/lib/channel/channelz.cc
index 452d6641..cad4e8ec 100644
--- a/grpc/src/core/lib/channel/channelz.cc
+++ b/grpc/src/core/lib/channel/channelz.cc
@@ -16,7 +16,7 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channelz.h"
@@ -24,6 +24,8 @@
#include <stdlib.h>
#include <string.h>
+#include <atomic>
+
#include "absl/strings/escaping.h"
#include "absl/strings/strip.h"
@@ -32,12 +34,12 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
@@ -76,7 +78,7 @@ std::string BaseNode::RenderJsonString() {
//
CallCountingHelper::CallCountingHelper() {
- num_cores_ = GPR_MAX(1, gpr_cpu_num_cores());
+ num_cores_ = std::max(1u, gpr_cpu_num_cores());
per_cpu_counter_data_storage_.reserve(num_cores_);
for (size_t i = 0; i < num_cores_; ++i) {
per_cpu_counter_data_storage_.emplace_back();
@@ -86,34 +88,34 @@ CallCountingHelper::CallCountingHelper() {
void CallCountingHelper::RecordCallStarted() {
AtomicCounterData& data =
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()];
- data.calls_started.FetchAdd(1, MemoryOrder::RELAXED);
- data.last_call_started_cycle.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ data.calls_started.fetch_add(1, std::memory_order_relaxed);
+ data.last_call_started_cycle.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void CallCountingHelper::RecordCallFailed() {
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()]
- .calls_failed.FetchAdd(1, MemoryOrder::RELAXED);
+ .calls_failed.fetch_add(1, std::memory_order_relaxed);
}
void CallCountingHelper::RecordCallSucceeded() {
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()]
- .calls_succeeded.FetchAdd(1, MemoryOrder::RELAXED);
+ .calls_succeeded.fetch_add(1, std::memory_order_relaxed);
}
void CallCountingHelper::CollectData(CounterData* out) {
for (size_t core = 0; core < num_cores_; ++core) {
AtomicCounterData& data = per_cpu_counter_data_storage_[core];
- out->calls_started += data.calls_started.Load(MemoryOrder::RELAXED);
+ out->calls_started += data.calls_started.load(std::memory_order_relaxed);
out->calls_succeeded +=
- per_cpu_counter_data_storage_[core].calls_succeeded.Load(
- MemoryOrder::RELAXED);
- out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.Load(
- MemoryOrder::RELAXED);
+ per_cpu_counter_data_storage_[core].calls_succeeded.load(
+ std::memory_order_relaxed);
+ out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.load(
+ std::memory_order_relaxed);
const gpr_cycle_counter last_call =
- per_cpu_counter_data_storage_[core].last_call_started_cycle.Load(
- MemoryOrder::RELAXED);
+ per_cpu_counter_data_storage_[core].last_call_started_cycle.load(
+ std::memory_order_relaxed);
if (last_call > out->last_call_started_cycle) {
out->last_call_started_cycle = last_call;
}
@@ -173,7 +175,7 @@ Json ChannelNode::RenderJson() {
};
// Connectivity state.
// If low-order bit is on, then the field is set.
- int state_field = connectivity_state_.Load(MemoryOrder::RELAXED);
+ int state_field = connectivity_state_.load(std::memory_order_relaxed);
if ((state_field & 1) != 0) {
grpc_connectivity_state state =
static_cast<grpc_connectivity_state>(state_field >> 1);
@@ -227,7 +229,7 @@ void ChannelNode::PopulateChildRefs(Json::Object* json) {
void ChannelNode::SetConnectivityState(grpc_connectivity_state state) {
// Store with low-order bit set to indicate that the field is set.
int state_field = (state << 1) + 1;
- connectivity_state_.Store(state_field, MemoryOrder::RELAXED);
+ connectivity_state_.store(state_field, std::memory_order_relaxed);
}
void ChannelNode::AddChildChannel(intptr_t child_uuid) {
@@ -397,7 +399,7 @@ void SecurityArgDestroy(void* p) {
xds_certificate_provider->Unref();
}
-int SecurityArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int SecurityArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kChannelArgVtable = {
SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp};
@@ -474,37 +476,38 @@ SocketNode::SocketNode(std::string local, std::string remote, std::string name,
security_(std::move(security)) {}
void SocketNode::RecordStreamStartedFromLocal() {
- streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
- last_local_stream_created_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ streams_started_.fetch_add(1, std::memory_order_relaxed);
+ last_local_stream_created_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordStreamStartedFromRemote() {
- streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
- last_remote_stream_created_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ streams_started_.fetch_add(1, std::memory_order_relaxed);
+ last_remote_stream_created_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordMessagesSent(uint32_t num_sent) {
- messages_sent_.FetchAdd(num_sent, MemoryOrder::RELAXED);
- last_message_sent_cycle_.Store(gpr_get_cycle_counter(), MemoryOrder::RELAXED);
+ messages_sent_.fetch_add(num_sent, std::memory_order_relaxed);
+ last_message_sent_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordMessageReceived() {
- messages_received_.FetchAdd(1, MemoryOrder::RELAXED);
- last_message_received_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ messages_received_.fetch_add(1, std::memory_order_relaxed);
+ last_message_received_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
Json SocketNode::RenderJson() {
// Create and fill the data child.
Json::Object data;
gpr_timespec ts;
- int64_t streams_started = streams_started_.Load(MemoryOrder::RELAXED);
+ int64_t streams_started = streams_started_.load(std::memory_order_relaxed);
if (streams_started != 0) {
data["streamsStarted"] = std::to_string(streams_started);
gpr_cycle_counter last_local_stream_created_cycle =
- last_local_stream_created_cycle_.Load(MemoryOrder::RELAXED);
+ last_local_stream_created_cycle_.load(std::memory_order_relaxed);
if (last_local_stream_created_cycle != 0) {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_local_stream_created_cycle),
@@ -512,7 +515,7 @@ Json SocketNode::RenderJson() {
data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
gpr_cycle_counter last_remote_stream_created_cycle =
- last_remote_stream_created_cycle_.Load(MemoryOrder::RELAXED);
+ last_remote_stream_created_cycle_.load(std::memory_order_relaxed);
if (last_remote_stream_created_cycle != 0) {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
@@ -520,33 +523,35 @@ Json SocketNode::RenderJson() {
data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
}
- int64_t streams_succeeded = streams_succeeded_.Load(MemoryOrder::RELAXED);
+ int64_t streams_succeeded =
+ streams_succeeded_.load(std::memory_order_relaxed);
if (streams_succeeded != 0) {
data["streamsSucceeded"] = std::to_string(streams_succeeded);
}
- int64_t streams_failed = streams_failed_.Load(MemoryOrder::RELAXED);
+ int64_t streams_failed = streams_failed_.load(std::memory_order_relaxed);
if (streams_failed != 0) {
data["streamsFailed"] = std::to_string(streams_failed);
}
- int64_t messages_sent = messages_sent_.Load(MemoryOrder::RELAXED);
+ int64_t messages_sent = messages_sent_.load(std::memory_order_relaxed);
if (messages_sent != 0) {
data["messagesSent"] = std::to_string(messages_sent);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
- last_message_sent_cycle_.Load(MemoryOrder::RELAXED)),
+ last_message_sent_cycle_.load(std::memory_order_relaxed)),
GPR_CLOCK_REALTIME);
data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
}
- int64_t messages_received = messages_received_.Load(MemoryOrder::RELAXED);
+ int64_t messages_received =
+ messages_received_.load(std::memory_order_relaxed);
if (messages_received != 0) {
data["messagesReceived"] = std::to_string(messages_received);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
- last_message_received_cycle_.Load(MemoryOrder::RELAXED)),
+ last_message_received_cycle_.load(std::memory_order_relaxed)),
GPR_CLOCK_REALTIME);
data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
}
- int64_t keepalives_sent = keepalives_sent_.Load(MemoryOrder::RELAXED);
+ int64_t keepalives_sent = keepalives_sent_.load(std::memory_order_relaxed);
if (keepalives_sent != 0) {
data["keepAlivesSent"] = std::to_string(keepalives_sent);
}
diff --git a/grpc/src/core/lib/channel/channelz.h b/grpc/src/core/lib/channel/channelz.h
index a0a449ef..2852e09d 100644
--- a/grpc/src/core/lib/channel/channelz.h
+++ b/grpc/src/core/lib/channel/channelz.h
@@ -19,19 +19,19 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
#define GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
-#include <grpc/impl/codegen/port_platform.h>
-
-#include <grpc/grpc.h>
+#include <grpc/support/port_platform.h>
+#include <atomic>
#include <set>
#include <string>
#include "absl/container/inlined_vector.h"
#include "absl/types/optional.h"
+#include <grpc/grpc.h>
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -41,7 +41,7 @@
#include "src/core/lib/json/json.h"
// Channel arg key for channelz node.
-#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.channelz_channel_node"
+#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.internal.channelz_channel_node"
// Channel arg key for indicating an internal channel.
#define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL \
@@ -134,19 +134,19 @@ class CallCountingHelper {
// Define the ctors so that we can use this structure in InlinedVector.
AtomicCounterData() = default;
AtomicCounterData(const AtomicCounterData& that)
- : calls_started(that.calls_started.Load(MemoryOrder::RELAXED)),
- calls_succeeded(that.calls_succeeded.Load(MemoryOrder::RELAXED)),
- calls_failed(that.calls_failed.Load(MemoryOrder::RELAXED)),
+ : calls_started(that.calls_started.load(std::memory_order_relaxed)),
+ calls_succeeded(that.calls_succeeded.load(std::memory_order_relaxed)),
+ calls_failed(that.calls_failed.load(std::memory_order_relaxed)),
last_call_started_cycle(
- that.last_call_started_cycle.Load(MemoryOrder::RELAXED)) {}
+ that.last_call_started_cycle.load(std::memory_order_relaxed)) {}
- Atomic<int64_t> calls_started{0};
- Atomic<int64_t> calls_succeeded{0};
- Atomic<int64_t> calls_failed{0};
- Atomic<gpr_cycle_counter> last_call_started_cycle{0};
+ std::atomic<int64_t> calls_started{0};
+ std::atomic<int64_t> calls_succeeded{0};
+ std::atomic<int64_t> calls_failed{0};
+ std::atomic<gpr_cycle_counter> last_call_started_cycle{0};
// 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>)];
+ uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(std::atomic<intptr_t>) -
+ sizeof(std::atomic<gpr_cycle_counter>)];
};
// TODO(soheilhy,veblush): Revist this after abseil integration.
// This has a problem when using abseil inlined_vector because it
@@ -220,7 +220,7 @@ class ChannelNode : public BaseNode {
// Least significant bit indicates whether the value is set. Remaining
// bits are a grpc_connectivity_state value.
- Atomic<int> connectivity_state_{0};
+ std::atomic<int> connectivity_state_{0};
Mutex child_mu_; // Guards sets below.
std::set<intptr_t> child_channels_;
@@ -276,6 +276,9 @@ class SocketNode : public BaseNode {
public:
struct Security : public RefCounted<Security> {
struct Tls {
+ // This is a workaround for https://bugs.llvm.org/show_bug.cgi?id=50346
+ Tls() {}
+
enum class NameType { kUnset = 0, kStandardName = 1, kOtherName = 2 };
NameType type = NameType::kUnset;
// Holds the value of standard_name or other_names if type is not kUnset.
@@ -307,30 +310,30 @@ class SocketNode : public BaseNode {
void RecordStreamStartedFromLocal();
void RecordStreamStartedFromRemote();
void RecordStreamSucceeded() {
- streams_succeeded_.FetchAdd(1, MemoryOrder::RELAXED);
+ streams_succeeded_.fetch_add(1, std::memory_order_relaxed);
}
void RecordStreamFailed() {
- streams_failed_.FetchAdd(1, MemoryOrder::RELAXED);
+ streams_failed_.fetch_add(1, std::memory_order_relaxed);
}
void RecordMessagesSent(uint32_t num_sent);
void RecordMessageReceived();
void RecordKeepaliveSent() {
- keepalives_sent_.FetchAdd(1, MemoryOrder::RELAXED);
+ keepalives_sent_.fetch_add(1, std::memory_order_relaxed);
}
const std::string& remote() { return remote_; }
private:
- Atomic<int64_t> streams_started_{0};
- Atomic<int64_t> streams_succeeded_{0};
- Atomic<int64_t> streams_failed_{0};
- Atomic<int64_t> messages_sent_{0};
- Atomic<int64_t> messages_received_{0};
- Atomic<int64_t> keepalives_sent_{0};
- Atomic<gpr_cycle_counter> last_local_stream_created_cycle_{0};
- 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};
+ std::atomic<int64_t> streams_started_{0};
+ std::atomic<int64_t> streams_succeeded_{0};
+ std::atomic<int64_t> streams_failed_{0};
+ std::atomic<int64_t> messages_sent_{0};
+ std::atomic<int64_t> messages_received_{0};
+ std::atomic<int64_t> keepalives_sent_{0};
+ std::atomic<gpr_cycle_counter> last_local_stream_created_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_remote_stream_created_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_message_sent_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_message_received_cycle_{0};
std::string local_;
std::string remote_;
RefCountedPtr<Security> const security_;
diff --git a/grpc/src/core/lib/channel/channelz_registry.cc b/grpc/src/core/lib/channel/channelz_registry.cc
index c76b5b43..3ef24792 100644
--- a/grpc/src/core/lib/channel/channelz_registry.cc
+++ b/grpc/src/core/lib/channel/channelz_registry.cc
@@ -16,25 +16,26 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channelz_registry.h"
#include <algorithm>
#include <cstring>
#include "absl/container/inlined_vector.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/sync.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-
namespace grpc_core {
namespace channelz {
namespace {
diff --git a/grpc/src/core/lib/channel/channelz_registry.h b/grpc/src/core/lib/channel/channelz_registry.h
index 8fcb7d86..8fd19f9b 100644
--- a/grpc/src/core/lib/channel/channelz_registry.h
+++ b/grpc/src/core/lib/channel/channelz_registry.h
@@ -19,7 +19,7 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H
#define GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include <stdint.h>
diff --git a/grpc/src/core/lib/channel/connected_channel.cc b/grpc/src/core/lib/channel/connected_channel.cc
index 12b3d786..b004e628 100644
--- a/grpc/src/core/lib/channel/connected_channel.cc
+++ b/grpc/src/core/lib/channel/connected_channel.cc
@@ -28,6 +28,7 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/transport/transport.h"
@@ -202,6 +203,7 @@ static void connected_channel_get_channel_info(
const grpc_channel_filter grpc_connected_filter = {
connected_channel_start_transport_stream_op_batch,
+ nullptr,
connected_channel_start_transport_op,
sizeof(call_data),
connected_channel_init_call_elem,
@@ -231,13 +233,15 @@ static void bind_transport(grpc_channel_stack* channel_stack,
grpc_transport_stream_size(static_cast<grpc_transport*>(t));
}
-bool grpc_add_connected_filter(grpc_channel_stack_builder* builder,
- void* arg_must_be_null) {
- GPR_ASSERT(arg_must_be_null == nullptr);
- grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
+bool grpc_add_connected_filter(grpc_core::ChannelStackBuilder* builder) {
+ grpc_transport* t = builder->transport();
GPR_ASSERT(t != nullptr);
- return grpc_channel_stack_builder_append_filter(
- builder, &grpc_connected_filter, bind_transport, t);
+ builder->AppendFilter(
+ &grpc_connected_filter,
+ [t](grpc_channel_stack* stk, grpc_channel_element* elem) {
+ bind_transport(stk, elem, t);
+ });
+ return true;
}
grpc_stream* grpc_connected_channel_get_stream(grpc_call_element* elem) {
diff --git a/grpc/src/core/lib/channel/connected_channel.h b/grpc/src/core/lib/channel/connected_channel.h
index faa1c73a..71bdd5a5 100644
--- a/grpc/src/core/lib/channel/connected_channel.h
+++ b/grpc/src/core/lib/channel/connected_channel.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder.h"
extern const grpc_channel_filter grpc_connected_filter;
-bool grpc_add_connected_filter(grpc_channel_stack_builder* builder,
- void* arg_must_be_null);
+bool grpc_add_connected_filter(grpc_core::ChannelStackBuilder* builder);
/* Debug helper to dig the transport stream out of a call element */
grpc_stream* grpc_connected_channel_get_stream(grpc_call_element* elem);
diff --git a/grpc/src/core/lib/channel/context.h b/grpc/src/core/lib/channel/context.h
index bd7fd495..ad1021b8 100644
--- a/grpc/src/core/lib/channel/context.h
+++ b/grpc/src/core/lib/channel/context.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CONTEXT_H
#define GRPC_CORE_LIB_CHANNEL_CONTEXT_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/promise/context.h"
+
/// Call object context pointers.
/// Call context is represented as an array of \a grpc_call_context_elements.
@@ -32,6 +36,9 @@ typedef enum {
/// Value is a \a census_context.
GRPC_CONTEXT_TRACING,
+ /// Value is a CallTracer object.
+ GRPC_CONTEXT_CALL_TRACER,
+
/// Reserved for traffic_class_context.
GRPC_CONTEXT_TRAFFIC,
@@ -46,4 +53,11 @@ struct grpc_call_context_element {
void (*destroy)(void*) = nullptr;
};
+namespace grpc_core {
+// Bind the legacy context array into the new style structure
+// TODO(ctiller): remove as we migrate these contexts to the new system.
+template <>
+struct ContextType<grpc_call_context_element> {};
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_CHANNEL_CONTEXT_H */
diff --git a/grpc/src/core/lib/channel/handshaker.cc b/grpc/src/core/lib/channel/handshaker.cc
index 632d2864..5ad0db31 100644
--- a/grpc/src/core/lib/channel/handshaker.cc
+++ b/grpc/src/core/lib/channel/handshaker.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/channel/handshaker.h"
+
#include <string.h>
#include "absl/strings/str_format.h"
@@ -28,7 +30,6 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -168,7 +169,7 @@ void HandshakeManager::OnTimeoutFn(void* arg, grpc_error_handle error) {
void HandshakeManager::DoHandshake(grpc_endpoint* endpoint,
const grpc_channel_args* channel_args,
- grpc_millis deadline,
+ Timestamp deadline,
grpc_tcp_server_acceptor* acceptor,
grpc_iomgr_cb_func on_handshake_done,
void* user_data) {
diff --git a/grpc/src/core/lib/channel/handshaker.h b/grpc/src/core/lib/channel/handshaker.h
index b6b69da5..30f56239 100644
--- a/grpc/src/core/lib/channel/handshaker.h
+++ b/grpc/src/core/lib/channel/handshaker.h
@@ -23,9 +23,8 @@
#include "absl/container/inlined_vector.h"
-#include <grpc/support/string_util.h>
-
#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -115,7 +114,7 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
/// the necessary clean-up. Otherwise, the callback takes ownership of
/// the arguments.
void DoHandshake(grpc_endpoint* endpoint,
- const grpc_channel_args* channel_args, grpc_millis deadline,
+ const grpc_channel_args* channel_args, Timestamp deadline,
grpc_tcp_server_acceptor* acceptor,
grpc_iomgr_cb_func on_handshake_done, void* user_data);
diff --git a/grpc/src/core/lib/channel/handshaker_factory.h b/grpc/src/core/lib/channel/handshaker_factory.h
index 520e5e4b..0d55a6d7 100644
--- a/grpc/src/core/lib/channel/handshaker_factory.h
+++ b/grpc/src/core/lib/channel/handshaker_factory.h
@@ -23,12 +23,20 @@
#include <grpc/impl/codegen/grpc_types.h>
-#include "src/core/lib/channel/handshaker.h"
-
// A handshaker factory is used to create handshakers.
+// TODO(ctiller): grpc_pollset_set and HandshakeManager are forward declared in
+// this file. grpc_pollset_set ought to be eliminated when EventEngine lands IO
+// support. At the same time, we ought to be able to include handshake_manager.h
+// here and eliminate the HandshakeManager dependency - we cannot right now
+// because HandshakeManager names too many iomgr types.
+
+typedef struct grpc_pollset_set grpc_pollset_set;
+
namespace grpc_core {
+class HandshakeManager;
+
class HandshakerFactory {
public:
virtual void AddHandshakers(const grpc_channel_args* args,
diff --git a/grpc/src/core/lib/channel/handshaker_registry.cc b/grpc/src/core/lib/channel/handshaker_registry.cc
index c2a83739..d9d7bc9d 100644
--- a/grpc/src/core/lib/channel/handshaker_registry.cc
+++ b/grpc/src/core/lib/channel/handshaker_registry.cc
@@ -18,88 +18,33 @@
#include <grpc/support/port_platform.h>
-#include "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"
-
-#include <string.h>
-#include <algorithm>
-
-#include <grpc/support/alloc.h>
-
-//
-// grpc_handshaker_factory_list
-//
namespace grpc_core {
-namespace {
-
-class HandshakerFactoryList {
- public:
- void Register(bool at_start, std::unique_ptr<HandshakerFactory> factory);
- void AddHandshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr);
-
- private:
- absl::InlinedVector<std::unique_ptr<HandshakerFactory>, 2> factories_;
-};
-
-HandshakerFactoryList* g_handshaker_factory_lists = nullptr;
-
-} // namespace
-
-void HandshakerFactoryList::Register(
- bool at_start, std::unique_ptr<HandshakerFactory> factory) {
- factories_.push_back(std::move(factory));
- if (at_start) {
- auto* end = &factories_[factories_.size() - 1];
- std::rotate(&factories_[0], end, end + 1);
- }
+void HandshakerRegistry::Builder::RegisterHandshakerFactory(
+ bool at_start, HandshakerType handshaker_type,
+ std::unique_ptr<HandshakerFactory> factory) {
+ auto& vec = factories_[handshaker_type];
+ auto where = at_start ? vec.begin() : vec.end();
+ vec.insert(where, std::move(factory));
}
-void HandshakerFactoryList::AddHandshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr) {
- for (size_t idx = 0; idx < factories_.size(); ++idx) {
- auto& handshaker_factory = factories_[idx];
- handshaker_factory->AddHandshakers(args, interested_parties, handshake_mgr);
+HandshakerRegistry HandshakerRegistry::Builder::Build() {
+ HandshakerRegistry out;
+ for (size_t i = 0; i < NUM_HANDSHAKER_TYPES; i++) {
+ out.factories_[i] = std::move(factories_[i]);
}
-}
-
-//
-// plugin
-//
-
-void HandshakerRegistry::Init() {
- GPR_ASSERT(g_handshaker_factory_lists == nullptr);
- g_handshaker_factory_lists = new HandshakerFactoryList[NUM_HANDSHAKER_TYPES];
-}
-
-void HandshakerRegistry::Shutdown() {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- delete[] g_handshaker_factory_lists;
- g_handshaker_factory_lists = nullptr;
-}
-
-void HandshakerRegistry::RegisterHandshakerFactory(
- bool at_start, HandshakerType handshaker_type,
- std::unique_ptr<HandshakerFactory> factory) {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- auto& factory_list = g_handshaker_factory_lists[handshaker_type];
- factory_list.Register(at_start, std::move(factory));
+ return out;
}
void HandshakerRegistry::AddHandshakers(HandshakerType handshaker_type,
const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr) {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- auto& factory_list = g_handshaker_factory_lists[handshaker_type];
- factory_list.AddHandshakers(args, interested_parties, handshake_mgr);
+ HandshakeManager* handshake_mgr) const {
+ for (const auto& factory : factories_[handshaker_type]) {
+ factory->AddHandshakers(args, interested_parties, handshake_mgr);
+ }
}
} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/handshaker_registry.h b/grpc/src/core/lib/channel/handshaker_registry.h
index 4a02efc3..ccd61412 100644
--- a/grpc/src/core/lib/channel/handshaker_registry.h
+++ b/grpc/src/core/lib/channel/handshaker_registry.h
@@ -21,6 +21,9 @@
#include <grpc/support/port_platform.h>
+#include <memory>
+#include <vector>
+
#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/channel/handshaker_factory.h"
@@ -35,18 +38,32 @@ typedef enum {
class HandshakerRegistry {
public:
- /// Registers a new handshaker factory. Takes ownership.
- /// If \a at_start is true, the new handshaker will be at the beginning of
- /// the list. Otherwise, it will be added to the end.
- static void RegisterHandshakerFactory(
- bool at_start, HandshakerType handshaker_type,
- std::unique_ptr<HandshakerFactory> factory);
- static void AddHandshakers(HandshakerType handshaker_type,
- const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr);
- static void Init();
- static void Shutdown();
+ class Builder {
+ public:
+ /// Registers a new handshaker factory. Takes ownership.
+ /// If \a at_start is true, the new handshaker will be at the beginning of
+ /// the list. Otherwise, it will be added to the end.
+ void RegisterHandshakerFactory(bool at_start,
+ HandshakerType handshaker_type,
+ std::unique_ptr<HandshakerFactory> factory);
+
+ HandshakerRegistry Build();
+
+ private:
+ std::vector<std::unique_ptr<HandshakerFactory>>
+ factories_[NUM_HANDSHAKER_TYPES];
+ };
+
+ void AddHandshakers(HandshakerType handshaker_type,
+ const grpc_channel_args* args,
+ grpc_pollset_set* interested_parties,
+ HandshakeManager* handshake_mgr) const;
+
+ private:
+ HandshakerRegistry() = default;
+
+ std::vector<std::unique_ptr<HandshakerFactory>>
+ factories_[NUM_HANDSHAKER_TYPES];
};
} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/promise_based_filter.cc b/grpc/src/core/lib/channel/promise_based_filter.cc
new file mode 100644
index 00000000..cb804a5e
--- /dev/null
+++ b/grpc/src/core/lib/channel/promise_based_filter.cc
@@ -0,0 +1,1002 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/promise_based_filter.h"
+
+#include <cstdlib>
+
+#include "src/core/lib/channel/channel_stack.h"
+
+namespace grpc_core {
+namespace promise_filter_detail {
+
+///////////////////////////////////////////////////////////////////////////////
+// BaseCallData
+
+BaseCallData::BaseCallData(grpc_call_element* elem,
+ const grpc_call_element_args* args, uint8_t flags)
+ : call_stack_(args->call_stack),
+ elem_(elem),
+ arena_(args->arena),
+ call_combiner_(args->call_combiner),
+ deadline_(args->deadline),
+ context_(args->context) {
+ if (flags & kFilterExaminesServerInitialMetadata) {
+ server_initial_metadata_latch_ = arena_->New<Latch<ServerMetadata*>>();
+ }
+}
+
+BaseCallData::~BaseCallData() {
+ if (server_initial_metadata_latch_ != nullptr) {
+ server_initial_metadata_latch_->~Latch();
+ }
+}
+
+// We don't form ActivityPtr's to this type, and consequently don't need
+// Orphan().
+void BaseCallData::Orphan() { abort(); }
+
+// For now we don't care about owning/non-owning wakers, instead just share
+// implementation.
+Waker BaseCallData::MakeNonOwningWaker() { return MakeOwningWaker(); }
+
+Waker BaseCallData::MakeOwningWaker() {
+ GRPC_CALL_STACK_REF(call_stack_, "waker");
+ return Waker(this);
+}
+
+void BaseCallData::Wakeup() {
+ auto wakeup = [](void* p, grpc_error_handle) {
+ auto* self = static_cast<BaseCallData*>(p);
+ self->OnWakeup();
+ self->Drop();
+ };
+ auto* closure = GRPC_CLOSURE_CREATE(wakeup, this, nullptr);
+ GRPC_CALL_COMBINER_START(call_combiner_, closure, GRPC_ERROR_NONE, "wakeup");
+}
+
+void BaseCallData::Drop() { GRPC_CALL_STACK_UNREF(call_stack_, "waker"); }
+
+///////////////////////////////////////////////////////////////////////////////
+// ClientCallData
+
+struct ClientCallData::RecvInitialMetadata final {
+ enum State {
+ // Initial state; no op seen
+ kInitial,
+ // No op seen, but we have a latch that would like to modify it when we do
+ kGotLatch,
+ // Responded to trailing metadata prior to getting a recv_initial_metadata
+ kRespondedToTrailingMetadataPriorToHook,
+ // Hooked, no latch yet
+ kHookedWaitingForLatch,
+ // Hooked, latch seen
+ kHookedAndGotLatch,
+ // Got the callback, haven't set latch yet
+ kCompleteWaitingForLatch,
+ // Got the callback and got the latch
+ kCompleteAndGotLatch,
+ // Got the callback and set the latch
+ kCompleteAndSetLatch,
+ // Called the original callback
+ kResponded,
+ };
+
+ State state = kInitial;
+ grpc_closure* original_on_ready = nullptr;
+ grpc_closure on_ready;
+ grpc_metadata_batch* metadata = nullptr;
+ Latch<ServerMetadata*>* server_initial_metadata_publisher = nullptr;
+};
+
+class ClientCallData::PollContext {
+ public:
+ explicit PollContext(ClientCallData* self) : self_(self) {
+ GPR_ASSERT(self_->poll_ctx_ == nullptr);
+ self_->poll_ctx_ = this;
+ scoped_activity_.Init(self_);
+ have_scoped_activity_ = true;
+ }
+
+ PollContext(const PollContext&) = delete;
+ PollContext& operator=(const PollContext&) = delete;
+
+ void Run() {
+ GPR_ASSERT(have_scoped_activity_);
+ repoll_ = false;
+ if (self_->server_initial_metadata_latch() != nullptr) {
+ switch (self_->recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kInitial:
+ case RecvInitialMetadata::kGotLatch:
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ case RecvInitialMetadata::kResponded:
+ case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
+ break;
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ self_->recv_initial_metadata_->state =
+ RecvInitialMetadata::kCompleteAndSetLatch;
+ self_->recv_initial_metadata_->server_initial_metadata_publisher->Set(
+ self_->recv_initial_metadata_->metadata);
+ ABSL_FALLTHROUGH_INTENDED;
+ case RecvInitialMetadata::kCompleteAndSetLatch: {
+ Poll<ServerMetadata**> p =
+ self_->server_initial_metadata_latch()->Wait()();
+ if (ServerMetadata*** ppp = absl::get_if<ServerMetadata**>(&p)) {
+ ServerMetadata* md = **ppp;
+ if (self_->recv_initial_metadata_->metadata != md) {
+ *self_->recv_initial_metadata_->metadata = std::move(*md);
+ }
+ self_->recv_initial_metadata_->state =
+ RecvInitialMetadata::kResponded;
+ call_closures_.Add(
+ absl::exchange(self_->recv_initial_metadata_->original_on_ready,
+ nullptr),
+ GRPC_ERROR_NONE,
+ "wake_inside_combiner:recv_initial_metadata_ready");
+ }
+ } break;
+ }
+ }
+ if (self_->recv_trailing_state_ == RecvTrailingState::kCancelled ||
+ self_->recv_trailing_state_ == RecvTrailingState::kResponded) {
+ return;
+ }
+ switch (self_->send_initial_state_) {
+ case SendInitialState::kQueued:
+ case SendInitialState::kForwarded: {
+ // Poll the promise once since we're waiting for it.
+ Poll<ServerMetadataHandle> poll = self_->promise_();
+ if (auto* r = absl::get_if<ServerMetadataHandle>(&poll)) {
+ auto* md = UnwrapMetadata(std::move(*r));
+ bool destroy_md = true;
+ if (self_->recv_trailing_state_ == RecvTrailingState::kComplete) {
+ if (self_->recv_trailing_metadata_ != md) {
+ *self_->recv_trailing_metadata_ = std::move(*md);
+ } else {
+ destroy_md = false;
+ }
+ self_->recv_trailing_state_ = RecvTrailingState::kResponded;
+ call_closures_.Add(
+ absl::exchange(self_->original_recv_trailing_metadata_ready_,
+ nullptr),
+ GRPC_ERROR_NONE, "wake_inside_combiner:recv_trailing_ready:1");
+ if (self_->recv_initial_metadata_ != nullptr) {
+ switch (self_->recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kInitial:
+ case RecvInitialMetadata::kGotLatch:
+ self_->recv_initial_metadata_->state = RecvInitialMetadata::
+ kRespondedToTrailingMetadataPriorToHook;
+ break;
+ case RecvInitialMetadata::
+ kRespondedToTrailingMetadataPriorToHook:
+ abort(); // not reachable
+ break;
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kResponded:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ break;
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ self_->recv_initial_metadata_->state =
+ RecvInitialMetadata::kResponded;
+ call_closures_.Add(
+ absl::exchange(
+ self_->recv_initial_metadata_->original_on_ready,
+ nullptr),
+ GRPC_ERROR_CANCELLED,
+ "wake_inside_combiner:recv_initial_metadata_ready");
+ }
+ }
+ } else {
+ GPR_ASSERT(*md->get_pointer(GrpcStatusMetadata()) !=
+ GRPC_STATUS_OK);
+ grpc_error_handle error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "early return from promise based filter"),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ *md->get_pointer(GrpcStatusMetadata()));
+ if (auto* message = md->get_pointer(GrpcMessageMetadata())) {
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ message->as_string_view());
+ }
+ GRPC_ERROR_UNREF(self_->cancelled_error_);
+ self_->cancelled_error_ = GRPC_ERROR_REF(error);
+ if (self_->recv_initial_metadata_ != nullptr) {
+ switch (self_->recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kInitial:
+ case RecvInitialMetadata::kGotLatch:
+ self_->recv_initial_metadata_->state = RecvInitialMetadata::
+ kRespondedToTrailingMetadataPriorToHook;
+ break;
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kResponded:
+ break;
+ case RecvInitialMetadata::
+ kRespondedToTrailingMetadataPriorToHook:
+ abort(); // not reachable
+ break;
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ self_->recv_initial_metadata_->state =
+ RecvInitialMetadata::kResponded;
+ call_closures_.Add(
+ absl::exchange(
+ self_->recv_initial_metadata_->original_on_ready,
+ nullptr),
+ GRPC_ERROR_REF(error),
+ "wake_inside_combiner:recv_initial_metadata_ready");
+ }
+ }
+ if (self_->send_initial_state_ == SendInitialState::kQueued) {
+ self_->send_initial_state_ = SendInitialState::kCancelled;
+ cancel_send_initial_metadata_error_ = error;
+ } else {
+ GPR_ASSERT(
+ self_->recv_trailing_state_ == RecvTrailingState::kInitial ||
+ self_->recv_trailing_state_ == RecvTrailingState::kForwarded);
+ self_->call_combiner()->Cancel(GRPC_ERROR_REF(error));
+ forward_batch_ =
+ grpc_make_transport_stream_op(GRPC_CLOSURE_CREATE(
+ [](void* p, grpc_error_handle) {
+ GRPC_CALL_COMBINER_STOP(static_cast<CallCombiner*>(p),
+ "finish_cancel");
+ },
+ self_->call_combiner(), nullptr));
+ forward_batch_->cancel_stream = true;
+ forward_batch_->payload->cancel_stream.cancel_error = error;
+ }
+ self_->recv_trailing_state_ = RecvTrailingState::kCancelled;
+ }
+ if (destroy_md) {
+ md->~grpc_metadata_batch();
+ }
+ scoped_activity_.Destroy();
+ have_scoped_activity_ = false;
+ self_->promise_ = ArenaPromise<ServerMetadataHandle>();
+ }
+ } break;
+ case SendInitialState::kInitial:
+ case SendInitialState::kCancelled:
+ // If we get a response without sending anything, we just propagate
+ // that up. (note: that situation isn't possible once we finish the
+ // promise transition).
+ if (self_->recv_trailing_state_ == RecvTrailingState::kComplete) {
+ self_->recv_trailing_state_ = RecvTrailingState::kResponded;
+ call_closures_.Add(
+ absl::exchange(self_->original_recv_trailing_metadata_ready_,
+ nullptr),
+ GRPC_ERROR_NONE, "wake_inside_combiner:recv_trailing_ready:2");
+ }
+ break;
+ }
+ }
+
+ ~PollContext() {
+ self_->poll_ctx_ = nullptr;
+ if (have_scoped_activity_) scoped_activity_.Destroy();
+ GRPC_CALL_STACK_REF(self_->call_stack(), "finish_poll");
+ bool in_combiner = true;
+ if (call_closures_.size() != 0) {
+ if (forward_batch_ != nullptr) {
+ call_closures_.RunClosuresWithoutYielding(self_->call_combiner());
+ } else {
+ in_combiner = false;
+ call_closures_.RunClosures(self_->call_combiner());
+ }
+ }
+ if (forward_batch_ != nullptr) {
+ GPR_ASSERT(in_combiner);
+ in_combiner = false;
+ forward_send_initial_metadata_ = false;
+ grpc_call_next_op(self_->elem(), forward_batch_);
+ }
+ if (cancel_send_initial_metadata_error_ != GRPC_ERROR_NONE) {
+ GPR_ASSERT(in_combiner);
+ forward_send_initial_metadata_ = false;
+ in_combiner = false;
+ grpc_transport_stream_op_batch_finish_with_failure(
+ absl::exchange(self_->send_initial_metadata_batch_, nullptr),
+ cancel_send_initial_metadata_error_, self_->call_combiner());
+ }
+ if (absl::exchange(forward_send_initial_metadata_, false)) {
+ GPR_ASSERT(in_combiner);
+ in_combiner = false;
+ grpc_call_next_op(
+ self_->elem(),
+ absl::exchange(self_->send_initial_metadata_batch_, nullptr));
+ }
+ if (repoll_) {
+ if (in_combiner) {
+ self_->WakeInsideCombiner();
+ } else {
+ struct NextPoll : public grpc_closure {
+ grpc_call_stack* call_stack;
+ ClientCallData* call_data;
+ };
+ auto run = [](void* p, grpc_error_handle) {
+ auto* next_poll = static_cast<NextPoll*>(p);
+ next_poll->call_data->WakeInsideCombiner();
+ GRPC_CALL_STACK_UNREF(next_poll->call_stack, "re-poll");
+ delete next_poll;
+ };
+ auto* p = absl::make_unique<NextPoll>().release();
+ p->call_stack = self_->call_stack();
+ p->call_data = self_;
+ GRPC_CALL_STACK_REF(self_->call_stack(), "re-poll");
+ GRPC_CLOSURE_INIT(p, run, p, nullptr);
+ GRPC_CALL_COMBINER_START(self_->call_combiner(), p, GRPC_ERROR_NONE,
+ "re-poll");
+ }
+ } else if (in_combiner) {
+ GRPC_CALL_COMBINER_STOP(self_->call_combiner(), "poll paused");
+ }
+ GRPC_CALL_STACK_UNREF(self_->call_stack(), "finish_poll");
+ }
+
+ void Repoll() { repoll_ = true; }
+
+ void ForwardSendInitialMetadata() { forward_send_initial_metadata_ = true; }
+
+ private:
+ ManualConstructor<ScopedActivity> scoped_activity_;
+ ClientCallData* self_;
+ CallCombinerClosureList call_closures_;
+ grpc_error_handle cancel_send_initial_metadata_error_ = GRPC_ERROR_NONE;
+ grpc_transport_stream_op_batch* forward_batch_ = nullptr;
+ bool repoll_ = false;
+ bool forward_send_initial_metadata_ = false;
+ bool have_scoped_activity_;
+};
+
+ClientCallData::ClientCallData(grpc_call_element* elem,
+ const grpc_call_element_args* args,
+ uint8_t flags)
+ : BaseCallData(elem, args, flags) {
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReadyCallback, this,
+ grpc_schedule_on_exec_ctx);
+ if (server_initial_metadata_latch() != nullptr) {
+ recv_initial_metadata_ = arena()->New<RecvInitialMetadata>();
+ }
+}
+
+ClientCallData::~ClientCallData() {
+ GPR_ASSERT(poll_ctx_ == nullptr);
+ GRPC_ERROR_UNREF(cancelled_error_);
+ if (recv_initial_metadata_ != nullptr) {
+ recv_initial_metadata_->~RecvInitialMetadata();
+ }
+}
+
+// Activity implementation.
+void ClientCallData::ForceImmediateRepoll() {
+ GPR_ASSERT(poll_ctx_ != nullptr);
+ poll_ctx_->Repoll();
+}
+
+// Handle one grpc_transport_stream_op_batch
+void ClientCallData::StartBatch(grpc_transport_stream_op_batch* batch) {
+ // Fake out the activity based context.
+ ScopedContext context(this);
+
+ // If this is a cancel stream, cancel anything we have pending and propagate
+ // the cancellation.
+ if (batch->cancel_stream) {
+ GPR_ASSERT(!batch->send_initial_metadata &&
+ !batch->send_trailing_metadata && !batch->send_message &&
+ !batch->recv_initial_metadata && !batch->recv_message &&
+ !batch->recv_trailing_metadata);
+ Cancel(batch->payload->cancel_stream.cancel_error);
+ grpc_call_next_op(elem(), batch);
+ return;
+ }
+
+ if (recv_initial_metadata_ != nullptr && batch->recv_initial_metadata) {
+ bool hook = true;
+ switch (recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kInitial:
+ recv_initial_metadata_->state =
+ RecvInitialMetadata::kHookedWaitingForLatch;
+ break;
+ case RecvInitialMetadata::kGotLatch:
+ recv_initial_metadata_->state = RecvInitialMetadata::kHookedAndGotLatch;
+ break;
+ case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
+ hook = false;
+ break;
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ case RecvInitialMetadata::kResponded:
+ abort(); // unreachable
+ }
+ if (hook) {
+ auto cb = [](void* ptr, grpc_error_handle error) {
+ ClientCallData* self = static_cast<ClientCallData*>(ptr);
+ self->RecvInitialMetadataReady(error);
+ };
+ recv_initial_metadata_->metadata =
+ batch->payload->recv_initial_metadata.recv_initial_metadata;
+ recv_initial_metadata_->original_on_ready =
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_->on_ready, cb, this, nullptr);
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &recv_initial_metadata_->on_ready;
+ }
+ }
+
+ // send_initial_metadata: seeing this triggers the start of the promise part
+ // of this filter.
+ if (batch->send_initial_metadata) {
+ // If we're already cancelled, just terminate the batch.
+ if (send_initial_state_ == SendInitialState::kCancelled ||
+ recv_trailing_state_ == RecvTrailingState::kCancelled) {
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancelled_error_), call_combiner());
+ return;
+ }
+ // Otherwise, we should not have seen a send_initial_metadata op yet.
+ GPR_ASSERT(send_initial_state_ == SendInitialState::kInitial);
+ // Mark ourselves as queued.
+ send_initial_state_ = SendInitialState::kQueued;
+ if (batch->recv_trailing_metadata) {
+ // If there's a recv_trailing_metadata op, we queue that too.
+ GPR_ASSERT(recv_trailing_state_ == RecvTrailingState::kInitial);
+ recv_trailing_state_ = RecvTrailingState::kQueued;
+ }
+ // This is the queuing!
+ send_initial_metadata_batch_ = batch;
+ // And kick start the promise.
+ StartPromise();
+ return;
+ }
+
+ // recv_trailing_metadata *without* send_initial_metadata: hook it so we can
+ // respond to it, and push it down.
+ if (batch->recv_trailing_metadata) {
+ if (recv_trailing_state_ == RecvTrailingState::kCancelled) {
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancelled_error_), call_combiner());
+ return;
+ }
+ GPR_ASSERT(recv_trailing_state_ == RecvTrailingState::kInitial);
+ recv_trailing_state_ = RecvTrailingState::kForwarded;
+ HookRecvTrailingMetadata(batch);
+ }
+
+ grpc_call_next_op(elem(), batch);
+}
+
+// Handle cancellation.
+void ClientCallData::Cancel(grpc_error_handle error) {
+ // Track the latest reason for cancellation.
+ GRPC_ERROR_UNREF(cancelled_error_);
+ cancelled_error_ = GRPC_ERROR_REF(error);
+ // Stop running the promise.
+ promise_ = ArenaPromise<ServerMetadataHandle>();
+ // If we have an op queued, fail that op.
+ // Record what we've done.
+ if (send_initial_state_ == SendInitialState::kQueued) {
+ send_initial_state_ = SendInitialState::kCancelled;
+ if (recv_trailing_state_ == RecvTrailingState::kQueued) {
+ recv_trailing_state_ = RecvTrailingState::kCancelled;
+ }
+ struct FailBatch : public grpc_closure {
+ grpc_transport_stream_op_batch* batch;
+ CallCombiner* call_combiner;
+ };
+ auto fail = [](void* p, grpc_error_handle error) {
+ auto* f = static_cast<FailBatch*>(p);
+ grpc_transport_stream_op_batch_finish_with_failure(
+ f->batch, GRPC_ERROR_REF(error), f->call_combiner);
+ delete f;
+ };
+ auto* b = new FailBatch();
+ GRPC_CLOSURE_INIT(b, fail, b, nullptr);
+ b->batch = absl::exchange(send_initial_metadata_batch_, nullptr);
+ b->call_combiner = call_combiner();
+ GRPC_CALL_COMBINER_START(call_combiner(), b,
+ GRPC_ERROR_REF(cancelled_error_),
+ "cancel pending batch");
+ } else {
+ send_initial_state_ = SendInitialState::kCancelled;
+ }
+ if (recv_initial_metadata_ != nullptr) {
+ switch (recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ recv_initial_metadata_->state = RecvInitialMetadata::kResponded;
+ GRPC_CALL_COMBINER_START(
+ call_combiner(),
+ absl::exchange(recv_initial_metadata_->original_on_ready, nullptr),
+ GRPC_ERROR_REF(error), "propagate cancellation");
+ break;
+ case RecvInitialMetadata::kInitial:
+ case RecvInitialMetadata::kGotLatch:
+ case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kResponded:
+ break;
+ }
+ }
+}
+
+// Begin running the promise - which will ultimately take some initial
+// metadata and return some trailing metadata.
+void ClientCallData::StartPromise() {
+ GPR_ASSERT(send_initial_state_ == SendInitialState::kQueued);
+ ChannelFilter* filter = static_cast<ChannelFilter*>(elem()->channel_data);
+
+ // Construct the promise.
+ PollContext ctx(this);
+ promise_ = filter->MakeCallPromise(
+ CallArgs{WrapMetadata(send_initial_metadata_batch_->payload
+ ->send_initial_metadata.send_initial_metadata),
+ server_initial_metadata_latch()},
+ [this](CallArgs call_args) {
+ return MakeNextPromise(std::move(call_args));
+ });
+ ctx.Run();
+}
+
+void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) {
+ ScopedContext context(this);
+ switch (recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ recv_initial_metadata_->state =
+ RecvInitialMetadata::kCompleteWaitingForLatch;
+ break;
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ recv_initial_metadata_->state = RecvInitialMetadata::kCompleteAndGotLatch;
+ break;
+ case RecvInitialMetadata::kInitial:
+ case RecvInitialMetadata::kGotLatch:
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ case RecvInitialMetadata::kResponded:
+ case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
+ abort(); // unreachable
+ }
+ if (error != GRPC_ERROR_NONE) {
+ recv_initial_metadata_->state = RecvInitialMetadata::kResponded;
+ GRPC_CALL_COMBINER_START(
+ call_combiner(),
+ absl::exchange(recv_initial_metadata_->original_on_ready, nullptr),
+ GRPC_ERROR_REF(error), "propagate cancellation");
+ } else if (send_initial_state_ == SendInitialState::kCancelled ||
+ recv_trailing_state_ == RecvTrailingState::kResponded) {
+ recv_initial_metadata_->state = RecvInitialMetadata::kResponded;
+ GRPC_CALL_COMBINER_START(
+ call_combiner(),
+ absl::exchange(recv_initial_metadata_->original_on_ready, nullptr),
+ GRPC_ERROR_REF(cancelled_error_), "propagate cancellation");
+ }
+ WakeInsideCombiner();
+}
+
+// Interject our callback into the op batch for recv trailing metadata ready.
+// Stash a pointer to the trailing metadata that will be filled in, so we can
+// manipulate it later.
+void ClientCallData::HookRecvTrailingMetadata(
+ grpc_transport_stream_op_batch* batch) {
+ recv_trailing_metadata_ =
+ batch->payload->recv_trailing_metadata.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_;
+}
+
+// Construct a promise that will "call" the next filter.
+// Effectively:
+// - put the modified initial metadata into the batch to be sent down.
+// - return a wrapper around PollTrailingMetadata as the promise.
+ArenaPromise<ServerMetadataHandle> ClientCallData::MakeNextPromise(
+ CallArgs call_args) {
+ GPR_ASSERT(poll_ctx_ != nullptr);
+ GPR_ASSERT(send_initial_state_ == SendInitialState::kQueued);
+ send_initial_metadata_batch_->payload->send_initial_metadata
+ .send_initial_metadata =
+ UnwrapMetadata(std::move(call_args.client_initial_metadata));
+ if (recv_initial_metadata_ != nullptr) {
+ // Call args should contain a latch for receiving initial metadata.
+ // It might be the one we passed in - in which case we know this filter
+ // only wants to examine the metadata, or it might be a new instance, in
+ // which case we know the filter wants to mutate.
+ GPR_ASSERT(call_args.server_initial_metadata != nullptr);
+ recv_initial_metadata_->server_initial_metadata_publisher =
+ call_args.server_initial_metadata;
+ switch (recv_initial_metadata_->state) {
+ case RecvInitialMetadata::kInitial:
+ recv_initial_metadata_->state = RecvInitialMetadata::kGotLatch;
+ break;
+ case RecvInitialMetadata::kHookedWaitingForLatch:
+ recv_initial_metadata_->state = RecvInitialMetadata::kHookedAndGotLatch;
+ poll_ctx_->Repoll();
+ break;
+ case RecvInitialMetadata::kCompleteWaitingForLatch:
+ recv_initial_metadata_->state =
+ RecvInitialMetadata::kCompleteAndGotLatch;
+ poll_ctx_->Repoll();
+ break;
+ case RecvInitialMetadata::kGotLatch:
+ case RecvInitialMetadata::kHookedAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndGotLatch:
+ case RecvInitialMetadata::kCompleteAndSetLatch:
+ case RecvInitialMetadata::kResponded:
+ case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
+ abort(); // unreachable
+ }
+ } else {
+ GPR_ASSERT(call_args.server_initial_metadata == nullptr);
+ }
+ return ArenaPromise<ServerMetadataHandle>(
+ [this]() { return PollTrailingMetadata(); });
+}
+
+// Wrapper to make it look like we're calling the next filter as a promise.
+// First poll: send the send_initial_metadata op down the stack.
+// All polls: await receiving the trailing metadata, then return it to the
+// application.
+Poll<ServerMetadataHandle> ClientCallData::PollTrailingMetadata() {
+ GPR_ASSERT(poll_ctx_ != nullptr);
+ if (send_initial_state_ == SendInitialState::kQueued) {
+ // First poll: pass the send_initial_metadata op down the stack.
+ GPR_ASSERT(send_initial_metadata_batch_ != nullptr);
+ send_initial_state_ = SendInitialState::kForwarded;
+ if (recv_trailing_state_ == RecvTrailingState::kQueued) {
+ // (and the recv_trailing_metadata op if it's part of the queuing)
+ HookRecvTrailingMetadata(send_initial_metadata_batch_);
+ recv_trailing_state_ = RecvTrailingState::kForwarded;
+ }
+ poll_ctx_->ForwardSendInitialMetadata();
+ }
+ switch (recv_trailing_state_) {
+ case RecvTrailingState::kInitial:
+ case RecvTrailingState::kQueued:
+ case RecvTrailingState::kForwarded:
+ // No trailing metadata yet: we are pending.
+ // We return that and expect the promise to be repolled later (if it's
+ // not cancelled).
+ return Pending{};
+ case RecvTrailingState::kComplete:
+ // We've received trailing metadata: pass it to the promise and allow it
+ // to adjust it.
+ return WrapMetadata(recv_trailing_metadata_);
+ case RecvTrailingState::kCancelled: {
+ // We've been cancelled: synthesize some trailing metadata and pass it
+ // to the calling promise for adjustment.
+ recv_trailing_metadata_->Clear();
+ SetStatusFromError(recv_trailing_metadata_, cancelled_error_);
+ return WrapMetadata(recv_trailing_metadata_);
+ }
+ case RecvTrailingState::kResponded:
+ // We've already responded to the caller: we can't do anything and we
+ // should never reach here.
+ abort();
+ }
+ GPR_UNREACHABLE_CODE(return Pending{});
+}
+
+void ClientCallData::RecvTrailingMetadataReadyCallback(
+ void* arg, grpc_error_handle error) {
+ static_cast<ClientCallData*>(arg)->RecvTrailingMetadataReady(error);
+}
+
+void ClientCallData::RecvTrailingMetadataReady(grpc_error_handle error) {
+ // If we were cancelled prior to receiving this callback, we should simply
+ // forward the callback up with the same error.
+ if (recv_trailing_state_ == RecvTrailingState::kCancelled) {
+ if (grpc_closure* call_closure =
+ absl::exchange(original_recv_trailing_metadata_ready_, nullptr)) {
+ Closure::Run(DEBUG_LOCATION, call_closure, GRPC_ERROR_REF(error));
+ }
+ return;
+ }
+ // If there was an error, we'll put that into the trailing metadata and
+ // proceed as if there was not.
+ if (error != GRPC_ERROR_NONE) {
+ SetStatusFromError(recv_trailing_metadata_, error);
+ }
+ // Record that we've got the callback.
+ GPR_ASSERT(recv_trailing_state_ == RecvTrailingState::kForwarded);
+ recv_trailing_state_ = RecvTrailingState::kComplete;
+ // Repoll the promise.
+ ScopedContext context(this);
+ WakeInsideCombiner();
+}
+
+// Given an error, fill in ServerMetadataHandle to represent that error.
+void ClientCallData::SetStatusFromError(grpc_metadata_batch* metadata,
+ grpc_error_handle error) {
+ grpc_status_code status_code = GRPC_STATUS_UNKNOWN;
+ std::string status_details;
+ grpc_error_get_status(error, deadline(), &status_code, &status_details,
+ nullptr, nullptr);
+ metadata->Set(GrpcStatusMetadata(), status_code);
+ metadata->Set(GrpcMessageMetadata(), Slice::FromCopiedString(status_details));
+ metadata->GetOrCreatePointer(GrpcStatusContext())
+ ->emplace_back(grpc_error_std_string(error));
+}
+
+// Wakeup and poll the promise if appropriate.
+void ClientCallData::WakeInsideCombiner() { PollContext(this).Run(); }
+
+void ClientCallData::OnWakeup() {
+ ScopedContext context(this);
+ WakeInsideCombiner();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// ServerCallData
+
+ServerCallData::ServerCallData(grpc_call_element* elem,
+ const grpc_call_element_args* args,
+ uint8_t flags)
+ : BaseCallData(elem, args, flags) {
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_,
+ RecvInitialMetadataReadyCallback, this,
+ grpc_schedule_on_exec_ctx);
+}
+
+ServerCallData::~ServerCallData() {
+ GPR_ASSERT(!is_polling_);
+ GRPC_ERROR_UNREF(cancelled_error_);
+}
+
+// Activity implementation.
+void ServerCallData::ForceImmediateRepoll() { abort(); } // Not implemented.
+
+// Handle one grpc_transport_stream_op_batch
+void ServerCallData::StartBatch(grpc_transport_stream_op_batch* batch) {
+ // Fake out the activity based context.
+ ScopedContext context(this);
+
+ // If this is a cancel stream, cancel anything we have pending and
+ // propagate the cancellation.
+ if (batch->cancel_stream) {
+ GPR_ASSERT(!batch->send_initial_metadata &&
+ !batch->send_trailing_metadata && !batch->send_message &&
+ !batch->recv_initial_metadata && !batch->recv_message &&
+ !batch->recv_trailing_metadata);
+ Cancel(batch->payload->cancel_stream.cancel_error);
+ grpc_call_next_op(elem(), batch);
+ return;
+ }
+
+ // recv_initial_metadata: we hook the response of this so we can start the
+ // promise at an appropriate time.
+ if (batch->recv_initial_metadata) {
+ GPR_ASSERT(!batch->send_initial_metadata &&
+ !batch->send_trailing_metadata && !batch->send_message &&
+ !batch->recv_message && !batch->recv_trailing_metadata);
+ // Otherwise, we should not have seen a send_initial_metadata op yet.
+ GPR_ASSERT(recv_initial_state_ == RecvInitialState::kInitial);
+ // Hook the callback so we know when to start the promise.
+ 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_;
+ recv_initial_state_ = RecvInitialState::kForwarded;
+ }
+
+ // send_trailing_metadata
+ if (batch->send_trailing_metadata) {
+ switch (send_trailing_state_) {
+ case SendTrailingState::kInitial:
+ send_trailing_metadata_batch_ = batch;
+ send_trailing_state_ = SendTrailingState::kQueued;
+ WakeInsideCombiner([this](grpc_error_handle error) {
+ GPR_ASSERT(send_trailing_state_ == SendTrailingState::kQueued);
+ Cancel(error);
+ });
+ break;
+ case SendTrailingState::kQueued:
+ case SendTrailingState::kForwarded:
+ abort(); // unreachable
+ break;
+ case SendTrailingState::kCancelled:
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancelled_error_), call_combiner());
+ break;
+ }
+ return;
+ }
+
+ grpc_call_next_op(elem(), batch);
+}
+
+// Handle cancellation.
+void ServerCallData::Cancel(grpc_error_handle error) {
+ // Track the latest reason for cancellation.
+ GRPC_ERROR_UNREF(cancelled_error_);
+ cancelled_error_ = GRPC_ERROR_REF(error);
+ // Stop running the promise.
+ promise_ = ArenaPromise<ServerMetadataHandle>();
+ if (send_trailing_state_ == SendTrailingState::kQueued) {
+ send_trailing_state_ = SendTrailingState::kCancelled;
+ struct FailBatch : public grpc_closure {
+ grpc_transport_stream_op_batch* batch;
+ CallCombiner* call_combiner;
+ };
+ auto fail = [](void* p, grpc_error_handle error) {
+ auto* f = static_cast<FailBatch*>(p);
+ grpc_transport_stream_op_batch_finish_with_failure(
+ f->batch, GRPC_ERROR_REF(error), f->call_combiner);
+ delete f;
+ };
+ auto* b = new FailBatch();
+ GRPC_CLOSURE_INIT(b, fail, b, nullptr);
+ b->batch = absl::exchange(send_trailing_metadata_batch_, nullptr);
+ b->call_combiner = call_combiner();
+ GRPC_CALL_COMBINER_START(call_combiner(), b,
+ GRPC_ERROR_REF(cancelled_error_),
+ "cancel pending batch");
+ } else {
+ send_trailing_state_ = SendTrailingState::kCancelled;
+ }
+}
+
+// Construct a promise that will "call" the next filter.
+// Effectively:
+// - put the modified initial metadata into the batch being sent up.
+// - return a wrapper around PollTrailingMetadata as the promise.
+ArenaPromise<ServerMetadataHandle> ServerCallData::MakeNextPromise(
+ CallArgs call_args) {
+ GPR_ASSERT(recv_initial_state_ == RecvInitialState::kComplete);
+ GPR_ASSERT(UnwrapMetadata(std::move(call_args.client_initial_metadata)) ==
+ recv_initial_metadata_);
+ forward_recv_initial_metadata_callback_ = true;
+ return ArenaPromise<ServerMetadataHandle>(
+ [this]() { return PollTrailingMetadata(); });
+}
+
+// Wrapper to make it look like we're calling the next filter as a promise.
+// All polls: await sending the trailing metadata, then foward it down the
+// stack.
+Poll<ServerMetadataHandle> ServerCallData::PollTrailingMetadata() {
+ switch (send_trailing_state_) {
+ case SendTrailingState::kInitial:
+ return Pending{};
+ case SendTrailingState::kQueued:
+ return WrapMetadata(send_trailing_metadata_batch_->payload
+ ->send_trailing_metadata.send_trailing_metadata);
+ case SendTrailingState::kForwarded:
+ abort(); // unreachable
+ case SendTrailingState::kCancelled:
+ // We could translate cancelled_error to metadata and return it... BUT
+ // we're not gonna be running much longer and the results going to be
+ // ignored.
+ return Pending{};
+ }
+ GPR_UNREACHABLE_CODE(return Pending{});
+}
+
+void ServerCallData::RecvInitialMetadataReadyCallback(void* arg,
+ grpc_error_handle error) {
+ static_cast<ServerCallData*>(arg)->RecvInitialMetadataReady(error);
+}
+
+void ServerCallData::RecvInitialMetadataReady(grpc_error_handle error) {
+ GPR_ASSERT(recv_initial_state_ == RecvInitialState::kForwarded);
+ // If there was an error we just propagate that through
+ if (error != GRPC_ERROR_NONE) {
+ recv_initial_state_ = RecvInitialState::kResponded;
+ Closure::Run(DEBUG_LOCATION, original_recv_initial_metadata_ready_,
+ GRPC_ERROR_REF(error));
+ return;
+ }
+ // Record that we've got the callback.
+ recv_initial_state_ = RecvInitialState::kComplete;
+
+ // Start the promise.
+ ScopedContext context(this);
+ // Construct the promise.
+ ChannelFilter* filter = static_cast<ChannelFilter*>(elem()->channel_data);
+ promise_ =
+ filter->MakeCallPromise(CallArgs{WrapMetadata(recv_initial_metadata_),
+ server_initial_metadata_latch()},
+ [this](CallArgs call_args) {
+ return MakeNextPromise(std::move(call_args));
+ });
+ // Poll once.
+ bool own_error = false;
+ WakeInsideCombiner([&error, &own_error](grpc_error_handle new_error) {
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ error = GRPC_ERROR_REF(new_error);
+ own_error = true;
+ });
+ Closure::Run(DEBUG_LOCATION, original_recv_initial_metadata_ready_,
+ GRPC_ERROR_REF(error));
+ if (own_error) GRPC_ERROR_UNREF(error);
+}
+
+// Wakeup and poll the promise if appropriate.
+void ServerCallData::WakeInsideCombiner(
+ absl::FunctionRef<void(grpc_error_handle)> cancel) {
+ GPR_ASSERT(!is_polling_);
+ bool forward_send_trailing_metadata = false;
+ is_polling_ = true;
+ if (recv_initial_state_ == RecvInitialState::kComplete) {
+ Poll<ServerMetadataHandle> poll;
+ {
+ ScopedActivity activity(this);
+ poll = promise_();
+ }
+ if (auto* r = absl::get_if<ServerMetadataHandle>(&poll)) {
+ auto* md = UnwrapMetadata(std::move(*r));
+ bool destroy_md = true;
+ switch (send_trailing_state_) {
+ case SendTrailingState::kQueued: {
+ if (send_trailing_metadata_batch_->payload->send_trailing_metadata
+ .send_trailing_metadata != md) {
+ *send_trailing_metadata_batch_->payload->send_trailing_metadata
+ .send_trailing_metadata = std::move(*md);
+ } else {
+ destroy_md = false;
+ }
+ forward_send_trailing_metadata = true;
+ send_trailing_state_ = SendTrailingState::kForwarded;
+ } break;
+ case SendTrailingState::kForwarded:
+ abort(); // unreachable
+ break;
+ case SendTrailingState::kInitial: {
+ GPR_ASSERT(*md->get_pointer(GrpcStatusMetadata()) != GRPC_STATUS_OK);
+ grpc_error_handle error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "early return from promise based filter"),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ *md->get_pointer(GrpcStatusMetadata()));
+ if (auto* message = md->get_pointer(GrpcMessageMetadata())) {
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ message->as_string_view());
+ }
+ cancel(error);
+ GRPC_ERROR_UNREF(error);
+ } break;
+ case SendTrailingState::kCancelled:
+ // Nothing to do.
+ break;
+ }
+ if (destroy_md) {
+ md->~grpc_metadata_batch();
+ }
+ }
+ }
+ is_polling_ = false;
+ if (forward_send_trailing_metadata) {
+ grpc_call_next_op(elem(),
+ absl::exchange(send_trailing_metadata_batch_, nullptr));
+ }
+}
+
+void ServerCallData::OnWakeup() { abort(); } // not implemented
+
+} // namespace promise_filter_detail
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/channel/promise_based_filter.h b/grpc/src/core/lib/channel/promise_based_filter.h
new file mode 100644
index 00000000..58c7286f
--- /dev/null
+++ b/grpc/src/core/lib/channel/promise_based_filter.h
@@ -0,0 +1,437 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_PROMISE_BASED_FILTER_H
+#define GRPC_CORE_LIB_CHANNEL_PROMISE_BASED_FILTER_H
+
+// Scaffolding to allow the per-call part of a filter to be authored in a
+// promise-style. Most of this will be removed once the promises conversion is
+// completed.
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/utility/utility.h"
+
+#include <grpc/status.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/channel/call_finalization.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gprpp/debug_location.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/promise/arena_promise.h"
+#include "src/core/lib/promise/context.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+class ChannelFilter {
+ public:
+ class Args {
+ public:
+ Args() : Args(nullptr, nullptr) {}
+ explicit Args(grpc_channel_stack* channel_stack,
+ grpc_channel_element* channel_element)
+ : channel_stack_(channel_stack), channel_element_(channel_element) {}
+
+ grpc_channel_stack* channel_stack() const { return channel_stack_; }
+ grpc_channel_element* uninitialized_channel_element() {
+ return channel_element_;
+ }
+
+ private:
+ friend class ChannelFilter;
+ grpc_channel_stack* channel_stack_;
+ grpc_channel_element* channel_element_;
+ };
+
+ // Construct a promise for one call.
+ virtual ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) = 0;
+
+ // Start a legacy transport op
+ // Return true if the op was handled, false if it should be passed to the
+ // next filter.
+ // TODO(ctiller): design a new API for this - we probably don't want big op
+ // structures going forward.
+ virtual bool StartTransportOp(grpc_transport_op*) { return false; }
+
+ virtual ~ChannelFilter() = default;
+};
+
+// Designator for whether a filter is client side or server side.
+// Please don't use this outside calls to MakePromiseBasedFilter - it's intended
+// to be deleted once the promise conversion is complete.
+enum class FilterEndpoint {
+ kClient,
+ kServer,
+};
+
+// Flags for MakePromiseBasedFilter.
+static constexpr uint8_t kFilterExaminesServerInitialMetadata = 1;
+
+namespace promise_filter_detail {
+
+// Call data shared between all implementations of promise-based filters.
+class BaseCallData : public Activity, private Wakeable {
+ public:
+ BaseCallData(grpc_call_element* elem, const grpc_call_element_args* args,
+ uint8_t flags);
+ ~BaseCallData() override;
+
+ void set_pollent(grpc_polling_entity* pollent) {
+ GPR_ASSERT(nullptr ==
+ pollent_.exchange(pollent, std::memory_order_release));
+ }
+
+ // Activity implementation (partial).
+ void Orphan() final;
+ Waker MakeNonOwningWaker() final;
+ Waker MakeOwningWaker() final;
+
+ void Finalize(const grpc_call_final_info* final_info) {
+ finalization_.Run(final_info);
+ }
+
+ protected:
+ class ScopedContext
+ : public promise_detail::Context<Arena>,
+ public promise_detail::Context<grpc_call_context_element>,
+ public promise_detail::Context<grpc_polling_entity>,
+ public promise_detail::Context<CallFinalization> {
+ public:
+ explicit ScopedContext(BaseCallData* call_data)
+ : promise_detail::Context<Arena>(call_data->arena_),
+ promise_detail::Context<grpc_call_context_element>(
+ call_data->context_),
+ promise_detail::Context<grpc_polling_entity>(
+ call_data->pollent_.load(std::memory_order_acquire)),
+ promise_detail::Context<CallFinalization>(&call_data->finalization_) {
+ }
+ };
+
+ static MetadataHandle<grpc_metadata_batch> WrapMetadata(
+ grpc_metadata_batch* p) {
+ return MetadataHandle<grpc_metadata_batch>(p);
+ }
+
+ static grpc_metadata_batch* UnwrapMetadata(
+ MetadataHandle<grpc_metadata_batch> p) {
+ return p.Unwrap();
+ }
+
+ Arena* arena() { return arena_; }
+ grpc_call_element* elem() const { return elem_; }
+ CallCombiner* call_combiner() const { return call_combiner_; }
+ Timestamp deadline() const { return deadline_; }
+ grpc_call_stack* call_stack() const { return call_stack_; }
+ Latch<ServerMetadata*>* server_initial_metadata_latch() const {
+ return server_initial_metadata_latch_;
+ }
+
+ private:
+ // Wakeable implementation.
+ void Wakeup() final;
+ void Drop() final;
+
+ virtual void OnWakeup() = 0;
+
+ grpc_call_stack* const call_stack_;
+ grpc_call_element* const elem_;
+ Arena* const arena_;
+ CallCombiner* const call_combiner_;
+ const Timestamp deadline_;
+ CallFinalization finalization_;
+ grpc_call_context_element* const context_;
+ std::atomic<grpc_polling_entity*> pollent_{nullptr};
+ Latch<ServerMetadata*>* server_initial_metadata_latch_ = nullptr;
+};
+
+class ClientCallData : public BaseCallData {
+ public:
+ ClientCallData(grpc_call_element* elem, const grpc_call_element_args* args,
+ uint8_t flags);
+ ~ClientCallData() override;
+
+ // Activity implementation.
+ void ForceImmediateRepoll() final;
+ // Handle one grpc_transport_stream_op_batch
+ void StartBatch(grpc_transport_stream_op_batch* batch);
+
+ private:
+ // At what stage is our handling of send initial metadata?
+ enum class SendInitialState {
+ // Start state: no op seen
+ kInitial,
+ // We've seen the op, and started the promise in response to it, but have
+ // not yet sent the op to the next filter.
+ kQueued,
+ // We've sent the op to the next filter.
+ kForwarded,
+ // We were cancelled.
+ kCancelled
+ };
+ // At what stage is our handling of recv trailing metadata?
+ enum class RecvTrailingState {
+ // Start state: no op seen
+ kInitial,
+ // We saw the op, and since it was bundled with send initial metadata, we
+ // queued it until the send initial metadata can be sent to the next filter.
+ kQueued,
+ // We've forwarded the op to the next filter.
+ kForwarded,
+ // The op has completed from below, but we haven't yet forwarded it up (the
+ // promise gets to interject and mutate it).
+ kComplete,
+ // We've called the recv_metadata_ready callback from the original
+ // recv_trailing_metadata op that was presented to us.
+ kResponded,
+ // We've been cancelled and handled that locally.
+ // (i.e. whilst the recv_trailing_metadata op is queued in this filter).
+ kCancelled
+ };
+
+ struct RecvInitialMetadata;
+ class PollContext;
+
+ // Handle cancellation.
+ void Cancel(grpc_error_handle error);
+ // Begin running the promise - which will ultimately take some initial
+ // metadata and return some trailing metadata.
+ void StartPromise();
+ // Interject our callback into the op batch for recv trailing metadata ready.
+ // Stash a pointer to the trailing metadata that will be filled in, so we can
+ // manipulate it later.
+ void HookRecvTrailingMetadata(grpc_transport_stream_op_batch* batch);
+ // Construct a promise that will "call" the next filter.
+ // Effectively:
+ // - put the modified initial metadata into the batch to be sent down.
+ // - return a wrapper around PollTrailingMetadata as the promise.
+ ArenaPromise<ServerMetadataHandle> MakeNextPromise(CallArgs call_args);
+ // Wrapper to make it look like we're calling the next filter as a promise.
+ // First poll: send the send_initial_metadata op down the stack.
+ // All polls: await receiving the trailing metadata, then return it to the
+ // application.
+ Poll<ServerMetadataHandle> PollTrailingMetadata();
+ static void RecvTrailingMetadataReadyCallback(void* arg,
+ grpc_error_handle error);
+ void RecvTrailingMetadataReady(grpc_error_handle error);
+ void RecvInitialMetadataReady(grpc_error_handle error);
+ // Given an error, fill in ServerMetadataHandle to represent that error.
+ void SetStatusFromError(grpc_metadata_batch* metadata,
+ grpc_error_handle error);
+ // Wakeup and poll the promise if appropriate.
+ void WakeInsideCombiner();
+ void OnWakeup() override;
+
+ // Contained promise
+ ArenaPromise<ServerMetadataHandle> promise_;
+ // Queued batch containing at least a send_initial_metadata op.
+ grpc_transport_stream_op_batch* send_initial_metadata_batch_ = nullptr;
+ // Pointer to where trailing metadata will be stored.
+ grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
+ // State tracking recv initial metadata for filters that care about it.
+ RecvInitialMetadata* recv_initial_metadata_ = nullptr;
+ // Closure to call when we're done with the trailing metadata.
+ grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
+ // Our closure pointing to RecvTrailingMetadataReadyCallback.
+ grpc_closure recv_trailing_metadata_ready_;
+ // Error received during cancellation.
+ grpc_error_handle cancelled_error_ = GRPC_ERROR_NONE;
+ // State of the send_initial_metadata op.
+ SendInitialState send_initial_state_ = SendInitialState::kInitial;
+ // State of the recv_trailing_metadata op.
+ RecvTrailingState recv_trailing_state_ = RecvTrailingState::kInitial;
+ // Polling related data. Non-null if we're actively polling
+ PollContext* poll_ctx_ = nullptr;
+};
+
+class ServerCallData : public BaseCallData {
+ public:
+ ServerCallData(grpc_call_element* elem, const grpc_call_element_args* args,
+ uint8_t flags);
+ ~ServerCallData() override;
+
+ // Activity implementation.
+ void ForceImmediateRepoll() final;
+ // Handle one grpc_transport_stream_op_batch
+ void StartBatch(grpc_transport_stream_op_batch* batch);
+
+ private:
+ // At what stage is our handling of recv initial metadata?
+ enum class RecvInitialState {
+ // Start state: no op seen
+ kInitial,
+ // Op seen, and forwarded to the next filter.
+ // Now waiting for the callback.
+ kForwarded,
+ // The op has completed from below, but we haven't yet forwarded it up
+ // (the promise gets to interject and mutate it).
+ kComplete,
+ // We've sent the response to the next filter up.
+ kResponded,
+ };
+ // At what stage is our handling of send trailing metadata?
+ enum class SendTrailingState {
+ // Start state: no op seen
+ kInitial,
+ // We saw the op, and are waiting for the promise to complete
+ // to forward it.
+ kQueued,
+ // We've forwarded the op to the next filter.
+ kForwarded,
+ // We were cancelled.
+ kCancelled
+ };
+
+ // Handle cancellation.
+ void Cancel(grpc_error_handle error);
+ // Construct a promise that will "call" the next filter.
+ // Effectively:
+ // - put the modified initial metadata into the batch being sent up.
+ // - return a wrapper around PollTrailingMetadata as the promise.
+ ArenaPromise<ServerMetadataHandle> MakeNextPromise(CallArgs call_args);
+ // Wrapper to make it look like we're calling the next filter as a promise.
+ // All polls: await sending the trailing metadata, then foward it down the
+ // stack.
+ Poll<ServerMetadataHandle> PollTrailingMetadata();
+ static void RecvInitialMetadataReadyCallback(void* arg,
+ grpc_error_handle error);
+ void RecvInitialMetadataReady(grpc_error_handle error);
+ // Wakeup and poll the promise if appropriate.
+ void WakeInsideCombiner(absl::FunctionRef<void(grpc_error_handle)> cancel);
+ void OnWakeup() override;
+
+ // Contained promise
+ ArenaPromise<ServerMetadataHandle> promise_;
+ // Pointer to where initial metadata will be stored.
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ // Closure to call when we're done with the trailing metadata.
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+ // Our closure pointing to RecvInitialMetadataReadyCallback.
+ grpc_closure recv_initial_metadata_ready_;
+ // Error received during cancellation.
+ grpc_error_handle cancelled_error_ = GRPC_ERROR_NONE;
+ // Trailing metadata batch
+ grpc_transport_stream_op_batch* send_trailing_metadata_batch_ = nullptr;
+ // State of the send_initial_metadata op.
+ RecvInitialState recv_initial_state_ = RecvInitialState::kInitial;
+ // State of the recv_trailing_metadata op.
+ SendTrailingState send_trailing_state_ = SendTrailingState::kInitial;
+ // Whether we're currently polling the promise.
+ bool is_polling_ = false;
+ // Whether to forward the recv_initial_metadata op at the end of promise
+ // wakeup.
+ bool forward_recv_initial_metadata_callback_ = false;
+};
+
+// Specific call data per channel filter.
+// Note that we further specialize for clients and servers since their
+// implementations are very different.
+template <class ChannelFilter, FilterEndpoint endpoint>
+class CallData;
+
+// Client implementation of call data.
+template <class ChannelFilter>
+class CallData<ChannelFilter, FilterEndpoint::kClient> : public ClientCallData {
+ public:
+ using ClientCallData::ClientCallData;
+};
+
+// Server implementation of call data.
+template <class ChannelFilter>
+class CallData<ChannelFilter, FilterEndpoint::kServer> : public ServerCallData {
+ public:
+ using ServerCallData::ServerCallData;
+};
+
+} // namespace promise_filter_detail
+
+// F implements ChannelFilter and :
+// class SomeChannelFilter : public ChannelFilter {
+// public:
+// static absl::StatusOr<SomeChannelFilter> Create(
+// ChannelArgs channel_args, ChannelFilter::Args filter_args);
+// };
+// TODO(ctiller): allow implementing get_channel_info, start_transport_op in
+// some way on ChannelFilter.
+template <typename F, FilterEndpoint kEndpoint, uint8_t kFlags = 0>
+absl::enable_if_t<std::is_base_of<ChannelFilter, F>::value, grpc_channel_filter>
+MakePromiseBasedFilter(const char* name) {
+ using CallData = promise_filter_detail::CallData<F, kEndpoint>;
+
+ return grpc_channel_filter{
+ // start_transport_stream_op_batch
+ [](grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ static_cast<CallData*>(elem->call_data)->StartBatch(batch);
+ },
+ // make_call_promise
+ [](grpc_channel_element* elem, CallArgs call_args,
+ NextPromiseFactory next_promise_factory) {
+ return static_cast<F*>(elem->channel_data)
+ ->MakeCallPromise(std::move(call_args),
+ std::move(next_promise_factory));
+ },
+ // start_transport_op
+ [](grpc_channel_element* elem, grpc_transport_op* op) {
+ if (!static_cast<F*>(elem->channel_data)->StartTransportOp(op)) {
+ grpc_channel_next_op(elem, op);
+ }
+ },
+ // sizeof_call_data
+ sizeof(CallData),
+ // init_call_elem
+ [](grpc_call_element* elem, const grpc_call_element_args* args) {
+ new (elem->call_data) CallData(elem, args, kFlags);
+ return GRPC_ERROR_NONE;
+ },
+ // set_pollset_or_pollset_set
+ [](grpc_call_element* elem, grpc_polling_entity* pollent) {
+ static_cast<CallData*>(elem->call_data)->set_pollent(pollent);
+ },
+ // destroy_call_elem
+ [](grpc_call_element* elem, const grpc_call_final_info* final_info,
+ grpc_closure*) {
+ auto* cd = static_cast<CallData*>(elem->call_data);
+ cd->Finalize(final_info);
+ cd->~CallData();
+ },
+ // sizeof_channel_data
+ sizeof(F),
+ // init_channel_elem
+ [](grpc_channel_element* elem, grpc_channel_element_args* args) {
+ GPR_ASSERT(!args->is_last);
+ auto status = F::Create(ChannelArgs::FromC(args->channel_args),
+ ChannelFilter::Args(args->channel_stack, elem));
+ if (!status.ok()) return absl_status_to_grpc_error(status.status());
+ new (elem->channel_data) F(std::move(*status));
+ return GRPC_ERROR_NONE;
+ },
+ // destroy_channel_elem
+ [](grpc_channel_element* elem) {
+ static_cast<F*>(elem->channel_data)->~F();
+ },
+ // get_channel_info
+ grpc_channel_next_get_info,
+ // name
+ name,
+ };
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_PROMISE_BASED_FILTER_H
diff --git a/grpc/src/core/lib/channel/status_util.h b/grpc/src/core/lib/channel/status_util.h
index 969033ad..b9245f23 100644
--- a/grpc/src/core/lib/channel/status_util.h
+++ b/grpc/src/core/lib/channel/status_util.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
-
#include <stdbool.h>
#include <string.h>
+#include <grpc/status.h>
+
/// If \a status_str is a valid status string, sets \a status to the
/// corresponding status value and returns true.
bool grpc_status_code_from_string(const char* status_str,
@@ -53,6 +53,10 @@ class StatusCodeSet {
return status_code_mask_ & (1 << status);
}
+ bool operator==(const StatusCodeSet& other) const {
+ return status_code_mask_ == other.status_code_mask_;
+ }
+
private:
int status_code_mask_ = 0; // A bitfield of status codes in the set.
};
diff --git a/grpc/src/core/lib/compression/algorithm_metadata.h b/grpc/src/core/lib/compression/algorithm_metadata.h
deleted file mode 100644
index d58d2f54..00000000
--- a/grpc/src/core/lib/compression/algorithm_metadata.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * 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_COMPRESSION_ALGORITHM_METADATA_H
-#define GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/compression.h>
-#include "src/core/lib/compression/compression_internal.h"
-#include "src/core/lib/transport/metadata.h"
-
-/** Return compression algorithm based metadata value */
-grpc_slice grpc_compression_algorithm_slice(
- grpc_compression_algorithm algorithm);
-
-/** Find compression algorithm based on passed in mdstr - returns
- * GRPC_COMPRESS_ALGORITHM_COUNT on failure */
-grpc_compression_algorithm grpc_compression_algorithm_from_slice(
- const grpc_slice& str);
-
-/** Return compression algorithm based metadata element */
-grpc_mdelem grpc_compression_encoding_mdelem(
- grpc_compression_algorithm algorithm);
-
-/** Return message compression algorithm based metadata element (grpc-encoding:
- * xxx) */
-grpc_mdelem grpc_message_compression_encoding_mdelem(
- grpc_message_compression_algorithm algorithm);
-
-/** Return stream compression algorithm based metadata element
- * (content-encoding: xxx) */
-grpc_mdelem grpc_stream_compression_encoding_mdelem(
- grpc_stream_compression_algorithm algorithm);
-
-/** Find compression algorithm based on passed in mdstr - returns
- * GRPC_COMPRESS_ALGORITHM_COUNT on failure */
-grpc_message_compression_algorithm
-grpc_message_compression_algorithm_from_slice(const grpc_slice& str);
-
-/** Find stream compression algorithm based on passed in mdstr - returns
- * GRPC_STREAM_COMPRESS_ALGORITHM_COUNT on failure */
-grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice(
- const grpc_slice& str);
-
-#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */
diff --git a/grpc/src/core/lib/compression/compression.cc b/grpc/src/core/lib/compression/compression.cc
index d14b738b..ce39d7e8 100644
--- a/grpc/src/core/lib/compression/compression.cc
+++ b/grpc/src/core/lib/compression/compression.cc
@@ -23,89 +23,47 @@
#include <grpc/compression.h>
-#include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/transport/static_metadata.h"
-int grpc_compression_algorithm_is_message(
- grpc_compression_algorithm algorithm) {
- return (algorithm >= GRPC_COMPRESS_DEFLATE && algorithm <= GRPC_COMPRESS_GZIP)
- ? 1
- : 0;
+int grpc_compression_algorithm_is_message(grpc_compression_algorithm) {
+ return 1;
}
-int grpc_compression_algorithm_is_stream(grpc_compression_algorithm algorithm) {
- return (algorithm == GRPC_COMPRESS_STREAM_GZIP) ? 1 : 0;
+int grpc_compression_algorithm_is_stream(grpc_compression_algorithm) {
+ return 0;
}
int grpc_compression_algorithm_parse(grpc_slice name,
grpc_compression_algorithm* algorithm) {
- if (grpc_slice_eq_static_interned(name, GRPC_MDSTR_IDENTITY)) {
- *algorithm = GRPC_COMPRESS_NONE;
- return 1;
- } else if (grpc_slice_eq_static_interned(name, GRPC_MDSTR_DEFLATE)) {
- *algorithm = GRPC_COMPRESS_DEFLATE;
+ absl::optional<grpc_compression_algorithm> alg =
+ grpc_core::ParseCompressionAlgorithm(
+ grpc_core::StringViewFromSlice(name));
+ if (alg.has_value()) {
+ *algorithm = alg.value();
return 1;
- } else if (grpc_slice_eq_static_interned(name, GRPC_MDSTR_GZIP)) {
- *algorithm = GRPC_COMPRESS_GZIP;
- return 1;
- } else if (grpc_slice_eq_static_interned(name,
- GRPC_MDSTR_STREAM_SLASH_GZIP)) {
- *algorithm = GRPC_COMPRESS_STREAM_GZIP;
- return 1;
- } else {
- return 0;
}
+ return 0;
}
int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm,
const char** name) {
GRPC_API_TRACE("grpc_compression_algorithm_name(algorithm=%d, name=%p)", 2,
((int)algorithm, name));
- switch (algorithm) {
- case GRPC_COMPRESS_NONE:
- *name = "identity";
- return 1;
- case GRPC_COMPRESS_DEFLATE:
- *name = "deflate";
- return 1;
- case GRPC_COMPRESS_GZIP:
- *name = "gzip";
- return 1;
- case GRPC_COMPRESS_STREAM_GZIP:
- *name = "stream/gzip";
- return 1;
- case GRPC_COMPRESS_ALGORITHMS_COUNT:
- return 0;
+ const char* result = grpc_core::CompressionAlgorithmAsString(algorithm);
+ if (result != nullptr) {
+ *name = result;
+ return 1;
}
return 0;
}
grpc_compression_algorithm grpc_compression_algorithm_for_level(
grpc_compression_level level, uint32_t accepted_encodings) {
- grpc_compression_algorithm algo;
- if (level == GRPC_COMPRESS_LEVEL_NONE) {
- return GRPC_COMPRESS_NONE;
- } else if (level <= GRPC_COMPRESS_LEVEL_HIGH) {
- // TODO(mxyan): Design algorithm to select from all algorithms, including
- // stream compression algorithm
- if (!grpc_compression_algorithm_from_message_stream_compression_algorithm(
- &algo,
- grpc_message_compression_algorithm_for_level(
- level,
- grpc_compression_bitset_to_message_bitset(accepted_encodings)),
- static_cast<grpc_stream_compression_algorithm>(0))) {
- gpr_log(GPR_ERROR, "Parse compression level error");
- return GRPC_COMPRESS_NONE;
- }
- return algo;
- } else {
- gpr_log(GPR_ERROR, "Unknown compression level: %d", level);
- return GRPC_COMPRESS_NONE;
- }
+ return grpc_core::CompressionAlgorithmSet::FromUint32(accepted_encodings)
+ .CompressionAlgorithmForLevel(level);
}
void grpc_compression_options_init(grpc_compression_options* opts) {
@@ -116,68 +74,18 @@ void grpc_compression_options_init(grpc_compression_options* opts) {
void grpc_compression_options_enable_algorithm(
grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
- GPR_BITSET(&opts->enabled_algorithms_bitset, algorithm);
+ grpc_core::SetBit(&opts->enabled_algorithms_bitset, algorithm);
}
void grpc_compression_options_disable_algorithm(
grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
- GPR_BITCLEAR(&opts->enabled_algorithms_bitset, algorithm);
+ grpc_core::ClearBit(&opts->enabled_algorithms_bitset, algorithm);
}
int grpc_compression_options_is_algorithm_enabled(
const grpc_compression_options* opts,
grpc_compression_algorithm algorithm) {
- return grpc_compression_options_is_algorithm_enabled_internal(opts,
- algorithm);
-}
-
-grpc_slice grpc_compression_algorithm_slice(
- grpc_compression_algorithm algorithm) {
- switch (algorithm) {
- case GRPC_COMPRESS_NONE:
- return GRPC_MDSTR_IDENTITY;
- case GRPC_COMPRESS_DEFLATE:
- return GRPC_MDSTR_DEFLATE;
- case GRPC_COMPRESS_GZIP:
- return GRPC_MDSTR_GZIP;
- case GRPC_COMPRESS_STREAM_GZIP:
- return GRPC_MDSTR_STREAM_SLASH_GZIP;
- case GRPC_COMPRESS_ALGORITHMS_COUNT:
- return grpc_empty_slice();
- }
- return grpc_empty_slice();
-}
-
-grpc_compression_algorithm grpc_compression_algorithm_from_slice(
- const grpc_slice& str) {
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_IDENTITY)) {
- return GRPC_COMPRESS_NONE;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_DEFLATE)) {
- return GRPC_COMPRESS_DEFLATE;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_GZIP)) {
- return GRPC_COMPRESS_GZIP;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_STREAM_SLASH_GZIP)) {
- return GRPC_COMPRESS_STREAM_GZIP;
- }
- return GRPC_COMPRESS_ALGORITHMS_COUNT;
-}
-
-grpc_mdelem grpc_compression_encoding_mdelem(
- grpc_compression_algorithm algorithm) {
- switch (algorithm) {
- case GRPC_COMPRESS_NONE:
- return GRPC_MDELEM_GRPC_ENCODING_IDENTITY;
- case GRPC_COMPRESS_DEFLATE:
- return GRPC_MDELEM_GRPC_ENCODING_DEFLATE;
- case GRPC_COMPRESS_GZIP:
- return GRPC_MDELEM_GRPC_ENCODING_GZIP;
- case GRPC_COMPRESS_STREAM_GZIP:
- return GRPC_MDELEM_GRPC_ENCODING_GZIP;
- default:
- break;
- }
- return GRPC_MDNULL;
+ return grpc_core::CompressionAlgorithmSet::FromUint32(
+ opts->enabled_algorithms_bitset)
+ .IsSet(algorithm);
}
diff --git a/grpc/src/core/lib/compression/compression_args.cc b/grpc/src/core/lib/compression/compression_args.cc
deleted file mode 100644
index 03e1a888..00000000
--- a/grpc/src/core/lib/compression/compression_args.cc
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * 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 <limits.h>
-#include <string.h>
-
-#include <grpc/compression.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/channel/channel_args.h"
-#include "src/core/lib/compression/compression_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gpr/useful.h"
-
-grpc_compression_algorithm
-grpc_channel_args_get_channel_default_compression_algorithm(
- const grpc_channel_args* a) {
- size_t i;
- if (a == nullptr) return GRPC_COMPRESS_NONE;
- for (i = 0; i < a->num_args; ++i) {
- if (a->args[i].type == GRPC_ARG_INTEGER &&
- !strcmp(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM, a->args[i].key)) {
- grpc_compression_algorithm default_algorithm =
- static_cast<grpc_compression_algorithm>(a->args[i].value.integer);
- return default_algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT
- ? default_algorithm
- : GRPC_COMPRESS_NONE;
- }
- }
- return GRPC_COMPRESS_NONE;
-}
-
-grpc_channel_args* grpc_channel_args_set_channel_default_compression_algorithm(
- grpc_channel_args* a, grpc_compression_algorithm algorithm) {
- GPR_ASSERT(algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT);
- grpc_arg tmp;
- tmp.type = GRPC_ARG_INTEGER;
- tmp.key = const_cast<char*>(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM);
- tmp.value.integer = algorithm;
- return grpc_channel_args_copy_and_add(a, &tmp, 1);
-}
-
-/** Returns 1 if the argument for compression algorithm's enabled states bitset
- * was found in \a a, returning the arg's value in \a states. Otherwise, returns
- * 0. */
-static int find_compression_algorithm_states_bitset(const grpc_channel_args* a,
- int** states_arg) {
- if (a != nullptr) {
- size_t i;
- for (i = 0; i < a->num_args; ++i) {
- if (a->args[i].type == GRPC_ARG_INTEGER &&
- !strcmp(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET,
- a->args[i].key)) {
- *states_arg = &a->args[i].value.integer;
- **states_arg =
- (**states_arg & ((1 << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1)) |
- 0x1; /* forcefully enable support for no compression */
- return 1;
- }
- }
- }
- return 0; /* GPR_FALSE */
-}
-
-grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
- grpc_channel_args** a, grpc_compression_algorithm algorithm, int state) {
- int* states_arg = nullptr;
- grpc_channel_args* result = *a;
- const int states_arg_found =
- find_compression_algorithm_states_bitset(*a, &states_arg);
-
- if (grpc_channel_args_get_channel_default_compression_algorithm(*a) ==
- algorithm &&
- state == 0) {
- const char* algo_name = nullptr;
- GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algo_name) != 0);
- gpr_log(GPR_ERROR,
- "Tried to disable default compression algorithm '%s'. The "
- "operation has been ignored.",
- algo_name);
- } else if (states_arg_found) {
- if (state != 0) {
- GPR_BITSET((unsigned*)states_arg, algorithm);
- } else if (algorithm != GRPC_COMPRESS_NONE) {
- GPR_BITCLEAR((unsigned*)states_arg, algorithm);
- }
- } else {
- /* create a new arg */
- grpc_arg tmp;
- tmp.type = GRPC_ARG_INTEGER;
- tmp.key =
- const_cast<char*>(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET);
- /* all enabled by default */
- tmp.value.integer = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
- if (state != 0) {
- GPR_BITSET((unsigned*)&tmp.value.integer, algorithm);
- } else if (algorithm != GRPC_COMPRESS_NONE) {
- GPR_BITCLEAR((unsigned*)&tmp.value.integer, algorithm);
- }
- result = grpc_channel_args_copy_and_add(*a, &tmp, 1);
- grpc_channel_args_destroy(*a);
- *a = result;
- }
- return result;
-}
-
-uint32_t grpc_channel_args_compression_algorithm_get_states(
- const grpc_channel_args* a) {
- int* states_arg;
- if (find_compression_algorithm_states_bitset(a, &states_arg)) {
- return static_cast<uint32_t>(*states_arg);
- } else {
- return (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; /* All algs. enabled */
- }
-}
diff --git a/grpc/src/core/lib/compression/compression_args.h b/grpc/src/core/lib/compression/compression_args.h
deleted file mode 100644
index f1abc122..00000000
--- a/grpc/src/core/lib/compression/compression_args.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * 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_COMPRESSION_COMPRESSION_ARGS_H
-#define GRPC_CORE_LIB_COMPRESSION_COMPRESSION_ARGS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/compression.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
-/** Returns the compression algorithm set in \a a. */
-grpc_compression_algorithm
-grpc_channel_args_get_channel_default_compression_algorithm(
- const grpc_channel_args* a);
-
-/** Returns a channel arg instance with compression enabled. If \a a is
- * non-NULL, its args are copied. N.B. GRPC_COMPRESS_NONE disables compression
- * for the channel. */
-grpc_channel_args* grpc_channel_args_set_channel_default_compression_algorithm(
- grpc_channel_args* a, grpc_compression_algorithm algorithm);
-
-/** Sets the support for the given compression algorithm. By default, all
- * compression algorithms are enabled. It's an error to disable an algorithm set
- * by grpc_channel_args_set_compression_algorithm.
- *
- * Returns an instance with the updated algorithm states. The \a a pointer is
- * modified to point to the returned instance (which may be different from the
- * input value of \a a). */
-grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
- grpc_channel_args** a, grpc_compression_algorithm algorithm, int state);
-
-/** Returns the bitset representing the support state (true for enabled, false
- * for disabled) for compression algorithms.
- *
- * The i-th bit of the returned bitset corresponds to the i-th entry in the
- * grpc_compression_algorithm enum. */
-uint32_t grpc_channel_args_compression_algorithm_get_states(
- const grpc_channel_args* a);
-
-#endif /* GRPC_CORE_LIB_COMPRESSION_COMPRESSION_ARGS_H */
diff --git a/grpc/src/core/lib/compression/compression_internal.cc b/grpc/src/core/lib/compression/compression_internal.cc
index 50750f85..a0f027e2 100644
--- a/grpc/src/core/lib/compression/compression_internal.cc
+++ b/grpc/src/core/lib/compression/compression_internal.cc
@@ -18,186 +18,60 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/compression_internal.h"
+
#include <stdlib.h>
#include <string.h>
+#include <cstdint>
+
+#include <zlib.h>
+
+#include "absl/container/inlined_vector.h"
+#include "absl/strings/str_join.h"
+#include "absl/strings/str_split.h"
+
#include <grpc/compression.h>
-#include "src/core/lib/compression/algorithm_metadata.h"
-#include "src/core/lib/compression/compression_internal.h"
+#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/transport/static_metadata.h"
-/* Interfaces related to MD */
+#define GRPC_DEFAULT_MIN_MESSAGE_SIZE_TO_COMPRESS (0)
-grpc_message_compression_algorithm
-grpc_message_compression_algorithm_from_slice(const grpc_slice& str) {
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_IDENTITY)) {
- return GRPC_MESSAGE_COMPRESS_NONE;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_DEFLATE)) {
- return GRPC_MESSAGE_COMPRESS_DEFLATE;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_GZIP)) {
- return GRPC_MESSAGE_COMPRESS_GZIP;
- }
- return GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT;
-}
-
-grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice(
- const grpc_slice& str) {
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_IDENTITY)) {
- return GRPC_STREAM_COMPRESS_NONE;
- }
- if (grpc_slice_eq_static_interned(str, GRPC_MDSTR_GZIP)) {
- return GRPC_STREAM_COMPRESS_GZIP;
- }
- return GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT;
-}
-
-grpc_mdelem grpc_message_compression_encoding_mdelem(
- grpc_message_compression_algorithm algorithm) {
- switch (algorithm) {
- case GRPC_MESSAGE_COMPRESS_NONE:
- return GRPC_MDELEM_GRPC_ENCODING_IDENTITY;
- case GRPC_MESSAGE_COMPRESS_DEFLATE:
- return GRPC_MDELEM_GRPC_ENCODING_DEFLATE;
- case GRPC_MESSAGE_COMPRESS_GZIP:
- return GRPC_MDELEM_GRPC_ENCODING_GZIP;
- default:
- break;
- }
- return GRPC_MDNULL;
-}
+namespace grpc_core {
-grpc_mdelem grpc_stream_compression_encoding_mdelem(
- grpc_stream_compression_algorithm algorithm) {
+const char* CompressionAlgorithmAsString(grpc_compression_algorithm algorithm) {
switch (algorithm) {
- case GRPC_STREAM_COMPRESS_NONE:
- return GRPC_MDELEM_CONTENT_ENCODING_IDENTITY;
- case GRPC_STREAM_COMPRESS_GZIP:
- return GRPC_MDELEM_CONTENT_ENCODING_GZIP;
- default:
- break;
- }
- return GRPC_MDNULL;
-}
-
-/* Interfaces performing transformation between compression algorithms and
- * levels. */
-grpc_message_compression_algorithm
-grpc_compression_algorithm_to_message_compression_algorithm(
- grpc_compression_algorithm algo) {
- switch (algo) {
+ case GRPC_COMPRESS_NONE:
+ return "identity";
case GRPC_COMPRESS_DEFLATE:
- return GRPC_MESSAGE_COMPRESS_DEFLATE;
+ return "deflate";
case GRPC_COMPRESS_GZIP:
- return GRPC_MESSAGE_COMPRESS_GZIP;
- default:
- return GRPC_MESSAGE_COMPRESS_NONE;
- }
-}
-
-grpc_stream_compression_algorithm
-grpc_compression_algorithm_to_stream_compression_algorithm(
- grpc_compression_algorithm algo) {
- switch (algo) {
- case GRPC_COMPRESS_STREAM_GZIP:
- return GRPC_STREAM_COMPRESS_GZIP;
+ return "gzip";
+ case GRPC_COMPRESS_ALGORITHMS_COUNT:
default:
- return GRPC_STREAM_COMPRESS_NONE;
+ return nullptr;
}
}
-uint32_t grpc_compression_bitset_to_message_bitset(uint32_t bitset) {
- return bitset & ((1u << GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT) - 1);
-}
-
-uint32_t grpc_compression_bitset_to_stream_bitset(uint32_t bitset) {
- uint32_t identity = (bitset & 1u);
- uint32_t other_bits =
- (bitset >> (GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT - 1)) &
- ((1u << GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) - 2);
- return identity | other_bits;
-}
-
-uint32_t grpc_compression_bitset_from_message_stream_compression_bitset(
- uint32_t message_bitset, uint32_t stream_bitset) {
- uint32_t offset_stream_bitset =
- (stream_bitset & 1u) |
- ((stream_bitset & (~1u)) << (GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT - 1));
- return message_bitset | offset_stream_bitset;
-}
-
-int grpc_compression_algorithm_from_message_stream_compression_algorithm(
- grpc_compression_algorithm* algorithm,
- grpc_message_compression_algorithm message_algorithm,
- grpc_stream_compression_algorithm stream_algorithm) {
- if (message_algorithm != GRPC_MESSAGE_COMPRESS_NONE &&
- stream_algorithm != GRPC_STREAM_COMPRESS_NONE) {
- *algorithm = GRPC_COMPRESS_NONE;
- return 0;
- }
- if (message_algorithm == GRPC_MESSAGE_COMPRESS_NONE) {
- switch (stream_algorithm) {
- case GRPC_STREAM_COMPRESS_NONE:
- *algorithm = GRPC_COMPRESS_NONE;
- return 1;
- case GRPC_STREAM_COMPRESS_GZIP:
- *algorithm = GRPC_COMPRESS_STREAM_GZIP;
- return 1;
- default:
- *algorithm = GRPC_COMPRESS_NONE;
- return 0;
- }
+absl::optional<grpc_compression_algorithm> ParseCompressionAlgorithm(
+ absl::string_view algorithm) {
+ if (algorithm == "identity") {
+ return GRPC_COMPRESS_NONE;
+ } else if (algorithm == "deflate") {
+ return GRPC_COMPRESS_DEFLATE;
+ } else if (algorithm == "gzip") {
+ return GRPC_COMPRESS_GZIP;
} else {
- switch (message_algorithm) {
- case GRPC_MESSAGE_COMPRESS_NONE:
- *algorithm = GRPC_COMPRESS_NONE;
- return 1;
- case GRPC_MESSAGE_COMPRESS_DEFLATE:
- *algorithm = GRPC_COMPRESS_DEFLATE;
- return 1;
- case GRPC_MESSAGE_COMPRESS_GZIP:
- *algorithm = GRPC_COMPRESS_GZIP;
- return 1;
- default:
- *algorithm = GRPC_COMPRESS_NONE;
- return 0;
- }
- }
- return 0;
-}
-
-/* Interfaces for message compression. */
-
-int grpc_message_compression_algorithm_name(
- grpc_message_compression_algorithm algorithm, const char** name) {
- GRPC_API_TRACE(
- "grpc_message_compression_algorithm_name(algorithm=%d, name=%p)", 2,
- ((int)algorithm, name));
- switch (algorithm) {
- case GRPC_MESSAGE_COMPRESS_NONE:
- *name = "identity";
- return 1;
- case GRPC_MESSAGE_COMPRESS_DEFLATE:
- *name = "deflate";
- return 1;
- case GRPC_MESSAGE_COMPRESS_GZIP:
- *name = "gzip";
- return 1;
- case GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT:
- return 0;
+ return absl::nullopt;
}
- return 0;
}
-/* TODO(dgq): Add the ability to specify parameters to the individual
- * compression algorithms */
-grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
- grpc_compression_level level, uint32_t accepted_encodings) {
+grpc_compression_algorithm
+CompressionAlgorithmSet::CompressionAlgorithmForLevel(
+ grpc_compression_level level) const {
GRPC_API_TRACE("grpc_message_compression_algorithm_for_level(level=%d)", 1,
((int)level));
if (level > GRPC_COMPRESS_LEVEL_HIGH) {
@@ -206,10 +80,8 @@ grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
abort();
}
- const size_t num_supported =
- GPR_BITCOUNT(accepted_encodings) - 1; /* discard NONE */
- if (level == GRPC_COMPRESS_LEVEL_NONE || num_supported == 0) {
- return GRPC_MESSAGE_COMPRESS_NONE;
+ if (level == GRPC_COMPRESS_LEVEL_NONE) {
+ return GRPC_COMPRESS_NONE;
}
GPR_ASSERT(level > 0);
@@ -218,68 +90,145 @@ grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
* compression.
* This is simplistic and we will probably want to introduce other dimensions
* in the future (cpu/memory cost, etc). */
- const grpc_message_compression_algorithm algos_ranking[] = {
- GRPC_MESSAGE_COMPRESS_GZIP, GRPC_MESSAGE_COMPRESS_DEFLATE};
-
- /* intersect algos_ranking with the supported ones keeping the ranked order */
- grpc_message_compression_algorithm
- sorted_supported_algos[GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT];
- size_t algos_supported_idx = 0;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(algos_ranking); i++) {
- const grpc_message_compression_algorithm alg = algos_ranking[i];
- for (size_t j = 0; j < num_supported; j++) {
- if (GPR_BITGET(accepted_encodings, alg) == 1) {
- /* if \a alg in supported */
- sorted_supported_algos[algos_supported_idx++] = alg;
- break;
- }
+ absl::InlinedVector<grpc_compression_algorithm,
+ GRPC_COMPRESS_ALGORITHMS_COUNT>
+ algos;
+ for (auto algo : {GRPC_COMPRESS_GZIP, GRPC_COMPRESS_DEFLATE}) {
+ if (set_.is_set(algo)) {
+ algos.push_back(algo);
}
- if (algos_supported_idx == num_supported) break;
+ }
+
+ if (algos.empty()) {
+ return GRPC_COMPRESS_NONE;
}
switch (level) {
case GRPC_COMPRESS_LEVEL_NONE:
abort(); /* should have been handled already */
case GRPC_COMPRESS_LEVEL_LOW:
- return sorted_supported_algos[0];
+ return algos[0];
case GRPC_COMPRESS_LEVEL_MED:
- return sorted_supported_algos[num_supported / 2];
+ return algos[algos.size() / 2];
case GRPC_COMPRESS_LEVEL_HIGH:
- return sorted_supported_algos[num_supported - 1];
+ return algos.back();
default:
abort();
};
}
-int grpc_message_compression_algorithm_parse(
- grpc_slice value, grpc_message_compression_algorithm* algorithm) {
- if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_IDENTITY)) {
- *algorithm = GRPC_MESSAGE_COMPRESS_NONE;
- return 1;
- } else if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_DEFLATE)) {
- *algorithm = GRPC_MESSAGE_COMPRESS_DEFLATE;
- return 1;
- } else if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_GZIP)) {
- *algorithm = GRPC_MESSAGE_COMPRESS_GZIP;
- return 1;
+CompressionAlgorithmSet CompressionAlgorithmSet::FromUint32(uint32_t value) {
+ CompressionAlgorithmSet set;
+ for (size_t i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+ if (value & (1u << i)) {
+ set.set_.set(i);
+ }
+ }
+ return set;
+}
+
+CompressionAlgorithmSet CompressionAlgorithmSet::FromChannelArgs(
+ const grpc_channel_args* args) {
+ CompressionAlgorithmSet set;
+ static const uint32_t kEverything =
+ (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
+ if (args != nullptr) {
+ set = CompressionAlgorithmSet::FromUint32(grpc_channel_args_find_integer(
+ args, GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET,
+ grpc_integer_options{kEverything, 0, kEverything}));
+ set.Set(GRPC_COMPRESS_NONE);
} else {
- return 0;
+ set = CompressionAlgorithmSet::FromUint32(kEverything);
}
- return 0;
+ return set;
}
-/* Interfaces for stream compression. */
+CompressionAlgorithmSet::CompressionAlgorithmSet() = default;
-int grpc_stream_compression_algorithm_parse(
- grpc_slice value, grpc_stream_compression_algorithm* algorithm) {
- if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_IDENTITY)) {
- *algorithm = GRPC_STREAM_COMPRESS_NONE;
- return 1;
- } else if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_GZIP)) {
- *algorithm = GRPC_STREAM_COMPRESS_GZIP;
- return 1;
+CompressionAlgorithmSet::CompressionAlgorithmSet(
+ std::initializer_list<grpc_compression_algorithm> algorithms) {
+ for (auto algorithm : algorithms) {
+ Set(algorithm);
+ }
+}
+
+bool CompressionAlgorithmSet::IsSet(
+ grpc_compression_algorithm algorithm) const {
+ size_t i = static_cast<size_t>(algorithm);
+ if (i < GRPC_COMPRESS_ALGORITHMS_COUNT) {
+ return set_.is_set(i);
} else {
- return 0;
+ return false;
+ }
+}
+
+void CompressionAlgorithmSet::Set(grpc_compression_algorithm algorithm) {
+ size_t i = static_cast<size_t>(algorithm);
+ if (i < GRPC_COMPRESS_ALGORITHMS_COUNT) {
+ set_.set(i);
+ }
+}
+
+std::string CompressionAlgorithmSet::ToString() const {
+ absl::InlinedVector<const char*, GRPC_COMPRESS_ALGORITHMS_COUNT> segments;
+ for (size_t i = 0; i < GRPC_COMPRESS_ALGORITHMS_COUNT; i++) {
+ if (set_.is_set(i)) {
+ segments.push_back(CompressionAlgorithmAsString(
+ static_cast<grpc_compression_algorithm>(i)));
+ }
+ }
+ return absl::StrJoin(segments, ", ");
+}
+
+Slice CompressionAlgorithmSet::ToSlice() const {
+ return Slice::FromCopiedString(ToString());
+}
+
+CompressionAlgorithmSet CompressionAlgorithmSet::FromString(
+ absl::string_view str) {
+ CompressionAlgorithmSet set{GRPC_COMPRESS_NONE};
+ for (auto algorithm : absl::StrSplit(str, ',')) {
+ auto parsed =
+ ParseCompressionAlgorithm(absl::StripAsciiWhitespace(algorithm));
+ if (parsed.has_value()) {
+ set.Set(*parsed);
+ }
}
- return 0;
+ return set;
}
+
+uint32_t CompressionAlgorithmSet::ToLegacyBitmask() const {
+ return set_.ToInt<uint32_t>();
+}
+
+absl::optional<grpc_compression_algorithm>
+DefaultCompressionAlgorithmFromChannelArgs(const grpc_channel_args* args) {
+ if (args == nullptr) return absl::nullopt;
+ for (size_t i = 0; i < args->num_args; i++) {
+ if (strcmp(args->args[i].key, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM) ==
+ 0) {
+ if (args->args[i].type == GRPC_ARG_INTEGER) {
+ return static_cast<grpc_compression_algorithm>(
+ args->args[i].value.integer);
+ } else if (args->args[i].type == GRPC_ARG_STRING) {
+ return ParseCompressionAlgorithm(args->args[i].value.string);
+ }
+ }
+ }
+ return absl::nullopt;
+}
+
+int DefaultGzipCompressionLevelFromChannelArgs(const grpc_channel_args* args) {
+ return grpc_channel_args_find_integer(
+ args, GRPC_ARG_GZIP_COMPRESSION_LEVEL,
+ {Z_DEFAULT_COMPRESSION, Z_NO_COMPRESSION, Z_BEST_COMPRESSION});
+}
+
+int DefaultGrpcMinMessageSizeToCompressFromChannelArgs(
+ const grpc_channel_args* args) {
+ return grpc_channel_args_find_integer(
+ args, GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS,
+ {GRPC_DEFAULT_MIN_MESSAGE_SIZE_TO_COMPRESS, 0, INT_MAX});
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/compression/compression_internal.h b/grpc/src/core/lib/compression/compression_internal.h
index 22977f7e..6e6c81c8 100644
--- a/grpc/src/core/lib/compression/compression_internal.h
+++ b/grpc/src/core/lib/compression/compression_internal.h
@@ -21,77 +21,77 @@
#include <grpc/support/port_platform.h>
-#include <grpc/compression.h>
-#include <grpc/slice.h>
-
-#include "src/core/lib/gpr/useful.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
- GRPC_MESSAGE_COMPRESS_NONE = 0,
- GRPC_MESSAGE_COMPRESS_DEFLATE,
- GRPC_MESSAGE_COMPRESS_GZIP,
- /* TODO(ctiller): snappy */
- GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT
-} grpc_message_compression_algorithm;
-
-/** Stream compression algorithms supported by gRPC */
-typedef enum {
- GRPC_STREAM_COMPRESS_NONE = 0,
- GRPC_STREAM_COMPRESS_GZIP,
- GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT
-} grpc_stream_compression_algorithm;
-
-/* Interfaces performing transformation between compression algorithms and
- * levels. */
-
-grpc_message_compression_algorithm
-grpc_compression_algorithm_to_message_compression_algorithm(
- grpc_compression_algorithm algo);
-
-grpc_stream_compression_algorithm
-grpc_compression_algorithm_to_stream_compression_algorithm(
- grpc_compression_algorithm algo);
-
-uint32_t grpc_compression_bitset_to_message_bitset(uint32_t bitset);
+#include <initializer_list>
-uint32_t grpc_compression_bitset_to_stream_bitset(uint32_t bitset);
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
-uint32_t grpc_compression_bitset_from_message_stream_compression_bitset(
- uint32_t message_bitset, uint32_t stream_bitset);
-
-int grpc_compression_algorithm_from_message_stream_compression_algorithm(
- grpc_compression_algorithm* algorithm,
- grpc_message_compression_algorithm message_algorithm,
- grpc_stream_compression_algorithm stream_algorithm);
-
-/* Interfaces for message compression. */
-
-int grpc_message_compression_algorithm_name(
- grpc_message_compression_algorithm algorithm, const char** name);
-
-grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
- grpc_compression_level level, uint32_t accepted_encodings);
-
-int grpc_message_compression_algorithm_parse(
- grpc_slice value, grpc_message_compression_algorithm* algorithm);
-
-/* Interfaces for stream compression. */
-
-int grpc_stream_compression_algorithm_parse(
- grpc_slice value, grpc_stream_compression_algorithm* algorithm);
-
-#ifdef __cplusplus
-}
-#endif
+#include <grpc/compression.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/slice.h>
-inline int grpc_compression_options_is_algorithm_enabled_internal(
- const grpc_compression_options* opts,
- grpc_compression_algorithm algorithm) {
- return GPR_BITGET(opts->enabled_algorithms_bitset, algorithm);
-}
+#include "src/core/lib/gprpp/bitset.h"
+#include "src/core/lib/slice/slice.h"
+
+namespace grpc_core {
+
+// Given a string naming a compression algorithm, return the corresponding enum
+// or nullopt on error.
+absl::optional<grpc_compression_algorithm> ParseCompressionAlgorithm(
+ absl::string_view algorithm);
+// Convert a compression algorithm to a string. Returns nullptr if a name is not
+// known.
+const char* CompressionAlgorithmAsString(grpc_compression_algorithm algorithm);
+// Retrieve the default compression algorithm from channel args, return nullopt
+// if not found.
+absl::optional<grpc_compression_algorithm>
+DefaultCompressionAlgorithmFromChannelArgs(const grpc_channel_args* args);
+
+int DefaultGzipCompressionLevelFromChannelArgs(const grpc_channel_args* args);
+
+int DefaultGrpcMinMessageSizeToCompressFromChannelArgs(
+ const grpc_channel_args* args);
+
+// A set of grpc_compression_algorithm values.
+class CompressionAlgorithmSet {
+ public:
+ // Construct from a uint32_t bitmask - bit 0 => algorithm 0, bit 1 =>
+ // algorithm 1, etc.
+ static CompressionAlgorithmSet FromUint32(uint32_t value);
+ // Locate in channel args and construct from the found value.
+ static CompressionAlgorithmSet FromChannelArgs(const grpc_channel_args* args);
+ // Parse a string of comma-separated compression algorithms.
+ static CompressionAlgorithmSet FromString(absl::string_view str);
+ // Construct an empty set.
+ CompressionAlgorithmSet();
+ // Construct from a std::initializer_list of grpc_compression_algorithm
+ // values.
+ CompressionAlgorithmSet(
+ std::initializer_list<grpc_compression_algorithm> algorithms);
+
+ // Given a compression level, choose an appropriate algorithm from this set.
+ grpc_compression_algorithm CompressionAlgorithmForLevel(
+ grpc_compression_level level) const;
+ // Return true if this set contains algorithm, false otherwise.
+ bool IsSet(grpc_compression_algorithm algorithm) const;
+ // Add algorithm to this set.
+ void Set(grpc_compression_algorithm algorithm);
+
+ // Return a comma separated string of the algorithms in this set.
+ std::string ToString() const;
+ Slice ToSlice() const;
+
+ // Return a bitmask of the algorithms in this set.
+ uint32_t ToLegacyBitmask() const;
+
+ bool operator==(const CompressionAlgorithmSet& other) const {
+ return set_ == other.set_;
+ }
+
+ private:
+ BitSet<GRPC_COMPRESS_ALGORITHMS_COUNT> set_;
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H */
diff --git a/grpc/src/core/lib/compression/message_compress.cc b/grpc/src/core/lib/compression/message_compress.cc
index 7c2a70ba..0187c1ea 100644
--- a/grpc/src/core/lib/compression/message_compress.cc
+++ b/grpc/src/core/lib/compression/message_compress.cc
@@ -21,14 +21,38 @@
#include "src/core/lib/compression/message_compress.h"
#include <string.h>
+#include <zconf.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
+#include <memory>
#include <zlib.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/slice/slice_internal.h"
+namespace grpc_core {
+
+class GzipCompressionOptionsImpl : public CompressionOptions {
+ public:
+ explicit GzipCompressionOptionsImpl(const grpc_channel_args* args)
+ : gzip_compression_level_(
+ DefaultGzipCompressionLevelFromChannelArgs(args)) {}
+
+ int gzip_compression_level() const { return gzip_compression_level_; }
+
+ private:
+ int gzip_compression_level_;
+};
+
+std::unique_ptr<CompressionOptions> MakeCompressionOptions(
+ const grpc_channel_args* args) {
+ return absl::make_unique<GzipCompressionOptionsImpl>(args);
+}
+} // namespace grpc_core
+
#define OUTPUT_BLOCK_SIZE 1024
static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
@@ -92,7 +116,8 @@ static void* zalloc_gpr(void* /*opaque*/, unsigned int items,
static void zfree_gpr(void* /*opaque*/, void* address) { gpr_free(address); }
static int zlib_compress(grpc_slice_buffer* input, grpc_slice_buffer* output,
- int gzip) {
+ int gzip,
+ const grpc_core::GzipCompressionOptionsImpl* options) {
z_stream zs;
int r;
size_t i;
@@ -101,8 +126,8 @@ static int zlib_compress(grpc_slice_buffer* input, grpc_slice_buffer* output,
memset(&zs, 0, sizeof(zs));
zs.zalloc = zalloc_gpr;
zs.zfree = zfree_gpr;
- r = deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 | (gzip ? 16 : 0),
- 8, Z_DEFAULT_STRATEGY);
+ r = deflateInit2(&zs, options->gzip_compression_level(), Z_DEFLATED,
+ 15 | (gzip ? 16 : 0), 8, Z_DEFAULT_STRATEGY);
GPR_ASSERT(r == Z_OK);
r = zlib_body(&zs, input, output, deflate) && output->length < input->length;
if (!r) {
@@ -148,43 +173,48 @@ static int copy(grpc_slice_buffer* input, grpc_slice_buffer* output) {
return 1;
}
-static int compress_inner(grpc_message_compression_algorithm algorithm,
- grpc_slice_buffer* input, grpc_slice_buffer* output) {
+static int compress_inner(
+ grpc_compression_algorithm algorithm, grpc_slice_buffer* input,
+ grpc_slice_buffer* output,
+ const grpc_core::GzipCompressionOptionsImpl* options) {
switch (algorithm) {
- case GRPC_MESSAGE_COMPRESS_NONE:
+ case GRPC_COMPRESS_NONE:
/* the fallback path always needs to be send uncompressed: we simply
rely on that here */
return 0;
- case GRPC_MESSAGE_COMPRESS_DEFLATE:
- return zlib_compress(input, output, 0);
- case GRPC_MESSAGE_COMPRESS_GZIP:
- return zlib_compress(input, output, 1);
- case GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT:
+ case GRPC_COMPRESS_DEFLATE:
+ return zlib_compress(input, output, 0, options);
+ case GRPC_COMPRESS_GZIP:
+ return zlib_compress(input, output, 1, options);
+ case GRPC_COMPRESS_ALGORITHMS_COUNT:
break;
}
gpr_log(GPR_ERROR, "invalid compression algorithm %d", algorithm);
return 0;
}
-int grpc_msg_compress(grpc_message_compression_algorithm algorithm,
- grpc_slice_buffer* input, grpc_slice_buffer* output) {
- if (!compress_inner(algorithm, input, output)) {
+int grpc_msg_compress(grpc_compression_algorithm algorithm,
+ grpc_slice_buffer* input, grpc_slice_buffer* output,
+ const grpc_core::CompressionOptions* options) {
+ auto compression_options =
+ static_cast<const grpc_core::GzipCompressionOptionsImpl*>(options);
+ if (!compress_inner(algorithm, input, output, compression_options)) {
copy(input, output);
return 0;
}
return 1;
}
-int grpc_msg_decompress(grpc_message_compression_algorithm algorithm,
+int grpc_msg_decompress(grpc_compression_algorithm algorithm,
grpc_slice_buffer* input, grpc_slice_buffer* output) {
switch (algorithm) {
- case GRPC_MESSAGE_COMPRESS_NONE:
+ case GRPC_COMPRESS_NONE:
return copy(input, output);
- case GRPC_MESSAGE_COMPRESS_DEFLATE:
+ case GRPC_COMPRESS_DEFLATE:
return zlib_decompress(input, output, 0);
- case GRPC_MESSAGE_COMPRESS_GZIP:
+ case GRPC_COMPRESS_GZIP:
return zlib_decompress(input, output, 1);
- case GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT:
+ case GRPC_COMPRESS_ALGORITHMS_COUNT:
break;
}
gpr_log(GPR_ERROR, "invalid compression algorithm %d", algorithm);
diff --git a/grpc/src/core/lib/compression/message_compress.h b/grpc/src/core/lib/compression/message_compress.h
index 91654e47..25cce044 100644
--- a/grpc/src/core/lib/compression/message_compress.h
+++ b/grpc/src/core/lib/compression/message_compress.h
@@ -21,20 +21,38 @@
#include <grpc/support/port_platform.h>
+#include <memory>
+
+#include <grpc/impl/codegen/compression_types.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include "src/core/lib/compression/compression_internal.h"
+namespace grpc_core {
+class CompressionOptions {
+ public:
+ virtual ~CompressionOptions() = default;
+};
+
+// Return Compression options
+std::unique_ptr<CompressionOptions> MakeCompressionOptions(
+ const grpc_channel_args* args);
+
+} // namespace grpc_core
+
/* compress 'input' to 'output' using 'algorithm'.
On success, appends compressed slices to output and returns 1.
On failure, appends uncompressed slices to output and returns 0. */
-int grpc_msg_compress(grpc_message_compression_algorithm algorithm,
- grpc_slice_buffer* input, grpc_slice_buffer* output);
+int grpc_msg_compress(grpc_compression_algorithm algorithm,
+ grpc_slice_buffer* input, grpc_slice_buffer* output,
+ const grpc_core::CompressionOptions* options);
/* decompress 'input' to 'output' using 'algorithm'.
On success, appends slices to output and returns 1.
On failure, output is unchanged, and returns 0. */
-int grpc_msg_decompress(grpc_message_compression_algorithm algorithm,
+int grpc_msg_decompress(grpc_compression_algorithm algorithm,
grpc_slice_buffer* input, grpc_slice_buffer* output);
#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */
diff --git a/grpc/src/core/lib/compression/stream_compression.cc b/grpc/src/core/lib/compression/stream_compression.cc
deleted file mode 100644
index e0857988..00000000
--- a/grpc/src/core/lib/compression/stream_compression.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 <grpc/support/log.h>
-
-#include "src/core/lib/compression/stream_compression.h"
-#include "src/core/lib/compression/stream_compression_gzip.h"
-#include "src/core/lib/slice/slice_utils.h"
-
-extern const grpc_stream_compression_vtable
- grpc_stream_compression_identity_vtable;
-
-bool grpc_stream_compress(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size,
- grpc_stream_compression_flush flush) {
- return ctx->vtable->compress(ctx, in, out, output_size, max_output_size,
- flush);
-}
-
-bool grpc_stream_decompress(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size,
- bool* end_of_context) {
- return ctx->vtable->decompress(ctx, in, out, output_size, max_output_size,
- end_of_context);
-}
-
-grpc_stream_compression_context* grpc_stream_compression_context_create(
- grpc_stream_compression_method method) {
- switch (method) {
- case GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS:
- case GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS:
- return grpc_stream_compression_identity_vtable.context_create(method);
- case GRPC_STREAM_COMPRESSION_GZIP_COMPRESS:
- case GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS:
- return grpc_stream_compression_gzip_vtable.context_create(method);
- default:
- gpr_log(GPR_ERROR, "Unknown stream compression method: %d", method);
- return nullptr;
- }
-}
-
-void grpc_stream_compression_context_destroy(
- grpc_stream_compression_context* ctx) {
- ctx->vtable->context_destroy(ctx);
-}
-
-int grpc_stream_compression_method_parse(
- grpc_slice value, bool is_compress,
- grpc_stream_compression_method* method) {
- if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_IDENTITY)) {
- *method = is_compress ? GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS
- : GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS;
- return 1;
- } else if (grpc_slice_eq_static_interned(value, GRPC_MDSTR_GZIP)) {
- *method = is_compress ? GRPC_STREAM_COMPRESSION_GZIP_COMPRESS
- : GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS;
- return 1;
- } else {
- return 0;
- }
-}
diff --git a/grpc/src/core/lib/compression/stream_compression.h b/grpc/src/core/lib/compression/stream_compression.h
deleted file mode 100644
index 7328c3ec..00000000
--- a/grpc/src/core/lib/compression/stream_compression.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_COMPRESSION_STREAM_COMPRESSION_H
-#define GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stdbool.h>
-
-#include <grpc/slice_buffer.h>
-#include <zlib.h>
-
-#include "src/core/lib/transport/static_metadata.h"
-
-typedef struct grpc_stream_compression_vtable grpc_stream_compression_vtable;
-
-/* Stream compression/decompression context */
-typedef struct grpc_stream_compression_context {
- const grpc_stream_compression_vtable* vtable;
-} grpc_stream_compression_context;
-
-typedef enum grpc_stream_compression_method {
- GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS = 0,
- GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS,
- GRPC_STREAM_COMPRESSION_GZIP_COMPRESS,
- GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS,
- GRPC_STREAM_COMPRESSION_METHOD_COUNT
-} grpc_stream_compression_method;
-
-typedef enum grpc_stream_compression_flush {
- GRPC_STREAM_COMPRESSION_FLUSH_NONE = 0,
- GRPC_STREAM_COMPRESSION_FLUSH_SYNC,
- GRPC_STREAM_COMPRESSION_FLUSH_FINISH,
- GRPC_STREAM_COMPRESSION_FLUSH_COUNT
-} grpc_stream_compression_flush;
-
-struct grpc_stream_compression_vtable {
- bool (*compress)(grpc_stream_compression_context* ctx, grpc_slice_buffer* in,
- grpc_slice_buffer* out, size_t* output_size,
- size_t max_output_size, grpc_stream_compression_flush flush);
- bool (*decompress)(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size,
- bool* end_of_context);
- grpc_stream_compression_context* (*context_create)(
- grpc_stream_compression_method method);
- void (*context_destroy)(grpc_stream_compression_context* ctx);
-};
-
-/**
- * Compress bytes provided in \a in with a given context, with an optional flush
- * at the end of compression. Emits at most \a max_output_size compressed bytes
- * into \a out. If all the bytes in input buffer \a in are depleted and \a flush
- * is not GRPC_STREAM_COMPRESSION_FLUSH_NONE, the corresponding flush method is
- * executed. The total number of bytes emitted is outputted in \a output_size.
- *
- * A SYNC flush indicates that the entire messages in \a in can be decompressed
- * from \a out. A FINISH flush implies a SYNC flush, and that any further
- * compression will not be dependent on the state of the current context and any
- * previous compressed bytes. It allows corresponding decompression context to
- * be dropped when reaching this boundary.
- */
-bool grpc_stream_compress(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size,
- grpc_stream_compression_flush flush);
-
-/**
- * Decompress bytes provided in \a in with a given context. Emits at most \a
- * max_output_size decompressed bytes into \a out. If decompression process
- * reached the end of a gzip stream, \a end_of_context is set to true; otherwise
- * it is set to false. The total number of bytes emitted is outputted in \a
- * output_size.
- */
-bool grpc_stream_decompress(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size,
- bool* end_of_context);
-
-/**
- * Creates a stream compression context. \a pending_bytes_buffer is the input
- * buffer for compression/decompression operations. \a method specifies whether
- * the context is for compression or decompression.
- */
-grpc_stream_compression_context* grpc_stream_compression_context_create(
- grpc_stream_compression_method method);
-
-/**
- * Destroys a stream compression context.
- */
-void grpc_stream_compression_context_destroy(
- grpc_stream_compression_context* ctx);
-
-/**
- * Parse stream compression method based on algorithm name
- */
-int grpc_stream_compression_method_parse(
- grpc_slice value, bool is_compress, grpc_stream_compression_method* method);
-
-#endif
diff --git a/grpc/src/core/lib/compression/stream_compression_gzip.cc b/grpc/src/core/lib/compression/stream_compression_gzip.cc
deleted file mode 100644
index 452b22b7..00000000
--- a/grpc/src/core/lib/compression/stream_compression_gzip.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/compression/stream_compression_gzip.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-#define OUTPUT_BLOCK_SIZE (1024)
-
-typedef struct grpc_stream_compression_context_gzip {
- grpc_stream_compression_context base;
-
- z_stream zs;
- int (*flate)(z_stream* zs, int flush);
-} grpc_stream_compression_context_gzip;
-
-static bool gzip_flate(grpc_stream_compression_context_gzip* ctx,
- grpc_slice_buffer* in, grpc_slice_buffer* out,
- size_t* output_size, size_t max_output_size, int flush,
- bool* end_of_context) {
- GPR_ASSERT(flush == 0 || flush == Z_SYNC_FLUSH || flush == Z_FINISH);
- /* Full flush is not allowed when inflating. */
- GPR_ASSERT(!(ctx->flate == inflate && (flush == Z_FINISH)));
-
- grpc_core::ExecCtx exec_ctx;
- int r;
- bool eoc = false;
- size_t original_max_output_size = max_output_size;
- while (max_output_size > 0 && (in->length > 0 || flush) && !eoc) {
- size_t slice_size = max_output_size < OUTPUT_BLOCK_SIZE ? max_output_size
- : OUTPUT_BLOCK_SIZE;
- grpc_slice slice_out = GRPC_SLICE_MALLOC(slice_size);
- ctx->zs.avail_out = static_cast<uInt>(slice_size);
- ctx->zs.next_out = GRPC_SLICE_START_PTR(slice_out);
- while (ctx->zs.avail_out > 0 && in->length > 0 && !eoc) {
- grpc_slice* slice = grpc_slice_buffer_peek_first(in);
- ctx->zs.avail_in = static_cast<uInt> GRPC_SLICE_LENGTH(*slice);
- ctx->zs.next_in = GRPC_SLICE_START_PTR(*slice);
- r = ctx->flate(&ctx->zs, Z_NO_FLUSH);
- if (r < 0 && r != Z_BUF_ERROR) {
- gpr_log(GPR_ERROR, "zlib error (%d)", r);
- grpc_slice_unref_internal(slice_out);
- grpc_slice_buffer_remove_first(in);
- return false;
- } else if (r == Z_STREAM_END && ctx->flate == inflate) {
- eoc = true;
- }
- if (ctx->zs.avail_in > 0) {
- grpc_slice_buffer_sub_first(
- in, GRPC_SLICE_LENGTH(*slice) - ctx->zs.avail_in,
- GRPC_SLICE_LENGTH(*slice));
- } else {
- grpc_slice_buffer_remove_first(in);
- }
- }
- if (flush != 0 && ctx->zs.avail_out > 0 && !eoc) {
- GPR_ASSERT(in->length == 0);
- r = ctx->flate(&ctx->zs, flush);
- if (flush == Z_SYNC_FLUSH) {
- switch (r) {
- case Z_OK:
- /* Maybe flush is not complete; just made some partial progress. */
- if (ctx->zs.avail_out > 0) {
- flush = 0;
- }
- break;
- case Z_BUF_ERROR:
- case Z_STREAM_END:
- flush = 0;
- break;
- default:
- gpr_log(GPR_ERROR, "zlib error (%d)", r);
- grpc_slice_unref_internal(slice_out);
-
- return false;
- }
- } else if (flush == Z_FINISH) {
- switch (r) {
- case Z_OK:
- case Z_BUF_ERROR:
- /* Wait for the next loop to assign additional output space. */
- GPR_ASSERT(ctx->zs.avail_out == 0);
- break;
- case Z_STREAM_END:
- flush = 0;
- break;
- default:
- gpr_log(GPR_ERROR, "zlib error (%d)", r);
- grpc_slice_unref_internal(slice_out);
-
- return false;
- }
- }
- }
-
- if (ctx->zs.avail_out == 0) {
- grpc_slice_buffer_add(out, slice_out);
- } else if (ctx->zs.avail_out < slice_size) {
- size_t len = GRPC_SLICE_LENGTH(slice_out);
- GRPC_SLICE_SET_LENGTH(slice_out, len - ctx->zs.avail_out);
- grpc_slice_buffer_add(out, slice_out);
- } else {
- grpc_slice_unref_internal(slice_out);
- }
- max_output_size -= (slice_size - ctx->zs.avail_out);
- }
-
- if (end_of_context) {
- *end_of_context = eoc;
- }
- if (output_size) {
- *output_size = original_max_output_size - max_output_size;
- }
- return true;
-}
-
-static bool grpc_stream_compress_gzip(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in,
- grpc_slice_buffer* out,
- size_t* output_size,
- size_t max_output_size,
- grpc_stream_compression_flush flush) {
- if (ctx == nullptr) {
- return false;
- }
- grpc_stream_compression_context_gzip* gzip_ctx =
- reinterpret_cast<grpc_stream_compression_context_gzip*>(ctx);
- GPR_ASSERT(gzip_ctx->flate == deflate);
- int gzip_flush;
- switch (flush) {
- case GRPC_STREAM_COMPRESSION_FLUSH_NONE:
- gzip_flush = 0;
- break;
- case GRPC_STREAM_COMPRESSION_FLUSH_SYNC:
- gzip_flush = Z_SYNC_FLUSH;
- break;
- case GRPC_STREAM_COMPRESSION_FLUSH_FINISH:
- gzip_flush = Z_FINISH;
- break;
- default:
- gzip_flush = 0;
- }
- return gzip_flate(gzip_ctx, in, out, output_size, max_output_size, gzip_flush,
- nullptr);
-}
-
-static bool grpc_stream_decompress_gzip(grpc_stream_compression_context* ctx,
- grpc_slice_buffer* in,
- grpc_slice_buffer* out,
- size_t* output_size,
- size_t max_output_size,
- bool* end_of_context) {
- if (ctx == nullptr) {
- return false;
- }
- grpc_stream_compression_context_gzip* gzip_ctx =
- reinterpret_cast<grpc_stream_compression_context_gzip*>(ctx);
- GPR_ASSERT(gzip_ctx->flate == inflate);
- return gzip_flate(gzip_ctx, in, out, output_size, max_output_size,
- Z_SYNC_FLUSH, end_of_context);
-}
-
-static grpc_stream_compression_context*
-grpc_stream_compression_context_create_gzip(
- grpc_stream_compression_method method) {
- GPR_ASSERT(method == GRPC_STREAM_COMPRESSION_GZIP_COMPRESS ||
- method == GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS);
- grpc_stream_compression_context_gzip* gzip_ctx =
- static_cast<grpc_stream_compression_context_gzip*>(
- gpr_zalloc(sizeof(grpc_stream_compression_context_gzip)));
- int r;
- if (gzip_ctx == nullptr) {
- return nullptr;
- }
- if (method == GRPC_STREAM_COMPRESSION_GZIP_DECOMPRESS) {
- r = inflateInit2(&gzip_ctx->zs, 0x1F);
- gzip_ctx->flate = inflate;
- } else {
- r = deflateInit2(&gzip_ctx->zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 0x1F, 8,
- Z_DEFAULT_STRATEGY);
- gzip_ctx->flate = deflate;
- }
- if (r != Z_OK) {
- gpr_free(gzip_ctx);
- return nullptr;
- }
-
- gzip_ctx->base.vtable = &grpc_stream_compression_gzip_vtable;
- return reinterpret_cast<grpc_stream_compression_context*>(gzip_ctx);
-}
-
-static void grpc_stream_compression_context_destroy_gzip(
- grpc_stream_compression_context* ctx) {
- if (ctx == nullptr) {
- return;
- }
- grpc_stream_compression_context_gzip* gzip_ctx =
- reinterpret_cast<grpc_stream_compression_context_gzip*>(ctx);
- if (gzip_ctx->flate == inflate) {
- inflateEnd(&gzip_ctx->zs);
- } else {
- deflateEnd(&gzip_ctx->zs);
- }
- gpr_free(ctx);
-}
-
-const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable = {
- grpc_stream_compress_gzip, grpc_stream_decompress_gzip,
- grpc_stream_compression_context_create_gzip,
- grpc_stream_compression_context_destroy_gzip};
diff --git a/grpc/src/core/lib/compression/stream_compression_gzip.h b/grpc/src/core/lib/compression/stream_compression_gzip.h
deleted file mode 100644
index 740f0973..00000000
--- a/grpc/src/core/lib/compression/stream_compression_gzip.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_COMPRESSION_STREAM_COMPRESSION_GZIP_H
-#define GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_GZIP_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/compression/stream_compression.h"
-
-extern const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable;
-
-#endif
diff --git a/grpc/src/core/lib/compression/stream_compression_identity.cc b/grpc/src/core/lib/compression/stream_compression_identity.cc
deleted file mode 100644
index 78486f09..00000000
--- a/grpc/src/core/lib/compression/stream_compression_identity.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/compression/stream_compression_identity.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-#define OUTPUT_BLOCK_SIZE (1024)
-
-/* Singleton context used for all identity streams. */
-static grpc_stream_compression_context identity_ctx = {
- &grpc_stream_compression_identity_vtable};
-
-static void grpc_stream_compression_pass_through(grpc_slice_buffer* in,
- grpc_slice_buffer* out,
- size_t* output_size,
- size_t max_output_size) {
- if (max_output_size >= in->length) {
- if (output_size) {
- *output_size = in->length;
- }
- grpc_slice_buffer_move_into(in, out);
- } else {
- if (output_size) {
- *output_size = max_output_size;
- }
- grpc_slice_buffer_move_first(in, max_output_size, out);
- }
-}
-
-static bool grpc_stream_compress_identity(
- grpc_stream_compression_context* ctx, grpc_slice_buffer* in,
- grpc_slice_buffer* out, size_t* output_size, size_t max_output_size,
- grpc_stream_compression_flush /*flush*/) {
- if (ctx == nullptr) {
- return false;
- }
- grpc_stream_compression_pass_through(in, out, output_size, max_output_size);
- return true;
-}
-
-static bool grpc_stream_decompress_identity(
- grpc_stream_compression_context* ctx, grpc_slice_buffer* in,
- grpc_slice_buffer* out, size_t* output_size, size_t max_output_size,
- bool* end_of_context) {
- if (ctx == nullptr) {
- return false;
- }
- grpc_stream_compression_pass_through(in, out, output_size, max_output_size);
- if (end_of_context) {
- *end_of_context = false;
- }
- return true;
-}
-
-static grpc_stream_compression_context*
-grpc_stream_compression_context_create_identity(
- grpc_stream_compression_method method) {
- GPR_ASSERT(method == GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS ||
- method == GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS);
- /* No context needed in this case. Use fake context instead. */
- return &identity_ctx;
-}
-
-static void grpc_stream_compression_context_destroy_identity(
- grpc_stream_compression_context* /*ctx*/) {}
-
-const grpc_stream_compression_vtable grpc_stream_compression_identity_vtable = {
- grpc_stream_compress_identity, grpc_stream_decompress_identity,
- grpc_stream_compression_context_create_identity,
- grpc_stream_compression_context_destroy_identity};
diff --git a/grpc/src/core/lib/compression/stream_compression_identity.h b/grpc/src/core/lib/compression/stream_compression_identity.h
deleted file mode 100644
index cc77b63e..00000000
--- a/grpc/src/core/lib/compression/stream_compression_identity.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_COMPRESSION_STREAM_COMPRESSION_IDENTITY_H
-#define GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_IDENTITY_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/compression/stream_compression.h"
-
-extern const grpc_stream_compression_vtable
- grpc_stream_compression_identity_vtable;
-
-#endif
diff --git a/grpc/src/core/lib/config/core_configuration.cc b/grpc/src/core/lib/config/core_configuration.cc
new file mode 100644
index 00000000..3924cd95
--- /dev/null
+++ b/grpc/src/core/lib/config/core_configuration.cc
@@ -0,0 +1,104 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/config/core_configuration.h"
+
+#include <atomic>
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+std::atomic<CoreConfiguration*> CoreConfiguration::config_{nullptr};
+std::atomic<CoreConfiguration::RegisteredBuilder*> CoreConfiguration::builders_{
+ nullptr};
+void (*CoreConfiguration::default_builder_)(CoreConfiguration::Builder*);
+
+CoreConfiguration::Builder::Builder() = default;
+
+CoreConfiguration* CoreConfiguration::Builder::Build() {
+ return new CoreConfiguration(this);
+}
+
+CoreConfiguration::CoreConfiguration(Builder* builder)
+ : channel_args_preconditioning_(
+ builder->channel_args_preconditioning_.Build()),
+ channel_init_(builder->channel_init_.Build()),
+ handshaker_registry_(builder->handshaker_registry_.Build()),
+ channel_creds_registry_(builder->channel_creds_registry_.Build()),
+ service_config_parser_(builder->service_config_parser_.Build()),
+ resolver_registry_(builder->resolver_registry_.Build()) {}
+
+void CoreConfiguration::RegisterBuilder(std::function<void(Builder*)> builder) {
+ GPR_ASSERT(config_.load(std::memory_order_relaxed) == nullptr &&
+ "CoreConfiguration was already instantiated before builder "
+ "registration was completed");
+ RegisteredBuilder* n = new RegisteredBuilder();
+ n->builder = std::move(builder);
+ n->next = builders_.load(std::memory_order_relaxed);
+ while (!builders_.compare_exchange_weak(n->next, n, std::memory_order_acq_rel,
+ std::memory_order_relaxed)) {
+ }
+ GPR_ASSERT(config_.load(std::memory_order_relaxed) == nullptr &&
+ "CoreConfiguration was already instantiated before builder "
+ "registration was completed");
+}
+
+const CoreConfiguration& CoreConfiguration::BuildNewAndMaybeSet() {
+ // Construct builder, pass it up to code that knows about build configuration
+ Builder builder;
+ // The linked list of builders stores things in reverse registration order.
+ // To get things registered as systems relying on this expect however, we
+ // actually need to run things in forward registration order, so we iterate
+ // once over the linked list to build a vector of builders, and then iterate
+ // over said vector in reverse to actually run the builders.
+ std::vector<RegisteredBuilder*> registered_builders;
+ for (RegisteredBuilder* b = builders_.load(std::memory_order_acquire);
+ b != nullptr; b = b->next) {
+ registered_builders.push_back(b);
+ }
+ for (auto it = registered_builders.rbegin(); it != registered_builders.rend();
+ ++it) {
+ (*it)->builder(&builder);
+ }
+ // Finally, call the built in configuration builder.
+ if (default_builder_ != nullptr) (*default_builder_)(&builder);
+ // Use builder to construct a confguration
+ CoreConfiguration* p = builder.Build();
+ // Try to set configuration global - it's possible another thread raced us
+ // here, in which case we drop the work we did and use the one that got set
+ // first
+ CoreConfiguration* expected = nullptr;
+ if (!config_.compare_exchange_strong(expected, p, std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ delete p;
+ return *expected;
+ }
+ return *p;
+}
+
+void CoreConfiguration::Reset() {
+ delete config_.exchange(nullptr, std::memory_order_acquire);
+ RegisteredBuilder* builder =
+ builders_.exchange(nullptr, std::memory_order_acquire);
+ while (builder != nullptr) {
+ RegisteredBuilder* next = builder->next;
+ delete builder;
+ builder = next;
+ }
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/config/core_configuration.h b/grpc/src/core/lib/config/core_configuration.h
new file mode 100644
index 00000000..a526c79b
--- /dev/null
+++ b/grpc/src/core/lib/config/core_configuration.h
@@ -0,0 +1,196 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CONFIG_CORE_CONFIGURATION_H
+#define GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+#include "src/core/lib/channel/channel_args_preconditioning.h"
+#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/resolver/resolver_registry.h"
+#include "src/core/lib/security/credentials/channel_creds_registry.h"
+#include "src/core/lib/service_config/service_config_parser.h"
+#include "src/core/lib/surface/channel_init.h"
+
+namespace grpc_core {
+
+// Global singleton that stores library configuration - factories, etc...
+// that plugins might choose to extend.
+class CoreConfiguration {
+ public:
+ CoreConfiguration(const CoreConfiguration&) = delete;
+ CoreConfiguration& operator=(const CoreConfiguration&) = delete;
+
+ // Builder is passed to plugins, etc... at initialization time to collect
+ // their configuration and assemble the published CoreConfiguration.
+ class Builder {
+ public:
+ ChannelArgsPreconditioning::Builder* channel_args_preconditioning() {
+ return &channel_args_preconditioning_;
+ }
+
+ ChannelInit::Builder* channel_init() { return &channel_init_; }
+
+ HandshakerRegistry::Builder* handshaker_registry() {
+ return &handshaker_registry_;
+ }
+
+ ChannelCredsRegistry<>::Builder* channel_creds_registry() {
+ return &channel_creds_registry_;
+ }
+
+ ServiceConfigParser::Builder* service_config_parser() {
+ return &service_config_parser_;
+ }
+
+ ResolverRegistry::Builder* resolver_registry() {
+ return &resolver_registry_;
+ }
+
+ private:
+ friend class CoreConfiguration;
+
+ ChannelArgsPreconditioning::Builder channel_args_preconditioning_;
+ ChannelInit::Builder channel_init_;
+ HandshakerRegistry::Builder handshaker_registry_;
+ ChannelCredsRegistry<>::Builder channel_creds_registry_;
+ ServiceConfigParser::Builder service_config_parser_;
+ ResolverRegistry::Builder resolver_registry_;
+
+ Builder();
+ CoreConfiguration* Build();
+ };
+
+ // Lifetime methods
+
+ // Get the core configuration; if it does not exist, create it.
+ static const CoreConfiguration& Get() {
+ CoreConfiguration* p = config_.load(std::memory_order_acquire);
+ if (p != nullptr) {
+ return *p;
+ }
+ return BuildNewAndMaybeSet();
+ }
+
+ // Build a special core configuration.
+ // Requires no concurrent Get() be called.
+ // Doesn't call the regular BuildCoreConfiguration function, instead calls
+ // `build`.
+ // BuildFunc is a callable that takes a Builder* and returns void.
+ // We use a template instead of std::function<void(Builder*)> to avoid
+ // including std::function in this widely used header, and to ensure no code
+ // is generated in programs that do not use this function.
+ // This is sometimes useful for testing.
+ template <typename BuildFunc>
+ static void BuildSpecialConfiguration(BuildFunc build) {
+ // Build bespoke configuration
+ Builder builder;
+ build(&builder);
+ CoreConfiguration* p = builder.Build();
+ // Swap in final configuration, deleting anything that was already present.
+ delete config_.exchange(p, std::memory_order_release);
+ }
+
+ // Attach a registration function globally.
+ // Each registration function is called *in addition to*
+ // BuildCoreConfiguration for the default core configuration. When using
+ // BuildSpecialConfiguration, one can use CallRegisteredBuilders to call them.
+ // Must be called before a configuration is built.
+ static void RegisterBuilder(std::function<void(Builder*)> builder);
+
+ // Call all registered builders.
+ // See RegisterBuilder for why you might want to call this.
+ static void CallRegisteredBuilders(Builder* builder);
+
+ // Drop the core configuration. Users must ensure no other threads are
+ // accessing the configuration.
+ // Clears any dynamically registered builders.
+ static void Reset();
+
+ // Helper for tests: Reset the configuration, build a special one, run some
+ // code, and then reset the configuration again.
+ // Templatized to be sure no codegen in normal builds.
+ template <typename BuildFunc, typename RunFunc>
+ static void RunWithSpecialConfiguration(BuildFunc build_configuration,
+ RunFunc code_to_run) {
+ Reset();
+ BuildSpecialConfiguration(build_configuration);
+ code_to_run();
+ Reset();
+ }
+
+ // Accessors
+
+ const ChannelArgsPreconditioning& channel_args_preconditioning() const {
+ return channel_args_preconditioning_;
+ }
+
+ const ChannelInit& channel_init() const { return channel_init_; }
+
+ const HandshakerRegistry& handshaker_registry() const {
+ return handshaker_registry_;
+ }
+
+ const ChannelCredsRegistry<>& channel_creds_registry() const {
+ return channel_creds_registry_;
+ }
+
+ const ServiceConfigParser& service_config_parser() const {
+ return service_config_parser_;
+ }
+
+ const ResolverRegistry& resolver_registry() const {
+ return resolver_registry_;
+ }
+
+ static void SetDefaultBuilder(void (*builder)(CoreConfiguration::Builder*)) {
+ default_builder_ = builder;
+ }
+
+ private:
+ explicit CoreConfiguration(Builder* builder);
+
+ // Stores a builder for RegisterBuilder
+ struct RegisteredBuilder {
+ std::function<void(Builder*)> builder;
+ RegisteredBuilder* next;
+ };
+
+ // Create a new CoreConfiguration, and either set it or throw it away.
+ // We allow multiple CoreConfiguration's to be created in parallel.
+ static const CoreConfiguration& BuildNewAndMaybeSet();
+
+ // The configuration
+ static std::atomic<CoreConfiguration*> config_;
+ // Extra registered builders
+ static std::atomic<RegisteredBuilder*> builders_;
+ // Default builder
+ static void (*default_builder_)(CoreConfiguration::Builder*);
+
+ ChannelArgsPreconditioning channel_args_preconditioning_;
+ ChannelInit channel_init_;
+ HandshakerRegistry handshaker_registry_;
+ ChannelCredsRegistry<> channel_creds_registry_;
+ ServiceConfigParser service_config_parser_;
+ ResolverRegistry resolver_registry_;
+};
+
+extern void BuildCoreConfiguration(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H */
diff --git a/grpc/src/core/lib/debug/stats.cc b/grpc/src/core/lib/debug/stats.cc
index 7f602b6b..a0292e3b 100644
--- a/grpc/src/core/lib/debug/stats.cc
+++ b/grpc/src/core/lib/debug/stats.cc
@@ -38,7 +38,7 @@ grpc_stats_data* grpc_stats_per_cpu_storage = nullptr;
static size_t g_num_cores;
void grpc_stats_init(void) {
- g_num_cores = GPR_MAX(1, gpr_cpu_num_cores());
+ g_num_cores = std::max(1u, gpr_cpu_num_cores());
grpc_stats_per_cpu_storage = static_cast<grpc_stats_data*>(
gpr_zalloc(sizeof(grpc_stats_data) * g_num_cores));
}
diff --git a/grpc/src/core/lib/debug/stats.h b/grpc/src/core/lib/debug/stats.h
index 8829b093..cafaa644 100644
--- a/grpc/src/core/lib/debug/stats.h
+++ b/grpc/src/core/lib/debug/stats.h
@@ -24,6 +24,7 @@
#include <string>
#include <grpc/support/atm.h>
+
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -67,4 +68,4 @@ double grpc_stats_histo_percentile(const grpc_stats_data* stats,
size_t grpc_stats_histo_count(const grpc_stats_data* stats,
grpc_stats_histograms histogram);
-#endif
+#endif // GRPC_CORE_LIB_DEBUG_STATS_H
diff --git a/grpc/src/core/lib/debug/stats_data.cc b/grpc/src/core/lib/debug/stats_data.cc
index ceacc571..73963c4c 100644
--- a/grpc/src/core/lib/debug/stats_data.cc
+++ b/grpc/src/core/lib/debug/stats_data.cc
@@ -20,8 +20,9 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
+
+#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -40,8 +41,6 @@ const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
"pollset_kick_wakeup_fd",
"pollset_kick_wakeup_cv",
"pollset_kick_own_thread",
- "syscall_epoll_ctl",
- "pollset_fd_cache_hits",
"histogram_slow_lookups",
"syscall_write",
"syscall_read",
@@ -74,6 +73,7 @@ const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
"http2_initiate_write_due_to_stream_flow_control",
"http2_initiate_write_due_to_transport_flow_control",
"http2_initiate_write_due_to_send_settings",
+ "http2_initiate_write_due_to_settings_ack",
"http2_initiate_write_due_to_bdp_estimator_ping",
"http2_initiate_write_due_to_flow_control_unstalled_by_setting",
"http2_initiate_write_due_to_flow_control_unstalled_by_update",
@@ -146,9 +146,6 @@ const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = {
"polling wakeup (only valid for epoll1 right now)",
"How many times could a polling wakeup be satisfied by keeping the waking "
"thread awake? (only valid for epoll1 right now)",
- "Number of epoll_ctl calls made (only valid for epollex right now)",
- "Number of epoll_ctl calls skipped because the fd was cached as already "
- "being added. (only valid for epollex right now)",
"Number of times histogram increments went through the slow (binary "
"search) path",
"Number of write syscalls (or equivalent - eg sendmsg) made by this "
@@ -185,6 +182,7 @@ const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = {
"Number of HTTP2 writes initiated due to 'stream_flow_control'",
"Number of HTTP2 writes initiated due to 'transport_flow_control'",
"Number of HTTP2 writes initiated due to 'send_settings'",
+ "Number of HTTP2 writes initiated due to 'settings_ack'",
"Number of HTTP2 writes initiated due to 'bdp_estimator_ping'",
"Number of HTTP2 writes initiated due to "
"'flow_control_unstalled_by_setting'",
@@ -280,7 +278,6 @@ const char* grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT] = {
"Number of streams whose payload was written per TCP write",
"Number of streams terminated per TCP write",
"Number of flow control updates written per TCP write",
- // NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
"How many completion queues were checked looking for a CQ that had "
"requested the incoming call",
};
@@ -352,7 +349,7 @@ const uint8_t grpc_stats_table_7[102] = {
const int grpc_stats_table_8[9] = {0, 1, 2, 4, 7, 13, 23, 39, 64};
const uint8_t grpc_stats_table_9[9] = {0, 0, 1, 2, 2, 3, 4, 4, 5};
void grpc_stats_inc_call_initial_size(int value) {
- value = GPR_CLAMP(value, 0, 262144);
+ value = grpc_core::Clamp(value, 0, 262144);
if (value < 6) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE, value);
return;
@@ -375,7 +372,7 @@ void grpc_stats_inc_call_initial_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_0, 64));
}
void grpc_stats_inc_poll_events_returned(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 29) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED, value);
return;
@@ -398,7 +395,7 @@ void grpc_stats_inc_poll_events_returned(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_2, 128));
}
void grpc_stats_inc_tcp_write_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, value);
return;
@@ -421,7 +418,7 @@ void grpc_stats_inc_tcp_write_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_write_iov_size(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, value);
return;
@@ -444,7 +441,7 @@ void grpc_stats_inc_tcp_write_iov_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_tcp_read_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, value);
return;
@@ -467,7 +464,7 @@ void grpc_stats_inc_tcp_read_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_read_offer(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, value);
return;
@@ -490,7 +487,7 @@ void grpc_stats_inc_tcp_read_offer(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_read_offer_iov_size(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_IOV_SIZE,
value);
@@ -515,7 +512,7 @@ void grpc_stats_inc_tcp_read_offer_iov_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_message_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE,
value);
@@ -540,7 +537,7 @@ void grpc_stats_inc_http2_send_message_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_http2_send_initial_metadata_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(
GRPC_STATS_HISTOGRAM_HTTP2_SEND_INITIAL_METADATA_PER_WRITE, value);
@@ -565,7 +562,7 @@ void grpc_stats_inc_http2_send_initial_metadata_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_message_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_PER_WRITE,
value);
@@ -590,7 +587,7 @@ void grpc_stats_inc_http2_send_message_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(
GRPC_STATS_HISTOGRAM_HTTP2_SEND_TRAILING_METADATA_PER_WRITE, value);
@@ -615,7 +612,7 @@ void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_flowctl_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_FLOWCTL_PER_WRITE,
value);
@@ -640,7 +637,7 @@ void grpc_stats_inc_http2_send_flowctl_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_server_cqs_checked(int value) {
- value = GPR_CLAMP(value, 0, 64);
+ value = grpc_core::Clamp(value, 0, 64);
if (value < 3) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED, value);
return;
diff --git a/grpc/src/core/lib/debug/stats_data.h b/grpc/src/core/lib/debug/stats_data.h
index c1356c44..46084198 100644
--- a/grpc/src/core/lib/debug/stats_data.h
+++ b/grpc/src/core/lib/debug/stats_data.h
@@ -24,6 +24,7 @@
#include <grpc/support/port_platform.h>
#include <inttypes.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
typedef enum {
@@ -41,8 +42,6 @@ typedef enum {
GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_FD,
GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV,
GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD,
- GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL,
- GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS,
GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS,
GRPC_STATS_COUNTER_SYSCALL_WRITE,
GRPC_STATS_COUNTER_SYSCALL_READ,
@@ -75,6 +74,7 @@ typedef enum {
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_STREAM_FLOW_CONTROL,
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL,
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS,
+ GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK,
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING,
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING,
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_UPDATE,
@@ -205,10 +205,6 @@ typedef enum {
GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_WAKEUP_CV)
#define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD() \
GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_KICK_OWN_THREAD)
-#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL() \
- GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_SYSCALL_EPOLL_CTL)
-#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS() \
- GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_POLLSET_FD_CACHE_HITS)
#define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS() \
GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS)
#define GRPC_STATS_INC_SYSCALL_WRITE() \
@@ -286,6 +282,9 @@ typedef enum {
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS() \
GRPC_STATS_INC_COUNTER( \
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS)
+#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK() \
+ GRPC_STATS_INC_COUNTER( \
+ GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK)
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING() \
GRPC_STATS_INC_COUNTER( \
GRPC_STATS_COUNTER_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING)
@@ -397,43 +396,43 @@ typedef enum {
GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES)
#define GRPC_STATS_INC_CALL_INITIAL_SIZE(value) \
grpc_stats_inc_call_initial_size((int)(value))
-void grpc_stats_inc_call_initial_size(int value);
+void grpc_stats_inc_call_initial_size(int x);
#define GRPC_STATS_INC_POLL_EVENTS_RETURNED(value) \
grpc_stats_inc_poll_events_returned((int)(value))
-void grpc_stats_inc_poll_events_returned(int value);
+void grpc_stats_inc_poll_events_returned(int x);
#define GRPC_STATS_INC_TCP_WRITE_SIZE(value) \
grpc_stats_inc_tcp_write_size((int)(value))
-void grpc_stats_inc_tcp_write_size(int value);
+void grpc_stats_inc_tcp_write_size(int x);
#define GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(value) \
grpc_stats_inc_tcp_write_iov_size((int)(value))
-void grpc_stats_inc_tcp_write_iov_size(int value);
+void grpc_stats_inc_tcp_write_iov_size(int x);
#define GRPC_STATS_INC_TCP_READ_SIZE(value) \
grpc_stats_inc_tcp_read_size((int)(value))
-void grpc_stats_inc_tcp_read_size(int value);
+void grpc_stats_inc_tcp_read_size(int x);
#define GRPC_STATS_INC_TCP_READ_OFFER(value) \
grpc_stats_inc_tcp_read_offer((int)(value))
-void grpc_stats_inc_tcp_read_offer(int value);
+void grpc_stats_inc_tcp_read_offer(int x);
#define GRPC_STATS_INC_TCP_READ_OFFER_IOV_SIZE(value) \
grpc_stats_inc_tcp_read_offer_iov_size((int)(value))
-void grpc_stats_inc_tcp_read_offer_iov_size(int value);
+void grpc_stats_inc_tcp_read_offer_iov_size(int x);
#define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(value) \
grpc_stats_inc_http2_send_message_size((int)(value))
-void grpc_stats_inc_http2_send_message_size(int value);
+void grpc_stats_inc_http2_send_message_size(int x);
#define GRPC_STATS_INC_HTTP2_SEND_INITIAL_METADATA_PER_WRITE(value) \
grpc_stats_inc_http2_send_initial_metadata_per_write((int)(value))
-void grpc_stats_inc_http2_send_initial_metadata_per_write(int value);
+void grpc_stats_inc_http2_send_initial_metadata_per_write(int x);
#define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_PER_WRITE(value) \
grpc_stats_inc_http2_send_message_per_write((int)(value))
-void grpc_stats_inc_http2_send_message_per_write(int value);
+void grpc_stats_inc_http2_send_message_per_write(int x);
#define GRPC_STATS_INC_HTTP2_SEND_TRAILING_METADATA_PER_WRITE(value) \
grpc_stats_inc_http2_send_trailing_metadata_per_write((int)(value))
-void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value);
+void grpc_stats_inc_http2_send_trailing_metadata_per_write(int x);
#define GRPC_STATS_INC_HTTP2_SEND_FLOWCTL_PER_WRITE(value) \
grpc_stats_inc_http2_send_flowctl_per_write((int)(value))
-void grpc_stats_inc_http2_send_flowctl_per_write(int value);
+void grpc_stats_inc_http2_send_flowctl_per_write(int x);
#define GRPC_STATS_INC_SERVER_CQS_CHECKED(value) \
grpc_stats_inc_server_cqs_checked((int)(value))
-void grpc_stats_inc_server_cqs_checked(int value);
+void grpc_stats_inc_server_cqs_checked(int x);
#else
#define GRPC_STATS_INC_CLIENT_CALLS_CREATED()
#define GRPC_STATS_INC_SERVER_CALLS_CREATED()
@@ -449,8 +448,6 @@ void grpc_stats_inc_server_cqs_checked(int value);
#define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD()
#define GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV()
#define GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD()
-#define GRPC_STATS_INC_SYSCALL_EPOLL_CTL()
-#define GRPC_STATS_INC_POLLSET_FD_CACHE_HITS()
#define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS()
#define GRPC_STATS_INC_SYSCALL_WRITE()
#define GRPC_STATS_INC_SYSCALL_READ()
@@ -483,6 +480,7 @@ void grpc_stats_inc_server_cqs_checked(int value);
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_STREAM_FLOW_CONTROL()
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL()
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS()
+#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SETTINGS_ACK()
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING()
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING()
#define GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_UPDATE()
diff --git a/grpc/src/core/lib/debug/stats_data.yaml b/grpc/src/core/lib/debug/stats_data.yaml
index 775b09df..76dc7341 100644
--- a/grpc/src/core/lib/debug/stats_data.yaml
+++ b/grpc/src/core/lib/debug/stats_data.yaml
@@ -63,12 +63,6 @@
doc: How many times could a polling wakeup be satisfied by keeping the waking
thread awake?
(only valid for epoll1 right now)
-# polling
-- counter: syscall_epoll_ctl
- doc: Number of epoll_ctl calls made (only valid for epollex right now)
-- counter: pollset_fd_cache_hits
- doc: Number of epoll_ctl calls skipped because the fd was cached as
- already being added. (only valid for epollex right now)
# stats system
- counter: histogram_slow_lookups
doc: Number of times histogram increments went through the slow
@@ -179,6 +173,8 @@
doc: Number of HTTP2 writes initiated due to 'transport_flow_control'
- counter: http2_initiate_write_due_to_send_settings
doc: Number of HTTP2 writes initiated due to 'send_settings'
+- counter: http2_initiate_write_due_to_settings_ack
+ doc: Number of HTTP2 writes initiated due to 'settings_ack'
- counter: http2_initiate_write_due_to_bdp_estimator_ping
doc: Number of HTTP2 writes initiated due to 'bdp_estimator_ping'
- counter: http2_initiate_write_due_to_flow_control_unstalled_by_setting
diff --git a/grpc/src/core/lib/debug/stats_data_bq_schema.sql b/grpc/src/core/lib/debug/stats_data_bq_schema.sql
index 7d1ab1da..1c542c21 100644
--- a/grpc/src/core/lib/debug/stats_data_bq_schema.sql
+++ b/grpc/src/core/lib/debug/stats_data_bq_schema.sql
@@ -12,8 +12,6 @@ pollset_kicked_again_per_iteration:FLOAT,
pollset_kick_wakeup_fd_per_iteration:FLOAT,
pollset_kick_wakeup_cv_per_iteration:FLOAT,
pollset_kick_own_thread_per_iteration:FLOAT,
-syscall_epoll_ctl_per_iteration:FLOAT,
-pollset_fd_cache_hits_per_iteration:FLOAT,
histogram_slow_lookups_per_iteration:FLOAT,
syscall_write_per_iteration:FLOAT,
syscall_read_per_iteration:FLOAT,
@@ -46,6 +44,7 @@ http2_initiate_write_due_to_close_from_api_per_iteration:FLOAT,
http2_initiate_write_due_to_stream_flow_control_per_iteration:FLOAT,
http2_initiate_write_due_to_transport_flow_control_per_iteration:FLOAT,
http2_initiate_write_due_to_send_settings_per_iteration:FLOAT,
+http2_initiate_write_due_to_settings_ack_per_iteration:FLOAT,
http2_initiate_write_due_to_bdp_estimator_ping_per_iteration:FLOAT,
http2_initiate_write_due_to_flow_control_unstalled_by_setting_per_iteration:FLOAT,
http2_initiate_write_due_to_flow_control_unstalled_by_update_per_iteration:FLOAT,
diff --git a/grpc/src/core/lib/debug/trace.cc b/grpc/src/core/lib/debug/trace.cc
index 84c0a380..87b61446 100644
--- a/grpc/src/core/lib/debug/trace.cc
+++ b/grpc/src/core/lib/debug/trace.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/debug/trace.h"
#include <string.h>
+
#include <type_traits>
#include <grpc/grpc.h>
diff --git a/grpc/src/core/lib/debug/trace.h b/grpc/src/core/lib/debug/trace.h
index ac7b40e5..91d15b3f 100644
--- a/grpc/src/core/lib/debug/trace.h
+++ b/grpc/src/core/lib/debug/trace.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
#include <stdbool.h>
+#include <grpc/support/atm.h>
+
#include "src/core/lib/gprpp/global_config.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_trace);
@@ -55,7 +56,7 @@ class TraceFlagList {
};
namespace testing {
-void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag);
+void grpc_tracer_enable_flag(TraceFlag* flag);
}
class TraceFlag {
@@ -89,7 +90,7 @@ class TraceFlag {
#endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */
private:
- friend void grpc_core::testing::grpc_tracer_enable_flag(TraceFlag* flag);
+ friend void testing::grpc_tracer_enable_flag(TraceFlag* flag);
friend class TraceFlagList;
void set_enabled(bool enabled) {
diff --git a/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc b/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc
new file mode 100644
index 00000000..f6e7c4a8
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc
@@ -0,0 +1,46 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
+
+#include <grpc/event_engine/endpoint_config.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/impl/codegen/log.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/useful.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EndpointConfig::Setting ChannelArgsEndpointConfig::Get(
+ absl::string_view key) const {
+ const grpc_arg* arg = grpc_channel_args_find(args_, std::string(key).c_str());
+ if (arg == nullptr) {
+ return absl::monostate();
+ }
+ switch (arg->type) {
+ case GRPC_ARG_STRING:
+ return absl::string_view(arg->value.string);
+ case GRPC_ARG_INTEGER:
+ return arg->value.integer;
+ case GRPC_ARG_POINTER:
+ return arg->value.pointer.p;
+ }
+ GPR_UNREACHABLE_CODE(return absl::monostate());
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h b/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h
new file mode 100644
index 00000000..e48887d8
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h
@@ -0,0 +1,42 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/endpoint_config.h>
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// A readonly \a EndpointConfig based on grpc_channel_args. This class does not
+/// take ownership of the grpc_endpoint_args*, and instances of this class
+/// should not be used after the underlying args are destroyed.
+class ChannelArgsEndpointConfig : public EndpointConfig {
+ public:
+ explicit ChannelArgsEndpointConfig(const grpc_channel_args* args)
+ : args_(args) {}
+ Setting Get(absl::string_view key) const override;
+
+ private:
+ const grpc_channel_args* args_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
diff --git a/grpc/src/core/lib/event_engine/default_event_engine_factory.cc b/grpc/src/core/lib/event_engine/default_event_engine_factory.cc
new file mode 100644
index 00000000..f84a1283
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/default_event_engine_factory.cc
@@ -0,0 +1,27 @@
+// Copyright 2022 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.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/event_engine/event_engine_factory.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+std::unique_ptr<EventEngine> DefaultEventEngineFactory() {
+ // TODO(hork): call LibuvEventEngineFactory
+ return nullptr;
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/event_engine.cc b/grpc/src/core/lib/event_engine/event_engine.cc
new file mode 100644
index 00000000..31b25a2c
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/event_engine.cc
@@ -0,0 +1,52 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/event_engine/port.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+const std::function<std::unique_ptr<EventEngine>()>* g_event_engine_factory =
+ nullptr;
+grpc_core::Mutex* g_mu = new grpc_core::Mutex();
+} // namespace
+
+void SetDefaultEventEngineFactory(
+ const std::function<std::unique_ptr<EventEngine>()>* factory) {
+ grpc_core::MutexLock lock(g_mu);
+ g_event_engine_factory = factory;
+}
+
+std::unique_ptr<EventEngine> CreateEventEngine() {
+ grpc_core::MutexLock lock(g_mu);
+ if (g_event_engine_factory != nullptr) {
+ return (*g_event_engine_factory)();
+ }
+ return DefaultEventEngineFactory();
+}
+
+EventEngine* GetDefaultEventEngine() {
+ static EventEngine* default_event_engine = CreateEventEngine().release();
+ return default_event_engine;
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/event_engine_factory.h b/grpc/src/core/lib/event_engine/event_engine_factory.h
new file mode 100644
index 00000000..11a96924
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/event_engine_factory.h
@@ -0,0 +1,36 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Access the shared global EventEngine instance.
+///
+/// The concept of a global EventEngine may go away in a post-iomgr world.
+/// Strongly consider whether you could use \a CreateEventEngine instead.
+EventEngine* GetDefaultEventEngine();
+
+/// Create an EventEngine using the default factory provided at link time.
+std::unique_ptr<EventEngine> DefaultEventEngineFactory();
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
diff --git a/grpc/src/core/lib/event_engine/memory_allocator.cc b/grpc/src/core/lib/event_engine/memory_allocator.cc
new file mode 100644
index 00000000..afb056ec
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/memory_allocator.cc
@@ -0,0 +1,66 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <grpc/event_engine/memory_allocator.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/slice/slice_refcount.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+
+// Reference count for a slice allocated by MemoryAllocator::MakeSlice.
+// Takes care of releasing memory back when the slice is destroyed.
+class SliceRefCount : public grpc_slice_refcount {
+ public:
+ SliceRefCount(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ size_t size)
+ : grpc_slice_refcount(Destroy),
+ allocator_(std::move(allocator)),
+ size_(size) {
+ // Nothing to do here.
+ }
+ ~SliceRefCount() { allocator_->Release(size_); }
+
+ private:
+ static void Destroy(grpc_slice_refcount* p) {
+ auto* rc = static_cast<SliceRefCount*>(p);
+ rc->~SliceRefCount();
+ gpr_free(rc);
+ }
+
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ size_t size_;
+};
+
+} // namespace
+
+grpc_slice MemoryAllocator::MakeSlice(MemoryRequest request) {
+ auto size = Reserve(request.Increase(sizeof(SliceRefCount)));
+ void* p = gpr_malloc(size);
+ new (p) SliceRefCount(allocator_, size);
+ grpc_slice slice;
+ slice.refcount = static_cast<SliceRefCount*>(p);
+ slice.data.refcounted.bytes =
+ static_cast<uint8_t*>(p) + sizeof(SliceRefCount);
+ slice.data.refcounted.length = size - sizeof(SliceRefCount);
+ return slice;
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/resolved_address.cc b/grpc/src/core/lib/event_engine/resolved_address.cc
new file mode 100644
index 00000000..0623e631
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/resolved_address.cc
@@ -0,0 +1,39 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/event_engine/port.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress::ResolvedAddress(const sockaddr* address,
+ socklen_t size)
+ : size_(size) {
+ GPR_ASSERT(size <= sizeof(address_));
+ memcpy(&address_, address, size);
+}
+
+const struct sockaddr* EventEngine::ResolvedAddress::address() const {
+ return reinterpret_cast<const struct sockaddr*>(address_);
+}
+
+socklen_t EventEngine::ResolvedAddress::size() const { return size_; }
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/slice_allocator.cc b/grpc/src/core/lib/event_engine/slice_allocator.cc
deleted file mode 100644
index 3ea615ac..00000000
--- a/grpc/src/core/lib/event_engine/slice_allocator.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2021 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.
-#include <grpc/support/port_platform.h>
-
-#include "grpc/event_engine/slice_allocator.h"
-
-#include <functional>
-
-#include "absl/status/status.h"
-
-#include "src/core/lib/iomgr/resource_quota.h"
-
-namespace grpc_event_engine {
-namespace experimental {
-
-SliceAllocator::SliceAllocator(grpc_resource_user* user)
- : resource_user_(user) {
- grpc_resource_user_ref(resource_user_);
-};
-
-SliceAllocator::~SliceAllocator() { grpc_resource_user_unref(resource_user_); };
-
-absl::Status SliceAllocator::Allocate(size_t size, SliceBuffer* dest,
- SliceAllocator::AllocateCallback cb) {
- // TODO(hork): implement
- (void)size;
- (void)dest;
- (void)cb;
- return absl::OkStatus();
-};
-
-SliceAllocatorFactory::SliceAllocatorFactory(grpc_resource_quota* quota)
- : resource_quota_(quota) {
- grpc_resource_quota_ref_internal(resource_quota_);
-};
-
-SliceAllocatorFactory::~SliceAllocatorFactory() {
- grpc_resource_quota_unref_internal(resource_quota_);
-}
-
-SliceAllocator SliceAllocatorFactory::CreateSliceAllocator(
- absl::string_view peer_name) {
- return SliceAllocator(
- grpc_resource_user_create(resource_quota_, peer_name.data()));
-}
-
-} // namespace experimental
-} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/event_engine/sockaddr.cc b/grpc/src/core/lib/event_engine/sockaddr.cc
index 811d3519..dab44f93 100644
--- a/grpc/src/core/lib/event_engine/sockaddr.cc
+++ b/grpc/src/core/lib/event_engine/sockaddr.cc
@@ -13,26 +13,28 @@
// limitations under the License.
#include <grpc/support/port_platform.h>
+#ifdef GRPC_USE_EVENT_ENGINE
#include <string.h>
-#include "grpc/event_engine/event_engine.h"
-#include "grpc/event_engine/port.h"
-#include "grpc/support/log.h"
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/event_engine/port.h>
+#include <grpc/support/log.h>
-namespace grpc_event_engine {
-namespace experimental {
+uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
-EventEngine::ResolvedAddress::ResolvedAddress(const sockaddr* address,
- socklen_t size) {
- GPR_ASSERT(size <= sizeof(address_));
- memcpy(&address_, address, size);
-}
+uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
-const struct sockaddr* EventEngine::ResolvedAddress::address() const {
- return reinterpret_cast<const struct sockaddr*>(address_);
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
+int grpc_inet_pton(int af, const char* src, void* dst) {
+ return inet_pton(af, src, dst);
}
-socklen_t EventEngine::ResolvedAddress::size() const { return size_; }
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
+ inet_ntop(af, src, dst, size);
+ return dst;
+}
-} // namespace experimental
-} // namespace grpc_event_engine
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/event_engine/sockaddr.h b/grpc/src/core/lib/event_engine/sockaddr.h
new file mode 100644
index 00000000..23b83dde
--- /dev/null
+++ b/grpc/src/core/lib/event_engine/sockaddr.h
@@ -0,0 +1,44 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/port.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+typedef struct sockaddr grpc_sockaddr;
+typedef struct sockaddr_in grpc_sockaddr_in;
+typedef struct sockaddr_in6 grpc_sockaddr_in6;
+typedef struct in_addr grpc_in_addr;
+typedef struct in6_addr grpc_in6_addr;
+
+#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
+#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
+
+#define GRPC_SOCK_STREAM SOCK_STREAM
+#define GRPC_SOCK_DGRAM SOCK_DGRAM
+
+#define GRPC_AF_UNSPEC AF_UNSPEC
+#define GRPC_AF_UNIX AF_UNIX
+#define GRPC_AF_INET AF_INET
+#define GRPC_AF_INET6 AF_INET6
+
+#define GRPC_AI_PASSIVE AI_PASSIVE
+
+#endif
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
diff --git a/grpc/src/core/lib/gpr/alloc.cc b/grpc/src/core/lib/gpr/alloc.cc
index 5bfdc8d1..9a46ff85 100644
--- a/grpc/src/core/lib/gpr/alloc.cc
+++ b/grpc/src/core/lib/gpr/alloc.cc
@@ -18,11 +18,12 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-
-#include <grpc/support/log.h>
#include <stdlib.h>
#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
#include "src/core/lib/profiling/timers.h"
void* gpr_malloc(size_t size) {
diff --git a/grpc/src/core/lib/gpr/arena.h b/grpc/src/core/lib/gpr/arena.h
deleted file mode 100644
index 4d706951..00000000
--- a/grpc/src/core/lib/gpr/arena.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// \file Arena based allocator
-// Allows very fast allocation of memory, but that memory cannot be freed until
-// the arena as a whole is freed
-// Tracks the total memory allocated against it, so that future arenas can
-// pre-allocate the right amount of memory
-// This transitional API is deprecated and will be removed soon in favour of
-// src/core/lib/gprpp/arena.h .
-
-#ifndef GRPC_CORE_LIB_GPR_ARENA_H
-#define GRPC_CORE_LIB_GPR_ARENA_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/gprpp/arena.h"
-
-// TODO(arjunroy) : Remove deprecated gpr_arena API once all callers are gone.
-typedef class grpc_core::Arena gpr_arena;
-// Create an arena, with \a initial_size bytes in the first allocated buffer
-inline gpr_arena* gpr_arena_create(size_t initial_size) {
- return grpc_core::Arena::Create(initial_size);
-}
-// Destroy an arena, returning the total number of bytes allocated
-inline size_t gpr_arena_destroy(gpr_arena* arena) { return arena->Destroy(); }
-// Allocate \a size bytes from the arena
-inline void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
- return arena->Alloc(size);
-}
-
-#endif /* GRPC_CORE_LIB_GPR_ARENA_H */
diff --git a/grpc/src/core/lib/gpr/atm.cc b/grpc/src/core/lib/gpr/atm.cc
index 649d400d..c40e97ea 100644
--- a/grpc/src/core/lib/gpr/atm.cc
+++ b/grpc/src/core/lib/gpr/atm.cc
@@ -28,7 +28,7 @@ gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
gpr_atm new_value;
do {
current_value = gpr_atm_no_barrier_load(value);
- new_value = GPR_CLAMP(current_value + delta, min, max);
+ new_value = grpc_core::Clamp(current_value + delta, min, max);
if (new_value == current_value) break;
} while (!gpr_atm_no_barrier_cas(value, current_value, new_value));
return new_value;
diff --git a/grpc/src/core/lib/gpr/cpu_posix.cc b/grpc/src/core/lib/gpr/cpu_posix.cc
index 982ccbd6..7a1d5460 100644
--- a/grpc/src/core/lib/gpr/cpu_posix.cc
+++ b/grpc/src/core/lib/gpr/cpu_posix.cc
@@ -77,7 +77,7 @@ unsigned gpr_cpu_current_cpu(void) {
pthread_setspecific(thread_id_key, thread_id);
}
- return (unsigned)GPR_HASH_POINTER(thread_id, gpr_cpu_num_cores());
+ return (unsigned)grpc_core::HashPointer(thread_id, gpr_cpu_num_cores());
}
#endif /* GPR_CPU_POSIX */
diff --git a/grpc/src/core/lib/gpr/env_linux.cc b/grpc/src/core/lib/gpr/env_linux.cc
index 6a78dc14..4b332468 100644
--- a/grpc/src/core/lib/gpr/env_linux.cc
+++ b/grpc/src/core/lib/gpr/env_linux.cc
@@ -25,8 +25,6 @@
#ifdef GPR_LINUX_ENV
-#include "src/core/lib/gpr/env.h"
-
#include <dlfcn.h>
#include <features.h>
#include <stdlib.h>
@@ -35,6 +33,7 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
diff --git a/grpc/src/core/lib/gpr/env_posix.cc b/grpc/src/core/lib/gpr/env_posix.cc
index 232095b4..fb2a21c6 100644
--- a/grpc/src/core/lib/gpr/env_posix.cc
+++ b/grpc/src/core/lib/gpr/env_posix.cc
@@ -20,13 +20,12 @@
#ifdef GPR_POSIX_ENV
-#include "src/core/lib/gpr/env.h"
-
#include <stdlib.h>
#include <grpc/support/log.h>
-
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
char* gpr_getenv(const char* name) {
diff --git a/grpc/src/core/lib/gpr/log.cc b/grpc/src/core/lib/gpr/log.cc
index 9400f7c4..d18f52b4 100644
--- a/grpc/src/core/lib/gpr/log.cc
+++ b/grpc/src/core/lib/gpr/log.cc
@@ -18,6 +18,9 @@
#include <grpc/support/port_platform.h>
+#include <stdio.h>
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
@@ -25,9 +28,6 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/global_config.h"
-#include <stdio.h>
-#include <string.h>
-
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
diff --git a/grpc/src/core/lib/gpr/log_android.cc b/grpc/src/core/lib/gpr/log_android.cc
index 40ef4c64..11ffd64d 100644
--- a/grpc/src/core/lib/gpr/log_android.cc
+++ b/grpc/src/core/lib/gpr/log_android.cc
@@ -21,12 +21,13 @@
#ifdef GPR_ANDROID
#include <android/log.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
switch (severity) {
case GPR_LOG_SEVERITY_DEBUG:
diff --git a/grpc/src/core/lib/gpr/log_linux.cc b/grpc/src/core/lib/gpr/log_linux.cc
index 6f64faab..850ee13a 100644
--- a/grpc/src/core/lib/gpr/log_linux.cc
+++ b/grpc/src/core/lib/gpr/log_linux.cc
@@ -28,9 +28,6 @@
#ifdef GPR_LINUX_LOG
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
@@ -42,6 +39,12 @@
#include <string>
#include "absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity);
@@ -74,7 +77,7 @@ void gpr_default_log(gpr_log_func_args* args) {
time_t timer;
gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
struct tm tm;
- static __thread long tid = 0;
+ static GPR_THREAD_LOCAL(long) tid(0);
if (tid == 0) tid = sys_gettid();
timer = static_cast<time_t>(now.tv_sec);
diff --git a/grpc/src/core/lib/gpr/log_posix.cc b/grpc/src/core/lib/gpr/log_posix.cc
index 4bd6117f..2c28bddd 100644
--- a/grpc/src/core/lib/gpr/log_posix.cc
+++ b/grpc/src/core/lib/gpr/log_posix.cc
@@ -20,18 +20,21 @@
#ifdef GPR_POSIX_LOG
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
+
#include <string>
#include "absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
#include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity);
diff --git a/grpc/src/core/lib/gpr/murmur_hash.cc b/grpc/src/core/lib/gpr/murmur_hash.cc
index 95d11d3c..063b104b 100644
--- a/grpc/src/core/lib/gpr/murmur_hash.cc
+++ b/grpc/src/core/lib/gpr/murmur_hash.cc
@@ -22,6 +22,8 @@
#include <string.h>
+#include "absl/base/attributes.h"
+
#define ROTL32(x, r) (((x) << (r)) | ((x) >> (32 - (r))))
#define FMIX32(h) \
@@ -61,10 +63,10 @@ uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) {
switch (len & 3) {
case 3:
k1 ^= (static_cast<uint32_t>(keyptr[2])) << 16;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 2:
k1 ^= (static_cast<uint32_t>(keyptr[1])) << 8;
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case 1:
k1 ^= keyptr[0];
k1 *= c1;
diff --git a/grpc/src/core/lib/gpr/string.cc b/grpc/src/core/lib/gpr/string.cc
index cbafdfcd..9f12ed47 100644
--- a/grpc/src/core/lib/gpr/string.cc
+++ b/grpc/src/core/lib/gpr/string.cc
@@ -89,7 +89,7 @@ static dump_out dump_out_create(void) {
static void dump_out_append(dump_out* out, char c) {
if (out->length == out->capacity) {
- out->capacity = GPR_MAX(8, 2 * out->capacity);
+ out->capacity = std::max(size_t(8), 2 * out->capacity);
out->data = static_cast<char*>(gpr_realloc(out->data, out->capacity));
}
out->data[out->length++] = c;
@@ -290,7 +290,7 @@ static void add_string_to_split(const char* beg, const char* end, char*** strs,
memcpy(out, beg, static_cast<size_t>(end - beg));
out[end - beg] = 0;
if (*nstrs == *capstrs) {
- *capstrs = GPR_MAX(8, 2 * *capstrs);
+ *capstrs = std::max(size_t(8), 2 * *capstrs);
*strs = static_cast<char**>(gpr_realloc(*strs, sizeof(*strs) * *capstrs));
}
(*strs)[*nstrs] = out;
diff --git a/grpc/src/core/lib/gpr/string.h b/grpc/src/core/lib/gpr/string.h
index 8695331e..33375609 100644
--- a/grpc/src/core/lib/gpr/string.h
+++ b/grpc/src/core/lib/gpr/string.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/gpr_types.h>
-
#include <stdbool.h>
#include <stddef.h>
#include <string>
+#include <grpc/impl/codegen/gpr_types.h>
+
/* String utility functions */
/* Flags for gpr_dump function. */
diff --git a/grpc/src/core/lib/gpr/sync.cc b/grpc/src/core/lib/gpr/sync.cc
index 36c35da3..28d506f7 100644
--- a/grpc/src/core/lib/gpr/sync.cc
+++ b/grpc/src/core/lib/gpr/sync.cc
@@ -20,12 +20,12 @@
#include <grpc/support/port_platform.h>
+#include <assert.h>
+
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include <assert.h>
-
/* Number of mutexes to allocate for events, to avoid lock contention.
Should be a prime. */
enum { event_sync_partitions = 31 };
diff --git a/grpc/src/core/lib/gpr/sync_abseil.cc b/grpc/src/core/lib/gpr/sync_abseil.cc
index 0da9caa9..16333366 100644
--- a/grpc/src/core/lib/gpr/sync_abseil.cc
+++ b/grpc/src/core/lib/gpr/sync_abseil.cc
@@ -20,20 +20,21 @@
#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 "absl/base/call_once.h"
#include "absl/synchronization/mutex.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/profiling/timers.h"
+
#ifdef GPR_LOW_LEVEL_COUNTERS
gpr_atm gpr_mu_locks = 0;
gpr_atm gpr_counter_atm_cas = 0;
diff --git a/grpc/src/core/lib/gpr/sync_posix.cc b/grpc/src/core/lib/gpr/sync_posix.cc
index fdd278be..21926352 100644
--- a/grpc/src/core/lib/gpr/sync_posix.cc
+++ b/grpc/src/core/lib/gpr/sync_posix.cc
@@ -21,14 +21,14 @@
#if defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
!defined(GPR_CUSTOM_SYNC)
+#include <errno.h>
+#include <time.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <errno.h>
-#include <time.h>
-
#include "src/core/lib/profiling/timers.h"
#ifdef GPR_LOW_LEVEL_COUNTERS
@@ -131,6 +131,7 @@ int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
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_time_max(abs_deadline, gpr_now(abs_deadline.clock_type));
#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;
diff --git a/grpc/src/core/lib/gpr/time.cc b/grpc/src/core/lib/gpr/time.cc
index 14df70d7..630e9872 100644
--- a/grpc/src/core/lib/gpr/time.cc
+++ b/grpc/src/core/lib/gpr/time.cc
@@ -20,12 +20,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
int gpr_time_cmp(gpr_timespec a, gpr_timespec b) {
int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
GPR_ASSERT(a.clock_type == b.clock_type);
@@ -183,7 +184,8 @@ gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b) {
dec++;
}
if (a.tv_sec == INT64_MAX || a.tv_sec == INT64_MIN) {
- diff = a;
+ diff.tv_sec = a.tv_sec;
+ diff.tv_nsec = a.tv_nsec;
} else if (b.tv_sec == INT64_MIN ||
(b.tv_sec <= 0 && a.tv_sec >= INT64_MAX + b.tv_sec)) {
diff = gpr_inf_future(GPR_CLOCK_REALTIME);
diff --git a/grpc/src/core/lib/gpr/time_windows.cc b/grpc/src/core/lib/gpr/time_windows.cc
index 247cc164..39bca1b0 100644
--- a/grpc/src/core/lib/gpr/time_windows.cc
+++ b/grpc/src/core/lib/gpr/time_windows.cc
@@ -22,12 +22,13 @@
#ifdef GPR_WINDOWS_TIME
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <limits.h>
#include <process.h>
#include <sys/timeb.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
#include "src/core/lib/gpr/time_precise.h"
static LARGE_INTEGER g_start_time;
diff --git a/grpc/src/core/lib/gpr/tls.h b/grpc/src/core/lib/gpr/tls.h
index 5eb69512..7ea6598d 100644
--- a/grpc/src/core/lib/gpr/tls.h
+++ b/grpc/src/core/lib/gpr/tls.h
@@ -21,52 +21,138 @@
#include <grpc/support/port_platform.h>
-/** Thread local storage.
-
- A minimal wrapper that should be implementable across many compilers,
- and implementable efficiently across most modern compilers.
-
- Thread locals have type intptr_t.
-
- Declaring a thread local variable 'foo':
- GPR_TLS_DECL(foo);
- Thread locals always have static scope.
-
- Declaring a thread local class variable 'foo':
- GPR_TLS_CLASS_DECL(foo);
-
- Defining the thread local class variable:
- GPR_TLS_CLASS_DEF(foo);
-
- Initializing a thread local (must be done at library initialization
- time):
- gpr_tls_init(&foo);
+#include <type_traits>
- Destroying a thread local:
- gpr_tls_destroy(&foo);
-
- Setting a thread local (returns new_value):
- gpr_tls_set(&foo, new_value);
+/** Thread local storage.
- Accessing a thread local:
- current_value = gpr_tls_get(&foo);
+ Usage is the same as C++ thread_local. Declaring a thread local:
+ static GPR_THREAD_LOCAL(uint32_t) foo;
ALL functions here may be implemented as macros. */
-#ifdef GPR_STDCPP_TLS
-#include "src/core/lib/gpr/tls_stdcpp.h"
-#endif
-
-#ifdef GPR_GCC_TLS
-#include "src/core/lib/gpr/tls_gcc.h"
-#endif
-
-#ifdef GPR_MSVC_TLS
-#include "src/core/lib/gpr/tls_msvc.h"
-#endif
+namespace grpc_core {
+
+// This class is never instantiated. It exists to statically ensure that all
+// TLS usage is compatible with the most restrictive implementation, allowing
+// developers to write correct code regardless of the platform they develop on.
+template <typename T>
+class TlsTypeConstrainer {
+ static_assert(std::is_trivial<T>::value,
+ "TLS support is limited to trivial types");
+
+ public:
+ using Type = T;
+};
+
+} // namespace grpc_core
+
+#if defined(GPR_PTHREAD_TLS)
+
+#include <pthread.h>
+
+#include <algorithm>
+#include <array>
+#include <cstring>
+
+#include <grpc/support/log.h> /* for GPR_ASSERT */
+
+namespace grpc_core {
+
+template <typename T>
+class PthreadTlsImpl : TlsTypeConstrainer<T> {
+ public:
+ PthreadTlsImpl(const PthreadTlsImpl&) = delete;
+ PthreadTlsImpl& operator=(const PthreadTlsImpl&) = delete;
+
+ // Achtung! This class emulates C++ `thread_local` using pthread keys. Each
+ // instance of this class is a stand in for a C++ `thread_local`. Think of
+ // each `thread_local` as a *global* pthread_key_t and a type tag. An
+ // important consequence of this is that the lifetime of a `pthread_key_t`
+ // is precisely the lifetime of an instance of this class. To understand why
+ // this is, consider the following scenario given a fictional implementation
+ // of this class which creates and destroys its `pthread_key_t` each time
+ // a given block of code runs (all actions take place on a single thread):
+ //
+ // - instance 1 (type tag = T*) is initialized, is assigned `pthread_key_t` 1
+ // - instance 2 (type tag = int) is initialized, is assigned `pthread_key_t` 2
+ // - instances 1 and 2 store and retrieve values; all is well
+ // - instances 1 and 2 are de-initialized; their keys are released to the pool
+ //
+ // - another run commences
+ // - instance 1 receives key 2
+ // - a value is read from instance 1, it observes a value of type int, but
+ // interprets it as T*; undefined behavior, kaboom
+ //
+ // To properly ensure these invariants are upheld the `pthread_key_t` must be
+ // `const`, which means it can only be released in the destructor. This is a
+ // a violation of the style guide, since these objects are always static (see
+ // footnote) but this code is used in sufficiently narrow circumstances to
+ // justify the deviation.
+ //
+ // https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
+ PthreadTlsImpl()
+ : keys_([]() {
+ typename std::remove_const<decltype(PthreadTlsImpl::keys_)>::type
+ keys;
+ for (pthread_key_t& key : keys) {
+ GPR_ASSERT(0 == pthread_key_create(&key, nullptr));
+ }
+ return keys;
+ }()) {}
+ PthreadTlsImpl(T t) : PthreadTlsImpl() { *this = t; }
+ ~PthreadTlsImpl() {
+ for (pthread_key_t key : keys_) {
+ GPR_ASSERT(0 == pthread_key_delete(key));
+ }
+ }
+
+ operator T() const {
+ T t;
+ char* dst = reinterpret_cast<char*>(&t);
+ for (pthread_key_t key : keys_) {
+ uintptr_t src = uintptr_t(pthread_getspecific(key));
+ size_t remaining = reinterpret_cast<char*>(&t + 1) - dst;
+ size_t step = std::min(sizeof(src), remaining);
+ memcpy(dst, &src, step);
+ dst += step;
+ }
+ return t;
+ }
+
+ T operator->() const {
+ static_assert(std::is_pointer<T>::value,
+ "operator-> only usable on pointers");
+ return this->operator T();
+ }
+
+ T operator=(T t) {
+ char* src = reinterpret_cast<char*>(&t);
+ for (pthread_key_t key : keys_) {
+ uintptr_t dst;
+ size_t remaining = reinterpret_cast<char*>(&t + 1) - src;
+ size_t step = std::min(sizeof(dst), remaining);
+ memcpy(&dst, src, step);
+ GPR_ASSERT(0 == pthread_setspecific(key, reinterpret_cast<void*>(dst)));
+ src += step;
+ }
+ return t;
+ }
+
+ private:
+ const std::array<pthread_key_t,
+ (sizeof(T) + sizeof(void*) - 1) / sizeof(void*)>
+ keys_;
+};
+
+} // namespace grpc_core
+
+#define GPR_THREAD_LOCAL(type) grpc_core::PthreadTlsImpl<type>
+
+#else
+
+#define GPR_THREAD_LOCAL(type) \
+ thread_local typename grpc_core::TlsTypeConstrainer<type>::Type
-#ifdef GPR_PTHREAD_TLS
-#include "src/core/lib/gpr/tls_pthread.h"
#endif
#endif /* GRPC_CORE_LIB_GPR_TLS_H */
diff --git a/grpc/src/core/lib/gpr/tls_gcc.h b/grpc/src/core/lib/gpr/tls_gcc.h
deleted file mode 100644
index 72b360b0..00000000
--- a/grpc/src/core/lib/gpr/tls_gcc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * 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_GPR_TLS_GCC_H
-#define GRPC_CORE_LIB_GPR_TLS_GCC_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stdbool.h>
-
-#include <grpc/support/log.h>
-
-/** Thread local storage based on gcc compiler primitives.
- #include tls.h to use this - and see that file for documentation */
-
-struct gpr_gcc_thread_local {
- intptr_t value;
-};
-
-#define GPR_TLS_DECL(name) \
- static __thread struct gpr_gcc_thread_local name = {0}
-
-#define GPR_TLS_CLASS_DECL(name) \
- static __thread struct gpr_gcc_thread_local name
-
-#define GPR_TLS_CLASS_DEF(name) __thread struct gpr_gcc_thread_local name = {0}
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value))
-#define gpr_tls_get(tls) ((tls)->value)
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_GCC_H */
diff --git a/grpc/src/core/lib/gpr/tls_msvc.h b/grpc/src/core/lib/gpr/tls_msvc.h
deleted file mode 100644
index 73e67345..00000000
--- a/grpc/src/core/lib/gpr/tls_msvc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * 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_GPR_TLS_MSVC_H
-#define GRPC_CORE_LIB_GPR_TLS_MSVC_H
-
-/** Thread local storage based on ms visual c compiler primitives.
-#include <grpc/support/port_platform.h>
-
- #include tls.h to use this - and see that file for documentation */
-
-#include <cstdint>
-
-struct gpr_msvc_thread_local {
- intptr_t value;
-};
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) \
- static __declspec(thread) struct gpr_msvc_thread_local name = {0}
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) \
- static __declspec(thread) struct gpr_msvc_thread_local name
-
-#define GPR_TLS_CLASS_DEF(name) \
- __declspec(thread) struct gpr_msvc_thread_local name = {0}
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value))
-#define gpr_tls_get(tls) ((tls)->value)
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_MSVC_H */
diff --git a/grpc/src/core/lib/gpr/tls_pthread.cc b/grpc/src/core/lib/gpr/tls_pthread.cc
deleted file mode 100644
index 2e5b3069..00000000
--- a/grpc/src/core/lib/gpr/tls_pthread.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * 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>
-
-#ifdef GPR_PTHREAD_TLS
-
-#include "src/core/lib/gpr/tls.h"
-
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value) {
- GPR_ASSERT(0 == pthread_setspecific(tls->key, (void*)value));
- return value;
-}
-
-#endif /* GPR_PTHREAD_TLS */
diff --git a/grpc/src/core/lib/gpr/tls_pthread.h b/grpc/src/core/lib/gpr/tls_pthread.h
deleted file mode 100644
index a15f2f33..00000000
--- a/grpc/src/core/lib/gpr/tls_pthread.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * 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_GPR_TLS_PTHREAD_H
-#define GRPC_CORE_LIB_GPR_TLS_PTHREAD_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/log.h> /* for GPR_ASSERT */
-#include <pthread.h>
-
-/** Thread local storage based on pthread library calls.
- #include tls.h to use this - and see that file for documentation */
-
-struct gpr_pthread_thread_local {
- pthread_key_t key;
-};
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) static struct gpr_pthread_thread_local name = {0}
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) static struct gpr_pthread_thread_local name
-
-/** Use GPR_TLS_CLASS_DEF to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DEF(name) struct gpr_pthread_thread_local name = {0}
-
-#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
-#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key)
-#define gpr_tls_get(tls) ((intptr_t)pthread_getspecific((tls)->key))
-#ifdef __cplusplus
-extern "C" {
-#endif
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_PTHREAD_H */
diff --git a/grpc/src/core/lib/gpr/tls_stdcpp.h b/grpc/src/core/lib/gpr/tls_stdcpp.h
deleted file mode 100644
index b5b422a5..00000000
--- a/grpc/src/core/lib/gpr/tls_stdcpp.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * 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_GPR_TLS_STDCPP_H
-#define GRPC_CORE_LIB_GPR_TLS_STDCPP_H
-
-#include <grpc/support/port_platform.h>
-
-/** Thread local storage based on C++ thread_local.
- #include tls.h to use this - and see that file for documentation */
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) thread_local static intptr_t name = 0
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) thread_local static intptr_t name
-
-#define GPR_TLS_CLASS_DEF(name) thread_local intptr_t name = 0
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-
-#define gpr_tls_set(tls, new_value) (*(tls) = (new_value))
-
-#define gpr_tls_get(tls) (*(tls))
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_STDCPP_H */
diff --git a/grpc/src/core/lib/gpr/tmpfile_posix.cc b/grpc/src/core/lib/gpr/tmpfile_posix.cc
index ffdad335..166cdf68 100644
--- a/grpc/src/core/lib/gpr/tmpfile_posix.cc
+++ b/grpc/src/core/lib/gpr/tmpfile_posix.cc
@@ -20,8 +20,6 @@
#ifdef GPR_POSIX_TMPFILE
-#include "src/core/lib/gpr/tmpfile.h"
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -32,6 +30,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gpr/tmpfile.h"
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) {
FILE* result = nullptr;
diff --git a/grpc/src/core/lib/gpr/useful.h b/grpc/src/core/lib/gpr/useful.h
index 8382a50e..dcd457bc 100644
--- a/grpc/src/core/lib/gpr/useful.h
+++ b/grpc/src/core/lib/gpr/useful.h
@@ -19,48 +19,113 @@
#ifndef GRPC_CORE_LIB_GPR_USEFUL_H
#define GRPC_CORE_LIB_GPR_USEFUL_H
-/** useful macros that don't belong anywhere else */
+#include <grpc/support/port_platform.h>
+
+#include <cstddef>
+
+/** useful utilities that don't belong anywhere else */
+
+namespace grpc_core {
+
+template <typename T>
+T Clamp(T val, T min, T max) {
+ if (val < min) return min;
+ if (max < val) return max;
+ return val;
+}
-#define GPR_MIN(a, b) ((a) < (b) ? (a) : (b))
-#define GPR_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define GPR_CLAMP(a, min, max) ((a) < (min) ? (min) : (a) > (max) ? (max) : (a))
/** rotl, rotr assume x is unsigned */
-#define GPR_ROTL(x, n) (((x) << (n)) | ((x) >> (sizeof(x) * 8 - (n))))
-#define GPR_ROTR(x, n) (((x) >> (n)) | ((x) << (sizeof(x) * 8 - (n))))
+template <typename T>
+constexpr T RotateLeft(T x, T n) {
+ return ((x << n) | (x >> (sizeof(x) * 8 - n)));
+}
+template <typename T>
+constexpr T RotateRight(T x, T n) {
+ return ((x >> n) | (x << (sizeof(x) * 8 - n)));
+}
-#define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array)))
+// Set the n-th bit of i
+template <typename T>
+T SetBit(T* i, size_t n) {
+ return *i |= (T(1) << n);
+}
-#define GPR_SWAP(type, a, b) \
- do { \
- type x = a; \
- (a) = b; \
- (b) = x; \
- } while (0)
+// Clear the n-th bit of i
+template <typename T>
+T ClearBit(T* i, size_t n) {
+ return *i &= ~(T(1) << n);
+}
-/** Set the \a n-th bit of \a i (a mutable pointer). */
-#define GPR_BITSET(i, n) ((*(i)) |= (1u << (n)))
+// Get the n-th bit of i
+template <typename T>
+bool GetBit(T i, size_t n) {
+ return (i & (T(1) << n)) != 0;
+}
-/** Clear the \a n-th bit of \a i (a mutable pointer). */
-#define GPR_BITCLEAR(i, n) ((*(i)) &= ~(1u << (n)))
+namespace useful_detail {
+inline constexpr uint32_t HexdigitBitcount(uint32_t x) {
+ return (x - ((x >> 1) & 0x77777777) - ((x >> 2) & 0x33333333) -
+ ((x >> 3) & 0x11111111));
+}
+} // namespace useful_detail
-/** Get the \a n-th bit of \a i */
-#define GPR_BITGET(i, n) (((i) & (1u << (n))) != 0)
+inline constexpr uint32_t BitCount(uint32_t i) {
+ return (((useful_detail::HexdigitBitcount(i) +
+ (useful_detail::HexdigitBitcount(i) >> 4)) &
+ 0x0f0f0f0f) %
+ 255);
+}
-#define GPR_INTERNAL_HEXDIGIT_BITCOUNT(x) \
- ((x) - (((x) >> 1) & 0x77777777) - (((x) >> 2) & 0x33333333) - \
- (((x) >> 3) & 0x11111111))
+inline constexpr uint32_t BitCount(uint64_t i) {
+ return BitCount(uint32_t(i)) + BitCount(uint32_t(i >> 32));
+}
-/** Returns number of bits set in bitset \a i */
-#define GPR_BITCOUNT(i) \
- (((GPR_INTERNAL_HEXDIGIT_BITCOUNT(i) + \
- (GPR_INTERNAL_HEXDIGIT_BITCOUNT(i) >> 4)) & \
- 0x0f0f0f0f) % \
- 255)
+inline constexpr uint32_t BitCount(uint16_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(uint8_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(int64_t i) { return BitCount(uint64_t(i)); }
+inline constexpr uint32_t BitCount(int32_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(int16_t i) { return BitCount(uint16_t(i)); }
+inline constexpr uint32_t BitCount(int8_t i) { return BitCount(uint8_t(i)); }
-#define GPR_ICMP(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
+// This function uses operator< to implement a qsort-style comparison, whereby:
+// if a is smaller than b, a number smaller than 0 is returned.
+// if a is bigger than b, a number greater than 0 is returned.
+// if a is neither smaller nor bigger than b, 0 is returned.
+template <typename T>
+int QsortCompare(const T& a, const T& b) {
+ if (a < b) return -1;
+ if (b < a) return 1;
+ return 0;
+}
-#define GPR_HASH_POINTER(x, range) \
- (((((size_t)(x)) >> 4) ^ (((size_t)(x)) >> 9) ^ (((size_t)(x)) >> 14)) % \
- (range))
+template <typename T>
+constexpr size_t HashPointer(T* p, size_t range) {
+ return (((reinterpret_cast<size_t>(p)) >> 4) ^
+ ((reinterpret_cast<size_t>(p)) >> 9) ^
+ ((reinterpret_cast<size_t>(p)) >> 14)) %
+ range;
+}
+
+// Compute a+b.
+// If the result is greater than INT64_MAX, return INT64_MAX.
+// If the result is less than INT64_MIN, return INT64_MIN.
+inline int64_t SaturatingAdd(int64_t a, int64_t b) {
+ if (a > 0) {
+ if (b > INT64_MAX - a) {
+ return INT64_MAX;
+ }
+ } else if (b < INT64_MIN - a) {
+ return INT64_MIN;
+ }
+ return a + b;
+}
+
+inline uint32_t MixHash32(uint32_t a, uint32_t b) {
+ return RotateLeft(a, 2u) ^ b;
+}
+
+} // namespace grpc_core
+
+#define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array)))
#endif /* GRPC_CORE_LIB_GPR_USEFUL_H */
diff --git a/grpc/src/core/lib/gpr/wrap_memcpy.cc b/grpc/src/core/lib/gpr/wrap_memcpy.cc
index 9b8608e0..51efc93a 100644
--- a/grpc/src/core/lib/gpr/wrap_memcpy.cc
+++ b/grpc/src/core/lib/gpr/wrap_memcpy.cc
@@ -28,7 +28,8 @@
extern "C" {
#ifdef __linux__
-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)
+#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && \
+ !defined(__ANDROID__)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
void* __wrap_memcpy(void* destination, const void* source, size_t num) {
return memcpy(destination, source, num);
diff --git a/grpc/src/core/lib/gprpp/arena.cc b/grpc/src/core/lib/gprpp/arena.cc
deleted file mode 100644
index 61688258..00000000
--- a/grpc/src/core/lib/gprpp/arena.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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/gprpp/arena.h"
-
-#include <string.h>
-#include <new>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/gpr/alloc.h"
-#include "src/core/lib/gprpp/memory.h"
-
-namespace {
-
-void* ArenaStorage(size_t initial_size) {
- static constexpr size_t base_size =
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_core::Arena));
- initial_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
- size_t alloc_size = base_size + initial_size;
- static constexpr size_t alignment =
- (GPR_CACHELINE_SIZE > GPR_MAX_ALIGNMENT &&
- GPR_CACHELINE_SIZE % GPR_MAX_ALIGNMENT == 0)
- ? GPR_CACHELINE_SIZE
- : GPR_MAX_ALIGNMENT;
- return gpr_malloc_aligned(alloc_size, alignment);
-}
-
-} // namespace
-
-namespace grpc_core {
-
-Arena::~Arena() {
- Zone* z = last_zone_;
- while (z) {
- Zone* prev_z = z->prev;
- z->~Zone();
- gpr_free_aligned(z);
- z = prev_z;
- }
-}
-
-Arena* Arena::Create(size_t initial_size) {
- return new (ArenaStorage(initial_size)) Arena(initial_size);
-}
-
-std::pair<Arena*, void*> Arena::CreateWithAlloc(size_t initial_size,
- size_t alloc_size) {
- static constexpr size_t base_size =
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
- auto* new_arena =
- new (ArenaStorage(initial_size)) Arena(initial_size, alloc_size);
- void* first_alloc = reinterpret_cast<char*>(new_arena) + base_size;
- return std::make_pair(new_arena, first_alloc);
-}
-
-size_t Arena::Destroy() {
- size_t size = total_used_.Load(MemoryOrder::RELAXED);
- this->~Arena();
- gpr_free_aligned(this);
- return size;
-}
-
-void* Arena::AllocZone(size_t size) {
- // If the allocation isn't able to end in the initial zone, create a new
- // zone for this allocation, and any unused space in the initial zone is
- // wasted. This overflowing and wasting is uncommon because of our arena
- // sizing hysteresis (that is, most calls should have a large enough initial
- // zone and will not need to grow the arena).
- static constexpr size_t zone_base_size =
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Zone));
- size_t alloc_size = zone_base_size + size;
- Zone* z = new (gpr_malloc_aligned(alloc_size, GPR_MAX_ALIGNMENT)) Zone();
- {
- gpr_spinlock_lock(&arena_growth_spinlock_);
- z->prev = last_zone_;
- last_zone_ = z;
- gpr_spinlock_unlock(&arena_growth_spinlock_);
- }
- return reinterpret_cast<char*>(z) + zone_base_size;
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/lib/gprpp/arena.h b/grpc/src/core/lib/gprpp/arena.h
deleted file mode 100644
index baca5a75..00000000
--- a/grpc/src/core/lib/gprpp/arena.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// \file Arena based allocator
-// Allows very fast allocation of memory, but that memory cannot be freed until
-// the arena as a whole is freed
-// Tracks the total memory allocated against it, so that future arenas can
-// pre-allocate the right amount of memory
-
-#ifndef GRPC_CORE_LIB_GPRPP_ARENA_H
-#define GRPC_CORE_LIB_GPRPP_ARENA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <new>
-#include <utility>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/gpr/alloc.h"
-#include "src/core/lib/gpr/spinlock.h"
-#include "src/core/lib/gprpp/atomic.h"
-
-#include <stddef.h>
-
-namespace grpc_core {
-
-class Arena {
- public:
- // Create an arena, with \a initial_size bytes in the first allocated buffer.
- static Arena* Create(size_t initial_size);
-
- // Create an arena, with \a initial_size bytes in the first allocated buffer,
- // and return both a void pointer to the returned arena and a void* with the
- // first allocation.
- static std::pair<Arena*, void*> CreateWithAlloc(size_t initial_size,
- size_t alloc_size);
-
- // Destroy an arena, returning the total number of bytes allocated.
- size_t Destroy();
- // Allocate \a size bytes from the arena.
- void* Alloc(size_t size) {
- static constexpr size_t base_size =
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
- size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(size);
- size_t begin = total_used_.FetchAdd(size, MemoryOrder::RELAXED);
- if (begin + size <= initial_zone_size_) {
- return reinterpret_cast<char*>(this) + base_size + begin;
- } else {
- return AllocZone(size);
- }
- }
-
- // TODO(roth): We currently assume that all callers need alignment of 16
- // bytes, which may be wrong in some cases. When we have time, we should
- // change this to instead use the alignment of the type being allocated by
- // this method.
- template <typename T, typename... Args>
- T* New(Args&&... args) {
- T* t = static_cast<T*>(Alloc(sizeof(T)));
- new (t) T(std::forward<Args>(args)...);
- return t;
- }
-
- private:
- struct Zone {
- Zone* prev;
- };
-
- // Initialize an arena.
- // Parameters:
- // initial_size: The initial size of the whole arena in bytes. These bytes
- // are contained within 'zone 0'. If the arena user ends up requiring more
- // memory than the arena contains in zone 0, subsequent zones are allocated
- // on demand and maintained in a tail-linked list.
- //
- // initial_alloc: Optionally, construct the arena as though a call to
- // Alloc() had already been made for initial_alloc bytes. This provides a
- // quick optimization (avoiding an atomic fetch-add) for the common case
- // where we wish to create an arena and then perform an immediate
- // allocation.
- explicit Arena(size_t initial_size, size_t initial_alloc = 0)
- : total_used_(GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_alloc)),
- initial_zone_size_(initial_size) {}
-
- ~Arena();
-
- void* AllocZone(size_t size);
-
- // Keep track of the total used size. We use this in our call sizing
- // hysteresis.
- Atomic<size_t> total_used_;
- const size_t initial_zone_size_;
- gpr_spinlock arena_growth_spinlock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
- // If the initial arena allocation wasn't enough, we allocate additional zones
- // in a reverse linked list. Each additional zone consists of (1) a pointer to
- // the zone added before this zone (null if this is the first additional zone)
- // and (2) the allocated memory. The arena itself maintains a pointer to the
- // last zone; the zone list is reverse-walked during arena destruction only.
- Zone* last_zone_ = nullptr;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_GPRPP_ARENA_H */
diff --git a/grpc/src/core/lib/gprpp/atomic.h b/grpc/src/core/lib/gprpp/atomic.h
deleted file mode 100644
index dd99d9ed..00000000
--- a/grpc/src/core/lib/gprpp/atomic.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_ATOMIC_H
-#define GRPC_CORE_LIB_GPRPP_ATOMIC_H
-
-#include <grpc/support/port_platform.h>
-
-#include <atomic>
-
-#include <grpc/support/atm.h>
-
-namespace grpc_core {
-
-enum class MemoryOrder {
- RELAXED = static_cast<int>(std::memory_order_relaxed),
- CONSUME = static_cast<int>(std::memory_order_consume),
- ACQUIRE = static_cast<int>(std::memory_order_acquire),
- RELEASE = static_cast<int>(std::memory_order_release),
- ACQ_REL = static_cast<int>(std::memory_order_acq_rel),
- SEQ_CST = static_cast<int>(std::memory_order_seq_cst)
-};
-
-template <typename T>
-class Atomic {
- public:
- explicit Atomic(T val = T()) : storage_(val) {}
-
- T Load(MemoryOrder order) const {
- return storage_.load(static_cast<std::memory_order>(order));
- }
-
- void Store(T val, MemoryOrder order) {
- storage_.store(val, static_cast<std::memory_order>(order));
- }
-
- T Exchange(T desired, MemoryOrder order) {
- return storage_.exchange(desired, static_cast<std::memory_order>(order));
- }
-
- bool CompareExchangeWeak(T* expected, T desired, MemoryOrder success,
- MemoryOrder failure) {
- return GPR_ATM_INC_CAS_THEN(storage_.compare_exchange_weak(
- *expected, desired, static_cast<std::memory_order>(success),
- static_cast<std::memory_order>(failure)));
- }
-
- bool CompareExchangeStrong(T* expected, T desired, MemoryOrder success,
- MemoryOrder failure) {
- return GPR_ATM_INC_CAS_THEN(storage_.compare_exchange_strong(
- *expected, desired, static_cast<std::memory_order>(success),
- static_cast<std::memory_order>(failure)));
- }
-
- template <typename Arg>
- T FetchAdd(Arg arg, MemoryOrder order = MemoryOrder::SEQ_CST) {
- return GPR_ATM_INC_ADD_THEN(storage_.fetch_add(
- static_cast<Arg>(arg), static_cast<std::memory_order>(order)));
- }
-
- template <typename Arg>
- T FetchSub(Arg arg, MemoryOrder order = MemoryOrder::SEQ_CST) {
- return GPR_ATM_INC_ADD_THEN(storage_.fetch_sub(
- static_cast<Arg>(arg), static_cast<std::memory_order>(order)));
- }
-
- // Atomically increment a counter only if the counter value is not zero.
- // Returns true if increment took place; false if counter is zero.
- bool IncrementIfNonzero() {
- T count = storage_.load(std::memory_order_acquire);
- do {
- // If zero, we are done (without an increment). If not, we must do a CAS
- // to maintain the contract: do not increment the counter if it is already
- // zero
- if (count == 0) {
- return false;
- }
- } while (!CompareExchangeWeak(&count, count + 1, MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
- return true;
- }
-
- private:
- std::atomic<T> storage_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_GPRPP_ATOMIC_H */
diff --git a/grpc/src/core/lib/gprpp/atomic_utils.h b/grpc/src/core/lib/gprpp/atomic_utils.h
new file mode 100644
index 00000000..c059ade6
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/atomic_utils.h
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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_ATOMIC_UTILS_H
+#define GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+namespace grpc_core {
+
+// Atomically increment a counter only if the counter value is not zero.
+// Returns true if increment took place; false if counter is zero.
+template <typename T>
+inline bool IncrementIfNonzero(std::atomic<T>* p) {
+ T count = p->load(std::memory_order_acquire);
+ do {
+ // If zero, we are done (without an increment). If not, we must do a CAS
+ // to maintain the contract: do not increment the counter if it is already
+ // zero
+ if (count == 0) {
+ return false;
+ }
+ } while (!p->compare_exchange_weak(
+ count, count + 1, std::memory_order_acq_rel, std::memory_order_acquire));
+ return true;
+}
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H */
diff --git a/grpc/src/core/lib/gprpp/bitset.h b/grpc/src/core/lib/gprpp/bitset.h
new file mode 100644
index 00000000..f88e8466
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/bitset.h
@@ -0,0 +1,207 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_BITSET_H
+#define GRPC_CORE_LIB_GPRPP_BITSET_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "src/core/lib/gpr/useful.h"
+
+#if __cplusplus > 201103l
+#define GRPC_BITSET_CONSTEXPR_MUTATOR constexpr
+#else
+#define GRPC_BITSET_CONSTEXPR_MUTATOR
+#endif
+
+namespace grpc_core {
+
+// Given a bit count as an integer, vend as member type `Type` a type with
+// exactly that number of bits. Undefined if that bit count is not available.
+template <size_t kBits>
+struct UintSelector;
+template <>
+struct UintSelector<8> {
+ typedef uint8_t Type;
+};
+template <>
+struct UintSelector<16> {
+ typedef uint16_t Type;
+};
+template <>
+struct UintSelector<32> {
+ typedef uint32_t Type;
+};
+template <>
+struct UintSelector<64> {
+ typedef uint64_t Type;
+};
+
+// An unsigned integer of some number of bits.
+template <size_t kBits>
+using Uint = typename UintSelector<kBits>::Type;
+
+// Given the total number of bits that need to be stored, choose the size of
+// 'unit' for a BitSet... We'll use an array of units to store the total set.
+// For small bit counts we are selective in the type to try and balance byte
+// size and performance
+// - the details will likely be tweaked into the future.
+// Once we get over 96 bits, we just use uint64_t for everything.
+constexpr size_t ChooseUnitBitsForBitSet(size_t total_bits) {
+ return total_bits <= 8 ? 8
+ : total_bits <= 16 ? 16
+ : total_bits <= 24 ? 8
+ : total_bits <= 32 ? 32
+ : total_bits <= 48 ? 16
+ : total_bits <= 64 ? 64
+ : total_bits <= 96 ? 32
+ : 64;
+}
+
+// A BitSet that's configurable.
+// Contains storage for kTotalBits, stored as an array of integers of size
+// kUnitBits. e.g. to store 72 bits in 8 bit chunks, we'd say BitSet<72, 8>.
+// Since most users shouldn't care about the size of unit used, we default
+// kUnitBits to whatever is selected by ChooseUnitBitsForBitSet
+template <size_t kTotalBits,
+ size_t kUnitBits = ChooseUnitBitsForBitSet(kTotalBits)>
+class BitSet {
+ static constexpr size_t kUnits = (kTotalBits + kUnitBits - 1) / kUnitBits;
+
+ public:
+ // Initialize to all bits false
+ constexpr BitSet() : units_{} {}
+
+ // Set bit i to true
+ GRPC_BITSET_CONSTEXPR_MUTATOR void set(int i) {
+ units_[unit_for(i)] |= mask_for(i);
+ }
+
+ // Set bit i to is_set
+ GRPC_BITSET_CONSTEXPR_MUTATOR void set(int i, bool is_set) {
+ if (is_set) {
+ set(i);
+ } else {
+ clear(i);
+ }
+ }
+
+ // Set bit i to false
+ GRPC_BITSET_CONSTEXPR_MUTATOR void clear(int i) {
+ units_[unit_for(i)] &= ~mask_for(i);
+ }
+
+ // Return true if bit i is set
+ constexpr bool is_set(int i) const {
+ return (units_[unit_for(i)] & mask_for(i)) != 0;
+ }
+
+ // Return true if all bits are set
+ bool all() const {
+ if (kTotalBits % kUnitBits == 0) {
+ // kTotalBits is a multiple of kUnitBits ==> we can just check for all
+ // ones in each unit.
+ for (size_t i = 0; i < kUnits; i++) {
+ if (units_[i] != all_ones()) return false;
+ }
+ return true;
+ } else {
+ // kTotalBits is not a multiple of kUnitBits ==> we need special handling
+ // for checking partial filling of the last unit (since not all of its
+ // bits are used!)
+ for (size_t i = 0; i < kUnits - 1; i++) {
+ if (units_[i] != all_ones()) return false;
+ }
+ return units_[kUnits - 1] == n_ones(kTotalBits % kUnitBits);
+ }
+ }
+
+ // Return true if *no* bits are set.
+ bool none() const {
+ for (size_t i = 0; i < kUnits; i++) {
+ if (units_[i] != 0) return false;
+ }
+ return true;
+ }
+
+ // Return a count of how many bits are set.
+ uint32_t count() const {
+ uint32_t count = 0;
+ for (size_t i = 0; i < kUnits; i++) {
+ count += BitCount(units_[i]);
+ }
+ return count;
+ }
+
+ bool operator==(const BitSet& other) const {
+ for (size_t i = 0; i < kUnits; i++) {
+ if (units_[i] != other.units_[i]) return false;
+ }
+ return true;
+ }
+
+ template <typename Int>
+ typename std::enable_if<std::is_unsigned<Int>::value &&
+ (sizeof(Int) * 8 >= kTotalBits),
+ Int>::type
+ ToInt() const {
+ Int result = 0;
+ for (size_t i = 0; i < kTotalBits; i++) {
+ if (is_set(i)) result |= (Int(1) << i);
+ }
+ return result;
+ }
+
+ private:
+ // Given a bit index, return which unit it's stored in.
+ static constexpr size_t unit_for(size_t bit) { return bit / kUnitBits; }
+
+ // Given a bit index, return a mask to access that bit within it's unit.
+ static constexpr Uint<kUnitBits> mask_for(size_t bit) {
+ return Uint<kUnitBits>{1} << (bit % kUnitBits);
+ }
+
+ // Return a value that is all ones
+ static constexpr Uint<kUnitBits> all_ones() {
+ return Uint<kUnitBits>(~Uint<kUnitBits>(0));
+ }
+
+ // Return a value with n bottom bits ones
+ static constexpr Uint<kUnitBits> n_ones(size_t n) {
+ return n == kUnitBits ? all_ones() : (Uint<kUnitBits>(1) << n) - 1;
+ }
+
+ // The set of units - kUnitBits sized integers that store kUnitBits bits!
+ Uint<kUnitBits> units_[kUnits];
+};
+
+// Zero-size specialization of BitSet.
+// Useful for generic programming.
+// Make a compile time error out of get/set type accesses, and hard-codes
+// queries that do make sense.
+template <>
+class BitSet<0> {
+ public:
+ constexpr BitSet() {}
+
+ bool all() const { return true; }
+ bool none() const { return true; }
+ uint32_t count() const { return 0; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_BITSET_H
diff --git a/grpc/src/core/lib/gprpp/capture.h b/grpc/src/core/lib/gprpp/capture.h
new file mode 100644
index 00000000..d673642d
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/capture.h
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CAPTURE_H
+#define GRPC_CORE_LIB_GPRPP_CAPTURE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <utility>
+
+#include "absl/utility/utility.h"
+
+namespace grpc_core {
+
+namespace detail {
+
+template <typename F, typename... Captures>
+class Capture {
+ public:
+ explicit Capture(F f, Captures... captures)
+ : f_(std::move(f)), captures_(std::move(captures)...) {}
+
+ template <typename... Args>
+ decltype(std::declval<F>()(static_cast<Captures*>(nullptr)...,
+ std::declval<Args>()...))
+ operator()(Args... args) {
+ auto f = &f_;
+ return absl::apply(
+ [f, &args...](Captures&... captures) {
+ return (*f)(&captures..., std::move(args)...);
+ },
+ captures_);
+ }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+ GPR_NO_UNIQUE_ADDRESS std::tuple<Captures...> captures_;
+};
+
+} // namespace detail
+
+// C++11 helper - best explained by usage:
+//
+// BigThing big_thing;
+// auto f = Capture(
+// [](BigThing* c, int a, int b) { /*...*/ },
+// std::move(big_thing));
+//
+// results in: f being a callable that takes arguments (int a, int b), and
+// captures the original value of big_thing by move. Each call, a pointer to
+// each captured thing is inserted into the argument list at the beginning so it
+// can be manipulated.
+//
+// Captured values are mutable, and it's the users responsibility to ensure,
+// should this callable be invoked from different threads, that proper locking
+// is implemented.
+template <typename F, typename... Captures>
+detail::Capture<F, Captures...> Capture(F f, Captures... captures) {
+ return detail::Capture<F, Captures...>(std::move(f), std::move(captures)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CAPTURE_H
diff --git a/grpc/src/core/lib/gprpp/chunked_vector.h b/grpc/src/core/lib/gprpp/chunked_vector.h
new file mode 100644
index 00000000..c4154276
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/chunked_vector.h
@@ -0,0 +1,253 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHUNKED_VECTOR_H
+#define GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstddef>
+
+#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/resource_quota/arena.h"
+
+namespace grpc_core {
+
+// Arena-friendly vector type.
+// This "vector" allocates non-contiguous runs of kChunkSize T's at a time.
+// Expectation is that most usage will fit in one chunk, sometimes two will be
+// needed, and very rarely three. Appending is constant time, calculating the
+// size is O(n_chunks).
+template <typename T, size_t kChunkSize>
+class ChunkedVector {
+ private:
+ // One chunk of allocated memory.
+ struct Chunk {
+ Chunk() = default;
+ Chunk* next = nullptr;
+ size_t count = 0;
+ ManualConstructor<T> data[kChunkSize];
+ };
+
+ public:
+ explicit ChunkedVector(Arena* arena) : arena_(arena) {}
+ template <class Iterator>
+ ChunkedVector(Arena* arena, Iterator begin, Iterator end) : arena_(arena) {
+ for (; begin != end; ++begin) {
+ EmplaceBack(*begin);
+ }
+ }
+ ChunkedVector(const ChunkedVector& other)
+ : ChunkedVector(other.arena_, other.begin(), other.end()) {}
+ ChunkedVector& operator=(const ChunkedVector& other) {
+ ChunkedVector tmp(other);
+ Swap(&tmp);
+ return *this;
+ }
+ ChunkedVector(ChunkedVector&& other) noexcept
+ : arena_(other.arena_), first_(other.first_), append_(other.append_) {
+ other.first_ = nullptr;
+ other.append_ = nullptr;
+ }
+ ChunkedVector& operator=(ChunkedVector&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+ ~ChunkedVector() { Clear(); }
+ void Swap(ChunkedVector* other) {
+ std::swap(other->arena_, arena_);
+ std::swap(other->first_, first_);
+ std::swap(other->append_, append_);
+ }
+
+ Arena* arena() const { return arena_; }
+
+ // Append a new element to the end of the vector.
+ template <typename... Args>
+ T* EmplaceBack(Args&&... args) {
+ auto* p = AppendSlot();
+ p->Init(std::forward<Args>(args)...);
+ return &**p;
+ }
+
+ // Remove the last element and return it.
+ T PopBack() {
+ GPR_ASSERT(append_ != nullptr);
+ if (append_->count == 0) {
+ GPR_ASSERT(first_ != append_);
+ Chunk* chunk = first_;
+ while (chunk->next != append_) {
+ chunk = chunk->next;
+ }
+ append_ = chunk;
+ }
+ const auto last = append_->count - 1;
+ T result = std::move(*append_->data[last]);
+ append_->data[last].Destroy();
+ append_->count = last;
+ return result;
+ }
+
+ void Clear() {
+ Chunk* chunk = first_;
+ while (chunk != nullptr && chunk->count != 0) {
+ for (size_t i = 0; i < chunk->count; i++) {
+ chunk->data[i].Destroy();
+ }
+ chunk->count = 0;
+ chunk = chunk->next;
+ }
+ append_ = first_;
+ }
+
+ // Forward-only iterator.
+ class ForwardIterator {
+ public:
+ ForwardIterator(Chunk* chunk, size_t n) : chunk_(chunk), n_(n) {}
+
+ using difference_type = std::ptrdiff_t;
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = T;
+ using pointer = T*;
+ using reference = T&;
+
+ T& operator*() const { return *chunk_->data[n_]; }
+ T* operator->() const { return &*chunk_->data[n_]; }
+ ForwardIterator& operator++() {
+ ++n_;
+ while (chunk_ != nullptr && n_ == chunk_->count) {
+ chunk_ = chunk_->next;
+ n_ = 0;
+ }
+ return *this;
+ }
+ ForwardIterator& operator++(int) {
+ ForwardIterator tmp = *this;
+ ++*this;
+ return tmp;
+ }
+ bool operator==(const ForwardIterator& other) const {
+ return chunk_ == other.chunk_ && n_ == other.n_;
+ }
+ bool operator!=(const ForwardIterator& other) const {
+ return !(*this == other);
+ }
+
+ private:
+ friend class ChunkedVector;
+
+ Chunk* chunk_;
+ size_t n_;
+ };
+
+ // Const Forward-only iterator.
+ class ConstForwardIterator {
+ public:
+ ConstForwardIterator(const Chunk* chunk, size_t n) : chunk_(chunk), n_(n) {}
+
+ using iterator_category = std::forward_iterator_tag;
+
+ const T& operator*() const { return *chunk_->data[n_]; }
+ const T* operator->() const { return &*chunk_->data[n_]; }
+ ConstForwardIterator& operator++() {
+ ++n_;
+ while (chunk_ != nullptr && n_ == chunk_->count) {
+ chunk_ = chunk_->next;
+ n_ = 0;
+ }
+ return *this;
+ }
+ ConstForwardIterator& operator++(int) {
+ ConstForwardIterator tmp = *this;
+ ++*this;
+ return tmp;
+ }
+ bool operator==(const ConstForwardIterator& other) const {
+ return chunk_ == other.chunk_ && n_ == other.n_;
+ }
+ bool operator!=(const ConstForwardIterator& other) const {
+ return !(*this == other);
+ }
+
+ private:
+ const Chunk* chunk_;
+ size_t n_;
+ };
+
+ ForwardIterator begin() {
+ if (first_ != nullptr && first_->count == 0) return end();
+ return ForwardIterator(first_, 0);
+ }
+ ForwardIterator end() { return ForwardIterator(nullptr, 0); }
+
+ ConstForwardIterator begin() const {
+ if (first_ != nullptr && first_->count == 0) return cend();
+ return ConstForwardIterator(first_, 0);
+ }
+ ConstForwardIterator end() const { return ConstForwardIterator(nullptr, 0); }
+
+ ConstForwardIterator cbegin() const { return begin(); }
+ ConstForwardIterator cend() const { return end(); }
+
+ // Count the number of elements in the vector.
+ size_t size() const {
+ size_t n = 0;
+ for (const Chunk* chunk = first_; chunk != nullptr; chunk = chunk->next) {
+ n += chunk->count;
+ }
+ return n;
+ }
+
+ // Return true if the vector is empty.
+ bool empty() const { return first_ == nullptr || first_->count == 0; }
+
+ void SetEnd(ForwardIterator it) {
+ if (it == end()) return;
+ Chunk* chunk = it.chunk_;
+ for (size_t i = it.n_; i < chunk->count; i++) {
+ chunk->data[i].Destroy();
+ }
+ chunk->count = it.n_;
+ append_ = chunk;
+ while ((chunk = chunk->next) != nullptr) {
+ for (size_t i = 0; i < chunk->count; i++) {
+ chunk->data[i].Destroy();
+ }
+ chunk->count = 0;
+ }
+ }
+
+ private:
+ ManualConstructor<T>* AppendSlot() {
+ if (append_ == nullptr) {
+ GPR_ASSERT(first_ == nullptr);
+ first_ = arena_->New<Chunk>();
+ append_ = first_;
+ } else if (append_->count == kChunkSize) {
+ if (append_->next == nullptr) {
+ append_->next = arena_->New<Chunk>();
+ }
+ append_ = append_->next;
+ }
+ return &append_->data[append_->count++];
+ }
+
+ Arena* arena_;
+ Chunk* first_ = nullptr;
+ Chunk* append_ = nullptr;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
diff --git a/grpc/src/core/lib/gprpp/construct_destruct.h b/grpc/src/core/lib/gprpp/construct_destruct.h
new file mode 100644
index 00000000..73fdb1f3
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/construct_destruct.h
@@ -0,0 +1,39 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CONSTRUCT_DESTRUCT_H
+#define GRPC_CORE_LIB_GPRPP_CONSTRUCT_DESTRUCT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+namespace grpc_core {
+
+// Call the destructor of p without having to name the type of p.
+template <typename T>
+void Destruct(T* p) {
+ p->~T();
+}
+
+// Call the constructor of p without having to name the type of p and forward
+// any arguments
+template <typename T, typename... Args>
+void Construct(T* p, Args&&... args) {
+ new (p) T(std::forward<Args>(args)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CONSTRUCT_DESTRUCT_H
diff --git a/grpc/src/core/lib/gprpp/cpp_impl_of.h b/grpc/src/core/lib/gprpp/cpp_impl_of.h
new file mode 100644
index 00000000..aca7a3eb
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/cpp_impl_of.h
@@ -0,0 +1,49 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CPP_IMPL_OF_H
+#define GRPC_CORE_LIB_GPRPP_CPP_IMPL_OF_H
+
+namespace grpc_core {
+
+// Declares CppType to be the backing implementation of CType.
+// Use via the curiously recursive template:
+// class Foo : public CppImplOf<Foo, grpc_foo> {};
+// Provides casting methods each way.
+// grpc_foo should be `typedef struct grpc_foo grpc_foo` and otherwise
+// not defined.
+template <typename CppType, typename CType>
+class CppImplOf {
+ public:
+ // Convert the C struct to C++
+ static CppType* FromC(CType* c_type) {
+ return reinterpret_cast<CppType*>(c_type);
+ }
+
+ static const CppType* FromC(const CType* c_type) {
+ return reinterpret_cast<const CppType*>(c_type);
+ }
+
+ // Retrieve a c pointer (of the same ownership as this)
+ CType* c_ptr() {
+ return reinterpret_cast<CType*>(static_cast<CppType*>(this));
+ }
+
+ protected:
+ ~CppImplOf() = default;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CPP_IMPL_OF_H
diff --git a/grpc/src/core/lib/gprpp/debug_location.h b/grpc/src/core/lib/gprpp/debug_location.h
index d2384fde..5377d5fd 100644
--- a/grpc/src/core/lib/gprpp/debug_location.h
+++ b/grpc/src/core/lib/gprpp/debug_location.h
@@ -42,6 +42,8 @@ class DebugLocation {
#else
class DebugLocation {
public:
+ DebugLocation() {}
+ DebugLocation(const char* /* file */, int /* line */) {}
const char* file() const { return nullptr; }
int line() const { return -1; }
};
diff --git a/grpc/src/core/lib/gprpp/dual_ref_counted.h b/grpc/src/core/lib/gprpp/dual_ref_counted.h
index 5217bfa1..560e08d0 100644
--- a/grpc/src/core/lib/gprpp/dual_ref_counted.h
+++ b/grpc/src/core/lib/gprpp/dual_ref_counted.h
@@ -19,15 +19,14 @@
#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/gprpp/atomic.h"
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.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"
@@ -67,7 +66,7 @@ class DualRefCounted : public Orphanable {
void Unref() {
// Convert strong ref to weak ref.
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_add(MakeRefPair(-1, 1), std::memory_order_acq_rel);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
@@ -85,7 +84,7 @@ class DualRefCounted : public Orphanable {
}
void Unref(const DebugLocation& location, const char* reason) {
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_add(MakeRefPair(-1, 1), std::memory_order_acq_rel);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
@@ -108,7 +107,7 @@ class DualRefCounted : public Orphanable {
}
RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
- uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
+ uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire);
do {
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
@@ -119,15 +118,15 @@ class DualRefCounted : public Orphanable {
}
#endif
if (strong_refs == 0) return nullptr;
- } while (!refs_.CompareExchangeWeak(
- &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
+ } while (!refs_.compare_exchange_weak(
+ prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0),
+ std::memory_order_acq_rel, std::memory_order_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);
+ uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire);
do {
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
@@ -144,9 +143,9 @@ class DualRefCounted : public Orphanable {
(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));
+ } while (!refs_.compare_exchange_weak(
+ prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0),
+ std::memory_order_acq_rel, std::memory_order_acquire));
return RefCountedPtr<Child>(static_cast<Child*>(this));
}
@@ -169,7 +168,7 @@ class DualRefCounted : public Orphanable {
const char* trace = trace_;
#endif
const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
@@ -191,7 +190,7 @@ class DualRefCounted : public Orphanable {
const char* trace = trace_;
#endif
const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
@@ -254,7 +253,7 @@ class DualRefCounted : public Orphanable {
void IncrementRefCount() {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
GPR_ASSERT(strong_refs != 0);
@@ -263,13 +262,13 @@ class DualRefCounted : public Orphanable {
strong_refs, strong_refs + 1, weak_refs);
}
#else
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_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);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
GPR_ASSERT(strong_refs != 0);
@@ -282,14 +281,14 @@ class DualRefCounted : public Orphanable {
// Use conditionally-important parameters
(void)location;
(void)reason;
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
#endif
}
void IncrementWeakRefCount() {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
if (trace_ != nullptr) {
@@ -297,14 +296,14 @@ class DualRefCounted : public Orphanable {
weak_refs, weak_refs + 1, strong_refs);
}
#else
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_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);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
if (trace_ != nullptr) {
@@ -316,14 +315,14 @@ class DualRefCounted : public Orphanable {
// Use conditionally-important parameters
(void)location;
(void)reason;
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
#endif
}
#ifndef NDEBUG
const char* trace_;
#endif
- Atomic<uint64_t> refs_;
+ std::atomic<uint64_t> refs_{0};
};
} // namespace grpc_core
diff --git a/grpc/src/core/lib/gprpp/fork.cc b/grpc/src/core/lib/gprpp/fork.cc
index 45a4a894..675f8e4d 100644
--- a/grpc/src/core/lib/gprpp/fork.cc
+++ b/grpc/src/core/lib/gprpp/fork.cc
@@ -168,28 +168,30 @@ class ThreadState {
void Fork::GlobalInit() {
if (!override_enabled_) {
- support_enabled_.Store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
- MemoryOrder::RELAXED);
+ support_enabled_.store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
+ std::memory_order_relaxed);
}
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
exec_ctx_state_ = new internal::ExecCtxState();
thread_state_ = new internal::ThreadState();
}
}
void Fork::GlobalShutdown() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
delete exec_ctx_state_;
delete thread_state_;
}
}
-bool Fork::Enabled() { return support_enabled_.Load(MemoryOrder::RELAXED); }
+bool Fork::Enabled() {
+ return support_enabled_.load(std::memory_order_relaxed);
+}
// Testing Only
void Fork::Enable(bool enable) {
override_enabled_ = true;
- support_enabled_.Store(enable, MemoryOrder::RELAXED);
+ support_enabled_.store(enable, std::memory_order_relaxed);
}
void Fork::DoIncExecCtxCount() { exec_ctx_state_->IncExecCtxCount(); }
@@ -205,38 +207,38 @@ Fork::child_postfork_func Fork::GetResetChildPollingEngineFunc() {
}
bool Fork::BlockExecCtx() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
return exec_ctx_state_->BlockExecCtx();
}
return false;
}
void Fork::AllowExecCtx() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
exec_ctx_state_->AllowExecCtx();
}
}
void Fork::IncThreadCount() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->IncThreadCount();
}
}
void Fork::DecThreadCount() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->DecThreadCount();
}
}
void Fork::AwaitThreads() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->AwaitThreads();
}
}
internal::ExecCtxState* Fork::exec_ctx_state_ = nullptr;
internal::ThreadState* Fork::thread_state_ = nullptr;
-Atomic<bool> Fork::support_enabled_(false);
+std::atomic<bool> Fork::support_enabled_(false);
bool Fork::override_enabled_ = false;
Fork::child_postfork_func Fork::reset_child_polling_engine_ = nullptr;
} // namespace grpc_core
diff --git a/grpc/src/core/lib/gprpp/fork.h b/grpc/src/core/lib/gprpp/fork.h
index 3601d7ca..d6ef1613 100644
--- a/grpc/src/core/lib/gprpp/fork.h
+++ b/grpc/src/core/lib/gprpp/fork.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/atomic.h"
+#include <atomic>
/*
* NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK
@@ -48,14 +48,14 @@ class Fork {
// Increment the count of active ExecCtxs.
// Will block until a pending fork is complete if one is in progress.
static void IncExecCtxCount() {
- if (GPR_UNLIKELY(support_enabled_.Load(MemoryOrder::RELAXED))) {
+ if (GPR_UNLIKELY(support_enabled_.load(std::memory_order_relaxed))) {
DoIncExecCtxCount();
}
}
// Decrement the count of active ExecCtxs
static void DecExecCtxCount() {
- if (GPR_UNLIKELY(support_enabled_.Load(MemoryOrder::RELAXED))) {
+ if (GPR_UNLIKELY(support_enabled_.load(std::memory_order_relaxed))) {
DoDecExecCtxCount();
}
}
@@ -93,7 +93,7 @@ class Fork {
static internal::ExecCtxState* exec_ctx_state_;
static internal::ThreadState* thread_state_;
- static grpc_core::Atomic<bool> support_enabled_;
+ static std::atomic<bool> support_enabled_;
static bool override_enabled_;
static child_postfork_func reset_child_polling_engine_;
};
diff --git a/grpc/src/core/lib/gprpp/global_config.h b/grpc/src/core/lib/gprpp/global_config.h
index ed986b8e..150c7385 100644
--- a/grpc/src/core/lib/gprpp/global_config.h
+++ b/grpc/src/core/lib/gprpp/global_config.h
@@ -89,8 +89,7 @@
// bool gpr_global_config_get_test();
// void gpr_global_config_set_test(bool value);
-#include "src/core/lib/gprpp/global_config_env.h"
-
#include "src/core/lib/gprpp/global_config_custom.h"
+#include "src/core/lib/gprpp/global_config_env.h"
#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H */
diff --git a/grpc/src/core/lib/gprpp/global_config_env.cc b/grpc/src/core/lib/gprpp/global_config_env.cc
index d45d232d..db12867f 100644
--- a/grpc/src/core/lib/gprpp/global_config_env.cc
+++ b/grpc/src/core/lib/gprpp/global_config_env.cc
@@ -20,13 +20,6 @@
#include "src/core/lib/gprpp/global_config_env.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-
#include <ctype.h>
#include <string.h>
@@ -34,6 +27,13 @@
#include "absl/strings/str_format.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+
namespace grpc_core {
namespace {
@@ -58,8 +58,8 @@ void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func) {
g_global_config_env_error_func = func;
}
-grpc_core::UniquePtr<char> GlobalConfigEnv::GetValue() {
- return grpc_core::UniquePtr<char>(gpr_getenv(GetName()));
+UniquePtr<char> GlobalConfigEnv::GetValue() {
+ return UniquePtr<char>(gpr_getenv(GetName()));
}
void GlobalConfigEnv::SetValue(const char* value) {
@@ -80,7 +80,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvBool>::value,
"GlobalConfigEnvBool needs to be trivially destructible.");
bool GlobalConfigEnvBool::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
@@ -101,7 +101,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvInt32>::value,
"GlobalConfigEnvInt32 needs to be trivially destructible.");
int32_t GlobalConfigEnvInt32::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
@@ -124,10 +124,10 @@ void GlobalConfigEnvInt32::Set(int32_t value) {
static_assert(std::is_trivially_destructible<GlobalConfigEnvString>::value,
"GlobalConfigEnvString needs to be trivially destructible.");
-grpc_core::UniquePtr<char> GlobalConfigEnvString::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+UniquePtr<char> GlobalConfigEnvString::Get() {
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
- return grpc_core::UniquePtr<char>(gpr_strdup(default_value_));
+ return UniquePtr<char>(gpr_strdup(default_value_));
}
return str;
}
diff --git a/grpc/src/core/lib/gprpp/global_config_env.h b/grpc/src/core/lib/gprpp/global_config_env.h
index b6d7d574..3d303889 100644
--- a/grpc/src/core/lib/gprpp/global_config_env.h
+++ b/grpc/src/core/lib/gprpp/global_config_env.h
@@ -43,7 +43,7 @@ class GlobalConfigEnv {
public:
// Returns the value of `name` variable.
- grpc_core::UniquePtr<char> GetValue();
+ UniquePtr<char> GetValue();
// Sets the value of `name` variable.
void SetValue(const char* value);
@@ -87,7 +87,7 @@ class GlobalConfigEnvString : public GlobalConfigEnv {
constexpr GlobalConfigEnvString(char* name, const char* default_value)
: GlobalConfigEnv(name), default_value_(default_value) {}
- grpc_core::UniquePtr<char> Get();
+ UniquePtr<char> Get();
void Set(const char* value);
private:
diff --git a/grpc/src/core/lib/gprpp/global_config_generic.h b/grpc/src/core/lib/gprpp/global_config_generic.h
index d3e3e2a2..6bdadb09 100644
--- a/grpc/src/core/lib/gprpp/global_config_generic.h
+++ b/grpc/src/core/lib/gprpp/global_config_generic.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/memory.h"
-
#include <stdint.h>
+#include "src/core/lib/gprpp/memory.h"
+
#define GPR_GLOBAL_CONFIG_GET(name) gpr_global_config_get_##name()
#define GPR_GLOBAL_CONFIG_SET(name, value) gpr_global_config_set_##name(value)
diff --git a/grpc/src/core/lib/gprpp/manual_constructor.h b/grpc/src/core/lib/gprpp/manual_constructor.h
index 7ee13796..6ef55570 100644
--- a/grpc/src/core/lib/gprpp/manual_constructor.h
+++ b/grpc/src/core/lib/gprpp/manual_constructor.h
@@ -25,12 +25,15 @@
#include <stddef.h>
#include <stdlib.h>
+
#include <new>
#include <type_traits>
#include <utility>
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/construct_destruct.h"
+
namespace grpc_core {
// this contains templated helpers needed to implement the ManualConstructors
@@ -160,9 +163,8 @@ class PolymorphicManualConstructor {
}
typename std::aligned_storage<
- grpc_core::manual_ctor_impl::max_size_of<DerivedTypes...>::value,
- grpc_core::manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type
- space_;
+ manual_ctor_impl::max_size_of<DerivedTypes...>::value,
+ manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type space_;
};
template <typename Type>
@@ -182,7 +184,7 @@ class ManualConstructor {
Type& operator*() { return *get(); }
const Type& operator*() const { return *get(); }
- void Init() { new (&space_) Type; }
+ void Init() { Construct(get()); }
// Init() constructs the Type instance using the given arguments
// (which are forwarded to Type's constructor).
@@ -192,17 +194,17 @@ class ManualConstructor {
// "new Type();"), so it will leave non-class types uninitialized.
template <typename... Ts>
void Init(Ts&&... args) {
- new (&space_) Type(std::forward<Ts>(args)...);
+ Construct(get(), std::forward<Ts>(args)...);
}
// Init() that is equivalent to copy and move construction.
// Enables usage like this:
// ManualConstructor<std::vector<int>> v;
// v.Init({1, 2, 3});
- void Init(const Type& x) { new (&space_) Type(x); }
- void Init(Type&& x) { new (&space_) Type(std::move(x)); }
+ void Init(const Type& x) { Construct(get(), x); }
+ void Init(Type&& x) { Construct(get(), std::forward<Type>(x)); }
- void Destroy() { get()->~Type(); }
+ void Destroy() { Destruct(get()); }
private:
typename std::aligned_storage<sizeof(Type), alignof(Type)>::type space_;
@@ -210,4 +212,4 @@ class ManualConstructor {
} // namespace grpc_core
-#endif
+#endif // GRPC_CORE_LIB_GPRPP_MANUAL_CONSTRUCTOR_H
diff --git a/grpc/src/core/lib/gprpp/match.h b/grpc/src/core/lib/gprpp/match.h
new file mode 100644
index 00000000..55c95b97
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/match.h
@@ -0,0 +1,73 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_MATCH_H
+#define GRPC_CORE_LIB_GPRPP_MATCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/types/variant.h"
+
+#include "src/core/lib/gprpp/overload.h"
+
+namespace grpc_core {
+
+namespace detail {
+
+template <typename... Cases>
+struct MatchPointerExtractor {
+ OverloadType<Cases...> cases;
+ template <typename T>
+ auto operator()(T& value) -> decltype(cases(&value)) {
+ return cases(&value);
+ }
+};
+
+} // namespace detail
+
+/// Match on a variant.
+/// Given variant \a value, and a set of callables \a fs, call the appropriate
+/// callable based on the type contained in \a value.
+///
+/// Example (prints "hoorah"):
+/// variant<int, string> v = 42;
+/// Match(v,
+/// [](int i) { puts("hoorah"); },
+/// [](string s) { puts("boo"); });
+template <typename... Fs, typename T0, typename... Ts>
+auto Match(const absl::variant<T0, Ts...>& value, Fs... fs)
+ -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0>())) {
+ return absl::visit(Overload(std::move(fs)...), value);
+}
+
+/// A version of Match that takes a mutable pointer to a variant and calls its
+/// overload callables with a mutable pointer to the current variant value.
+///
+/// Example:
+/// variant<int, string> v = 42;
+/// MatchMutable(&v,
+/// [](int* i) { *i = 1; },
+/// [](string* s) { *s = "foo"; });
+/// // v now contains 1.
+template <typename... Fs, typename T0, typename... Ts>
+auto MatchMutable(absl::variant<T0, Ts...>* value, Fs... fs)
+ -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0*>())) {
+ return absl::visit(detail::MatchPointerExtractor<Fs...>{OverloadType<Fs...>(
+ std::move(fs)...)},
+ *value);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_MATCH_H
diff --git a/grpc/src/core/lib/gprpp/memory.h b/grpc/src/core/lib/gprpp/memory.h
index 4edc9b3d..dc0a6ead 100644
--- a/grpc/src/core/lib/gprpp/memory.h
+++ b/grpc/src/core/lib/gprpp/memory.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
#include <limits>
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
namespace grpc_core {
class DefaultDeleteChar {
@@ -46,6 +46,12 @@ class DefaultDeleteChar {
template <typename T>
using UniquePtr = std::unique_ptr<T, DefaultDeleteChar>;
+template <class T>
+T* Zalloc() {
+ static_assert(std::is_trivial<T>::value, "Type should be trivial");
+ return static_cast<T*>(gpr_zalloc(sizeof(T)));
+}
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_MEMORY_H */
diff --git a/grpc/src/core/lib/gprpp/mpscq.cc b/grpc/src/core/lib/gprpp/mpscq.cc
index 373ec09f..b5a17173 100644
--- a/grpc/src/core/lib/gprpp/mpscq.cc
+++ b/grpc/src/core/lib/gprpp/mpscq.cc
@@ -27,9 +27,9 @@ namespace grpc_core {
//
bool MultiProducerSingleConsumerQueue::Push(Node* node) {
- node->next.Store(nullptr, MemoryOrder::RELAXED);
- Node* prev = head_.Exchange(node, MemoryOrder::ACQ_REL);
- prev->next.Store(node, MemoryOrder::RELEASE);
+ node->next.store(nullptr, std::memory_order_relaxed);
+ Node* prev = head_.exchange(node, std::memory_order_acq_rel);
+ prev->next.store(node, std::memory_order_release);
return prev == &stub_;
}
@@ -42,7 +42,7 @@ MultiProducerSingleConsumerQueue::Pop() {
MultiProducerSingleConsumerQueue::Node*
MultiProducerSingleConsumerQueue::PopAndCheckEnd(bool* empty) {
Node* tail = tail_;
- Node* next = tail_->next.Load(MemoryOrder::ACQUIRE);
+ Node* next = tail_->next.load(std::memory_order_acquire);
if (tail == &stub_) {
// indicates the list is actually (ephemerally) empty
if (next == nullptr) {
@@ -51,21 +51,21 @@ MultiProducerSingleConsumerQueue::PopAndCheckEnd(bool* empty) {
}
tail_ = next;
tail = next;
- next = tail->next.Load(MemoryOrder::ACQUIRE);
+ next = tail->next.load(std::memory_order_acquire);
}
if (next != nullptr) {
*empty = false;
tail_ = next;
return tail;
}
- Node* head = head_.Load(MemoryOrder::ACQUIRE);
+ Node* head = head_.load(std::memory_order_acquire);
if (tail != head) {
*empty = false;
// indicates a retry is in order: we're still adding
return nullptr;
}
Push(&stub_);
- next = tail->next.Load(MemoryOrder::ACQUIRE);
+ next = tail->next.load(std::memory_order_acquire);
if (next != nullptr) {
*empty = false;
tail_ = next;
diff --git a/grpc/src/core/lib/gprpp/mpscq.h b/grpc/src/core/lib/gprpp/mpscq.h
index a1c04cae..38e016c1 100644
--- a/grpc/src/core/lib/gprpp/mpscq.h
+++ b/grpc/src/core/lib/gprpp/mpscq.h
@@ -21,11 +21,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
+#include <atomic>
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/sync.h"
+
namespace grpc_core {
// Multiple-producer single-consumer lock free queue, based upon the
@@ -35,12 +36,12 @@ class MultiProducerSingleConsumerQueue {
public:
// List node. Application node types can inherit from this.
struct Node {
- Atomic<Node*> next;
+ std::atomic<Node*> next{nullptr};
};
MultiProducerSingleConsumerQueue() : head_{&stub_}, tail_(&stub_) {}
~MultiProducerSingleConsumerQueue() {
- GPR_ASSERT(head_.Load(MemoryOrder::RELAXED) == &stub_);
+ GPR_ASSERT(head_.load(std::memory_order_relaxed) == &stub_);
GPR_ASSERT(tail_ == &stub_);
}
@@ -61,7 +62,7 @@ class MultiProducerSingleConsumerQueue {
// make sure head & tail don't share a cacheline
union {
char padding_[GPR_CACHELINE_SIZE];
- Atomic<Node*> head_;
+ std::atomic<Node*> head_{nullptr};
};
Node* tail_;
Node stub_;
diff --git a/grpc/src/core/lib/gprpp/orphanable.h b/grpc/src/core/lib/gprpp/orphanable.h
index 2a95b9df..bdd26d56 100644
--- a/grpc/src/core/lib/gprpp/orphanable.h
+++ b/grpc/src/core/lib/gprpp/orphanable.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
#include <cinttypes>
#include <memory>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -72,7 +72,7 @@ inline OrphanablePtr<T> MakeOrphanable(Args&&... args) {
}
// A type of Orphanable with internal ref-counting.
-template <typename Child>
+template <typename Child, UnrefBehavior UnrefBehaviorArg = kUnrefDelete>
class InternallyRefCounted : public Orphanable {
public:
// Not copyable nor movable.
@@ -102,12 +102,12 @@ class InternallyRefCounted : public Orphanable {
void Unref() {
if (GPR_UNLIKELY(refs_.Unref())) {
- delete this;
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
void Unref(const DebugLocation& location, const char* reason) {
if (GPR_UNLIKELY(refs_.Unref(location, reason))) {
- delete this;
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
@@ -117,7 +117,7 @@ class InternallyRefCounted : public Orphanable {
refs_.Ref(location, reason);
}
- grpc_core::RefCount refs_;
+ RefCount refs_;
};
} // namespace grpc_core
diff --git a/grpc/src/core/lib/gprpp/overload.h b/grpc/src/core/lib/gprpp/overload.h
new file mode 100644
index 00000000..c243a8c0
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/overload.h
@@ -0,0 +1,59 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_OVERLOAD_H
+#define GRPC_CORE_LIB_GPRPP_OVERLOAD_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+namespace grpc_core {
+
+template <typename... Cases>
+struct OverloadType;
+// Compose one overload with N more -- use inheritance to leverage using and the
+// empty base class optimization.
+template <typename Case, typename... Cases>
+struct OverloadType<Case, Cases...> : public Case,
+ public OverloadType<Cases...> {
+ explicit OverloadType(Case&& c, Cases&&... cases)
+ : Case(std::forward<Case>(c)),
+ OverloadType<Cases...>(std::forward<Cases>(cases)...) {}
+ using Case::operator();
+ using OverloadType<Cases...>::operator();
+};
+// Overload of a single case is just that case itself
+template <typename Case>
+struct OverloadType<Case> : public Case {
+ explicit OverloadType(Case&& c) : Case(std::forward<Case>(c)) {}
+ using Case::operator();
+};
+
+/// Compose callables into a single callable.
+/// e.g. given [](int i) { puts("a"); } and [](double d) { puts("b"); },
+/// return a callable object like:
+/// struct {
+/// void operator()(int i) { puts("a"); }
+/// void operator()(double i) { puts("b"); }
+/// };
+/// Preserves all captures.
+template <typename... Cases>
+OverloadType<Cases...> Overload(Cases... cases) {
+ return OverloadType<Cases...>(std::move(cases)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_OVERLOAD_H
diff --git a/grpc/src/core/lib/gprpp/ref_counted.h b/grpc/src/core/lib/gprpp/ref_counted.h
index a8def8c9..d7031dc9 100644
--- a/grpc/src/core/lib/gprpp/ref_counted.h
+++ b/grpc/src/core/lib/gprpp/ref_counted.h
@@ -21,15 +21,15 @@
#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/gprpp/atomic.h"
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/gprpp/atomic_utils.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -70,18 +70,18 @@ class RefCount {
// Increases the ref-count by `n`.
void Ref(Value n = 1) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(n, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(n, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p ref %" PRIdPTR " -> %" PRIdPTR, trace_, this,
prior, prior + n);
}
#else
- value_.FetchAdd(n, MemoryOrder::RELAXED);
+ value_.fetch_add(n, std::memory_order_relaxed);
#endif
}
void Ref(const DebugLocation& location, const char* reason, Value n = 1) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(n, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(n, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s",
trace_, this, location.file(), location.line(), prior, prior + n,
@@ -91,26 +91,26 @@ class RefCount {
// Use conditionally-important parameters
(void)location;
(void)reason;
- value_.FetchAdd(n, MemoryOrder::RELAXED);
+ value_.fetch_add(n, std::memory_order_relaxed);
#endif
}
// Similar to Ref() with an assert on the ref-count being non-zero.
void RefNonZero() {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(1, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(1, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p ref %" PRIdPTR " -> %" PRIdPTR, trace_, this,
prior, prior + 1);
}
assert(prior > 0);
#else
- value_.FetchAdd(1, MemoryOrder::RELAXED);
+ value_.fetch_add(1, std::memory_order_relaxed);
#endif
}
void RefNonZero(const DebugLocation& location, const char* reason) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(1, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(1, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s",
trace_, this, location.file(), location.line(), prior, prior + 1,
@@ -133,7 +133,7 @@ class RefCount {
trace_, this, prior, prior + 1);
}
#endif
- return value_.IncrementIfNonzero();
+ return IncrementIfNonzero(&value_);
}
bool RefIfNonZero(const DebugLocation& location, const char* reason) {
#ifndef NDEBUG
@@ -148,7 +148,7 @@ class RefCount {
// Avoid unused-parameter warnings for debug-only parameters
(void)location;
(void)reason;
- return value_.IncrementIfNonzero();
+ return IncrementIfNonzero(&value_);
}
// Decrements the ref-count and returns true if the ref-count reaches 0.
@@ -159,7 +159,7 @@ class RefCount {
// safely access it, since another thread might free us in the interim.
auto* trace = trace_;
#endif
- const Value prior = value_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const Value prior = value_.fetch_sub(1, std::memory_order_acq_rel);
#ifndef NDEBUG
if (trace != nullptr) {
gpr_log(GPR_INFO, "%s:%p unref %" PRIdPTR " -> %" PRIdPTR, trace, this,
@@ -176,7 +176,7 @@ class RefCount {
// safely access it, since another thread might free us in the interim.
auto* trace = trace_;
#endif
- const Value prior = value_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const Value prior = value_.fetch_sub(1, std::memory_order_acq_rel);
#ifndef NDEBUG
if (trace != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s",
@@ -193,12 +193,12 @@ class RefCount {
}
private:
- Value get() const { return value_.Load(MemoryOrder::RELAXED); }
+ Value get() const { return value_.load(std::memory_order_relaxed); }
#ifndef NDEBUG
const char* trace_;
#endif
- Atomic<Value> value_;
+ std::atomic<Value> value_{0};
};
// PolymorphicRefCount enforces polymorphic destruction of RefCounted.
@@ -208,7 +208,7 @@ class PolymorphicRefCount {
};
// NonPolymorphicRefCount does not enforce polymorphic destruction of
-// RefCounted. Please refer to grpc_core::RefCounted for more details, and
+// RefCounted. Please refer to RefCounted for more details, and
// when in doubt use PolymorphicRefCount.
class NonPolymorphicRefCount {
public:
@@ -281,6 +281,8 @@ template <typename Child, typename Impl = PolymorphicRefCount,
UnrefBehavior UnrefBehaviorArg = kUnrefDelete>
class RefCounted : public Impl {
public:
+ using RefCountedChildType = Child;
+
// Note: Depending on the Impl used, this dtor can be implicitly virtual.
~RefCounted() = default;
diff --git a/grpc/src/core/lib/gprpp/ref_counted_ptr.h b/grpc/src/core/lib/gprpp/ref_counted_ptr.h
index 4ee1b950..047ae95a 100644
--- a/grpc/src/core/lib/gprpp/ref_counted_ptr.h
+++ b/grpc/src/core/lib/gprpp/ref_counted_ptr.h
@@ -40,8 +40,7 @@ class RefCountedPtr {
// If value is non-null, we take ownership of a ref to it.
template <typename Y>
- // NOLINTNEXTLINE(google-explicit-constructor)
- RefCountedPtr(Y* value) : value_(value) {}
+ explicit RefCountedPtr(Y* value) : value_(value) {}
// Move ctors.
RefCountedPtr(RefCountedPtr&& other) noexcept {
@@ -191,8 +190,7 @@ class WeakRefCountedPtr {
// If value is non-null, we take ownership of a ref to it.
template <typename Y>
- // NOLINTNEXTLINE(google-explicit-constructor)
- WeakRefCountedPtr(Y* value) {
+ explicit WeakRefCountedPtr(Y* value) {
value_ = value;
}
diff --git a/grpc/src/core/lib/gprpp/single_set_ptr.h b/grpc/src/core/lib/gprpp/single_set_ptr.h
new file mode 100644
index 00000000..1b26d099
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/single_set_ptr.h
@@ -0,0 +1,87 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SINGLE_SET_PTR_H
+#define GRPC_CORE_LIB_GPRPP_SINGLE_SET_PTR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+#include <memory>
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+template <class T, class Deleter = std::default_delete<T>>
+class SingleSetPtr {
+ public:
+ SingleSetPtr() = default;
+ explicit SingleSetPtr(T* p) : p_{p} {}
+ explicit SingleSetPtr(std::unique_ptr<T, Deleter> p) : p_{p.release()} {}
+ ~SingleSetPtr() { Delete(p_.load(std::memory_order_relaxed)); }
+
+ SingleSetPtr(const SingleSetPtr&) = delete;
+ SingleSetPtr& operator=(const SingleSetPtr&) = delete;
+ SingleSetPtr(SingleSetPtr&& other) noexcept
+ : p_(other.p_.exchange(nullptr)) {}
+ SingleSetPtr& operator=(SingleSetPtr&& other) noexcept {
+ Set(other.p_.exchange(nullptr, std::memory_order_acq_rel));
+ return *this;
+ }
+
+ // Set the pointer;
+ // if already set, return the pre-set value and delete ptr;
+ // if deleted, return nullptr and delete ptr.
+ T* Set(T* ptr) {
+ T* expected = nullptr;
+ if (!p_.compare_exchange_strong(expected, ptr, std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ Delete(ptr);
+ return expected;
+ }
+ return ptr;
+ }
+
+ // Set the pointer from a compatible unique_ptr - with the same caveats as
+ // above.
+ T* Set(std::unique_ptr<T, Deleter> ptr) { return Set(ptr.release()); }
+
+ // Clear the pointer.
+ void Reset() { Delete(p_.exchange(nullptr, std::memory_order_acq_rel)); }
+
+ bool is_set() const {
+ T* p = p_.load(std::memory_order_acquire);
+ return p != nullptr;
+ }
+
+ T* operator->() const {
+ T* p = p_.load(std::memory_order_acquire);
+ GPR_DEBUG_ASSERT(p != nullptr);
+ return p;
+ }
+
+ T& operator*() const { return *operator->(); }
+
+ private:
+ static void Delete(T* p) {
+ if (p == nullptr) return;
+ Deleter()(p);
+ }
+ std::atomic<T*> p_{nullptr};
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_SINGLE_SET_PTR_H
diff --git a/grpc/src/core/lib/gprpp/status_helper.cc b/grpc/src/core/lib/gprpp/status_helper.cc
index 8266e167..d98da252 100644
--- a/grpc/src/core/lib/gprpp/status_helper.cc
+++ b/grpc/src/core/lib/gprpp/status_helper.cc
@@ -19,9 +19,11 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/status_helper.h"
-#include "src/core/lib/gprpp/time_util.h"
-#include <grpc/support/log.h>
+#include <string.h>
+
+#include <algorithm>
+#include <utility>
#include "absl/strings/cord.h"
#include "absl/strings/escaping.h"
@@ -29,11 +31,14 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/time/clock.h"
-
#include "google/protobuf/any.upb.h"
#include "google/rpc/status.upb.h"
#include "upb/upb.hpp"
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gprpp/time_util.h"
+
namespace grpc_core {
namespace {
@@ -131,8 +136,9 @@ void EncodeUInt32ToBytes(uint32_t v, char* buf) {
}
uint32_t DecodeUInt32FromBytes(const char* buf) {
- return buf[0] | (uint32_t(buf[1]) << 8) | (uint32_t(buf[2]) << 16) |
- (uint32_t(buf[3]) << 24);
+ const unsigned char* ubuf = reinterpret_cast<const unsigned char*>(buf);
+ return ubuf[0] | (uint32_t(ubuf[1]) << 8) | (uint32_t(ubuf[2]) << 16) |
+ (uint32_t(ubuf[3]) << 24);
}
std::vector<absl::Status> ParseChildren(absl::Cord children) {
@@ -158,7 +164,7 @@ std::vector<absl::Status> ParseChildren(absl::Cord children) {
absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg,
const DebugLocation& location,
- std::initializer_list<absl::Status> children) {
+ std::vector<absl::Status> children) {
absl::Status s(code, msg);
if (location.file() != nullptr) {
StatusSetStr(&s, StatusStrProperty::kFile, location.file());
@@ -217,9 +223,10 @@ absl::optional<std::string> StatusGetStr(const absl::Status& status,
void StatusSetTime(absl::Status* status, StatusTimeProperty key,
absl::Time time) {
+ std::string time_str =
+ absl::FormatTime(absl::RFC3339_full, time, absl::UTCTimeZone());
status->SetPayload(GetStatusTimePropertyUrl(key),
- absl::Cord(absl::string_view(
- reinterpret_cast<const char*>(&time), sizeof(time))));
+ absl::Cord(std::move(time_str)));
}
absl::optional<absl::Time> StatusGetTime(const absl::Status& status,
@@ -228,11 +235,16 @@ absl::optional<absl::Time> StatusGetTime(const absl::Status& status,
status.GetPayload(GetStatusTimePropertyUrl(key));
if (p.has_value()) {
absl::optional<absl::string_view> sv = p->TryFlat();
+ absl::Time time;
if (sv.has_value()) {
- return *reinterpret_cast<const absl::Time*>(sv->data());
+ if (absl::ParseTime(absl::RFC3339_full, sv.value(), &time, nullptr)) {
+ return time;
+ }
} else {
std::string s = std::string(*p);
- return *reinterpret_cast<const absl::Time*>(s.c_str());
+ if (absl::ParseTime(absl::RFC3339_full, s, &time, nullptr)) {
+ return time;
+ }
}
}
return {};
@@ -300,9 +312,14 @@ std::string StatusToString(const absl::Status& status) {
absl::CHexEscape(payload_view), "\""));
} else if (absl::StartsWith(type_url, kTypeTimeTag)) {
type_url.remove_prefix(kTypeTimeTag.size());
- absl::Time t =
- *reinterpret_cast<const absl::Time*>(payload_view.data());
- kvs.push_back(absl::StrCat(type_url, ":\"", absl::FormatTime(t), "\""));
+ absl::Time t;
+ if (absl::ParseTime(absl::RFC3339_full, payload_view, &t, nullptr)) {
+ kvs.push_back(
+ absl::StrCat(type_url, ":\"", absl::FormatTime(t), "\""));
+ } else {
+ kvs.push_back(absl::StrCat(type_url, ":\"",
+ absl::CHexEscape(payload_view), "\""));
+ }
} else {
kvs.push_back(absl::StrCat(type_url, ":\"",
absl::CHexEscape(payload_view), "\""));
@@ -330,32 +347,34 @@ std::string StatusToString(const absl::Status& status) {
namespace internal {
-google_rpc_Status* StatusToProto(absl::Status status, upb_arena* arena) {
+google_rpc_Status* StatusToProto(const absl::Status& status, upb_Arena* arena) {
google_rpc_Status* msg = google_rpc_Status_new(arena);
google_rpc_Status_set_code(msg, int32_t(status.code()));
google_rpc_Status_set_message(
- msg, upb_strview_make(status.message().data(), status.message().size()));
+ msg, upb_StringView_FromDataAndSize(status.message().data(),
+ status.message().size()));
status.ForEachPayload([&](absl::string_view type_url,
const absl::Cord& payload) {
google_protobuf_Any* any = google_rpc_Status_add_details(msg, arena);
char* type_url_buf =
- reinterpret_cast<char*>(upb_arena_malloc(arena, type_url.size()));
+ reinterpret_cast<char*>(upb_Arena_Malloc(arena, type_url.size()));
memcpy(type_url_buf, type_url.data(), type_url.size());
google_protobuf_Any_set_type_url(
- any, upb_strview_make(type_url_buf, type_url.size()));
+ any, upb_StringView_FromDataAndSize(type_url_buf, type_url.size()));
absl::optional<absl::string_view> v_view = payload.TryFlat();
if (v_view.has_value()) {
google_protobuf_Any_set_value(
- any, upb_strview_make(v_view->data(), v_view->size()));
+ any, upb_StringView_FromDataAndSize(v_view->data(), v_view->size()));
} else {
char* buf =
- reinterpret_cast<char*>(upb_arena_malloc(arena, payload.size()));
+ reinterpret_cast<char*>(upb_Arena_Malloc(arena, payload.size()));
char* cur = buf;
for (absl::string_view chunk : payload.Chunks()) {
memcpy(cur, chunk.data(), chunk.size());
cur += chunk.size();
}
- google_protobuf_Any_set_value(any, upb_strview_make(buf, payload.size()));
+ google_protobuf_Any_set_value(
+ any, upb_StringView_FromDataAndSize(buf, payload.size()));
}
});
return msg;
@@ -363,43 +382,49 @@ google_rpc_Status* StatusToProto(absl::Status status, upb_arena* arena) {
absl::Status StatusFromProto(google_rpc_Status* msg) {
int32_t code = google_rpc_Status_code(msg);
- upb_strview message = google_rpc_Status_message(msg);
+ upb_StringView message = google_rpc_Status_message(msg);
absl::Status status(static_cast<absl::StatusCode>(code),
absl::string_view(message.data, message.size));
size_t detail_len;
const google_protobuf_Any* const* details =
google_rpc_Status_details(msg, &detail_len);
for (size_t i = 0; i < detail_len; i++) {
- upb_strview type_url = google_protobuf_Any_type_url(details[i]);
- upb_strview value = google_protobuf_Any_value(details[i]);
+ upb_StringView type_url = google_protobuf_Any_type_url(details[i]);
+ upb_StringView value = google_protobuf_Any_value(details[i]);
status.SetPayload(absl::string_view(type_url.data, type_url.size),
absl::Cord(absl::string_view(value.data, value.size)));
}
return status;
}
-uintptr_t StatusAllocPtr(absl::Status s) {
- // This relies the fact that absl::Status has only one member, StatusRep*
- // so the sizeof(absl::Status) has the same size of intptr_t and StatusRep*
- // can be stolen using placement allocation.
- static_assert(sizeof(intptr_t) == sizeof(absl::Status),
- "absl::Status should be as big as intptr_t");
- // This does two things;
- // 1. Copies StatusRep* of absl::Status to ptr
- // 2. Increases the counter of StatusRep if it's not inlined
- uintptr_t ptr;
- new (&ptr) absl::Status(s);
- return ptr;
+uintptr_t StatusAllocHeapPtr(absl::Status s) {
+ if (s.ok()) return 0;
+ absl::Status* ptr = new absl::Status(s);
+ return reinterpret_cast<uintptr_t>(ptr);
}
-void StatusFreePtr(uintptr_t ptr) {
- // Decreases the counter of StatusRep if it's not inlined.
- reinterpret_cast<absl::Status*>(&ptr)->~Status();
+void StatusFreeHeapPtr(uintptr_t ptr) {
+ absl::Status* s = reinterpret_cast<absl::Status*>(ptr);
+ delete s;
}
-absl::Status StatusGetFromPtr(uintptr_t ptr) {
- // Constructs Status from ptr having the address of StatusRep.
- return *reinterpret_cast<absl::Status*>(&ptr);
+absl::Status StatusGetFromHeapPtr(uintptr_t ptr) {
+ if (ptr == 0) {
+ return absl::OkStatus();
+ } else {
+ return *reinterpret_cast<absl::Status*>(ptr);
+ }
+}
+
+absl::Status StatusMoveFromHeapPtr(uintptr_t ptr) {
+ if (ptr == 0) {
+ return absl::OkStatus();
+ } else {
+ absl::Status* s = reinterpret_cast<absl::Status*>(ptr);
+ absl::Status ret = std::move(*s);
+ delete s;
+ return ret;
+ }
}
} // namespace internal
diff --git a/grpc/src/core/lib/gprpp/status_helper.h b/grpc/src/core/lib/gprpp/status_helper.h
index 50bcdffe..0c46c49e 100644
--- a/grpc/src/core/lib/gprpp/status_helper.h
+++ b/grpc/src/core/lib/gprpp/status_helper.h
@@ -21,14 +21,17 @@
#include <grpc/support/port_platform.h>
+#include <vector>
+
#include "absl/status/status.h"
#include "absl/time/time.h"
+#include "absl/types/optional.h"
#include "src/core/lib/gprpp/debug_location.h"
extern "C" {
struct google_rpc_Status;
-struct upb_arena;
+struct upb_Arena;
}
namespace grpc_core {
@@ -107,7 +110,7 @@ enum class StatusTimeProperty {
/// Creates a status with given additional information
absl::Status StatusCreate(
absl::StatusCode code, absl::string_view msg, const DebugLocation& location,
- std::initializer_list<absl::Status> children) GRPC_MUST_USE_RESULT;
+ std::vector<absl::Status> children) GRPC_MUST_USE_RESULT;
/// Sets the int property to the status
void StatusSetInt(absl::Status* status, StatusIntProperty key, intptr_t value);
@@ -150,28 +153,26 @@ namespace internal {
/// Builds a upb message, google_rpc_Status from a status
/// This is for internal implementation & test only
-google_rpc_Status* StatusToProto(absl::Status status,
- upb_arena* arena) GRPC_MUST_USE_RESULT;
+google_rpc_Status* StatusToProto(const absl::Status& status,
+ upb_Arena* arena) GRPC_MUST_USE_RESULT;
/// Builds a status from a upb message, google_rpc_Status
/// This is for internal implementation & test only
absl::Status StatusFromProto(google_rpc_Status* msg) GRPC_MUST_USE_RESULT;
-/// The same value of grpc_core::internal::StatusAllocPtr(absl::OkStatus())
-static constexpr uintptr_t kOkStatusPtr = 0;
+/// Returns ptr that is allocated in the heap memory and the given status is
+/// copied into. This ptr can be used to get Status later and should be
+/// freed by StatusFreeHeapPtr. This can be 0 in case of OkStatus.
+uintptr_t StatusAllocHeapPtr(absl::Status s);
-/// Returns ptr where the given status is copied into.
-/// This ptr can be used to get Status later and should be freed by
-/// StatusFreePtr. This shouldn't be used except migration purpose.
-uintptr_t StatusAllocPtr(absl::Status s);
+/// Frees the allocated status at heap ptr.
+void StatusFreeHeapPtr(uintptr_t ptr);
-/// Frees the allocated status at ptr.
-/// This shouldn't be used except migration purpose.
-void StatusFreePtr(uintptr_t ptr);
+/// Get the status from a heap ptr.
+absl::Status StatusGetFromHeapPtr(uintptr_t ptr);
-/// Get the status from ptr.
-/// This shouldn't be used except migration purpose.
-absl::Status StatusGetFromPtr(uintptr_t ptr);
+/// Move the status from a heap ptr. (GetFrom & FreeHeap)
+absl::Status StatusMoveFromHeapPtr(uintptr_t ptr);
} // namespace internal
diff --git a/grpc/src/core/lib/gprpp/sync.h b/grpc/src/core/lib/gprpp/sync.h
index f385883d..10f4ee6b 100644
--- a/grpc/src/core/lib/gprpp/sync.h
+++ b/grpc/src/core/lib/gprpp/sync.h
@@ -19,14 +19,14 @@
#ifndef GRPC_CORE_LIB_GPRPP_SYNC_H
#define GRPC_CORE_LIB_GPRPP_SYNC_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
-#include <grpc/impl/codegen/sync.h>
+#include "absl/synchronization/mutex.h"
+
+#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include "absl/synchronization/mutex.h"
#include "src/core/lib/gprpp/time_util.h"
// The core library is not accessible in C++ codegen headers, and vice versa.
@@ -69,6 +69,7 @@ class ABSL_LOCKABLE Mutex {
bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
return gpr_mu_trylock(&mu_) != 0;
}
+ void AssertHeld() ABSL_ASSERT_EXCLUSIVE_LOCK() {}
private:
gpr_mu mu_;
@@ -145,33 +146,6 @@ class CondVar {
#endif // GPR_ABSEIL_SYNC
-template <typename Predicate>
-static void WaitUntil(CondVar* cv, Mutex* mu, Predicate pred) {
- while (!pred()) {
- cv->Wait(mu);
- }
-}
-
-// Returns true iff we timed-out
-template <typename Predicate>
-static bool WaitUntilWithTimeout(CondVar* cv, Mutex* mu, Predicate pred,
- absl::Duration timeout) {
- while (!pred()) {
- if (cv->WaitWithTimeout(mu, timeout)) return true;
- }
- return false;
-}
-
-// Returns true iff we timed-out
-template <typename Predicate>
-static bool WaitUntilWithDeadline(CondVar* cv, Mutex* mu, Predicate pred,
- absl::Time deadline) {
- while (!pred()) {
- if (cv->WaitWithDeadline(mu, deadline)) return true;
- }
- return false;
-}
-
// Deprecated. Prefer MutexLock
class MutexLockForGprMu {
public:
diff --git a/grpc/src/core/lib/gprpp/table.h b/grpc/src/core/lib/gprpp/table.h
new file mode 100644
index 00000000..d42f36db
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/table.h
@@ -0,0 +1,434 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TABLE_H
+#define GRPC_CORE_LIB_GPRPP_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/bitset.h"
+
+namespace grpc_core {
+
+// Meta-programming detail types to aid in building up a Table
+namespace table_detail {
+
+// A tuple-like type that contains manually constructed elements.
+template <typename... Ts>
+struct Elements;
+template <typename T, typename... Ts>
+struct Elements<T, Ts...> : Elements<Ts...> {
+ union U {
+ U() {}
+ ~U() {}
+ GPR_NO_UNIQUE_ADDRESS T x;
+ };
+ U u;
+};
+template <>
+struct Elements<> {};
+
+// Element accessor for Elements<>
+// Provides a static method f that returns a pointer to the value of element I
+// for Elements<Ts...>
+template <size_t I, typename... Ts>
+struct GetElem;
+
+template <typename T, typename... Ts>
+struct GetElem<0, T, Ts...> {
+ static T* f(Elements<T, Ts...>* e) { return &e->u.x; }
+ static const T* f(const Elements<T, Ts...>* e) { return &e->u.x; }
+};
+
+template <size_t I, typename T, typename... Ts>
+struct GetElem<I, T, Ts...> {
+ static auto f(Elements<T, Ts...>* e)
+ -> decltype(GetElem<I - 1, Ts...>::f(e)) {
+ return GetElem<I - 1, Ts...>::f(e);
+ }
+ static auto f(const Elements<T, Ts...>* e)
+ -> decltype(GetElem<I - 1, Ts...>::f(e)) {
+ return GetElem<I - 1, Ts...>::f(e);
+ }
+};
+
+// CountIncludedStruct is the backing for the CountIncluded function below.
+// Sets a member constant N to the number of times Needle is in Haystack.
+template <typename Needle, typename... Haystack>
+struct CountIncludedStruct;
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct CountIncludedStruct<Needle, Straw, RestOfHaystack...> {
+ static constexpr size_t N =
+ static_cast<size_t>(std::is_same<Needle, Straw>::value) +
+ CountIncludedStruct<Needle, RestOfHaystack...>::N;
+};
+template <typename Needle>
+struct CountIncludedStruct<Needle> {
+ static constexpr size_t N = 0;
+};
+// Returns the number of times Needle is in Haystack.
+template <typename Needle, typename... Haystack>
+constexpr size_t CountIncluded() {
+ return CountIncludedStruct<Needle, Haystack...>::N;
+}
+
+// IndexOfStruct is the backing for IndexOf below.
+// Set a member constant N to the index of Needle in Haystack.
+// Ignored should be void always, and is used for enable_if_t.
+template <typename Ignored, typename Needle, typename... Haystack>
+struct IndexOfStruct;
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct IndexOfStruct<absl::enable_if_t<std::is_same<Needle, Straw>::value>,
+ Needle, Straw, RestOfHaystack...> {
+ // The first element is the one we're looking for. Done.
+ static constexpr size_t N = 0;
+};
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct IndexOfStruct<absl::enable_if_t<!std::is_same<Needle, Straw>::value>,
+ Needle, Straw, RestOfHaystack...> {
+ // The first element is not the one we're looking for, recurse looking at the
+ // tail, and sum the number of recursions.
+ static constexpr size_t N =
+ 1 + IndexOfStruct<void, Needle, RestOfHaystack...>::N;
+};
+// Return the index of Needle in Haystack.
+// Guarded by CountIncluded to ensure that the return type is unambiguous.
+// If you got here from a compiler error using Table, it's likely that you've
+// used the type-based accessor/mutators, but the type you're using is repeated
+// more than once in the Table type arguments. Consider either using the indexed
+// accessor/mutator variants, or eliminating the ambiguity in type resolution.
+template <typename Needle, typename... Haystack>
+constexpr absl::enable_if_t<CountIncluded<Needle, Haystack...>() == 1, size_t>
+IndexOf() {
+ return IndexOfStruct<void, Needle, Haystack...>::N;
+}
+
+// TypeIndexStruct is the backing for TypeIndex below.
+// Sets member type Type to the type at index I in Ts.
+// Implemented as a simple type recursion.
+template <size_t I, typename... Ts>
+struct TypeIndexStruct;
+template <typename T, typename... Ts>
+struct TypeIndexStruct<0, T, Ts...> {
+ using Type = T;
+};
+template <size_t I, typename T, typename... Ts>
+struct TypeIndexStruct<I, T, Ts...> : TypeIndexStruct<I - 1, Ts...> {};
+// TypeIndex is the type at index I in Ts.
+template <size_t I, typename... Ts>
+using TypeIndex = typename TypeIndexStruct<I, Ts...>::Type;
+
+// Helper to call the destructor of p if p is non-null.
+template <typename T>
+void DestructIfNotNull(T* p) {
+ if (p) p->~T();
+}
+
+// Helper function... just ignore the initializer list passed into it.
+// Allows doing 'statements' via parameter pack expansion in C++11 - given
+// template <typename... Ts>:
+// do_these_things({(foo<Ts>(), 1)});
+// will execute foo<T>() for each T in Ts.
+// In this example we also leverage the comma operator to make the resultant
+// type of each statement be a consistant int so that C++ type deduction works
+// as we'd like (note that in the expression (a, 1) in C++, the 'result' of the
+// expression is the value after the right-most ',' -- in this case 1, with a
+// executed as a side effect.
+template <typename T>
+void do_these_things(std::initializer_list<T>) {}
+
+} // namespace table_detail
+
+// A Table<Ts> is much like a tuple<optional<Ts>...> - a set of values that are
+// optionally present. Table efficiently packs the presence bits for size, and
+// provides a slightly more convenient interface.
+template <typename... Ts>
+class Table {
+ // Helper - TypeIndex<I> is the type at index I in Ts
+ template <size_t I>
+ using TypeIndex = table_detail::TypeIndex<I, Ts...>;
+
+ public:
+ // Construct a table with no values set.
+ Table() = default;
+ // Destruct - forwards to the Destruct member with an integer sequence so we
+ // can destruct field-wise.
+ ~Table() { Destruct(absl::make_index_sequence<sizeof...(Ts)>()); }
+
+ // Copy another table
+ Table(const Table& rhs) {
+ // Since we know all fields are clear initially, pass false for or_clear.
+ Copy<false>(absl::make_index_sequence<sizeof...(Ts)>(), rhs);
+ }
+
+ // Copy another table
+ Table& operator=(const Table& rhs) {
+ // Since we may not be all clear, pass true for or_clear to have Copy()
+ // clear newly emptied fields.
+ Copy<true>(absl::make_index_sequence<sizeof...(Ts)>(), rhs);
+ return *this;
+ }
+
+ // Move from another table
+ Table(Table&& rhs) noexcept {
+ // Since we know all fields are clear initially, pass false for or_clear.
+ Move<false>(absl::make_index_sequence<sizeof...(Ts)>(),
+ std::forward<Table>(rhs));
+ }
+
+ // Move from another table
+ Table& operator=(Table&& rhs) noexcept {
+ // Since we may not be all clear, pass true for or_clear to have Move()
+ // clear newly emptied fields.
+ Move<true>(absl::make_index_sequence<sizeof...(Ts)>(),
+ std::forward<Table>(rhs));
+ return *this;
+ }
+
+ // Check if this table has a value for type T.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ bool has() const {
+ return has<index_of<T>()>();
+ }
+
+ // Check if this table has index I.
+ template <size_t I>
+ absl::enable_if_t < I<sizeof...(Ts), bool> has() const {
+ return present_bits_.is_set(I);
+ }
+
+ // Return the value for type T, or nullptr if it is un-set.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ T* get() {
+ return get<index_of<T>()>();
+ }
+
+ // Return the value for type T, or nullptr if it is un-set.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ const T* get() const {
+ return get<index_of<T>()>();
+ }
+
+ // Return the value for index I, or nullptr if it is un-set.
+ template <size_t I>
+ TypeIndex<I>* get() {
+ if (has<I>()) return element_ptr<I>();
+ return nullptr;
+ }
+
+ // Return the value for index I, or nullptr if it is un-set.
+ template <size_t I>
+ const TypeIndex<I>* get() const {
+ if (has<I>()) return element_ptr<I>();
+ return nullptr;
+ }
+
+ // Return the value for type T, default constructing it if it is un-set.
+ template <typename T>
+ T* get_or_create() {
+ return get_or_create<index_of<T>()>();
+ }
+
+ // Return the value for index I, default constructing it if it is un-set.
+ template <size_t I>
+ TypeIndex<I>* get_or_create() {
+ auto* p = element_ptr<I>();
+ if (!set_present<I>(true)) {
+ new (p) TypeIndex<I>();
+ }
+ return element_ptr<I>();
+ }
+
+ // Set the value for type T - using Args as construction arguments.
+ template <typename T, typename... Args>
+ T* set(Args&&... args) {
+ return set<index_of<T>()>(std::forward<Args>(args)...);
+ }
+
+ // Set the value for index I - using Args as construction arguments.
+ template <size_t I, typename... Args>
+ TypeIndex<I>* set(Args&&... args) {
+ auto* p = element_ptr<I>();
+ if (set_present<I>(true)) {
+ TypeIndex<I> replacement(std::forward<Args>(args)...);
+ *p = std::move(replacement);
+ } else {
+ new (p) TypeIndex<I>(std::forward<Args>(args)...);
+ }
+ return p;
+ }
+
+ template <size_t I>
+ TypeIndex<I>* set(TypeIndex<I>&& value) {
+ auto* p = element_ptr<I>();
+ if (set_present<I>(true)) {
+ *p = std::forward<TypeIndex<I>>(value);
+ } else {
+ new (p) TypeIndex<I>(std::forward<TypeIndex<I>>(value));
+ }
+ return p;
+ }
+
+ // Clear the value for type T, leaving it un-set.
+ template <typename T>
+ void clear() {
+ clear<index_of<T>()>();
+ }
+
+ // Clear the value for index I, leaving it un-set.
+ template <size_t I>
+ void clear() {
+ if (set_present<I>(false)) {
+ using T = TypeIndex<I>;
+ element_ptr<I>()->~T();
+ }
+ }
+
+ // Iterate through each set field in the table
+ template <typename F>
+ void ForEach(F f) const {
+ ForEachImpl(std::move(f), absl::make_index_sequence<sizeof...(Ts)>());
+ }
+
+ // Count the number of set fields in the table
+ size_t count() const { return present_bits_.count(); }
+
+ // Check if the table is completely empty
+ bool empty() const { return present_bits_.none(); }
+
+ // Clear all elements in the table.
+ void ClearAll() { ClearAllImpl(absl::make_index_sequence<sizeof...(Ts)>()); }
+
+ private:
+ // Bit field for which elements of the table are set (true) or un-set (false,
+ // the default) -- one bit for each type in Ts.
+ using PresentBits = BitSet<sizeof...(Ts)>;
+ // The tuple-like backing structure for Table.
+ using Elements = table_detail::Elements<Ts...>;
+ // Extractor from Elements
+ template <size_t I>
+ using GetElem = table_detail::GetElem<I, Ts...>;
+
+ // Given a T, return the unambiguous index of it within Ts.
+ template <typename T>
+ static constexpr size_t index_of() {
+ return table_detail::IndexOf<T, Ts...>();
+ }
+
+ // Given an index, return a point to the (maybe uninitialized!) data value at
+ // index I.
+ template <size_t I>
+ TypeIndex<I>* element_ptr() {
+ return GetElem<I>::f(&elements_);
+ }
+
+ // Given an index, return a point to the (maybe uninitialized!) data value at
+ // index I.
+ template <size_t I>
+ const TypeIndex<I>* element_ptr() const {
+ return GetElem<I>::f(&elements_);
+ }
+
+ // Set the present bit to value (if true - value is present/set, if false,
+ // value is un-set). Returns the old value so that calling code can note
+ // transition edges.
+ template <size_t I>
+ bool set_present(bool value) {
+ bool out = present_bits_.is_set(I);
+ present_bits_.set(I, value);
+ return out;
+ }
+
+ // Set the value of index I to the value held in rhs index I if it is set.
+ // If it is unset, if or_clear is true, then clear our value, otherwise do
+ // nothing.
+ template <bool or_clear, size_t I>
+ void CopyIf(const Table& rhs) {
+ if (auto* p = rhs.get<I>()) {
+ set<I>(*p);
+ } else if (or_clear) {
+ clear<I>();
+ }
+ }
+
+ // Set the value of index I to the value moved from rhs index I if it was set.
+ // If it is unset, if or_clear is true, then clear our value, otherwise do
+ // nothing.
+ template <bool or_clear, size_t I>
+ void MoveIf(Table&& rhs) {
+ if (auto* p = rhs.get<I>()) {
+ set<I>(std::move(*p));
+ } else if (or_clear) {
+ clear<I>();
+ }
+ }
+
+ // Call (*f)(value) if that value is in the table.
+ template <size_t I, typename F>
+ void CallIf(F* f) const {
+ if (auto* p = get<I>()) {
+ (*f)(*p);
+ }
+ }
+
+ // For each field (element I=0, 1, ...) if that field is present, call its
+ // destructor.
+ template <size_t... I>
+ void Destruct(absl::index_sequence<I...>) {
+ table_detail::do_these_things<int>(
+ {(table_detail::DestructIfNotNull(get<I>()), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) copy that field into this table -
+ // or_clear as per CopyIf().
+ template <bool or_clear, size_t... I>
+ void Copy(absl::index_sequence<I...>, const Table& rhs) {
+ table_detail::do_these_things<int>({(CopyIf<or_clear, I>(rhs), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) move that field into this table -
+ // or_clear as per MoveIf().
+ template <bool or_clear, size_t... I>
+ void Move(absl::index_sequence<I...>, Table&& rhs) {
+ table_detail::do_these_things<int>(
+ {(MoveIf<or_clear, I>(std::forward<Table>(rhs)), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) if that field is present, call f.
+ template <typename F, size_t... I>
+ void ForEachImpl(F f, absl::index_sequence<I...>) const {
+ table_detail::do_these_things<int>({(CallIf<I>(&f), 1)...});
+ }
+
+ template <size_t... I>
+ void ClearAllImpl(absl::index_sequence<I...>) {
+ table_detail::do_these_things<int>({(clear<I>(), 1)...});
+ }
+
+ // Bit field indicating which elements are set.
+ GPR_NO_UNIQUE_ADDRESS PresentBits present_bits_;
+ // The memory to store the elements themselves.
+ GPR_NO_UNIQUE_ADDRESS Elements elements_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_TABLE_H
diff --git a/grpc/src/core/lib/gprpp/thd_posix.cc b/grpc/src/core/lib/gprpp/thd_posix.cc
index c3449bda..2d522c9b 100644
--- a/grpc/src/core/lib/gprpp/thd_posix.cc
+++ b/grpc/src/core/lib/gprpp/thd_posix.cc
@@ -22,20 +22,20 @@
#ifdef GPR_POSIX_SYNC
-#include "src/core/lib/gprpp/thd.h"
+#include <pthread.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/thd.h"
namespace grpc_core {
namespace {
diff --git a/grpc/src/core/lib/gprpp/thd_windows.cc b/grpc/src/core/lib/gprpp/thd_windows.cc
index fb90afd0..ce1a7539 100644
--- a/grpc/src/core/lib/gprpp/thd_windows.cc
+++ b/grpc/src/core/lib/gprpp/thd_windows.cc
@@ -22,22 +22,15 @@
#ifdef GPR_WINDOWS
-#include "src/core/lib/gprpp/thd.h"
+#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/thd_id.h>
-#include <string.h>
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/memory.h"
-
-#if defined(_MSC_VER)
-#define thread_local __declspec(thread)
-#elif defined(__GNUC__)
-#define thread_local __thread
-#else
-#error "Unknown compiler - please file a bug report"
-#endif
+#include "src/core/lib/gprpp/thd.h"
namespace {
class ThreadInternalsWindows;
@@ -49,7 +42,7 @@ struct thd_info {
bool joinable; /* whether it is joinable */
};
-thread_local struct thd_info* g_thd_info;
+GPR_THREAD_LOCAL(struct thd_info*) g_thd_info;
class ThreadInternalsWindows
: public grpc_core::internal::ThreadInternalsInterface {
diff --git a/grpc/src/core/lib/gprpp/time.cc b/grpc/src/core/lib/gprpp/time.cc
new file mode 100644
index 00000000..c7f02d5c
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/time.cc
@@ -0,0 +1,198 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/gprpp/time.h"
+
+#include <atomic>
+#include <cstdint>
+#include <limits>
+#include <string>
+
+#include <grpc/impl/codegen/gpr_types.h>
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+namespace {
+
+std::atomic<int64_t> g_process_epoch_seconds;
+std::atomic<gpr_cycle_counter> g_process_epoch_cycles;
+
+GPR_ATTRIBUTE_NOINLINE std::pair<int64_t, gpr_cycle_counter> InitTime() {
+ gpr_cycle_counter cycles_start = 0;
+ gpr_cycle_counter cycles_end = 0;
+ int64_t process_epoch_seconds = 0;
+
+ // Check the current time... if we end up with zero, try again after 100ms.
+ // If it doesn't advance after sleeping for 1100ms, crash the process.
+ for (int i = 0; i < 11; i++) {
+ cycles_start = gpr_get_cycle_counter();
+ gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
+ cycles_end = gpr_get_cycle_counter();
+ process_epoch_seconds = now.tv_sec - 1;
+ if (process_epoch_seconds != 0) {
+ break;
+ }
+ gpr_sleep_until(gpr_time_add(now, gpr_time_from_millis(100, GPR_TIMESPAN)));
+ }
+
+ // Time does not seem to be increasing from zero...
+ GPR_ASSERT(process_epoch_seconds != 0);
+ int64_t expected = 0;
+ gpr_cycle_counter process_epoch_cycles = (cycles_start + cycles_end) / 2;
+ GPR_ASSERT(process_epoch_cycles != 0);
+ if (!g_process_epoch_seconds.compare_exchange_strong(
+ expected, process_epoch_seconds, std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
+ process_epoch_seconds = expected;
+ do {
+ process_epoch_cycles =
+ g_process_epoch_cycles.load(std::memory_order_relaxed);
+ } while (process_epoch_cycles == 0);
+ } else {
+ g_process_epoch_cycles.store(process_epoch_cycles,
+ std::memory_order_relaxed);
+ }
+ return std::make_pair(process_epoch_seconds, process_epoch_cycles);
+}
+
+gpr_timespec StartTime() {
+ int64_t sec = g_process_epoch_seconds.load(std::memory_order_relaxed);
+ if (GPR_UNLIKELY(sec == 0)) sec = InitTime().first;
+ return {sec, 0, GPR_CLOCK_MONOTONIC};
+}
+
+gpr_cycle_counter StartCycleCounter() {
+ gpr_cycle_counter cycles =
+ g_process_epoch_cycles.load(std::memory_order_relaxed);
+ if (GPR_UNLIKELY(cycles == 0)) cycles = InitTime().second;
+ return cycles;
+}
+
+gpr_timespec MillisecondsAsTimespec(int64_t millis, gpr_clock_type clock_type) {
+ // special-case infinities as Timestamp can be 32bit on some
+ // platforms while gpr_time_from_millis always takes an int64_t.
+ if (millis == std::numeric_limits<int64_t>::max()) {
+ return gpr_inf_future(clock_type);
+ }
+ if (millis == std::numeric_limits<int64_t>::min()) {
+ return gpr_inf_past(clock_type);
+ }
+
+ if (clock_type == GPR_TIMESPAN) {
+ return gpr_time_from_millis(millis, GPR_TIMESPAN);
+ }
+ return gpr_time_add(gpr_convert_clock_type(StartTime(), clock_type),
+ gpr_time_from_millis(millis, GPR_TIMESPAN));
+}
+
+int64_t TimespanToMillisRoundUp(gpr_timespec ts) {
+ GPR_ASSERT(ts.clock_type == GPR_TIMESPAN);
+ double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
+ static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS +
+ static_cast<double>(GPR_NS_PER_SEC - 1) /
+ static_cast<double>(GPR_NS_PER_SEC);
+ if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) {
+ return std::numeric_limits<int64_t>::min();
+ }
+ if (x >= static_cast<double>(std::numeric_limits<int64_t>::max())) {
+ return std::numeric_limits<int64_t>::max();
+ }
+ return static_cast<int64_t>(x);
+}
+
+int64_t TimespanToMillisRoundDown(gpr_timespec ts) {
+ GPR_ASSERT(ts.clock_type == GPR_TIMESPAN);
+ double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
+ static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS;
+ if (x <= static_cast<double>(std::numeric_limits<int64_t>::min())) {
+ return std::numeric_limits<int64_t>::min();
+ }
+ if (x >= static_cast<double>(std::numeric_limits<int64_t>::max())) {
+ return std::numeric_limits<int64_t>::max();
+ }
+ return static_cast<int64_t>(x);
+}
+
+} // namespace
+
+Timestamp Timestamp::FromTimespecRoundUp(gpr_timespec ts) {
+ return FromMillisecondsAfterProcessEpoch(TimespanToMillisRoundUp(gpr_time_sub(
+ gpr_convert_clock_type(ts, GPR_CLOCK_MONOTONIC), StartTime())));
+}
+
+Timestamp Timestamp::FromTimespecRoundDown(gpr_timespec ts) {
+ return FromMillisecondsAfterProcessEpoch(
+ TimespanToMillisRoundDown(gpr_time_sub(
+ gpr_convert_clock_type(ts, GPR_CLOCK_MONOTONIC), StartTime())));
+}
+
+Timestamp Timestamp::FromCycleCounterRoundUp(gpr_cycle_counter c) {
+ return Timestamp::FromMillisecondsAfterProcessEpoch(
+ TimespanToMillisRoundUp(gpr_cycle_counter_sub(c, StartCycleCounter())));
+}
+
+Timestamp Timestamp::FromCycleCounterRoundDown(gpr_cycle_counter c) {
+ return Timestamp::FromMillisecondsAfterProcessEpoch(
+ TimespanToMillisRoundDown(gpr_cycle_counter_sub(c, StartCycleCounter())));
+}
+
+gpr_timespec Timestamp::as_timespec(gpr_clock_type clock_type) const {
+ return MillisecondsAsTimespec(millis_, clock_type);
+}
+
+std::string Timestamp::ToString() const {
+ if (millis_ == std::numeric_limits<int64_t>::max()) {
+ return "@∞";
+ }
+ if (millis_ == std::numeric_limits<int64_t>::min()) {
+ return "@-∞";
+ }
+ return "@" + std::to_string(millis_) + "ms";
+}
+
+gpr_timespec Duration::as_timespec() const {
+ return MillisecondsAsTimespec(millis_, GPR_TIMESPAN);
+}
+
+Duration Duration::FromTimespec(gpr_timespec t) {
+ return Duration::Milliseconds(TimespanToMillisRoundUp(t));
+}
+
+std::string Duration::ToString() const {
+ if (millis_ == std::numeric_limits<int64_t>::max()) {
+ return "∞";
+ }
+ if (millis_ == std::numeric_limits<int64_t>::min()) {
+ return "-∞";
+ }
+ return std::to_string(millis_) + "ms";
+}
+
+void TestOnlySetProcessEpoch(gpr_timespec epoch) {
+ g_process_epoch_seconds.store(
+ gpr_convert_clock_type(epoch, GPR_CLOCK_MONOTONIC).tv_sec);
+}
+
+std::ostream& operator<<(std::ostream& out, Timestamp timestamp) {
+ return out << timestamp.ToString();
+}
+
+std::ostream& operator<<(std::ostream& out, Duration duration) {
+ return out << duration.ToString();
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/gprpp/time.h b/grpc/src/core/lib/gprpp/time.h
new file mode 100644
index 00000000..d4eacc14
--- /dev/null
+++ b/grpc/src/core/lib/gprpp/time.h
@@ -0,0 +1,292 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TIME_H
+#define GRPC_CORE_LIB_GPRPP_TIME_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+#include <cstdint>
+#include <limits>
+#include <ostream>
+#include <string>
+
+#include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/time_precise.h"
+#include "src/core/lib/gpr/useful.h"
+
+namespace grpc_core {
+
+namespace time_detail {
+
+inline int64_t MillisAdd(int64_t a, int64_t b) {
+ if (a == std::numeric_limits<int64_t>::max() ||
+ b == std::numeric_limits<int64_t>::max()) {
+ return std::numeric_limits<int64_t>::max();
+ }
+ if (a == std::numeric_limits<int64_t>::min() ||
+ b == std::numeric_limits<int64_t>::min()) {
+ return std::numeric_limits<int64_t>::min();
+ }
+ return SaturatingAdd(a, b);
+}
+
+constexpr inline int64_t MillisMul(int64_t millis, int64_t mul) {
+ return millis >= std::numeric_limits<int64_t>::max() / mul
+ ? std::numeric_limits<int64_t>::max()
+ : millis <= std::numeric_limits<int64_t>::min() / mul
+ ? std::numeric_limits<int64_t>::min()
+ : millis * mul;
+}
+
+} // namespace time_detail
+
+class Duration;
+
+// Timestamp represents a discrete point in time.
+class Timestamp {
+ public:
+ constexpr Timestamp() = default;
+ // Constructs a Timestamp from a gpr_timespec.
+ static Timestamp FromTimespecRoundDown(gpr_timespec t);
+ static Timestamp FromTimespecRoundUp(gpr_timespec t);
+
+ // Construct a Timestamp from a gpr_cycle_counter.
+ static Timestamp FromCycleCounterRoundUp(gpr_cycle_counter c);
+ static Timestamp FromCycleCounterRoundDown(gpr_cycle_counter c);
+
+ static constexpr Timestamp FromMillisecondsAfterProcessEpoch(int64_t millis) {
+ return Timestamp(millis);
+ }
+
+ static constexpr Timestamp ProcessEpoch() { return Timestamp(0); }
+
+ static constexpr Timestamp InfFuture() {
+ return Timestamp(std::numeric_limits<int64_t>::max());
+ }
+
+ static constexpr Timestamp InfPast() {
+ return Timestamp(std::numeric_limits<int64_t>::min());
+ }
+
+ constexpr bool operator==(Timestamp other) const {
+ return millis_ == other.millis_;
+ }
+ constexpr bool operator!=(Timestamp other) const {
+ return millis_ != other.millis_;
+ }
+ constexpr bool operator<(Timestamp other) const {
+ return millis_ < other.millis_;
+ }
+ constexpr bool operator<=(Timestamp other) const {
+ return millis_ <= other.millis_;
+ }
+ constexpr bool operator>(Timestamp other) const {
+ return millis_ > other.millis_;
+ }
+ constexpr bool operator>=(Timestamp other) const {
+ return millis_ >= other.millis_;
+ }
+ Timestamp& operator+=(Duration duration);
+
+ bool is_process_epoch() const { return millis_ == 0; }
+
+ uint64_t milliseconds_after_process_epoch() const { return millis_; }
+
+ gpr_timespec as_timespec(gpr_clock_type type) const;
+
+ std::string ToString() const;
+
+ private:
+ explicit constexpr Timestamp(int64_t millis) : millis_(millis) {}
+
+ int64_t millis_ = 0;
+};
+
+// Duration represents a span of time.
+class Duration {
+ public:
+ constexpr Duration() noexcept : millis_(0) {}
+
+ static Duration FromTimespec(gpr_timespec t);
+ static Duration FromSecondsAndNanoseconds(int64_t seconds, int32_t nanos);
+ static Duration FromSecondsAsDouble(double seconds);
+
+ static constexpr Duration Zero() { return Duration(0); }
+
+ // Smallest representatable positive duration.
+ static constexpr Duration Epsilon() { return Duration(1); }
+
+ static constexpr Duration NegativeInfinity() {
+ return Duration(std::numeric_limits<int64_t>::min());
+ }
+
+ static constexpr Duration Infinity() {
+ return Duration(std::numeric_limits<int64_t>::max());
+ }
+
+ static constexpr Duration Hours(int64_t hours) {
+ return Minutes(time_detail::MillisMul(hours, 60));
+ }
+
+ static constexpr Duration Minutes(int64_t minutes) {
+ return Seconds(time_detail::MillisMul(minutes, 60));
+ }
+
+ static constexpr Duration Seconds(int64_t seconds) {
+ return Milliseconds(time_detail::MillisMul(seconds, GPR_MS_PER_SEC));
+ }
+
+ static constexpr Duration Milliseconds(int64_t millis) {
+ return Duration(millis);
+ }
+
+ static constexpr Duration MicrosecondsRoundDown(int64_t micros) {
+ return Duration(micros / GPR_US_PER_MS);
+ }
+
+ static constexpr Duration NanosecondsRoundDown(int64_t nanos) {
+ return Duration(nanos / GPR_NS_PER_MS);
+ }
+
+ static constexpr Duration MicrosecondsRoundUp(int64_t micros) {
+ return Duration(micros / GPR_US_PER_MS + (micros % GPR_US_PER_MS != 0));
+ }
+
+ static constexpr Duration NanosecondsRoundUp(int64_t nanos) {
+ return Duration(nanos / GPR_NS_PER_MS + (nanos % GPR_NS_PER_MS != 0));
+ }
+
+ constexpr bool operator==(Duration other) const {
+ return millis_ == other.millis_;
+ }
+ constexpr bool operator!=(Duration other) const {
+ return millis_ != other.millis_;
+ }
+ constexpr bool operator<(Duration other) const {
+ return millis_ < other.millis_;
+ }
+ constexpr bool operator<=(Duration other) const {
+ return millis_ <= other.millis_;
+ }
+ constexpr bool operator>(Duration other) const {
+ return millis_ > other.millis_;
+ }
+ constexpr bool operator>=(Duration other) const {
+ return millis_ >= other.millis_;
+ }
+ Duration& operator/=(int64_t divisor) {
+ if (millis_ == std::numeric_limits<int64_t>::max()) {
+ *this = divisor < 0 ? NegativeInfinity() : Infinity();
+ } else if (millis_ == std::numeric_limits<int64_t>::min()) {
+ *this = divisor < 0 ? Infinity() : NegativeInfinity();
+ } else {
+ millis_ /= divisor;
+ }
+ return *this;
+ }
+ Duration& operator+=(Duration other) {
+ millis_ += other.millis_;
+ return *this;
+ }
+
+ constexpr int64_t millis() const { return millis_; }
+ double seconds() const { return static_cast<double>(millis_) / 1000.0; }
+
+ gpr_timespec as_timespec() const;
+
+ std::string ToString() const;
+
+ private:
+ explicit constexpr Duration(int64_t millis) : millis_(millis) {}
+
+ int64_t millis_;
+};
+
+inline Duration operator+(Duration lhs, Duration rhs) {
+ return Duration::Milliseconds(
+ time_detail::MillisAdd(lhs.millis(), rhs.millis()));
+}
+
+inline Duration operator-(Duration lhs, Duration rhs) {
+ return Duration::Milliseconds(
+ time_detail::MillisAdd(lhs.millis(), -rhs.millis()));
+}
+
+inline Timestamp operator+(Timestamp lhs, Duration rhs) {
+ return Timestamp::FromMillisecondsAfterProcessEpoch(time_detail::MillisAdd(
+ lhs.milliseconds_after_process_epoch(), rhs.millis()));
+}
+
+inline Timestamp operator-(Timestamp lhs, Duration rhs) {
+ return Timestamp::FromMillisecondsAfterProcessEpoch(time_detail::MillisAdd(
+ lhs.milliseconds_after_process_epoch(), -rhs.millis()));
+}
+
+inline Timestamp operator+(Duration lhs, Timestamp rhs) { return rhs + lhs; }
+
+inline Duration operator-(Timestamp lhs, Timestamp rhs) {
+ return Duration::Milliseconds(
+ time_detail::MillisAdd(lhs.milliseconds_after_process_epoch(),
+ -rhs.milliseconds_after_process_epoch()));
+}
+
+inline Duration operator*(Duration lhs, double rhs) {
+ if (lhs == Duration::Infinity()) {
+ return rhs < 0 ? Duration::NegativeInfinity() : Duration::Infinity();
+ }
+ if (lhs == Duration::NegativeInfinity()) {
+ return rhs < 0 ? Duration::Infinity() : Duration::NegativeInfinity();
+ }
+ return Duration::FromSecondsAsDouble(lhs.millis() * rhs / 1000.0);
+}
+
+inline Duration operator*(double lhs, Duration rhs) { return rhs * lhs; }
+
+inline Duration operator/(Duration lhs, int64_t rhs) {
+ lhs /= rhs;
+ return lhs;
+}
+
+inline Duration Duration::FromSecondsAndNanoseconds(int64_t seconds,
+ int32_t nanos) {
+ return Seconds(seconds) + NanosecondsRoundDown(nanos);
+}
+
+inline Duration Duration::FromSecondsAsDouble(double seconds) {
+ double millis = seconds * 1000.0;
+ if (millis >= static_cast<double>(std::numeric_limits<int64_t>::max())) {
+ return Infinity();
+ }
+ if (millis <= static_cast<double>(std::numeric_limits<int64_t>::min())) {
+ return NegativeInfinity();
+ }
+ return Milliseconds(static_cast<int64_t>(millis));
+}
+
+inline Timestamp& Timestamp::operator+=(Duration duration) {
+ return *this = (*this + duration);
+}
+
+void TestOnlySetProcessEpoch(gpr_timespec epoch);
+
+std::ostream& operator<<(std::ostream& out, Timestamp timestamp);
+std::ostream& operator<<(std::ostream& out, Duration duration);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_TIME_H
diff --git a/grpc/src/core/lib/gprpp/time_util.cc b/grpc/src/core/lib/gprpp/time_util.cc
index d3aa25ae..84795032 100644
--- a/grpc/src/core/lib/gprpp/time_util.cc
+++ b/grpc/src/core/lib/gprpp/time_util.cc
@@ -16,10 +16,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-
#include "src/core/lib/gprpp/time_util.h"
+#include <grpc/support/log.h>
+
namespace grpc_core {
gpr_timespec ToGprTimeSpec(absl::Duration duration) {
diff --git a/grpc/src/core/lib/gprpp/time_util.h b/grpc/src/core/lib/gprpp/time_util.h
index 4ae4a407..226e4051 100644
--- a/grpc/src/core/lib/gprpp/time_util.h
+++ b/grpc/src/core/lib/gprpp/time_util.h
@@ -19,10 +19,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/time.h>
-
#include "absl/time/time.h"
+#include <grpc/support/time.h>
+
namespace grpc_core {
// Converts absl::Duration to gpr_timespec(GPR_TIMESPAN)
diff --git a/grpc/src/core/lib/http/format_request.cc b/grpc/src/core/lib/http/format_request.cc
index 947b19cb..685d854a 100644
--- a/grpc/src/core/lib/http/format_request.cc
+++ b/grpc/src/core/lib/http/format_request.cc
@@ -32,48 +32,49 @@
#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,
+static void fill_common_header(const grpc_http_request* request,
+ const char* host, const char* path,
bool connection_close,
std::vector<std::string>* 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(path);
+ buf->push_back(" HTTP/1.1\r\n");
buf->push_back("Host: ");
- buf->push_back(request->host);
+ buf->push_back(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);
+ for (size_t i = 0; i < request->hdr_count; i++) {
+ buf->push_back(request->hdrs[i].key);
buf->push_back(": ");
- buf->push_back(request->http.hdrs[i].value);
+ buf->push_back(request->hdrs[i].value);
buf->push_back("\r\n");
}
}
-grpc_slice grpc_httpcli_format_get_request(
- const grpc_httpcli_request* request) {
+grpc_slice grpc_httpcli_format_get_request(const grpc_http_request* request,
+ const char* host, const char* path) {
std::vector<std::string> out;
out.push_back("GET ");
- fill_common_header(request, true, &out);
+ fill_common_header(request, host, path, true, &out);
out.push_back("\r\n");
std::string req = 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) {
+grpc_slice grpc_httpcli_format_post_request(const grpc_http_request* request,
+ const char* host,
+ const char* path) {
std::vector<std::string> out;
out.push_back("POST ");
- fill_common_header(request, true, &out);
- if (body_bytes != nullptr) {
+ fill_common_header(request, host, path, true, &out);
+ if (request->body != 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) {
+ for (size_t i = 0; i < request->hdr_count; i++) {
+ if (strcmp(request->hdrs[i].key, "Content-Type") == 0) {
has_content_type = true;
break;
}
@@ -81,22 +82,25 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
if (!has_content_type) {
out.push_back("Content-Type: text/plain\r\n");
}
- out.push_back(absl::StrFormat("Content-Length: %lu\r\n",
- static_cast<unsigned long>(body_size)));
+ out.push_back(
+ absl::StrFormat("Content-Length: %lu\r\n",
+ static_cast<unsigned long>(request->body_length)));
}
out.push_back("\r\n");
std::string req = absl::StrJoin(out, "");
- if (body_bytes != nullptr) {
- absl::StrAppend(&req, absl::string_view(body_bytes, body_size));
+ if (request->body != nullptr) {
+ absl::StrAppend(&req,
+ absl::string_view(request->body, request->body_length));
}
return grpc_slice_from_copied_buffer(req.data(), req.size());
}
-grpc_slice grpc_httpcli_format_connect_request(
- const grpc_httpcli_request* request) {
+grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request,
+ const char* host,
+ const char* path) {
std::vector<std::string> out;
out.push_back("CONNECT ");
- fill_common_header(request, false, &out);
+ fill_common_header(request, host, path, false, &out);
out.push_back("\r\n");
std::string req = absl::StrJoin(out, "");
return grpc_slice_from_copied_buffer(req.data(), req.size());
diff --git a/grpc/src/core/lib/http/format_request.h b/grpc/src/core/lib/http/format_request.h
index bcc332fe..440bde90 100644
--- a/grpc/src/core/lib/http/format_request.h
+++ b/grpc/src/core/lib/http/format_request.h
@@ -22,13 +22,15 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/http/httpcli.h"
-grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request* request);
-grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request* request,
- const char* body_bytes,
- size_t body_size);
-grpc_slice grpc_httpcli_format_connect_request(
- const grpc_httpcli_request* request);
+grpc_slice grpc_httpcli_format_get_request(const grpc_http_request* request,
+ const char* host, const char* path);
+grpc_slice grpc_httpcli_format_post_request(const grpc_http_request* request,
+ const char* host, const char* path);
+grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request,
+ const char* host,
+ const char* path);
#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */
diff --git a/grpc/src/core/lib/http/httpcli.cc b/grpc/src/core/lib/http/httpcli.cc
index e3d2fbef..2bc598b7 100644
--- a/grpc/src/core/lib/http/httpcli.cc
+++ b/grpc/src/core/lib/http/httpcli.cc
@@ -24,8 +24,11 @@
#include <string>
+#include "absl/functional/bind_front.h"
#include "absl/strings/str_format.h"
+#include "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>
@@ -40,267 +43,354 @@
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+namespace {
+
+grpc_httpcli_get_override g_get_override;
+grpc_httpcli_post_override g_post_override;
+void (*g_test_only_on_handshake_done_intercept)(HttpRequest* req);
+
+} // namespace
+
+OrphanablePtr<HttpRequest> HttpRequest::Get(
+ URI uri, const grpc_channel_args* channel_args,
+ grpc_polling_entity* pollent, const grpc_http_request* request,
+ Timestamp deadline, grpc_closure* on_done, grpc_http_response* response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds) {
+ absl::optional<std::function<void()>> test_only_generate_response;
+ if (g_get_override != nullptr) {
+ test_only_generate_response = [request, uri, deadline, on_done,
+ response]() {
+ // Note that capturing request here assumes it will remain alive
+ // until after Start is called. This avoids making a copy as this
+ // code path is only used for test mocks.
+ g_get_override(request, uri.authority().c_str(), uri.path().c_str(),
+ deadline, on_done, response);
+ };
+ }
+ std::string name =
+ absl::StrFormat("HTTP:GET:%s:%s", uri.authority(), uri.path());
+ const grpc_slice request_text = grpc_httpcli_format_get_request(
+ request, uri.authority().c_str(), uri.path().c_str());
+ return MakeOrphanable<HttpRequest>(
+ std::move(uri), request_text, response, deadline, channel_args, on_done,
+ pollent, name.c_str(), std::move(test_only_generate_response),
+ std::move(channel_creds));
+}
-struct internal_request {
- grpc_slice request_text;
- grpc_http_parser parser;
- grpc_resolved_addresses* addresses;
- size_t next_address;
- grpc_endpoint* ep;
- char* host;
- char* ssl_host_override;
- grpc_millis deadline;
- int have_read_byte;
- const grpc_httpcli_handshaker* handshaker;
- grpc_closure* on_done;
- grpc_httpcli_context* context;
- grpc_polling_entity* pollent;
- grpc_iomgr_object iomgr_obj;
- grpc_slice_buffer incoming;
- grpc_slice_buffer outgoing;
- grpc_closure on_read;
- grpc_closure done_write;
- grpc_closure connected;
- grpc_error_handle overall_error;
- grpc_resource_quota* resource_quota;
-};
-static grpc_httpcli_get_override g_get_override = nullptr;
-static grpc_httpcli_post_override g_post_override = nullptr;
-
-static void plaintext_handshake(void* arg, grpc_endpoint* endpoint,
- const char* /*host*/, grpc_millis /*deadline*/,
- void (*on_done)(void* arg,
- grpc_endpoint* endpoint)) {
- on_done(arg, endpoint);
+OrphanablePtr<HttpRequest> HttpRequest::Post(
+ URI uri, const grpc_channel_args* channel_args,
+ grpc_polling_entity* pollent, const grpc_http_request* request,
+ Timestamp deadline, grpc_closure* on_done, grpc_http_response* response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds) {
+ absl::optional<std::function<void()>> test_only_generate_response;
+ if (g_post_override != nullptr) {
+ test_only_generate_response = [request, uri, deadline, on_done,
+ response]() {
+ g_post_override(request, uri.authority().c_str(), uri.path().c_str(),
+ request->body, request->body_length, deadline, on_done,
+ response);
+ };
+ }
+ std::string name =
+ absl::StrFormat("HTTP:POST:%s:%s", uri.authority(), uri.path());
+ const grpc_slice request_text = grpc_httpcli_format_post_request(
+ request, uri.authority().c_str(), uri.path().c_str());
+ return MakeOrphanable<HttpRequest>(
+ std::move(uri), request_text, response, deadline, channel_args, on_done,
+ pollent, name.c_str(), std::move(test_only_generate_response),
+ std::move(channel_creds));
}
-const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
- plaintext_handshake};
+void HttpRequest::SetOverride(grpc_httpcli_get_override get,
+ grpc_httpcli_post_override post) {
+ g_get_override = get;
+ g_post_override = post;
+}
-void grpc_httpcli_context_init(grpc_httpcli_context* context) {
- context->pollset_set = grpc_pollset_set_create();
+void HttpRequest::TestOnlySetOnHandshakeDoneIntercept(
+ void (*intercept)(HttpRequest* req)) {
+ g_test_only_on_handshake_done_intercept = intercept;
}
-void grpc_httpcli_context_destroy(grpc_httpcli_context* context) {
- grpc_pollset_set_destroy(context->pollset_set);
+HttpRequest::HttpRequest(
+ URI uri, const grpc_slice& request_text, grpc_http_response* response,
+ Timestamp deadline, const grpc_channel_args* channel_args,
+ grpc_closure* on_done, grpc_polling_entity* pollent, const char* name,
+ absl::optional<std::function<void()>> test_only_generate_response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds)
+ : uri_(std::move(uri)),
+ request_text_(request_text),
+ deadline_(deadline),
+ channel_args_(CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(channel_args)),
+ channel_creds_(std::move(channel_creds)),
+ on_done_(on_done),
+ resource_quota_(ResourceQuotaFromChannelArgs(channel_args_)),
+ pollent_(pollent),
+ pollset_set_(grpc_pollset_set_create()),
+ test_only_generate_response_(std::move(test_only_generate_response)) {
+ grpc_http_parser_init(&parser_, GRPC_HTTP_RESPONSE, response);
+ grpc_slice_buffer_init(&incoming_);
+ grpc_slice_buffer_init(&outgoing_);
+ grpc_iomgr_register_object(&iomgr_obj_, name);
+ GRPC_CLOSURE_INIT(&on_read_, OnRead, this, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&continue_on_read_after_schedule_on_exec_ctx_,
+ ContinueOnReadAfterScheduleOnExecCtx, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done_write_, DoneWrite, this, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&continue_done_write_after_schedule_on_exec_ctx_,
+ ContinueDoneWriteAfterScheduleOnExecCtx, this,
+ grpc_schedule_on_exec_ctx);
+ GPR_ASSERT(pollent);
+ grpc_polling_entity_add_to_pollset_set(pollent, pollset_set_);
+ // Create the DNS resolver. We'll start resolving when Start is called.
+ dns_request_ = GetDNSResolver()->ResolveName(
+ uri_.authority(), uri_.scheme(), pollset_set_,
+ absl::bind_front(&HttpRequest::OnResolved, this));
}
-static void next_address(internal_request* req, grpc_error_handle due_to_error);
+HttpRequest::~HttpRequest() {
+ grpc_channel_args_destroy(channel_args_);
+ grpc_http_parser_destroy(&parser_);
+ if (own_endpoint_ && ep_ != nullptr) {
+ grpc_endpoint_destroy(ep_);
+ }
+ grpc_slice_unref_internal(request_text_);
+ grpc_iomgr_unregister_object(&iomgr_obj_);
+ grpc_slice_buffer_destroy_internal(&incoming_);
+ grpc_slice_buffer_destroy_internal(&outgoing_);
+ GRPC_ERROR_UNREF(overall_error_);
+ grpc_pollset_set_destroy(pollset_set_);
+}
-static void finish(internal_request* req, grpc_error_handle error) {
- grpc_polling_entity_del_from_pollset_set(req->pollent,
- req->context->pollset_set);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, req->on_done, error);
- grpc_http_parser_destroy(&req->parser);
- if (req->addresses != nullptr) {
- grpc_resolved_addresses_destroy(req->addresses);
+void HttpRequest::Start() {
+ MutexLock lock(&mu_);
+ if (test_only_generate_response_.has_value()) {
+ test_only_generate_response_.value()();
+ return;
}
- if (req->ep != nullptr) {
- grpc_endpoint_destroy(req->ep);
+ Ref().release(); // ref held by pending DNS resolution
+ dns_request_->Start();
+}
+
+void HttpRequest::Orphan() {
+ {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(!cancelled_);
+ cancelled_ = true;
+ dns_request_.reset(); // cancel potentially pending DNS resolution
+ if (connecting_) {
+ // gRPC's TCP connection establishment API doesn't currently have
+ // a mechanism for cancellation. So invoke the user callback now. The TCP
+ // connection will eventually complete (at least within its deadline), and
+ // we'll simply unref ourselves at that point.
+ // TODO(apolcyn): fix this to cancel the TCP connection attempt when
+ // an API to do so exists.
+ Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "HTTP request cancelled during TCP connection establishment",
+ &overall_error_, 1));
+ }
+ if (handshake_mgr_ != nullptr) {
+ handshake_mgr_->Shutdown(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HTTP request cancelled during security handshake"));
+ }
+ if (own_endpoint_ && ep_ != nullptr) {
+ grpc_endpoint_shutdown(
+ ep_, GRPC_ERROR_CREATE_FROM_STATIC_STRING("HTTP request cancelled"));
+ }
}
- grpc_slice_unref_internal(req->request_text);
- gpr_free(req->host);
- gpr_free(req->ssl_host_override);
- grpc_iomgr_unregister_object(&req->iomgr_obj);
- grpc_slice_buffer_destroy_internal(&req->incoming);
- grpc_slice_buffer_destroy_internal(&req->outgoing);
- GRPC_ERROR_UNREF(req->overall_error);
- grpc_resource_quota_unref_internal(req->resource_quota);
- gpr_free(req);
+ Unref();
}
-static void append_error(internal_request* req, grpc_error_handle error) {
- if (req->overall_error == GRPC_ERROR_NONE) {
- req->overall_error =
+void HttpRequest::AppendError(grpc_error_handle error) {
+ if (overall_error_ == GRPC_ERROR_NONE) {
+ overall_error_ =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
}
- grpc_resolved_address* addr = &req->addresses->addrs[req->next_address - 1];
+ const grpc_resolved_address* addr = &addresses_[next_address_ - 1];
std::string 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))));
+ overall_error_ = grpc_error_add_child(
+ overall_error_,
+ grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, addr_text));
}
-static void do_read(internal_request* req) {
- grpc_endpoint_read(req->ep, &req->incoming, &req->on_read, /*urgent=*/true);
-}
-
-static void on_read(void* user_data, grpc_error_handle error) {
- internal_request* req = static_cast<internal_request*>(user_data);
- size_t i;
-
- for (i = 0; i < req->incoming.count; i++) {
- if (GRPC_SLICE_LENGTH(req->incoming.slices[i])) {
- req->have_read_byte = 1;
- grpc_error_handle err = grpc_http_parser_parse(
- &req->parser, req->incoming.slices[i], nullptr);
+void HttpRequest::OnReadInternal(grpc_error_handle error) {
+ for (size_t i = 0; i < incoming_.count; i++) {
+ if (GRPC_SLICE_LENGTH(incoming_.slices[i])) {
+ have_read_byte_ = 1;
+ grpc_error_handle err =
+ grpc_http_parser_parse(&parser_, incoming_.slices[i], nullptr);
if (err != GRPC_ERROR_NONE) {
- finish(req, err);
+ Finish(err);
return;
}
}
}
-
- if (error == GRPC_ERROR_NONE) {
- do_read(req);
- } else if (!req->have_read_byte) {
- next_address(req, GRPC_ERROR_REF(error));
+ if (cancelled_) {
+ Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "HTTP1 request cancelled during read", &overall_error_, 1));
+ } else if (error == GRPC_ERROR_NONE) {
+ DoRead();
+ } else if (!have_read_byte_) {
+ NextAddress(GRPC_ERROR_REF(error));
} else {
- finish(req, grpc_http_parser_eof(&req->parser));
+ Finish(grpc_http_parser_eof(&parser_));
}
}
-static void on_written(internal_request* req) { do_read(req); }
-
-static void done_write(void* arg, grpc_error_handle error) {
- internal_request* req = static_cast<internal_request*>(arg);
- if (error == GRPC_ERROR_NONE) {
- on_written(req);
+void HttpRequest::ContinueDoneWriteAfterScheduleOnExecCtx(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<HttpRequest> req(static_cast<HttpRequest*>(arg));
+ MutexLock lock(&req->mu_);
+ if (error == GRPC_ERROR_NONE && !req->cancelled_) {
+ req->OnWritten();
} else {
- next_address(req, GRPC_ERROR_REF(error));
+ req->NextAddress(GRPC_ERROR_REF(error));
}
}
-static void start_write(internal_request* req) {
- grpc_slice_ref_internal(req->request_text);
- grpc_slice_buffer_add(&req->outgoing, req->request_text);
- grpc_endpoint_write(req->ep, &req->outgoing, &req->done_write, nullptr);
+void HttpRequest::StartWrite() {
+ grpc_slice_ref_internal(request_text_);
+ grpc_slice_buffer_add(&outgoing_, request_text_);
+ Ref().release(); // ref held by pending write
+ grpc_endpoint_write(ep_, &outgoing_, &done_write_, nullptr);
}
-static void on_handshake_done(void* arg, grpc_endpoint* ep) {
- internal_request* req = static_cast<internal_request*>(arg);
-
- if (!ep) {
- next_address(req, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unexplained handshake failure"));
+void HttpRequest::OnHandshakeDone(void* arg, grpc_error_handle error) {
+ auto* args = static_cast<HandshakerArgs*>(arg);
+ RefCountedPtr<HttpRequest> req(static_cast<HttpRequest*>(args->user_data));
+ if (g_test_only_on_handshake_done_intercept != nullptr) {
+ // Run this testing intercept before the lock so that it has a chance to
+ // do things like calling Orphan on the request
+ g_test_only_on_handshake_done_intercept(req.get());
+ }
+ MutexLock lock(&req->mu_);
+ req->own_endpoint_ = true;
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "Secure transport setup failed: %s",
+ grpc_error_std_string(error).c_str());
+ req->NextAddress(GRPC_ERROR_REF(error));
return;
}
-
- req->ep = ep;
- start_write(req);
-}
-
-static void on_connected(void* arg, grpc_error_handle error) {
- internal_request* req = static_cast<internal_request*>(arg);
-
- if (!req->ep) {
- next_address(req, GRPC_ERROR_REF(error));
+ // Handshake completed, so we own fields in args
+ grpc_channel_args_destroy(args->args);
+ grpc_slice_buffer_destroy_internal(args->read_buffer);
+ gpr_free(args->read_buffer);
+ req->ep_ = args->endpoint;
+ if (req->cancelled_) {
+ req->NextAddress(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "HTTP request cancelled during security handshake"));
return;
}
- req->handshaker->handshake(
- req, req->ep, req->ssl_host_override ? req->ssl_host_override : req->host,
- req->deadline, on_handshake_done);
+ req->StartWrite();
}
-static void next_address(internal_request* req, grpc_error_handle error) {
- grpc_resolved_address* addr;
- if (error != GRPC_ERROR_NONE) {
- append_error(req, error);
+void HttpRequest::OnConnected(void* arg, grpc_error_handle error) {
+ RefCountedPtr<HttpRequest> req(static_cast<HttpRequest*>(arg));
+ MutexLock lock(&req->mu_);
+ req->connecting_ = false;
+ req->own_endpoint_ = true;
+ if (req->cancelled_) {
+ // since we were cancelled while connecting, Finish has already
+ // been called.
+ return;
}
- if (req->next_address == req->addresses->naddrs) {
- finish(req,
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed HTTP requests to all targets", &req->overall_error, 1));
+ if (!req->ep_) {
+ req->NextAddress(GRPC_ERROR_REF(error));
return;
}
- addr = &req->addresses->addrs[req->next_address++];
- GRPC_CLOSURE_INIT(&req->connected, on_connected, req,
- grpc_schedule_on_exec_ctx);
- grpc_arg arg = grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA), req->resource_quota,
- grpc_resource_quota_arg_vtable());
- grpc_channel_args args = {1, &arg};
- grpc_tcp_client_connect(&req->connected, &req->ep, req->context->pollset_set,
- &args, addr, req->deadline);
+ // TODO(yihuaz): treating nullptr channel_creds_ as insecure is
+ // a hack used to support the port server client (a test utility) in
+ // unsecure builds (when no definition of grpc_insecure_credentials_create
+ // exists). We can remove this hack and unconditionally assume a valid
+ // channel_creds_ object after unsecure builds are deleted, in
+ // https://github.com/grpc/grpc/pull/25586.
+ if (req->channel_creds_ == nullptr) {
+ gpr_log(GPR_DEBUG,
+ "HTTP request skipping handshake because creds are null");
+ req->StartWrite();
+ return;
+ }
+ // Create the security connector using the credentials and target name.
+ grpc_channel_args* new_args_from_connector = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> sc =
+ req->channel_creds_->create_security_connector(
+ nullptr /*call_creds*/, req->uri_.authority().c_str(),
+ req->channel_args_, &new_args_from_connector);
+ if (sc == nullptr) {
+ req->Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "failed to create security connector", &req->overall_error_, 1));
+ return;
+ }
+ grpc_arg security_connector_arg = grpc_security_connector_to_arg(sc.get());
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
+ new_args_from_connector != nullptr ? new_args_from_connector
+ : req->channel_args_,
+ &security_connector_arg, 1);
+ grpc_channel_args_destroy(new_args_from_connector);
+ // Start the handshake
+ req->handshake_mgr_ = MakeRefCounted<HandshakeManager>();
+ CoreConfiguration::Get().handshaker_registry().AddHandshakers(
+ HANDSHAKER_CLIENT, new_args, req->pollset_set_,
+ req->handshake_mgr_.get());
+ req->Ref().release(); // ref held by pending handshake
+ grpc_endpoint* ep = req->ep_;
+ req->ep_ = nullptr;
+ req->own_endpoint_ = false;
+ req->handshake_mgr_->DoHandshake(ep, new_args, req->deadline_,
+ /*acceptor=*/nullptr, OnHandshakeDone,
+ /*user_data=*/req.get());
+ sc.reset(DEBUG_LOCATION, "httpcli");
+ grpc_channel_args_destroy(new_args);
}
-static void on_resolved(void* arg, grpc_error_handle error) {
- internal_request* req = static_cast<internal_request*>(arg);
+void HttpRequest::NextAddress(grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
- finish(req, GRPC_ERROR_REF(error));
+ AppendError(error);
+ }
+ if (cancelled_) {
+ Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "HTTP request was cancelled", &overall_error_, 1));
return;
}
- req->next_address = 0;
- next_address(req, GRPC_ERROR_NONE);
-}
-
-static void internal_request_begin(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request,
- grpc_millis deadline, grpc_closure* on_done,
- grpc_httpcli_response* response,
- const char* name,
- const grpc_slice& request_text) {
- internal_request* req =
- static_cast<internal_request*>(gpr_malloc(sizeof(internal_request)));
- memset(req, 0, sizeof(*req));
- req->request_text = request_text;
- grpc_http_parser_init(&req->parser, GRPC_HTTP_RESPONSE, response);
- req->on_done = on_done;
- req->deadline = deadline;
- req->handshaker =
- request->handshaker ? request->handshaker : &grpc_httpcli_plaintext;
- req->context = context;
- req->pollent = pollent;
- req->overall_error = GRPC_ERROR_NONE;
- req->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
- GRPC_CLOSURE_INIT(&req->on_read, on_read, req, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&req->done_write, done_write, req,
- grpc_schedule_on_exec_ctx);
- grpc_slice_buffer_init(&req->incoming);
- grpc_slice_buffer_init(&req->outgoing);
- grpc_iomgr_register_object(&req->iomgr_obj, name);
- req->host = gpr_strdup(request->host);
- req->ssl_host_override = gpr_strdup(request->ssl_host_override);
-
- GPR_ASSERT(pollent);
- grpc_polling_entity_add_to_pollset_set(req->pollent,
- req->context->pollset_set);
- grpc_resolve_address(
- request->host, req->handshaker->default_port, req->context->pollset_set,
- GRPC_CLOSURE_CREATE(on_resolved, req, grpc_schedule_on_exec_ctx),
- &req->addresses);
-}
-
-void grpc_httpcli_get(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request, grpc_millis deadline,
- grpc_closure* on_done, grpc_httpcli_response* response) {
- if (g_get_override && g_get_override(request, deadline, on_done, response)) {
+ if (next_address_ == addresses_.size()) {
+ Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed HTTP requests to all targets", &overall_error_, 1));
return;
}
- std::string name =
- 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(),
- grpc_httpcli_format_get_request(request));
+ const grpc_resolved_address* addr = &addresses_[next_address_++];
+ GRPC_CLOSURE_INIT(&connected_, OnConnected, this, grpc_schedule_on_exec_ctx);
+ connecting_ = true;
+ own_endpoint_ = false;
+ Ref().release(); // ref held by pending connect
+ grpc_tcp_client_connect(&connected_, &ep_, pollset_set_, channel_args_, addr,
+ deadline_);
}
-void grpc_httpcli_post(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request,
- const char* body_bytes, size_t body_size,
- grpc_millis deadline, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- if (g_post_override && g_post_override(request, body_bytes, body_size,
- deadline, on_done, response)) {
+void HttpRequest::OnResolved(
+ absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or) {
+ RefCountedPtr<HttpRequest> unreffer(this);
+ MutexLock lock(&mu_);
+ dns_request_.reset();
+ if (!addresses_or.ok()) {
+ Finish(absl_status_to_grpc_error(addresses_or.status()));
return;
}
- std::string name =
- 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));
+ if (cancelled_) {
+ Finish(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "cancelled during DNS resolution"));
+ return;
+ }
+ addresses_ = std::move(*addresses_or);
+ next_address_ = 0;
+ NextAddress(GRPC_ERROR_NONE);
}
-void grpc_httpcli_set_override(grpc_httpcli_get_override get,
- grpc_httpcli_post_override post) {
- g_get_override = get;
- g_post_override = post;
-}
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/http/httpcli.h b/grpc/src/core/lib/http/httpcli.h
index b61bb068..46ccbd28 100644
--- a/grpc/src/core/lib/http/httpcli.h
+++ b/grpc/src/core/lib/http/httpcli.h
@@ -25,101 +25,199 @@
#include <grpc/support/time.h>
+#include "src/core/lib/channel/handshaker.h"
+#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/uri/uri_parser.h"
/* User agent this library reports */
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
-/* Tracks in-progress http requests
- TODO(ctiller): allow caching and capturing multiple requests for the
- same content and combining them */
-typedef struct grpc_httpcli_context {
- grpc_pollset_set* pollset_set;
-} grpc_httpcli_context;
-
-struct grpc_httpcli_handshaker {
- const char* default_port;
- void (*handshake)(void* arg, grpc_endpoint* endpoint, const char* host,
- grpc_millis deadline,
- void (*on_done)(void* arg, grpc_endpoint* endpoint));
-};
-extern const grpc_httpcli_handshaker grpc_httpcli_plaintext;
-extern const grpc_httpcli_handshaker grpc_httpcli_ssl;
-
-/* A request */
-typedef struct grpc_httpcli_request {
- /* The host name to connect to */
- char* host;
- /* The host to verify in the SSL handshake (or NULL) */
- char* ssl_host_override;
- /* The main part of the request
- The following headers are supplied automatically and MUST NOT be set here:
- Host, Connection, User-Agent */
- grpc_http_request http;
- /* handshaker to use ssl for the request */
- const grpc_httpcli_handshaker* handshaker;
-} grpc_httpcli_request;
-
-/* Expose the parser response type as a httpcli response too */
-typedef struct grpc_http_response grpc_httpcli_response;
-
-void grpc_httpcli_context_init(grpc_httpcli_context* context);
-void grpc_httpcli_context_destroy(grpc_httpcli_context* context);
-
-/* Asynchronously perform a HTTP GET.
- 'context' specifies the http context under which to do the get
- 'pollset' indicates a grpc_pollset that is interested in the result
- of the get - work on this pollset may be used to progress the get
- operation
- 'request' contains request parameters - these are caller owned and can be
- destroyed once the call returns
- 'deadline' contains a deadline for the request (or gpr_inf_future)
- 'on_response' is a callback to report results to */
-void grpc_httpcli_get(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request, grpc_millis deadline,
- grpc_closure* on_done, grpc_httpcli_response* response);
-
-/* Asynchronously perform a HTTP POST.
- 'context' specifies the http context under which to do the post
- 'pollset' indicates a grpc_pollset that is interested in the result
- of the post - work on this pollset may be used to progress the post
- operation
- 'request' contains request parameters - these are caller owned and can be
- destroyed once the call returns
- 'body_bytes' and 'body_size' specify the payload for the post.
- When there is no body, pass in NULL as body_bytes.
- 'deadline' contains a deadline for the request (or gpr_inf_future)
- 'em' points to a caller owned event manager that must be alive for the
- lifetime of the request
- 'on_response' is a callback to report results to
- Does not support ?var1=val1&var2=val2 in the path. */
-void grpc_httpcli_post(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request,
- const char* body_bytes, size_t body_size,
- grpc_millis deadline, grpc_closure* on_done,
- grpc_httpcli_response* response);
-
/* override functions return 1 if they handled the request, 0 otherwise */
-typedef int (*grpc_httpcli_get_override)(const grpc_httpcli_request* request,
- grpc_millis deadline,
+typedef int (*grpc_httpcli_get_override)(const grpc_http_request* request,
+ const char* host, const char* path,
+ grpc_core::Timestamp deadline,
grpc_closure* on_complete,
- grpc_httpcli_response* response);
-typedef int (*grpc_httpcli_post_override)(const grpc_httpcli_request* request,
- const char* body_bytes,
- size_t body_size,
- grpc_millis deadline,
- grpc_closure* on_complete,
- grpc_httpcli_response* response);
-
-void grpc_httpcli_set_override(grpc_httpcli_get_override get,
- grpc_httpcli_post_override post);
+ grpc_http_response* response);
+typedef int (*grpc_httpcli_post_override)(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body_bytes, size_t body_size, grpc_core::Timestamp deadline,
+ grpc_closure* on_complete, grpc_http_response* response);
+
+namespace grpc_core {
+
+// Tracks an in-progress GET or POST request. Calling \a Start()
+// begins async work and calling \a Orphan() arranges for async work
+// to be completed as sooon as possible (possibly aborting the request
+// if it's in flight).
+// TODO(ctiller): allow caching and capturing multiple requests for the
+// same content and combining them
+class HttpRequest : public InternallyRefCounted<HttpRequest> {
+ public:
+ // Asynchronously perform a HTTP GET.
+ // 'uri' is the target to make the request to. The scheme field is used to
+ // determine the port number. The authority field is the target host. The
+ // path field determines the path of the request. No other fields are used.
+ // 'args' are optional channel args for the request.
+ // 'pollent' indicates a grpc_polling_entity that is interested in the result
+ // of the get - work on this entity may be used to progress the get
+ // operation
+ // 'request' contains request parameters - these are caller owned and
+ // can be destroyed once the call returns
+ // 'deadline' contains a deadline for the request (or gpr_inf_future)
+ // 'on_done' is a callback to report results to
+ // 'channel_creds' are used to configurably secure the connection.
+ // For insecure requests, use grpc_insecure_credentials_create.
+ // For secure requests, use CreateHttpRequestSSLCredentials().
+ // nullptr is treated as insecure credentials.
+ // TODO(yihuaz): disallow nullptr as a value after unsecure builds
+ // are removed.
+ static OrphanablePtr<HttpRequest> Get(
+ URI uri, const grpc_channel_args* args, grpc_polling_entity* pollent,
+ const grpc_http_request* request, Timestamp deadline,
+ grpc_closure* on_done, grpc_http_response* response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds)
+ GRPC_MUST_USE_RESULT;
+
+ // Asynchronously perform a HTTP POST.
+ // 'uri' is the target to make the request to. The scheme field is used to
+ // determine the port number. The authority field is the target host. The
+ // path field determines the path of the request. No other fields are used.
+ // 'args' are optional channel args for the request.
+ // 'pollent' indicates a grpc_polling_entity that is interested in the result
+ // of the post - work on this entity may be used to progress the post
+ // operation
+ // 'request' contains request parameters - these are caller owned and can be
+ // destroyed once the call returns
+ // 'deadline' contains a deadline for the request (or gpr_inf_future)
+ // 'on_done' is a callback to report results to
+ // 'channel_creds' are used to configurably secure the connection.
+ // For insecure requests, use grpc_insecure_credentials_create.
+ // For secure requests, use CreateHttpRequestSSLCredentials().
+ // nullptr is treated as insecure credentials.
+ // TODO(apolcyn): disallow nullptr as a value after unsecure builds
+ // are removed.
+ // Does not support ?var1=val1&var2=val2 in the path.
+ static OrphanablePtr<HttpRequest> Post(
+ URI uri, const grpc_channel_args* args, grpc_polling_entity* pollent,
+ const grpc_http_request* request, Timestamp deadline,
+ grpc_closure* on_done, grpc_http_response* response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds)
+ GRPC_MUST_USE_RESULT;
+
+ HttpRequest(URI uri, const grpc_slice& request_text,
+ grpc_http_response* response, Timestamp deadline,
+ const grpc_channel_args* channel_args, grpc_closure* on_done,
+ grpc_polling_entity* pollent, const char* name,
+ absl::optional<std::function<void()>> test_only_generate_response,
+ RefCountedPtr<grpc_channel_credentials> channel_creds);
+
+ ~HttpRequest() override;
+
+ void Start();
+
+ void Orphan() override;
+
+ static void SetOverride(grpc_httpcli_get_override get,
+ grpc_httpcli_post_override post);
+
+ static void TestOnlySetOnHandshakeDoneIntercept(
+ void (*intercept)(HttpRequest* req));
+
+ private:
+ void Finish(grpc_error_handle error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ grpc_polling_entity_del_from_pollset_set(pollent_, pollset_set_);
+ ExecCtx::Run(DEBUG_LOCATION, on_done_, error);
+ }
+
+ void AppendError(grpc_error_handle error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ void DoRead() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ Ref().release(); // ref held by pending read
+ grpc_endpoint_read(ep_, &incoming_, &on_read_, /*urgent=*/true);
+ }
+
+ static void OnRead(void* user_data, grpc_error_handle error) {
+ HttpRequest* req = static_cast<HttpRequest*>(user_data);
+ ExecCtx::Run(DEBUG_LOCATION,
+ &req->continue_on_read_after_schedule_on_exec_ctx_,
+ GRPC_ERROR_REF(error));
+ }
+
+ // Needed since OnRead may be called inline from grpc_endpoint_read
+ static void ContinueOnReadAfterScheduleOnExecCtx(void* user_data,
+ grpc_error_handle error) {
+ RefCountedPtr<HttpRequest> req(static_cast<HttpRequest*>(user_data));
+ MutexLock lock(&req->mu_);
+ req->OnReadInternal(error);
+ }
+
+ void OnReadInternal(grpc_error_handle error)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ void OnWritten() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { DoRead(); }
+
+ static void DoneWrite(void* arg, grpc_error_handle error) {
+ HttpRequest* req = static_cast<HttpRequest*>(arg);
+ ExecCtx::Run(DEBUG_LOCATION,
+ &req->continue_done_write_after_schedule_on_exec_ctx_,
+ GRPC_ERROR_REF(error));
+ }
+
+ // Needed since DoneWrite may be called inline from grpc_endpoint_write
+ static void ContinueDoneWriteAfterScheduleOnExecCtx(void* arg,
+ grpc_error_handle error);
+
+ void StartWrite() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ static void OnHandshakeDone(void* arg, grpc_error_handle error);
+
+ static void OnConnected(void* arg, grpc_error_handle error);
+
+ void NextAddress(grpc_error_handle error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ void OnResolved(
+ absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or);
+
+ const URI uri_;
+ const grpc_slice request_text_;
+ const Timestamp deadline_;
+ const grpc_channel_args* channel_args_;
+ RefCountedPtr<grpc_channel_credentials> channel_creds_;
+ grpc_closure on_read_;
+ grpc_closure continue_on_read_after_schedule_on_exec_ctx_;
+ grpc_closure done_write_;
+ grpc_closure continue_done_write_after_schedule_on_exec_ctx_;
+ grpc_closure connected_;
+ grpc_endpoint* ep_ = nullptr;
+ grpc_closure* on_done_;
+ ResourceQuotaRefPtr resource_quota_;
+ grpc_polling_entity* pollent_;
+ grpc_pollset_set* pollset_set_;
+ const absl::optional<std::function<void()>> test_only_generate_response_;
+ Mutex mu_;
+ RefCountedPtr<HandshakeManager> handshake_mgr_ ABSL_GUARDED_BY(mu_);
+ bool own_endpoint_ ABSL_GUARDED_BY(mu_) = true;
+ bool cancelled_ ABSL_GUARDED_BY(mu_) = false;
+ bool connecting_ ABSL_GUARDED_BY(mu_) = false;
+ grpc_http_parser parser_ ABSL_GUARDED_BY(mu_);
+ std::vector<grpc_resolved_address> addresses_ ABSL_GUARDED_BY(mu_);
+ size_t next_address_ ABSL_GUARDED_BY(mu_) = 0;
+ int have_read_byte_ ABSL_GUARDED_BY(mu_) = 0;
+ grpc_iomgr_object iomgr_obj_ ABSL_GUARDED_BY(mu_);
+ grpc_slice_buffer incoming_ ABSL_GUARDED_BY(mu_);
+ grpc_slice_buffer outgoing_ ABSL_GUARDED_BY(mu_);
+ grpc_error_handle overall_error_ ABSL_GUARDED_BY(mu_) = GRPC_ERROR_NONE;
+ OrphanablePtr<DNSResolver::Request> dns_request_ ABSL_GUARDED_BY(mu_);
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */
diff --git a/grpc/src/core/lib/http/httpcli_security_connector.cc b/grpc/src/core/lib/http/httpcli_security_connector.cc
index e26f99b4..99273173 100644
--- a/grpc/src/core/lib/http/httpcli_security_connector.cc
+++ b/grpc/src/core/lib/http/httpcli_security_connector.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/http/httpcli.h"
-
#include <string.h>
#include "absl/strings/str_cat.h"
@@ -30,22 +28,27 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/credentials/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/tsi/ssl_transport_security.h"
+namespace grpc_core {
+
+namespace {
+
class grpc_httpcli_ssl_channel_security_connector final
: public grpc_channel_security_connector {
public:
explicit grpc_httpcli_ssl_channel_security_connector(char* secure_peer_name)
: grpc_channel_security_connector(
- /*url_scheme=*/nullptr,
+ /*url_scheme=*/{},
/*channel_creds=*/nullptr,
/*request_metadata_creds=*/nullptr),
secure_peer_name_(secure_peer_name) {}
@@ -70,18 +73,18 @@ class grpc_httpcli_ssl_channel_security_connector final
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /*interested_parties*/,
- grpc_core::HandshakeManager* handshake_mgr) override {
+ HandshakeManager* handshake_mgr) override {
tsi_handshaker* handshaker = nullptr;
if (handshaker_factory_ != nullptr) {
tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
- handshaker_factory_, secure_peer_name_, &handshaker);
+ handshaker_factory_, secure_peer_name_, /*network_bio_buf_size=*/0,
+ /*ssl_bio_buf_size=*/0, &handshaker);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
}
}
- handshake_mgr->Add(
- grpc_core::SecurityHandshakerCreate(handshaker, this, args));
+ handshake_mgr->Add(SecurityHandshakerCreate(handshaker, this, args));
}
tsi_ssl_client_handshaker_factory* handshaker_factory() const {
@@ -89,19 +92,17 @@ class grpc_httpcli_ssl_channel_security_connector final
}
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* /*auth_context*/,
+ RefCountedPtr<grpc_auth_context>* /*auth_context*/,
grpc_closure* on_peer_checked) override {
grpc_error_handle error = GRPC_ERROR_NONE;
/* 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(
- absl::StrCat("Peer name ", secure_peer_name_,
- " is not in peer certificate")
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Peer name ", secure_peer_name_, " is not in peer certificate"));
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
tsi_peer_destruct(&peer);
}
@@ -117,17 +118,9 @@ class grpc_httpcli_ssl_channel_security_connector final
return strcmp(secure_peer_name_, other->secure_peer_name_);
}
- bool check_call_host(absl::string_view /*host*/,
- grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle* error) override {
- *error = GRPC_ERROR_NONE;
- return true;
- }
-
- void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle error) override {
- GRPC_ERROR_UNREF(error);
+ ArenaPromise<absl::Status> CheckCallHost(absl::string_view,
+ grpc_auth_context*) override {
+ return ImmediateOkStatus();
}
const char* secure_peer_name() const { return secure_peer_name_; }
@@ -137,17 +130,17 @@ class grpc_httpcli_ssl_channel_security_connector final
char* secure_peer_name_;
};
-static grpc_core::RefCountedPtr<grpc_channel_security_connector>
+RefCountedPtr<grpc_channel_security_connector>
httpcli_ssl_channel_security_connector_create(
const char* pem_root_certs, const tsi_ssl_root_certs_store* root_store,
- const char* secure_peer_name, grpc_channel_args* /*channel_args*/) {
+ const char* secure_peer_name) {
if (secure_peer_name != nullptr && pem_root_certs == nullptr) {
gpr_log(GPR_ERROR,
"Cannot assert a secure peer name without a trust root.");
return nullptr;
}
- grpc_core::RefCountedPtr<grpc_httpcli_ssl_channel_security_connector> c =
- grpc_core::MakeRefCounted<grpc_httpcli_ssl_channel_security_connector>(
+ RefCountedPtr<grpc_httpcli_ssl_channel_security_connector> c =
+ MakeRefCounted<grpc_httpcli_ssl_channel_security_connector>(
secure_peer_name == nullptr ? nullptr : gpr_strdup(secure_peer_name));
tsi_result result = c->InitHandshakerFactory(pem_root_certs, root_store);
if (result != TSI_OK) {
@@ -158,61 +151,54 @@ httpcli_ssl_channel_security_connector_create(
return c;
}
-/* handshaker */
+class HttpRequestSSLCredentials : public grpc_channel_credentials {
+ public:
+ RefCountedPtr<grpc_channel_security_connector> create_security_connector(
+ RefCountedPtr<grpc_call_credentials> /*call_creds*/, const char* target,
+ const grpc_channel_args* args,
+ grpc_channel_args** /*new_args*/) override {
+ const char* pem_root_certs = DefaultSslRootStore::GetPemRootCerts();
+ const tsi_ssl_root_certs_store* root_store =
+ DefaultSslRootStore::GetRootStore();
+ if (root_store == nullptr) {
+ gpr_log(GPR_ERROR, "Could not get default pem root certs.");
+ return nullptr;
+ }
+ const char* ssl_host_override =
+ grpc_channel_args_find_string(args, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG);
+ if (ssl_host_override != nullptr) {
+ target = ssl_host_override;
+ }
+ return httpcli_ssl_channel_security_connector_create(pem_root_certs,
+ root_store, target);
+ }
-struct on_done_closure {
- void (*func)(void* arg, grpc_endpoint* endpoint);
- void* arg;
- grpc_core::RefCountedPtr<grpc_core::HandshakeManager> handshake_mgr;
-};
-static void on_handshake_done(void* arg, grpc_error_handle error) {
- auto* args = static_cast<grpc_core::HandshakerArgs*>(arg);
- on_done_closure* c = static_cast<on_done_closure*>(args->user_data);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Secure transport setup failed: %s",
- grpc_error_std_string(error).c_str());
- c->func(c->arg, nullptr);
- } else {
- grpc_channel_args_destroy(args->args);
- grpc_slice_buffer_destroy_internal(args->read_buffer);
- gpr_free(args->read_buffer);
- c->func(c->arg, args->endpoint);
+ RefCountedPtr<grpc_channel_credentials> duplicate_without_call_credentials()
+ override {
+ return Ref();
}
- delete c;
-}
-static void ssl_handshake(void* arg, grpc_endpoint* tcp, const char* host,
- grpc_millis deadline,
- void (*on_done)(void* arg, grpc_endpoint* endpoint)) {
- auto* c = new on_done_closure();
- const char* pem_root_certs =
- grpc_core::DefaultSslRootStore::GetPemRootCerts();
- const tsi_ssl_root_certs_store* root_store =
- grpc_core::DefaultSslRootStore::GetRootStore();
- if (root_store == nullptr) {
- gpr_log(GPR_ERROR, "Could not get default pem root certs.");
- on_done(arg, nullptr);
- gpr_free(c);
- return;
+ grpc_channel_args* update_arguments(grpc_channel_args* args) override {
+ return args;
}
- c->func = on_done;
- c->arg = arg;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> sc =
- httpcli_ssl_channel_security_connector_create(
- pem_root_certs, root_store, host,
- static_cast<grpc_core::HandshakerArgs*>(arg)->args);
-
- GPR_ASSERT(sc != nullptr);
- grpc_arg channel_arg = grpc_security_connector_to_arg(sc.get());
- grpc_channel_args args = {1, &channel_arg};
- c->handshake_mgr = grpc_core::MakeRefCounted<grpc_core::HandshakeManager>();
- grpc_core::HandshakerRegistry::AddHandshakers(
- grpc_core::HANDSHAKER_CLIENT, &args,
- /*interested_parties=*/nullptr, c->handshake_mgr.get());
- c->handshake_mgr->DoHandshake(tcp, /*channel_args=*/nullptr, deadline,
- /*acceptor=*/nullptr, on_handshake_done,
- /*user_data=*/c);
- sc.reset(DEBUG_LOCATION, "httpcli");
+
+ const char* type() const override { return "HttpRequestSSL"; }
+
+ private:
+ int cmp_impl(const grpc_channel_credentials* /* other */) const override {
+ // There's no differentiating factor between two HttpRequestSSLCredentials
+ // objects.
+ return 0;
+ }
+};
+
+} // namespace
+
+RefCountedPtr<grpc_channel_credentials> CreateHttpRequestSSLCredentials() {
+ // Create a singleton object for HttpRequestSSLCredentials so that channels to
+ // the same target with HttpRequestSSLCredentials can reuse the subchannels.
+ static auto* creds = new HttpRequestSSLCredentials();
+ return creds->Ref();
}
-const grpc_httpcli_handshaker grpc_httpcli_ssl = {"https", ssl_handshake};
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/http/httpcli_ssl_credentials.h b/grpc/src/core/lib/http/httpcli_ssl_credentials.h
new file mode 100644
index 00000000..ef33662a
--- /dev/null
+++ b/grpc/src/core/lib/http/httpcli_ssl_credentials.h
@@ -0,0 +1,37 @@
+//
+// 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_HTTP_HTTPCLI_SSL_CREDENTIALS_H
+#define GRPC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+
+namespace grpc_core {
+
+// Creates a channel credentials suitable for use with the
+// HttpRequest::Get and HttpRequest::Post APIs. Notably, this allows
+// HTTP1 requests to use secure connections without ALPN (as the
+// typical gRPC SSL credentials do).
+//
+// These credentials are NOT INTENDED FOR USE with gRPC channels, and
+// MUST ONLY BE USED with the HttpRequest::Get and Post APIs.
+RefCountedPtr<grpc_channel_credentials> CreateHttpRequestSSLCredentials();
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H
diff --git a/grpc/src/core/lib/http/parser.cc b/grpc/src/core/lib/http/parser.cc
index c47a0177..daf9a8a3 100644
--- a/grpc/src/core/lib/http/parser.cc
+++ b/grpc/src/core/lib/http/parser.cc
@@ -177,6 +177,7 @@ static grpc_error_handle add_header(grpc_http_parser* parser) {
uint8_t* cur = beg;
uint8_t* end = beg + parser->cur_line_length;
size_t* hdr_count = nullptr;
+ size_t size = 0;
grpc_http_header** hdrs = nullptr;
grpc_http_header hdr = {nullptr, nullptr};
grpc_error_handle error = GRPC_ERROR_NONE;
@@ -205,13 +206,20 @@ static grpc_error_handle add_header(grpc_http_parser* parser) {
cur++;
}
GPR_ASSERT((size_t)(end - cur) >= parser->cur_line_end_length);
- hdr.value = buf2str(
- cur, static_cast<size_t>(end - cur) - parser->cur_line_end_length);
+ size = static_cast<size_t>(end - cur) - parser->cur_line_end_length;
+ if ((size != 0) && (cur[size - 1] == '\r')) {
+ size--;
+ }
+ hdr.value = buf2str(cur, size);
switch (parser->type) {
case GRPC_HTTP_RESPONSE:
hdr_count = &parser->http.response->hdr_count;
hdrs = &parser->http.response->hdrs;
+ if ((strcmp(hdr.key, "Transfer-Encoding") == 0) &&
+ (strcmp(hdr.value, "chunked") == 0)) {
+ parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_LENGTH;
+ }
break;
case GRPC_HTTP_REQUEST:
hdr_count = &parser->http.request->hdr_count;
@@ -221,7 +229,7 @@ static grpc_error_handle add_header(grpc_http_parser* parser) {
if (*hdr_count == parser->hdr_capacity) {
parser->hdr_capacity =
- GPR_MAX(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
+ std::max(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
*hdrs = static_cast<grpc_http_header*>(
gpr_realloc(*hdrs, parser->hdr_capacity * sizeof(**hdrs)));
}
@@ -245,17 +253,24 @@ static grpc_error_handle finish_line(grpc_http_parser* parser,
parser->state = GRPC_HTTP_HEADERS;
break;
case GRPC_HTTP_HEADERS:
+ case GRPC_HTTP_TRAILERS:
if (parser->cur_line_length == parser->cur_line_end_length) {
- parser->state = GRPC_HTTP_BODY;
- *found_body_start = true;
+ if (parser->state == GRPC_HTTP_HEADERS) {
+ parser->state = GRPC_HTTP_BODY;
+ *found_body_start = true;
+ } else {
+ parser->state = GRPC_HTTP_END;
+ }
break;
- }
- err = add_header(parser);
- if (err != GRPC_ERROR_NONE) {
- return err;
+ } else {
+ err = add_header(parser);
+ if (err != GRPC_ERROR_NONE) {
+ return err;
+ }
}
break;
case GRPC_HTTP_BODY:
+ case GRPC_HTTP_END:
GPR_UNREACHABLE_CODE(return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Should never reach here"));
}
@@ -269,6 +284,59 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
char** body = nullptr;
if (parser->type == GRPC_HTTP_RESPONSE) {
+ switch (parser->http.response->chunked_state) {
+ case GRPC_HTTP_CHUNKED_LENGTH:
+ if ((byte == '\r') || (byte == ';')) {
+ parser->http.response->chunked_state =
+ GRPC_HTTP_CHUNKED_IGNORE_ALL_UNTIL_LF;
+ } else if ((byte >= '0') && (byte <= '9')) {
+ parser->http.response->chunk_length *= 16;
+ parser->http.response->chunk_length += byte - '0';
+ } else if ((byte >= 'a') && (byte <= 'f')) {
+ parser->http.response->chunk_length *= 16;
+ parser->http.response->chunk_length += byte - 'a' + 10;
+ } else if ((byte >= 'A') && (byte <= 'F')) {
+ parser->http.response->chunk_length *= 16;
+ parser->http.response->chunk_length += byte - 'A' + 10;
+ } else {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Expected chunk size in hexadecimal");
+ }
+ return GRPC_ERROR_NONE;
+ case GRPC_HTTP_CHUNKED_IGNORE_ALL_UNTIL_LF:
+ if (byte == '\n') {
+ if (parser->http.response->chunk_length == 0) {
+ parser->state = GRPC_HTTP_TRAILERS;
+ } else {
+ parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_BODY;
+ }
+ }
+ return GRPC_ERROR_NONE;
+ case GRPC_HTTP_CHUNKED_BODY:
+ if (parser->http.response->chunk_length == 0) {
+ if (byte != '\r') {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Expected '\\r\\n' after chunk body");
+ }
+ parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_CONSUME_LF;
+ parser->http.response->chunk_length = 0;
+ return GRPC_ERROR_NONE;
+ } else {
+ parser->http.response->chunk_length--;
+ /* fallback to the normal body appending code below */
+ }
+ break;
+ case GRPC_HTTP_CHUNKED_CONSUME_LF:
+ if (byte != '\n') {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Expected '\\r\\n' after chunk body");
+ }
+ parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_LENGTH;
+ return GRPC_ERROR_NONE;
+ case GRPC_HTTP_CHUNKED_PLAIN:
+ /* avoiding warning; just fallback to normal codepath */
+ break;
+ }
body_length = &parser->http.response->body_length;
body = &parser->http.response->body;
} else if (parser->type == GRPC_HTTP_REQUEST) {
@@ -280,7 +348,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
}
if (*body_length == parser->body_capacity) {
- parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2);
+ parser->body_capacity = std::max(size_t(8), parser->body_capacity * 3 / 2);
*body = static_cast<char*>(gpr_realloc(*body, parser->body_capacity));
}
(*body)[*body_length] = static_cast<char>(byte);
@@ -318,6 +386,7 @@ static grpc_error_handle addbyte(grpc_http_parser* parser, uint8_t byte,
switch (parser->state) {
case GRPC_HTTP_FIRST_LINE:
case GRPC_HTTP_HEADERS:
+ case GRPC_HTTP_TRAILERS:
if (parser->cur_line_length >= GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_http1_trace)) {
gpr_log(GPR_ERROR, "HTTP header max line length (%d) exceeded",
@@ -334,6 +403,8 @@ static grpc_error_handle addbyte(grpc_http_parser* parser, uint8_t byte,
return GRPC_ERROR_NONE;
case GRPC_HTTP_BODY:
return addbyte_body(parser, byte);
+ case GRPC_HTTP_END:
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unexpected byte after end");
}
GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
}
@@ -385,7 +456,7 @@ grpc_error_handle grpc_http_parser_parse(grpc_http_parser* parser,
}
grpc_error_handle grpc_http_parser_eof(grpc_http_parser* parser) {
- if (parser->state != GRPC_HTTP_BODY) {
+ if ((parser->state != GRPC_HTTP_BODY) && (parser->state != GRPC_HTTP_END)) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Did not finish headers");
}
return GRPC_ERROR_NONE;
diff --git a/grpc/src/core/lib/http/parser.h b/grpc/src/core/lib/http/parser.h
index 613b9726..63f9c9fd 100644
--- a/grpc/src/core/lib/http/parser.h
+++ b/grpc/src/core/lib/http/parser.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/error.h"
@@ -37,10 +38,20 @@ typedef struct grpc_http_header {
typedef enum {
GRPC_HTTP_FIRST_LINE,
GRPC_HTTP_HEADERS,
- GRPC_HTTP_BODY
+ GRPC_HTTP_BODY,
+ GRPC_HTTP_TRAILERS,
+ GRPC_HTTP_END,
} grpc_http_parser_state;
typedef enum {
+ GRPC_HTTP_CHUNKED_PLAIN,
+ GRPC_HTTP_CHUNKED_LENGTH,
+ GRPC_HTTP_CHUNKED_IGNORE_ALL_UNTIL_LF,
+ GRPC_HTTP_CHUNKED_BODY,
+ GRPC_HTTP_CHUNKED_CONSUME_LF,
+} grpc_http_parser_chunked_state;
+
+typedef enum {
GRPC_HTTP_HTTP10,
GRPC_HTTP_HTTP11,
GRPC_HTTP_HTTP20,
@@ -55,7 +66,7 @@ typedef enum {
typedef struct grpc_http_request {
/* Method of the request (e.g. GET, POST) */
char* method;
- /* The path of the resource to fetch */
+ /* The path of the resource to fetch (only used for parsed requests) */
char* path;
/* HTTP version to use */
grpc_http_version version;
@@ -76,6 +87,9 @@ typedef struct grpc_http_response {
grpc_http_header* hdrs = nullptr;
/* Body: length and contents; contents are NOT null-terminated */
size_t body_length = 0;
+ /* State of the chunked parser. Only valid for the response. */
+ grpc_http_parser_chunked_state chunked_state = GRPC_HTTP_CHUNKED_PLAIN;
+ size_t chunk_length = 0;
char* body = nullptr;
} grpc_http_response;
diff --git a/grpc/src/core/lib/iomgr/buffer_list.cc b/grpc/src/core/lib/iomgr/buffer_list.cc
index f92fc9b1..39500228 100644
--- a/grpc/src/core/lib/iomgr/buffer_list.cc
+++ b/grpc/src/core/lib/iomgr/buffer_list.cc
@@ -19,10 +19,11 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/buffer_list.h"
-#include "src/core/lib/iomgr/port.h"
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/port.h"
+
#ifdef GRPC_LINUX_ERRQUEUE
#include <netinet/in.h>
#include <string.h>
@@ -39,14 +40,14 @@ void fill_gpr_from_timestamp(gpr_timespec* gts, const struct timespec* ts) {
gts->clock_type = GPR_CLOCK_REALTIME;
}
-void default_timestamps_callback(void* /*arg*/, grpc_core::Timestamps* /*ts*/,
+void default_timestamps_callback(void* /*arg*/, Timestamps* /*ts*/,
grpc_error_handle /*shudown_err*/) {
gpr_log(GPR_DEBUG, "Timestamps callback has not been registered");
}
/** The saved callback function that will be invoked when we get all the
* timestamps that we are going to get for a TracedBuffer. */
-void (*timestamps_callback)(void*, grpc_core::Timestamps*,
+void (*timestamps_callback)(void*, Timestamps*,
grpc_error_handle shutdown_err) =
default_timestamps_callback;
@@ -61,11 +62,11 @@ T read_unaligned(const void* ptr) {
/* Extracts opt stats from the tcp_info struct \a info to \a metrics */
void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
- const grpc_core::tcp_info* info) {
+ const tcp_info* info) {
if (info == nullptr) {
return;
}
- if (info->length > offsetof(grpc_core::tcp_info, tcpi_sndbuf_limited)) {
+ if (info->length > offsetof(tcp_info, tcpi_sndbuf_limited)) {
metrics->recurring_retrans.emplace(info->tcpi_retransmits);
metrics->is_delivery_rate_app_limited.emplace(
info->tcpi_delivery_rate_app_limited);
@@ -83,7 +84,7 @@ void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
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)) {
+ if (info->length > offsetof(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);
@@ -188,9 +189,9 @@ void extract_opt_stats_from_cmsg(ConnectionMetrics* metrics,
}
}
-static int get_socket_tcp_info(grpc_core::tcp_info* info, int fd) {
+int get_socket_tcp_info(tcp_info* info, int fd) {
memset(info, 0, sizeof(*info));
- info->length = sizeof(*info) - sizeof(socklen_t);
+ info->length = offsetof(tcp_info, length);
return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &(info->length));
}
} /* namespace */
@@ -285,7 +286,7 @@ void TracedBuffer::Shutdown(TracedBuffer** head, void* remaining,
}
void grpc_tcp_set_write_timestamps_callback(
- void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) {
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
timestamps_callback = fn;
}
} /* namespace grpc_core */
@@ -294,7 +295,7 @@ void grpc_tcp_set_write_timestamps_callback(
namespace grpc_core {
void grpc_tcp_set_write_timestamps_callback(
- void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error)) {
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
// Cast value of fn to void to avoid unused parameter warning.
// Can't comment out the name because some compilers and formatters don't
// like the sequence */* , which would arise from */*fn*/.
diff --git a/grpc/src/core/lib/iomgr/buffer_list.h b/grpc/src/core/lib/iomgr/buffer_list.h
index 982c4c6b..bfa5b193 100644
--- a/grpc/src/core/lib/iomgr/buffer_list.h
+++ b/grpc/src/core/lib/iomgr/buffer_list.h
@@ -23,13 +23,12 @@
#include "absl/types/optional.h"
-#include "src/core/lib/iomgr/port.h"
-
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/internal_errqueue.h"
+#include "src/core/lib/iomgr/port.h"
namespace grpc_core {
@@ -83,22 +82,22 @@ struct ConnectionMetrics {
absl::optional<uint64_t> sndbuf_limited_usec;
};
-struct Timestamp {
+struct BufferTimestamp {
gpr_timespec time;
ConnectionMetrics metrics; /* Metrics collected with this timestamp */
};
struct Timestamps {
- Timestamp sendmsg_time;
- Timestamp scheduled_time;
- Timestamp sent_time;
- Timestamp acked_time;
+ BufferTimestamp sendmsg_time;
+ BufferTimestamp scheduled_time;
+ BufferTimestamp sent_time;
+ BufferTimestamp acked_time;
uint32_t byte_offset; /* byte offset relative to the start of the RPC */
#ifdef GRPC_LINUX_ERRQUEUE
- grpc_core::tcp_info info; /* tcp_info collected on sendmsg */
-#endif /* GRPC_LINUX_ERRQUEUE */
+ tcp_info info; /* tcp_info collected on sendmsg */
+#endif /* GRPC_LINUX_ERRQUEUE */
};
/** TracedBuffer is a class to keep track of timestamps for a specific buffer in
@@ -106,7 +105,7 @@ struct Timestamps {
* this class would only be used by Linux platforms. For all other platforms,
* TracedBuffer would be an empty class.
*
- * The timestamps collected are according to grpc_core::Timestamps declared
+ * The timestamps collected are according to Timestamps declared
* above.
*
* A TracedBuffer list is kept track of using the head element of the list. If
@@ -121,33 +120,33 @@ class TracedBuffer {
/** Add a new entry in the TracedBuffer list pointed to by head. Also saves
* sendmsg_time with the current timestamp. */
- static void AddNewEntry(grpc_core::TracedBuffer** head, uint32_t seq_no,
- int fd, void* arg);
+ static void AddNewEntry(TracedBuffer** head, uint32_t seq_no, int fd,
+ void* arg);
/** Processes a received timestamp based on sock_extended_err and
* scm_timestamping structures. It will invoke the timestamps callback if the
* timestamp type is SCM_TSTAMP_ACK. */
- static void ProcessTimestamp(grpc_core::TracedBuffer** head,
+ static void ProcessTimestamp(TracedBuffer** head,
struct sock_extended_err* serr,
struct cmsghdr* opt_stats,
struct scm_timestamping* tss);
/** Cleans the list by calling the callback for each traced buffer in the list
* with timestamps that it has. */
- static void Shutdown(grpc_core::TracedBuffer** head, void* remaining,
+ static void Shutdown(TracedBuffer** head, void* remaining,
grpc_error_handle shutdown_err);
private:
- uint32_t seq_no_; /* The sequence number for the last byte in the buffer */
- void* arg_; /* The arg to pass to timestamps_callback */
- grpc_core::Timestamps ts_; /* The timestamps corresponding to this buffer */
- grpc_core::TracedBuffer* next_; /* The next TracedBuffer in the list */
+ uint32_t seq_no_; /* The sequence number for the last byte in the buffer */
+ void* arg_; /* The arg to pass to timestamps_callback */
+ Timestamps ts_; /* The timestamps corresponding to this buffer */
+ TracedBuffer* next_; /* The next TracedBuffer in the list */
};
#else /* GRPC_LINUX_ERRQUEUE */
class TracedBuffer {
public:
/* Phony shutdown function */
- static void Shutdown(grpc_core::TracedBuffer** /*head*/, void* /*remaining*/,
+ static void Shutdown(TracedBuffer** /*head*/, void* /*remaining*/,
grpc_error_handle shutdown_err) {
GRPC_ERROR_UNREF(shutdown_err);
}
@@ -157,7 +156,7 @@ class TracedBuffer {
/** Sets the callback function to call when timestamps for a write are
* collected. The callback does not own a reference to error. */
void grpc_tcp_set_write_timestamps_callback(
- void (*fn)(void*, grpc_core::Timestamps*, grpc_error_handle error));
+ void (*fn)(void*, Timestamps*, grpc_error_handle error));
} /* namespace grpc_core */
diff --git a/grpc/src/core/lib/iomgr/call_combiner.cc b/grpc/src/core/lib/iomgr/call_combiner.cc
index 44ffb127..720fd47a 100644
--- a/grpc/src/core/lib/iomgr/call_combiner.cc
+++ b/grpc/src/core/lib/iomgr/call_combiner.cc
@@ -23,6 +23,7 @@
#include <inttypes.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/profiling/timers.h"
@@ -32,18 +33,20 @@ DebugOnlyTraceFlag grpc_call_combiner_trace(false, "call_combiner");
namespace {
+// grpc_error LSB can be used
+constexpr intptr_t kErrorBit = 1;
+
grpc_error_handle DecodeCancelStateError(gpr_atm cancel_state) {
- if (cancel_state & 1) {
- return reinterpret_cast<grpc_error_handle>(cancel_state &
- ~static_cast<gpr_atm>(1));
+ if (cancel_state & kErrorBit) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ return internal::StatusGetFromHeapPtr(cancel_state & ~kErrorBit);
+#else
+ return reinterpret_cast<grpc_error_handle>(cancel_state & ~kErrorBit);
+#endif
}
return GRPC_ERROR_NONE;
}
-gpr_atm EncodeCancelStateError(grpc_error_handle error) {
- return static_cast<gpr_atm>(1) | reinterpret_cast<gpr_atm>(error);
-}
-
} // namespace
CallCombiner::CallCombiner() {
@@ -56,7 +59,14 @@ CallCombiner::CallCombiner() {
}
CallCombiner::~CallCombiner() {
- GRPC_ERROR_UNREF(DecodeCancelStateError(cancel_state_));
+ if (cancel_state_ & kErrorBit) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(cancel_state_ & ~kErrorBit);
+#else
+ GRPC_ERROR_UNREF(reinterpret_cast<grpc_error_handle>(
+ cancel_state_ & ~static_cast<gpr_atm>(kErrorBit)));
+#endif
+ }
}
#ifdef GRPC_TSAN_ENABLED
@@ -81,8 +91,7 @@ void CallCombiner::TsanClosure(void* arg, grpc_error_handle error) {
} else {
lock.reset();
}
- grpc_core::Closure::Run(DEBUG_LOCATION, self->original_closure_,
- GRPC_ERROR_REF(error));
+ Closure::Run(DEBUG_LOCATION, self->original_closure_, GRPC_ERROR_REF(error));
if (lock != nullptr) {
TSAN_ANNOTATE_RWLOCK_RELEASED(&lock->taken, true);
bool prev = true;
@@ -141,7 +150,11 @@ void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error,
gpr_log(GPR_INFO, " QUEUING");
}
// Queue was not empty, so add closure to queue.
- closure->error_data.error = error;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ closure->error_data.error = internal::StatusAllocHeapPtr(error);
+#else
+ closure->error_data.error = reinterpret_cast<intptr_t>(error);
+#endif
queue_.Push(
reinterpret_cast<MultiProducerSingleConsumerQueue::Node*>(closure));
}
@@ -176,12 +189,19 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
}
continue;
}
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle error =
+ internal::StatusMoveFromHeapPtr(closure->error_data.error);
+#else
+ grpc_error_handle error =
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
+#endif
+ closure->error_data.error = 0;
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
gpr_log(GPR_INFO, " EXECUTING FROM QUEUE: closure=%p error=%s",
- closure,
- grpc_error_std_string(closure->error_data.error).c_str());
+ closure, grpc_error_std_string(error).c_str());
}
- ScheduleClosure(closure, closure->error_data.error);
+ ScheduleClosure(closure, error);
break;
}
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
@@ -234,15 +254,24 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) {
void CallCombiner::Cancel(grpc_error_handle error) {
GRPC_STATS_INC_CALL_COMBINER_CANCELLED();
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ intptr_t status_ptr = internal::StatusAllocHeapPtr(error);
+ gpr_atm new_state = kErrorBit | status_ptr;
+#else
+ gpr_atm new_state = kErrorBit | reinterpret_cast<gpr_atm>(error);
+#endif
while (true) {
gpr_atm original_state = gpr_atm_acq_load(&cancel_state_);
grpc_error_handle original_error = DecodeCancelStateError(original_state);
if (original_error != GRPC_ERROR_NONE) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(status_ptr);
+#else
GRPC_ERROR_UNREF(error);
+#endif
break;
}
- if (gpr_atm_full_cas(&cancel_state_, original_state,
- EncodeCancelStateError(error))) {
+ if (gpr_atm_full_cas(&cancel_state_, original_state, new_state)) {
if (original_state != 0) {
grpc_closure* notify_on_cancel =
reinterpret_cast<grpc_closure*>(original_state);
diff --git a/grpc/src/core/lib/iomgr/cfstream_handle.cc b/grpc/src/core/lib/iomgr/cfstream_handle.cc
index fb112316..b94711c6 100644
--- a/grpc/src/core/lib/iomgr/cfstream_handle.cc
+++ b/grpc/src/core/lib/iomgr/cfstream_handle.cc
@@ -23,13 +23,13 @@
#ifdef GRPC_CFSTREAM
#import <CoreFoundation/CoreFoundation.h>
-#import "src/core/lib/iomgr/cfstream_handle.h"
#include <grpc/grpc.h>
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include "src/core/lib/debug/trace.h"
+#import "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error_cfstream.h"
#include "src/core/lib/iomgr/ev_apple.h"
diff --git a/grpc/src/core/lib/iomgr/closure.h b/grpc/src/core/lib/iomgr/closure.h
index b429c9e3..0b79368a 100644
--- a/grpc/src/core/lib/iomgr/closure.h
+++ b/grpc/src/core/lib/iomgr/closure.h
@@ -72,7 +72,7 @@ struct grpc_closure {
/** Once queued, the result of the closure. Before then: scratch space */
union {
- grpc_error_handle error;
+ uintptr_t error;
uintptr_t scratch;
} error_data;
@@ -98,7 +98,7 @@ inline grpc_closure* grpc_closure_init(grpc_closure* closure,
#endif
closure->cb = cb;
closure->cb_arg = cb_arg;
- closure->error_data.error = GRPC_ERROR_NONE;
+ closure->error_data.error = 0;
#ifndef NDEBUG
closure->scheduled = false;
closure->file_initiated = nullptr;
@@ -172,16 +172,12 @@ inline void grpc_closure_list_init(grpc_closure_list* closure_list) {
}
/** add \a closure to the end of \a list
- and set \a closure's result to \a error
Returns true if \a list becomes non-empty */
inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
- grpc_closure* closure,
- grpc_error_handle error) {
+ grpc_closure* closure) {
if (closure == nullptr) {
- GRPC_ERROR_UNREF(error);
return false;
}
- closure->error_data.error = error;
closure->next_data.next = nullptr;
bool was_empty = (closure_list->head == nullptr);
if (was_empty) {
@@ -193,12 +189,36 @@ inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
return was_empty;
}
+/** add \a closure to the end of \a list
+ and set \a closure's result to \a error
+ Returns true if \a list becomes non-empty */
+inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
+ grpc_closure* closure,
+ grpc_error_handle error) {
+ if (closure == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return false;
+ }
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(error);
+#else
+ closure->error_data.error = reinterpret_cast<intptr_t>(error);
+#endif
+ return grpc_closure_list_append(closure_list, closure);
+}
+
/** force all success bits in \a list to false */
inline void grpc_closure_list_fail_all(grpc_closure_list* list,
grpc_error_handle forced_failure) {
for (grpc_closure* c = list->head; c != nullptr; c = c->next_data.next) {
- if (c->error_data.error == GRPC_ERROR_NONE) {
- c->error_data.error = GRPC_ERROR_REF(forced_failure);
+ if (c->error_data.error == 0) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ c->error_data.error =
+ grpc_core::internal::StatusAllocHeapPtr(forced_failure);
+#else
+ c->error_data.error =
+ reinterpret_cast<intptr_t>(GRPC_ERROR_REF(forced_failure));
+#endif
}
}
GRPC_ERROR_UNREF(forced_failure);
diff --git a/grpc/src/core/lib/iomgr/combiner.cc b/grpc/src/core/lib/iomgr/combiner.cc
index 48237e5a..a51364ca 100644
--- a/grpc/src/core/lib/iomgr/combiner.cc
+++ b/grpc/src/core/lib/iomgr/combiner.cc
@@ -27,11 +27,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");
@@ -128,17 +126,14 @@ static void push_first_on_exec_ctx(grpc_core::Combiner* lock) {
static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* cl,
grpc_error_handle error) {
- GPR_TIMER_SCOPE("combiner.execute", 0);
- GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_ITEMS();
gpr_atm last = gpr_atm_full_fetch_add(&lock->state, STATE_ELEM_COUNT_LOW_BIT);
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO,
"C:%p grpc_combiner_execute c=%p last=%" PRIdPTR,
lock, cl, last));
if (last == 1) {
- GRPC_STATS_INC_COMBINER_LOCKS_INITIATED();
- GPR_TIMER_MARK("combiner.initiated", 0);
- gpr_atm_no_barrier_store(&lock->initiating_exec_ctx_or_null,
- (gpr_atm)grpc_core::ExecCtx::Get());
+ gpr_atm_no_barrier_store(
+ &lock->initiating_exec_ctx_or_null,
+ reinterpret_cast<gpr_atm>(grpc_core::ExecCtx::Get()));
// first element on this list: add it to the list of combiner locks
// executing within this exec_ctx
push_last_on_exec_ctx(lock);
@@ -154,7 +149,11 @@ static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* cl,
}
GPR_ASSERT(last & STATE_UNORPHANED); // ensure lock has not been destroyed
assert(cl->cb);
- cl->error_data.error = error;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ cl->error_data.error = grpc_core::internal::StatusAllocHeapPtr(error);
+#else
+ cl->error_data.error = reinterpret_cast<intptr_t>(error);
+#endif
lock->queue.Push(cl->next_data.mpscq_node.get());
}
@@ -174,14 +173,12 @@ static void offload(void* arg, grpc_error_handle /*error*/) {
}
static void queue_offload(grpc_core::Combiner* lock) {
- GRPC_STATS_INC_COMBINER_LOCKS_OFFLOADED();
move_next();
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p queue_offload", lock));
grpc_core::Executor::Run(&lock->offload, GRPC_ERROR_NONE);
}
bool grpc_combiner_continue_exec_ctx() {
- GPR_TIMER_SCOPE("combiner.continue_exec_ctx", 0);
grpc_core::Combiner* lock =
grpc_core::ExecCtx::Get()->combiner_data()->active_combiner;
if (lock == nullptr) {
@@ -206,9 +203,8 @@ bool grpc_combiner_continue_exec_ctx() {
// 3. the current thread is not a worker for any background poller
// 4. the DEFAULT executor is threaded
if (contended && grpc_core::ExecCtx::Get()->IsReadyToFinish() &&
- !grpc_iomgr_is_any_background_poller_thread() &&
+ !grpc_iomgr_platform_is_any_background_poller_thread() &&
grpc_core::Executor::IsThreadedDefault()) {
- GPR_TIMER_MARK("offload_from_finished_exec_ctx", 0);
// this execution context wants to move on: schedule remaining work to be
// picked up on the executor
queue_offload(lock);
@@ -225,39 +221,53 @@ bool grpc_combiner_continue_exec_ctx() {
if (n == nullptr) {
// queue is in an inconsistent state: use this as a cue that we should
// go off and do something else for a while (and come back later)
- GPR_TIMER_MARK("delay_busy", 0);
queue_offload(lock);
return true;
}
- GPR_TIMER_SCOPE("combiner.exec1", 0);
grpc_closure* cl = reinterpret_cast<grpc_closure*>(n);
- grpc_error_handle cl_err = cl->error_data.error;
#ifndef NDEBUG
cl->scheduled = false;
#endif
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle cl_err =
+ grpc_core::internal::StatusMoveFromHeapPtr(cl->error_data.error);
+ cl->error_data.error = 0;
+ cl->cb(cl->cb_arg, std::move(cl_err));
+#else
+ grpc_error_handle cl_err =
+ reinterpret_cast<grpc_error_handle>(cl->error_data.error);
+ cl->error_data.error = 0;
cl->cb(cl->cb_arg, cl_err);
GRPC_ERROR_UNREF(cl_err);
+#endif
} else {
grpc_closure* c = lock->final_list.head;
GPR_ASSERT(c != nullptr);
grpc_closure_list_init(&lock->final_list);
int loops = 0;
while (c != nullptr) {
- GPR_TIMER_SCOPE("combiner.exec_1final", 0);
GRPC_COMBINER_TRACE(
gpr_log(GPR_INFO, "C:%p execute_final[%d] c=%p", lock, loops, c));
grpc_closure* next = c->next_data.next;
- grpc_error_handle error = c->error_data.error;
#ifndef NDEBUG
c->scheduled = false;
#endif
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle error =
+ grpc_core::internal::StatusMoveFromHeapPtr(c->error_data.error);
+ c->error_data.error = 0;
+ c->cb(c->cb_arg, std::move(error));
+#else
+ grpc_error_handle error =
+ reinterpret_cast<grpc_error_handle>(c->error_data.error);
+ c->error_data.error = 0;
c->cb(c->cb_arg, error);
GRPC_ERROR_UNREF(error);
+#endif
c = next;
}
}
- GPR_TIMER_MARK("unref", 0);
move_next();
lock->time_to_execute_final_list = false;
gpr_atm old_state =
@@ -304,13 +314,10 @@ static void combiner_finally_exec(grpc_core::Combiner* lock,
grpc_closure* closure,
grpc_error_handle error) {
GPR_ASSERT(lock != nullptr);
- GPR_TIMER_SCOPE("combiner.execute_finally", 0);
- GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS();
GRPC_COMBINER_TRACE(gpr_log(
GPR_INFO, "C:%p grpc_combiner_execute_finally c=%p; ac=%p", lock, closure,
grpc_core::ExecCtx::Get()->combiner_data()->active_combiner));
if (grpc_core::ExecCtx::Get()->combiner_data()->active_combiner != lock) {
- GPR_TIMER_MARK("slowpath", 0);
// Using error_data.scratch to store the combiner so that it can be accessed
// in enqueue_finally.
closure->error_data.scratch = reinterpret_cast<uintptr_t>(lock);
@@ -326,9 +333,10 @@ static void combiner_finally_exec(grpc_core::Combiner* lock,
static void enqueue_finally(void* closure, grpc_error_handle error) {
grpc_closure* cl = static_cast<grpc_closure*>(closure);
- combiner_finally_exec(
- reinterpret_cast<grpc_core::Combiner*>(cl->error_data.scratch), cl,
- GRPC_ERROR_REF(error));
+ grpc_core::Combiner* lock =
+ reinterpret_cast<grpc_core::Combiner*>(cl->error_data.scratch);
+ cl->error_data.scratch = 0;
+ combiner_finally_exec(lock, cl, GRPC_ERROR_REF(error));
}
namespace grpc_core {
diff --git a/grpc/src/core/lib/iomgr/combiner.h b/grpc/src/core/lib/iomgr/combiner.h
index efa2bce6..3b9ddfce 100644
--- a/grpc/src/core/lib/iomgr/combiner.h
+++ b/grpc/src/core/lib/iomgr/combiner.h
@@ -24,6 +24,7 @@
#include <stddef.h>
#include <grpc/support/atm.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.h"
diff --git a/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc b/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
index dc0eafeb..2d771133 100644
--- a/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
+++ b/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
@@ -23,6 +23,7 @@
#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
diff --git a/grpc/src/core/lib/iomgr/endpoint.cc b/grpc/src/core/lib/iomgr/endpoint.cc
index 4c84501a..a2f864c7 100644
--- a/grpc/src/core/lib/iomgr/endpoint.cc
+++ b/grpc/src/core/lib/iomgr/endpoint.cc
@@ -62,10 +62,6 @@ absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* 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) {
- return ep->vtable->get_resource_user(ep);
-}
-
bool grpc_endpoint_can_track_err(grpc_endpoint* ep) {
return ep->vtable->can_track_err(ep);
}
diff --git a/grpc/src/core/lib/iomgr/endpoint.h b/grpc/src/core/lib/iomgr/endpoint.h
index 4db5e3de..ce66f6fa 100644
--- a/grpc/src/core/lib/iomgr/endpoint.h
+++ b/grpc/src/core/lib/iomgr/endpoint.h
@@ -26,9 +26,9 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
-#include "src/core/lib/iomgr/resource_quota.h"
/* An endpoint caps a streaming channel between two communicating processes.
Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */
@@ -46,7 +46,6 @@ struct grpc_endpoint_vtable {
void (*delete_from_pollset_set)(grpc_endpoint* ep, grpc_pollset_set* pollset);
void (*shutdown)(grpc_endpoint* ep, grpc_error_handle why);
void (*destroy)(grpc_endpoint* ep);
- grpc_resource_user* (*get_resource_user)(grpc_endpoint* ep);
absl::string_view (*get_peer)(grpc_endpoint* ep);
absl::string_view (*get_local_address)(grpc_endpoint* ep);
int (*get_fd)(grpc_endpoint* ep);
@@ -99,8 +98,6 @@ void grpc_endpoint_add_to_pollset_set(grpc_endpoint* ep,
void grpc_endpoint_delete_from_pollset_set(grpc_endpoint* ep,
grpc_pollset_set* pollset_set);
-grpc_resource_user* grpc_endpoint_get_resource_user(grpc_endpoint* ep);
-
bool grpc_endpoint_can_track_err(grpc_endpoint* ep);
struct grpc_endpoint {
diff --git a/grpc/src/core/lib/iomgr/endpoint_cfstream.cc b/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
index 63945065..599f34aa 100644
--- a/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
+++ b/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
@@ -23,7 +23,6 @@
#ifdef GRPC_CFSTREAM_ENDPOINT
#import <CoreFoundation/CoreFoundation.h>
-#import "src/core/lib/iomgr/endpoint_cfstream.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
@@ -34,6 +33,7 @@
#include "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
+#import "src/core/lib/iomgr/endpoint_cfstream.h"
#include "src/core/lib/iomgr/error_cfstream.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -59,11 +59,8 @@ struct CFStreamEndpoint {
std::string peer_string;
std::string local_address;
- grpc_resource_user* resource_user;
- grpc_resource_user_slice_allocator slice_allocator;
};
static void CFStreamFree(CFStreamEndpoint* ep) {
- grpc_resource_user_unref(ep->resource_user);
CFRelease(ep->read_stream);
CFRelease(ep->write_stream);
CFSTREAM_HANDLE_UNREF(ep->stream_sync, "free");
@@ -111,8 +108,7 @@ static grpc_error_handle CFStreamAnnotateError(grpc_error_handle src_error,
return grpc_error_set_str(
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_ERROR_STR_TARGET_ADDRESS, ep->peer_string);
}
static void CallReadCb(CFStreamEndpoint* ep, grpc_error_handle error) {
@@ -151,7 +147,7 @@ static void CallWriteCb(CFStreamEndpoint* ep, grpc_error_handle error) {
static void ReadAction(void* arg, grpc_error_handle error) {
CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
GPR_ASSERT(ep->read_cb != nullptr);
- if (error) {
+ if (error != GRPC_ERROR_NONE) {
grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
CallReadCb(ep, GRPC_ERROR_REF(error));
EP_UNREF(ep, "read");
@@ -193,7 +189,7 @@ static void ReadAction(void* arg, grpc_error_handle error) {
static void WriteAction(void* arg, grpc_error_handle error) {
CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
GPR_ASSERT(ep->write_cb != nullptr);
- if (error) {
+ if (error != GRPC_ERROR_NONE) {
grpc_slice_buffer_reset_and_unref_internal(ep->write_slices);
CallWriteCb(ep, GRPC_ERROR_REF(error));
EP_UNREF(ep, "write");
@@ -240,17 +236,6 @@ static void WriteAction(void* arg, grpc_error_handle error) {
grpc_slice_unref_internal(slice);
}
-static void CFStreamReadAllocationDone(void* arg, grpc_error_handle error) {
- CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
- if (error == GRPC_ERROR_NONE) {
- ep->stream_sync->NotifyOnRead(&ep->read_action);
- } else {
- grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
- CallReadCb(ep, error);
- EP_UNREF(ep, "read");
- }
-}
-
static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, bool urgent) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
@@ -262,12 +247,10 @@ static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
ep_impl->read_cb = cb;
ep_impl->read_slices = slices;
grpc_slice_buffer_reset_and_unref_internal(slices);
+ grpc_slice_buffer_add_indexed(
+ slices, GRPC_SLICE_MALLOC(GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
EP_REF(ep_impl, "read");
- if (grpc_resource_user_alloc_slices(&ep_impl->slice_allocator,
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1,
- ep_impl->read_slices)) {
- ep_impl->stream_sync->NotifyOnRead(&ep_impl->read_action);
- }
+ ep_impl->stream_sync->NotifyOnRead(&ep_impl->read_action);
}
static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
@@ -287,14 +270,15 @@ static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
void CFStreamShutdown(grpc_endpoint* ep, grpc_error_handle why) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%p)", ep_impl, why);
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%s)", ep_impl,
+ grpc_error_std_string(why).c_str());
}
CFReadStreamClose(ep_impl->read_stream);
CFWriteStreamClose(ep_impl->write_stream);
ep_impl->stream_sync->Shutdown(why);
- grpc_resource_user_shutdown(ep_impl->resource_user);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%p)", ep_impl, why);
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%s)", ep_impl,
+ grpc_error_std_string(why).c_str());
}
}
@@ -306,11 +290,6 @@ void CFStreamDestroy(grpc_endpoint* ep) {
EP_UNREF(ep_impl, "destroy");
}
-grpc_resource_user* CFStreamGetResourceUser(grpc_endpoint* ep) {
- CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
- return ep_impl->resource_user;
-}
-
absl::string_view CFStreamGetPeer(grpc_endpoint* ep) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
return ep_impl->peer_string;
@@ -337,16 +316,15 @@ static const grpc_endpoint_vtable vtable = {CFStreamRead,
CFStreamDeleteFromPollsetSet,
CFStreamShutdown,
CFStreamDestroy,
- CFStreamGetResourceUser,
CFStreamGetPeer,
CFStreamGetLocalAddress,
CFStreamGetFD,
CFStreamCanTrackErr};
-grpc_endpoint* grpc_cfstream_endpoint_create(
- CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
- const char* peer_string, grpc_resource_quota* resource_quota,
- CFStreamHandle* stream_sync) {
+grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream,
+ const char* peer_string,
+ CFStreamHandle* stream_sync) {
CFStreamEndpoint* ep_impl = new CFStreamEndpoint;
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG,
@@ -387,11 +365,6 @@ grpc_endpoint* grpc_cfstream_endpoint_create(
static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&ep_impl->write_action, WriteAction,
static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
- ep_impl->resource_user =
- grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(&ep_impl->slice_allocator,
- ep_impl->resource_user,
- CFStreamReadAllocationDone, ep_impl);
return &ep_impl->base;
}
diff --git a/grpc/src/core/lib/iomgr/endpoint_cfstream.h b/grpc/src/core/lib/iomgr/endpoint_cfstream.h
index ef957c1f..6f2cf1c6 100644
--- a/grpc/src/core/lib/iomgr/endpoint_cfstream.h
+++ b/grpc/src/core/lib/iomgr/endpoint_cfstream.h
@@ -39,10 +39,10 @@
#include "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/endpoint.h"
-grpc_endpoint* grpc_cfstream_endpoint_create(
- CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
- const char* peer_string, grpc_resource_quota* resource_quota,
- CFStreamHandle* stream_sync);
+grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream,
+ const char* peer_string,
+ CFStreamHandle* stream_sync);
#endif /* GRPC_CFSTREAM */
diff --git a/grpc/src/core/lib/iomgr/endpoint_pair.h b/grpc/src/core/lib/iomgr/endpoint_pair.h
index e01185b9..6150b5bb 100644
--- a/grpc/src/core/lib/iomgr/endpoint_pair.h
+++ b/grpc/src/core/lib/iomgr/endpoint_pair.h
@@ -27,6 +27,7 @@ struct grpc_endpoint_pair {
grpc_endpoint* client;
grpc_endpoint* server;
};
+
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_channel_args* args);
diff --git a/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc b/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc
new file mode 100644
index 00000000..7c0c1008
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc
@@ -0,0 +1,32 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <stdlib.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/port.h"
+
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
+ const char* /* name */, grpc_channel_args* /* args */) {
+ // TODO(hork): determine what's needed here in the long run
+ GPR_ASSERT(
+ false &&
+ "grpc_iomgr_create_endpoint_pair is not suppoted with event_engine");
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc b/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
index a1a04ebf..1acf241b 100644
--- a/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -22,10 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_TCP
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
#include <errno.h>
#include <fcntl.h>
#include <string.h>
@@ -38,8 +34,13 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
static void create_sockets(int sv[2]) {
int flags;
@@ -57,16 +58,17 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
int sv[2];
grpc_endpoint_pair p;
create_sockets(sv);
-
grpc_core::ExecCtx exec_ctx;
-
std::string final_name = absl::StrCat(name, ":client");
+ const grpc_channel_args* new_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name.c_str(), false),
- args, "socketpair-server");
+ new_args, "socketpair-server");
final_name = absl::StrCat(name, ":server");
p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name.c_str(), false),
- args, "socketpair-client");
-
+ new_args, "socketpair-client");
+ grpc_channel_args_destroy(new_args);
return p;
}
diff --git a/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc b/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc
deleted file mode 100644
index b99d178c..00000000
--- a/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#ifdef GRPC_UV
-
-#include <stdlib.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/endpoint_pair.h"
-
-grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
- grpc_channel_args* args) {
- grpc_endpoint_pair endpoint_pair;
- // TODO(mlumish): implement this properly under libuv
- GPR_ASSERT(false &&
- "grpc_iomgr_create_endpoint_pair is not suppoted with libuv");
- return endpoint_pair;
-}
-
-#endif /* GRPC_UV */
diff --git a/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc b/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
index c1113e1e..386057b8 100644
--- a/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
+++ b/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
@@ -21,15 +21,15 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <grpc/support/log.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -71,7 +71,7 @@ static void create_sockets(SOCKET sv[2]) {
}
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
- const char* name, grpc_channel_args* channel_args) {
+ const char*, grpc_channel_args* channel_args) {
SOCKET sv[2];
grpc_endpoint_pair p;
create_sockets(sv);
@@ -80,7 +80,6 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
channel_args, "endpoint:server");
p.server = grpc_tcp_create(grpc_winsocket_create(sv[0], "endpoint:server"),
channel_args, "endpoint:client");
-
return p;
}
diff --git a/grpc/src/core/lib/iomgr/error.cc b/grpc/src/core/lib/iomgr/error.cc
index 378bdf72..7cf85831 100644
--- a/grpc/src/core/lib/iomgr/error.cc
+++ b/grpc/src/core/lib/iomgr/error.cc
@@ -22,7 +22,7 @@
#include <inttypes.h>
#include <string.h>
-#include <grpc/status.h>
+#include <grpc/impl/codegen/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -34,7 +34,6 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/error_internal.h"
-#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount(false,
@@ -59,13 +58,13 @@ absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg,
absl::Status s = StatusCreate(code, msg, location, {});
for (size_t i = 0; i < children_count; ++i) {
if (!children[i].ok()) {
- StatusAddChild(&s, children[i]);
+ grpc_core::StatusAddChild(&s, children[i]);
}
}
return s;
}
-std::string grpc_error_std_string(const absl::Status& error) {
+std::string grpc_error_std_string(absl::Status error) {
return grpc_core::StatusToString(error);
}
@@ -73,10 +72,11 @@ absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err,
const char* call_name) {
absl::Status s =
StatusCreate(absl::StatusCode::kUnknown, "OS Error", location, {});
- grpc_core::StatusSetInt(&s, grpc_core::StatusIntProperty::ERRNO, err);
- grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::OS_ERROR,
+ grpc_core::StatusSetInt(&s, grpc_core::StatusIntProperty::kErrorNo, err);
+ grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError,
strerror(err));
- grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::SYSCALL, call_name);
+ grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall,
+ call_name);
return s;
}
@@ -85,15 +85,21 @@ absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err,
const char* call_name) {
char* utf8_message = gpr_format_message(err);
absl::Status s =
- StatusCreate(absl::StatusCode::kUnknown, "WSA Error", location, {});
- StatusSetInt(&s, StatusIntProperty::WSA_ERROR, err);
- StatusSetStr(&s, StatusStrProperty::OS_ERROR, utf8_message);
- StatusSetStr(&s, StatusStrProperty::SYSCALL, call_name);
+ StatusCreate(absl::StatusCode::kUnavailable, "WSA Error", location, {});
+ StatusSetInt(&s, grpc_core::StatusIntProperty::kWsaError, err);
+ StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError, utf8_message);
+ StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall, call_name);
+ return s;
}
#endif
grpc_error_handle grpc_error_set_int(grpc_error_handle src,
grpc_error_ints which, intptr_t value) {
+ if (src == GRPC_ERROR_NONE) {
+ src = absl::UnknownError("");
+ StatusSetInt(&src, grpc_core::StatusIntProperty::kRpcStatus,
+ GRPC_STATUS_OK);
+ }
grpc_core::StatusSetInt(
&src, static_cast<grpc_core::StatusIntProperty>(which), value);
return src;
@@ -107,36 +113,100 @@ bool grpc_error_get_int(grpc_error_handle error, grpc_error_ints which,
*p = *value;
return true;
} else {
+ // TODO(veblush): Remove this once absl::Status migration is done
+ if (which == GRPC_ERROR_INT_GRPC_STATUS) {
+ switch (error.code()) {
+ case absl::StatusCode::kOk:
+ *p = GRPC_STATUS_OK;
+ return true;
+ case absl::StatusCode::kResourceExhausted:
+ *p = GRPC_STATUS_RESOURCE_EXHAUSTED;
+ return true;
+ case absl::StatusCode::kCancelled:
+ *p = GRPC_STATUS_CANCELLED;
+ return true;
+ default:
+ break;
+ }
+ }
return false;
}
}
grpc_error_handle grpc_error_set_str(grpc_error_handle src,
grpc_error_strs which,
- const grpc_slice& str) {
- grpc_core::StatusSetStr(
- &src, static_cast<grpc_core::StatusStrProperty>(which),
- std::string(reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(str)),
- GRPC_SLICE_LENGTH(str)));
+ absl::string_view str) {
+ if (src == GRPC_ERROR_NONE) {
+ src = absl::UnknownError("");
+ StatusSetInt(&src, grpc_core::StatusIntProperty::kRpcStatus,
+ GRPC_STATUS_OK);
+ }
+ if (which == GRPC_ERROR_STR_DESCRIPTION) {
+ // To change the message of absl::Status, a new instance should be created
+ // with a code and payload because it doesn't have a setter for it.
+ absl::Status s = absl::Status(src.code(), str);
+ src.ForEachPayload(
+ [&](absl::string_view type_url, const absl::Cord& payload) {
+ s.SetPayload(type_url, payload);
+ });
+ return s;
+ } else {
+ grpc_core::StatusSetStr(
+ &src, static_cast<grpc_core::StatusStrProperty>(which), str);
+ }
return src;
}
bool grpc_error_get_str(grpc_error_handle error, grpc_error_strs which,
- grpc_slice* s) {
- absl::optional<std::string> value = grpc_core::StatusGetStr(
- error, static_cast<grpc_core::StatusStrProperty>(which));
- if (value.has_value()) {
- *s = grpc_slice_from_copied_buffer(value->c_str(), value->size());
- return true;
+ std::string* s) {
+ if (which == GRPC_ERROR_STR_DESCRIPTION) {
+ // absl::Status uses the message field for GRPC_ERROR_STR_DESCRIPTION
+ // instead of using payload.
+ absl::string_view msg = error.message();
+ if (msg.empty()) {
+ return false;
+ } else {
+ *s = std::string(msg);
+ return true;
+ }
} else {
- return false;
+ absl::optional<std::string> value = grpc_core::StatusGetStr(
+ error, static_cast<grpc_core::StatusStrProperty>(which));
+ if (value.has_value()) {
+ *s = std::move(*value);
+ return true;
+ } else {
+ // TODO(veblush): Remove this once absl::Status migration is done
+ if (which == GRPC_ERROR_STR_GRPC_MESSAGE) {
+ switch (error.code()) {
+ case absl::StatusCode::kOk:
+ *s = "";
+ return true;
+ case absl::StatusCode::kResourceExhausted:
+ *s = "RESOURCE_EXHAUSTED";
+ return true;
+ case absl::StatusCode::kCancelled:
+ *s = "CANCELLED";
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+ }
}
}
grpc_error_handle grpc_error_add_child(grpc_error_handle src,
grpc_error_handle child) {
- grpc_core::StatusAddChild(&src, child);
- return src;
+ if (src.ok()) {
+ return child;
+ } else {
+ if (!child.ok()) {
+ grpc_core::StatusAddChild(&src, child);
+ }
+ return src;
+ }
}
bool grpc_log_error(const char* what, grpc_error_handle error, const char* file,
@@ -299,8 +369,8 @@ static uint8_t get_placement(grpc_error_handle* err, size_t size) {
GPR_ASSERT(*err);
uint8_t slots = static_cast<uint8_t>(size / sizeof(intptr_t));
if ((*err)->arena_size + slots > (*err)->arena_capacity) {
- (*err)->arena_capacity = static_cast<uint8_t> GPR_MIN(
- UINT8_MAX - 1, (3 * (*err)->arena_capacity / 2));
+ (*err)->arena_capacity = static_cast<uint8_t>(std::min(
+ size_t(UINT8_MAX - 1), size_t(3 * (*err)->arena_capacity / 2)));
if ((*err)->arena_size + slots > (*err)->arena_capacity) {
return UINT8_MAX;
}
@@ -375,6 +445,8 @@ static void internal_set_time(grpc_error_handle* err, grpc_error_times which,
memcpy((*err)->arena + slot, &value, sizeof(value));
}
+const char* grpc_error_string(grpc_error_handle err);
+
static void internal_add_error(grpc_error_handle* err,
grpc_error_handle new_err) {
grpc_linked_error new_last = {new_err, UINT8_MAX};
@@ -416,7 +488,6 @@ grpc_error_handle grpc_error_create(const char* file, int line,
const grpc_slice& desc,
grpc_error_handle* referencing,
size_t num_referencing) {
- GPR_TIMER_SCOPE("grpc_error_create", 0);
uint8_t initial_arena_capacity = static_cast<uint8_t>(
DEFAULT_ERROR_CAPACITY +
static_cast<uint8_t>(num_referencing * SLOTS_PER_LINKED_ERROR) +
@@ -482,13 +553,12 @@ static void ref_errs(grpc_error_handle err) {
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
reinterpret_cast<grpc_linked_error*>(err->arena + slot);
- GRPC_ERROR_REF(lerr->err);
+ (void)GRPC_ERROR_REF(lerr->err);
slot = lerr->next;
}
}
static grpc_error_handle copy_error_and_unref(grpc_error_handle in) {
- GPR_TIMER_SCOPE("copy_error_and_unref", 0);
grpc_error_handle out;
if (grpc_error_is_special(in)) {
out = GRPC_ERROR_CREATE_FROM_STATIC_STRING("unknown");
@@ -540,7 +610,6 @@ static grpc_error_handle copy_error_and_unref(grpc_error_handle in) {
grpc_error_handle grpc_error_set_int(grpc_error_handle src,
grpc_error_ints which, intptr_t value) {
- GPR_TIMER_SCOPE("grpc_error_set_int", 0);
grpc_error_handle new_err = copy_error_and_unref(src);
internal_set_int(&new_err, which, value);
return new_err;
@@ -554,16 +623,15 @@ struct special_error_status_map {
const special_error_status_map error_status_map[] = {
{GRPC_STATUS_OK, "", 0}, // GRPC_ERROR_NONE
{GRPC_STATUS_INVALID_ARGUMENT, "", 0}, // GRPC_ERROR_RESERVED_1
- {GRPC_STATUS_RESOURCE_EXHAUSTED, "Out of memory",
- strlen("Out of memory")}, // GRPC_ERROR_OOM
+ {GRPC_STATUS_RESOURCE_EXHAUSTED, "RESOURCE_EXHAUSTED",
+ strlen("RESOURCE_EXHAUSTED")}, // GRPC_ERROR_OOM
{GRPC_STATUS_INVALID_ARGUMENT, "", 0}, // GRPC_ERROR_RESERVED_2
- {GRPC_STATUS_CANCELLED, "Cancelled",
- strlen("Cancelled")}, // GRPC_ERROR_CANCELLED
+ {GRPC_STATUS_CANCELLED, "CANCELLED",
+ strlen("CANCELLED")}, // GRPC_ERROR_CANCELLED
};
bool grpc_error_get_int(grpc_error_handle err, grpc_error_ints which,
intptr_t* p) {
- GPR_TIMER_SCOPE("grpc_error_get_int", 0);
if (grpc_error_is_special(err)) {
if (which != GRPC_ERROR_INT_GRPC_STATUS) return false;
*p = error_status_map[reinterpret_cast<size_t>(err)].code;
@@ -579,28 +647,26 @@ bool grpc_error_get_int(grpc_error_handle err, grpc_error_ints which,
grpc_error_handle grpc_error_set_str(grpc_error_handle src,
grpc_error_strs which,
- const grpc_slice& str) {
- GPR_TIMER_SCOPE("grpc_error_set_str", 0);
+ absl::string_view str) {
grpc_error_handle new_err = copy_error_and_unref(src);
- internal_set_str(&new_err, which, str);
+ internal_set_str(&new_err, which,
+ grpc_slice_from_copied_buffer(str.data(), str.length()));
return new_err;
}
bool grpc_error_get_str(grpc_error_handle err, grpc_error_strs which,
- grpc_slice* str) {
+ std::string* s) {
if (grpc_error_is_special(err)) {
if (which != GRPC_ERROR_STR_GRPC_MESSAGE) return false;
const special_error_status_map& msg =
error_status_map[reinterpret_cast<size_t>(err)];
- str->refcount = &grpc_core::kNoopRefcount;
- str->data.refcounted.bytes =
- reinterpret_cast<uint8_t*>(const_cast<char*>(msg.msg));
- str->data.refcounted.length = msg.len;
+ *s = std::string(msg.msg, msg.len);
return true;
}
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
- *str = *reinterpret_cast<grpc_slice*>(err->arena + slot);
+ grpc_slice* slice = reinterpret_cast<grpc_slice*>(err->arena + slot);
+ *s = std::string(grpc_core::StringViewFromSlice(*slice));
return true;
} else {
return false;
@@ -609,7 +675,6 @@ bool grpc_error_get_str(grpc_error_handle err, grpc_error_strs which,
grpc_error_handle grpc_error_add_child(grpc_error_handle src,
grpc_error_handle child) {
- GPR_TIMER_SCOPE("grpc_error_add_child", 0);
if (src != GRPC_ERROR_NONE) {
if (child == GRPC_ERROR_NONE) {
/* \a child is empty. Simply return the ref to \a src */
@@ -630,9 +695,9 @@ grpc_error_handle grpc_error_add_child(grpc_error_handle src,
}
}
-static const char* no_error_string = "\"No Error\"";
-static const char* oom_error_string = "\"Out of memory\"";
-static const char* cancelled_error_string = "\"Cancelled\"";
+static const char* no_error_string = "\"OK\"";
+static const char* oom_error_string = "\"RESOURCE_EXHAUSTED\"";
+static const char* cancelled_error_string = "\"CANCELLED\"";
struct kv_pair {
char* key;
@@ -645,7 +710,7 @@ struct kv_pairs {
};
static void append_chr(char c, char** s, size_t* sz, size_t* cap) {
if (*sz == *cap) {
- *cap = GPR_MAX(8, 3 * *cap / 2);
+ *cap = std::max(size_t(8), 3 * *cap / 2);
*s = static_cast<char*>(gpr_realloc(*s, *cap));
}
(*s)[(*sz)++] = c;
@@ -697,7 +762,7 @@ static void append_esc_str(const uint8_t* str, size_t len, char** s, size_t* sz,
static void append_kv(kv_pairs* kvs, char* key, char* value) {
if (kvs->num_kvs == kvs->cap_kvs) {
- kvs->cap_kvs = GPR_MAX(3 * kvs->cap_kvs / 2, 4);
+ kvs->cap_kvs = std::max(3 * kvs->cap_kvs / 2, size_t(4));
kvs->kvs = static_cast<kv_pair*>(
gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs));
}
@@ -841,7 +906,6 @@ static char* finish_kvs(kv_pairs* kvs) {
}
const char* grpc_error_string(grpc_error_handle err) {
- GPR_TIMER_SCOPE("grpc_error_string", 0);
if (err == GRPC_ERROR_NONE) return no_error_string;
if (err == GRPC_ERROR_OOM) return oom_error_string;
if (err == GRPC_ERROR_CANCELLED) return cancelled_error_string;
@@ -888,24 +952,25 @@ grpc_error_handle grpc_os_error(const char* file, int line, int err,
grpc_slice_from_static_string(strerror(err)),
nullptr, 0),
GRPC_ERROR_INT_ERRNO, err),
- GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(strerror(err))),
- GRPC_ERROR_STR_SYSCALL, grpc_slice_from_copied_string(call_name));
+ GRPC_ERROR_STR_OS_ERROR, strerror(err)),
+ GRPC_ERROR_STR_SYSCALL, call_name);
}
#ifdef GPR_WINDOWS
grpc_error_handle grpc_wsa_error(const char* file, int line, int err,
const char* call_name) {
char* utf8_message = gpr_format_message(err);
- grpc_error_handle error = grpc_error_set_str(
+ grpc_error_handle error = grpc_error_set_int(
grpc_error_set_str(
- grpc_error_set_int(
- grpc_error_create(file, line,
- grpc_slice_from_static_string("OS Error"), NULL,
- 0),
- GRPC_ERROR_INT_WSA_ERROR, err),
- GRPC_ERROR_STR_OS_ERROR, grpc_slice_from_copied_string(utf8_message)),
- GRPC_ERROR_STR_SYSCALL, grpc_slice_from_static_string(call_name));
+ grpc_error_set_str(
+ grpc_error_set_int(
+ grpc_error_create(file, line,
+ grpc_slice_from_static_string("OS Error"),
+ NULL, 0),
+ GRPC_ERROR_INT_WSA_ERROR, err),
+ GRPC_ERROR_STR_OS_ERROR, utf8_message),
+ GRPC_ERROR_STR_SYSCALL, call_name),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
gpr_free(utf8_message);
return error;
}
diff --git a/grpc/src/core/lib/iomgr/error.h b/grpc/src/core/lib/iomgr/error.h
index aecd1e90..2b42841d 100644
--- a/grpc/src/core/lib/iomgr/error.h
+++ b/grpc/src/core/lib/iomgr/error.h
@@ -24,15 +24,17 @@
#include <inttypes.h>
#include <stdbool.h>
+#include "absl/status/status.h"
+
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gprpp/status_helper.h"
-
-#include "absl/status/status.h"
+#include "src/core/lib/slice/slice_internal.h"
/// Opaque representation of an error.
/// See https://github.com/grpc/grpc/blob/master/doc/core/grpc-error.md for a
@@ -143,8 +145,6 @@ typedef enum {
GRPC_ERROR_TIME_MAX,
} grpc_error_times;
-// DEPRECATED: Use grpc_error_std_string instead
-const char* grpc_error_string(grpc_error_handle error);
std::string grpc_error_std_string(grpc_error_handle error);
// debug only toggles that allow for a sanity to check that ensures we will
@@ -155,18 +155,20 @@ void grpc_enable_error_creation();
#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
#define GRPC_ERROR_NONE absl::OkStatus()
-#define GRPC_ERROR_OOM absl::Status(absl::ResourceExhaustedError)
+#define GRPC_ERROR_OOM absl::Status(absl::ResourceExhaustedError(""))
#define GRPC_ERROR_CANCELLED absl::CancelledError()
#define GRPC_ERROR_REF(err) (err)
-#define GRPC_ERROR_UNREF(err)
+#define GRPC_ERROR_UNREF(err) (void)(err)
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc) \
StatusCreate(absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
#define GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) \
StatusCreate(absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc) \
+ StatusCreate(absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
#define GRPC_ERROR_CREATE_FROM_STRING_VIEW(desc) \
- StatusCreate(ababsl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+ StatusCreate(absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg,
const grpc_core::DebugLocation& location,
@@ -186,11 +188,11 @@ absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg,
// them. If the vector is empty, return GRPC_ERROR_NONE.
template <typename VectorType>
static absl::Status grpc_status_create_from_vector(
- const grpc_core::DebugLocation& location, const char* desc,
+ const grpc_core::DebugLocation& location, absl::string_view desc,
VectorType* error_list) {
absl::Status error = GRPC_ERROR_NONE;
if (error_list->size() != 0) {
- error = grpc_status_create(absl::StatusCode::kUnknown, desc, DEBUG_LOCATION,
+ error = grpc_status_create(absl::StatusCode::kUnknown, desc, location,
error_list->size(), error_list->data());
error_list->clear();
}
@@ -199,6 +201,8 @@ static absl::Status grpc_status_create_from_vector(
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) \
grpc_status_create_from_vector(DEBUG_LOCATION, desc, error_list)
+#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(desc, error_list) \
+ grpc_status_create_from_vector(DEBUG_LOCATION, desc, error_list)
absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err,
const char* call_name) GRPC_MUST_USE_RESULT;
@@ -286,6 +290,9 @@ grpc_error_handle grpc_error_create(const char* file, int line,
#define GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) \
grpc_error_create(__FILE__, __LINE__, grpc_slice_from_copied_string(desc), \
NULL, 0)
+#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc) \
+ grpc_error_create(__FILE__, __LINE__, grpc_slice_from_cpp_string(desc), \
+ NULL, 0)
#define GRPC_ERROR_CREATE_FROM_STRING_VIEW(desc) \
grpc_error_create( \
__FILE__, __LINE__, \
@@ -301,18 +308,24 @@ grpc_error_handle grpc_error_create(const char* file, int line,
errs, count)
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) \
- grpc_error_create_from_vector(__FILE__, __LINE__, desc, error_list)
+ grpc_error_create_from_vector( \
+ __FILE__, __LINE__, grpc_slice_from_static_string, desc, error_list)
+#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(desc, error_list) \
+ grpc_error_create_from_vector(__FILE__, __LINE__, \
+ grpc_slice_from_cpp_string, desc, error_list)
// 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_handle grpc_error_create_from_vector(const char* file,
- int line,
- const char* desc,
- VectorType* error_list) {
+template <typename VectorType, typename StringType,
+ typename SliceFromStringFunction>
+static grpc_error_handle grpc_error_create_from_vector(
+ const char* file, int line,
+ SliceFromStringFunction slice_from_string_function, StringType desc,
+ VectorType* error_list) {
grpc_error_handle error = GRPC_ERROR_NONE;
if (error_list->size() != 0) {
- error = grpc_error_create(file, line, grpc_slice_from_static_string(desc),
+ error = grpc_error_create(file, line,
+ slice_from_string_function(std::move(desc)),
error_list->data(), error_list->size());
// Remove refs to all errors in error_list.
for (size_t i = 0; i < error_list->size(); i++) {
@@ -349,15 +362,12 @@ grpc_error_handle grpc_error_set_int(grpc_error_handle src,
/// intptr_t for `p`, even if the value of `p` is not used.
bool grpc_error_get_int(grpc_error_handle error, grpc_error_ints which,
intptr_t* p);
-/// This call takes ownership of the slice; the error is responsible for
-/// eventually unref-ing it.
grpc_error_handle grpc_error_set_str(
grpc_error_handle src, grpc_error_strs which,
- const grpc_slice& str) GRPC_MUST_USE_RESULT;
+ absl::string_view str) GRPC_MUST_USE_RESULT;
/// Returns false if the specified string is not set.
-/// Caller does NOT own the slice.
bool grpc_error_get_str(grpc_error_handle error, grpc_error_strs which,
- grpc_slice* s);
+ std::string* str);
/// Add a child error: an error that is believed to have contributed to this
/// error occurring. Allows root causing high level errors from lower level
@@ -384,4 +394,47 @@ inline bool grpc_log_if_error(const char* what, grpc_error_handle error,
#define GRPC_LOG_IF_ERROR(what, error) \
(grpc_log_if_error((what), (error), __FILE__, __LINE__))
+/// Helper class to get & set grpc_error_handle in a thread-safe fashion.
+/// This could be considered as atomic<grpc_error_handle>.
+class AtomicError {
+ public:
+ AtomicError() {
+ error_ = GRPC_ERROR_NONE;
+ lock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
+ }
+ explicit AtomicError(grpc_error_handle error) {
+ error_ = GRPC_ERROR_REF(error);
+ }
+ ~AtomicError() { GRPC_ERROR_UNREF(error_); }
+
+ AtomicError(const AtomicError&) = delete;
+ AtomicError& operator=(const AtomicError&) = delete;
+
+ /// returns get() == GRPC_ERROR_NONE
+ bool ok() {
+ gpr_spinlock_lock(&lock_);
+ bool ret = error_ == GRPC_ERROR_NONE;
+ gpr_spinlock_unlock(&lock_);
+ return ret;
+ }
+
+ grpc_error_handle get() {
+ gpr_spinlock_lock(&lock_);
+ grpc_error_handle ret = error_;
+ gpr_spinlock_unlock(&lock_);
+ return ret;
+ }
+
+ void set(grpc_error_handle error) {
+ gpr_spinlock_lock(&lock_);
+ GRPC_ERROR_UNREF(error_);
+ error_ = GRPC_ERROR_REF(error);
+ gpr_spinlock_unlock(&lock_);
+ }
+
+ private:
+ grpc_error_handle error_;
+ gpr_spinlock lock_;
+};
+
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */
diff --git a/grpc/src/core/lib/iomgr/error_cfstream.cc b/grpc/src/core/lib/iomgr/error_cfstream.cc
index 114b3f2e..84052aae 100644
--- a/grpc/src/core/lib/iomgr/error_cfstream.cc
+++ b/grpc/src/core/lib/iomgr/error_cfstream.cc
@@ -19,12 +19,12 @@
#include <grpc/support/port_platform.h>
#ifdef GRPC_CFSTREAM
+#include <CoreFoundation/CoreFoundation.h>
+
#include <string>
#include "absl/strings/str_format.h"
-#include <CoreFoundation/CoreFoundation.h>
-
#include <grpc/support/alloc.h>
#include "src/core/lib/iomgr/error.h"
@@ -48,7 +48,12 @@ grpc_error_handle grpc_error_create_from_cferror(const char* file, int line,
absl::StrFormat("%s (error domain:%s, code:%ld, description:%s)",
custom_desc, buf_domain, code, buf_desc);
CFRelease(desc);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ return StatusCreate(absl::StatusCode::kUnknown, error_msg,
+ grpc_core::DebugLocation(file, line), {});
+#else
return grpc_error_create(
file, line, grpc_slice_from_copied_string(error_msg.c_str()), NULL, 0);
+#endif
}
#endif /* GRPC_CFSTREAM */
diff --git a/grpc/src/core/lib/iomgr/error_internal.h b/grpc/src/core/lib/iomgr/error_internal.h
index 50c1ddeb..8959ed13 100644
--- a/grpc/src/core/lib/iomgr/error_internal.h
+++ b/grpc/src/core/lib/iomgr/error_internal.h
@@ -25,6 +25,7 @@
#include <stdbool.h> // TODO(unknown): , do we need this?
#include <grpc/support/sync.h>
+
#include "src/core/lib/iomgr/error.h"
#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
diff --git a/grpc/src/core/lib/iomgr/ev_apple.cc b/grpc/src/core/lib/iomgr/ev_apple.cc
index 25805826..1270183a 100644
--- a/grpc/src/core/lib/iomgr/ev_apple.cc
+++ b/grpc/src/core/lib/iomgr/ev_apple.cc
@@ -221,9 +221,10 @@ static void pollset_global_shutdown(void) {
/// these events will eventually trigger the kick.
static grpc_error_handle pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
GRPC_POLLING_TRACE("pollset work: %p, worker: %p, deadline: %" PRIu64,
- pollset, worker, deadline);
+ pollset, worker,
+ deadline.milliseconds_after_process_epoch());
GrpcApplePollset* apple_pollset =
reinterpret_cast<GrpcApplePollset*>(pollset);
GrpcAppleWorker actual_worker;
@@ -241,8 +242,8 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
while (!actual_worker.kicked && !apple_pollset->is_shutdown) {
if (actual_worker.cv.WaitWithDeadline(
- &apple_pollset->mu, grpc_core::ToAbslTime(grpc_millis_to_timespec(
- deadline, GPR_CLOCK_REALTIME)))) {
+ &apple_pollset->mu, grpc_core::ToAbslTime(deadline.as_timespec(
+ GPR_CLOCK_REALTIME)))) {
// timed out
break;
}
@@ -313,7 +314,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
GrpcApplePollset* apple_pollset =
reinterpret_cast<GrpcApplePollset*>(pollset);
apple_pollset->is_shutdown = true;
- pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
+ (void)pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
// If there is any worker blocked, shutdown will be done asynchronously.
if (apple_pollset->workers.empty()) {
diff --git a/grpc/src/core/lib/iomgr/ev_apple.h b/grpc/src/core/lib/iomgr/ev_apple.h
index a05f91ce..6397ed4c 100644
--- a/grpc/src/core/lib/iomgr/ev_apple.h
+++ b/grpc/src/core/lib/iomgr/ev_apple.h
@@ -40,4 +40,4 @@ extern grpc_pollset_set_vtable grpc_apple_pollset_set_vtable;
#endif
-#endif
+#endif // GRPC_CORE_LIB_IOMGR_EV_APPLE_H
diff --git a/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc b/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
index f09cd78b..0009d140 100644
--- a/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -18,15 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/port.h"
+
/* This polling engine is only relevant on linux kernels supporting epoll
epoll_create() or epoll_create1() */
#ifdef GRPC_LINUX_EPOLL
-#include "src/core/lib/iomgr/ev_epoll1_linux.h"
-
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -54,6 +52,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/block_annotate.h"
+#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/lockfree_event.h"
@@ -196,7 +195,7 @@ struct grpc_pollset_worker {
(worker)->kick_state_mutator = __LINE__; \
} while (false)
-#define MAX_NEIGHBORHOODS 1024
+#define MAX_NEIGHBORHOODS 1024u
typedef struct pollset_neighborhood {
union {
@@ -464,8 +463,8 @@ static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
* Pollset Definitions
*/
-GPR_TLS_DECL(g_current_thread_pollset);
-GPR_TLS_DECL(g_current_thread_worker);
+static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_pollset;
+static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker;
/* The designated poller */
static gpr_atm g_active_poller;
@@ -515,8 +514,6 @@ static size_t choose_neighborhood(void) {
}
static grpc_error_handle pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_pollset);
- gpr_tls_init(&g_current_thread_worker);
gpr_atm_no_barrier_store(&g_active_poller, 0);
global_wakeup_fd.read_fd = -1;
grpc_error_handle err = grpc_wakeup_fd_init(&global_wakeup_fd);
@@ -528,7 +525,8 @@ static grpc_error_handle pollset_global_init(void) {
&ev) != 0) {
return GRPC_OS_ERROR(errno, "epoll_ctl");
}
- g_num_neighborhoods = GPR_CLAMP(gpr_cpu_num_cores(), 1, MAX_NEIGHBORHOODS);
+ g_num_neighborhoods =
+ grpc_core::Clamp(gpr_cpu_num_cores(), 1u, MAX_NEIGHBORHOODS);
g_neighborhoods = static_cast<pollset_neighborhood*>(
gpr_zalloc(sizeof(*g_neighborhoods) * g_num_neighborhoods));
for (size_t i = 0; i < g_num_neighborhoods; i++) {
@@ -538,8 +536,6 @@ static grpc_error_handle pollset_global_init(void) {
}
static void pollset_global_shutdown(void) {
- gpr_tls_destroy(&g_current_thread_pollset);
- gpr_tls_destroy(&g_current_thread_worker);
if (global_wakeup_fd.read_fd != -1) grpc_wakeup_fd_destroy(&global_wakeup_fd);
for (size_t i = 0; i < g_num_neighborhoods; i++) {
gpr_mu_destroy(&g_neighborhoods[i].mu);
@@ -643,9 +639,9 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
pollset_maybe_finish_shutdown(pollset);
}
-static int poll_deadline_to_millis_timeout(grpc_millis millis) {
- if (millis == GRPC_MILLIS_INF_FUTURE) return -1;
- grpc_millis delta = millis - grpc_core::ExecCtx::Get()->Now();
+static int poll_deadline_to_millis_timeout(grpc_core::Timestamp millis) {
+ if (millis == grpc_core::Timestamp::InfFuture()) return -1;
+ int64_t delta = (millis - grpc_core::ExecCtx::Get()->Now()).millis();
if (delta > INT_MAX) {
return INT_MAX;
} else if (delta < 0) {
@@ -715,7 +711,8 @@ static grpc_error_handle process_epoll_events(grpc_pollset* /*pollset*/) {
NOTE ON SYNCHRONIZATION: At any point of time, only the g_active_poller
(i.e the designated poller thread) will be calling this function. So there is
no need for any synchronization when accesing fields in g_epoll_set */
-static grpc_error_handle do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) {
+static grpc_error_handle do_epoll_wait(grpc_pollset* ps,
+ grpc_core::Timestamp deadline) {
GPR_TIMER_SCOPE("do_epoll_wait", 0);
int r;
@@ -748,7 +745,7 @@ static grpc_error_handle do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) {
static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
GPR_TIMER_SCOPE("begin_worker", 0);
if (worker_hdl != nullptr) *worker_hdl = worker;
worker->initialized_cv = false;
@@ -835,7 +832,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
}
if (gpr_cv_wait(&worker->cv, &pollset->mu,
- grpc_millis_to_timespec(deadline, GPR_CLOCK_MONOTONIC)) &&
+ deadline.as_timespec(GPR_CLOCK_MONOTONIC)) &&
worker->state == UNKICKED) {
/* If gpr_cv_wait returns true (i.e a timeout), pretend that the worker
received a kick */
@@ -1016,7 +1013,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
ensure that it is held by the time the function returns */
static grpc_error_handle pollset_work(grpc_pollset* ps,
grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
grpc_pollset_worker worker;
grpc_error_handle error = GRPC_ERROR_NONE;
@@ -1027,8 +1024,8 @@ static grpc_error_handle pollset_work(grpc_pollset* ps,
}
if (begin_worker(ps, &worker, worker_hdl, deadline)) {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)ps);
- gpr_tls_set(&g_current_thread_worker, (intptr_t)&worker);
+ g_current_thread_pollset = ps;
+ g_current_thread_worker = &worker;
GPR_ASSERT(!ps->shutting_down);
GPR_ASSERT(!ps->seen_inactive);
@@ -1055,13 +1052,13 @@ static grpc_error_handle pollset_work(grpc_pollset* ps,
gpr_mu_lock(&ps->mu); /* lock */
- gpr_tls_set(&g_current_thread_worker, 0);
+ g_current_thread_worker = nullptr;
} else {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)ps);
+ g_current_thread_pollset = ps;
}
end_worker(ps, &worker, worker_hdl);
- gpr_tls_set(&g_current_thread_pollset, 0);
+ g_current_thread_pollset = nullptr;
return error;
}
@@ -1074,9 +1071,8 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset,
std::vector<std::string> log;
log.push_back(absl::StrFormat(
"PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset, specific_worker,
- reinterpret_cast<void*>(gpr_tls_get(&g_current_thread_pollset)),
- reinterpret_cast<void*>(gpr_tls_get(&g_current_thread_worker)),
- pollset->root_worker));
+ static_cast<void*>(g_current_thread_pollset),
+ static_cast<void*>(g_current_thread_worker), pollset->root_worker));
if (pollset->root_worker != nullptr) {
log.push_back(absl::StrFormat(
" {kick_state=%s next=%p {kick_state=%s}}",
@@ -1092,8 +1088,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset,
}
if (specific_worker == nullptr) {
- if (gpr_tls_get(&g_current_thread_pollset) !=
- reinterpret_cast<intptr_t>(pollset)) {
+ if (g_current_thread_pollset != pollset) {
grpc_pollset_worker* root_worker = pollset->root_worker;
if (root_worker == nullptr) {
GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER();
@@ -1185,8 +1180,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset,
gpr_log(GPR_INFO, " .. specific worker already kicked");
}
goto done;
- } else if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ } else if (g_current_thread_worker == specific_worker) {
GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD();
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, " .. mark %p kicked", specific_worker);
diff --git a/grpc/src/core/lib/iomgr/ev_epollex_linux.cc b/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
deleted file mode 100644
index 72d7da76..00000000
--- a/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
+++ /dev/null
@@ -1,1661 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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"
-
-#include <grpc/support/log.h>
-
-/* This polling engine is only relevant on linux kernels supporting epoll() */
-#ifdef GRPC_LINUX_EPOLL_CREATE1
-
-#include "src/core/lib/iomgr/ev_epollex_linux.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <limits.h>
-#include <poll.h>
-#include <pthread.h>
-#include <string.h>
-#include <sys/epoll.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "absl/container/inlined_vector.h"
-#include "absl/strings/str_cat.h"
-#include "absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/lib/debug/stats.h"
-#include "src/core/lib/gpr/spinlock.h"
-#include "src/core/lib/gpr/tls.h"
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/manual_constructor.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/block_annotate.h"
-#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/is_epollexclusive_available.h"
-#include "src/core/lib/iomgr/lockfree_event.h"
-#include "src/core/lib/iomgr/sys_epoll_wrapper.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-#include "src/core/lib/profiling/timers.h"
-
-// debug aid: create workers on the heap (allows asan to spot
-// use-after-destruction)
-//#define GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP 1
-
-#define MAX_EPOLL_EVENTS 100
-#define MAX_FDS_IN_CACHE 32
-
-grpc_core::DebugOnlyTraceFlag grpc_trace_pollable_refcount(false,
- "pollable_refcount");
-
-/*******************************************************************************
- * pollable Declarations
- */
-
-typedef enum { PO_MULTI, PO_FD, PO_EMPTY } pollable_type;
-
-typedef struct pollable pollable;
-
-/// A pollable is something that can be polled: it has an epoll set to poll on,
-/// and a wakeup fd for kicks
-/// There are three broad types:
-/// - PO_EMPTY - the empty pollable, used before file descriptors are added to
-/// a pollset
-/// - PO_FD - a pollable containing only one FD - used to optimize single-fd
-/// pollsets (which are common with synchronous api usage)
-/// - PO_MULTI - a pollable containing many fds
-struct pollable {
- pollable_type type; // immutable
- grpc_core::RefCount refs;
-
- int epfd;
- grpc_wakeup_fd wakeup;
-
- // The following are relevant only for type PO_FD
- grpc_fd* owner_fd; // Set to the owner_fd if the type is PO_FD
- gpr_mu owner_orphan_mu; // Synchronizes access to owner_orphaned field
- bool owner_orphaned; // Is the owner fd orphaned
-
- grpc_pollset_set* pollset_set;
- pollable* next;
- pollable* prev;
-
- gpr_mu mu;
- grpc_pollset_worker* root_worker;
-
- int event_cursor;
- int event_count;
- struct epoll_event events[MAX_EPOLL_EVENTS];
-};
-
-static const char* pollable_type_string(pollable_type t) {
- switch (t) {
- case PO_MULTI:
- return "pollset";
- case PO_FD:
- return "fd";
- case PO_EMPTY:
- return "empty";
- }
- return "<invalid>";
-}
-
-static std::string pollable_desc(pollable* p) {
- return 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
-/// added
-static pollable* g_empty_pollable;
-
-static grpc_error_handle pollable_create(pollable_type type, pollable** p);
-static pollable* pollable_ref(pollable* p,
- const grpc_core::DebugLocation& dbg_loc,
- const char* reason) {
- p->refs.Ref(dbg_loc, reason);
- return p;
-}
-static void pollable_unref(pollable* p, const grpc_core::DebugLocation& dbg_loc,
- const char* reason) {
- if (p == nullptr) return;
- if (GPR_UNLIKELY(p != nullptr && p->refs.Unref(dbg_loc, reason))) {
- GRPC_FD_TRACE("pollable_unref: Closing epfd: %d", p->epfd);
- close(p->epfd);
- grpc_wakeup_fd_destroy(&p->wakeup);
- gpr_mu_destroy(&p->owner_orphan_mu);
- gpr_mu_destroy(&p->mu);
- gpr_free(p);
- }
-}
-#define POLLABLE_REF(p, r) pollable_ref((p), DEBUG_LOCATION, (r))
-#define POLLABLE_UNREF(p, r) pollable_unref((p), DEBUG_LOCATION, (r))
-
-/*******************************************************************************
- * Fd Declarations
- */
-
-struct grpc_fd {
- grpc_fd(int fd, const char* name, bool track_err)
- : fd(fd), track_err(track_err) {
- gpr_mu_init(&orphan_mu);
- gpr_mu_init(&pollable_mu);
- read_closure.InitEvent();
- write_closure.InitEvent();
- error_closure.InitEvent();
-
- std::string fd_name = 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());
- }
-#endif
- }
-
- // This is really the dtor, but the poller threads waking up from
- // epoll_wait() may access the (read|write|error)_closure after destruction.
- // Since the object will be added to the free pool, this behavior is
- // not going to cause issues, except spurious events if the FD is reused
- // while the race happens.
- void destroy() {
- 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.
- absl::InlinedVector<int, 1> pollset_fds_tmp;
- pollset_fds_tmp.swap(pollset_fds);
-
- gpr_mu_destroy(&pollable_mu);
- gpr_mu_destroy(&orphan_mu);
-
- read_closure.DestroyEvent();
- write_closure.DestroyEvent();
- error_closure.DestroyEvent();
-
- invalidate();
- }
-
-#ifndef NDEBUG
- /* Since an fd is never really destroyed (i.e gpr_free() is not called), it is
- * hard-to-debug cases where fd fields are accessed even after calling
- * fd_destroy(). The following invalidates fd fields to make catching such
- * errors easier */
- void invalidate() {
- fd = -1;
- gpr_atm_no_barrier_store(&refst, -1);
- memset(&orphan_mu, -1, sizeof(orphan_mu));
- memset(&pollable_mu, -1, sizeof(pollable_mu));
- pollable_obj = nullptr;
- on_done_closure = nullptr;
- memset(&iomgr_object, -1, sizeof(iomgr_object));
- track_err = false;
- }
-#else
- void invalidate() {}
-#endif
-
- int fd;
-
- // refst format:
- // bit 0 : 1=Active / 0=Orphaned
- // bits 1-n : refcount
- // Ref/Unref by two to avoid altering the orphaned bit
- gpr_atm refst = 1;
-
- gpr_mu orphan_mu;
-
- // Protects pollable_obj and pollset_fds.
- gpr_mu pollable_mu;
- 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;
- grpc_core::LockfreeEvent error_closure;
-
- struct grpc_fd* freelist_next = nullptr;
- grpc_closure* on_done_closure = nullptr;
-
- grpc_iomgr_object iomgr_object;
-
- // Do we need to track EPOLLERR events separately?
- bool track_err;
-};
-
-static void fd_global_init(void);
-static void fd_global_shutdown(void);
-
-/*******************************************************************************
- * Pollset Declarations
- */
-
-struct pwlink {
- grpc_pollset_worker* next;
- grpc_pollset_worker* prev;
-};
-typedef enum { PWLINK_POLLABLE = 0, PWLINK_POLLSET, PWLINK_COUNT } pwlinks;
-
-struct grpc_pollset_worker {
- bool kicked;
- bool initialized_cv;
-#ifndef NDEBUG
- // debug aid: which thread started this worker
- pid_t originator;
-#endif
- gpr_cv cv;
- grpc_pollset* pollset;
- pollable* pollable_obj;
-
- pwlink links[PWLINK_COUNT];
-};
-
-struct grpc_pollset {
- gpr_mu mu;
- gpr_atm worker_count;
- gpr_atm active_pollable_type;
- pollable* active_pollable;
- bool kicked_without_poller;
- grpc_closure* shutdown_closure;
- bool already_shutdown;
- grpc_pollset_worker* root_worker;
- int containing_pollset_set_count;
-};
-
-/*******************************************************************************
- * Pollset-set Declarations
- */
-
-struct grpc_pollset_set {
- grpc_core::RefCount refs;
- gpr_mu mu;
- grpc_pollset_set* parent;
-
- size_t pollset_count;
- size_t pollset_capacity;
- grpc_pollset** pollsets;
-
- size_t fd_count;
- size_t fd_capacity;
- grpc_fd** fds;
-};
-
-/*******************************************************************************
- * Common helpers
- */
-
-static bool append_error(grpc_error_handle* composite, grpc_error_handle error,
- const char* desc) {
- if (error == GRPC_ERROR_NONE) return true;
- if (*composite == GRPC_ERROR_NONE) {
- *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc);
- }
- *composite = grpc_error_add_child(*composite, error);
- return false;
-}
-
-/*******************************************************************************
- * Fd Definitions
- */
-
-/* We need to keep a freelist not because of any concerns of malloc performance
- * but instead so that implementations with multiple threads in (for example)
- * epoll_wait deal with the race between pollset removal and incoming poll
- * notifications.
- *
- * The problem is that the poller ultimately holds a reference to this
- * object, so it is very difficult to know when is safe to free it, at least
- * without some expensive synchronization.
- *
- * If we keep the object freelisted, in the worst case losing this race just
- * becomes a spurious read notification on a reused fd.
- */
-
-static grpc_fd* fd_freelist = nullptr;
-static gpr_mu fd_freelist_mu;
-
-#ifndef NDEBUG
-#define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
-#define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__)
-static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file,
- int line) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) {
- gpr_log(GPR_DEBUG,
- "FD %d %p ref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
- fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
- gpr_atm_no_barrier_load(&fd->refst) + n, reason, file, line);
- }
-#else
-#define REF_BY(fd, n, reason) \
- do { \
- ref_by(fd, n); \
- (void)(reason); \
- } while (0)
-#define UNREF_BY(fd, n, reason) \
- do { \
- unref_by(fd, n); \
- (void)(reason); \
- } while (0)
-static void ref_by(grpc_fd* fd, int n) {
-#endif
- GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
-}
-
-/* Uninitialize and add to the freelist */
-static void fd_destroy(void* arg, grpc_error_handle /*error*/) {
- grpc_fd* fd = static_cast<grpc_fd*>(arg);
- fd->destroy();
-
- /* Add the fd to the freelist */
- gpr_mu_lock(&fd_freelist_mu);
- fd->freelist_next = fd_freelist;
- fd_freelist = fd;
- gpr_mu_unlock(&fd_freelist_mu);
-}
-
-#ifndef NDEBUG
-static void unref_by(grpc_fd* fd, int n, const char* reason, const char* file,
- int line) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) {
- gpr_log(GPR_DEBUG,
- "FD %d %p unref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]",
- fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst),
- gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line);
- }
-#else
-static void unref_by(grpc_fd* fd, int n) {
-#endif
- gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n);
- if (old == n) {
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(fd_destroy, fd, grpc_schedule_on_exec_ctx),
- GRPC_ERROR_NONE);
- } else {
- GPR_ASSERT(old > n);
- }
-}
-
-static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
-
-static void fd_global_shutdown(void) {
- // TODO(guantaol): We don't have a reasonable explanation about this
- // lock()/unlock() pattern. It can be a valid barrier if there is at most one
- // pending lock() at this point. Otherwise, there is still a possibility of
- // use-after-free race. Need to reason about the code and/or clean it up.
- gpr_mu_lock(&fd_freelist_mu);
- gpr_mu_unlock(&fd_freelist_mu);
- while (fd_freelist != nullptr) {
- grpc_fd* fd = fd_freelist;
- fd_freelist = fd_freelist->freelist_next;
- gpr_free(fd);
- }
- gpr_mu_destroy(&fd_freelist_mu);
-}
-
-static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
- grpc_fd* new_fd = nullptr;
-
- gpr_mu_lock(&fd_freelist_mu);
- if (fd_freelist != nullptr) {
- new_fd = fd_freelist;
- fd_freelist = fd_freelist->freelist_next;
- }
- gpr_mu_unlock(&fd_freelist_mu);
-
- if (new_fd == nullptr) {
- new_fd = static_cast<grpc_fd*>(gpr_malloc(sizeof(grpc_fd)));
- }
-
- return new (new_fd) grpc_fd(fd, name, track_err);
-}
-
-static int fd_wrapped_fd(grpc_fd* fd) {
- int ret_fd = fd->fd;
- return (gpr_atm_acq_load(&fd->refst) & 1) ? ret_fd : -1;
-}
-
-static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
- const char* reason) {
- bool is_fd_closed = false;
-
- gpr_mu_lock(&fd->orphan_mu);
-
- // Get the fd->pollable_obj and set the owner_orphaned on that pollable to
- // true so that the pollable will no longer access its owner_fd field.
- gpr_mu_lock(&fd->pollable_mu);
- pollable* pollable_obj = fd->pollable_obj;
-
- if (pollable_obj) {
- gpr_mu_lock(&pollable_obj->owner_orphan_mu);
- pollable_obj->owner_orphaned = true;
- }
-
- fd->on_done_closure = on_done;
-
- /* If release_fd is not NULL, we should be relinquishing control of the file
- descriptor fd->fd (but we still own the grpc_fd structure). */
- if (release_fd != nullptr) {
- // Remove the FD from all epolls sets, before releasing it.
- // Otherwise, we will receive epoll events after we release the FD.
- epoll_event ev_fd;
- memset(&ev_fd, 0, sizeof(ev_fd));
- if (pollable_obj != nullptr) { // For PO_FD.
- epoll_ctl(pollable_obj->epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd);
- }
- for (size_t i = 0; i < fd->pollset_fds.size(); ++i) { // For PO_MULTI.
- const int epfd = fd->pollset_fds[i];
- epoll_ctl(epfd, EPOLL_CTL_DEL, fd->fd, &ev_fd);
- }
- *release_fd = fd->fd;
- } else {
- close(fd->fd);
- is_fd_closed = true;
- }
-
- // TODO(sreek): handle fd removal (where is_fd_closed=false)
- if (!is_fd_closed) {
- GRPC_FD_TRACE("epoll_fd %p (%d) was orphaned but not closed.", fd, fd->fd);
- }
-
- /* Remove the active status but keep referenced. We want this grpc_fd struct
- to be alive (and not added to freelist) until the end of this function */
- REF_BY(fd, 1, reason);
-
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, fd->on_done_closure, GRPC_ERROR_NONE);
-
- if (pollable_obj) {
- gpr_mu_unlock(&pollable_obj->owner_orphan_mu);
- }
-
- gpr_mu_unlock(&fd->pollable_mu);
- gpr_mu_unlock(&fd->orphan_mu);
-
- UNREF_BY(fd, 2, reason); /* Drop the reference */
-}
-
-static bool fd_is_shutdown(grpc_fd* fd) {
- return fd->read_closure.IsShutdown();
-}
-
-/* Might be called multiple times */
-static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
- if (fd->read_closure.SetShutdown(GRPC_ERROR_REF(why))) {
- if (shutdown(fd->fd, SHUT_RDWR)) {
- if (errno != ENOTCONN) {
- gpr_log(GPR_ERROR, "Error shutting down fd %d. errno: %d",
- grpc_fd_wrapped_fd(fd), errno);
- }
- }
- fd->write_closure.SetShutdown(GRPC_ERROR_REF(why));
- fd->error_closure.SetShutdown(GRPC_ERROR_REF(why));
- }
- GRPC_ERROR_UNREF(why);
-}
-
-static void fd_notify_on_read(grpc_fd* fd, grpc_closure* closure) {
- fd->read_closure.NotifyOn(closure);
-}
-
-static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
- fd->write_closure.NotifyOn(closure);
-}
-
-static void fd_notify_on_error(grpc_fd* fd, grpc_closure* closure) {
- fd->error_closure.NotifyOn(closure);
-}
-
-static bool fd_has_pollset(grpc_fd* fd, grpc_pollset* pollset) {
- const int epfd = pollset->active_pollable->epfd;
- grpc_core::MutexLockForGprMu lock(&fd->pollable_mu);
- for (size_t i = 0; i < fd->pollset_fds.size(); ++i) {
- if (fd->pollset_fds[i] == epfd) {
- return true;
- }
- }
- return false;
-}
-
-static void fd_add_pollset(grpc_fd* fd, grpc_pollset* pollset) {
- const int epfd = pollset->active_pollable->epfd;
- grpc_core::MutexLockForGprMu lock(&fd->pollable_mu);
- fd->pollset_fds.push_back(epfd);
-}
-
-/*******************************************************************************
- * Pollable Definitions
- */
-
-static grpc_error_handle pollable_create(pollable_type type, pollable** p) {
- *p = nullptr;
-
- int epfd = epoll_create1(EPOLL_CLOEXEC);
- if (epfd == -1) {
- return GRPC_OS_ERROR(errno, "epoll_create1");
- }
- GRPC_FD_TRACE("Pollable_create: created epfd: %d (type: %d)", epfd, type);
- *p = static_cast<pollable*>(gpr_malloc(sizeof(**p)));
- grpc_error_handle err = grpc_wakeup_fd_init(&(*p)->wakeup);
- if (err != GRPC_ERROR_NONE) {
- GRPC_FD_TRACE(
- "Pollable_create: closed epfd: %d (type: %d). wakeupfd_init error",
- epfd, type);
- close(epfd);
- gpr_free(*p);
- *p = nullptr;
- return err;
- }
- struct epoll_event ev;
- ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLET);
- ev.data.ptr =
- reinterpret_cast<void*>(1 | reinterpret_cast<intptr_t>(&(*p)->wakeup));
- if (epoll_ctl(epfd, EPOLL_CTL_ADD, (*p)->wakeup.read_fd, &ev) != 0) {
- err = GRPC_OS_ERROR(errno, "epoll_ctl");
- GRPC_FD_TRACE(
- "Pollable_create: closed epfd: %d (type: %d). epoll_ctl error", epfd,
- type);
- close(epfd);
- grpc_wakeup_fd_destroy(&(*p)->wakeup);
- gpr_free(*p);
- *p = nullptr;
- return err;
- }
-
- (*p)->type = type;
- new (&(*p)->refs) grpc_core::RefCount(
- 1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_pollable_refcount)
- ? "pollable_refcount"
- : nullptr);
- gpr_mu_init(&(*p)->mu);
- (*p)->epfd = epfd;
- (*p)->owner_fd = nullptr;
- gpr_mu_init(&(*p)->owner_orphan_mu);
- (*p)->owner_orphaned = false;
- (*p)->pollset_set = nullptr;
- (*p)->next = (*p)->prev = *p;
- (*p)->root_worker = nullptr;
- (*p)->event_cursor = 0;
- (*p)->event_count = 0;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle pollable_add_fd(pollable* p, grpc_fd* fd) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- static const char* err_desc = "pollable_add_fd";
- const int epfd = p->epfd;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "add fd %p (%d) to pollable %p", fd, fd->fd, p);
- }
-
- struct epoll_event ev_fd;
- ev_fd.events =
- static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLOUT | EPOLLEXCLUSIVE);
- /* Use the second least significant bit of ev_fd.data.ptr to store track_err
- * to avoid synchronization issues when accessing it after receiving an event.
- * Accessing fd would be a data race there because the fd might have been
- * returned to the free list at that point. */
- ev_fd.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fd) |
- (fd->track_err ? 2 : 0));
- GRPC_STATS_INC_SYSCALL_EPOLL_CTL();
- if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev_fd) != 0) {
- switch (errno) {
- case EEXIST:
- break;
- default:
- append_error(&error, GRPC_OS_ERROR(errno, "epoll_ctl"), err_desc);
- }
- }
-
- return error;
-}
-
-/*******************************************************************************
- * Pollset Definitions
- */
-
-GPR_TLS_DECL(g_current_thread_pollset);
-GPR_TLS_DECL(g_current_thread_worker);
-
-/* Global state management */
-static grpc_error_handle pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_pollset);
- gpr_tls_init(&g_current_thread_worker);
- return pollable_create(PO_EMPTY, &g_empty_pollable);
-}
-
-static void pollset_global_shutdown(void) {
- POLLABLE_UNREF(g_empty_pollable, "g_empty_pollable");
- gpr_tls_destroy(&g_current_thread_pollset);
- gpr_tls_destroy(&g_current_thread_worker);
-}
-
-/* pollset->mu must be held while calling this function */
-static void pollset_maybe_finish_shutdown(grpc_pollset* pollset) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p (pollable:%p) maybe_finish_shutdown sc=%p (target:!NULL) "
- "rw=%p (target:NULL) cpsc=%d (target:0)",
- pollset, pollset->active_pollable, pollset->shutdown_closure,
- pollset->root_worker, pollset->containing_pollset_set_count);
- }
- if (pollset->shutdown_closure != nullptr && pollset->root_worker == nullptr &&
- pollset->containing_pollset_set_count == 0) {
- GPR_TIMER_MARK("pollset_finish_shutdown", 0);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, pollset->shutdown_closure,
- GRPC_ERROR_NONE);
- pollset->shutdown_closure = nullptr;
- pollset->already_shutdown = true;
- }
-}
-
-/* pollset->mu must be held before calling this function,
- * pollset->active_pollable->mu & specific_worker->pollable_obj->mu must not be
- * held */
-static grpc_error_handle kick_one_worker(grpc_pollset_worker* specific_worker) {
- GPR_TIMER_SCOPE("kick_one_worker", 0);
- pollable* p = specific_worker->pollable_obj;
- grpc_core::MutexLockForGprMu lock(&p->mu);
- GPR_ASSERT(specific_worker != nullptr);
- if (specific_worker->kicked) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_specific_but_already_kicked", p);
- }
- GRPC_STATS_INC_POLLSET_KICKED_AGAIN();
- return GRPC_ERROR_NONE;
- }
- if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_specific_but_awake", p);
- }
- GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD();
- specific_worker->kicked = true;
- return GRPC_ERROR_NONE;
- }
- if (specific_worker == p->root_worker) {
- GRPC_STATS_INC_POLLSET_KICK_WAKEUP_FD();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_specific_via_wakeup_fd", p);
- }
- specific_worker->kicked = true;
- grpc_error_handle error = grpc_wakeup_fd_wakeup(&p->wakeup);
- return error;
- }
- if (specific_worker->initialized_cv) {
- GRPC_STATS_INC_POLLSET_KICK_WAKEUP_CV();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_specific_via_cv", p);
- }
- specific_worker->kicked = true;
- gpr_cv_signal(&specific_worker->cv);
- return GRPC_ERROR_NONE;
- }
- // we can get here during end_worker after removing specific_worker from the
- // pollable list but before removing it from the pollset list
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
- GPR_TIMER_SCOPE("pollset_kick", 0);
- GRPC_STATS_INC_POLLSET_KICK();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p kick %p tls_pollset=%" PRIxPTR " tls_worker=%" PRIxPTR
- " pollset.root_worker=%p",
- pollset, specific_worker, gpr_tls_get(&g_current_thread_pollset),
- gpr_tls_get(&g_current_thread_worker), pollset->root_worker);
- }
- if (specific_worker == nullptr) {
- if (gpr_tls_get(&g_current_thread_pollset) !=
- reinterpret_cast<intptr_t>(pollset)) {
- if (pollset->root_worker == nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_any_without_poller", pollset);
- }
- GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER();
- pollset->kicked_without_poller = true;
- return GRPC_ERROR_NONE;
- } else {
- // We've been asked to kick a poller, but we haven't been told which one
- // ... any will do
- // We look at the pollset worker list because:
- // 1. the pollable list may include workers from other pollers, so we'd
- // need to do an O(N) search
- // 2. we'd additionally need to take the pollable lock, which we've so
- // far avoided
- // Now, we would prefer to wake a poller in cv_wait, and not in
- // epoll_wait (since the latter would imply the need to do an additional
- // wakeup)
- // We know that if a worker is at the root of a pollable, it's (likely)
- // also the root of a pollset, and we know that if a worker is NOT at
- // the root of a pollset, it's (likely) not at the root of a pollable,
- // so we take our chances and choose the SECOND worker enqueued against
- // the pollset as a worker that's likely to be in cv_wait
- return kick_one_worker(
- pollset->root_worker->links[PWLINK_POLLSET].next);
- }
- } else {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p kicked_any_but_awake", pollset);
- }
- GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD();
- return GRPC_ERROR_NONE;
- }
- } else {
- return kick_one_worker(specific_worker);
- }
-}
-
-static grpc_error_handle pollset_kick_all(grpc_pollset* pollset) {
- GPR_TIMER_SCOPE("pollset_kick_all", 0);
- grpc_error_handle error = GRPC_ERROR_NONE;
- const char* err_desc = "pollset_kick_all";
- grpc_pollset_worker* w = pollset->root_worker;
- if (w != nullptr) {
- do {
- GRPC_STATS_INC_POLLSET_KICK();
- append_error(&error, kick_one_worker(w), err_desc);
- w = w->links[PWLINK_POLLSET].next;
- } while (w != pollset->root_worker);
- }
- return error;
-}
-
-static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
- gpr_mu_init(&pollset->mu);
- gpr_atm_no_barrier_store(&pollset->worker_count, 0);
- gpr_atm_no_barrier_store(&pollset->active_pollable_type, PO_EMPTY);
- pollset->active_pollable = POLLABLE_REF(g_empty_pollable, "pollset");
- pollset->kicked_without_poller = false;
- pollset->shutdown_closure = nullptr;
- pollset->already_shutdown = false;
- pollset->root_worker = nullptr;
- pollset->containing_pollset_set_count = 0;
- *mu = &pollset->mu;
-}
-
-static int poll_deadline_to_millis_timeout(grpc_millis millis) {
- if (millis == GRPC_MILLIS_INF_FUTURE) return -1;
- grpc_millis delta = millis - grpc_core::ExecCtx::Get()->Now();
- if (delta > INT_MAX) {
- return INT_MAX;
- } else if (delta < 0) {
- return 0;
- } else {
- return static_cast<int>(delta);
- }
-}
-
-static void fd_become_readable(grpc_fd* fd) { fd->read_closure.SetReady(); }
-
-static void fd_become_writable(grpc_fd* fd) { fd->write_closure.SetReady(); }
-
-static void fd_has_errors(grpc_fd* fd) { fd->error_closure.SetReady(); }
-
-/* Get the pollable_obj attached to this fd. If none is attached, create a new
- * pollable object (of type PO_FD), attach it to the fd and return it
- *
- * Note that if a pollable object is already attached to the fd, it may be of
- * either PO_FD or PO_MULTI type */
-static grpc_error_handle get_fd_pollable(grpc_fd* fd, pollable** p) {
- gpr_mu_lock(&fd->pollable_mu);
- grpc_error_handle error = GRPC_ERROR_NONE;
- static const char* err_desc = "get_fd_pollable";
- if (fd->pollable_obj == nullptr) {
- if (append_error(&error, pollable_create(PO_FD, &fd->pollable_obj),
- err_desc)) {
- fd->pollable_obj->owner_fd = fd;
- if (!append_error(&error, pollable_add_fd(fd->pollable_obj, fd),
- err_desc)) {
- POLLABLE_UNREF(fd->pollable_obj, "fd_pollable");
- fd->pollable_obj = nullptr;
- }
- }
- }
- if (error == GRPC_ERROR_NONE) {
- GPR_ASSERT(fd->pollable_obj != nullptr);
- *p = POLLABLE_REF(fd->pollable_obj, "pollset");
- } else {
- GPR_ASSERT(fd->pollable_obj == nullptr);
- *p = nullptr;
- }
- gpr_mu_unlock(&fd->pollable_mu);
- return error;
-}
-
-/* pollset->po.mu lock must be held by the caller before calling this */
-static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
- GPR_TIMER_SCOPE("pollset_shutdown", 0);
- GPR_ASSERT(pollset->shutdown_closure == nullptr);
- pollset->shutdown_closure = closure;
- GRPC_LOG_IF_ERROR("pollset_shutdown", pollset_kick_all(pollset));
- pollset_maybe_finish_shutdown(pollset);
-}
-
-static grpc_error_handle pollable_process_events(grpc_pollset* pollset,
- pollable* pollable_obj,
- bool drain) {
- GPR_TIMER_SCOPE("pollable_process_events", 0);
- static const char* err_desc = "pollset_process_events";
- // Use a simple heuristic to determine how many fd events to process
- // per loop iteration. (events/workers)
- int handle_count = 1;
- int worker_count = gpr_atm_no_barrier_load(&pollset->worker_count);
- GPR_ASSERT(worker_count > 0);
- handle_count =
- (pollable_obj->event_count - pollable_obj->event_cursor) / worker_count;
- if (handle_count == 0) {
- handle_count = 1;
- }
- grpc_error_handle error = GRPC_ERROR_NONE;
- for (int i = 0; (drain || i < handle_count) &&
- pollable_obj->event_cursor != pollable_obj->event_count;
- i++) {
- int n = pollable_obj->event_cursor++;
- struct epoll_event* ev = &pollable_obj->events[n];
- void* data_ptr = ev->data.ptr;
- if (1 & reinterpret_cast<intptr_t>(data_ptr)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p got pollset_wakeup %p", pollset, data_ptr);
- }
- append_error(
- &error,
- grpc_wakeup_fd_consume_wakeup(reinterpret_cast<grpc_wakeup_fd*>(
- ~static_cast<intptr_t>(1) &
- reinterpret_cast<intptr_t>(data_ptr))),
- err_desc);
- } else {
- grpc_fd* fd =
- reinterpret_cast<grpc_fd*>(reinterpret_cast<intptr_t>(data_ptr) & ~2);
- bool track_err = reinterpret_cast<intptr_t>(data_ptr) & 2;
- bool cancel = (ev->events & EPOLLHUP) != 0;
- bool error = (ev->events & EPOLLERR) != 0;
- bool read_ev = (ev->events & (EPOLLIN | EPOLLPRI)) != 0;
- bool write_ev = (ev->events & EPOLLOUT) != 0;
- bool err_fallback = error && !track_err;
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p got fd %p: cancel=%d read=%d "
- "write=%d",
- pollset, fd, cancel, read_ev, write_ev);
- }
- if (error && !err_fallback) {
- fd_has_errors(fd);
- }
- if (read_ev || cancel || err_fallback) {
- fd_become_readable(fd);
- }
- if (write_ev || cancel || err_fallback) {
- fd_become_writable(fd);
- }
- }
- }
-
- return error;
-}
-
-/* pollset_shutdown is guaranteed to be called before pollset_destroy. */
-static void pollset_destroy(grpc_pollset* pollset) {
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- pollset->active_pollable = nullptr;
- gpr_mu_destroy(&pollset->mu);
-}
-
-static grpc_error_handle pollable_epoll(pollable* p, grpc_millis deadline) {
- GPR_TIMER_SCOPE("pollable_epoll", 0);
- 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);
- }
-
- if (timeout != 0) {
- GRPC_SCHEDULING_START_BLOCKING_REGION;
- }
- int r;
- do {
- GRPC_STATS_INC_SYSCALL_POLL();
- r = epoll_wait(p->epfd, p->events, MAX_EPOLL_EVENTS, timeout);
- } while (r < 0 && errno == EINTR);
- if (timeout != 0) {
- GRPC_SCHEDULING_END_BLOCKING_REGION;
- }
-
- if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait");
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "POLLABLE:%p got %d events", p, r);
- }
-
- p->event_cursor = 0;
- p->event_count = r;
-
- return GRPC_ERROR_NONE;
-}
-
-/* Return true if first in list */
-static bool worker_insert(grpc_pollset_worker** root_worker,
- grpc_pollset_worker* worker, pwlinks link) {
- if (*root_worker == nullptr) {
- *root_worker = worker;
- worker->links[link].next = worker->links[link].prev = worker;
- return true;
- } else {
- worker->links[link].next = *root_worker;
- worker->links[link].prev = worker->links[link].next->links[link].prev;
- worker->links[link].next->links[link].prev = worker;
- worker->links[link].prev->links[link].next = worker;
- return false;
- }
-}
-
-/* returns the new root IFF the root changed */
-typedef enum { WRR_NEW_ROOT, WRR_EMPTIED, WRR_REMOVED } worker_remove_result;
-
-static worker_remove_result worker_remove(grpc_pollset_worker** root_worker,
- grpc_pollset_worker* worker,
- pwlinks link) {
- if (worker == *root_worker) {
- if (worker == worker->links[link].next) {
- *root_worker = nullptr;
- return WRR_EMPTIED;
- } else {
- *root_worker = worker->links[link].next;
- worker->links[link].prev->links[link].next = worker->links[link].next;
- worker->links[link].next->links[link].prev = worker->links[link].prev;
- return WRR_NEW_ROOT;
- }
- } else {
- worker->links[link].prev->links[link].next = worker->links[link].next;
- worker->links[link].next->links[link].prev = worker->links[link].prev;
- return WRR_REMOVED;
- }
-}
-
-/* Return true if this thread should poll */
-static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
- GPR_TIMER_SCOPE("begin_worker", 0);
- bool do_poll =
- (pollset->shutdown_closure == nullptr && !pollset->already_shutdown);
- gpr_atm_no_barrier_fetch_add(&pollset->worker_count, 1);
- if (worker_hdl != nullptr) *worker_hdl = worker;
- worker->initialized_cv = false;
- worker->kicked = false;
- worker->pollset = pollset;
- worker->pollable_obj =
- POLLABLE_REF(pollset->active_pollable, "pollset_worker");
- worker_insert(&pollset->root_worker, worker, PWLINK_POLLSET);
- gpr_mu_lock(&worker->pollable_obj->mu);
- if (!worker_insert(&worker->pollable_obj->root_worker, worker,
- PWLINK_POLLABLE)) {
- worker->initialized_cv = true;
- gpr_cv_init(&worker->cv);
- gpr_mu_unlock(&pollset->mu);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace) &&
- worker->pollable_obj->root_worker != worker) {
- gpr_log(GPR_INFO, "PS:%p wait %p w=%p for %dms", pollset,
- worker->pollable_obj, worker,
- poll_deadline_to_millis_timeout(deadline));
- }
- while (do_poll && worker->pollable_obj->root_worker != worker) {
- if (gpr_cv_wait(&worker->cv, &worker->pollable_obj->mu,
- grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p timeout_wait %p w=%p", pollset,
- worker->pollable_obj, worker);
- }
- do_poll = false;
- } else if (worker->kicked) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PS:%p wakeup %p w=%p", pollset,
- worker->pollable_obj, worker);
- }
- do_poll = false;
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace) &&
- worker->pollable_obj->root_worker != worker) {
- gpr_log(GPR_INFO, "PS:%p spurious_wakeup %p w=%p", pollset,
- worker->pollable_obj, worker);
- }
- }
- grpc_core::ExecCtx::Get()->InvalidateNow();
- } else {
- gpr_mu_unlock(&pollset->mu);
- }
- gpr_mu_unlock(&worker->pollable_obj->mu);
-
- return do_poll;
-}
-
-static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
- grpc_pollset_worker** /*worker_hdl*/) {
- GPR_TIMER_SCOPE("end_worker", 0);
- gpr_mu_lock(&pollset->mu);
- gpr_mu_lock(&worker->pollable_obj->mu);
- switch (worker_remove(&worker->pollable_obj->root_worker, worker,
- PWLINK_POLLABLE)) {
- case WRR_NEW_ROOT: {
- // wakeup new poller
- grpc_pollset_worker* new_root = worker->pollable_obj->root_worker;
- GPR_ASSERT(new_root->initialized_cv);
- gpr_cv_signal(&new_root->cv);
- break;
- }
- case WRR_EMPTIED:
- if (pollset->active_pollable != worker->pollable_obj) {
- // pollable no longer being polled: flush events
- pollable_process_events(pollset, worker->pollable_obj, true);
- }
- break;
- case WRR_REMOVED:
- break;
- }
- gpr_mu_unlock(&worker->pollable_obj->mu);
- POLLABLE_UNREF(worker->pollable_obj, "pollset_worker");
- if (worker_remove(&pollset->root_worker, worker, PWLINK_POLLSET) ==
- WRR_EMPTIED) {
- pollset_maybe_finish_shutdown(pollset);
- }
- if (worker->initialized_cv) {
- gpr_cv_destroy(&worker->cv);
- }
- gpr_atm_no_barrier_fetch_add(&pollset->worker_count, -1);
-}
-
-#ifndef NDEBUG
-static long sys_gettid(void) { return syscall(__NR_gettid); }
-#endif
-
-/* pollset->mu lock must be held by the caller before calling this.
- The function pollset_work() may temporarily release the lock (pollset->po.mu)
- during the course of its execution but it will always re-acquire the lock and
- ensure that it is held by the time the function returns */
-static grpc_error_handle pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
- GPR_TIMER_SCOPE("pollset_work", 0);
-#ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP
- grpc_pollset_worker* worker =
- (grpc_pollset_worker*)gpr_malloc(sizeof(*worker));
-#define WORKER_PTR (worker)
-#else
- grpc_pollset_worker worker;
-#define WORKER_PTR (&worker)
-#endif
-#ifndef NDEBUG
- WORKER_PTR->originator = sys_gettid();
-#endif
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p work hdl=%p worker=%p now=%" PRId64 " deadline=%" PRId64
- " kwp=%d pollable=%p",
- pollset, worker_hdl, WORKER_PTR, grpc_core::ExecCtx::Get()->Now(),
- deadline, pollset->kicked_without_poller, pollset->active_pollable);
- }
- static const char* err_desc = "pollset_work";
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (pollset->kicked_without_poller) {
- pollset->kicked_without_poller = false;
- } else {
- if (begin_worker(pollset, WORKER_PTR, worker_hdl, deadline)) {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)pollset);
- gpr_tls_set(&g_current_thread_worker, (intptr_t)WORKER_PTR);
- if (WORKER_PTR->pollable_obj->event_cursor ==
- WORKER_PTR->pollable_obj->event_count) {
- append_error(&error, pollable_epoll(WORKER_PTR->pollable_obj, deadline),
- err_desc);
- }
- append_error(
- &error,
- pollable_process_events(pollset, WORKER_PTR->pollable_obj, false),
- err_desc);
- grpc_core::ExecCtx::Get()->Flush();
- gpr_tls_set(&g_current_thread_pollset, 0);
- gpr_tls_set(&g_current_thread_worker, 0);
- }
- end_worker(pollset, WORKER_PTR, worker_hdl);
- }
-#ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP
- gpr_free(worker);
-#endif
-#undef WORKER_PTR
- return error;
-}
-
-static grpc_error_handle pollset_transition_pollable_from_empty_to_fd_locked(
- grpc_pollset* pollset, grpc_fd* fd) {
- static const char* err_desc = "pollset_transition_pollable_from_empty_to_fd";
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p add fd %p (%d); transition pollable from empty to fd",
- pollset, fd, fd->fd);
- }
- append_error(&error, pollset_kick_all(pollset), err_desc);
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- append_error(&error, get_fd_pollable(fd, &pollset->active_pollable),
- err_desc);
- return error;
-}
-
-static grpc_error_handle pollset_transition_pollable_from_fd_to_multi_locked(
- grpc_pollset* pollset, grpc_fd* and_add_fd) {
- static const char* err_desc = "pollset_transition_pollable_from_fd_to_multi";
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(
- GPR_INFO,
- "PS:%p add fd %p (%d); transition pollable from fd %p to multipoller",
- pollset, and_add_fd, and_add_fd ? and_add_fd->fd : -1,
- pollset->active_pollable->owner_fd);
- }
- append_error(&error, pollset_kick_all(pollset), err_desc);
- grpc_fd* initial_fd = pollset->active_pollable->owner_fd;
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- pollset->active_pollable = nullptr;
- if (append_error(&error, pollable_create(PO_MULTI, &pollset->active_pollable),
- err_desc)) {
- append_error(&error, pollable_add_fd(pollset->active_pollable, initial_fd),
- err_desc);
- if (and_add_fd != nullptr) {
- append_error(&error,
- pollable_add_fd(pollset->active_pollable, and_add_fd),
- err_desc);
- }
- }
- return error;
-}
-
-/* expects pollsets locked, flag whether fd is locked or not */
-static grpc_error_handle pollset_add_fd_locked(grpc_pollset* pollset,
- grpc_fd* fd) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- pollable* po_at_start =
- POLLABLE_REF(pollset->active_pollable, "pollset_add_fd");
- switch (pollset->active_pollable->type) {
- case PO_EMPTY:
- /* empty pollable --> single fd pollable */
- error = pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd);
- break;
- case PO_FD:
- gpr_mu_lock(&po_at_start->owner_orphan_mu);
- if (po_at_start->owner_orphaned) {
- error =
- pollset_transition_pollable_from_empty_to_fd_locked(pollset, fd);
- } else {
- /* fd --> multipoller */
- error =
- pollset_transition_pollable_from_fd_to_multi_locked(pollset, fd);
- }
- gpr_mu_unlock(&po_at_start->owner_orphan_mu);
- break;
- case PO_MULTI:
- error = pollable_add_fd(pollset->active_pollable, fd);
- break;
- }
- if (error != GRPC_ERROR_NONE) {
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- pollset->active_pollable = po_at_start;
- } else {
- gpr_atm_rel_store(&pollset->active_pollable_type,
- pollset->active_pollable->type);
- POLLABLE_UNREF(po_at_start, "pollset_add_fd");
- }
- return error;
-}
-
-static grpc_error_handle pollset_as_multipollable_locked(
- grpc_pollset* pollset, pollable** pollable_obj) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- pollable* po_at_start =
- POLLABLE_REF(pollset->active_pollable, "pollset_as_multipollable");
- switch (pollset->active_pollable->type) {
- case PO_EMPTY:
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- error = pollable_create(PO_MULTI, &pollset->active_pollable);
- /* Any workers currently polling on this pollset must now be woked up so
- * that they can pick up the new active_pollable */
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO,
- "PS:%p active pollable transition from empty to multi",
- pollset);
- }
- static const char* err_desc =
- "pollset_as_multipollable_locked: empty -> multi";
- append_error(&error, pollset_kick_all(pollset), err_desc);
- break;
- case PO_FD:
- gpr_mu_lock(&po_at_start->owner_orphan_mu);
- if (po_at_start->owner_orphaned) {
- // Unlock before Unref'ing the pollable
- gpr_mu_unlock(&po_at_start->owner_orphan_mu);
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- error = pollable_create(PO_MULTI, &pollset->active_pollable);
- } else {
- error = pollset_transition_pollable_from_fd_to_multi_locked(pollset,
- nullptr);
- gpr_mu_unlock(&po_at_start->owner_orphan_mu);
- }
- break;
- case PO_MULTI:
- break;
- }
- if (error != GRPC_ERROR_NONE) {
- POLLABLE_UNREF(pollset->active_pollable, "pollset");
- pollset->active_pollable = po_at_start;
- *pollable_obj = nullptr;
- } else {
- gpr_atm_rel_store(&pollset->active_pollable_type,
- pollset->active_pollable->type);
- *pollable_obj = POLLABLE_REF(pollset->active_pollable, "pollset_set");
- POLLABLE_UNREF(po_at_start, "pollset_as_multipollable");
- }
- return error;
-}
-
-static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {
- GPR_TIMER_SCOPE("pollset_add_fd", 0);
-
- // We never transition from PO_MULTI to other modes (i.e., PO_FD or PO_EMPTY)
- // and, thus, it is safe to simply store and check whether the FD has already
- // been added to the active pollable previously.
- if (gpr_atm_acq_load(&pollset->active_pollable_type) == PO_MULTI &&
- fd_has_pollset(fd, pollset)) {
- return;
- }
-
- grpc_core::MutexLockForGprMu lock(&pollset->mu);
- grpc_error_handle error = pollset_add_fd_locked(pollset, fd);
-
- // If we are in PO_MULTI mode, we should update the pollsets of the FD.
- if (gpr_atm_no_barrier_load(&pollset->active_pollable_type) == PO_MULTI) {
- fd_add_pollset(fd, pollset);
- }
-
- GRPC_LOG_IF_ERROR("pollset_add_fd", error);
-}
-
-/*******************************************************************************
- * Pollset-set Definitions
- */
-
-static grpc_pollset_set* pss_lock_adam(grpc_pollset_set* pss) {
- gpr_mu_lock(&pss->mu);
- while (pss->parent != nullptr) {
- gpr_mu_unlock(&pss->mu);
- pss = pss->parent;
- gpr_mu_lock(&pss->mu);
- }
- return pss;
-}
-
-static grpc_pollset_set* pollset_set_create(void) {
- grpc_pollset_set* pss =
- static_cast<grpc_pollset_set*>(gpr_zalloc(sizeof(*pss)));
- gpr_mu_init(&pss->mu);
- new (&pss->refs) grpc_core::RefCount();
- return pss;
-}
-
-static void pollset_set_unref(grpc_pollset_set* pss) {
- if (pss == nullptr) return;
- if (GPR_LIKELY(!pss->refs.Unref())) return;
- pollset_set_unref(pss->parent);
- gpr_mu_destroy(&pss->mu);
- for (size_t i = 0; i < pss->pollset_count; i++) {
- gpr_mu_lock(&pss->pollsets[i]->mu);
- if (0 == --pss->pollsets[i]->containing_pollset_set_count) {
- pollset_maybe_finish_shutdown(pss->pollsets[i]);
- }
- gpr_mu_unlock(&pss->pollsets[i]->mu);
- }
- for (size_t i = 0; i < pss->fd_count; i++) {
- UNREF_BY(pss->fds[i], 2, "pollset_set");
- }
- gpr_free(pss->pollsets);
- gpr_free(pss->fds);
- gpr_free(pss);
-}
-
-static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) {
- GPR_TIMER_SCOPE("pollset_set_add_fd", 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd);
- }
- grpc_error_handle error = GRPC_ERROR_NONE;
- static const char* err_desc = "pollset_set_add_fd";
- pss = pss_lock_adam(pss);
- for (size_t i = 0; i < pss->pollset_count; i++) {
- append_error(&error, pollable_add_fd(pss->pollsets[i]->active_pollable, fd),
- err_desc);
- }
- if (pss->fd_count == pss->fd_capacity) {
- pss->fd_capacity = GPR_MAX(pss->fd_capacity * 2, 8);
- pss->fds = static_cast<grpc_fd**>(
- gpr_realloc(pss->fds, pss->fd_capacity * sizeof(*pss->fds)));
- }
- REF_BY(fd, 2, "pollset_set");
- pss->fds[pss->fd_count++] = fd;
- gpr_mu_unlock(&pss->mu);
-
- GRPC_LOG_IF_ERROR(err_desc, error);
-}
-
-static void pollset_set_del_fd(grpc_pollset_set* pss, grpc_fd* fd) {
- GPR_TIMER_SCOPE("pollset_set_del_fd", 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS:%p: del fd %p", pss, fd);
- }
- pss = pss_lock_adam(pss);
- size_t i;
- for (i = 0; i < pss->fd_count; i++) {
- if (pss->fds[i] == fd) {
- UNREF_BY(fd, 2, "pollset_set");
- break;
- }
- }
- GPR_ASSERT(i != pss->fd_count);
- for (; i < pss->fd_count - 1; i++) {
- pss->fds[i] = pss->fds[i + 1];
- }
- pss->fd_count--;
- gpr_mu_unlock(&pss->mu);
-}
-
-static void pollset_set_del_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {
- GPR_TIMER_SCOPE("pollset_set_del_pollset", 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS:%p: del pollset %p", pss, ps);
- }
- pss = pss_lock_adam(pss);
- size_t i;
- for (i = 0; i < pss->pollset_count; i++) {
- if (pss->pollsets[i] == ps) {
- break;
- }
- }
- GPR_ASSERT(i != pss->pollset_count);
- for (; i < pss->pollset_count - 1; i++) {
- pss->pollsets[i] = pss->pollsets[i + 1];
- }
- pss->pollset_count--;
- gpr_mu_unlock(&pss->mu);
- gpr_mu_lock(&ps->mu);
- if (0 == --ps->containing_pollset_set_count) {
- pollset_maybe_finish_shutdown(ps);
- }
- gpr_mu_unlock(&ps->mu);
-}
-
-// add all fds to pollables, and output a new array of unorphaned out_fds
-// assumes pollsets are multipollable
-static grpc_error_handle add_fds_to_pollsets(grpc_fd** fds, size_t fd_count,
- grpc_pollset** pollsets,
- size_t pollset_count,
- const char* err_desc,
- grpc_fd** out_fds,
- size_t* out_fd_count) {
- GPR_TIMER_SCOPE("add_fds_to_pollsets", 0);
- grpc_error_handle error = GRPC_ERROR_NONE;
- for (size_t i = 0; i < fd_count; i++) {
- gpr_mu_lock(&fds[i]->orphan_mu);
- if ((gpr_atm_no_barrier_load(&fds[i]->refst) & 1) == 0) {
- gpr_mu_unlock(&fds[i]->orphan_mu);
- UNREF_BY(fds[i], 2, "pollset_set");
- } else {
- for (size_t j = 0; j < pollset_count; j++) {
- append_error(&error,
- pollable_add_fd(pollsets[j]->active_pollable, fds[i]),
- err_desc);
- }
- gpr_mu_unlock(&fds[i]->orphan_mu);
- out_fds[(*out_fd_count)++] = fds[i];
- }
- }
- return error;
-}
-
-static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {
- GPR_TIMER_SCOPE("pollset_set_add_pollset", 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS:%p: add pollset %p", pss, ps);
- }
- grpc_error_handle error = GRPC_ERROR_NONE;
- static const char* err_desc = "pollset_set_add_pollset";
- pollable* pollable_obj = nullptr;
- gpr_mu_lock(&ps->mu);
- if (!GRPC_LOG_IF_ERROR(err_desc,
- pollset_as_multipollable_locked(ps, &pollable_obj))) {
- GPR_ASSERT(pollable_obj == nullptr);
- gpr_mu_unlock(&ps->mu);
- return;
- }
- ps->containing_pollset_set_count++;
- gpr_mu_unlock(&ps->mu);
- pss = pss_lock_adam(pss);
- size_t initial_fd_count = pss->fd_count;
- pss->fd_count = 0;
- append_error(&error,
- add_fds_to_pollsets(pss->fds, initial_fd_count, &ps, 1, err_desc,
- pss->fds, &pss->fd_count),
- err_desc);
- if (pss->pollset_count == pss->pollset_capacity) {
- pss->pollset_capacity = GPR_MAX(pss->pollset_capacity * 2, 8);
- pss->pollsets = static_cast<grpc_pollset**>(gpr_realloc(
- pss->pollsets, pss->pollset_capacity * sizeof(*pss->pollsets)));
- }
- pss->pollsets[pss->pollset_count++] = ps;
- gpr_mu_unlock(&pss->mu);
- POLLABLE_UNREF(pollable_obj, "pollset_set");
-
- GRPC_LOG_IF_ERROR(err_desc, error);
-}
-
-static void pollset_set_add_pollset_set(grpc_pollset_set* a,
- grpc_pollset_set* b) {
- GPR_TIMER_SCOPE("pollset_set_add_pollset_set", 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS: merge (%p, %p)", a, b);
- }
- grpc_error_handle error = GRPC_ERROR_NONE;
- static const char* err_desc = "pollset_set_add_fd";
- for (;;) {
- if (a == b) {
- // pollset ancestors are the same: nothing to do
- return;
- }
- if (a > b) {
- GPR_SWAP(grpc_pollset_set*, a, b);
- }
- gpr_mu* a_mu = &a->mu;
- gpr_mu* b_mu = &b->mu;
- gpr_mu_lock(a_mu);
- gpr_mu_lock(b_mu);
- if (a->parent != nullptr) {
- a = a->parent;
- } else if (b->parent != nullptr) {
- b = b->parent;
- } else {
- break; // exit loop, both pollsets locked
- }
- gpr_mu_unlock(a_mu);
- gpr_mu_unlock(b_mu);
- }
- // try to do the least copying possible
- // TODO(sreek): there's probably a better heuristic here
- const size_t a_size = a->fd_count + a->pollset_count;
- const size_t b_size = b->fd_count + b->pollset_count;
- if (b_size > a_size) {
- GPR_SWAP(grpc_pollset_set*, a, b);
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
- gpr_log(GPR_INFO, "PSS: parent %p to %p", b, a);
- }
- a->refs.Ref();
- b->parent = a;
- if (a->fd_capacity < a->fd_count + b->fd_count) {
- a->fd_capacity = GPR_MAX(2 * a->fd_capacity, a->fd_count + b->fd_count);
- a->fds = static_cast<grpc_fd**>(
- gpr_realloc(a->fds, a->fd_capacity * sizeof(*a->fds)));
- }
- size_t initial_a_fd_count = a->fd_count;
- a->fd_count = 0;
- append_error(
- &error,
- add_fds_to_pollsets(a->fds, initial_a_fd_count, b->pollsets,
- b->pollset_count, "merge_a2b", a->fds, &a->fd_count),
- err_desc);
- append_error(
- &error,
- add_fds_to_pollsets(b->fds, b->fd_count, a->pollsets, a->pollset_count,
- "merge_b2a", a->fds, &a->fd_count),
- err_desc);
- if (a->pollset_capacity < a->pollset_count + b->pollset_count) {
- a->pollset_capacity =
- GPR_MAX(2 * a->pollset_capacity, a->pollset_count + b->pollset_count);
- a->pollsets = static_cast<grpc_pollset**>(
- gpr_realloc(a->pollsets, a->pollset_capacity * sizeof(*a->pollsets)));
- }
- if (b->pollset_count > 0) {
- memcpy(a->pollsets + a->pollset_count, b->pollsets,
- b->pollset_count * sizeof(*b->pollsets));
- }
- a->pollset_count += b->pollset_count;
- gpr_free(b->fds);
- gpr_free(b->pollsets);
- b->fds = nullptr;
- b->pollsets = nullptr;
- b->fd_count = b->fd_capacity = b->pollset_count = b->pollset_capacity = 0;
- gpr_mu_unlock(&a->mu);
- gpr_mu_unlock(&b->mu);
-}
-
-static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/,
- grpc_pollset_set* /*item*/) {}
-
-/*******************************************************************************
- * Event engine binding
- */
-
-static bool is_any_background_poller_thread(void) { return false; }
-
-static void shutdown_background_closure(void) {}
-
-static bool add_closure_to_background_poller(grpc_closure* /*closure*/,
- grpc_error_handle /*error*/) {
- return false;
-}
-
-static void shutdown_engine(void) {
- fd_global_shutdown();
- pollset_global_shutdown();
-}
-
-static const grpc_event_engine_vtable vtable = {
- sizeof(grpc_pollset),
- true,
- false,
-
- fd_create,
- fd_wrapped_fd,
- fd_orphan,
- fd_shutdown,
- fd_notify_on_read,
- fd_notify_on_write,
- fd_notify_on_error,
- fd_become_readable,
- fd_become_writable,
- fd_has_errors,
- fd_is_shutdown,
-
- pollset_init,
- pollset_shutdown,
- pollset_destroy,
- pollset_work,
- pollset_kick,
- pollset_add_fd,
-
- pollset_set_create,
- pollset_set_unref, // destroy ==> unref 1 public ref
- pollset_set_add_pollset,
- pollset_set_del_pollset,
- pollset_set_add_pollset_set,
- pollset_set_del_pollset_set,
- pollset_set_add_fd,
- pollset_set_del_fd,
-
- is_any_background_poller_thread,
- shutdown_background_closure,
- shutdown_engine,
- add_closure_to_background_poller,
-};
-
-const grpc_event_engine_vtable* grpc_init_epollex_linux(
- bool /*explicitly_requested*/) {
- if (!grpc_has_wakeup_fd()) {
- gpr_log(GPR_ERROR, "Skipping epollex because of no wakeup fd.");
- return nullptr;
- }
-
- if (!grpc_is_epollexclusive_available()) {
- gpr_log(GPR_INFO, "Skipping epollex because it is not supported.");
- return nullptr;
- }
-
- fd_global_init();
-
- if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {
- pollset_global_shutdown();
- fd_global_shutdown();
- return nullptr;
- }
-
- return &vtable;
-}
-
-#else /* defined(GRPC_LINUX_EPOLL_CREATE1) */
-#if defined(GRPC_POSIX_SOCKET_EV_EPOLLEX)
-#include "src/core/lib/iomgr/ev_epollex_linux.h"
-/* If GRPC_LINUX_EPOLL_CREATE1 is not defined, it means
- epoll_create1 is not available. Return NULL */
-const grpc_event_engine_vtable* grpc_init_epollex_linux(
- bool /*explicitly_requested*/) {
- return nullptr;
-}
-#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLLEX) */
-
-#endif /* !defined(GRPC_LINUX_EPOLL_CREATE1) */
diff --git a/grpc/src/core/lib/iomgr/ev_epollex_linux.h b/grpc/src/core/lib/iomgr/ev_epollex_linux.h
deleted file mode 100644
index e70ba72a..00000000
--- a/grpc/src/core/lib/iomgr/ev_epollex_linux.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * 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_EV_EPOLLEX_LINUX_H
-#define GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/port.h"
-
-const grpc_event_engine_vtable* grpc_init_epollex_linux(
- bool explicitly_requested);
-
-#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */
diff --git a/grpc/src/core/lib/iomgr/ev_poll_posix.cc b/grpc/src/core/lib/iomgr/ev_poll_posix.cc
index fa4242f3..6df4bfbc 100644
--- a/grpc/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/grpc/src/core/lib/iomgr/ev_poll_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_EV_POLL
-#include "src/core/lib/iomgr/ev_poll_posix.h"
-
#include <assert.h>
#include <errno.h>
#include <limits.h>
@@ -45,6 +43,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/block_annotate.h"
+#include "src/core/lib/iomgr/ev_poll_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include "src/core/lib/profiling/timers.h"
@@ -222,7 +221,7 @@ static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
- longer than a millisecond polls are rounded up to the next nearest
millisecond to avoid spinning
- infinite timeouts are converted to -1 */
-static int poll_deadline_to_millis_timeout(grpc_millis deadline);
+static int poll_deadline_to_millis_timeout(grpc_core::Timestamp deadline);
/* Allow kick to wakeup the currently polling worker */
#define GRPC_POLLSET_CAN_KICK_SELF 1
@@ -358,7 +357,12 @@ static void unref_by(grpc_fd* fd, int n) {
gpr_mu_destroy(&fd->mu);
grpc_iomgr_unregister_object(&fd->iomgr_object);
fork_fd_list_remove_node(fd->fork_fd_list);
- if (fd->shutdown) GRPC_ERROR_UNREF(fd->shutdown_error);
+ if (fd->shutdown) {
+ GRPC_ERROR_UNREF(fd->shutdown_error);
+ }
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ fd->shutdown_error.~Status();
+#endif
gpr_free(fd);
} else {
GPR_ASSERT(old > n);
@@ -373,6 +377,9 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
gpr_mu_init(&r->mu);
gpr_atm_rel_store(&r->refst, 1);
r->shutdown = 0;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ new (&r->shutdown_error) absl::Status();
+#endif
r->read_closure = CLOSURE_NOT_READY;
r->write_closure = CLOSURE_NOT_READY;
r->fd = fd;
@@ -406,11 +413,11 @@ static grpc_error_handle pollset_kick_locked(grpc_fd_watcher* watcher) {
static void maybe_wake_one_watcher_locked(grpc_fd* fd) {
if (fd->inactive_watcher_root.next != &fd->inactive_watcher_root) {
- pollset_kick_locked(fd->inactive_watcher_root.next);
+ (void)pollset_kick_locked(fd->inactive_watcher_root.next);
} else if (fd->read_watcher) {
- pollset_kick_locked(fd->read_watcher);
+ (void)pollset_kick_locked(fd->read_watcher);
} else if (fd->write_watcher) {
- pollset_kick_locked(fd->write_watcher);
+ (void)pollset_kick_locked(fd->write_watcher);
}
}
@@ -418,13 +425,13 @@ static void wake_all_watchers_locked(grpc_fd* fd) {
grpc_fd_watcher* watcher;
for (watcher = fd->inactive_watcher_root.next;
watcher != &fd->inactive_watcher_root; watcher = watcher->next) {
- pollset_kick_locked(watcher);
+ (void)pollset_kick_locked(watcher);
}
if (fd->read_watcher) {
- pollset_kick_locked(fd->read_watcher);
+ (void)pollset_kick_locked(fd->read_watcher);
}
if (fd->write_watcher && fd->write_watcher != fd->read_watcher) {
- pollset_kick_locked(fd->write_watcher);
+ (void)pollset_kick_locked(fd->write_watcher);
}
}
@@ -706,8 +713,8 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) {
* pollset_posix.c
*/
-GPR_TLS_DECL(g_current_thread_poller);
-GPR_TLS_DECL(g_current_thread_worker);
+static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_poller;
+static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker;
static void remove_worker(grpc_pollset* /*p*/, grpc_pollset_worker* worker) {
worker->prev->next = worker->next;
@@ -776,8 +783,7 @@ static grpc_error_handle pollset_kick_ext(grpc_pollset* p,
&error, grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd));
}
p->kicked_without_pollers = true;
- } else if (gpr_tls_get(&g_current_thread_worker) !=
- reinterpret_cast<intptr_t>(specific_worker)) {
+ } else if (g_current_thread_worker != specific_worker) {
GPR_TIMER_MARK("different_thread_worker", 0);
if ((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) != 0) {
specific_worker->reevaluate_polling_on_wakeup = true;
@@ -794,20 +800,17 @@ static grpc_error_handle pollset_kick_ext(grpc_pollset* p,
kick_append_error(&error,
grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd));
}
- } else if (gpr_tls_get(&g_current_thread_poller) !=
- reinterpret_cast<intptr_t>(p)) {
+ } else if (g_current_thread_poller != p) {
GPR_ASSERT((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) == 0);
GPR_TIMER_MARK("kick_anonymous", 0);
specific_worker = pop_front_worker(p);
if (specific_worker != nullptr) {
- if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ if (g_current_thread_worker == specific_worker) {
GPR_TIMER_MARK("kick_anonymous_not_self", 0);
push_back_worker(p, specific_worker);
specific_worker = pop_front_worker(p);
if ((flags & GRPC_POLLSET_CAN_KICK_SELF) == 0 &&
- gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ g_current_thread_worker == specific_worker) {
push_back_worker(p, specific_worker);
specific_worker = nullptr;
}
@@ -835,16 +838,9 @@ static grpc_error_handle pollset_kick(grpc_pollset* p,
/* global state management */
-static grpc_error_handle pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_poller);
- gpr_tls_init(&g_current_thread_worker);
- return GRPC_ERROR_NONE;
-}
+static grpc_error_handle pollset_global_init(void) { return GRPC_ERROR_NONE; }
-static void pollset_global_shutdown(void) {
- gpr_tls_destroy(&g_current_thread_poller);
- gpr_tls_destroy(&g_current_thread_worker);
-}
+static void pollset_global_shutdown(void) {}
/* main interface */
@@ -885,13 +881,13 @@ static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {
}
if (pollset->fd_count == pollset->fd_capacity) {
pollset->fd_capacity =
- GPR_MAX(pollset->fd_capacity + 8, pollset->fd_count * 3 / 2);
+ std::max(pollset->fd_capacity + 8, pollset->fd_count * 3 / 2);
pollset->fds = static_cast<grpc_fd**>(
gpr_realloc(pollset->fds, sizeof(grpc_fd*) * pollset->fd_capacity));
}
pollset->fds[pollset->fd_count++] = fd;
GRPC_FD_REF(fd, "multipoller");
- pollset_kick(pollset, nullptr);
+ (void)pollset_kick(pollset, nullptr);
exit:
gpr_mu_unlock(&pollset->mu);
}
@@ -917,7 +913,7 @@ static void work_combine_error(grpc_error_handle* composite,
static grpc_error_handle pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
@@ -959,7 +955,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
re-evaluate our pollers (this allows poll() based pollers to
ensure they don't miss wakeups) */
keep_polling = 1;
- gpr_tls_set(&g_current_thread_poller, (intptr_t)pollset);
+ g_current_thread_poller = pollset;
while (keep_polling) {
keep_polling = 0;
if (!pollset->kicked_without_pollers ||
@@ -967,7 +963,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
if (!added_worker) {
push_front_worker(pollset, &worker);
added_worker = 1;
- gpr_tls_set(&g_current_thread_worker, (intptr_t)&worker);
+ g_current_thread_worker = &worker;
}
GPR_TIMER_SCOPE("maybe_work_and_unlock", 0);
#define POLLOUT_CHECK (POLLOUT | POLLHUP | POLLERR)
@@ -1110,15 +1106,15 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
if (queued_work || worker.kicked_specifically) {
/* If there's queued work on the list, then set the deadline to be
immediate so we get back out of the polling loop quickly */
- deadline = 0;
+ deadline = grpc_core::Timestamp();
}
keep_polling = 1;
}
}
- gpr_tls_set(&g_current_thread_poller, 0);
+ g_current_thread_poller = nullptr;
if (added_worker) {
remove_worker(pollset, &worker);
- gpr_tls_set(&g_current_thread_worker, 0);
+ g_current_thread_worker = nullptr;
}
/* release wakeup fd to the local pool */
worker.wakeup_fd->next = pollset->local_wakeup_cache;
@@ -1126,7 +1122,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
/* check shutdown conditions */
if (pollset->shutting_down) {
if (pollset_has_workers(pollset)) {
- pollset_kick(pollset, nullptr);
+ (void)pollset_kick(pollset, nullptr);
} else if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
pollset->called_shutdown = 1;
gpr_mu_unlock(&pollset->mu);
@@ -1148,17 +1144,17 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
GPR_ASSERT(!pollset->shutting_down);
pollset->shutting_down = 1;
pollset->shutdown_done = closure;
- pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
+ (void)pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
pollset->called_shutdown = 1;
finish_shutdown(pollset);
}
}
-static int poll_deadline_to_millis_timeout(grpc_millis deadline) {
- if (deadline == GRPC_MILLIS_INF_FUTURE) return -1;
- if (deadline == 0) return 0;
- grpc_millis n = deadline - grpc_core::ExecCtx::Get()->Now();
+static int poll_deadline_to_millis_timeout(grpc_core::Timestamp deadline) {
+ if (deadline == grpc_core::Timestamp::InfFuture()) return -1;
+ if (deadline.is_process_epoch()) return 0;
+ int64_t n = (deadline - grpc_core::ExecCtx::Get()->Now()).millis();
if (n < 0) return 0;
if (n > INT_MAX) return -1;
return static_cast<int>(n);
@@ -1210,7 +1206,7 @@ static void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
gpr_mu_lock(&pollset_set->mu);
if (pollset_set->pollset_count == pollset_set->pollset_capacity) {
pollset_set->pollset_capacity =
- GPR_MAX(8, 2 * pollset_set->pollset_capacity);
+ std::max(size_t(8), 2 * pollset_set->pollset_capacity);
pollset_set->pollsets = static_cast<grpc_pollset**>(gpr_realloc(
pollset_set->pollsets,
pollset_set->pollset_capacity * sizeof(*pollset_set->pollsets)));
@@ -1235,8 +1231,8 @@ static void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
for (i = 0; i < pollset_set->pollset_count; i++) {
if (pollset_set->pollsets[i] == pollset) {
pollset_set->pollset_count--;
- GPR_SWAP(grpc_pollset*, pollset_set->pollsets[i],
- pollset_set->pollsets[pollset_set->pollset_count]);
+ std::swap(pollset_set->pollsets[i],
+ pollset_set->pollsets[pollset_set->pollset_count]);
break;
}
}
@@ -1259,7 +1255,8 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* bag,
size_t i, j;
gpr_mu_lock(&bag->mu);
if (bag->pollset_set_count == bag->pollset_set_capacity) {
- bag->pollset_set_capacity = GPR_MAX(8, 2 * bag->pollset_set_capacity);
+ bag->pollset_set_capacity =
+ std::max(size_t(8), 2 * bag->pollset_set_capacity);
bag->pollset_sets = static_cast<grpc_pollset_set**>(
gpr_realloc(bag->pollset_sets,
bag->pollset_set_capacity * sizeof(*bag->pollset_sets)));
@@ -1284,8 +1281,8 @@ static void pollset_set_del_pollset_set(grpc_pollset_set* bag,
for (i = 0; i < bag->pollset_set_count; i++) {
if (bag->pollset_sets[i] == item) {
bag->pollset_set_count--;
- GPR_SWAP(grpc_pollset_set*, bag->pollset_sets[i],
- bag->pollset_sets[bag->pollset_set_count]);
+ std::swap(bag->pollset_sets[i],
+ bag->pollset_sets[bag->pollset_set_count]);
break;
}
}
@@ -1296,7 +1293,8 @@ static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
size_t i;
gpr_mu_lock(&pollset_set->mu);
if (pollset_set->fd_count == pollset_set->fd_capacity) {
- pollset_set->fd_capacity = GPR_MAX(8, 2 * pollset_set->fd_capacity);
+ pollset_set->fd_capacity =
+ std::max(size_t(8), 2 * pollset_set->fd_capacity);
pollset_set->fds = static_cast<grpc_fd**>(
gpr_realloc(pollset_set->fds,
pollset_set->fd_capacity * sizeof(*pollset_set->fds)));
@@ -1318,8 +1316,7 @@ static void pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
for (i = 0; i < pollset_set->fd_count; i++) {
if (pollset_set->fds[i] == fd) {
pollset_set->fd_count--;
- GPR_SWAP(grpc_fd*, pollset_set->fds[i],
- pollset_set->fds[pollset_set->fd_count]);
+ std::swap(pollset_set->fds[i], pollset_set->fds[pollset_set->fd_count]);
GRPC_FD_UNREF(fd, "pollset_set");
break;
}
diff --git a/grpc/src/core/lib/iomgr/ev_posix.cc b/grpc/src/core/lib/iomgr/ev_posix.cc
index dfb250f4..a472716d 100644
--- a/grpc/src/core/lib/iomgr/ev_posix.cc
+++ b/grpc/src/core/lib/iomgr/ev_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_EV
-#include "src/core/lib/iomgr/ev_posix.h"
-
#include <string.h>
#include <grpc/support/alloc.h>
@@ -34,8 +32,8 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
-#include "src/core/lib/iomgr/ev_epollex_linux.h"
#include "src/core/lib/iomgr/ev_poll_posix.h"
+#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/internal_errqueue.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(
@@ -127,12 +125,12 @@ const grpc_event_engine_vtable* init_non_polling(bool explicit_request) {
// environment variable if that variable is set (which should be a
// comma-separated list of one or more event engine names)
static event_engine_factory g_factories[] = {
- {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr},
- {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr},
- {"epollex", grpc_init_epollex_linux}, {"epoll1", grpc_init_epoll1_linux},
- {"poll", grpc_init_poll_posix}, {"none", init_non_polling},
- {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr},
- {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr},
+ {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr},
+ {ENGINE_HEAD_CUSTOM, nullptr}, {ENGINE_HEAD_CUSTOM, nullptr},
+ {"epoll1", grpc_init_epoll1_linux}, {"poll", grpc_init_poll_posix},
+ {"none", init_non_polling}, {ENGINE_TAIL_CUSTOM, nullptr},
+ {ENGINE_TAIL_CUSTOM, nullptr}, {ENGINE_TAIL_CUSTOM, nullptr},
+ {ENGINE_TAIL_CUSTOM, nullptr},
};
static void add(const char* beg, const char* end, char*** ss, size_t* ns) {
@@ -317,13 +315,13 @@ static void pollset_destroy(grpc_pollset* pollset) {
static grpc_error_handle pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
GRPC_POLLING_API_TRACE("pollset_work(%p, %" PRId64 ") begin", pollset,
- deadline);
+ deadline.milliseconds_after_process_epoch());
grpc_error_handle err =
g_event_engine->pollset_work(pollset, worker, deadline);
GRPC_POLLING_API_TRACE("pollset_work(%p, %" PRId64 ") end", pollset,
- deadline);
+ deadline.milliseconds_after_process_epoch());
return err;
}
diff --git a/grpc/src/core/lib/iomgr/ev_posix.h b/grpc/src/core/lib/iomgr/ev_posix.h
index 479921ae..823f6826 100644
--- a/grpc/src/core/lib/iomgr/ev_posix.h
+++ b/grpc/src/core/lib/iomgr/ev_posix.h
@@ -66,7 +66,7 @@ typedef struct grpc_event_engine_vtable {
void (*pollset_destroy)(grpc_pollset* pollset);
grpc_error_handle (*pollset_work)(grpc_pollset* pollset,
grpc_pollset_worker** worker,
- grpc_millis deadline);
+ grpc_core::Timestamp deadline);
grpc_error_handle (*pollset_kick)(grpc_pollset* pollset,
grpc_pollset_worker* specific_worker);
void (*pollset_add_fd)(grpc_pollset* pollset, struct grpc_fd* fd);
diff --git a/grpc/src/core/lib/iomgr/event_engine/closure.cc b/grpc/src/core/lib/iomgr/event_engine/closure.cc
new file mode 100644
index 00000000..e2afe8ab
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/closure.cc
@@ -0,0 +1,77 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+
+void RunClosure(grpc_closure* closure, grpc_error_handle error) {
+ GPR_ASSERT(closure != nullptr);
+#ifndef NDEBUG
+ closure->scheduled = false;
+ if (grpc_trace_closure.enabled()) {
+ gpr_log(GPR_DEBUG,
+ "EventEngine: running closure %p: created [%s:%d]: %s [%s:%d]",
+ closure, closure->file_created, closure->line_created,
+ closure->run ? "run" : "scheduled", closure->file_initiated,
+ closure->line_initiated);
+ }
+#endif
+ closure->cb(closure->cb_arg, error);
+#ifndef NDEBUG
+ if (grpc_trace_closure.enabled()) {
+ gpr_log(GPR_DEBUG, "EventEngine: closure %p finished", closure);
+ }
+#endif
+}
+
+} // namespace
+
+std::function<void(absl::Status)> GrpcClosureToStatusCallback(
+ grpc_closure* closure) {
+ return [closure](absl::Status status) {
+ RunClosure(closure, absl_status_to_grpc_error(status));
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure) {
+ return [closure]() {
+ RunClosure(closure, GRPC_ERROR_NONE);
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure,
+ grpc_error_handle error) {
+ return [closure, error]() {
+ RunClosure(closure, error);
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/closure.h b/grpc/src/core/lib/iomgr/event_engine/closure.h
new file mode 100644
index 00000000..ecb332bf
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/closure.h
@@ -0,0 +1,42 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Creates a callback that takes an error status argument.
+std::function<void(absl::Status)> GrpcClosureToStatusCallback(
+ grpc_closure* closure);
+
+/// Create a callback that *does not* take an error status argument.
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure);
+
+/// Creates a callback that *does not* take an error status argument.
+/// This version has a pre-bound error.
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure,
+ grpc_error_handle error);
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/endpoint.cc b/grpc/src/core/lib/iomgr/event_engine/endpoint.cc
new file mode 100644
index 00000000..11b1df86
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/endpoint.cc
@@ -0,0 +1,172 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include "absl/strings/string_view.h"
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/slice.h>
+#include <grpc/slice_buffer.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/endpoint.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/transport/error_utils.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+namespace {
+
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::ResolvedAddressToURI;
+using ::grpc_event_engine::experimental::SliceBuffer;
+
+void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb, bool /* urgent */) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_CANCELLED);
+ return;
+ }
+ SliceBuffer* read_buffer = new (&eeep->read_buffer) SliceBuffer(slices);
+ eeep->endpoint->Read(
+ [eeep, cb](absl::Status status) {
+ auto* read_buffer = reinterpret_cast<SliceBuffer*>(&eeep->read_buffer);
+ read_buffer->~SliceBuffer();
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
+ absl_status_to_grpc_error(status));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ read_buffer);
+}
+
+void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb, void* arg) {
+ // TODO(hork): adapt arg to some metrics collection mechanism.
+ (void)arg;
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_CANCELLED);
+ return;
+ }
+ SliceBuffer* write_buffer = new (&eeep->write_buffer) SliceBuffer(slices);
+ eeep->endpoint->Write(
+ [eeep, cb](absl::Status status) {
+ auto* write_buffer =
+ reinterpret_cast<SliceBuffer*>(&eeep->write_buffer);
+ write_buffer->~SliceBuffer();
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
+ absl_status_to_grpc_error(status));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ write_buffer);
+}
+void endpoint_add_to_pollset(grpc_endpoint* /* ep */,
+ grpc_pollset* /* pollset */) {}
+void endpoint_add_to_pollset_set(grpc_endpoint* /* ep */,
+ grpc_pollset_set* /* pollset */) {}
+void endpoint_delete_from_pollset_set(grpc_endpoint* /* ep */,
+ grpc_pollset_set* /* pollset */) {}
+/// After shutdown, all endpoint operations except destroy are no-op,
+/// and will return some kind of sane default (empty strings, nullptrs, etc). It
+/// is the caller's responsibility to ensure that calls to endpoint_shutdown are
+/// synchronized.
+void endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
+ std::string str = grpc_error_std_string(why);
+ gpr_log(GPR_INFO, "TCP Endpoint %p shutdown why=%s", eeep->endpoint.get(),
+ str.c_str());
+ }
+ eeep->endpoint.reset();
+}
+
+void endpoint_destroy(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ delete eeep;
+}
+
+absl::string_view endpoint_get_peer(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ return "";
+ }
+ if (eeep->peer_address.empty()) {
+ const EventEngine::ResolvedAddress& addr = eeep->endpoint->GetPeerAddress();
+ eeep->peer_address = ResolvedAddressToURI(addr);
+ }
+ return eeep->peer_address;
+}
+
+absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ return "";
+ }
+ if (eeep->local_address.empty()) {
+ const EventEngine::ResolvedAddress& addr =
+ eeep->endpoint->GetLocalAddress();
+ eeep->local_address = ResolvedAddressToURI(addr);
+ }
+ return eeep->local_address;
+}
+
+int endpoint_get_fd(grpc_endpoint* /* ep */) { return -1; }
+
+bool endpoint_can_track_err(grpc_endpoint* /* ep */) { return false; }
+
+grpc_endpoint_vtable grpc_event_engine_endpoint_vtable = {
+ endpoint_read,
+ endpoint_write,
+ endpoint_add_to_pollset,
+ endpoint_add_to_pollset_set,
+ endpoint_delete_from_pollset_set,
+ endpoint_shutdown,
+ endpoint_destroy,
+ endpoint_get_peer,
+ endpoint_get_local_address,
+ endpoint_get_fd,
+ endpoint_can_track_err};
+
+} // namespace
+
+grpc_event_engine_endpoint* grpc_tcp_server_endpoint_create(
+ std::unique_ptr<EventEngine::Endpoint> ee_endpoint) {
+ auto endpoint = new grpc_event_engine_endpoint;
+ endpoint->base.vtable = &grpc_event_engine_endpoint_vtable;
+ endpoint->endpoint = std::move(ee_endpoint);
+ return endpoint;
+}
+
+grpc_endpoint* grpc_tcp_create(const grpc_channel_args* /* channel_args */,
+ absl::string_view /* peer_address */) {
+ auto endpoint = new grpc_event_engine_endpoint;
+ endpoint->base.vtable = &grpc_event_engine_endpoint_vtable;
+ return &endpoint->base;
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/endpoint.h b/grpc/src/core/lib/iomgr/event_engine/endpoint.h
new file mode 100644
index 00000000..b0c5c522
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/endpoint.h
@@ -0,0 +1,52 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resource_quota.h"
+
+struct grpc_event_engine_endpoint {
+ grpc_endpoint base;
+ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
+ endpoint;
+ std::string peer_address;
+ std::string local_address;
+ std::aligned_storage<
+ sizeof(grpc_event_engine::experimental::SliceBuffer),
+ alignof(grpc_event_engine::experimental::SliceBuffer)>::type read_buffer;
+ std::aligned_storage<
+ sizeof(grpc_event_engine::experimental::SliceBuffer),
+ alignof(grpc_event_engine::experimental::SliceBuffer)>::type write_buffer;
+};
+
+/// Creates an internal grpc_endpoint struct from an EventEngine Endpoint.
+/// Server code needs to create grpc_endpoints after the EventEngine has made
+/// connections.
+grpc_event_engine_endpoint* grpc_tcp_server_endpoint_create(
+ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint> ee);
+
+/// Creates a new internal grpc_endpoint struct, when no EventEngine Endpoint
+/// has yet been created. This is used in client code before connections are
+/// established. Takes ownership of the slice_allocator.
+grpc_endpoint* grpc_tcp_create(const grpc_channel_args* channel_args,
+ absl::string_view peer_address);
+
+#endif
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/iomgr.cc b/grpc/src/core/lib/iomgr/event_engine/iomgr.cc
new file mode 100644
index 00000000..2fc7f046
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/iomgr.cc
@@ -0,0 +1,85 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/event_engine/resolver.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/surface/init.h"
+
+extern grpc_tcp_client_vtable grpc_event_engine_tcp_client_vtable;
+extern grpc_tcp_server_vtable grpc_event_engine_tcp_server_vtable;
+extern grpc_timer_vtable grpc_event_engine_timer_vtable;
+extern grpc_pollset_vtable grpc_event_engine_pollset_vtable;
+extern grpc_pollset_set_vtable grpc_event_engine_pollset_set_vtable;
+
+// Disabled by default. grpc_polling_trace must be defined in all iomgr
+// implementations due to its usage in lockfree_event.
+grpc_core::DebugOnlyTraceFlag grpc_polling_trace(false, "polling");
+
+namespace {
+
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+
+// TODO(nnoble): Instantiate the default EventEngine if none have been provided.
+void iomgr_platform_init(void) {}
+
+void iomgr_platform_flush(void) {}
+
+void iomgr_platform_shutdown(void) {}
+
+void iomgr_platform_shutdown_background_closure(void) {}
+
+bool iomgr_platform_is_any_background_poller_thread(void) {
+ return grpc_event_engine::experimental::GetDefaultEventEngine()
+ ->IsWorkerThread();
+}
+
+bool iomgr_platform_add_closure_to_background_poller(
+ grpc_closure* /* closure */, grpc_error_handle /* error */) {
+ return false;
+}
+
+grpc_iomgr_platform_vtable vtable = {
+ iomgr_platform_init,
+ iomgr_platform_flush,
+ iomgr_platform_shutdown,
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread,
+ iomgr_platform_add_closure_to_background_poller};
+
+} // namespace
+
+void grpc_set_default_iomgr_platform() {
+ grpc_set_tcp_client_impl(&grpc_event_engine_tcp_client_vtable);
+ grpc_set_tcp_server_impl(&grpc_event_engine_tcp_server_vtable);
+ grpc_set_timer_impl(&grpc_event_engine_timer_vtable);
+ grpc_set_pollset_vtable(&grpc_event_engine_pollset_vtable);
+ grpc_set_pollset_set_vtable(&grpc_event_engine_pollset_set_vtable);
+ grpc_core::SetDNSResolver(
+ grpc_core::experimental::EventEngineDNSResolver::GetOrCreate());
+ grpc_set_iomgr_platform_vtable(&vtable);
+}
+
+bool grpc_iomgr_run_in_background() { return false; }
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/pollset.cc b/grpc/src/core/lib/iomgr/event_engine/pollset.cc
new file mode 100644
index 00000000..8dac8ef9
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/pollset.cc
@@ -0,0 +1,87 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+
+namespace {
+
+static gpr_mu g_mu;
+static gpr_cv g_cv;
+
+// --- pollset vtable API ---
+void pollset_global_init(void) {
+ gpr_mu_init(&g_mu);
+ gpr_cv_init(&g_cv);
+}
+void pollset_global_shutdown(void) {
+ gpr_cv_destroy(&g_cv);
+ gpr_mu_destroy(&g_mu);
+}
+void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { *mu = &g_mu; }
+void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
+}
+void pollset_destroy(grpc_pollset* pollset) {}
+grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_core::Timestamp deadline) {
+ (void)worker;
+ gpr_cv_wait(&g_cv, &g_mu, deadline.as_timespec(GPR_CLOCK_REALTIME));
+ return GRPC_ERROR_NONE;
+}
+grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
+ (void)pollset;
+ (void)specific_worker;
+ return GRPC_ERROR_NONE;
+}
+size_t pollset_size(void) { return 1; }
+
+// --- pollset_set vtable API ---
+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) {}
+
+} // namespace
+
+void grpc_pollset_ee_broadcast_event() { gpr_cv_signal(&g_cv); }
+
+// --- vtables ---
+grpc_pollset_vtable grpc_event_engine_pollset_vtable = {
+ pollset_global_init, pollset_global_shutdown,
+ pollset_init, pollset_shutdown,
+ pollset_destroy, pollset_work,
+ pollset_kick, pollset_size};
+
+grpc_pollset_set_vtable grpc_event_engine_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 // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/pollset.h b/grpc/src/core/lib/iomgr/event_engine/pollset.h
new file mode 100644
index 00000000..94a46c0a
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/pollset.h
@@ -0,0 +1,25 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+
+/// Signals pollset_work that some work has been done.
+void grpc_pollset_ee_broadcast_event();
+
+#endif
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/promise.h b/grpc/src/core/lib/iomgr/event_engine/promise.h
new file mode 100644
index 00000000..155534b8
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/promise.h
@@ -0,0 +1,51 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// A minimal promise implementation.
+///
+/// This is light-duty, syntactical sugar around cv wait & signal, which is
+/// useful in some cases. A more robust implementation is being worked on
+/// separately.
+template <typename T>
+class Promise {
+ public:
+ T& Get() {
+ absl::MutexLock lock(&mu_);
+ cv_.Wait(&mu_);
+ return val_;
+ }
+ void Set(T&& val) {
+ absl::MutexLock lock(&mu_);
+ val_ = std::move(val);
+ cv_.Signal();
+ }
+
+ private:
+ absl::Mutex mu_;
+ absl::CondVar cv_;
+ T val_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc b/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc
new file mode 100644
index 00000000..ef270593
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc
@@ -0,0 +1,47 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/event_engine/resolved_address_internal.h"
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress CreateResolvedAddress(
+ const grpc_resolved_address& addr) {
+ return EventEngine::ResolvedAddress(
+ reinterpret_cast<const sockaddr*>(addr.addr), addr.len);
+}
+
+grpc_resolved_address CreateGRPCResolvedAddress(
+ const EventEngine::ResolvedAddress& ra) {
+ grpc_resolved_address grpc_addr;
+ memcpy(grpc_addr.addr, ra.address(), ra.size());
+ grpc_addr.len = ra.size();
+ return grpc_addr;
+}
+
+// TODO(ctiller): Move this to somewhere more permanent as we're deleting iomgr.
+std::string ResolvedAddressToURI(const EventEngine::ResolvedAddress& addr) {
+ auto gra = CreateGRPCResolvedAddress(addr);
+ return grpc_sockaddr_to_uri(&gra);
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h b/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h
new file mode 100644
index 00000000..27141f2b
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h
@@ -0,0 +1,37 @@
+// Copyright 2021 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.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress CreateResolvedAddress(
+ const grpc_resolved_address& addr);
+
+grpc_resolved_address CreateGRPCResolvedAddress(
+ const EventEngine::ResolvedAddress& ra);
+
+std::string ResolvedAddressToURI(const EventEngine::ResolvedAddress& addr);
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/resolver.cc b/grpc/src/core/lib/iomgr/event_engine/resolver.cc
new file mode 100644
index 00000000..5d983adf
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/resolver.cc
@@ -0,0 +1,133 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include "absl/functional/bind_front.h"
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/promise.h"
+#include "src/core/lib/iomgr/event_engine/resolved_address_internal.h"
+#include "src/core/lib/iomgr/event_engine/resolver.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_impl.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+namespace experimental {
+namespace {
+using ::grpc_event_engine::experimental::CreateGRPCResolvedAddress;
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::Promise;
+
+/// A fire-and-forget class representing an individual DNS request.
+///
+/// This provides a place to store the ownership of the DNSResolver object until
+/// the request is complete.
+class EventEngineDNSRequest : DNSRequest {
+ public:
+ EventEngineDNSRequest(std::unique_ptr<EventEngine::DNSResolver> dns_resolver,
+ absl::string_view name, absl::string_view default_port,
+ grpc_closure* on_done,
+ std::vector<grpc_resolved_address>* addresses)
+ : dns_resolver_(std::move(dns_resolver)),
+ name_(std::string(name)),
+ default_port_(std::string(default_port)),
+ on_done_(std::move(on_done)) {}
+
+ void Start() override {
+ if (dns_resolver_ == nullptr) {
+ new DNSCallbackExecCtxScheduler(
+ std::move(on_done_),
+ absl::UnknownError("Failed to get DNS Resolver."));
+ return;
+ }
+ Ref().release(); // ref held by pending resolution
+ dns_resolver_->LookupHostname(
+ absl::bind_front(&EventEngineDNSRequest::OnLookupComplete, this), name_,
+ default_port_, absl::InfiniteFuture());
+ }
+
+ // TODO(hork): implement cancellation; currently it's a no-op
+ void Orphan() override { Unref(); }
+
+ private:
+ void OnLookupComplete(
+ absl::StatusOr<std::vector<EventEngine::ResolvedAddress>> addresses) {
+ ExecCtx exec_ctx;
+ // Convert addresses to iomgr form.
+ std::vector<grpc_resolved_address> result;
+ results.reserve(addresses->size());
+ for (size_t i = 0; i < addresses->size(); ++i) {
+ results.push_back(CreateGRPCResolvedAddress(addresses[i]));
+ }
+ if (addresses.ok()) {
+ on_done_(std::move(result));
+ } else {
+ on_done_(addresses.status());
+ }
+ Unref();
+ }
+
+ std::unique_ptr<EventEngine::DNSResolver> dns_resolver_;
+ const std::string name_;
+ const std::string default_port_;
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done_;
+};
+
+} // namespace
+
+DNSResolver* EventEngineDNSResolver::GetOrCreate() {
+ static EventEngineDNSResolver* instance = new EventEngineDNSResolver();
+ return instance;
+}
+
+OrphanablePtr<DNSResolver::Request> EventEngineDNSResolver::ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* /* interested_parties */,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) {
+ std::unique_ptr<EventEngine::DNSResolver> dns_resolver =
+ GetDefaultEventEngine()->GetDNSResolver();
+ return MakeOrphanable<EventEngineDNSRequest>(
+ std::move(dns_resolver), name, default_port, std::move(on_done));
+}
+
+absl::StatusOr<std::vector<grpc_resolved_address>>
+EventEngineDNSResolver::ResolveNameBlocking(absl::string_view name,
+ absl::string_view default_port) {
+ grpc_closure on_done;
+ Promise<absl::StatusOr<std::vector<grpc_resolved_address>>> evt;
+ auto r = ResolveName(
+ name, default_port,
+ [&evt](void(absl::StatusOr<std::vector<grpc_resolved_address>> result) {
+ evt.Set(std::move(result));
+ }));
+ r->Start();
+ return evt.Get();
+}
+
+} // namespace experimental
+} // namespace grpc_core
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/resolver.h b/grpc/src/core/lib/iomgr/event_engine/resolver.h
new file mode 100644
index 00000000..09c98ae7
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/resolver.h
@@ -0,0 +1,56 @@
+//
+// 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_EVENT_ENGINE_RESOLVER_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string.h>
+#include <sys/types.h>
+
+#include <functional>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_core {
+namespace experimental {
+
+class EventEngineDNSResolver : public DNSResolver {
+ public:
+ // Gets the singleton instance, creating it first if it doesn't exist
+ static EventEngineDNSResolver* GetOrCreate();
+
+ OrphanablePtr<DNSResolver::Request> ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) override;
+
+ absl::StatusOr<std::vector<grpc_resolved_address>> ResolveNameBlocking(
+ absl::string_view name, absl::string_view default_port) override;
+};
+
+} // namespace experimental
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVER_H
diff --git a/grpc/src/core/lib/iomgr/event_engine/tcp.cc b/grpc/src/core/lib/iomgr/event_engine/tcp.cc
new file mode 100644
index 00000000..e9d6e9d8
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/tcp.cc
@@ -0,0 +1,296 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/event_engine/sockaddr.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/endpoint.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+namespace {
+using ::grpc_event_engine::experimental::ChannelArgsEndpointConfig;
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::GrpcClosureToStatusCallback;
+using ::grpc_event_engine::experimental::SliceAllocator;
+using ::grpc_event_engine::experimental::SliceAllocatorFactory;
+using ::grpc_event_engine::experimental::SliceBuffer;
+} // namespace
+
+class WrappedInternalSliceAllocator : public SliceAllocator {
+ public:
+ explicit WrappedInternalSliceAllocator(grpc_slice_allocator* slice_allocator)
+ : slice_allocator_(slice_allocator) {}
+
+ ~WrappedInternalSliceAllocator() {
+ grpc_slice_allocator_destroy(slice_allocator_);
+ }
+
+ absl::Status Allocate(size_t size, SliceBuffer* dest,
+ SliceAllocator::AllocateCallback cb) override {
+ // TODO(nnoble): requires the SliceBuffer definition.
+ grpc_slice_allocator_allocate(
+ slice_allocator_, size, 1, grpc_slice_allocator_intent::kReadBuffer,
+ dest->RawSliceBuffer(),
+ [](void* arg, grpc_error_handle error) {
+ auto cb = static_cast<SliceAllocator::AllocateCallback*>(arg);
+ (*cb)(grpc_error_to_absl_status(error));
+ delete cb;
+ },
+ new SliceAllocator::AllocateCallback(cb));
+ return absl::OkStatus();
+ }
+
+ private:
+ grpc_slice_allocator* slice_allocator_;
+};
+
+class WrappedInternalSliceAllocatorFactory : public SliceAllocatorFactory {
+ public:
+ explicit WrappedInternalSliceAllocatorFactory(
+ grpc_slice_allocator_factory* slice_allocator_factory)
+ : slice_allocator_factory_(slice_allocator_factory) {}
+
+ ~WrappedInternalSliceAllocatorFactory() {
+ grpc_slice_allocator_factory_destroy(slice_allocator_factory_);
+ }
+
+ std::unique_ptr<SliceAllocator> CreateSliceAllocator(
+ absl::string_view peer_name) override {
+ return absl::make_unique<WrappedInternalSliceAllocator>(
+ grpc_slice_allocator_factory_create_slice_allocator(
+ slice_allocator_factory_, peer_name));
+ };
+
+ private:
+ grpc_slice_allocator_factory* slice_allocator_factory_;
+};
+
+struct grpc_tcp_server {
+ explicit grpc_tcp_server(std::unique_ptr<EventEngine::Listener> listener)
+ : refcount(1, GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) ? "tcp" : nullptr),
+ listener(std::move(listener)) {
+ shutdown_starting.head = nullptr;
+ shutdown_starting.tail = nullptr;
+ };
+ ~grpc_tcp_server() {
+ grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &shutdown_starting);
+ grpc_core::ExecCtx::Get()->Flush();
+ }
+ grpc_core::RefCount refcount;
+ grpc_core::Mutex mu;
+ std::unique_ptr<EventEngine::Listener> listener;
+ grpc_closure_list shutdown_starting ABSL_GUARDED_BY(mu);
+ grpc_tcp_server_cb on_accept_internal;
+ void* on_accept_internal_arg;
+};
+
+namespace {
+
+/// Converts a grpc_closure to an EventEngine Callback. The closure is expected
+/// to already be initialized.
+EventEngine::OnConnectCallback GrpcClosureToOnConnectCallback(
+ grpc_closure* closure, grpc_endpoint** endpoint_ptr) {
+ return [closure, endpoint_ptr](
+ absl::StatusOr<std::unique_ptr<EventEngine::Endpoint>> endpoint) {
+ grpc_core::ExecCtx exec_ctx;
+ if (endpoint.ok()) {
+ auto* grpc_endpoint_out =
+ reinterpret_cast<grpc_event_engine_endpoint*>(*endpoint_ptr);
+ grpc_endpoint_out->endpoint = std::move(*endpoint);
+ } else {
+ grpc_endpoint_destroy(*endpoint_ptr);
+ *endpoint_ptr = nullptr;
+ }
+ grpc_core::Closure::Run(DEBUG_LOCATION, closure,
+ absl_status_to_grpc_error(endpoint.status()));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+/// Usage note: this method does not take ownership of any pointer arguments.
+void tcp_connect(grpc_closure* on_connect, grpc_endpoint** endpoint,
+ grpc_slice_allocator* slice_allocator,
+ grpc_pollset_set* /* interested_parties */,
+ const grpc_channel_args* channel_args,
+ const grpc_resolved_address* addr,
+ grpc_core::Timestamp deadline) {
+ grpc_event_engine_endpoint* ee_endpoint =
+ reinterpret_cast<grpc_event_engine_endpoint*>(
+ grpc_tcp_create(channel_args, grpc_sockaddr_to_uri(addr)));
+ *endpoint = &ee_endpoint->base;
+ EventEngine::OnConnectCallback ee_on_connect =
+ GrpcClosureToOnConnectCallback(on_connect, endpoint);
+ auto ee_slice_allocator =
+ absl::make_unique<WrappedInternalSliceAllocator>(slice_allocator);
+ EventEngine::ResolvedAddress ra(reinterpret_cast<const sockaddr*>(addr->addr),
+ addr->len);
+ absl::Time ee_deadline =
+ grpc_core::ToAbslTime(deadline.as_timespec(GPR_CLOCK_MONOTONIC));
+ ChannelArgsEndpointConfig endpoint_config(channel_args);
+ absl::Status connected = GetDefaultEventEngine()->Connect(
+ ee_on_connect, ra, endpoint_config, std::move(ee_slice_allocator),
+ ee_deadline);
+ if (!connected.ok()) {
+ // EventEngine failed to start an asynchronous connect.
+ grpc_endpoint_destroy(*endpoint);
+ *endpoint = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_connect,
+ absl_status_to_grpc_error(connected));
+ }
+}
+
+grpc_error_handle tcp_server_create(
+ grpc_closure* shutdown_complete, const grpc_channel_args* args,
+ grpc_slice_allocator_factory* slice_allocator_factory,
+ grpc_tcp_server** server) {
+ ChannelArgsEndpointConfig endpoint_config(args);
+ auto ee_slice_allocator_factory =
+ absl::make_unique<WrappedInternalSliceAllocatorFactory>(
+ slice_allocator_factory);
+ EventEngine* event_engine = GetDefaultEventEngine();
+ absl::StatusOr<std::unique_ptr<EventEngine::Listener>> listener =
+ event_engine->CreateListener(
+ [server](std::unique_ptr<EventEngine::Endpoint> ee_endpoint,
+ const SliceAllocator& /*slice_allocator*/) {
+ grpc_core::ExecCtx exec_ctx;
+ GPR_ASSERT((*server)->on_accept_internal != nullptr);
+ grpc_event_engine_endpoint* iomgr_endpoint =
+ grpc_tcp_server_endpoint_create(std::move(ee_endpoint));
+ grpc_tcp_server_acceptor* acceptor =
+ static_cast<grpc_tcp_server_acceptor*>(
+ gpr_zalloc(sizeof(*acceptor)));
+ acceptor->from_server = *server;
+ acceptor->external_connection = false;
+ (*server)->on_accept_internal((*server)->on_accept_internal_arg,
+ &iomgr_endpoint->base, nullptr,
+ acceptor);
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ GrpcClosureToStatusCallback(shutdown_complete), endpoint_config,
+ std::move(ee_slice_allocator_factory));
+ if (!listener.ok()) {
+ return absl_status_to_grpc_error(listener.status());
+ }
+ *server = new grpc_tcp_server(std::move(*listener));
+ return GRPC_ERROR_NONE;
+}
+
+void tcp_server_start(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* /* pollsets */,
+ grpc_tcp_server_cb on_accept_cb, void* cb_arg) {
+ server->on_accept_internal = on_accept_cb;
+ server->on_accept_internal_arg = cb_arg;
+ // The iomgr API does not handle situations where the server cannot start, so
+ // a crash may be preferable for now.
+ GPR_ASSERT(server->listener->Start().ok());
+}
+
+grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port) {
+ EventEngine::ResolvedAddress ra(reinterpret_cast<const sockaddr*>(addr->addr),
+ addr->len);
+ auto port = s->listener->Bind(ra);
+ if (!port.ok()) {
+ return absl_status_to_grpc_error(port.status());
+ }
+ *out_port = *port;
+ return GRPC_ERROR_NONE;
+}
+
+grpc_core::TcpServerFdHandler* tcp_server_create_fd_handler(
+ grpc_tcp_server* /* s */) {
+ // EventEngine-iomgr does not support fds.
+ return nullptr;
+}
+
+unsigned tcp_server_port_fd_count(grpc_tcp_server* /* s */,
+ unsigned /* port_index */) {
+ return 0;
+}
+
+int tcp_server_port_fd(grpc_tcp_server* /* s */, unsigned /* port_index */,
+ unsigned /* fd_index */) {
+ // Note: only used internally
+ return -1;
+}
+
+grpc_tcp_server* tcp_server_ref(grpc_tcp_server* s) {
+ s->refcount.Ref(DEBUG_LOCATION, "server ref");
+ return s;
+}
+
+void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+ grpc_closure* shutdown_starting) {
+ grpc_core::MutexLock lock(&s->mu);
+ grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
+ GRPC_ERROR_NONE);
+}
+
+void tcp_server_unref(grpc_tcp_server* s) {
+ if (GPR_UNLIKELY(s->refcount.Unref(DEBUG_LOCATION, "server unref"))) {
+ delete s;
+ }
+}
+
+// No-op, all are handled on listener unref
+void tcp_server_shutdown_listeners(grpc_tcp_server* /* s */) {}
+
+} // namespace
+
+grpc_tcp_client_vtable grpc_event_engine_tcp_client_vtable = {tcp_connect};
+grpc_tcp_server_vtable grpc_event_engine_tcp_server_vtable = {
+ tcp_server_create, tcp_server_start,
+ tcp_server_add_port, tcp_server_create_fd_handler,
+ tcp_server_port_fd_count, tcp_server_port_fd,
+ tcp_server_ref, tcp_server_shutdown_starting_add,
+ tcp_server_unref, tcp_server_shutdown_listeners};
+
+// Methods that are expected to exist elsewhere in the codebase.
+
+struct grpc_fd {
+ int fd;
+};
+
+grpc_fd* grpc_fd_create(int /* fd */, const char* /* name */,
+ bool /* track_err */) {
+ return nullptr;
+}
+
+grpc_endpoint* grpc_tcp_client_create_from_fd(
+ grpc_fd* /* fd */, const grpc_channel_args* /* channel_args */,
+ absl::string_view /* addr_str */,
+ grpc_slice_allocator* slice_allocator /* slice_allocator */) {
+ grpc_slice_allocator_destroy(slice_allocator);
+ return nullptr;
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/event_engine/timer.cc b/grpc/src/core/lib/iomgr/event_engine/timer.cc
new file mode 100644
index 00000000..7b139816
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/event_engine/timer.cc
@@ -0,0 +1,62 @@
+// Copyright 2021 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.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace {
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::GrpcClosureToCallback;
+
+void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
+ grpc_closure* closure) {
+ timer->ee_task_handle = GetDefaultEventEngine()->RunAt(
+ grpc_core::ToAbslTime(deadline.as_timespec(GPR_CLOCK_REALTIME)),
+ GrpcClosureToCallback(closure));
+ timer->closure = closure;
+}
+
+void timer_cancel(grpc_timer* timer) {
+ auto handle = timer->ee_task_handle;
+ if (!GetDefaultEventEngine()->Cancel(handle)) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure,
+ GRPC_ERROR_CANCELLED);
+ }
+}
+
+/* Internal API */
+grpc_timer_check_result timer_check(grpc_core::Timestamp* /* next */) {
+ return GRPC_TIMERS_NOT_CHECKED;
+}
+void timer_list_init() {}
+void timer_list_shutdown(void) {}
+void timer_consume_kick(void) {}
+
+} // namespace
+
+grpc_timer_vtable grpc_event_engine_timer_vtable = {
+ timer_init, timer_cancel, timer_check,
+ timer_list_init, timer_list_shutdown, timer_consume_kick};
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/grpc/src/core/lib/iomgr/exec_ctx.cc b/grpc/src/core/lib/iomgr/exec_ctx.cc
index 54ab9fda..8bee36e5 100644
--- a/grpc/src/core/lib/iomgr/exec_ctx.cc
+++ b/grpc/src/core/lib/iomgr/exec_ctx.cc
@@ -23,11 +23,11 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
-static void exec_ctx_run(grpc_closure* closure, grpc_error_handle error) {
+static void exec_ctx_run(grpc_closure* closure) {
#ifndef NDEBUG
closure->scheduled = false;
if (grpc_trace_closure.enabled()) {
@@ -37,111 +37,34 @@ static void exec_ctx_run(grpc_closure* closure, grpc_error_handle error) {
closure->line_initiated);
}
#endif
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle error =
+ grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
+ closure->error_data.error = 0;
+ closure->cb(closure->cb_arg, std::move(error));
+#else
+ grpc_error_handle error =
+ reinterpret_cast<grpc_error_handle>(closure->error_data.error);
+ closure->error_data.error = 0;
closure->cb(closure->cb_arg, error);
+ GRPC_ERROR_UNREF(error);
+#endif
#ifndef NDEBUG
if (grpc_trace_closure.enabled()) {
gpr_log(GPR_DEBUG, "closure %p finished", closure);
}
#endif
- GRPC_ERROR_UNREF(error);
-}
-
-static void exec_ctx_sched(grpc_closure* closure, grpc_error_handle error) {
- grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), closure,
- error);
-}
-
-static gpr_timespec g_start_time;
-static gpr_cycle_counter g_start_cycle;
-
-static grpc_millis timespan_to_millis_round_down(gpr_timespec ts) {
- double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
- static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS;
- if (x < 0) return 0;
- if (x > static_cast<double>(GRPC_MILLIS_INF_FUTURE)) {
- return GRPC_MILLIS_INF_FUTURE;
- }
- return static_cast<grpc_millis>(x);
-}
-
-static grpc_millis timespec_to_millis_round_down(gpr_timespec ts) {
- return timespan_to_millis_round_down(gpr_time_sub(ts, g_start_time));
-}
-
-static grpc_millis timespan_to_millis_round_up(gpr_timespec ts) {
- double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
- static_cast<double>(ts.tv_nsec) / GPR_NS_PER_MS +
- static_cast<double>(GPR_NS_PER_SEC - 1) /
- static_cast<double>(GPR_NS_PER_SEC);
- if (x < 0) return 0;
- if (x > static_cast<double>(GRPC_MILLIS_INF_FUTURE)) {
- return GRPC_MILLIS_INF_FUTURE;
- }
- return static_cast<grpc_millis>(x);
-}
-
-static grpc_millis timespec_to_millis_round_up(gpr_timespec ts) {
- return timespan_to_millis_round_up(gpr_time_sub(ts, g_start_time));
}
-gpr_timespec grpc_millis_to_timespec(grpc_millis millis,
- gpr_clock_type clock_type) {
- // special-case infinities as grpc_millis can be 32bit on some platforms
- // while gpr_time_from_millis always takes an int64_t.
- if (millis == GRPC_MILLIS_INF_FUTURE) {
- return gpr_inf_future(clock_type);
- }
- if (millis == GRPC_MILLIS_INF_PAST) {
- return gpr_inf_past(clock_type);
- }
-
- if (clock_type == GPR_TIMESPAN) {
- return gpr_time_from_millis(millis, GPR_TIMESPAN);
- }
- return gpr_time_add(gpr_convert_clock_type(g_start_time, clock_type),
- gpr_time_from_millis(millis, GPR_TIMESPAN));
-}
-
-grpc_millis grpc_timespec_to_millis_round_down(gpr_timespec ts) {
- return timespec_to_millis_round_down(
- gpr_convert_clock_type(ts, g_start_time.clock_type));
-}
-
-grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec ts) {
- return timespec_to_millis_round_up(
- gpr_convert_clock_type(ts, g_start_time.clock_type));
-}
-
-grpc_millis grpc_cycle_counter_to_millis_round_down(gpr_cycle_counter cycles) {
- return timespan_to_millis_round_down(
- gpr_cycle_counter_sub(cycles, g_start_cycle));
-}
-
-grpc_millis grpc_cycle_counter_to_millis_round_up(gpr_cycle_counter cycles) {
- return timespan_to_millis_round_up(
- gpr_cycle_counter_sub(cycles, g_start_cycle));
+static void exec_ctx_sched(grpc_closure* closure) {
+ grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), closure);
}
namespace grpc_core {
-GPR_TLS_CLASS_DEF(ExecCtx::exec_ctx_);
-GPR_TLS_CLASS_DEF(ApplicationCallbackExecCtx::callback_exec_ctx_);
-// WARNING: for testing purposes only!
-void ExecCtx::TestOnlyGlobalInit(gpr_timespec new_val) {
- g_start_time = new_val;
- gpr_tls_init(&exec_ctx_);
-}
-
-void ExecCtx::GlobalInit(void) {
- // gpr_now(GPR_CLOCK_MONOTONIC) incurs a syscall. We don't actually know the
- // exact cycle the time was captured, so we use the average of cycles before
- // and after the syscall as the starting cycle.
- const gpr_cycle_counter cycle_before = gpr_get_cycle_counter();
- g_start_time = gpr_now(GPR_CLOCK_MONOTONIC);
- const gpr_cycle_counter cycle_after = gpr_get_cycle_counter();
- g_start_cycle = (cycle_before + cycle_after) / 2;
- gpr_tls_init(&exec_ctx_);
-}
+GPR_THREAD_LOCAL(ExecCtx*) ExecCtx::exec_ctx_;
+GPR_THREAD_LOCAL(ApplicationCallbackExecCtx*)
+ApplicationCallbackExecCtx::callback_exec_ctx_;
bool ExecCtx::Flush() {
bool did_something = false;
@@ -152,9 +75,8 @@ bool ExecCtx::Flush() {
closure_list_.head = closure_list_.tail = nullptr;
while (c != nullptr) {
grpc_closure* next = c->next_data.next;
- grpc_error_handle error = c->error_data.error;
did_something = true;
- exec_ctx_run(c, error);
+ exec_ctx_run(c);
c = next;
}
} else if (!grpc_combiner_continue_exec_ctx()) {
@@ -165,9 +87,9 @@ bool ExecCtx::Flush() {
return did_something;
}
-grpc_millis ExecCtx::Now() {
+Timestamp ExecCtx::Now() {
if (!now_is_valid_) {
- now_ = timespec_to_millis_round_down(gpr_now(GPR_CLOCK_MONOTONIC));
+ now_ = Timestamp::FromTimespecRoundDown(gpr_now(GPR_CLOCK_MONOTONIC));
now_is_valid_ = true;
}
return now_;
@@ -196,7 +118,12 @@ void ExecCtx::Run(const DebugLocation& location, grpc_closure* closure,
closure->run = false;
GPR_ASSERT(closure->cb != nullptr);
#endif
- exec_ctx_sched(closure, error);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ closure->error_data.error = internal::StatusAllocHeapPtr(error);
+#else
+ closure->error_data.error = reinterpret_cast<intptr_t>(error);
+#endif
+ exec_ctx_sched(closure);
}
void ExecCtx::RunList(const DebugLocation& location, grpc_closure_list* list) {
@@ -219,7 +146,7 @@ void ExecCtx::RunList(const DebugLocation& location, grpc_closure_list* list) {
c->run = false;
GPR_ASSERT(c->cb != nullptr);
#endif
- exec_ctx_sched(c, c->error_data.error);
+ exec_ctx_sched(c);
c = next;
}
list->head = list->tail = nullptr;
diff --git a/grpc/src/core/lib/iomgr/exec_ctx.h b/grpc/src/core/lib/iomgr/exec_ctx.h
index 9cb52575..2c9e2147 100644
--- a/grpc/src/core/lib/iomgr/exec_ctx.h
+++ b/grpc/src/core/lib/iomgr/exec_ctx.h
@@ -23,6 +23,7 @@
#include <limits>
+#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/atm.h>
#include <grpc/support/cpu.h>
@@ -32,13 +33,9 @@
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/fork.h"
+#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
-typedef int64_t grpc_millis;
-
-#define GRPC_MILLIS_INF_FUTURE INT64_MAX
-#define GRPC_MILLIS_INF_PAST INT64_MIN
-
/** A combiner represents a list of work to be executed later.
Forward declared here to avoid a circular dependency with combiner.h. */
typedef struct grpc_combiner grpc_combiner;
@@ -57,12 +54,6 @@ typedef struct grpc_combiner grpc_combiner;
should not be counted by fork handlers */
#define GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD 1
-gpr_timespec grpc_millis_to_timespec(grpc_millis millis, gpr_clock_type clock);
-grpc_millis grpc_timespec_to_millis_round_down(gpr_timespec ts);
-grpc_millis grpc_timespec_to_millis_round_up(gpr_timespec ts);
-grpc_millis grpc_cycle_counter_to_millis_round_down(gpr_cycle_counter cycles);
-grpc_millis grpc_cycle_counter_to_millis_round_up(gpr_cycle_counter cycles);
-
namespace grpc_core {
class Combiner;
/** Execution context.
@@ -73,10 +64,10 @@ class Combiner;
* Generally, to create an exec_ctx instance, add the following line at the top
* of the public API entry point or at the start of a thread's work function :
*
- * grpc_core::ExecCtx exec_ctx;
+ * ExecCtx exec_ctx;
*
* Access the created ExecCtx instance using :
- * grpc_core::ExecCtx::Get()
+ * ExecCtx::Get()
*
* Specific responsibilities (this may grow in the future):
* - track a list of core work that needs to be delayed until the base of the
@@ -90,7 +81,7 @@ class Combiner;
* - Instance of this must ALWAYS be constructed on the stack, never
* heap allocated.
* - Do not pass exec_ctx as a parameter to a function. Always access it using
- * grpc_core::ExecCtx::Get().
+ * ExecCtx::Get().
* - NOTE: In the future, the convention is likely to change to allow only one
* ExecCtx on a thread's stack at the same time. The TODO below
* discusses this plan in more detail.
@@ -108,14 +99,14 @@ class ExecCtx {
/** Default Constructor */
ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
Set(this);
}
/** Parameterised Constructor */
explicit ExecCtx(uintptr_t fl) : flags_(fl) {
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
}
Set(this);
}
@@ -126,7 +117,7 @@ class ExecCtx {
Flush();
Set(last_exec_ctx_);
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::DecExecCtxCount();
+ Fork::DecExecCtxCount();
}
}
@@ -189,7 +180,7 @@ class ExecCtx {
* otherwise refreshes the stored time, sets it valid and returns the new
* value.
*/
- grpc_millis Now();
+ Timestamp Now();
/** Invalidates the stored time value. A new time value will be set on calling
* Now().
@@ -198,34 +189,22 @@ class ExecCtx {
/** To be used only by shutdown code in iomgr */
void SetNowIomgrShutdown() {
- now_ = GRPC_MILLIS_INF_FUTURE;
+ now_ = Timestamp::InfFuture();
now_is_valid_ = true;
}
/** To be used only for testing.
* Sets the now value.
*/
- void TestOnlySetNow(grpc_millis new_val) {
+ void TestOnlySetNow(Timestamp new_val) {
now_ = new_val;
now_is_valid_ = true;
}
- static void TestOnlyGlobalInit(gpr_timespec new_val);
-
- /** Global initialization for ExecCtx. Called by iomgr. */
- static void GlobalInit(void);
-
- /** Global shutdown for ExecCtx. Called by iomgr. */
- static void GlobalShutdown(void) { gpr_tls_destroy(&exec_ctx_); }
-
/** Gets pointer to current exec_ctx. */
- static ExecCtx* Get() {
- return reinterpret_cast<ExecCtx*>(gpr_tls_get(&exec_ctx_));
- }
+ static ExecCtx* Get() { return exec_ctx_; }
- static void Set(ExecCtx* exec_ctx) {
- gpr_tls_set(&exec_ctx_, reinterpret_cast<intptr_t>(exec_ctx));
- }
+ static void Set(ExecCtx* exec_ctx) { exec_ctx_ = exec_ctx; }
static void Run(const DebugLocation& location, grpc_closure* closure,
grpc_error_handle error);
@@ -249,9 +228,9 @@ class ExecCtx {
unsigned starting_cpu_ = std::numeric_limits<unsigned>::max();
bool now_is_valid_ = false;
- grpc_millis now_ = 0;
+ Timestamp now_;
- GPR_TLS_CLASS_DECL(exec_ctx_);
+ static GPR_THREAD_LOCAL(ExecCtx*) exec_ctx_;
ExecCtx* last_exec_ctx_ = Get();
};
@@ -280,7 +259,7 @@ class ExecCtx {
* stacks of core re-entries. Instead, any application callbacks instead should
* not be invoked until other core work is done and other application callbacks
* have completed. To accomplish this, any application callback should be
- * enqueued using grpc_core::ApplicationCallbackExecCtx::Enqueue .
+ * enqueued using ApplicationCallbackExecCtx::Enqueue .
*
* CONVENTIONS:
* - Instances of this must ALWAYS be constructed on the stack, never
@@ -293,8 +272,8 @@ class ExecCtx {
* Generally, core entry points that may trigger application-level callbacks
* will have the following declarations:
*
- * grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- * grpc_core::ExecCtx exec_ctx;
+ * ApplicationCallbackExecCtx callback_exec_ctx;
+ * ExecCtx exec_ctx;
*
* This ordering is important to make sure that the ApplicationCallbackExecCtx
* is destroyed after the ExecCtx (to prevent the re-entry problem described
@@ -313,8 +292,7 @@ class ApplicationCallbackExecCtx {
}
~ApplicationCallbackExecCtx() {
- if (reinterpret_cast<ApplicationCallbackExecCtx*>(
- gpr_tls_get(&callback_exec_ctx_)) == this) {
+ if (Get() == this) {
while (head_ != nullptr) {
auto* f = head_;
head_ = f->internal_next;
@@ -323,9 +301,9 @@ class ApplicationCallbackExecCtx {
}
(*f->functor_run)(f, f->internal_success);
}
- gpr_tls_set(&callback_exec_ctx_, reinterpret_cast<intptr_t>(nullptr));
+ callback_exec_ctx_ = nullptr;
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::DecExecCtxCount();
+ Fork::DecExecCtxCount();
}
} else {
GPR_DEBUG_ASSERT(head_ == nullptr);
@@ -335,22 +313,18 @@ class ApplicationCallbackExecCtx {
uintptr_t Flags() { return flags_; }
- static ApplicationCallbackExecCtx* Get() {
- return reinterpret_cast<ApplicationCallbackExecCtx*>(
- gpr_tls_get(&callback_exec_ctx_));
- }
+ static ApplicationCallbackExecCtx* Get() { return callback_exec_ctx_; }
static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) {
if (Get() == nullptr) {
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
}
- gpr_tls_set(&callback_exec_ctx_, reinterpret_cast<intptr_t>(exec_ctx));
+ callback_exec_ctx_ = exec_ctx;
}
}
- static void Enqueue(grpc_experimental_completion_queue_functor* functor,
- int is_success) {
+ static void Enqueue(grpc_completion_queue_functor* functor, int is_success) {
functor->internal_success = is_success;
functor->internal_next = nullptr;
@@ -366,19 +340,20 @@ class ApplicationCallbackExecCtx {
}
/** Global initialization for ApplicationCallbackExecCtx. Called by init. */
- static void GlobalInit(void) { gpr_tls_init(&callback_exec_ctx_); }
+ static void GlobalInit(void) {}
/** Global shutdown for ApplicationCallbackExecCtx. Called by init. */
- static void GlobalShutdown(void) { gpr_tls_destroy(&callback_exec_ctx_); }
+ static void GlobalShutdown(void) {}
static bool Available() { return Get() != nullptr; }
private:
uintptr_t flags_{0u};
- grpc_experimental_completion_queue_functor* head_{nullptr};
- grpc_experimental_completion_queue_functor* tail_{nullptr};
- GPR_TLS_CLASS_DECL(callback_exec_ctx_);
+ grpc_completion_queue_functor* head_{nullptr};
+ grpc_completion_queue_functor* tail_{nullptr};
+ static GPR_THREAD_LOCAL(ApplicationCallbackExecCtx*) callback_exec_ctx_;
};
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_IOMGR_EXEC_CTX_H */
diff --git a/grpc/src/core/lib/iomgr/executor.cc b/grpc/src/core/lib/iomgr/executor.cc
index 3d8d757b..b8986d9f 100644
--- a/grpc/src/core/lib/iomgr/executor.cc
+++ b/grpc/src/core/lib/iomgr/executor.cc
@@ -27,12 +27,11 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
#define MAX_DEPTH 2
@@ -53,7 +52,7 @@
namespace grpc_core {
namespace {
-GPR_TLS_DECL(g_this_thread_state);
+GPR_THREAD_LOCAL(ThreadState*) g_this_thread_state;
Executor* executors[static_cast<size_t>(ExecutorType::NUM_EXECUTORS)];
@@ -92,7 +91,7 @@ TraceFlag executor_trace(false, "executor");
Executor::Executor(const char* name) : name_(name) {
adding_thread_lock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
gpr_atm_rel_store(&num_threads_, 0);
- max_threads_ = GPR_MAX(1, 2 * gpr_cpu_num_cores());
+ max_threads_ = std::max(1u, 2 * gpr_cpu_num_cores());
}
void Executor::Init() { SetThreading(true); }
@@ -109,13 +108,12 @@ size_t Executor::RunClosures(const char* executor_name,
// invoked on its destruction, which will be after completing any closures in
// the executor's closure list (which were explicitly scheduled onto the
// executor).
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx(
+ ApplicationCallbackExecCtx callback_exec_ctx(
GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
grpc_closure* c = list.head;
while (c != nullptr) {
grpc_closure* next = c->next_data.next;
- grpc_error_handle error = c->error_data.error;
#ifndef NDEBUG
EXECUTOR_TRACE("(%s) run %p [created by %s:%d]", executor_name, c,
c->file_created, c->line_created);
@@ -123,11 +121,21 @@ size_t Executor::RunClosures(const char* executor_name,
#else
EXECUTOR_TRACE("(%s) run %p", executor_name, c);
#endif
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle error =
+ internal::StatusMoveFromHeapPtr(c->error_data.error);
+ c->error_data.error = 0;
+ c->cb(c->cb_arg, std::move(error));
+#else
+ grpc_error_handle error =
+ reinterpret_cast<grpc_error_handle>(c->error_data.error);
+ c->error_data.error = 0;
c->cb(c->cb_arg, error);
GRPC_ERROR_UNREF(error);
+#endif
c = next;
n++;
- grpc_core::ExecCtx::Get()->Flush();
+ ExecCtx::Get()->Flush();
}
return n;
@@ -157,12 +165,11 @@ void Executor::SetThreading(bool threading) {
gpr_cv_init(&thd_state_[i].cv);
thd_state_[i].id = i;
thd_state_[i].name = name_;
- thd_state_[i].thd = grpc_core::Thread();
+ thd_state_[i].thd = Thread();
thd_state_[i].elems = GRPC_CLOSURE_LIST_INIT;
}
- thd_state_[0].thd =
- grpc_core::Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
+ thd_state_[0].thd = Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
thd_state_[0].thd.Start();
} else { // !threading
if (curr_num_threads == 0) {
@@ -203,8 +210,8 @@ void Executor::SetThreading(bool threading) {
// finish. Thus, never call Executor::SetThreading(false) in the middle of
// an application.
// TODO(guantaol): create another method to finish all the pending closures
- // registered in the background poller by grpc_core::Executor.
- grpc_iomgr_shutdown_background_closure();
+ // registered in the background poller by Executor.
+ grpc_iomgr_platform_shutdown_background_closure();
}
EXECUTOR_TRACE("(%s) SetThreading(%d) done", name_, threading);
@@ -214,9 +221,9 @@ void Executor::Shutdown() { SetThreading(false); }
void Executor::ThreadMain(void* arg) {
ThreadState* ts = static_cast<ThreadState*>(arg);
- gpr_tls_set(&g_this_thread_state, reinterpret_cast<intptr_t>(ts));
+ g_this_thread_state = ts;
- grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
+ ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
size_t subtract_depth = 0;
for (;;) {
@@ -237,28 +244,22 @@ void Executor::ThreadMain(void* arg) {
break;
}
- GRPC_STATS_INC_EXECUTOR_QUEUE_DRAINED();
grpc_closure_list closures = ts->elems;
ts->elems = GRPC_CLOSURE_LIST_INIT;
gpr_mu_unlock(&ts->mu);
EXECUTOR_TRACE("(%s) [%" PRIdPTR "]: execute", ts->name, ts->id);
- grpc_core::ExecCtx::Get()->InvalidateNow();
+ ExecCtx::Get()->InvalidateNow();
subtract_depth = RunClosures(ts->name, closures);
}
- gpr_tls_set(&g_this_thread_state, reinterpret_cast<intptr_t>(nullptr));
+ g_this_thread_state = nullptr;
}
void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
bool is_short) {
bool retry_push;
- if (is_short) {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_SHORT_ITEMS();
- } else {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_LONG_ITEMS();
- }
do {
retry_push = false;
@@ -274,22 +275,17 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
#else
EXECUTOR_TRACE("(%s) schedule %p inline", name_, closure);
#endif
- grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(),
- closure, error);
+ grpc_closure_list_append(ExecCtx::Get()->closure_list(), closure, error);
return;
}
- if (grpc_iomgr_add_closure_to_background_poller(closure, error)) {
+ if (grpc_iomgr_platform_add_closure_to_background_poller(closure, error)) {
return;
}
- ThreadState* ts =
- reinterpret_cast<ThreadState*>(gpr_tls_get(&g_this_thread_state));
+ ThreadState* ts = g_this_thread_state;
if (ts == nullptr) {
- ts = &thd_state_[GPR_HASH_POINTER(grpc_core::ExecCtx::Get(),
- cur_thread_count)];
- } else {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_TO_SELF();
+ ts = &thd_state_[HashPointer(ExecCtx::Get(), cur_thread_count)];
}
ThreadState* orig_ts = ts;
@@ -342,7 +338,6 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
// - Note that gpr_cv_signal() won't immediately wakeup the thread. That
// happens after we release the mutex &ts->mu a few lines below
if (grpc_closure_list_empty(ts->elems) && !ts->shutdown) {
- GRPC_STATS_INC_EXECUTOR_WAKEUP_INITIATED();
gpr_cv_signal(&ts->cv);
}
@@ -367,16 +362,12 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
// always increment num_threads under the 'adding_thread_lock')
gpr_atm_rel_store(&num_threads_, cur_thread_count + 1);
- thd_state_[cur_thread_count].thd = grpc_core::Thread(
- name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]);
+ thd_state_[cur_thread_count].thd =
+ Thread(name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]);
thd_state_[cur_thread_count].thd.Start();
}
gpr_spinlock_unlock(&adding_thread_lock_);
}
-
- if (retry_push) {
- GRPC_STATS_INC_EXECUTOR_PUSH_RETRIES();
- }
} while (retry_push);
}
@@ -465,6 +456,6 @@ void Executor::SetThreadingDefault(bool enable) {
executors[static_cast<size_t>(ExecutorType::DEFAULT)]->SetThreading(enable);
}
-void grpc_executor_global_init() { gpr_tls_init(&g_this_thread_state); }
+void grpc_executor_global_init() {}
} // namespace grpc_core
diff --git a/grpc/src/core/lib/iomgr/executor.h b/grpc/src/core/lib/iomgr/executor.h
index 37e5c1e5..2b18d842 100644
--- a/grpc/src/core/lib/iomgr/executor.h
+++ b/grpc/src/core/lib/iomgr/executor.h
@@ -36,7 +36,7 @@ struct ThreadState {
size_t depth; // Number of closures in the closure list
bool shutdown;
bool queued_long_job;
- grpc_core::Thread thd;
+ Thread thd;
};
enum class ExecutorType {
diff --git a/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc b/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
index 74096a4c..e4d9d21d 100644
--- a/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
+++ b/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -29,7 +29,8 @@ inline void* InfLenFIFOQueue::PopFront() {
// mutex. This function will assume that there is at least one element in the
// queue (i.e. queue_head_->content is valid).
void* result = queue_head_->content;
- count_.Store(count_.Load(MemoryOrder::RELAXED) - 1, MemoryOrder::RELAXED);
+ count_.store(count_.load(std::memory_order_relaxed) - 1,
+ std::memory_order_relaxed);
// Updates Stats when trace flag turned on.
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace)) {
@@ -40,7 +41,7 @@ inline void* InfLenFIFOQueue::PopFront() {
stats_.max_queue_time = gpr_time_max(
gpr_convert_clock_type(stats_.max_queue_time, GPR_TIMESPAN), wait_time);
- if (count_.Load(MemoryOrder::RELAXED) == 0) {
+ if (count_.load(std::memory_order_relaxed) == 0) {
stats_.busy_queue_time =
gpr_time_add(stats_.busy_queue_time,
gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), busy_time));
@@ -57,7 +58,7 @@ inline void* InfLenFIFOQueue::PopFront() {
queue_head_ = queue_head_->next;
// Signal waiting thread
- if (count_.Load(MemoryOrder::RELAXED) > 0) {
+ if (count_.load(std::memory_order_relaxed) > 0) {
TopWaiter()->cv.Signal();
}
@@ -66,7 +67,7 @@ inline void* InfLenFIFOQueue::PopFront() {
InfLenFIFOQueue::Node* InfLenFIFOQueue::AllocateNodes(int num) {
num_nodes_ = num_nodes_ + num;
- Node* new_chunk = static_cast<Node*>(gpr_zalloc(sizeof(Node) * num));
+ Node* new_chunk = new Node[num];
new_chunk[0].next = &new_chunk[1];
new_chunk[num - 1].prev = &new_chunk[num - 2];
for (int i = 1; i < num - 1; ++i) {
@@ -78,8 +79,7 @@ InfLenFIFOQueue::Node* InfLenFIFOQueue::AllocateNodes(int num) {
InfLenFIFOQueue::InfLenFIFOQueue() {
delete_list_size_ = kDeleteListInitSize;
- delete_list_ =
- static_cast<Node**>(gpr_zalloc(sizeof(Node*) * delete_list_size_));
+ delete_list_ = new Node*[delete_list_size_];
Node* new_chunk = AllocateNodes(kQueueInitNumNodes);
delete_list_[delete_list_count_++] = new_chunk;
@@ -92,17 +92,17 @@ InfLenFIFOQueue::InfLenFIFOQueue() {
}
InfLenFIFOQueue::~InfLenFIFOQueue() {
- GPR_ASSERT(count_.Load(MemoryOrder::RELAXED) == 0);
+ GPR_ASSERT(count_.load(std::memory_order_relaxed) == 0);
for (size_t i = 0; i < delete_list_count_; ++i) {
- gpr_free(delete_list_[i]);
+ delete[] delete_list_[i];
}
- gpr_free(delete_list_);
+ delete[] delete_list_;
}
void InfLenFIFOQueue::Put(void* elem) {
MutexLock l(&mu_);
- int curr_count = count_.Load(MemoryOrder::RELAXED);
+ int curr_count = count_.load(std::memory_order_relaxed);
if (queue_tail_ == queue_head_ && curr_count != 0) {
// List is full. Expands list to double size by inserting new chunk of nodes
@@ -111,8 +111,7 @@ void InfLenFIFOQueue::Put(void* elem) {
// Expands delete list on full.
if (delete_list_count_ == delete_list_size_) {
delete_list_size_ = delete_list_size_ * 2;
- delete_list_ = static_cast<Node**>(
- gpr_realloc(delete_list_, sizeof(Node*) * delete_list_size_));
+ delete_list_ = new Node*[delete_list_size_];
}
new_chunk[0].prev = queue_tail_->prev;
new_chunk[curr_count - 1].next = queue_head_;
@@ -134,7 +133,7 @@ void InfLenFIFOQueue::Put(void* elem) {
queue_tail_->insert_time = current_time;
}
- count_.Store(curr_count + 1, MemoryOrder::RELAXED);
+ count_.store(curr_count + 1, std::memory_order_relaxed);
queue_tail_ = queue_tail_->next;
TopWaiter()->cv.Signal();
@@ -143,7 +142,7 @@ void InfLenFIFOQueue::Put(void* elem) {
void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) {
MutexLock l(&mu_);
- if (count_.Load(MemoryOrder::RELAXED) == 0) {
+ if (count_.load(std::memory_order_relaxed) == 0) {
gpr_timespec start_time;
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace) &&
wait_time != nullptr) {
@@ -154,14 +153,14 @@ void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) {
PushWaiter(&self);
do {
self.cv.Wait(&mu_);
- } while (count_.Load(MemoryOrder::RELAXED) == 0);
+ } while (count_.load(std::memory_order_relaxed) == 0);
RemoveWaiter(&self);
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace) &&
wait_time != nullptr) {
*wait_time = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), start_time);
}
}
- GPR_DEBUG_ASSERT(count_.Load(MemoryOrder::RELAXED) > 0);
+ GPR_DEBUG_ASSERT(count_.load(std::memory_order_relaxed) > 0);
return PopFront();
}
diff --git a/grpc/src/core/lib/iomgr/executor/mpmcqueue.h b/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
index 46e88b8c..f3bc346e 100644
--- a/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
+++ b/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
@@ -21,8 +21,9 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
+
#include "src/core/lib/debug/stats.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/sync.h"
namespace grpc_core {
@@ -70,18 +71,13 @@ class InfLenFIFOQueue : public MPMCQueueInterface {
// Returns number of elements in queue currently.
// There might be concurrently add/remove on queue, so count might change
// quickly.
- int count() const override { return count_.Load(MemoryOrder::RELAXED); }
+ int count() const override { return count_.load(std::memory_order_relaxed); }
struct Node {
- Node* next; // Linking
- Node* prev;
- void* content; // Points to actual element
+ Node* next = nullptr; // Linking
+ Node* prev = nullptr;
+ void* content = nullptr; // Points to actual element
gpr_timespec insert_time; // Time for stats
-
- Node() {
- next = prev = nullptr;
- content = nullptr;
- }
};
// For test purpose only. Returns number of nodes allocated in queue.
@@ -157,7 +153,7 @@ class InfLenFIFOQueue : public MPMCQueueInterface {
Node* queue_head_ = nullptr; // Head of the queue, remove position
Node* queue_tail_ = nullptr; // End of queue, insert position
- Atomic<int> count_{0}; // Number of elements in queue
+ std::atomic<int> count_{0}; // Number of elements in queue
int num_nodes_ = 0; // Number of nodes allocated
Stats stats_; // Stats info
diff --git a/grpc/src/core/lib/iomgr/executor/threadpool.cc b/grpc/src/core/lib/iomgr/executor/threadpool.cc
index 859c49a3..8bd954cc 100644
--- a/grpc/src/core/lib/iomgr/executor/threadpool.cc
+++ b/grpc/src/core/lib/iomgr/executor/threadpool.cc
@@ -41,8 +41,7 @@ void ThreadPoolWorker::Run() {
break;
}
// Runs closure
- auto* closure =
- static_cast<grpc_experimental_completion_queue_functor*>(elem);
+ auto* closure = static_cast<grpc_completion_queue_functor*>(elem);
closure->functor_run(closure, closure->internal_success);
}
}
@@ -73,7 +72,7 @@ size_t ThreadPool::DefaultStackSize() {
void ThreadPool::AssertHasNotBeenShutDown() {
// For debug checking purpose, using RELAXED order is sufficient.
- GPR_DEBUG_ASSERT(!shut_down_.Load(MemoryOrder::RELAXED));
+ GPR_DEBUG_ASSERT(!shut_down_.load(std::memory_order_relaxed));
}
ThreadPool::ThreadPool(int num_threads) : num_threads_(num_threads) {
@@ -103,7 +102,7 @@ ThreadPool::ThreadPool(int num_threads, const char* thd_name,
ThreadPool::~ThreadPool() {
// For debug checking purpose, using RELAXED order is sufficient.
- shut_down_.Store(true, MemoryOrder::RELAXED);
+ shut_down_.store(true, std::memory_order_relaxed);
for (int i = 0; i < num_threads_; ++i) {
queue_->Put(nullptr);
@@ -120,7 +119,7 @@ ThreadPool::~ThreadPool() {
delete queue_;
}
-void ThreadPool::Add(grpc_experimental_completion_queue_functor* closure) {
+void ThreadPool::Add(grpc_completion_queue_functor* closure) {
AssertHasNotBeenShutDown();
queue_->Put(static_cast<void*>(closure));
}
diff --git a/grpc/src/core/lib/iomgr/executor/threadpool.h b/grpc/src/core/lib/iomgr/executor/threadpool.h
index 66218b52..e0e5eb07 100644
--- a/grpc/src/core/lib/iomgr/executor/threadpool.h
+++ b/grpc/src/core/lib/iomgr/executor/threadpool.h
@@ -43,7 +43,7 @@ class ThreadPoolInterface {
// current thread to be blocked (in case of unable to schedule).
// Closure should contain a function pointer and arguments it will take, more
// details for closure struct at /grpc/include/grpc/impl/codegen/grpc_types.h
- virtual void Add(grpc_experimental_completion_queue_functor* closure) = 0;
+ virtual void Add(grpc_completion_queue_functor* closure) = 0;
// Returns the current number of pending closures
virtual int num_pending_closures() const = 0;
@@ -120,7 +120,7 @@ class ThreadPool : public ThreadPoolInterface {
// Adds given closure into pending queue immediately. Since closure queue has
// infinite length, this routine will not block.
- void Add(grpc_experimental_completion_queue_functor* closure) override;
+ void Add(grpc_completion_queue_functor* closure) override;
int num_pending_closures() const override;
int pool_capacity() const override;
@@ -134,7 +134,8 @@ class ThreadPool : public ThreadPoolInterface {
ThreadPoolWorker** threads_ = nullptr; // Array of worker threads
MPMCQueueInterface* queue_ = nullptr; // Closure queue
- Atomic<bool> shut_down_{false}; // Destructor has been called if set to true
+ std::atomic<bool> shut_down_{
+ false}; // Destructor has been called if set to true
void SharedThreadPoolConstructor();
// For ThreadPool, default stack size for mobile platform is 1952K. for other
diff --git a/grpc/src/core/lib/iomgr/fork_posix.cc b/grpc/src/core/lib/iomgr/fork_posix.cc
index 82654b5a..fe245240 100644
--- a/grpc/src/core/lib/iomgr/fork_posix.cc
+++ b/grpc/src/core/lib/iomgr/fork_posix.cc
@@ -70,9 +70,10 @@ void grpc_prefork() {
gpr_log(GPR_INFO,
"Fork support is only compatible with the epoll1 and poll polling "
"strategies");
+ return;
}
if (!grpc_core::Fork::BlockExecCtx()) {
- gpr_log(GPR_INFO,
+ gpr_log(GPR_ERROR,
"Other threads are currently calling into gRPC, skipping fork() "
"handlers");
return;
diff --git a/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc b/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
index f1ba20dc..8916eac9 100644
--- a/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+++ b/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
@@ -22,13 +22,13 @@
#if GRPC_IF_NAMETOINDEX == 1 && defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
-#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
-
#include <errno.h>
#include <net/if.h>
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
uint32_t grpc_if_nametoindex(char* name) {
uint32_t out = if_nametoindex(name);
if (out == 0) {
diff --git a/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc b/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
index 08644ccc..63062433 100644
--- a/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
+++ b/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
@@ -22,10 +22,10 @@
#if GRPC_IF_NAMETOINDEX == 0 || !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
-#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
uint32_t grpc_if_nametoindex(char* name) {
gpr_log(GPR_DEBUG,
"Not attempting to convert interface name %s to index for current "
diff --git a/grpc/src/core/lib/iomgr/internal_errqueue.cc b/grpc/src/core/lib/iomgr/internal_errqueue.cc
index b68c66b7..ac644b2f 100644
--- a/grpc/src/core/lib/iomgr/internal_errqueue.cc
+++ b/grpc/src/core/lib/iomgr/internal_errqueue.cc
@@ -18,10 +18,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/internal_errqueue.h"
#include <grpc/impl/codegen/log.h>
-#include "src/core/lib/iomgr/internal_errqueue.h"
+
+#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_TCP
diff --git a/grpc/src/core/lib/iomgr/iocp_windows.cc b/grpc/src/core/lib/iomgr/iocp_windows.cc
index 29a05ee3..b5c34907 100644
--- a/grpc/src/core/lib/iomgr/iocp_windows.cc
+++ b/grpc/src/core/lib/iomgr/iocp_windows.cc
@@ -23,6 +23,7 @@
#ifdef GRPC_WINSOCK_SOCKET
#include <winsock2.h>
+
#include <limits>
#include <grpc/support/alloc.h>
@@ -43,18 +44,18 @@ static gpr_atm g_custom_events = 0;
static HANDLE g_iocp;
-static DWORD deadline_to_millis_timeout(grpc_millis deadline) {
- if (deadline == GRPC_MILLIS_INF_FUTURE) {
+static DWORD deadline_to_millis_timeout(grpc_core::Timestamp deadline) {
+ if (deadline == grpc_core::Timestamp::InfFuture()) {
return INFINITE;
}
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
+ grpc_core::Timestamp now = grpc_core::ExecCtx::Get()->Now();
if (deadline < now) return 0;
- grpc_millis timeout = deadline - now;
- if (timeout > std::numeric_limits<DWORD>::max()) return INFINITE;
- return static_cast<DWORD>(deadline - now);
+ grpc_core::Duration timeout = deadline - now;
+ if (timeout.millis() > std::numeric_limits<DWORD>::max()) return INFINITE;
+ return static_cast<DWORD>(timeout.millis());
}
-grpc_iocp_work_status grpc_iocp_work(grpc_millis deadline) {
+grpc_iocp_work_status grpc_iocp_work(grpc_core::Timestamp deadline) {
BOOL success;
DWORD bytes = 0;
DWORD flags = 0;
@@ -123,7 +124,7 @@ void grpc_iocp_flush(void) {
grpc_iocp_work_status work_status;
do {
- work_status = grpc_iocp_work(GRPC_MILLIS_INF_PAST);
+ work_status = grpc_iocp_work(grpc_core::Timestamp::InfPast());
} while (work_status == GRPC_IOCP_WORK_KICK ||
grpc_core::ExecCtx::Get()->Flush());
}
@@ -131,7 +132,7 @@ void grpc_iocp_flush(void) {
void grpc_iocp_shutdown(void) {
grpc_core::ExecCtx exec_ctx;
while (gpr_atm_acq_load(&g_custom_events)) {
- grpc_iocp_work(GRPC_MILLIS_INF_FUTURE);
+ grpc_iocp_work(grpc_core::Timestamp::InfFuture());
grpc_core::ExecCtx::Get()->Flush();
}
diff --git a/grpc/src/core/lib/iomgr/iocp_windows.h b/grpc/src/core/lib/iomgr/iocp_windows.h
index 68d9de61..b8e3fb81 100644
--- a/grpc/src/core/lib/iomgr/iocp_windows.h
+++ b/grpc/src/core/lib/iomgr/iocp_windows.h
@@ -36,7 +36,7 @@ typedef enum {
GRPC_IOCP_WORK_KICK
} grpc_iocp_work_status;
-grpc_iocp_work_status grpc_iocp_work(grpc_millis deadline);
+grpc_iocp_work_status grpc_iocp_work(grpc_core::Timestamp deadline);
void grpc_iocp_init(void);
void grpc_iocp_kick(void);
void grpc_iocp_flush(void);
diff --git a/grpc/src/core/lib/iomgr/iomgr.cc b/grpc/src/core/lib/iomgr/iomgr.cc
index 1210bd70..8bfcebf9 100644
--- a/grpc/src/core/lib/iomgr/iomgr.cc
+++ b/grpc/src/core/lib/iomgr/iomgr.cc
@@ -53,7 +53,9 @@ static bool g_grpc_abort_on_leaks;
void grpc_iomgr_init() {
grpc_core::ExecCtx exec_ctx;
- grpc_determine_iomgr_platform();
+ if (!grpc_have_determined_iomgr_platform()) {
+ grpc_set_default_iomgr_platform();
+ }
g_shutdown = 0;
gpr_mu_init(&g_mu);
gpr_cv_init(&g_rcv);
@@ -94,7 +96,6 @@ void grpc_iomgr_shutdown() {
{
grpc_timer_manager_shutdown();
grpc_iomgr_platform_flush();
- grpc_core::Executor::ShutdownAll();
gpr_mu_lock(&g_mu);
g_shutdown = 1;
@@ -149,6 +150,7 @@ void grpc_iomgr_shutdown() {
gpr_mu_unlock(&g_mu);
grpc_timer_list_shutdown();
grpc_core::ExecCtx::Get()->Flush();
+ grpc_core::Executor::ShutdownAll();
}
/* ensure all threads have left g_mu */
diff --git a/grpc/src/core/lib/iomgr/iomgr.h b/grpc/src/core/lib/iomgr/iomgr.h
index 9af0557e..190942bb 100644
--- a/grpc/src/core/lib/iomgr/iomgr.h
+++ b/grpc/src/core/lib/iomgr/iomgr.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/port.h"
-#include <stdlib.h>
-
/** Initializes the iomgr. */
void grpc_iomgr_init();
diff --git a/grpc/src/core/lib/iomgr/iomgr_custom.cc b/grpc/src/core/lib/iomgr/iomgr_custom.cc
deleted file mode 100644
index 9a9f06a5..00000000
--- a/grpc/src/core/lib/iomgr/iomgr_custom.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#include <grpc/support/thd_id.h>
-
-#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/pollset_custom.h"
-#include "src/core/lib/iomgr/pollset_set_custom.h"
-#include "src/core/lib/iomgr/resolve_address_custom.h"
-
-gpr_thd_id g_init_thread;
-
-static void iomgr_platform_init(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Executor::SetThreadingAll(false);
- g_init_thread = gpr_thd_currentid();
- grpc_pollset_global_init();
-}
-static void iomgr_platform_flush(void) {}
-static void iomgr_platform_shutdown(void) { grpc_pollset_global_shutdown(); }
-static void iomgr_platform_shutdown_background_closure(void) {}
-static bool iomgr_platform_is_any_background_poller_thread(void) {
- return false;
-}
-static bool iomgr_platform_add_closure_to_background_poller(
- grpc_closure* /*closure*/, grpc_error_handle /*error*/) {
- return false;
-}
-
-bool g_custom_iomgr_enabled = false;
-
-static grpc_iomgr_platform_vtable vtable = {
- iomgr_platform_init,
- iomgr_platform_flush,
- iomgr_platform_shutdown,
- iomgr_platform_shutdown_background_closure,
- iomgr_platform_is_any_background_poller_thread,
- iomgr_platform_add_closure_to_background_poller};
-
-void grpc_custom_iomgr_init(grpc_socket_vtable* socket,
- grpc_custom_resolver_vtable* resolver,
- grpc_custom_timer_vtable* timer,
- grpc_custom_poller_vtable* poller) {
- g_custom_iomgr_enabled = true;
- grpc_custom_endpoint_init(socket);
- grpc_custom_timer_init(timer);
- grpc_custom_pollset_init(poller);
- grpc_custom_pollset_set_init();
- grpc_custom_resolver_init(resolver);
- grpc_set_iomgr_platform_vtable(&vtable);
-}
-
-#ifdef GRPC_CUSTOM_SOCKET
-grpc_iomgr_platform_vtable* grpc_default_iomgr_platform_vtable() {
- return &vtable;
-}
-#endif
diff --git a/grpc/src/core/lib/iomgr/iomgr_custom.h b/grpc/src/core/lib/iomgr/iomgr_custom.h
deleted file mode 100644
index e6a88843..00000000
--- a/grpc/src/core/lib/iomgr/iomgr_custom.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_IOMGR_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_IOMGR_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/pollset_custom.h"
-#include "src/core/lib/iomgr/resolve_address_custom.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-#include <grpc/support/thd_id.h>
-
-/* The thread ID of the thread on which grpc was initialized. Used to verify
- * that all calls into the custom iomgr are made on that same thread */
-extern gpr_thd_id g_init_thread;
-
-#ifdef GRPC_CUSTOM_IOMGR_THREAD_CHECK
-#define GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD() \
- GPR_ASSERT(gpr_thd_currentid() == g_init_thread)
-#else
-#define GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD()
-#endif /* GRPC_CUSTOM_IOMGR_THREAD_CHECK */
-
-extern bool g_custom_iomgr_enabled;
-
-void grpc_custom_iomgr_init(grpc_socket_vtable* socket,
- grpc_custom_resolver_vtable* resolver,
- grpc_custom_timer_vtable* timer,
- grpc_custom_poller_vtable* poller);
-
-#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/iomgr_internal.cc b/grpc/src/core/lib/iomgr/iomgr_internal.cc
index e5ce8ab3..87ec71ad 100644
--- a/grpc/src/core/lib/iomgr/iomgr_internal.cc
+++ b/grpc/src/core/lib/iomgr/iomgr_internal.cc
@@ -18,22 +18,18 @@
#include <grpc/support/port_platform.h>
-#include <stddef.h>
-
#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_manager.h"
+
+#include <stddef.h>
static grpc_iomgr_platform_vtable* iomgr_platform_vtable = nullptr;
-void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
- iomgr_platform_vtable = vtable;
+bool grpc_have_determined_iomgr_platform() {
+ return iomgr_platform_vtable != nullptr;
}
-void grpc_determine_iomgr_platform() {
- if (iomgr_platform_vtable == nullptr) {
- grpc_set_default_iomgr_platform();
- }
+void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
+ iomgr_platform_vtable = vtable;
}
void grpc_iomgr_platform_init() { iomgr_platform_vtable->init(); }
diff --git a/grpc/src/core/lib/iomgr/iomgr_internal.h b/grpc/src/core/lib/iomgr/iomgr_internal.h
index 01cd2483..b9e7eacb 100644
--- a/grpc/src/core/lib/iomgr/iomgr_internal.h
+++ b/grpc/src/core/lib/iomgr/iomgr_internal.h
@@ -23,7 +23,8 @@
#include <stdbool.h>
-#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
typedef struct grpc_iomgr_object {
char* name;
@@ -44,7 +45,7 @@ typedef struct grpc_iomgr_platform_vtable {
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
void grpc_iomgr_unregister_object(grpc_iomgr_object* obj);
-void grpc_determine_iomgr_platform();
+bool grpc_have_determined_iomgr_platform();
void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable);
diff --git a/grpc/src/core/lib/iomgr/iomgr_posix.cc b/grpc/src/core/lib/iomgr/iomgr_posix.cc
index 0407e305..437d0327 100644
--- a/grpc/src/core/lib/iomgr/iomgr_posix.cc
+++ b/grpc/src/core/lib/iomgr/iomgr_posix.cc
@@ -26,6 +26,7 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_posix.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -36,16 +37,17 @@ extern grpc_tcp_client_vtable grpc_posix_tcp_client_vtable;
extern grpc_timer_vtable grpc_generic_timer_vtable;
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 iomgr_platform_init(void) {
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
+ grpc_tcp_posix_init();
}
static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) {
+ grpc_tcp_posix_shutdown();
grpc_event_engine_shutdown();
grpc_wakeup_fd_global_destroy();
}
@@ -77,7 +79,7 @@ void grpc_set_default_iomgr_platform() {
grpc_set_timer_impl(&grpc_generic_timer_vtable);
grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
- grpc_set_resolver_impl(&grpc_posix_resolver_vtable);
+ grpc_core::SetDNSResolver(grpc_core::NativeDNSResolver::GetOrCreate());
grpc_set_iomgr_platform_vtable(&vtable);
}
diff --git a/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc b/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
index 78b29851..74cd19cc 100644
--- a/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
+++ b/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
@@ -41,6 +41,7 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_posix.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -55,7 +56,6 @@ extern grpc_tcp_client_vtable grpc_cfstream_client_vtable;
extern grpc_timer_vtable grpc_generic_timer_vtable;
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(); }
@@ -84,7 +84,43 @@ static grpc_iomgr_platform_vtable apple_vtable = {
apple_iomgr_platform_is_any_background_poller_thread,
apple_iomgr_platform_add_closure_to_background_poller};
+namespace {
+struct CFStreamEnv {
+ bool enable_cfstream;
+ bool enable_cfstream_run_loop;
+};
+
+// Parses environment variables for CFStream specific settings
+CFStreamEnv ParseEnvForCFStream() {
+ CFStreamEnv env;
+ char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
+ env.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.
+ env.enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
+ enable_cfstream_run_loop_str[0] == '1';
+ return env;
+}
+
+void MaybeInitializeTcpPosix(void) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
+ grpc_tcp_posix_init();
+ }
+}
+
+void MaybeShutdownTcpPosix(void) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
+ grpc_tcp_posix_shutdown();
+ }
+}
+} // namespace
+
static void iomgr_platform_init(void) {
+ MaybeInitializeTcpPosix();
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
}
@@ -94,6 +130,7 @@ static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) {
grpc_event_engine_shutdown();
grpc_wakeup_fd_global_destroy();
+ MaybeShutdownTcpPosix();
}
static void iomgr_platform_shutdown_background_closure(void) {
@@ -118,22 +155,15 @@ 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) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.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) {
+ } else if (env.enable_cfstream && !env.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);
@@ -148,7 +178,7 @@ void grpc_set_default_iomgr_platform() {
grpc_set_iomgr_platform_vtable(&apple_vtable);
}
grpc_set_timer_impl(&grpc_generic_timer_vtable);
- grpc_set_resolver_impl(&grpc_posix_resolver_vtable);
+ grpc_core::SetDNSResolver(grpc_core::NativeDNSResolver::GetOrCreate());
}
bool grpc_iomgr_run_in_background() {
diff --git a/grpc/src/core/lib/iomgr/iomgr_uv.cc b/grpc/src/core/lib/iomgr/iomgr_uv.cc
deleted file mode 100644
index a6172396..00000000
--- a/grpc/src/core/lib/iomgr/iomgr_uv.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#if defined(GRPC_CUSTOM_SOCKET) && defined(GRPC_UV)
-
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/pollset_custom.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-extern grpc_socket_vtable grpc_uv_socket_vtable;
-extern grpc_custom_resolver_vtable uv_resolver_vtable;
-extern grpc_custom_timer_vtable uv_timer_vtable;
-extern grpc_custom_poller_vtable uv_pollset_vtable;
-
-void grpc_set_default_iomgr_platform() {
- grpc_custom_iomgr_init(&grpc_uv_socket_vtable, &uv_resolver_vtable,
- &uv_timer_vtable, &uv_pollset_vtable);
-}
-
-bool grpc_iomgr_run_in_background() { return false; }
-
-#endif
diff --git a/grpc/src/core/lib/iomgr/iomgr_windows.cc b/grpc/src/core/lib/iomgr/iomgr_windows.cc
index df1207ae..87509d8a 100644
--- a/grpc/src/core/lib/iomgr/iomgr_windows.cc
+++ b/grpc/src/core/lib/iomgr/iomgr_windows.cc
@@ -22,14 +22,14 @@
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr_windows.h"
-
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset_windows.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_windows.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -40,7 +40,6 @@ extern grpc_tcp_client_vtable grpc_windows_tcp_client_vtable;
extern grpc_timer_vtable grpc_generic_timer_vtable;
extern grpc_pollset_vtable grpc_windows_pollset_vtable;
extern grpc_pollset_set_vtable grpc_windows_pollset_set_vtable;
-extern grpc_address_resolver_vtable grpc_windows_resolver_vtable;
/* Windows' io manager is going to be fully designed using IO completion
ports. All of what we're doing here is basically make sure that
@@ -97,7 +96,7 @@ void grpc_set_default_iomgr_platform() {
grpc_set_timer_impl(&grpc_generic_timer_vtable);
grpc_set_pollset_vtable(&grpc_windows_pollset_vtable);
grpc_set_pollset_set_vtable(&grpc_windows_pollset_set_vtable);
- grpc_set_resolver_impl(&grpc_windows_resolver_vtable);
+ grpc_core::SetDNSResolver(grpc_core::NativeDNSResolver::GetOrCreate());
grpc_set_iomgr_platform_vtable(&vtable);
}
diff --git a/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc b/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
deleted file mode 100644
index abc901ef..00000000
--- a/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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"
-
-#include "src/core/lib/iomgr/is_epollexclusive_available.h"
-
-#ifdef GRPC_LINUX_EPOLL_CREATE1
-
-#include <grpc/support/log.h>
-
-#include <errno.h>
-#include <sys/epoll.h>
-#include <sys/eventfd.h>
-#include <unistd.h>
-
-#include "src/core/lib/iomgr/sys_epoll_wrapper.h"
-
-/* This polling engine is only relevant on linux kernels supporting epoll() */
-bool grpc_is_epollexclusive_available(void) {
- static bool logged_why_not = false;
-
- int fd = epoll_create1(EPOLL_CLOEXEC);
- if (fd < 0) {
- if (!logged_why_not) {
- gpr_log(GPR_DEBUG,
- "epoll_create1 failed with error: %d. Not using epollex polling "
- "engine.",
- fd);
- logged_why_not = true;
- }
- return false;
- }
- int evfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
- if (evfd < 0) {
- if (!logged_why_not) {
- gpr_log(GPR_DEBUG,
- "eventfd failed with error: %d. Not using epollex polling "
- "engine.",
- fd);
- logged_why_not = true;
- }
- close(fd);
- return false;
- }
- struct epoll_event ev;
- /* choose events that should cause an error on
- EPOLLEXCLUSIVE enabled kernels - specifically the combination of
- EPOLLONESHOT and EPOLLEXCLUSIVE */
- ev.events =
- static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE | EPOLLONESHOT);
- ev.data.ptr = nullptr;
- if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) {
- if (errno != EINVAL) {
- if (!logged_why_not) {
- gpr_log(
- GPR_ERROR,
- "epoll_ctl with EPOLLEXCLUSIVE | EPOLLONESHOT failed with error: "
- "%d. Not using epollex polling engine.",
- errno);
- logged_why_not = true;
- }
- close(fd);
- close(evfd);
- return false;
- }
- } else {
- if (!logged_why_not) {
- gpr_log(GPR_DEBUG,
- "epoll_ctl with EPOLLEXCLUSIVE | EPOLLONESHOT succeeded. This is "
- "evidence of no EPOLLEXCLUSIVE support. Not using "
- "epollex polling engine.");
- 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;
-}
-
-#else
-
-bool grpc_is_epollexclusive_available(void) { return false; }
-
-#endif
diff --git a/grpc/src/core/lib/iomgr/is_epollexclusive_available.h b/grpc/src/core/lib/iomgr/is_epollexclusive_available.h
deleted file mode 100644
index 8a44113c..00000000
--- a/grpc/src/core/lib/iomgr/is_epollexclusive_available.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * 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_IS_EPOLLEXCLUSIVE_AVAILABLE_H
-#define GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-bool grpc_is_epollexclusive_available(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */
diff --git a/grpc/src/core/lib/iomgr/load_file.cc b/grpc/src/core/lib/iomgr/load_file.cc
index a1878229..90686701 100644
--- a/grpc/src/core/lib/iomgr/load_file.cc
+++ b/grpc/src/core/lib/iomgr/load_file.cc
@@ -71,8 +71,8 @@ end:
grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Failed to load file", &error, 1),
GRPC_ERROR_STR_FILENAME,
- grpc_slice_from_copied_string(
- filename)); // TODO(ncteisen), always static?
+
+ filename);
GRPC_ERROR_UNREF(error);
error = error_out;
}
diff --git a/grpc/src/core/lib/iomgr/lockfree_event.cc b/grpc/src/core/lib/iomgr/lockfree_event.cc
index fa21406c..d41e5029 100644
--- a/grpc/src/core/lib/iomgr/lockfree_event.cc
+++ b/grpc/src/core/lib/iomgr/lockfree_event.cc
@@ -77,7 +77,11 @@ void LockfreeEvent::DestroyEvent() {
do {
curr = gpr_atm_no_barrier_load(&state_);
if (curr & kShutdownBit) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(curr & ~kShutdownBit);
+#else
GRPC_ERROR_UNREF((grpc_error_handle)(curr & ~kShutdownBit));
+#endif
} else {
GPR_ASSERT(curr == kClosureNotReady || curr == kClosureReady);
}
@@ -139,8 +143,13 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
contains a pointer to the shutdown-error). If the fd is shutdown,
schedule the closure with the shutdown error */
if ((curr & kShutdownBit) > 0) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle shutdown_err =
+ internal::StatusGetFromHeapPtr(curr & ~kShutdownBit);
+#else
grpc_error_handle shutdown_err =
reinterpret_cast<grpc_error_handle>(curr & ~kShutdownBit);
+#endif
ExecCtx::Run(DEBUG_LOCATION, closure,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"FD Shutdown", &shutdown_err, 1));
@@ -160,7 +169,12 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
}
bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ intptr_t status_ptr = internal::StatusAllocHeapPtr(shutdown_error);
+ gpr_atm new_state = status_ptr | kShutdownBit;
+#else
gpr_atm new_state = reinterpret_cast<gpr_atm>(shutdown_error) | kShutdownBit;
+#endif
while (true) {
gpr_atm curr = gpr_atm_no_barrier_load(&state_);
@@ -184,7 +198,11 @@ bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) {
/* If fd is already shutdown, we are done */
if ((curr & kShutdownBit) > 0) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(status_ptr);
+#else
GRPC_ERROR_UNREF(shutdown_error);
+#endif
return false;
}
diff --git a/grpc/src/core/lib/iomgr/polling_entity.cc b/grpc/src/core/lib/iomgr/polling_entity.cc
index dea07cae..0c1788a6 100644
--- a/grpc/src/core/lib/iomgr/polling_entity.cc
+++ b/grpc/src/core/lib/iomgr/polling_entity.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/iomgr/polling_entity.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/polling_entity.h"
-
grpc_polling_entity grpc_polling_entity_create_from_pollset_set(
grpc_pollset_set* pollset_set) {
grpc_polling_entity pollent;
diff --git a/grpc/src/core/lib/iomgr/polling_entity.h b/grpc/src/core/lib/iomgr/polling_entity.h
index 6f4c5bdd..e177176d 100644
--- a/grpc/src/core/lib/iomgr/polling_entity.h
+++ b/grpc/src/core/lib/iomgr/polling_entity.h
@@ -23,6 +23,7 @@
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/promise/context.h"
typedef enum grpc_pollset_tag {
GRPC_POLLS_NONE,
@@ -65,4 +66,9 @@ void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent,
void grpc_polling_entity_del_from_pollset_set(grpc_polling_entity* pollent,
grpc_pollset_set* pss_dst);
+namespace grpc_core {
+template <>
+struct ContextType<grpc_polling_entity> {};
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */
diff --git a/grpc/src/core/lib/iomgr/pollset.cc b/grpc/src/core/lib/iomgr/pollset.cc
index ba2a58d8..ae9ab6cf 100644
--- a/grpc/src/core/lib/iomgr/pollset.cc
+++ b/grpc/src/core/lib/iomgr/pollset.cc
@@ -44,7 +44,7 @@ void grpc_pollset_destroy(grpc_pollset* pollset) {
grpc_error_handle grpc_pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
return grpc_pollset_impl->work(pollset, worker, deadline);
}
diff --git a/grpc/src/core/lib/iomgr/pollset.h b/grpc/src/core/lib/iomgr/pollset.h
index 7c87a827..b1f1138f 100644
--- a/grpc/src/core/lib/iomgr/pollset.h
+++ b/grpc/src/core/lib/iomgr/pollset.h
@@ -45,7 +45,7 @@ typedef struct grpc_pollset_vtable {
void (*shutdown)(grpc_pollset* pollset, grpc_closure* closure);
void (*destroy)(grpc_pollset* pollset);
grpc_error_handle (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
- grpc_millis deadline);
+ grpc_core::Timestamp deadline);
grpc_error_handle (*kick)(grpc_pollset* pollset,
grpc_pollset_worker* specific_worker);
size_t (*pollset_size)(void);
@@ -86,9 +86,9 @@ void grpc_pollset_destroy(grpc_pollset* pollset);
May call grpc_closure_list_run on grpc_closure_list, without holding the
pollset
lock */
-grpc_error_handle grpc_pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_pollset_work(
+ grpc_pollset* pollset, grpc_pollset_worker** worker,
+ grpc_core::Timestamp deadline) GRPC_MUST_USE_RESULT;
/* Break one polling thread out of polling work for this pollset.
If specific_worker is non-NULL, then kick that worker. */
diff --git a/grpc/src/core/lib/iomgr/pollset_custom.cc b/grpc/src/core/lib/iomgr/pollset_custom.cc
deleted file mode 100644
index 62c4b397..00000000
--- a/grpc/src/core/lib/iomgr/pollset_custom.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#include <stddef.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
-#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/iomgr/pollset_custom.h"
-#include "src/core/lib/iomgr/timer.h"
-
-#include "src/core/lib/debug/trace.h"
-
-static grpc_custom_poller_vtable* poller_vtable;
-
-struct grpc_pollset {
- gpr_mu mu;
-};
-
-static size_t pollset_size() { return sizeof(grpc_pollset); }
-
-static void pollset_global_init() { poller_vtable->init(); }
-
-static void pollset_global_shutdown() { poller_vtable->shutdown(); }
-
-static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- gpr_mu_init(&pollset->mu);
- *mu = &pollset->mu;
-}
-
-static void pollset_shutdown(grpc_pollset* /*pollset*/, grpc_closure* closure) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
-}
-
-static void pollset_destroy(grpc_pollset* pollset) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- gpr_mu_destroy(&pollset->mu);
-}
-
-static grpc_error_handle pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** /*worker_hdl*/,
- grpc_millis deadline) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- gpr_mu_unlock(&pollset->mu);
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
- grpc_millis timeout = 0;
- if (deadline > now) {
- timeout = deadline - now;
- }
- // We yield here because the poll() call might yield
- // control back to the application
- grpc_core::ExecCtx* curr = grpc_core::ExecCtx::Get();
- grpc_core::ExecCtx::Set(nullptr);
- poller_vtable->poll(static_cast<size_t>(timeout));
- grpc_core::ExecCtx::Set(curr);
- grpc_core::ExecCtx::Get()->InvalidateNow();
- if (grpc_core::ExecCtx::Get()->HasWork()) {
- grpc_core::ExecCtx::Get()->Flush();
- }
- gpr_mu_lock(&pollset->mu);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle pollset_kick(
- grpc_pollset* /*pollset*/, grpc_pollset_worker* /*specific_worker*/) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- poller_vtable->kick();
- return GRPC_ERROR_NONE;
-}
-
-grpc_pollset_vtable custom_pollset_vtable = {
- pollset_global_init, pollset_global_shutdown,
- pollset_init, pollset_shutdown,
- pollset_destroy, pollset_work,
- pollset_kick, pollset_size};
-
-void grpc_custom_pollset_init(grpc_custom_poller_vtable* vtable) {
- poller_vtable = vtable;
- grpc_set_pollset_vtable(&custom_pollset_vtable);
-}
diff --git a/grpc/src/core/lib/iomgr/pollset_custom.h b/grpc/src/core/lib/iomgr/pollset_custom.h
deleted file mode 100644
index 9e2027f7..00000000
--- a/grpc/src/core/lib/iomgr/pollset_custom.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * 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_IOMGR_POLLSET_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_POLLSET_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stddef.h>
-
-typedef struct grpc_custom_poller_vtable {
- void (*init)();
- void (*poll)(size_t timeout_ms);
- void (*kick)();
- void (*shutdown)();
-} grpc_custom_poller_vtable;
-
-void grpc_custom_pollset_init(grpc_custom_poller_vtable* vtable);
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/pollset_set_custom.cc b/grpc/src/core/lib/iomgr/pollset_set_custom.cc
deleted file mode 100644
index 0cc90891..00000000
--- a/grpc/src/core/lib/iomgr/pollset_set_custom.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#include "src/core/lib/iomgr/pollset_set.h"
-
-static grpc_pollset_set* pollset_set_create(void) {
- return reinterpret_cast<grpc_pollset_set*>(static_cast<intptr_t>(0xdeafbeef));
-}
-
-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_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_del_pollset_set(grpc_pollset_set* /*bag*/,
- grpc_pollset_set* /*item*/) {}
-
-static grpc_pollset_set_vtable 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};
-
-void grpc_custom_pollset_set_init() { grpc_set_pollset_set_vtable(&vtable); }
diff --git a/grpc/src/core/lib/iomgr/pollset_set_custom.h b/grpc/src/core/lib/iomgr/pollset_set_custom.h
deleted file mode 100644
index 80e19a1f..00000000
--- a/grpc/src/core/lib/iomgr/pollset_set_custom.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * 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_IOMGR_POLLSET_SET_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_POLLSET_SET_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-void grpc_custom_pollset_set_init();
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/pollset_set_windows.cc b/grpc/src/core/lib/iomgr/pollset_set_windows.cc
index bb9e7f5d..1b105a24 100644
--- a/grpc/src/core/lib/iomgr/pollset_set_windows.cc
+++ b/grpc/src/core/lib/iomgr/pollset_set_windows.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <stdint.h>
+
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
diff --git a/grpc/src/core/lib/iomgr/pollset_uv.cc b/grpc/src/core/lib/iomgr/pollset_uv.cc
deleted file mode 100644
index bade6eae..00000000
--- a/grpc/src/core/lib/iomgr/pollset_uv.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#ifdef GRPC_UV
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/pollset_custom.h"
-
-#include <uv.h>
-
-/* Indicates that grpc_pollset_work should run an iteration of the UV loop
- before running callbacks. This defaults to 1, and should be disabled if
- grpc_pollset_work will be called within the callstack of uv_run */
-int grpc_pollset_work_run_loop = 1;
-
-static bool g_kicked = false;
-
-typedef struct uv_poller_handle {
- uv_timer_t poll_timer;
- uv_timer_t kick_timer;
- int refs;
-} uv_poller_handle;
-
-static uv_poller_handle* g_handle;
-
-static void init() {
- g_handle = (uv_poller_handle*)gpr_malloc(sizeof(uv_poller_handle));
- g_handle->refs = 2;
- uv_timer_init(uv_default_loop(), &g_handle->poll_timer);
- uv_timer_init(uv_default_loop(), &g_handle->kick_timer);
-}
-
-static void empty_timer_cb(uv_timer_t* handle) {}
-
-static void kick_timer_cb(uv_timer_t* handle) { g_kicked = false; }
-
-static void run_loop(size_t timeout) {
- if (grpc_pollset_work_run_loop) {
- if (timeout == 0) {
- uv_run(uv_default_loop(), UV_RUN_NOWAIT);
- } else {
- uv_timer_start(&g_handle->poll_timer, empty_timer_cb, timeout, 0);
- uv_run(uv_default_loop(), UV_RUN_ONCE);
- uv_timer_stop(&g_handle->poll_timer);
- }
- }
-}
-
-static void kick() {
- if (!g_kicked) {
- g_kicked = true;
- uv_timer_start(&g_handle->kick_timer, kick_timer_cb, 0, 0);
- }
-}
-
-static void close_timer_cb(uv_handle_t* handle) {
- g_handle->refs--;
- if (g_handle->refs == 0) {
- gpr_free(g_handle);
- }
-}
-
-static void shutdown() {
- uv_close((uv_handle_t*)&g_handle->poll_timer, close_timer_cb);
- uv_close((uv_handle_t*)&g_handle->kick_timer, close_timer_cb);
- if (grpc_pollset_work_run_loop) {
- GPR_ASSERT(uv_run(uv_default_loop(), UV_RUN_DEFAULT) == 0);
- }
-}
-
-grpc_custom_poller_vtable uv_pollset_vtable = {init, run_loop, kick, shutdown};
-
-#endif /* GRPC_UV */
diff --git a/grpc/src/core/lib/iomgr/pollset_uv.h b/grpc/src/core/lib/iomgr/pollset_uv.h
deleted file mode 100644
index de82bcc1..00000000
--- a/grpc/src/core/lib/iomgr/pollset_uv.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * 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_LIB_IOMGR_POLLSET_UV_H
-#define GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
-
-extern int grpc_pollset_work_run_loop;
-
-typedef struct grpc_custom_poller_vtable {
- void (*init)(void);
- void (*run_loop)(int blocking);
-} grpc_custom_poller_vtable;
-
-void grpc_custom_pollset_global_init(grpc_custom_poller_vtable* vtable);
-void grpc_custom_pollset_global_shutdown(void);
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */
diff --git a/grpc/src/core/lib/iomgr/pollset_windows.cc b/grpc/src/core/lib/iomgr/pollset_windows.cc
index f8758a3f..ccc71c36 100644
--- a/grpc/src/core/lib/iomgr/pollset_windows.cc
+++ b/grpc/src/core/lib/iomgr/pollset_windows.cc
@@ -108,7 +108,7 @@ static void pollset_destroy(grpc_pollset* pollset) {}
static grpc_error_handle pollset_work(grpc_pollset* pollset,
grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
@@ -159,7 +159,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
added_worker = 1;
while (!worker.kicked) {
if (gpr_cv_wait(&worker.cv, &grpc_polling_mu,
- grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
+ deadline.as_timespec(GPR_CLOCK_REALTIME))) {
grpc_core::ExecCtx::Get()->InvalidateNow();
break;
}
diff --git a/grpc/src/core/lib/iomgr/port.h b/grpc/src/core/lib/iomgr/port.h
index 8d3cd98b..8762791e 100644
--- a/grpc/src/core/lib/iomgr/port.h
+++ b/grpc/src/core/lib/iomgr/port.h
@@ -15,23 +15,17 @@
* limitations under the License.
*
*/
-
-#include <grpc/support/port_platform.h>
-
#ifndef GRPC_CORE_LIB_IOMGR_PORT_H
#define GRPC_CORE_LIB_IOMGR_PORT_H
-#ifdef GRPC_UV
-#ifndef GRPC_CUSTOM_SOCKET
-#define GRPC_CUSTOM_SOCKET
-#endif
-#endif
+#include <grpc/support/port_platform.h>
+
/* This needs to be separate from the other conditions because it needs to
* apply to custom sockets too */
#ifdef GPR_WINDOWS
#define GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY 1
#endif
-#if defined(GRPC_CUSTOM_SOCKET)
+#if defined(GRPC_USE_EVENT_ENGINE)
// Do Nothing
#elif defined(GPR_WINDOWS)
#define GRPC_WINSOCK_SOCKET 1
@@ -77,9 +71,9 @@
#if __GLIBC_PREREQ(2, 10)
#define GRPC_LINUX_SOCKETUTILS 1
#endif
-#if !(__GLIBC_PREREQ(2, 17))
+#if !(__GLIBC_PREREQ(2, 18))
/*
- * TCP_USER_TIMEOUT wasn't imported to glibc until 2.17. Use Linux system
+ * TCP_USER_TIMEOUT wasn't imported to glibc until 2.18. Use Linux system
* header instead.
*/
#define GRPC_LINUX_TCP_H 1
@@ -113,7 +107,6 @@
#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
#define GRPC_POSIX_SOCKET_EV 1
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
-#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
#define GRPC_POSIX_SOCKET_EV_POLL 1
#define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1
#define GRPC_POSIX_SOCKET_RESOLVE_ADDRESS 1
@@ -188,17 +181,16 @@
#error "Platform not recognized"
#endif
-#if defined(GRPC_POSIX_SOCKET) + defined(GRPC_WINSOCK_SOCKET) + \
- defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) != \
+#if defined(GRPC_POSIX_SOCKET) + defined(GRPC_WINSOCK_SOCKET) + \
+ defined(GRPC_CFSTREAM) + defined(GRPC_USE_EVENT_ENGINE) != \
1
#error \
- "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET, GRPC_CFSTREAM"
+ "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CFSTREAM, GRPC_USE_EVENT_ENGINE"
#endif
#ifdef GRPC_POSIX_SOCKET
#define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1
#define GRPC_POSIX_SOCKET_EV 1
-#define GRPC_POSIX_SOCKET_EV_EPOLLEX 1
#define GRPC_POSIX_SOCKET_EV_POLL 1
#define GRPC_POSIX_SOCKET_EV_EPOLL1 1
#define GRPC_POSIX_SOCKET_IF_NAMETOINDEX 1
diff --git a/grpc/src/core/lib/iomgr/python_util.h b/grpc/src/core/lib/iomgr/python_util.h
index 10c335b1..5b7eeccb 100644
--- a/grpc/src/core/lib/iomgr/python_util.h
+++ b/grpc/src/core/lib/iomgr/python_util.h
@@ -23,6 +23,7 @@
#include <grpc/impl/codegen/slice.h>
#include <grpc/status.h>
+
#include "src/core/lib/iomgr/error.h"
// These are only used by the gRPC Python extensions.
@@ -43,4 +44,4 @@ inline int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i) {
return GRPC_SLICE_LENGTH(buffer->slices[i]);
}
-#endif
+#endif // GRPC_CORE_LIB_IOMGR_PYTHON_UTIL_H
diff --git a/grpc/src/core/lib/iomgr/resolve_address.cc b/grpc/src/core/lib/iomgr/resolve_address.cc
index 83c6aacf..3dfe1bf5 100644
--- a/grpc/src/core/lib/iomgr/resolve_address.cc
+++ b/grpc/src/core/lib/iomgr/resolve_address.cc
@@ -15,36 +15,22 @@
* limitations under the License.
*
*/
-
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
#include "src/core/lib/iomgr/resolve_address.h"
-grpc_address_resolver_vtable* grpc_resolve_address_impl;
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/support/alloc.h>
-void grpc_set_resolver_impl(grpc_address_resolver_vtable* vtable) {
- grpc_resolve_address_impl = vtable;
-}
+namespace grpc_core {
+const char* kDefaultSecurePort = "https";
-void grpc_resolve_address(const char* addr, const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_resolved_addresses** addresses) {
- grpc_resolve_address_impl->resolve_address(
- addr, default_port, interested_parties, on_done, addresses);
+namespace {
+DNSResolver* g_dns_resolver;
}
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addresses) {
- if (addresses != nullptr) {
- gpr_free(addresses->addrs);
- }
- gpr_free(addresses);
-}
+void SetDNSResolver(DNSResolver* resolver) { g_dns_resolver = resolver; }
-grpc_error_handle grpc_blocking_resolve_address(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses) {
- return grpc_resolve_address_impl->blocking_resolve_address(name, default_port,
- addresses);
-}
+DNSResolver* GetDNSResolver() { return g_dns_resolver; }
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/iomgr/resolve_address.h b/grpc/src/core/lib/iomgr/resolve_address.h
index 112d0ac5..35774425 100644
--- a/grpc/src/core/lib/iomgr/resolve_address.h
+++ b/grpc/src/core/lib/iomgr/resolve_address.h
@@ -23,59 +23,64 @@
#include <stddef.h>
+#include "absl/status/statusor.h"
+
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/resolved_address.h"
-#ifdef GRPC_UV
-#include <uv.h>
-#endif
+#define GRPC_MAX_SOCKADDR_SIZE 128
-#ifdef GRPC_WINSOCK_SOCKET
-#include <ws2tcpip.h>
-#endif
+namespace grpc_core {
+extern const char* kDefaultSecurePort;
+constexpr int kDefaultSecurePortInt = 443;
-#if defined(GRPC_POSIX_SOCKET) || defined(GRPC_CFSTREAM)
-#include <sys/socket.h>
-#endif
+// A singleton class used for async and blocking DNS resolution
+class DNSResolver {
+ public:
+ // Tracks a single asynchronous DNS resolution attempt. The DNS
+ // resolution should be arranged to be cancelled as soon as possible
+ // when Orphan is called.
+ class Request : public InternallyRefCounted<Request> {
+ public:
+ // Begins async DNS resolution
+ virtual void Start() = 0;
+ };
-#include "src/core/lib/iomgr/pollset_set.h"
+ virtual ~DNSResolver() {}
-#define GRPC_MAX_SOCKADDR_SIZE 128
+ // Asynchronously resolve name. Use \a default_port if a port isn't designated
+ // in \a name, otherwise use the port in \a name. On completion, \a on_done is
+ // invoked with the result.
+ //
+ // Note for implementations: calls may acquire locks in \a on_done which
+ // were previously held while calling Request::Start(). Therefore,
+ // implementations must not invoke \a on_done inline from the call to
+ // Request::Start(). The DNSCallbackExecCtxScheduler utility may help address
+ // this.
+ virtual OrphanablePtr<Request> ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) GRPC_MUST_USE_RESULT = 0;
-struct grpc_resolved_address {
- char addr[GRPC_MAX_SOCKADDR_SIZE];
- socklen_t len;
-};
-struct grpc_resolved_addresses {
- size_t naddrs;
- grpc_resolved_address* addrs;
+ // Resolve name in a blocking fashion. Use \a default_port if a port isn't
+ // designated in \a name, otherwise use the port in \a name.
+ virtual absl::StatusOr<std::vector<grpc_resolved_address>>
+ ResolveNameBlocking(absl::string_view name,
+ absl::string_view default_port) = 0;
};
-typedef struct grpc_address_resolver_vtable {
- void (*resolve_address)(const char* addr, const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_resolved_addresses** addresses);
- grpc_error_handle (*blocking_resolve_address)(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses);
-} grpc_address_resolver_vtable;
-
-void grpc_set_resolver_impl(grpc_address_resolver_vtable* vtable);
-/* Asynchronously resolve addr. Use default_port if a port isn't designated
- in addr, otherwise use the port in addr. */
-/* TODO(apolcyn): add a timeout here */
-void grpc_resolve_address(const char* addr, const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_resolved_addresses** addresses);
+// Override the active DNS resolver which should be used for all DNS
+// resolution in gRPC. Note this should only be used during library
+// initialization or within tests.
+void SetDNSResolver(DNSResolver* resolver);
-/* Destroy resolved addresses */
-void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addresses);
+// Get the singleton DNS resolver instance which should be used for all
+// DNS resolution in gRPC.
+DNSResolver* GetDNSResolver();
-/* Resolve addr in a blocking fashion. On success,
- result must be freed with grpc_resolved_addresses_destroy. */
-grpc_error_handle grpc_blocking_resolve_address(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses);
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */
diff --git a/grpc/src/core/lib/iomgr/resolve_address_custom.cc b/grpc/src/core/lib/iomgr/resolve_address_custom.cc
deleted file mode 100644
index f89eab05..00000000
--- a/grpc/src/core/lib/iomgr/resolve_address_custom.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- *
- * 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/iomgr/resolve_address_custom.h"
-
-#include <string.h>
-
-#include <string>
-
-#include "absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/address_utils/sockaddr_utils.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"
-
-struct grpc_custom_resolver {
- grpc_closure* on_done = nullptr;
- grpc_resolved_addresses** addresses = nullptr;
- std::string host;
- std::string port;
-};
-
-static grpc_custom_resolver_vtable* resolve_address_vtable = nullptr;
-
-static int retry_named_port_failure(grpc_custom_resolver* r,
- grpc_resolved_addresses** res) {
- // 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 (res) {
- grpc_error_handle 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());
- }
- return 1;
- }
- }
- return 0;
-}
-
-void grpc_custom_resolve_callback(grpc_custom_resolver* r,
- grpc_resolved_addresses* result,
- grpc_error_handle error) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- if (error == GRPC_ERROR_NONE) {
- *r->addresses = result;
- } else if (retry_named_port_failure(r, nullptr)) {
- return;
- }
- if (r->on_done) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
- }
- delete r;
-}
-
-static grpc_error_handle try_split_host_port(const char* name,
- const char* default_port,
- std::string* host,
- std::string* 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(
- absl::StrFormat("unparseable host:port: '%s'", name).c_str());
- }
- if (port->empty()) {
- // TODO(murgatroid99): add tests for this case
- if (default_port == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("no port in name '%s'", name).c_str());
- }
- *port = default_port;
- }
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle blocking_resolve_address_impl(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
-
- grpc_custom_resolver resolver;
- grpc_error_handle err =
- try_split_host_port(name, default_port, &resolver.host, &resolver.port);
- if (err != GRPC_ERROR_NONE) {
- return err;
- }
-
- /* Call getaddrinfo */
- 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);
- if (err != GRPC_ERROR_NONE) {
- if (retry_named_port_failure(&resolver, &addrs)) {
- GRPC_ERROR_UNREF(err);
- err = GRPC_ERROR_NONE;
- }
- }
- grpc_core::ExecCtx::Set(curr);
- if (err == GRPC_ERROR_NONE) {
- *addresses = addrs;
- }
- return err;
-}
-
-static void resolve_address_impl(const char* name, const char* default_port,
- grpc_pollset_set* /*interested_parties*/,
- grpc_closure* on_done,
- grpc_resolved_addresses** addrs) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- std::string host;
- std::string port;
- grpc_error_handle 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();
- r->on_done = on_done;
- r->addresses = addrs;
- 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());
-}
-
-static grpc_address_resolver_vtable custom_resolver_vtable = {
- resolve_address_impl, blocking_resolve_address_impl};
-
-void grpc_custom_resolver_init(grpc_custom_resolver_vtable* impl) {
- resolve_address_vtable = impl;
- grpc_set_resolver_impl(&custom_resolver_vtable);
-}
diff --git a/grpc/src/core/lib/iomgr/resolve_address_custom.h b/grpc/src/core/lib/iomgr/resolve_address_custom.h
deleted file mode 100644
index 5f674dd0..00000000
--- a/grpc/src/core/lib/iomgr/resolve_address_custom.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * 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_IOMGR_RESOLVE_ADDRESS_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-
-typedef struct grpc_custom_resolver grpc_custom_resolver;
-
-typedef struct grpc_custom_resolver_vtable {
- grpc_error_handle (*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,
- grpc_resolved_addresses* result,
- grpc_error_handle error);
-
-/* Internal APIs */
-void grpc_custom_resolver_init(grpc_custom_resolver_vtable* impl);
-
-#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/resolve_address_impl.h b/grpc/src/core/lib/iomgr/resolve_address_impl.h
new file mode 100644
index 00000000..0f912182
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/resolve_address_impl.h
@@ -0,0 +1,59 @@
+//
+// 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_RESOLVE_ADDRESS_IMPL_H
+#define GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_core {
+
+// A fire and forget class used by DNSResolver::Request implementations to
+// schedule DNS resolution callbacks on the ExecCtx, which is frequently
+// necessary to avoid lock inversion related problems.
+class DNSCallbackExecCtxScheduler {
+ public:
+ DNSCallbackExecCtxScheduler(
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done,
+ absl::StatusOr<std::vector<grpc_resolved_address>> param)
+ : on_done_(std::move(on_done)), param_(std::move(param)) {
+ GRPC_CLOSURE_INIT(&closure_, RunCallback, this, grpc_schedule_on_exec_ctx);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+ }
+
+ private:
+ static void RunCallback(void* arg, grpc_error_handle /* error */) {
+ DNSCallbackExecCtxScheduler* self =
+ static_cast<DNSCallbackExecCtxScheduler*>(arg);
+ self->on_done_(std::move(self->param_));
+ delete self;
+ }
+
+ const std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done_;
+ absl::StatusOr<std::vector<grpc_resolved_address>> param_;
+ grpc_closure closure_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_IMPL_H */
diff --git a/grpc/src/core/lib/iomgr/resolve_address_posix.cc b/grpc/src/core/lib/iomgr/resolve_address_posix.cc
index d0d1e0cd..d3217362 100644
--- a/grpc/src/core/lib/iomgr/resolve_address_posix.cc
+++ b/grpc/src/core/lib/iomgr/resolve_address_posix.cc
@@ -21,10 +21,6 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_RESOLVE_ADDRESS
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <string.h>
#include <sys/types.h>
@@ -40,51 +36,109 @@
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_posix.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+namespace {
+
+class NativeDNSRequest : public DNSResolver::Request {
+ public:
+ NativeDNSRequest(
+ absl::string_view name, absl::string_view default_port,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done)
+ : name_(name), default_port_(default_port), on_done_(std::move(on_done)) {
+ GRPC_CLOSURE_INIT(&request_closure_, DoRequestThread, this, nullptr);
+ }
+
+ // Starts the resolution
+ void Start() override {
+ Ref().release(); // ref held by callback
+ Executor::Run(&request_closure_, GRPC_ERROR_NONE, ExecutorType::RESOLVER);
+ }
-static grpc_error_handle posix_blocking_resolve_address(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses) {
- grpc_core::ExecCtx exec_ctx;
+ // This is a no-op for the native resolver. Note
+ // that no I/O polling is required for the resolution to finish.
+ void Orphan() override { Unref(); }
+
+ private:
+ // Callback to be passed to grpc Executor to asynch-ify
+ // ResolveNameBlocking
+ static void DoRequestThread(void* rp, grpc_error_handle /*error*/) {
+ NativeDNSRequest* r = static_cast<NativeDNSRequest*>(rp);
+ auto result =
+ GetDNSResolver()->ResolveNameBlocking(r->name_, r->default_port_);
+ // running inline is safe since we've already been scheduled on the executor
+ r->on_done_(std::move(result));
+ r->Unref();
+ }
+
+ const std::string name_;
+ const std::string default_port_;
+ const std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done_;
+ grpc_closure request_closure_;
+};
+
+} // namespace
+
+NativeDNSResolver* NativeDNSResolver::GetOrCreate() {
+ static NativeDNSResolver* instance = new NativeDNSResolver();
+ return instance;
+}
+
+OrphanablePtr<DNSResolver::Request> NativeDNSResolver::ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* /* interested_parties */,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) {
+ return MakeOrphanable<NativeDNSRequest>(name, default_port,
+ std::move(on_done));
+}
+
+absl::StatusOr<std::vector<grpc_resolved_address>>
+NativeDNSResolver::ResolveNameBlocking(absl::string_view name,
+ absl::string_view default_port) {
+ ExecCtx exec_ctx;
struct addrinfo hints;
struct addrinfo *result = nullptr, *resp;
int s;
size_t i;
grpc_error_handle err;
-
+ std::vector<grpc_resolved_address> addresses;
std::string host;
std::string port;
- /* parse name, splitting it into host and port parts */
- grpc_core::SplitHostPort(name, &host, &port);
+ // parse name, splitting it into host and port parts
+ SplitHostPort(name, &host, &port);
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));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
-
if (port.empty()) {
- if (default_port == nullptr) {
+ if (default_port.empty()) {
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));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
- port = default_port;
+ port = std::string(default_port);
}
-
- /* Call getaddrinfo */
+ // Call getaddrinfo
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */
hints.ai_socktype = SOCK_STREAM; /* stream socket */
hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
-
GRPC_SCHEDULING_START_BLOCKING_REGION;
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 */
+ // 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]) {
@@ -95,7 +149,6 @@ static grpc_error_handle posix_blocking_resolve_address(
}
}
}
-
if (s != 0) {
err = grpc_error_set_str(
grpc_error_set_str(
@@ -103,72 +156,31 @@ static grpc_error_handle posix_blocking_resolve_address(
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(gai_strerror(s)),
GRPC_ERROR_INT_ERRNO, s),
- GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(gai_strerror(s))),
- GRPC_ERROR_STR_SYSCALL,
- grpc_slice_from_static_string("getaddrinfo")),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_OS_ERROR, gai_strerror(s)),
+ GRPC_ERROR_STR_SYSCALL, "getaddrinfo"),
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
-
- /* Success path: set addrs non-NULL, fill it in */
- *addresses = static_cast<grpc_resolved_addresses*>(
- gpr_malloc(sizeof(grpc_resolved_addresses)));
- (*addresses)->naddrs = 0;
- for (resp = result; resp != nullptr; resp = resp->ai_next) {
- (*addresses)->naddrs++;
- }
- (*addresses)->addrs = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address) * (*addresses)->naddrs));
- i = 0;
+ // Success path: fill in addrs
for (resp = result; resp != nullptr; resp = resp->ai_next) {
- memcpy(&(*addresses)->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
- (*addresses)->addrs[i].len = resp->ai_addrlen;
- i++;
+ grpc_resolved_address addr;
+ memcpy(&addr.addr, resp->ai_addr, resp->ai_addrlen);
+ addr.len = resp->ai_addrlen;
+ addresses.push_back(addr);
}
err = GRPC_ERROR_NONE;
-
done:
if (result) {
freeaddrinfo(result);
}
- return err;
-}
-
-struct request {
- char* name;
- char* default_port;
- grpc_closure* on_done;
- grpc_resolved_addresses** addrs_out;
- grpc_closure request_closure;
- void* arg;
-};
-/* Callback to be passed to grpc Executor to asynch-ify
- * grpc_blocking_resolve_address */
-static void do_request_thread(void* rp, grpc_error_handle /*error*/) {
- request* r = static_cast<request*>(rp);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION, r->on_done,
- grpc_blocking_resolve_address(r->name, r->default_port, r->addrs_out));
- gpr_free(r->name);
- gpr_free(r->default_port);
- gpr_free(r);
+ if (err == GRPC_ERROR_NONE) {
+ return addresses;
+ }
+ auto error_result = grpc_error_to_absl_status(err);
+ GRPC_ERROR_UNREF(err);
+ return error_result;
}
-static void posix_resolve_address(const char* name, const char* default_port,
- grpc_pollset_set* /*interested_parties*/,
- grpc_closure* on_done,
- grpc_resolved_addresses** addrs) {
- request* r = static_cast<request*>(gpr_malloc(sizeof(request)));
- GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r, nullptr);
- r->name = gpr_strdup(name);
- r->default_port = gpr_strdup(default_port);
- r->on_done = on_done;
- r->addrs_out = addrs;
- grpc_core::Executor::Run(&r->request_closure, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::RESOLVER);
-}
+} // namespace grpc_core
-grpc_address_resolver_vtable grpc_posix_resolver_vtable = {
- posix_resolve_address, posix_blocking_resolve_address};
#endif
diff --git a/grpc/src/core/lib/iomgr/resolve_address_posix.h b/grpc/src/core/lib/iomgr/resolve_address_posix.h
new file mode 100644
index 00000000..6362d02d
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/resolve_address_posix.h
@@ -0,0 +1,47 @@
+//
+// 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_RESOLVE_ADDRESS_POSIX_H
+#define GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_POSIX_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+
+#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_core {
+
+// A DNS resolver which uses the native platform's getaddrinfo API.
+class NativeDNSResolver : public DNSResolver {
+ public:
+ // Gets the singleton instance, creating it first if it doesn't exist
+ static NativeDNSResolver* GetOrCreate();
+
+ OrphanablePtr<DNSResolver::Request> ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) override;
+
+ absl::StatusOr<std::vector<grpc_resolved_address>> ResolveNameBlocking(
+ absl::string_view name, absl::string_view default_port) override;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_POSIX_H
diff --git a/grpc/src/core/lib/iomgr/resolve_address_windows.cc b/grpc/src/core/lib/iomgr/resolve_address_windows.cc
index 926237bc..90592312 100644
--- a/grpc/src/core/lib/iomgr/resolve_address_windows.cc
+++ b/grpc/src/core/lib/iomgr/resolve_address_windows.cc
@@ -1,30 +1,24 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <inttypes.h>
#include <string.h>
#include <sys/types.h>
@@ -46,43 +40,99 @@
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/resolve_address_windows.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+namespace {
+
+class NativeDNSRequest : public DNSResolver::Request {
+ public:
+ NativeDNSRequest(
+ absl::string_view name, absl::string_view default_port,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done)
+ : name_(name), default_port_(default_port), on_done_(std::move(on_done)) {
+ GRPC_CLOSURE_INIT(&request_closure_, DoRequestThread, this, nullptr);
+ }
+
+ // Starts the resolution
+ void Start() override {
+ Ref().release(); // ref held by callback
+ Executor::Run(&request_closure_, GRPC_ERROR_NONE, ExecutorType::RESOLVER);
+ }
+
+ // This is a no-op for the native resolver. Note
+ // that no I/O polling is required for the resolution to finish.
+ void Orphan() override { Unref(); }
+
+ private:
+ // Callback to be passed to grpc Executor to asynch-ify
+ // ResolveNameBlocking
+ static void DoRequestThread(void* rp, grpc_error_handle /*error*/) {
+ NativeDNSRequest* r = static_cast<NativeDNSRequest*>(rp);
+ auto result =
+ GetDNSResolver()->ResolveNameBlocking(r->name_, r->default_port_);
+ // running inline is safe since we've already been scheduled on the executor
+ r->on_done_(std::move(result));
+ r->Unref();
+ }
-struct request {
- char* name;
- char* default_port;
- grpc_closure request_closure;
- grpc_closure* on_done;
- grpc_resolved_addresses** addresses;
+ const std::string name_;
+ const std::string default_port_;
+ const std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done_;
+ grpc_closure request_closure_;
};
-static grpc_error_handle windows_blocking_resolve_address(
- const char* name, const char* default_port,
- grpc_resolved_addresses** addresses) {
- grpc_core::ExecCtx exec_ctx;
+
+} // namespace
+
+NativeDNSResolver* NativeDNSResolver::GetOrCreate() {
+ static NativeDNSResolver* instance = new NativeDNSResolver();
+ return instance;
+}
+
+OrphanablePtr<DNSResolver::Request> NativeDNSResolver::ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* /* interested_parties */,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) {
+ return MakeOrphanable<NativeDNSRequest>(name, default_port,
+ std::move(on_done));
+}
+
+absl::StatusOr<std::vector<grpc_resolved_address>>
+NativeDNSResolver::ResolveNameBlocking(absl::string_view name,
+ absl::string_view default_port) {
+ ExecCtx exec_ctx;
struct addrinfo hints;
struct addrinfo *result = NULL, *resp;
int s;
size_t i;
grpc_error_handle error = GRPC_ERROR_NONE;
+ std::vector<grpc_resolved_address> addresses;
- /* parse name, splitting it into host and port parts */
+ // parse name, splitting it into host and port parts
std::string host;
std::string port;
- grpc_core::SplitHostPort(name, &host, &port);
+ SplitHostPort(name, &host, &port);
if (host.empty()) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("unparseable host:port: '%s'", name).c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("unparseable host:port: '%s'", name));
goto done;
}
if (port.empty()) {
if (default_port == NULL) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("no port in name '%s'", name).c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("no port in name '%s'", name));
goto done;
}
- port = default_port;
+ port = std::string(default_port);
}
- /* Call getaddrinfo */
+ // Call getaddrinfo
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */
hints.ai_socktype = SOCK_STREAM; /* stream socket */
@@ -96,59 +146,26 @@ static grpc_error_handle windows_blocking_resolve_address(
goto done;
}
- /* Success path: set addrs non-NULL, fill it in */
- (*addresses) =
- (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
- (*addresses)->naddrs = 0;
+ // Success path: set addrs non-NULL, fill it in
for (resp = result; resp != NULL; resp = resp->ai_next) {
- (*addresses)->naddrs++;
- }
- (*addresses)->addrs = (grpc_resolved_address*)gpr_malloc(
- sizeof(grpc_resolved_address) * (*addresses)->naddrs);
- i = 0;
- for (resp = result; resp != NULL; resp = resp->ai_next) {
- memcpy(&(*addresses)->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
- (*addresses)->addrs[i].len = resp->ai_addrlen;
- i++;
+ grpc_resolved_address addr;
+ memcpy(&addr.addr, resp->ai_addr, resp->ai_addrlen);
+ addr.len = resp->ai_addrlen;
+ addresses.push_back(addr);
}
done:
if (result) {
freeaddrinfo(result);
}
- return error;
-}
-
-/* Callback to be passed to grpc_executor to asynch-ify
- * grpc_blocking_resolve_address */
-static void do_request_thread(void* rp, grpc_error_handle error) {
- request* r = (request*)rp;
if (error == GRPC_ERROR_NONE) {
- error =
- grpc_blocking_resolve_address(r->name, r->default_port, r->addresses);
- } else {
- GRPC_ERROR_REF(error);
+ return addresses;
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
- gpr_free(r->name);
- gpr_free(r->default_port);
- gpr_free(r);
+ auto error_result = grpc_error_to_absl_status(error);
+ GRPC_ERROR_UNREF(error);
+ return error_result;
}
-static void windows_resolve_address(const char* name, const char* default_port,
- grpc_pollset_set* interested_parties,
- grpc_closure* on_done,
- grpc_resolved_addresses** addresses) {
- request* r = (request*)gpr_malloc(sizeof(request));
- GRPC_CLOSURE_INIT(&r->request_closure, do_request_thread, r, nullptr);
- r->name = gpr_strdup(name);
- r->default_port = gpr_strdup(default_port);
- r->on_done = on_done;
- r->addresses = addresses;
- grpc_core::Executor::Run(&r->request_closure, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::RESOLVER);
-}
+} // namespace grpc_core
-grpc_address_resolver_vtable grpc_windows_resolver_vtable = {
- windows_resolve_address, windows_blocking_resolve_address};
#endif
diff --git a/grpc/src/core/lib/iomgr/resolve_address_windows.h b/grpc/src/core/lib/iomgr/resolve_address_windows.h
new file mode 100644
index 00000000..403c4ff0
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/resolve_address_windows.h
@@ -0,0 +1,47 @@
+//
+// 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_RESOLVE_ADDRESS_WINDOWS_H
+#define GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_WINDOWS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+
+#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_core {
+
+// A DNS resolver which uses the native platform's getaddrinfo API.
+class NativeDNSResolver : public DNSResolver {
+ public:
+ // Gets the singleton instance, creating it first if it doesn't exist
+ static NativeDNSResolver* GetOrCreate();
+
+ OrphanablePtr<DNSResolver::Request> ResolveName(
+ absl::string_view name, absl::string_view default_port,
+ grpc_pollset_set* interested_parties,
+ std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
+ on_done) override;
+
+ absl::StatusOr<std::vector<grpc_resolved_address>> ResolveNameBlocking(
+ absl::string_view name, absl::string_view default_port) override;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_WINDOWS_H
diff --git a/grpc/src/core/lib/iomgr/resolved_address.h b/grpc/src/core/lib/iomgr/resolved_address.h
new file mode 100644
index 00000000..9ca8c262
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/resolved_address.h
@@ -0,0 +1,39 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOLVED_ADDRESS_H
+#define GRPC_CORE_LIB_IOMGR_RESOLVED_ADDRESS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_WINSOCK_SOCKET
+#include <ws2tcpip.h>
+#endif
+
+#if defined(GRPC_POSIX_SOCKET) || defined(GRPC_CFSTREAM)
+#include <sys/socket.h>
+#endif
+
+#define GRPC_MAX_SOCKADDR_SIZE 128
+
+struct grpc_resolved_address {
+ char addr[GRPC_MAX_SOCKADDR_SIZE];
+ socklen_t len;
+};
+
+#endif /* GRPC_CORE_LIB_IOMGR_RESOLVED_ADDRESS_H */
diff --git a/grpc/src/core/lib/iomgr/resource_quota.cc b/grpc/src/core/lib/iomgr/resource_quota.cc
deleted file mode 100644
index a4f4107d..00000000
--- a/grpc/src/core/lib/iomgr/resource_quota.cc
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*
- *
- * 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/resource_quota.h"
-
-#include <inttypes.h>
-#include <limits.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <string>
-
-#include "absl/strings/str_cat.h"
-
-#include <grpc/slice_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/iomgr/combiner.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota");
-
-#define MEMORY_USAGE_ESTIMATION_MAX 65536
-
-/* Internal linked list pointers for a resource user */
-struct grpc_resource_user_link {
- grpc_resource_user* next;
- grpc_resource_user* prev;
-};
-/* Resource users are kept in (potentially) several intrusive linked lists
- at once. These are the list names. */
-typedef enum {
- /* Resource users that are waiting for an allocation */
- GRPC_RULIST_AWAITING_ALLOCATION,
- /* Resource users that have free memory available for internal reclamation */
- GRPC_RULIST_NON_EMPTY_FREE_POOL,
- /* Resource users that have published a benign reclamation is available */
- GRPC_RULIST_RECLAIMER_BENIGN,
- /* Resource users that have published a destructive reclamation is
- available */
- GRPC_RULIST_RECLAIMER_DESTRUCTIVE,
- /* Number of lists: must be last */
- GRPC_RULIST_COUNT
-} grpc_rulist;
-
-struct grpc_resource_user {
- /* The quota this resource user consumes from */
- grpc_resource_quota* resource_quota;
-
- /* Closure to schedule an allocation under the resource quota combiner lock */
- grpc_closure allocate_closure;
- /* Closure to publish a non empty free pool under the resource quota combiner
- lock */
- grpc_closure add_to_free_pool_closure;
-
- /* one ref for each ref call (released by grpc_resource_user_unref), and one
- ref for each byte allocated (released by grpc_resource_user_free) */
- gpr_atm refs;
- /* is this resource user unlocked? starts at 0, increases for each shutdown
- call */
- gpr_atm shutdown;
-
- gpr_mu mu;
- /* The amount of memory (in bytes) this user has cached for its own use: to
- avoid quota contention, each resource user can keep some memory in
- addition to what it is immediately using (e.g., for caching), and the quota
- can pull it back under memory pressure.
- This value can become negative if more memory has been requested than
- existed in the free pool, at which point the quota is consulted to bring
- this value non-negative (asynchronously). */
- int64_t free_pool;
- /* A list of closures to call once free_pool becomes non-negative - ie when
- all outstanding allocations have been granted. */
- grpc_closure_list on_allocated;
- /* True if we are currently trying to allocate from the quota, false if not */
- bool allocating;
- /* The amount of memory (in bytes) that has been requested from this user
- * asynchronously but hasn't been granted yet. */
- int64_t outstanding_allocations;
- /* True if we are currently trying to add ourselves to the non-free quota
- list, false otherwise */
- bool added_to_free_pool;
-
- /* The number of threads currently allocated to this resource user */
- gpr_atm num_threads_allocated;
-
- /* Reclaimers: index 0 is the benign reclaimer, 1 is the destructive reclaimer
- */
- grpc_closure* reclaimers[2];
- /* Reclaimers just posted: once we're in the combiner lock, we'll move them
- to the array above */
- grpc_closure* new_reclaimers[2];
- /* Trampoline closures to finish reclamation and re-enter the quota combiner
- lock */
- grpc_closure post_reclaimer_closure[2];
-
- /* Closure to execute under the quota combiner to de-register and shutdown the
- resource user */
- grpc_closure destroy_closure;
-
- /* Links in the various grpc_rulist lists */
- grpc_resource_user_link links[GRPC_RULIST_COUNT];
-
- /* The name of this resource user, for debugging/tracing */
- std::string name;
-};
-
-struct grpc_resource_quota {
- /* refcount */
- gpr_refcount refs;
-
- /* estimate of current memory usage
- scaled to the range [0..RESOURCE_USAGE_ESTIMATION_MAX] */
- gpr_atm memory_usage_estimation;
-
- /* Main combiner lock: all activity on a quota executes under this combiner
- * (so no mutex is needed for this data structure) */
- grpc_core::Combiner* combiner;
- /* Size of the resource quota */
- int64_t size;
- /* Amount of free memory in the resource quota */
- int64_t free_pool;
- /* Used size of memory in the resource quota. Updated as soon as the resource
- * users start to allocate or free the memory. */
- gpr_atm used;
-
- gpr_atm last_size;
-
- /* Mutex to protect max_threads and num_threads_allocated */
- /* Note: We could have used gpr_atm for max_threads and num_threads_allocated
- * and avoid having this mutex; but in that case, each invocation of the
- * function grpc_resource_user_allocate_threads() would have had to do at
- * least two atomic loads (for max_threads and num_threads_allocated) followed
- * by a CAS (on num_threads_allocated).
- * Moreover, we expect grpc_resource_user_allocate_threads() to be often
- * called concurrently thereby increasing the chances of failing the CAS
- * operation. This additional complexity is not worth the tiny perf gain we
- * may (or may not) have by using atomics */
- gpr_mu thread_count_mu;
-
- /* Max number of threads allowed */
- int max_threads;
-
- /* Number of threads currently allocated via this resource_quota object */
- int num_threads_allocated;
-
- /* Has rq_step been scheduled to occur? */
- bool step_scheduled;
-
- /* Are we currently reclaiming memory */
- bool reclaiming;
-
- /* Closure around rq_step */
- grpc_closure rq_step_closure;
-
- /* Closure around rq_reclamation_done */
- grpc_closure rq_reclamation_done_closure;
-
- /* This is only really usable for debugging: it's always a stale pointer, but
- a stale pointer that might just be fresh enough to guide us to where the
- reclamation system is stuck */
- grpc_closure* debug_only_last_initiated_reclaimer;
- grpc_resource_user* debug_only_last_reclaimer_resource_user;
-
- /* Roots of all resource user lists */
- grpc_resource_user* roots[GRPC_RULIST_COUNT];
-
- std::string name;
-};
-
-static void ru_unref_by(grpc_resource_user* resource_user, gpr_atm amount);
-
-/*******************************************************************************
- * list management
- */
-
-static void rulist_add_head(grpc_resource_user* resource_user,
- grpc_rulist list) {
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- grpc_resource_user** root = &resource_quota->roots[list];
- if (*root == nullptr) {
- *root = resource_user;
- resource_user->links[list].next = resource_user->links[list].prev =
- resource_user;
- } else {
- resource_user->links[list].next = *root;
- resource_user->links[list].prev = (*root)->links[list].prev;
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev->links[list].next = resource_user;
- *root = resource_user;
- }
-}
-
-static void rulist_add_tail(grpc_resource_user* resource_user,
- grpc_rulist list) {
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- grpc_resource_user** root = &resource_quota->roots[list];
- if (*root == nullptr) {
- *root = resource_user;
- resource_user->links[list].next = resource_user->links[list].prev =
- resource_user;
- } else {
- resource_user->links[list].next = (*root)->links[list].next;
- resource_user->links[list].prev = *root;
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev->links[list].next = resource_user;
- }
-}
-
-static bool rulist_empty(grpc_resource_quota* resource_quota,
- grpc_rulist list) {
- return resource_quota->roots[list] == nullptr;
-}
-
-static grpc_resource_user* rulist_pop_head(grpc_resource_quota* resource_quota,
- grpc_rulist list) {
- grpc_resource_user** root = &resource_quota->roots[list];
- grpc_resource_user* resource_user = *root;
- if (resource_user == nullptr) {
- return nullptr;
- }
- if (resource_user->links[list].next == resource_user) {
- *root = nullptr;
- } else {
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev;
- resource_user->links[list].prev->links[list].next =
- resource_user->links[list].next;
- *root = resource_user->links[list].next;
- }
- resource_user->links[list].next = resource_user->links[list].prev = nullptr;
- return resource_user;
-}
-
-static void rulist_remove(grpc_resource_user* resource_user, grpc_rulist list) {
- if (resource_user->links[list].next == nullptr) return;
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- if (resource_quota->roots[list] == resource_user) {
- resource_quota->roots[list] = resource_user->links[list].next;
- if (resource_quota->roots[list] == resource_user) {
- resource_quota->roots[list] = nullptr;
- }
- }
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev;
- resource_user->links[list].prev->links[list].next =
- resource_user->links[list].next;
- resource_user->links[list].next = resource_user->links[list].prev = nullptr;
-}
-
-/*******************************************************************************
- * resource quota state machine
- */
-
-static bool rq_alloc(grpc_resource_quota* resource_quota);
-static bool rq_reclaim_from_per_user_free_pool(
- grpc_resource_quota* resource_quota);
-static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive);
-
-static void rq_step(void* rq, grpc_error_handle /*error*/) {
- grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
- resource_quota->step_scheduled = false;
- do {
- if (rq_alloc(resource_quota)) goto done;
- } while (rq_reclaim_from_per_user_free_pool(resource_quota));
-
- if (!rq_reclaim(resource_quota, false)) {
- rq_reclaim(resource_quota, true);
- }
-
-done:
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-static void rq_step_sched(grpc_resource_quota* resource_quota) {
- if (resource_quota->step_scheduled) return;
- resource_quota->step_scheduled = true;
- grpc_resource_quota_ref_internal(resource_quota);
- resource_quota->combiner->FinallyRun(&resource_quota->rq_step_closure,
- GRPC_ERROR_NONE);
-}
-
-/* update the atomically available resource estimate - use no barriers since
- timeliness of delivery really doesn't matter much */
-static void rq_update_estimate(grpc_resource_quota* resource_quota) {
- gpr_atm memory_usage_estimation = MEMORY_USAGE_ESTIMATION_MAX;
- if (resource_quota->size != 0) {
- memory_usage_estimation =
- GPR_CLAMP((gpr_atm)((1.0 - ((double)resource_quota->free_pool) /
- ((double)resource_quota->size)) *
- MEMORY_USAGE_ESTIMATION_MAX),
- 0, MEMORY_USAGE_ESTIMATION_MAX);
- }
- gpr_atm_no_barrier_store(&resource_quota->memory_usage_estimation,
- memory_usage_estimation);
-}
-
-/* returns true if all allocations are completed */
-static bool rq_alloc(grpc_resource_quota* resource_quota) {
- grpc_resource_user* resource_user;
- while ((resource_user = rulist_pop_head(resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION))) {
- gpr_mu_lock(&resource_user->mu);
- 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,
- resource_user, gpr_atm_no_barrier_load(&resource_user->shutdown),
- resource_user->free_pool, resource_user->outstanding_allocations);
- }
- if (gpr_atm_no_barrier_load(&resource_user->shutdown)) {
- resource_user->allocating = false;
- grpc_closure_list_fail_all(
- &resource_user->on_allocated,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource user shutdown"));
- int64_t aborted_allocations = resource_user->outstanding_allocations;
- resource_user->outstanding_allocations = 0;
- 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));
- }
- continue;
- }
- if (resource_user->free_pool < 0 &&
- -resource_user->free_pool <= resource_quota->free_pool) {
- int64_t amt = -resource_user->free_pool;
- resource_user->free_pool = 0;
- resource_quota->free_pool -= amt;
- rq_update_estimate(resource_quota);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- 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->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());
- }
- if (resource_user->free_pool >= 0) {
- resource_user->allocating = false;
- resource_user->outstanding_allocations = 0;
- grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
- gpr_mu_unlock(&resource_user->mu);
- } else {
- rulist_add_head(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
- gpr_mu_unlock(&resource_user->mu);
- return false;
- }
- }
- return true;
-}
-
-/* returns true if any memory could be reclaimed from buffers */
-static bool rq_reclaim_from_per_user_free_pool(
- grpc_resource_quota* resource_quota) {
- grpc_resource_user* resource_user;
- while ((resource_user = rulist_pop_head(resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL))) {
- gpr_mu_lock(&resource_user->mu);
- resource_user->added_to_free_pool = false;
- if (resource_user->free_pool > 0) {
- int64_t amt = resource_user->free_pool;
- resource_user->free_pool = 0;
- resource_quota->free_pool += amt;
- rq_update_estimate(resource_quota);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- 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->free_pool);
- }
- gpr_mu_unlock(&resource_user->mu);
- return true;
- } else {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- 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_user->free_pool, resource_quota->free_pool);
- }
- gpr_mu_unlock(&resource_user->mu);
- }
- }
- return false;
-}
-
-/* returns true if reclamation is proceeding */
-static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive) {
- if (resource_quota->reclaiming) return true;
- grpc_rulist list = destructive ? GRPC_RULIST_RECLAIMER_DESTRUCTIVE
- : GRPC_RULIST_RECLAIMER_BENIGN;
- 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");
- }
- resource_quota->reclaiming = true;
- grpc_resource_quota_ref_internal(resource_quota);
- grpc_closure* c = resource_user->reclaimers[destructive];
- GPR_ASSERT(c);
- resource_quota->debug_only_last_reclaimer_resource_user = resource_user;
- resource_quota->debug_only_last_initiated_reclaimer = c;
- resource_user->reclaimers[destructive] = nullptr;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, GRPC_ERROR_NONE);
- return true;
-}
-
-/*******************************************************************************
- * ru_slice: a slice implementation that is backed by a grpc_resource_user
- */
-
-namespace grpc_core {
-
-class RuSliceRefcount {
- public:
- static void Destroy(void* p) {
- auto* rc = static_cast<RuSliceRefcount*>(p);
- rc->~RuSliceRefcount();
- gpr_free(rc);
- }
- RuSliceRefcount(grpc_resource_user* resource_user, size_t size)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
- resource_user_(resource_user),
- size_(size) {
- // Nothing to do here.
- }
- ~RuSliceRefcount() { grpc_resource_user_free(resource_user_, size_); }
-
- grpc_slice_refcount* base_refcount() { return &base_; }
-
- private:
- grpc_slice_refcount base_;
- RefCount refs_;
- grpc_resource_user* resource_user_;
- size_t size_;
-};
-
-} // namespace grpc_core
-
-static grpc_slice ru_slice_create(grpc_resource_user* resource_user,
- size_t size) {
- auto* rc = static_cast<grpc_core::RuSliceRefcount*>(
- gpr_malloc(sizeof(grpc_core::RuSliceRefcount) + size));
- new (rc) grpc_core::RuSliceRefcount(resource_user, size);
- grpc_slice slice;
-
- slice.refcount = rc->base_refcount();
- slice.data.refcounted.bytes = reinterpret_cast<uint8_t*>(rc + 1);
- slice.data.refcounted.length = size;
- return slice;
-}
-
-/*******************************************************************************
- * grpc_resource_quota internal implementation: resource user manipulation under
- * the combiner
- */
-
-static void ru_allocate(void* ru, grpc_error_handle /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
-}
-
-static void ru_add_to_free_pool(void* ru, grpc_error_handle /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_NON_EMPTY_FREE_POOL);
-}
-
-static bool ru_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive) {
- grpc_closure* closure = resource_user->new_reclaimers[destructive];
- GPR_ASSERT(closure != nullptr);
- resource_user->new_reclaimers[destructive] = nullptr;
- GPR_ASSERT(resource_user->reclaimers[destructive] == nullptr);
- if (gpr_atm_acq_load(&resource_user->shutdown) > 0) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_CANCELLED);
- return false;
- }
- resource_user->reclaimers[destructive] = closure;
- return true;
-}
-
-static void ru_post_benign_reclaimer(void* ru, grpc_error_handle /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!ru_post_reclaimer(resource_user, false)) return;
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_BENIGN)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
-}
-
-static void ru_post_destructive_reclaimer(void* ru,
- grpc_error_handle /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!ru_post_reclaimer(resource_user, true)) return;
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_BENIGN) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_DESTRUCTIVE)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
-}
-
-static void ru_shutdown(void* ru, grpc_error_handle /*error*/) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RU shutdown %p", ru);
- }
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- gpr_mu_lock(&resource_user->mu);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
- GRPC_ERROR_CANCELLED);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
- GRPC_ERROR_CANCELLED);
- resource_user->reclaimers[0] = nullptr;
- resource_user->reclaimers[1] = nullptr;
- rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
- rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
- if (resource_user->allocating) {
- rq_step_sched(resource_user->resource_quota);
- }
- gpr_mu_unlock(&resource_user->mu);
-}
-
-static void ru_destroy(void* ru, grpc_error_handle /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- GPR_ASSERT(gpr_atm_no_barrier_load(&resource_user->refs) == 0);
- // Free all the remaining thread quota
- grpc_resource_user_free_threads(resource_user,
- static_cast<int>(gpr_atm_no_barrier_load(
- &resource_user->num_threads_allocated)));
-
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- rulist_remove(resource_user, static_cast<grpc_rulist>(i));
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
- GRPC_ERROR_CANCELLED);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
- GRPC_ERROR_CANCELLED);
- if (resource_user->free_pool != 0) {
- resource_user->resource_quota->free_pool += resource_user->free_pool;
- rq_step_sched(resource_user->resource_quota);
- }
- grpc_resource_quota_unref_internal(resource_user->resource_quota);
- gpr_mu_destroy(&resource_user->mu);
- delete resource_user;
-}
-
-static void ru_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator) {
- for (size_t i = 0; i < slice_allocator->count; i++) {
- grpc_slice_buffer_add_indexed(
- slice_allocator->dest, ru_slice_create(slice_allocator->resource_user,
- slice_allocator->length));
- }
-}
-
-static void ru_allocated_slices(void* arg, grpc_error_handle error) {
- grpc_resource_user_slice_allocator* slice_allocator =
- static_cast<grpc_resource_user_slice_allocator*>(arg);
- if (error == GRPC_ERROR_NONE) ru_alloc_slices(slice_allocator);
- grpc_core::Closure::Run(DEBUG_LOCATION, &slice_allocator->on_done,
- GRPC_ERROR_REF(error));
-}
-
-/*******************************************************************************
- * grpc_resource_quota internal implementation: quota manipulation under the
- * combiner
- */
-
-struct rq_resize_args {
- int64_t size;
- grpc_resource_quota* resource_quota;
- grpc_closure closure;
-};
-static void rq_resize(void* args, grpc_error_handle /*error*/) {
- rq_resize_args* a = static_cast<rq_resize_args*>(args);
- int64_t delta = a->size - a->resource_quota->size;
- a->resource_quota->size += delta;
- a->resource_quota->free_pool += delta;
- rq_update_estimate(a->resource_quota);
- rq_step_sched(a->resource_quota);
- grpc_resource_quota_unref_internal(a->resource_quota);
- gpr_free(a);
-}
-
-static void rq_reclamation_done(void* rq, grpc_error_handle /*error*/) {
- grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
- resource_quota->reclaiming = false;
- rq_step_sched(resource_quota);
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-/*******************************************************************************
- * grpc_resource_quota api
- */
-
-/* Public API */
-grpc_resource_quota* grpc_resource_quota_create(const char* name) {
- 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;
- resource_quota->size = INT64_MAX;
- resource_quota->used = 0;
- gpr_atm_no_barrier_store(&resource_quota->last_size, GPR_ATM_MAX);
- gpr_mu_init(&resource_quota->thread_count_mu);
- resource_quota->max_threads = INT_MAX;
- resource_quota->num_threads_allocated = 0;
- resource_quota->step_scheduled = false;
- resource_quota->reclaiming = false;
- gpr_atm_no_barrier_store(&resource_quota->memory_usage_estimation, 0);
- if (name != nullptr) {
- resource_quota->name = name;
- } else {
- resource_quota->name = absl::StrCat(
- "anonymous_pool_", reinterpret_cast<intptr_t>(resource_quota));
- }
- GRPC_CLOSURE_INIT(&resource_quota->rq_step_closure, rq_step, resource_quota,
- nullptr);
- GRPC_CLOSURE_INIT(&resource_quota->rq_reclamation_done_closure,
- rq_reclamation_done, resource_quota, nullptr);
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- resource_quota->roots[i] = nullptr;
- }
- return resource_quota;
-}
-
-void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota) {
- if (gpr_unref(&resource_quota->refs)) {
- // No outstanding thread 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;
- }
-}
-
-/* Public API */
-void grpc_resource_quota_unref(grpc_resource_quota* resource_quota) {
- grpc_core::ExecCtx exec_ctx;
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-grpc_resource_quota* grpc_resource_quota_ref_internal(
- grpc_resource_quota* resource_quota) {
- gpr_ref(&resource_quota->refs);
- return resource_quota;
-}
-
-/* Public API */
-void grpc_resource_quota_ref(grpc_resource_quota* resource_quota) {
- grpc_resource_quota_ref_internal(resource_quota);
-}
-
-double grpc_resource_quota_get_memory_pressure(
- grpc_resource_quota* resource_quota) {
- return (static_cast<double>(gpr_atm_no_barrier_load(
- &resource_quota->memory_usage_estimation))) /
- (static_cast<double>(MEMORY_USAGE_ESTIMATION_MAX));
-}
-
-/* Public API */
-void grpc_resource_quota_set_max_threads(grpc_resource_quota* resource_quota,
- int new_max_threads) {
- GPR_ASSERT(new_max_threads >= 0);
- gpr_mu_lock(&resource_quota->thread_count_mu);
- resource_quota->max_threads = new_max_threads;
- gpr_mu_unlock(&resource_quota->thread_count_mu);
-}
-
-/* Public API */
-void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
- size_t size) {
- grpc_core::ExecCtx exec_ctx;
- rq_resize_args* a = static_cast<rq_resize_args*>(gpr_malloc(sizeof(*a)));
- a->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
- a->size = static_cast<int64_t>(size);
- gpr_atm_no_barrier_store(&resource_quota->last_size,
- (gpr_atm)GPR_MIN((size_t)GPR_ATM_MAX, size));
- GRPC_CLOSURE_INIT(&a->closure, rq_resize, a, grpc_schedule_on_exec_ctx);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, &a->closure, GRPC_ERROR_NONE);
-}
-
-size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota) {
- return static_cast<size_t>(
- gpr_atm_no_barrier_load(&resource_quota->last_size));
-}
-
-/*******************************************************************************
- * grpc_resource_user channel args api
- */
-
-grpc_resource_quota* grpc_resource_quota_from_channel_args(
- const grpc_channel_args* channel_args, bool create) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- if (channel_args->args[i].type == GRPC_ARG_POINTER) {
- return grpc_resource_quota_ref_internal(
- static_cast<grpc_resource_quota*>(
- channel_args->args[i].value.pointer.p));
- } else {
- gpr_log(GPR_DEBUG, GRPC_ARG_RESOURCE_QUOTA " should be a pointer");
- }
- }
- }
- return create ? grpc_resource_quota_create(nullptr) : nullptr;
-}
-
-static void* rq_copy(void* rq) {
- grpc_resource_quota_ref(static_cast<grpc_resource_quota*>(rq));
- return rq;
-}
-
-static void rq_destroy(void* rq) {
- grpc_resource_quota_unref_internal(static_cast<grpc_resource_quota*>(rq));
-}
-
-static int rq_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
-
-const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void) {
- static const grpc_arg_pointer_vtable vtable = {rq_copy, rq_destroy, rq_cmp};
- return &vtable;
-}
-
-/*******************************************************************************
- * grpc_resource_user api
- */
-
-grpc_resource_user* grpc_resource_user_create(
- grpc_resource_quota* resource_quota, const char* name) {
- 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,
- resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->add_to_free_pool_closure,
- &ru_add_to_free_pool, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->post_reclaimer_closure[0],
- &ru_post_benign_reclaimer, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->post_reclaimer_closure[1],
- &ru_post_destructive_reclaimer, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->destroy_closure, &ru_destroy, resource_user,
- nullptr);
- gpr_mu_init(&resource_user->mu);
- gpr_atm_rel_store(&resource_user->refs, 1);
- gpr_atm_rel_store(&resource_user->shutdown, 0);
- resource_user->free_pool = 0;
- grpc_closure_list_init(&resource_user->on_allocated);
- resource_user->allocating = false;
- resource_user->added_to_free_pool = false;
- gpr_atm_no_barrier_store(&resource_user->num_threads_allocated, 0);
- resource_user->reclaimers[0] = nullptr;
- resource_user->reclaimers[1] = nullptr;
- resource_user->new_reclaimers[0] = nullptr;
- resource_user->new_reclaimers[1] = nullptr;
- resource_user->outstanding_allocations = 0;
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- resource_user->links[i].next = resource_user->links[i].prev = nullptr;
- }
- if (name != nullptr) {
- resource_user->name = name;
- } else {
- resource_user->name = absl::StrCat(
- "anonymous_resource_user_", reinterpret_cast<intptr_t>(resource_user));
- }
- return resource_user;
-}
-
-grpc_resource_quota* grpc_resource_user_quota(
- grpc_resource_user* resource_user) {
- return resource_user->resource_quota;
-}
-
-static void ru_ref_by(grpc_resource_user* resource_user, gpr_atm amount) {
- GPR_ASSERT(amount > 0);
- GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0);
-}
-
-static void ru_unref_by(grpc_resource_user* resource_user, gpr_atm amount) {
- GPR_ASSERT(amount > 0);
- gpr_atm old = gpr_atm_full_fetch_add(&resource_user->refs, -amount);
- GPR_ASSERT(old >= amount);
- if (old == amount) {
- resource_user->resource_quota->combiner->Run(
- &resource_user->destroy_closure, GRPC_ERROR_NONE);
- }
-}
-
-void grpc_resource_user_ref(grpc_resource_user* resource_user) {
- ru_ref_by(resource_user, 1);
-}
-
-void grpc_resource_user_unref(grpc_resource_user* resource_user) {
- ru_unref_by(resource_user, 1);
-}
-
-void grpc_resource_user_shutdown(grpc_resource_user* resource_user) {
- if (gpr_atm_full_fetch_add(&resource_user->shutdown, 1) == 0) {
- resource_user->resource_quota->combiner->Run(
- GRPC_CLOSURE_CREATE(ru_shutdown, resource_user, nullptr),
- GRPC_ERROR_NONE);
- }
-}
-
-bool grpc_resource_user_allocate_threads(grpc_resource_user* resource_user,
- int thread_count) {
- GPR_ASSERT(thread_count >= 0);
- bool is_success = false;
- gpr_mu_lock(&resource_user->resource_quota->thread_count_mu);
- grpc_resource_quota* rq = resource_user->resource_quota;
- if (rq->num_threads_allocated + thread_count <= rq->max_threads) {
- rq->num_threads_allocated += thread_count;
- gpr_atm_no_barrier_fetch_add(&resource_user->num_threads_allocated,
- thread_count);
- is_success = true;
- }
- gpr_mu_unlock(&resource_user->resource_quota->thread_count_mu);
- return is_success;
-}
-
-void grpc_resource_user_free_threads(grpc_resource_user* resource_user,
- int thread_count) {
- GPR_ASSERT(thread_count >= 0);
- gpr_mu_lock(&resource_user->resource_quota->thread_count_mu);
- grpc_resource_quota* rq = resource_user->resource_quota;
- rq->num_threads_allocated -= thread_count;
- int old_count = static_cast<int>(gpr_atm_no_barrier_fetch_add(
- &resource_user->num_threads_allocated, -thread_count));
- if (old_count < thread_count || rq->num_threads_allocated < 0) {
- gpr_log(GPR_ERROR,
- "Releasing more threads (%d) than currently allocated (rq threads: "
- "%d, ru threads: %d)",
- thread_count, rq->num_threads_allocated + thread_count, old_count);
- abort();
- }
- gpr_mu_unlock(&resource_user->resource_quota->thread_count_mu);
-}
-
-static bool resource_user_alloc_locked(grpc_resource_user* resource_user,
- size_t size,
- grpc_closure* optional_on_done) {
- ru_ref_by(resource_user, static_cast<gpr_atm>(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: alloc %" PRIdPTR "; free_pool -> %" PRId64,
- 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.
- if (optional_on_done != nullptr) {
- resource_user->outstanding_allocations += static_cast<int64_t>(size);
- grpc_closure_list_append(&resource_user->on_allocated, optional_on_done,
- GRPC_ERROR_NONE);
- }
- if (!resource_user->allocating) {
- resource_user->allocating = true;
- resource_user->resource_quota->combiner->Run(
- &resource_user->allocate_closure, GRPC_ERROR_NONE);
- }
- return false;
-}
-
-bool grpc_resource_user_safe_alloc(grpc_resource_user* resource_user,
- size_t size) {
- if (gpr_atm_no_barrier_load(&resource_user->shutdown)) return false;
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- bool cas_success;
- do {
- gpr_atm used = gpr_atm_no_barrier_load(&resource_quota->used);
- gpr_atm new_used = used + size;
- if (static_cast<size_t>(new_used) >
- grpc_resource_quota_peek_size(resource_quota)) {
- gpr_mu_unlock(&resource_user->mu);
- return false;
- }
- cas_success = gpr_atm_full_cas(&resource_quota->used, used, new_used);
- } while (!cas_success);
- resource_user_alloc_locked(resource_user, size, nullptr);
- gpr_mu_unlock(&resource_user->mu);
- return true;
-}
-
-bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
- grpc_closure* optional_on_done) {
- // TODO(juanlishen): Maybe return immediately if shutting down. Deferring this
- // because some tests become flaky after the change.
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- gpr_atm_no_barrier_fetch_add(&resource_quota->used, size);
- const bool ret =
- resource_user_alloc_locked(resource_user, size, optional_on_done);
- gpr_mu_unlock(&resource_user->mu);
- return ret;
-}
-
-void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size) {
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- gpr_atm prior = gpr_atm_no_barrier_fetch_add(&resource_quota->used, -size);
- GPR_ASSERT(prior >= static_cast<long>(size));
- bool was_zero_or_negative = resource_user->free_pool <= 0;
- 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);
- }
- bool is_bigger_than_zero = resource_user->free_pool > 0;
- if (is_bigger_than_zero && was_zero_or_negative &&
- !resource_user->added_to_free_pool) {
- resource_user->added_to_free_pool = true;
- resource_quota->combiner->Run(&resource_user->add_to_free_pool_closure,
- GRPC_ERROR_NONE);
- }
- gpr_mu_unlock(&resource_user->mu);
- ru_unref_by(resource_user, static_cast<gpr_atm>(size));
-}
-
-void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive,
- grpc_closure* closure) {
- GPR_ASSERT(resource_user->new_reclaimers[destructive] == nullptr);
- resource_user->new_reclaimers[destructive] = closure;
- resource_user->resource_quota->combiner->Run(
- &resource_user->post_reclaimer_closure[destructive], GRPC_ERROR_NONE);
-}
-
-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->combiner->Run(
- &resource_user->resource_quota->rq_reclamation_done_closure,
- GRPC_ERROR_NONE);
-}
-
-void grpc_resource_user_slice_allocator_init(
- grpc_resource_user_slice_allocator* slice_allocator,
- grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p) {
- GRPC_CLOSURE_INIT(&slice_allocator->on_allocated, ru_allocated_slices,
- slice_allocator, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&slice_allocator->on_done, cb, p,
- grpc_schedule_on_exec_ctx);
- slice_allocator->resource_user = resource_user;
-}
-
-bool grpc_resource_user_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator, size_t length,
- size_t count, grpc_slice_buffer* dest) {
- if (GPR_UNLIKELY(
- gpr_atm_no_barrier_load(&slice_allocator->resource_user->shutdown))) {
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION, &slice_allocator->on_allocated,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource user shutdown"));
- return false;
- }
- slice_allocator->length = length;
- slice_allocator->count = count;
- slice_allocator->dest = dest;
- const bool ret =
- grpc_resource_user_alloc(slice_allocator->resource_user, count * length,
- &slice_allocator->on_allocated);
- if (ret) ru_alloc_slices(slice_allocator);
- return ret;
-}
diff --git a/grpc/src/core/lib/iomgr/resource_quota.h b/grpc/src/core/lib/iomgr/resource_quota.h
deleted file mode 100644
index ec89a920..00000000
--- a/grpc/src/core/lib/iomgr/resource_quota.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *
- * 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_LIB_IOMGR_RESOURCE_QUOTA_H
-#define GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/closure.h"
-
-/** \file Tracks resource usage against a pool.
-
- The current implementation tracks only memory usage, but in the future
- this may be extended to (for example) threads and file descriptors.
-
- A grpc_resource_quota represents the pooled resources, and
- grpc_resource_user instances attach to the quota and consume those
- resources. They also offer a vector for reclamation: if we become
- resource constrained, grpc_resource_user instances are asked (in turn) to
- free up whatever they can so that the system as a whole can make progress.
-
- There are three kinds of reclamation that take place, in order of increasing
- invasiveness:
- - an internal reclamation, where cached resource at the resource user level
- is returned to the quota
- - a benign reclamation phase, whereby resources that are in use but are not
- helping anything make progress are reclaimed
- - a destructive reclamation, whereby resources that are helping something
- make progress may be enacted so that at least one part of the system can
- complete.
-
- Only one reclamation will be outstanding for a given quota at a given time.
- On each reclamation attempt, the kinds of reclamation are tried in order of
- increasing invasiveness, stopping at the first one that succeeds. Thus, on a
- given reclamation attempt, if internal and benign reclamation both fail, it
- will wind up doing a destructive reclamation. However, the next reclamation
- attempt may then be able to get what it needs via internal or benign
- reclamation, due to resources that may have been freed up by the destructive
- reclamation in the previous attempt.
-
- Future work will be to expose the current resource pressure so that back
- pressure can be applied to avoid reclamation phases starting.
-
- Resource users own references to resource quotas, and resource quotas
- maintain lists of users (which users arrange to leave before they are
- destroyed) */
-
-extern grpc_core::TraceFlag grpc_resource_quota_trace;
-
-// TODO(juanlishen): This is a hack. We need to do real accounting instead of
-// hard coding.
-constexpr size_t GRPC_RESOURCE_QUOTA_CALL_SIZE = 15 * 1024;
-constexpr size_t GRPC_RESOURCE_QUOTA_CHANNEL_SIZE = 50 * 1024;
-
-grpc_resource_quota* grpc_resource_quota_ref_internal(
- grpc_resource_quota* resource_quota);
-void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota);
-grpc_resource_quota* grpc_resource_quota_from_channel_args(
- const grpc_channel_args* channel_args, bool create = true);
-
-/* Return a number indicating current memory pressure:
- 0.0 ==> no memory usage
- 1.0 ==> maximum memory usage */
-double grpc_resource_quota_get_memory_pressure(
- grpc_resource_quota* resource_quota);
-
-size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota);
-
-typedef struct grpc_resource_user grpc_resource_user;
-
-grpc_resource_user* grpc_resource_user_create(
- grpc_resource_quota* resource_quota, const char* name);
-
-/* Returns a borrowed reference to the underlying resource quota for this
- resource user. */
-grpc_resource_quota* grpc_resource_user_quota(
- grpc_resource_user* resource_user);
-
-void grpc_resource_user_ref(grpc_resource_user* resource_user);
-void grpc_resource_user_unref(grpc_resource_user* resource_user);
-void grpc_resource_user_shutdown(grpc_resource_user* resource_user);
-
-/* Attempts to get quota from the resource_user to create 'thread_count' number
- * of threads. Returns true if successful (i.e the caller is now free to create
- * 'thread_count' number of threads) or false if quota is not available */
-bool grpc_resource_user_allocate_threads(grpc_resource_user* resource_user,
- int thread_count);
-/* Releases 'thread_count' worth of quota back to the resource user. The quota
- * should have been previously obtained successfully by calling
- * grpc_resource_user_allocate_threads().
- *
- * Note: There need not be an exact one-to-one correspondence between
- * grpc_resource_user_allocate_threads() and grpc_resource_user_free_threads()
- * calls. The only requirement is that the number of threads allocated should
- * all be eventually released */
-void grpc_resource_user_free_threads(grpc_resource_user* resource_user,
- int thread_count);
-
-/* Allocates from the resource user 'size' worth of memory if this won't exceed
- * the resource quota's total size. Returns whether the allocation is done
- * successfully. If allocated successfully, the memory should be freed by the
- * caller eventually. */
-bool grpc_resource_user_safe_alloc(grpc_resource_user* resource_user,
- size_t size);
-/* Allocates from the resource user 'size' worth of memory.
- * If optional_on_done is NULL, then allocate immediately. This may push the
- * quota over-limit, at which point reclamation will kick in. The caller is
- * always responsible to free the memory eventually.
- * Returns true if the allocation was successful. Otherwise, if optional_on_done
- * is non-NULL, it will be scheduled without error when the allocation has been
- * granted by the quota, and the caller is responsible to free the memory
- * eventually. Or it may be scheduled with an error, in which case the caller
- * fails to allocate the memory and shouldn't free the memory.
- */
-bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
- grpc_closure* optional_on_done)
- GRPC_MUST_USE_RESULT;
-/* Release memory back to the quota */
-void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size);
-/* Post a memory reclaimer to the resource user. Only one benign and one
- destructive reclaimer can be posted at once. When executed, the reclaimer
- MUST call grpc_resource_user_finish_reclamation before it completes, to
- return control to the resource quota. */
-void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive, grpc_closure* closure);
-/* Finish a reclamation step */
-void grpc_resource_user_finish_reclamation(grpc_resource_user* resource_user);
-
-/* Helper to allocate slices from a resource user */
-typedef struct grpc_resource_user_slice_allocator {
- /* Closure for when a resource user allocation completes */
- grpc_closure on_allocated;
- /* Closure to call when slices have been allocated */
- grpc_closure on_done;
- /* Length of slices to allocate on the current request */
- size_t length;
- /* Number of slices to allocate on the current request */
- size_t count;
- /* Destination for slices to allocate on the current request */
- grpc_slice_buffer* dest;
- /* Parent resource user */
- grpc_resource_user* resource_user;
-} grpc_resource_user_slice_allocator;
-
-/* Initialize a slice allocator.
- When an allocation is completed, calls \a cb with arg \p. */
-void grpc_resource_user_slice_allocator_init(
- grpc_resource_user_slice_allocator* slice_allocator,
- grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p);
-
-/* Allocate \a count slices of length \a length into \a dest. Only one request
- can be outstanding at a time.
- Returns whether the slice was allocated inline in the function. If true,
- the \a slice_allocator->on_allocated callback will not be called. */
-bool grpc_resource_user_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator, size_t length,
- size_t count, grpc_slice_buffer* dest) GRPC_MUST_USE_RESULT;
-
-#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
diff --git a/grpc/src/core/lib/iomgr/sockaddr.h b/grpc/src/core/lib/iomgr/sockaddr.h
index 5edf735c..7abb82dd 100644
--- a/grpc/src/core/lib/iomgr/sockaddr.h
+++ b/grpc/src/core/lib/iomgr/sockaddr.h
@@ -25,7 +25,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/sockaddr_custom.h"
+#include "src/core/lib/event_engine/sockaddr.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/sockaddr_posix.h"
#include "src/core/lib/iomgr/sockaddr_windows.h"
diff --git a/grpc/src/core/lib/iomgr/sockaddr_custom.h b/grpc/src/core/lib/iomgr/sockaddr_custom.h
deleted file mode 100644
index d85cc504..00000000
--- a/grpc/src/core/lib/iomgr/sockaddr_custom.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * 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_IOMGR_SOCKADDR_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stddef.h>
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#include <uv.h>
-
-// TODO(kpayson) It would be nice to abstract this so we don't
-// depend on anything uv specific
-typedef struct sockaddr grpc_sockaddr;
-typedef struct sockaddr_in grpc_sockaddr_in;
-typedef struct in_addr grpc_in_addr;
-typedef struct sockaddr_in6 grpc_sockaddr_in6;
-typedef struct in6_addr grpc_in6_addr;
-
-#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
-#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
-
-#define GRPC_SOCK_STREAM SOCK_STREAM
-#define GRPC_SOCK_DGRAM SOCK_DGRAM
-
-#define GRPC_AF_UNSPEC AF_UNSPEC
-#define GRPC_AF_UNIX AF_UNIX
-#define GRPC_AF_INET AF_INET
-#define GRPC_AF_INET6 AF_INET6
-
-#define GRPC_AI_PASSIVE AI_PASSIVE
-
-#endif // GRPC_UV
-
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/sockaddr_utils_posix.cc b/grpc/src/core/lib/iomgr/sockaddr_utils_posix.cc
new file mode 100644
index 00000000..ba9a6c73
--- /dev/null
+++ b/grpc/src/core/lib/iomgr/sockaddr_utils_posix.cc
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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/lib/iomgr/port.h"
+
+#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
+
+#include "src/core/lib/iomgr/socket_utils.h"
+#ifdef GRPC_LINUX_TCP_H
+#include <linux/tcp.h>
+#else
+#include <netinet/tcp.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <string>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/iomgr/sockaddr.h"
+
+uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
+
+uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
+
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
+int grpc_inet_pton(int af, const char* src, void* dst) {
+ return inet_pton(af, src, dst);
+}
+
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
+ GPR_ASSERT(size <= (socklen_t)-1);
+ return inet_ntop(af, src, dst, static_cast<socklen_t>(size));
+}
+
+#endif
diff --git a/grpc/src/core/lib/iomgr/socket_factory_posix.cc b/grpc/src/core/lib/iomgr/socket_factory_posix.cc
index 8d1bd71a..11f86569 100644
--- a/grpc/src/core/lib/iomgr/socket_factory_posix.cc
+++ b/grpc/src/core/lib/iomgr/socket_factory_posix.cc
@@ -22,13 +22,13 @@
#ifdef GRPC_POSIX_SOCKET_SOCKET_FACTORY
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/socket_factory_posix.h"
-#include <grpc/impl/codegen/grpc_types.h>
-#include <grpc/support/sync.h>
-
void grpc_socket_factory_init(grpc_socket_factory* factory,
const grpc_socket_factory_vtable* vtable) {
factory->vtable = vtable;
@@ -47,11 +47,11 @@ int grpc_socket_factory_bind(grpc_socket_factory* factory, int sockfd,
int grpc_socket_factory_compare(grpc_socket_factory* a,
grpc_socket_factory* b) {
- int c = GPR_ICMP(a, b);
+ int c = grpc_core::QsortCompare(a, b);
if (c != 0) {
grpc_socket_factory* sma = a;
grpc_socket_factory* smb = b;
- c = GPR_ICMP(sma->vtable, smb->vtable);
+ c = grpc_core::QsortCompare(sma->vtable, smb->vtable);
if (c == 0) {
c = sma->vtable->compare(sma, smb);
}
diff --git a/grpc/src/core/lib/iomgr/socket_factory_posix.h b/grpc/src/core/lib/iomgr/socket_factory_posix.h
index 92ea6c16..287ae5f0 100644
--- a/grpc/src/core/lib/iomgr/socket_factory_posix.h
+++ b/grpc/src/core/lib/iomgr/socket_factory_posix.h
@@ -23,6 +23,7 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
+
#include "src/core/lib/iomgr/resolve_address.h"
/** The virtual table of grpc_socket_factory */
diff --git a/grpc/src/core/lib/iomgr/socket_mutator.cc b/grpc/src/core/lib/iomgr/socket_mutator.cc
index 918754ad..b908e22f 100644
--- a/grpc/src/core/lib/iomgr/socket_mutator.cc
+++ b/grpc/src/core/lib/iomgr/socket_mutator.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/iomgr/socket_mutator.h"
#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/channel/channel_args.h"
@@ -37,17 +38,29 @@ grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator) {
return mutator;
}
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd) {
- return mutator->vtable->mutate_fd(fd, mutator);
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd,
+ grpc_fd_usage usage) {
+ if (mutator->vtable->mutate_fd_2 != nullptr) {
+ grpc_mutate_socket_info info{fd, usage};
+ return mutator->vtable->mutate_fd_2(&info, mutator);
+ }
+ switch (usage) {
+ case GRPC_FD_SERVER_CONNECTION_USAGE:
+ return true;
+ case GRPC_FD_CLIENT_CONNECTION_USAGE:
+ case GRPC_FD_SERVER_LISTENER_USAGE:
+ return mutator->vtable->mutate_fd(fd, mutator);
+ }
+ GPR_UNREACHABLE_CODE(return false);
}
int grpc_socket_mutator_compare(grpc_socket_mutator* a,
grpc_socket_mutator* b) {
- int c = GPR_ICMP(a, b);
+ int c = grpc_core::QsortCompare(a, b);
if (c != 0) {
grpc_socket_mutator* sma = a;
grpc_socket_mutator* smb = b;
- c = GPR_ICMP(sma->vtable, smb->vtable);
+ c = grpc_core::QsortCompare(sma->vtable, smb->vtable);
if (c == 0) {
c = sma->vtable->compare(sma, smb);
}
diff --git a/grpc/src/core/lib/iomgr/socket_mutator.h b/grpc/src/core/lib/iomgr/socket_mutator.h
index 9f77a3b2..f7564da5 100644
--- a/grpc/src/core/lib/iomgr/socket_mutator.h
+++ b/grpc/src/core/lib/iomgr/socket_mutator.h
@@ -21,20 +21,43 @@
#include <grpc/support/port_platform.h>
+#include <stdbool.h>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
-#include <stdbool.h>
+/** How is an fd to be used? */
+typedef enum {
+ /** Used for client connection */
+ GRPC_FD_CLIENT_CONNECTION_USAGE,
+ /** Used for server listening */
+ GRPC_FD_SERVER_LISTENER_USAGE,
+ /** Used for server connection */
+ GRPC_FD_SERVER_CONNECTION_USAGE,
+} grpc_fd_usage;
+
+/** Information about an fd to mutate */
+typedef struct {
+ /** File descriptor to mutate */
+ int fd;
+ /** How the fd will be used */
+ grpc_fd_usage usage;
+} grpc_mutate_socket_info;
/** The virtual table of grpc_socket_mutator */
struct grpc_socket_mutator_vtable {
- /** Mutates the socket options of \a fd */
+ /** Mutates the socket options of \a fd -- deprecated, prefer mutate_fd_2 */
bool (*mutate_fd)(int fd, grpc_socket_mutator* mutator);
/** Compare socket mutator \a a and \a b */
int (*compare)(grpc_socket_mutator* a, grpc_socket_mutator* b);
/** Destroys the socket mutator instance */
void (*destroy)(grpc_socket_mutator* mutator);
+ /** Mutates the socket options of the fd in \a info - if set takes preference
+ * to mutate_fd */
+ bool (*mutate_fd_2)(const grpc_mutate_socket_info* info,
+ grpc_socket_mutator* mutator);
};
+
/** The Socket Mutator interface allows changes on socket options */
struct grpc_socket_mutator {
const grpc_socket_mutator_vtable* vtable;
@@ -49,7 +72,8 @@ void grpc_socket_mutator_init(grpc_socket_mutator* mutator,
grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator* mutator);
/** Perform the file descriptor mutation operation of \a mutator on \a fd */
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd);
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd,
+ grpc_fd_usage usage);
/** Compare if \a a and \a b are the same mutator or have same settings */
int grpc_socket_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b);
diff --git a/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc b/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
index e8c9ee19..75e837b4 100644
--- a/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
+++ b/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
@@ -22,14 +22,14 @@
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
-#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <netinet/in.h>
+
+#include "src/core/lib/iomgr/socket_utils.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
#ifdef GRPC_LINUX_TCP_H
#include <linux/tcp.h>
#else
@@ -388,17 +388,17 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout(
}
/* set a socket using a grpc_socket_mutator */
-grpc_error_handle grpc_set_socket_with_mutator(int fd,
+grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage,
grpc_socket_mutator* mutator) {
GPR_ASSERT(mutator);
- if (!grpc_socket_mutator_mutate_fd(mutator, fd)) {
+ if (!grpc_socket_mutator_mutate_fd(mutator, fd, usage)) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("grpc_socket_mutator failed.");
}
return GRPC_ERROR_NONE;
}
grpc_error_handle grpc_apply_socket_mutator_in_args(
- int fd, const grpc_channel_args* args) {
+ int fd, grpc_fd_usage usage, const grpc_channel_args* args) {
const grpc_arg* socket_mutator_arg =
grpc_channel_args_find(args, GRPC_ARG_SOCKET_MUTATOR);
if (socket_mutator_arg == nullptr) {
@@ -407,7 +407,7 @@ grpc_error_handle grpc_apply_socket_mutator_in_args(
GPR_DEBUG_ASSERT(socket_mutator_arg->type == GRPC_ARG_POINTER);
grpc_socket_mutator* mutator =
static_cast<grpc_socket_mutator*>(socket_mutator_arg->value.pointer.p);
- return grpc_set_socket_with_mutator(fd, mutator);
+ return grpc_set_socket_with_mutator(fd, usage, mutator);
}
static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT;
@@ -443,8 +443,7 @@ static grpc_error_handle error_for_fd(int fd,
if (fd >= 0) return GRPC_ERROR_NONE;
std::string addr_str = grpc_sockaddr_to_string(addr, false);
grpc_error_handle err = grpc_error_set_str(
- GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(addr_str.c_str()));
+ GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS, addr_str);
return err;
}
@@ -496,21 +495,4 @@ grpc_error_handle grpc_create_dualstack_socket_using_factory(
return error_for_fd(*newfd, resolved_addr);
}
-uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
-
-uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
-
-uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
-
-uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
-
-int grpc_inet_pton(int af, const char* src, void* dst) {
- return inet_pton(af, src, dst);
-}
-
-const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
- GPR_ASSERT(size <= (socklen_t)-1);
- return inet_ntop(af, src, dst, static_cast<socklen_t>(size));
-}
-
#endif
diff --git a/grpc/src/core/lib/iomgr/socket_utils_linux.cc b/grpc/src/core/lib/iomgr/socket_utils_linux.cc
index 34f93cc4..ef5d975b 100644
--- a/grpc/src/core/lib/iomgr/socket_utils_linux.cc
+++ b/grpc/src/core/lib/iomgr/socket_utils_linux.cc
@@ -22,13 +22,13 @@
#ifdef GRPC_LINUX_SOCKETUTILS
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include <sys/socket.h>
+#include <sys/types.h>
#include <grpc/support/log.h>
-#include <sys/socket.h>
-#include <sys/types.h>
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
diff --git a/grpc/src/core/lib/iomgr/socket_utils_posix.cc b/grpc/src/core/lib/iomgr/socket_utils_posix.cc
index c48da52f..333e60db 100644
--- a/grpc/src/core/lib/iomgr/socket_utils_posix.cc
+++ b/grpc/src/core/lib/iomgr/socket_utils_posix.cc
@@ -22,14 +22,14 @@
#ifdef GRPC_POSIX_SOCKETUTILS
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
#include <fcntl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
diff --git a/grpc/src/core/lib/iomgr/socket_utils_posix.h b/grpc/src/core/lib/iomgr/socket_utils_posix.h
index 13c22bc0..d79a4a15 100644
--- a/grpc/src/core/lib/iomgr/socket_utils_posix.h
+++ b/grpc/src/core/lib/iomgr/socket_utils_posix.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <sys/socket.h>
#include <unistd.h>
#include <grpc/impl/codegen/grpc_types.h>
+
#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/socket_factory_posix.h"
#include "src/core/lib/iomgr/socket_mutator.h"
@@ -101,12 +101,12 @@ grpc_error_handle grpc_set_socket_sndbuf(int fd, int buffer_size_bytes);
grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes);
/* Tries to set the socket using a grpc_socket_mutator */
-grpc_error_handle grpc_set_socket_with_mutator(int fd,
+grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage,
grpc_socket_mutator* mutator);
/* Extracts the first socket mutator from args if any and applies on the fd. */
grpc_error_handle grpc_apply_socket_mutator_in_args(
- int fd, const grpc_channel_args* args);
+ int fd, grpc_fd_usage usage, const grpc_channel_args* args);
/* An enum to keep track of IPv4/IPv6 socket modes.
diff --git a/grpc/src/core/lib/iomgr/socket_utils_uv.cc b/grpc/src/core/lib/iomgr/socket_utils_uv.cc
deleted file mode 100644
index b5f96b52..00000000
--- a/grpc/src/core/lib/iomgr/socket_utils_uv.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#ifdef GRPC_UV
-
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
-
-#include <grpc/support/log.h>
-
-#include <uv.h>
-
-uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
-
-uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
-
-uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
-
-uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
-
-int grpc_inet_pton(int af, const char* src, void* dst) {
- return inet_pton(af, src, dst);
-}
-
-const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
- uv_inet_ntop(af, src, dst, size);
- return dst;
-}
-
-#endif /* GRPC_UV */
diff --git a/grpc/src/core/lib/iomgr/socket_utils_windows.cc b/grpc/src/core/lib/iomgr/socket_utils_windows.cc
index 9137ab98..4f483f07 100644
--- a/grpc/src/core/lib/iomgr/socket_utils_windows.cc
+++ b/grpc/src/core/lib/iomgr/socket_utils_windows.cc
@@ -22,11 +22,11 @@
#ifdef GRPC_WINDOWS_SOCKETUTILS
+#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
-#include <grpc/support/log.h>
-
uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
diff --git a/grpc/src/core/lib/iomgr/sys_epoll_wrapper.h b/grpc/src/core/lib/iomgr/sys_epoll_wrapper.h
deleted file mode 100644
index d21d8536..00000000
--- a/grpc/src/core/lib/iomgr/sys_epoll_wrapper.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_SYS_EPOLL_WRAPPER_H
-#define GRPC_CORE_LIB_IOMGR_SYS_EPOLL_WRAPPER_H
-
-#include <grpc/support/port_platform.h>
-
-#include <sys/epoll.h>
-
-#ifndef EPOLLEXCLUSIVE
-#define EPOLLEXCLUSIVE (1 << 28)
-#endif
-
-#endif /* GRPC_CORE_LIB_IOMGR_SYS_EPOLL_WRAPPER_H */
diff --git a/grpc/src/core/lib/iomgr/tcp_client.cc b/grpc/src/core/lib/iomgr/tcp_client.cc
index 3441a63c..f252f207 100644
--- a/grpc/src/core/lib/iomgr/tcp_client.cc
+++ b/grpc/src/core/lib/iomgr/tcp_client.cc
@@ -26,7 +26,7 @@ void grpc_tcp_client_connect(grpc_closure* on_connect, grpc_endpoint** endpoint,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
grpc_tcp_client_impl->connect(on_connect, endpoint, interested_parties,
channel_args, addr, deadline);
}
diff --git a/grpc/src/core/lib/iomgr/tcp_client.h b/grpc/src/core/lib/iomgr/tcp_client.h
index d209eeb8..1dfb8d25 100644
--- a/grpc/src/core/lib/iomgr/tcp_client.h
+++ b/grpc/src/core/lib/iomgr/tcp_client.h
@@ -23,15 +23,18 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
typedef struct grpc_tcp_client_vtable {
void (*connect)(grpc_closure* on_connect, grpc_endpoint** endpoint,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
- const grpc_resolved_address* addr, grpc_millis deadline);
+ const grpc_resolved_address* addr,
+ grpc_core::Timestamp deadline);
} grpc_tcp_client_vtable;
/* Asynchronously connect to an address (specified as (addr, len)), and call
@@ -43,7 +46,7 @@ void grpc_tcp_client_connect(grpc_closure* on_connect, grpc_endpoint** endpoint,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
- grpc_millis deadline);
+ grpc_core::Timestamp deadline);
void grpc_tcp_client_global_init();
diff --git a/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc b/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
index 5c0a95e5..b6e89420 100644
--- a/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
+++ b/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -24,15 +24,13 @@
#ifdef GRPC_CFSTREAM_CLIENT
#include <CoreFoundation/CoreFoundation.h>
-
+#include <netinet/in.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include <netinet/in.h>
-
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/host_port.h"
@@ -66,11 +64,9 @@ struct CFStreamConnect {
grpc_endpoint** endpoint;
int refs;
std::string addr_name;
- grpc_resource_quota* resource_quota;
};
static void CFStreamConnectCleanup(CFStreamConnect* connect) {
- grpc_resource_quota_unref_internal(connect->resource_quota);
CFSTREAM_HANDLE_UNREF(connect->stream_handle, "async connect clean up");
CFRelease(connect->read_stream);
CFRelease(connect->write_stream);
@@ -81,7 +77,8 @@ static void CFStreamConnectCleanup(CFStreamConnect* connect) {
static void OnAlarm(void* arg, grpc_error_handle error) {
CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%p", connect, error);
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%s", connect,
+ grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&connect->mu);
grpc_closure* closure = connect->closure;
@@ -102,7 +99,8 @@ static void OnAlarm(void* arg, grpc_error_handle error) {
static void OnOpen(void* arg, grpc_error_handle error) {
CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%p", connect, error);
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%s", connect,
+ grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&connect->mu);
grpc_timer_cancel(&connect->alarm);
@@ -130,11 +128,10 @@ static void OnOpen(void* arg, grpc_error_handle 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->addr_name.c_str(), connect->stream_handle);
}
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
gpr_mu_unlock(&connect->mu);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
@@ -156,12 +153,11 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
const grpc_resolved_address* resolved_addr,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
CFStreamConnect* connect = new CFStreamConnect();
connect->closure = closure;
connect->endpoint = ep;
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
- // connect->resource_quota = resource_quota;
connect->refs = 2; // One for the connect operation, one for the timer.
gpr_ref_init(&connect->refcount, 1);
gpr_mu_init(&connect->mu);
@@ -171,18 +167,6 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
connect, connect->addr_name.c_str());
}
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
- if (channel_args != NULL) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota = grpc_resource_quota_ref_internal(
- (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
- }
- }
- }
- connect->resource_quota = resource_quota;
-
CFReadStreamRef read_stream;
CFWriteStreamRef write_stream;
diff --git a/grpc/src/core/lib/iomgr/tcp_client_custom.cc b/grpc/src/core/lib/iomgr/tcp_client_custom.cc
deleted file mode 100644
index d54a5f03..00000000
--- a/grpc/src/core/lib/iomgr/tcp_client_custom.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/tcp_client.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/timer.h"
-
-extern grpc_core::TraceFlag grpc_tcp_trace;
-extern grpc_socket_vtable* grpc_custom_socket_vtable;
-
-struct grpc_custom_tcp_connect {
- grpc_custom_socket* socket;
- grpc_timer alarm;
- grpc_closure on_alarm;
- grpc_closure* closure;
- grpc_endpoint** endpoint;
- int refs;
- std::string 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;
- socket->refs--;
- if (socket->refs == 0) {
- grpc_custom_socket_vtable->destroy(socket);
- gpr_free(socket);
- }
-}
-
-static void custom_close_callback(grpc_custom_socket* /*socket*/) {}
-
-static void on_alarm(void* acp, grpc_error_handle error) {
- int done;
- grpc_custom_socket* socket = static_cast<grpc_custom_socket*>(acp);
- grpc_custom_tcp_connect* connect = socket->connector;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
- connect->addr_name.c_str(), grpc_error_std_string(error).c_str());
- }
- if (error == GRPC_ERROR_NONE) {
- /* error == NONE implies that the timer ran out, and wasn't cancelled. If
- it was cancelled, then the handler that cancelled it also should close
- the handle, if applicable */
- grpc_custom_socket_vtable->close(socket, custom_close_callback);
- }
- done = (--connect->refs == 0);
- if (done) {
- custom_tcp_connect_cleanup(connect);
- }
-}
-
-static void custom_connect_callback_internal(grpc_custom_socket* socket,
- grpc_error_handle error) {
- grpc_custom_tcp_connect* connect = socket->connector;
- int done;
- grpc_closure* closure = connect->closure;
- 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());
- }
- done = (--connect->refs == 0);
- if (done) {
- grpc_core::ExecCtx::Get()->Flush();
- custom_tcp_connect_cleanup(connect);
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
-}
-
-static void custom_connect_callback(grpc_custom_socket* socket,
- grpc_error_handle error) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- if (grpc_core::ExecCtx::Get() == nullptr) {
- /* If we are being run on a thread which does not have an exec_ctx created
- * yet, we should create one. */
- grpc_core::ExecCtx exec_ctx;
- custom_connect_callback_internal(socket, error);
- } else {
- custom_connect_callback_internal(socket, error);
- }
-}
-
-static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
- grpc_pollset_set* interested_parties,
- const grpc_channel_args* channel_args,
- const grpc_resolved_address* resolved_addr,
- grpc_millis deadline) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- (void)channel_args;
- (void)interested_parties;
- 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++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota =
- grpc_resource_quota_ref_internal(static_cast<grpc_resource_quota*>(
- channel_args->args[i].value.pointer.p));
- }
- }
- }
- grpc_custom_socket* socket =
- static_cast<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();
- connect->closure = closure;
- connect->endpoint = ep;
- connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
- connect->resource_quota = resource_quota;
- connect->socket = socket;
- socket->connector = connect;
- socket->endpoint = nullptr;
- socket->listener = nullptr;
- connect->refs = 2;
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "CLIENT_CONNECT: %p %s: asynchronously connecting",
- socket, connect->addr_name.c_str());
- }
-
- GRPC_CLOSURE_INIT(&connect->on_alarm, on_alarm, socket,
- grpc_schedule_on_exec_ctx);
- grpc_timer_init(&connect->alarm, deadline, &connect->on_alarm);
- grpc_custom_socket_vtable->connect(
- socket, reinterpret_cast<const grpc_sockaddr*>(resolved_addr->addr),
- resolved_addr->len, custom_connect_callback);
-}
-
-grpc_tcp_client_vtable custom_tcp_client_vtable = {tcp_connect};
diff --git a/grpc/src/core/lib/iomgr/tcp_client_posix.cc b/grpc/src/core/lib/iomgr/tcp_client_posix.cc
index 741cc6af..92e9c70d 100644
--- a/grpc/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/grpc/src/core/lib/iomgr/tcp_client_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_TCP_CLIENT
-#include "src/core/lib/iomgr/tcp_client_posix.h"
-
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
@@ -39,10 +37,12 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_mutator.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/tcp_client_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
@@ -87,7 +87,8 @@ static grpc_error_handle prepare_socket(const grpc_resolved_address* addr,
err = grpc_set_socket_no_sigpipe_if_possible(fd);
if (err != GRPC_ERROR_NONE) goto error;
- err = grpc_apply_socket_mutator_in_args(fd, channel_args);
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_CLIENT_CONNECTION_USAGE,
+ channel_args);
if (err != GRPC_ERROR_NONE) goto error;
goto done;
@@ -122,7 +123,8 @@ static void tc_on_alarm(void* acp, grpc_error_handle error) {
}
grpc_endpoint* grpc_tcp_client_create_from_fd(
- grpc_fd* fd, const grpc_channel_args* channel_args, const char* addr_str) {
+ grpc_fd* fd, const grpc_channel_args* channel_args,
+ absl::string_view addr_str) {
return grpc_tcp_create(fd, channel_args, addr_str);
}
@@ -134,9 +136,10 @@ static void on_writable(void* acp, grpc_error_handle error) {
int done;
grpc_endpoint** ep = ac->ep;
grpc_closure* closure = ac->closure;
+ std::string addr_str = ac->addr_str;
grpc_fd* fd;
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s",
@@ -154,8 +157,7 @@ static void on_writable(void* acp, grpc_error_handle error) {
gpr_mu_lock(&ac->mu);
if (error != GRPC_ERROR_NONE) {
error =
- grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string("Timeout occurred"));
+ grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR, "Timeout occurred");
goto finish;
}
@@ -172,8 +174,7 @@ static void on_writable(void* acp, grpc_error_handle 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);
fd = nullptr;
break;
case ENOBUFS:
@@ -213,23 +214,15 @@ finish:
fd = nullptr;
}
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);
gpr_mu_unlock(&ac->mu);
if (error != GRPC_ERROR_NONE) {
- grpc_slice str;
+ std::string str;
bool ret = grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &str);
GPR_ASSERT(ret);
- std::string description = 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 {
- grpc_slice_unref_internal(addr_str_slice);
+ std::string description =
+ absl::StrCat("Failed to connect to remote host: ", str);
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION, description);
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, addr_str);
}
if (done) {
// This is safe even outside the lock, because "done", the sentinel, is
@@ -238,7 +231,10 @@ finish:
grpc_channel_args_destroy(ac->channel_args);
delete ac;
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
+ // Push async connect closure to the executor since this may actually be
+ // called during the shutdown process, in which case a deadlock could form
+ // between the core shutdown mu and the connector mu (b/188239051)
+ grpc_core::Executor::Run(closure, error);
}
grpc_error_handle grpc_tcp_client_prepare_fd(
@@ -274,7 +270,7 @@ grpc_error_handle grpc_tcp_client_prepare_fd(
void grpc_tcp_client_create_from_prepared_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) {
+ grpc_core::Timestamp deadline, grpc_endpoint** ep) {
int err;
do {
err = connect(fd, reinterpret_cast<const grpc_sockaddr*>(addr->addr),
@@ -286,15 +282,14 @@ void grpc_tcp_client_create_from_prepared_fd(
if (err >= 0) {
*ep = grpc_tcp_client_create_from_fd(fdobj, channel_args,
- grpc_sockaddr_to_uri(addr).c_str());
+ grpc_sockaddr_to_uri(addr));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
return;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
grpc_error_handle 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)));
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_sockaddr_to_uri(addr));
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return;
@@ -330,7 +325,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
grpc_resolved_address mapped_addr;
int fd = -1;
grpc_error_handle error;
diff --git a/grpc/src/core/lib/iomgr/tcp_client_posix.h b/grpc/src/core/lib/iomgr/tcp_client_posix.h
index 2467f374..eb87b9fb 100644
--- a/grpc/src/core/lib/iomgr/tcp_client_posix.h
+++ b/grpc/src/core/lib/iomgr/tcp_client_posix.h
@@ -30,10 +30,12 @@
fd: a connected FD. Ownership is taken.
channel_args: may contain custom settings for the endpoint
addr_str: destination address in printable format
+ slice_allocator: ownership is taken by client.
Returns: a new endpoint
*/
grpc_endpoint* grpc_tcp_client_create_from_fd(
- grpc_fd* fd, const grpc_channel_args* channel_args, const char* addr_str);
+ grpc_fd* fd, const grpc_channel_args* channel_args,
+ absl::string_view addr_str);
/* Return a configured, unbound, unconnected TCP client fd.
@@ -62,6 +64,6 @@ grpc_error_handle grpc_tcp_client_prepare_fd(
void grpc_tcp_client_create_from_prepared_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);
+ grpc_core::Timestamp deadline, grpc_endpoint** ep);
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */
diff --git a/grpc/src/core/lib/iomgr/tcp_client_windows.cc b/grpc/src/core/lib/iomgr/tcp_client_windows.cc
index ef260cad..2c0b28ee 100644
--- a/grpc/src/core/lib/iomgr/tcp_client_windows.cc
+++ b/grpc/src/core/lib/iomgr/tcp_client_windows.cc
@@ -18,13 +18,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <inttypes.h>
-#ifdef GRPC_WINSOCK_SOCKET
+#include "src/core/lib/iomgr/port.h"
-#include "src/core/lib/iomgr/sockaddr_windows.h"
+#ifdef GRPC_WINSOCK_SOCKET
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
@@ -35,6 +33,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -83,7 +82,7 @@ static void on_connect(void* acp, grpc_error_handle error) {
GPR_ASSERT(*ep == NULL);
grpc_closure* on_done = ac->on_done;
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
gpr_mu_lock(&ac->mu);
grpc_winsocket* socket = ac->socket;
@@ -106,8 +105,8 @@ static void on_connect(void* acp, grpc_error_handle error) {
error = GRPC_WSA_ERROR(WSAGetLastError(), "ConnectEx");
closesocket(socket->socket);
} else {
- *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name.c_str());
- socket = NULL;
+ *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name);
+ socket = nullptr;
}
} else {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("socket is null");
@@ -126,7 +125,7 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
grpc_pollset_set* interested_parties,
const grpc_channel_args* channel_args,
const grpc_resolved_address* addr,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
SOCKET sock = INVALID_SOCKET;
BOOL success;
int status;
@@ -206,8 +205,10 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
GRPC_CLOSURE_INIT(&ac->on_connect, on_connect, ac, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&ac->on_alarm, on_alarm, ac, grpc_schedule_on_exec_ctx);
+ gpr_mu_lock(&ac->mu);
grpc_timer_init(&ac->alarm, deadline, &ac->on_alarm);
grpc_socket_notify_on_write(socket, &ac->on_connect);
+ gpr_mu_unlock(&ac->mu);
return;
failure:
@@ -216,8 +217,7 @@ failure:
grpc_error_handle 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_ERROR_STR_TARGET_ADDRESS, target_uri);
GRPC_ERROR_UNREF(error);
if (socket != NULL) {
grpc_winsocket_destroy(socket);
diff --git a/grpc/src/core/lib/iomgr/tcp_custom.cc b/grpc/src/core/lib/iomgr/tcp_custom.cc
deleted file mode 100644
index c526a957..00000000
--- a/grpc/src/core/lib/iomgr/tcp_custom.cc
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/slice_buffer.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#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/tcp_client.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/tcp_server.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-
-#define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192
-
-extern grpc_core::TraceFlag grpc_tcp_trace;
-
-grpc_socket_vtable* grpc_custom_socket_vtable = nullptr;
-extern grpc_tcp_server_vtable custom_tcp_server_vtable;
-extern grpc_tcp_client_vtable custom_tcp_client_vtable;
-
-void grpc_custom_endpoint_init(grpc_socket_vtable* impl) {
- grpc_custom_socket_vtable = impl;
- grpc_set_tcp_client_impl(&custom_tcp_client_vtable);
- grpc_set_tcp_server_impl(&custom_tcp_server_vtable);
-}
-
-struct custom_tcp_endpoint {
- grpc_endpoint base;
- gpr_refcount refcount;
- grpc_custom_socket* socket;
-
- grpc_closure* read_cb = nullptr;
- grpc_closure* write_cb = 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;
-
- std::string peer_string;
- std::string local_address;
-};
-static void tcp_free(grpc_custom_socket* s) {
- custom_tcp_endpoint* tcp =
- reinterpret_cast<custom_tcp_endpoint*>(s->endpoint);
- grpc_resource_user_unref(tcp->resource_user);
- delete tcp;
- s->refs--;
- if (s->refs == 0) {
- grpc_custom_socket_vtable->destroy(s);
- gpr_free(s);
- }
-}
-
-#ifndef NDEBUG
-#define TCP_UNREF(tcp, reason) tcp_unref((tcp), (reason), __FILE__, __LINE__)
-#define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__)
-static void tcp_unref(custom_tcp_endpoint* tcp, const char* reason,
- const char* file, int line) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
- gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
- "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp->socket, reason,
- val, val - 1);
- }
- if (gpr_unref(&tcp->refcount)) {
- tcp_free(tcp->socket);
- }
-}
-
-static void tcp_ref(custom_tcp_endpoint* tcp, const char* reason,
- const char* file, int line) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count);
- gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
- "TCP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp->socket, reason,
- val, val + 1);
- }
- gpr_ref(&tcp->refcount);
-}
-#else
-#define TCP_UNREF(tcp, reason) tcp_unref((tcp))
-#define TCP_REF(tcp, reason) tcp_ref((tcp))
-static void tcp_unref(custom_tcp_endpoint* tcp) {
- if (gpr_unref(&tcp->refcount)) {
- tcp_free(tcp->socket);
- }
-}
-
-static void tcp_ref(custom_tcp_endpoint* tcp) { gpr_ref(&tcp->refcount); }
-#endif
-
-static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error_handle error) {
- grpc_closure* cb = tcp->read_cb;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp->socket, cb, cb->cb,
- cb->cb_arg);
- size_t i;
- gpr_log(GPR_INFO, "read: error=%s", grpc_error_std_string(error).c_str());
- 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_free(dump);
- }
- }
- TCP_UNREF(tcp, "read");
- tcp->read_slices = nullptr;
- tcp->read_cb = nullptr;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
-}
-
-static void custom_read_callback(grpc_custom_socket* socket, size_t nread,
- grpc_error_handle error) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- grpc_slice_buffer garbage;
- custom_tcp_endpoint* tcp =
- reinterpret_cast<custom_tcp_endpoint*>(socket->endpoint);
- if (error == GRPC_ERROR_NONE && nread == 0) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("EOF");
- }
- if (error == GRPC_ERROR_NONE) {
- // Successful read
- if (nread < tcp->read_slices->length) {
- /* TODO(murgatroid99): Instead of discarding the unused part of the read
- * buffer, reuse it as the next read buffer. */
- grpc_slice_buffer_init(&garbage);
- grpc_slice_buffer_trim_end(tcp->read_slices,
- tcp->read_slices->length - nread, &garbage);
- grpc_slice_buffer_reset_and_unref_internal(&garbage);
- }
- } else {
- grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices);
- }
- call_read_cb(tcp, error);
-}
-
-static void tcp_read_allocation_done(void* tcpp, grpc_error_handle error) {
- custom_tcp_endpoint* tcp = static_cast<custom_tcp_endpoint*>(tcpp);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp->socket,
- grpc_error_std_string(error).c_str());
- }
- if (error == GRPC_ERROR_NONE) {
- /* Before calling read, we allocate a buffer with exactly one slice
- * to tcp->read_slices and wait for the callback indicating that the
- * allocation was successful. So slices[0] should always exist here */
- char* buffer = reinterpret_cast<char*>(
- GRPC_SLICE_START_PTR(tcp->read_slices->slices[0]));
- size_t len = GRPC_SLICE_LENGTH(tcp->read_slices->slices[0]);
- grpc_custom_socket_vtable->read(tcp->socket, buffer, len,
- custom_read_callback);
- } else {
- grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices);
- call_read_cb(tcp, GRPC_ERROR_REF(error));
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "Initiating read on %p: error=%s", tcp->socket,
- grpc_error_std_string(error).c_str());
- }
-}
-
-static void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
- grpc_closure* cb, bool /*urgent*/) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- GPR_ASSERT(tcp->read_cb == nullptr);
- tcp->read_cb = cb;
- tcp->read_slices = read_slices;
- grpc_slice_buffer_reset_and_unref_internal(read_slices);
- TCP_REF(tcp, "read");
- if (grpc_resource_user_alloc_slices(&tcp->slice_allocator,
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1,
- tcp->read_slices)) {
- tcp_read_allocation_done(tcp, GRPC_ERROR_NONE);
- }
-}
-
-static void custom_write_callback(grpc_custom_socket* socket,
- grpc_error_handle error) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- custom_tcp_endpoint* tcp =
- reinterpret_cast<custom_tcp_endpoint*>(socket->endpoint);
- grpc_closure* cb = tcp->write_cb;
- tcp->write_cb = nullptr;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "write complete on %p: error=%s", tcp->socket,
- grpc_error_std_string(error).c_str());
- }
- TCP_UNREF(tcp, "write");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
-}
-
-static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
- grpc_closure* cb, void* /*arg*/) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- size_t j;
-
- 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_free(data);
- }
- }
-
- if (tcp->shutting_down) {
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION, cb,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("TCP socket is shutting down"));
- return;
- }
-
- GPR_ASSERT(tcp->write_cb == nullptr);
- tcp->write_slices = write_slices;
- GPR_ASSERT(tcp->write_slices->count <= UINT_MAX);
- if (tcp->write_slices->count == 0) {
- // No slices means we don't have to do anything,
- // and libuv doesn't like empty writes
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
- return;
- }
- tcp->write_cb = cb;
- TCP_REF(tcp, "write");
- grpc_custom_socket_vtable->write(tcp->socket, tcp->write_slices,
- custom_write_callback);
-}
-
-static void endpoint_add_to_pollset(grpc_endpoint* ep, grpc_pollset* pollset) {
- // No-op. We're ignoring pollsets currently
- (void)ep;
- (void)pollset;
-}
-
-static void endpoint_add_to_pollset_set(grpc_endpoint* ep,
- grpc_pollset_set* pollset) {
- // No-op. We're ignoring pollsets currently
- (void)ep;
- (void)pollset;
-}
-
-static void endpoint_delete_from_pollset_set(grpc_endpoint* ep,
- grpc_pollset_set* pollset) {
- // No-op. We're ignoring pollsets currently
- (void)ep;
- (void)pollset;
-}
-
-static void endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- if (!tcp->shutting_down) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP %p shutdown why=%s", tcp->socket,
- grpc_error_std_string(why).c_str());
- }
- tcp->shutting_down = true;
- // grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->read_cb,
- // GRPC_ERROR_REF(why));
- // grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->write_cb,
- // GRPC_ERROR_REF(why)); tcp->read_cb = nullptr; tcp->write_cb = nullptr;
- grpc_resource_user_shutdown(tcp->resource_user);
- grpc_custom_socket_vtable->shutdown(tcp->socket);
- }
- GRPC_ERROR_UNREF(why);
-}
-
-static void custom_close_callback(grpc_custom_socket* socket) {
- socket->refs--;
- if (socket->refs == 0) {
- grpc_custom_socket_vtable->destroy(socket);
- gpr_free(socket);
- } else if (socket->endpoint) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- custom_tcp_endpoint* tcp =
- reinterpret_cast<custom_tcp_endpoint*>(socket->endpoint);
- TCP_UNREF(tcp, "destroy");
- }
-}
-
-static void endpoint_destroy(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- grpc_custom_socket_vtable->close(tcp->socket, custom_close_callback);
-}
-
-static absl::string_view endpoint_get_peer(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- return tcp->peer_string;
-}
-
-static absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- return tcp->local_address;
-}
-
-static grpc_resource_user* endpoint_get_resource_user(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- return tcp->resource_user;
-}
-
-static int endpoint_get_fd(grpc_endpoint* /*ep*/) { return -1; }
-
-static bool endpoint_can_track_err(grpc_endpoint* /*ep*/) { return false; }
-
-static grpc_endpoint_vtable vtable = {endpoint_read,
- endpoint_write,
- endpoint_add_to_pollset,
- endpoint_add_to_pollset_set,
- endpoint_delete_from_pollset_set,
- endpoint_shutdown,
- endpoint_destroy,
- endpoint_get_resource_user,
- endpoint_get_peer,
- 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;
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "Creating TCP endpoint %p", socket);
- }
- socket->refs++;
- socket->endpoint = reinterpret_cast<grpc_endpoint*>(tcp);
- 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->shutting_down = false;
- tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(
- &tcp->slice_allocator, tcp->resource_user, tcp_read_allocation_done, tcp);
-
- return &tcp->base;
-}
diff --git a/grpc/src/core/lib/iomgr/tcp_custom.h b/grpc/src/core/lib/iomgr/tcp_custom.h
deleted file mode 100644
index b342efba..00000000
--- a/grpc/src/core/lib/iomgr/tcp_custom.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * 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_IOMGR_TCP_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_TCP_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#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)
-
-typedef struct grpc_tcp_listener grpc_tcp_listener;
-typedef struct grpc_custom_tcp_connect grpc_custom_tcp_connect;
-
-typedef struct grpc_custom_socket {
- // Implementation defined
- void* impl;
- grpc_endpoint* endpoint;
- grpc_tcp_listener* listener;
- grpc_custom_tcp_connect* connector;
- int refs;
-} grpc_custom_socket;
-
-typedef void (*grpc_custom_connect_callback)(grpc_custom_socket* socket,
- grpc_error_handle error);
-typedef void (*grpc_custom_write_callback)(grpc_custom_socket* socket,
- grpc_error_handle error);
-typedef void (*grpc_custom_read_callback)(grpc_custom_socket* socket,
- size_t nread,
- grpc_error_handle error);
-typedef void (*grpc_custom_accept_callback)(grpc_custom_socket* socket,
- grpc_custom_socket* client,
- grpc_error_handle error);
-typedef void (*grpc_custom_close_callback)(grpc_custom_socket* socket);
-
-typedef struct grpc_socket_vtable {
- grpc_error_handle (*init)(grpc_custom_socket* socket, int domain);
- void (*connect)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
- size_t len, grpc_custom_connect_callback cb);
- void (*destroy)(grpc_custom_socket* socket);
- void (*shutdown)(grpc_custom_socket* socket);
- void (*close)(grpc_custom_socket* socket, grpc_custom_close_callback cb);
- void (*write)(grpc_custom_socket* socket, grpc_slice_buffer* slices,
- grpc_custom_write_callback cb);
- void (*read)(grpc_custom_socket* socket, char* buffer, size_t length,
- grpc_custom_read_callback cb);
- grpc_error_handle (*getpeername)(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, int* len);
- grpc_error_handle (*getsockname)(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, int* len);
- grpc_error_handle (*bind)(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, size_t len, int flags);
- grpc_error_handle (*listen)(grpc_custom_socket* socket);
- void (*accept)(grpc_custom_socket* socket, grpc_custom_socket* client,
- grpc_custom_accept_callback cb);
-} grpc_socket_vtable;
-
-/* Internal APIs */
-void grpc_custom_endpoint_init(grpc_socket_vtable* impl);
-
-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);
-
-#endif /* GRPC_CORE_LIB_IOMGR_TCP_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/tcp_posix.cc b/grpc/src/core/lib/iomgr/tcp_posix.cc
index 1f28b773..35377c26 100644
--- a/grpc/src/core/lib/iomgr/tcp_posix.cc
+++ b/grpc/src/core/lib/iomgr/tcp_posix.cc
@@ -18,12 +18,12 @@
#include <grpc/support/port_platform.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_TCP
-#include "src/core/lib/iomgr/tcp_posix.h"
-
#include <errno.h>
#include <limits.h>
#include <netinet/in.h>
@@ -35,6 +35,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <algorithm>
#include <unordered_map>
@@ -56,7 +57,11 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/trace.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -136,12 +141,12 @@ class TcpZerocopySendRecord {
}
// References: 1 reference per sendmsg(), and 1 for the tcp_write().
- void Ref() { ref_.FetchAdd(1, MemoryOrder::RELAXED); }
+ void Ref() { ref_.fetch_add(1, std::memory_order_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);
+ const intptr_t prior = ref_.fetch_sub(1, std::memory_order_acq_rel);
GPR_DEBUG_ASSERT(prior > 0);
if (prior == 1) {
AllSendsComplete();
@@ -159,7 +164,7 @@ class TcpZerocopySendRecord {
void AssertEmpty() {
GPR_DEBUG_ASSERT(buf_.count == 0);
GPR_DEBUG_ASSERT(buf_.length == 0);
- GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
+ GPR_DEBUG_ASSERT(ref_.load(std::memory_order_relaxed) == 0);
}
// When all sendmsg() calls associated with this tcp_write() have been
@@ -167,12 +172,12 @@ class TcpZerocopySendRecord {
// 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);
+ GPR_DEBUG_ASSERT(ref_.load(std::memory_order_relaxed) == 0);
grpc_slice_buffer_reset_and_unref_internal(&buf_);
}
grpc_slice_buffer buf_;
- Atomic<intptr_t> ref_;
+ std::atomic<intptr_t> ref_{0};
OutgoingOffset out_offset_;
};
@@ -286,7 +291,7 @@ class TcpZerocopySendCtx {
// 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); }
+ void Shutdown() { shutdown_.store(true, std::memory_order_release); }
// Indicates that there are no inflight tcp_write() instances with zerocopy
// enabled.
@@ -317,7 +322,7 @@ class TcpZerocopySendCtx {
}
TcpZerocopySendRecord* TryGetSendRecordLocked() {
- if (shutdown_.Load(MemoryOrder::ACQUIRE)) {
+ if (shutdown_.load(std::memory_order_acquire)) {
return nullptr;
}
if (free_send_records_size_ == 0) {
@@ -339,7 +344,7 @@ class TcpZerocopySendCtx {
int free_send_records_size_;
Mutex lock_;
uint32_t last_send_ = 0;
- Atomic<bool> shutdown_;
+ std::atomic<bool> shutdown_{false};
bool enabled_ = false;
size_t threshold_bytes_ = kDefaultSendBytesThreshold;
std::unordered_map<uint32_t, TcpZerocopySendRecord*> ctx_lookup_;
@@ -361,6 +366,7 @@ struct grpc_tcp {
/* Used by the endpoint read function to distinguish the very first read call
* from the rest */
bool is_first_read;
+ bool has_posted_reclaimer;
double target_length;
double bytes_read_this_round;
grpc_core::RefCount refcount;
@@ -372,7 +378,8 @@ struct grpc_tcp {
/* garbage after the last read */
grpc_slice_buffer last_read_buffer;
- grpc_slice_buffer* incoming_buffer;
+ absl::Mutex read_mu;
+ grpc_slice_buffer* incoming_buffer ABSL_GUARDED_BY(read_mu) = nullptr;
int inq; /* bytes pending on the socket from the last read. */
bool inq_capable; /* cache whether kernel supports inq */
@@ -392,8 +399,8 @@ struct grpc_tcp {
std::string peer_string;
std::string local_address;
- grpc_resource_user* resource_user;
- grpc_resource_user_slice_allocator slice_allocator;
+ grpc_core::MemoryOwner memory_owner;
+ grpc_core::MemoryAllocator::Reservation self_reservation;
grpc_core::TracedBuffer* tb_head; /* List of traced buffers */
gpr_mu tb_mu; /* Lock for access to list of traced buffers */
@@ -419,6 +426,9 @@ struct grpc_tcp {
on errors anymore */
TcpZerocopySendCtx tcp_zerocopy_send_ctx;
TcpZerocopySendRecord* current_zerocopy_send = nullptr;
+
+ bool curr_read_completed;
+ int curr_min_read_chunk_size;
};
struct backup_poller {
@@ -432,8 +442,10 @@ static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp);
#define BACKUP_POLLER_POLLSET(b) ((grpc_pollset*)((b) + 1))
-static gpr_atm g_uncovered_notifications_pending;
-static gpr_atm g_backup_poller; /* backup_poller* */
+static grpc_core::Mutex* g_backup_poller_mu = nullptr;
+static int g_uncovered_notifications_pending
+ ABSL_GUARDED_BY(g_backup_poller_mu);
+static backup_poller* g_backup_poller ABSL_GUARDED_BY(g_backup_poller_mu);
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error_handle error);
@@ -455,23 +467,20 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p);
}
gpr_mu_lock(p->pollset_mu);
- grpc_millis deadline = grpc_core::ExecCtx::Get()->Now() + 10 * GPR_MS_PER_SEC;
+ grpc_core::Timestamp deadline =
+ grpc_core::ExecCtx::Get()->Now() + grpc_core::Duration::Seconds(10);
GRPC_STATS_INC_TCP_BACKUP_POLLER_POLLS();
GRPC_LOG_IF_ERROR(
"backup_poller:pollset_work",
grpc_pollset_work(BACKUP_POLLER_POLLSET(p), nullptr, deadline));
gpr_mu_unlock(p->pollset_mu);
- /* last "uncovered" notification is the ref that keeps us polling, if we get
- * there try a cas to release it */
- if (gpr_atm_no_barrier_load(&g_uncovered_notifications_pending) == 1 &&
- gpr_atm_full_cas(&g_uncovered_notifications_pending, 1, 0)) {
- gpr_mu_lock(p->pollset_mu);
- bool cas_ok =
- gpr_atm_full_cas(&g_backup_poller, reinterpret_cast<gpr_atm>(p), 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p done cas_ok=%d", p, cas_ok);
- }
- gpr_mu_unlock(p->pollset_mu);
+ g_backup_poller_mu->Lock();
+ /* last "uncovered" notification is the ref that keeps us polling */
+ if (g_uncovered_notifications_pending == 1) {
+ GPR_ASSERT(g_backup_poller == p);
+ g_backup_poller = nullptr;
+ g_uncovered_notifications_pending = 0;
+ g_backup_poller_mu->Unlock();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p shutdown", p);
}
@@ -479,6 +488,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
GRPC_CLOSURE_INIT(&p->run_poller, done_poller, p,
grpc_schedule_on_exec_ctx));
} else {
+ g_backup_poller_mu->Unlock();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p);
}
@@ -489,15 +499,17 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
}
static void drop_uncovered(grpc_tcp* /*tcp*/) {
- backup_poller* p =
- reinterpret_cast<backup_poller*>(gpr_atm_acq_load(&g_backup_poller));
- gpr_atm old_count =
- gpr_atm_full_fetch_add(&g_uncovered_notifications_pending, -1);
+ int old_count;
+ backup_poller* p;
+ g_backup_poller_mu->Lock();
+ p = g_backup_poller;
+ old_count = g_uncovered_notifications_pending--;
+ g_backup_poller_mu->Unlock();
+ GPR_ASSERT(old_count > 1);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p,
- static_cast<int>(old_count), static_cast<int>(old_count) - 1);
+ gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p, old_count,
+ old_count - 1);
}
- GPR_ASSERT(old_count != 1);
}
// gRPC API considers a Write operation to be done the moment it clears ‘flow
@@ -509,38 +521,33 @@ static void drop_uncovered(grpc_tcp* /*tcp*/) {
// polling thread and progress is made) and hence add it to a backup poller here
static void cover_self(grpc_tcp* tcp) {
backup_poller* p;
- gpr_atm old_count =
- gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, 2);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER: cover cnt %d->%d",
- static_cast<int>(old_count), 2 + static_cast<int>(old_count));
- }
- if (old_count == 0) {
- GRPC_STATS_INC_TCP_BACKUP_POLLERS_CREATED();
+ g_backup_poller_mu->Lock();
+ int old_count = 0;
+ if (g_uncovered_notifications_pending == 0) {
+ g_uncovered_notifications_pending = 2;
p = static_cast<backup_poller*>(
gpr_zalloc(sizeof(*p) + grpc_pollset_size()));
+ g_backup_poller = p;
+ grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu);
+ g_backup_poller_mu->Unlock();
+ GRPC_STATS_INC_TCP_BACKUP_POLLERS_CREATED();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p create", p);
}
- grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu);
- gpr_atm_rel_store(&g_backup_poller, (gpr_atm)p);
grpc_core::Executor::Run(
GRPC_CLOSURE_INIT(&p->run_poller, run_poller, p, nullptr),
GRPC_ERROR_NONE, grpc_core::ExecutorType::DEFAULT,
grpc_core::ExecutorJobType::LONG);
} else {
- while ((p = reinterpret_cast<backup_poller*>(
- gpr_atm_acq_load(&g_backup_poller))) == nullptr) {
- // spin waiting for backup poller
- }
+ old_count = g_uncovered_notifications_pending++;
+ p = g_backup_poller;
+ g_backup_poller_mu->Unlock();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p", p, tcp);
+ gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p cnt %d->%d", p, tcp,
+ old_count - 1, old_count);
}
grpc_pollset_add_fd(BACKUP_POLLER_POLLSET(p), tcp->em_fd);
- if (old_count != 0) {
- drop_uncovered(tcp);
- }
}
static void notify_on_read(grpc_tcp* tcp) {
@@ -580,7 +587,7 @@ static void finish_estimate(grpc_tcp* tcp) {
value */
if (tcp->bytes_read_this_round > tcp->target_length * 0.8) {
tcp->target_length =
- GPR_MAX(2 * tcp->target_length, tcp->bytes_read_this_round);
+ std::max(2 * tcp->target_length, tcp->bytes_read_this_round);
} else {
tcp->target_length =
0.99 * tcp->target_length + 0.01 * tcp->bytes_read_this_round;
@@ -588,24 +595,6 @@ static void finish_estimate(grpc_tcp* tcp) {
tcp->bytes_read_this_round = 0;
}
-static size_t get_target_read_size(grpc_tcp* tcp) {
- grpc_resource_quota* rq = grpc_resource_user_quota(tcp->resource_user);
- double pressure = grpc_resource_quota_get_memory_pressure(rq);
- double target =
- tcp->target_length * (pressure > 0.8 ? (1.0 - pressure) / 0.2 : 1.0);
- size_t sz = ((static_cast<size_t> GPR_CLAMP(target, tcp->min_read_chunk_size,
- tcp->max_read_chunk_size)) +
- 255) &
- ~static_cast<size_t>(255);
- /* don't use more than 1/16th of the overall resource quota for a single read
- * alloc */
- size_t rqmax = grpc_resource_quota_peek_size(rq);
- if (sz > rqmax / 16 && rqmax > 1024) {
- sz = rqmax / 16;
- }
- return sz;
-}
-
static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
grpc_tcp* tcp) {
return grpc_error_set_str(
@@ -614,8 +603,7 @@ static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
/* All tcp errors are marked with UNAVAILABLE so that application may
* 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_ERROR_STR_TARGET_ADDRESS, tcp->peer_string);
}
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
@@ -625,14 +613,12 @@ static void tcp_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
ZerocopyDisableAndWaitForRemaining(tcp);
grpc_fd_shutdown(tcp->em_fd, why);
- grpc_resource_user_shutdown(tcp->resource_user);
}
static void tcp_free(grpc_tcp* tcp) {
grpc_fd_orphan(tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
"tcp_unref_orphan");
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
- grpc_resource_user_unref(tcp->resource_user);
/* The lock is not really necessary here, since all refs have been released */
gpr_mu_lock(&tcp->tb_mu);
grpc_core::TracedBuffer::Shutdown(
@@ -681,9 +667,35 @@ static void tcp_destroy(grpc_endpoint* ep) {
TCP_UNREF(tcp, "destroy");
}
-static void call_read_cb(grpc_tcp* tcp, grpc_error_handle error) {
- grpc_closure* cb = tcp->read_cb;
+static void perform_reclamation(grpc_tcp* tcp)
+ ABSL_LOCKS_EXCLUDED(tcp->read_mu) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO, "TCP: benign reclamation to free memory");
+ }
+ tcp->read_mu.Lock();
+ if (tcp->incoming_buffer != nullptr) {
+ grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
+ }
+ tcp->read_mu.Unlock();
+ tcp->has_posted_reclaimer = false;
+}
+static void maybe_post_reclaimer(grpc_tcp* tcp)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
+ if (!tcp->has_posted_reclaimer) {
+ tcp->has_posted_reclaimer = true;
+ tcp->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kBenign,
+ [tcp](absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (!sweep.has_value()) return;
+ perform_reclamation(tcp);
+ });
+ }
+}
+
+static void tcp_trace_read(grpc_tcp* tcp, grpc_error_handle error)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
+ grpc_closure* cb = tcp->read_cb;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg);
size_t i;
@@ -698,15 +710,16 @@ static void call_read_cb(grpc_tcp* tcp, grpc_error_handle error) {
}
}
}
-
- tcp->read_cb = nullptr;
- tcp->incoming_buffer = nullptr;
- grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
}
+/* Returns true if data available to read or error other than EAGAIN. */
#define MAX_READ_IOVEC 4
-static void tcp_do_read(grpc_tcp* tcp) {
+static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
GPR_TIMER_SCOPE("tcp_do_read", 0);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
+ gpr_log(GPR_INFO, "TCP:%p do_read", tcp);
+ }
struct msghdr msg;
struct iovec iov[MAX_READ_IOVEC];
ssize_t read_bytes;
@@ -725,6 +738,8 @@ static void tcp_do_read(grpc_tcp* tcp) {
iov[i].iov_len = GRPC_SLICE_LENGTH(tcp->incoming_buffer->slices[i]);
}
+ GPR_ASSERT(tcp->incoming_buffer->length != 0);
+
do {
/* Assume there is something on the queue. If we receive TCP_INQ from
* kernel, we will update this value, otherwise, we have to assume there is
@@ -764,17 +779,16 @@ static void tcp_do_read(grpc_tcp* tcp) {
/* NB: After calling call_read_cb a parallel call of the read handler may
* be running. */
if (errno == EAGAIN) {
+ tcp->curr_read_completed = true;
finish_estimate(tcp);
tcp->inq = 0;
- /* We've consumed the edge, request a new one */
- notify_on_read(tcp);
+ return false;
} else {
+ tcp->curr_read_completed = false;
grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
- call_read_cb(tcp,
- tcp_annotate_error(GRPC_OS_ERROR(errno, "recvmsg"), tcp));
- TCP_UNREF(tcp, "read");
+ *error = tcp_annotate_error(GRPC_OS_ERROR(errno, "recvmsg"), tcp);
+ return true;
}
- return;
}
if (read_bytes == 0) {
/* 0 read size ==> end of stream
@@ -782,12 +796,11 @@ static void tcp_do_read(grpc_tcp* tcp) {
* We may have read something, i.e., total_read_bytes > 0, but
* since the connection is closed we will drop the data here, because we
* can't call the callback multiple times. */
+ tcp->curr_read_completed = true;
grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
- call_read_cb(
- tcp, tcp_annotate_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Socket closed"), tcp));
- TCP_UNREF(tcp, "read");
- return;
+ *error = tcp_annotate_error(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Socket closed"), tcp);
+ return true;
}
GRPC_STATS_INC_TCP_READ_SIZE(read_bytes);
@@ -811,7 +824,6 @@ static void tcp_do_read(grpc_tcp* tcp) {
total_read_bytes += read_bytes;
if (tcp->inq == 0 || total_read_bytes == tcp->incoming_buffer->length) {
- /* We have filled incoming_buffer, and we cannot read any more. */
break;
}
@@ -841,51 +853,50 @@ static void tcp_do_read(grpc_tcp* tcp) {
finish_estimate(tcp);
}
+ // There may be more data to be read because recvmsg did not return EAGAIN.
+ tcp->curr_read_completed = false;
GPR_DEBUG_ASSERT(total_read_bytes > 0);
if (total_read_bytes < tcp->incoming_buffer->length) {
grpc_slice_buffer_trim_end(tcp->incoming_buffer,
tcp->incoming_buffer->length - total_read_bytes,
&tcp->last_read_buffer);
}
- call_read_cb(tcp, GRPC_ERROR_NONE);
- TCP_UNREF(tcp, "read");
-}
-
-static void tcp_read_allocation_done(void* tcpp, grpc_error_handle error) {
- grpc_tcp* tcp = static_cast<grpc_tcp*>(tcpp);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp,
- grpc_error_std_string(error).c_str());
- }
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
- grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
- call_read_cb(tcp, GRPC_ERROR_REF(error));
- TCP_UNREF(tcp, "read");
- } else {
- tcp_do_read(tcp);
- }
+ *error = GRPC_ERROR_NONE;
+ return true;
}
-static void tcp_continue_read(grpc_tcp* tcp) {
- size_t target_read_size = get_target_read_size(tcp);
- /* Wait for allocation only when there is no buffer left. */
+static void maybe_make_read_slices(grpc_tcp* tcp)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) {
if (tcp->incoming_buffer->length == 0 &&
tcp->incoming_buffer->count < MAX_READ_IOVEC) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p alloc_slices", tcp);
+ gpr_log(GPR_INFO,
+ "TCP:%p alloc_slices; min_chunk=%d max_chunk=%d target=%lf "
+ "buf_len=%" PRIdPTR,
+ tcp, tcp->min_read_chunk_size, tcp->max_read_chunk_size,
+ tcp->target_length, tcp->incoming_buffer->length);
}
- if (GPR_UNLIKELY(!grpc_resource_user_alloc_slices(&tcp->slice_allocator,
- target_read_size, 1,
- tcp->incoming_buffer))) {
- // Wait for allocation.
- return;
+ int target_length = static_cast<int>(tcp->target_length);
+ int extra_wanted =
+ target_length - static_cast<int>(tcp->incoming_buffer->length);
+ if (tcp->curr_read_completed) {
+ // Set it to false again to start the next block of reads
+ tcp->curr_read_completed = false;
+ // Reset curr_min_read_chunk_size for the next block of reads
+ tcp->curr_min_read_chunk_size = tcp->min_read_chunk_size;
+ } else {
+ // Last read is not completed yet. Double the last min read chunk size.
+ tcp->curr_min_read_chunk_size =
+ std::min(2 * tcp->curr_min_read_chunk_size, tcp->max_read_chunk_size);
}
+ grpc_slice_buffer_add_indexed(
+ tcp->incoming_buffer,
+ tcp->memory_owner.MakeSlice(grpc_core::MemoryRequest(
+ tcp->curr_min_read_chunk_size,
+ grpc_core::Clamp(extra_wanted, tcp->curr_min_read_chunk_size,
+ tcp->max_read_chunk_size))));
+ maybe_post_reclaimer(tcp);
}
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p do_read", tcp);
- }
- tcp_do_read(tcp);
}
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) {
@@ -894,15 +905,28 @@ static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) {
gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp,
grpc_error_std_string(error).c_str());
}
-
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
+ tcp->read_mu.Lock();
+ grpc_error_handle tcp_read_error;
+ if (GPR_LIKELY(error == GRPC_ERROR_NONE)) {
+ maybe_make_read_slices(tcp);
+ if (!tcp_do_read(tcp, &tcp_read_error)) {
+ /* We've consumed the edge, request a new one */
+ tcp->read_mu.Unlock();
+ notify_on_read(tcp);
+ return;
+ }
+ tcp_trace_read(tcp, tcp_read_error);
+ } else {
+ tcp_read_error = GRPC_ERROR_REF(error);
grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
- call_read_cb(tcp, GRPC_ERROR_REF(error));
- TCP_UNREF(tcp, "read");
- } else {
- tcp_continue_read(tcp);
}
+ grpc_closure* cb = tcp->read_cb;
+ tcp->read_cb = nullptr;
+ tcp->incoming_buffer = nullptr;
+ tcp->read_mu.Unlock();
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb, tcp_read_error);
+ TCP_UNREF(tcp, "read");
}
static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer,
@@ -910,9 +934,11 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer,
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
GPR_ASSERT(tcp->read_cb == nullptr);
tcp->read_cb = cb;
+ tcp->read_mu.Lock();
tcp->incoming_buffer = incoming_buffer;
grpc_slice_buffer_reset_and_unref_internal(incoming_buffer);
grpc_slice_buffer_swap(incoming_buffer, &tcp->last_read_buffer);
+ tcp->read_mu.Unlock();
TCP_REF(tcp, "read");
if (tcp->is_first_read) {
/* Endpoint read called for the very first time. Register read callback with
@@ -1164,9 +1190,9 @@ static bool process_errors(grpc_tcp* tcp) {
struct cmsghdr align;
} aligned_buf;
msg.msg_control = aligned_buf.rbuf;
- msg.msg_controllen = sizeof(aligned_buf.rbuf);
int r, saved_errno;
while (true) {
+ msg.msg_controllen = sizeof(aligned_buf.rbuf);
do {
r = recvmsg(tcp->fd, &msg, MSG_ERRQUEUE);
saved_errno = errno;
@@ -1280,10 +1306,10 @@ void tcp_shutdown_buffer_list(grpc_tcp* tcp) {
}
}
-#if defined(IOV_MAX) && IOV_MAX < 1000
+#if defined(IOV_MAX) && IOV_MAX < 260
#define MAX_WRITE_IOVEC IOV_MAX
#else
-#define MAX_WRITE_IOVEC 1000
+#define MAX_WRITE_IOVEC 260
#endif
msg_iovlen_type TcpZerocopySendRecord::PopulateIovs(size_t* unwind_slice_idx,
size_t* unwind_byte_idx,
@@ -1328,13 +1354,17 @@ void TcpZerocopySendRecord::UpdateOffsetForBytesSent(size_t sending_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_handle* 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;
+ bool tried_sending_message;
+ msghdr msg;
+ // iov consumes a large space. Keep it as the last item on the stack to
+ // improve locality. After all, we expect only the first elements of it being
+ // populated in most cases.
+ iovec iov[MAX_WRITE_IOVEC];
while (true) {
sending_length = 0;
iov_size = record->PopulateIovs(&unwind_slice_idx, &unwind_byte_idx,
@@ -1344,7 +1374,7 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
msg.msg_iov = iov;
msg.msg_iovlen = iov_size;
msg.msg_flags = 0;
- bool tried_sending_message = false;
+ 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);
@@ -1660,11 +1690,6 @@ static int tcp_get_fd(grpc_endpoint* ep) {
return tcp->fd;
}
-static grpc_resource_user* tcp_get_resource_user(grpc_endpoint* ep) {
- grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- return tcp->resource_user;
-}
-
static bool tcp_can_track_err(grpc_endpoint* ep) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
if (!grpc_event_engine_can_track_errors()) {
@@ -1685,7 +1710,6 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
tcp_delete_from_pollset_set,
tcp_shutdown,
tcp_destroy,
- tcp_get_resource_user,
tcp_get_peer,
tcp_get_local_address,
tcp_get_fd,
@@ -1695,7 +1719,7 @@ 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) {
+ absl::string_view peer_string) {
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;
@@ -1705,7 +1729,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
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++) {
if (0 ==
@@ -1723,12 +1746,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
grpc_integer_options options = {tcp_read_chunk_size, 1, MAX_CHUNK_SIZE};
tcp_max_read_chunk_size =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
- } else if (0 ==
- strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- 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(
@@ -1753,14 +1770,18 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
if (tcp_min_read_chunk_size > tcp_max_read_chunk_size) {
tcp_min_read_chunk_size = tcp_max_read_chunk_size;
}
- tcp_read_chunk_size = GPR_CLAMP(tcp_read_chunk_size, tcp_min_read_chunk_size,
- tcp_max_read_chunk_size);
+ tcp_read_chunk_size = grpc_core::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);
tcp->base.vtable = &vtable;
- tcp->peer_string = peer_string;
+ tcp->peer_string = std::string(peer_string);
tcp->fd = grpc_fd_wrapped_fd(em_fd);
+ tcp->memory_owner = grpc_core::ResourceQuotaFromChannelArgs(channel_args)
+ ->memory_quota()
+ ->CreateMemoryOwner(peer_string);
+ tcp->self_reservation = tcp->memory_owner.MakeReservation(sizeof(grpc_tcp));
grpc_resolved_address resolved_local_addr;
memset(&resolved_local_addr, 0, sizeof(resolved_local_addr));
resolved_local_addr.len = sizeof(resolved_local_addr.addr);
@@ -1776,17 +1797,19 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
tcp->current_zerocopy_send = nullptr;
tcp->release_fd_cb = nullptr;
tcp->release_fd = nullptr;
- tcp->incoming_buffer = nullptr;
tcp->target_length = static_cast<double>(tcp_read_chunk_size);
tcp->min_read_chunk_size = tcp_min_read_chunk_size;
tcp->max_read_chunk_size = tcp_max_read_chunk_size;
tcp->bytes_read_this_round = 0;
/* Will be set to false by the very first endpoint read function */
tcp->is_first_read = true;
+ tcp->has_posted_reclaimer = false;
tcp->bytes_counter = -1;
tcp->socket_ts_enabled = false;
tcp->ts_capable = true;
tcp->outgoing_buffer_arg = nullptr;
+ tcp->curr_read_completed = true;
+ tcp->curr_min_read_chunk_size = tcp->min_read_chunk_size;
if (tcp_tx_zerocopy_enabled && !tcp->tcp_zerocopy_send_ctx.memory_limited()) {
#ifdef GRPC_LINUX_ERRQUEUE
const int enable = 1;
@@ -1805,10 +1828,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
tcp->em_fd = em_fd;
grpc_slice_buffer_init(&tcp->last_read_buffer);
- tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(
- &tcp->slice_allocator, tcp->resource_user, tcp_read_allocation_done, tcp);
- grpc_resource_quota_unref_internal(resource_quota);
gpr_mu_init(&tcp->tb_mu);
tcp->tb_head = nullptr;
GRPC_CLOSURE_INIT(&tcp->read_done_closure, tcp_handle_read, tcp,
@@ -1873,4 +1892,11 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
TCP_UNREF(tcp, "destroy");
}
+void grpc_tcp_posix_init() { g_backup_poller_mu = new grpc_core::Mutex; }
+
+void grpc_tcp_posix_shutdown() {
+ delete g_backup_poller_mu;
+ g_backup_poller_mu = nullptr;
+}
+
#endif /* GRPC_POSIX_SOCKET_TCP */
diff --git a/grpc/src/core/lib/iomgr/tcp_posix.h b/grpc/src/core/lib/iomgr/tcp_posix.h
index eff825cb..d657539b 100644
--- a/grpc/src/core/lib/iomgr/tcp_posix.h
+++ b/grpc/src/core/lib/iomgr/tcp_posix.h
@@ -31,30 +31,35 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/buffer_list.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/port.h"
extern grpc_core::TraceFlag grpc_tcp_trace;
-/* Create a tcp endpoint given a file desciptor and a read slice size.
- Takes ownership of fd. */
+/// Create a tcp endpoint given a file desciptor and a read slice size.
+/// Takes ownership of \a fd. Takes ownership of the \a slice_allocator.
grpc_endpoint* grpc_tcp_create(grpc_fd* fd, const grpc_channel_args* args,
- const char* peer_string);
+ absl::string_view peer_string);
-/* Return the tcp endpoint's fd, or -1 if this is not available. Does not
- release the fd.
- Requires: ep must be a tcp endpoint.
- */
+/// Return the tcp endpoint's fd, or -1 if this is not available. Does not
+/// release the fd. Requires: \a ep must be a tcp endpoint.
int grpc_tcp_fd(grpc_endpoint* ep);
-/* Destroy the tcp endpoint without closing its fd. *fd will be set and done
- * will be called when the endpoint is destroyed.
- * Requires: ep must be a tcp endpoint and fd must not be NULL. */
+/// Destroy the tcp endpoint without closing its fd. *fd will be set and done
+/// will be called when the endpoint is destroyed. Requires: \a ep must be a tcp
+/// endpoint and fd must not be NULL.
void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
grpc_closure* done);
+#ifdef GRPC_POSIX_SOCKET_TCP
+
+void grpc_tcp_posix_init();
+
+void grpc_tcp_posix_shutdown();
+
+#endif /* GRPC_POSIX_SOCKET_TCP */
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */
diff --git a/grpc/src/core/lib/iomgr/tcp_server.h b/grpc/src/core/lib/iomgr/tcp_server.h
index 50ac4e74..9c884280 100644
--- a/grpc/src/core/lib/iomgr/tcp_server.h
+++ b/grpc/src/core/lib/iomgr/tcp_server.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
+#include <vector>
+
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
-#include <vector>
-
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
@@ -84,7 +84,8 @@ typedef struct grpc_tcp_server_vtable {
/* Create a server, initially not bound to any ports. The caller owns one ref.
If shutdown_complete is not NULL, it will be used by
- grpc_tcp_server_unref() when the ref count reaches zero. */
+ grpc_tcp_server_unref() when the ref count reaches zero.
+ Takes ownership of the slice_allocator_factory. */
grpc_error_handle grpc_tcp_server_create(grpc_closure* shutdown_complete,
const grpc_channel_args* args,
grpc_tcp_server** server);
diff --git a/grpc/src/core/lib/iomgr/tcp_server_custom.cc b/grpc/src/core/lib/iomgr/tcp_server_custom.cc
deleted file mode 100644
index fff75453..00000000
--- a/grpc/src/core/lib/iomgr/tcp_server_custom.cc
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- *
- * 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/iomgr/port.h"
-
-#include <assert.h>
-#include <string.h>
-
-#include <string>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/address_utils/sockaddr_utils.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"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/tcp_server.h"
-
-extern grpc_core::TraceFlag grpc_tcp_trace;
-
-extern grpc_socket_vtable* grpc_custom_socket_vtable;
-
-/* one listening port */
-struct grpc_tcp_listener {
- grpc_tcp_server* server;
- unsigned port_index;
- int port;
-
- grpc_custom_socket* socket;
-
- /* linked list */
- struct grpc_tcp_listener* next;
-
- bool closed;
-};
-
-struct grpc_tcp_server {
- gpr_refcount refs;
-
- /* Called whenever accept() succeeds on a server port. */
- grpc_tcp_server_cb on_accept_cb;
- void* on_accept_cb_arg;
-
- int open_ports;
-
- /* linked list of server ports */
- grpc_tcp_listener* head;
- grpc_tcp_listener* tail;
-
- /* List of closures passed to shutdown_starting_add(). */
- grpc_closure_list shutdown_starting;
-
- /* shutdown callback */
- grpc_closure* shutdown_complete;
-
- bool shutdown;
- bool so_reuseport;
-
- grpc_resource_quota* resource_quota;
-};
-
-static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
- grpc_tcp_server* s =
- static_cast<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;
- 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 (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);
- s->resource_quota = grpc_resource_quota_ref_internal(
- static_cast<grpc_resource_quota*>(args->args[i].value.pointer.p));
- } else {
- grpc_resource_quota_unref_internal(s->resource_quota);
- gpr_free(s);
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- GRPC_ARG_RESOURCE_QUOTA " must be a pointer to a buffer pool");
- }
- }
- }
- gpr_ref_init(&s->refs, 1);
- s->on_accept_cb = nullptr;
- s->on_accept_cb_arg = nullptr;
- s->open_ports = 0;
- s->head = nullptr;
- s->tail = nullptr;
- s->shutdown_starting.head = nullptr;
- s->shutdown_starting.tail = nullptr;
- s->shutdown_complete = shutdown_complete;
- s->shutdown = false;
- *server = s;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_tcp_server* tcp_server_ref(grpc_tcp_server* s) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- gpr_ref(&s->refs);
- return s;
-}
-
-static void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
- grpc_closure* shutdown_starting) {
- grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
- GRPC_ERROR_NONE);
-}
-
-static void finish_shutdown(grpc_tcp_server* s) {
- GPR_ASSERT(s->shutdown);
- if (s->shutdown_complete != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
- GRPC_ERROR_NONE);
- }
-
- while (s->head) {
- grpc_tcp_listener* sp = s->head;
- s->head = sp->next;
- sp->next = nullptr;
- gpr_free(sp);
- }
- grpc_resource_quota_unref_internal(s->resource_quota);
- gpr_free(s);
-}
-
-static void custom_close_callback(grpc_custom_socket* socket) {
- grpc_tcp_listener* sp = socket->listener;
- if (sp) {
- grpc_core::ExecCtx exec_ctx;
- sp->server->open_ports--;
- if (sp->server->open_ports == 0 && sp->server->shutdown) {
- finish_shutdown(sp->server);
- }
- }
- socket->refs--;
- if (socket->refs == 0) {
- grpc_custom_socket_vtable->destroy(socket);
- gpr_free(socket);
- }
-}
-
-void grpc_custom_close_server_callback(grpc_tcp_listener* listener) {
- if (listener) {
- grpc_core::ExecCtx exec_ctx;
- listener->server->open_ports--;
- if (listener->server->open_ports == 0 && listener->server->shutdown) {
- finish_shutdown(listener->server);
- }
- }
-}
-
-static void close_listener(grpc_tcp_listener* sp) {
- grpc_custom_socket* socket = sp->socket;
- if (!sp->closed) {
- sp->closed = true;
- grpc_custom_socket_vtable->close(socket, custom_close_callback);
- }
-}
-
-static void tcp_server_destroy(grpc_tcp_server* s) {
- int immediately_done = 0;
- grpc_tcp_listener* sp;
-
- GPR_ASSERT(!s->shutdown);
- s->shutdown = true;
-
- if (s->open_ports == 0) {
- immediately_done = 1;
- }
- for (sp = s->head; sp; sp = sp->next) {
- close_listener(sp);
- }
-
- if (immediately_done) {
- finish_shutdown(s);
- }
-}
-
-static void tcp_server_unref(grpc_tcp_server* s) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- if (gpr_unref(&s->refs)) {
- /* Complete shutdown_starting work before destroying. */
- grpc_core::ExecCtx exec_ctx;
- grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &s->shutdown_starting);
- grpc_core::ExecCtx::Get()->Flush();
- tcp_server_destroy(s);
- }
-}
-
-static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
- grpc_tcp_server_acceptor* acceptor =
- static_cast<grpc_tcp_server_acceptor*>(gpr_malloc(sizeof(*acceptor)));
- grpc_endpoint* ep = nullptr;
- grpc_resolved_address peer_name;
- std::string peer_name_string;
- grpc_error_handle err;
-
- memset(&peer_name, 0, sizeof(grpc_resolved_address));
- peer_name.len = GRPC_MAX_SOCKADDR_SIZE;
- err = grpc_custom_socket_vtable->getpeername(
- socket, reinterpret_cast<grpc_sockaddr*>(&peer_name.addr),
- reinterpret_cast<int*>(&peer_name.len));
- if (err == GRPC_ERROR_NONE) {
- peer_name_string = grpc_sockaddr_to_uri(&peer_name);
- } else {
- GRPC_LOG_IF_ERROR("getpeername error", err);
- 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());
- }
- ep = custom_tcp_endpoint_create(socket, sp->server->resource_quota,
- peer_name_string.c_str());
- acceptor->from_server = sp->server;
- acceptor->port_index = sp->port_index;
- acceptor->fd_index = 0;
- acceptor->external_connection = false;
- sp->server->on_accept_cb(sp->server->on_accept_cb_arg, ep, nullptr, acceptor);
-}
-
-static void custom_accept_callback(grpc_custom_socket* socket,
- grpc_custom_socket* client,
- grpc_error_handle error);
-
-static void custom_accept_callback(grpc_custom_socket* socket,
- grpc_custom_socket* client,
- grpc_error_handle error) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- grpc_tcp_listener* sp = socket->listener;
- if (error != GRPC_ERROR_NONE) {
- if (!sp->closed) {
- gpr_log(GPR_ERROR, "Accept failed: %s",
- grpc_error_std_string(error).c_str());
- }
- gpr_free(client);
- GRPC_ERROR_UNREF(error);
- return;
- }
- finish_accept(sp, client);
- if (!sp->closed) {
- grpc_custom_socket* new_socket = static_cast<grpc_custom_socket*>(
- gpr_malloc(sizeof(grpc_custom_socket)));
- new_socket->endpoint = nullptr;
- new_socket->listener = nullptr;
- new_socket->connector = nullptr;
- new_socket->refs = 1;
- grpc_custom_socket_vtable->accept(sp->socket, new_socket,
- custom_accept_callback);
- }
-}
-
-static grpc_error_handle add_socket_to_server(grpc_tcp_server* s,
- grpc_custom_socket* socket,
- const grpc_resolved_address* addr,
- unsigned port_index,
- grpc_tcp_listener** listener) {
- grpc_tcp_listener* sp = nullptr;
- int port = -1;
- grpc_error_handle 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;
- }
-
- error = grpc_custom_socket_vtable->bind(
- socket, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)),
- addr->len, flags);
- if (error != GRPC_ERROR_NONE) {
- return error;
- }
-
- error = grpc_custom_socket_vtable->listen(socket);
- if (error != GRPC_ERROR_NONE) {
- return error;
- }
-
- sockname_temp.len = GRPC_MAX_SOCKADDR_SIZE;
- error = grpc_custom_socket_vtable->getsockname(
- socket, reinterpret_cast<grpc_sockaddr*>(&sockname_temp.addr),
- reinterpret_cast<int*>(&sockname_temp.len));
- if (error != GRPC_ERROR_NONE) {
- return error;
- }
-
- port = grpc_sockaddr_get_port(&sockname_temp);
-
- GPR_ASSERT(port >= 0);
- GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
- sp = static_cast<grpc_tcp_listener*>(gpr_zalloc(sizeof(grpc_tcp_listener)));
- sp->next = nullptr;
- if (s->head == nullptr) {
- s->head = sp;
- } else {
- s->tail->next = sp;
- }
- s->tail = sp;
- sp->server = s;
- sp->socket = socket;
- sp->port = port;
- sp->port_index = port_index;
- sp->closed = false;
- s->open_ports++;
- *listener = sp;
-
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* port) {
- // This function is mostly copied from tcp_server_windows.c
- grpc_tcp_listener* sp = nullptr;
- grpc_custom_socket* socket;
- grpc_resolved_address addr6_v4mapped;
- grpc_resolved_address wildcard;
- grpc_resolved_address* allocated_addr = nullptr;
- grpc_resolved_address sockname_temp;
- unsigned port_index = 0;
- grpc_error_handle error = GRPC_ERROR_NONE;
- int family;
-
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
-
- if (s->tail != nullptr) {
- port_index = s->tail->port_index + 1;
- }
-
- /* Check if this is a wildcard port, and if so, try to keep the port the same
- as some previously created listener. */
- if (grpc_sockaddr_get_port(addr) == 0) {
- for (sp = s->head; sp; sp = sp->next) {
- socket = sp->socket;
- sockname_temp.len = GRPC_MAX_SOCKADDR_SIZE;
- if (nullptr == grpc_custom_socket_vtable->getsockname(
- socket,
- reinterpret_cast<grpc_sockaddr*>(&sockname_temp.addr),
- reinterpret_cast<int*>(&sockname_temp.len))) {
- *port = grpc_sockaddr_get_port(&sockname_temp);
- if (*port > 0) {
- allocated_addr = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address)));
- memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
- grpc_sockaddr_set_port(allocated_addr, *port);
- addr = allocated_addr;
- break;
- }
- }
- }
- }
-
- if (grpc_sockaddr_to_v4mapped(addr, &addr6_v4mapped)) {
- addr = &addr6_v4mapped;
- }
-
- /* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */
- if (grpc_sockaddr_is_wildcard(addr, port)) {
- grpc_sockaddr_make_wildcard6(*port, &wildcard);
-
- addr = &wildcard;
- }
-
- 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_std_string(error).c_str());
- }
-
- family = grpc_sockaddr_get_family(addr);
- socket =
- static_cast<grpc_custom_socket*>(gpr_malloc(sizeof(grpc_custom_socket)));
- socket->refs = 1;
- socket->endpoint = nullptr;
- socket->listener = nullptr;
- socket->connector = nullptr;
- error = grpc_custom_socket_vtable->init(socket, family);
-
- if (error == GRPC_ERROR_NONE) {
- error = add_socket_to_server(s, socket, addr, port_index, &sp);
- }
- gpr_free(allocated_addr);
-
- if (error != GRPC_ERROR_NONE) {
- grpc_error_handle error_out =
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to add port to server", &error, 1);
- GRPC_ERROR_UNREF(error);
- error = error_out;
- *port = -1;
- } else {
- GPR_ASSERT(sp != nullptr);
- *port = sp->port;
- }
- socket->listener = sp;
- return error;
-}
-
-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();
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "SERVER_START %p", server);
- }
- GPR_ASSERT(on_accept_cb);
- GPR_ASSERT(!server->on_accept_cb);
- server->on_accept_cb = on_accept_cb;
- server->on_accept_cb_arg = cb_arg;
- for (sp = server->head; sp; sp = sp->next) {
- grpc_custom_socket* new_socket = static_cast<grpc_custom_socket*>(
- gpr_malloc(sizeof(grpc_custom_socket)));
- new_socket->endpoint = nullptr;
- new_socket->listener = nullptr;
- new_socket->connector = nullptr;
- new_socket->refs = 1;
- grpc_custom_socket_vtable->accept(sp->socket, new_socket,
- custom_accept_callback);
- }
-}
-
-static unsigned tcp_server_port_fd_count(grpc_tcp_server* /*s*/,
- unsigned /*port_index*/) {
- return 0;
-}
-
-static int tcp_server_port_fd(grpc_tcp_server* /*s*/, unsigned /*port_index*/,
- unsigned /*fd_index*/) {
- return -1;
-}
-
-static void tcp_server_shutdown_listeners(grpc_tcp_server* s) {
- for (grpc_tcp_listener* sp = s->head; sp; sp = sp->next) {
- if (!sp->closed) {
- sp->closed = true;
- grpc_custom_socket_vtable->close(sp->socket, custom_close_callback);
- }
- }
-}
-
-static grpc_core::TcpServerFdHandler* tcp_server_create_fd_handler(
- grpc_tcp_server* /*s*/) {
- return nullptr;
-}
-
-grpc_tcp_server_vtable custom_tcp_server_vtable = {
- tcp_server_create, tcp_server_start,
- tcp_server_add_port, tcp_server_create_fd_handler,
- tcp_server_port_fd_count, tcp_server_port_fd,
- tcp_server_ref, tcp_server_shutdown_starting_add,
- tcp_server_unref, tcp_server_shutdown_listeners};
-
-#ifdef GRPC_UV_TEST
-grpc_tcp_server_vtable* default_tcp_server_vtable = &custom_tcp_server_vtable;
-#endif
diff --git a/grpc/src/core/lib/iomgr/tcp_server_posix.cc b/grpc/src/core/lib/iomgr/tcp_server_posix.cc
index 5662aec7..f02bb839 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/grpc/src/core/lib/iomgr/tcp_server_posix.cc
@@ -29,6 +29,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <string.h>
@@ -59,12 +60,14 @@
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
+
+static std::atomic<int64_t> num_dropped_connections{0};
static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
const grpc_channel_args* args,
grpc_tcp_server** server) {
- grpc_tcp_server* s =
- static_cast<grpc_tcp_server*>(gpr_zalloc(sizeof(grpc_tcp_server)));
+ grpc_tcp_server* s = new grpc_tcp_server;
s->so_reuseport = grpc_is_socket_reuse_port_supported();
s->expand_wildcard_addrs = false;
for (size_t i = 0; i < (args == nullptr ? 0 : args->num_args); i++) {
@@ -102,6 +105,8 @@ static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
s->nports = 0;
s->channel_args = grpc_channel_args_copy(args);
s->fd_handler = nullptr;
+ s->memory_quota =
+ grpc_core::ResourceQuotaFromChannelArgs(args)->memory_quota();
gpr_atm_no_barrier_store(&s->next_pollset_to_assign, 0);
*server = s;
return GRPC_ERROR_NONE;
@@ -115,9 +120,7 @@ static void finish_shutdown(grpc_tcp_server* s) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
GRPC_ERROR_NONE);
}
-
gpr_mu_destroy(&s->mu);
-
while (s->head) {
grpc_tcp_listener* sp = s->head;
s->head = sp->next;
@@ -125,8 +128,7 @@ static void finish_shutdown(grpc_tcp_server* s) {
}
grpc_channel_args_destroy(s->channel_args);
delete s->fd_handler;
-
- gpr_free(s);
+ delete s;
}
static void destroyed_port(void* server, grpc_error_handle /*error*/) {
@@ -169,10 +171,8 @@ static void deactivated_all_ports(grpc_tcp_server* s) {
static void tcp_server_destroy(grpc_tcp_server* s) {
gpr_mu_lock(&s->mu);
-
GPR_ASSERT(!s->shutdown);
s->shutdown = true;
-
/* shutdown all fd's */
if (s->active_ports) {
grpc_tcp_listener* sp;
@@ -204,23 +204,35 @@ static void on_read(void* arg, grpc_error_handle err) {
strip off the ::ffff:0.0.0.0/96 prefix first. */
int fd = grpc_accept4(sp->fd, &addr, 1, 1);
if (fd < 0) {
- switch (errno) {
- case EINTR:
- continue;
- case EAGAIN:
- grpc_fd_notify_on_read(sp->emfd, &sp->read_closure);
- return;
- default:
- gpr_mu_lock(&sp->server->mu);
- if (!sp->server->shutdown_listeners) {
- gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno));
- } else {
- /* if we have shutdown listeners, accept4 could fail, and we
- needn't notify users */
- }
- gpr_mu_unlock(&sp->server->mu);
- goto error;
+ if (errno == EINTR) {
+ continue;
+ } else if (errno == EAGAIN || errno == ECONNABORTED ||
+ errno == EWOULDBLOCK) {
+ grpc_fd_notify_on_read(sp->emfd, &sp->read_closure);
+ return;
+ } else {
+ gpr_mu_lock(&sp->server->mu);
+ if (!sp->server->shutdown_listeners) {
+ gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno));
+ } else {
+ /* if we have shutdown listeners, accept4 could fail, and we
+ needn't notify users */
+ }
+ gpr_mu_unlock(&sp->server->mu);
+ goto error;
+ }
+ }
+
+ if (sp->server->memory_quota->IsMemoryPressureHigh()) {
+ int64_t dropped_connections_count = ++num_dropped_connections;
+ if (dropped_connections_count % 1000 == 0) {
+ gpr_log(GPR_INFO,
+ "Dropped >= %" PRId64
+ " new connection attempts due to high memory pressure",
+ dropped_connections_count);
}
+ close(fd);
+ continue;
}
/* For UNIX sockets, the accept call might not fill up the member sun_path
@@ -236,7 +248,13 @@ static void on_read(void* arg, grpc_error_handle err) {
}
}
- grpc_set_socket_no_sigpipe_if_possible(fd);
+ (void)grpc_set_socket_no_sigpipe_if_possible(fd);
+
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_SERVER_CONNECTION_USAGE,
+ sp->server->channel_args);
+ if (err != GRPC_ERROR_NONE) {
+ goto error;
+ }
std::string addr_str = grpc_sockaddr_to_uri(&addr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
@@ -261,10 +279,9 @@ static void on_read(void* arg, grpc_error_handle err) {
acceptor->port_index = sp->port_index;
acceptor->fd_index = sp->fd_index;
acceptor->external_connection = false;
-
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),
read_notifier_pollset, acceptor);
}
@@ -399,6 +416,7 @@ static grpc_error_handle clone_port(grpc_tcp_listener* listener,
static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
const grpc_resolved_address* addr,
int* out_port) {
+ GPR_ASSERT(addr->len <= GRPC_MAX_SOCKADDR_SIZE);
grpc_tcp_listener* sp;
grpc_resolved_address sockname_temp;
grpc_resolved_address addr6_v4mapped;
@@ -585,7 +603,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
close(fd);
return;
}
- grpc_set_socket_no_sigpipe_if_possible(fd);
+ (void)grpc_set_socket_no_sigpipe_if_possible(fd);
std::string addr_str = grpc_sockaddr_to_uri(&addr);
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s",
@@ -607,7 +625,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),
read_notifier_pollset, acceptor);
}
diff --git a/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h b/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
index ed4587a3..79527c24 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -25,6 +25,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
/* one listening port */
typedef struct grpc_tcp_listener {
@@ -52,48 +53,51 @@ typedef struct grpc_tcp_listener {
struct grpc_tcp_server {
gpr_refcount refs;
/* Called whenever accept() succeeds on a server port. */
- grpc_tcp_server_cb on_accept_cb;
- void* on_accept_cb_arg;
+ grpc_tcp_server_cb on_accept_cb = nullptr;
+ void* on_accept_cb_arg = nullptr;
gpr_mu mu;
/* active port count: how many ports are actually still listening */
- size_t active_ports;
+ size_t active_ports = 0;
/* destroyed port count: how many ports are completely destroyed */
- size_t destroyed_ports;
+ size_t destroyed_ports = 0;
/* is this server shutting down? */
- bool shutdown;
+ bool shutdown = false;
/* have listeners been shutdown? */
- bool shutdown_listeners;
+ bool shutdown_listeners = false;
/* use SO_REUSEPORT */
- bool so_reuseport;
+ bool so_reuseport = false;
/* expand wildcard addresses to a list of all local addresses */
- bool expand_wildcard_addrs;
+ bool expand_wildcard_addrs = false;
/* linked list of server ports */
- grpc_tcp_listener* head;
- grpc_tcp_listener* tail;
- unsigned nports;
+ grpc_tcp_listener* head = nullptr;
+ grpc_tcp_listener* tail = nullptr;
+ unsigned nports = 0;
/* List of closures passed to shutdown_starting_add(). */
- grpc_closure_list shutdown_starting;
+ grpc_closure_list shutdown_starting{nullptr, nullptr};
/* shutdown callback */
- grpc_closure* shutdown_complete;
+ grpc_closure* shutdown_complete = nullptr;
/* all pollsets interested in new connections. The object pointed at is not
* owned by this struct */
- const std::vector<grpc_pollset*>* pollsets;
+ const std::vector<grpc_pollset*>* pollsets = nullptr;
/* next pollset to assign a channel to */
- gpr_atm next_pollset_to_assign;
+ gpr_atm next_pollset_to_assign = 0;
/* channel args for this server */
- grpc_channel_args* channel_args;
+ grpc_channel_args* channel_args = nullptr;
/* a handler for external connections, owned */
- grpc_core::TcpServerFdHandler* fd_handler;
+ grpc_core::TcpServerFdHandler* fd_handler = nullptr;
+
+ /* used to create slice allocators for endpoints, owned */
+ grpc_core::MemoryQuotaRefPtr memory_quota;
};
/* If successful, add a listener to \a s for \a addr, set \a dsmode for the
diff --git a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index 6fdf0701..d0956db3 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -22,12 +22,11 @@
#ifdef GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON
-#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <sys/socket.h>
#include <string>
@@ -40,6 +39,7 @@
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#define MIN_SAFE_ACCEPT_QUEUE_SIZE 100
@@ -182,7 +182,8 @@ grpc_error_handle grpc_tcp_server_prepare_socket(
err = grpc_set_socket_no_sigpipe_if_possible(fd);
if (err != GRPC_ERROR_NONE) goto error;
- err = grpc_apply_socket_mutator_in_args(fd, s->channel_args);
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_SERVER_LISTENER_USAGE,
+ s->channel_args);
if (err != GRPC_ERROR_NONE) goto error;
if (bind(fd, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)),
diff --git a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
index a7e8f840..451ecbcf 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
+++ b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
@@ -22,12 +22,11 @@
#ifdef GRPC_HAVE_IFADDRS
-#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-
#include <errno.h>
#include <ifaddrs.h>
#include <stddef.h>
#include <string.h>
+#include <sys/socket.h>
#include <string>
@@ -39,6 +38,7 @@
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
/* Return the listener in s with address addr or NULL. */
static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s,
@@ -146,8 +146,8 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
}
if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
&new_sp)) != GRPC_ERROR_NONE) {
- grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Failed to add listener: ", addr_str).c_str());
+ grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Failed to add listener: ", addr_str));
err = grpc_error_add_child(root_err, err);
break;
} else {
diff --git a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
index a9354b00..beaf489e 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
+++ b/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
@@ -24,10 +24,10 @@
#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
- unsigned port_index,
- int requested_port,
- int* out_port) {
+grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* /*s*/,
+ unsigned /*port_index*/,
+ int /*requested_port*/,
+ int* /*out_port*/) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ifaddrs available");
}
diff --git a/grpc/src/core/lib/iomgr/tcp_server_windows.cc b/grpc/src/core/lib/iomgr/tcp_server_windows.cc
index 614ea35e..a01e4edc 100644
--- a/grpc/src/core/lib/iomgr/tcp_server_windows.cc
+++ b/grpc/src/core/lib/iomgr/tcp_server_windows.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <inttypes.h>
#include <io.h>
@@ -43,6 +41,7 @@
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/pollset_windows.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -166,7 +165,6 @@ static void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
static void tcp_server_destroy(grpc_tcp_server* s) {
grpc_tcp_listener* sp;
gpr_mu_lock(&s->mu);
-
/* First, shutdown all fd's. This will queue abortion calls for all
of the pending accepts due to the normal operation mechanism. */
if (s->active_ports == 0) {
@@ -228,11 +226,10 @@ static grpc_error_handle 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_sockaddr_to_uri(addr)),
GRPC_ERROR_INT_FD, (intptr_t)sock);
GRPC_ERROR_UNREF(error);
if (sock != INVALID_SOCKET) closesocket(sock);
@@ -324,7 +321,6 @@ static void on_accept(void* arg, grpc_error_handle error) {
gpr_mu_unlock(&sp->server->mu);
return;
}
-
/* The IOCP notified us of a completed operation. Let's grab the results,
and act accordingly. */
transfered_bytes = 0;
@@ -359,7 +355,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
}
std::string fd_name = 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());
+ sp->server->channel_args, peer_name_string);
} else {
closesocket(sock);
}
diff --git a/grpc/src/core/lib/iomgr/tcp_uv.cc b/grpc/src/core/lib/iomgr/tcp_uv.cc
deleted file mode 100644
index 8f64d22b..00000000
--- a/grpc/src/core/lib/iomgr/tcp_uv.cc
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#ifdef GRPC_UV
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/slice_buffer.h>
-
-#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/iomgr/error.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/resolve_address_custom.h"
-#include "src/core/lib/iomgr/resource_quota.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-
-#include <uv.h>
-
-#define IGNORE_CONST(addr) ((grpc_sockaddr*)(uintptr_t)(addr))
-
-typedef struct uv_socket_t {
- uv_connect_t connect_req;
- uv_write_t write_req;
- uv_shutdown_t shutdown_req;
- uv_tcp_t* handle;
- uv_buf_t* write_buffers;
-
- char* read_buf;
- size_t read_len;
-
- int pending_connections;
- grpc_custom_socket* accept_socket;
- grpc_error_handle accept_error;
-
- grpc_custom_connect_callback connect_cb;
- grpc_custom_write_callback write_cb;
- grpc_custom_read_callback read_cb;
- grpc_custom_accept_callback accept_cb;
- grpc_custom_close_callback close_cb;
-
-} uv_socket_t;
-
-static grpc_error_handle tcp_error_create(const char* desc, int status) {
- if (status == 0) {
- return GRPC_ERROR_NONE;
- }
- grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc);
- /* All tcp errors are marked with UNAVAILABLE so that application may
- * choose to retry. */
- error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAVAILABLE);
- return grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(uv_strerror(status)));
-}
-
-static void uv_socket_destroy(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- gpr_free(uv_socket->handle);
- gpr_free(uv_socket);
-}
-
-static void alloc_uv_buf(uv_handle_t* handle, size_t suggested_size,
- uv_buf_t* buf) {
- uv_socket_t* uv_socket =
- (uv_socket_t*)((grpc_custom_socket*)handle->data)->impl;
- (void)suggested_size;
- buf->base = uv_socket->read_buf;
- buf->len = uv_socket->read_len;
-}
-
-static void uv_read_callback(uv_stream_t* stream, ssize_t nread,
- const uv_buf_t* buf) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (nread == 0) {
- // Nothing happened. Wait for the next callback
- return;
- }
- // TODO(murgatroid99): figure out what the return value here means
- uv_read_stop(stream);
- if (nread == UV_EOF) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("EOF");
- } else if (nread < 0) {
- error = tcp_error_create("TCP Read failed", nread);
- }
- grpc_custom_socket* socket = (grpc_custom_socket*)stream->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->read_cb(socket, (size_t)nread, error);
-}
-
-static void uv_close_callback(uv_handle_t* handle) {
- grpc_custom_socket* socket = (grpc_custom_socket*)handle->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (uv_socket->accept_socket) {
- uv_socket->accept_cb(socket, uv_socket->accept_socket,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("socket closed"));
- }
- uv_socket->close_cb(socket);
-}
-
-static void uv_socket_read(grpc_custom_socket* socket, char* buffer,
- size_t length, grpc_custom_read_callback read_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status;
- grpc_error_handle error;
- uv_socket->read_cb = read_cb;
- uv_socket->read_buf = buffer;
- uv_socket->read_len = length;
- // TODO(murgatroid99): figure out what the return value here means
- status =
- uv_read_start((uv_stream_t*)uv_socket->handle, (uv_alloc_cb)alloc_uv_buf,
- (uv_read_cb)uv_read_callback);
- if (status != 0) {
- error = tcp_error_create("TCP Read failed at start", status);
- uv_socket->read_cb(socket, 0, error);
- }
-}
-
-static void uv_write_callback(uv_write_t* req, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)req->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- gpr_free(uv_socket->write_buffers);
- uv_socket->write_cb(socket, tcp_error_create("TCP Write failed", status));
-}
-
-void uv_socket_write(grpc_custom_socket* socket,
- grpc_slice_buffer* write_slices,
- grpc_custom_write_callback write_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->write_cb = write_cb;
- uv_buf_t* uv_buffers;
- uv_write_t* write_req;
-
- uv_buffers = (uv_buf_t*)gpr_malloc(sizeof(uv_buf_t) * write_slices->count);
- for (size_t i = 0; i < write_slices->count; i++) {
- uv_buffers[i].base = (char*)GRPC_SLICE_START_PTR(write_slices->slices[i]);
- uv_buffers[i].len = GRPC_SLICE_LENGTH(write_slices->slices[i]);
- }
-
- uv_socket->write_buffers = uv_buffers;
- write_req = &uv_socket->write_req;
- write_req->data = socket;
- // TODO(murgatroid99): figure out what the return value here means
- uv_write(write_req, (uv_stream_t*)uv_socket->handle, uv_buffers,
- write_slices->count, uv_write_callback);
-}
-
-static void shutdown_callback(uv_shutdown_t* req, int status) {}
-
-static void uv_socket_shutdown(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_shutdown_t* req = &uv_socket->shutdown_req;
- uv_shutdown(req, (uv_stream_t*)uv_socket->handle, shutdown_callback);
-}
-
-static void uv_socket_close(grpc_custom_socket* socket,
- grpc_custom_close_callback close_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->close_cb = close_cb;
- uv_close((uv_handle_t*)uv_socket->handle, uv_close_callback);
-}
-
-static grpc_error_handle uv_socket_init_helper(uv_socket_t* uv_socket,
- int domain) {
- uv_tcp_t* tcp = (uv_tcp_t*)gpr_malloc(sizeof(uv_tcp_t));
- uv_socket->handle = tcp;
- int status = uv_tcp_init_ex(uv_default_loop(), tcp, (unsigned int)domain);
- if (status != 0) {
- return tcp_error_create("Failed to initialize UV tcp handle", status);
- }
-#if defined(GPR_LINUX) && defined(SO_REUSEPORT)
- if (domain == AF_INET || domain == AF_INET6) {
- int enable = 1;
- int fd;
- uv_fileno((uv_handle_t*)tcp, &fd);
- // TODO Handle error here.
- setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(enable));
- }
-#endif
- uv_socket->write_buffers = nullptr;
- uv_socket->read_len = 0;
- uv_tcp_nodelay(uv_socket->handle, 1);
- // Node uses a garbage collector to call destructors, so we don't
- // want to hold the uv loop open with active gRPC objects.
- uv_unref((uv_handle_t*)uv_socket->handle);
- uv_socket->pending_connections = 0;
- uv_socket->accept_socket = nullptr;
- uv_socket->accept_error = GRPC_ERROR_NONE;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle uv_socket_init(grpc_custom_socket* socket,
- int domain) {
- uv_socket_t* uv_socket = (uv_socket_t*)gpr_malloc(sizeof(uv_socket_t));
- grpc_error_handle error = uv_socket_init_helper(uv_socket, domain);
- if (error != GRPC_ERROR_NONE) {
- return error;
- }
- uv_socket->handle->data = socket;
- socket->impl = uv_socket;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error_handle uv_socket_getpeername(grpc_custom_socket* socket,
- const grpc_sockaddr* addr,
- int* addr_len) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int err = uv_tcp_getpeername(uv_socket->handle,
- (struct sockaddr*)IGNORE_CONST(addr), addr_len);
- return tcp_error_create("getpeername failed", err);
-}
-
-static grpc_error_handle uv_socket_getsockname(grpc_custom_socket* socket,
- const grpc_sockaddr* addr,
- int* addr_len) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int err = uv_tcp_getsockname(uv_socket->handle,
- (struct sockaddr*)IGNORE_CONST(addr), addr_len);
- return tcp_error_create("getsockname failed", err);
-}
-
-static void accept_new_connection(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (uv_socket->pending_connections == 0 || !uv_socket->accept_socket) {
- return;
- }
- grpc_custom_socket* new_socket = uv_socket->accept_socket;
- grpc_error_handle error = uv_socket->accept_error;
- uv_socket->accept_socket = nullptr;
- uv_socket->accept_error = GRPC_ERROR_NONE;
- uv_socket->pending_connections -= 1;
- if (uv_socket->accept_error != GRPC_ERROR_NONE) {
- uv_stream_t phony_handle;
- uv_accept((uv_stream_t*)uv_socket->handle, &phony_handle);
- uv_socket->accept_cb(socket, new_socket, error);
- } else {
- uv_socket_t* uv_new_socket = (uv_socket_t*)gpr_malloc(sizeof(uv_socket_t));
- uv_socket_init_helper(uv_new_socket, AF_UNSPEC);
- // UV documentation says this is guaranteed to succeed
- GPR_ASSERT(uv_accept((uv_stream_t*)uv_socket->handle,
- (uv_stream_t*)uv_new_socket->handle) == 0);
- new_socket->impl = uv_new_socket;
- uv_new_socket->handle->data = new_socket;
- uv_socket->accept_cb(socket, new_socket, error);
- }
-}
-
-static void uv_on_connect(uv_stream_t* server, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)server->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (status < 0) {
- switch (status) {
- case UV_EINTR:
- case UV_EAGAIN:
- return;
- default:
- uv_socket->accept_error = tcp_error_create("accept failed", status);
- }
- }
- uv_socket->pending_connections += 1;
- accept_new_connection(socket);
-}
-
-void uv_socket_accept(grpc_custom_socket* socket,
- grpc_custom_socket* new_socket,
- grpc_custom_accept_callback accept_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->accept_cb = accept_cb;
- GPR_ASSERT(uv_socket->accept_socket == nullptr);
- uv_socket->accept_socket = new_socket;
- accept_new_connection(socket);
-}
-
-static grpc_error_handle uv_socket_bind(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, size_t len,
- int flags) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status =
- uv_tcp_bind((uv_tcp_t*)uv_socket->handle, (struct sockaddr*)addr, 0);
- return tcp_error_create("Failed to bind to port", status);
-}
-
-static grpc_error_handle uv_socket_listen(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status =
- uv_listen((uv_stream_t*)uv_socket->handle, SOMAXCONN, uv_on_connect);
- return tcp_error_create("Failed to listen to port", status);
-}
-
-static void uv_tc_on_connect(uv_connect_t* req, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)req->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- grpc_error_handle error;
- if (status == UV_ECANCELED) {
- // This should only happen if the handle is already closed
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Timeout occurred");
- } else {
- error = tcp_error_create("Failed to connect to remote host", status);
- }
- uv_socket->connect_cb(socket, error);
-}
-
-static void uv_socket_connect(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, size_t len,
- grpc_custom_connect_callback connect_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->connect_cb = connect_cb;
- uv_socket->connect_req.data = socket;
- int status = uv_tcp_connect(&uv_socket->connect_req, uv_socket->handle,
- (struct sockaddr*)addr, uv_tc_on_connect);
- if (status != 0) {
- // The callback will not be called
- uv_socket->connect_cb(socket, tcp_error_create("connect failed", status));
- }
-}
-
-static grpc_resolved_addresses* handle_addrinfo_result(
- struct addrinfo* result) {
- struct addrinfo* resp;
- size_t i;
- grpc_resolved_addresses* addresses =
- (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
- addresses->naddrs = 0;
- for (resp = result; resp != nullptr; resp = resp->ai_next) {
- addresses->naddrs++;
- }
- addresses->addrs = (grpc_resolved_address*)gpr_malloc(
- sizeof(grpc_resolved_address) * addresses->naddrs);
- for (resp = result, i = 0; resp != nullptr; resp = resp->ai_next, i++) {
- memcpy(&addresses->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
- addresses->addrs[i].len = resp->ai_addrlen;
- }
- // addrinfo objects are allocated by libuv (e.g. in uv_getaddrinfo)
- // and not by gpr_malloc
- uv_freeaddrinfo(result);
- return addresses;
-}
-
-static void uv_resolve_callback(uv_getaddrinfo_t* req, int status,
- struct addrinfo* res) {
- grpc_custom_resolver* r = (grpc_custom_resolver*)req->data;
- gpr_free(req);
- grpc_resolved_addresses* result = nullptr;
- if (status == 0) {
- result = handle_addrinfo_result(res);
- }
- grpc_custom_resolve_callback(r, result,
- tcp_error_create("getaddrinfo failed", status));
-}
-
-static grpc_error_handle uv_resolve(const char* host, const char* port,
- grpc_resolved_addresses** result) {
- int status;
- uv_getaddrinfo_t req;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */
- hints.ai_socktype = SOCK_STREAM; /* stream socket */
- hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
- status = uv_getaddrinfo(uv_default_loop(), &req, NULL, host, port, &hints);
- if (status != 0) {
- *result = nullptr;
- } else {
- *result = handle_addrinfo_result(req.addrinfo);
- }
- return tcp_error_create("getaddrinfo failed", status);
-}
-
-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));
- req->data = r;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = GRPC_AF_UNSPEC; /* ipv4 or ipv6 */
- hints.ai_socktype = GRPC_SOCK_STREAM; /* stream socket */
- hints.ai_flags = GRPC_AI_PASSIVE; /* for wildcard IP address */
- status = uv_getaddrinfo(uv_default_loop(), req, uv_resolve_callback, host,
- port, &hints);
- if (status != 0) {
- gpr_free(req);
- grpc_error_handle error = tcp_error_create("getaddrinfo failed", status);
- grpc_custom_resolve_callback(r, NULL, error);
- }
-}
-
-grpc_custom_resolver_vtable uv_resolver_vtable = {uv_resolve, uv_resolve_async};
-
-grpc_socket_vtable grpc_uv_socket_vtable = {
- uv_socket_init, uv_socket_connect, uv_socket_destroy,
- uv_socket_shutdown, uv_socket_close, uv_socket_write,
- uv_socket_read, uv_socket_getpeername, uv_socket_getsockname,
- uv_socket_bind, uv_socket_listen, uv_socket_accept};
-
-#endif
diff --git a/grpc/src/core/lib/iomgr/tcp_windows.cc b/grpc/src/core/lib/iomgr/tcp_windows.cc
index aa693cc1..40a60b5f 100644
--- a/grpc/src/core/lib/iomgr/tcp_windows.cc
+++ b/grpc/src/core/lib/iomgr/tcp_windows.cc
@@ -24,8 +24,6 @@
#include <limits.h>
-#include "src/core/lib/iomgr/sockaddr_windows.h"
-
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -36,6 +34,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -117,8 +116,6 @@ typedef struct grpc_tcp {
grpc_slice_buffer* write_slices;
grpc_slice_buffer* read_slices;
- grpc_resource_user* resource_user;
-
/* The IO Completion Port runs from another thread. We need some mechanism
to protect ourselves when requesting a shutdown. */
gpr_mu mu;
@@ -133,7 +130,6 @@ static void tcp_free(grpc_tcp* tcp) {
grpc_winsocket_destroy(tcp->socket);
gpr_mu_destroy(&tcp->mu);
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;
}
@@ -187,7 +183,7 @@ static void on_read(void* tcpp, grpc_error_handle error) {
gpr_log(GPR_INFO, "TCP:%p on_read", tcp);
}
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
if (error == GRPC_ERROR_NONE) {
if (info->wsa_error != 0 && !tcp->shutting_down) {
@@ -223,10 +219,12 @@ static void on_read(void* tcpp, grpc_error_handle error) {
gpr_log(GPR_INFO, "TCP:%p unref read_slice", tcp);
}
grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices);
- error = tcp->shutting_down
- ? GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "TCP stream shutting down", &tcp->shutdown_error, 1)
- : GRPC_ERROR_CREATE_FROM_STATIC_STRING("End of TCP stream");
+ error = grpc_error_set_int(
+ tcp->shutting_down
+ ? GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "TCP stream shutting down", &tcp->shutdown_error, 1)
+ : GRPC_ERROR_CREATE_FROM_STATIC_STRING("End of TCP stream"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
}
}
}
@@ -256,8 +254,10 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
if (tcp->shutting_down) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, cb,
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "TCP socket is shutting down", &tcp->shutdown_error, 1));
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "TCP socket is shutting down", &tcp->shutdown_error, 1),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
return;
}
@@ -323,7 +323,7 @@ static void on_write(void* tcpp, grpc_error_handle error) {
gpr_log(GPR_INFO, "TCP:%p on_write", tcp);
}
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
gpr_mu_lock(&tcp->mu);
cb = tcp->write_cb;
@@ -370,8 +370,10 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
if (tcp->shutting_down) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, cb,
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "TCP socket is shutting down", &tcp->shutdown_error, 1));
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "TCP socket is shutting down", &tcp->shutdown_error, 1),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
return;
}
@@ -467,7 +469,6 @@ static void win_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
}
grpc_winsocket_shutdown(tcp->socket);
gpr_mu_unlock(&tcp->mu);
- grpc_resource_user_shutdown(tcp->resource_user);
}
static void win_destroy(grpc_endpoint* ep) {
@@ -486,11 +487,6 @@ static absl::string_view win_get_local_address(grpc_endpoint* 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;
-}
-
static int win_get_fd(grpc_endpoint* ep) { return -1; }
static bool win_can_track_err(grpc_endpoint* ep) { return false; }
@@ -502,7 +498,6 @@ static grpc_endpoint_vtable vtable = {win_read,
win_delete_from_pollset_set,
win_shutdown,
win_destroy,
- win_get_resource_user,
win_get_peer,
win_get_local_address,
win_get_fd,
@@ -510,19 +505,10 @@ static grpc_endpoint_vtable vtable = {win_read,
grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
grpc_channel_args* channel_args,
- const char* peer_string) {
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
- if (channel_args != NULL) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota = grpc_resource_quota_ref_internal(
- (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
- }
- }
- }
- grpc_tcp* tcp = new grpc_tcp;
- memset(tcp, 0, sizeof(grpc_tcp));
+ absl::string_view peer_string) {
+ // TODO(jtattermusch): C++ize grpc_tcp and its dependencies (i.e. add
+ // constructors) to ensure proper initialization
+ grpc_tcp* tcp = new grpc_tcp{};
tcp->base.vtable = &vtable;
tcp->socket = socket;
gpr_mu_init(&tcp->mu);
@@ -538,11 +524,8 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
} else {
tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
}
- tcp->peer_string = peer_string;
+ tcp->peer_string = std::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);
-
return &tcp->base;
}
diff --git a/grpc/src/core/lib/iomgr/tcp_windows.h b/grpc/src/core/lib/iomgr/tcp_windows.h
index de3dc550..9c6ad526 100644
--- a/grpc/src/core/lib/iomgr/tcp_windows.h
+++ b/grpc/src/core/lib/iomgr/tcp_windows.h
@@ -42,7 +42,7 @@
*/
grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
grpc_channel_args* channel_args,
- const char* peer_string);
+ absl::string_view peer_string);
grpc_error_handle grpc_tcp_prepare_socket(SOCKET sock);
diff --git a/grpc/src/core/lib/iomgr/timer.cc b/grpc/src/core/lib/iomgr/timer.cc
index e647cdef..39af4198 100644
--- a/grpc/src/core/lib/iomgr/timer.cc
+++ b/grpc/src/core/lib/iomgr/timer.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/timer.h"
+
#include "src/core/lib/iomgr/timer_manager.h"
grpc_timer_vtable* grpc_timer_impl;
@@ -27,14 +28,14 @@ void grpc_set_timer_impl(grpc_timer_vtable* vtable) {
grpc_timer_impl = vtable;
}
-void grpc_timer_init(grpc_timer* timer, grpc_millis deadline,
+void grpc_timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
grpc_closure* closure) {
grpc_timer_impl->init(timer, deadline, closure);
}
void grpc_timer_cancel(grpc_timer* timer) { grpc_timer_impl->cancel(timer); }
-grpc_timer_check_result grpc_timer_check(grpc_millis* next) {
+grpc_timer_check_result grpc_timer_check(grpc_core::Timestamp* next) {
return grpc_timer_impl->check(next);
}
diff --git a/grpc/src/core/lib/iomgr/timer.h b/grpc/src/core/lib/iomgr/timer.h
index 11da1496..675df66a 100644
--- a/grpc/src/core/lib/iomgr/timer.h
+++ b/grpc/src/core/lib/iomgr/timer.h
@@ -21,14 +21,17 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include <cstdint>
+#include <grpc/event_engine/event_engine.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/port.h"
typedef struct grpc_timer {
- grpc_millis deadline;
+ int64_t deadline;
// Uninitialized if not using heap, or INVALID_HEAP_INDEX if not in heap.
uint32_t heap_index;
bool pending;
@@ -40,9 +43,15 @@ typedef struct grpc_timer {
#endif
// Optional field used by custom timers
- void* custom_timer;
+ union {
+ void* custom_timer;
+ grpc_event_engine::experimental::EventEngine::TaskHandle ee_task_handle;
+ };
} grpc_timer;
+static_assert(std::is_trivial<grpc_timer>::value,
+ "grpc_timer is expected to be a trivial type");
+
typedef enum {
GRPC_TIMERS_NOT_CHECKED,
GRPC_TIMERS_CHECKED_AND_EMPTY,
@@ -50,11 +59,11 @@ typedef enum {
} grpc_timer_check_result;
typedef struct grpc_timer_vtable {
- void (*init)(grpc_timer* timer, grpc_millis, grpc_closure* closure);
+ void (*init)(grpc_timer* timer, grpc_core::Timestamp, grpc_closure* closure);
void (*cancel)(grpc_timer* timer);
/* Internal API */
- grpc_timer_check_result (*check)(grpc_millis* next);
+ grpc_timer_check_result (*check)(grpc_core::Timestamp* next);
void (*list_init)();
void (*list_shutdown)(void);
void (*consume_kick)(void);
@@ -66,8 +75,8 @@ typedef struct grpc_timer_vtable {
application code should check the error to determine how it was invoked. The
application callback is also responsible for maintaining information about
when to free up any user-level state. Behavior is undefined for a deadline of
- GRPC_MILLIS_INF_FUTURE. */
-void grpc_timer_init(grpc_timer* timer, grpc_millis deadline,
+ grpc_core::Timestamp::InfFuture(). */
+void grpc_timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
grpc_closure* closure);
/* Initialize *timer without setting it. This can later be passed through
@@ -111,7 +120,7 @@ void grpc_timer_cancel(grpc_timer* timer);
*next is never guaranteed to be updated on any given execution; however,
with high probability at least one thread in the system will see an update
at any time slice. */
-grpc_timer_check_result grpc_timer_check(grpc_millis* next);
+grpc_timer_check_result grpc_timer_check(grpc_core::Timestamp* next);
void grpc_timer_list_init();
void grpc_timer_list_shutdown();
diff --git a/grpc/src/core/lib/iomgr/timer_custom.cc b/grpc/src/core/lib/iomgr/timer_custom.cc
deleted file mode 100644
index cb01b7ce..00000000
--- a/grpc/src/core/lib/iomgr/timer_custom.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-static grpc_custom_timer_vtable* custom_timer_impl;
-
-void grpc_custom_timer_callback(grpc_custom_timer* t,
- grpc_error_handle /*error*/) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- grpc_timer* timer = t->original;
- GPR_ASSERT(timer->pending);
- timer->pending = false;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure, GRPC_ERROR_NONE);
- custom_timer_impl->stop(t);
- gpr_free(t);
-}
-
-static void timer_init(grpc_timer* timer, grpc_millis deadline,
- grpc_closure* closure) {
- uint64_t timeout;
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
- if (deadline <= grpc_core::ExecCtx::Get()->Now()) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
- timer->pending = false;
- return;
- } else {
- timeout = deadline - now;
- }
- timer->pending = true;
- timer->closure = closure;
- grpc_custom_timer* timer_wrapper =
- static_cast<grpc_custom_timer*>(gpr_malloc(sizeof(grpc_custom_timer)));
- timer_wrapper->timeout_ms = timeout;
- timer->custom_timer = timer_wrapper;
- timer_wrapper->original = timer;
- custom_timer_impl->start(timer_wrapper);
-}
-
-static void timer_cancel(grpc_timer* timer) {
- GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
- grpc_custom_timer* tw = static_cast<grpc_custom_timer*>(timer->custom_timer);
- if (timer->pending) {
- timer->pending = false;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure,
- GRPC_ERROR_CANCELLED);
- custom_timer_impl->stop(tw);
- gpr_free(tw);
- }
-}
-
-static grpc_timer_check_result timer_check(grpc_millis* /*next*/) {
- return GRPC_TIMERS_NOT_CHECKED;
-}
-
-static void timer_list_init() {}
-static void timer_list_shutdown() {}
-
-static void timer_consume_kick(void) {}
-
-static grpc_timer_vtable custom_timer_vtable = {
- timer_init, timer_cancel, timer_check,
- timer_list_init, timer_list_shutdown, timer_consume_kick};
-
-void grpc_custom_timer_init(grpc_custom_timer_vtable* impl) {
- custom_timer_impl = impl;
- grpc_set_timer_impl(&custom_timer_vtable);
-}
diff --git a/grpc/src/core/lib/iomgr/timer_custom.h b/grpc/src/core/lib/iomgr/timer_custom.h
deleted file mode 100644
index 83c3e8dd..00000000
--- a/grpc/src/core/lib/iomgr/timer_custom.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * 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_IOMGR_TIMER_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_TIMER_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/timer.h"
-
-typedef struct grpc_custom_timer {
- // Implementation defined
- void* timer;
- uint64_t timeout_ms;
-
- grpc_timer* original;
-} grpc_custom_timer;
-
-typedef struct grpc_custom_timer_vtable {
- void (*start)(grpc_custom_timer* t);
- void (*stop)(grpc_custom_timer* t);
-} grpc_custom_timer_vtable;
-
-void grpc_custom_timer_init(grpc_custom_timer_vtable* impl);
-
-void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error_handle error);
-
-#endif /* GRPC_CORE_LIB_IOMGR_TIMER_CUSTOM_H */
diff --git a/grpc/src/core/lib/iomgr/timer_generic.cc b/grpc/src/core/lib/iomgr/timer_generic.cc
index 3d2fc006..e4e0e6ab 100644
--- a/grpc/src/core/lib/iomgr/timer_generic.cc
+++ b/grpc/src/core/lib/iomgr/timer_generic.cc
@@ -18,16 +18,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <inttypes.h>
#include <string>
#include "absl/strings/str_cat.h"
-#include "src/core/lib/iomgr/timer.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
@@ -37,15 +33,18 @@
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/time_averaged_stats.h"
+#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/timer_heap.h"
#define INVALID_HEAP_INDEX 0xffffffffu
#define ADD_DEADLINE_SCALE 0.33
#define MIN_QUEUE_WINDOW_DURATION 0.01
-#define MAX_QUEUE_WINDOW_DURATION 1
+#define MAX_QUEUE_WINDOW_DURATION 1.0
grpc_core::TraceFlag grpc_timer_trace(false, "timer");
grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check");
@@ -63,9 +62,9 @@ struct timer_shard {
gpr_mu mu;
grpc_time_averaged_stats stats;
/* All and only timers with deadlines < this will be in the heap. */
- grpc_millis queue_deadline_cap;
+ grpc_core::Timestamp queue_deadline_cap;
/* The deadline of the next timer due in this shard. */
- grpc_millis min_deadline;
+ grpc_core::Timestamp min_deadline;
/* Index of this timer_shard in the g_shard_queue. */
uint32_t shard_queue_index;
/* This holds all timers with deadlines < queue_deadline_cap. Timers in this
@@ -107,7 +106,7 @@ static void destroy_timer_ht() {
}
static bool is_in_ht(grpc_timer* t) {
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
gpr_mu_lock(&g_hash_mu[i]);
grpc_timer* p = g_timer_ht[i];
@@ -121,7 +120,7 @@ static bool is_in_ht(grpc_timer* t) {
static void add_to_ht(grpc_timer* t) {
GPR_ASSERT(!t->hash_table_next);
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
gpr_mu_lock(&g_hash_mu[i]);
grpc_timer* p = g_timer_ht[i];
@@ -146,7 +145,7 @@ static void add_to_ht(grpc_timer* t) {
}
static void remove_from_ht(grpc_timer* t) {
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
bool removed = false;
gpr_mu_lock(&g_hash_mu[i]);
@@ -212,23 +211,15 @@ static void validate_non_pending_timer(grpc_timer* t) {
#endif
-#if GPR_ARCH_64
-/* NOTE: TODO(sreek) - Currently the thread local storage support in grpc is
- for intptr_t which means on 32-bit machines it is not wide enough to hold
- grpc_millis which is 64-bit. Adding thread local support for 64 bit values
- is a lot of work for very little gain. So we are currently restricting this
- optimization to only 64 bit machines */
-
/* Thread local variable that stores the deadline of the next timer the thread
* has last-seen. This is an optimization to prevent the thread from checking
* shared_mutables.min_timer (which requires acquiring shared_mutables.mu lock,
* an expensive operation) */
-GPR_TLS_DECL(g_last_seen_min_timer);
-#endif
+static GPR_THREAD_LOCAL(int64_t) g_last_seen_min_timer;
struct shared_mutables {
/* The deadline of the next timer due across all timer shards */
- grpc_millis min_timer;
+ grpc_core::Timestamp min_timer;
/* Allow only one run_some_expired_timers at once */
gpr_spinlock checker_mu;
bool initialized;
@@ -238,27 +229,21 @@ struct shared_mutables {
static struct shared_mutables g_shared_mutables;
-static grpc_millis saturating_add(grpc_millis a, grpc_millis b) {
- if (a > GRPC_MILLIS_INF_FUTURE - b) {
- return GRPC_MILLIS_INF_FUTURE;
- }
- return a + b;
-}
-
-static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
- grpc_millis* next,
- grpc_error_handle error);
+static grpc_timer_check_result run_some_expired_timers(
+ grpc_core::Timestamp now, grpc_core::Timestamp* next,
+ grpc_error_handle error);
-static grpc_millis compute_min_deadline(timer_shard* shard) {
+static grpc_core::Timestamp compute_min_deadline(timer_shard* shard) {
return grpc_timer_heap_is_empty(&shard->heap)
- ? saturating_add(shard->queue_deadline_cap, 1)
- : grpc_timer_heap_top(&shard->heap)->deadline;
+ ? shard->queue_deadline_cap + grpc_core::Duration::Epsilon()
+ : grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ grpc_timer_heap_top(&shard->heap)->deadline);
}
static void timer_list_init() {
uint32_t i;
- g_num_shards = GPR_CLAMP(2 * gpr_cpu_num_cores(), 1, 32);
+ g_num_shards = grpc_core::Clamp(2 * gpr_cpu_num_cores(), 1u, 32u);
g_shards =
static_cast<timer_shard*>(gpr_zalloc(g_num_shards * sizeof(*g_shards)));
g_shard_queue = static_cast<timer_shard**>(
@@ -269,10 +254,7 @@ static void timer_list_init() {
gpr_mu_init(&g_shared_mutables.mu);
g_shared_mutables.min_timer = grpc_core::ExecCtx::Get()->Now();
-#if GPR_ARCH_64
- gpr_tls_init(&g_last_seen_min_timer);
- gpr_tls_set(&g_last_seen_min_timer, 0);
-#endif
+ g_last_seen_min_timer = 0;
for (i = 0; i < g_num_shards; i++) {
timer_shard* shard = &g_shards[i];
@@ -293,7 +275,7 @@ static void timer_list_init() {
static void timer_list_shutdown() {
size_t i;
run_some_expired_timers(
- GRPC_MILLIS_INF_FUTURE, nullptr,
+ grpc_core::Timestamp::InfFuture(), nullptr,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Timer list shutdown"));
for (i = 0; i < g_num_shards; i++) {
timer_shard* shard = &g_shards[i];
@@ -301,11 +283,6 @@ static void timer_list_shutdown() {
grpc_timer_heap_destroy(&shard->heap);
}
gpr_mu_destroy(&g_shared_mutables.mu);
-
-#if GPR_ARCH_64
- gpr_tls_destroy(&g_last_seen_min_timer);
-#endif
-
gpr_free(g_shards);
gpr_free(g_shard_queue);
g_shared_mutables.initialized = false;
@@ -352,12 +329,12 @@ static void note_deadline_change(timer_shard* shard) {
void grpc_timer_init_unset(grpc_timer* timer) { timer->pending = false; }
-static void timer_init(grpc_timer* timer, grpc_millis deadline,
+static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
grpc_closure* closure) {
int is_first_timer = 0;
- timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, g_num_shards)];
+ timer_shard* shard = &g_shards[grpc_core::HashPointer(timer, g_num_shards)];
timer->closure = closure;
- timer->deadline = deadline;
+ timer->deadline = deadline.milliseconds_after_process_epoch();
#ifndef NDEBUG
timer->hash_table_next = nullptr;
@@ -365,8 +342,9 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) {
gpr_log(GPR_INFO, "TIMER %p: SET %" PRId64 " now %" PRId64 " call %p[%p]",
- timer, deadline, grpc_core::ExecCtx::Get()->Now(), closure,
- closure->cb);
+ timer, deadline.milliseconds_after_process_epoch(),
+ grpc_core::ExecCtx::Get()->Now().milliseconds_after_process_epoch(),
+ closure, closure->cb);
}
if (!g_shared_mutables.initialized) {
@@ -380,7 +358,7 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
gpr_mu_lock(&shard->mu);
timer->pending = true;
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
+ grpc_core::Timestamp now = grpc_core::ExecCtx::Get()->Now();
if (deadline <= now) {
timer->pending = false;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure, GRPC_ERROR_NONE);
@@ -389,8 +367,8 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
return;
}
- grpc_time_averaged_stats_add_sample(
- &shard->stats, static_cast<double>(deadline - now) / 1000.0);
+ grpc_time_averaged_stats_add_sample(&shard->stats,
+ (deadline - now).millis() / 1000.0);
ADD_TO_HASH_TABLE(timer);
@@ -404,7 +382,8 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
gpr_log(GPR_INFO,
" .. add to shard %d with queue_deadline_cap=%" PRId64
" => is_first_timer=%s",
- static_cast<int>(shard - g_shards), shard->queue_deadline_cap,
+ static_cast<int>(shard - g_shards),
+ shard->queue_deadline_cap.milliseconds_after_process_epoch(),
is_first_timer ? "true" : "false");
}
gpr_mu_unlock(&shard->mu);
@@ -424,10 +403,10 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
gpr_mu_lock(&g_shared_mutables.mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) {
gpr_log(GPR_INFO, " .. old shard min_deadline=%" PRId64,
- shard->min_deadline);
+ shard->min_deadline.milliseconds_after_process_epoch());
}
if (deadline < shard->min_deadline) {
- grpc_millis old_min_deadline = g_shard_queue[0]->min_deadline;
+ grpc_core::Timestamp old_min_deadline = g_shard_queue[0]->min_deadline;
shard->min_deadline = deadline;
note_deadline_change(shard);
if (shard->shard_queue_index == 0 && deadline < old_min_deadline) {
@@ -437,10 +416,10 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
// (&g_shared_mutables.min_timer) is a (long long *). The cast should be
// safe since we know that both are pointer types and 64-bit wide.
gpr_atm_no_barrier_store((gpr_atm*)(&g_shared_mutables.min_timer),
- deadline);
+ deadline.milliseconds_after_process_epoch());
#else
// On 32-bit systems, gpr_atm_no_barrier_store does not work on 64-bit
- // types (like grpc_millis). So all reads and writes to
+ // types (like grpc_core::Timestamp). So all reads and writes to
// g_shared_mutables.min_timer varialbe under g_shared_mutables.mu
g_shared_mutables.min_timer = deadline;
#endif
@@ -452,10 +431,8 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
}
static void timer_consume_kick(void) {
-#if GPR_ARCH_64
/* Force re-evaluation of last seen min */
- gpr_tls_set(&g_last_seen_min_timer, 0);
-#endif
+ g_last_seen_min_timer = 0;
}
static void timer_cancel(grpc_timer* timer) {
@@ -464,7 +441,7 @@ static void timer_cancel(grpc_timer* timer) {
return;
}
- timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, g_num_shards)];
+ timer_shard* shard = &g_shards[grpc_core::HashPointer(timer, g_num_shards)];
gpr_mu_lock(&shard->mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) {
gpr_log(GPR_INFO, "TIMER %p: CANCEL pending=%s", timer,
@@ -493,32 +470,36 @@ static void timer_cancel(grpc_timer* timer) {
'queue_deadline_cap') into into shard->heap.
Returns 'true' if shard->heap has at least ONE element
REQUIRES: shard->mu locked */
-static bool refill_heap(timer_shard* shard, grpc_millis now) {
+static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) {
/* Compute the new queue window width and bound by the limits: */
double computed_deadline_delta =
grpc_time_averaged_stats_update_average(&shard->stats) *
ADD_DEADLINE_SCALE;
double deadline_delta =
- GPR_CLAMP(computed_deadline_delta, MIN_QUEUE_WINDOW_DURATION,
- MAX_QUEUE_WINDOW_DURATION);
+ grpc_core::Clamp(computed_deadline_delta, MIN_QUEUE_WINDOW_DURATION,
+ MAX_QUEUE_WINDOW_DURATION);
grpc_timer *timer, *next;
/* Compute the new cap and put all timers under it into the queue: */
shard->queue_deadline_cap =
- saturating_add(GPR_MAX(now, shard->queue_deadline_cap),
- static_cast<grpc_millis>(deadline_delta * 1000.0));
+ std::max(now, shard->queue_deadline_cap) +
+ grpc_core::Duration::FromSecondsAsDouble(deadline_delta);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, " .. shard[%d]->queue_deadline_cap --> %" PRId64,
- static_cast<int>(shard - g_shards), shard->queue_deadline_cap);
+ static_cast<int>(shard - g_shards),
+ shard->queue_deadline_cap.milliseconds_after_process_epoch());
}
for (timer = shard->list.next; timer != &shard->list; timer = next) {
next = timer->next;
+ auto timer_deadline =
+ grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ timer->deadline);
- if (timer->deadline < shard->queue_deadline_cap) {
+ if (timer_deadline < shard->queue_deadline_cap) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, " .. add timer with deadline %" PRId64 " to heap",
- timer->deadline);
+ timer_deadline.milliseconds_after_process_epoch());
}
list_remove(timer);
grpc_timer_heap_add(&shard->heap, timer);
@@ -530,7 +511,7 @@ static bool refill_heap(timer_shard* shard, grpc_millis now) {
/* This pops the next non-cancelled timer with deadline <= now from the
queue, or returns NULL if there isn't one.
REQUIRES: shard->mu locked */
-static grpc_timer* pop_one(timer_shard* shard, grpc_millis now) {
+static grpc_timer* pop_one(timer_shard* shard, grpc_core::Timestamp now) {
grpc_timer* timer;
for (;;) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
@@ -543,15 +524,19 @@ static grpc_timer* pop_one(timer_shard* shard, grpc_millis now) {
if (!refill_heap(shard, now)) return nullptr;
}
timer = grpc_timer_heap_top(&shard->heap);
+ auto timer_deadline =
+ grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ timer->deadline);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO,
" .. check top timer deadline=%" PRId64 " now=%" PRId64,
- timer->deadline, now);
+ timer_deadline.milliseconds_after_process_epoch(),
+ now.milliseconds_after_process_epoch());
}
- if (timer->deadline > now) return nullptr;
+ if (timer_deadline > now) return nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) {
gpr_log(GPR_INFO, "TIMER %p: FIRE %" PRId64 "ms late", timer,
- now - timer->deadline);
+ (now - timer_deadline).millis());
}
timer->pending = false;
grpc_timer_heap_pop(&shard->heap);
@@ -560,8 +545,8 @@ static grpc_timer* pop_one(timer_shard* shard, grpc_millis now) {
}
/* REQUIRES: shard->mu unlocked */
-static size_t pop_timers(timer_shard* shard, grpc_millis now,
- grpc_millis* new_min_deadline,
+static size_t pop_timers(timer_shard* shard, grpc_core::Timestamp now,
+ grpc_core::Timestamp* new_min_deadline,
grpc_error_handle error) {
size_t n = 0;
grpc_timer* timer;
@@ -582,7 +567,8 @@ static size_t pop_timers(timer_shard* shard, grpc_millis now,
}
static grpc_timer_check_result run_some_expired_timers(
- grpc_millis now, grpc_millis* next, grpc_error_handle error) {
+ grpc_core::Timestamp now, grpc_core::Timestamp* next,
+ grpc_error_handle error) {
grpc_timer_check_result result = GRPC_TIMERS_NOT_CHECKED;
#if GPR_ARCH_64
@@ -590,19 +576,21 @@ static grpc_timer_check_result run_some_expired_timers(
// mac platforms complaining that gpr_atm* is (long *) while
// (&g_shared_mutables.min_timer) is a (long long *). The cast should be
// safe since we know that both are pointer types and 64-bit wide
- grpc_millis min_timer = static_cast<grpc_millis>(
- gpr_atm_no_barrier_load((gpr_atm*)(&g_shared_mutables.min_timer)));
- gpr_tls_set(&g_last_seen_min_timer, min_timer);
+ grpc_core::Timestamp min_timer =
+ grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ gpr_atm_no_barrier_load((gpr_atm*)(&g_shared_mutables.min_timer)));
#else
// On 32-bit systems, gpr_atm_no_barrier_load does not work on 64-bit types
- // (like grpc_millis). So all reads and writes to g_shared_mutables.min_timer
- // are done under g_shared_mutables.mu
+ // (like grpc_core::Timestamp). So all reads and writes to
+ // g_shared_mutables.min_timer are done under g_shared_mutables.mu
gpr_mu_lock(&g_shared_mutables.mu);
- grpc_millis min_timer = g_shared_mutables.min_timer;
+ grpc_core::Timestamp min_timer = g_shared_mutables.min_timer;
gpr_mu_unlock(&g_shared_mutables.mu);
#endif
+ g_last_seen_min_timer = min_timer.milliseconds_after_process_epoch();
+
if (now < min_timer) {
- if (next != nullptr) *next = GPR_MIN(*next, min_timer);
+ if (next != nullptr) *next = std::min(*next, min_timer);
return GRPC_TIMERS_CHECKED_AND_EMPTY;
}
@@ -611,15 +599,16 @@ static grpc_timer_check_result run_some_expired_timers(
result = GRPC_TIMERS_CHECKED_AND_EMPTY;
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
- gpr_log(GPR_INFO, " .. shard[%d]->min_deadline = %" PRId64,
- static_cast<int>(g_shard_queue[0] - g_shards),
- g_shard_queue[0]->min_deadline);
+ gpr_log(
+ GPR_INFO, " .. shard[%d]->min_deadline = %" PRId64,
+ static_cast<int>(g_shard_queue[0] - g_shards),
+ g_shard_queue[0]->min_deadline.milliseconds_after_process_epoch());
}
while (g_shard_queue[0]->min_deadline < now ||
- (now != GRPC_MILLIS_INF_FUTURE &&
+ (now != grpc_core::Timestamp::InfFuture() &&
g_shard_queue[0]->min_deadline == now)) {
- grpc_millis new_min_deadline;
+ grpc_core::Timestamp new_min_deadline;
/* For efficiency, we pop as many available timers as we can from the
shard. This may violate perfect timer deadline ordering, but that
@@ -629,12 +618,15 @@ static grpc_timer_check_result run_some_expired_timers(
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
- gpr_log(GPR_INFO,
- " .. result --> %d"
- ", shard[%d]->min_deadline %" PRId64 " --> %" PRId64
- ", now=%" PRId64,
- result, static_cast<int>(g_shard_queue[0] - g_shards),
- g_shard_queue[0]->min_deadline, new_min_deadline, now);
+ gpr_log(
+ GPR_INFO,
+ " .. result --> %d"
+ ", shard[%d]->min_deadline %" PRId64 " --> %" PRId64
+ ", now=%" PRId64,
+ result, static_cast<int>(g_shard_queue[0] - g_shards),
+ g_shard_queue[0]->min_deadline.milliseconds_after_process_epoch(),
+ new_min_deadline.milliseconds_after_process_epoch(),
+ now.milliseconds_after_process_epoch());
}
/* An grpc_timer_init() on the shard could intervene here, adding a new
@@ -647,7 +639,7 @@ static grpc_timer_check_result run_some_expired_timers(
}
if (next) {
- *next = GPR_MIN(*next, g_shard_queue[0]->min_deadline);
+ *next = std::min(*next, g_shard_queue[0]->min_deadline);
}
#if GPR_ARCH_64
@@ -655,11 +647,12 @@ static grpc_timer_check_result run_some_expired_timers(
// mac platforms complaining that gpr_atm* is (long *) while
// (&g_shared_mutables.min_timer) is a (long long *). The cast should be
// safe since we know that both are pointer types and 64-bit wide
- gpr_atm_no_barrier_store((gpr_atm*)(&g_shared_mutables.min_timer),
- g_shard_queue[0]->min_deadline);
+ gpr_atm_no_barrier_store(
+ (gpr_atm*)(&g_shared_mutables.min_timer),
+ g_shard_queue[0]->min_deadline.milliseconds_after_process_epoch());
#else
// On 32-bit systems, gpr_atm_no_barrier_store does not work on 64-bit
- // types (like grpc_millis). So all reads and writes to
+ // types (like grpc_core::Timestamp). So all reads and writes to
// g_shared_mutables.min_timer are done under g_shared_mutables.mu
g_shared_mutables.min_timer = g_shard_queue[0]->min_deadline;
#endif
@@ -672,38 +665,30 @@ static grpc_timer_check_result run_some_expired_timers(
return result;
}
-static grpc_timer_check_result timer_check(grpc_millis* next) {
+static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) {
// prelude
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
+ grpc_core::Timestamp now = grpc_core::ExecCtx::Get()->Now();
-#if GPR_ARCH_64
/* fetch from a thread-local first: this avoids contention on a globally
mutable cacheline in the common case */
- grpc_millis min_timer = gpr_tls_get(&g_last_seen_min_timer);
-#else
- // On 32-bit systems, we currently do not have thread local support for 64-bit
- // types. In this case, directly read from g_shared_mutables.min_timer.
- // Also, note that on 32-bit systems, gpr_atm_no_barrier_store does not work
- // on 64-bit types (like grpc_millis). So all reads and writes to
- // g_shared_mutables.min_timer are done under g_shared_mutables.mu
- gpr_mu_lock(&g_shared_mutables.mu);
- grpc_millis min_timer = g_shared_mutables.min_timer;
- gpr_mu_unlock(&g_shared_mutables.mu);
-#endif
+ grpc_core::Timestamp min_timer =
+ grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ g_last_seen_min_timer);
if (now < min_timer) {
if (next != nullptr) {
- *next = GPR_MIN(*next, min_timer);
+ *next = std::min(*next, min_timer);
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, "TIMER CHECK SKIP: now=%" PRId64 " min_timer=%" PRId64,
- now, min_timer);
+ now.milliseconds_after_process_epoch(),
+ min_timer.milliseconds_after_process_epoch());
}
return GRPC_TIMERS_CHECKED_AND_EMPTY;
}
grpc_error_handle shutdown_error =
- now != GRPC_MILLIS_INF_FUTURE
+ now != grpc_core::Timestamp::InfFuture()
? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING("Shutting down timer system");
@@ -713,18 +698,22 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
if (next == nullptr) {
next_str = "NULL";
} else {
- next_str = absl::StrCat(*next);
+ next_str = absl::StrCat(next->milliseconds_after_process_epoch());
}
#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,
- static_cast<grpc_millis>(gpr_atm_no_barrier_load(
- (gpr_atm*)(&g_shared_mutables.min_timer))));
+ gpr_log(
+ GPR_INFO,
+ "TIMER CHECK BEGIN: now=%" PRId64 " next=%s tls_min=%" PRId64
+ " glob_min=%" PRId64,
+ now.milliseconds_after_process_epoch(), next_str.c_str(),
+ min_timer.milliseconds_after_process_epoch(),
+ grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(
+ gpr_atm_no_barrier_load((gpr_atm*)(&g_shared_mutables.min_timer)))
+ .milliseconds_after_process_epoch());
#else
gpr_log(GPR_INFO, "TIMER CHECK BEGIN: now=%" PRId64 " next=%s min=%" PRId64,
- now, next_str.c_str(), min_timer);
+ now.milliseconds_after_process_epoch(), next_str.c_str(),
+ min_timer.milliseconds_after_process_epoch());
#endif
}
// actual code
@@ -736,7 +725,7 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
if (next == nullptr) {
next_str = "NULL";
} else {
- next_str = absl::StrCat(*next);
+ next_str = absl::StrCat(next->milliseconds_after_process_epoch());
}
gpr_log(GPR_INFO, "TIMER CHECK END: r=%d; next=%s", r, next_str.c_str());
}
diff --git a/grpc/src/core/lib/iomgr/timer_generic.h b/grpc/src/core/lib/iomgr/timer_generic.h
index 97a45133..2ac002b6 100644
--- a/grpc/src/core/lib/iomgr/timer_generic.h
+++ b/grpc/src/core/lib/iomgr/timer_generic.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
struct grpc_timer {
diff --git a/grpc/src/core/lib/iomgr/timer_heap.cc b/grpc/src/core/lib/iomgr/timer_heap.cc
index 2c6a5991..604bfe1b 100644
--- a/grpc/src/core/lib/iomgr/timer_heap.cc
+++ b/grpc/src/core/lib/iomgr/timer_heap.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/iomgr/timer_heap.h"
#include <string.h>
@@ -27,6 +25,7 @@
#include <grpc/support/alloc.h>
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/port.h"
/* Adjusts a heap so as to move a hole at position i closer to the root,
until a suitable position is found for element t. Then, copies t into that
@@ -98,7 +97,7 @@ void grpc_timer_heap_destroy(grpc_timer_heap* heap) { gpr_free(heap->timers); }
bool grpc_timer_heap_add(grpc_timer_heap* heap, grpc_timer* timer) {
if (heap->timer_count == heap->timer_capacity) {
heap->timer_capacity =
- GPR_MAX(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
+ std::max(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
heap->timers = static_cast<grpc_timer**>(
gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer*)));
}
diff --git a/grpc/src/core/lib/iomgr/timer_manager.cc b/grpc/src/core/lib/iomgr/timer_manager.cc
index bf467cb5..5cb236c9 100644
--- a/grpc/src/core/lib/iomgr/timer_manager.cc
+++ b/grpc/src/core/lib/iomgr/timer_manager.cc
@@ -56,7 +56,7 @@ static bool g_kicked;
static bool g_has_timed_waiter;
// the deadline of the current timed waiter thread (only relevant if
// g_has_timed_waiter is true)
-static grpc_millis g_timed_waiter_deadline;
+static grpc_core::Timestamp g_timed_waiter_deadline;
// generation counter to track which thread is waiting for the next timer
static uint64_t g_timed_waiter_generation;
// number of timer wakeups
@@ -143,7 +143,7 @@ static void run_some_timers() {
// wait until 'next' (or forever if there is already a timed waiter in the pool)
// returns true if the thread should continue executing (false if it should
// shutdown)
-static bool wait_until(grpc_millis next) {
+static bool wait_until(grpc_core::Timestamp next) {
gpr_mu_lock(&g_mu);
// if we're not threaded anymore, leave
if (!g_threaded) {
@@ -177,28 +177,29 @@ static bool wait_until(grpc_millis next) {
unless their 'next' is earlier than the current timed-waiter's deadline
(in which case the thread with earlier 'next' takes over as the new timed
waiter) */
- if (next != GRPC_MILLIS_INF_FUTURE) {
+ if (next != grpc_core::Timestamp::InfFuture()) {
if (!g_has_timed_waiter || (next < g_timed_waiter_deadline)) {
my_timed_waiter_generation = ++g_timed_waiter_generation;
g_has_timed_waiter = true;
g_timed_waiter_deadline = next;
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
- grpc_millis wait_time = next - grpc_core::ExecCtx::Get()->Now();
- gpr_log(GPR_INFO, "sleep for a %" PRId64 " milliseconds", wait_time);
+ grpc_core::Duration wait_time =
+ next - grpc_core::ExecCtx::Get()->Now();
+ gpr_log(GPR_INFO, "sleep for a %" PRId64 " milliseconds",
+ wait_time.millis());
}
} else { // g_timed_waiter == true && next >= g_timed_waiter_deadline
- next = GRPC_MILLIS_INF_FUTURE;
+ next = grpc_core::Timestamp::InfFuture();
}
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace) &&
- next == GRPC_MILLIS_INF_FUTURE) {
+ next == grpc_core::Timestamp::InfFuture()) {
gpr_log(GPR_INFO, "sleep until kicked");
}
- gpr_cv_wait(&g_cv_wait, &g_mu,
- grpc_millis_to_timespec(next, GPR_CLOCK_MONOTONIC));
+ gpr_cv_wait(&g_cv_wait, &g_mu, next.as_timespec(GPR_CLOCK_MONOTONIC));
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, "wait ended: was_timed:%d kicked:%d",
@@ -211,7 +212,7 @@ static bool wait_until(grpc_millis next) {
if (my_timed_waiter_generation == g_timed_waiter_generation) {
++g_wakeups;
g_has_timed_waiter = false;
- g_timed_waiter_deadline = GRPC_MILLIS_INF_FUTURE;
+ g_timed_waiter_deadline = grpc_core::Timestamp::InfFuture();
}
}
@@ -228,7 +229,7 @@ static bool wait_until(grpc_millis next) {
static void timer_main_loop() {
for (;;) {
- grpc_millis next = GRPC_MILLIS_INF_FUTURE;
+ grpc_core::Timestamp next = grpc_core::Timestamp::InfFuture();
grpc_core::ExecCtx::Get()->InvalidateNow();
// check timer state, updates next to the next time to run a check
@@ -249,8 +250,8 @@ static void timer_main_loop() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, "timers not checked: expect another thread to");
}
- next = GRPC_MILLIS_INF_FUTURE;
- // fallthrough
+ next = grpc_core::Timestamp::InfFuture();
+ ABSL_FALLTHROUGH_INTENDED;
case GRPC_TIMERS_CHECKED_AND_EMPTY:
if (!wait_until(next)) {
return;
@@ -306,7 +307,7 @@ void grpc_timer_manager_init(void) {
g_completed_threads = nullptr;
g_has_timed_waiter = false;
- g_timed_waiter_deadline = GRPC_MILLIS_INF_FUTURE;
+ g_timed_waiter_deadline = grpc_core::Timestamp::InfFuture();
start_threads();
}
@@ -354,7 +355,7 @@ void grpc_kick_poller(void) {
gpr_mu_lock(&g_mu);
g_kicked = true;
g_has_timed_waiter = false;
- g_timed_waiter_deadline = GRPC_MILLIS_INF_FUTURE;
+ g_timed_waiter_deadline = grpc_core::Timestamp::InfFuture();
++g_timed_waiter_generation;
gpr_cv_signal(&g_cv_wait);
gpr_mu_unlock(&g_mu);
diff --git a/grpc/src/core/lib/iomgr/timer_uv.cc b/grpc/src/core/lib/iomgr/timer_uv.cc
deleted file mode 100644
index 8b7c82eb..00000000
--- a/grpc/src/core/lib/iomgr/timer_uv.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * 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/port.h"
-
-#ifdef GRPC_UV
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-#include <uv.h>
-
-static void timer_close_callback(uv_handle_t* handle) { gpr_free(handle); }
-
-static void stop_uv_timer(uv_timer_t* handle) {
- uv_timer_stop(handle);
- uv_unref((uv_handle_t*)handle);
- uv_close((uv_handle_t*)handle, timer_close_callback);
-}
-
-void run_expired_timer(uv_timer_t* handle) {
- grpc_custom_timer* timer_wrapper = (grpc_custom_timer*)handle->data;
- grpc_custom_timer_callback(timer_wrapper, GRPC_ERROR_NONE);
-}
-
-static void timer_start(grpc_custom_timer* t) {
- uv_timer_t* uv_timer;
- uv_timer = (uv_timer_t*)gpr_malloc(sizeof(uv_timer_t));
- uv_timer_init(uv_default_loop(), uv_timer);
- uv_timer->data = t;
- t->timer = (void*)uv_timer;
- uv_timer_start(uv_timer, run_expired_timer, t->timeout_ms, 0);
- // Node uses a garbage collector to call destructors, so we don't
- // want to hold the uv loop open with active gRPC objects.
- uv_unref((uv_handle_t*)uv_timer);
-}
-
-static void timer_stop(grpc_custom_timer* t) {
- stop_uv_timer((uv_timer_t*)t->timer);
-}
-
-grpc_custom_timer_vtable uv_timer_vtable = {timer_start, timer_stop};
-
-#endif
diff --git a/grpc/src/core/lib/iomgr/udp_server.cc b/grpc/src/core/lib/iomgr/udp_server.cc
deleted file mode 100644
index 4efaf23b..00000000
--- a/grpc/src/core/lib/iomgr/udp_server.cc
+++ /dev/null
@@ -1,748 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-/* FIXME: "posix" files shouldn't be depending on _GNU_SOURCE */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef SO_RXQ_OVFL
-#define SO_RXQ_OVFL 40
-#endif
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_POSIX_SOCKET_UDP_SERVER
-
-#include "src/core/lib/iomgr/udp_server.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <string>
-#include <vector>
-
-#include "absl/container/inlined_vector.h"
-#include "absl/strings/str_cat.h"
-
-#include <grpc/grpc.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/time.h>
-
-#include "src/core/lib/address_utils/sockaddr_utils.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_factory_posix.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
-/* A listener which implements basic features of Listening on a port for
- * I/O events*/
-class GrpcUdpListener {
- public:
- GrpcUdpListener(grpc_udp_server* server, int fd,
- const grpc_resolved_address* addr);
- ~GrpcUdpListener();
-
- /* Called when grpc server starts to listening on the grpc_fd. */
- void StartListening(const std::vector<grpc_pollset*>* pollsets,
- GrpcUdpHandlerFactory* handler_factory);
-
- /* Called when data is available to read from the socket.
- * Return true if there is more data to read from fd. */
- void OnRead(grpc_error_handle error, void* do_read_arg);
-
- /* Called when the socket is writeable. The given closure should be scheduled
- * when the socket becomes blocked next time. */
- void OnCanWrite(grpc_error_handle error, void* do_write_arg);
-
- /* Called when the grpc_fd is about to be orphaned (and the FD closed). */
- void OnFdAboutToOrphan();
-
- /* Called to orphan fd of this listener.*/
- void OrphanFd();
-
- /* Called when this listener is going to be destroyed. */
- void OnDestroy();
-
- int fd() const { return fd_; }
-
- protected:
- grpc_fd* emfd() const { return emfd_; }
-
- gpr_mu* mutex() { return &mutex_; }
-
- private:
- /* event manager callback when reads are ready */
- static void on_read(void* arg, grpc_error_handle error);
- static void on_write(void* arg, grpc_error_handle error);
-
- static void do_read(void* arg, grpc_error_handle error);
- static void do_write(void* arg, grpc_error_handle error);
- // Wrapper of grpc_fd_notify_on_write() with a grpc_closure callback
- // interface.
- static void fd_notify_on_write_wrapper(void* arg, grpc_error_handle error);
-
- static void shutdown_fd(void* args, grpc_error_handle error);
-
- int fd_;
- grpc_fd* emfd_;
- grpc_udp_server* server_;
- grpc_resolved_address addr_;
- grpc_closure read_closure_;
- grpc_closure write_closure_;
- // To be called when corresponding QuicGrpcServer closes all active
- // connections.
- grpc_closure orphan_fd_closure_;
- grpc_closure destroyed_closure_;
- // To be scheduled on another thread to actually read/write.
- grpc_closure do_read_closure_;
- grpc_closure do_write_closure_;
- grpc_closure notify_on_write_closure_;
- // True if orphan_cb is trigered.
- bool orphan_notified_;
- // True if grpc_fd_notify_on_write() is called after on_write() call.
- bool notify_on_write_armed_;
- // True if fd has been shutdown.
- bool already_shutdown_;
- // Object actually handles I/O events. Assigned in StartListening().
- GrpcUdpHandler* udp_handler_ = nullptr;
- // To be notified on destruction.
- GrpcUdpHandlerFactory* handler_factory_ = nullptr;
- // Required to access above fields.
- gpr_mu mutex_;
-};
-
-GrpcUdpListener::GrpcUdpListener(grpc_udp_server* server, int fd,
- const grpc_resolved_address* addr)
- : fd_(fd),
- server_(server),
- orphan_notified_(false),
- already_shutdown_(false) {
- std::string addr_str = grpc_sockaddr_to_string(addr, true);
- std::string name = 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_);
-}
-
-GrpcUdpListener::~GrpcUdpListener() { gpr_mu_destroy(&mutex_); }
-
-/* the overall server */
-struct grpc_udp_server {
- gpr_mu mu;
-
- /* factory to use for creating and binding sockets, or NULL */
- grpc_socket_factory* socket_factory;
-
- /* active port count: how many ports are actually still listening */
- size_t active_ports;
- /* destroyed port count: how many ports are completely destroyed */
- size_t destroyed_ports;
-
- /* is this server shutting down? (boolean) */
- int shutdown;
-
- /* An array of listeners */
- absl::InlinedVector<GrpcUdpListener, 16> listeners;
-
- /* factory for use to create udp listeners */
- GrpcUdpHandlerFactory* handler_factory;
-
- /* 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;
- /* opaque object to pass to callbacks */
- void* user_data;
-
- /* latch has_so_reuseport during server creation */
- bool so_reuseport;
-};
-
-static grpc_socket_factory* get_socket_factory(const grpc_channel_args* args) {
- if (args) {
- const grpc_arg* arg = grpc_channel_args_find(args, GRPC_ARG_SOCKET_FACTORY);
- if (arg) {
- GPR_ASSERT(arg->type == GRPC_ARG_POINTER);
- return static_cast<grpc_socket_factory*>(arg->value.pointer.p);
- }
- }
- return nullptr;
-}
-
-grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args) {
- grpc_udp_server* s = new grpc_udp_server();
- gpr_mu_init(&s->mu);
- s->socket_factory = get_socket_factory(args);
- if (s->socket_factory) {
- grpc_socket_factory_ref(s->socket_factory);
- }
- s->active_ports = 0;
- s->destroyed_ports = 0;
- s->shutdown = 0;
- s->so_reuseport = grpc_is_socket_reuse_port_supported();
- return s;
-}
-
-// static
-void GrpcUdpListener::shutdown_fd(void* args, grpc_error_handle error) {
- if (args == nullptr) {
- // No-op if shutdown args are null.
- return;
- }
- auto sp = static_cast<GrpcUdpListener*>(args);
- gpr_mu_lock(sp->mutex());
- gpr_log(GPR_DEBUG, "shutdown fd %d", sp->fd_);
- grpc_fd_shutdown(sp->emfd_, GRPC_ERROR_REF(error));
- sp->already_shutdown_ = true;
- if (!sp->notify_on_write_armed_) {
- // Re-arm write notification to notify listener with error. This is
- // necessary to decrement active_ports.
- sp->notify_on_write_armed_ = true;
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-static void finish_shutdown(grpc_udp_server* s) {
- if (s->shutdown_complete != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
- GRPC_ERROR_NONE);
- }
-
- gpr_mu_destroy(&s->mu);
-
- gpr_log(GPR_DEBUG, "Destroy all listeners.");
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- s->listeners[i].OnDestroy();
- }
-
- if (s->socket_factory) {
- grpc_socket_factory_unref(s->socket_factory);
- }
-
- delete s;
-}
-
-static void destroyed_port(void* server, grpc_error_handle /*error*/) {
- grpc_udp_server* s = static_cast<grpc_udp_server*>(server);
- gpr_mu_lock(&s->mu);
- s->destroyed_ports++;
- if (s->destroyed_ports == s->listeners.size()) {
- gpr_mu_unlock(&s->mu);
- finish_shutdown(s);
- } else {
- gpr_mu_unlock(&s->mu);
- }
-}
-
-/* called when all listening endpoints have been shutdown, so no further
- events will be received on them - at this point it's safe to destroy
- things */
-static void deactivated_all_ports(grpc_udp_server* s) {
- /* delete ALL the things */
- gpr_mu_lock(&s->mu);
-
- GPR_ASSERT(s->shutdown);
-
- if (s->listeners.empty()) {
- gpr_mu_unlock(&s->mu);
- finish_shutdown(s);
- return;
- }
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- s->listeners[i].OrphanFd();
- }
- gpr_mu_unlock(&s->mu);
-}
-
-void GrpcUdpListener::OrphanFd() {
- gpr_log(GPR_DEBUG, "Orphan fd %d, emfd %p", fd_, emfd_);
- grpc_unlink_if_unix_domain_socket(&addr_);
-
- GRPC_CLOSURE_INIT(&destroyed_closure_, destroyed_port, server_,
- grpc_schedule_on_exec_ctx);
- /* Because at this point, all listening sockets have been shutdown already, no
- * need to call OnFdAboutToOrphan() to notify the handler again. */
- grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr, "udp_listener_shutdown");
-}
-
-void grpc_udp_server_destroy(grpc_udp_server* s, grpc_closure* on_done) {
- gpr_mu_lock(&s->mu);
-
- GPR_ASSERT(!s->shutdown);
- s->shutdown = 1;
-
- s->shutdown_complete = on_done;
-
- gpr_log(GPR_DEBUG, "start to destroy udp_server");
- /* shutdown all fd's */
- if (s->active_ports) {
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- GrpcUdpListener* sp = &s->listeners[i];
- sp->OnFdAboutToOrphan();
- }
- gpr_mu_unlock(&s->mu);
- } else {
- gpr_mu_unlock(&s->mu);
- deactivated_all_ports(s);
- }
-}
-
-void GrpcUdpListener::OnFdAboutToOrphan() {
- gpr_mu_lock(&mutex_);
- grpc_unlink_if_unix_domain_socket(&addr_);
-
- GRPC_CLOSURE_INIT(&destroyed_closure_, destroyed_port, server_,
- grpc_schedule_on_exec_ctx);
- if (!orphan_notified_ && udp_handler_ != nullptr) {
- /* Signals udp_handler that the FD is about to be closed and
- * should no longer be used. */
- GRPC_CLOSURE_INIT(&orphan_fd_closure_, shutdown_fd, this,
- grpc_schedule_on_exec_ctx);
- gpr_log(GPR_DEBUG, "fd %d about to be orphaned", fd_);
- udp_handler_->OnFdAboutToOrphan(&orphan_fd_closure_, server_->user_data);
- orphan_notified_ = true;
- }
- gpr_mu_unlock(&mutex_);
-}
-
-static int bind_socket(grpc_socket_factory* socket_factory, int sockfd,
- const grpc_resolved_address* addr) {
- return (socket_factory != nullptr)
- ? grpc_socket_factory_bind(socket_factory, sockfd, addr)
- : bind(sockfd,
- reinterpret_cast<grpc_sockaddr*>(
- const_cast<char*>(addr->addr)),
- addr->len);
-}
-
-/* Prepare a recently-created socket for listening. */
-static int prepare_socket(grpc_socket_factory* socket_factory, int fd,
- const grpc_resolved_address* addr, int rcv_buf_size,
- int snd_buf_size, bool so_reuseport) {
- grpc_resolved_address sockname_temp;
- grpc_sockaddr* addr_ptr =
- reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr));
-
- if (fd < 0) {
- goto error;
- }
-
- if (grpc_set_socket_nonblocking(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set nonblocking %d: %s", fd, strerror(errno));
- goto error;
- }
- if (grpc_set_socket_cloexec(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set cloexec %d: %s", fd, strerror(errno));
- goto error;
- }
-
- if (grpc_set_socket_ip_pktinfo_if_possible(fd) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set ip_pktinfo.");
- goto error;
- } else if (addr_ptr->sa_family == AF_INET6) {
- if (grpc_set_socket_ipv6_recvpktinfo_if_possible(fd) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set ipv6_recvpktinfo.");
- goto error;
- }
- }
-
- if (grpc_set_socket_sndbuf(fd, snd_buf_size) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set send buffer size to %d bytes",
- snd_buf_size);
- goto error;
- }
-
- if (grpc_set_socket_rcvbuf(fd, rcv_buf_size) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set receive buffer size to %d bytes",
- rcv_buf_size);
- goto error;
- }
-
- {
- int get_overflow = 1;
- if (0 != setsockopt(fd, SOL_SOCKET, SO_RXQ_OVFL, &get_overflow,
- sizeof(get_overflow))) {
- gpr_log(GPR_INFO, "Failed to set socket overflow support");
- }
- }
-
- if (so_reuseport && !grpc_is_unix_socket(addr) &&
- grpc_set_socket_reuse_port(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set SO_REUSEPORT for fd %d", fd);
- goto error;
- }
-
- if (bind_socket(socket_factory, fd, addr) < 0) {
- std::string addr_str = grpc_sockaddr_to_string(addr, false);
- gpr_log(GPR_ERROR, "bind addr=%s: %s", addr_str.c_str(), strerror(errno));
- goto error;
- }
-
- sockname_temp.len = static_cast<socklen_t>(sizeof(struct sockaddr_storage));
-
- if (getsockname(fd, reinterpret_cast<grpc_sockaddr*>(sockname_temp.addr),
- &sockname_temp.len) < 0) {
- gpr_log(GPR_ERROR, "Unable to get the address socket %d is bound to: %s",
- fd, strerror(errno));
- goto error;
- }
-
- return grpc_sockaddr_get_port(&sockname_temp);
-
-error:
- if (fd >= 0) {
- close(fd);
- }
- return -1;
-}
-
-// static
-void GrpcUdpListener::do_read(void* arg, grpc_error_handle error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- /* TODO: the reason we hold server->mu here is merely to prevent fd
- * shutdown while we are reading. However, it blocks do_write(). Switch to
- * read lock if available. */
- gpr_mu_lock(sp->mutex());
- /* Tell the registered callback that data is available to read. */
- if (!sp->already_shutdown_ && sp->udp_handler_->Read()) {
- /* There maybe more packets to read. Schedule read_more_cb_ closure to run
- * after finishing this event loop. */
- grpc_core::Executor::Run(&sp->do_read_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
- } else {
- /* Finish reading all the packets, re-arm the notification event so we can
- * get another chance to read. Or fd already shutdown, re-arm to get a
- * notification with shutdown error. */
- grpc_fd_notify_on_read(sp->emfd_, &sp->read_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::on_read(void* arg, grpc_error_handle error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- sp->OnRead(error, arg);
-}
-
-void GrpcUdpListener::OnRead(grpc_error_handle error, void* do_read_arg) {
- if (error != GRPC_ERROR_NONE) {
- gpr_mu_lock(&server_->mu);
- if (0 == --server_->active_ports && server_->shutdown) {
- gpr_mu_unlock(&server_->mu);
- deactivated_all_ports(server_);
- } else {
- gpr_mu_unlock(&server_->mu);
- }
- return;
- }
-
- /* Read once. If there is more data to read, off load the work to another
- * thread to finish. */
- if (udp_handler_->Read()) {
- /* There maybe more packets to read. Schedule read_more_cb_ closure to run
- * after finishing this event loop. */
- GRPC_CLOSURE_INIT(&do_read_closure_, do_read, do_read_arg, nullptr);
- grpc_core::Executor::Run(&do_read_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
- } else {
- /* Finish reading all the packets, re-arm the notification event so we can
- * get another chance to read. Or fd already shutdown, re-arm to get a
- * notification with shutdown error. */
- grpc_fd_notify_on_read(emfd_, &read_closure_);
- }
-}
-
-// static
-// Wrapper of grpc_fd_notify_on_write() with a grpc_closure callback interface.
-void GrpcUdpListener::fd_notify_on_write_wrapper(void* arg,
- grpc_error_handle /*error*/) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- gpr_mu_lock(sp->mutex());
- if (!sp->notify_on_write_armed_) {
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- sp->notify_on_write_armed_ = true;
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::do_write(void* arg, grpc_error_handle error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- gpr_mu_lock(sp->mutex());
- if (sp->already_shutdown_) {
- // If fd has been shutdown, don't write any more and re-arm notification.
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- } else {
- sp->notify_on_write_armed_ = false;
- /* Tell the registered callback that the socket is writeable. */
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- GRPC_CLOSURE_INIT(&sp->notify_on_write_closure_, fd_notify_on_write_wrapper,
- arg, grpc_schedule_on_exec_ctx);
- sp->udp_handler_->OnCanWrite(sp->server_->user_data,
- &sp->notify_on_write_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::on_write(void* arg, grpc_error_handle error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- sp->OnCanWrite(error, arg);
-}
-
-void GrpcUdpListener::OnCanWrite(grpc_error_handle error, void* do_write_arg) {
- if (error != GRPC_ERROR_NONE) {
- gpr_mu_lock(&server_->mu);
- if (0 == --server_->active_ports && server_->shutdown) {
- gpr_mu_unlock(&server_->mu);
- deactivated_all_ports(server_);
- } else {
- gpr_mu_unlock(&server_->mu);
- }
- return;
- }
-
- /* Schedule actual write in another thread. */
- GRPC_CLOSURE_INIT(&do_write_closure_, do_write, do_write_arg, nullptr);
-
- grpc_core::Executor::Run(&do_write_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
-}
-
-static int add_socket_to_server(grpc_udp_server* s, int fd,
- const grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size) {
- gpr_log(GPR_DEBUG, "add socket %d to server", fd);
-
- int port = prepare_socket(s->socket_factory, fd, addr, rcv_buf_size,
- snd_buf_size, s->so_reuseport);
- if (port >= 0) {
- gpr_mu_lock(&s->mu);
- s->listeners.emplace_back(s, fd, addr);
- gpr_log(GPR_DEBUG,
- "add socket %d to server for port %d, %zu listener(s) in total", fd,
- port, s->listeners.size());
- gpr_mu_unlock(&s->mu);
- }
- return port;
-}
-
-int grpc_udp_server_add_port(grpc_udp_server* s, grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size,
- GrpcUdpHandlerFactory* handler_factory,
- size_t num_listeners) {
- if (num_listeners > 1 && !s->so_reuseport) {
- gpr_log(GPR_ERROR,
- "Try to have multiple listeners on same port, but SO_REUSEPORT is "
- "not supported. Only create 1 listener.");
- }
- std::string 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;
- int fd;
- grpc_dualstack_mode dsmode;
- grpc_resolved_address addr6_v4mapped;
- grpc_resolved_address wild4;
- grpc_resolved_address wild6;
- grpc_resolved_address addr4_copy;
- grpc_resolved_address* allocated_addr = nullptr;
- grpc_resolved_address sockname_temp;
- int port = 0;
-
- /* Check if this is a wildcard port, and if so, try to keep the port the same
- as some previously created listener. */
- if (grpc_sockaddr_get_port(addr) == 0) {
- /* Loop through existing listeners to find the port in use. */
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- sockname_temp.len =
- static_cast<socklen_t>(sizeof(struct sockaddr_storage));
- if (0 == getsockname(s->listeners[i].fd(),
- reinterpret_cast<grpc_sockaddr*>(sockname_temp.addr),
- &sockname_temp.len)) {
- port = grpc_sockaddr_get_port(&sockname_temp);
- if (port > 0) {
- /* Found such a port, update |addr| to reflects this port. */
- allocated_addr = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address)));
- memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
- grpc_sockaddr_set_port(allocated_addr, port);
- addr = allocated_addr;
- break;
- }
- }
- }
- }
-
- if (grpc_sockaddr_to_v4mapped(addr, &addr6_v4mapped)) {
- addr = &addr6_v4mapped;
- }
-
- s->handler_factory = handler_factory;
- for (size_t i = 0; i < num_listeners; ++i) {
- /* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */
- if (grpc_sockaddr_is_wildcard(addr, &port)) {
- grpc_sockaddr_make_wildcards(port, &wild4, &wild6);
-
- /* Try listening on IPv6 first. */
- addr = &wild6;
- // TODO(rjshade): Test and propagate the returned grpc_error_handle:
- GRPC_ERROR_UNREF(grpc_create_dualstack_socket_using_factory(
- s->socket_factory, addr, SOCK_DGRAM, IPPROTO_UDP, &dsmode, &fd));
- allocated_port1 =
- add_socket_to_server(s, fd, addr, rcv_buf_size, snd_buf_size);
- if (fd >= 0 && dsmode == GRPC_DSMODE_DUALSTACK) {
- if (port == 0) {
- /* This is the first time to bind to |addr|. If its port is still
- * wildcard port, update |addr| with the ephermeral port returned by
- * kernel. Thus |addr| can have a specific port in following
- * iterations. */
- grpc_sockaddr_set_port(addr, allocated_port1);
- port = allocated_port1;
- } else if (allocated_port1 >= 0) {
- /* The following successfully created socket should have same port as
- * the first one. */
- GPR_ASSERT(port == allocated_port1);
- }
- /* A dualstack socket is created, no need to create corresponding IPV4
- * socket. */
- continue;
- }
-
- /* If we didn't get a dualstack socket, also listen on 0.0.0.0. */
- if (port == 0 && allocated_port1 > 0) {
- /* |port| hasn't been assigned to an emphemeral port yet, |wild4| must
- * have a wildcard port. Update it with the emphemeral port created
- * during binding.*/
- grpc_sockaddr_set_port(&wild4, allocated_port1);
- port = allocated_port1;
- }
- /* |wild4| should have been updated with an emphemeral port by now. Use
- * this IPV4 address to create a IPV4 socket. */
- addr = &wild4;
- }
-
- // TODO(rjshade): Test and propagate the returned grpc_error_handle:
- GRPC_ERROR_UNREF(grpc_create_dualstack_socket_using_factory(
- s->socket_factory, addr, SOCK_DGRAM, IPPROTO_UDP, &dsmode, &fd));
- if (fd < 0) {
- gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
- }
- if (dsmode == GRPC_DSMODE_IPV4 &&
- grpc_sockaddr_is_v4mapped(addr, &addr4_copy)) {
- addr = &addr4_copy;
- }
- allocated_port2 =
- add_socket_to_server(s, fd, addr, rcv_buf_size, snd_buf_size);
- if (port == 0) {
- /* Update |addr| with the ephermeral port returned by kernel. So |addr|
- * can have a specific port in following iterations. */
- grpc_sockaddr_set_port(addr, allocated_port2);
- port = allocated_port2;
- } else if (allocated_port2 >= 0) {
- GPR_ASSERT(port == allocated_port2);
- }
- }
-
- gpr_free(allocated_addr);
- return port;
-}
-
-int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index) {
- if (port_index >= s->listeners.size()) {
- return -1;
- }
-
- 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) {
- 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;
-
- for (auto& listener : udp_server->listeners) {
- listener.StartListening(pollsets, udp_server->handler_factory);
- }
-
- gpr_mu_unlock(&udp_server->mu);
-}
-
-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_);
- }
- GRPC_CLOSURE_INIT(&read_closure_, on_read, this, grpc_schedule_on_exec_ctx);
- grpc_fd_notify_on_read(emfd_, &read_closure_);
-
- GRPC_CLOSURE_INIT(&write_closure_, on_write, this, grpc_schedule_on_exec_ctx);
- notify_on_write_armed_ = true;
- grpc_fd_notify_on_write(emfd_, &write_closure_);
-
- /* Registered for both read and write callbacks: increment active_ports
- * twice to account for this, and delay free-ing of memory until both
- * on_read and on_write have fired. */
- server_->active_ports += 2;
- gpr_mu_unlock(&mutex_);
-}
-
-void GrpcUdpListener::OnDestroy() {
- if (udp_handler_ != nullptr) {
- handler_factory_->DestroyUdpHandler(udp_handler_);
- }
-}
-
-#endif
diff --git a/grpc/src/core/lib/iomgr/udp_server.h b/grpc/src/core/lib/iomgr/udp_server.h
deleted file mode 100644
index ba7acbbe..00000000
--- a/grpc/src/core/lib/iomgr/udp_server.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * 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_UDP_SERVER_H
-#define GRPC_CORE_LIB_IOMGR_UDP_SERVER_H
-
-#include <grpc/support/port_platform.h>
-
-#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"
-
-/* Forward decl of struct grpc_server */
-/* This is not typedef'ed to avoid a typedef-redefinition error */
-struct grpc_server;
-
-/* Forward decl of grpc_udp_server */
-typedef struct grpc_udp_server grpc_udp_server;
-
-/* An interface associated with a socket. udp server delivers I/O event on that
- * socket to the subclass of this interface which is created through
- * GrpcUdpHandlerFactory.
- * Its implementation should do the real IO work, e.g. read packet and write. */
-class GrpcUdpHandler {
- public:
- GrpcUdpHandler(grpc_fd* /* emfd */, void* /* user_data */) {}
- virtual ~GrpcUdpHandler() {}
-
- // Interfaces to be implemented by subclasses to do the actual setup/tear down
- // or I/O.
-
- // Called when data is available to read from the socket. Returns true if
- // there is more data to read after this call.
- virtual bool Read() = 0;
- // Called when socket becomes write unblocked. The given closure should be
- // scheduled when the socket becomes blocked next time.
- virtual void OnCanWrite(void* user_data,
- grpc_closure* notify_on_write_closure) = 0;
- // Called before the gRPC FD is orphaned. Notify udp server to continue
- // orphaning fd by scheduling the given closure, afterwards the associated fd
- // will be closed.
- virtual void OnFdAboutToOrphan(grpc_closure* orphan_fd_closure,
- void* user_data) = 0;
-};
-
-class GrpcUdpHandlerFactory {
- public:
- virtual ~GrpcUdpHandlerFactory() {}
- /* Called when start to listen on a socket.
- * Return an instance of the implementation of GrpcUdpHandler interface which
- * will process I/O events for this socket from now on. */
- virtual GrpcUdpHandler* CreateUdpHandler(grpc_fd* emfd, void* user_data) = 0;
- virtual void DestroyUdpHandler(GrpcUdpHandler* handler) = 0;
-};
-
-/* Create a server, initially not bound to any ports */
-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);
-
-int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index);
-
-/* Add a port to the server, returning port number on success, or negative
- on failure.
-
- Create |num_listeners| sockets for given address to listen on using
- SO_REUSEPORT if supported.
-
- The :: and 0.0.0.0 wildcard addresses are treated identically, accepting
- both IPv4 and IPv6 connections, but :: is the preferred style. This usually
- creates |num_listeners| sockets, but possibly 2 * |num_listeners| on systems
- which support IPv6, but not dualstack sockets. */
-
-/* TODO(ctiller): deprecate this, and make grpc_udp_server_add_ports to handle
- all of the multiple socket port matching logic in one place */
-int grpc_udp_server_add_port(grpc_udp_server* s, grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size,
- GrpcUdpHandlerFactory* handler_factory,
- size_t num_listeners);
-
-void grpc_udp_server_destroy(grpc_udp_server* server, grpc_closure* on_done);
-
-#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */
diff --git a/grpc/src/core/lib/iomgr/unix_sockets_posix.cc b/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
index 2b077a38..e8776f6a 100644
--- a/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
+++ b/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
@@ -21,8 +21,6 @@
#ifdef GRPC_HAVE_UNIX_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -30,36 +28,42 @@
#include "absl/strings/str_cat.h"
-#include "src/core/lib/address_utils/parse_address.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/transport/error_utils.h"
void grpc_create_socketpair_if_unix(int sv[2]) {
GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
}
-grpc_error_handle grpc_resolve_unix_domain_address(
- const char* name, grpc_resolved_addresses** addresses) {
- *addresses = static_cast<grpc_resolved_addresses*>(
- gpr_malloc(sizeof(grpc_resolved_addresses)));
- (*addresses)->naddrs = 1;
- (*addresses)->addrs = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address)));
- return grpc_core::UnixSockaddrPopulate(name, (*addresses)->addrs);
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_domain_address(absl::string_view name) {
+ grpc_resolved_address addr;
+ grpc_error_handle error = grpc_core::UnixSockaddrPopulate(name, &addr);
+ if (error == GRPC_ERROR_NONE) {
+ return std::vector<grpc_resolved_address>({addr});
+ }
+ auto result = grpc_error_to_absl_status(error);
+ GRPC_ERROR_UNREF(error);
+ return result;
}
-grpc_error_handle grpc_resolve_unix_abstract_domain_address(
- const absl::string_view name, grpc_resolved_addresses** addresses) {
- *addresses = static_cast<grpc_resolved_addresses*>(
- gpr_malloc(sizeof(grpc_resolved_addresses)));
- (*addresses)->naddrs = 1;
- (*addresses)->addrs = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address)));
- return grpc_core::UnixAbstractSockaddrPopulate(name, (*addresses)->addrs);
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_abstract_domain_address(const absl::string_view name) {
+ grpc_resolved_address addr;
+ grpc_error_handle error =
+ grpc_core::UnixAbstractSockaddrPopulate(name, &addr);
+ if (error == GRPC_ERROR_NONE) {
+ return std::vector<grpc_resolved_address>({addr});
+ }
+ auto result = grpc_error_to_absl_status(error);
+ GRPC_ERROR_UNREF(error);
+ return result;
}
int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr) {
@@ -89,22 +93,4 @@ void grpc_unlink_if_unix_domain_socket(
}
}
-std::string 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 "";
- }
- const auto* unix_addr = reinterpret_cast<const struct sockaddr_un*>(addr);
- if (unix_addr->sun_path[0] == '\0' && unix_addr->sun_path[1] != '\0') {
- return absl::StrCat(
- "unix-abstract:",
- absl::string_view(
- unix_addr->sun_path + 1,
- resolved_addr->len - sizeof(unix_addr->sun_family) - 1));
- }
- return absl::StrCat("unix:", unix_addr->sun_path);
-}
-
#endif
diff --git a/grpc/src/core/lib/iomgr/unix_sockets_posix.h b/grpc/src/core/lib/iomgr/unix_sockets_posix.h
index c35423bc..701b836d 100644
--- a/grpc/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/grpc/src/core/lib/iomgr/unix_sockets_posix.h
@@ -23,28 +23,24 @@
#include <string>
-#include "src/core/lib/iomgr/port.h"
+#include "absl/strings/string_view.h"
#include <grpc/support/string_util.h>
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "absl/strings/string_view.h"
-
void grpc_create_socketpair_if_unix(int sv[2]);
-grpc_error_handle grpc_resolve_unix_domain_address(
- const char* name, grpc_resolved_addresses** addresses);
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_domain_address(absl::string_view name);
-grpc_error_handle grpc_resolve_unix_abstract_domain_address(
- absl::string_view name, grpc_resolved_addresses** addresses);
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_abstract_domain_address(absl::string_view name);
int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr);
void grpc_unlink_if_unix_domain_socket(
const grpc_resolved_address* resolved_addr);
-std::string 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/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc b/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
index c2659221..492d04ac 100644
--- a/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
+++ b/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
@@ -33,18 +33,14 @@ void grpc_create_socketpair_if_unix(int /* sv */[2]) {
GPR_ASSERT(0);
}
-grpc_error_handle grpc_resolve_unix_domain_address(
- const char* /* name */, grpc_resolved_addresses** addresses) {
- *addresses = NULL;
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unix domain sockets are not supported on Windows");
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_domain_address(absl::string_view /* name */) {
+ return absl::UnknownError("Unix domain sockets are not supported on Windows");
}
-grpc_error_handle grpc_resolve_unix_abstract_domain_address(
- absl::string_view, grpc_resolved_addresses** addresses) {
- *addresses = NULL;
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unix domain sockets are not supported on Windows");
+absl::StatusOr<std::vector<grpc_resolved_address>>
+grpc_resolve_unix_abstract_domain_address(absl::string_view /* name */) {
+ return absl::UnknownError("Unix domain sockets are not supported on Windows");
}
int grpc_is_unix_socket(const grpc_resolved_address* /* addr */) {
@@ -54,9 +50,4 @@ int grpc_is_unix_socket(const grpc_resolved_address* /* addr */) {
void grpc_unlink_if_unix_domain_socket(
const grpc_resolved_address* /* addr */) {}
-std::string grpc_sockaddr_to_uri_unix_if_possible(
- const grpc_resolved_address* /* addr */) {
- return "";
-}
-
#endif
diff --git a/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc b/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
index b1565751..aff61eaa 100644
--- a/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
+++ b/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
@@ -28,6 +28,7 @@
#ifdef GRPC_POSIX_NO_SPECIAL_WAKEUP_FD
#include <stddef.h>
+
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
static int check_availability_invalid(void) { return 0; }
diff --git a/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc b/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
index 943d9d54..e25a9448 100644
--- a/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
+++ b/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
@@ -22,9 +22,6 @@
#ifdef GRPC_POSIX_WAKEUP_FD
-#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-
#include <errno.h>
#include <string.h>
#include <unistd.h>
@@ -32,6 +29,8 @@
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
+#include "src/core/lib/iomgr/wakeup_fd_posix.h"
static grpc_error_handle pipe_init(grpc_wakeup_fd* fd_info) {
int pipefd[2];
diff --git a/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc b/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
index 36b497b8..89bd51ba 100644
--- a/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
+++ b/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
@@ -23,6 +23,7 @@
#ifdef GRPC_POSIX_WAKEUP_FD
#include <stddef.h>
+
#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
diff --git a/grpc/src/core/lib/iomgr/work_serializer.cc b/grpc/src/core/lib/iomgr/work_serializer.cc
index db573e3b..ac98962b 100644
--- a/grpc/src/core/lib/iomgr/work_serializer.cc
+++ b/grpc/src/core/lib/iomgr/work_serializer.cc
@@ -24,54 +24,79 @@ 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 Run(std::function<void()> callback, const DebugLocation& location);
+ void Schedule(std::function<void()> callback, const DebugLocation& location);
+ void DrainQueue();
void Orphan() override;
private:
- void DrainQueue();
+ struct CallbackWrapper {
+ CallbackWrapper(std::function<void()> cb, const DebugLocation& loc)
+ : callback(std::move(cb)), location(loc) {}
+
+ MultiProducerSingleConsumerQueue::Node mpscq_node;
+ const std::function<void()> callback;
+ const DebugLocation location;
+ };
+
+ // Callers of DrainQueueOwned should make sure to grab the lock on the
+ // workserializer with
+ //
+ // prev_ref_pair =
+ // refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
+ //
+ // and only invoke DrainQueueOwned() if there was previously no owner. Note
+ // that the queue size is also incremented as part of the fetch_add to allow
+ // the callers to add a callback to the queue if another thread already holds
+ // the lock to the work serializer.
+ void DrainQueueOwned();
+
+ // First 16 bits indicate ownership of the WorkSerializer, next 48 bits are
+ // queue size (i.e., refs).
+ static uint64_t MakeRefPair(uint16_t owners, uint64_t size) {
+ GPR_ASSERT(size >> 48 == 0);
+ return (static_cast<uint64_t>(owners) << 48) + static_cast<int64_t>(size);
+ }
+ static uint32_t GetOwners(uint64_t ref_pair) {
+ return static_cast<uint32_t>(ref_pair >> 48);
+ }
+ static uint64_t GetSize(uint64_t ref_pair) {
+ return static_cast<uint64_t>(ref_pair & 0xffffffffffffu);
+ }
// An initial size of 1 keeps track of whether the work serializer has been
// orphaned.
- Atomic<size_t> size_{1};
+ std::atomic<uint64_t> refs_{MakeRefPair(0, 1)};
MultiProducerSingleConsumerQueue queue_;
};
-void WorkSerializer::WorkSerializerImpl::Run(
- std::function<void()> callback, const grpc_core::DebugLocation& location) {
+void WorkSerializer::WorkSerializerImpl::Run(std::function<void()> callback,
+ const 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);
+ // Increment queue size for the new callback and owner count to attempt to
+ // take ownership of the WorkSerializer.
+ const uint64_t prev_ref_pair =
+ refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
// 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.
+ GPR_DEBUG_ASSERT(GetSize(prev_ref_pair) > 0);
+ if (GetOwners(prev_ref_pair) == 0) {
+ // We took ownership of the WorkSerializer. Invoke callback and drain queue.
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();
+ DrainQueueOwned();
} else {
+ // Another thread is holding the WorkSerializer, so decrement the ownership
+ // count we just added and queue the callback.
+ refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel);
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);
}
@@ -79,12 +104,26 @@ void WorkSerializer::WorkSerializerImpl::Run(
}
}
+void WorkSerializer::WorkSerializerImpl::Schedule(
+ std::function<void()> callback, const DebugLocation& location) {
+ CallbackWrapper* cb_wrapper =
+ new CallbackWrapper(std::move(callback), location);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO,
+ "WorkSerializer::Schedule() %p Scheduling callback %p [%s:%d]",
+ this, cb_wrapper, location.file(), location.line());
+ }
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_acq_rel);
+ 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) {
+ const uint64_t prev_ref_pair =
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
+ if (GetOwners(prev_ref_pair) == 0 && GetSize(prev_ref_pair) == 1) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Destroying");
}
@@ -93,30 +132,58 @@ void WorkSerializer::WorkSerializerImpl::Orphan() {
}
// 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.
+// execute all the scheduled callbacks.
void WorkSerializer::WorkSerializerImpl::DrainQueue() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this);
+ }
+ // Attempt to take ownership of the WorkSerializer. Also increment the queue
+ // size as required by `DrainQueueOwned()`.
+ const uint64_t prev_ref_pair =
+ refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
+ if (GetOwners(prev_ref_pair) == 0) {
+ // We took ownership of the WorkSerializer. Drain the queue.
+ DrainQueueOwned();
+ } else {
+ // Another thread is holding the WorkSerializer, so decrement the ownership
+ // count we just added and queue a no-op callback.
+ refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel);
+ CallbackWrapper* cb_wrapper = new CallbackWrapper([]() {}, DEBUG_LOCATION);
+ queue_.Push(&cb_wrapper->mpscq_node);
+ }
+}
+
+void WorkSerializer::WorkSerializerImpl::DrainQueueOwned() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::DrainQueueOwned() %p", this);
+ }
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
+ auto prev_ref_pair = refs_.fetch_sub(MakeRefPair(0, 1));
+ // It is possible that while draining the queue, the last callback ended
// up orphaning the work serializer. In that case, delete the object.
- if (prev_size == 1) {
+ if (GetSize(prev_ref_pair) == 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");
+ if (GetSize(prev_ref_pair) == 2) {
+ // Queue drained. Give up ownership but only if queue remains empty.
+ uint64_t expected = MakeRefPair(1, 1);
+ if (refs_.compare_exchange_strong(expected, MakeRefPair(0, 1),
+ std::memory_order_acq_rel)) {
+ // Queue is drained.
+ return;
+ }
+ if (GetSize(expected) == 0) {
+ // WorkSerializer got orphaned while this was running
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, " Queue Drained. Destroying");
+ }
+ delete this;
+ return;
}
- return;
}
// There is at least one callback on the queue. Pop the callback from the
// queue and execute it.
@@ -124,8 +191,8 @@ void WorkSerializer::WorkSerializerImpl::DrainQueue() {
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()
+ // This can happen due to a race condition within the mpscq
+ // implementation or because of a race with Run()/Schedule().
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Queue returned nullptr, trying again");
}
@@ -140,7 +207,9 @@ void WorkSerializer::WorkSerializerImpl::DrainQueue() {
}
}
+//
// WorkSerializer
+//
WorkSerializer::WorkSerializer()
: impl_(MakeOrphanable<WorkSerializerImpl>()) {}
@@ -148,8 +217,15 @@ WorkSerializer::WorkSerializer()
WorkSerializer::~WorkSerializer() {}
void WorkSerializer::Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location) {
+ const DebugLocation& location) {
impl_->Run(std::move(callback), location);
}
+void WorkSerializer::Schedule(std::function<void()> callback,
+ const DebugLocation& location) {
+ impl_->Schedule(std::move(callback), location);
+}
+
+void WorkSerializer::DrainQueue() { impl_->DrainQueue(); }
+
} // namespace grpc_core
diff --git a/grpc/src/core/lib/iomgr/work_serializer.h b/grpc/src/core/lib/iomgr/work_serializer.h
index 547b80c7..217018cf 100644
--- a/grpc/src/core/lib/iomgr/work_serializer.h
+++ b/grpc/src/core/lib/iomgr/work_serializer.h
@@ -18,12 +18,12 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <functional>
#include "absl/synchronization/mutex.h"
#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"
@@ -45,13 +45,20 @@ namespace grpc_core {
// 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().
+// If a thread wants to preclude the possibility of the callback being invoked
+// inline in Run() (for example, if a mutex lock is held and executing callbacks
+// inline would cause a deadlock), it should use Schedule() instead and then
+// invoke DrainQueue() when it is safe to invoke the callback.
class ABSL_LOCKABLE WorkSerializer {
public:
WorkSerializer();
~WorkSerializer();
- // Runs a given callback.
+ // Runs a given callback on the work serializer. If there is no other thread
+ // currently executing the WorkSerializer, the callback is run immediately. In
+ // this case, the current thread is also borrowed for draining the queue for
+ // any callbacks that get added in the meantime.
//
// If you want to use clang thread annotation to make sure that callback is
// called by WorkSerializer only, you need to add the annotation to both the
@@ -65,10 +72,15 @@ class ABSL_LOCKABLE WorkSerializer {
// }
// void callback() ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer) { ... }
//
- // TODO(yashkt): Replace grpc_core::DebugLocation with absl::SourceLocation
+ // TODO(yashkt): Replace DebugLocation with absl::SourceLocation
// once we can start using it directly.
- void Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location);
+ void Run(std::function<void()> callback, const DebugLocation& location);
+
+ // Schedule \a callback to be run later when the queue of callbacks is
+ // drained.
+ void Schedule(std::function<void()> callback, const DebugLocation& location);
+ // Drains the queue of callbacks.
+ void DrainQueue();
private:
class WorkSerializerImpl;
diff --git a/grpc/src/core/lib/json/json_reader.cc b/grpc/src/core/lib/json/json_reader.cc
index 2daeadf4..bdd749fb 100644
--- a/grpc/src/core/lib/json/json_reader.cc
+++ b/grpc/src/core/lib/json/json_reader.cc
@@ -95,8 +95,8 @@ class JsonReader {
size_t CurrentIndex() const { return input_ - original_input_ - 1; }
- void StringAddChar(uint32_t c);
- void StringAddUtf32(uint32_t c);
+ GRPC_MUST_USE_RESULT bool StringAddChar(uint32_t c);
+ GRPC_MUST_USE_RESULT bool StringAddUtf32(uint32_t c);
Json* CreateAndLinkValue();
bool StartContainer(Json::Type type);
@@ -119,6 +119,7 @@ class JsonReader {
uint16_t unicode_high_surrogate_ = 0;
std::vector<grpc_error_handle> errors_;
bool truncated_errors_ = false;
+ uint8_t utf8_bytes_remaining_ = 0;
Json root_value_;
std::vector<Json*> stack_;
@@ -127,34 +128,55 @@ class JsonReader {
std::string string_;
};
-void JsonReader::StringAddChar(uint32_t c) {
+bool JsonReader::StringAddChar(uint32_t c) {
+ switch (utf8_bytes_remaining_) {
+ case 0:
+ if ((c & 0x80) == 0) {
+ utf8_bytes_remaining_ = 0;
+ } else if ((c & 0xe0) == 0xc0) {
+ utf8_bytes_remaining_ = 1;
+ } else if ((c & 0xf0) == 0xe0) {
+ utf8_bytes_remaining_ = 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ utf8_bytes_remaining_ = 3;
+ } else {
+ return false;
+ }
+ break;
+ case 1:
+ case 2:
+ case 3:
+ if ((c & 0xc0) != 0x80) return false;
+ --utf8_bytes_remaining_;
+ break;
+ default:
+ abort();
+ }
string_.push_back(static_cast<uint8_t>(c));
+ return true;
}
-void JsonReader::StringAddUtf32(uint32_t c) {
+bool JsonReader::StringAddUtf32(uint32_t c) {
if (c <= 0x7f) {
- StringAddChar(c);
+ return StringAddChar(c);
} else if (c <= 0x7ff) {
uint32_t b1 = 0xc0 | ((c >> 6) & 0x1f);
uint32_t b2 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
+ return 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);
+ return 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);
+ return StringAddChar(b1) && StringAddChar(b2) && StringAddChar(b3) &&
+ StringAddChar(b4);
+ } else {
+ return false;
}
}
@@ -180,10 +202,9 @@ Json* JsonReader::CreateAndLinkValue() {
if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
truncated_errors_ = true;
} else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("duplicate key \"%s\" at index %" PRIuPTR, key_,
- CurrentIndex())
- .c_str()));
+ CurrentIndex())));
}
}
value = &(*parent->mutable_object())[std::move(key_)];
@@ -201,10 +222,9 @@ bool JsonReader::StartContainer(Json::Type type) {
if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
truncated_errors_ = true;
} else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("exceeded max stack depth (%d) at index %" PRIuPTR,
- GRPC_JSON_MAX_DEPTH, CurrentIndex())
- .c_str()));
+ GRPC_JSON_MAX_DEPTH, CurrentIndex())));
}
return false;
}
@@ -277,12 +297,22 @@ JsonReader::Status JsonReader::Run() {
switch (c) {
/* Let's process the error case first. */
case GRPC_JSON_READ_CHAR_EOF:
+ switch (state_) {
+ 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:
+ break;
+ }
if (IsComplete()) {
return Status::GRPC_JSON_DONE;
- } else {
- return Status::GRPC_JSON_PARSE_ERROR;
}
- break;
+ return Status::GRPC_JSON_PARSE_ERROR;
/* Processing whitespaces. */
case ' ':
@@ -303,7 +333,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
@@ -329,7 +359,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
@@ -341,14 +371,12 @@ JsonReader::Status JsonReader::Run() {
} 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;
- /* The missing break here is intentional. */
- /* fallthrough */
+ ABSL_FALLTHROUGH_INTENDED;
case State::GRPC_JSON_STATE_VALUE_END:
case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
@@ -416,7 +444,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar('\\');
+ if (!StringAddChar('\\')) return Status::GRPC_JSON_PARSE_ERROR;
if (escaped_string_was_key_) {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
} else {
@@ -443,10 +471,15 @@ JsonReader::Status JsonReader::Run() {
}
if (c == '"') {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_END;
+ // Once the key is parsed, there should no un-matched utf8
+ // encoded bytes.
+ if (utf8_bytes_remaining_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
SetKey();
} else {
if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -456,10 +489,15 @@ JsonReader::Status JsonReader::Run() {
}
if (c == '"') {
state_ = State::GRPC_JSON_STATE_VALUE_END;
+ // Once the value is parsed, there should no un-matched utf8
+ // encoded bytes.
+ if (utf8_bytes_remaining_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
SetString();
} else {
if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -487,7 +525,7 @@ JsonReader::Status JsonReader::Run() {
break;
case '0':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO;
break;
@@ -501,7 +539,7 @@ JsonReader::Status JsonReader::Run() {
case '8':
case '9':
case '-':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER;
break;
@@ -536,22 +574,22 @@ JsonReader::Status JsonReader::Run() {
switch (c) {
case '"':
case '/':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'b':
- StringAddChar('\b');
+ if (!StringAddChar('\b')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'f':
- StringAddChar('\f');
+ if (!StringAddChar('\f')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'n':
- StringAddChar('\n');
+ if (!StringAddChar('\n')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'r':
- StringAddChar('\r');
+ if (!StringAddChar('\r')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 't':
- StringAddChar('\t');
+ if (!StringAddChar('\t')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'u':
state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U1;
@@ -608,14 +646,18 @@ JsonReader::Status JsonReader::Run() {
utf32 += static_cast<uint32_t>(
(unicode_high_surrogate_ - 0xd800) * 0x400);
utf32 += static_cast<uint32_t>(unicode_char_ - 0xdc00);
- StringAddUtf32(utf32);
+ if (!StringAddUtf32(utf32)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
unicode_high_surrogate_ = 0;
} else {
/* anything else */
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddUtf32(unicode_char_);
+ if (!StringAddUtf32(unicode_char_)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
}
if (escaped_string_was_key_) {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
@@ -629,7 +671,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -655,7 +697,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -679,12 +721,12 @@ JsonReader::Status JsonReader::Run() {
case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
if (c != '.') return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_DOT:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -704,7 +746,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_E:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -726,7 +768,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -830,14 +872,11 @@ grpc_error_handle JsonReader::Parse(absl::string_view input, Json* output) {
"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(
- absl::StrCat("internal error in JSON parser at index ",
- reader.CurrentIndex())
- .c_str()));
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "internal error in JSON parser at index ", reader.CurrentIndex())));
} else if (status == Status::GRPC_JSON_PARSE_ERROR) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("JSON parse error at index ", reader.CurrentIndex())
- .c_str()));
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("JSON parse error at index ", reader.CurrentIndex())));
}
if (!reader.errors_.empty()) {
return GRPC_ERROR_CREATE_FROM_VECTOR("JSON parsing failed",
diff --git a/grpc/src/core/lib/json/json_util.cc b/grpc/src/core/lib/json/json_util.cc
index 1c90aeb5..168070bd 100644
--- a/grpc/src/core/lib/json/json_util.cc
+++ b/grpc/src/core/lib/json/json_util.cc
@@ -26,11 +26,11 @@
namespace grpc_core {
-bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
+bool ParseDurationFromJson(const Json& field, Duration* 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()));
+ 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;
@@ -51,7 +51,75 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
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;
+ *duration = Duration::FromSecondsAndNanoseconds(seconds, nanos);
+ return true;
+}
+
+bool ExtractJsonBool(const Json& json, absl::string_view field_name,
+ bool* output, std::vector<grpc_error_handle>* 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_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:type should be BOOLEAN")));
+ return false;
+ }
+}
+
+bool ExtractJsonArray(const Json& json, absl::string_view field_name,
+ const Json::Array** output,
+ std::vector<grpc_error_handle>* error_list) {
+ if (json.type() != Json::Type::ARRAY) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:type should be ARRAY")));
+ return false;
+ }
+ *output = &json.array_value();
+ return true;
+}
+
+bool ExtractJsonObject(const Json& json, absl::string_view field_name,
+ const Json::Object** output,
+ std::vector<grpc_error_handle>* error_list) {
+ if (json.type() != Json::Type::OBJECT) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:type should be OBJECT")));
+ return false;
+ }
+ *output = &json.object_value();
+ return true;
+}
+
+bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
+ absl::string_view field_name,
+ Duration* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required) {
+ // TODO(roth): Once we can use C++14 heterogenous lookups, stop
+ // creating a std::string here.
+ auto it = object.find(std::string(field_name));
+ if (it == object.end()) {
+ if (required) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:does not exist.")));
+ }
+ return false;
+ }
+ if (!ParseDurationFromJson(it->second, output)) {
+ *output = Duration::NegativeInfinity();
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name,
+ " error:type should be STRING of the form given by "
+ "google.proto.Duration.")));
+ return false;
+ }
return true;
}
diff --git a/grpc/src/core/lib/json/json_util.h b/grpc/src/core/lib/json/json_util.h
index 00a96eb7..9582ab21 100644
--- a/grpc/src/core/lib/json/json_util.h
+++ b/grpc/src/core/lib/json/json_util.h
@@ -33,138 +33,108 @@ namespace grpc_core {
// 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);
+bool ParseDurationFromJson(const Json& field, Duration* duration);
//
// Helper functions for extracting types from JSON.
// Return true on success, false otherwise. If an error is encountered during
// parsing, a descriptive error is appended to \a error_list.
//
-template <typename NumericType, typename ErrorVectorType>
-inline bool ExtractJsonNumber(const Json& json, const std::string& field_name,
- NumericType* output,
- ErrorVectorType* error_list) {
+template <typename NumericType>
+bool ExtractJsonNumber(const Json& json, absl::string_view field_name,
+ NumericType* output,
+ std::vector<grpc_error_handle>* 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(
- absl::StrCat("field:", field_name, " error:type should be NUMBER")
- .c_str()));
+ if (json.type() != Json::Type::NUMBER && json.type() != Json::Type::STRING) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "field:", field_name, " error:type should be NUMBER or STRING")));
return false;
}
if (!absl::SimpleAtoi(json.string_value(), output)) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:", field_name, " error:failed to parse.").c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:failed to parse.")));
return false;
}
return true;
}
-template <typename ErrorVectorType>
-inline bool ExtractJsonBool(const Json& json, const std::string& 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(
- absl::StrCat("field:", field_name, " error:type should be BOOLEAN")
- .c_str()));
- return false;
- }
-}
+bool ExtractJsonBool(const Json& json, absl::string_view field_name,
+ bool* output, std::vector<grpc_error_handle>* error_list);
-template <typename ErrorVectorType>
-inline bool ExtractJsonString(const Json& json, const std::string& field_name,
- std::string* output,
- ErrorVectorType* error_list) {
+// OutputType can be std::string or absl::string_view.
+template <typename OutputType>
+bool ExtractJsonString(const Json& json, absl::string_view field_name,
+ OutputType* output,
+ std::vector<grpc_error_handle>* error_list) {
if (json.type() != Json::Type::STRING) {
*output = "";
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:", field_name, " error:type should be STRING")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:type should be STRING")));
return false;
}
*output = json.string_value();
return true;
}
-template <typename ErrorVectorType>
-inline bool ExtractJsonArray(const Json& json, const std::string& 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(
- absl::StrCat("field:", field_name, " error:type should be ARRAY")
- .c_str()));
- return false;
- }
- *output = &json.array_value();
- return true;
-}
+bool ExtractJsonArray(const Json& json, absl::string_view field_name,
+ const Json::Array** output,
+ std::vector<grpc_error_handle>* error_list);
-template <typename ErrorVectorType>
-inline bool ExtractJsonObject(const Json& json, const std::string& 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(
- absl::StrCat("field:", field_name, " error:type should be OBJECT")
- .c_str()));
- return false;
- }
- *output = &json.object_value();
- return true;
-}
+bool ExtractJsonObject(const Json& json, absl::string_view field_name,
+ const Json::Object** output,
+ std::vector<grpc_error_handle>* error_list);
-template <typename NumericType, typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const std::string& field_name,
- NumericType* output, ErrorVectorType* error_list) {
+// Wrappers for automatically choosing one of the above functions based
+// on output parameter type.
+template <typename NumericType>
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
+ NumericType* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonNumber(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const std::string& field_name,
- bool* output, ErrorVectorType* error_list) {
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
+ bool* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonBool(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const std::string& field_name,
- std::string* output, ErrorVectorType* error_list) {
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
+ std::string* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonString(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const std::string& field_name,
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
+ absl::string_view* output,
+ std::vector<grpc_error_handle>* error_list) {
+ return ExtractJsonString(json, field_name, output, error_list);
+}
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
const Json::Array** output,
- ErrorVectorType* error_list) {
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonArray(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const std::string& field_name,
+inline bool ExtractJsonType(const Json& json, absl::string_view field_name,
const Json::Object** output,
- ErrorVectorType* error_list) {
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonObject(json, field_name, output, error_list);
}
-template <typename T, typename ErrorVectorType>
-inline bool ParseJsonObjectField(const Json::Object& object,
- const std::string& field_name, T* output,
- ErrorVectorType* error_list,
- bool required = true) {
- auto it = object.find(field_name);
+// Extracts a field from a JSON object, automatically selecting the type
+// of parsing based on the output parameter type.
+// If the field is not present, returns false, and if required is true,
+// adds an error to error_list.
+// Upon any other error, adds an error to error_list and returns false.
+template <typename T>
+bool ParseJsonObjectField(const Json::Object& object,
+ absl::string_view field_name, T* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required = true) {
+ // TODO(roth): Once we can use C++14 heterogenous lookups, stop
+ // creating a std::string here.
+ auto it = object.find(std::string(field_name));
if (it == object.end()) {
if (required) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:", field_name, " error:does not exist.")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("field:", field_name, " error:does not exist.")));
}
return false;
}
@@ -172,32 +142,12 @@ inline bool ParseJsonObjectField(const Json::Object& object,
return ExtractJsonType(child_object_json, field_name, output, error_list);
}
-template <typename ErrorVectorType>
-inline bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
- const std::string& field_name,
- grpc_millis* output,
- ErrorVectorType* error_list,
- bool required = true) {
- auto it = object.find(field_name);
- if (it == object.end()) {
- if (required) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:", field_name, " error:does not exist.")
- .c_str()));
- }
- return false;
- }
- if (!ParseDurationFromJson(it->second, output)) {
- *output = GRPC_MILLIS_INF_PAST;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("field:", field_name,
- " error:type should be STRING of the form given by "
- "google.proto.Duration.")
- .c_str()));
- return false;
- }
- return true;
-}
+// Alternative to ParseJsonObjectField() for duration-value fields.
+bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
+ absl::string_view field_name,
+ Duration* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required = true);
} // namespace grpc_core
diff --git a/grpc/src/core/lib/json/json_writer.cc b/grpc/src/core/lib/json/json_writer.cc
index 74d0cf50..7522802a 100644
--- a/grpc/src/core/lib/json/json_writer.cc
+++ b/grpc/src/core/lib/json/json_writer.cc
@@ -23,9 +23,6 @@
#include "absl/strings/string_view.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
#include "src/core/lib/json/json.h"
namespace grpc_core {
diff --git a/grpc/src/core/lib/matchers/matchers.cc b/grpc/src/core/lib/matchers/matchers.cc
index 489a4808..12f509b1 100644
--- a/grpc/src/core/lib/matchers/matchers.cc
+++ b/grpc/src/core/lib/matchers/matchers.cc
@@ -32,14 +32,12 @@ absl::StatusOr<StringMatcher> StringMatcher::Create(Type type,
absl::string_view matcher,
bool case_sensitive) {
if (type == Type::kSafeRegex) {
- RE2::Options options;
- options.set_case_sensitive(case_sensitive);
- auto regex_matcher = absl::make_unique<RE2>(std::string(matcher), options);
+ auto regex_matcher = absl::make_unique<RE2>(std::string(matcher));
if (!regex_matcher->ok()) {
return absl::InvalidArgumentError(
"Invalid regex string specified in matcher.");
}
- return StringMatcher(std::move(regex_matcher), case_sensitive);
+ return StringMatcher(std::move(regex_matcher));
} else {
return StringMatcher(type, matcher, case_sensitive);
}
@@ -49,19 +47,13 @@ StringMatcher::StringMatcher(Type type, absl::string_view matcher,
bool case_sensitive)
: type_(type), string_matcher_(matcher), case_sensitive_(case_sensitive) {}
-StringMatcher::StringMatcher(std::unique_ptr<RE2> regex_matcher,
- bool case_sensitive)
- : type_(Type::kSafeRegex),
- regex_matcher_(std::move(regex_matcher)),
- case_sensitive_(case_sensitive) {}
+StringMatcher::StringMatcher(std::unique_ptr<RE2> regex_matcher)
+ : type_(Type::kSafeRegex), regex_matcher_(std::move(regex_matcher)) {}
StringMatcher::StringMatcher(const StringMatcher& other)
: type_(other.type_), case_sensitive_(other.case_sensitive_) {
if (type_ == Type::kSafeRegex) {
- RE2::Options options;
- options.set_case_sensitive(other.case_sensitive_);
- regex_matcher_ =
- absl::make_unique<RE2>(other.regex_matcher_->pattern(), options);
+ regex_matcher_ = absl::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}
@@ -70,10 +62,7 @@ StringMatcher::StringMatcher(const StringMatcher& other)
StringMatcher& StringMatcher::operator=(const StringMatcher& other) {
type_ = other.type_;
if (type_ == Type::kSafeRegex) {
- RE2::Options options;
- options.set_case_sensitive(other.case_sensitive_);
- regex_matcher_ =
- absl::make_unique<RE2>(other.regex_matcher_->pattern(), options);
+ regex_matcher_ = absl::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}
@@ -151,9 +140,8 @@ std::string StringMatcher::ToString() const {
return absl::StrFormat("StringMatcher{contains=%s%s}", string_matcher_,
case_sensitive_ ? "" : ", case_sensitive=false");
case Type::kSafeRegex:
- return absl::StrFormat("StringMatcher{safe_regex=%s%s}",
- regex_matcher_->pattern(),
- case_sensitive_ ? "" : ", case_sensitive=false");
+ return absl::StrFormat("StringMatcher{safe_regex=%s}",
+ regex_matcher_->pattern());
default:
return "";
}
@@ -303,7 +291,7 @@ bool HeaderMatcher::Match(
match = value.has_value() == present_match_;
} else if (!value.has_value()) {
// All other types fail to match if field is not present.
- match = false;
+ return false;
} else if (type_ == Type::kRange) {
int64_t int_value;
match = absl::SimpleAtoi(value.value(), &int_value) &&
diff --git a/grpc/src/core/lib/matchers/matchers.h b/grpc/src/core/lib/matchers/matchers.h
index af2ce59b..9889d688 100644
--- a/grpc/src/core/lib/matchers/matchers.h
+++ b/grpc/src/core/lib/matchers/matchers.h
@@ -23,7 +23,6 @@
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
-
#include "re2/re2.h"
namespace grpc_core {
@@ -39,6 +38,7 @@ class StringMatcher {
};
// Creates StringMatcher instance. Returns error status on failure.
+ // Note: case_sensitive is ignored for type kSafeRegex.
static absl::StatusOr<StringMatcher> Create(Type type,
absl::string_view matcher,
bool case_sensitive = true);
@@ -66,7 +66,7 @@ class StringMatcher {
private:
StringMatcher(Type type, absl::string_view matcher, bool case_sensitive);
- StringMatcher(std::unique_ptr<RE2> regex_matcher, bool case_sensitive);
+ explicit StringMatcher(std::unique_ptr<RE2> regex_matcher);
Type type_ = Type::kExact;
std::string string_matcher_;
diff --git a/grpc/src/core/lib/profiling/basic_timers.cc b/grpc/src/core/lib/profiling/basic_timers.cc
index 2056940f..f98624bf 100644
--- a/grpc/src/core/lib/profiling/basic_timers.cc
+++ b/grpc/src/core/lib/profiling/basic_timers.cc
@@ -22,15 +22,17 @@
#ifdef GRPC_BASIC_PROFILER
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/profiling/timers.h"
@@ -61,7 +63,7 @@ typedef struct gpr_timer_log_list {
gpr_timer_log* tail;
} gpr_timer_log_list;
-static __thread gpr_timer_log* g_thread_log;
+static GPR_THREAD_LOCAL(gpr_timer_log*) g_thread_log;
static gpr_once g_once_init = GPR_ONCE_INIT;
static FILE* output_file;
static const char* output_filename_or_null = NULL;
@@ -71,7 +73,7 @@ static gpr_timer_log_list g_in_progress_logs;
static gpr_timer_log_list g_done_logs;
static int g_shutdown;
static pthread_t g_writing_thread;
-static __thread int g_thread_id;
+static GPR_THREAD_LOCAL(int) g_thread_id;
static int g_next_thread_id;
static int g_writing_enabled = 1;
diff --git a/grpc/src/core/lib/profiling/stap_timers.cc b/grpc/src/core/lib/profiling/stap_timers.cc
index 5ee1c431..a00dbaf2 100644
--- a/grpc/src/core/lib/profiling/stap_timers.cc
+++ b/grpc/src/core/lib/profiling/stap_timers.cc
@@ -20,9 +20,9 @@
#ifdef GRPC_STAP_PROFILER
-#include "src/core/lib/profiling/timers.h"
-
#include <sys/sdt.h>
+
+#include "src/core/lib/profiling/timers.h"
/* Generated from src/core/profiling/stap_probes.d */
#include "src/core/lib/profiling/stap_probes.h"
diff --git a/grpc/src/core/lib/promise/activity.cc b/grpc/src/core/lib/promise/activity.cc
new file mode 100644
index 00000000..adb35272
--- /dev/null
+++ b/grpc/src/core/lib/promise/activity.cc
@@ -0,0 +1,121 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/promise/activity.h"
+
+#include "absl/base/attributes.h"
+
+#include "src/core/lib/gprpp/atomic_utils.h"
+
+namespace grpc_core {
+
+///////////////////////////////////////////////////////////////////////////////
+// GLOBALS
+
+GPR_THREAD_LOCAL(Activity*) Activity::g_current_activity_{nullptr};
+Waker::Unwakeable Waker::unwakeable_;
+
+namespace promise_detail {
+
+///////////////////////////////////////////////////////////////////////////////
+// HELPER TYPES
+
+// Weak handle to an Activity.
+// Handle can persist while Activity goes away.
+class FreestandingActivity::Handle final : public Wakeable {
+ public:
+ explicit Handle(FreestandingActivity* activity) : activity_(activity) {}
+
+ // Ref the Handle (not the activity).
+ void Ref() { refs_.fetch_add(1, std::memory_order_relaxed); }
+
+ // Activity is going away... drop its reference and sever the connection back.
+ void DropActivity() ABSL_LOCKS_EXCLUDED(mu_) {
+ mu_.Lock();
+ GPR_ASSERT(activity_ != nullptr);
+ activity_ = nullptr;
+ mu_.Unlock();
+ Unref();
+ }
+
+ // Activity needs to wake up (if it still exists!) - wake it up, and drop the
+ // ref that was kept for this handle.
+ void Wakeup() override ABSL_LOCKS_EXCLUDED(mu_) {
+ mu_.Lock();
+ // Note that activity refcount can drop to zero, but we could win the lock
+ // against DropActivity, so we need to only increase activities refcount if
+ // it is non-zero.
+ if (activity_ && activity_->RefIfNonzero()) {
+ FreestandingActivity* activity = activity_;
+ mu_.Unlock();
+ // Activity still exists and we have a reference: wake it up, which will
+ // drop the ref.
+ activity->Wakeup();
+ } else {
+ // Could not get the activity - it's either gone or going. No need to wake
+ // it up!
+ mu_.Unlock();
+ }
+ // Drop the ref to the handle (we have one ref = one wakeup semantics).
+ Unref();
+ }
+
+ void Drop() override { Unref(); }
+
+ private:
+ // Unref the Handle (not the activity).
+ void Unref() {
+ if (1 == refs_.fetch_sub(1, std::memory_order_acq_rel)) {
+ delete this;
+ }
+ }
+
+ // Two initial refs: one for the waiter that caused instantiation, one for the
+ // activity.
+ std::atomic<size_t> refs_{2};
+ Mutex mu_ ABSL_ACQUIRED_AFTER(activity_->mu_);
+ FreestandingActivity* activity_ ABSL_GUARDED_BY(mu_);
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// ACTIVITY IMPLEMENTATION
+
+bool FreestandingActivity::RefIfNonzero() { return IncrementIfNonzero(&refs_); }
+
+FreestandingActivity::Handle* FreestandingActivity::RefHandle() {
+ if (handle_ == nullptr) {
+ // No handle created yet - construct it and return it.
+ handle_ = new Handle(this);
+ return handle_;
+ } else {
+ // Already had to create a handle, ref & return it.
+ handle_->Ref();
+ return handle_;
+ }
+}
+
+void FreestandingActivity::DropHandle() {
+ handle_->DropActivity();
+ handle_ = nullptr;
+}
+
+Waker FreestandingActivity::MakeNonOwningWaker() {
+ mu_.AssertHeld();
+ return Waker(RefHandle());
+}
+
+} // namespace promise_detail
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/promise/activity.h b/grpc/src/core/lib/promise/activity.h
new file mode 100644
index 00000000..01aed8b3
--- /dev/null
+++ b/grpc/src/core/lib/promise/activity.h
@@ -0,0 +1,540 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_ACTIVITY_H
+#define GRPC_CORE_LIB_PROMISE_ACTIVITY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <atomic>
+#include <functional>
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+#include "absl/base/thread_annotations.h"
+#include "absl/status/status.h"
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+#include "absl/utility/utility.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/tls.h"
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/promise/context.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// A Wakeable object is used by queues to wake activities.
+class Wakeable {
+ public:
+ // Wake up the underlying activity.
+ // After calling, this Wakeable cannot be used again.
+ virtual void Wakeup() = 0;
+ // Drop this wakeable without waking up the underlying activity.
+ virtual void Drop() = 0;
+
+ protected:
+ inline ~Wakeable() {}
+};
+
+// An owning reference to a Wakeable.
+// This type is non-copyable but movable.
+class Waker {
+ public:
+ explicit Waker(Wakeable* wakeable) : wakeable_(wakeable) {}
+ Waker() : wakeable_(&unwakeable_) {}
+ ~Waker() { wakeable_->Drop(); }
+ Waker(const Waker&) = delete;
+ Waker& operator=(const Waker&) = delete;
+ Waker(Waker&& other) noexcept : wakeable_(other.wakeable_) {
+ other.wakeable_ = &unwakeable_;
+ }
+ Waker& operator=(Waker&& other) noexcept {
+ std::swap(wakeable_, other.wakeable_);
+ return *this;
+ }
+
+ // Wake the underlying activity.
+ void Wakeup() {
+ wakeable_->Wakeup();
+ wakeable_ = &unwakeable_;
+ }
+
+ template <typename H>
+ friend H AbslHashValue(H h, const Waker& w) {
+ return H::combine(std::move(h), w.wakeable_);
+ }
+
+ bool operator==(const Waker& other) const noexcept {
+ return wakeable_ == other.wakeable_;
+ }
+
+ private:
+ class Unwakeable final : public Wakeable {
+ public:
+ void Wakeup() final {}
+ void Drop() final {}
+ };
+
+ Wakeable* wakeable_;
+ static Unwakeable unwakeable_;
+};
+
+// An Activity tracks execution of a single promise.
+// It executes the promise under a mutex.
+// When the promise stalls, it registers the containing activity to be woken up
+// later.
+// The activity takes a callback, which will be called exactly once with the
+// result of execution.
+// Activity execution may be cancelled by simply deleting the activity. In such
+// a case, if execution had not already finished, the done callback would be
+// called with absl::CancelledError().
+class Activity : public Orphanable {
+ public:
+ // Force wakeup from the outside.
+ // This should be rarely needed, and usages should be accompanied with a note
+ // on why it's not possible to wakeup with a Waker object.
+ // Nevertheless, it's sometimes useful for integrations with Activity to force
+ // an Activity to repoll.
+ void ForceWakeup() { MakeOwningWaker().Wakeup(); }
+
+ // Force the current activity to immediately repoll if it doesn't complete.
+ virtual void ForceImmediateRepoll() = 0;
+
+ // Return the current activity.
+ // Additionally:
+ // - assert that there is a current activity (and catch bugs if there's not)
+ // - indicate to thread safety analysis that the current activity is indeed
+ // locked
+ // - back up that assertation with a runtime check in debug builds (it's
+ // prohibitively expensive in non-debug builds)
+ static Activity* current() { return g_current_activity_; }
+
+ // Produce an activity-owning Waker. The produced waker will keep the activity
+ // alive until it's awoken or dropped.
+ virtual Waker MakeOwningWaker() = 0;
+
+ // Produce a non-owning Waker. The waker will own a small heap allocated weak
+ // pointer to this activity. This is more suitable for wakeups that may not be
+ // delivered until long after the activity should be destroyed.
+ virtual Waker MakeNonOwningWaker() = 0;
+
+ protected:
+ // Check if this activity is the current activity executing on the current
+ // thread.
+ bool is_current() const { return this == g_current_activity_; }
+ // Check if there is an activity executing on the current thread.
+ static bool have_current() { return g_current_activity_ != nullptr; }
+ // Set the current activity at construction, clean it up at destruction.
+ class ScopedActivity {
+ public:
+ explicit ScopedActivity(Activity* activity) {
+ GPR_ASSERT(g_current_activity_ == nullptr);
+ g_current_activity_ = activity;
+ }
+ ~ScopedActivity() { g_current_activity_ = nullptr; }
+ ScopedActivity(const ScopedActivity&) = delete;
+ ScopedActivity& operator=(const ScopedActivity&) = delete;
+ };
+
+ private:
+ // Set during RunLoop to the Activity that's executing.
+ // Being set implies that mu_ is held.
+ static GPR_THREAD_LOCAL(Activity*) g_current_activity_;
+};
+
+// Owned pointer to one Activity.
+using ActivityPtr = OrphanablePtr<Activity>;
+
+namespace promise_detail {
+
+template <typename Context>
+class ContextHolder {
+ public:
+ using ContextType = Context;
+
+ explicit ContextHolder(Context value) : value_(std::move(value)) {}
+ Context* GetContext() { return &value_; }
+
+ private:
+ Context value_;
+};
+
+template <typename Context>
+class ContextHolder<Context*> {
+ public:
+ using ContextType = Context;
+
+ explicit ContextHolder(Context* value) : value_(value) {}
+ Context* GetContext() { return value_; }
+
+ private:
+ Context* value_;
+};
+
+template <typename Context, typename Deleter>
+class ContextHolder<std::unique_ptr<Context, Deleter>> {
+ public:
+ using ContextType = Context;
+
+ explicit ContextHolder(std::unique_ptr<Context, Deleter> value)
+ : value_(std::move(value)) {}
+ Context* GetContext() { return value_.get(); }
+
+ private:
+ std::unique_ptr<Context, Deleter> value_;
+};
+
+template <typename HeldContext>
+using ContextTypeFromHeld = typename ContextHolder<HeldContext>::ContextType;
+
+template <typename... Contexts>
+class ActivityContexts : public ContextHolder<Contexts>... {
+ public:
+ explicit ActivityContexts(Contexts&&... contexts)
+ : ContextHolder<Contexts>(std::forward<Contexts>(contexts))... {}
+
+ class ScopedContext : public Context<ContextTypeFromHeld<Contexts>>... {
+ public:
+ explicit ScopedContext(ActivityContexts* contexts)
+ : Context<ContextTypeFromHeld<Contexts>>(
+ static_cast<ContextHolder<Contexts>*>(contexts)
+ ->GetContext())... {}
+ };
+};
+
+// A free standing activity: an activity that owns its own synchronization and
+// memory.
+// The alternative is an activity that's somehow tied into another system, for
+// instance the type seen in promise_based_filter.h as we're transitioning from
+// the old filter stack to the new system.
+// FreestandingActivity is-a Wakeable, but needs to increment a refcount before
+// returning that Wakeable interface. Additionally, we want to keep
+// FreestandingActivity as small as is possible, since it will be used
+// everywhere. So we use inheritance to provide the Wakeable interface: this
+// makes it zero sized, and we make the inheritance private to prevent
+// accidental casting.
+class FreestandingActivity : public Activity, private Wakeable {
+ public:
+ Waker MakeOwningWaker() final {
+ Ref();
+ return Waker(this);
+ }
+ Waker MakeNonOwningWaker() final;
+
+ void Orphan() final {
+ Cancel();
+ Unref();
+ }
+
+ void ForceImmediateRepoll() final {
+ mu_.AssertHeld();
+ SetActionDuringRun(ActionDuringRun::kWakeup);
+ }
+
+ protected:
+ // Action received during a run, in priority order.
+ // If more than one action is received during a run, we use max() to resolve
+ // which one to report (so Cancel overrides Wakeup).
+ enum class ActionDuringRun : uint8_t {
+ kNone, // No action occured during run.
+ kWakeup, // A wakeup occured during run.
+ kCancel, // Cancel was called during run.
+ };
+
+ inline ~FreestandingActivity() override {
+ if (handle_) {
+ DropHandle();
+ }
+ }
+
+ // Check if we got an internal wakeup since the last time this function was
+ // called.
+ ActionDuringRun GotActionDuringRun() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ return absl::exchange(action_during_run_, ActionDuringRun::kNone);
+ }
+
+ // Implementors of Wakeable::Wakeup should call this after the wakeup has
+ // completed.
+ void WakeupComplete() { Unref(); }
+
+ // Set the action that occured during this run.
+ // We use max to combine actions so that cancellation overrides wakeups.
+ void SetActionDuringRun(ActionDuringRun action)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ action_during_run_ = std::max(action_during_run_, action);
+ }
+
+ Mutex* mu() ABSL_LOCK_RETURNED(mu_) { return &mu_; }
+
+ private:
+ class Handle;
+
+ // Cancel execution of the underlying promise.
+ virtual void Cancel() = 0;
+
+ void Ref() { refs_.fetch_add(1, std::memory_order_relaxed); }
+ void Unref() {
+ if (1 == refs_.fetch_sub(1, std::memory_order_acq_rel)) {
+ delete this;
+ }
+ }
+
+ // Return a Handle instance with a ref so that it can be stored waiting for
+ // some wakeup.
+ Handle* RefHandle() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ // If our refcount is non-zero, ref and return true.
+ // Otherwise, return false.
+ bool RefIfNonzero();
+ // Drop the (proved existing) wait handle.
+ void DropHandle() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ // All promise execution occurs under this mutex.
+ Mutex mu_;
+
+ // Current refcount.
+ std::atomic<uint32_t> refs_{1};
+ // If wakeup is called during Promise polling, we set this to Wakeup and
+ // repoll. If cancel is called during Promise polling, we set this to Cancel
+ // and cancel at the end of polling.
+ ActionDuringRun action_during_run_ ABSL_GUARDED_BY(mu_) =
+ ActionDuringRun::kNone;
+ // Handle for long waits. Allows a very small weak pointer type object to
+ // queue for wakeups while Activity may be deleted earlier.
+ Handle* handle_ ABSL_GUARDED_BY(mu_) = nullptr;
+};
+
+// Implementation details for an Activity of an arbitrary type of promise.
+// There should exist a static function:
+// struct WakeupScheduler {
+// template <typename ActivityType>
+// void ScheduleWakeup(ActivityType* activity);
+// };
+// This function should arrange that activity->RunScheduledWakeup() be invoked
+// at the earliest opportunity.
+// It can assume that activity will remain live until RunScheduledWakeup() is
+// invoked, and that a given activity will not be concurrently scheduled again
+// until its RunScheduledWakeup() has been invoked.
+// We use private inheritance here as a way of getting private members for
+// each of the contexts.
+// TODO(ctiller): We can probably reconsider the private inheritance here
+// when we move away from C++11 and have more powerful template features.
+template <class F, class WakeupScheduler, class OnDone, typename... Contexts>
+class PromiseActivity final : public FreestandingActivity,
+ private ActivityContexts<Contexts...> {
+ public:
+ using Factory = PromiseFactory<void, F>;
+ using ResultType = typename Factory::Promise::Result;
+
+ PromiseActivity(F promise_factory, WakeupScheduler wakeup_scheduler,
+ OnDone on_done, Contexts&&... contexts)
+ : FreestandingActivity(),
+ ActivityContexts<Contexts...>(std::forward<Contexts>(contexts)...),
+ wakeup_scheduler_(std::move(wakeup_scheduler)),
+ on_done_(std::move(on_done)) {
+ // Lock, construct an initial promise from the factory, and step it.
+ // This may hit a waiter, which could expose our this pointer to other
+ // threads, meaning we do need to hold this mutex even though we're still
+ // constructing.
+ mu()->Lock();
+ auto status = Start(Factory(std::move(promise_factory)));
+ mu()->Unlock();
+ // We may complete immediately.
+ if (status.has_value()) {
+ on_done_(std::move(*status));
+ }
+ }
+
+ ~PromiseActivity() override {
+ // We shouldn't destruct without calling Cancel() first, and that must get
+ // us to be done_, so we assume that and have no logic to destruct the
+ // promise here.
+ GPR_ASSERT(done_);
+ }
+
+ void RunScheduledWakeup() {
+ GPR_ASSERT(wakeup_scheduled_.exchange(false, std::memory_order_acq_rel));
+ Step();
+ WakeupComplete();
+ }
+
+ private:
+ using typename ActivityContexts<Contexts...>::ScopedContext;
+
+ void Cancel() final {
+ if (Activity::is_current()) {
+ mu()->AssertHeld();
+ SetActionDuringRun(ActionDuringRun::kCancel);
+ return;
+ }
+ bool was_done;
+ {
+ MutexLock lock(mu());
+ // Check if we were done, and flag done.
+ was_done = done_;
+ if (!done_) MarkDone();
+ }
+ // If we were not done, then call the on_done callback.
+ if (!was_done) {
+ on_done_(absl::CancelledError());
+ }
+ }
+
+ // Wakeup this activity. Arrange to poll the activity again at a convenient
+ // time: this could be inline if it's deemed safe, or it could be by passing
+ // the activity to an external threadpool to run. If the activity is already
+ // running on this thread, a note is taken of such and the activity is
+ // repolled if it doesn't complete.
+ void Wakeup() final {
+ // If there is an active activity, but hey it's us, flag that and we'll loop
+ // in RunLoop (that's calling from above here!).
+ if (Activity::is_current()) {
+ mu()->AssertHeld();
+ SetActionDuringRun(ActionDuringRun::kWakeup);
+ WakeupComplete();
+ return;
+ }
+ if (!wakeup_scheduled_.exchange(true, std::memory_order_acq_rel)) {
+ // Can't safely run, so ask to run later.
+ wakeup_scheduler_.ScheduleWakeup(this);
+ } else {
+ // Already a wakeup scheduled for later, drop ref.
+ WakeupComplete();
+ }
+ }
+
+ // Drop a wakeup
+ void Drop() final { this->WakeupComplete(); }
+
+ // Notification that we're no longer executing - it's ok to destruct the
+ // promise.
+ void MarkDone() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu()) {
+ GPR_ASSERT(!done_);
+ done_ = true;
+ Destruct(&promise_holder_.promise);
+ }
+
+ // In response to Wakeup, run the Promise state machine again until it
+ // settles. Then check for completion, and if we have completed, call on_done.
+ void Step() ABSL_LOCKS_EXCLUDED(mu()) {
+ // Poll the promise until things settle out under a lock.
+ mu()->Lock();
+ if (done_) {
+ // We might get some spurious wakeups after finishing.
+ mu()->Unlock();
+ return;
+ }
+ auto status = RunStep();
+ mu()->Unlock();
+ if (status.has_value()) {
+ on_done_(std::move(*status));
+ }
+ }
+
+ // The main body of a step: set the current activity, and any contexts, and
+ // then run the main polling loop. Contained in a function by itself in
+ // order to keep the scoping rules a little easier in Step().
+ absl::optional<ResultType> RunStep() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu()) {
+ ScopedActivity scoped_activity(this);
+ ScopedContext contexts(this);
+ return StepLoop();
+ }
+
+ // Similarly to RunStep, but additionally construct the promise from a
+ // promise factory before entering the main loop. Called once from the
+ // constructor.
+ absl::optional<ResultType> Start(Factory promise_factory)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu()) {
+ ScopedActivity scoped_activity(this);
+ ScopedContext contexts(this);
+ Construct(&promise_holder_.promise, promise_factory.Once());
+ return StepLoop();
+ }
+
+ // Until there are no wakeups from within and the promise is incomplete:
+ // poll the promise.
+ absl::optional<ResultType> StepLoop() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu()) {
+ GPR_ASSERT(is_current());
+ while (true) {
+ // Run the promise.
+ GPR_ASSERT(!done_);
+ auto r = promise_holder_.promise();
+ if (auto* status = absl::get_if<kPollReadyIdx>(&r)) {
+ // If complete, destroy the promise, flag done, and exit this loop.
+ MarkDone();
+ return IntoStatus(status);
+ }
+ // Continue looping til no wakeups occur.
+ switch (GotActionDuringRun()) {
+ case ActionDuringRun::kNone:
+ return {};
+ case ActionDuringRun::kWakeup:
+ break;
+ case ActionDuringRun::kCancel:
+ MarkDone();
+ return absl::CancelledError();
+ }
+ }
+ }
+
+ using Promise = typename Factory::Promise;
+ // Scheduler for wakeups
+ GPR_NO_UNIQUE_ADDRESS WakeupScheduler wakeup_scheduler_;
+ // Callback on completion of the promise.
+ GPR_NO_UNIQUE_ADDRESS OnDone on_done_;
+ // Has execution completed?
+ GPR_NO_UNIQUE_ADDRESS bool done_ ABSL_GUARDED_BY(mu()) = false;
+ // Is there a wakeup scheduled?
+ GPR_NO_UNIQUE_ADDRESS std::atomic<bool> wakeup_scheduled_{false};
+ // We wrap the promise in a union to allow control over the construction
+ // simultaneously with annotating mutex requirements and noting that the
+ // promise contained may not use any memory.
+ union PromiseHolder {
+ PromiseHolder() {}
+ ~PromiseHolder() {}
+ GPR_NO_UNIQUE_ADDRESS Promise promise;
+ };
+ GPR_NO_UNIQUE_ADDRESS PromiseHolder promise_holder_ ABSL_GUARDED_BY(mu());
+};
+
+} // namespace promise_detail
+
+// Given a functor that returns a promise (a promise factory), a callback for
+// completion, and a callback scheduler, construct an activity.
+template <typename Factory, typename WakeupScheduler, typename OnDone,
+ typename... Contexts>
+ActivityPtr MakeActivity(Factory promise_factory,
+ WakeupScheduler wakeup_scheduler, OnDone on_done,
+ Contexts&&... contexts) {
+ return ActivityPtr(
+ new promise_detail::PromiseActivity<Factory, WakeupScheduler, OnDone,
+ Contexts...>(
+ std::move(promise_factory), std::move(wakeup_scheduler),
+ std::move(on_done), std::forward<Contexts>(contexts)...));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_ACTIVITY_H
diff --git a/grpc/src/core/lib/promise/arena_promise.h b/grpc/src/core/lib/promise/arena_promise.h
new file mode 100644
index 00000000..14db9843
--- /dev/null
+++ b/grpc/src/core/lib/promise/arena_promise.h
@@ -0,0 +1,188 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_ARENA_PROMISE_H
+#define GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/promise/poll.h"
+#include "src/core/lib/resource_quota/arena.h"
+
+namespace grpc_core {
+
+namespace arena_promise_detail {
+
+// Type erased promise stored in the arena.
+template <typename T>
+class ImplInterface {
+ public:
+ // Poll the promise, once.
+ virtual Poll<T> PollOnce() = 0;
+ // Destroy the underlying callable object if there is one.
+ // Since we don't delete (the arena owns the memory) but we may need to call a
+ // destructor, we expose this for when the ArenaPromise object is destroyed.
+ virtual void Destroy() = 0;
+
+ protected:
+ ~ImplInterface() = default;
+};
+
+// Implementation of ImplInterface for an empty object.
+// Used when an empty ArenaPromise is created, or when the ArenaPromise is moved
+// from. Since in either case these objects should not be polled, we simply
+// crash if it is.
+template <typename T>
+class NullImpl final : public ImplInterface<T> {
+ public:
+ Poll<T> PollOnce() override {
+ abort();
+ GPR_UNREACHABLE_CODE(return Pending{});
+ }
+ void Destroy() override {}
+
+ static ImplInterface<T>* Get() {
+ static NullImpl<T> instance;
+ return &instance;
+ }
+
+ private:
+ ~NullImpl() = default;
+};
+
+// Implementation of ImplInterface for a callable object.
+template <typename T, typename Callable>
+class CallableImpl final : public ImplInterface<T> {
+ public:
+ explicit CallableImpl(Callable&& callable) : callable_(std::move(callable)) {}
+ // Forward polls to the callable object.
+ Poll<T> PollOnce() override { return poll_cast<T>(callable_()); }
+ // Destroy destructs the callable object.
+ void Destroy() override { this->~CallableImpl(); }
+
+ private:
+ // Should only be called by Destroy().
+ ~CallableImpl() = default;
+
+ Callable callable_;
+};
+
+// If a callable object is empty we can substitute any instance of that callable
+// for the one we call (for how could we tell the difference)?
+// Since this corresponds to a lambda with no fields, and we expect these to be
+// reasonably common, we can elide the arena allocation entirely and simply poll
+// a global shared instance.
+// (this comes up often when the promise only accesses context data from the
+// containing activity).
+template <typename T, typename Callable>
+class SharedImpl final : public ImplInterface<T>, private Callable {
+ public:
+ // Call the callable, or at least an exact duplicate of it - if you have no
+ // members, all your instances look the same.
+ Poll<T> PollOnce() override { return Callable::operator()(); }
+ // Nothing to destroy.
+ void Destroy() override {}
+ // Return a pointer to the shared instance - these are singletons, and are
+ // needed just to get the vtable in place.
+ static SharedImpl* Get(Callable&& callable) {
+ static_assert(sizeof(SharedImpl) == sizeof(void*),
+ "SharedImpl should be pointer sized");
+ static SharedImpl impl(std::forward<Callable>(callable));
+ return &impl;
+ }
+
+ private:
+ explicit SharedImpl(Callable&& callable)
+ : Callable(std::forward<Callable>(callable)) {}
+ ~SharedImpl() = default;
+};
+
+// Redirector type: given a callable type, expose a Make() function that creates
+// the appropriate underlying implementation.
+template <typename T, typename Callable, typename Ignored = void>
+struct ChooseImplForCallable;
+
+template <typename T, typename Callable>
+struct ChooseImplForCallable<
+ T, Callable, absl::enable_if_t<!std::is_empty<Callable>::value>> {
+ static ImplInterface<T>* Make(Callable&& callable) {
+ return GetContext<Arena>()->template New<CallableImpl<T, Callable>>(
+ std::forward<Callable>(callable));
+ }
+};
+
+template <typename T, typename Callable>
+struct ChooseImplForCallable<
+ T, Callable, absl::enable_if_t<std::is_empty<Callable>::value>> {
+ static ImplInterface<T>* Make(Callable&& callable) {
+ return SharedImpl<T, Callable>::Get(std::forward<Callable>(callable));
+ }
+};
+
+// Wrap ChooseImplForCallable with a friend approachable syntax.
+template <typename T, typename Callable>
+ImplInterface<T>* MakeImplForCallable(Callable&& callable) {
+ return ChooseImplForCallable<T, Callable>::Make(
+ std::forward<Callable>(callable));
+}
+
+} // namespace arena_promise_detail
+
+// A promise for which the state memory is allocated from an arena.
+template <typename T>
+class ArenaPromise {
+ public:
+ // Construct an empty, uncallable, invalid ArenaPromise.
+ ArenaPromise() = default;
+
+ // Construct an ArenaPromise that will call the given callable when polled.
+ template <typename Callable,
+ typename Ignored =
+ absl::enable_if_t<!std::is_same<Callable, ArenaPromise>::value>>
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ ArenaPromise(Callable&& callable)
+ : impl_(arena_promise_detail::MakeImplForCallable<T>(
+ std::forward<Callable>(callable))) {}
+
+ // ArenaPromise is not copyable.
+ ArenaPromise(const ArenaPromise&) = delete;
+ ArenaPromise& operator=(const ArenaPromise&) = delete;
+ // ArenaPromise is movable.
+ ArenaPromise(ArenaPromise&& other) noexcept : impl_(other.impl_) {
+ other.impl_ = arena_promise_detail::NullImpl<T>::Get();
+ }
+ ArenaPromise& operator=(ArenaPromise&& other) noexcept {
+ impl_->Destroy();
+ impl_ = other.impl_;
+ other.impl_ = arena_promise_detail::NullImpl<T>::Get();
+ return *this;
+ }
+
+ // Destruction => call Destroy on the underlying impl object.
+ ~ArenaPromise() { impl_->Destroy(); }
+
+ // Expose the promise interface: a call operator that returns Poll<T>.
+ Poll<T> operator()() { return impl_->PollOnce(); }
+
+ private:
+ // Underlying impl object.
+ arena_promise_detail::ImplInterface<T>* impl_ =
+ arena_promise_detail::NullImpl<T>::Get();
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H */
diff --git a/grpc/src/core/lib/promise/call_push_pull.h b/grpc/src/core/lib/promise/call_push_pull.h
new file mode 100644
index 00000000..a5649600
--- /dev/null
+++ b/grpc/src/core/lib/promise/call_push_pull.h
@@ -0,0 +1,144 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_CALL_PUSH_PULL_H
+#define GRPC_CORE_LIB_PROMISE_CALL_PUSH_PULL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <assert.h>
+
+#include "src/core/lib/gprpp/bitset.h"
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename FMain, typename FPush, typename FPull>
+class CallPushPull {
+ public:
+ CallPushPull(FMain f_main, FPush f_push, FPull f_pull)
+ : push_(std::move(f_push)), pull_(std::move(f_pull)) {
+ Construct(&main_, std::move(f_main));
+ }
+
+ CallPushPull(const CallPushPull&) = delete;
+ CallPushPull& operator=(const CallPushPull&) = delete;
+ CallPushPull(CallPushPull&& other) noexcept
+ : done_(other.done_),
+ push_(std::move(other.push_)),
+ pull_(std::move(other.pull_)) {
+ assert(!done_.is_set(kDoneMain));
+ Construct(&main_, std::move(other.main_));
+ }
+
+ CallPushPull& operator=(CallPushPull&& other) noexcept {
+ assert(!done_.is_set(kDoneMain));
+ done_ = other.done_;
+ assert(!done_.is_set(kDoneMain));
+ push_ = std::move(other.push_);
+ main_ = std::move(other.main_);
+ pull_ = std::move(other.pull_);
+ return *this;
+ }
+
+ ~CallPushPull() {
+ if (done_.is_set(kDoneMain)) {
+ Destruct(&result_);
+ } else {
+ Destruct(&main_);
+ }
+ }
+
+ using Result =
+ typename PollTraits<decltype(std::declval<PromiseLike<FMain>>()())>::Type;
+
+ Poll<Result> operator()() {
+ if (!done_.is_set(kDonePush)) {
+ auto p = push_();
+ if (auto* status = absl::get_if<kPollReadyIdx>(&p)) {
+ if (IsStatusOk(*status)) {
+ done_.set(kDonePush);
+ } else {
+ return Result(std::move(*status));
+ }
+ }
+ }
+ if (!done_.is_set(kDoneMain)) {
+ auto p = main_();
+ if (auto* status = absl::get_if<kPollReadyIdx>(&p)) {
+ if (IsStatusOk(*status)) {
+ done_.set(kDoneMain);
+ Destruct(&main_);
+ Construct(&result_, std::move(*status));
+ } else {
+ return std::move(*status);
+ }
+ }
+ }
+ if (!done_.is_set(kDonePull)) {
+ auto p = pull_();
+ if (auto* status = absl::get_if<kPollReadyIdx>(&p)) {
+ if (IsStatusOk(*status)) {
+ done_.set(kDonePull);
+ } else {
+ return Result(std::move(*status));
+ }
+ }
+ }
+ if (done_.all()) return std::move(result_);
+ return Pending{};
+ }
+
+ private:
+ enum { kDonePull = 0, kDoneMain = 1, kDonePush = 2 };
+ BitSet<3> done_;
+ GPR_NO_UNIQUE_ADDRESS PromiseLike<FPush> push_;
+ union {
+ PromiseLike<FMain> main_;
+ Result result_;
+ };
+ GPR_NO_UNIQUE_ADDRESS PromiseLike<FPull> pull_;
+};
+
+} // namespace promise_detail
+
+// For promises representing calls a common pattern emerges:
+// There's a process pushing data down the stack, a process handling the main
+// call part, and a process pulling data back up the stack.
+//
+// This can reasonably be represented by the right combinations of TryJoins and
+// Maps, but since the structure is fundamental to the domain we introduce
+// this simple helper to make it easier to write the common case.
+//
+// It takes three promises: the main call, the push and the pull.
+// When polling, the push is polled first, then the main call (descending the
+// stack), then the pull (as we ascend once more).
+//
+// This strategy minimizes repolls.
+template <typename FMain, typename FPush, typename FPull>
+promise_detail::CallPushPull<FMain, FPush, FPull> CallPushPull(FMain f_main,
+ FPush f_push,
+ FPull f_pull) {
+ return promise_detail::CallPushPull<FMain, FPush, FPull>(
+ std::move(f_main), std::move(f_push), std::move(f_pull));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_CALL_PUSH_PULL_H
diff --git a/grpc/src/core/lib/promise/context.h b/grpc/src/core/lib/promise/context.h
new file mode 100644
index 00000000..dfee3d28
--- /dev/null
+++ b/grpc/src/core/lib/promise/context.h
@@ -0,0 +1,86 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_CONTEXT_H
+#define GRPC_CORE_LIB_PROMISE_CONTEXT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "src/core/lib/gpr/tls.h"
+
+namespace grpc_core {
+
+// To avoid accidentally creating context types, we require an explicit
+// specialization of this template per context type. The specialization need
+// not contain any members, only exist.
+// The reason for avoiding this is that context types each use a thread local.
+template <typename T>
+struct ContextType;
+
+namespace promise_detail {
+
+template <typename T>
+class Context : public ContextType<T> {
+ public:
+ explicit Context(T* p) : old_(current_) { current_ = p; }
+ ~Context() { current_ = old_; }
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
+
+ static T* get() { return current_; }
+
+ private:
+ T* const old_;
+ static GPR_THREAD_LOCAL(T*) current_;
+};
+
+template <typename T>
+GPR_THREAD_LOCAL(T*)
+Context<T>::current_;
+
+template <typename T, typename F>
+class WithContext {
+ public:
+ WithContext(F f, T* context) : context_(context), f_(std::move(f)) {}
+
+ decltype(std::declval<F>()()) operator()() {
+ Context<T> ctx(context_);
+ return f_();
+ }
+
+ private:
+ T* context_;
+ F f_;
+};
+
+} // namespace promise_detail
+
+// Retrieve the current value of a context.
+template <typename T>
+T* GetContext() {
+ return promise_detail::Context<T>::get();
+}
+
+// Given a promise and a context, return a promise that has that context set.
+template <typename T, typename F>
+promise_detail::WithContext<T, F> WithContext(F f, T* context) {
+ return promise_detail::WithContext<T, F>(f, context);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_CONTEXT_H
diff --git a/grpc/src/core/lib/promise/detail/basic_join.h b/grpc/src/core/lib/promise/detail/basic_join.h
new file mode 100644
index 00000000..17c5e42b
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/basic_join.h
@@ -0,0 +1,199 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_DETAIL_BASIC_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include <assert.h>
+#include <stddef.h>
+
+#include <array>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include "absl/types/variant.h"
+#include "absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/bitset.h"
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+namespace promise_detail {
+
+// This union can either be a functor, or the result of the functor (after
+// mapping via a trait). Allows us to remember the result of one joined functor
+// until the rest are ready.
+template <typename Traits, typename F>
+union Fused {
+ explicit Fused(F&& f) : f(std::forward<F>(f)) {}
+ explicit Fused(PromiseLike<F>&& f) : f(std::forward<PromiseLike<F>>(f)) {}
+ ~Fused() {}
+ // Wrap the functor in a PromiseLike to handle immediately returning functors
+ // and the like.
+ using Promise = PromiseLike<F>;
+ GPR_NO_UNIQUE_ADDRESS Promise f;
+ // Compute the result type: We take the result of the promise, and pass it via
+ // our traits, so that, for example, TryJoin and take a StatusOr<T> and just
+ // store a T.
+ using Result = typename Traits::template ResultType<typename Promise::Result>;
+ GPR_NO_UNIQUE_ADDRESS Result result;
+};
+
+// A join gets composed of joints... these are just wrappers around a Fused for
+// their data, with some machinery as methods to get the system working.
+template <typename Traits, size_t kRemaining, typename... Fs>
+struct Joint : public Joint<Traits, kRemaining - 1, Fs...> {
+ // The index into Fs for this Joint
+ static constexpr size_t kIdx = sizeof...(Fs) - kRemaining;
+ // The next join (the one we derive from)
+ using NextJoint = Joint<Traits, kRemaining - 1, Fs...>;
+ // From Fs, extract the functor for this joint.
+ using F = typename std::tuple_element<kIdx, std::tuple<Fs...>>::type;
+ // Generate the Fused type for this functor.
+ using Fsd = Fused<Traits, F>;
+ GPR_NO_UNIQUE_ADDRESS Fsd fused;
+ // Figure out what kind of bitmask will be used by the outer join.
+ using Bits = BitSet<sizeof...(Fs)>;
+ // Initialize from a tuple of pointers to Fs
+ explicit Joint(std::tuple<Fs*...> fs)
+ : NextJoint(fs), fused(std::move(*std::get<kIdx>(fs))) {}
+ // Copy: assume that the Fuse is still in the promise state (since it's not
+ // legal to copy after the first poll!)
+ Joint(const Joint& j) : NextJoint(j), fused(j.fused.f) {}
+ // Move: assume that the Fuse is still in the promise state (since it's not
+ // legal to move after the first poll!)
+ Joint(Joint&& j) noexcept
+ : NextJoint(std::forward<NextJoint>(j)), fused(std::move(j.fused.f)) {}
+ // Destruct: check bits to see if we're in promise or result state, and call
+ // the appropriate destructor. Recursively, call up through the join.
+ void DestructAll(const Bits& bits) {
+ if (!bits.is_set(kIdx)) {
+ Destruct(&fused.f);
+ } else {
+ Destruct(&fused.result);
+ }
+ NextJoint::DestructAll(bits);
+ }
+ // Poll all joints up, and then call finally.
+ template <typename F>
+ auto Run(Bits* bits, F finally) -> decltype(finally()) {
+ // If we're still in the promise state...
+ if (!bits->is_set(kIdx)) {
+ // Poll the promise
+ auto r = fused.f();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ // If it's done, then ask the trait to unwrap it and store that result
+ // in the Fused, and continue the iteration. Note that OnResult could
+ // instead choose to return a value instead of recursing through the
+ // iteration, in that case we continue returning the same result up.
+ // Here is where TryJoin can escape out.
+ return Traits::OnResult(
+ std::move(*p), [this, bits, &finally](typename Fsd::Result result) {
+ bits->set(kIdx);
+ Destruct(&fused.f);
+ Construct(&fused.result, std::move(result));
+ return NextJoint::Run(bits, std::move(finally));
+ });
+ }
+ }
+ // That joint is still pending... we'll still poll the result of the joints.
+ return NextJoint::Run(bits, std::move(finally));
+ }
+};
+
+// Terminating joint... for each of the recursions, do the thing we're supposed
+// to do at the end.
+template <typename Traits, typename... Fs>
+struct Joint<Traits, 0, Fs...> {
+ explicit Joint(std::tuple<Fs*...>) {}
+ Joint(const Joint&) {}
+ Joint(Joint&&) noexcept {}
+ template <typename T>
+ void DestructAll(const T&) {}
+ template <typename F>
+ auto Run(BitSet<sizeof...(Fs)>*, F finally) -> decltype(finally()) {
+ return finally();
+ }
+};
+
+template <typename Traits, typename... Fs>
+class BasicJoin {
+ private:
+ // How many things are we joining?
+ static constexpr size_t N = sizeof...(Fs);
+ // Bitset: if a bit is 0, that joint is still in promise state. If it's 1,
+ // then the joint has a result.
+ GPR_NO_UNIQUE_ADDRESS BitSet<N> state_;
+ // The actual joints, wrapped in an anonymous union to give us control of
+ // construction/destruction.
+ union {
+ GPR_NO_UNIQUE_ADDRESS Joint<Traits, sizeof...(Fs), Fs...> joints_;
+ };
+
+ // Access joint index I
+ template <size_t I>
+ Joint<Traits, sizeof...(Fs) - I, Fs...>* GetJoint() {
+ return static_cast<Joint<Traits, sizeof...(Fs) - I, Fs...>*>(&joints_);
+ }
+
+ // The tuple of results of all our promises
+ using Tuple = std::tuple<typename Fused<Traits, Fs>::Result...>;
+
+ // Collect up all the results and construct a tuple.
+ template <size_t... I>
+ Tuple Finish(absl::index_sequence<I...>) {
+ return Tuple(std::move(GetJoint<I>()->fused.result)...);
+ }
+
+ public:
+ explicit BasicJoin(Fs&&... fs) : joints_(std::tuple<Fs*...>(&fs...)) {}
+ BasicJoin& operator=(const BasicJoin&) = delete;
+ // Copy a join - only available before polling.
+ BasicJoin(const BasicJoin& other) {
+ assert(other.state_.none());
+ Construct(&joints_, other.joints_);
+ }
+ // Move a join - only available before polling.
+ BasicJoin(BasicJoin&& other) noexcept {
+ assert(other.state_.none());
+ Construct(&joints_, std::move(other.joints_));
+ }
+ ~BasicJoin() { joints_.DestructAll(state_); }
+ using Result = decltype(Traits::Wrap(std::declval<Tuple>()));
+ // Poll the join
+ Poll<Result> operator()() {
+ // Poll the joints...
+ return joints_.Run(&state_, [this]() -> Poll<Result> {
+ // If all of them are completed, collect the results, and then ask our
+ // traits to wrap them - allowing for example TryJoin to turn tuple<A,B,C>
+ // into StatusOr<tuple<A,B,C>>.
+ if (state_.all()) {
+ return Traits::Wrap(Finish(absl::make_index_sequence<N>()));
+ } else {
+ return Pending();
+ }
+ });
+ }
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H
diff --git a/grpc/src/core/lib/promise/detail/basic_seq.h b/grpc/src/core/lib/promise/detail/basic_seq.h
new file mode 100644
index 00000000..d3029f10
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/basic_seq.h
@@ -0,0 +1,496 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_DETAIL_BASIC_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <array>
+#include <cassert>
+#include <new>
+#include <tuple>
+#include <utility>
+
+#include "absl/meta/type_traits.h"
+#include "absl/types/variant.h"
+#include "absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/switch.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+namespace promise_detail {
+template <typename F>
+class PromiseLike;
+
+// Helper for SeqState to evaluate some common types to all partial
+// specializations.
+template <template <typename> class Traits, typename FPromise, typename FNext>
+struct SeqStateTypes {
+ // Our current promise.
+ using Promise = FPromise;
+ // The result of our current promise.
+ using PromiseResult = typename Promise::Result;
+ // Traits around the result of our promise.
+ using PromiseResultTraits = Traits<PromiseResult>;
+ // Wrap the factory callable in our factory wrapper to deal with common edge
+ // cases. We use the 'unwrapped type' from the traits, so for instance, TrySeq
+ // can pass back a T from a StatusOr<T>.
+ using Next = promise_detail::PromiseFactory<
+ typename PromiseResultTraits::UnwrappedType, FNext>;
+};
+
+// One state in a sequence.
+// A state contains the current promise, and the promise factory to turn the
+// result of the current promise into the next state's promise. We play a shell
+// game such that the prior state and our current promise are kept in a union,
+// and the next promise factory is kept alongside in the state struct.
+// Recursively this guarantees that the next functions get initialized once, and
+// destroyed once, and don't need to be moved around in between, which avoids a
+// potential O(n**2) loop of next factory moves had we used a variant of states
+// here. The very first state does not have a prior state, and so that state has
+// a partial specialization below. The final state does not have a next state;
+// that state is inlined in BasicSeq since that was simpler to type.
+template <template <typename> class Traits, char I, typename... Fs>
+struct SeqState {
+ // The state evaluated before this state.
+ using PriorState = SeqState<Traits, I - 1, Fs...>;
+ // Initialization from callables.
+ explicit SeqState(std::tuple<Fs*...> fs)
+ : next_factory(std::move(*std::get<I + 1>(fs))) {
+ new (&prior) PriorState(fs);
+ }
+ // Move constructor - assumes we're in the initial state (move prior) as it's
+ // illegal to move a promise after polling it.
+ SeqState(SeqState&& other) noexcept
+ : next_factory(std::move(other.next_factory)) {
+ new (&prior) PriorState(std::move(other.prior));
+ }
+ // Copy constructor - assumes we're in the initial state (move prior) as it's
+ // illegal to move a promise after polling it.
+ SeqState(const SeqState& other) : next_factory(other.next_factory) {
+ new (&prior) PriorState(std::move(other.prior));
+ }
+ // Empty destructor - we instead destruct the innards in BasicSeq manually
+ // depending on state.
+ ~SeqState() {}
+ // Evaluate the current promise, next promise factory types for this state.
+ // The current promise is the next promise from the prior state.
+ // The next factory callable is from the callables passed in:
+ // Fs[0] is the initial promise, Fs[1] is the state 0 next factory, Fs[2] is
+ // the state 1 next factory, etc...
+ using Types = SeqStateTypes<
+ Traits, typename PriorState::Types::Next::Promise,
+ typename std::tuple_element<I + 1, std::tuple<Fs...>>::type>;
+ // Storage for either the current promise or the prior state.
+ union {
+ // If we're in the prior state.
+ GPR_NO_UNIQUE_ADDRESS PriorState prior;
+ // The callables representing our promise.
+ GPR_NO_UNIQUE_ADDRESS typename Types::Promise current_promise;
+ };
+ // Storage for the next promise factory.
+ GPR_NO_UNIQUE_ADDRESS typename Types::Next next_factory;
+};
+
+// Partial specialization of SeqState above for the first state - it has no
+// prior state, so we take the first callable from the template arg list and use
+// it as a promise.
+template <template <typename> class Traits, typename... Fs>
+struct SeqState<Traits, 0, Fs...> {
+ // Initialization from callables.
+ explicit SeqState(std::tuple<Fs*...> args)
+ : current_promise(std::move(*std::get<0>(args))),
+ next_factory(std::move(*std::get<1>(args))) {}
+ // Move constructor - it's assumed we're in this state (see above).
+ SeqState(SeqState&& other) noexcept
+ : current_promise(std::move(other.current_promise)),
+ next_factory(std::move(other.next_factory)) {}
+ // Copy constructor - it's assumed we're in this state (see above).
+ SeqState(const SeqState& other)
+ : current_promise(other.current_promise),
+ next_factory(other.next_factory) {}
+ // Empty destructor - we instead destruct the innards in BasicSeq manually
+ // depending on state.
+ ~SeqState() {}
+ // Evaluate the current promise, next promise factory types for this state.
+ // Our callable is the first element of Fs, wrapped in PromiseLike to handle
+ // some common edge cases. The next factory is the second element.
+ using Types = SeqStateTypes<
+ Traits,
+ PromiseLike<typename std::tuple_element<0, std::tuple<Fs...>>::type>,
+ typename std::tuple_element<1, std::tuple<Fs...>>::type>;
+ GPR_NO_UNIQUE_ADDRESS typename Types::Promise current_promise;
+ GPR_NO_UNIQUE_ADDRESS typename Types::Next next_factory;
+};
+
+// Helper to get a specific state index.
+// Calls the prior state, unless it's this state, in which case it returns
+// that.
+template <char I, template <typename> class Traits, char J, typename... Fs>
+struct GetSeqStateInner {
+ static SeqState<Traits, I, Fs...>* f(SeqState<Traits, J, Fs...>* p) {
+ return GetSeqStateInner<I, Traits, J - 1, Fs...>::f(&p->prior);
+ }
+};
+
+template <char I, template <typename> class Traits, typename... Fs>
+struct GetSeqStateInner<I, Traits, I, Fs...> {
+ static SeqState<Traits, I, Fs...>* f(SeqState<Traits, I, Fs...>* p) {
+ return p;
+ }
+};
+
+template <char I, template <typename> class Traits, char J, typename... Fs>
+absl::enable_if_t<I <= J, SeqState<Traits, I, Fs...>*> GetSeqState(
+ SeqState<Traits, J, Fs...>* p) {
+ return GetSeqStateInner<I, Traits, J, Fs...>::f(p);
+}
+
+template <template <typename> class Traits, char I, typename... Fs, typename T>
+auto CallNext(SeqState<Traits, I, Fs...>* state, T&& arg)
+ -> decltype(SeqState<Traits, I, Fs...>::Types::PromiseResultTraits::
+ CallFactory(&state->next_factory, std::forward<T>(arg))) {
+ return SeqState<Traits, I, Fs...>::Types::PromiseResultTraits::CallFactory(
+ &state->next_factory, std::forward<T>(arg));
+}
+
+// A sequence under stome traits for some set of callables Fs.
+// Fs[0] should be a promise-like object that yields a value.
+// Fs[1..] should be promise-factory-like objects that take the value from the
+// previous step and yield a promise. Note that most of the machinery in
+// PromiseFactory exists to make it possible for those promise-factory-like
+// objects to be anything that's convenient. Traits defines how we move from one
+// step to the next. Traits sets up the wrapping and escape handling for the
+// sequence. Promises return wrapped values that the trait can inspect and
+// unwrap before passing them to the next element of the sequence. The trait can
+// also interpret a wrapped value as an escape value, which terminates
+// evaluation of the sequence immediately yielding a result. Traits for type T
+// have the members:
+// * type UnwrappedType - the type after removing wrapping from T (i.e. for
+// TrySeq, T=StatusOr<U> yields UnwrappedType=U).
+// * type WrappedType - the type after adding wrapping if it doesn't already
+// exist (i.e. for TrySeq if T is not Status/StatusOr/void, then
+// WrappedType=StatusOr<T>; if T is Status then WrappedType=Status (it's
+// already wrapped!))
+// * template <typename Next> void CallFactory(Next* next_factory, T&& value) -
+// call promise factory next_factory with the result of unwrapping value, and
+// return the resulting promise.
+// * template <typename Result, typename RunNext> Poll<Result>
+// CheckResultAndRunNext(T prior, RunNext run_next) - examine the value of
+// prior, and decide to escape or continue. If escaping, return the final
+// sequence value of type Poll<Result>. If continuing, return the value of
+// run_next(std::move(prior)).
+template <template <typename> class Traits, typename... Fs>
+class BasicSeq {
+ private:
+ // Number of states in the sequence - we'll refer to this some!
+ static constexpr char N = sizeof...(Fs);
+
+ // Current state.
+ static_assert(N < 128, "Long sequence... please revisit BasicSeq");
+ char state_ = 0;
+ // The penultimate state contains all the preceding states too.
+ using PenultimateState = SeqState<Traits, N - 2, Fs...>;
+ // The final state is simply the final promise, which is the next promise from
+ // the penultimate state.
+ using FinalPromise = typename PenultimateState::Types::Next::Promise;
+ union {
+ GPR_NO_UNIQUE_ADDRESS PenultimateState penultimate_state_;
+ GPR_NO_UNIQUE_ADDRESS FinalPromise final_promise_;
+ };
+ using FinalPromiseResult = typename FinalPromise::Result;
+ using Result = typename Traits<FinalPromiseResult>::WrappedType;
+
+ // Get a state by index.
+ template <char I>
+ absl::enable_if_t < I<N - 2, SeqState<Traits, I, Fs...>*> state() {
+ return GetSeqState<I>(&penultimate_state_);
+ }
+
+ template <char I>
+ absl::enable_if_t<I == N - 2, PenultimateState*> state() {
+ return &penultimate_state_;
+ }
+
+ // Get the next state's promise.
+ template <char I>
+ auto next_promise() -> absl::enable_if_t<
+ I != N - 2,
+ decltype(&GetSeqState<I + 1>(static_cast<PenultimateState*>(nullptr))
+ ->current_promise)> {
+ return &GetSeqState<I + 1>(&penultimate_state_)->current_promise;
+ }
+
+ template <char I>
+ absl::enable_if_t<I == N - 2, FinalPromise*> next_promise() {
+ return &final_promise_;
+ }
+
+ // Callable to advance the state to the next one after I given the result from
+ // state I.
+ template <char I>
+ struct RunNext {
+ BasicSeq* s;
+ template <typename T>
+ Poll<Result> operator()(T&& value) {
+ auto* prior = s->state<I>();
+ using StateType = absl::remove_reference_t<decltype(*prior)>;
+ // Destroy the promise that just completed.
+ Destruct(&prior->current_promise);
+ // Construct the next promise by calling the next promise factory.
+ // We need to ask the traits to do this to deal with value
+ // wrapping/unwrapping.
+ auto n = StateType::Types::PromiseResultTraits::CallFactory(
+ &prior->next_factory, std::forward<T>(value));
+ // Now we also no longer need the factory, so we can destroy that.
+ Destruct(&prior->next_factory);
+ // Constructing the promise for the new state will use the memory
+ // previously occupied by the promise & next factory of the old state.
+ Construct(s->next_promise<I>(), std::move(n));
+ // Store the state counter.
+ s->state_ = I + 1;
+ // Recursively poll the new current state.
+ return s->RunState<I + 1>();
+ }
+ };
+
+ // Poll the current state, advance it if necessary.
+ template <char I>
+ absl::enable_if_t<I != N - 1, Poll<Result>> RunState() {
+ // Get a pointer to the state object.
+ auto* s = state<I>();
+ // Poll the current promise in this state.
+ auto r = s->current_promise();
+ // If we are still pending, say so by returning.
+ if (absl::holds_alternative<Pending>(r)) {
+ return Pending();
+ }
+ // Current promise is ready, as the traits to do the next thing.
+ // That may be returning - eg if TrySeq sees an error.
+ // Or it may be by calling the callable we hand down - RunNext - which
+ // will advance the state and call the next promise.
+ return Traits<
+ typename absl::remove_reference_t<decltype(*s)>::Types::PromiseResult>::
+ template CheckResultAndRunNext<Result>(
+ std::move(absl::get<kPollReadyIdx>(std::move(r))),
+ RunNext<I>{this});
+ }
+
+ // Specialization of RunState to run the final state.
+ template <char I>
+ absl::enable_if_t<I == N - 1, Poll<Result>> RunState() {
+ // Poll the final promise.
+ auto r = final_promise_();
+ // If we are still pending, say so by returning.
+ if (absl::holds_alternative<Pending>(r)) {
+ return Pending();
+ }
+ // We are complete, return the (wrapped) result.
+ return Result(std::move(absl::get<kPollReadyIdx>(std::move(r))));
+ }
+
+ // For state numbered I, destruct the current promise and the next promise
+ // factory, and recursively destruct the next promise factories for future
+ // states (since they also still exist).
+ template <char I>
+ absl::enable_if_t<I != N - 1, void>
+ DestructCurrentPromiseAndSubsequentFactories() {
+ Destruct(&GetSeqState<I>(&penultimate_state_)->current_promise);
+ DestructSubsequentFactories<I>();
+ }
+
+ template <char I>
+ absl::enable_if_t<I == N - 1, void>
+ DestructCurrentPromiseAndSubsequentFactories() {
+ Destruct(&final_promise_);
+ }
+
+ // For state I, destruct the next promise factory, and recursively the next
+ // promise factories after.
+ template <char I>
+ absl::enable_if_t<I != N - 1, void> DestructSubsequentFactories() {
+ Destruct(&GetSeqState<I>(&penultimate_state_)->next_factory);
+ DestructSubsequentFactories<I + 1>();
+ }
+
+ template <char I>
+ absl::enable_if_t<I == N - 1, void> DestructSubsequentFactories() {}
+
+ // Placate older compilers by wrapping RunState in a struct so that their
+ // parameter unpacking can work.
+ template <char I>
+ struct RunStateStruct {
+ BasicSeq* s;
+ Poll<Result> operator()() { return s->RunState<I>(); }
+ };
+
+ // Similarly placate those compilers for
+ // DestructCurrentPromiseAndSubsequentFactories
+ template <char I>
+ struct DestructCurrentPromiseAndSubsequentFactoriesStruct {
+ BasicSeq* s;
+ void operator()() {
+ return s->DestructCurrentPromiseAndSubsequentFactories<I>();
+ }
+ };
+
+ // Run the current state (and possibly later states if that one finishes).
+ // Single argument is a type that encodes the integer sequence 0, 1, 2, ...,
+ // N-1 as a type, but which uses no memory. This is used to expand out
+ // RunState instances using a template unpack to pass to Switch, which encodes
+ // a switch statement over the various cases. This ultimately gives us a
+ // Duff's device like mechanic for evaluating sequences.
+ template <char... I>
+ Poll<Result> Run(absl::integer_sequence<char, I...>) {
+ return Switch<Poll<Result>>(state_, RunStateStruct<I>{this}...);
+ }
+
+ // Run the appropriate destructors for a given state.
+ // Single argument is a type that encodes the integer sequence 0, 1, 2, ...,
+ // N-1 as a type, but which uses no memory. This is used to expand out
+ // DestructCurrentPromiseAndSubsequentFactories instances to pass to Switch,
+ // which can choose the correct instance at runtime to destroy everything.
+ template <char... I>
+ void RunDestruct(absl::integer_sequence<char, I...>) {
+ Switch<void>(
+ state_, DestructCurrentPromiseAndSubsequentFactoriesStruct<I>{this}...);
+ }
+
+ public:
+ // Construct a sequence given the callables that will control it.
+ explicit BasicSeq(Fs... fs) : penultimate_state_(std::make_tuple(&fs...)) {}
+ // No assignment... we don't need it (but if we ever find a good case, then
+ // it's ok to implement).
+ BasicSeq& operator=(const BasicSeq&) = delete;
+ // Copy construction - only for state 0.
+ // It's illegal to copy a Promise after polling it - if we are in state>0 we
+ // *must* have been polled.
+ BasicSeq(const BasicSeq& other) {
+ assert(other.state_ == 0);
+ new (&penultimate_state_) PenultimateState(other.penultimate_state_);
+ }
+ // Move construction - only for state 0.
+ // It's illegal to copy a Promise after polling it - if we are in state>0 we
+ // *must* have been polled.
+ BasicSeq(BasicSeq&& other) noexcept {
+ assert(other.state_ == 0);
+ new (&penultimate_state_)
+ PenultimateState(std::move(other.penultimate_state_));
+ }
+ // Destruct based on current state.
+ ~BasicSeq() { RunDestruct(absl::make_integer_sequence<char, N>()); }
+
+ // Poll the sequence once.
+ Poll<Result> operator()() {
+ return Run(absl::make_integer_sequence<char, N>());
+ }
+};
+
+// As above, but models a sequence of unknown size
+// At each element, the accumulator A and the current value V is passed to some
+// function of type F as f(V, A); f is expected to return a promise that
+// resolves to Traits::WrappedType.
+template <template <typename Wrapped> class Traits, typename F, typename Arg,
+ typename Iter>
+class BasicSeqIter {
+ private:
+ using IterValue = decltype(*std::declval<Iter>());
+ using StateCreated = decltype(std::declval<F>()(std::declval<IterValue>(),
+ std::declval<Arg>()));
+ using State = PromiseLike<StateCreated>;
+ using Wrapped = typename State::Result;
+
+ public:
+ BasicSeqIter(Iter begin, Iter end, F f, Arg arg)
+ : cur_(begin), end_(end), f_(std::move(f)) {
+ if (cur_ == end_) {
+ Construct(&result_, std::move(arg));
+ } else {
+ Construct(&state_, f_(*cur_, std::move(arg)));
+ }
+ }
+
+ ~BasicSeqIter() {
+ if (cur_ == end_) {
+ Destruct(&result_);
+ } else {
+ Destruct(&state_);
+ }
+ }
+
+ BasicSeqIter(const BasicSeqIter& other) = delete;
+ BasicSeqIter& operator=(const BasicSeqIter&) = delete;
+
+ BasicSeqIter(BasicSeqIter&& other) noexcept
+ : cur_(other.cur_), end_(other.end_), f_(std::move(other.f_)) {
+ if (cur_ == end_) {
+ Construct(&result_, std::move(other.result_));
+ } else {
+ Construct(&state_, std::move(other.state_));
+ }
+ }
+ BasicSeqIter& operator=(BasicSeqIter&& other) noexcept {
+ cur_ = other.cur_;
+ end_ = other.end_;
+ if (cur_ == end_) {
+ Construct(&result_, std::move(other.result_));
+ } else {
+ Construct(&state_, std::move(other.state_));
+ }
+ return *this;
+ }
+
+ Poll<Wrapped> operator()() {
+ if (cur_ == end_) {
+ return std::move(result_);
+ }
+ return PollNonEmpty();
+ }
+
+ private:
+ Poll<Wrapped> PollNonEmpty() {
+ Poll<Wrapped> r = state_();
+ if (absl::holds_alternative<Pending>(r)) return r;
+ return Traits<Wrapped>::template CheckResultAndRunNext<Wrapped>(
+ std::move(absl::get<Wrapped>(r)), [this](Wrapped arg) -> Poll<Wrapped> {
+ auto next = cur_;
+ ++next;
+ if (next == end_) {
+ return std::move(arg);
+ }
+ cur_ = next;
+ state_.~State();
+ Construct(&state_,
+ Traits<Wrapped>::CallSeqFactory(f_, *cur_, std::move(arg)));
+ return PollNonEmpty();
+ });
+ }
+
+ Iter cur_;
+ const Iter end_;
+ GPR_NO_UNIQUE_ADDRESS F f_;
+ union {
+ GPR_NO_UNIQUE_ADDRESS State state_;
+ GPR_NO_UNIQUE_ADDRESS Arg result_;
+ };
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_SEQ_H
diff --git a/grpc/src/core/lib/promise/detail/promise_factory.h b/grpc/src/core/lib/promise/detail/promise_factory.h
new file mode 100644
index 00000000..e37e2e69
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/promise_factory.h
@@ -0,0 +1,189 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_DETAIL_PROMISE_FACTORY_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+// PromiseFactory is an adaptor class.
+//
+// Where a Promise is a thing that's polled periodically, a PromiseFactory
+// creates a Promise. Within this Promise/Activity framework, PromiseFactory's
+// then provide the edges for computation -- invoked at state transition
+// boundaries to provide the new steady state.
+//
+// A PromiseFactory formally is f(A) -> Promise<T> for some types A & T.
+// This get a bit awkward and inapproprate to write however, and so the type
+// contained herein can adapt various kinds of callable into the correct form.
+// Of course a callable of a single argument returning a Promise will see an
+// identity translation. One taking no arguments and returning a Promise
+// similarly.
+//
+// A Promise passed to a PromiseFactory will yield a PromiseFactory that
+// returns just that Promise.
+//
+// Generalizing slightly, a callable taking a single argument A and returning a
+// Poll<T> will yield a PromiseFactory that captures it's argument A and
+// returns a Poll<T>.
+//
+// Since various consumers of PromiseFactory run either repeatedly through an
+// overarching Promises lifetime, or just once, and we can optimize just once
+// by moving the contents of the PromiseFactory, two factory methods are
+// provided: Once, that can be called just once, and Repeated, that can (wait
+// for it) be called Repeatedly.
+
+namespace grpc_core {
+namespace promise_detail {
+
+// Helper trait: given a T, and T x, is calling x() legal?
+template <typename T, typename Ignored = void>
+struct IsVoidCallable {
+ static constexpr bool value = false;
+};
+template <typename F>
+struct IsVoidCallable<F, absl::void_t<decltype(std::declval<F>()())>> {
+ static constexpr bool value = true;
+};
+
+// Given F(A,B,C,...), what's the return type?
+template <typename T, typename Ignored = void>
+struct ResultOfT;
+
+template <typename F, typename... Args>
+struct ResultOfT<F(Args...),
+ absl::void_t<decltype(std::declval<RemoveCVRef<F>>()(
+ std::declval<Args>()...))>> {
+ using T = decltype(std::declval<RemoveCVRef<F>>()(std::declval<Args>()...));
+};
+
+template <typename T>
+using ResultOf = typename ResultOfT<T>::T;
+
+// Captures the promise functor and the argument passed.
+// Provides the interface of a promise.
+template <typename F, typename Arg>
+class Curried {
+ public:
+ Curried(F&& f, Arg&& arg)
+ : f_(std::forward<F>(f)), arg_(std::forward<Arg>(arg)) {}
+ Curried(const F& f, Arg&& arg) : f_(f), arg_(std::forward<Arg>(arg)) {}
+ using Result = decltype(std::declval<F>()(std::declval<Arg>()));
+ Result operator()() { return f_(std::move(arg_)); }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+ GPR_NO_UNIQUE_ADDRESS Arg arg_;
+};
+
+// Promote a callable(A) -> T | Poll<T> to a PromiseFactory(A) -> Promise<T> by
+// capturing A.
+template <typename A, typename F>
+absl::enable_if_t<!IsVoidCallable<ResultOf<F(A)>>::value,
+ PromiseLike<Curried<RemoveCVRef<F>, A>>>
+PromiseFactoryImpl(F&& f, A&& arg) {
+ return Curried<RemoveCVRef<F>, A>(std::forward<F>(f), std::forward<A>(arg));
+}
+
+// Promote a callable() -> T|Poll<T> to a PromiseFactory(A) -> Promise<T>
+// by dropping the argument passed to the factory.
+template <typename A, typename F>
+absl::enable_if_t<!IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<RemoveCVRef<F>>>
+PromiseFactoryImpl(F f, A&&) {
+ return PromiseLike<F>(std::move(f));
+}
+
+// Promote a callable() -> T|Poll<T> to a PromiseFactory() -> Promise<T>
+template <typename F>
+absl::enable_if_t<!IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<RemoveCVRef<F>>>
+PromiseFactoryImpl(F f) {
+ return PromiseLike<F>(std::move(f));
+}
+
+// Given a callable(A) -> Promise<T>, name it a PromiseFactory and use it.
+template <typename A, typename F>
+absl::enable_if_t<IsVoidCallable<ResultOf<F(A)>>::value,
+ PromiseLike<decltype(std::declval<F>()(std::declval<A>()))>>
+PromiseFactoryImpl(F&& f, A&& arg) {
+ return f(std::forward<A>(arg));
+}
+
+// Given a callable() -> Promise<T>, promote it to a
+// PromiseFactory(A) -> Promise<T> by dropping the first argument.
+template <typename A, typename F>
+absl::enable_if_t<IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<decltype(std::declval<F>()())>>
+PromiseFactoryImpl(F&& f, A&&) {
+ return f();
+}
+
+// Given a callable() -> Promise<T>, name it a PromiseFactory and use it.
+template <typename F>
+absl::enable_if_t<IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<decltype(std::declval<F>()())>>
+PromiseFactoryImpl(F&& f) {
+ return f();
+};
+
+template <typename A, typename F>
+class PromiseFactory {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ using Arg = A;
+ using Promise =
+ decltype(PromiseFactoryImpl(std::move(f_), std::declval<A>()));
+
+ explicit PromiseFactory(F f) : f_(std::move(f)) {}
+
+ Promise Once(Arg&& a) {
+ return PromiseFactoryImpl(std::move(f_), std::forward<Arg>(a));
+ }
+
+ Promise Repeated(Arg&& a) const {
+ return PromiseFactoryImpl(f_, std::forward<Arg>(a));
+ }
+};
+
+template <typename F>
+class PromiseFactory<void, F> {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ using Arg = void;
+ using Promise = decltype(PromiseFactoryImpl(std::move(f_)));
+
+ explicit PromiseFactory(F f) : f_(std::move(f)) {}
+
+ Promise Once() { return PromiseFactoryImpl(std::move(f_)); }
+
+ Promise Repeated() const { return PromiseFactoryImpl(f_); }
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_FACTORY_H
diff --git a/grpc/src/core/lib/promise/detail/promise_like.h b/grpc/src/core/lib/promise/detail/promise_like.h
new file mode 100644
index 00000000..c0b32f1e
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/promise_like.h
@@ -0,0 +1,85 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_DETAIL_PROMISE_LIKE_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_LIKE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/poll.h"
+
+// A Promise is a callable object that returns Poll<T> for some T.
+// Often when we're writing code that uses promises, we end up wanting to also
+// deal with code that completes instantaneously - that is, it returns some T
+// where T is not Poll.
+// PromiseLike wraps any callable that takes no parameters and implements the
+// Promise interface. For things that already return Poll, this wrapping does
+// nothing. For things that do not return Poll, we wrap the return type in Poll.
+// This allows us to write things like:
+// Seq(
+// [] { return 42; },
+// ...)
+// in preference to things like:
+// Seq(
+// [] { return Poll<int>(42); },
+// ...)
+// or:
+// Seq(
+// [] -> Poll<int> { return 42; },
+// ...)
+// leading to slightly more concise code and eliminating some rules that in
+// practice people find hard to deal with.
+
+namespace grpc_core {
+namespace promise_detail {
+
+template <typename T>
+struct PollWrapper {
+ static Poll<T> Wrap(T&& x) { return Poll<T>(std::forward<T>(x)); }
+};
+
+template <typename T>
+struct PollWrapper<Poll<T>> {
+ static Poll<T> Wrap(Poll<T>&& x) { return std::forward<Poll<T>>(x); }
+};
+
+template <typename T>
+auto WrapInPoll(T&& x) -> decltype(PollWrapper<T>::Wrap(std::forward<T>(x))) {
+ return PollWrapper<T>::Wrap(std::forward<T>(x));
+}
+
+template <typename F>
+class PromiseLike {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ // NOLINTNEXTLINE - internal detail that drastically simplifies calling code.
+ PromiseLike(F&& f) : f_(std::forward<F>(f)) {}
+ auto operator()() -> decltype(WrapInPoll(f_())) { return WrapInPoll(f_()); }
+ using Result = typename PollTraits<decltype(WrapInPoll(f_()))>::Type;
+};
+
+// T -> T, const T& -> T
+template <typename T>
+using RemoveCVRef = absl::remove_cv_t<absl::remove_reference_t<T>>;
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_LIKE_H
diff --git a/grpc/src/core/lib/promise/detail/status.h b/grpc/src/core/lib/promise/detail/status.h
new file mode 100644
index 00000000..a56c6fe0
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/status.h
@@ -0,0 +1,50 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_DETAIL_STATUS_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_STATUS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "absl/status/status.h"
+#include "absl/status/statusor.h"
+
+// Helpers for dealing with absl::Status/StatusOr generically
+
+namespace grpc_core {
+namespace promise_detail {
+
+// Convert with a move the input status to an absl::Status.
+template <typename T>
+absl::Status IntoStatus(absl::StatusOr<T>* status) {
+ return std::move(status->status());
+}
+
+// Convert with a move the input status to an absl::Status.
+inline absl::Status IntoStatus(absl::Status* status) {
+ return std::move(*status);
+}
+
+} // namespace promise_detail
+
+// Return true if the status represented by the argument is ok, false if not.
+// By implementing this function for other, non-absl::Status types, those types
+// can participate in TrySeq as result types that affect control flow.
+inline bool IsStatusOk(const absl::Status& status) { return status.ok(); }
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_STATUS_H
diff --git a/grpc/src/core/lib/promise/detail/switch.h b/grpc/src/core/lib/promise/detail/switch.h
new file mode 100644
index 00000000..84b11911
--- /dev/null
+++ b/grpc/src/core/lib/promise/detail/switch.h
@@ -0,0 +1,1455 @@
+/*
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Automatically generated by tools/codegen/core/gen_switch.py
+ */
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdlib.h>
+
+namespace grpc_core {
+
+template <typename R, typename F0>
+R Switch(char idx, F0 f0) {
+ switch (idx) {
+ case 0:
+ return f0();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1>
+R Switch(char idx, F0 f0, F1 f1) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2>
+R Switch(char idx, F0 f0, F1 f1, F2 f2) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22,
+ F23 f23) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29, typename F30>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29, F30 f30) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ case 30:
+ return f30();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29, typename F30, typename F31>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29, F30 f30,
+ F31 f31) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ case 30:
+ return f30();
+ case 31:
+ return f31();
+ }
+ abort();
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
diff --git a/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h b/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h
new file mode 100644
index 00000000..168cbcc4
--- /dev/null
+++ b/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h
@@ -0,0 +1,48 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
+#define GRPC_CORE_LIB_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/debug_location.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+namespace grpc_core {
+
+// A callback scheduler for activities that works by scheduling callbacks on the
+// exec ctx.
+class ExecCtxWakeupScheduler {
+ public:
+ template <typename ActivityType>
+ void ScheduleWakeup(ActivityType* activity) {
+ GRPC_CLOSURE_INIT(
+ &closure_,
+ [](void* arg, grpc_error_handle) {
+ static_cast<ActivityType*>(arg)->RunScheduledWakeup();
+ },
+ activity, grpc_schedule_on_exec_ctx);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+ }
+
+ private:
+ grpc_closure closure_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
diff --git a/grpc/src/core/lib/promise/for_each.h b/grpc/src/core/lib/promise/for_each.h
new file mode 100644
index 00000000..add484ad
--- /dev/null
+++ b/grpc/src/core/lib/promise/for_each.h
@@ -0,0 +1,140 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_FOR_EACH_H
+#define GRPC_CORE_LIB_PROMISE_FOR_EACH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "absl/status/status.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace for_each_detail {
+
+// Helper function: at the end of each iteration of a for-each loop, this is
+// called. If the iteration failed, return failure. If the iteration succeeded,
+// then call the next iteration.
+template <typename Reader, typename CallPoll>
+Poll<absl::Status> FinishIteration(absl::Status* r, Reader* reader,
+ CallPoll call_poll) {
+ if (r->ok()) {
+ auto next = reader->Next();
+ return call_poll(next);
+ }
+ return std::move(*r);
+}
+
+// Done creates statuses for the end of the iteration. It's templated on the
+// type of the result of the ForEach loop, so that we can introduce new types
+// easily.
+template <typename T>
+struct Done;
+
+template <>
+struct Done<absl::Status> {
+ static absl::Status Make() { return absl::OkStatus(); }
+};
+
+template <typename Reader, typename Action>
+class ForEach {
+ private:
+ using ReaderNext = decltype(std::declval<Reader>().Next());
+ using ReaderResult = typename PollTraits<
+ decltype(std::declval<ReaderNext>()())>::Type::value_type;
+ using ActionFactory = promise_detail::PromiseFactory<ReaderResult, Action>;
+ using ActionPromise = typename ActionFactory::Promise;
+
+ public:
+ using Result =
+ typename PollTraits<decltype(std::declval<ActionPromise>()())>::Type;
+ ForEach(Reader reader, Action action)
+ : reader_(std::move(reader)),
+ action_factory_(std::move(action)),
+ state_(reader_.Next()) {}
+
+ ForEach(const ForEach&) = delete;
+ ForEach& operator=(const ForEach&) = delete;
+ // noexcept causes compiler errors on older gcc's
+ // NOLINTNEXTLINE(performance-noexcept-move-constructor)
+ ForEach(ForEach&&) = default;
+ // noexcept causes compiler errors on older gcc's
+ // NOLINTNEXTLINE(performance-noexcept-move-constructor)
+ ForEach& operator=(ForEach&&) = default;
+
+ Poll<Result> operator()() {
+ return absl::visit(CallPoll<false>{this}, state_);
+ }
+
+ private:
+ Reader reader_;
+ ActionFactory action_factory_;
+ absl::variant<ReaderNext, ActionPromise> state_;
+
+ // Call the inner poll function, and if it's finished, start the next
+ // iteration. If kSetState==true, also set the current state in self->state_.
+ // We omit that on the first iteration because it's common to poll once and
+ // not change state, which saves us some work.
+ template <bool kSetState>
+ struct CallPoll {
+ ForEach* const self;
+
+ Poll<Result> operator()(ReaderNext& reader_next) {
+ auto r = reader_next();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ if (p->has_value()) {
+ auto action = self->action_factory_.Repeated(std::move(**p));
+ return CallPoll<true>{self}(action);
+ } else {
+ return Done<Result>::Make();
+ }
+ }
+ if (kSetState) {
+ self->state_.template emplace<ReaderNext>(std::move(reader_next));
+ }
+ return Pending();
+ }
+
+ Poll<Result> operator()(ActionPromise& promise) {
+ auto r = promise();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ return FinishIteration(p, &self->reader_, CallPoll<true>{self});
+ }
+ if (kSetState) {
+ self->state_.template emplace<ActionPromise>(std::move(promise));
+ }
+ return Pending();
+ }
+ };
+};
+
+} // namespace for_each_detail
+
+/// For each item acquired by calling Reader::Next, run the promise Action.
+template <typename Reader, typename Action>
+for_each_detail::ForEach<Reader, Action> ForEach(Reader reader, Action action) {
+ return for_each_detail::ForEach<Reader, Action>(std::move(reader),
+ std::move(action));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_FOR_EACH_H
diff --git a/grpc/src/core/lib/promise/if.h b/grpc/src/core/lib/promise/if.h
new file mode 100644
index 00000000..89f11479
--- /dev/null
+++ b/grpc/src/core/lib/promise/if.h
@@ -0,0 +1,134 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_IF_H
+#define GRPC_CORE_LIB_PROMISE_IF_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+
+#include "absl/status/statusor.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename CallPoll, typename T, typename F>
+typename CallPoll::PollResult ChooseIf(CallPoll call_poll, bool result,
+ T* if_true, F* if_false) {
+ if (result) {
+ auto promise = if_true->Once();
+ return call_poll(promise);
+ } else {
+ auto promise = if_false->Once();
+ return call_poll(promise);
+ }
+}
+
+template <typename CallPoll, typename T, typename F>
+typename CallPoll::PollResult ChooseIf(CallPoll call_poll,
+ absl::StatusOr<bool> result, T* if_true,
+ F* if_false) {
+ if (!result.ok()) {
+ return typename CallPoll::PollResult(result.status());
+ } else if (*result) {
+ auto promise = if_true->Once();
+ return call_poll(promise);
+ } else {
+ auto promise = if_false->Once();
+ return call_poll(promise);
+ }
+}
+
+template <typename C, typename T, typename F>
+class If {
+ private:
+ using TrueFactory = promise_detail::PromiseFactory<void, T>;
+ using FalseFactory = promise_detail::PromiseFactory<void, F>;
+ using ConditionPromise = PromiseLike<C>;
+ using TruePromise = typename TrueFactory::Promise;
+ using FalsePromise = typename FalseFactory::Promise;
+ using Result =
+ typename PollTraits<decltype(std::declval<TruePromise>()())>::Type;
+
+ public:
+ If(C condition, T if_true, F if_false)
+ : state_(Evaluating{ConditionPromise(std::move(condition)),
+ TrueFactory(std::move(if_true)),
+ FalseFactory(std::move(if_false))}) {}
+
+ Poll<Result> operator()() {
+ return absl::visit(CallPoll<false>{this}, state_);
+ }
+
+ private:
+ struct Evaluating {
+ ConditionPromise condition;
+ TrueFactory if_true;
+ FalseFactory if_false;
+ };
+ using State = absl::variant<Evaluating, TruePromise, FalsePromise>;
+ State state_;
+
+ template <bool kSetState>
+ struct CallPoll {
+ using PollResult = Poll<Result>;
+
+ If* const self;
+
+ PollResult operator()(Evaluating& evaluating) const {
+ static_assert(
+ !kSetState,
+ "shouldn't need to set state coming through the initial branch");
+ auto r = evaluating.condition();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ return ChooseIf(CallPoll<true>{self}, std::move(*p),
+ &evaluating.if_true, &evaluating.if_false);
+ }
+ return Pending();
+ }
+
+ template <class Promise>
+ PollResult operator()(Promise& promise) const {
+ auto r = promise();
+ if (kSetState && absl::holds_alternative<Pending>(r)) {
+ self->state_.template emplace<Promise>(std::move(promise));
+ }
+ return r;
+ }
+ };
+};
+
+} // namespace promise_detail
+
+// If promise combinator.
+// Takes 3 promise factories, and evaluates the first.
+// If it returns failure, returns failure for the entire combinator.
+// If it returns true, evaluates the second promise.
+// If it returns false, evaluates the third promise.
+template <typename C, typename T, typename F>
+promise_detail::If<C, T, F> If(C condition, T if_true, F if_false) {
+ return promise_detail::If<C, T, F>(std::move(condition), std::move(if_true),
+ std::move(if_false));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_IF_H
diff --git a/grpc/src/core/lib/promise/intra_activity_waiter.h b/grpc/src/core/lib/promise/intra_activity_waiter.h
new file mode 100644
index 00000000..137db5fd
--- /dev/null
+++ b/grpc/src/core/lib/promise/intra_activity_waiter.h
@@ -0,0 +1,49 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_INTRA_ACTIVITY_WAITER_H
+#define GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Helper type to track wakeups between objects in the same activity.
+// Can be fairly fast as no ref counting or locking needs to occur.
+class IntraActivityWaiter {
+ public:
+ // Register for wakeup, return Pending(). If state is not ready to proceed,
+ // Promises should bottom out here.
+ Pending pending() {
+ waiting_ = true;
+ return Pending();
+ }
+ // Wake the activity
+ void Wake() {
+ if (waiting_) {
+ waiting_ = false;
+ Activity::current()->ForceImmediateRepoll();
+ }
+ }
+
+ private:
+ bool waiting_ = false;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H
diff --git a/grpc/src/core/lib/promise/join.h b/grpc/src/core/lib/promise/join.h
new file mode 100644
index 00000000..d8088d0b
--- /dev/null
+++ b/grpc/src/core/lib/promise/join.h
@@ -0,0 +1,55 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/detail/basic_join.h"
+
+namespace grpc_core {
+namespace promise_detail {
+
+struct JoinTraits {
+ template <typename T>
+ using ResultType = absl::remove_reference_t<T>;
+ template <typename T, typename F>
+ static auto OnResult(T result, F kontinue)
+ -> decltype(kontinue(std::move(result))) {
+ return kontinue(std::move(result));
+ }
+ template <typename T>
+ static T Wrap(T x) {
+ return x;
+ }
+};
+
+template <typename... Promises>
+using Join = BasicJoin<JoinTraits, Promises...>;
+
+} // namespace promise_detail
+
+/// Combinator to run all promises to completion, and return a tuple
+/// of their results.
+template <typename... Promise>
+promise_detail::Join<Promise...> Join(Promise... promises) {
+ return promise_detail::Join<Promise...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_JOIN_H
diff --git a/grpc/src/core/lib/promise/latch.h b/grpc/src/core/lib/promise/latch.h
new file mode 100644
index 00000000..e20dd593
--- /dev/null
+++ b/grpc/src/core/lib/promise/latch.h
@@ -0,0 +1,104 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_LATCH_H
+#define GRPC_CORE_LIB_PROMISE_LATCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/intra_activity_waiter.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Latch provides a single set waitable object.
+// Initially the Latch is unset.
+// It can be waited upon by the Wait method, which produces a Promise that
+// resolves when the Latch is Set to a value of type T.
+template <typename T>
+class Latch {
+ public:
+ // This is the type of the promise returned by Wait.
+ class WaitPromise {
+ public:
+ Poll<T*> operator()() const {
+ if (latch_->has_value_) {
+ return &latch_->value_;
+ } else {
+ return latch_->waiter_.pending();
+ }
+ }
+
+ private:
+ friend class Latch;
+ explicit WaitPromise(Latch* latch) : latch_(latch) {}
+ Latch* latch_;
+ };
+
+ Latch() = default;
+ Latch(const Latch&) = delete;
+ Latch& operator=(const Latch&) = delete;
+ Latch(Latch&& other) noexcept
+ : value_(std::move(other.value_)), has_value_(other.has_value_) {
+#ifndef NDEBUG
+ GPR_DEBUG_ASSERT(!other.has_had_waiters_);
+#endif
+ }
+ Latch& operator=(Latch&& other) noexcept {
+#ifndef NDEBUG
+ GPR_DEBUG_ASSERT(!other.has_had_waiters_);
+#endif
+ value_ = std::move(other.value_);
+ has_value_ = other.has_value_;
+ return *this;
+ }
+
+ // Produce a promise to wait for a value from this latch.
+ WaitPromise Wait() {
+#ifndef NDEBUG
+ has_had_waiters_ = true;
+#endif
+ return WaitPromise(this);
+ }
+
+ // Set the value of the latch. Can only be called once.
+ void Set(T value) {
+ GPR_DEBUG_ASSERT(!has_value_);
+ value_ = std::move(value);
+ has_value_ = true;
+ waiter_.Wake();
+ }
+
+ private:
+ // The value stored (if has_value_ is true), otherwise some random value, we
+ // don't care.
+ // Why not absl::optional<>? Writing things this way lets us compress
+ // has_value_ with waiter_ and leads to some significant memory savings for
+ // some scenarios.
+ GPR_NO_UNIQUE_ADDRESS T value_;
+ // True if we have a value set, false otherwise.
+ bool has_value_ = false;
+#ifndef NDEBUG
+ // Has this latch ever had waiters.
+ bool has_had_waiters_ = false;
+#endif
+ IntraActivityWaiter waiter_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_LATCH_H
diff --git a/grpc/src/core/lib/promise/loop.h b/grpc/src/core/lib/promise/loop.h
new file mode 100644
index 00000000..3de26672
--- /dev/null
+++ b/grpc/src/core/lib/promise/loop.h
@@ -0,0 +1,134 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_LOOP_H
+#define GRPC_CORE_LIB_PROMISE_LOOP_H
+
+#include <grpc/support/port_platform.h>
+
+#include <new>
+#include <type_traits>
+
+#include "absl/status/statusor.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Special type - signals to loop to take another iteration, instead of
+// finishing
+struct Continue {};
+
+// Result of polling a loop promise - either Continue looping, or return a value
+// T
+template <typename T>
+using LoopCtl = absl::variant<Continue, T>;
+
+namespace promise_detail {
+
+template <typename T>
+struct LoopTraits;
+
+template <typename T>
+struct LoopTraits<LoopCtl<T>> {
+ using Result = T;
+ static LoopCtl<T> ToLoopCtl(LoopCtl<T> value) { return value; }
+};
+
+template <typename T>
+struct LoopTraits<absl::StatusOr<LoopCtl<T>>> {
+ using Result = absl::StatusOr<T>;
+ static LoopCtl<Result> ToLoopCtl(absl::StatusOr<LoopCtl<T>> value) {
+ if (!value.ok()) return value.status();
+ const auto& inner = *value;
+ if (absl::holds_alternative<Continue>(inner)) return Continue{};
+ return absl::get<T>(inner);
+ }
+};
+
+template <>
+struct LoopTraits<absl::StatusOr<LoopCtl<absl::Status>>> {
+ using Result = absl::Status;
+ static LoopCtl<Result> ToLoopCtl(
+ absl::StatusOr<LoopCtl<absl::Status>> value) {
+ if (!value.ok()) return value.status();
+ const auto& inner = *value;
+ if (absl::holds_alternative<Continue>(inner)) return Continue{};
+ return absl::get<absl::Status>(inner);
+ }
+};
+
+template <typename F>
+class Loop {
+ private:
+ using Factory = promise_detail::PromiseFactory<void, F>;
+ using PromiseType = decltype(std::declval<Factory>().Repeated());
+ using PromiseResult = typename PromiseType::Result;
+
+ public:
+ using Result = typename LoopTraits<PromiseResult>::Result;
+
+ explicit Loop(F f) : factory_(std::move(f)), promise_(factory_.Repeated()) {}
+ ~Loop() { promise_.~PromiseType(); }
+
+ Loop(Loop&& loop) noexcept
+ : factory_(std::move(loop.factory_)),
+ promise_(std::move(loop.promise_)) {}
+
+ Loop(const Loop& loop) = delete;
+ Loop& operator=(const Loop& loop) = delete;
+
+ Poll<Result> operator()() {
+ while (true) {
+ // Poll the inner promise.
+ auto promise_result = promise_();
+ // If it returns a value:
+ if (auto* p = absl::get_if<kPollReadyIdx>(&promise_result)) {
+ // - then if it's Continue, destroy the promise and recreate a new one
+ // from our factory.
+ auto lc = LoopTraits<PromiseResult>::ToLoopCtl(*p);
+ if (absl::holds_alternative<Continue>(lc)) {
+ promise_.~PromiseType();
+ new (&promise_) PromiseType(factory_.Repeated());
+ continue;
+ }
+ // - otherwise there's our result... return it out.
+ return absl::get<Result>(lc);
+ } else {
+ // Otherwise the inner promise was pending, so we are pending.
+ return Pending();
+ }
+ }
+ }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS Factory factory_;
+ GPR_NO_UNIQUE_ADDRESS union { GPR_NO_UNIQUE_ADDRESS PromiseType promise_; };
+};
+
+} // namespace promise_detail
+
+// Looping combinator.
+// Expects F returns LoopCtl<T> - if it's Continue, then run the loop again -
+// otherwise yield the returned value as the result of the loop.
+template <typename F>
+promise_detail::Loop<F> Loop(F f) {
+ return promise_detail::Loop<F>(std::move(f));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_LOOP_H
diff --git a/grpc/src/core/lib/promise/map.h b/grpc/src/core/lib/promise/map.h
new file mode 100644
index 00000000..d4090beb
--- /dev/null
+++ b/grpc/src/core/lib/promise/map.h
@@ -0,0 +1,88 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_MAP_H
+#define GRPC_CORE_LIB_PROMISE_MAP_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Implementation of mapping combinator - use this via the free function below!
+// Promise is the type of promise to poll on, Fn is a function that takes the
+// result of Promise and maps it to some new type.
+template <typename Promise, typename Fn>
+class Map {
+ public:
+ Map(Promise promise, Fn fn)
+ : promise_(std::move(promise)), fn_(std::move(fn)) {}
+
+ using PromiseResult = typename PromiseLike<Promise>::Result;
+ using Result =
+ RemoveCVRef<decltype(std::declval<Fn>()(std::declval<PromiseResult>()))>;
+
+ Poll<Result> operator()() {
+ Poll<PromiseResult> r = promise_();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ return fn_(std::move(*p));
+ }
+ return Pending();
+ }
+
+ private:
+ PromiseLike<Promise> promise_;
+ Fn fn_;
+};
+
+} // namespace promise_detail
+
+// Mapping combinator.
+// Takes a promise, and a synchronous function to mutate its result, and
+// returns a promise.
+template <typename Promise, typename Fn>
+promise_detail::Map<Promise, Fn> Map(Promise promise, Fn fn) {
+ return promise_detail::Map<Promise, Fn>(std::move(promise), std::move(fn));
+}
+
+// Callable that takes a tuple and returns one element
+template <size_t kElem>
+struct JustElem {
+ template <typename... A>
+ auto operator()(std::tuple<A...>&& t) const
+ -> decltype(std::get<kElem>(std::forward<std::tuple<A...>>(t))) {
+ return std::get<kElem>(std::forward<std::tuple<A...>>(t));
+ }
+ template <typename... A>
+ auto operator()(const std::tuple<A...>& t) const
+ -> decltype(std::get<kElem>(t)) {
+ return std::get<kElem>(t);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_MAP_H
diff --git a/grpc/src/core/lib/promise/observable.h b/grpc/src/core/lib/promise/observable.h
new file mode 100644
index 00000000..26edf9f1
--- /dev/null
+++ b/grpc/src/core/lib/promise/observable.h
@@ -0,0 +1,295 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_OBSERVABLE_H
+#define GRPC_CORE_LIB_PROMISE_OBSERVABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+#include <limits>
+#include <memory>
+#include <type_traits>
+
+#include "absl/base/thread_annotations.h"
+#include "absl/synchronization/mutex.h"
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+#include "src/core/lib/promise/wait_set.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+using ObservableVersion = uint64_t;
+static constexpr ObservableVersion kTombstoneVersion =
+ std::numeric_limits<ObservableVersion>::max();
+
+} // namespace promise_detail
+
+class WatchCommitter {
+ public:
+ void Commit() { version_seen_ = promise_detail::kTombstoneVersion; }
+
+ protected:
+ promise_detail::ObservableVersion version_seen_ = 0;
+};
+
+namespace promise_detail {
+
+// Shared state between Observable and Observer.
+template <typename T>
+class ObservableState {
+ public:
+ explicit ObservableState(absl::optional<T> value)
+ : value_(std::move(value)) {}
+
+ // Publish that we're closed.
+ void Close() {
+ mu_.Lock();
+ version_ = kTombstoneVersion;
+ value_.reset();
+ auto wakeup = waiters_.TakeWakeupSet();
+ mu_.Unlock();
+ wakeup.Wakeup();
+ }
+
+ // Synchronously publish a new value, and wake any waiters.
+ void Push(T value) {
+ mu_.Lock();
+ version_++;
+ value_ = std::move(value);
+ auto wakeup = waiters_.TakeWakeupSet();
+ mu_.Unlock();
+ wakeup.Wakeup();
+ }
+
+ Poll<absl::optional<T>> PollGet(ObservableVersion* version_seen) {
+ absl::MutexLock lock(&mu_);
+ if (!Started()) return Pending();
+ *version_seen = version_;
+ return value_;
+ }
+
+ Poll<absl::optional<T>> PollNext(ObservableVersion* version_seen) {
+ absl::MutexLock lock(&mu_);
+ if (!NextValueReady(version_seen)) return Pending();
+ return value_;
+ }
+
+ Poll<absl::optional<T>> PollWatch(ObservableVersion* version_seen) {
+ if (*version_seen == kTombstoneVersion) return Pending();
+
+ absl::MutexLock lock(&mu_);
+ if (!NextValueReady(version_seen)) return Pending();
+ // Watch needs to be woken up if the value changes even if it's ready now.
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return value_;
+ }
+
+ private:
+ // Returns true if an initial value is set.
+ // If one is not set, add ourselves as pending to waiters_, and return false.
+ bool Started() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ if (!value_.has_value()) {
+ if (version_ != kTombstoneVersion) {
+ // We allow initial no-value, which does not indicate closure.
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // If no value is ready, add ourselves as pending to waiters_ and return
+ // false.
+ // If the next value is ready, update the last version seen and return true.
+ bool NextValueReady(ObservableVersion* version_seen)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ if (!Started()) return false;
+ if (version_ == *version_seen) {
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return false;
+ }
+ *version_seen = version_;
+ return true;
+ }
+
+ absl::Mutex mu_;
+ WaitSet waiters_ ABSL_GUARDED_BY(mu_);
+ ObservableVersion version_ ABSL_GUARDED_BY(mu_) = 1;
+ absl::optional<T> value_ ABSL_GUARDED_BY(mu_);
+};
+
+// Promise implementation for Observer::Get.
+template <typename T>
+class ObservableGet {
+ public:
+ ObservableGet(ObservableVersion* version_seen, ObservableState<T>* state)
+ : version_seen_(version_seen), state_(state) {}
+
+ Poll<absl::optional<T>> operator()() {
+ return state_->PollGet(version_seen_);
+ }
+
+ private:
+ ObservableVersion* version_seen_;
+ ObservableState<T>* state_;
+};
+
+// Promise implementation for Observer::Next.
+template <typename T>
+class ObservableNext {
+ public:
+ ObservableNext(ObservableVersion* version_seen, ObservableState<T>* state)
+ : version_seen_(version_seen), state_(state) {}
+
+ Poll<absl::optional<T>> operator()() {
+ return state_->PollNext(version_seen_);
+ }
+
+ private:
+ ObservableVersion* version_seen_;
+ ObservableState<T>* state_;
+};
+
+template <typename T, typename F>
+class ObservableWatch final : private WatchCommitter {
+ private:
+ using Promise = PromiseLike<decltype(std::declval<F>()(
+ std::declval<T>(), std::declval<WatchCommitter*>()))>;
+ using Result = typename Promise::Result;
+
+ public:
+ explicit ObservableWatch(F factory, std::shared_ptr<ObservableState<T>> state)
+ : state_(std::move(state)), factory_(std::move(factory)) {}
+ ObservableWatch(const ObservableWatch&) = delete;
+ ObservableWatch& operator=(const ObservableWatch&) = delete;
+ ObservableWatch(ObservableWatch&& other) noexcept
+ : state_(std::move(other.state_)),
+ promise_(std::move(other.promise_)),
+ factory_(std::move(other.factory_)) {}
+ ObservableWatch& operator=(ObservableWatch&&) noexcept = default;
+
+ Poll<Result> operator()() {
+ auto r = state_->PollWatch(&version_seen_);
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ if (p->has_value()) {
+ promise_ = Promise(factory_(std::move(**p), this));
+ } else {
+ promise_ = {};
+ }
+ }
+ if (promise_.has_value()) {
+ return (*promise_)();
+ } else {
+ return Pending();
+ }
+ }
+
+ private:
+ std::shared_ptr<ObservableState<T>> state_;
+ absl::optional<Promise> promise_;
+ F factory_;
+};
+
+} // namespace promise_detail
+
+template <typename T>
+class Observable;
+
+// Observer watches an Observable for updates.
+// It can see either the latest value or wait for a new value, but is not
+// guaranteed to see every value pushed to the Observable.
+template <typename T>
+class Observer {
+ public:
+ Observer(const Observer&) = delete;
+ Observer& operator=(const Observer&) = delete;
+ Observer(Observer&& other) noexcept
+ : version_seen_(other.version_seen_), state_(std::move(other.state_)) {}
+ Observer& operator=(Observer&& other) noexcept {
+ version_seen_ = other.version_seen_;
+ state_ = std::move(other.state_);
+ return *this;
+ }
+
+ // Return a promise that will produce an optional<T>.
+ // If the Observable is still present, this will be a value T, but if the
+ // Observable has been closed, this will be nullopt. Borrows data from the
+ // Observer, so this value must stay valid until the promise is resolved. Only
+ // one Next, Get call is allowed to be outstanding at a time.
+ promise_detail::ObservableGet<T> Get() {
+ return promise_detail::ObservableGet<T>{&version_seen_, &*state_};
+ }
+
+ // Return a promise that will produce the next unseen value as an optional<T>.
+ // If the Observable is still present, this will be a value T, but if the
+ // Observable has been closed, this will be nullopt. Borrows data from the
+ // Observer, so this value must stay valid until the promise is resolved. Only
+ // one Next, Get call is allowed to be outstanding at a time.
+ promise_detail::ObservableNext<T> Next() {
+ return promise_detail::ObservableNext<T>{&version_seen_, &*state_};
+ }
+
+ private:
+ using State = promise_detail::ObservableState<T>;
+ friend class Observable<T>;
+ explicit Observer(std::shared_ptr<State> state) : state_(state) {}
+ promise_detail::ObservableVersion version_seen_ = 0;
+ std::shared_ptr<State> state_;
+};
+
+// Observable models a single writer multiple reader broadcast channel.
+// Readers can observe the latest value, or await a new latest value, but they
+// are not guaranteed to observe every value.
+template <typename T>
+class Observable {
+ public:
+ Observable() : state_(std::make_shared<State>(absl::nullopt)) {}
+ explicit Observable(T value)
+ : state_(std::make_shared<State>(std::move(value))) {}
+ ~Observable() { state_->Close(); }
+ Observable(const Observable&) = delete;
+ Observable& operator=(const Observable&) = delete;
+
+ // Push a new value into the observable.
+ void Push(T value) { state_->Push(std::move(value)); }
+
+ // Create a new Observer - which can pull the current state from this
+ // Observable.
+ Observer<T> MakeObserver() { return Observer<T>(state_); }
+
+ // Create a new Watch - a promise that pushes state into the passed in promise
+ // factory. The promise factory takes two parameters - the current value and a
+ // commit token. If the commit token is used (the Commit function on it is
+ // called), then no further Watch updates are provided.
+ template <typename F>
+ promise_detail::ObservableWatch<T, F> Watch(F f) {
+ return promise_detail::ObservableWatch<T, F>(std::move(f), state_);
+ }
+
+ private:
+ using State = promise_detail::ObservableState<T>;
+ std::shared_ptr<State> state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_OBSERVABLE_H
diff --git a/grpc/src/core/lib/promise/pipe.h b/grpc/src/core/lib/promise/pipe.h
new file mode 100644
index 00000000..c2de5da4
--- /dev/null
+++ b/grpc/src/core/lib/promise/pipe.h
@@ -0,0 +1,339 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_PIPE_H
+#define GRPC_CORE_LIB_PROMISE_PIPE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <new>
+#include <type_traits>
+#include <utility>
+
+#include "absl/container/inlined_vector.h"
+#include "absl/status/status.h"
+#include "absl/status/statusor.h"
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/intra_activity_waiter.h"
+#include "src/core/lib/promise/poll.h"
+#include "src/core/lib/resource_quota/arena.h"
+
+namespace grpc_core {
+
+template <typename T>
+struct Pipe;
+template <typename T>
+class PipeSender;
+template <typename T>
+class PipeReceiver;
+
+namespace pipe_detail {
+
+template <typename T>
+class Push;
+template <typename T>
+class Next;
+
+// Center sits between a sender and a receiver to provide a one-deep buffer of
+// Ts
+template <typename T>
+class Center {
+ public:
+ // Initialize with one send ref (held by PipeSender) and one recv ref (held by
+ // PipeReceiver)
+ Center() {
+ send_refs_ = 1;
+ recv_refs_ = 1;
+ has_value_ = false;
+ }
+
+ // Add one ref to the send side of this object, and return this.
+ Center* RefSend() {
+ send_refs_++;
+ return this;
+ }
+
+ // Add one ref to the recv side of this object, and return this.
+ Center* RefRecv() {
+ recv_refs_++;
+ return this;
+ }
+
+ // Drop a send side ref
+ // If no send refs remain, wake due to send closure
+ // If no refs remain, destroy this object
+ void UnrefSend() {
+ GPR_DEBUG_ASSERT(send_refs_ > 0);
+ send_refs_--;
+ if (0 == send_refs_) {
+ on_full_.Wake();
+ on_empty_.Wake();
+ if (0 == recv_refs_) {
+ this->~Center();
+ }
+ }
+ }
+
+ // Drop a recv side ref
+ // If no recv refs remain, wake due to recv closure
+ // If no refs remain, destroy this object
+ void UnrefRecv() {
+ GPR_DEBUG_ASSERT(recv_refs_ > 0);
+ recv_refs_--;
+ if (0 == recv_refs_) {
+ on_full_.Wake();
+ on_empty_.Wake();
+ if (0 == send_refs_) {
+ this->~Center();
+ } else if (has_value_) {
+ ResetValue();
+ }
+ }
+ }
+
+ // Try to push *value into the pipe.
+ // Return Pending if there is no space.
+ // Return true if the value was pushed.
+ // Return false if the recv end is closed.
+ Poll<bool> Push(T* value) {
+ GPR_DEBUG_ASSERT(send_refs_ != 0);
+ if (recv_refs_ == 0) return false;
+ if (has_value_) return on_empty_.pending();
+ has_value_ = true;
+ value_ = std::move(*value);
+ on_full_.Wake();
+ return true;
+ }
+
+ // Try to receive a value from the pipe.
+ // Return Pending if there is no value.
+ // Return the value if one was retrieved.
+ // Return nullopt if the send end is closed and no value had been pushed.
+ Poll<absl::optional<T>> Next() {
+ GPR_DEBUG_ASSERT(recv_refs_ != 0);
+ if (!has_value_) {
+ if (send_refs_ == 0) return absl::nullopt;
+ return on_full_.pending();
+ }
+ has_value_ = false;
+ on_empty_.Wake();
+ return std::move(value_);
+ }
+
+ private:
+ void ResetValue() {
+ // Fancy dance to move out of value in the off chance that we reclaim some
+ // memory earlier.
+ [](T) {}(std::move(value_));
+ has_value_ = false;
+ }
+ T value_;
+ // Number of sending objects.
+ // 0 => send is closed.
+ // 1 ref each for PipeSender and Push.
+ uint8_t send_refs_ : 2;
+ // Number of receiving objects.
+ // 0 => recv is closed.
+ // 1 ref each for PipeReceiver and Next.
+ uint8_t recv_refs_ : 2;
+ // True iff there is a value in the pipe.
+ bool has_value_ : 1;
+ IntraActivityWaiter on_empty_;
+ IntraActivityWaiter on_full_;
+};
+
+} // namespace pipe_detail
+
+// Send end of a Pipe.
+template <typename T>
+class PipeSender {
+ public:
+ PipeSender(const PipeSender&) = delete;
+ PipeSender& operator=(const PipeSender&) = delete;
+
+ PipeSender(PipeSender&& other) noexcept : center_(other.center_) {
+ other.center_ = nullptr;
+ }
+ PipeSender& operator=(PipeSender&& other) noexcept {
+ if (center_ != nullptr) center_->UnrefSend();
+ center_ = other.center_;
+ other.center_ = nullptr;
+ return *this;
+ }
+
+ ~PipeSender() {
+ if (center_ != nullptr) center_->UnrefSend();
+ }
+
+ // Send a single message along the pipe.
+ // Returns a promise that will resolve to a bool - true if the message was
+ // sent, false if it could never be sent. Blocks the promise until the
+ // receiver is either closed or able to receive another message.
+ pipe_detail::Push<T> Push(T value);
+
+ private:
+ friend struct Pipe<T>;
+ explicit PipeSender(pipe_detail::Center<T>* center) : center_(center) {}
+ pipe_detail::Center<T>* center_;
+};
+
+// Receive end of a Pipe.
+template <typename T>
+class PipeReceiver {
+ public:
+ PipeReceiver(const PipeReceiver&) = delete;
+ PipeReceiver& operator=(const PipeReceiver&) = delete;
+
+ PipeReceiver(PipeReceiver&& other) noexcept : center_(other.center_) {
+ other.center_ = nullptr;
+ }
+ PipeReceiver& operator=(PipeReceiver&& other) noexcept {
+ if (center_ != nullptr) center_->UnrefRecv();
+ center_ = other.center_;
+ other.center_ = nullptr;
+ return *this;
+ }
+ ~PipeReceiver() {
+ if (center_ != nullptr) center_->UnrefRecv();
+ }
+
+ // Receive a single message from the pipe.
+ // Returns a promise that will resolve to an optional<T> - with a value if a
+ // message was received, or no value if the other end of the pipe was closed.
+ // Blocks the promise until the receiver is either closed or a message is
+ // available.
+ pipe_detail::Next<T> Next();
+
+ private:
+ friend struct Pipe<T>;
+ explicit PipeReceiver(pipe_detail::Center<T>* center) : center_(center) {}
+ pipe_detail::Center<T>* center_;
+};
+
+namespace pipe_detail {
+
+// Implementation of PipeSender::Push promise.
+template <typename T>
+class Push {
+ public:
+ Push(const Push&) = delete;
+ Push& operator=(const Push&) = delete;
+ Push(Push&& other) noexcept
+ : center_(other.center_), push_(std::move(other.push_)) {
+ other.center_ = nullptr;
+ }
+ Push& operator=(Push&& other) noexcept {
+ if (center_ != nullptr) center_->UnrefSend();
+ center_ = other.center_;
+ other.center_ = nullptr;
+ push_ = std::move(other.push_);
+ return *this;
+ }
+
+ ~Push() {
+ if (center_ != nullptr) center_->UnrefSend();
+ }
+
+ Poll<bool> operator()() { return center_->Push(&push_); }
+
+ private:
+ friend class PipeSender<T>;
+ explicit Push(pipe_detail::Center<T>* center, T push)
+ : center_(center), push_(std::move(push)) {}
+ Center<T>* center_;
+ T push_;
+};
+
+// Implementation of PipeReceiver::Next promise.
+template <typename T>
+class Next {
+ public:
+ Next(const Next&) = delete;
+ Next& operator=(const Next&) = delete;
+ Next(Next&& other) noexcept : center_(other.center_) {
+ other.center_ = nullptr;
+ }
+ Next& operator=(Next&& other) noexcept {
+ if (center_ != nullptr) center_->UnrefRecv();
+ center_ = other.center_;
+ other.center_ = nullptr;
+ return *this;
+ }
+
+ ~Next() {
+ if (center_ != nullptr) center_->UnrefRecv();
+ }
+
+ Poll<absl::optional<T>> operator()() { return center_->Next(); }
+
+ private:
+ friend class PipeReceiver<T>;
+ explicit Next(pipe_detail::Center<T>* center) : center_(center) {}
+ Center<T>* center_;
+};
+
+} // namespace pipe_detail
+
+template <typename T>
+pipe_detail::Push<T> PipeSender<T>::Push(T value) {
+ return pipe_detail::Push<T>(center_->RefSend(), std::move(value));
+}
+
+template <typename T>
+pipe_detail::Next<T> PipeReceiver<T>::Next() {
+ return pipe_detail::Next<T>(center_->RefRecv());
+}
+
+// A Pipe is an intra-Activity communications channel that transmits T's from
+// one end to the other.
+// It is only safe to use a Pipe within the context of a single Activity.
+// No synchronization is performed internally.
+// The primary Pipe data structure is allocated from an arena, so the activity
+// must have an arena as part of its context.
+// By performing that allocation we can ensure stable pointer to shared data
+// allowing PipeSender/PipeReceiver/Push/Next to be relatively simple in their
+// implementation.
+// This type has been optimized with the expectation that there are relatively
+// few pipes per activity. If this assumption does not hold then a design
+// allowing inline filtering of pipe contents (instead of connecting pipes with
+// polling code) would likely be more appropriate.
+template <typename T>
+struct Pipe {
+ Pipe() : Pipe(GetContext<Arena>()->New<pipe_detail::Center<T>>()) {}
+ Pipe(const Pipe&) = delete;
+ Pipe& operator=(const Pipe&) = delete;
+ Pipe(Pipe&&) noexcept = default;
+ Pipe& operator=(Pipe&&) noexcept = default;
+
+ PipeSender<T> sender;
+ PipeReceiver<T> receiver;
+
+ private:
+ explicit Pipe(pipe_detail::Center<T>* center)
+ : sender(center), receiver(center) {}
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_PIPE_H
diff --git a/grpc/src/core/lib/promise/poll.h b/grpc/src/core/lib/promise/poll.h
new file mode 100644
index 00000000..e891bf72
--- /dev/null
+++ b/grpc/src/core/lib/promise/poll.h
@@ -0,0 +1,66 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_POLL_H
+#define GRPC_CORE_LIB_PROMISE_POLL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "absl/types/variant.h"
+
+namespace grpc_core {
+
+// A type that signals a Promise is still pending and not yet completed.
+// Allows writing 'return Pending{}' and with automatic conversions gets
+// upgraded to a Poll<> object.
+struct Pending {
+ constexpr bool operator==(Pending) const { return true; }
+};
+
+// The result of polling a Promise once.
+//
+// Can be either pending - the Promise has not yet completed, or ready -
+// indicating that the Promise has completed AND should not be polled again.
+template <typename T>
+using Poll = absl::variant<Pending, T>;
+
+template <typename T, typename U>
+Poll<T> poll_cast(Poll<U> poll) {
+ if (absl::holds_alternative<Pending>(poll)) return Pending{};
+ return std::move(absl::get<U>(poll));
+}
+
+// Variant of Poll that serves as a ready value
+static constexpr size_t kPollReadyIdx = 1;
+
+// PollTraits tells us whether a type is Poll<> or some other type, and is
+// leveraged in the PromiseLike/PromiseFactory machinery to select the
+// appropriate implementation of those concepts based upon the return type of a
+// lambda, for example (via enable_if).
+template <typename T>
+struct PollTraits {
+ static constexpr bool is_poll() { return false; }
+};
+
+template <typename T>
+struct PollTraits<Poll<T>> {
+ using Type = T;
+ static constexpr bool is_poll() { return true; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_POLL_H
diff --git a/grpc/src/core/lib/promise/promise.h b/grpc/src/core/lib/promise/promise.h
new file mode 100644
index 00000000..1e414314
--- /dev/null
+++ b/grpc/src/core/lib/promise/promise.h
@@ -0,0 +1,95 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_PROMISE_H
+#define GRPC_CORE_LIB_PROMISE_PROMISE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <type_traits>
+
+#include "absl/status/status.h"
+#include "absl/types/optional.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// A Promise is any functor that takes no arguments and returns Poll<T>.
+// Most of the time we just pass around the functor, but occasionally
+// it pays to have a type erased variant, which we define here.
+template <typename T>
+using Promise = std::function<Poll<T>()>;
+
+// Helper to execute a promise immediately and return either the result or
+// nothing.
+template <typename Promise>
+auto NowOrNever(Promise promise)
+ -> absl::optional<typename promise_detail::PromiseLike<Promise>::Result> {
+ auto r = promise_detail::PromiseLike<Promise>(std::move(promise))();
+ if (auto* p = absl::get_if<kPollReadyIdx>(&r)) {
+ return std::move(*p);
+ }
+ return {};
+}
+
+// A promise that never completes.
+template <typename T>
+struct Never {
+ Poll<T> operator()() { return Pending(); }
+};
+
+namespace promise_detail {
+// A promise that immediately completes.
+template <typename T>
+class Immediate {
+ public:
+ explicit Immediate(T value) : value_(std::move(value)) {}
+
+ Poll<T> operator()() { return std::move(value_); }
+
+ private:
+ T value_;
+};
+} // namespace promise_detail
+
+// Return \a value immediately
+template <typename T>
+promise_detail::Immediate<T> Immediate(T value) {
+ return promise_detail::Immediate<T>(std::move(value));
+}
+
+// Return status Ok immediately
+struct ImmediateOkStatus {
+ Poll<absl::Status> operator()() { return absl::OkStatus(); }
+};
+
+// Typecheck that a promise returns the expected return type.
+// usage: auto promise = WithResult<int>([]() { return 3; });
+// NOTE: there are tests in promise_test.cc that are commented out because they
+// should fail to compile. When modifying this code these should be uncommented
+// and their miscompilation verified.
+template <typename T, typename F>
+auto WithResult(F f) ->
+ typename std::enable_if<std::is_same<decltype(f()), Poll<T>>::value,
+ F>::type {
+ return f;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_PROMISE_H
diff --git a/grpc/src/core/lib/promise/race.h b/grpc/src/core/lib/promise/race.h
new file mode 100644
index 00000000..4ecb359a
--- /dev/null
+++ b/grpc/src/core/lib/promise/race.h
@@ -0,0 +1,84 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_RACE_H
+#define GRPC_CORE_LIB_PROMISE_RACE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <type_traits>
+
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Implementation type for Race combinator.
+template <typename... Promises>
+class Race;
+
+template <typename Promise, typename... Promises>
+class Race<Promise, Promises...> {
+ public:
+ using Result = decltype(std::declval<Promise>()());
+
+ explicit Race(Promise promise, Promises... promises)
+ : promise_(std::move(promise)), next_(std::move(promises)...) {}
+
+ Result operator()() {
+ // Check our own promise.
+ auto r = promise_();
+ if (absl::holds_alternative<Pending>(r)) {
+ // Check the rest of them.
+ return next_();
+ }
+ // Return the first ready result.
+ return std::move(absl::get<kPollReadyIdx>(std::move(r)));
+ }
+
+ private:
+ // The Promise checked by this instance.
+ Promise promise_;
+ // We recursively expand to check the rest of the instances.
+ Race<Promises...> next_;
+};
+
+template <typename Promise>
+class Race<Promise> {
+ public:
+ using Result = decltype(std::declval<Promise>()());
+ explicit Race(Promise promise) : promise_(std::move(promise)) {}
+ Result operator()() { return promise_(); }
+
+ private:
+ Promise promise_;
+};
+
+} // namespace promise_detail
+
+/// Run all the promises, return the first result that's available.
+/// If two results are simultaneously available, bias towards the first result
+/// listed.
+template <typename... Promises>
+promise_detail::Race<Promises...> Race(Promises... promises) {
+ return promise_detail::Race<Promises...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_RACE_H
diff --git a/grpc/src/core/lib/promise/seq.h b/grpc/src/core/lib/promise/seq.h
new file mode 100644
index 00000000..8ad2c549
--- /dev/null
+++ b/grpc/src/core/lib/promise/seq.h
@@ -0,0 +1,89 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/basic_seq.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename T>
+struct SeqTraits {
+ using UnwrappedType = T;
+ using WrappedType = T;
+ template <typename Next>
+ static auto CallFactory(Next* next, T&& value)
+ -> decltype(next->Once(std::forward<T>(value))) {
+ return next->Once(std::forward<T>(value));
+ }
+ template <typename F, typename Elem>
+ static auto CallSeqFactory(F& f, Elem&& elem, T&& value)
+ -> decltype(f(std::forward<Elem>(elem), std::forward<T>(value))) {
+ return f(std::forward<Elem>(elem), std::forward<T>(value));
+ }
+ template <typename Result, typename PriorResult, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(PriorResult prior,
+ RunNext run_next) {
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename... Fs>
+using Seq = BasicSeq<SeqTraits, Fs...>;
+
+} // namespace promise_detail
+
+// Sequencing combinator.
+// Run the first promise.
+// Pass its result to the second, and run the returned promise.
+// Pass its result to the third, and run the returned promise.
+// etc
+// Return the final value.
+template <typename... Functors>
+promise_detail::Seq<Functors...> Seq(Functors... functors) {
+ return promise_detail::Seq<Functors...>(std::move(functors)...);
+}
+
+template <typename F>
+F Seq(F functor) {
+ return functor;
+}
+
+// Execute a sequence of operations of unknown length.
+// Asynchronously:
+// for (element in (begin, end)) {
+// argument = wait_for factory(element, argument);
+// }
+// return argument;
+template <typename Iter, typename Factory, typename Argument>
+promise_detail::BasicSeqIter<promise_detail::SeqTraits, Factory, Argument, Iter>
+SeqIter(Iter begin, Iter end, Argument argument, Factory factory) {
+ return promise_detail::BasicSeqIter<promise_detail::SeqTraits, Factory,
+ Argument, Iter>(
+ begin, end, std::move(factory), std::move(argument));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_SEQ_H
diff --git a/grpc/src/core/lib/promise/sleep.cc b/grpc/src/core/lib/promise/sleep.cc
new file mode 100644
index 00000000..c28f2df0
--- /dev/null
+++ b/grpc/src/core/lib/promise/sleep.cc
@@ -0,0 +1,74 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/promise/sleep.h"
+
+namespace grpc_core {
+
+Sleep::Sleep(Timestamp deadline) : state_(new State(deadline)) {
+ GRPC_CLOSURE_INIT(&state_->on_timer, &OnTimer, state_, nullptr);
+}
+
+Sleep::~Sleep() {
+ if (state_ == nullptr) return;
+ {
+ MutexLock lock(&state_->mu);
+ switch (state_->stage) {
+ case Stage::kInitial:
+ state_->Unref();
+ break;
+ case Stage::kStarted:
+ grpc_timer_cancel(&state_->timer);
+ break;
+ case Stage::kDone:
+ break;
+ }
+ }
+ state_->Unref();
+}
+
+void Sleep::OnTimer(void* arg, grpc_error_handle) {
+ auto* state = static_cast<State*>(arg);
+ Waker waker;
+ {
+ MutexLock lock(&state->mu);
+ state->stage = Stage::kDone;
+ waker = std::move(state->waker);
+ }
+ waker.Wakeup();
+ state->Unref();
+}
+
+Poll<absl::Status> Sleep::operator()() {
+ MutexLock lock(&state_->mu);
+ switch (state_->stage) {
+ case Stage::kInitial:
+ if (state_->deadline <= ExecCtx::Get()->Now()) {
+ return absl::OkStatus();
+ }
+ state_->stage = Stage::kStarted;
+ grpc_timer_init(&state_->timer, state_->deadline, &state_->on_timer);
+ break;
+ case Stage::kStarted:
+ break;
+ case Stage::kDone:
+ return absl::OkStatus();
+ }
+ state_->waker = Activity::current()->MakeNonOwningWaker();
+ return Pending{};
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/promise/sleep.h b/grpc/src/core/lib/promise/sleep.h
new file mode 100644
index 00000000..0af4915c
--- /dev/null
+++ b/grpc/src/core/lib/promise/sleep.h
@@ -0,0 +1,66 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_SLEEP_H
+#define GRPC_CORE_LIB_PROMISE_SLEEP_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Promise that sleeps until a deadline and then finishes.
+class Sleep {
+ public:
+ explicit Sleep(Timestamp deadline);
+ ~Sleep();
+
+ Sleep(const Sleep&) = delete;
+ Sleep& operator=(const Sleep&) = delete;
+ Sleep(Sleep&& other) noexcept : state_(other.state_) {
+ other.state_ = nullptr;
+ }
+ Sleep& operator=(Sleep&& other) noexcept {
+ std::swap(state_, other.state_);
+ return *this;
+ }
+
+ Poll<absl::Status> operator()();
+
+ private:
+ static void OnTimer(void* arg, grpc_error_handle error);
+
+ enum class Stage { kInitial, kStarted, kDone };
+ struct State {
+ explicit State(Timestamp deadline) : deadline(deadline) {}
+ RefCount refs{2};
+ const Timestamp deadline;
+ grpc_timer timer;
+ grpc_closure on_timer;
+ Mutex mu;
+ Stage stage ABSL_GUARDED_BY(mu) = Stage::kInitial;
+ Waker waker ABSL_GUARDED_BY(mu);
+ void Unref() {
+ if (refs.Unref()) delete this;
+ }
+ };
+ State* state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_SLEEP_H
diff --git a/grpc/src/core/lib/promise/try_join.h b/grpc/src/core/lib/promise/try_join.h
new file mode 100644
index 00000000..095fc1a9
--- /dev/null
+++ b/grpc/src/core/lib/promise/try_join.h
@@ -0,0 +1,83 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_TRY_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_TRY_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+
+#include "absl/meta/type_traits.h"
+#include "absl/status/status.h"
+#include "absl/status/statusor.h"
+
+#include "src/core/lib/promise/detail/basic_join.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Extract the T from a StatusOr<T>
+template <typename T>
+T IntoResult(absl::StatusOr<T>* status) {
+ return std::move(**status);
+}
+
+// TryJoin returns a StatusOr<tuple<A,B,C>> for f()->Poll<StatusOr<A>>,
+// g()->Poll<StatusOr<B>>, h()->Poll<StatusOr<C>>. If one of those should be a
+// Status instead, we need a placeholder type to return, and this is it.
+struct Empty {};
+inline Empty IntoResult(absl::Status*) { return Empty{}; }
+
+// Traits object to pass to BasicJoin
+struct TryJoinTraits {
+ template <typename T>
+ using ResultType =
+ decltype(IntoResult(std::declval<absl::remove_reference_t<T>*>()));
+ template <typename T, typename F>
+ static auto OnResult(T result, F kontinue)
+ -> decltype(kontinue(IntoResult(&result))) {
+ using Result =
+ typename PollTraits<decltype(kontinue(IntoResult(&result)))>::Type;
+ if (!result.ok()) {
+ return Result(IntoStatus(&result));
+ }
+ return kontinue(IntoResult(&result));
+ }
+ template <typename T>
+ static absl::StatusOr<T> Wrap(T x) {
+ return absl::StatusOr<T>(std::move(x));
+ }
+};
+
+// Implementation of TryJoin combinator.
+template <typename... Promises>
+using TryJoin = BasicJoin<TryJoinTraits, Promises...>;
+
+} // namespace promise_detail
+
+// Run all promises.
+// If any fail, cancel the rest and return the failure.
+// If all succeed, return Ok(tuple-of-results).
+template <typename... Promises>
+promise_detail::TryJoin<Promises...> TryJoin(Promises... promises) {
+ return promise_detail::TryJoin<Promises...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_TRY_JOIN_H
diff --git a/grpc/src/core/lib/promise/try_seq.h b/grpc/src/core/lib/promise/try_seq.h
new file mode 100644
index 00000000..65520f07
--- /dev/null
+++ b/grpc/src/core/lib/promise/try_seq.h
@@ -0,0 +1,157 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_TRY_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_TRY_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <utility>
+
+#include "absl/status/status.h"
+#include "absl/status/statusor.h"
+#include "absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/basic_seq.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename T, typename Ignored = void>
+struct TrySeqTraitsWithSfinae {
+ using UnwrappedType = T;
+ using WrappedType = absl::StatusOr<T>;
+ template <typename Next>
+ static auto CallFactory(Next* next, T&& value)
+ -> decltype(next->Once(std::forward<T>(value))) {
+ return next->Once(std::forward<T>(value));
+ }
+ template <typename F, typename Elem>
+ static auto CallSeqFactory(F& f, Elem&& elem, T&& value)
+ -> decltype(f(std::forward<Elem>(elem), std::forward<T>(value))) {
+ return f(std::forward<Elem>(elem), std::forward<T>(value));
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(T prior, RunNext run_next) {
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename T>
+struct TrySeqTraitsWithSfinae<absl::StatusOr<T>> {
+ using UnwrappedType = T;
+ using WrappedType = absl::StatusOr<T>;
+ template <typename Next>
+ static auto CallFactory(Next* next, absl::StatusOr<T>&& status)
+ -> decltype(next->Once(std::move(*status))) {
+ return next->Once(std::move(*status));
+ }
+ template <typename F, typename Elem>
+ static auto CallSeqFactory(F& f, Elem&& elem, absl::StatusOr<T> value)
+ -> decltype(f(std::forward<Elem>(elem), std::move(*value))) {
+ return f(std::forward<Elem>(elem), std::move(*value));
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(absl::StatusOr<T> prior,
+ RunNext run_next) {
+ if (!prior.ok()) return Result(prior.status());
+ return run_next(std::move(prior));
+ }
+};
+// If there exists a function 'IsStatusOk(const T&) -> bool' then we assume that
+// T is a status type for the purposes of promise sequences, and a non-OK T
+// should terminate the sequence and return.
+template <typename T>
+struct TrySeqTraitsWithSfinae<
+ T, absl::enable_if_t<
+ std::is_same<decltype(IsStatusOk(std::declval<T>())), bool>::value,
+ void>> {
+ using UnwrappedType = void;
+ using WrappedType = T;
+ template <typename Next>
+ static auto CallFactory(Next* next, T&&) -> decltype(next->Once()) {
+ return next->Once();
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(T prior, RunNext run_next) {
+ if (!IsStatusOk(prior)) return Result(std::move(prior));
+ return run_next(std::move(prior));
+ }
+};
+template <>
+struct TrySeqTraitsWithSfinae<absl::Status> {
+ using UnwrappedType = void;
+ using WrappedType = absl::Status;
+ template <typename Next>
+ static auto CallFactory(Next* next, absl::Status&&)
+ -> decltype(next->Once()) {
+ return next->Once();
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(absl::Status prior,
+ RunNext run_next) {
+ if (!prior.ok()) return Result(std::move(prior));
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename T>
+using TrySeqTraits = TrySeqTraitsWithSfinae<T>;
+
+template <typename... Fs>
+using TrySeq = BasicSeq<TrySeqTraits, Fs...>;
+
+} // namespace promise_detail
+
+// Try a sequence of operations.
+// * Run the first functor as a promise.
+// * Feed its success result into the second functor to create a promise,
+// then run that.
+// * ...
+// * Feed the second-final success result into the final functor to create a
+// promise, then run that, with the overall success result being that
+// promises success result.
+// If any step fails, fail everything.
+// Functors can return StatusOr<> to signal that a value is fed forward, or
+// Status to indicate only success/failure. In the case of returning Status,
+// the construction functors take no arguments.
+template <typename... Functors>
+promise_detail::TrySeq<Functors...> TrySeq(Functors... functors) {
+ return promise_detail::TrySeq<Functors...>(std::move(functors)...);
+}
+
+// Try a sequence of operations of unknown length.
+// Asynchronously:
+// for (element in (begin, end)) {
+// auto r = wait_for factory(element, argument);
+// if (!r.ok()) return r;
+// argument = *r;
+// }
+// return argument;
+template <typename Iter, typename Factory, typename Argument>
+promise_detail::BasicSeqIter<promise_detail::TrySeqTraits, Factory, Argument,
+ Iter>
+TrySeqIter(Iter begin, Iter end, Argument argument, Factory factory) {
+ return promise_detail::BasicSeqIter<promise_detail::TrySeqTraits, Factory,
+ Argument, Iter>(
+ begin, end, std::move(factory), std::move(argument));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_TRY_SEQ_H
diff --git a/grpc/src/core/lib/promise/wait_set.h b/grpc/src/core/lib/promise/wait_set.h
new file mode 100644
index 00000000..79a0e0f2
--- /dev/null
+++ b/grpc/src/core/lib/promise/wait_set.h
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PROMISE_WAIT_SET_H
+#define GRPC_CORE_LIB_PROMISE_WAIT_SET_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "absl/container/flat_hash_set.h"
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Helper type that can be used to enqueue many Activities waiting for some
+// external state.
+// Typically the external state should be guarded by mu_, and a call to
+// WakeAllAndUnlock should be made when the state changes.
+// Promises should bottom out polling inside pending(), which will register for
+// wakeup and return Pending().
+// Queues handles to Activities, and not Activities themselves, meaning that if
+// an Activity is destroyed prior to wakeup we end up holding only a small
+// amount of memory (around 16 bytes + malloc overhead) until the next wakeup
+// occurs.
+class WaitSet final {
+ using WakerSet = absl::flat_hash_set<Waker>;
+
+ public:
+ // Register for wakeup, return Pending(). If state is not ready to proceed,
+ // Promises should bottom out here.
+ Pending AddPending(Waker waker) {
+ pending_.emplace(std::move(waker));
+ return Pending();
+ }
+
+ class WakeupSet {
+ public:
+ void Wakeup() {
+ while (!wakeup_.empty()) {
+ wakeup_.extract(wakeup_.begin()).value().Wakeup();
+ }
+ }
+
+ private:
+ friend class WaitSet;
+ explicit WakeupSet(WakerSet&& wakeup)
+ : wakeup_(std::forward<WakerSet>(wakeup)) {}
+ WakerSet wakeup_;
+ };
+
+ GRPC_MUST_USE_RESULT WakeupSet TakeWakeupSet() {
+ return WakeupSet(std::move(pending_));
+ }
+
+ private:
+ // Handles to activities that need to be awoken.
+ WakerSet pending_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_WAIT_SET_H
diff --git a/grpc/src/core/lib/resolver/resolver.cc b/grpc/src/core/lib/resolver/resolver.cc
new file mode 100644
index 00000000..e43e97b4
--- /dev/null
+++ b/grpc/src/core/lib/resolver/resolver.cc
@@ -0,0 +1,79 @@
+/*
+ *
+ * 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/lib/resolver/resolver.h"
+
+grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false,
+ "resolver_refcount");
+
+namespace grpc_core {
+
+//
+// Resolver
+//
+
+Resolver::Resolver()
+ : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_resolver_refcount)
+ ? "Resolver"
+ : nullptr) {}
+
+//
+// Resolver::Result
+//
+
+Resolver::Result::~Result() { grpc_channel_args_destroy(args); }
+
+Resolver::Result::Result(const Result& other)
+ : addresses(other.addresses),
+ service_config(other.service_config),
+ resolution_note(other.resolution_note),
+ args(grpc_channel_args_copy(other.args)) {}
+
+Resolver::Result::Result(Result&& other) noexcept
+ : addresses(std::move(other.addresses)),
+ service_config(std::move(other.service_config)),
+ resolution_note(std::move(other.resolution_note)),
+ // TODO(roth): Use std::move() once channel args is converted to C++.
+ args(other.args) {
+ other.args = nullptr;
+}
+
+Resolver::Result& Resolver::Result::operator=(const Result& other) {
+ if (&other == this) return *this;
+ addresses = other.addresses;
+ service_config = other.service_config;
+ resolution_note = other.resolution_note;
+ grpc_channel_args_destroy(args);
+ args = grpc_channel_args_copy(other.args);
+ return *this;
+}
+
+Resolver::Result& Resolver::Result::operator=(Result&& other) noexcept {
+ addresses = std::move(other.addresses);
+ service_config = std::move(other.service_config);
+ resolution_note = std::move(other.resolution_note);
+ // TODO(roth): Use std::move() once channel args is converted to C++.
+ grpc_channel_args_destroy(args);
+ args = other.args;
+ other.args = nullptr;
+ return *this;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resolver/resolver.h b/grpc/src/core/lib/resolver/resolver.h
new file mode 100644
index 00000000..f3e35eb6
--- /dev/null
+++ b/grpc/src/core/lib/resolver/resolver.h
@@ -0,0 +1,135 @@
+//
+// 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_RESOLVER_RESOLVER_H
+#define GRPC_CORE_LIB_RESOLVER_RESOLVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/status/statusor.h"
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/resolver/server_address.h"
+#include "src/core/lib/service_config/service_config.h"
+
+extern grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount;
+
+// Name associated with individual address, if available.
+#define GRPC_ARG_ADDRESS_NAME "grpc.address_name"
+
+namespace grpc_core {
+
+/// Interface for name resolution.
+///
+/// This interface is designed to support both push-based and pull-based
+/// mechanisms. A push-based mechanism is one where the resolver will
+/// subscribe to updates for a given name, and the name service will
+/// proactively send new data to the resolver whenever the data associated
+/// with the name changes. A pull-based mechanism is one where the resolver
+/// needs to query the name service again to get updated information (e.g.,
+/// DNS).
+///
+/// Note: All methods with a "Locked" suffix must be called from the
+/// work_serializer passed to the constructor.
+class Resolver : public InternallyRefCounted<Resolver> {
+ public:
+ /// Results returned by the resolver.
+ struct Result {
+ /// A list of addresses, or an error.
+ absl::StatusOr<ServerAddressList> addresses;
+ /// A service config, or an error.
+ absl::StatusOr<RefCountedPtr<ServiceConfig>> service_config = nullptr;
+ /// An optional human-readable note describing context about the resolution,
+ /// to be passed along to the LB policy for inclusion in RPC failure status
+ /// messages in cases where neither \a addresses nor \a service_config
+ /// has a non-OK status. For example, a resolver that returns an empty
+ /// address list but a valid service config may set to this to something
+ /// like "no DNS entries found for <name>".
+ std::string resolution_note;
+ // TODO(roth): Before making this a public API, figure out a way to
+ // avoid exposing channel args this way.
+ const grpc_channel_args* args = nullptr;
+
+ // TODO(roth): Remove everything below once grpc_channel_args is
+ // converted to a copyable and movable C++ object.
+ Result() = default;
+ ~Result();
+ Result(const Result& other);
+ Result(Result&& other) noexcept;
+ Result& operator=(const Result& other);
+ Result& operator=(Result&& other) noexcept;
+ };
+
+ /// A proxy object used by the resolver to return results to the
+ /// client channel.
+ class ResultHandler {
+ public:
+ virtual ~ResultHandler() {}
+
+ /// Reports a result to the channel.
+ // TODO(roth): Add a mechanism for the resolver to get back a signal
+ // indicating if the result was accepted by the LB policy, so that it
+ // knows whether to go into backoff to retry to resolution.
+ virtual void ReportResult(Result result) = 0; // NOLINT
+ };
+
+ // Not copyable nor movable.
+ Resolver(const Resolver&) = delete;
+ Resolver& operator=(const Resolver&) = delete;
+ ~Resolver() override = default;
+
+ /// Starts resolving.
+ virtual void StartLocked() = 0;
+
+ /// Asks the resolver to obtain an updated resolver result, if
+ /// applicable.
+ ///
+ /// This is useful for pull-based implementations to decide when to
+ /// re-resolve. However, the implementation is not required to
+ /// re-resolve immediately upon receiving this call; it may instead
+ /// elect to delay based on some configured minimum time between
+ /// queries, to avoid hammering the name service with queries.
+ ///
+ /// For push-based implementations, this may be a no-op.
+ ///
+ /// Note: Implementations must not invoke any method on the
+ /// ResultHandler from within this call.
+ virtual void RequestReresolutionLocked() {}
+
+ /// Resets the re-resolution backoff, if any.
+ /// This needs to be implemented only by pull-based implementations;
+ /// for push-based implementations, it will be a no-op.
+ virtual void ResetBackoffLocked() {}
+
+ // Note: This must be invoked while holding the work_serializer.
+ void Orphan() override {
+ ShutdownLocked();
+ Unref();
+ }
+
+ protected:
+ Resolver();
+
+ /// Shuts down the resolver.
+ virtual void ShutdownLocked() = 0;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOLVER_RESOLVER_H
diff --git a/grpc/src/core/lib/resolver/resolver_factory.h b/grpc/src/core/lib/resolver/resolver_factory.h
new file mode 100644
index 00000000..091d30ee
--- /dev/null
+++ b/grpc/src/core/lib/resolver/resolver_factory.h
@@ -0,0 +1,76 @@
+//
+// 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_RESOLVER_RESOLVER_FACTORY_H
+#define GRPC_CORE_LIB_RESOLVER_RESOLVER_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/strings/strip.h"
+
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/resolver/resolver.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+typedef struct grpc_pollset_set grpc_pollset_set;
+
+namespace grpc_core {
+
+// TODO(yashkt): Move WorkSerializer to its own Bazel target, depend on that
+// target from this one, and remove this forward declaration.
+class WorkSerializer;
+
+struct ResolverArgs {
+ /// The parsed URI to resolve.
+ URI uri;
+ /// Channel args to be included in resolver results.
+ 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 result handler to be used by the resolver.
+ std::unique_ptr<Resolver::ResultHandler> result_handler;
+};
+
+class ResolverFactory {
+ public:
+ virtual ~ResolverFactory() {}
+
+ /// Returns the URI scheme that this factory implements.
+ /// Caller does NOT take ownership of result.
+ virtual absl::string_view scheme() const = 0;
+
+ /// Returns a bool indicating whether the input uri is valid to create a
+ /// resolver.
+ virtual bool IsValidUri(const URI& uri) const = 0;
+
+ /// Returns a new resolver instance.
+ virtual OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const = 0;
+
+ /// Returns a string representing the default authority to use for this
+ /// scheme.
+ virtual std::string GetDefaultAuthority(const URI& uri) const {
+ return std::string(absl::StripPrefix(uri.path(), "/"));
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOLVER_RESOLVER_FACTORY_H
diff --git a/grpc/src/core/lib/resolver/resolver_registry.cc b/grpc/src/core/lib/resolver/resolver_registry.cc
new file mode 100644
index 00000000..8333bfd2
--- /dev/null
+++ b/grpc/src/core/lib/resolver/resolver_registry.cc
@@ -0,0 +1,156 @@
+//
+// 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/lib/resolver/resolver_registry.h"
+
+#include <string.h>
+
+#include <vector>
+
+#include "absl/memory/memory.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/resolver/resolver_registry.h"
+
+namespace grpc_core {
+
+//
+// ResolverRegistry::Builder
+//
+
+ResolverRegistry::Builder::Builder() { Reset(); }
+
+void ResolverRegistry::Builder::SetDefaultPrefix(std::string default_prefix) {
+ state_.default_prefix = std::move(default_prefix);
+}
+
+void ResolverRegistry::Builder::RegisterResolverFactory(
+ std::unique_ptr<ResolverFactory> factory) {
+ auto p = state_.factories.emplace(factory->scheme(), std::move(factory));
+ GPR_ASSERT(p.second);
+}
+
+bool ResolverRegistry::Builder::HasResolverFactory(
+ absl::string_view scheme) const {
+ return state_.factories.find(scheme) != state_.factories.end();
+}
+
+void ResolverRegistry::Builder::Reset() {
+ state_.factories.clear();
+ state_.default_prefix = "dns:///";
+}
+
+ResolverRegistry ResolverRegistry::Builder::Build() {
+ return ResolverRegistry(std::move(state_));
+}
+
+//
+// ResolverRegistry
+//
+
+bool ResolverRegistry::IsValidTarget(absl::string_view target) const {
+ std::string canonical_target;
+ URI uri;
+ ResolverFactory* factory =
+ FindResolverFactory(target, &uri, &canonical_target);
+ if (factory == nullptr) return false;
+ return factory->IsValidUri(uri);
+}
+
+OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
+ absl::string_view target, const grpc_channel_args* args,
+ grpc_pollset_set* pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer,
+ std::unique_ptr<Resolver::ResultHandler> result_handler) const {
+ std::string canonical_target;
+ ResolverArgs resolver_args;
+ ResolverFactory* factory =
+ FindResolverFactory(target, &resolver_args.uri, &canonical_target);
+ if (factory == nullptr) return nullptr;
+ resolver_args.args = args;
+ resolver_args.pollset_set = pollset_set;
+ resolver_args.work_serializer = std::move(work_serializer);
+ resolver_args.result_handler = std::move(result_handler);
+ return factory->CreateResolver(std::move(resolver_args));
+}
+
+std::string ResolverRegistry::GetDefaultAuthority(
+ absl::string_view target) const {
+ std::string canonical_target;
+ URI uri;
+ ResolverFactory* factory =
+ FindResolverFactory(target, &uri, &canonical_target);
+ if (factory == nullptr) return "";
+ return factory->GetDefaultAuthority(uri);
+}
+
+std::string ResolverRegistry::AddDefaultPrefixIfNeeded(
+ absl::string_view target) const {
+ std::string canonical_target;
+ URI uri;
+ FindResolverFactory(target, &uri, &canonical_target);
+ return canonical_target.empty() ? std::string(target) : canonical_target;
+}
+
+ResolverFactory* ResolverRegistry::LookupResolverFactory(
+ absl::string_view scheme) const {
+ auto it = state_.factories.find(scheme);
+ if (it == state_.factories.end()) return nullptr;
+ return it->second.get();
+}
+
+// Returns the factory for the scheme of \a target. If \a target does
+// not parse as a URI, prepends \a default_prefix_ and tries again.
+// If URI parsing is successful (in either attempt), sets \a uri to
+// point to the parsed URI.
+ResolverFactory* ResolverRegistry::FindResolverFactory(
+ absl::string_view target, URI* uri, std::string* canonical_target) const {
+ GPR_ASSERT(uri != nullptr);
+ absl::StatusOr<URI> tmp_uri = URI::Parse(target);
+ ResolverFactory* factory =
+ tmp_uri.ok() ? LookupResolverFactory(tmp_uri->scheme()) : nullptr;
+ if (factory != nullptr) {
+ *uri = std::move(*tmp_uri);
+ return factory;
+ }
+ *canonical_target = absl::StrCat(state_.default_prefix, target);
+ absl::StatusOr<URI> tmp_uri2 = URI::Parse(*canonical_target);
+ factory = tmp_uri2.ok() ? LookupResolverFactory(tmp_uri2->scheme()) : nullptr;
+ if (factory != nullptr) {
+ *uri = std::move(*tmp_uri2);
+ return factory;
+ }
+ if (!tmp_uri.ok() || !tmp_uri2.ok()) {
+ gpr_log(GPR_ERROR, "%s",
+ absl::StrFormat("Error parsing URI(s). '%s':%s; '%s':%s", target,
+ tmp_uri.status().ToString(), *canonical_target,
+ tmp_uri2.status().ToString())
+ .c_str());
+ return nullptr;
+ }
+ gpr_log(GPR_ERROR, "Don't know how to resolve '%s' or '%s'.",
+ std::string(target).c_str(), canonical_target->c_str());
+ return nullptr;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resolver/resolver_registry.h b/grpc/src/core/lib/resolver/resolver_registry.h
new file mode 100644
index 00000000..ab96aae7
--- /dev/null
+++ b/grpc/src/core/lib/resolver/resolver_registry.h
@@ -0,0 +1,113 @@
+//
+// 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_RESOLVER_RESOLVER_REGISTRY_H
+#define GRPC_CORE_LIB_RESOLVER_RESOLVER_REGISTRY_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/resolver/resolver_factory.h"
+
+namespace grpc_core {
+
+class ResolverRegistry {
+ private:
+ // Forward declaration needed to use this in Builder.
+ struct State {
+ std::map<absl::string_view, std::unique_ptr<ResolverFactory>> factories;
+ std::string default_prefix;
+ };
+
+ public:
+ /// Methods used to create and populate the ResolverRegistry.
+ /// NOT THREAD SAFE -- to be used only during global gRPC
+ /// initialization and shutdown.
+ class Builder {
+ public:
+ Builder();
+
+ /// Sets the default URI prefix to \a default_prefix.
+ void SetDefaultPrefix(std::string default_prefix);
+
+ /// Registers a resolver factory. The factory will be used to create a
+ /// resolver for any URI whose scheme matches that of the factory.
+ void RegisterResolverFactory(std::unique_ptr<ResolverFactory> factory);
+
+ /// Returns true iff scheme already has a registered factory.
+ bool HasResolverFactory(absl::string_view scheme) const;
+
+ /// Wipe everything in the registry and reset to empty.
+ void Reset();
+
+ ResolverRegistry Build();
+
+ private:
+ ResolverRegistry::State state_;
+ };
+
+ ResolverRegistry(const ResolverRegistry&) = delete;
+ ResolverRegistry& operator=(const ResolverRegistry&) = delete;
+ ResolverRegistry(ResolverRegistry&&) noexcept;
+ ResolverRegistry& operator=(ResolverRegistry&&) noexcept;
+
+ /// Checks whether the user input \a target is valid to create a resolver.
+ bool IsValidTarget(absl::string_view target) const;
+
+ /// Creates a resolver given \a target.
+ /// First tries to parse \a target as a URI. If this succeeds, tries
+ /// to locate a registered resolver factory based on the URI scheme.
+ /// If parsing fails or there is no factory for the URI's scheme,
+ /// 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.
+ OrphanablePtr<Resolver> CreateResolver(
+ absl::string_view target, const grpc_channel_args* args,
+ grpc_pollset_set* pollset_set,
+ std::shared_ptr<WorkSerializer> work_serializer,
+ std::unique_ptr<Resolver::ResultHandler> result_handler) const;
+
+ /// Returns the default authority to pass from a client for \a target.
+ std::string GetDefaultAuthority(absl::string_view target) const;
+
+ /// Returns \a target with the default prefix prepended, if needed.
+ std::string AddDefaultPrefixIfNeeded(absl::string_view target) const;
+
+ /// Returns the resolver factory for \a scheme.
+ /// Caller does NOT own the return value.
+ ResolverFactory* LookupResolverFactory(absl::string_view scheme) const;
+
+ private:
+ explicit ResolverRegistry(State state) : state_(std::move(state)) {}
+
+ // TODO(ctiller): fix callers such that the canonical_target argument can be
+ // removed, and replaced with uri.ToString().
+ ResolverFactory* FindResolverFactory(absl::string_view target, URI* uri,
+ std::string* canonical_target) const;
+
+ State state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOLVER_RESOLVER_REGISTRY_H
diff --git a/grpc/src/core/lib/resolver/server_address.cc b/grpc/src/core/lib/resolver/server_address.cc
new file mode 100644
index 00000000..aa9bfeea
--- /dev/null
+++ b/grpc/src/core/lib/resolver/server_address.cc
@@ -0,0 +1,170 @@
+/*
+ *
+ * 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/resolver/server_address.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/str_join.h"
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+
+namespace grpc_core {
+
+//
+// ServerAddressWeightAttribute
+//
+const char* ServerAddressWeightAttribute::kServerAddressWeightAttributeKey =
+ "server_address_weight";
+
+//
+// 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 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) {
+ if (&other == this) {
+ return *this;
+ }
+ 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;
+}
+
+std::string ServerAddress::ToString() const {
+ std::vector<std::string> parts = {
+ grpc_sockaddr_to_string(&address_, false),
+ };
+ if (args_ != nullptr) {
+ parts.emplace_back(
+ absl::StrCat("args={", grpc_channel_args_string(args_), "}"));
+ }
+ if (!attributes_.empty()) {
+ std::vector<std::string> attrs;
+ for (const auto& p : attributes_) {
+ attrs.emplace_back(absl::StrCat(p.first, "=", p.second->ToString()));
+ }
+ parts.emplace_back(
+ absl::StrCat("attributes={", absl::StrJoin(attrs, ", "), "}"));
+ }
+ return absl::StrJoin(parts, " ");
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resolver/server_address.h b/grpc/src/core/lib/resolver/server_address.h
new file mode 100644
index 00000000..db1c456a
--- /dev/null
+++ b/grpc/src/core/lib/resolver/server_address.h
@@ -0,0 +1,144 @@
+/*
+ *
+ * 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_RESOLVER_SERVER_ADDRESS_H
+#define GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <memory>
+
+#include "absl/container/inlined_vector.h"
+#include "absl/strings/str_format.h"
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/resolved_address.h"
+
+namespace grpc_core {
+
+//
+// ServerAddress
+//
+
+// A server address is a grpc_resolved_address with an associated set of
+// channel args. Any args present here will be merged into the channel
+// 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 std::string 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 void* address, size_t address_len,
+ 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);
+
+ // Movable.
+ ServerAddress(ServerAddress&& other) noexcept;
+ ServerAddress& operator=(ServerAddress&& other) noexcept;
+
+ bool operator==(const ServerAddress& other) const { return Cmp(other) == 0; }
+
+ 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;
+
+ std::string ToString() const;
+
+ private:
+ grpc_resolved_address address_;
+ grpc_channel_args* args_;
+ std::map<const char*, std::unique_ptr<AttributeInterface>> attributes_;
+};
+
+//
+// ServerAddressList
+//
+
+typedef absl::InlinedVector<ServerAddress, 1> ServerAddressList;
+
+//
+// ServerAddressWeightAttribute
+//
+class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
+ public:
+ static const char* kServerAddressWeightAttributeKey;
+
+ explicit ServerAddressWeightAttribute(uint32_t weight) : weight_(weight) {}
+
+ uint32_t weight() const { return weight_; }
+
+ std::unique_ptr<AttributeInterface> Copy() const override {
+ return absl::make_unique<ServerAddressWeightAttribute>(weight_);
+ }
+
+ int Cmp(const AttributeInterface* other) const override {
+ const auto* other_locality_attr =
+ static_cast<const ServerAddressWeightAttribute*>(other);
+ return QsortCompare(weight_, other_locality_attr->weight_);
+ }
+
+ std::string ToString() const override {
+ return absl::StrFormat("%d", weight_);
+ }
+
+ private:
+ uint32_t weight_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H */
diff --git a/grpc/src/core/lib/resource_quota/api.cc b/grpc/src/core/lib/resource_quota/api.cc
new file mode 100644
index 00000000..2cad657f
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/api.cc
@@ -0,0 +1,83 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/resource_quota/api.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
+
+namespace grpc_core {
+
+ResourceQuotaRefPtr ResourceQuotaFromChannelArgs(
+ const grpc_channel_args* args) {
+ return grpc_channel_args_find_pointer<ResourceQuota>(args,
+ GRPC_ARG_RESOURCE_QUOTA)
+ ->Ref();
+}
+
+ChannelArgs EnsureResourceQuotaInChannelArgs(ChannelArgs args) {
+ if (args.GetObject<ResourceQuota>() != nullptr) return args;
+ // If there's no existing quota, add it to the default one - shared between
+ // all channel args declared thusly. This prevents us from accidentally not
+ // sharing subchannels due to their channel args not specifying a quota.
+ return args.SetObject(ResourceQuota::Default());
+}
+
+void RegisterResourceQuota(CoreConfiguration::Builder* builder) {
+ builder->channel_args_preconditioning()->RegisterStage(
+ EnsureResourceQuotaInChannelArgs);
+}
+
+} // namespace grpc_core
+
+extern "C" const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable() {
+ return grpc_core::ChannelArgTypeTraits<grpc_core::ResourceQuota>::VTable();
+}
+
+extern "C" grpc_resource_quota* grpc_resource_quota_create(const char* name) {
+ static std::atomic<uintptr_t> anonymous_counter{0};
+ std::string quota_name =
+ name == nullptr
+ ? absl::StrCat("anonymous-quota-", anonymous_counter.fetch_add(1))
+ : name;
+ return (new grpc_core::ResourceQuota(std::move(quota_name)))->c_ptr();
+}
+
+extern "C" void grpc_resource_quota_ref(grpc_resource_quota* resource_quota) {
+ grpc_core::ResourceQuota::FromC(resource_quota)->Ref().release();
+}
+
+extern "C" void grpc_resource_quota_unref(grpc_resource_quota* resource_quota) {
+ grpc_core::ResourceQuota::FromC(resource_quota)->Unref();
+}
+
+extern "C" void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
+ size_t new_size) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::ResourceQuota::FromC(resource_quota)
+ ->memory_quota()
+ ->SetSize(new_size);
+}
+
+extern "C" void grpc_resource_quota_set_max_threads(
+ grpc_resource_quota* resource_quota, int new_max_threads) {
+ grpc_core::ResourceQuota::FromC(resource_quota)
+ ->thread_quota()
+ ->SetMax(new_max_threads);
+}
diff --git a/grpc/src/core/lib/resource_quota/api.h b/grpc/src/core/lib/resource_quota/api.h
new file mode 100644
index 00000000..42c44ad8
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/api.h
@@ -0,0 +1,40 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOURCE_QUOTA_API_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_API_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
+
+typedef struct grpc_resource_quota grpc_resource_quota;
+
+namespace grpc_core {
+
+// TODO(ctiller): This is a hack. We need to do real accounting instead of
+// hard coding.
+constexpr size_t kResourceQuotaChannelSize = 34 * 1024;
+
+// Retrieve the resource quota from the channel args.
+// UB if not set.
+ResourceQuotaRefPtr ResourceQuotaFromChannelArgs(const grpc_channel_args* args);
+
+void RegisterResourceQuota(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_API_H
diff --git a/grpc/src/core/lib/resource_quota/arena.cc b/grpc/src/core/lib/resource_quota/arena.cc
new file mode 100644
index 00000000..7d7e1857
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/arena.cc
@@ -0,0 +1,107 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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/resource_quota/arena.h"
+
+#include <string.h>
+
+#include <new>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/gpr/alloc.h"
+#include "src/core/lib/gprpp/memory.h"
+
+namespace {
+
+void* ArenaStorage(size_t initial_size) {
+ static constexpr size_t base_size =
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_core::Arena));
+ initial_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
+ size_t alloc_size = base_size + initial_size;
+ static constexpr size_t alignment =
+ (GPR_CACHELINE_SIZE > GPR_MAX_ALIGNMENT &&
+ GPR_CACHELINE_SIZE % GPR_MAX_ALIGNMENT == 0)
+ ? GPR_CACHELINE_SIZE
+ : GPR_MAX_ALIGNMENT;
+ return gpr_malloc_aligned(alloc_size, alignment);
+}
+
+} // namespace
+
+namespace grpc_core {
+
+Arena::~Arena() {
+ Zone* z = last_zone_;
+ while (z) {
+ Zone* prev_z = z->prev;
+ z->~Zone();
+ gpr_free_aligned(z);
+ z = prev_z;
+ }
+}
+
+Arena* Arena::Create(size_t initial_size, MemoryAllocator* memory_allocator) {
+ return new (ArenaStorage(initial_size))
+ Arena(initial_size, 0, memory_allocator);
+}
+
+std::pair<Arena*, void*> Arena::CreateWithAlloc(
+ size_t initial_size, size_t alloc_size, MemoryAllocator* memory_allocator) {
+ static constexpr size_t base_size =
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
+ auto* new_arena = new (ArenaStorage(initial_size))
+ Arena(initial_size, alloc_size, memory_allocator);
+ void* first_alloc = reinterpret_cast<char*>(new_arena) + base_size;
+ return std::make_pair(new_arena, first_alloc);
+}
+
+size_t Arena::Destroy() {
+ size_t size = total_used_.load(std::memory_order_relaxed);
+ memory_allocator_->Release(total_allocated_.load(std::memory_order_relaxed));
+ this->~Arena();
+ gpr_free_aligned(this);
+ return size;
+}
+
+void* Arena::AllocZone(size_t size) {
+ // If the allocation isn't able to end in the initial zone, create a new
+ // zone for this allocation, and any unused space in the initial zone is
+ // wasted. This overflowing and wasting is uncommon because of our arena
+ // sizing hysteresis (that is, most calls should have a large enough initial
+ // zone and will not need to grow the arena).
+ static constexpr size_t zone_base_size =
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Zone));
+ size_t alloc_size = zone_base_size + size;
+ memory_allocator_->Reserve(alloc_size);
+ total_allocated_.fetch_add(alloc_size, std::memory_order_relaxed);
+ Zone* z = new (gpr_malloc_aligned(alloc_size, GPR_MAX_ALIGNMENT)) Zone();
+ auto* prev = last_zone_.load(std::memory_order_relaxed);
+ do {
+ z->prev = prev;
+ } while (!last_zone_.compare_exchange_weak(prev, z, std::memory_order_relaxed,
+ std::memory_order_relaxed));
+ return reinterpret_cast<char*>(z) + zone_base_size;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resource_quota/arena.h b/grpc/src/core/lib/resource_quota/arena.h
new file mode 100644
index 00000000..542b09a3
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/arena.h
@@ -0,0 +1,142 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// \file Arena based allocator
+// Allows very fast allocation of memory, but that memory cannot be freed until
+// the arena as a whole is freed
+// Tracks the total memory allocated against it, so that future arenas can
+// pre-allocate the right amount of memory
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include <atomic>
+#include <memory>
+#include <new>
+#include <utility>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/gpr/alloc.h"
+#include "src/core/lib/promise/context.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+
+namespace grpc_core {
+
+class Arena {
+ public:
+ // Create an arena, with \a initial_size bytes in the first allocated buffer.
+ static Arena* Create(size_t initial_size, MemoryAllocator* memory_allocator);
+
+ // Create an arena, with \a initial_size bytes in the first allocated buffer,
+ // and return both a void pointer to the returned arena and a void* with the
+ // first allocation.
+ static std::pair<Arena*, void*> CreateWithAlloc(
+ size_t initial_size, size_t alloc_size,
+ MemoryAllocator* memory_allocator);
+
+ // Destroy an arena, returning the total number of bytes allocated.
+ size_t Destroy();
+ // Allocate \a size bytes from the arena.
+ void* Alloc(size_t size) {
+ static constexpr size_t base_size =
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
+ size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(size);
+ size_t begin = total_used_.fetch_add(size, std::memory_order_relaxed);
+ if (begin + size <= initial_zone_size_) {
+ return reinterpret_cast<char*>(this) + base_size + begin;
+ } else {
+ return AllocZone(size);
+ }
+ }
+
+ // TODO(roth): We currently assume that all callers need alignment of 16
+ // bytes, which may be wrong in some cases. When we have time, we should
+ // change this to instead use the alignment of the type being allocated by
+ // this method.
+ template <typename T, typename... Args>
+ T* New(Args&&... args) {
+ T* t = static_cast<T*>(Alloc(sizeof(T)));
+ new (t) T(std::forward<Args>(args)...);
+ return t;
+ }
+
+ private:
+ struct Zone {
+ Zone* prev;
+ };
+
+ // Initialize an arena.
+ // Parameters:
+ // initial_size: The initial size of the whole arena in bytes. These bytes
+ // are contained within 'zone 0'. If the arena user ends up requiring more
+ // memory than the arena contains in zone 0, subsequent zones are allocated
+ // on demand and maintained in a tail-linked list.
+ //
+ // initial_alloc: Optionally, construct the arena as though a call to
+ // Alloc() had already been made for initial_alloc bytes. This provides a
+ // quick optimization (avoiding an atomic fetch-add) for the common case
+ // where we wish to create an arena and then perform an immediate
+ // allocation.
+ explicit Arena(size_t initial_size, size_t initial_alloc,
+ MemoryAllocator* memory_allocator)
+ : total_used_(GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_alloc)),
+ initial_zone_size_(initial_size),
+ memory_allocator_(memory_allocator) {}
+
+ ~Arena();
+
+ void* AllocZone(size_t size);
+
+ // Keep track of the total used size. We use this in our call sizing
+ // hysteresis.
+ std::atomic<size_t> total_used_{0};
+ std::atomic<size_t> total_allocated_{0};
+ const size_t initial_zone_size_;
+ // If the initial arena allocation wasn't enough, we allocate additional zones
+ // in a reverse linked list. Each additional zone consists of (1) a pointer to
+ // the zone added before this zone (null if this is the first additional zone)
+ // and (2) the allocated memory. The arena itself maintains a pointer to the
+ // last zone; the zone list is reverse-walked during arena destruction only.
+ std::atomic<Zone*> last_zone_{nullptr};
+ // The backing memory quota
+ MemoryAllocator* const memory_allocator_;
+};
+
+// Smart pointer for arenas when the final size is not required.
+struct ScopedArenaDeleter {
+ void operator()(Arena* arena) { arena->Destroy(); }
+};
+using ScopedArenaPtr = std::unique_ptr<Arena, ScopedArenaDeleter>;
+inline ScopedArenaPtr MakeScopedArena(size_t initial_size,
+ MemoryAllocator* memory_allocator) {
+ return ScopedArenaPtr(Arena::Create(initial_size, memory_allocator));
+}
+
+// Arenas form a context for activities
+template <>
+struct ContextType<Arena> {};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H */
diff --git a/grpc/src/core/lib/resource_quota/memory_quota.cc b/grpc/src/core/lib/resource_quota/memory_quota.cc
new file mode 100644
index 00000000..d4799095
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/memory_quota.cc
@@ -0,0 +1,478 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/resource_quota/memory_quota.h"
+
+#include <atomic>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/mpscq.h"
+#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
+#include "src/core/lib/promise/loop.h"
+#include "src/core/lib/promise/map.h"
+#include "src/core/lib/promise/race.h"
+#include "src/core/lib/promise/seq.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/trace.h"
+
+namespace grpc_core {
+
+// Maximum number of bytes an allocator will request from a quota in one step.
+// Larger allocations than this will require multiple allocation requests.
+static constexpr size_t kMaxReplenishBytes = 1024 * 1024;
+
+// Minimum number of bytes an allocator will request from a quota in one step.
+static constexpr size_t kMinReplenishBytes = 4096;
+
+//
+// Reclaimer
+//
+
+ReclamationSweep::~ReclamationSweep() {
+ if (memory_quota_ != nullptr) {
+ memory_quota_->FinishReclamation(sweep_token_, std::move(waker_));
+ }
+}
+
+//
+// ReclaimerQueue
+//
+
+struct ReclaimerQueue::QueuedNode
+ : public MultiProducerSingleConsumerQueue::Node {
+ explicit QueuedNode(RefCountedPtr<Handle> reclaimer_handle)
+ : reclaimer_handle(std::move(reclaimer_handle)) {}
+ RefCountedPtr<Handle> reclaimer_handle;
+};
+
+struct ReclaimerQueue::State {
+ Mutex reader_mu;
+ MultiProducerSingleConsumerQueue queue; // reader_mu must be held to pop
+ Waker waker ABSL_GUARDED_BY(reader_mu);
+
+ ~State() {
+ bool empty = false;
+ do {
+ delete static_cast<QueuedNode*>(queue.PopAndCheckEnd(&empty));
+ } while (!empty);
+ }
+};
+
+void ReclaimerQueue::Handle::Orphan() {
+ if (auto* sweep = sweep_.exchange(nullptr, std::memory_order_acq_rel)) {
+ sweep->RunAndDelete(absl::nullopt);
+ }
+ Unref();
+}
+
+void ReclaimerQueue::Handle::Run(ReclamationSweep reclamation_sweep) {
+ if (auto* sweep = sweep_.exchange(nullptr, std::memory_order_acq_rel)) {
+ sweep->RunAndDelete(std::move(reclamation_sweep));
+ }
+}
+
+bool ReclaimerQueue::Handle::Requeue(ReclaimerQueue* new_queue) {
+ if (sweep_.load(std::memory_order_relaxed)) {
+ new_queue->Enqueue(Ref());
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void ReclaimerQueue::Handle::Sweep::MarkCancelled() {
+ // When we cancel a reclaimer we rotate the elements of the queue once -
+ // taking one non-cancelled node from the start, and placing it on the end.
+ // This ensures that we don't suffer from head of line blocking whereby a
+ // non-cancelled reclaimer at the head of the queue, in the absence of memory
+ // pressure, prevents the remainder of the queue from being cleaned up.
+ MutexLock lock(&state_->reader_mu);
+ while (true) {
+ bool empty = false;
+ std::unique_ptr<QueuedNode> node(
+ static_cast<QueuedNode*>(state_->queue.PopAndCheckEnd(&empty)));
+ if (node == nullptr) break;
+ if (node->reclaimer_handle->sweep_.load(std::memory_order_relaxed) !=
+ nullptr) {
+ state_->queue.Push(node.release());
+ break;
+ }
+ }
+}
+
+ReclaimerQueue::ReclaimerQueue() : state_(std::make_shared<State>()) {}
+
+ReclaimerQueue::~ReclaimerQueue() = default;
+
+void ReclaimerQueue::Enqueue(RefCountedPtr<Handle> handle) {
+ if (state_->queue.Push(new QueuedNode(std::move(handle)))) {
+ MutexLock lock(&state_->reader_mu);
+ state_->waker.Wakeup();
+ }
+}
+
+Poll<RefCountedPtr<ReclaimerQueue::Handle>> ReclaimerQueue::PollNext() {
+ MutexLock lock(&state_->reader_mu);
+ bool empty = false;
+ // Try to pull from the queue.
+ std::unique_ptr<QueuedNode> node(
+ static_cast<QueuedNode*>(state_->queue.PopAndCheckEnd(&empty)));
+ // If we get something, great.
+ if (node != nullptr) return std::move(node->reclaimer_handle);
+ if (!empty) {
+ // If we don't, but the queue is probably not empty, schedule an immediate
+ // repoll.
+ Activity::current()->ForceImmediateRepoll();
+ } else {
+ // Otherwise, schedule a wakeup for whenever something is pushed.
+ state_->waker = Activity::current()->MakeNonOwningWaker();
+ }
+ return Pending{};
+}
+
+//
+// GrpcMemoryAllocatorImpl
+//
+
+GrpcMemoryAllocatorImpl::GrpcMemoryAllocatorImpl(
+ std::shared_ptr<BasicMemoryQuota> memory_quota, std::string name)
+ : memory_quota_(memory_quota), name_(std::move(name)) {
+ memory_quota_->Take(taken_bytes_);
+}
+
+GrpcMemoryAllocatorImpl::~GrpcMemoryAllocatorImpl() {
+ GPR_ASSERT(free_bytes_.load(std::memory_order_acquire) +
+ sizeof(GrpcMemoryAllocatorImpl) ==
+ taken_bytes_);
+ memory_quota_->Return(taken_bytes_);
+}
+
+void GrpcMemoryAllocatorImpl::Shutdown() {
+ std::shared_ptr<BasicMemoryQuota> memory_quota;
+ OrphanablePtr<ReclaimerQueue::Handle>
+ reclamation_handles[kNumReclamationPasses];
+ {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ shutdown_ = true;
+ memory_quota = memory_quota_;
+ for (size_t i = 0; i < kNumReclamationPasses; i++) {
+ reclamation_handles[i] = absl::exchange(reclamation_handles_[i], nullptr);
+ }
+ }
+}
+
+size_t GrpcMemoryAllocatorImpl::Reserve(MemoryRequest request) {
+ // Validate request - performed here so we don't bloat the generated code with
+ // inlined asserts.
+ GPR_ASSERT(request.min() <= request.max());
+ GPR_ASSERT(request.max() <= MemoryRequest::max_allowed_size());
+ while (true) {
+ // Attempt to reserve memory from our pool.
+ auto reservation = TryReserve(request);
+ if (reservation.has_value()) return *reservation;
+ // If that failed, grab more from the quota and retry.
+ Replenish();
+ }
+}
+
+absl::optional<size_t> GrpcMemoryAllocatorImpl::TryReserve(
+ MemoryRequest request) {
+ // How much memory should we request? (see the scaling below)
+ size_t scaled_size_over_min = request.max() - request.min();
+ // Scale the request down according to memory pressure if we have that
+ // flexibility.
+ if (scaled_size_over_min != 0) {
+ double pressure;
+ size_t max_recommended_allocation_size;
+ {
+ MutexLock lock(&memory_quota_mu_);
+ const auto pressure_and_max_recommended_allocation_size =
+ memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize();
+ pressure = pressure_and_max_recommended_allocation_size.first;
+ max_recommended_allocation_size =
+ pressure_and_max_recommended_allocation_size.second;
+ }
+ // Reduce allocation size proportional to the pressure > 80% usage.
+ if (pressure > 0.8) {
+ scaled_size_over_min =
+ std::min(scaled_size_over_min,
+ static_cast<size_t>((request.max() - request.min()) *
+ (1.0 - pressure) / 0.2));
+ }
+ if (max_recommended_allocation_size < request.min()) {
+ scaled_size_over_min = 0;
+ } else if (request.min() + scaled_size_over_min >
+ max_recommended_allocation_size) {
+ scaled_size_over_min = max_recommended_allocation_size - request.min();
+ }
+ }
+
+ // How much do we want to reserve?
+ const size_t reserve = request.min() + scaled_size_over_min;
+ // See how many bytes are available.
+ size_t available = free_bytes_.load(std::memory_order_acquire);
+ while (true) {
+ // Does the current free pool satisfy the request?
+ if (available < reserve) {
+ return {};
+ }
+ // Try to reserve the requested amount.
+ // If the amount of free memory changed through this loop, then available
+ // will be set to the new value and we'll repeat.
+ if (free_bytes_.compare_exchange_weak(available, available - reserve,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ return reserve;
+ }
+ }
+}
+
+void GrpcMemoryAllocatorImpl::Replenish() {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ // Attempt a fairly low rate exponential growth request size, bounded between
+ // some reasonable limits declared at top of file.
+ auto amount = Clamp(taken_bytes_ / 3, kMinReplenishBytes, kMaxReplenishBytes);
+ // Take the requested amount from the quota.
+ memory_quota_->Take(amount);
+ // Record that we've taken it.
+ taken_bytes_ += amount;
+ // Add the taken amount to the free pool.
+ free_bytes_.fetch_add(amount, std::memory_order_acq_rel);
+ // See if we can add ourselves as a reclaimer.
+ MaybeRegisterReclaimerLocked();
+}
+
+void GrpcMemoryAllocatorImpl::MaybeRegisterReclaimer() {
+ MutexLock lock(&memory_quota_mu_);
+ MaybeRegisterReclaimerLocked();
+}
+
+void GrpcMemoryAllocatorImpl::MaybeRegisterReclaimerLocked() {
+ // If the reclaimer is already registered, then there's nothing to do.
+ if (registered_reclaimer_) return;
+ if (shutdown_) return;
+ // Grab references to the things we'll need
+ auto self = shared_from_this();
+ std::weak_ptr<EventEngineMemoryAllocatorImpl> self_weak{self};
+ registered_reclaimer_ = true;
+ InsertReclaimer(0, [self_weak](absl::optional<ReclamationSweep> sweep) {
+ if (!sweep.has_value()) return;
+ auto self = self_weak.lock();
+ if (self == nullptr) return;
+ auto* p = static_cast<GrpcMemoryAllocatorImpl*>(self.get());
+ MutexLock lock(&p->memory_quota_mu_);
+ p->registered_reclaimer_ = false;
+ // Figure out how many bytes we can return to the quota.
+ size_t return_bytes = p->free_bytes_.exchange(0, std::memory_order_acq_rel);
+ if (return_bytes == 0) return;
+ // Subtract that from our outstanding balance.
+ p->taken_bytes_ -= return_bytes;
+ // And return them to the quota.
+ p->memory_quota_->Return(return_bytes);
+ });
+}
+
+void GrpcMemoryAllocatorImpl::Rebind(
+ std::shared_ptr<BasicMemoryQuota> memory_quota) {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ if (memory_quota_ == memory_quota) return;
+ // Return memory to the original memory quota.
+ memory_quota_->Return(taken_bytes_);
+ // Reassign any queued reclaimers
+ for (size_t i = 0; i < kNumReclamationPasses; i++) {
+ if (reclamation_handles_[i] != nullptr) {
+ reclamation_handles_[i]->Requeue(memory_quota->reclaimer_queue(i));
+ }
+ }
+ // Switch to the new memory quota, leaving the old one in memory_quota so that
+ // when we unref it, we are outside of lock.
+ memory_quota_.swap(memory_quota);
+ // Drop our freed memory down to zero, to avoid needing to ask the new
+ // quota for memory we're not currently using.
+ taken_bytes_ -= free_bytes_.exchange(0, std::memory_order_acq_rel);
+ // And let the new quota know how much we're already using.
+ memory_quota_->Take(taken_bytes_);
+}
+
+//
+// MemoryOwner
+//
+
+void MemoryOwner::Rebind(MemoryQuota* quota) {
+ impl()->Rebind(quota->memory_quota_);
+}
+
+//
+// BasicMemoryQuota
+//
+
+class BasicMemoryQuota::WaitForSweepPromise {
+ public:
+ WaitForSweepPromise(std::shared_ptr<BasicMemoryQuota> memory_quota,
+ uint64_t token)
+ : memory_quota_(std::move(memory_quota)), token_(token) {}
+
+ struct Empty {};
+ Poll<Empty> operator()() {
+ if (memory_quota_->reclamation_counter_.load(std::memory_order_relaxed) !=
+ token_) {
+ return Empty{};
+ } else {
+ return Pending{};
+ }
+ }
+
+ private:
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+ uint64_t token_;
+};
+
+void BasicMemoryQuota::Start() {
+ auto self = shared_from_this();
+
+ // Reclamation loop:
+ // basically, wait until we are in overcommit (free_bytes_ < 0), and then:
+ // while (free_bytes_ < 0) reclaim_memory()
+ // ... and repeat
+ auto reclamation_loop = Loop(Seq(
+ [self]() -> Poll<int> {
+ // If there's free memory we no longer need to reclaim memory!
+ if (self->free_bytes_.load(std::memory_order_acquire) > 0) {
+ return Pending{};
+ }
+ return 0;
+ },
+ [self]() {
+ // Race biases to the first thing that completes... so this will
+ // choose the highest priority/least destructive thing to do that's
+ // available.
+ auto annotate = [](const char* name) {
+ return [name](RefCountedPtr<ReclaimerQueue::Handle> f) {
+ return std::make_tuple(name, std::move(f));
+ };
+ };
+ return Race(Map(self->reclaimers_[0].Next(), annotate("compact")),
+ Map(self->reclaimers_[1].Next(), annotate("benign")),
+ Map(self->reclaimers_[2].Next(), annotate("idle")),
+ Map(self->reclaimers_[3].Next(), annotate("destructive")));
+ },
+ [self](
+ std::tuple<const char*, RefCountedPtr<ReclaimerQueue::Handle>> arg) {
+ auto reclaimer = std::move(std::get<1>(arg));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO, "RQ: %s perform %s reclamation",
+ self->name_.c_str(), std::get<0>(arg));
+ }
+ // One of the reclaimer queues gave us a way to get back memory.
+ // Call the reclaimer with a token that contains enough to wake us
+ // up again.
+ const uint64_t token =
+ self->reclamation_counter_.fetch_add(1, std::memory_order_relaxed) +
+ 1;
+ reclaimer->Run(ReclamationSweep(
+ self, token, Activity::current()->MakeNonOwningWaker()));
+ // Return a promise that will wait for our barrier. This will be
+ // awoken by the token above being destroyed. So, once that token is
+ // destroyed, we'll be able to proceed.
+ return WaitForSweepPromise(self, token);
+ },
+ []() -> LoopCtl<absl::Status> {
+ // Continue the loop!
+ return Continue{};
+ }));
+
+ reclaimer_activity_ =
+ MakeActivity(std::move(reclamation_loop), ExecCtxWakeupScheduler(),
+ [](absl::Status status) {
+ GPR_ASSERT(status.code() == absl::StatusCode::kCancelled);
+ });
+}
+
+void BasicMemoryQuota::Stop() { reclaimer_activity_.reset(); }
+
+void BasicMemoryQuota::SetSize(size_t new_size) {
+ size_t old_size = quota_size_.exchange(new_size, std::memory_order_relaxed);
+ if (old_size < new_size) {
+ // We're growing the quota.
+ Return(new_size - old_size);
+ } else {
+ // We're shrinking the quota.
+ Take(old_size - new_size);
+ }
+}
+
+void BasicMemoryQuota::Take(size_t amount) {
+ // If there's a request for nothing, then do nothing!
+ if (amount == 0) return;
+ GPR_DEBUG_ASSERT(amount <= std::numeric_limits<intptr_t>::max());
+ // Grab memory from the quota.
+ auto prior = free_bytes_.fetch_sub(amount, std::memory_order_acq_rel);
+ // If we push into overcommit, awake the reclaimer.
+ if (prior >= 0 && prior < static_cast<intptr_t>(amount)) {
+ if (reclaimer_activity_ != nullptr) reclaimer_activity_->ForceWakeup();
+ }
+}
+
+void BasicMemoryQuota::FinishReclamation(uint64_t token, Waker waker) {
+ uint64_t current = reclamation_counter_.load(std::memory_order_relaxed);
+ if (current != token) return;
+ if (reclamation_counter_.compare_exchange_strong(current, current + 1,
+ std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO, "RQ: %s reclamation complete", name_.c_str());
+ }
+ waker.Wakeup();
+ }
+}
+
+void BasicMemoryQuota::Return(size_t amount) {
+ free_bytes_.fetch_add(amount, std::memory_order_relaxed);
+}
+
+std::pair<double, size_t>
+BasicMemoryQuota::InstantaneousPressureAndMaxRecommendedAllocationSize() const {
+ double free = free_bytes_.load();
+ if (free < 0) free = 0;
+ size_t quota_size = quota_size_.load();
+ double size = quota_size;
+ if (size < 1) return std::make_pair(1.0, 1);
+ double pressure = (size - free) / size;
+ if (pressure < 0.0) pressure = 0.0;
+ if (pressure > 1.0) pressure = 1.0;
+ return std::make_pair(pressure, quota_size / 16);
+}
+
+//
+// MemoryQuota
+//
+
+MemoryAllocator MemoryQuota::CreateMemoryAllocator(absl::string_view name) {
+ auto impl = std::make_shared<GrpcMemoryAllocatorImpl>(
+ memory_quota_, absl::StrCat(memory_quota_->name(), "/allocator/", name));
+ return MemoryAllocator(std::move(impl));
+}
+
+MemoryOwner MemoryQuota::CreateMemoryOwner(absl::string_view name) {
+ auto impl = std::make_shared<GrpcMemoryAllocatorImpl>(
+ memory_quota_, absl::StrCat(memory_quota_->name(), "/owner/", name));
+ return MemoryOwner(std::move(impl));
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resource_quota/memory_quota.h b/grpc/src/core/lib/resource_quota/memory_quota.h
new file mode 100644
index 00000000..37b31608
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/memory_quota.h
@@ -0,0 +1,457 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOURCE_QUOTA_MEMORY_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <algorithm>
+#include <atomic>
+#include <cstddef>
+#include <limits>
+#include <memory>
+#include <queue>
+#include <vector>
+
+#include <grpc/event_engine/memory_allocator.h>
+#include <grpc/slice.h>
+
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+class BasicMemoryQuota;
+class MemoryQuota;
+
+using grpc_event_engine::experimental::MemoryRequest;
+
+// Pull in impl under a different name to keep the gRPC/EventEngine separation
+// clear.
+using EventEngineMemoryAllocatorImpl =
+ grpc_event_engine::experimental::internal::MemoryAllocatorImpl;
+using grpc_event_engine::experimental::MemoryAllocator;
+template <typename T>
+using Vector = grpc_event_engine::experimental::Vector<T>;
+
+// Reclamation passes.
+// When memory is tight, we start trying to claim some back from memory
+// reclaimers. We do this in multiple passes: if there is a less destructive
+// operation available, we do that, otherwise we do something more destructive.
+enum class ReclamationPass {
+ // Non-empty reclamation ought to take index 0, but to simplify API we don't
+ // expose that publicly (it's an internal detail), and hence index zero is
+ // here unnamed.
+
+ // Benign reclamation is intended for reclamation steps that are not
+ // observable outside of gRPC (besides maybe causing an increase in CPU
+ // usage).
+ // Examples of such reclamation would be resizing buffers to fit the current
+ // load needs, rather than whatever was the peak usage requirement.
+ kBenign = 1,
+ // Idle reclamation is intended for reclamation steps that are observable
+ // outside of gRPC, but do not cause application work to be lost.
+ // Examples of such reclamation would be dropping channels that are not being
+ // used.
+ kIdle = 2,
+ // Destructive reclamation is our last resort, and is these reclamations are
+ // allowed to drop work - such as cancelling in flight requests.
+ kDestructive = 3,
+};
+static constexpr size_t kNumReclamationPasses = 4;
+
+// For each reclamation function run we construct a ReclamationSweep.
+// When this object is finally destroyed (it may be moved several times first),
+// then that reclamation is complete and we may continue the reclamation loop.
+class ReclamationSweep {
+ public:
+ ReclamationSweep() = default;
+ ReclamationSweep(std::shared_ptr<BasicMemoryQuota> memory_quota,
+ uint64_t sweep_token, Waker waker)
+ : memory_quota_(std::move(memory_quota)),
+ sweep_token_(sweep_token),
+ waker_(std::move(waker)) {}
+ ~ReclamationSweep();
+
+ ReclamationSweep(const ReclamationSweep&) = delete;
+ ReclamationSweep& operator=(const ReclamationSweep&) = delete;
+ ReclamationSweep(ReclamationSweep&&) = default;
+ ReclamationSweep& operator=(ReclamationSweep&&) = default;
+
+ // Has enough work been done that we would not be called upon again
+ // immediately to do reclamation work if we stopped and requeued. Reclaimers
+ // with a variable amount of work to do can use this to ascertain when they
+ // can stop more efficiently than going through the reclaimer queue once per
+ // work item.
+ bool IsSufficient() const;
+
+ // Explicit finish for users that wish to write it.
+ // Just destroying the object is enough, but sometimes the additional
+ // explicitness is warranted.
+ void Finish() {
+ [](ReclamationSweep) {}(std::move(*this));
+ }
+
+ private:
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+ uint64_t sweep_token_;
+ Waker waker_;
+};
+
+class ReclaimerQueue {
+ private:
+ struct QueuedNode;
+ struct State;
+
+ public:
+ class Handle : public InternallyRefCounted<Handle> {
+ public:
+ Handle() = default;
+ template <typename F>
+ explicit Handle(F reclaimer, std::shared_ptr<State> state)
+ : sweep_(new SweepFn<F>(std::move(reclaimer), std::move(state))) {}
+ ~Handle() override {
+ GPR_DEBUG_ASSERT(sweep_.load(std::memory_order_relaxed) == nullptr);
+ }
+
+ Handle(const Handle&) = delete;
+ Handle& operator=(const Handle&) = delete;
+
+ void Orphan() final;
+ void Run(ReclamationSweep reclamation_sweep);
+ bool Requeue(ReclaimerQueue* new_queue);
+
+ private:
+ friend class ReclaimerQueue;
+ using InternallyRefCounted<Handle>::Ref;
+
+ class Sweep {
+ public:
+ virtual void RunAndDelete(absl::optional<ReclamationSweep> sweep) = 0;
+
+ protected:
+ explicit Sweep(std::shared_ptr<State> state) : state_(std::move(state)) {}
+ ~Sweep() = default;
+ void MarkCancelled();
+
+ private:
+ std::shared_ptr<State> state_;
+ };
+
+ template <typename F>
+ class SweepFn final : public Sweep {
+ public:
+ explicit SweepFn(F&& f, std::shared_ptr<State> state)
+ : Sweep(std::move(state)), f_(std::move(f)) {}
+ void RunAndDelete(absl::optional<ReclamationSweep> sweep) override {
+ if (!sweep.has_value()) MarkCancelled();
+ f_(std::move(sweep));
+ delete this;
+ }
+
+ private:
+ F f_;
+ };
+
+ std::atomic<Sweep*> sweep_{nullptr};
+ };
+
+ ReclaimerQueue();
+ ~ReclaimerQueue();
+
+ ReclaimerQueue(const ReclaimerQueue&) = delete;
+ ReclaimerQueue& operator=(const ReclaimerQueue&) = delete;
+
+ // Insert a new element at the back of the queue.
+ // If there is already an element from allocator at *index, then it is
+ // replaced with the new reclaimer and *index is unchanged. If there is not,
+ // then *index is set to the index of the newly queued entry.
+ // Associates the reclamation function with an allocator, and keeps that
+ // allocator alive, so that we can use the pointer as an ABA guard.
+ template <typename F>
+ GRPC_MUST_USE_RESULT OrphanablePtr<Handle> Insert(F reclaimer) {
+ auto p = MakeOrphanable<Handle>(std::move(reclaimer), state_);
+ Enqueue(p->Ref());
+ return p;
+ }
+
+ // Poll to see if an entry is available: returns Pending if not, or the
+ // removed reclamation function if so.
+ Poll<RefCountedPtr<Handle>> PollNext();
+
+ // This callable is the promise backing Next - it resolves when there is an
+ // entry available. This really just redirects to calling PollNext().
+ class NextPromise {
+ public:
+ explicit NextPromise(ReclaimerQueue* queue) : queue_(queue) {}
+ Poll<RefCountedPtr<Handle>> operator()() { return queue_->PollNext(); }
+
+ private:
+ // Borrowed ReclaimerQueue backing this promise.
+ ReclaimerQueue* queue_;
+ };
+ GRPC_MUST_USE_RESULT NextPromise Next() { return NextPromise(this); }
+
+ private:
+ void Enqueue(RefCountedPtr<Handle> handle);
+
+ std::shared_ptr<State> state_;
+};
+
+class BasicMemoryQuota final
+ : public std::enable_shared_from_this<BasicMemoryQuota> {
+ public:
+ explicit BasicMemoryQuota(std::string name) : name_(std::move(name)) {}
+
+ // Start the reclamation activity.
+ void Start();
+ // Stop the reclamation activity.
+ // Until reclamation is stopped, it's possible that circular references to the
+ // BasicMemoryQuota remain. i.e. to guarantee deletion, a singular owning
+ // object should call BasicMemoryQuota::Stop().
+ void Stop();
+
+ // Resize the quota to new_size.
+ void SetSize(size_t new_size);
+ // Forcefully take some memory from the quota, potentially entering
+ // overcommit.
+ void Take(size_t amount);
+ // Finish reclamation pass.
+ void FinishReclamation(uint64_t token, Waker waker);
+ // Return some memory to the quota.
+ void Return(size_t amount);
+ // Instantaneous memory pressure approximation.
+ std::pair<double, size_t>
+ InstantaneousPressureAndMaxRecommendedAllocationSize() const;
+ // Get a reclamation queue
+ ReclaimerQueue* reclaimer_queue(size_t i) { return &reclaimers_[i]; }
+
+ // The name of this quota
+ absl::string_view name() const { return name_; }
+
+ private:
+ friend class ReclamationSweep;
+ class WaitForSweepPromise;
+
+ static constexpr intptr_t kInitialSize = std::numeric_limits<intptr_t>::max();
+
+ // The amount of memory that's free in this quota.
+ // We use intptr_t as a reasonable proxy for ssize_t that's portable.
+ // We allow arbitrary overcommit and so this must allow negative values.
+ std::atomic<intptr_t> free_bytes_{kInitialSize};
+ // The total number of bytes in this quota.
+ std::atomic<size_t> quota_size_{kInitialSize};
+
+ // Reclaimer queues.
+ ReclaimerQueue reclaimers_[kNumReclamationPasses];
+ // The reclaimer activity consumes reclaimers whenever we are in overcommit to
+ // try and get back under memory limits.
+ ActivityPtr reclaimer_activity_;
+ // Each time we do a reclamation sweep, we increment this counter and give it
+ // to the sweep in question. In this way, should we choose to cancel a sweep
+ // we can do so and not get confused when the sweep reports back that it's
+ // completed.
+ // We also increment this counter on completion of a sweep, as an indicator
+ // that the wait has ended.
+ std::atomic<uint64_t> reclamation_counter_{0};
+ // The name of this quota - used for debugging/tracing/etc..
+ std::string name_;
+};
+
+// MemoryAllocatorImpl grants the owner the ability to allocate memory from an
+// underlying resource quota.
+class GrpcMemoryAllocatorImpl final : public EventEngineMemoryAllocatorImpl {
+ public:
+ explicit GrpcMemoryAllocatorImpl(
+ std::shared_ptr<BasicMemoryQuota> memory_quota, std::string name);
+ ~GrpcMemoryAllocatorImpl() override;
+
+ // Rebind - Swaps the underlying quota for this allocator, taking care to
+ // make sure memory allocated is moved to allocations against the new quota.
+ void Rebind(std::shared_ptr<BasicMemoryQuota> memory_quota)
+ ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+
+ // Reserve bytes from the quota.
+ // If we enter overcommit, reclamation will begin concurrently.
+ // Returns the number of bytes reserved.
+ size_t Reserve(MemoryRequest request) override;
+
+ // Release some bytes that were previously reserved.
+ void Release(size_t n) override {
+ // Add the released memory to our free bytes counter... if this increases
+ // from 0 to non-zero, then we have more to do, otherwise, we're actually
+ // done.
+ if (free_bytes_.fetch_add(n, std::memory_order_release) != 0) return;
+ MaybeRegisterReclaimer();
+ }
+
+ // Post a reclamation function.
+ template <typename F>
+ void PostReclaimer(ReclamationPass pass, F fn) {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ InsertReclaimer(static_cast<size_t>(pass), std::move(fn));
+ }
+
+ // Shutdown the allocator.
+ void Shutdown() override;
+
+ // Read the instantaneous memory pressure
+ double InstantaneousPressure() const {
+ MutexLock lock(&memory_quota_mu_);
+ return memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize()
+ .first;
+ }
+
+ // Name of this allocator
+ absl::string_view name() const { return name_; }
+
+ private:
+ // Primitive reservation function.
+ absl::optional<size_t> TryReserve(MemoryRequest request) GRPC_MUST_USE_RESULT;
+ // Replenish bytes from the quota, without blocking, possibly entering
+ // overcommit.
+ void Replenish() ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+ // If we have not already, register a reclamation function against the quota
+ // to sweep any free memory back to that quota.
+ void MaybeRegisterReclaimer() ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+ void MaybeRegisterReclaimerLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(memory_quota_mu_);
+ template <typename F>
+ void InsertReclaimer(size_t pass, F fn)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(memory_quota_mu_) {
+ reclamation_handles_[pass] =
+ memory_quota_->reclaimer_queue(pass)->Insert(std::move(fn));
+ }
+
+ // Amount of memory this allocator has cached for its own use: to avoid quota
+ // contention, each MemoryAllocator can keep some memory in addition to what
+ // it is immediately using, and the quota can pull it back under memory
+ // pressure.
+ std::atomic<size_t> free_bytes_{0};
+ // Mutex guarding the backing resource quota.
+ mutable Mutex memory_quota_mu_;
+ // Backing resource quota.
+ std::shared_ptr<BasicMemoryQuota> memory_quota_
+ ABSL_GUARDED_BY(memory_quota_mu_);
+ // Amount of memory taken from the quota by this allocator.
+ size_t taken_bytes_ ABSL_GUARDED_BY(memory_quota_mu_) =
+ sizeof(GrpcMemoryAllocatorImpl);
+ bool shutdown_ ABSL_GUARDED_BY(memory_quota_mu_) = false;
+ bool registered_reclaimer_ ABSL_GUARDED_BY(memory_quota_mu_) = false;
+ // Indices into the various reclaimer queues, used so that we can cancel
+ // reclamation should we shutdown or get rebound.
+ OrphanablePtr<ReclaimerQueue::Handle>
+ reclamation_handles_[kNumReclamationPasses] ABSL_GUARDED_BY(
+ memory_quota_mu_);
+ // Name of this allocator.
+ std::string name_;
+};
+
+// MemoryOwner is an enhanced MemoryAllocator that can also reclaim memory, and
+// be rebound to a different memory quota.
+// Different modules should not share a MemoryOwner between themselves, instead
+// each module that requires a MemoryOwner should create one from a resource
+// quota. This is because the MemoryOwner reclaimers are tied to the
+// MemoryOwner's lifetime, and are not queryable, so passing a MemoryOwner to a
+// new owning module means that module cannot reason about which reclaimers are
+// active, nor what they might do.
+class MemoryOwner final : public MemoryAllocator {
+ public:
+ MemoryOwner() = default;
+
+ explicit MemoryOwner(std::shared_ptr<GrpcMemoryAllocatorImpl> allocator)
+ : MemoryAllocator(std::move(allocator)) {}
+
+ // Post a reclaimer for some reclamation pass.
+ template <typename F>
+ void PostReclaimer(ReclamationPass pass, F fn) {
+ impl()->PostReclaimer(pass, std::move(fn));
+ }
+
+ // Rebind to a different quota.
+ void Rebind(MemoryQuota* quota);
+
+ // Instantaneous memory pressure in the underlying quota.
+ double InstantaneousPressure() const {
+ return impl()->InstantaneousPressure();
+ }
+
+ template <typename T, typename... Args>
+ OrphanablePtr<T> MakeOrphanable(Args&&... args) {
+ return OrphanablePtr<T>(New<T>(std::forward<Args>(args)...));
+ }
+
+ // Name of this object
+ absl::string_view name() const { return impl()->name(); }
+
+ // Is this object valid (ie has not been moved out of or reset)
+ bool is_valid() const { return impl() != nullptr; }
+
+ private:
+ const GrpcMemoryAllocatorImpl* impl() const {
+ return static_cast<const GrpcMemoryAllocatorImpl*>(get_internal_impl_ptr());
+ }
+
+ GrpcMemoryAllocatorImpl* impl() {
+ return static_cast<GrpcMemoryAllocatorImpl*>(get_internal_impl_ptr());
+ }
+};
+
+// MemoryQuota tracks the amount of memory available as part of a ResourceQuota.
+class MemoryQuota final
+ : public grpc_event_engine::experimental::MemoryAllocatorFactory {
+ public:
+ explicit MemoryQuota(std::string name)
+ : memory_quota_(std::make_shared<BasicMemoryQuota>(std::move(name))) {
+ memory_quota_->Start();
+ }
+ ~MemoryQuota() override {
+ if (memory_quota_ != nullptr) memory_quota_->Stop();
+ }
+
+ MemoryQuota(const MemoryQuota&) = delete;
+ MemoryQuota& operator=(const MemoryQuota&) = delete;
+ MemoryQuota(MemoryQuota&&) = default;
+ MemoryQuota& operator=(MemoryQuota&&) = default;
+
+ MemoryAllocator CreateMemoryAllocator(absl::string_view name) override;
+ MemoryOwner CreateMemoryOwner(absl::string_view name);
+
+ // Resize the quota to new_size.
+ void SetSize(size_t new_size) { memory_quota_->SetSize(new_size); }
+
+ // Return true if the instantaneous memory pressure is high.
+ bool IsMemoryPressureHigh() const {
+ static constexpr double kMemoryPressureHighThreshold = 0.9;
+ return memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize()
+ .first > kMemoryPressureHighThreshold;
+ }
+
+ private:
+ friend class MemoryOwner;
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+};
+
+using MemoryQuotaRefPtr = std::shared_ptr<MemoryQuota>;
+inline MemoryQuotaRefPtr MakeMemoryQuota(std::string name) {
+ return std::make_shared<MemoryQuota>(std::move(name));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
diff --git a/grpc/src/core/lib/resource_quota/resource_quota.cc b/grpc/src/core/lib/resource_quota/resource_quota.cc
new file mode 100644
index 00000000..ac8e3cef
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/resource_quota.cc
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/resource_quota/resource_quota.h"
+
+namespace grpc_core {
+
+ResourceQuota::ResourceQuota(std::string name)
+ : memory_quota_(MakeMemoryQuota(std::move(name))),
+ thread_quota_(MakeRefCounted<ThreadQuota>()) {}
+
+ResourceQuota::~ResourceQuota() = default;
+
+ResourceQuotaRefPtr ResourceQuota::Default() {
+ static auto default_resource_quota =
+ MakeResourceQuota("default_resource_quota").release();
+ return default_resource_quota->Ref();
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resource_quota/resource_quota.h b/grpc/src/core/lib/resource_quota/resource_quota.h
new file mode 100644
index 00000000..5a0b8830
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/resource_quota.h
@@ -0,0 +1,66 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOURCE_QUOTA_RESOURCE_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/cpp_impl_of.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/thread_quota.h"
+
+namespace grpc_core {
+
+class ResourceQuota;
+using ResourceQuotaRefPtr = RefCountedPtr<ResourceQuota>;
+
+class ResourceQuota : public RefCounted<ResourceQuota>,
+ public CppImplOf<ResourceQuota, grpc_resource_quota> {
+ public:
+ explicit ResourceQuota(std::string name);
+ ~ResourceQuota() override;
+
+ ResourceQuota(const ResourceQuota&) = delete;
+ ResourceQuota& operator=(const ResourceQuota&) = delete;
+
+ static absl::string_view ChannelArgName() { return GRPC_ARG_RESOURCE_QUOTA; }
+
+ MemoryQuotaRefPtr memory_quota() { return memory_quota_; }
+
+ const RefCountedPtr<ThreadQuota>& thread_quota() { return thread_quota_; }
+
+ // The default global resource quota
+ static ResourceQuotaRefPtr Default();
+
+ static int ChannelArgsCompare(const ResourceQuota* a,
+ const ResourceQuota* b) {
+ return QsortCompare(a, b);
+ }
+
+ private:
+ MemoryQuotaRefPtr memory_quota_;
+ RefCountedPtr<ThreadQuota> thread_quota_;
+};
+
+inline ResourceQuotaRefPtr MakeResourceQuota(std::string name) {
+ return MakeRefCounted<ResourceQuota>(std::move(name));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
diff --git a/grpc/src/core/lib/resource_quota/thread_quota.cc b/grpc/src/core/lib/resource_quota/thread_quota.cc
new file mode 100644
index 00000000..c935be0d
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/thread_quota.cc
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/resource_quota/thread_quota.h"
+
+namespace grpc_core {
+
+ThreadQuota::ThreadQuota() = default;
+
+ThreadQuota::~ThreadQuota() = default;
+
+void ThreadQuota::SetMax(size_t new_max) {
+ MutexLock lock(&mu_);
+ max_ = new_max;
+}
+
+bool ThreadQuota::Reserve(size_t num_threads) {
+ MutexLock lock(&mu_);
+ if (allocated_ + num_threads > max_) return false;
+ allocated_ += num_threads;
+ return true;
+}
+
+void ThreadQuota::Release(size_t num_threads) {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(num_threads <= allocated_);
+ allocated_ -= num_threads;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/resource_quota/thread_quota.h b/grpc/src/core/lib/resource_quota/thread_quota.h
new file mode 100644
index 00000000..c0ae46da
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/thread_quota.h
@@ -0,0 +1,57 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOURCE_QUOTA_THREAD_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_THREAD_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstddef>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_core {
+
+// Tracks the amount of threads in a resource quota.
+class ThreadQuota : public RefCounted<ThreadQuota> {
+ public:
+ ThreadQuota();
+ ~ThreadQuota() override;
+
+ ThreadQuota(const ThreadQuota&) = delete;
+ ThreadQuota& operator=(const ThreadQuota&) = delete;
+
+ // Set the maximum number of threads that can be used by this quota.
+ // If there are more, new reservations will fail until the quota is available.
+ void SetMax(size_t new_max);
+
+ // Try to allocate some number of threads.
+ // Returns true if the allocation succeeded, false otherwise.
+ bool Reserve(size_t num_threads);
+
+ // Release some number of threads.
+ void Release(size_t num_threads);
+
+ private:
+ Mutex mu_;
+ size_t allocated_ ABSL_GUARDED_BY(mu_) = 0;
+ size_t max_ ABSL_GUARDED_BY(mu_) = std::numeric_limits<size_t>::max();
+};
+
+using ThreadQuotaPtr = RefCountedPtr<ThreadQuota>;
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_THREAD_QUOTA_H
diff --git a/grpc/src/core/lib/resource_quota/trace.cc b/grpc/src/core/lib/resource_quota/trace.cc
new file mode 100644
index 00000000..51e6cb01
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/trace.cc
@@ -0,0 +1,19 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/resource_quota/trace.h"
+
+grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota");
diff --git a/grpc/src/core/lib/resource_quota/trace.h b/grpc/src/core/lib/resource_quota/trace.h
new file mode 100644
index 00000000..8964746f
--- /dev/null
+++ b/grpc/src/core/lib/resource_quota/trace.h
@@ -0,0 +1,24 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_RESOURCE_QUOTA_TRACE_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_TRACE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/debug/trace.h"
+
+extern grpc_core::TraceFlag grpc_resource_quota_trace;
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_TRACE_H
diff --git a/grpc/src/core/lib/security/authorization/authorization_engine.h b/grpc/src/core/lib/security/authorization/authorization_engine.h
index 7889e62d..997ffbe4 100644
--- a/grpc/src/core/lib/security/authorization/authorization_engine.h
+++ b/grpc/src/core/lib/security/authorization/authorization_engine.h
@@ -19,12 +19,13 @@
#include <string>
+#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/authorization/evaluate_args.h"
namespace grpc_core {
// Interface for gRPC Authorization Engine.
-class AuthorizationEngine {
+class AuthorizationEngine : public RefCounted<AuthorizationEngine> {
public:
struct Decision {
enum class Type {
@@ -35,7 +36,6 @@ class AuthorizationEngine {
std::string matching_policy_name;
};
- virtual ~AuthorizationEngine() = default;
virtual Decision Evaluate(const EvaluateArgs& args) const = 0;
};
diff --git a/grpc/src/core/lib/security/authorization/authorization_policy_provider.h b/grpc/src/core/lib/security/authorization/authorization_policy_provider.h
new file mode 100644
index 00000000..780a80d8
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/authorization_policy_provider.h
@@ -0,0 +1,40 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_POLICY_PROVIDER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/security/authorization/authorization_engine.h"
+
+struct grpc_authorization_policy_provider
+ : public grpc_core::DualRefCounted<grpc_authorization_policy_provider> {
+ public:
+ static absl::string_view ChannelArgName() {
+ return GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER;
+ }
+ static int ChannelArgsCompare(const grpc_authorization_policy_provider* a,
+ const grpc_authorization_policy_provider* b) {
+ return QsortCompare(a, b);
+ }
+ struct AuthorizationEngines {
+ grpc_core::RefCountedPtr<grpc_core::AuthorizationEngine> allow_engine;
+ grpc_core::RefCountedPtr<grpc_core::AuthorizationEngine> deny_engine;
+ };
+ virtual AuthorizationEngines engines() = 0;
+};
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc b/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
new file mode 100644
index 00000000..f8a4426e
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
@@ -0,0 +1,46 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <grpc/grpc.h>
+
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+
+namespace {
+
+void* ProviderArgCopy(void* p) {
+ grpc_authorization_policy_provider* provider =
+ static_cast<grpc_authorization_policy_provider*>(p);
+ provider->Ref().release();
+ return provider;
+}
+
+void ProviderArgDestroy(void* p) {
+ grpc_authorization_policy_provider* provider =
+ static_cast<grpc_authorization_policy_provider*>(p);
+ provider->Unref();
+}
+
+int ProviderArgCmp(void* p, void* q) { return grpc_core::QsortCompare(p, q); }
+
+} // namespace
+
+// Wrapper API declared in grpc.h
+
+const grpc_arg_pointer_vtable* grpc_authorization_policy_provider_arg_vtable() {
+ static const grpc_arg_pointer_vtable vtable = {
+ ProviderArgCopy, ProviderArgDestroy, ProviderArgCmp};
+ return &vtable;
+}
diff --git a/grpc/src/core/lib/security/authorization/cel_authorization_engine.cc b/grpc/src/core/lib/security/authorization/cel_authorization_engine.cc
index 844d9fb5..177c46f1 100644
--- a/grpc/src/core/lib/security/authorization/cel_authorization_engine.cc
+++ b/grpc/src/core/lib/security/authorization/cel_authorization_engine.cc
@@ -14,9 +14,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/authorization/cel_authorization_engine.h"
+
#include "absl/memory/memory.h"
-#include "src/core/lib/security/authorization/cel_authorization_engine.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
namespace grpc_core {
@@ -62,11 +64,11 @@ CelAuthorizationEngine::CelAuthorizationEngine(
// 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;
+ size_t policy_num = kUpb_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 =
+ const upb_StringView policy_name_strview =
envoy_config_rbac_v3_RBAC_PoliciesEntry_key(policy_entry);
const std::string policy_name(policy_name_strview.data,
policy_name_strview.size);
@@ -101,7 +103,7 @@ std::unique_ptr<mock_cel::Activation> CelAuthorizationEngine::CreateActivation(
mock_cel::CelValue::CreateStringView(url_path));
}
} else if (elem == kHost) {
- absl::string_view host(args.GetHost());
+ absl::string_view host(args.GetAuthority());
if (!host.empty()) {
activation->InsertValue(kHost,
mock_cel::CelValue::CreateStringView(host));
@@ -113,17 +115,17 @@ std::unique_ptr<mock_cel::Activation> CelAuthorizationEngine::CreateActivation(
mock_cel::CelValue::CreateStringView(method));
}
} else if (elem == kHeaders) {
- std::multimap<absl::string_view, 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()) {
+ std::string temp_value;
+ absl::optional<absl::string_view> header_value =
+ args.GetHeaderValue(header_key, &temp_value);
+ if (header_value.has_value()) {
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)));
+ mock_cel::CelValue::CreateStringView(*header_value)));
}
}
headers_ = mock_cel::ContainerBackedMapImpl::Create(
@@ -132,7 +134,7 @@ std::unique_ptr<mock_cel::Activation> CelAuthorizationEngine::CreateActivation(
activation->InsertValue(kHeaders,
mock_cel::CelValue::CreateMap(headers_.get()));
} else if (elem == kSourceAddress) {
- absl::string_view source_address(args.GetPeerAddress());
+ absl::string_view source_address(args.GetPeerAddressString());
if (!source_address.empty()) {
activation->InsertValue(
kSourceAddress,
@@ -142,7 +144,7 @@ std::unique_ptr<mock_cel::Activation> CelAuthorizationEngine::CreateActivation(
activation->InsertValue(
kSourcePort, mock_cel::CelValue::CreateInt64(args.GetPeerPort()));
} else if (elem == kDestinationAddress) {
- absl::string_view destination_address(args.GetLocalAddress());
+ absl::string_view destination_address(args.GetLocalAddressString());
if (!destination_address.empty()) {
activation->InsertValue(
kDestinationAddress,
diff --git a/grpc/src/core/lib/security/authorization/cel_authorization_engine.h b/grpc/src/core/lib/security/authorization/cel_authorization_engine.h
index 6f37bfbe..3c20478f 100644
--- a/grpc/src/core/lib/security/authorization/cel_authorization_engine.h
+++ b/grpc/src/core/lib/security/authorization/cel_authorization_engine.h
@@ -18,7 +18,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
#include <map>
#include <memory>
#include <string>
@@ -29,6 +28,8 @@
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "upb/upb.hpp"
+#include <grpc/support/log.h>
+
#include "src/core/lib/security/authorization/evaluate_args.h"
#include "src/core/lib/security/authorization/mock_cel/activation.h"
diff --git a/grpc/src/core/lib/security/authorization/evaluate_args.cc b/grpc/src/core/lib/security/authorization/evaluate_args.cc
index 12144dfb..d422190e 100644
--- a/grpc/src/core/lib/security/authorization/evaluate_args.cc
+++ b/grpc/src/core/lib/security/authorization/evaluate_args.cc
@@ -16,49 +16,46 @@
#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "absl/strings/numbers.h"
+
#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gprpp/host_port.h"
-#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/security/credentials/tls/tls_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
namespace grpc_core {
namespace {
-absl::string_view GetAuthPropertyValue(grpc_auth_context* context,
- const char* property_name) {
- grpc_auth_property_iterator it =
- grpc_auth_context_find_properties_by_name(context, property_name);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) {
- gpr_log(GPR_DEBUG, "No value found for %s property.", property_name);
- return "";
- }
- if (grpc_auth_property_iterator_next(&it) != nullptr) {
- gpr_log(GPR_DEBUG, "Multiple values found for %s property.", property_name);
- return "";
- }
- return absl::string_view(prop->value, prop->value_length);
-}
-
-void ParseEndpointUri(absl::string_view uri_text, std::string* address,
- int* port) {
+EvaluateArgs::PerChannelArgs::Address ParseEndpointUri(
+ absl::string_view uri_text) {
+ EvaluateArgs::PerChannelArgs::Address address;
absl::StatusOr<URI> uri = URI::Parse(uri_text);
if (!uri.ok()) {
gpr_log(GPR_DEBUG, "Failed to parse uri.");
- return;
+ return address;
}
absl::string_view host_view;
absl::string_view port_view;
if (!SplitHostPort(uri->path(), &host_view, &port_view)) {
gpr_log(GPR_DEBUG, "Failed to split %s into host and port.",
uri->path().c_str());
- return;
+ return address;
}
- *address = std::string(host_view);
- if (!absl::SimpleAtoi(port_view, port)) {
+ if (!absl::SimpleAtoi(port_view, &address.port)) {
gpr_log(GPR_DEBUG, "Port %s is out of range or null.",
std::string(port_view).c_str());
}
+ address.address_str = std::string(host_view);
+ grpc_error_handle error = grpc_string_to_sockaddr(
+ &address.address, address.address_str.c_str(), address.port);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_DEBUG, "Address %s is not IPv4/IPv6. Error: %s",
+ address.address_str.c_str(), grpc_error_std_string(error).c_str());
+ }
+ GRPC_ERROR_UNREF(error);
+ return address;
}
} // namespace
@@ -70,96 +67,104 @@ EvaluateArgs::PerChannelArgs::PerChannelArgs(grpc_auth_context* auth_context,
auth_context, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
spiffe_id =
GetAuthPropertyValue(auth_context, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME);
+ uri_sans = GetAuthPropertyArray(auth_context, GRPC_PEER_URI_PROPERTY_NAME);
+ dns_sans = GetAuthPropertyArray(auth_context, GRPC_PEER_DNS_PROPERTY_NAME);
common_name =
GetAuthPropertyValue(auth_context, GRPC_X509_CN_PROPERTY_NAME);
+ subject =
+ GetAuthPropertyValue(auth_context, GRPC_X509_SUBJECT_PROPERTY_NAME);
}
if (endpoint != nullptr) {
- ParseEndpointUri(grpc_endpoint_get_local_address(endpoint), &local_address,
- &local_port);
- ParseEndpointUri(grpc_endpoint_get_peer(endpoint), &peer_address,
- &peer_port);
+ local_address = ParseEndpointUri(grpc_endpoint_get_local_address(endpoint));
+ peer_address = ParseEndpointUri(grpc_endpoint_get_peer(endpoint));
}
}
absl::string_view EvaluateArgs::GetPath() const {
- 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);
+ if (metadata_ != nullptr) {
+ const auto* path = metadata_->get_pointer(HttpPathMetadata());
+ if (path != nullptr) {
+ return path->as_string_view();
+ }
}
- return path;
+ return absl::string_view();
}
-absl::string_view EvaluateArgs::GetHost() const {
- 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);
+absl::string_view EvaluateArgs::GetAuthority() const {
+ absl::string_view authority;
+ if (metadata_ != nullptr) {
+ if (auto* authority_md = metadata_->get_pointer(HttpAuthorityMetadata())) {
+ authority = authority_md->as_string_view();
+ }
}
- return host;
+ return authority;
}
absl::string_view EvaluateArgs::GetMethod() const {
- 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);
+ if (metadata_ != nullptr) {
+ auto method_md = metadata_->get(HttpMethodMetadata());
+ if (method_md.has_value()) {
+ return HttpMethodMetadata::Encode(*method_md).as_string_view();
+ }
}
- return method;
+ return absl::string_view();
}
-std::multimap<absl::string_view, absl::string_view> EvaluateArgs::GetHeaders()
- const {
- std::multimap<absl::string_view, absl::string_view> headers;
+absl::optional<absl::string_view> EvaluateArgs::GetHeaderValue(
+ absl::string_view key, std::string* concatenated_value) const {
if (metadata_ == nullptr) {
- return headers;
+ return absl::nullopt;
}
- 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));
+ if (absl::EqualsIgnoreCase(key, "te")) {
+ return absl::nullopt;
}
- return headers;
+ if (absl::EqualsIgnoreCase(key, "host")) {
+ // Maps legacy host header to :authority.
+ return GetAuthority();
+ }
+ return metadata_->GetStringValue(key, concatenated_value);
}
-absl::optional<absl::string_view> EvaluateArgs::GetHeaderValue(
- absl::string_view key, std::string* concatenated_value) const {
- if (metadata_ == nullptr) {
- return absl::nullopt;
+grpc_resolved_address EvaluateArgs::GetLocalAddress() const {
+ if (channel_args_ == nullptr) {
+ return {};
}
- return grpc_metadata_batch_get_value(metadata_, key, concatenated_value);
+ return channel_args_->local_address.address;
}
-absl::string_view EvaluateArgs::GetLocalAddress() const {
+absl::string_view EvaluateArgs::GetLocalAddressString() const {
if (channel_args_ == nullptr) {
return "";
}
- return channel_args_->local_address;
+ return channel_args_->local_address.address_str;
}
int EvaluateArgs::GetLocalPort() const {
if (channel_args_ == nullptr) {
return 0;
}
- return channel_args_->local_port;
+ return channel_args_->local_address.port;
}
-absl::string_view EvaluateArgs::GetPeerAddress() const {
+grpc_resolved_address EvaluateArgs::GetPeerAddress() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->peer_address.address;
+}
+
+absl::string_view EvaluateArgs::GetPeerAddressString() const {
if (channel_args_ == nullptr) {
return "";
}
- return channel_args_->peer_address;
+ return channel_args_->peer_address.address_str;
}
int EvaluateArgs::GetPeerPort() const {
if (channel_args_ == nullptr) {
return 0;
}
- return channel_args_->peer_port;
+ return channel_args_->peer_address.port;
}
absl::string_view EvaluateArgs::GetTransportSecurityType() const {
@@ -176,6 +181,20 @@ absl::string_view EvaluateArgs::GetSpiffeId() const {
return channel_args_->spiffe_id;
}
+std::vector<absl::string_view> EvaluateArgs::GetUriSans() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->uri_sans;
+}
+
+std::vector<absl::string_view> EvaluateArgs::GetDnsSans() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->dns_sans;
+}
+
absl::string_view EvaluateArgs::GetCommonName() const {
if (channel_args_ == nullptr) {
return "";
@@ -183,4 +202,11 @@ absl::string_view EvaluateArgs::GetCommonName() const {
return channel_args_->common_name;
}
+absl::string_view EvaluateArgs::GetSubject() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->subject;
+}
+
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/authorization/evaluate_args.h b/grpc/src/core/lib/security/authorization/evaluate_args.h
index b3ac93ca..09e32bc7 100644
--- a/grpc/src/core/lib/security/authorization/evaluate_args.h
+++ b/grpc/src/core/lib/security/authorization/evaluate_args.h
@@ -22,6 +22,7 @@
#include "absl/types/optional.h"
#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -32,24 +33,32 @@ class EvaluateArgs {
// Caller is responsible for ensuring auth_context outlives PerChannelArgs
// struct.
struct PerChannelArgs {
+ struct Address {
+ // The address in sockaddr form.
+ grpc_resolved_address address;
+ // The same address with only the host part.
+ std::string address_str;
+ int port = 0;
+ };
+
PerChannelArgs(grpc_auth_context* auth_context, grpc_endpoint* endpoint);
absl::string_view transport_security_type;
absl::string_view spiffe_id;
+ std::vector<absl::string_view> uri_sans;
+ std::vector<absl::string_view> dns_sans;
absl::string_view common_name;
- std::string local_address;
- int local_port = 0;
- std::string peer_address;
- int peer_port = 0;
+ absl::string_view subject;
+ Address local_address;
+ Address peer_address;
};
EvaluateArgs(grpc_metadata_batch* metadata, PerChannelArgs* channel_args)
: metadata_(metadata), channel_args_(channel_args) {}
absl::string_view GetPath() const;
- absl::string_view GetHost() const;
+ absl::string_view GetAuthority() const;
absl::string_view GetMethod() const;
- std::multimap<absl::string_view, absl::string_view> GetHeaders() const;
// Returns metadata value(s) for the specified key.
// If the key is not present in the batch, returns absl::nullopt.
// If the key is present exactly once in the batch, returns a string_view of
@@ -60,13 +69,18 @@ class EvaluateArgs {
absl::optional<absl::string_view> GetHeaderValue(
absl::string_view key, std::string* concatenated_value) const;
- absl::string_view GetLocalAddress() const;
+ grpc_resolved_address GetLocalAddress() const;
+ absl::string_view GetLocalAddressString() const;
int GetLocalPort() const;
- absl::string_view GetPeerAddress() const;
+ grpc_resolved_address GetPeerAddress() const;
+ absl::string_view GetPeerAddressString() const;
int GetPeerPort() const;
absl::string_view GetTransportSecurityType() const;
absl::string_view GetSpiffeId() const;
+ std::vector<absl::string_view> GetUriSans() const;
+ std::vector<absl::string_view> GetDnsSans() const;
absl::string_view GetCommonName() const;
+ absl::string_view GetSubject() const;
private:
grpc_metadata_batch* metadata_;
diff --git a/grpc/src/core/lib/security/authorization/grpc_authorization_engine.cc b/grpc/src/core/lib/security/authorization/grpc_authorization_engine.cc
index 34fc9767..5278a3bc 100644
--- a/grpc/src/core/lib/security/authorization/grpc_authorization_engine.cc
+++ b/grpc/src/core/lib/security/authorization/grpc_authorization_engine.cc
@@ -29,6 +29,17 @@ GrpcAuthorizationEngine::GrpcAuthorizationEngine(Rbac policy)
}
}
+GrpcAuthorizationEngine::GrpcAuthorizationEngine(
+ GrpcAuthorizationEngine&& other) noexcept
+ : action_(other.action_), policies_(std::move(other.policies_)) {}
+
+GrpcAuthorizationEngine& GrpcAuthorizationEngine::operator=(
+ GrpcAuthorizationEngine&& other) noexcept {
+ action_ = other.action_;
+ policies_ = std::move(other.policies_);
+ return *this;
+}
+
AuthorizationEngine::Decision GrpcAuthorizationEngine::Evaluate(
const EvaluateArgs& args) const {
Decision decision;
diff --git a/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h b/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h
index 5b7791ac..f50a6917 100644
--- a/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h
+++ b/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h
@@ -36,6 +36,14 @@ class GrpcAuthorizationEngine : public AuthorizationEngine {
// Builds GrpcAuthorizationEngine with allow/deny RBAC policy.
explicit GrpcAuthorizationEngine(Rbac policy);
+ GrpcAuthorizationEngine(GrpcAuthorizationEngine&& other) noexcept;
+ GrpcAuthorizationEngine& operator=(GrpcAuthorizationEngine&& other) noexcept;
+
+ Rbac::Action action() const { return action_; }
+
+ // Required only for testing purpose.
+ size_t num_policies() const { return policies_.size(); }
+
// Evaluates incoming request against RBAC policy and makes a decision to
// whether allow/deny this request.
Decision Evaluate(const EvaluateArgs& args) const override;
@@ -45,7 +53,6 @@ class GrpcAuthorizationEngine : public AuthorizationEngine {
std::string name;
std::unique_ptr<AuthorizationMatcher> matcher;
};
-
Rbac::Action action_;
std::vector<Policy> policies_;
};
diff --git a/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc b/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
new file mode 100644
index 00000000..bbc69de7
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc
@@ -0,0 +1,193 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/grpc_authorization_policy_provider.h"
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+namespace grpc_core {
+
+extern TraceFlag grpc_authz_trace;
+
+absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+StaticDataAuthorizationPolicyProvider::Create(absl::string_view authz_policy) {
+ auto policies_or = GenerateRbacPolicies(authz_policy);
+ if (!policies_or.ok()) {
+ return policies_or.status();
+ }
+ return MakeRefCounted<StaticDataAuthorizationPolicyProvider>(
+ std::move(*policies_or));
+}
+
+StaticDataAuthorizationPolicyProvider::StaticDataAuthorizationPolicyProvider(
+ RbacPolicies policies)
+ : allow_engine_(MakeRefCounted<GrpcAuthorizationEngine>(
+ std::move(policies.allow_policy))),
+ deny_engine_(MakeRefCounted<GrpcAuthorizationEngine>(
+ std::move(policies.deny_policy))) {}
+
+namespace {
+
+absl::StatusOr<std::string> ReadPolicyFromFile(absl::string_view policy_path) {
+ grpc_slice policy_slice = grpc_empty_slice();
+ grpc_error_handle error =
+ grpc_load_file(std::string(policy_path).c_str(), 0, &policy_slice);
+ if (error != GRPC_ERROR_NONE) {
+ absl::Status status =
+ absl::InvalidArgumentError(grpc_error_std_string(error));
+ GRPC_ERROR_UNREF(error);
+ return status;
+ }
+ std::string policy_contents(StringViewFromSlice(policy_slice));
+ grpc_slice_unref_internal(policy_slice);
+ return policy_contents;
+}
+
+gpr_timespec TimeoutSecondsToDeadline(int64_t seconds) {
+ return gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_seconds(seconds, GPR_TIMESPAN));
+}
+
+} // namespace
+
+absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+FileWatcherAuthorizationPolicyProvider::Create(
+ absl::string_view authz_policy_path, unsigned int refresh_interval_sec) {
+ GPR_ASSERT(!authz_policy_path.empty());
+ GPR_ASSERT(refresh_interval_sec > 0);
+ absl::Status status;
+ auto provider = MakeRefCounted<FileWatcherAuthorizationPolicyProvider>(
+ authz_policy_path, refresh_interval_sec, &status);
+ if (!status.ok()) return status;
+ return provider;
+}
+
+FileWatcherAuthorizationPolicyProvider::FileWatcherAuthorizationPolicyProvider(
+ absl::string_view authz_policy_path, unsigned int refresh_interval_sec,
+ absl::Status* status)
+ : authz_policy_path_(std::string(authz_policy_path)),
+ refresh_interval_sec_(refresh_interval_sec) {
+ gpr_event_init(&shutdown_event_);
+ // Initial read is done synchronously.
+ *status = ForceUpdate();
+ if (!status->ok()) {
+ return;
+ }
+ auto thread_lambda = [](void* arg) {
+ WeakRefCountedPtr<FileWatcherAuthorizationPolicyProvider> provider(
+ static_cast<FileWatcherAuthorizationPolicyProvider*>(arg));
+ GPR_ASSERT(provider != nullptr);
+ while (true) {
+ void* value = gpr_event_wait(
+ &provider->shutdown_event_,
+ TimeoutSecondsToDeadline(provider->refresh_interval_sec_));
+ if (value != nullptr) {
+ return;
+ }
+ absl::Status status = provider->ForceUpdate();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace) && !status.ok()) {
+ gpr_log(GPR_ERROR,
+ "authorization policy reload status. code=%d error_details=%s",
+ status.code(), std::string(status.message()).c_str());
+ }
+ }
+ };
+ refresh_thread_ = absl::make_unique<Thread>(
+ "FileWatcherAuthorizationPolicyProvider_refreshing_thread", thread_lambda,
+ WeakRef().release());
+ refresh_thread_->Start();
+}
+
+absl::Status FileWatcherAuthorizationPolicyProvider::ForceUpdate() {
+ absl::StatusOr<std::string> file_contents =
+ ReadPolicyFromFile(authz_policy_path_);
+ if (!file_contents.ok()) {
+ return file_contents.status();
+ }
+ if (file_contents_ == *file_contents) {
+ return absl::OkStatus();
+ }
+ file_contents_ = std::move(*file_contents);
+ auto rbac_policies_or = GenerateRbacPolicies(file_contents_);
+ if (!rbac_policies_or.ok()) {
+ return rbac_policies_or.status();
+ }
+ MutexLock lock(&mu_);
+ allow_engine_ = MakeRefCounted<GrpcAuthorizationEngine>(
+ std::move(rbac_policies_or->allow_policy));
+ deny_engine_ = MakeRefCounted<GrpcAuthorizationEngine>(
+ std::move(rbac_policies_or->deny_policy));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) {
+ gpr_log(GPR_INFO,
+ "authorization policy reload status: successfully loaded new "
+ "policy\n%s",
+ file_contents_.c_str());
+ }
+ return absl::OkStatus();
+}
+
+void FileWatcherAuthorizationPolicyProvider::Orphan() {
+ gpr_event_set(&shutdown_event_, reinterpret_cast<void*>(1));
+ if (refresh_thread_ != nullptr) {
+ refresh_thread_->Join();
+ }
+}
+
+} // namespace grpc_core
+
+// Wrapper APIs declared in grpc_security.h
+
+grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_static_data_create(
+ const char* authz_policy, grpc_status_code* code,
+ const char** error_details) {
+ GPR_ASSERT(authz_policy != nullptr);
+ auto provider_or =
+ grpc_core::StaticDataAuthorizationPolicyProvider::Create(authz_policy);
+ if (!provider_or.ok()) {
+ *code = static_cast<grpc_status_code>(provider_or.status().code());
+ *error_details =
+ gpr_strdup(std::string(provider_or.status().message()).c_str());
+ return nullptr;
+ }
+ return provider_or->release();
+}
+
+grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_file_watcher_create(
+ const char* authz_policy_path, unsigned int refresh_interval_sec,
+ grpc_status_code* code, const char** error_details) {
+ GPR_ASSERT(authz_policy_path != nullptr);
+ auto provider_or = grpc_core::FileWatcherAuthorizationPolicyProvider::Create(
+ authz_policy_path, refresh_interval_sec);
+ if (!provider_or.ok()) {
+ *code = static_cast<grpc_status_code>(provider_or.status().code());
+ *error_details =
+ gpr_strdup(std::string(provider_or.status().message()).c_str());
+ return nullptr;
+ }
+ return provider_or->release();
+}
+
+void grpc_authorization_policy_provider_release(
+ grpc_authorization_policy_provider* provider) {
+ if (provider != nullptr) provider->Unref();
+}
diff --git a/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h b/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h
new file mode 100644
index 00000000..1d59252c
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h
@@ -0,0 +1,103 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "absl/status/statusor.h"
+
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+#include "src/core/lib/security/authorization/rbac_translator.h"
+
+namespace grpc_core {
+
+// Provider class will get gRPC Authorization policy from string during
+// initialization. This policy will be translated to Envoy RBAC policies and
+// used to initialize allow and deny AuthorizationEngine objects. This provider
+// will return the same authorization engines everytime.
+class StaticDataAuthorizationPolicyProvider
+ : public grpc_authorization_policy_provider {
+ public:
+ static absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+ Create(absl::string_view authz_policy);
+
+ // Use factory method "Create" to create an instance of
+ // StaticDataAuthorizationPolicyProvider.
+ explicit StaticDataAuthorizationPolicyProvider(RbacPolicies policies);
+
+ AuthorizationEngines engines() override {
+ return {allow_engine_, deny_engine_};
+ }
+
+ void Orphan() override {}
+
+ private:
+ RefCountedPtr<AuthorizationEngine> allow_engine_;
+ RefCountedPtr<AuthorizationEngine> deny_engine_;
+};
+
+// Provider class will get gRPC Authorization policy from provided file path.
+// This policy will be translated to Envoy RBAC policies and used to initialize
+// allow and deny AuthorizationEngine objects. This provider will periodically
+// load file contents in specified path, and upon modification update the engine
+// instances with new policy configuration. During reload if the file contents
+// are invalid or there are I/O errors, we will skip that particular update and
+// log error status. The authorization decisions will be made using the latest
+// valid policy.
+class FileWatcherAuthorizationPolicyProvider
+ : public grpc_authorization_policy_provider {
+ public:
+ static absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+ Create(absl::string_view authz_policy_path,
+ unsigned int refresh_interval_sec);
+
+ // Use factory method "Create" to create an instance of
+ // FileWatcherAuthorizationPolicyProvider.
+ FileWatcherAuthorizationPolicyProvider(absl::string_view authz_policy_path,
+ unsigned int refresh_interval_sec,
+ absl::Status* status);
+
+ void Orphan() override;
+
+ AuthorizationEngines engines() override {
+ MutexLock lock(&mu_);
+ return {allow_engine_, deny_engine_};
+ }
+
+ private:
+ // Force an update from the file system regardless of the interval.
+ absl::Status ForceUpdate();
+
+ std::string authz_policy_path_;
+ std::string file_contents_;
+ unsigned int refresh_interval_sec_;
+
+ std::unique_ptr<Thread> refresh_thread_;
+ gpr_event shutdown_event_;
+
+ Mutex mu_;
+ // Engines created using authz_policy_.
+ RefCountedPtr<AuthorizationEngine> allow_engine_ ABSL_GUARDED_BY(mu_);
+ RefCountedPtr<AuthorizationEngine> deny_engine_ ABSL_GUARDED_BY(mu_);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.cc b/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.cc
new file mode 100644
index 00000000..44823c5f
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.cc
@@ -0,0 +1,106 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/grpc_server_authz_filter.h"
+
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/transport/transport.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_authz_trace(false, "grpc_authz_api");
+
+GrpcServerAuthzFilter::GrpcServerAuthzFilter(
+ RefCountedPtr<grpc_auth_context> auth_context, grpc_endpoint* endpoint,
+ RefCountedPtr<grpc_authorization_policy_provider> provider)
+ : auth_context_(std::move(auth_context)),
+ per_channel_evaluate_args_(auth_context_.get(), endpoint),
+ provider_(std::move(provider)) {}
+
+absl::StatusOr<GrpcServerAuthzFilter> GrpcServerAuthzFilter::Create(
+ ChannelArgs args, ChannelFilter::Args) {
+ auto* auth_context = args.GetObject<grpc_auth_context>();
+ auto* provider = args.GetObject<grpc_authorization_policy_provider>();
+ if (provider == nullptr) {
+ return absl::InvalidArgumentError("Failed to get authorization provider.");
+ }
+ // grpc_endpoint isn't needed because the current gRPC authorization policy
+ // does not support any rules that requires looking for source or destination
+ // addresses.
+ return GrpcServerAuthzFilter(
+ auth_context != nullptr ? auth_context->Ref() : nullptr,
+ /*endpoint=*/nullptr, provider->Ref());
+}
+
+bool GrpcServerAuthzFilter::IsAuthorized(
+ const ClientMetadataHandle& initial_metadata) {
+ EvaluateArgs args(initial_metadata.get(), &per_channel_evaluate_args_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) {
+ gpr_log(GPR_DEBUG,
+ "checking request: url_path=%s, transport_security_type=%s, "
+ "uri_sans=[%s], dns_sans=[%s], subject=%s",
+ std::string(args.GetPath()).c_str(),
+ std::string(args.GetTransportSecurityType()).c_str(),
+ absl::StrJoin(args.GetUriSans(), ",").c_str(),
+ absl::StrJoin(args.GetDnsSans(), ",").c_str(),
+ std::string(args.GetSubject()).c_str());
+ }
+ grpc_authorization_policy_provider::AuthorizationEngines engines =
+ provider_->engines();
+ if (engines.deny_engine != nullptr) {
+ AuthorizationEngine::Decision decision =
+ engines.deny_engine->Evaluate(args);
+ if (decision.type == AuthorizationEngine::Decision::Type::kDeny) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: request denied by policy %s.", this,
+ decision.matching_policy_name.c_str());
+ }
+ return false;
+ }
+ }
+ if (engines.allow_engine != nullptr) {
+ AuthorizationEngine::Decision decision =
+ engines.allow_engine->Evaluate(args);
+ if (decision.type == AuthorizationEngine::Decision::Type::kAllow) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) {
+ gpr_log(GPR_DEBUG, "chand=%p: request allowed by policy %s.", this,
+ decision.matching_policy_name.c_str());
+ }
+ return true;
+ }
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: request denied, no matching policy found.",
+ this);
+ }
+ return false;
+}
+
+ArenaPromise<ServerMetadataHandle> GrpcServerAuthzFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ if (!IsAuthorized(call_args.client_initial_metadata)) {
+ return ArenaPromise<ServerMetadataHandle>(Immediate(ServerMetadataHandle(
+ absl::PermissionDeniedError("Unauthorized RPC request rejected."))));
+ }
+ return next_promise_factory(std::move(call_args));
+}
+
+const grpc_channel_filter GrpcServerAuthzFilter::kFilterVtable =
+ MakePromiseBasedFilter<GrpcServerAuthzFilter, FilterEndpoint::kServer>(
+ "grpc-server-authz");
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.h b/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.h
new file mode 100644
index 00000000..d3c3768e
--- /dev/null
+++ b/grpc/src/core/lib/security/authorization/grpc_server_authz_filter.h
@@ -0,0 +1,50 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_GRPC_SERVER_AUTHZ_FILTER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_SERVER_AUTHZ_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+
+namespace grpc_core {
+
+class GrpcServerAuthzFilter final : public ChannelFilter {
+ public:
+ static const grpc_channel_filter kFilterVtable;
+
+ static absl::StatusOr<GrpcServerAuthzFilter> Create(ChannelArgs args,
+ ChannelFilter::Args);
+
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ private:
+ GrpcServerAuthzFilter(
+ RefCountedPtr<grpc_auth_context> auth_context, grpc_endpoint* endpoint,
+ RefCountedPtr<grpc_authorization_policy_provider> provider);
+
+ bool IsAuthorized(const ClientMetadataHandle& initial_metadata);
+
+ RefCountedPtr<grpc_auth_context> auth_context_;
+ EvaluateArgs::PerChannelArgs per_channel_evaluate_args_;
+ RefCountedPtr<grpc_authorization_policy_provider> provider_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_SERVER_AUTHZ_FILTER_H
diff --git a/grpc/src/core/lib/security/authorization/matchers.cc b/grpc/src/core/lib/security/authorization/matchers.cc
index 5613b748..e4262d99 100644
--- a/grpc/src/core/lib/security/authorization/matchers.cc
+++ b/grpc/src/core/lib/security/authorization/matchers.cc
@@ -16,58 +16,51 @@
#include "src/core/lib/security/authorization/matchers.h"
-namespace grpc_core {
+#include <grpc/grpc_security_constants.h>
-namespace {
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
-bool AuthenticatedMatchesHelper(const EvaluateArgs& args,
- const StringMatcher& matcher) {
- if (args.GetTransportSecurityType() != GRPC_SSL_TRANSPORT_SECURITY_TYPE) {
- // Connection is not authenticated.
- return false;
- }
- if (matcher.string_matcher().empty()) {
- // Allows any authenticated user.
- return true;
- }
- absl::string_view spiffe_id = args.GetSpiffeId();
- if (!spiffe_id.empty()) {
- return matcher.Match(spiffe_id);
- }
- // TODO(ashithasantosh): Check principal matches DNS SAN, followed by Subject
- // field from certificate. This requires updating tsi_peer to expose these
- // fields.
- return false;
-}
-
-} // namespace
+namespace grpc_core {
std::unique_ptr<AuthorizationMatcher> AuthorizationMatcher::Create(
Rbac::Permission permission) {
switch (permission.type) {
- case Rbac::Permission::RuleType::kAnd:
- return absl::make_unique<AndAuthorizationMatcher>(
- std::move(permission.permissions), permission.not_rule);
- case Rbac::Permission::RuleType::kOr:
- return absl::make_unique<OrAuthorizationMatcher>(
- std::move(permission.permissions), permission.not_rule);
+ case Rbac::Permission::RuleType::kAnd: {
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
+ for (const auto& rule : permission.permissions) {
+ matchers.push_back(AuthorizationMatcher::Create(std::move(*rule)));
+ }
+ return absl::make_unique<AndAuthorizationMatcher>(std::move(matchers));
+ }
+ case Rbac::Permission::RuleType::kOr: {
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
+ for (const auto& rule : permission.permissions) {
+ matchers.push_back(AuthorizationMatcher::Create(std::move(*rule)));
+ }
+ return absl::make_unique<OrAuthorizationMatcher>(std::move(matchers));
+ }
+ case Rbac::Permission::RuleType::kNot:
+ return absl::make_unique<NotAuthorizationMatcher>(
+ AuthorizationMatcher::Create(std::move(*permission.permissions[0])));
case Rbac::Permission::RuleType::kAny:
- return absl::make_unique<AlwaysAuthorizationMatcher>(permission.not_rule);
+ return absl::make_unique<AlwaysAuthorizationMatcher>();
case Rbac::Permission::RuleType::kHeader:
return absl::make_unique<HeaderAuthorizationMatcher>(
- std::move(permission.header_matcher), permission.not_rule);
+ std::move(permission.header_matcher));
case Rbac::Permission::RuleType::kPath:
return absl::make_unique<PathAuthorizationMatcher>(
- std::move(permission.string_matcher), permission.not_rule);
+ std::move(permission.string_matcher));
case Rbac::Permission::RuleType::kDestIp:
- return absl::make_unique<IpAuthorizationMatcher>(std::move(permission.ip),
- permission.not_rule);
+ return absl::make_unique<IpAuthorizationMatcher>(
+ IpAuthorizationMatcher::Type::kDestIp, std::move(permission.ip));
case Rbac::Permission::RuleType::kDestPort:
- return absl::make_unique<PortAuthorizationMatcher>(permission.port,
- permission.not_rule);
+ return absl::make_unique<PortAuthorizationMatcher>(permission.port);
+ case Rbac::Permission::RuleType::kMetadata:
+ return absl::make_unique<MetadataAuthorizationMatcher>(permission.invert);
case Rbac::Permission::RuleType::kReqServerName:
return absl::make_unique<ReqServerNameAuthorizationMatcher>(
- std::move(permission.string_matcher), permission.not_rule);
+ std::move(permission.string_matcher));
}
return nullptr;
}
@@ -75,124 +68,156 @@ std::unique_ptr<AuthorizationMatcher> AuthorizationMatcher::Create(
std::unique_ptr<AuthorizationMatcher> AuthorizationMatcher::Create(
Rbac::Principal principal) {
switch (principal.type) {
- case Rbac::Principal::RuleType::kAnd:
- return absl::make_unique<AndAuthorizationMatcher>(
- std::move(principal.principals), principal.not_rule);
- case Rbac::Principal::RuleType::kOr:
- return absl::make_unique<OrAuthorizationMatcher>(
- std::move(principal.principals), principal.not_rule);
+ case Rbac::Principal::RuleType::kAnd: {
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
+ for (const auto& id : principal.principals) {
+ matchers.push_back(AuthorizationMatcher::Create(std::move(*id)));
+ }
+ return absl::make_unique<AndAuthorizationMatcher>(std::move(matchers));
+ }
+ case Rbac::Principal::RuleType::kOr: {
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers;
+ for (const auto& id : principal.principals) {
+ matchers.push_back(AuthorizationMatcher::Create(std::move(*id)));
+ }
+ return absl::make_unique<OrAuthorizationMatcher>(std::move(matchers));
+ }
+ case Rbac::Principal::RuleType::kNot:
+ return absl::make_unique<NotAuthorizationMatcher>(
+ AuthorizationMatcher::Create(std::move(*principal.principals[0])));
case Rbac::Principal::RuleType::kAny:
- return absl::make_unique<AlwaysAuthorizationMatcher>(principal.not_rule);
+ return absl::make_unique<AlwaysAuthorizationMatcher>();
case Rbac::Principal::RuleType::kPrincipalName:
return absl::make_unique<AuthenticatedAuthorizationMatcher>(
- std::move(principal.string_matcher), principal.not_rule);
+ std::move(principal.string_matcher));
case Rbac::Principal::RuleType::kSourceIp:
+ return absl::make_unique<IpAuthorizationMatcher>(
+ IpAuthorizationMatcher::Type::kSourceIp, std::move(principal.ip));
case Rbac::Principal::RuleType::kDirectRemoteIp:
+ return absl::make_unique<IpAuthorizationMatcher>(
+ IpAuthorizationMatcher::Type::kDirectRemoteIp,
+ std::move(principal.ip));
case Rbac::Principal::RuleType::kRemoteIp:
- return absl::make_unique<IpAuthorizationMatcher>(std::move(principal.ip),
- principal.not_rule);
+ return absl::make_unique<IpAuthorizationMatcher>(
+ IpAuthorizationMatcher::Type::kRemoteIp, std::move(principal.ip));
case Rbac::Principal::RuleType::kHeader:
return absl::make_unique<HeaderAuthorizationMatcher>(
- std::move(principal.header_matcher), principal.not_rule);
+ std::move(principal.header_matcher));
case Rbac::Principal::RuleType::kPath:
return absl::make_unique<PathAuthorizationMatcher>(
- std::move(principal.string_matcher), principal.not_rule);
+ std::move(principal.string_matcher.value()));
+ case Rbac::Principal::RuleType::kMetadata:
+ return absl::make_unique<MetadataAuthorizationMatcher>(principal.invert);
}
return nullptr;
}
-AndAuthorizationMatcher::AndAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Permission>> rules, bool not_rule)
- : not_rule_(not_rule) {
- for (auto& rule : rules) {
- matchers_.push_back(AuthorizationMatcher::Create(std::move(*rule)));
- }
-}
-
-AndAuthorizationMatcher::AndAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Principal>> ids, bool not_rule)
- : not_rule_(not_rule) {
- for (const auto& id : ids) {
- matchers_.push_back(AuthorizationMatcher::Create(std::move(*id)));
- }
-}
-
bool AndAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
- bool matches = true;
for (const auto& matcher : matchers_) {
if (!matcher->Matches(args)) {
- matches = false;
- break;
+ return false;
}
}
- return matches != not_rule_;
-}
-
-OrAuthorizationMatcher::OrAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Permission>> rules, bool not_rule)
- : not_rule_(not_rule) {
- for (const auto& rule : rules) {
- matchers_.push_back(AuthorizationMatcher::Create(std::move(*rule)));
- }
-}
-
-OrAuthorizationMatcher::OrAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Principal>> ids, bool not_rule)
- : not_rule_(not_rule) {
- for (const auto& id : ids) {
- matchers_.push_back(AuthorizationMatcher::Create(std::move(*id)));
- }
+ return true;
}
bool OrAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
- bool matches = false;
for (const auto& matcher : matchers_) {
if (matcher->Matches(args)) {
- matches = true;
- break;
+ return true;
}
}
- return matches != not_rule_;
+ return false;
+}
+
+bool NotAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
+ return !matcher_->Matches(args);
}
bool HeaderAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
std::string concatenated_value;
- bool matches =
- matcher_.Match(args.GetHeaderValue(matcher_.name(), &concatenated_value));
- return matches != not_rule_;
+ return matcher_.Match(
+ args.GetHeaderValue(matcher_.name(), &concatenated_value));
+}
+
+IpAuthorizationMatcher::IpAuthorizationMatcher(Type type, Rbac::CidrRange range)
+ : type_(type), prefix_len_(range.prefix_len) {
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&subnet_address_, range.address_prefix.c_str(),
+ /*port does not matter here*/ 0);
+ if (error == GRPC_ERROR_NONE) {
+ grpc_sockaddr_mask_bits(&subnet_address_, prefix_len_);
+ } else {
+ gpr_log(GPR_DEBUG, "CidrRange address %s is not IPv4/IPv6. Error: %s",
+ range.address_prefix.c_str(), grpc_error_std_string(error).c_str());
+ }
+ GRPC_ERROR_UNREF(error);
}
-// TODO(ashithasantosh): Implement IpAuthorizationMatcher::Matches.
-bool IpAuthorizationMatcher::Matches(const EvaluateArgs&) const {
- bool matches = false;
- return matches != not_rule_;
+bool IpAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
+ grpc_resolved_address address;
+ switch (type_) {
+ case Type::kDestIp: {
+ address = args.GetLocalAddress();
+ break;
+ }
+ case Type::kSourceIp:
+ case Type::kDirectRemoteIp:
+ case Type::kRemoteIp: {
+ address = args.GetPeerAddress();
+ break;
+ }
+ default:
+ return false;
+ }
+ return grpc_sockaddr_match_subnet(&address, &subnet_address_, prefix_len_);
}
bool PortAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
- bool matches = (port_ == args.GetLocalPort());
- return matches != not_rule_;
+ return port_ == args.GetLocalPort();
}
bool AuthenticatedAuthorizationMatcher::Matches(
const EvaluateArgs& args) const {
- bool matches = AuthenticatedMatchesHelper(args, matcher_);
- return matches != not_rule_;
+ if (args.GetTransportSecurityType() != GRPC_SSL_TRANSPORT_SECURITY_TYPE &&
+ args.GetTransportSecurityType() != GRPC_TLS_TRANSPORT_SECURITY_TYPE) {
+ // Connection is not authenticated.
+ return false;
+ }
+ if (!matcher_.has_value()) {
+ // Allows any authenticated user.
+ return true;
+ }
+ std::vector<absl::string_view> uri_sans = args.GetUriSans();
+ if (!uri_sans.empty()) {
+ for (const auto& uri : uri_sans) {
+ if (matcher_->Match(uri)) {
+ return true;
+ }
+ }
+ }
+ std::vector<absl::string_view> dns_sans = args.GetDnsSans();
+ if (!dns_sans.empty()) {
+ for (const auto& dns : dns_sans) {
+ if (matcher_->Match(dns)) {
+ return true;
+ }
+ }
+ }
+ return matcher_->Match(args.GetSubject());
}
bool ReqServerNameAuthorizationMatcher::Matches(const EvaluateArgs&) const {
- // Currently we do not support matching rules containing
- // "requested_server_name".
- bool matches = false;
- return matches != not_rule_;
+ // Currently we only support matching against an empty string.
+ return matcher_.Match("");
}
bool PathAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
- bool matches = false;
absl::string_view path = args.GetPath();
if (!path.empty()) {
- matches = matcher_.Match(path);
+ return matcher_.Match(path);
}
- return matches != not_rule_;
+ return false;
}
bool PolicyAuthorizationMatcher::Matches(const EvaluateArgs& args) const {
diff --git a/grpc/src/core/lib/security/authorization/matchers.h b/grpc/src/core/lib/security/authorization/matchers.h
index 86b40ee7..a64d6b20 100644
--- a/grpc/src/core/lib/security/authorization/matchers.h
+++ b/grpc/src/core/lib/security/authorization/matchers.h
@@ -47,110 +47,119 @@ class AuthorizationMatcher {
class AlwaysAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit AlwaysAuthorizationMatcher(bool not_rule = false)
- : not_rule_(not_rule) {}
+ explicit AlwaysAuthorizationMatcher() = default;
- bool Matches(const EvaluateArgs&) const override { return !not_rule_; }
-
- private:
- // Negates matching the provided permission/principal.
- const bool not_rule_;
+ bool Matches(const EvaluateArgs&) const override { return true; }
};
class AndAuthorizationMatcher : public AuthorizationMatcher {
public:
explicit AndAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Permission>> rules,
- bool not_rule = false);
- explicit AndAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Principal>> ids, bool not_rule = false);
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers)
+ : matchers_(std::move(matchers)) {}
bool Matches(const EvaluateArgs& args) const override;
private:
std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
class OrAuthorizationMatcher : public AuthorizationMatcher {
public:
explicit OrAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Permission>> rules,
- bool not_rule = false);
- explicit OrAuthorizationMatcher(
- std::vector<std::unique_ptr<Rbac::Principal>> ids, bool not_rule = false);
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers)
+ : matchers_(std::move(matchers)) {}
bool Matches(const EvaluateArgs& args) const override;
private:
std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
-// TODO(ashithasantosh): Add matcher implementation for metadata field.
+// Negates matching the provided permission/principal.
+class NotAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit NotAuthorizationMatcher(
+ std::unique_ptr<AuthorizationMatcher> matcher)
+ : matcher_(std::move(matcher)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ std::unique_ptr<AuthorizationMatcher> matcher_;
+};
+
+class MetadataAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit MetadataAuthorizationMatcher(bool invert) : invert_(invert) {}
+
+ // In RBAC, metadata refers to the Envoy metadata which has no relation to
+ // gRPC metadata. Envoy metadata is a generic state shared between filters,
+ // which has no gRPC equivalent. RBAC implementations in gRPC will treat Envoy
+ // metadata as an empty map. Since ValueMatcher can only match if a value is
+ // present (even NullMatch), the metadata matcher will not match unless invert
+ // is set to true.
+ bool Matches(const EvaluateArgs&) const override { return invert_; }
+
+ private:
+ const bool invert_;
+};
// Perform a match against HTTP headers.
class HeaderAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit HeaderAuthorizationMatcher(HeaderMatcher matcher,
- bool not_rule = false)
- : matcher_(std::move(matcher)), not_rule_(not_rule) {}
+ explicit HeaderAuthorizationMatcher(HeaderMatcher matcher)
+ : matcher_(std::move(matcher)) {}
bool Matches(const EvaluateArgs& args) const override;
private:
const HeaderMatcher matcher_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
// Perform a match against IP Cidr Range.
-// TODO(ashithasantosh): Handle type of Ip or use seperate matchers for each
-// type. Implement Match functionality, this would require updating EvaluateArgs
-// getters, to return format of IP as well.
class IpAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit IpAuthorizationMatcher(Rbac::CidrRange range, bool not_rule = false)
- : range_(std::move(range)), not_rule_(not_rule) {}
+ enum class Type {
+ kDestIp,
+ kSourceIp,
+ kDirectRemoteIp,
+ kRemoteIp,
+ };
- bool Matches(const EvaluateArgs&) const override;
+ IpAuthorizationMatcher(Type type, Rbac::CidrRange range);
+
+ bool Matches(const EvaluateArgs& args) const override;
private:
- const Rbac::CidrRange range_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
+ const Type type_;
+ // Subnet masked address.
+ grpc_resolved_address subnet_address_;
+ const uint32_t prefix_len_;
};
// Perform a match against port number of the destination (local) address.
class PortAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit PortAuthorizationMatcher(int port, bool not_rule = false)
- : port_(port), not_rule_(not_rule) {}
+ explicit PortAuthorizationMatcher(int port) : port_(port) {}
bool Matches(const EvaluateArgs& args) const override;
private:
const int port_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
// Matches the principal name as described in the peer certificate. Uses URI SAN
// or DNS SAN in that order, otherwise uses subject field.
class AuthenticatedAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit AuthenticatedAuthorizationMatcher(StringMatcher auth,
- bool not_rule = false)
- : matcher_(std::move(auth)), not_rule_(not_rule) {}
+ explicit AuthenticatedAuthorizationMatcher(absl::optional<StringMatcher> auth)
+ : matcher_(std::move(auth)) {}
bool Matches(const EvaluateArgs& args) const override;
private:
- const StringMatcher matcher_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
+ const absl::optional<StringMatcher> matcher_;
};
// Perform a match against the request server from the client's connection
@@ -158,29 +167,25 @@ class AuthenticatedAuthorizationMatcher : public AuthorizationMatcher {
class ReqServerNameAuthorizationMatcher : public AuthorizationMatcher {
public:
explicit ReqServerNameAuthorizationMatcher(
- StringMatcher requested_server_name, bool not_rule = false)
- : matcher_(std::move(requested_server_name)), not_rule_(not_rule) {}
+ StringMatcher requested_server_name)
+ : matcher_(std::move(requested_server_name)) {}
bool Matches(const EvaluateArgs&) const override;
private:
const StringMatcher matcher_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
// Perform a match against the path header of HTTP request.
class PathAuthorizationMatcher : public AuthorizationMatcher {
public:
- explicit PathAuthorizationMatcher(StringMatcher path, bool not_rule = false)
- : matcher_(std::move(path)), not_rule_(not_rule) {}
+ explicit PathAuthorizationMatcher(StringMatcher path)
+ : matcher_(std::move(path)) {}
bool Matches(const EvaluateArgs& args) const override;
private:
const StringMatcher matcher_;
- // Negates matching the provided permission/principal.
- const bool not_rule_;
};
// Performs a match for policy field in RBAC, which is a collection of
diff --git a/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h b/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
index 34a31a6d..82ece385 100644
--- a/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
+++ b/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
@@ -21,8 +21,8 @@
#include <vector>
#include "absl/status/statusor.h"
-
#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"
diff --git a/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h b/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
index 9aab0d2a..1cf99159 100644
--- a/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
+++ b/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
@@ -22,8 +22,8 @@
#include <vector>
#include "absl/status/statusor.h"
-
#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"
diff --git a/grpc/src/core/lib/security/authorization/rbac_policy.cc b/grpc/src/core/lib/security/authorization/rbac_policy.cc
index a081c514..f43eefc1 100644
--- a/grpc/src/core/lib/security/authorization/rbac_policy.cc
+++ b/grpc/src/core/lib/security/authorization/rbac_policy.cc
@@ -75,33 +75,87 @@ std::string Rbac::CidrRange::ToString() const {
// Permission
//
-Rbac::Permission::Permission(
- Permission::RuleType type,
- std::vector<std::unique_ptr<Permission>> permissions, bool not_rule)
- : type(type), permissions(std::move(permissions)), not_rule(not_rule) {}
-Rbac::Permission::Permission(Permission::RuleType type, bool not_rule)
- : type(type), not_rule(not_rule) {}
-Rbac::Permission::Permission(Permission::RuleType type,
- HeaderMatcher header_matcher, bool not_rule)
- : type(type),
- header_matcher(std::move(header_matcher)),
- not_rule(not_rule) {}
-Rbac::Permission::Permission(Permission::RuleType type,
- StringMatcher string_matcher, bool not_rule)
- : type(type),
- string_matcher(std::move(string_matcher)),
- not_rule(not_rule) {}
-Rbac::Permission::Permission(Permission::RuleType type, CidrRange ip,
- bool not_rule)
- : type(type), ip(std::move(ip)), not_rule(not_rule) {}
-Rbac::Permission::Permission(Permission::RuleType type, int port, bool not_rule)
- : type(type), port(port), not_rule(not_rule) {}
+Rbac::Permission Rbac::Permission::MakeAndPermission(
+ std::vector<std::unique_ptr<Permission>> permissions) {
+ Permission permission;
+ permission.type = Permission::RuleType::kAnd;
+ permission.permissions = std::move(permissions);
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeOrPermission(
+ std::vector<std::unique_ptr<Permission>> permissions) {
+ Permission permission;
+ permission.type = Permission::RuleType::kOr;
+ permission.permissions = std::move(permissions);
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeNotPermission(Permission permission) {
+ Permission not_permission;
+ not_permission.type = Permission::RuleType::kNot;
+ not_permission.permissions.push_back(
+ absl::make_unique<Rbac::Permission>(std::move(permission)));
+ return not_permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeAnyPermission() {
+ Permission permission;
+ permission.type = Permission::RuleType::kAny;
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher header_matcher) {
+ Permission permission;
+ permission.type = Permission::RuleType::kHeader;
+ permission.header_matcher = std::move(header_matcher);
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakePathPermission(
+ StringMatcher string_matcher) {
+ Permission permission;
+ permission.type = Permission::RuleType::kPath;
+ permission.string_matcher = std::move(string_matcher);
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeDestIpPermission(CidrRange ip) {
+ Permission permission;
+ permission.type = Permission::RuleType::kDestIp;
+ permission.ip = std::move(ip);
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeDestPortPermission(int port) {
+ Permission permission;
+ permission.type = Permission::RuleType::kDestPort;
+ permission.port = port;
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeMetadataPermission(bool invert) {
+ Permission permission;
+ permission.type = Permission::RuleType::kMetadata;
+ permission.invert = invert;
+ return permission;
+}
+
+Rbac::Permission Rbac::Permission::MakeReqServerNamePermission(
+ StringMatcher string_matcher) {
+ Permission permission;
+ permission.type = Permission::RuleType::kReqServerName;
+ permission.string_matcher = std::move(string_matcher);
+ return permission;
+}
Rbac::Permission::Permission(Rbac::Permission&& other) noexcept
- : type(other.type), not_rule(other.not_rule) {
+ : type(other.type), invert(other.invert) {
switch (type) {
case RuleType::kAnd:
case RuleType::kOr:
+ case RuleType::kNot:
permissions = std::move(other.permissions);
break;
case RuleType::kAny:
@@ -124,10 +178,11 @@ Rbac::Permission::Permission(Rbac::Permission&& other) noexcept
Rbac::Permission& Rbac::Permission::operator=(
Rbac::Permission&& other) noexcept {
type = other.type;
- not_rule = other.not_rule;
+ invert = other.invert;
switch (type) {
case RuleType::kAnd:
case RuleType::kOr:
+ case RuleType::kNot:
permissions = std::move(other.permissions);
break;
case RuleType::kAny:
@@ -156,8 +211,7 @@ std::string Rbac::Permission::ToString() const {
for (const auto& permission : permissions) {
contents.push_back(permission->ToString());
}
- return absl::StrFormat("%sand=[%s]", not_rule ? "not " : "",
- absl::StrJoin(contents, ","));
+ return absl::StrFormat("and=[%s]", absl::StrJoin(contents, ","));
}
case RuleType::kOr: {
std::vector<std::string> contents;
@@ -165,25 +219,25 @@ std::string Rbac::Permission::ToString() const {
for (const auto& permission : permissions) {
contents.push_back(permission->ToString());
}
- return absl::StrFormat("%sor=[%s]", not_rule ? "not " : "",
- absl::StrJoin(contents, ","));
+ return absl::StrFormat("or=[%s]", absl::StrJoin(contents, ","));
}
+ case RuleType::kNot:
+ return absl::StrFormat("not %s", permissions[0]->ToString());
case RuleType::kAny:
- return absl::StrFormat("%sany", not_rule ? "not " : "");
+ return "any";
case RuleType::kHeader:
- return absl::StrFormat("%sheader=%s", not_rule ? "not " : "",
- header_matcher.ToString());
+ return absl::StrFormat("header=%s", header_matcher.ToString());
case RuleType::kPath:
- return absl::StrFormat("%spath=%s", not_rule ? "not " : "",
- string_matcher.ToString());
+ return absl::StrFormat("path=%s", string_matcher.ToString());
case RuleType::kDestIp:
- return absl::StrFormat("%sdest_ip=%s", not_rule ? "not " : "",
- ip.ToString());
+ return absl::StrFormat("dest_ip=%s", ip.ToString());
case RuleType::kDestPort:
- return absl::StrFormat("%sdest_port=%d", not_rule ? "not " : "", port);
+ return absl::StrFormat("dest_port=%d", port);
+ case RuleType::kMetadata:
+ return absl::StrFormat("%smetadata", invert ? "invert " : "");
case RuleType::kReqServerName:
- return absl::StrFormat("%srequested_server_name=%s",
- not_rule ? "not " : "", string_matcher.ToString());
+ return absl::StrFormat("requested_server_name=%s",
+ string_matcher.ToString());
default:
return "";
}
@@ -193,31 +247,94 @@ std::string Rbac::Permission::ToString() const {
// Principal
//
-Rbac::Principal::Principal(Principal::RuleType type,
- std::vector<std::unique_ptr<Principal>> principals,
- bool not_rule)
- : type(type), principals(std::move(principals)), not_rule(not_rule) {}
-Rbac::Principal::Principal(Principal::RuleType type, bool not_rule)
- : type(type), not_rule(not_rule) {}
-Rbac::Principal::Principal(Principal::RuleType type,
- StringMatcher string_matcher, bool not_rule)
- : type(type),
- string_matcher(std::move(string_matcher)),
- not_rule(not_rule) {}
-Rbac::Principal::Principal(Principal::RuleType type, CidrRange ip,
- bool not_rule)
- : type(type), ip(std::move(ip)), not_rule(not_rule) {}
-Rbac::Principal::Principal(Principal::RuleType type,
- HeaderMatcher header_matcher, bool not_rule)
- : type(type),
- header_matcher(std::move(header_matcher)),
- not_rule(not_rule) {}
+Rbac::Principal Rbac::Principal::MakeAndPrincipal(
+ std::vector<std::unique_ptr<Principal>> principals) {
+ Principal principal;
+ principal.type = Principal::RuleType::kAnd;
+ principal.principals = std::move(principals);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeOrPrincipal(
+ std::vector<std::unique_ptr<Principal>> principals) {
+ Principal principal;
+ principal.type = Principal::RuleType::kOr;
+ principal.principals = std::move(principals);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeNotPrincipal(Principal principal) {
+ Principal not_principal;
+ not_principal.type = Principal::RuleType::kNot;
+ not_principal.principals.push_back(
+ absl::make_unique<Rbac::Principal>(std::move(principal)));
+ return not_principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeAnyPrincipal() {
+ Principal principal;
+ principal.type = Principal::RuleType::kAny;
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeAuthenticatedPrincipal(
+ absl::optional<StringMatcher> string_matcher) {
+ Principal principal;
+ principal.type = Principal::RuleType::kPrincipalName;
+ principal.string_matcher = std::move(string_matcher);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeSourceIpPrincipal(CidrRange ip) {
+ Principal principal;
+ principal.type = Principal::RuleType::kSourceIp;
+ principal.ip = std::move(ip);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeDirectRemoteIpPrincipal(CidrRange ip) {
+ Principal principal;
+ principal.type = Principal::RuleType::kDirectRemoteIp;
+ principal.ip = std::move(ip);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeRemoteIpPrincipal(CidrRange ip) {
+ Principal principal;
+ principal.type = Principal::RuleType::kRemoteIp;
+ principal.ip = std::move(ip);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeHeaderPrincipal(
+ HeaderMatcher header_matcher) {
+ Principal principal;
+ principal.type = Principal::RuleType::kHeader;
+ principal.header_matcher = std::move(header_matcher);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakePathPrincipal(
+ StringMatcher string_matcher) {
+ Principal principal;
+ principal.type = Principal::RuleType::kPath;
+ principal.string_matcher = std::move(string_matcher);
+ return principal;
+}
+
+Rbac::Principal Rbac::Principal::MakeMetadataPrincipal(bool invert) {
+ Principal principal;
+ principal.type = Principal::RuleType::kMetadata;
+ principal.invert = invert;
+ return principal;
+}
Rbac::Principal::Principal(Rbac::Principal&& other) noexcept
- : type(other.type), not_rule(other.not_rule) {
+ : type(other.type), invert(other.invert) {
switch (type) {
case RuleType::kAnd:
case RuleType::kOr:
+ case RuleType::kNot:
principals = std::move(other.principals);
break;
case RuleType::kAny:
@@ -236,10 +353,11 @@ Rbac::Principal::Principal(Rbac::Principal&& other) noexcept
Rbac::Principal& Rbac::Principal::operator=(Rbac::Principal&& other) noexcept {
type = other.type;
- not_rule = other.not_rule;
+ invert = other.invert;
switch (type) {
case RuleType::kAnd:
case RuleType::kOr:
+ case RuleType::kNot:
principals = std::move(other.principals);
break;
case RuleType::kAny:
@@ -265,8 +383,7 @@ std::string Rbac::Principal::ToString() const {
for (const auto& principal : principals) {
contents.push_back(principal->ToString());
}
- return absl::StrFormat("%sand=[%s]", not_rule ? "not " : "",
- absl::StrJoin(contents, ","));
+ return absl::StrFormat("and=[%s]", absl::StrJoin(contents, ","));
}
case RuleType::kOr: {
std::vector<std::string> contents;
@@ -274,29 +391,26 @@ std::string Rbac::Principal::ToString() const {
for (const auto& principal : principals) {
contents.push_back(principal->ToString());
}
- return absl::StrFormat("%sor=[%s]", not_rule ? "not " : "",
- absl::StrJoin(contents, ","));
+ return absl::StrFormat("or=[%s]", absl::StrJoin(contents, ","));
}
+ case RuleType::kNot:
+ return absl::StrFormat("not %s", principals[0]->ToString());
case RuleType::kAny:
- return absl::StrFormat("%sany", not_rule ? "not " : "");
+ return "any";
case RuleType::kPrincipalName:
- return absl::StrFormat("%sprincipal_name=%s", not_rule ? "not " : "",
- string_matcher.ToString());
+ return absl::StrFormat("principal_name=%s", string_matcher->ToString());
case RuleType::kSourceIp:
- return absl::StrFormat("%ssource_ip=%s", not_rule ? "not " : "",
- ip.ToString());
+ return absl::StrFormat("source_ip=%s", ip.ToString());
case RuleType::kDirectRemoteIp:
- return absl::StrFormat("%sdirect_remote_ip=%s", not_rule ? "not " : "",
- ip.ToString());
+ return absl::StrFormat("direct_remote_ip=%s", ip.ToString());
case RuleType::kRemoteIp:
- return absl::StrFormat("%sremote_ip=%s", not_rule ? "not " : "",
- ip.ToString());
+ return absl::StrFormat("remote_ip=%s", ip.ToString());
case RuleType::kHeader:
- return absl::StrFormat("%sheader=%s", not_rule ? "not " : "",
- header_matcher.ToString());
+ return absl::StrFormat("header=%s", header_matcher.ToString());
case RuleType::kPath:
- return absl::StrFormat("%spath=%s", not_rule ? "not " : "",
- string_matcher.ToString());
+ return absl::StrFormat("path=%s", string_matcher->ToString());
+ case RuleType::kMetadata:
+ return absl::StrFormat("%smetadata", invert ? "invert " : "");
default:
return "";
}
diff --git a/grpc/src/core/lib/security/authorization/rbac_policy.h b/grpc/src/core/lib/security/authorization/rbac_policy.h
index 027bf92e..df26ba56 100644
--- a/grpc/src/core/lib/security/authorization/rbac_policy.h
+++ b/grpc/src/core/lib/security/authorization/rbac_policy.h
@@ -44,56 +44,59 @@ struct Rbac {
uint32_t prefix_len;
};
- // TODO(ashithasantosh): Add metadata field to Permission and Principal.
+ // TODO(ashithasantosh): Support for destination_port_range.
struct Permission {
enum class RuleType {
kAnd,
kOr,
+ kNot,
kAny,
kHeader,
kPath,
kDestIp,
kDestPort,
+ kMetadata,
kReqServerName,
};
+ static Permission MakeAndPermission(
+ std::vector<std::unique_ptr<Permission>> permissions);
+ static Permission MakeOrPermission(
+ std::vector<std::unique_ptr<Permission>> permissions);
+ static Permission MakeNotPermission(Permission permission);
+ static Permission MakeAnyPermission();
+ static Permission MakeHeaderPermission(HeaderMatcher header_matcher);
+ static Permission MakePathPermission(StringMatcher string_matcher);
+ static Permission MakeDestIpPermission(CidrRange ip);
+ static Permission MakeDestPortPermission(int port);
+ // All the other fields in MetadataMatcher are ignored except invert.
+ static Permission MakeMetadataPermission(bool invert);
+ static Permission MakeReqServerNamePermission(StringMatcher string_matcher);
+
Permission() = default;
- // For AND/OR RuleType.
- Permission(Permission::RuleType type,
- std::vector<std::unique_ptr<Permission>> permissions,
- bool not_rule = false);
- // For ANY RuleType.
- explicit Permission(Permission::RuleType type, bool not_rule = false);
- // For HEADER RuleType.
- Permission(Permission::RuleType type, HeaderMatcher header_matcher,
- bool not_rule = false);
- // For PATH/REQ_SERVER_NAME RuleType.
- Permission(Permission::RuleType type, StringMatcher string_matcher,
- bool not_rule = false);
- // For DEST_IP RuleType.
- Permission(Permission::RuleType type, CidrRange ip, bool not_rule = false);
- // For DEST_PORT RuleType.
- Permission(Permission::RuleType type, int port, bool not_rule = false);
Permission(Permission&& other) noexcept;
Permission& operator=(Permission&& other) noexcept;
std::string ToString() const;
- RuleType type;
+ RuleType type = RuleType::kAnd;
HeaderMatcher header_matcher;
StringMatcher string_matcher;
CidrRange ip;
int port;
- // For type AND/OR.
+ // For type kAnd/kOr/kNot. For kNot type, the vector will have only one
+ // element.
std::vector<std::unique_ptr<Permission>> permissions;
- bool not_rule = false;
+ // For kMetadata
+ bool invert = false;
};
struct Principal {
enum class RuleType {
kAnd,
kOr,
+ kNot,
kAny,
kPrincipalName,
kSourceIp,
@@ -101,36 +104,41 @@ struct Rbac {
kRemoteIp,
kHeader,
kPath,
+ kMetadata,
};
+ static Principal MakeAndPrincipal(
+ std::vector<std::unique_ptr<Principal>> principals);
+ static Principal MakeOrPrincipal(
+ std::vector<std::unique_ptr<Principal>> principals);
+ static Principal MakeNotPrincipal(Principal principal);
+ static Principal MakeAnyPrincipal();
+ static Principal MakeAuthenticatedPrincipal(
+ absl::optional<StringMatcher> string_matcher);
+ static Principal MakeSourceIpPrincipal(CidrRange ip);
+ static Principal MakeDirectRemoteIpPrincipal(CidrRange ip);
+ static Principal MakeRemoteIpPrincipal(CidrRange ip);
+ static Principal MakeHeaderPrincipal(HeaderMatcher header_matcher);
+ static Principal MakePathPrincipal(StringMatcher string_matcher);
+ // All the other fields in MetadataMatcher are ignored except invert.
+ static Principal MakeMetadataPrincipal(bool invert);
+
Principal() = default;
- // For AND/OR RuleType.
- Principal(Principal::RuleType type,
- std::vector<std::unique_ptr<Principal>> principals,
- bool not_rule = false);
- // For ANY RuleType.
- explicit Principal(Principal::RuleType type, bool not_rule = false);
- // For PRINCIPAL_NAME/PATH RuleType.
- Principal(Principal::RuleType type, StringMatcher string_matcher,
- bool not_rule = false);
- // For SOURCE_IP/DIRECT_REMOTE_IP/REMOTE_IP RuleType.
- Principal(Principal::RuleType type, CidrRange ip, bool not_rule = false);
- // For HEADER RuleType.
- Principal(Principal::RuleType type, HeaderMatcher header_matcher,
- bool not_rule = false);
Principal(Principal&& other) noexcept;
Principal& operator=(Principal&& other) noexcept;
std::string ToString() const;
- RuleType type;
+ RuleType type = RuleType::kAnd;
HeaderMatcher header_matcher;
- StringMatcher string_matcher;
+ absl::optional<StringMatcher> string_matcher;
CidrRange ip;
- // For type AND/OR.
+ // For type kAnd/kOr/kNot. For kNot type, the vector will have only one
+ // element.
std::vector<std::unique_ptr<Principal>> principals;
- bool not_rule = false;
+ // For kMetadata
+ bool invert = false;
};
struct Policy {
diff --git a/grpc/src/core/lib/security/authorization/rbac_translator.cc b/grpc/src/core/lib/security/authorization/rbac_translator.cc
index ea5599dd..01d9c0eb 100644
--- a/grpc/src/core/lib/security/authorization/rbac_translator.cc
+++ b/grpc/src/core/lib/security/authorization/rbac_translator.cc
@@ -20,6 +20,7 @@
#include "absl/strings/str_format.h"
#include "absl/strings/strip.h"
+#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/matchers/matchers.h"
namespace grpc_core {
@@ -29,8 +30,9 @@ namespace {
absl::string_view GetMatcherType(absl::string_view value,
StringMatcher::Type* type) {
if (value == "*") {
- *type = StringMatcher::Type::kPrefix;
- return "";
+ *type = StringMatcher::Type::kSafeRegex;
+ // Presence match checks for non empty strings.
+ return ".+";
} else if (absl::StartsWith(value, "*")) {
*type = StringMatcher::Type::kSuffix;
return absl::StripPrefix(value, "*");
@@ -56,6 +58,24 @@ absl::StatusOr<HeaderMatcher> GetHeaderMatcher(absl::string_view name,
matcher);
}
+bool IsUnsupportedHeader(absl::string_view header_name) {
+ static const char* const kUnsupportedHeaders[] = {"host",
+ "connection",
+ "keep-alive",
+ "proxy-authenticate",
+ "proxy-authorization",
+ "te",
+ "trailer",
+ "transfer-encoding",
+ "upgrade"};
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(kUnsupportedHeaders); ++i) {
+ if (absl::EqualsIgnoreCase(header_name, kUnsupportedHeaders[i])) {
+ return true;
+ }
+ }
+ return false;
+}
+
absl::StatusOr<Rbac::Principal> ParsePrincipalsArray(const Json& json) {
std::vector<std::unique_ptr<Rbac::Principal>> principal_names;
for (size_t i = 0; i < json.array_value().size(); ++i) {
@@ -71,11 +91,10 @@ absl::StatusOr<Rbac::Principal> ParsePrincipalsArray(const Json& json) {
matcher_or.status().message()));
}
principal_names.push_back(absl::make_unique<Rbac::Principal>(
- Rbac::Principal::RuleType::kPrincipalName,
- std::move(matcher_or.value())));
+ Rbac::Principal::MakeAuthenticatedPrincipal(
+ std::move(matcher_or.value()))));
}
- return Rbac::Principal(Rbac::Principal::RuleType::kOr,
- std::move(principal_names));
+ return Rbac::Principal::MakeOrPrincipal(std::move(principal_names));
}
absl::StatusOr<Rbac::Principal> ParsePeer(const Json& json) {
@@ -93,9 +112,9 @@ absl::StatusOr<Rbac::Principal> ParsePeer(const Json& json) {
}
}
if (peer.empty()) {
- return Rbac::Principal(Rbac::Principal::RuleType::kAny);
+ return Rbac::Principal::MakeAnyPrincipal();
}
- return Rbac::Principal(Rbac::Principal::RuleType::kAnd, std::move(peer));
+ return Rbac::Principal::MakeAndPrincipal(std::move(peer));
}
absl::StatusOr<Rbac::Permission> ParseHeaderValues(
@@ -117,9 +136,9 @@ absl::StatusOr<Rbac::Permission> ParseHeaderValues(
absl::StrCat("\"values\" ", i, ": ", matcher_or.status().message()));
}
values.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader, std::move(matcher_or.value())));
+ Rbac::Permission::MakeHeaderPermission(std::move(matcher_or.value()))));
}
- return Rbac::Permission(Rbac::Permission::RuleType::kOr, std::move(values));
+ return Rbac::Permission::MakeOrPermission(std::move(values));
}
absl::StatusOr<Rbac::Permission> ParseHeaders(const Json& json) {
@@ -131,10 +150,9 @@ absl::StatusOr<Rbac::Permission> ParseHeaders(const Json& json) {
return absl::InvalidArgumentError("\"key\" is not a string.");
}
absl::string_view header_name = it->second.string_value();
- // TODO(ashithasantosh): Add connection headers below.
if (absl::StartsWith(header_name, ":") ||
- absl::StartsWith(header_name, "grpc-") || header_name == "host" ||
- header_name == "Host") {
+ absl::StartsWith(header_name, "grpc-") ||
+ IsUnsupportedHeader(header_name)) {
return absl::InvalidArgumentError(
absl::StrFormat("Unsupported \"key\" %s.", header_name));
}
@@ -165,7 +183,7 @@ absl::StatusOr<Rbac::Permission> ParseHeadersArray(const Json& json) {
headers.push_back(
absl::make_unique<Rbac::Permission>(std::move(headers_or.value())));
}
- return Rbac::Permission(Rbac::Permission::RuleType::kAnd, std::move(headers));
+ return Rbac::Permission::MakeAndPermission(std::move(headers));
}
absl::StatusOr<Rbac::Permission> ParsePathsArray(const Json& json) {
@@ -183,9 +201,9 @@ absl::StatusOr<Rbac::Permission> ParsePathsArray(const Json& json) {
absl::StrCat("\"paths\" ", i, ": ", matcher_or.status().message()));
}
paths.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kPath, std::move(matcher_or.value())));
+ Rbac::Permission::MakePathPermission(std::move(matcher_or.value()))));
}
- return Rbac::Permission(Rbac::Permission::RuleType::kOr, std::move(paths));
+ return Rbac::Permission::MakeOrPermission(std::move(paths));
}
absl::StatusOr<Rbac::Permission> ParseRequest(const Json& json) {
@@ -215,9 +233,9 @@ absl::StatusOr<Rbac::Permission> ParseRequest(const Json& json) {
}
}
if (request.empty()) {
- return Rbac::Permission(Rbac::Permission::RuleType::kAny);
+ return Rbac::Permission::MakeAnyPermission();
}
- return Rbac::Permission(Rbac::Permission::RuleType::kAnd, std::move(request));
+ return Rbac::Permission::MakeAndPermission(std::move(request));
}
absl::StatusOr<Rbac::Policy> ParseRules(const Json& json) {
@@ -231,7 +249,7 @@ absl::StatusOr<Rbac::Policy> ParseRules(const Json& json) {
if (!peer_or.ok()) return peer_or.status();
principals = std::move(peer_or.value());
} else {
- principals = Rbac::Principal(Rbac::Principal::RuleType::kAny);
+ principals = Rbac::Principal::MakeAnyPrincipal();
}
Rbac::Permission permissions;
it = json.object_value().find("request");
@@ -243,7 +261,7 @@ absl::StatusOr<Rbac::Policy> ParseRules(const Json& json) {
if (!request_or.ok()) return request_or.status();
permissions = std::move(request_or.value());
} else {
- permissions = Rbac::Permission(Rbac::Permission::RuleType::kAny);
+ permissions = Rbac::Permission::MakeAnyPermission();
}
return Rbac::Policy(std::move(permissions), std::move(principals));
}
@@ -301,7 +319,7 @@ absl::StatusOr<RbacPolicies> GenerateRbacPolicies(
Json json = Json::Parse(authz_policy, &error);
if (error != GRPC_ERROR_NONE) {
absl::Status status = absl::InvalidArgumentError(
- absl::StrCat("Failed to parse SDK authorization policy. Error: ",
+ absl::StrCat("Failed to parse gRPC authorization policy. Error: ",
grpc_error_std_string(error)));
GRPC_ERROR_UNREF(error);
return status;
diff --git a/grpc/src/core/lib/security/authorization/rbac_translator.h b/grpc/src/core/lib/security/authorization/rbac_translator.h
index 51d70248..4adab7dc 100644
--- a/grpc/src/core/lib/security/authorization/rbac_translator.h
+++ b/grpc/src/core/lib/security/authorization/rbac_translator.h
@@ -18,6 +18,7 @@
#include <grpc/support/port_platform.h>
#include "absl/status/statusor.h"
+
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/authorization/rbac_policy.h"
diff --git a/grpc/src/core/lib/security/context/security_context.cc b/grpc/src/core/lib/security/context/security_context.cc
index d760d82f..903bcb0e 100644
--- a/grpc/src/core/lib/security/context/security_context.cc
+++ b/grpc/src/core/lib/security/context/security_context.cc
@@ -18,22 +18,23 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/context/security_context.h"
+
#include <string.h>
+#include <grpc/grpc_security.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/gpr/string.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/security/context/security_context.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount(
false, "auth_context_refcount");
@@ -222,7 +223,7 @@ grpc_auth_property_iterator grpc_auth_context_peer_identity(
void grpc_auth_context::ensure_capacity() {
if (properties_.count == properties_.capacity) {
properties_.capacity =
- GPR_MAX(properties_.capacity + 8, properties_.capacity * 2);
+ std::max(properties_.capacity + 8, properties_.capacity * 2);
properties_.array = static_cast<grpc_auth_property*>(gpr_realloc(
properties_.array, properties_.capacity * sizeof(grpc_auth_property)));
}
@@ -234,7 +235,9 @@ void grpc_auth_context::add_property(const char* name, const char* value,
grpc_auth_property* prop = &properties_.array[properties_.count++];
prop->name = gpr_strdup(name);
prop->value = static_cast<char*>(gpr_malloc(value_length + 1));
- memcpy(prop->value, value, value_length);
+ if (value != nullptr) {
+ memcpy(prop->value, value, value_length);
+ }
prop->value[value_length] = '\0';
prop->value_length = value_length;
}
@@ -288,7 +291,9 @@ static void* auth_context_pointer_arg_copy(void* p) {
: ctx->Ref(DEBUG_LOCATION, "auth_context_pointer_arg").release();
}
-static int auth_context_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+static int auth_context_pointer_cmp(void* a, void* b) {
+ return grpc_core::QsortCompare(a, b);
+}
static const grpc_arg_pointer_vtable auth_context_pointer_vtable = {
auth_context_pointer_arg_copy, auth_context_pointer_arg_destroy,
diff --git a/grpc/src/core/lib/security/context/security_context.h b/grpc/src/core/lib/security/context/security_context.h
index 6ff4856e..f1d2fc2a 100644
--- a/grpc/src/core/lib/security/context/security_context.h
+++ b/grpc/src/core/lib/security/context/security_context.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.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/iomgr/pollset.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/security/credentials/credentials.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount;
@@ -43,6 +43,8 @@ struct grpc_auth_property_array {
void grpc_auth_property_reset(grpc_auth_property* property);
+#define GRPC_AUTH_CONTEXT_ARG "grpc.auth_context"
+
// This type is forward declared as a C struct and we cannot define it as a
// class. Otherwise, compiler will complain about type mismatch due to
// -Wmismatched-tags.
@@ -73,6 +75,12 @@ struct grpc_auth_context
}
}
+ static absl::string_view ChannelArgName() { return GRPC_AUTH_CONTEXT_ARG; }
+ static int ChannelArgsCompare(const grpc_auth_context* a,
+ const grpc_auth_context* b) {
+ return QsortCompare(a, b);
+ }
+
const grpc_auth_context* chained() const { return chained_.get(); }
const grpc_auth_property_array& properties() const { return properties_; }
@@ -142,7 +150,6 @@ grpc_server_security_context* grpc_server_security_context_create(
void grpc_server_security_context_destroy(void* ctx);
/* --- Channel args for auth context --- */
-#define GRPC_AUTH_CONTEXT_ARG "grpc.auth_context"
grpc_arg grpc_auth_context_to_arg(grpc_auth_context* c);
grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg);
diff --git a/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc b/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc
index 30acd749..037c8b4f 100644
--- a/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc
@@ -30,14 +30,12 @@
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
#include "src/core/lib/security/security_connector/alts/alts_security_connector.h"
-#define GRPC_CREDENTIALS_TYPE_ALTS "Alts"
#define GRPC_ALTS_HANDSHAKER_SERVICE_URL "metadata.google.internal.:8080"
grpc_alts_credentials::grpc_alts_credentials(
const grpc_alts_credentials_options* options,
const char* handshaker_service_url)
- : grpc_channel_credentials(GRPC_CREDENTIALS_TYPE_ALTS),
- options_(grpc_alts_credentials_options_copy(options)),
+ : options_(grpc_alts_credentials_options_copy(options)),
handshaker_service_url_(handshaker_service_url == nullptr
? gpr_strdup(GRPC_ALTS_HANDSHAKER_SERVICE_URL)
: gpr_strdup(handshaker_service_url)) {
@@ -58,11 +56,12 @@ grpc_alts_credentials::create_security_connector(
this->Ref(), std::move(call_creds), target_name);
}
+const char* grpc_alts_credentials::type() const { return "Alts"; }
+
grpc_alts_server_credentials::grpc_alts_server_credentials(
const grpc_alts_credentials_options* options,
const char* handshaker_service_url)
- : grpc_server_credentials(GRPC_CREDENTIALS_TYPE_ALTS),
- options_(grpc_alts_credentials_options_copy(options)),
+ : options_(grpc_alts_credentials_options_copy(options)),
handshaker_service_url_(handshaker_service_url == nullptr
? gpr_strdup(GRPC_ALTS_HANDSHAKER_SERVICE_URL)
: gpr_strdup(handshaker_service_url)) {
@@ -80,6 +79,8 @@ grpc_alts_server_credentials::~grpc_alts_server_credentials() {
gpr_free(handshaker_service_url_);
}
+const char* grpc_alts_server_credentials::type() const { return "Alts"; }
+
grpc_channel_credentials* grpc_alts_credentials_create_customized(
const grpc_alts_credentials_options* options,
const char* handshaker_service_url, bool enable_untrusted_alts) {
diff --git a/grpc/src/core/lib/security/credentials/alts/alts_credentials.h b/grpc/src/core/lib/security/credentials/alts/alts_credentials.h
index 8e1362c0..1a333b9e 100644
--- a/grpc/src/core/lib/security/credentials/alts/alts_credentials.h
+++ b/grpc/src/core/lib/security/credentials/alts/alts_credentials.h
@@ -39,11 +39,19 @@ class grpc_alts_credentials final : public grpc_channel_credentials {
const char* target_name, const grpc_channel_args* args,
grpc_channel_args** new_args) override;
+ const char* type() const override;
+
const grpc_alts_credentials_options* options() const { return options_; }
grpc_alts_credentials_options* mutable_options() { return options_; }
const char* handshaker_service_url() const { return handshaker_service_url_; }
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+ }
+
grpc_alts_credentials_options* options_;
char* handshaker_service_url_;
};
@@ -58,6 +66,8 @@ class grpc_alts_server_credentials final : public grpc_server_credentials {
grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* /* args */) override;
+ const char* type() const override;
+
const grpc_alts_credentials_options* options() const { return options_; }
grpc_alts_credentials_options* mutable_options() { return options_; }
const char* handshaker_service_url() const { return handshaker_service_url_; }
diff --git a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
index 8454fd75..0c6f5561 100644
--- a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
+++ b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
@@ -20,12 +20,12 @@
#ifdef GPR_LINUX
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/sync.h>
-#include <string.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
#define GRPC_ALTS_EXPECT_NAME_GOOGLE "Google"
#define GRPC_ALTS_EXPECT_NAME_GCE "Google Compute Engine"
diff --git a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
index b71f66a5..cb401025 100644
--- a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
+++ b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
@@ -20,10 +20,10 @@
#if !defined(GPR_LINUX) && !defined(GPR_WINDOWS)
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+
bool grpc_alts_is_running_on_gcp() {
gpr_log(GPR_INFO,
"ALTS: Platforms other than Linux and Windows are not supported");
diff --git a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
index 59432cff..5d2bdc14 100644
--- a/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
+++ b/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
@@ -20,8 +20,6 @@
#ifdef GPR_WINDOWS
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
-
#include <shellapi.h>
#include <stdio.h>
#include <tchar.h>
@@ -31,6 +29,8 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+
namespace grpc_core {
namespace internal {
diff --git a/grpc/src/core/lib/security/credentials/call_creds_util.cc b/grpc/src/core/lib/security/credentials/call_creds_util.cc
new file mode 100644
index 00000000..c04a52f0
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/call_creds_util.cc
@@ -0,0 +1,87 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/call_creds_util.h"
+
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+namespace grpc_core {
+
+namespace {
+
+struct ServiceUrlAndMethod {
+ std::string service_url;
+ absl::string_view method_name;
+};
+
+ServiceUrlAndMethod MakeServiceUrlAndMethod(
+ const ClientMetadataHandle& initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
+ auto service =
+ initial_metadata->get_pointer(HttpPathMetadata())->as_string_view();
+ auto last_slash = service.find_last_of('/');
+ absl::string_view method_name;
+ if (last_slash == absl::string_view::npos) {
+ gpr_log(GPR_ERROR, "No '/' found in fully qualified method name");
+ service = "";
+ method_name = "";
+ } else if (last_slash == 0) {
+ method_name = "";
+ } else {
+ method_name = service.substr(last_slash + 1);
+ service = service.substr(0, last_slash);
+ }
+ auto host_and_port =
+ initial_metadata->get_pointer(HttpAuthorityMetadata())->as_string_view();
+ absl::string_view url_scheme = args->security_connector->url_scheme();
+ if (url_scheme == GRPC_SSL_URL_SCHEME) {
+ // Remove the port if it is 443.
+ auto port_delimiter = host_and_port.find_last_of(':');
+ if (port_delimiter != absl::string_view::npos &&
+ host_and_port.substr(port_delimiter + 1) == "443") {
+ host_and_port = host_and_port.substr(0, port_delimiter);
+ }
+ }
+ return ServiceUrlAndMethod{
+ absl::StrCat(url_scheme, "://", host_and_port, service), method_name};
+}
+
+} // namespace
+
+std::string MakeJwtServiceUrl(
+ const ClientMetadataHandle& initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
+ return MakeServiceUrlAndMethod(initial_metadata, args).service_url;
+}
+
+grpc_auth_metadata_context MakePluginAuthMetadataContext(
+ const ClientMetadataHandle& initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
+ auto fields = MakeServiceUrlAndMethod(initial_metadata, args);
+ grpc_auth_metadata_context ctx;
+ memset(&ctx, 0, sizeof(ctx));
+ ctx.channel_auth_context = args->auth_context != nullptr
+ ? args->auth_context->Ref().release()
+ : nullptr;
+ ctx.service_url = gpr_strdup(fields.service_url.c_str());
+ ctx.method_name = gpr_strdup(std::string(fields.method_name).c_str());
+ return ctx;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/credentials/call_creds_util.h b/grpc/src/core/lib/security/credentials/call_creds_util.h
new file mode 100644
index 00000000..30b70dad
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/call_creds_util.h
@@ -0,0 +1,42 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CALL_CREDS_UTIL_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_CALL_CREDS_UTIL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/security/credentials/credentials.h"
+
+namespace grpc_core {
+
+// Helper function to construct service URL for jwt call creds.
+std::string MakeJwtServiceUrl(
+ const ClientMetadataHandle& initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args);
+
+// Helper function to construct context for plugin call creds.
+grpc_auth_metadata_context MakePluginAuthMetadataContext(
+ const ClientMetadataHandle& initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CALL_CREDS_UTIL_H */
diff --git a/grpc/src/core/lib/security/credentials/channel_creds_registry.h b/grpc/src/core/lib/security/credentials/channel_creds_registry.h
new file mode 100644
index 00000000..241c5853
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/channel_creds_registry.h
@@ -0,0 +1,97 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_CHANNEL_CREDS_REGISTRY_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_CHANNEL_CREDS_REGISTRY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/json/json.h"
+
+struct grpc_channel_credentials;
+
+namespace grpc_core {
+
+template <typename T = grpc_channel_credentials>
+class ChannelCredsFactory final {
+ public:
+ virtual ~ChannelCredsFactory() {}
+ virtual absl::string_view creds_type() const = delete;
+ virtual bool IsValidConfig(const Json& config) const = delete;
+ virtual RefCountedPtr<T> CreateChannelCreds(const Json& config) const =
+ delete;
+};
+
+template <>
+class ChannelCredsFactory<grpc_channel_credentials> {
+ public:
+ virtual ~ChannelCredsFactory() {}
+ virtual absl::string_view creds_type() const = 0;
+ virtual bool IsValidConfig(const Json& config) const = 0;
+ virtual RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
+ const Json& config) const = 0;
+};
+
+template <typename T = grpc_channel_credentials>
+class ChannelCredsRegistry {
+ public:
+ static_assert(std::is_base_of<grpc_channel_credentials, T>::value,
+ "ChannelCredsRegistry must be instantiated with "
+ "grpc_channel_credentials.");
+ class Builder {
+ public:
+ void RegisterChannelCredsFactory(
+ std::unique_ptr<ChannelCredsFactory<T>> factory) {
+ factories_[factory->creds_type()] = std::move(factory);
+ }
+ ChannelCredsRegistry Build() {
+ ChannelCredsRegistry<T> registry;
+ registry.factories_.swap(factories_);
+ return registry;
+ }
+
+ private:
+ std::map<absl::string_view, std::unique_ptr<ChannelCredsFactory<T>>>
+ factories_;
+ };
+
+ bool IsSupported(const std::string& creds_type) const {
+ return factories_.find(creds_type) != factories_.end();
+ }
+
+ bool IsValidConfig(const std::string& creds_type, const Json& config) const {
+ const auto iter = factories_.find(creds_type);
+ return iter != factories_.cend() && iter->second->IsValidConfig(config);
+ }
+
+ RefCountedPtr<T> CreateChannelCreds(const std::string& creds_type,
+ const Json& config) const {
+ const auto iter = factories_.find(creds_type);
+ if (iter == factories_.cend()) return nullptr;
+ return iter->second->CreateChannelCreds(config);
+ }
+
+ private:
+ ChannelCredsRegistry() = default;
+ std::map<absl::string_view, std::unique_ptr<ChannelCredsFactory<T>>>
+ factories_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_CHANNEL_CREDS_REGISTRY_H
diff --git a/grpc/src/core/lib/security/credentials/channel_creds_registry_init.cc b/grpc/src/core/lib/security/credentials/channel_creds_registry_init.cc
new file mode 100644
index 00000000..09ec4191
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/channel_creds_registry_init.cc
@@ -0,0 +1,70 @@
+//
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/config/core_configuration.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+
+namespace grpc_core {
+
+class GoogleDefaultChannelCredsFactory : public ChannelCredsFactory<> {
+ public:
+ absl::string_view creds_type() const override { return "google_default"; }
+ bool IsValidConfig(const Json& /*config*/) const override { return true; }
+ RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
+ const Json& /*config*/) const override {
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_google_default_credentials_create(nullptr));
+ }
+};
+
+class InsecureChannelCredsFactory : public ChannelCredsFactory<> {
+ public:
+ absl::string_view creds_type() const override { return "insecure"; }
+ bool IsValidConfig(const Json& /*config*/) const override { return true; }
+ RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
+ const Json& /*config*/) const override {
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ }
+};
+
+class FakeChannelCredsFactory : public ChannelCredsFactory<> {
+ public:
+ absl::string_view creds_type() const override { return "fake"; }
+ bool IsValidConfig(const Json& /*config*/) const override { return true; }
+ RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
+ const Json& /*config*/) const override {
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_fake_transport_security_credentials_create());
+ }
+};
+
+void RegisterChannelDefaultCreds(CoreConfiguration::Builder* builder) {
+ builder->channel_creds_registry()->RegisterChannelCredsFactory(
+ absl::make_unique<GoogleDefaultChannelCredsFactory>());
+ builder->channel_creds_registry()->RegisterChannelCredsFactory(
+ absl::make_unique<InsecureChannelCredsFactory>());
+ builder->channel_creds_registry()->RegisterChannelCredsFactory(
+ absl::make_unique<FakeChannelCredsFactory>());
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc b/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
index 5543ad1a..3a62f6f9 100644
--- a/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -26,99 +26,42 @@
#include "absl/strings/str_cat.h"
#include "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"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-/* -- Composite call credentials. -- */
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/promise/try_seq.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/transport/transport.h"
-static void composite_call_metadata_cb(void* arg, grpc_error_handle error);
-
-namespace {
-struct grpc_composite_call_credentials_metadata_context {
- grpc_composite_call_credentials_metadata_context(
- grpc_composite_call_credentials* composite_creds,
- grpc_polling_entity* pollent, grpc_auth_metadata_context auth_md_context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata)
- : composite_creds(composite_creds),
- pollent(pollent),
- auth_md_context(auth_md_context),
- md_array(md_array),
- on_request_metadata(on_request_metadata) {
- GRPC_CLOSURE_INIT(&internal_on_request_metadata, composite_call_metadata_cb,
- this, grpc_schedule_on_exec_ctx);
- }
+//
+// grpc_composite_channel_credentials
+//
- grpc_composite_call_credentials* composite_creds;
- size_t creds_index = 0;
- grpc_polling_entity* pollent;
- grpc_auth_metadata_context auth_md_context;
- grpc_credentials_mdelem_array* md_array;
- grpc_closure* on_request_metadata;
- grpc_closure internal_on_request_metadata;
-};
-} // namespace
-
-static void composite_call_metadata_cb(void* arg, grpc_error_handle error) {
- grpc_composite_call_credentials_metadata_context* ctx =
- static_cast<grpc_composite_call_credentials_metadata_context*>(arg);
- if (error == GRPC_ERROR_NONE) {
- const grpc_composite_call_credentials::CallCredentialsList& inner =
- ctx->composite_creds->inner();
- /* See if we need to get some more metadata. */
- if (ctx->creds_index < inner.size()) {
- if (inner[ctx->creds_index++]->get_request_metadata(
- ctx->pollent, ctx->auth_md_context, ctx->md_array,
- &ctx->internal_on_request_metadata, &error)) {
- // Synchronous response, so call ourselves recursively.
- composite_call_metadata_cb(arg, error);
- GRPC_ERROR_UNREF(error);
- }
- return;
- }
- // We're done!
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, ctx->on_request_metadata,
- GRPC_ERROR_REF(error));
- delete ctx;
+const char* grpc_composite_channel_credentials::type() const {
+ return "Composite";
}
-bool grpc_composite_call_credentials::get_request_metadata(
- grpc_polling_entity* pollent, grpc_auth_metadata_context auth_md_context,
- grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error_handle* error) {
- grpc_composite_call_credentials_metadata_context* ctx;
- ctx = new grpc_composite_call_credentials_metadata_context(
- this, pollent, auth_md_context, md_array, on_request_metadata);
- bool synchronous = true;
- const CallCredentialsList& inner = ctx->composite_creds->inner();
- while (ctx->creds_index < inner.size()) {
- if (inner[ctx->creds_index++]->get_request_metadata(
- ctx->pollent, ctx->auth_md_context, ctx->md_array,
- &ctx->internal_on_request_metadata, error)) {
- if (*error != GRPC_ERROR_NONE) break;
- } else {
- synchronous = false; // Async return.
- break;
- }
- }
- if (synchronous) delete ctx;
- return synchronous;
-}
+/* -- Composite call credentials. -- */
-void grpc_composite_call_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
- for (size_t i = 0; i < inner_.size(); ++i) {
- inner_[i]->cancel_get_request_metadata(md_array, GRPC_ERROR_REF(error));
- }
- GRPC_ERROR_UNREF(error);
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_composite_call_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
+ auto self = Ref();
+ return TrySeqIter(
+ inner_.begin(), inner_.end(), std::move(initial_metadata),
+ [self, args](const grpc_core::RefCountedPtr<grpc_call_credentials>& creds,
+ grpc_core::ClientMetadataHandle initial_metadata) {
+ return creds->GetRequestMetadata(std::move(initial_metadata), args);
+ });
}
+const char* grpc_composite_call_credentials::Type() { return "Composite"; }
+
std::string grpc_composite_call_credentials::debug_string() {
std::vector<std::string> outputs;
for (auto& inner_cred : inner_) {
@@ -146,18 +89,17 @@ void grpc_composite_call_credentials::push_to_inner(
auto composite_creds =
static_cast<grpc_composite_call_credentials*>(creds.get());
for (size_t i = 0; i < composite_creds->inner().size(); ++i) {
- inner_.push_back(std::move(composite_creds->inner_[i]));
+ inner_.push_back(composite_creds->inner_[i]);
}
}
grpc_composite_call_credentials::grpc_composite_call_credentials(
grpc_core::RefCountedPtr<grpc_call_credentials> creds1,
- grpc_core::RefCountedPtr<grpc_call_credentials> creds2)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) {
+ grpc_core::RefCountedPtr<grpc_call_credentials> creds2) {
const bool creds1_is_composite =
- strcmp(creds1->type(), GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0;
+ creds1->type() == grpc_composite_call_credentials::Type();
const bool creds2_is_composite =
- strcmp(creds2->type(), GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0;
+ creds2->type() == grpc_composite_call_credentials::Type();
const size_t size = get_creds_array_size(creds1.get(), creds1_is_composite) +
get_creds_array_size(creds2.get(), creds2_is_composite);
inner_.reserve(size);
diff --git a/grpc/src/core/lib/security/credentials/composite/composite_credentials.h b/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
index 86346275..7cb703d9 100644
--- a/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -35,8 +35,7 @@ class grpc_composite_channel_credentials : public grpc_channel_credentials {
grpc_composite_channel_credentials(
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds)
- : grpc_channel_credentials(channel_creds->type()),
- inner_creds_(std::move(channel_creds)),
+ : inner_creds_(std::move(channel_creds)),
call_creds_(std::move(call_creds)) {}
~grpc_composite_channel_credentials() override = default;
@@ -56,6 +55,8 @@ class grpc_composite_channel_credentials : public grpc_channel_credentials {
return inner_creds_->update_arguments(args);
}
+ const char* type() const override;
+
const grpc_channel_credentials* inner_creds() const {
return inner_creds_.get();
}
@@ -63,6 +64,13 @@ class grpc_composite_channel_credentials : public grpc_channel_credentials {
grpc_call_credentials* mutable_call_creds() { return call_creds_.get(); }
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ auto* o = static_cast<const grpc_composite_channel_credentials*>(other);
+ int r = inner_creds_->cmp(o->inner_creds_.get());
+ if (r != 0) return r;
+ return call_creds_->cmp(o->call_creds_.get());
+ }
+
grpc_core::RefCountedPtr<grpc_channel_credentials> inner_creds_;
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds_;
};
@@ -79,14 +87,9 @@ class grpc_composite_call_credentials : public grpc_call_credentials {
grpc_core::RefCountedPtr<grpc_call_credentials> creds2);
~grpc_composite_call_credentials() override = default;
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
grpc_security_level min_security_level() const override {
return min_security_level_;
@@ -95,7 +98,17 @@ class grpc_composite_call_credentials : public grpc_call_credentials {
const CallCredentialsList& inner() const { return inner_; }
std::string debug_string() override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
+
void push_to_inner(grpc_core::RefCountedPtr<grpc_call_credentials> creds,
bool is_composite);
grpc_security_level min_security_level_;
diff --git a/grpc/src/core/lib/security/credentials/credentials.cc b/grpc/src/core/lib/security/credentials/credentials.cc
index d2f4c9c6..0c225794 100644
--- a/grpc/src/core/lib/security/credentials/credentials.cc
+++ b/grpc/src/core/lib/security/credentials/credentials.cc
@@ -23,20 +23,18 @@
#include <stdio.h>
#include <string.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/http/parser.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/json/json.h"
-#include "src/core/lib/surface/api_trace.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/time.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/surface/api_trace.h"
+
/* -- Common. -- */
void grpc_channel_credentials_release(grpc_channel_credentials* creds) {
@@ -59,7 +57,10 @@ static void* credentials_pointer_arg_copy(void* p) {
return static_cast<grpc_channel_credentials*>(p)->Ref().release();
}
-static int credentials_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+static int credentials_pointer_cmp(void* a, void* b) {
+ return static_cast<const grpc_channel_credentials*>(a)->cmp(
+ static_cast<const grpc_channel_credentials*>(b));
+}
static const grpc_arg_pointer_vtable credentials_pointer_vtable = {
credentials_pointer_arg_copy, credentials_pointer_arg_destroy,
@@ -127,7 +128,7 @@ static void* server_credentials_pointer_arg_copy(void* p) {
}
static int server_credentials_pointer_cmp(void* a, void* b) {
- return GPR_ICMP(a, b);
+ return grpc_core::QsortCompare(a, b);
}
static const grpc_arg_pointer_vtable cred_ptr_vtable = {
diff --git a/grpc/src/core/lib/security/credentials/credentials.h b/grpc/src/core/lib/security/credentials/credentials.h
index b8609c58..f4508374 100644
--- a/grpc/src/core/lib/security/credentials/credentials.h
+++ b/grpc/src/core/lib/security/credentials/credentials.h
@@ -28,13 +28,14 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/http/httpcli.h"
-#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/promise/arena_promise.h"
+#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/security_connector/security_connector.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/transport.h"
struct grpc_http_response;
@@ -47,16 +48,6 @@ typedef enum {
#define GRPC_FAKE_TRANSPORT_SECURITY_TYPE "fake"
-#define GRPC_CHANNEL_CREDENTIALS_TYPE_SSL "Ssl"
-#define GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY \
- "FakeTransportSecurity"
-#define GRPC_CHANNEL_CREDENTIALS_TYPE_GOOGLE_DEFAULT "GoogleDefault"
-
-#define GRPC_CALL_CREDENTIALS_TYPE_OAUTH2 "Oauth2"
-#define GRPC_CALL_CREDENTIALS_TYPE_JWT "Jwt"
-#define GRPC_CALL_CREDENTIALS_TYPE_IAM "Iam"
-#define GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE "Composite"
-
#define GRPC_AUTHORIZATION_METADATA_KEY "authorization"
#define GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY \
"x-goog-iam-authorization-token"
@@ -93,7 +84,7 @@ void grpc_override_well_known_credentials_path_getter(
/* --- grpc_channel_credentials. --- */
-#define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.channel_credentials"
+#define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.internal.channel_credentials"
// This type is forward declared as a C struct and we cannot define it as a
// class. Otherwise, compiler will complain about type mismatch due to
@@ -101,9 +92,6 @@ void grpc_override_well_known_credentials_path_getter(
struct grpc_channel_credentials
: grpc_core::RefCounted<grpc_channel_credentials> {
public:
- explicit grpc_channel_credentials(const char* type) : type_(type) {}
- ~grpc_channel_credentials() override = default;
-
// Creates a security connector for the channel. May also create new channel
// args for the channel to be used in place of the passed in const args if
// returned non NULL. In that case the caller is responsible for destroying
@@ -131,12 +119,40 @@ struct grpc_channel_credentials
return args;
}
- const char* type() const { return type_; }
+ // Compares this grpc_channel_credentials object with \a other.
+ // If this method returns 0, it means that gRPC can treat the two channel
+ // credentials as effectively the same. This method is used to compare
+ // `grpc_channel_credentials` objects when they are present in channel_args.
+ // One important usage of this is when channel args are used in SubchannelKey,
+ // which leads to a useful property that allows subchannels to be reused when
+ // two different `grpc_channel_credentials` objects are used but they compare
+ // as equal (assuming other channel args match).
+ int cmp(const grpc_channel_credentials* other) const {
+ GPR_ASSERT(other != nullptr);
+ // Intentionally uses grpc_core::QsortCompare instead of strcmp as a safety
+ // against different grpc_channel_credentials types using the same name.
+ int r = grpc_core::QsortCompare(type(), other->type());
+ if (r != 0) return r;
+ return cmp_impl(other);
+ }
+
+ // The pointer value \a type is used to uniquely identify a creds
+ // implementation for down-casting purposes. Every creds implementation should
+ // use a unique string instance, which should be returned by all instances of
+ // that creds implementation.
+ virtual const char* type() const = 0;
private:
- const char* type_;
+ // Implementation for `cmp` method intended to be overridden by subclasses.
+ // Only invoked if `type()` and `other->type()` point to the same string.
+ virtual int cmp_impl(const grpc_channel_credentials* other) const = 0;
};
+// TODO(roth): Once we eliminate insecure builds, find a better way to
+// plumb credentials so that it doesn't need to flow through channel
+// args. For example, we'll want to expose it to LB policies by adding
+// methods on the helper API.
+
/* Util to encapsulate the channel credentials in a channel arg. */
grpc_arg grpc_channel_credentials_to_arg(grpc_channel_credentials* credentials);
@@ -148,21 +164,11 @@ grpc_channel_credentials* grpc_channel_credentials_from_arg(
grpc_channel_credentials* grpc_channel_credentials_find_in_args(
const grpc_channel_args* args);
-/* --- grpc_credentials_mdelem_array. --- */
-
-struct grpc_credentials_mdelem_array {
- grpc_mdelem* md = nullptr;
- size_t size = 0;
-};
-/// Takes a new ref to \a md.
-void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array* list,
- grpc_mdelem md);
-
-/// Appends all elements from \a src to \a dst, taking a new ref to each one.
-void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array* dst,
- grpc_credentials_mdelem_array* src);
+/* --- grpc_core::CredentialsMetadataArray. --- */
-void grpc_credentials_mdelem_array_destroy(grpc_credentials_mdelem_array* list);
+namespace grpc_core {
+using CredentialsMetadataArray = std::vector<std::pair<Slice, Slice>>;
+}
/* --- grpc_call_credentials. --- */
@@ -172,48 +178,69 @@ void grpc_credentials_mdelem_array_destroy(grpc_credentials_mdelem_array* list);
struct grpc_call_credentials
: public grpc_core::RefCounted<grpc_call_credentials> {
public:
+ // TODO(roth): Consider whether security connector actually needs to
+ // be part of this interface. Currently, it is here only for the
+ // url_scheme() method, which we might be able to instead add as an
+ // auth context property.
+ struct GetRequestMetadataArgs {
+ grpc_core::RefCountedPtr<grpc_channel_security_connector>
+ security_connector;
+ grpc_core::RefCountedPtr<grpc_auth_context> auth_context;
+ };
+
+ // The pointer value \a type is used to uniquely identify a creds
+ // implementation for down-casting purposes. Every creds implementation should
+ // use a unique string instance, which should be returned by all instances of
+ // that creds implementation.
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) {}
+ : min_security_level_(min_security_level) {}
~grpc_call_credentials() override = default;
- // Returns true if completed synchronously, in which case \a error will
- // be set to indicate the result. Otherwise, \a on_request_metadata will
- // be invoked asynchronously when complete. \a md_array will be populated
- // with the resulting metadata once complete.
- virtual bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) = 0;
-
- // Cancels a pending asynchronous operation started by
- // grpc_call_credentials_get_request_metadata() with the corresponding
- // value of \a md_array.
- virtual void cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error_handle error) = 0;
+ virtual grpc_core::ArenaPromise<
+ absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) = 0;
virtual grpc_security_level min_security_level() const {
return min_security_level_;
}
+ // Compares this grpc_call_credentials object with \a other.
+ // If this method returns 0, it means that gRPC can treat the two call
+ // credentials as effectively the same..
+ int cmp(const grpc_call_credentials* other) const {
+ GPR_ASSERT(other != nullptr);
+ // Intentionally uses grpc_core::QsortCompare instead of strcmp as a safety
+ // against different grpc_call_credentials types using the same name.
+ int r = grpc_core::QsortCompare(type(), other->type());
+ if (r != 0) return r;
+ return cmp_impl(other);
+ }
+
virtual std::string debug_string() {
return "grpc_call_credentials did not provide debug string";
}
- const char* type() const { return type_; }
+ // The pointer value \a type is used to uniquely identify a creds
+ // implementation for down-casting purposes. Every creds implementation should
+ // use a unique string instance, which should be returned by all instances of
+ // that creds implementation.
+ virtual const char* type() const = 0;
private:
- const char* type_;
+ // Implementation for `cmp` method intended to be overridden by subclasses.
+ // Only invoked if `type()` and `other->type()` point to the same string.
+ virtual int cmp_impl(const grpc_call_credentials* other) const = 0;
+
const grpc_security_level min_security_level_;
};
/* Metadata-only credentials with the specified key and value where
asynchronicity can be simulated for testing. */
grpc_call_credentials* grpc_md_only_test_credentials_create(
- const char* md_key, const char* md_value, bool is_async);
+ const char* md_key, const char* md_value);
/* --- grpc_server_credentials. --- */
@@ -223,15 +250,13 @@ grpc_call_credentials* grpc_md_only_test_credentials_create(
struct grpc_server_credentials
: public grpc_core::RefCounted<grpc_server_credentials> {
public:
- explicit grpc_server_credentials(const char* type) : type_(type) {}
-
~grpc_server_credentials() override { DestroyProcessor(); }
// Ownership of \a args is not passed.
virtual grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* args) = 0;
- const char* type() const { return type_; }
+ virtual const char* type() const = 0;
const grpc_auth_metadata_processor& auth_metadata_processor() const {
return processor_;
@@ -246,7 +271,6 @@ struct grpc_server_credentials
}
}
- const char* type_;
grpc_auth_metadata_processor processor_ =
grpc_auth_metadata_processor(); // Zero-initialize the C struct.
};
@@ -258,29 +282,4 @@ grpc_server_credentials* grpc_server_credentials_from_arg(const grpc_arg* arg);
grpc_server_credentials* grpc_find_server_credentials_in_args(
const grpc_channel_args* args);
-/* -- Credentials Metadata Request. -- */
-
-struct grpc_credentials_metadata_request {
- explicit grpc_credentials_metadata_request(
- grpc_core::RefCountedPtr<grpc_call_credentials> creds)
- : creds(std::move(creds)) {}
- ~grpc_credentials_metadata_request() {
- grpc_http_response_destroy(&response);
- }
-
- grpc_core::RefCountedPtr<grpc_call_credentials> creds;
- grpc_http_response response;
-};
-
-inline grpc_credentials_metadata_request*
-grpc_credentials_metadata_request_create(
- grpc_core::RefCountedPtr<grpc_call_credentials> creds) {
- return new grpc_credentials_metadata_request(std::move(creds));
-}
-
-inline void grpc_credentials_metadata_request_destroy(
- grpc_credentials_metadata_request* r) {
- delete r;
-}
-
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H */
diff --git a/grpc/src/core/lib/security/credentials/credentials_metadata.cc b/grpc/src/core/lib/security/credentials/credentials_metadata.cc
deleted file mode 100644
index 703de4aa..00000000
--- a/grpc/src/core/lib/security/credentials/credentials_metadata.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * 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/lib/security/credentials/credentials.h"
-
-#include <grpc/support/alloc.h>
-
-#include <string.h>
-
-#include "src/core/lib/slice/slice_internal.h"
-
-static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array* list,
- size_t additional_space_needed) {
- size_t target_size = list->size + additional_space_needed;
- // Find the next power of two greater than the target size (i.e.,
- // whenever we add more space, we double what we already have).
- size_t new_size = 2;
- while (new_size < target_size) {
- new_size *= 2;
- }
- list->md = static_cast<grpc_mdelem*>(
- gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size));
-}
-
-void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array* list,
- grpc_mdelem md) {
- mdelem_list_ensure_capacity(list, 1);
- list->md[list->size++] = GRPC_MDELEM_REF(md);
-}
-
-void grpc_credentials_mdelem_array_append(grpc_credentials_mdelem_array* dst,
- grpc_credentials_mdelem_array* src) {
- mdelem_list_ensure_capacity(dst, src->size);
- for (size_t i = 0; i < src->size; ++i) {
- dst->md[dst->size++] = GRPC_MDELEM_REF(src->md[i]);
- }
-}
-
-void grpc_credentials_mdelem_array_destroy(
- grpc_credentials_mdelem_array* list) {
- for (size_t i = 0; i < list->size; ++i) {
- GRPC_MDELEM_UNREF(list->md[i]);
- }
- gpr_free(list->md);
-}
diff --git a/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc b/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
index c479bf06..5d8a74fb 100644
--- a/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
@@ -22,6 +22,7 @@
#include "absl/strings/str_replace.h"
#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
namespace grpc_core {
@@ -155,27 +156,29 @@ void AwsExternalAccountCredentials::RetrieveRegion() {
}
absl::StatusOr<URI> uri = URI::Parse(region_url_);
if (!uri.ok()) {
- FinishRetrieveSubjectToken("", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Invalid region url. %s",
- uri.status().ToString())
- .c_str()));
+ FinishRetrieveSubjectToken(
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Invalid region url. %s", uri.status().ToString())));
return;
}
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(uri->authority().c_str());
- request.http.path = gpr_strdup(uri->path().c_str());
- request.handshaker =
- uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveRegion, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (uri->scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ =
+ HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
+ ctx_->pollent, &request, ctx_->deadline, &ctx_->closure,
+ &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ grpc_http_request_destroy(&request);
}
void AwsExternalAccountCredentials::OnRetrieveRegion(void* arg,
@@ -206,26 +209,29 @@ void AwsExternalAccountCredentials::RetrieveRoleName() {
absl::StatusOr<URI> uri = URI::Parse(url_);
if (!uri.ok()) {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Invalid url: %s.", uri.status().ToString())
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrFormat("Invalid url: %s.", uri.status().ToString())));
return;
}
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(uri->authority().c_str());
- request.http.path = gpr_strdup(uri->path().c_str());
- request.handshaker =
- uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveRoleName, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ // TODO(ctiller): use the caller's resource quota.
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (uri->scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ =
+ HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
+ ctx_->pollent, &request, ctx_->deadline, &ctx_->closure,
+ &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ grpc_http_request_destroy(&request);
}
void AwsExternalAccountCredentials::OnRetrieveRoleName(
@@ -268,27 +274,29 @@ void AwsExternalAccountCredentials::RetrieveSigningKeys() {
absl::StatusOr<URI> uri = URI::Parse(url_with_role_name);
if (!uri.ok()) {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Invalid url with role name: %s.",
- uri.status().ToString())
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Invalid url with role name: %s.", uri.status().ToString())));
return;
}
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(uri->authority().c_str());
- request.http.path = gpr_strdup(uri->path().c_str());
- request.handshaker =
- uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveSigningKeys, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ // TODO(ctiller): use the caller's resource quota.
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (uri->scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ =
+ HttpRequest::Get(std::move(*uri), nullptr /* channel args */,
+ ctx_->pollent, &request, ctx_->deadline, &ctx_->closure,
+ &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ grpc_http_request_destroy(&request);
}
void AwsExternalAccountCredentials::OnRetrieveSigningKeys(
@@ -320,10 +328,8 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
access_key_id_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid AccessKeyId in %s.",
- response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid AccessKeyId in %s.", response_body)));
return;
}
it = json.object_value().find("SecretAccessKey");
@@ -332,10 +338,8 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
secret_access_key_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid SecretAccessKey in %s.",
- response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid SecretAccessKey in %s.", response_body)));
return;
}
it = json.object_value().find("Token");
@@ -344,10 +348,8 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
token_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "",
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid Token in %s.", response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid Token in %s.", response_body)));
return;
}
BuildSubjectToken();
diff --git a/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h b/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
index 50ccf194..ee47270b 100644
--- a/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
+++ b/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
@@ -19,9 +19,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/external/external_account_credentials.h"
-
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
+#include "src/core/lib/security/credentials/external/external_account_credentials.h"
namespace grpc_core {
@@ -57,6 +56,7 @@ class AwsExternalAccountCredentials final : public ExternalAccountCredentials {
grpc_error_handle error);
std::string audience_;
+ OrphanablePtr<HttpRequest> http_request_;
// Fields of credential source
std::string region_url_;
diff --git a/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc b/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
index b665701b..bc4920f3 100644
--- a/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
+++ b/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
@@ -17,6 +17,9 @@
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_format.h"
@@ -25,9 +28,6 @@
#include "absl/time/clock.h"
#include "absl/time/time.h"
-#include <openssl/hmac.h>
-#include <openssl/sha.h>
-
namespace grpc_core {
namespace {
diff --git a/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc b/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
index f5d9442e..cc5165eb 100644
--- a/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
@@ -17,19 +17,21 @@
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
+#include "absl/strings/match.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
+#include "absl/strings/strip.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/http/parser.h"
-#include "src/core/lib/security/util/json_util.h"
-#include "src/core/lib/slice/b64.h"
-
#include "src/core/lib/security/credentials/external/aws_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/file_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/url_external_account_credentials.h"
+#include "src/core/lib/security/util/json_util.h"
+#include "src/core/lib/slice/b64.h"
#define EXTERNAL_ACCOUNT_CREDENTIALS_GRANT_TYPE \
"urn:ietf:params:oauth:grant-type:token-exchange"
@@ -60,6 +62,23 @@ std::string UrlEncode(const absl::string_view& s) {
return result;
}
+// Expression to match:
+// //iam.googleapis.com/locations/[^/]+/workforcePools/[^/]+/providers/.+
+bool MatchWorkforcePoolAudience(absl::string_view audience) {
+ // Match "//iam.googleapis.com/locations/"
+ if (!absl::ConsumePrefix(&audience, "//iam.googleapis.com")) return false;
+ if (!absl::ConsumePrefix(&audience, "/locations/")) return false;
+ // Match "[^/]+/workforcePools/"
+ std::pair<absl::string_view, absl::string_view> workforce_pools_split_result =
+ absl::StrSplit(audience, absl::MaxSplits("/workforcePools/", 1));
+ if (absl::StrContains(workforce_pools_split_result.first, '/')) return false;
+ // Match "[^/]+/providers/.+"
+ std::pair<absl::string_view, absl::string_view> providers_split_result =
+ absl::StrSplit(workforce_pools_split_result.second,
+ absl::MaxSplits("/providers/", 1));
+ return !absl::StrContains(providers_split_result.first, '/');
+}
+
} // namespace
RefCountedPtr<ExternalAccountCredentials> ExternalAccountCredentials::Create(
@@ -152,6 +171,17 @@ RefCountedPtr<ExternalAccountCredentials> ExternalAccountCredentials::Create(
if (it != json.object_value().end()) {
options.client_secret = it->second.string_value();
}
+ it = json.object_value().find("workforce_pool_user_project");
+ if (it != json.object_value().end()) {
+ if (MatchWorkforcePoolAudience(options.audience)) {
+ options.workforce_pool_user_project = it->second.string_value();
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "workforce_pool_user_project should not be set for non-workforce "
+ "pool credentials");
+ return nullptr;
+ }
+ }
RefCountedPtr<ExternalAccountCredentials> creds;
if (options.credential_source.object_value().find("environment_id") !=
options.credential_source.object_value().end()) {
@@ -208,10 +238,10 @@ std::string ExternalAccountCredentials::debug_string() {
// down.
void ExternalAccountCredentials::fetch_oauth2(
grpc_credentials_metadata_request* metadata_req,
- grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
- grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
+ grpc_polling_entity* pollent, grpc_iomgr_cb_func response_cb,
+ Timestamp deadline) {
GPR_ASSERT(ctx_ == nullptr);
- ctx_ = new HTTPRequestContext(httpcli_context, pollent, deadline);
+ ctx_ = new HTTPRequestContext(pollent, deadline);
metadata_req_ = metadata_req;
response_cb_ = response_cb;
auto cb = [this](std::string token, grpc_error_handle error) {
@@ -233,21 +263,18 @@ void ExternalAccountCredentials::ExchangeToken(
absl::string_view subject_token) {
absl::StatusOr<URI> uri = URI::Parse(options_.token_url);
if (!uri.ok()) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("Invalid token url: %s. Error: %s", options_.token_url,
- uri.status().ToString())
- .c_str()));
+ uri.status().ToString())));
return;
}
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(uri->authority().c_str());
- request.http.path = gpr_strdup(uri->path().c_str());
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
grpc_http_header* headers = nullptr;
if (!options_.client_id.empty() && !options_.client_secret.empty()) {
- request.http.hdr_count = 2;
+ request.hdr_count = 2;
headers = static_cast<grpc_http_header*>(
- gpr_malloc(sizeof(grpc_http_header) * request.http.hdr_count));
+ gpr_malloc(sizeof(grpc_http_header) * request.hdr_count));
headers[0].key = gpr_strdup("Content-Type");
headers[0].value = gpr_strdup("application/x-www-form-urlencoded");
std::string raw_cred =
@@ -259,46 +286,60 @@ void ExternalAccountCredentials::ExchangeToken(
headers[1].value = gpr_strdup(str.c_str());
gpr_free(encoded_cred);
} else {
- request.http.hdr_count = 1;
+ request.hdr_count = 1;
headers = static_cast<grpc_http_header*>(
- gpr_malloc(sizeof(grpc_http_header) * request.http.hdr_count));
+ gpr_malloc(sizeof(grpc_http_header) * request.hdr_count));
headers[0].key = gpr_strdup("Content-Type");
headers[0].value = gpr_strdup("application/x-www-form-urlencoded");
}
- request.http.hdrs = headers;
- request.handshaker =
- uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
+ request.hdrs = headers;
std::vector<std::string> body_parts;
- body_parts.push_back(absl::StrFormat("%s=%s", "audience",
- UrlEncode(options_.audience).c_str()));
+ body_parts.push_back(
+ absl::StrFormat("audience=%s", UrlEncode(options_.audience).c_str()));
body_parts.push_back(absl::StrFormat(
- "%s=%s", "grant_type",
+ "grant_type=%s",
UrlEncode(EXTERNAL_ACCOUNT_CREDENTIALS_GRANT_TYPE).c_str()));
body_parts.push_back(absl::StrFormat(
- "%s=%s", "requested_token_type",
+ "requested_token_type=%s",
UrlEncode(EXTERNAL_ACCOUNT_CREDENTIALS_REQUESTED_TOKEN_TYPE).c_str()));
+ body_parts.push_back(absl::StrFormat(
+ "subject_token_type=%s", UrlEncode(options_.subject_token_type).c_str()));
body_parts.push_back(
- absl::StrFormat("%s=%s", "subject_token_type",
- UrlEncode(options_.subject_token_type).c_str()));
- body_parts.push_back(absl::StrFormat("%s=%s", "subject_token",
- UrlEncode(subject_token).c_str()));
+ absl::StrFormat("subject_token=%s", UrlEncode(subject_token).c_str()));
std::string scope = GOOGLE_CLOUD_PLATFORM_DEFAULT_SCOPE;
if (options_.service_account_impersonation_url.empty()) {
scope = absl::StrJoin(scopes_, " ");
}
- body_parts.push_back(
- absl::StrFormat("%s=%s", "scope", UrlEncode(scope).c_str()));
+ body_parts.push_back(absl::StrFormat("scope=%s", UrlEncode(scope).c_str()));
+ Json::Object addtional_options_json_object;
+ if (options_.client_id.empty() && options_.client_secret.empty()) {
+ addtional_options_json_object["userProject"] =
+ options_.workforce_pool_user_project;
+ }
+ Json addtional_options_json(std::move(addtional_options_json_object));
+ body_parts.push_back(absl::StrFormat(
+ "options=%s", UrlEncode(addtional_options_json.Dump()).c_str()));
std::string body = absl::StrJoin(body_parts, "&");
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ request.body = const_cast<char*>(body.c_str());
+ request.body_length = body.size();
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnExchangeToken, this, nullptr);
- grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, body.c_str(), body.size(), ctx_->deadline,
- &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ GPR_ASSERT(http_request_ == nullptr);
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (uri->scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ =
+ HttpRequest::Post(std::move(*uri), nullptr /* channel args */,
+ ctx_->pollent, &request, ctx_->deadline, &ctx_->closure,
+ &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ request.body = nullptr;
+ grpc_http_request_destroy(&request);
}
void ExternalAccountCredentials::OnExchangeToken(void* arg,
@@ -310,6 +351,7 @@ void ExternalAccountCredentials::OnExchangeToken(void* arg,
void ExternalAccountCredentials::OnExchangeTokenInternal(
grpc_error_handle error) {
+ http_request_.reset();
if (error != GRPC_ERROR_NONE) {
FinishTokenFetch(error);
} else {
@@ -346,49 +388,52 @@ void ExternalAccountCredentials::ImpersenateServiceAccount() {
auto it = json.object_value().find("access_token");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid access_token in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid access_token in %s.", response_body)));
return;
}
std::string access_token = it->second.string_value();
absl::StatusOr<URI> uri =
URI::Parse(options_.service_account_impersonation_url);
if (!uri.ok()) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat(
- "Invalid service account impersonation url: %s. Error: %s",
- options_.service_account_impersonation_url, uri.status().ToString())
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Invalid service account impersonation url: %s. Error: %s",
+ options_.service_account_impersonation_url, uri.status().ToString())));
return;
}
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(uri->authority().c_str());
- request.http.path = gpr_strdup(uri->path().c_str());
- request.http.hdr_count = 2;
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
+ request.hdr_count = 2;
grpc_http_header* headers = static_cast<grpc_http_header*>(
- gpr_malloc(sizeof(grpc_http_header) * request.http.hdr_count));
+ gpr_malloc(sizeof(grpc_http_header) * request.hdr_count));
headers[0].key = gpr_strdup("Content-Type");
headers[0].value = gpr_strdup("application/x-www-form-urlencoded");
std::string str = absl::StrFormat("Bearer %s", access_token);
headers[1].key = gpr_strdup("Authorization");
headers[1].value = gpr_strdup(str.c_str());
- request.http.hdrs = headers;
- request.handshaker =
- uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
+ request.hdrs = headers;
std::string scope = absl::StrJoin(scopes_, " ");
- std::string body = absl::StrFormat("%s=%s", "scope", scope);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ std::string body = absl::StrFormat("scope=%s", scope);
+ request.body = const_cast<char*>(body.c_str());
+ request.body_length = body.size();
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnImpersenateServiceAccount, this, nullptr);
- grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, body.c_str(), body.size(), ctx_->deadline,
- &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ // TODO(ctiller): Use the callers resource quota.
+ GPR_ASSERT(http_request_ == nullptr);
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (uri->scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ = HttpRequest::Post(
+ std::move(*uri), nullptr, ctx_->pollent, &request, ctx_->deadline,
+ &ctx_->closure, &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ request.body = nullptr;
+ grpc_http_request_destroy(&request);
}
void ExternalAccountCredentials::OnImpersenateServiceAccount(
@@ -400,6 +445,7 @@ void ExternalAccountCredentials::OnImpersenateServiceAccount(
void ExternalAccountCredentials::OnImpersenateServiceAccountInternal(
grpc_error_handle error) {
+ http_request_.reset();
if (error != GRPC_ERROR_NONE) {
FinishTokenFetch(error);
return;
@@ -416,18 +462,16 @@ void ExternalAccountCredentials::OnImpersenateServiceAccountInternal(
auto it = json.object_value().find("accessToken");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid accessToken in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid accessToken in %s.", response_body)));
return;
}
std::string access_token = it->second.string_value();
it = json.object_value().find("expireTime");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrFormat("Missing or invalid expireTime in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Missing or invalid expireTime in %s.", response_body)));
return;
}
std::string expire_time = it->second.string_value();
diff --git a/grpc/src/core/lib/security/credentials/external/external_account_credentials.h b/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
index 3c000968..c31294d9 100644
--- a/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
+++ b/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
@@ -46,6 +46,7 @@ class ExternalAccountCredentials
std::string quota_project_id;
std::string client_id;
std::string client_secret;
+ std::string workforce_pool_user_project;
};
static RefCountedPtr<ExternalAccountCredentials> Create(
@@ -60,18 +61,14 @@ class ExternalAccountCredentials
// This is a helper struct to pass information between multiple callback based
// asynchronous calls.
struct HTTPRequestContext {
- HTTPRequestContext(grpc_httpcli_context* httpcli_context,
- grpc_polling_entity* pollent, grpc_millis deadline)
- : httpcli_context(httpcli_context),
- pollent(pollent),
- deadline(deadline) {}
+ HTTPRequestContext(grpc_polling_entity* pollent, Timestamp deadline)
+ : pollent(pollent), deadline(deadline) {}
~HTTPRequestContext() { grpc_http_response_destroy(&response); }
// Contextual parameters passed from
// grpc_oauth2_token_fetcher_credentials::fetch_oauth2().
- grpc_httpcli_context* httpcli_context;
grpc_polling_entity* pollent;
- grpc_millis deadline;
+ Timestamp deadline;
// Reusable token fetch http response and closure.
grpc_closure closure;
@@ -91,9 +88,8 @@ class ExternalAccountCredentials
// This method implements the common token fetch logic and it will be called
// when grpc_oauth2_token_fetcher_credentials request a new access token.
void fetch_oauth2(grpc_credentials_metadata_request* req,
- grpc_httpcli_context* httpcli_context,
grpc_polling_entity* pollent, grpc_iomgr_cb_func cb,
- grpc_millis deadline) override;
+ Timestamp deadline) override;
void OnRetrieveSubjectTokenInternal(absl::string_view subject_token,
grpc_error_handle error);
@@ -111,6 +107,7 @@ class ExternalAccountCredentials
Options options_;
std::vector<std::string> scopes_;
+ OrphanablePtr<HttpRequest> http_request_;
HTTPRequestContext* ctx_ = nullptr;
grpc_credentials_metadata_request* metadata_req_ = nullptr;
grpc_iomgr_cb_func response_cb_ = nullptr;
diff --git a/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc b/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
index d596d294..a959e8c8 100644
--- a/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
@@ -21,7 +21,6 @@
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_utils.h"
namespace grpc_core {
diff --git a/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc b/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
index 55151b96..b1a0512a 100644
--- a/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
@@ -21,6 +21,9 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
+#include "src/core/lib/transport/error_utils.h"
+
namespace grpc_core {
RefCountedPtr<UrlExternalAccountCredentials>
@@ -51,10 +54,9 @@ UrlExternalAccountCredentials::UrlExternalAccountCredentials(
}
absl::StatusOr<URI> tmp_url = URI::Parse(it->second.string_value());
if (!tmp_url.ok()) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("Invalid credential source url. Error: %s",
- tmp_url.status().ToString())
- .c_str());
+ tmp_url.status().ToString()));
return;
}
url_ = *tmp_url;
@@ -121,34 +123,48 @@ void UrlExternalAccountCredentials::RetrieveSubjectToken(
"Missing HTTPRequestContext to start subject token retrieval."));
return;
}
+ auto url_for_request =
+ URI::Create(url_.scheme(), url_.authority(), url_full_path_,
+ {} /* query params */, "" /* fragment */);
+ if (!url_for_request.ok()) {
+ FinishRetrieveSubjectToken(
+ "", absl_status_to_grpc_error(url_for_request.status()));
+ return;
+ }
ctx_ = ctx;
cb_ = cb;
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(url_.authority().c_str());
- request.http.path = gpr_strdup(url_full_path_.c_str());
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
+ request.path = gpr_strdup(url_full_path_.c_str());
grpc_http_header* headers = nullptr;
- request.http.hdr_count = headers_.size();
+ request.hdr_count = headers_.size();
headers = static_cast<grpc_http_header*>(
- gpr_malloc(sizeof(grpc_http_header) * request.http.hdr_count));
+ gpr_malloc(sizeof(grpc_http_header) * request.hdr_count));
int i = 0;
for (auto const& header : headers_) {
headers[i].key = gpr_strdup(header.first.c_str());
headers[i].value = gpr_strdup(header.second.c_str());
++i;
}
- request.http.hdrs = headers;
- request.handshaker =
- url_.scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ request.hdrs = headers;
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveSubjectToken, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
- grpc_http_request_destroy(&request.http);
+ GPR_ASSERT(http_request_ == nullptr);
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (url_.scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ CreateHttpRequestSSLCredentials());
+ }
+ http_request_ =
+ HttpRequest::Get(std::move(*url_for_request), nullptr /* channel args */,
+ ctx_->pollent, &request, ctx_->deadline, &ctx_->closure,
+ &ctx_->response, std::move(http_request_creds));
+ http_request_->Start();
+ grpc_http_request_destroy(&request);
}
void UrlExternalAccountCredentials::OnRetrieveSubjectToken(
@@ -160,6 +176,7 @@ void UrlExternalAccountCredentials::OnRetrieveSubjectToken(
void UrlExternalAccountCredentials::OnRetrieveSubjectTokenInternal(
grpc_error_handle error) {
+ http_request_.reset();
if (error != GRPC_ERROR_NONE) {
FinishRetrieveSubjectToken("", error);
return;
diff --git a/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h b/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
index eaf984c7..ac07fca3 100644
--- a/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
+++ b/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
@@ -51,6 +51,7 @@ class UrlExternalAccountCredentials final : public ExternalAccountCredentials {
std::string format_type_;
std::string format_subject_token_field_name_;
+ OrphanablePtr<HttpRequest> http_request_;
HTTPRequestContext* ctx_ = nullptr;
std::function<void(std::string, grpc_error_handle)> cb_ = nullptr;
};
diff --git a/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc b/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
index 57a897f0..6403de3e 100644
--- a/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
@@ -29,6 +29,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/security_connector/fake/fake_security_connector.h"
/* -- Fake transport security credentials. -- */
@@ -36,11 +37,6 @@
namespace {
class grpc_fake_channel_credentials final : public grpc_channel_credentials {
public:
- grpc_fake_channel_credentials()
- : grpc_channel_credentials(
- GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY) {}
- ~grpc_fake_channel_credentials() override = default;
-
grpc_core::RefCountedPtr<grpc_channel_security_connector>
create_security_connector(
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
@@ -49,19 +45,25 @@ class grpc_fake_channel_credentials final : public grpc_channel_credentials {
return grpc_fake_channel_security_connector_create(
this->Ref(), std::move(call_creds), target, args);
}
+
+ const char* type() const override { return "Fake"; }
+
+ private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+ }
};
class grpc_fake_server_credentials final : public grpc_server_credentials {
public:
- grpc_fake_server_credentials()
- : grpc_server_credentials(
- GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY) {}
- ~grpc_fake_server_credentials() override = default;
-
grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* /*args*/) override {
return grpc_fake_server_security_connector_create(this->Ref());
}
+
+ const char* type() const override { return "Fake"; }
};
} // namespace
@@ -89,25 +91,19 @@ const char* grpc_fake_transport_get_expected_targets(
/* -- Metadata-only test credentials. -- */
-bool grpc_md_only_test_credentials::get_request_metadata(
- grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
- grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error_handle* /*error*/) {
- grpc_credentials_mdelem_array_add(md_array, md_);
- if (is_async_) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_request_metadata,
- GRPC_ERROR_NONE);
- return false;
- }
- return true;
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_md_only_test_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs*) {
+ initial_metadata->Append(
+ key_.as_string_view(), value_.Ref(),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ return grpc_core::Immediate(std::move(initial_metadata));
}
-void grpc_md_only_test_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
- GRPC_ERROR_UNREF(error);
-}
+const char* grpc_md_only_test_credentials::Type() { return "MdOnlyTest"; }
grpc_call_credentials* grpc_md_only_test_credentials_create(
- const char* md_key, const char* md_value, bool is_async) {
- return new grpc_md_only_test_credentials(md_key, md_value, is_async);
+ const char* md_key, const char* md_value) {
+ return new grpc_md_only_test_credentials(md_key, md_value);
}
diff --git a/grpc/src/core/lib/security/credentials/fake/fake_credentials.h b/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
index ea8c8136..299f58c4 100644
--- a/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -59,29 +59,30 @@ const char* grpc_fake_transport_get_expected_targets(
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),
- md_(grpc_mdelem_from_slices(grpc_slice_from_copied_string(md_key),
- grpc_slice_from_copied_string(md_value))),
- is_async_(is_async) {}
- ~grpc_md_only_test_credentials() override { GRPC_MDELEM_UNREF(md_); }
-
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
-
- std::string debug_string() override { return "MD only Test Credentials"; };
+ grpc_md_only_test_credentials(const char* md_key, const char* md_value)
+ : grpc_call_credentials(GRPC_SECURITY_NONE),
+ key_(grpc_core::Slice::FromCopiedString(md_key)),
+ value_(grpc_core::Slice::FromCopiedString(md_value)) {}
+
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
+
+ std::string debug_string() override { return "MD only Test Credentials"; }
+
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
private:
- grpc_mdelem md_;
- bool is_async_;
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
+
+ grpc_core::Slice key_;
+ grpc_core::Slice value_;
};
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */
diff --git a/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc b/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
index 8716edec..1b56824d 100644
--- a/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
+++ b/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
-
#include <string>
#include "absl/strings/str_cat.h"
@@ -28,6 +26,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
std::string grpc_get_well_known_google_credentials_file_path_impl(void) {
char* base = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR);
diff --git a/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 0e1a2a10..565161f5 100644
--- a/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -18,10 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include <string.h>
+#include "absl/strings/match.h"
+#include "absl/strings/strip.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -31,6 +34,7 @@
#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/host_port.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
@@ -38,8 +42,8 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/credentials/alts/alts_credentials.h"
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
-#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -91,7 +95,7 @@ grpc_google_default_channel_credentials::create_security_connector(
const char* xds_cluster =
grpc_channel_args_find_string(args, GRPC_ARG_XDS_CLUSTER_NAME);
const bool is_xds_non_cfe_cluster =
- xds_cluster != nullptr && strcmp(xds_cluster, "google_cfe") != 0;
+ xds_cluster != nullptr && !absl::StartsWith(xds_cluster, "google_cfe_");
const bool use_alts = is_grpclb_load_balancer ||
is_backend_from_grpclb_load_balancer ||
is_xds_non_cfe_cluster;
@@ -134,6 +138,10 @@ grpc_channel_args* grpc_google_default_channel_credentials::update_arguments(
return updated;
}
+const char* grpc_google_default_channel_credentials::type() const {
+ return "GoogleDefault";
+}
+
static void on_metadata_server_detection_http_response(
void* user_data, grpc_error_handle error) {
metadata_server_detector* detector =
@@ -167,31 +175,31 @@ static void destroy_pollset(void* p, grpc_error_handle /*e*/) {
static int is_metadata_server_reachable() {
metadata_server_detector detector;
- grpc_httpcli_request request;
- grpc_httpcli_context context;
+ grpc_http_request request;
grpc_closure destroy_closure;
/* The http call is local. If it takes more than one sec, it is for sure not
on compute engine. */
- grpc_millis max_detection_delay = GPR_MS_PER_SEC;
+ const auto max_detection_delay = grpc_core::Duration::Seconds(1);
grpc_pollset* pollset =
static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
grpc_pollset_init(pollset, &g_polling_mu);
detector.pollent = grpc_polling_entity_create_from_pollset(pollset);
detector.is_done = 0;
detector.success = 0;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(GRPC_COMPUTE_ENGINE_DETECTION_HOST);
- request.http.path = const_cast<char*>("/");
- grpc_httpcli_context_init(&context);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("google_default_credentials");
- grpc_httpcli_get(
- &context, &detector.pollent, resource_quota, &request,
+ memset(&request, 0, sizeof(grpc_http_request));
+ auto uri =
+ grpc_core::URI::Create("http", GRPC_COMPUTE_ENGINE_DETECTION_HOST, "/",
+ {} /* query params */, "" /* fragment */);
+ GPR_ASSERT(uri.ok()); // params are hardcoded
+ auto http_request = grpc_core::HttpRequest::Get(
+ std::move(*uri), nullptr /* channel args */, &detector.pollent, &request,
grpc_core::ExecCtx::Get()->Now() + max_detection_delay,
GRPC_CLOSURE_CREATE(on_metadata_server_detection_http_response, &detector,
grpc_schedule_on_exec_ctx),
- &detector.response);
- grpc_resource_quota_unref_internal(resource_quota);
+ &detector.response,
+ grpc_core::RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create()));
+ http_request->Start();
grpc_core::ExecCtx::Get()->Flush();
/* Block until we get the response. This is not ideal but this should only be
called once for the lifetime of the process by the default credentials. */
@@ -201,13 +209,13 @@ static int is_metadata_server_reachable() {
if (!GRPC_LOG_IF_ERROR(
"pollset_work",
grpc_pollset_work(grpc_polling_entity_pollset(&detector.pollent),
- &worker, GRPC_MILLIS_INF_FUTURE))) {
+ &worker, grpc_core::Timestamp::InfFuture()))) {
detector.is_done = 1;
detector.success = 0;
}
}
gpr_mu_unlock(g_polling_mu);
- grpc_httpcli_context_destroy(&context);
+ http_request.reset();
GRPC_CLOSURE_INIT(&destroy_closure, destroy_pollset,
grpc_polling_entity_pollset(&detector.pollent),
grpc_schedule_on_exec_ctx);
@@ -220,6 +228,52 @@ static int is_metadata_server_reachable() {
return detector.success;
}
+namespace {
+
+bool ValidateUrlField(const Json& json, const std::string& field) {
+ auto it = json.object_value().find(field);
+ if (it == json.object_value().end()) {
+ return true;
+ }
+ if (it->second.type() != Json::Type::STRING ||
+ it->second.string_value().empty()) {
+ return false;
+ }
+ absl::StatusOr<grpc_core::URI> url =
+ grpc_core::URI::Parse(it->second.string_value());
+ if (!url.ok()) return false;
+ if (!absl::EqualsIgnoreCase(url->scheme(), "https")) {
+ return false;
+ }
+ absl::string_view host;
+ absl::string_view port;
+ grpc_core::SplitHostPort(url->authority(), &host, &port);
+ if (absl::ConsumeSuffix(&host, ".googleapis.com")) {
+ if (host == "sts" || host == "iamcredentials") {
+ return true;
+ } else if (absl::StartsWith(host, "sts.") ||
+ absl::StartsWith(host, "iamcredentials.")) {
+ return true;
+ } else if (absl::EndsWith(host, ".sts") ||
+ absl::EndsWith(host, ".iamcredentials")) {
+ return true;
+ } else if (absl::EndsWith(host, "-sts") ||
+ absl::EndsWith(host, "-iamcredentials")) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ValidateExteralAccountCredentials(const Json& json) {
+ return json.type() == Json::Type::OBJECT &&
+ ValidateUrlField(json, "token_url") &&
+ ValidateUrlField(json, "service_account_impersonation_url") &&
+ ValidateUrlField(json, "token_info_url");
+}
+
+} // namespace
+
/* Takes ownership of creds_path if not NULL. */
static grpc_error_handle create_default_creds_from_path(
const std::string& creds_path,
@@ -241,7 +295,7 @@ static grpc_error_handle create_default_creds_from_path(
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));
+ GRPC_ERROR_STR_RAW_BYTES, grpc_core::StringViewFromSlice(creds_data));
goto end;
}
@@ -273,6 +327,11 @@ static grpc_error_handle create_default_creds_from_path(
}
/* Finally try an external account credentials.*/
+ if (!ValidateExteralAccountCredentials(json)) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid external account credentials format.");
+ goto end;
+ }
result = grpc_core::ExternalAccountCredentials::Create(json, {}, &error);
end:
@@ -387,9 +446,9 @@ void set_gce_tenancy_checker_for_testing(grpc_gce_tenancy_checker checker) {
}
void grpc_flush_cached_google_default_credentials(void) {
- grpc_core::ExecCtx exec_ctx;
+ ExecCtx exec_ctx;
gpr_once_init(&g_once, init_default_credentials);
- grpc_core::MutexLock lock(g_state_mu);
+ MutexLock lock(g_state_mu);
g_metadata_server_available = 0;
}
diff --git a/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.h b/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.h
index 8a945da3..32ae0683 100644
--- a/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.h
+++ b/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.h
@@ -46,9 +46,7 @@ class grpc_google_default_channel_credentials
grpc_google_default_channel_credentials(
grpc_core::RefCountedPtr<grpc_channel_credentials> alts_creds,
grpc_core::RefCountedPtr<grpc_channel_credentials> ssl_creds)
- : grpc_channel_credentials(GRPC_CHANNEL_CREDENTIALS_TYPE_GOOGLE_DEFAULT),
- alts_creds_(std::move(alts_creds)),
- ssl_creds_(std::move(ssl_creds)) {}
+ : alts_creds_(std::move(alts_creds)), ssl_creds_(std::move(ssl_creds)) {}
~grpc_google_default_channel_credentials() override = default;
@@ -60,12 +58,20 @@ class grpc_google_default_channel_credentials
grpc_channel_args* update_arguments(grpc_channel_args* args) override;
+ const char* type() const override;
+
const grpc_channel_credentials* alts_creds() const {
return alts_creds_.get();
}
const grpc_channel_credentials* ssl_creds() const { return ssl_creds_.get(); }
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+ }
+
grpc_core::RefCountedPtr<grpc_channel_credentials> alts_creds_;
grpc_core::RefCountedPtr<grpc_channel_credentials> ssl_creds_;
};
diff --git a/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc b/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
index c9dc2235..f2f5a2a3 100644
--- a/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -20,49 +20,43 @@
#include "src/core/lib/security/credentials/iam/iam_credentials.h"
+#include "absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "absl/strings/str_format.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/surface/api_trace.h"
-grpc_google_iam_credentials::~grpc_google_iam_credentials() {
- grpc_credentials_mdelem_array_destroy(&md_array_);
-}
-
-bool grpc_google_iam_credentials::get_request_metadata(
- grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error_handle* /*error*/) {
- grpc_credentials_mdelem_array_append(md_array, &md_array_);
- return true;
-}
-
-void grpc_google_iam_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
- GRPC_ERROR_UNREF(error);
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_google_iam_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs*) {
+ if (token_.has_value()) {
+ initial_metadata->Append(
+ GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, token_->Ref(),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ }
+ initial_metadata->Append(
+ GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, authority_selector_.Ref(),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ return grpc_core::Immediate(std::move(initial_metadata));
}
grpc_google_iam_credentials::grpc_google_iam_credentials(
const char* token, const char* authority_selector)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_IAM),
+ : token_(token == nullptr ? absl::optional<grpc_core::Slice>()
+ : grpc_core::Slice::FromCopiedString(token)),
+ authority_selector_(
+ grpc_core::Slice::FromCopiedString(authority_selector)),
debug_string_(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));
- grpc_credentials_mdelem_array_add(&md_array_, md);
- GRPC_MDELEM_UNREF(md);
- md = grpc_mdelem_from_slices(
- grpc_slice_from_static_string(GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY),
- grpc_slice_from_copied_string(authority_selector));
- grpc_credentials_mdelem_array_add(&md_array_, md);
- GRPC_MDELEM_UNREF(md);
-}
+ token != nullptr ? "present" : "absent", authority_selector)) {}
+
+const char* grpc_google_iam_credentials::Type() { return "Iam"; }
grpc_call_credentials* grpc_google_iam_credentials_create(
const char* token, const char* authority_selector, void* reserved) {
diff --git a/grpc/src/core/lib/security/credentials/iam/iam_credentials.h b/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
index 881ba268..e717fd19 100644
--- a/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
+++ b/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
@@ -29,20 +29,26 @@ class grpc_google_iam_credentials : public grpc_call_credentials {
public:
grpc_google_iam_credentials(const char* token,
const char* authority_selector);
- ~grpc_google_iam_credentials() override;
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
std::string debug_string() override { return debug_string_; }
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
- grpc_credentials_mdelem_array md_array_;
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
+
+ const absl::optional<grpc_core::Slice> token_;
+ const grpc_core::Slice authority_selector_;
const std::string debug_string_;
};
diff --git a/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.cc b/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.cc
index 4cf500e6..55dff87b 100644
--- a/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.cc
@@ -18,45 +18,44 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
+#include "src/core/lib/security/credentials/insecure/insecure_credentials.h"
-#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/insecure/insecure_security_connector.h"
namespace grpc_core {
-namespace {
-constexpr char kCredentialsTypeInsecure[] = "insecure";
+RefCountedPtr<grpc_channel_security_connector>
+InsecureCredentials::create_security_connector(
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* /* target_name */, const grpc_channel_args* /* args */,
+ grpc_channel_args** /* new_args */) {
+ return MakeRefCounted<InsecureChannelSecurityConnector>(
+ Ref(), std::move(request_metadata_creds));
+}
-class InsecureCredentials final : public grpc_channel_credentials {
- public:
- InsecureCredentials() : grpc_channel_credentials(kCredentialsTypeInsecure) {}
+const char* InsecureCredentials::Type() { return "Insecure"; }
- RefCountedPtr<grpc_channel_security_connector> create_security_connector(
- RefCountedPtr<grpc_call_credentials> call_creds,
- const char* /* target_name */, const grpc_channel_args* /* args */,
- grpc_channel_args** /* new_args */) override {
- return MakeRefCounted<InsecureChannelSecurityConnector>(
- Ref(), std::move(call_creds));
- }
-};
+int InsecureCredentials::cmp_impl(
+ const grpc_channel_credentials* /* other */) const {
+ // All insecure credentials objects should compare equal.
+ return 0;
+}
-class InsecureServerCredentials final : public grpc_server_credentials {
- public:
- InsecureServerCredentials()
- : grpc_server_credentials(kCredentialsTypeInsecure) {}
+RefCountedPtr<grpc_server_security_connector>
+InsecureServerCredentials::create_security_connector(
+ const grpc_channel_args* /* args */) {
+ return MakeRefCounted<InsecureServerSecurityConnector>(Ref());
+}
- RefCountedPtr<grpc_server_security_connector> create_security_connector(
- const grpc_channel_args* /* args */) override {
- return MakeRefCounted<InsecureServerSecurityConnector>(Ref());
- }
-};
+const char* InsecureServerCredentials::Type() { return "Insecure"; }
-} // namespace
} // namespace grpc_core
grpc_channel_credentials* grpc_insecure_credentials_create() {
- return new grpc_core::InsecureCredentials();
+ // Create a singleton object for InsecureCredentials so that channels to the
+ // same target with InsecureCredentials can reuse the subchannels.
+ static auto* creds = new grpc_core::InsecureCredentials();
+ return creds->Ref().release();
}
grpc_server_credentials* grpc_insecure_server_credentials_create() {
diff --git a/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.h b/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.h
new file mode 100644
index 00000000..ff0139fe
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/insecure/insecure_credentials.h
@@ -0,0 +1,57 @@
+//
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_INSECURE_INSECURE_CREDENTIALS_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_INSECURE_INSECURE_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 InsecureCredentials final : public grpc_channel_credentials {
+ public:
+ RefCountedPtr<grpc_channel_security_connector> create_security_connector(
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ const char* /* target_name */, const grpc_channel_args* /* args */,
+ grpc_channel_args** /* new_args */) override;
+
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
+ private:
+ int cmp_impl(const grpc_channel_credentials* other) const override;
+};
+
+class InsecureServerCredentials final : public grpc_server_credentials {
+ public:
+ RefCountedPtr<grpc_server_security_connector> create_security_connector(
+ const grpc_channel_args* /* args */) override;
+
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_INSECURE_INSECURE_CREDENTIALS_H
diff --git a/grpc/src/core/lib/security/credentials/jwt/json_token.cc b/grpc/src/core/lib/security/credentials/jwt/json_token.cc
index 5e317c49..b57ca7b2 100644
--- a/grpc/src/core/lib/security/credentials/jwt/json_token.cc
+++ b/grpc/src/core/lib/security/credentials/jwt/json_token.cc
@@ -18,11 +18,14 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
#include <string.h>
+#include <openssl/bio.h>
+#include <openssl/evp.h>
+#include <openssl/pem.h>
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -30,15 +33,10 @@
#include <grpc/support/time.h>
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/slice/b64.h"
-extern "C" {
-#include <openssl/bio.h>
-#include <openssl/evp.h>
-#include <openssl/pem.h>
-}
-
using grpc_core::Json;
/* --- Constants. --- */
diff --git a/grpc/src/core/lib/security/credentials/jwt/json_token.h b/grpc/src/core/lib/security/credentials/jwt/json_token.h
index b9a41c6b..163cc3d7 100644
--- a/grpc/src/core/lib/security/credentials/jwt/json_token.h
+++ b/grpc/src/core/lib/security/credentials/jwt/json_token.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
#include <openssl/rsa.h>
+#include <grpc/slice.h>
+
#include "src/core/lib/json/json.h"
/* --- Constants. --- */
diff --git a/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index 27590f4b..2115a083 100644
--- a/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -27,96 +27,86 @@
#include "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/surface/api_trace.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-using grpc_core::Json;
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/security/credentials/call_creds_util.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
-void grpc_service_account_jwt_access_credentials::reset_cache() {
- GRPC_MDELEM_UNREF(cached_.jwt_md);
- cached_.jwt_md = GRPC_MDNULL;
- if (cached_.service_url != nullptr) {
- gpr_free(cached_.service_url);
- cached_.service_url = nullptr;
- }
- cached_.jwt_expiration = gpr_inf_past(GPR_CLOCK_REALTIME);
-}
+using grpc_core::Json;
grpc_service_account_jwt_access_credentials::
~grpc_service_account_jwt_access_credentials() {
grpc_auth_json_key_destruct(&key_);
- reset_cache();
gpr_mu_destroy(&cache_mu_);
}
-bool grpc_service_account_jwt_access_credentials::get_request_metadata(
- grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error_handle* error) {
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_service_account_jwt_access_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
gpr_timespec refresh_threshold = gpr_time_from_seconds(
GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS, GPR_TIMESPAN);
- /* See if we can return a cached jwt. */
- grpc_mdelem jwt_md = GRPC_MDNULL;
+ // Remove service name from service_url to follow the audience format
+ // dictated in https://google.aip.dev/auth/4111.
+ absl::StatusOr<std::string> uri = grpc_core::RemoveServiceNameFromJwtUri(
+ grpc_core::MakeJwtServiceUrl(initial_metadata, args));
+ if (!uri.ok()) {
+ return grpc_core::Immediate(uri.status());
+ }
+ // See if we can return a cached jwt.
+ absl::optional<grpc_core::Slice> jwt_value;
{
gpr_mu_lock(&cache_mu_);
- if (cached_.service_url != nullptr &&
- strcmp(cached_.service_url, context.service_url) == 0 &&
- !GRPC_MDISNULL(cached_.jwt_md) &&
+ if (cached_.has_value() && cached_->service_url == *uri &&
(gpr_time_cmp(
- gpr_time_sub(cached_.jwt_expiration, gpr_now(GPR_CLOCK_REALTIME)),
+ gpr_time_sub(cached_->jwt_expiration, gpr_now(GPR_CLOCK_REALTIME)),
refresh_threshold) > 0)) {
- jwt_md = GRPC_MDELEM_REF(cached_.jwt_md);
+ jwt_value = cached_->jwt_value.Ref();
}
gpr_mu_unlock(&cache_mu_);
}
- if (GRPC_MDISNULL(jwt_md)) {
+ if (!jwt_value.has_value()) {
char* jwt = nullptr;
- /* Generate a new jwt. */
+ // Generate a new jwt.
gpr_mu_lock(&cache_mu_);
- reset_cache();
- jwt = grpc_jwt_encode_and_sign(&key_, context.service_url, jwt_lifetime_,
- nullptr);
+ cached_.reset();
+ jwt = grpc_jwt_encode_and_sign(&key_, uri->c_str(), jwt_lifetime_, nullptr);
if (jwt != nullptr) {
std::string md_value = 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)));
- jwt_md = GRPC_MDELEM_REF(cached_.jwt_md);
+ jwt_value = grpc_core::Slice::FromCopiedString(md_value);
+ cached_ = {jwt_value->Ref(), std::move(*uri),
+ gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), jwt_lifetime_)};
}
gpr_mu_unlock(&cache_mu_);
}
- if (!GRPC_MDISNULL(jwt_md)) {
- grpc_credentials_mdelem_array_add(md_array, jwt_md);
- GRPC_MDELEM_UNREF(jwt_md);
- } else {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT.");
+ if (!jwt_value.has_value()) {
+ return grpc_core::Immediate(
+ absl::UnauthenticatedError("Could not generate JWT."));
}
- return true;
-}
-void grpc_service_account_jwt_access_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
- GRPC_ERROR_UNREF(error);
+ initial_metadata->Append(
+ GRPC_AUTHORIZATION_METADATA_KEY, std::move(*jwt_value),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ return grpc_core::Immediate(std::move(initial_metadata));
}
grpc_service_account_jwt_access_credentials::
grpc_service_account_jwt_access_credentials(grpc_auth_json_key key,
gpr_timespec token_lifetime)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_JWT), key_(key) {
+ : key_(key) {
gpr_timespec max_token_lifetime = grpc_max_auth_token_lifetime();
if (gpr_time_cmp(token_lifetime, max_token_lifetime) > 0) {
gpr_log(GPR_INFO,
@@ -126,7 +116,10 @@ grpc_service_account_jwt_access_credentials::
}
jwt_lifetime_ = token_lifetime;
gpr_mu_init(&cache_mu_);
- reset_cache();
+}
+
+const char* grpc_service_account_jwt_access_credentials::Type() {
+ return "Jwt";
}
grpc_core::RefCountedPtr<grpc_call_credentials>
@@ -173,3 +166,15 @@ grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
grpc_auth_json_key_create_from_string(json_key), token_lifetime)
.release();
}
+
+namespace grpc_core {
+
+absl::StatusOr<std::string> RemoveServiceNameFromJwtUri(absl::string_view uri) {
+ auto parsed = URI::Parse(uri);
+ if (!parsed.ok()) {
+ return parsed.status();
+ }
+ return absl::StrFormat("%s://%s/", parsed->scheme(), parsed->authority());
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h b/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
index 5ae4c1f4..a296fc3a 100644
--- a/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -23,10 +23,11 @@
#include <string>
-#include <grpc/support/time.h>
-
#include "absl/strings/str_format.h"
#include "absl/time/time.h"
+
+#include <grpc/support/time.h>
+
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
@@ -37,14 +38,9 @@ class grpc_service_account_jwt_access_credentials
gpr_timespec token_lifetime);
~grpc_service_account_jwt_access_credentials() override;
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
const gpr_timespec& jwt_lifetime() const { return jwt_lifetime_; }
const grpc_auth_json_key& key() const { return key_; }
@@ -56,17 +52,26 @@ class grpc_service_account_jwt_access_credentials
static_cast<int64_t>(gpr_timespec_to_micros(jwt_lifetime_)))));
};
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
- void reset_cache();
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
// Have a simple cache for now with just 1 entry. We could have a map based on
// the service_url for a more sophisticated one.
gpr_mu cache_mu_;
- struct {
- grpc_mdelem jwt_md = GRPC_MDNULL;
- char* service_url = nullptr;
+ struct Cache {
+ grpc_core::Slice jwt_value;
+ std::string service_url;
gpr_timespec jwt_expiration;
- } cached_;
+ };
+ absl::optional<Cache> cached_;
grpc_auth_json_key key_;
gpr_timespec jwt_lifetime_;
@@ -78,4 +83,11 @@ grpc_core::RefCountedPtr<grpc_call_credentials>
grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
grpc_auth_json_key key, gpr_timespec token_lifetime);
+namespace grpc_core {
+
+// Exposed for testing purposes only.
+absl::StatusOr<std::string> RemoveServiceNameFromJwtUri(absl::string_view uri);
+
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */
diff --git a/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index 8d43cf98..f4bf0055 100644
--- a/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
+++ b/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -23,20 +23,19 @@
#include <limits.h>
#include <string.h>
+#include <openssl/bn.h>
+#include <openssl/pem.h>
+#include <openssl/rsa.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-extern "C" {
-#include <openssl/bn.h>
-#include <openssl/pem.h>
-#include <openssl/rsa.h>
-}
-
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/http/httpcli.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -134,7 +133,7 @@ static void jose_header_destroy(jose_header* h) {
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)));
+ jose_header* h = grpc_core::Zalloc<jose_header>();
if (json.type() != Json::Type::OBJECT) {
gpr_log(GPR_ERROR, "JSON value is not an object");
goto error;
@@ -238,8 +237,7 @@ gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims) {
}
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)));
+ grpc_jwt_claims* claims = grpc_core::Zalloc<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);
@@ -347,6 +345,7 @@ struct verifier_cb_ctx {
void* user_data;
grpc_jwt_verification_done_cb user_cb;
grpc_http_response responses[HTTP_RESPONSE_COUNT];
+ grpc_core::OrphanablePtr<grpc_core::HttpRequest> http_request;
};
/* Takes ownership of the header, claims and signature. */
static verifier_cb_ctx* verifier_cb_ctx_create(
@@ -356,8 +355,7 @@ static verifier_cb_ctx* verifier_cb_ctx_create(
grpc_jwt_verification_done_cb cb) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- verifier_cb_ctx* ctx =
- static_cast<verifier_cb_ctx*>(gpr_zalloc(sizeof(verifier_cb_ctx)));
+ verifier_cb_ctx* ctx = new verifier_cb_ctx();
ctx->verifier = verifier;
ctx->pollent = grpc_polling_entity_create_from_pollset(pollset);
ctx->header = header;
@@ -367,7 +365,6 @@ static verifier_cb_ctx* verifier_cb_ctx_create(
ctx->signed_data = grpc_slice_from_copied_buffer(signed_jwt, signed_jwt_len);
ctx->user_data = user_data;
ctx->user_cb = cb;
-
return ctx;
}
@@ -381,7 +378,7 @@ void verifier_cb_ctx_destroy(verifier_cb_ctx* ctx) {
grpc_http_response_destroy(&ctx->responses[i]);
}
/* TODO: see what to do with claims... */
- gpr_free(ctx);
+ delete ctx;
}
/* --- grpc_jwt_verifier object. --- */
@@ -390,7 +387,8 @@ void verifier_cb_ctx_destroy(verifier_cb_ctx* ctx) {
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;
+grpc_core::Duration grpc_jwt_verifier_max_delay =
+ grpc_core::Duration::Minutes(1);
struct email_key_mapping {
char* email_domain;
@@ -400,10 +398,9 @@ struct grpc_jwt_verifier {
email_key_mapping* mappings;
size_t num_mappings; /* Should be very few, linear search ok. */
size_t allocated_mappings;
- grpc_httpcli_context http_ctx;
};
-static Json json_from_http(const grpc_httpcli_response* response) {
+static Json json_from_http(const grpc_http_response* response) {
if (response == nullptr) {
gpr_log(GPR_ERROR, "HTTP response is NULL.");
return Json(); // JSON null
@@ -672,10 +669,13 @@ static void on_openid_config_retrieved(void* user_data,
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);
- grpc_httpcli_request req;
+ grpc_http_request req;
+ memset(&req, 0, sizeof(grpc_http_request));
const char* jwks_uri;
- grpc_resource_quota* resource_quota = nullptr;
const Json* cur;
+ absl::StatusOr<grpc_core::URI> uri;
+ char* host;
+ char* path;
/* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */
if (json.type() == Json::Type::JSON_NULL) goto error;
@@ -691,26 +691,30 @@ static void on_openid_config_retrieved(void* user_data,
goto error;
}
jwks_uri += 8;
- req.handshaker = &grpc_httpcli_ssl;
- req.host = gpr_strdup(jwks_uri);
- req.http.path = const_cast<char*>(strchr(jwks_uri, '/'));
- if (req.http.path == nullptr) {
- req.http.path = const_cast<char*>("");
+ host = gpr_strdup(jwks_uri);
+ path = const_cast<char*>(strchr(jwks_uri, '/'));
+ if (path == nullptr) {
+ path = const_cast<char*>("");
} else {
- *(req.host + (req.http.path - jwks_uri)) = '\0';
+ *(host + (path - jwks_uri)) = '\0';
}
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- resource_quota = grpc_resource_quota_create("jwt_verifier");
- grpc_httpcli_get(
- &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
+ uri = grpc_core::URI::Create("https", host, path, {} /* query params /*/,
+ "" /* fragment */);
+ if (!uri.ok()) {
+ goto error;
+ }
+ ctx->http_request = grpc_core::HttpRequest::Get(
+ std::move(*uri), nullptr /* channel args */, &ctx->pollent, &req,
grpc_core::ExecCtx::Get()->Now() + grpc_jwt_verifier_max_delay,
GRPC_CLOSURE_CREATE(on_keys_retrieved, ctx, grpc_schedule_on_exec_ctx),
- &ctx->responses[HTTP_RESPONSE_KEYS]);
- grpc_resource_quota_unref_internal(resource_quota);
- gpr_free(req.host);
+ &ctx->responses[HTTP_RESPONSE_KEYS],
+ grpc_core::CreateHttpRequestSSLCredentials());
+ ctx->http_request->Start();
+ gpr_free(host);
return;
error:
@@ -768,11 +772,12 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) {
grpc_closure* http_cb;
char* path_prefix = nullptr;
const char* iss;
- grpc_httpcli_request req;
- grpc_resource_quota* resource_quota = nullptr;
- memset(&req, 0, sizeof(grpc_httpcli_request));
- req.handshaker = &grpc_httpcli_ssl;
+ grpc_http_request req;
+ memset(&req, 0, sizeof(grpc_http_request));
http_response_index rsp_idx;
+ char* host;
+ char* path;
+ absl::StatusOr<grpc_core::URI> uri;
GPR_ASSERT(ctx != nullptr && ctx->header != nullptr &&
ctx->claims != nullptr);
@@ -800,26 +805,25 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) {
gpr_log(GPR_ERROR, "Missing mapping for issuer email.");
goto error;
}
- req.host = gpr_strdup(mapping->key_url_prefix);
- path_prefix = strchr(req.host, '/');
+ host = gpr_strdup(mapping->key_url_prefix);
+ path_prefix = strchr(host, '/');
if (path_prefix == nullptr) {
- gpr_asprintf(&req.http.path, "/%s", iss);
+ gpr_asprintf(&path, "/%s", iss);
} else {
*(path_prefix++) = '\0';
- gpr_asprintf(&req.http.path, "/%s/%s", path_prefix, iss);
+ gpr_asprintf(&path, "/%s/%s", path_prefix, iss);
}
http_cb =
GRPC_CLOSURE_CREATE(on_keys_retrieved, ctx, grpc_schedule_on_exec_ctx);
rsp_idx = HTTP_RESPONSE_KEYS;
} else {
- req.host = gpr_strdup(strstr(iss, "https://") == iss ? iss + 8 : iss);
- path_prefix = strchr(req.host, '/');
+ host = gpr_strdup(strstr(iss, "https://") == iss ? iss + 8 : iss);
+ path_prefix = strchr(host, '/');
if (path_prefix == nullptr) {
- req.http.path = gpr_strdup(GRPC_OPENID_CONFIG_URL_SUFFIX);
+ path = gpr_strdup(GRPC_OPENID_CONFIG_URL_SUFFIX);
} else {
*(path_prefix++) = 0;
- gpr_asprintf(&req.http.path, "/%s%s", path_prefix,
- GRPC_OPENID_CONFIG_URL_SUFFIX);
+ gpr_asprintf(&path, "/%s%s", path_prefix, GRPC_OPENID_CONFIG_URL_SUFFIX);
}
http_cb = GRPC_CLOSURE_CREATE(on_openid_config_retrieved, ctx,
grpc_schedule_on_exec_ctx);
@@ -829,14 +833,18 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) {
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- resource_quota = grpc_resource_quota_create("jwt_verifier");
- grpc_httpcli_get(
- &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
+ uri = grpc_core::URI::Create("https", host, path, {} /* query params */,
+ "" /* fragment */);
+ if (!uri.ok()) {
+ goto error;
+ }
+ ctx->http_request = grpc_core::HttpRequest::Get(
+ std::move(*uri), nullptr /* channel args */, &ctx->pollent, &req,
grpc_core::ExecCtx::Get()->Now() + grpc_jwt_verifier_max_delay, http_cb,
- &ctx->responses[rsp_idx]);
- grpc_resource_quota_unref_internal(resource_quota);
- gpr_free(req.host);
- gpr_free(req.http.path);
+ &ctx->responses[rsp_idx], grpc_core::CreateHttpRequestSSLCredentials());
+ ctx->http_request->Start();
+ gpr_free(host);
+ gpr_free(path);
return;
error:
@@ -892,9 +900,7 @@ error:
grpc_jwt_verifier* grpc_jwt_verifier_create(
const grpc_jwt_verifier_email_domain_key_url_mapping* mappings,
size_t num_mappings) {
- grpc_jwt_verifier* v =
- static_cast<grpc_jwt_verifier*>(gpr_zalloc(sizeof(grpc_jwt_verifier)));
- grpc_httpcli_context_init(&v->http_ctx);
+ grpc_jwt_verifier* v = grpc_core::Zalloc<grpc_jwt_verifier>();
/* We know at least of one mapping. */
v->allocated_mappings = 1 + num_mappings;
@@ -916,7 +922,6 @@ grpc_jwt_verifier* grpc_jwt_verifier_create(
void grpc_jwt_verifier_destroy(grpc_jwt_verifier* v) {
size_t i;
if (v == nullptr) return;
- grpc_httpcli_context_destroy(&v->http_ctx);
if (v->mappings != nullptr) {
for (i = 0; i < v->num_mappings; i++) {
gpr_free(v->mappings[i].email_domain);
diff --git a/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h b/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 66ddbf22..85883db9 100644
--- a/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/json/json.h"
-
#include <grpc/slice.h>
#include <grpc/support/time.h>
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/json/json.h"
+
/* --- Constants. --- */
#define GRPC_OPENID_CONFIG_URL_SUFFIX "/.well-known/openid-configuration"
@@ -82,7 +82,7 @@ struct grpc_jwt_verifier_email_domain_key_url_mapping {
};
/* Globals to control the verifier. Not thread-safe. */
extern gpr_timespec grpc_jwt_verifier_clock_skew;
-extern grpc_millis grpc_jwt_verifier_max_delay;
+extern grpc_core::Duration grpc_jwt_verifier_max_delay;
/* The verifier can be created with some custom mappings to help with key
discovery in the case where the issuer is an email address.
diff --git a/grpc/src/core/lib/security/credentials/local/local_credentials.cc b/grpc/src/core/lib/security/credentials/local/local_credentials.cc
index 84caf1c3..b03f3865 100644
--- a/grpc/src/core/lib/security/credentials/local/local_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/local/local_credentials.cc
@@ -27,8 +27,6 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/security/security_connector/local/local_security_connector.h"
-#define GRPC_CREDENTIALS_TYPE_LOCAL "Local"
-
grpc_core::RefCountedPtr<grpc_channel_security_connector>
grpc_local_credentials::create_security_connector(
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
@@ -38,16 +36,19 @@ grpc_local_credentials::create_security_connector(
this->Ref(), std::move(request_metadata_creds), args, target_name);
}
+const char* grpc_local_credentials::type() const { return "Local"; }
+
grpc_core::RefCountedPtr<grpc_server_security_connector>
grpc_local_server_credentials::create_security_connector(
const grpc_channel_args* /* args */) {
return grpc_local_server_security_connector_create(this->Ref());
}
+const char* grpc_local_server_credentials::type() const { return "Local"; }
+
grpc_local_credentials::grpc_local_credentials(
grpc_local_connect_type connect_type)
- : grpc_channel_credentials(GRPC_CREDENTIALS_TYPE_LOCAL),
- connect_type_(connect_type) {}
+ : connect_type_(connect_type) {}
grpc_channel_credentials* grpc_local_credentials_create(
grpc_local_connect_type connect_type) {
@@ -56,8 +57,7 @@ grpc_channel_credentials* grpc_local_credentials_create(
grpc_local_server_credentials::grpc_local_server_credentials(
grpc_local_connect_type connect_type)
- : grpc_server_credentials(GRPC_CREDENTIALS_TYPE_LOCAL),
- connect_type_(connect_type) {}
+ : connect_type_(connect_type) {}
grpc_server_credentials* grpc_local_server_credentials_create(
grpc_local_connect_type connect_type) {
diff --git a/grpc/src/core/lib/security/credentials/local/local_credentials.h b/grpc/src/core/lib/security/credentials/local/local_credentials.h
index a1857ad8..5e1bb6a1 100644
--- a/grpc/src/core/lib/security/credentials/local/local_credentials.h
+++ b/grpc/src/core/lib/security/credentials/local/local_credentials.h
@@ -37,9 +37,17 @@ class grpc_local_credentials final : public grpc_channel_credentials {
const char* target_name, const grpc_channel_args* args,
grpc_channel_args** new_args) override;
+ const char* type() const override;
+
grpc_local_connect_type connect_type() const { return connect_type_; }
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+ }
+
grpc_local_connect_type connect_type_;
};
@@ -52,6 +60,8 @@ class grpc_local_server_credentials final : public grpc_server_credentials {
grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* /* args */) override;
+ const char* type() const override;
+
grpc_local_connect_type connect_type() const { return connect_type_; }
private:
diff --git a/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index 50d20e64..906d208e 100644
--- a/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -18,12 +18,14 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include <string.h>
+#include <atomic>
+
#include "absl/container/inlined_vector.h"
+#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
@@ -36,12 +38,18 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/capture.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/transport.h"
#include "src/core/lib/uri/uri_parser.h"
using grpc_core::Json;
@@ -127,16 +135,15 @@ void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token) {
grpc_oauth2_token_fetcher_credentials::
~grpc_oauth2_token_fetcher_credentials() {
- GRPC_MDELEM_UNREF(access_token_md_);
gpr_mu_destroy(&mu_);
grpc_pollset_set_destroy(grpc_polling_entity_pollset_set(&pollent_));
- grpc_httpcli_context_destroy(&httpcli_context_);
}
grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response(
- const grpc_http_response* response, grpc_mdelem* token_md,
- grpc_millis* token_lifetime) {
+ const grpc_http_response* response,
+ absl::optional<grpc_core::Slice>* token_value,
+ grpc_core::Duration* token_lifetime) {
char* null_terminated_body = nullptr;
grpc_credentials_status status = GRPC_CREDENTIALS_OK;
Json json;
@@ -203,20 +210,15 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
goto end;
}
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(
- absl::StrCat(token_type, " ", access_token)));
+ *token_lifetime =
+ grpc_core::Duration::Seconds(strtol(expires_in, nullptr, 10));
+ *token_value = grpc_core::Slice::FromCopiedString(
+ absl::StrCat(token_type, " ", access_token));
status = GRPC_CREDENTIALS_OK;
}
end:
- if (status != GRPC_CREDENTIALS_OK && !GRPC_MDISNULL(*token_md)) {
- GRPC_MDELEM_UNREF(*token_md);
- *token_md = GRPC_MDNULL;
- }
+ if (status != GRPC_CREDENTIALS_OK) *token_value = absl::nullopt;
gpr_free(null_terminated_body);
return status;
}
@@ -233,82 +235,86 @@ static void on_oauth2_token_fetcher_http_response(void* user_data,
void grpc_oauth2_token_fetcher_credentials::on_http_response(
grpc_credentials_metadata_request* r, grpc_error_handle error) {
- grpc_mdelem access_token_md = GRPC_MDNULL;
- grpc_millis token_lifetime = 0;
+ absl::optional<grpc_core::Slice> access_token_value;
+ grpc_core::Duration token_lifetime;
grpc_credentials_status status =
error == GRPC_ERROR_NONE
? grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &r->response, &access_token_md, &token_lifetime)
+ &r->response, &access_token_value, &token_lifetime)
: GRPC_CREDENTIALS_ERROR;
// Update cache and grab list of pending requests.
gpr_mu_lock(&mu_);
token_fetch_pending_ = false;
- access_token_md_ = GRPC_MDELEM_REF(access_token_md);
- token_expiration_ =
- status == GRPC_CREDENTIALS_OK
- ? gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
- gpr_time_from_millis(token_lifetime, GPR_TIMESPAN))
- : gpr_inf_past(GPR_CLOCK_MONOTONIC);
+ if (access_token_value.has_value()) {
+ access_token_value_ = access_token_value->Ref();
+ } else {
+ access_token_value_ = absl::nullopt;
+ }
+ token_expiration_ = status == GRPC_CREDENTIALS_OK
+ ? gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ token_lifetime.as_timespec())
+ : gpr_inf_past(GPR_CLOCK_MONOTONIC);
grpc_oauth2_pending_get_request_metadata* pending_request = pending_requests_;
pending_requests_ = nullptr;
gpr_mu_unlock(&mu_);
// Invoke callbacks for all pending requests.
while (pending_request != nullptr) {
- grpc_error_handle new_error = GRPC_ERROR_NONE;
if (status == GRPC_CREDENTIALS_OK) {
- grpc_credentials_mdelem_array_add(pending_request->md_array,
- access_token_md);
+ pending_request->md->Append(
+ GRPC_AUTHORIZATION_METADATA_KEY, access_token_value->Ref(),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ pending_request->result = std::move(pending_request->md);
} else {
- new_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ auto err = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
+ pending_request->result = grpc_error_to_absl_status(err);
+ GRPC_ERROR_UNREF(err);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION,
- pending_request->on_request_metadata, new_error);
+ pending_request->done.store(true, std::memory_order_release);
+ pending_request->waker.Wakeup();
grpc_polling_entity_del_from_pollset_set(
pending_request->pollent, grpc_polling_entity_pollset_set(&pollent_));
grpc_oauth2_pending_get_request_metadata* prev = pending_request;
pending_request = pending_request->next;
- gpr_free(prev);
+ prev->Unref();
}
- GRPC_MDELEM_UNREF(access_token_md);
- Unref();
- grpc_credentials_metadata_request_destroy(r);
+ delete r;
}
-bool grpc_oauth2_token_fetcher_credentials::get_request_metadata(
- grpc_polling_entity* pollent, grpc_auth_metadata_context /*context*/,
- grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error_handle* /*error*/) {
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_oauth2_token_fetcher_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs*) {
// Check if we can use the cached token.
- grpc_millis refresh_threshold =
- GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS * GPR_MS_PER_SEC;
- grpc_mdelem cached_access_token_md = GRPC_MDNULL;
+ absl::optional<grpc_core::Slice> cached_access_token_value;
gpr_mu_lock(&mu_);
- if (!GRPC_MDISNULL(access_token_md_) &&
+ if (access_token_value_.has_value() &&
gpr_time_cmp(
gpr_time_sub(token_expiration_, gpr_now(GPR_CLOCK_MONOTONIC)),
gpr_time_from_seconds(GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS,
GPR_TIMESPAN)) > 0) {
- cached_access_token_md = GRPC_MDELEM_REF(access_token_md_);
+ cached_access_token_value = access_token_value_->Ref();
}
- if (!GRPC_MDISNULL(cached_access_token_md)) {
+ if (cached_access_token_value.has_value()) {
gpr_mu_unlock(&mu_);
- grpc_credentials_mdelem_array_add(md_array, cached_access_token_md);
- GRPC_MDELEM_UNREF(cached_access_token_md);
- return true;
+ initial_metadata->Append(
+ GRPC_AUTHORIZATION_METADATA_KEY, std::move(*cached_access_token_value),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ return grpc_core::Immediate(std::move(initial_metadata));
}
// Couldn't get the token from the cache.
// Add request to pending_requests_ and start a new fetch if needed.
- grpc_oauth2_pending_get_request_metadata* pending_request =
- static_cast<grpc_oauth2_pending_get_request_metadata*>(
- gpr_malloc(sizeof(*pending_request)));
- pending_request->md_array = md_array;
- pending_request->on_request_metadata = on_request_metadata;
- pending_request->pollent = pollent;
+ grpc_core::Duration refresh_threshold =
+ grpc_core::Duration::Seconds(GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS);
+ auto pending_request =
+ grpc_core::MakeRefCounted<grpc_oauth2_pending_get_request_metadata>();
+ pending_request->pollent = grpc_core::GetContext<grpc_polling_entity>();
+ pending_request->waker = grpc_core::Activity::current()->MakeNonOwningWaker();
grpc_polling_entity_add_to_pollset_set(
- pollent, grpc_polling_entity_pollset_set(&pollent_));
+ pending_request->pollent, grpc_polling_entity_pollset_set(&pollent_));
pending_request->next = pending_requests_;
- pending_requests_ = pending_request;
+ pending_request->md = std::move(initial_metadata);
+ pending_requests_ = pending_request->Ref().release();
bool start_fetch = false;
if (!token_fetch_pending_) {
token_fetch_pending_ = true;
@@ -316,55 +322,35 @@ bool grpc_oauth2_token_fetcher_credentials::get_request_metadata(
}
gpr_mu_unlock(&mu_);
if (start_fetch) {
- Ref().release();
- fetch_oauth2(grpc_credentials_metadata_request_create(this->Ref()),
- &httpcli_context_, &pollent_,
+ fetch_oauth2(new grpc_credentials_metadata_request(Ref()), &pollent_,
on_oauth2_token_fetcher_http_response,
grpc_core::ExecCtx::Get()->Now() + refresh_threshold);
}
- return false;
-}
-
-void grpc_oauth2_token_fetcher_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
- gpr_mu_lock(&mu_);
- grpc_oauth2_pending_get_request_metadata* prev = nullptr;
- grpc_oauth2_pending_get_request_metadata* pending_request = pending_requests_;
- while (pending_request != nullptr) {
- if (pending_request->md_array == md_array) {
- // Remove matching pending request from the list.
- if (prev != nullptr) {
- prev->next = pending_request->next;
- } else {
- pending_requests_ = pending_request->next;
- }
- // Invoke the callback immediately with an error.
- grpc_core::ExecCtx::Run(DEBUG_LOCATION,
- pending_request->on_request_metadata,
- GRPC_ERROR_REF(error));
- gpr_free(pending_request);
- break;
- }
- prev = pending_request;
- pending_request = pending_request->next;
- }
- gpr_mu_unlock(&mu_);
- GRPC_ERROR_UNREF(error);
+ return
+ [pending_request]()
+ -> grpc_core::Poll<absl::StatusOr<grpc_core::ClientMetadataHandle>> {
+ if (!pending_request->done.load(std::memory_order_acquire)) {
+ return grpc_core::Pending{};
+ }
+ return std::move(pending_request->result);
+ };
}
grpc_oauth2_token_fetcher_credentials::grpc_oauth2_token_fetcher_credentials()
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_OAUTH2),
- token_expiration_(gpr_inf_past(GPR_CLOCK_MONOTONIC)),
+ : token_expiration_(gpr_inf_past(GPR_CLOCK_MONOTONIC)),
pollent_(grpc_polling_entity_create_from_pollset_set(
grpc_pollset_set_create())) {
gpr_mu_init(&mu_);
- grpc_httpcli_context_init(&httpcli_context_);
}
std::string grpc_oauth2_token_fetcher_credentials::debug_string() {
return "OAuth2TokenFetcherCredentials";
}
+const char* grpc_oauth2_token_fetcher_credentials::type() const {
+ return "Oauth2";
+}
+
//
// Google Compute Engine credentials.
//
@@ -379,29 +365,31 @@ class grpc_compute_engine_token_fetcher_credentials
protected:
void fetch_oauth2(grpc_credentials_metadata_request* metadata_req,
- grpc_httpcli_context* http_context,
grpc_polling_entity* pollent,
grpc_iomgr_cb_func response_cb,
- grpc_millis deadline) override {
+ grpc_core::Timestamp deadline) override {
grpc_http_header header = {const_cast<char*>("Metadata-Flavor"),
const_cast<char*>("Google")};
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(GRPC_COMPUTE_ENGINE_METADATA_HOST);
- request.http.path =
- const_cast<char*>(GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH);
- request.http.hdr_count = 1;
- request.http.hdrs = &header;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
+ request.hdr_count = 1;
+ request.hdrs = &header;
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("oauth2_credentials");
- grpc_httpcli_get(http_context, pollent, resource_quota, &request, deadline,
- GRPC_CLOSURE_INIT(&http_get_cb_closure_, response_cb,
- metadata_req, grpc_schedule_on_exec_ctx),
- &metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ auto uri = grpc_core::URI::Create("http", GRPC_COMPUTE_ENGINE_METADATA_HOST,
+ GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH,
+ {} /* query params */, "" /* fragment */);
+ GPR_ASSERT(uri.ok()); // params are hardcoded
+ http_request_ = grpc_core::HttpRequest::Get(
+ std::move(*uri), nullptr /* channel args */, pollent, &request,
+ deadline,
+ GRPC_CLOSURE_INIT(&http_get_cb_closure_, response_cb, metadata_req,
+ grpc_schedule_on_exec_ctx),
+ &metadata_req->response,
+ grpc_core::RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create()));
+ http_request_->Start();
}
std::string debug_string() override {
@@ -412,6 +400,7 @@ class grpc_compute_engine_token_fetcher_credentials
private:
grpc_closure http_get_cb_closure_;
+ grpc_core::OrphanablePtr<grpc_core::HttpRequest> http_request_;
};
} // namespace
@@ -437,32 +426,33 @@ grpc_google_refresh_token_credentials::
void grpc_google_refresh_token_credentials::fetch_oauth2(
grpc_credentials_metadata_request* metadata_req,
- grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
- grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
+ grpc_polling_entity* pollent, grpc_iomgr_cb_func response_cb,
+ grpc_core::Timestamp deadline) {
grpc_http_header header = {
const_cast<char*>("Content-Type"),
const_cast<char*>("application/x-www-form-urlencoded")};
- grpc_httpcli_request request;
+ grpc_http_request request;
std::string body = 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 = const_cast<char*>(GRPC_GOOGLE_OAUTH2_SERVICE_HOST);
- request.http.path = const_cast<char*>(GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH);
- request.http.hdr_count = 1;
- request.http.hdrs = &header;
- request.handshaker = &grpc_httpcli_ssl;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ memset(&request, 0, sizeof(grpc_http_request));
+ request.hdr_count = 1;
+ request.hdrs = &header;
+ request.body = const_cast<char*>(body.c_str());
+ request.body_length = body.size();
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
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_CLOSURE_INIT(&http_post_cb_closure_, response_cb,
- metadata_req, grpc_schedule_on_exec_ctx),
- &metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ auto uri = grpc_core::URI::Create("https", GRPC_GOOGLE_OAUTH2_SERVICE_HOST,
+ GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH,
+ {} /* query params */, "" /* fragment */);
+ GPR_ASSERT(uri.ok()); // params are hardcoded
+ http_request_ = grpc_core::HttpRequest::Post(
+ std::move(*uri), nullptr /* channel args */, pollent, &request, deadline,
+ GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req,
+ grpc_schedule_on_exec_ctx),
+ &metadata_req->response, grpc_core::CreateHttpRequestSSLCredentials());
+ http_request_->Start();
}
grpc_google_refresh_token_credentials::grpc_google_refresh_token_credentials(
@@ -486,6 +476,10 @@ std::string grpc_google_refresh_token_credentials::debug_string() {
grpc_oauth2_token_fetcher_credentials::debug_string());
}
+const char* grpc_google_refresh_token_credentials::type() const {
+ return "GoogleRefreshToken";
+}
+
static std::string create_loggable_refresh_token(
grpc_auth_refresh_token* token) {
if (strcmp(token->type, GRPC_AUTH_JSON_TYPE_INVALID) == 0) {
@@ -560,13 +554,12 @@ class StsTokenFetcherCredentials
private:
void fetch_oauth2(grpc_credentials_metadata_request* metadata_req,
- grpc_httpcli_context* http_context,
grpc_polling_entity* pollent,
grpc_iomgr_cb_func response_cb,
- grpc_millis deadline) override {
- char* body = nullptr;
- size_t body_length = 0;
- grpc_error_handle err = FillBody(&body, &body_length);
+ Timestamp deadline) override {
+ grpc_http_request request;
+ memset(&request, 0, sizeof(grpc_http_request));
+ grpc_error_handle err = FillBody(&request.body, &request.body_length);
if (err != GRPC_ERROR_NONE) {
response_cb(metadata_req, err);
GRPC_ERROR_UNREF(err);
@@ -575,28 +568,25 @@ class StsTokenFetcherCredentials
grpc_http_header header = {
const_cast<char*>("Content-Type"),
const_cast<char*>("application/x-www-form-urlencoded")};
- grpc_httpcli_request request;
- memset(&request, 0, sizeof(grpc_httpcli_request));
- request.host = const_cast<char*>(sts_url_.authority().c_str());
- request.http.path = const_cast<char*>(sts_url_.path().c_str());
- request.http.hdr_count = 1;
- request.http.hdrs = &header;
- request.handshaker = (sts_url_.scheme() == "https")
- ? &grpc_httpcli_ssl
- : &grpc_httpcli_plaintext;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ request.hdr_count = 1;
+ request.hdrs = &header;
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("oauth2_credentials_refresh");
- grpc_httpcli_post(
- http_context, pollent, resource_quota, &request, body, body_length,
- deadline,
+ RefCountedPtr<grpc_channel_credentials> http_request_creds;
+ if (sts_url_.scheme() == "http") {
+ http_request_creds = RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
+ } else {
+ http_request_creds = CreateHttpRequestSSLCredentials();
+ }
+ http_request_ = HttpRequest::Post(
+ sts_url_, nullptr /* channel args */, pollent, &request, deadline,
GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req,
grpc_schedule_on_exec_ctx),
- &metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
- gpr_free(body);
+ &metadata_req->response, std::move(http_request_creds));
+ http_request_->Start();
+ gpr_free(request.body);
}
grpc_error_handle FillBody(char** body, size_t* body_length) {
@@ -643,14 +633,15 @@ class StsTokenFetcherCredentials
URI sts_url_;
grpc_closure http_post_cb_closure_;
- grpc_core::UniquePtr<char> resource_;
- grpc_core::UniquePtr<char> audience_;
- grpc_core::UniquePtr<char> scope_;
- grpc_core::UniquePtr<char> requested_token_type_;
- grpc_core::UniquePtr<char> subject_token_path_;
- grpc_core::UniquePtr<char> subject_token_type_;
- grpc_core::UniquePtr<char> actor_token_path_;
- grpc_core::UniquePtr<char> actor_token_type_;
+ UniquePtr<char> resource_;
+ UniquePtr<char> audience_;
+ UniquePtr<char> scope_;
+ UniquePtr<char> requested_token_type_;
+ UniquePtr<char> subject_token_path_;
+ UniquePtr<char> subject_token_type_;
+ UniquePtr<char> actor_token_path_;
+ UniquePtr<char> actor_token_type_;
+ OrphanablePtr<HttpRequest> http_request_;
};
} // namespace
@@ -663,10 +654,9 @@ absl::StatusOr<URI> ValidateStsCredentialsOptions(
? ""
: options->token_exchange_service_uri);
if (!sts_url.ok()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrFormat("Invalid or missing STS endpoint URL. Error: %s",
- sts_url.status().ToString())
- .c_str()));
+ sts_url.status().ToString())));
} else if (sts_url->scheme() != "https" && sts_url->scheme() != "http") {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Invalid URI scheme, must be https to http."));
@@ -713,36 +703,25 @@ grpc_call_credentials* grpc_sts_credentials_create(
// Oauth2 Access Token credentials.
//
-grpc_access_token_credentials::~grpc_access_token_credentials() {
- GRPC_MDELEM_UNREF(access_token_md_);
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_access_token_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs*) {
+ initial_metadata->Append(
+ GRPC_AUTHORIZATION_METADATA_KEY, access_token_value_.Ref(),
+ [](absl::string_view, const grpc_core::Slice&) { abort(); });
+ return grpc_core::Immediate(std::move(initial_metadata));
}
-bool grpc_access_token_credentials::get_request_metadata(
- grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error_handle* /*error*/) {
- grpc_credentials_mdelem_array_add(md_array, access_token_md_);
- return true;
-}
-
-void grpc_access_token_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
- GRPC_ERROR_UNREF(error);
-}
+const char* grpc_access_token_credentials::Type() { return "AccessToken"; }
grpc_access_token_credentials::grpc_access_token_credentials(
const char* access_token)
- : grpc_call_credentials(GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) {
- grpc_core::ExecCtx exec_ctx;
- access_token_md_ = grpc_mdelem_from_slices(
- grpc_core::ExternallyManagedSlice(GRPC_AUTHORIZATION_METADATA_KEY),
- grpc_slice_from_cpp_string(absl::StrCat("Bearer ", access_token)));
-}
+ : access_token_value_(grpc_core::Slice::FromCopiedString(
+ absl::StrCat("Bearer ", access_token))) {}
std::string grpc_access_token_credentials::debug_string() {
- bool access_token_present = !GRPC_MDISNULL(access_token_md_);
- return absl::StrFormat("AccessTokenCredentials{Token:%s}",
- access_token_present ? "present" : "absent");
+ return absl::StrFormat("AccessTokenCredentials{Token:present}");
}
grpc_call_credentials* grpc_access_token_credentials_create(
diff --git a/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index f174112b..a9304586 100644
--- a/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -24,6 +24,9 @@
#include <string>
#include <grpc/grpc_security.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -57,49 +60,67 @@ grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
/// Destructs the object.
void grpc_auth_refresh_token_destruct(grpc_auth_refresh_token* refresh_token);
-// -- Oauth2 Token Fetcher credentials --
-//
-// This object is a base for credentials that need to acquire an oauth2 token
-// from an http service.
+// -- Credentials Metadata Request. --
+
+struct grpc_credentials_metadata_request {
+ explicit grpc_credentials_metadata_request(
+ grpc_core::RefCountedPtr<grpc_call_credentials> creds)
+ : creds(std::move(creds)) {}
+ ~grpc_credentials_metadata_request() {
+ grpc_http_response_destroy(&response);
+ }
+
+ grpc_core::RefCountedPtr<grpc_call_credentials> creds;
+ grpc_http_response response;
+};
-struct grpc_oauth2_pending_get_request_metadata {
- grpc_credentials_mdelem_array* md_array;
- grpc_closure* on_request_metadata;
+struct grpc_oauth2_pending_get_request_metadata
+ : public grpc_core::RefCounted<grpc_oauth2_pending_get_request_metadata> {
+ std::atomic<bool> done{false};
+ grpc_core::Waker waker;
grpc_polling_entity* pollent;
+ grpc_core::ClientMetadataHandle md;
struct grpc_oauth2_pending_get_request_metadata* next;
+ absl::StatusOr<grpc_core::ClientMetadataHandle> result;
};
+// -- Oauth2 Token Fetcher credentials --
+//
+// This object is a base for credentials that need to acquire an oauth2 token
+// from an http service.
+
class grpc_oauth2_token_fetcher_credentials : public grpc_call_credentials {
public:
grpc_oauth2_token_fetcher_credentials();
~grpc_oauth2_token_fetcher_credentials() override;
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
void on_http_response(grpc_credentials_metadata_request* r,
grpc_error_handle error);
std::string debug_string() override;
+ const char* type() const override;
+
protected:
virtual void fetch_oauth2(grpc_credentials_metadata_request* req,
- grpc_httpcli_context* httpcli_context,
grpc_polling_entity* pollent, grpc_iomgr_cb_func cb,
- grpc_millis deadline) = 0;
+ grpc_core::Timestamp deadline) = 0;
private:
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
+
gpr_mu mu_;
- grpc_mdelem access_token_md_ = GRPC_MDNULL;
+ absl::optional<grpc_core::Slice> access_token_value_;
gpr_timespec token_expiration_;
bool token_fetch_pending_ = false;
grpc_oauth2_pending_get_request_metadata* pending_requests_ = nullptr;
- grpc_httpcli_context httpcli_context_;
grpc_polling_entity pollent_;
};
@@ -117,36 +138,42 @@ class grpc_google_refresh_token_credentials final
std::string debug_string() override;
+ const char* type() const override;
+
protected:
void fetch_oauth2(grpc_credentials_metadata_request* req,
- grpc_httpcli_context* httpcli_context,
grpc_polling_entity* pollent, grpc_iomgr_cb_func cb,
- grpc_millis deadline) override;
+ grpc_core::Timestamp deadline) override;
private:
grpc_auth_refresh_token refresh_token_;
grpc_closure http_post_cb_closure_;
+ grpc_core::OrphanablePtr<grpc_core::HttpRequest> http_request_;
};
// Access token credentials.
class grpc_access_token_credentials final : public grpc_call_credentials {
public:
explicit grpc_access_token_credentials(const char* access_token);
- ~grpc_access_token_credentials() override;
-
- bool get_request_metadata(grpc_polling_entity* pollent,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
std::string debug_string() override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
- grpc_mdelem access_token_md_;
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
+
+ const grpc_core::Slice access_token_value_;
};
// Private constructor for refresh token credentials from an already parsed
@@ -158,8 +185,9 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
// Exposed for testing only.
grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response(
- const struct grpc_http_response* response, grpc_mdelem* token_md,
- grpc_millis* token_lifetime);
+ const struct grpc_http_response* response,
+ absl::optional<grpc_core::Slice>* token_value,
+ grpc_core::Duration* token_lifetime);
namespace grpc_core {
// Exposed for testing only. This function validates the options, ensuring that
diff --git a/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index 4c583ad3..28198133 100644
--- a/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -22,6 +22,8 @@
#include <string.h>
+#include <atomic>
+
#include "absl/strings/str_cat.h"
#include <grpc/grpc.h>
@@ -29,6 +31,9 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/security/credentials/plugin/plugin_credentials.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/api_trace.h"
@@ -37,7 +42,6 @@
grpc_core::TraceFlag grpc_plugin_credentials_trace(false, "plugin_credentials");
grpc_plugin_credentials::~grpc_plugin_credentials() {
- gpr_mu_destroy(&mu_);
if (plugin_.state != nullptr && plugin_.destroy != nullptr) {
plugin_.destroy(plugin_.state);
}
@@ -56,41 +60,15 @@ std::string grpc_plugin_credentials::debug_string() {
return debug_str;
}
-void grpc_plugin_credentials::pending_request_remove_locked(
- pending_request* pending_request) {
- if (pending_request->prev == nullptr) {
- pending_requests_ = pending_request->next;
- } else {
- pending_request->prev->next = pending_request->next;
- }
- if (pending_request->next != nullptr) {
- pending_request->next->prev = pending_request->prev;
- }
-}
-
-// Checks if the request has been cancelled.
-// If not, removes it from the pending list, so that it cannot be
-// cancelled out from under us.
-// When this returns, r->cancelled indicates whether the request was
-// cancelled before completion.
-void grpc_plugin_credentials::pending_request_complete(pending_request* r) {
- GPR_DEBUG_ASSERT(r->creds == this);
- gpr_mu_lock(&mu_);
- if (!r->cancelled) pending_request_remove_locked(r);
- gpr_mu_unlock(&mu_);
- // Ref to credentials not needed anymore.
- Unref();
-}
+const char* grpc_plugin_credentials::type() const { return "Plugin"; }
-static grpc_error_handle process_plugin_result(
- grpc_plugin_credentials::pending_request* r, const grpc_metadata* md,
- size_t num_md, grpc_status_code status, const char* error_details) {
- grpc_error_handle error = GRPC_ERROR_NONE;
+absl::StatusOr<grpc_core::ClientMetadataHandle>
+grpc_plugin_credentials::PendingRequest::ProcessPluginResult(
+ const grpc_metadata* md, size_t num_md, grpc_status_code status,
+ const char* error_details) {
if (status != GRPC_STATUS_OK) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Getting metadata from plugin failed with error: ",
- error_details)
- .c_str());
+ return absl::UnavailableError(absl::StrCat(
+ "Getting metadata from plugin failed with error: ", error_details));
} else {
bool seen_illegal_header = false;
for (size_t i = 0; i < num_md; ++i) {
@@ -108,156 +86,120 @@ static grpc_error_handle process_plugin_result(
}
}
if (seen_illegal_header) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal metadata");
+ return absl::UnavailableError("Illegal metadata");
} else {
+ absl::Status error;
for (size_t i = 0; i < num_md; ++i) {
- grpc_mdelem mdelem =
- grpc_mdelem_create(md[i].key, md[i].value, nullptr);
- grpc_credentials_mdelem_array_add(r->md_array, mdelem);
- GRPC_MDELEM_UNREF(mdelem);
+ md_->Append(
+ grpc_core::StringViewFromSlice(md[i].key),
+ grpc_core::Slice(grpc_slice_ref_internal(md[i].value)),
+ [&error](absl::string_view message, const grpc_core::Slice&) {
+ error = absl::UnavailableError(message);
+ });
}
+ if (!error.ok()) return std::move(error);
+ return grpc_core::ClientMetadataHandle(std::move(md_));
}
}
- return error;
}
-static void plugin_md_request_metadata_ready(void* request,
- const grpc_metadata* md,
- size_t num_md,
- grpc_status_code status,
- const char* error_details) {
+grpc_core::Poll<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_plugin_credentials::PendingRequest::PollAsyncResult() {
+ if (!ready_.load(std::memory_order_acquire)) {
+ return grpc_core::Pending{};
+ }
+ return ProcessPluginResult(metadata_.data(), metadata_.size(), status_,
+ error_details_.c_str());
+}
+
+void grpc_plugin_credentials::PendingRequest::RequestMetadataReady(
+ void* request, const grpc_metadata* md, size_t num_md,
+ grpc_status_code status, const char* error_details) {
/* called from application code */
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_FINISHED |
GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP);
- grpc_plugin_credentials::pending_request* r =
- static_cast<grpc_plugin_credentials::pending_request*>(request);
+ grpc_core::RefCountedPtr<grpc_plugin_credentials::PendingRequest> r(
+ static_cast<grpc_plugin_credentials::PendingRequest*>(request));
if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
gpr_log(GPR_INFO,
"plugin_credentials[%p]: request %p: plugin returned "
"asynchronously",
- r->creds, r);
+ r->creds(), r.get());
}
- // Remove request from pending list if not previously cancelled.
- r->creds->pending_request_complete(r);
- // If it has not been cancelled, process it.
- if (!r->cancelled) {
- grpc_error_handle error =
- process_plugin_result(r, md, num_md, status, error_details);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_request_metadata, error);
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO,
- "plugin_credentials[%p]: request %p: plugin was previously "
- "cancelled",
- r->creds, r);
+ for (size_t i = 0; i < num_md; ++i) {
+ grpc_metadata p;
+ p.key = grpc_slice_ref_internal(md[i].key);
+ p.value = grpc_slice_ref_internal(md[i].value);
+ r->metadata_.push_back(p);
}
- gpr_free(r);
+ r->error_details_ = error_details == nullptr ? "" : error_details;
+ r->status_ = status;
+ r->ready_.store(true, std::memory_order_release);
+ r->waker_.Wakeup();
}
-bool grpc_plugin_credentials::get_request_metadata(
- grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error_handle* error) {
- bool retval = true; // Synchronous return.
- if (plugin_.get_metadata != nullptr) {
- // Create pending_request object.
- pending_request* request =
- static_cast<pending_request*>(gpr_zalloc(sizeof(*request)));
- request->creds = this;
- request->md_array = md_array;
- request->on_request_metadata = on_request_metadata;
- // Add it to the pending list.
- gpr_mu_lock(&mu_);
- if (pending_requests_ != nullptr) {
- pending_requests_->prev = request;
- }
- request->next = pending_requests_;
- pending_requests_ = request;
- gpr_mu_unlock(&mu_);
- // Invoke the plugin. The callback holds a ref to us.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: invoking plugin",
- this, request);
- }
- Ref().release();
- grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX];
- size_t num_creds_md = 0;
- grpc_status_code status = GRPC_STATUS_OK;
- const char* error_details = nullptr;
- if (!plugin_.get_metadata(
- plugin_.state, context, plugin_md_request_metadata_ready, request,
- creds_md, &num_creds_md, &status, &error_details)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO,
- "plugin_credentials[%p]: request %p: plugin will return "
- "asynchronously",
- this, request);
- }
- return false; // Asynchronous return.
- }
- // Returned synchronously.
- // Remove request from pending list if not previously cancelled.
- request->creds->pending_request_complete(request);
- // If the request was cancelled, the error will have been returned
- // asynchronously by plugin_cancel_get_request_metadata(), so return
- // false. Otherwise, process the result.
- if (request->cancelled) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO,
- "plugin_credentials[%p]: request %p was cancelled, error "
- "will be returned asynchronously",
- this, request);
- }
- retval = false;
- } else {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO,
- "plugin_credentials[%p]: request %p: plugin returned "
- "synchronously",
- this, request);
- }
- *error = process_plugin_result(request, creds_md, num_creds_md, status,
- error_details);
- }
- // Clean up.
- for (size_t i = 0; i < num_creds_md; ++i) {
- grpc_slice_unref_internal(creds_md[i].key);
- grpc_slice_unref_internal(creds_md[i].value);
- }
- gpr_free(const_cast<char*>(error_details));
- gpr_free(request);
+grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+grpc_plugin_credentials::GetRequestMetadata(
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args) {
+ if (plugin_.get_metadata == nullptr) {
+ return grpc_core::Immediate(std::move(initial_metadata));
}
- return retval;
-}
-void grpc_plugin_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
- gpr_mu_lock(&mu_);
- for (pending_request* pending_request = pending_requests_;
- pending_request != nullptr; pending_request = pending_request->next) {
- if (pending_request->md_array == md_array) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
- gpr_log(GPR_INFO, "plugin_credentials[%p]: cancelling request %p", this,
- pending_request);
- }
- pending_request->cancelled = true;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION,
- pending_request->on_request_metadata,
- GRPC_ERROR_REF(error));
- pending_request_remove_locked(pending_request);
- break;
+ // Create pending_request object.
+ auto request = grpc_core::MakeRefCounted<PendingRequest>(
+ Ref(), std::move(initial_metadata), args);
+ // Invoke the plugin. The callback holds a ref to us.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
+ gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: invoking plugin",
+ this, request.get());
+ }
+ grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX];
+ size_t num_creds_md = 0;
+ grpc_status_code status = GRPC_STATUS_OK;
+ const char* error_details = nullptr;
+ // Add an extra ref to the request object for the async callback.
+ // If the request completes synchronously, we'll drop this later.
+ // If the request completes asynchronously, it will own a ref to the request
+ // object (which we release from our ownership below).
+ auto child_request = request->Ref();
+ if (!plugin_.get_metadata(plugin_.state, request->context(),
+ PendingRequest::RequestMetadataReady,
+ child_request.get(), creds_md, &num_creds_md,
+ &status, &error_details)) {
+ child_request.release();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
+ gpr_log(GPR_INFO,
+ "plugin_credentials[%p]: request %p: plugin will return "
+ "asynchronously",
+ this, request.get());
}
+ return [request] { return request->PollAsyncResult(); };
+ }
+ // Synchronous return.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
+ gpr_log(GPR_INFO,
+ "plugin_credentials[%p]: request %p: plugin returned "
+ "synchronously",
+ this, request.get());
+ }
+ auto result = request->ProcessPluginResult(creds_md, num_creds_md, status,
+ error_details);
+ // Clean up.
+ for (size_t i = 0; i < num_creds_md; ++i) {
+ grpc_slice_unref_internal(creds_md[i].key);
+ grpc_slice_unref_internal(creds_md[i].value);
}
- gpr_mu_unlock(&mu_);
- GRPC_ERROR_UNREF(error);
+ gpr_free(const_cast<char*>(error_details));
+
+ return grpc_core::Immediate(std::move(result));
}
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) {
- gpr_mu_init(&mu_);
-}
+ : grpc_call_credentials(min_security_level), plugin_(plugin) {}
grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
grpc_metadata_credentials_plugin plugin,
diff --git a/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h b/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
index 68351868..4be8a56f 100644
--- a/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
+++ b/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/credentials/call_creds_util.h"
#include "src/core/lib/security/credentials/credentials.h"
extern grpc_core::TraceFlag grpc_plugin_credentials_trace;
@@ -30,43 +31,71 @@ extern grpc_core::TraceFlag grpc_plugin_credentials_trace;
// -Wmismatched-tags.
struct grpc_plugin_credentials final : public grpc_call_credentials {
public:
- struct pending_request {
- bool cancelled;
- struct grpc_plugin_credentials* creds;
- grpc_credentials_mdelem_array* md_array;
- grpc_closure* on_request_metadata;
- struct pending_request* prev;
- struct pending_request* next;
- };
-
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,
- grpc_auth_metadata_context context,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* on_request_metadata,
- grpc_error_handle* error) override;
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error_handle error) override;
-
- // Checks if the request has been cancelled.
- // If not, removes it from the pending list, so that it cannot be
- // cancelled out from under us.
- // When this returns, r->cancelled indicates whether the request was
- // cancelled before completion.
- void pending_request_complete(pending_request* r);
+ grpc_core::ArenaPromise<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ GetRequestMetadata(grpc_core::ClientMetadataHandle initial_metadata,
+ const GetRequestMetadataArgs* args) override;
std::string debug_string() override;
+ const char* type() const override;
+
private:
- void pending_request_remove_locked(pending_request* pending_request);
+ class PendingRequest : public grpc_core::RefCounted<PendingRequest> {
+ public:
+ PendingRequest(grpc_core::RefCountedPtr<grpc_plugin_credentials> creds,
+ grpc_core::ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs* args)
+ : call_creds_(std::move(creds)),
+ context_(
+ grpc_core::MakePluginAuthMetadataContext(initial_metadata, args)),
+ md_(std::move(initial_metadata)) {}
+
+ ~PendingRequest() override {
+ grpc_auth_metadata_context_reset(&context_);
+ for (size_t i = 0; i < metadata_.size(); i++) {
+ grpc_slice_unref_internal(metadata_[i].key);
+ grpc_slice_unref_internal(metadata_[i].value);
+ }
+ }
+
+ absl::StatusOr<grpc_core::ClientMetadataHandle> ProcessPluginResult(
+ const grpc_metadata* md, size_t num_md, grpc_status_code status,
+ const char* error_details);
+
+ grpc_core::Poll<absl::StatusOr<grpc_core::ClientMetadataHandle>>
+ PollAsyncResult();
+
+ static void RequestMetadataReady(void* request, const grpc_metadata* md,
+ size_t num_md, grpc_status_code status,
+ const char* error_details);
+
+ grpc_auth_metadata_context context() const { return context_; }
+ grpc_plugin_credentials* creds() const { return call_creds_.get(); }
+
+ private:
+ std::atomic<bool> ready_{false};
+ grpc_core::Waker waker_{
+ grpc_core::Activity::current()->MakeNonOwningWaker()};
+ grpc_core::RefCountedPtr<grpc_plugin_credentials> call_creds_;
+ grpc_auth_metadata_context context_;
+ grpc_core::ClientMetadataHandle md_;
+ // final status
+ absl::InlinedVector<grpc_metadata, 2> metadata_;
+ std::string error_details_;
+ grpc_status_code status_;
+ };
+
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_call_credentials*>(this), other);
+ }
grpc_metadata_credentials_plugin plugin_;
- gpr_mu mu_;
- pending_request* pending_requests_ = nullptr;
};
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H */
diff --git a/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 469eb0cf..49b1b262 100644
--- a/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -22,32 +22,22 @@
#include <string.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/tsi/ssl_transport_security.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/ssl_utils.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/tsi/ssl_transport_security.h"
+
//
// SSL Channel Credentials.
//
-void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
- size_t num_key_cert_pairs) {
- if (kp == nullptr) return;
- for (size_t i = 0; i < num_key_cert_pairs; i++) {
- gpr_free(const_cast<char*>(kp[i].private_key));
- gpr_free(const_cast<char*>(kp[i].cert_chain));
- }
- gpr_free(kp);
-}
-
grpc_ssl_credentials::grpc_ssl_credentials(
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
- const grpc_ssl_verify_peer_options* verify_options)
- : grpc_channel_credentials(GRPC_CHANNEL_CREDENTIALS_TYPE_SSL) {
+ const grpc_ssl_verify_peer_options* verify_options) {
build_config(pem_root_certs, pem_key_cert_pair, verify_options);
}
@@ -92,6 +82,8 @@ grpc_ssl_credentials::create_security_connector(
return sc;
}
+const char* grpc_ssl_credentials::Type() { return "Ssl"; }
+
void grpc_ssl_credentials::build_config(
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
const grpc_ssl_verify_peer_options* verify_options) {
@@ -171,8 +163,7 @@ struct grpc_ssl_server_credentials_options {
};
grpc_ssl_server_credentials::grpc_ssl_server_credentials(
- const grpc_ssl_server_credentials_options& options)
- : grpc_server_credentials(GRPC_CHANNEL_CREDENTIALS_TYPE_SSL) {
+ const grpc_ssl_server_credentials_options& options) {
if (options.certificate_config_fetcher != nullptr) {
config_.client_certificate_request = options.client_certificate_request;
certificate_config_fetcher_ = *options.certificate_config_fetcher;
@@ -195,6 +186,8 @@ grpc_ssl_server_credentials::create_security_connector(
return grpc_ssl_server_security_connector_create(this->Ref());
}
+const char* grpc_ssl_server_credentials::Type() { return "Ssl"; }
+
tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
size_t num_key_cert_pairs) {
diff --git a/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h b/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
index 0491eea7..0fe700d1 100644
--- a/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
+++ b/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
@@ -21,7 +21,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/security/credentials/credentials.h"
-
#include "src/core/lib/security/security_connector/ssl/ssl_security_connector.h"
class grpc_ssl_credentials : public grpc_channel_credentials {
@@ -38,12 +37,22 @@ class grpc_ssl_credentials : public grpc_channel_credentials {
const char* target, const grpc_channel_args* args,
grpc_channel_args** new_args) override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
// 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:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+ }
+
void build_config(const char* pem_root_certs,
grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
const grpc_ssl_verify_peer_options* verify_options);
@@ -71,6 +80,10 @@ class grpc_ssl_server_credentials final : public grpc_server_credentials {
grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* /* args */) override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
bool has_cert_config_fetcher() const {
return certificate_config_fetcher_.cb != nullptr;
}
@@ -103,7 +116,4 @@ tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
size_t num_key_cert_pairs);
-void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
- size_t num_key_cert_pairs);
-
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H */
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
index e831aa5c..5fa17199 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
@@ -18,11 +18,12 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+#include <stdlib.h>
+#include <string.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 std::string& cert_name, absl::optional<std::string> pem_root_certs,
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
index 36c46bef..b0bc58ca 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
@@ -19,12 +19,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
-
#include <utility>
#include "absl/container/inlined_vector.h"
#include "absl/types/optional.h"
+
+#include <grpc/grpc_security.h>
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
@@ -125,7 +126,7 @@ struct grpc_tls_certificate_distributor
// are being watched.
void SetWatchStatusCallback(
std::function<void(std::string, bool, bool)> callback) {
- grpc_core::MutexLock lock(&mu_);
+ grpc_core::MutexLock lock(&callback_mu_);
watch_status_callback_ = std::move(callback);
};
@@ -201,13 +202,16 @@ struct grpc_tls_certificate_distributor
// functions.
grpc_core::Mutex callback_mu_;
// Stores information about each watcher.
- std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_;
+ std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_
+ ABSL_GUARDED_BY(mu_);
// The callback to notify the caller, e.g. the Producer, that the watch status
// is changed.
- std::function<void(std::string, bool, bool)> watch_status_callback_;
+ std::function<void(std::string, bool, bool)> watch_status_callback_
+ ABSL_GUARDED_BY(callback_mu_);
// Stores the names of each certificate, and their corresponding credential
// contents as well as some additional watcher information.
- std::map<std::string, CertificateInfo> certificate_info_map_;
+ std::map<std::string, CertificateInfo> certificate_info_map_
+ ABSL_GUARDED_BY(mu_);
};
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
index b4b6bf55..9ee71806 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include <openssl/ssl.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -29,17 +31,16 @@
namespace grpc_core {
StaticDataCertificateProvider::StaticDataCertificateProvider(
- std::string root_certificate,
- grpc_core::PemKeyCertPairList pem_key_cert_pairs)
+ std::string root_certificate, PemKeyCertPairList pem_key_cert_pairs)
: distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()),
root_certificate_(std::move(root_certificate)),
pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) {
distributor_->SetWatchStatusCallback([this](std::string cert_name,
bool root_being_watched,
bool identity_being_watched) {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
absl::optional<std::string> root_certificate;
- absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched &&
!root_certificate_.empty()) {
@@ -121,15 +122,15 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
provider->ForceUpdate();
}
};
- refresh_thread_ = grpc_core::Thread(
- "FileWatcherCertificateProvider_refreshing_thread", thread_lambda, this);
+ refresh_thread_ = Thread("FileWatcherCertificateProvider_refreshing_thread",
+ thread_lambda, this);
refresh_thread_.Start();
distributor_->SetWatchStatusCallback([this](std::string cert_name,
bool root_being_watched,
bool identity_being_watched) {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
absl::optional<std::string> root_certificate;
- absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
FileWatcherCertificateProvider::WatcherInfo& info =
watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched &&
@@ -178,7 +179,7 @@ FileWatcherCertificateProvider::~FileWatcherCertificateProvider() {
void FileWatcherCertificateProvider::ForceUpdate() {
absl::optional<std::string> root_certificate;
- absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
if (!root_cert_path_.empty()) {
root_certificate = ReadRootCertificatesFromFile(root_cert_path_);
}
@@ -186,7 +187,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
pem_key_cert_pairs = ReadIdentityKeyCertPairFromFiles(
private_key_path_, identity_certificate_path_);
}
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
const bool root_cert_changed =
(!root_certificate.has_value() && !root_certificate_.empty()) ||
(root_certificate.has_value() && root_certificate_ != *root_certificate);
@@ -219,7 +220,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
const std::string& cert_name = p.first;
const WatcherInfo& info = p.second;
absl::optional<std::string> root_to_report;
- absl::optional<grpc_core::PemKeyCertPairList> identity_to_report;
+ absl::optional<PemKeyCertPairList> identity_to_report;
// Set key materials to the distributor if their contents changed.
if (info.root_being_watched && !root_certificate_.empty() &&
root_cert_changed) {
@@ -277,7 +278,7 @@ namespace {
// it logs the error and returns 0.
time_t GetModificationTime(const char* filename) {
time_t ts = 0;
- absl::Status status = grpc_core::GetFileModificationTime(filename, &ts);
+ absl::Status status = GetFileModificationTime(filename, &ts);
return ts;
}
@@ -364,6 +365,54 @@ FileWatcherCertificateProvider::ReadIdentityKeyCertPairFromFiles(
return absl::nullopt;
}
+absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
+ absl::string_view private_key, absl::string_view cert_chain) {
+ if (private_key.empty()) {
+ return absl::InvalidArgumentError("Private key string is empty.");
+ }
+ if (cert_chain.empty()) {
+ return absl::InvalidArgumentError("Certificate string is empty.");
+ }
+ BIO* cert_bio = BIO_new_mem_buf(cert_chain.data(), cert_chain.size());
+ if (cert_bio == nullptr) {
+ return absl::InvalidArgumentError(
+ "Conversion from certificate string to BIO failed.");
+ }
+ // Reads the first cert from the cert_chain which is expected to be the leaf
+ // cert
+ X509* x509 = PEM_read_bio_X509(cert_bio, nullptr, nullptr, nullptr);
+ BIO_free(cert_bio);
+ if (x509 == nullptr) {
+ return absl::InvalidArgumentError(
+ "Conversion from PEM string to X509 failed.");
+ }
+ EVP_PKEY* public_evp_pkey = X509_get_pubkey(x509);
+ X509_free(x509);
+ if (public_evp_pkey == nullptr) {
+ return absl::InvalidArgumentError(
+ "Extraction of public key from x.509 certificate failed.");
+ }
+ BIO* private_key_bio =
+ BIO_new_mem_buf(private_key.data(), private_key.size());
+ if (private_key_bio == nullptr) {
+ EVP_PKEY_free(public_evp_pkey);
+ return absl::InvalidArgumentError(
+ "Conversion from private key string to BIO failed.");
+ }
+ EVP_PKEY* private_evp_pkey =
+ PEM_read_bio_PrivateKey(private_key_bio, nullptr, nullptr, nullptr);
+ BIO_free(private_key_bio);
+ if (private_evp_pkey == nullptr) {
+ EVP_PKEY_free(public_evp_pkey);
+ return absl::InvalidArgumentError(
+ "Conversion from PEM string to EVP_PKEY failed.");
+ }
+ bool result = EVP_PKEY_cmp(private_evp_pkey, public_evp_pkey) == 1;
+ EVP_PKEY_free(private_evp_pkey);
+ EVP_PKEY_free(public_evp_pkey);
+ return result;
+}
+
} // namespace grpc_core
/** -- Wrapper APIs declared in grpc_security.h -- **/
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
index 414718d2..293a55e2 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
@@ -19,11 +19,14 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
#include <string.h>
#include "absl/container/inlined_vector.h"
+#include "absl/status/statusor.h"
+
+#include <grpc/grpc_security.h>
+#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/thd.h"
@@ -48,6 +51,36 @@ struct grpc_tls_certificate_provider
virtual grpc_core::RefCountedPtr<grpc_tls_certificate_distributor>
distributor() const = 0;
+
+ // Compares this grpc_tls_certificate_provider object with \a other.
+ // If this method returns 0, it means that gRPC can treat the two certificate
+ // providers as effectively the same. This method is used to compare
+ // `grpc_tls_certificate_provider` objects when they are present in
+ // channel_args. One important usage of this is when channel args are used in
+ // SubchannelKey, which leads to a useful property that allows subchannels to
+ // be reused when two different `grpc_tls_certificate_provider` objects are
+ // used but they compare as equal (assuming other channel args match).
+ int Compare(const grpc_tls_certificate_provider* other) const {
+ GPR_ASSERT(other != nullptr);
+ // Intentionally uses grpc_core::QsortCompare instead of strcmp as a safety
+ // against different grpc_tls_certificate_provider types using the same
+ // name.
+ int r = grpc_core::QsortCompare(type(), other->type());
+ if (r != 0) return r;
+ return CompareImpl(other);
+ }
+
+ // The pointer value \a type is used to uniquely identify a creds
+ // implementation for down-casting purposes. Every provider implementation
+ // should use a unique string instance, which should be returned by all
+ // instances of that provider implementation.
+ virtual const char* type() const = 0;
+
+ private:
+ // Implementation for `Compare` method intended to be overridden by
+ // subclasses. Only invoked if `type()` and `other->type()` point to the same
+ // string.
+ virtual int CompareImpl(const grpc_tls_certificate_provider* other) const = 0;
};
namespace grpc_core {
@@ -57,9 +90,8 @@ namespace grpc_core {
class StaticDataCertificateProvider final
: public grpc_tls_certificate_provider {
public:
- StaticDataCertificateProvider(
- std::string root_certificate,
- grpc_core::PemKeyCertPairList pem_key_cert_pairs);
+ StaticDataCertificateProvider(std::string root_certificate,
+ PemKeyCertPairList pem_key_cert_pairs);
~StaticDataCertificateProvider() override;
@@ -67,16 +99,25 @@ class StaticDataCertificateProvider final
return distributor_;
}
+ const char* type() const override { return "StaticData"; }
+
private:
struct WatcherInfo {
bool root_being_watched = false;
bool identity_being_watched = false;
};
+
+ int CompareImpl(const grpc_tls_certificate_provider* other) const override {
+ // TODO(yashykt): Maybe do something better here.
+ return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
+ other);
+ }
+
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
std::string root_certificate_;
- grpc_core::PemKeyCertPairList pem_key_cert_pairs_;
+ PemKeyCertPairList pem_key_cert_pairs_;
// Guards members below.
- grpc_core::Mutex mu_;
+ Mutex mu_;
// Stores each cert_name we get from the distributor callback and its watcher
// information.
std::map<std::string, WatcherInfo> watcher_info_;
@@ -97,17 +138,27 @@ class FileWatcherCertificateProvider final
return distributor_;
}
+ const char* type() const override { return "FileWatcher"; }
+
private:
struct WatcherInfo {
bool root_being_watched = false;
bool identity_being_watched = false;
};
+
+ int CompareImpl(const grpc_tls_certificate_provider* other) const override {
+ // TODO(yashykt): Maybe do something better here.
+ return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
+ other);
+ }
+
// Force an update from the file system regardless of the interval.
void ForceUpdate();
// Read the root certificates from files and update the distributor.
absl::optional<std::string> ReadRootCertificatesFromFile(
const std::string& root_cert_full_path);
- // Read the root certificates from files and update the distributor.
+ // Read the private key and the certificate chain from files and update the
+ // distributor.
absl::optional<PemKeyCertPairList> ReadIdentityKeyCertPairFromFiles(
const std::string& private_key_path,
const std::string& identity_certificate_path);
@@ -119,20 +170,26 @@ class FileWatcherCertificateProvider final
unsigned int refresh_interval_sec_ = 0;
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
- grpc_core::Thread refresh_thread_;
+ Thread refresh_thread_;
gpr_event shutdown_event_;
// Guards members below.
- grpc_core::Mutex mu_;
+ Mutex mu_;
// The most-recent credential data. It will be empty if the most recent read
// attempt failed.
- std::string root_certificate_;
- grpc_core::PemKeyCertPairList pem_key_cert_pairs_;
+ std::string root_certificate_ ABSL_GUARDED_BY(mu_);
+ PemKeyCertPairList pem_key_cert_pairs_ ABSL_GUARDED_BY(mu_);
// Stores each cert_name we get from the distributor callback and its watcher
// information.
- std::map<std::string, WatcherInfo> watcher_info_;
+ std::map<std::string, WatcherInfo> watcher_info_ ABSL_GUARDED_BY(mu_);
};
+// Checks if the private key matches the certificate's public key.
+// Returns a not-OK status on failure, or a bool indicating
+// whether the key/cert pair matches.
+absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
+ absl::string_view private_key, absl::string_view cert_chain);
+
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_PROVIDER_H
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc
new file mode 100644
index 00000000..9bf92c6c
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc
@@ -0,0 +1,209 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_verifier.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/gprpp/stat.h"
+#include "src/core/lib/security/credentials/tls/tls_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/api_trace.h"
+
+namespace grpc_core {
+
+//
+// ExternalCertificateVerifier
+//
+
+bool ExternalCertificateVerifier::Verify(
+ grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)> callback, absl::Status* sync_status) {
+ {
+ MutexLock lock(&mu_);
+ request_map_.emplace(request, std::move(callback));
+ }
+ // Invoke the caller-specified verification logic embedded in
+ // external_verifier_.
+ grpc_status_code status_code = GRPC_STATUS_OK;
+ char* error_details = nullptr;
+ bool is_done = external_verifier_->verify(external_verifier_->user_data,
+ request, &OnVerifyDone, this,
+ &status_code, &error_details);
+ if (is_done) {
+ if (status_code != GRPC_STATUS_OK) {
+ *sync_status = absl::Status(static_cast<absl::StatusCode>(status_code),
+ error_details);
+ }
+ MutexLock lock(&mu_);
+ request_map_.erase(request);
+ }
+ gpr_free(error_details);
+ return is_done;
+}
+
+void ExternalCertificateVerifier::OnVerifyDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details) {
+ ExecCtx exec_ctx;
+ auto* self = static_cast<ExternalCertificateVerifier*>(callback_arg);
+ std::function<void(absl::Status)> callback;
+ {
+ MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = std::move(it->second);
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ absl::Status return_status = absl::OkStatus();
+ if (status != GRPC_STATUS_OK) {
+ return_status =
+ absl::Status(static_cast<absl::StatusCode>(status), error_details);
+ }
+ callback(return_status);
+ }
+}
+
+//
+// HostNameCertificateVerifier
+//
+
+bool HostNameCertificateVerifier::Verify(
+ grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)>, absl::Status* sync_status) {
+ GPR_ASSERT(request != nullptr);
+ // Extract the target name, and remove its port.
+ const char* target_name = request->target_name;
+ if (target_name == nullptr) {
+ *sync_status = absl::Status(absl::StatusCode::kUnauthenticated,
+ "Target name is not specified.");
+ return true; // synchronous check
+ }
+ absl::string_view target_host;
+ absl::string_view ignored_port;
+ SplitHostPort(target_name, &target_host, &ignored_port);
+ if (target_host.empty()) {
+ *sync_status = absl::Status(absl::StatusCode::kUnauthenticated,
+ "Failed to split hostname and port.");
+ return true; // synchronous check
+ }
+ // IPv6 zone-id should not be included in comparisons.
+ const size_t zone_id = target_host.find('%');
+ if (zone_id != absl::string_view::npos) {
+ target_host.remove_suffix(target_host.size() - zone_id);
+ }
+ // Perform the hostname check.
+ // First check the DNS field. We allow prefix or suffix wildcard matching.
+ char** dns_names = request->peer_info.san_names.dns_names;
+ size_t dns_names_size = request->peer_info.san_names.dns_names_size;
+ if (dns_names != nullptr && dns_names_size > 0) {
+ for (size_t i = 0; i < dns_names_size; ++i) {
+ const char* dns_name = dns_names[i];
+ // We are using the target name sent from the client as a matcher to match
+ // against identity name on the peer cert.
+ if (VerifySubjectAlternativeName(dns_name, std::string(target_host))) {
+ return true; // synchronous check
+ }
+ }
+ }
+ // Then check the IP address. We only allow exact matching.
+ char** ip_names = request->peer_info.san_names.ip_names;
+ size_t ip_names_size = request->peer_info.san_names.ip_names_size;
+ if (ip_names != nullptr && ip_names_size > 0) {
+ for (size_t i = 0; i < ip_names_size; ++i) {
+ const char* ip_name = ip_names[i];
+ if (target_host == ip_name) {
+ return true; // synchronous check
+ }
+ }
+ }
+ // If there's no SAN, try the CN.
+ if (dns_names_size == 0) {
+ const char* common_name = request->peer_info.common_name;
+ // We are using the target name sent from the client as a matcher to match
+ // against identity name on the peer cert.
+ if (VerifySubjectAlternativeName(common_name, std::string(target_host))) {
+ return true; // synchronous check
+ }
+ }
+ *sync_status = absl::Status(absl::StatusCode::kUnauthenticated,
+ "Hostname Verification Check failed.");
+ return true; // synchronous check
+}
+
+} // namespace grpc_core
+
+//
+// Wrapper APIs declared in grpc_security.h
+//
+
+int grpc_tls_certificate_verifier_verify(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details) {
+ grpc_core::ExecCtx exec_ctx;
+ std::function<void(absl::Status)> async_cb =
+ [callback, request, callback_arg](absl::Status async_status) {
+ callback(request, callback_arg,
+ static_cast<grpc_status_code>(async_status.code()),
+ std::string(async_status.message()).c_str());
+ };
+ absl::Status sync_status_cpp;
+ bool is_done = verifier->Verify(request, async_cb, &sync_status_cpp);
+ if (is_done) {
+ if (!sync_status_cpp.ok()) {
+ *sync_status = static_cast<grpc_status_code>(sync_status_cpp.code());
+ *sync_error_details =
+ gpr_strdup(std::string(sync_status_cpp.message()).c_str());
+ }
+ }
+ return is_done;
+}
+
+void grpc_tls_certificate_verifier_cancel(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request) {
+ grpc_core::ExecCtx exec_ctx;
+ verifier->Cancel(request);
+}
+
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier) {
+ grpc_core::ExecCtx exec_ctx;
+ return new grpc_core::ExternalCertificateVerifier(external_verifier);
+}
+
+grpc_tls_certificate_verifier*
+grpc_tls_certificate_verifier_host_name_create() {
+ grpc_core::ExecCtx exec_ctx;
+ return new grpc_core::HostNameCertificateVerifier();
+}
+
+void grpc_tls_certificate_verifier_release(
+ grpc_tls_certificate_verifier* verifier) {
+ GRPC_API_TRACE("grpc_tls_certificate_verifier_release(verifier=%p)", 1,
+ (verifier));
+ grpc_core::ExecCtx exec_ctx;
+ if (verifier != nullptr) verifier->Unref();
+}
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h
new file mode 100644
index 00000000..a7e1df5e
--- /dev/null
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h
@@ -0,0 +1,145 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_VERIFIER_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_VERIFIER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string.h>
+
+#include "absl/status/status.h"
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
+
+// An abstraction of the verifier that all verifier subclasses should extend.
+struct grpc_tls_certificate_verifier
+ : public grpc_core::RefCounted<grpc_tls_certificate_verifier> {
+ public:
+ ~grpc_tls_certificate_verifier() override = default;
+ // Verifies the specific request. It can be processed in sync or async mode.
+ // If the caller want it to be processed asynchronously, return false
+ // immediately, and at the end of the async operation, invoke the callback
+ // with the verification results stored in absl::Status. Otherwise, populate
+ // the verification results in |sync_status| and return true. The caller is
+ // expected to populate verification results by setting request.
+ virtual bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)> callback,
+ absl::Status* sync_status) = 0;
+ // Operations that will be performed when a request is cancelled.
+ // This is only needed when in async mode.
+ virtual void Cancel(grpc_tls_custom_verification_check_request* request) = 0;
+
+ // Compares this grpc_tls_certificate_verifier object with \a other.
+ // If this method returns 0, it means that gRPC can treat the two certificate
+ // verifiers as effectively the same.
+ int Compare(const grpc_tls_certificate_verifier* other) const {
+ GPR_ASSERT(other != nullptr);
+ int r = grpc_core::QsortCompare(type(), other->type());
+ if (r != 0) return r;
+ return CompareImpl(other);
+ }
+
+ // The pointer value \a type is used to uniquely identify a verifier
+ // implementation for down-casting purposes. Every verifier implementation
+ // should use a unique string instance, which should be returned by all
+ // instances of that verifier implementation.
+ virtual const char* type() const = 0;
+
+ private:
+ // Implementation for `Compare` method intended to be overridden by
+ // subclasses. Only invoked if `type()` and `other->type()` point to the same
+ // string.
+ virtual int CompareImpl(const grpc_tls_certificate_verifier* other) const = 0;
+};
+
+namespace grpc_core {
+
+// A verifier that will transform grpc_tls_certificate_verifier_external to a
+// verifier that extends grpc_tls_certificate_verifier.
+class ExternalCertificateVerifier : public grpc_tls_certificate_verifier {
+ public:
+ explicit ExternalCertificateVerifier(
+ grpc_tls_certificate_verifier_external* external_verifier)
+ : external_verifier_(external_verifier) {}
+
+ ~ExternalCertificateVerifier() override {
+ if (external_verifier_->destruct != nullptr) {
+ external_verifier_->destruct(external_verifier_->user_data);
+ }
+ }
+
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)> callback,
+ absl::Status* sync_status) override;
+
+ void Cancel(grpc_tls_custom_verification_check_request* request) override {
+ external_verifier_->cancel(external_verifier_->user_data, request);
+ }
+
+ const char* type() const override { return "External"; }
+
+ private:
+ int CompareImpl(const grpc_tls_certificate_verifier* other) const override {
+ const auto* o = static_cast<const ExternalCertificateVerifier*>(other);
+ return QsortCompare(external_verifier_, o->external_verifier_);
+ }
+
+ static void OnVerifyDone(grpc_tls_custom_verification_check_request* request,
+ void* callback_arg, grpc_status_code status,
+ const char* error_details);
+
+ grpc_tls_certificate_verifier_external* external_verifier_;
+
+ // Guards members below.
+ Mutex mu_;
+ // stores each check request and its corresponding callback function.
+ std::map<grpc_tls_custom_verification_check_request*,
+ std::function<void(absl::Status)>>
+ request_map_ ABSL_GUARDED_BY(mu_);
+};
+
+// An internal verifier that will perform hostname verification check.
+class HostNameCertificateVerifier : public grpc_tls_certificate_verifier {
+ public:
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)> callback,
+ absl::Status* sync_status) override;
+ void Cancel(grpc_tls_custom_verification_check_request*) override {}
+
+ const char* type() const override { return "Hostname"; }
+
+ private:
+ int CompareImpl(
+ const grpc_tls_certificate_verifier* /* other */) const override {
+ // No differentiating factor between different HostNameCertificateVerifier
+ // objects.
+ return 0;
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_VERIFIER_H
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc b/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
index bf26e707..6adafa40 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
@@ -29,61 +29,6 @@
#include "src/core/lib/surface/api_trace.h"
-/** -- gRPC TLS server authorization check API implementation. -- **/
-grpc_tls_server_authorization_check_config::
- grpc_tls_server_authorization_check_config(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data))
- : config_user_data_(const_cast<void*>(config_user_data)),
- schedule_(schedule),
- cancel_(cancel),
- destruct_(destruct) {}
-
-grpc_tls_server_authorization_check_config::
- ~grpc_tls_server_authorization_check_config() {
- if (destruct_ != nullptr) {
- destruct_(config_user_data_);
- }
-}
-
-int grpc_tls_server_authorization_check_config::Schedule(
- grpc_tls_server_authorization_check_arg* arg) const {
- if (schedule_ == nullptr) {
- gpr_log(GPR_ERROR, "schedule API is nullptr");
- if (arg != nullptr) {
- arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
- "schedule API in server authorization check config is nullptr");
- }
- return 1;
- }
- if (arg != nullptr && context_ != nullptr) {
- arg->config = const_cast<grpc_tls_server_authorization_check_config*>(this);
- }
- return schedule_(config_user_data_, arg);
-}
-
-void grpc_tls_server_authorization_check_config::Cancel(
- grpc_tls_server_authorization_check_arg* arg) const {
- if (cancel_ == nullptr) {
- gpr_log(GPR_ERROR, "cancel API is nullptr.");
- if (arg != nullptr) {
- arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
- "schedule API in server authorization check config is nullptr");
- }
- return;
- }
- if (arg != nullptr) {
- arg->config = const_cast<grpc_tls_server_authorization_check_config*>(this);
- }
- cancel_(config_user_data_, arg);
-}
-
/** -- Wrapper APIs declared in grpc_security.h -- **/
grpc_tls_credentials_options* grpc_tls_credentials_options_create() {
@@ -98,11 +43,10 @@ void grpc_tls_credentials_options_set_cert_request_type(
options->set_cert_request_type(type);
}
-void grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option) {
+void grpc_tls_credentials_options_set_verify_server_cert(
+ grpc_tls_credentials_options* options, int verify_server_cert) {
GPR_ASSERT(options != nullptr);
- options->set_server_verification_option(server_verification_option);
+ options->set_verify_server_cert(verify_server_cert);
}
void grpc_tls_credentials_options_set_certificate_provider(
@@ -139,39 +83,41 @@ void grpc_tls_credentials_options_set_identity_cert_name(
options->set_identity_cert_name(identity_cert_name);
}
-void grpc_tls_credentials_options_set_server_authorization_check_config(
+void grpc_tls_credentials_options_set_certificate_verifier(
grpc_tls_credentials_options* options,
- grpc_tls_server_authorization_check_config* config) {
+ grpc_tls_certificate_verifier* verifier) {
GPR_ASSERT(options != nullptr);
- GPR_ASSERT(config != nullptr);
- grpc_core::ExecCtx exec_ctx;
- options->set_server_authorization_check_config(config->Ref());
+ GPR_ASSERT(verifier != nullptr);
+ options->set_certificate_verifier(verifier->Ref());
}
-grpc_tls_server_authorization_check_config*
-grpc_tls_server_authorization_check_config_create(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data)) {
- if (schedule == nullptr) {
- gpr_log(GPR_ERROR,
- "Schedule API is nullptr in creating TLS server authorization "
- "check config.");
- return nullptr;
- }
- grpc_core::ExecCtx exec_ctx;
- return new grpc_tls_server_authorization_check_config(
- config_user_data, schedule, cancel, destruct);
+void grpc_tls_credentials_options_set_crl_directory(
+ grpc_tls_credentials_options* options, const char* crl_directory) {
+ GPR_ASSERT(options != nullptr);
+ options->set_crl_directory(crl_directory);
+}
+
+void grpc_tls_credentials_options_set_check_call_host(
+ grpc_tls_credentials_options* options, int check_call_host) {
+ GPR_ASSERT(options != nullptr);
+ options->set_check_call_host(check_call_host);
}
-void grpc_tls_server_authorization_check_config_release(
- grpc_tls_server_authorization_check_config* config) {
+void grpc_tls_credentials_options_set_tls_session_key_log_file_path(
+ grpc_tls_credentials_options* options, const char* path) {
+ if (!tsi_tls_session_key_logging_supported() || options == nullptr) {
+ return;
+ }
GRPC_API_TRACE(
- "grpc_tls_server_authorization_check_config_release(config=%p)", 1,
- (config));
- grpc_core::ExecCtx exec_ctx;
- if (config != nullptr) config->Unref();
+ "grpc_tls_credentials_options_set_tls_session_key_log_config(options=%p)",
+ 1, (options));
+ // Tls session key logging is assumed to be enabled if the specified log
+ // file is non-empty.
+ if (path != nullptr) {
+ gpr_log(GPR_INFO,
+ "Enabling TLS session key logging with keys stored at: %s", path);
+ } else {
+ gpr_log(GPR_INFO, "Disabling TLS session key logging");
+ }
+ options->set_tls_session_key_log_file_path(path != nullptr ? path : "");
}
diff --git a/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
index 2aae29b4..a85e7264 100644
--- a/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
+++ b/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
@@ -1,100 +1,38 @@
-/*
- *
- * 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.
+//
+//
+
+// Generated by tools/codegen/core/gen_grpc_tls_credentials_options.py
#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H
#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
-
#include "absl/container/inlined_vector.h"
+#include <grpc/grpc_security.h>
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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 std::string& error_details() { return error_details_; }
-
- private:
- std::string error_details_;
-};
-
-/** TLS server authorization check config. **/
-struct grpc_tls_server_authorization_check_config
- : public grpc_core::RefCounted<grpc_tls_server_authorization_check_config> {
- public:
- grpc_tls_server_authorization_check_config(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data));
- ~grpc_tls_server_authorization_check_config() override;
-
- void* context() const { return context_; }
-
- void set_context(void* context) { context_ = context; }
-
- int Schedule(grpc_tls_server_authorization_check_arg* arg) const;
-
- void Cancel(grpc_tls_server_authorization_check_arg* arg) const;
-
- private:
- /** This is a pointer to the wrapped language implementation of
- * grpc_tls_server_authorization_check_config. It is necessary to implement
- * the C schedule and cancel functions, given the schedule or cancel function
- * in a wrapped language. **/
- void* context_ = nullptr;
- /** config-specific, read-only user data that works for all channels created
- with a Credential using the config. */
- void* config_user_data_;
-
- /** callback function for invoking server authorization check. The
- implementation of this method has to be non-blocking, but can be performed
- synchronously or asynchronously.
- If processing occurs synchronously, it populates \a arg->result, \a
- arg->status, and \a arg->error_details, and returns zero.
- If processing occurs asynchronously, it returns a non-zero value.
- Application then invokes \a arg->cb when processing is completed. Note that
- \a arg->cb cannot be invoked before \a schedule() returns.
- */
- int (*schedule_)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg);
-
- /** callback function for canceling a server authorization check request. */
- void (*cancel_)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg);
-
- /** callback function for cleaning up any data associated with server
- authorization check config. */
- void (*destruct_)(void* config_user_data);
-};
-
// Contains configurable options specified by callers to configure their certain
// security features supported in TLS.
// TODO(ZhenLian): consider making this not ref-counted.
@@ -104,90 +42,76 @@ struct grpc_tls_credentials_options
~grpc_tls_credentials_options() override = default;
// Getters for member fields.
- 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_ssl_client_certificate_request_type cert_request_type() const { return cert_request_type_; }
+ bool verify_server_cert() const { return verify_server_cert_; }
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_authorization_check_config*
- server_authorization_check_config() const {
- return server_authorization_check_config_.get();
+ grpc_tls_certificate_verifier* certificate_verifier() {
+ return certificate_verifier_.get();
}
- // Returns the distributor from provider_ if it is set, nullptr otherwise.
+ bool check_call_host() const { return check_call_host_; }
+ // Returns the distributor from certificate_provider_ if it is set, nullptr otherwise.
grpc_tls_certificate_distributor* certificate_distributor() {
- if (provider_ != nullptr) return provider_->distributor().get();
+ if (certificate_provider_ != nullptr) { return certificate_provider_->distributor().get(); }
return nullptr;
}
- bool watch_root_cert() { return watch_root_cert_; }
- const std::string& root_cert_name() { return root_cert_name_; }
- bool watch_identity_pair() { return watch_identity_pair_; }
- const std::string& identity_cert_name() { return identity_cert_name_; }
+ bool watch_root_cert() const { return watch_root_cert_; }
+ const std::string& root_cert_name() const { return root_cert_name_; }
+ bool watch_identity_pair() const { return watch_identity_pair_; }
+ const std::string& identity_cert_name() const { return identity_cert_name_; }
+ const std::string& tls_session_key_log_file_path() const { return tls_session_key_log_file_path_; }
+ const std::string& crl_directory() const { return crl_directory_; }
// Setters for member fields.
- void set_cert_request_type(
- 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_authorization_check_config(
- grpc_core::RefCountedPtr<grpc_tls_server_authorization_check_config>
- config) {
- server_authorization_check_config_ = std::move(config);
- }
- // Sets the provider in the options.
- void set_certificate_provider(
- grpc_core::RefCountedPtr<grpc_tls_certificate_provider> provider) {
- provider_ = std::move(provider);
- }
- // If need to watch the updates of root certificates with name
- // |root_cert_name|. The default value is false. If used in tls_credentials,
- // it should always be set to true unless the root certificates are not
- // needed.
- void set_watch_root_cert(bool watch) { watch_root_cert_ = watch; }
- // Sets the name of root certificates being watched, if |set_watch_root_cert|
- // is called. If not set, an empty string will be used as the name.
- void set_root_cert_name(std::string root_cert_name) {
- root_cert_name_ = std::move(root_cert_name);
- }
- // If need to watch the updates of identity certificates with name
- // |identity_cert_name|.
- // The default value is false.
- // If used in tls_credentials, it should always be set to true
- // unless the identity key-cert pairs are not needed.
- void set_watch_identity_pair(bool watch) { watch_identity_pair_ = watch; }
- // Sets the name of identity key-cert pairs being watched, if
- // |set_watch_identity_pair| is called. If not set, an empty string will
- // be used as the name.
- void set_identity_cert_name(std::string identity_cert_name) {
- identity_cert_name_ = std::move(identity_cert_name);
+ void set_cert_request_type(grpc_ssl_client_certificate_request_type cert_request_type) { cert_request_type_ = cert_request_type; }
+ void set_verify_server_cert(bool verify_server_cert) { verify_server_cert_ = verify_server_cert; }
+ 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_certificate_verifier(grpc_core::RefCountedPtr<grpc_tls_certificate_verifier> certificate_verifier) { certificate_verifier_ = std::move(certificate_verifier); }
+ void set_check_call_host(bool check_call_host) { check_call_host_ = check_call_host; }
+ void set_certificate_provider(grpc_core::RefCountedPtr<grpc_tls_certificate_provider> certificate_provider) { certificate_provider_ = std::move(certificate_provider); }
+ // If need to watch the updates of root certificates with name |root_cert_name|. The default value is false. If used in tls_credentials, it should always be set to true unless the root certificates are not needed.
+ void set_watch_root_cert(bool watch_root_cert) { watch_root_cert_ = watch_root_cert; }
+ // Sets the name of root certificates being watched, if |set_watch_root_cert| is called. If not set, an empty string will be used as the name.
+ void set_root_cert_name(std::string root_cert_name) { root_cert_name_ = std::move(root_cert_name); }
+ // If need to watch the updates of identity certificates with name |identity_cert_name|. The default value is false. If used in tls_credentials, it should always be set to true unless the identity key-cert pairs are not needed.
+ void set_watch_identity_pair(bool watch_identity_pair) { watch_identity_pair_ = watch_identity_pair; }
+ // Sets the name of identity key-cert pairs being watched, if |set_watch_identity_pair| is called. If not set, an empty string will be used as the name.
+ void set_identity_cert_name(std::string identity_cert_name) { identity_cert_name_ = std::move(identity_cert_name); }
+ void set_tls_session_key_log_file_path(std::string tls_session_key_log_file_path) { tls_session_key_log_file_path_ = std::move(tls_session_key_log_file_path); }
+ // gRPC will enforce CRLs on all handshakes from all hashed CRL files inside of the crl_directory. If not set, an empty string will be used, which will not enable CRL checking. Only supported for OpenSSL version > 1.1.
+ void set_crl_directory(std::string crl_directory) { crl_directory_ = std::move(crl_directory); }
+
+ bool operator==(const grpc_tls_credentials_options& other) const {
+ return cert_request_type_ == other.cert_request_type_ &&
+ verify_server_cert_ == other.verify_server_cert_ &&
+ min_tls_version_ == other.min_tls_version_ &&
+ max_tls_version_ == other.max_tls_version_ &&
+ (certificate_verifier_ == other.certificate_verifier_ || (certificate_verifier_ != nullptr && other.certificate_verifier_ != nullptr && certificate_verifier_->Compare(other.certificate_verifier_.get()) == 0)) &&
+ check_call_host_ == other.check_call_host_ &&
+ (certificate_provider_ == other.certificate_provider_ || (certificate_provider_ != nullptr && other.certificate_provider_ != nullptr && certificate_provider_->Compare(other.certificate_provider_.get()) == 0)) &&
+ watch_root_cert_ == other.watch_root_cert_ &&
+ root_cert_name_ == other.root_cert_name_ &&
+ watch_identity_pair_ == other.watch_identity_pair_ &&
+ identity_cert_name_ == other.identity_cert_name_ &&
+ tls_session_key_log_file_path_ == other.tls_session_key_log_file_path_ &&
+ crl_directory_ == other.crl_directory_;
}
private:
- grpc_ssl_client_certificate_request_type cert_request_type_ =
- GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
- grpc_tls_server_verification_option server_verification_option_ =
- GRPC_TLS_SERVER_VERIFICATION;
+ grpc_ssl_client_certificate_request_type cert_request_type_ = GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
+ bool verify_server_cert_ = true;
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_server_authorization_check_config>
- server_authorization_check_config_;
- grpc_core::RefCountedPtr<grpc_tls_certificate_provider> provider_;
+ grpc_core::RefCountedPtr<grpc_tls_certificate_verifier> certificate_verifier_;
+ bool check_call_host_ = true;
+ grpc_core::RefCountedPtr<grpc_tls_certificate_provider> certificate_provider_;
bool watch_root_cert_ = false;
std::string root_cert_name_;
bool watch_identity_pair_ = false;
std::string identity_cert_name_;
+ std::string tls_session_key_log_file_path_;
+ std::string crl_directory_;
};
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H
diff --git a/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc b/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
index f5b05d8a..b92de4ca 100644
--- a/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
@@ -28,29 +28,38 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.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 CredentialOptionSanityCheck(grpc_tls_credentials_options* options,
bool is_client) {
if (options == nullptr) {
gpr_log(GPR_ERROR, "TLS credentials options is nullptr.");
return false;
}
- // TODO(ZhenLian): remove this when it is also supported on server side.
- if (!is_client && options->server_authorization_check_config() != nullptr) {
- gpr_log(GPR_INFO,
- "Server's credentials options should not contain server "
- "authorization check config.");
+ // In the following conditions, there won't be any issues, but it might
+ // indicate callers are doing something wrong with the API.
+ if (is_client && options->cert_request_type() !=
+ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE) {
+ gpr_log(GPR_ERROR,
+ "Client's credentials options should not set cert_request_type.");
}
- if (options->server_verification_option() != GRPC_TLS_SERVER_VERIFICATION &&
- options->server_authorization_check_config() == nullptr) {
+ if (!is_client && !options->verify_server_cert()) {
gpr_log(GPR_ERROR,
- "Should provider custom verifications if bypassing default ones.");
- return false;
+ "Server's credentials options should not set verify_server_cert.");
+ }
+ // In the following conditions, there could be severe security issues.
+ if (is_client && options->certificate_verifier() == nullptr) {
+ // If no verifier is specified on the client side, use the hostname verifier
+ // as default. Users who want to bypass all the verifier check should
+ // implement an external verifier instead.
+ gpr_log(GPR_INFO,
+ "No verifier specified on the client side. Using default hostname "
+ "verifier");
+ options->set_certificate_verifier(
+ grpc_core::MakeRefCounted<grpc_core::HostNameCertificateVerifier>());
}
return true;
}
@@ -59,8 +68,7 @@ bool CredentialOptionSanityCheck(const grpc_tls_credentials_options* options,
TlsCredentials::TlsCredentials(
grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
- : grpc_channel_credentials(GRPC_CREDENTIALS_TYPE_TLS),
- options_(std::move(options)) {}
+ : options_(std::move(options)) {}
TlsCredentials::~TlsCredentials() {}
@@ -98,10 +106,16 @@ TlsCredentials::create_security_connector(
return sc;
}
+int TlsCredentials::cmp_impl(const grpc_channel_credentials* other) const {
+ const TlsCredentials* o = static_cast<const TlsCredentials*>(other);
+ if (*options_ == *o->options_) return 0;
+ return grpc_core::QsortCompare(
+ static_cast<const grpc_channel_credentials*>(this), other);
+}
+
TlsServerCredentials::TlsServerCredentials(
grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
- : grpc_server_credentials(GRPC_CREDENTIALS_TYPE_TLS),
- options_(std::move(options)) {}
+ : options_(std::move(options)) {}
TlsServerCredentials::~TlsServerCredentials() {}
diff --git a/grpc/src/core/lib/security/credentials/tls/tls_credentials.h b/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
index a5e4f486..0e719cae 100644
--- a/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
+++ b/grpc/src/core/lib/security/credentials/tls/tls_credentials.h
@@ -38,9 +38,13 @@ class TlsCredentials final : public grpc_channel_credentials {
const char* target_name, const grpc_channel_args* args,
grpc_channel_args** new_args) override;
+ const char* type() const override { return "Tls"; }
+
grpc_tls_credentials_options* options() const { return options_.get(); }
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override;
+
grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
};
@@ -53,6 +57,8 @@ class TlsServerCredentials final : public grpc_server_credentials {
grpc_core::RefCountedPtr<grpc_server_security_connector>
create_security_connector(const grpc_channel_args* /* args */) override;
+ const char* type() const override { return "Tls"; }
+
grpc_tls_credentials_options* options() const { return options_.get(); }
private:
diff --git a/grpc/src/core/lib/security/credentials/tls/tls_utils.cc b/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
index b94c2eed..2dcc1974 100644
--- a/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
+++ b/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
@@ -88,4 +88,36 @@ bool VerifySubjectAlternativeName(absl::string_view subject_alternative_name,
std::string::npos;
}
+absl::string_view GetAuthPropertyValue(grpc_auth_context* context,
+ const char* property_name) {
+ grpc_auth_property_iterator it =
+ grpc_auth_context_find_properties_by_name(context, property_name);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ if (prop == nullptr) {
+ gpr_log(GPR_DEBUG, "No value found for %s property.", property_name);
+ return "";
+ }
+ if (grpc_auth_property_iterator_next(&it) != nullptr) {
+ gpr_log(GPR_DEBUG, "Multiple values found for %s property.", property_name);
+ return "";
+ }
+ return absl::string_view(prop->value, prop->value_length);
+}
+
+std::vector<absl::string_view> GetAuthPropertyArray(grpc_auth_context* context,
+ const char* property_name) {
+ std::vector<absl::string_view> values;
+ grpc_auth_property_iterator it =
+ grpc_auth_context_find_properties_by_name(context, property_name);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ while (prop != nullptr) {
+ values.emplace_back(prop->value, prop->value_length);
+ prop = grpc_auth_property_iterator_next(&it);
+ }
+ if (values.empty()) {
+ gpr_log(GPR_DEBUG, "No value found for %s property.", property_name);
+ }
+ return values;
+}
+
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/credentials/tls/tls_utils.h b/grpc/src/core/lib/security/credentials/tls/tls_utils.h
index 6fe9bb46..31a7f32e 100644
--- a/grpc/src/core/lib/security/credentials/tls/tls_utils.h
+++ b/grpc/src/core/lib/security/credentials/tls/tls_utils.h
@@ -26,6 +26,8 @@
#include "absl/strings/string_view.h"
+#include "src/core/lib/security/context/security_context.h"
+
namespace grpc_core {
// Matches \a subject_alternative_name with \a matcher. Returns true if there
@@ -33,6 +35,17 @@ namespace grpc_core {
bool VerifySubjectAlternativeName(absl::string_view subject_alternative_name,
const std::string& matcher);
+// Returns value for the specified property_name from auth context. Here the
+// property is expected to have a single value. Returns empty if multiple values
+// are found.
+absl::string_view GetAuthPropertyValue(grpc_auth_context* context,
+ const char* property_name);
+
+// Returns values for the specified property_name from auth context. Here the
+// property can have any number of values.
+std::vector<absl::string_view> GetAuthPropertyArray(grpc_auth_context* context,
+ const char* property_name);
+
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_UTILS_H
diff --git a/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc b/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
index 15b8e900..c391fc2a 100644
--- a/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
+++ b/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
@@ -29,8 +29,6 @@
namespace grpc_core {
-const char kCredentialsTypeXds[] = "Xds";
-
namespace {
bool XdsVerifySubjectAlternativeNames(
@@ -61,46 +59,53 @@ bool XdsVerifySubjectAlternativeNames(
return false;
}
-class ServerAuthCheck {
- public:
- ServerAuthCheck(
- RefCountedPtr<XdsCertificateProvider> xds_certificate_provider,
- std::string cluster_name)
- : xds_certificate_provider_(std::move(xds_certificate_provider)),
- cluster_name_(std::move(cluster_name)) {}
-
- static int Schedule(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg) {
- return static_cast<ServerAuthCheck*>(config_user_data)->ScheduleImpl(arg);
- }
+} // namespace
- static void Destroy(void* config_user_data) {
- delete static_cast<ServerAuthCheck*>(config_user_data);
- }
+//
+// XdsCertificateVerifier
+//
- private:
- int ScheduleImpl(grpc_tls_server_authorization_check_arg* arg) {
- if (XdsVerifySubjectAlternativeNames(
- arg->subject_alternative_names, arg->subject_alternative_names_size,
- xds_certificate_provider_->GetSanMatchers(cluster_name_))) {
- arg->success = 1;
- arg->status = GRPC_STATUS_OK;
- } else {
- arg->success = 0;
- arg->status = GRPC_STATUS_UNAUTHENTICATED;
- if (arg->error_details) {
- arg->error_details->set_error_details(
- "SANs from certificate did not match SANs from xDS control plane");
- }
- }
- return 0; /* synchronous check */
+XdsCertificateVerifier::XdsCertificateVerifier(
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider,
+ std::string cluster_name)
+ : xds_certificate_provider_(std::move(xds_certificate_provider)),
+ cluster_name_(std::move(cluster_name)) {}
+
+bool XdsCertificateVerifier::Verify(
+ grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)>, absl::Status* sync_status) {
+ GPR_ASSERT(request != nullptr);
+ if (!XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.uri_names,
+ request->peer_info.san_names.uri_names_size,
+ xds_certificate_provider_->GetSanMatchers(cluster_name_)) &&
+ !XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.ip_names,
+ request->peer_info.san_names.ip_names_size,
+ xds_certificate_provider_->GetSanMatchers(cluster_name_)) &&
+ !XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.dns_names,
+ request->peer_info.san_names.dns_names_size,
+ xds_certificate_provider_->GetSanMatchers(cluster_name_))) {
+ *sync_status = absl::Status(
+ absl::StatusCode::kUnauthenticated,
+ "SANs from certificate did not match SANs from xDS control plane");
}
+ return true; /* synchronous check */
+}
- RefCountedPtr<XdsCertificateProvider> xds_certificate_provider_;
- std::string cluster_name_;
-};
+void XdsCertificateVerifier::Cancel(
+ grpc_tls_custom_verification_check_request*) {}
-} // namespace
+int XdsCertificateVerifier::CompareImpl(
+ const grpc_tls_certificate_verifier* other) const {
+ auto* o = static_cast<const XdsCertificateVerifier*>(other);
+ int r = QsortCompare(xds_certificate_provider_, o->xds_certificate_provider_);
+ if (r != 0) return r;
+ return cluster_name_.compare(o->cluster_name_);
+}
+
+const char* XdsCertificateVerifier::type() const { return "Xds"; }
bool TestOnlyXdsVerifySubjectAlternativeNames(
const char* const* subject_alternative_names,
@@ -161,27 +166,11 @@ XdsCredentials::create_security_connector(
tls_credentials_options->set_watch_identity_pair(true);
tls_credentials_options->set_identity_cert_name(cluster_name);
}
- tls_credentials_options->set_server_verification_option(
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION);
- auto* server_auth_check = new ServerAuthCheck(xds_certificate_provider,
- std::move(cluster_name));
- tls_credentials_options->set_server_authorization_check_config(
- MakeRefCounted<grpc_tls_server_authorization_check_config>(
- server_auth_check, ServerAuthCheck::Schedule, nullptr,
- ServerAuthCheck::Destroy));
- // TODO(yashkt): Creating a new TlsCreds object each time we create a
- // security connector means that the security connector's cmp() method
- // returns unequal for each instance, which means that every time an LB
- // policy updates, all the subchannels will be recreated. This is
- // going to lead to a lot of connection churn. Instead, we should
- // either (a) change the TLS security connector's cmp() method to be
- // smarter somehow, so that it compares unequal only when the
- // tls_credentials_options have changed, or (b) cache the TlsCreds
- // objects in the XdsCredentials object so that we can reuse the
- // same one when creating new security connectors, swapping out the
- // TlsCreds object only when the tls_credentials_options change.
- // Option (a) would probably be better, although it may require some
- // structural changes to the security connector API.
+ tls_credentials_options->set_verify_server_cert(true);
+ tls_credentials_options->set_certificate_verifier(
+ MakeRefCounted<XdsCertificateVerifier>(xds_certificate_provider,
+ std::move(cluster_name)));
+ tls_credentials_options->set_check_call_host(false);
auto tls_credentials =
MakeRefCounted<TlsCredentials>(std::move(tls_credentials_options));
return tls_credentials->create_security_connector(
@@ -193,6 +182,8 @@ XdsCredentials::create_security_connector(
std::move(call_creds), target_name, temp_args.args, new_args);
}
+const char* XdsCredentials::Type() { return "Xds"; }
+
//
// XdsServerCredentials
//
@@ -229,6 +220,8 @@ XdsServerCredentials::create_security_connector(const grpc_channel_args* args) {
return fallback_credentials_->create_security_connector(args);
}
+const char* XdsServerCredentials::Type() { return "Xds"; }
+
} // namespace grpc_core
grpc_channel_credentials* grpc_xds_credentials_create(
diff --git a/grpc/src/core/lib/security/credentials/xds/xds_credentials.h b/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
index ee2e71c5..4d308b88 100644
--- a/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
+++ b/grpc/src/core/lib/security/credentials/xds/xds_credentials.h
@@ -23,25 +23,53 @@
#include <grpc/grpc_security.h>
-#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/xds_certificate_provider.h"
+#include "src/core/lib/matchers/matchers.h"
#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
namespace grpc_core {
-extern const char kCredentialsTypeXds[];
+class XdsCertificateVerifier : public grpc_tls_certificate_verifier {
+ public:
+ XdsCertificateVerifier(
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider,
+ std::string cluster_name);
+
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(absl::Status)>,
+ absl::Status* sync_status) override;
+ void Cancel(grpc_tls_custom_verification_check_request*) override;
+
+ const char* type() const override;
+
+ private:
+ int CompareImpl(const grpc_tls_certificate_verifier* other) const override;
+
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider_;
+ std::string cluster_name_;
+};
class XdsCredentials final : public grpc_channel_credentials {
public:
explicit XdsCredentials(
RefCountedPtr<grpc_channel_credentials> fallback_credentials)
- : grpc_channel_credentials(kCredentialsTypeXds),
- fallback_credentials_(std::move(fallback_credentials)) {}
+ : fallback_credentials_(std::move(fallback_credentials)) {}
RefCountedPtr<grpc_channel_security_connector> create_security_connector(
RefCountedPtr<grpc_call_credentials> call_creds, const char* target_name,
const grpc_channel_args* args, grpc_channel_args** new_args) override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ auto* o = static_cast<const XdsCredentials*>(other);
+ return fallback_credentials_->cmp(o->fallback_credentials_.get());
+ }
+
RefCountedPtr<grpc_channel_credentials> fallback_credentials_;
};
@@ -49,12 +77,15 @@ class XdsServerCredentials final : public grpc_server_credentials {
public:
explicit XdsServerCredentials(
RefCountedPtr<grpc_server_credentials> fallback_credentials)
- : grpc_server_credentials(kCredentialsTypeXds),
- fallback_credentials_(std::move(fallback_credentials)) {}
+ : fallback_credentials_(std::move(fallback_credentials)) {}
RefCountedPtr<grpc_server_security_connector> create_security_connector(
const grpc_channel_args* /* args */) override;
+ static const char* Type();
+
+ const char* type() const override { return Type(); }
+
private:
RefCountedPtr<grpc_server_credentials> fallback_credentials_;
};
diff --git a/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
index 131436df..95906981 100644
--- a/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
@@ -29,6 +29,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/credentials/alts/alts_credentials.h"
#include "src/core/lib/security/transport/security_handshaker.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -69,7 +70,7 @@ class grpc_alts_channel_security_connector final
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name)
- : grpc_channel_security_connector(GRPC_ALTS_URL_SCHEME,
+ : grpc_channel_security_connector(GRPC_SSL_URL_SCHEME,
std::move(channel_creds),
std::move(request_metadata_creds)),
target_name_(gpr_strdup(target_name)) {}
@@ -116,20 +117,13 @@ class grpc_alts_channel_security_connector final
return strcmp(target_name_, other->target_name_);
}
- bool check_call_host(absl::string_view host,
- grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle* error) override {
+ grpc_core::ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context*) override {
if (host.empty() || host != target_name_) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "ALTS call host does not match target name");
+ return grpc_core::Immediate(absl::UnauthenticatedError(
+ "ALTS call host does not match target name"));
}
- return true;
- }
-
- void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle error) override {
- GRPC_ERROR_UNREF(error);
+ return grpc_core::ImmediateOkStatus();
}
private:
@@ -141,7 +135,7 @@ class grpc_alts_server_security_connector final
public:
explicit grpc_alts_server_security_connector(
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
- : grpc_server_security_connector(GRPC_ALTS_URL_SCHEME,
+ : grpc_server_security_connector(GRPC_SSL_URL_SCHEME,
std::move(server_creds)) {}
~grpc_alts_server_security_connector() override = default;
@@ -187,8 +181,8 @@ class grpc_alts_server_security_connector final
namespace grpc_core {
namespace internal {
-grpc_core::RefCountedPtr<grpc_auth_context>
-grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
+RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
+ const tsi_peer* peer) {
if (peer == nullptr) {
gpr_log(GPR_ERROR,
"Invalid arguments to grpc_alts_auth_context_from_tsi_peer()");
@@ -243,7 +237,7 @@ grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
return nullptr;
}
/* Create auth context. */
- auto ctx = grpc_core::MakeRefCounted<grpc_auth_context>(nullptr);
+ auto ctx = MakeRefCounted<grpc_auth_context>(nullptr);
grpc_auth_context_add_cstring_property(
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_ALTS_TRANSPORT_SECURITY_TYPE);
diff --git a/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h b/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
index 10c3fe93..9fafca2d 100644
--- a/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
@@ -23,9 +23,9 @@
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
#define GRPC_ALTS_TRANSPORT_SECURITY_TYPE "alts"
-#define GRPC_ALTS_URL_SCHEME "https"
/**
* This method creates an ALTS channel security connector.
@@ -66,8 +66,8 @@ namespace grpc_core {
namespace internal {
/* Exposed only for testing. */
-grpc_core::RefCountedPtr<grpc_auth_context>
-grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer);
+RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
+ const tsi_peer* peer);
} // namespace internal
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
index 0e25fb02..ef3eaaf6 100644
--- a/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
@@ -29,13 +29,12 @@
#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/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
#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/promise/promise.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
@@ -92,12 +91,12 @@ class grpc_fake_channel_security_connector final
c = strcmp(target_, other->target_);
if (c != 0) return c;
if (expected_targets_ == nullptr || other->expected_targets_ == nullptr) {
- c = GPR_ICMP(expected_targets_, other->expected_targets_);
+ c = grpc_core::QsortCompare(expected_targets_, other->expected_targets_);
} else {
c = strcmp(expected_targets_, other->expected_targets_);
}
if (c != 0) return c;
- return GPR_ICMP(is_lb_channel_, other->is_lb_channel_);
+ return grpc_core::QsortCompare(is_lb_channel_, other->is_lb_channel_);
}
void add_handshakers(const grpc_channel_args* args,
@@ -107,10 +106,8 @@ class grpc_fake_channel_security_connector final
tsi_create_fake_handshaker(/*is_client=*/true), this, args));
}
- bool check_call_host(absl::string_view host,
- grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle* /*error*/) override {
+ grpc_core::ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context*) override {
absl::string_view authority_hostname;
absl::string_view authority_ignored_port;
absl::string_view target_hostname;
@@ -136,12 +133,7 @@ class grpc_fake_channel_security_connector final
target_);
abort();
}
- return true;
- }
-
- void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle error) override {
- GRPC_ERROR_UNREF(error);
+ return grpc_core::ImmediateOkStatus();
}
char* target() const { return target_; }
@@ -214,10 +206,9 @@ class grpc_fake_channel_security_connector final
char* target_name_override_;
};
-static void fake_check_peer(
- grpc_security_connector* /*sc*/, tsi_peer peer,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) {
+void fake_check_peer(grpc_security_connector* /*sc*/, tsi_peer peer,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) {
const char* prop_name;
grpc_error_handle error = GRPC_ERROR_NONE;
*auth_context = nullptr;
@@ -229,10 +220,9 @@ static void fake_check_peer(
prop_name = peer.properties[0].name;
if (prop_name == nullptr ||
strcmp(prop_name, TSI_CERTIFICATE_TYPE_PEER_PROPERTY) != 0) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
+ prop_name == nullptr ? "<EMPTY>" : prop_name));
goto end;
}
if (strncmp(peer.properties[0].value.data, TSI_FAKE_CERTIFICATE_TYPE,
@@ -244,10 +234,9 @@ static void fake_check_peer(
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(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
+ prop_name == nullptr ? "<EMPTY>" : prop_name));
goto end;
}
if (strncmp(peer.properties[1].value.data, TSI_FAKE_SECURITY_LEVEL,
diff --git a/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.h b/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.h
index 344a2349..c5cb51c3 100644
--- a/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.h
@@ -27,8 +27,6 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/security_connector/security_connector.h"
-#define GRPC_FAKE_SECURITY_URL_SCHEME "http+fake_security"
-
/* Creates a fake connector that emulates real channel security. */
grpc_core::RefCountedPtr<grpc_channel_security_connector>
grpc_fake_channel_security_connector_create(
diff --git a/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc b/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
index 360764e1..4fc0df77 100644
--- a/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/security/security_connector/insecure/insecure_security_connector.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/transport/security_handshaker.h"
#include "src/core/tsi/local_transport_security.h"
@@ -48,18 +49,9 @@ RefCountedPtr<grpc_auth_context> TestOnlyMakeInsecureAuthContext() {
return MakeAuthContext();
}
-// check_call_host and cancel_check_call_host are no-ops since we want to
-// provide an insecure channel.
-bool InsecureChannelSecurityConnector::check_call_host(
- absl::string_view /*host*/, grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/, grpc_error_handle* error) {
- *error = GRPC_ERROR_NONE;
- return true;
-}
-
-void InsecureChannelSecurityConnector::cancel_check_call_host(
- grpc_closure* /*on_call_host_checked*/, grpc_error_handle error) {
- GRPC_ERROR_UNREF(error);
+ArenaPromise<absl::Status> InsecureChannelSecurityConnector::CheckCallHost(
+ absl::string_view, grpc_auth_context*) {
+ return ImmediateOkStatus();
}
// add_handshakers should have been a no-op but we need to add a minimalist
@@ -70,8 +62,7 @@ void InsecureChannelSecurityConnector::add_handshakers(
HandshakeManager* handshake_manager) {
tsi_handshaker* handshaker = nullptr;
// Re-use local_tsi_handshaker_create as a minimalist handshaker.
- GPR_ASSERT(tsi_local_handshaker_create(true /* is_client */, &handshaker) ==
- TSI_OK);
+ GPR_ASSERT(tsi_local_handshaker_create(&handshaker) == TSI_OK);
handshake_manager->Add(SecurityHandshakerCreate(handshaker, this, args));
}
@@ -95,17 +86,16 @@ int InsecureChannelSecurityConnector::cmp(
// created with the security level of TSI_SECURITY_NONE.
void InsecureServerSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) {
+ HandshakeManager* handshake_manager) {
tsi_handshaker* handshaker = nullptr;
// Re-use local_tsi_handshaker_create as a minimalist handshaker.
- GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */, &handshaker) ==
- TSI_OK);
+ GPR_ASSERT(tsi_local_handshaker_create(&handshaker) == TSI_OK);
handshake_manager->Add(SecurityHandshakerCreate(handshaker, this, args));
}
void InsecureServerSecurityConnector::check_peer(
tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) {
*auth_context = MakeAuthContext();
tsi_peer_destruct(&peer);
diff --git a/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h b/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
index 352e346c..2b716bcb 100644
--- a/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
@@ -39,25 +39,20 @@ class InsecureChannelSecurityConnector
: public grpc_channel_security_connector {
public:
InsecureChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds)
- : grpc_channel_security_connector(/* url_scheme */ nullptr,
- std::move(channel_creds),
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds)
+ : grpc_channel_security_connector("", std::move(channel_creds),
std::move(request_metadata_creds)) {}
- bool check_call_host(absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* on_call_host_checked,
- grpc_error_handle* error) override;
-
- void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error_handle error) override;
+ ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context* auth_context) override;
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) override;
+ HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
@@ -71,16 +66,16 @@ class InsecureChannelSecurityConnector
class InsecureServerSecurityConnector : public grpc_server_security_connector {
public:
explicit InsecureServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
- : grpc_server_security_connector(nullptr /* url_scheme */,
+ RefCountedPtr<grpc_server_credentials> server_creds)
+ : grpc_server_security_connector("" /* url_scheme */,
std::move(server_creds)) {}
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) override;
+ HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
diff --git a/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc b/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
index f04d0ed2..f448d3fc 100644
--- a/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
+++ b/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/lib/security/security_connector/load_system_roots.h"
#if !defined(GPR_LINUX) && !defined(GPR_ANDROID)
diff --git a/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc b/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
index 4cd709f7..6b9c50b7 100644
--- a/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
+++ b/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
@@ -18,12 +18,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice_buffer.h>
#include "src/core/lib/security/security_connector/load_system_roots_linux.h"
-#if defined(GPR_LINUX) || defined(GPR_ANDROID)
+#include <grpc/slice_buffer.h>
-#include "src/core/lib/security/security_connector/load_system_roots.h"
+#if defined(GPR_LINUX) || defined(GPR_ANDROID)
#include <dirent.h>
#include <fcntl.h>
@@ -44,6 +43,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/security_connector/load_system_roots.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_system_ssl_roots_dir, "",
"Custom directory to SSL Roots");
@@ -145,8 +145,7 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
grpc_slice LoadSystemRootCerts() {
grpc_slice result = grpc_empty_slice();
// Prioritize user-specified custom directory if flag is set.
- grpc_core::UniquePtr<char> custom_dir =
- GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
+ UniquePtr<char> custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
if (strlen(custom_dir.get()) > 0) {
result = CreateRootCertsBundle(custom_dir.get());
}
diff --git a/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc b/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
index 1c1cfe92..f97299d0 100644
--- a/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
@@ -29,6 +29,7 @@
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -37,11 +38,14 @@
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/promise/promise.h"
#include "src/core/lib/security/credentials/local/local_credentials.h"
#include "src/core/lib/security/transport/security_handshaker.h"
+#include "src/core/lib/uri/uri_parser.h"
#include "src/core/tsi/local_transport_security.h"
#define GRPC_UDS_URI_PATTERN "unix:"
+#define GRPC_ABSTRACT_UDS_URI_PATTERN "unix-abstract:"
#define GRPC_LOCAL_TRANSPORT_SECURITY_TYPE "local"
namespace {
@@ -70,13 +74,14 @@ 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) {
- int fd = grpc_endpoint_get_fd(ep);
grpc_resolved_address resolved_addr;
- memset(&resolved_addr, 0, sizeof(resolved_addr));
- resolved_addr.len = GRPC_MAX_SOCKADDR_SIZE;
bool is_endpoint_local = false;
- if (getsockname(fd, reinterpret_cast<grpc_sockaddr*>(resolved_addr.addr),
- &resolved_addr.len) == 0) {
+ absl::string_view local_addr = grpc_endpoint_get_local_address(ep);
+ absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(local_addr);
+ if (!uri.ok() || !grpc_parse_uri(*uri, &resolved_addr)) {
+ gpr_log(GPR_ERROR, "Could not parse endpoint address: %s",
+ std::string(local_addr.data(), local_addr.size()).c_str());
+ } else {
grpc_resolved_address addr_normalized;
grpc_resolved_address* addr =
grpc_sockaddr_is_v4mapped(&resolved_addr, &addr_normalized)
@@ -103,7 +108,7 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
}
}
}
- grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_error_handle error;
if (!is_endpoint_local) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Endpoint is neither UDS or TCP loopback address.");
@@ -147,7 +152,7 @@ class grpc_local_channel_security_connector final
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name)
- : grpc_channel_security_connector(nullptr, std::move(channel_creds),
+ : grpc_channel_security_connector({}, std::move(channel_creds),
std::move(request_metadata_creds)),
target_name_(gpr_strdup(target_name)) {}
@@ -157,8 +162,7 @@ class grpc_local_channel_security_connector final
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
grpc_core::HandshakeManager* handshake_manager) override {
tsi_handshaker* handshaker = nullptr;
- GPR_ASSERT(tsi_local_handshaker_create(true /* is_client */, &handshaker) ==
- TSI_OK);
+ GPR_ASSERT(tsi_local_handshaker_create(&handshaker) == TSI_OK);
handshake_manager->Add(
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
}
@@ -186,20 +190,13 @@ class grpc_local_channel_security_connector final
GRPC_ERROR_UNREF(error);
}
- bool check_call_host(absl::string_view host,
- grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle* error) override {
+ grpc_core::ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context*) override {
if (host.empty() || host != target_name_) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "local call host does not match target name");
+ return grpc_core::Immediate(absl::UnauthenticatedError(
+ "local call host does not match target name"));
}
- return true;
- }
-
- void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle error) override {
- GRPC_ERROR_UNREF(error);
+ return grpc_core::ImmediateOkStatus();
}
const char* target_name() const { return target_name_; }
@@ -213,15 +210,14 @@ class grpc_local_server_security_connector final
public:
explicit grpc_local_server_security_connector(
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
- : grpc_server_security_connector(nullptr, std::move(server_creds)) {}
+ : grpc_server_security_connector({}, std::move(server_creds)) {}
~grpc_local_server_security_connector() override = default;
void add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
grpc_core::HandshakeManager* handshake_manager) override {
tsi_handshaker* handshaker = nullptr;
- GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */,
- &handshaker) == TSI_OK);
+ GPR_ASSERT(tsi_local_handshaker_create(&handshaker) == TSI_OK);
handshake_manager->Add(
grpc_core::SecurityHandshakerCreate(handshaker, this, args));
}
@@ -267,7 +263,9 @@ grpc_local_channel_security_connector_create(
const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
if (creds->connect_type() == UDS &&
strncmp(GRPC_UDS_URI_PATTERN, server_uri_str,
- strlen(GRPC_UDS_URI_PATTERN)) != 0) {
+ strlen(GRPC_UDS_URI_PATTERN)) != 0 &&
+ strncmp(GRPC_ABSTRACT_UDS_URI_PATTERN, server_uri_str,
+ strlen(GRPC_ABSTRACT_UDS_URI_PATTERN)) != 0) {
gpr_log(GPR_ERROR,
"Invalid UDS target name to "
"grpc_local_channel_security_connector_create()");
diff --git a/grpc/src/core/lib/security/security_connector/security_connector.cc b/grpc/src/core/lib/security/security_connector/security_connector.cc
index 822fe15c..aff35e97 100644
--- a/grpc/src/core/lib/security/security_connector/security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/security_connector.cc
@@ -25,15 +25,11 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/transport/chttp2/alpn/alpn.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/host_port.h"
-#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/security_connector/load_system_roots.h"
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/security/transport/security_handshaker.h"
@@ -41,7 +37,7 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount(
false, "security_connector_refcount");
grpc_server_security_connector::grpc_server_security_connector(
- const char* url_scheme,
+ absl::string_view url_scheme,
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
: grpc_security_connector(url_scheme),
server_creds_(std::move(server_creds)) {}
@@ -49,7 +45,7 @@ grpc_server_security_connector::grpc_server_security_connector(
grpc_server_security_connector::~grpc_server_security_connector() = default;
grpc_channel_security_connector::grpc_channel_security_connector(
- const char* url_scheme,
+ absl::string_view url_scheme,
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds)
: grpc_security_connector(url_scheme),
@@ -58,21 +54,16 @@ grpc_channel_security_connector::grpc_channel_security_connector(
grpc_channel_security_connector::~grpc_channel_security_connector() {}
-int grpc_security_connector_cmp(const grpc_security_connector* sc,
- const grpc_security_connector* other) {
- if (sc == nullptr || other == nullptr) return GPR_ICMP(sc, other);
- return sc->cmp(other);
-}
-
int grpc_channel_security_connector::channel_security_connector_cmp(
const grpc_channel_security_connector* other) const {
const grpc_channel_security_connector* other_sc =
static_cast<const grpc_channel_security_connector*>(other);
GPR_ASSERT(channel_creds() != nullptr);
GPR_ASSERT(other_sc->channel_creds() != nullptr);
- int c = GPR_ICMP(channel_creds(), other_sc->channel_creds());
+ int c = channel_creds()->cmp(other_sc->channel_creds());
if (c != 0) return c;
- return GPR_ICMP(request_metadata_creds(), other_sc->request_metadata_creds());
+ return grpc_core::QsortCompare(request_metadata_creds(),
+ other_sc->request_metadata_creds());
}
int grpc_server_security_connector::server_security_connector_cmp(
@@ -81,15 +72,17 @@ int grpc_server_security_connector::server_security_connector_cmp(
static_cast<const grpc_server_security_connector*>(other);
GPR_ASSERT(server_creds() != nullptr);
GPR_ASSERT(other_sc->server_creds() != nullptr);
- return GPR_ICMP(server_creds(), other_sc->server_creds());
+ return grpc_core::QsortCompare(server_creds(), other_sc->server_creds());
}
static void connector_arg_destroy(void* p) {
+ if (p == nullptr) return;
static_cast<grpc_security_connector*>(p)->Unref(DEBUG_LOCATION,
"connector_arg_destroy");
}
static void* connector_arg_copy(void* p) {
+ if (p == nullptr) return nullptr;
return static_cast<grpc_security_connector*>(p)
->Ref(DEBUG_LOCATION, "connector_arg_copy")
.release();
diff --git a/grpc/src/core/lib/security/security_connector/security_connector.h b/grpc/src/core/lib/security/security_connector/security_connector.h
index 50d9af37..86a508e3 100644
--- a/grpc/src/core/lib/security/security_connector/security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/security_connector.h
@@ -30,11 +30,16 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/tcp_server.h"
-#include "src/core/tsi/ssl_transport_security.h"
+#include "src/core/lib/promise/arena_promise.h"
#include "src/core/tsi/transport_security_interface.h"
extern grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount;
+/* --- URL schemes. --- */
+
+#define GRPC_SSL_URL_SCHEME "https"
+#define GRPC_FAKE_SECURITY_URL_SCHEME "http+fake_security"
+
typedef enum { GRPC_SECURITY_OK = 0, GRPC_SECURITY_ERROR } grpc_security_status;
/* --- security_connector object. ---
@@ -42,12 +47,12 @@ typedef enum { GRPC_SECURITY_OK = 0, GRPC_SECURITY_ERROR } grpc_security_status;
A security connector object represents away to configure the underlying
transport security mechanism and check the resulting trusted peer. */
-#define GRPC_ARG_SECURITY_CONNECTOR "grpc.security_connector"
+#define GRPC_ARG_SECURITY_CONNECTOR "grpc.internal.security_connector"
class grpc_security_connector
: public grpc_core::RefCounted<grpc_security_connector> {
public:
- explicit grpc_security_connector(const char* url_scheme)
+ explicit grpc_security_connector(absl::string_view url_scheme)
: grpc_core::RefCounted<grpc_security_connector>(
GRPC_TRACE_FLAG_ENABLED(grpc_trace_security_connector_refcount)
? "security_connector_refcount"
@@ -55,6 +60,10 @@ class grpc_security_connector
url_scheme_(url_scheme) {}
~grpc_security_connector() override = default;
+ static absl::string_view ChannelArgName() {
+ return GRPC_ARG_SECURITY_CONNECTOR;
+ }
+
// Checks the peer. Callee takes ownership of the peer object.
// When done, sets *auth_context and invokes on_peer_checked.
virtual void check_peer(
@@ -70,10 +79,15 @@ class grpc_security_connector
/* Compares two security connectors. */
virtual int cmp(const grpc_security_connector* other) const = 0;
- const char* url_scheme() const { return url_scheme_; }
+ static int ChannelArgsCompare(const grpc_security_connector* a,
+ const grpc_security_connector* b) {
+ return a->cmp(b);
+ }
+
+ absl::string_view url_scheme() const { return url_scheme_; }
private:
- const char* url_scheme_;
+ absl::string_view url_scheme_;
};
/* Util to encapsulate the connector in a channel arg. */
@@ -94,26 +108,16 @@ grpc_security_connector* grpc_security_connector_find_in_args(
class grpc_channel_security_connector : public grpc_security_connector {
public:
grpc_channel_security_connector(
- const char* url_scheme,
+ absl::string_view url_scheme,
grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds
- /*,
- grpc_channel_args* channel_args = nullptr*/);
+ grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds);
~grpc_channel_security_connector() override;
/// Checks that the host that will be set for a call is acceptable.
- /// 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(absl::string_view host,
- grpc_auth_context* auth_context,
- grpc_closure* on_call_host_checked,
- grpc_error_handle* error) = 0;
- /// Cancels a pending asynchronous call to
- /// grpc_channel_security_connector_check_call_host() with
- /// \a on_call_host_checked as its callback.
- virtual void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error_handle error) = 0;
+ /// Returns ok if the host is acceptable, otherwise returns an error.
+ virtual grpc_core::ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context* auth_context) = 0;
+
/// Registers handshakers with \a handshake_mgr.
virtual void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
@@ -156,7 +160,7 @@ class grpc_channel_security_connector : public grpc_security_connector {
class grpc_server_security_connector : public grpc_security_connector {
public:
grpc_server_security_connector(
- const char* url_scheme,
+ absl::string_view url_scheme,
grpc_core::RefCountedPtr<grpc_server_credentials> server_creds);
~grpc_server_security_connector() override;
diff --git a/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc b/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
index 3e424e35..dcee1ecb 100644
--- a/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
@@ -35,6 +35,7 @@
#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/promise/promise.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 +55,8 @@ grpc_error_handle 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(
- absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Peer name ", peer_name, " is not in peer certificate"));
}
*auth_context =
grpc_ssl_peer_to_auth_context(peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
@@ -129,7 +129,8 @@ class grpc_ssl_channel_security_connector final
client_handshaker_factory_,
overridden_target_name_.empty() ? target_name_.c_str()
: overridden_target_name_.c_str(),
- &tsi_hs);
+ /*network_bio_buf_size=*/0,
+ /*ssl_bio_buf_size=*/0, &tsi_hs);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
@@ -162,10 +163,8 @@ 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(
- absl::StrFormat("Verify peer callback returned a failure (%d)",
- callback_status)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
+ "Verify peer callback returned a failure (%d)", callback_status));
}
}
}
@@ -188,17 +187,11 @@ class grpc_ssl_channel_security_connector final
return overridden_target_name_.compare(other->overridden_target_name_);
}
- bool check_call_host(absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* /*on_call_host_checked*/,
- grpc_error_handle* error) override {
- 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*/,
- grpc_error_handle error) override {
- GRPC_ERROR_UNREF(error);
+ grpc_core::ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context* auth_context) override {
+ return grpc_core::Immediate(
+ SslCheckCallHost(host, target_name_.c_str(),
+ overridden_target_name_.c_str(), auth_context));
}
private:
@@ -280,7 +273,8 @@ class grpc_ssl_server_security_connector
try_fetch_ssl_server_credentials();
tsi_handshaker* tsi_hs = nullptr;
tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
- server_handshaker_factory_, &tsi_hs);
+ server_handshaker_factory_, /*network_bio_buf_size=*/0,
+ /*ssl_bio_buf_size=*/0, &tsi_hs);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
diff --git a/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h b/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
index 04c32bb2..57342d94 100644
--- a/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
@@ -23,9 +23,8 @@
#include <grpc/grpc_security.h>
-#include "src/core/lib/security/security_connector/security_connector.h"
-
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security_interface.h"
diff --git a/grpc/src/core/lib/security/security_connector/ssl_utils.cc b/grpc/src/core/lib/security/security_connector/ssl_utils.cc
index f445be9c..07983c3b 100644
--- a/grpc/src/core/lib/security/security_connector/ssl_utils.cc
+++ b/grpc/src/core/lib/security/security_connector/ssl_utils.cc
@@ -92,30 +92,6 @@ 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);
-}
-
tsi_client_certificate_request_type
grpc_get_tsi_client_certificate_request_type(
grpc_ssl_client_certificate_request_type grpc_request_type) {
@@ -173,18 +149,28 @@ grpc_error_handle grpc_ssl_check_peer_name(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(
- absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Peer name ", peer_name, " is not in peer certificate"));
}
return GRPC_ERROR_NONE;
}
-bool grpc_ssl_check_call_host(absl::string_view host,
+void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
+ size_t num_key_cert_pairs) {
+ if (kp == nullptr) return;
+ for (size_t i = 0; i < num_key_cert_pairs; i++) {
+ gpr_free(const_cast<char*>(kp[i].private_key));
+ gpr_free(const_cast<char*>(kp[i].cert_chain));
+ }
+ gpr_free(kp);
+}
+
+namespace grpc_core {
+
+absl::Status SslCheckCallHost(absl::string_view host,
absl::string_view target_name,
absl::string_view overridden_target_name,
- grpc_auth_context* auth_context,
- grpc_error_handle* error) {
+ grpc_auth_context* auth_context) {
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;
@@ -195,13 +181,17 @@ bool grpc_ssl_check_call_host(absl::string_view host,
status = GRPC_SECURITY_OK;
}
if (status != GRPC_SECURITY_OK) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ gpr_log(GPR_ERROR, "call host does not match SSL server name");
+ grpc_shallow_peer_destruct(&peer);
+ return absl::UnauthenticatedError(
"call host does not match SSL server name");
}
grpc_shallow_peer_destruct(&peer);
- return true;
+ return absl::OkStatus();
}
+} // namespace grpc_core
+
const char** grpc_fill_alpn_protocol_strings(size_t* num_alpn_protocols) {
GPR_ASSERT(num_alpn_protocols != nullptr);
*num_alpn_protocols = grpc_chttp2_num_alpn_versions();
@@ -247,7 +237,7 @@ static bool IsSpiffeId(absl::string_view uri) {
return false;
}
std::vector<absl::string_view> splits = absl::StrSplit(uri, '/');
- if (splits.size() < 4 || splits[3] == "") {
+ if (splits.size() < 4 || splits[3].empty()) {
gpr_log(GPR_INFO, "Invalid SPIFFE ID: workload id is empty.");
return false;
}
@@ -277,7 +267,11 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
for (i = 0; i < peer->property_count; i++) {
const tsi_peer_property* prop = &peer->properties[i];
if (prop->name == nullptr) continue;
- if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
+ if (strcmp(prop->name, TSI_X509_SUBJECT_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_X509_SUBJECT_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) ==
+ 0) {
/* If there is no subject alt name, have the CN as the identity. */
if (peer_identity_property_name == nullptr) {
peer_identity_property_name = GRPC_X509_CN_PROPERTY_NAME;
@@ -309,6 +303,8 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
grpc_auth_context_add_property(ctx.get(), GRPC_PEER_DNS_PROPERTY_NAME,
prop->value.data, prop->value.length);
} else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_PEER_URI_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
uri_count++;
absl::string_view spiffe_id(prop->value.data, prop->value.length);
if (IsSpiffeId(spiffe_id)) {
@@ -371,6 +367,9 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
if (strcmp(prop->name, GRPC_X509_SAN_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(
&peer, prop, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_X509_SUBJECT_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_SUBJECT_PEER_PROPERTY);
} else if (strcmp(prop->name, GRPC_X509_CN_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(
&peer, prop, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY);
@@ -388,6 +387,9 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
} else if (strcmp(prop->name, GRPC_PEER_DNS_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(&peer, prop,
TSI_X509_DNS_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_URI_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_URI_PEER_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);
@@ -411,6 +413,8 @@ 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,
+ tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* tls_session_key_logger,
+ const char* crl_directory,
tsi_ssl_client_handshaker_factory** handshaker_factory) {
const char* root_certs;
const tsi_ssl_root_certs_store* root_store;
@@ -443,10 +447,12 @@ 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.key_logger = tls_session_key_logger;
options.skip_server_certificate_verification =
skip_server_certificate_verification;
options.min_tls_version = min_tls_version;
options.max_tls_version = max_tls_version;
+ options.crl_directory = crl_directory;
const tsi_result result =
tsi_create_ssl_client_handshaker_factory_with_options(&options,
handshaker_factory);
@@ -464,6 +470,8 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
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::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* tls_session_key_logger,
+ const char* crl_directory,
tsi_ssl_server_handshaker_factory** handshaker_factory) {
size_t num_alpn_protocols = 0;
const char** alpn_protocol_strings =
@@ -479,6 +487,8 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
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.key_logger = tls_session_key_logger;
+ options.crl_directory = crl_directory;
const tsi_result result =
tsi_create_ssl_server_handshaker_factory_with_options(&options,
handshaker_factory);
@@ -519,7 +529,7 @@ static void grpc_ssl_session_cache_arg_destroy(void* p) {
}
static int grpc_ssl_session_cache_arg_cmp(void* p, void* q) {
- return GPR_ICMP(p, q);
+ return grpc_core::QsortCompare(p, q);
}
grpc_arg grpc_ssl_session_cache_create_channel_arg(
@@ -558,7 +568,7 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
const bool not_use_system_roots =
GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots);
// First try to load the roots from the configuration.
- grpc_core::UniquePtr<char> default_root_certs_path =
+ UniquePtr<char> default_root_certs_path =
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
if (strlen(default_root_certs_path.get()) > 0) {
GRPC_LOG_IF_ERROR(
diff --git a/grpc/src/core/lib/security/security_connector/ssl_utils.h b/grpc/src/core/lib/security/security_connector/ssl_utils.h
index 1c41a543..cc0825dd 100644
--- a/grpc/src/core/lib/security/security_connector/ssl_utils.h
+++ b/grpc/src/core/lib/security/security_connector/ssl_utils.h
@@ -40,9 +40,6 @@
/* --- Util --- */
-/* --- URL schemes. --- */
-#define GRPC_SSL_URL_SCHEME "https"
-
/* Check ALPN information returned from SSL handshakes. */
grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer);
@@ -54,12 +51,15 @@ int grpc_ssl_cmp_target_name(absl::string_view target_name,
absl::string_view other_target_name,
absl::string_view overridden_target_name,
absl::string_view other_overridden_target_name);
+
+namespace grpc_core {
/* Check the host that will be set for a call is acceptable.*/
-bool grpc_ssl_check_call_host(absl::string_view host,
+absl::Status SslCheckCallHost(absl::string_view host,
absl::string_view target_name,
absl::string_view overridden_target_name,
- grpc_auth_context* auth_context,
- grpc_error_handle* error);
+ grpc_auth_context* auth_context);
+} // namespace grpc_core
+
/* Return HTTP2-compliant cipher suites that gRPC accepts by default. */
const char* grpc_get_ssl_cipher_suites(void);
@@ -69,20 +69,9 @@ 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);
-
/* Return an array of strings containing alpn protocols. */
const char** grpc_fill_alpn_protocol_strings(size_t* num_alpn_protocols);
@@ -91,6 +80,8 @@ 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,
+ tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* tls_session_key_logger,
+ const char* crl_directory,
tsi_ssl_client_handshaker_factory** handshaker_factory);
grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
@@ -98,8 +89,13 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init(
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::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* tls_session_key_logger,
+ const char* crl_directory,
tsi_ssl_server_handshaker_factory** handshaker_factory);
+/* Free the memory occupied by key cert pairs. */
+void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp,
+ size_t num_key_cert_pairs);
/* Exposed for testing only. */
grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
const tsi_peer* peer, const char* transport_security_type);
@@ -181,7 +177,7 @@ class PemKeyCertPair {
std::string cert_chain_;
};
-typedef absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
+typedef absl::InlinedVector<PemKeyCertPair, 1> PemKeyCertPairList;
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc b/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
index ea6b42e0..13701e59 100644
--- a/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
+++ b/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
@@ -23,16 +23,18 @@
#include <stdbool.h>
#include <string.h>
+#include "absl/functional/bind_front.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
+#include <grpc/grpc_security_constants.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/promise/promise.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"
@@ -45,6 +47,155 @@ namespace grpc_core {
namespace {
+char* CopyCoreString(char* src, size_t length) {
+ char* target = static_cast<char*>(gpr_malloc(length + 1));
+ memcpy(target, src, length);
+ target[length] = '\0';
+ return target;
+}
+
+void PendingVerifierRequestInit(
+ const char* target_name, tsi_peer peer,
+ grpc_tls_custom_verification_check_request* request) {
+ GPR_ASSERT(request != nullptr);
+ // The verifier holds a ref to the security connector, so it's fine to
+ // directly point this to the name cached in the security connector.
+ request->target_name = target_name;
+ // TODO(ZhenLian): avoid the copy when the underlying core implementation used
+ // the null-terminating string.
+ bool has_common_name = false;
+ bool has_peer_cert = false;
+ bool has_peer_cert_full_chain = false;
+ std::vector<char*> uri_names;
+ std::vector<char*> dns_names;
+ std::vector<char*> email_names;
+ std::vector<char*> ip_names;
+ for (size_t i = 0; i < peer.property_count; ++i) {
+ const tsi_peer_property* prop = &peer.properties[i];
+ if (prop->name == nullptr) continue;
+ if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
+ request->peer_info.common_name =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_common_name = true;
+ } else if (strcmp(prop->name, TSI_X509_PEM_CERT_PROPERTY) == 0) {
+ request->peer_info.peer_cert =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_peer_cert = true;
+ } else if (strcmp(prop->name, TSI_X509_PEM_CERT_CHAIN_PROPERTY) == 0) {
+ request->peer_info.peer_cert_full_chain =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_peer_cert_full_chain = true;
+ } else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
+ char* uri = CopyCoreString(prop->value.data, prop->value.length);
+ uri_names.emplace_back(uri);
+ } else if (strcmp(prop->name, TSI_X509_DNS_PEER_PROPERTY) == 0) {
+ char* dns = CopyCoreString(prop->value.data, prop->value.length);
+ dns_names.emplace_back(dns);
+ } else if (strcmp(prop->name, TSI_X509_EMAIL_PEER_PROPERTY) == 0) {
+ char* email = CopyCoreString(prop->value.data, prop->value.length);
+ email_names.emplace_back(email);
+ } else if (strcmp(prop->name, TSI_X509_IP_PEER_PROPERTY) == 0) {
+ char* ip = CopyCoreString(prop->value.data, prop->value.length);
+ ip_names.emplace_back(ip);
+ }
+ }
+ if (!has_common_name) {
+ request->peer_info.common_name = nullptr;
+ }
+ if (!has_peer_cert) {
+ request->peer_info.peer_cert = nullptr;
+ }
+ if (!has_peer_cert_full_chain) {
+ request->peer_info.peer_cert_full_chain = nullptr;
+ }
+ request->peer_info.san_names.uri_names_size = uri_names.size();
+ if (!uri_names.empty()) {
+ request->peer_info.san_names.uri_names =
+ new char*[request->peer_info.san_names.uri_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.uri_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.uri_names[i] = uri_names[i];
+ }
+ } else {
+ request->peer_info.san_names.uri_names = nullptr;
+ }
+ request->peer_info.san_names.dns_names_size = dns_names.size();
+ if (!dns_names.empty()) {
+ request->peer_info.san_names.dns_names =
+ new char*[request->peer_info.san_names.dns_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.dns_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.dns_names[i] = dns_names[i];
+ }
+ } else {
+ request->peer_info.san_names.dns_names = nullptr;
+ }
+ request->peer_info.san_names.email_names_size = email_names.size();
+ if (!email_names.empty()) {
+ request->peer_info.san_names.email_names =
+ new char*[request->peer_info.san_names.email_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.email_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.email_names[i] = email_names[i];
+ }
+ } else {
+ request->peer_info.san_names.email_names = nullptr;
+ }
+ request->peer_info.san_names.ip_names_size = ip_names.size();
+ if (!ip_names.empty()) {
+ request->peer_info.san_names.ip_names =
+ new char*[request->peer_info.san_names.ip_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.ip_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.ip_names[i] = ip_names[i];
+ }
+ } else {
+ request->peer_info.san_names.ip_names = nullptr;
+ }
+}
+
+void PendingVerifierRequestDestroy(
+ grpc_tls_custom_verification_check_request* request) {
+ GPR_ASSERT(request != nullptr);
+ if (request->peer_info.common_name != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.common_name));
+ }
+ if (request->peer_info.san_names.uri_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.uri_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.uri_names[i]);
+ }
+ delete[] request->peer_info.san_names.uri_names;
+ }
+ if (request->peer_info.san_names.dns_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.dns_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.dns_names[i]);
+ }
+ delete[] request->peer_info.san_names.dns_names;
+ }
+ if (request->peer_info.san_names.email_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.email_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.email_names[i]);
+ }
+ delete[] request->peer_info.san_names.email_names;
+ }
+ if (request->peer_info.san_names.ip_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.ip_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.ip_names[i]);
+ }
+ delete[] request->peer_info.san_names.ip_names;
+ }
+ if (request->peer_info.peer_cert != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.peer_cert));
+ }
+ if (request->peer_info.peer_cert_full_chain != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.peer_cert_full_chain));
+ }
+}
+
tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair(
const PemKeyCertPairList& cert_pair_list) {
tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
@@ -112,10 +263,15 @@ TlsChannelSecurityConnector::TlsChannelSecurityConnector(
overridden_target_name_(
overridden_target_name == nullptr ? "" : overridden_target_name),
ssl_session_cache_(ssl_session_cache) {
+ const std::string& tls_session_key_log_file_path =
+ options_->tls_session_key_log_file_path();
+ if (!tls_session_key_log_file_path.empty()) {
+ tls_session_key_logger_ =
+ tsi::TlsSessionKeyLoggerCache::Get(tls_session_key_log_file_path);
+ }
if (ssl_session_cache_ != nullptr) {
tsi_ssl_session_cache_ref(ssl_session_cache_);
}
- check_arg_ = ServerAuthorizationCheckArgCreate(this);
absl::string_view host;
absl::string_view port;
SplitHostPort(target_name, &host, &port);
@@ -163,36 +319,28 @@ TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
if (client_handshaker_factory_ != nullptr) {
tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
}
- if (check_arg_ != nullptr) {
- ServerAuthorizationCheckArgDestroy(check_arg_);
- }
}
void TlsChannelSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
HandshakeManager* handshake_mgr) {
MutexLock lock(&mu_);
+ tsi_handshaker* tsi_hs = nullptr;
if (client_handshaker_factory_ != nullptr) {
// 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);
+ /*network_bio_buf_size=*/0,
+ /*ssl_bio_buf_size=*/0, &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(SecurityHandshakerCreate(tsi_hs, this, args));
- return;
}
- // TODO(ZhenLian): Implement the logic(delegation to
- // BlockOnInitialCredentialHandshaker) when certificates are not ready.
- gpr_log(GPR_ERROR, "%s not supported yet.",
- "Client BlockOnInitialCredentialHandshaker");
+ // If tsi_hs is null, this will add a failing handshaker.
+ handshake_mgr->Add(SecurityHandshakerCreate(tsi_hs, this, args));
}
void TlsChannelSecurityConnector::check_peer(
@@ -210,126 +358,66 @@ void TlsChannelSecurityConnector::check_peer(
}
*auth_context =
grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
- if (options_->server_verification_option() == GRPC_TLS_SERVER_VERIFICATION) {
- /* Do the default host name check if specifying the target name. */
- error = internal::TlsCheckHostName(target_name, &peer);
- if (error != GRPC_ERROR_NONE) {
- ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
- return;
- }
+ GPR_ASSERT(options_->certificate_verifier() != nullptr);
+ auto* pending_request = new ChannelPendingVerifierRequest(
+ Ref(), on_peer_checked, peer, target_name);
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ pending_verifier_requests_.emplace(on_peer_checked, pending_request);
+ }
+ pending_request->Start();
+}
+
+void TlsChannelSecurityConnector::cancel_check_peer(
+ grpc_closure* on_peer_checked, grpc_error_handle error) {
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "TlsChannelSecurityConnector::cancel_check_peer error: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return;
}
- /* Do the custom server authorization check, if specified by the user. */
- const grpc_tls_server_authorization_check_config* config =
- 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);
- }
- // TODO(zhenlian) - This should be cleaned up as part of the custom
- // verification changes. Fill in the subject alternative names
- std::vector<char*> subject_alternative_names;
- for (size_t i = 0; i < peer.property_count; i++) {
- const tsi_peer_property* prop = &peer.properties[i];
- if (strcmp(prop->name,
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
- char* san = new char[prop->value.length + 1];
- memcpy(san, prop->value.data, prop->value.length);
- san[prop->value.length] = '\0';
- subject_alternative_names.emplace_back(san);
- }
- }
- if (check_arg_->subject_alternative_names != nullptr) {
- for (size_t i = 0; i < check_arg_->subject_alternative_names_size;
- ++i) {
- delete[] check_arg_->subject_alternative_names[i];
- }
- delete[] check_arg_->subject_alternative_names;
- }
- check_arg_->subject_alternative_names_size =
- subject_alternative_names.size();
- if (subject_alternative_names.empty()) {
- check_arg_->subject_alternative_names = nullptr;
+ auto* verifier = options_->certificate_verifier();
+ if (verifier != nullptr) {
+ grpc_tls_custom_verification_check_request* pending_verifier_request =
+ nullptr;
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ auto it = pending_verifier_requests_.find(on_peer_checked);
+ if (it != pending_verifier_requests_.end()) {
+ pending_verifier_request = it->second->request();
} else {
- check_arg_->subject_alternative_names =
- new char*[check_arg_->subject_alternative_names_size];
- for (size_t i = 0; i < check_arg_->subject_alternative_names_size;
- ++i) {
- check_arg_->subject_alternative_names[i] =
- subject_alternative_names[i];
- }
+ gpr_log(GPR_INFO,
+ "TlsChannelSecurityConnector::cancel_check_peer: no "
+ "corresponding pending request found");
}
- 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_);
+ }
+ if (pending_verifier_request != nullptr) {
+ verifier->Cancel(pending_verifier_request);
}
}
- 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(
+ if (c != 0) return c;
+ c = 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());
+ if (c != 0) return c;
+ return 0;
}
-bool TlsChannelSecurityConnector::check_call_host(
- absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* /*on_call_host_checked*/, grpc_error_handle* error) {
- if (options_->server_verification_option() ==
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION ||
- options_->server_verification_option() ==
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION) {
- return true;
+ArenaPromise<absl::Status> TlsChannelSecurityConnector::CheckCallHost(
+ absl::string_view host, grpc_auth_context* auth_context) {
+ if (options_->check_call_host()) {
+ return Immediate(SslCheckCallHost(host, target_name_.c_str(),
+ overridden_target_name_.c_str(),
+ auth_context));
}
- 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_handle error) {
- GRPC_ERROR_UNREF(error);
+ return ImmediateOkStatus();
}
void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::
@@ -374,13 +462,61 @@ void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::OnError(
GRPC_ERROR_UNREF(identity_cert_error);
}
+TlsChannelSecurityConnector::ChannelPendingVerifierRequest::
+ ChannelPendingVerifierRequest(
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer, const char* target_name)
+ : security_connector_(std::move(security_connector)),
+ on_peer_checked_(on_peer_checked) {
+ PendingVerifierRequestInit(target_name, peer, &request_);
+ tsi_peer_destruct(&peer);
+}
+
+TlsChannelSecurityConnector::ChannelPendingVerifierRequest::
+ ~ChannelPendingVerifierRequest() {
+ PendingVerifierRequestDestroy(&request_);
+}
+
+void TlsChannelSecurityConnector::ChannelPendingVerifierRequest::Start() {
+ absl::Status sync_status;
+ grpc_tls_certificate_verifier* verifier =
+ security_connector_->options_->certificate_verifier();
+ bool is_done = verifier->Verify(
+ &request_,
+ absl::bind_front(&ChannelPendingVerifierRequest::OnVerifyDone, this,
+ true),
+ &sync_status);
+ if (is_done) {
+ OnVerifyDone(false, sync_status);
+ }
+}
+
+void TlsChannelSecurityConnector::ChannelPendingVerifierRequest::OnVerifyDone(
+ bool run_callback_inline, absl::Status status) {
+ {
+ MutexLock lock(&security_connector_->verifier_request_map_mu_);
+ security_connector_->pending_verifier_requests_.erase(on_peer_checked_);
+ }
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (!status.ok()) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ absl::StrCat("Custom verification check failed with error: ",
+ status.ToString())
+ .c_str());
+ }
+ if (run_callback_inline) {
+ Closure::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ } else {
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ }
+ delete this;
+}
+
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
grpc_security_status
TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
- bool skip_server_certificate_verification =
- options_->server_verification_option() ==
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION;
+ bool skip_server_certificate_verification = !options_->verify_server_cert();
/* Free the client handshaker factory if exists. */
if (client_handshaker_factory_ != nullptr) {
tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
@@ -403,6 +539,7 @@ TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
skip_server_certificate_verification,
grpc_get_tsi_tls_version(options_->min_tls_version()),
grpc_get_tsi_tls_version(options_->max_tls_version()), ssl_session_cache_,
+ tls_session_key_logger_.get(), options_->crl_directory().c_str(),
&client_handshaker_factory_);
/* Free memory. */
if (pem_key_cert_pair != nullptr) {
@@ -411,83 +548,6 @@ TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
return status;
}
-void TlsChannelSecurityConnector::ServerAuthorizationCheckDone(
- grpc_tls_server_authorization_check_arg* arg) {
- GPR_ASSERT(arg != nullptr);
- ExecCtx exec_ctx;
- grpc_error_handle error = ProcessServerAuthorizationCheckResult(arg);
- TlsChannelSecurityConnector* connector =
- static_cast<TlsChannelSecurityConnector*>(arg->cb_user_data);
- ExecCtx::Run(DEBUG_LOCATION, connector->on_peer_checked_, error);
-}
-
-grpc_error_handle
-TlsChannelSecurityConnector::ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- /* Server authorization check is cancelled by caller. */
- if (arg->status == GRPC_STATUS_CANCELLED) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- 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(
- 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(
- 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->target_name = nullptr;
- arg->peer_cert = nullptr;
- arg->peer_cert_full_chain = nullptr;
- arg->subject_alternative_names = nullptr;
- arg->subject_alternative_names_size = 0;
- 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(const_cast<char*>(arg->target_name));
- gpr_free(const_cast<char*>(arg->peer_cert));
- gpr_free(const_cast<char*>(arg->peer_cert_full_chain));
- for (size_t i = 0; i < arg->subject_alternative_names_size; ++i) {
- delete[] arg->subject_alternative_names[i];
- }
- delete[] arg->subject_alternative_names;
- delete arg->error_details;
- if (arg->destroy_context != nullptr) {
- arg->destroy_context(arg->context);
- }
- delete arg;
-}
-
// -------------------server security connector-------------------
RefCountedPtr<grpc_server_security_connector>
TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
@@ -515,6 +575,12 @@ TlsServerSecurityConnector::TlsServerSecurityConnector(
: grpc_server_security_connector(GRPC_SSL_URL_SCHEME,
std::move(server_creds)),
options_(std::move(options)) {
+ const std::string& tls_session_key_log_file_path =
+ options_->tls_session_key_log_file_path();
+ if (!tls_session_key_log_file_path.empty()) {
+ tls_session_key_logger_ =
+ tsi::TlsSessionKeyLoggerCache::Get(tls_session_key_log_file_path);
+ }
// Create a watcher.
auto watcher_ptr = absl::make_unique<TlsServerCertificateWatcher>(this);
certificate_watcher_ = watcher_ptr.get();
@@ -549,24 +615,19 @@ void TlsServerSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
HandshakeManager* handshake_mgr) {
MutexLock lock(&mu_);
+ tsi_handshaker* tsi_hs = nullptr;
if (server_handshaker_factory_ != nullptr) {
// Instantiate TSI handshaker.
- tsi_handshaker* tsi_hs = nullptr;
tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
- server_handshaker_factory_, &tsi_hs);
+ server_handshaker_factory_, /*network_bio_buf_size=*/0,
+ /*ssl_bio_buf_size=*/0, &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(SecurityHandshakerCreate(tsi_hs, this, args));
- return;
}
- // TODO(ZhenLian): Implement the logic(delegation to
- // BlockOnInitialCredentialHandshaker) when certificates are not ready.
- gpr_log(GPR_ERROR, "%s not supported yet.",
- "Server BlockOnInitialCredentialHandshaker");
+ // If tsi_hs is null, this will add a failing handshaker.
+ handshake_mgr->Add(SecurityHandshakerCreate(tsi_hs, this, args));
}
void TlsServerSecurityConnector::check_peer(
@@ -574,16 +635,63 @@ void TlsServerSecurityConnector::check_peer(
RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) {
grpc_error_handle error = grpc_ssl_check_alpn(&peer);
+ if (error != GRPC_ERROR_NONE) {
+ 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);
- tsi_peer_destruct(&peer);
- ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ if (options_->certificate_verifier() != nullptr) {
+ auto* pending_request =
+ new ServerPendingVerifierRequest(Ref(), on_peer_checked, peer);
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ pending_verifier_requests_.emplace(on_peer_checked, pending_request);
+ }
+ pending_request->Start();
+ } else {
+ tsi_peer_destruct(&peer);
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ }
+}
+
+void TlsServerSecurityConnector::cancel_check_peer(
+ grpc_closure* on_peer_checked, grpc_error_handle error) {
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "TlsServerSecurityConnector::cancel_check_peer error: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ auto* verifier = options_->certificate_verifier();
+ if (verifier != nullptr) {
+ grpc_tls_custom_verification_check_request* pending_verifier_request =
+ nullptr;
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ auto it = pending_verifier_requests_.find(on_peer_checked);
+ if (it != pending_verifier_requests_.end()) {
+ pending_verifier_request = it->second->request();
+ } else {
+ gpr_log(GPR_INFO,
+ "TlsServerSecurityConnector::cancel_check_peer: no "
+ "corresponding pending request found");
+ }
+ }
+ if (pending_verifier_request != nullptr) {
+ verifier->Cancel(pending_verifier_request);
+ }
+ }
}
int TlsServerSecurityConnector::cmp(
- const grpc_security_connector* other) const {
- return server_security_connector_cmp(
- static_cast<const grpc_server_security_connector*>(other));
+ const grpc_security_connector* other_sc) const {
+ auto* other = reinterpret_cast<const TlsServerSecurityConnector*>(other_sc);
+ int c = server_security_connector_cmp(other);
+ if (c != 0) return c;
+ return 0;
}
void TlsServerSecurityConnector::TlsServerCertificateWatcher::
@@ -632,6 +740,55 @@ void TlsServerSecurityConnector::TlsServerCertificateWatcher::OnError(
GRPC_ERROR_UNREF(identity_cert_error);
}
+TlsServerSecurityConnector::ServerPendingVerifierRequest::
+ ServerPendingVerifierRequest(
+ RefCountedPtr<TlsServerSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer)
+ : security_connector_(std::move(security_connector)),
+ on_peer_checked_(on_peer_checked) {
+ PendingVerifierRequestInit(nullptr, peer, &request_);
+ tsi_peer_destruct(&peer);
+}
+
+TlsServerSecurityConnector::ServerPendingVerifierRequest::
+ ~ServerPendingVerifierRequest() {
+ PendingVerifierRequestDestroy(&request_);
+}
+
+void TlsServerSecurityConnector::ServerPendingVerifierRequest::Start() {
+ absl::Status sync_status;
+ grpc_tls_certificate_verifier* verifier =
+ security_connector_->options_->certificate_verifier();
+ bool is_done = verifier->Verify(
+ &request_,
+ absl::bind_front(&ServerPendingVerifierRequest::OnVerifyDone, this, true),
+ &sync_status);
+ if (is_done) {
+ OnVerifyDone(false, sync_status);
+ }
+}
+
+void TlsServerSecurityConnector::ServerPendingVerifierRequest::OnVerifyDone(
+ bool run_callback_inline, absl::Status status) {
+ {
+ MutexLock lock(&security_connector_->verifier_request_map_mu_);
+ security_connector_->pending_verifier_requests_.erase(on_peer_checked_);
+ }
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (!status.ok()) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ absl::StrCat("Custom verification check failed with error: ",
+ status.ToString())
+ .c_str());
+ }
+ if (run_callback_inline) {
+ Closure::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ } else {
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ }
+ delete this;
+}
+
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
grpc_security_status
@@ -658,6 +815,7 @@ TlsServerSecurityConnector::UpdateHandshakerFactoryLocked() {
options_->cert_request_type(),
grpc_get_tsi_tls_version(options_->min_tls_version()),
grpc_get_tsi_tls_version(options_->max_tls_version()),
+ tls_session_key_logger_.get(), options_->crl_directory().c_str(),
&server_handshaker_factory_);
/* Free memory. */
grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pairs,
@@ -665,19 +823,4 @@ TlsServerSecurityConnector::UpdateHandshakerFactoryLocked() {
return status;
}
-namespace internal {
-
-grpc_error_handle 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(
- absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
- }
- return GRPC_ERROR_NONE;
-}
-
-} // namespace internal
-
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h b/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
index 80c26954..b42da8f8 100644
--- a/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
+++ b/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
@@ -21,12 +21,14 @@
#include <grpc/support/port_platform.h>
+#include "absl/status/status.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_certificate_provider.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
+using TlsSessionKeyLogger = tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger;
namespace grpc_core {
@@ -60,20 +62,13 @@ class TlsChannelSecurityConnector final
RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
- void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
- grpc_error_handle error) override {
- // TODO(ZhenLian): call verifier->cancel() once the verifier is ready.
- GRPC_ERROR_UNREF(error);
- }
+ void cancel_check_peer(grpc_closure* on_peer_checked,
+ grpc_error_handle error) override;
int cmp(const grpc_security_connector* other_sc) const override;
- bool check_call_host(absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* on_call_host_checked,
- grpc_error_handle* error) override;
-
- void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error_handle error) override;
+ ArenaPromise<absl::Status> CheckCallHost(
+ absl::string_view host, grpc_auth_context* auth_context) override;
tsi_ssl_client_handshaker_factory* ClientHandshakerFactoryForTesting() {
MutexLock lock(&mu_);
@@ -110,43 +105,52 @@ class TlsChannelSecurityConnector final
TlsChannelSecurityConnector* security_connector_ = nullptr;
};
- // Updates |client_handshaker_factory_| when the certificates that
- // |certificate_watcher_| is watching get updated.
- grpc_security_status UpdateHandshakerFactoryLocked()
- ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ // Use "new" to create a new instance, and no need to delete it later, since
+ // it will be self-destroyed in |OnVerifyDone|.
+ class ChannelPendingVerifierRequest {
+ public:
+ ChannelPendingVerifierRequest(
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer, const char* target_name);
- // 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);
+ ~ChannelPendingVerifierRequest();
- // A util function to process server authorization check result.
- static grpc_error_handle ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg);
+ void Start();
- // A util function to create a server authorization check arg instance.
- static grpc_tls_server_authorization_check_arg*
- ServerAuthorizationCheckArgCreate(void* user_data);
+ grpc_tls_custom_verification_check_request* request() { return &request_; }
- // A util function to destroy a server authorization check arg instance.
- static void ServerAuthorizationCheckArgDestroy(
- grpc_tls_server_authorization_check_arg* arg);
+ private:
+ void OnVerifyDone(bool run_callback_inline, absl::Status status);
+ // The request will keep a reference of the security connector to make sure
+ // it won't be destroyed while the request is still ongoing.
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector_;
+ grpc_tls_custom_verification_check_request request_;
+ grpc_closure* on_peer_checked_;
+ };
+ // Updates |client_handshaker_factory_| when the certificates that
+ // |certificate_watcher_| is watching get updated.
+ grpc_security_status UpdateHandshakerFactoryLocked()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ Mutex mu_;
+ // We need a separate mutex for |pending_verifier_requests_|, otherwise there
+ // would be deadlock errors.
+ Mutex verifier_request_map_mu_;
RefCountedPtr<grpc_tls_credentials_options> options_;
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
certificate_watcher_ = nullptr;
- grpc_closure* on_peer_checked_ = nullptr;
std::string target_name_;
std::string overridden_target_name_;
- grpc_tls_server_authorization_check_arg* check_arg_ = nullptr;
-
- Mutex mu_;
tsi_ssl_client_handshaker_factory* client_handshaker_factory_
ABSL_GUARDED_BY(mu_) = nullptr;
tsi_ssl_session_cache* ssl_session_cache_ ABSL_GUARDED_BY(mu_) = nullptr;
+ RefCountedPtr<TlsSessionKeyLogger> tls_session_key_logger_;
absl::optional<absl::string_view> pem_root_certs_ ABSL_GUARDED_BY(mu_);
absl::optional<PemKeyCertPairList> pem_key_cert_pair_list_
ABSL_GUARDED_BY(mu_);
+ std::map<grpc_closure* /*on_peer_checked*/, ChannelPendingVerifierRequest*>
+ pending_verifier_requests_ ABSL_GUARDED_BY(verifier_request_map_mu_);
};
// Server security connector using TLS as transport security protocol.
@@ -172,10 +176,7 @@ class TlsServerSecurityConnector final : public grpc_server_security_connector {
grpc_closure* on_peer_checked) override;
void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
- grpc_error_handle error) override {
- // TODO(ZhenLian): call verifier->cancel() once the verifier is ready.
- GRPC_ERROR_UNREF(error);
- }
+ grpc_error_handle error) override;
int cmp(const grpc_security_connector* other) const override;
@@ -207,6 +208,7 @@ class TlsServerSecurityConnector final : public grpc_server_security_connector {
void OnCertificatesChanged(
absl::optional<absl::string_view> root_certs,
absl::optional<PemKeyCertPairList> key_cert_pairs) override;
+
void OnError(grpc_error_handle root_cert_error,
grpc_error_handle identity_cert_error) override;
@@ -214,32 +216,51 @@ class TlsServerSecurityConnector final : public grpc_server_security_connector {
TlsServerSecurityConnector* security_connector_ = nullptr;
};
+ // Use "new" to create a new instance, and no need to delete it later, since
+ // it will be self-destroyed in |OnVerifyDone|.
+ class ServerPendingVerifierRequest {
+ public:
+ ServerPendingVerifierRequest(
+ RefCountedPtr<TlsServerSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer);
+
+ ~ServerPendingVerifierRequest();
+
+ void Start();
+
+ grpc_tls_custom_verification_check_request* request() { return &request_; }
+
+ private:
+ void OnVerifyDone(bool run_callback_inline, absl::Status status);
+ // The request will keep a reference of the security connector to make sure
+ // it won't be destroyed while the request is still ongoing.
+ RefCountedPtr<TlsServerSecurityConnector> security_connector_;
+ grpc_tls_custom_verification_check_request request_;
+ grpc_closure* on_peer_checked_;
+ };
+
// Updates |server_handshaker_factory_| when the certificates that
// |certificate_watcher_| is watching get updated.
grpc_security_status UpdateHandshakerFactoryLocked()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ Mutex mu_;
+ // We need a separate mutex for |pending_verifier_requests_|, otherwise there
+ // would be deadlock errors.
+ Mutex verifier_request_map_mu_;
RefCountedPtr<grpc_tls_credentials_options> options_;
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
certificate_watcher_ = nullptr;
-
- Mutex mu_;
tsi_ssl_server_handshaker_factory* server_handshaker_factory_
ABSL_GUARDED_BY(mu_) = nullptr;
absl::optional<absl::string_view> pem_root_certs_ ABSL_GUARDED_BY(mu_);
absl::optional<PemKeyCertPairList> pem_key_cert_pair_list_
ABSL_GUARDED_BY(mu_);
+ RefCountedPtr<TlsSessionKeyLogger> tls_session_key_logger_;
+ std::map<grpc_closure* /*on_peer_checked*/, ServerPendingVerifierRequest*>
+ pending_verifier_requests_ ABSL_GUARDED_BY(verifier_request_map_mu_);
};
-// ---- Functions below are exposed for testing only -----------------------
-namespace internal {
-
-// TlsCheckHostName checks if |peer_name| matches the identity information
-// contained in |peer|. This is AKA hostname check.
-grpc_error_handle TlsCheckHostName(const char* peer_name, const tsi_peer* peer);
-
-} // namespace internal
-
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H
diff --git a/grpc/src/core/lib/security/transport/auth_filters.h b/grpc/src/core/lib/security/transport/auth_filters.h
index ae31b1d5..69a1b9ec 100644
--- a/grpc/src/core/lib/security/transport/auth_filters.h
+++ b/grpc/src/core/lib/security/transport/auth_filters.h
@@ -22,14 +22,48 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc_security.h>
+
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/promise_based_filter.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
+#include "src/core/lib/transport/transport.h"
-extern const grpc_channel_filter grpc_client_auth_filter;
extern const grpc_channel_filter grpc_server_auth_filter;
-void grpc_auth_metadata_context_build(
- const char* url_scheme, const grpc_slice& call_host,
- const grpc_slice& call_method, grpc_auth_context* auth_context,
- grpc_auth_metadata_context* auth_md_context);
+namespace grpc_core {
+
+// Handles calling out to credentials to fill in metadata per call.
+class ClientAuthFilter final : public ChannelFilter {
+ public:
+ static const grpc_channel_filter kFilter;
+
+ static absl::StatusOr<ClientAuthFilter> Create(ChannelArgs args,
+ ChannelFilter::Args);
+
+ // Construct a promise for one call.
+ ArenaPromise<ServerMetadataHandle> MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) override;
+
+ private:
+ ClientAuthFilter(
+ RefCountedPtr<grpc_channel_security_connector> security_connector,
+ RefCountedPtr<grpc_auth_context> auth_context);
+
+ ArenaPromise<absl::StatusOr<CallArgs>> GetCallCredsMetadata(
+ CallArgs call_args);
+
+ // Contains refs to security connector and auth context.
+ grpc_call_credentials::GetRequestMetadataArgs args_;
+};
+
+} // namespace grpc_core
+
+// Exposed for testing purposes only.
+// Check if the channel's security level is higher or equal to
+// that of call credentials to make a decision whether the transfer
+// of call credentials should be allowed or not.
+bool grpc_check_security_level(grpc_security_level channel_level,
+ grpc_security_level call_cred_level);
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */
diff --git a/grpc/src/core/lib/security/transport/client_auth_filter.cc b/grpc/src/core/lib/security/transport/client_auth_filter.cc
index babc90fb..0bc1ff8f 100644
--- a/grpc/src/core/lib/security/transport/client_auth_filter.cc
+++ b/grpc/src/core/lib/security/transport/client_auth_filter.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/transport/auth_filters.h"
-
#include <string.h>
#include <string>
@@ -31,91 +29,24 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/promise_based_filter.h"
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/capture.h"
+#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/promise/try_seq.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/security_connector.h"
-#include "src/core/lib/security/security_connector/ssl_utils.h"
+#include "src/core/lib/security/transport/auth_filters.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/transport/static_metadata.h"
+#include "src/core/lib/transport/transport.h"
#define MAX_CREDENTIALS_METADATA_COUNT 4
-namespace {
-
-/* We can have a per-channel credentials. */
-struct channel_data {
- channel_data(grpc_channel_security_connector* security_connector,
- grpc_auth_context* auth_context)
- : security_connector(
- security_connector->Ref(DEBUG_LOCATION, "client_auth_filter")),
- auth_context(auth_context->Ref(DEBUG_LOCATION, "client_auth_filter")) {}
- ~channel_data() {
- security_connector.reset(DEBUG_LOCATION, "client_auth_filter");
- auth_context.reset(DEBUG_LOCATION, "client_auth_filter");
- }
-
- grpc_core::RefCountedPtr<grpc_channel_security_connector> security_connector;
- grpc_core::RefCountedPtr<grpc_auth_context> auth_context;
-};
-
-/* We can have a per-call credentials. */
-struct call_data {
- call_data(grpc_call_element* elem, const grpc_call_element_args& args)
- : owning_call(args.call_stack), call_combiner(args.call_combiner) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- GPR_ASSERT(args.context != nullptr);
- if (args.context[GRPC_CONTEXT_SECURITY].value == nullptr) {
- args.context[GRPC_CONTEXT_SECURITY].value =
- grpc_client_security_context_create(args.arena, /*creds=*/nullptr);
- args.context[GRPC_CONTEXT_SECURITY].destroy =
- grpc_client_security_context_destroy;
- }
- grpc_client_security_context* sec_ctx =
- static_cast<grpc_client_security_context*>(
- args.context[GRPC_CONTEXT_SECURITY].value);
- sec_ctx->auth_context.reset(DEBUG_LOCATION, "client_auth_filter");
- sec_ctx->auth_context =
- chand->auth_context->Ref(DEBUG_LOCATION, "client_auth_filter");
- }
-
- // This method is technically the dtor of this class. However, since
- // `get_request_metadata_cancel_closure` can run in parallel to
- // `destroy_call_elem`, we cannot call the dtor in them. Otherwise,
- // fields will be accessed after calling dtor, and msan correctly complains
- // that the memory is not initialized.
- void destroy() {
- grpc_credentials_mdelem_array_destroy(&md_array);
- creds.reset();
- grpc_slice_unref_internal(host);
- grpc_slice_unref_internal(method);
- grpc_auth_metadata_context_reset(&auth_md_context);
- }
-
- grpc_call_stack* owning_call;
- grpc_core::CallCombiner* call_combiner;
- grpc_core::RefCountedPtr<grpc_call_credentials> creds;
- grpc_slice host = grpc_empty_slice();
- grpc_slice method = grpc_empty_slice();
- /* pollset{_set} bound to this call; if we need to make external
- network requests, they should be done under a pollset added to this
- pollset_set so that work can progress when this call wants work to progress
- */
- grpc_polling_entity* pollent = nullptr;
- grpc_credentials_mdelem_array md_array;
- grpc_linked_mdelem md_links[MAX_CREDENTIALS_METADATA_COUNT] = {};
- grpc_auth_metadata_context auth_md_context =
- grpc_auth_metadata_context(); // Zero-initialize the C struct.
- grpc_closure async_result_closure;
- grpc_closure check_call_host_cancel_closure;
- grpc_closure get_request_metadata_cancel_closure;
-};
-
-} // namespace
-
void grpc_auth_metadata_context_copy(grpc_auth_metadata_context* from,
grpc_auth_metadata_context* to) {
grpc_auth_metadata_context_reset(to);
@@ -146,330 +77,134 @@ void grpc_auth_metadata_context_reset(
}
}
-static void add_error(grpc_error_handle* combined, grpc_error_handle error) {
- if (error == GRPC_ERROR_NONE) return;
- if (*combined == GRPC_ERROR_NONE) {
- *combined = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Client auth metadata plugin error");
+static grpc_security_level convert_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;
}
- *combined = grpc_error_add_child(*combined, error);
+ return GRPC_SECURITY_NONE;
}
-static void on_credentials_metadata(void* arg, grpc_error_handle input_error) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- grpc_call_element* elem =
- static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- grpc_auth_metadata_context_reset(&calld->auth_md_context);
- grpc_error_handle error = GRPC_ERROR_REF(input_error);
- if (error == GRPC_ERROR_NONE) {
- GPR_ASSERT(calld->md_array.size <= MAX_CREDENTIALS_METADATA_COUNT);
- GPR_ASSERT(batch->send_initial_metadata);
- grpc_metadata_batch* mdb =
- batch->payload->send_initial_metadata.send_initial_metadata;
- for (size_t i = 0; i < calld->md_array.size; ++i) {
- add_error(&error, grpc_metadata_batch_add_tail(
- mdb, &calld->md_links[i],
- GRPC_MDELEM_REF(calld->md_array.md[i])));
- }
- }
- if (error == GRPC_ERROR_NONE) {
- grpc_call_next_op(elem, batch);
- } else {
- error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAVAILABLE);
- grpc_transport_stream_op_batch_finish_with_failure(batch, error,
- calld->call_combiner);
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call, "get_request_metadata");
+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);
}
-void grpc_auth_metadata_context_build(
- const char* url_scheme, const grpc_slice& call_host,
- const grpc_slice& call_method, grpc_auth_context* auth_context,
- grpc_auth_metadata_context* auth_md_context) {
- char* service = grpc_slice_to_c_string(call_method);
- char* last_slash = strrchr(service, '/');
- char* method_name = nullptr;
- char* service_url = nullptr;
- grpc_auth_metadata_context_reset(auth_md_context);
- if (last_slash == nullptr) {
- gpr_log(GPR_ERROR, "No '/' found in fully qualified method name");
- service[0] = '\0';
- method_name = gpr_strdup("");
- } else if (last_slash == service) {
- method_name = gpr_strdup("");
- } else {
- *last_slash = '\0';
- method_name = gpr_strdup(last_slash + 1);
- }
- char* host_and_port = grpc_slice_to_c_string(call_host);
- if (url_scheme != nullptr && strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) {
- /* Remove the port if it is 443. */
- char* port_delimiter = strrchr(host_and_port, ':');
- if (port_delimiter != nullptr && strcmp(port_delimiter + 1, "443") == 0) {
- *port_delimiter = '\0';
- }
- }
- gpr_asprintf(&service_url, "%s://%s%s",
- url_scheme == nullptr ? "" : url_scheme, host_and_port, service);
- auth_md_context->service_url = service_url;
- auth_md_context->method_name = method_name;
- auth_md_context->channel_auth_context =
- auth_context == nullptr
- ? nullptr
- : auth_context->Ref(DEBUG_LOCATION, "grpc_auth_metadata_context")
- .release();
- gpr_free(service);
- gpr_free(host_and_port);
-}
+namespace grpc_core {
-static void cancel_get_request_metadata(void* arg, grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- if (error != GRPC_ERROR_NONE) {
- calld->creds->cancel_get_request_metadata(&calld->md_array,
- GRPC_ERROR_REF(error));
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call, "cancel_get_request_metadata");
-}
+ClientAuthFilter::ClientAuthFilter(
+ RefCountedPtr<grpc_channel_security_connector> security_connector,
+ RefCountedPtr<grpc_auth_context> auth_context)
+ : args_{std::move(security_connector), std::move(auth_context)} {}
-static void send_security_metadata(grpc_call_element* elem,
- grpc_transport_stream_op_batch* batch) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- grpc_client_security_context* ctx =
- static_cast<grpc_client_security_context*>(
- batch->payload->context[GRPC_CONTEXT_SECURITY].value);
+ArenaPromise<absl::StatusOr<CallArgs>> ClientAuthFilter::GetCallCredsMetadata(
+ CallArgs call_args) {
+ auto* ctx = static_cast<grpc_client_security_context*>(
+ GetContext<grpc_call_context_element>()[GRPC_CONTEXT_SECURITY].value);
grpc_call_credentials* channel_call_creds =
- chand->security_connector->mutable_request_metadata_creds();
- int call_creds_has_md = (ctx != nullptr) && (ctx->creds != nullptr);
+ args_.security_connector->mutable_request_metadata_creds();
+ const bool call_creds_has_md = (ctx != nullptr) && (ctx->creds != nullptr);
if (channel_call_creds == nullptr && !call_creds_has_md) {
/* Skip sending metadata altogether. */
- grpc_call_next_op(elem, batch);
- return;
+ return Immediate(absl::StatusOr<CallArgs>(std::move(call_args)));
}
+ RefCountedPtr<grpc_call_credentials> creds;
if (channel_call_creds != nullptr && call_creds_has_md) {
- calld->creds = grpc_core::RefCountedPtr<grpc_call_credentials>(
+ creds = RefCountedPtr<grpc_call_credentials>(
grpc_composite_call_credentials_create(channel_call_creds,
ctx->creds.get(), nullptr));
- if (calld->creds == nullptr) {
- grpc_transport_stream_op_batch_finish_with_failure(
- batch,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Incompatible credentials set on channel and call."),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
- calld->call_combiner);
- return;
+ if (creds == nullptr) {
+ return Immediate(absl::UnauthenticatedError(
+ "Incompatible credentials set on channel and call."));
}
+ } else if (call_creds_has_md) {
+ creds = ctx->creds->Ref();
} else {
- calld->creds =
- call_creds_has_md ? ctx->creds->Ref() : channel_call_creds->Ref();
+ creds = 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);
+ args_.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),
+ return Immediate(
+ absl::UnauthenticatedError("Established channel does not have an auth "
+ "property representing a security level."));
+ }
+ const grpc_security_level call_cred_security_level =
+ creds->min_security_level();
+ const bool is_security_level_ok = grpc_check_security_level(
+ convert_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);
-
- GPR_ASSERT(calld->pollent != nullptr);
- GRPC_CALL_STACK_REF(calld->owning_call, "get_request_metadata");
- GRPC_CLOSURE_INIT(&calld->async_result_closure, on_credentials_metadata,
- batch, grpc_schedule_on_exec_ctx);
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (calld->creds->get_request_metadata(
- calld->pollent, calld->auth_md_context, &calld->md_array,
- &calld->async_result_closure, &error)) {
- // Synchronous return; invoke on_credentials_metadata() directly.
- on_credentials_metadata(batch, error);
- GRPC_ERROR_UNREF(error);
- } else {
- // Async return; register cancellation closure with call combiner.
- // TODO(yashykt): We would not need this ref if call combiners used
- // Closure::Run() instead of ExecCtx::Run()
- GRPC_CALL_STACK_REF(calld->owning_call, "cancel_get_request_metadata");
- calld->call_combiner->SetNotifyOnCancel(GRPC_CLOSURE_INIT(
- &calld->get_request_metadata_cancel_closure,
- cancel_get_request_metadata, elem, grpc_schedule_on_exec_ctx));
- }
-}
-
-static void on_host_checked(void* arg, grpc_error_handle error) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- grpc_call_element* elem =
- static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- if (error == GRPC_ERROR_NONE) {
- send_security_metadata(elem, batch);
- } else {
- std::string error_msg = 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),
- calld->call_combiner);
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call, "check_call_host");
-}
-
-static void cancel_check_call_host(void* arg, grpc_error_handle error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- if (error != GRPC_ERROR_NONE) {
- chand->security_connector->cancel_check_call_host(
- &calld->async_result_closure, GRPC_ERROR_REF(error));
- }
- GRPC_CALL_STACK_UNREF(calld->owning_call, "cancel_check_call_host");
-}
-
-static void client_auth_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- GPR_TIMER_SCOPE("auth_start_transport_stream_op_batch", 0);
-
- /* grab pointers to our data from the call element */
- call_data* calld = static_cast<call_data*>(elem->call_data);
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
-
- if (batch->send_initial_metadata) {
- grpc_metadata_batch* metadata =
- batch->payload->send_initial_metadata.send_initial_metadata;
- if (metadata->idx.named.path != nullptr) {
- calld->method =
- grpc_slice_ref_internal(GRPC_MDVALUE(metadata->idx.named.path->md));
- }
- if (metadata->idx.named.authority != nullptr) {
- calld->host = grpc_slice_ref_internal(
- GRPC_MDVALUE(metadata->idx.named.authority->md));
- batch->handler_private.extra_arg = elem;
- 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);
- absl::string_view call_host(grpc_core::StringViewFromSlice(calld->host));
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (chand->security_connector->check_call_host(
- call_host, chand->auth_context.get(),
- &calld->async_result_closure, &error)) {
- // Synchronous return; invoke on_host_checked() directly.
- on_host_checked(batch, error);
- GRPC_ERROR_UNREF(error);
- } else {
- // Async return; register cancellation closure with call combiner.
- // TODO(yashykt): We would not need this ref if call combiners used
- // Closure::Run() instead of ExecCtx::Run()
- GRPC_CALL_STACK_REF(calld->owning_call, "cancel_check_call_host");
- calld->call_combiner->SetNotifyOnCancel(GRPC_CLOSURE_INIT(
- &calld->check_call_host_cancel_closure, cancel_check_call_host,
- elem, grpc_schedule_on_exec_ctx));
- }
- return; /* early exit */
- }
- }
-
- /* pass control down the stack */
- grpc_call_next_op(elem, batch);
+ return Immediate(absl::UnauthenticatedError(
+ "Established channel does not have a sufficient security level to "
+ "transfer call credential."));
+ }
+
+ auto client_initial_metadata = std::move(call_args.client_initial_metadata);
+ return TrySeq(
+ creds->GetRequestMetadata(std::move(client_initial_metadata), &args_),
+ Capture(
+ [](CallArgs* rest_of_args, ClientMetadataHandle new_metadata) {
+ rest_of_args->client_initial_metadata = std::move(new_metadata);
+ return Immediate<absl::StatusOr<CallArgs>>(
+ absl::StatusOr<CallArgs>(std::move(*rest_of_args)));
+ },
+ std::move(call_args)));
}
-/* Constructor for call_data */
-static grpc_error_handle client_auth_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- new (elem->call_data) call_data(elem, *args);
- return GRPC_ERROR_NONE;
+ArenaPromise<ServerMetadataHandle> ClientAuthFilter::MakeCallPromise(
+ CallArgs call_args, NextPromiseFactory next_promise_factory) {
+ auto* legacy_ctx = GetContext<grpc_call_context_element>();
+ if (legacy_ctx[GRPC_CONTEXT_SECURITY].value == nullptr) {
+ legacy_ctx[GRPC_CONTEXT_SECURITY].value =
+ grpc_client_security_context_create(GetContext<Arena>(),
+ /*creds=*/nullptr);
+ legacy_ctx[GRPC_CONTEXT_SECURITY].destroy =
+ grpc_client_security_context_destroy;
+ }
+ static_cast<grpc_client_security_context*>(
+ legacy_ctx[GRPC_CONTEXT_SECURITY].value)
+ ->auth_context = args_.auth_context;
+
+ auto* host =
+ call_args.client_initial_metadata->get_pointer(HttpAuthorityMetadata());
+ if (host == nullptr) {
+ return next_promise_factory(std::move(call_args));
+ }
+ return TrySeq(args_.security_connector->CheckCallHost(
+ host->as_string_view(), args_.auth_context.get()),
+ GetCallCredsMetadata(std::move(call_args)),
+ next_promise_factory);
}
-static void client_auth_set_pollset_or_pollset_set(
- grpc_call_element* elem, grpc_polling_entity* pollent) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->pollent = pollent;
-}
-
-/* Destructor for call_data */
-static void client_auth_destroy_call_elem(
- grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->destroy();
-}
-
-/* Constructor for channel_data */
-static grpc_error_handle client_auth_init_channel_elem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
- /* The first and the last filters tend to be implemented differently to
- handle the case that there's no 'next' filter to call on the up or down
- path */
- GPR_ASSERT(!args->is_last);
- grpc_security_connector* sc =
- grpc_security_connector_find_in_args(args->channel_args);
+absl::StatusOr<ClientAuthFilter> ClientAuthFilter::Create(ChannelArgs args,
+ ChannelFilter::Args) {
+ auto* sc = args.GetObject<grpc_security_connector>();
if (sc == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ return absl::InvalidArgumentError(
"Security connector missing from client auth filter args");
}
- grpc_auth_context* auth_context =
- grpc_find_auth_context_in_args(args->channel_args);
+ auto* auth_context = args.GetObject<grpc_auth_context>();
if (auth_context == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ return absl::InvalidArgumentError(
"Auth context missing from client auth filter args");
}
- new (elem->channel_data) channel_data(
- static_cast<grpc_channel_security_connector*>(sc), auth_context);
- return GRPC_ERROR_NONE;
-}
-/* Destructor for channel data */
-static void client_auth_destroy_channel_elem(grpc_channel_element* elem) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- chand->~channel_data();
+ return ClientAuthFilter(
+ static_cast<grpc_channel_security_connector*>(sc)->Ref(),
+ auth_context->Ref());
}
-const grpc_channel_filter grpc_client_auth_filter = {
- client_auth_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- client_auth_init_call_elem,
- client_auth_set_pollset_or_pollset_set,
- client_auth_destroy_call_elem,
- sizeof(channel_data),
- client_auth_init_channel_elem,
- client_auth_destroy_channel_elem,
- grpc_channel_next_get_info,
- "client-auth"};
+const grpc_channel_filter ClientAuthFilter::kFilter =
+ MakePromiseBasedFilter<ClientAuthFilter, FilterEndpoint::kClient>(
+ "client-auth-filter");
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/transport/secure_endpoint.cc b/grpc/src/core/lib/security/transport/secure_endpoint.cc
index fc1fb7e8..321b4ca0 100644
--- a/grpc/src/core/lib/security/transport/secure_endpoint.cc
+++ b/grpc/src/core/lib/security/transport/secure_endpoint.cc
@@ -16,26 +16,26 @@
*
*/
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
- using that endpoint. Because of various transitive includes in uv.h,
- including windows.h on Windows, uv.h must be included before other system
- headers. Therefore, sockaddr.h must always be included first */
#include <grpc/support/port_platform.h>
-#include <new>
+#include "src/core/lib/security/transport/secure_endpoint.h"
-#include "src/core/lib/iomgr/sockaddr.h"
+#include <new>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/security/transport/secure_endpoint.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/trace.h"
#include "src/core/lib/security/transport/tsi_error.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -51,6 +51,7 @@ struct secure_endpoint {
tsi_frame_protector* protector,
tsi_zero_copy_grpc_protector* zero_copy_protector,
grpc_endpoint* transport, grpc_slice* leftover_slices,
+ const grpc_channel_args* channel_args,
size_t leftover_nslices)
: wrapped_ep(transport),
protector(protector),
@@ -65,6 +66,17 @@ struct secure_endpoint {
grpc_slice_ref_internal(leftover_slices[i]));
}
grpc_slice_buffer_init(&output_buffer);
+ memory_owner =
+ grpc_core::ResourceQuotaFromChannelArgs(channel_args)
+ ->memory_quota()
+ ->CreateMemoryOwner(absl::StrCat(grpc_endpoint_get_peer(transport),
+ ":secure_endpoint"));
+ self_reservation = memory_owner.MakeReservation(sizeof(*this));
+ read_staging_buffer =
+ memory_owner.MakeSlice(grpc_core::MemoryRequest(STAGING_BUFFER_SIZE));
+ write_staging_buffer =
+ memory_owner.MakeSlice(grpc_core::MemoryRequest(STAGING_BUFFER_SIZE));
+ has_posted_reclaimer.store(false, std::memory_order_relaxed);
gpr_ref_init(&ref, 1);
}
@@ -85,6 +97,8 @@ struct secure_endpoint {
struct tsi_frame_protector* protector;
struct tsi_zero_copy_grpc_protector* zero_copy_protector;
gpr_mu protector_mu;
+ absl::Mutex read_mu;
+ absl::Mutex write_mu;
/* saved upper level callbacks and user_data. */
grpc_closure* read_cb = nullptr;
grpc_closure* write_cb = nullptr;
@@ -94,9 +108,12 @@ struct secure_endpoint {
/* saved handshaker leftover data to unprotect. */
grpc_slice_buffer leftover_bytes;
/* buffers for read and write */
- grpc_slice read_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
- grpc_slice write_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
+ grpc_slice read_staging_buffer ABSL_GUARDED_BY(read_mu);
+ grpc_slice write_staging_buffer ABSL_GUARDED_BY(write_mu);
grpc_slice_buffer output_buffer;
+ grpc_core::MemoryOwner memory_owner;
+ grpc_core::MemoryAllocator::Reservation self_reservation;
+ std::atomic<bool> has_posted_reclaimer;
gpr_refcount ref;
};
@@ -146,10 +163,46 @@ static void secure_endpoint_unref(secure_endpoint* ep) {
static void secure_endpoint_ref(secure_endpoint* ep) { gpr_ref(&ep->ref); }
#endif
+static void maybe_post_reclaimer(secure_endpoint* ep) {
+ if (!ep->has_posted_reclaimer) {
+ SECURE_ENDPOINT_REF(ep, "benign_reclaimer");
+ ep->has_posted_reclaimer.exchange(true, std::memory_order_relaxed);
+ ep->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kBenign,
+ [ep](absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (sweep.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO,
+ "secure endpoint: benign reclamation to free memory");
+ }
+ grpc_slice temp_read_slice;
+ grpc_slice temp_write_slice;
+
+ ep->read_mu.Lock();
+ temp_read_slice = ep->read_staging_buffer;
+ ep->read_staging_buffer = grpc_empty_slice();
+ ep->read_mu.Unlock();
+
+ ep->write_mu.Lock();
+ temp_write_slice = ep->write_staging_buffer;
+ ep->write_staging_buffer = grpc_empty_slice();
+ ep->write_mu.Unlock();
+
+ grpc_slice_unref_internal(temp_read_slice);
+ grpc_slice_unref_internal(temp_write_slice);
+ ep->has_posted_reclaimer.exchange(false, std::memory_order_relaxed);
+ }
+ SECURE_ENDPOINT_UNREF(ep, "benign_reclaimer");
+ });
+ }
+}
+
static void flush_read_staging_buffer(secure_endpoint* ep, uint8_t** cur,
- uint8_t** end) {
- grpc_slice_buffer_add(ep->read_buffer, ep->read_staging_buffer);
- ep->read_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
+ uint8_t** end)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(ep->read_mu) {
+ grpc_slice_buffer_add_indexed(ep->read_buffer, ep->read_staging_buffer);
+ ep->read_staging_buffer =
+ ep->memory_owner.MakeSlice(grpc_core::MemoryRequest(STAGING_BUFFER_SIZE));
*cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
*end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
}
@@ -174,68 +227,73 @@ static void on_read(void* user_data, grpc_error_handle error) {
uint8_t keep_looping = 0;
tsi_result result = TSI_OK;
secure_endpoint* ep = static_cast<secure_endpoint*>(user_data);
- uint8_t* cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
- uint8_t* end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
- if (error != GRPC_ERROR_NONE) {
- grpc_slice_buffer_reset_and_unref_internal(ep->read_buffer);
- call_read_cb(ep, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Secure read failed", &error, 1));
- return;
- }
+ {
+ absl::MutexLock l(&ep->read_mu);
+ uint8_t* cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
+ uint8_t* end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
- if (ep->zero_copy_protector != nullptr) {
- // Use zero-copy grpc protector to unprotect.
- result = tsi_zero_copy_grpc_protector_unprotect(
- ep->zero_copy_protector, &ep->source_buffer, ep->read_buffer);
- } else {
- // Use frame protector to unprotect.
- /* TODO(yangg) check error, maybe bail out early */
- for (i = 0; i < ep->source_buffer.count; i++) {
- grpc_slice encrypted = ep->source_buffer.slices[i];
- uint8_t* message_bytes = GRPC_SLICE_START_PTR(encrypted);
- size_t message_size = GRPC_SLICE_LENGTH(encrypted);
-
- while (message_size > 0 || keep_looping) {
- size_t unprotected_buffer_size_written = static_cast<size_t>(end - cur);
- size_t processed_message_size = message_size;
- gpr_mu_lock(&ep->protector_mu);
- result = tsi_frame_protector_unprotect(
- ep->protector, message_bytes, &processed_message_size, cur,
- &unprotected_buffer_size_written);
- gpr_mu_unlock(&ep->protector_mu);
- if (result != TSI_OK) {
- gpr_log(GPR_ERROR, "Decryption error: %s",
- tsi_result_to_string(result));
- break;
- }
- message_bytes += processed_message_size;
- message_size -= processed_message_size;
- cur += unprotected_buffer_size_written;
-
- if (cur == end) {
- flush_read_staging_buffer(ep, &cur, &end);
- /* Force to enter the loop again to extract buffered bytes in
- protector. The bytes could be buffered because of running out of
- staging_buffer. If this happens at the end of all slices, doing
- another unprotect avoids leaving data in the protector. */
- keep_looping = 1;
- } else if (unprotected_buffer_size_written > 0) {
- keep_looping = 1;
- } else {
- keep_looping = 0;
+ if (error != GRPC_ERROR_NONE) {
+ grpc_slice_buffer_reset_and_unref_internal(ep->read_buffer);
+ call_read_cb(ep, GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Secure read failed", &error, 1));
+ return;
+ }
+
+ if (ep->zero_copy_protector != nullptr) {
+ // Use zero-copy grpc protector to unprotect.
+ result = tsi_zero_copy_grpc_protector_unprotect(
+ ep->zero_copy_protector, &ep->source_buffer, ep->read_buffer);
+ } else {
+ // Use frame protector to unprotect.
+ /* TODO(yangg) check error, maybe bail out early */
+ for (i = 0; i < ep->source_buffer.count; i++) {
+ grpc_slice encrypted = ep->source_buffer.slices[i];
+ uint8_t* message_bytes = GRPC_SLICE_START_PTR(encrypted);
+ size_t message_size = GRPC_SLICE_LENGTH(encrypted);
+
+ while (message_size > 0 || keep_looping) {
+ size_t unprotected_buffer_size_written =
+ static_cast<size_t>(end - cur);
+ size_t processed_message_size = message_size;
+ gpr_mu_lock(&ep->protector_mu);
+ result = tsi_frame_protector_unprotect(
+ ep->protector, message_bytes, &processed_message_size, cur,
+ &unprotected_buffer_size_written);
+ gpr_mu_unlock(&ep->protector_mu);
+ if (result != TSI_OK) {
+ gpr_log(GPR_ERROR, "Decryption error: %s",
+ tsi_result_to_string(result));
+ break;
+ }
+ message_bytes += processed_message_size;
+ message_size -= processed_message_size;
+ cur += unprotected_buffer_size_written;
+
+ if (cur == end) {
+ flush_read_staging_buffer(ep, &cur, &end);
+ /* Force to enter the loop again to extract buffered bytes in
+ protector. The bytes could be buffered because of running out of
+ staging_buffer. If this happens at the end of all slices, doing
+ another unprotect avoids leaving data in the protector. */
+ keep_looping = 1;
+ } else if (unprotected_buffer_size_written > 0) {
+ keep_looping = 1;
+ } else {
+ keep_looping = 0;
+ }
}
+ if (result != TSI_OK) break;
}
- if (result != TSI_OK) break;
- }
- if (cur != GRPC_SLICE_START_PTR(ep->read_staging_buffer)) {
- grpc_slice_buffer_add(
- ep->read_buffer,
- grpc_slice_split_head(
- &ep->read_staging_buffer,
- static_cast<size_t>(
- cur - GRPC_SLICE_START_PTR(ep->read_staging_buffer))));
+ if (cur != GRPC_SLICE_START_PTR(ep->read_staging_buffer)) {
+ grpc_slice_buffer_add(
+ ep->read_buffer,
+ grpc_slice_split_head(
+ &ep->read_staging_buffer,
+ static_cast<size_t>(
+ cur - GRPC_SLICE_START_PTR(ep->read_staging_buffer))));
+ }
}
}
@@ -273,11 +331,14 @@ static void endpoint_read(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
}
static void flush_write_staging_buffer(secure_endpoint* ep, uint8_t** cur,
- uint8_t** end) {
- grpc_slice_buffer_add(&ep->output_buffer, ep->write_staging_buffer);
- ep->write_staging_buffer = GRPC_SLICE_MALLOC(STAGING_BUFFER_SIZE);
+ uint8_t** end)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(ep->write_mu) {
+ grpc_slice_buffer_add_indexed(&ep->output_buffer, ep->write_staging_buffer);
+ ep->write_staging_buffer =
+ ep->memory_owner.MakeSlice(grpc_core::MemoryRequest(STAGING_BUFFER_SIZE));
*cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
*end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
+ maybe_post_reclaimer(ep);
}
static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
@@ -287,75 +348,79 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
unsigned i;
tsi_result result = TSI_OK;
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
- uint8_t* cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
- uint8_t* end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
-
- grpc_slice_buffer_reset_and_unref_internal(&ep->output_buffer);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint)) {
- 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: %s", ep, data);
- gpr_free(data);
- }
- }
+ {
+ absl::MutexLock l(&ep->write_mu);
+ uint8_t* cur = GRPC_SLICE_START_PTR(ep->write_staging_buffer);
+ uint8_t* end = GRPC_SLICE_END_PTR(ep->write_staging_buffer);
- if (ep->zero_copy_protector != nullptr) {
- // Use zero-copy grpc protector to protect.
- result = tsi_zero_copy_grpc_protector_protect(ep->zero_copy_protector,
- slices, &ep->output_buffer);
- } else {
- // Use frame protector to protect.
- for (i = 0; i < slices->count; i++) {
- grpc_slice plain = slices->slices[i];
- uint8_t* message_bytes = GRPC_SLICE_START_PTR(plain);
- size_t message_size = GRPC_SLICE_LENGTH(plain);
- while (message_size > 0) {
- size_t protected_buffer_size_to_send = static_cast<size_t>(end - cur);
- size_t processed_message_size = message_size;
- gpr_mu_lock(&ep->protector_mu);
- result = tsi_frame_protector_protect(ep->protector, message_bytes,
- &processed_message_size, cur,
- &protected_buffer_size_to_send);
- gpr_mu_unlock(&ep->protector_mu);
- if (result != TSI_OK) {
- gpr_log(GPR_ERROR, "Encryption error: %s",
- tsi_result_to_string(result));
- break;
- }
- message_bytes += processed_message_size;
- message_size -= processed_message_size;
- cur += protected_buffer_size_to_send;
+ grpc_slice_buffer_reset_and_unref_internal(&ep->output_buffer);
- if (cur == end) {
- flush_write_staging_buffer(ep, &cur, &end);
- }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint)) {
+ 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: %s", ep, data);
+ gpr_free(data);
}
- if (result != TSI_OK) break;
}
- if (result == TSI_OK) {
- size_t still_pending_size;
- do {
- size_t protected_buffer_size_to_send = static_cast<size_t>(end - cur);
- gpr_mu_lock(&ep->protector_mu);
- result = tsi_frame_protector_protect_flush(
- ep->protector, cur, &protected_buffer_size_to_send,
- &still_pending_size);
- gpr_mu_unlock(&ep->protector_mu);
+
+ if (ep->zero_copy_protector != nullptr) {
+ // Use zero-copy grpc protector to protect.
+ result = tsi_zero_copy_grpc_protector_protect(ep->zero_copy_protector,
+ slices, &ep->output_buffer);
+ } else {
+ // Use frame protector to protect.
+ for (i = 0; i < slices->count; i++) {
+ grpc_slice plain = slices->slices[i];
+ uint8_t* message_bytes = GRPC_SLICE_START_PTR(plain);
+ size_t message_size = GRPC_SLICE_LENGTH(plain);
+ while (message_size > 0) {
+ size_t protected_buffer_size_to_send = static_cast<size_t>(end - cur);
+ size_t processed_message_size = message_size;
+ gpr_mu_lock(&ep->protector_mu);
+ result = tsi_frame_protector_protect(ep->protector, message_bytes,
+ &processed_message_size, cur,
+ &protected_buffer_size_to_send);
+ gpr_mu_unlock(&ep->protector_mu);
+ if (result != TSI_OK) {
+ gpr_log(GPR_ERROR, "Encryption error: %s",
+ tsi_result_to_string(result));
+ break;
+ }
+ message_bytes += processed_message_size;
+ message_size -= processed_message_size;
+ cur += protected_buffer_size_to_send;
+
+ if (cur == end) {
+ flush_write_staging_buffer(ep, &cur, &end);
+ }
+ }
if (result != TSI_OK) break;
- cur += protected_buffer_size_to_send;
- if (cur == end) {
- flush_write_staging_buffer(ep, &cur, &end);
+ }
+ if (result == TSI_OK) {
+ size_t still_pending_size;
+ do {
+ size_t protected_buffer_size_to_send = static_cast<size_t>(end - cur);
+ gpr_mu_lock(&ep->protector_mu);
+ result = tsi_frame_protector_protect_flush(
+ ep->protector, cur, &protected_buffer_size_to_send,
+ &still_pending_size);
+ gpr_mu_unlock(&ep->protector_mu);
+ if (result != TSI_OK) break;
+ cur += protected_buffer_size_to_send;
+ if (cur == end) {
+ flush_write_staging_buffer(ep, &cur, &end);
+ }
+ } while (still_pending_size > 0);
+ if (cur != GRPC_SLICE_START_PTR(ep->write_staging_buffer)) {
+ grpc_slice_buffer_add(
+ &ep->output_buffer,
+ grpc_slice_split_head(
+ &ep->write_staging_buffer,
+ static_cast<size_t>(
+ cur - GRPC_SLICE_START_PTR(ep->write_staging_buffer))));
}
- } while (still_pending_size > 0);
- if (cur != GRPC_SLICE_START_PTR(ep->write_staging_buffer)) {
- grpc_slice_buffer_add(
- &ep->output_buffer,
- grpc_slice_split_head(
- &ep->write_staging_buffer,
- static_cast<size_t>(
- cur - GRPC_SLICE_START_PTR(ep->write_staging_buffer))));
}
}
}
@@ -380,6 +445,7 @@ static void endpoint_shutdown(grpc_endpoint* secure_ep, grpc_error_handle why) {
static void endpoint_destroy(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
+ ep->memory_owner.Reset();
SECURE_ENDPOINT_UNREF(ep, "destroy");
}
@@ -416,12 +482,6 @@ static int endpoint_get_fd(grpc_endpoint* secure_ep) {
return grpc_endpoint_get_fd(ep->wrapped_ep);
}
-static grpc_resource_user* endpoint_get_resource_user(
- grpc_endpoint* secure_ep) {
- secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
- return grpc_endpoint_get_resource_user(ep->wrapped_ep);
-}
-
static bool endpoint_can_track_err(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
return grpc_endpoint_can_track_err(ep->wrapped_ep);
@@ -434,7 +494,6 @@ static const grpc_endpoint_vtable vtable = {endpoint_read,
endpoint_delete_from_pollset_set,
endpoint_shutdown,
endpoint_destroy,
- endpoint_get_resource_user,
endpoint_get_peer,
endpoint_get_local_address,
endpoint_get_fd,
@@ -444,9 +503,9 @@ grpc_endpoint* grpc_secure_endpoint_create(
struct tsi_frame_protector* protector,
struct tsi_zero_copy_grpc_protector* zero_copy_protector,
grpc_endpoint* to_wrap, grpc_slice* leftover_slices,
- size_t leftover_nslices) {
+ const grpc_channel_args* channel_args, size_t leftover_nslices) {
secure_endpoint* ep =
new secure_endpoint(&vtable, protector, zero_copy_protector, to_wrap,
- leftover_slices, leftover_nslices);
+ leftover_slices, channel_args, leftover_nslices);
return &ep->base;
}
diff --git a/grpc/src/core/lib/security/transport/secure_endpoint.h b/grpc/src/core/lib/security/transport/secure_endpoint.h
index e7e33516..163d718b 100644
--- a/grpc/src/core/lib/security/transport/secure_endpoint.h
+++ b/grpc/src/core/lib/security/transport/secure_endpoint.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/iomgr/endpoint.h"
struct tsi_frame_protector;
@@ -36,6 +37,6 @@ grpc_endpoint* grpc_secure_endpoint_create(
struct tsi_frame_protector* protector,
struct tsi_zero_copy_grpc_protector* zero_copy_protector,
grpc_endpoint* to_wrap, grpc_slice* leftover_slices,
- size_t leftover_nslices);
+ const grpc_channel_args* channel_args, size_t leftover_nslices);
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */
diff --git a/grpc/src/core/lib/security/transport/security_handshaker.cc b/grpc/src/core/lib/security/transport/security_handshaker.cc
index 6d05c970..0b71bea5 100644
--- a/grpc/src/core/lib/security/transport/security_handshaker.cc
+++ b/grpc/src/core/lib/security/transport/security_handshaker.cc
@@ -22,6 +22,7 @@
#include <stdbool.h>
#include <string.h>
+
#include <limits>
#include <grpc/slice_buffer.h>
@@ -31,7 +32,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/handshaker.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/transport/secure_endpoint.h"
@@ -115,13 +116,10 @@ SecurityHandshaker::SecurityHandshaker(tsi_handshaker* handshaker,
connector_(connector->Ref(DEBUG_LOCATION, "handshake")),
handshake_buffer_size_(GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE),
handshake_buffer_(
- static_cast<uint8_t*>(gpr_malloc(handshake_buffer_size_))) {
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
- if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
- max_frame_size_ = grpc_channel_arg_get_integer(
- arg, {0, 0, std::numeric_limits<int>::max()});
- }
+ static_cast<uint8_t*>(gpr_malloc(handshake_buffer_size_))),
+ max_frame_size_(grpc_channel_args_find_integer(
+ args, GRPC_ARG_TSI_MAX_FRAME_SIZE,
+ {0, 0, std::numeric_limits<int>::max()})) {
grpc_slice_buffer_init(&outgoing_);
GRPC_CLOSURE_INIT(&on_peer_checked_, &SecurityHandshaker::OnPeerCheckedFn,
this, grpc_schedule_on_exec_ctx);
@@ -231,56 +229,100 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
HandshakeFailedLocked(error);
return;
}
- // Create zero-copy frame protector, if implemented.
- tsi_zero_copy_grpc_protector* zero_copy_protector = nullptr;
- tsi_result result = tsi_handshaker_result_create_zero_copy_grpc_protector(
- handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
- &zero_copy_protector);
- if (result != TSI_OK && result != TSI_UNIMPLEMENTED) {
- error = grpc_set_tsi_error_result(
+ // Get unused bytes.
+ const unsigned char* unused_bytes = nullptr;
+ size_t unused_bytes_size = 0;
+ tsi_result result = tsi_handshaker_result_get_unused_bytes(
+ handshaker_result_, &unused_bytes, &unused_bytes_size);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Zero-copy frame protector creation failed"),
- result);
- HandshakeFailedLocked(error);
+ "TSI handshaker result does not provide unused bytes"),
+ result));
+ return;
+ }
+ // Check whether we need to wrap the endpoint.
+ tsi_frame_protector_type frame_protector_type;
+ result = tsi_handshaker_result_get_frame_protector_type(
+ handshaker_result_, &frame_protector_type);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TSI handshaker result does not implement "
+ "get_frame_protector_type"),
+ result));
return;
}
- // Create frame protector if zero-copy frame protector is NULL.
+ tsi_zero_copy_grpc_protector* zero_copy_protector = nullptr;
tsi_frame_protector* protector = nullptr;
- if (zero_copy_protector == nullptr) {
- result = tsi_handshaker_result_create_frame_protector(
- handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
- &protector);
- if (result != TSI_OK) {
- error = grpc_set_tsi_error_result(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Frame protector creation failed"),
- result);
- HandshakeFailedLocked(error);
- return;
- }
+ switch (frame_protector_type) {
+ case TSI_FRAME_PROTECTOR_ZERO_COPY:
+ ABSL_FALLTHROUGH_INTENDED;
+ case TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY:
+ // Create zero-copy frame protector.
+ result = tsi_handshaker_result_create_zero_copy_grpc_protector(
+ handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
+ &zero_copy_protector);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Zero-copy frame protector creation failed"),
+ result));
+ return;
+ }
+ break;
+ case TSI_FRAME_PROTECTOR_NORMAL:
+ // Create normal frame protector.
+ result = tsi_handshaker_result_create_frame_protector(
+ handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
+ &protector);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(
+ grpc_set_tsi_error_result(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Frame protector creation failed"),
+ result));
+ return;
+ }
+ break;
+ case TSI_FRAME_PROTECTOR_NONE:
+ break;
}
- // Get unused bytes.
- const unsigned char* unused_bytes = nullptr;
- size_t unused_bytes_size = 0;
- result = tsi_handshaker_result_get_unused_bytes(
- handshaker_result_, &unused_bytes, &unused_bytes_size);
- // Create secure endpoint.
- if (unused_bytes_size > 0) {
+ bool has_frame_protector =
+ zero_copy_protector != nullptr || protector != nullptr;
+ // If we have a frame protector, create a secure endpoint.
+ if (has_frame_protector) {
+ if (unused_bytes_size > 0) {
+ grpc_slice slice = grpc_slice_from_copied_buffer(
+ reinterpret_cast<const char*>(unused_bytes), unused_bytes_size);
+ args_->endpoint =
+ grpc_secure_endpoint_create(protector, zero_copy_protector,
+ args_->endpoint, &slice, args_->args, 1);
+ grpc_slice_unref_internal(slice);
+ } else {
+ args_->endpoint =
+ grpc_secure_endpoint_create(protector, zero_copy_protector,
+ args_->endpoint, nullptr, args_->args, 0);
+ }
+ } else if (unused_bytes_size > 0) {
+ // Not wrapping the endpoint, so just pass along unused bytes.
grpc_slice slice = grpc_slice_from_copied_buffer(
reinterpret_cast<const char*>(unused_bytes), unused_bytes_size);
- args_->endpoint = grpc_secure_endpoint_create(
- protector, zero_copy_protector, args_->endpoint, &slice, 1);
- grpc_slice_unref_internal(slice);
- } else {
- args_->endpoint = grpc_secure_endpoint_create(
- protector, zero_copy_protector, args_->endpoint, nullptr, 0);
+ grpc_slice_buffer_add(args_->read_buffer, slice);
}
+ // Done with handshaker result.
tsi_handshaker_result_destroy(handshaker_result_);
handshaker_result_ = nullptr;
- // Add auth context to channel args.
- absl::InlinedVector<grpc_arg, 2> args_to_add;
- args_to_add.push_back(grpc_auth_context_to_arg(auth_context_.get()));
- auto security = MakeChannelzSecurityFromAuthContext(auth_context_.get());
- args_to_add.push_back(security->MakeChannelArg());
+ absl::InlinedVector<grpc_arg, 2> args_to_add = {
+ // Add auth context to channel args.
+ grpc_auth_context_to_arg(auth_context_.get()),
+ };
+ RefCountedPtr<channelz::SocketNode::Security> channelz_security;
+ // Add channelz channel args only if frame protector is created.
+ if (has_frame_protector) {
+ channelz_security =
+ MakeChannelzSecurityFromAuthContext(auth_context_.get());
+ args_to_add.push_back(channelz_security->MakeChannelArg());
+ }
grpc_channel_args* tmp_args = args_->args;
args_->args = grpc_channel_args_copy_and_add(tmp_args, args_to_add.data(),
args_to_add.size());
@@ -408,7 +450,7 @@ grpc_error_handle SecurityHandshaker::DoHandshakerNextLocked(
void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler(
void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
+ ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_received_from_peer_,
&SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn,
@@ -429,7 +471,6 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(
size_t bytes_received_size = h->MoveReadBufferIntoHandshakeBuffer();
// Call TSI handshaker.
error = h->DoHandshakerNextLocked(h->handshake_buffer_, bytes_received_size);
-
if (error != GRPC_ERROR_NONE) {
h->HandshakeFailedLocked(error);
} else {
@@ -442,7 +483,7 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(
void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler(
void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
+ ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer_,
&SecurityHandshaker::OnHandshakeDataSentToPeerFn, h,
@@ -521,10 +562,18 @@ class FailHandshaker : public Handshaker {
void Shutdown(grpc_error_handle why) override { GRPC_ERROR_UNREF(why); }
void DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
grpc_closure* on_handshake_done,
- HandshakerArgs* /*args*/) override {
- ExecCtx::Run(DEBUG_LOCATION, on_handshake_done,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Failed to create security handshaker"));
+ HandshakerArgs* args) override {
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Failed to create security handshaker");
+ grpc_endpoint_shutdown(args->endpoint, GRPC_ERROR_REF(error));
+ grpc_endpoint_destroy(args->endpoint);
+ args->endpoint = nullptr;
+ grpc_channel_args_destroy(args->args);
+ args->args = nullptr;
+ grpc_slice_buffer_destroy_internal(args->read_buffer);
+ gpr_free(args->read_buffer);
+ args->read_buffer = nullptr;
+ ExecCtx::Run(DEBUG_LOCATION, on_handshake_done, error);
}
private:
@@ -585,11 +634,11 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
}
}
-void SecurityRegisterHandshakerFactories() {
- HandshakerRegistry::RegisterHandshakerFactory(
+void SecurityRegisterHandshakerFactories(CoreConfiguration::Builder* builder) {
+ builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_CLIENT,
absl::make_unique<ClientSecurityHandshakerFactory>());
- HandshakerRegistry::RegisterHandshakerFactory(
+ builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_SERVER,
absl::make_unique<ServerSecurityHandshakerFactory>());
}
diff --git a/grpc/src/core/lib/security/transport/security_handshaker.h b/grpc/src/core/lib/security/transport/security_handshaker.h
index a9e1fe83..8f4ab8b2 100644
--- a/grpc/src/core/lib/security/transport/security_handshaker.h
+++ b/grpc/src/core/lib/security/transport/security_handshaker.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/handshaker.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/security/security_connector/security_connector.h"
namespace grpc_core {
@@ -32,7 +33,7 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
const grpc_channel_args* args);
/// Registers security handshaker factories.
-void SecurityRegisterHandshakerFactories();
+void SecurityRegisterHandshakerFactories(CoreConfiguration::Builder*);
} // namespace grpc_core
diff --git a/grpc/src/core/lib/security/transport/server_auth_filter.cc b/grpc/src/core/lib/security/transport/server_auth_filter.cc
index 65a7e405..18522852 100644
--- a/grpc/src/core/lib/security/transport/server_auth_filter.cc
+++ b/grpc/src/core/lib/security/transport/server_auth_filter.cc
@@ -86,51 +86,55 @@ struct call_data {
grpc_error_handle recv_trailing_metadata_error;
bool seen_recv_trailing_metadata_ready = false;
grpc_metadata_array md;
- const grpc_metadata* consumed_md;
- size_t num_consumed_md;
grpc_closure cancel_closure;
gpr_atm state = STATE_INIT; // async_state
};
+class ArrayEncoder {
+ public:
+ explicit ArrayEncoder(grpc_metadata_array* result) : result_(result) {}
+
+ void Encode(const grpc_core::Slice& key, const grpc_core::Slice& value) {
+ Append(key.Ref(), value.Ref());
+ }
+
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ Append(grpc_core::Slice(
+ grpc_core::StaticSlice::FromStaticString(Which::key())),
+ grpc_core::Slice(Which::Encode(value)));
+ }
+
+ void Encode(grpc_core::HttpMethodMetadata,
+ const typename grpc_core::HttpMethodMetadata::ValueType&) {}
+
+ private:
+ void Append(grpc_core::Slice key, grpc_core::Slice value) {
+ if (result_->count == result_->capacity) {
+ result_->capacity =
+ std::max(result_->capacity + 8, result_->capacity * 2);
+ result_->metadata = static_cast<grpc_metadata*>(gpr_realloc(
+ result_->metadata, result_->capacity * sizeof(grpc_metadata)));
+ }
+ auto* usr_md = &result_->metadata[result_->count++];
+ usr_md->key = key.TakeCSlice();
+ usr_md->value = value.TakeCSlice();
+ }
+
+ grpc_metadata_array* result_;
+};
+
} // namespace
static grpc_metadata_array metadata_batch_to_md_array(
const grpc_metadata_batch* batch) {
- grpc_linked_mdelem* l;
grpc_metadata_array result;
grpc_metadata_array_init(&result);
- for (l = batch->list.head; l != nullptr; l = l->next) {
- grpc_metadata* usr_md = nullptr;
- grpc_mdelem md = l->md;
- grpc_slice key = GRPC_MDKEY(md);
- grpc_slice value = GRPC_MDVALUE(md);
- if (result.count == result.capacity) {
- result.capacity = GPR_MAX(result.capacity + 8, result.capacity * 2);
- result.metadata = static_cast<grpc_metadata*>(gpr_realloc(
- result.metadata, result.capacity * sizeof(grpc_metadata)));
- }
- usr_md = &result.metadata[result.count++];
- usr_md->key = grpc_slice_ref_internal(key);
- usr_md->value = grpc_slice_ref_internal(value);
- }
+ ArrayEncoder encoder(&result);
+ batch->Encode(&encoder);
return result;
}
-static grpc_filtered_mdelem remove_consumed_md(void* user_data,
- grpc_mdelem md) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
- size_t i;
- for (i = 0; i < calld->num_consumed_md; i++) {
- const grpc_metadata* consumed_md = &calld->consumed_md[i];
- if (grpc_slice_eq(GRPC_MDKEY(md), consumed_md->key) &&
- grpc_slice_eq(GRPC_MDVALUE(md), consumed_md->value)) {
- return GRPC_FILTERED_REMOVE();
- }
- }
- return GRPC_FILTERED_MDELEM(md);
-}
-
static void on_md_processing_done_inner(grpc_call_element* elem,
const grpc_metadata* consumed_md,
size_t num_consumed_md,
@@ -146,11 +150,10 @@ static void on_md_processing_done_inner(grpc_call_element* elem,
"Ignoring...");
}
if (error == GRPC_ERROR_NONE) {
- calld->consumed_md = consumed_md;
- calld->num_consumed_md = num_consumed_md;
- error = grpc_metadata_batch_filter(
- batch->payload->recv_initial_metadata.recv_initial_metadata,
- remove_consumed_md, elem, "Response metadata filtering error");
+ for (size_t i = 0; i < num_consumed_md; i++) {
+ batch->payload->recv_initial_metadata.recv_initial_metadata->Remove(
+ grpc_core::StringViewFromSlice(consumed_md[i].key));
+ }
}
calld->recv_initial_metadata_error = GRPC_ERROR_REF(error);
grpc_closure* closure = calld->original_recv_initial_metadata_ready;
@@ -306,13 +309,6 @@ static grpc_error_handle server_auth_init_channel_elem(
GPR_ASSERT(!args->is_last);
grpc_auth_context* auth_context =
grpc_find_auth_context_in_args(args->channel_args);
- if (auth_context == nullptr) {
- grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No authorization context found. This might be a TRANSIENT failure due "
- "to certificates not having been loaded yet.");
- gpr_log(GPR_DEBUG, "%s", grpc_error_std_string(error).c_str());
- return error;
- }
GPR_ASSERT(auth_context != nullptr);
grpc_server_credentials* creds =
grpc_find_server_credentials_in_args(args->channel_args);
@@ -328,6 +324,7 @@ static void server_auth_destroy_channel_elem(grpc_channel_element* elem) {
const grpc_channel_filter grpc_server_auth_filter = {
server_auth_start_transport_stream_op_batch,
+ nullptr,
grpc_channel_next_op,
sizeof(call_data),
server_auth_init_call_elem,
diff --git a/grpc/src/core/lib/security/transport/tsi_error.cc b/grpc/src/core/lib/security/transport/tsi_error.cc
index 4d337b46..23b10811 100644
--- a/grpc/src/core/lib/security/transport/tsi_error.cc
+++ b/grpc/src/core/lib/security/transport/tsi_error.cc
@@ -22,9 +22,7 @@
grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error,
tsi_result result) {
- return grpc_error_set_int(
- grpc_error_set_str(
- error, GRPC_ERROR_STR_TSI_ERROR,
- grpc_slice_from_static_string(tsi_result_to_string(result))),
- GRPC_ERROR_INT_TSI_CODE, result);
+ return grpc_error_set_int(grpc_error_set_str(error, GRPC_ERROR_STR_TSI_ERROR,
+ tsi_result_to_string(result)),
+ GRPC_ERROR_INT_TSI_CODE, result);
}
diff --git a/grpc/src/core/lib/security/util/json_util.cc b/grpc/src/core/lib/security/util/json_util.cc
index 34bf88f4..25223eef 100644
--- a/grpc/src/core/lib/security/util/json_util.cc
+++ b/grpc/src/core/lib/security/util/json_util.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/util/json_util.h"
+
#include <string.h>
#include "absl/strings/str_cat.h"
@@ -26,7 +28,6 @@
#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,
const char* prop_name,
@@ -41,18 +42,15 @@ const char* grpc_json_get_string_property(const grpc_core::Json& json,
auto it = json.object_value().find(prop_name);
if (it == json.object_value().end()) {
if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Property ", prop_name, " not found in JSON object.")
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Property ", prop_name, " not found in JSON object."));
}
return nullptr;
}
if (it->second.type() != grpc_core::Json::Type::STRING) {
if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- absl::StrCat("Property ", prop_name,
- " n JSON object is not a string.")
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrCat(
+ "Property ", prop_name, " n JSON object is not a string."));
}
return nullptr;
}
diff --git a/grpc/src/core/lib/service_config/service_config.h b/grpc/src/core/lib/service_config/service_config.h
new file mode 100644
index 00000000..76a882d7
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config.h
@@ -0,0 +1,82 @@
+//
+// 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_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H
+#define GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <unordered_map>
+#include <vector>
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/string_util.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/service_config/service_config_parser.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:
+//
+// {
+// "loadBalancingPolicy": "string", // optional
+// "methodConfig": [ // array of one or more method_config objects
+// {
+// "name": [ // array of one or more name objects
+// {
+// "service": "string", // required
+// "method": "string", // optional
+// }
+// ],
+// // remaining fields are optional.
+// // see https://developers.google.com/protocol-buffers/docs/proto3#json
+// // for format details.
+// "waitForReady": bool,
+// "timeout": "duration_string",
+// "maxRequestMessageBytes": "int64_string",
+// "maxResponseMessageBytes": "int64_string",
+// }
+// ]
+// }
+
+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.
+class ServiceConfig : public RefCounted<ServiceConfig> {
+ public:
+ virtual absl::string_view json_string() const = 0;
+
+ /// Retrieves the global parsed config at index \a index. The
+ /// lifetime of the returned object is tied to the lifetime of the
+ /// ServiceConfig object.
+ virtual ServiceConfigParser::ParsedConfig* GetGlobalParsedConfig(
+ size_t index) = 0;
+
+ /// 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.
+ virtual const ServiceConfigParser::ParsedConfigVector*
+ GetMethodParsedConfigVector(const grpc_slice& path) const = 0;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H */
diff --git a/grpc/src/core/lib/service_config/service_config_call_data.h b/grpc/src/core/lib/service_config/service_config_call_data.h
new file mode 100644
index 00000000..8d5041e1
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config_call_data.h
@@ -0,0 +1,72 @@
+//
+// 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_LIB_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H
+#define GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+
+#include "absl/strings/string_view.h"
+
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/service_config/service_config.h"
+#include "src/core/lib/service_config/service_config_parser.h"
+
+namespace grpc_core {
+
+/// Stores the service config data associated with an individual call.
+/// A pointer to this object is stored in the call_context
+/// GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA element, so that filters can
+/// easily access method and global parameters for the call.
+class ServiceConfigCallData {
+ public:
+ using CallAttributes = std::map<const char*, absl::string_view>;
+
+ ServiceConfigCallData() : method_configs_(nullptr) {}
+
+ ServiceConfigCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_configs,
+ CallAttributes call_attributes)
+ : service_config_(std::move(service_config)),
+ method_configs_(method_configs),
+ call_attributes_(std::move(call_attributes)) {}
+
+ 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);
+ }
+
+ const CallAttributes& call_attributes() const { return call_attributes_; }
+
+ private:
+ RefCountedPtr<ServiceConfig> service_config_;
+ const ServiceConfigParser::ParsedConfigVector* method_configs_;
+ CallAttributes call_attributes_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H */
diff --git a/grpc/src/core/lib/service_config/service_config_impl.cc b/grpc/src/core/lib/service_config/service_config_impl.cc
new file mode 100644
index 00000000..5f17d674
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config_impl.cc
@@ -0,0 +1,230 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/service_config/service_config_impl.h"
+
+#include <string>
+
+#include "absl/strings/str_cat.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/service_config/service_config_parser.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+namespace grpc_core {
+
+RefCountedPtr<ServiceConfig> ServiceConfigImpl::Create(
+ const grpc_channel_args* args, absl::string_view json_string,
+ grpc_error_handle* error) {
+ GPR_DEBUG_ASSERT(error != nullptr);
+ Json json = Json::Parse(json_string, error);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ return MakeRefCounted<ServiceConfigImpl>(args, std::string(json_string),
+ std::move(json), error);
+}
+
+ServiceConfigImpl::ServiceConfigImpl(const grpc_channel_args* args,
+ std::string json_string, Json json,
+ grpc_error_handle* 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");
+ return;
+ }
+ std::vector<grpc_error_handle> error_list;
+ grpc_error_handle global_error = GRPC_ERROR_NONE;
+ parsed_global_configs_ =
+ CoreConfiguration::Get().service_config_parser().ParseGlobalParameters(
+ args, json_, &global_error);
+ if (global_error != GRPC_ERROR_NONE) error_list.push_back(global_error);
+ grpc_error_handle 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);
+ }
+}
+
+ServiceConfigImpl::~ServiceConfigImpl() {
+ for (auto& p : parsed_method_configs_map_) {
+ grpc_slice_unref_internal(p.first);
+ }
+}
+
+grpc_error_handle ServiceConfigImpl::ParseJsonMethodConfig(
+ const grpc_channel_args* args, const Json& json) {
+ std::vector<grpc_error_handle> error_list;
+ // Parse method config with each registered parser.
+ auto parsed_configs =
+ absl::make_unique<ServiceConfigParser::ParsedConfigVector>();
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
+ *parsed_configs =
+ CoreConfiguration::Get().service_config_parser().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_handle parse_error = GRPC_ERROR_NONE;
+ std::string 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();
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
+}
+
+grpc_error_handle ServiceConfigImpl::ParsePerMethodParams(
+ const grpc_channel_args* args) {
+ std::vector<grpc_error_handle> 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"));
+ }
+ 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;
+ }
+ grpc_error_handle 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);
+}
+
+std::string ServiceConfigImpl::ParseJsonMethodName(const Json& json,
+ grpc_error_handle* error) {
+ if (json.type() != Json::Type::OBJECT) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:name error:type is not object");
+ return "";
+ }
+ // Find service name.
+ const std::string* 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 std::string* 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");
+ }
+ return "";
+ }
+ // Construct path.
+ return absl::StrCat("/", *service_name, "/",
+ method_name == nullptr ? "" : *method_name);
+}
+
+const ServiceConfigParser::ParsedConfigVector*
+ServiceConfigImpl::GetMethodParsedConfigVector(const grpc_slice& path) const {
+ if (parsed_method_configs_map_.empty()) {
+ return default_method_config_vector_;
+ }
+ // 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_;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/service_config/service_config_impl.h b/grpc/src/core/lib/service_config/service_config_impl.h
new file mode 100644
index 00000000..18b7f6d9
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config_impl.h
@@ -0,0 +1,125 @@
+//
+// 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_SERVICE_CONFIG_SERVICE_CONFIG_IMPL_H
+#define GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <unordered_map>
+#include <vector>
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/string_util.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/service_config/service_config.h"
+#include "src/core/lib/service_config/service_config_parser.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:
+//
+// {
+// "loadBalancingPolicy": "string", // optional
+// "methodConfig": [ // array of one or more method_config objects
+// {
+// "name": [ // array of one or more name objects
+// {
+// "service": "string", // required
+// "method": "string", // optional
+// }
+// ],
+// // remaining fields are optional.
+// // see https://developers.google.com/protocol-buffers/docs/proto3#json
+// // for format details.
+// "waitForReady": bool,
+// "timeout": "duration_string",
+// "maxRequestMessageBytes": "int64_string",
+// "maxResponseMessageBytes": "int64_string",
+// }
+// ]
+// }
+
+namespace grpc_core {
+
+class ServiceConfigImpl final : public 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,
+ absl::string_view json_string,
+ grpc_error_handle* error);
+
+ ServiceConfigImpl(const grpc_channel_args* args, std::string json_string,
+ Json json, grpc_error_handle* error);
+ ~ServiceConfigImpl() override;
+
+ absl::string_view json_string() const override { 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) override {
+ GPR_DEBUG_ASSERT(index < parsed_global_configs_.size());
+ return parsed_global_configs_[index].get();
+ }
+
+ /// 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 override;
+
+ private:
+ // Helper functions for parsing the method configs.
+ grpc_error_handle ParsePerMethodParams(const grpc_channel_args* args);
+ grpc_error_handle 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 std::string ParseJsonMethodName(const Json& json,
+ grpc_error_handle* error);
+
+ std::string json_string_;
+ Json json_;
+
+ std::vector<std::unique_ptr<ServiceConfigParser::ParsedConfig>>
+ 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;
+ // Storage for all the vectors that are being used in
+ // parsed_method_configs_table_.
+ absl::InlinedVector<std::unique_ptr<ServiceConfigParser::ParsedConfigVector>,
+ 32>
+ parsed_method_config_vectors_storage_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_IMPL_H */
diff --git a/grpc/src/core/lib/service_config/service_config_parser.cc b/grpc/src/core/lib/service_config/service_config_parser.cc
new file mode 100644
index 00000000..569eef67
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config_parser.cc
@@ -0,0 +1,93 @@
+//
+// 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/lib/service_config/service_config_parser.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+ServiceConfigParser ServiceConfigParser::Builder::Build() {
+ return ServiceConfigParser(std::move(registered_parsers_));
+}
+
+void ServiceConfigParser::Builder::RegisterParser(
+ std::unique_ptr<Parser> parser) {
+ for (const auto& registered_parser : registered_parsers_) {
+ if (registered_parser->name() == parser->name()) {
+ gpr_log(GPR_ERROR, "%s",
+ absl::StrCat("Parser with name '", parser->name(),
+ "' already registered")
+ .c_str());
+ // We'll otherwise crash later.
+ abort();
+ }
+ }
+ registered_parsers_.emplace_back(std::move(parser));
+}
+
+ServiceConfigParser::ParsedConfigVector
+ServiceConfigParser::ParseGlobalParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) const {
+ ParsedConfigVector parsed_global_configs;
+ std::vector<grpc_error_handle> error_list;
+ for (size_t i = 0; i < registered_parsers_.size(); i++) {
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
+ auto parsed_config =
+ 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_handle* error) const {
+ ParsedConfigVector parsed_method_configs;
+ std::vector<grpc_error_handle> error_list;
+ for (size_t i = 0; i < registered_parsers_.size(); ++i) {
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
+ auto parsed_config =
+ 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;
+}
+
+size_t ServiceConfigParser::GetParserIndex(absl::string_view name) const {
+ for (size_t i = 0; i < registered_parsers_.size(); ++i) {
+ if (registered_parsers_[i]->name() == name) return i;
+ }
+ return -1;
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/service_config/service_config_parser.h b/grpc/src/core/lib/service_config/service_config_parser.h
new file mode 100644
index 00000000..eabcdff3
--- /dev/null
+++ b/grpc/src/core/lib/service_config/service_config_parser.h
@@ -0,0 +1,106 @@
+//
+// 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_LIB_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H
+#define GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <vector>
+
+#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 absl::string_view name() const = 0;
+
+ virtual std::unique_ptr<ParsedConfig> ParseGlobalParams(
+ const grpc_channel_args*, const Json& /* json */,
+ grpc_error_handle* 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_handle* error) {
+ // Avoid unused parameter warning on debug-only parameter
+ (void)error;
+ GPR_DEBUG_ASSERT(error != nullptr);
+ return nullptr;
+ }
+ };
+
+ using ServiceConfigParserList = std::vector<std::unique_ptr<Parser>>;
+ using ParsedConfigVector = std::vector<std::unique_ptr<ParsedConfig>>;
+
+ class Builder {
+ public:
+ /// Globally register a service config parser. 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.
+ void RegisterParser(std::unique_ptr<Parser> parser);
+
+ ServiceConfigParser Build();
+
+ private:
+ ServiceConfigParserList registered_parsers_;
+ };
+
+ ParsedConfigVector ParseGlobalParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) const;
+
+ ParsedConfigVector ParsePerMethodParameters(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) const;
+
+ // Return the index for a given registered parser.
+ // If there is an error, return -1.
+ size_t GetParserIndex(absl::string_view name) const;
+
+ private:
+ explicit ServiceConfigParser(ServiceConfigParserList registered_parsers)
+ : registered_parsers_(std::move(registered_parsers)) {}
+ ServiceConfigParserList registered_parsers_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H */
diff --git a/grpc/src/core/lib/slice/percent_encoding.cc b/grpc/src/core/lib/slice/percent_encoding.cc
index 79a4805b..98e17bc5 100644
--- a/grpc/src/core/lib/slice/percent_encoding.cc
+++ b/grpc/src/core/lib/slice/percent_encoding.cc
@@ -20,150 +20,137 @@
#include "src/core/lib/slice/percent_encoding.h"
+#include <cstdint>
+
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/slice/slice_internal.h"
-const uint8_t grpc_url_percent_encoding_unreserved_bytes[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0xfe, 0xff, 0xff,
- 0x87, 0xfe, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-const uint8_t grpc_compatible_percent_encoding_unreserved_bytes[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-static bool is_unreserved_character(uint8_t c,
- const uint8_t* unreserved_bytes) {
- return ((unreserved_bytes[c / 8] >> (c % 8)) & 1) != 0;
+#if __cplusplus > 201103l
+#define GRPC_PCTENCODE_CONSTEXPR_FN constexpr
+#define GRPC_PCTENCODE_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_PCTENCODE_CONSTEXPR_FN
+#define GRPC_PCTENCODE_CONSTEXPR_VALUE const
+#endif
+
+namespace grpc_core {
+
+namespace {
+class UrlTable : public BitSet<256> {
+ public:
+ GRPC_PCTENCODE_CONSTEXPR_FN UrlTable() {
+ for (int i = 'a'; i <= 'z'; i++) set(i);
+ for (int i = 'A'; i <= 'Z'; i++) set(i);
+ for (int i = '0'; i <= '9'; i++) set(i);
+ set('-');
+ set('_');
+ set('.');
+ set('~');
+ }
+};
+
+GRPC_PCTENCODE_CONSTEXPR_VALUE UrlTable g_url_table;
+
+class CompatibleTable : public BitSet<256> {
+ public:
+ GRPC_PCTENCODE_CONSTEXPR_FN CompatibleTable() {
+ for (int i = 32; i <= 126; i++) {
+ if (i == '%') continue;
+ set(i);
+ }
+ }
+};
+
+GRPC_PCTENCODE_CONSTEXPR_VALUE CompatibleTable g_compatible_table;
+
+// Map PercentEncodingType to a lookup table of legal symbols for that encoding.
+const BitSet<256>& LookupTableForPercentEncodingType(PercentEncodingType type) {
+ switch (type) {
+ case PercentEncodingType::URL:
+ return g_url_table;
+ case PercentEncodingType::Compatible:
+ return g_compatible_table;
+ }
+ // Crash if a bad PercentEncodingType was passed in.
+ GPR_UNREACHABLE_CODE(abort());
}
+} // namespace
-grpc_slice grpc_percent_encode_slice(const grpc_slice& slice,
- const uint8_t* unreserved_bytes) {
+Slice PercentEncodeSlice(Slice slice, PercentEncodingType type) {
static const uint8_t hex[] = "0123456789ABCDEF";
+ const BitSet<256>& lut = LookupTableForPercentEncodingType(type);
+
// first pass: count the number of bytes needed to output this string
size_t output_length = 0;
- const uint8_t* slice_start = GRPC_SLICE_START_PTR(slice);
- const uint8_t* slice_end = GRPC_SLICE_END_PTR(slice);
- const uint8_t* p;
bool any_reserved_bytes = false;
- for (p = slice_start; p < slice_end; p++) {
- bool unres = is_unreserved_character(*p, unreserved_bytes);
+ for (uint8_t c : slice) {
+ bool unres = lut.is_set(c);
output_length += unres ? 1 : 3;
any_reserved_bytes |= !unres;
}
// no unreserved bytes: return the string unmodified
if (!any_reserved_bytes) {
- return grpc_slice_ref_internal(slice);
+ return slice;
}
// second pass: actually encode
- grpc_slice out = GRPC_SLICE_MALLOC(output_length);
- uint8_t* q = GRPC_SLICE_START_PTR(out);
- for (p = slice_start; p < slice_end; p++) {
- if (is_unreserved_character(*p, unreserved_bytes)) {
- *q++ = *p;
+ auto out = MutableSlice::CreateUninitialized(output_length);
+ uint8_t* q = out.begin();
+ for (uint8_t c : slice) {
+ if (lut.is_set(c)) {
+ *q++ = c;
} else {
*q++ = '%';
- *q++ = hex[*p >> 4];
- *q++ = hex[*p & 15];
+ *q++ = hex[c >> 4];
+ *q++ = hex[c & 15];
}
}
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
- return out;
+ GPR_ASSERT(q == out.end());
+ return Slice(std::move(out));
}
-static bool valid_hex(const uint8_t* p, const uint8_t* end) {
+static bool ValidHex(const uint8_t* p, const uint8_t* end) {
if (p >= end) return false;
return (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') ||
(*p >= 'A' && *p <= 'F');
}
-static uint8_t dehex(uint8_t c) {
+static uint8_t DeHex(uint8_t c) {
if (c >= '0' && c <= '9') return static_cast<uint8_t>(c - '0');
if (c >= 'A' && c <= 'F') return static_cast<uint8_t>(c - 'A' + 10);
if (c >= 'a' && c <= 'f') return static_cast<uint8_t>(c - 'a' + 10);
GPR_UNREACHABLE_CODE(return 255);
}
-bool grpc_strict_percent_decode_slice(const grpc_slice& slice_in,
- const uint8_t* unreserved_bytes,
- grpc_slice* slice_out) {
- const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
- const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
- size_t out_length = 0;
+Slice PermissivePercentDecodeSlice(Slice slice_in) {
bool any_percent_encoded_stuff = false;
- while (p != in_end) {
- if (*p == '%') {
- if (!valid_hex(++p, in_end)) return false;
- if (!valid_hex(++p, in_end)) return false;
- p++;
- out_length++;
+ for (uint8_t c : slice_in) {
+ if (c == '%') {
any_percent_encoded_stuff = true;
- } else if (is_unreserved_character(*p, unreserved_bytes)) {
- p++;
- out_length++;
- } else {
- return false;
+ break;
}
}
- if (!any_percent_encoded_stuff) {
- *slice_out = grpc_slice_ref_internal(slice_in);
- return true;
- }
- p = GRPC_SLICE_START_PTR(slice_in);
- *slice_out = GRPC_SLICE_MALLOC(out_length);
- uint8_t* q = GRPC_SLICE_START_PTR(*slice_out);
- while (p != in_end) {
- if (*p == '%') {
- *q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
- p += 3;
- } else {
- *q++ = *p++;
- }
- }
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(*slice_out));
- return true;
-}
+ if (!any_percent_encoded_stuff) return slice_in;
-grpc_slice grpc_permissive_percent_decode_slice(const grpc_slice& slice_in) {
- const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
- const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
- size_t out_length = 0;
- bool any_percent_encoded_stuff = false;
- while (p != in_end) {
+ MutableSlice out = slice_in.TakeMutable();
+ uint8_t* q = out.begin();
+ const uint8_t* p = out.begin();
+ const uint8_t* end = out.end();
+ while (p != end) {
if (*p == '%') {
- if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
- p++;
- out_length++;
- } else {
- p += 3;
- out_length++;
- any_percent_encoded_stuff = true;
- }
- } else {
- p++;
- out_length++;
- }
- }
- if (!any_percent_encoded_stuff) {
- return grpc_slice_ref_internal(slice_in);
- }
- p = GRPC_SLICE_START_PTR(slice_in);
- grpc_slice out = GRPC_SLICE_MALLOC(out_length);
- uint8_t* q = GRPC_SLICE_START_PTR(out);
- while (p != in_end) {
- if (*p == '%') {
- if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
+ if (!ValidHex(p + 1, end) || !ValidHex(p + 2, end)) {
*q++ = *p++;
} else {
- *q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
+ *q++ = static_cast<uint8_t>(DeHex(p[1]) << 4) | (DeHex(p[2]));
p += 3;
}
} else {
*q++ = *p++;
}
}
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
- return out;
+ return Slice(out.TakeSubSlice(0, q - out.begin()));
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/slice/percent_encoding.h b/grpc/src/core/lib/slice/percent_encoding.h
index 43b20f09..830ef025 100644
--- a/grpc/src/core/lib/slice/percent_encoding.h
+++ b/grpc/src/core/lib/slice/percent_encoding.h
@@ -30,36 +30,31 @@
#include <stdbool.h>
+#include "absl/types/optional.h"
+
#include <grpc/slice.h>
-/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
- grpc_percent_encode_slice, grpc_strict_percent_decode_slice).
- Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
- */
-extern const uint8_t grpc_url_percent_encoding_unreserved_bytes[256 / 8];
-/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
- grpc_percent_encode_slice, grpc_strict_percent_decode_slice).
- Flags ascii7 non-control characters excluding '%' as unreserved bytes for the
- percent encoding routines */
-extern const uint8_t grpc_compatible_percent_encoding_unreserved_bytes[256 / 8];
+#include "src/core/lib/slice/slice.h"
+
+namespace grpc_core {
+
+enum class PercentEncodingType {
+ // Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
+ URL,
+ // Flags ascii7 non-control characters excluding '%' as unreserved bytes for
+ // the percent encoding routines
+ Compatible
+};
+
+// Percent-encode a slice, returning the new slice (this cannot fail):
+// unreserved_bytes is a bitfield indicating which bytes are considered
+// unreserved and thus do not need percent encoding
+Slice PercentEncodeSlice(Slice slice, PercentEncodingType type);
+// Percent-decode a slice, permissively.
+// If a % triplet can not be decoded, pass it through verbatim.
+// This cannot fail.
+Slice PermissivePercentDecodeSlice(Slice slice_in);
-/* Percent-encode a slice, returning the new slice (this cannot fail):
- unreserved_bytes is a bitfield indicating which bytes are considered
- unreserved and thus do not need percent encoding */
-grpc_slice grpc_percent_encode_slice(const grpc_slice& slice,
- const uint8_t* unreserved_bytes);
-/* Percent-decode a slice, strictly.
- If the input is legal (contains no unreserved bytes, and legal % encodings),
- returns true and sets *slice_out to the decoded slice.
- If the input is not legal, returns false and leaves *slice_out untouched.
- unreserved_bytes is a bitfield indicating which bytes are considered
- unreserved and thus do not need percent encoding */
-bool grpc_strict_percent_decode_slice(const grpc_slice& slice_in,
- const uint8_t* unreserved_bytes,
- grpc_slice* slice_out);
-/* Percent-decode a slice, permissively.
- If a % triplet can not be decoded, pass it through verbatim.
- This cannot fail. */
-grpc_slice grpc_permissive_percent_decode_slice(const grpc_slice& slice_in);
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */
diff --git a/grpc/src/core/lib/slice/slice.cc b/grpc/src/core/lib/slice/slice.cc
index 5f7e9ea0..2e78b4de 100644
--- a/grpc/src/core/lib/slice/slice.cc
+++ b/grpc/src/core/lib/slice/slice.cc
@@ -18,17 +18,18 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice.h"
+
+#include <string.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
-
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_refcount_base.h"
char* grpc_slice_to_c_string(grpc_slice slice) {
char* out = static_cast<char*>(gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1));
@@ -37,7 +38,9 @@ char* grpc_slice_to_c_string(grpc_slice slice) {
return out;
}
-grpc_slice grpc_empty_slice(void) { return grpc_core::UnmanagedMemorySlice(); }
+grpc_slice grpc_empty_slice(void) {
+ return grpc_core::slice_detail::EmptySlice();
+}
grpc_slice grpc_slice_copy(grpc_slice s) {
grpc_slice out = GRPC_SLICE_MALLOC(GRPC_SLICE_LENGTH(s));
@@ -46,47 +49,23 @@ grpc_slice grpc_slice_copy(grpc_slice s) {
return out;
}
-/* Public API */
-grpc_slice grpc_slice_ref(grpc_slice slice) {
- return grpc_slice_ref_internal(slice);
-}
-
-/* Public API */
-void grpc_slice_unref(grpc_slice slice) {
- if (grpc_core::ExecCtx::Get() == nullptr) {
- grpc_core::ExecCtx exec_ctx;
- grpc_slice_unref_internal(slice);
- } else {
- grpc_slice_unref_internal(slice);
- }
-}
-
namespace grpc_core {
-/* grpc_slice_from_static_string support structure - a refcount that does
- nothing */
-grpc_slice_refcount kNoopRefcount(grpc_slice_refcount::Type::NOP);
-static_assert(std::is_trivially_destructible<decltype(kNoopRefcount)>::value,
- "kNoopRefcount must be trivially destructible.");
-
/* grpc_slice_new support structures - we create a refcount object extended
with the user provided data pointer & destroy function */
-class NewSliceRefcount {
+class NewSliceRefcount : public grpc_slice_refcount {
public:
- static void Destroy(void* arg) { delete static_cast<NewSliceRefcount*>(arg); }
-
NewSliceRefcount(void (*destroy)(void*), void* user_data)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
+ : grpc_slice_refcount(Destroy),
user_destroy_(destroy),
user_data_(user_data) {}
~NewSliceRefcount() { user_destroy_(user_data_); }
- grpc_slice_refcount* base_refcount() { return &base_; }
-
private:
- grpc_slice_refcount base_;
- RefCount refs_;
+ static void Destroy(grpc_slice_refcount* arg) {
+ delete static_cast<NewSliceRefcount*>(arg);
+ }
+
void (*user_destroy_)(void*);
void* user_data_;
};
@@ -94,7 +73,8 @@ class NewSliceRefcount {
} // namespace grpc_core
size_t grpc_slice_memory_usage(grpc_slice s) {
- if (s.refcount == nullptr || s.refcount == &grpc_core::kNoopRefcount) {
+ if (s.refcount == nullptr ||
+ s.refcount == grpc_slice_refcount::NoopRefcount()) {
return 0;
} else {
return s.data.refcounted.length;
@@ -102,19 +82,18 @@ size_t grpc_slice_memory_usage(grpc_slice s) {
}
grpc_slice grpc_slice_from_static_buffer(const void* s, size_t len) {
- return grpc_core::ExternallyManagedSlice(s, len);
+ return grpc_core::StaticSlice::FromStaticBuffer(s, len).TakeCSlice();
}
grpc_slice grpc_slice_from_static_string(const char* s) {
- return grpc_core::ExternallyManagedSlice(s, strlen(s));
+ return grpc_core::StaticSlice::FromStaticString(s).TakeCSlice();
}
grpc_slice grpc_slice_new_with_user_data(void* p, size_t len,
void (*destroy)(void*),
void* user_data) {
grpc_slice slice;
- slice.refcount =
- (new grpc_core::NewSliceRefcount(destroy, user_data))->base_refcount();
+ slice.refcount = new grpc_core::NewSliceRefcount(destroy, user_data);
slice.data.refcounted.bytes = static_cast<uint8_t*>(p);
slice.data.refcounted.length = len;
return slice;
@@ -128,68 +107,51 @@ grpc_slice grpc_slice_new(void* p, size_t len, void (*destroy)(void*)) {
namespace grpc_core {
/* grpc_slice_new_with_len support structures - we create a refcount object
extended with the user provided data pointer & destroy function */
-class NewWithLenSliceRefcount {
+class NewWithLenSliceRefcount : public grpc_slice_refcount {
public:
- static void Destroy(void* arg) {
- delete static_cast<NewWithLenSliceRefcount*>(arg);
- }
-
NewWithLenSliceRefcount(void (*destroy)(void*, size_t), void* user_data,
size_t user_length)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
+ : grpc_slice_refcount(Destroy),
user_data_(user_data),
user_length_(user_length),
user_destroy_(destroy) {}
~NewWithLenSliceRefcount() { user_destroy_(user_data_, user_length_); }
- grpc_slice_refcount* base_refcount() { return &base_; }
-
private:
- grpc_slice_refcount base_;
- RefCount refs_;
+ static void Destroy(grpc_slice_refcount* arg) {
+ delete static_cast<NewWithLenSliceRefcount*>(arg);
+ }
+
void* user_data_;
size_t user_length_;
void (*user_destroy_)(void*, size_t);
};
/** grpc_slice_from_moved_(string|buffer) ref count .*/
-class MovedStringSliceRefCount {
+class MovedStringSliceRefCount : public grpc_slice_refcount {
public:
- explicit MovedStringSliceRefCount(grpc_core::UniquePtr<char>&& str)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
- str_(std::move(str)) {}
-
- grpc_slice_refcount* base_refcount() { return &base_; }
+ explicit MovedStringSliceRefCount(UniquePtr<char>&& str)
+ : grpc_slice_refcount(Destroy), str_(std::move(str)) {}
private:
- static void Destroy(void* arg) {
+ static void Destroy(grpc_slice_refcount* arg) {
delete static_cast<MovedStringSliceRefCount*>(arg);
}
- grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
- grpc_core::UniquePtr<char> str_;
+ UniquePtr<char> str_;
};
// grpc_slice_from_cpp_string() ref count.
-class MovedCppStringSliceRefCount {
+class MovedCppStringSliceRefCount : public grpc_slice_refcount {
public:
explicit MovedCppStringSliceRefCount(std::string&& str)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
- str_(std::move(str)) {}
-
- grpc_slice_refcount* base_refcount() { return &base_; }
+ : grpc_slice_refcount(Destroy), str_(std::move(str)) {}
private:
- static void Destroy(void* arg) {
+ static void Destroy(grpc_slice_refcount* arg) {
delete static_cast<MovedCppStringSliceRefCount*>(arg);
}
- grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
std::string str_;
};
@@ -198,36 +160,21 @@ class MovedCppStringSliceRefCount {
grpc_slice grpc_slice_new_with_len(void* p, size_t len,
void (*destroy)(void*, size_t)) {
grpc_slice slice;
- slice.refcount = (new grpc_core::NewWithLenSliceRefcount(destroy, p, len))
- ->base_refcount();
+ slice.refcount = new grpc_core::NewWithLenSliceRefcount(destroy, p, len);
slice.data.refcounted.bytes = static_cast<uint8_t*>(p);
slice.data.refcounted.length = len;
return slice;
}
-grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(const char* source,
- size_t length) {
- if (length <= sizeof(data.inlined.bytes)) {
- refcount = nullptr;
- data.inlined.length = static_cast<uint8_t>(length);
- } else {
- HeapInit(length);
- }
- if (length > 0) {
- memcpy(GRPC_SLICE_START_PTR(*this), source, length);
- }
-}
-
-grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(const char* source)
- : grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(source,
- strlen(source)) {}
-
-grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t length) {
- return grpc_core::UnmanagedMemorySlice(source, length);
+grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t len) {
+ if (len == 0) return grpc_empty_slice();
+ grpc_slice out = grpc_slice_malloc(len);
+ memcpy(GRPC_SLICE_START_PTR(out), source, len);
+ return out;
}
grpc_slice grpc_slice_from_copied_string(const char* source) {
- return grpc_core::UnmanagedMemorySlice(source, strlen(source));
+ return grpc_slice_from_copied_buffer(source, strlen(source));
}
grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
@@ -239,8 +186,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
slice.data.inlined.length = len;
memcpy(GRPC_SLICE_START_PTR(slice), ptr, len);
} else {
- slice.refcount = (new grpc_core::MovedStringSliceRefCount(std::move(p)))
- ->base_refcount();
+ slice.refcount = new grpc_core::MovedStringSliceRefCount(std::move(p));
slice.data.refcounted.bytes = ptr;
slice.data.refcounted.length = len;
}
@@ -262,94 +208,44 @@ grpc_slice grpc_slice_from_cpp_string(std::string str) {
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();
+ slice.refcount = new grpc_core::MovedCppStringSliceRefCount(std::move(str));
}
return slice;
}
-namespace {
-
-class MallocRefCount {
- public:
- static void Destroy(void* arg) {
- MallocRefCount* r = static_cast<MallocRefCount*>(arg);
- r->~MallocRefCount();
- gpr_free(r);
- }
-
- MallocRefCount()
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_) {}
- ~MallocRefCount() = default;
-
- grpc_slice_refcount* base_refcount() { return &base_; }
-
- private:
- grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
-};
-
-} // namespace
-
grpc_slice grpc_slice_malloc_large(size_t length) {
- return grpc_core::UnmanagedMemorySlice(
- length, grpc_core::UnmanagedMemorySlice::ForceHeapAllocation());
-}
-
-void grpc_core::UnmanagedMemorySlice::HeapInit(size_t length) {
- /* Memory layout used by the slice created here:
-
- +-----------+----------------------------------------------------------+
- | refcount | bytes |
- +-----------+----------------------------------------------------------+
-
- refcount is a malloc_refcount
- bytes is an array of bytes of the requested length
- Both parts are placed in the same allocation returned from gpr_malloc */
- auto* rc =
- static_cast<MallocRefCount*>(gpr_malloc(sizeof(MallocRefCount) + length));
-
- /* Initial refcount on rc is 1 - and it's up to the caller to release
- this reference. */
- new (rc) MallocRefCount();
-
- /* Build up the slice to be returned. */
- /* The slices refcount points back to the allocated block. */
- refcount = rc->base_refcount();
- /* The data bytes are placed immediately after the refcount struct */
- data.refcounted.bytes = reinterpret_cast<uint8_t*>(rc + 1);
- /* And the length of the block is set to the requested length */
- data.refcounted.length = length;
+ grpc_slice slice;
+ uint8_t* memory = new uint8_t[sizeof(grpc_slice_refcount) + length];
+ slice.refcount = new (memory) grpc_slice_refcount(
+ [](grpc_slice_refcount* p) { delete[] reinterpret_cast<uint8_t*>(p); });
+ slice.data.refcounted.bytes = memory + sizeof(grpc_slice_refcount);
+ slice.data.refcounted.length = length;
+ return slice;
}
grpc_slice grpc_slice_malloc(size_t length) {
- return grpc_core::UnmanagedMemorySlice(length);
-}
-
-grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(size_t length) {
- if (length > sizeof(data.inlined.bytes)) {
- HeapInit(length);
+ if (length <= GRPC_SLICE_INLINED_SIZE) {
+ grpc_slice slice;
+ slice.refcount = nullptr;
+ slice.data.inlined.length = length;
+ return slice;
} else {
- /* small slice: just inline the data */
- refcount = nullptr;
- data.inlined.length = static_cast<uint8_t>(length);
+ return grpc_slice_malloc_large(length);
}
}
-template <typename Slice>
-static Slice sub_no_ref(const Slice& source, size_t begin, size_t end) {
- Slice subset;
+static grpc_slice sub_no_ref(const grpc_slice& source, size_t begin,
+ size_t end) {
+ grpc_slice subset;
GPR_ASSERT(end >= begin);
- if (source.refcount) {
+ if (source.refcount != nullptr) {
/* Enforce preconditions */
GPR_ASSERT(source.data.refcounted.length >= end);
/* Build the result */
- subset.refcount = source.refcount->sub_refcount();
+ subset.refcount = source.refcount;
/* Point into the source array */
subset.data.refcounted.bytes = source.data.refcounted.bytes + begin;
subset.data.refcounted.length = end - begin;
@@ -368,11 +264,6 @@ grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end) {
return sub_no_ref(source, begin, end);
}
-grpc_core::UnmanagedMemorySlice grpc_slice_sub_no_ref(
- const grpc_core::UnmanagedMemorySlice& source, size_t begin, size_t end) {
- return sub_no_ref(source, begin, end);
-}
-
grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) {
grpc_slice subset;
@@ -384,7 +275,9 @@ grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) {
} else {
subset = grpc_slice_sub_no_ref(source, begin, end);
/* Bump the refcount */
- subset.refcount->Ref();
+ if (subset.refcount != grpc_slice_refcount::NoopRefcount()) {
+ subset.refcount->Ref();
+ }
}
return subset;
}
@@ -402,6 +295,12 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split,
memcpy(tail.data.inlined.bytes, source->data.inlined.bytes + split,
tail.data.inlined.length);
source->data.inlined.length = static_cast<uint8_t>(split);
+ } else if (source->refcount == grpc_slice_refcount::NoopRefcount()) {
+ /* refcount == NoopRefcount(), so we can just split in-place */
+ tail.refcount = grpc_slice_refcount::NoopRefcount();
+ tail.data.refcounted.bytes = source->data.refcounted.bytes + split;
+ tail.data.refcounted.length = source->data.refcounted.length - split;
+ source->data.refcounted.length = split;
} else {
size_t tail_length = source->data.refcounted.length - split;
GPR_ASSERT(source->data.refcounted.length >= split);
@@ -412,23 +311,22 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split,
tail.data.inlined.length = static_cast<uint8_t>(tail_length);
memcpy(tail.data.inlined.bytes, source->data.refcounted.bytes + split,
tail_length);
- source->refcount = source->refcount->sub_refcount();
} else {
/* Build the result */
switch (ref_whom) {
case GRPC_SLICE_REF_TAIL:
- tail.refcount = source->refcount->sub_refcount();
- source->refcount = &grpc_core::kNoopRefcount;
+ tail.refcount = source->refcount;
+ source->refcount = grpc_slice_refcount::NoopRefcount();
break;
case GRPC_SLICE_REF_HEAD:
- tail.refcount = &grpc_core::kNoopRefcount;
- source->refcount = source->refcount->sub_refcount();
+ tail.refcount = grpc_slice_refcount::NoopRefcount();
break;
case GRPC_SLICE_REF_BOTH:
- tail.refcount = source->refcount->sub_refcount();
- source->refcount = source->refcount->sub_refcount();
+ tail.refcount = source->refcount;
/* Bump the refcount */
- tail.refcount->Ref();
+ if (tail.refcount != grpc_slice_refcount::NoopRefcount()) {
+ tail.refcount->Ref();
+ }
break;
}
/* Point into the source array */
@@ -464,20 +362,20 @@ grpc_slice grpc_slice_split_head(grpc_slice* source, size_t split) {
head.refcount = nullptr;
head.data.inlined.length = static_cast<uint8_t>(split);
memcpy(head.data.inlined.bytes, source->data.refcounted.bytes, split);
- source->refcount = source->refcount->sub_refcount();
source->data.refcounted.bytes += split;
source->data.refcounted.length -= split;
} else {
GPR_ASSERT(source->data.refcounted.length >= split);
/* Build the result */
- head.refcount = source->refcount->sub_refcount();
+ head.refcount = source->refcount;
/* Bump the refcount */
- head.refcount->Ref();
+ if (head.refcount != grpc_slice_refcount::NoopRefcount()) {
+ head.refcount->Ref();
+ }
/* Point into the source array */
head.data.refcounted.bytes = source->data.refcounted.bytes;
head.data.refcounted.length = split;
- source->refcount = source->refcount->sub_refcount();
source->data.refcounted.bytes += split;
source->data.refcounted.length -= split;
}
@@ -485,21 +383,13 @@ grpc_slice grpc_slice_split_head(grpc_slice* source, size_t split) {
return head;
}
-int grpc_slice_default_eq_impl(grpc_slice a, grpc_slice b) {
+int grpc_slice_eq(grpc_slice a, grpc_slice b) {
if (GRPC_SLICE_LENGTH(a) != GRPC_SLICE_LENGTH(b)) return false;
if (GRPC_SLICE_LENGTH(a) == 0) return true;
return 0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b),
GRPC_SLICE_LENGTH(a));
}
-int grpc_slice_eq(grpc_slice a, grpc_slice b) {
- if (a.refcount && b.refcount &&
- a.refcount->GetType() == b.refcount->GetType()) {
- return a.refcount->Eq(a, b);
- }
- return grpc_slice_default_eq_impl(a, b);
-}
-
int grpc_slice_differs_refcounted(const grpc_slice& a,
const grpc_slice& b_not_inline) {
size_t a_len;
diff --git a/grpc/src/core/lib/slice/slice.h b/grpc/src/core/lib/slice/slice.h
new file mode 100644
index 00000000..c4c9284b
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice.h
@@ -0,0 +1,384 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SLICE_SLICE_H
+#define GRPC_CORE_LIB_SLICE_SLICE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+
+#include "absl/strings/string_view.h"
+
+#include <grpc/slice.h>
+
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_refcount.h"
+#include "src/core/lib/slice/slice_refcount_base.h"
+
+// Herein lies grpc_core::Slice and its team of thin wrappers around grpc_slice.
+// They aim to keep you safe by providing strong guarantees around lifetime and
+// mutability.
+//
+// The team:
+// Slice - provides a wrapper around an unknown type of slice.
+// Immutable (since we don't know who else might be referencing
+// it), and potentially ref counted.
+// StaticSlice - provides a wrapper around a static slice. Not refcounted,
+// fast to copy.
+// MutableSlice - provides a guarantee of unique ownership, meaning the
+// underlying data can be mutated safely.
+
+namespace grpc_core {
+
+// Forward declarations
+class Slice;
+class StaticSlice;
+class MutableSlice;
+
+namespace slice_detail {
+
+// Returns an empty slice.
+static constexpr grpc_slice EmptySlice() { return {nullptr, {}}; }
+
+// BaseSlice holds the grpc_slice object, but does not apply refcounting policy.
+// It does export immutable access into the slice, such that this can be shared
+// by all storage policies.
+class BaseSlice {
+ public:
+ BaseSlice(const BaseSlice&) = delete;
+ BaseSlice& operator=(const BaseSlice&) = delete;
+ BaseSlice(BaseSlice&& other) = delete;
+ BaseSlice& operator=(BaseSlice&& other) = delete;
+
+ // Iterator access to the underlying bytes
+ const uint8_t* begin() const { return GRPC_SLICE_START_PTR(c_slice()); }
+ const uint8_t* end() const { return GRPC_SLICE_END_PTR(c_slice()); }
+ const uint8_t* cbegin() const { return GRPC_SLICE_START_PTR(c_slice()); }
+ const uint8_t* cend() const { return GRPC_SLICE_END_PTR(c_slice()); }
+
+ // Retrieve a borrowed reference to the underlying grpc_slice.
+ const grpc_slice& c_slice() const { return slice_; }
+
+ // Retrieve the underlying grpc_slice, and replace the one in this object with
+ // EmptySlice().
+ grpc_slice TakeCSlice() {
+ grpc_slice out = slice_;
+ slice_ = EmptySlice();
+ return out;
+ }
+
+ // As other things... borrowed references.
+ absl::string_view as_string_view() const {
+ return absl::string_view(reinterpret_cast<const char*>(data()), size());
+ }
+
+ // Array access
+ uint8_t operator[](size_t i) const {
+ return GRPC_SLICE_START_PTR(c_slice())[i];
+ }
+
+ // Access underlying data
+ const uint8_t* data() const { return GRPC_SLICE_START_PTR(c_slice()); }
+
+ // Size of the slice
+ size_t size() const { return GRPC_SLICE_LENGTH(c_slice()); }
+ size_t length() const { return size(); }
+ bool empty() const { return size() == 0; }
+
+ // For inlined slices - are these two slices equal?
+ // For non-inlined slices - do these two slices refer to the same block of
+ // memory?
+ bool is_equivalent(const BaseSlice& other) const {
+ return grpc_slice_is_equivalent(slice_, other.slice_);
+ }
+
+ uint32_t Hash() const { return grpc_slice_hash_internal(slice_); }
+
+ protected:
+ BaseSlice() : slice_(EmptySlice()) {}
+ explicit BaseSlice(const grpc_slice& slice) : slice_(slice) {}
+ ~BaseSlice() = default;
+
+ void Swap(BaseSlice* other) { std::swap(slice_, other->slice_); }
+ void SetCSlice(const grpc_slice& slice) { slice_ = slice; }
+
+ uint8_t* mutable_data() { return GRPC_SLICE_START_PTR(slice_); }
+
+ grpc_slice* c_slice_ptr() { return &slice_; }
+
+ private:
+ grpc_slice slice_;
+};
+
+inline bool operator==(const BaseSlice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a.c_slice(), b.c_slice()) != 0;
+}
+
+inline bool operator!=(const BaseSlice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a.c_slice(), b.c_slice()) == 0;
+}
+
+inline bool operator==(const BaseSlice& a, absl::string_view b) {
+ return a.as_string_view() == b;
+}
+
+inline bool operator!=(const BaseSlice& a, absl::string_view b) {
+ return a.as_string_view() != b;
+}
+
+inline bool operator==(absl::string_view a, const BaseSlice& b) {
+ return a == b.as_string_view();
+}
+
+inline bool operator!=(absl::string_view a, const BaseSlice& b) {
+ return a != b.as_string_view();
+}
+
+inline bool operator==(const BaseSlice& a, const grpc_slice& b) {
+ return grpc_slice_eq(a.c_slice(), b) != 0;
+}
+
+inline bool operator!=(const BaseSlice& a, const grpc_slice& b) {
+ return grpc_slice_eq(a.c_slice(), b) == 0;
+}
+
+inline bool operator==(const grpc_slice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a, b.c_slice()) != 0;
+}
+
+inline bool operator!=(const grpc_slice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a, b.c_slice()) == 0;
+}
+
+template <typename Out>
+struct CopyConstructors {
+ static Out FromCopiedString(const char* s) {
+ return FromCopiedBuffer(s, strlen(s));
+ }
+ static Out FromCopiedString(absl::string_view s) {
+ return FromCopiedBuffer(s.data(), s.size());
+ }
+ static Out FromCopiedString(std::string s) {
+ return Out(grpc_slice_from_cpp_string(std::move(s)));
+ }
+ static Out FromCopiedBuffer(const char* p, size_t len) {
+ return Out(grpc_slice_from_copied_buffer(p, len));
+ }
+
+ template <typename Buffer>
+ static Out FromCopiedBuffer(const Buffer& buffer) {
+ return FromCopiedBuffer(reinterpret_cast<const char*>(buffer.data()),
+ buffer.size());
+ }
+
+ static Out FromInt64(int64_t i) {
+ char buffer[GPR_LTOA_MIN_BUFSIZE];
+ gpr_ltoa(i, buffer);
+ return FromCopiedString(buffer);
+ }
+};
+
+template <typename Out>
+struct StaticConstructors {
+ static Out FromStaticString(const char* s) {
+ return FromStaticBuffer(s, strlen(s));
+ }
+
+ static Out FromStaticString(absl::string_view s) {
+ return FromStaticBuffer(s.data(), s.size());
+ }
+
+ static Out FromStaticBuffer(const void* s, size_t len) {
+ grpc_slice slice;
+ slice.refcount = grpc_slice_refcount::NoopRefcount();
+ slice.data.refcounted.bytes =
+ const_cast<uint8_t*>(static_cast<const uint8_t*>(s));
+ slice.data.refcounted.length = len;
+ return Out(slice);
+ }
+};
+
+} // namespace slice_detail
+
+class StaticSlice : public slice_detail::BaseSlice,
+ public slice_detail::StaticConstructors<StaticSlice> {
+ public:
+ StaticSlice() = default;
+ explicit StaticSlice(const grpc_slice& slice)
+ : slice_detail::BaseSlice(slice) {
+ GPR_DEBUG_ASSERT(slice.refcount == grpc_slice_refcount::NoopRefcount());
+ }
+
+ StaticSlice(const StaticSlice& other)
+ : slice_detail::BaseSlice(other.c_slice()) {}
+ StaticSlice& operator=(const StaticSlice& other) {
+ SetCSlice(other.c_slice());
+ return *this;
+ }
+ StaticSlice(StaticSlice&& other) noexcept
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ StaticSlice& operator=(StaticSlice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+};
+
+class MutableSlice : public slice_detail::BaseSlice,
+ public slice_detail::CopyConstructors<MutableSlice> {
+ public:
+ MutableSlice() = default;
+ explicit MutableSlice(const grpc_slice& slice)
+ : slice_detail::BaseSlice(slice) {
+ GPR_DEBUG_ASSERT(slice.refcount == nullptr || slice.refcount->IsUnique());
+ }
+ ~MutableSlice() { grpc_slice_unref_internal(c_slice()); }
+
+ MutableSlice(const MutableSlice&) = delete;
+ MutableSlice& operator=(const MutableSlice&) = delete;
+ MutableSlice(MutableSlice&& other) noexcept
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ MutableSlice& operator=(MutableSlice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+
+ static MutableSlice CreateUninitialized(size_t length) {
+ return MutableSlice(grpc_slice_malloc(length));
+ }
+
+ // Return a sub slice of this one. Leaves this slice in an indeterminate but
+ // valid state.
+ MutableSlice TakeSubSlice(size_t pos, size_t n) {
+ return MutableSlice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
+ }
+
+ // Iterator access to the underlying bytes
+ uint8_t* begin() { return mutable_data(); }
+ uint8_t* end() { return mutable_data() + size(); }
+ uint8_t* data() { return mutable_data(); }
+
+ // Array access
+ uint8_t& operator[](size_t i) { return mutable_data()[i]; }
+};
+
+class Slice : public slice_detail::BaseSlice,
+ public slice_detail::CopyConstructors<Slice>,
+ public slice_detail::StaticConstructors<Slice> {
+ public:
+ Slice() = default;
+ ~Slice() { grpc_slice_unref_internal(c_slice()); }
+ explicit Slice(const grpc_slice& slice) : slice_detail::BaseSlice(slice) {}
+ explicit Slice(slice_detail::BaseSlice&& other)
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+
+ Slice(const Slice&) = delete;
+ Slice& operator=(const Slice&) = delete;
+ Slice(Slice&& other) noexcept : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ Slice& operator=(Slice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+
+ // A slice might refer to some memory that we keep a refcount to (this is
+ // owned), or some memory that's inlined into the slice (also owned), or some
+ // other block of memory that we know will be available for the lifetime of
+ // some operation in the common case (not owned). In the *less common* case
+ // that we need to keep that slice text for longer than our API's guarantee us
+ // access, we need to take a copy and turn this into something that we do own.
+
+ // TakeOwned returns an owned slice regardless of current ownership, and
+ // leaves the current slice in a valid but externally unpredictable state - in
+ // doing so it can avoid adding a ref to the underlying slice.
+ Slice TakeOwned() {
+ if (c_slice().refcount == nullptr) {
+ return Slice(c_slice());
+ }
+ if (c_slice().refcount == grpc_slice_refcount::NoopRefcount()) {
+ return Slice(grpc_slice_copy(c_slice()));
+ }
+ return Slice(TakeCSlice());
+ }
+
+ // AsOwned returns an owned slice but does not mutate the current slice,
+ // meaning that it may add a reference to the underlying slice.
+ Slice AsOwned() const {
+ if (c_slice().refcount == nullptr) {
+ return Slice(c_slice());
+ }
+ if (c_slice().refcount == grpc_slice_refcount::NoopRefcount()) {
+ return Slice(grpc_slice_copy(c_slice()));
+ }
+ return Slice(grpc_slice_ref_internal(c_slice()));
+ }
+
+ // TakeMutable returns a MutableSlice, and leaves the current slice in an
+ // indeterminate but valid state.
+ // A mutable slice requires only one reference to the bytes of the slice -
+ // this can be achieved either with inlined storage or with a single
+ // reference.
+ // If the current slice is refcounted and there are more than one references
+ // to that slice, then the slice is copied in order to achieve a mutable
+ // version.
+ MutableSlice TakeMutable() {
+ if (c_slice().refcount == nullptr) {
+ return MutableSlice(c_slice());
+ }
+ if (c_slice().refcount != grpc_slice_refcount::NoopRefcount() &&
+ c_slice().refcount->IsUnique()) {
+ return MutableSlice(TakeCSlice());
+ }
+ return MutableSlice(grpc_slice_copy(c_slice()));
+ }
+
+ // Return a sub slice of this one. Leaves this slice in an indeterminate but
+ // valid state.
+ Slice TakeSubSlice(size_t pos, size_t n) {
+ return Slice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
+ }
+
+ // Return a sub slice of this one. Adds a reference to the underlying slice.
+ Slice RefSubSlice(size_t pos, size_t n) const {
+ return Slice(grpc_slice_sub(c_slice(), pos, pos + n));
+ }
+
+ // Split this slice, returning a new slice containing (split:end] and
+ // leaving this slice with [begin:split).
+ Slice Split(size_t split) {
+ return Slice(grpc_slice_split_tail(c_slice_ptr(), split));
+ }
+
+ Slice Ref() const { return Slice(grpc_slice_ref_internal(c_slice())); }
+
+ Slice Copy() const { return Slice(grpc_slice_copy(c_slice())); }
+
+ static Slice FromRefcountAndBytes(grpc_slice_refcount* r,
+ const uint8_t* begin, const uint8_t* end) {
+ grpc_slice out;
+ out.refcount = r;
+ if (r != grpc_slice_refcount::NoopRefcount()) r->Ref();
+ out.data.refcounted.bytes = const_cast<uint8_t*>(begin);
+ out.data.refcounted.length = end - begin;
+ return Slice(out);
+ }
+
+ static Slice FromExternalString(absl::string_view str) {
+ return FromStaticString(str);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SLICE_SLICE_H
diff --git a/grpc/src/core/lib/slice/slice_api.cc b/grpc/src/core/lib/slice/slice_api.cc
new file mode 100644
index 00000000..28827d20
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_api.cc
@@ -0,0 +1,39 @@
+/*
+ *
+ * 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 <grpc/slice.h>
+
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+/* Public API */
+grpc_slice grpc_slice_ref(grpc_slice slice) {
+ return grpc_slice_ref_internal(slice);
+}
+
+/* Public API */
+void grpc_slice_unref(grpc_slice slice) {
+ if (grpc_core::ExecCtx::Get() == nullptr) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_slice_unref_internal(slice);
+ } else {
+ grpc_slice_unref_internal(slice);
+ }
+}
diff --git a/grpc/src/core/lib/slice/slice_buffer.cc b/grpc/src/core/lib/slice/slice_buffer.cc
index ba103d70..12cca86c 100644
--- a/grpc/src/core/lib/slice/slice_buffer.cc
+++ b/grpc/src/core/lib/slice/slice_buffer.cc
@@ -18,10 +18,9 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice_buffer.h>
-
#include <string.h>
+#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -85,6 +84,10 @@ void grpc_slice_buffer_destroy_internal(grpc_slice_buffer* sb) {
grpc_slice_buffer_reset_and_unref_internal(sb);
if (sb->base_slices != sb->inlined) {
gpr_free(sb->base_slices);
+ // As a precaution, set sb->base_slices to equal sb->inlined
+ // to prevent a double free attempt if grpc_slice_buffer_destroy_internal
+ // is invoked two times on the same slice buffer.
+ sb->base_slices = sb->slices = sb->inlined;
}
}
@@ -232,19 +235,19 @@ void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) {
memcpy(a->base_slices, b->inlined, b_count * sizeof(grpc_slice));
} else {
/* no inlining: easy swap */
- GPR_SWAP(grpc_slice*, a->base_slices, b->base_slices);
+ std::swap(a->base_slices, b->base_slices);
}
- /* Update the slices pointers (cannot do a GPR_SWAP on slices fields here).
+ /* Update the slices pointers (cannot do a std::swap on slices fields here).
* Also note that since the base_slices pointers are already swapped we need
* use 'b_offset' for 'a->base_slices' and vice versa */
a->slices = a->base_slices + b_offset;
b->slices = b->base_slices + a_offset;
/* base_slices and slices fields are correctly set. Swap all other fields */
- GPR_SWAP(size_t, a->count, b->count);
- GPR_SWAP(size_t, a->capacity, b->capacity);
- GPR_SWAP(size_t, a->length, b->length);
+ std::swap(a->count, b->count);
+ std::swap(a->capacity, b->capacity);
+ std::swap(a->length, b->length);
}
void grpc_slice_buffer_move_into(grpc_slice_buffer* src,
diff --git a/grpc/src/core/lib/slice/slice_intern.cc b/grpc/src/core/lib/slice/slice_intern.cc
deleted file mode 100644
index 04681304..00000000
--- a/grpc/src/core/lib/slice/slice_intern.cc
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- *
- * 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/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_utils.h"
-
-#include <inttypes.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/gpr/murmur_hash.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/iomgr_internal.h" /* for iomgr_abort_on_leaks() */
-#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-#define LOG2_SHARD_COUNT 5
-#define SHARD_COUNT (1 << LOG2_SHARD_COUNT)
-#define INITIAL_SHARD_CAPACITY 8
-
-#define TABLE_IDX(hash, capacity) (((hash) >> LOG2_SHARD_COUNT) % (capacity))
-#define SHARD_IDX(hash) ((hash) & ((1 << LOG2_SHARD_COUNT) - 1))
-
-using grpc_core::InternedSliceRefcount;
-
-typedef struct slice_shard {
- grpc_core::Mutex mu;
- InternedSliceRefcount** strs;
- size_t count;
- size_t capacity;
-} slice_shard;
-
-static slice_shard* g_shards;
-
-struct static_metadata_hash_ent {
- uint32_t hash;
- uint32_t idx;
-};
-static static_metadata_hash_ent
- static_metadata_hash[4 * GRPC_STATIC_MDSTR_COUNT];
-static uint32_t max_static_metadata_hash_probe;
-uint32_t grpc_static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT];
-
-namespace grpc_core {
-
-/* hash seed: decided at initialization time */
-uint32_t g_hash_seed;
-static bool g_forced_hash_seed = false;
-
-InternedSliceRefcount::~InternedSliceRefcount() {
- slice_shard* shard = &g_shards[SHARD_IDX(this->hash)];
- MutexLock lock(&shard->mu);
- InternedSliceRefcount** prev_next;
- InternedSliceRefcount* cur;
- for (prev_next = &shard->strs[TABLE_IDX(this->hash, shard->capacity)],
- cur = *prev_next;
- cur != this; prev_next = &cur->bucket_next, cur = cur->bucket_next) {
- }
- *prev_next = cur->bucket_next;
- shard->count--;
-}
-
-} // namespace grpc_core
-
-static void grow_shard(slice_shard* shard) {
- GPR_TIMER_SCOPE("grow_strtab", 0);
-
- size_t capacity = shard->capacity * 2;
- size_t i;
- InternedSliceRefcount** strtab;
- InternedSliceRefcount *s, *next;
-
- strtab = static_cast<InternedSliceRefcount**>(
- gpr_zalloc(sizeof(InternedSliceRefcount*) * capacity));
-
- for (i = 0; i < shard->capacity; i++) {
- for (s = shard->strs[i]; s; s = next) {
- size_t idx = TABLE_IDX(s->hash, capacity);
- next = s->bucket_next;
- s->bucket_next = strtab[idx];
- strtab[idx] = s;
- }
- }
- gpr_free(shard->strs);
- shard->strs = strtab;
- shard->capacity = capacity;
-}
-
-grpc_core::InternedSlice::InternedSlice(InternedSliceRefcount* s) {
- refcount = &s->base;
- data.refcounted.bytes = reinterpret_cast<uint8_t*>(s + 1);
- data.refcounted.length = s->length;
-}
-
-uint32_t grpc_slice_default_hash_impl(grpc_slice s) {
- return gpr_murmur_hash3(GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s),
- grpc_core::g_hash_seed);
-}
-
-uint32_t grpc_static_slice_hash(grpc_slice s) {
- return grpc_static_metadata_hash_values[GRPC_STATIC_METADATA_INDEX(s)];
-}
-
-int grpc_static_slice_eq(grpc_slice a, grpc_slice b) {
- return GRPC_STATIC_METADATA_INDEX(a) == GRPC_STATIC_METADATA_INDEX(b);
-}
-
-uint32_t grpc_slice_hash(grpc_slice s) { return grpc_slice_hash_internal(s); }
-
-grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
- bool* returned_slice_is_different) {
- if (GRPC_IS_STATIC_METADATA_STRING(slice)) {
- return slice;
- }
-
- uint32_t hash = grpc_slice_hash_internal(slice);
- for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
- static_metadata_hash_ent ent =
- static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
- if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
- grpc_slice_eq_static_interned(slice, static_slice_table[ent.idx])) {
- *returned_slice_is_different = true;
- return static_slice_table[ent.idx];
- }
- }
-
- return slice;
-}
-
-grpc_slice grpc_slice_intern(grpc_slice slice) {
- /* TODO(arjunroy): At present, this is capable of returning either a static or
- an interned slice. This yields weirdness like the constructor for
- ManagedMemorySlice instantiating itself as an instance of a derived type
- (StaticMetadataSlice or InternedSlice). Should reexamine. */
- return grpc_core::ManagedMemorySlice(&slice);
-}
-
-// Attempt to see if the provided slice or string matches a static slice.
-// SliceArgs is either a const grpc_slice& or const pair<const char*, size_t>&.
-// In either case, hash is the pre-computed hash value.
-//
-// Returns: a matching static slice, or null.
-template <typename SliceArgs>
-static const grpc_core::StaticMetadataSlice* MatchStaticSlice(
- uint32_t hash, const SliceArgs& args) {
- for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
- static_metadata_hash_ent ent =
- static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
- if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
- static_slice_table[ent.idx] == args) {
- return &static_slice_table[ent.idx];
- }
- }
- return nullptr;
-}
-
-// Helper methods to enable us to select appropriately overloaded slice methods
-// whether we're dealing with a slice, or a buffer with length, when interning
-// strings. Helpers for FindOrCreateInternedSlice().
-static const char* GetBuffer(const std::pair<const char*, size_t>& buflen) {
- return buflen.first;
-}
-static size_t GetLength(const std::pair<const char*, size_t>& buflen) {
- return buflen.second;
-}
-static const void* GetBuffer(const grpc_slice& slice) {
- return GRPC_SLICE_START_PTR(slice);
-}
-static size_t GetLength(const grpc_slice& slice) {
- return GRPC_SLICE_LENGTH(slice);
-}
-
-// Creates an interned slice for a string that does not currently exist in the
-// intern table. SliceArgs is either a const grpc_slice& or a const
-// pair<const char*, size_t>&. Hash is the pre-computed hash value. We must
-// already hold the shard lock. Helper for FindOrCreateInternedSlice().
-//
-// Returns: a newly interned slice.
-template <typename SliceArgs>
-static InternedSliceRefcount* InternNewStringLocked(slice_shard* shard,
- size_t shard_idx,
- uint32_t hash,
- const SliceArgs& args) {
- /* string data goes after the internal_string header */
- size_t len = GetLength(args);
- const void* buffer = GetBuffer(args);
- InternedSliceRefcount* s =
- static_cast<InternedSliceRefcount*>(gpr_malloc(sizeof(*s) + len));
- new (s) grpc_core::InternedSliceRefcount(len, hash, shard->strs[shard_idx]);
- // TODO(arjunroy): Investigate why hpack tried to intern the nullptr string.
- // https://github.com/grpc/grpc/pull/20110#issuecomment-526729282
- if (len > 0) {
- memcpy(reinterpret_cast<char*>(s + 1), buffer, len);
- }
- shard->strs[shard_idx] = s;
- shard->count++;
- if (shard->count > shard->capacity * 2) {
- grow_shard(shard);
- }
- return s;
-}
-
-// Attempt to see if the provided slice or string matches an existing interned
-// slice. SliceArgs... is either a const grpc_slice& or a string and length. In
-// either case, hash is the pre-computed hash value. We must already hold the
-// shard lock. Helper for FindOrCreateInternedSlice().
-//
-// Returns: a pre-existing matching static slice, or null.
-template <typename SliceArgs>
-static InternedSliceRefcount* MatchInternedSliceLocked(uint32_t hash,
- size_t idx,
- const SliceArgs& args) {
- InternedSliceRefcount* s;
- slice_shard* shard = &g_shards[SHARD_IDX(hash)];
- /* search for an existing string */
- for (s = shard->strs[idx]; s; s = s->bucket_next) {
- if (s->hash == hash && grpc_core::InternedSlice(s) == args) {
- if (s->refcnt.RefIfNonZero()) {
- return s;
- }
- }
- }
- return nullptr;
-}
-
-// Attempt to see if the provided slice or string matches an existing interned
-// slice, and failing that, create an interned slice with its contents. Returns
-// either the existing matching interned slice or the newly created one.
-// SliceArgs is either a const grpc_slice& or const pair<const char*, size_t>&.
-// In either case, hash is the pre-computed hash value. We do not hold the
-// shard lock here, but do take it.
-//
-// Returns: an interned slice, either pre-existing/matched or newly created.
-template <typename SliceArgs>
-static InternedSliceRefcount* FindOrCreateInternedSlice(uint32_t hash,
- const SliceArgs& args) {
- slice_shard* shard = &g_shards[SHARD_IDX(hash)];
- grpc_core::MutexLock lock(&shard->mu);
- const size_t idx = TABLE_IDX(hash, shard->capacity);
- InternedSliceRefcount* s = MatchInternedSliceLocked(hash, idx, args);
- if (s == nullptr) {
- s = InternNewStringLocked(shard, idx, hash, args);
- }
- return s;
-}
-
-grpc_core::ManagedMemorySlice::ManagedMemorySlice(const char* string)
- : grpc_core::ManagedMemorySlice::ManagedMemorySlice(string,
- strlen(string)) {}
-
-grpc_core::ManagedMemorySlice::ManagedMemorySlice(const char* buf, size_t len) {
- GPR_TIMER_SCOPE("grpc_slice_intern", 0);
- const uint32_t hash = gpr_murmur_hash3(buf, len, g_hash_seed);
- const StaticMetadataSlice* static_slice =
- MatchStaticSlice(hash, std::pair<const char*, size_t>(buf, len));
- if (static_slice) {
- *this = *static_slice;
- } else {
- *this = grpc_core::InternedSlice(FindOrCreateInternedSlice(
- hash, std::pair<const char*, size_t>(buf, len)));
- }
-}
-
-grpc_core::ManagedMemorySlice::ManagedMemorySlice(const grpc_slice* slice_ptr) {
- GPR_TIMER_SCOPE("grpc_slice_intern", 0);
- const grpc_slice& slice = *slice_ptr;
- if (GRPC_IS_STATIC_METADATA_STRING(slice)) {
- *this = static_cast<const grpc_core::StaticMetadataSlice&>(slice);
- return;
- }
- const uint32_t hash = grpc_slice_hash_internal(slice);
- const StaticMetadataSlice* static_slice = MatchStaticSlice(hash, slice);
- if (static_slice) {
- *this = *static_slice;
- } else {
- *this = grpc_core::InternedSlice(FindOrCreateInternedSlice(hash, slice));
- }
-}
-
-void grpc_test_only_set_slice_hash_seed(uint32_t seed) {
- grpc_core::g_hash_seed = seed;
- grpc_core::g_forced_hash_seed = true;
-}
-
-void grpc_slice_intern_init(void) {
- if (!grpc_core::g_forced_hash_seed) {
- grpc_core::g_hash_seed =
- static_cast<uint32_t>(gpr_now(GPR_CLOCK_REALTIME).tv_nsec);
- }
- g_shards = new slice_shard[SHARD_COUNT];
- for (size_t i = 0; i < SHARD_COUNT; i++) {
- slice_shard* shard = &g_shards[i];
- shard->count = 0;
- shard->capacity = INITIAL_SHARD_CAPACITY;
- shard->strs = static_cast<InternedSliceRefcount**>(
- gpr_zalloc(sizeof(*shard->strs) * shard->capacity));
- }
- for (size_t i = 0; i < GPR_ARRAY_SIZE(static_metadata_hash); i++) {
- static_metadata_hash[i].hash = 0;
- static_metadata_hash[i].idx = GRPC_STATIC_MDSTR_COUNT;
- }
- max_static_metadata_hash_probe = 0;
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
- for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
- grpc_static_metadata_hash_values[i] =
- grpc_slice_default_hash_internal(static_slice_table[i]);
- for (size_t j = 0; j < GPR_ARRAY_SIZE(static_metadata_hash); j++) {
- size_t slot = (grpc_static_metadata_hash_values[i] + j) %
- GPR_ARRAY_SIZE(static_metadata_hash);
- if (static_metadata_hash[slot].idx == GRPC_STATIC_MDSTR_COUNT) {
- static_metadata_hash[slot].hash = grpc_static_metadata_hash_values[i];
- static_metadata_hash[slot].idx = static_cast<uint32_t>(i);
- if (j > max_static_metadata_hash_probe) {
- max_static_metadata_hash_probe = static_cast<uint32_t>(j);
- }
- break;
- }
- }
- }
- // Handle KV hash for all static mdelems.
- for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; ++i) {
- grpc_static_mdelem_table()[i].HashInit();
- }
-}
-
-void grpc_slice_intern_shutdown(void) {
- for (size_t i = 0; i < SHARD_COUNT; i++) {
- slice_shard* shard = &g_shards[i];
- /* TODO(ctiller): GPR_ASSERT(shard->count == 0); */
- if (shard->count != 0) {
- gpr_log(GPR_DEBUG, "WARNING: %" PRIuPTR " metadata strings were leaked",
- shard->count);
- for (size_t j = 0; j < shard->capacity; j++) {
- for (InternedSliceRefcount* s = shard->strs[j]; s; s = s->bucket_next) {
- char* text = grpc_dump_slice(grpc_core::InternedSlice(s),
- GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_DEBUG, "LEAKED: %s", text);
- gpr_free(text);
- }
- }
- if (grpc_iomgr_abort_on_leaks()) {
- abort();
- }
- }
- gpr_free(shard->strs);
- }
- delete[] g_shards;
-}
diff --git a/grpc/src/core/lib/slice/slice_internal.h b/grpc/src/core/lib/slice/slice_internal.h
index 1cbe32ba..d4f22bbf 100644
--- a/grpc/src/core/lib/slice/slice_internal.h
+++ b/grpc/src/core/lib/slice/slice_internal.h
@@ -21,259 +21,18 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
+#include <string.h>
+
+#include "absl/strings/string_view.h"
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
-#include <string.h>
+#include <grpc/support/log.h>
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/slice/slice_utils.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-// Interned slices have specific fast-path operations for hashing. To inline
-// these operations, we need to forward declare them here.
-extern uint32_t grpc_static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT];
-
-// grpc_slice_refcount : A reference count for grpc_slice.
-//
-// Non-inlined grpc_slice objects are refcounted. Historically this was
-// implemented via grpc_slice_refcount, a C-style polymorphic class using a
-// manually managed vtable of operations. Subclasses would define their own
-// vtable; the 'virtual' methods (ref, unref, equals and hash) would simply call
-// the function pointers in the vtable as necessary.
-//
-// Unfortunately, this leads to some inefficiencies in the generated code that
-// can be improved upon. For example, equality checking for interned slices is a
-// simple equality check on the refcount pointer. With the vtable approach, this
-// would translate to roughly the following (high-level) instructions:
-//
-// grpc_slice_equals(slice1, slice2):
-// load vtable->eq -> eq_func
-// call eq_func(slice1, slice2)
-//
-// interned_slice_equals(slice1, slice2)
-// load slice1.ref -> r1
-// load slice2.ref -> r2
-// cmp r1, r2 -> retval
-// ret retval
-//
-// This leads to a function call for a function defined in another translation
-// unit, which imposes memory barriers, which reduces the compiler's ability to
-// optimize (in addition to the added overhead of call/ret). Additionally, it
-// may be harder to reason about branch prediction when we're jumping to
-// essentially arbitrarily provided function pointers.
-//
-// In addition, it is arguable that while virtualization was helpful for
-// Equals()/Hash() methods, that it was fundamentally unnecessary for
-// Ref()/Unref().
-//
-// Instead, grpc_slice_refcount provides the same functionality as the C-style
-// virtual class, but in a de-virtualized manner - Eq(), Hash(), Ref() and
-// Unref() are provided within this header file. Fastpaths for Eq()/Hash()
-// (interned and static metadata slices), as well as the Ref() operation, can
-// all be inlined without any memory barriers.
-//
-// It does this by:
-// 1. Using grpc_core::RefCount<> (header-only) for Ref/Unref. Two special cases
-// need support: No-op ref/unref (eg. static metadata slices) and stream
-// slice references (where all the slices share the streamref). This is in
-// addition to the normal case of '1 slice, 1 ref'.
-// To support these cases, we explicitly track a nullable pointer to the
-// underlying RefCount<>. No-op ref/unref is used by checking the pointer for
-// null, and doing nothing if it is. Both stream slice refs and 'normal'
-// slices use the same path for Ref/Unref (by targeting the non-null
-// pointer).
-//
-// 2. introducing the notion of grpc_slice_refcount::Type. This describes if a
-// slice ref is used by a static metadata slice, an interned slice, or other
-// slices. We switch on the slice ref type in order to provide fastpaths for
-// Equals() and Hash().
-//
-// In total, this saves us roughly 1-2% latency for unary calls, with smaller
-// calls benefitting. The effect is present, but not as useful, for larger calls
-// where the cost of sending the data dominates.
-// TODO(arjunroy): Investigate if this can be removed with strongly typed
-// grpc_slices.
-struct grpc_slice_refcount {
- public:
- enum class Type {
- STATIC, // Refcount for a static metadata slice.
- INTERNED, // Refcount for an interned slice.
- NOP, // No-Op
- REGULAR // Refcount for non-static-metadata, non-interned slices.
- };
- typedef void (*DestroyerFn)(void*);
-
- grpc_slice_refcount() = default;
-
- explicit grpc_slice_refcount(Type t) : ref_type_(t) {}
-
- explicit grpc_slice_refcount(grpc_slice_refcount* sub) : sub_refcount_(sub) {}
- // Regular constructor for grpc_slice_refcount.
- //
- // Parameters:
- // 1. grpc_slice_refcount::Type type
- // Whether we are the refcount for a static
- // metadata slice, an interned slice, or any other kind of slice.
- //
- // 2. RefCount* ref
- // The pointer to the actual underlying grpc_core::RefCount. Rather than
- // performing struct offset computations as in the original implementation to
- // get to the refcount, which requires a virtual method, we devirtualize by
- // using a nullable pointer to allow a single pair of Ref/Unref methods.
- //
- // 3. DestroyerFn destroyer_fn
- // Called when the refcount goes to 0, with destroyer_arg as parameter.
- //
- // 4. void* destroyer_arg
- // Argument for the virtualized destructor.
- //
- // 5. grpc_slice_refcount* sub
- // Argument used for interned slices.
- grpc_slice_refcount(grpc_slice_refcount::Type type, grpc_core::RefCount* ref,
- DestroyerFn destroyer_fn, void* destroyer_arg,
- grpc_slice_refcount* sub)
- : ref_(ref),
- ref_type_(type),
- sub_refcount_(sub),
- dest_fn_(destroyer_fn),
- destroy_fn_arg_(destroyer_arg) {}
- // Initializer for static refcounts.
- grpc_slice_refcount(grpc_slice_refcount* sub, Type type)
- : ref_type_(type), sub_refcount_(sub) {}
-
- Type GetType() const { return ref_type_; }
-
- int Eq(const grpc_slice& a, const grpc_slice& b);
-
- uint32_t Hash(const grpc_slice& slice);
- void Ref() {
- if (ref_ == nullptr) return;
- ref_->RefNonZero();
- }
- void Unref() {
- if (ref_ == nullptr) return;
- if (ref_->Unref()) {
- dest_fn_(destroy_fn_arg_);
- }
- }
-
- grpc_slice_refcount* sub_refcount() const { return sub_refcount_; }
-
- private:
- grpc_core::RefCount* ref_ = nullptr;
- const Type ref_type_ = Type::REGULAR;
- grpc_slice_refcount* sub_refcount_ = this;
- DestroyerFn dest_fn_ = nullptr;
- void* destroy_fn_arg_ = nullptr;
-};
-
-namespace grpc_core {
-
-struct StaticSliceRefcount {
- static grpc_slice_refcount kStaticSubRefcount;
-
- explicit StaticSliceRefcount(uint32_t index)
- : base(&kStaticSubRefcount, grpc_slice_refcount::Type::STATIC),
- index(index) {}
-
- grpc_slice_refcount base;
- const uint32_t index;
-};
-
-extern grpc_slice_refcount kNoopRefcount;
-
-struct InternedSliceRefcount {
- static void Destroy(void* arg) {
- auto* rc = static_cast<InternedSliceRefcount*>(arg);
- rc->~InternedSliceRefcount();
- gpr_free(rc);
- }
-
- InternedSliceRefcount(size_t length, uint32_t hash,
- InternedSliceRefcount* bucket_next)
- : base(grpc_slice_refcount::Type::INTERNED, &refcnt, Destroy, this, &sub),
- sub(grpc_slice_refcount::Type::REGULAR, &refcnt, Destroy, this, &sub),
- length(length),
- hash(hash),
- bucket_next(bucket_next) {}
-
- ~InternedSliceRefcount();
-
- grpc_slice_refcount base;
- grpc_slice_refcount sub;
- const size_t length;
- RefCount refcnt;
- const uint32_t hash;
- InternedSliceRefcount* bucket_next;
-};
-
-} // namespace grpc_core
-
-inline size_t grpc_refcounted_slice_length(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- return slice.data.refcounted.length;
-}
-
-inline const uint8_t* grpc_refcounted_slice_data(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- return slice.data.refcounted.bytes;
-}
-
-inline int grpc_slice_refcount::Eq(const grpc_slice& a, const grpc_slice& b) {
- GPR_DEBUG_ASSERT(a.refcount != nullptr);
- GPR_DEBUG_ASSERT(a.refcount == this);
- switch (ref_type_) {
- case Type::STATIC:
- GPR_DEBUG_ASSERT(
- (GRPC_STATIC_METADATA_INDEX(a) == GRPC_STATIC_METADATA_INDEX(b)) ==
- (a.refcount == b.refcount));
- case Type::INTERNED:
- return a.refcount == b.refcount;
- case Type::NOP:
- case Type::REGULAR:
- break;
- }
- if (grpc_refcounted_slice_length(a) != GRPC_SLICE_LENGTH(b)) return false;
- if (grpc_refcounted_slice_length(a) == 0) return true;
- return 0 == memcmp(grpc_refcounted_slice_data(a), GRPC_SLICE_START_PTR(b),
- grpc_refcounted_slice_length(a));
-}
-
-inline uint32_t grpc_slice_refcount::Hash(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- GPR_DEBUG_ASSERT(slice.refcount == this);
- switch (ref_type_) {
- case Type::STATIC:
- return ::grpc_static_metadata_hash_values[GRPC_STATIC_METADATA_INDEX(
- slice)];
- case Type::INTERNED:
- return reinterpret_cast<grpc_core::InternedSliceRefcount*>(slice.refcount)
- ->hash;
- case Type::NOP:
- case Type::REGULAR:
- break;
- }
- return gpr_murmur_hash3(grpc_refcounted_slice_data(slice),
- grpc_refcounted_slice_length(slice),
- grpc_core::g_hash_seed);
-}
-
-inline const grpc_slice& grpc_slice_ref_internal(const grpc_slice& slice) {
- if (slice.refcount) {
- slice.refcount->Ref();
- }
- return slice;
-}
-
-inline void grpc_slice_unref_internal(const grpc_slice& slice) {
- if (slice.refcount) {
- slice.refcount->Unref();
- }
-}
+#include "src/core/lib/slice/slice_refcount.h"
void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer* sb);
void grpc_slice_buffer_partial_unref_internal(grpc_slice_buffer* sb,
@@ -294,22 +53,6 @@ void grpc_slice_buffer_remove_first(grpc_slice_buffer* sb);
void grpc_slice_buffer_sub_first(grpc_slice_buffer* sb, size_t begin,
size_t end);
-/* Check if a slice is interned */
-bool grpc_slice_is_interned(const grpc_slice& slice);
-inline bool grpc_slice_is_interned(const grpc_slice& slice) {
- return (slice.refcount &&
- (slice.refcount->GetType() == grpc_slice_refcount::Type::INTERNED ||
- slice.refcount->GetType() == grpc_slice_refcount::Type::STATIC));
-}
-
-inline bool grpc_slice_static_interned_equal(const grpc_slice& a,
- const grpc_slice& b) {
- GPR_DEBUG_ASSERT(grpc_slice_is_interned(a) && grpc_slice_is_interned(b));
- return a.refcount == b.refcount;
-}
-
-void grpc_slice_intern_init(void);
-void grpc_slice_intern_shutdown(void);
void grpc_test_only_set_slice_hash_seed(uint32_t seed);
// if slice matches a static slice, returns the static slice
// otherwise returns the passed in slice (without reffing it)
@@ -320,21 +63,11 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
uint32_t grpc_static_slice_hash(grpc_slice s);
int grpc_static_slice_eq(grpc_slice a, grpc_slice b);
-inline uint32_t grpc_slice_hash_refcounted(const grpc_slice& s) {
- GPR_DEBUG_ASSERT(s.refcount != nullptr);
- return s.refcount->Hash(s);
-}
-
-inline uint32_t grpc_slice_default_hash_internal(const grpc_slice& s) {
+inline uint32_t grpc_slice_hash_internal(const grpc_slice& s) {
return gpr_murmur_hash3(GRPC_SLICE_START_PTR(s), GRPC_SLICE_LENGTH(s),
grpc_core::g_hash_seed);
}
-inline uint32_t grpc_slice_hash_internal(const grpc_slice& s) {
- return s.refcount == nullptr ? grpc_slice_default_hash_internal(s)
- : grpc_slice_hash_refcounted(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);
@@ -345,9 +78,6 @@ grpc_slice grpc_slice_from_cpp_string(std::string str);
// 0. All other slices will return the size of the allocated chars.
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 {
@@ -356,6 +86,15 @@ struct SliceHash {
}
};
+extern uint32_t g_hash_seed;
+
+// Converts grpc_slice to absl::string_view.
+inline absl::string_view StringViewFromSlice(const grpc_slice& slice) {
+ return absl::string_view(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(slice)),
+ GRPC_SLICE_LENGTH(slice));
+}
+
} // namespace grpc_core
inline bool operator==(const grpc_slice& s1, const grpc_slice& s2) {
diff --git a/grpc/src/core/lib/slice/slice_refcount.cc b/grpc/src/core/lib/slice/slice_refcount.cc
new file mode 100644
index 00000000..dc42de1d
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_refcount.cc
@@ -0,0 +1,35 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/slice/slice_refcount.h"
+
+#include <chrono>
+
+namespace grpc_core {
+
+uint32_t g_hash_seed = []() {
+ auto now = std::chrono::system_clock::now();
+ auto now_since_epoch = now.time_since_epoch();
+ auto now_ns =
+ std::chrono::duration_cast<std::chrono::nanoseconds>(now_since_epoch);
+ return static_cast<uint32_t>(now_ns.count());
+}();
+
+} // namespace grpc_core
+
+void grpc_test_only_set_slice_hash_seed(uint32_t seed) {
+ grpc_core::g_hash_seed = seed;
+}
diff --git a/grpc/src/core/lib/slice/slice_refcount.h b/grpc/src/core/lib/slice/slice_refcount.h
new file mode 100644
index 00000000..c3a90ca6
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_refcount.h
@@ -0,0 +1,46 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SLICE_SLICE_REFCOUNT_H
+#define GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/gpr/murmur_hash.h"
+#include "src/core/lib/slice/slice_refcount_base.h"
+
+namespace grpc_core {
+
+extern uint32_t g_hash_seed;
+
+} // namespace grpc_core
+
+inline const grpc_slice& grpc_slice_ref_internal(const grpc_slice& slice) {
+ if (reinterpret_cast<uintptr_t>(slice.refcount) > 1) {
+ slice.refcount->Ref();
+ }
+ return slice;
+}
+
+inline void grpc_slice_unref_internal(const grpc_slice& slice) {
+ if (reinterpret_cast<uintptr_t>(slice.refcount) > 1) {
+ slice.refcount->Unref();
+ }
+}
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H */
diff --git a/grpc/src/core/lib/slice/slice_refcount_base.h b/grpc/src/core/lib/slice/slice_refcount_base.h
new file mode 100644
index 00000000..79aaf9c1
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_refcount_base.h
@@ -0,0 +1,61 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_SLICE_SLICE_REFCOUNT_BASE_H
+#define GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_BASE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+#include <grpc/slice.h>
+#include <grpc/support/log.h>
+
+// grpc_slice_refcount : A reference count for grpc_slice.
+struct grpc_slice_refcount {
+ public:
+ typedef void (*DestroyerFn)(grpc_slice_refcount*);
+
+ static grpc_slice_refcount* NoopRefcount() {
+ return reinterpret_cast<grpc_slice_refcount*>(1);
+ }
+
+ grpc_slice_refcount() = default;
+
+ // Regular constructor for grpc_slice_refcount.
+ //
+ // Parameters:
+ // 1. DestroyerFn destroyer_fn
+ // Called when the refcount goes to 0, with 'this' as parameter.
+ explicit grpc_slice_refcount(DestroyerFn destroyer_fn)
+ : destroyer_fn_(destroyer_fn) {}
+
+ void Ref() { ref_.fetch_add(1, std::memory_order_relaxed); }
+ void Unref() {
+ if (ref_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
+ destroyer_fn_(this);
+ }
+ }
+
+ // Is this the only instance?
+ // For this to be useful the caller needs to ensure that if this is the only
+ // instance, no other instance could be created during this call.
+ bool IsUnique() const { return ref_.load(std::memory_order_relaxed) == 1; }
+
+ private:
+ std::atomic<size_t> ref_{1};
+ DestroyerFn destroyer_fn_ = nullptr;
+};
+
+#endif // GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_BASE_H
diff --git a/grpc/src/core/lib/slice/slice_split.cc b/grpc/src/core/lib/slice/slice_split.cc
new file mode 100644
index 00000000..d2a951cb
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_split.cc
@@ -0,0 +1,100 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/slice/slice_split.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+/** Finds the initial (\a begin) and final (\a end) offsets of the next
+ * substring from \a str + \a read_offset until the next \a sep or the end of \a
+ * str.
+ *
+ * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
+static int slice_find_separator_offset(const grpc_slice str, const char* sep,
+ const size_t read_offset, size_t* begin,
+ size_t* end) {
+ size_t i;
+ const uint8_t* str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
+ const size_t str_len = GRPC_SLICE_LENGTH(str) - read_offset;
+ const size_t sep_len = strlen(sep);
+ if (str_len < sep_len) {
+ return 0;
+ }
+
+ for (i = 0; i <= str_len - sep_len; i++) {
+ if (memcmp(str_ptr + i, sep, sep_len) == 0) {
+ *begin = read_offset;
+ *end = read_offset + i;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static void skip_leading_trailing_spaces(const uint8_t* str_buffer,
+ size_t* begin, size_t* end) {
+ while (*begin < *end && str_buffer[*begin] == ' ') {
+ (*begin)++;
+ }
+ while (*begin < *end && str_buffer[*end - 1] == ' ') {
+ (*end)--;
+ }
+}
+
+static void grpc_slice_split_inner(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst, bool no_space) {
+ const size_t sep_len = strlen(sep);
+ size_t begin, end;
+ const uint8_t* str_buffer = GRPC_SLICE_START_PTR(str);
+ size_t sep_pos;
+
+ GPR_ASSERT(sep_len > 0);
+
+ if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
+ do {
+ sep_pos = end;
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ } while (slice_find_separator_offset(str, sep, sep_pos + sep_len, &begin,
+ &end) != 0);
+ begin = sep_pos + sep_len;
+ end = GRPC_SLICE_LENGTH(str);
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ } else { /* no sep found, add whole input */
+ begin = 0;
+ end = GRPC_SLICE_LENGTH(str);
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ }
+}
+
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst) {
+ grpc_slice_split_inner(str, sep, dst, false);
+}
+
+void grpc_slice_split_without_space(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst) {
+ grpc_slice_split_inner(str, sep, dst, true);
+}
diff --git a/grpc/src/core/lib/slice/slice_split.h b/grpc/src/core/lib/slice/slice_split.h
new file mode 100644
index 00000000..835b16a8
--- /dev/null
+++ b/grpc/src/core/lib/slice/slice_split.h
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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_SLICE_SLICE_SPLIT_H
+#define GRPC_CORE_LIB_SLICE_SLICE_SPLIT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#include <grpc/slice.h>
+#include <grpc/slice_buffer.h>
+
+/** Split \a str by the separator \a sep. Results are stored in \a dst, which
+ * should be a properly initialized instance. */
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
+
+/** Split \a str by the separator \a sep and remove the leading and trailing
+ * spaces of each resulting token. Results are stored in \a dst, which should be
+ * a properly initialized instance. */
+void grpc_slice_split_without_space(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst);
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_SPLIT_H */
diff --git a/grpc/src/core/lib/slice/slice_string_helpers.cc b/grpc/src/core/lib/slice/slice_string_helpers.cc
index 7887e030..35744d0a 100644
--- a/grpc/src/core/lib/slice/slice_string_helpers.cc
+++ b/grpc/src/core/lib/slice/slice_string_helpers.cc
@@ -20,10 +20,6 @@
#include "src/core/lib/slice/slice_string_helpers.h"
-#include <string.h>
-
-#include <grpc/support/log.h>
-
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -41,85 +37,6 @@ grpc_slice grpc_dump_slice_to_slice(const grpc_slice& s, uint32_t flags) {
return grpc_slice_from_moved_buffer(std::move(ptr), len);
}
-/** Finds the initial (\a begin) and final (\a end) offsets of the next
- * substring from \a str + \a read_offset until the next \a sep or the end of \a
- * str.
- *
- * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
-static int slice_find_separator_offset(const grpc_slice str, const char* sep,
- const size_t read_offset, size_t* begin,
- size_t* end) {
- size_t i;
- const uint8_t* str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
- const size_t str_len = GRPC_SLICE_LENGTH(str) - read_offset;
- const size_t sep_len = strlen(sep);
- if (str_len < sep_len) {
- return 0;
- }
-
- for (i = 0; i <= str_len - sep_len; i++) {
- if (memcmp(str_ptr + i, sep, sep_len) == 0) {
- *begin = read_offset;
- *end = read_offset + i;
- return 1;
- }
- }
- return 0;
-}
-
-static void skip_leading_trailing_spaces(const uint8_t* str_buffer,
- size_t* begin, size_t* end) {
- while (*begin < *end && str_buffer[*begin] == ' ') {
- (*begin)++;
- }
- while (*begin < *end && str_buffer[*end - 1] == ' ') {
- (*end)--;
- }
-}
-
-static void grpc_slice_split_inner(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst, bool no_space) {
- const size_t sep_len = strlen(sep);
- size_t begin, end;
- const uint8_t* str_buffer = GRPC_SLICE_START_PTR(str);
- size_t sep_pos;
-
- GPR_ASSERT(sep_len > 0);
-
- if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
- do {
- sep_pos = end;
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- } while (slice_find_separator_offset(str, sep, sep_pos + sep_len, &begin,
- &end) != 0);
- begin = sep_pos + sep_len;
- end = GRPC_SLICE_LENGTH(str);
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- } else { /* no sep found, add whole input */
- begin = 0;
- end = GRPC_SLICE_LENGTH(str);
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- }
-}
-
-void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst) {
- grpc_slice_split_inner(str, sep, dst, false);
-}
-
-void grpc_slice_split_without_space(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst) {
- grpc_slice_split_inner(str, sep, dst, true);
-}
-
bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result) {
return gpr_parse_bytes_to_uint32(
reinterpret_cast<const char*> GRPC_SLICE_START_PTR(str),
diff --git a/grpc/src/core/lib/slice/slice_string_helpers.h b/grpc/src/core/lib/slice/slice_string_helpers.h
index 6551a6df..df9cadd5 100644
--- a/grpc/src/core/lib/slice/slice_string_helpers.h
+++ b/grpc/src/core/lib/slice/slice_string_helpers.h
@@ -25,7 +25,6 @@
#include <stddef.h>
#include <grpc/slice.h>
-#include <grpc/slice_buffer.h>
#include "src/core/lib/gpr/string.h"
@@ -34,16 +33,6 @@ char* grpc_dump_slice(const grpc_slice& slice, uint32_t flags);
/* Calls gpr_dump on a slice and returns the result as a slice. */
grpc_slice grpc_dump_slice_to_slice(const grpc_slice& slice, uint32_t flags);
-/** Split \a str by the separator \a sep. Results are stored in \a dst, which
- * should be a properly initialized instance. */
-void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
-
-/** Split \a str by the separator \a sep and remove the leading and trailing
- * spaces of each resulting token. Results are stored in \a dst, which should be
- * a properly initialized instance. */
-void grpc_slice_split_without_space(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst);
-
bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result);
#endif /* GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H */
diff --git a/grpc/src/core/lib/slice/slice_utils.h b/grpc/src/core/lib/slice/slice_utils.h
deleted file mode 100644
index d9a4253c..00000000
--- a/grpc/src/core/lib/slice/slice_utils.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- *
- * 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_SLICE_SLICE_UTILS_H
-#define GRPC_CORE_LIB_SLICE_SLICE_UTILS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <cstring>
-
-#include "absl/strings/string_view.h"
-
-#include <grpc/slice.h>
-
-#include "src/core/lib/gpr/murmur_hash.h"
-
-namespace grpc_core {
-extern uint32_t g_hash_seed;
-} // namespace grpc_core
-
-// When we compare two slices, and we know the latter is not inlined, we can
-// short circuit our comparison operator. We specifically use differs()
-// semantics instead of equals() semantics due to more favourable code
-// generation when using differs(). Specifically, we may use the output of
-// grpc_slice_differs_refcounted for control flow. If we use differs()
-// semantics, we end with a tailcall to memcmp(). If we use equals() semantics,
-// we need to invert the result that memcmp provides us, which costs several
-// instructions to do so. If we're using the result for control flow (i.e.
-// branching based on the output) then we're just performing the extra
-// operations to invert the result pointlessly. Concretely, we save 6 ops on
-// x86-64/clang with differs().
-int grpc_slice_differs_refcounted(const grpc_slice& a,
- const grpc_slice& b_not_inline);
-
-// When we compare two slices, and we *know* that one of them is static or
-// interned, we can short circuit our slice equality function. The second slice
-// here must be static or interned; slice a can be any slice, inlined or not.
-inline bool grpc_slice_eq_static_interned(const grpc_slice& a,
- const grpc_slice& b_static_interned) {
- if (a.refcount == b_static_interned.refcount) {
- return true;
- }
- return !grpc_slice_differs_refcounted(a, b_static_interned);
-}
-
-// TODO(arjunroy): These type declarations ought to be in
-// src/core/lib/slice/slice_internal.h instead; they are here due to a circular
-// header depedency between slice_internal.h and
-// src/core/lib/transport/metadata.h. We need to fix this circular reference and
-// when we do, move these type declarations.
-//
-// Internal slice type declarations.
-// Externally, a grpc_slice is a grpc_slice is a grpc_slice.
-// Internally, we may have heap allocated slices, static slices, interned
-// slices, and inlined slices. If we know the specific type of slice
-// we're dealing with, we can save cycles (e.g. fast-paths when we know we don't
-// need to take a reference on a slice). Rather than introducing new methods
-// ad-hoc in these cases, we rely on type-system backed overloads to keep
-// internal APIs clean.
-//
-// For each overload, the definition and layout of the underlying slice does not
-// change; this is purely type-system information.
-namespace grpc_core {
-
-// There are two main types of slices: those that have their memory
-// managed by the slice library and those that do not.
-//
-// The following types of slices are not managed:
-// - inlined slices (i.e., refcount is null)
-// - slices that have a custom refcount type (i.e., not STATIC or INTERNED)
-// - slices where the memory is managed by some external agent. The slice is not
-// ref-counted by grpc, and the programmer is responsible for ensuring the
-// data is valid for the duration of the period that grpc may access it.
-//
-// The following types of slices are managed:
-// - static metadata slices (i.e., refcount type is STATIC)
-// - interned slices (i.e., refcount type is INTERNED)
-//
-// This categorization is reflected in the following hierarchy:
-//
-// - grpc_slice
-// > - UnmanagedMemorySlice
-// > - ExternallyManagedSlice
-// - ManagedMemorySlice
-// > - InternedSlice
-// - StaticMetadataSlice
-//
-struct ManagedMemorySlice : public grpc_slice {
- ManagedMemorySlice() {
- refcount = nullptr;
- data.refcounted.bytes = nullptr;
- data.refcounted.length = 0;
- }
- explicit ManagedMemorySlice(const char* string);
- ManagedMemorySlice(const char* buf, size_t len);
- explicit ManagedMemorySlice(const grpc_slice* slice);
- bool operator==(const grpc_slice& other) const {
- if (refcount == other.refcount) {
- return true;
- }
- return !grpc_slice_differs_refcounted(other, *this);
- }
- bool operator!=(const grpc_slice& other) const { return !(*this == other); }
- bool operator==(std::pair<const char*, size_t> buflen) const {
- return data.refcounted.length == buflen.second && buflen.first != nullptr &&
- memcmp(buflen.first, data.refcounted.bytes, buflen.second) == 0;
- }
-};
-struct UnmanagedMemorySlice : public grpc_slice {
- // TODO(arjunroy): Can we use a default=false param instead of this enum?
- enum class ForceHeapAllocation {};
- UnmanagedMemorySlice() {
- refcount = nullptr;
- data.inlined.length = 0;
- }
- explicit UnmanagedMemorySlice(const char* source);
- UnmanagedMemorySlice(const char* source, size_t length);
- // The first constructor creates a slice that may be heap allocated, or
- // inlined in the slice structure if length is small enough
- // (< GRPC_SLICE_INLINED_SIZE). The second constructor forces heap alloc.
- explicit UnmanagedMemorySlice(size_t length);
- explicit UnmanagedMemorySlice(size_t length, const ForceHeapAllocation&) {
- HeapInit(length);
- }
-
- private:
- void HeapInit(size_t length);
-};
-
-extern grpc_slice_refcount kNoopRefcount;
-
-struct ExternallyManagedSlice : public UnmanagedMemorySlice {
- ExternallyManagedSlice()
- : ExternallyManagedSlice(&kNoopRefcount, 0, nullptr) {}
- explicit ExternallyManagedSlice(const char* s)
- : ExternallyManagedSlice(s, strlen(s)) {}
- ExternallyManagedSlice(const void* s, size_t len)
- : ExternallyManagedSlice(
- &kNoopRefcount, len,
- reinterpret_cast<uint8_t*>(const_cast<void*>(s))) {}
- ExternallyManagedSlice(grpc_slice_refcount* ref, size_t length,
- uint8_t* bytes) {
- refcount = ref;
- data.refcounted.length = length;
- data.refcounted.bytes = bytes;
- }
- bool operator==(const grpc_slice& other) const {
- return data.refcounted.length == GRPC_SLICE_LENGTH(other) &&
- memcmp(data.refcounted.bytes, GRPC_SLICE_START_PTR(other),
- data.refcounted.length) == 0;
- }
- bool operator!=(const grpc_slice& other) const { return !(*this == other); }
- uint32_t Hash() {
- return gpr_murmur_hash3(data.refcounted.bytes, data.refcounted.length,
- g_hash_seed);
- }
-};
-
-struct StaticMetadataSlice : public ManagedMemorySlice {
- StaticMetadataSlice(grpc_slice_refcount* ref, size_t length,
- const uint8_t* bytes) {
- refcount = ref;
- data.refcounted.length = length;
- // NB: grpc_slice may or may not point to a static slice, but we are
- // definitely pointing to static data here. Since we are not changing
- // the underlying C-type, we need a const_cast here.
- data.refcounted.bytes = const_cast<uint8_t*>(bytes);
- }
-};
-
-struct InternedSliceRefcount;
-struct InternedSlice : public ManagedMemorySlice {
- explicit InternedSlice(InternedSliceRefcount* s);
-};
-
-// Converts grpc_slice to absl::string_view.
-inline absl::string_view StringViewFromSlice(const grpc_slice& slice) {
- return 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/grpc/src/core/lib/surface/api_trace.cc b/grpc/src/core/lib/surface/api_trace.cc
index bab5a791..c40b9e1b 100644
--- a/grpc/src/core/lib/surface/api_trace.cc
+++ b/grpc/src/core/lib/surface/api_trace.cc
@@ -18,7 +18,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/debug/trace.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/debug/trace.h"
+
grpc_core::TraceFlag grpc_api_trace(false, "api");
diff --git a/grpc/src/core/lib/surface/api_trace.h b/grpc/src/core/lib/surface/api_trace.h
index 51d1f522..a7981d14 100644
--- a/grpc/src/core/lib/surface/api_trace.h
+++ b/grpc/src/core/lib/surface/api_trace.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/debug/trace.h"
extern grpc_core::TraceFlag grpc_api_trace;
diff --git a/grpc/src/core/lib/surface/builtins.cc b/grpc/src/core/lib/surface/builtins.cc
new file mode 100644
index 00000000..2e79668b
--- /dev/null
+++ b/grpc/src/core/lib/surface/builtins.cc
@@ -0,0 +1,49 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/surface/builtins.h"
+
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/lame_client.h"
+#include "src/core/lib/surface/server.h"
+
+namespace grpc_core {
+
+void RegisterBuiltins(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_LAME_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](ChannelStackBuilder* builder) {
+ builder->AppendFilter(&grpc_lame_filter, nullptr);
+ return true;
+ });
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX, [](ChannelStackBuilder* builder) {
+ builder->PrependFilter(&Server::kServerTopFilter, nullptr);
+ return true;
+ });
+}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/surface/builtins.h b/grpc/src/core/lib/surface/builtins.h
new file mode 100644
index 00000000..c177f02b
--- /dev/null
+++ b/grpc/src/core/lib/surface/builtins.h
@@ -0,0 +1,26 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_BUILTINS_H
+#define GRPC_CORE_LIB_SURFACE_BUILTINS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/config/core_configuration.h"
+
+namespace grpc_core {
+void RegisterBuiltins(CoreConfiguration::Builder* builder);
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SURFACE_BUILTINS_H
diff --git a/grpc/src/core/lib/surface/byte_buffer_reader.cc b/grpc/src/core/lib/surface/byte_buffer_reader.cc
index 3689c794..207aaef8 100644
--- a/grpc/src/core/lib/surface/byte_buffer_reader.cc
+++ b/grpc/src/core/lib/surface/byte_buffer_reader.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/byte_buffer_reader.h>
#include <string.h>
#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
diff --git a/grpc/src/core/lib/surface/call.cc b/grpc/src/core/lib/surface/call.cc
index ac0854c2..dab2f50c 100644
--- a/grpc/src/core/lib/surface/call.cc
+++ b/grpc/src/core/lib/surface/call.cc
@@ -18,12 +18,15 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/surface/call.h"
+
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <atomic>
#include <string>
#include "absl/strings/str_cat.h"
@@ -37,204 +40,357 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/compression/algorithm_metadata.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/arena.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_split.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/call_test_only.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/error_utils.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-#include "src/core/lib/transport/status_metadata.h"
#include "src/core/lib/transport/transport.h"
-/** The maximum number of concurrent batches possible.
- Based upon the maximum number of individually queueable ops in the batch
- api:
- - initial metadata send
- - message send
- - status/close send (depending on client/server)
- - initial metadata recv
- - message recv
- - status/close recv (depending on client/server) */
-#define MAX_CONCURRENT_BATCHES 6
-
-#define MAX_SEND_EXTRA_METADATA_COUNT 3
-
-// Used to create arena for the first call.
-#define ESTIMATED_MDELEM_COUNT 16
-
-struct batch_control {
- batch_control() = default;
-
- grpc_call* call = nullptr;
- grpc_transport_stream_op_batch op;
- /* Share memory for cq_completion and notify_tag as they are never needed
- simultaneously. Each byte used in this data structure count as six bytes
- per call, so any savings we can make are worthwhile,
-
- We use notify_tag to determine whether or not to send notification to the
- completion queue. Once we've made that determination, we can reuse the
- memory for cq_completion. */
- union {
- grpc_cq_completion cq_completion;
- struct {
- /* Any given op indicates completion by either (a) calling a closure or
- (b) sending a notification on the call's completion queue. If
- \a is_closure is true, \a tag indicates a closure to be invoked;
- otherwise, \a tag indicates the tag to be used in the notification to
- be sent to the completion queue. */
- void* tag;
- bool is_closure;
- } notify_tag;
- } completion_data;
- grpc_closure start_batch;
- grpc_closure finish_batch;
- grpc_core::Atomic<intptr_t> steps_to_complete;
- gpr_atm batch_error = reinterpret_cast<gpr_atm>(GRPC_ERROR_NONE);
- void set_num_steps_to_complete(uintptr_t steps) {
- steps_to_complete.Store(steps, grpc_core::MemoryOrder::RELEASE);
+grpc_core::TraceFlag grpc_call_error_trace(false, "call_error");
+grpc_core::TraceFlag grpc_compression_trace(false, "compression");
+
+namespace grpc_core {
+
+class Call : public CppImplOf<Call, grpc_call> {
+ public:
+ Arena* arena() { return arena_; }
+ bool is_client() const { return is_client_; }
+
+ virtual void ContextSet(grpc_context_index elem, void* value,
+ void (*destroy)(void* value)) = 0;
+ virtual void* ContextGet(grpc_context_index elem) const = 0;
+ virtual bool Completed() = 0;
+ void CancelWithStatus(grpc_status_code status, const char* description);
+ virtual void CancelWithError(grpc_error_handle error) = 0;
+ virtual void SetCompletionQueue(grpc_completion_queue* cq) = 0;
+ virtual char* GetPeer() = 0;
+ virtual grpc_call_error StartBatch(const grpc_op* ops, size_t nops,
+ void* notify_tag,
+ bool is_notify_tag_closure) = 0;
+ virtual bool failed_before_recv_message() const = 0;
+ virtual bool is_trailers_only() const = 0;
+ virtual void ExternalRef() = 0;
+ virtual void ExternalUnref() = 0;
+ virtual void InternalRef(const char* reason) = 0;
+ virtual void InternalUnref(const char* reason) = 0;
+
+ virtual grpc_compression_algorithm test_only_compression_algorithm() = 0;
+ virtual uint32_t test_only_message_flags() = 0;
+ virtual uint32_t test_only_encodings_accepted_by_peer() = 0;
+ virtual grpc_compression_algorithm compression_for_level(
+ grpc_compression_level level) = 0;
+
+ // This should return nullptr for the promise stack (and alternative means
+ // for that functionality be invented)
+ virtual grpc_call_stack* call_stack() = 0;
+
+ protected:
+ Call(Arena* arena, bool is_client, Timestamp send_deadline)
+ : arena_(arena), send_deadline_(send_deadline), is_client_(is_client) {
+ GPR_DEBUG_ASSERT(arena_ != nullptr);
+ }
+ ~Call() = default;
+
+ struct ParentCall {
+ Mutex child_list_mu;
+ Call* first_child ABSL_GUARDED_BY(child_list_mu) = nullptr;
+ };
+
+ struct ChildCall {
+ explicit ChildCall(Call* parent) : parent(parent) {}
+ Call* parent;
+ /** siblings: children of the same parent form a list, and this list is
+ protected under
+ parent->mu */
+ Call* sibling_next = nullptr;
+ Call* sibling_prev = nullptr;
+ };
+
+ ParentCall* GetOrCreateParentCall();
+ ParentCall* parent_call();
+
+ absl::Status InitParent(Call* parent, uint32_t propagation_mask);
+ void PublishToParent(Call* parent);
+ void MaybeUnpublishFromParent();
+ void PropagateCancellationToChildren();
+
+ Timestamp send_deadline() const { return send_deadline_; }
+ void set_send_deadline(Timestamp send_deadline) {
+ send_deadline_ = send_deadline;
+ }
+
+ private:
+ Arena* const arena_;
+ std::atomic<ParentCall*> parent_call_{nullptr};
+ ChildCall* child_ = nullptr;
+ Timestamp send_deadline_;
+ const bool is_client_;
+ // flag indicating that cancellation is inherited
+ bool cancellation_is_inherited_ = false;
+};
+
+class FilterStackCall final : public Call {
+ public:
+ ~FilterStackCall() {
+ for (int i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
+ if (context_[i].destroy) {
+ context_[i].destroy(context_[i].value);
+ }
+ }
+ gpr_free(static_cast<void*>(const_cast<char*>(final_info_.error_string)));
}
- bool completed_batch_step() {
- return steps_to_complete.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1;
+
+ bool Completed() override {
+ return gpr_atm_acq_load(&received_final_op_atm_) != 0;
}
-};
-struct parent_call {
- parent_call() { gpr_mu_init(&child_list_mu); }
- ~parent_call() { gpr_mu_destroy(&child_list_mu); }
+ // TODO(ctiller): return absl::StatusOr<SomeSmartPointer<Call>>?
+ static grpc_error_handle Create(grpc_call_create_args* args,
+ grpc_call** out_call);
- gpr_mu child_list_mu;
- grpc_call* first_child = nullptr;
-};
+ static Call* FromTopElem(grpc_call_element* elem) {
+ return FromCallStack(grpc_call_stack_from_top_element(elem));
+ }
-struct child_call {
- explicit child_call(grpc_call* parent) : parent(parent) {}
- grpc_call* parent;
- /** siblings: children of the same parent form a list, and this list is
- protected under
- parent->mu */
- grpc_call* sibling_next = nullptr;
- grpc_call* sibling_prev = nullptr;
-};
+ grpc_call_stack* call_stack() override {
+ return reinterpret_cast<grpc_call_stack*>(
+ reinterpret_cast<char*>(this) +
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(*this)));
+ }
-#define RECV_NONE ((gpr_atm)0)
-#define RECV_INITIAL_METADATA_FIRST ((gpr_atm)1)
-
-struct grpc_call {
- grpc_call(grpc_core::Arena* arena, const grpc_call_create_args& args)
- : arena(arena),
- cq(args.cq),
- channel(args.channel),
- is_client(args.server_transport_data == nullptr),
- stream_op_payload(context) {
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 2; j++) {
- metadata_batch[i][j].deadline = GRPC_MILLIS_INF_FUTURE;
- }
- }
+ grpc_call_element* call_elem(size_t idx) {
+ return grpc_call_stack_element(call_stack(), idx);
}
- ~grpc_call() {
- gpr_free(static_cast<void*>(const_cast<char*>(final_info.error_string)));
+ CallCombiner* call_combiner() { return &call_combiner_; }
+
+ void CancelWithError(grpc_error_handle error) override;
+ void SetCompletionQueue(grpc_completion_queue* cq) override;
+ char* GetPeer() override;
+ grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
+ bool is_notify_tag_closure) override;
+ void ExternalRef() override { ext_ref_.Ref(); }
+ void ExternalUnref() override;
+ void InternalRef(const char* reason) override {
+ GRPC_CALL_STACK_REF(call_stack(), reason);
}
+ void InternalUnref(const char* reason) override {
+ GRPC_CALL_STACK_UNREF(call_stack(), reason);
+ }
+
+ void ContextSet(grpc_context_index elem, void* value,
+ void (*destroy)(void* value)) override;
+ void* ContextGet(grpc_context_index elem) const override {
+ return context_[elem].value;
+ }
+
+ grpc_compression_algorithm compression_for_level(
+ grpc_compression_level level) override {
+ return encodings_accepted_by_peer_.CompressionAlgorithmForLevel(level);
+ }
+
+ bool is_trailers_only() const override {
+ bool result = is_trailers_only_;
+ GPR_DEBUG_ASSERT(!result || recv_initial_metadata_.TransportSize() == 0);
+ return result;
+ }
+
+ bool failed_before_recv_message() const override {
+ return call_failed_before_recv_message_;
+ }
+
+ grpc_compression_algorithm test_only_compression_algorithm() override {
+ return incoming_compression_algorithm_;
+ }
+
+ uint32_t test_only_message_flags() override {
+ return test_only_last_message_flags_;
+ }
+
+ uint32_t test_only_encodings_accepted_by_peer() override {
+ return encodings_accepted_by_peer_.ToLegacyBitmask();
+ }
+
+ static size_t InitialSizeEstimate() {
+ return sizeof(FilterStackCall) +
+ sizeof(BatchControl) * kMaxConcurrentBatches;
+ }
+
+ private:
+ // The maximum number of concurrent batches possible.
+ // Based upon the maximum number of individually queueable ops in the batch
+ // api:
+ // - initial metadata send
+ // - message send
+ // - status/close send (depending on client/server)
+ // - initial metadata recv
+ // - message recv
+ // - status/close recv (depending on client/server)
+ static constexpr size_t kMaxConcurrentBatches = 6;
+
+ static constexpr gpr_atm kRecvNone = 0;
+ static constexpr gpr_atm kRecvInitialMetadataFirst = 1;
+
+ struct BatchControl {
+ FilterStackCall* call_ = nullptr;
+ grpc_transport_stream_op_batch op_;
+ /* Share memory for cq_completion and notify_tag as they are never needed
+ simultaneously. Each byte used in this data structure count as six bytes
+ per call, so any savings we can make are worthwhile,
+
+ We use notify_tag to determine whether or not to send notification to the
+ completion queue. Once we've made that determination, we can reuse the
+ memory for cq_completion. */
+ union {
+ grpc_cq_completion cq_completion;
+ struct {
+ /* Any given op indicates completion by either (a) calling a closure or
+ (b) sending a notification on the call's completion queue. If
+ \a is_closure is true, \a tag indicates a closure to be invoked;
+ otherwise, \a tag indicates the tag to be used in the notification to
+ be sent to the completion queue. */
+ void* tag;
+ bool is_closure;
+ } notify_tag;
+ } completion_data_;
+ grpc_closure start_batch_;
+ grpc_closure finish_batch_;
+ std::atomic<intptr_t> steps_to_complete_{0};
+ AtomicError batch_error_;
+ void set_num_steps_to_complete(uintptr_t steps) {
+ steps_to_complete_.store(steps, std::memory_order_release);
+ }
+ bool completed_batch_step() {
+ return steps_to_complete_.fetch_sub(1, std::memory_order_acq_rel) == 1;
+ }
- grpc_core::RefCount ext_ref;
- grpc_core::Arena* arena;
- grpc_core::CallCombiner call_combiner;
- grpc_completion_queue* cq;
- grpc_polling_entity pollent;
- grpc_channel* channel;
- gpr_cycle_counter start_time = gpr_get_cycle_counter();
- /* parent_call* */ gpr_atm parent_call_atm = 0;
- child_call* child = nullptr;
+ void PostCompletion();
+ void FinishStep();
+ void ContinueReceivingSlices();
+ void ReceivingSliceReady(grpc_error_handle error);
+ void ProcessDataAfterMetadata();
+ void ReceivingStreamReady(grpc_error_handle error);
+ void ValidateFilteredMetadata();
+ void ReceivingInitialMetadataReady(grpc_error_handle error);
+ void ReceivingTrailingMetadataReady(grpc_error_handle error);
+ void FinishBatch(grpc_error_handle error);
+ };
+
+ FilterStackCall(Arena* arena, const grpc_call_create_args& args)
+ : Call(arena, args.server_transport_data == nullptr, args.send_deadline),
+ cq_(args.cq),
+ channel_(args.channel),
+ stream_op_payload_(context_) {}
+
+ static void ReleaseCall(void* call, grpc_error_handle);
+ static void DestroyCall(void* call, grpc_error_handle);
+
+ static FilterStackCall* FromCallStack(grpc_call_stack* call_stack) {
+ return reinterpret_cast<FilterStackCall*>(
+ reinterpret_cast<char*>(call_stack) -
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)));
+ }
+
+ void ExecuteBatch(grpc_transport_stream_op_batch* batch,
+ grpc_closure* start_batch_closure);
+ void SetFinalStatus(grpc_error_handle error);
+ BatchControl* ReuseOrAllocateBatchControl(const grpc_op* ops);
+ void HandleCompressionAlgorithmDisabled(
+ grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
+ void HandleCompressionAlgorithmNotAccepted(
+ grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
+ bool PrepareApplicationMetadata(size_t count, grpc_metadata* metadata,
+ bool is_trailing);
+ void PublishAppMetadata(grpc_metadata_batch* b, bool is_trailing);
+ void RecvInitialFilter(grpc_metadata_batch* b);
+ void RecvTrailingFilter(grpc_metadata_batch* b,
+ grpc_error_handle batch_error);
+
+ RefCount ext_ref_;
+ CallCombiner call_combiner_;
+ grpc_completion_queue* cq_;
+ grpc_polling_entity pollent_;
+ grpc_channel* channel_;
+ gpr_cycle_counter start_time_ = gpr_get_cycle_counter();
- /* client or server call */
- bool is_client;
/** has grpc_call_unref been called */
- bool destroy_called = false;
- /** flag indicating that cancellation is inherited */
- bool cancellation_is_inherited = false;
+ bool destroy_called_ = false;
+ // Trailers-only response status
+ bool is_trailers_only_ = false;
/** which ops are in-flight */
- bool sent_initial_metadata = false;
- bool sending_message = false;
- bool sent_final_op = false;
- bool received_initial_metadata = false;
- bool receiving_message = false;
- bool requested_final_op = false;
- gpr_atm any_ops_sent_atm = 0;
- gpr_atm received_final_op_atm = 0;
-
- batch_control* active_batches[MAX_CONCURRENT_BATCHES] = {};
- grpc_transport_stream_op_batch_payload stream_op_payload;
+ bool sent_initial_metadata_ = false;
+ bool sending_message_ = false;
+ bool sent_final_op_ = false;
+ bool received_initial_metadata_ = false;
+ bool receiving_message_ = false;
+ bool requested_final_op_ = false;
+ gpr_atm any_ops_sent_atm_ = 0;
+ gpr_atm received_final_op_atm_ = 0;
+
+ BatchControl* active_batches_[kMaxConcurrentBatches] = {};
+ grpc_transport_stream_op_batch_payload stream_op_payload_;
/* first idx: is_receiving, second idx: is_trailing */
- grpc_metadata_batch metadata_batch[2][2] = {};
+ grpc_metadata_batch send_initial_metadata_{arena()};
+ grpc_metadata_batch send_trailing_metadata_{arena()};
+ grpc_metadata_batch recv_initial_metadata_{arena()};
+ grpc_metadata_batch recv_trailing_metadata_{arena()};
/* Buffered read metadata waiting to be returned to the application.
Element 0 is initial metadata, element 1 is trailing metadata. */
- grpc_metadata_array* buffered_metadata[2] = {};
-
- grpc_metadata compression_md;
+ grpc_metadata_array* buffered_metadata_[2] = {};
// A char* indicating the peer name.
- gpr_atm peer_string = 0;
+ gpr_atm peer_string_ = 0;
/* Call data useful used for reporting. Only valid after the call has
* completed */
- grpc_call_final_info final_info;
+ grpc_call_final_info final_info_;
/* Compression algorithm for *incoming* data */
- grpc_message_compression_algorithm incoming_message_compression_algorithm =
- GRPC_MESSAGE_COMPRESS_NONE;
- /* Stream compression algorithm for *incoming* data */
- grpc_stream_compression_algorithm incoming_stream_compression_algorithm =
- GRPC_STREAM_COMPRESS_NONE;
+ grpc_compression_algorithm incoming_compression_algorithm_ =
+ GRPC_COMPRESS_NONE;
/* Supported encodings (compression algorithms), a bitset.
* Always support no compression. */
- uint32_t encodings_accepted_by_peer = 1 << GRPC_MESSAGE_COMPRESS_NONE;
- /* Supported stream encodings (stream compression algorithms), a bitset */
- uint32_t stream_encodings_accepted_by_peer = 0;
+ CompressionAlgorithmSet encodings_accepted_by_peer_{GRPC_COMPRESS_NONE};
/* Contexts for various subsystems (security, tracing, ...). */
- grpc_call_context_element context[GRPC_CONTEXT_COUNT] = {};
-
- /* for the client, extra metadata is initial metadata; for the
- server, it's trailing metadata */
- grpc_linked_mdelem send_extra_metadata[MAX_SEND_EXTRA_METADATA_COUNT];
- int send_extra_metadata_count;
- grpc_millis send_deadline;
-
- grpc_core::ManualConstructor<grpc_core::SliceBufferByteStream> sending_stream;
-
- grpc_core::OrphanablePtr<grpc_core::ByteStream> receiving_stream;
- grpc_byte_buffer** receiving_buffer = nullptr;
- grpc_slice receiving_slice = grpc_empty_slice();
- grpc_closure receiving_slice_ready;
- grpc_closure receiving_stream_ready;
- grpc_closure receiving_initial_metadata_ready;
- grpc_closure receiving_trailing_metadata_ready;
- uint32_t test_only_last_message_flags = 0;
+ grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
+
+ ManualConstructor<SliceBufferByteStream> sending_stream_;
+
+ OrphanablePtr<ByteStream> receiving_stream_;
+ bool call_failed_before_recv_message_ = false;
+ grpc_byte_buffer** receiving_buffer_ = nullptr;
+ grpc_slice receiving_slice_ = grpc_empty_slice();
+ grpc_closure receiving_slice_ready_;
+ grpc_closure receiving_stream_ready_;
+ 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;
+ bool sent_server_trailing_metadata_ = false;
+ gpr_atm cancelled_with_error_ = 0;
- grpc_closure release_call;
+ grpc_closure release_call_;
union {
struct {
@@ -245,10 +401,10 @@ struct grpc_call {
struct {
int* cancelled;
// backpointer to owning server if this is a server side call.
- grpc_core::Server* core_server;
+ Server* core_server;
} server;
- } final_op;
- gpr_atm status_error = 0;
+ } final_op_;
+ AtomicError status_error_;
/* recv_state can contain one of the following values:
RECV_NONE : : no initial metadata and messages received
@@ -266,226 +422,178 @@ struct grpc_call {
For 1, 4: See receiving_initial_metadata_ready() function
For 2, 3: See receiving_stream_ready() function */
- gpr_atm recv_state = 0;
+ gpr_atm recv_state_ = 0;
};
-grpc_core::TraceFlag grpc_call_error_trace(false, "call_error");
-grpc_core::TraceFlag grpc_compression_trace(false, "compression");
-
-#define CALL_STACK_FROM_CALL(call) \
- (grpc_call_stack*)((char*)(call) + \
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
-#define CALL_FROM_CALL_STACK(call_stack) \
- (grpc_call*)(((char*)(call_stack)) - \
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)))
-
-#define CALL_ELEM_FROM_CALL(call, idx) \
- grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx)
-#define CALL_FROM_TOP_ELEM(top_elem) \
- CALL_FROM_CALL_STACK(grpc_call_stack_from_top_element(top_elem))
-
-static void execute_batch(grpc_call* call,
- grpc_transport_stream_op_batch* batch,
- grpc_closure* start_batch_closure);
-
-static void cancel_with_status(grpc_call* c, grpc_status_code status,
- const char* description);
-static void cancel_with_error(grpc_call* c, grpc_error_handle error);
-static void destroy_call(void* call_stack, grpc_error_handle error);
-static void receiving_slice_ready(void* bctlp, grpc_error_handle error);
-static void set_final_status(grpc_call* call, grpc_error_handle error);
-static void process_data_after_md(batch_control* bctl);
-static void post_batch_completion(batch_control* bctl);
-
-static void add_init_error(grpc_error_handle* composite,
- grpc_error_handle new_err) {
- if (new_err == GRPC_ERROR_NONE) return;
- if (*composite == GRPC_ERROR_NONE) {
- *composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
- }
- *composite = grpc_error_add_child(*composite, new_err);
-}
-
-void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
- return call->arena->Alloc(size);
-}
-
-static parent_call* get_or_create_parent_call(grpc_call* call) {
- parent_call* p =
- reinterpret_cast<parent_call*>(gpr_atm_acq_load(&call->parent_call_atm));
+Call::ParentCall* Call::GetOrCreateParentCall() {
+ ParentCall* p = parent_call_.load(std::memory_order_acquire);
if (p == nullptr) {
- p = call->arena->New<parent_call>();
- if (!gpr_atm_rel_cas(&call->parent_call_atm,
- reinterpret_cast<gpr_atm>(nullptr),
- reinterpret_cast<gpr_atm>(p))) {
- p->~parent_call();
- p = reinterpret_cast<parent_call*>(
- gpr_atm_acq_load(&call->parent_call_atm));
+ p = arena_->New<ParentCall>();
+ ParentCall* expected = nullptr;
+ if (!parent_call_.compare_exchange_strong(expected, p,
+ std::memory_order_release,
+ std::memory_order_relaxed)) {
+ p->~ParentCall();
+ p = expected;
}
}
return p;
}
-static parent_call* get_parent_call(grpc_call* call) {
- return reinterpret_cast<parent_call*>(
- gpr_atm_acq_load(&call->parent_call_atm));
+Call::ParentCall* Call::parent_call() {
+ return parent_call_.load(std::memory_order_acquire);
}
-size_t grpc_call_get_initial_size_estimate() {
- return sizeof(grpc_call) + sizeof(batch_control) * MAX_CONCURRENT_BATCHES +
- sizeof(grpc_linked_mdelem) * ESTIMATED_MDELEM_COUNT;
+absl::Status Call::InitParent(Call* parent, uint32_t propagation_mask) {
+ child_ = arena()->New<ChildCall>(parent);
+
+ parent->InternalRef("child");
+ GPR_ASSERT(is_client_);
+ GPR_ASSERT(!parent->is_client_);
+
+ if (propagation_mask & GRPC_PROPAGATE_DEADLINE) {
+ send_deadline_ = std::min(send_deadline_, parent->send_deadline_);
+ }
+ /* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with
+ * GRPC_PROPAGATE_STATS_CONTEXT */
+ /* TODO(ctiller): This should change to use the appropriate census start_op
+ * call. */
+ if (propagation_mask & GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT) {
+ if (0 == (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) {
+ return absl::UnknownError(
+ "Census tracing propagation requested without Census context "
+ "propagation");
+ }
+ ContextSet(GRPC_CONTEXT_TRACING, parent->ContextGet(GRPC_CONTEXT_TRACING),
+ nullptr);
+ } else if (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT) {
+ return absl::UnknownError(
+ "Census context propagation requested without Census tracing "
+ "propagation");
+ }
+ if (propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
+ cancellation_is_inherited_ = true;
+ }
+ return absl::OkStatus();
+}
+
+void Call::PublishToParent(Call* parent) {
+ ChildCall* cc = child_;
+ ParentCall* pc = parent->GetOrCreateParentCall();
+ MutexLock lock(&pc->child_list_mu);
+ if (pc->first_child == nullptr) {
+ pc->first_child = this;
+ cc->sibling_next = cc->sibling_prev = this;
+ } else {
+ cc->sibling_next = pc->first_child;
+ cc->sibling_prev = pc->first_child->child_->sibling_prev;
+ cc->sibling_next->child_->sibling_prev =
+ cc->sibling_prev->child_->sibling_next = this;
+ }
+ if (parent->Completed()) {
+ CancelWithError(GRPC_ERROR_CANCELLED);
+ }
}
-grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
- grpc_call** out_call) {
+grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args,
+ grpc_call** out_call) {
GPR_TIMER_SCOPE("grpc_call_create", 0);
GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");
- grpc_core::Arena* arena;
- grpc_call* call;
+ auto add_init_error = [](grpc_error_handle* composite,
+ grpc_error_handle new_err) {
+ if (new_err == GRPC_ERROR_NONE) return;
+ if (*composite == GRPC_ERROR_NONE) {
+ *composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
+ }
+ *composite = grpc_error_add_child(*composite, new_err);
+ };
+
+ Arena* arena;
+ FilterStackCall* call;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_channel_stack* channel_stack =
grpc_channel_get_channel_stack(args->channel);
size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
GRPC_STATS_INC_CALL_INITIAL_SIZE(initial_size);
- size_t call_and_stack_size =
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_call)) +
- channel_stack->call_stack_size;
size_t call_alloc_size =
- call_and_stack_size + (args->parent ? sizeof(child_call) : 0);
+ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)) +
+ channel_stack->call_stack_size;
- std::pair<grpc_core::Arena*, void*> arena_with_call =
- grpc_core::Arena::CreateWithAlloc(initial_size, call_alloc_size);
+ std::pair<Arena*, void*> arena_with_call = Arena::CreateWithAlloc(
+ initial_size, call_alloc_size, &*args->channel->allocator);
arena = arena_with_call.first;
- call = new (arena_with_call.second) grpc_call(arena, *args);
- *out_call = call;
+ call = new (arena_with_call.second) FilterStackCall(arena, *args);
+ GPR_DEBUG_ASSERT(FromC(call->c_ptr()) == call);
+ GPR_DEBUG_ASSERT(FromCallStack(call->call_stack()) == call);
+ *out_call = call->c_ptr();
grpc_slice path = grpc_empty_slice();
- if (call->is_client) {
- call->final_op.client.status_details = nullptr;
- call->final_op.client.status = nullptr;
- call->final_op.client.error_string = nullptr;
+ if (call->is_client()) {
+ call->final_op_.client.status_details = nullptr;
+ call->final_op_.client.status = nullptr;
+ call->final_op_.client.error_string = nullptr;
GRPC_STATS_INC_CLIENT_CALLS_CREATED();
- GPR_ASSERT(args->add_initial_metadata_count <
- MAX_SEND_EXTRA_METADATA_COUNT);
- for (size_t i = 0; i < args->add_initial_metadata_count; i++) {
- call->send_extra_metadata[i].md = args->add_initial_metadata[i];
- if (grpc_slice_eq_static_interned(
- GRPC_MDKEY(args->add_initial_metadata[i]), GRPC_MDSTR_PATH)) {
- path = grpc_slice_ref_internal(
- GRPC_MDVALUE(args->add_initial_metadata[i]));
- }
+ path = grpc_slice_ref_internal(args->path->c_slice());
+ call->send_initial_metadata_.Set(HttpPathMetadata(),
+ std::move(*args->path));
+ if (args->authority.has_value()) {
+ call->send_initial_metadata_.Set(HttpAuthorityMetadata(),
+ std::move(*args->authority));
}
- call->send_extra_metadata_count =
- static_cast<int>(args->add_initial_metadata_count);
} else {
GRPC_STATS_INC_SERVER_CALLS_CREATED();
- call->final_op.server.cancelled = nullptr;
- call->final_op.server.core_server = args->server;
- GPR_ASSERT(args->add_initial_metadata_count == 0);
- call->send_extra_metadata_count = 0;
+ call->final_op_.server.cancelled = nullptr;
+ call->final_op_.server.core_server = args->server;
}
- grpc_millis send_deadline = args->send_deadline;
- bool immediately_cancel = false;
-
- if (args->parent != nullptr) {
- call->child = new (reinterpret_cast<char*>(arena_with_call.second) +
- call_and_stack_size) child_call(args->parent);
-
- GRPC_CALL_INTERNAL_REF(args->parent, "child");
- GPR_ASSERT(call->is_client);
- GPR_ASSERT(!args->parent->is_client);
-
- if (args->propagation_mask & GRPC_PROPAGATE_DEADLINE) {
- send_deadline = GPR_MIN(send_deadline, args->parent->send_deadline);
- }
- /* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with
- * GRPC_PROPAGATE_STATS_CONTEXT */
- /* TODO(ctiller): This should change to use the appropriate census start_op
- * call. */
- if (args->propagation_mask & GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT) {
- if (0 == (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) {
- add_init_error(&error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Census tracing propagation requested "
- "without Census context propagation"));
- }
- grpc_call_context_set(call, GRPC_CONTEXT_TRACING,
- args->parent->context[GRPC_CONTEXT_TRACING].value,
- nullptr);
- } else if (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT) {
- add_init_error(&error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Census context propagation requested "
- "without Census tracing propagation"));
- }
- if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
- call->cancellation_is_inherited = true;
- if (gpr_atm_acq_load(&args->parent->received_final_op_atm)) {
- immediately_cancel = true;
- }
- }
+ Call* parent = Call::FromC(args->parent);
+ if (parent != nullptr) {
+ add_init_error(&error, absl_status_to_grpc_error(call->InitParent(
+ parent, args->propagation_mask)));
}
- call->send_deadline = send_deadline;
/* initial refcount dropped by grpc_call_unref */
- grpc_call_element_args call_args = {CALL_STACK_FROM_CALL(call),
- args->server_transport_data,
- call->context,
- path,
- call->start_time,
- send_deadline,
- call->arena,
- &call->call_combiner};
- add_init_error(&error, grpc_call_stack_init(channel_stack, 1, destroy_call,
+ grpc_call_element_args call_args = {
+ call->call_stack(), args->server_transport_data,
+ call->context_, path,
+ call->start_time_, call->send_deadline(),
+ call->arena(), &call->call_combiner_};
+ add_init_error(&error, grpc_call_stack_init(channel_stack, 1, DestroyCall,
call, &call_args));
// Publish this call to parent only after the call stack has been initialized.
- if (args->parent != nullptr) {
- child_call* cc = call->child;
- parent_call* pc = get_or_create_parent_call(args->parent);
- gpr_mu_lock(&pc->child_list_mu);
- if (pc->first_child == nullptr) {
- pc->first_child = call;
- cc->sibling_next = cc->sibling_prev = call;
- } else {
- cc->sibling_next = pc->first_child;
- cc->sibling_prev = pc->first_child->child->sibling_prev;
- cc->sibling_next->child->sibling_prev =
- cc->sibling_prev->child->sibling_next = call;
- }
- gpr_mu_unlock(&pc->child_list_mu);
+ if (parent != nullptr) {
+ call->PublishToParent(parent);
}
if (error != GRPC_ERROR_NONE) {
- cancel_with_error(call, GRPC_ERROR_REF(error));
- }
- if (immediately_cancel) {
- cancel_with_error(call, GRPC_ERROR_CANCELLED);
+ call->CancelWithError(GRPC_ERROR_REF(error));
}
if (args->cq != nullptr) {
GPR_ASSERT(args->pollset_set_alternative == nullptr &&
"Only one of 'cq' and 'pollset_set_alternative' should be "
"non-nullptr.");
GRPC_CQ_INTERNAL_REF(args->cq, "bind");
- call->pollent =
+ call->pollent_ =
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(args->cq));
}
if (args->pollset_set_alternative != nullptr) {
- call->pollent = grpc_polling_entity_create_from_pollset_set(
+ call->pollent_ = grpc_polling_entity_create_from_pollset_set(
args->pollset_set_alternative);
}
- if (!grpc_polling_entity_is_empty(&call->pollent)) {
- grpc_call_stack_set_pollset_or_pollset_set(CALL_STACK_FROM_CALL(call),
- &call->pollent);
+ if (!grpc_polling_entity_is_empty(&call->pollent_)) {
+ grpc_call_stack_set_pollset_or_pollset_set(call->call_stack(),
+ &call->pollent_);
}
- if (call->is_client) {
- grpc_core::channelz::ChannelNode* channelz_channel =
- grpc_channel_get_channelz_node(call->channel);
+ if (call->is_client()) {
+ channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(call->channel_);
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();
+ } else if (call->final_op_.server.core_server != nullptr) {
+ channelz::ServerNode* channelz_node =
+ call->final_op_.server.core_server->channelz_node();
if (channelz_node != nullptr) {
channelz_node->RecordCallStarted();
}
@@ -496,281 +604,211 @@ grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
return error;
}
-void grpc_call_set_completion_queue(grpc_call* call,
- grpc_completion_queue* cq) {
+void FilterStackCall::SetCompletionQueue(grpc_completion_queue* cq) {
GPR_ASSERT(cq);
- if (grpc_polling_entity_pollset_set(&call->pollent) != nullptr) {
+ if (grpc_polling_entity_pollset_set(&pollent_) != nullptr) {
gpr_log(GPR_ERROR, "A pollset_set is already registered for this call.");
abort();
}
- call->cq = cq;
+ cq_ = cq;
GRPC_CQ_INTERNAL_REF(cq, "bind");
- call->pollent = grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq));
- grpc_call_stack_set_pollset_or_pollset_set(CALL_STACK_FROM_CALL(call),
- &call->pollent);
+ pollent_ = grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq));
+ grpc_call_stack_set_pollset_or_pollset_set(call_stack(), &pollent_);
}
-#ifndef NDEBUG
-#define REF_REASON reason
-#define REF_ARG , const char* reason
-#else
-#define REF_REASON ""
-#define REF_ARG
-#endif
-void grpc_call_internal_ref(grpc_call* c REF_ARG) {
- GRPC_CALL_STACK_REF(CALL_STACK_FROM_CALL(c), REF_REASON);
-}
-void grpc_call_internal_unref(grpc_call* c REF_ARG) {
- GRPC_CALL_STACK_UNREF(CALL_STACK_FROM_CALL(c), REF_REASON);
-}
-
-static void release_call(void* call, grpc_error_handle /*error*/) {
- grpc_call* c = static_cast<grpc_call*>(call);
- grpc_channel* channel = c->channel;
- grpc_core::Arena* arena = c->arena;
- c->~grpc_call();
+void FilterStackCall::ReleaseCall(void* call, grpc_error_handle /*error*/) {
+ auto* c = static_cast<FilterStackCall*>(call);
+ grpc_channel* channel = c->channel_;
+ Arena* arena = c->arena();
+ c->~FilterStackCall();
grpc_channel_update_call_size_estimate(channel, arena->Destroy());
GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
}
-static void destroy_call(void* call, grpc_error_handle /*error*/) {
+void FilterStackCall::DestroyCall(void* call, grpc_error_handle /*error*/) {
GPR_TIMER_SCOPE("destroy_call", 0);
- size_t i;
- int ii;
- grpc_call* c = static_cast<grpc_call*>(call);
- for (i = 0; i < 2; i++) {
- grpc_metadata_batch_destroy(
- &c->metadata_batch[1 /* is_receiving */][i /* is_initial */]);
- }
- c->receiving_stream.reset();
- parent_call* pc = get_parent_call(c);
+ auto* c = static_cast<FilterStackCall*>(call);
+ c->recv_initial_metadata_.Clear();
+ c->recv_trailing_metadata_.Clear();
+ c->receiving_stream_.reset();
+ ParentCall* pc = c->parent_call();
if (pc != nullptr) {
- pc->~parent_call();
+ pc->~ParentCall();
}
- for (ii = 0; ii < c->send_extra_metadata_count; ii++) {
- GRPC_MDELEM_UNREF(c->send_extra_metadata[ii].md);
- }
- for (i = 0; i < GRPC_CONTEXT_COUNT; i++) {
- if (c->context[i].destroy) {
- c->context[i].destroy(c->context[i].value);
- }
- }
- if (c->cq) {
- GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
+ if (c->cq_) {
+ GRPC_CQ_INTERNAL_UNREF(c->cq_, "bind");
}
- grpc_error_handle status_error =
- reinterpret_cast<grpc_error_handle>(gpr_atm_acq_load(&c->status_error));
- grpc_error_get_status(status_error, c->send_deadline,
- &c->final_info.final_status, nullptr, nullptr,
- &(c->final_info.error_string));
- GRPC_ERROR_UNREF(status_error);
- c->final_info.stats.latency =
- gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->start_time);
- grpc_call_stack_destroy(CALL_STACK_FROM_CALL(c), &c->final_info,
- GRPC_CLOSURE_INIT(&c->release_call, release_call, c,
+ grpc_error_handle status_error = c->status_error_.get();
+ grpc_error_get_status(status_error, c->send_deadline(),
+ &c->final_info_.final_status, nullptr, nullptr,
+ &(c->final_info_.error_string));
+ c->status_error_.set(GRPC_ERROR_NONE);
+ c->final_info_.stats.latency =
+ gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->start_time_);
+ grpc_call_stack_destroy(c->call_stack(), &c->final_info_,
+ GRPC_CLOSURE_INIT(&c->release_call_, ReleaseCall, c,
grpc_schedule_on_exec_ctx));
}
-void grpc_call_ref(grpc_call* c) { c->ext_ref.Ref(); }
-
-void grpc_call_unref(grpc_call* c) {
- if (GPR_LIKELY(!c->ext_ref.Unref())) return;
-
- GPR_TIMER_SCOPE("grpc_call_unref", 0);
-
- child_call* cc = c->child;
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
-
- GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (c));
+void Call::MaybeUnpublishFromParent() {
+ ChildCall* cc = child_;
+ if (cc == nullptr) return;
- if (cc) {
- parent_call* pc = get_parent_call(cc->parent);
- gpr_mu_lock(&pc->child_list_mu);
- if (c == pc->first_child) {
+ ParentCall* pc = cc->parent->parent_call();
+ {
+ MutexLock lock(&pc->child_list_mu);
+ if (this == pc->first_child) {
pc->first_child = cc->sibling_next;
- if (c == pc->first_child) {
+ if (this == pc->first_child) {
pc->first_child = nullptr;
}
}
- cc->sibling_prev->child->sibling_next = cc->sibling_next;
- cc->sibling_next->child->sibling_prev = cc->sibling_prev;
- gpr_mu_unlock(&pc->child_list_mu);
- GRPC_CALL_INTERNAL_UNREF(cc->parent, "child");
+ cc->sibling_prev->child_->sibling_next = cc->sibling_next;
+ cc->sibling_next->child_->sibling_prev = cc->sibling_prev;
}
+ cc->parent->InternalUnref("child");
+}
+
+void FilterStackCall::ExternalUnref() {
+ if (GPR_LIKELY(!ext_ref_.Unref())) return;
- GPR_ASSERT(!c->destroy_called);
- c->destroy_called = true;
- bool cancel = gpr_atm_acq_load(&c->any_ops_sent_atm) != 0 &&
- gpr_atm_acq_load(&c->received_final_op_atm) == 0;
+ GPR_TIMER_SCOPE("grpc_call_unref", 0);
+
+ ApplicationCallbackExecCtx callback_exec_ctx;
+ ExecCtx exec_ctx;
+
+ GRPC_API_TRACE("grpc_call_unref(c=%p)", 1, (this));
+
+ MaybeUnpublishFromParent();
+
+ GPR_ASSERT(!destroy_called_);
+ destroy_called_ = true;
+ bool cancel = gpr_atm_acq_load(&any_ops_sent_atm_) != 0 &&
+ gpr_atm_acq_load(&received_final_op_atm_) == 0;
if (cancel) {
- cancel_with_error(c, GRPC_ERROR_CANCELLED);
+ CancelWithError(GRPC_ERROR_CANCELLED);
} else {
// Unset the call combiner cancellation closure. This has the
// effect of scheduling the previously set cancellation closure, if
// any, so that it can release any internal references it may be
// holding to the call stack.
- c->call_combiner.SetNotifyOnCancel(nullptr);
+ call_combiner_.SetNotifyOnCancel(nullptr);
}
- GRPC_CALL_INTERNAL_UNREF(c, "destroy");
+ InternalUnref("destroy");
}
-grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
- GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
- GPR_ASSERT(!reserved);
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- cancel_with_error(call, GRPC_ERROR_CANCELLED);
- return GRPC_CALL_OK;
-}
-
-// This is called via the call combiner to start sending a batch down
-// the filter stack.
-static void execute_batch_in_call_combiner(void* arg,
- grpc_error_handle /*ignored*/) {
- GPR_TIMER_SCOPE("execute_batch_in_call_combiner", 0);
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- grpc_call* call = static_cast<grpc_call*>(batch->handler_private.extra_arg);
- grpc_call_element* elem = CALL_ELEM_FROM_CALL(call, 0);
- GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
- elem->filter->start_transport_stream_op_batch(elem, batch);
+char* FilterStackCall::GetPeer() {
+ char* peer_string = reinterpret_cast<char*>(gpr_atm_acq_load(&peer_string_));
+ if (peer_string != nullptr) return gpr_strdup(peer_string);
+ peer_string = grpc_channel_get_target(channel_);
+ if (peer_string != nullptr) return peer_string;
+ return gpr_strdup("unknown");
}
// start_batch_closure points to a caller-allocated closure to be used
// for entering the call combiner.
-static void execute_batch(grpc_call* call,
- grpc_transport_stream_op_batch* batch,
- grpc_closure* start_batch_closure) {
- batch->handler_private.extra_arg = call;
+void FilterStackCall::ExecuteBatch(grpc_transport_stream_op_batch* batch,
+ grpc_closure* start_batch_closure) {
+ // This is called via the call combiner to start sending a batch down
+ // the filter stack.
+ auto execute_batch_in_call_combiner = [](void* arg, grpc_error_handle) {
+ GPR_TIMER_SCOPE("execute_batch_in_call_combiner", 0);
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
+ auto* call =
+ static_cast<FilterStackCall*>(batch->handler_private.extra_arg);
+ grpc_call_element* elem = call->call_elem(0);
+ GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
+ elem->filter->start_transport_stream_op_batch(elem, batch);
+ };
+ batch->handler_private.extra_arg = this;
GRPC_CLOSURE_INIT(start_batch_closure, execute_batch_in_call_combiner, batch,
grpc_schedule_on_exec_ctx);
- GRPC_CALL_COMBINER_START(&call->call_combiner, start_batch_closure,
+ GRPC_CALL_COMBINER_START(call_combiner(), start_batch_closure,
GRPC_ERROR_NONE, "executing batch");
}
-char* grpc_call_get_peer(grpc_call* call) {
- char* peer_string =
- reinterpret_cast<char*>(gpr_atm_acq_load(&call->peer_string));
- if (peer_string != nullptr) return gpr_strdup(peer_string);
- peer_string = grpc_channel_get_target(call->channel);
- if (peer_string != nullptr) return peer_string;
- return gpr_strdup("unknown");
-}
-
-grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element) {
- return CALL_FROM_TOP_ELEM(surface_element);
-}
-
-/*******************************************************************************
- * CANCELLATION
- */
-
-grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
- grpc_status_code status,
- const char* description,
- void* reserved) {
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- grpc_core::ExecCtx exec_ctx;
- GRPC_API_TRACE(
- "grpc_call_cancel_with_status("
- "c=%p, status=%d, description=%s, reserved=%p)",
- 4, (c, (int)status, description, reserved));
- GPR_ASSERT(reserved == nullptr);
- cancel_with_status(c, status, description);
- return GRPC_CALL_OK;
-}
-
-struct cancel_state {
- grpc_call* call;
+namespace {
+struct CancelState {
+ FilterStackCall* call;
grpc_closure start_batch;
grpc_closure finish_batch;
};
+} // namespace
+
// The on_complete callback used when sending a cancel_stream batch down
// the filter stack. Yields the call combiner when the batch is done.
static void done_termination(void* arg, grpc_error_handle /*error*/) {
- cancel_state* state = static_cast<cancel_state*>(arg);
- GRPC_CALL_COMBINER_STOP(&state->call->call_combiner,
+ CancelState* state = static_cast<CancelState*>(arg);
+ GRPC_CALL_COMBINER_STOP(state->call->call_combiner(),
"on_complete for cancel_stream op");
- GRPC_CALL_INTERNAL_UNREF(state->call, "termination");
- gpr_free(state);
+ state->call->InternalUnref("termination");
+ delete state;
}
-static void cancel_with_error(grpc_call* c, grpc_error_handle error) {
- if (!gpr_atm_rel_cas(&c->cancelled_with_error, 0, 1)) {
+void FilterStackCall::CancelWithError(grpc_error_handle error) {
+ if (!gpr_atm_rel_cas(&cancelled_with_error_, 0, 1)) {
GRPC_ERROR_UNREF(error);
return;
}
- GRPC_CALL_INTERNAL_REF(c, "termination");
+ InternalRef("termination");
// Inform the call combiner of the cancellation, so that it can cancel
// any in-flight asynchronous actions that may be holding the call
// combiner. This ensures that the cancel_stream batch can be sent
// down the filter stack in a timely manner.
- c->call_combiner.Cancel(GRPC_ERROR_REF(error));
- cancel_state* state = static_cast<cancel_state*>(gpr_malloc(sizeof(*state)));
- state->call = c;
+ call_combiner_.Cancel(GRPC_ERROR_REF(error));
+ CancelState* state = new CancelState;
+ state->call = this;
GRPC_CLOSURE_INIT(&state->finish_batch, done_termination, state,
grpc_schedule_on_exec_ctx);
grpc_transport_stream_op_batch* op =
grpc_make_transport_stream_op(&state->finish_batch);
op->cancel_stream = true;
op->payload->cancel_stream.cancel_error = error;
- execute_batch(c, op, &state->start_batch);
-}
-
-void grpc_call_cancel_internal(grpc_call* call) {
- cancel_with_error(call, GRPC_ERROR_CANCELLED);
+ ExecuteBatch(op, &state->start_batch);
}
-static grpc_error_handle error_from_status(grpc_status_code status,
- const char* description) {
+void Call::CancelWithStatus(grpc_status_code status, const char* description) {
// copying 'description' is needed to ensure the grpc_call_cancel_with_status
// guarantee that can be short-lived.
- return grpc_error_set_int(
+ CancelWithError(grpc_error_set_int(
grpc_error_set_str(GRPC_ERROR_CREATE_FROM_COPIED_STRING(description),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_copied_string(description)),
- GRPC_ERROR_INT_GRPC_STATUS, status);
+ GRPC_ERROR_STR_GRPC_MESSAGE, description),
+ GRPC_ERROR_INT_GRPC_STATUS, status));
}
-static void cancel_with_status(grpc_call* c, grpc_status_code status,
- const char* description) {
- cancel_with_error(c, error_from_status(status, description));
-}
-
-static void set_final_status(grpc_call* call, grpc_error_handle error) {
+void FilterStackCall::SetFinalStatus(grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_error_trace)) {
- gpr_log(GPR_DEBUG, "set_final_status %s", call->is_client ? "CLI" : "SVR");
+ gpr_log(GPR_DEBUG, "set_final_status %s", is_client() ? "CLI" : "SVR");
gpr_log(GPR_DEBUG, "%s", grpc_error_std_string(error).c_str());
}
- if (call->is_client) {
- grpc_error_get_status(error, call->send_deadline,
- call->final_op.client.status,
- call->final_op.client.status_details, nullptr,
- call->final_op.client.error_string);
- // explicitly take a ref
- grpc_slice_ref_internal(*call->final_op.client.status_details);
- gpr_atm_rel_store(&call->status_error, reinterpret_cast<gpr_atm>(error));
- grpc_core::channelz::ChannelNode* channelz_channel =
- grpc_channel_get_channelz_node(call->channel);
+ if (is_client()) {
+ std::string status_details;
+ grpc_error_get_status(error, send_deadline(), final_op_.client.status,
+ &status_details, nullptr,
+ final_op_.client.error_string);
+ *final_op_.client.status_details =
+ grpc_slice_from_cpp_string(std::move(status_details));
+ status_error_.set(error);
+ GRPC_ERROR_UNREF(error);
+ channelz::ChannelNode* channelz_channel =
+ grpc_channel_get_channelz_node(channel_);
if (channelz_channel != nullptr) {
- if (*call->final_op.client.status != GRPC_STATUS_OK) {
+ if (*final_op_.client.status != GRPC_STATUS_OK) {
channelz_channel->RecordCallFailed();
} else {
channelz_channel->RecordCallSucceeded();
}
}
} 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();
+ *final_op_.server.cancelled =
+ error != GRPC_ERROR_NONE || !sent_server_trailing_metadata_;
+ channelz::ServerNode* channelz_node =
+ final_op_.server.core_server->channelz_node();
if (channelz_node != nullptr) {
- if (*call->final_op.server.cancelled ||
- reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&call->status_error)) != GRPC_ERROR_NONE) {
+ if (*final_op_.server.cancelled || !status_error_.ok()) {
channelz_node->RecordCallFailed();
} else {
channelz_node->RecordCallSucceeded();
@@ -780,330 +818,166 @@ static void set_final_status(grpc_call* call, grpc_error_handle error) {
}
}
-/*******************************************************************************
- * COMPRESSION
- */
-
-static void set_incoming_message_compression_algorithm(
- grpc_call* call, grpc_message_compression_algorithm algo) {
- GPR_ASSERT(algo < GRPC_MESSAGE_COMPRESS_ALGORITHMS_COUNT);
- call->incoming_message_compression_algorithm = algo;
-}
-
-static void set_incoming_stream_compression_algorithm(
- grpc_call* call, grpc_stream_compression_algorithm algo) {
- GPR_ASSERT(algo < GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT);
- call->incoming_stream_compression_algorithm = algo;
-}
-
-grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
- grpc_call* call) {
- grpc_compression_algorithm algorithm = GRPC_COMPRESS_NONE;
- grpc_compression_algorithm_from_message_stream_compression_algorithm(
- &algorithm, call->incoming_message_compression_algorithm,
- call->incoming_stream_compression_algorithm);
- return algorithm;
-}
-
-static grpc_compression_algorithm compression_algorithm_for_level_locked(
- grpc_call* call, grpc_compression_level level) {
- return grpc_compression_algorithm_for_level(level,
- call->encodings_accepted_by_peer);
-}
-
-uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
- uint32_t flags;
- flags = call->test_only_last_message_flags;
- return flags;
-}
-
-static void destroy_encodings_accepted_by_peer(void* /*p*/) {}
-
-static void set_encodings_accepted_by_peer(grpc_call* /*call*/,
- grpc_mdelem mdel,
- uint32_t* encodings_accepted_by_peer,
- bool stream_encoding) {
- size_t i;
- uint32_t algorithm;
- grpc_slice_buffer accept_encoding_parts;
- grpc_slice accept_encoding_slice;
- void* accepted_user_data;
-
- accepted_user_data =
- grpc_mdelem_get_user_data(mdel, destroy_encodings_accepted_by_peer);
- if (accepted_user_data != nullptr) {
- *encodings_accepted_by_peer = static_cast<uint32_t>(
- reinterpret_cast<uintptr_t>(accepted_user_data) - 1);
- return;
- }
-
- *encodings_accepted_by_peer = 0;
-
- accept_encoding_slice = GRPC_MDVALUE(mdel);
- grpc_slice_buffer_init(&accept_encoding_parts);
- grpc_slice_split_without_space(accept_encoding_slice, ",",
- &accept_encoding_parts);
-
- GPR_BITSET(encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
- for (i = 0; i < accept_encoding_parts.count; i++) {
- int r;
- grpc_slice accept_encoding_entry_slice = accept_encoding_parts.slices[i];
- if (!stream_encoding) {
- r = grpc_message_compression_algorithm_parse(
- accept_encoding_entry_slice,
- reinterpret_cast<grpc_message_compression_algorithm*>(&algorithm));
- } else {
- r = grpc_stream_compression_algorithm_parse(
- accept_encoding_entry_slice,
- reinterpret_cast<grpc_stream_compression_algorithm*>(&algorithm));
- }
- if (r) {
- GPR_BITSET(encodings_accepted_by_peer, algorithm);
- } else {
- char* accept_encoding_entry_str =
- grpc_slice_to_c_string(accept_encoding_entry_slice);
- gpr_log(GPR_DEBUG,
- "Unknown entry in accept encoding metadata: '%s'. Ignoring.",
- accept_encoding_entry_str);
- gpr_free(accept_encoding_entry_str);
- }
- }
-
- grpc_slice_buffer_destroy_internal(&accept_encoding_parts);
-
- grpc_mdelem_set_user_data(
- mdel, destroy_encodings_accepted_by_peer,
- reinterpret_cast<void*>(
- static_cast<uintptr_t>(*encodings_accepted_by_peer) + 1));
-}
-
-uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
- uint32_t encodings_accepted_by_peer;
- encodings_accepted_by_peer = call->encodings_accepted_by_peer;
- return encodings_accepted_by_peer;
-}
-
-grpc_stream_compression_algorithm
-grpc_call_test_only_get_incoming_stream_encodings(grpc_call* call) {
- return call->incoming_stream_compression_algorithm;
-}
-
-static grpc_linked_mdelem* linked_from_md(grpc_metadata* md) {
- return reinterpret_cast<grpc_linked_mdelem*>(&md->internal_data);
-}
-
-static grpc_metadata* get_md_elem(grpc_metadata* metadata,
- grpc_metadata* additional_metadata, int i,
- int count) {
- grpc_metadata* res =
- i < count ? &metadata[i] : &additional_metadata[i - count];
- GPR_ASSERT(res);
- return res;
-}
-
-static int prepare_application_metadata(grpc_call* call, int count,
- grpc_metadata* metadata,
- int is_trailing,
- int prepend_extra_metadata,
- grpc_metadata* additional_metadata,
- int additional_metadata_count) {
- int total_count = count + additional_metadata_count;
- int i;
+bool FilterStackCall::PrepareApplicationMetadata(size_t count,
+ grpc_metadata* metadata,
+ bool is_trailing) {
grpc_metadata_batch* batch =
- &call->metadata_batch[0 /* is_receiving */][is_trailing];
- for (i = 0; i < total_count; i++) {
- grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
- grpc_linked_mdelem* l = linked_from_md(md);
- GPR_ASSERT(sizeof(grpc_linked_mdelem) == sizeof(md->internal_data));
+ is_trailing ? &send_trailing_metadata_ : &send_initial_metadata_;
+ for (size_t i = 0; i < count; i++) {
+ grpc_metadata* md = &metadata[i];
if (!GRPC_LOG_IF_ERROR("validate_metadata",
grpc_validate_header_key_is_legal(md->key))) {
- break;
+ return false;
} else if (!grpc_is_binary_header_internal(md->key) &&
!GRPC_LOG_IF_ERROR(
"validate_metadata",
grpc_validate_header_nonbin_value_is_legal(md->value))) {
- break;
+ return false;
} else if (GRPC_SLICE_LENGTH(md->value) >= UINT32_MAX) {
// HTTP2 hpack encoding has a maximum limit.
- break;
+ return false;
+ } else if (grpc_slice_str_cmp(md->key, "content-length") == 0) {
+ // Filter "content-length metadata"
+ continue;
}
- l->md = grpc_mdelem_from_grpc_metadata(const_cast<grpc_metadata*>(md));
+ batch->Append(StringViewFromSlice(md->key),
+ Slice(grpc_slice_ref_internal(md->value)),
+ [md](absl::string_view error, const Slice& value) {
+ gpr_log(GPR_DEBUG, "Append error: %s",
+ absl::StrCat("key=", StringViewFromSlice(md->key),
+ " error=", error,
+ " value=", value.as_string_view())
+ .c_str());
+ });
}
- if (i != total_count) {
- for (int j = 0; j < i; j++) {
- grpc_metadata* md = get_md_elem(metadata, additional_metadata, j, count);
- grpc_linked_mdelem* l = linked_from_md(md);
- GRPC_MDELEM_UNREF(l->md);
- }
- return 0;
+
+ return true;
+}
+
+namespace {
+class PublishToAppEncoder {
+ public:
+ explicit PublishToAppEncoder(grpc_metadata_array* dest) : dest_(dest) {}
+
+ void Encode(const Slice& key, const Slice& value) {
+ Append(key.c_slice(), value.c_slice());
}
- if (prepend_extra_metadata) {
- if (call->send_extra_metadata_count == 0) {
- prepend_extra_metadata = 0;
- } else {
- for (i = 0; i < call->send_extra_metadata_count; i++) {
- GRPC_LOG_IF_ERROR("prepare_application_metadata",
- grpc_metadata_batch_link_tail(
- batch, &call->send_extra_metadata[i]));
- }
- }
+
+ // Catch anything that is not explicitly handled, and do not publish it to the
+ // application. If new metadata is added to a batch that needs to be
+ // published, it should be called out here.
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType&) {}
+
+ void Encode(UserAgentMetadata, const Slice& slice) {
+ Append(UserAgentMetadata::key(), slice);
}
- for (i = 0; i < total_count; i++) {
- grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
- grpc_linked_mdelem* l = linked_from_md(md);
- grpc_error_handle error = grpc_metadata_batch_link_tail(batch, l);
- if (error != GRPC_ERROR_NONE) {
- GRPC_MDELEM_UNREF(l->md);
- }
- GRPC_LOG_IF_ERROR("prepare_application_metadata", error);
+
+ void Encode(HostMetadata, const Slice& slice) {
+ Append(HostMetadata::key(), slice);
}
- call->send_extra_metadata_count = 0;
- return 1;
-}
+ void Encode(GrpcPreviousRpcAttemptsMetadata, uint32_t count) {
+ Append(GrpcPreviousRpcAttemptsMetadata::key(), count);
+ }
-static grpc_message_compression_algorithm decode_message_compression(
- 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 Encode(GrpcRetryPushbackMsMetadata, Duration count) {
+ Append(GrpcRetryPushbackMsMetadata::key(), count.millis());
+ }
-static grpc_stream_compression_algorithm decode_stream_compression(
- grpc_mdelem md) {
- grpc_stream_compression_algorithm algorithm =
- grpc_stream_compression_algorithm_from_slice(GRPC_MDVALUE(md));
- if (algorithm == GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) {
- char* md_c_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- gpr_log(GPR_ERROR,
- "Invalid incoming stream compression algorithm: '%s'. Interpreting "
- "incoming data as uncompressed.",
- md_c_str);
- gpr_free(md_c_str);
- return GRPC_STREAM_COMPRESS_NONE;
- }
- return algorithm;
-}
+ void Encode(LbTokenMetadata, const Slice& slice) {
+ Append(LbTokenMetadata::key(), slice);
+ }
+
+ private:
+ void Append(absl::string_view key, int64_t value) {
+ Append(StaticSlice::FromStaticString(key).c_slice(),
+ Slice::FromInt64(value).c_slice());
+ }
+
+ void Append(absl::string_view key, const Slice& value) {
+ Append(StaticSlice::FromStaticString(key).c_slice(), value.c_slice());
+ }
-static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
- int is_trailing) {
- if (b->list.count == 0) return;
- if (!call->is_client && is_trailing) return;
- if (is_trailing && call->buffered_metadata[1] == nullptr) return;
+ void Append(grpc_slice key, grpc_slice value) {
+ auto* mdusr = &dest_->metadata[dest_->count++];
+ mdusr->key = key;
+ mdusr->value = value;
+ }
+
+ grpc_metadata_array* const dest_;
+};
+} // namespace
+
+void FilterStackCall::PublishAppMetadata(grpc_metadata_batch* b,
+ bool is_trailing) {
+ if (b->count() == 0) return;
+ if (!is_client() && is_trailing) return;
+ if (is_trailing && buffered_metadata_[1] == nullptr) return;
GPR_TIMER_SCOPE("publish_app_metadata", 0);
grpc_metadata_array* dest;
- grpc_metadata* mdusr;
- dest = call->buffered_metadata[is_trailing];
- if (dest->count + b->list.count > dest->capacity) {
+ dest = buffered_metadata_[is_trailing];
+ if (dest->count + b->count() > dest->capacity) {
dest->capacity =
- GPR_MAX(dest->capacity + b->list.count, dest->capacity * 3 / 2);
+ std::max(dest->capacity + b->count(), dest->capacity * 3 / 2);
dest->metadata = static_cast<grpc_metadata*>(
gpr_realloc(dest->metadata, sizeof(grpc_metadata) * dest->capacity));
}
- for (grpc_linked_mdelem* l = b->list.head; l != nullptr; l = l->next) {
- mdusr = &dest->metadata[dest->count++];
- /* we pass back borrowed slices that are valid whilst the call is valid */
- mdusr->key = GRPC_MDKEY(l->md);
- mdusr->value = GRPC_MDVALUE(l->md);
- }
+ PublishToAppEncoder encoder(dest);
+ b->Encode(&encoder);
}
-static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) {
- if (b->idx.named.content_encoding != nullptr) {
- GPR_TIMER_SCOPE("incoming_stream_compression_algorithm", 0);
- set_incoming_stream_compression_algorithm(
- call, decode_stream_compression(b->idx.named.content_encoding->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_ENCODING);
- }
- if (b->idx.named.grpc_encoding != nullptr) {
- GPR_TIMER_SCOPE("incoming_message_compression_algorithm", 0);
- set_incoming_message_compression_algorithm(
- call, decode_message_compression(b->idx.named.grpc_encoding->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ENCODING);
- }
- uint32_t message_encodings_accepted_by_peer = 1u;
- uint32_t stream_encodings_accepted_by_peer = 1u;
- if (b->idx.named.grpc_accept_encoding != nullptr) {
- GPR_TIMER_SCOPE("encodings_accepted_by_peer", 0);
- set_encodings_accepted_by_peer(call, b->idx.named.grpc_accept_encoding->md,
- &message_encodings_accepted_by_peer, false);
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ACCEPT_ENCODING);
- }
- if (b->idx.named.accept_encoding != nullptr) {
- GPR_TIMER_SCOPE("stream_encodings_accepted_by_peer", 0);
- set_encodings_accepted_by_peer(call, b->idx.named.accept_encoding->md,
- &stream_encodings_accepted_by_peer, true);
- grpc_metadata_batch_remove(b, GRPC_BATCH_ACCEPT_ENCODING);
- }
- call->encodings_accepted_by_peer =
- grpc_compression_bitset_from_message_stream_compression_bitset(
- message_encodings_accepted_by_peer,
- stream_encodings_accepted_by_peer);
- publish_app_metadata(call, b, false);
+void FilterStackCall::RecvInitialFilter(grpc_metadata_batch* b) {
+ incoming_compression_algorithm_ =
+ b->Take(GrpcEncodingMetadata()).value_or(GRPC_COMPRESS_NONE);
+ encodings_accepted_by_peer_ =
+ b->Take(GrpcAcceptEncodingMetadata())
+ .value_or(CompressionAlgorithmSet{GRPC_COMPRESS_NONE});
+ PublishAppMetadata(b, false);
}
-static void recv_trailing_filter(void* args, grpc_metadata_batch* b,
- grpc_error_handle batch_error) {
- grpc_call* call = static_cast<grpc_call*>(args);
+void FilterStackCall::RecvTrailingFilter(grpc_metadata_batch* b,
+ grpc_error_handle batch_error) {
if (batch_error != GRPC_ERROR_NONE) {
- set_final_status(call, batch_error);
- } else if (b->idx.named.grpc_status != nullptr) {
- grpc_status_code status_code =
- grpc_get_status_code_from_metadata(b->idx.named.grpc_status->md);
- grpc_error_handle 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(
- 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) {
- error = grpc_error_set_str(
- error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_message->md)));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_MESSAGE);
- } else if (error != GRPC_ERROR_NONE) {
- error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_empty_slice());
- }
- set_final_status(call, GRPC_ERROR_REF(error));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_STATUS);
- GRPC_ERROR_UNREF(error);
- } else if (!call->is_client) {
- set_final_status(call, GRPC_ERROR_NONE);
+ SetFinalStatus(batch_error);
} else {
- gpr_log(GPR_DEBUG,
- "Received trailing metadata with no error and no status");
- set_final_status(
- call, grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("No status received"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNKNOWN));
- }
- publish_app_metadata(call, b, true);
-}
-
-grpc_core::Arena* grpc_call_get_arena(grpc_call* call) { return call->arena; }
-
-grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
- return CALL_STACK_FROM_CALL(call);
+ absl::optional<grpc_status_code> grpc_status =
+ b->Take(GrpcStatusMetadata());
+ if (grpc_status.has_value()) {
+ grpc_status_code status_code = *grpc_status;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (status_code != GRPC_STATUS_OK) {
+ char* peer = GetPeer();
+ error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Error received from peer ", peer)),
+ GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
+ gpr_free(peer);
+ }
+ auto grpc_message = b->Take(GrpcMessageMetadata());
+ if (grpc_message.has_value()) {
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ grpc_message->as_string_view());
+ } else if (error != GRPC_ERROR_NONE) {
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, "");
+ }
+ SetFinalStatus(GRPC_ERROR_REF(error));
+ GRPC_ERROR_UNREF(error);
+ } else if (!is_client()) {
+ SetFinalStatus(GRPC_ERROR_NONE);
+ } else {
+ gpr_log(GPR_DEBUG,
+ "Received trailing metadata with no error and no status");
+ SetFinalStatus(grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No status received"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNKNOWN));
+ }
+ }
+ PublishAppMetadata(b, true);
}
-/*******************************************************************************
- * BATCH API IMPLEMENTATION
- */
-
-static bool are_write_flags_valid(uint32_t flags) {
+namespace {
+bool AreWriteFlagsValid(uint32_t flags) {
/* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */
const uint32_t allowed_write_positions =
(GRPC_WRITE_USED_MASK | GRPC_WRITE_INTERNAL_USED_MASK);
@@ -1111,16 +985,13 @@ static bool are_write_flags_valid(uint32_t flags) {
return !(flags & invalid_positions);
}
-static bool are_initial_metadata_flags_valid(uint32_t flags, bool is_client) {
+bool AreInitialMetadataFlagsValid(uint32_t flags) {
/* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */
uint32_t invalid_positions = ~GRPC_INITIAL_METADATA_USED_MASK;
- if (!is_client) {
- invalid_positions |= GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
- }
return !(flags & invalid_positions);
}
-static size_t batch_slot_for_op(grpc_op_type type) {
+size_t BatchSlotForOp(grpc_op_type type) {
switch (type) {
case GRPC_OP_SEND_INITIAL_METADATA:
return 0;
@@ -1139,142 +1010,135 @@ static size_t batch_slot_for_op(grpc_op_type type) {
}
GPR_UNREACHABLE_CODE(return 123456789);
}
+} // namespace
-static batch_control* reuse_or_allocate_batch_control(grpc_call* call,
- const grpc_op* ops) {
- size_t slot_idx = batch_slot_for_op(ops[0].op);
- batch_control** pslot = &call->active_batches[slot_idx];
- batch_control* bctl;
+FilterStackCall::BatchControl* FilterStackCall::ReuseOrAllocateBatchControl(
+ const grpc_op* ops) {
+ size_t slot_idx = BatchSlotForOp(ops[0].op);
+ BatchControl** pslot = &active_batches_[slot_idx];
+ BatchControl* bctl;
if (*pslot != nullptr) {
bctl = *pslot;
- if (bctl->call != nullptr) {
+ if (bctl->call_ != nullptr) {
return nullptr;
}
- bctl->~batch_control();
- bctl->op = {};
+ bctl->~BatchControl();
+ bctl->op_ = {};
+ new (&bctl->batch_error_) AtomicError();
} else {
- bctl = call->arena->New<batch_control>();
+ bctl = arena()->New<BatchControl>();
*pslot = bctl;
}
- bctl->call = call;
- bctl->op.payload = &call->stream_op_payload;
+ bctl->call_ = this;
+ bctl->op_.payload = &stream_op_payload_;
return bctl;
}
-static void finish_batch_completion(void* user_data,
- grpc_cq_completion* /*storage*/) {
- batch_control* bctl = static_cast<batch_control*>(user_data);
- grpc_call* call = bctl->call;
- bctl->call = nullptr;
- GRPC_CALL_INTERNAL_UNREF(call, "completion");
-}
-
-static void reset_batch_errors(batch_control* bctl) {
- GRPC_ERROR_UNREF(reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&bctl->batch_error)));
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_NONE));
+void Call::PropagateCancellationToChildren() {
+ ParentCall* pc = parent_call();
+ if (pc != nullptr) {
+ Call* child;
+ MutexLock lock(&pc->child_list_mu);
+ child = pc->first_child;
+ if (child != nullptr) {
+ do {
+ Call* next_child_call = child->child_->sibling_next;
+ if (child->cancellation_is_inherited_) {
+ child->InternalRef("propagate_cancel");
+ child->CancelWithError(GRPC_ERROR_CANCELLED);
+ child->InternalUnref("propagate_cancel");
+ }
+ child = next_child_call;
+ } while (child != pc->first_child);
+ }
+ }
}
-static void post_batch_completion(batch_control* bctl) {
- grpc_call* next_child_call;
- grpc_call* call = bctl->call;
- grpc_error_handle error = GRPC_ERROR_REF(reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&bctl->batch_error)));
+void FilterStackCall::BatchControl::PostCompletion() {
+ FilterStackCall* call = call_;
+ grpc_error_handle error = GRPC_ERROR_REF(batch_error_.get());
- if (bctl->op.send_initial_metadata) {
- grpc_metadata_batch_destroy(
- &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]);
+ if (op_.send_initial_metadata) {
+ call->send_initial_metadata_.Clear();
}
- if (bctl->op.send_message) {
- if (bctl->op.payload->send_message.stream_write_closed &&
+ if (op_.send_message) {
+ if (op_.payload->send_message.stream_write_closed &&
error == GRPC_ERROR_NONE) {
error = grpc_error_add_child(
error, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Attempt to send message after stream was closed."));
}
- call->sending_message = false;
+ call->sending_message_ = false;
}
- if (bctl->op.send_trailing_metadata) {
- grpc_metadata_batch_destroy(
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */]);
+ if (op_.send_trailing_metadata) {
+ call->send_trailing_metadata_.Clear();
}
- if (bctl->op.recv_trailing_metadata) {
+ if (op_.recv_trailing_metadata) {
/* propagate cancellation to any interested children */
- gpr_atm_rel_store(&call->received_final_op_atm, 1);
- parent_call* pc = get_parent_call(call);
- if (pc != nullptr) {
- grpc_call* child;
- gpr_mu_lock(&pc->child_list_mu);
- child = pc->first_child;
- if (child != nullptr) {
- do {
- next_child_call = child->child->sibling_next;
- if (child->cancellation_is_inherited) {
- GRPC_CALL_INTERNAL_REF(child, "propagate_cancel");
- cancel_with_error(child, GRPC_ERROR_CANCELLED);
- GRPC_CALL_INTERNAL_UNREF(child, "propagate_cancel");
- }
- child = next_child_call;
- } while (child != pc->first_child);
- }
- gpr_mu_unlock(&pc->child_list_mu);
- }
+ gpr_atm_rel_store(&call->received_final_op_atm_, 1);
+ call->PropagateCancellationToChildren();
GRPC_ERROR_UNREF(error);
error = GRPC_ERROR_NONE;
}
- if (error != GRPC_ERROR_NONE && bctl->op.recv_message &&
- *call->receiving_buffer != nullptr) {
- grpc_byte_buffer_destroy(*call->receiving_buffer);
- *call->receiving_buffer = nullptr;
+ if (error != GRPC_ERROR_NONE && op_.recv_message &&
+ *call->receiving_buffer_ != nullptr) {
+ grpc_byte_buffer_destroy(*call->receiving_buffer_);
+ *call->receiving_buffer_ = nullptr;
}
- reset_batch_errors(bctl);
+ batch_error_.set(GRPC_ERROR_NONE);
- if (bctl->completion_data.notify_tag.is_closure) {
+ if (completion_data_.notify_tag.is_closure) {
/* unrefs error */
- bctl->call = nullptr;
- grpc_core::Closure::Run(
- DEBUG_LOCATION,
- static_cast<grpc_closure*>(bctl->completion_data.notify_tag.tag),
- error);
- GRPC_CALL_INTERNAL_UNREF(call, "completion");
+ call_ = nullptr;
+ Closure::Run(DEBUG_LOCATION,
+ static_cast<grpc_closure*>(completion_data_.notify_tag.tag),
+ error);
+ call->InternalUnref("completion");
} else {
/* unrefs error */
- grpc_cq_end_op(bctl->call->cq, bctl->completion_data.notify_tag.tag, error,
- finish_batch_completion, bctl,
- &bctl->completion_data.cq_completion);
+ grpc_cq_end_op(
+ call->cq_, completion_data_.notify_tag.tag, error,
+ [](void* user_data, grpc_cq_completion* /*storage*/) {
+ BatchControl* bctl = static_cast<BatchControl*>(user_data);
+ Call* call = bctl->call_;
+ bctl->call_ = nullptr;
+ call->InternalUnref("completion");
+ },
+ this, &completion_data_.cq_completion);
}
}
-static void finish_batch_step(batch_control* bctl) {
- if (GPR_UNLIKELY(bctl->completed_batch_step())) {
- post_batch_completion(bctl);
+void FilterStackCall::BatchControl::FinishStep() {
+ if (GPR_UNLIKELY(completed_batch_step())) {
+ PostCompletion();
}
}
-static void continue_receiving_slices(batch_control* bctl) {
+void FilterStackCall::BatchControl::ContinueReceivingSlices() {
grpc_error_handle error;
- grpc_call* call = bctl->call;
+ FilterStackCall* call = call_;
for (;;) {
- size_t remaining = call->receiving_stream->length() -
- (*call->receiving_buffer)->data.raw.slice_buffer.length;
+ size_t remaining = call->receiving_stream_->length() -
+ (*call->receiving_buffer_)->data.raw.slice_buffer.length;
if (remaining == 0) {
- call->receiving_message = false;
- call->receiving_stream.reset();
- finish_batch_step(bctl);
+ call->receiving_message_ = false;
+ call->receiving_stream_.reset();
+ FinishStep();
return;
}
- if (call->receiving_stream->Next(remaining, &call->receiving_slice_ready)) {
- error = call->receiving_stream->Pull(&call->receiving_slice);
+ if (call->receiving_stream_->Next(remaining,
+ &call->receiving_slice_ready_)) {
+ error = call->receiving_stream_->Pull(&call->receiving_slice_);
if (error == GRPC_ERROR_NONE) {
- grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
- call->receiving_slice);
+ grpc_slice_buffer_add(
+ &(*call->receiving_buffer_)->data.raw.slice_buffer,
+ call->receiving_slice_);
} else {
- call->receiving_stream.reset();
- grpc_byte_buffer_destroy(*call->receiving_buffer);
- *call->receiving_buffer = nullptr;
- call->receiving_message = false;
- finish_batch_step(bctl);
+ call->receiving_stream_.reset();
+ grpc_byte_buffer_destroy(*call->receiving_buffer_);
+ *call->receiving_buffer_ = nullptr;
+ call->receiving_message_ = false;
+ FinishStep();
GRPC_ERROR_UNREF(error);
return;
}
@@ -1284,18 +1148,18 @@ static void continue_receiving_slices(batch_control* bctl) {
}
}
-static void receiving_slice_ready(void* bctlp, grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
+void FilterStackCall::BatchControl::ReceivingSliceReady(
+ grpc_error_handle error) {
+ FilterStackCall* call = call_;
bool release_error = false;
if (error == GRPC_ERROR_NONE) {
grpc_slice slice;
- error = call->receiving_stream->Pull(&slice);
+ error = call->receiving_stream_->Pull(&slice);
if (error == GRPC_ERROR_NONE) {
- grpc_slice_buffer_add(&(*call->receiving_buffer)->data.raw.slice_buffer,
+ grpc_slice_buffer_add(&(*call->receiving_buffer_)->data.raw.slice_buffer,
slice);
- continue_receiving_slices(bctl);
+ ContinueReceivingSlices();
} else {
/* Error returned by ByteStream::Pull() needs to be released manually */
release_error = true;
@@ -1306,194 +1170,133 @@ static void receiving_slice_ready(void* bctlp, grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
GRPC_LOG_IF_ERROR("receiving_slice_ready", GRPC_ERROR_REF(error));
}
- call->receiving_stream.reset();
- grpc_byte_buffer_destroy(*call->receiving_buffer);
- *call->receiving_buffer = nullptr;
- call->receiving_message = false;
- finish_batch_step(bctl);
+ call->receiving_stream_.reset();
+ grpc_byte_buffer_destroy(*call->receiving_buffer_);
+ *call->receiving_buffer_ = nullptr;
+ call->receiving_message_ = false;
+ FinishStep();
if (release_error) {
GRPC_ERROR_UNREF(error);
}
}
}
-static void process_data_after_md(batch_control* bctl) {
- grpc_call* call = bctl->call;
- if (call->receiving_stream == nullptr) {
- *call->receiving_buffer = nullptr;
- call->receiving_message = false;
- finish_batch_step(bctl);
+void FilterStackCall::BatchControl::ProcessDataAfterMetadata() {
+ FilterStackCall* call = call_;
+ if (call->receiving_stream_ == nullptr) {
+ *call->receiving_buffer_ = nullptr;
+ call->receiving_message_ = false;
+ FinishStep();
} else {
- call->test_only_last_message_flags = call->receiving_stream->flags();
- if ((call->receiving_stream->flags() & GRPC_WRITE_INTERNAL_COMPRESS) &&
- (call->incoming_message_compression_algorithm >
- GRPC_MESSAGE_COMPRESS_NONE)) {
- grpc_compression_algorithm algo;
- GPR_ASSERT(
- grpc_compression_algorithm_from_message_stream_compression_algorithm(
- &algo, call->incoming_message_compression_algorithm,
- (grpc_stream_compression_algorithm)0));
- *call->receiving_buffer =
- grpc_raw_compressed_byte_buffer_create(nullptr, 0, algo);
+ call->test_only_last_message_flags_ = call->receiving_stream_->flags();
+ if ((call->receiving_stream_->flags() & GRPC_WRITE_INTERNAL_COMPRESS) &&
+ (call->incoming_compression_algorithm_ != GRPC_COMPRESS_NONE)) {
+ *call->receiving_buffer_ = grpc_raw_compressed_byte_buffer_create(
+ nullptr, 0, call->incoming_compression_algorithm_);
} else {
- *call->receiving_buffer = grpc_raw_byte_buffer_create(nullptr, 0);
+ *call->receiving_buffer_ = grpc_raw_byte_buffer_create(nullptr, 0);
}
- GRPC_CLOSURE_INIT(&call->receiving_slice_ready, receiving_slice_ready, bctl,
- grpc_schedule_on_exec_ctx);
- continue_receiving_slices(bctl);
+ GRPC_CLOSURE_INIT(
+ &call->receiving_slice_ready_,
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->ReceivingSliceReady(error);
+ },
+ this, grpc_schedule_on_exec_ctx);
+ ContinueReceivingSlices();
}
}
-static void receiving_stream_ready(void* bctlp, grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
+void FilterStackCall::BatchControl::ReceivingStreamReady(
+ grpc_error_handle error) {
+ FilterStackCall* call = call_;
if (error != GRPC_ERROR_NONE) {
- call->receiving_stream.reset();
- if (reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&bctl->batch_error)) == GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+ call->receiving_stream_.reset();
+ if (batch_error_.ok()) {
+ batch_error_.set(error);
}
- cancel_with_error(call, GRPC_ERROR_REF(error));
+ call->CancelWithError(GRPC_ERROR_REF(error));
}
- /* If recv_state is RECV_NONE, we will save the batch_control
+ /* If recv_state is kRecvNone, we will save the batch_control
* object with rel_cas, and will not use it after the cas. Its corresponding
* acq_load is in receiving_initial_metadata_ready() */
- if (error != GRPC_ERROR_NONE || call->receiving_stream == nullptr ||
- !gpr_atm_rel_cas(&call->recv_state, RECV_NONE,
- reinterpret_cast<gpr_atm>(bctlp))) {
- process_data_after_md(bctl);
+ if (error != GRPC_ERROR_NONE || call->receiving_stream_ == nullptr ||
+ !gpr_atm_rel_cas(&call->recv_state_, kRecvNone,
+ reinterpret_cast<gpr_atm>(this))) {
+ ProcessDataAfterMetadata();
}
}
-// The recv_message_ready callback used when sending a batch containing
-// a recv_message op down the filter stack. Yields the call combiner
-// before processing the received message.
-static void receiving_stream_ready_in_call_combiner(void* bctlp,
- grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
- GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_message_ready");
- receiving_stream_ready(bctlp, error);
-}
-
-static void GPR_ATTRIBUTE_NOINLINE
-handle_both_stream_and_msg_compression_set(grpc_call* call) {
- std::string error_msg = 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) {
- std::string error_msg = 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) {
- std::string error_msg = 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) {
+void FilterStackCall::HandleCompressionAlgorithmDisabled(
+ grpc_compression_algorithm compression_algorithm) {
const char* algo_name = nullptr;
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
std::string error_msg =
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());
+ CancelWithStatus(GRPC_STATUS_UNIMPLEMENTED, error_msg.c_str());
}
-static void GPR_ATTRIBUTE_NOINLINE handle_compression_algorithm_not_accepted(
- grpc_call* call, grpc_compression_algorithm compression_algorithm) {
+void FilterStackCall::HandleCompressionAlgorithmNotAccepted(
+ grpc_compression_algorithm compression_algorithm) {
const char* algo_name = nullptr;
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
gpr_log(GPR_ERROR,
- "Compression algorithm ('%s') not present in the bitset of "
- "accepted encodings ('0x%x')",
- algo_name, call->encodings_accepted_by_peer);
-}
-
-static void validate_filtered_metadata(batch_control* bctl) {
- grpc_compression_algorithm compression_algorithm;
- grpc_call* call = bctl->call;
- if (GPR_UNLIKELY(call->incoming_stream_compression_algorithm !=
- GRPC_STREAM_COMPRESS_NONE &&
- call->incoming_message_compression_algorithm !=
- GRPC_MESSAGE_COMPRESS_NONE)) {
- handle_both_stream_and_msg_compression_set(call);
- } else if (
- GPR_UNLIKELY(
- grpc_compression_algorithm_from_message_stream_compression_algorithm(
- &compression_algorithm,
- call->incoming_message_compression_algorithm,
- call->incoming_stream_compression_algorithm) == 0)) {
- handle_error_parsing_compression_algorithm(call);
- } else {
- const grpc_compression_options compression_options =
- grpc_channel_compression_options(call->channel);
- if (GPR_UNLIKELY(compression_algorithm >= GRPC_COMPRESS_ALGORITHMS_COUNT)) {
- handle_invalid_compression(call, compression_algorithm);
- } else if (GPR_UNLIKELY(
- grpc_compression_options_is_algorithm_enabled_internal(
- &compression_options, compression_algorithm) == 0)) {
- /* check if algorithm is supported by current channel config */
- handle_compression_algorithm_disabled(call, compression_algorithm);
- }
- /* GRPC_COMPRESS_NONE is always set. */
- GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer != 0);
- if (GPR_UNLIKELY(!GPR_BITGET(call->encodings_accepted_by_peer,
- compression_algorithm))) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
- handle_compression_algorithm_not_accepted(call, compression_algorithm);
- }
+ "Compression algorithm ('%s') not present in the "
+ "accepted encodings (%s)",
+ algo_name, encodings_accepted_by_peer_.ToString().c_str());
+}
+
+void FilterStackCall::BatchControl::ValidateFilteredMetadata() {
+ FilterStackCall* call = call_;
+
+ const grpc_compression_options compression_options =
+ grpc_channel_compression_options(call->channel_);
+ const grpc_compression_algorithm compression_algorithm =
+ call->incoming_compression_algorithm_;
+ if (GPR_UNLIKELY(!CompressionAlgorithmSet::FromUint32(
+ compression_options.enabled_algorithms_bitset)
+ .IsSet(compression_algorithm))) {
+ /* check if algorithm is supported by current channel config */
+ call->HandleCompressionAlgorithmDisabled(compression_algorithm);
+ }
+ /* GRPC_COMPRESS_NONE is always set. */
+ GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer_.IsSet(GRPC_COMPRESS_NONE));
+ if (GPR_UNLIKELY(
+ !call->encodings_accepted_by_peer_.IsSet(compression_algorithm))) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
+ call->HandleCompressionAlgorithmNotAccepted(compression_algorithm);
}
}
}
-static void receiving_initial_metadata_ready(void* bctlp,
- grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
+void FilterStackCall::BatchControl::ReceivingInitialMetadataReady(
+ grpc_error_handle error) {
+ FilterStackCall* call = call_;
- GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_initial_metadata_ready");
+ GRPC_CALL_COMBINER_STOP(call->call_combiner(), "recv_initial_metadata_ready");
if (error == GRPC_ERROR_NONE) {
- grpc_metadata_batch* md =
- &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
- recv_initial_filter(call, md);
+ grpc_metadata_batch* md = &call->recv_initial_metadata_;
+ call->RecvInitialFilter(md);
/* TODO(ctiller): this could be moved into recv_initial_filter now */
GPR_TIMER_SCOPE("validate_filtered_metadata", 0);
- validate_filtered_metadata(bctl);
+ ValidateFilteredMetadata();
- if (md->deadline != GRPC_MILLIS_INF_FUTURE && !call->is_client) {
- call->send_deadline = md->deadline;
+ absl::optional<Timestamp> deadline = md->get(GrpcTimeoutMetadata());
+ if (deadline.has_value() && !call->is_client()) {
+ call_->set_send_deadline(*deadline);
}
} else {
- if (reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&bctl->batch_error)) == GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+ if (batch_error_.ok()) {
+ batch_error_.set(error);
}
- cancel_with_error(call, GRPC_ERROR_REF(error));
+ call->CancelWithError(GRPC_ERROR_REF(error));
}
grpc_closure* saved_rsr_closure = nullptr;
while (true) {
- gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state);
+ gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state_);
/* Should only receive initial metadata once */
GPR_ASSERT(rsr_bctlp != 1);
if (rsr_bctlp == 0) {
@@ -1502,99 +1305,100 @@ static void receiving_initial_metadata_ready(void* bctlp,
* no_barrier_cas is used, as this function won't access the batch_control
* object saved by receiving_stream_ready() if the initial metadata is
* received first. */
- if (gpr_atm_no_barrier_cas(&call->recv_state, RECV_NONE,
- RECV_INITIAL_METADATA_FIRST)) {
+ if (gpr_atm_no_barrier_cas(&call->recv_state_, kRecvNone,
+ kRecvInitialMetadataFirst)) {
break;
}
} else {
/* Already received messages */
- saved_rsr_closure =
- GRPC_CLOSURE_CREATE(receiving_stream_ready, (batch_control*)rsr_bctlp,
- grpc_schedule_on_exec_ctx);
+ saved_rsr_closure = GRPC_CLOSURE_CREATE(
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->ReceivingStreamReady(error);
+ },
+ reinterpret_cast<BatchControl*>(rsr_bctlp),
+ grpc_schedule_on_exec_ctx);
/* No need to modify recv_state */
break;
}
}
if (saved_rsr_closure != nullptr) {
- grpc_core::Closure::Run(DEBUG_LOCATION, saved_rsr_closure,
- GRPC_ERROR_REF(error));
+ Closure::Run(DEBUG_LOCATION, saved_rsr_closure, GRPC_ERROR_REF(error));
}
- finish_batch_step(bctl);
+ FinishStep();
}
-static void receiving_trailing_metadata_ready(void* bctlp,
- grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
- GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_trailing_metadata_ready");
- grpc_metadata_batch* md =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- recv_trailing_filter(call, md, GRPC_ERROR_REF(error));
- finish_batch_step(bctl);
+void FilterStackCall::BatchControl::ReceivingTrailingMetadataReady(
+ grpc_error_handle error) {
+ GRPC_CALL_COMBINER_STOP(call_->call_combiner(),
+ "recv_trailing_metadata_ready");
+ grpc_metadata_batch* md = &call_->recv_trailing_metadata_;
+ call_->RecvTrailingFilter(md, GRPC_ERROR_REF(error));
+ FinishStep();
}
-static void finish_batch(void* bctlp, grpc_error_handle error) {
- batch_control* bctl = static_cast<batch_control*>(bctlp);
- grpc_call* call = bctl->call;
- GRPC_CALL_COMBINER_STOP(&call->call_combiner, "on_complete");
- if (reinterpret_cast<grpc_error_handle>(
- gpr_atm_acq_load(&bctl->batch_error)) == GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+void FilterStackCall::BatchControl::FinishBatch(grpc_error_handle error) {
+ GRPC_CALL_COMBINER_STOP(call_->call_combiner(), "on_complete");
+ if (batch_error_.ok()) {
+ batch_error_.set(error);
}
if (error != GRPC_ERROR_NONE) {
- cancel_with_error(call, GRPC_ERROR_REF(error));
+ call_->CancelWithError(GRPC_ERROR_REF(error));
}
- finish_batch_step(bctl);
+ FinishStep();
}
-static void free_no_op_completion(void* /*p*/, grpc_cq_completion* completion) {
- gpr_free(completion);
-}
-
-static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
- size_t nops, void* notify_tag,
- int is_notify_tag_closure) {
+grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops,
+ void* notify_tag,
+ bool is_notify_tag_closure) {
GPR_TIMER_SCOPE("call_start_batch", 0);
size_t i;
const grpc_op* op;
- batch_control* bctl;
+ BatchControl* bctl;
bool has_send_ops = false;
int num_recv_ops = 0;
grpc_call_error error = GRPC_CALL_OK;
grpc_transport_stream_op_batch* stream_op;
grpc_transport_stream_op_batch_payload* stream_op_payload;
+ uint32_t seen_ops = 0;
+
+ for (i = 0; i < nops; i++) {
+ if (seen_ops & (1u << ops[i].op)) {
+ return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
+ }
+ seen_ops |= (1u << ops[i].op);
+ }
GRPC_CALL_LOG_BATCH(GPR_INFO, ops, nops);
if (nops == 0) {
if (!is_notify_tag_closure) {
- GPR_ASSERT(grpc_cq_begin_op(call->cq, notify_tag));
- grpc_cq_end_op(call->cq, notify_tag, GRPC_ERROR_NONE,
- free_no_op_completion, nullptr,
- static_cast<grpc_cq_completion*>(
- gpr_malloc(sizeof(grpc_cq_completion))));
+ GPR_ASSERT(grpc_cq_begin_op(cq_, notify_tag));
+ grpc_cq_end_op(
+ cq_, notify_tag, GRPC_ERROR_NONE,
+ [](void*, grpc_cq_completion* completion) { gpr_free(completion); },
+ nullptr,
+ static_cast<grpc_cq_completion*>(
+ gpr_malloc(sizeof(grpc_cq_completion))));
} else {
- grpc_core::Closure::Run(DEBUG_LOCATION,
- static_cast<grpc_closure*>(notify_tag),
- GRPC_ERROR_NONE);
+ Closure::Run(DEBUG_LOCATION, static_cast<grpc_closure*>(notify_tag),
+ GRPC_ERROR_NONE);
}
error = GRPC_CALL_OK;
goto done;
}
- bctl = reuse_or_allocate_batch_control(call, ops);
+ bctl = ReuseOrAllocateBatchControl(ops);
if (bctl == nullptr) {
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
}
- bctl->completion_data.notify_tag.tag = notify_tag;
- bctl->completion_data.notify_tag.is_closure =
+ bctl->completion_data_.notify_tag.tag = notify_tag;
+ bctl->completion_data_.notify_tag.is_closure =
static_cast<uint8_t>(is_notify_tag_closure != 0);
- stream_op = &bctl->op;
- stream_op_payload = &call->stream_op_payload;
+ stream_op = &bctl->op_;
+ stream_op_payload = &stream_op_payload_;
/* rewrite batch ops into a transport op */
for (i = 0; i < nops; i++) {
@@ -1606,11 +1410,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
switch (op->op) {
case GRPC_OP_SEND_INITIAL_METADATA: {
/* Flag validation: currently allow no flags */
- if (!are_initial_metadata_flags_valid(op->flags, call->is_client)) {
+ if (!AreInitialMetadataFlagsValid(op->flags)) {
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (call->sent_initial_metadata) {
+ if (sent_initial_metadata_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
@@ -1619,11 +1423,6 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
// GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY, we shouldn't override that
// with the compression algorithm mapped from compression level.
/* process compression level */
- grpc_metadata& compression_md = call->compression_md;
- compression_md.key = grpc_empty_slice();
- compression_md.value = grpc_empty_slice();
- compression_md.flags = 0;
- size_t additional_metadata_count = 0;
grpc_compression_level effective_compression_level =
GRPC_COMPRESS_LEVEL_NONE;
bool level_set = false;
@@ -1633,55 +1432,52 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
level_set = true;
} else {
const grpc_compression_options copts =
- grpc_channel_compression_options(call->channel);
+ grpc_channel_compression_options(channel_);
if (copts.default_level.is_set) {
level_set = true;
effective_compression_level = copts.default_level.level;
}
}
// Currently, only server side supports compression level setting.
- if (level_set && !call->is_client) {
+ if (level_set && !is_client()) {
const grpc_compression_algorithm calgo =
- compression_algorithm_for_level_locked(
- call, effective_compression_level);
+ encodings_accepted_by_peer_.CompressionAlgorithmForLevel(
+ effective_compression_level);
// The following metadata will be checked and removed by the message
// compression filter. It will be used as the call's compression
// algorithm.
- compression_md.key = GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST;
- compression_md.value = grpc_compression_algorithm_slice(calgo);
- additional_metadata_count++;
+ send_initial_metadata_.Set(GrpcInternalEncodingRequest(), calgo);
}
- if (op->data.send_initial_metadata.count + additional_metadata_count >
- INT_MAX) {
+ if (op->data.send_initial_metadata.count > INT_MAX) {
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
stream_op->send_initial_metadata = true;
- call->sent_initial_metadata = true;
- if (!prepare_application_metadata(
- call, static_cast<int>(op->data.send_initial_metadata.count),
- op->data.send_initial_metadata.metadata, 0, call->is_client,
- &compression_md, static_cast<int>(additional_metadata_count))) {
+ sent_initial_metadata_ = true;
+ if (!PrepareApplicationMetadata(op->data.send_initial_metadata.count,
+ op->data.send_initial_metadata.metadata,
+ false)) {
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
+ // Ignore any te metadata key value pairs specified.
+ send_initial_metadata_.Remove(TeMetadata());
/* TODO(ctiller): just make these the same variable? */
- if (call->is_client) {
- call->metadata_batch[0][0].deadline = call->send_deadline;
+ if (is_client() && send_deadline() != Timestamp::InfFuture()) {
+ send_initial_metadata_.Set(GrpcTimeoutMetadata(), send_deadline());
}
stream_op_payload->send_initial_metadata.send_initial_metadata =
- &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */];
+ &send_initial_metadata_;
stream_op_payload->send_initial_metadata.send_initial_metadata_flags =
op->flags;
- if (call->is_client) {
- stream_op_payload->send_initial_metadata.peer_string =
- &call->peer_string;
+ if (is_client()) {
+ stream_op_payload->send_initial_metadata.peer_string = &peer_string_;
}
has_send_ops = true;
break;
}
case GRPC_OP_SEND_MESSAGE: {
- if (!are_write_flags_valid(op->flags)) {
+ if (!AreWriteFlagsValid(op->flags)) {
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
@@ -1689,7 +1485,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_MESSAGE;
goto done_with_error;
}
- if (call->sending_message) {
+ if (sending_message_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
@@ -1702,11 +1498,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
flags |= GRPC_WRITE_INTERNAL_COMPRESS;
}
stream_op->send_message = true;
- call->sending_message = true;
- call->sending_stream.Init(
+ sending_message_ = true;
+ sending_stream_.Init(
&op->data.send_message.send_message->data.raw.slice_buffer, flags);
stream_op_payload->send_message.send_message.reset(
- call->sending_stream.get());
+ sending_stream_.get());
has_send_ops = true;
break;
}
@@ -1716,18 +1512,18 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (!call->is_client) {
+ if (!is_client()) {
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
goto done_with_error;
}
- if (call->sent_final_op) {
+ if (sent_final_op_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
stream_op->send_trailing_metadata = true;
- call->sent_final_op = true;
+ sent_final_op_ = true;
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ &send_trailing_metadata_;
has_send_ops = true;
break;
}
@@ -1737,11 +1533,11 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (call->is_client) {
+ if (is_client()) {
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
goto done_with_error;
}
- if (call->sent_final_op) {
+ if (sent_final_op_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
@@ -1751,11 +1547,15 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
goto done_with_error;
}
stream_op->send_trailing_metadata = true;
- call->sent_final_op = true;
- GPR_ASSERT(call->send_extra_metadata_count == 0);
- call->send_extra_metadata_count = 1;
- call->send_extra_metadata[0].md = grpc_get_reffed_status_elem(
- op->data.send_status_from_server.status);
+ sent_final_op_ = true;
+
+ if (!PrepareApplicationMetadata(
+ op->data.send_status_from_server.trailing_metadata_count,
+ op->data.send_status_from_server.trailing_metadata, true)) {
+ error = GRPC_CALL_ERROR_INVALID_METADATA;
+ goto done_with_error;
+ }
+
grpc_error_handle status_error =
op->data.send_status_from_server.status == GRPC_STATUS_OK
? GRPC_ERROR_NONE
@@ -1766,40 +1566,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
static_cast<intptr_t>(
op->data.send_status_from_server.status));
if (op->data.send_status_from_server.status_details != nullptr) {
- call->send_extra_metadata[1].md = grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_MESSAGE,
- grpc_slice_ref_internal(
- *op->data.send_status_from_server.status_details));
- call->send_extra_metadata_count++;
+ send_trailing_metadata_.Set(
+ GrpcMessageMetadata(),
+ Slice(grpc_slice_copy(
+ *op->data.send_status_from_server.status_details)));
if (status_error != GRPC_ERROR_NONE) {
- char* msg = grpc_slice_to_c_string(
- GRPC_MDVALUE(call->send_extra_metadata[1].md));
- status_error =
- grpc_error_set_str(status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_copied_string(msg));
- gpr_free(msg);
+ status_error = grpc_error_set_str(
+ status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ StringViewFromSlice(
+ *op->data.send_status_from_server.status_details));
}
}
- gpr_atm_rel_store(&call->status_error,
- reinterpret_cast<gpr_atm>(status_error));
- if (!prepare_application_metadata(
- call,
- static_cast<int>(
- op->data.send_status_from_server.trailing_metadata_count),
- op->data.send_status_from_server.trailing_metadata, 1, 1,
- nullptr, 0)) {
- for (int n = 0; n < call->send_extra_metadata_count; n++) {
- GRPC_MDELEM_UNREF(call->send_extra_metadata[n].md);
- }
- call->send_extra_metadata_count = 0;
- error = GRPC_CALL_ERROR_INVALID_METADATA;
- goto done_with_error;
- }
+ status_error_.set(status_error);
+ GRPC_ERROR_UNREF(status_error);
+
+ send_trailing_metadata_.Set(GrpcStatusMetadata(),
+ op->data.send_status_from_server.status);
+
+ // Ignore any te metadata key value pairs specified.
+ send_trailing_metadata_.Remove(TeMetadata());
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ &send_trailing_metadata_;
stream_op_payload->send_trailing_metadata.sent =
- &call->sent_server_trailing_metadata;
+ &sent_server_trailing_metadata_;
has_send_ops = true;
break;
}
@@ -1809,24 +1599,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (call->received_initial_metadata) {
+ if (received_initial_metadata_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
- call->received_initial_metadata = true;
- call->buffered_metadata[0] =
+ received_initial_metadata_ = true;
+ buffered_metadata_[0] =
op->data.recv_initial_metadata.recv_initial_metadata;
- GRPC_CLOSURE_INIT(&call->receiving_initial_metadata_ready,
- receiving_initial_metadata_ready, bctl,
- grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(
+ &receiving_initial_metadata_ready_,
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->ReceivingInitialMetadataReady(
+ error);
+ },
+ bctl, grpc_schedule_on_exec_ctx);
stream_op->recv_initial_metadata = true;
stream_op_payload->recv_initial_metadata.recv_initial_metadata =
- &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
+ &recv_initial_metadata_;
stream_op_payload->recv_initial_metadata.recv_initial_metadata_ready =
- &call->receiving_initial_metadata_ready;
- if (!call->is_client) {
- stream_op_payload->recv_initial_metadata.peer_string =
- &call->peer_string;
+ &receiving_initial_metadata_ready_;
+ if (is_client()) {
+ stream_op_payload->recv_initial_metadata.trailing_metadata_available =
+ &is_trailers_only_;
+ } else {
+ stream_op_payload->recv_initial_metadata.peer_string = &peer_string_;
}
++num_recv_ops;
break;
@@ -1837,19 +1633,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (call->receiving_message) {
+ if (receiving_message_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
- call->receiving_message = true;
+ receiving_message_ = true;
stream_op->recv_message = true;
- call->receiving_buffer = op->data.recv_message.recv_message;
- stream_op_payload->recv_message.recv_message = &call->receiving_stream;
- GRPC_CLOSURE_INIT(&call->receiving_stream_ready,
- receiving_stream_ready_in_call_combiner, bctl,
- grpc_schedule_on_exec_ctx);
+ receiving_buffer_ = op->data.recv_message.recv_message;
+ stream_op_payload->recv_message.recv_message = &receiving_stream_;
+ stream_op_payload->recv_message.call_failed_before_recv_message =
+ &call_failed_before_recv_message_;
+ GRPC_CLOSURE_INIT(
+ &receiving_stream_ready_,
+ [](void* bctlp, grpc_error_handle error) {
+ auto* bctl = static_cast<BatchControl*>(bctlp);
+ auto* call = bctl->call_;
+ // Yields the call combiner before processing the received
+ // message.
+ GRPC_CALL_COMBINER_STOP(call->call_combiner(),
+ "recv_message_ready");
+ bctl->ReceivingStreamReady(error);
+ },
+ bctl, grpc_schedule_on_exec_ctx);
stream_op_payload->recv_message.recv_message_ready =
- &call->receiving_stream_ready;
+ &receiving_stream_ready_;
++num_recv_ops;
break;
}
@@ -1859,32 +1666,36 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (!call->is_client) {
+ if (!is_client()) {
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
goto done_with_error;
}
- if (call->requested_final_op) {
+ if (requested_final_op_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
- call->requested_final_op = true;
- call->buffered_metadata[1] =
+ requested_final_op_ = true;
+ buffered_metadata_[1] =
op->data.recv_status_on_client.trailing_metadata;
- call->final_op.client.status = op->data.recv_status_on_client.status;
- call->final_op.client.status_details =
+ final_op_.client.status = op->data.recv_status_on_client.status;
+ final_op_.client.status_details =
op->data.recv_status_on_client.status_details;
- call->final_op.client.error_string =
+ final_op_.client.error_string =
op->data.recv_status_on_client.error_string;
stream_op->recv_trailing_metadata = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ &recv_trailing_metadata_;
stream_op_payload->recv_trailing_metadata.collect_stats =
- &call->final_info.stats.transport_stream_stats;
- GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
- receiving_trailing_metadata_ready, bctl,
- grpc_schedule_on_exec_ctx);
+ &final_info_.stats.transport_stream_stats;
+ GRPC_CLOSURE_INIT(
+ &receiving_trailing_metadata_ready_,
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
+ error);
+ },
+ bctl, grpc_schedule_on_exec_ctx);
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &call->receiving_trailing_metadata_ready;
+ &receiving_trailing_metadata_ready_;
++num_recv_ops;
break;
}
@@ -1894,47 +1705,54 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error;
}
- if (call->is_client) {
+ if (is_client()) {
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
goto done_with_error;
}
- if (call->requested_final_op) {
+ if (requested_final_op_) {
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
goto done_with_error;
}
- call->requested_final_op = true;
- call->final_op.server.cancelled =
- op->data.recv_close_on_server.cancelled;
+ requested_final_op_ = true;
+ final_op_.server.cancelled = op->data.recv_close_on_server.cancelled;
stream_op->recv_trailing_metadata = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ &recv_trailing_metadata_;
stream_op_payload->recv_trailing_metadata.collect_stats =
- &call->final_info.stats.transport_stream_stats;
- GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
- receiving_trailing_metadata_ready, bctl,
- grpc_schedule_on_exec_ctx);
+ &final_info_.stats.transport_stream_stats;
+ GRPC_CLOSURE_INIT(
+ &receiving_trailing_metadata_ready_,
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
+ error);
+ },
+ bctl, grpc_schedule_on_exec_ctx);
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &call->receiving_trailing_metadata_ready;
+ &receiving_trailing_metadata_ready_;
++num_recv_ops;
break;
}
}
}
- GRPC_CALL_INTERNAL_REF(call, "completion");
+ InternalRef("completion");
if (!is_notify_tag_closure) {
- GPR_ASSERT(grpc_cq_begin_op(call->cq, notify_tag));
+ GPR_ASSERT(grpc_cq_begin_op(cq_, notify_tag));
}
bctl->set_num_steps_to_complete((has_send_ops ? 1 : 0) + num_recv_ops);
if (has_send_ops) {
- GRPC_CLOSURE_INIT(&bctl->finish_batch, finish_batch, bctl,
- grpc_schedule_on_exec_ctx);
- stream_op->on_complete = &bctl->finish_batch;
+ GRPC_CLOSURE_INIT(
+ &bctl->finish_batch_,
+ [](void* bctl, grpc_error_handle error) {
+ static_cast<BatchControl*>(bctl)->FinishBatch(error);
+ },
+ bctl, grpc_schedule_on_exec_ctx);
+ stream_op->on_complete = &bctl->finish_batch_;
}
- gpr_atm_rel_store(&call->any_ops_sent_atm, 1);
- execute_batch(call, stream_op, &bctl->start_batch);
+ gpr_atm_rel_store(&any_ops_sent_atm_, 1);
+ ExecuteBatch(stream_op, &bctl->start_batch_);
done:
return error;
@@ -1942,76 +1760,172 @@ done:
done_with_error:
/* reverse any mutations that occurred */
if (stream_op->send_initial_metadata) {
- call->sent_initial_metadata = false;
- grpc_metadata_batch_clear(&call->metadata_batch[0][0]);
+ sent_initial_metadata_ = false;
+ send_initial_metadata_.Clear();
}
if (stream_op->send_message) {
- call->sending_message = false;
- call->sending_stream->Orphan();
+ sending_message_ = false;
+ // No need to invoke call->sending_stream->Orphan() explicitly.
+ // stream_op_payload->send_message.send_message.reset() calls Deletor
+ // of call->sending_stream which in-turn invokes the Orphan() method.
+ stream_op_payload->send_message.send_message.reset();
}
if (stream_op->send_trailing_metadata) {
- call->sent_final_op = false;
- grpc_metadata_batch_clear(&call->metadata_batch[0][1]);
+ sent_final_op_ = false;
+ send_trailing_metadata_.Clear();
}
if (stream_op->recv_initial_metadata) {
- call->received_initial_metadata = false;
+ received_initial_metadata_ = false;
}
if (stream_op->recv_message) {
- call->receiving_message = false;
+ receiving_message_ = false;
}
if (stream_op->recv_trailing_metadata) {
- call->requested_final_op = false;
+ requested_final_op_ = false;
}
goto done;
}
+void FilterStackCall::ContextSet(grpc_context_index elem, void* value,
+ void (*destroy)(void*)) {
+ if (context_[elem].destroy) {
+ context_[elem].destroy(context_[elem].value);
+ }
+ context_[elem].value = value;
+ context_[elem].destroy = destroy;
+}
+
+} // namespace grpc_core
+
+void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
+ grpc_core::ExecCtx exec_ctx;
+ return grpc_core::Call::FromC(call)->arena()->Alloc(size);
+}
+
+size_t grpc_call_get_initial_size_estimate() {
+ return grpc_core::FilterStackCall::InitialSizeEstimate();
+}
+
+grpc_error_handle grpc_call_create(grpc_call_create_args* args,
+ grpc_call** out_call) {
+ return grpc_core::FilterStackCall::Create(args, out_call);
+}
+
+void grpc_call_set_completion_queue(grpc_call* call,
+ grpc_completion_queue* cq) {
+ grpc_core::Call::FromC(call)->SetCompletionQueue(cq);
+}
+
+void grpc_call_ref(grpc_call* c) { grpc_core::Call::FromC(c)->ExternalRef(); }
+
+void grpc_call_unref(grpc_call* c) {
+ grpc_core::Call::FromC(c)->ExternalUnref();
+}
+
+char* grpc_call_get_peer(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->GetPeer();
+}
+
+grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element) {
+ return grpc_core::FilterStackCall::FromTopElem(surface_element)->c_ptr();
+}
+
+grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
+ GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
+ GPR_ASSERT(reserved == nullptr);
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Call::FromC(call)->CancelWithError(GRPC_ERROR_CANCELLED);
+ return GRPC_CALL_OK;
+}
+
+grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
+ grpc_status_code status,
+ const char* description,
+ void* reserved) {
+ GRPC_API_TRACE(
+ "grpc_call_cancel_with_status("
+ "c=%p, status=%d, description=%s, reserved=%p)",
+ 4, (c, (int)status, description, reserved));
+ GPR_ASSERT(reserved == nullptr);
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Call::FromC(c)->CancelWithStatus(status, description);
+ return GRPC_CALL_OK;
+}
+
+void grpc_call_cancel_internal(grpc_call* call) {
+ grpc_core::Call::FromC(call)->CancelWithError(GRPC_ERROR_CANCELLED);
+}
+
+grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
+ grpc_call* call) {
+ return grpc_core::Call::FromC(call)->test_only_compression_algorithm();
+}
+
+uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->test_only_message_flags();
+}
+
+uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->test_only_encodings_accepted_by_peer();
+}
+
+grpc_core::Arena* grpc_call_get_arena(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->arena();
+}
+
+grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->call_stack();
+}
+
grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
size_t nops, void* tag, void* reserved) {
- grpc_call_error err;
-
GRPC_API_TRACE(
"grpc_call_start_batch(call=%p, ops=%p, nops=%lu, tag=%p, "
"reserved=%p)",
5, (call, ops, (unsigned long)nops, tag, reserved));
if (reserved != nullptr) {
- err = GRPC_CALL_ERROR;
+ return GRPC_CALL_ERROR;
} else {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- err = call_start_batch(call, ops, nops, tag, 0);
+ return grpc_core::Call::FromC(call)->StartBatch(ops, nops, tag, false);
}
-
- return err;
}
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
const grpc_op* ops,
size_t nops,
grpc_closure* closure) {
- return call_start_batch(call, ops, nops, closure, 1);
+ return grpc_core::Call::FromC(call)->StartBatch(ops, nops, closure, true);
}
void grpc_call_context_set(grpc_call* call, grpc_context_index elem,
void* value, void (*destroy)(void* value)) {
- if (call->context[elem].destroy) {
- call->context[elem].destroy(call->context[elem].value);
- }
- call->context[elem].value = value;
- call->context[elem].destroy = destroy;
+ return grpc_core::Call::FromC(call)->ContextSet(elem, value, destroy);
}
void* grpc_call_context_get(grpc_call* call, grpc_context_index elem) {
- return call->context[elem].value;
+ return grpc_core::Call::FromC(call)->ContextGet(elem);
}
-uint8_t grpc_call_is_client(grpc_call* call) { return call->is_client; }
+uint8_t grpc_call_is_client(grpc_call* call) {
+ return grpc_core::Call::FromC(call)->is_client();
+}
grpc_compression_algorithm grpc_call_compression_for_level(
grpc_call* call, grpc_compression_level level) {
- grpc_compression_algorithm algo =
- compression_algorithm_for_level_locked(call, level);
- return algo;
+ return grpc_core::Call::FromC(call)->compression_for_level(level);
+}
+
+bool grpc_call_is_trailers_only(const grpc_call* call) {
+ return grpc_core::Call::FromC(call)->is_trailers_only();
+}
+
+int grpc_call_failed_before_recv_message(const grpc_call* c) {
+ return grpc_core::Call::FromC(c)->failed_before_recv_message();
}
const char* grpc_call_error_to_string(grpc_call_error error) {
diff --git a/grpc/src/core/lib/surface/call.h b/grpc/src/core/lib/surface/call.h
index a6ad3cae..90e34ee0 100644
--- a/grpc/src/core/lib/surface/call.h
+++ b/grpc/src/core/lib/surface/call.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
+#include <grpc/grpc.h>
+#include <grpc/impl/codegen/compression_types.h>
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
-#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
-#include <grpc/grpc.h>
-#include <grpc/impl/codegen/compression_types.h>
-
typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
void* user_data);
@@ -46,34 +46,20 @@ typedef struct grpc_call_create_args {
const void* server_transport_data;
- grpc_mdelem* add_initial_metadata;
- size_t add_initial_metadata_count;
+ absl::optional<grpc_core::Slice> path;
+ absl::optional<grpc_core::Slice> authority;
- grpc_millis send_deadline;
+ grpc_core::Timestamp send_deadline;
} grpc_call_create_args;
/* Create a new call based on \a args.
Regardless of success or failure, always returns a valid new call into *call
*/
-grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
+grpc_error_handle grpc_call_create(grpc_call_create_args* args,
grpc_call** call);
void grpc_call_set_completion_queue(grpc_call* call, grpc_completion_queue* cq);
-#ifndef NDEBUG
-void grpc_call_internal_ref(grpc_call* call, const char* reason);
-void grpc_call_internal_unref(grpc_call* call, const char* reason);
-#define GRPC_CALL_INTERNAL_REF(call, reason) \
- grpc_call_internal_ref(call, reason)
-#define GRPC_CALL_INTERNAL_UNREF(call, reason) \
- grpc_call_internal_unref(call, reason)
-#else
-void grpc_call_internal_ref(grpc_call* call);
-void grpc_call_internal_unref(grpc_call* call);
-#define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call)
-#define GRPC_CALL_INTERNAL_UNREF(call, reason) grpc_call_internal_unref(call)
-#endif
-
grpc_core::Arena* grpc_call_get_arena(grpc_call* call);
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call);
@@ -120,6 +106,11 @@ size_t grpc_call_get_initial_size_estimate();
grpc_compression_algorithm grpc_call_compression_for_level(
grpc_call* call, grpc_compression_level level);
+/* Did this client call receive a trailers-only response */
+/* TODO(markdroth): This is currently available only to the C++ API.
+ Move to surface API if requested by other languages. */
+bool grpc_call_is_trailers_only(const grpc_call* call);
+
extern grpc_core::TraceFlag grpc_call_error_trace;
extern grpc_core::TraceFlag grpc_compression_trace;
diff --git a/grpc/src/core/lib/surface/call_details.cc b/grpc/src/core/lib/surface/call_details.cc
index 29c184c2..ce73c3a5 100644
--- a/grpc/src/core/lib/surface/call_details.cc
+++ b/grpc/src/core/lib/surface/call_details.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
-#include <string.h>
-
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
diff --git a/grpc/src/core/lib/surface/call_log_batch.cc b/grpc/src/core/lib/surface/call_log_batch.cc
index eac55137..6bc1881a 100644
--- a/grpc/src/core/lib/surface/call_log_batch.cc
+++ b/grpc/src/core/lib/surface/call_log_batch.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/call.h"
-
#include <inttypes.h>
#include <vector>
@@ -29,8 +27,10 @@
#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"
+#include "src/core/lib/surface/call.h"
static void add_metadata(const grpc_metadata* md, size_t count,
std::vector<std::string>* b) {
diff --git a/grpc/src/core/lib/surface/channel.cc b/grpc/src/core/lib/surface/channel.cc
index d3552c87..4dab2827 100644
--- a/grpc/src/core/lib/surface/channel.cc
+++ b/grpc/src/core/lib/surface/channel.cc
@@ -31,21 +31,23 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/channelz_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/surface/channel_stack_type.h"
/** Cache grpc-status: X mdelems for X = 0..NUM_CACHED_STATUS_ELEMS.
* Avoids needing to take a metadata context lock for sending status
@@ -57,22 +59,20 @@
static void destroy_channel(void* arg, grpc_error_handle error);
grpc_channel* grpc_channel_create_with_builder(
- grpc_channel_stack_builder* builder,
+ grpc_core::ChannelStackBuilder* builder,
grpc_channel_stack_type channel_stack_type, grpc_error_handle* error) {
- char* target = gpr_strdup(grpc_channel_stack_builder_get_target(builder));
- grpc_channel_args* args = grpc_channel_args_copy(
- grpc_channel_stack_builder_get_channel_arguments(builder));
- grpc_resource_user* resource_user =
- grpc_channel_stack_builder_get_resource_user(builder);
+ std::string target(builder->target());
+ grpc_channel_args* args = grpc_channel_args_copy(builder->channel_args());
grpc_channel* channel;
if (channel_stack_type == GRPC_SERVER_CHANNEL) {
GRPC_STATS_INC_SERVER_CHANNELS_CREATED();
} else {
GRPC_STATS_INC_CLIENT_CHANNELS_CREATED();
}
- grpc_error_handle builder_error = grpc_channel_stack_builder_finish(
- builder, sizeof(grpc_channel), 1, destroy_channel, nullptr,
- reinterpret_cast<void**>(&channel));
+ std::string name(builder->target());
+ grpc_error_handle builder_error =
+ builder->Build(sizeof(grpc_channel), 1, destroy_channel, nullptr,
+ reinterpret_cast<void**>(&channel));
if (builder_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "channel stack builder failed: %s",
grpc_error_std_string(builder_error).c_str());
@@ -82,14 +82,15 @@ grpc_channel* grpc_channel_create_with_builder(
} else {
GRPC_ERROR_UNREF(builder_error);
}
- gpr_free(target);
grpc_channel_args_destroy(args);
return nullptr;
}
- channel->target = target;
- channel->resource_user = resource_user;
+ channel->target.Init(std::move(target));
channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
channel->registration_table.Init();
+ channel->allocator.Init(grpc_core::ResourceQuotaFromChannelArgs(args)
+ ->memory_quota()
+ ->CreateMemoryOwner(name));
gpr_atm_no_barrier_store(
&channel->call_size_estimate,
@@ -180,13 +181,14 @@ void channelz_node_destroy(void* p) {
static_cast<grpc_core::channelz::ChannelNode*>(p);
node->Unref();
}
-int channelz_node_cmp(void* p1, void* p2) { return GPR_ICMP(p1, p2); }
+int channelz_node_cmp(void* p1, void* p2) {
+ return grpc_core::QsortCompare(p1, p2);
+}
const grpc_arg_pointer_vtable channelz_node_arg_vtable = {
channelz_node_copy, channelz_node_destroy, channelz_node_cmp};
-void CreateChannelzNode(grpc_channel_stack_builder* builder) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
+void CreateChannelzNode(grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* args = builder->channel_args();
// Check whether channelz is enabled.
const bool channelz_enabled = grpc_channel_args_find_bool(
args, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT);
@@ -198,11 +200,10 @@ void CreateChannelzNode(grpc_channel_stack_builder* builder) {
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);
+ std::string target(builder->target());
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);
+ target.c_str(), channel_tracer_max_memory, is_internal_channel);
channelz_node->AddTraceEvent(
grpc_core::channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("Channel created"));
@@ -214,18 +215,16 @@ void CreateChannelzNode(grpc_channel_stack_builder* builder) {
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);
+ builder->SetChannelArgs(new_args);
grpc_channel_args_destroy(new_args);
}
} // namespace
-grpc_channel* grpc_channel_create(const char* target,
- const grpc_channel_args* input_args,
- grpc_channel_stack_type channel_stack_type,
- grpc_transport* optional_transport,
- grpc_resource_user* resource_user,
- grpc_error_handle* error) {
+grpc_channel* grpc_channel_create_internal(
+ const char* target, const grpc_channel_args* input_args,
+ grpc_channel_stack_type channel_stack_type,
+ grpc_transport* optional_transport, grpc_error_handle* error) {
// We need to make sure that grpc_shutdown() does not shut things down
// until after the channel is destroyed. However, the channel may not
// actually be destroyed by the time grpc_channel_destroy() returns,
@@ -243,7 +242,8 @@ grpc_channel* grpc_channel_create(const char* target,
// grpc_shutdown() when the channel is actually destroyed, thus
// ensuring that shutdown is deferred until that point.
grpc_init();
- grpc_channel_stack_builder* builder = grpc_channel_stack_builder_create();
+ grpc_core::ChannelStackBuilderImpl builder(
+ grpc_channel_stack_type_string(channel_stack_type), channel_stack_type);
const grpc_core::UniquePtr<char> default_authority =
get_default_authority(input_args);
grpc_channel_args* args =
@@ -255,26 +255,21 @@ grpc_channel* grpc_channel_create(const char* target,
args = channel_args_mutator(target, args, channel_stack_type);
}
}
- grpc_channel_stack_builder_set_channel_arguments(builder, args);
+ builder.SetChannelArgs(args).SetTarget(target).SetTransport(
+ optional_transport);
grpc_channel_args_destroy(args);
- grpc_channel_stack_builder_set_target(builder, target);
- grpc_channel_stack_builder_set_transport(builder, optional_transport);
- grpc_channel_stack_builder_set_resource_user(builder, resource_user);
- if (!grpc_channel_init_create_stack(builder, channel_stack_type)) {
- grpc_channel_stack_builder_destroy(builder);
- if (resource_user != nullptr) {
- grpc_resource_user_free(resource_user, GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
+ if (!grpc_core::CoreConfiguration::Get().channel_init().CreateStack(
+ &builder)) {
grpc_shutdown(); // Since we won't call destroy_channel().
return nullptr;
}
// We only need to do this for clients here. For servers, this will be
// done in src/core/lib/surface/server.cc.
if (grpc_channel_stack_type_is_client(channel_stack_type)) {
- CreateChannelzNode(builder);
+ CreateChannelzNode(&builder);
}
grpc_channel* channel =
- grpc_channel_create_with_builder(builder, channel_stack_type, error);
+ grpc_channel_create_with_builder(&builder, channel_stack_type, error);
if (channel == nullptr) {
grpc_shutdown(); // Since we won't call destroy_channel().
}
@@ -311,14 +306,14 @@ void grpc_channel_update_call_size_estimate(grpc_channel* channel,
/* size shrank: decrease estimate */
gpr_atm_no_barrier_cas(
&channel->call_size_estimate, static_cast<gpr_atm>(cur),
- static_cast<gpr_atm>(GPR_MIN(cur - 1, (255 * cur + size) / 256)));
+ static_cast<gpr_atm>(std::min(cur - 1, (255 * cur + size) / 256)));
/* if we lose: never mind, something else will likely update soon enough */
}
}
char* grpc_channel_get_target(grpc_channel* channel) {
GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel));
- return gpr_strdup(channel->target);
+ return gpr_strdup(channel->target->c_str());
}
void grpc_channel_get_info(grpc_channel* channel,
@@ -345,19 +340,11 @@ void grpc_channel_reset_connect_backoff(grpc_channel* channel) {
static grpc_call* grpc_channel_create_call_internal(
grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
grpc_completion_queue* cq, grpc_pollset_set* pollset_set_alternative,
- grpc_mdelem path_mdelem, grpc_mdelem authority_mdelem,
- grpc_millis deadline) {
- grpc_mdelem send_metadata[2];
- size_t num_metadata = 0;
-
+ grpc_core::Slice path, absl::optional<grpc_core::Slice> authority,
+ grpc_core::Timestamp deadline) {
GPR_ASSERT(channel->is_client);
GPR_ASSERT(!(cq != nullptr && pollset_set_alternative != nullptr));
- send_metadata[num_metadata++] = path_mdelem;
- if (!GRPC_MDISNULL(authority_mdelem)) {
- send_metadata[num_metadata++] = authority_mdelem;
- }
-
grpc_call_create_args args;
args.channel = channel;
args.server = nullptr;
@@ -366,8 +353,8 @@ static grpc_call* grpc_channel_create_call_internal(
args.cq = cq;
args.pollset_set_alternative = pollset_set_alternative;
args.server_transport_data = nullptr;
- args.add_initial_metadata = send_metadata;
- args.add_initial_metadata_count = num_metadata;
+ args.path = std::move(path);
+ args.authority = std::move(authority);
args.send_deadline = deadline;
grpc_call* call;
@@ -386,10 +373,11 @@ grpc_call* grpc_channel_create_call(grpc_channel* channel,
grpc_core::ExecCtx exec_ctx;
grpc_call* call = grpc_channel_create_call_internal(
channel, parent_call, propagation_mask, completion_queue, nullptr,
- grpc_mdelem_create(GRPC_MDSTR_PATH, method, nullptr),
- host != nullptr ? grpc_mdelem_create(GRPC_MDSTR_AUTHORITY, *host, nullptr)
- : GRPC_MDNULL,
- grpc_timespec_to_millis_round_up(deadline));
+ grpc_core::Slice(grpc_slice_ref_internal(method)),
+ host != nullptr
+ ? absl::optional<grpc_core::Slice>(grpc_slice_ref_internal(*host))
+ : absl::nullopt,
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline));
return call;
}
@@ -397,54 +385,35 @@ grpc_call* grpc_channel_create_call(grpc_channel* channel,
grpc_call* grpc_channel_create_pollset_set_call(
grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
grpc_pollset_set* pollset_set, const grpc_slice& method,
- const grpc_slice* host, grpc_millis deadline, void* reserved) {
+ const grpc_slice* host, grpc_core::Timestamp deadline, void* reserved) {
GPR_ASSERT(!reserved);
return grpc_channel_create_call_internal(
channel, parent_call, propagation_mask, nullptr, pollset_set,
- grpc_mdelem_create(GRPC_MDSTR_PATH, method, nullptr),
- host != nullptr ? grpc_mdelem_create(GRPC_MDSTR_AUTHORITY, *host, nullptr)
- : GRPC_MDNULL,
+ grpc_core::Slice(method),
+ host != nullptr
+ ? absl::optional<grpc_core::Slice>(grpc_slice_ref_internal(*host))
+ : absl::nullopt,
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(const char* method_arg, const char* host_arg) {
+ path = Slice::FromCopiedString(method_arg);
+ if (host_arg != nullptr && host_arg[0] != 0) {
+ authority = Slice::FromCopiedString(host_arg);
+ }
}
-RegisteredCall::~RegisteredCall() {
- GRPC_MDELEM_UNREF(path);
- GRPC_MDELEM_UNREF(authority);
+RegisteredCall::RegisteredCall(const RegisteredCall& other)
+ : path(other.path.Ref()) {
+ if (other.authority.has_value()) {
+ authority = other.authority->Ref();
+ }
}
+RegisteredCall::~RegisteredCall() {}
+
} // namespace grpc_core
void* grpc_channel_register_call(grpc_channel* channel, const char* method,
@@ -491,8 +460,11 @@ grpc_call* grpc_channel_create_registered_call(
grpc_core::ExecCtx exec_ctx;
grpc_call* call = grpc_channel_create_call_internal(
channel, parent_call, propagation_mask, completion_queue, nullptr,
- GRPC_MDELEM_REF(rc->path), GRPC_MDELEM_REF(rc->authority),
- grpc_timespec_to_millis_round_up(deadline));
+ rc->path.Ref(),
+ rc->authority.has_value()
+ ? absl::optional<grpc_core::Slice>(rc->authority->Ref())
+ : absl::nullopt,
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline));
return call;
}
@@ -507,13 +479,10 @@ static void destroy_channel(void* arg, grpc_error_handle /*error*/) {
}
grpc_channel_stack_destroy(CHANNEL_STACK_FROM_CHANNEL(channel));
channel->registration_table.Destroy();
- if (channel->resource_user != nullptr) {
- grpc_resource_user_free(channel->resource_user,
- GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
- gpr_free(channel->target);
+ channel->allocator.Destroy();
+ channel->target.Destroy();
gpr_free(channel);
- // See comment in grpc_channel_create() for why we do this.
+ // See comment in grpc_channel_create_internal() for why we do this.
grpc_shutdown();
}
diff --git a/grpc/src/core/lib/surface/channel.h b/grpc/src/core/lib/surface/channel.h
index 8a14a72d..c079de8e 100644
--- a/grpc/src/core/lib/surface/channel.h
+++ b/grpc/src/core/lib/surface/channel.h
@@ -27,22 +27,23 @@
#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/resource_quota/memory_quota.h"
#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/metadata.h"
-grpc_channel* grpc_channel_create(const char* target,
- const grpc_channel_args* args,
- grpc_channel_stack_type channel_stack_type,
- grpc_transport* optional_transport,
- grpc_resource_user* resource_user = nullptr,
- grpc_error_handle* error = nullptr);
+/// Creates a grpc_channel.
+grpc_channel* grpc_channel_create_internal(
+ const char* target, const grpc_channel_args* args,
+ grpc_channel_stack_type channel_stack_type,
+ grpc_transport* optional_transport, grpc_error_handle* error);
/** The same as grpc_channel_destroy, but doesn't create an ExecCtx, and so
* is safe to use from within core. */
void grpc_channel_destroy_internal(grpc_channel* channel);
+/// Creates a grpc_channel with a builder. See the description of
+/// \a grpc_channel_create for variable definitions.
grpc_channel* grpc_channel_create_with_builder(
- grpc_channel_stack_builder* builder,
+ grpc_core::ChannelStackBuilder* builder,
grpc_channel_stack_type channel_stack_type,
grpc_error_handle* error = nullptr);
@@ -57,7 +58,7 @@ grpc_channel* grpc_channel_create_with_builder(
grpc_call* grpc_channel_create_pollset_set_call(
grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask,
grpc_pollset_set* pollset_set, const grpc_slice& method,
- const grpc_slice* host, grpc_millis deadline, void* reserved);
+ const grpc_slice* host, grpc_core::Timestamp deadline, void* reserved);
/** Get a (borrowed) pointer to this channels underlying channel stack */
grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel);
@@ -71,27 +72,18 @@ 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.
- std::string method;
- std::string host;
-
- grpc_mdelem path;
- grpc_mdelem authority;
+ Slice path;
+ absl::optional<Slice> 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;
+ 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).
@@ -107,7 +99,6 @@ struct grpc_channel {
grpc_compression_options compression_options;
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
@@ -117,8 +108,9 @@ struct grpc_channel {
grpc_core::ManualConstructor<grpc_core::CallRegistrationTable>
registration_table;
grpc_core::RefCountedPtr<grpc_core::channelz::ChannelNode> channelz_node;
+ grpc_core::ManualConstructor<grpc_core::MemoryAllocator> allocator;
- char* target;
+ grpc_core::ManualConstructor<std::string> target;
};
#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack*)((c) + 1))
diff --git a/grpc/src/core/lib/surface/channel_init.cc b/grpc/src/core/lib/surface/channel_init.cc
index 17f6c901..459cbdea 100644
--- a/grpc/src/core/lib/surface/channel_init.cc
+++ b/grpc/src/core/lib/surface/channel_init.cc
@@ -20,90 +20,36 @@
#include "src/core/lib/surface/channel_init.h"
-#include <grpc/support/alloc.h>
+#include <algorithm>
-typedef struct stage_slot {
- grpc_channel_init_stage fn;
- void* arg;
- int priority;
- size_t insertion_order;
-} stage_slot;
+namespace grpc_core {
-typedef struct stage_slots {
- stage_slot* slots;
- size_t num_slots;
- size_t cap_slots;
-} stage_slots;
-
-static stage_slots g_slots[GRPC_NUM_CHANNEL_STACK_TYPES];
-static bool g_finalized;
-
-void grpc_channel_init_init(void) {
- for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- g_slots[i].slots = nullptr;
- g_slots[i].num_slots = 0;
- g_slots[i].cap_slots = 0;
- }
- g_finalized = false;
-}
-
-void grpc_channel_init_register_stage(grpc_channel_stack_type type,
- int priority,
- grpc_channel_init_stage stage,
- void* stage_arg) {
- GPR_ASSERT(!g_finalized);
- if (g_slots[type].cap_slots == g_slots[type].num_slots) {
- g_slots[type].cap_slots = GPR_MAX(8, 3 * g_slots[type].cap_slots / 2);
- g_slots[type].slots = static_cast<stage_slot*>(
- gpr_realloc(g_slots[type].slots,
- g_slots[type].cap_slots * sizeof(*g_slots[type].slots)));
- }
- stage_slot* s = &g_slots[type].slots[g_slots[type].num_slots++];
- s->insertion_order = g_slots[type].num_slots;
- s->priority = priority;
- s->fn = stage;
- s->arg = stage_arg;
-}
-
-static int compare_slots(const void* a, const void* b) {
- const stage_slot* sa = static_cast<const stage_slot*>(a);
- const stage_slot* sb = static_cast<const stage_slot*>(b);
-
- int c = GPR_ICMP(sa->priority, sb->priority);
- if (c != 0) return c;
- return GPR_ICMP(sa->insertion_order, sb->insertion_order);
+void ChannelInit::Builder::RegisterStage(grpc_channel_stack_type type,
+ int priority, Stage stage) {
+ slots_[type].emplace_back(std::move(stage), priority);
}
-void grpc_channel_init_finalize(void) {
- GPR_ASSERT(!g_finalized);
+ChannelInit ChannelInit::Builder::Build() {
+ ChannelInit result;
for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- qsort(g_slots[i].slots, g_slots[i].num_slots, sizeof(*g_slots[i].slots),
- compare_slots);
- }
- g_finalized = true;
-}
-
-void grpc_channel_init_shutdown(void) {
- for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- gpr_free(g_slots[i].slots);
- g_slots[i].slots =
- static_cast<stage_slot*>(reinterpret_cast<void*>(0xdeadbeef));
+ auto& slots = slots_[i];
+ std::stable_sort(
+ slots.begin(), slots.end(),
+ [](const Slot& a, const Slot& b) { return a.priority < b.priority; });
+ auto& result_slots = result.slots_[i];
+ result_slots.reserve(slots.size());
+ for (auto& slot : slots) {
+ result_slots.emplace_back(std::move(slot.stage));
+ }
}
+ return result;
}
-bool grpc_channel_init_create_stack(grpc_channel_stack_builder* builder,
- grpc_channel_stack_type type) {
- GPR_ASSERT(g_finalized);
-
- grpc_channel_stack_builder_set_name(builder,
- grpc_channel_stack_type_string(type));
-
- for (size_t i = 0; i < g_slots[type].num_slots; i++) {
- const stage_slot* slot = &g_slots[type].slots[i];
- if (!slot->fn(builder, slot->arg)) {
- return false;
- }
+bool ChannelInit::CreateStack(ChannelStackBuilder* builder) const {
+ for (const auto& stage : slots_[builder->channel_stack_type()]) {
+ if (!stage(builder)) return false;
}
-
return true;
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/surface/channel_init.h b/grpc/src/core/lib/surface/channel_init.h
index d17a7216..9f4bb6fd 100644
--- a/grpc/src/core/lib/surface/channel_init.h
+++ b/grpc/src/core/lib/surface/channel_init.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
+#include <functional>
+#include <vector>
+
#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/transport.h"
#define GRPC_CHANNEL_INIT_BUILTIN_PRIORITY 10000
@@ -32,47 +33,50 @@
/// It also provides a universal entry path to run those mutators to build
/// a channel stack for various subsystems.
-/// One stage of mutation: call functions against \a builder to influence the
-/// finally constructed channel stack
-typedef bool (*grpc_channel_init_stage)(grpc_channel_stack_builder* builder,
- void* arg);
+namespace grpc_core {
+
+class ChannelInit {
+ public:
+ /// One stage of mutation: call functions against \a builder to influence the
+ /// finally constructed channel stack
+ using Stage = std::function<bool(ChannelStackBuilder* builder)>;
+
+ class Builder {
+ public:
+ /// Register one stage of mutators.
+ /// Stages are run in priority order (lowest to highest), and then in
+ /// registration order (in the case of a tie).
+ /// Stages are registered against one of the pre-determined channel stack
+ /// types.
+ /// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
+ /// ensure that subchannels with different filter lists will always have
+ /// different channel args. This requires setting a channel arg in case the
+ /// registration function relies on some condition other than channel args
+ /// to decide whether to add a filter or not.
+ void RegisterStage(grpc_channel_stack_type type, int priority, Stage stage);
+
+ /// Finalize registration. No more calls to grpc_channel_init_register_stage
+ /// are allowed.
+ ChannelInit Build();
-/// Global initialization of the system
-void grpc_channel_init_init(void);
+ private:
+ struct Slot {
+ Slot(Stage stage, int priority)
+ : stage(std::move(stage)), priority(priority) {}
+ Stage stage;
+ int priority;
+ };
+ std::vector<Slot> slots_[GRPC_NUM_CHANNEL_STACK_TYPES];
+ };
-/// Register one stage of mutators.
-/// Stages are run in priority order (lowest to highest), and then in
-/// registration order (in the case of a tie).
-/// Stages are registered against one of the pre-determined channel stack
-/// types.
-/// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
-/// ensure that subchannels with different filter lists will always have
-/// different channel args. This requires setting a channel arg in case the
-/// registration function relies on some condition other than channel args to
-/// decide whether to add a filter or not.
-void grpc_channel_init_register_stage(grpc_channel_stack_type type,
- int priority,
- grpc_channel_init_stage stage_fn,
- void* stage_arg);
+ /// Construct a channel stack of some sort: see channel_stack.h for details
+ /// \a builder is the channel stack builder to build into.
+ bool CreateStack(ChannelStackBuilder* builder) const;
-/// Finalize registration. No more calls to grpc_channel_init_register_stage are
-/// allowed.
-void grpc_channel_init_finalize(void);
-/// Shutdown the channel init system
-void grpc_channel_init_shutdown(void);
+ private:
+ std::vector<Stage> slots_[GRPC_NUM_CHANNEL_STACK_TYPES];
+};
-/// Construct a channel stack of some sort: see channel_stack.h for details
-/// \a type is the type of channel stack to create
-/// \a prefix_bytes is the number of bytes before the channel stack to allocate
-/// \a args are configuration arguments for the channel stack
-/// \a initial_refs is the initial refcount to give the channel stack
-/// \a destroy and \a destroy_arg specify how to destroy the channel stack
-/// if destroy_arg is NULL, the returned value from this function will be
-/// substituted
-/// \a optional_transport is either NULL or a constructed transport object
-/// Returns a pointer to the base of the memory allocated (the actual channel
-/// stack object will be prefix_bytes past that pointer)
-bool grpc_channel_init_create_stack(grpc_channel_stack_builder* builder,
- grpc_channel_stack_type type);
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H */
diff --git a/grpc/src/core/lib/surface/channel_ping.cc b/grpc/src/core/lib/surface/channel_ping.cc
index a6e53ec4..22c49386 100644
--- a/grpc/src/core/lib/surface/channel_ping.cc
+++ b/grpc/src/core/lib/surface/channel_ping.cc
@@ -18,14 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/channel.h"
-
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
struct ping_result {
diff --git a/grpc/src/core/lib/surface/channel_stack_type.cc b/grpc/src/core/lib/surface/channel_stack_type.cc
index fcf96ddc..ecbc3ef6 100644
--- a/grpc/src/core/lib/surface/channel_stack_type.cc
+++ b/grpc/src/core/lib/surface/channel_stack_type.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
#include "src/core/lib/surface/channel_stack_type.h"
+#include <grpc/support/log.h>
+
bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type) {
switch (type) {
case GRPC_CLIENT_CHANNEL:
diff --git a/grpc/src/core/lib/surface/completion_queue.cc b/grpc/src/core/lib/surface/completion_queue.cc
index 2b889e0d..7170787a 100644
--- a/grpc/src/core/lib/surface/completion_queue.cc
+++ b/grpc/src/core/lib/surface/completion_queue.cc
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
+#include <atomic>
#include <vector>
#include "absl/strings/str_format.h"
@@ -38,7 +39,6 @@
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tls.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/timer.h"
@@ -58,8 +58,8 @@ namespace {
// with a cq cache will go into that cache, and
// will only be returned on the thread that initialized the cache.
// NOTE: Only one event will ever be cached.
-GPR_TLS_DECL(g_cached_event);
-GPR_TLS_DECL(g_cached_cq);
+GPR_THREAD_LOCAL(grpc_cq_completion*) g_cached_event;
+GPR_THREAD_LOCAL(grpc_completion_queue*) g_cached_cq;
struct plucker {
grpc_pollset_worker** worker;
@@ -73,7 +73,7 @@ struct cq_poller_vtable {
grpc_error_handle (*kick)(grpc_pollset* pollset,
grpc_pollset_worker* specific_worker);
grpc_error_handle (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
- grpc_millis deadline);
+ grpc_core::Timestamp deadline);
void (*shutdown)(grpc_pollset* pollset, grpc_closure* closure);
void (*destroy)(grpc_pollset* pollset);
};
@@ -105,7 +105,7 @@ void non_polling_poller_destroy(grpc_pollset* pollset) {
grpc_error_handle non_polling_poller_work(grpc_pollset* pollset,
grpc_pollset_worker** worker,
- grpc_millis deadline) {
+ grpc_core::Timestamp deadline) {
non_polling_poller* npp = reinterpret_cast<non_polling_poller*>(pollset);
if (npp->shutdown) return GRPC_ERROR_NONE;
if (npp->kicked_without_poller) {
@@ -123,8 +123,7 @@ grpc_error_handle non_polling_poller_work(grpc_pollset* pollset,
w.next->prev = w.prev->next = &w;
}
w.kicked = false;
- gpr_timespec deadline_ts =
- grpc_millis_to_timespec(deadline, GPR_CLOCK_MONOTONIC);
+ gpr_timespec deadline_ts = deadline.as_timespec(GPR_CLOCK_MONOTONIC);
while (!npp->shutdown && !w.kicked &&
!gpr_cv_wait(&w.cv, &npp->mu, deadline_ts)) {
}
@@ -197,8 +196,7 @@ const cq_poller_vtable g_poller_vtable_by_poller_type[] = {
struct cq_vtable {
grpc_cq_completion_type cq_completion_type;
size_t data_size;
- void (*init)(void* data,
- grpc_experimental_completion_queue_functor* shutdown_callback);
+ void (*init)(void* data, grpc_completion_queue_functor* shutdown_callback);
void (*shutdown)(grpc_completion_queue* cq);
void (*destroy)(void* data);
bool (*begin_op)(grpc_completion_queue* cq, void* tag);
@@ -225,7 +223,7 @@ class CqEventQueue {
/* Note: The counter is not incremented/decremented atomically with push/pop.
* The count is only eventually consistent */
intptr_t num_items() const {
- return num_queue_items_.Load(grpc_core::MemoryOrder::RELAXED);
+ return num_queue_items_.load(std::memory_order_relaxed);
}
bool Push(grpc_cq_completion* c);
@@ -240,14 +238,14 @@ class CqEventQueue {
/* A lazy counter of number of items in the queue. This is NOT atomically
incremented/decremented along with push/pop operations and hence is only
eventually consistent */
- grpc_core::Atomic<intptr_t> num_queue_items_{0};
+ std::atomic<intptr_t> num_queue_items_{0};
};
struct cq_next_data {
~cq_next_data() {
GPR_ASSERT(queue.num_items() == 0);
#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -258,11 +256,11 @@ struct cq_next_data {
/** Counter of how many things have ever been queued on this completion queue
useful for avoiding locks to check the queue */
- grpc_core::Atomic<intptr_t> things_queued_ever{0};
+ std::atomic<intptr_t> things_queued_ever{0};
/** Number of outstanding events (+1 if not shut down)
Initial count is dropped by grpc_completion_queue_shutdown */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
@@ -278,7 +276,7 @@ struct 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) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -290,17 +288,17 @@ struct cq_pluck_data {
/** Number of pending events (+1 if we're not shutdown).
Initial count is dropped by grpc_completion_queue_shutdown. */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** Counter of how many things have ever been queued on this completion queue
useful for avoiding locks to check the queue */
- grpc_core::Atomic<intptr_t> things_queued_ever{0};
+ std::atomic<intptr_t> things_queued_ever{0};
/** 0 initially. 1 once we completed shutting */
/* TODO: (sreek) This is not needed since (shutdown == 1) if and only if
* (pending_events == 0). So consider removing this in future and use
* pending_events */
- grpc_core::Atomic<bool> shutdown{false};
+ std::atomic<bool> shutdown{false};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
@@ -310,13 +308,12 @@ struct cq_pluck_data {
};
struct cq_callback_data {
- explicit cq_callback_data(
- grpc_experimental_completion_queue_functor* shutdown_callback)
+ explicit cq_callback_data(grpc_completion_queue_functor* shutdown_callback)
: shutdown_callback(shutdown_callback) {}
~cq_callback_data() {
#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -326,13 +323,13 @@ struct cq_callback_data {
/** Number of pending events (+1 if we're not shutdown).
Initial count is dropped by grpc_completion_queue_shutdown. */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
/** A callback that gets invoked when the CQ completes shutdown */
- grpc_experimental_completion_queue_functor* shutdown_callback;
+ grpc_completion_queue_functor* shutdown_callback;
};
} // namespace
@@ -397,12 +394,12 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
gpr_timespec deadline, void* reserved);
// Note that cq_init_next and cq_init_pluck do not use the shutdown_callback
-static void cq_init_next(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
-static void cq_init_pluck(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
-static void cq_init_callback(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
+static void cq_init_next(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
+static void cq_init_pluck(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
+static void cq_init_callback(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
static void cq_destroy_next(void* data);
static void cq_destroy_pluck(void* data);
static void cq_destroy_callback(void* data);
@@ -441,33 +438,27 @@ grpc_core::TraceFlag grpc_cq_pluck_trace(false, "queue_pluck");
static void on_pollset_shutdown_done(void* arg, grpc_error_handle error);
-void grpc_cq_global_init() {
- gpr_tls_init(&g_cached_event);
- gpr_tls_init(&g_cached_cq);
-}
+void grpc_cq_global_init() {}
void grpc_completion_queue_thread_local_cache_init(grpc_completion_queue* cq) {
- if (reinterpret_cast<grpc_completion_queue*>(gpr_tls_get(&g_cached_cq)) ==
- nullptr) {
- gpr_tls_set(&g_cached_event, (intptr_t)0);
- gpr_tls_set(&g_cached_cq, (intptr_t)cq);
+ if (g_cached_cq == nullptr) {
+ g_cached_event = nullptr;
+ g_cached_cq = cq;
}
}
int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
void** tag, int* ok) {
- grpc_cq_completion* storage =
- reinterpret_cast<grpc_cq_completion*>(gpr_tls_get(&g_cached_event));
+ grpc_cq_completion* storage = g_cached_event;
int ret = 0;
- if (storage != nullptr && reinterpret_cast<grpc_completion_queue*>(
- gpr_tls_get(&g_cached_cq)) == cq) {
+ if (storage != nullptr && g_cached_cq == cq) {
*tag = storage->tag;
grpc_core::ExecCtx exec_ctx;
*ok = (storage->next & static_cast<uintptr_t>(1)) == 1;
storage->done(storage->done_arg, storage);
ret = 1;
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
@@ -475,8 +466,8 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
GRPC_CQ_INTERNAL_UNREF(cq, "shutting_down");
}
}
- gpr_tls_set(&g_cached_event, (intptr_t)0);
- gpr_tls_set(&g_cached_cq, (intptr_t)0);
+ g_cached_event = nullptr;
+ g_cached_cq = nullptr;
return ret;
}
@@ -484,7 +475,7 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
bool CqEventQueue::Push(grpc_cq_completion* c) {
queue_.Push(
reinterpret_cast<grpc_core::MultiProducerSingleConsumerQueue::Node*>(c));
- return num_queue_items_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED) == 0;
+ return num_queue_items_.fetch_add(1, std::memory_order_relaxed) == 0;
}
grpc_cq_completion* CqEventQueue::Pop() {
@@ -505,7 +496,7 @@ grpc_cq_completion* CqEventQueue::Pop() {
}
if (c) {
- num_queue_items_.FetchSub(1, grpc_core::MemoryOrder::RELAXED);
+ num_queue_items_.fetch_sub(1, std::memory_order_relaxed);
}
return c;
@@ -513,7 +504,7 @@ grpc_cq_completion* CqEventQueue::Pop() {
grpc_completion_queue* grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_callback) {
+ grpc_completion_queue_functor* shutdown_callback) {
GPR_TIMER_SCOPE("grpc_completion_queue_create_internal", 0);
grpc_completion_queue* cq;
@@ -548,9 +539,8 @@ grpc_completion_queue* grpc_completion_queue_create_internal(
return cq;
}
-static void cq_init_next(
- void* data,
- grpc_experimental_completion_queue_functor* /*shutdown_callback*/) {
+static void cq_init_next(void* data,
+ grpc_completion_queue_functor* /*shutdown_callback*/) {
new (data) cq_next_data();
}
@@ -560,8 +550,7 @@ static void cq_destroy_next(void* data) {
}
static void cq_init_pluck(
- void* data,
- grpc_experimental_completion_queue_functor* /*shutdown_callback*/) {
+ void* data, grpc_completion_queue_functor* /*shutdown_callback*/) {
new (data) cq_pluck_data();
}
@@ -570,8 +559,8 @@ static void cq_destroy_pluck(void* data) {
cqd->~cq_pluck_data();
}
-static void cq_init_callback(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback) {
+static void cq_init_callback(void* data,
+ grpc_completion_queue_functor* shutdown_callback) {
new (data) cq_callback_data(shutdown_callback);
}
@@ -638,8 +627,8 @@ static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) {
for (int i = 0; i < static_cast<int>(cq->outstanding_tag_count); i++) {
if (cq->outstanding_tags[i] == tag) {
cq->outstanding_tag_count--;
- GPR_SWAP(void*, cq->outstanding_tags[i],
- cq->outstanding_tags[cq->outstanding_tag_count]);
+ std::swap(cq->outstanding_tags[i],
+ cq->outstanding_tags[cq->outstanding_tag_count]);
found = 1;
break;
}
@@ -658,24 +647,25 @@ static void cq_check_tag(grpc_completion_queue* /*cq*/, void* /*tag*/,
static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* /*tag*/) {
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* /*tag*/) {
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
static bool cq_begin_op_for_callback(grpc_completion_queue* cq, void* /*tag*/) {
cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) {
#ifndef NDEBUG
gpr_mu_lock(cq->mu);
if (cq->outstanding_tag_count == cq->outstanding_tag_capacity) {
- cq->outstanding_tag_capacity = GPR_MAX(4, 2 * cq->outstanding_tag_capacity);
+ cq->outstanding_tag_capacity =
+ std::max(size_t(4), 2 * cq->outstanding_tag_capacity);
cq->outstanding_tags = static_cast<void**>(gpr_realloc(
cq->outstanding_tags,
sizeof(*cq->outstanding_tags) * cq->outstanding_tag_capacity));
@@ -719,21 +709,18 @@ static void cq_end_op_for_next(
cq_check_tag(cq, tag, true); /* Used in debug builds only */
- if (reinterpret_cast<grpc_completion_queue*>(gpr_tls_get(&g_cached_cq)) ==
- cq &&
- reinterpret_cast<grpc_cq_completion*>(gpr_tls_get(&g_cached_event)) ==
- nullptr) {
- gpr_tls_set(&g_cached_event, (intptr_t)storage);
+ if (g_cached_cq == cq && g_cached_event == nullptr) {
+ g_cached_event = storage;
} else {
/* Add the completion to the queue */
bool is_first = cqd->queue.Push(storage);
- cqd->things_queued_ever.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed);
/* Since we do not hold the cq lock here, it is important to do an 'acquire'
load here (instead of a 'no_barrier' load) to match with the release
store
- (done via pending_events.FetchSub(1, ACQ_REL)) in cq_shutdown_next
+ (done via pending_events.fetch_sub(1, ACQ_REL)) in cq_shutdown_next
*/
- if (cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 1) {
+ if (cqd->pending_events.load(std::memory_order_acquire) != 1) {
/* Only kick if this is the first item queued */
if (is_first) {
gpr_mu_lock(cq->mu);
@@ -747,8 +734,7 @@ static void cq_end_op_for_next(
GRPC_ERROR_UNREF(kick_error);
}
}
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) ==
- 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
@@ -757,7 +743,7 @@ static void cq_end_op_for_next(
}
} else {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
- cqd->pending_events.Store(0, grpc_core::MemoryOrder::RELEASE);
+ cqd->pending_events.store(0, std::memory_order_release);
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
gpr_mu_unlock(cq->mu);
@@ -805,12 +791,12 @@ static void cq_end_op_for_pluck(
cq_check_tag(cq, tag, false); /* Used in debug builds only */
/* Add to the list of completions */
- cqd->things_queued_ever.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed);
cqd->completed_tail->next =
reinterpret_cast<uintptr_t>(storage) | (1u & cqd->completed_tail->next);
cqd->completed_tail = storage;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_pluck(cq);
gpr_mu_unlock(cq->mu);
} else {
@@ -836,7 +822,7 @@ static void cq_end_op_for_pluck(
}
static void functor_callback(void* arg, grpc_error_handle error) {
- auto* functor = static_cast<grpc_experimental_completion_queue_functor*>(arg);
+ auto* functor = static_cast<grpc_completion_queue_functor*>(arg);
functor->functor_run(functor, error == GRPC_ERROR_NONE);
}
@@ -870,7 +856,7 @@ static void cq_end_op_for_callback(
cq_check_tag(cq, tag, true); /* Used in debug builds only */
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_callback(cq);
}
@@ -880,7 +866,7 @@ static void cq_end_op_for_callback(
// 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);
+ auto* functor = static_cast<grpc_completion_queue_functor*>(tag);
if (((internal || functor->inlineable) &&
grpc_core::ApplicationCallbackExecCtx::Available()) ||
grpc_iomgr_is_any_background_poller_thread()) {
@@ -907,7 +893,7 @@ void grpc_cq_end_op(grpc_completion_queue* cq, void* tag,
struct cq_is_finished_arg {
gpr_atm last_seen_things_queued_ever;
grpc_completion_queue* cq;
- grpc_millis deadline;
+ grpc_core::Timestamp deadline;
grpc_cq_completion* stolen_completion;
void* tag; /* for pluck */
bool first_loop;
@@ -925,12 +911,12 @@ class ExecCtxNext : public grpc_core::ExecCtx {
GPR_ASSERT(a->stolen_completion == nullptr);
intptr_t current_last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
if (current_last_seen_things_queued_ever !=
a->last_seen_things_queued_ever) {
a->last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
/* Pop a cq_completion from the queue. Returns NULL if the queue is empty
* might return NULL in some cases even if the queue is not empty; but
@@ -987,9 +973,10 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
GRPC_CQ_INTERNAL_REF(cq, "next");
- grpc_millis deadline_millis = grpc_timespec_to_millis_round_up(deadline);
+ grpc_core::Timestamp deadline_millis =
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline);
cq_is_finished_arg is_finished_arg = {
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED),
+ cqd->things_queued_ever.load(std::memory_order_relaxed),
cq,
deadline_millis,
nullptr,
@@ -997,7 +984,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
true};
ExecCtxNext exec_ctx(&is_finished_arg);
for (;;) {
- grpc_millis iteration_deadline = deadline_millis;
+ grpc_core::Timestamp iteration_deadline = deadline_millis;
if (is_finished_arg.stolen_completion != nullptr) {
grpc_cq_completion* c = is_finished_arg.stolen_completion;
@@ -1024,11 +1011,11 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
attempt at popping. Not doing this can potentially deadlock this
thread forever (if the deadline is infinity) */
if (cqd->queue.num_items() > 0) {
- iteration_deadline = 0;
+ iteration_deadline = grpc_core::Timestamp::ProcessEpoch();
}
}
- if (cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) == 0) {
+ if (cqd->pending_events.load(std::memory_order_acquire) == 0) {
/* Before returning, check if the queue has any items left over (since
MultiProducerSingleConsumerQueue::Pop() can sometimes return NULL
even if the queue is not empty. If so, keep retrying but do not
@@ -1065,7 +1052,11 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
gpr_log(GPR_ERROR, "Completion queue next failed: %s",
grpc_error_std_string(err).c_str());
GRPC_ERROR_UNREF(err);
- ret.type = GRPC_QUEUE_TIMEOUT;
+ if (err == GRPC_ERROR_CANCELLED) {
+ ret.type = GRPC_QUEUE_SHUTDOWN;
+ } else {
+ ret.type = GRPC_QUEUE_TIMEOUT;
+ }
ret.success = 0;
dump_pending_tags(cq);
break;
@@ -1074,9 +1065,9 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
}
if (cqd->queue.num_items() > 0 &&
- cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) {
+ cqd->pending_events.load(std::memory_order_acquire) > 0) {
gpr_mu_lock(cq->mu);
- cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), nullptr);
+ (void)cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), nullptr);
gpr_mu_unlock(cq->mu);
}
@@ -1098,7 +1089,7 @@ static void cq_finish_shutdown_next(grpc_completion_queue* cq) {
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
GPR_ASSERT(cqd->shutdown_called);
- GPR_ASSERT(cqd->pending_events.Load(grpc_core::MemoryOrder::RELAXED) == 0);
+ GPR_ASSERT(cqd->pending_events.load(std::memory_order_relaxed) == 0);
cq->poller_vtable->shutdown(POLLSET_FROM_CQ(cq), &cq->pollset_shutdown_done);
}
@@ -1120,10 +1111,10 @@ static void cq_shutdown_next(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- /* Doing acq/release FetchSub here to match with
+ /* Doing acq/release fetch_sub here to match with
* cq_begin_op_for_next and cq_end_op_for_next functions which read/write
* on this counter without necessarily holding a lock on cq */
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_next(cq);
}
gpr_mu_unlock(cq->mu);
@@ -1153,7 +1144,7 @@ static void del_plucker(grpc_completion_queue* cq, void* tag,
for (int i = 0; i < cqd->num_pluckers; i++) {
if (cqd->pluckers[i].tag == tag && cqd->pluckers[i].worker == worker) {
cqd->num_pluckers--;
- GPR_SWAP(plucker, cqd->pluckers[i], cqd->pluckers[cqd->num_pluckers]);
+ std::swap(cqd->pluckers[i], cqd->pluckers[cqd->num_pluckers]);
return;
}
}
@@ -1173,12 +1164,12 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
GPR_ASSERT(a->stolen_completion == nullptr);
gpr_atm current_last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
if (current_last_seen_things_queued_ever !=
a->last_seen_things_queued_ever) {
gpr_mu_lock(cq->mu);
a->last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
grpc_cq_completion* c;
grpc_cq_completion* prev = &cqd->completed_head;
while ((c = reinterpret_cast<grpc_cq_completion*>(
@@ -1232,9 +1223,10 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
GRPC_CQ_INTERNAL_REF(cq, "pluck");
gpr_mu_lock(cq->mu);
- grpc_millis deadline_millis = grpc_timespec_to_millis_round_up(deadline);
+ grpc_core::Timestamp deadline_millis =
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline);
cq_is_finished_arg is_finished_arg = {
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED),
+ cqd->things_queued_ever.load(std::memory_order_relaxed),
cq,
deadline_millis,
nullptr,
@@ -1271,7 +1263,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
}
prev = c;
}
- if (cqd->shutdown.Load(grpc_core::MemoryOrder::RELAXED)) {
+ if (cqd->shutdown.load(std::memory_order_relaxed)) {
gpr_mu_unlock(cq->mu);
ret.type = GRPC_QUEUE_SHUTDOWN;
ret.success = 0;
@@ -1333,8 +1325,8 @@ static void cq_finish_shutdown_pluck(grpc_completion_queue* cq) {
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
GPR_ASSERT(cqd->shutdown_called);
- GPR_ASSERT(!cqd->shutdown.Load(grpc_core::MemoryOrder::RELAXED));
- cqd->shutdown.Store(true, grpc_core::MemoryOrder::RELAXED);
+ GPR_ASSERT(!cqd->shutdown.load(std::memory_order_relaxed));
+ cqd->shutdown.store(true, std::memory_order_relaxed);
cq->poller_vtable->shutdown(POLLSET_FROM_CQ(cq), &cq->pollset_shutdown_done);
}
@@ -1358,7 +1350,7 @@ static void cq_shutdown_pluck(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_pluck(cq);
}
gpr_mu_unlock(cq->mu);
@@ -1401,7 +1393,7 @@ static void cq_shutdown_callback(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
gpr_mu_unlock(cq->mu);
cq_finish_shutdown_callback(cq);
} else {
diff --git a/grpc/src/core/lib/surface/completion_queue.h b/grpc/src/core/lib/surface/completion_queue.h
index 2bf91faf..b2cf19e8 100644
--- a/grpc/src/core/lib/surface/completion_queue.h
+++ b/grpc/src/core/lib/surface/completion_queue.h
@@ -93,6 +93,6 @@ int grpc_get_cq_poll_num(grpc_completion_queue* cq);
grpc_completion_queue* grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_callback);
+ grpc_completion_queue_functor* shutdown_callback);
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */
diff --git a/grpc/src/core/lib/surface/completion_queue_factory.cc b/grpc/src/core/lib/surface/completion_queue_factory.cc
index 72aa03ad..80aaba24 100644
--- a/grpc/src/core/lib/surface/completion_queue_factory.cc
+++ b/grpc/src/core/lib/surface/completion_queue_factory.cc
@@ -18,11 +18,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/completion_queue_factory.h"
#include <grpc/support/log.h>
+#include "src/core/lib/surface/completion_queue.h"
+
/*
* == Default completion queue factory implementation ==
*/
@@ -72,8 +73,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
}
grpc_completion_queue* grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
- void* reserved) {
+ grpc_completion_queue_functor* shutdown_callback, void* reserved) {
GPR_ASSERT(!reserved);
grpc_completion_queue_attributes attr = {
2, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING, shutdown_callback};
diff --git a/grpc/src/core/lib/surface/completion_queue_factory.h b/grpc/src/core/lib/surface/completion_queue_factory.h
index d2b30a9c..b1b13722 100644
--- a/grpc/src/core/lib/surface/completion_queue_factory.h
+++ b/grpc/src/core/lib/surface/completion_queue_factory.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/surface/completion_queue.h"
typedef struct grpc_completion_queue_factory_vtable {
diff --git a/grpc/src/core/lib/surface/event_string.cc b/grpc/src/core/lib/surface/event_string.cc
index 32d85f7b..da40734a 100644
--- a/grpc/src/core/lib/surface/event_string.cc
+++ b/grpc/src/core/lib/surface/event_string.cc
@@ -29,6 +29,7 @@
#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<std::string>* buf) {
diff --git a/grpc/src/core/lib/surface/init.cc b/grpc/src/core/lib/surface/init.cc
index 41866f12..f28fe575 100644
--- a/grpc/src/core/lib/surface/init.cc
+++ b/grpc/src/core/lib/surface/init.cc
@@ -22,6 +22,7 @@
#include <limits.h>
#include <memory.h>
+#include <string.h>
#include <grpc/fork.h>
#include <grpc/grpc.h>
@@ -30,26 +31,33 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/sync.h"
-#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/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resource_quota.h"
#include "src/core/lib/iomgr/timer_manager.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/security/authorization/grpc_server_authz_filter.h"
+#include "src/core/lib/security/context/security_context.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/plugin/plugin_credentials.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
+#include "src/core/lib/security/transport/auth_filters.h"
+#include "src/core/lib/security/transport/secure_endpoint.h"
+#include "src/core/lib/security/transport/security_handshaker.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/builtins.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/surface/server.h"
@@ -64,48 +72,83 @@ extern void grpc_register_built_in_plugins(void);
static gpr_once g_basic_init = GPR_ONCE_INIT;
static grpc_core::Mutex* g_init_mu;
-static int g_initializations;
+static int g_initializations ABSL_GUARDED_BY(g_init_mu) = []() {
+ grpc_core::CoreConfiguration::SetDefaultBuilder(
+ grpc_core::BuildCoreConfiguration);
+ return 0;
+}();
static grpc_core::CondVar* g_shutting_down_cv;
-static bool g_shutting_down;
+static bool g_shutting_down ABSL_GUARDED_BY(g_init_mu) = false;
+
+static bool maybe_prepend_client_auth_filter(
+ grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* args = builder->channel_args();
+ if (args) {
+ for (size_t i = 0; i < args->num_args; i++) {
+ if (0 == strcmp(GRPC_ARG_SECURITY_CONNECTOR, args->args[i].key)) {
+ builder->PrependFilter(&grpc_core::ClientAuthFilter::kFilter, nullptr);
+ break;
+ }
+ }
+ }
+ return true;
+}
+
+static bool maybe_prepend_server_auth_filter(
+ grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* args = builder->channel_args();
+ if (args) {
+ for (size_t i = 0; i < args->num_args; i++) {
+ if (0 == strcmp(GRPC_SERVER_CREDENTIALS_ARG, args->args[i].key)) {
+ builder->PrependFilter(&grpc_server_auth_filter, nullptr);
+ break;
+ }
+ }
+ }
+ return true;
+}
+
+static bool maybe_prepend_grpc_server_authz_filter(
+ grpc_core::ChannelStackBuilder* builder) {
+ const grpc_channel_args* args = builder->channel_args();
+ const auto* provider =
+ grpc_channel_args_find_pointer<grpc_authorization_policy_provider>(
+ args, GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER);
+ if (provider != nullptr) {
+ builder->PrependFilter(&grpc_core::GrpcServerAuthzFilter::kFilterVtable,
+ nullptr);
+ }
+ return true;
+}
+
+namespace grpc_core {
+void RegisterSecurityFilters(CoreConfiguration::Builder* builder) {
+ // Register the auth client with a priority < INT_MAX to allow the authority
+ // filter -on which the auth filter depends- to be higher on the channel
+ // stack.
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL, INT_MAX - 1,
+ maybe_prepend_client_auth_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ INT_MAX - 1,
+ maybe_prepend_client_auth_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL, INT_MAX - 1,
+ maybe_prepend_server_auth_filter);
+ // Register the GrpcServerAuthzFilter with a priority less than
+ // server_auth_filter to allow server_auth_filter on which the grpc filter
+ // depends on to be higher on the channel stack.
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX - 2, maybe_prepend_grpc_server_authz_filter);
+}
+} // namespace grpc_core
static void do_basic_init(void) {
gpr_log_verbosity_init();
g_init_mu = new grpc_core::Mutex();
g_shutting_down_cv = new grpc_core::CondVar();
- g_shutting_down = false;
grpc_register_built_in_plugins();
grpc_cq_global_init();
grpc_core::grpc_executor_global_init();
gpr_time_init();
- g_initializations = 0;
-}
-
-static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_append_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
-
-static bool prepend_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
-
-static void register_builtin_channel_init() {
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_LAME_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- append_filter, const_cast<grpc_channel_filter*>(&grpc_lame_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, INT_MAX, prepend_filter,
- const_cast<grpc_channel_filter*>(&grpc_core::Server::kServerTopFilter));
}
typedef struct grpc_plugin {
@@ -126,7 +169,6 @@ void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) {
}
void grpc_init(void) {
- int i;
gpr_once_init(&g_basic_init, do_basic_init);
grpc_core::MutexLock lock(g_init_mu);
@@ -138,44 +180,30 @@ void grpc_init(void) {
grpc_core::Fork::GlobalInit();
grpc_fork_handlers_auto_register();
grpc_stats_init();
- grpc_init_static_metadata_ctx();
- grpc_slice_intern_init();
- grpc_mdctx_global_init();
- grpc_channel_init_init();
grpc_core::channelz::ChannelzRegistry::Init();
- grpc_security_pre_init();
grpc_core::ApplicationCallbackExecCtx::GlobalInit();
- grpc_core::ExecCtx::GlobalInit();
grpc_iomgr_init();
gpr_timers_global_init();
- grpc_core::HandshakerRegistry::Init();
- grpc_security_init();
- for (i = 0; i < g_number_of_plugins; i++) {
+ for (int i = 0; i < g_number_of_plugins; i++) {
if (g_all_of_the_plugins[i].init != nullptr) {
g_all_of_the_plugins[i].init();
}
}
- /* register channel finalization AFTER all plugins, to ensure that it's run
- * at the appropriate time */
- grpc_register_security_filters();
- register_builtin_channel_init();
grpc_tracer_init();
- /* no more changes to channel init pipelines */
- grpc_channel_init_finalize();
grpc_iomgr_start();
}
GRPC_API_TRACE("grpc_init(void)", 0, ());
}
-void grpc_shutdown_internal_locked(void) {
+void grpc_shutdown_internal_locked(void)
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(g_init_mu) {
int i;
{
grpc_core::ExecCtx exec_ctx(0);
grpc_iomgr_shutdown_background_closure();
{
grpc_timer_manager_set_threading(false); // shutdown timer_manager thread
- grpc_core::Executor::ShutdownAll();
for (i = g_number_of_plugins; i >= 0; i--) {
if (g_all_of_the_plugins[i].destroy != nullptr) {
g_all_of_the_plugins[i].destroy();
@@ -185,19 +213,13 @@ void grpc_shutdown_internal_locked(void) {
grpc_iomgr_shutdown();
gpr_timers_global_destroy();
grpc_tracer_shutdown();
- grpc_mdctx_global_shutdown();
- grpc_core::HandshakerRegistry::Shutdown();
- grpc_slice_intern_shutdown();
grpc_core::channelz::ChannelzRegistry::Shutdown();
grpc_stats_shutdown();
grpc_core::Fork::GlobalShutdown();
}
- grpc_core::ExecCtx::GlobalShutdown();
grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
g_shutting_down = false;
g_shutting_down_cv->SignalAll();
- // Absolute last action will be to delete static metadata context.
- grpc_destroy_static_metadata_ctx();
}
void grpc_shutdown_internal(void* /*ignored*/) {
diff --git a/grpc/src/core/lib/surface/init.h b/grpc/src/core/lib/surface/init.h
index 6eaa488d..092c892e 100644
--- a/grpc/src/core/lib/surface/init.h
+++ b/grpc/src/core/lib/surface/init.h
@@ -15,13 +15,19 @@
* limitations under the License.
*
*/
-
#ifndef GRPC_CORE_LIB_SURFACE_INIT_H
#define GRPC_CORE_LIB_SURFACE_INIT_H
-void grpc_register_security_filters(void);
-void grpc_security_pre_init(void);
-void grpc_security_init(void);
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+namespace grpc_event_engine {
+namespace experimental {
+class EventEngine;
+}
+} // namespace grpc_event_engine
+
void grpc_maybe_wait_for_async_shutdown(void);
#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */
diff --git a/grpc/src/core/lib/surface/init_secure.cc b/grpc/src/core/lib/surface/init_secure.cc
deleted file mode 100644
index 428c5815..00000000
--- a/grpc/src/core/lib/surface/init_secure.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * 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/lib/surface/init.h"
-
-#include <limits.h>
-#include <string.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/security/context/security_context.h"
-#include "src/core/lib/security/credentials/credentials.h"
-#include "src/core/lib/security/credentials/plugin/plugin_credentials.h"
-#include "src/core/lib/security/security_connector/security_connector.h"
-#include "src/core/lib/security/transport/auth_filters.h"
-#include "src/core/lib/security/transport/secure_endpoint.h"
-#include "src/core/lib/security/transport/security_handshaker.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/tsi/transport_security_interface.h"
-
-void grpc_security_pre_init(void) {}
-
-static bool maybe_prepend_client_auth_filter(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (args) {
- for (size_t i = 0; i < args->num_args; i++) {
- if (0 == strcmp(GRPC_ARG_SECURITY_CONNECTOR, args->args[i].key)) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_client_auth_filter, nullptr, nullptr);
- }
- }
- }
- return true;
-}
-
-static bool maybe_prepend_server_auth_filter(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (args) {
- for (size_t i = 0; i < args->num_args; i++) {
- if (0 == strcmp(GRPC_SERVER_CREDENTIALS_ARG, args->args[i].key)) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_server_auth_filter, nullptr, nullptr);
- }
- }
- }
- return true;
-}
-
-void grpc_register_security_filters(void) {
- // Register the auth client with a priority < INT_MAX to allow the authority
- // filter -on which the auth filter depends- to be higher on the channel
- // stack.
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX - 1,
- maybe_prepend_client_auth_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX - 1,
- maybe_prepend_client_auth_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX - 1,
- maybe_prepend_server_auth_filter, nullptr);
-}
-
-void grpc_security_init() { grpc_core::SecurityRegisterHandshakerFactories(); }
diff --git a/grpc/src/core/lib/surface/init_unsecure.cc b/grpc/src/core/lib/surface/init_unsecure.cc
deleted file mode 100644
index 7b86d50d..00000000
--- a/grpc/src/core/lib/surface/init_unsecure.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * 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 <grpc/support/log.h>
-
-#include "src/core/lib/surface/init.h"
-
-void grpc_security_pre_init(void) {}
-
-void grpc_register_security_filters(void) {}
-
-void grpc_security_init(void) {
- gpr_log(GPR_DEBUG,
- "Using insecure gRPC build. Security handshakers will not be invoked "
- "even if secure credentials are used.");
-}
diff --git a/grpc/src/core/lib/surface/lame_client.cc b/grpc/src/core/lib/surface/lame_client.cc
index 65e659ac..35f7eba8 100644
--- a/grpc/src/core/lib/surface/lame_client.cc
+++ b/grpc/src/core/lib/surface/lame_client.cc
@@ -18,22 +18,23 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
+#include "src/core/lib/surface/lame_client.h"
#include <string.h>
+#include <atomic>
+
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/transport/connectivity_state.h"
-#include "src/core/lib/transport/static_metadata.h"
#define GRPC_ARG_LAME_FILTER_ERROR "grpc.lame_filter_error"
@@ -44,9 +45,9 @@ namespace {
struct ChannelData {
explicit ChannelData(grpc_channel_element_args* args)
: state_tracker("lame_channel", GRPC_CHANNEL_SHUTDOWN) {
- grpc_error_handle err = grpc_channel_args_find_pointer<grpc_error>(
+ grpc_error_handle* err = grpc_channel_args_find_pointer<grpc_error_handle>(
args->channel_args, GRPC_ARG_LAME_FILTER_ERROR);
- if (err != nullptr) error = GRPC_ERROR_REF(err);
+ if (err != nullptr) error = GRPC_ERROR_REF(*err);
}
~ChannelData() { GRPC_ERROR_UNREF(error); }
@@ -60,19 +61,19 @@ struct CallData {
CallCombiner* call_combiner;
};
-static void lame_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
+void lame_start_transport_stream_op_batch(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op) {
CallData* calld = static_cast<CallData*>(elem->call_data);
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
grpc_transport_stream_op_batch_finish_with_failure(
op, GRPC_ERROR_REF(chand->error), calld->call_combiner);
}
-static void lame_get_channel_info(grpc_channel_element* /*elem*/,
- const grpc_channel_info* /*channel_info*/) {}
+void lame_get_channel_info(grpc_channel_element* /*elem*/,
+ const grpc_channel_info* /*channel_info*/) {}
-static void lame_start_transport_op(grpc_channel_element* elem,
- grpc_transport_op* op) {
+void lame_start_transport_op(grpc_channel_element* elem,
+ grpc_transport_op* op) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
{
MutexLock lock(&chand->mu);
@@ -98,46 +99,54 @@ static void lame_start_transport_op(grpc_channel_element* elem,
}
}
-static grpc_error_handle lame_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* args) {
+grpc_error_handle lame_init_call_elem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
CallData* calld = static_cast<CallData*>(elem->call_data);
calld->call_combiner = args->call_combiner;
return GRPC_ERROR_NONE;
}
-static void lame_destroy_call_elem(grpc_call_element* /*elem*/,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* then_schedule_closure) {
+void lame_destroy_call_elem(grpc_call_element* /*elem*/,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* then_schedule_closure) {
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
}
-static grpc_error_handle lame_init_channel_elem(
- grpc_channel_element* elem, grpc_channel_element_args* args) {
+grpc_error_handle lame_init_channel_elem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
}
-static void lame_destroy_channel_elem(grpc_channel_element* elem) {
+void lame_destroy_channel_elem(grpc_channel_element* elem) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
chand->~ChannelData();
}
// Channel arg vtable for a grpc_error_handle.
void* ErrorCopy(void* p) {
- grpc_error_handle error = static_cast<grpc_error_handle>(p);
- return GRPC_ERROR_REF(error);
+ grpc_error_handle* new_error = nullptr;
+ if (p != nullptr) {
+ grpc_error_handle* error = static_cast<grpc_error_handle*>(p);
+ new_error = new grpc_error_handle();
+ *new_error = GRPC_ERROR_REF(*error);
+ }
+ return new_error;
}
void ErrorDestroy(void* p) {
- grpc_error_handle error = static_cast<grpc_error_handle>(p);
- GRPC_ERROR_UNREF(error);
+ if (p != nullptr) {
+ grpc_error_handle* error = static_cast<grpc_error_handle*>(p);
+ GRPC_ERROR_UNREF(*error);
+ delete error;
+ }
}
-int ErrorCompare(void* p, void* q) { return GPR_ICMP(p, q); }
+int ErrorCompare(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kLameFilterErrorArgVtable = {
ErrorCopy, ErrorDestroy, ErrorCompare};
} // namespace
-grpc_arg MakeLameClientErrorArg(grpc_error_handle error) {
+grpc_arg MakeLameClientErrorArg(grpc_error_handle* error) {
return grpc_channel_arg_pointer_create(
const_cast<char*>(GRPC_ARG_LAME_FILTER_ERROR), error,
&kLameFilterErrorArgVtable);
@@ -147,6 +156,7 @@ grpc_arg MakeLameClientErrorArg(grpc_error_handle error) {
const grpc_channel_filter grpc_lame_filter = {
grpc_core::lame_start_transport_stream_op_batch,
+ nullptr,
grpc_core::lame_start_transport_op,
sizeof(grpc_core::CallData),
grpc_core::lame_init_call_elem,
@@ -173,12 +183,17 @@ grpc_channel* grpc_lame_client_channel_create(const char* target,
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("lame client channel"),
GRPC_ERROR_INT_GRPC_STATUS, error_code),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_static_string(error_message));
- grpc_arg error_arg = grpc_core::MakeLameClientErrorArg(error);
- grpc_channel_args args = {1, &error_arg};
- grpc_channel* channel =
- grpc_channel_create(target, &args, GRPC_CLIENT_LAME_CHANNEL, nullptr);
+ GRPC_ERROR_STR_GRPC_MESSAGE, error_message);
+ grpc_arg error_arg = grpc_core::MakeLameClientErrorArg(&error);
+ grpc_channel_args* args0 =
+ grpc_channel_args_copy_and_add(nullptr, &error_arg, 1);
+ const grpc_channel_args* args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args0);
+ grpc_channel_args_destroy(args0);
+ grpc_channel* channel = grpc_channel_create_internal(
+ target, args, GRPC_CLIENT_LAME_CHANNEL, nullptr, nullptr);
+ grpc_channel_args_destroy(args);
GRPC_ERROR_UNREF(error);
return channel;
}
diff --git a/grpc/src/core/lib/surface/lame_client.h b/grpc/src/core/lib/surface/lame_client.h
index 41759cbb..6c9d1459 100644
--- a/grpc/src/core/lib/surface/lame_client.h
+++ b/grpc/src/core/lib/surface/lame_client.h
@@ -25,7 +25,7 @@
namespace grpc_core {
// Does NOT take ownership of error.
-grpc_arg MakeLameClientErrorArg(grpc_error_handle error);
+grpc_arg MakeLameClientErrorArg(grpc_error_handle* error);
} // namespace grpc_core
extern const grpc_channel_filter grpc_lame_filter;
diff --git a/grpc/src/core/lib/surface/metadata_array.cc b/grpc/src/core/lib/surface/metadata_array.cc
index f794a2bb..3633382a 100644
--- a/grpc/src/core/lib/surface/metadata_array.cc
+++ b/grpc/src/core/lib/surface/metadata_array.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
-#include <string.h>
-
#include "src/core/lib/surface/api_trace.h"
void grpc_metadata_array_init(grpc_metadata_array* array) {
diff --git a/grpc/src/core/lib/surface/server.cc b/grpc/src/core/lib/surface/server.cc
index a8b4aaae..4c022083 100644
--- a/grpc/src/core/lib/surface/server.cc
+++ b/grpc/src/core/lib/surface/server.cc
@@ -46,14 +46,13 @@
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/init.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
namespace grpc_core {
@@ -480,7 +479,6 @@ class ChannelBroadcaster {
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 =
@@ -499,6 +497,7 @@ class ChannelBroadcaster {
const grpc_channel_filter Server::kServerTopFilter = {
Server::CallData::StartTransportStreamOpBatch,
+ nullptr,
grpc_channel_next_op,
sizeof(Server::CallData),
Server::CallData::InitCallElement,
@@ -513,17 +512,6 @@ const grpc_channel_filter Server::kServerTopFilter = {
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(
const grpc_channel_args* args) {
RefCountedPtr<channelz::ServerNode> channelz_node;
@@ -545,7 +533,6 @@ RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
Server::Server(const grpc_channel_args* args)
: channel_args_(grpc_channel_args_copy(args)),
- default_resource_user_(CreateDefaultResourceUser(args)),
channelz_node_(CreateChannelzNode(args)) {}
Server::~Server() {
@@ -612,12 +599,11 @@ void Server::Start() {
grpc_error_handle 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) {
+ const RefCountedPtr<channelz::SocketNode>& socket_node) {
// Create channel.
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_channel* channel = grpc_channel_create(
- nullptr, args, GRPC_SERVER_CHANNEL, transport, resource_user, &error);
+ grpc_channel* channel = grpc_channel_create_internal(
+ nullptr, args, GRPC_SERVER_CHANNEL, transport, &error);
if (channel == nullptr) {
return error;
}
@@ -698,7 +684,7 @@ Server::RegisteredMethod* Server::RegisterMethod(
return nullptr;
}
}
- if ((flags & ~GRPC_INITIAL_METADATA_USED_MASK) != 0) {
+ if (flags != 0) {
gpr_log(GPR_ERROR, "grpc_server_register_method invalid flags 0x%08x",
flags);
return nullptr;
@@ -805,11 +791,14 @@ void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
// 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) {
+ absl::Notification* await_requests = nullptr;
ChannelBroadcaster broadcaster;
{
// Wait for startup to be finished. Locks mu_global.
MutexLock lock(&mu_global_);
- WaitUntil(&starting_cv_, &mu_global_, [this] { return !starting_; });
+ while (starting_) {
+ starting_cv_.Wait(&mu_global_);
+ }
// Stay locked, and gather up some stuff to do.
GPR_ASSERT(grpc_cq_begin_op(cq, tag));
if (shutdown_published_) {
@@ -829,7 +818,12 @@ void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
KillPendingWorkLocked(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
}
- ShutdownUnrefOnShutdownCall();
+ await_requests = ShutdownUnrefOnShutdownCall();
+ }
+ // We expect no new requests but there can still be requests in-flight.
+ // Wait for them to complete before proceeding.
+ if (await_requests != nullptr) {
+ await_requests->WaitForNotification();
}
// Shutdown listeners.
for (auto& listener : listeners_) {
@@ -864,11 +858,6 @@ void Server::Orphan() {
GPR_ASSERT(ShutdownCalled() || 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();
}
@@ -993,19 +982,7 @@ class Server::ChannelData::ConnectivityWatcher
//
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();
- }
+ registered_methods_.reset();
if (server_ != nullptr) {
if (server_->channelz_node_ != nullptr && channelz_socket_uuid_ != 0) {
server_->channelz_node_->RemoveChildSocket(channelz_socket_uuid_);
@@ -1038,14 +1015,13 @@ void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
registered_methods_ =
absl::make_unique<std::vector<ChannelRegisteredMethod>>(slots);
for (std::unique_ptr<RegisteredMethod>& rm : server_->registered_methods_) {
- ExternallyManagedSlice host;
- ExternallyManagedSlice method(rm->method.c_str());
+ Slice host;
+ Slice method = Slice::FromExternalString(rm->method);
const bool has_host = !rm->host.empty();
if (has_host) {
- host = ExternallyManagedSlice(rm->host.c_str());
+ host = Slice::FromExternalString(rm->host.c_str());
}
- uint32_t hash =
- GRPC_MDSTR_KV_HASH(has_host ? host.Hash() : 0, method.Hash());
+ uint32_t hash = MixHash32(has_host ? host.Hash() : 0, method.Hash());
uint32_t probes = 0;
for (probes = 0; (*registered_methods_)[(hash + probes) % slots]
.server_registered_method != nullptr;
@@ -1058,9 +1034,9 @@ void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
crm->flags = rm->flags;
crm->has_host = has_host;
if (has_host) {
- crm->host = host;
+ crm->host = std::move(host);
}
- crm->method = method;
+ crm->method = std::move(method);
}
GPR_ASSERT(slots <= UINT32_MAX);
registered_method_max_probes_ = max_probes;
@@ -1085,12 +1061,12 @@ void Server::ChannelData::InitTransport(RefCountedPtr<Server> server,
}
Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod(
- const grpc_slice& host, const grpc_slice& path, bool is_idempotent) {
+ const grpc_slice& host, const grpc_slice& path) {
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));
+ uint32_t hash =
+ MixHash32(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()];
@@ -1098,24 +1074,16 @@ Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod(
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));
+ hash = MixHash32(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;
@@ -1133,9 +1101,7 @@ void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
args.cq = nullptr;
args.pollset_set_alternative = nullptr;
args.server_transport_data = transport_server_data;
- args.add_initial_metadata = nullptr;
- args.add_initial_metadata_count = 0;
- args.send_deadline = GRPC_MILLIS_INF_FUTURE;
+ args.send_deadline = Timestamp::InfFuture();
grpc_call* call;
grpc_error_handle error = grpc_call_create(&args, &call);
grpc_call_element* elem =
@@ -1207,39 +1173,33 @@ Server::CallData::CallData(grpc_call_element* elem,
}
Server::CallData::~CallData() {
- GPR_ASSERT(state_.Load(MemoryOrder::RELAXED) != CallState::PENDING);
+ GPR_ASSERT(state_.load(std::memory_order_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);
+ state_.store(state, std::memory_order_relaxed);
}
bool Server::CallData::MaybeActivate() {
CallState expected = CallState::PENDING;
- return state_.CompareExchangeStrong(&expected, CallState::ACTIVATED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED);
+ return state_.compare_exchange_strong(expected, CallState::ACTIVATED,
+ std::memory_order_acq_rel,
+ std::memory_order_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)) {
+ if (state_.compare_exchange_strong(expected_not_started, CallState::ZOMBIED,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
KillZombie();
- } else if (state_.CompareExchangeStrong(&expected_pending, CallState::ZOMBIED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED)) {
+ } else if (state_.compare_exchange_strong(
+ expected_pending, CallState::ZOMBIED,
+ std::memory_order_acq_rel, std::memory_order_relaxed)) {
// Zombied call will be destroyed when it's removed from the pending
// queue... later.
}
@@ -1262,20 +1222,21 @@ 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_);
+ std::swap(*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->host = grpc_slice_ref_internal(host_->c_slice());
+ rc->data.batch.details->method =
+ grpc_slice_ref_internal(path_->c_slice());
rc->data.batch.details->deadline =
- grpc_millis_to_timespec(deadline_, GPR_CLOCK_MONOTONIC);
+ deadline_.as_timespec(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);
+ deadline_.as_timespec(GPR_CLOCK_MONOTONIC);
if (rc->data.registered.optional_payload != nullptr) {
*rc->data.registered.optional_payload = payload_;
payload_ = nullptr;
@@ -1295,7 +1256,7 @@ void Server::CallData::PublishNewRpc(void* arg, grpc_error_handle error) {
RequestMatcherInterface* rm = calld->matcher_;
Server* server = rm->server();
if (error != GRPC_ERROR_NONE || server->ShutdownCalled()) {
- calld->state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ calld->state_.store(CallState::ZOMBIED, std::memory_order_relaxed);
calld->KillZombie();
return;
}
@@ -1319,7 +1280,7 @@ void Server::CallData::KillZombie() {
void Server::CallData::StartNewRpc(grpc_call_element* elem) {
auto* chand = static_cast<ChannelData*>(elem->channel_data);
if (server_->ShutdownCalled()) {
- state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ state_.store(CallState::ZOMBIED, std::memory_order_relaxed);
KillZombie();
return;
}
@@ -1329,9 +1290,7 @@ void Server::CallData::StartNewRpc(grpc_call_element* elem) {
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));
+ chand->GetRegisteredMethod(host_->c_slice(), path_->c_slice());
if (rm != nullptr) {
matcher_ = rm->server_registered_method->matcher.get();
payload_handling = rm->server_registered_method->payload_handling;
@@ -1361,6 +1320,8 @@ void Server::CallData::RecvInitialMetadataBatchComplete(
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<Server::CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_DEBUG, "Failed call creation: %s",
+ grpc_error_std_string(error).c_str());
calld->FailCallCreation();
return;
}
@@ -1393,24 +1354,15 @@ void Server::CallData::RecvInitialMetadataReady(void* arg,
grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
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);
+ calld->path_ = calld->recv_initial_metadata_->Take(HttpPathMetadata());
+ calld->host_ = calld->recv_initial_metadata_->Take(HttpAuthorityMetadata());
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
- op_deadline = calld->recv_initial_metadata_->deadline;
- if (op_deadline != GRPC_MILLIS_INF_FUTURE) {
- calld->deadline_ = op_deadline;
+ auto op_deadline = calld->recv_initial_metadata_->get(GrpcTimeoutMetadata());
+ if (op_deadline.has_value()) {
+ calld->deadline_ = *op_deadline;
}
if (calld->host_.has_value() && calld->path_.has_value()) {
/* do nothing */
@@ -1484,9 +1436,12 @@ void Server::CallData::StartTransportStreamOpBatch(
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;
+ const grpc_channel_args* new_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_core::Server* server = new grpc_core::Server(new_args);
+ grpc_channel_args_destroy(new_args);
+ return server->c_ptr();
}
void grpc_server_register_completion_queue(grpc_server* server,
@@ -1505,7 +1460,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);
+ grpc_core::Server::FromC(server)->RegisterCompletionQueue(cq);
}
void* grpc_server_register_method(
@@ -1516,14 +1471,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 grpc_core::Server::FromC(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();
+ grpc_core::Server::FromC(server)->Start();
}
void grpc_server_shutdown_and_notify(grpc_server* server,
@@ -1532,21 +1487,21 @@ 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);
+ grpc_core::Server::FromC(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();
+ grpc_core::Server::FromC(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;
+ grpc_core::Server::FromC(server)->Orphan();
}
grpc_call_error grpc_server_request_call(
@@ -1564,9 +1519,9 @@ grpc_call_error grpc_server_request_call(
7,
(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 grpc_core::Server::FromC(server)->RequestCall(
+ call, details, request_metadata, cq_bound_to_call, cq_for_notification,
+ tag);
}
grpc_call_error grpc_server_request_registered_call(
@@ -1589,7 +1544,7 @@ grpc_call_error grpc_server_request_registered_call(
9,
(server, registered_method, call, deadline, request_metadata,
optional_payload, cq_bound_to_call, cq_for_notification, tag_new));
- return server->core_server->RequestRegisteredCall(
+ return grpc_core::Server::FromC(server)->RequestRegisteredCall(
rm, call, deadline, request_metadata, optional_payload, cq_bound_to_call,
cq_for_notification, tag_new);
}
@@ -1600,7 +1555,7 @@ void grpc_server_set_config_fetcher(
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_set_config_fetcher(server=%p, config_fetcher=%p)",
2, (server, server_config_fetcher));
- server->core_server->set_config_fetcher(
+ grpc_core::Server::FromC(server)->set_config_fetcher(
std::unique_ptr<grpc_server_config_fetcher>(server_config_fetcher));
}
diff --git a/grpc/src/core/lib/surface/server.h b/grpc/src/core/lib/surface/server.h
index 413a5a8a..0af23190 100644
--- a/grpc/src/core/lib/surface/server.h
+++ b/grpc/src/core/lib/surface/server.h
@@ -19,10 +19,12 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <list>
#include <vector>
#include "absl/status/statusor.h"
+#include "absl/synchronization/notification.h"
#include "absl/types/optional.h"
#include <grpc/grpc.h>
@@ -31,8 +33,10 @@
#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/gprpp/cpp_impl_of.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/transport/transport.h"
@@ -40,7 +44,8 @@ namespace grpc_core {
extern TraceFlag grpc_server_channel_trace;
-class Server : public InternallyRefCounted<Server> {
+class Server : public InternallyRefCounted<Server>,
+ public CppImplOf<Server, grpc_server> {
public:
// Filter vtable.
static const grpc_channel_filter kServerTopFilter;
@@ -97,9 +102,6 @@ class Server : public InternallyRefCounted<Server> {
void Orphan() ABSL_LOCKS_EXCLUDED(mu_global_) 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
@@ -128,11 +130,11 @@ class Server : public InternallyRefCounted<Server> {
// 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.
+ // Takes ownership of a ref on resource_user from the caller.
grpc_error_handle 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);
+ const RefCountedPtr<channelz::SocketNode>& socket_node);
void RegisterCompletionQueue(grpc_completion_queue* cq);
@@ -174,8 +176,8 @@ class Server : public InternallyRefCounted<Server> {
RegisteredMethod* server_registered_method = nullptr;
uint32_t flags;
bool has_host;
- ExternallyManagedSlice method;
- ExternallyManagedSlice host;
+ Slice method;
+ Slice host;
};
class RequestMatcherInterface;
@@ -198,8 +200,7 @@ class Server : public InternallyRefCounted<Server> {
size_t cq_idx() const { return cq_idx_; }
ChannelRegisteredMethod* GetRegisteredMethod(const grpc_slice& host,
- const grpc_slice& path,
- bool is_idempotent);
+ const grpc_slice& path);
// Filter vtable functions.
static grpc_error_handle InitChannelElement(
@@ -289,11 +290,11 @@ class Server : public InternallyRefCounted<Server> {
grpc_call* call_;
- Atomic<CallState> state_{CallState::NOT_STARTED};
+ std::atomic<CallState> state_{CallState::NOT_STARTED};
- absl::optional<grpc_slice> path_;
- absl::optional<grpc_slice> host_;
- grpc_millis deadline_ = GRPC_MILLIS_INF_FUTURE;
+ absl::optional<Slice> path_;
+ absl::optional<Slice> host_;
+ Timestamp deadline_ = Timestamp::InfFuture();
grpc_completion_queue* cq_new_ = nullptr;
@@ -365,9 +366,9 @@ class Server : public InternallyRefCounted<Server> {
std::vector<grpc_channel*> GetChannelsLocked() const;
// Take a shutdown ref for a request (increment by 2) and return if shutdown
- // has already been called.
+ // has not been called.
bool ShutdownRefOnRequest() {
- int old_value = shutdown_refs_.FetchAdd(2, MemoryOrder::ACQ_REL);
+ int old_value = shutdown_refs_.fetch_add(2, std::memory_order_acq_rel);
return (old_value & 1) != 0;
}
@@ -375,30 +376,41 @@ class Server : public InternallyRefCounted<Server> {
// (for in-flight request) and possibly call MaybeFinishShutdown if
// appropriate.
void ShutdownUnrefOnRequest() ABSL_LOCKS_EXCLUDED(mu_global_) {
- if (shutdown_refs_.FetchSub(2, MemoryOrder::ACQ_REL) == 2) {
+ if (shutdown_refs_.fetch_sub(2, std::memory_order_acq_rel) == 2) {
MutexLock lock(&mu_global_);
MaybeFinishShutdown();
+ // The last request in-flight during shutdown is now complete.
+ if (requests_complete_ != nullptr) {
+ GPR_ASSERT(!requests_complete_->HasBeenNotified());
+ requests_complete_->Notify();
+ }
}
}
- void ShutdownUnrefOnShutdownCall() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) {
- if (shutdown_refs_.FetchSub(1, MemoryOrder::ACQ_REL) == 1) {
+ // Returns a notification pointer to wait on if there are requests in-flight,
+ // or null.
+ absl::Notification* ShutdownUnrefOnShutdownCall()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) GRPC_MUST_USE_RESULT {
+ if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
+ // There is no request in-flight.
MaybeFinishShutdown();
+ return nullptr;
}
+ requests_complete_ = absl::make_unique<absl::Notification>();
+ return requests_complete_.get();
}
bool ShutdownCalled() const {
- return (shutdown_refs_.Load(MemoryOrder::ACQUIRE) & 1) == 0;
+ return (shutdown_refs_.load(std::memory_order_acquire) & 1) == 0;
}
// Returns whether there are no more shutdown refs, which means that shutdown
// has been called and all accepted requests have been published if using an
// AllocatingRequestMatcher.
bool ShutdownReady() const {
- return shutdown_refs_.Load(MemoryOrder::ACQUIRE) == 0;
+ return shutdown_refs_.load(std::memory_order_acquire) == 0;
}
grpc_channel_args* const channel_args_;
- grpc_resource_user* default_resource_user_ = nullptr;
RefCountedPtr<channelz::ServerNode> channelz_node_;
std::unique_ptr<grpc_server_config_fetcher> config_fetcher_;
@@ -416,9 +428,9 @@ class Server : public InternallyRefCounted<Server> {
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;
+ // startup synchronization: flag, signals whether we are doing the listener
+ // start routine or not.
+ bool starting_ ABSL_GUARDED_BY(mu_global_) = false;
CondVar starting_cv_;
std::vector<std::unique_ptr<RegisteredMethod>> registered_methods_;
@@ -432,9 +444,11 @@ class Server : public InternallyRefCounted<Server> {
// the lowest bit will be 0 (defaults to 1) and the counter will be even. The
// server should not notify on shutdown until the counter is 0 (shutdown is
// called and there are no requests that are accepted but not started).
- Atomic<int> shutdown_refs_{1};
+ std::atomic<int> shutdown_refs_{1};
bool shutdown_published_ ABSL_GUARDED_BY(mu_global_) = false;
std::vector<ShutdownTag> shutdown_tags_ ABSL_GUARDED_BY(mu_global_);
+ std::unique_ptr<absl::Notification> requests_complete_
+ ABSL_GUARDED_BY(mu_global_);
std::list<ChannelData*> channels_;
@@ -447,19 +461,10 @@ class Server : public InternallyRefCounted<Server> {
} // namespace grpc_core
-struct grpc_server {
- grpc_core::OrphanablePtr<grpc_core::Server> core_server;
-};
-
-// TODO(roth): Eventually, will need a way to modify configuration even after
-// a connection is established (e.g., to change things like L7 rate
-// limiting, RBAC, and fault injection configs). One possible option
-// would be to do something like ServiceConfig and ConfigSelector, but
-// that might add unnecessary per-call overhead. Need to consider other
-// approaches here.
struct grpc_server_config_fetcher {
public:
- class ConnectionManager : public grpc_core::RefCounted<ConnectionManager> {
+ class ConnectionManager
+ : public grpc_core::DualRefCounted<ConnectionManager> {
public:
// Ownership of \a args is transfered.
virtual absl::StatusOr<grpc_channel_args*> UpdateChannelArgsForConnection(
@@ -481,9 +486,7 @@ struct grpc_server_config_fetcher {
virtual ~grpc_server_config_fetcher() = default;
- // Ownership of \a args is transferred.
virtual void StartWatch(std::string listening_address,
- grpc_channel_args* args,
std::unique_ptr<WatcherInterface> watcher) = 0;
virtual void CancelWatch(WatcherInterface* watcher) = 0;
virtual grpc_pollset_set* interested_parties() = 0;
diff --git a/grpc/src/core/lib/surface/validate_metadata.cc b/grpc/src/core/lib/surface/validate_metadata.cc
index c1ec936e..76df4df0 100644
--- a/grpc/src/core/lib/surface/validate_metadata.cc
+++ b/grpc/src/core/lib/surface/validate_metadata.cc
@@ -18,34 +18,44 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/surface/validate_metadata.h"
+
#include <stdlib.h>
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
+#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/surface/validate_metadata.h"
+
+#if __cplusplus > 201103l
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_FN constexpr
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_FN
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE const
+#endif
static grpc_error_handle conforms_to(const grpc_slice& slice,
- const uint8_t* legal_bits,
+ const grpc_core::BitSet<256>& legal_bits,
const char* err_desc) {
const uint8_t* p = GRPC_SLICE_START_PTR(slice);
const uint8_t* e = GRPC_SLICE_END_PTR(slice);
for (; p != e; p++) {
- int idx = *p;
- int byte = idx / 8;
- int bit = idx % 8;
- if ((legal_bits[byte] & (1 << bit)) == 0) {
+ if (!legal_bits.is_set(*p)) {
+ size_t len;
+ grpc_core::UniquePtr<char> ptr(gpr_dump_return_len(
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_LENGTH(slice), GPR_DUMP_HEX | GPR_DUMP_ASCII, &len));
grpc_error_handle error = grpc_error_set_str(
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_desc),
GRPC_ERROR_INT_OFFSET,
p - GRPC_SLICE_START_PTR(slice)),
- GRPC_ERROR_STR_RAW_BYTES,
- grpc_dump_slice_to_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII));
+ GRPC_ERROR_STR_RAW_BYTES, absl::string_view(ptr.get(), len));
return error;
}
}
@@ -58,11 +68,22 @@ static int error2int(grpc_error_handle error) {
return r;
}
+namespace {
+class LegalHeaderKeyBits : public grpc_core::BitSet<256> {
+ public:
+ GRPC_VALIDATE_METADATA_CONSTEXPR_FN LegalHeaderKeyBits() {
+ for (int i = 'a'; i <= 'z'; i++) set(i);
+ for (int i = '0'; i <= '9'; i++) set(i);
+ set('-');
+ set('_');
+ set('.');
+ }
+};
+GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE LegalHeaderKeyBits
+ g_legal_header_key_bits;
+} // namespace
+
grpc_error_handle grpc_validate_header_key_is_legal(const grpc_slice& slice) {
- static const uint8_t legal_header_bits[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0x00, 0x00, 0x00,
- 0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
if (GRPC_SLICE_LENGTH(slice) == 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Metadata keys cannot be zero length");
@@ -75,20 +96,30 @@ grpc_error_handle grpc_validate_header_key_is_legal(const grpc_slice& slice) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Metadata keys cannot start with :");
}
- return conforms_to(slice, legal_header_bits, "Illegal header key");
+ return conforms_to(slice, g_legal_header_key_bits, "Illegal header key");
}
int grpc_header_key_is_legal(grpc_slice slice) {
return error2int(grpc_validate_header_key_is_legal(slice));
}
+namespace {
+class LegalHeaderNonBinValueBits : public grpc_core::BitSet<256> {
+ public:
+ GRPC_VALIDATE_METADATA_CONSTEXPR_FN LegalHeaderNonBinValueBits() {
+ for (int i = 32; i <= 126; i++) {
+ set(i);
+ }
+ }
+};
+GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE LegalHeaderNonBinValueBits
+ g_legal_header_non_bin_value_bits;
+} // namespace
+
grpc_error_handle grpc_validate_header_nonbin_value_is_legal(
const grpc_slice& slice) {
- static const uint8_t legal_header_bits[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- return conforms_to(slice, legal_header_bits, "Illegal header value");
+ return conforms_to(slice, g_legal_header_non_bin_value_bits,
+ "Illegal header value");
}
int grpc_header_nonbin_value_is_legal(grpc_slice slice) {
diff --git a/grpc/src/core/lib/surface/version.cc b/grpc/src/core/lib/surface/version.cc
index 8061df0c..9c08937d 100644
--- a/grpc/src/core/lib/surface/version.cc
+++ b/grpc/src/core/lib/surface/version.cc
@@ -23,8 +23,6 @@
#include <grpc/grpc.h>
-const char* grpc_version_string(void) { return "16.0.0"; }
+const char* grpc_version_string(void) { return "24.0.0"; }
-const char* grpc_g_stands_for(void) {
- return "guadalupe_river_park_conservancy";
-}
+const char* grpc_g_stands_for(void) { return "golazo"; }
diff --git a/grpc/src/core/lib/transport/authority_override.cc b/grpc/src/core/lib/transport/authority_override.cc
deleted file mode 100644
index 66850725..00000000
--- a/grpc/src/core/lib/transport/authority_override.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// 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 "absl/strings/string_view.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 {
-
-grpc_arg CreateAuthorityOverrideChannelArg(const char* authority) {
- return grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_AUTHORITY_OVERRIDE),
- const_cast<char*>(authority));
-}
-
-absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args) {
- const char* found =
- grpc_channel_args_find_string(args, GRPC_ARG_AUTHORITY_OVERRIDE);
- return found == nullptr ? "" : found;
-}
-
-} // namespace grpc_core
diff --git a/grpc/src/core/lib/transport/authority_override.h b/grpc/src/core/lib/transport/authority_override.h
deleted file mode 100644
index 7af6526e..00000000
--- a/grpc/src/core/lib/transport/authority_override.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// 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>
-
-#include "absl/strings/string_view.h"
-
-#include <grpc/grpc.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 the empty string. The return
-/// value is a string_view into the `args` data structure.
-absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args);
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H */
diff --git a/grpc/src/core/lib/transport/bdp_estimator.cc b/grpc/src/core/lib/transport/bdp_estimator.cc
index dd266877..de4f3292 100644
--- a/grpc/src/core/lib/transport/bdp_estimator.cc
+++ b/grpc/src/core/lib/transport/bdp_estimator.cc
@@ -34,18 +34,18 @@ BdpEstimator::BdpEstimator(const char* name)
accumulator_(0),
estimate_(65536),
ping_start_time_(gpr_time_0(GPR_CLOCK_MONOTONIC)),
- inter_ping_delay_(100), // start at 100ms
+ inter_ping_delay_(Duration::Milliseconds(100)), // start at 100ms
stable_estimate_count_(0),
bw_est_(0),
name_(name) {}
-grpc_millis BdpEstimator::CompletePing() {
+Timestamp BdpEstimator::CompletePing() {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec dt_ts = gpr_time_sub(now, ping_start_time_);
double dt = static_cast<double>(dt_ts.tv_sec) +
1e-9 * static_cast<double>(dt_ts.tv_nsec);
double bw = dt > 0 ? (static_cast<double>(accumulator_) / dt) : 0;
- int start_inter_ping_delay = inter_ping_delay_;
+ Duration start_inter_ping_delay = inter_ping_delay_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) {
gpr_log(GPR_INFO,
"bdp[%s]:complete acc=%" PRId64 " est=%" PRId64
@@ -55,7 +55,7 @@ grpc_millis BdpEstimator::CompletePing() {
}
GPR_ASSERT(ping_state_ == PingState::STARTED);
if (accumulator_ > 2 * estimate_ / 3 && bw > bw_est_) {
- estimate_ = GPR_MAX(accumulator_, estimate_ * 2);
+ estimate_ = std::max(accumulator_, estimate_ * 2);
bw_est_ = bw;
if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) {
gpr_log(GPR_INFO, "bdp[%s]: estimate increased to %" PRId64, name_,
@@ -63,25 +63,24 @@ grpc_millis BdpEstimator::CompletePing() {
}
inter_ping_delay_ /= 2; // if the ping estimate changes,
// exponentially get faster at probing
- } else if (inter_ping_delay_ < 10000) {
+ } else if (inter_ping_delay_ < Duration::Seconds(10)) {
stable_estimate_count_++;
if (stable_estimate_count_ >= 2) {
- inter_ping_delay_ +=
- 100 + static_cast<int>(rand() * 100.0 /
- RAND_MAX); // if the ping estimate is steady,
- // slowly ramp down the probe time
+ // if the ping estimate is steady, slowly ramp down the probe time
+ inter_ping_delay_ += Duration::Milliseconds(
+ 100 + static_cast<int>(rand() * 100.0 / RAND_MAX));
}
}
if (start_inter_ping_delay != inter_ping_delay_) {
stable_estimate_count_ = 0;
if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) {
- gpr_log(GPR_INFO, "bdp[%s]:update_inter_time to %dms", name_,
- inter_ping_delay_);
+ gpr_log(GPR_INFO, "bdp[%s]:update_inter_time to %" PRId64 "ms", name_,
+ inter_ping_delay_.millis());
}
}
ping_state_ = PingState::UNSCHEDULED;
accumulator_ = 0;
- return grpc_core::ExecCtx::Get()->Now() + inter_ping_delay_;
+ return ExecCtx::Get()->Now() + inter_ping_delay_;
}
} // namespace grpc_core
diff --git a/grpc/src/core/lib/transport/bdp_estimator.h b/grpc/src/core/lib/transport/bdp_estimator.h
index 7eb336d8..5e4a61a8 100644
--- a/grpc/src/core/lib/transport/bdp_estimator.h
+++ b/grpc/src/core/lib/transport/bdp_estimator.h
@@ -72,7 +72,7 @@ class BdpEstimator {
}
// Completes a previously started ping, returns when to schedule the next one
- grpc_millis CompletePing();
+ Timestamp CompletePing();
int64_t accumulator() { return accumulator_; }
@@ -84,7 +84,7 @@ class BdpEstimator {
int64_t estimate_;
// when was the current ping started?
gpr_timespec ping_start_time_;
- int inter_ping_delay_;
+ Duration inter_ping_delay_;
int stable_estimate_count_;
double bw_est_;
const char* name_;
diff --git a/grpc/src/core/lib/transport/byte_stream.cc b/grpc/src/core/lib/transport/byte_stream.cc
index 3cc5275e..7bf17321 100644
--- a/grpc/src/core/lib/transport/byte_stream.cc
+++ b/grpc/src/core/lib/transport/byte_stream.cc
@@ -40,6 +40,10 @@ SliceBufferByteStream::SliceBufferByteStream(grpc_slice_buffer* slice_buffer,
GPR_ASSERT(slice_buffer->length <= UINT32_MAX);
grpc_slice_buffer_init(&backing_buffer_);
grpc_slice_buffer_swap(slice_buffer, &backing_buffer_);
+ if (backing_buffer_.count == 0) {
+ grpc_slice_buffer_add_indexed(&backing_buffer_, grpc_empty_slice());
+ GPR_ASSERT(backing_buffer_.count > 0);
+ }
}
SliceBufferByteStream::~SliceBufferByteStream() {}
@@ -47,6 +51,7 @@ SliceBufferByteStream::~SliceBufferByteStream() {}
void SliceBufferByteStream::Orphan() {
grpc_slice_buffer_destroy_internal(&backing_buffer_);
GRPC_ERROR_UNREF(shutdown_error_);
+ shutdown_error_ = GRPC_ERROR_NONE;
// Note: We do not actually delete the object here, since
// SliceBufferByteStream is usually allocated as part of a larger
// object and has an OrphanablePtr of itself passed down through the
@@ -103,6 +108,7 @@ ByteStreamCache::CachingByteStream::~CachingByteStream() {}
void ByteStreamCache::CachingByteStream::Orphan() {
GRPC_ERROR_UNREF(shutdown_error_);
+ shutdown_error_ = GRPC_ERROR_NONE;
// Note: We do not actually delete the object here, since
// CachingByteStream is usually allocated as part of a larger
// object and has an OrphanablePtr of itself passed down through the
diff --git a/grpc/src/core/lib/transport/byte_stream.h b/grpc/src/core/lib/transport/byte_stream.h
index 09a30326..28dd443a 100644
--- a/grpc/src/core/lib/transport/byte_stream.h
+++ b/grpc/src/core/lib/transport/byte_stream.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/closure.h"
diff --git a/grpc/src/core/lib/transport/connectivity_state.cc b/grpc/src/core/lib/transport/connectivity_state.cc
index 01a4f5cb..ffad92e8 100644
--- a/grpc/src/core/lib/transport/connectivity_state.cc
+++ b/grpc/src/core/lib/transport/connectivity_state.cc
@@ -101,7 +101,8 @@ void AsyncConnectivityStateWatcherInterface::Notify(
//
ConnectivityStateTracker::~ConnectivityStateTracker() {
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_relaxed);
if (current_state == GRPC_CHANNEL_SHUTDOWN) return;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
@@ -121,7 +122,8 @@ void ConnectivityStateTracker::AddWatcher(
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: add watcher %p", name_,
this, watcher.get());
}
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_relaxed);
if (initial_state != current_state) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO,
@@ -150,14 +152,15 @@ void ConnectivityStateTracker::RemoveWatcher(
void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
const absl::Status& status,
const char* reason) {
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_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());
}
- state_.Store(state, MemoryOrder::RELAXED);
+ state_.store(state, std::memory_order_relaxed);
status_ = status;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
@@ -174,7 +177,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
}
grpc_connectivity_state ConnectivityStateTracker::state() const {
- grpc_connectivity_state state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state state = state_.load(std::memory_order_relaxed);
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: get current state: %s",
name_, this, ConnectivityStateName(state));
diff --git a/grpc/src/core/lib/transport/connectivity_state.h b/grpc/src/core/lib/transport/connectivity_state.h
index 34173110..8c866a37 100644
--- a/grpc/src/core/lib/transport/connectivity_state.h
+++ b/grpc/src/core/lib/transport/connectivity_state.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <map>
#include <memory>
@@ -29,7 +30,6 @@
#include <grpc/grpc.h>
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -131,7 +131,7 @@ class ConnectivityStateTracker {
private:
const char* name_;
- Atomic<grpc_connectivity_state> state_;
+ std::atomic<grpc_connectivity_state> state_{grpc_connectivity_state()};
absl::Status status_;
// TODO(roth): Once we can use C++-14 heterogeneous lookups, this can
// be a set instead of a map.
diff --git a/grpc/src/core/lib/transport/error_utils.cc b/grpc/src/core/lib/transport/error_utils.cc
index e8f05550..e8cb09d4 100644
--- a/grpc/src/core/lib/transport/error_utils.cc
+++ b/grpc/src/core/lib/transport/error_utils.cc
@@ -21,6 +21,8 @@
#include "src/core/lib/transport/error_utils.h"
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/iomgr/error_internal.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/status_conversion.h"
@@ -32,7 +34,14 @@ static grpc_error_handle recursively_find_error_with_field(
if (grpc_error_get_int(error, which, &unused)) {
return error;
}
- if (grpc_error_is_special(error)) return nullptr;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ std::vector<absl::Status> children = grpc_core::StatusGetChildren(error);
+ for (const absl::Status& child : children) {
+ grpc_error_handle result = recursively_find_error_with_field(child, which);
+ if (result != GRPC_ERROR_NONE) return result;
+ }
+#else
+ if (grpc_error_is_special(error)) return GRPC_ERROR_NONE;
// Otherwise, search through its children.
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
@@ -43,26 +52,28 @@ static grpc_error_handle recursively_find_error_with_field(
if (result) return result;
slot = lerr->next;
}
- return nullptr;
+#endif
+ return GRPC_ERROR_NONE;
}
-void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
- grpc_status_code* code, grpc_slice* slice,
+void grpc_error_get_status(grpc_error_handle error,
+ grpc_core::Timestamp deadline,
+ grpc_status_code* code, std::string* message,
grpc_http2_error_code* http_error,
const char** error_string) {
// Fast path: We expect no error.
if (GPR_LIKELY(error == GRPC_ERROR_NONE)) {
if (code != nullptr) *code = GRPC_STATUS_OK;
- if (slice != nullptr) {
+ if (message != nullptr) {
// Normally, we call grpc_error_get_str(
- // error, GRPC_ERROR_STR_GRPC_MESSAGE, slice).
+ // error, GRPC_ERROR_STR_GRPC_MESSAGE, message).
// We can fastpath since we know that:
// 1) Error is null
// 2) which == GRPC_ERROR_STR_GRPC_MESSAGE
- // 3) The resulting slice is statically known.
- // 4) Said resulting slice is of length 0 ("").
+ // 3) The resulting message is statically known.
+ // 4) Said resulting message is "".
// This means 3 movs, instead of 10s of instructions and a strlen.
- *slice = grpc_core::ExternallyManagedSlice("");
+ *message = "";
}
if (http_error != nullptr) {
*http_error = GRPC_HTTP2_NO_ERROR;
@@ -74,7 +85,7 @@ void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
// until we find the first one that has a status code.
grpc_error_handle found_error =
recursively_find_error_with_field(error, GRPC_ERROR_INT_GRPC_STATUS);
- if (found_error == nullptr) {
+ if (found_error == GRPC_ERROR_NONE) {
/// If no grpc-status exists, retry through the tree to find a http2 error
/// code
found_error =
@@ -83,7 +94,7 @@ void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
// If we found an error with a status code above, use that; otherwise,
// fall back to using the parent error.
- if (found_error == nullptr) found_error = error;
+ if (found_error == GRPC_ERROR_NONE) found_error = error;
grpc_status_code status = GRPC_STATUS_UNKNOWN;
intptr_t integer;
@@ -93,6 +104,10 @@ void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
&integer)) {
status = grpc_http2_error_to_grpc_status(
static_cast<grpc_http2_error_code>(integer), deadline);
+ } else {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ status = static_cast<grpc_status_code>(found_error.code());
+#endif
}
if (code != nullptr) *code = status;
@@ -115,10 +130,16 @@ void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
// If the error has a status message, use it. Otherwise, fall back to
// the error description.
- if (slice != nullptr) {
- if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE, slice)) {
- if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION, slice)) {
- *slice = grpc_slice_from_static_string("unknown error");
+ if (message != nullptr) {
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ message)) {
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION,
+ message)) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ *message = grpc_error_std_string(error);
+#else
+ *message = "unknown error";
+#endif
}
}
}
@@ -128,13 +149,11 @@ absl::Status grpc_error_to_absl_status(grpc_error_handle error) {
grpc_status_code status;
// TODO(yashykt): This should be updated once we decide on how to use the
// 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 absl::Status(static_cast<absl::StatusCode>(status),
- absl::string_view(reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(message)),
- GRPC_SLICE_LENGTH(message)));
+ std::string message;
+ grpc_error_get_status(error, grpc_core::Timestamp::InfFuture(), &status,
+ &message, nullptr /* http_error */,
+ nullptr /* error_string */);
+ return absl::Status(static_cast<absl::StatusCode>(status), message);
}
grpc_error_handle absl_status_to_grpc_error(absl::Status status) {
@@ -152,6 +171,14 @@ bool grpc_error_has_clear_grpc_status(grpc_error_handle error) {
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &unused)) {
return true;
}
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ std::vector<absl::Status> children = grpc_core::StatusGetChildren(error);
+ for (const absl::Status& child : children) {
+ if (grpc_error_has_clear_grpc_status(child)) {
+ return true;
+ }
+ }
+#else
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
@@ -161,5 +188,6 @@ bool grpc_error_has_clear_grpc_status(grpc_error_handle error) {
}
slot = lerr->next;
}
+#endif
return false;
}
diff --git a/grpc/src/core/lib/transport/error_utils.h b/grpc/src/core/lib/transport/error_utils.h
index 777e6323..4b500675 100644
--- a/grpc/src/core/lib/transport/error_utils.h
+++ b/grpc/src/core/lib/transport/error_utils.h
@@ -34,8 +34,9 @@
/// be populated with the entire error string. If any of the attributes (code,
/// msg, http_status, error_string) are unneeded, they can be passed as
/// NULL.
-void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
- grpc_status_code* code, grpc_slice* slice,
+void grpc_error_get_status(grpc_error_handle error,
+ grpc_core::Timestamp deadline,
+ grpc_status_code* code, std::string* message,
grpc_http2_error_code* http_error,
const char** error_string);
diff --git a/grpc/src/core/lib/transport/metadata.cc b/grpc/src/core/lib/transport/metadata.cc
deleted file mode 100644
index ef1e07d2..00000000
--- a/grpc/src/core/lib/transport/metadata.cc
+++ /dev/null
@@ -1,693 +0,0 @@
-/*
- *
- * 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/lib/transport/metadata.h"
-
-#include <assert.h>
-#include <inttypes.h>
-#include <stddef.h>
-#include <string.h>
-
-#include <grpc/compression.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/gpr/murmur_hash.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/iomgr_internal.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"
-#include "src/core/lib/transport/static_metadata.h"
-
-using grpc_core::AllocatedMetadata;
-using grpc_core::InternedMetadata;
-using grpc_core::StaticMetadata;
-using grpc_core::UserData;
-
-/* There are two kinds of mdelem and mdstr instances.
- * Static instances are declared in static_metadata.{h,c} and
- * are initialized by grpc_mdctx_global_init().
- * Dynamic instances are stored in hash tables on grpc_mdctx, and are backed
- * by internal_string and internal_element structures.
- * Internal helper functions here-in (is_mdstr_static, is_mdelem_static) are
- * used to determine which kind of element a pointer refers to.
- */
-
-grpc_core::DebugOnlyTraceFlag grpc_trace_metadata(false, "metadata");
-
-#ifndef NDEBUG
-#define DEBUG_ARGS , const char *file, int line
-#define FWD_DEBUG_ARGS file, line
-
-void grpc_mdelem_trace_ref(void* md, const grpc_slice& key,
- const grpc_slice& value, intptr_t refcnt,
- const char* file, int line) {
- if (grpc_trace_metadata.enabled()) {
- char* key_str = grpc_slice_to_c_string(key);
- char* value_str = grpc_slice_to_c_string(value);
- gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
- "mdelem REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md,
- refcnt, refcnt + 1, key_str, value_str);
- gpr_free(key_str);
- gpr_free(value_str);
- }
-}
-
-void grpc_mdelem_trace_unref(void* md, const grpc_slice& key,
- const grpc_slice& value, intptr_t refcnt,
- const char* file, int line) {
- if (grpc_trace_metadata.enabled()) {
- char* key_str = grpc_slice_to_c_string(key);
- char* value_str = grpc_slice_to_c_string(value);
- gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
- "mdelem UNREF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md,
- refcnt, refcnt - 1, key_str, value_str);
- gpr_free(key_str);
- gpr_free(value_str);
- }
-}
-
-#else // ifndef NDEBUG
-#define DEBUG_ARGS
-#define FWD_DEBUG_ARGS
-#endif // ifndef NDEBUG
-
-#define INITIAL_SHARD_CAPACITY 8
-#define LOG2_SHARD_COUNT 4
-#define SHARD_COUNT ((size_t)(1 << LOG2_SHARD_COUNT))
-
-#define TABLE_IDX(hash, capacity) (((hash) >> (LOG2_SHARD_COUNT)) % (capacity))
-#define SHARD_IDX(hash) ((hash) & ((1 << (LOG2_SHARD_COUNT)) - 1))
-
-void StaticMetadata::HashInit() {
- uint32_t k_hash = grpc_slice_hash_internal(kv_.key);
- uint32_t v_hash = grpc_slice_hash_internal(kv_.value);
- hash_ = GRPC_MDSTR_KV_HASH(k_hash, v_hash);
-}
-
-AllocatedMetadata::AllocatedMetadata(const grpc_slice& key,
- const grpc_slice& value)
- : RefcountedMdBase(grpc_slice_ref_internal(key),
- grpc_slice_ref_internal(value)) {
-#ifndef NDEBUG
- TraceAtStart("ALLOC_MD");
-#endif
-}
-
-AllocatedMetadata::AllocatedMetadata(const grpc_slice& key,
- const grpc_slice& value, const NoRefKey*)
- : RefcountedMdBase(key, grpc_slice_ref_internal(value)) {
-#ifndef NDEBUG
- TraceAtStart("ALLOC_MD_NOREF_KEY");
-#endif
-}
-
-AllocatedMetadata::AllocatedMetadata(
- const grpc_core::ManagedMemorySlice& key,
- const grpc_core::UnmanagedMemorySlice& value)
- : RefcountedMdBase(key, value) {
-#ifndef NDEBUG
- TraceAtStart("ALLOC_MD_NOREF_KEY_VAL");
-#endif
-}
-
-AllocatedMetadata::AllocatedMetadata(
- const grpc_core::ExternallyManagedSlice& key,
- const grpc_core::UnmanagedMemorySlice& value)
- : RefcountedMdBase(key, value) {
-#ifndef NDEBUG
- TraceAtStart("ALLOC_MD_NOREF_KEY_VAL");
-#endif
-}
-
-AllocatedMetadata::~AllocatedMetadata() {
- grpc_slice_unref_internal(key());
- grpc_slice_unref_internal(value());
- void* user_data = user_data_.data.Load(grpc_core::MemoryOrder::RELAXED);
- if (user_data) {
- destroy_user_data_func destroy_user_data =
- user_data_.destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED);
- destroy_user_data(user_data);
- }
-}
-
-#ifndef NDEBUG
-void grpc_core::RefcountedMdBase::TraceAtStart(const char* tag) {
- if (grpc_trace_metadata.enabled()) {
- char* key_str = grpc_slice_to_c_string(key());
- char* value_str = grpc_slice_to_c_string(value());
- gpr_log(GPR_DEBUG, "mdelem %s:%p:%" PRIdPTR ": '%s' = '%s'", tag, this,
- RefValue(), key_str, value_str);
- gpr_free(key_str);
- gpr_free(value_str);
- }
-}
-#endif
-
-InternedMetadata::InternedMetadata(const grpc_slice& key,
- const grpc_slice& value, uint32_t hash,
- InternedMetadata* next)
- : RefcountedMdBase(grpc_slice_ref_internal(key),
- grpc_slice_ref_internal(value), hash),
- link_(next) {
-#ifndef NDEBUG
- TraceAtStart("INTERNED_MD");
-#endif
-}
-
-InternedMetadata::InternedMetadata(const grpc_slice& key,
- const grpc_slice& value, uint32_t hash,
- InternedMetadata* next, const NoRefKey*)
- : RefcountedMdBase(key, grpc_slice_ref_internal(value), hash), link_(next) {
-#ifndef NDEBUG
- TraceAtStart("INTERNED_MD_NOREF_KEY");
-#endif
-}
-
-InternedMetadata::~InternedMetadata() {
- grpc_slice_unref_internal(key());
- grpc_slice_unref_internal(value());
- void* user_data = user_data_.data.Load(grpc_core::MemoryOrder::RELAXED);
- if (user_data) {
- destroy_user_data_func destroy_user_data =
- user_data_.destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED);
- destroy_user_data(user_data);
- }
-}
-
-size_t InternedMetadata::CleanupLinkedMetadata(
- InternedMetadata::BucketLink* head) {
- size_t num_freed = 0;
- InternedMetadata::BucketLink* prev_next = head;
- InternedMetadata *md, *next;
-
- for (md = head->next; md; md = next) {
- next = md->link_.next;
- if (md->AllRefsDropped()) {
- prev_next->next = next;
- delete md;
- num_freed++;
- } else {
- prev_next = &md->link_;
- }
- }
- return num_freed;
-}
-
-typedef struct mdtab_shard {
- gpr_mu mu;
- InternedMetadata::BucketLink* elems;
- size_t count;
- size_t capacity;
- /** Estimate of the number of unreferenced mdelems in the hash table.
- This will eventually converge to the exact number, but it's instantaneous
- accuracy is not guaranteed */
- gpr_atm free_estimate;
-} mdtab_shard;
-
-static mdtab_shard g_shards[SHARD_COUNT];
-
-static void gc_mdtab(mdtab_shard* shard);
-
-void grpc_mdctx_global_init(void) {
- /* initialize shards */
- for (size_t i = 0; i < SHARD_COUNT; i++) {
- mdtab_shard* shard = &g_shards[i];
- gpr_mu_init(&shard->mu);
- shard->count = 0;
- gpr_atm_no_barrier_store(&shard->free_estimate, 0);
- shard->capacity = INITIAL_SHARD_CAPACITY;
- shard->elems = static_cast<InternedMetadata::BucketLink*>(
- gpr_zalloc(sizeof(*shard->elems) * shard->capacity));
- }
-}
-
-void grpc_mdctx_global_shutdown() {
- for (size_t i = 0; i < SHARD_COUNT; i++) {
- mdtab_shard* shard = &g_shards[i];
- gpr_mu_destroy(&shard->mu);
- gc_mdtab(shard);
- if (shard->count != 0) {
- gpr_log(GPR_ERROR, "WARNING: %" PRIuPTR " metadata elements were leaked",
- shard->count);
- for (size_t 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.
-#ifndef GRPC_ASAN_ENABLED
- GPR_DEBUG_ASSERT(shard->count == 0);
-#endif
- gpr_free(shard->elems);
- }
-}
-
-#ifndef NDEBUG
-static int is_mdelem_static(grpc_mdelem e) {
- return reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) >=
- &grpc_static_mdelem_table()[0] &&
- reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) <
- &grpc_static_mdelem_table()[GRPC_STATIC_MDELEM_COUNT];
-}
-#endif
-
-void InternedMetadata::RefWithShardLocked(mdtab_shard* shard) {
-#ifndef NDEBUG
- if (grpc_trace_metadata.enabled()) {
- char* key_str = grpc_slice_to_c_string(key());
- char* value_str = grpc_slice_to_c_string(value());
- intptr_t value = RefValue();
- gpr_log(__FILE__, __LINE__, GPR_LOG_SEVERITY_DEBUG,
- "mdelem REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", this,
- value, value + 1, key_str, value_str);
- gpr_free(key_str);
- gpr_free(value_str);
- }
-#endif
- if (FirstRef()) {
- gpr_atm_no_barrier_fetch_add(&shard->free_estimate, -1);
- }
-}
-
-static void gc_mdtab(mdtab_shard* shard) {
- GPR_TIMER_SCOPE("gc_mdtab", 0);
- size_t num_freed = 0;
- for (size_t i = 0; i < shard->capacity; ++i) {
- intptr_t freed = InternedMetadata::CleanupLinkedMetadata(&shard->elems[i]);
- num_freed += freed;
- shard->count -= freed;
- }
- gpr_atm_no_barrier_fetch_add(&shard->free_estimate,
- -static_cast<intptr_t>(num_freed));
-}
-
-static void grow_mdtab(mdtab_shard* shard) {
- GPR_TIMER_SCOPE("grow_mdtab", 0);
-
- size_t capacity = shard->capacity * 2;
- size_t i;
- InternedMetadata::BucketLink* mdtab;
- InternedMetadata *md, *next;
- uint32_t hash;
-
- mdtab = static_cast<InternedMetadata::BucketLink*>(
- gpr_zalloc(sizeof(InternedMetadata::BucketLink) * capacity));
-
- for (i = 0; i < shard->capacity; i++) {
- for (md = shard->elems[i].next; md; md = next) {
- size_t idx;
- hash = md->hash();
- next = md->bucket_next();
- idx = TABLE_IDX(hash, capacity);
- md->set_bucket_next(mdtab[idx].next);
- mdtab[idx].next = md;
- }
- }
- gpr_free(shard->elems);
- shard->elems = mdtab;
- shard->capacity = capacity;
-}
-
-static void rehash_mdtab(mdtab_shard* shard) {
- if (gpr_atm_no_barrier_load(&shard->free_estimate) >
- static_cast<gpr_atm>(shard->capacity / 4)) {
- gc_mdtab(shard);
- } else {
- grow_mdtab(shard);
- }
-}
-
-template <bool key_definitely_static, bool value_definitely_static = false>
-static grpc_mdelem md_create_maybe_static(const grpc_slice& key,
- const grpc_slice& value);
-template <bool key_definitely_static>
-static grpc_mdelem md_create_must_intern(const grpc_slice& key,
- const grpc_slice& value,
- uint32_t hash);
-
-template <bool key_definitely_static, bool value_definitely_static = false>
-static grpc_mdelem md_create(
- const grpc_slice& key, const grpc_slice& value,
- grpc_mdelem_data* compatible_external_backing_store) {
- // Ensure slices are, in fact, static if we claimed they were.
- GPR_DEBUG_ASSERT(!key_definitely_static ||
- GRPC_IS_STATIC_METADATA_STRING(key));
- GPR_DEBUG_ASSERT(!value_definitely_static ||
- GRPC_IS_STATIC_METADATA_STRING(value));
- const bool key_is_interned =
- key_definitely_static || grpc_slice_is_interned(key);
- const bool value_is_interned =
- value_definitely_static || grpc_slice_is_interned(value);
- // External storage if either slice is not interned and the caller already
- // created a backing store. If no backing store, we allocate one.
- if (!key_is_interned || !value_is_interned) {
- if (compatible_external_backing_store != nullptr) {
- // Caller provided backing store.
- return GRPC_MAKE_MDELEM(compatible_external_backing_store,
- GRPC_MDELEM_STORAGE_EXTERNAL);
- } else {
- // We allocate backing store.
- return key_definitely_static
- ? GRPC_MAKE_MDELEM(
- new AllocatedMetadata(
- key, value,
- static_cast<const AllocatedMetadata::NoRefKey*>(
- nullptr)),
- GRPC_MDELEM_STORAGE_ALLOCATED)
- : GRPC_MAKE_MDELEM(new AllocatedMetadata(key, value),
- GRPC_MDELEM_STORAGE_ALLOCATED);
- }
- }
- return md_create_maybe_static<key_definitely_static, value_definitely_static>(
- key, value);
-}
-
-template <bool key_definitely_static, bool value_definitely_static>
-static grpc_mdelem md_create_maybe_static(const grpc_slice& key,
- const grpc_slice& value) {
- // Ensure slices are, in fact, static if we claimed they were.
- GPR_DEBUG_ASSERT(!key_definitely_static ||
- GRPC_IS_STATIC_METADATA_STRING(key));
- GPR_DEBUG_ASSERT(!value_definitely_static ||
- GRPC_IS_STATIC_METADATA_STRING(value));
- GPR_DEBUG_ASSERT(key.refcount != nullptr);
- GPR_DEBUG_ASSERT(value.refcount != nullptr);
-
- const bool key_is_static_mdstr =
- key_definitely_static ||
- key.refcount->GetType() == grpc_slice_refcount::Type::STATIC;
- const bool value_is_static_mdstr =
- value_definitely_static ||
- value.refcount->GetType() == grpc_slice_refcount::Type::STATIC;
-
- const intptr_t kidx = GRPC_STATIC_METADATA_INDEX(key);
-
- // Not all static slice input yields a statically stored metadata element.
- if (key_is_static_mdstr && value_is_static_mdstr) {
- grpc_mdelem static_elem = grpc_static_mdelem_for_static_strings(
- kidx, GRPC_STATIC_METADATA_INDEX(value));
- if (!GRPC_MDISNULL(static_elem)) {
- return static_elem;
- }
- }
-
- uint32_t khash = key_definitely_static
- ? grpc_static_metadata_hash_values[kidx]
- : grpc_slice_hash_refcounted(key);
-
- uint32_t hash = GRPC_MDSTR_KV_HASH(khash, grpc_slice_hash_refcounted(value));
- return md_create_must_intern<key_definitely_static>(key, value, hash);
-}
-
-template <bool key_definitely_static>
-static grpc_mdelem md_create_must_intern(const grpc_slice& key,
- const grpc_slice& value,
- uint32_t hash) {
- // Here, we know both key and value are both at least interned, and both
- // possibly static. We know that anything inside the shared interned table is
- // also at least interned (and maybe static). Note that equality for a static
- // and interned slice implies that they are both the same exact slice.
- // The same applies to a pair of interned slices, or a pair of static slices.
- // Rather than run the full equality check, we can therefore just do a pointer
- // comparison of the refcounts.
- InternedMetadata* md;
- mdtab_shard* shard = &g_shards[SHARD_IDX(hash)];
- size_t idx;
-
- GPR_TIMER_SCOPE("grpc_mdelem_from_metadata_strings", 0);
-
- gpr_mu_lock(&shard->mu);
-
- idx = TABLE_IDX(hash, shard->capacity);
- /* search for an existing pair */
- for (md = shard->elems[idx].next; md; md = md->bucket_next()) {
- if (grpc_slice_static_interned_equal(key, md->key()) &&
- grpc_slice_static_interned_equal(value, md->value())) {
- md->RefWithShardLocked(shard);
- gpr_mu_unlock(&shard->mu);
- return GRPC_MAKE_MDELEM(md, GRPC_MDELEM_STORAGE_INTERNED);
- }
- }
-
- /* not found: create a new pair */
- md = key_definitely_static
- ? new InternedMetadata(
- key, value, hash, shard->elems[idx].next,
- static_cast<const InternedMetadata::NoRefKey*>(nullptr))
- : new InternedMetadata(key, value, hash, shard->elems[idx].next);
- shard->elems[idx].next = md;
- shard->count++;
-
- if (shard->count > shard->capacity * 2) {
- rehash_mdtab(shard);
- }
-
- gpr_mu_unlock(&shard->mu);
-
- return GRPC_MAKE_MDELEM(md, GRPC_MDELEM_STORAGE_INTERNED);
-}
-
-grpc_mdelem grpc_mdelem_create(
- const grpc_slice& key, const grpc_slice& value,
- grpc_mdelem_data* compatible_external_backing_store) {
- return md_create<false>(key, value, compatible_external_backing_store);
-}
-
-grpc_mdelem grpc_mdelem_create(
- const grpc_core::StaticMetadataSlice& key, const grpc_slice& value,
- grpc_mdelem_data* compatible_external_backing_store) {
- return md_create<true>(key, value, compatible_external_backing_store);
-}
-
-/* Create grpc_mdelem from provided slices. We specify via template parameter
- whether we know that the input key is static or not. If it is, we short
- circuit various comparisons and a no-op unref. */
-template <bool key_definitely_static>
-static grpc_mdelem md_from_slices(const grpc_slice& key,
- const grpc_slice& value) {
- // Ensure key is, in fact, static if we claimed it was.
- GPR_DEBUG_ASSERT(!key_definitely_static ||
- GRPC_IS_STATIC_METADATA_STRING(key));
- grpc_mdelem out = md_create<key_definitely_static>(key, value, nullptr);
- if (!key_definitely_static) {
- grpc_slice_unref_internal(key);
- }
- grpc_slice_unref_internal(value);
- return out;
-}
-
-grpc_mdelem grpc_mdelem_from_slices(const grpc_slice& key,
- const grpc_slice& value) {
- return md_from_slices</*key_definitely_static=*/false>(key, value);
-}
-
-grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key,
- const grpc_slice& value) {
- return md_from_slices</*key_definitely_static=*/true>(key, value);
-}
-
-grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::StaticMetadataSlice& key,
- const grpc_core::StaticMetadataSlice& value) {
- grpc_mdelem out = md_create_maybe_static<true, true>(key, value);
- return out;
-}
-
-grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::StaticMetadataSlice& key,
- const grpc_core::ManagedMemorySlice& value) {
- // TODO(arjunroy): We can save the unref if md_create_maybe_static ended up
- // creating a new interned metadata. But otherwise - we need this here.
- grpc_mdelem out = md_create_maybe_static<true>(key, value);
- grpc_slice_unref_internal(value);
- return out;
-}
-
-grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::ManagedMemorySlice& key,
- const grpc_core::ManagedMemorySlice& value) {
- grpc_mdelem out = md_create_maybe_static<false>(key, value);
- // TODO(arjunroy): We can save the unref if md_create_maybe_static ended up
- // creating a new interned metadata. But otherwise - we need this here.
- grpc_slice_unref_internal(key);
- grpc_slice_unref_internal(value);
- return out;
-}
-
-grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_metadata* metadata) {
- bool changed = false;
- grpc_slice key_slice =
- grpc_slice_maybe_static_intern(metadata->key, &changed);
- grpc_slice value_slice =
- grpc_slice_maybe_static_intern(metadata->value, &changed);
- return grpc_mdelem_create(
- key_slice, value_slice,
- changed ? nullptr : reinterpret_cast<grpc_mdelem_data*>(metadata));
-}
-
-static void* get_user_data(UserData* user_data, void (*destroy_func)(void*)) {
- if (user_data->destroy_user_data.Load(grpc_core::MemoryOrder::ACQUIRE) ==
- destroy_func) {
- return user_data->data.Load(grpc_core::MemoryOrder::RELAXED);
- } else {
- return nullptr;
- }
-}
-
-void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*destroy_func)(void*)) {
- switch (GRPC_MDELEM_STORAGE(md)) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- return nullptr;
- case GRPC_MDELEM_STORAGE_STATIC:
- return reinterpret_cast<void*>(
- grpc_static_mdelem_user_data
- [reinterpret_cast<grpc_core::StaticMetadata*>(
- GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table()]);
- case GRPC_MDELEM_STORAGE_ALLOCATED: {
- auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
- return get_user_data(am->user_data(), destroy_func);
- }
- case GRPC_MDELEM_STORAGE_INTERNED: {
- auto* im = reinterpret_cast<InternedMetadata*> GRPC_MDELEM_DATA(md);
- return get_user_data(im->user_data(), destroy_func);
- }
- }
- GPR_UNREACHABLE_CODE(return nullptr);
-}
-
-static void* set_user_data(UserData* ud, void (*destroy_func)(void*),
- void* data) {
- GPR_ASSERT((data == nullptr) == (destroy_func == nullptr));
- grpc_core::ReleasableMutexLock lock(&ud->mu_user_data);
- if (ud->destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED)) {
- /* user data can only be set once */
- lock.Release();
- if (destroy_func != nullptr) {
- destroy_func(data);
- }
- return ud->data.Load(grpc_core::MemoryOrder::RELAXED);
- }
- ud->data.Store(data, grpc_core::MemoryOrder::RELAXED);
- ud->destroy_user_data.Store(destroy_func, grpc_core::MemoryOrder::RELEASE);
- return data;
-}
-
-void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
- void* data) {
- switch (GRPC_MDELEM_STORAGE(md)) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- destroy_func(data);
- return nullptr;
- case GRPC_MDELEM_STORAGE_STATIC:
- destroy_func(data);
- return reinterpret_cast<void*>(
- grpc_static_mdelem_user_data
- [reinterpret_cast<grpc_core::StaticMetadata*>(
- GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table()]);
- case GRPC_MDELEM_STORAGE_ALLOCATED: {
- auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
- return set_user_data(am->user_data(), destroy_func, data);
- }
- case GRPC_MDELEM_STORAGE_INTERNED: {
- auto* im = reinterpret_cast<InternedMetadata*> GRPC_MDELEM_DATA(md);
- GPR_DEBUG_ASSERT(!is_mdelem_static(md));
- return set_user_data(im->user_data(), destroy_func, data);
- }
- }
- GPR_UNREACHABLE_CODE(return nullptr);
-}
-
-bool grpc_mdelem_eq(grpc_mdelem a, grpc_mdelem b) {
- if (a.payload == b.payload) return true;
- if (GRPC_MDELEM_IS_INTERNED(a) && GRPC_MDELEM_IS_INTERNED(b)) return false;
- if (GRPC_MDISNULL(a) || GRPC_MDISNULL(b)) return false;
- return grpc_slice_eq(GRPC_MDKEY(a), GRPC_MDKEY(b)) &&
- grpc_slice_eq(GRPC_MDVALUE(a), GRPC_MDVALUE(b));
-}
-
-static void note_disposed_interned_metadata(uint32_t hash) {
- mdtab_shard* shard = &g_shards[SHARD_IDX(hash)];
- gpr_atm_no_barrier_fetch_add(&shard->free_estimate, 1);
-}
-
-void grpc_mdelem_do_unref(grpc_mdelem gmd DEBUG_ARGS) {
- switch (GRPC_MDELEM_STORAGE(gmd)) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- case GRPC_MDELEM_STORAGE_STATIC:
- return;
- case GRPC_MDELEM_STORAGE_INTERNED: {
- auto* md = reinterpret_cast<InternedMetadata*> GRPC_MDELEM_DATA(gmd);
- uint32_t hash = md->hash();
- if (GPR_UNLIKELY(md->Unref(FWD_DEBUG_ARGS))) {
- /* once the refcount hits zero, some other thread can come along and
- free md at any time: it's unsafe from this point on to access it */
- note_disposed_interned_metadata(hash);
- }
- break;
- }
- case GRPC_MDELEM_STORAGE_ALLOCATED: {
- auto* md = reinterpret_cast<AllocatedMetadata*> GRPC_MDELEM_DATA(gmd);
- if (GPR_UNLIKELY(md->Unref(FWD_DEBUG_ARGS))) {
- delete md;
- }
- break;
- }
- }
-}
-
-void grpc_mdelem_on_final_unref(grpc_mdelem_data_storage storage, void* ptr,
- uint32_t hash DEBUG_ARGS) {
-#ifndef NDEBUG
- (void)file;
- (void)line;
-#endif
- switch (storage) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- case GRPC_MDELEM_STORAGE_STATIC:
- return;
- case GRPC_MDELEM_STORAGE_INTERNED: {
- note_disposed_interned_metadata(hash);
- break;
- }
- case GRPC_MDELEM_STORAGE_ALLOCATED: {
- delete reinterpret_cast<AllocatedMetadata*>(ptr);
- break;
- }
- }
-}
diff --git a/grpc/src/core/lib/transport/metadata.h b/grpc/src/core/lib/transport/metadata.h
deleted file mode 100644
index e6de4ea9..00000000
--- a/grpc/src/core/lib/transport/metadata.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- *
- * 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_TRANSPORT_METADATA_H
-#define GRPC_CORE_LIB_TRANSPORT_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/impl/codegen/log.h>
-
-#include <grpc/grpc.h>
-#include <grpc/slice.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/slice/slice_utils.h"
-
-extern grpc_core::DebugOnlyTraceFlag grpc_trace_metadata;
-
-/* This file provides a mechanism for tracking metadata through the grpc stack.
- It's not intended for consumption outside of the library.
-
- Metadata is tracked in the context of a sharded global grpc_mdctx. The
- context tracks unique strings (grpc_mdstr) and pairs of strings
- (grpc_mdelem). Any of these objects can be checked for equality by comparing
- their pointers. These objects are reference counted.
-
- grpc_mdelem can additionally store a (non-NULL) user data pointer. This
- pointer is intended to be used to cache semantic meaning of a metadata
- element. For example, an OAuth token may cache the credentials it represents
- and the time at which it expires in the mdelem user data.
-
- Combining this metadata cache and the hpack compression table allows us to
- simply lookup complete preparsed objects quickly, incurring a few atomic
- ops per metadata element on the fast path.
-
- grpc_mdelem instances MAY live longer than their refcount implies, and are
- garbage collected periodically, meaning cached data can easily outlive a
- single request.
-
- STATIC METADATA: in static_metadata.h we declare a set of static metadata.
- These mdelems and mdstrs are available via pre-declared code generated macros
- and are available to code anywhere between grpc_init() and grpc_shutdown().
- They are not refcounted, but can be passed to _ref and _unref functions
- declared here - in which case those functions are effectively no-ops. */
-
-/* Forward declarations */
-typedef struct grpc_mdelem grpc_mdelem;
-
-/* if changing this, make identical changes in:
- - grpc_core::{InternedMetadata, AllocatedMetadata}
- - grpc_metadata in grpc_types.h */
-typedef struct grpc_mdelem_data {
- const grpc_slice key;
- const grpc_slice value;
- /* there is a private part to this in metadata.c */
-} grpc_mdelem_data;
-
-/* GRPC_MDELEM_STORAGE_* enum values that can be treated as interned always have
- this bit set in their integer value */
-#define GRPC_MDELEM_STORAGE_INTERNED_BIT 1
-
-/* External and static storage metadata has no refcount to ref/unref. Allocated
- * and interned metadata do have a refcount. Metadata ref and unref methods use
- * a switch statement on this enum to determine which behaviour to execute.
- * Keeping the no-ref cases together and the ref-cases together leads to
- * slightly better code generation (9 inlined instructions rather than 10). */
-typedef enum {
- /* memory pointed to by grpc_mdelem::payload is owned by an external system */
- GRPC_MDELEM_STORAGE_EXTERNAL = 0,
- /* memory is in the static metadata table */
- GRPC_MDELEM_STORAGE_STATIC = GRPC_MDELEM_STORAGE_INTERNED_BIT,
- /* memory pointed to by grpc_mdelem::payload is allocated by the metadata
- system */
- GRPC_MDELEM_STORAGE_ALLOCATED = 2,
- /* memory pointed to by grpc_mdelem::payload is interned by the metadata
- system */
- GRPC_MDELEM_STORAGE_INTERNED = 2 | GRPC_MDELEM_STORAGE_INTERNED_BIT,
-} grpc_mdelem_data_storage;
-
-struct grpc_mdelem {
- /* a grpc_mdelem_data* generally, with the two lower bits signalling memory
- ownership as per grpc_mdelem_data_storage */
- uintptr_t payload;
-};
-
-#define GRPC_MDELEM_DATA(md) ((grpc_mdelem_data*)((md).payload & ~(uintptr_t)3))
-#define GRPC_MDELEM_STORAGE(md) \
- ((grpc_mdelem_data_storage)((md).payload & (uintptr_t)3))
-#ifdef __cplusplus
-#define GRPC_MAKE_MDELEM(data, storage) \
- (grpc_mdelem{((uintptr_t)(data)) | ((uintptr_t)(storage))})
-#else
-#define GRPC_MAKE_MDELEM(data, storage) \
- ((grpc_mdelem){((uintptr_t)(data)) | ((uintptr_t)(storage))})
-#endif
-#define GRPC_MDELEM_IS_INTERNED(md) \
- ((grpc_mdelem_data_storage)((md).payload & \
- (uintptr_t)GRPC_MDELEM_STORAGE_INTERNED_BIT))
-
-/* Given arbitrary input slices, create a grpc_mdelem object. The caller refs
- * the input slices; we unref them. This method is always safe to call; however,
- * if we know data about the slices in question (e.g. if we knew our key was
- * static) we can call specializations that save on cycle count. */
-grpc_mdelem grpc_mdelem_from_slices(const grpc_slice& key,
- const grpc_slice& value);
-
-/* Like grpc_mdelem_from_slices, but we know that key is a static slice. This
- saves us a few branches and a no-op call to md_unref() for the key. */
-grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key,
- const grpc_slice& value);
-
-/* Like grpc_mdelem_from_slices, but key is static and val is static. */
-grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::StaticMetadataSlice& key,
- const grpc_core::StaticMetadataSlice& value);
-
-/* Like grpc_mdelem_from_slices, but key is static and val is interned. */
-grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key,
- const grpc_core::ManagedMemorySlice& value);
-
-/* Like grpc_mdelem_from_slices, but key and val are interned. */
-grpc_mdelem grpc_mdelem_from_slices(const grpc_core::ManagedMemorySlice& key,
- const grpc_core::ManagedMemorySlice& value);
-
-/* Cheaply convert a grpc_metadata to a grpc_mdelem; may use the grpc_metadata
- object as backing storage (so lifetimes should align) */
-grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_metadata* metadata);
-
-/* Does not unref the slices; if a new non-interned mdelem is needed, allocates
- one if compatible_external_backing_store is NULL, or uses
- compatible_external_backing_store if it is non-NULL (in which case it's the
- users responsibility to ensure that it outlives usage) */
-grpc_mdelem grpc_mdelem_create(
- const grpc_slice& key, const grpc_slice& value,
- grpc_mdelem_data* compatible_external_backing_store);
-
-/* Like grpc_mdelem_create, but we know that key is static. */
-grpc_mdelem grpc_mdelem_create(
- const grpc_core::StaticMetadataSlice& key, const grpc_slice& value,
- grpc_mdelem_data* compatible_external_backing_store);
-
-#define GRPC_MDKEY(md) (GRPC_MDELEM_DATA(md)->key)
-#define GRPC_MDVALUE(md) (GRPC_MDELEM_DATA(md)->value)
-
-bool grpc_mdelem_eq(grpc_mdelem a, grpc_mdelem b);
-/* Often we compare metadata where we know a-priori that the second parameter is
- * static, and that the keys match. This most commonly happens when processing
- * metadata batch callouts in initial/trailing filters. In this case, fastpath
- * grpc_mdelem_eq and remove unnecessary checks. */
-inline bool grpc_mdelem_static_value_eq(grpc_mdelem a, grpc_mdelem b_static) {
- if (a.payload == b_static.payload) return true;
- return grpc_slice_eq_static_interned(GRPC_MDVALUE(a), GRPC_MDVALUE(b_static));
-}
-#define GRPC_MDISNULL(md) (GRPC_MDELEM_DATA(md) == NULL)
-
-inline bool grpc_mdelem_both_interned_eq(grpc_mdelem a_interned,
- grpc_mdelem b_interned) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(a_interned) ||
- GRPC_MDISNULL(a_interned));
- GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(b_interned) ||
- GRPC_MDISNULL(b_interned));
- return a_interned.payload == b_interned.payload;
-}
-
-/* Mutator and accessor for grpc_mdelem user data. The destructor function
- is used as a type tag and is checked during user_data fetch. */
-void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*if_destroy_func)(void*));
-void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
- void* data);
-
-// Defined in metadata.cc.
-struct mdtab_shard;
-
-#ifndef NDEBUG
-void grpc_mdelem_trace_ref(void* md, const grpc_slice& key,
- const grpc_slice& value, intptr_t refcnt,
- const char* file, int line);
-void grpc_mdelem_trace_unref(void* md, const grpc_slice& key,
- const grpc_slice& value, intptr_t refcnt,
- const char* file, int line);
-#endif
-namespace grpc_core {
-
-typedef void (*destroy_user_data_func)(void* data);
-
-struct UserData {
- Mutex mu_user_data;
- grpc_core::Atomic<destroy_user_data_func> destroy_user_data;
- grpc_core::Atomic<void*> data;
-};
-
-class StaticMetadata {
- public:
- StaticMetadata(const grpc_slice& key, const grpc_slice& value, uintptr_t idx)
- : kv_({key, value}), hash_(0), static_idx_(idx) {}
-
- const grpc_mdelem_data& data() const { return kv_; }
-
- void HashInit();
- uint32_t hash() { return hash_; }
- uintptr_t StaticIndex() { return static_idx_; }
-
- private:
- grpc_mdelem_data kv_;
-
- /* private only data */
- uint32_t hash_;
- uintptr_t static_idx_;
-};
-
-class RefcountedMdBase {
- public:
- RefcountedMdBase(const grpc_slice& key, const grpc_slice& value)
- : key_(key), value_(value), refcnt_(1) {}
- RefcountedMdBase(const grpc_slice& key, const grpc_slice& value,
- uint32_t hash)
- : key_(key), value_(value), refcnt_(1), hash_(hash) {}
-
- const grpc_slice& key() const { return key_; }
- const grpc_slice& value() const { return value_; }
- uint32_t hash() { return hash_; }
-
-#ifndef NDEBUG
- void Ref(const char* file, int line) {
- grpc_mdelem_trace_ref(this, key_, value_, RefValue(), file, line);
- const intptr_t prior = refcnt_.FetchAdd(1, MemoryOrder::RELAXED);
- GPR_ASSERT(prior > 0);
- }
- bool Unref(const char* file, int line) {
- grpc_mdelem_trace_unref(this, key_, value_, RefValue(), file, line);
- return Unref();
- }
-#endif
- void Ref() {
- /* we can assume the ref count is >= 1 as the application is calling
- this function - meaning that no adjustment to mdtab_free is necessary,
- simplifying the logic here to be just an atomic increment */
- refcnt_.FetchAdd(1, MemoryOrder::RELAXED);
- }
- bool Unref() {
- const intptr_t prior = refcnt_.FetchSub(1, MemoryOrder::ACQ_REL);
- GPR_DEBUG_ASSERT(prior > 0);
- return prior == 1;
- }
-
- protected:
-#ifndef NDEBUG
- void TraceAtStart(const char* tag);
-#endif
-
- intptr_t RefValue() { return refcnt_.Load(MemoryOrder::RELAXED); }
- bool AllRefsDropped() { return refcnt_.Load(MemoryOrder::ACQUIRE) == 0; }
- bool FirstRef() { return refcnt_.FetchAdd(1, MemoryOrder::RELAXED) == 0; }
-
- private:
- /* must be byte compatible with grpc_mdelem_data */
- grpc_slice key_;
- grpc_slice value_;
- grpc_core::Atomic<intptr_t> refcnt_;
- uint32_t hash_ = 0;
-};
-
-class InternedMetadata : public RefcountedMdBase {
- public:
- // TODO(arjunroy): Change to use strongly typed slices instead.
- struct NoRefKey {};
- struct BucketLink {
- explicit BucketLink(InternedMetadata* md) : next(md) {}
-
- InternedMetadata* next = nullptr;
- };
- InternedMetadata(const grpc_slice& key, const grpc_slice& value,
- uint32_t hash, InternedMetadata* next);
- InternedMetadata(const grpc_slice& key, const grpc_slice& value,
- uint32_t hash, InternedMetadata* next, const NoRefKey*);
-
- ~InternedMetadata();
- void RefWithShardLocked(mdtab_shard* shard);
- UserData* user_data() { return &user_data_; }
- InternedMetadata* bucket_next() { return link_.next; }
- void set_bucket_next(InternedMetadata* md) { link_.next = md; }
-
- static size_t CleanupLinkedMetadata(BucketLink* head);
-
- private:
- UserData user_data_;
- BucketLink link_;
-};
-
-/* Shadow structure for grpc_mdelem_data for allocated elements */
-class AllocatedMetadata : public RefcountedMdBase {
- public:
- // TODO(arjunroy): Change to use strongly typed slices instead.
- struct NoRefKey {};
- AllocatedMetadata(const grpc_slice& key, const grpc_slice& value);
- AllocatedMetadata(const grpc_core::ManagedMemorySlice& key,
- const grpc_core::UnmanagedMemorySlice& value);
- AllocatedMetadata(const grpc_core::ExternallyManagedSlice& key,
- const grpc_core::UnmanagedMemorySlice& value);
- AllocatedMetadata(const grpc_slice& key, const grpc_slice& value,
- const NoRefKey*);
- ~AllocatedMetadata();
-
- UserData* user_data() { return &user_data_; }
-
- private:
- UserData user_data_;
-};
-
-} // namespace grpc_core
-
-#ifndef NDEBUG
-#define GRPC_MDELEM_REF(s) grpc_mdelem_ref((s), __FILE__, __LINE__)
-inline grpc_mdelem grpc_mdelem_ref(grpc_mdelem gmd, const char* file,
- int line) {
-#else // ifndef NDEBUG
-#define GRPC_MDELEM_REF(s) grpc_mdelem_ref((s))
-inline grpc_mdelem grpc_mdelem_ref(grpc_mdelem gmd) {
-#endif // ifndef NDEBUG
- switch (GRPC_MDELEM_STORAGE(gmd)) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- case GRPC_MDELEM_STORAGE_STATIC:
- break;
- case GRPC_MDELEM_STORAGE_INTERNED: {
- auto* md =
- reinterpret_cast<grpc_core::InternedMetadata*> GRPC_MDELEM_DATA(gmd);
- /* use C assert to have this removed in opt builds */
-#ifndef NDEBUG
- md->Ref(file, line);
-#else
- md->Ref();
-#endif
- break;
- }
- case GRPC_MDELEM_STORAGE_ALLOCATED: {
- auto* md =
- reinterpret_cast<grpc_core::AllocatedMetadata*> GRPC_MDELEM_DATA(gmd);
-#ifndef NDEBUG
- md->Ref(file, line);
-#else
- md->Ref();
-#endif
- break;
- }
- }
- return gmd;
-}
-
-#ifndef NDEBUG
-#define GRPC_MDELEM_UNREF(s) grpc_mdelem_unref((s), __FILE__, __LINE__)
-void grpc_mdelem_on_final_unref(grpc_mdelem_data_storage storage, void* ptr,
- uint32_t hash, const char* file, int line);
-inline void grpc_mdelem_unref(grpc_mdelem gmd, const char* file, int line) {
-#else
-#define GRPC_MDELEM_UNREF(s) grpc_mdelem_unref((s))
-void grpc_mdelem_on_final_unref(grpc_mdelem_data_storage storage, void* ptr,
- uint32_t hash);
-inline void grpc_mdelem_unref(grpc_mdelem gmd) {
-#endif
- const grpc_mdelem_data_storage storage = GRPC_MDELEM_STORAGE(gmd);
- switch (storage) {
- case GRPC_MDELEM_STORAGE_EXTERNAL:
- case GRPC_MDELEM_STORAGE_STATIC:
- return;
- case GRPC_MDELEM_STORAGE_INTERNED:
- case GRPC_MDELEM_STORAGE_ALLOCATED:
- auto* md =
- reinterpret_cast<grpc_core::RefcountedMdBase*> GRPC_MDELEM_DATA(gmd);
- /* once the refcount hits zero, some other thread can come along and
- free an interned md at any time: it's unsafe from this point on to
- access it so we read the hash now. */
- uint32_t hash = md->hash();
-#ifndef NDEBUG
- if (GPR_UNLIKELY(md->Unref(file, line))) {
- grpc_mdelem_on_final_unref(storage, md, hash, file, line);
-#else
- if (GPR_UNLIKELY(md->Unref())) {
- grpc_mdelem_on_final_unref(storage, md, hash);
-#endif
- }
- return;
- }
-}
-
-#define GRPC_MDNULL GRPC_MAKE_MDELEM(NULL, GRPC_MDELEM_STORAGE_EXTERNAL)
-
-/* We add 32 bytes of padding as per RFC-7540 section 6.5.2. */
-#define GRPC_MDELEM_LENGTH(e) \
- (GRPC_SLICE_LENGTH(GRPC_MDKEY((e))) + GRPC_SLICE_LENGTH(GRPC_MDVALUE((e))) + \
- 32)
-
-#define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash))
-
-void grpc_mdctx_global_init(void);
-void grpc_mdctx_global_shutdown();
-
-/* Like grpc_mdelem_from_slices, but we know that key is a static or interned
- slice and value is not static or interned. This gives us an inlinable
- fastpath - we know we must allocate metadata now, and that we do not need to
- unref the value (rather, we just transfer the ref). We can avoid a ref since:
- 1) the key slice is passed in already ref'd
- 2) We're guaranteed to create a new Allocated slice, thus meaning the
- ref can be considered 'transferred'.*/
-inline grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::ManagedMemorySlice& key,
- const grpc_core::UnmanagedMemorySlice& value) {
- using grpc_core::AllocatedMetadata;
- return GRPC_MAKE_MDELEM(new AllocatedMetadata(key, value),
- GRPC_MDELEM_STORAGE_ALLOCATED);
-}
-
-inline grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::ExternallyManagedSlice& key,
- const grpc_core::UnmanagedMemorySlice& value) {
- using grpc_core::AllocatedMetadata;
- return GRPC_MAKE_MDELEM(new AllocatedMetadata(key, value),
- GRPC_MDELEM_STORAGE_ALLOCATED);
-}
-
-inline grpc_mdelem grpc_mdelem_from_slices(
- const grpc_core::StaticMetadataSlice& key,
- const grpc_core::UnmanagedMemorySlice& value) {
- using grpc_core::AllocatedMetadata;
- return GRPC_MAKE_MDELEM(new AllocatedMetadata(key, value),
- GRPC_MDELEM_STORAGE_ALLOCATED);
-}
-
-#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_H */
diff --git a/grpc/src/core/lib/transport/metadata_batch.cc b/grpc/src/core/lib/transport/metadata_batch.cc
deleted file mode 100644
index e85b476c..00000000
--- a/grpc/src/core/lib/transport/metadata_batch.cc
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- *
- * 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/lib/transport/metadata_batch.h"
-
-#include <stdbool.h>
-#include <string.h>
-
-#include "absl/container/inlined_vector.h"
-#include "absl/strings/str_join.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.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"
-
-static void assert_valid_list(grpc_mdelem_list* list) {
-#ifndef NDEBUG
- grpc_linked_mdelem* l;
-
- GPR_ASSERT((list->head == nullptr) == (list->tail == nullptr));
- if (!list->head) return;
- GPR_ASSERT(list->head->prev == nullptr);
- GPR_ASSERT(list->tail->next == nullptr);
- GPR_ASSERT((list->head == list->tail) == (list->head->next == nullptr));
-
- size_t verified_count = 0;
- for (l = list->head; l; l = l->next) {
- GPR_ASSERT(!GRPC_MDISNULL(l->md));
- GPR_ASSERT((l->prev == nullptr) == (l == list->head));
- GPR_ASSERT((l->next == nullptr) == (l == list->tail));
- if (l->next) GPR_ASSERT(l->next->prev == l);
- if (l->prev) GPR_ASSERT(l->prev->next == l);
- verified_count++;
- }
- GPR_ASSERT(list->count == verified_count);
-#else
- // Avoid unused-parameter warning for debug-only parameter
- (void)list;
-#endif /* NDEBUG */
-}
-
-static void assert_valid_callouts(grpc_metadata_batch* batch) {
-#ifndef NDEBUG
- for (grpc_linked_mdelem* l = batch->list.head; l != nullptr; l = l->next) {
- grpc_slice key_interned = grpc_slice_intern(GRPC_MDKEY(l->md));
- grpc_metadata_batch_callouts_index callout_idx =
- GRPC_BATCH_INDEX_OF(key_interned);
- if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
- GPR_ASSERT(batch->idx.array[callout_idx] == l);
- }
- grpc_slice_unref_internal(key_interned);
- }
-#else
- // Avoid unused-parameter warning for debug-only parameter
- (void)batch;
-#endif
-}
-
-#ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
- assert_valid_list(&batch->list);
-}
-#endif /* NDEBUG */
-
-void grpc_metadata_batch_init(grpc_metadata_batch* batch) {
- memset(batch, 0, sizeof(*batch));
- batch->deadline = GRPC_MILLIS_INF_FUTURE;
-}
-
-void grpc_metadata_batch_destroy(grpc_metadata_batch* batch) {
- grpc_linked_mdelem* l;
- for (l = batch->list.head; l; l = l->next) {
- GRPC_MDELEM_UNREF(l->md);
- }
-}
-
-grpc_error_handle grpc_attach_md_to_error(grpc_error_handle src,
- grpc_mdelem md) {
- grpc_error_handle out = grpc_error_set_str(
- grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
- grpc_slice_ref_internal(GRPC_MDKEY(md))),
- GRPC_ERROR_STR_VALUE, grpc_slice_ref_internal(GRPC_MDVALUE(md)));
- return out;
-}
-
-static grpc_error_handle GPR_ATTRIBUTE_NOINLINE error_with_md(grpc_mdelem md) {
- return grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"), md);
-}
-
-static grpc_error_handle link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(idx >= 0 && idx < GRPC_BATCH_CALLOUTS_COUNT);
- if (GPR_LIKELY(batch->idx.array[idx] == nullptr)) {
- ++batch->list.default_count;
- batch->idx.array[idx] = storage;
- return GRPC_ERROR_NONE;
- }
- return error_with_md(storage->md);
-}
-
-static grpc_error_handle maybe_link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-
-static grpc_error_handle maybe_link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_callouts_index idx =
- GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
- if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
- return GRPC_ERROR_NONE;
- }
- return link_callout(batch, storage, idx);
-}
-
-static void maybe_unlink_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_callouts_index idx =
- GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
- if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
- return;
- }
- --batch->list.default_count;
- GPR_DEBUG_ASSERT(batch->idx.array[idx] != nullptr);
- batch->idx.array[idx] = nullptr;
-}
-
-grpc_error_handle grpc_metadata_batch_add_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_link_head(batch, storage);
-}
-
-static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
- storage->prev = nullptr;
- storage->next = list->head;
- storage->reserved = nullptr;
- if (list->head != nullptr) {
- list->head->prev = storage;
- } else {
- list->tail = storage;
- }
- list->head = storage;
- list->count++;
- assert_valid_list(list);
-}
-
-grpc_error_handle grpc_metadata_batch_link_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- grpc_error_handle err = maybe_link_callout(batch, storage);
- if (err != GRPC_ERROR_NONE) {
- assert_valid_callouts(batch);
- return err;
- }
- link_head(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-// TODO(arjunroy): Need to revisit this and see what guarantees exist between
-// C-core and the internal-metadata subsystem. E.g. can we ensure a particular
-// metadata is never added twice, even in the presence of user supplied data?
-grpc_error_handle grpc_metadata_batch_link_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
- assert_valid_callouts(batch);
- grpc_error_handle err = link_callout(batch, storage, idx);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
- assert_valid_callouts(batch);
- return err;
- }
- link_head(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle grpc_metadata_batch_add_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_link_tail(batch, storage);
-}
-
-static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
- storage->prev = list->tail;
- storage->next = nullptr;
- storage->reserved = nullptr;
- if (list->tail != nullptr) {
- list->tail->next = storage;
- } else {
- list->head = storage;
- }
- list->tail = storage;
- list->count++;
- assert_valid_list(list);
-}
-
-grpc_error_handle grpc_metadata_batch_link_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- grpc_error_handle err = maybe_link_callout(batch, storage);
- if (err != GRPC_ERROR_NONE) {
- assert_valid_callouts(batch);
- return err;
- }
- link_tail(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error_handle grpc_metadata_batch_link_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
- assert_valid_callouts(batch);
- grpc_error_handle err = link_callout(batch, storage, idx);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
- assert_valid_callouts(batch);
- return err;
- }
- link_tail(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-static void unlink_storage(grpc_mdelem_list* list,
- grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- if (storage->prev != nullptr) {
- storage->prev->next = storage->next;
- } else {
- list->head = storage->next;
- }
- if (storage->next != nullptr) {
- storage->next->prev = storage->prev;
- } else {
- list->tail = storage->prev;
- }
- list->count--;
- assert_valid_list(list);
-}
-
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- maybe_unlink_callout(batch, storage);
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- assert_valid_callouts(batch);
-}
-
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_metadata_batch_callouts_index idx) {
- assert_valid_callouts(batch);
- grpc_linked_mdelem* storage = batch->idx.array[idx];
- GPR_DEBUG_ASSERT(storage != nullptr);
- --batch->list.default_count;
- batch->idx.array[idx] = nullptr;
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- assert_valid_callouts(batch);
-}
-
-void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
- const grpc_slice& value) {
- grpc_mdelem old_mdelem = storage->md;
- grpc_mdelem new_mdelem = grpc_mdelem_from_slices(
- grpc_slice_ref_internal(GRPC_MDKEY(old_mdelem)), value);
- storage->md = new_mdelem;
- GRPC_MDELEM_UNREF(old_mdelem);
-}
-
-absl::optional<absl::string_view> grpc_metadata_batch_get_value(
- grpc_metadata_batch* batch, absl::string_view target_key,
- std::string* concatenated_value) {
- // Find all values for the specified key.
- GPR_DEBUG_ASSERT(batch != nullptr);
- absl::InlinedVector<absl::string_view, 1> values;
- for (grpc_linked_mdelem* md = batch->list.head; md != nullptr;
- md = md->next) {
- absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md->md));
- absl::string_view value =
- grpc_core::StringViewFromSlice(GRPC_MDVALUE(md->md));
- if (target_key == key) values.push_back(value);
- }
- // If none found, no match.
- if (values.empty()) return 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 = absl::StrJoin(values, ",");
- return *concatenated_value;
-}
-
-grpc_error_handle grpc_metadata_batch_substitute(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem new_mdelem) {
- assert_valid_callouts(batch);
- grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_mdelem old_mdelem = storage->md;
- if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
- maybe_unlink_callout(batch, storage);
- storage->md = new_mdelem;
- error = maybe_link_callout(batch, storage);
- if (error != GRPC_ERROR_NONE) {
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- }
- } else {
- storage->md = new_mdelem;
- }
- GRPC_MDELEM_UNREF(old_mdelem);
- assert_valid_callouts(batch);
- return error;
-}
-
-void grpc_metadata_batch_clear(grpc_metadata_batch* batch) {
- grpc_metadata_batch_destroy(batch);
- grpc_metadata_batch_init(batch);
-}
-
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch) {
- return batch->list.head == nullptr &&
- batch->deadline == GRPC_MILLIS_INF_FUTURE;
-}
-
-size_t grpc_metadata_batch_size(grpc_metadata_batch* batch) {
- size_t size = 0;
- for (grpc_linked_mdelem* elem = batch->list.head; elem != nullptr;
- elem = elem->next) {
- size += GRPC_MDELEM_LENGTH(elem->md);
- }
- return size;
-}
-
-static void add_error(grpc_error_handle* composite, grpc_error_handle error,
- const char* composite_error_string) {
- if (error == GRPC_ERROR_NONE) return;
- if (*composite == GRPC_ERROR_NONE) {
- *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
- }
- *composite = grpc_error_add_child(*composite, error);
-}
-
-grpc_error_handle grpc_metadata_batch_filter(
- grpc_metadata_batch* batch, grpc_metadata_batch_filter_func func,
- void* user_data, const char* composite_error_string) {
- grpc_linked_mdelem* l = batch->list.head;
- grpc_error_handle error = GRPC_ERROR_NONE;
- while (l) {
- grpc_linked_mdelem* next = l->next;
- grpc_filtered_mdelem new_mdelem = func(user_data, l->md);
- add_error(&error, new_mdelem.error, composite_error_string);
- if (GRPC_MDISNULL(new_mdelem.md)) {
- grpc_metadata_batch_remove(batch, l);
- } else if (new_mdelem.md.payload != l->md.payload) {
- grpc_metadata_batch_substitute(batch, l, new_mdelem.md);
- }
- l = next;
- }
- return error;
-}
-
-void grpc_metadata_batch_copy(grpc_metadata_batch* src,
- grpc_metadata_batch* dst,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_init(dst);
- dst->deadline = src->deadline;
- size_t i = 0;
- for (grpc_linked_mdelem* elem = src->list.head; elem != nullptr;
- elem = elem->next) {
- // Error unused in non-debug builds.
- grpc_error_handle GRPC_UNUSED error = grpc_metadata_batch_add_tail(
- dst, &storage[i++], GRPC_MDELEM_REF(elem->md));
- // The only way that grpc_metadata_batch_add_tail() can fail is if
- // there's a duplicate entry for a callout. However, that can't be
- // the case here, because we would not have been allowed to create
- // a source batch that had that kind of conflict.
- GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE);
- }
-}
-
-void grpc_metadata_batch_move(grpc_metadata_batch* src,
- grpc_metadata_batch* dst) {
- *dst = *src;
- grpc_metadata_batch_init(src);
-}
diff --git a/grpc/src/core/lib/transport/metadata_batch.h b/grpc/src/core/lib/transport/metadata_batch.h
index b72859fc..1694d943 100644
--- a/grpc/src/core/lib/transport/metadata_batch.h
+++ b/grpc/src/core/lib/transport/metadata_batch.h
@@ -23,184 +23,1372 @@
#include <stdbool.h>
+#include <cstdint>
+#include <limits>
+
+#include "absl/strings/escaping.h"
+#include "absl/strings/match.h"
+#include "absl/strings/str_join.h"
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/slice.h>
+#include <grpc/status.h>
#include <grpc/support/time.h>
+#include "src/core/lib/compression/compression_internal.h"
+#include "src/core/lib/gprpp/chunked_vector.h"
+#include "src/core/lib/gprpp/table.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-typedef struct grpc_linked_mdelem {
- grpc_linked_mdelem() {}
-
- grpc_mdelem md;
- struct grpc_linked_mdelem* next = nullptr;
- struct grpc_linked_mdelem* prev = nullptr;
- void* reserved;
-} grpc_linked_mdelem;
-
-typedef struct grpc_mdelem_list {
- size_t count;
- size_t default_count; // Number of default keys.
- grpc_linked_mdelem* head;
- grpc_linked_mdelem* tail;
-} grpc_mdelem_list;
-
-typedef struct grpc_metadata_batch {
- /** Metadata elements in this batch */
- grpc_mdelem_list list;
- grpc_metadata_batch_callouts idx;
- /** Used to calculate grpc-timeout at the point of sending,
- or GRPC_MILLIS_INF_FUTURE if this batch does not need to send a
- grpc-timeout */
- grpc_millis deadline;
-} grpc_metadata_batch;
-
-void grpc_metadata_batch_init(grpc_metadata_batch* batch);
-void grpc_metadata_batch_destroy(grpc_metadata_batch* batch);
-void grpc_metadata_batch_clear(grpc_metadata_batch* batch);
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch);
-
-/* Returns the transport size of the batch. */
-size_t grpc_metadata_batch_size(grpc_metadata_batch* batch);
-
-/** Remove \a storage from the batch, unreffing the mdelem contained */
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage);
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_metadata_batch_callouts_index idx);
-
-/** Substitute a new mdelem for an old value */
-grpc_error_handle grpc_metadata_batch_substitute(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem new_mdelem);
-
-void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
- const grpc_slice& value);
-
-/** Returns metadata value(s) for the specified key.
- If the key is not present in the batch, returns absl::nullopt.
- If the key is present exactly once in the batch, returns a string_view of
- that value.
- If the key is present more than once in the batch, constructs a
- comma-concatenated string of all values in concatenated_value and returns a
- string_view of that string. */
-absl::optional<absl::string_view> grpc_metadata_batch_get_value(
- grpc_metadata_batch* batch, absl::string_view target_key,
- std::string* concatenated_value);
-
-/** Add \a storage to the beginning of \a batch. storage->md is
- assumed to be valid.
- \a storage is owned by the caller and must survive for the
- lifetime of batch. This usually means it should be around
- for the lifetime of the call. */
-grpc_error_handle grpc_metadata_batch_link_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-grpc_error_handle grpc_metadata_batch_link_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT;
-
-/** Add \a storage to the end of \a batch. storage->md is
- assumed to be valid.
- \a storage is owned by the caller and must survive for the
- lifetime of batch. This usually means it should be around
- for the lifetime of the call. */
-grpc_error_handle grpc_metadata_batch_link_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-grpc_error_handle grpc_metadata_batch_link_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT;
-
-/** Add \a elem_to_add as the first element in \a batch, using
- \a storage as backing storage for the linked list element.
- \a storage is owned by the caller and must survive for the
- lifetime of batch. This usually means it should be around
- for the lifetime of the call.
- Takes ownership of \a elem_to_add */
-grpc_error_handle grpc_metadata_batch_add_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
-
-// TODO(arjunroy, roth): Remove redundant methods.
-// add/link_head/tail are almost identical.
-inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- return grpc_metadata_batch_link_head(batch, storage, idx);
+#include "src/core/lib/slice/slice.h"
+#include "src/core/lib/surface/validate_metadata.h"
+#include "src/core/lib/transport/parsed_metadata.h"
+#include "src/core/lib/transport/timeout_encoding.h"
+
+struct grpc_call_final_info;
+
+namespace grpc_core {
+
+// grpc-timeout metadata trait.
+// ValueType is defined as Timestamp - an absolute timestamp (i.e. a
+// deadline!), that is converted to a duration by transports before being
+// sent.
+// TODO(ctiller): Move this elsewhere. During the transition we need to be able
+// to name this in MetadataMap, but ultimately once the transition is done we
+// should not need to.
+struct GrpcTimeoutMetadata {
+ static constexpr bool kRepeatable = false;
+ using ValueType = Timestamp;
+ using MementoType = Duration;
+ static absl::string_view key() { return "grpc-timeout"; }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ auto timeout = ParseTimeout(value);
+ if (!timeout.has_value()) {
+ on_error("invalid value", value);
+ return Duration::Infinity();
+ }
+ return *timeout;
+ }
+ static ValueType MementoToValue(MementoType timeout) {
+ if (timeout == Duration::Infinity()) {
+ return Timestamp::InfFuture();
+ }
+ return ExecCtx::Get()->Now() + timeout;
+ }
+ static Slice Encode(ValueType x) {
+ return Timeout::FromDuration(x - ExecCtx::Get()->Now()).Encode();
+ }
+ static std::string DisplayValue(MementoType x) { return x.ToString(); }
+};
+
+// TE metadata trait.
+struct TeMetadata {
+ static constexpr bool kRepeatable = false;
+ // HTTP2 says that TE can either be empty or "trailers".
+ // Empty means this trait is not included, "trailers" means kTrailers, and
+ // kInvalid is used to remember an invalid value.
+ enum ValueType : uint8_t {
+ kTrailers,
+ kInvalid,
+ };
+ using MementoType = ValueType;
+ static absl::string_view key() { return "te"; }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ auto out = kInvalid;
+ if (value == "trailers") {
+ out = kTrailers;
+ } else {
+ on_error("invalid value", value);
+ }
+ return out;
+ }
+ static ValueType MementoToValue(MementoType te) { return te; }
+ static StaticSlice Encode(ValueType x) {
+ GPR_ASSERT(x == kTrailers);
+ return StaticSlice::FromStaticString("trailers");
+ }
+ static const char* DisplayValue(MementoType te) {
+ switch (te) {
+ case ValueType::kTrailers:
+ return "trailers";
+ default:
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+// content-type metadata trait.
+struct ContentTypeMetadata {
+ static constexpr bool kRepeatable = false;
+ // gRPC says that content-type can be application/grpc[;something]
+ // Core has only ever verified the prefix.
+ // IF we want to start verifying more, we can expand this type.
+ enum ValueType {
+ kApplicationGrpc,
+ kEmpty,
+ kInvalid,
+ };
+ using MementoType = ValueType;
+ static absl::string_view key() { return "content-type"; }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ auto out = kInvalid;
+ auto value_string = value.as_string_view();
+ if (value_string == "application/grpc") {
+ out = kApplicationGrpc;
+ } else if (absl::StartsWith(value_string, "application/grpc;")) {
+ out = kApplicationGrpc;
+ } else if (absl::StartsWith(value_string, "application/grpc+")) {
+ out = kApplicationGrpc;
+ } else if (value_string.empty()) {
+ out = kEmpty;
+ } else {
+ on_error("invalid value", value);
+ }
+ return out;
+ }
+ static ValueType MementoToValue(MementoType content_type) {
+ return content_type;
+ }
+ static StaticSlice Encode(ValueType x) {
+ switch (x) {
+ case kEmpty:
+ return StaticSlice::FromStaticString("");
+ case kApplicationGrpc:
+ return StaticSlice::FromStaticString("application/grpc");
+ case kInvalid:
+ return StaticSlice::FromStaticString("application/grpc+unknown");
+ }
+ GPR_UNREACHABLE_CODE(
+ return StaticSlice::FromStaticString("unrepresentable value"));
+ }
+ static const char* DisplayValue(MementoType content_type) {
+ switch (content_type) {
+ case ValueType::kApplicationGrpc:
+ return "application/grpc";
+ case ValueType::kEmpty:
+ return "";
+ default:
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+// scheme metadata trait.
+struct HttpSchemeMetadata {
+ static constexpr bool kRepeatable = false;
+ enum ValueType {
+ kHttp,
+ kHttps,
+ kInvalid,
+ };
+ using MementoType = ValueType;
+ static absl::string_view key() { return ":scheme"; }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ return Parse(value.as_string_view(), on_error);
+ }
+ static ValueType Parse(absl::string_view value,
+ MetadataParseErrorFn on_error) {
+ if (value == "http") {
+ return kHttp;
+ } else if (value == "https") {
+ return kHttps;
+ }
+ on_error("invalid value", Slice::FromCopiedBuffer(value));
+ return kInvalid;
+ }
+ static ValueType MementoToValue(MementoType content_type) {
+ return content_type;
+ }
+ static StaticSlice Encode(ValueType x) {
+ switch (x) {
+ case kHttp:
+ return StaticSlice::FromStaticString("http");
+ case kHttps:
+ return StaticSlice::FromStaticString("https");
+ default:
+ abort();
+ }
+ }
+ static const char* DisplayValue(MementoType content_type) {
+ switch (content_type) {
+ case kHttp:
+ return "http";
+ case kHttps:
+ return "https";
+ default:
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+// method metadata trait.
+struct HttpMethodMetadata {
+ static constexpr bool kRepeatable = false;
+ enum ValueType {
+ kPost,
+ kGet,
+ kInvalid,
+ };
+ using MementoType = ValueType;
+ static absl::string_view key() { return ":method"; }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ auto out = kInvalid;
+ auto value_string = value.as_string_view();
+ if (value_string == "POST") {
+ out = kPost;
+ } else if (value_string == "GET") {
+ out = kGet;
+ } else {
+ on_error("invalid value", value);
+ }
+ return out;
+ }
+ static ValueType MementoToValue(MementoType content_type) {
+ return content_type;
+ }
+ static StaticSlice Encode(ValueType x) {
+ switch (x) {
+ case kPost:
+ return StaticSlice::FromStaticString("POST");
+ case kGet:
+ return StaticSlice::FromStaticString("GET");
+ default:
+ abort();
+ }
+ }
+ static const char* DisplayValue(MementoType content_type) {
+ switch (content_type) {
+ case kPost:
+ return "POST";
+ case kGet:
+ return "GET";
+ default:
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+// Base type for metadata pertaining to a single compression algorithm
+// (e.g., "grpc-encoding").
+struct CompressionAlgorithmBasedMetadata {
+ using ValueType = grpc_compression_algorithm;
+ using MementoType = ValueType;
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ auto algorithm = ParseCompressionAlgorithm(value.as_string_view());
+ if (!algorithm.has_value()) {
+ on_error("invalid value", value);
+ return GRPC_COMPRESS_NONE;
+ }
+ return *algorithm;
+ }
+ static ValueType MementoToValue(MementoType x) { return x; }
+ static Slice Encode(ValueType x) {
+ GPR_ASSERT(x != GRPC_COMPRESS_ALGORITHMS_COUNT);
+ return Slice::FromStaticString(CompressionAlgorithmAsString(x));
+ }
+ static const char* DisplayValue(MementoType x) {
+ if (const char* p = CompressionAlgorithmAsString(x)) {
+ return p;
+ } else {
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+// grpc-encoding metadata trait.
+struct GrpcEncodingMetadata : public CompressionAlgorithmBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-encoding"; }
+};
+
+// grpc-internal-encoding-request metadata trait.
+struct GrpcInternalEncodingRequest : public CompressionAlgorithmBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-internal-encoding-request"; }
+};
+
+// grpc-accept-encoding metadata trait.
+struct GrpcAcceptEncodingMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-accept-encoding"; }
+ using ValueType = CompressionAlgorithmSet;
+ using MementoType = ValueType;
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn) {
+ return CompressionAlgorithmSet::FromString(value.as_string_view());
+ }
+ static ValueType MementoToValue(MementoType x) { return x; }
+ static Slice Encode(ValueType x) { return x.ToSlice(); }
+ static std::string DisplayValue(MementoType x) { return x.ToString(); }
+};
+
+struct SimpleSliceBasedMetadata {
+ using ValueType = Slice;
+ using MementoType = Slice;
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn) {
+ return value.TakeOwned();
+ }
+ static ValueType MementoToValue(MementoType value) { return value; }
+ static Slice Encode(const ValueType& x) { return x.Ref(); }
+ static absl::string_view DisplayValue(const MementoType& value) {
+ return value.as_string_view();
+ }
+};
+
+// user-agent metadata trait.
+struct UserAgentMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "user-agent"; }
+};
+
+// grpc-message metadata trait.
+struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-message"; }
+};
+
+// host metadata trait.
+struct HostMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "host"; }
+};
+
+// x-endpoint-load-metrics-bin metadata trait.
+struct XEndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "x-endpoint-load-metrics-bin"; }
+};
+
+// grpc-server-stats-bin metadata trait.
+struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-server-stats-bin"; }
+};
+
+// grpc-trace-bin metadata trait.
+struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-trace-bin"; }
+};
+
+// grpc-tags-bin metadata trait.
+struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-tags-bin"; }
+};
+
+// :authority metadata trait.
+struct HttpAuthorityMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return ":authority"; }
+};
+
+// :path metadata trait.
+struct HttpPathMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return ":path"; }
+};
+
+// We separate SimpleIntBasedMetadata into two pieces: one that does not depend
+// on the invalid value, and one that does. This allows the compiler to easily
+// see the functions that are shared, and helps reduce code bloat here.
+template <typename Int>
+struct SimpleIntBasedMetadataBase {
+ using ValueType = Int;
+ using MementoType = Int;
+ static ValueType MementoToValue(MementoType value) { return value; }
+ static Slice Encode(ValueType x) { return Slice::FromInt64(x); }
+ static Int DisplayValue(MementoType x) { return x; }
+};
+
+template <typename Int, Int kInvalidValue>
+struct SimpleIntBasedMetadata : public SimpleIntBasedMetadataBase<Int> {
+ static constexpr Int invalid_value() { return kInvalidValue; }
+ static Int ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ Int out;
+ if (!absl::SimpleAtoi(value.as_string_view(), &out)) {
+ on_error("not an integer", value);
+ out = kInvalidValue;
+ }
+ return out;
+ }
+};
+
+// grpc-status metadata trait.
+struct GrpcStatusMetadata
+ : public SimpleIntBasedMetadata<grpc_status_code, GRPC_STATUS_UNKNOWN> {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-status"; }
+};
+
+// grpc-previous-rpc-attempts metadata trait.
+struct GrpcPreviousRpcAttemptsMetadata
+ : public SimpleIntBasedMetadata<uint32_t, 0> {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-previous-rpc-attempts"; }
+};
+
+// grpc-retry-pushback-ms metadata trait.
+struct GrpcRetryPushbackMsMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpc-retry-pushback-ms"; }
+ using ValueType = Duration;
+ using MementoType = Duration;
+ static ValueType MementoToValue(MementoType x) { return x; }
+ static Slice Encode(Duration x) { return Slice::FromInt64(x.millis()); }
+ static int64_t DisplayValue(Duration x) { return x.millis(); }
+ static Duration ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ int64_t out;
+ if (!absl::SimpleAtoi(value.as_string_view(), &out)) {
+ on_error("not an integer", value);
+ return Duration::NegativeInfinity();
+ }
+ return Duration::Milliseconds(out);
+ }
+};
+
+// :status metadata trait.
+// TODO(ctiller): consider moving to uint16_t
+struct HttpStatusMetadata : public SimpleIntBasedMetadata<uint32_t, 0> {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return ":status"; }
+};
+
+// "secret" metadata trait used to pass load balancing token between filters.
+// This should not be exposed outside of gRPC core.
+class GrpcLbClientStats;
+struct GrpcLbClientStatsMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "grpclb_client_stats"; }
+ using ValueType = GrpcLbClientStats*;
+ using MementoType = ValueType;
+ static ValueType MementoToValue(MementoType value) { return value; }
+ static Slice Encode(ValueType) { abort(); }
+ static const char* DisplayValue(MementoType) { return "<internal-lb-stats>"; }
+ static MementoType ParseMemento(Slice, MetadataParseErrorFn) {
+ return nullptr;
+ }
+};
+
+// lb-token metadata
+struct LbTokenMetadata : public SimpleSliceBasedMetadata {
+ static constexpr bool kRepeatable = false;
+ static absl::string_view key() { return "lb-token"; }
+};
+
+// lb-cost-bin metadata
+struct LbCostBinMetadata {
+ static constexpr bool kRepeatable = true;
+ static absl::string_view key() { return "lb-cost-bin"; }
+ struct ValueType {
+ double cost;
+ std::string name;
+ };
+ using MementoType = ValueType;
+ static ValueType MementoToValue(MementoType value) { return value; }
+ static Slice Encode(const ValueType& x) {
+ auto slice =
+ MutableSlice::CreateUninitialized(sizeof(double) + x.name.length());
+ memcpy(slice.data(), &x.cost, sizeof(double));
+ memcpy(slice.data() + sizeof(double), x.name.data(), x.name.length());
+ return Slice(std::move(slice));
+ }
+ static std::string DisplayValue(MementoType x) {
+ return absl::StrCat(x.name, ":", x.cost);
+ }
+ static MementoType ParseMemento(Slice value, MetadataParseErrorFn on_error) {
+ if (value.length() < sizeof(double)) {
+ on_error("too short", value);
+ return {0, ""};
+ }
+ MementoType out;
+ memcpy(&out.cost, value.data(), sizeof(double));
+ out.name = std::string(
+ reinterpret_cast<const char*>(value.data()) + sizeof(double),
+ value.length() - sizeof(double));
+ return out;
+ }
+};
+
+// Annotation added by a transport to note whether a failed request was never
+// placed on the wire, or never seen by a server.
+struct GrpcStreamNetworkState {
+ static absl::string_view DebugKey() { return "GrpcStreamNetworkState"; }
+ static constexpr bool kRepeatable = false;
+ enum ValueType : uint8_t {
+ kNotSentOnWire,
+ kNotSeenByServer,
+ };
+ static std::string DisplayValue(ValueType x) {
+ switch (x) {
+ case kNotSentOnWire:
+ return "not sent on wire";
+ case kNotSeenByServer:
+ return "not seen by server";
+ }
+ }
+};
+
+// Annotation added by a server transport to note the peer making a request.
+struct PeerString {
+ static absl::string_view DebugKey() { return "PeerString"; }
+ static constexpr bool kRepeatable = false;
+ using ValueType = absl::string_view;
+ static std::string DisplayValue(ValueType x) { return std::string(x); }
+};
+
+// Annotation added by various systems to describe the reason for a failure.
+struct GrpcStatusContext {
+ static absl::string_view DebugKey() { return "GrpcStatusContext"; }
+ static constexpr bool kRepeatable = true;
+ using ValueType = std::string;
+ static const std::string& DisplayValue(const std::string& x) { return x; }
+};
+
+namespace metadata_detail {
+
+// IsEncodable: Given a trait, determine if that trait is encodable, or is just
+// a value attached to a MetadataMap.
+// We use the presence of the key() static method to determine if a trait is
+// encodable or not - encodable traits have string names, and non-encodable
+// traits do not.
+template <typename Trait, typename Ignored = void>
+struct IsEncodableTrait {
+ static const bool value = false;
+};
+
+template <typename Trait>
+struct IsEncodableTrait<Trait, absl::void_t<decltype(Trait::key())>> {
+ static const bool value = true;
+};
+
+// Helper type - maps a string name to a trait.
+template <typename MustBeVoid, typename... Traits>
+struct NameLookup;
+
+template <typename Trait, typename... Traits>
+struct NameLookup<absl::enable_if_t<IsEncodableTrait<Trait>::value, void>,
+ Trait, Traits...> {
+ // Call op->Found(Trait()) if op->name == Trait::key() for some Trait in
+ // Traits. If not found, call op->NotFound().
+ template <typename Op>
+ static auto Lookup(absl::string_view key, Op* op)
+ -> decltype(op->Found(Trait())) {
+ if (key == Trait::key()) {
+ return op->Found(Trait());
+ }
+ return NameLookup<void, Traits...>::Lookup(key, op);
+ }
+};
+
+template <typename Trait, typename... Traits>
+struct NameLookup<absl::enable_if_t<!IsEncodableTrait<Trait>::value, void>,
+ Trait, Traits...> {
+ template <typename Op>
+ static auto Lookup(absl::string_view key, Op* op)
+ -> decltype(NameLookup<void, Traits...>::Lookup(key, op)) {
+ return NameLookup<void, Traits...>::Lookup(key, op);
+ }
+};
+
+template <>
+struct NameLookup<void> {
+ template <typename Op>
+ static auto Lookup(absl::string_view key, Op* op)
+ -> decltype(op->NotFound(key)) {
+ return op->NotFound(key);
+ }
+};
+
+// Helper to take a slice to a memento to a value.
+// By splitting this part out we can scale code size as the number of (memento,
+// value) types, rather than as the number of traits.
+template <typename ParseMementoFn, typename MementoToValueFn>
+struct ParseValue {
+ template <ParseMementoFn parse_memento, MementoToValueFn memento_to_value>
+ static GPR_ATTRIBUTE_NOINLINE auto Parse(Slice* value,
+ MetadataParseErrorFn on_error)
+ -> decltype(memento_to_value(parse_memento(std::move(*value),
+ on_error))) {
+ return memento_to_value(parse_memento(std::move(*value), on_error));
+ }
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
+// ParsedMetadata object.
+template <typename Container>
+class ParseHelper {
+ public:
+ ParseHelper(Slice value, MetadataParseErrorFn on_error, size_t transport_size)
+ : value_(std::move(value)),
+ on_error_(on_error),
+ transport_size_(transport_size) {}
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> Found(Trait trait) {
+ return ParsedMetadata<Container>(
+ trait,
+ ParseValueToMemento<typename Trait::MementoType, Trait::ParseMemento>(),
+ transport_size_);
+ }
+
+ GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
+ absl::string_view key) {
+ return ParsedMetadata<Container>(Slice::FromCopiedString(key),
+ std::move(value_));
+ }
+
+ private:
+ template <typename T, T (*parse_memento)(Slice, MetadataParseErrorFn)>
+ GPR_ATTRIBUTE_NOINLINE T ParseValueToMemento() {
+ return parse_memento(std::move(value_), on_error_);
+ }
+
+ Slice value_;
+ MetadataParseErrorFn on_error_;
+ const size_t transport_size_;
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::Append, its Found/NotFound methods turn a slice into a
+// value and add it to a container.
+template <typename Container>
+class AppendHelper {
+ public:
+ AppendHelper(Container* container, Slice value, MetadataParseErrorFn on_error)
+ : container_(container), value_(std::move(value)), on_error_(on_error) {}
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
+ container_->Set(
+ trait, ParseValue<decltype(Trait::ParseMemento),
+ decltype(Trait::MementoToValue)>::
+ template Parse<Trait::ParseMemento, Trait::MementoToValue>(
+ &value_, on_error_));
+ }
+
+ GPR_ATTRIBUTE_NOINLINE void NotFound(absl::string_view key) {
+ container_->AppendUnknown(key, std::move(value_));
+ }
+
+ private:
+ Container* const container_;
+ Slice value_;
+ MetadataParseErrorFn on_error_;
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::Remove, its Found/NotFound methods remove a key from
+// the container.
+template <typename Container>
+class RemoveHelper {
+ public:
+ explicit RemoveHelper(Container* container) : container_(container) {}
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
+ container_->Remove(trait);
+ }
+
+ GPR_ATTRIBUTE_NOINLINE void NotFound(absl::string_view key) {
+ container_->RemoveUnknown(key);
+ }
+
+ private:
+ Container* const container_;
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::GetStringValue, its Found/NotFound methods generated a
+// string value from the container.
+template <typename Container>
+class GetStringValueHelper {
+ public:
+ explicit GetStringValueHelper(const Container* container,
+ std::string* backing)
+ : container_(container), backing_(backing) {}
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
+ Trait::kRepeatable == false &&
+ std::is_same<Slice, typename Trait::ValueType>::value,
+ absl::optional<absl::string_view>>
+ Found(Trait) {
+ const auto* value = container_->get_pointer(Trait());
+ if (value == nullptr) return absl::nullopt;
+ return value->as_string_view();
+ }
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
+ Trait::kRepeatable == true &&
+ !std::is_same<Slice, typename Trait::ValueType>::value,
+ absl::optional<absl::string_view>>
+ Found(Trait) {
+ const auto* value = container_->get_pointer(Trait());
+ if (value == nullptr) return absl::nullopt;
+ backing_->clear();
+ for (const auto& v : *value) {
+ if (!backing_->empty()) backing_->push_back(',');
+ auto new_segment = Trait::Encode(v);
+ backing_->append(new_segment.begin(), new_segment.end());
+ }
+ return *backing_;
+ }
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE absl::enable_if_t<
+ Trait::kRepeatable == false &&
+ !std::is_same<Slice, typename Trait::ValueType>::value,
+ absl::optional<absl::string_view>>
+ Found(Trait) {
+ const auto* value = container_->get_pointer(Trait());
+ if (value == nullptr) return absl::nullopt;
+ *backing_ = std::string(Trait::Encode(*value).as_string_view());
+ return *backing_;
+ }
+
+ GPR_ATTRIBUTE_NOINLINE absl::optional<absl::string_view> NotFound(
+ absl::string_view key) {
+ return container_->GetStringValueUnknown(key, backing_);
+ }
+
+ private:
+ const Container* const container_;
+ std::string* backing_;
+};
+
+// Sink for key value logs
+using LogFn = absl::FunctionRef<void(absl::string_view, absl::string_view)>;
+
+template <typename T>
+struct AdaptDisplayValueToLog {
+ static std::string ToString(const T& value) { return absl::StrCat(value); }
+};
+
+template <>
+struct AdaptDisplayValueToLog<Slice> {
+ static std::string ToString(Slice value) {
+ return std::string(value.as_string_view());
+ }
+};
+
+template <>
+struct AdaptDisplayValueToLog<StaticSlice> {
+ static absl::string_view ToString(StaticSlice value) {
+ return value.as_string_view();
+ }
+};
+
+template <typename T, typename U, typename V>
+GPR_ATTRIBUTE_NOINLINE void LogKeyValueTo(absl::string_view key, const T& value,
+ V (*display_value)(U), LogFn log_fn) {
+ log_fn(key, AdaptDisplayValueToLog<V>::ToString(display_value(value)));
}
-inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_add_head(batch, storage, idx);
+// Generate a strong type for metadata values per trait.
+template <typename Which, typename Ignored = void>
+struct Value;
+
+template <typename Which>
+struct Value<Which, absl::enable_if_t<Which::kRepeatable == false &&
+ IsEncodableTrait<Which>::value,
+ void>> {
+ Value() = default;
+ explicit Value(const typename Which::ValueType& value) : value(value) {}
+ explicit Value(typename Which::ValueType&& value)
+ : value(std::forward<typename Which::ValueType>(value)) {}
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+ Value(Value&&) noexcept = default;
+ Value& operator=(Value&& other) noexcept {
+ value = std::move(other.value);
+ return *this;
+ }
+ template <typename Encoder>
+ void EncodeTo(Encoder* encoder) const {
+ encoder->Encode(Which(), value);
+ }
+ void LogTo(LogFn log_fn) const {
+ LogKeyValueTo(Which::key(), value, Which::Encode, log_fn);
+ }
+ using StorageType = typename Which::ValueType;
+ GPR_NO_UNIQUE_ADDRESS StorageType value;
+};
+
+template <typename Which>
+struct Value<Which, absl::enable_if_t<Which::kRepeatable == false &&
+ !IsEncodableTrait<Which>::value,
+ void>> {
+ Value() = default;
+ explicit Value(const typename Which::ValueType& value) : value(value) {}
+ explicit Value(typename Which::ValueType&& value)
+ : value(std::forward<typename Which::ValueType>(value)) {}
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+ Value(Value&&) noexcept = default;
+ Value& operator=(Value&& other) noexcept {
+ value = std::move(other.value);
+ return *this;
+ }
+ template <typename Encoder>
+ void EncodeTo(Encoder*) const {}
+ void LogTo(LogFn log_fn) const {
+ LogKeyValueTo(Which::DebugKey(), value, Which::DisplayValue, log_fn);
+ }
+ using StorageType = typename Which::ValueType;
+ GPR_NO_UNIQUE_ADDRESS StorageType value;
+};
+
+template <typename Which>
+struct Value<Which, absl::enable_if_t<Which::kRepeatable == true &&
+ IsEncodableTrait<Which>::value,
+ void>> {
+ Value() = default;
+ explicit Value(const typename Which::ValueType& value) {
+ this->value.push_back(value);
+ }
+ explicit Value(typename Which::ValueType&& value) {
+ this->value.emplace_back(std::forward<typename Which::ValueType>(value));
+ }
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+ Value(Value&& other) noexcept : value(std::move(other.value)) {}
+ Value& operator=(Value&& other) noexcept {
+ value = std::move(other.value);
+ return *this;
+ }
+ template <typename Encoder>
+ void EncodeTo(Encoder* encoder) const {
+ for (const auto& v : value) {
+ encoder->Encode(Which(), v);
+ }
+ }
+ void LogTo(LogFn log_fn) const {
+ for (const auto& v : value) {
+ LogKeyValueTo(Which::key(), v, Which::Encode, log_fn);
+ }
+ }
+ using StorageType = absl::InlinedVector<typename Which::ValueType, 1>;
+ StorageType value;
+};
+
+template <typename Which>
+struct Value<Which, absl::enable_if_t<Which::kRepeatable == true &&
+ !IsEncodableTrait<Which>::value,
+ void>> {
+ Value() = default;
+ explicit Value(const typename Which::ValueType& value) {
+ this->value.push_back(value);
+ }
+ explicit Value(typename Which::ValueType&& value) {
+ this->value.emplace_back(std::forward<typename Which::ValueType>(value));
+ }
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+ Value(Value&& other) noexcept : value(std::move(other.value)) {}
+ Value& operator=(Value&& other) noexcept {
+ value = std::move(other.value);
+ return *this;
+ }
+ template <typename Encoder>
+ void EncodeTo(Encoder*) const {}
+ void LogTo(LogFn log_fn) const {
+ for (const auto& v : value) {
+ LogKeyValueTo(Which::DebugKey(), v, Which::DisplayValue, log_fn);
+ }
+ }
+ using StorageType = absl::InlinedVector<typename Which::ValueType, 1>;
+ StorageType value;
+};
+
+// Encoder to copy some metadata
+template <typename Output>
+class CopySink {
+ public:
+ explicit CopySink(Output* dst) : dst_(dst) {}
+
+ template <class T, class V>
+ void Encode(T trait, V value) {
+ dst_->Set(trait, value);
+ }
+
+ template <class T>
+ void Encode(T trait, const Slice& value) {
+ dst_->Set(trait, std::move(value.AsOwned()));
+ }
+
+ void Encode(const Slice& key, const Slice& value) {
+ dst_->AppendUnknown(key.as_string_view(), value.Ref());
+ }
+
+ private:
+ Output* dst_;
+};
+
+// Callable for the ForEach in Encode() -- for each value, call the
+// appropriate encoder method.
+template <typename Encoder>
+struct EncodeWrapper {
+ Encoder* encoder;
+ template <typename Which>
+ void operator()(const Value<Which>& which) {
+ which.EncodeTo(encoder);
+ }
+};
+
+// Callable for the ForEach in Log()
+struct LogWrapper {
+ LogFn log_fn;
+ template <typename Which>
+ void operator()(const Value<Which>& which) {
+ which.LogTo(log_fn);
+ }
+};
+
+// Encoder to compute TransportSize
+class TransportSizeEncoder {
+ public:
+ void Encode(const Slice& key, const Slice& value) {
+ size_ += key.length() + value.length() + 32;
+ }
+
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ Add(Which(), value);
+ }
+
+ void Encode(ContentTypeMetadata,
+ const typename ContentTypeMetadata::ValueType& value) {
+ if (value == ContentTypeMetadata::kInvalid) return;
+ Add(ContentTypeMetadata(), value);
+ }
+
+ size_t size() const { return size_; }
+
+ private:
+ template <typename Which>
+ void Add(Which, const typename Which::ValueType& value) {
+ size_ += Which::key().length() + Which::Encode(value).length() + 32;
+ }
+
+ uint32_t size_ = 0;
+};
+
+} // namespace metadata_detail
+
+// Helper function for encoders
+// Given a metadata trait, convert the value to a slice.
+template <typename Which>
+absl::enable_if_t<std::is_same<typename Which::ValueType, Slice>::value,
+ const Slice&>
+MetadataValueAsSlice(const Slice& slice) {
+ return slice;
+}
+
+template <typename Which>
+absl::enable_if_t<!std::is_same<typename Which::ValueType, Slice>::value, Slice>
+MetadataValueAsSlice(typename Which::ValueType value) {
+ return Slice(Which::Encode(value));
+}
+
+// MetadataMap encodes the mapping of metadata keys to metadata values.
+//
+// MetadataMap takes a derived class and list of traits. Each of these trait
+// objects defines one metadata field that is used by core, and so should have
+// more specialized handling than just using the generic APIs.
+//
+// MetadataMap is the backing type for some derived type via the curiously
+// recursive template pattern. This is because many types consumed by
+// MetadataMap require the container type to operate on, and many of those
+// types are instantiated one per trait. A naive implementation without the
+// Derived type would, for traits A,B,C, then instantiate for some
+// T<Container, Trait>:
+// - T<MetadataMap<A,B,C>, A>,
+// - T<MetadataMap<A,B,C>, B>,
+// - T<MetadataMap<A,B,C>, C>.
+// Since these types ultimately need to be recorded in the .dynstr segment
+// for dynamic linkers (if gRPC is linked as a static library) this would
+// create O(N^2) bytes of symbols even in stripped libraries. To avoid this
+// we use the derived type (e.g. grpc_metadata_batch right now) to capture
+// the container type, and we would write T<grpc_metadata_batch, A>, etc...
+// Note that now the container type uses a number of bytes that is independent
+// of the number of traits, and so we return to a linear symbol table growth
+// function.
+//
+// Each trait object has one of two possible signatures, depending on whether
+// that traits field is encodable or not.
+// Non-encodable traits are carried in a MetadataMap, but are never passed to
+// the application nor serialized to wire.
+//
+// Encodable traits have the following signature:
+// // Traits for the "grpc-xyz" metadata field:
+// struct GrpcXyzMetadata {
+// // Can this metadata field be repeated?
+// static constexpr bool kRepeatable = ...;
+// // The type that's stored on MetadataBatch
+// using ValueType = ...;
+// // The type that's stored in compression/decompression tables
+// using MementoType = ...;
+// // The string key for this metadata type (for transports that require it)
+// static absl::string_view key() { return "grpc-xyz"; }
+// // Parse a memento from a slice
+// // Takes ownership of value
+// // Calls fn in the case of an error that should be reported to the user
+// static MementoType ParseMemento(Slice value, MementoParseErrorFn fn) { ...
+// }
+// // Convert a memento to a value
+// static ValueType MementoToValue(MementoType memento) { ... }
+// // Convert a value to its canonical text wire format (the format that
+// // ParseMemento will accept!)
+// static Slice Encode(const ValueType& value);
+// // Convert a value to something that can be passed to StrCat and displayed
+// // for debugging
+// static SomeStrCatableType DisplayValue(MementoType value) { ... }
+// };
+//
+// Non-encodable traits are determined by missing the key() method, and have the
+// following signature (and by convention omit the Metadata part of the type
+// name):
+// // Traits for the GrpcXyz field:
+// struct GrpcXyz {
+// // The string key that should be used for debug dumps - should not be a
+// // valid http2 key (ie all lower case)
+// static absl::string_view DebugKey() { return "GRPC_XYZ"; }
+// // Can this metadata field be repeated?
+// static constexpr bool kRepeatable = ...;
+// // The type that's stored on MetadataBatch
+// using ValueType = ...;
+// // Convert a value to something that can be passed to StrCat and displayed
+// // for debugging
+// static SomeStrCatableType DisplayValue(ValueType value) { ... }
+// };
+//
+// About parsing and mementos:
+//
+// Many gRPC transports exchange metadata as key/value strings, but also allow
+// for a more efficient representation as a single integer. We can use this
+// integer representation to avoid reparsing too, by storing the parsed value
+// in the compression table. This is what mementos are used for.
+//
+// A trait offers the capability to turn a slice into a memento via
+// ParseMemento. This is exposed to users of MetadataMap via the Parse() method,
+// that returns a ParsedMetadata object. That ParsedMetadata object can in turn
+// be used to set the same value on many different MetadataMaps without having
+// to reparse.
+//
+// Implementation wise, ParsedMetadata is a type erased wrapper around
+// MementoType. When we set a value on MetadataMap, we first turn that memento
+// into a value. For most types, this is going to be a no-op, but for example
+// for grpc-timeout we make the memento the timeout expressed on the wire, but
+// we make the value the timestamp of when the timeout will expire (i.e. the
+// deadline).
+template <class Derived, typename... Traits>
+class MetadataMap {
+ public:
+ explicit MetadataMap(Arena* arena);
+ ~MetadataMap();
+
+ MetadataMap(const MetadataMap&) = delete;
+ MetadataMap& operator=(const MetadataMap&) = delete;
+ MetadataMap(MetadataMap&&) noexcept;
+ // We never create MetadataMap directly, instead we create Derived, but we
+ // want to be able to move it without redeclaring this.
+ // NOLINTNEXTLINE(misc-unconventional-assign-operator)
+ Derived& operator=(MetadataMap&&) noexcept;
+
+ // Encode this metadata map into some encoder.
+ // For each field that is set in the MetadataMap, call
+ // encoder->Encode.
+ //
+ // For fields for which we have traits, this will be a method with
+ // the signature:
+ // void Encode(TraitsType, typename TraitsType::ValueType value);
+ // For fields for which we do not have traits, this will be a method
+ // with the signature:
+ // void Encode(grpc_mdelem md);
+ // TODO(ctiller): It's expected that the latter Encode method will
+ // become Encode(Slice, Slice) by the end of the current metadata API
+ // transitions.
+ template <typename Encoder>
+ void Encode(Encoder* encoder) const {
+ table_.ForEach(metadata_detail::EncodeWrapper<Encoder>{encoder});
+ for (const auto& unk : unknown_) {
+ encoder->Encode(unk.first, unk.second);
+ }
+ }
+
+ // Similar to Encode, but targeted at logging: for each metadatum,
+ // call f(key, value) as absl::string_views.
+ void Log(metadata_detail::LogFn log_fn) const {
+ table_.ForEach(metadata_detail::LogWrapper{log_fn});
+ for (const auto& unk : unknown_) {
+ log_fn(unk.first.as_string_view(), unk.second.as_string_view());
+ }
+ }
+
+ std::string DebugString() const {
+ std::string out;
+ Log([&out](absl::string_view key, absl::string_view value) {
+ if (!out.empty()) out.append(", ");
+ absl::StrAppend(&out, absl::CEscape(key), ": ", absl::CEscape(value));
+ });
+ return out;
+ }
+
+ // Get the pointer to the value of some known metadata.
+ // Returns nullptr if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ const typename metadata_detail::Value<Which>::StorageType* get_pointer(
+ Which) const {
+ if (auto* p = table_.template get<Value<Which>>()) return &p->value;
+ return nullptr;
+ }
+
+ // Get the pointer to the value of some known metadata.
+ // Returns nullptr if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ typename metadata_detail::Value<Which>::StorageType* get_pointer(Which) {
+ if (auto* p = table_.template get<Value<Which>>()) return &p->value;
+ return nullptr;
+ }
+
+ // Get the pointer to the value of some known metadata.
+ // Adds the default value for the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ typename metadata_detail::Value<Which>::StorageType* GetOrCreatePointer(
+ Which) {
+ return &table_.template get_or_create<Value<Which>>()->value;
+ }
+
+ // Get the value of some known metadata.
+ // Returns nullopt if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ absl::optional<typename Which::ValueType> get(Which) const {
+ if (auto* p = table_.template get<Value<Which>>()) return p->value;
+ return absl::nullopt;
+ }
+
+ // Set the value of some known metadata.
+ // Returns a pointer to the new value.
+ template <typename Which, typename... Args>
+ absl::enable_if_t<Which::kRepeatable == false, void> Set(Which,
+ Args&&... args) {
+ table_.template set<Value<Which>>(std::forward<Args>(args)...);
+ }
+ template <typename Which, typename... Args>
+ absl::enable_if_t<Which::kRepeatable == true, void> Set(Which,
+ Args&&... args) {
+ GetOrCreatePointer(Which())->emplace_back(std::forward<Args>(args)...);
+ }
+
+ // Remove a specific piece of known metadata.
+ template <typename Which>
+ void Remove(Which) {
+ table_.template clear<Value<Which>>();
+ }
+
+ // Remove some metadata by name
+ void Remove(absl::string_view key) {
+ metadata_detail::RemoveHelper<Derived> helper(static_cast<Derived*>(this));
+ metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
+ }
+
+ void Remove(const char* key) { Remove(absl::string_view(key)); }
+
+ // Retrieve some metadata by name
+ absl::optional<absl::string_view> GetStringValue(absl::string_view name,
+ std::string* buffer) const {
+ metadata_detail::GetStringValueHelper<Derived> helper(
+ static_cast<const Derived*>(this), buffer);
+ return metadata_detail::NameLookup<void, Traits...>::Lookup(name, &helper);
+ }
+
+ // Extract a piece of known metadata.
+ // Returns nullopt if the metadata was not present, or the value if it was.
+ // The same as:
+ // auto value = m.get(T());
+ // m.Remove(T());
+ template <typename Which>
+ absl::enable_if_t<Which::kRepeatable == false,
+ absl::optional<typename Which::ValueType>>
+ Take(Which which) {
+ if (auto* p = get_pointer(which)) {
+ absl::optional<typename Which::ValueType> value(std::move(*p));
+ Remove(which);
+ return value;
+ }
+ return {};
+ }
+
+ // Extract repeated known metadata.
+ // Returns an empty vector if the metadata was not present.
+ template <typename Which>
+ absl::enable_if_t<Which::kRepeatable == true,
+ typename metadata_detail::Value<Which>::StorageType>
+ Take(Which which) {
+ if (auto* p = get_pointer(which)) {
+ typename Value<Which>::StorageType value = std::move(*p);
+ Remove(which);
+ return value;
+ }
+ return {};
+ }
+
+ // Parse metadata from a key/value pair, and return an object representing
+ // that result.
+ // TODO(ctiller): key should probably be an absl::string_view.
+ // Once we don't care about interning anymore, make that change!
+ static ParsedMetadata<Derived> Parse(absl::string_view key, Slice value,
+ uint32_t transport_size,
+ MetadataParseErrorFn on_error) {
+ metadata_detail::ParseHelper<Derived> helper(value.TakeOwned(), on_error,
+ transport_size);
+ return metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
+ }
+
+ // Set a value from a parsed metadata object.
+ void Set(const ParsedMetadata<Derived>& m) {
+ m.SetOnContainer(static_cast<Derived*>(this));
+ }
+
+ // Append a key/value pair - takes ownership of value
+ void Append(absl::string_view key, Slice value,
+ MetadataParseErrorFn on_error) {
+ metadata_detail::AppendHelper<Derived> helper(static_cast<Derived*>(this),
+ value.TakeOwned(), on_error);
+ metadata_detail::NameLookup<void, Traits...>::Lookup(key, &helper);
+ }
+
+ void Clear();
+ size_t TransportSize() const;
+ Derived Copy() const;
+ bool empty() const { return table_.empty() && unknown_.empty(); }
+ size_t count() const { return table_.count() + unknown_.size(); }
+
+ private:
+ friend class metadata_detail::AppendHelper<Derived>;
+ friend class metadata_detail::GetStringValueHelper<Derived>;
+ friend class metadata_detail::RemoveHelper<Derived>;
+ friend class metadata_detail::CopySink<Derived>;
+ friend class ParsedMetadata<Derived>;
+
+ template <typename Which>
+ using Value = metadata_detail::Value<Which>;
+
+ void AppendUnknown(absl::string_view key, Slice value) {
+ unknown_.EmplaceBack(Slice::FromCopiedString(key), value.Ref());
+ }
+
+ void RemoveUnknown(absl::string_view key) {
+ unknown_.SetEnd(std::remove_if(unknown_.begin(), unknown_.end(),
+ [key](const std::pair<Slice, Slice>& p) {
+ return p.first.as_string_view() == key;
+ }));
+ }
+
+ absl::optional<absl::string_view> GetStringValueUnknown(
+ absl::string_view key, std::string* backing) const {
+ absl::optional<absl::string_view> out;
+ for (const auto& p : unknown_) {
+ if (p.first.as_string_view() == key) {
+ if (!out.has_value()) {
+ out = p.second.as_string_view();
+ } else {
+ out = *backing = absl::StrCat(*out, ",", p.second.as_string_view());
+ }
+ }
+ }
+ return out;
+ }
+
+ // Table of known metadata types.
+ Table<Value<Traits>...> table_;
+ // Backing store for added metadata.
+ ChunkedVector<std::pair<Slice, Slice>, 10> unknown_;
+};
+
+// Ok/not-ok check for metadata maps that contain GrpcStatusMetadata, so that
+// they can be used as result types for TrySeq.
+template <typename Derived, typename... Args>
+inline bool IsStatusOk(const MetadataMap<Derived, Args...>& m) {
+ return m.get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN) ==
+ GRPC_STATUS_OK;
}
-/** Add \a elem_to_add as the last element in \a batch, using
- \a storage as backing storage for the linked list element.
- \a storage is owned by the caller and must survive for the
- lifetime of batch. This usually means it should be around
- for the lifetime of the call.
- Takes ownership of \a elem_to_add */
-grpc_error_handle grpc_metadata_batch_add_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
-
-inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- return grpc_metadata_batch_link_tail(batch, storage, idx);
+template <typename Derived, typename... Traits>
+MetadataMap<Derived, Traits...>::MetadataMap(Arena* arena) : unknown_(arena) {}
+
+template <typename Derived, typename... Traits>
+MetadataMap<Derived, Traits...>::MetadataMap(MetadataMap&& other) noexcept
+ : table_(std::move(other.table_)), unknown_(std::move(other.unknown_)) {}
+
+// We never create MetadataMap directly, instead we create Derived, but we want
+// to be able to move it without redeclaring this.
+// NOLINTNEXTLINE(misc-unconventional-assign-operator)
+template <typename Derived, typename... Traits>
+Derived& MetadataMap<Derived, Traits...>::operator=(
+ MetadataMap&& other) noexcept {
+ table_ = std::move(other.table_);
+ unknown_ = std::move(other.unknown_);
+ return static_cast<Derived&>(*this);
+}
+
+template <typename Derived, typename... Traits>
+MetadataMap<Derived, Traits...>::~MetadataMap() = default;
+
+template <typename Derived, typename... Traits>
+void MetadataMap<Derived, Traits...>::Clear() {
+ table_.ClearAll();
+ unknown_.Clear();
}
-inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_add_tail(batch, storage, idx);
+template <typename Derived, typename... Traits>
+size_t MetadataMap<Derived, Traits...>::TransportSize() const {
+ metadata_detail::TransportSizeEncoder enc;
+ Encode(&enc);
+ return enc.size();
}
-grpc_error_handle grpc_attach_md_to_error(grpc_error_handle src,
- grpc_mdelem md);
-
-struct grpc_filtered_mdelem {
- grpc_error_handle error;
- grpc_mdelem md;
-};
-#define GRPC_FILTERED_ERROR(error) \
- { (error), GRPC_MDNULL }
-#define GRPC_FILTERED_MDELEM(md) \
- { GRPC_ERROR_NONE, (md) }
-#define GRPC_FILTERED_REMOVE() \
- { GRPC_ERROR_NONE, GRPC_MDNULL }
-
-typedef grpc_filtered_mdelem (*grpc_metadata_batch_filter_func)(
- void* user_data, grpc_mdelem elem);
-grpc_error_handle grpc_metadata_batch_filter(
- grpc_metadata_batch* batch, grpc_metadata_batch_filter_func func,
- void* user_data, const char* composite_error_string) GRPC_MUST_USE_RESULT;
-
-#ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch);
-#else
-#define grpc_metadata_batch_assert_ok(batch) \
- do { \
- } while (0)
-#endif
-
-/// Copies \a src to \a dst. \a storage must point to an array of
-/// \a grpc_linked_mdelem structs of at least the same size as \a src.
-void grpc_metadata_batch_copy(grpc_metadata_batch* src,
- grpc_metadata_batch* dst,
- grpc_linked_mdelem* storage);
-
-void grpc_metadata_batch_move(grpc_metadata_batch* src,
- grpc_metadata_batch* dst);
+template <typename Derived, typename... Traits>
+Derived MetadataMap<Derived, Traits...>::Copy() const {
+ Derived out(unknown_.arena());
+ metadata_detail::CopySink<Derived> sink(&out);
+ Encode(&sink);
+ return out;
+}
+
+} // namespace grpc_core
+
+struct grpc_metadata_batch;
+
+using grpc_metadata_batch_base = grpc_core::MetadataMap<
+ grpc_metadata_batch,
+ // Colon prefixed headers first
+ grpc_core::HttpPathMetadata, grpc_core::HttpAuthorityMetadata,
+ grpc_core::HttpMethodMetadata, grpc_core::HttpStatusMetadata,
+ grpc_core::HttpSchemeMetadata,
+ // Non-colon prefixed headers begin here
+ grpc_core::ContentTypeMetadata, grpc_core::TeMetadata,
+ grpc_core::GrpcEncodingMetadata, grpc_core::GrpcInternalEncodingRequest,
+ grpc_core::GrpcAcceptEncodingMetadata, grpc_core::GrpcStatusMetadata,
+ grpc_core::GrpcTimeoutMetadata, grpc_core::GrpcPreviousRpcAttemptsMetadata,
+ grpc_core::GrpcRetryPushbackMsMetadata, grpc_core::UserAgentMetadata,
+ grpc_core::GrpcMessageMetadata, grpc_core::HostMetadata,
+ grpc_core::XEndpointLoadMetricsBinMetadata,
+ grpc_core::GrpcServerStatsBinMetadata, grpc_core::GrpcTraceBinMetadata,
+ grpc_core::GrpcTagsBinMetadata, grpc_core::GrpcLbClientStatsMetadata,
+ grpc_core::LbCostBinMetadata, grpc_core::LbTokenMetadata,
+ // Non-encodable things
+ grpc_core::GrpcStreamNetworkState, grpc_core::PeerString,
+ grpc_core::GrpcStatusContext>;
+
+struct grpc_metadata_batch : public grpc_metadata_batch_base {
+ using grpc_metadata_batch_base::grpc_metadata_batch_base;
+};
#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H */
diff --git a/grpc/src/core/lib/transport/parsed_metadata.cc b/grpc/src/core/lib/transport/parsed_metadata.cc
new file mode 100644
index 00000000..6ec657b0
--- /dev/null
+++ b/grpc/src/core/lib/transport/parsed_metadata.cc
@@ -0,0 +1,37 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/transport/parsed_metadata.h"
+
+namespace grpc_core {
+namespace metadata_detail {
+
+std::string MakeDebugString(absl::string_view key, absl::string_view value) {
+ return absl::StrCat(key, ": ", value);
+}
+
+Slice SliceFromBuffer(const Buffer& buffer) {
+ return Slice(grpc_slice_ref_internal(buffer.slice));
+}
+
+void DestroySliceValue(const Buffer& value) {
+ grpc_slice_unref_internal(value.slice);
+}
+
+void DestroyTrivialMemento(const Buffer&) {}
+
+} // namespace metadata_detail
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/transport/parsed_metadata.h b/grpc/src/core/lib/transport/parsed_metadata.h
new file mode 100644
index 00000000..a0b69944
--- /dev/null
+++ b/grpc/src/core/lib/transport/parsed_metadata.h
@@ -0,0 +1,401 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_PARSED_METADATA_H
+#define GRPC_CORE_LIB_TRANSPORT_PARSED_METADATA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+#include <type_traits>
+
+#include "absl/meta/type_traits.h"
+#include "absl/strings/match.h"
+
+#include "src/core/lib/gprpp/time.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/slice/slice.h"
+#include "src/core/lib/surface/validate_metadata.h"
+
+namespace grpc_core {
+
+using MetadataParseErrorFn =
+ absl::FunctionRef<void(absl::string_view error, const Slice& value)>;
+
+namespace metadata_detail {
+
+// Helper to determine whether a traits metadata is inlinable inside a memento,
+// or (if not) we'll need to take the memory allocation path.
+template <typename Which>
+struct HasSimpleMemento {
+ static constexpr bool value =
+ (std::is_trivial<typename Which::MementoType>::value &&
+ sizeof(typename Which::MementoType) <= sizeof(grpc_slice)) ||
+ std::is_same<typename Which::MementoType, Duration>::value;
+};
+
+// Storage type for a single metadata entry.
+union Buffer {
+ uint8_t trivial[sizeof(grpc_slice)];
+ void* pointer;
+ grpc_slice slice;
+};
+
+// Given a key and a value, concatenate together to make a debug string.
+// Split out to avoid template bloat.
+std::string MakeDebugString(absl::string_view key, absl::string_view value);
+
+// Wrapper around MakeDebugString.
+// For the value part, use two functions - one to extract a typed field from
+// Buffer, and a second (sourced from the trait) to generate a displayable debug
+// string from the field value. We try to maximize indirection/code sharing here
+// as this is not critical path code and we'd like to avoid some code bloat -
+// better to scale by number of types than then number of metadata traits!
+template <typename Field, typename CompatibleWithField, typename Display>
+GPR_ATTRIBUTE_NOINLINE std::string MakeDebugStringPipeline(
+ absl::string_view key, const Buffer& value,
+ Field (*field_from_buffer)(const Buffer&),
+ Display (*display_from_field)(CompatibleWithField)) {
+ return MakeDebugString(
+ key, absl::StrCat(display_from_field(field_from_buffer(value))));
+}
+
+// Extract a trivial field value from a Buffer - for MakeDebugStringPipeline.
+template <typename Field>
+Field FieldFromTrivial(const Buffer& value) {
+ Field field;
+ memcpy(&field, value.trivial, sizeof(Field));
+ return field;
+}
+
+// Extract a pointer field value from a Buffer - for MakeDebugStringPipeline.
+template <typename Field>
+Field FieldFromPointer(const Buffer& value) {
+ return *static_cast<const Field*>(value.pointer);
+}
+
+// Extract a Slice from a Buffer.
+Slice SliceFromBuffer(const Buffer& buffer);
+
+// Unref the grpc_slice part of a Buffer (assumes it is in fact a grpc_slice).
+void DestroySliceValue(const Buffer& value);
+
+// Destroy a trivial memento (empty function).
+void DestroyTrivialMemento(const Buffer& value);
+
+// Set a slice value in a container
+template <Slice (*MementoToValue)(Slice)>
+void SetSliceValue(Slice* set, const Buffer& value) {
+ *set = MementoToValue(SliceFromBuffer(value));
+}
+
+} // namespace metadata_detail
+
+// A parsed metadata value.
+// This type captures a type erased MementoType from one trait of
+// MetadataContainer, and provides utilities to manipulate that and to set it on
+// a MetadataContainer.
+template <typename MetadataContainer>
+class ParsedMetadata {
+ public:
+ // Construct metadata from a trait Which of MetadataContainer.
+ // Two versions: the first is for simple inlinable mementos, and the second
+ // forces an allocation.
+ template <typename Which>
+ ParsedMetadata(
+ Which,
+ absl::enable_if_t<metadata_detail::HasSimpleMemento<Which>::value,
+ typename Which::MementoType>
+ value,
+ uint32_t transport_size)
+ : vtable_(ParsedMetadata::template TrivialTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ memcpy(value_.trivial, &value, sizeof(value));
+ }
+ template <typename Which>
+ ParsedMetadata(
+ Which,
+ absl::enable_if_t<
+ !metadata_detail::HasSimpleMemento<Which>::value &&
+ !std::is_convertible<typename Which::MementoType, Slice>::value,
+ typename Which::MementoType>
+ value,
+ uint32_t transport_size)
+ : vtable_(ParsedMetadata::template NonTrivialTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ value_.pointer = new typename Which::MementoType(std::move(value));
+ }
+ // Construct metadata from a Slice typed value.
+ template <typename Which>
+ ParsedMetadata(Which, Slice value, uint32_t transport_size)
+ : vtable_(ParsedMetadata::template SliceTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ value_.slice = value.TakeCSlice();
+ }
+ // Construct metadata from a string key, slice value pair.
+ ParsedMetadata(Slice key, Slice value)
+ : vtable_(ParsedMetadata::KeyValueVTable(key.as_string_view())),
+ transport_size_(key.size() + value.size() + 32) {
+ value_.pointer =
+ new std::pair<Slice, Slice>(std::move(key), std::move(value));
+ }
+ ParsedMetadata() : vtable_(EmptyVTable()), transport_size_(0) {}
+ ~ParsedMetadata() { vtable_->destroy(value_); }
+
+ // Non copyable, but movable.
+ ParsedMetadata(const ParsedMetadata&) = delete;
+ ParsedMetadata& operator=(const ParsedMetadata&) = delete;
+ ParsedMetadata(ParsedMetadata&& other) noexcept
+ : vtable_(other.vtable_),
+ value_(other.value_),
+ transport_size_(other.transport_size_) {
+ other.vtable_ = EmptyVTable();
+ }
+ ParsedMetadata& operator=(ParsedMetadata&& other) noexcept {
+ vtable_ = other.vtable_;
+ value_ = other.value_;
+ transport_size_ = other.transport_size_;
+ other.vtable_ = EmptyVTable();
+ return *this;
+ }
+
+ // Set this parsed value on a container.
+ void SetOnContainer(MetadataContainer* container) const {
+ vtable_->set(value_, container);
+ }
+
+ // Is this a binary header or not?
+ bool is_binary_header() const { return vtable_->is_binary_header; }
+ // HTTP2 defined storage size of this metadatum.
+ uint32_t transport_size() const { return transport_size_; }
+ // Create a new parsed metadata with the same key but a different value.
+ ParsedMetadata WithNewValue(Slice value,
+ MetadataParseErrorFn on_error) const {
+ ParsedMetadata result;
+ result.vtable_ = vtable_;
+ result.value_ = value_;
+ result.transport_size_ = TransportSize(key().length(), value.length());
+ vtable_->with_new_value(&value, on_error, &result);
+ return result;
+ }
+ std::string DebugString() const { return vtable_->debug_string(value_); }
+ absl::string_view key() const {
+ if (vtable_->key == nullptr) return vtable_->key_value;
+ return vtable_->key(value_);
+ }
+
+ // TODO(ctiller): move to transport
+ static uint32_t TransportSize(uint32_t key_size, uint32_t value_size) {
+ // TODO(ctiller): use hpack constant?
+ return key_size + value_size + 32;
+ }
+
+ private:
+ using Buffer = metadata_detail::Buffer;
+
+ struct VTable {
+ const bool is_binary_header;
+ void (*const destroy)(const Buffer& value);
+ void (*const set)(const Buffer& value, MetadataContainer* container);
+ // result is a bitwise copy of the originating ParsedMetadata.
+ void (*const with_new_value)(Slice* new_value,
+ MetadataParseErrorFn on_error,
+ ParsedMetadata* result);
+ std::string (*const debug_string)(const Buffer& value);
+ // The key - if key is null, use key_value, otherwise call key.
+ absl::string_view key_value;
+ absl::string_view (*const key)(const Buffer& value);
+ };
+
+ static const VTable* EmptyVTable();
+ static const VTable* KeyValueVTable(absl::string_view key);
+ template <typename Which>
+ static const VTable* TrivialTraitVTable();
+ template <typename Which>
+ static const VTable* NonTrivialTraitVTable();
+ template <typename Which>
+ static const VTable* SliceTraitVTable();
+
+ template <Slice (*ParseMemento)(Slice, MetadataParseErrorFn)>
+ GPR_ATTRIBUTE_NOINLINE static void WithNewValueSetSlice(
+ Slice* slice, MetadataParseErrorFn on_error, ParsedMetadata* result) {
+ result->value_.slice =
+ ParseMemento(std::move(*slice), on_error).TakeCSlice();
+ }
+
+ template <typename T, T (*ParseMemento)(Slice, MetadataParseErrorFn)>
+ GPR_ATTRIBUTE_NOINLINE static void WithNewValueSetTrivial(
+ Slice* slice, MetadataParseErrorFn on_error, ParsedMetadata* result) {
+ T memento = ParseMemento(std::move(*slice), on_error);
+ memcpy(result->value_.trivial, &memento, sizeof(memento));
+ }
+
+ const VTable* vtable_;
+ Buffer value_;
+ uint32_t transport_size_;
+};
+
+namespace metadata_detail {} // namespace metadata_detail
+
+template <typename MetadataContainer>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::EmptyVTable() {
+ static const VTable vtable = {
+ false,
+ // destroy
+ metadata_detail::DestroyTrivialMemento,
+ // set
+ [](const Buffer&, MetadataContainer*) {},
+ // with_new_value
+ [](Slice*, MetadataParseErrorFn, ParsedMetadata*) {},
+ // debug_string
+ [](const Buffer&) -> std::string { return "empty"; },
+ // key
+ "",
+ nullptr,
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::TrivialTraitVTable() {
+ static const VTable vtable = {
+ absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ metadata_detail::DestroyTrivialMemento,
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ map->Set(
+ Which(),
+ Which::MementoToValue(
+ metadata_detail::FieldFromTrivial<typename Which::MementoType>(
+ value)));
+ },
+ // with_new_value
+ WithNewValueSetTrivial<typename Which::MementoType, Which::ParseMemento>,
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value,
+ metadata_detail::FieldFromTrivial<typename Which::MementoType>,
+ Which::DisplayValue);
+ },
+ // key
+ Which::key(),
+ nullptr,
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::NonTrivialTraitVTable() {
+ static const VTable vtable = {
+ absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ [](const Buffer& value) {
+ delete static_cast<typename Which::MementoType*>(value.pointer);
+ },
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ auto* p = static_cast<typename Which::MementoType*>(value.pointer);
+ map->Set(Which(), Which::MementoToValue(*p));
+ },
+ // with_new_value
+ [](Slice* value, MetadataParseErrorFn on_error, ParsedMetadata* result) {
+ result->value_.pointer = new typename Which::MementoType(
+ Which::ParseMemento(std::move(*value), on_error));
+ },
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value,
+ metadata_detail::FieldFromPointer<typename Which::MementoType>,
+ Which::DisplayValue);
+ },
+ // key
+ Which::key(),
+ nullptr,
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::SliceTraitVTable() {
+ static const VTable vtable = {
+ absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ metadata_detail::DestroySliceValue,
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ metadata_detail::SetSliceValue<Which::MementoToValue>(
+ map->GetOrCreatePointer(Which()), value);
+ },
+ // with_new_value
+ WithNewValueSetSlice<Which::ParseMemento>,
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value, metadata_detail::SliceFromBuffer,
+ Which::DisplayValue);
+ },
+ // key
+ Which::key(),
+ nullptr,
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::KeyValueVTable(absl::string_view key) {
+ using KV = std::pair<Slice, Slice>;
+ static const auto destroy = [](const Buffer& value) {
+ delete static_cast<KV*>(value.pointer);
+ };
+ static const auto set = [](const Buffer& value, MetadataContainer* map) {
+ auto* p = static_cast<KV*>(value.pointer);
+ map->AppendUnknown(p->first.as_string_view(), p->second.Ref());
+ };
+ static const auto with_new_value = [](Slice* value, MetadataParseErrorFn,
+ ParsedMetadata* result) {
+ auto* p = new KV{
+ static_cast<KV*>(result->value_.pointer)->first.Ref(),
+ std::move(*value),
+ };
+ result->value_.pointer = p;
+ };
+ static const auto debug_string = [](const Buffer& value) {
+ auto* p = static_cast<KV*>(value.pointer);
+ return absl::StrCat(p->first.as_string_view(), ": ",
+ p->second.as_string_view());
+ };
+ static const auto key_fn = [](const Buffer& value) {
+ return static_cast<KV*>(value.pointer)->first.as_string_view();
+ };
+ static const VTable vtable[2] = {
+ {false, destroy, set, with_new_value, debug_string, "", key_fn},
+ {true, destroy, set, with_new_value, debug_string, "", key_fn},
+ };
+ return &vtable[absl::EndsWith(key, "-bin")];
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_TRANSPORT_PARSED_METADATA_H
diff --git a/grpc/src/core/lib/transport/pid_controller.cc b/grpc/src/core/lib/transport/pid_controller.cc
index dbc98f49..c0dc38ad 100644
--- a/grpc/src/core/lib/transport/pid_controller.cc
+++ b/grpc/src/core/lib/transport/pid_controller.cc
@@ -31,8 +31,8 @@ double PidController::Update(double error, double dt) {
if (dt <= 0) return last_control_value_;
/* integrate error using the trapezoid rule */
error_integral_ += dt * (last_error_ + error) * 0.5;
- error_integral_ = GPR_CLAMP(error_integral_, -args_.integral_range(),
- args_.integral_range());
+ error_integral_ =
+ Clamp(error_integral_, -args_.integral_range(), args_.integral_range());
double diff_error = (error - last_error_) / dt;
/* calculate derivative of control value vs time */
double dc_dt = args_.gain_p() * error + args_.gain_i() * error_integral_ +
@@ -40,8 +40,8 @@ double PidController::Update(double error, double dt) {
/* and perform trapezoidal integration */
double new_control_value =
last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5;
- new_control_value = GPR_CLAMP(new_control_value, args_.min_control_value(),
- args_.max_control_value());
+ new_control_value = Clamp(new_control_value, args_.min_control_value(),
+ args_.max_control_value());
last_error_ = error;
last_dc_dt_ = dc_dt;
last_control_value_ = new_control_value;
diff --git a/grpc/src/core/lib/transport/static_metadata.cc b/grpc/src/core/lib/transport/static_metadata.cc
deleted file mode 100644
index 483a40f0..00000000
--- a/grpc/src/core/lib/transport/static_metadata.cc
+++ /dev/null
@@ -1,1249 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * WARNING: Auto-generated code.
- *
- * To make changes to this file, change
- * tools/codegen/core/gen_static_metadata.py, and then re-run it.
- *
- * See metadata.h for an explanation of the interface here, and metadata.cc for
- * an explanation of what's going on.
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/transport/static_metadata.h"
-
-#include "src/core/lib/slice/slice_internal.h"
-
-static constexpr uint8_t g_bytes[] = {
- 58, 112, 97, 116, 104, 58, 109, 101, 116, 104, 111, 100, 58, 115, 116,
- 97, 116, 117, 115, 58, 97, 117, 116, 104, 111, 114, 105, 116, 121, 58,
- 115, 99, 104, 101, 109, 101, 116, 101, 103, 114, 112, 99, 45, 109, 101,
- 115, 115, 97, 103, 101, 103, 114, 112, 99, 45, 115, 116, 97, 116, 117,
- 115, 103, 114, 112, 99, 45, 112, 97, 121, 108, 111, 97, 100, 45, 98,
- 105, 110, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103,
- 103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99,
- 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 115, 101, 114, 118, 101,
- 114, 45, 115, 116, 97, 116, 115, 45, 98, 105, 110, 103, 114, 112, 99,
- 45, 116, 97, 103, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116,
- 114, 97, 99, 101, 45, 98, 105, 110, 99, 111, 110, 116, 101, 110, 116,
- 45, 116, 121, 112, 101, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110,
- 99, 111, 100, 105, 110, 103, 97, 99, 99, 101, 112, 116, 45, 101, 110,
- 99, 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 105, 110, 116, 101,
- 114, 110, 97, 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114,
- 101, 113, 117, 101, 115, 116, 103, 114, 112, 99, 45, 105, 110, 116, 101,
- 114, 110, 97, 108, 45, 115, 116, 114, 101, 97, 109, 45, 101, 110, 99,
- 111, 100, 105, 110, 103, 45, 114, 101, 113, 117, 101, 115, 116, 117, 115,
- 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, 116, 103, 114, 112,
- 99, 45, 112, 114, 101, 118, 105, 111, 117, 115, 45, 114, 112, 99, 45,
- 97, 116, 116, 101, 109, 112, 116, 115, 103, 114, 112, 99, 45, 114, 101,
- 116, 114, 121, 45, 112, 117, 115, 104, 98, 97, 99, 107, 45, 109, 115,
- 120, 45, 101, 110, 100, 112, 111, 105, 110, 116, 45, 108, 111, 97, 100,
- 45, 109, 101, 116, 114, 105, 99, 115, 45, 98, 105, 110, 103, 114, 112,
- 99, 45, 116, 105, 109, 101, 111, 117, 116, 49, 50, 51, 52, 103, 114,
- 112, 99, 46, 119, 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97,
- 100, 121, 103, 114, 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103,
- 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116,
- 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103,
- 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115,
- 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115,
- 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97,
- 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110,
- 99, 101, 76, 111, 97, 100, 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, 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};
-
-grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount;
-
-namespace grpc_core {
-struct StaticMetadataCtx {
-#ifndef NDEBUG
- const uint64_t init_canary = kGrpcStaticMetadataInitCanary;
-#endif
- StaticSliceRefcount refcounts[GRPC_STATIC_MDSTR_COUNT] = {
-
- StaticSliceRefcount(0), StaticSliceRefcount(1),
- StaticSliceRefcount(2), StaticSliceRefcount(3),
- StaticSliceRefcount(4), StaticSliceRefcount(5),
- StaticSliceRefcount(6), StaticSliceRefcount(7),
- StaticSliceRefcount(8), StaticSliceRefcount(9),
- StaticSliceRefcount(10), StaticSliceRefcount(11),
- StaticSliceRefcount(12), StaticSliceRefcount(13),
- StaticSliceRefcount(14), StaticSliceRefcount(15),
- StaticSliceRefcount(16), StaticSliceRefcount(17),
- StaticSliceRefcount(18), StaticSliceRefcount(19),
- StaticSliceRefcount(20), StaticSliceRefcount(21),
- StaticSliceRefcount(22), StaticSliceRefcount(23),
- StaticSliceRefcount(24), StaticSliceRefcount(25),
- StaticSliceRefcount(26), StaticSliceRefcount(27),
- StaticSliceRefcount(28), StaticSliceRefcount(29),
- StaticSliceRefcount(30), StaticSliceRefcount(31),
- StaticSliceRefcount(32), StaticSliceRefcount(33),
- StaticSliceRefcount(34), StaticSliceRefcount(35),
- StaticSliceRefcount(36), StaticSliceRefcount(37),
- StaticSliceRefcount(38), StaticSliceRefcount(39),
- StaticSliceRefcount(40), StaticSliceRefcount(41),
- StaticSliceRefcount(42), StaticSliceRefcount(43),
- StaticSliceRefcount(44), StaticSliceRefcount(45),
- StaticSliceRefcount(46), StaticSliceRefcount(47),
- StaticSliceRefcount(48), StaticSliceRefcount(49),
- StaticSliceRefcount(50), StaticSliceRefcount(51),
- StaticSliceRefcount(52), StaticSliceRefcount(53),
- StaticSliceRefcount(54), StaticSliceRefcount(55),
- StaticSliceRefcount(56), StaticSliceRefcount(57),
- StaticSliceRefcount(58), StaticSliceRefcount(59),
- StaticSliceRefcount(60), StaticSliceRefcount(61),
- StaticSliceRefcount(62), StaticSliceRefcount(63),
- StaticSliceRefcount(64), StaticSliceRefcount(65),
- StaticSliceRefcount(66), StaticSliceRefcount(67),
- StaticSliceRefcount(68), StaticSliceRefcount(69),
- StaticSliceRefcount(70), StaticSliceRefcount(71),
- StaticSliceRefcount(72), StaticSliceRefcount(73),
- StaticSliceRefcount(74), StaticSliceRefcount(75),
- StaticSliceRefcount(76), StaticSliceRefcount(77),
- StaticSliceRefcount(78), StaticSliceRefcount(79),
- StaticSliceRefcount(80), StaticSliceRefcount(81),
- StaticSliceRefcount(82), StaticSliceRefcount(83),
- StaticSliceRefcount(84), StaticSliceRefcount(85),
- StaticSliceRefcount(86), StaticSliceRefcount(87),
- StaticSliceRefcount(88), StaticSliceRefcount(89),
- StaticSliceRefcount(90), StaticSliceRefcount(91),
- StaticSliceRefcount(92), StaticSliceRefcount(93),
- StaticSliceRefcount(94), StaticSliceRefcount(95),
- StaticSliceRefcount(96), StaticSliceRefcount(97),
- StaticSliceRefcount(98), StaticSliceRefcount(99),
- StaticSliceRefcount(100), StaticSliceRefcount(101),
- StaticSliceRefcount(102), StaticSliceRefcount(103),
- StaticSliceRefcount(104), StaticSliceRefcount(105),
- StaticSliceRefcount(106), StaticSliceRefcount(107),
- StaticSliceRefcount(108), StaticSliceRefcount(109),
- };
-
- const StaticMetadataSlice slices[GRPC_STATIC_MDSTR_COUNT] = {
-
- grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[3].base, 10, g_bytes + 19),
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[5].base, 2, g_bytes + 36),
- grpc_core::StaticMetadataSlice(&refcounts[6].base, 12, g_bytes + 38),
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[8].base, 16, g_bytes + 61),
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[11].base, 21, g_bytes + 110),
- grpc_core::StaticMetadataSlice(&refcounts[12].base, 13, g_bytes + 131),
- grpc_core::StaticMetadataSlice(&refcounts[13].base, 14, g_bytes + 144),
- grpc_core::StaticMetadataSlice(&refcounts[14].base, 12, g_bytes + 158),
- grpc_core::StaticMetadataSlice(&refcounts[15].base, 16, g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[17].base, 30, g_bytes + 201),
- grpc_core::StaticMetadataSlice(&refcounts[18].base, 37, g_bytes + 231),
- grpc_core::StaticMetadataSlice(&refcounts[19].base, 10, g_bytes + 268),
- grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278),
- grpc_core::StaticMetadataSlice(&refcounts[21].base, 26, g_bytes + 282),
- grpc_core::StaticMetadataSlice(&refcounts[22].base, 22, g_bytes + 308),
- grpc_core::StaticMetadataSlice(&refcounts[23].base, 27, g_bytes + 330),
- grpc_core::StaticMetadataSlice(&refcounts[24].base, 12, g_bytes + 357),
- grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369),
- grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370),
- grpc_core::StaticMetadataSlice(&refcounts[27].base, 1, g_bytes + 371),
- grpc_core::StaticMetadataSlice(&refcounts[28].base, 1, g_bytes + 372),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- grpc_core::StaticMetadataSlice(&refcounts[30].base, 19, g_bytes + 373),
- grpc_core::StaticMetadataSlice(&refcounts[31].base, 12, g_bytes + 392),
- grpc_core::StaticMetadataSlice(&refcounts[32].base, 30, g_bytes + 404),
- 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),
- };
- StaticMetadata static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[3].base, 10, g_bytes + 19),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 0),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- 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),
- 2),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- 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),
- 4),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- 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),
- 6),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- 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),
- 8),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- 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),
- 10),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- 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),
- 12),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- 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[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),
- 15),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 17),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 19),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 21),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 23),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[66].base, 19,
- g_bytes + 1012),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 24),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
- g_bytes + 170),
- 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[29].base, 0, g_bytes + 373),
- 26),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 28),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[70].base, 13,
- g_bytes + 1077),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 29),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[14].base, 12,
- g_bytes + 158),
- 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[29].base, 0, g_bytes + 373),
- 31),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 33),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 35),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[76].base, 4,
- g_bytes + 1117),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 36),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278),
- 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[29].base, 0, g_bytes + 373),
- 38),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 40),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 42),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 44),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 46),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 48),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 50),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 52),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 54),
- StaticMetadata(
- 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[29].base, 0, g_bytes + 373),
- 56),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[19].base, 10,
- g_bytes + 268),
- 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[29].base, 0, g_bytes + 373),
- 58),
- StaticMetadata(
- 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[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),
- 61),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369),
- 62),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370),
- 63),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- 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),
- 65),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- 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),
- 67),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[14].base, 12,
- g_bytes + 158),
- 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),
- 69),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[104].base, 3,
- g_bytes + 1408),
- 70),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 71),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
- g_bytes + 170),
- 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),
- 73),
- StaticMetadata(
- 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),
- 75),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- 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),
- 77),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- 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),
- 79),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- 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),
- 81),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- 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),
- 83),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
- g_bytes + 1438),
- 84),
- };
-
- /* Warning: the core static metadata currently operates under the soft
- constraint that the first GRPC_CHTTP2_LAST_STATIC_ENTRY (61) entries must
- contain metadata specified by the http2 hpack standard. The CHTTP2 transport
- reads the core metadata with this assumption in mind. If the order of the core
- static metadata is to be changed, then the CHTTP2 transport must be changed as
- well to stop relying on the core metadata. */
-
- grpc_mdelem static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT] = {
- // clang-format off
- /* GRPC_MDELEM_AUTHORITY_EMPTY:
- ":authority": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[0].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_METHOD_GET:
- ":method": "GET" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[1].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_METHOD_POST:
- ":method": "POST" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[2].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_PATH_SLASH:
- ":path": "/" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[3].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML:
- ":path": "/index.html" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[4].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_SCHEME_HTTP:
- ":scheme": "http" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[5].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_SCHEME_HTTPS:
- ":scheme": "https" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[6].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_200:
- ":status": "200" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[7].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_204:
- ":status": "204" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[8].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_206:
- ":status": "206" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[9].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_304:
- ":status": "304" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[10].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_400:
- ":status": "400" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[11].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_404:
- ":status": "404" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[12].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STATUS_500:
- ":status": "500" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[13].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_CHARSET_EMPTY:
- "accept-charset": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[14].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE:
- "accept-encoding": "gzip, deflate" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[15].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY:
- "accept-language": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[16].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_RANGES_EMPTY:
- "accept-ranges": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[17].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_EMPTY:
- "accept": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[18].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY:
- "access-control-allow-origin": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[19].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_AGE_EMPTY:
- "age": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[20].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ALLOW_EMPTY:
- "allow": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[21].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_AUTHORIZATION_EMPTY:
- "authorization": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[22].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CACHE_CONTROL_EMPTY:
- "cache-control": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[23].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY:
- "content-disposition": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[24].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_ENCODING_EMPTY:
- "content-encoding": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[25].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY:
- "content-language": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[26].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_LENGTH_EMPTY:
- "content-length": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[27].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_LOCATION_EMPTY:
- "content-location": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[28].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_RANGE_EMPTY:
- "content-range": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[29].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_TYPE_EMPTY:
- "content-type": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[30].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_COOKIE_EMPTY:
- "cookie": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[31].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_DATE_EMPTY:
- "date": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[32].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ETAG_EMPTY:
- "etag": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[33].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_EXPECT_EMPTY:
- "expect": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[34].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_EXPIRES_EMPTY:
- "expires": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[35].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_FROM_EMPTY:
- "from": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[36].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_HOST_EMPTY:
- "host": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[37].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_IF_MATCH_EMPTY:
- "if-match": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[38].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY:
- "if-modified-since": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[39].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_IF_NONE_MATCH_EMPTY:
- "if-none-match": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[40].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_IF_RANGE_EMPTY:
- "if-range": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[41].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY:
- "if-unmodified-since": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[42].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_LAST_MODIFIED_EMPTY:
- "last-modified": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[43].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_LINK_EMPTY:
- "link": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[44].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_LOCATION_EMPTY:
- "location": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[45].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_MAX_FORWARDS_EMPTY:
- "max-forwards": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[46].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY:
- "proxy-authenticate": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[47].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY:
- "proxy-authorization": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[48].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_RANGE_EMPTY:
- "range": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[49].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_REFERER_EMPTY:
- "referer": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[50].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_REFRESH_EMPTY:
- "refresh": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[51].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_RETRY_AFTER_EMPTY:
- "retry-after": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[52].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_SERVER_EMPTY:
- "server": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[53].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_SET_COOKIE_EMPTY:
- "set-cookie": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[54].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY:
- "strict-transport-security": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[55].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_TRANSFER_ENCODING_EMPTY:
- "transfer-encoding": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[56].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_USER_AGENT_EMPTY:
- "user-agent": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[57].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_VARY_EMPTY:
- "vary": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[58].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_VIA_EMPTY:
- "via": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[59].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY:
- "www-authenticate": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[60].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_STATUS_0:
- "grpc-status": "0" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[61].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_STATUS_1:
- "grpc-status": "1" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[62].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_STATUS_2:
- "grpc-status": "2" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[63].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ENCODING_IDENTITY:
- "grpc-encoding": "identity" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[64].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ENCODING_GZIP:
- "grpc-encoding": "gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[65].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ENCODING_DEFLATE:
- "grpc-encoding": "deflate" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[66].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_TE_TRAILERS:
- "te": "trailers" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[67].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC:
- "content-type": "application/grpc" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[68].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_SCHEME_GRPC:
- ":scheme": "grpc" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[69].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_METHOD_PUT:
- ":method": "PUT" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[70].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_ENCODING_EMPTY:
- "accept-encoding": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[71].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_ENCODING_IDENTITY:
- "content-encoding": "identity" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[72].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_CONTENT_ENCODING_GZIP:
- "content-encoding": "gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[73].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_LB_COST_BIN_EMPTY:
- "lb-cost-bin": "" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[74].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY:
- "grpc-accept-encoding": "identity" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[75].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE:
- "grpc-accept-encoding": "deflate" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[76].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE:
- "grpc-accept-encoding": "identity,deflate" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[77].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP:
- "grpc-accept-encoding": "gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[78].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP:
- "grpc-accept-encoding": "identity,gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[79].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP:
- "grpc-accept-encoding": "deflate,gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[80].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP:
- "grpc-accept-encoding": "identity,deflate,gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[81].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY:
- "accept-encoding": "identity" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[82].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_ENCODING_GZIP:
- "accept-encoding": "gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[83].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP:
- "accept-encoding": "identity,gzip" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[84].data(),
- GRPC_MDELEM_STORAGE_STATIC)
- // clang-format on
- };
-};
-} // namespace grpc_core
-
-namespace grpc_core {
-static StaticMetadataCtx* g_static_metadata_slice_ctx = nullptr;
-const StaticMetadataSlice* g_static_metadata_slice_table = nullptr;
-StaticSliceRefcount* g_static_metadata_slice_refcounts = nullptr;
-StaticMetadata* g_static_mdelem_table = nullptr;
-grpc_mdelem* g_static_mdelem_manifested = nullptr;
-#ifndef NDEBUG
-uint64_t StaticMetadataInitCanary() {
- return g_static_metadata_slice_ctx->init_canary;
-}
-#endif
-} // namespace grpc_core
-
-void grpc_init_static_metadata_ctx(void) {
- grpc_core::g_static_metadata_slice_ctx = new grpc_core::StaticMetadataCtx();
- grpc_core::g_static_metadata_slice_table =
- grpc_core::g_static_metadata_slice_ctx->slices;
- grpc_core::g_static_metadata_slice_refcounts =
- grpc_core::g_static_metadata_slice_ctx->refcounts;
- grpc_core::g_static_mdelem_table =
- grpc_core::g_static_metadata_slice_ctx->static_mdelem_table;
- grpc_core::g_static_mdelem_manifested =
- grpc_core::g_static_metadata_slice_ctx->static_mdelem_manifested;
-}
-
-void grpc_destroy_static_metadata_ctx(void) {
- delete grpc_core::g_static_metadata_slice_ctx;
- grpc_core::g_static_metadata_slice_ctx = nullptr;
- grpc_core::g_static_metadata_slice_table = nullptr;
- grpc_core::g_static_metadata_slice_refcounts = nullptr;
- grpc_core::g_static_mdelem_table = nullptr;
- grpc_core::g_static_mdelem_manifested = nullptr;
-}
-
-uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
- 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, 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, 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};
-static uint32_t elems_phash(uint32_t i) {
- 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 = static_cast<uint32_t>(elems_r[y]);
- h += delta;
- }
- return h;
-}
-
-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};
-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};
-
-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 h = elems_phash(k);
- return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k &&
- elem_idxs[h] != 255
- ? GRPC_MAKE_MDELEM(
- &grpc_static_mdelem_table()[elem_idxs[h]].data(),
- GRPC_MDELEM_STORAGE_STATIC)
- : GRPC_MDNULL;
-}
-
-const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 75, 76, 77,
- 78, 79, 80, 81};
-
-const uint8_t grpc_static_accept_stream_encoding_metadata[4] = {0, 82, 83, 84};
diff --git a/grpc/src/core/lib/transport/static_metadata.h b/grpc/src/core/lib/transport/static_metadata.h
deleted file mode 100644
index 5d844af5..00000000
--- a/grpc/src/core/lib/transport/static_metadata.h
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * WARNING: Auto-generated code.
- *
- * To make changes to this file, change
- * tools/codegen/core/gen_static_metadata.py, and then re-run it.
- *
- * See metadata.h for an explanation of the interface here, and metadata.cc for
- * an explanation of what's going on.
- */
-
-#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
-#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <cstdint>
-
-#include "src/core/lib/transport/metadata.h"
-
-static_assert(
- std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
- "grpc_core::StaticMetadataSlice must be trivially destructible.");
-#define GRPC_STATIC_MDSTR_COUNT 110
-
-void grpc_init_static_metadata_ctx(void);
-void grpc_destroy_static_metadata_ctx(void);
-namespace grpc_core {
-#ifndef NDEBUG
-constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
-uint64_t StaticMetadataInitCanary();
-#endif
-extern const StaticMetadataSlice* g_static_metadata_slice_table;
-} // namespace grpc_core
-inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_table != nullptr);
- return grpc_core::g_static_metadata_slice_table;
-}
-
-/* ":path" */
-#define GRPC_MDSTR_PATH (grpc_static_slice_table()[0])
-/* ":method" */
-#define GRPC_MDSTR_METHOD (grpc_static_slice_table()[1])
-/* ":status" */
-#define GRPC_MDSTR_STATUS (grpc_static_slice_table()[2])
-/* ":authority" */
-#define GRPC_MDSTR_AUTHORITY (grpc_static_slice_table()[3])
-/* ":scheme" */
-#define GRPC_MDSTR_SCHEME (grpc_static_slice_table()[4])
-/* "te" */
-#define GRPC_MDSTR_TE (grpc_static_slice_table()[5])
-/* "grpc-message" */
-#define GRPC_MDSTR_GRPC_MESSAGE (grpc_static_slice_table()[6])
-/* "grpc-status" */
-#define GRPC_MDSTR_GRPC_STATUS (grpc_static_slice_table()[7])
-/* "grpc-payload-bin" */
-#define GRPC_MDSTR_GRPC_PAYLOAD_BIN (grpc_static_slice_table()[8])
-/* "grpc-encoding" */
-#define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table()[9])
-/* "grpc-accept-encoding" */
-#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table()[10])
-/* "grpc-server-stats-bin" */
-#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table()[11])
-/* "grpc-tags-bin" */
-#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table()[12])
-/* "grpc-trace-bin" */
-#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table()[13])
-/* "content-type" */
-#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table()[14])
-/* "content-encoding" */
-#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table()[15])
-/* "accept-encoding" */
-#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table()[16])
-/* "grpc-internal-encoding-request" */
-#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
- (grpc_static_slice_table()[17])
-/* "grpc-internal-stream-encoding-request" */
-#define GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST \
- (grpc_static_slice_table()[18])
-/* "user-agent" */
-#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table()[19])
-/* "host" */
-#define GRPC_MDSTR_HOST (grpc_static_slice_table()[20])
-/* "grpc-previous-rpc-attempts" */
-#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table()[21])
-/* "grpc-retry-pushback-ms" */
-#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table()[22])
-/* "x-endpoint-load-metrics-bin" */
-#define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN (grpc_static_slice_table()[23])
-/* "grpc-timeout" */
-#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[24])
-/* "1" */
-#define GRPC_MDSTR_1 (grpc_static_slice_table()[25])
-/* "2" */
-#define GRPC_MDSTR_2 (grpc_static_slice_table()[26])
-/* "3" */
-#define GRPC_MDSTR_3 (grpc_static_slice_table()[27])
-/* "4" */
-#define GRPC_MDSTR_4 (grpc_static_slice_table()[28])
-/* "" */
-#define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[29])
-/* "grpc.wait_for_ready" */
-#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[30])
-/* "grpc.timeout" */
-#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[31])
-/* "grpc.max_request_message_bytes" */
-#define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \
- (grpc_static_slice_table()[32])
-/* "grpc.max_response_message_bytes" */
-#define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \
- (grpc_static_slice_table()[33])
-/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
-#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
- (grpc_static_slice_table()[34])
-/* "/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])
-/* "/grpc.health.v1.Health/Watch" */
-#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
- (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])
-/* "deflate" */
-#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[40])
-/* "gzip" */
-#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[41])
-/* "stream/gzip" */
-#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[42])
-/* "GET" */
-#define GRPC_MDSTR_GET (grpc_static_slice_table()[43])
-/* "POST" */
-#define GRPC_MDSTR_POST (grpc_static_slice_table()[44])
-/* "/" */
-#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[45])
-/* "/index.html" */
-#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[46])
-/* "http" */
-#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[47])
-/* "https" */
-#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[48])
-/* "200" */
-#define GRPC_MDSTR_200 (grpc_static_slice_table()[49])
-/* "204" */
-#define GRPC_MDSTR_204 (grpc_static_slice_table()[50])
-/* "206" */
-#define GRPC_MDSTR_206 (grpc_static_slice_table()[51])
-/* "304" */
-#define GRPC_MDSTR_304 (grpc_static_slice_table()[52])
-/* "400" */
-#define GRPC_MDSTR_400 (grpc_static_slice_table()[53])
-/* "404" */
-#define GRPC_MDSTR_404 (grpc_static_slice_table()[54])
-/* "500" */
-#define GRPC_MDSTR_500 (grpc_static_slice_table()[55])
-/* "accept-charset" */
-#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[56])
-/* "gzip, deflate" */
-#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[57])
-/* "accept-language" */
-#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[58])
-/* "accept-ranges" */
-#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[59])
-/* "accept" */
-#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])
-/* "age" */
-#define GRPC_MDSTR_AGE (grpc_static_slice_table()[62])
-/* "allow" */
-#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[63])
-/* "authorization" */
-#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[64])
-/* "cache-control" */
-#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[65])
-/* "content-disposition" */
-#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[66])
-/* "content-language" */
-#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[67])
-/* "content-length" */
-#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[68])
-/* "content-location" */
-#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[69])
-/* "content-range" */
-#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[70])
-/* "cookie" */
-#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[71])
-/* "date" */
-#define GRPC_MDSTR_DATE (grpc_static_slice_table()[72])
-/* "etag" */
-#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[73])
-/* "expect" */
-#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[74])
-/* "expires" */
-#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[75])
-/* "from" */
-#define GRPC_MDSTR_FROM (grpc_static_slice_table()[76])
-/* "if-match" */
-#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[77])
-/* "if-modified-since" */
-#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])
-/* "if-range" */
-#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[80])
-/* "if-unmodified-since" */
-#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[81])
-/* "last-modified" */
-#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[82])
-/* "link" */
-#define GRPC_MDSTR_LINK (grpc_static_slice_table()[83])
-/* "location" */
-#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[84])
-/* "max-forwards" */
-#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[85])
-/* "proxy-authenticate" */
-#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[86])
-/* "proxy-authorization" */
-#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[87])
-/* "range" */
-#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[88])
-/* "referer" */
-#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[89])
-/* "refresh" */
-#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[90])
-/* "retry-after" */
-#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[91])
-/* "server" */
-#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[92])
-/* "set-cookie" */
-#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[93])
-/* "strict-transport-security" */
-#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[94])
-/* "transfer-encoding" */
-#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[95])
-/* "vary" */
-#define GRPC_MDSTR_VARY (grpc_static_slice_table()[96])
-/* "via" */
-#define GRPC_MDSTR_VIA (grpc_static_slice_table()[97])
-/* "www-authenticate" */
-#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[98])
-/* "0" */
-#define GRPC_MDSTR_0 (grpc_static_slice_table()[99])
-/* "identity" */
-#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[100])
-/* "trailers" */
-#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[101])
-/* "application/grpc" */
-#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[102])
-/* "grpc" */
-#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[103])
-/* "PUT" */
-#define GRPC_MDSTR_PUT (grpc_static_slice_table()[104])
-/* "lb-cost-bin" */
-#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[105])
-/* "identity,deflate" */
-#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[106])
-/* "identity,gzip" */
-#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[107])
-/* "deflate,gzip" */
-#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])
-
-namespace grpc_core {
-struct StaticSliceRefcount;
-extern StaticSliceRefcount* g_static_metadata_slice_refcounts;
-} // namespace grpc_core
-inline grpc_core::StaticSliceRefcount* grpc_static_metadata_refcounts() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_refcounts != nullptr);
- return grpc_core::g_static_metadata_slice_refcounts;
-}
-
-#define GRPC_IS_STATIC_METADATA_STRING(slice) \
- ((slice).refcount != NULL && \
- (slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC)
-
-#define GRPC_STATIC_METADATA_INDEX(static_slice) \
- (reinterpret_cast<grpc_core::StaticSliceRefcount*>((static_slice).refcount) \
- ->index)
-
-#define GRPC_STATIC_MDELEM_COUNT 85
-
-namespace grpc_core {
-extern StaticMetadata* g_static_mdelem_table;
-extern grpc_mdelem* g_static_mdelem_manifested;
-} // namespace grpc_core
-inline grpc_core::StaticMetadata* grpc_static_mdelem_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_table != nullptr);
- return grpc_core::g_static_mdelem_table;
-}
-inline grpc_mdelem* grpc_static_mdelem_manifested() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_manifested != nullptr);
- return grpc_core::g_static_mdelem_manifested;
-}
-
-extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
-/* ":authority": "" */
-#define GRPC_MDELEM_AUTHORITY_EMPTY (grpc_static_mdelem_manifested()[0])
-/* ":method": "GET" */
-#define GRPC_MDELEM_METHOD_GET (grpc_static_mdelem_manifested()[1])
-/* ":method": "POST" */
-#define GRPC_MDELEM_METHOD_POST (grpc_static_mdelem_manifested()[2])
-/* ":path": "/" */
-#define GRPC_MDELEM_PATH_SLASH (grpc_static_mdelem_manifested()[3])
-/* ":path": "/index.html" */
-#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
- (grpc_static_mdelem_manifested()[4])
-/* ":scheme": "http" */
-#define GRPC_MDELEM_SCHEME_HTTP (grpc_static_mdelem_manifested()[5])
-/* ":scheme": "https" */
-#define GRPC_MDELEM_SCHEME_HTTPS (grpc_static_mdelem_manifested()[6])
-/* ":status": "200" */
-#define GRPC_MDELEM_STATUS_200 (grpc_static_mdelem_manifested()[7])
-/* ":status": "204" */
-#define GRPC_MDELEM_STATUS_204 (grpc_static_mdelem_manifested()[8])
-/* ":status": "206" */
-#define GRPC_MDELEM_STATUS_206 (grpc_static_mdelem_manifested()[9])
-/* ":status": "304" */
-#define GRPC_MDELEM_STATUS_304 (grpc_static_mdelem_manifested()[10])
-/* ":status": "400" */
-#define GRPC_MDELEM_STATUS_400 (grpc_static_mdelem_manifested()[11])
-/* ":status": "404" */
-#define GRPC_MDELEM_STATUS_404 (grpc_static_mdelem_manifested()[12])
-/* ":status": "500" */
-#define GRPC_MDELEM_STATUS_500 (grpc_static_mdelem_manifested()[13])
-/* "accept-charset": "" */
-#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (grpc_static_mdelem_manifested()[14])
-/* "accept-encoding": "gzip, deflate" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \
- (grpc_static_mdelem_manifested()[15])
-/* "accept-language": "" */
-#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[16])
-/* "accept-ranges": "" */
-#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (grpc_static_mdelem_manifested()[17])
-/* "accept": "" */
-#define GRPC_MDELEM_ACCEPT_EMPTY (grpc_static_mdelem_manifested()[18])
-/* "access-control-allow-origin": "" */
-#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \
- (grpc_static_mdelem_manifested()[19])
-/* "age": "" */
-#define GRPC_MDELEM_AGE_EMPTY (grpc_static_mdelem_manifested()[20])
-/* "allow": "" */
-#define GRPC_MDELEM_ALLOW_EMPTY (grpc_static_mdelem_manifested()[21])
-/* "authorization": "" */
-#define GRPC_MDELEM_AUTHORIZATION_EMPTY (grpc_static_mdelem_manifested()[22])
-/* "cache-control": "" */
-#define GRPC_MDELEM_CACHE_CONTROL_EMPTY (grpc_static_mdelem_manifested()[23])
-/* "content-disposition": "" */
-#define GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY \
- (grpc_static_mdelem_manifested()[24])
-/* "content-encoding": "" */
-#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[25])
-/* "content-language": "" */
-#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[26])
-/* "content-length": "" */
-#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY (grpc_static_mdelem_manifested()[27])
-/* "content-location": "" */
-#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY (grpc_static_mdelem_manifested()[28])
-/* "content-range": "" */
-#define GRPC_MDELEM_CONTENT_RANGE_EMPTY (grpc_static_mdelem_manifested()[29])
-/* "content-type": "" */
-#define GRPC_MDELEM_CONTENT_TYPE_EMPTY (grpc_static_mdelem_manifested()[30])
-/* "cookie": "" */
-#define GRPC_MDELEM_COOKIE_EMPTY (grpc_static_mdelem_manifested()[31])
-/* "date": "" */
-#define GRPC_MDELEM_DATE_EMPTY (grpc_static_mdelem_manifested()[32])
-/* "etag": "" */
-#define GRPC_MDELEM_ETAG_EMPTY (grpc_static_mdelem_manifested()[33])
-/* "expect": "" */
-#define GRPC_MDELEM_EXPECT_EMPTY (grpc_static_mdelem_manifested()[34])
-/* "expires": "" */
-#define GRPC_MDELEM_EXPIRES_EMPTY (grpc_static_mdelem_manifested()[35])
-/* "from": "" */
-#define GRPC_MDELEM_FROM_EMPTY (grpc_static_mdelem_manifested()[36])
-/* "host": "" */
-#define GRPC_MDELEM_HOST_EMPTY (grpc_static_mdelem_manifested()[37])
-/* "if-match": "" */
-#define GRPC_MDELEM_IF_MATCH_EMPTY (grpc_static_mdelem_manifested()[38])
-/* "if-modified-since": "" */
-#define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY \
- (grpc_static_mdelem_manifested()[39])
-/* "if-none-match": "" */
-#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY (grpc_static_mdelem_manifested()[40])
-/* "if-range": "" */
-#define GRPC_MDELEM_IF_RANGE_EMPTY (grpc_static_mdelem_manifested()[41])
-/* "if-unmodified-since": "" */
-#define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY \
- (grpc_static_mdelem_manifested()[42])
-/* "last-modified": "" */
-#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (grpc_static_mdelem_manifested()[43])
-/* "link": "" */
-#define GRPC_MDELEM_LINK_EMPTY (grpc_static_mdelem_manifested()[44])
-/* "location": "" */
-#define GRPC_MDELEM_LOCATION_EMPTY (grpc_static_mdelem_manifested()[45])
-/* "max-forwards": "" */
-#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (grpc_static_mdelem_manifested()[46])
-/* "proxy-authenticate": "" */
-#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \
- (grpc_static_mdelem_manifested()[47])
-/* "proxy-authorization": "" */
-#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \
- (grpc_static_mdelem_manifested()[48])
-/* "range": "" */
-#define GRPC_MDELEM_RANGE_EMPTY (grpc_static_mdelem_manifested()[49])
-/* "referer": "" */
-#define GRPC_MDELEM_REFERER_EMPTY (grpc_static_mdelem_manifested()[50])
-/* "refresh": "" */
-#define GRPC_MDELEM_REFRESH_EMPTY (grpc_static_mdelem_manifested()[51])
-/* "retry-after": "" */
-#define GRPC_MDELEM_RETRY_AFTER_EMPTY (grpc_static_mdelem_manifested()[52])
-/* "server": "" */
-#define GRPC_MDELEM_SERVER_EMPTY (grpc_static_mdelem_manifested()[53])
-/* "set-cookie": "" */
-#define GRPC_MDELEM_SET_COOKIE_EMPTY (grpc_static_mdelem_manifested()[54])
-/* "strict-transport-security": "" */
-#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
- (grpc_static_mdelem_manifested()[55])
-/* "transfer-encoding": "" */
-#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \
- (grpc_static_mdelem_manifested()[56])
-/* "user-agent": "" */
-#define GRPC_MDELEM_USER_AGENT_EMPTY (grpc_static_mdelem_manifested()[57])
-/* "vary": "" */
-#define GRPC_MDELEM_VARY_EMPTY (grpc_static_mdelem_manifested()[58])
-/* "via": "" */
-#define GRPC_MDELEM_VIA_EMPTY (grpc_static_mdelem_manifested()[59])
-/* "www-authenticate": "" */
-#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested()[60])
-/* "grpc-status": "0" */
-#define GRPC_MDELEM_GRPC_STATUS_0 (grpc_static_mdelem_manifested()[61])
-/* "grpc-status": "1" */
-#define GRPC_MDELEM_GRPC_STATUS_1 (grpc_static_mdelem_manifested()[62])
-/* "grpc-status": "2" */
-#define GRPC_MDELEM_GRPC_STATUS_2 (grpc_static_mdelem_manifested()[63])
-/* "grpc-encoding": "identity" */
-#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY (grpc_static_mdelem_manifested()[64])
-/* "grpc-encoding": "gzip" */
-#define GRPC_MDELEM_GRPC_ENCODING_GZIP (grpc_static_mdelem_manifested()[65])
-/* "grpc-encoding": "deflate" */
-#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (grpc_static_mdelem_manifested()[66])
-/* "te": "trailers" */
-#define GRPC_MDELEM_TE_TRAILERS (grpc_static_mdelem_manifested()[67])
-/* "content-type": "application/grpc" */
-#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
- (grpc_static_mdelem_manifested()[68])
-/* ":scheme": "grpc" */
-#define GRPC_MDELEM_SCHEME_GRPC (grpc_static_mdelem_manifested()[69])
-/* ":method": "PUT" */
-#define GRPC_MDELEM_METHOD_PUT (grpc_static_mdelem_manifested()[70])
-/* "accept-encoding": "" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[71])
-/* "content-encoding": "identity" */
-#define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[72])
-/* "content-encoding": "gzip" */
-#define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested()[73])
-/* "lb-cost-bin": "" */
-#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested()[74])
-/* "grpc-accept-encoding": "identity" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[75])
-/* "grpc-accept-encoding": "deflate" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \
- (grpc_static_mdelem_manifested()[76])
-/* "grpc-accept-encoding": "identity,deflate" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \
- (grpc_static_mdelem_manifested()[77])
-/* "grpc-accept-encoding": "gzip" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \
- (grpc_static_mdelem_manifested()[78])
-/* "grpc-accept-encoding": "identity,gzip" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[79])
-/* "grpc-accept-encoding": "deflate,gzip" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[80])
-/* "grpc-accept-encoding": "identity,deflate,gzip" */
-#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[81])
-/* "accept-encoding": "identity" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[82])
-/* "accept-encoding": "gzip" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested()[83])
-/* "accept-encoding": "identity,gzip" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[84])
-
-grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b);
-typedef enum {
- GRPC_BATCH_PATH,
- GRPC_BATCH_METHOD,
- GRPC_BATCH_STATUS,
- GRPC_BATCH_AUTHORITY,
- GRPC_BATCH_SCHEME,
- GRPC_BATCH_TE,
- GRPC_BATCH_GRPC_MESSAGE,
- GRPC_BATCH_GRPC_STATUS,
- GRPC_BATCH_GRPC_PAYLOAD_BIN,
- GRPC_BATCH_GRPC_ENCODING,
- GRPC_BATCH_GRPC_ACCEPT_ENCODING,
- GRPC_BATCH_GRPC_SERVER_STATS_BIN,
- GRPC_BATCH_GRPC_TAGS_BIN,
- GRPC_BATCH_GRPC_TRACE_BIN,
- GRPC_BATCH_CONTENT_TYPE,
- GRPC_BATCH_CONTENT_ENCODING,
- GRPC_BATCH_ACCEPT_ENCODING,
- GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST,
- GRPC_BATCH_GRPC_INTERNAL_STREAM_ENCODING_REQUEST,
- GRPC_BATCH_USER_AGENT,
- GRPC_BATCH_HOST,
- GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS,
- GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS,
- GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN,
- GRPC_BATCH_CALLOUTS_COUNT
-} grpc_metadata_batch_callouts_index;
-
-typedef union {
- struct grpc_linked_mdelem* array[GRPC_BATCH_CALLOUTS_COUNT];
- struct {
- struct grpc_linked_mdelem* path;
- struct grpc_linked_mdelem* method;
- struct grpc_linked_mdelem* status;
- struct grpc_linked_mdelem* authority;
- struct grpc_linked_mdelem* scheme;
- struct grpc_linked_mdelem* te;
- struct grpc_linked_mdelem* grpc_message;
- struct grpc_linked_mdelem* grpc_status;
- struct grpc_linked_mdelem* grpc_payload_bin;
- struct grpc_linked_mdelem* grpc_encoding;
- struct grpc_linked_mdelem* grpc_accept_encoding;
- struct grpc_linked_mdelem* grpc_server_stats_bin;
- struct grpc_linked_mdelem* grpc_tags_bin;
- struct grpc_linked_mdelem* grpc_trace_bin;
- struct grpc_linked_mdelem* content_type;
- struct grpc_linked_mdelem* content_encoding;
- struct grpc_linked_mdelem* accept_encoding;
- struct grpc_linked_mdelem* grpc_internal_encoding_request;
- struct grpc_linked_mdelem* grpc_internal_stream_encoding_request;
- struct grpc_linked_mdelem* user_agent;
- struct grpc_linked_mdelem* host;
- struct grpc_linked_mdelem* grpc_previous_rpc_attempts;
- struct grpc_linked_mdelem* grpc_retry_pushback_ms;
- struct grpc_linked_mdelem* x_endpoint_load_metrics_bin;
- } named;
-} grpc_metadata_batch_callouts;
-
-#define GRPC_BATCH_INDEX_OF(slice) \
- (GRPC_IS_STATIC_METADATA_STRING((slice)) && \
- reinterpret_cast<grpc_core::StaticSliceRefcount*>((slice).refcount) \
- ->index <= static_cast<uint32_t>(GRPC_BATCH_CALLOUTS_COUNT) \
- ? static_cast<grpc_metadata_batch_callouts_index>( \
- reinterpret_cast<grpc_core::StaticSliceRefcount*>( \
- (slice).refcount) \
- ->index) \
- : GRPC_BATCH_CALLOUTS_COUNT)
-
-extern const uint8_t grpc_static_accept_encoding_metadata[8];
-#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \
- (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
- [grpc_static_accept_encoding_metadata[(algs)]] \
- .data(), \
- GRPC_MDELEM_STORAGE_STATIC))
-
-extern const uint8_t grpc_static_accept_stream_encoding_metadata[4];
-#define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) \
- (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
- [grpc_static_accept_stream_encoding_metadata[(algs)]] \
- .data(), \
- GRPC_MDELEM_STORAGE_STATIC))
-#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */
diff --git a/grpc/src/core/lib/transport/status_conversion.cc b/grpc/src/core/lib/transport/status_conversion.cc
index 46c6cd8c..acfd5c5e 100644
--- a/grpc/src/core/lib/transport/status_conversion.cc
+++ b/grpc/src/core/lib/transport/status_conversion.cc
@@ -39,8 +39,8 @@ grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status) {
}
}
-grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error,
- grpc_millis deadline) {
+grpc_status_code grpc_http2_error_to_grpc_status(
+ grpc_http2_error_code error, grpc_core::Timestamp deadline) {
switch (error) {
case GRPC_HTTP2_NO_ERROR:
/* should never be received */
diff --git a/grpc/src/core/lib/transport/status_conversion.h b/grpc/src/core/lib/transport/status_conversion.h
index 487f00c0..73a58fb9 100644
--- a/grpc/src/core/lib/transport/status_conversion.h
+++ b/grpc/src/core/lib/transport/status_conversion.h
@@ -29,7 +29,7 @@
/* Conversion of grpc status codes to http2 error codes (for RST_STREAM) */
grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status);
grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error,
- grpc_millis deadline);
+ grpc_core::Timestamp deadline);
/* Conversion of HTTP status codes (:status) to grpc status codes */
grpc_status_code grpc_http2_status_to_grpc_status(int status);
diff --git a/grpc/src/core/lib/transport/status_metadata.cc b/grpc/src/core/lib/transport/status_metadata.cc
deleted file mode 100644
index 1b19307e..00000000
--- a/grpc/src/core/lib/transport/status_metadata.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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/transport/status_metadata.h"
-
-#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-/* we offset status by a small amount when storing it into transport metadata
- as metadata cannot store a 0 value (which is used as OK for grpc_status_codes
- */
-#define STATUS_OFFSET 1
-
-static void destroy_status(void* /*ignored*/) {}
-
-grpc_status_code grpc_get_status_code_from_metadata(grpc_mdelem md) {
- if (grpc_mdelem_static_value_eq(md, GRPC_MDELEM_GRPC_STATUS_0)) {
- return GRPC_STATUS_OK;
- }
- if (grpc_mdelem_static_value_eq(md, GRPC_MDELEM_GRPC_STATUS_1)) {
- return GRPC_STATUS_CANCELLED;
- }
- if (grpc_mdelem_static_value_eq(md, GRPC_MDELEM_GRPC_STATUS_2)) {
- return GRPC_STATUS_UNKNOWN;
- }
- void* user_data = grpc_mdelem_get_user_data(md, destroy_status);
- if (user_data != nullptr) {
- return static_cast<grpc_status_code>(reinterpret_cast<intptr_t>(user_data) -
- STATUS_OFFSET);
- }
- uint32_t status;
- if (!grpc_parse_slice_to_uint32(GRPC_MDVALUE(md), &status)) {
- status = GRPC_STATUS_UNKNOWN; /* could not parse status code */
- }
- grpc_mdelem_set_user_data(md, destroy_status,
- reinterpret_cast<void*>(status + STATUS_OFFSET));
- return static_cast<grpc_status_code>(status);
-}
-
-grpc_mdelem grpc_get_reffed_status_elem_slowpath(int status_code) {
- char tmp[GPR_LTOA_MIN_BUFSIZE];
- gpr_ltoa(status_code, tmp);
- return grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_STATUS,
- grpc_core::UnmanagedMemorySlice(tmp));
-}
diff --git a/grpc/src/core/lib/transport/status_metadata.h b/grpc/src/core/lib/transport/status_metadata.h
deleted file mode 100644
index 24022c0c..00000000
--- a/grpc/src/core/lib/transport/status_metadata.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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_STATUS_METADATA_H
-#define GRPC_CORE_LIB_TRANSPORT_STATUS_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/status.h>
-
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-grpc_status_code grpc_get_status_code_from_metadata(grpc_mdelem md);
-
-/** Get a grpc_mdelem of grpc-status: X where X is the numeric value of
- status_code.
-
- The returned elem is owned by the caller. */
-grpc_mdelem grpc_get_reffed_status_elem_slowpath(int status_code);
-inline grpc_mdelem grpc_get_reffed_status_elem(int status_code) {
- switch (status_code) {
- case 0:
- return GRPC_MDELEM_GRPC_STATUS_0;
- case 1:
- return GRPC_MDELEM_GRPC_STATUS_1;
- case 2:
- return GRPC_MDELEM_GRPC_STATUS_2;
- }
- return grpc_get_reffed_status_elem_slowpath(status_code);
-}
-
-#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_METADATA_H */
diff --git a/grpc/src/core/lib/transport/timeout_encoding.cc b/grpc/src/core/lib/transport/timeout_encoding.cc
index 27400638..8af89f5e 100644
--- a/grpc/src/core/lib/transport/timeout_encoding.cc
+++ b/grpc/src/core/lib/transport/timeout_encoding.cc
@@ -23,83 +23,216 @@
#include <stdio.h>
#include <string.h>
+#include <cstdint>
+
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
-static int64_t round_up(int64_t x, int64_t divisor) {
- return (x / divisor + (x % divisor != 0)) * divisor;
+namespace grpc_core {
+
+namespace {
+
+int64_t DivideRoundingUp(int64_t dividend, int64_t divisor) {
+ return (dividend + divisor - 1) / divisor;
}
-/* round an integer up to the next value with three significant figures */
-static int64_t round_up_to_three_sig_figs(int64_t x) {
- if (x < 1000) return x;
- if (x < 10000) return round_up(x, 10);
- if (x < 100000) return round_up(x, 100);
- if (x < 1000000) return round_up(x, 1000);
- if (x < 10000000) return round_up(x, 10000);
- if (x < 100000000) return round_up(x, 100000);
- if (x < 1000000000) return round_up(x, 1000000);
- return round_up(x, 10000000);
+constexpr int64_t kSecondsPerMinute = 60;
+constexpr int64_t kMinutesPerHour = 60;
+constexpr int64_t kMaxHours = 27000;
+
+bool IsAllSpace(const uint8_t* p, const uint8_t* end) {
+ while (p != end && *p == ' ') p++;
+ return p == end;
}
-/* encode our minimum viable timeout value */
-static void enc_tiny(char* buffer) { memcpy(buffer, "1n", 3); }
+} // namespace
-/* encode our maximum timeout value, about 1157 days */
-static void enc_huge(char* buffer) { memcpy(buffer, "99999999S", 10); }
+Timeout Timeout::FromDuration(Duration duration) {
+ return Timeout::FromMillis(duration.millis());
+}
-static void enc_ext(char* buffer, int64_t value, char ext) {
- int n = int64_ttoa(value, buffer);
- buffer[n] = ext;
- buffer[n + 1] = 0;
+double Timeout::RatioVersus(Timeout other) const {
+ double a = AsDuration().millis();
+ double b = other.AsDuration().millis();
+ if (b == 0) {
+ if (a > 0) return 100;
+ if (a < 0) return -100;
+ return 0;
+ }
+ return 100 * (a / b - 1);
}
-static void enc_seconds(char* buffer, int64_t sec) {
- sec = round_up_to_three_sig_figs(sec);
- if (sec % 3600 == 0) {
- enc_ext(buffer, sec / 3600, 'H');
- } else if (sec % 60 == 0) {
- enc_ext(buffer, sec / 60, 'M');
- } else {
- enc_ext(buffer, sec, 'S');
+Duration Timeout::AsDuration() const {
+ int64_t value = value_;
+ switch (unit_) {
+ case Unit::kNanoseconds:
+ return Duration::Zero();
+ case Unit::kMilliseconds:
+ return Duration::Milliseconds(value);
+ case Unit::kTenMilliseconds:
+ return Duration::Milliseconds(value * 10);
+ case Unit::kHundredMilliseconds:
+ return Duration::Milliseconds(value * 100);
+ case Unit::kSeconds:
+ return Duration::Seconds(value);
+ case Unit::kTenSeconds:
+ return Duration::Seconds(value * 10);
+ case Unit::kHundredSeconds:
+ return Duration::Seconds(value * 100);
+ case Unit::kMinutes:
+ return Duration::Minutes(value);
+ case Unit::kTenMinutes:
+ return Duration::Minutes(value * 10);
+ case Unit::kHundredMinutes:
+ return Duration::Minutes(value * 100);
+ case Unit::kHours:
+ return Duration::Hours(value);
}
+ GPR_UNREACHABLE_CODE(return Duration::NegativeInfinity());
}
-static void enc_millis(char* buffer, int64_t x) {
- x = round_up_to_three_sig_figs(x);
- if (x < GPR_MS_PER_SEC) {
- enc_ext(buffer, x, 'm');
+Slice Timeout::Encode() const {
+ char buf[10];
+ char* p = buf;
+ uint16_t n = value_;
+ int digits;
+ if (n >= 10000) {
+ digits = 5;
+ } else if (n >= 1000) {
+ digits = 4;
+ } else if (n >= 100) {
+ digits = 3;
+ } else if (n >= 10) {
+ digits = 2;
} else {
- if (x % GPR_MS_PER_SEC == 0) {
- enc_seconds(buffer, x / GPR_MS_PER_SEC);
- } else {
- enc_ext(buffer, x, 'm');
+ digits = 1;
+ }
+ switch (digits) {
+ case 5:
+ *p++ = '0' + n / 10000;
+ n %= 10000;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 4:
+ *p++ = '0' + n / 1000;
+ n %= 1000;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 3:
+ *p++ = '0' + n / 100;
+ n %= 100;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 2:
+ *p++ = '0' + n / 10;
+ n %= 10;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 1:
+ *p++ = '0' + n;
+ }
+ switch (unit_) {
+ case Unit::kNanoseconds:
+ *p++ = 'n';
+ break;
+ case Unit::kHundredMilliseconds:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kTenMilliseconds:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kMilliseconds:
+ *p++ = 'm';
+ break;
+ case Unit::kHundredSeconds:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kTenSeconds:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kSeconds:
+ *p++ = 'S';
+ break;
+ case Unit::kHundredMinutes:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kTenMinutes:
+ *p++ = '0';
+ ABSL_FALLTHROUGH_INTENDED;
+ case Unit::kMinutes:
+ *p++ = 'M';
+ break;
+ case Unit::kHours:
+ *p++ = 'H';
+ break;
+ }
+ return Slice::FromCopiedBuffer(buf, p - buf);
+}
+
+Timeout Timeout::FromMillis(int64_t millis) {
+ if (millis <= 0) {
+ return Timeout(1, Unit::kNanoseconds);
+ } else if (millis < 1000) {
+ return Timeout(millis, Unit::kMilliseconds);
+ } else if (millis < 10000) {
+ int64_t value = DivideRoundingUp(millis, 10);
+ if (value % 100 != 0) return Timeout(value, Unit::kTenMilliseconds);
+ } else if (millis < 100000) {
+ int64_t value = DivideRoundingUp(millis, 100);
+ if (value % 10 != 0) return Timeout(value, Unit::kHundredMilliseconds);
+ }
+ return Timeout::FromSeconds(DivideRoundingUp(millis, 1000));
+}
+
+Timeout Timeout::FromSeconds(int64_t seconds) {
+ GPR_DEBUG_ASSERT(seconds != 0);
+ if (seconds < 1000) {
+ if (seconds % kSecondsPerMinute != 0) {
+ return Timeout(seconds, Unit::kSeconds);
+ }
+ } else if (seconds < 10000) {
+ int64_t value = DivideRoundingUp(seconds, 10);
+ if ((value * 10) % kSecondsPerMinute != 0) {
+ return Timeout(value, Unit::kTenSeconds);
+ }
+ } else if (seconds < 100000) {
+ int64_t value = DivideRoundingUp(seconds, 100);
+ if ((value * 100) % kSecondsPerMinute != 0) {
+ return Timeout(value, Unit::kHundredSeconds);
}
}
+ return Timeout::FromMinutes(DivideRoundingUp(seconds, kSecondsPerMinute));
}
-void grpc_http2_encode_timeout(grpc_millis timeout, char* buffer) {
- const grpc_millis kMaxTimeout = 99999999000;
- if (timeout <= 0) {
- enc_tiny(buffer);
- } else if (timeout < 1000 * GPR_MS_PER_SEC) {
- enc_millis(buffer, timeout);
- } else if (timeout >= kMaxTimeout) {
- enc_huge(buffer);
- } else {
- enc_seconds(buffer,
- timeout / GPR_MS_PER_SEC + (timeout % GPR_MS_PER_SEC != 0));
+Timeout Timeout::FromMinutes(int64_t minutes) {
+ GPR_DEBUG_ASSERT(minutes != 0);
+ if (minutes < 1000) {
+ if (minutes % kMinutesPerHour != 0) {
+ return Timeout(minutes, Unit::kMinutes);
+ }
+ } else if (minutes < 10000) {
+ int64_t value = DivideRoundingUp(minutes, 10);
+ if ((value * 10) % kMinutesPerHour != 0) {
+ return Timeout(value, Unit::kTenMinutes);
+ }
+ } else if (minutes < 100000) {
+ int64_t value = DivideRoundingUp(minutes, 100);
+ if ((value * 100) % kMinutesPerHour != 0) {
+ return Timeout(value, Unit::kHundredMinutes);
+ }
}
+ return Timeout::FromHours(DivideRoundingUp(minutes, kMinutesPerHour));
}
-static int is_all_whitespace(const char* p, const char* end) {
- while (p != end && *p == ' ') p++;
- return p == end;
+Timeout Timeout::FromHours(int64_t hours) {
+ GPR_DEBUG_ASSERT(hours != 0);
+ if (hours < kMaxHours) {
+ return Timeout(hours, Unit::kHours);
+ }
+ return Timeout(kMaxHours, Unit::kHours);
}
-int grpc_http2_decode_timeout(const grpc_slice& text, grpc_millis* timeout) {
- grpc_millis x = 0;
- const uint8_t* p = GRPC_SLICE_START_PTR(text);
- const uint8_t* end = GRPC_SLICE_END_PTR(text);
+absl::optional<Duration> ParseTimeout(const Slice& text) {
+ int32_t x = 0;
+ const uint8_t* p = text.begin();
+ const uint8_t* end = text.end();
int have_digit = 0;
/* skip whitespace */
for (; p != end && *p == ' '; p++) {
@@ -111,41 +244,45 @@ int grpc_http2_decode_timeout(const grpc_slice& text, grpc_millis* timeout) {
/* spec allows max. 8 digits, but we allow values up to 1,000,000,000 */
if (x >= (100 * 1000 * 1000)) {
if (x != (100 * 1000 * 1000) || digit != 0) {
- *timeout = GRPC_MILLIS_INF_FUTURE;
- return 1;
+ return Duration::Infinity();
}
}
x = x * 10 + digit;
}
- if (!have_digit) return 0;
+ if (!have_digit) return absl::nullopt;
/* skip whitespace */
for (; p != end && *p == ' '; p++) {
}
- if (p == end) return 0;
+ if (p == end) return absl::nullopt;
/* decode unit specifier */
+ Duration timeout;
switch (*p) {
case 'n':
- *timeout = x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0);
+ timeout =
+ Duration::Milliseconds(x / GPR_NS_PER_MS + (x % GPR_NS_PER_MS != 0));
break;
case 'u':
- *timeout = x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0);
+ timeout =
+ Duration::Milliseconds(x / GPR_US_PER_MS + (x % GPR_US_PER_MS != 0));
break;
case 'm':
- *timeout = x;
+ timeout = Duration::Milliseconds(x);
break;
case 'S':
- *timeout = x * GPR_MS_PER_SEC;
+ timeout = Duration::Seconds(x);
break;
case 'M':
- *timeout = x * 60 * GPR_MS_PER_SEC;
+ timeout = Duration::Minutes(x);
break;
case 'H':
- *timeout = x * 60 * 60 * GPR_MS_PER_SEC;
+ timeout = Duration::Hours(x);
break;
default:
- return 0;
+ return absl::nullopt;
}
p++;
- return is_all_whitespace(reinterpret_cast<const char*>(p),
- reinterpret_cast<const char*>(end));
+ if (!IsAllSpace(p, end)) return absl::nullopt;
+ return timeout;
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/lib/transport/timeout_encoding.h b/grpc/src/core/lib/transport/timeout_encoding.h
index c87ff39d..4d8cd736 100644
--- a/grpc/src/core/lib/transport/timeout_encoding.h
+++ b/grpc/src/core/lib/transport/timeout_encoding.h
@@ -21,18 +21,48 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
-#include <grpc/support/time.h>
-
-#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice.h"
+
+namespace grpc_core {
+
+class Timeout {
+ public:
+ static Timeout FromDuration(Duration duration);
+
+ // Computes: 100 * ((this - other) / other)
+ double RatioVersus(Timeout other) const;
+ Slice Encode() const;
+ Duration AsDuration() const;
+
+ private:
+ enum class Unit : uint8_t {
+ kNanoseconds,
+ kMilliseconds,
+ kTenMilliseconds,
+ kHundredMilliseconds,
+ kSeconds,
+ kTenSeconds,
+ kHundredSeconds,
+ kMinutes,
+ kTenMinutes,
+ kHundredMinutes,
+ kHours,
+ };
+
+ Timeout(uint16_t value, Unit unit) : value_(value), unit_(unit) {}
+
+ static Timeout FromMillis(int64_t millis);
+ static Timeout FromSeconds(int64_t seconds);
+ static Timeout FromMinutes(int64_t minutes);
+ static Timeout FromHours(int64_t hours);
+
+ uint16_t value_;
+ Unit unit_;
+};
-#define GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE 10
+absl::optional<Duration> ParseTimeout(const Slice& text);
-/* Encode/decode timeouts to the GRPC over HTTP/2 format;
- encoding may round up arbitrarily. If the timeout is larger than about 1157
- days, it will be capped and "99999999S" will be sent on the wire. */
-void grpc_http2_encode_timeout(grpc_millis timeout, char* buffer);
-int grpc_http2_decode_timeout(const grpc_slice& text, grpc_millis* timeout);
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */
diff --git a/grpc/src/core/lib/transport/transport.cc b/grpc/src/core/lib/transport/transport.cc
index 36060a6b..cb1c4789 100644
--- a/grpc/src/core/lib/transport/transport.cc
+++ b/grpc/src/core/lib/transport/transport.cc
@@ -61,25 +61,6 @@ void slice_stream_destroy(void* arg) {
grpc_stream_destroy(static_cast<grpc_stream_refcount*>(arg));
}
-#define STREAM_REF_FROM_SLICE_REF(p) \
- ((grpc_stream_refcount*)(((uint8_t*)(p)) - \
- offsetof(grpc_stream_refcount, slice_refcount)))
-
-grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount,
- void* buffer, size_t length) {
-#ifndef NDEBUG
- grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(&refcount->slice_refcount),
- "slice");
-#else
- grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(&refcount->slice_refcount));
-#endif
- grpc_slice res;
- res.refcount = &refcount->slice_refcount;
- res.data.refcounted.bytes = static_cast<uint8_t*>(buffer);
- res.data.refcounted.length = length;
- return res;
-}
-
#ifndef NDEBUG
void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/,
grpc_iomgr_cb_func cb, void* cb_arg,
@@ -94,21 +75,18 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/,
new (&refcount->refs) grpc_core::RefCount(
1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_stream_refcount) ? "stream_refcount"
: nullptr);
- new (&refcount->slice_refcount) grpc_slice_refcount(
- grpc_slice_refcount::Type::REGULAR, &refcount->refs, slice_stream_destroy,
- refcount, &refcount->slice_refcount);
}
-static void move64(uint64_t* from, uint64_t* to) {
+static void move64bits(uint64_t* from, uint64_t* to) {
*to += *from;
*from = 0;
}
void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats* from,
grpc_transport_one_way_stats* to) {
- move64(&from->framing_bytes, &to->framing_bytes);
- move64(&from->data_bytes, &to->data_bytes);
- move64(&from->header_bytes, &to->header_bytes);
+ move64bits(&from->framing_bytes, &to->framing_bytes);
+ move64bits(&from->data_bytes, &to->data_bytes);
+ move64bits(&from->header_bytes, &to->header_bytes);
}
void grpc_transport_move_stats(grpc_transport_stream_stats* from,
@@ -237,22 +215,23 @@ grpc_transport_op* grpc_make_transport_op(grpc_closure* on_complete) {
struct made_transport_stream_op {
grpc_closure outer_on_complete;
- grpc_closure* inner_on_complete;
+ grpc_closure* inner_on_complete = nullptr;
grpc_transport_stream_op_batch op;
- grpc_transport_stream_op_batch_payload payload;
+ grpc_transport_stream_op_batch_payload payload{nullptr};
};
static void destroy_made_transport_stream_op(void* arg,
grpc_error_handle error) {
made_transport_stream_op* op = static_cast<made_transport_stream_op*>(arg);
grpc_closure* c = op->inner_on_complete;
- gpr_free(op);
- grpc_core::Closure::Run(DEBUG_LOCATION, c, GRPC_ERROR_REF(error));
+ delete op;
+ if (c != nullptr) {
+ grpc_core::Closure::Run(DEBUG_LOCATION, c, GRPC_ERROR_REF(error));
+ }
}
grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
grpc_closure* on_complete) {
- made_transport_stream_op* op =
- static_cast<made_transport_stream_op*>(gpr_zalloc(sizeof(*op)));
+ made_transport_stream_op* op = new made_transport_stream_op();
op->op.payload = &op->payload;
GRPC_CLOSURE_INIT(&op->outer_on_complete, destroy_made_transport_stream_op,
op, grpc_schedule_on_exec_ctx);
diff --git a/grpc/src/core/lib/transport/transport.h b/grpc/src/core/lib/transport/transport.h
index 7372b389..a02d07fd 100644
--- a/grpc/src/core/lib/transport/transport.h
+++ b/grpc/src/core/lib/transport/transport.h
@@ -24,13 +24,15 @@
#include <stddef.h>
#include "src/core/lib/channel/context.h"
-#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/promise/arena_promise.h"
+#include "src/core/lib/promise/latch.h"
+#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/connectivity_state.h"
@@ -42,6 +44,93 @@
#define GRPC_PROTOCOL_VERSION_MIN_MAJOR 2
#define GRPC_PROTOCOL_VERSION_MIN_MINOR 1
+#define GRPC_ARG_TRANSPORT "grpc.internal.transport"
+
+namespace grpc_core {
+// TODO(ctiller): eliminate once MetadataHandle is constructable directly.
+namespace promise_filter_detail {
+class BaseCallData;
+}
+
+// Small unowned "handle" type to ensure one accessor at a time to metadata.
+// The focus here is to get promises to use the syntax we'd like - we'll
+// probably substitute some other smart pointer later.
+template <typename T>
+class MetadataHandle {
+ public:
+ MetadataHandle() = default;
+
+ MetadataHandle(const MetadataHandle&) = delete;
+ MetadataHandle& operator=(const MetadataHandle&) = delete;
+
+ MetadataHandle(MetadataHandle&& other) noexcept : handle_(other.handle_) {
+ other.handle_ = nullptr;
+ }
+ MetadataHandle& operator=(MetadataHandle&& other) noexcept {
+ handle_ = other.handle_;
+ other.handle_ = nullptr;
+ return *this;
+ }
+
+ explicit MetadataHandle(const absl::Status& status) {
+ handle_ = GetContext<Arena>()->New<T>(GetContext<Arena>());
+ handle_->Set(GrpcStatusMetadata(),
+ static_cast<grpc_status_code>(status.code()));
+ if (status.ok()) return;
+ handle_->Set(GrpcMessageMetadata(),
+ Slice::FromCopiedString(status.message()));
+ }
+
+ T* operator->() const { return handle_; }
+ bool has_value() const { return handle_ != nullptr; }
+ T* get() const { return handle_; }
+
+ static MetadataHandle TestOnlyWrap(T* p) { return MetadataHandle(p); }
+
+ private:
+ friend class promise_filter_detail::BaseCallData;
+
+ explicit MetadataHandle(T* handle) : handle_(handle) {}
+ T* Unwrap() {
+ T* result = handle_;
+ handle_ = nullptr;
+ return result;
+ }
+
+ T* handle_ = nullptr;
+};
+
+// Server metadata type
+// TODO(ctiller): This should be a bespoke instance of MetadataMap<>
+using ServerMetadata = grpc_metadata_batch;
+using ServerMetadataHandle = MetadataHandle<ServerMetadata>;
+
+// Ok/not-ok check for trailing metadata, so that it can be used as result types
+// for TrySeq.
+inline bool IsStatusOk(const ServerMetadataHandle& m) {
+ return m->get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN) ==
+ GRPC_STATUS_OK;
+}
+
+// Client initial metadata type
+// TODO(ctiller): This should be a bespoke instance of MetadataMap<>
+using ClientMetadata = grpc_metadata_batch;
+using ClientMetadataHandle = MetadataHandle<ClientMetadata>;
+
+// Server initial metadata type
+// TODO(ctiller): This should be a bespoke instance of MetadataMap<>
+using ServerMetadataHandle = MetadataHandle<grpc_metadata_batch>;
+
+struct CallArgs {
+ ClientMetadataHandle client_initial_metadata;
+ Latch<ServerMetadata*>* server_initial_metadata;
+};
+
+using NextPromiseFactory =
+ std::function<ArenaPromise<ServerMetadataHandle>(CallArgs)>;
+
+} // namespace grpc_core
+
/* forward declarations */
typedef struct grpc_transport grpc_transport;
@@ -59,7 +148,6 @@ typedef struct grpc_stream_refcount {
#ifndef NDEBUG
const char* object_type;
#endif
- grpc_slice_refcount slice_refcount;
} grpc_stream_refcount;
#ifndef NDEBUG
@@ -279,8 +367,11 @@ struct grpc_transport_stream_op_batch_payload {
/** Should be enqueued when initial metadata is ready to be processed. */
grpc_closure* recv_initial_metadata_ready = nullptr;
// If not NULL, will be set to true if trailing metadata is
- // immediately available. This may be a signal that we received a
- // Trailers-Only response.
+ // immediately available. This may be a signal that we received a
+ // Trailers-Only response. The retry filter checks this to know whether to
+ // defer the decision to commit the call or not. The C++ callback API also
+ // uses this to set the success flag of OnReadInitialMetadataDone()
+ // callback.
bool* trailing_metadata_available = nullptr;
// If non-NULL, will be set by the transport to the peer string (a char*).
// The transport retains ownership of the string.
@@ -295,6 +386,8 @@ struct grpc_transport_stream_op_batch_payload {
// containing a received message.
// Will be NULL if trailing metadata is received instead of a message.
grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message = nullptr;
+ // Was this recv_message failed for reasons other than a clean end-of-stream
+ bool* call_failed_before_recv_message = nullptr;
/** Should be enqueued when one message is ready to be processed. */
grpc_closure* recv_message_ready = nullptr;
} recv_message;
@@ -352,6 +445,14 @@ typedef struct grpc_transport_op {
void (*set_accept_stream_fn)(void* user_data, grpc_transport* transport,
const void* server_data) = nullptr;
void* set_accept_stream_user_data = nullptr;
+ /** set the callback for accepting new streams based upon promises;
+ this is a permanent callback, unlike the other one-shot closures.
+ If true, the callback is set to set_make_promise_fn, with its
+ user_data argument set to set_make_promise_data */
+ bool set_make_promise = false;
+ void (*set_make_promise_fn)(void* user_data, grpc_transport* transport,
+ const void* server_data) = nullptr;
+ void* set_make_promise_user_data = nullptr;
/** add this transport to a pollset */
grpc_pollset* bind_pollset = nullptr;
/** add this transport to a pollset_set */
diff --git a/grpc/src/core/lib/transport/transport_impl.h b/grpc/src/core/lib/transport/transport_impl.h
index 526cc1b1..cab18ed0 100644
--- a/grpc/src/core/lib/transport/transport_impl.h
+++ b/grpc/src/core/lib/transport/transport_impl.h
@@ -36,6 +36,18 @@ typedef struct grpc_transport_vtable {
grpc_stream_refcount* refcount, const void* server_data,
grpc_core::Arena* arena);
+ /* Create a promise to execute one client call.
+ If this is non-null, it may be used in preference to
+ perform_stream_op.
+ If this is used in preference to perform_stream_op, the
+ following can be omitted also:
+ - calling init_stream, destroy_stream, set_pollset, set_pollset_set
+ - allocation of memory for call data (sizeof_stream may be ignored)
+ There is an on-going migration to move all filters to providing this, and
+ then to drop perform_stream_op. */
+ grpc_core::ArenaPromise<grpc_core::ServerMetadataHandle> (*make_call_promise)(
+ grpc_transport* self, grpc_core::ClientMetadataHandle initial_metadata);
+
/* implementation of grpc_transport_set_pollset */
void (*set_pollset)(grpc_transport* self, grpc_stream* stream,
grpc_pollset* pollset);
@@ -64,6 +76,8 @@ typedef struct grpc_transport_vtable {
/* an instance of a grpc transport */
struct grpc_transport {
+ struct RawPointerChannelArgTag {};
+ static absl::string_view ChannelArgName() { return GRPC_ARG_TRANSPORT; }
/* pointer to a vtable defining operations on this transport */
const grpc_transport_vtable* vtable;
};
diff --git a/grpc/src/core/lib/transport/transport_op_string.cc b/grpc/src/core/lib/transport/transport_op_string.cc
index 49dec384..3fba07dc 100644
--- a/grpc/src/core/lib/transport/transport_op_string.cc
+++ b/grpc/src/core/lib/transport/transport_op_string.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/channel/channel_stack.h"
-
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
@@ -27,12 +25,15 @@
#include <vector>
+#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/connectivity_state.h"
@@ -40,37 +41,14 @@
/* 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<std::string>* 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<std::string>* 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 (md.deadline != GRPC_MILLIS_INF_FUTURE) {
- out->push_back(absl::StrFormat(" deadline=%" PRId64, md.deadline));
- }
-}
-
std::string grpc_transport_stream_op_batch_string(
grpc_transport_stream_op_batch* op) {
std::vector<std::string> 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(op->payload->send_initial_metadata.send_initial_metadata
+ ->DebugString());
out.push_back("}");
}
@@ -89,8 +67,8 @@ std::string grpc_transport_stream_op_batch_string(
if (op->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
+ ->DebugString());
out.push_back("}");
}
@@ -135,7 +113,7 @@ std::string grpc_transport_op_string(grpc_transport_op* op) {
" DISCONNECT:", grpc_error_std_string(op->disconnect_with_error)));
}
- if (op->goaway_error) {
+ if (op->goaway_error != GRPC_ERROR_NONE) {
out.push_back(absl::StrCat(" SEND_GOAWAY:%s",
grpc_error_std_string(op->goaway_error)));
}
diff --git a/grpc/src/core/lib/uri/uri_parser.cc b/grpc/src/core/lib/uri/uri_parser.cc
index ea103306..8a794aed 100644
--- a/grpc/src/core/lib/uri/uri_parser.cc
+++ b/grpc/src/core/lib/uri/uri_parser.cc
@@ -1,20 +1,18 @@
-/*
- *
- * 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.
+//
#include <grpc/support/port_platform.h>
@@ -34,44 +32,129 @@
#include "src/core/lib/gpr/string.h"
namespace grpc_core {
+
namespace {
-// Similar to `grpc_permissive_percent_decode_slice`, this %-decodes all valid
-// triplets, and passes through the rest verbatim.
-std::string PercentDecode(absl::string_view str) {
- if (str.empty() || !absl::StrContains(str, "%")) {
- return std::string(str);
+// Returns true for any sub-delim character, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-2.2
+bool IsSubDelimChar(char c) {
+ switch (c) {
+ case '!':
+ case '$':
+ case '&':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '+':
+ case ',':
+ case ';':
+ case '=':
+ return true;
+ }
+ return false;
+}
+
+// Returns true for any unreserved character, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-2.3
+bool IsUnreservedChar(char c) {
+ if (absl::ascii_isalnum(c)) return true;
+ switch (c) {
+ case '-':
+ case '.':
+ case '_':
+ case '~':
+ return true;
+ }
+ return false;
+}
+
+// Returns true for any character in scheme, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
+bool IsSchemeChar(char c) {
+ if (absl::ascii_isalnum(c)) return true;
+ switch (c) {
+ case '+':
+ case '-':
+ case '.':
+ return true;
}
+ return false;
+}
+
+// Returns true for any character in authority, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-3.2
+bool IsAuthorityChar(char c) {
+ if (IsUnreservedChar(c)) return true;
+ if (IsSubDelimChar(c)) return true;
+ switch (c) {
+ case ':':
+ case '[':
+ case ']':
+ case '@':
+ return true;
+ }
+ return false;
+}
+
+// Returns true for any character in pchar, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
+bool IsPChar(char c) {
+ if (IsUnreservedChar(c)) return true;
+ if (IsSubDelimChar(c)) return true;
+ switch (c) {
+ case ':':
+ case '@':
+ return true;
+ }
+ return false;
+}
+
+// Returns true for any character allowed in a URI path, as defined in:
+// https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
+bool IsPathChar(char c) { return IsPChar(c) || c == '/'; }
+
+// Returns true for any character allowed in a URI query or fragment,
+// as defined in:
+// See https://tools.ietf.org/html/rfc3986#section-3.4
+bool IsQueryOrFragmentChar(char c) {
+ return IsPChar(c) || c == '/' || c == '?';
+}
+
+// Same as IsQueryOrFragmentChar(), but excludes '&' and '='.
+bool IsQueryKeyOrValueChar(char c) {
+ return c != '&' && c != '=' && IsQueryOrFragmentChar(c);
+}
+
+// Returns a copy of str, percent-encoding any character for which
+// is_allowed_char() returns false.
+std::string PercentEncode(absl::string_view str,
+ std::function<bool(char)> is_allowed_char) {
std::string out;
- std::string unescaped;
- out.reserve(str.size());
- for (size_t i = 0; i < str.length(); i++) {
- unescaped = "";
- if (str[i] != '%') {
- out += str[i];
- continue;
- }
- if (i + 3 >= str.length() ||
- !absl::CUnescape(absl::StrCat("\\x", str.substr(i + 1, 2)),
- &unescaped) ||
- unescaped.length() > 1) {
- out += str[i];
+ for (char c : str) {
+ if (!is_allowed_char(c)) {
+ std::string hex = absl::BytesToHexString(absl::string_view(&c, 1));
+ GPR_ASSERT(hex.size() == 2);
+ // BytesToHexString() returns lower case, but
+ // https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1 says
+ // to prefer upper-case.
+ absl::AsciiStrToUpper(&hex);
+ out.push_back('%');
+ out.append(hex);
} else {
- out += unescaped[0];
- i += 2;
+ out.push_back(c);
}
}
return out;
}
-// Checks if this string is made up of pchars, '/', '?', and '%' exclusively.
+// Checks if this string is made up of query/fragment chars and '%' exclusively.
// See https://tools.ietf.org/html/rfc3986#section-3.4
-bool IsPCharString(absl::string_view str) {
- return (str.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789"
- "?/:@\\-._~!$&'()*+,;=%") ==
- absl::string_view::npos);
+bool IsQueryOrFragmentString(absl::string_view str) {
+ for (char c : str) {
+ if (!IsQueryOrFragmentChar(c) && c != '%') return false;
+ }
+ return true;
}
absl::Status MakeInvalidURIStatus(absl::string_view part_name,
@@ -80,17 +163,50 @@ absl::Status MakeInvalidURIStatus(absl::string_view part_name,
return absl::InvalidArgumentError(absl::StrFormat(
"Could not parse '%s' from uri '%s'. %s", part_name, uri, extra));
}
+
} // namespace
+std::string URI::PercentEncodeAuthority(absl::string_view str) {
+ return PercentEncode(str, IsAuthorityChar);
+}
+
+std::string URI::PercentEncodePath(absl::string_view str) {
+ return PercentEncode(str, IsPathChar);
+}
+
+// Similar to `grpc_permissive_percent_decode_slice`, this %-decodes all valid
+// triplets, and passes through the rest verbatim.
+std::string URI::PercentDecode(absl::string_view str) {
+ if (str.empty() || !absl::StrContains(str, "%")) {
+ return std::string(str);
+ }
+ std::string out;
+ std::string unescaped;
+ out.reserve(str.size());
+ for (size_t i = 0; i < str.length(); i++) {
+ unescaped = "";
+ if (str[i] == '%' && i + 3 <= str.length() &&
+ absl::CUnescape(absl::StrCat("\\x", str.substr(i + 1, 2)),
+ &unescaped) &&
+ unescaped.length() == 1) {
+ out += unescaped[0];
+ i += 2;
+ } else {
+ out += str[i];
+ }
+ }
+ return out;
+}
+
absl::StatusOr<URI> URI::Parse(absl::string_view uri_text) {
absl::StatusOr<std::string> decoded;
absl::string_view remaining = uri_text;
// parse scheme
- size_t idx = remaining.find(':');
- if (idx == remaining.npos || idx == 0) {
+ size_t offset = remaining.find(':');
+ if (offset == remaining.npos || offset == 0) {
return MakeInvalidURIStatus("scheme", uri_text, "Scheme not found.");
}
- std::string scheme(remaining.substr(0, idx));
+ std::string scheme(remaining.substr(0, offset));
if (scheme.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+-.") != std::string::npos) {
@@ -102,30 +218,38 @@ absl::StatusOr<URI> URI::Parse(absl::string_view uri_text) {
"scheme", uri_text,
"Scheme must begin with an alpha character [A-Za-z].");
}
- remaining.remove_prefix(scheme.length() + 1);
+ remaining.remove_prefix(offset + 1);
// parse authority
std::string authority;
- if (absl::StartsWith(remaining, "//")) {
- remaining.remove_prefix(2);
- authority =
- PercentDecode(remaining.substr(0, remaining.find_first_of("/?#")));
- remaining.remove_prefix(authority.length());
+ if (absl::ConsumePrefix(&remaining, "//")) {
+ offset = remaining.find_first_of("/?#");
+ authority = PercentDecode(remaining.substr(0, offset));
+ if (offset == remaining.npos) {
+ remaining = "";
+ } else {
+ remaining.remove_prefix(offset);
+ }
}
// parse path
std::string path;
if (!remaining.empty()) {
- path = PercentDecode(remaining.substr(0, remaining.find_first_of("?#")));
- remaining.remove_prefix(path.length());
+ offset = remaining.find_first_of("?#");
+ path = PercentDecode(remaining.substr(0, offset));
+ if (offset == remaining.npos) {
+ remaining = "";
+ } else {
+ remaining.remove_prefix(offset);
+ }
}
// parse query
std::vector<QueryParam> query_param_pairs;
- if (!remaining.empty() && remaining[0] == '?') {
- remaining.remove_prefix(1);
- absl::string_view tmp_query = remaining.substr(0, remaining.find('#'));
+ if (absl::ConsumePrefix(&remaining, "?")) {
+ offset = remaining.find('#');
+ absl::string_view tmp_query = remaining.substr(0, offset);
if (tmp_query.empty()) {
return MakeInvalidURIStatus("query", uri_text, "Invalid query string.");
}
- if (!IsPCharString(tmp_query)) {
+ if (!IsQueryOrFragmentString(tmp_query)) {
return MakeInvalidURIStatus("query string", uri_text,
"Query string contains invalid characters.");
}
@@ -136,12 +260,15 @@ absl::StatusOr<URI> URI::Parse(absl::string_view uri_text) {
query_param_pairs.push_back({PercentDecode(possible_kv.first),
PercentDecode(possible_kv.second)});
}
- remaining.remove_prefix(tmp_query.length());
+ if (offset == remaining.npos) {
+ remaining = "";
+ } else {
+ remaining.remove_prefix(offset);
+ }
}
std::string fragment;
- if (!remaining.empty() && remaining[0] == '#') {
- remaining.remove_prefix(1);
- if (!IsPCharString(remaining)) {
+ if (absl::ConsumePrefix(&remaining, "#")) {
+ if (!IsQueryOrFragmentString(remaining)) {
return MakeInvalidURIStatus("fragment", uri_text,
"Fragment contains invalid characters.");
}
@@ -151,6 +278,18 @@ absl::StatusOr<URI> URI::Parse(absl::string_view uri_text) {
std::move(query_param_pairs), std::move(fragment));
}
+absl::StatusOr<URI> URI::Create(std::string scheme, std::string authority,
+ std::string path,
+ std::vector<QueryParam> query_parameter_pairs,
+ std::string fragment) {
+ if (!authority.empty() && !path.empty() && path[0] != '/') {
+ return absl::InvalidArgumentError(
+ "if authority is present, path must start with a '/'");
+ }
+ return URI(std::move(scheme), std::move(authority), std::move(path),
+ std::move(query_parameter_pairs), std::move(fragment));
+}
+
URI::URI(std::string scheme, std::string authority, std::string path,
std::vector<QueryParam> query_parameter_pairs, std::string fragment)
: scheme_(std::move(scheme)),
@@ -188,4 +327,39 @@ URI& URI::operator=(const URI& other) {
}
return *this;
}
+
+namespace {
+
+// A pair formatter for use with absl::StrJoin() for formatting query params.
+struct QueryParameterFormatter {
+ void operator()(std::string* out, const URI::QueryParam& query_param) const {
+ out->append(
+ absl::StrCat(PercentEncode(query_param.key, IsQueryKeyOrValueChar), "=",
+ PercentEncode(query_param.value, IsQueryKeyOrValueChar)));
+ }
+};
+
+} // namespace
+
+std::string URI::ToString() const {
+ std::vector<std::string> parts = {PercentEncode(scheme_, IsSchemeChar), ":"};
+ if (!authority_.empty()) {
+ parts.emplace_back("//");
+ parts.emplace_back(PercentEncode(authority_, IsAuthorityChar));
+ }
+ if (!path_.empty()) {
+ parts.emplace_back(PercentEncode(path_, IsPathChar));
+ }
+ if (!query_parameter_pairs_.empty()) {
+ parts.push_back("?");
+ parts.push_back(
+ absl::StrJoin(query_parameter_pairs_, "&", QueryParameterFormatter()));
+ }
+ if (!fragment_.empty()) {
+ parts.push_back("#");
+ parts.push_back(PercentEncode(fragment_, IsQueryOrFragmentChar));
+ }
+ return absl::StrJoin(parts, "");
+}
+
} // namespace grpc_core
diff --git a/grpc/src/core/lib/uri/uri_parser.h b/grpc/src/core/lib/uri/uri_parser.h
index dcd7e12d..91c1b488 100644
--- a/grpc/src/core/lib/uri/uri_parser.h
+++ b/grpc/src/core/lib/uri/uri_parser.h
@@ -1,20 +1,18 @@
-/*
- *
- * 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_URI_URI_PARSER_H
#define GRPC_CORE_LIB_URI_URI_PARSER_H
@@ -40,15 +38,23 @@ class URI {
bool operator==(const QueryParam& other) const {
return key == other.key && value == other.value;
}
+ bool operator<(const QueryParam& other) const {
+ int c = key.compare(other.key);
+ if (c != 0) return c < 0;
+ return value < other.value;
+ }
};
- // Creates an instance of GrpcURI by parsing an rfc3986 URI string. Returns
- // an IllegalArgumentError on failure.
+ // Creates a URI by parsing an rfc3986 URI string. Returns an
+ // InvalidArgumentError on failure.
static absl::StatusOr<URI> Parse(absl::string_view uri_text);
- // Explicit construction by individual URI components
- URI(std::string scheme, std::string authority, std::string path,
- std::vector<QueryParam> query_parameter_pairs, std::string fragment_);
+ // Creates a URI from components. Returns an InvalidArgumentError on failure.
+ static absl::StatusOr<URI> Create(
+ std::string scheme, std::string authority, std::string path,
+ std::vector<QueryParam> query_parameter_pairs, std::string fragment);
+
URI() = default;
+
// Copy construction and assignment
URI(const URI& other);
URI& operator=(const URI& other);
@@ -56,6 +62,11 @@ class URI {
URI(URI&&) = default;
URI& operator=(URI&&) = default;
+ static std::string PercentEncodeAuthority(absl::string_view str);
+ static std::string PercentEncodePath(absl::string_view str);
+
+ static std::string PercentDecode(absl::string_view str);
+
const std::string& scheme() const { return scheme_; }
const std::string& authority() const { return authority_; }
const std::string& path() const { return path_; }
@@ -74,7 +85,12 @@ class URI {
}
const std::string& fragment() const { return fragment_; }
+ std::string ToString() const;
+
private:
+ URI(std::string scheme, std::string authority, std::string path,
+ std::vector<QueryParam> query_parameter_pairs, std::string fragment);
+
std::string scheme_;
std::string authority_;
std::string path_;
@@ -84,4 +100,4 @@ class URI {
};
} // namespace grpc_core
-#endif /* GRPC_CORE_LIB_URI_URI_PARSER_H */
+#endif // GRPC_CORE_LIB_URI_URI_PARSER_H
diff --git a/grpc/src/core/plugin_registry/grpc_plugin_registry.cc b/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
index d3def27e..95026cd6 100644
--- a/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -20,18 +20,15 @@
#include <grpc/grpc.h>
-void grpc_http_filters_init(void);
-void grpc_http_filters_shutdown(void);
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/builtins.h"
+
+extern void grpc_register_extra_plugins(void);
+
void grpc_chttp2_plugin_init(void);
void grpc_chttp2_plugin_shutdown(void);
-void grpc_deadline_filter_init(void);
-void grpc_deadline_filter_shutdown(void);
void grpc_client_channel_init(void);
void grpc_client_channel_shutdown(void);
-void grpc_inproc_plugin_init(void);
-void grpc_inproc_plugin_shutdown(void);
-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);
@@ -44,69 +41,23 @@ void grpc_lb_policy_round_robin_init(void);
void grpc_lb_policy_round_robin_shutdown(void);
void grpc_resolver_dns_ares_init(void);
void grpc_resolver_dns_ares_shutdown(void);
-void grpc_resolver_dns_native_init(void);
-void grpc_resolver_dns_native_shutdown(void);
-void grpc_resolver_sockaddr_init(void);
-void grpc_resolver_sockaddr_shutdown(void);
-void grpc_client_idle_filter_init(void);
-void grpc_client_idle_filter_shutdown(void);
-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_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);
-namespace grpc_core {
-void FaultInjectionFilterInit(void);
-void FaultInjectionFilterShutdown(void);
-} // namespace grpc_core
-
-#ifndef GRPC_NO_XDS
namespace grpc_core {
-void XdsClientGlobalInit();
-void XdsClientGlobalShutdown();
+void GrpcLbPolicyRingHashInit(void);
+void GrpcLbPolicyRingHashShutdown(void);
+#ifndef GRPC_NO_RLS
+void RlsLbPluginInit();
+void RlsLbPluginShutdown();
+#endif // !GRPC_NO_RLS
} // namespace grpc_core
-void grpc_certificate_provider_registry_init(void);
-void grpc_certificate_provider_registry_shutdown(void);
-namespace grpc_core {
-void FileWatcherCertificateProviderInit();
-void FileWatcherCertificateProviderShutdown();
-} // namespace grpc_core
-void grpc_lb_policy_cds_init(void);
-void grpc_lb_policy_cds_shutdown(void);
-void grpc_lb_policy_xds_cluster_impl_init(void);
-void grpc_lb_policy_xds_cluster_impl_shutdown(void);
-void grpc_lb_policy_xds_cluster_resolver_init(void);
-void grpc_lb_policy_xds_cluster_resolver_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);
-namespace grpc_core {
-void GoogleCloud2ProdResolverInit();
-void GoogleCloud2ProdResolverShutdown();
-}
-#endif
void grpc_register_built_in_plugins(void) {
- grpc_register_plugin(grpc_http_filters_init,
- grpc_http_filters_shutdown);
- grpc_register_plugin(grpc_chttp2_plugin_init,
- grpc_chttp2_plugin_shutdown);
- grpc_register_plugin(grpc_deadline_filter_init,
- grpc_deadline_filter_shutdown);
- grpc_register_plugin(grpc_client_channel_init,
- grpc_client_channel_shutdown);
- grpc_register_plugin(grpc_inproc_plugin_init,
- grpc_inproc_plugin_shutdown);
- grpc_register_plugin(grpc_resolver_fake_init,
- grpc_resolver_fake_shutdown);
+ grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
+#ifndef GRPC_NO_RLS
+ grpc_register_plugin(grpc_core::RlsLbPluginInit,
+ grpc_core::RlsLbPluginShutdown);
+#endif // !GRPC_NO_RLS
grpc_register_plugin(grpc_lb_policy_priority_init,
grpc_lb_policy_priority_shutdown);
grpc_register_plugin(grpc_lb_policy_weighted_target_init,
@@ -115,44 +66,64 @@ void grpc_register_built_in_plugins(void) {
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
grpc_lb_policy_round_robin_shutdown);
+ grpc_register_plugin(grpc_core::GrpcLbPolicyRingHashInit,
+ grpc_core::GrpcLbPolicyRingHashShutdown);
grpc_register_plugin(grpc_resolver_dns_ares_init,
grpc_resolver_dns_ares_shutdown);
- grpc_register_plugin(grpc_resolver_dns_native_init,
- grpc_resolver_dns_native_shutdown);
- grpc_register_plugin(grpc_resolver_sockaddr_init,
- grpc_resolver_sockaddr_shutdown);
- grpc_register_plugin(grpc_client_idle_filter_init,
- grpc_client_idle_filter_shutdown);
- grpc_register_plugin(grpc_max_age_filter_init,
- grpc_max_age_filter_shutdown);
- grpc_register_plugin(grpc_message_size_filter_init,
- grpc_message_size_filter_shutdown);
- grpc_register_plugin(grpc_core::FaultInjectionFilterInit,
- grpc_core::FaultInjectionFilterShutdown);
- 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_core::FileWatcherCertificateProviderInit,
- grpc_core::FileWatcherCertificateProviderShutdown);
- grpc_register_plugin(grpc_lb_policy_cds_init,
- grpc_lb_policy_cds_shutdown);
- grpc_register_plugin(grpc_lb_policy_xds_cluster_impl_init,
- grpc_lb_policy_xds_cluster_impl_shutdown);
- grpc_register_plugin(grpc_lb_policy_xds_cluster_resolver_init,
- grpc_lb_policy_xds_cluster_resolver_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);
- grpc_register_plugin(grpc_core::GoogleCloud2ProdResolverInit,
- grpc_core::GoogleCloud2ProdResolverShutdown);
+ grpc_register_extra_plugins();
+}
+
+namespace grpc_core {
+
+extern void BuildClientChannelConfiguration(
+ CoreConfiguration::Builder* builder);
+extern void SecurityRegisterHandshakerFactories(
+ CoreConfiguration::Builder* builder);
+extern void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder);
+extern void RegisterChannelIdleFilters(CoreConfiguration::Builder* builder);
+extern void RegisterDeadlineFilter(CoreConfiguration::Builder* builder);
+extern void RegisterGrpcLbLoadReportingFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterHttpFilters(CoreConfiguration::Builder* builder);
+extern void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder);
+extern void RegisterSecurityFilters(CoreConfiguration::Builder* builder);
+extern void RegisterServiceConfigChannelArgFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterExtraFilters(CoreConfiguration::Builder* builder);
+extern void RegisterResourceQuota(CoreConfiguration::Builder* builder);
+extern void FaultInjectionFilterRegister(CoreConfiguration::Builder* builder);
+extern void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder);
+extern void RegisterAresDnsResolver(CoreConfiguration::Builder* builder);
+extern void RegisterSockaddrResolver(CoreConfiguration::Builder* builder);
+extern void RegisterFakeResolver(CoreConfiguration::Builder* builder);
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+extern void RegisterBinderResolver(CoreConfiguration::Builder* builder);
#endif
+
+void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
+ BuildClientChannelConfiguration(builder);
+ SecurityRegisterHandshakerFactories(builder);
+ RegisterClientAuthorityFilter(builder);
+ RegisterChannelIdleFilters(builder);
+ RegisterGrpcLbLoadReportingFilter(builder);
+ RegisterHttpFilters(builder);
+ RegisterDeadlineFilter(builder);
+ RegisterMessageSizeFilter(builder);
+ RegisterServiceConfigChannelArgFilter(builder);
+ RegisterResourceQuota(builder);
+ FaultInjectionFilterRegister(builder);
+ RegisterAresDnsResolver(builder);
+ RegisterNativeDnsResolver(builder);
+ RegisterSockaddrResolver(builder);
+ RegisterFakeResolver(builder);
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+ RegisterBinderResolver(builder);
+#endif
+ // Run last so it gets a consistent location.
+ // TODO(ctiller): Is this actually necessary?
+ RegisterSecurityFilters(builder);
+ RegisterExtraFilters(builder);
+ RegisterBuiltins(builder);
}
+
+} // namespace grpc_core
diff --git a/grpc/src/core/plugin_registry/grpc_plugin_registry_extra.cc b/grpc/src/core/plugin_registry/grpc_plugin_registry_extra.cc
new file mode 100644
index 00000000..68e792ac
--- /dev/null
+++ b/grpc/src/core/plugin_registry/grpc_plugin_registry_extra.cc
@@ -0,0 +1,85 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <grpc/grpc.h>
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/builtins.h"
+
+#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);
+namespace grpc_core {
+void FileWatcherCertificateProviderInit();
+void FileWatcherCertificateProviderShutdown();
+} // namespace grpc_core
+void grpc_lb_policy_cds_init(void);
+void grpc_lb_policy_cds_shutdown(void);
+void grpc_lb_policy_xds_cluster_impl_init(void);
+void grpc_lb_policy_xds_cluster_impl_shutdown(void);
+void grpc_lb_policy_xds_cluster_resolver_init(void);
+void grpc_lb_policy_xds_cluster_resolver_shutdown(void);
+void grpc_lb_policy_xds_cluster_manager_init(void);
+void grpc_lb_policy_xds_cluster_manager_shutdown(void);
+#endif
+
+void grpc_register_extra_plugins() {
+#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_core::FileWatcherCertificateProviderInit,
+ grpc_core::FileWatcherCertificateProviderShutdown);
+ grpc_register_plugin(grpc_lb_policy_cds_init, grpc_lb_policy_cds_shutdown);
+ grpc_register_plugin(grpc_lb_policy_xds_cluster_impl_init,
+ grpc_lb_policy_xds_cluster_impl_shutdown);
+ grpc_register_plugin(grpc_lb_policy_xds_cluster_resolver_init,
+ grpc_lb_policy_xds_cluster_resolver_shutdown);
+ grpc_register_plugin(grpc_lb_policy_xds_cluster_manager_init,
+ grpc_lb_policy_xds_cluster_manager_shutdown);
+#endif
+}
+
+namespace grpc_core {
+#ifndef GRPC_NO_XDS
+extern void RbacFilterRegister(CoreConfiguration::Builder* builder);
+extern void RegisterXdsChannelStackModifier(
+ CoreConfiguration::Builder* builder);
+extern void RegisterChannelDefaultCreds(CoreConfiguration::Builder* builder);
+extern void RegisterXdsResolver(CoreConfiguration::Builder* builder);
+extern void RegisterCloud2ProdResolver(CoreConfiguration::Builder* builder);
+#endif
+void RegisterExtraFilters(CoreConfiguration::Builder* builder) {
+ // Use builder to avoid unused-parameter warning.
+ (void)builder;
+#ifndef GRPC_NO_XDS
+ // rbac_filter is being guarded with GRPC_NO_XDS to avoid a dependency on the
+ // re2 library by default
+ RbacFilterRegister(builder);
+ RegisterXdsChannelStackModifier(builder);
+ RegisterChannelDefaultCreds(builder);
+ RegisterXdsResolver(builder);
+ RegisterCloud2ProdResolver(builder);
+#endif
+}
+} // namespace grpc_core
diff --git a/grpc/src/core/plugin_registry/grpc_plugin_registry_noextra.cc b/grpc/src/core/plugin_registry/grpc_plugin_registry_noextra.cc
new file mode 100644
index 00000000..8ed172ed
--- /dev/null
+++ b/grpc/src/core/plugin_registry/grpc_plugin_registry_noextra.cc
@@ -0,0 +1,28 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <grpc/grpc.h>
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/builtins.h"
+
+void grpc_register_extra_plugins(void) {}
+
+namespace grpc_core {
+void RegisterExtraFilters(CoreConfiguration::Builder* /* builder */){}
+} // namespace grpc_core
diff --git a/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
deleted file mode 100644
index 5e745293..00000000
--- a/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * 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 <grpc/grpc.h>
-
-void grpc_http_filters_init(void);
-void grpc_http_filters_shutdown(void);
-void grpc_chttp2_plugin_init(void);
-void grpc_chttp2_plugin_shutdown(void);
-void grpc_deadline_filter_init(void);
-void grpc_deadline_filter_shutdown(void);
-void grpc_client_channel_init(void);
-void grpc_client_channel_shutdown(void);
-void grpc_inproc_plugin_init(void);
-void grpc_inproc_plugin_shutdown(void);
-void grpc_resolver_dns_ares_init(void);
-void grpc_resolver_dns_ares_shutdown(void);
-void grpc_resolver_dns_native_init(void);
-void grpc_resolver_dns_native_shutdown(void);
-void grpc_resolver_sockaddr_init(void);
-void grpc_resolver_sockaddr_shutdown(void);
-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_pick_first_init(void);
-void grpc_lb_policy_pick_first_shutdown(void);
-void grpc_lb_policy_round_robin_init(void);
-void grpc_lb_policy_round_robin_shutdown(void);
-void grpc_client_idle_filter_init(void);
-void grpc_client_idle_filter_shutdown(void);
-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);
-namespace grpc_core {
-void FaultInjectionFilterInit(void);
-void FaultInjectionFilterShutdown(void);
-} // namespace grpc_core
-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);
-
-void grpc_register_built_in_plugins(void) {
- grpc_register_plugin(grpc_http_filters_init,
- grpc_http_filters_shutdown);
- grpc_register_plugin(grpc_chttp2_plugin_init,
- grpc_chttp2_plugin_shutdown);
- grpc_register_plugin(grpc_deadline_filter_init,
- grpc_deadline_filter_shutdown);
- grpc_register_plugin(grpc_client_channel_init,
- grpc_client_channel_shutdown);
- grpc_register_plugin(grpc_inproc_plugin_init,
- grpc_inproc_plugin_shutdown);
- grpc_register_plugin(grpc_resolver_dns_ares_init,
- grpc_resolver_dns_ares_shutdown);
- grpc_register_plugin(grpc_resolver_dns_native_init,
- grpc_resolver_dns_native_shutdown);
- grpc_register_plugin(grpc_resolver_sockaddr_init,
- grpc_resolver_sockaddr_shutdown);
- grpc_register_plugin(grpc_resolver_fake_init,
- 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_pick_first_init,
- grpc_lb_policy_pick_first_shutdown);
- grpc_register_plugin(grpc_lb_policy_round_robin_init,
- grpc_lb_policy_round_robin_shutdown);
- grpc_register_plugin(grpc_client_idle_filter_init,
- grpc_client_idle_filter_shutdown);
- grpc_register_plugin(grpc_max_age_filter_init,
- grpc_max_age_filter_shutdown);
- grpc_register_plugin(grpc_message_size_filter_init,
- grpc_message_size_filter_shutdown);
- grpc_register_plugin(grpc_core::FaultInjectionFilterInit,
- grpc_core::FaultInjectionFilterShutdown);
- 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);
-}
diff --git a/grpc/src/core/tsi/alts/crypt/aes_gcm.cc b/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
index 02b1ac44..4eaaee28 100644
--- a/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
+++ b/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
@@ -18,17 +18,18 @@
#include <grpc/support/port_platform.h>
-#include "src/core/tsi/alts/crypt/gsec.h"
+#include <string.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
-#include <string.h>
#include <grpc/support/alloc.h>
+#include "src/core/tsi/alts/crypt/gsec.h"
+
constexpr size_t kKdfKeyLen = 32;
constexpr size_t kKdfCounterLen = 6;
constexpr size_t kKdfCounterOffset = 2;
@@ -558,7 +559,9 @@ static grpc_status_code gsec_aes_gcm_aead_crypter_decrypt_iovec(
if (!EVP_DecryptFinal_ex(aes_gcm_crypter->ctx, nullptr,
&bytes_written_temp)) {
aes_gcm_format_errors("Checking tag failed.", error_details);
- memset(plaintext_vec.iov_base, 0x00, plaintext_vec.iov_len);
+ if (plaintext_vec.iov_base != nullptr) {
+ memset(plaintext_vec.iov_base, 0x00, plaintext_vec.iov_len);
+ }
return GRPC_STATUS_FAILED_PRECONDITION;
}
if (bytes_written_temp != 0) {
diff --git a/grpc/src/core/tsi/alts/crypt/gsec.h b/grpc/src/core/tsi/alts/crypt/gsec.h
index c330ca69..11b21549 100644
--- a/grpc/src/core/tsi/alts/crypt/gsec.h
+++ b/grpc/src/core/tsi/alts/crypt/gsec.h
@@ -21,20 +21,21 @@
#include <grpc/support/port_platform.h>
-#include <grpc/event_engine/port.h>
-
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
+#include <grpc/event_engine/port.h>
#include <grpc/grpc.h>
-#ifndef GRPC_EVENT_ENGINE_POSIX
+#ifndef _STRUCT_IOVEC
+#if !defined(GRPC_EVENT_ENGINE_POSIX)
struct iovec {
void* iov_base;
size_t iov_len;
};
#endif // GRPC_EVENT_ENGINE_POSIX
+#endif // _STRUCT_IOVEC
/**
* A gsec interface for AEAD encryption schemes. The API is thread-compatible.
diff --git a/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc b/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
index bfa0b7a7..aae92a47 100644
--- a/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
+++ b/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -156,10 +158,10 @@ static tsi_result alts_protect(tsi_frame_protector* self,
*/
if (impl->in_place_protect_bytes_buffered + impl->overhead_length <
max_encrypted_payload_bytes(impl)) {
- size_t bytes_to_buffer = GPR_MIN(*unprotected_bytes_size,
- max_encrypted_payload_bytes(impl) -
- impl->in_place_protect_bytes_buffered -
- impl->overhead_length);
+ size_t bytes_to_buffer = std::min(
+ *unprotected_bytes_size, max_encrypted_payload_bytes(impl) -
+ impl->in_place_protect_bytes_buffered -
+ impl->overhead_length);
*unprotected_bytes_size = bytes_to_buffer;
if (bytes_to_buffer > 0) {
memcpy(
@@ -266,9 +268,9 @@ static tsi_result alts_unprotect(tsi_frame_protector* self,
if (!alts_is_frame_reader_done(impl->reader)) {
ensure_buffer_size(impl);
*protected_frames_bytes_size =
- GPR_MIN(impl->max_unprotected_frame_size -
- alts_get_output_bytes_read(impl->reader),
- *protected_frames_bytes_size);
+ std::min(impl->max_unprotected_frame_size -
+ alts_get_output_bytes_read(impl->reader),
+ *protected_frames_bytes_size);
size_t read_frames_bytes_size = *protected_frames_bytes_size;
if (!alts_read_frame_bytes(impl->reader, protected_frames_bytes,
&read_frames_bytes_size)) {
@@ -290,7 +292,7 @@ static tsi_result alts_unprotect(tsi_frame_protector* self,
return result;
}
}
- size_t bytes_to_write = GPR_MIN(
+ size_t bytes_to_write = std::min(
*unprotected_bytes_size, alts_get_output_bytes_read(impl->reader) -
impl->in_place_unprotect_bytes_processed -
impl->overhead_length);
@@ -368,8 +370,7 @@ tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size,
return TSI_INTERNAL_ERROR;
}
char* error_details = nullptr;
- alts_frame_protector* impl =
- static_cast<alts_frame_protector*>(gpr_zalloc(sizeof(*impl)));
+ alts_frame_protector* impl = grpc_core::Zalloc<alts_frame_protector>();
grpc_status_code status = create_alts_crypters(
key, key_size, is_client, is_rekey, impl, &error_details);
if (status != GRPC_STATUS_OK) {
@@ -385,9 +386,9 @@ tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size,
size_t max_protected_frame_size_to_set = kDefaultFrameLength;
if (max_protected_frame_size != nullptr) {
*max_protected_frame_size =
- GPR_MIN(*max_protected_frame_size, kMaxFrameLength);
+ std::min(*max_protected_frame_size, kMaxFrameLength);
*max_protected_frame_size =
- GPR_MAX(*max_protected_frame_size, kMinFrameLength);
+ std::max(*max_protected_frame_size, kMinFrameLength);
max_protected_frame_size_to_set = *max_protected_frame_size;
}
impl->max_protected_frame_size = max_protected_frame_size_to_set;
diff --git a/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc b/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
index aa90bbc6..0237f247 100644
--- a/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
+++ b/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
@@ -24,10 +24,12 @@
#include <stdint.h>
#include <string.h>
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/memory.h"
/* Use little endian to interpret a string of bytes as uint32_t. */
static uint32_t load_32_le(const unsigned char* buffer) {
@@ -47,9 +49,7 @@ static void store_32_le(uint32_t value, unsigned char* buffer) {
/* Frame writer implementation. */
alts_frame_writer* alts_create_frame_writer() {
- alts_frame_writer* writer =
- static_cast<alts_frame_writer*>(gpr_zalloc(sizeof(*writer)));
- return writer;
+ return grpc_core::Zalloc<alts_frame_writer>();
}
bool alts_reset_frame_writer(alts_frame_writer* writer,
@@ -82,8 +82,8 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output,
/* Write some header bytes, if needed. */
if (writer->header_bytes_written != sizeof(writer->header_buffer)) {
size_t bytes_to_write =
- GPR_MIN(*bytes_size,
- sizeof(writer->header_buffer) - writer->header_bytes_written);
+ std::min(*bytes_size,
+ sizeof(writer->header_buffer) - writer->header_bytes_written);
memcpy(output, writer->header_buffer + writer->header_bytes_written,
bytes_to_write);
bytes_written += bytes_to_write;
@@ -97,7 +97,7 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output,
}
/* Write some non-header bytes. */
size_t bytes_to_write =
- GPR_MIN(writer->input_size - writer->input_bytes_written, *bytes_size);
+ std::min(writer->input_size - writer->input_bytes_written, *bytes_size);
memcpy(output, writer->input_buffer, bytes_to_write);
writer->input_buffer += bytes_to_write;
bytes_written += bytes_to_write;
@@ -120,8 +120,7 @@ void alts_destroy_frame_writer(alts_frame_writer* writer) { gpr_free(writer); }
/* Frame reader implementation. */
alts_frame_reader* alts_create_frame_reader() {
- alts_frame_reader* reader =
- static_cast<alts_frame_reader*>(gpr_zalloc(sizeof(*reader)));
+ alts_frame_reader* reader = grpc_core::Zalloc<alts_frame_reader>();
return reader;
}
@@ -167,7 +166,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader,
size_t bytes_processed = 0;
/* Process the header, if needed. */
if (reader->header_bytes_read != sizeof(reader->header_buffer)) {
- size_t bytes_to_write = GPR_MIN(
+ size_t bytes_to_write = std::min(
*bytes_size, sizeof(reader->header_buffer) - reader->header_bytes_read);
memcpy(reader->header_buffer + reader->header_bytes_read, bytes,
bytes_to_write);
@@ -199,7 +198,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader,
reader->bytes_remaining = frame_length - kFrameMessageTypeFieldSize;
}
/* Process the non-header bytes. */
- size_t bytes_to_write = GPR_MIN(*bytes_size, reader->bytes_remaining);
+ size_t bytes_to_write = std::min(*bytes_size, reader->bytes_remaining);
memcpy(reader->output_buffer, bytes, bytes_to_write);
reader->output_buffer += bytes_to_write;
bytes_processed += bytes_to_write;
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
index ed70d812..4e80c654 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
+++ b/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <list>
-
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
+#include <list>
+
#include "upb/upb.hpp"
#include <grpc/byte_buffer.h>
@@ -178,8 +178,7 @@ static void handle_response_done(alts_grpc_handshaker_client* client,
const unsigned char* bytes_to_send,
size_t bytes_to_send_size,
tsi_handshaker_result* result) {
- recv_message_result* p =
- static_cast<recv_message_result*>(gpr_zalloc(sizeof(*p)));
+ recv_message_result* p = grpc_core::Zalloc<recv_message_result>();
p->status = status;
p->bytes_to_send = bytes_to_send;
p->bytes_to_send_size = bytes_to_send_size;
@@ -210,13 +209,13 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
}
/* TSI handshake has been shutdown. */
if (alts_tsi_handshaker_has_shutdown(handshaker)) {
- gpr_log(GPR_ERROR, "TSI handshake shutdown");
+ gpr_log(GPR_INFO, "TSI handshake shutdown");
handle_response_done(client, TSI_HANDSHAKE_SHUTDOWN, nullptr, 0, nullptr);
return;
}
/* Failed grpc call check. */
if (!is_ok || status != GRPC_STATUS_OK) {
- gpr_log(GPR_ERROR, "grpc call made to handshaker service failed");
+ gpr_log(GPR_INFO, "grpc call made to handshaker service failed");
handle_response_done(client, TSI_INTERNAL_ERROR, nullptr, 0, nullptr);
return;
}
@@ -244,7 +243,7 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
handle_response_done(client, TSI_DATA_CORRUPTED, nullptr, 0, nullptr);
return;
}
- upb_strview out_frames = grpc_gcp_HandshakerResp_out_frames(resp);
+ upb_StringView out_frames = grpc_gcp_HandshakerResp_out_frames(resp);
unsigned char* bytes_to_send = nullptr;
size_t bytes_to_send_size = 0;
if (out_frames.size > 0) {
@@ -273,7 +272,7 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
grpc_status_code code = static_cast<grpc_status_code>(
grpc_gcp_HandshakerStatus_code(resp_status));
if (code != GRPC_STATUS_OK) {
- upb_strview details = grpc_gcp_HandshakerStatus_details(resp_status);
+ upb_StringView details = grpc_gcp_HandshakerStatus_details(resp_status);
if (details.size > 0) {
char* error_details = static_cast<char*>(gpr_zalloc(details.size + 1));
memcpy(error_details, details.data, details.size);
@@ -463,7 +462,7 @@ static void on_status_received(void* arg, grpc_error_handle error) {
/* Serializes a grpc_gcp_HandshakerReq message into a buffer and returns newly
* grpc_byte_buffer holding it. */
static grpc_byte_buffer* get_serialized_handshaker_req(
- grpc_gcp_HandshakerReq* req, upb_arena* arena) {
+ grpc_gcp_HandshakerReq* req, upb_Arena* arena) {
size_t buf_length;
char* buf = grpc_gcp_HandshakerReq_serialize(req, arena, &buf_length);
if (buf == nullptr) {
@@ -488,19 +487,21 @@ static grpc_byte_buffer* get_serialized_start_client(
grpc_gcp_StartClientHandshakeReq_set_handshake_security_protocol(
start_client, grpc_gcp_ALTS);
grpc_gcp_StartClientHandshakeReq_add_application_protocols(
- start_client, upb_strview_makez(ALTS_APPLICATION_PROTOCOL), arena.ptr());
+ start_client, upb_StringView_FromString(ALTS_APPLICATION_PROTOCOL),
+ arena.ptr());
grpc_gcp_StartClientHandshakeReq_add_record_protocols(
- start_client, upb_strview_makez(ALTS_RECORD_PROTOCOL), arena.ptr());
+ start_client, upb_StringView_FromString(ALTS_RECORD_PROTOCOL),
+ arena.ptr());
grpc_gcp_RpcProtocolVersions* client_version =
grpc_gcp_StartClientHandshakeReq_mutable_rpc_versions(start_client,
arena.ptr());
grpc_gcp_RpcProtocolVersions_assign_from_struct(
client_version, arena.ptr(), &client->options->rpc_versions);
grpc_gcp_StartClientHandshakeReq_set_target_name(
- start_client,
- upb_strview_make(reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(client->target_name)),
- GRPC_SLICE_LENGTH(client->target_name)));
+ start_client, upb_StringView_FromDataAndSize(
+ reinterpret_cast<const char*>(
+ GRPC_SLICE_START_PTR(client->target_name)),
+ GRPC_SLICE_LENGTH(client->target_name)));
target_service_account* ptr =
(reinterpret_cast<grpc_alts_credentials_client_options*>(client->options))
->target_account_list_head;
@@ -509,7 +510,7 @@ static grpc_byte_buffer* get_serialized_start_client(
grpc_gcp_StartClientHandshakeReq_add_target_identities(start_client,
arena.ptr());
grpc_gcp_Identity_set_service_account(target_identity,
- upb_strview_makez(ptr->data));
+ upb_StringView_FromString(ptr->data));
ptr = ptr->next;
}
grpc_gcp_StartClientHandshakeReq_set_max_frame_size(
@@ -552,17 +553,19 @@ static grpc_byte_buffer* get_serialized_start_server(
grpc_gcp_StartServerHandshakeReq* start_server =
grpc_gcp_HandshakerReq_mutable_server_start(req, arena.ptr());
grpc_gcp_StartServerHandshakeReq_add_application_protocols(
- start_server, upb_strview_makez(ALTS_APPLICATION_PROTOCOL), arena.ptr());
+ start_server, upb_StringView_FromString(ALTS_APPLICATION_PROTOCOL),
+ arena.ptr());
grpc_gcp_ServerHandshakeParameters* value =
grpc_gcp_ServerHandshakeParameters_new(arena.ptr());
grpc_gcp_ServerHandshakeParameters_add_record_protocols(
- value, upb_strview_makez(ALTS_RECORD_PROTOCOL), arena.ptr());
+ value, upb_StringView_FromString(ALTS_RECORD_PROTOCOL), 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)),
- GRPC_SLICE_LENGTH(*bytes_received)));
+ start_server,
+ upb_StringView_FromDataAndSize(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(*bytes_received)),
+ GRPC_SLICE_LENGTH(*bytes_received)));
grpc_gcp_RpcProtocolVersions* server_version =
grpc_gcp_StartServerHandshakeReq_mutable_rpc_versions(start_server,
arena.ptr());
@@ -603,9 +606,10 @@ static grpc_byte_buffer* get_serialized_next(grpc_slice* bytes_received) {
grpc_gcp_NextHandshakeMessageReq* next =
grpc_gcp_HandshakerReq_mutable_next(req, arena.ptr());
grpc_gcp_NextHandshakeMessageReq_set_in_bytes(
- next, upb_strview_make(reinterpret_cast<const char*> GRPC_SLICE_START_PTR(
- *bytes_received),
- GRPC_SLICE_LENGTH(*bytes_received)));
+ next,
+ upb_StringView_FromDataAndSize(
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(*bytes_received),
+ GRPC_SLICE_LENGTH(*bytes_received)));
return get_serialized_handshaker_req(req, arena.ptr());
}
@@ -717,12 +721,12 @@ alts_handshaker_client* alts_grpc_handshaker_client_create(
: grpc_channel_create_pollset_set_call(
channel, nullptr, GRPC_PROPAGATE_DEFAULTS, interested_parties,
grpc_slice_from_static_string(ALTS_SERVICE_METHOD), &slice,
- GRPC_MILLIS_INF_FUTURE, nullptr);
+ grpc_core::Timestamp::InfFuture(), nullptr);
+ grpc_slice_unref_internal(slice);
GRPC_CLOSURE_INIT(&client->on_handshaker_service_resp_recv, grpc_cb, client,
grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&client->on_status_received, on_status_received, client,
grpc_schedule_on_exec_ctx);
- grpc_slice_unref_internal(slice);
return &client->base;
}
@@ -850,7 +854,7 @@ void alts_handshaker_client_on_status_received_for_testing(
reinterpret_cast<alts_grpc_handshaker_client*>(c);
client->handshake_status_code = status;
client->handshake_status_details = grpc_empty_slice();
- grpc_core::Closure::Run(DEBUG_LOCATION, &client->on_status_received, error);
+ Closure::Run(DEBUG_LOCATION, &client->on_status_received, error);
}
} // namespace internal
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h b/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
index d8669da0..133cea5d 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
+++ b/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
@@ -25,11 +25,10 @@
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
-#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
-#include "src/core/tsi/transport_security_interface.h"
-
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
+#include "src/core/tsi/transport_security_interface.h"
#define ALTS_SERVICE_METHOD "/grpc.gcp.HandshakerService/DoHandshake"
#define ALTS_APPLICATION_PROTOCOL "grpc"
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_shared_resource.cc b/grpc/src/core/tsi/alts/handshaker/alts_shared_resource.cc
index 255eda5d..a4a1fb20 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_shared_resource.cc
+++ b/grpc/src/core/tsi/alts/handshaker/alts_shared_resource.cc
@@ -22,6 +22,7 @@
#include <grpc/support/log.h>
+#include "src/core/lib/channel/channel_args.h"
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
static alts_shared_resource_dedicated g_alts_resource_dedicated;
@@ -55,8 +56,15 @@ void grpc_alts_shared_resource_dedicated_start(
const char* handshaker_service_url) {
gpr_mu_lock(&g_alts_resource_dedicated.mu);
if (g_alts_resource_dedicated.cq == nullptr) {
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ // Disable retries so that we quickly get a signal when the
+ // handshake server is not reachable.
+ grpc_arg disable_retries_arg = grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_ENABLE_RETRIES), 0);
+ grpc_channel_args args = {1, &disable_retries_arg};
g_alts_resource_dedicated.channel =
- grpc_insecure_channel_create(handshaker_service_url, nullptr, nullptr);
+ grpc_channel_create(handshaker_service_url, creds, &args);
+ grpc_channel_credentials_release(creds);
g_alts_resource_dedicated.cq =
grpc_completion_queue_create_for_next(nullptr);
g_alts_resource_dedicated.thread =
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
index 9cca8ab4..2d3935d8 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
+++ b/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
@@ -26,12 +26,14 @@
#include "upb/upb.hpp"
+#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 "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/closure.h"
@@ -151,6 +153,13 @@ static tsi_result handshaker_result_extract_peer(
return ok;
}
+static tsi_result handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY;
+ return TSI_OK;
+}
+
static tsi_result handshaker_result_create_zero_copy_grpc_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_zero_copy_grpc_protector** protector) {
@@ -247,9 +256,11 @@ static void handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable result_vtable = {
handshaker_result_extract_peer,
+ handshaker_result_get_frame_protector_type,
handshaker_result_create_zero_copy_grpc_protector,
handshaker_result_create_frame_protector,
- handshaker_result_get_unused_bytes, handshaker_result_destroy};
+ handshaker_result_get_unused_bytes,
+ handshaker_result_destroy};
tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
bool is_client,
@@ -266,13 +277,13 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
gpr_log(GPR_ERROR, "Invalid identity");
return TSI_FAILED_PRECONDITION;
}
- upb_strview peer_service_account =
+ upb_StringView peer_service_account =
grpc_gcp_Identity_service_account(identity);
if (peer_service_account.size == 0) {
gpr_log(GPR_ERROR, "Invalid peer service account");
return TSI_FAILED_PRECONDITION;
}
- upb_strview key_data = grpc_gcp_HandshakerResult_key_data(hresult);
+ upb_StringView key_data = grpc_gcp_HandshakerResult_key_data(hresult);
if (key_data.size < kAltsAes128GcmRekeyKeyLength) {
gpr_log(GPR_ERROR, "Bad key length");
return TSI_FAILED_PRECONDITION;
@@ -283,13 +294,13 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
gpr_log(GPR_ERROR, "Peer does not set RPC protocol versions.");
return TSI_FAILED_PRECONDITION;
}
- upb_strview application_protocol =
+ upb_StringView application_protocol =
grpc_gcp_HandshakerResult_application_protocol(hresult);
if (application_protocol.size == 0) {
gpr_log(GPR_ERROR, "Invalid application protocol");
return TSI_FAILED_PRECONDITION;
}
- upb_strview record_protocol =
+ upb_StringView record_protocol =
grpc_gcp_HandshakerResult_record_protocol(hresult);
if (record_protocol.size == 0) {
gpr_log(GPR_ERROR, "Invalid record protocol");
@@ -301,12 +312,12 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
gpr_log(GPR_ERROR, "Invalid local identity");
return TSI_FAILED_PRECONDITION;
}
- upb_strview local_service_account =
+ upb_StringView local_service_account =
grpc_gcp_Identity_service_account(local_identity);
// We don't check if local service account is empty here
// because local identity could be empty in certain situations.
alts_tsi_handshaker_result* sresult =
- static_cast<alts_tsi_handshaker_result*>(gpr_zalloc(sizeof(*sresult)));
+ grpc_core::Zalloc<alts_tsi_handshaker_result>();
sresult->key_data =
static_cast<char*>(gpr_zalloc(kAltsAes128GcmRekeyKeyLength));
memcpy(sresult->key_data, key_data.data, kAltsAes128GcmRekeyKeyLength);
@@ -340,14 +351,14 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
return TSI_FAILED_PRECONDITION;
}
if (grpc_gcp_Identity_has_attributes(identity)) {
- size_t iter = UPB_MAP_BEGIN;
+ size_t iter = kUpb_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(
+ upb_StringView key = grpc_gcp_Identity_AttributesEntry_key(
const_cast<grpc_gcp_Identity_AttributesEntry*>(
peer_attributes_entry));
- upb_strview val = grpc_gcp_Identity_AttributesEntry_value(
+ upb_StringView val = grpc_gcp_Identity_AttributesEntry_value(
const_cast<grpc_gcp_Identity_AttributesEntry*>(
peer_attributes_entry));
grpc_gcp_AltsContext_peer_attributes_set(context, key, val,
@@ -381,7 +392,7 @@ static void on_handshaker_service_resp_recv(void* arg,
}
bool success = true;
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
+ gpr_log(GPR_INFO,
"ALTS handshaker on_handshaker_service_resp_recv error: %s",
grpc_error_std_string(error).c_str());
success = false;
@@ -436,7 +447,7 @@ static tsi_result alts_tsi_handshaker_continue_handshaker_next(
GPR_ASSERT(handshaker->client == nullptr);
handshaker->client = client;
if (handshaker->shutdown) {
- gpr_log(GPR_ERROR, "TSI handshake shutdown");
+ gpr_log(GPR_INFO, "TSI handshake shutdown");
return TSI_HANDSHAKE_SHUTDOWN;
}
}
@@ -487,8 +498,15 @@ static void alts_tsi_handshaker_create_channel(
static_cast<alts_tsi_handshaker_continue_handshaker_next_args*>(arg);
alts_tsi_handshaker* handshaker = next_args->handshaker;
GPR_ASSERT(handshaker->channel == nullptr);
- handshaker->channel = grpc_insecure_channel_create(
- next_args->handshaker->handshaker_service_url, nullptr, nullptr);
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ // Disable retries so that we quickly get a signal when the
+ // handshake server is not reachable.
+ grpc_arg disable_retries_arg = grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_ENABLE_RETRIES), 0);
+ grpc_channel_args args = {1, &disable_retries_arg};
+ handshaker->channel = grpc_channel_create(
+ next_args->handshaker->handshaker_service_url, creds, &args);
+ grpc_channel_credentials_release(creds);
tsi_result continue_next_result =
alts_tsi_handshaker_continue_handshaker_next(
handshaker, next_args->received_bytes.get(),
@@ -514,7 +532,7 @@ static tsi_result handshaker_next(
{
grpc_core::MutexLock lock(&handshaker->mu);
if (handshaker->shutdown) {
- gpr_log(GPR_ERROR, "TSI handshake shutdown");
+ gpr_log(GPR_INFO, "TSI handshake shutdown");
return TSI_HANDSHAKE_SHUTDOWN;
}
}
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.cc b/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.cc
index f80498db..42d6323f 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.cc
+++ b/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.cc
@@ -42,14 +42,14 @@ tsi_result alts_tsi_utils_convert_to_tsi_result(grpc_status_code code) {
}
grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response(
- grpc_byte_buffer* resp_buffer, upb_arena* arena) {
+ grpc_byte_buffer* resp_buffer, upb_Arena* arena) {
GPR_ASSERT(resp_buffer != nullptr);
GPR_ASSERT(arena != nullptr);
grpc_byte_buffer_reader bbr;
grpc_byte_buffer_reader_init(&bbr, resp_buffer);
grpc_slice slice = grpc_byte_buffer_reader_readall(&bbr);
size_t buf_size = GPR_SLICE_LENGTH(slice);
- void* buf = upb_arena_malloc(arena, buf_size);
+ void* buf = upb_Arena_Malloc(arena, buf_size);
memcpy(buf, reinterpret_cast<const char*>(GPR_SLICE_START_PTR(slice)),
buf_size);
grpc_gcp_HandshakerResp* resp = grpc_gcp_HandshakerResp_parse(
diff --git a/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.h b/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.h
index a20e5e9c..c856a706 100644
--- a/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.h
+++ b/grpc/src/core/tsi/alts/handshaker/alts_tsi_utils.h
@@ -48,6 +48,6 @@ tsi_result alts_tsi_utils_convert_to_tsi_result(grpc_status_code code);
* failure.
*/
grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response(
- grpc_byte_buffer* resp_buffer, upb_arena* arena);
+ grpc_byte_buffer* resp_buffer, upb_Arena* arena);
#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H */
diff --git a/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options b/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options
deleted file mode 100644
index 702ba380..00000000
--- a/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options
+++ /dev/null
@@ -1,2 +0,0 @@
-handshaker.proto no_unions:true
-grpc.gcp.StartServerHandshakeReq.handshake_parameters max_count:3
diff --git a/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc b/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
index 402bf131..b7644a07 100644
--- a/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
+++ b/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.cc
@@ -68,7 +68,7 @@ bool grpc_gcp_rpc_protocol_versions_encode(
}
bool grpc_gcp_rpc_protocol_versions_encode(
- const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
+ const grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena,
grpc_slice* slice) {
if (versions == nullptr || arena == nullptr || slice == nullptr) {
gpr_log(GPR_ERROR,
@@ -135,7 +135,7 @@ void grpc_gcp_rpc_protocol_versions_assign_from_upb(
}
void grpc_gcp_RpcProtocolVersions_assign_from_struct(
- grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
+ grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena,
const grpc_gcp_rpc_protocol_versions* value) {
grpc_gcp_RpcProtocolVersions_Version* max_version_msg =
grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(versions, arena);
diff --git a/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h b/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h
index 75739e4f..34675ad9 100644
--- a/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h
+++ b/grpc/src/core/tsi/alts/handshaker/transport_security_common_api.h
@@ -91,7 +91,7 @@ bool grpc_gcp_rpc_protocol_versions_encode(
* The method returns true on success and false otherwise.
*/
bool grpc_gcp_rpc_protocol_versions_encode(
- const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
+ const grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena,
grpc_slice* slice);
/**
@@ -119,7 +119,7 @@ void grpc_gcp_rpc_protocol_versions_assign_from_upb(
* RpcProtocolVersions.
*/
void grpc_gcp_RpcProtocolVersions_assign_from_struct(
- grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena,
+ grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena,
const grpc_gcp_rpc_protocol_versions* value);
/**
diff --git a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
index 352561d4..67cdd994 100644
--- a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
+++ b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
@@ -20,11 +20,11 @@
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h"
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
-
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h"
diff --git a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
index 1048b600..f601b326 100644
--- a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
+++ b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
@@ -39,7 +39,7 @@ static void ensure_iovec_buf_size(alts_grpc_record_protocol* rp,
return;
}
/* At least double the iovec buffer size. */
- rp->iovec_buf_length = GPR_MAX(sb->count, 2 * rp->iovec_buf_length);
+ rp->iovec_buf_length = std::max(sb->count, 2 * rp->iovec_buf_length);
rp->iovec_buf = static_cast<iovec_t*>(
gpr_realloc(rp->iovec_buf, rp->iovec_buf_length * sizeof(iovec_t)));
}
diff --git a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
index e0ce6410..d5455b6d 100644
--- a/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
+++ b/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
@@ -278,9 +278,9 @@ tsi_result alts_zero_copy_grpc_protector_create(
size_t max_protected_frame_size_to_set = kDefaultFrameLength;
if (max_protected_frame_size != nullptr) {
*max_protected_frame_size =
- GPR_MIN(*max_protected_frame_size, kMaxFrameLength);
+ std::min(*max_protected_frame_size, kMaxFrameLength);
*max_protected_frame_size =
- GPR_MAX(*max_protected_frame_size, kMinFrameLength);
+ std::max(*max_protected_frame_size, kMinFrameLength);
max_protected_frame_size_to_set = *max_protected_frame_size;
}
impl->max_protected_frame_size = max_protected_frame_size_to_set;
diff --git a/grpc/src/core/tsi/fake_transport_security.cc b/grpc/src/core/tsi/fake_transport_security.cc
index 5e63f11a..ce09cdb7 100644
--- a/grpc/src/core/tsi/fake_transport_security.cc
+++ b/grpc/src/core/tsi/fake_transport_security.cc
@@ -27,6 +27,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/transport_security_grpc.h"
@@ -416,8 +417,8 @@ static tsi_result fake_zero_copy_grpc_protector_protect(
/* Protects each frame. */
while (unprotected_slices->length > 0) {
size_t frame_length =
- GPR_MIN(impl->max_frame_size,
- unprotected_slices->length + TSI_FAKE_FRAME_HEADER_SIZE);
+ std::min(impl->max_frame_size,
+ unprotected_slices->length + TSI_FAKE_FRAME_HEADER_SIZE);
grpc_slice slice = GRPC_SLICE_MALLOC(TSI_FAKE_FRAME_HEADER_SIZE);
store32_little_endian(static_cast<uint32_t>(frame_length),
GRPC_SLICE_START_PTR(slice));
@@ -498,6 +499,7 @@ struct fake_handshaker_result {
unsigned char* unused_bytes;
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. */
@@ -514,6 +516,13 @@ static tsi_result fake_handshaker_result_extract_peer(
return result;
}
+static tsi_result fake_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY;
+ return TSI_OK;
+}
+
static tsi_result fake_handshaker_result_create_zero_copy_grpc_protector(
const tsi_handshaker_result* /*self*/,
size_t* max_output_protected_frame_size,
@@ -549,6 +558,7 @@ static void fake_handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable handshaker_result_vtable = {
fake_handshaker_result_extract_peer,
+ fake_handshaker_result_get_frame_protector_type,
fake_handshaker_result_create_zero_copy_grpc_protector,
fake_handshaker_result_create_frame_protector,
fake_handshaker_result_get_unused_bytes,
@@ -562,8 +572,7 @@ static tsi_result fake_handshaker_result_create(
handshaker_result == nullptr) {
return TSI_INVALID_ARGUMENT;
}
- fake_handshaker_result* result =
- static_cast<fake_handshaker_result*>(gpr_zalloc(sizeof(*result)));
+ fake_handshaker_result* result = grpc_core::Zalloc<fake_handshaker_result>();
result->base.vtable = &handshaker_result_vtable;
if (unused_bytes_size > 0) {
result->unused_bytes =
@@ -755,8 +764,7 @@ static const tsi_handshaker_vtable handshaker_vtable = {
};
tsi_handshaker* tsi_create_fake_handshaker(int is_client) {
- tsi_fake_handshaker* impl =
- static_cast<tsi_fake_handshaker*>(gpr_zalloc(sizeof(*impl)));
+ tsi_fake_handshaker* impl = grpc_core::Zalloc<tsi_fake_handshaker>();
impl->base.vtable = &handshaker_vtable;
impl->is_client = is_client;
impl->result = TSI_HANDSHAKE_IN_PROGRESS;
@@ -777,7 +785,7 @@ tsi_handshaker* tsi_create_fake_handshaker(int is_client) {
tsi_frame_protector* tsi_create_fake_frame_protector(
size_t* max_protected_frame_size) {
tsi_fake_frame_protector* impl =
- static_cast<tsi_fake_frame_protector*>(gpr_zalloc(sizeof(*impl)));
+ grpc_core::Zalloc<tsi_fake_frame_protector>();
impl->max_frame_size = (max_protected_frame_size == nullptr)
? TSI_FAKE_DEFAULT_FRAME_SIZE
: *max_protected_frame_size;
diff --git a/grpc/src/core/tsi/local_transport_security.cc b/grpc/src/core/tsi/local_transport_security.cc
index 19043cd1..e563d45a 100644
--- a/grpc/src/core/tsi/local_transport_security.cc
+++ b/grpc/src/core/tsi/local_transport_security.cc
@@ -41,118 +41,77 @@ typedef struct local_zero_copy_grpc_protector {
/* Main struct for local TSI handshaker result. */
typedef struct local_tsi_handshaker_result {
tsi_handshaker_result base;
- bool is_client;
+ unsigned char* unused_bytes;
+ size_t unused_bytes_size;
} local_tsi_handshaker_result;
/* Main struct for local TSI handshaker. */
typedef struct local_tsi_handshaker {
tsi_handshaker base;
- bool is_client;
} local_tsi_handshaker;
-/* --- tsi_zero_copy_grpc_protector methods implementation. --- */
+/* --- tsi_handshaker_result methods implementation. --- */
-static tsi_result local_zero_copy_grpc_protector_protect(
- tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices,
- grpc_slice_buffer* protected_slices) {
- if (self == nullptr || unprotected_slices == nullptr ||
- protected_slices == nullptr) {
- gpr_log(GPR_ERROR, "Invalid nullptr arguments to zero-copy grpc protect.");
- return TSI_INVALID_ARGUMENT;
- }
- grpc_slice_buffer_move_into(unprotected_slices, protected_slices);
+tsi_result handshaker_result_extract_peer(const tsi_handshaker_result* /*self*/,
+ tsi_peer* /*peer*/) {
return TSI_OK;
}
-static tsi_result local_zero_copy_grpc_protector_unprotect(
- tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* protected_slices,
- grpc_slice_buffer* unprotected_slices) {
- if (self == nullptr || unprotected_slices == nullptr ||
- protected_slices == nullptr) {
- gpr_log(GPR_ERROR,
- "Invalid nullptr arguments to zero-copy grpc unprotect.");
- return TSI_INVALID_ARGUMENT;
- }
- grpc_slice_buffer_move_into(protected_slices, unprotected_slices);
+tsi_result handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NONE;
return TSI_OK;
}
-static void local_zero_copy_grpc_protector_destroy(
- tsi_zero_copy_grpc_protector* self) {
- gpr_free(self);
-}
-
-static const tsi_zero_copy_grpc_protector_vtable
- local_zero_copy_grpc_protector_vtable = {
- local_zero_copy_grpc_protector_protect,
- local_zero_copy_grpc_protector_unprotect,
- local_zero_copy_grpc_protector_destroy,
- nullptr /* local_zero_copy_grpc_protector_max_frame_size */};
-
-tsi_result local_zero_copy_grpc_protector_create(
- tsi_zero_copy_grpc_protector** protector) {
- if (grpc_core::ExecCtx::Get() == nullptr || protector == nullptr) {
- gpr_log(
- GPR_ERROR,
- "Invalid nullptr arguments to local_zero_copy_grpc_protector create.");
+tsi_result handshaker_result_get_unused_bytes(const tsi_handshaker_result* self,
+ const unsigned char** bytes,
+ size_t* bytes_size) {
+ if (self == nullptr || bytes == nullptr || bytes_size == nullptr) {
+ gpr_log(GPR_ERROR, "Invalid arguments to get_unused_bytes()");
return TSI_INVALID_ARGUMENT;
}
- local_zero_copy_grpc_protector* impl =
- static_cast<local_zero_copy_grpc_protector*>(gpr_zalloc(sizeof(*impl)));
- impl->base.vtable = &local_zero_copy_grpc_protector_vtable;
- *protector = &impl->base;
+ auto* result = reinterpret_cast<local_tsi_handshaker_result*>(
+ const_cast<tsi_handshaker_result*>(self));
+ *bytes_size = result->unused_bytes_size;
+ *bytes = result->unused_bytes;
return TSI_OK;
}
-/* --- tsi_handshaker_result methods implementation. --- */
-
-static tsi_result handshaker_result_extract_peer(
- const tsi_handshaker_result* /*self*/, tsi_peer* /*peer*/) {
- return TSI_OK;
-}
-
-static tsi_result handshaker_result_create_zero_copy_grpc_protector(
- const tsi_handshaker_result* self,
- size_t* /*max_output_protected_frame_size*/,
- tsi_zero_copy_grpc_protector** protector) {
- if (self == nullptr || protector == nullptr) {
- gpr_log(GPR_ERROR,
- "Invalid arguments to create_zero_copy_grpc_protector()");
- return TSI_INVALID_ARGUMENT;
- }
- tsi_result ok = local_zero_copy_grpc_protector_create(protector);
- if (ok != TSI_OK) {
- gpr_log(GPR_ERROR, "Failed to create zero-copy grpc protector");
- }
- return ok;
-}
-
-static void handshaker_result_destroy(tsi_handshaker_result* self) {
+void handshaker_result_destroy(tsi_handshaker_result* self) {
if (self == nullptr) {
return;
}
local_tsi_handshaker_result* result =
reinterpret_cast<local_tsi_handshaker_result*>(
const_cast<tsi_handshaker_result*>(self));
+ gpr_free(result->unused_bytes);
gpr_free(result);
}
-static const tsi_handshaker_result_vtable result_vtable = {
+const tsi_handshaker_result_vtable result_vtable = {
handshaker_result_extract_peer,
- handshaker_result_create_zero_copy_grpc_protector,
+ handshaker_result_get_frame_protector_type,
+ nullptr, /* handshaker_result_create_zero_copy_grpc_protector */
nullptr, /* handshaker_result_create_frame_protector */
- nullptr, /* handshaker_result_get_unused_bytes */
+ handshaker_result_get_unused_bytes,
handshaker_result_destroy};
-static tsi_result create_handshaker_result(bool is_client,
- tsi_handshaker_result** self) {
+tsi_result create_handshaker_result(const unsigned char* received_bytes,
+ size_t received_bytes_size,
+ tsi_handshaker_result** self) {
if (self == nullptr) {
gpr_log(GPR_ERROR, "Invalid arguments to create_handshaker_result()");
return TSI_INVALID_ARGUMENT;
}
local_tsi_handshaker_result* result =
- static_cast<local_tsi_handshaker_result*>(gpr_zalloc(sizeof(*result)));
- result->is_client = is_client;
+ grpc_core::Zalloc<local_tsi_handshaker_result>();
+ if (received_bytes_size > 0) {
+ result->unused_bytes =
+ static_cast<unsigned char*>(gpr_malloc(received_bytes_size));
+ memcpy(result->unused_bytes, received_bytes, received_bytes_size);
+ }
+ result->unused_bytes_size = received_bytes_size;
result->base.vtable = &result_vtable;
*self = &result->base;
return TSI_OK;
@@ -160,9 +119,9 @@ static tsi_result create_handshaker_result(bool is_client,
/* --- tsi_handshaker methods implementation. --- */
-static tsi_result handshaker_next(
- tsi_handshaker* self, const unsigned char* /*received_bytes*/,
- size_t /*received_bytes_size*/, const unsigned char** /*bytes_to_send*/,
+tsi_result handshaker_next(
+ tsi_handshaker* self, const unsigned char* received_bytes,
+ size_t received_bytes_size, const unsigned char** /*bytes_to_send*/,
size_t* bytes_to_send_size, tsi_handshaker_result** result,
tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/) {
if (self == nullptr) {
@@ -172,14 +131,12 @@ static tsi_result handshaker_next(
/* Note that there is no interaction between TSI peers, and all operations are
* local.
*/
- local_tsi_handshaker* handshaker =
- reinterpret_cast<local_tsi_handshaker*>(self);
*bytes_to_send_size = 0;
- create_handshaker_result(handshaker->is_client, result);
+ create_handshaker_result(received_bytes, received_bytes_size, result);
return TSI_OK;
}
-static void handshaker_destroy(tsi_handshaker* self) {
+void handshaker_destroy(tsi_handshaker* self) {
if (self == nullptr) {
return;
}
@@ -188,7 +145,7 @@ static void handshaker_destroy(tsi_handshaker* self) {
gpr_free(handshaker);
}
-static const tsi_handshaker_vtable handshaker_vtable = {
+const tsi_handshaker_vtable handshaker_vtable = {
nullptr, /* get_bytes_to_send_to_peer -- deprecated */
nullptr, /* process_bytes_from_peer -- deprecated */
nullptr, /* get_result -- deprecated */
@@ -201,14 +158,12 @@ static const tsi_handshaker_vtable handshaker_vtable = {
} // namespace
-tsi_result tsi_local_handshaker_create(bool is_client, tsi_handshaker** self) {
+tsi_result tsi_local_handshaker_create(tsi_handshaker** self) {
if (self == nullptr) {
gpr_log(GPR_ERROR, "Invalid arguments to local_tsi_handshaker_create()");
return TSI_INVALID_ARGUMENT;
}
- local_tsi_handshaker* handshaker =
- static_cast<local_tsi_handshaker*>(gpr_zalloc(sizeof(*handshaker)));
- handshaker->is_client = is_client;
+ local_tsi_handshaker* handshaker = grpc_core::Zalloc<local_tsi_handshaker>();
handshaker->base.vtable = &handshaker_vtable;
*self = &handshaker->base;
return TSI_OK;
diff --git a/grpc/src/core/tsi/local_transport_security.h b/grpc/src/core/tsi/local_transport_security.h
index fb46c1ea..79ed8f9c 100644
--- a/grpc/src/core/tsi/local_transport_security.h
+++ b/grpc/src/core/tsi/local_transport_security.h
@@ -32,9 +32,6 @@
/**
* This method creates a local TSI handshaker instance.
*
- * - is_client: boolean value indicating if the handshaker is used at the client
- * (is_client = true) or server (is_client = false) side. The parameter is
- * added for future extension.
* - self: address of local TSI handshaker instance to be returned from the
* method.
*
@@ -45,6 +42,6 @@
* does not fit with an insecure connector, we would need to add a separate
* handshaker for insecure connectors.
*/
-tsi_result tsi_local_handshaker_create(bool is_client, tsi_handshaker** self);
+tsi_result tsi_local_handshaker_create(tsi_handshaker** self);
#endif /* GRPC_CORE_TSI_LOCAL_TRANSPORT_SECURITY_H */
diff --git a/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.cc b/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.cc
new file mode 100644
index 00000000..2d99be47
--- /dev/null
+++ b/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.cc
@@ -0,0 +1,141 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/tsi/ssl/key_logging/ssl_key_logging.h"
+
+#include <map>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/slice/slice_internal.h"
+
+using TlsSessionKeyLogger = tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger;
+
+namespace tsi {
+
+namespace {
+
+gpr_once g_cache_mutex_init = GPR_ONCE_INIT;
+grpc_core::Mutex* g_tls_session_key_log_cache_mu = nullptr;
+// A pointer to a global singleton instance.
+TlsSessionKeyLoggerCache* g_cache_instance
+ ABSL_GUARDED_BY(g_tls_session_key_log_cache_mu) = nullptr;
+
+void do_cache_mutex_init(void) {
+ g_tls_session_key_log_cache_mu = new grpc_core::Mutex();
+}
+
+} // namespace
+
+TlsSessionKeyLoggerCache::TlsSessionKeyLogger::TlsSessionKeyLogger(
+ std::string tls_session_key_log_file_path,
+ grpc_core::RefCountedPtr<TlsSessionKeyLoggerCache> cache)
+ : tls_session_key_log_file_path_(std::move(tls_session_key_log_file_path)),
+ cache_(std::move(cache)) {
+ GPR_ASSERT(!tls_session_key_log_file_path_.empty());
+ GPR_ASSERT(cache_ != nullptr);
+ fd_ = fopen(tls_session_key_log_file_path_.c_str(), "w+");
+ if (fd_ == nullptr) {
+ grpc_error_handle error = GRPC_OS_ERROR(errno, "fopen");
+ gpr_log(GPR_ERROR,
+ "Ignoring TLS Key logging. ERROR Opening TLS Keylog "
+ "file: %s",
+ grpc_error_std_string(error).c_str());
+ }
+ cache_->tls_session_key_logger_map_.emplace(tls_session_key_log_file_path_,
+ this);
+};
+
+TlsSessionKeyLoggerCache::TlsSessionKeyLogger::~TlsSessionKeyLogger() {
+ {
+ grpc_core::MutexLock lock(&lock_);
+ if (fd_ != nullptr) fclose(fd_);
+ }
+ {
+ grpc_core::MutexLock lock(g_tls_session_key_log_cache_mu);
+ auto it = cache_->tls_session_key_logger_map_.find(
+ tls_session_key_log_file_path_);
+ if (it != cache_->tls_session_key_logger_map_.end() && it->second == this) {
+ cache_->tls_session_key_logger_map_.erase(it);
+ }
+ }
+}
+
+void TlsSessionKeyLoggerCache::TlsSessionKeyLogger::LogSessionKeys(
+ SSL_CTX* /* ssl_context */, const std::string& session_keys_info) {
+ grpc_core::MutexLock lock(&lock_);
+ if (fd_ == nullptr || session_keys_info.empty()) return;
+ // Append to key log file under lock
+ bool err =
+ fwrite((session_keys_info + "\r\n").c_str(), sizeof(char),
+ session_keys_info.length() + 1, fd_) < session_keys_info.length();
+
+ if (err) {
+ grpc_error_handle error = GRPC_OS_ERROR(errno, "fwrite");
+ gpr_log(GPR_ERROR, "Error Appending to TLS session key log file: %s",
+ grpc_error_std_string(error).c_str());
+ fclose(fd_);
+ fd_ = nullptr; // disable future attempts to write to this file
+ } else {
+ fflush(fd_);
+ }
+}
+
+TlsSessionKeyLoggerCache::TlsSessionKeyLoggerCache()
+ ABSL_EXCLUSIVE_LOCKS_REQUIRED(g_tls_session_key_log_cache_mu) {
+ g_cache_instance = this;
+}
+
+TlsSessionKeyLoggerCache::~TlsSessionKeyLoggerCache() {
+ grpc_core::MutexLock lock(g_tls_session_key_log_cache_mu);
+ g_cache_instance = nullptr;
+}
+
+grpc_core::RefCountedPtr<TlsSessionKeyLogger> TlsSessionKeyLoggerCache::Get(
+ std::string tls_session_key_log_file_path) {
+ gpr_once_init(&g_cache_mutex_init, do_cache_mutex_init);
+ GPR_DEBUG_ASSERT(g_tls_session_key_log_cache_mu != nullptr);
+ if (tls_session_key_log_file_path.empty()) {
+ return nullptr;
+ }
+ {
+ grpc_core::MutexLock lock(g_tls_session_key_log_cache_mu);
+ grpc_core::RefCountedPtr<TlsSessionKeyLoggerCache> cache;
+ if (g_cache_instance == nullptr) {
+ // This will automatically set g_cache_instance.
+ cache = grpc_core::MakeRefCounted<TlsSessionKeyLoggerCache>();
+ } else {
+ cache = g_cache_instance->Ref();
+ }
+ // Check cache for entry.
+ auto it =
+ cache->tls_session_key_logger_map_.find(tls_session_key_log_file_path);
+ if (it != cache->tls_session_key_logger_map_.end()) {
+ // Avoid a race condition if the destructor of the tls key logger
+ // of interest is currently executing.
+ auto key_logger = it->second->RefIfNonZero();
+ if (key_logger != nullptr) return key_logger;
+ }
+ // Not found in cache, so create new entry.
+ // This will automatically add itself to tls_session_key_logger_map_.
+ return grpc_core::MakeRefCounted<TlsSessionKeyLogger>(
+ std::move(tls_session_key_log_file_path), std::move(cache));
+ }
+}
+
+}; // namespace tsi
diff --git a/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.h b/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.h
new file mode 100644
index 00000000..01781a76
--- /dev/null
+++ b/grpc/src/core/tsi/ssl/key_logging/ssl_key_logging.h
@@ -0,0 +1,81 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_TSI_SSL_KEY_LOGGING_SSL_KEY_LOGGING_H
+#define GRPC_CORE_TSI_SSL_KEY_LOGGING_SSL_KEY_LOGGING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <iostream>
+#include <map>
+
+#include <openssl/ssl.h>
+
+#include "absl/base/thread_annotations.h"
+
+#include <grpc/grpc_security.h>
+#include <grpc/slice.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace tsi {
+
+class TlsSessionKeyLoggerCache
+ : public grpc_core::RefCounted<TlsSessionKeyLoggerCache> {
+ public:
+ TlsSessionKeyLoggerCache();
+ ~TlsSessionKeyLoggerCache() override;
+
+ // A helper class which facilitates appending Tls session keys into a file.
+ // The instance is bound to a file meaning only one instance of this object
+ // can ever exist for a given file path.
+ class TlsSessionKeyLogger
+ : public grpc_core::RefCounted<TlsSessionKeyLogger> {
+ public:
+ // Instantiates a TlsSessionKeyLogger instance bound to a specific path.
+ TlsSessionKeyLogger(
+ std::string tls_session_key_log_file_path,
+ grpc_core::RefCountedPtr<TlsSessionKeyLoggerCache> cache);
+ ~TlsSessionKeyLogger() override;
+
+ // Not copyable nor assignable.
+ TlsSessionKeyLogger(const TlsSessionKeyLogger&) = delete;
+ TlsSessionKeyLogger& operator=(const TlsSessionKeyLogger&) = delete;
+ // Writes session keys into the file in the NSS key logging format.
+ // This is called upon completion of a handshake. The associated ssl_context
+ // is also provided here to support future extensions such as logging
+ // keys only when connections are made by certain IPs etc.
+ void LogSessionKeys(SSL_CTX* ssl_context,
+ const std::string& session_keys_info);
+
+ private:
+ grpc_core::Mutex lock_; // protects appends to file
+ FILE* fd_ ABSL_GUARDED_BY(lock_);
+ std::string tls_session_key_log_file_path_;
+ grpc_core::RefCountedPtr<TlsSessionKeyLoggerCache> cache_;
+ };
+ // Creates and returns a TlsSessionKeyLogger instance.
+ static grpc_core::RefCountedPtr<TlsSessionKeyLogger> Get(
+ std::string tls_session_key_log_file_path);
+
+ private:
+ std::map<std::string, TlsSessionKeyLogger*> tls_session_key_logger_map_;
+};
+
+} // namespace tsi
+
+#endif // GRPC_CORE_TSI_SSL_KEY_LOGGING_SSL_KEY_LOGGING_H
diff --git a/grpc/src/core/tsi/ssl/session_cache/ssl_session.h b/grpc/src/core/tsi/ssl/session_cache/ssl_session.h
index 108c0cd1..adf31aeb 100644
--- a/grpc/src/core/tsi/ssl/session_cache/ssl_session.h
+++ b/grpc/src/core/tsi/ssl/session_cache/ssl_session.h
@@ -21,11 +21,9 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
-
-extern "C" {
#include <openssl/ssl.h>
-}
+
+#include <grpc/slice.h>
#include "src/core/lib/gprpp/ref_counted.h"
diff --git a/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc b/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
index 9254dcee..5657fbc0 100644
--- a/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
+++ b/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
@@ -18,51 +18,29 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/tsi/ssl/session_cache/ssl_session.h"
#include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-namespace tsi {
-
-static void cache_key_avl_destroy(void* /*key*/, void* /*unused*/) {}
-
-static void* cache_key_avl_copy(void* key, void* /*unused*/) { return key; }
-
-static long cache_key_avl_compare(void* key1, void* key2, void* /*unused*/) {
- return grpc_slice_cmp(*static_cast<grpc_slice*>(key1),
- *static_cast<grpc_slice*>(key2));
-}
-
-static void cache_value_avl_destroy(void* /*value*/, void* /*unused*/) {}
-
-static void* cache_value_avl_copy(void* value, void* /*unused*/) {
- return value;
-}
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/tsi/ssl/session_cache/ssl_session.h"
-// AVL only stores pointers, ownership belonges to the linked list.
-static const grpc_avl_vtable cache_avl_vtable = {
- cache_key_avl_destroy, cache_key_avl_copy, cache_key_avl_compare,
- cache_value_avl_destroy, cache_value_avl_copy,
-};
+namespace tsi {
/// Node for single cached session.
class SslSessionLRUCache::Node {
public:
- Node(const grpc_slice& key, SslSessionPtr session) : key_(key) {
+ Node(const std::string& key, SslSessionPtr session) : key_(key) {
SetSession(std::move(session));
}
- ~Node() { grpc_slice_unref_internal(key_); }
-
// Not copyable nor movable.
Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
- void* AvlKey() { return &key_; }
+ const std::string& key() const { return key_; }
/// Returns a copy of the node's cache session.
SslSessionPtr CopySession() const { return session_->CopySession(); }
@@ -75,7 +53,7 @@ class SslSessionLRUCache::Node {
private:
friend class SslSessionLRUCache;
- grpc_slice key_;
+ std::string key_;
std::unique_ptr<SslCachedSession> session_;
Node* next_ = nullptr;
@@ -84,7 +62,6 @@ class SslSessionLRUCache::Node {
SslSessionLRUCache::SslSessionLRUCache(size_t capacity) : capacity_(capacity) {
GPR_ASSERT(capacity > 0);
- entry_by_key_ = grpc_avl_create(&cache_avl_vtable);
}
SslSessionLRUCache::~SslSessionLRUCache() {
@@ -94,7 +71,6 @@ SslSessionLRUCache::~SslSessionLRUCache() {
delete node;
node = next;
}
- grpc_avl_unref(entry_by_key_, nullptr);
}
size_t SslSessionLRUCache::Size() {
@@ -103,13 +79,12 @@ size_t SslSessionLRUCache::Size() {
}
SslSessionLRUCache::Node* SslSessionLRUCache::FindLocked(
- const grpc_slice& key) {
- void* value =
- grpc_avl_get(entry_by_key_, const_cast<grpc_slice*>(&key), nullptr);
- if (value == nullptr) {
+ const std::string& key) {
+ auto it = entry_by_key_.find(key);
+ if (it == entry_by_key_.end()) {
return nullptr;
}
- Node* node = static_cast<Node*>(value);
+ Node* node = it->second;
// Move to the beginning.
Remove(node);
PushFront(node);
@@ -119,22 +94,21 @@ SslSessionLRUCache::Node* SslSessionLRUCache::FindLocked(
void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
grpc_core::MutexLock lock(&lock_);
- Node* node = FindLocked(grpc_slice_from_static_string(key));
+ Node* node = FindLocked(key);
if (node != nullptr) {
node->SetSession(std::move(session));
return;
}
- grpc_slice key_slice = grpc_slice_from_copied_string(key);
- node = new Node(key_slice, std::move(session));
+ node = new Node(key, std::move(session));
PushFront(node);
- entry_by_key_ = grpc_avl_add(entry_by_key_, node->AvlKey(), node, nullptr);
+ entry_by_key_.emplace(key, node);
AssertInvariants();
if (use_order_list_size_ > capacity_) {
GPR_ASSERT(use_order_list_tail_);
node = use_order_list_tail_;
Remove(node);
// Order matters, key is destroyed after deleting node.
- entry_by_key_ = grpc_avl_remove(entry_by_key_, node->AvlKey(), nullptr);
+ entry_by_key_.erase(node->key());
delete node;
AssertInvariants();
}
@@ -143,8 +117,7 @@ void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
SslSessionPtr SslSessionLRUCache::Get(const char* key) {
grpc_core::MutexLock lock(&lock_);
// Key is only used for lookups.
- grpc_slice key_slice = grpc_slice_from_static_string(key);
- Node* node = FindLocked(key_slice);
+ Node* node = FindLocked(key);
if (node == nullptr) {
return nullptr;
}
@@ -182,13 +155,6 @@ void SslSessionLRUCache::PushFront(SslSessionLRUCache::Node* node) {
}
#ifndef NDEBUG
-static size_t calculate_tree_size(grpc_avl_node* node) {
- if (node == nullptr) {
- return 0;
- }
- return 1 + calculate_tree_size(node->left) + calculate_tree_size(node->right);
-}
-
void SslSessionLRUCache::AssertInvariants() {
size_t size = 0;
Node* prev = nullptr;
@@ -196,14 +162,15 @@ void SslSessionLRUCache::AssertInvariants() {
while (current != nullptr) {
size++;
GPR_ASSERT(current->prev_ == prev);
- void* node = grpc_avl_get(entry_by_key_, current->AvlKey(), nullptr);
- GPR_ASSERT(node == current);
+ auto it = entry_by_key_.find(current->key());
+ GPR_ASSERT(it != entry_by_key_.end());
+ GPR_ASSERT(it->second == current);
prev = current;
current = current->next_;
}
GPR_ASSERT(prev == use_order_list_tail_);
GPR_ASSERT(size == use_order_list_size_);
- GPR_ASSERT(calculate_tree_size(entry_by_key_.root) == use_order_list_size_);
+ GPR_ASSERT(entry_by_key_.size() == use_order_list_size_);
}
#else
void SslSessionLRUCache::AssertInvariants() {}
diff --git a/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
index 0aa3f169..12ff6469 100644
--- a/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
+++ b/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
@@ -21,14 +21,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
-#include <grpc/support/sync.h>
+#include <map>
-extern "C" {
#include <openssl/ssl.h>
-}
-#include "src/core/lib/avl/avl.h"
+#include <grpc/slice.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -72,7 +71,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
private:
class Node;
- Node* FindLocked(const grpc_slice& key);
+ Node* FindLocked(const std::string& key);
void Remove(Node* node);
void PushFront(Node* node);
void AssertInvariants();
@@ -83,7 +82,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
Node* use_order_list_head_ = nullptr;
Node* use_order_list_tail_ = nullptr;
size_t use_order_list_size_ = 0;
- grpc_avl entry_by_key_;
+ std::map<std::string, Node*> entry_by_key_;
};
} // namespace tsi
diff --git a/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc b/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
index f45205ce..60675d2d 100644
--- a/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
+++ b/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include "src/core/tsi/ssl/session_cache/ssl_session.h"
-
#include <grpc/support/log.h>
+#include "src/core/tsi/ssl/session_cache/ssl_session.h"
+
#ifndef OPENSSL_IS_BORINGSSL
// OpenSSL invalidates SSL_SESSION on SSL destruction making it pointless
diff --git a/grpc/src/core/tsi/ssl_transport_security.cc b/grpc/src/core/tsi/ssl_transport_security.cc
index 4241b6f6..15be218f 100644
--- a/grpc/src/core/tsi/ssl_transport_security.cc
+++ b/grpc/src/core/tsi/ssl_transport_security.cc
@@ -35,17 +35,6 @@
#include <string>
-#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 "absl/strings/match.h"
-#include "absl/strings/string_view.h"
-
-extern "C" {
#include <openssl/bio.h>
#include <openssl/crypto.h> /* For OPENSSL_free */
#include <openssl/engine.h>
@@ -54,9 +43,19 @@ extern "C" {
#include <openssl/tls1.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
-}
+
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.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 "src/core/lib/gpr/useful.h"
+#include "src/core/tsi/ssl/key_logging/ssl_key_logging.h"
#include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
#include "src/core/tsi/ssl_types.h"
#include "src/core/tsi/transport_security.h"
@@ -78,6 +77,8 @@ extern "C" {
SSL structure. This is what we would ultimately want though... */
#define TSI_SSL_MAX_PROTECTION_OVERHEAD 100
+using TlsSessionKeyLogger = tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger;
+
/* --- Structure definitions. ---*/
struct tsi_ssl_root_certs_store {
@@ -95,6 +96,7 @@ struct tsi_ssl_client_handshaker_factory {
unsigned char* alpn_protocol_list;
size_t alpn_protocol_list_length;
grpc_core::RefCountedPtr<tsi::SslSessionLRUCache> session_cache;
+ grpc_core::RefCountedPtr<TlsSessionKeyLogger> key_logger;
};
struct tsi_ssl_server_handshaker_factory {
@@ -107,6 +109,7 @@ struct tsi_ssl_server_handshaker_factory {
size_t ssl_context_count;
unsigned char* alpn_protocol_list;
size_t alpn_protocol_list_length;
+ grpc_core::RefCountedPtr<TlsSessionKeyLogger> key_logger;
};
struct tsi_ssl_handshaker {
@@ -323,6 +326,30 @@ static tsi_result peer_property_from_x509_common_name(
return result;
}
+/* Gets the subject of an X509 cert as a tsi_peer_property. */
+static tsi_result peer_property_from_x509_subject(X509* cert,
+ tsi_peer_property* property) {
+ X509_NAME* subject_name = X509_get_subject_name(cert);
+ if (subject_name == nullptr) {
+ gpr_log(GPR_INFO, "Could not get subject name from certificate.");
+ return TSI_NOT_FOUND;
+ }
+ BIO* bio = BIO_new(BIO_s_mem());
+ X509_NAME_print_ex(bio, subject_name, 0, XN_FLAG_RFC2253);
+ char* contents;
+ long len = BIO_get_mem_data(bio, &contents);
+ if (len < 0) {
+ gpr_log(GPR_ERROR, "Could not get subject entry from certificate.");
+ BIO_free(bio);
+ return TSI_INTERNAL_ERROR;
+ }
+ tsi_result result = tsi_construct_string_peer_property(
+ TSI_X509_SUBJECT_PEER_PROPERTY, contents, static_cast<size_t>(len),
+ property);
+ BIO_free(bio);
+ return result;
+}
+
/* Gets the X509 cert in PEM format as a tsi_peer_property. */
static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) {
BIO* bio = BIO_new(BIO_s_mem());
@@ -439,7 +466,7 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
tsi_result result;
GPR_ASSERT(subject_alt_name_count >= 0);
property_count = (include_certificate_type ? static_cast<size_t>(1) : 0) +
- 2 /* common name, certificate */ +
+ 3 /* subject, 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 =
@@ -465,6 +492,11 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
&peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
}
+
+ result = peer_property_from_x509_subject(
+ cert, &peer->properties[current_insert_index++]);
+ if (result != TSI_OK) break;
+
result = peer_property_from_x509_common_name(
cert, &peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
@@ -503,10 +535,10 @@ static void log_ssl_error_stack(void) {
/* Performs an SSL_read and handle errors. */
static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
size_t* unprotected_bytes_size) {
- int read_from_ssl;
GPR_ASSERT(*unprotected_bytes_size <= INT_MAX);
- read_from_ssl = SSL_read(ssl, unprotected_bytes,
- static_cast<int>(*unprotected_bytes_size));
+ ERR_clear_error();
+ int read_from_ssl = SSL_read(ssl, unprotected_bytes,
+ static_cast<int>(*unprotected_bytes_size));
if (read_from_ssl <= 0) {
read_from_ssl = SSL_get_error(ssl, read_from_ssl);
switch (read_from_ssl) {
@@ -536,10 +568,10 @@ static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
/* Performs an SSL_write and handle errors. */
static tsi_result do_ssl_write(SSL* ssl, unsigned char* unprotected_bytes,
size_t unprotected_bytes_size) {
- int ssl_write_result;
GPR_ASSERT(unprotected_bytes_size <= INT_MAX);
- ssl_write_result = SSL_write(ssl, unprotected_bytes,
- static_cast<int>(unprotected_bytes_size));
+ ERR_clear_error();
+ int ssl_write_result = SSL_write(ssl, unprotected_bytes,
+ static_cast<int>(unprotected_bytes_size));
if (ssl_write_result < 0) {
ssl_write_result = SSL_get_error(ssl, ssl_write_result);
if (ssl_write_result == SSL_ERROR_WANT_READ) {
@@ -1302,6 +1334,13 @@ static tsi_result ssl_handshaker_result_extract_peer(
return result;
}
+static tsi_result ssl_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL;
+ return TSI_OK;
+}
+
static tsi_result ssl_handshaker_result_create_frame_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_frame_protector** protector) {
@@ -1368,6 +1407,7 @@ static void ssl_handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable handshaker_result_vtable = {
ssl_handshaker_result_extract_peer,
+ ssl_handshaker_result_get_frame_protector_type,
nullptr, /* create_zero_copy_grpc_protector */
ssl_handshaker_result_create_frame_protector,
ssl_handshaker_result_get_unused_bytes,
@@ -1382,7 +1422,7 @@ static tsi_result ssl_handshaker_result_create(
return TSI_INVALID_ARGUMENT;
}
tsi_ssl_handshaker_result* result =
- static_cast<tsi_ssl_handshaker_result*>(gpr_zalloc(sizeof(*result)));
+ grpc_core::Zalloc<tsi_ssl_handshaker_result>();
result->base.vtable = &handshaker_result_vtable;
/* Transfer ownership of ssl and network_io to the handshaker result. */
result->ssl = handshaker->ssl;
@@ -1401,8 +1441,7 @@ static tsi_result ssl_handshaker_result_create(
static tsi_result ssl_handshaker_get_bytes_to_send_to_peer(
tsi_ssl_handshaker* impl, unsigned char* bytes, size_t* bytes_size) {
int bytes_read_from_ssl = 0;
- if (bytes == nullptr || bytes_size == nullptr || *bytes_size == 0 ||
- *bytes_size > INT_MAX) {
+ if (bytes == nullptr || bytes_size == nullptr || *bytes_size > INT_MAX) {
return TSI_INVALID_ARGUMENT;
}
GPR_ASSERT(*bytes_size <= INT_MAX);
@@ -1429,26 +1468,12 @@ static tsi_result ssl_handshaker_get_result(tsi_ssl_handshaker* impl) {
return impl->result;
}
-static tsi_result ssl_handshaker_process_bytes_from_peer(
- tsi_ssl_handshaker* impl, const unsigned char* bytes, size_t* bytes_size) {
- int bytes_written_into_ssl_size = 0;
- if (bytes == nullptr || bytes_size == nullptr || *bytes_size > INT_MAX) {
- return TSI_INVALID_ARGUMENT;
- }
- GPR_ASSERT(*bytes_size <= INT_MAX);
- bytes_written_into_ssl_size =
- BIO_write(impl->network_io, bytes, static_cast<int>(*bytes_size));
- if (bytes_written_into_ssl_size < 0) {
- gpr_log(GPR_ERROR, "Could not write to memory BIO.");
- impl->result = TSI_INTERNAL_ERROR;
- return impl->result;
- }
- *bytes_size = static_cast<size_t>(bytes_written_into_ssl_size);
-
+static tsi_result ssl_handshaker_do_handshake(tsi_ssl_handshaker* impl) {
if (ssl_handshaker_get_result(impl) != TSI_HANDSHAKE_IN_PROGRESS) {
impl->result = TSI_OK;
return impl->result;
} else {
+ ERR_clear_error();
/* Get ready to get some bytes from SSL. */
int ssl_result = SSL_do_handshake(impl->ssl);
ssl_result = SSL_get_error(impl->ssl, ssl_result);
@@ -1462,6 +1487,8 @@ static tsi_result ssl_handshaker_process_bytes_from_peer(
}
case SSL_ERROR_NONE:
return TSI_OK;
+ case SSL_ERROR_WANT_WRITE:
+ return TSI_DRAIN_BUFFER;
default: {
char err_str[256];
ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str));
@@ -1474,6 +1501,24 @@ static tsi_result ssl_handshaker_process_bytes_from_peer(
}
}
+static tsi_result ssl_handshaker_process_bytes_from_peer(
+ tsi_ssl_handshaker* impl, const unsigned char* bytes, size_t* bytes_size) {
+ int bytes_written_into_ssl_size = 0;
+ if (bytes == nullptr || bytes_size == nullptr || *bytes_size > INT_MAX) {
+ return TSI_INVALID_ARGUMENT;
+ }
+ GPR_ASSERT(*bytes_size <= INT_MAX);
+ bytes_written_into_ssl_size =
+ BIO_write(impl->network_io, bytes, static_cast<int>(*bytes_size));
+ if (bytes_written_into_ssl_size < 0) {
+ gpr_log(GPR_ERROR, "Could not write to memory BIO.");
+ impl->result = TSI_INTERNAL_ERROR;
+ return impl->result;
+ }
+ *bytes_size = static_cast<size_t>(bytes_written_into_ssl_size);
+ return ssl_handshaker_do_handshake(impl);
+}
+
static void ssl_handshaker_destroy(tsi_handshaker* self) {
tsi_ssl_handshaker* impl = reinterpret_cast<tsi_ssl_handshaker*>(self);
SSL_free(impl->ssl);
@@ -1513,6 +1558,30 @@ static tsi_result ssl_bytes_remaining(tsi_ssl_handshaker* impl,
return TSI_OK;
}
+// Write handshake data received from SSL to an unbound output buffer.
+// By doing that, we drain SSL bio buffer used to hold handshake data.
+// This API needs to be repeatedly called until all handshake data are
+// received from SSL.
+static tsi_result ssl_handshaker_write_output_buffer(tsi_handshaker* self,
+ size_t* bytes_written) {
+ tsi_ssl_handshaker* impl = reinterpret_cast<tsi_ssl_handshaker*>(self);
+ tsi_result status = TSI_OK;
+ int offset = *bytes_written;
+ do {
+ size_t to_send_size = impl->outgoing_bytes_buffer_size - offset;
+ status = ssl_handshaker_get_bytes_to_send_to_peer(
+ impl, impl->outgoing_bytes_buffer + offset, &to_send_size);
+ offset += to_send_size;
+ if (status == TSI_INCOMPLETE_DATA) {
+ impl->outgoing_bytes_buffer_size *= 2;
+ impl->outgoing_bytes_buffer = static_cast<unsigned char*>(gpr_realloc(
+ impl->outgoing_bytes_buffer, impl->outgoing_bytes_buffer_size));
+ }
+ } while (status == TSI_INCOMPLETE_DATA);
+ *bytes_written = offset;
+ return status;
+}
+
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,
@@ -1528,27 +1597,22 @@ static tsi_result ssl_handshaker_next(
tsi_ssl_handshaker* impl = reinterpret_cast<tsi_ssl_handshaker*>(self);
tsi_result status = TSI_OK;
size_t bytes_consumed = received_bytes_size;
+ size_t bytes_written = 0;
if (received_bytes_size > 0) {
status = ssl_handshaker_process_bytes_from_peer(impl, received_bytes,
&bytes_consumed);
- if (status != TSI_OK) return status;
+ while (status == TSI_DRAIN_BUFFER) {
+ status = ssl_handshaker_write_output_buffer(self, &bytes_written);
+ if (status != TSI_OK) return status;
+ status = ssl_handshaker_do_handshake(impl);
+ }
}
+ if (status != TSI_OK) return status;
/* Get bytes to send to the peer, if available. */
- size_t offset = 0;
- do {
- size_t to_send_size = impl->outgoing_bytes_buffer_size - offset;
- status = ssl_handshaker_get_bytes_to_send_to_peer(
- impl, impl->outgoing_bytes_buffer + offset, &to_send_size);
- offset += to_send_size;
- if (status == TSI_INCOMPLETE_DATA) {
- impl->outgoing_bytes_buffer_size *= 2;
- impl->outgoing_bytes_buffer = static_cast<unsigned char*>(gpr_realloc(
- impl->outgoing_bytes_buffer, impl->outgoing_bytes_buffer_size));
- }
- } while (status == TSI_INCOMPLETE_DATA);
+ status = ssl_handshaker_write_output_buffer(self, &bytes_written);
if (status != TSI_OK) return status;
*bytes_to_send = impl->outgoing_bytes_buffer;
- *bytes_to_send_size = offset;
+ *bytes_to_send_size = bytes_written;
/* If handshake completes, create tsi_handshaker_result. */
if (ssl_handshaker_get_result(impl) == TSI_HANDSHAKE_IN_PROGRESS) {
*handshaker_result = nullptr;
@@ -1605,6 +1669,8 @@ static void tsi_ssl_handshaker_resume_session(
static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
const char* server_name_indication,
+ size_t network_bio_buf_size,
+ size_t ssl_bio_buf_size,
tsi_ssl_handshaker_factory* factory,
tsi_handshaker** handshaker) {
SSL* ssl = SSL_new(ctx);
@@ -1621,7 +1687,8 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
}
SSL_set_info_callback(ssl, ssl_info_callback);
- if (!BIO_new_bio_pair(&network_io, 0, &ssl_io, 0)) {
+ if (!BIO_new_bio_pair(&network_io, network_bio_buf_size, &ssl_io,
+ ssl_bio_buf_size)) {
gpr_log(GPR_ERROR, "BIO_new_bio_pair failed.");
SSL_free(ssl);
return TSI_OUT_OF_RESOURCES;
@@ -1645,6 +1712,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
tsi_ssl_handshaker_resume_session(ssl,
client_factory->session_cache.get());
}
+ ERR_clear_error();
ssl_result = SSL_do_handshake(ssl);
ssl_result = SSL_get_error(ssl, ssl_result);
if (ssl_result != SSL_ERROR_WANT_READ) {
@@ -1659,7 +1727,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
SSL_set_accept_state(ssl);
}
- impl = static_cast<tsi_ssl_handshaker*>(gpr_zalloc(sizeof(*impl)));
+ impl = grpc_core::Zalloc<tsi_ssl_handshaker>();
impl->ssl = ssl;
impl->network_io = network_io;
impl->result = TSI_HANDSHAKE_IN_PROGRESS;
@@ -1705,10 +1773,11 @@ static int select_protocol_list(const unsigned char** out,
tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
tsi_ssl_client_handshaker_factory* factory,
- const char* server_name_indication, tsi_handshaker** handshaker) {
- return create_tsi_ssl_handshaker(factory->ssl_context, 1,
- server_name_indication, &factory->base,
- handshaker);
+ const char* server_name_indication, size_t network_bio_buf_size,
+ size_t ssl_bio_buf_size, tsi_handshaker** handshaker) {
+ return create_tsi_ssl_handshaker(
+ factory->ssl_context, 1, server_name_indication, network_bio_buf_size,
+ ssl_bio_buf_size, &factory->base, handshaker);
}
void tsi_ssl_client_handshaker_factory_unref(
@@ -1725,6 +1794,7 @@ static void tsi_ssl_client_handshaker_factory_destroy(
if (self->ssl_context != nullptr) SSL_CTX_free(self->ssl_context);
if (self->alpn_protocol_list != nullptr) gpr_free(self->alpn_protocol_list);
self->session_cache.reset();
+ self->key_logger.reset();
gpr_free(self);
}
@@ -1741,11 +1811,13 @@ static int client_handshaker_factory_npn_callback(
/* --- tsi_ssl_server_handshaker_factory methods implementation. --- */
tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
- tsi_ssl_server_handshaker_factory* factory, tsi_handshaker** handshaker) {
+ tsi_ssl_server_handshaker_factory* factory, size_t network_bio_buf_size,
+ size_t ssl_bio_buf_size, tsi_handshaker** handshaker) {
if (factory->ssl_context_count == 0) return TSI_INVALID_ARGUMENT;
/* Create the handshaker with the first context. We will switch if needed
because of SNI in ssl_server_handshaker_factory_servername_callback. */
return create_tsi_ssl_handshaker(factory->ssl_contexts[0], 0, nullptr,
+ network_bio_buf_size, ssl_bio_buf_size,
&factory->base, handshaker);
}
@@ -1772,6 +1844,7 @@ static void tsi_ssl_server_handshaker_factory_destroy(
gpr_free(self->ssl_context_x509_subject_names);
}
if (self->alpn_protocol_list != nullptr) gpr_free(self->alpn_protocol_list);
+ self->key_logger.reset();
gpr_free(self);
}
@@ -1884,6 +1957,33 @@ static int server_handshaker_factory_new_session_callback(
return 1;
}
+/// This callback is invoked at client or server when ssl/tls handshakes
+/// complete and keylogging is enabled.
+template <typename T>
+static void ssl_keylogging_callback(const SSL* ssl, const char* info) {
+ SSL_CTX* ssl_context = SSL_get_SSL_CTX(ssl);
+ GPR_ASSERT(ssl_context != nullptr);
+ void* arg = SSL_CTX_get_ex_data(ssl_context, g_ssl_ctx_ex_factory_index);
+ T* factory = static_cast<T*>(arg);
+ factory->key_logger->LogSessionKeys(ssl_context, info);
+}
+
+// This callback is invoked when the CRL has been verified and will soft-fail
+// errors in verification depending on certain error types.
+static int verify_cb(int ok, X509_STORE_CTX* ctx) {
+ int cert_error = X509_STORE_CTX_get_error(ctx);
+ if (cert_error == X509_V_ERR_UNABLE_TO_GET_CRL) {
+ gpr_log(
+ GPR_INFO,
+ "Certificate verification failed to get CRL files. Ignoring error.");
+ return 1;
+ }
+ if (cert_error != 0) {
+ gpr_log(GPR_ERROR, "Certificate verify failed with code %d", cert_error);
+ }
+ return ok;
+}
+
/* --- tsi_ssl_handshaker_factory constructors. --- */
static tsi_ssl_handshaker_factory_vtable client_handshaker_factory_vtable = {
@@ -1944,12 +2044,27 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
impl->session_cache =
reinterpret_cast<tsi::SslSessionLRUCache*>(options->session_cache)
->Ref();
- SSL_CTX_set_ex_data(ssl_context, g_ssl_ctx_ex_factory_index, impl);
SSL_CTX_sess_set_new_cb(ssl_context,
server_handshaker_factory_new_session_callback);
SSL_CTX_set_session_cache_mode(ssl_context, SSL_SESS_CACHE_CLIENT);
}
+#if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
+ if (options->key_logger != nullptr) {
+ impl->key_logger = options->key_logger->Ref();
+ // SSL_CTX_set_keylog_callback is set here to register callback
+ // when ssl/tls handshakes complete.
+ SSL_CTX_set_keylog_callback(
+ ssl_context,
+ ssl_keylogging_callback<tsi_ssl_client_handshaker_factory>);
+ }
+#endif
+
+ if (options->session_cache != nullptr || options->key_logger != nullptr) {
+ // Need to set factory at g_ssl_ctx_ex_factory_index
+ SSL_CTX_set_ex_data(ssl_context, g_ssl_ctx_ex_factory_index, impl);
+ }
+
do {
result = populate_ssl_context(ssl_context, options->pem_key_cert_pair,
options->cipher_suites);
@@ -2004,7 +2119,24 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
} else {
SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, nullptr);
}
- /* TODO(jboeuf): Add revocation verification. */
+
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ if (options->crl_directory != nullptr &&
+ strcmp(options->crl_directory, "") != 0) {
+ gpr_log(GPR_INFO, "enabling client CRL checking with path: %s",
+ options->crl_directory);
+ X509_STORE* cert_store = SSL_CTX_get_cert_store(ssl_context);
+ X509_STORE_set_verify_cb(cert_store, verify_cb);
+ if (!X509_STORE_load_locations(cert_store, nullptr,
+ options->crl_directory)) {
+ gpr_log(GPR_ERROR, "Failed to load CRL File from directory.");
+ } else {
+ X509_VERIFY_PARAM* param = X509_STORE_get0_param(cert_store);
+ X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
+ gpr_log(GPR_INFO, "enabled client side CRL checking.");
+ }
+ }
+#endif
*factory = impl;
return TSI_OK;
@@ -2086,6 +2218,10 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
}
}
+ if (options->key_logger != nullptr) {
+ impl->key_logger = options->key_logger->Ref();
+ }
+
for (i = 0; i < options->num_key_cert_pairs; i++) {
do {
#if OPENSSL_VERSION_NUMBER >= 0x10100000
@@ -2166,7 +2302,24 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
nullptr);
break;
}
- /* TODO(jboeuf): Add revocation verification. */
+
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ if (options->crl_directory != nullptr &&
+ strcmp(options->crl_directory, "") != 0) {
+ gpr_log(GPR_INFO, "enabling server CRL checking with path %s",
+ options->crl_directory);
+ X509_STORE* cert_store = SSL_CTX_get_cert_store(impl->ssl_contexts[i]);
+ X509_STORE_set_verify_cb(cert_store, verify_cb);
+ if (!X509_STORE_load_locations(cert_store, nullptr,
+ options->crl_directory)) {
+ gpr_log(GPR_ERROR, "Failed to load CRL File from directory.");
+ } else {
+ X509_VERIFY_PARAM* param = X509_STORE_get0_param(cert_store);
+ X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
+ gpr_log(GPR_INFO, "enabled server CRL checking.");
+ }
+ }
+#endif
result = tsi_ssl_extract_x509_subject_names_from_pem_cert(
options->pem_key_cert_pairs[i].cert_chain,
@@ -2184,6 +2337,20 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
SSL_CTX_set_next_protos_advertised_cb(
impl->ssl_contexts[i],
server_handshaker_factory_npn_advertised_callback, impl);
+
+#if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
+ /* Register factory at index */
+ if (options->key_logger != nullptr) {
+ // Need to set factory at g_ssl_ctx_ex_factory_index
+ SSL_CTX_set_ex_data(impl->ssl_contexts[i], g_ssl_ctx_ex_factory_index,
+ impl);
+ // SSL_CTX_set_keylog_callback is set here to register callback
+ // when ssl/tls handshakes complete.
+ SSL_CTX_set_keylog_callback(
+ impl->ssl_contexts[i],
+ ssl_keylogging_callback<tsi_ssl_server_handshaker_factory>);
+ }
+#endif
} while (false);
if (result != TSI_OK) {
diff --git a/grpc/src/core/tsi/ssl_transport_security.h b/grpc/src/core/tsi/ssl_transport_security.h
index c3d30a88..47d69917 100644
--- a/grpc/src/core/tsi/ssl_transport_security.h
+++ b/grpc/src/core/tsi/ssl_transport_security.h
@@ -21,18 +21,20 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security_constants.h>
+#include <openssl/x509.h>
+
#include "absl/strings/string_view.h"
-#include "src/core/tsi/transport_security_interface.h"
-extern "C" {
-#include <openssl/x509.h>
-}
+#include <grpc/grpc_security_constants.h>
+
+#include "src/core/tsi/ssl/key_logging/ssl_key_logging.h"
+#include "src/core/tsi/transport_security_interface.h"
/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. */
#define TSI_X509_CERTIFICATE_TYPE "X509"
/* This property is of type TSI_PEER_PROPERTY_STRING. */
+#define TSI_X509_SUBJECT_PEER_PROPERTY "x509_subject"
#define TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY "x509_subject_common_name"
#define TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY \
"x509_subject_alternative_name"
@@ -74,6 +76,19 @@ void tsi_ssl_session_cache_ref(tsi_ssl_session_cache* cache);
/* Decrement reference counter of \a cache. */
void tsi_ssl_session_cache_unref(tsi_ssl_session_cache* cache);
+/* --- tsi_ssl_key_logger object ---
+
+ Experimental SSL Key logging functionality to enable decryption of
+ packet captures. */
+static constexpr bool tsi_tls_session_key_logging_supported() {
+// Supported only for open-ssl versions >= 1.1.1
+#if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
+ return true;
+#else
+ return false;
+#endif
+}
+
/* --- tsi_ssl_client_handshaker_factory object ---
This object creates a client tsi_handshaker objects implemented in terms of
@@ -148,6 +163,8 @@ struct tsi_ssl_client_handshaker_options {
size_t num_alpn_protocols;
/* ssl_session_cache is a cache for reusable client-side sessions. */
tsi_ssl_session_cache* session_cache;
+ /* tsi_ssl_key_logger is an instance used to log SSL keys to a file. */
+ tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* key_logger;
/* skip server certificate verification. */
bool skip_server_certificate_verification;
@@ -156,6 +173,12 @@ struct tsi_ssl_client_handshaker_options {
tsi_tls_version min_tls_version;
tsi_tls_version max_tls_version;
+ /* The directory where all hashed CRL files enforced by the handshaker are
+ located. If the directory is invalid, CRL checking will fail open and just
+ log. An empty directory will not enable crl checking. Only OpenSSL version
+ > 1.1 is supported for CRL checking*/
+ const char* crl_directory;
+
tsi_ssl_client_handshaker_options()
: pem_key_cert_pair(nullptr),
pem_root_certs(nullptr),
@@ -164,9 +187,11 @@ struct tsi_ssl_client_handshaker_options {
alpn_protocols(nullptr),
num_alpn_protocols(0),
session_cache(nullptr),
+ key_logger(nullptr),
skip_server_certificate_verification(false),
min_tls_version(tsi_tls_version::TSI_TLS1_2),
- max_tls_version(tsi_tls_version::TSI_TLS1_3) {}
+ max_tls_version(tsi_tls_version::TSI_TLS1_3),
+ crl_directory(nullptr) {}
};
/* Creates a client handshaker factory.
@@ -184,13 +209,16 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
- server_name_indication indicates the name of the server the client is
trying to connect to which will be relayed to the server using the SNI
extension.
+ - network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in
+ SSL. The buffer size being 0 translates to 17KB in boringSSL.
- handshaker is the address of the handshaker pointer to be created.
- This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
where a parameter is invalid. */
tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(
tsi_ssl_client_handshaker_factory* factory,
- const char* server_name_indication, tsi_handshaker** handshaker);
+ const char* server_name_indication, size_t network_bio_buf_size,
+ size_t ssl_bio_buf_size, tsi_handshaker** handshaker);
/* Decrements reference count of the handshaker factory. Handshaker factory will
* be destroyed once no references exist. */
@@ -285,6 +313,14 @@ struct tsi_ssl_server_handshaker_options {
/* 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_key_logger is an instance used to log SSL keys to a file. */
+ tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* key_logger;
+
+ /* The directory where all hashed CRL files are cached in the x.509 store and
+ * enforced by the handshaker are located. If the directory is invalid, CRL
+ * checking will fail open and just log. An empty directory will not enable
+ * crl checking. Only OpenSSL version > 1.1 is supported for CRL checking */
+ const char* crl_directory;
tsi_ssl_server_handshaker_options()
: pem_key_cert_pairs(nullptr),
@@ -297,7 +333,9 @@ struct tsi_ssl_server_handshaker_options {
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) {}
+ max_tls_version(tsi_tls_version::TSI_TLS1_3),
+ key_logger(nullptr),
+ crl_directory(nullptr) {}
};
/* Creates a server handshaker factory.
@@ -312,12 +350,15 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
/* Creates a server handshaker.
- factory is the factory from which the handshaker will be created.
+ - network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in
+ SSL. The buffer size being 0 translates to 17KB in boringSSL.
- handshaker is the address of the handshaker pointer to be created.
- This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case
where a parameter is invalid. */
tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(
- tsi_ssl_server_handshaker_factory* factory, tsi_handshaker** handshaker);
+ tsi_ssl_server_handshaker_factory* factory, size_t network_bio_buf_size,
+ size_t ssl_bio_buf_size, tsi_handshaker** handshaker);
/* Decrements reference count of the handshaker factory. Handshaker factory will
* be destroyed once no references exist. */
diff --git a/grpc/src/core/tsi/test_creds/BUILD b/grpc/src/core/tsi/test_creds/BUILD
index 94bb5d4b..1ff24718 100644
--- a/grpc/src/core/tsi/test_creds/BUILD
+++ b/grpc/src/core/tsi/test_creds/BUILD
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
+licenses(["notice"])
exports_files([
"ca.pem",
diff --git a/grpc/src/core/tsi/transport_security.cc b/grpc/src/core/tsi/transport_security.cc
index dd621896..5d822604 100644
--- a/grpc/src/core/tsi/transport_security.cc
+++ b/grpc/src/core/tsi/transport_security.cc
@@ -20,12 +20,12 @@
#include "src/core/tsi/transport_security.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-
#include <stdlib.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
/* --- Tracing. --- */
grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi");
@@ -251,6 +251,18 @@ tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
return self->vtable->extract_peer(self, peer);
}
+tsi_result tsi_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type) {
+ if (self == nullptr || frame_protector_type == nullptr) {
+ return TSI_INVALID_ARGUMENT;
+ }
+ if (self->vtable->get_frame_protector_type == nullptr) {
+ return TSI_UNIMPLEMENTED;
+ }
+ return self->vtable->get_frame_protector_type(self, frame_protector_type);
+}
+
tsi_result tsi_handshaker_result_create_frame_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_frame_protector** protector) {
diff --git a/grpc/src/core/tsi/transport_security.h b/grpc/src/core/tsi/transport_security.h
index d3b1c7f4..53f85d28 100644
--- a/grpc/src/core/tsi/transport_security.h
+++ b/grpc/src/core/tsi/transport_security.h
@@ -29,7 +29,8 @@
extern grpc_core::TraceFlag tsi_tracing_enabled;
/* Base for tsi_frame_protector implementations.
- See transport_security_interface.h for documentation. */
+ See transport_security_interface.h for documentation.
+ All methods must be implemented. */
struct tsi_frame_protector_vtable {
tsi_result (*protect)(tsi_frame_protector* self,
const unsigned char* unprotected_bytes,
@@ -54,6 +55,9 @@ struct tsi_frame_protector {
/* Base for tsi_handshaker implementations.
See transport_security_interface.h for documentation. */
struct tsi_handshaker_vtable {
+ /* Methods for supporting the old synchronous API.
+ These can be null if the TSI impl supports only the new
+ async-capable API. */
tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker* self,
unsigned char* bytes,
size_t* bytes_size);
@@ -65,7 +69,10 @@ struct tsi_handshaker_vtable {
tsi_result (*create_frame_protector)(tsi_handshaker* self,
size_t* max_protected_frame_size,
tsi_frame_protector** protector);
+ /* Must be implemented by all TSI impls. */
void (*destroy)(tsi_handshaker* self);
+ /* Methods for supporting the new async-capable API.
+ These can be null if the TSI impl supports only the old sync API. */
tsi_result (*next)(tsi_handshaker* self, const unsigned char* received_bytes,
size_t received_bytes_size,
const unsigned char** bytes_to_send,
@@ -88,13 +95,21 @@ struct tsi_handshaker {
API depend on grpc. The create_zero_copy_grpc_protector() method is only used
in grpc, where we do need the exec_ctx passed through, but the API still
needs to compile in other applications, where grpc_exec_ctx is not defined.
+ All methods must be non-null, except where noted below.
*/
struct tsi_handshaker_result_vtable {
tsi_result (*extract_peer)(const tsi_handshaker_result* self, tsi_peer* peer);
+ tsi_result (*get_frame_protector_type)(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type);
+ /* May be null if get_frame_protector_type() returns
+ TSI_FRAME_PROTECTOR_NORMAL or TSI_FRAME_PROTECTOR_NONE. */
tsi_result (*create_zero_copy_grpc_protector)(
const tsi_handshaker_result* self,
size_t* max_output_protected_frame_size,
tsi_zero_copy_grpc_protector** protector);
+ /* May be null if get_frame_protector_type() returns
+ TSI_FRAME_PROTECTOR_ZERO_COPY or TSI_FRAME_PROTECTOR_NONE. */
tsi_result (*create_frame_protector)(const tsi_handshaker_result* self,
size_t* max_output_protected_frame_size,
tsi_frame_protector** protector);
diff --git a/grpc/src/core/tsi/transport_security_grpc.h b/grpc/src/core/tsi/transport_security_grpc.h
index 4779b686..ba9428b5 100644
--- a/grpc/src/core/tsi/transport_security_grpc.h
+++ b/grpc/src/core/tsi/transport_security_grpc.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/tsi/transport_security.h"
/* This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK
diff --git a/grpc/src/core/tsi/transport_security_interface.h b/grpc/src/core/tsi/transport_security_interface.h
index 50beccac..65f5453d 100644
--- a/grpc/src/core/tsi/transport_security_interface.h
+++ b/grpc/src/core/tsi/transport_security_interface.h
@@ -45,6 +45,8 @@ typedef enum {
TSI_ASYNC = 13,
TSI_HANDSHAKE_SHUTDOWN = 14,
TSI_CLOSE_NOTIFY = 15, // Indicates that the connection should be closed.
+ TSI_DRAIN_BUFFER = 16, // Indicates that the buffer used to store handshake
+ // data should be drained.
} tsi_result;
typedef enum {
@@ -65,6 +67,26 @@ typedef enum {
} tsi_client_certificate_request_type;
typedef enum {
+ // TSI implementation provides a normal frame protector. The caller
+ // should invoke tsi_handshaker_result_create_frame_protector() to
+ // generate the frame protector.
+ TSI_FRAME_PROTECTOR_NORMAL,
+ // TSI implementation provides a zero-copy frame protector. The caller
+ // should invoke tsi_handshaker_result_create_zero_copy_grpc_protector()
+ // to generate the frame protector.
+ TSI_FRAME_PROTECTOR_ZERO_COPY,
+ // TSI implementation provides both normal and zero-copy frame protectors.
+ // The caller should invoke either
+ // tsi_handshaker_result_create_frame_protector() or
+ // tsi_handshaker_result_create_zero_copy_grpc_protector() to generate
+ // the frame protector.
+ TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY,
+ // TSI implementation does not provide any frame protector. This means
+ // that it is safe for the caller to send bytes unprotected on the wire.
+ TSI_FRAME_PROTECTOR_NONE,
+} tsi_frame_protector_type;
+
+typedef enum {
TSI_TLS1_2,
TSI_TLS1_3,
} tsi_tls_version;
@@ -234,6 +256,12 @@ typedef struct tsi_handshaker_result tsi_handshaker_result;
tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
tsi_peer* peer);
+/* This method indicates what type of frame protector is provided by the
+ TSI implementation. */
+tsi_result tsi_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type);
+
/* This method creates a tsi_frame_protector object. It returns TSI_OK assuming
there is no fatal error.
The caller is responsible for destroying the protector. */
diff --git a/grpc/src/cpp/Protobuf-C++.podspec b/grpc/src/cpp/Protobuf-C++.podspec
deleted file mode 100644
index 7b239a6b..00000000
--- a/grpc/src/cpp/Protobuf-C++.podspec
+++ /dev/null
@@ -1,42 +0,0 @@
-Pod::Spec.new do |s|
- s.name = 'Protobuf-C++'
- s.version = '3.15.8'
- s.summary = 'Protocol Buffers v3 runtime library for C++.'
- s.homepage = 'https://github.com/google/protobuf'
- s.license = '3-Clause BSD License'
- s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
- s.cocoapods_version = '>= 1.0'
-
- s.source = { :git => 'https://github.com/google/protobuf.git',
- :tag => "v#{s.version}" }
-
- s.source_files = 'src/google/protobuf/*.{h,cc,inc}',
- 'src/google/protobuf/stubs/*.{h,cc}',
- 'src/google/protobuf/io/*.{h,cc}',
- 'src/google/protobuf/util/*.{h,cc}',
- 'src/google/protobuf/util/internal/*.{h,cc}'
-
- # Excluding all the tests in the directories above
- s.exclude_files = 'src/google/**/*_test.{h,cc,inc}',
- 'src/google/**/*_unittest.{h,cc}',
- 'src/google/protobuf/test_util*.{h,cc}',
- 'src/google/protobuf/map_lite_test_util.{h,cc}',
- 'src/google/protobuf/map_test_util*.{h,cc,inc}'
-
- s.header_mappings_dir = 'src'
-
- s.ios.deployment_target = '9.0'
- s.osx.deployment_target = '10.10'
- s.tvos.deployment_target = '9.0'
- s.watchos.deployment_target = '2.0'
-
- s.pod_target_xcconfig = {
- # Do not let src/google/protobuf/stubs/time.h override system API
- 'USE_HEADERMAP' => 'NO',
- 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
-
- # Configure tool is not being used for Xcode. When building, assume pthread is supported.
- 'GCC_PREPROCESSOR_DEFINITIONS' => '"$(inherited)" "HAVE_PTHREAD=1"',
- }
-
-end
diff --git a/grpc/src/cpp/README.md b/grpc/src/cpp/README.md
index 134f4db5..6329a8dc 100755
--- a/grpc/src/cpp/README.md
+++ b/grpc/src/cpp/README.md
@@ -9,6 +9,39 @@ 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.
+## Supported Platforms
+
+* Officially Supported: These platforms are officially supported. We test our
+ code on these platform and have automated continuous integration tests for
+ them.
+
+* Best Effort: We do not have continous integration tests for these, but we are
+ fairly confident that gRPC C++ would work on them. We will make our best
+ effort to support them, and we welcome patches for such platforms, but we
+ might need to declare bankruptcy on some issues.
+
+* Community Supported: These platforms are supported by contributions from the
+ open source community, there is no official support for them. Breakages on
+ these platforms may go unnoticed, and the community is responsible for all
+ maintenance. Unmaintained code for these platforms may be deleted.
+
+| Operating System | Architectures | Versions | Support Level |
+|------------------|---------------|----------|---------------|
+| Linux - Debian, Ubuntu, CentOS | x86, x64 | clang 4+, GCC 5.1+ | Officially Supported |
+| Windows 10+ | x86, x64 | Visual Studio 2015+ | Officially Supported |
+| MacOS | x86, x64 | XCode 7.2+ | Officially Supported |
+| Linux - Others | x86, x64 | clang 4+, GCC 5.1+ | Best Effort |
+| Linux | ARM | | Best Effort |
+| iOS | | | Best Effort |
+| Android | | | Best Effort |
+| Asylo | | | Best Effort |
+| FreeBSD | | | Community Supported |
+| OpenBSD | | | Community Supported |
+| AIX | | | Community Supported |
+| Solaris | | | Community Supported |
+| NaCL | | | Community Supported |
+| Fuchsia | | | Community Supported |
+
## Bazel
Bazel is the primary build system used by the core gRPC development team. Bazel
@@ -122,6 +155,13 @@ 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)
+**Note for CentOS 7 users**
+
+CentOS-7 ships with `pkg-config` 0.27.1, which has a
+[bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make
+invocations take extremely long to complete. If you plan to use `pkg-config`,
+you'll want to upgrade it to something newer.
+
## make (deprecated)
The default choice for building on UNIX based systems used to be `make`, but we are no longer recommending it.
@@ -147,11 +187,16 @@ gRPC is available using the [vcpkg](https://github.com/Microsoft/vcpkg) dependen
# install vcpkg package manager on your system using the official instructions
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
+
+# Bootstrap on Linux:
./bootstrap-vcpkg.sh
+# Bootstrap on Windows instead:
+# ./bootstrap-vcpkg.bat
+
./vcpkg integrate install
# install gRPC using vcpkg package manager
-vcpkg install grpc
+./vcpkg install grpc
```
The gRPC port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
diff --git a/grpc/src/cpp/client/channel_cc.cc b/grpc/src/cpp/client/channel_cc.cc
index a9f20839..e4aa072d 100644
--- a/grpc/src/cpp/client/channel_cc.cc
+++ b/grpc/src/cpp/client/channel_cc.cc
@@ -16,8 +16,6 @@
*
*/
-#include <grpcpp/channel.h>
-
#include <cstring>
#include <memory>
@@ -27,6 +25,7 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>
@@ -45,11 +44,12 @@
namespace grpc {
-static ::grpc::internal::GrpcLibraryInitializer g_gli_initializer;
-Channel::Channel(const std::string& host, grpc_channel* channel,
- std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
- interceptor_creators)
+static grpc::internal::GrpcLibraryInitializer g_gli_initializer;
+Channel::Channel(
+ const std::string& host, grpc_channel* channel,
+ std::vector<
+ std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
+ interceptor_creators)
: host_(host), c_channel_(channel) {
interceptor_creators_ = std::move(interceptor_creators);
g_gli_initializer.summon();
@@ -109,9 +109,9 @@ void ChannelResetConnectionBackoff(Channel* channel) {
} // namespace experimental
-::grpc::internal::Call Channel::CreateCallInternal(
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
- ::grpc::CompletionQueue* cq, size_t interceptor_pos) {
+grpc::internal::Call Channel::CreateCallInternal(
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
+ grpc::CompletionQueue* cq, size_t interceptor_pos) {
const bool kRegistered = method.channel_tag() && context->authority().empty();
grpc_call* c_call = nullptr;
if (kRegistered) {
@@ -130,7 +130,7 @@ void ChannelResetConnectionBackoff(Channel* channel) {
SliceFromArray(method.name(), strlen(method.name()));
grpc_slice host_slice;
if (host_str != nullptr) {
- host_slice = ::grpc::SliceFromCopiedString(*host_str);
+ host_slice = grpc::SliceFromCopiedString(*host_str);
}
c_call = grpc_channel_create_call(
c_channel_, context->propagate_from_call_,
@@ -152,17 +152,17 @@ void ChannelResetConnectionBackoff(Channel* channel) {
interceptor_creators_, interceptor_pos);
context->set_call(c_call, shared_from_this());
- return ::grpc::internal::Call(c_call, this, cq, info);
+ return grpc::internal::Call(c_call, this, cq, info);
}
-::grpc::internal::Call Channel::CreateCall(
- const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context,
+grpc::internal::Call Channel::CreateCall(
+ const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
CompletionQueue* cq) {
return CreateCallInternal(method, context, cq, 0);
}
-void Channel::PerformOpsOnCall(::grpc::internal::CallOpSetInterface* ops,
- ::grpc::internal::Call* call) {
+void Channel::PerformOpsOnCall(grpc::internal::CallOpSetInterface* ops,
+ grpc::internal::Call* call) {
ops->FillOps(
call); // Make a copy of call. It's fine since Call just has pointers
}
@@ -178,7 +178,7 @@ grpc_connectivity_state Channel::GetState(bool try_to_connect) {
namespace {
-class TagSaver final : public ::grpc::internal::CompletionQueueTag {
+class TagSaver final : public grpc::internal::CompletionQueueTag {
public:
explicit TagSaver(void* tag) : tag_(tag) {}
~TagSaver() override {}
@@ -196,7 +196,7 @@ class TagSaver final : public ::grpc::internal::CompletionQueueTag {
void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
- ::grpc::CompletionQueue* cq, void* tag) {
+ grpc::CompletionQueue* cq, void* tag) {
TagSaver* tag_saver = new TagSaver(tag);
grpc_channel_watch_connectivity_state(c_channel_, last_observed, deadline,
cq->cq(), tag_saver);
@@ -204,7 +204,7 @@ void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) {
- ::grpc::CompletionQueue cq;
+ grpc::CompletionQueue cq;
bool ok = false;
void* tag = nullptr;
NotifyOnStateChangeImpl(last_observed, deadline, &cq, nullptr);
@@ -214,7 +214,7 @@ bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
}
namespace {
-class ShutdownCallback : public grpc_experimental_completion_queue_functor {
+class ShutdownCallback : public grpc_completion_queue_functor {
public:
ShutdownCallback() {
functor_run = &ShutdownCallback::Run;
@@ -226,18 +226,18 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
}
// TakeCQ takes ownership of the cq into the shutdown callback
// so that the shutdown callback will be responsible for destroying it
- void TakeCQ(::grpc::CompletionQueue* cq) { cq_ = cq; }
+ void TakeCQ(grpc::CompletionQueue* cq) { cq_ = cq; }
// The Run function will get invoked by the completion queue library
// when the shutdown is actually complete
- static void Run(grpc_experimental_completion_queue_functor* cb, int) {
+ static void Run(grpc_completion_queue_functor* cb, int) {
auto* callback = static_cast<ShutdownCallback*>(cb);
delete callback->cq_;
delete callback;
}
private:
- ::grpc::CompletionQueue* cq_ = nullptr;
+ grpc::CompletionQueue* cq_ = nullptr;
};
} // namespace
@@ -257,10 +257,9 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
// gRPC-core provides the backing needed for the preferred CQ type
auto* shutdown_callback = new ShutdownCallback;
- callback_cq =
- new ::grpc::CompletionQueue(grpc_completion_queue_attributes{
- GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK,
- GRPC_CQ_DEFAULT_POLLING, shutdown_callback});
+ 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);
diff --git a/grpc/src/cpp/client/channel_test_peer.cc b/grpc/src/cpp/client/channel_test_peer.cc
index f921352a..e55f5224 100644
--- a/grpc/src/cpp/client/channel_test_peer.cc
+++ b/grpc/src/cpp/client/channel_test_peer.cc
@@ -16,10 +16,9 @@
*
*/
-#include <grpcpp/test/channel_test_peer.h>
-
#include <grpc/support/sync.h>
#include <grpcpp/channel.h>
+#include <grpcpp/test/channel_test_peer.h>
#include "src/core/lib/surface/channel.h"
diff --git a/grpc/src/cpp/client/client_callback.cc b/grpc/src/cpp/client/client_callback.cc
index a10e1b57..9e4ebbb3 100644
--- a/grpc/src/cpp/client/client_callback.cc
+++ b/grpc/src/cpp/client/client_callback.cc
@@ -20,6 +20,7 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/surface/call.h"
namespace grpc {
namespace internal {
@@ -48,5 +49,9 @@ void ClientReactor::InternalScheduleOnDone(grpc::Status s) {
grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
}
+bool ClientReactor::InternalTrailersOnly(const grpc_call* call) const {
+ return grpc_call_is_trailers_only(call);
+}
+
} // namespace internal
} // namespace grpc
diff --git a/grpc/src/cpp/client/client_context.cc b/grpc/src/cpp/client/client_context.cc
index 386b731c..72e6653f 100644
--- a/grpc/src/cpp/client/client_context.cc
+++ b/grpc/src/cpp/client/client_context.cc
@@ -16,14 +16,12 @@
*
*/
-#include <grpcpp/client_context.h>
-
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-
+#include <grpcpp/client_context.h>
#include <grpcpp/impl/codegen/interceptor_common.h>
#include <grpcpp/impl/codegen/sync.h>
#include <grpcpp/impl/grpc_library.h>
@@ -53,8 +51,6 @@ ClientContext::ClientContext()
: initial_metadata_received_(false),
wait_for_ready_(false),
wait_for_ready_explicitly_set_(false),
- idempotent_(false),
- cacheable_(false),
call_(nullptr),
call_canceled_(false),
deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)),
@@ -98,7 +94,7 @@ std::unique_ptr<ClientContext> ClientContext::FromInternalServerContext(
}
std::unique_ptr<ClientContext> ClientContext::FromServerContext(
- const grpc::ServerContext& server_context, PropagationOptions options) {
+ const grpc::ServerContextBase& server_context, PropagationOptions options) {
return FromInternalServerContext(server_context, options);
}
diff --git a/grpc/src/cpp/client/create_channel_internal.cc b/grpc/src/cpp/client/create_channel_internal.cc
index 71398bd0..3523d503 100644
--- a/grpc/src/cpp/client/create_channel_internal.cc
+++ b/grpc/src/cpp/client/create_channel_internal.cc
@@ -16,7 +16,12 @@
*
*/
+#include "src/cpp/client/create_channel_internal.h"
+
#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
#include <grpcpp/channel.h>
@@ -26,8 +31,8 @@ namespace grpc {
std::shared_ptr<Channel> CreateChannelInternal(
const std::string& host, grpc_channel* c_channel,
- std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ std::vector<
+ std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
return std::shared_ptr<Channel>(
new Channel(host, c_channel, std::move(interceptor_creators)));
diff --git a/grpc/src/cpp/client/create_channel_internal.h b/grpc/src/cpp/client/create_channel_internal.h
index 82b69790..997b3769 100644
--- a/grpc/src/cpp/client/create_channel_internal.h
+++ b/grpc/src/cpp/client/create_channel_internal.h
@@ -20,6 +20,8 @@
#define GRPC_INTERNAL_CPP_CLIENT_CREATE_CHANNEL_INTERNAL_H
#include <memory>
+#include <string>
+#include <vector>
#include <grpcpp/channel.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
@@ -31,8 +33,8 @@ namespace grpc {
std::shared_ptr<Channel> CreateChannelInternal(
const std::string& host, grpc_channel* c_channel,
- std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ std::vector<
+ std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
} // namespace grpc
diff --git a/grpc/src/cpp/client/create_channel_posix.cc b/grpc/src/cpp/client/create_channel_posix.cc
index a89df0a3..87a28054 100644
--- a/grpc/src/cpp/client/create_channel_posix.cc
+++ b/grpc/src/cpp/client/create_channel_posix.cc
@@ -18,8 +18,10 @@
#include <grpc/grpc.h>
#include <grpc/grpc_posix.h>
+#include <grpc/grpc_security.h>
#include <grpcpp/channel.h>
#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/security/credentials.h>
#include <grpcpp/support/channel_arguments.h>
#include "src/cpp/client/create_channel_internal.h"
@@ -34,10 +36,13 @@ std::shared_ptr<Channel> CreateInsecureChannelFromFd(const std::string& target,
int fd) {
grpc::internal::GrpcLibrary init_lib;
init_lib.init();
- return CreateChannelInternal(
- "", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr),
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ auto channel = CreateChannelInternal(
+ "", grpc_channel_create_from_fd(target.c_str(), fd, creds, nullptr),
std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+ grpc_channel_credentials_release(creds);
+ return channel;
}
std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
@@ -46,11 +51,13 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return CreateChannelInternal(
- "",
- grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ auto channel = CreateChannelInternal(
+ "", grpc_channel_create_from_fd(target.c_str(), fd, creds, &channel_args),
std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+ grpc_channel_credentials_release(creds);
+ return channel;
}
namespace experimental {
@@ -64,10 +71,12 @@ std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return CreateChannelInternal(
- "",
- grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ auto channel = CreateChannelInternal(
+ "", grpc_channel_create_from_fd(target.c_str(), fd, creds, &channel_args),
std::move(interceptor_creators));
+ grpc_channel_credentials_release(creds);
+ return channel;
}
} // namespace experimental
diff --git a/grpc/src/cpp/client/cronet_credentials.cc b/grpc/src/cpp/client/cronet_credentials.cc
index d09e2841..4ef81139 100644
--- a/grpc/src/cpp/client/cronet_credentials.cc
+++ b/grpc/src/cpp/client/cronet_credentials.cc
@@ -16,11 +16,11 @@
*
*/
-#include <grpcpp/security/credentials.h>
-
#include <grpc/grpc_cronet.h>
#include <grpcpp/channel.h>
+#include <grpcpp/security/credentials.h>
#include <grpcpp/support/channel_arguments.h>
+
#include "src/cpp/client/create_channel_internal.h"
namespace grpc {
diff --git a/grpc/src/cpp/client/insecure_credentials.cc b/grpc/src/cpp/client/insecure_credentials.cc
index 98e8cb75..b7727436 100644
--- a/grpc/src/cpp/client/insecure_credentials.cc
+++ b/grpc/src/cpp/client/insecure_credentials.cc
@@ -15,13 +15,14 @@
* limitations under the License.
*
*/
-#include <grpcpp/security/credentials.h>
-
#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
#include <grpcpp/channel.h>
+#include <grpcpp/security/credentials.h>
#include <grpcpp/support/channel_arguments.h>
#include <grpcpp/support/config.h>
+
#include "src/cpp/client/create_channel_internal.h"
namespace grpc {
@@ -44,10 +45,12 @@ class InsecureChannelCredentialsImpl final : public ChannelCredentials {
interceptor_creators) override {
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return ::grpc::CreateChannelInternal(
- "",
- grpc_insecure_channel_create(target.c_str(), &channel_args, nullptr),
+ grpc_channel_credentials* creds = grpc_insecure_credentials_create();
+ std::shared_ptr<Channel> channel = grpc::CreateChannelInternal(
+ "", grpc_channel_create(target.c_str(), creds, &channel_args),
std::move(interceptor_creators));
+ grpc_channel_credentials_release(creds);
+ return channel;
}
SecureChannelCredentials* AsSecureCredentials() override { return nullptr; }
diff --git a/grpc/src/cpp/client/secure_credentials.cc b/grpc/src/cpp/client/secure_credentials.cc
index be99d542..d3351e34 100644
--- a/grpc/src/cpp/client/secure_credentials.cc
+++ b/grpc/src/cpp/client/secure_credentials.cc
@@ -18,6 +18,8 @@
#include "src/cpp/client/secure_credentials.h"
+#include "absl/strings/str_join.h"
+
#include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
@@ -28,8 +30,6 @@
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/channel_arguments.h>
-#include "absl/strings/str_join.h"
-
// TODO(yashykt): We shouldn't be including "src/core" headers.
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/error.h"
@@ -66,10 +66,9 @@ SecureChannelCredentials::CreateChannelWithInterceptors(
interceptor_creators) {
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
- return ::grpc::CreateChannelInternal(
+ return grpc::CreateChannelInternal(
args.GetSslTargetNameOverride(),
- grpc_secure_channel_create(c_creds_, target.c_str(), &channel_args,
- nullptr),
+ grpc_channel_create(target.c_str(), c_creds_, &channel_args),
std::move(interceptor_creators));
}
@@ -217,6 +216,7 @@ grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions* options) {
char* sts_creds_path = gpr_getenv("STS_CREDENTIALS");
grpc_error_handle error = GRPC_ERROR_NONE;
grpc::Status status;
+ // NOLINTNEXTLINE(clang-diagnostic-unused-lambda-capture)
auto cleanup = [&json_string, &sts_creds_path, &error, &status]() {
grpc_slice_unref_internal(json_string);
gpr_free(sts_creds_path);
@@ -492,7 +492,6 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
grpc_metadata md_entry;
md_entry.key = SliceFromCopiedString(metadatum.first);
md_entry.value = SliceFromCopiedString(metadatum.second);
- md_entry.flags = 0;
md.push_back(md_entry);
}
if (creds_md != nullptr) {
@@ -507,7 +506,6 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
for (const auto& elem : md) {
creds_md[*num_creds_md].key = elem.key;
creds_md[*num_creds_md].value = elem.value;
- creds_md[*num_creds_md].flags = elem.flags;
++(*num_creds_md);
}
*status_code = static_cast<grpc_status_code>(status.error_code());
@@ -525,6 +523,10 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin)
- : thread_pool_(CreateDefaultThreadPool()), plugin_(std::move(plugin)) {}
+ : plugin_(std::move(plugin)) {
+ if (plugin_->IsBlocking()) {
+ thread_pool_.reset(CreateDefaultThreadPool());
+ }
+}
} // namespace grpc
diff --git a/grpc/src/cpp/client/secure_credentials.h b/grpc/src/cpp/client/secure_credentials.h
index 318c402b..992e2237 100644
--- a/grpc/src/cpp/client/secure_credentials.h
+++ b/grpc/src/cpp/client/secure_credentials.h
@@ -19,13 +19,12 @@
#ifndef GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H
#define GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H
-#include <grpc/grpc_security.h>
+#include "absl/strings/str_cat.h"
+#include <grpc/grpc_security.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/security/tls_credentials_options.h>
#include <grpcpp/support/config.h>
-
-#include "absl/strings/str_cat.h"
// TODO(yashykt): We shouldn't be including "src/core" headers.
#include "src/core/lib/security/credentials/credentials.h"
#include "src/cpp/server/thread_pool_interface.h"
@@ -38,6 +37,7 @@ class SecureChannelCredentials final : public ChannelCredentials {
public:
explicit SecureChannelCredentials(grpc_channel_credentials* c_creds);
~SecureChannelCredentials() override {
+ grpc_core::ExecCtx exec_ctx;
if (c_creds_ != nullptr) c_creds_->Unref();
}
grpc_channel_credentials* GetRawCreds() { return c_creds_; }
@@ -51,7 +51,7 @@ class SecureChannelCredentials final : public ChannelCredentials {
std::shared_ptr<Channel> CreateChannelWithInterceptors(
const std::string& target, const ChannelArguments& args,
std::vector<std::unique_ptr<
- ::grpc::experimental::ClientInterceptorFactoryInterface>>
+ grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) override;
grpc_channel_credentials* const c_creds_;
};
@@ -60,6 +60,7 @@ class SecureCallCredentials final : public CallCredentials {
public:
explicit SecureCallCredentials(grpc_call_credentials* c_creds);
~SecureCallCredentials() override {
+ grpc_core::ExecCtx exec_ctx;
if (c_creds_ != nullptr) c_creds_->Unref();
}
grpc_call_credentials* GetRawCreds() { return c_creds_; }
diff --git a/grpc/src/cpp/client/xds_credentials.cc b/grpc/src/cpp/client/xds_credentials.cc
index 63b48837..d5446a02 100644
--- a/grpc/src/cpp/client/xds_credentials.cc
+++ b/grpc/src/cpp/client/xds_credentials.cc
@@ -19,7 +19,6 @@
#include "src/cpp/client/secure_credentials.h"
namespace grpc {
-namespace experimental {
std::shared_ptr<ChannelCredentials> XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds) {
@@ -37,5 +36,12 @@ std::shared_ptr<ChannelCredentials> XdsCredentials(
}
}
+namespace experimental {
+
+std::shared_ptr<ChannelCredentials> XdsCredentials(
+ const std::shared_ptr<ChannelCredentials>& fallback_creds) {
+ return grpc::XdsCredentials(fallback_creds);
+}
+
} // namespace experimental
} // namespace grpc
diff --git a/grpc/src/cpp/common/alarm.cc b/grpc/src/cpp/common/alarm.cc
index 10d633c0..913c0c73 100644
--- a/grpc/src/cpp/common/alarm.cc
+++ b/grpc/src/cpp/common/alarm.cc
@@ -15,27 +15,26 @@
*
*/
-#include <grpcpp/alarm.h>
+#include <grpc/support/port_platform.h>
#include <memory>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
+#include <grpcpp/alarm.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
+
+#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.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 internal {
-class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
+class AlarmImpl : public grpc::internal::CompletionQueueTag {
public:
AlarmImpl() : cq_(nullptr), tag_(nullptr) {
gpr_ref_init(&refs_, 1);
@@ -47,7 +46,7 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
Unref();
return true;
}
- void Set(::grpc::CompletionQueue* cq, gpr_timespec deadline, void* tag) {
+ void Set(grpc::CompletionQueue* cq, gpr_timespec deadline, void* tag) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_CQ_INTERNAL_REF(cq->cq(), "alarm");
@@ -71,7 +70,8 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
GRPC_CQ_INTERNAL_UNREF(cq, "alarm");
},
this, grpc_schedule_on_exec_ctx);
- grpc_timer_init(&timer_, grpc_timespec_to_millis_round_up(deadline),
+ grpc_timer_init(&timer_,
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline),
&on_alarm_);
}
void Set(gpr_timespec deadline, std::function<void(bool)> f) {
@@ -94,7 +94,8 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
error);
},
this, grpc_schedule_on_exec_ctx);
- grpc_timer_init(&timer_, grpc_timespec_to_millis_round_up(deadline),
+ grpc_timer_init(&timer_,
+ grpc_core::Timestamp::FromTimespecRoundUp(deadline),
&on_alarm_);
}
void Cancel() {
@@ -126,13 +127,13 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
};
} // namespace internal
-static ::grpc::internal::GrpcLibraryInitializer g_gli_initializer;
+static grpc::internal::GrpcLibraryInitializer g_gli_initializer;
Alarm::Alarm() : alarm_(new internal::AlarmImpl()) {
g_gli_initializer.summon();
}
-void Alarm::SetInternal(::grpc::CompletionQueue* cq, gpr_timespec deadline,
+void Alarm::SetInternal(grpc::CompletionQueue* cq, gpr_timespec deadline,
void* tag) {
// Note that we know that alarm_ is actually an internal::AlarmImpl
// but we declared it as the base pointer to avoid a forward declaration
diff --git a/grpc/src/cpp/common/alts_context.cc b/grpc/src/cpp/common/alts_context.cc
index 0b7e7307..5e674ff7 100644
--- a/grpc/src/cpp/common/alts_context.cc
+++ b/grpc/src/cpp/common/alts_context.cc
@@ -29,23 +29,23 @@ namespace experimental {
// 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 =
+ upb_StringView application_protocol =
grpc_gcp_AltsContext_application_protocol(ctx);
if (application_protocol.data != nullptr && application_protocol.size > 0) {
application_protocol_ =
std::string(application_protocol.data, application_protocol.size);
}
- upb_strview record_protocol = grpc_gcp_AltsContext_record_protocol(ctx);
+ upb_StringView record_protocol = grpc_gcp_AltsContext_record_protocol(ctx);
if (record_protocol.data != nullptr && record_protocol.size > 0) {
record_protocol_ = std::string(record_protocol.data, record_protocol.size);
}
- upb_strview peer_service_account =
+ upb_StringView peer_service_account =
grpc_gcp_AltsContext_peer_service_account(ctx);
if (peer_service_account.data != nullptr && peer_service_account.size > 0) {
peer_service_account_ =
std::string(peer_service_account.data, peer_service_account.size);
}
- upb_strview local_service_account =
+ upb_StringView local_service_account =
grpc_gcp_AltsContext_local_service_account(ctx);
if (local_service_account.data != nullptr && local_service_account.size > 0) {
local_service_account_ =
@@ -81,13 +81,13 @@ AltsContext::AltsContext(const grpc_gcp_AltsContext* ctx) {
grpc_gcp_AltsContext_security_level(ctx));
}
if (grpc_gcp_AltsContext_has_peer_attributes(ctx)) {
- size_t iter = UPB_MAP_BEGIN;
+ size_t iter = kUpb_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 =
+ upb_StringView key =
grpc_gcp_AltsContext_PeerAttributesEntry_key(peer_attributes_entry);
- upb_strview val =
+ upb_StringView val =
grpc_gcp_AltsContext_PeerAttributesEntry_value(peer_attributes_entry);
peer_attributes_map_[std::string(key.data, key.size)] =
std::string(val.data, val.size);
diff --git a/grpc/src/cpp/common/auth_property_iterator.cc b/grpc/src/cpp/common/auth_property_iterator.cc
index 0f380b09..1334ea99 100644
--- a/grpc/src/cpp/common/auth_property_iterator.cc
+++ b/grpc/src/cpp/common/auth_property_iterator.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/security/auth_context.h>
-
#include <grpc/grpc_security.h>
+#include <grpcpp/security/auth_context.h>
namespace grpc {
diff --git a/grpc/src/cpp/common/channel_arguments.cc b/grpc/src/cpp/common/channel_arguments.cc
index e342e8d6..6c45dda2 100644
--- a/grpc/src/cpp/common/channel_arguments.cc
+++ b/grpc/src/cpp/common/channel_arguments.cc
@@ -15,14 +15,14 @@
* limitations under the License.
*
*/
-#include <grpcpp/support/channel_arguments.h>
-
#include <sstream>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/resource_quota.h>
+#include <grpcpp/support/channel_arguments.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/socket_mutator.h"
@@ -66,9 +66,9 @@ ChannelArguments::ChannelArguments(const ChannelArguments& other)
}
ChannelArguments::~ChannelArguments() {
- grpc_core::ExecCtx exec_ctx;
for (auto& arg : args_) {
if (arg.type == GRPC_ARG_POINTER) {
+ grpc_core::ExecCtx exec_ctx;
arg.value.pointer.vtable->destroy(arg.value.pointer.p);
}
}
diff --git a/grpc/src/cpp/common/channel_filter.cc b/grpc/src/cpp/common/channel_filter.cc
index ab56d607..26346d42 100644
--- a/grpc/src/cpp/common/channel_filter.cc
+++ b/grpc/src/cpp/common/channel_filter.cc
@@ -16,25 +16,28 @@
*
*/
-#include <string.h>
-
-#include "src/core/lib/channel/channel_stack.h"
#include "src/cpp/common/channel_filter.h"
+#include <string.h>
+
#include <grpcpp/impl/codegen/slice.h>
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
+
namespace grpc {
// MetadataBatch
-grpc_linked_mdelem* MetadataBatch::AddMetadata(const string& key,
- const string& value) {
- grpc_linked_mdelem* storage = new grpc_linked_mdelem;
- storage->md = grpc_mdelem_from_slices(SliceFromCopiedString(key),
- SliceFromCopiedString(value));
- GRPC_LOG_IF_ERROR("MetadataBatch::AddMetadata",
- grpc_metadata_batch_link_head(batch_, storage));
- return storage;
+void MetadataBatch::AddMetadata(const string& key, const string& value) {
+ batch_->Append(key, grpc_core::Slice::FromCopiedString(value),
+ [&](absl::string_view error, const grpc_core::Slice&) {
+ gpr_log(GPR_INFO, "%s",
+ absl::StrCat("MetadataBatch::AddMetadata error:",
+ error, " key=", key, " value=", value)
+ .c_str());
+ });
}
// ChannelData
@@ -61,38 +64,29 @@ void CallData::SetPollsetOrPollsetSet(grpc_call_element* elem,
grpc_call_stack_ignore_set_pollset_or_pollset_set(elem, pollent);
}
-// internal code used by RegisterChannelFilter()
-
namespace internal {
-// Note: Implicitly initialized to nullptr due to static lifetime.
-std::vector<FilterRecord>* channel_filters;
-
-namespace {
-
-bool MaybeAddFilter(grpc_channel_stack_builder* builder, void* arg) {
- const FilterRecord& filter = *static_cast<FilterRecord*>(arg);
- if (filter.include_filter) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (!filter.include_filter(*args)) return true;
- }
- return grpc_channel_stack_builder_prepend_filter(builder, &filter.filter,
- nullptr, nullptr);
+void RegisterChannelFilter(
+ grpc_channel_stack_type stack_type, int priority,
+ std::function<bool(const grpc_channel_args&)> include_filter,
+ const grpc_channel_filter* filter) {
+ auto maybe_add_filter = [include_filter,
+ filter](grpc_core::ChannelStackBuilder* builder) {
+ if (include_filter != nullptr) {
+ const grpc_channel_args* args = builder->channel_args();
+ if (!include_filter(*args)) return true;
+ }
+ builder->PrependFilter(filter, nullptr);
+ return true;
+ };
+ grpc_core::CoreConfiguration::RegisterBuilder(
+ [stack_type, priority,
+ maybe_add_filter](grpc_core::CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(stack_type, priority,
+ maybe_add_filter);
+ });
}
-} // namespace
-
-void ChannelFilterPluginInit() {
- for (size_t i = 0; i < channel_filters->size(); ++i) {
- FilterRecord& filter = (*channel_filters)[i];
- grpc_channel_init_register_stage(filter.stack_type, filter.priority,
- MaybeAddFilter, &filter);
- }
-}
-
-void ChannelFilterPluginShutdown() {}
-
} // namespace internal
} // namespace grpc
diff --git a/grpc/src/cpp/common/channel_filter.h b/grpc/src/cpp/common/channel_filter.h
index d5880563..b58af7ad 100644
--- a/grpc/src/cpp/common/channel_filter.h
+++ b/grpc/src/cpp/common/channel_filter.h
@@ -19,13 +19,13 @@
#ifndef GRPCXX_CHANNEL_FILTER_H
#define GRPCXX_CHANNEL_FILTER_H
+#include <functional>
+#include <vector>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpcpp/impl/codegen/config.h>
-#include <functional>
-#include <vector>
-
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -51,52 +51,8 @@ class MetadataBatch {
grpc_metadata_batch* batch() const { return batch_; }
- /// Adds metadata and returns the newly allocated storage.
- /// The caller takes ownership of the result, which must exist for the
- /// lifetime of the gRPC call.
- grpc_linked_mdelem* AddMetadata(const string& key, const string& value);
-
- class const_iterator : public std::iterator<std::bidirectional_iterator_tag,
- const grpc_mdelem> {
- public:
- const grpc_mdelem& operator*() const { return elem_->md; }
- grpc_mdelem operator->() const { return elem_->md; }
-
- const_iterator& operator++() {
- elem_ = elem_->next;
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp(*this);
- operator++();
- return tmp;
- }
- const_iterator& operator--() {
- elem_ = elem_->prev;
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp(*this);
- operator--();
- return tmp;
- }
-
- bool operator==(const const_iterator& other) const {
- return elem_ == other.elem_;
- }
- bool operator!=(const const_iterator& other) const {
- return elem_ != other.elem_;
- }
-
- private:
- friend class MetadataBatch;
- explicit const_iterator(grpc_linked_mdelem* elem) : elem_(elem) {}
-
- grpc_linked_mdelem* elem_;
- };
-
- const_iterator begin() const { return const_iterator(batch_->list.head); }
- const_iterator end() const { return const_iterator(nullptr); }
+ /// Adds metadata.
+ void AddMetadata(const string& key, const string& value);
private:
grpc_metadata_batch* batch_; // Not owned.
@@ -348,16 +304,10 @@ class ChannelFilter final {
}
};
-struct FilterRecord {
- grpc_channel_stack_type stack_type;
- int priority;
- std::function<bool(const grpc_channel_args&)> include_filter;
- grpc_channel_filter filter;
-};
-extern std::vector<FilterRecord>* channel_filters;
-
-void ChannelFilterPluginInit();
-void ChannelFilterPluginShutdown();
+void RegisterChannelFilter(
+ grpc_channel_stack_type stack_type, int priority,
+ std::function<bool(const grpc_channel_args&)> include_filter,
+ const grpc_channel_filter* filter);
} // namespace internal
@@ -375,26 +325,22 @@ template <typename ChannelDataType, typename CallDataType>
void RegisterChannelFilter(
const char* name, grpc_channel_stack_type stack_type, int priority,
std::function<bool(const grpc_channel_args&)> include_filter) {
- // If we haven't been called before, initialize channel_filters and
- // call grpc_register_plugin().
- if (internal::channel_filters == nullptr) {
- grpc_register_plugin(internal::ChannelFilterPluginInit,
- internal::ChannelFilterPluginShutdown);
- internal::channel_filters = new std::vector<internal::FilterRecord>();
- }
- // Add an entry to channel_filters. The filter will be added when the
- // C-core initialization code calls ChannelFilterPluginInit().
- typedef internal::ChannelFilter<ChannelDataType, CallDataType> FilterType;
- internal::FilterRecord filter_record = {
- stack_type,
- priority,
- include_filter,
- {FilterType::StartTransportStreamOpBatch, FilterType::StartTransportOp,
- FilterType::call_data_size, FilterType::InitCallElement,
- FilterType::SetPollsetOrPollsetSet, FilterType::DestroyCallElement,
- FilterType::channel_data_size, FilterType::InitChannelElement,
- FilterType::DestroyChannelElement, FilterType::GetChannelInfo, name}};
- internal::channel_filters->push_back(filter_record);
+ using FilterType = internal::ChannelFilter<ChannelDataType, CallDataType>;
+ static const grpc_channel_filter filter = {
+ FilterType::StartTransportStreamOpBatch,
+ nullptr,
+ FilterType::StartTransportOp,
+ FilterType::call_data_size,
+ FilterType::InitCallElement,
+ FilterType::SetPollsetOrPollsetSet,
+ FilterType::DestroyCallElement,
+ FilterType::channel_data_size,
+ FilterType::InitChannelElement,
+ FilterType::DestroyChannelElement,
+ FilterType::GetChannelInfo,
+ name};
+ grpc::internal::RegisterChannelFilter(stack_type, priority,
+ std::move(include_filter), &filter);
}
} // namespace grpc
diff --git a/grpc/src/cpp/common/completion_queue_cc.cc b/grpc/src/cpp/common/completion_queue_cc.cc
index 015b5c1d..078f928f 100644
--- a/grpc/src/cpp/common/completion_queue_cc.cc
+++ b/grpc/src/cpp/common/completion_queue_cc.cc
@@ -15,13 +15,12 @@
*
*/
-#include <grpcpp/completion_queue.h>
-
#include <memory>
#include <grpc/grpc.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
+#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
@@ -53,7 +52,8 @@ struct CallbackAlternativeCQ {
refs++;
if (refs == 1) {
cq = new CompletionQueue;
- int num_nexting_threads = GPR_CLAMP(gpr_cpu_num_cores() / 2, 2, 16);
+ int num_nexting_threads =
+ grpc_core::Clamp(gpr_cpu_num_cores() / 2, 2u, 16u);
nexting_threads = new std::vector<grpc_core::Thread>;
for (int i = 0; i < num_nexting_threads; i++) {
nexting_threads->emplace_back(
@@ -89,8 +89,7 @@ struct CallbackAlternativeCQ {
// hold any application locks before executing the callback,
// and cannot be entered recursively.
auto* functor =
- static_cast<grpc_experimental_completion_queue_functor*>(
- ev.tag);
+ static_cast<grpc_completion_queue_functor*>(ev.tag);
functor->functor_run(functor, ev.success);
}
},
@@ -152,7 +151,7 @@ CompletionQueue::NextStatus CompletionQueue::AsyncNextInternal(
return SHUTDOWN;
case GRPC_OP_COMPLETE:
auto core_cq_tag =
- static_cast<::grpc::internal::CompletionQueueTag*>(ev.tag);
+ static_cast<grpc::internal::CompletionQueueTag*>(ev.tag);
*ok = ev.success != 0;
*tag = core_cq_tag;
if (core_cq_tag->FinalizeResult(tag, ok)) {
@@ -180,7 +179,7 @@ bool CompletionQueue::CompletionQueueTLSCache::Flush(void** tag, bool* ok) {
if (grpc_completion_queue_thread_local_cache_flush(cq_->cq_, &res_tag,
&res)) {
auto core_cq_tag =
- static_cast<::grpc::internal::CompletionQueueTag*>(res_tag);
+ static_cast<grpc::internal::CompletionQueueTag*>(res_tag);
*ok = res == 1;
if (core_cq_tag->FinalizeResult(tag, ok)) {
return true;
diff --git a/grpc/src/cpp/common/core_codegen.cc b/grpc/src/cpp/common/core_codegen.cc
index 75383ed5..da964f66 100644
--- a/grpc/src/cpp/common/core_codegen.cc
+++ b/grpc/src/cpp/common/core_codegen.cc
@@ -16,7 +16,7 @@
*
*/
-#include <grpcpp/impl/codegen/core_codegen.h>
+#include <grpc/support/port_platform.h>
#include <stdlib.h>
@@ -27,8 +27,8 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
+#include <grpcpp/impl/codegen/core_codegen.h>
#include <grpcpp/support/config.h>
#include "src/core/lib/profiling/timers.h"
@@ -118,6 +118,10 @@ grpc_call_error CoreCodegen::grpc_call_cancel_with_status(
void* reserved) {
return ::grpc_call_cancel_with_status(call, status, description, reserved);
}
+
+int CoreCodegen::grpc_call_failed_before_recv_message(const grpc_call* c) {
+ return ::grpc_call_failed_before_recv_message(c);
+}
void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); }
void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); }
void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) {
diff --git a/grpc/src/cpp/common/secure_channel_arguments.cc b/grpc/src/cpp/common/secure_channel_arguments.cc
index 471c23f2..339d94b1 100644
--- a/grpc/src/cpp/common/secure_channel_arguments.cc
+++ b/grpc/src/cpp/common/secure_channel_arguments.cc
@@ -16,9 +16,9 @@
*
*/
+#include <grpc/grpc_security.h>
#include <grpcpp/support/channel_arguments.h>
-#include <grpc/grpc_security.h>
#include "src/core/lib/channel/channel_args.h"
namespace grpc {
diff --git a/grpc/src/cpp/common/secure_create_auth_context.cc b/grpc/src/cpp/common/secure_create_auth_context.cc
index 908c4662..6633374b 100644
--- a/grpc/src/cpp/common/secure_create_auth_context.cc
+++ b/grpc/src/cpp/common/secure_create_auth_context.cc
@@ -20,6 +20,7 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpcpp/security/auth_context.h>
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/cpp/common/secure_auth_context.h"
diff --git a/grpc/src/cpp/common/tls_certificate_provider.cc b/grpc/src/cpp/common/tls_certificate_provider.cc
index 2deea5f7..62a2a5cf 100644
--- a/grpc/src/cpp/common/tls_certificate_provider.cc
+++ b/grpc/src/cpp/common/tls_certificate_provider.cc
@@ -14,12 +14,12 @@
// limitations under the License.
//
+#include "absl/container/inlined_vector.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpcpp/security/tls_certificate_provider.h>
-#include "absl/container/inlined_vector.h"
-
namespace grpc {
namespace experimental {
diff --git a/grpc/src/cpp/common/tls_certificate_verifier.cc b/grpc/src/cpp/common/tls_certificate_verifier.cc
new file mode 100644
index 00000000..9be5e127
--- /dev/null
+++ b/grpc/src/cpp/common/tls_certificate_verifier.cc
@@ -0,0 +1,244 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/container/inlined_vector.h"
+#include "absl/status/status.h"
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include <grpcpp/security/tls_certificate_verifier.h>
+
+namespace grpc {
+namespace experimental {
+
+static internal::GrpcLibraryInitializer g_gli_initializer;
+
+TlsCustomVerificationCheckRequest::TlsCustomVerificationCheckRequest(
+ grpc_tls_custom_verification_check_request* request)
+ : c_request_(request) {
+ GPR_ASSERT(c_request_ != nullptr);
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::target_name() const {
+ return c_request_->target_name != nullptr ? c_request_->target_name : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::peer_cert() const {
+ return c_request_->peer_info.peer_cert != nullptr
+ ? c_request_->peer_info.peer_cert
+ : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::peer_cert_full_chain()
+ const {
+ return c_request_->peer_info.peer_cert_full_chain != nullptr
+ ? c_request_->peer_info.peer_cert_full_chain
+ : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::common_name() const {
+ return c_request_->peer_info.common_name != nullptr
+ ? c_request_->peer_info.common_name
+ : "";
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::uri_names()
+ const {
+ std::vector<grpc::string_ref> uri_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.uri_names_size; ++i) {
+ uri_names.emplace_back(c_request_->peer_info.san_names.uri_names[i]);
+ }
+ return uri_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::dns_names()
+ const {
+ std::vector<grpc::string_ref> dns_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.dns_names_size; ++i) {
+ dns_names.emplace_back(c_request_->peer_info.san_names.dns_names[i]);
+ }
+ return dns_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::email_names()
+ const {
+ std::vector<grpc::string_ref> email_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.email_names_size;
+ ++i) {
+ email_names.emplace_back(c_request_->peer_info.san_names.email_names[i]);
+ }
+ return email_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::ip_names()
+ const {
+ std::vector<grpc::string_ref> ip_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.ip_names_size; ++i) {
+ ip_names.emplace_back(c_request_->peer_info.san_names.ip_names[i]);
+ }
+ return ip_names;
+}
+
+CertificateVerifier::CertificateVerifier(grpc_tls_certificate_verifier* v)
+ : verifier_(v) {
+ g_gli_initializer.summon();
+}
+
+CertificateVerifier::~CertificateVerifier() {
+ grpc_tls_certificate_verifier_release(verifier_);
+}
+
+bool CertificateVerifier::Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) {
+ GPR_ASSERT(request != nullptr);
+ GPR_ASSERT(request->c_request() != nullptr);
+ {
+ internal::MutexLock lock(&mu_);
+ request_map_.emplace(request->c_request(), std::move(callback));
+ }
+ grpc_status_code status_code = GRPC_STATUS_OK;
+ char* error_details = nullptr;
+ bool is_done = grpc_tls_certificate_verifier_verify(
+ verifier_, request->c_request(), &AsyncCheckDone, this, &status_code,
+ &error_details);
+ if (is_done) {
+ if (status_code != GRPC_STATUS_OK) {
+ *sync_status = grpc::Status(static_cast<grpc::StatusCode>(status_code),
+ error_details);
+ }
+ internal::MutexLock lock(&mu_);
+ request_map_.erase(request->c_request());
+ }
+ gpr_free(error_details);
+ return is_done;
+}
+
+void CertificateVerifier::Cancel(TlsCustomVerificationCheckRequest* request) {
+ GPR_ASSERT(request != nullptr);
+ GPR_ASSERT(request->c_request() != nullptr);
+ grpc_tls_certificate_verifier_cancel(verifier_, request->c_request());
+}
+
+void CertificateVerifier::AsyncCheckDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details) {
+ auto* self = static_cast<CertificateVerifier*>(callback_arg);
+ std::function<void(grpc::Status)> callback;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = std::move(it->second);
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ grpc::Status return_status;
+ if (status != GRPC_STATUS_OK) {
+ return_status =
+ grpc::Status(static_cast<grpc::StatusCode>(status), error_details);
+ }
+ callback(return_status);
+ }
+}
+
+ExternalCertificateVerifier::ExternalCertificateVerifier() {
+ base_ = new grpc_tls_certificate_verifier_external();
+ base_->user_data = this;
+ base_->verify = VerifyInCoreExternalVerifier;
+ base_->cancel = CancelInCoreExternalVerifier;
+ base_->destruct = DestructInCoreExternalVerifier;
+}
+
+ExternalCertificateVerifier::~ExternalCertificateVerifier() { delete base_; }
+
+int ExternalCertificateVerifier::VerifyInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ TlsCustomVerificationCheckRequest* cpp_request = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto pair = self->request_map_.emplace(
+ request, AsyncRequestState(callback, callback_arg, request));
+ GPR_ASSERT(pair.second);
+ cpp_request = &pair.first->second.cpp_request;
+ }
+ grpc::Status sync_current_verifier_status;
+ bool is_done = self->Verify(
+ cpp_request,
+ [self, request](grpc::Status status) {
+ grpc_tls_on_custom_verification_check_done_cb callback = nullptr;
+ void* callback_arg = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = it->second.callback;
+ callback_arg = it->second.callback_arg;
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ callback(request, callback_arg,
+ static_cast<grpc_status_code>(status.error_code()),
+ status.error_message().c_str());
+ }
+ },
+ &sync_current_verifier_status);
+ if (is_done) {
+ if (!sync_current_verifier_status.ok()) {
+ *sync_status = static_cast<grpc_status_code>(
+ sync_current_verifier_status.error_code());
+ *sync_error_details =
+ gpr_strdup(sync_current_verifier_status.error_message().c_str());
+ }
+ internal::MutexLock lock(&self->mu_);
+ self->request_map_.erase(request);
+ }
+ return is_done;
+}
+
+void ExternalCertificateVerifier::CancelInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ TlsCustomVerificationCheckRequest* cpp_request = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ cpp_request = &it->second.cpp_request;
+ }
+ }
+ if (cpp_request != nullptr) {
+ self->Cancel(cpp_request);
+ }
+}
+
+void ExternalCertificateVerifier::DestructInCoreExternalVerifier(
+ void* user_data) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ delete self;
+}
+
+HostNameCertificateVerifier::HostNameCertificateVerifier()
+ : CertificateVerifier(grpc_tls_certificate_verifier_host_name_create()) {}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/grpc/src/cpp/common/tls_credentials_options.cc b/grpc/src/cpp/common/tls_credentials_options.cc
index 729e6a4d..3e561561 100644
--- a/grpc/src/cpp/common/tls_credentials_options.cc
+++ b/grpc/src/cpp/common/tls_credentials_options.cc
@@ -16,114 +16,15 @@
*
*/
+#include "absl/container/inlined_vector.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpcpp/security/tls_credentials_options.h>
-#include "absl/container/inlined_vector.h"
-#include "src/cpp/common/tls_credentials_options_util.h"
-
namespace grpc {
namespace experimental {
-/** gRPC TLS server authorization check arg API implementation **/
-TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg(
- grpc_tls_server_authorization_check_arg* arg)
- : c_arg_(arg) {
- GPR_ASSERT(c_arg_ != nullptr);
- if (c_arg_->context != nullptr) {
- gpr_log(GPR_ERROR, "c_arg context has already been set");
- }
- c_arg_->context = static_cast<void*>(this);
- c_arg_->destroy_context = &TlsServerAuthorizationCheckArgDestroyContext;
-}
-
-TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {}
-
-void* TlsServerAuthorizationCheckArg::cb_user_data() const {
- return c_arg_->cb_user_data;
-}
-
-int TlsServerAuthorizationCheckArg::success() const { return c_arg_->success; }
-
-std::string TlsServerAuthorizationCheckArg::target_name() const {
- std::string cpp_target_name(c_arg_->target_name);
- return cpp_target_name;
-}
-
-std::string TlsServerAuthorizationCheckArg::peer_cert() const {
- std::string cpp_peer_cert(c_arg_->peer_cert);
- return cpp_peer_cert;
-}
-
-std::string TlsServerAuthorizationCheckArg::peer_cert_full_chain() const {
- std::string 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;
-}
-
-std::string TlsServerAuthorizationCheckArg::error_details() const {
- return c_arg_->error_details->error_details();
-}
-
-void TlsServerAuthorizationCheckArg::set_cb_user_data(void* cb_user_data) {
- c_arg_->cb_user_data = cb_user_data;
-}
-
-void TlsServerAuthorizationCheckArg::set_success(int success) {
- c_arg_->success = success;
-}
-
-void TlsServerAuthorizationCheckArg::set_target_name(
- const std::string& target_name) {
- c_arg_->target_name = gpr_strdup(target_name.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::set_peer_cert(
- const std::string& peer_cert) {
- c_arg_->peer_cert = gpr_strdup(peer_cert.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::set_peer_cert_full_chain(
- const std::string& 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 std::string& error_details) {
- c_arg_->error_details->set_error_details(error_details.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() {
- if (c_arg_->cb == nullptr) {
- gpr_log(GPR_ERROR, "server authorizaton check arg callback API is nullptr");
- return;
- }
- c_arg_->cb(c_arg_);
-}
-
-TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig(
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface)
- : server_authorization_check_interface_(
- std::move(server_authorization_check_interface)) {
- c_config_ = grpc_tls_server_authorization_check_config_create(
- nullptr, &TlsServerAuthorizationCheckConfigCSchedule,
- &TlsServerAuthorizationCheckConfigCCancel, nullptr);
- c_config_->set_context(static_cast<void*>(this));
-}
-
-TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {
- grpc_tls_server_authorization_check_config_release(c_config_);
-}
-
TlsCredentialsOptions::TlsCredentialsOptions() {
c_credentials_options_ = grpc_tls_credentials_options_create();
}
@@ -158,22 +59,38 @@ void TlsCredentialsOptions::set_identity_cert_name(
c_credentials_options_, identity_cert_name.c_str());
}
-void TlsChannelCredentialsOptions::set_server_verification_option(
- grpc_tls_server_verification_option server_verification_option) {
+void TlsCredentialsOptions::set_crl_directory(const std::string& path) {
+ grpc_tls_credentials_options_set_crl_directory(c_credentials_options_,
+ path.c_str());
+}
+
+void TlsCredentialsOptions::set_tls_session_key_log_file_path(
+ const std::string& tls_session_key_log_file_path) {
+ grpc_tls_credentials_options_set_tls_session_key_log_file_path(
+ c_credentials_options_, tls_session_key_log_file_path.c_str());
+}
+
+void TlsCredentialsOptions::set_certificate_verifier(
+ std::shared_ptr<CertificateVerifier> certificate_verifier) {
+ certificate_verifier_ = std::move(certificate_verifier);
+ if (certificate_verifier_ != nullptr) {
+ grpc_tls_credentials_options_set_certificate_verifier(
+ c_credentials_options_, certificate_verifier_->c_verifier());
+ }
+}
+
+void TlsCredentialsOptions::set_check_call_host(bool check_call_host) {
grpc_tls_credentials_options* options = c_credentials_options();
GPR_ASSERT(options != nullptr);
- grpc_tls_credentials_options_set_server_verification_option(
- options, server_verification_option);
+ grpc_tls_credentials_options_set_check_call_host(options, check_call_host);
}
-void TlsChannelCredentialsOptions::set_server_authorization_check_config(
- std::shared_ptr<TlsServerAuthorizationCheckConfig> config) {
+void TlsChannelCredentialsOptions::set_verify_server_certs(
+ bool verify_server_certs) {
grpc_tls_credentials_options* options = c_credentials_options();
GPR_ASSERT(options != nullptr);
- if (config != nullptr) {
- grpc_tls_credentials_options_set_server_authorization_check_config(
- options, config->c_config());
- }
+ grpc_tls_credentials_options_set_verify_server_cert(options,
+ verify_server_certs);
}
void TlsServerCredentialsOptions::set_cert_request_type(
diff --git a/grpc/src/cpp/common/tls_credentials_options_util.cc b/grpc/src/cpp/common/tls_credentials_options_util.cc
deleted file mode 100644
index 1cea450b..00000000
--- a/grpc/src/cpp/common/tls_credentials_options_util.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * 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 "absl/container/inlined_vector.h"
-
-#include <grpcpp/security/tls_credentials_options.h>
-
-#include "src/cpp/common/tls_credentials_options_util.h"
-
-namespace grpc {
-namespace experimental {
-
-/** The C schedule and cancel functions for the server authorization check
- * config. They populate a C server authorization check arg with the result
- * of a C++ server authorization check schedule/cancel API. **/
-int TlsServerAuthorizationCheckConfigCSchedule(
- void* /*config_user_data*/, grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr || arg->config == nullptr ||
- arg->config->context() == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg was not properly initialized");
- return 1;
- }
- TlsServerAuthorizationCheckConfig* cpp_config =
- static_cast<TlsServerAuthorizationCheckConfig*>(arg->config->context());
- TlsServerAuthorizationCheckArg* cpp_arg =
- new TlsServerAuthorizationCheckArg(arg);
- int schedule_result = cpp_config->Schedule(cpp_arg);
- return schedule_result;
-}
-
-void TlsServerAuthorizationCheckConfigCCancel(
- void* /*config_user_data*/, grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr || arg->config == nullptr ||
- arg->config->context() == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg was not properly initialized");
- return;
- }
- if (arg->context == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg schedule has already completed");
- return;
- }
- TlsServerAuthorizationCheckConfig* cpp_config =
- static_cast<TlsServerAuthorizationCheckConfig*>(arg->config->context());
- TlsServerAuthorizationCheckArg* cpp_arg =
- static_cast<TlsServerAuthorizationCheckArg*>(arg->context);
- cpp_config->Cancel(cpp_arg);
-}
-
-void TlsServerAuthorizationCheckArgDestroyContext(void* context) {
- if (context != nullptr) {
- TlsServerAuthorizationCheckArg* cpp_arg =
- static_cast<TlsServerAuthorizationCheckArg*>(context);
- delete cpp_arg;
- }
-}
-
-} // namespace experimental
-} // namespace grpc
diff --git a/grpc/src/cpp/common/tls_credentials_options_util.h b/grpc/src/cpp/common/tls_credentials_options_util.h
deleted file mode 100644
index d6247219..00000000
--- a/grpc/src/cpp/common/tls_credentials_options_util.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * 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_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
-#define GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
-
-#include <grpc/grpc_security.h>
-#include <grpcpp/security/tls_credentials_options.h>
-
-#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-
-namespace grpc {
-namespace experimental {
-
-/** The following 2 functions convert the user-provided schedule or cancel
- * functions into C style schedule or cancel functions. These are internal
- * functions, not meant to be accessed by the user. **/
-int TlsServerAuthorizationCheckConfigCSchedule(
- void* config_user_data, grpc_tls_server_authorization_check_arg* arg);
-
-void TlsServerAuthorizationCheckConfigCCancel(
- void* config_user_data, grpc_tls_server_authorization_check_arg* arg);
-
-void TlsServerAuthorizationCheckArgDestroyContext(void* context);
-
-} // namespace experimental
-} // namespace grpc
-
-#endif // GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
diff --git a/grpc/src/cpp/common/validate_service_config.cc b/grpc/src/cpp/common/validate_service_config.cc
index cac39ad9..c444ea2d 100644
--- a/grpc/src/cpp/common/validate_service_config.cc
+++ b/grpc/src/cpp/common/validate_service_config.cc
@@ -19,15 +19,15 @@
#include <grpc/grpc.h>
#include <grpcpp/support/validate_service_config.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/lib/service_config/service_config_impl.h"
namespace grpc {
namespace experimental {
std::string ValidateServiceConfigJSON(const std::string& service_config_json) {
grpc_init();
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::ServiceConfig::Create(/*args=*/nullptr,
- service_config_json.c_str(), &error);
+ grpc_core::ServiceConfigImpl::Create(/*args=*/nullptr,
+ service_config_json.c_str(), &error);
std::string return_value;
if (error != GRPC_ERROR_NONE) {
return_value = grpc_error_std_string(error);
diff --git a/grpc/src/cpp/common/version_cc.cc b/grpc/src/cpp/common/version_cc.cc
index b7afff43..ad698e56 100644
--- a/grpc/src/cpp/common/version_cc.cc
+++ b/grpc/src/cpp/common/version_cc.cc
@@ -22,5 +22,5 @@
#include <grpcpp/grpcpp.h>
namespace grpc {
-std::string Version() { return "1.38.0"; }
+std::string Version() { return "1.46.5"; }
} // namespace grpc
diff --git a/grpc/src/cpp/ext/filters/census/client_filter.cc b/grpc/src/cpp/ext/filters/census/client_filter.cc
index 380ad5b5..618324f5 100644
--- a/grpc/src/cpp/ext/filters/census/client_filter.cc
+++ b/grpc/src/cpp/ext/filters/census/client_filter.cc
@@ -18,169 +18,241 @@
#include <grpc/support/port_platform.h>
+#include "src/cpp/ext/filters/census/client_filter.h"
+
#include <string>
#include <utility>
#include <vector>
-#include "src/cpp/ext/filters/census/client_filter.h"
-
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "opencensus/stats/stats.h"
+#include "opencensus/tags/context_util.h"
#include "opencensus/tags/tag_key.h"
#include "opencensus/tags/tag_map.h"
+
#include "src/core/lib/surface/call.h"
#include "src/cpp/ext/filters/census/grpc_plugin.h"
#include "src/cpp/ext/filters/census/measures.h"
namespace grpc {
-constexpr uint32_t CensusClientCallData::kMaxTraceContextLen;
-constexpr uint32_t CensusClientCallData::kMaxTagsLen;
+constexpr uint32_t
+ OpenCensusCallTracer::OpenCensusCallAttemptTracer::kMaxTraceContextLen;
+constexpr uint32_t
+ OpenCensusCallTracer::OpenCensusCallAttemptTracer::kMaxTagsLen;
-namespace {
+grpc_error_handle CensusClientCallData::Init(
+ grpc_call_element* /* elem */, const grpc_call_element_args* args) {
+ tracer_ = args->arena->New<OpenCensusCallTracer>(args);
+ GPR_DEBUG_ASSERT(args->context[GRPC_CONTEXT_CALL_TRACER].value == nullptr);
+ args->context[GRPC_CONTEXT_CALL_TRACER].value = tracer_;
+ args->context[GRPC_CONTEXT_CALL_TRACER].destroy = [](void* tracer) {
+ (static_cast<OpenCensusCallTracer*>(tracer))->~OpenCensusCallTracer();
+ };
+ return GRPC_ERROR_NONE;
+}
-void FilterTrailingMetadata(grpc_metadata_batch* b, uint64_t* elapsed_time) {
- if (b->idx.named.grpc_server_stats_bin != nullptr) {
- ServerStatsDeserialize(
- reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(
- GRPC_MDVALUE(b->idx.named.grpc_server_stats_bin->md))),
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(b->idx.named.grpc_server_stats_bin->md)),
- elapsed_time);
- grpc_metadata_batch_remove(b, b->idx.named.grpc_server_stats_bin);
+void CensusClientCallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, TransportStreamOpBatch* op) {
+ // Note that we are generating the overall call context here instead of in
+ // the constructor of `OpenCensusCallTracer` due to the semantics of
+ // `grpc_census_call_set_context` which allows the application to set the
+ // census context for a call anytime before the first call to
+ // `grpc_call_start_batch`.
+ if (op->op()->send_initial_metadata) {
+ tracer_->GenerateContext();
}
+ grpc_call_next_op(elem, op->op());
+}
+
+//
+// OpenCensusCallTracer::OpenCensusCallAttemptTracer
+//
+
+namespace {
+
+CensusContext CreateCensusContextForCallAttempt(
+ absl::string_view method, const CensusContext& parent_context) {
+ GPR_DEBUG_ASSERT(parent_context.Context().IsValid());
+ return CensusContext(absl::StrCat("Attempt.", method), &parent_context.Span(),
+ parent_context.tags());
}
} // namespace
-void CensusClientCallData::OnDoneRecvTrailingMetadataCb(
- void* user_data, grpc_error_handle error) {
- grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
- CensusClientCallData* calld =
- reinterpret_cast<CensusClientCallData*>(elem->call_data);
- GPR_ASSERT(calld != nullptr);
- if (error == GRPC_ERROR_NONE) {
- GPR_ASSERT(calld->recv_trailing_metadata_ != nullptr);
- FilterTrailingMetadata(calld->recv_trailing_metadata_,
- &calld->elapsed_time_);
- }
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->initial_on_done_recv_trailing_metadata_,
- GRPC_ERROR_REF(error));
+OpenCensusCallTracer::OpenCensusCallAttemptTracer::OpenCensusCallAttemptTracer(
+ OpenCensusCallTracer* parent, uint64_t attempt_num,
+ bool is_transparent_retry, bool arena_allocated)
+ : parent_(parent),
+ arena_allocated_(arena_allocated),
+ context_(CreateCensusContextForCallAttempt(parent_->method_,
+ parent_->context_)),
+ start_time_(absl::Now()) {
+ context_.AddSpanAttribute("previous-rpc-attempts", attempt_num);
+ context_.AddSpanAttribute("transparent-retry", is_transparent_retry);
}
-void CensusClientCallData::OnDoneRecvMessageCb(void* user_data,
- grpc_error_handle error) {
- grpc_call_element* elem = reinterpret_cast<grpc_call_element*>(user_data);
- CensusClientCallData* calld =
- reinterpret_cast<CensusClientCallData*>(elem->call_data);
- CensusChannelData* channeld =
- reinterpret_cast<CensusChannelData*>(elem->channel_data);
- GPR_ASSERT(calld != nullptr);
- GPR_ASSERT(channeld != nullptr);
- // Stream messages are no longer valid after receiving trailing metadata.
- if ((*calld->recv_message_) != nullptr) {
- calld->recv_message_count_++;
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::
+ RecordSendInitialMetadata(grpc_metadata_batch* send_initial_metadata,
+ uint32_t /*flags*/) {
+ char tracing_buf[kMaxTraceContextLen];
+ size_t tracing_len = TraceContextSerialize(context_.Context(), tracing_buf,
+ kMaxTraceContextLen);
+ if (tracing_len > 0) {
+ send_initial_metadata->Set(
+ grpc_core::GrpcTraceBinMetadata(),
+ grpc_core::Slice::FromCopiedBuffer(tracing_buf, tracing_len));
+ }
+ grpc_slice tags = grpc_empty_slice();
+ // TODO(unknown): Add in tagging serialization.
+ size_t encoded_tags_len = StatsContextSerialize(kMaxTagsLen, &tags);
+ if (encoded_tags_len > 0) {
+ send_initial_metadata->Set(grpc_core::GrpcTagsBinMetadata(),
+ grpc_core::Slice(tags));
}
- grpc_core::Closure::Run(DEBUG_LOCATION, calld->initial_on_done_recv_message_,
- GRPC_ERROR_REF(error));
}
-void CensusClientCallData::StartTransportStreamOpBatch(
- grpc_call_element* elem, TransportStreamOpBatch* op) {
- if (op->send_initial_metadata() != nullptr) {
- census_context* ctxt = op->get_census_context();
- GenerateClientContext(
- qualified_method_, &context_,
- (ctxt == nullptr) ? nullptr : reinterpret_cast<CensusContext*>(ctxt));
- size_t tracing_len = TraceContextSerialize(context_.Context(), tracing_buf_,
- kMaxTraceContextLen);
- if (tracing_len > 0) {
- GRPC_LOG_IF_ERROR(
- "census grpc_filter",
- grpc_metadata_batch_add_tail(
- op->send_initial_metadata()->batch(), &tracing_bin_,
- grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_TRACE_BIN,
- grpc_core::UnmanagedMemorySlice(tracing_buf_, tracing_len)),
- GRPC_BATCH_GRPC_TRACE_BIN));
- }
- grpc_slice tags = grpc_empty_slice();
- // TODO(unknown): Add in tagging serialization.
- size_t encoded_tags_len = StatsContextSerialize(kMaxTagsLen, &tags);
- if (encoded_tags_len > 0) {
- GRPC_LOG_IF_ERROR(
- "census grpc_filter",
- grpc_metadata_batch_add_tail(
- op->send_initial_metadata()->batch(), &stats_bin_,
- grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TAGS_BIN, tags),
- GRPC_BATCH_GRPC_TAGS_BIN));
- }
- }
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordSendMessage(
+ const grpc_core::ByteStream& /*send_message*/) {
+ ++sent_message_count_;
+}
- if (op->send_message() != nullptr) {
- ++sent_message_count_;
- }
- if (op->recv_message() != nullptr) {
- recv_message_ = op->op()->payload->recv_message.recv_message;
- initial_on_done_recv_message_ =
- op->op()->payload->recv_message.recv_message_ready;
- op->op()->payload->recv_message.recv_message_ready = &on_done_recv_message_;
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordReceivedMessage(
+ const grpc_core::ByteStream& /*recv_message*/) {
+ ++recv_message_count_;
+}
+
+namespace {
+
+void FilterTrailingMetadata(grpc_metadata_batch* b, uint64_t* elapsed_time) {
+ absl::optional<grpc_core::Slice> grpc_server_stats_bin =
+ b->Take(grpc_core::GrpcServerStatsBinMetadata());
+ if (grpc_server_stats_bin.has_value()) {
+ ServerStatsDeserialize(
+ reinterpret_cast<const char*>(grpc_server_stats_bin->data()),
+ grpc_server_stats_bin->size(), elapsed_time);
}
- if (op->recv_trailing_metadata() != nullptr) {
- recv_trailing_metadata_ = op->recv_trailing_metadata()->batch();
- initial_on_done_recv_trailing_metadata_ =
- op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- op->op()->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &on_done_recv_trailing_metadata_;
+}
+
+} // namespace
+
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::
+ RecordReceivedTrailingMetadata(
+ absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
+ const grpc_transport_stream_stats* transport_stream_stats) {
+ status_code_ = status.code();
+ if (recv_trailing_metadata == nullptr || transport_stream_stats == nullptr) {
+ return;
}
- // Call next op.
- grpc_call_next_op(elem, op->op());
+ uint64_t elapsed_time = 0;
+ FilterTrailingMetadata(recv_trailing_metadata, &elapsed_time);
+ std::vector<std::pair<opencensus::tags::TagKey, std::string>> tags =
+ context_.tags().tags();
+ tags.emplace_back(ClientMethodTagKey(), std::string(parent_->method_));
+ std::string final_status = absl::StatusCodeToString(status_code_);
+ tags.emplace_back(ClientStatusTagKey(), final_status);
+ ::opencensus::stats::Record(
+ {{RpcClientSentBytesPerRpc(),
+ static_cast<double>(transport_stream_stats->outgoing.data_bytes)},
+ {RpcClientReceivedBytesPerRpc(),
+ static_cast<double>(transport_stream_stats->incoming.data_bytes)},
+ {RpcClientServerLatency(),
+ ToDoubleMilliseconds(absl::Nanoseconds(elapsed_time))}},
+ tags);
}
-grpc_error_handle CensusClientCallData::Init(
- grpc_call_element* elem, const grpc_call_element_args* args) {
- path_ = grpc_slice_ref_internal(args->path);
- start_time_ = absl::Now();
- method_ = GetMethod(&path_);
- qualified_method_ = absl::StrCat("Sent.", method_);
- GRPC_CLOSURE_INIT(&on_done_recv_message_, OnDoneRecvMessageCb, elem,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&on_done_recv_trailing_metadata_,
- OnDoneRecvTrailingMetadataCb, elem,
- grpc_schedule_on_exec_ctx);
- return GRPC_ERROR_NONE;
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordCancel(
+ grpc_error_handle cancel_error) {
+ status_code_ = absl::StatusCode::kCancelled;
+ GRPC_ERROR_UNREF(cancel_error);
}
-void CensusClientCallData::Destroy(grpc_call_element* /*elem*/,
- const grpc_call_final_info* final_info,
- grpc_closure* /*then_call_closure*/) {
- const uint64_t request_size = GetOutgoingDataSize(final_info);
- const uint64_t response_size = GetIncomingDataSize(final_info);
+void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordEnd(
+ const gpr_timespec& /*latency*/) {
double latency_ms = absl::ToDoubleMilliseconds(absl::Now() - start_time_);
std::vector<std::pair<opencensus::tags::TagKey, std::string>> tags =
context_.tags().tags();
- std::string method = absl::StrCat(method_);
- tags.emplace_back(ClientMethodTagKey(), method);
- std::string final_status =
- absl::StrCat(StatusCodeToString(final_info->final_status));
- tags.emplace_back(ClientStatusTagKey(), final_status);
+ tags.emplace_back(ClientMethodTagKey(), std::string(parent_->method_));
+ tags.emplace_back(ClientStatusTagKey(), StatusCodeToString(status_code_));
::opencensus::stats::Record(
- {{RpcClientSentBytesPerRpc(), static_cast<double>(request_size)},
- {RpcClientReceivedBytesPerRpc(), static_cast<double>(response_size)},
- {RpcClientRoundtripLatency(), latency_ms},
- {RpcClientServerLatency(),
- ToDoubleMilliseconds(absl::Nanoseconds(elapsed_time_))},
+ {{RpcClientRoundtripLatency(), latency_ms},
{RpcClientSentMessagesPerRpc(), sent_message_count_},
{RpcClientReceivedMessagesPerRpc(), recv_message_count_}},
tags);
- grpc_slice_unref_internal(path_);
- if (final_info->final_status != GRPC_STATUS_OK) {
- // TODO(unknown): Map grpc_status_code to trace::StatusCode.
- context_.Span().SetStatus(opencensus::trace::StatusCode::UNKNOWN,
- StatusCodeToString(final_info->final_status));
+ if (status_code_ != absl::StatusCode::kOk) {
+ context_.Span().SetStatus(opencensus::trace::StatusCode(status_code_),
+ StatusCodeToString(status_code_));
}
context_.EndSpan();
+ grpc_core::MutexLock lock(&parent_->mu_);
+ if (--parent_->num_active_rpcs_ == 0) {
+ parent_->time_at_last_attempt_end_ = absl::Now();
+ }
+ if (arena_allocated_) {
+ this->~OpenCensusCallAttemptTracer();
+ } else {
+ delete this;
+ }
+}
+
+//
+// OpenCensusCallTracer
+//
+
+OpenCensusCallTracer::OpenCensusCallTracer(const grpc_call_element_args* args)
+ : call_context_(args->context),
+ path_(grpc_slice_ref_internal(args->path)),
+ method_(GetMethod(path_)),
+ arena_(args->arena) {}
+
+OpenCensusCallTracer::~OpenCensusCallTracer() {
+ std::vector<std::pair<opencensus::tags::TagKey, std::string>> tags =
+ context_.tags().tags();
+ tags.emplace_back(ClientMethodTagKey(), std::string(method_));
+ ::opencensus::stats::Record(
+ {{RpcClientRetriesPerCall(), retries_ - 1}, // exclude first attempt
+ {RpcClientTransparentRetriesPerCall(), transparent_retries_},
+ {RpcClientRetryDelayPerCall(), ToDoubleMilliseconds(retry_delay_)}},
+ tags);
+}
+
+void OpenCensusCallTracer::GenerateContext() {
+ auto* parent_context = reinterpret_cast<CensusContext*>(
+ call_context_[GRPC_CONTEXT_TRACING].value);
+ GenerateClientContext(absl::StrCat("Sent.", method_), &context_,
+ (parent_context == nullptr) ? nullptr : parent_context);
+}
+
+OpenCensusCallTracer::OpenCensusCallAttemptTracer*
+OpenCensusCallTracer::StartNewAttempt(bool is_transparent_retry) {
+ // We allocate the first attempt on the arena and all subsequent attempts on
+ // the heap, so that in the common case we don't require a heap allocation,
+ // nor do we unnecessarily grow the arena.
+ bool is_first_attempt = true;
+ uint64_t attempt_num;
+ {
+ grpc_core::MutexLock lock(&mu_);
+ if (transparent_retries_ != 0 || retries_ != 0) {
+ is_first_attempt = false;
+ if (num_active_rpcs_ == 0) {
+ retry_delay_ += absl::Now() - time_at_last_attempt_end_;
+ }
+ }
+ attempt_num = retries_;
+ if (is_transparent_retry) {
+ ++transparent_retries_;
+ } else {
+ ++retries_;
+ }
+ ++num_active_rpcs_;
+ }
+ if (is_first_attempt) {
+ return arena_->New<OpenCensusCallAttemptTracer>(
+ this, attempt_num, is_transparent_retry, true /* arena_allocated */);
+ }
+ return new OpenCensusCallAttemptTracer(
+ this, attempt_num, is_transparent_retry, false /* arena_allocated */);
}
} // namespace grpc
diff --git a/grpc/src/cpp/ext/filters/census/client_filter.h b/grpc/src/cpp/ext/filters/census/client_filter.h
index f55a4b5c..871b8faa 100644
--- a/grpc/src/cpp/ext/filters/census/client_filter.h
+++ b/grpc/src/cpp/ext/filters/census/client_filter.h
@@ -23,8 +23,9 @@
#include "absl/strings/string_view.h"
#include "absl/time/time.h"
+
#include "src/cpp/ext/filters/census/channel_filter.h"
-#include "src/cpp/ext/filters/census/context.h"
+#include "src/cpp/ext/filters/census/open_census_call_tracer.h"
namespace grpc {
@@ -34,71 +35,13 @@ namespace grpc {
// a call at a time.
class CensusClientCallData : public CallData {
public:
- // Maximum size of trace context is sent on the wire.
- static constexpr uint32_t kMaxTraceContextLen = 64;
- // Maximum size of tags that are sent on the wire.
- static constexpr uint32_t kMaxTagsLen = 2048;
-
- CensusClientCallData()
- : recv_trailing_metadata_(nullptr),
- initial_on_done_recv_trailing_metadata_(nullptr),
- initial_on_done_recv_message_(nullptr),
- elapsed_time_(0),
- recv_message_(nullptr),
- recv_message_count_(0),
- sent_message_count_(0) {
- memset(&stats_bin_, 0, sizeof(grpc_linked_mdelem));
- memset(&tracing_bin_, 0, sizeof(grpc_linked_mdelem));
- memset(&path_, 0, sizeof(grpc_slice));
- memset(&on_done_recv_trailing_metadata_, 0, sizeof(grpc_closure));
- memset(&on_done_recv_message_, 0, sizeof(grpc_closure));
- }
-
- grpc_error_handle Init(grpc_call_element* elem,
+ grpc_error_handle Init(grpc_call_element* /* elem */,
const grpc_call_element_args* args) override;
-
- void Destroy(grpc_call_element* elem, const grpc_call_final_info* final_info,
- grpc_closure* then_call_closure) override;
-
void StartTransportStreamOpBatch(grpc_call_element* elem,
TransportStreamOpBatch* op) override;
- static void OnDoneRecvTrailingMetadataCb(void* user_data,
- grpc_error_handle error);
-
- static void OnDoneSendInitialMetadataCb(void* user_data,
- grpc_error_handle error);
-
- static void OnDoneRecvMessageCb(void* user_data, grpc_error_handle error);
-
private:
- CensusContext context_;
- // Metadata elements for tracing and census stats data.
- grpc_linked_mdelem stats_bin_;
- grpc_linked_mdelem tracing_bin_;
- // Client method.
- absl::string_view method_;
- std::string qualified_method_;
- grpc_slice path_;
- // The recv trailing metadata callbacks.
- grpc_metadata_batch* recv_trailing_metadata_;
- grpc_closure* initial_on_done_recv_trailing_metadata_;
- grpc_closure on_done_recv_trailing_metadata_;
- // recv message
- grpc_closure* initial_on_done_recv_message_;
- grpc_closure on_done_recv_message_;
- // Start time (for measuring latency).
- absl::Time start_time_;
- // Server elapsed time in nanoseconds.
- uint64_t elapsed_time_;
- // The received message--may be null.
- grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message_;
- // Number of messages in this RPC.
- uint64_t recv_message_count_;
- uint64_t sent_message_count_;
- // Buffer needed for grpc_slice to reference when adding trace context
- // metatdata to outgoing message.
- char tracing_buf_[kMaxTraceContextLen];
+ OpenCensusCallTracer* tracer_ = nullptr;
};
} // namespace grpc
diff --git a/grpc/src/cpp/ext/filters/census/context.cc b/grpc/src/cpp/ext/filters/census/context.cc
index 0650bd1b..672228a8 100644
--- a/grpc/src/cpp/ext/filters/census/context.cc
+++ b/grpc/src/cpp/ext/filters/census/context.cc
@@ -18,10 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/cpp/ext/filters/census/context.h"
+
#include "opencensus/tags/context_util.h"
#include "opencensus/trace/context_util.h"
#include "opencensus/trace/propagation/grpc_trace_bin.h"
-#include "src/cpp/ext/filters/census/context.h"
namespace grpc {
diff --git a/grpc/src/cpp/ext/filters/census/context.h b/grpc/src/cpp/ext/filters/census/context.h
index 67f5704a..608a93b9 100644
--- a/grpc/src/cpp/ext/filters/census/context.h
+++ b/grpc/src/cpp/ext/filters/census/context.h
@@ -21,12 +21,9 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
-
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"
-
#include "opencensus/context/context.h"
#include "opencensus/tags/tag_map.h"
#include "opencensus/trace/context_util.h"
@@ -34,6 +31,8 @@
#include "opencensus/trace/span_context.h"
#include "opencensus/trace/trace_params.h"
+#include <grpc/status.h>
+
#include "src/core/lib/slice/slice_internal.h"
#include "src/cpp/common/channel_filter.h"
#include "src/cpp/ext/filters/census/rpc_encoding.h"
@@ -64,6 +63,11 @@ class CensusContext {
name, parent_ctxt)),
tags_({}) {}
+ void AddSpanAttribute(absl::string_view key,
+ opencensus::trace::AttributeValueRef attribute) {
+ span_.AddAttribute(key, attribute);
+ }
+
const ::opencensus::trace::Span& Span() const { return span_; }
const ::opencensus::tags::TagMap& tags() const { return tags_; }
@@ -122,15 +126,12 @@ uint64_t GetOutgoingDataSize(const grpc_call_final_info* final_info);
// Returns a string representation of the StatusCode enum.
absl::string_view StatusCodeToString(grpc_status_code code);
-inline absl::string_view GetMethod(const grpc_slice* path) {
- if (GRPC_SLICE_IS_EMPTY(*path)) {
+inline absl::string_view GetMethod(const grpc_core::Slice& path) {
+ if (path.empty()) {
return "";
}
// Check for leading '/' and trim it if present.
- return absl::StripPrefix(absl::string_view(reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(*path)),
- GRPC_SLICE_LENGTH(*path)),
- "/");
+ return absl::StripPrefix(path.as_string_view(), "/");
}
} // namespace grpc
diff --git a/grpc/src/cpp/ext/filters/census/grpc_plugin.cc b/grpc/src/cpp/ext/filters/census/grpc_plugin.cc
index 09788a61..41ded5cb 100644
--- a/grpc/src/cpp/ext/filters/census/grpc_plugin.cc
+++ b/grpc/src/cpp/ext/filters/census/grpc_plugin.cc
@@ -20,10 +20,11 @@
#include "src/cpp/ext/filters/census/grpc_plugin.h"
-#include <grpcpp/server_context.h>
-
#include "opencensus/tags/tag_key.h"
#include "opencensus/trace/span.h"
+
+#include <grpcpp/server_context.h>
+
#include "src/cpp/ext/filters/census/channel_filter.h"
#include "src/cpp/ext/filters/census/client_filter.h"
#include "src/cpp/ext/filters/census/measures.h"
@@ -47,6 +48,9 @@ void RegisterOpenCensusPlugin() {
RpcClientServerLatency();
RpcClientSentMessagesPerRpc();
RpcClientReceivedMessagesPerRpc();
+ RpcClientRetriesPerCall();
+ RpcClientTransparentRetriesPerCall();
+ RpcClientRetryDelayPerCall();
RpcServerSentBytesPerRpc();
RpcServerReceivedBytesPerRpc();
@@ -112,6 +116,16 @@ ABSL_CONST_INIT const absl::string_view kRpcClientRoundtripLatencyMeasureName =
ABSL_CONST_INIT const absl::string_view kRpcClientServerLatencyMeasureName =
"grpc.io/client/server_latency";
+ABSL_CONST_INIT const absl::string_view kRpcClientRetriesPerCallMeasureName =
+ "grpc.io/client/retries_per_call";
+
+ABSL_CONST_INIT const absl::string_view
+ kRpcClientTransparentRetriesPerCallMeasureName =
+ "grpc.io/client/transparent_retries_per_call";
+
+ABSL_CONST_INIT const absl::string_view kRpcClientRetryDelayPerCallMeasureName =
+ "grpc.io/client/retry_delay_per_call";
+
// Server
ABSL_CONST_INIT const absl::string_view
kRpcServerSentMessagesPerRpcMeasureName =
diff --git a/grpc/src/cpp/ext/filters/census/grpc_plugin.h b/grpc/src/cpp/ext/filters/census/grpc_plugin.h
index 1fb7c904..54754aa8 100644
--- a/grpc/src/cpp/ext/filters/census/grpc_plugin.h
+++ b/grpc/src/cpp/ext/filters/census/grpc_plugin.h
@@ -22,10 +22,11 @@
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
-#include "include/grpcpp/opencensus.h"
#include "opencensus/stats/stats.h"
#include "opencensus/tags/tag_key.h"
+#include <grpcpp/opencensus.h>
+
namespace grpc {
// The tag keys set when recording RPC stats.
@@ -42,6 +43,9 @@ extern const absl::string_view kRpcClientReceivedMessagesPerRpcMeasureName;
extern const absl::string_view kRpcClientReceivedBytesPerRpcMeasureName;
extern const absl::string_view kRpcClientRoundtripLatencyMeasureName;
extern const absl::string_view kRpcClientServerLatencyMeasureName;
+extern const absl::string_view kRpcClientRetriesPerCallMeasureName;
+extern const absl::string_view kRpcClientTransparentRetriesPerCallMeasureName;
+extern const absl::string_view kRpcClientRetryDelayPerCallMeasureName;
extern const absl::string_view kRpcServerSentMessagesPerRpcMeasureName;
extern const absl::string_view kRpcServerSentBytesPerRpcMeasureName;
@@ -59,6 +63,12 @@ ClientReceivedBytesPerRpcCumulative();
const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyCumulative();
const ::opencensus::stats::ViewDescriptor& ClientServerLatencyCumulative();
const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesPerCallCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesCumulative();
+const ::opencensus::stats::ViewDescriptor&
+ClientTransparentRetriesPerCallCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientTransparentRetriesCumulative();
+const ::opencensus::stats::ViewDescriptor& ClientRetryDelayPerCallCumulative();
const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcCumulative();
const ::opencensus::stats::ViewDescriptor&
@@ -77,6 +87,12 @@ const ::opencensus::stats::ViewDescriptor& ClientReceivedBytesPerRpcMinute();
const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyMinute();
const ::opencensus::stats::ViewDescriptor& ClientServerLatencyMinute();
const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsMinute();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesPerCallMinute();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesMinute();
+const ::opencensus::stats::ViewDescriptor&
+ClientTransparentRetriesPerCallMinute();
+const ::opencensus::stats::ViewDescriptor& ClientTransparentRetriesMinute();
+const ::opencensus::stats::ViewDescriptor& ClientRetryDelayPerCallMinute();
const ::opencensus::stats::ViewDescriptor& ServerSentMessagesPerRpcMinute();
const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcMinute();
@@ -92,6 +108,12 @@ const ::opencensus::stats::ViewDescriptor& ClientReceivedBytesPerRpcHour();
const ::opencensus::stats::ViewDescriptor& ClientRoundtripLatencyHour();
const ::opencensus::stats::ViewDescriptor& ClientServerLatencyHour();
const ::opencensus::stats::ViewDescriptor& ClientCompletedRpcsHour();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesPerCallHour();
+const ::opencensus::stats::ViewDescriptor& ClientRetriesHour();
+const ::opencensus::stats::ViewDescriptor&
+ClientTransparentRetriesPerCallHour();
+const ::opencensus::stats::ViewDescriptor& ClientTransparentRetriesHour();
+const ::opencensus::stats::ViewDescriptor& ClientRetryDelayPerCallHour();
const ::opencensus::stats::ViewDescriptor& ServerSentMessagesPerRpcHour();
const ::opencensus::stats::ViewDescriptor& ServerSentBytesPerRpcHour();
diff --git a/grpc/src/cpp/ext/filters/census/measures.cc b/grpc/src/cpp/ext/filters/census/measures.cc
index b522fae0..c02fdce6 100644
--- a/grpc/src/cpp/ext/filters/census/measures.cc
+++ b/grpc/src/cpp/ext/filters/census/measures.cc
@@ -21,6 +21,7 @@
#include "src/cpp/ext/filters/census/measures.h"
#include "opencensus/stats/stats.h"
+
#include "src/cpp/ext/filters/census/grpc_plugin.h"
namespace grpc {
@@ -88,6 +89,32 @@ MeasureInt64 RpcClientReceivedMessagesPerRpc() {
return measure;
}
+// Client per-overall-client-call measures
+MeasureInt64 RpcClientRetriesPerCall() {
+ static const auto measure =
+ MeasureInt64::Register(kRpcClientRetriesPerCallMeasureName,
+ "Number of retry or hedging attempts excluding "
+ "transparent retries made during the client call",
+ kCount);
+ return measure;
+}
+
+MeasureInt64 RpcClientTransparentRetriesPerCall() {
+ static const auto measure = MeasureInt64::Register(
+ kRpcClientTransparentRetriesPerCallMeasureName,
+ "Number of transparent retries made during the client call", kCount);
+ return measure;
+}
+
+MeasureDouble RpcClientRetryDelayPerCall() {
+ static const auto measure =
+ MeasureDouble::Register(kRpcClientRetryDelayPerCallMeasureName,
+ "Total time of delay while there is no active "
+ "attempt during the client call",
+ kUnitMilliseconds);
+ return measure;
+}
+
// Server
MeasureDouble RpcServerSentBytesPerRpc() {
static const auto measure = MeasureDouble::Register(
diff --git a/grpc/src/cpp/ext/filters/census/measures.h b/grpc/src/cpp/ext/filters/census/measures.h
index 8f8e72ac..0682f2e5 100644
--- a/grpc/src/cpp/ext/filters/census/measures.h
+++ b/grpc/src/cpp/ext/filters/census/measures.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include "opencensus/stats/stats.h"
+
#include "src/cpp/ext/filters/census/grpc_plugin.h"
namespace grpc {
@@ -33,6 +34,9 @@ namespace grpc {
::opencensus::stats::MeasureDouble RpcClientRoundtripLatency();
::opencensus::stats::MeasureDouble RpcClientServerLatency();
::opencensus::stats::MeasureInt64 RpcClientCompletedRpcs();
+::opencensus::stats::MeasureInt64 RpcClientRetriesPerCall();
+::opencensus::stats::MeasureInt64 RpcClientTransparentRetriesPerCall();
+::opencensus::stats::MeasureDouble RpcClientRetryDelayPerCall();
::opencensus::stats::MeasureInt64 RpcServerSentMessagesPerRpc();
::opencensus::stats::MeasureDouble RpcServerSentBytesPerRpc();
diff --git a/grpc/src/cpp/ext/filters/census/open_census_call_tracer.h b/grpc/src/cpp/ext/filters/census/open_census_call_tracer.h
new file mode 100644
index 00000000..d856afbe
--- /dev/null
+++ b/grpc/src/cpp/ext/filters/census/open_census_call_tracer.h
@@ -0,0 +1,100 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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_INTERNAL_CPP_EXT_FILTERS_OPEN_CENSUS_CALL_TRACER_H
+#define GRPC_INTERNAL_CPP_EXT_FILTERS_OPEN_CENSUS_CALL_TRACER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/call_tracer.h"
+#include "src/cpp/ext/filters/census/context.h"
+
+namespace grpc {
+
+class OpenCensusCallTracer : public grpc_core::CallTracer {
+ public:
+ class OpenCensusCallAttemptTracer : public CallAttemptTracer {
+ public:
+ OpenCensusCallAttemptTracer(OpenCensusCallTracer* parent,
+ uint64_t attempt_num, bool is_transparent_retry,
+ bool arena_allocated);
+ void RecordSendInitialMetadata(grpc_metadata_batch* send_initial_metadata,
+ uint32_t /*flags*/) override;
+ void RecordOnDoneSendInitialMetadata(gpr_atm* /*peer_string*/) override {}
+ void RecordSendTrailingMetadata(
+ grpc_metadata_batch* /*send_trailing_metadata*/) override {}
+ void RecordSendMessage(
+ const grpc_core::ByteStream& /*send_message*/) override;
+ void RecordReceivedInitialMetadata(
+ grpc_metadata_batch* /*recv_initial_metadata*/,
+ uint32_t /*flags*/) override {}
+ void RecordReceivedMessage(
+ const grpc_core::ByteStream& /*recv_message*/) override;
+ void RecordReceivedTrailingMetadata(
+ absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
+ const grpc_transport_stream_stats* transport_stream_stats) override;
+ void RecordCancel(grpc_error_handle cancel_error) override;
+ void RecordEnd(const gpr_timespec& /*latency*/) override;
+
+ CensusContext* context() { return &context_; }
+
+ private:
+ // Maximum size of trace context is sent on the wire.
+ static constexpr uint32_t kMaxTraceContextLen = 64;
+ // Maximum size of tags that are sent on the wire.
+ static constexpr uint32_t kMaxTagsLen = 2048;
+ OpenCensusCallTracer* parent_;
+ const bool arena_allocated_;
+ CensusContext context_;
+ // Start time (for measuring latency).
+ absl::Time start_time_;
+ // Number of messages in this RPC.
+ uint64_t recv_message_count_ = 0;
+ uint64_t sent_message_count_ = 0;
+ // End status code
+ absl::StatusCode status_code_;
+ };
+
+ explicit OpenCensusCallTracer(const grpc_call_element_args* args);
+ ~OpenCensusCallTracer() override;
+
+ void GenerateContext();
+ OpenCensusCallAttemptTracer* StartNewAttempt(
+ bool is_transparent_retry) override;
+
+ private:
+ const grpc_call_context_element* call_context_;
+ // Client method.
+ grpc_core::Slice path_;
+ absl::string_view method_;
+ CensusContext context_;
+ grpc_core::Arena* arena_;
+ grpc_core::Mutex mu_;
+ // Non-transparent attempts per call
+ uint64_t retries_ ABSL_GUARDED_BY(&mu_) = 0;
+ // Transparent retries per call
+ uint64_t transparent_retries_ ABSL_GUARDED_BY(&mu_) = 0;
+ // Retry delay
+ absl::Duration retry_delay_ ABSL_GUARDED_BY(&mu_);
+ absl::Time time_at_last_attempt_end_ ABSL_GUARDED_BY(&mu_);
+ uint64_t num_active_rpcs_ ABSL_GUARDED_BY(&mu_) = 0;
+};
+
+}; // namespace grpc
+
+#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_OPEN_CENSUS_CALL_TRACER_H
diff --git a/grpc/src/cpp/ext/filters/census/server_filter.cc b/grpc/src/cpp/ext/filters/census/server_filter.cc
index 72ee8e16..011cd420 100644
--- a/grpc/src/cpp/ext/filters/census/server_filter.cc
+++ b/grpc/src/cpp/ext/filters/census/server_filter.cc
@@ -25,6 +25,7 @@
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "opencensus/stats/stats.h"
+
#include "src/core/lib/surface/call.h"
#include "src/cpp/ext/filters/census/grpc_plugin.h"
#include "src/cpp/ext/filters/census/measures.h"
@@ -37,25 +38,24 @@ namespace {
// server metadata elements
struct ServerMetadataElements {
- grpc_slice path;
- grpc_slice tracing_slice;
- grpc_slice census_proto;
+ grpc_core::Slice path;
+ grpc_core::Slice tracing_slice;
+ grpc_core::Slice census_proto;
};
void FilterInitialMetadata(grpc_metadata_batch* b,
ServerMetadataElements* sml) {
- if (b->idx.named.path != nullptr) {
- sml->path = grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.path->md));
+ const auto* path = b->get_pointer(grpc_core::HttpPathMetadata());
+ if (path != nullptr) {
+ sml->path = path->Ref();
}
- if (b->idx.named.grpc_trace_bin != nullptr) {
- sml->tracing_slice =
- grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_trace_bin->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_TRACE_BIN);
+ auto grpc_trace_bin = b->Take(grpc_core::GrpcTraceBinMetadata());
+ if (grpc_trace_bin.has_value()) {
+ sml->tracing_slice = std::move(*grpc_trace_bin);
}
- if (b->idx.named.grpc_tags_bin != nullptr) {
- sml->census_proto =
- grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_tags_bin->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_TAGS_BIN);
+ auto grpc_tags_bin = b->Take(grpc_core::GrpcTagsBinMetadata());
+ if (grpc_tags_bin.has_value()) {
+ sml->census_proto = std::move(*grpc_tags_bin);
}
}
@@ -88,26 +88,12 @@ void CensusServerCallData::OnDoneRecvInitialMetadataCb(
grpc_metadata_batch* initial_metadata = calld->recv_initial_metadata_;
GPR_ASSERT(initial_metadata != nullptr);
ServerMetadataElements sml;
- sml.path = grpc_empty_slice();
- sml.tracing_slice = grpc_empty_slice();
- sml.census_proto = grpc_empty_slice();
FilterInitialMetadata(initial_metadata, &sml);
- calld->path_ = grpc_slice_ref_internal(sml.path);
- calld->method_ = GetMethod(&calld->path_);
+ calld->path_ = std::move(sml.path);
+ calld->method_ = GetMethod(calld->path_);
calld->qualified_method_ = absl::StrCat("Recv.", calld->method_);
- const char* tracing_str =
- GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
- ? ""
- : reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(sml.tracing_slice));
- size_t tracing_str_len = GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
- ? 0
- : GRPC_SLICE_LENGTH(sml.tracing_slice);
- GenerateServerContext(absl::string_view(tracing_str, tracing_str_len),
+ GenerateServerContext(sml.tracing_slice.as_string_view(),
calld->qualified_method_, &calld->context_);
- grpc_slice_unref_internal(sml.tracing_slice);
- grpc_slice_unref_internal(sml.census_proto);
- grpc_slice_unref_internal(sml.path);
grpc_census_call_set_context(
calld->gc_, reinterpret_cast<census_context*>(&calld->context_));
}
@@ -140,14 +126,9 @@ void CensusServerCallData::StartTransportStreamOpBatch(
size_t len = ServerStatsSerialize(absl::ToInt64Nanoseconds(elapsed_time_),
stats_buf_, kMaxServerStatsLen);
if (len > 0) {
- GRPC_LOG_IF_ERROR(
- "census grpc_filter",
- grpc_metadata_batch_add_tail(
- op->send_trailing_metadata()->batch(), &census_bin_,
- grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_SERVER_STATS_BIN,
- grpc_core::UnmanagedMemorySlice(stats_buf_, len)),
- GRPC_BATCH_GRPC_SERVER_STATS_BIN));
+ op->send_trailing_metadata()->batch()->Set(
+ grpc_core::GrpcServerStatsBinMetadata(),
+ grpc_core::Slice::FromCopiedBuffer(stats_buf_, len));
}
}
// Call next op.
@@ -183,7 +164,6 @@ void CensusServerCallData::Destroy(grpc_call_element* /*elem*/,
{RpcServerReceivedMessagesPerRpc(), recv_message_count_}},
{{ServerMethodTagKey(), method_},
{ServerStatusTagKey(), StatusCodeToString(final_info->final_status)}});
- grpc_slice_unref_internal(path_);
context_.EndSpan();
}
diff --git a/grpc/src/cpp/ext/filters/census/server_filter.h b/grpc/src/cpp/ext/filters/census/server_filter.h
index 81bec8fa..de20b0b2 100644
--- a/grpc/src/cpp/ext/filters/census/server_filter.h
+++ b/grpc/src/cpp/ext/filters/census/server_filter.h
@@ -24,7 +24,9 @@
#include "absl/strings/string_view.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
-#include "include/grpc/grpc_security.h"
+
+#include <grpc/grpc_security.h>
+
#include "src/cpp/ext/filters/census/channel_filter.h"
#include "src/cpp/ext/filters/census/context.h"
@@ -48,8 +50,6 @@ class CensusServerCallData : public CallData {
recv_message_(nullptr),
recv_message_count_(0),
sent_message_count_(0) {
- memset(&census_bin_, 0, sizeof(grpc_linked_mdelem));
- memset(&path_, 0, sizeof(grpc_slice));
memset(&on_done_recv_initial_metadata_, 0, sizeof(grpc_closure));
memset(&on_done_recv_message_, 0, sizeof(grpc_closure));
}
@@ -73,13 +73,11 @@ class CensusServerCallData : public CallData {
// server method
absl::string_view method_;
std::string qualified_method_;
- grpc_slice path_;
+ grpc_core::Slice path_;
// Pointer to the grpc_call element
grpc_call* gc_;
// Authorization context for the call.
grpc_auth_context* auth_context_;
- // Metadata element for census stats.
- grpc_linked_mdelem census_bin_;
// recv callback
grpc_metadata_batch* recv_initial_metadata_;
grpc_closure* initial_on_done_recv_initial_metadata_;
diff --git a/grpc/src/cpp/ext/filters/census/views.cc b/grpc/src/cpp/ext/filters/census/views.cc
index 2c0c5f72..926e8425 100644
--- a/grpc/src/cpp/ext/filters/census/views.cc
+++ b/grpc/src/cpp/ext/filters/census/views.cc
@@ -18,13 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/cpp/ext/filters/census/grpc_plugin.h"
-
#include "absl/time/time.h"
#include "opencensus/stats/internal/aggregation_window.h"
#include "opencensus/stats/internal/set_aggregation_window.h"
#include "opencensus/stats/stats.h"
+#include "src/cpp/ext/filters/census/grpc_plugin.h"
+
namespace grpc {
using ::opencensus::stats::Aggregation;
@@ -158,6 +158,56 @@ const ViewDescriptor& ClientReceivedMessagesPerRpcCumulative() {
return descriptor;
}
+const ViewDescriptor& ClientRetriesPerCallCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/retries_per_call/cumulative")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetriesCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/retries/cumulative")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesPerCallCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/transparent_retries_per_call/cumulative")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/transparent_retries/cumulative")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetryDelayPerCallCumulative() {
+ const static ViewDescriptor descriptor =
+ ViewDescriptor()
+ .set_name("grpc.io/client/retry_delay_per_call/cumulative")
+ .set_measure(kRpcClientRetryDelayPerCallMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
// server cumulative
const ViewDescriptor& ServerSentBytesPerRpcCumulative() {
const static ViewDescriptor descriptor =
@@ -292,6 +342,56 @@ const ViewDescriptor& ClientReceivedMessagesPerRpcMinute() {
return descriptor;
}
+const ViewDescriptor& ClientRetriesPerCallMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/retries_per_call/minute")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetriesMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/retries/minute")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesPerCallMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/transparent_retries_per_call/minute")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/transparent_retries/minute")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetryDelayPerCallMinute() {
+ const static ViewDescriptor descriptor =
+ MinuteDescriptor()
+ .set_name("grpc.io/client/retry_delay_per_call/minute")
+ .set_measure(kRpcClientRetryDelayPerCallMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
// server minute
const ViewDescriptor& ServerSentBytesPerRpcMinute() {
const static ViewDescriptor descriptor =
@@ -426,6 +526,56 @@ const ViewDescriptor& ClientReceivedMessagesPerRpcHour() {
return descriptor;
}
+const ViewDescriptor& ClientRetriesPerCallHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/retries_per_call/hour")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetriesHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/retries/hour")
+ .set_measure(kRpcClientRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesPerCallHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/transparent_retries_per_call/hour")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(CountDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientTransparentRetriesHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/transparent_retries/hour")
+ .set_measure(kRpcClientTransparentRetriesPerCallMeasureName)
+ .set_aggregation(Aggregation::Sum())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
+const ViewDescriptor& ClientRetryDelayPerCallHour() {
+ const static ViewDescriptor descriptor =
+ HourDescriptor()
+ .set_name("grpc.io/client/retry_delay_per_call/hour")
+ .set_measure(kRpcClientRetryDelayPerCallMeasureName)
+ .set_aggregation(MillisDistributionAggregation())
+ .add_column(ClientMethodTagKey());
+ return descriptor;
+}
+
// server hour
const ViewDescriptor& ServerSentBytesPerRpcHour() {
const static ViewDescriptor descriptor =
diff --git a/grpc/src/cpp/ext/proto_server_reflection.cc b/grpc/src/cpp/ext/proto_server_reflection.cc
index 336465a3..af35a285 100644
--- a/grpc/src/cpp/ext/proto_server_reflection.cc
+++ b/grpc/src/cpp/ext/proto_server_reflection.cc
@@ -16,13 +16,13 @@
*
*/
+#include "src/cpp/ext/proto_server_reflection.h"
+
#include <unordered_set>
#include <vector>
#include <grpcpp/grpcpp.h>
-#include "src/cpp/ext/proto_server_reflection.h"
-
using grpc::Status;
using grpc::StatusCode;
using grpc::reflection::v1alpha::ErrorResponse;
diff --git a/grpc/src/cpp/ext/proto_server_reflection.h b/grpc/src/cpp/ext/proto_server_reflection.h
index 31e386f3..04f1e638 100644
--- a/grpc/src/cpp/ext/proto_server_reflection.h
+++ b/grpc/src/cpp/ext/proto_server_reflection.h
@@ -23,6 +23,7 @@
#include <vector>
#include <grpcpp/grpcpp.h>
+
#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
namespace grpc {
diff --git a/grpc/src/cpp/ext/proto_server_reflection_plugin.cc b/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
index 0a892d84..c3c2bfb5 100644
--- a/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
+++ b/grpc/src/cpp/ext/proto_server_reflection_plugin.cc
@@ -58,15 +58,15 @@ bool ProtoServerReflectionPlugin::has_async_methods() const {
return false;
}
-static std::unique_ptr< ::grpc::ServerBuilderPlugin> CreateProtoReflection() {
- return std::unique_ptr< ::grpc::ServerBuilderPlugin>(
+static std::unique_ptr<grpc::ServerBuilderPlugin> CreateProtoReflection() {
+ return std::unique_ptr<grpc::ServerBuilderPlugin>(
new ProtoServerReflectionPlugin());
}
void InitProtoReflectionServerBuilderPlugin() {
static struct Initialize {
Initialize() {
- ::grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection);
+ grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection);
}
} initializer;
}
diff --git a/grpc/src/cpp/server/admin/admin_services.cc b/grpc/src/cpp/server/admin/admin_services.cc
index 5159b3ad..7a8713d1 100644
--- a/grpc/src/cpp/server/admin/admin_services.cc
+++ b/grpc/src/cpp/server/admin/admin_services.cc
@@ -22,7 +22,6 @@
#include <grpcpp/ext/admin_services.h>
#include <grpcpp/impl/server_builder_plugin.h>
-
#include <grpcpp/server_builder.h>
// TODO(lidiz) build a real registration system that can pull in services
@@ -35,9 +34,9 @@ namespace grpc {
namespace {
-static auto* g_channelz_service = new ChannelzService();
+auto* g_channelz_service = new ChannelzService();
#if !defined(GRPC_NO_XDS) && !defined(DISABLED_XDS_PROTO_IN_CC)
-static auto* g_csds = new xds::experimental::ClientStatusDiscoveryService();
+auto* g_csds = new xds::experimental::ClientStatusDiscoveryService();
#endif // GRPC_NO_XDS or DISABLED_XDS_PROTO_IN_CC
} // namespace
diff --git a/grpc/src/cpp/server/async_generic_service.cc b/grpc/src/cpp/server/async_generic_service.cc
index 07697a52..9580219e 100644
--- a/grpc/src/cpp/server/async_generic_service.cc
+++ b/grpc/src/cpp/server/async_generic_service.cc
@@ -17,15 +17,14 @@
*/
#include <grpcpp/generic/async_generic_service.h>
-
#include <grpcpp/server.h>
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/grpc/src/cpp/server/authorization_policy_provider.cc b/grpc/src/cpp/server/authorization_policy_provider.cc
new file mode 100644
index 00000000..8dab33dd
--- /dev/null
+++ b/grpc/src/cpp/server/authorization_policy_provider.cc
@@ -0,0 +1,69 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpcpp/security/authorization_policy_provider.h>
+
+namespace grpc {
+namespace experimental {
+
+std::shared_ptr<StaticDataAuthorizationPolicyProvider>
+StaticDataAuthorizationPolicyProvider::Create(const std::string& authz_policy,
+ grpc::Status* status) {
+ grpc_status_code code = GRPC_STATUS_OK;
+ const char* error_details;
+ grpc_authorization_policy_provider* provider =
+ grpc_authorization_policy_provider_static_data_create(
+ authz_policy.c_str(), &code, &error_details);
+ if (code != GRPC_STATUS_OK) {
+ *status = grpc::Status(static_cast<grpc::StatusCode>(code), error_details);
+ gpr_free(const_cast<char*>(error_details));
+ return nullptr;
+ }
+ *status = grpc::Status();
+ return std::make_shared<StaticDataAuthorizationPolicyProvider>(provider);
+}
+
+StaticDataAuthorizationPolicyProvider::
+ ~StaticDataAuthorizationPolicyProvider() {
+ grpc_authorization_policy_provider_release(c_provider_);
+}
+
+std::shared_ptr<FileWatcherAuthorizationPolicyProvider>
+FileWatcherAuthorizationPolicyProvider::Create(
+ const std::string& authz_policy_path, unsigned int refresh_interval_sec,
+ grpc::Status* status) {
+ grpc_status_code code = GRPC_STATUS_OK;
+ const char* error_details;
+ grpc_authorization_policy_provider* provider =
+ grpc_authorization_policy_provider_file_watcher_create(
+ authz_policy_path.c_str(), refresh_interval_sec, &code,
+ &error_details);
+ if (code != GRPC_STATUS_OK) {
+ *status = grpc::Status(static_cast<grpc::StatusCode>(code), error_details);
+ gpr_free(const_cast<char*>(error_details));
+ return nullptr;
+ }
+ return std::make_shared<FileWatcherAuthorizationPolicyProvider>(provider);
+}
+
+FileWatcherAuthorizationPolicyProvider::
+ ~FileWatcherAuthorizationPolicyProvider() {
+ grpc_authorization_policy_provider_release(c_provider_);
+}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/grpc/src/cpp/server/channelz/channelz_service.h b/grpc/src/cpp/server/channelz/channelz_service.h
index b4a66ba1..824f0a9f 100644
--- a/grpc/src/cpp/server/channelz/channelz_service.h
+++ b/grpc/src/cpp/server/channelz/channelz_service.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpcpp/grpcpp.h>
+
#include "src/proto/grpc/channelz/channelz.grpc.pb.h"
namespace grpc {
diff --git a/grpc/src/cpp/server/channelz/channelz_service_plugin.cc b/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
index e2e9495e..2fc5b2a6 100644
--- a/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
+++ b/grpc/src/cpp/server/channelz/channelz_service_plugin.cc
@@ -29,7 +29,7 @@ namespace grpc {
namespace channelz {
namespace experimental {
-class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
+class ChannelzServicePlugin : public grpc::ServerBuilderPlugin {
public:
ChannelzServicePlugin() : channelz_service_(new grpc::ChannelzService()) {}
@@ -61,16 +61,16 @@ class ChannelzServicePlugin : public ::grpc::ServerBuilderPlugin {
std::shared_ptr<grpc::ChannelzService> channelz_service_;
};
-static std::unique_ptr< ::grpc::ServerBuilderPlugin>
+static std::unique_ptr<grpc::ServerBuilderPlugin>
CreateChannelzServicePlugin() {
- return std::unique_ptr< ::grpc::ServerBuilderPlugin>(
+ return std::unique_ptr<grpc::ServerBuilderPlugin>(
new ChannelzServicePlugin());
}
void InitChannelzService() {
static struct Initializer {
Initializer() {
- ::grpc::ServerBuilder::InternalAddPluginFactory(
+ grpc::ServerBuilder::InternalAddPluginFactory(
&grpc::channelz::experimental::CreateChannelzServicePlugin);
}
} initialize;
diff --git a/grpc/src/cpp/server/csds/csds.cc b/grpc/src/cpp/server/csds/csds.cc
index fc8e7e0e..61de3760 100644
--- a/grpc/src/cpp/server/csds/csds.cc
+++ b/grpc/src/cpp/server/csds/csds.cc
@@ -20,14 +20,14 @@
#include "src/cpp/server/csds/csds.h"
+#include <string>
+
#include "absl/status/statusor.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpcpp/impl/codegen/slice.h>
-#include <string>
-
#include "src/proto/grpc/testing/xds/v3/csds.grpc.pb.h"
namespace grpc {
diff --git a/grpc/src/cpp/server/csds/csds.h b/grpc/src/cpp/server/csds/csds.h
index be2a4aa1..d08e1524 100644
--- a/grpc/src/cpp/server/csds/csds.h
+++ b/grpc/src/cpp/server/csds/csds.h
@@ -20,9 +20,11 @@
#define GRPC_INTERNAL_CPP_SERVER_CSDS_H
#include <grpc/support/port_platform.h>
-#include <grpcpp/grpcpp.h>
+
#include "absl/status/status.h"
+#include <grpcpp/grpcpp.h>
+
#include "src/proto/grpc/testing/xds/v3/csds.grpc.pb.h"
namespace grpc {
diff --git a/grpc/src/cpp/server/external_connection_acceptor_impl.h b/grpc/src/cpp/server/external_connection_acceptor_impl.h
index 9c65ac16..674baff5 100644
--- a/grpc/src/cpp/server/external_connection_acceptor_impl.h
+++ b/grpc/src/cpp/server/external_connection_acceptor_impl.h
@@ -53,7 +53,7 @@ class ExternalConnectionAcceptorImpl
ServerCredentials* GetCredentials() { return creds_.get(); }
- void SetToChannelArgs(::grpc::ChannelArguments* args);
+ void SetToChannelArgs(grpc::ChannelArguments* args);
private:
const std::string name_;
diff --git a/grpc/src/cpp/server/health/default_health_check_service.cc b/grpc/src/cpp/server/health/default_health_check_service.cc
index 42c55c52..d0114f0f 100644
--- a/grpc/src/cpp/server/health/default_health_check_service.cc
+++ b/grpc/src/cpp/server/health/default_health_check_service.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/cpp/server/health/default_health_check_service.h"
+
#include <memory>
#include "absl/memory/memory.h"
@@ -26,9 +28,7 @@
#include <grpc/support/log.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"
#define MAX_SERVICE_NAME_LENGTH 200
@@ -161,8 +161,8 @@ DefaultHealthCheckService::HealthCheckServiceImpl::HealthCheckServiceImpl(
AddMethod(new internal::RpcServiceMethod(
kHealthWatchMethodName, internal::RpcMethod::SERVER_STREAMING, nullptr));
// Create serving thread.
- thread_ = absl::make_unique<::grpc_core::Thread>("grpc_health_check_service",
- Serve, this);
+ thread_ = absl::make_unique<grpc_core::Thread>("grpc_health_check_service",
+ Serve, this);
}
DefaultHealthCheckService::HealthCheckServiceImpl::~HealthCheckServiceImpl() {
@@ -202,32 +202,20 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::Serve(void* arg) {
bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest(
const ByteBuffer& request, std::string* service_name) {
- std::vector<Slice> slices;
- if (!request.Dump(&slices).ok()) return false;
+ Slice slice;
+ if (!request.DumpToSingleSlice(&slice).ok()) return false;
uint8_t* request_bytes = nullptr;
size_t request_size = 0;
- if (slices.size() == 1) {
- request_bytes = const_cast<uint8_t*>(slices[0].begin());
- request_size = slices[0].size();
- } else if (slices.size() > 1) {
- request_bytes = static_cast<uint8_t*>(gpr_malloc(request.Length()));
- uint8_t* copy_to = request_bytes;
- for (size_t i = 0; i < slices.size(); i++) {
- memcpy(copy_to, slices[i].begin(), slices[i].size());
- copy_to += slices[i].size();
- }
- }
+ request_bytes = const_cast<uint8_t*>(slice.begin());
+ request_size = slice.size();
upb::Arena arena;
grpc_health_v1_HealthCheckRequest* request_struct =
grpc_health_v1_HealthCheckRequest_parse(
reinterpret_cast<char*>(request_bytes), request_size, arena.ptr());
- if (slices.size() > 1) {
- gpr_free(request_bytes);
- }
if (request_struct == nullptr) {
return false;
}
- upb_strview service =
+ upb_StringView service =
grpc_health_v1_HealthCheckRequest_service(request_struct);
if (service.size > MAX_SERVICE_NAME_LENGTH) {
return false;
diff --git a/grpc/src/cpp/server/health/default_health_check_service.h b/grpc/src/cpp/server/health/default_health_check_service.h
index e62189bd..0d3f7971 100644
--- a/grpc/src/cpp/server/health/default_health_check_service.h
+++ b/grpc/src/cpp/server/health/default_health_check_service.h
@@ -229,7 +229,7 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface {
// we don't enqueue new tags into cq_ after it is already shut down.
grpc_core::Mutex cq_shutdown_mu_;
std::atomic_bool shutdown_{false};
- std::unique_ptr<::grpc_core::Thread> thread_;
+ std::unique_ptr<grpc_core::Thread> thread_;
};
DefaultHealthCheckService();
diff --git a/grpc/src/cpp/server/insecure_server_credentials.cc b/grpc/src/cpp/server/insecure_server_credentials.cc
index 4c1cec0c..bafd60de 100644
--- a/grpc/src/cpp/server/insecure_server_credentials.cc
+++ b/grpc/src/cpp/server/insecure_server_credentials.cc
@@ -16,17 +16,21 @@
*
*/
-#include <grpcpp/security/server_credentials.h>
-
#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
+#include <grpcpp/security/server_credentials.h>
namespace grpc {
namespace {
class InsecureServerCredentialsImpl final : public ServerCredentials {
public:
int AddPortToServer(const std::string& addr, grpc_server* server) override {
- return grpc_server_add_insecure_http2_port(server, addr.c_str());
+ grpc_server_credentials* server_creds =
+ grpc_insecure_server_credentials_create();
+ int result = grpc_server_add_http2_port(server, addr.c_str(), server_creds);
+ grpc_server_credentials_release(server_creds);
+ return result;
}
void SetAuthMetadataProcessor(
const std::shared_ptr<grpc::AuthMetadataProcessor>& processor) override {
diff --git a/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc b/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
index 561d4f50..f778b137 100644
--- a/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
+++ b/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
@@ -20,6 +20,8 @@
#ifdef GPR_LINUX
+#include <inttypes.h>
+
#include <cstdio>
#include "src/cpp/server/load_reporter/get_cpu_stats.h"
@@ -32,7 +34,8 @@ std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
FILE* fp;
fp = fopen("/proc/stat", "r");
uint64_t user, nice, system, idle;
- if (fscanf(fp, "cpu %lu %lu %lu %lu", &user, &nice, &system, &idle) != 4) {
+ if (fscanf(fp, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64, &user,
+ &nice, &system, &idle) != 4) {
// Something bad happened with the information, so assume it's all invalid
user = nice = system = idle = 0;
}
diff --git a/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc b/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
index 0a98e848..c03daddb 100644
--- a/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
+++ b/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
@@ -21,6 +21,7 @@
#ifdef GPR_WINDOWS
#include <windows.h>
+
#include <cstdint>
#include "src/cpp/server/load_reporter/get_cpu_stats.h"
diff --git a/grpc/src/cpp/server/load_reporter/load_data_store.cc b/grpc/src/cpp/server/load_reporter/load_data_store.cc
index 003192c3..9a65c3e7 100644
--- a/grpc/src/cpp/server/load_reporter/load_data_store.cc
+++ b/grpc/src/cpp/server/load_reporter/load_data_store.cc
@@ -18,14 +18,16 @@
#include <grpc/impl/codegen/port_platform.h>
+#include "src/cpp/server/load_reporter/load_data_store.h"
+
#include <stdio.h>
+
#include <cstdlib>
#include <set>
#include <unordered_map>
#include <vector>
#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/cpp/server/load_reporter/load_data_store.h"
namespace grpc {
namespace load_reporter {
diff --git a/grpc/src/cpp/server/load_reporter/load_reporter.cc b/grpc/src/cpp/server/load_reporter/load_reporter.cc
index 613cf3a0..c4ea44e5 100644
--- a/grpc/src/cpp/server/load_reporter/load_reporter.cc
+++ b/grpc/src/cpp/server/load_reporter/load_reporter.cc
@@ -18,20 +18,22 @@
#include <grpc/impl/codegen/port_platform.h>
+#include "src/cpp/server/load_reporter/load_reporter.h"
+
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
+
#include <chrono>
#include <ctime>
#include <iterator>
-#include "src/cpp/server/load_reporter/constants.h"
-#include "src/cpp/server/load_reporter/get_cpu_stats.h"
-#include "src/cpp/server/load_reporter/load_reporter.h"
-
#include "opencensus/stats/internal/set_aggregation_window.h"
#include "opencensus/tags/tag_key.h"
+#include "src/cpp/server/load_reporter/constants.h"
+#include "src/cpp/server/load_reporter/get_cpu_stats.h"
+
namespace grpc {
namespace load_reporter {
@@ -250,7 +252,7 @@ LoadReporter::GenerateLoadBalancingFeedback() {
feedback_records_.pop_front();
}
if (feedback_records_.size() < 2) {
- return ::grpc::lb::v1::LoadBalancingFeedback::default_instance();
+ return grpc::lb::v1::LoadBalancingFeedback::default_instance();
}
// Find the longest range with valid ends.
auto oldest = feedback_records_.begin();
@@ -265,7 +267,7 @@ LoadReporter::GenerateLoadBalancingFeedback() {
if (std::distance(oldest, newest) < 1 ||
oldest->end_time == newest->end_time ||
newest->cpu_limit == oldest->cpu_limit) {
- return ::grpc::lb::v1::LoadBalancingFeedback::default_instance();
+ return grpc::lb::v1::LoadBalancingFeedback::default_instance();
}
uint64_t rpcs = 0;
uint64_t errors = 0;
@@ -280,7 +282,7 @@ LoadReporter::GenerateLoadBalancingFeedback() {
std::chrono::duration<double> duration_seconds =
newest->end_time - oldest->end_time;
lock.Release();
- ::grpc::lb::v1::LoadBalancingFeedback feedback;
+ grpc::lb::v1::LoadBalancingFeedback feedback;
feedback.set_server_utilization(static_cast<float>(cpu_usage / cpu_limit));
feedback.set_calls_per_second(
static_cast<float>(rpcs / duration_seconds.count()));
@@ -289,14 +291,14 @@ LoadReporter::GenerateLoadBalancingFeedback() {
return feedback;
}
-::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load>
+::google::protobuf::RepeatedPtrField<grpc::lb::v1::Load>
LoadReporter::GenerateLoads(const std::string& hostname,
const std::string& lb_id) {
grpc_core::MutexLock lock(&store_mu_);
auto assigned_stores = load_data_store_.GetAssignedStores(hostname, lb_id);
GPR_ASSERT(assigned_stores != nullptr);
GPR_ASSERT(!assigned_stores->empty());
- ::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load> loads;
+ ::google::protobuf::RepeatedPtrField<grpc::lb::v1::Load> loads;
for (PerBalancerStore* per_balancer_store : *assigned_stores) {
GPR_ASSERT(!per_balancer_store->IsSuspended());
if (!per_balancer_store->load_record_map().empty()) {
@@ -352,7 +354,7 @@ LoadReporter::GenerateLoads(const std::string& hostname,
}
void LoadReporter::AttachOrphanLoadId(
- ::grpc::lb::v1::Load* load, const PerBalancerStore& per_balancer_store) {
+ grpc::lb::v1::Load* load, const PerBalancerStore& per_balancer_store) {
if (per_balancer_store.lb_id() == kInvalidLbId) {
load->set_load_key_unknown(true);
} else {
diff --git a/grpc/src/cpp/server/load_reporter/load_reporter.h b/grpc/src/cpp/server/load_reporter/load_reporter.h
index f8b1123c..586e62db 100644
--- a/grpc/src/cpp/server/load_reporter/load_reporter.h
+++ b/grpc/src/cpp/server/load_reporter/load_reporter.h
@@ -26,6 +26,9 @@
#include <deque>
#include <vector>
+#include "opencensus/stats/stats.h"
+#include "opencensus/tags/tag_key.h"
+
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config.h>
@@ -33,9 +36,6 @@
#include "src/cpp/server/load_reporter/load_data_store.h"
#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h"
-#include "opencensus/stats/stats.h"
-#include "opencensus/tags/tag_key.h"
-
namespace grpc {
namespace load_reporter {
@@ -140,13 +140,13 @@ class LoadReporter {
// all the stats data accumulated between the last report (i.e., the last
// consumption) and the last fetch from Census (i.e., the last production).
// Thread-safe.
- ::google::protobuf::RepeatedPtrField<::grpc::lb::v1::Load> GenerateLoads(
+ ::google::protobuf::RepeatedPtrField<grpc::lb::v1::Load> GenerateLoads(
const std::string& hostname, const std::string& lb_id);
// The feedback is calculated from the stats data recorded in the sliding
// window. Outdated records are discarded.
// Thread-safe.
- ::grpc::lb::v1::LoadBalancingFeedback GenerateLoadBalancingFeedback();
+ grpc::lb::v1::LoadBalancingFeedback GenerateLoadBalancingFeedback();
// Wrapper around LoadDataStore::ReportStreamCreated.
// Thread-safe.
@@ -209,7 +209,7 @@ class LoadReporter {
// Extracts an OrphanedLoadIdentifier from the per-balancer store and attaches
// it to the load.
- void AttachOrphanLoadId(::grpc::lb::v1::Load* load,
+ void AttachOrphanLoadId(grpc::lb::v1::Load* load,
const PerBalancerStore& per_balancer_store);
std::atomic<int64_t> next_lb_id_{0};
diff --git a/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc b/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc
index e2a14efc..21164173 100644
--- a/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc
+++ b/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc
@@ -18,12 +18,12 @@
#include <grpc/support/port_platform.h>
+#include "src/cpp/server/load_reporter/load_reporter_async_service_impl.h"
+
#include <inttypes.h>
#include "absl/memory/memory.h"
-#include "src/cpp/server/load_reporter/load_reporter_async_service_impl.h"
-
namespace grpc {
namespace load_reporter {
@@ -36,8 +36,8 @@ void LoadReporterAsyncServiceImpl::CallableTag::Run(bool ok) {
LoadReporterAsyncServiceImpl::LoadReporterAsyncServiceImpl(
std::unique_ptr<ServerCompletionQueue> cq)
: cq_(std::move(cq)) {
- thread_ = absl::make_unique<::grpc_core::Thread>("server_load_reporting",
- Work, this);
+ thread_ =
+ absl::make_unique<grpc_core::Thread>("server_load_reporting", Work, this);
std::unique_ptr<CpuStatsProvider> cpu_stats_provider = nullptr;
#if defined(GPR_LINUX) || defined(GPR_WINDOWS) || defined(GPR_APPLE)
cpu_stats_provider = absl::make_unique<CpuStatsProviderDefaultImpl>();
@@ -285,7 +285,7 @@ void LoadReporterAsyncServiceImpl::ReportLoadHandler::SendReport(
Shutdown(std::move(self), "SendReport");
return;
}
- ::grpc::lb::v1::LoadReportResponse response;
+ grpc::lb::v1::LoadReportResponse response;
auto loads = load_reporter_->GenerateLoads(load_balanced_hostname_, lb_id_);
response.mutable_load()->Swap(&loads);
auto feedback = load_reporter_->GenerateLoadBalancingFeedback();
@@ -294,7 +294,7 @@ void LoadReporterAsyncServiceImpl::ReportLoadHandler::SendReport(
auto initial_response = response.mutable_initial_response();
initial_response->set_load_balancer_id(lb_id_);
initial_response->set_implementation_id(
- ::grpc::lb::v1::InitialLoadReportResponse::CPP);
+ grpc::lb::v1::InitialLoadReportResponse::CPP);
initial_response->set_server_version(kVersion);
call_status_ = INITIAL_RESPONSE_SENT;
}
diff --git a/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.h b/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.h
index d8452955..728a193a 100644
--- a/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.h
+++ b/grpc/src/cpp/server/load_reporter/load_reporter_async_service_impl.h
@@ -142,14 +142,14 @@ class LoadReporterAsyncServiceImpl
// The data for RPC communication with the load reportee.
ServerContext ctx_;
- ::grpc::lb::v1::LoadReportRequest request_;
+ grpc::lb::v1::LoadReportRequest request_;
// The members passed down from LoadReporterAsyncServiceImpl.
ServerCompletionQueue* cq_;
LoadReporterAsyncServiceImpl* service_;
LoadReporter* load_reporter_;
- ServerAsyncReaderWriter<::grpc::lb::v1::LoadReportResponse,
- ::grpc::lb::v1::LoadReportRequest>
+ ServerAsyncReaderWriter<grpc::lb::v1::LoadReportResponse,
+ grpc::lb::v1::LoadReportRequest>
stream_;
// The status of the RPC progress.
@@ -184,7 +184,7 @@ class LoadReporterAsyncServiceImpl
// don't enqueue new tags into cq_ after it is already shut down.
grpc_core::Mutex cq_shutdown_mu_;
std::atomic_bool shutdown_{false};
- std::unique_ptr<::grpc_core::Thread> thread_;
+ std::unique_ptr<grpc_core::Thread> thread_;
std::unique_ptr<LoadReporter> load_reporter_;
std::unique_ptr<Alarm> next_fetch_and_sample_alarm_;
};
diff --git a/grpc/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc b/grpc/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc
index 43ad7021..29041c9f 100644
--- a/grpc/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc
+++ b/grpc/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc
@@ -27,12 +27,12 @@ namespace load_reporter {
namespace experimental {
void LoadReportingServiceServerBuilderOption::UpdateArguments(
- ::grpc::ChannelArguments* args) {
+ grpc::ChannelArguments* args) {
args->SetInt(GRPC_ARG_ENABLE_LOAD_REPORTING, true);
}
void LoadReportingServiceServerBuilderOption::UpdatePlugins(
- std::vector<std::unique_ptr<::grpc::ServerBuilderPlugin>>* plugins) {
+ std::vector<std::unique_ptr<grpc::ServerBuilderPlugin>>* plugins) {
plugins->emplace_back(
new grpc::load_reporter::LoadReportingServiceServerBuilderPlugin());
}
diff --git a/grpc/src/cpp/server/load_reporter/util.cc b/grpc/src/cpp/server/load_reporter/util.cc
index 4f05a5b8..75be7f16 100644
--- a/grpc/src/cpp/server/load_reporter/util.cc
+++ b/grpc/src/cpp/server/load_reporter/util.cc
@@ -18,11 +18,10 @@
#include <grpc/impl/codegen/port_platform.h>
-#include <grpcpp/ext/server_load_reporting.h>
-
#include <cmath>
#include <grpc/support/log.h>
+#include <grpcpp/ext/server_load_reporting.h>
namespace grpc {
namespace load_reporter {
diff --git a/grpc/src/cpp/server/orca/orca_service.cc b/grpc/src/cpp/server/orca/orca_service.cc
new file mode 100644
index 00000000..55bc14d7
--- /dev/null
+++ b/grpc/src/cpp/server/orca/orca_service.cc
@@ -0,0 +1,224 @@
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "google/protobuf/duration.upb.h"
+#include "upb/upb.hpp"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
+#include "xds/service/orca/v3/orca.upb.h"
+
+#include <grpcpp/ext/orca_service.h>
+#include <grpcpp/impl/codegen/server_callback_handlers.h>
+
+#include "src/core/lib/gprpp/time.h"
+#include "src/core/lib/iomgr/timer.h"
+
+namespace grpc {
+namespace experimental {
+
+//
+// OrcaService::Reactor
+//
+
+class OrcaService::Reactor : public ServerWriteReactor<ByteBuffer>,
+ public grpc_core::RefCounted<Reactor> {
+ public:
+ explicit Reactor(OrcaService* service, const ByteBuffer* request_buffer)
+ : service_(service) {
+ GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr);
+ // Get slice from request.
+ Slice slice;
+ GPR_ASSERT(request_buffer->DumpToSingleSlice(&slice).ok());
+ // Parse request proto.
+ upb::Arena arena;
+ xds_service_orca_v3_OrcaLoadReportRequest* request =
+ xds_service_orca_v3_OrcaLoadReportRequest_parse(
+ reinterpret_cast<const char*>(slice.begin()), slice.size(),
+ arena.ptr());
+ if (request == nullptr) {
+ Finish(Status(StatusCode::INTERNAL, "could not parse request proto"));
+ return;
+ }
+ const auto* duration_proto =
+ xds_service_orca_v3_OrcaLoadReportRequest_report_interval(request);
+ if (duration_proto != nullptr) {
+ report_interval_ = grpc_core::Duration::FromSecondsAndNanoseconds(
+ google_protobuf_Duration_seconds(duration_proto),
+ google_protobuf_Duration_nanos(duration_proto));
+ }
+ auto min_interval = grpc_core::Duration::Milliseconds(
+ service_->min_report_duration_ / absl::Milliseconds(1));
+ if (report_interval_ < min_interval) report_interval_ = min_interval;
+ // Send initial response.
+ SendResponse();
+ }
+
+ void OnWriteDone(bool ok) override {
+ if (!ok) {
+ Finish(Status(StatusCode::UNKNOWN, "write failed"));
+ return;
+ }
+ response_.Clear();
+ ScheduleTimer();
+ }
+
+ void OnCancel() override {
+ MaybeCancelTimer();
+ Finish(Status(StatusCode::UNKNOWN, "call cancelled by client"));
+ }
+
+ void OnDone() override {
+ // Free the initial ref from instantiation.
+ Unref();
+ }
+
+ private:
+ void SendResponse() {
+ Slice response_slice = service_->GetOrCreateSerializedResponse();
+ ByteBuffer response_buffer(&response_slice, 1);
+ response_.Swap(&response_buffer);
+ StartWrite(&response_);
+ }
+
+ void ScheduleTimer() {
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ Ref().release(); // Ref held by timer.
+ grpc::internal::MutexLock lock(&timer_mu_);
+ timer_pending_ = true;
+ grpc_timer_init(&timer_, exec_ctx.Now() + report_interval_, &on_timer_);
+ }
+
+ void MaybeCancelTimer() {
+ grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
+ grpc_core::ExecCtx exec_ctx;
+ grpc::internal::MutexLock lock(&timer_mu_);
+ if (timer_pending_) {
+ timer_pending_ = false;
+ grpc_timer_cancel(&timer_);
+ }
+ }
+
+ static void OnTimer(void* arg, grpc_error_handle error) {
+ grpc_core::RefCountedPtr<Reactor> self(static_cast<Reactor*>(arg));
+ grpc::internal::MutexLock lock(&self->timer_mu_);
+ if (error == GRPC_ERROR_NONE && self->timer_pending_) {
+ self->timer_pending_ = false;
+ self->SendResponse();
+ }
+ }
+
+ OrcaService* service_;
+
+ // TODO(roth): Change this to use the EventEngine API once it becomes
+ // available.
+ grpc::internal::Mutex timer_mu_;
+ bool timer_pending_ ABSL_GUARDED_BY(&timer_mu_) = false;
+ grpc_timer timer_ ABSL_GUARDED_BY(&timer_mu_);
+ grpc_closure on_timer_;
+
+ grpc_core::Duration report_interval_;
+ ByteBuffer response_;
+};
+
+//
+// OrcaService
+//
+
+OrcaService::OrcaService(OrcaService::Options options)
+ : min_report_duration_(options.min_report_duration) {
+ AddMethod(new internal::RpcServiceMethod(
+ "/xds.service.orca.v3.OpenRcaService/StreamCoreMetrics",
+ internal::RpcMethod::SERVER_STREAMING, /*handler=*/nullptr));
+ MarkMethodCallback(
+ 0, new internal::CallbackServerStreamingHandler<ByteBuffer, ByteBuffer>(
+ [this](CallbackServerContext* /*ctx*/, const ByteBuffer* request) {
+ return new Reactor(this, request);
+ }));
+}
+
+void OrcaService::SetCpuUtilization(double cpu_utilization) {
+ grpc::internal::MutexLock lock(&mu_);
+ cpu_utilization_ = cpu_utilization;
+ response_slice_.reset();
+}
+
+void OrcaService::DeleteCpuUtilization() {
+ grpc::internal::MutexLock lock(&mu_);
+ cpu_utilization_ = -1;
+ response_slice_.reset();
+}
+
+void OrcaService::SetMemoryUtilization(double memory_utilization) {
+ grpc::internal::MutexLock lock(&mu_);
+ memory_utilization_ = memory_utilization;
+ response_slice_.reset();
+}
+
+void OrcaService::DeleteMemoryUtilization() {
+ grpc::internal::MutexLock lock(&mu_);
+ memory_utilization_ = -1;
+ response_slice_.reset();
+}
+
+void OrcaService::SetNamedUtilization(std::string name, double utilization) {
+ grpc::internal::MutexLock lock(&mu_);
+ named_utilization_[std::move(name)] = utilization;
+ response_slice_.reset();
+}
+
+void OrcaService::DeleteNamedUtilization(const std::string& name) {
+ grpc::internal::MutexLock lock(&mu_);
+ named_utilization_.erase(name);
+ response_slice_.reset();
+}
+
+void OrcaService::SetAllNamedUtilization(
+ std::map<std::string, double> named_utilization) {
+ grpc::internal::MutexLock lock(&mu_);
+ named_utilization_ = std::move(named_utilization);
+ response_slice_.reset();
+}
+
+Slice OrcaService::GetOrCreateSerializedResponse() {
+ grpc::internal::MutexLock lock(&mu_);
+ if (!response_slice_.has_value()) {
+ upb::Arena arena;
+ xds_data_orca_v3_OrcaLoadReport* response =
+ xds_data_orca_v3_OrcaLoadReport_new(arena.ptr());
+ if (cpu_utilization_ != -1) {
+ xds_data_orca_v3_OrcaLoadReport_set_cpu_utilization(response,
+ cpu_utilization_);
+ }
+ if (memory_utilization_ != -1) {
+ xds_data_orca_v3_OrcaLoadReport_set_mem_utilization(response,
+ memory_utilization_);
+ }
+ for (const auto& p : named_utilization_) {
+ xds_data_orca_v3_OrcaLoadReport_utilization_set(
+ response,
+ upb_StringView_FromDataAndSize(p.first.data(), p.first.size()),
+ p.second, arena.ptr());
+ }
+ size_t buf_length;
+ char* buf = xds_data_orca_v3_OrcaLoadReport_serialize(response, arena.ptr(),
+ &buf_length);
+ response_slice_.emplace(buf, buf_length);
+ }
+ return Slice(*response_slice_);
+}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/grpc/src/cpp/server/secure_server_credentials.cc b/grpc/src/cpp/server/secure_server_credentials.cc
index 4f52a879..412b7931 100644
--- a/grpc/src/cpp/server/secure_server_credentials.cc
+++ b/grpc/src/cpp/server/secure_server_credentials.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/cpp/server/secure_server_credentials.h"
+
#include <functional>
#include <map>
#include <memory>
@@ -25,7 +27,6 @@
#include <grpcpp/security/auth_metadata_processor.h>
#include "src/cpp/common/secure_auth_context.h"
-#include "src/cpp/server/secure_server_credentials.h"
namespace grpc {
@@ -74,7 +75,6 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
grpc_metadata md_entry;
md_entry.key = SliceReferencingString(consumed.first);
md_entry.value = SliceReferencingString(consumed.second);
- md_entry.flags = 0;
consumed_md.push_back(md_entry);
}
std::vector<grpc_metadata> response_md;
@@ -82,7 +82,6 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
grpc_metadata md_entry;
md_entry.key = SliceReferencingString(response.first);
md_entry.value = SliceReferencingString(response.second);
- md_entry.flags = 0;
response_md.push_back(md_entry);
}
auto consumed_md_data = consumed_md.empty() ? nullptr : &consumed_md[0];
@@ -94,7 +93,7 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
int SecureServerCredentials::AddPortToServer(const std::string& addr,
grpc_server* server) {
- return grpc_server_add_secure_http2_port(server, addr.c_str(), creds_);
+ return grpc_server_add_http2_port(server, addr.c_str(), creds_);
}
void SecureServerCredentials::SetAuthMetadataProcessor(
diff --git a/grpc/src/cpp/server/secure_server_credentials.h b/grpc/src/cpp/server/secure_server_credentials.h
index 730abdb8..6a74fd9a 100644
--- a/grpc/src/cpp/server/secure_server_credentials.h
+++ b/grpc/src/cpp/server/secure_server_credentials.h
@@ -21,11 +21,10 @@
#include <memory>
+#include <grpc/grpc_security.h>
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/security/tls_credentials_options.h>
-#include <grpc/grpc_security.h>
-
#include "src/cpp/server/thread_pool_interface.h"
namespace grpc {
diff --git a/grpc/src/cpp/server/server_builder.cc b/grpc/src/cpp/server/server_builder.cc
index 695aa541..f0fec748 100644
--- a/grpc/src/cpp/server/server_builder.cc
+++ b/grpc/src/cpp/server/server_builder.cc
@@ -16,15 +16,14 @@
*
*/
-#include <grpcpp/server_builder.h>
+#include <utility>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/resource_quota.h>
#include <grpcpp/server.h>
-
-#include <utility>
+#include <grpcpp/server_builder.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
@@ -102,38 +101,23 @@ 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);
+ service);
} else {
callback_generic_service_ = service;
}
return *this;
}
-#else
-ServerBuilder& ServerBuilder::experimental_type::RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) {
- if (builder_->generic_service_ || builder_->callback_generic_service_) {
- gpr_log(GPR_ERROR,
- "Adding multiple generic services is unsupported for now. "
- "Dropping the service %p",
- service);
- } else {
- builder_->callback_generic_service_ = service;
- }
- return *builder_;
-}
-#endif
-ServerBuilder& ServerBuilder::experimental_type::SetContextAllocator(
+ServerBuilder& ServerBuilder::SetContextAllocator(
std::unique_ptr<grpc::ContextAllocator> context_allocator) {
- builder_->context_allocator_ = std::move(context_allocator);
- return *builder_;
+ context_allocator_ = std::move(context_allocator);
+ return *this;
}
std::unique_ptr<grpc::experimental::ExternalConnectionAcceptor>
@@ -149,6 +133,12 @@ ServerBuilder::experimental_type::AddExternalConnectionAcceptor(
return builder_->acceptors_.back()->GetAcceptor();
}
+void ServerBuilder::experimental_type::SetAuthorizationPolicyProvider(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider) {
+ builder_->authorization_provider_ = std::move(provider);
+}
+
ServerBuilder& ServerBuilder::SetOption(
std::unique_ptr<ServerBuilderOption> option) {
options_.push_back(std::move(option));
@@ -177,9 +167,9 @@ ServerBuilder& ServerBuilder::SetSyncServerOption(
ServerBuilder& ServerBuilder::SetCompressionAlgorithmSupportStatus(
grpc_compression_algorithm algorithm, bool enabled) {
if (enabled) {
- GPR_BITSET(&enabled_compression_algorithms_bitset_, algorithm);
+ grpc_core::SetBit(&enabled_compression_algorithms_bitset_, algorithm);
} else {
- GPR_BITCLEAR(&enabled_compression_algorithms_bitset_, algorithm);
+ grpc_core::ClearBit(&enabled_compression_algorithms_bitset_, algorithm);
}
return *this;
}
@@ -253,6 +243,11 @@ ChannelArguments ServerBuilder::BuildChannelArgs() {
plugin->UpdateServerBuilder(this);
plugin->UpdateChannelArguments(&args);
}
+ if (authorization_provider_ != nullptr) {
+ args.SetPointerWithVtable(GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER,
+ authorization_provider_->c_provider(),
+ grpc_authorization_policy_provider_arg_vtable());
+ }
return args;
}
@@ -382,12 +377,7 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
return nullptr;
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
server->RegisterContextAllocator(std::move(context_allocator_));
-#else
- server->experimental_registration()->RegisterContextAllocator(
- std::move(context_allocator_));
-#endif
for (const auto& value : services_) {
if (!server->RegisterService(value->host.get(), value->service)) {
diff --git a/grpc/src/cpp/server/server_cc.cc b/grpc/src/cpp/server/server_cc.cc
index a334cdd8..875893de 100644
--- a/grpc/src/cpp/server/server_cc.cc
+++ b/grpc/src/cpp/server/server_cc.cc
@@ -15,13 +15,13 @@
*
*/
-#include <grpcpp/server.h>
-
#include <cstdlib>
#include <sstream>
#include <type_traits>
#include <utility>
+#include "absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
@@ -39,11 +39,10 @@
#include <grpcpp/impl/server_initializer.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
#include <grpcpp/server_context.h>
#include <grpcpp/support/time.h>
-#include "absl/memory/memory.h"
-
#include "src/core/ext/transport/inproc/inproc_transport.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -114,15 +113,6 @@ 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
-
} // namespace
ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
@@ -273,7 +263,7 @@ bool ServerInterface::GenericAsyncRequest::FinalizeResult(void** tag,
}
namespace {
-class ShutdownCallback : public grpc_experimental_completion_queue_functor {
+class ShutdownCallback : public grpc_completion_queue_functor {
public:
ShutdownCallback() {
functor_run = &ShutdownCallback::Run;
@@ -289,7 +279,7 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
// The Run function will get invoked by the completion queue library
// when the shutdown is actually complete
- static void Run(grpc_experimental_completion_queue_functor* cb, int) {
+ static void Run(grpc_completion_queue_functor* cb, int) {
auto* callback = static_cast<ShutdownCallback*>(cb);
delete callback->cq_;
delete callback;
@@ -417,7 +407,9 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
: server_->resource_exhausted_handler_.get();
deserialized_request_ = handler->Deserialize(call_, request_payload_,
&request_status_, nullptr);
-
+ if (!request_status_.ok()) {
+ gpr_log(GPR_DEBUG, "Failed to deserialize message.");
+ }
request_payload_ = nullptr;
interceptor_methods_.AddInterceptionHookPoint(
grpc::experimental::InterceptionHookPoints::POST_RECV_MESSAGE);
@@ -583,7 +575,7 @@ class Server::CallbackRequest final
// method_name needs to be specialized between named method and generic
const char* method_name() const;
- class CallbackCallTag : public grpc_experimental_completion_queue_functor {
+ class CallbackCallTag : public grpc_completion_queue_functor {
public:
explicit CallbackCallTag(Server::CallbackRequest<ServerContextType>* req)
: req_(req) {
@@ -606,8 +598,7 @@ class Server::CallbackRequest final
Server::CallbackRequest<ServerContextType>* req_;
grpc::internal::Call* call_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackCallTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
@@ -657,6 +648,9 @@ class Server::CallbackRequest final
req_->request_ = req_->method_->handler()->Deserialize(
req_->call_, req_->request_payload_, &req_->request_status_,
&req_->handler_data_);
+ if (!(req_->request_status_.ok())) {
+ gpr_log(GPR_DEBUG, "Failed to deserialize message.");
+ }
req_->request_payload_ = nullptr;
req_->interceptor_methods_.AddInterceptionHookPoint(
grpc::experimental::InterceptionHookPoints::POST_RECV_MESSAGE);
@@ -798,8 +792,8 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
}
void AddSyncMethod(grpc::internal::RpcServiceMethod* method, void* tag) {
- server_->server()->core_server->SetRegisteredMethodAllocator(
- server_cq_->cq(), tag, [this, method] {
+ grpc_core::Server::FromC(server_->server())
+ ->SetRegisteredMethodAllocator(server_cq_->cq(), tag, [this, method] {
grpc_core::Server::RegisteredCallAllocation result;
new SyncRequest(server_, method, &result);
return result;
@@ -812,8 +806,8 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
unknown_method_ = absl::make_unique<grpc::internal::RpcServiceMethod>(
"unknown", grpc::internal::RpcMethod::BIDI_STREAMING,
new grpc::internal::UnknownMethodHandler(kUnknownRpcMethod));
- server_->server()->core_server->SetBatchMethodAllocator(
- server_cq_->cq(), [this] {
+ grpc_core::Server::FromC(server_->server())
+ ->SetBatchMethodAllocator(server_cq_->cq(), [this] {
grpc_core::Server::BatchCallAllocation result;
new SyncRequest(server_, unknown_method_.get(), &result);
return result;
@@ -1037,7 +1031,7 @@ bool Server::RegisterService(const std::string* addr, grpc::Service* service) {
has_callback_methods_ = true;
grpc::internal::RpcServiceMethod* method_value = method.get();
grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetRegisteredMethodAllocator(
+ grpc_core::Server::FromC(server_)->SetRegisteredMethodAllocator(
cq->cq(), method_registration_tag, [this, cq, method_value] {
grpc_core::Server::RegisteredCallAllocation result;
new CallbackRequest<grpc::CallbackServerContext>(this, method_value,
@@ -1078,7 +1072,8 @@ void Server::RegisterCallbackGenericService(
generic_handler_.reset(service->Handler());
grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetBatchMethodAllocator(cq->cq(), [this, cq] {
+ grpc_core::Server::FromC(server_)->SetBatchMethodAllocator(cq->cq(), [this,
+ cq] {
grpc_core::Server::BatchCallAllocation result;
new CallbackRequest<grpc::GenericCallbackServerContext>(this, cq, &result);
return result;
@@ -1115,9 +1110,9 @@ void Server::UnrefAndWaitLocked() {
shutdown_done_ = true;
return; // no need to wait on CV since done condition already set
}
- grpc::internal::WaitUntil(
- &shutdown_done_cv_, &mu_,
- [this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { return shutdown_done_; });
+ while (!shutdown_done_) {
+ shutdown_done_cv_.Wait(&mu_);
+ }
}
void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
diff --git a/grpc/src/cpp/server/server_context.cc b/grpc/src/cpp/server/server_context.cc
index 2cb014ba..6bfe19d4 100644
--- a/grpc/src/cpp/server/server_context.cc
+++ b/grpc/src/cpp/server/server_context.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/impl/codegen/server_context.h>
-
#include <algorithm>
+#include <atomic>
#include <utility>
#include <grpc/compression.h>
@@ -28,6 +27,7 @@
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/server_context.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/support/time.h>
@@ -48,7 +48,7 @@ class ServerContextBase::CompletionOp final
// 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)
+ grpc::internal::ServerCallbackCall* callback_controller)
: call_(*call),
callback_controller_(callback_controller),
has_tag_(false),
@@ -141,7 +141,7 @@ class ServerContextBase::CompletionOp final
}
internal::Call call_;
- ::grpc::internal::ServerCallbackCall* const callback_controller_;
+ grpc::internal::ServerCallbackCall* const callback_controller_;
bool has_tag_;
void* tag_;
void* core_cq_tag_;
@@ -275,7 +275,7 @@ ServerContextBase::CallWrapper::~CallWrapper() {
void ServerContextBase::BeginCompletionOp(
internal::Call* call, std::function<void(bool)> callback,
- ::grpc::internal::ServerCallbackCall* callback_controller) {
+ grpc::internal::ServerCallbackCall* callback_controller) {
GPR_ASSERT(!completion_op_);
if (rpc_info_) {
rpc_info_->Ref();
@@ -327,14 +327,16 @@ void ServerContextBase::TryCancel() const {
bool ServerContextBase::IsCancelled() const {
if (completion_tag_) {
// When using callback API, this result is always valid.
- return completion_op_->CheckCancelledAsync();
+ return marked_cancelled_.load(std::memory_order_acquire) ||
+ completion_op_->CheckCancelledAsync();
} else if (has_notify_when_done_tag_) {
// When using async API, the result is only valid
// if the tag has already been delivered at the completion queue
return completion_op_ && completion_op_->CheckCancelledAsync();
} else {
// when using sync API, the result is always valid
- return completion_op_ && completion_op_->CheckCancelled(cq_);
+ return marked_cancelled_.load(std::memory_order_acquire) ||
+ (completion_op_ && completion_op_->CheckCancelled(cq_));
}
}
diff --git a/grpc/src/cpp/server/server_credentials.cc b/grpc/src/cpp/server/server_credentials.cc
index 36b5a52d..454e8b4e 100644
--- a/grpc/src/cpp/server/server_credentials.cc
+++ b/grpc/src/cpp/server/server_credentials.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/security/server_credentials.h>
-
#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/security/server_credentials.h>
namespace grpc {
diff --git a/grpc/src/cpp/server/server_posix.cc b/grpc/src/cpp/server/server_posix.cc
index c3d40d4f..58542421 100644
--- a/grpc/src/cpp/server/server_posix.cc
+++ b/grpc/src/cpp/server/server_posix.cc
@@ -16,16 +16,18 @@
*
*/
-#include <grpcpp/server_posix.h>
-
#include <grpc/grpc_posix.h>
+#include <grpc/grpc_security.h>
+#include <grpcpp/server_posix.h>
namespace grpc {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
void AddInsecureChannelFromFd(grpc::Server* server, int fd) {
- grpc_server_add_insecure_channel_from_fd(server->c_server(), nullptr, fd);
+ grpc_server_credentials* creds = grpc_insecure_server_credentials_create();
+ grpc_server_add_channel_from_fd(server->c_server(), fd, creds);
+ grpc_server_credentials_release(creds);
}
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
diff --git a/grpc/src/cpp/server/xds_server_credentials.cc b/grpc/src/cpp/server/xds_server_credentials.cc
index b543f3f1..f1842389 100644
--- a/grpc/src/cpp/server/xds_server_credentials.cc
+++ b/grpc/src/cpp/server/xds_server_credentials.cc
@@ -19,7 +19,6 @@
#include "src/cpp/server/secure_server_credentials.h"
namespace grpc {
-namespace experimental {
std::shared_ptr<ServerCredentials> XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials) {
@@ -37,5 +36,12 @@ std::shared_ptr<ServerCredentials> XdsServerCredentials(
fallback_credentials->AsSecureServerCredentials()->c_creds()));
}
+namespace experimental {
+
+std::shared_ptr<ServerCredentials> XdsServerCredentials(
+ const std::shared_ptr<ServerCredentials>& fallback_credentials) {
+ return grpc::XdsServerCredentials(fallback_credentials);
+}
+
} // namespace experimental
} // namespace grpc
diff --git a/grpc/src/cpp/thread_manager/thread_manager.cc b/grpc/src/cpp/thread_manager/thread_manager.cc
index 5155f610..25c06558 100644
--- a/grpc/src/cpp/thread_manager/thread_manager.cc
+++ b/grpc/src/cpp/thread_manager/thread_manager.cc
@@ -21,6 +21,7 @@
#include <climits>
#include <grpc/support/log.h>
+
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -49,17 +50,16 @@ ThreadManager::WorkerThread::~WorkerThread() {
thd_.Join();
}
-ThreadManager::ThreadManager(const char* name,
- grpc_resource_quota* resource_quota,
+ThreadManager::ThreadManager(const char*, grpc_resource_quota* resource_quota,
int min_pollers, int max_pollers)
: shutdown_(false),
+ thread_quota_(
+ grpc_core::ResourceQuota::FromC(resource_quota)->thread_quota()),
num_pollers_(0),
min_pollers_(min_pollers),
max_pollers_(max_pollers == -1 ? INT_MAX : max_pollers),
num_threads_(0),
- max_active_threads_sofar_(0) {
- resource_user_ = grpc_resource_user_create(resource_quota, name);
-}
+ max_active_threads_sofar_(0) {}
ThreadManager::~ThreadManager() {
{
@@ -67,8 +67,6 @@ ThreadManager::~ThreadManager() {
GPR_ASSERT(num_threads_ == 0);
}
- grpc_core::ExecCtx exec_ctx; // grpc_resource_user_unref needs an exec_ctx
- grpc_resource_user_unref(resource_user_);
CleanupCompletedThreads();
}
@@ -109,7 +107,7 @@ void ThreadManager::MarkAsCompleted(WorkerThread* thd) {
}
// Give a thread back to the resource quota
- grpc_resource_user_free_threads(resource_user_, 1);
+ thread_quota_->Release(1);
}
void ThreadManager::CleanupCompletedThreads() {
@@ -124,7 +122,7 @@ void ThreadManager::CleanupCompletedThreads() {
}
void ThreadManager::Initialize() {
- if (!grpc_resource_user_allocate_threads(resource_user_, min_pollers_)) {
+ if (!thread_quota_->Reserve(min_pollers_)) {
gpr_log(GPR_ERROR,
"No thread quota available to even create the minimum required "
"polling threads (i.e %d). Unable to start the thread manager",
@@ -171,7 +169,7 @@ void ThreadManager::MainWorkLoop() {
// quota available to create a new thread, start a new poller thread
bool resource_exhausted = false;
if (!shutdown_ && num_pollers_ < min_pollers_) {
- if (grpc_resource_user_allocate_threads(resource_user_, 1)) {
+ if (thread_quota_->Reserve(1)) {
// We can allocate a new poller thread
num_pollers_++;
num_threads_++;
diff --git a/grpc/src/cpp/thread_manager/thread_manager.h b/grpc/src/cpp/thread_manager/thread_manager.h
index aae24177..4c49854d 100644
--- a/grpc/src/cpp/thread_manager/thread_manager.h
+++ b/grpc/src/cpp/thread_manager/thread_manager.h
@@ -22,11 +22,12 @@
#include <list>
#include <memory>
+#include <grpc/grpc.h>
#include <grpcpp/support/config.h>
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
-#include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/resource_quota/api.h"
namespace grpc {
@@ -154,7 +155,7 @@ class ThreadManager {
// object (that contains the actual max thread quota) and a grpc_resource_user
// object through which quota is requested whenever new threads need to be
// created
- grpc_resource_user* resource_user_;
+ grpc_core::ThreadQuotaPtr thread_quota_;
// Number of threads doing polling
int num_pollers_;
diff --git a/grpc/src/cpp/util/byte_buffer_cc.cc b/grpc/src/cpp/util/byte_buffer_cc.cc
index fb705906..5c6f22bd 100644
--- a/grpc/src/cpp/util/byte_buffer_cc.cc
+++ b/grpc/src/cpp/util/byte_buffer_cc.cc
@@ -25,6 +25,37 @@ namespace grpc {
static internal::GrpcLibraryInitializer g_gli_initializer;
+Status ByteBuffer::TrySingleSlice(Slice* slice) const {
+ if (!buffer_) {
+ return Status(StatusCode::FAILED_PRECONDITION, "Buffer not initialized");
+ }
+ if ((buffer_->type == GRPC_BB_RAW) &&
+ (buffer_->data.raw.compression == GRPC_COMPRESS_NONE) &&
+ (buffer_->data.raw.slice_buffer.count == 1)) {
+ grpc_slice internal_slice = buffer_->data.raw.slice_buffer.slices[0];
+ *slice = Slice(internal_slice, Slice::ADD_REF);
+ return Status::OK;
+ } else {
+ return Status(StatusCode::FAILED_PRECONDITION,
+ "Buffer isn't made up of a single uncompressed slice.");
+ }
+}
+
+Status ByteBuffer::DumpToSingleSlice(Slice* slice) const {
+ if (!buffer_) {
+ return Status(StatusCode::FAILED_PRECONDITION, "Buffer not initialized");
+ }
+ grpc_byte_buffer_reader reader;
+ if (!grpc_byte_buffer_reader_init(&reader, buffer_)) {
+ return Status(StatusCode::INTERNAL,
+ "Couldn't initialize byte buffer reader");
+ }
+ grpc_slice s = grpc_byte_buffer_reader_readall(&reader);
+ *slice = Slice(s, Slice::STEAL_REF);
+ grpc_byte_buffer_reader_destroy(&reader);
+ return Status::OK;
+}
+
Status ByteBuffer::Dump(std::vector<Slice>* slices) const {
slices->clear();
if (!buffer_) {
diff --git a/grpc/src/cpp/util/core_stats.h b/grpc/src/cpp/util/core_stats.h
index 6366d7d0..358de90f 100644
--- a/grpc/src/cpp/util/core_stats.h
+++ b/grpc/src/cpp/util/core_stats.h
@@ -19,9 +19,8 @@
#ifndef GRPC_INTERNAL_CPP_UTIL_CORE_STATS_H
#define GRPC_INTERNAL_CPP_UTIL_CORE_STATS_H
-#include "src/proto/grpc/core/stats.pb.h"
-
#include "src/core/lib/debug/stats.h"
+#include "src/proto/grpc/core/stats.pb.h"
namespace grpc {
diff --git a/grpc/src/proto/grpc/auth/v1/BUILD b/grpc/src/proto/grpc/auth/v1/BUILD
deleted file mode 100644
index 0e487b22..00000000
--- a/grpc/src/proto/grpc/auth/v1/BUILD
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-licenses(["notice"])
-
-load("@rules_proto//proto:defs.bzl", "proto_library")
-
-proto_library(
- name = "authz_policy_proto",
- srcs = [
- "authz_policy.proto",
- ],
- visibility = ["//visibility:public"],
-)
diff --git a/grpc/src/proto/grpc/auth/v1/authz_policy.proto b/grpc/src/proto/grpc/auth/v1/authz_policy.proto
deleted file mode 100644
index 347386f3..00000000
--- a/grpc/src/proto/grpc/auth/v1/authz_policy.proto
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2021 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.
-
-syntax = "proto3";
-
-package grpc.auth.v1;
-
-// Peer specifies attributes of a peer. Fields in the Peer are ANDed together, once
-// we support multiple fields in the future.
-message Peer {
- // Optional. A list of peer identities to match for authorization. The principals
- // are one of, i.e., it matches if one of the principals matches. The field
- // supports Exact, Prefix, Suffix, and Presence matches.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string principals = 1;
-}
-
-// Specification of HTTP header match attributes.
-message Header {
- // Required. The name of the HTTP header to match. The following headers are *not*
- // supported: "hop-by-hop" headers (e.g., those listed in "Connection" header),
- // HTTP/2 pseudo headers (":"-prefixed), the "Host" header, and headers prefixed
- // with "grpc-".
- string key = 1;
-
- // Required. A list of header values to match. The header values are ORed together,
- // i.e., it matches if one of the values matches. This field supports Exact,
- // Prefix, Suffix, and Presence match. Multi-valued headers are considered a single
- // value with commas added between values.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string values = 2;
-}
-
-// Request specifies attributes of a request. Fields in the Request are ANDed
-// together.
-message Request {
- // Optional. A list of paths to match for authorization. This is the fully
- // qualified name in the form of "/package.service/method". The paths are ORed
- // together, i.e., it matches if one of the paths matches. This field supports
- // Exact, Prefix, Suffix, and Presence matches.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string paths = 1;
-
- // Optional. A list of HTTP header key/value pairs to match against, for
- // potentially advanced use cases. The headers are ANDed together, i.e., it matches
- // only if *all* the headers match.
- repeated Header headers = 3;
-}
-
-// Specification of rules.
-message Rule {
- // Required. The name of an authorization rule.
- // It is mainly for monitoring and error message generation.
- string name = 1;
-
- // Optional. If not set, no checks will be performed against the source. An empty
- // rule is always matched (i.e., both source and request are empty).
- Peer source = 2;
-
- // Optional. If not set, no checks will be performed against the request. An empty
- // rule is always matched (i.e., both source and request are empty).
- Request request = 3;
-}
-
-// AuthorizationPolicy defines which principals are permitted to access which
-// resource. Resources are RPC methods scoped by services.
-//
-// In the following yaml policy example, a peer identity from ["admin1", "admin2", "admin3"]
-// is authorized to access any RPC methods in pkg.service, and peer identity "dev" is
-// authorized to access the "foo" and "bar" RPC methods.
-//
-// name: example-policy
-// allow_rules:
-// - name: admin-access
-// source:
-// principals:
-// - "spiffe://foo.com/sa/admin1"
-// - "spiffe://foo.com/sa/admin2"
-// - "spiffe://foo.com/sa/admin3"
-// request:
-// paths: ["/pkg.service/*"]
-// - name: dev-access
-// source:
-// principals: ["spiffe://foo.com/sa/dev"]
-// request:
-// paths: ["/pkg.service/foo", "/pkg.service/bar"]
-
-message AuthorizationPolicy {
- // Required. The name of an authorization policy.
- // It is mainly for monitoring and error message generation.
- string name = 1;
-
- // Optional. List of deny rules to match. If a request matches any of the deny
- // rules, then it will be denied. If none of the deny rules matches or there are
- // no deny rules, the allow rules will be evaluated.
- repeated Rule deny_rules = 2;
-
- // Required. List of allow rules to match. The allow rules will only be evaluated
- // after the deny rules. If a request matches any of the allow rules, then it will
- // allowed. If none of the allow rules matches, it will be denied.
- repeated Rule allow_rules = 3;
-}
diff --git a/grpc/src/proto/grpc/binary_log/v1alpha/log.proto b/grpc/src/proto/grpc/binary_log/v1alpha/log.proto
deleted file mode 100644
index 77100ebb..00000000
--- a/grpc/src/proto/grpc/binary_log/v1alpha/log.proto
+++ /dev/null
@@ -1,93 +0,0 @@
-// 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.
-
-syntax = "proto3";
-
-import "google/protobuf/timestamp.proto";
-
-package grpc.binary_log.v1alpha;
-
-enum Direction {
- SERVER_SEND = 0;
- SERVER_RECV = 1;
- CLIENT_SEND = 2;
- CLIENT_RECV = 3;
-}
-
-message KeyValuePair {
- string key = 1;
- string value = 2;
-}
-
-// Any sort of metadata that may be sent in either direction during a call
-message Metadata {
- // Cryptographically unique identifier, generated on the client and sent
- // to the server.
- uint64 rpc_id = 1;
- // Timestamp of logging the metadata
- google.protobuf.Timestamp timestamp = 2;
- Direction direction = 3;
- // The actual metadata that is being sent
- repeated KeyValuePair metadata = 4;
-
- // Initial metadata sent by the client to initiate a request
- message ClientInitialMetadata {
- // The full method name that is being called
- string method_name = 1;
- // The call's deadline
- google.protobuf.Timestamp deadline = 2;
- // The address of the connected peer
- string peer = 3;
- }
-
- // Arbitrary key/value pairs specified by the user that are not sent over
- // the network but are nonetheless useful to log
- message UserData {
- }
-
- // Initial metadata response sent by the server after accepting the request
- message ServerInitialMetadata {
- }
-
- // Status sent by the server when closing the call on the server side
- message ServerStatus {
- // The status code
- uint32 code = 1;
- // The status details
- string details = 2;
- }
-
- oneof kind {
- ClientInitialMetadata client_initial_metadata = 5;
- UserData user_data = 6;
- ServerInitialMetadata server_initial_metadata = 7;
- ServerStatus server_status = 8;
- }
-}
-
-// A message that is sent during a call
-message Message {
- // Cryptographically unique identifier, generated on the client and sent
- // to the server.
- uint64 rpc_id = 1;
- // The sequence number of the message. Messages sent by the client and by the
- // server should have independently incrementing sequence numbers.
- uint32 sequence_number = 2;
- Direction direction = 3;
- // The length of the complete message.
- uint32 length = 4;
- // The contents of the message. May be a prefix instead of the complete
- // message.
- bytes data = 5;
-}
diff --git a/grpc/src/proto/grpc/channelz/BUILD b/grpc/src/proto/grpc/channelz/BUILD
index 6aa9c123..9c024586 100644
--- a/grpc/src/proto/grpc/channelz/BUILD
+++ b/grpc/src/proto/grpc/channelz/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "channelz",
visibility = "public",
diff --git a/grpc/src/proto/grpc/core/BUILD b/grpc/src/proto/grpc/core/BUILD
index c79e15d6..a28519cc 100644
--- a/grpc/src/proto/grpc/core/BUILD
+++ b/grpc/src/proto/grpc/core/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
load("//bazel:python_rules.bzl", "py_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "core",
visibility = "public",
diff --git a/grpc/src/proto/grpc/gcp/BUILD b/grpc/src/proto/grpc/gcp/BUILD
index 96e287f7..3a490e9c 100644
--- a/grpc/src/proto/grpc/gcp/BUILD
+++ b/grpc/src/proto/grpc/gcp/BUILD
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("@rules_proto//proto:defs.bzl", "proto_library")
+licenses(["notice"])
+
proto_library(
name = "alts_handshaker_proto",
srcs = [
diff --git a/grpc/src/proto/grpc/health/v1/BUILD b/grpc/src/proto/grpc/health/v1/BUILD
index 9caa531c..09cd333b 100644
--- a/grpc/src/proto/grpc/health/v1/BUILD
+++ b/grpc/src/proto/grpc/health/v1/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "health",
visibility = "public",
diff --git a/grpc/src/proto/grpc/health/v1/health.options b/grpc/src/proto/grpc/health/v1/health.options
deleted file mode 100644
index 240b498b..00000000
--- a/grpc/src/proto/grpc/health/v1/health.options
+++ /dev/null
@@ -1 +0,0 @@
-grpc.health.v1.HealthCheckRequest.service max_size:200
diff --git a/grpc/src/proto/grpc/http_over_grpc/BUILD b/grpc/src/proto/grpc/http_over_grpc/BUILD
deleted file mode 100644
index 0fb10331..00000000
--- a/grpc/src/proto/grpc/http_over_grpc/BUILD
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
-
-licenses(["notice"]) # Apache v2
-
-grpc_package(
- name = "http_over_grpc",
- visibility = "public",
-)
-
-grpc_proto_library(
- name = "http_over_grpc_proto",
- srcs = [
- "http_over_grpc.proto",
- ],
- has_services = True,
- well_known_protos = True,
-)
diff --git a/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto b/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto
deleted file mode 100644
index ccfa951c..00000000
--- a/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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.
-
-syntax = "proto3";
-
-package grpc.http_over_grpc;
-
-// Represents HTTP 1.1 header.
-message Header {
- string key = 1;
- repeated string values = 2;
-}
-
-// An HTTP 1.1 request encapsulated in a gRPC.
-message HTTPOverGRPCRequest {
- // The HTTP request method.
- string method = 1;
- // The HTTP request URL.
- string url = 2;
- // The HTTP request headers.
- repeated Header headers = 3;
- // HTTP request body.
- bytes body = 4;
-}
-
-// An HTTP 1.1 reply encapsulated in an RPC.
-message HTTPOverGRPCReply {
- // The HTTP status code (e.g. 200, 400, 404).
- int32 status = 1;
- // The HTTP response headers.
- repeated Header headers = 2;
- // The HTTP response body.
- bytes body = 3;
-}
-
-// Currently does not support HTTP chunked transfer encoding.
-service HTTPOverGRPC {
- // Perform the given HTTP request.
- rpc HTTPRequest(HTTPOverGRPCRequest) returns (HTTPOverGRPCReply) {}
-}
diff --git a/grpc/src/proto/grpc/lb/v1/BUILD b/grpc/src/proto/grpc/lb/v1/BUILD
index 44ffebe1..7bfffe34 100644
--- a/grpc/src/proto/grpc/lb/v1/BUILD
+++ b/grpc/src/proto/grpc/lb/v1/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "lb",
visibility = "public",
diff --git a/grpc/src/proto/grpc/lb/v1/load_balancer.options b/grpc/src/proto/grpc/lb/v1/load_balancer.options
deleted file mode 100644
index 7fbd44b9..00000000
--- a/grpc/src/proto/grpc/lb/v1/load_balancer.options
+++ /dev/null
@@ -1,5 +0,0 @@
-grpc.lb.v1.InitialLoadBalanceRequest.name max_size:128
-grpc.lb.v1.InitialLoadBalanceResponse.load_balancer_delegate max_size:64
-grpc.lb.v1.Server.ip_address max_size:16
-grpc.lb.v1.Server.load_balance_token max_size:50
-load_balancer.proto no_unions:true
diff --git a/grpc/src/proto/grpc/lb/v1/load_balancer.proto b/grpc/src/proto/grpc/lb/v1/load_balancer.proto
index ccf2efd6..00fc7096 100644
--- a/grpc/src/proto/grpc/lb/v1/load_balancer.proto
+++ b/grpc/src/proto/grpc/lb/v1/load_balancer.proto
@@ -26,7 +26,7 @@ import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1";
option java_multiple_files = true;
option java_outer_classname = "LoadBalancerProto";
-option java_package = "io.grpc.grpclb";
+option java_package = "io.grpc.lb.v1";
service LoadBalancer {
// Bidirectional rpc to get a list of servers.
@@ -97,18 +97,14 @@ message LoadBalanceResponse {
// 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;
}
}
+message FallbackResponse {}
+
message InitialLoadBalanceResponse {
- // This is an application layer redirect that indicates the client should use
- // the specified server for load balancing. When this field is non-empty in
- // the response, the client should open a separate connection to the
- // load_balancer_delegate and call the BalanceLoad method. Its length should
- // be less than 64 bytes.
- string load_balancer_delegate = 1;
+ reserved 1; // never-used load_balancer_delegate
// This interval defines how often the client should send the client stats
// to the load balancer. Stats should only be reported when the duration is
@@ -153,5 +149,3 @@ message Server {
reserved 5;
}
-
-message FallbackResponse {}
diff --git a/grpc/src/proto/grpc/lookup/v1/BUILD b/grpc/src/proto/grpc/lookup/v1/BUILD
new file mode 100644
index 00000000..81cf765b
--- /dev/null
+++ b/grpc/src/proto/grpc/lookup/v1/BUILD
@@ -0,0 +1,48 @@
+# 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.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+
+licenses(["notice"])
+
+grpc_package(
+ name = "src/proto/grpc/lookup/v1",
+ visibility = "public",
+)
+
+grpc_proto_library(
+ name = "rls_proto",
+ srcs = ["rls.proto"],
+ well_known_protos = True,
+)
+
+grpc_proto_library(
+ name = "rls_config_proto",
+ srcs = ["rls_config.proto"],
+ well_known_protos = True,
+)
+
+proto_library(
+ name = "rls_proto_descriptor",
+ srcs = ["rls.proto"],
+)
+
+proto_library(
+ name = "rls_config_proto_descriptor",
+ srcs = ["rls_config.proto"],
+ deps = [
+ "@com_google_protobuf//:duration_proto",
+ ],
+)
diff --git a/grpc/src/proto/grpc/lookup/v1/rls.proto b/grpc/src/proto/grpc/lookup/v1/rls.proto
new file mode 100644
index 00000000..7d173528
--- /dev/null
+++ b/grpc/src/proto/grpc/lookup/v1/rls.proto
@@ -0,0 +1,62 @@
+// 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.
+
+syntax = "proto3";
+
+package grpc.lookup.v1;
+
+option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.lookup.v1";
+option java_outer_classname = "RlsProto";
+
+message RouteLookupRequest {
+ // Target type allows the client to specify what kind of target format it
+ // would like from RLS to allow it to find the regional server, e.g. "grpc".
+ string target_type = 3;
+ // Possible reasons for making a request.
+ enum Reason {
+ REASON_UNKNOWN = 0; // Unused
+ REASON_MISS = 1; // No data available in local cache
+ REASON_STALE = 2; // Data in local cache is stale
+ }
+ // Reason for making this request.
+ Reason reason = 5;
+ // For REASON_STALE, the header_data from the stale response, if any.
+ string stale_header_data = 6;
+ // Map of key values extracted via key builders for the gRPC or HTTP request.
+ map<string, string> key_map = 4;
+
+ reserved 1, 2;
+ reserved "server", "path";
+}
+
+message RouteLookupResponse {
+ // Prioritized list (best one first) of addressable entities to use
+ // for routing, using syntax requested by the request target_type.
+ // The targets will be tried in order until a healthy one is found.
+ repeated string targets = 3;
+ // Optional header value to pass along to AFE in the X-Google-RLS-Data header.
+ // Cached with "target" and sent with all requests that match the request key.
+ // Allows the RLS to pass its work product to the eventual target.
+ string header_data = 2;
+
+ reserved 1;
+ reserved "target";
+}
+
+service RouteLookupService {
+ // Lookup returns a target for a single key.
+ rpc RouteLookup(RouteLookupRequest) returns (RouteLookupResponse) {}
+}
diff --git a/grpc/src/proto/grpc/lookup/v1/rls_config.proto b/grpc/src/proto/grpc/lookup/v1/rls_config.proto
new file mode 100644
index 00000000..9d2b6c54
--- /dev/null
+++ b/grpc/src/proto/grpc/lookup/v1/rls_config.proto
@@ -0,0 +1,225 @@
+// 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.
+
+syntax = "proto3";
+
+package grpc.lookup.v1;
+
+import "google/protobuf/duration.proto";
+
+option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.lookup.v1";
+option java_outer_classname = "RlsConfigProto";
+
+// Extract a key based on a given name (e.g. header name or query parameter
+// name). The name must match one of the names listed in the "name" field. If
+// the "required_match" field is true, one of the specified names must be
+// present for the keybuilder to match.
+message NameMatcher {
+ // The name that will be used in the RLS key_map to refer to this value.
+ // If required_match is true, you may omit this field or set it to an empty
+ // string, in which case the matcher will require a match, but won't update
+ // the key_map.
+ string key = 1;
+
+ // Ordered list of names (headers or query parameter names) that can supply
+ // this value; the first one with a non-empty value is used.
+ repeated string names = 2;
+
+ // If true, make this extraction required; the key builder will not match
+ // if no value is found.
+ bool required_match = 3;
+}
+
+// A GrpcKeyBuilder applies to a given gRPC service, name, and headers.
+message GrpcKeyBuilder {
+ // To match, one of the given Name fields must match; the service and method
+ // fields are specified as fixed strings. The service name is required and
+ // includes the proto package name. The method name may be omitted, in
+ // which case any method on the given service is matched.
+ message Name {
+ string service = 1;
+ string method = 2;
+ }
+ repeated Name names = 1;
+
+ // If you wish to include the host, service, or method names as keys in the
+ // generated RouteLookupRequest, specify key names to use in the extra_keys
+ // submessage. If a key name is empty, no key will be set for that value.
+ // If this submessage is specified, the normal host/path fields will be left
+ // unset in the RouteLookupRequest. We are deprecating host/path in the
+ // RouteLookupRequest, so services should migrate to the ExtraKeys approach.
+ message ExtraKeys {
+ string host = 1;
+ string service = 2;
+ string method = 3;
+ }
+ ExtraKeys extra_keys = 3;
+
+ // Extract keys from all listed headers.
+ // For gRPC, it is an error to specify "required_match" on the NameMatcher
+ // protos.
+ repeated NameMatcher headers = 2;
+
+ // You can optionally set one or more specific key/value pairs to be added to
+ // the key_map. This can be useful to identify which builder built the key,
+ // for example if you are suppressing the actual method, but need to
+ // separately cache and request all the matched methods.
+ map<string, string> constant_keys = 4;
+}
+
+// An HttpKeyBuilder applies to a given HTTP URL and headers.
+//
+// Path and host patterns use the matching syntax from gRPC transcoding to
+// extract named key/value pairs from the path and host components of the URL:
+// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
+//
+// It is invalid to specify the same key name in multiple places in a pattern.
+//
+// For a service where the project id can be expressed either as a subdomain or
+// in the path, separate HttpKeyBuilders must be used:
+// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
+// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
+// If the host is exactly 'example.com', the first path segment will be used as
+// the id and the second segment as the object. If the host has a subdomain, the
+// subdomain will be used as the id and the first segment as the object. If
+// neither pattern matches, no keys will be extracted.
+message HttpKeyBuilder {
+ // host_pattern is an ordered list of host template patterns for the desired
+ // value. If any host_pattern values are specified, then at least one must
+ // match, and the last one wins and sets any specified variables. A host
+ // consists of labels separated by dots. Each label is matched against the
+ // label in the pattern as follows:
+ // - "*": Matches any single label.
+ // - "**": Matches zero or more labels (first or last part of host only).
+ // - "{<name>=...}": One or more label capture, where "..." can be any
+ // template that does not include a capture.
+ // - "{<name>}": A single label capture. Identical to {<name>=*}.
+ //
+ // Examples:
+ // - "example.com": Only applies to the exact host example.com.
+ // - "*.example.com": Matches subdomains of example.com.
+ // - "**.example.com": matches example.com, and all levels of subdomains.
+ // - "{project}.example.com": Extracts the third level subdomain.
+ // - "{project=**}.example.com": Extracts the third level+ subdomains.
+ // - "{project=**}": Extracts the entire host.
+ repeated string host_patterns = 1;
+
+ // path_pattern is an ordered list of path template patterns for the desired
+ // value. If any path_pattern values are specified, then at least one must
+ // match, and the last one wins and sets any specified variables. A path
+ // consists of segments separated by slashes. Each segment is matched against
+ // the segment in the pattern as follows:
+ // - "*": Matches any single segment.
+ // - "**": Matches zero or more segments (first or last part of path only).
+ // - "{<name>=...}": One or more segment capture, where "..." can be any
+ // template that does not include a capture.
+ // - "{<name>}": A single segment capture. Identical to {<name>=*}.
+ // A custom method may also be specified by appending ":" and the custom
+ // method name or "*" to indicate any custom method (including no custom
+ // method). For example, "/*/projects/{project_id}/**:*" extracts
+ // `{project_id}` for any version, resource and custom method that includes
+ // it. By default, any custom method will be matched.
+ //
+ // Examples:
+ // - "/v1/{name=messages/*}": extracts a name like "messages/12345".
+ // - "/v1/messages/{message_id}": extracts a message_id like "12345".
+ // - "/v1/users/{user_id}/messages/{message_id}": extracts two key values.
+ repeated string path_patterns = 2;
+
+ // List of query parameter names to try to match.
+ // For example: ["parent", "name", "resource.name"]
+ // We extract all the specified query_parameters (case-sensitively). If any
+ // are marked as "required_match" and are not present, this keybuilder fails
+ // to match. If a given parameter appears multiple times (?foo=a&foo=b) we
+ // will report it as a comma-separated string (foo=a,b).
+ repeated NameMatcher query_parameters = 3;
+
+ // List of headers to try to match.
+ // We extract all the specified header values (case-insensitively). If any
+ // are marked as "required_match" and are not present, this keybuilder fails
+ // to match. If a given header appears multiple times in the request we will
+ // report it as a comma-separated string, in standard HTTP fashion.
+ repeated NameMatcher headers = 4;
+
+ // You can optionally set one or more specific key/value pairs to be added to
+ // the key_map. This can be useful to identify which builder built the key,
+ // for example if you are suppressing a lot of information from the URL, but
+ // need to separately cache and request URLs with that content.
+ map<string, string> constant_keys = 5;
+}
+
+message RouteLookupConfig {
+ // Ordered specifications for constructing keys for HTTP requests. Last
+ // match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to
+ // the lookup service; it should likely reply with a global default route
+ // and raise an alert.
+ repeated HttpKeyBuilder http_keybuilders = 1;
+
+ // Unordered specifications for constructing keys for gRPC requests. All
+ // GrpcKeyBuilders on this list must have unique "name" fields so that the
+ // client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder
+ // matches, an empty key_map will be sent to the lookup service; it should
+ // likely reply with a global default route and raise an alert.
+ repeated GrpcKeyBuilder grpc_keybuilders = 2;
+
+ // The name of the lookup service as a gRPC URI. Typically, this will be
+ // a subdomain of the target, such as "lookup.datastore.googleapis.com".
+ string lookup_service = 3;
+
+ // Configure a timeout value for lookup service requests.
+ // Defaults to 10 seconds if not specified.
+ google.protobuf.Duration lookup_service_timeout = 4;
+
+ // How long are responses valid for (like HTTP Cache-Control).
+ // If omitted or zero, the longest valid cache time is used.
+ // This value is clamped to 5 minutes to avoid unflushable bad responses.
+ google.protobuf.Duration max_age = 5;
+
+ // After a response has been in the client cache for this amount of time
+ // and is re-requested, start an asynchronous RPC to re-validate it.
+ // This value should be less than max_age by at least the length of a
+ // typical RTT to the Route Lookup Service to fully mask the RTT latency.
+ // If omitted, keys are only re-requested after they have expired.
+ google.protobuf.Duration stale_age = 6;
+
+ // Rough indicator of amount of memory to use for the client cache. Some of
+ // the data structure overhead is not accounted for, so actual memory consumed
+ // will be somewhat greater than this value. If this field is omitted or set
+ // to zero, a client default will be used. The value may be capped to a lower
+ // amount based on client configuration.
+ int64 cache_size_bytes = 7;
+
+ // This is a list of all the possible targets that can be returned by the
+ // lookup service. If a target not on this list is returned, it will be
+ // treated the same as an unhealthy target.
+ repeated string valid_targets = 8;
+
+ // This value provides a default target to use if needed. If set, it will be
+ // used if RLS returns an error, times out, or returns an invalid response.
+ // Note that requests can be routed only to a subdomain of the original
+ // target, e.g. "us_east_1.cloudbigtable.googleapis.com".
+ string default_target = 9;
+
+ reserved 10;
+ reserved "request_processing_strategy";
+}
+
+// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier
+// plugin for RLS.
+message RouteLookupClusterSpecifier {
+ // The RLS config for this cluster specifier plugin instance.
+ RouteLookupConfig route_lookup_config = 1;
+}
diff --git a/grpc/src/proto/grpc/reflection/v1/BUILD b/grpc/src/proto/grpc/reflection/v1/BUILD
new file mode 100644
index 00000000..09f78a70
--- /dev/null
+++ b/grpc/src/proto/grpc/reflection/v1/BUILD
@@ -0,0 +1,40 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+
+licenses(["notice"])
+
+grpc_package(
+ name = "reflection_v1",
+ visibility = "public",
+)
+
+grpc_proto_library(
+ name = "reflection_proto",
+ srcs = ["reflection.proto"],
+)
+
+proto_library(
+ name = "reflection_proto_descriptor",
+ srcs = ["reflection.proto"],
+)
+
+filegroup(
+ name = "reflection_proto_file",
+ srcs = [
+ "reflection.proto",
+ ],
+)
diff --git a/grpc/src/proto/grpc/reflection/v1/reflection.proto b/grpc/src/proto/grpc/reflection/v1/reflection.proto
new file mode 100644
index 00000000..1a2ceedc
--- /dev/null
+++ b/grpc/src/proto/grpc/reflection/v1/reflection.proto
@@ -0,0 +1,147 @@
+// Copyright 2016 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.
+
+// Service exported by server reflection. A more complete description of how
+// server reflection works can be found at
+// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
+//
+// The canonical version of this proto can be found at
+// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
+
+syntax = "proto3";
+
+package grpc.reflection.v1;
+
+option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.reflection.v1";
+option java_outer_classname = "ServerReflectionProto";
+
+service ServerReflection {
+ // The reflection service is structured as a bidirectional stream, ensuring
+ // all related requests go to a single server.
+ rpc ServerReflectionInfo(stream ServerReflectionRequest)
+ returns (stream ServerReflectionResponse);
+}
+
+// The message sent by the client when calling ServerReflectionInfo method.
+message ServerReflectionRequest {
+ string host = 1;
+ // To use reflection service, the client should set one of the following
+ // fields in message_request. The server distinguishes requests by their
+ // defined field and then handles them using corresponding methods.
+ oneof message_request {
+ // Find a proto file by the file name.
+ string file_by_filename = 3;
+
+ // Find the proto file that declares the given fully-qualified symbol name.
+ // This field should be a fully-qualified symbol name
+ // (e.g. <package>.<service>[.<method>] or <package>.<type>).
+ string file_containing_symbol = 4;
+
+ // Find the proto file which defines an extension extending the given
+ // message type with the given field number.
+ ExtensionRequest file_containing_extension = 5;
+
+ // Finds the tag numbers used by all known extensions of the given message
+ // type, and appends them to ExtensionNumberResponse in an undefined order.
+ // Its corresponding method is best-effort: it's not guaranteed that the
+ // reflection service will implement this method, and it's not guaranteed
+ // that this method will provide all extensions. Returns
+ // StatusCode::UNIMPLEMENTED if it's not implemented.
+ // This field should be a fully-qualified type name. The format is
+ // <package>.<type>
+ string all_extension_numbers_of_type = 6;
+
+ // List the full names of registered services. The content will not be
+ // checked.
+ string list_services = 7;
+ }
+}
+
+// The type name and extension number sent by the client when requesting
+// file_containing_extension.
+message ExtensionRequest {
+ // Fully-qualified type name. The format should be <package>.<type>
+ string containing_type = 1;
+ int32 extension_number = 2;
+}
+
+// The message sent by the server to answer ServerReflectionInfo method.
+message ServerReflectionResponse {
+ string valid_host = 1;
+ ServerReflectionRequest original_request = 2;
+ // The server sets one of the following fields according to the message_request
+ // in the request.
+ oneof message_response {
+ // This message is used to answer file_by_filename, file_containing_symbol,
+ // file_containing_extension requests with transitive dependencies.
+ // As the repeated label is not allowed in oneof fields, we use a
+ // FileDescriptorResponse message to encapsulate the repeated fields.
+ // The reflection service is allowed to avoid sending FileDescriptorProtos
+ // that were previously sent in response to earlier requests in the stream.
+ FileDescriptorResponse file_descriptor_response = 4;
+
+ // This message is used to answer all_extension_numbers_of_type requests.
+ ExtensionNumberResponse all_extension_numbers_response = 5;
+
+ // This message is used to answer list_services requests.
+ ListServiceResponse list_services_response = 6;
+
+ // This message is used when an error occurs.
+ ErrorResponse error_response = 7;
+ }
+}
+
+// Serialized FileDescriptorProto messages sent by the server answering
+// a file_by_filename, file_containing_symbol, or file_containing_extension
+// request.
+message FileDescriptorResponse {
+ // Serialized FileDescriptorProto messages. We avoid taking a dependency on
+ // descriptor.proto, which uses proto2 only features, by making them opaque
+ // bytes instead.
+ repeated bytes file_descriptor_proto = 1;
+}
+
+// A list of extension numbers sent by the server answering
+// all_extension_numbers_of_type request.
+message ExtensionNumberResponse {
+ // Full name of the base type, including the package name. The format
+ // is <package>.<type>
+ string base_type_name = 1;
+ repeated int32 extension_number = 2;
+}
+
+// A list of ServiceResponse sent by the server answering list_services request.
+message ListServiceResponse {
+ // The information of each service may be expanded in the future, so we use
+ // ServiceResponse message to encapsulate it.
+ repeated ServiceResponse service = 1;
+}
+
+// The information of a single service used by ListServiceResponse to answer
+// list_services request.
+message ServiceResponse {
+ // Full name of a registered service, including its package name. The format
+ // is <package>.<service>
+ string name = 1;
+}
+
+// The error code and error message sent by the server when an error occurs.
+message ErrorResponse {
+ // This field uses the error codes defined in grpc::StatusCode.
+ int32 error_code = 1;
+ string error_message = 2;
+}
+
diff --git a/grpc/src/proto/grpc/reflection/v1alpha/BUILD b/grpc/src/proto/grpc/reflection/v1alpha/BUILD
index e7824558..1c125225 100644
--- a/grpc/src/proto/grpc/reflection/v1alpha/BUILD
+++ b/grpc/src/proto/grpc/reflection/v1alpha/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "reflection",
visibility = "public",
diff --git a/grpc/src/proto/grpc/status/BUILD b/grpc/src/proto/grpc/status/BUILD
index ed8c29ca..fd17ef51 100644
--- a/grpc/src/proto/grpc/status/BUILD
+++ b/grpc/src/proto/grpc/status/BUILD
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "status",
visibility = "public",
diff --git a/grpc/src/proto/grpc/testing/BUILD b/grpc/src/proto/grpc/testing/BUILD
index c67a7f81..4646da2d 100644
--- a/grpc/src/proto/grpc/testing/BUILD
+++ b/grpc/src/proto/grpc/testing/BUILD
@@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
-load("@grpc_python_dependencies//:requirements.bzl", "requirement")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "testing",
visibility = "public",
@@ -43,6 +42,7 @@ grpc_proto_library(
name = "control_proto",
srcs = ["control.proto"],
has_services = False,
+ well_known_protos = True,
deps = [
"payloads_proto",
"stats_proto",
@@ -278,6 +278,7 @@ proto_library(
deps = [
":payloads_descriptor",
":stats_descriptor",
+ "@com_google_protobuf//:timestamp_proto",
],
)
diff --git a/grpc/src/proto/grpc/testing/control.proto b/grpc/src/proto/grpc/testing/control.proto
index 742b2192..0cdd4060 100644
--- a/grpc/src/proto/grpc/testing/control.proto
+++ b/grpc/src/proto/grpc/testing/control.proto
@@ -16,6 +16,7 @@ syntax = "proto3";
import "src/proto/grpc/testing/payloads.proto";
import "src/proto/grpc/testing/stats.proto";
+import "google/protobuf/timestamp.proto";
package grpc.testing;
@@ -265,6 +266,11 @@ message ScenarioResultSummary
// Queries per CPU-sec over all servers or clients
double server_queries_per_cpu_sec = 17;
double client_queries_per_cpu_sec = 18;
+
+
+ // Start and end time for the test scenario
+ google.protobuf.Timestamp start_time = 19;
+ google.protobuf.Timestamp end_time =20;
}
// Results of a single benchmark scenario.
diff --git a/grpc/src/proto/grpc/testing/duplicate/BUILD b/grpc/src/proto/grpc/testing/duplicate/BUILD
index d7902c1c..6f7abbc8 100644
--- a/grpc/src/proto/grpc/testing/duplicate/BUILD
+++ b/grpc/src/proto/grpc/testing/duplicate/BUILD
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "duplicate",
visibility = "public",
diff --git a/grpc/src/proto/grpc/testing/echo.proto b/grpc/src/proto/grpc/testing/echo.proto
index c4233035..4c8f2c56 100644
--- a/grpc/src/proto/grpc/testing/echo.proto
+++ b/grpc/src/proto/grpc/testing/echo.proto
@@ -33,6 +33,7 @@ service EchoTestService {
rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
rpc Unimplemented(EchoRequest) returns (EchoResponse);
+ rpc UnimplementedBidi(stream EchoRequest) returns (stream EchoResponse);
}
service EchoTest1Service {
diff --git a/grpc/src/proto/grpc/testing/proto2/BUILD.bazel b/grpc/src/proto/grpc/testing/proto2/BUILD.bazel
index a28c1b2a..d5ffa13a 100644
--- a/grpc/src/proto/grpc/testing/proto2/BUILD.bazel
+++ b/grpc/src/proto/grpc/testing/proto2/BUILD.bazel
@@ -1,10 +1,21 @@
+# Copyright 2021 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.
load("@rules_proto//proto:defs.bzl", "proto_library")
-load("@grpc_python_dependencies//:requirements.bzl", "requirement")
+load("//bazel:python_rules.bzl", "py_proto_library")
package(default_visibility = ["//visibility:public"])
-load("//bazel:python_rules.bzl", "py_proto_library")
-
proto_library(
name = "empty2_proto_descriptor",
srcs = ["empty2.proto"],
diff --git a/grpc/src/proto/grpc/testing/xds/BUILD b/grpc/src/proto/grpc/testing/xds/BUILD
index 5dd57959..e854b582 100644
--- a/grpc/src/proto/grpc/testing/xds/BUILD
+++ b/grpc/src/proto/grpc/testing/xds/BUILD
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "xds",
visibility = "public",
@@ -69,10 +69,3 @@ grpc_proto_library(
well_known_protos = True,
deps = ["eds_for_test_proto"],
)
-
-grpc_proto_library(
- name = "orca_load_report_for_test_proto",
- srcs = [
- "orca_load_report_for_test.proto",
- ],
-)
diff --git a/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto b/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto
deleted file mode 100644
index 1feaedd6..00000000
--- a/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto
+++ /dev/null
@@ -1,58 +0,0 @@
-// 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 a copy of the ORCA load reporting protos, with the
-// validation options stripped out to avoid the extra dependency on
-// protoc-gen-validate.
-//
-// 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 udpa.data.orca.v1;
-
-option java_outer_classname = "OrcaLoadReportProto";
-option java_multiple_files = true;
-option java_package = "io.envoyproxy.udpa.data.orca.v1";
-option go_package = "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/grpc/src/proto/grpc/testing/xds/v3/BUILD b/grpc/src/proto/grpc/testing/xds/v3/BUILD
index be730dea..87f6f997 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/BUILD
+++ b/grpc/src/proto/grpc/testing/xds/v3/BUILD
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
-
load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
+licenses(["notice"])
+
grpc_package(
name = "xds_v3",
visibility = "public",
@@ -87,6 +87,7 @@ grpc_proto_library(
deps = [
"base_proto",
"config_source_proto",
+ "endpoint_proto",
],
)
@@ -104,6 +105,25 @@ grpc_proto_library(
)
grpc_proto_library(
+ name = "extension_proto",
+ srcs = [
+ "extension.proto",
+ ],
+ well_known_protos = True,
+)
+
+grpc_proto_library(
+ name = "path_proto",
+ srcs = [
+ "path.proto",
+ ],
+ well_known_protos = True,
+ deps = [
+ "string_proto",
+ ],
+)
+
+grpc_proto_library(
name = "listener_proto",
srcs = [
"listener.proto",
@@ -148,6 +168,18 @@ grpc_proto_library(
)
grpc_proto_library(
+ name = "orca_service_proto",
+ srcs = [
+ "orca_service.proto",
+ ],
+ has_services = True,
+ well_known_protos = True,
+ deps = [
+ "orca_load_report_proto",
+ ],
+)
+
+grpc_proto_library(
name = "protocol_proto",
srcs = [
"protocol.proto",
@@ -177,6 +209,7 @@ grpc_proto_library(
well_known_protos = True,
deps = [
"base_proto",
+ "extension_proto",
"percent_proto",
"range_proto",
"regex_proto",
@@ -191,6 +224,7 @@ grpc_proto_library(
well_known_protos = True,
deps = [
"config_source_proto",
+ "extension_proto",
"protocol_proto",
"route_proto",
],
@@ -243,6 +277,8 @@ grpc_proto_library(
],
well_known_protos = True,
deps = [
+ "base_proto",
+ "extension_proto",
"string_proto",
],
)
@@ -280,6 +316,51 @@ grpc_proto_library(
],
)
+grpc_proto_library(
+ name = "metadata_proto",
+ srcs = [
+ "metadata.proto",
+ ],
+ well_known_protos = True,
+)
+
+grpc_proto_library(
+ name = "expr_proto",
+ srcs = [
+ "expr.proto",
+ ],
+ well_known_protos = True,
+)
+
+grpc_proto_library(
+ name = "rbac_proto",
+ srcs = [
+ "rbac.proto",
+ ],
+ well_known_protos = True,
+ deps = [
+ "address_proto",
+ "expr_proto",
+ "extension_proto",
+ "metadata_proto",
+ "path_proto",
+ "range_proto",
+ "route_proto",
+ "string_proto",
+ ],
+)
+
+grpc_proto_library(
+ name = "http_filter_rbac_proto",
+ srcs = [
+ "http_filter_rbac.proto",
+ ],
+ well_known_protos = True,
+ deps = [
+ "rbac_proto",
+ ],
+)
+
py_proto_library(
name = "csds_py_pb2",
deps = [":_csds_proto_only"],
diff --git a/grpc/src/proto/grpc/testing/xds/v3/address.proto b/grpc/src/proto/grpc/testing/xds/v3/address.proto
index 38592ccf..47efbed8 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/address.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/address.proto
@@ -40,6 +40,13 @@ message SocketAddress {
oneof port_specifier {
uint32 port_value = 3;
}
+
+ // The name of the custom resolver. This must have been registered with Envoy. If
+ // this is empty, a context dependent default applies. If the address is a concrete
+ // IP address, no resolution will occur. If address is a hostname this
+ // should be set for resolution other than DNS. Specifying a custom resolver with
+ // *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime.
+ string resolver_name = 5;
}
// Addresses specify either a logical or physical address and port, which are
diff --git a/grpc/src/proto/grpc/testing/xds/v3/ads.proto b/grpc/src/proto/grpc/testing/xds/v3/ads.proto
index d576c1dd..4688aeed 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/ads.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/ads.proto
@@ -40,6 +40,6 @@ service AggregatedDiscoveryService {
}
// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
-// services: https://github.com/google/protobuf/issues/4221
+// services: https://github.com/protocolbuffers/protobuf/issues/4221
message AdsPhony {
}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/base.proto b/grpc/src/proto/grpc/testing/xds/v3/base.proto
index b5acb094..33719f68 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/base.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/base.proto
@@ -96,6 +96,9 @@ message Node {
repeated string client_features = 10;
}
+// Data source consisting of either a file or an inline value.
+message DataSource {}
+
// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not
// specified via a runtime key.
//
diff --git a/grpc/src/proto/grpc/testing/xds/v3/cluster.proto b/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
index c04fe20a..1bc2d51b 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
@@ -20,6 +20,7 @@ package envoy.config.cluster.v3;
import "src/proto/grpc/testing/xds/v3/base.proto";
import "src/proto/grpc/testing/xds/v3/config_source.proto";
+import "src/proto/grpc/testing/xds/v3/endpoint.proto";
import "google/protobuf/any.proto";
import "google/protobuf/wrappers.proto";
@@ -153,12 +154,63 @@ message Cluster {
// Configuration to use for EDS updates for the Cluster.
EdsClusterConfig eds_cluster_config = 3;
+ // Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>`
+ // load balancing policy.
+ message RingHashLbConfig {
+ // The hash function used to hash hosts onto the ketama ring.
+ enum HashFunction {
+ // Use `xxHash <https://github.com/Cyan4973/xxHash>`_, this is the default hash function.
+ XX_HASH = 0;
+ MURMUR_HASH_2 = 1;
+ }
+
+ reserved 2;
+
+ // Minimum hash ring size. The larger the ring is (that is, the more hashes there are for each
+ // provided host) the better the request distribution will reflect the desired weights. Defaults
+ // to 1024 entries, and limited to 8M entries. See also
+ // :ref:`maximum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.maximum_ring_size>`.
+ google.protobuf.UInt64Value minimum_ring_size = 1;
+
+ // The hash function used to hash hosts onto the ketama ring. The value defaults to
+ // :ref:`XX_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.RingHashLbConfig.HashFunction.XX_HASH>`.
+ HashFunction hash_function = 3;
+
+ // Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries, but can be lowered
+ // to further constrain resource use. See also
+ // :ref:`minimum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.minimum_ring_size>`.
+ google.protobuf.UInt64Value maximum_ring_size = 4;
+ }
+
// The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
// when picking a host in the cluster.
LbPolicy lb_policy = 6;
+ // Setting this is required for specifying members of
+ // :ref:`STATIC<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STATIC>`,
+ // :ref:`STRICT_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`
+ // or :ref:`LOGICAL_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` clusters.
+ // This field supersedes the *hosts* field in the v2 API.
+ //
+ // .. attention::
+ //
+ // Setting this allows non-EDS cluster types to contain embedded EDS equivalent
+ // :ref:`endpoint assignments<envoy_api_msg_config.endpoint.v3.ClusterLoadAssignment>`.
+ //
+ endpoint.v3.ClusterLoadAssignment load_assignment = 33;
+
CircuitBreakers circuit_breakers = 10;
+ // Optional configuration for the load balancing algorithm selected by
+ // LbPolicy. Currently only
+ // :ref:`RING_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.LbPolicy.RING_HASH>`,
+ // Specifying ring_hash_lb_config without setting the corresponding
+ // LbPolicy will generate an error at runtime.
+ oneof lb_config {
+ // Optional configuration for the Ring Hash load balancing policy.
+ RingHashLbConfig ring_hash_lb_config = 23;
+ }
+
// Optional custom transport socket implementation to use for upstream connections.
// To setup TLS, set a transport socket with name `tls` and
// :ref:`UpstreamTlsContexts <envoy_api_msg_extensions.transport_sockets.tls.v3.UpstreamTlsContext>` in the `typed_config`.
diff --git a/grpc/src/proto/grpc/testing/xds/v3/csds.proto b/grpc/src/proto/grpc/testing/xds/v3/csds.proto
index bbdfd4e0..79b8bc8b 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/csds.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/csds.proto
@@ -21,6 +21,9 @@ package envoy.service.status.v3;
import "src/proto/grpc/testing/xds/v3/config_dump.proto";
import "src/proto/grpc/testing/xds/v3/base.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
+
// CSDS is Client Status Discovery Service. It can be used to get the status of
// an xDS-compliant client from the management server's point of view. It can
@@ -77,10 +80,58 @@ message PerXdsConfig {
// All xds configs for a particular client.
message ClientConfig {
+ // GenericXdsConfig is used to specify the config status and the dump
+ // of any xDS resource identified by their type URL. It is the generalized
+ // version of the now deprecated ListenersConfigDump, ClustersConfigDump etc
+ // [#next-free-field: 10]
+ message GenericXdsConfig {
+ // Type_url represents the fully qualified name of xDS resource type
+ // like envoy.v3.Cluster, envoy.v3.ClusterLoadAssignment etc.
+ string type_url = 1;
+
+ // Name of the xDS resource
+ string name = 2;
+
+ // This is the :ref:`version_info <envoy_v3_api_field_service.discovery.v3.DiscoveryResponse.version_info>`
+ // in the last processed xDS discovery response. If there are only
+ // static bootstrap listeners, this field will be ""
+ string version_info = 3;
+
+ // The xDS resource config. Actual content depends on the type
+ google.protobuf.Any xds_config = 4;
+
+ // Timestamp when the xDS resource was last updated
+ google.protobuf.Timestamp last_updated = 5;
+
+ // Per xDS resource config status. It is generated by management servers.
+ // It will not be present if the CSDS server is an xDS client.
+ ConfigStatus config_status = 6;
+
+ // Per xDS resource status from the view of a xDS client
+ admin.v3.ClientResourceStatus client_status = 7;
+
+ // Set if the last update failed, cleared after the next successful
+ // update. The *error_state* field contains the rejected version of
+ // this particular resource along with the reason and timestamp. For
+ // successfully updated or acknowledged resource, this field should
+ // be empty.
+ admin.v3.UpdateFailureState error_state = 8;
+
+ // Is static resource is true if it is specified in the config supplied
+ // through the file at the startup.
+ bool is_static_resource = 9;
+ }
+
// Node for a particular client.
config.core.v3.Node node = 1;
- repeated PerXdsConfig xds_config = 2;
+ // This field is deprecated in favor of generic_xds_configs which is
+ // much simpler and uniform in structure.
+ repeated PerXdsConfig xds_config = 2 [deprecated = true];
+
+ // Represents generic xDS config and the exact config structure depends on
+ // the type URL (like Cluster if it is CDS)
+ repeated GenericXdsConfig generic_xds_configs = 3;
}
message ClientStatusResponse {
diff --git a/grpc/src/proto/grpc/testing/xds/v3/discovery.proto b/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
index 2a697d96..f7335c3b 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/discovery.proto
@@ -21,6 +21,7 @@ package envoy.service.discovery.v3;
import "src/proto/grpc/testing/xds/v3/base.proto";
import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
message Status {
// The status code, which should be an enum value of [google.rpc.Code][].
@@ -120,3 +121,47 @@ message DiscoveryResponse {
// required for non-stream based xDS implementations.
string nonce = 5;
}
+
+// [#next-free-field: 8]
+message Resource {
+ // Cache control properties for the resource.
+ // [#not-implemented-hide:]
+ message CacheControl {
+ // If true, xDS proxies may not cache this resource.
+ // Note that this does not apply to clients other than xDS proxies, which must cache resources
+ // for their own use, regardless of the value of this field.
+ bool do_not_cache = 1;
+ }
+
+ // The resource's name, to distinguish it from others of the same type of resource.
+ string name = 3;
+
+ // The aliases are a list of other names that this resource can go by.
+ repeated string aliases = 4;
+
+ // The resource level version. It allows xDS to track the state of individual
+ // resources.
+ string version = 1;
+
+ // The resource being tracked.
+ google.protobuf.Any resource = 2;
+
+ // Time-to-live value for the resource. For each resource, a timer is started. The timer is
+ // reset each time the resource is received with a new TTL. If the resource is received with
+ // no TTL set, the timer is removed for the resource. Upon expiration of the timer, the
+ // configuration for the resource will be removed.
+ //
+ // The TTL can be refreshed or changed by sending a response that doesn't change the resource
+ // version. In this case the resource field does not need to be populated, which allows for
+ // light-weight "heartbeat" updates to keep a resource with a TTL alive.
+ //
+ // The TTL feature is meant to support configurations that should be removed in the event of
+ // a management server failure. For example, the feature may be used for fault injection
+ // testing where the fault injection should be terminated in the event that Envoy loses contact
+ // with the management server.
+ google.protobuf.Duration ttl = 6;
+
+ // Cache control properties for the resource.
+ // [#not-implemented-hide:]
+ CacheControl cache_control = 7;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto b/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
index 7cc1d40c..7cbea7f4 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
@@ -76,6 +76,17 @@ message LbEndpoint {
// Optional health status when known and supplied by EDS server.
HealthStatus health_status = 2;
+
+ // The optional load balancing weight of the upstream host; at least 1.
+ // Envoy uses the load balancing weight in some of the built in load
+ // balancers. The load balancing weight for an endpoint is divided by the sum
+ // of the weights of all endpoints in the endpoint's locality to produce a
+ // percentage of traffic for the endpoint. This percentage is then further
+ // weighted by the endpoint's locality's load balancing weight from
+ // LocalityLbEndpoints. If unspecified, each host is presumed to have equal
+ // weight in a locality. The sum of the weights of all endpoints in the
+ // endpoint's locality must not exceed uint32_t maximal value (4294967295).
+ google.protobuf.UInt32Value load_balancing_weight = 4;
}
// A group of endpoints belonging to a Locality.
diff --git a/grpc/src/proto/grpc/testing/xds/v3/expr.proto b/grpc/src/proto/grpc/testing/xds/v3/expr.proto
new file mode 100644
index 00000000..b97fb15b
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/expr.proto
@@ -0,0 +1,29 @@
+// Copyright 2021 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.
+
+// We would ideally just use the proto file from the googleapis submodule, but
+// that breaks the expectations of the CMake build system - gRPC C++ needs to
+// stay buildable/installable even if the submodules are not present (e.g. the
+// tar.gz archive with gRPC doesn't contain the submodules), assuming that the
+// dependencies are already installed. Given that this is needed for a test we
+// could probably say that this test does not build for CMake but that way we
+// would lose the ability to test xds_end2end_test for portability.
+
+syntax = "proto3";
+
+package google.api.expr.v1alpha1;
+
+message Expr {}
+
+message CheckedExpr {}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/extension.proto b/grpc/src/proto/grpc/testing/xds/v3/extension.proto
new file mode 100644
index 00000000..10f4b002
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/extension.proto
@@ -0,0 +1,38 @@
+// Copyright 2021 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 "google/protobuf/any.proto";
+
+// [#protodoc-title: Extension configuration]
+
+// Message type for extension configuration.
+// [#next-major-version: revisit all existing typed_config that doesn't use this wrapper.].
+message TypedExtensionConfig {
+ // The name of an extension. This is not used to select the extension, instead
+ // it serves the role of an opaque identifier.
+ string name = 1;
+
+ // The typed config for the extension. The type URL will be used to identify
+ // the extension. In the case that the type URL is *udpa.type.v1.TypedStruct*,
+ // the inner type URL of *TypedStruct* will be utilized. See the
+ // :ref:`extension configuration overview
+ // <config_overview_extension_configuration>` for further details.
+ google.protobuf.Any typed_config = 2;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto b/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
index 74477073..a8d3ea49 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/http_connection_manager.proto
@@ -21,6 +21,7 @@ package envoy.extensions.filters.network.http_connection_manager.v3;
import "google/protobuf/any.proto";
import "src/proto/grpc/testing/xds/v3/config_source.proto";
+import "src/proto/grpc/testing/xds/v3/extension.proto";
import "src/proto/grpc/testing/xds/v3/protocol.proto";
import "src/proto/grpc/testing/xds/v3/route.proto";
@@ -50,6 +51,32 @@ message HttpConnectionManager {
// Additional settings for HTTP requests handled by the connection manager. These will be
// applicable to both HTTP1 and HTTP2 requests.
config.core.v3.HttpProtocolOptions common_http_protocol_options = 35;
+
+ // The number of additional ingress proxy hops from the right side of the
+ // :ref:`config_http_conn_man_headers_x-forwarded-for` HTTP header to trust when
+ // determining the origin client's IP address. The default is zero if this option
+ // is not specified. See the documentation for
+ // :ref:`config_http_conn_man_headers_x-forwarded-for` for more information.
+ uint32 xff_num_trusted_hops = 19;
+
+ // The configuration for the original IP detection extensions.
+ //
+ // When configured the extensions will be called along with the request headers
+ // and information about the downstream connection, such as the directly connected address.
+ // Each extension will then use these parameters to decide the request's effective remote address.
+ // If an extension fails to detect the original IP address and isn't configured to reject
+ // the request, the HCM will try the remaining extensions until one succeeds or rejects
+ // the request. If the request isn't rejected nor any extension succeeds, the HCM will
+ // fallback to using the remote address.
+ //
+ // .. WARNING::
+ // Extensions cannot be used in conjunction with :ref:`use_remote_address
+ // <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address>`
+ // nor :ref:`xff_num_trusted_hops
+ // <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.xff_num_trusted_hops>`.
+ //
+ // [#extension-category: envoy.http.original_ip_detection]
+ repeated config.core.v3.TypedExtensionConfig original_ip_detection_extensions = 46;
}
message Rds {
diff --git a/grpc/src/proto/grpc/testing/xds/v3/http_filter_rbac.proto b/grpc/src/proto/grpc/testing/xds/v3/http_filter_rbac.proto
new file mode 100644
index 00000000..03d5f7b2
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/http_filter_rbac.proto
@@ -0,0 +1,41 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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.http.rbac.v3;
+
+import "src/proto/grpc/testing/xds/v3/rbac.proto";
+
+// [#protodoc-title: RBAC]
+// Role-Based Access Control :ref:`configuration overview <config_http_filters_rbac>`.
+// [#extension: envoy.filters.http.rbac]
+
+// RBAC filter config.
+message RBAC {
+ // Specify the RBAC rules to be applied globally.
+ // If absent, no enforcing RBAC policy will be applied.
+ // If present and empty, DENY.
+ config.rbac.v3.RBAC rules = 1;
+}
+
+message RBACPerRoute {
+ // Override the global configuration of the filter with this new config.
+ // If absent, the global RBAC policy will be disabled for this route.
+ RBAC rbac = 2;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/metadata.proto b/grpc/src/proto/grpc/testing/xds/v3/metadata.proto
new file mode 100644
index 00000000..ea51d89d
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/metadata.proto
@@ -0,0 +1,86 @@
+// Copyright 2021 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: Metadata matcher]
+
+// MetadataMatcher provides a general interface to check if a given value is matched in
+// :ref:`Metadata <envoy_v3_api_msg_config.core.v3.Metadata>`. It uses `filter` and `path` to retrieve the value
+// from the Metadata and then check if it's matched to the specified value.
+//
+// For example, for the following Metadata:
+//
+// .. code-block:: yaml
+//
+// filter_metadata:
+// envoy.filters.http.rbac:
+// fields:
+// a:
+// struct_value:
+// fields:
+// b:
+// struct_value:
+// fields:
+// c:
+// string_value: pro
+// t:
+// list_value:
+// values:
+// - string_value: m
+// - string_value: n
+//
+// The following MetadataMatcher is matched as the path [a, b, c] will retrieve a string value "pro"
+// from the Metadata which is matched to the specified prefix match.
+//
+// .. code-block:: yaml
+//
+// filter: envoy.filters.http.rbac
+// path:
+// - key: a
+// - key: b
+// - key: c
+// value:
+// string_match:
+// prefix: pr
+//
+// The following MetadataMatcher is matched as the code will match one of the string values in the
+// list at the path [a, t].
+//
+// .. code-block:: yaml
+//
+// filter: envoy.filters.http.rbac
+// path:
+// - key: a
+// - key: t
+// value:
+// list_match:
+// one_of:
+// string_match:
+// exact: m
+//
+// An example use of MetadataMatcher is specifying additional metadata in envoy.filters.http.rbac to
+// enforce access control based on dynamic metadata in a request. See :ref:`Permission
+// <envoy_v3_api_msg_config.rbac.v3.Permission>` and :ref:`Principal
+// <envoy_v3_api_msg_config.rbac.v3.Principal>`.
+
+// [#next-major-version: MetadataMatcher should use StructMatcher]
+message MetadataMatcher {
+ // If true, the match result will be inverted.
+ bool invert = 4;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto b/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
index 0d6a1699..033e64ba 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
@@ -16,7 +16,7 @@
syntax = "proto3";
-package udpa.data.orca.v1;
+package xds.data.orca.v3;
// See section `ORCA load report format` of the design document in
// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
diff --git a/grpc/src/proto/grpc/testing/xds/v3/orca_service.proto b/grpc/src/proto/grpc/testing/xds/v3/orca_service.proto
new file mode 100644
index 00000000..4ba5a46e
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/orca_service.proto
@@ -0,0 +1,47 @@
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 xds.service.orca.v3;
+
+import "src/proto/grpc/testing/xds/v3/orca_load_report.proto";
+
+import "google/protobuf/duration.proto";
+
+// See section `Out-of-band (OOB) reporting` of the design document in
+// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
+
+// Out-of-band (OOB) load reporting service for the additional load reporting
+// agent that does not sit in the request path. Reports are periodically sampled
+// with sufficient frequency to provide temporal association with requests.
+// OOB reporting compensates the limitation of in-band reporting in revealing
+// costs for backends that do not provide a steady stream of telemetry such as
+// long running stream operations and zero QPS services. This is a server
+// streaming service, client needs to terminate current RPC and initiate
+// a new call to change backend reporting frequency.
+service OpenRcaService {
+ rpc StreamCoreMetrics(OrcaLoadReportRequest) returns (stream xds.data.orca.v3.OrcaLoadReport);
+}
+
+message OrcaLoadReportRequest {
+ // Interval for generating Open RCA core metric responses.
+ google.protobuf.Duration report_interval = 1;
+ // Request costs to collect. If this is empty, all known requests costs tracked by
+ // the load reporting agent will be returned. This provides an opportunity for
+ // the client to selectively obtain a subset of tracked costs.
+ repeated string request_cost_names = 2;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/path.proto b/grpc/src/proto/grpc/testing/xds/v3/path.proto
new file mode 100644
index 00000000..18f3421b
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/path.proto
@@ -0,0 +1,35 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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;
+
+import "src/proto/grpc/testing/xds/v3/string.proto";
+
+// [#protodoc-title: Path matcher]
+
+// Specifies the way to match a path on HTTP request.
+message PathMatcher {
+ oneof rule {
+ // The `path` must match the URL path portion of the :path header. The query and fragment
+ // string (if present) are removed in the URL path portion.
+ // For example, the path */data* will match the *:path* header */data#fragment?param=value*.
+ StringMatcher path = 1;
+ }
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/range.proto b/grpc/src/proto/grpc/testing/xds/v3/range.proto
index 5fe5530e..e9a94422 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/range.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/range.proto
@@ -29,3 +29,13 @@ message Int64Range {
// end of the range (exclusive)
int64 end = 2;
}
+
+// Specifies the int32 start and end of the range using half-open interval semantics [start,
+// end).
+message Int32Range {
+ // start of the range (inclusive)
+ int32 start = 1;
+
+ // end of the range (exclusive)
+ int32 end = 2;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/rbac.proto b/grpc/src/proto/grpc/testing/xds/v3/rbac.proto
new file mode 100644
index 00000000..d9f2213b
--- /dev/null
+++ b/grpc/src/proto/grpc/testing/xds/v3/rbac.proto
@@ -0,0 +1,293 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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.rbac.v3;
+
+import "src/proto/grpc/testing/xds/v3/address.proto";
+import "src/proto/grpc/testing/xds/v3/extension.proto";
+import "src/proto/grpc/testing/xds/v3/route.proto";
+import "src/proto/grpc/testing/xds/v3/metadata.proto";
+import "src/proto/grpc/testing/xds/v3/path.proto";
+import "src/proto/grpc/testing/xds/v3/string.proto";
+import "src/proto/grpc/testing/xds/v3/range.proto";
+
+import "src/proto/grpc/testing/xds/v3/expr.proto";
+
+// [#protodoc-title: Role Based Access Control (RBAC)]
+
+// Role Based Access Control (RBAC) provides service-level and method-level access control for a
+// service. Requests are allowed or denied based on the `action` and whether a matching policy is
+// found. For instance, if the action is ALLOW and a matching policy is found the request should be
+// allowed.
+//
+// RBAC can also be used to make access logging decisions by communicating with access loggers
+// through dynamic metadata. When the action is LOG and at least one policy matches, the
+// `access_log_hint` value in the shared key namespace 'envoy.common' is set to `true` indicating
+// the request should be logged.
+//
+// Here is an example of RBAC configuration. It has two policies:
+//
+// * Service account "cluster.local/ns/default/sa/admin" has full access to the service, and so
+// does "cluster.local/ns/default/sa/superuser".
+//
+// * Any user can read ("GET") the service at paths with prefix "/products", so long as the
+// destination port is either 80 or 443.
+//
+// .. code-block:: yaml
+//
+// action: ALLOW
+// policies:
+// "service-admin":
+// permissions:
+// - any: true
+// principals:
+// - authenticated:
+// principal_name:
+// exact: "cluster.local/ns/default/sa/admin"
+// - authenticated:
+// principal_name:
+// exact: "cluster.local/ns/default/sa/superuser"
+// "product-viewer":
+// permissions:
+// - and_rules:
+// rules:
+// - header:
+// name: ":method"
+// string_match:
+// exact: "GET"
+// - url_path:
+// path: { prefix: "/products" }
+// - or_rules:
+// rules:
+// - destination_port: 80
+// - destination_port: 443
+// principals:
+// - any: true
+//
+message RBAC {
+ // Should we do safe-list or block-list style access control?
+ enum Action {
+ // The policies grant access to principals. The rest are denied. This is safe-list style
+ // access control. This is the default type.
+ ALLOW = 0;
+
+ // The policies deny access to principals. The rest are allowed. This is block-list style
+ // access control.
+ DENY = 1;
+
+ // The policies set the `access_log_hint` dynamic metadata key based on if requests match.
+ // All requests are allowed.
+ LOG = 2;
+ }
+
+ // The action to take if a policy matches. Every action either allows or denies a request,
+ // and can also carry out action-specific operations.
+ //
+ // Actions:
+ //
+ // * ALLOW: Allows the request if and only if there is a policy that matches
+ // the request.
+ // * DENY: Allows the request if and only if there are no policies that
+ // match the request.
+ // * LOG: Allows all requests. If at least one policy matches, the dynamic
+ // metadata key `access_log_hint` is set to the value `true` under the shared
+ // key namespace 'envoy.common'. If no policies match, it is set to `false`.
+ // Other actions do not modify this key.
+ //
+ Action action = 1;
+
+ // Maps from policy name to policy. A match occurs when at least one policy matches the request.
+ // The policies are evaluated in lexicographic order of the policy name.
+ map<string, Policy> policies = 2;
+}
+
+// Policy specifies a role and the principals that are assigned/denied the role.
+// A policy matches if and only if at least one of its permissions match the
+// action taking place AND at least one of its principals match the downstream
+// AND the condition is true if specified.
+message Policy {
+ // Required. The set of permissions that define a role. Each permission is
+ // matched with OR semantics. To match all actions for this policy, a single
+ // Permission with the `any` field set to true should be used.
+ repeated Permission permissions = 1;
+
+ // Required. The set of principals that are assigned/denied the role based on
+ // “action”. Each principal is matched with OR semantics. To match all
+ // downstreams for this policy, a single Principal with the `any` field set to
+ // true should be used.
+ repeated Principal principals = 2;
+
+ // An optional symbolic expression specifying an access control
+ // :ref:`condition <arch_overview_condition>`. The condition is combined
+ // with the permissions and the principals as a clause with AND semantics.
+ // Only be used when checked_condition is not used.
+ google.api.expr.v1alpha1.Expr condition = 3;
+
+ // [#not-implemented-hide:]
+ // An optional symbolic expression that has been successfully type checked.
+ // Only be used when condition is not used.
+ google.api.expr.v1alpha1.CheckedExpr checked_condition = 4;
+}
+
+// Permission defines an action (or actions) that a principal can take.
+// [#next-free-field: 13]
+message Permission {
+ // Used in the `and_rules` and `or_rules` fields in the `rule` oneof. Depending on the context,
+ // each are applied with the associated behavior.
+ message Set {
+ repeated Permission rules = 1;
+ }
+
+ oneof rule {
+ // A set of rules that all must match in order to define the action.
+ Set and_rules = 1;
+
+ // A set of rules where at least one must match in order to define the action.
+ Set or_rules = 2;
+
+ // When any is set, it matches any action.
+ bool any = 3;
+
+ // A header (or pseudo-header such as :path or :method) on the incoming HTTP request. Only
+ // available for HTTP request.
+ // Note: the pseudo-header :path includes the query and fragment string. Use the `url_path`
+ // field if you want to match the URL path without the query and fragment string.
+ route.v3.HeaderMatcher header = 4;
+
+ // A URL path on the incoming HTTP request. Only available for HTTP.
+ type.matcher.v3.PathMatcher url_path = 10;
+
+ // A CIDR block that describes the destination IP.
+ core.v3.CidrRange destination_ip = 5;
+
+ // A port number that describes the destination port connecting to.
+ uint32 destination_port = 6;
+
+ // A port number range that describes a range of destination ports connecting to.
+ type.v3.Int32Range destination_port_range = 11;
+
+ // Metadata that describes additional information about the action.
+ type.matcher.v3.MetadataMatcher metadata = 7;
+
+ // Negates matching the provided permission. For instance, if the value of
+ // `not_rule` would match, this permission would not match. Conversely, if
+ // the value of `not_rule` would not match, this permission would match.
+ Permission not_rule = 8;
+
+ // The request server from the client's connection request. This is
+ // typically TLS SNI.
+ //
+ // .. attention::
+ //
+ // The behavior of this field may be affected by how Envoy is configured
+ // as explained below.
+ //
+ // * If the :ref:`TLS Inspector <config_listener_filters_tls_inspector>`
+ // filter is not added, and if a `FilterChainMatch` is not defined for
+ // the :ref:`server name
+ // <envoy_v3_api_field_config.listener.v3.FilterChainMatch.server_names>`,
+ // a TLS connection's requested SNI server name will be treated as if it
+ // wasn't present.
+ //
+ // * A :ref:`listener filter <arch_overview_listener_filters>` may
+ // overwrite a connection's requested server name within Envoy.
+ //
+ // Please refer to :ref:`this FAQ entry <faq_how_to_setup_sni>` to learn to
+ // setup SNI.
+ type.matcher.v3.StringMatcher requested_server_name = 9;
+
+ // Extension for configuring custom matchers for RBAC.
+ // [#extension-category: envoy.rbac.matchers]
+ core.v3.TypedExtensionConfig matcher = 12;
+ }
+}
+
+// Principal defines an identity or a group of identities for a downstream
+// subject.
+// [#next-free-field: 12]
+message Principal {
+ // Used in the `and_ids` and `or_ids` fields in the `identifier` oneof.
+ // Depending on the context, each are applied with the associated behavior.
+ message Set {
+ repeated Principal ids = 1;
+ }
+
+ // Authentication attributes for a downstream.
+ message Authenticated {
+ reserved 1;
+
+ // The name of the principal. If set, The URI SAN or DNS SAN in that order
+ // is used from the certificate, otherwise the subject field is used. If
+ // unset, it applies to any user that is authenticated.
+ type.matcher.v3.StringMatcher principal_name = 2;
+ }
+
+ oneof identifier {
+ // A set of identifiers that all must match in order to define the
+ // downstream.
+ Set and_ids = 1;
+
+ // A set of identifiers at least one must match in order to define the
+ // downstream.
+ Set or_ids = 2;
+
+ // When any is set, it matches any downstream.
+ bool any = 3;
+
+ // Authenticated attributes that identify the downstream.
+ Authenticated authenticated = 4;
+
+ // A CIDR block that describes the downstream IP.
+ // This address will honor proxy protocol, but will not honor XFF.
+ core.v3.CidrRange source_ip = 5;
+
+ // A CIDR block that describes the downstream remote/origin address.
+ // Note: This is always the physical peer even if the
+ // :ref:`remote_ip <envoy_v3_api_field_config.rbac.v3.Principal.remote_ip>` is
+ // inferred from for example the x-forwarder-for header, proxy protocol,
+ // etc.
+ core.v3.CidrRange direct_remote_ip = 10;
+
+ // A CIDR block that describes the downstream remote/origin address.
+ // Note: This may not be the physical peer and could be different from the
+ // :ref:`direct_remote_ip
+ // <envoy_v3_api_field_config.rbac.v3.Principal.direct_remote_ip>`. E.g, if the
+ // remote ip is inferred from for example the x-forwarder-for header, proxy
+ // protocol, etc.
+ core.v3.CidrRange remote_ip = 11;
+
+ // A header (or pseudo-header such as :path or :method) on the incoming HTTP
+ // request. Only available for HTTP request. Note: the pseudo-header :path
+ // includes the query and fragment string. Use the `url_path` field if you
+ // want to match the URL path without the query and fragment string.
+ route.v3.HeaderMatcher header = 6;
+
+ // A URL path on the incoming HTTP request. Only available for HTTP.
+ type.matcher.v3.PathMatcher url_path = 9;
+
+ // Metadata that describes additional information about the principal.
+ type.matcher.v3.MetadataMatcher metadata = 7;
+
+ // Negates matching the provided principal. For instance, if the value of
+ // `not_id` would match, this principal would not match. Conversely, if the
+ // value of `not_id` would not match, this principal would match.
+ Principal not_id = 8;
+ }
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/regex.proto b/grpc/src/proto/grpc/testing/xds/v3/regex.proto
index af904577..9039ed46 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/regex.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/regex.proto
@@ -36,3 +36,8 @@ message RegexMatcher {
// The regex match string. The string must be supported by the configured engine.
string regex = 2;
}
+
+message RegexMatchAndSubstitute {
+ RegexMatcher pattern = 1;
+ string substitution = 2;
+}
diff --git a/grpc/src/proto/grpc/testing/xds/v3/route.proto b/grpc/src/proto/grpc/testing/xds/v3/route.proto
index baeaaf64..b06fbc71 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/route.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/route.proto
@@ -19,6 +19,7 @@ syntax = "proto3";
package envoy.config.route.v3;
import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/extension.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";
@@ -31,6 +32,18 @@ import "google/protobuf/wrappers.proto";
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
+message RetryPolicy {
+ string retry_on = 1;
+ google.protobuf.UInt32Value num_retries = 2;
+
+ message RetryBackOff {
+ google.protobuf.Duration base_interval = 1;
+ google.protobuf.Duration max_interval = 2;
+ }
+
+ RetryBackOff retry_back_off = 8;
+}
+
// 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
@@ -72,6 +85,8 @@ message VirtualHost {
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
map<string, google.protobuf.Any> typed_per_filter_config = 15;
+
+ RetryPolicy retry_policy = 16;
}
// A route is both a specification of how to match a request as well as an indication of what to do
@@ -89,12 +104,21 @@ message Route {
// Route matching parameters.
RouteMatch match = 1;
+ message NonForwardingAction {
+ }
+
oneof action {
// Route request to some upstream cluster.
RouteAction route = 2;
// Return a redirect.
RedirectAction redirect = 3;
+
+ // An action used when the route will generate a response directly,
+ // without forwarding to an upstream host. This will be used in non-proxy
+ // xDS clients like the gRPC server. It could also be used in the future
+ // in Envoy for a filter that directly generates responses for requests.
+ NonForwardingAction non_forwarding_action = 18;
}
// The typed_per_filter_config field can be used to provide route-specific
@@ -245,7 +269,88 @@ message RouteAction {
// :ref:`traffic splitting <config_http_conn_man_route_table_traffic_splitting_split>`
// for additional documentation.
WeightedCluster weighted_clusters = 3;
+
+ // Name of the cluster specifier plugin to use to determine the cluster for
+ // requests on this route. The plugin name must be defined in the associated
+ // :ref:`envoy_v3_api_field_config.route.v3.RouteConfiguration.cluster_specifier_plugins`
+ // in the
+ // :ref:`envoy_v3_api_field_config.core.v3.TypedExtensionConfig.name` field.
+ string cluster_specifier_plugin = 37;
+ }
+
+ message HashPolicy {
+ message Header {
+ // The name of the request header that will be used to obtain the hash
+ // key. If the request header is not present, no hash will be produced.
+ string header_name = 1;
+
+ // If specified, the request header value will be rewritten and used
+ // to produce the hash key.
+ type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
+ }
+
+ message Cookie {
+ string name = 1;
+ }
+
+ message ConnectionProperties {
+ bool source_ip = 1;
+ }
+
+ message QueryParameter {
+ string name = 1;
+ }
+
+ message FilterState {
+ // The name of the Object in the per-request filterState, which is an
+ // Envoy::Http::Hashable object. If there is no data associated with the key,
+ // or the stored object is not Envoy::Http::Hashable, no hash will be produced.
+ string key = 1;
+ }
+
+ oneof policy_specifier {
+ // Header hash policy.
+ Header header = 1;
+
+ // Cookie hash policy.
+ Cookie cookie = 2;
+
+ // Connection properties hash policy.
+ ConnectionProperties connection_properties = 3;
+
+ // Query parameter hash policy.
+ QueryParameter query_parameter = 5;
+
+ // Filter state hash policy.
+ FilterState filter_state = 6;
+ }
+
+ // The flag that short-circuits the hash computing. This field provides a
+ // 'fallback' style of configuration: "if a terminal policy doesn't work,
+ // fallback to rest of the policy list", it saves time when the terminal
+ // policy works.
+ //
+ // If true, and there is already a hash computed, ignore rest of the
+ // list of hash polices.
+ // For example, if the following hash methods are configured:
+ //
+ // ========= ========
+ // specifier terminal
+ // ========= ========
+ // Header A true
+ // Header B false
+ // Header C false
+ // ========= ========
+ //
+ // The generateHash process ends if policy "header A" generates a hash, as
+ // it's a terminal policy.
+ bool terminal = 4;
}
+
+ repeated HashPolicy hash_policy = 15;
+
+ RetryPolicy retry_policy = 9;
+
// Specifies the maximum stream duration for this route.
MaxStreamDuration max_stream_duration = 36;
}
@@ -338,6 +443,19 @@ message HeaderMatcher {
message QueryParameterMatcher {
}
+// Configuration for a cluster specifier plugin.
+message ClusterSpecifierPlugin {
+ // The name of the plugin and its opaque configuration.
+ core.v3.TypedExtensionConfig extension = 1;
+
+ // If is_optional is not set and the plugin defined by this message is not
+ // a supported type, the containing resource is NACKed. If is_optional is
+ // set, the resource would not be NACKed for this reason. In this case,
+ // routes referencing this plugin's name would not be treated as an illegal
+ // configuration, but would result in a failure if the route is selected.
+ bool is_optional = 2;
+}
+
// [#protodoc-title: HTTP route configuration]
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
@@ -352,6 +470,11 @@ message RouteConfiguration {
// An array of virtual hosts that make up the route table.
repeated VirtualHost virtual_hosts = 2;
+
+ // A list of plugins and their configurations which may be used by a
+ // :ref:`envoy_v3_api_field_config.route.v3.RouteAction.cluster_specifier_plugin`
+ // within the route. All *extension.name* fields in this list must be unique.
+ repeated ClusterSpecifierPlugin cluster_specifier_plugins = 12;
}
message RedirectAction {
diff --git a/grpc/src/proto/grpc/testing/xds/v3/tls.proto b/grpc/src/proto/grpc/testing/xds/v3/tls.proto
index e9acfb52..b2fc4532 100644
--- a/grpc/src/proto/grpc/testing/xds/v3/tls.proto
+++ b/grpc/src/proto/grpc/testing/xds/v3/tls.proto
@@ -18,16 +18,104 @@ syntax = "proto3";
package envoy.extensions.transport_sockets.tls.v3;
+import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/extension.proto";
import "src/proto/grpc/testing/xds/v3/string.proto";
import "google/protobuf/wrappers.proto";
+// Indicates a certificate to be obtained from a named CertificateProvider plugin instance.
+// The plugin instances are defined in the client's bootstrap file.
+// The plugin allows certificates to be fetched/refreshed over the network asynchronously with
+// respect to the TLS handshake.
+// [#not-implemented-hide:]
+message CertificateProviderPluginInstance {
+ // Provider instance name. If not present, defaults to "default".
+ //
+ // Instance names should generally be defined not in terms of the underlying provider
+ // implementation (e.g., "file_watcher") but rather in terms of the function of the
+ // certificates (e.g., "foo_deployment_identity").
+ string instance_name = 1;
+
+ // Opaque name used to specify certificate instances or types. For example, "ROOTCA" to specify
+ // a root-certificate (validation context) or "example.com" to specify a certificate for a
+ // particular domain. Not all provider instances will actually use this field, so the value
+ // defaults to the empty string.
+ string certificate_name = 2;
+}
+
message CertificateValidationContext {
+ // Certificate provider instance for fetching TLS certificates.
+ //
+ // Only one of *trusted_ca* and *ca_certificate_provider_instance* may be specified.
+ // [#not-implemented-hide:]
+ CertificateProviderPluginInstance ca_certificate_provider_instance = 13;
+
+ // An optional list of base64-encoded SHA-256 hashes. If specified, Envoy will verify that the
+ // SHA-256 of the DER-encoded Subject Public Key Information (SPKI) of the presented certificate
+ // matches one of the specified values.
+ //
+ // A base64-encoded SHA-256 of the Subject Public Key Information (SPKI) of the certificate
+ // can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -noout -pubkey
+ // | openssl pkey -pubin -outform DER
+ // | openssl dgst -sha256 -binary
+ // | openssl enc -base64
+ // NvqYIYSbgK2vCJpQhObf77vv+bQWtc5ek5RIOwPiC9A=
+ //
+ // This is the format used in HTTP Public Key Pinning.
+ //
+ // When both:
+ // :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and
+ // :ref:`verify_certificate_spki
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified,
+ // a hash matching value from either of the lists will result in the certificate being accepted.
+ //
+ // .. attention::
+ //
+ // This option is preferred over :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>`,
+ // because SPKI is tied to a private key, so it doesn't change when the certificate
+ // is renewed using the same private key.
+ repeated string verify_certificate_spki = 3;
+
+ // An optional list of hex-encoded SHA-256 hashes. If specified, Envoy will verify that
+ // the SHA-256 of the DER-encoded presented certificate matches one of the specified values.
+ //
+ // A hex-encoded SHA-256 of the certificate can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -outform DER | openssl dgst -sha256 | cut -d" " -f2
+ // df6ff72fe9116521268f6f2dd4966f51df479883fe7037b39f75916ac3049d1a
+ //
+ // A long hex-encoded and colon-separated SHA-256 (a.k.a. "fingerprint") of the certificate
+ // can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -noout -fingerprint -sha256 | cut -d"=" -f2
+ // DF:6F:F7:2F:E9:11:65:21:26:8F:6F:2D:D4:96:6F:51:DF:47:98:83:FE:70:37:B3:9F:75:91:6A:C3:04:9D:1A
+ //
+ // Both of those formats are acceptable.
+ //
+ // When both:
+ // :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and
+ // :ref:`verify_certificate_spki
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified,
+ // a hash matching value from either of the lists will result in the certificate being accepted.
+ repeated string verify_certificate_hash = 2;
+
// An optional list of Subject Alternative name matchers. If specified, Envoy will verify that the
// Subject Alternative Name of the presented certificate matches one of the specified matchers.
//
// When a certificate has wildcard DNS SAN entries, to match a specific client, it should be
- // configured with exact match type in the :ref:`string matcher <envoy_api_msg_type.matcher.v3.StringMatcher>`.
+ // configured with exact match type in the :ref:`string matcher <envoy_v3_api_msg_type.matcher.v3.StringMatcher>`.
// For example if the certificate has "\*.example.com" as DNS SAN entry, to allow only "api.example.com",
// it should be configured as shown below.
//
@@ -40,8 +128,29 @@ message CertificateValidationContext {
//
// Subject Alternative Names are easily spoofable and verifying only them is insecure,
// therefore this option must be used together with :ref:`trusted_ca
- // <envoy_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>`.
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>`.
repeated type.matcher.v3.StringMatcher match_subject_alt_names = 9;
+
+ // [#not-implemented-hide:] Must present signed certificate time-stamp.
+ google.protobuf.BoolValue require_signed_certificate_timestamp = 6;
+
+ // An optional `certificate revocation list
+ // <https://en.wikipedia.org/wiki/Certificate_revocation_list>`_
+ // (in PEM format). If specified, Envoy will verify that the presented peer
+ // certificate has not been revoked by this CRL. If this DataSource contains
+ // multiple CRLs, all of them will be used. Note that if a CRL is provided
+ // for any certificate authority in a trust chain, a CRL must be provided
+ // for all certificate authorities in that chain. Failure to do so will
+ // result in verification failure for both revoked and unrevoked certificates
+ // from that chain.
+ config.core.v3.DataSource crl = 7;
+
+ // The configuration of an extension specific certificate validator.
+ // If specified, all validation is done by the specified validator,
+ // and the behavior of all other validation settings is defined by the specified validator (and may be entirely ignored, unused, and unvalidated).
+ // Refer to the documentation for the specified validator. If you do not want a custom validation algorithm, do not set this field.
+ // [#extension-category: envoy.tls.cert_validator]
+ config.core.v3.TypedExtensionConfig custom_validator_config = 12;
}
message UpstreamTlsContext {
@@ -56,12 +165,43 @@ message UpstreamTlsContext {
}
message DownstreamTlsContext {
+ enum OcspStaplePolicy {
+ // OCSP responses are optional. If an OCSP response is absent
+ // or expired, the associated certificate will be used for
+ // connections without an OCSP staple.
+ LENIENT_STAPLING = 0;
+
+ // OCSP responses are optional. If an OCSP response is absent,
+ // the associated certificate will be used without an
+ // OCSP staple. If a response is provided but is expired,
+ // the associated certificate will not be used for
+ // subsequent connections. If no suitable certificate is found,
+ // the connection is rejected.
+ STRICT_STAPLING = 1;
+
+ // OCSP responses are required. Configuration will fail if
+ // a certificate is provided without an OCSP response. If a
+ // response expires, the associated certificate will not be
+ // used connections. If no suitable certificate is found, the
+ // connection is rejected.
+ MUST_STAPLE = 2;
+ }
+
// Common TLS context settings.
CommonTlsContext common_tls_context = 1;
// If specified, Envoy will reject connections without a valid client
// certificate.
google.protobuf.BoolValue require_client_certificate = 2;
+
+ // If specified, Envoy will reject connections without a valid and matching SNI.
+ // [#not-implemented-hide:]
+ google.protobuf.BoolValue require_sni = 3;
+
+ // Config for whether to use certificates if they do not have
+ // an accompanying OCSP response or if the response expires at runtime.
+ // Defaults to LENIENT_STAPLING
+ OcspStaplePolicy ocsp_staple_policy = 8;
}
@@ -98,10 +238,60 @@ message CommonTlsContext {
CertificateProviderInstance validation_context_certificate_provider_instance = 4;
}
+ message TlsParameters {}
+
+ // TLS protocol versions, cipher suites etc.
+ TlsParameters tls_params = 1;
+
+ message TlsCertificate {}
+
+ // :ref:`Multiple TLS certificates <arch_overview_ssl_cert_select>` can be associated with the
+ // same context to allow both RSA and ECDSA certificates.
+ //
+ // Only a single TLS certificate is supported in client contexts. In server contexts, the first
+ // RSA certificate is used for clients that only support RSA and the first ECDSA certificate is
+ // used for clients that support ECDSA.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's
+ // not legal to put a repeated field in a oneof. In the next major version, we should rework
+ // this to avoid this problem.]
+ repeated TlsCertificate tls_certificates = 2;
+
+ message SdsSecretConfig {}
+
+ // Configs for fetching TLS certificates via SDS API. Note SDS API allows certificates to be
+ // fetched/refreshed over the network asynchronously with respect to the TLS handshake.
+ //
+ // The same number and types of certificates as :ref:`tls_certificates <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CommonTlsContext.tls_certificates>`
+ // are valid in the the certificates fetched through this setting.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's
+ // not legal to put a repeated field in a oneof. In the next major version, we should rework
+ // this to avoid this problem.]
+ repeated SdsSecretConfig tls_certificate_sds_secret_configs = 6;
+
+ // Certificate provider instance for fetching TLS certs.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#not-implemented-hide:]
+ CertificateProviderPluginInstance tls_certificate_provider_instance = 14;
+
// Certificate provider instance for fetching TLS certificates.
CertificateProviderInstance tls_certificate_certificate_provider_instance = 11;
oneof validation_context_type {
+ // How to validate peer certificates.
+ CertificateValidationContext validation_context = 3;
+
+ // Config for fetching validation context via SDS API. Note SDS API allows certificates to be
+ // fetched/refreshed over the network asynchronously with respect to the TLS handshake.
+ SdsSecretConfig validation_context_sds_secret_config = 7;
+
// Combined certificate validation context holds a default CertificateValidationContext
// and SDS config. When SDS server returns dynamic CertificateValidationContext, both dynamic
// and default CertificateValidationContext are merged into a new CertificateValidationContext
@@ -111,4 +301,8 @@ message CommonTlsContext {
// CertificateValidationContext, and logical OR is applied to boolean fields.
CombinedCertificateValidationContext combined_validation_context = 8;
}
+
+ // Custom TLS handshaker. If empty, defaults to native TLS handshaking
+ // behavior.
+ config.core.v3.TypedExtensionConfig custom_handshaker = 13;
}
diff --git a/grpc/src/upb/gen_build_yaml.py b/grpc/src/upb/gen_build_yaml.py
index b556c3de..939d71b3 100755
--- a/grpc/src/upb/gen_build_yaml.py
+++ b/grpc/src/upb/gen_build_yaml.py
@@ -29,10 +29,14 @@ try:
'build': 'all',
'language': 'c',
'src': [
+ "third_party/upb/third_party/utf8_range/naive.c",
+ "third_party/upb/third_party/utf8_range/range2-neon.c",
+ "third_party/upb/third_party/utf8_range/range2-sse.c",
"third_party/upb/upb/decode_fast.c",
"third_party/upb/upb/decode.c",
"third_party/upb/upb/def.c",
"third_party/upb/upb/encode.c",
+ "third_party/upb/upb/json_encode.c",
"third_party/upb/upb/msg.c",
"third_party/upb/upb/reflection.c",
"third_party/upb/upb/table.c",
@@ -42,22 +46,25 @@ try:
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c",
],
'headers': [
+ "third_party/upb/third_party/utf8_range/utf8_range.h",
"third_party/upb/upb/decode_fast.h",
+ "third_party/upb/upb/decode_internal.h",
"third_party/upb/upb/decode.h",
- "third_party/upb/upb/decode.int.h",
"third_party/upb/upb/def.h",
"third_party/upb/upb/def.hpp",
"third_party/upb/upb/encode.h",
+ "third_party/upb/upb/json_encode.h",
+ "third_party/upb/upb/msg_internal.h",
"third_party/upb/upb/msg.h",
"third_party/upb/upb/port_def.inc",
"third_party/upb/upb/port_undef.inc",
"third_party/upb/upb/reflection.h",
- "third_party/upb/upb/table.int.h",
+ "third_party/upb/upb/reflection.hpp",
+ "third_party/upb/upb/table_internal.h",
"third_party/upb/upb/text_encode.h",
+ "third_party/upb/upb/upb_internal.h",
"third_party/upb/upb/upb.h",
"third_party/upb/upb/upb.hpp",
- "third_party/upb/upb/upb.int.h",
- "third_party/upb/third_party/wyhash/wyhash.h",
"src/core/ext/upb-generated/google/protobuf/descriptor.upb.h",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h",
],
diff --git a/grpc/test/build/check_epollexclusive.c b/grpc/test/build/check_epollexclusive.c
deleted file mode 100644
index 3f862ce0..00000000
--- a/grpc/test/build/check_epollexclusive.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT 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 "src/core/lib/iomgr/is_epollexclusive_available.h"
-
-int main(int argc, char **argv) {
- return grpc_is_epollexclusive_available() ? 0 : 1;
-}
diff --git a/grpc/test/build_test/BUILD b/grpc/test/build_test/BUILD
index 3a419fb5..c06806d9 100644
--- a/grpc/test/build_test/BUILD
+++ b/grpc/test/build_test/BUILD
@@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+load("@bazel_skylib//rules:build_test.bzl", "build_test")
+
licenses(["notice"])
package(default_visibility = ["//visibility:public"])
-load("@bazel_skylib//rules:build_test.bzl", "build_test")
-
# build test //test/build_test:objective_c_examples_test
build_test(
name = "objective_c_examples_test",
diff --git a/grpc/test/core/security/alts_credentials_fuzzer.cc b/grpc/test/core/security/alts_credentials_fuzzer.cc
index 42e683f6..1f2aa605 100644
--- a/grpc/test/core/security/alts_credentials_fuzzer.cc
+++ b/grpc/test/core/security/alts_credentials_fuzzer.cc
@@ -23,12 +23,12 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include "test/core/util/fuzzer_util.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/security/credentials/alts/alts_credentials.h"
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
+#include "test/core/util/fuzzer_util.h"
using grpc_core::testing::grpc_fuzzer_get_next_byte;
using grpc_core::testing::grpc_fuzzer_get_next_string;
diff --git a/grpc/test/core/security/alts_security_connector_test.cc b/grpc/test/core/security/alts_security_connector_test.cc
index ec1b1d31..becd4e63 100644
--- a/grpc/test/core/security/alts_security_connector_test.cc
+++ b/grpc/test/core/security/alts_security_connector_test.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/core/lib/security/security_connector/alts/alts_security_connector.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -24,7 +26,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/security/security_connector/alts/alts_security_connector.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
#include "src/core/tsi/transport_security.h"
diff --git a/grpc/test/core/security/auth_context_test.cc b/grpc/test/core/security/auth_context_test.cc
index e7e0cb2e..3b6f4e42 100644
--- a/grpc/test/core/security/auth_context_test.cc
+++ b/grpc/test/core/security/auth_context_test.cc
@@ -18,13 +18,13 @@
#include <string.h>
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/context/security_context.h"
#include "test/core/util/test_config.h"
-#include <grpc/support/log.h>
-
static void test_empty_context(void) {
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_core::MakeRefCounted<grpc_auth_context>(nullptr);
@@ -138,7 +138,7 @@ static void test_chained_context(void) {
}
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
test_empty_context();
test_simple_context();
test_chained_context();
diff --git a/grpc/test/core/security/authorization_matchers_test.cc b/grpc/test/core/security/authorization_matchers_test.cc
index 36b38621..975e97e1 100644
--- a/grpc/test/core/security/authorization_matchers_test.cc
+++ b/grpc/test/core/security/authorization_matchers_test.cc
@@ -19,6 +19,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+#include <grpc/grpc_security_constants.h>
+
#include "src/core/lib/security/authorization/evaluate_args.h"
#include "src/core/lib/security/authorization/matchers.h"
#include "test/core/util/evaluate_args_test_util.h"
@@ -36,26 +38,21 @@ TEST_F(AuthorizationMatchersTest, AlwaysAuthorizationMatcher) {
EXPECT_TRUE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotAlwaysAuthorizationMatcher) {
- EvaluateArgs args = args_.MakeEvaluateArgs();
- AlwaysAuthorizationMatcher matcher(/*not_rule=*/true);
- EXPECT_FALSE(matcher.Matches(args));
-}
-
TEST_F(AuthorizationMatchersTest, AndAuthorizationMatcherSuccessfulMatch) {
args_.AddPairToMetadata("foo", "bar");
args_.SetLocalEndpoint("ipv4:255.255.255.255:123");
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kDestPort, /*port=*/123));
- AndAuthorizationMatcher matcher(std::move(rules));
- EXPECT_TRUE(matcher.Matches(args));
+ Rbac::Permission::MakeDestPortPermission(/*port=*/123)));
+ auto matcher = AuthorizationMatcher::Create(
+ Rbac::Permission::MakeAndPermission(std::move(rules)));
+ EXPECT_TRUE(matcher->Matches(args));
}
TEST_F(AuthorizationMatchersTest, AndAuthorizationMatcherFailedMatch) {
@@ -64,48 +61,34 @@ TEST_F(AuthorizationMatchersTest, AndAuthorizationMatcherFailedMatch) {
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kDestPort, /*port=*/123));
- AndAuthorizationMatcher matcher(std::move(rules));
+ Rbac::Permission::MakeDestPortPermission(/*port=*/123)));
+ auto matcher = AuthorizationMatcher::Create(
+ Rbac::Permission(Rbac::Permission::MakeAndPermission(std::move(rules))));
// Header rule fails. Expected value "bar", got "not_bar" for key "foo".
- EXPECT_FALSE(matcher.Matches(args));
-}
-
-TEST_F(AuthorizationMatchersTest, NotAndAuthorizationMatcher) {
- args_.AddPairToMetadata(":path", "/expected/foo");
- EvaluateArgs args = args_.MakeEvaluateArgs();
- StringMatcher string_matcher =
- StringMatcher::Create(StringMatcher::Type::kExact,
- /*matcher=*/"/expected/foo",
- /*case_sensitive=*/false)
- .value();
- std::vector<std::unique_ptr<Rbac::Permission>> ids;
- ids.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kPath, std::move(string_matcher)));
- AndAuthorizationMatcher matcher(std::move(ids), /*not_rule=*/true);
- EXPECT_FALSE(matcher.Matches(args));
+ EXPECT_FALSE(matcher->Matches(args));
}
TEST_F(AuthorizationMatchersTest, OrAuthorizationMatcherSuccessfulMatch) {
args_.AddPairToMetadata("foo", "bar");
args_.SetLocalEndpoint("ipv4:255.255.255.255:123");
EvaluateArgs args = args_.MakeEvaluateArgs();
- HeaderMatcher header_matcher =
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader, header_matcher));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kDestPort, /*port=*/456));
- OrAuthorizationMatcher matcher(std::move(rules));
+ Rbac::Permission::MakeDestPortPermission(/*port=*/456)));
+ auto matcher = AuthorizationMatcher::Create(
+ Rbac::Permission(Rbac::Permission::MakeOrPermission(std::move(rules))));
// Matches as header rule matches even though port rule fails.
- EXPECT_TRUE(matcher.Matches(args));
+ EXPECT_TRUE(matcher->Matches(args));
}
TEST_F(AuthorizationMatchersTest, OrAuthorizationMatcherFailedMatch) {
@@ -113,26 +96,38 @@ TEST_F(AuthorizationMatchersTest, OrAuthorizationMatcherFailedMatch) {
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
- OrAuthorizationMatcher matcher(std::move(rules));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
+ auto matcher = AuthorizationMatcher::Create(
+ Rbac::Permission(Rbac::Permission::MakeOrPermission(std::move(rules))));
// Header rule fails. Expected value "bar", got "not_bar" for key "foo".
- EXPECT_FALSE(matcher.Matches(args));
+ EXPECT_FALSE(matcher->Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotOrAuthorizationMatcher) {
- args_.AddPairToMetadata("foo", "not_bar");
+TEST_F(AuthorizationMatchersTest, NotAuthorizationMatcherSuccessfulMatch) {
+ args_.AddPairToMetadata(":path", "/different/foo");
EvaluateArgs args = args_.MakeEvaluateArgs();
- std::vector<std::unique_ptr<Rbac::Permission>> rules;
- rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
- OrAuthorizationMatcher matcher(std::move(rules), /*not_rule=*/true);
- EXPECT_TRUE(matcher.Matches(args));
+ auto matcher = AuthorizationMatcher::Create(Rbac::Principal(
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakePathPrincipal(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"/expected/foo",
+ /*case_sensitive=*/false)
+ .value()))));
+ EXPECT_TRUE(matcher->Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, NotAuthorizationMatcherFailedMatch) {
+ args_.AddPairToMetadata(":path", "/expected/foo");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ auto matcher = AuthorizationMatcher::Create(Rbac::Principal(
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakePathPrincipal(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"/expected/foo",
+ /*case_sensitive=*/false)
+ .value()))));
+ EXPECT_FALSE(matcher->Matches(args));
}
TEST_F(AuthorizationMatchersTest, HybridAuthorizationMatcherSuccessfulMatch) {
@@ -141,20 +136,21 @@ TEST_F(AuthorizationMatchersTest, HybridAuthorizationMatcherSuccessfulMatch) {
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> sub_and_rules;
sub_and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
std::vector<std::unique_ptr<Rbac::Permission>> sub_or_rules;
sub_or_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kDestPort, /*port=*/123));
+ Rbac::Permission::MakeDestPortPermission(/*port=*/123)));
std::vector<std::unique_ptr<Rbac::Permission>> and_rules;
and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kAnd, std::move(sub_and_rules)));
+ Rbac::Permission::MakeAndPermission(std::move(sub_and_rules))));
and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kOr, std::move(std::move(sub_or_rules))));
- AndAuthorizationMatcher matcher(std::move(and_rules));
- EXPECT_TRUE(matcher.Matches(args));
+ Rbac::Permission::MakeOrPermission(std::move(std::move(sub_or_rules)))));
+ auto matcher = AuthorizationMatcher::Create(Rbac::Permission(
+ Rbac::Permission::MakeAndPermission(std::move(and_rules))));
+ EXPECT_TRUE(matcher->Matches(args));
}
TEST_F(AuthorizationMatchersTest, HybridAuthorizationMatcherFailedMatch) {
@@ -163,25 +159,47 @@ TEST_F(AuthorizationMatchersTest, HybridAuthorizationMatcherFailedMatch) {
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> sub_and_rules;
sub_and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"foo", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
sub_and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"absent_key", HeaderMatcher::Type::kExact,
- /*matcher=*/"some_value")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"absent_key",
+ HeaderMatcher::Type::kExact,
+ /*matcher=*/"some_value")
+ .value())));
std::vector<std::unique_ptr<Rbac::Permission>> sub_or_rules;
sub_or_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kDestPort, /*port=*/123));
+ Rbac::Permission::MakeDestPortPermission(/*port=*/123)));
std::vector<std::unique_ptr<Rbac::Permission>> and_rules;
and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kAnd, std::move(sub_and_rules)));
+ Rbac::Permission::MakeAndPermission(std::move(sub_and_rules))));
and_rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kOr, std::move(std::move(sub_or_rules))));
- AndAuthorizationMatcher matcher(std::move(and_rules));
+ Rbac::Permission::MakeOrPermission(std::move(std::move(sub_or_rules)))));
+ auto matcher = AuthorizationMatcher::Create(Rbac::Permission(
+ Rbac::Permission::MakeAndPermission(std::move(and_rules))));
// Fails as "absent_key" header was not present.
+ EXPECT_FALSE(matcher->Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest,
+ ReqServerNameAuthorizationMatcherSuccessfulMatch) {
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ ReqServerNameAuthorizationMatcher matcher(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"")
+ .value());
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest,
+ ReqServerNameAuthorizationMatcherFailedMatch) {
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ ReqServerNameAuthorizationMatcher matcher(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"server1")
+ .value());
EXPECT_FALSE(matcher.Matches(args));
}
@@ -207,16 +225,6 @@ TEST_F(AuthorizationMatchersTest, PathAuthorizationMatcherFailedMatch) {
EXPECT_FALSE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotPathAuthorizationMatcher) {
- args_.AddPairToMetadata(":path", "expected/path");
- EvaluateArgs args = args_.MakeEvaluateArgs();
- PathAuthorizationMatcher matcher(
- StringMatcher::Create(StringMatcher::Type::kExact, "expected/path", false)
- .value(),
- /*not_rule=*/true);
- EXPECT_FALSE(matcher.Matches(args));
-}
-
TEST_F(AuthorizationMatchersTest,
PathAuthorizationMatcherFailedMatchMissingPath) {
EvaluateArgs args = args_.MakeEvaluateArgs();
@@ -228,6 +236,18 @@ TEST_F(AuthorizationMatchersTest,
EXPECT_FALSE(matcher.Matches(args));
}
+TEST_F(AuthorizationMatchersTest, MetadataAuthorizationMatcherSuccessfulMatch) {
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ MetadataAuthorizationMatcher matcher(/*invert=*/true);
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, MetadataAuthorizationMatcherFailedMatch) {
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ MetadataAuthorizationMatcher matcher(/*invert=*/false);
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherSuccessfulMatch) {
args_.AddPairToMetadata("key123", "foo_xxx");
EvaluateArgs args = args_.MakeEvaluateArgs();
@@ -248,6 +268,66 @@ TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherFailedMatch) {
EXPECT_FALSE(matcher.Matches(args));
}
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherMethodSuccess) {
+ args_.AddPairToMetadata(":method", "GET");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":method", HeaderMatcher::Type::kExact,
+ /*matcher=*/"GET")
+ .value());
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherMethodFail) {
+ args_.AddPairToMetadata(":method", "GET");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":method", HeaderMatcher::Type::kExact,
+ /*matcher=*/"PUT")
+ .value());
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherAuthoritySuccess) {
+ args_.AddPairToMetadata(":authority", "localhost");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":authority", HeaderMatcher::Type::kExact,
+ /*matcher=*/"localhost")
+ .value());
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherAuthorityFail) {
+ args_.AddPairToMetadata(":authority", "localhost");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":authority", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bad_authority")
+ .value());
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherPathSuccess) {
+ args_.AddPairToMetadata(":path", "/expected/path");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":path", HeaderMatcher::Type::kExact,
+ /*matcher=*/"/expected/path")
+ .value());
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, HeaderAuthorizationMatcherPathFail) {
+ args_.AddPairToMetadata(":path", "/expected/path");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ HeaderAuthorizationMatcher matcher(
+ HeaderMatcher::Create(/*name=*/":path", HeaderMatcher::Type::kExact,
+ /*matcher=*/"/unexpected/path")
+ .value());
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
TEST_F(AuthorizationMatchersTest,
HeaderAuthorizationMatcherFailedMatchMultivaluedHeader) {
args_.AddPairToMetadata("key123", "foo");
@@ -270,17 +350,82 @@ TEST_F(AuthorizationMatchersTest,
EXPECT_FALSE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotHeaderAuthorizationMatcher) {
- args_.AddPairToMetadata("key123", "foo");
+TEST_F(AuthorizationMatchersTest, IpAuthorizationMatcherDestIpSuccessfulMatch) {
+ args_.SetLocalEndpoint("ipv4:1.2.3.4:123");
EvaluateArgs args = args_.MakeEvaluateArgs();
- HeaderAuthorizationMatcher matcher(
- HeaderMatcher::Create(/*name=*/"key123", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value(),
- /*not_rule=*/true);
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kDestIp,
+ Rbac::CidrRange(/*address_prefix=*/"1.7.8.9", /*prefix_len=*/8));
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, IpAuthorizationMatcherDestIpFailedMatch) {
+ args_.SetLocalEndpoint("ipv4:1.2.3.4:123");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kDestIp,
+ Rbac::CidrRange(/*address_prefix=*/"1.2.3.9", /*prefix_len=*/32));
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest,
+ IpAuthorizationMatcherSourceIpSuccessfulMatch) {
+ args_.SetPeerEndpoint("ipv6:[1:2:3::]:456");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kSourceIp,
+ Rbac::CidrRange(/*address_prefix=*/"1:3:4::", /*prefix_len=*/16));
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, IpAuthorizationMatcherSourceIpFailedMatch) {
+ args_.SetPeerEndpoint("ipv6:[1:2::3::]:456");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kSourceIp,
+ Rbac::CidrRange(/*address_prefix=*/"1:3::", /*prefix_len=*/48));
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest,
+ IpAuthorizationMatcherRemoteIpSuccessfulMatch) {
+ args_.SetPeerEndpoint("ipv6:[1:2:3::]:456");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kRemoteIp,
+ Rbac::CidrRange(/*address_prefix=*/"1:2:4::", /*prefix_len=*/32));
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, IpAuthorizationMatcherRemoteIpFailedMatch) {
+ args_.SetPeerEndpoint("ipv6:[1:2::]:456");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kRemoteIp,
+ Rbac::CidrRange(/*address_prefix=*/"1:3::", /*prefix_len=*/32));
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest,
+ IpAuthorizationMatcherDirectRemoteIpSuccessfulMatch) {
+ args_.SetPeerEndpoint("ipv4:1.2.3.4:123");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kDirectRemoteIp,
+ Rbac::CidrRange(/*address_prefix=*/"1.7.8.9", /*prefix_len=*/8));
EXPECT_TRUE(matcher.Matches(args));
}
+TEST_F(AuthorizationMatchersTest,
+ IpAuthorizationMatcherDirectRemoteIpFailedMatch) {
+ args_.SetPeerEndpoint("ipv4:1.2.3.4:123");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ IpAuthorizationMatcher matcher(
+ IpAuthorizationMatcher::Type::kDirectRemoteIp,
+ Rbac::CidrRange(/*address_prefix=*/"1.7.8.9", /*prefix_len=*/16));
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
TEST_F(AuthorizationMatchersTest, PortAuthorizationMatcherSuccessfulMatch) {
args_.SetLocalEndpoint("ipv4:255.255.255.255:123");
EvaluateArgs args = args_.MakeEvaluateArgs();
@@ -295,13 +440,6 @@ TEST_F(AuthorizationMatchersTest, PortAuthorizationMatcherFailedMatch) {
EXPECT_FALSE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotPortAuthorizationMatcher) {
- args_.SetLocalEndpoint("ipv4:255.255.255.255:123");
- EvaluateArgs args = args_.MakeEvaluateArgs();
- PortAuthorizationMatcher matcher(/*port=*/123, /*not_rule=*/true);
- EXPECT_FALSE(matcher.Matches(args));
-}
-
TEST_F(AuthorizationMatchersTest,
AuthenticatedMatcherUnAuthenticatedConnection) {
EvaluateArgs args = args_.MakeEvaluateArgs();
@@ -318,79 +456,140 @@ TEST_F(AuthorizationMatchersTest,
args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_SSL_TRANSPORT_SECURITY_TYPE);
EvaluateArgs args = args_.MakeEvaluateArgs();
+ AuthenticatedAuthorizationMatcher matcher(/*auth=*/absl::nullopt);
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherSuccessfulUriSanMatches) {
+ args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ args_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME,
+ "spiffe://foo.abc");
+ args_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME,
+ "https://foo.domain.com");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
AuthenticatedAuthorizationMatcher matcher(
StringMatcher::Create(StringMatcher::Type::kExact,
- /*matcher=*/"",
+ /*matcher=*/"spiffe://foo.abc",
/*case_sensitive=*/false)
.value());
EXPECT_TRUE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest,
- AuthenticatedMatcherSuccessfulSpiffeIdMatches) {
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedUriSanMatches) {
args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
- GRPC_SSL_TRANSPORT_SECURITY_TYPE);
- args_.AddPropertyToAuthContext(GRPC_PEER_SPIFFE_ID_PROPERTY_NAME,
- "spiffe://foo.abc");
+ GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ args_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME,
+ "spiffe://bar.abc");
EvaluateArgs args = args_.MakeEvaluateArgs();
AuthenticatedAuthorizationMatcher matcher(
StringMatcher::Create(StringMatcher::Type::kExact,
/*matcher=*/"spiffe://foo.abc",
/*case_sensitive=*/false)
.value());
- EXPECT_TRUE(matcher.Matches(args));
+ EXPECT_FALSE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedSpiffeIdMatches) {
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherSuccessfulDnsSanMatches) {
args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_SSL_TRANSPORT_SECURITY_TYPE);
- args_.AddPropertyToAuthContext(GRPC_PEER_SPIFFE_ID_PROPERTY_NAME,
+ args_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME,
"spiffe://bar.abc");
+ args_.AddPropertyToAuthContext(GRPC_PEER_DNS_PROPERTY_NAME,
+ "foo.test.domain.com");
+ args_.AddPropertyToAuthContext(GRPC_PEER_DNS_PROPERTY_NAME,
+ "bar.test.domain.com");
EvaluateArgs args = args_.MakeEvaluateArgs();
+ // No match found in URI SANs, finds match in DNS SANs.
AuthenticatedAuthorizationMatcher matcher(
StringMatcher::Create(StringMatcher::Type::kExact,
- /*matcher=*/"spiffe://foo.abc",
+ /*matcher=*/"bar.test.domain.com",
/*case_sensitive=*/false)
.value());
- EXPECT_FALSE(matcher.Matches(args));
+ EXPECT_TRUE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedNothingMatches) {
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedDnsSanMatches) {
args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ args_.AddPropertyToAuthContext(GRPC_PEER_DNS_PROPERTY_NAME,
+ "foo.test.domain.com");
EvaluateArgs args = args_.MakeEvaluateArgs();
AuthenticatedAuthorizationMatcher matcher(
StringMatcher::Create(StringMatcher::Type::kExact,
- /*matcher=*/"foo",
+ /*matcher=*/"bar.test.domain.com",
/*case_sensitive=*/false)
.value());
EXPECT_FALSE(matcher.Matches(args));
}
-TEST_F(AuthorizationMatchersTest, NotAuthenticatedMatcher) {
+TEST_F(AuthorizationMatchersTest,
+ AuthenticatedMatcherSuccessfulSubjectMatches) {
+ args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ args_.AddPropertyToAuthContext(GRPC_X509_SUBJECT_PROPERTY_NAME,
+ "CN=abc,OU=Google");
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ // No match found in URI SANs and DNS SANs, finds match in Subject.
+ AuthenticatedAuthorizationMatcher matcher(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"CN=abc,OU=Google",
+ /*case_sensitive=*/false)
+ .value());
+ EXPECT_TRUE(matcher.Matches(args));
+}
+
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedSubjectMatches) {
args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ args_.AddPropertyToAuthContext(GRPC_X509_SUBJECT_PROPERTY_NAME,
+ "CN=abc,OU=Google");
EvaluateArgs args = args_.MakeEvaluateArgs();
AuthenticatedAuthorizationMatcher matcher(
- StringMatcher::Create(StringMatcher::Type::kExact, /*matcher=*/"foo",
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"CN=def,OU=Google",
/*case_sensitive=*/false)
- .value(),
- /*not_rule=*/true);
+ .value());
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
+TEST_F(
+ AuthorizationMatchersTest,
+ AuthenticatedMatcherWithoutClientCertMatchesSuccessfullyOnEmptyPrincipal) {
+ args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_TLS_TRANSPORT_SECURITY_TYPE);
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ AuthenticatedAuthorizationMatcher matcher(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"")
+ .value());
EXPECT_TRUE(matcher.Matches(args));
}
+TEST_F(AuthorizationMatchersTest, AuthenticatedMatcherFailedNothingMatches) {
+ args_.AddPropertyToAuthContext(GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ EvaluateArgs args = args_.MakeEvaluateArgs();
+ AuthenticatedAuthorizationMatcher matcher(
+ StringMatcher::Create(StringMatcher::Type::kExact,
+ /*matcher=*/"foo",
+ /*case_sensitive=*/false)
+ .value());
+ EXPECT_FALSE(matcher.Matches(args));
+}
+
TEST_F(AuthorizationMatchersTest, PolicyAuthorizationMatcherSuccessfulMatch) {
args_.AddPairToMetadata("key123", "foo");
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"key123", HeaderMatcher::Type::kExact,
- /*matcher=*/"foo")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"key123", HeaderMatcher::Type::kExact,
+ /*matcher=*/"foo")
+ .value())));
PolicyAuthorizationMatcher matcher(Rbac::Policy(
- Rbac::Permission(Rbac::Permission::RuleType::kOr, std::move(rules)),
- Rbac::Principal(Rbac::Principal::RuleType::kAny)));
+ Rbac::Permission(Rbac::Permission::MakeOrPermission(std::move(rules))),
+ Rbac::Principal::MakeAnyPrincipal()));
EXPECT_TRUE(matcher.Matches(args));
}
@@ -399,13 +598,13 @@ TEST_F(AuthorizationMatchersTest, PolicyAuthorizationMatcherFailedMatch) {
EvaluateArgs args = args_.MakeEvaluateArgs();
std::vector<std::unique_ptr<Rbac::Permission>> rules;
rules.push_back(absl::make_unique<Rbac::Permission>(
- Rbac::Permission::RuleType::kHeader,
- HeaderMatcher::Create(/*name=*/"key123", HeaderMatcher::Type::kExact,
- /*matcher=*/"bar")
- .value()));
+ Rbac::Permission::MakeHeaderPermission(
+ HeaderMatcher::Create(/*name=*/"key123", HeaderMatcher::Type::kExact,
+ /*matcher=*/"bar")
+ .value())));
PolicyAuthorizationMatcher matcher(Rbac::Policy(
- Rbac::Permission(Rbac::Permission::RuleType::kOr, std::move(rules)),
- Rbac::Principal(Rbac::Principal::RuleType::kAny)));
+ Rbac::Permission(Rbac::Permission::MakeOrPermission(std::move(rules))),
+ Rbac::Principal::MakeAnyPrincipal()));
EXPECT_FALSE(matcher.Matches(args));
}
diff --git a/grpc/test/core/security/aws_request_signer_test.cc b/grpc/test/core/security/aws_request_signer_test.cc
index bc5780fa..bf4fb15b 100644
--- a/grpc/test/core/security/aws_request_signer_test.cc
+++ b/grpc/test/core/security/aws_request_signer_test.cc
@@ -17,6 +17,7 @@
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
#include <gmock/gmock.h>
+
#include <grpc/grpc_security.h>
#include "test/core/util/test_config.h"
@@ -245,13 +246,10 @@ TEST(GrpcAwsRequestSignerTest, InvalidUrl) {
grpc_core::AwsRequestSigner signer("access_key_id", "secret_access_key",
"token", "POST", "invalid_url",
"us-east-1", "", {}, &error);
- grpc_slice expected_error_description =
- grpc_slice_from_static_string("Invalid Aws request url.");
- grpc_slice actual_error_description;
+ std::string actual_error_description;
GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
&actual_error_description));
- EXPECT_TRUE(grpc_slice_cmp(expected_error_description,
- actual_error_description) == 0);
+ EXPECT_EQ(actual_error_description, "Invalid Aws request url.");
GRPC_ERROR_UNREF(error);
}
@@ -261,20 +259,18 @@ TEST(GrpcAwsRequestSignerTest, DuplicateRequestDate) {
"access_key_id", "secret_access_key", "token", "POST", "invalid_url",
"us-east-1", "", {{"date", kBotoTestDate}, {"x-amz-date", kAmzTestDate}},
&error);
- grpc_slice expected_error_description = grpc_slice_from_static_string(
- "Only one of {date, x-amz-date} can be specified, not both.");
- grpc_slice actual_error_description;
+ std::string actual_error_description;
GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
&actual_error_description));
- EXPECT_TRUE(grpc_slice_cmp(expected_error_description,
- actual_error_description) == 0);
+ EXPECT_EQ(actual_error_description,
+ "Only one of {date, x-amz-date} can be specified, not both.");
GRPC_ERROR_UNREF(error);
}
} // namespace testing
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
diff --git a/grpc/test/core/security/channel_creds_registry_test.cc b/grpc/test/core/security/channel_creds_registry_test.cc
new file mode 100644
index 00000000..4c41d6a5
--- /dev/null
+++ b/grpc/test/core/security/channel_creds_registry_test.cc
@@ -0,0 +1,104 @@
+//
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "src/core/lib/security/credentials/channel_creds_registry.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/security/credentials/channel_creds_registry.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "test/core/util/test_config.h"
+
+namespace grpc_core {
+namespace testing {
+namespace {
+
+class TestChannelCredsFactory : public ChannelCredsFactory<> {
+ public:
+ absl::string_view creds_type() const override { return "test"; }
+ bool IsValidConfig(const Json& /*config*/) const override { return true; }
+ RefCountedPtr<grpc_channel_credentials> CreateChannelCreds(
+ const Json& /*config*/) const override {
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_fake_transport_security_credentials_create());
+ }
+};
+
+TEST(ChannelCredsRegistry2Test, DefaultCreds) {
+ // Default creds.
+ EXPECT_TRUE(CoreConfiguration::Get().channel_creds_registry().IsSupported(
+ "google_default"));
+ EXPECT_TRUE(CoreConfiguration::Get().channel_creds_registry().IsSupported(
+ "insecure"));
+ EXPECT_TRUE(
+ CoreConfiguration::Get().channel_creds_registry().IsSupported("fake"));
+
+ // Non-default creds.
+ EXPECT_EQ(
+ CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
+ "test", Json()),
+ nullptr);
+ EXPECT_EQ(
+ CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
+ "", Json()),
+ nullptr);
+}
+
+TEST(ChannelCredsRegistry2Test, Register) {
+ CoreConfiguration::Reset();
+ grpc_init();
+
+ // Before registration.
+ EXPECT_FALSE(
+ CoreConfiguration::Get().channel_creds_registry().IsSupported("test"));
+ EXPECT_EQ(
+ CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
+ "test", Json()),
+ nullptr);
+
+ // Registration.
+ CoreConfiguration::BuildSpecialConfiguration(
+ [](CoreConfiguration::Builder* builder) {
+ BuildCoreConfiguration(builder);
+ builder->channel_creds_registry()->RegisterChannelCredsFactory(
+ absl::make_unique<TestChannelCredsFactory>());
+ });
+
+ RefCountedPtr<grpc_channel_credentials> test_cred(
+ CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
+ "test", Json()));
+ EXPECT_TRUE(
+ CoreConfiguration::Get().channel_creds_registry().IsSupported("test"));
+ EXPECT_NE(test_cred.get(), nullptr);
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
+ grpc_init();
+ auto result = RUN_ALL_TESTS();
+ return result;
+}
diff --git a/grpc/test/core/security/check_gcp_environment_windows_test.cc b/grpc/test/core/security/check_gcp_environment_windows_test.cc
index 20b6d547..19341732 100644
--- a/grpc/test/core/security/check_gcp_environment_windows_test.cc
+++ b/grpc/test/core/security/check_gcp_environment_windows_test.cc
@@ -27,6 +27,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/tmpfile.h"
namespace grpc_core {
diff --git a/grpc/test/core/security/create_jwt.cc b/grpc/test/core/security/create_jwt.cc
index 2ea640b6..a82e07a8 100644
--- a/grpc/test/core/security/create_jwt.cc
+++ b/grpc/test/core/security/create_jwt.cc
@@ -19,13 +19,12 @@
#include <stdio.h>
#include <string.h>
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
-
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "test/core/util/cmdline.h"
void create_jwt(const char* json_key_file_path, const char* service_url,
diff --git a/grpc/test/core/security/credentials_test.cc b/grpc/test/core/security/credentials_test.cc
index 0533247a..6c53a397 100644
--- a/grpc/test/core/security/credentials_test.cc
+++ b/grpc/test/core/security/credentials_test.cc
@@ -20,12 +20,14 @@
#include "src/core/lib/security/credentials/credentials.h"
-#include <openssl/rsa.h>
#include <stdlib.h>
#include <string.h>
#include <string>
+#include <gmock/gmock.h>
+#include <openssl/rsa.h>
+
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@@ -42,8 +44,14 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/httpcli.h"
+#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
+#include "src/core/lib/promise/promise.h"
+#include "src/core/lib/promise/seq.h"
+#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/composite/composite_credentials.h"
#include "src/core/lib/security/credentials/external/aws_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
@@ -51,26 +59,36 @@
#include "src/core/lib/security/credentials/external/url_external_account_credentials.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
+#include "src/core/lib/security/credentials/iam/iam_credentials.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
+#include "src/core/lib/security/credentials/xds/xds_credentials.h"
#include "src/core/lib/security/transport/auth_filters.h"
+#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/uri/uri_parser.h"
#include "test/core/util/test_config.h"
-using grpc_core::internal::grpc_flush_cached_google_default_credentials;
-using grpc_core::internal::set_gce_tenancy_checker_for_testing;
+namespace grpc_core {
+
+using internal::grpc_flush_cached_google_default_credentials;
+using internal::set_gce_tenancy_checker_for_testing;
+
+namespace {
+
+auto* g_memory_allocator = new MemoryAllocator(
+ ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator("test"));
/* -- Constants. -- */
-static const char test_google_iam_authorization_token[] = "blahblahblhahb";
-static const char test_google_iam_authority_selector[] = "respectmyauthoritah";
-static const char test_oauth2_bearer_token[] =
- "Bearer blaaslkdjfaslkdfasdsfasf";
+const char test_google_iam_authorization_token[] = "blahblahblhahb";
+const char test_google_iam_authority_selector[] = "respectmyauthoritah";
+const char test_oauth2_bearer_token[] = "Bearer blaaslkdjfaslkdfasdsfasf";
/* This JSON key was generated with the GCE console and revoked immediately.
The identifiers have been changed as well.
Maximum size for a string literal is 509 chars in C89, yay! */
-static const char test_json_key_str_part1[] =
+const char test_json_key_str_part1[] =
"{ \"private_key\": \"-----BEGIN PRIVATE KEY-----"
"\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE"
"qg"
@@ -81,7 +99,7 @@ static const char test_json_key_str_part1[] =
"zuFoPrRc6qL9p2SsnV7txrunTyJkkOnPLND9ABAXybRTlcVKP/sGgza\\n/"
"8HpCqFYM9V8f34SBWfD4fRFT+n/"
"73cfRUtGXdXpseva2lh8RilIQfPhNZAncenU\\ngqXjDvpkypEusgXAykECQQD+";
-static const char test_json_key_str_part2[] =
+const char test_json_key_str_part2[] =
"53XxNVnxBHsYb+AYEfklR96yVi8HywjVHP34+OQZ\\nCslxoHQM8s+"
"dBnjfScLu22JqkPv04xyxmt0QAKm9+vTdAkEA4ib7YvEAn2jXzcCI\\nEkoy2L/"
"XydR1GCHoacdfdAwiL2npOdnbvi4ZmdYRPY1LSTO058tQHKVXV7NLeCa3\\nAARh2QJBAMKeDA"
@@ -93,7 +111,7 @@ static const char test_json_key_str_part2[] =
"5nZ68ECQQDvYuI3\\nLyK5fS8g0SYbmPOL9TlcHDOqwG0mrX9qpg5DC2fniXNSrrZ64GTDKdzZ"
"Y"
"Ap6LI9W\\nIqv4vr6y38N79TTC\\n-----END PRIVATE KEY-----\\n\", ";
-static const char test_json_key_str_part3[] =
+const char test_json_key_str_part3[] =
"\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", "
"\"client_email\": "
"\"777-abaslkan11hlb6nmim3bpspl31ud@developer.gserviceaccount."
@@ -102,99 +120,141 @@ static const char test_json_key_str_part3[] =
"com\", \"type\": \"service_account\" }";
/* Test refresh token. */
-static const char test_refresh_token_str[] =
+const char test_refresh_token_str[] =
"{ \"client_id\": \"32555999999.apps.googleusercontent.com\","
" \"client_secret\": \"EmssLNjJy1332hD4KFsecret\","
" \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\","
" \"type\": \"authorized_user\"}";
-static const char valid_oauth2_json_response[] =
+/* Test external account credentials. */
+const char test_external_account_credentials_str[] =
+ "{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_"
+ "token_type\":\"subject_token_type\",\"service_account_impersonation_"
+ "url\":\"https://iamcredentials.googleapis.com:5555/"
+ "service_account_impersonation_url\",\"token_url\":\"https://"
+ "sts.googleapis.com:5555/"
+ "token\",\"token_info_url\":\"https://sts.googleapis.com:5555/"
+ "token_info\",\"credential_source\":{\"file\":"
+ "\"credentials_file_path\"},"
+ "\"quota_project_id\":\"quota_"
+ "project_id\",\"client_id\":\"client_id\",\"client_secret\":\"client_"
+ "secret\"}";
+
+const char test_external_account_credentials_multi_pattern_sts_str[] =
+ "{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_"
+ "token_type\":\"subject_token_type\",\"service_account_impersonation_"
+ "url\":\"https://sts.test.googleapis.com:5555/"
+ "service_account_impersonation_url\",\"token_url\":\"https://"
+ "test.sts.googleapis.com:5555/token\",\"token_info_url\":\"https://"
+ "test-sts.googleapis.com:5555/"
+ "token_info\",\"credential_source\":{\"file\":\"credentials_file_path\"},"
+ "\"quota_project_id\":\"quota_"
+ "project_id\",\"client_id\":\"client_id\",\"client_secret\":\"client_"
+ "secret\"}";
+
+const char test_external_account_credentials_multi_pattern_iam_str[] =
+ "{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_"
+ "token_type\":\"subject_token_type\",\"service_account_impersonation_"
+ "url\":\"https://iamcredentials.test.googleapis.com:5555/"
+ "service_account_impersonation_url\",\"token_url\":\"https://"
+ "test.iamcredentials.googleapis.com:5555/"
+ "token\",\"token_info_url\":\"https://"
+ "test-iamcredentials.googleapis.com:5555/"
+ "token_info\",\"credential_source\":{\"file\":\"credentials_file_path\"},"
+ "\"quota_project_id\":\"quota_"
+ "project_id\",\"client_id\":\"client_id\",\"client_secret\":\"client_"
+ "secret\"}";
+
+const char valid_oauth2_json_response[] =
"{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
" \"expires_in\":3599, "
" \"token_type\":\"Bearer\"}";
-static const char valid_sts_json_response[] =
+const char valid_sts_json_response[] =
"{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
" \"expires_in\":3599, "
" \"issued_token_type\":\"urn:ietf:params:oauth:token-type:access_token\", "
" \"token_type\":\"Bearer\"}";
-static const char test_scope[] = "perm1 perm2";
+const char test_scope[] = "perm1 perm2";
-static const char test_signed_jwt[] =
+const char test_signed_jwt[] =
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0OTRkN2M1YWU2MGRmOTcyNmM4YW"
"U0MDcyZTViYTdmZDkwODg2YzcifQ";
-static const char test_signed_jwt_token_type[] =
+const char test_signed_jwt_token_type[] =
"urn:ietf:params:oauth:token-type:id_token";
-static const char test_signed_jwt2[] =
+const char test_signed_jwt2[] =
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImY0OTRkN2M1YWU2MGRmOTcyNmM5YW"
"U2MDcyZTViYTdnZDkwODg5YzcifQ";
-static const char test_signed_jwt_token_type2[] =
+const char test_signed_jwt_token_type2[] =
"urn:ietf:params:oauth:token-type:jwt";
-static const char test_signed_jwt_path_prefix[] = "test_sign_jwt";
+const char test_signed_jwt_path_prefix[] = "test_sign_jwt";
-static const char test_service_url[] = "https://foo.com/foo.v1";
-static const char other_test_service_url[] = "https://bar.com/bar.v1";
+const char test_service_url[] = "https://foo.com/foo.v1";
+const char test_service_url_no_service_name[] = "https://foo.com/";
+const char other_test_service_url_no_service_name[] = "https://bar.com/";
+const char test_method[] = "ThisIsNotAMethod";
-static const char test_sts_endpoint_url[] =
- "https://foo.com:5555/v1/token-exchange";
+const char kTestUrlScheme[] = "https";
+const char kTestAuthority[] = "foo.com";
+const char kTestPath[] = "/foo.v1/ThisIsNotAMethod";
+const char kTestOtherAuthority[] = "bar.com";
+const char kTestOtherPath[] = "/bar.v1/ThisIsNotAMethod";
-static const char test_method[] = "ThisIsNotAMethod";
+const char test_sts_endpoint_url[] = "https://foo.com:5555/v1/token-exchange";
-static const char valid_external_account_creds_token_exchange_response[] =
+const char valid_external_account_creds_token_exchange_response[] =
"{\"access_token\":\"token_exchange_access_token\","
" \"expires_in\":3599,"
" \"token_type\":\"Bearer\"}";
-static const char
+const char
valid_external_account_creds_service_account_impersonation_response[] =
"{\"accessToken\":\"service_account_impersonation_access_token\","
" \"expireTime\":\"2050-01-01T00:00:00Z\"}";
-static const char
+const char
valid_url_external_account_creds_options_credential_source_format_text[] =
"{\"url\":\"https://foo.com:5555/generate_subject_token_format_text\","
"\"headers\":{\"Metadata-Flavor\":\"Google\"}}";
-static const char
+const char
valid_url_external_account_creds_options_credential_source_with_qurey_params_format_text
[] = "{\"url\":\"https://foo.com:5555/"
"path/to/url/creds?p1=v1&p2=v2\","
"\"headers\":{\"Metadata-Flavor\":\"Google\"}}";
-static const char
+const char
valid_url_external_account_creds_retrieve_subject_token_response_format_text
[] = "test_subject_token";
-static const char
+const char
valid_url_external_account_creds_options_credential_source_format_json[] =
"{\"url\":\"https://foo.com:5555/generate_subject_token_format_json\","
"\"headers\":{\"Metadata-Flavor\":\"Google\"},"
"\"format\":{\"type\":\"json\",\"subject_token_field_name\":\"access_"
"token\"}}";
-static const char
+const char
valid_url_external_account_creds_retrieve_subject_token_response_format_json
[] = "{\"access_token\":\"test_subject_token\"}";
-static const char
- invalid_url_external_account_creds_options_credential_source[] =
- "{\"url\":\"invalid_credential_source_url\","
- "\"headers\":{\"Metadata-Flavor\":\"Google\"}}";
+const char invalid_url_external_account_creds_options_credential_source[] =
+ "{\"url\":\"invalid_credential_source_url\","
+ "\"headers\":{\"Metadata-Flavor\":\"Google\"}}";
-static const char
- valid_aws_external_account_creds_retrieve_signing_keys_response[] =
- "{\"AccessKeyId\":\"test_access_key_id\",\"SecretAccessKey\":"
- "\"test_secret_access_key\",\"Token\":\"test_token\"}";
+const char valid_aws_external_account_creds_retrieve_signing_keys_response[] =
+ "{\"AccessKeyId\":\"test_access_key_id\",\"SecretAccessKey\":"
+ "\"test_secret_access_key\",\"Token\":\"test_token\"}";
-static const char valid_aws_external_account_creds_options_credential_source[] =
+const char valid_aws_external_account_creds_options_credential_source[] =
"{\"environment_id\":\"aws1\","
"\"region_url\":\"https://foo.com:5555/region_url\","
"\"url\":\"https://foo.com:5555/url\","
"\"regional_cred_verification_url\":\"https://foo.com:5555/"
"regional_cred_verification_url_{region}\"}";
-static const char
+const char
invalid_aws_external_account_creds_options_credential_source_unmatched_environment_id
[] = "{\"environment_id\":\"unsupported_aws_version\","
"\"region_url\":\"https://foo.com:5555/region_url\","
@@ -202,7 +262,7 @@ static const char
"\"regional_cred_verification_url\":\"https://foo.com:5555/"
"regional_cred_verification_url_{region}\"}";
-static const char
+const char
invalid_aws_external_account_creds_options_credential_source_invalid_region_url
[] = "{\"environment_id\":\"aws1\","
"\"region_url\":\"invalid_region_url\","
@@ -210,7 +270,7 @@ static const char
"\"regional_cred_verification_url\":\"https://foo.com:5555/"
"regional_cred_verification_url_{region}\"}";
-static const char
+const char
invalid_aws_external_account_creds_options_credential_source_invalid_url[] =
"{\"environment_id\":\"aws1\","
"\"region_url\":\"https://foo.com:5555/region_url\","
@@ -218,7 +278,7 @@ static const char
"\"regional_cred_verification_url\":\"https://foo.com:5555/"
"regional_cred_verification_url_{region}\"}";
-static const char
+const char
invalid_aws_external_account_creds_options_credential_source_missing_role_name
[] = "{\"environment_id\":\"aws1\","
"\"region_url\":\"https://foo.com:5555/region_url\","
@@ -226,7 +286,7 @@ static const char
"\"regional_cred_verification_url\":\"https://foo.com:5555/"
"regional_cred_verification_url_{region}\"}";
-static const char
+const char
invalid_aws_external_account_creds_options_credential_source_invalid_regional_cred_verification_url
[] = "{\"environment_id\":\"aws1\","
"\"region_url\":\"https://foo.com:5555/region_url\","
@@ -236,13 +296,13 @@ static const char
/* -- Global state flags. -- */
-static bool g_test_is_on_gce = false;
+bool g_test_is_on_gce = false;
-static bool g_test_gce_tenancy_checker_called = false;
+bool g_test_gce_tenancy_checker_called = false;
/* -- Utils. -- */
-static char* test_json_key_str(void) {
+char* test_json_key_str(void) {
size_t result_len = strlen(test_json_key_str_part1) +
strlen(test_json_key_str_part2) +
strlen(test_json_key_str_part3);
@@ -256,8 +316,8 @@ static char* test_json_key_str(void) {
return result;
}
-static grpc_httpcli_response http_response(int status, const char* body) {
- grpc_httpcli_response response;
+grpc_http_response http_response(int status, const char* body) {
+ grpc_http_response response;
response = {};
response.status = status;
response.body = gpr_strdup(const_cast<char*>(body));
@@ -267,293 +327,276 @@ static grpc_httpcli_response http_response(int status, const char* body) {
/* -- Tests. -- */
-static void test_empty_md_array(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_credentials_mdelem_array md_array;
- md_array = {};
- GPR_ASSERT(md_array.md == nullptr);
- GPR_ASSERT(md_array.size == 0);
- grpc_credentials_mdelem_array_destroy(&md_array);
-}
-
-static void test_add_to_empty_md_array(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_credentials_mdelem_array md_array;
- md_array = {};
- const char* key = "hello";
- const char* value = "there blah blah blah blah blah blah blah";
- grpc_mdelem md = grpc_mdelem_from_slices(
- grpc_slice_from_copied_string(key), grpc_slice_from_copied_string(value));
- grpc_credentials_mdelem_array_add(&md_array, md);
- GPR_ASSERT(md_array.size == 1);
- GPR_ASSERT(grpc_mdelem_eq(md, md_array.md[0]));
- GRPC_MDELEM_UNREF(md);
- grpc_credentials_mdelem_array_destroy(&md_array);
-}
-
-static void test_add_abunch_to_md_array(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_credentials_mdelem_array md_array;
- md_array = {};
- const char* key = "hello";
- const char* value = "there blah blah blah blah blah blah blah";
- grpc_mdelem md = grpc_mdelem_from_slices(
- grpc_slice_from_copied_string(key), grpc_slice_from_copied_string(value));
- size_t num_entries = 1000;
- for (size_t i = 0; i < num_entries; ++i) {
- grpc_credentials_mdelem_array_add(&md_array, md);
- }
- for (size_t i = 0; i < num_entries; ++i) {
- GPR_ASSERT(grpc_mdelem_eq(md_array.md[i], md));
- }
- GRPC_MDELEM_UNREF(md);
- grpc_credentials_mdelem_array_destroy(&md_array);
-}
-
-static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response =
- http_response(200, valid_oauth2_json_response);
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingOk) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response = http_response(200, valid_oauth2_json_response);
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_OK);
- GPR_ASSERT(token_lifetime == 3599 * GPR_MS_PER_SEC);
- GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDKEY(token_md), "authorization") == 0);
- GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(token_md),
- "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_") ==
- 0);
- GRPC_MDELEM_UNREF(token_md);
+ &response, &token_value, &token_lifetime) ==
+ GRPC_CREDENTIALS_OK);
+ GPR_ASSERT(token_lifetime == Duration::Seconds(3599));
+ GPR_ASSERT(token_value->as_string_view() ==
+ "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_");
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_bad_http_status(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response =
- http_response(401, valid_oauth2_json_response);
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingBadHttpStatus) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response = http_response(401, valid_oauth2_json_response);
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_empty_http_body(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response = http_response(200, "");
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingEmptyHttpBody) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response = http_response(200, "");
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_invalid_json(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response =
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingInvalidJson) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response =
http_response(200,
"{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
" \"expires_in\":3599, "
" \"token_type\":\"Bearer\"");
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_missing_token(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response = http_response(200,
- "{"
- " \"expires_in\":3599, "
- " \"token_type\":\"Bearer\"}");
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingMissingToken) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response = http_response(200,
+ "{"
+ " \"expires_in\":3599, "
+ " \"token_type\":\"Bearer\"}");
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_missing_token_type(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response =
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingMissingTokenType) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response =
http_response(200,
"{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
" \"expires_in\":3599, "
"}");
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-static void test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime(
- void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_mdelem token_md = GRPC_MDNULL;
- grpc_millis token_lifetime;
- grpc_httpcli_response response =
+TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingMissingTokenLifetime) {
+ ExecCtx exec_ctx;
+ absl::optional<Slice> token_value;
+ Duration token_lifetime;
+ grpc_http_response response =
http_response(200,
"{\"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_\","
" \"token_type\":\"Bearer\"}");
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
+ &response, &token_value, &token_lifetime) ==
GRPC_CREDENTIALS_ERROR);
grpc_http_response_destroy(&response);
}
-typedef struct {
- const char* key;
- const char* value;
-} expected_md;
+namespace {
-typedef struct {
- grpc_error_handle expected_error;
- const expected_md* expected;
- size_t expected_size;
- grpc_credentials_mdelem_array md_array;
- grpc_closure on_request_metadata;
- grpc_call_credentials* creds;
- grpc_polling_entity pollent;
-} request_metadata_state;
-
-static void check_metadata(const expected_md* expected,
- grpc_credentials_mdelem_array* md_array) {
- for (size_t i = 0; i < md_array->size; ++i) {
- size_t j;
- for (j = 0; j < md_array->size; ++j) {
- if (0 ==
- grpc_slice_str_cmp(GRPC_MDKEY(md_array->md[j]), expected[i].key)) {
- GPR_ASSERT(grpc_slice_str_cmp(GRPC_MDVALUE(md_array->md[j]),
- expected[i].value) == 0);
- break;
- }
- }
- if (j == md_array->size) {
- gpr_log(GPR_ERROR, "key %s not found", expected[i].key);
- GPR_ASSERT(0);
- }
+class RequestMetadataState : public RefCounted<RequestMetadataState> {
+ public:
+ static RefCountedPtr<RequestMetadataState> NewInstance(
+ grpc_error_handle expected_error, std::string expected) {
+ return MakeRefCounted<RequestMetadataState>(
+ expected_error, std::move(expected),
+ grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create()));
}
-}
-static void check_request_metadata(void* arg, grpc_error_handle error) {
- request_metadata_state* state = static_cast<request_metadata_state*>(arg);
- gpr_log(GPR_INFO, "expected_error: %s",
- grpc_error_std_string(state->expected_error).c_str());
- gpr_log(GPR_INFO, "actual_error: %s", grpc_error_std_string(error).c_str());
- if (state->expected_error == GRPC_ERROR_NONE) {
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- } else {
- grpc_slice expected_error;
- GPR_ASSERT(grpc_error_get_str(state->expected_error,
- GRPC_ERROR_STR_DESCRIPTION, &expected_error));
- grpc_slice actual_error;
- GPR_ASSERT(
- grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
- GPR_ASSERT(grpc_slice_cmp(expected_error, actual_error) == 0);
- GRPC_ERROR_UNREF(state->expected_error);
+ RequestMetadataState(grpc_error_handle expected_error, std::string expected,
+ grpc_polling_entity pollent)
+ : expected_error_(expected_error),
+ expected_(std::move(expected)),
+ pollent_(pollent) {}
+
+ ~RequestMetadataState() override {
+ grpc_pollset_set_destroy(grpc_polling_entity_pollset_set(&pollent_));
}
- gpr_log(GPR_INFO, "expected_size=%" PRIdPTR " actual_size=%" PRIdPTR,
- state->expected_size, state->md_array.size);
- GPR_ASSERT(state->md_array.size == state->expected_size);
- check_metadata(state->expected, &state->md_array);
- grpc_credentials_mdelem_array_destroy(&state->md_array);
- grpc_pollset_set_destroy(grpc_polling_entity_pollset_set(&state->pollent));
- gpr_free(state);
-}
-
-static request_metadata_state* make_request_metadata_state(
- grpc_error_handle expected_error, const expected_md* expected,
- size_t expected_size) {
- request_metadata_state* state =
- static_cast<request_metadata_state*>(gpr_zalloc(sizeof(*state)));
- state->expected_error = expected_error;
- state->expected = expected;
- state->expected_size = expected_size;
- state->pollent =
- grpc_polling_entity_create_from_pollset_set(grpc_pollset_set_create());
- GRPC_CLOSURE_INIT(&state->on_request_metadata, check_request_metadata, state,
- grpc_schedule_on_exec_ctx);
- return state;
-}
-
-static void run_request_metadata_test(grpc_call_credentials* creds,
- grpc_auth_metadata_context auth_md_ctx,
- request_metadata_state* state) {
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (creds->get_request_metadata(&state->pollent, auth_md_ctx,
- &state->md_array, &state->on_request_metadata,
- &error)) {
- // Synchronous result. Invoke the callback directly.
- check_request_metadata(state, error);
+
+ void RunRequestMetadataTest(grpc_call_credentials* creds,
+ const char* url_scheme, const char* authority,
+ const char* path) {
+ auto self = Ref();
+ get_request_metadata_args_.security_connector =
+ MakeRefCounted<BogusSecurityConnector>(url_scheme);
+ md_.Set(HttpAuthorityMetadata(), Slice::FromStaticString(authority));
+ md_.Set(HttpPathMetadata(), Slice::FromStaticString(path));
+ activity_ = MakeActivity(
+ [this, creds] {
+ return Seq(creds->GetRequestMetadata(
+ ClientMetadataHandle::TestOnlyWrap(&md_),
+ &get_request_metadata_args_),
+ [this](absl::StatusOr<ClientMetadataHandle> metadata) {
+ if (metadata.ok()) {
+ GPR_ASSERT(metadata->get() == &md_);
+ }
+ return metadata.status();
+ });
+ },
+ ExecCtxWakeupScheduler(),
+ [self](absl::Status status) mutable {
+ self->CheckRequestMetadata(
+ absl_status_to_grpc_error(std::move(status)));
+ self.reset();
+ },
+ arena_.get(), &pollent_);
+ }
+
+ private:
+ // No-op security connector, exists only to inject url_scheme.
+ class BogusSecurityConnector : public grpc_channel_security_connector {
+ public:
+ explicit BogusSecurityConnector(absl::string_view url_scheme)
+ : grpc_channel_security_connector(url_scheme, nullptr, nullptr) {}
+
+ void check_peer(tsi_peer, grpc_endpoint*, RefCountedPtr<grpc_auth_context>*,
+ grpc_closure*) override {
+ GPR_ASSERT(false);
+ }
+
+ void cancel_check_peer(grpc_closure*, grpc_error_handle) override {
+ GPR_ASSERT(false);
+ }
+
+ int cmp(const grpc_security_connector*) const override {
+ GPR_UNREACHABLE_CODE(return 0);
+ }
+
+ ArenaPromise<absl::Status> CheckCallHost(absl::string_view,
+ grpc_auth_context*) override {
+ GPR_UNREACHABLE_CODE(
+ return Immediate(absl::PermissionDeniedError("should never happen")));
+ }
+
+ void add_handshakers(const grpc_channel_args*, grpc_pollset_set*,
+ HandshakeManager*) override {
+ GPR_ASSERT(false);
+ }
+ };
+
+ void CheckRequestMetadata(grpc_error_handle error) {
+ gpr_log(GPR_INFO, "expected_error: %s",
+ grpc_error_std_string(expected_error_).c_str());
+ gpr_log(GPR_INFO, "actual_error: %s", grpc_error_std_string(error).c_str());
+ if (expected_error_ == GRPC_ERROR_NONE) {
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ } else {
+ std::string expected_error;
+ GPR_ASSERT(grpc_error_get_str(expected_error_, GRPC_ERROR_STR_DESCRIPTION,
+ &expected_error));
+ std::string actual_error;
+ GPR_ASSERT(
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
+ GPR_ASSERT(expected_error == actual_error);
+ GRPC_ERROR_UNREF(expected_error_);
+ }
+ md_.Remove(HttpAuthorityMetadata());
+ md_.Remove(HttpPathMetadata());
+ gpr_log(GPR_INFO, "expected metadata: %s", expected_.c_str());
+ gpr_log(GPR_INFO, "actual metadata: %s", md_.DebugString().c_str());
+ GPR_ASSERT(md_.DebugString() == expected_);
GRPC_ERROR_UNREF(error);
}
-}
-static void test_google_iam_creds(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {{GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
- test_google_iam_authorization_token},
- {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
- test_google_iam_authority_selector}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+ private:
+ grpc_error_handle expected_error_;
+ std::string expected_;
+ ScopedArenaPtr arena_ = MakeScopedArena(1024, g_memory_allocator);
+ grpc_metadata_batch md_{arena_.get()};
+ grpc_call_credentials::GetRequestMetadataArgs get_request_metadata_args_;
+ grpc_polling_entity pollent_;
+ ActivityPtr activity_;
+};
+
+} // namespace
+
+TEST(CredentialsTest, TestGoogleIamCreds) {
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ absl::StrCat(GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, ": ",
+ test_google_iam_authorization_token, ", ",
+ GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, ": ",
+ test_google_iam_authority_selector));
grpc_call_credentials* creds = grpc_google_iam_credentials_create(
test_google_iam_authorization_token, test_google_iam_authority_selector,
nullptr);
/* Check security level. */
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- run_request_metadata_test(creds, auth_md_ctx, state);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
creds->Unref();
}
-static void test_access_token_creds(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {{GRPC_AUTHORIZATION_METADATA_KEY, "Bearer blah"}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+TEST(CredentialsTest, TestAccessTokenCreds) {
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE,
+ "authorization: Bearer blah");
grpc_call_credentials* creds =
grpc_access_token_credentials_create("blah", nullptr);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- GPR_ASSERT(strcmp(creds->type(), GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
+ GPR_ASSERT(strcmp(creds->type(), grpc_access_token_credentials::Type()) == 0);
/* Check security level. */
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
creds->Unref();
}
namespace {
class check_channel_oauth2 final : public grpc_channel_credentials {
public:
- check_channel_oauth2() : grpc_channel_credentials("mock") {}
- ~check_channel_oauth2() override = default;
-
- grpc_core::RefCountedPtr<grpc_channel_security_connector>
- create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* /*target*/, const grpc_channel_args* /*args*/,
+ RefCountedPtr<grpc_channel_security_connector> create_security_connector(
+ RefCountedPtr<grpc_call_credentials> call_creds, const char* /*target*/,
+ const grpc_channel_args* /*args*/,
grpc_channel_args** /*new_args*/) override {
- GPR_ASSERT(strcmp(type(), "mock") == 0);
+ GPR_ASSERT(strcmp(type(), "check_channel_oauth2") == 0);
GPR_ASSERT(call_creds != nullptr);
- GPR_ASSERT(strcmp(call_creds->type(), GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) ==
- 0);
+ GPR_ASSERT(call_creds->type() == grpc_access_token_credentials::Type());
return nullptr;
}
+
+ const char* type() const override { return "check_channel_oauth2"; }
+
+ private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return QsortCompare(static_cast<const grpc_channel_credentials*>(this),
+ other);
+ }
};
} // namespace
-static void test_channel_oauth2_composite_creds(void) {
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestChannelOauth2CompositeCreds) {
+ ExecCtx exec_ctx;
grpc_channel_args* new_args;
grpc_channel_credentials* channel_creds = new check_channel_oauth2();
grpc_call_credentials* oauth2_creds =
@@ -568,20 +611,18 @@ static void test_channel_oauth2_composite_creds(void) {
grpc_channel_credentials_release(channel_oauth2_creds);
}
-static void test_oauth2_google_iam_composite_creds(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {GRPC_AUTHORIZATION_METADATA_KEY, test_oauth2_bearer_token},
- {GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY,
- test_google_iam_authorization_token},
- {GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY,
- test_google_iam_authority_selector}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestOauth2GoogleIamCompositeCreds) {
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ absl::StrCat(GRPC_AUTHORIZATION_METADATA_KEY, ": ",
+ test_oauth2_bearer_token, ", ",
+ GRPC_IAM_AUTHORIZATION_TOKEN_METADATA_KEY, ": ",
+ test_google_iam_authorization_token, ", ",
+ GRPC_IAM_AUTHORITY_SELECTOR_METADATA_KEY, ": ",
+ test_google_iam_authority_selector));
grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create(
- "authorization", test_oauth2_bearer_token, false);
+ "authorization", test_oauth2_bearer_token);
/* Check security level of fake credentials. */
GPR_ASSERT(oauth2_creds->min_security_level() == GRPC_SECURITY_NONE);
@@ -598,49 +639,52 @@ static void test_oauth2_google_iam_composite_creds(void) {
oauth2_creds->Unref();
google_iam_creds->Unref();
- GPR_ASSERT(strcmp(composite_creds->type(),
- GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0);
+ GPR_ASSERT(composite_creds->type() ==
+ grpc_composite_call_credentials::Type());
const grpc_composite_call_credentials::CallCredentialsList& creds_list =
static_cast<const grpc_composite_call_credentials*>(composite_creds)
->inner();
GPR_ASSERT(creds_list.size() == 2);
- GPR_ASSERT(strcmp(creds_list[0]->type(), GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) ==
- 0);
- GPR_ASSERT(strcmp(creds_list[1]->type(), GRPC_CALL_CREDENTIALS_TYPE_IAM) ==
- 0);
- run_request_metadata_test(composite_creds, auth_md_ctx, state);
+ GPR_ASSERT(creds_list[0]->type() == grpc_md_only_test_credentials::Type());
+ GPR_ASSERT(creds_list[1]->type() == grpc_google_iam_credentials::Type());
+ state->RunRequestMetadataTest(composite_creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
composite_creds->Unref();
}
namespace {
class check_channel_oauth2_google_iam final : public grpc_channel_credentials {
public:
- check_channel_oauth2_google_iam() : grpc_channel_credentials("mock") {}
- ~check_channel_oauth2_google_iam() override = default;
-
- grpc_core::RefCountedPtr<grpc_channel_security_connector>
- create_security_connector(
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds,
- const char* /*target*/, const grpc_channel_args* /*args*/,
+ RefCountedPtr<grpc_channel_security_connector> create_security_connector(
+ RefCountedPtr<grpc_call_credentials> call_creds, const char* /*target*/,
+ const grpc_channel_args* /*args*/,
grpc_channel_args** /*new_args*/) override {
- GPR_ASSERT(strcmp(type(), "mock") == 0);
+ GPR_ASSERT(strcmp(type(), "check_channel_oauth2_google_iam") == 0);
GPR_ASSERT(call_creds != nullptr);
- GPR_ASSERT(
- strcmp(call_creds->type(), GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE) == 0);
+ GPR_ASSERT(call_creds->type() == grpc_composite_call_credentials::Type());
const grpc_composite_call_credentials::CallCredentialsList& creds_list =
static_cast<const grpc_composite_call_credentials*>(call_creds.get())
->inner();
- GPR_ASSERT(
- strcmp(creds_list[0]->type(), GRPC_CALL_CREDENTIALS_TYPE_OAUTH2) == 0);
- GPR_ASSERT(strcmp(creds_list[1]->type(), GRPC_CALL_CREDENTIALS_TYPE_IAM) ==
- 0);
+ GPR_ASSERT(creds_list[0]->type() == grpc_access_token_credentials::Type());
+ GPR_ASSERT(creds_list[1]->type() == grpc_google_iam_credentials::Type());
return nullptr;
}
+
+ const char* type() const override {
+ return "check_channel_oauth2_google_iam";
+ }
+
+ private:
+ int cmp_impl(const grpc_channel_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return QsortCompare(static_cast<const grpc_channel_credentials*>(this),
+ other);
+ }
};
} // namespace
-static void test_channel_oauth2_google_iam_composite_creds(void) {
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestChannelOauth2GoogleIamCompositeCreds) {
+ ExecCtx exec_ctx;
grpc_channel_args* new_args;
grpc_channel_credentials* channel_creds =
new check_channel_oauth2_google_iam();
@@ -667,112 +711,113 @@ static void test_channel_oauth2_google_iam_composite_creds(void) {
grpc_channel_credentials_release(channel_oauth2_iam_creds);
}
-static void validate_compute_engine_http_request(
- const grpc_httpcli_request* request) {
- GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, "metadata.google.internal.") == 0);
+void validate_compute_engine_http_request(const grpc_http_request* request,
+ const char* host, const char* path) {
+ GPR_ASSERT(strcmp(host, "metadata.google.internal.") == 0);
GPR_ASSERT(
- strcmp(request->http.path,
+ strcmp(path,
"/computeMetadata/v1/instance/service-accounts/default/token") ==
0);
- GPR_ASSERT(request->http.hdr_count == 1);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Metadata-Flavor") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value, "Google") == 0);
+ GPR_ASSERT(request->hdr_count == 1);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Metadata-Flavor") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[0].value, "Google") == 0);
}
-static int compute_engine_httpcli_get_success_override(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
- validate_compute_engine_http_request(request);
+int compute_engine_httpcli_get_success_override(
+ const grpc_http_request* request, const char* host, const char* path,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
+ validate_compute_engine_http_request(request, host, path);
*response = http_response(200, valid_oauth2_json_response);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int compute_engine_httpcli_get_failure_override(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
- validate_compute_engine_http_request(request);
+int compute_engine_httpcli_get_failure_override(
+ const grpc_http_request* request, const char* host, const char* path,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
+ validate_compute_engine_http_request(request, host, path);
*response = http_response(403, "Not Authorized.");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int httpcli_post_should_not_be_called(
- const grpc_httpcli_request* /*request*/, const char* /*body_bytes*/,
- size_t /*body_size*/, grpc_millis /*deadline*/, grpc_closure* /*on_done*/,
- grpc_httpcli_response* /*response*/) {
+int httpcli_post_should_not_be_called(
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* /*path*/, const char* /*body_bytes*/, size_t /*body_size*/,
+ Timestamp /*deadline*/, grpc_closure* /*on_done*/,
+ grpc_http_response* /*response*/) {
GPR_ASSERT("HTTP POST should not be called" == nullptr);
return 1;
}
-static int httpcli_get_should_not_be_called(
- const grpc_httpcli_request* /*request*/, grpc_millis /*deadline*/,
- grpc_closure* /*on_done*/, grpc_httpcli_response* /*response*/) {
+int httpcli_get_should_not_be_called(const grpc_http_request* /*request*/,
+ const char* /*host*/, const char* /*path*/,
+ Timestamp /*deadline*/,
+ grpc_closure* /*on_done*/,
+ grpc_http_response* /*response*/) {
GPR_ASSERT("HTTP GET should not be called" == nullptr);
return 1;
}
-static void test_compute_engine_creds_success() {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+TEST(CredentialsTest, TestComputeEngineCredsSuccess) {
+ ExecCtx exec_ctx;
+ std::string emd = "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_";
const char expected_creds_debug_string[] =
"GoogleComputeEngineTokenFetcherCredentials{"
"OAuth2TokenFetcherCredentials}";
grpc_call_credentials* creds =
grpc_google_compute_engine_credentials_create(nullptr);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
/* Check security level. */
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http get should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(compute_engine_httpcli_get_success_override,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_compute_engine_creds_failure(void) {
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestComputeEngineCredsFailure) {
+ ExecCtx exec_ctx;
const char expected_creds_debug_string[] =
"GoogleComputeEngineTokenFetcherCredentials{"
"OAuth2TokenFetcherCredentials}";
- request_metadata_state* state = make_request_metadata_state(
+ auto state = RequestMetadataState::NewInstance(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."),
- nullptr, 0);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ {});
grpc_call_credentials* creds =
grpc_google_compute_engine_credentials_create(nullptr);
- grpc_httpcli_set_override(compute_engine_httpcli_get_failure_override,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ HttpRequest::SetOverride(compute_engine_httpcli_get_failure_override,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void validate_refresh_token_http_request(
- const grpc_httpcli_request* request, const char* body, size_t body_size) {
+void validate_refresh_token_http_request(const grpc_http_request* request,
+ const char* host, const char* path,
+ const char* body, size_t body_size) {
/* The content of the assertion is tested extensively in json_token_test. */
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
@@ -782,46 +827,42 @@ static void validate_refresh_token_http_request(
"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42");
GPR_ASSERT(expected_body.size() == body_size);
GPR_ASSERT(memcmp(expected_body.data(), body, body_size) == 0);
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
+ GPR_ASSERT(strcmp(host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
+ GPR_ASSERT(strcmp(path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
+ GPR_ASSERT(request->hdr_count == 1);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
GPR_ASSERT(
- strcmp(request->http.path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
- GPR_ASSERT(request->http.hdr_count == 1);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
-}
-
-static int refresh_token_httpcli_post_success(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- validate_refresh_token_http_request(request, body, body_size);
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+}
+
+int refresh_token_httpcli_post_success(const grpc_http_request* request,
+ const char* host, const char* path,
+ const char* body, size_t body_size,
+ Timestamp /*deadline*/,
+ grpc_closure* on_done,
+ grpc_http_response* response) {
+ validate_refresh_token_http_request(request, host, path, body, body_size);
*response = http_response(200, valid_oauth2_json_response);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int token_httpcli_post_failure(const grpc_httpcli_request* /*request*/,
- const char* /*body*/,
- size_t /*body_size*/,
- grpc_millis /*deadline*/,
- grpc_closure* on_done,
- grpc_httpcli_response* response) {
+int token_httpcli_post_failure(const grpc_http_request* /*request*/,
+ const char* /*host*/, const char* /*path*/,
+ const char* /*body*/, size_t /*body_size*/,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(403, "Not Authorized.");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static void test_refresh_token_creds_success(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+TEST(CredentialsTest, TestRefreshTokenCredsSuccess) {
+ ExecCtx exec_ctx;
+ std::string emd = "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_";
const char expected_creds_debug_string[] =
"GoogleRefreshToken{ClientID:32555999999.apps.googleusercontent.com,"
"OAuth2TokenFetcherCredentials}";
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create(
test_refresh_token_str, nullptr);
@@ -829,51 +870,50 @@ static void test_refresh_token_creds_success(void) {
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http put should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- refresh_token_httpcli_post_success);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ refresh_token_httpcli_post_success);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_refresh_token_creds_failure(void) {
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestRefreshTokenCredsFailure) {
+ ExecCtx exec_ctx;
const char expected_creds_debug_string[] =
"GoogleRefreshToken{ClientID:32555999999.apps.googleusercontent.com,"
"OAuth2TokenFetcherCredentials}";
- request_metadata_state* state = make_request_metadata_state(
+ auto state = RequestMetadataState::NewInstance(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."),
- nullptr, 0);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ {});
grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create(
test_refresh_token_str, nullptr);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- token_httpcli_post_failure);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ token_httpcli_post_failure);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_valid_sts_creds_options(void) {
+TEST(CredentialsTest, TestValidStsCredsOptions) {
grpc_sts_credentials_options valid_options = {
test_sts_endpoint_url, // sts_endpoint_url
nullptr, // resource
@@ -885,17 +925,16 @@ static void test_valid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- absl::StatusOr<grpc_core::URI> sts_url =
- grpc_core::ValidateStsCredentialsOptions(&valid_options);
+ absl::StatusOr<URI> sts_url = ValidateStsCredentialsOptions(&valid_options);
GPR_ASSERT(sts_url.ok());
absl::string_view host;
absl::string_view port;
- GPR_ASSERT(grpc_core::SplitHostPort(sts_url->authority(), &host, &port));
+ GPR_ASSERT(SplitHostPort(sts_url->authority(), &host, &port));
GPR_ASSERT(host == "foo.com");
GPR_ASSERT(port == "5555");
}
-static void test_invalid_sts_creds_options(void) {
+TEST(CredentialsTest, TestInvalidStsCredsOptions) {
grpc_sts_credentials_options invalid_options = {
test_sts_endpoint_url, // sts_endpoint_url
nullptr, // resource
@@ -907,8 +946,8 @@ static void test_invalid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- absl::StatusOr<grpc_core::URI> url_should_be_invalid =
- grpc_core::ValidateStsCredentialsOptions(&invalid_options);
+ absl::StatusOr<URI> url_should_be_invalid =
+ ValidateStsCredentialsOptions(&invalid_options);
GPR_ASSERT(!url_should_be_invalid.ok());
invalid_options = {
@@ -922,8 +961,7 @@ static void test_invalid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- url_should_be_invalid =
- grpc_core::ValidateStsCredentialsOptions(&invalid_options);
+ url_should_be_invalid = ValidateStsCredentialsOptions(&invalid_options);
GPR_ASSERT(!url_should_be_invalid.ok());
invalid_options = {
@@ -937,8 +975,7 @@ static void test_invalid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- url_should_be_invalid =
- grpc_core::ValidateStsCredentialsOptions(&invalid_options);
+ url_should_be_invalid = ValidateStsCredentialsOptions(&invalid_options);
GPR_ASSERT(!url_should_be_invalid.ok());
invalid_options = {
@@ -952,8 +989,7 @@ static void test_invalid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- url_should_be_invalid =
- grpc_core::ValidateStsCredentialsOptions(&invalid_options);
+ url_should_be_invalid = ValidateStsCredentialsOptions(&invalid_options);
GPR_ASSERT(!url_should_be_invalid.ok());
invalid_options = {
@@ -967,14 +1003,12 @@ static void test_invalid_sts_creds_options(void) {
nullptr, // actor_token_path
nullptr // actor_token_type
};
- url_should_be_invalid =
- grpc_core::ValidateStsCredentialsOptions(&invalid_options);
+ url_should_be_invalid = ValidateStsCredentialsOptions(&invalid_options);
GPR_ASSERT(!url_should_be_invalid.ok());
}
-static void assert_query_parameters(const grpc_core::URI& uri,
- absl::string_view expected_key,
- absl::string_view expected_val) {
+void assert_query_parameters(const URI& uri, absl::string_view expected_key,
+ absl::string_view expected_val) {
const auto it = uri.query_parameter_map().find(expected_key);
GPR_ASSERT(it != uri.query_parameter_map().end());
if (it->second != expected_val) {
@@ -984,17 +1018,16 @@ static void assert_query_parameters(const grpc_core::URI& uri,
GPR_ASSERT(it->second == expected_val);
}
-static void validate_sts_token_http_request(const grpc_httpcli_request* request,
- const char* body, size_t body_size,
- bool expect_actor_token) {
+void validate_sts_token_http_request(const grpc_http_request* request,
+ const char* host, const char* path,
+ const char* body, size_t body_size,
+ bool expect_actor_token) {
// Check that the body is constructed properly.
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
std::string get_url_equivalent =
absl::StrFormat("%s?%s", test_sts_endpoint_url, body);
- absl::StatusOr<grpc_core::URI> url =
- grpc_core::URI::Parse(get_url_equivalent);
+ absl::StatusOr<URI> url = URI::Parse(get_url_equivalent);
if (!url.ok()) {
gpr_log(GPR_ERROR, "%s", url.status().ToString().c_str());
GPR_ASSERT(url.ok());
@@ -1018,36 +1051,37 @@ static void validate_sts_token_http_request(const grpc_httpcli_request* request,
}
// Check the rest of the request.
- GPR_ASSERT(strcmp(request->host, "foo.com:5555") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/v1/token-exchange") == 0);
- GPR_ASSERT(request->http.hdr_count == 1);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
-}
-
-static int sts_token_httpcli_post_success(const grpc_httpcli_request* request,
- const char* body, size_t body_size,
- grpc_millis /*deadline*/,
- grpc_closure* on_done,
- grpc_httpcli_response* response) {
- validate_sts_token_http_request(request, body, body_size, true);
+ GPR_ASSERT(strcmp(host, "foo.com:5555") == 0);
+ GPR_ASSERT(strcmp(path, "/v1/token-exchange") == 0);
+ GPR_ASSERT(request->hdr_count == 1);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+}
+
+int sts_token_httpcli_post_success(const grpc_http_request* request,
+ const char* host, const char* path,
+ const char* body, size_t body_size,
+ Timestamp /*deadline*/,
+ grpc_closure* on_done,
+ grpc_http_response* response) {
+ validate_sts_token_http_request(request, host, path, body, body_size, true);
*response = http_response(200, valid_sts_json_response);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int sts_token_httpcli_post_success_no_actor_token(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- validate_sts_token_http_request(request, body, body_size, false);
+int sts_token_httpcli_post_success_no_actor_token(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, Timestamp /*deadline*/,
+ grpc_closure* on_done, grpc_http_response* response) {
+ validate_sts_token_http_request(request, host, path, body, body_size, false);
*response = http_response(200, valid_sts_json_response);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static char* write_tmp_jwt_file(const char* jwt_contents) {
+char* write_tmp_jwt_file(const char* jwt_contents) {
char* path;
FILE* tmp = gpr_tmpfile(test_signed_jwt_path_prefix, &path);
GPR_ASSERT(path != nullptr);
@@ -1058,15 +1092,12 @@ static char* write_tmp_jwt_file(const char* jwt_contents) {
return path;
}
-static void test_sts_creds_success(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+TEST(CredentialsTest, TestStsCredsSuccess) {
+ ExecCtx exec_ctx;
+ std::string emd = "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_";
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
char* subject_token_path = write_tmp_jwt_file(test_signed_jwt);
char* actor_token_path = write_tmp_jwt_file(test_signed_jwt2);
grpc_sts_credentials_options valid_options = {
@@ -1087,33 +1118,31 @@ static void test_sts_creds_success(void) {
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http put should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- sts_token_httpcli_post_success);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ sts_token_httpcli_post_success);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_free(subject_token_path);
gpr_free(actor_token_path);
}
-static void test_sts_creds_token_file_not_found(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestStsCredsTokenFileNotFound) {
+ ExecCtx exec_ctx;
grpc_sts_credentials_options valid_options = {
test_sts_endpoint_url, // sts_endpoint_url
"resource", // resource
@@ -1131,29 +1160,27 @@ static void test_sts_creds_token_file_not_found(void) {
/* Check security level. */
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state = make_request_metadata_state(
+ auto state = RequestMetadataState::NewInstance(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."),
- nullptr, 0);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ {});
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Cleanup. */
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_sts_creds_no_actor_token_success(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
+TEST(CredentialsTest, TestStsCredsNoActorTokenSuccess) {
+ ExecCtx exec_ctx;
+ std::string emd = "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_";
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
char* subject_token_path = write_tmp_jwt_file(test_signed_jwt);
grpc_sts_credentials_options valid_options = {
test_sts_endpoint_url, // sts_endpoint_url
@@ -1173,39 +1200,37 @@ static void test_sts_creds_no_actor_token_success(void) {
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http put should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- sts_token_httpcli_post_success_no_actor_token);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ sts_token_httpcli_post_success_no_actor_token);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_free(subject_token_path);
}
-static void test_sts_creds_load_token_failure(void) {
+TEST(CredentialsTest, TestStsCredsLoadTokenFailure) {
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
- grpc_core::ExecCtx exec_ctx;
- request_metadata_state* state = make_request_metadata_state(
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."),
- nullptr, 0);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ {});
char* test_signed_jwt_path = write_tmp_jwt_file(test_signed_jwt);
grpc_sts_credentials_options options = {
test_sts_endpoint_url, // sts_endpoint_url
@@ -1219,28 +1244,27 @@ static void test_sts_creds_load_token_failure(void) {
nullptr // actor_token_type
};
grpc_call_credentials* creds = grpc_sts_credentials_create(&options, nullptr);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_free(test_signed_jwt_path);
}
-static void test_sts_creds_http_failure(void) {
+TEST(CredentialsTest, TestStsCredsHttpFailure) {
const char expected_creds_debug_string[] =
"StsTokenFetcherCredentials{Path:/v1/"
"token-exchange,Authority:foo.com:5555,OAuth2TokenFetcherCredentials}";
- grpc_core::ExecCtx exec_ctx;
- request_metadata_state* state = make_request_metadata_state(
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token."),
- nullptr, 0);
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ {});
char* test_signed_jwt_path = write_tmp_jwt_file(test_signed_jwt);
grpc_sts_credentials_options valid_options = {
test_sts_endpoint_url, // sts_endpoint_url
@@ -1255,19 +1279,20 @@ static void test_sts_creds_http_failure(void) {
};
grpc_call_credentials* creds =
grpc_sts_credentials_create(&valid_options, nullptr);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- token_httpcli_post_failure);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ token_httpcli_post_failure);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_free(test_signed_jwt_path);
}
-static void validate_jwt_encode_and_sign_params(
- const grpc_auth_json_key* json_key, const char* scope,
- gpr_timespec token_lifetime) {
+void validate_jwt_encode_and_sign_params(const grpc_auth_json_key* json_key,
+ const char* scope,
+ gpr_timespec token_lifetime) {
GPR_ASSERT(grpc_auth_json_key_is_valid(json_key));
GPR_ASSERT(json_key->private_key != nullptr);
GPR_ASSERT(RSA_check_key(json_key->private_key));
@@ -1288,37 +1313,42 @@ static void validate_jwt_encode_and_sign_params(
GPR_ASSERT(gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime()) == 0);
}
-static char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
- const char* /*audience*/,
- gpr_timespec token_lifetime,
- const char* scope) {
+char* encode_and_sign_jwt_success(const grpc_auth_json_key* json_key,
+ const char* audience,
+ gpr_timespec token_lifetime,
+ const char* scope) {
+ if (strcmp(audience, test_service_url_no_service_name) != 0 &&
+ strcmp(audience, other_test_service_url_no_service_name) != 0) {
+ return nullptr;
+ }
validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
return gpr_strdup(test_signed_jwt);
}
-static char* encode_and_sign_jwt_failure(const grpc_auth_json_key* json_key,
- const char* /*audience*/,
- gpr_timespec token_lifetime,
- const char* scope) {
+char* encode_and_sign_jwt_failure(const grpc_auth_json_key* json_key,
+ const char* /*audience*/,
+ gpr_timespec token_lifetime,
+ const char* scope) {
validate_jwt_encode_and_sign_params(json_key, scope, token_lifetime);
return nullptr;
}
-static char* encode_and_sign_jwt_should_not_be_called(
+char* encode_and_sign_jwt_should_not_be_called(
const grpc_auth_json_key* /*json_key*/, const char* /*audience*/,
gpr_timespec /*token_lifetime*/, const char* /*scope*/) {
GPR_ASSERT("grpc_jwt_encode_and_sign should not be called" == nullptr);
return nullptr;
}
-static grpc_service_account_jwt_access_credentials* creds_as_jwt(
+grpc_service_account_jwt_access_credentials* creds_as_jwt(
grpc_call_credentials* creds) {
GPR_ASSERT(creds != nullptr);
- GPR_ASSERT(strcmp(creds->type(), GRPC_CALL_CREDENTIALS_TYPE_JWT) == 0);
+ GPR_ASSERT(creds->type() ==
+ grpc_service_account_jwt_access_credentials::Type());
return reinterpret_cast<grpc_service_account_jwt_access_credentials*>(creds);
}
-static void test_jwt_creds_lifetime(void) {
+TEST(CredentialsTest, TestJwtCredsLifetime) {
char* json_key_string = test_json_key_str();
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
@@ -1362,43 +1392,50 @@ static void test_jwt_creds_lifetime(void) {
gpr_free(json_key_string);
}
-static void test_jwt_creds_success(void) {
+TEST(CredentialsTest, TestRemoveServiceFromJwtUri) {
+ const char wrong_uri[] = "hello world";
+ GPR_ASSERT(!RemoveServiceNameFromJwtUri(wrong_uri).ok());
+ const char valid_uri[] = "https://foo.com/get/";
+ const char expected_uri[] = "https://foo.com/";
+ auto output = RemoveServiceNameFromJwtUri(valid_uri);
+ GPR_ASSERT(output.ok());
+ GPR_ASSERT(strcmp(output->c_str(), expected_uri) == 0);
+}
+
+TEST(CredentialsTest, TestJwtCredsSuccess) {
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
char* json_key_string = test_json_key_str();
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ ExecCtx exec_ctx;
std::string expected_md_value = absl::StrCat("Bearer ", test_signed_jwt);
- expected_md emd[] = {{"authorization", expected_md_value.c_str()}};
+ std::string emd = absl::StrCat("authorization: ", expected_md_value);
grpc_call_credentials* creds =
grpc_service_account_jwt_access_credentials_create(
json_key_string, grpc_max_auth_token_lifetime(), nullptr);
/* First request: jwt_encode_and_sign should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
grpc_jwt_encode_and_sign_set_override(
encode_and_sign_jwt_should_not_be_called);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Third request: Different service url so jwt_encode_and_sign should be
called again (no caching). */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- auth_md_ctx.service_url = other_test_service_url;
+ state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, emd);
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
- run_request_metadata_test(creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestOtherAuthority,
+ kTestOtherPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
creds->debug_string().c_str(),
strlen(expected_creds_debug_string_prefix)) == 0);
@@ -1408,22 +1445,20 @@ static void test_jwt_creds_success(void) {
grpc_jwt_encode_and_sign_set_override(nullptr);
}
-static void test_jwt_creds_signing_failure(void) {
+TEST(CredentialsTest, TestJwtCredsSigningFailure) {
const char expected_creds_debug_string_prefix[] =
"JWTAccessCredentials{ExpirationTime:";
char* json_key_string = test_json_key_str();
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- request_metadata_state* state = make_request_metadata_state(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), nullptr,
- 0);
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Could not generate JWT."), {});
grpc_call_credentials* creds =
grpc_service_account_jwt_access_credentials_create(
json_key_string, grpc_max_auth_token_lifetime(), nullptr);
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure);
- run_request_metadata_test(creds, auth_md_ctx, state);
+ state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
gpr_free(json_key_string);
GPR_ASSERT(strncmp(expected_creds_debug_string_prefix,
@@ -1434,7 +1469,7 @@ static void test_jwt_creds_signing_failure(void) {
grpc_jwt_encode_and_sign_set_override(nullptr);
}
-static void set_google_default_creds_env_var_with_file_contents(
+void set_google_default_creds_env_var_with_file_contents(
const char* file_prefix, const char* contents) {
size_t contents_len = strlen(contents);
char* creds_file_name;
@@ -1447,13 +1482,15 @@ static void set_google_default_creds_env_var_with_file_contents(
gpr_free(creds_file_name);
}
-static bool test_gce_tenancy_checker(void) {
+bool test_gce_tenancy_checker(void) {
g_test_gce_tenancy_checker_called = true;
return g_test_is_on_gce;
}
-static void test_google_default_creds_auth_key(void) {
- grpc_core::ExecCtx exec_ctx;
+std::string null_well_known_creds_path_getter(void) { return ""; }
+
+TEST(CredentialsTest, TestGoogleDefaultCredsAuthKey) {
+ ExecCtx exec_ctx;
grpc_composite_channel_credentials* creds;
char* json_key = test_json_key_str();
grpc_flush_cached_google_default_credentials();
@@ -1462,6 +1499,8 @@ static void test_google_default_creds_auth_key(void) {
g_test_is_on_gce = true;
set_google_default_creds_env_var_with_file_contents(
"json_key_google_default_creds", json_key);
+ grpc_override_well_known_credentials_path_getter(
+ null_well_known_creds_path_getter);
gpr_free(json_key);
creds = reinterpret_cast<grpc_composite_channel_credentials*>(
grpc_google_default_credentials_create(nullptr));
@@ -1479,14 +1518,17 @@ static void test_google_default_creds_auth_key(void) {
GPR_ASSERT(g_test_gce_tenancy_checker_called == false);
creds->Unref();
gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+ grpc_override_well_known_credentials_path_getter(nullptr);
}
-static void test_google_default_creds_refresh_token(void) {
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestGoogleDefaultCredsRefreshToken) {
+ ExecCtx exec_ctx;
grpc_composite_channel_credentials* creds;
grpc_flush_cached_google_default_credentials();
set_google_default_creds_env_var_with_file_contents(
"refresh_token_google_default_creds", test_refresh_token_str);
+ grpc_override_well_known_credentials_path_getter(
+ null_well_known_creds_path_getter);
creds = reinterpret_cast<grpc_composite_channel_credentials*>(
grpc_google_default_credentials_create(nullptr));
auto* default_creds =
@@ -1500,11 +1542,84 @@ static void test_google_default_creds_refresh_token(void) {
"32555999999.apps.googleusercontent.com") == 0);
creds->Unref();
gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+ grpc_override_well_known_credentials_path_getter(nullptr);
}
-static int default_creds_metadata_server_detection_httpcli_get_success_override(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
+TEST(CredentialsTest, TestGoogleDefaultCredsExternalAccountCredentials) {
+ ExecCtx exec_ctx;
+ grpc_composite_channel_credentials* creds;
+ grpc_flush_cached_google_default_credentials();
+ set_google_default_creds_env_var_with_file_contents(
+ "google_default_creds_external_account_credentials",
+ test_external_account_credentials_str);
+ grpc_override_well_known_credentials_path_getter(
+ null_well_known_creds_path_getter);
+ creds = reinterpret_cast<grpc_composite_channel_credentials*>(
+ grpc_google_default_credentials_create(nullptr));
+ auto* default_creds =
+ reinterpret_cast<const grpc_google_default_channel_credentials*>(
+ creds->inner_creds());
+ GPR_ASSERT(default_creds->ssl_creds() != nullptr);
+ auto* external =
+ reinterpret_cast<const ExternalAccountCredentials*>(creds->call_creds());
+ GPR_ASSERT(external != nullptr);
+ creds->Unref();
+ gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+ grpc_override_well_known_credentials_path_getter(nullptr);
+}
+
+TEST(CredentialsTest,
+ TestGoogleDefaultCredsExternalAccountCredentialsMultiPatternSts) {
+ ExecCtx exec_ctx;
+ grpc_composite_channel_credentials* creds;
+ grpc_flush_cached_google_default_credentials();
+ set_google_default_creds_env_var_with_file_contents(
+ "google_default_creds_external_account_credentials_multi_pattern_sts",
+ test_external_account_credentials_multi_pattern_sts_str);
+ grpc_override_well_known_credentials_path_getter(
+ null_well_known_creds_path_getter);
+ creds = reinterpret_cast<grpc_composite_channel_credentials*>(
+ grpc_google_default_credentials_create(nullptr));
+ auto* default_creds =
+ reinterpret_cast<const grpc_google_default_channel_credentials*>(
+ creds->inner_creds());
+ GPR_ASSERT(default_creds->ssl_creds() != nullptr);
+ auto* external =
+ reinterpret_cast<const ExternalAccountCredentials*>(creds->call_creds());
+ GPR_ASSERT(external != nullptr);
+ creds->Unref();
+ gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+ grpc_override_well_known_credentials_path_getter(nullptr);
+}
+
+TEST(CredentialsTest,
+ TestGoogleDefaultCredsExternalAccountCredentialsMultiPatternIam) {
+ ExecCtx exec_ctx;
+ grpc_composite_channel_credentials* creds;
+ grpc_flush_cached_google_default_credentials();
+ set_google_default_creds_env_var_with_file_contents(
+ "google_default_creds_external_account_credentials_multi_pattern_iam",
+ test_external_account_credentials_multi_pattern_iam_str);
+ grpc_override_well_known_credentials_path_getter(
+ null_well_known_creds_path_getter);
+ creds = reinterpret_cast<grpc_composite_channel_credentials*>(
+ grpc_google_default_credentials_create(nullptr));
+ auto* default_creds =
+ reinterpret_cast<const grpc_google_default_channel_credentials*>(
+ creds->inner_creds());
+ GPR_ASSERT(default_creds->ssl_creds() != nullptr);
+ auto* external =
+ reinterpret_cast<const ExternalAccountCredentials*>(creds->call_creds());
+ GPR_ASSERT(external != nullptr);
+ creds->Unref();
+ gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
+ grpc_override_well_known_credentials_path_getter(nullptr);
+}
+
+int default_creds_metadata_server_detection_httpcli_get_success_override(
+ const grpc_http_request* /*request*/, const char* host, const char* path,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(200, "");
grpc_http_header* headers =
static_cast<grpc_http_header*>(gpr_malloc(sizeof(*headers) * 1));
@@ -1512,22 +1627,17 @@ static int default_creds_metadata_server_detection_httpcli_get_success_override(
headers[0].value = gpr_strdup("Google");
response->hdr_count = 1;
response->hdrs = headers;
- GPR_ASSERT(strcmp(request->http.path, "/") == 0);
- GPR_ASSERT(strcmp(request->host, "metadata.google.internal.") == 0);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ GPR_ASSERT(strcmp(path, "/") == 0);
+ GPR_ASSERT(strcmp(host, "metadata.google.internal.") == 0);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static std::string null_well_known_creds_path_getter(void) { return ""; }
-
-static void test_google_default_creds_gce(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestGoogleDefaultCredsGce) {
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_");
grpc_flush_cached_google_default_credentials();
gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
grpc_override_well_known_credentials_path_getter(
@@ -1544,27 +1654,25 @@ static void test_google_default_creds_gce(void) {
/* Verify that the default creds actually embeds a GCE creds. */
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(creds->call_creds() != nullptr);
- grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds->mutable_call_creds(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(compute_engine_httpcli_get_success_override,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds->mutable_call_creds(), kTestUrlScheme,
+ kTestAuthority, kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(g_test_gce_tenancy_checker_called == true);
/* Cleanup. */
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
grpc_override_well_known_credentials_path_getter(nullptr);
}
-static void test_google_default_creds_non_gce(void) {
- grpc_core::ExecCtx exec_ctx;
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestGoogleDefaultCredsNonGce) {
+ ExecCtx exec_ctx;
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_");
grpc_flush_cached_google_default_credentials();
gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
grpc_override_well_known_credentials_path_getter(
@@ -1573,7 +1681,7 @@ static void test_google_default_creds_non_gce(void) {
g_test_gce_tenancy_checker_called = false;
g_test_is_on_gce = false;
/* Simulate a successful detection of metadata server. */
- grpc_httpcli_set_override(
+ HttpRequest::SetOverride(
default_creds_metadata_server_detection_httpcli_get_success_override,
httpcli_post_should_not_be_called);
grpc_composite_channel_credentials* creds =
@@ -1582,29 +1690,31 @@ static void test_google_default_creds_non_gce(void) {
/* Verify that the default creds actually embeds a GCE creds. */
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(creds->call_creds() != nullptr);
- grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(creds->mutable_call_creds(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(compute_engine_httpcli_get_success_override,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(creds->mutable_call_creds(), kTestUrlScheme,
+ kTestAuthority, kTestPath);
+ ExecCtx::Get()->Flush();
GPR_ASSERT(g_test_gce_tenancy_checker_called == true);
/* Cleanup. */
creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
grpc_override_well_known_credentials_path_getter(nullptr);
}
-static int default_creds_gce_detection_httpcli_get_failure_override(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
+int default_creds_gce_detection_httpcli_get_failure_override(
+ const grpc_http_request* /*request*/, const char* host, const char* path,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
/* No magic header. */
- GPR_ASSERT(strcmp(request->http.path, "/") == 0);
- GPR_ASSERT(strcmp(request->host, "metadata.google.internal.") == 0);
+ GPR_ASSERT(strcmp(path, "/") == 0);
+ GPR_ASSERT(strcmp(host, "metadata.google.internal.") == 0);
*response = http_response(200, "");
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static void test_no_google_default_creds(void) {
+TEST(CredentialsTest, TestNoGoogleDefaultCreds) {
grpc_flush_cached_google_default_credentials();
gpr_setenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */
grpc_override_well_known_credentials_path_getter(
@@ -1612,7 +1722,7 @@ static void test_no_google_default_creds(void) {
set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker);
g_test_gce_tenancy_checker_called = false;
g_test_is_on_gce = false;
- grpc_httpcli_set_override(
+ HttpRequest::SetOverride(
default_creds_gce_detection_httpcli_get_failure_override,
httpcli_post_should_not_be_called);
/* Simulate a successful detection of GCE. */
@@ -1623,24 +1733,21 @@ static void test_no_google_default_creds(void) {
GPR_ASSERT(g_test_gce_tenancy_checker_called == true);
/* Cleanup. */
grpc_override_well_known_credentials_path_getter(nullptr);
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_google_default_creds_call_creds_specified(void) {
- expected_md emd[] = {
- {"authorization", "Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestGoogleDefaultCredsCallCredsSpecified) {
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_");
+ ExecCtx exec_ctx;
grpc_flush_cached_google_default_credentials();
grpc_call_credentials* call_creds =
grpc_google_compute_engine_credentials_create(nullptr);
set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker);
g_test_gce_tenancy_checker_called = false;
g_test_is_on_gce = true;
- grpc_httpcli_set_override(
+ HttpRequest::SetOverride(
default_creds_metadata_server_detection_httpcli_get_success_override,
httpcli_post_should_not_be_called);
grpc_composite_channel_credentials* channel_creds =
@@ -1649,57 +1756,44 @@ static void test_google_default_creds_call_creds_specified(void) {
GPR_ASSERT(g_test_gce_tenancy_checker_called == false);
GPR_ASSERT(channel_creds != nullptr);
GPR_ASSERT(channel_creds->call_creds() != nullptr);
- grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(channel_creds->mutable_call_creds(), auth_md_ctx,
- state);
- grpc_core::ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(compute_engine_httpcli_get_success_override,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(channel_creds->mutable_call_creds(),
+ kTestUrlScheme, kTestAuthority, kTestPath);
+ ExecCtx::Get()->Flush();
channel_creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
struct fake_call_creds : public grpc_call_credentials {
public:
- explicit fake_call_creds() : grpc_call_credentials("fake") {
- grpc_slice key = grpc_slice_from_static_string("foo");
- grpc_slice value = grpc_slice_from_static_string("oof");
- phony_md_ = grpc_mdelem_from_slices(key, value);
- grpc_slice_unref(key);
- grpc_slice_unref(value);
+ ArenaPromise<absl::StatusOr<ClientMetadataHandle>> GetRequestMetadata(
+ ClientMetadataHandle initial_metadata,
+ const grpc_call_credentials::GetRequestMetadataArgs*) override {
+ initial_metadata->Append("foo", Slice::FromStaticString("oof"),
+ [](absl::string_view, const Slice&) { abort(); });
+ return Immediate(std::move(initial_metadata));
}
- ~fake_call_creds() override { GRPC_MDELEM_UNREF(phony_md_); }
-
- bool get_request_metadata(grpc_polling_entity* /*pollent*/,
- grpc_auth_metadata_context /*context*/,
- grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/,
- grpc_error_handle* /*error*/) override {
- grpc_credentials_mdelem_array_add(md_array, phony_md_);
- return true;
- }
-
- void cancel_get_request_metadata(grpc_credentials_mdelem_array* /*md_array*/,
- grpc_error_handle /*error*/) override {}
+ const char* type() const override { return "fake"; }
private:
- grpc_mdelem phony_md_;
+ int cmp_impl(const grpc_call_credentials* other) const override {
+ // TODO(yashykt): Check if we can do something better here
+ return QsortCompare(static_cast<const grpc_call_credentials*>(this), other);
+ }
};
-static void test_google_default_creds_not_default(void) {
- expected_md emd[] = {{"foo", "oof"}};
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::ExecCtx exec_ctx;
+TEST(CredentialsTest, TestGoogleDefaultCredsNotDefault) {
+ auto state = RequestMetadataState::NewInstance(GRPC_ERROR_NONE, "foo: oof");
+ ExecCtx exec_ctx;
grpc_flush_cached_google_default_credentials();
- grpc_core::RefCountedPtr<grpc_call_credentials> call_creds =
- grpc_core::MakeRefCounted<fake_call_creds>();
+ RefCountedPtr<grpc_call_credentials> call_creds =
+ MakeRefCounted<fake_call_creds>();
set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker);
g_test_gce_tenancy_checker_called = false;
g_test_is_on_gce = true;
- grpc_httpcli_set_override(
+ HttpRequest::SetOverride(
default_creds_metadata_server_detection_httpcli_get_success_override,
httpcli_post_should_not_be_called);
grpc_composite_channel_credentials* channel_creds =
@@ -1708,11 +1802,11 @@ static void test_google_default_creds_not_default(void) {
GPR_ASSERT(g_test_gce_tenancy_checker_called == false);
GPR_ASSERT(channel_creds != nullptr);
GPR_ASSERT(channel_creds->call_creds() != nullptr);
- run_request_metadata_test(channel_creds->mutable_call_creds(), auth_md_ctx,
- state);
- grpc_core::ExecCtx::Get()->Flush();
+ state->RunRequestMetadataTest(channel_creds->mutable_call_creds(),
+ kTestUrlScheme, kTestAuthority, kTestPath);
+ ExecCtx::Get()->Flush();
channel_creds->Unref();
- grpc_httpcli_set_override(nullptr, nullptr);
+ HttpRequest::SetOverride(nullptr, nullptr);
}
typedef enum {
@@ -1721,9 +1815,10 @@ typedef enum {
PLUGIN_DESTROY_CALLED_STATE
} plugin_state;
-static const expected_md plugin_md[] = {{"foo", "bar"}, {"hi", "there"}};
+const std::map<std::string, std::string> plugin_md = {{"foo", "bar"},
+ {"hi", "there"}};
-static int plugin_get_metadata_success(
+int plugin_get_metadata_success(
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],
@@ -1733,22 +1828,23 @@ static int plugin_get_metadata_success(
GPR_ASSERT(strcmp(context.method_name, test_method) == 0);
GPR_ASSERT(context.channel_auth_context == nullptr);
GPR_ASSERT(context.reserved == nullptr);
- GPR_ASSERT(GPR_ARRAY_SIZE(plugin_md) <
- GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX);
+ GPR_ASSERT(plugin_md.size() < GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX);
plugin_state* s = static_cast<plugin_state*>(state);
*s = PLUGIN_GET_METADATA_CALLED_STATE;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(plugin_md); ++i) {
+ size_t i = 0;
+ for (auto const& md : plugin_md) {
memset(&creds_md[i], 0, sizeof(grpc_metadata));
- creds_md[i].key = grpc_slice_from_copied_string(plugin_md[i].key);
- creds_md[i].value = grpc_slice_from_copied_string(plugin_md[i].value);
+ creds_md[i].key = grpc_slice_from_copied_string(md.first.c_str());
+ creds_md[i].value = grpc_slice_from_copied_string(md.second.c_str());
+ i += 1;
}
- *num_creds_md = GPR_ARRAY_SIZE(plugin_md);
+ *num_creds_md = plugin_md.size();
return true; // Synchronous return.
}
-static const char* plugin_error_details = "Could not get metadata for plugin.";
+const char* plugin_error_details = "Could not get metadata for plugin.";
-static int plugin_get_metadata_failure(
+int plugin_get_metadata_failure(
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],
@@ -1765,12 +1861,12 @@ static int plugin_get_metadata_failure(
return true; // Synchronous return.
}
-static void plugin_destroy(void* state) {
+void plugin_destroy(void* state) {
plugin_state* s = static_cast<plugin_state*>(state);
*s = PLUGIN_DESTROY_CALLED_STATE;
}
-static char* plugin_debug_string(void* state) {
+char* plugin_debug_string(void* state) {
plugin_state* s = static_cast<plugin_state*>(state);
char* ret = nullptr;
switch (*s) {
@@ -1790,16 +1886,14 @@ static char* plugin_debug_string(void* state) {
return ret;
}
-static void test_metadata_plugin_success(void) {
+TEST(CredentialsTest, TestMetadataPluginSuccess) {
const char expected_creds_debug_string[] =
"TestPluginCredentials{state:GET_METADATA_CALLED}";
plugin_state state = PLUGIN_INITIAL_STATE;
grpc_metadata_credentials_plugin plugin;
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- request_metadata_state* md_state = make_request_metadata_state(
- GRPC_ERROR_NONE, plugin_md, GPR_ARRAY_SIZE(plugin_md));
+ ExecCtx exec_ctx;
+ auto md_state =
+ RequestMetadataState::NewInstance(GRPC_ERROR_NONE, "foo: bar, hi: there");
plugin.state = &state;
plugin.get_metadata = plugin_get_metadata_success;
@@ -1811,7 +1905,8 @@ static void test_metadata_plugin_success(void) {
/* Check security level. */
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
- run_request_metadata_test(creds, auth_md_ctx, md_state);
+ md_state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
@@ -1820,19 +1915,18 @@ static void test_metadata_plugin_success(void) {
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
}
-static void test_metadata_plugin_failure(void) {
+TEST(CredentialsTest, TestMetadataPluginFailure) {
const char expected_creds_debug_string[] =
"TestPluginCredentials{state:GET_METADATA_CALLED}";
plugin_state state = PLUGIN_INITIAL_STATE;
grpc_metadata_credentials_plugin plugin;
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- std::string expected_error = absl::StrCat(
- "Getting metadata from plugin failed with error: ", plugin_error_details);
- request_metadata_state* md_state = make_request_metadata_state(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(expected_error.c_str()), nullptr, 0);
+ ExecCtx exec_ctx;
+ auto md_state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ absl::StrCat("Getting metadata from plugin failed with error: ",
+ plugin_error_details)),
+ {});
plugin.state = &state;
plugin.get_metadata = plugin_get_metadata_failure;
@@ -1842,7 +1936,8 @@ static void test_metadata_plugin_failure(void) {
grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin(
plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr);
GPR_ASSERT(state == PLUGIN_INITIAL_STATE);
- run_request_metadata_test(creds, auth_md_ctx, md_state);
+ md_state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GPR_ASSERT(state == PLUGIN_GET_METADATA_CALLED_STATE);
GPR_ASSERT(
strcmp(creds->debug_string().c_str(), expected_creds_debug_string) == 0);
@@ -1851,7 +1946,7 @@ static void test_metadata_plugin_failure(void) {
GPR_ASSERT(state == PLUGIN_DESTROY_CALLED_STATE);
}
-static void test_get_well_known_google_credentials_file_path(void) {
+TEST(CredentialsTest, TestGetWellKnownGoogleCredentialsFilePath) {
char* home = gpr_getenv("HOME");
bool restore_home_env = false;
#if defined(GRPC_BAZEL_BUILD) && \
@@ -1880,15 +1975,15 @@ static void test_get_well_known_google_credentials_file_path(void) {
gpr_free(home);
}
-static void test_channel_creds_duplicate_without_call_creds(void) {
+TEST(CredentialsTest, TestChannelCredsDuplicateWithoutCallCreds) {
const char expected_creds_debug_string[] =
"AccessTokenCredentials{Token:present}";
- grpc_core::ExecCtx exec_ctx;
+ ExecCtx exec_ctx;
grpc_channel_credentials* channel_creds =
grpc_fake_transport_security_credentials_create();
- grpc_core::RefCountedPtr<grpc_channel_credentials> dup =
+ RefCountedPtr<grpc_channel_credentials> dup =
channel_creds->duplicate_without_call_credentials();
GPR_ASSERT(dup == channel_creds);
dup.reset();
@@ -1918,7 +2013,48 @@ typedef struct {
const char* desired_method_name;
} auth_metadata_context_test_case;
-static void test_auth_metadata_context(void) {
+void auth_metadata_context_build(const char* url_scheme,
+ const grpc_slice& call_host,
+ const grpc_slice& call_method,
+ grpc_auth_context* auth_context,
+ grpc_auth_metadata_context* auth_md_context) {
+ char* service = grpc_slice_to_c_string(call_method);
+ char* last_slash = strrchr(service, '/');
+ char* method_name = nullptr;
+ char* service_url = nullptr;
+ grpc_auth_metadata_context_reset(auth_md_context);
+ if (last_slash == nullptr) {
+ gpr_log(GPR_ERROR, "No '/' found in fully qualified method name");
+ service[0] = '\0';
+ method_name = gpr_strdup("");
+ } else if (last_slash == service) {
+ method_name = gpr_strdup("");
+ } else {
+ *last_slash = '\0';
+ method_name = gpr_strdup(last_slash + 1);
+ }
+ char* host_and_port = grpc_slice_to_c_string(call_host);
+ if (url_scheme != nullptr && strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) {
+ /* Remove the port if it is 443. */
+ char* port_delimiter = strrchr(host_and_port, ':');
+ if (port_delimiter != nullptr && strcmp(port_delimiter + 1, "443") == 0) {
+ *port_delimiter = '\0';
+ }
+ }
+ gpr_asprintf(&service_url, "%s://%s%s",
+ url_scheme == nullptr ? "" : url_scheme, host_and_port, service);
+ auth_md_context->service_url = service_url;
+ auth_md_context->method_name = method_name;
+ auth_md_context->channel_auth_context =
+ auth_context == nullptr
+ ? nullptr
+ : auth_context->Ref(DEBUG_LOCATION, "grpc_auth_metadata_context")
+ .release();
+ gpr_free(service);
+ gpr_free(host_and_port);
+}
+
+TEST(CredentialsTest, TestAuthMetadataContext) {
auth_metadata_context_test_case test_cases[] = {
// No service nor method.
{"https", "www.foo.com", "", "https://www.foo.com", ""},
@@ -1960,8 +2096,8 @@ static void test_auth_metadata_context(void) {
grpc_slice_from_copied_string(test_cases[i].call_method);
grpc_auth_metadata_context auth_md_context;
memset(&auth_md_context, 0, sizeof(auth_md_context));
- grpc_auth_metadata_context_build(url_scheme, call_host, call_method,
- nullptr, &auth_md_context);
+ auth_metadata_context_build(url_scheme, call_host, call_method, nullptr,
+ &auth_md_context);
if (strcmp(auth_md_context.service_url,
test_cases[i].desired_service_url) != 0) {
gpr_log(GPR_ERROR, "Invalid service url, want: %s, got %s.",
@@ -1981,17 +2117,15 @@ static void test_auth_metadata_context(void) {
}
}
-static void validate_external_account_creds_token_exchage_request(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- bool /*expect_actor_token*/) {
+void validate_external_account_creds_token_exchage_request(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, bool /*expect_actor_token*/) {
// Check that the body is constructed properly.
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
std::string get_url_equivalent =
absl::StrFormat("%s?%s", "https://foo.com:5555/token", body);
- absl::StatusOr<grpc_core::URI> uri =
- grpc_core::URI::Parse(get_url_equivalent);
+ absl::StatusOr<URI> uri = URI::Parse(get_url_equivalent);
if (!uri.ok()) {
gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
GPR_ASSERT(uri.ok());
@@ -2007,25 +2141,23 @@ static void validate_external_account_creds_token_exchage_request(
"https://www.googleapis.com/auth/cloud-platform");
// Check the rest of the request.
- GPR_ASSERT(strcmp(request->host, "foo.com:5555") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/token") == 0);
- GPR_ASSERT(request->http.hdr_count == 2);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].key, "Authorization") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].value,
+ GPR_ASSERT(strcmp(host, "foo.com:5555") == 0);
+ GPR_ASSERT(strcmp(path, "/token") == 0);
+ GPR_ASSERT(request->hdr_count == 2);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].key, "Authorization") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].value,
"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=") == 0);
}
-static void
-validate_external_account_creds_token_exchage_request_with_url_encode(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- bool /*expect_actor_token*/) {
+void validate_external_account_creds_token_exchage_request_with_url_encode(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, bool /*expect_actor_token*/) {
// Check that the body is constructed properly.
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(
strcmp(
std::string(body, body_size).c_str(),
@@ -2033,124 +2165,117 @@ validate_external_account_creds_token_exchage_request_with_url_encode(
"3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%"
"3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type="
"subject_token_type_!%40%23%24&subject_token=test_subject_token&"
- "scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform") ==
- 0);
+ "scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&"
+ "options=%7B%7D") == 0);
// Check the rest of the request.
- GPR_ASSERT(strcmp(request->host, "foo.com:5555") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/token_url_encode") == 0);
- GPR_ASSERT(request->http.hdr_count == 2);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].key, "Authorization") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].value,
+ GPR_ASSERT(strcmp(host, "foo.com:5555") == 0);
+ GPR_ASSERT(strcmp(path, "/token_url_encode") == 0);
+ GPR_ASSERT(request->hdr_count == 2);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].key, "Authorization") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].value,
"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=") == 0);
}
-static void
-validate_external_account_creds_service_account_impersonation_request(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- bool /*expect_actor_token*/) {
+void validate_external_account_creds_service_account_impersonation_request(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, bool /*expect_actor_token*/) {
// Check that the body is constructed properly.
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(body, "scope=scope_1 scope_2") == 0);
// Check the rest of the request.
- GPR_ASSERT(strcmp(request->host, "foo.com:5555") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/service_account_impersonation") == 0);
- GPR_ASSERT(request->http.hdr_count == 2);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].key, "Authorization") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].value,
+ GPR_ASSERT(strcmp(host, "foo.com:5555") == 0);
+ GPR_ASSERT(strcmp(path, "/service_account_impersonation") == 0);
+ GPR_ASSERT(request->hdr_count == 2);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].key, "Authorization") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].value,
"Bearer token_exchange_access_token") == 0);
}
-static int external_account_creds_httpcli_post_success(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- if (strcmp(request->http.path, "/token") == 0) {
- validate_external_account_creds_token_exchage_request(request, body,
- body_size, true);
+int external_account_creds_httpcli_post_success(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, Timestamp /*deadline*/,
+ grpc_closure* on_done, grpc_http_response* response) {
+ if (strcmp(path, "/token") == 0) {
+ validate_external_account_creds_token_exchage_request(
+ request, host, path, body, body_size, true);
*response = http_response(
200, valid_external_account_creds_token_exchange_response);
- } else if (strcmp(request->http.path, "/service_account_impersonation") ==
- 0) {
+ } else if (strcmp(path, "/service_account_impersonation") == 0) {
validate_external_account_creds_service_account_impersonation_request(
- request, body, body_size, true);
+ request, host, path, body, body_size, true);
*response = http_response(
200,
valid_external_account_creds_service_account_impersonation_response);
- } else if (strcmp(request->http.path, "/token_url_encode") == 0) {
+ } else if (strcmp(path, "/token_url_encode") == 0) {
validate_external_account_creds_token_exchage_request_with_url_encode(
- request, body, body_size, true);
+ request, host, path, body, body_size, true);
*response = http_response(
200, valid_external_account_creds_token_exchange_response);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int
-external_account_creds_httpcli_post_failure_token_exchange_response_missing_access_token(
- const grpc_httpcli_request* request, const char* /*body*/,
- size_t /*body_size*/, grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- if (strcmp(request->http.path, "/token") == 0) {
+int external_account_creds_httpcli_post_failure_token_exchange_response_missing_access_token(
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* path, const char* /*body*/, size_t /*body_size*/,
+ Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
+ if (strcmp(path, "/token") == 0) {
*response = http_response(200,
"{\"not_access_token\":\"not_access_token\","
"\"expires_in\":3599,"
" \"token_type\":\"Bearer\"}");
- } else if (strcmp(request->http.path, "/service_account_impersonation") ==
- 0) {
+ } else if (strcmp(path, "/service_account_impersonation") == 0) {
*response = http_response(
200,
valid_external_account_creds_service_account_impersonation_response);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int url_external_account_creds_httpcli_get_success(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
- if (strcmp(request->http.path, "/generate_subject_token_format_text") == 0) {
+int url_external_account_creds_httpcli_get_success(
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* path, Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
+ if (strcmp(path, "/generate_subject_token_format_text") == 0) {
*response = http_response(
200,
valid_url_external_account_creds_retrieve_subject_token_response_format_text);
- } else if (strcmp(request->http.path, "/path/to/url/creds?p1=v1&p2=v2") ==
- 0) {
+ } else if (strcmp(path, "/path/to/url/creds?p1=v1&p2=v2") == 0) {
*response = http_response(
200,
valid_url_external_account_creds_retrieve_subject_token_response_format_text);
- } else if (strcmp(request->http.path,
- "/generate_subject_token_format_json") == 0) {
+ } else if (strcmp(path, "/generate_subject_token_format_json") == 0) {
*response = http_response(
200,
valid_url_external_account_creds_retrieve_subject_token_response_format_json);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static void validate_aws_external_account_creds_token_exchage_request(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- bool /*expect_actor_token*/) {
+void validate_aws_external_account_creds_token_exchage_request(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, bool /*expect_actor_token*/) {
// Check that the body is constructed properly.
GPR_ASSERT(body != nullptr);
GPR_ASSERT(body_size != 0);
// Check that the regional_cred_verification_url got constructed
// with the correct AWS Region ("test_regionz" or "test_region").
GPR_ASSERT(strstr(body, "regional_cred_verification_url_test_region"));
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
std::string get_url_equivalent =
absl::StrFormat("%s?%s", "https://foo.com:5555/token", body);
- absl::StatusOr<grpc_core::URI> uri =
- grpc_core::URI::Parse(get_url_equivalent);
+ absl::StatusOr<URI> uri = URI::Parse(get_url_equivalent);
GPR_ASSERT(uri.ok());
assert_query_parameters(*uri, "audience", "audience");
assert_query_parameters(*uri, "grant_type",
@@ -2161,53 +2286,53 @@ static void validate_aws_external_account_creds_token_exchage_request(
assert_query_parameters(*uri, "scope",
"https://www.googleapis.com/auth/cloud-platform");
// Check the rest of the request.
- GPR_ASSERT(strcmp(request->host, "foo.com:5555") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/token") == 0);
- GPR_ASSERT(request->http.hdr_count == 2);
- GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].key, "Authorization") == 0);
- GPR_ASSERT(strcmp(request->http.hdrs[1].value,
+ GPR_ASSERT(strcmp(host, "foo.com:5555") == 0);
+ GPR_ASSERT(strcmp(path, "/token") == 0);
+ GPR_ASSERT(request->hdr_count == 2);
+ GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].key, "Authorization") == 0);
+ GPR_ASSERT(strcmp(request->hdrs[1].value,
"Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=") == 0);
}
-static int aws_external_account_creds_httpcli_get_success(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
- if (strcmp(request->http.path, "/region_url") == 0) {
+int aws_external_account_creds_httpcli_get_success(
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* path, Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
+ if (strcmp(path, "/region_url") == 0) {
*response = http_response(200, "test_regionz");
- } else if (strcmp(request->http.path, "/url") == 0) {
+ } else if (strcmp(path, "/url") == 0) {
*response = http_response(200, "test_role_name");
- } else if (strcmp(request->http.path, "/url_no_role_name") == 0) {
+ } else if (strcmp(path, "/url_no_role_name") == 0) {
*response = http_response(200, "");
- } else if (strcmp(request->http.path, "/url/test_role_name") == 0) {
+ } else if (strcmp(path, "/url/test_role_name") == 0) {
*response = http_response(
200, valid_aws_external_account_creds_retrieve_signing_keys_response);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int aws_external_account_creds_httpcli_post_success(
- const grpc_httpcli_request* request, const char* body, size_t body_size,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
- if (strcmp(request->http.path, "/token") == 0) {
- validate_aws_external_account_creds_token_exchage_request(request, body,
- body_size, true);
+int aws_external_account_creds_httpcli_post_success(
+ const grpc_http_request* request, const char* host, const char* path,
+ const char* body, size_t body_size, Timestamp /*deadline*/,
+ grpc_closure* on_done, grpc_http_response* response) {
+ if (strcmp(path, "/token") == 0) {
+ validate_aws_external_account_creds_token_exchage_request(
+ request, host, path, body, body_size, true);
*response = http_response(
200, valid_external_account_creds_token_exchange_response);
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
// The subclass of ExternalAccountCredentials for testing.
// ExternalAccountCredentials is an abstract class so we can't directly test
// against it.
-class TestExternalAccountCredentials final
- : public grpc_core::ExternalAccountCredentials {
+class TestExternalAccountCredentials final : public ExternalAccountCredentials {
public:
TestExternalAccountCredentials(Options options,
std::vector<std::string> scopes)
@@ -2221,12 +2346,9 @@ class TestExternalAccountCredentials final
}
};
-static void test_external_account_creds_success(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+TEST(CredentialsTest, TestExternalAccountCredsSuccess) {
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
@@ -2238,33 +2360,35 @@ static void test_external_account_creds_success(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {});
/* Check security level. */
GPR_ASSERT(creds.min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http put should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(&creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
/* Second request: the cached token should be served directly. */
- state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
- run_request_metadata_test(&creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void test_external_account_creds_success_with_url_encode(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+ state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest, TestExternalAccountCredsSuccessWithUrlEncode) {
+ std::map<std::string, std::string> emd = {
+ {"authorization", "Bearer token_exchange_access_token"}};
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience_!@#$", // audience;
@@ -2276,25 +2400,23 @@ static void test_external_account_creds_success_with_url_encode(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {});
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(&creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void
-test_external_account_creds_success_with_service_account_impersonation(void) {
- expected_md emd[] = {
- {"authorization", "Bearer service_account_impersonation_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest,
+ TestExternalAccountCredsSuccessWithServiceAccountImpersonation) {
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
@@ -2306,25 +2428,26 @@ test_external_account_creds_success_with_service_account_impersonation(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {"scope_1", "scope_2"});
/* Check security level. */
GPR_ASSERT(creds.min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
/* First request: http put should be called. */
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(&creds, auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void test_external_account_creds_failure_invalid_token_url(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE,
+ "authorization: Bearer service_account_impersonation_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest, TestExternalAccountCredsFailureInvalidTokenUrl) {
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
@@ -2336,30 +2459,28 @@ static void test_external_account_creds_failure_invalid_token_url(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {});
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Invalid token url: invalid_token_url.");
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- run_request_metadata_test(&creds, auth_md_ctx, state);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GRPC_ERROR_UNREF(error);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void
-test_external_account_creds_failure_invalid_service_account_impersonation_url(
- void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+TEST(CredentialsTest,
+ TestExternalAccountCredsFailureInvalidServiceAccountImpersonationUrl) {
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
@@ -2371,31 +2492,29 @@ test_external_account_creds_failure_invalid_service_account_impersonation_url(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {});
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Invalid service account impersonation url: "
"invalid_service_account_impersonation_url.");
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- run_request_metadata_test(&creds, auth_md_ctx, state);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GRPC_ERROR_UNREF(error);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void
-test_external_account_creds_failure_token_exchange_response_missing_access_token(
- void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
- grpc_core::Json credential_source("");
+TEST(CredentialsTest,
+ TestExternalAccountCredsFailureTokenExchangeResponseMissingAccessToken) {
+ ExecCtx exec_ctx;
+ Json credential_source("");
TestExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
@@ -2407,9 +2526,10 @@ test_external_account_creds_failure_token_exchange_response_missing_access_token
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
TestExternalAccountCredentials creds(options, {});
- grpc_httpcli_set_override(
+ HttpRequest::SetOverride(
httpcli_get_should_not_be_called,
external_account_creds_httpcli_post_failure_token_exchange_response_missing_access_token);
grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -2419,25 +2539,22 @@ test_external_account_creds_failure_token_exchange_response_missing_access_token
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- run_request_metadata_test(&creds, auth_md_ctx, state);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority,
+ kTestPath);
GRPC_ERROR_UNREF(error);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
}
-static void test_url_external_account_creds_success_format_text(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestUrlExternalAccountCredsSuccessFormatText) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_url_external_account_creds_options_credential_source_format_text,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2448,33 +2565,33 @@ static void test_url_external_account_creds_success_format_text(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::UrlExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = UrlExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(url_external_account_creds_httpcli_get_success,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void
-test_url_external_account_creds_success_with_qurey_params_format_text(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(url_external_account_creds_httpcli_get_success,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest,
+ TestUrlExternalAccountCredsSuccessWithQureyParamsFormatText) {
+ std::map<std::string, std::string> emd = {
+ {"authorization", "Bearer token_exchange_access_token"}};
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_url_external_account_creds_options_credential_source_with_qurey_params_format_text,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2485,32 +2602,30 @@ test_url_external_account_creds_success_with_qurey_params_format_text(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::UrlExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = UrlExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(url_external_account_creds_httpcli_get_success,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void test_url_external_account_creds_success_format_json(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(url_external_account_creds_httpcli_get_success,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest, TestUrlExternalAccountCredsSuccessFormatJson) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_url_external_account_creds_options_credential_source_format_json,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2521,28 +2636,29 @@ static void test_url_external_account_creds_success_format_json(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::UrlExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = UrlExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(url_external_account_creds_httpcli_get_success,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void
-test_url_external_account_creds_failure_invalid_credential_source_url(void) {
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(url_external_account_creds_httpcli_get_success,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest,
+ TestUrlExternalAccountCredsFailureInvalidCredentialSourceUrl) {
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_url_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2553,33 +2669,28 @@ test_url_external_account_creds_failure_invalid_credential_source_url(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::UrlExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = UrlExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds == nullptr);
- grpc_slice actual_error_slice;
- GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
- &actual_error_slice));
- absl::string_view actual_error =
- grpc_core::StringViewFromSlice(actual_error_slice);
+ std::string actual_error;
+ GPR_ASSERT(
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
GPR_ASSERT(absl::StartsWith(actual_error, "Invalid credential source url."));
GRPC_ERROR_UNREF(error);
}
-static void test_file_external_account_creds_success_format_text(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestFileExternalAccountCredsSuccessFormatText) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
char* subject_token_path = write_tmp_jwt_file("test_subject_token");
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
absl::StrFormat(
"{\"file\":\"%s\"}",
absl::StrReplaceAll(subject_token_path, {{"\\", "\\\\"}})),
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2590,32 +2701,30 @@ static void test_file_external_account_creds_success_format_text(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::FileExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = FileExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
gpr_free(subject_token_path);
}
-static void test_file_external_account_creds_success_format_json(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestFileExternalAccountCredsSuccessFormatJson) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
char* subject_token_path =
write_tmp_jwt_file("{\"access_token\":\"test_subject_token\"}");
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
absl::StrFormat(
"{\n"
"\"file\":\"%s\",\n"
@@ -2628,7 +2737,7 @@ static void test_file_external_account_creds_success_format_json(void) {
absl::StrReplaceAll(subject_token_path, {{"\\", "\\\\"}})),
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2639,32 +2748,31 @@ static void test_file_external_account_creds_success_format_json(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::FileExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = FileExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
gpr_free(subject_token_path);
}
-static void test_file_external_account_creds_failure_file_not_found(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestFileExternalAccountCredsFailureFileNotFound) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source =
- grpc_core::Json::Parse("{\"file\":\"non_exisiting_file\"}", &error);
+ Json credential_source =
+ Json::Parse("{\"file\":\"non_exisiting_file\"}", &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2675,33 +2783,30 @@ static void test_file_external_account_creds_failure_file_not_found(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::FileExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = FileExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to load file");
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
}
-static void test_file_external_account_creds_failure_invalid_json_content(
- void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestFileExternalAccountCredsFailureInvalidJsonContent) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
char* subject_token_path = write_tmp_jwt_file("not_a_valid_json_file");
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
absl::StrFormat(
"{\n"
"\"file\":\"%s\",\n"
@@ -2714,7 +2819,7 @@ static void test_file_external_account_creds_failure_invalid_json_content(
absl::StrReplaceAll(subject_token_path, {{"\\", "\\\\"}})),
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2725,37 +2830,34 @@ static void test_file_external_account_creds_failure_invalid_json_content(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::FileExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = FileExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
+ HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"The content of the file is not a valid json object.");
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
gpr_free(subject_token_path);
}
-static void test_aws_external_account_creds_success(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsSuccess) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2766,33 +2868,30 @@ static void test_aws_external_account_creds_success(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
-}
-
-static void test_aws_external_account_creds_success_path_region_env_keys_url(
- void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
+}
+
+TEST(CredentialsTest, TestAwsExternalAccountCredsSuccessPathRegionEnvKeysUrl) {
+ ExecCtx exec_ctx;
gpr_setenv("AWS_REGION", "test_regionz");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2803,34 +2902,32 @@ static void test_aws_external_account_creds_success_path_region_env_keys_url(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_REGION");
}
-static void
-test_aws_external_account_creds_success_path_default_region_env_keys_url(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsSuccessPathDefaultRegionEnvKeysUrl) {
+ ExecCtx exec_ctx;
gpr_setenv("AWS_DEFAULT_REGION", "test_regionz");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2841,37 +2938,34 @@ test_aws_external_account_creds_success_path_default_region_env_keys_url(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_DEFAULT_REGION");
}
-static void
-test_aws_external_account_creds_success_path_duplicate_region_env_keys_url(
- void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsSuccessPathDuplicateRegionEnvKeysUrl) {
+ ExecCtx exec_ctx;
// Make sure that AWS_REGION gets used over AWS_DEFAULT_REGION
gpr_setenv("AWS_REGION", "test_regionz");
gpr_setenv("AWS_DEFAULT_REGION", "ERROR_REGION");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2882,37 +2976,34 @@ test_aws_external_account_creds_success_path_duplicate_region_env_keys_url(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_REGION");
gpr_unsetenv("AWS_DEFAULT_REGION");
}
-static void test_aws_external_account_creds_success_path_region_url_keys_env(
- void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsSuccessPathRegionUrlKeysEnv) {
+ ExecCtx exec_ctx;
gpr_setenv("AWS_ACCESS_KEY_ID", "test_access_key_id");
gpr_setenv("AWS_SECRET_ACCESS_KEY", "test_secret_access_key");
gpr_setenv("AWS_SESSION_TOKEN", "test_token");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2923,39 +3014,36 @@ static void test_aws_external_account_creds_success_path_region_url_keys_env(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_ACCESS_KEY_ID");
gpr_unsetenv("AWS_SECRET_ACCESS_KEY");
gpr_unsetenv("AWS_SESSION_TOKEN");
}
-static void test_aws_external_account_creds_success_path_region_env_keys_env(
- void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsSuccessPathRegionEnvKeysEnv) {
+ ExecCtx exec_ctx;
gpr_setenv("AWS_REGION", "test_regionz");
gpr_setenv("AWS_ACCESS_KEY_ID", "test_access_key_id");
gpr_setenv("AWS_SECRET_ACCESS_KEY", "test_secret_access_key");
gpr_setenv("AWS_SESSION_TOKEN", "test_token");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -2966,40 +3054,40 @@ static void test_aws_external_account_creds_success_path_region_env_keys_env(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_REGION");
gpr_unsetenv("AWS_ACCESS_KEY_ID");
gpr_unsetenv("AWS_SECRET_ACCESS_KEY");
gpr_unsetenv("AWS_SESSION_TOKEN");
}
-static void
-test_aws_external_account_creds_success_path_default_region_env_keys_env(void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsSuccessPathDefaultRegionEnvKeysEnv) {
+ std::map<std::string, std::string> emd = {
+ {"authorization", "Bearer token_exchange_access_token"}};
+ ExecCtx exec_ctx;
gpr_setenv("AWS_DEFAULT_REGION", "test_regionz");
gpr_setenv("AWS_ACCESS_KEY_ID", "test_access_key_id");
gpr_setenv("AWS_SECRET_ACCESS_KEY", "test_secret_access_key");
gpr_setenv("AWS_SESSION_TOKEN", "test_token");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3010,32 +3098,29 @@ test_aws_external_account_creds_success_path_default_region_env_keys_env(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_DEFAULT_REGION");
gpr_unsetenv("AWS_ACCESS_KEY_ID");
gpr_unsetenv("AWS_SECRET_ACCESS_KEY");
gpr_unsetenv("AWS_SESSION_TOKEN");
}
-static void
-test_aws_external_account_creds_success_path_duplicate_region_env_keys_env(
- void) {
- expected_md emd[] = {{"authorization", "Bearer token_exchange_access_token"}};
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsSuccessPathDuplicateRegionEnvKeysEnv) {
+ ExecCtx exec_ctx;
// Make sure that AWS_REGION gets used over AWS_DEFAULT_REGION
gpr_setenv("AWS_REGION", "test_regionz");
gpr_setenv("AWS_DEFAULT_REGION", "ERROR_REGION");
@@ -3043,10 +3128,10 @@ test_aws_external_account_creds_success_path_duplicate_region_env_keys_env(
gpr_setenv("AWS_SECRET_ACCESS_KEY", "test_secret_access_key");
gpr_setenv("AWS_SESSION_TOKEN", "test_token");
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
valid_aws_external_account_creds_options_credential_source, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3057,19 +3142,20 @@ test_aws_external_account_creds_success_path_duplicate_region_env_keys_env(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
- request_metadata_state* state =
- make_request_metadata_state(GRPC_ERROR_NONE, emd, GPR_ARRAY_SIZE(emd));
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(
+ GRPC_ERROR_NONE, "authorization: Bearer token_exchange_access_token");
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
gpr_unsetenv("AWS_REGION");
gpr_unsetenv("AWS_DEFAULT_REGION");
gpr_unsetenv("AWS_ACCESS_KEY_ID");
@@ -3077,14 +3163,14 @@ test_aws_external_account_creds_success_path_duplicate_region_env_keys_env(
gpr_unsetenv("AWS_SESSION_TOKEN");
}
-static void test_aws_external_account_creds_failure_unmatched_environment_id(
- void) {
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsFailureUnmatchedEnvironmentId) {
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_aws_external_account_creds_options_credential_source_unmatched_environment_id,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3095,29 +3181,26 @@ static void test_aws_external_account_creds_failure_unmatched_environment_id(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds == nullptr);
- grpc_slice expected_error_slice =
- grpc_slice_from_static_string("environment_id does not match.");
- grpc_slice actual_error_slice;
- GPR_ASSERT(grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION,
- &actual_error_slice));
- GPR_ASSERT(grpc_slice_cmp(expected_error_slice, actual_error_slice) == 0);
+ std::string expected_error = "environment_id does not match.";
+ std::string actual_error;
+ GPR_ASSERT(
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &actual_error));
+ GPR_ASSERT(expected_error == actual_error);
GRPC_ERROR_UNREF(error);
}
-static void test_aws_external_account_creds_failure_invalid_region_url(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsFailureInvalidRegionUrl) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_aws_external_account_creds_options_credential_source_invalid_region_url,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3128,9 +3211,9 @@ static void test_aws_external_account_creds_failure_invalid_region_url(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
@@ -3139,26 +3222,24 @@ static void test_aws_external_account_creds_failure_invalid_region_url(void) {
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
}
-static void test_aws_external_account_creds_failure_invalid_url(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsFailureInvalidUrl) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_aws_external_account_creds_options_credential_source_invalid_url,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3169,9 +3250,9 @@ static void test_aws_external_account_creds_failure_invalid_url(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
@@ -3179,26 +3260,24 @@ static void test_aws_external_account_creds_failure_invalid_url(void) {
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
}
-static void test_aws_external_account_creds_failure_missing_role_name(void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest, TestAwsExternalAccountCredsFailureMissingRoleName) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_aws_external_account_creds_options_credential_source_missing_role_name,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3209,9 +3288,9 @@ static void test_aws_external_account_creds_failure_missing_role_name(void) {
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
@@ -3220,28 +3299,25 @@ static void test_aws_external_account_creds_failure_missing_role_name(void) {
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
}
-static void
-test_aws_external_account_creds_failure_invalid_regional_cred_verification_url(
- void) {
- grpc_core::ExecCtx exec_ctx;
- grpc_auth_metadata_context auth_md_ctx = {test_service_url, test_method,
- nullptr, nullptr};
+TEST(CredentialsTest,
+ TestAwsExternalAccountCredsFailureInvalidRegionalCredVerificationUrl) {
+ ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
- grpc_core::Json credential_source = grpc_core::Json::Parse(
+ Json credential_source = Json::Parse(
invalid_aws_external_account_creds_options_credential_source_invalid_regional_cred_verification_url,
&error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
- grpc_core::ExternalAccountCredentials::Options options = {
+ ExternalAccountCredentials::Options options = {
"external_account", // type;
"audience", // audience;
"subject_token_type", // subject_token_type;
@@ -3252,9 +3328,9 @@ test_aws_external_account_creds_failure_invalid_regional_cred_verification_url(
"quota_project_id", // quota_project_id;
"client_id", // client_id;
"client_secret", // client_secret;
+ "", // workforce_pool_user_project;
};
- auto creds =
- grpc_core::AwsExternalAccountCredentials::Create(options, {}, &error);
+ auto creds = AwsExternalAccountCredentials::Create(options, {}, &error);
GPR_ASSERT(creds != nullptr);
GPR_ASSERT(error == GRPC_ERROR_NONE);
GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY);
@@ -3263,17 +3339,17 @@ test_aws_external_account_creds_failure_invalid_regional_cred_verification_url(
grpc_error_handle expected_error =
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Error occurred when fetching oauth2 token.", &error, 1);
- request_metadata_state* state =
- make_request_metadata_state(expected_error, nullptr, 0);
- grpc_httpcli_set_override(aws_external_account_creds_httpcli_get_success,
- aws_external_account_creds_httpcli_post_success);
- run_request_metadata_test(creds.get(), auth_md_ctx, state);
- grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ auto state = RequestMetadataState::NewInstance(expected_error, {});
+ HttpRequest::SetOverride(aws_external_account_creds_httpcli_get_success,
+ aws_external_account_creds_httpcli_post_success);
+ state->RunRequestMetadataTest(creds.get(), kTestUrlScheme, kTestAuthority,
+ kTestPath);
+ ExecCtx::Get()->Flush();
+ HttpRequest::SetOverride(nullptr, nullptr);
GRPC_ERROR_UNREF(error);
}
-static void test_external_account_credentials_create_success(void) {
+TEST(CredentialsTest, TestExternalAccountCredentialsCreateSuccess) {
// url credentials
const char* url_options_string =
"{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_"
@@ -3326,25 +3402,25 @@ static void test_external_account_credentials_create_success(void) {
aws_creds->Unref();
}
-static void
-test_external_account_credentials_create_failure_invalid_json_format(void) {
+TEST(CredentialsTest,
+ TestExternalAccountCredentialsCreateFailureInvalidJsonFormat) {
const char* options_string = "invalid_json";
grpc_call_credentials* creds =
grpc_external_account_credentials_create(options_string, "");
GPR_ASSERT(creds == nullptr);
}
-static void
-test_external_account_credentials_create_failure_invalid_options_format(void) {
+TEST(CredentialsTest,
+ TestExternalAccountCredentialsCreateFailureInvalidOptionsFormat) {
const char* options_string = "{\"random_key\":\"random_value\"}";
grpc_call_credentials* creds =
grpc_external_account_credentials_create(options_string, "");
GPR_ASSERT(creds == nullptr);
}
-static void
-test_external_account_credentials_create_failure_invalid_options_credential_source(
- void) {
+TEST(
+ CredentialsTest,
+ TestExternalAccountCredentialsCreateFailureInvalidOptionsCredentialSource) {
const char* options_string =
"{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_"
"token_type\":\"subject_token_type\",\"service_account_impersonation_"
@@ -3359,81 +3435,244 @@ test_external_account_credentials_create_failure_invalid_options_credential_sour
GPR_ASSERT(creds == nullptr);
}
+TEST(CredentialsTest,
+ TestExternalAccountCredentialsCreateSuccessWorkforcePool) {
+ const char* url_options_string =
+ "{\"type\":\"external_account\",\"audience\":\"//iam.googleapis.com/"
+ "locations/location/workforcePools/pool/providers/provider\",\"subject_"
+ "token_type\":\"subject_token_type\",\"service_account_impersonation_"
+ "url\":\"service_account_impersonation_url\",\"token_url\":\"https://"
+ "foo.com:5555/token\",\"token_info_url\":\"https://foo.com:5555/"
+ "token_info\",\"credential_source\":{\"url\":\"https://foo.com:5555/"
+ "generate_subject_token_format_json\",\"headers\":{\"Metadata-Flavor\":"
+ "\"Google\"},\"format\":{\"type\":\"json\",\"subject_token_field_name\":"
+ "\"access_token\"}},\"quota_project_id\":\"quota_"
+ "project_id\",\"client_id\":\"client_id\",\"client_secret\":\"client_"
+ "secret\",\"workforce_pool_user_project\":\"workforce_pool_user_"
+ "project\"}";
+ const char* url_scopes_string = "scope1,scope2";
+ grpc_call_credentials* url_creds = grpc_external_account_credentials_create(
+ url_options_string, url_scopes_string);
+ GPR_ASSERT(url_creds != nullptr);
+ url_creds->Unref();
+}
+
+TEST(CredentialsTest,
+ TestExternalAccountCredentialsCreateFailureInvalidWorkforcePoolAudience) {
+ const char* url_options_string =
+ "{\"type\":\"external_account\",\"audience\":\"invalid_workforce_pool_"
+ "audience\",\"subject_"
+ "token_type\":\"subject_token_type\",\"service_account_impersonation_"
+ "url\":\"service_account_impersonation_url\",\"token_url\":\"https://"
+ "foo.com:5555/token\",\"token_info_url\":\"https://foo.com:5555/"
+ "token_info\",\"credential_source\":{\"url\":\"https://foo.com:5555/"
+ "generate_subject_token_format_json\",\"headers\":{\"Metadata-Flavor\":"
+ "\"Google\"},\"format\":{\"type\":\"json\",\"subject_token_field_name\":"
+ "\"access_token\"}},\"quota_project_id\":\"quota_"
+ "project_id\",\"client_id\":\"client_id\",\"client_secret\":\"client_"
+ "secret\",\"workforce_pool_user_project\":\"workforce_pool_user_"
+ "project\"}";
+ const char* url_scopes_string = "scope1,scope2";
+ grpc_call_credentials* url_creds = grpc_external_account_credentials_create(
+ url_options_string, url_scopes_string);
+ GPR_ASSERT(url_creds == nullptr);
+}
+
+TEST(CredentialsTest, TestInsecureCredentialsCompareSuccess) {
+ auto insecure_creds_1 = grpc_insecure_credentials_create();
+ auto insecure_creds_2 = grpc_insecure_credentials_create();
+ ASSERT_EQ(insecure_creds_1->cmp(insecure_creds_2), 0);
+ grpc_arg arg_1 = grpc_channel_credentials_to_arg(insecure_creds_1);
+ grpc_channel_args args_1 = {1, &arg_1};
+ grpc_arg arg_2 = grpc_channel_credentials_to_arg(insecure_creds_2);
+ grpc_channel_args args_2 = {1, &arg_2};
+ EXPECT_EQ(grpc_channel_args_compare(&args_1, &args_2), 0);
+ grpc_channel_credentials_release(insecure_creds_1);
+ grpc_channel_credentials_release(insecure_creds_2);
+}
+
+TEST(CredentialsTest, TestInsecureCredentialsCompareFailure) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto* fake_creds = grpc_fake_transport_security_credentials_create();
+ ASSERT_NE(insecure_creds->cmp(fake_creds), 0);
+ ASSERT_NE(fake_creds->cmp(insecure_creds), 0);
+ grpc_arg arg_1 = grpc_channel_credentials_to_arg(insecure_creds);
+ grpc_channel_args args_1 = {1, &arg_1};
+ grpc_arg arg_2 = grpc_channel_credentials_to_arg(fake_creds);
+ grpc_channel_args args_2 = {1, &arg_2};
+ EXPECT_NE(grpc_channel_args_compare(&args_1, &args_2), 0);
+ grpc_channel_credentials_release(fake_creds);
+ grpc_channel_credentials_release(insecure_creds);
+}
+
+TEST(CredentialsTest, TestInsecureCredentialsSingletonCreate) {
+ auto* insecure_creds_1 = grpc_insecure_credentials_create();
+ auto* insecure_creds_2 = grpc_insecure_credentials_create();
+ EXPECT_EQ(insecure_creds_1, insecure_creds_2);
+}
+
+TEST(CredentialsTest, TestFakeCallCredentialsCompareSuccess) {
+ auto call_creds = MakeRefCounted<fake_call_creds>();
+ GPR_ASSERT(call_creds->cmp(call_creds.get()) == 0);
+}
+
+TEST(CredentialsTest, TestFakeCallCredentialsCompareFailure) {
+ auto fake_creds = MakeRefCounted<fake_call_creds>();
+ auto* md_creds = grpc_md_only_test_credentials_create("key", "value");
+ GPR_ASSERT(fake_creds->cmp(md_creds) != 0);
+ GPR_ASSERT(md_creds->cmp(fake_creds.get()) != 0);
+ grpc_call_credentials_release(md_creds);
+}
+
+TEST(CredentialsTest, TestHttpRequestSSLCredentialsCompare) {
+ auto creds_1 = CreateHttpRequestSSLCredentials();
+ auto creds_2 = CreateHttpRequestSSLCredentials();
+ EXPECT_EQ(creds_1->cmp(creds_2.get()), 0);
+ EXPECT_EQ(creds_2->cmp(creds_1.get()), 0);
+}
+
+TEST(CredentialsTest, TestHttpRequestSSLCredentialsSingleton) {
+ auto creds_1 = CreateHttpRequestSSLCredentials();
+ auto creds_2 = CreateHttpRequestSSLCredentials();
+ EXPECT_EQ(creds_1, creds_2);
+}
+
+TEST(CredentialsTest, TestCompositeChannelCredsCompareSuccess) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto fake_creds = MakeRefCounted<fake_call_creds>();
+ auto* composite_creds_1 = grpc_composite_channel_credentials_create(
+ insecure_creds, fake_creds.get(), nullptr);
+ auto* composite_creds_2 = grpc_composite_channel_credentials_create(
+ insecure_creds, fake_creds.get(), nullptr);
+ EXPECT_EQ(composite_creds_1->cmp(composite_creds_2), 0);
+ EXPECT_EQ(composite_creds_2->cmp(composite_creds_1), 0);
+ grpc_channel_credentials_release(insecure_creds);
+ grpc_channel_credentials_release(composite_creds_1);
+ grpc_channel_credentials_release(composite_creds_2);
+}
+
+TEST(CredentialsTest,
+ TestCompositeChannelCredsCompareFailureDifferentChannelCreds) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto* fake_channel_creds = grpc_fake_transport_security_credentials_create();
+ auto fake_creds = MakeRefCounted<fake_call_creds>();
+ auto* composite_creds_1 = grpc_composite_channel_credentials_create(
+ insecure_creds, fake_creds.get(), nullptr);
+ auto* composite_creds_2 = grpc_composite_channel_credentials_create(
+ fake_channel_creds, fake_creds.get(), nullptr);
+ EXPECT_NE(composite_creds_1->cmp(composite_creds_2), 0);
+ EXPECT_NE(composite_creds_2->cmp(composite_creds_1), 0);
+ grpc_channel_credentials_release(insecure_creds);
+ grpc_channel_credentials_release(fake_channel_creds);
+ grpc_channel_credentials_release(composite_creds_1);
+ grpc_channel_credentials_release(composite_creds_2);
+}
+
+TEST(CredentialsTest,
+ TestCompositeChannelCredsCompareFailureDifferentCallCreds) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto fake_creds = MakeRefCounted<fake_call_creds>();
+ auto* md_creds = grpc_md_only_test_credentials_create("key", "value");
+ auto* composite_creds_1 = grpc_composite_channel_credentials_create(
+ insecure_creds, fake_creds.get(), nullptr);
+ auto* composite_creds_2 = grpc_composite_channel_credentials_create(
+ insecure_creds, md_creds, nullptr);
+ EXPECT_NE(composite_creds_1->cmp(composite_creds_2), 0);
+ EXPECT_NE(composite_creds_2->cmp(composite_creds_1), 0);
+ grpc_channel_credentials_release(insecure_creds);
+ grpc_call_credentials_release(md_creds);
+ grpc_channel_credentials_release(composite_creds_1);
+ grpc_channel_credentials_release(composite_creds_2);
+}
+
+TEST(CredentialsTest, TestTlsCredentialsCompareSuccess) {
+ auto* tls_creds_1 =
+ grpc_tls_credentials_create(grpc_tls_credentials_options_create());
+ auto* tls_creds_2 =
+ grpc_tls_credentials_create(grpc_tls_credentials_options_create());
+ EXPECT_EQ(tls_creds_1->cmp(tls_creds_2), 0);
+ EXPECT_EQ(tls_creds_2->cmp(tls_creds_1), 0);
+ grpc_channel_credentials_release(tls_creds_1);
+ grpc_channel_credentials_release(tls_creds_2);
+}
+
+TEST(CredentialsTest, TestTlsCredentialsWithVerifierCompareSuccess) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ options_1->set_certificate_verifier(
+ MakeRefCounted<HostNameCertificateVerifier>());
+ auto* tls_creds_1 = grpc_tls_credentials_create(options_1);
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_2->set_certificate_verifier(
+ MakeRefCounted<HostNameCertificateVerifier>());
+ auto* tls_creds_2 = grpc_tls_credentials_create(options_2);
+ EXPECT_EQ(tls_creds_1->cmp(tls_creds_2), 0);
+ EXPECT_EQ(tls_creds_2->cmp(tls_creds_1), 0);
+ grpc_channel_credentials_release(tls_creds_1);
+ grpc_channel_credentials_release(tls_creds_2);
+}
+
+TEST(CredentialsTest, TestTlsCredentialsCompareFailure) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ options_1->set_check_call_host(true);
+ auto* tls_creds_1 = grpc_tls_credentials_create(options_1);
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_2->set_check_call_host(false);
+ auto* tls_creds_2 = grpc_tls_credentials_create(options_2);
+ EXPECT_NE(tls_creds_1->cmp(tls_creds_2), 0);
+ EXPECT_NE(tls_creds_2->cmp(tls_creds_1), 0);
+ grpc_channel_credentials_release(tls_creds_1);
+ grpc_channel_credentials_release(tls_creds_2);
+}
+
+TEST(CredentialsTest, TestTlsCredentialsWithVerifierCompareFailure) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ options_1->set_certificate_verifier(
+ MakeRefCounted<HostNameCertificateVerifier>());
+ auto* tls_creds_1 = grpc_tls_credentials_create(options_1);
+ auto* options_2 = grpc_tls_credentials_options_create();
+ grpc_tls_certificate_verifier_external verifier = {nullptr, nullptr, nullptr,
+ nullptr};
+ options_2->set_certificate_verifier(
+ MakeRefCounted<ExternalCertificateVerifier>(&verifier));
+ auto* tls_creds_2 = grpc_tls_credentials_create(options_2);
+ EXPECT_NE(tls_creds_1->cmp(tls_creds_2), 0);
+ EXPECT_NE(tls_creds_2->cmp(tls_creds_1), 0);
+ grpc_channel_credentials_release(tls_creds_1);
+ grpc_channel_credentials_release(tls_creds_2);
+}
+
+TEST(CredentialsTest, TestXdsCredentialsCompareSucces) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto* xds_creds_1 = grpc_xds_credentials_create(insecure_creds);
+ auto* xds_creds_2 = grpc_xds_credentials_create(insecure_creds);
+ EXPECT_EQ(xds_creds_1->cmp(xds_creds_2), 0);
+ EXPECT_EQ(xds_creds_2->cmp(xds_creds_1), 0);
+ grpc_channel_credentials_release(insecure_creds);
+ grpc_channel_credentials_release(xds_creds_1);
+ grpc_channel_credentials_release(xds_creds_2);
+}
+
+TEST(CredentialsTest, TestXdsCredentialsCompareFailure) {
+ auto* insecure_creds = grpc_insecure_credentials_create();
+ auto* fake_creds = grpc_fake_transport_security_credentials_create();
+ auto* xds_creds_1 = grpc_xds_credentials_create(insecure_creds);
+ auto* xds_creds_2 = grpc_xds_credentials_create(fake_creds);
+ EXPECT_NE(xds_creds_1->cmp(xds_creds_2), 0);
+ EXPECT_NE(xds_creds_2->cmp(xds_creds_1), 0);
+ grpc_channel_credentials_release(insecure_creds);
+ grpc_channel_credentials_release(fake_creds);
+ grpc_channel_credentials_release(xds_creds_1);
+ grpc_channel_credentials_release(xds_creds_2);
+}
+
+} // namespace
+} // namespace grpc_core
+
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
- test_empty_md_array();
- test_add_to_empty_md_array();
- test_add_abunch_to_md_array();
- test_oauth2_token_fetcher_creds_parsing_ok();
- test_oauth2_token_fetcher_creds_parsing_bad_http_status();
- test_oauth2_token_fetcher_creds_parsing_empty_http_body();
- test_oauth2_token_fetcher_creds_parsing_invalid_json();
- test_oauth2_token_fetcher_creds_parsing_missing_token();
- test_oauth2_token_fetcher_creds_parsing_missing_token_type();
- test_oauth2_token_fetcher_creds_parsing_missing_token_lifetime();
- test_google_iam_creds();
- test_access_token_creds();
- test_channel_oauth2_composite_creds();
- test_oauth2_google_iam_composite_creds();
- test_channel_oauth2_google_iam_composite_creds();
- test_compute_engine_creds_success();
- test_compute_engine_creds_failure();
- test_refresh_token_creds_success();
- test_refresh_token_creds_failure();
- test_valid_sts_creds_options();
- test_invalid_sts_creds_options();
- test_sts_creds_success();
- test_sts_creds_no_actor_token_success();
- test_sts_creds_load_token_failure();
- test_sts_creds_http_failure();
- test_sts_creds_token_file_not_found();
- test_jwt_creds_lifetime();
- test_jwt_creds_success();
- test_jwt_creds_signing_failure();
- test_google_default_creds_auth_key();
- test_google_default_creds_refresh_token();
- test_google_default_creds_gce();
- test_google_default_creds_non_gce();
- test_no_google_default_creds();
- test_google_default_creds_call_creds_specified();
- test_google_default_creds_not_default();
- test_metadata_plugin_success();
- test_metadata_plugin_failure();
- test_get_well_known_google_credentials_file_path();
- test_channel_creds_duplicate_without_call_creds();
- test_auth_metadata_context();
- test_external_account_creds_success();
- test_external_account_creds_success_with_url_encode();
- test_external_account_creds_success_with_service_account_impersonation();
- test_external_account_creds_failure_invalid_token_url();
- test_external_account_creds_failure_invalid_service_account_impersonation_url();
- test_external_account_creds_failure_token_exchange_response_missing_access_token();
- test_url_external_account_creds_success_format_text();
- test_url_external_account_creds_success_format_json();
- test_url_external_account_creds_failure_invalid_credential_source_url();
- test_url_external_account_creds_success_with_qurey_params_format_text();
- test_file_external_account_creds_success_format_text();
- test_file_external_account_creds_success_format_json();
- test_file_external_account_creds_failure_file_not_found();
- test_file_external_account_creds_failure_invalid_json_content();
- test_aws_external_account_creds_success();
- test_aws_external_account_creds_success_path_region_env_keys_url();
- test_aws_external_account_creds_success_path_default_region_env_keys_url();
- test_aws_external_account_creds_success_path_duplicate_region_env_keys_url();
- test_aws_external_account_creds_success_path_region_url_keys_env();
- test_aws_external_account_creds_success_path_region_env_keys_env();
- test_aws_external_account_creds_success_path_default_region_env_keys_env();
- test_aws_external_account_creds_success_path_duplicate_region_env_keys_env();
- test_aws_external_account_creds_failure_unmatched_environment_id();
- test_aws_external_account_creds_failure_invalid_region_url();
- test_aws_external_account_creds_failure_invalid_url();
- test_aws_external_account_creds_failure_missing_role_name();
- test_aws_external_account_creds_failure_invalid_regional_cred_verification_url();
- test_external_account_credentials_create_success();
- test_external_account_credentials_create_failure_invalid_json_format();
- test_external_account_credentials_create_failure_invalid_options_format();
- test_external_account_credentials_create_failure_invalid_options_credential_source();
+ auto result = RUN_ALL_TESTS();
grpc_shutdown();
- return 0;
+ return result;
}
diff --git a/grpc/test/core/security/evaluate_args_test.cc b/grpc/test/core/security/evaluate_args_test.cc
index de98537d..d8753843 100644
--- a/grpc/test/core/security/evaluate_args_test.cc
+++ b/grpc/test/core/security/evaluate_args_test.cc
@@ -14,10 +14,12 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/authorization/evaluate_args.h"
+
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "test/core/util/evaluate_args_test_util.h"
#include "test/core/util/test_config.h"
@@ -30,10 +32,9 @@ class EvaluateArgsTest : public ::testing::Test {
TEST_F(EvaluateArgsTest, EmptyMetadata) {
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetPath(), nullptr);
- EXPECT_EQ(args.GetMethod(), nullptr);
- EXPECT_EQ(args.GetHost(), nullptr);
- EXPECT_THAT(args.GetHeaders(), ::testing::ElementsAre());
+ EXPECT_THAT(args.GetPath(), ::testing::IsEmpty());
+ EXPECT_THAT(args.GetMethod(), ::testing::IsEmpty());
+ EXPECT_THAT(args.GetAuthority(), ::testing::IsEmpty());
EXPECT_EQ(args.GetHeaderValue("some_key", nullptr), absl::nullopt);
}
@@ -43,10 +44,10 @@ TEST_F(EvaluateArgsTest, GetPathSuccess) {
EXPECT_EQ(args.GetPath(), "/expected/path");
}
-TEST_F(EvaluateArgsTest, GetHostSuccess) {
- util_.AddPairToMetadata("host", "host123");
+TEST_F(EvaluateArgsTest, GetAuthoritySuccess) {
+ util_.AddPairToMetadata(":authority", "test.google.com");
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetHost(), "host123");
+ EXPECT_EQ(args.GetAuthority(), "test.google.com");
}
TEST_F(EvaluateArgsTest, GetMethodSuccess) {
@@ -55,16 +56,6 @@ TEST_F(EvaluateArgsTest, GetMethodSuccess) {
EXPECT_EQ(args.GetMethod(), "GET");
}
-TEST_F(EvaluateArgsTest, GetHeadersSuccess) {
- util_.AddPairToMetadata("host", "host123");
- util_.AddPairToMetadata(":path", "/expected/path");
- EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_THAT(args.GetHeaders(),
- ::testing::UnorderedElementsAre(
- ::testing::Pair("host", "host123"),
- ::testing::Pair(":path", "/expected/path")));
-}
-
TEST_F(EvaluateArgsTest, GetHeaderValueSuccess) {
util_.AddPairToMetadata("key123", "value123");
EvaluateArgs args = util_.MakeEvaluateArgs();
@@ -75,38 +66,43 @@ TEST_F(EvaluateArgsTest, GetHeaderValueSuccess) {
EXPECT_EQ(value.value(), "value123");
}
-TEST_F(EvaluateArgsTest, TestIpv4LocalAddressAndPort) {
- util_.SetLocalEndpoint("ipv4:255.255.255.255:123");
+TEST_F(EvaluateArgsTest, GetHeaderValueAliasesHost) {
+ util_.AddPairToMetadata(":authority", "test.google.com");
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetLocalAddress(), "255.255.255.255");
- EXPECT_EQ(args.GetLocalPort(), 123);
-}
-
-TEST_F(EvaluateArgsTest, TestIpv4PeerAddressAndPort) {
- util_.SetPeerEndpoint("ipv4:128.128.128.128:321");
- EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetPeerAddress(), "128.128.128.128");
- EXPECT_EQ(args.GetPeerPort(), 321);
+ std::string concatenated_value;
+ absl::optional<absl::string_view> value =
+ args.GetHeaderValue("host", &concatenated_value);
+ ASSERT_TRUE(value.has_value());
+ EXPECT_EQ(value.value(), "test.google.com");
}
-TEST_F(EvaluateArgsTest, TestIpv6LocalAddressAndPort) {
+TEST_F(EvaluateArgsTest, TestLocalAddressAndPort) {
util_.SetLocalEndpoint("ipv6:[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:456");
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetLocalAddress(), "2001:0db8:85a3:0000:0000:8a2e:0370:7334");
+ grpc_resolved_address local_address = args.GetLocalAddress();
+ EXPECT_EQ(grpc_sockaddr_to_uri(&local_address),
+ "ipv6:[2001:db8:85a3::8a2e:370:7334]:456");
+ EXPECT_EQ(args.GetLocalAddressString(),
+ "2001:0db8:85a3:0000:0000:8a2e:0370:7334");
EXPECT_EQ(args.GetLocalPort(), 456);
}
-TEST_F(EvaluateArgsTest, TestIpv6PeerAddressAndPort) {
- util_.SetPeerEndpoint("ipv6:[2001:db8::1]:654");
+TEST_F(EvaluateArgsTest, TestPeerAddressAndPort) {
+ util_.SetPeerEndpoint("ipv4:255.255.255.255:123");
EvaluateArgs args = util_.MakeEvaluateArgs();
- EXPECT_EQ(args.GetPeerAddress(), "2001:db8::1");
- EXPECT_EQ(args.GetPeerPort(), 654);
+ grpc_resolved_address peer_address = args.GetPeerAddress();
+ EXPECT_EQ(grpc_sockaddr_to_uri(&peer_address), "ipv4:255.255.255.255:123");
+ EXPECT_EQ(args.GetPeerAddressString(), "255.255.255.255");
+ EXPECT_EQ(args.GetPeerPort(), 123);
}
TEST_F(EvaluateArgsTest, EmptyAuthContext) {
EvaluateArgs args = util_.MakeEvaluateArgs();
EXPECT_TRUE(args.GetTransportSecurityType().empty());
EXPECT_TRUE(args.GetSpiffeId().empty());
+ EXPECT_TRUE(args.GetUriSans().empty());
+ EXPECT_TRUE(args.GetDnsSans().empty());
+ EXPECT_TRUE(args.GetSubject().empty());
EXPECT_TRUE(args.GetCommonName().empty());
}
@@ -139,6 +135,20 @@ TEST_F(EvaluateArgsTest, GetSpiffeIdFailDuplicateProperty) {
EXPECT_TRUE(args.GetSpiffeId().empty());
}
+TEST_F(EvaluateArgsTest, GetUriSanSuccessMultipleProperties) {
+ util_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME, "foo");
+ util_.AddPropertyToAuthContext(GRPC_PEER_URI_PROPERTY_NAME, "bar");
+ EvaluateArgs args = util_.MakeEvaluateArgs();
+ EXPECT_THAT(args.GetUriSans(), ::testing::ElementsAre("foo", "bar"));
+}
+
+TEST_F(EvaluateArgsTest, GetDnsSanSuccessMultipleProperties) {
+ util_.AddPropertyToAuthContext(GRPC_PEER_DNS_PROPERTY_NAME, "foo");
+ util_.AddPropertyToAuthContext(GRPC_PEER_DNS_PROPERTY_NAME, "bar");
+ EvaluateArgs args = util_.MakeEvaluateArgs();
+ EXPECT_THAT(args.GetDnsSans(), ::testing::ElementsAre("foo", "bar"));
+}
+
TEST_F(EvaluateArgsTest, GetCommonNameSuccessOneProperty) {
util_.AddPropertyToAuthContext(GRPC_X509_CN_PROPERTY_NAME, "server123");
EvaluateArgs args = util_.MakeEvaluateArgs();
@@ -152,10 +162,26 @@ TEST_F(EvaluateArgsTest, GetCommonNameFailDuplicateProperty) {
EXPECT_TRUE(args.GetCommonName().empty());
}
+TEST_F(EvaluateArgsTest, GetSubjectSuccessOneProperty) {
+ util_.AddPropertyToAuthContext(GRPC_X509_SUBJECT_PROPERTY_NAME,
+ "CN=abc,OU=Google");
+ EvaluateArgs args = util_.MakeEvaluateArgs();
+ EXPECT_EQ(args.GetSubject(), "CN=abc,OU=Google");
+}
+
+TEST_F(EvaluateArgsTest, GetSubjectFailDuplicateProperty) {
+ util_.AddPropertyToAuthContext(GRPC_X509_SUBJECT_PROPERTY_NAME,
+ "CN=abc,OU=Google");
+ util_.AddPropertyToAuthContext(GRPC_X509_SUBJECT_PROPERTY_NAME,
+ "CN=def,OU=Google");
+ EvaluateArgs args = util_.MakeEvaluateArgs();
+ EXPECT_TRUE(args.GetSubject().empty());
+}
+
} // namespace grpc_core
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
diff --git a/grpc/test/core/security/fetch_oauth2.cc b/grpc/test/core/security/fetch_oauth2.cc
index 99d7c76d..b9f08dcd 100644
--- a/grpc/test/core/security/fetch_oauth2.cc
+++ b/grpc/test/core/security/fetch_oauth2.cc
@@ -25,8 +25,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include <grpcpp/security/credentials.h>
-#include "grpcpp/security/credentials.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/credentials.h"
diff --git a/grpc/test/core/security/grpc_alts_credentials_options_test.cc b/grpc/test/core/security/grpc_alts_credentials_options_test.cc
index d33b5919..0e4c2fe2 100644
--- a/grpc/test/core/security/grpc_alts_credentials_options_test.cc
+++ b/grpc/test/core/security/grpc_alts_credentials_options_test.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -23,8 +25,6 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h"
-
#define ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_1 "abc@google.com"
#define ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_2 "def@google.com"
diff --git a/grpc/test/core/security/grpc_authorization_engine_test.cc b/grpc/test/core/security/grpc_authorization_engine_test.cc
index a2b5e114..01fb8e76 100644
--- a/grpc/test/core/security/grpc_authorization_engine_test.cc
+++ b/grpc/test/core/security/grpc_authorization_engine_test.cc
@@ -14,19 +14,20 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
+
#include <gmock/gmock.h>
#include <gtest/gtest.h>
-#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
-
namespace grpc_core {
TEST(GrpcAuthorizationEngineTest, AllowEngineWithMatchingPolicy) {
Rbac::Policy policy1(
- Rbac::Permission(Rbac::Permission::RuleType::kAny, /*not_rule=*/true),
- Rbac::Principal(Rbac::Principal::RuleType::kAny, /*not_rule=*/true));
- Rbac::Policy policy2((Rbac::Permission(Rbac::Permission::RuleType::kAny)),
- (Rbac::Principal(Rbac::Principal::RuleType::kAny)));
+ Rbac::Permission::MakeNotPermission(
+ Rbac::Permission::MakeAnyPermission()),
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakeAnyPrincipal()));
+ Rbac::Policy policy2(Rbac::Permission::MakeAnyPermission(),
+ Rbac::Principal::MakeAnyPrincipal());
std::map<std::string, Rbac::Policy> policies;
policies["policy1"] = std::move(policy1);
policies["policy2"] = std::move(policy2);
@@ -40,8 +41,9 @@ TEST(GrpcAuthorizationEngineTest, AllowEngineWithMatchingPolicy) {
TEST(GrpcAuthorizationEngineTest, AllowEngineWithNoMatchingPolicy) {
Rbac::Policy policy1(
- Rbac::Permission(Rbac::Permission::RuleType::kAny, /*not_rule=*/true),
- Rbac::Principal(Rbac::Principal::RuleType::kAny, /*not_rule=*/true));
+ Rbac::Permission::MakeNotPermission(
+ Rbac::Permission::MakeAnyPermission()),
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakeAnyPrincipal()));
std::map<std::string, Rbac::Policy> policies;
policies["policy1"] = std::move(policy1);
Rbac rbac(Rbac::Action::kAllow, std::move(policies));
@@ -62,10 +64,11 @@ TEST(GrpcAuthorizationEngineTest, AllowEngineWithEmptyPolicies) {
TEST(GrpcAuthorizationEngineTest, DenyEngineWithMatchingPolicy) {
Rbac::Policy policy1(
- Rbac::Permission(Rbac::Permission::RuleType::kAny, /*not_rule=*/true),
- Rbac::Principal(Rbac::Principal::RuleType::kAny, /*not_rule=*/true));
- Rbac::Policy policy2((Rbac::Permission(Rbac::Permission::RuleType::kAny)),
- (Rbac::Principal(Rbac::Principal::RuleType::kAny)));
+ Rbac::Permission::MakeNotPermission(
+ Rbac::Permission::MakeAnyPermission()),
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakeAnyPrincipal()));
+ Rbac::Policy policy2(Rbac::Permission::MakeAnyPermission(),
+ Rbac::Principal::MakeAnyPrincipal());
std::map<std::string, Rbac::Policy> policies;
policies["policy1"] = std::move(policy1);
policies["policy2"] = std::move(policy2);
@@ -79,8 +82,9 @@ TEST(GrpcAuthorizationEngineTest, DenyEngineWithMatchingPolicy) {
TEST(GrpcAuthorizationEngineTest, DenyEngineWithNoMatchingPolicy) {
Rbac::Policy policy1(
- Rbac::Permission(Rbac::Permission::RuleType::kAny, /*not_rule=*/true),
- Rbac::Principal(Rbac::Principal::RuleType::kAny, /*not_rule=*/true));
+ Rbac::Permission::MakeNotPermission(
+ Rbac::Permission::MakeAnyPermission()),
+ Rbac::Principal::MakeNotPrincipal(Rbac::Principal::MakeAnyPrincipal()));
std::map<std::string, Rbac::Policy> policies;
policies["policy1"] = std::move(policy1);
Rbac rbac(Rbac::Action::kDeny, std::move(policies));
diff --git a/grpc/test/core/security/grpc_authorization_policy_provider_test.cc b/grpc/test/core/security/grpc_authorization_policy_provider_test.cc
new file mode 100644
index 00000000..0b672e48
--- /dev/null
+++ b/grpc/test/core/security/grpc_authorization_policy_provider_test.cc
@@ -0,0 +1,219 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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/grpc_authorization_policy_provider.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
+#include "test/core/util/test_config.h"
+#include "test/core/util/tls_utils.h"
+
+#define VALID_POLICY_PATH_1 \
+ "test/core/security/authorization/test_policies/valid_policy_1.json"
+#define VALID_POLICY_PATH_2 \
+ "test/core/security/authorization/test_policies/valid_policy_2.json"
+#define INVALID_POLICY_PATH \
+ "test/core/security/authorization/test_policies/invalid_policy.json"
+
+namespace grpc_core {
+
+TEST(AuthorizationPolicyProviderTest, StaticDataInitializationSuccessful) {
+ auto provider = StaticDataAuthorizationPolicyProvider::Create(
+ testing::GetFileContents(VALID_POLICY_PATH_1));
+ ASSERT_TRUE(provider.ok());
+ auto engines = (*provider)->engines();
+ auto* allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ auto* deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+}
+
+TEST(AuthorizationPolicyProviderTest,
+ StaticDataInitializationFailedInvalidPolicy) {
+ auto provider = StaticDataAuthorizationPolicyProvider::Create(
+ testing::GetFileContents(INVALID_POLICY_PATH));
+ EXPECT_EQ(provider.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(provider.status().message(), "\"name\" field is not present.");
+}
+
+TEST(AuthorizationPolicyProviderTest,
+ FileWatcherInitializationSuccessValidPolicy) {
+ auto tmp_authz_policy = absl::make_unique<testing::TmpFile>(
+ testing::GetFileContents(VALID_POLICY_PATH_1));
+ auto provider = FileWatcherAuthorizationPolicyProvider::Create(
+ tmp_authz_policy->name(), /*refresh_interval_sec=*/1);
+ ASSERT_TRUE(provider.ok());
+ auto engines = (*provider)->engines();
+ auto* allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ auto* deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+}
+
+TEST(AuthorizationPolicyProviderTest,
+ FileWatcherInitializationFailedInvalidPolicy) {
+ auto tmp_authz_policy = absl::make_unique<testing::TmpFile>(
+ testing::GetFileContents(INVALID_POLICY_PATH));
+ auto provider = FileWatcherAuthorizationPolicyProvider::Create(
+ tmp_authz_policy->name(), /*refresh_interval_sec=*/1);
+ EXPECT_EQ(provider.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(provider.status().message(), "\"name\" field is not present.");
+}
+
+TEST(AuthorizationPolicyProviderTest, FileWatcherSuccessValidPolicyRefresh) {
+ auto tmp_authz_policy = absl::make_unique<testing::TmpFile>(
+ testing::GetFileContents(VALID_POLICY_PATH_1));
+ auto provider = FileWatcherAuthorizationPolicyProvider::Create(
+ tmp_authz_policy->name(), /*refresh_interval_sec=*/1);
+ ASSERT_TRUE(provider.ok());
+ auto engines = (*provider)->engines();
+ auto* allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ auto* deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+ // Rewrite the file with a different valid authorization policy.
+ tmp_authz_policy->RewriteFile(testing::GetFileContents(VALID_POLICY_PATH_2));
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ engines = (*provider)->engines();
+ allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 2);
+ deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 0);
+}
+
+TEST(AuthorizationPolicyProviderTest,
+ FileWatcherInvalidPolicyRefreshSkipReload) {
+ auto tmp_authz_policy = absl::make_unique<testing::TmpFile>(
+ testing::GetFileContents(VALID_POLICY_PATH_1));
+ auto provider = FileWatcherAuthorizationPolicyProvider::Create(
+ tmp_authz_policy->name(), /*refresh_interval_sec=*/1);
+ ASSERT_TRUE(provider.ok());
+ auto engines = (*provider)->engines();
+ auto* allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ auto* deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+ // Skips the following policy update, and continues to use the valid policy.
+ tmp_authz_policy->RewriteFile(testing::GetFileContents(INVALID_POLICY_PATH));
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ engines = (*provider)->engines();
+ allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+}
+
+TEST(AuthorizationPolicyProviderTest, FileWatcherRecoversFromFailure) {
+ auto tmp_authz_policy = absl::make_unique<testing::TmpFile>(
+ testing::GetFileContents(VALID_POLICY_PATH_1));
+ auto provider = FileWatcherAuthorizationPolicyProvider::Create(
+ tmp_authz_policy->name(), /*refresh_interval_sec=*/1);
+ ASSERT_TRUE(provider.ok());
+ auto engines = (*provider)->engines();
+ auto* allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ auto* deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+ // Skips the following policy update, and continues to use the valid policy.
+ tmp_authz_policy->RewriteFile(testing::GetFileContents(INVALID_POLICY_PATH));
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ engines = (*provider)->engines();
+ allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 1);
+ deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 1);
+ // Rewrite the file with a valid authorization policy.
+ tmp_authz_policy->RewriteFile(testing::GetFileContents(VALID_POLICY_PATH_2));
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ engines = (*provider)->engines();
+ allow_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.allow_engine.get());
+ ASSERT_NE(allow_engine, nullptr);
+ EXPECT_EQ(allow_engine->action(), Rbac::Action::kAllow);
+ EXPECT_EQ(allow_engine->num_policies(), 2);
+ deny_engine =
+ dynamic_cast<GrpcAuthorizationEngine*>(engines.deny_engine.get());
+ ASSERT_NE(deny_engine, nullptr);
+ EXPECT_EQ(deny_engine->action(), Rbac::Action::kDeny);
+ EXPECT_EQ(deny_engine->num_policies(), 0);
+}
+
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ grpc::testing::TestEnvironment env(&argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ grpc_init();
+ int ret = RUN_ALL_TESTS();
+ grpc_shutdown();
+ return ret;
+}
diff --git a/grpc/test/core/security/grpc_tls_certificate_distributor_test.cc b/grpc/test/core/security/grpc_tls_certificate_distributor_test.cc
index 92123a18..343de7f4 100644
--- a/grpc/test/core/security/grpc_tls_certificate_distributor_test.cc
+++ b/grpc/test/core/security/grpc_tls_certificate_distributor_test.cc
@@ -16,17 +16,18 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
-#include <gmock/gmock.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <gtest/gtest.h>
-
#include <deque>
#include <list>
#include <string>
#include <thread>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
#include "src/core/lib/slice/slice_internal.h"
#include "test/core/util/test_config.h"
#include "test/core/util/tls_utils.h"
@@ -136,18 +137,13 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test {
std::string root_error_str;
std::string identity_error_str;
if (root_cert_error != GRPC_ERROR_NONE) {
- grpc_slice root_error_slice;
GPR_ASSERT(grpc_error_get_str(
- root_cert_error, GRPC_ERROR_STR_DESCRIPTION, &root_error_slice));
- root_error_str = std::string(StringViewFromSlice(root_error_slice));
+ root_cert_error, GRPC_ERROR_STR_DESCRIPTION, &root_error_str));
}
if (identity_cert_error != GRPC_ERROR_NONE) {
- grpc_slice identity_error_slice;
GPR_ASSERT(grpc_error_get_str(identity_cert_error,
GRPC_ERROR_STR_DESCRIPTION,
- &identity_error_slice));
- identity_error_str =
- std::string(StringViewFromSlice(identity_error_slice));
+ &identity_error_str));
}
state_->error_queue.emplace_back(std::move(root_error_str),
std::move(identity_error_str));
@@ -945,7 +941,7 @@ TEST_F(GrpcTlsCertificateDistributorTest, SetErrorForCertInCallback) {
} // namespace grpc_core
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
diff --git a/grpc/test/core/security/grpc_tls_certificate_provider_test.cc b/grpc/test/core/security/grpc_tls_certificate_provider_test.cc
index 9d675569..0a76ee71 100644
--- a/grpc/test/core/security/grpc_tls_certificate_provider_test.cc
+++ b/grpc/test/core/security/grpc_tls_certificate_provider_test.cc
@@ -16,15 +16,15 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include <deque>
+#include <list>
+
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <gtest/gtest.h>
-
-#include <deque>
-#include <list>
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/iomgr/load_file.h"
@@ -139,18 +139,13 @@ class GrpcTlsCertificateProviderTest : public ::testing::Test {
std::string root_error_str;
std::string identity_error_str;
if (root_cert_error != GRPC_ERROR_NONE) {
- grpc_slice root_error_slice;
GPR_ASSERT(grpc_error_get_str(
- root_cert_error, GRPC_ERROR_STR_DESCRIPTION, &root_error_slice));
- root_error_str = std::string(StringViewFromSlice(root_error_slice));
+ root_cert_error, GRPC_ERROR_STR_DESCRIPTION, &root_error_str));
}
if (identity_cert_error != GRPC_ERROR_NONE) {
- grpc_slice identity_error_slice;
GPR_ASSERT(grpc_error_get_str(identity_cert_error,
GRPC_ERROR_STR_DESCRIPTION,
- &identity_error_slice));
- identity_error_str =
- std::string(StringViewFromSlice(identity_error_slice));
+ &identity_error_str));
}
state_->error_queue.emplace_back(std::move(root_error_str),
std::move(identity_error_str));
@@ -495,12 +490,59 @@ TEST_F(GrpcTlsCertificateProviderTest,
CancelWatch(watcher_state_1);
}
-} // namespace testing
+TEST_F(GrpcTlsCertificateProviderTest, FailedKeyCertMatchOnEmptyPrivateKey) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch(/*private_key=*/"", cert_chain_);
+ EXPECT_FALSE(status.ok());
+ EXPECT_EQ(status.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(status.status().message(), "Private key string is empty.");
+}
+
+TEST_F(GrpcTlsCertificateProviderTest, FailedKeyCertMatchOnEmptyCertificate) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch(private_key_2_, /*cert_chain=*/"");
+ EXPECT_FALSE(status.ok());
+ EXPECT_EQ(status.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(status.status().message(), "Certificate string is empty.");
+}
+
+TEST_F(GrpcTlsCertificateProviderTest, FailedKeyCertMatchOnInvalidCertFormat) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch(private_key_2_, "invalid_certificate");
+ EXPECT_FALSE(status.ok());
+ EXPECT_EQ(status.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(status.status().message(),
+ "Conversion from PEM string to X509 failed.");
+}
+
+TEST_F(GrpcTlsCertificateProviderTest,
+ FailedKeyCertMatchOnInvalidPrivateKeyFormat) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch("invalid_private_key", cert_chain_2_);
+ EXPECT_EQ(status.status().code(), absl::StatusCode::kInvalidArgument);
+ EXPECT_EQ(status.status().message(),
+ "Conversion from PEM string to EVP_PKEY failed.");
+}
+TEST_F(GrpcTlsCertificateProviderTest, SuccessfulKeyCertMatch) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch(private_key_2_, cert_chain_2_);
+ EXPECT_TRUE(status.ok());
+ EXPECT_TRUE(*status);
+}
+
+TEST_F(GrpcTlsCertificateProviderTest, FailedKeyCertMatchOnInvalidPair) {
+ absl::StatusOr<bool> status =
+ PrivateKeyAndCertificateMatch(private_key_2_, cert_chain_);
+ EXPECT_TRUE(status.ok());
+ EXPECT_FALSE(*status);
+}
+
+} // namespace testing
} // namespace grpc_core
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
diff --git a/grpc/test/core/security/grpc_tls_certificate_verifier_test.cc b/grpc/test/core/security/grpc_tls_certificate_verifier_test.cc
new file mode 100644
index 00000000..5432c187
--- /dev/null
+++ b/grpc/test/core/security/grpc_tls_certificate_verifier_test.cc
@@ -0,0 +1,305 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
+
+#include <deque>
+#include <list>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/tmpfile.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "test/core/util/test_config.h"
+#include "test/core/util/tls_utils.h"
+
+namespace grpc_core {
+
+namespace testing {
+
+// Unit tests for grpc_tls_certificate_verifier and all its successors.
+// In these tests, |request_| is not outliving the test itself, so it's fine to
+// point fields in |request_| directly to the address of local variables. In
+// actual implementation, these fields are dynamically allocated.
+class GrpcTlsCertificateVerifierTest : public ::testing::Test {
+ protected:
+ void SetUp() override { memset(&request_, 0, sizeof(request_)); }
+
+ void TearDown() override {}
+
+ grpc_tls_custom_verification_check_request request_;
+ HostNameCertificateVerifier hostname_certificate_verifier_;
+};
+
+TEST_F(GrpcTlsCertificateVerifierTest, SyncExternalVerifierSucceeds) {
+ auto* sync_verifier = new SyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier->base());
+ absl::Status sync_status;
+ EXPECT_TRUE(core_external_verifier.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, SyncExternalVerifierFails) {
+ auto* sync_verifier = new SyncExternalVerifier(false);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier->base());
+ absl::Status sync_status;
+ EXPECT_TRUE(core_external_verifier.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: SyncExternalVerifier failed");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, AsyncExternalVerifierSucceeds) {
+ absl::Status sync_status;
+ // This is to make sure the callback has already been completed before we
+ // destroy ExternalCertificateVerifier object.
+ gpr_event callback_completed_event;
+ gpr_event_init(&callback_completed_event);
+ auto* async_verifier = new AsyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(async_verifier->base());
+ EXPECT_FALSE(core_external_verifier.Verify(
+ &request_,
+ [&callback_completed_event](absl::Status async_status) {
+ EXPECT_TRUE(async_status.ok())
+ << async_status.code() << " " << async_status.message();
+ gpr_event_set(&callback_completed_event, reinterpret_cast<void*>(1));
+ },
+ &sync_status));
+ void* callback_completed =
+ gpr_event_wait(&callback_completed_event,
+ gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_seconds(10, GPR_TIMESPAN)));
+ EXPECT_NE(callback_completed, nullptr);
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, AsyncExternalVerifierFails) {
+ absl::Status sync_status;
+ // This is to make sure the callback has already been completed before we
+ // destroy ExternalCertificateVerifier object.
+ gpr_event callback_completed_event;
+ gpr_event_init(&callback_completed_event);
+ auto* async_verifier = new AsyncExternalVerifier(false);
+ ExternalCertificateVerifier core_external_verifier(async_verifier->base());
+ EXPECT_FALSE(core_external_verifier.Verify(
+ &request_,
+ [&callback_completed_event](absl::Status async_status) {
+ gpr_log(GPR_INFO, "Callback is invoked.");
+ EXPECT_EQ(async_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(async_status.ToString(),
+ "UNAUTHENTICATED: AsyncExternalVerifier failed");
+ gpr_event_set(&callback_completed_event, reinterpret_cast<void*>(1));
+ },
+ &sync_status));
+ void* callback_completed =
+ gpr_event_wait(&callback_completed_event,
+ gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_time_from_seconds(10, GPR_TIMESPAN)));
+ EXPECT_NE(callback_completed, nullptr);
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierNullTargetName) {
+ absl::Status sync_status;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Target name is not specified.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierInvalidTargetName) {
+ absl::Status sync_status;
+ request_.target_name = "[foo.com@443";
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Failed to split hostname and port.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierDNSExactCheckSucceeds) {
+ absl::Status sync_status;
+ request_.target_name = "foo.com:443";
+ char* dns_names[] = {const_cast<char*>("foo.com")};
+ request_.peer_info.san_names.dns_names = dns_names;
+ request_.peer_info.san_names.dns_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest,
+ HostnameVerifierDNSWildcardCheckSucceeds) {
+ absl::Status sync_status;
+ request_.target_name = "foo.bar.com:443";
+ char* dns_names[] = {const_cast<char*>("*.bar.com")};
+ request_.peer_info.san_names.dns_names = dns_names;
+ request_.peer_info.san_names.dns_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest,
+ HostnameVerifierDNSWildcardCaseInsensitiveCheckSucceeds) {
+ absl::Status sync_status;
+ request_.target_name = "fOo.bar.cOm:443";
+ char* dns_names[] = {const_cast<char*>("*.BaR.Com")};
+ request_.peer_info.san_names.dns_names = dns_names;
+ request_.peer_info.san_names.dns_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest,
+ HostnameVerifierDNSTopWildcardCheckFails) {
+ absl::Status sync_status;
+ request_.target_name = "foo.com:443";
+ char* dns_names[] = {const_cast<char*>("*.")};
+ request_.peer_info.san_names.dns_names = dns_names;
+ request_.peer_info.san_names.dns_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Hostname Verification Check failed.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierDNSExactCheckFails) {
+ absl::Status sync_status;
+ request_.target_name = "foo.com:443";
+ char* dns_names[] = {const_cast<char*>("bar.com")};
+ request_.peer_info.san_names.dns_names = dns_names;
+ request_.peer_info.san_names.dns_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Hostname Verification Check failed.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierIpCheckSucceeds) {
+ absl::Status sync_status;
+ request_.target_name = "192.168.0.1:443";
+ char* ip_names[] = {const_cast<char*>("192.168.0.1")};
+ request_.peer_info.san_names.ip_names = ip_names;
+ request_.peer_info.san_names.ip_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierIpCheckFails) {
+ absl::Status sync_status;
+ request_.target_name = "192.168.0.1:443";
+ char* ip_names[] = {const_cast<char*>("192.168.1.1")};
+ request_.peer_info.san_names.ip_names = ip_names;
+ request_.peer_info.san_names.ip_names_size = 1;
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Hostname Verification Check failed.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest,
+ HostnameVerifierCommonNameCheckSucceeds) {
+ absl::Status sync_status;
+ request_.target_name = "foo.com:443";
+ request_.peer_info.common_name = "foo.com";
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_TRUE(sync_status.ok())
+ << sync_status.code() << " " << sync_status.message();
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostnameVerifierCommonNameCheckFails) {
+ absl::Status sync_status;
+ request_.target_name = "foo.com:443";
+ request_.peer_info.common_name = "bar.com";
+ EXPECT_TRUE(hostname_certificate_verifier_.Verify(
+ &request_, [](absl::Status) {}, &sync_status));
+ EXPECT_EQ(sync_status.code(), absl::StatusCode::kUnauthenticated);
+ EXPECT_EQ(sync_status.ToString(),
+ "UNAUTHENTICATED: Hostname Verification Check failed.");
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, ComparingDifferentObjectTypesFails) {
+ grpc_tls_certificate_verifier_external verifier = {nullptr, nullptr, nullptr,
+ nullptr};
+ ExternalCertificateVerifier external_verifier(&verifier);
+ HostNameCertificateVerifier hostname_certificate_verifier;
+ EXPECT_NE(external_verifier.Compare(&hostname_certificate_verifier), 0);
+ EXPECT_NE(hostname_certificate_verifier.Compare(&external_verifier), 0);
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, HostNameCertificateVerifier) {
+ HostNameCertificateVerifier hostname_certificate_verifier_1;
+ HostNameCertificateVerifier hostname_certificate_verifier_2;
+ EXPECT_EQ(
+ hostname_certificate_verifier_1.Compare(&hostname_certificate_verifier_2),
+ 0);
+ EXPECT_EQ(
+ hostname_certificate_verifier_2.Compare(&hostname_certificate_verifier_1),
+ 0);
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, ExternalCertificateVerifierSuccess) {
+ grpc_tls_certificate_verifier_external verifier = {nullptr, nullptr, nullptr,
+ nullptr};
+ ExternalCertificateVerifier external_verifier_1(&verifier);
+ ExternalCertificateVerifier external_verifier_2(&verifier);
+ EXPECT_EQ(external_verifier_1.Compare(&external_verifier_2), 0);
+ EXPECT_EQ(external_verifier_2.Compare(&external_verifier_1), 0);
+}
+
+TEST_F(GrpcTlsCertificateVerifierTest, ExternalCertificateVerifierFailure) {
+ grpc_tls_certificate_verifier_external verifier_1 = {nullptr, nullptr,
+ nullptr, nullptr};
+ ExternalCertificateVerifier external_verifier_1(&verifier_1);
+ grpc_tls_certificate_verifier_external verifier_2 = {nullptr, nullptr,
+ nullptr, nullptr};
+ ExternalCertificateVerifier external_verifier_2(&verifier_2);
+ EXPECT_NE(external_verifier_1.Compare(&external_verifier_2), 0);
+ EXPECT_NE(external_verifier_2.Compare(&external_verifier_1), 0);
+}
+
+} // namespace testing
+
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ grpc::testing::TestEnvironment env(&argc, argv);
+ ::testing::InitGoogleTest(&argc, argv);
+ grpc_init();
+ int ret = RUN_ALL_TESTS();
+ grpc_shutdown();
+ return ret;
+}
diff --git a/grpc/test/core/security/grpc_tls_credentials_options_comparator_test.cc b/grpc/test/core/security/grpc_tls_credentials_options_comparator_test.cc
new file mode 100644
index 00000000..3ee2a433
--- /dev/null
+++ b/grpc/test/core/security/grpc_tls_credentials_options_comparator_test.cc
@@ -0,0 +1,175 @@
+//
+//
+// Copyright 2022 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+// Generated by tools/codegen/core/gen_grpc_tls_credentials_options.py
+
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "src/core/lib/security/credentials/xds/xds_credentials.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
+#include "test/core/util/test_config.h"
+
+namespace grpc_core {
+namespace {
+
+TEST(TlsCredentialsOptionsComparatorTest, DifferentCertRequestType) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options_2->set_cert_request_type(GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentVerifyServerCert) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_verify_server_cert(false);
+ options_2->set_verify_server_cert(true);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentMinTlsVersion) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_min_tls_version(grpc_tls_version::TLS1_2);
+ options_2->set_min_tls_version(grpc_tls_version::TLS1_3);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentMaxTlsVersion) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_max_tls_version(grpc_tls_version::TLS1_2);
+ options_2->set_max_tls_version(grpc_tls_version::TLS1_3);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentCertificateVerifier) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_certificate_verifier(MakeRefCounted<HostNameCertificateVerifier>());
+ options_2->set_certificate_verifier(MakeRefCounted<XdsCertificateVerifier>(nullptr, ""));
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentCheckCallHost) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_check_call_host(false);
+ options_2->set_check_call_host(true);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentCertificateProvider) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_certificate_provider(MakeRefCounted<StaticDataCertificateProvider>("root_cert_1", PemKeyCertPairList()));
+ options_2->set_certificate_provider(MakeRefCounted<StaticDataCertificateProvider>("root_cert_2", PemKeyCertPairList()));
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentWatchRootCert) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_watch_root_cert(false);
+ options_2->set_watch_root_cert(true);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentRootCertName) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_root_cert_name("root_cert_name_1");
+ options_2->set_root_cert_name("root_cert_name_2");
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentWatchIdentityPair) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_watch_identity_pair(false);
+ options_2->set_watch_identity_pair(true);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentIdentityCertName) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_identity_cert_name("identity_cert_name_1");
+ options_2->set_identity_cert_name("identity_cert_name_2");
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentTlsSessionKeyLogFilePath) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_tls_session_key_log_file_path("file_path_1");
+ options_2->set_tls_session_key_log_file_path("file_path_2");
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+TEST(TlsCredentialsOptionsComparatorTest, DifferentCrlDirectory) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_crl_directory("crl_directory_1");
+ options_2->set_crl_directory("crl_directory_2");
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}
+
+} // namespace
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
+ grpc_init();
+ auto result = RUN_ALL_TESTS();
+ grpc_shutdown();
+ return result;
+}
diff --git a/grpc/test/core/security/grpc_tls_credentials_options_test.cc b/grpc/test/core/security/grpc_tls_credentials_options_test.cc
index c5736ca1..eb8bb710 100644
--- a/grpc/test/core/security/grpc_tls_credentials_options_test.cc
+++ b/grpc/test/core/security/grpc_tls_credentials_options_test.cc
@@ -19,10 +19,11 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <gtest/gtest.h>
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/iomgr/load_file.h"
@@ -60,18 +61,15 @@ class GrpcTlsCredentialsOptionsTest : public ::testing::Test {
std::string root_cert_2_;
std::string private_key_2_;
std::string cert_chain_2_;
+ HostNameCertificateVerifier hostname_certificate_verifier_;
};
-TEST_F(GrpcTlsCredentialsOptionsTest, ErrorDetails) {
- grpc_tls_error_details error_details;
- EXPECT_STREQ(error_details.error_details().c_str(), "");
- error_details.set_error_details("test error details");
- EXPECT_STREQ(error_details.error_details().c_str(), "test error details");
-}
+//
+// Tests for Default Root Certs.
+//
TEST_F(GrpcTlsCredentialsOptionsTest, ClientOptionsOnDefaultRootCerts) {
auto options = MakeRefCounted<grpc_tls_credentials_options>();
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -84,7 +82,10 @@ TEST_F(GrpcTlsCredentialsOptionsTest, ClientOptionsOnDefaultRootCerts) {
EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
}
+//
// Tests for StaticDataCertificateProvider.
+//
+
TEST_F(GrpcTlsCredentialsOptionsTest,
ClientOptionsWithStaticDataProviderOnBothCerts) {
auto options = MakeRefCounted<grpc_tls_credentials_options>();
@@ -93,7 +94,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -115,7 +115,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
root_cert_, PemKeyCertPairList());
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -137,7 +136,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
"", MakeCertKeyPairs(private_key_.c_str(), cert_chain_.c_str()));
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -157,7 +155,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
"", MakeCertKeyPairs(private_key_.c_str(), cert_chain_.c_str()));
options->set_certificate_provider(std::move(provider));
options->set_watch_identity_pair(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -227,7 +224,10 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
EXPECT_EQ(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
}
+//
// Tests for FileWatcherCertificateProvider.
+//
+
TEST_F(GrpcTlsCredentialsOptionsTest,
ClientOptionsWithCertWatcherProviderOnBothCerts) {
auto options = MakeRefCounted<grpc_tls_credentials_options>();
@@ -236,7 +236,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -258,7 +257,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
MakeRefCounted<FileWatcherCertificateProvider>("", "", CA_CERT_PATH, 1);
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -280,7 +278,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
SERVER_KEY_PATH, SERVER_CERT_PATH, "", 1);
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -300,7 +297,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
MakeRefCounted<FileWatcherCertificateProvider>("", "", INVALID_PATH, 1);
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -387,8 +383,11 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
EXPECT_EQ(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
}
-// The following tests write credential data to temporary files to test the
+//
+// Tests writing credential data to temporary files to test the
// transition behavior of the provider.
+//
+
TEST_F(GrpcTlsCredentialsOptionsTest,
ClientOptionsWithCertWatcherProviderOnCertificateRefreshed) {
// Create temporary files and copy cert data into them.
@@ -403,7 +402,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -452,7 +450,6 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
options->set_certificate_provider(std::move(provider));
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
- options->set_server_verification_option(GRPC_TLS_SERVER_VERIFICATION);
auto credentials = MakeRefCounted<TlsCredentials>(options);
ASSERT_NE(credentials, nullptr);
grpc_channel_args* new_args = nullptr;
@@ -489,12 +486,97 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
MakeCertKeyPairs(private_key_.c_str(), cert_chain_.c_str()));
}
+//
+// Tests for ExternalCertificateVerifier.
+// It will only test the creation of security connector, so the actual verify
+// logic is not invoked.
+//
+
+TEST_F(GrpcTlsCredentialsOptionsTest, ClientOptionsWithExternalVerifier) {
+ auto* sync_verifier_ = new SyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier_->base());
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ options->set_check_call_host(false);
+ auto credentials = MakeRefCounted<TlsCredentials>(options);
+ ASSERT_NE(credentials, nullptr);
+ grpc_channel_args* new_args = nullptr;
+ auto connector = credentials->create_security_connector(
+ nullptr, "random targets", nullptr, &new_args);
+ grpc_channel_args_destroy(new_args);
+ ASSERT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector, nullptr);
+}
+
+TEST_F(GrpcTlsCredentialsOptionsTest, ServerOptionsWithExternalVerifier) {
+ auto* sync_verifier_ = new SyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier_->base());
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ // On server side we have to set the provider providing identity certs.
+ auto provider = MakeRefCounted<StaticDataCertificateProvider>(
+ root_cert_, PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ ASSERT_NE(credentials, nullptr);
+ auto connector = credentials->create_security_connector(nullptr);
+ ASSERT_NE(connector, nullptr);
+ TlsServerSecurityConnector* tls_connector =
+ static_cast<TlsServerSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector, nullptr);
+}
+
+//
+// Tests for HostnameCertificateVerifier.
+//
+
+TEST_F(GrpcTlsCredentialsOptionsTest,
+ ClientOptionsWithHostnameCertificateVerifier) {
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(hostname_certificate_verifier_.Ref());
+ auto credentials = MakeRefCounted<TlsCredentials>(options);
+ ASSERT_NE(credentials, nullptr);
+ grpc_channel_args* new_args = nullptr;
+ auto connector = credentials->create_security_connector(
+ nullptr, "random targets", nullptr, &new_args);
+ grpc_channel_args_destroy(new_args);
+ ASSERT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+}
+
+TEST_F(GrpcTlsCredentialsOptionsTest,
+ ServerOptionsWithHostnameCertificateVerifier) {
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(hostname_certificate_verifier_.Ref());
+ // On server side we have to set the provider providing identity certs.
+ auto provider = MakeRefCounted<StaticDataCertificateProvider>(
+ root_cert_, PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ ASSERT_NE(credentials, nullptr);
+ auto connector = credentials->create_security_connector(nullptr);
+ ASSERT_NE(connector, nullptr);
+ TlsServerSecurityConnector* tls_connector =
+ static_cast<TlsServerSecurityConnector*>(connector.get());
+ EXPECT_EQ(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
+}
+
} // namespace testing
} // namespace grpc_core
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
diff --git a/grpc/test/core/security/insecure_security_connector_test.cc b/grpc/test/core/security/insecure_security_connector_test.cc
index dfdb28b9..cb961af6 100644
--- a/grpc/test/core/security/insecure_security_connector_test.cc
+++ b/grpc/test/core/security/insecure_security_connector_test.cc
@@ -16,12 +16,13 @@
//
//
+#include "src/core/lib/security/security_connector/insecure/insecure_security_connector.h"
+
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <grpc/grpc_security.h>
-#include "src/core/lib/security/security_connector/insecure/insecure_security_connector.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
#include "src/core/tsi/transport_security.h"
#include "test/core/util/test_config.h"
@@ -46,8 +47,7 @@ TEST(InsecureSecurityConnector, MakeAuthContextTest) {
auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME);
prop = grpc_auth_property_iterator_next(&it);
ASSERT_NE(prop, nullptr);
- EXPECT_EQ(grpc_tsi_security_level_string_to_enum(prop->value),
- GRPC_SECURITY_NONE);
+ EXPECT_STREQ(prop->value, tsi_security_level_to_string(TSI_SECURITY_NONE));
}
} // namespace
@@ -56,7 +56,7 @@ TEST(InsecureSecurityConnector, MakeAuthContextTest) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
const auto result = RUN_ALL_TESTS();
return result;
}
diff --git a/grpc/test/core/security/json_token_test.cc b/grpc/test/core/security/json_token_test.cc
index 1ded259b..373b25b9 100644
--- a/grpc/test/core/security/json_token_test.cc
+++ b/grpc/test/core/security/json_token_test.cc
@@ -18,9 +18,10 @@
#include "src/core/lib/security/credentials/jwt/json_token.h"
-#include <openssl/evp.h>
#include <string.h>
+#include <openssl/evp.h>
+
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
@@ -432,7 +433,7 @@ static void test_parse_refresh_token_failure_no_refresh_token(void) {
}
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
test_parse_json_key_success();
test_parse_json_key_failure_bad_json();
diff --git a/grpc/test/core/security/jwt_verifier_test.cc b/grpc/test/core/security/jwt_verifier_test.cc
index 21ed63fc..7bd7cabd 100644
--- a/grpc/test/core/security/jwt_verifier_test.cc
+++ b/grpc/test/core/security/jwt_verifier_test.cc
@@ -21,7 +21,6 @@
#include <string.h>
#include <grpc/grpc.h>
-
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -331,8 +330,8 @@ static char* good_google_email_keys(void) {
return result;
}
-static grpc_httpcli_response http_response(int status, char* body) {
- grpc_httpcli_response response;
+static grpc_http_response http_response(int status, char* body) {
+ grpc_http_response response;
response = {};
response.status = status;
response.body = body;
@@ -341,20 +340,21 @@ static grpc_httpcli_response http_response(int status, char* body) {
}
static int httpcli_post_should_not_be_called(
- const grpc_httpcli_request* /*request*/, const char* /*body_bytes*/,
- size_t /*body_size*/, grpc_millis /*deadline*/, grpc_closure* /*on_done*/,
- grpc_httpcli_response* /*response*/) {
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* /*path*/, const char* /*body_bytes*/, size_t /*body_size*/,
+ grpc_core::Timestamp /*deadline*/, grpc_closure* /*on_done*/,
+ grpc_http_response* /*response*/) {
GPR_ASSERT("HTTP POST should not be called" == nullptr);
return 1;
}
static int httpcli_get_google_keys_for_email(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
+ const grpc_http_request* /*request*/, const char* host, const char* path,
+ grpc_core::Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(200, good_google_email_keys());
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
- GPR_ASSERT(strcmp(request->http.path,
+ GPR_ASSERT(strcmp(host, "www.googleapis.com") == 0);
+ GPR_ASSERT(strcmp(path,
"/robot/v1/metadata/x509/"
"777-abaslkan11hlb6nmim3bpspl31ud@developer."
"gserviceaccount.com") == 0);
@@ -380,8 +380,8 @@ static void test_jwt_verifier_google_email_issuer_success(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_google_keys_for_email,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_google_keys_for_email,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -392,16 +392,16 @@ static void test_jwt_verifier_google_email_issuer_success(void) {
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
gpr_free(jwt);
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
static int httpcli_get_custom_keys_for_email(
- const grpc_httpcli_request* request, grpc_millis /*deadline*/,
- grpc_closure* on_done, grpc_httpcli_response* response) {
+ const grpc_http_request* /*request*/, const char* host, const char* path,
+ grpc_core::Timestamp /*deadline*/, grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(200, gpr_strdup(good_jwk_set));
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
+ GPR_ASSERT(strcmp(host, "keys.bar.com") == 0);
+ GPR_ASSERT(strcmp(path, "/jwk/foo@bar.com") == 0);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@@ -414,8 +414,8 @@ static void test_jwt_verifier_custom_email_issuer_success(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_custom_keys_for_email,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_custom_keys_for_email,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -426,30 +426,31 @@ static void test_jwt_verifier_custom_email_issuer_success(void) {
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
gpr_free(jwt);
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
-static int httpcli_get_jwk_set(const grpc_httpcli_request* request,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
+static int httpcli_get_jwk_set(const grpc_http_request* /*request*/,
+ const char* host, const char* path,
+ grpc_core::Timestamp /*deadline*/,
+ grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(200, gpr_strdup(good_jwk_set));
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
- GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
+ GPR_ASSERT(strcmp(host, "www.googleapis.com") == 0);
+ GPR_ASSERT(strcmp(path, "/oauth2/v3/certs") == 0);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
-static int httpcli_get_openid_config(const grpc_httpcli_request* request,
- grpc_millis /*deadline*/,
+static int httpcli_get_openid_config(const grpc_http_request* /*request*/,
+ const char* host, const char* path,
+ grpc_core::Timestamp /*deadline*/,
grpc_closure* on_done,
- grpc_httpcli_response* response) {
+ grpc_http_response* response) {
*response = http_response(200, gpr_strdup(good_openid_config));
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
- GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0);
- GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
- grpc_httpcli_set_override(httpcli_get_jwk_set,
- httpcli_post_should_not_be_called);
+ GPR_ASSERT(strcmp(host, "accounts.google.com") == 0);
+ GPR_ASSERT(strcmp(path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_jwk_set,
+ httpcli_post_should_not_be_called);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@@ -462,8 +463,8 @@ static void test_jwt_verifier_url_issuer_success(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_openid_config,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_openid_config,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -474,7 +475,7 @@ static void test_jwt_verifier_url_issuer_success(void) {
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
gpr_free(jwt);
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
static void on_verification_key_retrieval_error(void* user_data,
@@ -485,11 +486,12 @@ static void on_verification_key_retrieval_error(void* user_data,
GPR_ASSERT(user_data == (void*)expected_user_data);
}
-static int httpcli_get_bad_json(const grpc_httpcli_request* request,
- grpc_millis /*deadline*/, grpc_closure* on_done,
- grpc_httpcli_response* response) {
+static int httpcli_get_bad_json(const grpc_http_request* /* request */,
+ const char* /*host*/, const char* /*path*/,
+ grpc_core::Timestamp /*deadline*/,
+ grpc_closure* on_done,
+ grpc_http_response* response) {
*response = http_response(200, gpr_strdup("{\"bad\": \"stuff\"}"));
- GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, GRPC_ERROR_NONE);
return 1;
}
@@ -502,8 +504,8 @@ static void test_jwt_verifier_url_issuer_bad_config(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_bad_json,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_bad_json,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -514,7 +516,7 @@ static void test_jwt_verifier_url_issuer_bad_config(void) {
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
gpr_free(jwt);
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
static void test_jwt_verifier_bad_json_key(void) {
@@ -525,8 +527,8 @@ static void test_jwt_verifier_bad_json_key(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_bad_json,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_bad_json,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -537,7 +539,7 @@ static void test_jwt_verifier_bad_json_key(void) {
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
gpr_free(jwt);
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
static void corrupt_jwt_sig(char* jwt) {
@@ -576,8 +578,8 @@ static void test_jwt_verifier_bad_signature(void) {
grpc_auth_json_key key = grpc_auth_json_key_create_from_string(key_str);
gpr_free(key_str);
GPR_ASSERT(grpc_auth_json_key_is_valid(&key));
- grpc_httpcli_set_override(httpcli_get_openid_config,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_openid_config,
+ httpcli_post_should_not_be_called);
jwt = grpc_jwt_encode_and_sign(&key, expected_audience, expected_lifetime,
nullptr);
grpc_auth_json_key_destruct(&key);
@@ -589,12 +591,13 @@ static void test_jwt_verifier_bad_signature(void) {
gpr_free(jwt);
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
static int httpcli_get_should_not_be_called(
- const grpc_httpcli_request* /*request*/, grpc_millis /*deadline*/,
- grpc_closure* /*on_done*/, grpc_httpcli_response* /*response*/) {
+ const grpc_http_request* /*request*/, const char* /*host*/,
+ const char* /*path*/, grpc_core::Timestamp /*deadline*/,
+ grpc_closure* /*on_done*/, grpc_http_response* /*response*/) {
GPR_ASSERT(0);
return 1;
}
@@ -610,14 +613,14 @@ static void on_verification_bad_format(void* user_data,
static void test_jwt_verifier_bad_format(void) {
grpc_core::ExecCtx exec_ctx;
grpc_jwt_verifier* verifier = grpc_jwt_verifier_create(nullptr, 0);
- grpc_httpcli_set_override(httpcli_get_should_not_be_called,
- httpcli_post_should_not_be_called);
+ grpc_core::HttpRequest::SetOverride(httpcli_get_should_not_be_called,
+ httpcli_post_should_not_be_called);
grpc_jwt_verifier_verify(verifier, nullptr, "bad jwt", expected_audience,
on_verification_bad_format,
const_cast<char*>(expected_user_data));
grpc_jwt_verifier_destroy(verifier);
grpc_core::ExecCtx::Get()->Flush();
- grpc_httpcli_set_override(nullptr, nullptr);
+ grpc_core::HttpRequest::SetOverride(nullptr, nullptr);
}
/* find verification key: bad jks, cannot find key in jks */
@@ -625,7 +628,7 @@ static void test_jwt_verifier_bad_format(void) {
/* bad key */
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
test_jwt_issuer_email_domain();
test_claims_success();
diff --git a/grpc/test/core/security/linux_system_roots_test.cc b/grpc/test/core/security/linux_system_roots_test.cc
index cd8bd3be..72eefda6 100644
--- a/grpc/test/core/security/linux_system_roots_test.cc
+++ b/grpc/test/core/security/linux_system_roots_test.cc
@@ -17,15 +17,19 @@
*/
#include <grpc/support/port_platform.h>
+
#include <stdio.h>
#ifdef GPR_LINUX
+#include <string.h>
+#include <sys/param.h>
+
+#include "gtest/gtest.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <string.h>
-#include <sys/param.h>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/tmpfile.h"
@@ -39,8 +43,6 @@
#include "src/core/tsi/transport_security.h"
#include "test/core/util/test_config.h"
-#include "gtest/gtest.h"
-
namespace grpc {
namespace {
@@ -86,7 +88,7 @@ TEST(CreateRootCertsBundleTest, BundlesCorrectly) {
} // namespace grpc
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/grpc/test/core/security/matchers_test.cc b/grpc/test/core/security/matchers_test.cc
index 0bacd167..d088b572 100644
--- a/grpc/test/core/security/matchers_test.cc
+++ b/grpc/test/core/security/matchers_test.cc
@@ -91,8 +91,7 @@ TEST(StringMatcherTest, InvalidRegex) {
TEST(StringMatcherTest, SafeRegexMatchCaseSensitive) {
auto string_matcher = StringMatcher::Create(StringMatcher::Type::kSafeRegex,
- /*matcher=*/"regex.*",
- /*case_sensitive=*/true);
+ /*matcher=*/"regex.*");
ASSERT_TRUE(string_matcher.ok());
EXPECT_TRUE(string_matcher->Match("regex-test"));
EXPECT_FALSE(string_matcher->Match("xx-regex-test"));
@@ -100,15 +99,12 @@ TEST(StringMatcherTest, SafeRegexMatchCaseSensitive) {
EXPECT_FALSE(string_matcher->Match("test-regex"));
}
-TEST(StringMatcherTest, SafeRegexMatchCaseInSensitive) {
+TEST(StringMatcherTest, PresenceMatchUsingSafeRegex) {
auto string_matcher = StringMatcher::Create(StringMatcher::Type::kSafeRegex,
- /*matcher=*/"regex.*",
- /*case_sensitive=*/false);
+ /*matcher=*/".+");
ASSERT_TRUE(string_matcher.ok());
- EXPECT_TRUE(string_matcher->Match("regex-test"));
- EXPECT_TRUE(string_matcher->Match("Regex-test"));
- EXPECT_FALSE(string_matcher->Match("xx-Regex-test"));
- EXPECT_FALSE(string_matcher->Match("test-regex"));
+ EXPECT_TRUE(string_matcher->Match("any-value"));
+ EXPECT_FALSE(string_matcher->Match(""));
}
TEST(StringMatcherTest, ContainsMatchCaseSensitive) {
@@ -140,6 +136,7 @@ TEST(HeaderMatcherTest, StringMatcher) {
EXPECT_TRUE(header_matcher->Match("exact"));
EXPECT_FALSE(header_matcher->Match("Exact"));
EXPECT_FALSE(header_matcher->Match("exacz"));
+ EXPECT_FALSE(header_matcher->Match(absl::nullopt));
}
TEST(HeaderMatcherTest, StringMatcherWithInvertMatch) {
@@ -152,6 +149,7 @@ TEST(HeaderMatcherTest, StringMatcherWithInvertMatch) {
EXPECT_FALSE(header_matcher->Match("exact"));
EXPECT_TRUE(header_matcher->Match("Exact"));
EXPECT_TRUE(header_matcher->Match("exacz"));
+ EXPECT_FALSE(header_matcher->Match(absl::nullopt));
}
TEST(HeaderMatcherTest, InvalidRegex) {
@@ -176,13 +174,27 @@ TEST(HeaderMatcherTest, RangeMatcherValidRange) {
EXPECT_TRUE(header_matcher->Match("10"));
EXPECT_FALSE(header_matcher->Match("3"));
EXPECT_FALSE(header_matcher->Match("20"));
+ EXPECT_FALSE(header_matcher->Match(absl::nullopt));
+}
+
+TEST(HeaderMatcherTest, RangeMatcherValidRangeWithInvertMatch) {
+ auto header_matcher = HeaderMatcher::Create(
+ /*name=*/"key", HeaderMatcher::Type::kRange,
+ /*matcher=*/"", /*range_start=*/10,
+ /*range_end=*/20, /*present_match=*/false, /*invert_match=*/true);
+ ASSERT_TRUE(header_matcher.ok());
+ EXPECT_FALSE(header_matcher->Match("16"));
+ EXPECT_FALSE(header_matcher->Match("10"));
+ EXPECT_TRUE(header_matcher->Match("3"));
+ EXPECT_TRUE(header_matcher->Match("20"));
+ EXPECT_FALSE(header_matcher->Match(absl::nullopt));
}
TEST(HeaderMatcherTest, RangeMatcherInvalidRange) {
auto header_matcher =
HeaderMatcher::Create(/*name=*/"key", HeaderMatcher::Type::kRange,
/*matcher=*/"", /*range_start=*/20,
- /*range_end*/ 10);
+ /*range_end=*/10);
EXPECT_FALSE(header_matcher.ok());
EXPECT_EQ(header_matcher.status().code(), absl::StatusCode::kInvalidArgument);
EXPECT_EQ(
@@ -200,6 +212,16 @@ TEST(HeaderMatcherTest, PresentMatcherTrue) {
EXPECT_FALSE(header_matcher->Match(absl::nullopt));
}
+TEST(HeaderMatcherTest, PresentMatcherTrueWithInvertMatch) {
+ auto header_matcher = HeaderMatcher::Create(
+ /*name=*/"key", HeaderMatcher::Type::kPresent,
+ /*matcher=*/"", /*range_start=*/0,
+ /*range_end=*/0, /*present_match=*/true, /*invert_match=*/true);
+ ASSERT_TRUE(header_matcher.ok());
+ EXPECT_FALSE(header_matcher->Match("any_value"));
+ EXPECT_TRUE(header_matcher->Match(absl::nullopt));
+}
+
TEST(HeaderMatcherTest, PresentMatcherFalse) {
auto header_matcher =
HeaderMatcher::Create(/*name=*/"key", HeaderMatcher::Type::kPresent,
@@ -210,6 +232,16 @@ TEST(HeaderMatcherTest, PresentMatcherFalse) {
EXPECT_TRUE(header_matcher->Match(absl::nullopt));
}
+TEST(HeaderMatcherTest, PresentMatcherFalseWithInvertMatch) {
+ auto header_matcher = HeaderMatcher::Create(
+ /*name=*/"key", HeaderMatcher::Type::kPresent,
+ /*matcher=*/"", /*range_start=*/0,
+ /*range_end=*/0, /*present_match=*/false, /*invert_match=*/true);
+ ASSERT_TRUE(header_matcher.ok());
+ EXPECT_TRUE(header_matcher->Match("any_value"));
+ EXPECT_FALSE(header_matcher->Match(absl::nullopt));
+}
+
} // namespace grpc_core
int main(int argc, char** argv) {
diff --git a/grpc/test/core/security/oauth2_utils.cc b/grpc/test/core/security/oauth2_utils.cc
index 536696b4..18358015 100644
--- a/grpc/test/core/security/oauth2_utils.cc
+++ b/grpc/test/core/security/oauth2_utils.cc
@@ -28,90 +28,80 @@
#include <grpc/support/sync.h>
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
+#include "src/core/lib/promise/map.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/security/credentials/credentials.h"
-typedef struct {
- gpr_mu* mu;
- grpc_polling_entity pops;
- bool is_done;
- char* token;
-
- grpc_credentials_mdelem_array md_array;
- grpc_closure closure;
-} oauth2_request;
-
-static void on_oauth2_response(void* arg, grpc_error_handle error) {
- oauth2_request* request = static_cast<oauth2_request*>(arg);
- char* token = nullptr;
- grpc_slice token_slice;
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Fetching token failed: %s",
- grpc_error_std_string(error).c_str());
- } else {
- GPR_ASSERT(request->md_array.size == 1);
- token_slice = GRPC_MDVALUE(request->md_array.md[0]);
- token = static_cast<char*>(gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1));
- memcpy(token, GRPC_SLICE_START_PTR(token_slice),
- GRPC_SLICE_LENGTH(token_slice));
- token[GRPC_SLICE_LENGTH(token_slice)] = '\0';
- }
- grpc_credentials_mdelem_array_destroy(&request->md_array);
- gpr_mu_lock(request->mu);
- request->is_done = true;
- request->token = token;
- GRPC_LOG_IF_ERROR(
- "pollset_kick",
- grpc_pollset_kick(grpc_polling_entity_pollset(&request->pops), nullptr));
- gpr_mu_unlock(request->mu);
-}
-
-static void do_nothing(void* /*arg*/, grpc_error_handle /*error*/) {}
+static auto* g_memory_allocator = new grpc_core::MemoryAllocator(
+ grpc_core::ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
+ "test"));
char* grpc_test_fetch_oauth2_token_with_credentials(
grpc_call_credentials* creds) {
- oauth2_request request;
- memset(&request, 0, sizeof(request));
grpc_core::ExecCtx exec_ctx;
- grpc_closure do_nothing_closure;
- grpc_auth_metadata_context null_ctx = {"", "", nullptr, nullptr};
+ grpc_call_credentials::GetRequestMetadataArgs get_request_metadata_args;
grpc_pollset* pollset =
static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
- grpc_pollset_init(pollset, &request.mu);
- request.pops = grpc_polling_entity_create_from_pollset(pollset);
- request.is_done = false;
+ gpr_mu* mu = nullptr;
+ grpc_pollset_init(pollset, &mu);
+ auto pops = grpc_polling_entity_create_from_pollset(pollset);
+ bool is_done = false;
- GRPC_CLOSURE_INIT(&do_nothing_closure, do_nothing, nullptr,
- grpc_schedule_on_exec_ctx);
+ auto arena = grpc_core::MakeScopedArena(1024, g_memory_allocator);
+ grpc_metadata_batch initial_metadata{arena.get()};
+ char* token = nullptr;
- GRPC_CLOSURE_INIT(&request.closure, on_oauth2_response, &request,
- grpc_schedule_on_exec_ctx);
+ auto activity = grpc_core::MakeActivity(
+ [creds, &initial_metadata, &get_request_metadata_args]() {
+ return grpc_core::Map(
+ creds->GetRequestMetadata(
+ grpc_core::ClientMetadataHandle::TestOnlyWrap(
+ &initial_metadata),
+ &get_request_metadata_args),
+ [](const absl::StatusOr<grpc_core::ClientMetadataHandle>& s) {
+ return s.status();
+ });
+ },
+ grpc_core::ExecCtxWakeupScheduler(),
+ [&is_done, &token, &initial_metadata](absl::Status result) {
+ is_done = true;
+ if (!result.ok()) {
+ gpr_log(GPR_ERROR, "Fetching token failed: %s",
+ result.ToString().c_str());
+ } else {
+ std::string buffer;
+ token = gpr_strdup(
+ std::string(
+ initial_metadata
+ .GetStringValue(GRPC_AUTHORIZATION_METADATA_KEY, &buffer)
+ .value_or(""))
+ .c_str());
+ }
+ },
+ arena.get(), &pops);
- grpc_error_handle error = GRPC_ERROR_NONE;
- if (creds->get_request_metadata(&request.pops, null_ctx, &request.md_array,
- &request.closure, &error)) {
- // Synchronous result; invoke callback directly.
- on_oauth2_response(&request, error);
- GRPC_ERROR_UNREF(error);
- }
grpc_core::ExecCtx::Get()->Flush();
- gpr_mu_lock(request.mu);
- while (!request.is_done) {
+ gpr_mu_lock(mu);
+ while (!is_done) {
grpc_pollset_worker* worker = nullptr;
if (!GRPC_LOG_IF_ERROR(
"pollset_work",
- grpc_pollset_work(grpc_polling_entity_pollset(&request.pops),
- &worker, GRPC_MILLIS_INF_FUTURE))) {
- request.is_done = true;
+ grpc_pollset_work(grpc_polling_entity_pollset(&pops), &worker,
+ grpc_core::Timestamp::InfFuture()))) {
+ is_done = true;
}
}
- gpr_mu_unlock(request.mu);
+ gpr_mu_unlock(mu);
- grpc_pollset_shutdown(grpc_polling_entity_pollset(&request.pops),
- &do_nothing_closure);
+ grpc_pollset_shutdown(
+ grpc_polling_entity_pollset(&pops),
+ GRPC_CLOSURE_CREATE([](void*, grpc_error_handle) {}, nullptr, nullptr));
grpc_core::ExecCtx::Get()->Flush();
- grpc_pollset_destroy(grpc_polling_entity_pollset(&request.pops));
+ grpc_pollset_destroy(grpc_polling_entity_pollset(&pops));
gpr_free(pollset);
- return request.token;
+
+ return token;
}
diff --git a/grpc/test/core/security/print_google_default_creds_token.cc b/grpc/test/core/security/print_google_default_creds_token.cc
index 0d6c7b79..c2ced88b 100644
--- a/grpc/test/core/security/print_google_default_creds_token.cc
+++ b/grpc/test/core/security/print_google_default_creds_token.cc
@@ -37,7 +37,7 @@ typedef struct {
grpc_polling_entity pops;
bool is_done;
- grpc_credentials_mdelem_array md_array;
+ grpc_core::CredentialsMetadataArray md_array;
grpc_closure on_request_metadata;
} synchronizer;
@@ -112,7 +112,7 @@ int main(int argc, char** argv) {
if (!GRPC_LOG_IF_ERROR(
"pollset_work",
grpc_pollset_work(grpc_polling_entity_pollset(&sync.pops), &worker,
- GRPC_MILLIS_INF_FUTURE)))
+ grpc_core::Timestamp::InfFuture())))
sync.is_done = true;
gpr_mu_unlock(sync.mu);
grpc_core::ExecCtx::Get()->Flush();
diff --git a/grpc/test/core/security/rbac_translator_test.cc b/grpc/test/core/security/rbac_translator_test.cc
index 337f4715..07f4abf6 100644
--- a/grpc/test/core/security/rbac_translator_test.cc
+++ b/grpc/test/core/security/rbac_translator_test.cc
@@ -21,25 +21,34 @@ namespace grpc_core {
namespace {
-MATCHER_P2(EqualsPrincipalName, expected_matcher_type, expected_matcher_value,
- "") {
+MATCHER_P3(EqualsPrincipalName, expected_matcher_type, expected_matcher_value,
+ is_regex, "") {
return arg->type == Rbac::Principal::RuleType::kPrincipalName &&
- arg->string_matcher.type() == expected_matcher_type &&
- arg->string_matcher.string_matcher() == expected_matcher_value;
+ arg->string_matcher.value().type() == expected_matcher_type &&
+ is_regex
+ ? arg->string_matcher.value().regex_matcher()->pattern() ==
+ expected_matcher_value
+ : arg->string_matcher.value().string_matcher() ==
+ expected_matcher_value;
}
-MATCHER_P2(EqualsPath, expected_matcher_type, expected_matcher_value, "") {
+MATCHER_P3(EqualsPath, expected_matcher_type, expected_matcher_value, is_regex,
+ "") {
return arg->type == Rbac::Permission::RuleType::kPath &&
- arg->string_matcher.type() == expected_matcher_type &&
- arg->string_matcher.string_matcher() == expected_matcher_value;
+ arg->string_matcher.type() == expected_matcher_type && is_regex
+ ? arg->string_matcher.regex_matcher()->pattern() ==
+ expected_matcher_value
+ : arg->string_matcher.string_matcher() == expected_matcher_value;
}
-MATCHER_P3(EqualsHeader, expected_name, expected_matcher_type,
- expected_matcher_value, "") {
+MATCHER_P4(EqualsHeader, expected_name, expected_matcher_type,
+ expected_matcher_value, is_regex, "") {
return arg->type == Rbac::Permission::RuleType::kHeader &&
- arg->header_matcher.name() == expected_name &&
- arg->header_matcher.type() == expected_matcher_type &&
- arg->header_matcher.string_matcher() == expected_matcher_value;
+ arg->header_matcher.name() == expected_name &&
+ arg->header_matcher.type() == expected_matcher_type && is_regex
+ ? arg->header_matcher.regex_matcher()->pattern() ==
+ expected_matcher_value
+ : arg->header_matcher.string_matcher() == expected_matcher_value;
}
} // namespace
@@ -53,7 +62,7 @@ TEST(GenerateRbacPoliciesTest, InvalidPolicy) {
EXPECT_EQ(rbac_policies.status().code(), absl::StatusCode::kInvalidArgument);
EXPECT_THAT(
std::string(rbac_policies.status().message()),
- ::testing::StartsWith("Failed to parse SDK authorization policy."));
+ ::testing::StartsWith("Failed to parse gRPC authorization policy."));
}
TEST(GenerateRbacPoliciesTest, MissingAuthorizationPolicyName) {
@@ -292,40 +301,41 @@ TEST(GenerateRbacPoliciesTest, ParseSourceSuccess) {
auto rbac_policies = GenerateRbacPolicies(authz_policy);
ASSERT_TRUE(rbac_policies.ok());
EXPECT_EQ(rbac_policies.value().allow_policy.action, Rbac::Action::kAllow);
- EXPECT_THAT(
- rbac_policies.value().allow_policy.policies,
- ::testing::ElementsAre(::testing::Pair(
- "authz_allow_policy",
- ::testing::AllOf(
- ::testing::Field(
- &Rbac::Policy::permissions,
- ::testing::Field(&Rbac::Permission::type,
- Rbac::Permission::RuleType::kAny)),
- ::testing::Field(
- &Rbac::Policy::principals,
+ EXPECT_THAT(rbac_policies.value().allow_policy.policies,
+ ::testing::ElementsAre(::testing::Pair(
+ "authz_allow_policy",
::testing::AllOf(
- ::testing::Field(&Rbac::Principal::type,
- Rbac::Principal::RuleType::kAnd),
::testing::Field(
- &Rbac::Principal::principals,
- ::testing::ElementsAre(::testing::AllOf(
- ::testing::Pointee(::testing::Field(
- &Rbac::Principal::type,
- Rbac::Principal::RuleType::kOr)),
- ::testing::Pointee(::testing::Field(
+ &Rbac::Policy::permissions,
+ ::testing::Field(&Rbac::Permission::type,
+ Rbac::Permission::RuleType::kAny)),
+ ::testing::Field(
+ &Rbac::Policy::principals,
+ ::testing::AllOf(
+ ::testing::Field(&Rbac::Principal::type,
+ Rbac::Principal::RuleType::kAnd),
+ ::testing::Field(
&Rbac::Principal::principals,
- ::testing::ElementsAre(
- EqualsPrincipalName(
- StringMatcher::Type::kExact,
- "spiffe://foo.abc"),
- EqualsPrincipalName(
- StringMatcher::Type::kPrefix,
- "spiffe://bar"),
- EqualsPrincipalName(
- StringMatcher::Type::kSuffix, "baz"),
- EqualsPrincipalName(
- StringMatcher::Type::kExact,
- "spiffe://abc.*.com")))))))))))));
+ ::testing::ElementsAre(::testing::AllOf(
+ ::testing::Pointee(::testing::Field(
+ &Rbac::Principal::type,
+ Rbac::Principal::RuleType::kOr)),
+ ::testing::Pointee(::testing::Field(
+ &Rbac::Principal::principals,
+ ::testing::ElementsAre(
+ EqualsPrincipalName(
+ StringMatcher::Type::kExact,
+ "spiffe://foo.abc", false),
+ EqualsPrincipalName(
+ StringMatcher::Type::kPrefix,
+ "spiffe://bar", false),
+ EqualsPrincipalName(
+ StringMatcher::Type::kSuffix,
+ "baz", false),
+ EqualsPrincipalName(
+ StringMatcher::Type::kExact,
+ "spiffe://abc.*.com",
+ false)))))))))))));
EXPECT_EQ(rbac_policies.value().deny_policy.action, Rbac::Action::kDeny);
EXPECT_THAT(
rbac_policies.value().deny_policy.policies,
@@ -350,8 +360,8 @@ TEST(GenerateRbacPoliciesTest, ParseSourceSuccess) {
::testing::Pointee(::testing::Field(
&Rbac::Principal::principals,
::testing::ElementsAre(EqualsPrincipalName(
- StringMatcher::Type::kPrefix,
- "")))))))))))));
+ StringMatcher::Type::kSafeRegex, ".+",
+ true)))))))))))));
}
TEST(GenerateRbacPoliciesTest, IncorrectRequestType) {
@@ -447,11 +457,11 @@ TEST(GenerateRbacPoliciesTest, ParseRequestPathsSuccess) {
&Rbac::Permission::permissions,
::testing::ElementsAre(
EqualsPath(StringMatcher::Type::kExact,
- "path-foo"),
+ "path-foo", false),
EqualsPath(StringMatcher::Type::kPrefix,
- "path-bar"),
+ "path-bar", false),
EqualsPath(StringMatcher::Type::kSuffix,
- "baz")))))))))))));
+ "baz", false)))))))))))));
EXPECT_EQ(rbac_policies.value().allow_policy.action, Rbac::Action::kAllow);
EXPECT_THAT(
rbac_policies.value().allow_policy.policies,
@@ -475,9 +485,9 @@ TEST(GenerateRbacPoliciesTest, ParseRequestPathsSuccess) {
Rbac::Permission::RuleType::kOr)),
::testing::Pointee(::testing::Field(
&Rbac::Permission::permissions,
- ::testing::ElementsAre(
- EqualsPath(StringMatcher::Type::kPrefix,
- "")))))))))))));
+ ::testing::ElementsAre(EqualsPath(
+ StringMatcher::Type::kSafeRegex, ".+",
+ true)))))))))))));
}
TEST(GenerateRbacPoliciesTest, IncorrectHeaderType) {
@@ -553,32 +563,6 @@ TEST(GenerateRbacPoliciesTest, UnsupportedPseudoHeaders) {
"allow_rules 0: \"headers\" 0: Unsupported \"key\" :method.");
}
-TEST(GenerateRbacPoliciesTest, UnsupportedhostHeader) {
- const char* authz_policy =
- "{"
- " \"name\": \"authz\","
- " \"deny_rules\": ["
- " {"
- " \"name\": \"policy\","
- " \"request\": {"
- " \"headers\": ["
- " {"
- " \"key\": \"host\","
- " \"values\": ["
- " \"*\""
- " ]"
- " }"
- " ]"
- " }"
- " }"
- " ]"
- "}";
- auto rbac_policies = GenerateRbacPolicies(authz_policy);
- EXPECT_EQ(rbac_policies.status().code(), absl::StatusCode::kInvalidArgument);
- EXPECT_EQ(rbac_policies.status().message(),
- "deny_rules 0: \"headers\" 0: Unsupported \"key\" host.");
-}
-
TEST(GenerateRbacPoliciesTest, UnsupportedHostHeader) {
const char* authz_policy =
"{"
@@ -696,8 +680,8 @@ TEST(GenerateRbacPoliciesTest, ParseRequestHeadersSuccess) {
EqualsHeader(
"key-1",
HeaderMatcher::Type::
- kPrefix,
- ""))))),
+ kSafeRegex,
+ ".+", true))))),
::testing::AllOf(
::testing::Pointee(::testing::Field(
&Rbac::Permission::type,
@@ -708,17 +692,18 @@ TEST(GenerateRbacPoliciesTest, ParseRequestHeadersSuccess) {
EqualsHeader("key-2",
HeaderMatcher::
Type::kExact,
- "foo"),
+ "foo", false),
EqualsHeader(
"key-2",
HeaderMatcher::Type::
kPrefix,
- "bar"),
+ "bar", false),
EqualsHeader(
"key-2",
HeaderMatcher::Type::
kSuffix,
- "baz")))))))))))))))));
+ "baz",
+ false)))))))))))))))));
}
TEST(GenerateRbacPoliciesTest, ParseRulesArraySuccess) {
@@ -769,8 +754,8 @@ TEST(GenerateRbacPoliciesTest, ParseRulesArraySuccess) {
::testing::Pointee(::testing::Field(
&Rbac::Permission::permissions,
::testing::ElementsAre(EqualsPath(
- StringMatcher::Type::kExact,
- "foo"))))))))),
+ StringMatcher::Type::kExact, "foo",
+ false))))))))),
::testing::Field(
&Rbac::Policy::principals,
::testing::AllOf(
@@ -787,7 +772,8 @@ TEST(GenerateRbacPoliciesTest, ParseRulesArraySuccess) {
::testing::ElementsAre(
EqualsPrincipalName(
StringMatcher::Type::kExact,
- "spiffe://foo.abc"))))))))))),
+ "spiffe://foo.abc",
+ false))))))))))),
::testing::Pair(
"authz_allow_policy_2",
::testing::AllOf(
diff --git a/grpc/test/core/security/secure_endpoint_test.cc b/grpc/test/core/security/secure_endpoint_test.cc
index c5621d92..0d27e137 100644
--- a/grpc/test/core/security/secure_endpoint_test.cc
+++ b/grpc/test/core/security/secure_endpoint_test.cc
@@ -16,7 +16,7 @@
*
*/
-#include "test/core/iomgr/endpoint_tests.h"
+#include "src/core/lib/security/transport/secure_endpoint.h"
#include <fcntl.h>
#include <sys/types.h>
@@ -24,12 +24,13 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/security/transport/secure_endpoint.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/fake_transport_security.h"
+#include "test/core/iomgr/endpoint_tests.h"
#include "test/core/util/test_config.h"
static gpr_mu* g_mu;
@@ -54,10 +55,14 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
grpc_endpoint_test_fixture f;
grpc_endpoint_pair tcp;
- grpc_arg a[1];
+ grpc_arg a[2];
a[0].key = const_cast<char*>(GRPC_ARG_TCP_READ_CHUNK_SIZE);
a[0].type = GRPC_ARG_INTEGER;
a[0].value.integer = static_cast<int>(slice_size);
+ a[1].key = const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA);
+ a[1].type = GRPC_ARG_POINTER;
+ a[1].value.pointer.p = grpc_resource_quota_create("test");
+ a[1].value.pointer.vtable = grpc_resource_quota_arg_vtable();
grpc_channel_args args = {GPR_ARRAY_SIZE(a), a};
tcp = grpc_iomgr_create_endpoint_pair("fixture", &args);
grpc_endpoint_add_to_pollset(tcp.client, g_pollset);
@@ -66,7 +71,7 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
if (leftover_nslices == 0) {
f.client_ep = grpc_secure_endpoint_create(fake_read_protector,
fake_read_zero_copy_protector,
- tcp.client, nullptr, 0);
+ tcp.client, nullptr, &args, 0);
} else {
unsigned i;
tsi_result result;
@@ -110,14 +115,16 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
total_buffer_size - buffer_size);
f.client_ep = grpc_secure_endpoint_create(
fake_read_protector, fake_read_zero_copy_protector, tcp.client,
- &encrypted_leftover, 1);
+ &encrypted_leftover, &args, 1);
grpc_slice_unref(encrypted_leftover);
gpr_free(encrypted_buffer);
}
f.server_ep = grpc_secure_endpoint_create(fake_write_protector,
fake_write_zero_copy_protector,
- tcp.server, nullptr, 0);
+ tcp.server, nullptr, &args, 0);
+ grpc_resource_quota_unref(
+ static_cast<grpc_resource_quota*>(a[1].value.pointer.p));
return f;
}
@@ -208,7 +215,7 @@ static void destroy_pollset(void* p, grpc_error_handle /*error*/) {
int main(int argc, char** argv) {
grpc_closure destroyed;
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
{
diff --git a/grpc/test/core/security/security_connector_test.cc b/grpc/test/core/security/security_connector_test.cc
index da7f2f0c..71d45862 100644
--- a/grpc/test/core/security/security_connector_test.cc
+++ b/grpc/test/core/security/security_connector_test.cc
@@ -18,12 +18,13 @@
#include "src/core/lib/security/security_connector/security_connector.h"
+#include <stdio.h>
+#include <string.h>
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <stdio.h>
-#include <string.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tmpfile.h"
@@ -39,20 +40,6 @@
#define TSI_OPENSSL_ALPN_SUPPORT 1
#endif
-static int check_transport_security_type(const grpc_auth_context* ctx) {
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) return 0;
- if (strncmp(prop->value, GRPC_SSL_TRANSPORT_SECURITY_TYPE,
- prop->value_length) != 0) {
- return 0;
- }
- /* Check that we have only one property with this name. */
- if (grpc_auth_property_iterator_next(&it) != nullptr) return 0;
- return 1;
-}
-
static int check_peer_property(const tsi_peer* peer,
const tsi_peer_property* expected) {
size_t i;
@@ -84,145 +71,30 @@ static int check_ssl_peer_equivalence(const tsi_peer* original,
return 1;
}
-static void test_check_security_level() {
- GPR_ASSERT(grpc_check_security_level(GRPC_PRIVACY_AND_INTEGRITY,
- GRPC_PRIVACY_AND_INTEGRITY) == true);
- GPR_ASSERT(grpc_check_security_level(GRPC_PRIVACY_AND_INTEGRITY,
- GRPC_INTEGRITY_ONLY) == true);
- GPR_ASSERT(grpc_check_security_level(GRPC_PRIVACY_AND_INTEGRITY,
- GRPC_SECURITY_NONE) == true);
- GPR_ASSERT(grpc_check_security_level(GRPC_INTEGRITY_ONLY,
- GRPC_PRIVACY_AND_INTEGRITY) == false);
- GPR_ASSERT(grpc_check_security_level(GRPC_INTEGRITY_ONLY,
- GRPC_INTEGRITY_ONLY) == true);
- GPR_ASSERT(grpc_check_security_level(GRPC_INTEGRITY_ONLY,
- GRPC_SECURITY_NONE) == true);
- GPR_ASSERT(grpc_check_security_level(GRPC_SECURITY_NONE,
- GRPC_PRIVACY_AND_INTEGRITY) == false);
- GPR_ASSERT(grpc_check_security_level(GRPC_SECURITY_NONE,
- GRPC_INTEGRITY_ONLY) == false);
- GPR_ASSERT(grpc_check_security_level(GRPC_SECURITY_NONE,
- GRPC_SECURITY_NONE) == true);
-}
-
-static void test_unauthenticated_ssl_peer(void) {
- tsi_peer peer;
- tsi_peer rpeer;
- GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
- GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
- TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
- &peer.properties[0]) == TSI_OK);
- GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
- TSI_SECURITY_LEVEL_PEER_PROPERTY,
- tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
- &peer.properties[1]) == TSI_OK);
- grpc_core::RefCountedPtr<grpc_auth_context> ctx =
- grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
- GPR_ASSERT(ctx != nullptr);
- GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx.get()));
- GPR_ASSERT(check_transport_security_type(ctx.get()));
-
- rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
- GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
-
- grpc_shallow_peer_destruct(&rpeer);
- tsi_peer_destruct(&peer);
- ctx.reset(DEBUG_LOCATION, "test");
-}
-
-static int check_identity(const grpc_auth_context* ctx,
+static int check_property(const grpc_auth_context* ctx,
const char* expected_property_name,
- const char** expected_identities,
- size_t num_identities) {
- grpc_auth_property_iterator it;
- const grpc_auth_property* prop;
- size_t i;
- GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
- it = grpc_auth_context_peer_identity(ctx);
- for (i = 0; i < num_identities; i++) {
- prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) {
- gpr_log(GPR_ERROR, "Expected identity value %s not found.",
- expected_identities[i]);
- return 0;
- }
- if (strcmp(prop->name, expected_property_name) != 0) {
- gpr_log(GPR_ERROR, "Expected peer identity property name %s and got %s.",
- expected_property_name, prop->name);
- return 0;
- }
- if (strncmp(prop->value, expected_identities[i], prop->value_length) != 0) {
- gpr_log(GPR_ERROR, "Expected peer identity %s and got %s.",
- expected_identities[i], prop->value);
- return 0;
- }
- }
- return 1;
-}
-
-static int check_x509_cn(const grpc_auth_context* ctx,
- const char* expected_cn) {
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- ctx, GRPC_X509_CN_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) {
- gpr_log(GPR_ERROR, "CN property not found.");
- return 0;
- }
- if (strncmp(prop->value, expected_cn, prop->value_length) != 0) {
- gpr_log(GPR_ERROR, "Expected CN %s and got %s", expected_cn, prop->value);
- return 0;
- }
- if (grpc_auth_property_iterator_next(&it) != nullptr) {
- gpr_log(GPR_ERROR, "Expected only one property for CN.");
- return 0;
- }
- return 1;
-}
-
-static int check_x509_pem_cert(const grpc_auth_context* ctx,
- const char* expected_pem_cert) {
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- ctx, GRPC_X509_PEM_CERT_PROPERTY_NAME);
- const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
- if (prop == nullptr) {
- gpr_log(GPR_ERROR, "Pem certificate property not found.");
- return 0;
- }
- if (strncmp(prop->value, expected_pem_cert, prop->value_length) != 0) {
- gpr_log(GPR_ERROR, "Expected pem cert %s and got %s", expected_pem_cert,
- prop->value);
- return 0;
- }
- if (grpc_auth_property_iterator_next(&it) != nullptr) {
- gpr_log(GPR_ERROR, "Expected only one property for pem cert.");
- return 0;
- }
- return 1;
-}
-
-static int check_x509_pem_cert_chain(const grpc_auth_context* ctx,
- const char* expected_pem_cert_chain) {
- grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
- ctx, GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME);
+ const char* expected_property_value) {
+ grpc_auth_property_iterator it =
+ grpc_auth_context_find_properties_by_name(ctx, expected_property_name);
const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
if (prop == nullptr) {
- gpr_log(GPR_ERROR, "Pem certificate chain property not found.");
+ gpr_log(GPR_ERROR, "Expected value %s not found.", expected_property_value);
return 0;
}
- if (strncmp(prop->value, expected_pem_cert_chain, prop->value_length) != 0) {
- gpr_log(GPR_ERROR, "Expected pem cert chain %s and got %s",
- expected_pem_cert_chain, prop->value);
+ if (strncmp(prop->value, expected_property_value, prop->value_length) != 0) {
+ gpr_log(GPR_ERROR, "Expected value %s and got %s for property %s.",
+ expected_property_value, prop->value, expected_property_name);
return 0;
}
if (grpc_auth_property_iterator_next(&it) != nullptr) {
- gpr_log(GPR_ERROR, "Expected only one property for pem cert chain.");
+ gpr_log(GPR_ERROR, "Expected only one property for %s.",
+ expected_property_name);
return 0;
}
return 1;
}
-static int check_sans(
+static int check_properties(
const grpc_auth_context* ctx, const char* expected_property_name,
const std::vector<std::string>& expected_property_values) {
grpc_auth_property_iterator it =
@@ -234,9 +106,14 @@ static int check_sans(
property_value.c_str());
return 0;
}
+ if (strcmp(prop->name, expected_property_name) != 0) {
+ gpr_log(GPR_ERROR, "Expected peer property name %s and got %s.",
+ expected_property_name, prop->name);
+ return 0;
+ }
if (strncmp(prop->value, property_value.c_str(), prop->value_length) != 0) {
- gpr_log(GPR_ERROR, "Expected peer %s and got %s.", property_value.c_str(),
- prop->value);
+ gpr_log(GPR_ERROR, "Expected peer property value %s and got %s.",
+ property_value.c_str(), prop->value);
return 0;
}
}
@@ -277,6 +154,33 @@ static int check_spiffe_id(const grpc_auth_context* ctx,
return 1;
}
+static void test_unauthenticated_ssl_peer(void) {
+ tsi_peer peer;
+ tsi_peer rpeer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
+ &peer.properties[1]) == TSI_OK);
+ grpc_core::RefCountedPtr<grpc_auth_context> ctx =
+ grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ GPR_ASSERT(ctx != nullptr);
+ GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx.get()));
+ GPR_ASSERT(check_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE));
+
+ rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
+ GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
+
+ grpc_shallow_peer_destruct(&rpeer);
+ tsi_peer_destruct(&peer);
+ ctx.reset(DEBUG_LOCATION, "test");
+}
+
static void test_cn_only_ssl_peer_to_auth_context(void) {
tsi_peer peer;
tsi_peer rpeer;
@@ -305,11 +209,16 @@ static void test_cn_only_ssl_peer_to_auth_context(void) {
GPR_ASSERT(ctx != nullptr);
GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx.get()));
GPR_ASSERT(
- check_identity(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, &expected_cn, 1));
- GPR_ASSERT(check_transport_security_type(ctx.get()));
- GPR_ASSERT(check_x509_cn(ctx.get(), expected_cn));
- GPR_ASSERT(check_x509_pem_cert(ctx.get(), expected_pem_cert));
- GPR_ASSERT(check_x509_pem_cert_chain(ctx.get(), expected_pem_cert_chain));
+ check_property(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, expected_cn));
+ GPR_ASSERT(check_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE));
+ GPR_ASSERT(
+ check_property(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, expected_cn));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_PROPERTY_NAME,
+ expected_pem_cert));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
+ expected_pem_cert_chain));
rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
@@ -323,7 +232,7 @@ static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
tsi_peer peer;
tsi_peer rpeer;
const char* expected_cn = "cn1";
- const char* expected_san = "san1";
+ const std::vector<std::string> expected_sans = {"san1"};
const char* expected_pem_cert = "pem_cert1";
const char* expected_pem_cert_chain = "pem_cert1_chain";
GPR_ASSERT(tsi_construct_peer(6, &peer) == TSI_OK);
@@ -334,28 +243,36 @@ static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
&peer.properties[1]) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_san,
- &peer.properties[2]) == TSI_OK);
- GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_PROPERTY, expected_pem_cert,
- &peer.properties[3]) == TSI_OK);
+ &peer.properties[2]) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_SECURITY_LEVEL_PEER_PROPERTY,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
- &peer.properties[4]) == TSI_OK);
+ &peer.properties[3]) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_CHAIN_PROPERTY, expected_pem_cert_chain,
- &peer.properties[5]) == TSI_OK);
+ &peer.properties[4]) == TSI_OK);
+ for (size_t i = 0; i < expected_sans.size(); i++) {
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
+ expected_sans[i].c_str(),
+ &peer.properties[5 + i]) == TSI_OK);
+ }
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx.get()));
GPR_ASSERT(
- check_identity(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
- GPR_ASSERT(check_transport_security_type(ctx.get()));
- GPR_ASSERT(check_x509_cn(ctx.get(), expected_cn));
- GPR_ASSERT(check_x509_pem_cert(ctx.get(), expected_pem_cert));
- GPR_ASSERT(check_x509_pem_cert_chain(ctx.get(), expected_pem_cert_chain));
+ check_properties(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME, expected_sans));
+ GPR_ASSERT(check_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE));
+ GPR_ASSERT(
+ check_property(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, expected_cn));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_PROPERTY_NAME,
+ expected_pem_cert));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
+ expected_pem_cert_chain));
rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
@@ -369,12 +286,11 @@ static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) {
tsi_peer peer;
tsi_peer rpeer;
const char* expected_cn = "cn1";
- const char* expected_sans[] = {"san1", "san2", "san3"};
+ const std::vector<std::string> expected_sans = {"san1", "san2", "san3"};
const char* expected_pem_cert = "pem_cert1";
const char* expected_pem_cert_chain = "pem_cert1_chain";
size_t i;
- GPR_ASSERT(tsi_construct_peer(5 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
- TSI_OK);
+ GPR_ASSERT(tsi_construct_peer(5 + expected_sans.size(), &peer) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
&peer.properties[0]) == TSI_OK);
@@ -391,21 +307,27 @@ static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) {
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_CHAIN_PROPERTY, expected_pem_cert_chain,
&peer.properties[4]) == TSI_OK);
- for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+ for (i = 0; i < expected_sans.size(); i++) {
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
- expected_sans[i], &peer.properties[5 + i]) == TSI_OK);
+ expected_sans[i].c_str(),
+ &peer.properties[5 + i]) == TSI_OK);
}
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx.get()));
- GPR_ASSERT(check_identity(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME,
- expected_sans, GPR_ARRAY_SIZE(expected_sans)));
- GPR_ASSERT(check_transport_security_type(ctx.get()));
- GPR_ASSERT(check_x509_cn(ctx.get(), expected_cn));
- GPR_ASSERT(check_x509_pem_cert(ctx.get(), expected_pem_cert));
- GPR_ASSERT(check_x509_pem_cert_chain(ctx.get(), expected_pem_cert_chain));
+ GPR_ASSERT(
+ check_properties(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME, expected_sans));
+ GPR_ASSERT(check_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE));
+ GPR_ASSERT(
+ check_property(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, expected_cn));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_PROPERTY_NAME,
+ expected_pem_cert));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
+ expected_pem_cert_chain));
rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
@@ -422,10 +344,9 @@ static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(
const char* expected_cn = "cn1";
const char* expected_pem_cert = "pem_cert1";
const char* expected_pem_cert_chain = "pem_cert1_chain";
- const char* expected_sans[] = {"san1", "san2", "san3"};
+ const std::vector<std::string> expected_sans = {"san1", "san2", "san3"};
size_t i;
- GPR_ASSERT(tsi_construct_peer(7 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
- TSI_OK);
+ GPR_ASSERT(tsi_construct_peer(7 + expected_sans.size(), &peer) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
&peer.properties[0]) == TSI_OK);
@@ -446,21 +367,27 @@ static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_CHAIN_PROPERTY, expected_pem_cert_chain,
&peer.properties[6]) == TSI_OK);
- for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+ for (i = 0; i < expected_sans.size(); i++) {
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
- expected_sans[i], &peer.properties[7 + i]) == TSI_OK);
+ expected_sans[i].c_str(),
+ &peer.properties[7 + i]) == TSI_OK);
}
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx.get()));
- GPR_ASSERT(check_identity(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME,
- expected_sans, GPR_ARRAY_SIZE(expected_sans)));
- GPR_ASSERT(check_transport_security_type(ctx.get()));
- GPR_ASSERT(check_x509_cn(ctx.get(), expected_cn));
- GPR_ASSERT(check_x509_pem_cert(ctx.get(), expected_pem_cert));
- GPR_ASSERT(check_x509_pem_cert_chain(ctx.get(), expected_pem_cert_chain));
+ GPR_ASSERT(
+ check_properties(ctx.get(), GRPC_X509_SAN_PROPERTY_NAME, expected_sans));
+ GPR_ASSERT(check_property(ctx.get(),
+ GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
+ GRPC_SSL_TRANSPORT_SECURITY_TYPE));
+ GPR_ASSERT(
+ check_property(ctx.get(), GRPC_X509_CN_PROPERTY_NAME, expected_cn));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_PROPERTY_NAME,
+ expected_pem_cert));
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME,
+ expected_pem_cert_chain));
rpeer = grpc_shallow_peer_from_ssl_auth_context(ctx.get());
GPR_ASSERT(check_ssl_peer_equivalence(&peer, &rpeer));
@@ -482,7 +409,26 @@ static void test_dns_peer_to_auth_context(void) {
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
- GPR_ASSERT(check_sans(ctx.get(), GRPC_PEER_DNS_PROPERTY_NAME, expected_dns));
+ GPR_ASSERT(
+ check_properties(ctx.get(), GRPC_PEER_DNS_PROPERTY_NAME, expected_dns));
+ tsi_peer_destruct(&peer);
+ ctx.reset(DEBUG_LOCATION, "test");
+}
+
+static void test_uri_peer_to_auth_context(void) {
+ tsi_peer peer;
+ const std::vector<std::string> expected_uri = {"uri1", "uri2", "uri3"};
+ GPR_ASSERT(tsi_construct_peer(expected_uri.size(), &peer) == TSI_OK);
+ for (size_t i = 0; i < expected_uri.size(); ++i) {
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_URI_PEER_PROPERTY, expected_uri[i].c_str(),
+ &peer.properties[i]) == TSI_OK);
+ }
+ grpc_core::RefCountedPtr<grpc_auth_context> ctx =
+ grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ GPR_ASSERT(ctx != nullptr);
+ GPR_ASSERT(
+ check_properties(ctx.get(), GRPC_PEER_URI_PROPERTY_NAME, expected_uri));
tsi_peer_destruct(&peer);
ctx.reset(DEBUG_LOCATION, "test");
}
@@ -499,8 +445,8 @@ static void test_email_peer_to_auth_context(void) {
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
- GPR_ASSERT(
- check_sans(ctx.get(), GRPC_PEER_EMAIL_PROPERTY_NAME, expected_emails));
+ GPR_ASSERT(check_properties(ctx.get(), GRPC_PEER_EMAIL_PROPERTY_NAME,
+ expected_emails));
tsi_peer_destruct(&peer);
ctx.reset(DEBUG_LOCATION, "test");
}
@@ -518,7 +464,8 @@ static void test_ip_peer_to_auth_context(void) {
grpc_core::RefCountedPtr<grpc_auth_context> ctx =
grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
GPR_ASSERT(ctx != nullptr);
- GPR_ASSERT(check_sans(ctx.get(), GRPC_PEER_IP_PROPERTY_NAME, expected_ips));
+ GPR_ASSERT(
+ check_properties(ctx.get(), GRPC_PEER_IP_PROPERTY_NAME, expected_ips));
tsi_peer_destruct(&peer);
ctx.reset(DEBUG_LOCATION, "test");
}
@@ -604,6 +551,22 @@ static void test_spiffe_id_peer_to_auth_context(void) {
multiple_uri_ctx.reset(DEBUG_LOCATION, "test");
}
+static void test_subject_to_auth_context(void) {
+ tsi_peer peer;
+ const char* expected_subject = "subject1";
+ GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_PEER_PROPERTY, expected_subject,
+ &peer.properties[0]) == TSI_OK);
+ grpc_core::RefCountedPtr<grpc_auth_context> ctx =
+ grpc_ssl_peer_to_auth_context(&peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
+ GPR_ASSERT(ctx != nullptr);
+ GPR_ASSERT(check_property(ctx.get(), GRPC_X509_SUBJECT_PROPERTY_NAME,
+ expected_subject));
+ tsi_peer_destruct(&peer);
+ ctx.reset(DEBUG_LOCATION, "test");
+}
+
static const char* roots_for_override_api = "roots for override api";
static grpc_ssl_roots_override_result override_roots_success(
@@ -745,7 +708,7 @@ static void test_peer_alpn_check(void) {
}
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
test_unauthenticated_ssl_peer();
test_cn_only_ssl_peer_to_auth_context();
@@ -753,13 +716,14 @@ int main(int argc, char** argv) {
test_cn_and_multiple_sans_ssl_peer_to_auth_context();
test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context();
test_dns_peer_to_auth_context();
+ test_uri_peer_to_auth_context();
test_email_peer_to_auth_context();
test_ip_peer_to_auth_context();
test_spiffe_id_peer_to_auth_context();
+ test_subject_to_auth_context();
test_ipv6_address_san();
test_default_ssl_roots();
test_peer_alpn_check();
- test_check_security_level();
grpc_shutdown();
return 0;
}
diff --git a/grpc/test/core/security/ssl_credentials_test.cc b/grpc/test/core/security/ssl_credentials_test.cc
index 7c9f5616..1f6aec2d 100644
--- a/grpc/test/core/security/ssl_credentials_test.cc
+++ b/grpc/test/core/security/ssl_credentials_test.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
+
#include <stdio.h>
#include <string.h>
@@ -23,7 +25,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/security/credentials/ssl/ssl_credentials.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "test/core/util/test_config.h"
@@ -56,7 +58,7 @@ static void test_convert_grpc_to_tsi_cert_pairs() {
}
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
test_convert_grpc_to_tsi_cert_pairs();
diff --git a/grpc/test/core/security/ssl_server_fuzzer.cc b/grpc/test/core/security/ssl_server_fuzzer.cc
index 6401f8e2..db783109 100644
--- a/grpc/test/core/security/ssl_server_fuzzer.cc
+++ b/grpc/test/core/security/ssl_server_fuzzer.cc
@@ -59,11 +59,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
{
grpc_core::ExecCtx exec_ctx;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("ssl_server_fuzzer");
- grpc_endpoint* mock_endpoint =
- grpc_mock_endpoint_create(discard_write, resource_quota);
- grpc_resource_quota_unref_internal(resource_quota);
+ grpc_endpoint* mock_endpoint = grpc_mock_endpoint_create(discard_write);
grpc_mock_endpoint_put_read(
mock_endpoint, grpc_slice_from_copied_buffer((const char*)data, size));
@@ -93,7 +89,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
grpc_core::RefCountedPtr<grpc_server_security_connector> sc =
creds->create_security_connector(nullptr);
GPR_ASSERT(sc != nullptr);
- grpc_millis deadline = GPR_MS_PER_SEC + grpc_core::ExecCtx::Get()->Now();
+ grpc_core::Timestamp deadline =
+ grpc_core::Duration::Seconds(1) + grpc_core::ExecCtx::Get()->Now();
struct handshake_state state;
state.done_callback_called = false;
@@ -114,7 +111,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Explicit close"));
grpc_core::ExecCtx::Get()->Flush();
}
-
GPR_ASSERT(state.done_callback_called);
sc.reset(DEBUG_LOCATION, "test");
diff --git a/grpc/test/core/security/tls_security_connector_test.cc b/grpc/test/core/security/tls_security_connector_test.cc
index c041fd92..ab66282e 100644
--- a/grpc/test/core/security/tls_security_connector_test.cc
+++ b/grpc/test/core/security/tls_security_connector_test.cc
@@ -18,19 +18,22 @@
#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
+#include <stdlib.h>
+#include <string.h>
+
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <gtest/gtest.h>
-#include <stdlib.h>
-#include <string.h>
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
#include "src/core/lib/security/credentials/tls/tls_credentials.h"
#include "src/core/tsi/transport_security.h"
#include "test/core/util/test_config.h"
+#include "test/core/util/tls_utils.h"
#define CA_CERT_PATH "src/core/tsi/test_creds/ca.pem"
#define CLIENT_CERT_PATH "src/core/tsi/test_creds/multi-domain.pem"
@@ -39,17 +42,18 @@
#define SERVER_CERT_PATH_1 "src/core/tsi/test_creds/server1.pem"
#define SERVER_KEY_PATH_1 "src/core/tsi/test_creds/server1.key"
-namespace grpc {
+namespace grpc_core {
namespace testing {
constexpr const char* kRootCertName = "root_cert_name";
constexpr const char* kIdentityCertName = "identity_cert_name";
constexpr const char* kErrorMessage = "error_message";
-constexpr const char* kTargetName = "some_target";
+constexpr const char* kTargetName = "foo.bar.com:443";
class TlsSecurityConnectorTest : public ::testing::Test {
protected:
TlsSecurityConnectorTest() {}
+
void SetUp() override {
grpc_slice ca_slice_1, ca_slice_0, cert_slice_1, key_slice_1, cert_slice_0,
key_slice_0;
@@ -65,16 +69,14 @@ class TlsSecurityConnectorTest : public ::testing::Test {
"load_file", grpc_load_file(SERVER_CERT_PATH_0, 1, &cert_slice_0)));
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"load_file", grpc_load_file(SERVER_KEY_PATH_0, 1, &key_slice_0)));
- root_cert_1_ = std::string(grpc_core::StringViewFromSlice(ca_slice_1));
- root_cert_0_ = std::string(grpc_core::StringViewFromSlice(ca_slice_0));
- std::string identity_key_1 =
- std::string(grpc_core::StringViewFromSlice(key_slice_1));
- std::string identity_key_0 =
- std::string(grpc_core::StringViewFromSlice(key_slice_0));
+ root_cert_1_ = std::string(StringViewFromSlice(ca_slice_1));
+ root_cert_0_ = std::string(StringViewFromSlice(ca_slice_0));
+ std::string identity_key_1 = std::string(StringViewFromSlice(key_slice_1));
+ std::string identity_key_0 = std::string(StringViewFromSlice(key_slice_0));
std::string identity_cert_1 =
- std::string(grpc_core::StringViewFromSlice(cert_slice_1));
+ std::string(StringViewFromSlice(cert_slice_1));
std::string identity_cert_0 =
- std::string(grpc_core::StringViewFromSlice(cert_slice_0));
+ std::string(StringViewFromSlice(cert_slice_0));
identity_pairs_1_.emplace_back(identity_key_1, identity_cert_1);
identity_pairs_0_.emplace_back(identity_key_0, identity_cert_0);
grpc_slice_unref(ca_slice_1);
@@ -85,55 +87,80 @@ class TlsSecurityConnectorTest : public ::testing::Test {
grpc_slice_unref(key_slice_0);
}
- void TearDown() override {}
+ static void VerifyExpectedErrorCallback(void* arg, grpc_error_handle error) {
+ const char* expected_error_msg = static_cast<const char*>(arg);
+ if (expected_error_msg == nullptr) {
+ EXPECT_EQ(error, GRPC_ERROR_NONE);
+ } else {
+ EXPECT_EQ(GetErrorMsg(error), expected_error_msg);
+ }
+ }
+
+ static std::string GetErrorMsg(grpc_error_handle error) {
+ std::string error_str;
+ GPR_ASSERT(
+ grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &error_str));
+ return error_str;
+ }
std::string root_cert_1_;
std::string root_cert_0_;
- grpc_core::PemKeyCertPairList identity_pairs_1_;
- grpc_core::PemKeyCertPairList identity_pairs_0_;
+ PemKeyCertPairList identity_pairs_1_;
+ PemKeyCertPairList identity_pairs_0_;
+ HostNameCertificateVerifier hostname_certificate_verifier_;
};
-class TlsTestCertificateProvider : public ::grpc_tls_certificate_provider {
+class TlsTestCertificateProvider : public grpc_tls_certificate_provider {
public:
explicit TlsTestCertificateProvider(
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor)
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor)
: distributor_(std::move(distributor)) {}
~TlsTestCertificateProvider() override {}
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
- const override {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
return distributor_;
}
+ const char* type() const override { return "tls_test"; }
+
private:
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
+ int CompareImpl(const grpc_tls_certificate_provider* other) const override {
+ // TODO(yashykt): Maybe do something better here.
+ return QsortCompare(static_cast<const grpc_tls_certificate_provider*>(this),
+ other);
+ }
+
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
};
-// Tests for ChannelSecurityConnector.
+//
+// Tests for Certificate Providers in ChannelSecurityConnector.
+//
+
TEST_F(TlsSecurityConnectorTest,
RootAndIdentityCertsObtainedWhenCreateChannelSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsCredentials> credential =
- grpc_core::MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
grpc_channel_args* new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> connector =
+ RefCountedPtr<grpc_channel_security_connector> connector =
credential->create_security_connector(nullptr, kTargetName, nullptr,
&new_args);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(connector.get());
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_);
EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_);
@@ -149,46 +176,44 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
SystemRootsWhenCreateChannelSecurityConnector) {
// Create options watching for no certificates.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> root_options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
- grpc_core::RefCountedPtr<TlsCredentials> root_credential =
- grpc_core::MakeRefCounted<TlsCredentials>(root_options);
+ RefCountedPtr<grpc_tls_credentials_options> root_options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<TlsCredentials> root_credential =
+ MakeRefCounted<TlsCredentials>(root_options);
grpc_channel_args* root_new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> root_connector =
+ RefCountedPtr<grpc_channel_security_connector> root_connector =
root_credential->create_security_connector(nullptr, "some_target",
nullptr, &root_new_args);
EXPECT_NE(root_connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_root_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(
- root_connector.get());
+ TlsChannelSecurityConnector* tls_root_connector =
+ static_cast<TlsChannelSecurityConnector*>(root_connector.get());
EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr);
grpc_channel_args_destroy(root_new_args);
}
TEST_F(TlsSecurityConnectorTest,
SystemRootsAndIdentityCertsObtainedWhenCreateChannelSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
// Create options only watching for identity certificates.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> root_options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_credentials_options> root_options =
+ MakeRefCounted<grpc_tls_credentials_options>();
root_options->set_certificate_provider(provider);
root_options->set_watch_identity_pair(true);
root_options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsCredentials> root_credential =
- grpc_core::MakeRefCounted<TlsCredentials>(root_options);
+ RefCountedPtr<TlsCredentials> root_credential =
+ MakeRefCounted<TlsCredentials>(root_options);
grpc_channel_args* root_new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> root_connector =
+ RefCountedPtr<grpc_channel_security_connector> root_connector =
root_credential->create_security_connector(nullptr, "some_target",
nullptr, &root_new_args);
EXPECT_NE(root_connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_root_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(
- root_connector.get());
+ TlsChannelSecurityConnector* tls_root_connector =
+ static_cast<TlsChannelSecurityConnector*>(root_connector.get());
EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_root_connector->KeyCertPairListForTesting(), identity_pairs_0_);
// If we have a root update, we shouldn't receive them in security connector,
@@ -201,29 +226,28 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
RootCertsObtainedWhenCreateChannelSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
// Create options only watching for root certificates.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> root_options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_credentials_options> root_options =
+ MakeRefCounted<grpc_tls_credentials_options>();
root_options->set_certificate_provider(provider);
root_options->set_watch_root_cert(true);
root_options->set_root_cert_name(kRootCertName);
- grpc_core::RefCountedPtr<TlsCredentials> root_credential =
- grpc_core::MakeRefCounted<TlsCredentials>(root_options);
+ RefCountedPtr<TlsCredentials> root_credential =
+ MakeRefCounted<TlsCredentials>(root_options);
grpc_channel_args* root_new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> root_connector =
+ RefCountedPtr<grpc_channel_security_connector> root_connector =
root_credential->create_security_connector(nullptr, "some_target",
nullptr, &root_new_args);
EXPECT_NE(root_connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_root_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(
- root_connector.get());
+ TlsChannelSecurityConnector* tls_root_connector =
+ static_cast<TlsChannelSecurityConnector*>(root_connector.get());
EXPECT_NE(tls_root_connector->ClientHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_root_connector->RootCertsForTesting(), root_cert_0_);
distributor->SetKeyMaterials(kRootCertName, root_cert_1_, absl::nullopt);
@@ -234,29 +258,29 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
CertPartiallyObtainedWhenCreateChannelSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
// Registered the options watching both certs, but only root certs are
// available at distributor right now.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsCredentials> credential =
- grpc_core::MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
grpc_channel_args* new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> connector =
+ RefCountedPtr<grpc_channel_security_connector> connector =
credential->create_security_connector(nullptr, kTargetName, nullptr,
&new_args);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(connector.get());
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
// The client_handshaker_factory_ shouldn't be updated.
EXPECT_EQ(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_);
@@ -272,29 +296,29 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
DistributorHasErrorForChannelSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsCredentials> credential =
- grpc_core::MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
grpc_channel_args* new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> connector =
+ RefCountedPtr<grpc_channel_security_connector> connector =
credential->create_security_connector(nullptr, kTargetName, nullptr,
&new_args);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsChannelSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsChannelSecurityConnector*>(connector.get());
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_);
EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_);
@@ -314,12 +338,12 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
CreateChannelSecurityConnectorFailNoTargetName) {
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
- grpc_core::RefCountedPtr<TlsCredentials> credential =
- grpc_core::MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
grpc_channel_args* new_args = nullptr;
- grpc_core::RefCountedPtr<grpc_channel_security_connector> connector =
+ RefCountedPtr<grpc_channel_security_connector> connector =
credential->create_security_connector(nullptr, nullptr, nullptr,
&new_args);
EXPECT_EQ(connector, nullptr);
@@ -328,76 +352,418 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
CreateChannelSecurityConnectorFailNoCredentials) {
auto connector =
- grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
- nullptr, grpc_core::MakeRefCounted<grpc_tls_credentials_options>(),
- nullptr, kTargetName, nullptr, nullptr);
+ TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
+ nullptr, MakeRefCounted<grpc_tls_credentials_options>(), nullptr,
+ kTargetName, nullptr, nullptr);
EXPECT_EQ(connector, nullptr);
}
TEST_F(TlsSecurityConnectorTest, CreateChannelSecurityConnectorFailNoOptions) {
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
- grpc_core::RefCountedPtr<TlsCredentials> credential =
- grpc_core::MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
auto connector =
- grpc_core::TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
+ TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
credential, nullptr, nullptr, kTargetName, nullptr, nullptr);
EXPECT_EQ(connector, nullptr);
}
-TEST_F(TlsSecurityConnectorTest, TlsCheckHostNameSuccess) {
- const char* target_name = "foo.test.google.fr";
+//
+// Tests for Certificate Verifier in ChannelSecurityConnector.
+//
+
+TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorWithSyncExternalVerifierSucceeds) {
+ auto* sync_verifier_ = new SyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier_->base());
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ options->set_check_call_host(false);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a basic TSI Peer.
tsi_peer peer;
- GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, target_name,
- &peer.properties[0]) == TSI_OK);
- grpc_error_handle error =
- grpc_core::internal::TlsCheckHostName(target_name, &peer);
- tsi_peer_destruct(&peer);
- EXPECT_EQ(error, GRPC_ERROR_NONE);
- GRPC_ERROR_UNREF(error);
-}
-
-TEST_F(TlsSecurityConnectorTest, TlsCheckHostNameFail) {
- const char* target_name = "foo.test.google.fr";
- const char* another_name = "bar.test.google.fr";
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorWithSyncExternalVerifierFails) {
+ auto* sync_verifier_ = new SyncExternalVerifier(false);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier_->base());
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ options->set_check_call_host(false);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a basic TSI Peer.
tsi_peer peer;
- GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, another_name,
- &peer.properties[0]) == TSI_OK);
- grpc_error_handle error =
- grpc_core::internal::TlsCheckHostName(target_name, &peer);
- tsi_peer_destruct(&peer);
- EXPECT_NE(error, GRPC_ERROR_NONE);
- GRPC_ERROR_UNREF(error);
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ const char* expected_error_msg =
+ "Custom verification check failed with error: UNAUTHENTICATED: "
+ "SyncExternalVerifier failed";
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, const_cast<char*>(expected_error_msg),
+ grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ CompareChannelSecurityConnectorSucceedsOnSameCredentials) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_root_cert(true);
+ options->set_root_cert_name(kRootCertName);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ RefCountedPtr<grpc_channel_security_connector> other_connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ // Comparing the equality of security connectors generated from the same
+ // channel credentials with same settings should succeed.
+ EXPECT_EQ(connector->cmp(other_connector.get()), 0);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ CompareChannelSecurityConnectorFailsOnDifferentChannelCredentials) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_root_cert(true);
+ options->set_root_cert_name(kRootCertName);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ auto other_options = MakeRefCounted<grpc_tls_credentials_options>();
+ other_options->set_certificate_provider(provider);
+ other_options->set_watch_root_cert(true);
+ other_options->set_root_cert_name(kRootCertName);
+ other_options->set_watch_identity_pair(true);
+ RefCountedPtr<TlsCredentials> other_credential =
+ MakeRefCounted<TlsCredentials>(other_options);
+ RefCountedPtr<grpc_channel_security_connector> other_connector =
+ other_credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ // Comparing the equality of security connectors generated from different
+ // channel credentials should fail.
+ EXPECT_NE(connector->cmp(other_connector.get()), 0);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ CompareChannelSecurityConnectorFailsOnDifferentCallCredentials) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_root_cert(true);
+ options->set_root_cert_name(kRootCertName);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ grpc_call_credentials* call_creds =
+ grpc_md_only_test_credentials_create("", "");
+ RefCountedPtr<grpc_channel_security_connector> other_connector =
+ credential->create_security_connector(
+ RefCountedPtr<grpc_call_credentials>(call_creds), kTargetName,
+ nullptr, nullptr);
+ // Comparing the equality of security connectors generated with different call
+ // credentials should fail.
+ EXPECT_NE(connector->cmp(other_connector.get()), 0);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ CompareChannelSecurityConnectorFailsOnDifferentTargetNames) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_root_cert(true);
+ options->set_root_cert_name(kRootCertName);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ nullptr);
+ RefCountedPtr<grpc_channel_security_connector> other_connector =
+ credential->create_security_connector(nullptr, "", nullptr, nullptr);
+ // Comparing the equality of security connectors generated with different
+ // target names should fail.
+ EXPECT_NE(connector->cmp(other_connector.get()), 0);
}
// Tests for ServerSecurityConnector.
TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorWithAsyncExternalVerifierSucceeds) {
+ auto* async_verifier = new AsyncExternalVerifier(true);
+ auto* core_external_verifier =
+ new ExternalCertificateVerifier(async_verifier->base());
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(core_external_verifier->Ref());
+ options->set_check_call_host(false);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+ core_external_verifier->Unref();
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorWithAsyncExternalVerifierFails) {
+ auto* async_verifier = new AsyncExternalVerifier(false);
+ auto* core_external_verifier =
+ new ExternalCertificateVerifier(async_verifier->base());
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(core_external_verifier->Ref());
+ options->set_check_call_host(false);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ const char* expected_error_msg =
+ "Custom verification check failed with error: UNAUTHENTICATED: "
+ "AsyncExternalVerifier failed";
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, const_cast<char*>(expected_error_msg),
+ grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+ core_external_verifier->Unref();
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorHostnameVerifierSucceeds) {
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(hostname_certificate_verifier_.Ref());
+ options->set_check_call_host(false);
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a full TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(7, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
+ TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
+ &peer.properties[3]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
+ &peer.properties[4]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[5]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
+ &peer.properties[6]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ChannelSecurityConnectorHostnameVerifierFails) {
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_verify_server_cert(true);
+ options->set_certificate_verifier(hostname_certificate_verifier_.Ref());
+ RefCountedPtr<TlsCredentials> credential =
+ MakeRefCounted<TlsCredentials>(options);
+ grpc_channel_args* new_args = nullptr;
+ RefCountedPtr<grpc_channel_security_connector> connector =
+ credential->create_security_connector(nullptr, kTargetName, nullptr,
+ &new_args);
+ EXPECT_NE(connector, nullptr);
+ TlsChannelSecurityConnector* tls_connector =
+ static_cast<TlsChannelSecurityConnector*>(connector.get());
+ EXPECT_NE(tls_connector->ClientHandshakerFactoryForTesting(), nullptr);
+ // Construct a full TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(7, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.com",
+ &peer.properties[1]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
+ TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_SECURITY_LEVEL_PEER_PROPERTY,
+ tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
+ &peer.properties[3]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
+ &peer.properties[4]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "*.com",
+ &peer.properties[5]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
+ &peer.properties[6]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ const char* expected_error_msg =
+ "Custom verification check failed with error: UNAUTHENTICATED: Hostname "
+ "Verification "
+ "Check failed.";
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, const_cast<char*>(expected_error_msg),
+ grpc_schedule_on_exec_ctx);
+ tls_connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ grpc_channel_args_destroy(new_args);
+}
+
+//
+// Tests for Certificate Providers in ServerSecurityConnector.
+//
+
+TEST_F(TlsSecurityConnectorTest,
RootAndIdentityCertsObtainedWhenCreateServerSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsServerCredentials> credential =
- grpc_core::MakeRefCounted<TlsServerCredentials>(options);
- grpc_core::RefCountedPtr<grpc_server_security_connector> connector =
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> connector =
credential->create_security_connector(nullptr);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsServerSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsServerSecurityConnector*>(connector.get());
+ TlsServerSecurityConnector* tls_connector =
+ static_cast<TlsServerSecurityConnector*>(connector.get());
EXPECT_NE(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_);
EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_);
@@ -415,27 +781,26 @@ TEST_F(TlsSecurityConnectorTest,
// will hence fail on some systems.
TEST_F(TlsSecurityConnectorTest,
IdentityCertsObtainedWhenCreateServerSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
// Create options only watching for identity certificates.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> identity_options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_credentials_options> identity_options =
+ MakeRefCounted<grpc_tls_credentials_options>();
identity_options->set_certificate_provider(provider);
identity_options->set_watch_identity_pair(true);
identity_options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsServerCredentials> identity_credential =
- grpc_core::MakeRefCounted<TlsServerCredentials>(identity_options);
- grpc_core::RefCountedPtr<grpc_server_security_connector> identity_connector =
+ RefCountedPtr<TlsServerCredentials> identity_credential =
+ MakeRefCounted<TlsServerCredentials>(identity_options);
+ RefCountedPtr<grpc_server_security_connector> identity_connector =
identity_credential->create_security_connector(nullptr);
EXPECT_NE(identity_connector, nullptr);
- grpc_core::TlsServerSecurityConnector* tls_identity_connector =
- static_cast<grpc_core::TlsServerSecurityConnector*>(
- identity_connector.get());
+ TlsServerSecurityConnector* tls_identity_connector =
+ static_cast<TlsServerSecurityConnector*>(identity_connector.get());
EXPECT_NE(tls_identity_connector->ServerHandshakerFactoryForTesting(),
nullptr);
EXPECT_EQ(tls_identity_connector->KeyCertPairListForTesting(),
@@ -450,28 +815,28 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
CertPartiallyObtainedWhenCreateServerSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
// Registered the options watching both certs, but only root certs are
// available at distributor right now.
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsServerCredentials> credential =
- grpc_core::MakeRefCounted<TlsServerCredentials>(options);
- grpc_core::RefCountedPtr<grpc_server_security_connector> connector =
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> connector =
credential->create_security_connector(nullptr);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsServerSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsServerSecurityConnector*>(connector.get());
+ TlsServerSecurityConnector* tls_connector =
+ static_cast<TlsServerSecurityConnector*>(connector.get());
// The server_handshaker_factory_ shouldn't be updated.
EXPECT_EQ(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_);
@@ -485,27 +850,27 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
DistributorHasErrorForServerSecurityConnector) {
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor =
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>();
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
distributor->SetKeyMaterials(kRootCertName, root_cert_0_, absl::nullopt);
distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
identity_pairs_0_);
- grpc_core::RefCountedPtr<::grpc_tls_certificate_provider> provider =
- grpc_core::MakeRefCounted<TlsTestCertificateProvider>(distributor);
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
options->set_certificate_provider(provider);
options->set_watch_root_cert(true);
options->set_watch_identity_pair(true);
options->set_root_cert_name(kRootCertName);
options->set_identity_cert_name(kIdentityCertName);
- grpc_core::RefCountedPtr<TlsServerCredentials> credential =
- grpc_core::MakeRefCounted<TlsServerCredentials>(options);
- grpc_core::RefCountedPtr<grpc_server_security_connector> connector =
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> connector =
credential->create_security_connector(nullptr);
EXPECT_NE(connector, nullptr);
- grpc_core::TlsServerSecurityConnector* tls_connector =
- static_cast<grpc_core::TlsServerSecurityConnector*>(connector.get());
+ TlsServerSecurityConnector* tls_connector =
+ static_cast<TlsServerSecurityConnector*>(connector.get());
EXPECT_NE(tls_connector->ServerHandshakerFactoryForTesting(), nullptr);
EXPECT_EQ(tls_connector->RootCertsForTesting(), root_cert_0_);
EXPECT_EQ(tls_connector->KeyCertPairListForTesting(), identity_pairs_0_);
@@ -524,28 +889,209 @@ TEST_F(TlsSecurityConnectorTest,
TEST_F(TlsSecurityConnectorTest,
CreateServerSecurityConnectorFailNoCredentials) {
- auto connector =
- grpc_core::TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
- nullptr, grpc_core::MakeRefCounted<grpc_tls_credentials_options>());
+ auto connector = TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
+ nullptr, MakeRefCounted<grpc_tls_credentials_options>());
EXPECT_EQ(connector, nullptr);
}
TEST_F(TlsSecurityConnectorTest, CreateServerSecurityConnectorFailNoOptions) {
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options =
- grpc_core::MakeRefCounted<grpc_tls_credentials_options>();
- grpc_core::RefCountedPtr<TlsServerCredentials> credential =
- grpc_core::MakeRefCounted<TlsServerCredentials>(options);
- auto connector =
- grpc_core::TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
- credential, nullptr);
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ auto connector = TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
+ credential, nullptr);
EXPECT_EQ(connector, nullptr);
}
+TEST_F(TlsSecurityConnectorTest,
+ CompareServerSecurityConnectorSucceedsOnSameCredentials) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
+ identity_pairs_0_);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_identity_pair(true);
+ options->set_identity_cert_name(kIdentityCertName);
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> connector =
+ credential->create_security_connector(nullptr);
+ RefCountedPtr<grpc_server_security_connector> other_connector =
+ credential->create_security_connector(nullptr);
+ // Comparing the equality of security connectors generated from the same
+ // server credentials with same settings should succeed.
+ EXPECT_EQ(connector->cmp(other_connector.get()), 0);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ CompareServerSecurityConnectorFailsOnDifferentServerCredentials) {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor =
+ MakeRefCounted<grpc_tls_certificate_distributor>();
+ distributor->SetKeyMaterials(kIdentityCertName, absl::nullopt,
+ identity_pairs_0_);
+ RefCountedPtr<grpc_tls_certificate_provider> provider =
+ MakeRefCounted<TlsTestCertificateProvider>(distributor);
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_certificate_provider(provider);
+ options->set_watch_identity_pair(true);
+ options->set_identity_cert_name(kIdentityCertName);
+ RefCountedPtr<TlsServerCredentials> credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> connector =
+ credential->create_security_connector(nullptr);
+ RefCountedPtr<TlsServerCredentials> other_credential =
+ MakeRefCounted<TlsServerCredentials>(options);
+ RefCountedPtr<grpc_server_security_connector> other_connector =
+ other_credential->create_security_connector(nullptr);
+ // Comparing the equality of security connectors generated from different
+ // server credentials should fail.
+ EXPECT_NE(connector->cmp(other_connector.get()), 0);
+}
+
+//
+// Tests for Certificate Verifier in ServerSecurityConnector.
+//
+
+TEST_F(TlsSecurityConnectorTest,
+ ServerSecurityConnectorWithSyncExternalVerifierSucceeds) {
+ auto* sync_verifier = new SyncExternalVerifier(true);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier->base());
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ auto provider =
+ MakeRefCounted<StaticDataCertificateProvider>("", PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ auto connector = credentials->create_security_connector(nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx);
+ connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ServerSecurityConnectorWithSyncExternalVerifierFails) {
+ auto* sync_verifier = new SyncExternalVerifier(false);
+ ExternalCertificateVerifier core_external_verifier(sync_verifier->base());
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(core_external_verifier.Ref());
+ auto provider =
+ MakeRefCounted<StaticDataCertificateProvider>("", PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ auto connector = credentials->create_security_connector(nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ const char* expected_error_msg =
+ "Custom verification check failed with error: UNAUTHENTICATED: "
+ "SyncExternalVerifier failed";
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, const_cast<char*>(expected_error_msg),
+ grpc_schedule_on_exec_ctx);
+ connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ServerSecurityConnectorWithAsyncExternalVerifierSucceeds) {
+ auto* async_verifier = new AsyncExternalVerifier(true);
+ auto* core_external_verifier =
+ new ExternalCertificateVerifier(async_verifier->base());
+ auto options = MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(core_external_verifier->Ref());
+ auto provider =
+ MakeRefCounted<StaticDataCertificateProvider>("", PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ auto connector = credentials->create_security_connector(nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, nullptr, grpc_schedule_on_exec_ctx);
+ connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ core_external_verifier->Unref();
+}
+
+TEST_F(TlsSecurityConnectorTest,
+ ServerSecurityConnectorWithAsyncExternalVerifierFails) {
+ auto* async_verifier = new AsyncExternalVerifier(false);
+ auto* core_external_verifier =
+ new ExternalCertificateVerifier(async_verifier->base());
+ RefCountedPtr<grpc_tls_credentials_options> options =
+ MakeRefCounted<grpc_tls_credentials_options>();
+ options->set_cert_request_type(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
+ options->set_certificate_verifier(core_external_verifier->Ref());
+ auto provider =
+ MakeRefCounted<StaticDataCertificateProvider>("", PemKeyCertPairList());
+ options->set_certificate_provider(std::move(provider));
+ options->set_watch_identity_pair(true);
+ auto credentials = MakeRefCounted<TlsServerCredentials>(options);
+ auto connector = credentials->create_security_connector(nullptr);
+ // Construct a basic TSI Peer.
+ tsi_peer peer;
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
+ "grpc", strlen("grpc"),
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
+ &peer.properties[1]) == TSI_OK);
+ RefCountedPtr<grpc_auth_context> auth_context;
+ const char* expected_error_msg =
+ "Custom verification check failed with error: UNAUTHENTICATED: "
+ "AsyncExternalVerifier failed";
+ ExecCtx exec_ctx;
+ grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
+ VerifyExpectedErrorCallback, const_cast<char*>(expected_error_msg),
+ grpc_schedule_on_exec_ctx);
+ connector->check_peer(peer, nullptr, &auth_context, on_peer_checked);
+ core_external_verifier->Unref();
+}
+
} // namespace testing
-} // namespace grpc
+} // namespace grpc_core
int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
diff --git a/grpc/test/core/security/verify_jwt.cc b/grpc/test/core/security/verify_jwt.cc
index bf951b47..8dd7e65e 100644
--- a/grpc/test/core/security/verify_jwt.cc
+++ b/grpc/test/core/security/verify_jwt.cc
@@ -101,7 +101,8 @@ int main(int argc, char** argv) {
grpc_pollset_worker* worker = nullptr;
if (!GRPC_LOG_IF_ERROR(
"pollset_work",
- grpc_pollset_work(sync.pollset, &worker, GRPC_MILLIS_INF_FUTURE))) {
+ grpc_pollset_work(sync.pollset, &worker,
+ grpc_core::Timestamp::InfFuture()))) {
sync.is_done = true;
}
gpr_mu_unlock(sync.mu);
diff --git a/grpc/test/core/security/xds_credentials_test.cc b/grpc/test/core/security/xds_credentials_test.cc
index c055972a..280d6ac0 100644
--- a/grpc/test/core/security/xds_credentials_test.cc
+++ b/grpc/test/core/security/xds_credentials_test.cc
@@ -289,6 +289,29 @@ TEST(XdsSanMatchingTest, RegexMatch) {
sans.data(), sans.size(), {SafeRegexMatcher("(abc|xyz).example.com")}));
}
+TEST(XdsCertificateVerifierTest, CompareSuccess) {
+ XdsCertificateVerifier verifier_1(nullptr, "");
+ XdsCertificateVerifier verifier_2(nullptr, "");
+ EXPECT_EQ(verifier_1.Compare(&verifier_2), 0);
+ EXPECT_EQ(verifier_2.Compare(&verifier_1), 0);
+}
+
+TEST(XdsCertificateVerifierTest, CompareFailureDifferentCertificateProviders) {
+ XdsCertificateVerifier verifier_1(MakeRefCounted<XdsCertificateProvider>(),
+ "");
+ XdsCertificateVerifier verifier_2(MakeRefCounted<XdsCertificateProvider>(),
+ "");
+ EXPECT_NE(verifier_1.Compare(&verifier_2), 0);
+ EXPECT_NE(verifier_2.Compare(&verifier_1), 0);
+}
+
+TEST(XdsCertificateVerifierTest, CompareFailureDifferentClusterNames) {
+ XdsCertificateVerifier verifier_1(nullptr, "cluster1");
+ XdsCertificateVerifier verifier_2(nullptr, "cluster2");
+ EXPECT_NE(verifier_1.Compare(&verifier_2), 0);
+ EXPECT_NE(verifier_2.Compare(&verifier_1), 0);
+}
+
} // namespace
} // namespace testing
@@ -296,7 +319,7 @@ TEST(XdsSanMatchingTest, RegexMatch) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
- grpc::testing::TestEnvironment env(argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
auto result = RUN_ALL_TESTS();
grpc_shutdown();
diff --git a/grpc/test/core/util/cmdline.cc b/grpc/test/core/util/cmdline.cc
index 23e52e6f..182370a2 100644
--- a/grpc/test/core/util/cmdline.cc
+++ b/grpc/test/core/util/cmdline.cc
@@ -31,7 +31,9 @@
#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/memory.h"
typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;
@@ -62,7 +64,7 @@ struct gpr_cmdline {
static int normal_state(gpr_cmdline* cl, char* str);
gpr_cmdline* gpr_cmdline_create(const char* description) {
- gpr_cmdline* cl = static_cast<gpr_cmdline*>(gpr_zalloc(sizeof(gpr_cmdline)));
+ gpr_cmdline* cl = grpc_core::Zalloc<gpr_cmdline>();
cl->description = description;
cl->state = normal_state;
diff --git a/grpc/test/distrib/bazel/cpp/BUILD b/grpc/test/distrib/bazel/cpp/BUILD
new file mode 100644
index 00000000..0869e63f
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/BUILD
@@ -0,0 +1,43 @@
+# Copyright 2022 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.
+
+licenses(["notice"])
+
+cc_binary(
+ name = "greeter_client",
+ srcs = ["greeter_client.cc"],
+ deps = [
+ "//protos:helloworld_cc_grpc",
+ "@com_github_grpc_grpc//:grpc++",
+ ],
+)
+
+cc_binary(
+ name = "greeter_server",
+ srcs = ["greeter_server.cc"],
+ deps = [
+ "//protos:helloworld_cc_grpc",
+ "@com_github_grpc_grpc//:grpc++",
+ "@com_github_grpc_grpc//:grpc++_reflection",
+ ],
+)
+
+sh_test(
+ name = "greeter_test",
+ srcs = ["greeter_test.sh"],
+ data = [
+ ":greeter_client",
+ ":greeter_server",
+ ],
+)
diff --git a/grpc/test/distrib/bazel/cpp/WORKSPACE b/grpc/test/distrib/bazel/cpp/WORKSPACE
new file mode 100644
index 00000000..4b764408
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/WORKSPACE
@@ -0,0 +1,27 @@
+# Copyright 2022 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_repository(
+ name = "com_github_grpc_grpc",
+ path = "../../../..",
+)
+
+workspace(name = "bazel_cpp_distribtests")
+
+load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
+
+grpc_deps()
+
+load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
+
+grpc_extra_deps()
diff --git a/grpc/test/distrib/bazel/cpp/greeter_client.cc b/grpc/test/distrib/bazel/cpp/greeter_client.cc
new file mode 100644
index 00000000..75597c1f
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/greeter_client.cc
@@ -0,0 +1,104 @@
+/*
+ *
+ * Copyright 2022 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.
+ *
+ */
+
+#include <iostream>
+#include <memory>
+#include <string>
+
+#include <grpcpp/grpcpp.h>
+
+#include "protos/helloworld.grpc.pb.h"
+
+using grpc::Channel;
+using grpc::ClientContext;
+using grpc::Status;
+using helloworld::Greeter;
+using helloworld::HelloReply;
+using helloworld::HelloRequest;
+
+class GreeterClient {
+ public:
+ GreeterClient(std::shared_ptr<Channel> channel)
+ : stub_(Greeter::NewStub(channel)) {}
+
+ // Assembles the client's payload, sends it and presents the response back
+ // from the server.
+ std::string SayHello(const std::string& user) {
+ // Data we are sending to the server.
+ HelloRequest request;
+ request.set_name(user);
+
+ // Container for the data we expect from the server.
+ HelloReply reply;
+
+ // Context for the client. It could be used to convey extra information to
+ // the server and/or tweak certain RPC behaviors.
+ ClientContext context;
+
+ // The actual RPC.
+ Status status = stub_->SayHello(&context, request, &reply);
+
+ // Act upon its status.
+ if (status.ok()) {
+ return reply.message();
+ } else {
+ std::cout << status.error_code() << ": " << status.error_message()
+ << std::endl;
+ return "RPC failed";
+ }
+ }
+
+ private:
+ std::unique_ptr<Greeter::Stub> stub_;
+};
+
+int main(int argc, char** argv) {
+ // Instantiate the client. It requires a channel, out of which the actual RPCs
+ // are created. This channel models a connection to an endpoint specified by
+ // the argument "--target=" which is the only expected argument.
+ // We indicate that the channel isn't authenticated (use of
+ // InsecureChannelCredentials()).
+ std::string target_str;
+ std::string arg_str("--target");
+ if (argc > 1) {
+ std::string arg_val = argv[1];
+ size_t start_pos = arg_val.find(arg_str);
+ if (start_pos != std::string::npos) {
+ start_pos += arg_str.size();
+ if (arg_val[start_pos] == '=') {
+ target_str = arg_val.substr(start_pos + 1);
+ } else {
+ std::cout << "The only correct argument syntax is --target="
+ << std::endl;
+ return 0;
+ }
+ } else {
+ std::cout << "The only acceptable argument is --target=" << std::endl;
+ return 0;
+ }
+ } else {
+ target_str = "localhost:50051";
+ }
+ GreeterClient greeter(
+ grpc::CreateChannel(target_str, grpc::InsecureChannelCredentials()));
+ std::string user("world");
+ std::string reply = greeter.SayHello(user);
+ std::cout << "Greeter received: " << reply << std::endl;
+
+ return 0;
+}
diff --git a/grpc/test/distrib/bazel/cpp/greeter_server.cc b/grpc/test/distrib/bazel/cpp/greeter_server.cc
new file mode 100644
index 00000000..f42c9b8b
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/greeter_server.cc
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright 2022 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.
+ *
+ */
+
+#include <iostream>
+#include <memory>
+#include <string>
+
+#include <grpcpp/ext/proto_server_reflection_plugin.h>
+#include <grpcpp/grpcpp.h>
+#include <grpcpp/health_check_service_interface.h>
+
+#include "protos/helloworld.grpc.pb.h"
+
+using grpc::Server;
+using grpc::ServerBuilder;
+using grpc::ServerContext;
+using grpc::Status;
+using helloworld::Greeter;
+using helloworld::HelloReply;
+using helloworld::HelloRequest;
+
+// Logic and data behind the server's behavior.
+class GreeterServiceImpl final : public Greeter::Service {
+ Status SayHello(ServerContext* context, const HelloRequest* request,
+ HelloReply* reply) override {
+ std::string prefix("Hello ");
+ reply->set_message(prefix + request->name());
+ return Status::OK;
+ }
+};
+
+void RunServer() {
+ std::string server_address("0.0.0.0:0");
+ GreeterServiceImpl service;
+
+ grpc::EnableDefaultHealthCheckService(true);
+ grpc::reflection::InitProtoReflectionServerBuilderPlugin();
+ ServerBuilder builder;
+ // Listen on the given address without any authentication mechanism.
+ int bound_port;
+ builder.AddListeningPort(server_address, grpc::InsecureServerCredentials(), &bound_port);
+ // Register "service" as the instance through which we'll communicate with
+ // clients. In this case it corresponds to an *synchronous* service.
+ builder.RegisterService(&service);
+ // Finally assemble the server.
+ std::unique_ptr<Server> server(builder.BuildAndStart());
+ std::cout << "127.0.0.1:" << bound_port << std::endl;
+
+ // Wait for the server to shutdown. Note that some other thread must be
+ // responsible for shutting down the server for this call to ever return.
+ server->Wait();
+}
+
+int main(int argc, char** argv) {
+ RunServer();
+
+ return 0;
+}
diff --git a/grpc/test/distrib/bazel/cpp/greeter_test.sh b/grpc/test/distrib/bazel/cpp/greeter_test.sh
new file mode 100755
index 00000000..92f6233e
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/greeter_test.sh
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# Copyright 2022 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.
+
+set -exo pipefail
+
+SERVER_PID=""
+SERVER_TIMEOUT=10
+
+SERVER_OUTPUT=$(mktemp)
+
+function cleanup() {
+ if [ -n "$SERVER_PID" ]; then
+ kill "$SERVER_PID"
+ fi
+}
+
+function fail() {
+ echo "$1" >/dev/stderr
+ echo "Failed." >/dev/stderr
+ exit 1
+}
+
+function await_server() {
+ TIME=0
+ while [ ! -s "$SERVER_OUTPUT" ]; do
+ if [ "$TIME" == "$SERVER_TIMEOUT" ] ; then
+ fail "Server not listening after $SERVER_TIMEOUT seconds."
+ fi
+ sleep 1
+ TIME=$((TIME+1))
+ done
+ cat "$SERVER_OUTPUT"
+}
+
+trap cleanup SIGINT SIGTERM EXIT
+
+./greeter_server >"$SERVER_OUTPUT" &
+SERVER_PID=$!
+
+SERVER_ADDRESS=$(await_server)
+
+RESPONSE=$(./greeter_client --target="$SERVER_ADDRESS")
+EXPECTED_RESPONSE="Greeter received: Hello world"
+
+if [ "$RESPONSE" != "$EXPECTED_RESPONSE" ]; then
+ fail "Received response \"$RESPONSE\" but expected \"$EXPECTED_RESPONSE\""
+fi
+
+echo "Success."
diff --git a/grpc/test/distrib/bazel/cpp/protos/BUILD b/grpc/test/distrib/bazel/cpp/protos/BUILD
new file mode 100644
index 00000000..5923542b
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/protos/BUILD
@@ -0,0 +1,37 @@
+# Copyright 2022 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.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+
+licenses(["notice"])
+
+package(default_visibility = ["//:__subpackages__"])
+
+proto_library(
+ name = "helloworld_proto",
+ srcs = ["helloworld.proto"],
+)
+
+cc_proto_library(
+ name = "helloworld_cc_proto",
+ deps = [":helloworld_proto"],
+)
+
+cc_grpc_library(
+ name = "helloworld_cc_grpc",
+ srcs = [":helloworld_proto"],
+ grpc_only = True,
+ deps = [":helloworld_cc_proto"],
+)
diff --git a/grpc/test/distrib/bazel/cpp/protos/helloworld.proto b/grpc/test/distrib/bazel/cpp/protos/helloworld.proto
new file mode 100644
index 00000000..be878ce2
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/protos/helloworld.proto
@@ -0,0 +1,38 @@
+// 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.
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "io.grpc.examples.helloworld";
+option java_outer_classname = "HelloWorldProto";
+option objc_class_prefix = "HLW";
+
+package helloworld;
+
+// The greeting service definition.
+service Greeter {
+ // Sends a greeting
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+// The request message containing the user's name.
+message HelloRequest {
+ string name = 1;
+}
+
+// The response message containing the greetings
+message HelloReply {
+ string message = 1;
+}
diff --git a/grpc/test/distrib/bazel/cpp/tools/bazel b/grpc/test/distrib/bazel/cpp/tools/bazel
new file mode 100755
index 00000000..b2645c8a
--- /dev/null
+++ b/grpc/test/distrib/bazel/cpp/tools/bazel
@@ -0,0 +1,85 @@
+#!/bin/bash
+# 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.
+
+
+# Keeping up with Bazel's breaking changes is currently difficult.
+# This script wraps calling bazel by downloading the currently
+# supported version, and then calling it. This way, we can make sure
+# that running bazel will always get meaningful results, at least
+# until Bazel 1.0 is released.
+# NOTE: This script relies on bazel's feature where //tools/bazel
+# script can be used to hijack "bazel" invocations in given workspace.
+
+set -e
+
+# DISABLE_BAZEL_WRAPPER can be set to eliminate the wrapper logic
+if [ "${DISABLE_BAZEL_WRAPPER}" != "" ] && [ "${OVERRIDE_BAZEL_VERSION}" == "" ]
+then
+ if [ "${BAZEL_REAL}" != "" ]
+ then
+ # use BAZEL_REAL as set by
+ # https://github.com/bazelbuild/bazel/blob/master/scripts/packages/bazel.sh
+ # that originally invoked this script (this is what happens when you
+ # run "bazel" in our workspace)
+ exec -a "$0" "${BAZEL_REAL}" "$@"
+ else
+ # if BAZEL_REAL is not set, just invoke the default system bazel
+ exec bazel "$@"
+ fi
+fi
+
+# IMPORTANT: if you update the version here, other parts of infrastructure might needs updating as well
+# (e.g. sanity checks, bazel toolchains etc.)
+VERSION=${OVERRIDE_BAZEL_VERSION:-4.2.1}
+echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." >&2
+
+# update tools/update_mirror.sh to populate the mirror with new bazel archives
+BASEURL_MIRROR="https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel/releases/download"
+BASEURL="https://github.com/bazelbuild/bazel/releases/download"
+pushd "$(dirname "$0")" >/dev/null
+# bazel binary will be downloaded to GRPC_REPO_ROOT/tools directory by default
+DOWNLOAD_DIR=${OVERRIDE_BAZEL_WRAPPER_DOWNLOAD_DIR:-$(pwd)}
+
+case $(uname -sm) in
+ "Linux x86_64")
+ suffix=linux-x86_64
+ ;;
+ "Linux aarch64")
+ suffix=linux-arm64
+ ;;
+ "Darwin x86_64")
+ suffix=darwin-x86_64
+ ;;
+ "MINGW"* | "MSYS_NT"*)
+ suffix=windows-x86_64.exe
+ ;;
+ *)
+ echo "Unsupported architecture: $(uname -sm)" >&2
+ exit 1
+ ;;
+esac
+
+filename="bazel-$VERSION-$suffix"
+filename_abs="${DOWNLOAD_DIR}/${filename}"
+
+if [ ! -x "${filename_abs}" ] ; then
+ # first try to download using mirror, fallback to download from github
+ echo "Downloading bazel, will try URLs: ${BASEURL_MIRROR}/${VERSION}/${filename} ${BASEURL}/${VERSION}/${filename}" >&2
+ curl --fail -L --output "${filename_abs}" "${BASEURL_MIRROR}/${VERSION}/${filename}" || curl --fail -L --output "${filename_abs}" "${BASEURL}/${VERSION}/${filename}"
+ chmod a+x "${filename_abs}"
+fi
+
+popd >/dev/null
+exec "${filename_abs}" "$@"
diff --git a/grpc/bazel/test/python_test_repo/.gitignore b/grpc/test/distrib/bazel/python/.gitignore
index 7146a250..7146a250 100644
--- a/grpc/bazel/test/python_test_repo/.gitignore
+++ b/grpc/test/distrib/bazel/python/.gitignore
diff --git a/grpc/test/distrib/bazel/python/BUILD b/grpc/test/distrib/bazel/python/BUILD
new file mode 100644
index 00000000..127a4356
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/BUILD
@@ -0,0 +1,157 @@
+# gRPC Bazel BUILD file.
+#
+# 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.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load(
+ "@com_github_grpc_grpc//bazel:python_rules.bzl",
+ "py_grpc_library",
+ "py_proto_library",
+)
+
+package(
+ default_testonly = 1,
+)
+
+proto_library(
+ name = "helloworld_proto",
+ srcs = ["helloworld.proto"],
+ deps = [
+ ":hello_dep_proto",
+ "@com_google_protobuf//:duration_proto",
+ "@com_google_protobuf//:timestamp_proto",
+ ],
+)
+
+# Test that .proto files can be located in strict subdiretories of the package.
+proto_library(
+ name = "hello_dep_proto",
+ srcs = ["subdir/hello_dep.proto"],
+)
+
+py_proto_library(
+ name = "helloworld_py_pb2",
+ deps = [":helloworld_proto"],
+)
+
+py_grpc_library(
+ name = "helloworld_py_pb2_grpc",
+ srcs = [":helloworld_proto"],
+ deps = [":helloworld_py_pb2"],
+)
+
+py_proto_library(
+ name = "duration_py_pb2",
+ deps = ["@com_google_protobuf//:duration_proto"],
+)
+
+py_proto_library(
+ name = "timestamp_py_pb2",
+ deps = ["@com_google_protobuf//:timestamp_proto"],
+)
+
+py_test(
+ name = "import_test",
+ srcs = ["helloworld.py"],
+ main = "helloworld.py",
+ python_version = "PY3",
+ deps = [
+ ":duration_py_pb2",
+ ":helloworld_py_pb2",
+ ":helloworld_py_pb2_grpc",
+ ":timestamp_py_pb2",
+ ],
+)
+
+# Test compatibility of py_proto_library and py_grpc_library rules with
+# proto_library targets as deps when the latter use import_prefix and/or
+# strip_import_prefix arguments
+#
+# See namespaced/upper/example for more encompassing tests.
+proto_library(
+ name = "helloworld_moved_proto",
+ srcs = ["helloworld.proto"],
+ import_prefix = "google/cloud",
+ strip_import_prefix = "",
+ deps = [
+ ":hello_dep_proto",
+ "@com_google_protobuf//:duration_proto",
+ "@com_google_protobuf//:timestamp_proto",
+ ],
+)
+
+py_proto_library(
+ name = "helloworld_moved_py_pb2",
+ deps = [":helloworld_moved_proto"],
+)
+
+py_grpc_library(
+ name = "helloworld_moved_py_pb2_grpc",
+ srcs = [":helloworld_moved_proto"],
+ deps = [":helloworld_moved_py_pb2"],
+)
+
+py_test(
+ name = "import_moved_test",
+ srcs = ["helloworld_moved.py"],
+ main = "helloworld_moved.py",
+ python_version = "PY3",
+ deps = [
+ ":duration_py_pb2",
+ ":helloworld_moved_py_pb2",
+ ":helloworld_moved_py_pb2_grpc",
+ ":timestamp_py_pb2",
+ ],
+)
+
+# Test that a py_proto_library wrapping a proto_library in another package can
+# be imported from the package that contains the py_proto_library *AND* from
+# the package that contains the proto_library.
+py_proto_library(
+ name = "subpackage_py_pb2",
+ deps = ["//in_subpackage:subpackage_proto"],
+)
+
+py_test(
+ name = "import_from_this_package_subpackage_test",
+ srcs = ["import_from_this_package.py"],
+ main = "import_from_this_package.py",
+ python_version = "PY3",
+ deps = [
+ ":subpackage_py_pb2",
+ ],
+)
+
+py_test(
+ name = "import_from_proto_library_package_test",
+ srcs = ["import_from_proto_library_package.py"],
+ main = "import_from_proto_library_package.py",
+ python_version = "PY3",
+ deps = [
+ ":subpackage_py_pb2",
+ ],
+)
+
+# Test that a py_proto_library can be successfully imported without requiring
+# explicit dependencies on unused dependencies of the generated code.
+py_test(
+ name = "transitive_proto_dep_test",
+ srcs = ["transitive_proto_dep.py"],
+ main = "transitive_proto_dep.py",
+ python_version = "PY3",
+ deps = [
+ ":helloworld_py_pb2",
+ ],
+)
diff --git a/grpc/bazel/test/python_test_repo/README.md b/grpc/test/distrib/bazel/python/README.md
index d9dfd1d9..d9dfd1d9 100644
--- a/grpc/bazel/test/python_test_repo/README.md
+++ b/grpc/test/distrib/bazel/python/README.md
diff --git a/grpc/test/distrib/bazel/python/WORKSPACE b/grpc/test/distrib/bazel/python/WORKSPACE
new file mode 100644
index 00000000..e8120154
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/WORKSPACE
@@ -0,0 +1,22 @@
+# TODO: Move to test/distrib/python.
+
+local_repository(
+ name = "com_github_grpc_grpc",
+ path = "../../../..",
+)
+
+# Ensure rules don't rely on __main__ naming convention.
+workspace(name = "python_test_repo")
+
+load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
+
+grpc_deps()
+
+load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
+
+grpc_extra_deps()
+
+local_repository(
+ name = "some_other_repo",
+ path = "../python_second_test_repo",
+)
diff --git a/grpc/test/distrib/bazel/python/helloworld.proto b/grpc/test/distrib/bazel/python/helloworld.proto
new file mode 100644
index 00000000..d9cb0b53
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/helloworld.proto
@@ -0,0 +1,46 @@
+// 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.
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "io.grpc.examples.helloworld";
+option java_outer_classname = "HelloWorldProto";
+option objc_class_prefix = "HLW";
+
+package helloworld;
+
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/duration.proto";
+import "subdir/hello_dep.proto";
+
+// The greeting service definition.
+service Greeter {
+ // Sends a greeting
+ rpc SayHello (HelloRequest) returns (HelloReply) {}
+}
+
+// The request message containing the user's name.
+message HelloRequest {
+ string name = 1;
+ google.protobuf.Timestamp request_initiation = 2;
+}
+
+// The response message containing the greetings, plus some additional
+// data of a type defined in a separate .proto file.
+message HelloReply {
+ string message = 1;
+ google.protobuf.Duration request_duration = 2;
+ HelloDep dep = 3;
+}
diff --git a/grpc/test/distrib/bazel/python/helloworld.py b/grpc/test/distrib/bazel/python/helloworld.py
new file mode 100644
index 00000000..496f75e3
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/helloworld.py
@@ -0,0 +1,76 @@
+# 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 Python implementation of the GRPC helloworld.Greeter client."""
+
+from concurrent import futures
+import contextlib
+import datetime
+import logging
+import unittest
+
+from google.protobuf import duration_pb2
+from google.protobuf import timestamp_pb2
+import grpc
+import helloworld_pb2
+import helloworld_pb2_grpc
+
+_HOST = 'localhost'
+_SERVER_ADDRESS = '{}:0'.format(_HOST)
+
+
+class Greeter(helloworld_pb2_grpc.GreeterServicer):
+
+ def SayHello(self, request, context):
+ request_in_flight = datetime.datetime.now() - \
+ request.request_initiation.ToDatetime()
+ request_duration = duration_pb2.Duration()
+ request_duration.FromTimedelta(request_in_flight)
+ return helloworld_pb2.HelloReply(
+ message='Hello, %s!' % request.name,
+ request_duration=request_duration,
+ )
+
+
+@contextlib.contextmanager
+def _listening_server():
+ server = grpc.server(futures.ThreadPoolExecutor())
+ helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
+ port = server.add_insecure_port(_SERVER_ADDRESS)
+ server.start()
+ try:
+ yield port
+ finally:
+ server.stop(0)
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ with _listening_server() as port:
+ with grpc.insecure_channel('{}:{}'.format(_HOST, port)) as channel:
+ stub = helloworld_pb2_grpc.GreeterStub(channel)
+ request_timestamp = timestamp_pb2.Timestamp()
+ request_timestamp.GetCurrentTime()
+ response = stub.SayHello(helloworld_pb2.HelloRequest(
+ name='you',
+ request_initiation=request_timestamp,
+ ),
+ wait_for_ready=True)
+ self.assertEqual(response.message, "Hello, you!")
+ self.assertGreater(response.request_duration.nanos, 0)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/test/distrib/bazel/python/helloworld_moved.py b/grpc/test/distrib/bazel/python/helloworld_moved.py
new file mode 100644
index 00000000..c9027358
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/helloworld_moved.py
@@ -0,0 +1,79 @@
+# 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 Python implementation of the GRPC helloworld.Greeter client."""
+
+from concurrent import futures
+import contextlib
+import datetime
+import logging
+import unittest
+
+# TODO(https://github.com/grpc/grpc/issues/29284)
+# isort: off
+import grpc
+from google.protobuf import duration_pb2
+from google.protobuf import timestamp_pb2
+from google.cloud import helloworld_pb2
+from google.cloud import helloworld_pb2_grpc
+# isort: on
+
+_HOST = 'localhost'
+_SERVER_ADDRESS = '{}:0'.format(_HOST)
+
+
+class Greeter(helloworld_pb2_grpc.GreeterServicer):
+
+ def SayHello(self, request, context):
+ request_in_flight = datetime.datetime.now() - \
+ request.request_initiation.ToDatetime()
+ request_duration = duration_pb2.Duration()
+ request_duration.FromTimedelta(request_in_flight)
+ return helloworld_pb2.HelloReply(
+ message='Hello, %s!' % request.name,
+ request_duration=request_duration,
+ )
+
+
+@contextlib.contextmanager
+def _listening_server():
+ server = grpc.server(futures.ThreadPoolExecutor())
+ helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
+ port = server.add_insecure_port(_SERVER_ADDRESS)
+ server.start()
+ try:
+ yield port
+ finally:
+ server.stop(0)
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ with _listening_server() as port:
+ with grpc.insecure_channel('{}:{}'.format(_HOST, port)) as channel:
+ stub = helloworld_pb2_grpc.GreeterStub(channel)
+ request_timestamp = timestamp_pb2.Timestamp()
+ request_timestamp.GetCurrentTime()
+ response = stub.SayHello(helloworld_pb2.HelloRequest(
+ name='you',
+ request_initiation=request_timestamp,
+ ),
+ wait_for_ready=True)
+ self.assertEqual(response.message, "Hello, you!")
+ self.assertGreater(response.request_duration.nanos, 0)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/test/distrib/bazel/python/import_from_proto_library_package.py b/grpc/test/distrib/bazel/python/import_from_proto_library_package.py
new file mode 100644
index 00000000..9a7e085c
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/import_from_proto_library_package.py
@@ -0,0 +1,18 @@
+# Copyright 2021 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 trivial executable that imports Protobuf generated code where the
+proto_library and py_proto_library are in different Bazel packages.
+"""
+
+import in_subpackage.subpackage_pb2
diff --git a/grpc/test/distrib/bazel/python/import_from_this_package.py b/grpc/test/distrib/bazel/python/import_from_this_package.py
new file mode 100644
index 00000000..1191ff2e
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/import_from_this_package.py
@@ -0,0 +1,18 @@
+# Copyright 2021 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 trivial executable that imports Protobuf generated code where the
+proto_library and py_proto_library are in different Bazel packages.
+"""
+
+import subpackage_pb2
diff --git a/grpc/test/distrib/bazel/python/in_subpackage/BUILD b/grpc/test/distrib/bazel/python/in_subpackage/BUILD
new file mode 100644
index 00000000..2b008c8b
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/in_subpackage/BUILD
@@ -0,0 +1,28 @@
+# gRPC Bazel BUILD file.
+#
+# Copyright 2021 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.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+package(
+ default_testonly = 1,
+ default_visibility = ["//:__subpackages__"],
+)
+
+proto_library(
+ name = "subpackage_proto",
+ srcs = ["subpackage.proto"],
+ deps = ["@some_other_repo//proto:my_proto"],
+)
diff --git a/grpc/test/distrib/bazel/python/in_subpackage/subpackage.proto b/grpc/test/distrib/bazel/python/in_subpackage/subpackage.proto
new file mode 100644
index 00000000..12cc1031
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/in_subpackage/subpackage.proto
@@ -0,0 +1,29 @@
+// Copyright 2021 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.
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "io.grpc.examples.subpackage";
+option java_outer_classname = "SubpackageProto";
+option objc_class_prefix = "SP";
+
+package subpackage;
+
+import "proto/my.proto";
+
+message Subpackaged {
+ string name = 1;
+ somewhere_else.MyMessage msg = 2;
+}
diff --git a/grpc/test/distrib/bazel/python/namespaced/upper/example/BUILD b/grpc/test/distrib/bazel/python/namespaced/upper/example/BUILD
new file mode 100644
index 00000000..2d610337
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/BUILD
@@ -0,0 +1,168 @@
+# gRPC Bazel BUILD file.
+#
+# 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.
+
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load(
+ "@com_github_grpc_grpc//bazel:python_rules.bzl",
+ "py_grpc_library",
+ "py_proto_library",
+)
+
+_IMPORT_PREFIX = "foo/bar"
+
+_STRIP_PREFIX = "/%s" % package_name()
+
+proto_library(
+ name = "import_no_strip_proto",
+ srcs = ["namespaced_example.proto"],
+ import_prefix = _IMPORT_PREFIX,
+ strip_import_prefix = None,
+)
+
+proto_library(
+ name = "import_strip_proto",
+ srcs = ["namespaced_example.proto"],
+ import_prefix = _IMPORT_PREFIX,
+ strip_import_prefix = _STRIP_PREFIX,
+)
+
+proto_library(
+ name = "no_import_no_strip_proto",
+ srcs = ["namespaced_example.proto"],
+ import_prefix = None,
+ strip_import_prefix = None,
+)
+
+proto_library(
+ name = "no_import_strip_proto",
+ srcs = ["namespaced_example.proto"],
+ import_prefix = None,
+ strip_import_prefix = _STRIP_PREFIX,
+)
+
+py_proto_library(
+ name = "import_no_strip_py_pb2",
+ deps = ["import_no_strip_proto"],
+)
+
+py_grpc_library(
+ name = "import_no_strip_py_pb2_grpc",
+ srcs = ["import_no_strip_proto"],
+ deps = ["import_no_strip_py_pb2"],
+)
+
+py_proto_library(
+ name = "import_strip_py_pb2",
+ deps = ["import_strip_proto"],
+)
+
+py_grpc_library(
+ name = "import_strip_py_pb2_grpc",
+ srcs = ["import_strip_proto"],
+ deps = ["import_strip_py_pb2"],
+)
+
+py_proto_library(
+ name = "no_import_no_strip_py_pb2",
+ deps = ["no_import_no_strip_proto"],
+)
+
+py_grpc_library(
+ name = "no_import_no_strip_py_pb2_grpc",
+ srcs = ["no_import_no_strip_proto"],
+ deps = ["no_import_no_strip_py_pb2"],
+)
+
+py_proto_library(
+ name = "no_import_strip_py_pb2",
+ deps = ["no_import_strip_proto"],
+)
+
+py_grpc_library(
+ name = "no_import_strip_py_pb2_grpc",
+ srcs = ["no_import_strip_proto"],
+ deps = ["no_import_strip_py_pb2"],
+)
+
+#################
+# Namespace Tests
+#################
+
+# Most examples with protos have all proto packages rooted at the workspace root. i.e. google/api has
+# a directory structure:
+# - WORKSPACE
+# - /google
+# - /api
+# - files.proto
+#
+# But if you can't anchor the protos at the root, you have to use strip and import prefixes. This results
+# in the following directory layout for python, which needs to properly be added to the imports.
+#
+# No Import or Strip (Can't compile if there are any proto dependencies)
+# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/namespaced_example_pb2.py
+#
+# No import Prefix (Can't compile if there are any proto dependencies)
+# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/namespaced_example_pb2.py
+#
+# No strip prefix (Can't compile if there are any proto dependencies)
+# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/upper/example/namespaced/upper/example/namespaced_example_pb2.py
+#
+# Both Import and Strip
+# bazel-out/darwin-fastbuild/bin/namespaced/upper/example/_virtual_imports/namespaced_example_proto/upper/example/namespaced_example_pb2.py
+
+py_test(
+ name = "import_no_strip_test",
+ srcs = ["import_no_strip_test.py"],
+ main = "import_no_strip_test.py",
+ python_version = "PY3",
+ deps = [
+ ":import_no_strip_py_pb2",
+ ":import_no_strip_py_pb2_grpc",
+ ],
+)
+
+py_test(
+ name = "import_strip_test",
+ srcs = ["import_strip_test.py"],
+ main = "import_strip_test.py",
+ python_version = "PY3",
+ deps = [
+ ":import_strip_py_pb2",
+ ":import_strip_py_pb2_grpc",
+ ],
+)
+
+py_test(
+ name = "no_import_no_strip_test",
+ srcs = ["no_import_no_strip_test.py"],
+ main = "no_import_no_strip_test.py",
+ python_version = "PY3",
+ deps = [
+ ":no_import_no_strip_py_pb2",
+ ":no_import_no_strip_py_pb2_grpc",
+ ],
+)
+
+py_test(
+ name = "no_import_strip_test",
+ srcs = ["no_import_strip_test.py"],
+ main = "no_import_strip_test.py",
+ python_version = "PY3",
+ deps = [
+ ":no_import_strip_py_pb2",
+ ":no_import_strip_py_pb2_grpc",
+ ],
+)
diff --git a/grpc/test/distrib/bazel/python/namespaced/upper/example/import_no_strip_test.py b/grpc/test/distrib/bazel/python/namespaced/upper/example/import_no_strip_test.py
new file mode 100644
index 00000000..f0c44539
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/import_no_strip_test.py
@@ -0,0 +1,39 @@
+# 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
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ from foo.bar.namespaced.upper.example.namespaced_example_pb2 import \
+ NamespacedExample
+ namespaced_example = NamespacedExample()
+ namespaced_example.value = "hello"
+ # Superfluous assert, important part is namespaced example was imported.
+ self.assertEqual(namespaced_example.value, "hello")
+
+ def test_grpc(self):
+ from foo.bar.namespaced.upper.example.namespaced_example_pb2_grpc import \
+ NamespacedServiceStub
+
+ # No error from import
+ self.assertEqual(1, 1)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/test/distrib/bazel/python/namespaced/upper/example/import_strip_test.py b/grpc/test/distrib/bazel/python/namespaced/upper/example/import_strip_test.py
new file mode 100644
index 00000000..1d0d14f4
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/import_strip_test.py
@@ -0,0 +1,37 @@
+# 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
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ from foo.bar.namespaced_example_pb2 import NamespacedExample
+ namespaced_example = NamespacedExample()
+ namespaced_example.value = "hello"
+ # Superfluous assert, important part is namespaced example was imported.
+ self.assertEqual(namespaced_example.value, "hello")
+
+ def test_grpc(self):
+ from foo.bar.namespaced_example_pb2_grpc import NamespacedServiceStub
+
+ # No error from import
+ self.assertEqual(1, 1)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_dependency.proto b/grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_dependency.proto
index 5820e1c5..5820e1c5 100644
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_dependency.proto
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_dependency.proto
diff --git a/grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_example.proto b/grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_example.proto
index 85061aae..85061aae 100644
--- a/grpc/bazel/test/python_test_repo/namespaced/upper/example/namespaced_example.proto
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/namespaced_example.proto
diff --git a/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_no_strip_test.py b/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_no_strip_test.py
new file mode 100644
index 00000000..6702e52e
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_no_strip_test.py
@@ -0,0 +1,39 @@
+# 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
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ from namespaced.upper.example.namespaced_example_pb2 import \
+ NamespacedExample
+ namespaced_example = NamespacedExample()
+ namespaced_example.value = "hello"
+ # Superfluous assert, important part is namespaced example was imported.
+ self.assertEqual(namespaced_example.value, "hello")
+
+ def test_grpc(self):
+ from namespaced.upper.example.namespaced_example_pb2_grpc import \
+ NamespacedServiceStub
+
+ # No error from import
+ self.assertEqual(1, 1)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_strip_test.py b/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_strip_test.py
new file mode 100644
index 00000000..8e756a04
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/namespaced/upper/example/no_import_strip_test.py
@@ -0,0 +1,37 @@
+# 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
+
+
+class ImportTest(unittest.TestCase):
+
+ def test_import(self):
+ from namespaced_example_pb2 import NamespacedExample
+ namespaced_example = NamespacedExample()
+ namespaced_example.value = "hello"
+ # Superfluous assert, important part is namespaced example was imported.
+ self.assertEqual(namespaced_example.value, "hello")
+
+ def test_grpc(self):
+ from namespaced_example_pb2_grpc import NamespacedServiceStub
+
+ # No error from import
+ self.assertEqual(1, 1)
+
+
+if __name__ == '__main__':
+ logging.basicConfig()
+ unittest.main()
diff --git a/grpc/test/distrib/bazel/python/subdir/hello_dep.proto b/grpc/test/distrib/bazel/python/subdir/hello_dep.proto
new file mode 100644
index 00000000..ad9f7514
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/subdir/hello_dep.proto
@@ -0,0 +1,21 @@
+// 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.
+
+syntax = "proto3";
+
+package helloworld;
+
+message HelloDep {
+ repeated int64 numbers = 1;
+}
diff --git a/grpc/test/distrib/bazel/python/tools/bazel b/grpc/test/distrib/bazel/python/tools/bazel
new file mode 100755
index 00000000..b2645c8a
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/tools/bazel
@@ -0,0 +1,85 @@
+#!/bin/bash
+# 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.
+
+
+# Keeping up with Bazel's breaking changes is currently difficult.
+# This script wraps calling bazel by downloading the currently
+# supported version, and then calling it. This way, we can make sure
+# that running bazel will always get meaningful results, at least
+# until Bazel 1.0 is released.
+# NOTE: This script relies on bazel's feature where //tools/bazel
+# script can be used to hijack "bazel" invocations in given workspace.
+
+set -e
+
+# DISABLE_BAZEL_WRAPPER can be set to eliminate the wrapper logic
+if [ "${DISABLE_BAZEL_WRAPPER}" != "" ] && [ "${OVERRIDE_BAZEL_VERSION}" == "" ]
+then
+ if [ "${BAZEL_REAL}" != "" ]
+ then
+ # use BAZEL_REAL as set by
+ # https://github.com/bazelbuild/bazel/blob/master/scripts/packages/bazel.sh
+ # that originally invoked this script (this is what happens when you
+ # run "bazel" in our workspace)
+ exec -a "$0" "${BAZEL_REAL}" "$@"
+ else
+ # if BAZEL_REAL is not set, just invoke the default system bazel
+ exec bazel "$@"
+ fi
+fi
+
+# IMPORTANT: if you update the version here, other parts of infrastructure might needs updating as well
+# (e.g. sanity checks, bazel toolchains etc.)
+VERSION=${OVERRIDE_BAZEL_VERSION:-4.2.1}
+echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." >&2
+
+# update tools/update_mirror.sh to populate the mirror with new bazel archives
+BASEURL_MIRROR="https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel/releases/download"
+BASEURL="https://github.com/bazelbuild/bazel/releases/download"
+pushd "$(dirname "$0")" >/dev/null
+# bazel binary will be downloaded to GRPC_REPO_ROOT/tools directory by default
+DOWNLOAD_DIR=${OVERRIDE_BAZEL_WRAPPER_DOWNLOAD_DIR:-$(pwd)}
+
+case $(uname -sm) in
+ "Linux x86_64")
+ suffix=linux-x86_64
+ ;;
+ "Linux aarch64")
+ suffix=linux-arm64
+ ;;
+ "Darwin x86_64")
+ suffix=darwin-x86_64
+ ;;
+ "MINGW"* | "MSYS_NT"*)
+ suffix=windows-x86_64.exe
+ ;;
+ *)
+ echo "Unsupported architecture: $(uname -sm)" >&2
+ exit 1
+ ;;
+esac
+
+filename="bazel-$VERSION-$suffix"
+filename_abs="${DOWNLOAD_DIR}/${filename}"
+
+if [ ! -x "${filename_abs}" ] ; then
+ # first try to download using mirror, fallback to download from github
+ echo "Downloading bazel, will try URLs: ${BASEURL_MIRROR}/${VERSION}/${filename} ${BASEURL}/${VERSION}/${filename}" >&2
+ curl --fail -L --output "${filename_abs}" "${BASEURL_MIRROR}/${VERSION}/${filename}" || curl --fail -L --output "${filename_abs}" "${BASEURL}/${VERSION}/${filename}"
+ chmod a+x "${filename_abs}"
+fi
+
+popd >/dev/null
+exec "${filename_abs}" "$@"
diff --git a/grpc/test/distrib/bazel/python/transitive_proto_dep.py b/grpc/test/distrib/bazel/python/transitive_proto_dep.py
new file mode 100644
index 00000000..23d9b0c5
--- /dev/null
+++ b/grpc/test/distrib/bazel/python/transitive_proto_dep.py
@@ -0,0 +1,17 @@
+# Copyright 2021 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 trivial executable that imports helloworld_pb2, but NOT its transitive
+dependencies."""
+
+import helloworld_pb2
diff --git a/grpc/test/distrib/bazel/python_second_test_repo/WORKSPACE b/grpc/test/distrib/bazel/python_second_test_repo/WORKSPACE
new file mode 100644
index 00000000..05a2b5b5
--- /dev/null
+++ b/grpc/test/distrib/bazel/python_second_test_repo/WORKSPACE
@@ -0,0 +1 @@
+workspace(name = "my_messages")
diff --git a/grpc/test/distrib/bazel/python_second_test_repo/proto/BUILD b/grpc/test/distrib/bazel/python_second_test_repo/proto/BUILD
new file mode 100644
index 00000000..3a0ff8e4
--- /dev/null
+++ b/grpc/test/distrib/bazel/python_second_test_repo/proto/BUILD
@@ -0,0 +1,29 @@
+# gRPC Bazel BUILD file.
+#
+# Copyright 2021 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.
+
+proto_library(
+ name = "my_proto",
+ srcs = ["my.proto"],
+ visibility = ["//visibility:public"],
+)
+
+genrule(
+ name = "make_my_proto",
+ outs = ["my.proto"],
+ cmd = """
+ echo -e "syntax = \\"proto3\\";\npackage somewhere_else;\nmessage MyMessage {};" > $@
+ """,
+)
diff --git a/grpc/test/distrib/bazel/run_bazel_distrib_test.sh b/grpc/test/distrib/bazel/run_bazel_distrib_test.sh
new file mode 100755
index 00000000..347417a7
--- /dev/null
+++ b/grpc/test/distrib/bazel/run_bazel_distrib_test.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+cd "$(dirname "$0")"
+
+# TODO(jtattermusch): make build work with bazel 2.2.0 and bazel 1.2.1 if that's reasonably simple.
+VERSIONS=$(cat ../../../bazel/supported_versions.txt)
+
+FAILED_VERSIONS=""
+for VERSION in $VERSIONS; do
+ echo "Running bazel distribtest with bazel version ${VERSION}"
+ ./test_single_bazel_version.sh "${VERSION}" || FAILED_VERSIONS="${FAILED_VERSIONS}${VERSION} "
+done
+
+if [ "$FAILED_VERSIONS" != "" ]
+then
+ echo "Bazel distribtest failed: Failing versions: ${FAILED_VERSIONS}"
+ exit 1
+fi
diff --git a/grpc/test/distrib/bazel/test_latest_bazel_version.sh b/grpc/test/distrib/bazel/test_latest_bazel_version.sh
new file mode 100755
index 00000000..fb02a86c
--- /dev/null
+++ b/grpc/test/distrib/bazel/test_latest_bazel_version.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+cd "$(dirname "$0")"
+
+GITHUB_URL="https://github.com"
+REPO="bazelbuild/bazel"
+
+VERSION=$(curl -Ls "${GITHUB_URL}/${REPO}/releases/latest" | \
+ grep "href=.*\.tar.gz" | \
+ grep -o "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*")
+
+./test_single_bazel_version.sh "$VERSION"
diff --git a/grpc/test/distrib/bazel/test_single_bazel_version.sh b/grpc/test/distrib/bazel/test_single_bazel_version.sh
new file mode 100755
index 00000000..663d9b19
--- /dev/null
+++ b/grpc/test/distrib/bazel/test_single_bazel_version.sh
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+if [ "$#" != "1" ] ; then
+ echo "Must supply bazel version to be tested." >/dev/stderr
+ exit 1
+fi
+
+VERSION="$1"
+
+cd "$(dirname "$0")"/../../..
+
+EXCLUDED_TARGETS=(
+ # iOS platform fails the analysis phase since there is no toolchain available
+ # for it.
+ "-//src/objective-c/..."
+ "-//third_party/objective_c/..."
+
+ # This could be a legitmate failure due to bitrot.
+ "-//src/proto/grpc/testing:test_gen_proto"
+
+ # This appears to be a legitimately broken BUILD file. There's a reference to
+ # a non-existent "link_dynamic_library.sh".
+ "-//third_party/toolchains/bazel_0.26.0_rbe_windows:all"
+
+ # TODO(jtattermusch): add back once fixed
+ "-//examples/android/binder/..."
+)
+
+TEST_DIRECTORIES=(
+ "cpp"
+ "python"
+)
+
+FAILED_TESTS=""
+
+export OVERRIDE_BAZEL_VERSION="$VERSION"
+# when running under bazel docker image, the workspace is read only.
+export OVERRIDE_BAZEL_WRAPPER_DOWNLOAD_DIR=/tmp
+bazel build -- //... "${EXCLUDED_TARGETS[@]}" || FAILED_TESTS="${FAILED_TESTS}Build "
+
+for TEST_DIRECTORY in "${TEST_DIRECTORIES[@]}"; do
+ pushd "test/distrib/bazel/$TEST_DIRECTORY/"
+
+ bazel test --test_output=all //:all || FAILED_TESTS="${FAILED_TESTS}${TEST_DIRECTORY} Distribtest"
+
+ popd
+done
+
+if [ "$FAILED_TESTS" != "" ]
+then
+ echo "Failed tests at version ${VERSION}: ${FAILED_TESTS}"
+ exit 1
+fi
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake.bat b/grpc/test/distrib/cpp/run_distrib_test_cmake.bat
index 9ebc0324..1948d26d 100644
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake.bat
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake.bat
@@ -29,6 +29,8 @@ powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [Sys
@rem set absolute path to OpenSSL with forward slashes
set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
+@rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
+
@rem Install absl
mkdir third_party\abseil-cpp\cmake\build
pushd third_party\abseil-cpp\cmake\build
@@ -78,6 +80,7 @@ cmake ^
-DZLIB_ROOT=%INSTALL_DIR% ^
-DgRPC_INSTALL=ON ^
-DgRPC_BUILD_TESTS=OFF ^
+ -DgRPC_BUILD_MSVC_MP_COUNT=-1 ^
-DgRPC_ABSL_PROVIDER=package ^
-DgRPC_CARES_PROVIDER=package ^
-DgRPC_PROTOBUF_PROVIDER=package ^
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake.sh
index 247914d9..b92f653a 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake.sh
@@ -20,11 +20,14 @@ cd "$(dirname "$0")/../../.."
# Install openssl (to use instead of boringssl)
apt-get update && apt-get install -y libssl-dev
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Install absl
mkdir -p "third_party/abseil-cpp/cmake/build"
pushd "third_party/abseil-cpp/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install c-ares
@@ -34,28 +37,28 @@ popd
mkdir -p "third_party/cares/cares/cmake/build"
pushd "third_party/cares/cares/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install protobuf
mkdir -p "third_party/protobuf/cmake/build"
pushd "third_party/protobuf/cmake/build"
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install re2
mkdir -p "third_party/re2/cmake/build"
pushd "third_party/re2/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install zlib
mkdir -p "third_party/zlib/cmake/build"
pushd "third_party/zlib/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Just before installing gRPC, wipe out contents of all the submodules to simulate
@@ -77,12 +80,12 @@ cmake \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example using cmake
mkdir -p "examples/cpp/helloworld/cmake/build"
pushd "examples/cpp/helloworld/cmake/build"
cmake ../..
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh
index 4b8b5221..c6322ff4 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh
@@ -26,6 +26,9 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Build and install gRPC for the host architecture.
# We do this because we need to be able to run protoc and grpc_cpp_plugin
# while cross-compiling.
@@ -37,7 +40,7 @@ cmake \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_SSL_PROVIDER=package \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Write a toolchain file to use for cross-compiling.
@@ -53,17 +56,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
EOT
-# Build and install absl (absl won't be installed down below)
-mkdir -p "third_party/abseil-cpp/cmake/build_arm"
-pushd "third_party/abseil-cpp/cmake/build_arm"
-cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=/tmp/install \
- -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
- ../..
-make -j4 install
-popd
-
# Build and install gRPC for ARM.
# This build will use the host architecture copies of protoc and
# grpc_cpp_plugin that we built earlier because we installed them
@@ -74,7 +66,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp/install \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example for ARM.
@@ -84,8 +76,9 @@ mkdir -p "examples/cpp/helloworld/cmake/build_arm"
pushd "examples/cpp/helloworld/cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
+ -Dabsl_DIR=/tmp/stage/lib/cmake/absl \
-DProtobuf_DIR=/tmp/stage/lib/cmake/protobuf \
-DgRPC_DIR=/tmp/stage/lib/cmake/grpc \
../..
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat
index 6f4d5819..456c40c1 100644
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.bat
@@ -26,6 +26,8 @@ powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [Sys
@rem set absolute path to OpenSSL with forward slashes
set OPENSSL_DIR=%cd:\=/%/OpenSSL-Win32
+@rem TODO(jtattermusch): add support for GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS env variable
+
@rem Build helloworld example using cmake
@rem Use non-standard build directory to avoid too long filenames
mkdir example_build
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh
index 1729f2d8..9e517767 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh
@@ -28,9 +28,12 @@ rm -r third_party/bloaty/* || true
rm -r third_party/boringssl-with-bazel/* || true
rm -r third_party/googletest/* || true
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Build helloworld example using cmake superbuild
cd examples/cpp/helloworld/cmake_externalproject
mkdir -p cmake/build
cd cmake/build
cmake ../..
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh
index defc63e0..907479dd 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_as_submodule.sh
@@ -17,9 +17,12 @@ set -ex
cd "$(dirname "$0")/../../.."
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Build helloworld example using cmake, including grpc with "add_subdirectory"
cd examples/cpp/helloworld
mkdir -p cmake/build
cd cmake/build
cmake -DGRPC_AS_SUBMODULE=ON ../..
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh
index c81cb07c..74b8f288 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh
@@ -27,6 +27,9 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Build helloworld example.
# This uses CMake's FetchContent module to download gRPC and its dependencies
# and add it to the helloworld project as a subdirectory.
@@ -41,5 +44,5 @@ cmake \
-DGRPC_FETCHCONTENT=ON \
-DFETCHCONTENT_SOURCE_DIR_GRPC="$grpc_dir" \
../..
-make -j4
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install.sh
index b669b993..141a8a50 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install.sh
@@ -26,12 +26,8 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
-# Install absl (absl won't be installed down below)
-mkdir -p "third_party/abseil-cpp/cmake/build"
-pushd "third_party/abseil-cpp/cmake/build"
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
-popd
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
# Install gRPC and its dependencies
mkdir -p "cmake/build"
@@ -40,15 +36,14 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
- -DgRPC_ABSL_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example using cmake
mkdir -p "examples/cpp/helloworld/cmake/build"
pushd "examples/cpp/helloworld/cmake/build"
cmake ../..
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh
index fd08da63..48ee8517 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh
@@ -26,12 +26,8 @@ wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.
sh cmake-linux.sh -- --skip-license --prefix=/usr
rm cmake-linux.sh
-# Install absl (absl won't be installed down below)
-mkdir -p "third_party/abseil-cpp/cmake/build"
-pushd "third_party/abseil-cpp/cmake/build"
-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
-popd
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
# Install gRPC and its dependencies
mkdir -p "cmake/build"
@@ -40,14 +36,13 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
- -DgRPC_ABSL_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example using make & pkg-config
cd examples/cpp/helloworld
export PKG_CONFIG_PATH=/usr/local/grpc/lib/pkgconfig
export PATH=$PATH:/usr/local/grpc/bin
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
diff --git a/grpc/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh b/grpc/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh
index e0c04ea8..0770b7b8 100755
--- a/grpc/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh
+++ b/grpc/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh
@@ -20,39 +20,42 @@ cd "$(dirname "$0")/../../.."
# Install openssl (to use instead of boringssl)
apt-get update && apt-get install -y libssl-dev
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS=${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS:-4}
+
# Install absl
mkdir -p "third_party/abseil-cpp/cmake/build"
pushd "third_party/abseil-cpp/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install c-ares
mkdir -p "third_party/cares/cares/cmake/build"
pushd "third_party/cares/cares/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install protobuf
mkdir -p "third_party/protobuf/cmake/build"
pushd "third_party/protobuf/cmake/build"
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install re2
mkdir -p "third_party/re2/cmake/build"
pushd "third_party/re2/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Install zlib
mkdir -p "third_party/zlib/cmake/build"
pushd "third_party/zlib/cmake/build"
cmake -DCMAKE_BUILD_TYPE=Release ../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Just before installing gRPC, wipe out contents of all the submodules to simulate
@@ -75,19 +78,19 @@ cmake \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
../..
-make -j4 install
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example using Makefile and pkg-config
pushd examples/cpp/helloworld
export PKG_CONFIG_PATH=/usr/local/grpc/lib/pkgconfig
export PATH=$PATH:/usr/local/grpc/bin
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
# Build route_guide example using Makefile and pkg-config
pushd examples/cpp/route_guide
export PKG_CONFIG_PATH=/usr/local/grpc/lib/pkgconfig
export PATH=$PATH:/usr/local/grpc/bin
-make
+make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/test/distrib/gcf/python/.gcloudignore b/grpc/test/distrib/gcf/python/.gcloudignore
new file mode 100644
index 00000000..19370129
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/.gcloudignore
@@ -0,0 +1,19 @@
+# This file specifies files that are *not* uploaded to Google Cloud
+# using gcloud. It follows the same syntax as .gitignore, with the addition of
+# "#!include" directives (which insert the entries of the given .gitignore-style
+# file at that point).
+#
+# For more information, run:
+# $ gcloud topic gcloudignore
+#
+.gcloudignore
+# If you would like to upload your .git directory, .gitignore file or files
+# from your .gitignore file, remove the corresponding line
+# below:
+.git
+.gitignore
+
+*.sh
+*.md
+*.whl
+requirements.txt.base
diff --git a/grpc/test/distrib/gcf/python/.gitignore b/grpc/test/distrib/gcf/python/.gitignore
new file mode 100644
index 00000000..4414fc1e
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/.gitignore
@@ -0,0 +1 @@
+requirements.txt
diff --git a/grpc/test/distrib/gcf/python/README.md b/grpc/test/distrib/gcf/python/README.md
new file mode 100644
index 00000000..209e1e47
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/README.md
@@ -0,0 +1,12 @@
+# Python Google Cloud Functions Distribtest
+
+This distribtest acts as a smoke test for usage of the `grpcio` Python wheel in
+the GCF environment. This test is dependent on two long-lived GCP resources:
+
+- `gcf-distribtest-topic` Pub Sub Topic with default configuration.
+- `grpc-gcf-distribtest` GCS Bucket. This bucket has 1 day TTL on all artifacts.
+
+
+All Functions _should_ be deleted by the test under normal circumstances. In
+case anything goes wrong with this process, a `cleanup.sh` script is provided to
+delete any dangling test functions.
diff --git a/grpc/test/distrib/gcf/python/cleanup.sh b/grpc/test/distrib/gcf/python/cleanup.sh
new file mode 100755
index 00000000..029f6bf1
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/cleanup.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cd "$(dirname "$0")"
+
+# Shellcheck cant find the included file.
+# shellcheck disable=SC1091
+source common.sh
+
+set -euxo pipefail
+
+gcloud functions list | grep "${FUNCTION_PREFIX}" | awk '{print $1;}' | xargs -n1 gcloud functions delete
diff --git a/grpc/test/distrib/gcf/python/common.sh b/grpc/test/distrib/gcf/python/common.sh
new file mode 100644
index 00000000..8efd267d
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/common.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Shellcheck can't track usage across files.
+# shellcheck disable=SC2034
+FUNCTION_PREFIX="grpc-gcf-distribtest"
diff --git a/grpc/test/distrib/gcf/python/main.py b/grpc/test/distrib/gcf/python/main.py
new file mode 100644
index 00000000..8f649932
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/main.py
@@ -0,0 +1,32 @@
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 functions_framework
+from google.cloud import pubsub_v1
+
+ps_client = pubsub_v1.PublisherClient()
+_PROJECT_ID = "grpc-testing"
+_PUBSUB_TOPIC = 'gcf-distribtest-topic'
+
+
+@functions_framework.http
+def test_publish(request):
+ topic_path = ps_client.topic_path(_PROJECT_ID, _PUBSUB_TOPIC)
+ message = '{"function": "TEST"}'
+ message_bytes = message.encode('utf-8')
+
+ for _ in range(100):
+ future = ps_client.publish(topic_path, data=message_bytes)
+
+ return "ok", 200
diff --git a/grpc/test/distrib/gcf/python/requirements.txt.base b/grpc/test/distrib/gcf/python/requirements.txt.base
new file mode 100644
index 00000000..2abd9709
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/requirements.txt.base
@@ -0,0 +1 @@
+google-cloud-pubsub>=0.0.dev0
diff --git a/grpc/test/distrib/gcf/python/run.sh b/grpc/test/distrib/gcf/python/run.sh
new file mode 100755
index 00000000..65bbeb19
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/run.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -euxo pipefail
+
+cd "$(dirname "$0")"
+
+ARTIFACT_DIRECTORY="$1"
+
+BUCKET_NAME="grpc-gcf-distribtests"
+
+RUN_ID=$(uuidgen)
+
+FAILED_RUNTIMES=""
+
+# This is the only programmatic way to get access to the list of runtimes.
+# While hacky, it's better than the alternative -- manually upgrading a
+# hand-curated list every few months.
+RUNTIMES=$(gcloud functions deploy --help | grep -Eo "python[0-9]+" | sort | uniq)
+
+while read -r RUNTIME; do
+ BARE_VERSION=${RUNTIME//python/}
+
+ # We sort to get the latest manylinux version.
+ ARTIFACT=$(find "${ARTIFACT_DIRECTORY}" -regex '.*grpcio-[0-9\.]+.+-cp'"${BARE_VERSION}"'-cp'"${BARE_VERSION}"'m?-manylinux.+x86_64\.whl' | sort -r | head -n 1)
+ ARTIFACT_BASENAME=$(basename "${ARTIFACT}")
+
+ # Upload artifact to GCS so GCF can access it.
+ # A 1 day retention policy is active on this bucket.
+ gsutil cp "${ARTIFACT}" "gs://${BUCKET_NAME}/${RUN_ID}/${ARTIFACT_BASENAME}"
+
+ echo "Testing runtime ${RUNTIME} with artifact ${ARTIFACT_BASENAME}"
+ ./run_single.sh "${RUNTIME}" "https://storage.googleapis.com/${BUCKET_NAME}/${RUN_ID}/${ARTIFACT_BASENAME}" || FAILED_RUNTIMES="${FAILED_RUNTIMES} ${RUNTIME}"
+done<<<"${RUNTIMES}"
+
+if [ "$FAILED_RUNTIMES" != "" ]
+then
+ echo "GCF Distribtest failed: Failing runtimes: ${FAILED_RUNTIMES}"
+ exit 1
+fi
diff --git a/grpc/test/distrib/gcf/python/run_single.sh b/grpc/test/distrib/gcf/python/run_single.sh
new file mode 100755
index 00000000..c2387555
--- /dev/null
+++ b/grpc/test/distrib/gcf/python/run_single.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cd "$(dirname "$0")"
+
+# Shellcheck cant find the included file.
+# shellcheck disable=SC1091
+source common.sh
+
+set -euxo pipefail
+
+RUNTIME="$1"
+ARTIFACT_URL="$2"
+
+REQUEST_COUNT=20
+LOG_QUIESCE_SECONDS=10
+
+rm -f requirements.txt
+cp requirements.txt.base requirements.txt
+echo "${ARTIFACT_URL}" >>requirements.txt
+
+# Generate Function name.
+FUNCTION_NAME="${FUNCTION_PREFIX}-$(uuidgen)"
+
+function cleanup() {
+ # Wait for logs to quiesce.
+ sleep "${LOG_QUIESCE_SECONDS}"
+ gcloud functions logs read "${FUNCTION_NAME}" || true
+ (yes || true) | gcloud functions delete "${FUNCTION_NAME}"
+}
+
+trap cleanup SIGINT SIGTERM EXIT
+
+# Deploy
+DEPLOY_OUTPUT=$(gcloud functions deploy "${FUNCTION_NAME}" --entry-point test_publish --runtime "${RUNTIME}" --trigger-http --allow-unauthenticated)
+HTTP_URL=$(echo "${DEPLOY_OUTPUT}" | grep "url: " | awk '{print $2;}')
+
+# Send Requests
+for _ in $(seq 1 "${REQUEST_COUNT}"); do
+ GCP_IDENTITY_TOKEN=$(gcloud auth print-identity-token 2>/dev/null);
+ curl -v -H "Authorization: Bearer $GCP_IDENTITY_TOKEN" "${HTTP_URL}"
+done
diff --git a/grpc/test/distrib/python/test_packages.sh b/grpc/test/distrib/python/test_packages.sh
index e9f49431..b2984e47 100755
--- a/grpc/test/distrib/python/test_packages.sh
+++ b/grpc/test/distrib/python/test_packages.sh
@@ -35,7 +35,7 @@ REFLECTION_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-reflection-[0-9
TESTING_ARCHIVES=("$EXTERNAL_GIT_ROOT"/input_artifacts/grpcio-testing-[0-9]*.tar.gz)
VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV"
+python3 -m virtualenv "$VIRTUAL_ENV"
PYTHON=$VIRTUAL_ENV/bin/python
"$PYTHON" -m pip install --upgrade six pip wheel
@@ -83,6 +83,6 @@ at_least_one_installs "${TESTING_ARCHIVES[@]}"
# TODO(jtattermusch): add a .proto file to the distribtest, generate python
# code from it and then use the generated code from distribtest.py
-"$PYTHON" -m grpc.tools.protoc --help
+"$PYTHON" -m grpc_tools.protoc --help
"$PYTHON" distribtest.py
diff --git a/grpc/test/distrib/ruby/run_distrib_test.sh b/grpc/test/distrib/ruby/run_distrib_test.sh
index e2128c03..a611fd1b 100755
--- a/grpc/test/distrib/ruby/run_distrib_test.sh
+++ b/grpc/test/distrib/ruby/run_distrib_test.sh
@@ -51,7 +51,7 @@ bundle install
bundle exec ./distribtest.rb
[[ "$PACKAGE_TYPE" == "source" ]] && exit 0
-# Attempt to repro https://github.com/google/protobuf/issues/4210.
+# Attempt to repro https://github.com/protocolbuffers/protobuf/issues/4210.
# This sanity check only works for linux-based distrib tests and for
# binary gRPC packages.
INSTALLATION_DIR="$(gem env | grep '\- INSTALLATION DIRECTORY' | awk '{ print $4 }')"
diff --git a/grpc/test/http2_test/http2_base_server.py b/grpc/test/http2_test/http2_base_server.py
index 44884692..dff2bbdb 100644
--- a/grpc/test/http2_test/http2_base_server.py
+++ b/grpc/test/http2_test/http2_base_server.py
@@ -13,11 +13,11 @@
# limitations under the License.
import logging
-import messages_pb2
import struct
import h2
import h2.connection
+import messages_pb2
import twisted
import twisted.internet
import twisted.internet.protocol
diff --git a/grpc/test/http2_test/http2_server_health_check.py b/grpc/test/http2_test/http2_server_health_check.py
index d5ac49f3..11cf4079 100644
--- a/grpc/test/http2_test/http2_server_health_check.py
+++ b/grpc/test/http2_test/http2_server_health_check.py
@@ -13,9 +13,10 @@
# limitations under the License.
import argparse
-import hyper
import sys
+import hyper
+
# Utility to healthcheck the http2 server. Used when starting the server to
# verify that the server is live before tests begin.
if __name__ == '__main__':
diff --git a/grpc/test/http2_test/http2_test_server.py b/grpc/test/http2_test/http2_test_server.py
index 5946895e..ed402e09 100644
--- a/grpc/test/http2_test/http2_test_server.py
+++ b/grpc/test/http2_test/http2_test_server.py
@@ -16,19 +16,19 @@
import argparse
import logging
import sys
-import twisted
-import twisted.internet
-import twisted.internet.endpoints
-import twisted.internet.reactor
import http2_base_server
+import test_data_frame_padding
import test_goaway
import test_max_streams
import test_ping
import test_rst_after_data
import test_rst_after_header
import test_rst_during_data
-import test_data_frame_padding
+import twisted
+import twisted.internet
+import twisted.internet.endpoints
+import twisted.internet.reactor
_TEST_CASE_MAPPING = {
'rst_after_header': test_rst_after_header.TestcaseRstStreamAfterHeader,
diff --git a/grpc/test/http2_test/test_data_frame_padding.py b/grpc/test/http2_test/test_data_frame_padding.py
index d6758690..cfd86956 100644
--- a/grpc/test/http2_test/test_data_frame_padding.py
+++ b/grpc/test/http2_test/test_data_frame_padding.py
@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import http2_base_server
import logging
+
+import http2_base_server
import messages_pb2
# Set the number of padding bytes per data frame to be very large
diff --git a/grpc/test/http2_test/test_max_streams.py b/grpc/test/http2_test/test_max_streams.py
index 40130748..62538433 100644
--- a/grpc/test/http2_test/test_max_streams.py
+++ b/grpc/test/http2_test/test_max_streams.py
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import hyperframe.frame
import logging
import http2_base_server
+import hyperframe.frame
class TestcaseSettingsMaxStreams(object):
diff --git a/grpc/test/spm_build/test.cc b/grpc/test/spm_build/test.cc
new file mode 100644
index 00000000..2eab4acf
--- /dev/null
+++ b/grpc/test/spm_build/test.cc
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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/channel.h"
+#include "grpcpp/client_context.h"
+#include "grpcpp/completion_queue.h"
+#include "grpcpp/create_channel.h"
+#include "grpcpp/generic/generic_stub.h"
+#include "grpcpp/grpcpp.h"
+#include "grpcpp/impl/codegen/grpc_library.h"
+#include "grpcpp/support/byte_buffer.h"
+#include "grpcpp/support/status.h"
+#include "grpcpp/support/status_code_enum.h"
+#include "grpcpp/support/string_ref.h"
diff --git a/grpc/third_party/ABSEIL_MANUAL.md b/grpc/third_party/ABSEIL_MANUAL.md
index 1e510e90..793e45d3 100644
--- a/grpc/third_party/ABSEIL_MANUAL.md
+++ b/grpc/third_party/ABSEIL_MANUAL.md
@@ -19,9 +19,8 @@ because they're not going well yet on some of our test machinaries or
platforms it supports. The following is a list of targets that are NOT
ready to use.
-- `absl/synchronization:*`: This will be ready from the LTS version in 2021.
+- `absl/synchronization:*`: Blocked by b/186685878.
- `absl/random`: [WIP](https://github.com/grpc/grpc/pull/23346).
-- `absl/types:variant`: [WIP](https://github.com/grpc/grpc/pull/22961).
## Implemetation only
diff --git a/grpc/third_party/BUILD b/grpc/third_party/BUILD
index 272d2396..72a4730d 100644
--- a/grpc/third_party/BUILD
+++ b/grpc/third_party/BUILD
@@ -12,4 +12,6 @@ exports_files([
"futures.BUILD",
"libuv.BUILD",
"protobuf.patch",
+ "rules_python.patch",
+ "protoc-gen-validate.patch",
])
diff --git a/grpc/third_party/README.md b/grpc/third_party/README.md
index b93570f1..ec265370 100644
--- a/grpc/third_party/README.md
+++ b/grpc/third_party/README.md
@@ -58,26 +58,26 @@ Updating some dependencies requires extra care.
### Updating third_party/boringssl-with-bazel
-- Update the `third_party/boringssl-with-bazel` submodule to the latest [`master-with-bazel`](https://github.com/google/boringssl/tree/master-with-bazel) branch
+- Update the `third_party/boringssl-with-bazel` submodule to the latest [`main-with-bazel`](https://github.com/google/boringssl/tree/main-with-bazel) branch
```
git submodule update --init # just to start in a clean state
cd third_party/boringssl-with-bazel
git fetch origin # fetch what's new in the boringssl repository
-git checkout origin/master-with-bazel # checkout the current state of master-with-bazel branch in the boringssl repo
-# Note the latest commit SHA on master-with-bazel-branch
+git checkout origin/main-with-bazel # checkout the current state of main-with-bazel branch in the boringssl repo
+# Note the latest commit SHA on main-with-bazel branch
cd ../.. # go back to grpc repo root
git status # will show that there are new commits in third_party/boringssl-with-bazel
git add third_party/boringssl-with-bazel # we actually want to update the changes to the submodule
-git commit -m "update submodule boringssl-with-bazel with origin/master-with-bazel" # commit
+git commit -m "update submodule boringssl-with-bazel with origin/main-with-bazel" # commit
```
-- Update boringssl dependency in `bazel/grpc_deps.bzl` to the same commit SHA as master-with-bazel branch
+- Update boringssl dependency in `bazel/grpc_deps.bzl` to the same commit SHA as main-with-bazel branch
- Update `http_archive(name = "boringssl",` section by updating the sha in `strip_prefix` and `urls` fields.
- Also, set `sha256` field to "" as the existing value is not valid. This will be added later once we know what that value is.
- Update `tools/run_tests/sanity/check_submodules.sh` with the same commit
-- Commit these changes `git commit -m "update boringssl dependency to master-with-bazel commit SHA"`
+- Commit these changes `git commit -m "update boringssl dependency to main-with-bazel commit SHA"`
- Run `tools/buildgen/generate_projects.sh` to regenerate the generated files
- Because `sha256` in `bazel/grpc_deps.bzl` was left empty, you will get a DEBUG msg like this one:
@@ -112,3 +112,34 @@ Apart from the above steps, please perform the following two steps to generate t
1. Bump the version in the `tools/distrib/python/xds_protos/setup.py`;
2. Run `tools/distrib/python/xds_protos/build_validate_upload.sh` to upload the built wheel.
+
+### Updating third_party/upb
+
+Since upb is vendored in the gRPC repo, you cannot use submodule to update it. Please follow the steps below.
+
+1. Update third_party/upb directory by running
+ - `export GRPC_ROOT=~/git/grpc`
+ - `wget https://github.com/protocolbuffers/upb/archive/refs/heads/main.zip`
+ - `rm -rf $GRPC_ROOT/third_party/upb`
+ - `unzip main.zip -d $GRPC_ROOT/third_party`
+ - `mv $GRPC_ROOT/third_party/upb-main $GRPC_ROOT/third_party/upb`
+2. Update the dependency in `grpc_deps.bzl` to the same commit
+3. Populate the bazel download mirror by running `bazel/update_mirror.sh`
+4. Update `src/upb/gen_build_yaml.py` for newly added or removed upb files
+5. Run `tools/buildgen/generate_projects.sh` to regenerate the generated files
+6. Run `tools/codegen/core/gen_upb_api.sh` to regenerate upb files.
+
+### Updating third_party/xxhash
+
+TODO(https://github.com/Cyan4973/xxHash/issues/548): revisit LICENSE
+instructions if upstream splits library and CLI.
+
+The upstream xxhash repository contains a bunch of files that we don't want, so
+we employ a rather manual update flow to pick up just the bits we care about:
+
+```
+git remote add xxhash https://github.com/Cyan4973/xxHash.git
+git fetch xxhash
+git show xxhash/dev:xxhash.h > third_party/xxhash/xxhash.h
+git show xxhash/dev:LICENSE | sed -nE '/^-+$/q;p' > third_party/xxhash/LICENSE
+```
diff --git a/grpc/third_party/abseil-cpp/CMake/AbseilDll.cmake b/grpc/third_party/abseil-cpp/CMake/AbseilDll.cmake
index 253c73ff..fa323ff8 100644
--- a/grpc/third_party/abseil-cpp/CMake/AbseilDll.cmake
+++ b/grpc/third_party/abseil-cpp/CMake/AbseilDll.cmake
@@ -17,8 +17,6 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/dynamic_annotations.h"
"base/internal/endian.h"
"base/internal/errno_saver.h"
- "base/internal/exponential_biased.cc"
- "base/internal/exponential_biased.h"
"base/internal/fast_type_id.h"
"base/internal/hide_ptr.h"
"base/internal/identity.h"
@@ -28,8 +26,6 @@ set(ABSL_INTERNAL_DLL_FILES
"base/internal/low_level_alloc.h"
"base/internal/low_level_scheduling.h"
"base/internal/per_thread_tls.h"
- "base/internal/periodic_sampler.cc"
- "base/internal/periodic_sampler.h"
"base/internal/pretty_function.h"
"base/internal/raw_logging.cc"
"base/internal/raw_logging.h"
@@ -124,8 +120,8 @@ set(ABSL_INTERNAL_DLL_FILES
"hash/internal/hash.h"
"hash/internal/hash.cc"
"hash/internal/spy_hash_state.h"
- "hash/internal/wyhash.h"
- "hash/internal/wyhash.cc"
+ "hash/internal/low_level_hash.h"
+ "hash/internal/low_level_hash.cc"
"memory/memory.h"
"meta/type_traits.h"
"numeric/bits.h"
@@ -133,6 +129,11 @@ set(ABSL_INTERNAL_DLL_FILES
"numeric/int128.h"
"numeric/internal/bits.h"
"numeric/internal/representation.h"
+ "profiling/internal/exponential_biased.cc"
+ "profiling/internal/exponential_biased.h"
+ "profiling/internal/periodic_sampler.cc"
+ "profiling/internal/periodic_sampler.h"
+ "profiling/internal/sample_recorder.h"
"random/bernoulli_distribution.h"
"random/beta_distribution.h"
"random/bit_gen_ref.h"
@@ -197,16 +198,35 @@ set(ABSL_INTERNAL_DLL_FILES
"strings/cord.h"
"strings/escaping.cc"
"strings/escaping.h"
+ "strings/internal/charconv_bigint.cc"
+ "strings/internal/charconv_bigint.h"
+ "strings/internal/charconv_parse.cc"
+ "strings/internal/charconv_parse.h"
"strings/internal/cord_internal.cc"
"strings/internal/cord_internal.h"
+ "strings/internal/cord_rep_consume.h"
+ "strings/internal/cord_rep_consume.cc"
+ "strings/internal/cord_rep_btree.cc"
+ "strings/internal/cord_rep_btree.h"
+ "strings/internal/cord_rep_btree_navigator.cc"
+ "strings/internal/cord_rep_btree_navigator.h"
+ "strings/internal/cord_rep_btree_reader.cc"
+ "strings/internal/cord_rep_btree_reader.h"
"strings/internal/cord_rep_flat.h"
"strings/internal/cord_rep_ring.cc"
"strings/internal/cord_rep_ring.h"
"strings/internal/cord_rep_ring_reader.h"
- "strings/internal/charconv_bigint.cc"
- "strings/internal/charconv_bigint.h"
- "strings/internal/charconv_parse.cc"
- "strings/internal/charconv_parse.h"
+ "strings/internal/cordz_functions.cc"
+ "strings/internal/cordz_functions.h"
+ "strings/internal/cordz_handle.cc"
+ "strings/internal/cordz_handle.h"
+ "strings/internal/cordz_info.cc"
+ "strings/internal/cordz_info.h"
+ "strings/internal/cordz_sample_token.cc"
+ "strings/internal/cordz_sample_token.h"
+ "strings/internal/cordz_statistics.h"
+ "strings/internal/cordz_update_scope.h"
+ "strings/internal/cordz_update_tracker.h"
"strings/internal/stl_type_traits.h"
"strings/internal/string_constant.h"
"strings/match.cc"
@@ -438,6 +458,7 @@ set(ABSL_INTERNAL_DLL_TARGETS
"raw_hash_set"
"layout"
"tracked"
+ "sample_recorder"
)
function(absl_internal_dll_contains)
diff --git a/grpc/third_party/abseil-cpp/CMake/AbseilHelpers.cmake b/grpc/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
index 70eaa4ca..f2ce5675 100644
--- a/grpc/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
+++ b/grpc/third_party/abseil-cpp/CMake/AbseilHelpers.cmake
@@ -141,7 +141,8 @@ function(absl_cc_library)
endif()
# Generate a pkg-config file for every library:
- if(_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
+ if((_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
+ AND ABSL_ENABLE_INSTALL)
if(NOT ABSL_CC_LIB_TESTONLY)
if(absl_VERSION)
set(PC_VERSION "${absl_VERSION}")
@@ -170,8 +171,8 @@ function(absl_cc_library)
FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
prefix=${CMAKE_INSTALL_PREFIX}\n\
exec_prefix=\${prefix}\n\
-libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}\n\
-includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}\n\
+libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\
+includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\
\n\
Name: absl_${_NAME}\n\
Description: Abseil ${_NAME} library\n\
@@ -181,7 +182,7 @@ Requires:${PC_DEPS}\n\
Libs: -L\${libdir} $<JOIN:${ABSL_CC_LIB_LINKOPTS}, > $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-labsl_${_NAME}>\n\
Cflags: -I\${includedir}${PC_CFLAGS}\n")
INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc"
- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()
endif()
@@ -253,9 +254,23 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/internal)
endif()
- # INTERFACE libraries can't have the CXX_STANDARD property set
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ if(ABSL_PROPAGATE_CXX_STD)
+ # Abseil libraries require C++11 as the current minimum standard.
+ # Top-level application CMake projects should ensure a consistent C++
+ # standard for all compiled sources by setting CMAKE_CXX_STANDARD.
+ target_compile_features(${_NAME} PUBLIC cxx_std_11)
+ else()
+ # Note: This is legacy (before CMake 3.8) behavior. Setting the
+ # target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
+ # initialized by CMAKE_CXX_STANDARD) should have no real effect, since
+ # that is the default value anyway.
+ #
+ # CXX_STANDARD_REQUIRED does guard against the top-level CMake project
+ # not having enabled CMAKE_CXX_STANDARD_REQUIRED (which prevents
+ # "decaying" to an older standard if the requested one isn't available).
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ endif()
# When being installed, we lose the absl_ prefix. We want to put it back
# to have properly named lib files. This is a no-op when we are not being
@@ -263,7 +278,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_ENABLE_INSTALL)
set_target_properties(${_NAME} PROPERTIES
OUTPUT_NAME "absl_${_NAME}"
- SOVERSION "2103.0.0"
+ SOVERSION "2111.0.0"
)
endif()
else()
@@ -286,6 +301,16 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
${ABSL_DEFAULT_LINKOPTS}
)
target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
+
+ if(ABSL_PROPAGATE_CXX_STD)
+ # Abseil libraries require C++11 as the current minimum standard.
+ # Top-level application CMake projects should ensure a consistent C++
+ # standard for all compiled sources by setting CMAKE_CXX_STANDARD.
+ target_compile_features(${_NAME} INTERFACE cxx_std_11)
+
+ # (INTERFACE libraries can't have the CXX_STANDARD property set, so there
+ # is no legacy behavior else case).
+ endif()
endif()
# TODO currently we don't install googletest alongside abseil sources, so
@@ -335,8 +360,8 @@ endfunction()
# "awesome_test.cc"
# DEPS
# absl::awesome
-# gmock
-# gtest_main
+# GTest::gmock
+# GTest::gtest_main
# )
function(absl_cc_test)
if(NOT BUILD_TESTING)
@@ -389,8 +414,23 @@ function(absl_cc_test)
# Add all Abseil targets to a folder in the IDE for organization.
set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ if(ABSL_PROPAGATE_CXX_STD)
+ # Abseil libraries require C++11 as the current minimum standard.
+ # Top-level application CMake projects should ensure a consistent C++
+ # standard for all compiled sources by setting CMAKE_CXX_STANDARD.
+ target_compile_features(${_NAME} PUBLIC cxx_std_11)
+ else()
+ # Note: This is legacy (before CMake 3.8) behavior. Setting the
+ # target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
+ # initialized by CMAKE_CXX_STANDARD) should have no real effect, since
+ # that is the default value anyway.
+ #
+ # CXX_STANDARD_REQUIRED does guard against the top-level CMake project
+ # not having enabled CMAKE_CXX_STANDARD_REQUIRED (which prevents
+ # "decaying" to an older standard if the requested one isn't available).
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ endif()
add_test(NAME ${_NAME} COMMAND ${_NAME})
endfunction()
diff --git a/grpc/third_party/abseil-cpp/CMake/README.md b/grpc/third_party/abseil-cpp/CMake/README.md
index 5eee8171..f8b27e63 100644
--- a/grpc/third_party/abseil-cpp/CMake/README.md
+++ b/grpc/third_party/abseil-cpp/CMake/README.md
@@ -34,15 +34,16 @@ to include Abseil directly in your CMake project.
4. Add the **absl::** target you wish to use to the
[`target_link_libraries()`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
section of your executable or of your library.<br>
-Here is a short CMakeLists.txt example of a project file using Abseil.
+Here is a short CMakeLists.txt example of an application project using Abseil.
```cmake
-cmake_minimum_required(VERSION 3.5)
-project(my_project)
+cmake_minimum_required(VERSION 3.8.2)
+project(my_app_project)
# Pick the C++ standard to compile with.
# Abseil currently supports C++11, C++14, and C++17.
set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(abseil-cpp)
@@ -50,6 +51,44 @@ add_executable(my_exe source.cpp)
target_link_libraries(my_exe absl::base absl::synchronization absl::strings)
```
+Note that if you are developing a library designed for use by other clients, you
+should instead leave `CMAKE_CXX_STANDARD` unset (or only set if being built as
+the current top-level CMake project) and configure the minimum required C++
+standard at the target level. If you require a later minimum C++ standard than
+Abseil does, it's a good idea to also enforce that `CMAKE_CXX_STANDARD` (which
+will control Abseil library targets) is set to at least that minimum. For
+example:
+
+```cmake
+cmake_minimum_required(VERSION 3.8.2)
+project(my_lib_project)
+
+# Leave C++ standard up to the root application, so set it only if this is the
+# current top-level CMake project.
+if(CMAKE_SOURCE_DIR STREQUAL my_lib_project_SOURCE_DIR)
+ set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+endif()
+
+add_subdirectory(abseil-cpp)
+
+add_library(my_lib source.cpp)
+target_link_libraries(my_lib absl::base absl::synchronization absl::strings)
+
+# Enforce that my_lib requires C++17. Important to document for clients that they
+# must set CMAKE_CXX_STANDARD to 17 or higher for proper Abseil ABI compatibility
+# (since otherwise, Abseil library targets could be compiled with a lower C++
+# standard than my_lib).
+target_compile_features(my_lib PUBLIC cxx_std_17)
+if(CMAKE_CXX_STANDARD LESS 17)
+ message(FATAL_ERROR
+ "my_lib_project requires CMAKE_CXX_STANDARD >= 17 (got: ${CMAKE_CXX_STANDARD})")
+endif()
+```
+
+Then the top-level application project that uses your library is responsible for
+setting a consistent `CMAKE_CXX_STANDARD` that is sufficiently high.
+
### Running Abseil Tests with CMake
Use the `-DBUILD_TESTING=ON` flag to run Abseil tests.
@@ -99,3 +138,48 @@ absl::synchronization
absl::time
absl::utility
```
+
+## Traditional CMake Set-Up
+
+For larger projects, it may make sense to use the traditional CMake set-up where you build and install projects separately.
+
+First, you'd need to build and install Google Test:
+```
+cmake -S /source/googletest -B /build/googletest -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/installation/dir -DBUILD_GMOCK=ON
+cmake --build /build/googletest --target install
+```
+
+Then you need to configure and build Abseil. Make sure you enable `ABSL_USE_EXTERNAL_GOOGLETEST` and `ABSL_FIND_GOOGLETEST`. You also need to enable `ABSL_ENABLE_INSTALL` so that you can install Abseil itself.
+```
+cmake -S /source/abseil-cpp -B /build/abseil-cpp -DCMAKE_PREFIX_PATH=/installation/dir -DCMAKE_INSTALL_PREFIX=/installation/dir -DABSL_ENABLE_INSTALL=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON
+cmake --build /temporary/build/abseil-cpp
+```
+
+(`CMAKE_PREFIX_PATH` is where you already have Google Test installed; `CMAKE_INSTALL_PREFIX` is where you want to have Abseil installed; they can be different.)
+
+Run the tests:
+```
+ctest --test-dir /temporary/build/abseil-cpp
+```
+
+And finally install:
+```
+cmake --build /temporary/build/abseil-cpp --target install
+```
+
+# CMake Option Synposis
+
+## Enable Standard CMake Installation
+
+`-DABSL_ENABLE_INSTALL=ON`
+
+## Google Test Options
+
+`-DBUILD_TESTING=ON` must be set to enable testing
+
+- Have Abseil download and build Google Test for you: `-DABSL_USE_EXTERNAL_GOOGLETEST=OFF` (default)
+ - Download and build latest Google Test: `-DABSL_USE_GOOGLETEST_HEAD=ON`
+ - Download specific Google Test version (ZIP archive): `-DABSL_GOOGLETEST_DOWNLOAD_URL=https://.../version.zip`
+ - Use Google Test from specific local directory: `-DABSL_LOCAL_GOOGLETEST_DIR=/path/to/googletest`
+- Use Google Test included elsewhere in your project: `-DABSL_USE_EXTERNAL_GOOGLETEST=ON`
+- Use standard CMake `find_package(CTest)` to find installed Google Test: `-DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON`
diff --git a/grpc/third_party/abseil-cpp/CMake/install_test_project/CMakeLists.txt b/grpc/third_party/abseil-cpp/CMake/install_test_project/CMakeLists.txt
index 06b797e9..b865b2ec 100644
--- a/grpc/third_party/abseil-cpp/CMake/install_test_project/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/CMake/install_test_project/CMakeLists.txt
@@ -18,10 +18,8 @@
cmake_minimum_required(VERSION 3.5)
project(absl_cmake_testing CXX)
-set(CMAKE_CXX_STANDARD 11)
-
add_executable(simple simple.cc)
find_package(absl REQUIRED)
-target_link_libraries(simple absl::strings)
+target_link_libraries(simple absl::strings absl::config)
diff --git a/grpc/third_party/abseil-cpp/CMake/install_test_project/simple.cc b/grpc/third_party/abseil-cpp/CMake/install_test_project/simple.cc
index e9e35291..7daa7f09 100644
--- a/grpc/third_party/abseil-cpp/CMake/install_test_project/simple.cc
+++ b/grpc/third_party/abseil-cpp/CMake/install_test_project/simple.cc
@@ -14,8 +14,17 @@
// limitations under the License.
#include <iostream>
+#include "absl/base/config.h"
#include "absl/strings/substitute.h"
+#if !defined(ABSL_LTS_RELEASE_VERSION) || ABSL_LTS_RELEASE_VERSION != 99998877
+#error ABSL_LTS_RELEASE_VERSION is not set correctly.
+#endif
+
+#if !defined(ABSL_LTS_RELEASE_PATCH_LEVEL) || ABSL_LTS_RELEASE_PATCH_LEVEL != 0
+#error ABSL_LTS_RELEASE_PATCH_LEVEL is not set correctly.
+#endif
+
int main(int argc, char** argv) {
for (int i = 0; i < argc; ++i) {
std::cout << absl::Substitute("Arg $0: $1\n", i, argv[i]);
diff --git a/grpc/third_party/abseil-cpp/CMake/install_test_project/test.sh b/grpc/third_party/abseil-cpp/CMake/install_test_project/test.sh
index a3d39773..5a78c92c 100755
--- a/grpc/third_party/abseil-cpp/CMake/install_test_project/test.sh
+++ b/grpc/third_party/abseil-cpp/CMake/install_test_project/test.sh
@@ -19,10 +19,9 @@
# Fail on any error. Treat unset variables an error. Print commands as executed.
set -euox pipefail
-source ci/cmake_common.sh
-
absl_dir=/abseil-cpp
absl_build_dir=/buildfs
+googletest_builddir=/googletest_builddir
project_dir="${absl_dir}"/CMake/install_test_project
project_build_dir=/buildfs/project-build
@@ -31,13 +30,30 @@ if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then
build_shared_libs="ON"
fi
+# Build and install GoogleTest
+mkdir "${googletest_builddir}"
+pushd "${googletest_builddir}"
+curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${ABSL_GOOGLETEST_COMMIT}".zip
+unzip "${ABSL_GOOGLETEST_COMMIT}".zip
+pushd "googletest-${ABSL_GOOGLETEST_COMMIT}"
+mkdir build
+pushd build
+cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" ..
+make -j $(nproc)
+make install
+ldconfig
+popd
+popd
+popd
+
# Run the LTS transformations
./create_lts.py 99998877
-# Install Abseil
+# Build and install Abseil
pushd "${absl_build_dir}"
cmake "${absl_dir}" \
- -DABSL_GOOGLETEST_DOWNLOAD_URL="${ABSL_GOOGLETEST_DOWNLOAD_URL}" \
+ -DABSL_USE_EXTERNAL_GOOGLETEST=ON \
+ -DABSL_FIND_GOOGLETEST=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS="${build_shared_libs}"
diff --git a/grpc/third_party/abseil-cpp/CMakeLists.txt b/grpc/third_party/abseil-cpp/CMakeLists.txt
index 3a73f707..750a4755 100644
--- a/grpc/third_party/abseil-cpp/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/CMakeLists.txt
@@ -41,11 +41,16 @@ if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)
+# Allow the user to specify the MSVC runtime
+if (POLICY CMP0091)
+ cmake_policy(SET CMP0091 NEW)
+endif (POLICY CMP0091)
+
# Set BUILD_TESTING to OFF by default.
# This must come before the project() and include(CTest) lines.
OPTION(BUILD_TESTING "Build tests" OFF)
-project(absl LANGUAGES CXX VERSION 20210324)
+project(absl LANGUAGES CXX VERSION 20211102)
include(CTest)
# Output directory is correct by default for most build setups. However, when
@@ -62,6 +67,13 @@ else()
option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
endif()
+option(ABSL_PROPAGATE_CXX_STD
+ "Use CMake C++ standard meta features (e.g. cxx_std_11) that propagate to targets that link to Abseil"
+ OFF) # TODO: Default to ON for CMake 3.8 and greater.
+if((${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.8) AND (NOT ABSL_PROPAGATE_CXX_STD))
+ message(WARNING "A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake 3.8 and up. We recommend enabling this option to ensure your project still builds correctly.")
+endif()
+
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/CMake
${CMAKE_CURRENT_LIST_DIR}/absl/copts
@@ -97,9 +109,18 @@ endif()
## pthread
find_package(Threads REQUIRED)
+include(CMakeDependentOption)
+
option(ABSL_USE_EXTERNAL_GOOGLETEST
"If ON, Abseil will assume that the targets for GoogleTest are already provided by the including project. This makes sense when Abseil is used with add_subproject." OFF)
+cmake_dependent_option(ABSL_FIND_GOOGLETEST
+ "If ON, Abseil will use find_package(GTest) rather than assuming that GoogleTest is already provided by the including project."
+ ON
+ "ABSL_USE_EXTERNAL_GOOGLETEST"
+ OFF)
+
+
option(ABSL_USE_GOOGLETEST_HEAD
"If ON, abseil will download HEAD from GoogleTest at config time." OFF)
@@ -111,7 +132,15 @@ set(ABSL_LOCAL_GOOGLETEST_DIR "/usr/src/googletest" CACHE PATH
if(BUILD_TESTING)
## check targets
- if (NOT ABSL_USE_EXTERNAL_GOOGLETEST)
+ if (ABSL_USE_EXTERNAL_GOOGLETEST)
+ if (ABSL_FIND_GOOGLETEST)
+ find_package(GTest REQUIRED)
+ else()
+ if (NOT TARGET gtest AND NOT TARGET GTest::gtest)
+ message(FATAL_ERROR "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.")
+ endif()
+ endif()
+ else()
set(absl_gtest_build_dir ${CMAKE_BINARY_DIR}/googletest-build)
if(ABSL_USE_GOOGLETEST_HEAD AND ABSL_GOOGLETEST_DOWNLOAD_URL)
message(FATAL_ERROR "Do not set both ABSL_USE_GOOGLETEST_HEAD and ABSL_GOOGLETEST_DOWNLOAD_URL")
@@ -129,16 +158,18 @@ if(BUILD_TESTING)
include(CMake/Googletest/DownloadGTest.cmake)
endif()
- check_target(gtest)
- check_target(gtest_main)
- check_target(gmock)
+ if (NOT ABSL_FIND_GOOGLETEST)
+ # When Google Test is included directly rather than through find_package, the aliases are missing.
+ add_library(GTest::gtest ALIAS gtest)
+ add_library(GTest::gtest_main ALIAS gtest_main)
+ add_library(GTest::gmock ALIAS gmock)
+ add_library(GTest::gmock_main ALIAS gmock_main)
+ endif()
- list(APPEND ABSL_TEST_COMMON_LIBRARIES
- gtest_main
- gtest
- gmock
- ${CMAKE_THREAD_LIBS_INIT}
- )
+ check_target(GTest::gtest)
+ check_target(GTest::gtest_main)
+ check_target(GTest::gmock)
+ check_target(GTest::gmock_main)
endif()
add_subdirectory(absl)
diff --git a/grpc/third_party/abseil-cpp/FAQ.md b/grpc/third_party/abseil-cpp/FAQ.md
index 78028fc0..fbd92ce9 100644
--- a/grpc/third_party/abseil-cpp/FAQ.md
+++ b/grpc/third_party/abseil-cpp/FAQ.md
@@ -27,7 +27,10 @@ compiler, there several ways to do this:
file](https://docs.bazel.build/versions/master/guide.html#bazelrc)
If you are using CMake as the build system, you'll need to add a line like
-`set(CMAKE_CXX_STANDARD 17)` to your top level `CMakeLists.txt` file. See the
+`set(CMAKE_CXX_STANDARD 17)` to your top level `CMakeLists.txt` file. If you
+are developing a library designed to be used by other clients, you should
+instead leave `CMAKE_CXX_STANDARD` unset and configure the minimum C++ standard
+required by each of your library targets via `target_compile_features`. See the
[CMake build
instructions](https://github.com/abseil/abseil-cpp/blob/master/CMake/README.md)
for more information.
diff --git a/grpc/third_party/abseil-cpp/README.md b/grpc/third_party/abseil-cpp/README.md
index 264c4b3f..db3a7b44 100644
--- a/grpc/third_party/abseil-cpp/README.md
+++ b/grpc/third_party/abseil-cpp/README.md
@@ -92,6 +92,9 @@ Abseil contains the following C++ library components:
available within C++14 and C++17 versions of the C++ `<type_traits>` library.
* [`numeric`](absl/numeric/)
<br /> The `numeric` library contains C++11-compatible 128-bit integers.
+* [`profiling`](absl/profiling/)
+ <br /> The `profiling` library contains utility code for profiling C++
+ entities. It is currently a private dependency of other Abseil libraries.
* [`status`](absl/status/)
<br /> The `status` contains abstractions for error handling, specifically
`absl::Status` and `absl::StatusOr<T>`.
diff --git a/grpc/third_party/abseil-cpp/WORKSPACE b/grpc/third_party/abseil-cpp/WORKSPACE
index 258d23b5..c9aa8caf 100644
--- a/grpc/third_party/abseil-cpp/WORKSPACE
+++ b/grpc/third_party/abseil-cpp/WORKSPACE
@@ -15,31 +15,30 @@
#
workspace(name = "com_google_absl")
+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# GoogleTest/GoogleMock framework. Used by most unit-tests.
http_archive(
- name = "com_google_googletest",
+ name = "com_google_googletest", # 2021-07-09T13:28:13Z
+ sha256 = "12ef65654dc01ab40f6f33f9d02c04f2097d2cd9fbe48dc6001b29543583b0ad",
+ strip_prefix = "googletest-8d51ffdfab10b3fba636ae69bc03da4b54f8c235",
# Keep this URL in sync with ABSL_GOOGLETEST_COMMIT in ci/cmake_common.sh.
- urls = ["https://github.com/google/googletest/archive/8567b09290fe402cf01923e2131c5635b8ed851b.zip"], # 2020-06-12T22:24:28Z
- strip_prefix = "googletest-8567b09290fe402cf01923e2131c5635b8ed851b",
- sha256 = "9a8a166eb6a56c7b3d7b19dc2c946fe4778fd6f21c7a12368ad3b836d8f1be48",
+ urls = ["https://github.com/google/googletest/archive/8d51ffdfab10b3fba636ae69bc03da4b54f8c235.zip"],
)
# Google benchmark.
http_archive(
- name = "com_github_google_benchmark",
- urls = ["https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip"], # 2020-11-26T11:14:03Z
- strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677",
- sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c",
+ name = "com_github_google_benchmark", # 2021-09-20T09:19:51Z
+ sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0",
+ strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
+ urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"],
)
-# C++ rules for Bazel.
+# Bazel platform rules.
http_archive(
- name = "rules_cc",
- sha256 = "9a446e9dd9c1bb180c86977a8dc1e9e659550ae732ae58bd2e8fd51e15b2c91d",
- strip_prefix = "rules_cc-262ebec3c2296296526740db4aefce68c80de7fa",
- urls = [
- "https://github.com/bazelbuild/rules_cc/archive/262ebec3c2296296526740db4aefce68c80de7fa.zip",
- ],
+ name = "platforms",
+ sha256 = "b601beaf841244de5c5a50d2b2eddd34839788000fa1be4260ce6603ca0d8eb7",
+ strip_prefix = "platforms-98939346da932eef0b54cf808622f5bb0928f00b",
+ urls = ["https://github.com/bazelbuild/platforms/archive/98939346da932eef0b54cf808622f5bb0928f00b.zip"],
)
diff --git a/grpc/third_party/abseil-cpp/absl/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/BUILD.bazel
index c9d4a2da..d799b7fe 100644
--- a/grpc/third_party/abseil-cpp/absl/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/BUILD.bazel
@@ -44,14 +44,14 @@ config_setting(
config_setting(
name = "osx",
constraint_values = [
- "@bazel_tools//platforms:osx",
+ "@platforms//os:osx",
],
)
config_setting(
name = "ios",
constraint_values = [
- "@bazel_tools//platforms:ios",
+ "@platforms//os:ios",
],
)
@@ -70,3 +70,11 @@ config_setting(
},
visibility = [":__subpackages__"],
)
+
+config_setting(
+ name = "fuchsia",
+ values = {
+ "cpu": "fuchsia",
+ },
+ visibility = [":__subpackages__"],
+)
diff --git a/grpc/third_party/abseil-cpp/absl/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/CMakeLists.txt
index fbfa7822..b1715846 100644
--- a/grpc/third_party/abseil-cpp/absl/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/CMakeLists.txt
@@ -16,6 +16,7 @@
add_subdirectory(base)
add_subdirectory(algorithm)
+add_subdirectory(cleanup)
add_subdirectory(container)
add_subdirectory(debugging)
add_subdirectory(flags)
@@ -24,6 +25,7 @@ add_subdirectory(hash)
add_subdirectory(memory)
add_subdirectory(meta)
add_subdirectory(numeric)
+add_subdirectory(profiling)
add_subdirectory(random)
add_subdirectory(status)
add_subdirectory(strings)
diff --git a/grpc/third_party/abseil-cpp/absl/algorithm/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/algorithm/BUILD.bazel
index a3002b7d..afc52639 100644
--- a/grpc/third_party/abseil-cpp/absl/algorithm/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/algorithm/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt
index 56cd0fb8..609d8589 100644
--- a/grpc/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt
@@ -35,7 +35,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::algorithm
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -65,5 +65,5 @@ absl_cc_test(
absl::core_headers
absl::memory
absl::span
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/algorithm/container.h b/grpc/third_party/abseil-cpp/absl/algorithm/container.h
index 6398438f..c38a4a63 100644
--- a/grpc/third_party/abseil-cpp/absl/algorithm/container.h
+++ b/grpc/third_party/abseil-cpp/absl/algorithm/container.h
@@ -905,11 +905,11 @@ void c_sort(C& c) {
// Overload of c_sort() for performing a `comp` comparison other than the
// default `operator<`.
-template <typename C, typename Compare>
-void c_sort(C& c, Compare&& comp) {
+template <typename C, typename LessThan>
+void c_sort(C& c, LessThan&& comp) {
std::sort(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_stable_sort()
@@ -925,11 +925,11 @@ void c_stable_sort(C& c) {
// Overload of c_stable_sort() for performing a `comp` comparison other than the
// default `operator<`.
-template <typename C, typename Compare>
-void c_stable_sort(C& c, Compare&& comp) {
+template <typename C, typename LessThan>
+void c_stable_sort(C& c, LessThan&& comp) {
std::stable_sort(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_is_sorted()
@@ -944,11 +944,11 @@ bool c_is_sorted(const C& c) {
// c_is_sorted() overload for performing a `comp` comparison other than the
// default `operator<`.
-template <typename C, typename Compare>
-bool c_is_sorted(const C& c, Compare&& comp) {
+template <typename C, typename LessThan>
+bool c_is_sorted(const C& c, LessThan&& comp) {
return std::is_sorted(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_partial_sort()
@@ -966,14 +966,14 @@ void c_partial_sort(
// Overload of c_partial_sort() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename RandomAccessContainer, typename Compare>
+template <typename RandomAccessContainer, typename LessThan>
void c_partial_sort(
RandomAccessContainer& sequence,
container_algorithm_internal::ContainerIter<RandomAccessContainer> middle,
- Compare&& comp) {
+ LessThan&& comp) {
std::partial_sort(container_algorithm_internal::c_begin(sequence), middle,
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_partial_sort_copy()
@@ -994,15 +994,15 @@ c_partial_sort_copy(const C& sequence, RandomAccessContainer& result) {
// Overload of c_partial_sort_copy() for performing a `comp` comparison other
// than the default `operator<`.
-template <typename C, typename RandomAccessContainer, typename Compare>
+template <typename C, typename RandomAccessContainer, typename LessThan>
container_algorithm_internal::ContainerIter<RandomAccessContainer>
c_partial_sort_copy(const C& sequence, RandomAccessContainer& result,
- Compare&& comp) {
+ LessThan&& comp) {
return std::partial_sort_copy(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
container_algorithm_internal::c_begin(result),
container_algorithm_internal::c_end(result),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_is_sorted_until()
@@ -1018,12 +1018,12 @@ container_algorithm_internal::ContainerIter<C> c_is_sorted_until(C& c) {
// Overload of c_is_sorted_until() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename C, typename Compare>
+template <typename C, typename LessThan>
container_algorithm_internal::ContainerIter<C> c_is_sorted_until(
- C& c, Compare&& comp) {
+ C& c, LessThan&& comp) {
return std::is_sorted_until(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_nth_element()
@@ -1043,14 +1043,14 @@ void c_nth_element(
// Overload of c_nth_element() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename RandomAccessContainer, typename Compare>
+template <typename RandomAccessContainer, typename LessThan>
void c_nth_element(
RandomAccessContainer& sequence,
container_algorithm_internal::ContainerIter<RandomAccessContainer> nth,
- Compare&& comp) {
+ LessThan&& comp) {
std::nth_element(container_algorithm_internal::c_begin(sequence), nth,
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
@@ -1072,12 +1072,12 @@ container_algorithm_internal::ContainerIter<Sequence> c_lower_bound(
// Overload of c_lower_bound() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename Sequence, typename T, typename Compare>
+template <typename Sequence, typename T, typename LessThan>
container_algorithm_internal::ContainerIter<Sequence> c_lower_bound(
- Sequence& sequence, T&& value, Compare&& comp) {
+ Sequence& sequence, T&& value, LessThan&& comp) {
return std::lower_bound(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<T>(value), std::forward<Compare>(comp));
+ std::forward<T>(value), std::forward<LessThan>(comp));
}
// c_upper_bound()
@@ -1095,12 +1095,12 @@ container_algorithm_internal::ContainerIter<Sequence> c_upper_bound(
// Overload of c_upper_bound() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename Sequence, typename T, typename Compare>
+template <typename Sequence, typename T, typename LessThan>
container_algorithm_internal::ContainerIter<Sequence> c_upper_bound(
- Sequence& sequence, T&& value, Compare&& comp) {
+ Sequence& sequence, T&& value, LessThan&& comp) {
return std::upper_bound(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<T>(value), std::forward<Compare>(comp));
+ std::forward<T>(value), std::forward<LessThan>(comp));
}
// c_equal_range()
@@ -1118,12 +1118,12 @@ c_equal_range(Sequence& sequence, T&& value) {
// Overload of c_equal_range() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename Sequence, typename T, typename Compare>
+template <typename Sequence, typename T, typename LessThan>
container_algorithm_internal::ContainerIterPairType<Sequence, Sequence>
-c_equal_range(Sequence& sequence, T&& value, Compare&& comp) {
+c_equal_range(Sequence& sequence, T&& value, LessThan&& comp) {
return std::equal_range(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<T>(value), std::forward<Compare>(comp));
+ std::forward<T>(value), std::forward<LessThan>(comp));
}
// c_binary_search()
@@ -1140,12 +1140,12 @@ bool c_binary_search(Sequence&& sequence, T&& value) {
// Overload of c_binary_search() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename Sequence, typename T, typename Compare>
-bool c_binary_search(Sequence&& sequence, T&& value, Compare&& comp) {
+template <typename Sequence, typename T, typename LessThan>
+bool c_binary_search(Sequence&& sequence, T&& value, LessThan&& comp) {
return std::binary_search(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
std::forward<T>(value),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
@@ -1166,14 +1166,14 @@ OutputIterator c_merge(const C1& c1, const C2& c2, OutputIterator result) {
// Overload of c_merge() for performing a `comp` comparison other than
// the default `operator<`.
-template <typename C1, typename C2, typename OutputIterator, typename Compare>
+template <typename C1, typename C2, typename OutputIterator, typename LessThan>
OutputIterator c_merge(const C1& c1, const C2& c2, OutputIterator result,
- Compare&& comp) {
+ LessThan&& comp) {
return std::merge(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2), result,
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_inplace_merge()
@@ -1189,13 +1189,13 @@ void c_inplace_merge(C& c,
// Overload of c_inplace_merge() for performing a merge using a `comp` other
// than `operator<`.
-template <typename C, typename Compare>
+template <typename C, typename LessThan>
void c_inplace_merge(C& c,
container_algorithm_internal::ContainerIter<C> middle,
- Compare&& comp) {
+ LessThan&& comp) {
std::inplace_merge(container_algorithm_internal::c_begin(c), middle,
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_includes()
@@ -1213,13 +1213,13 @@ bool c_includes(const C1& c1, const C2& c2) {
// Overload of c_includes() for performing a merge using a `comp` other than
// `operator<`.
-template <typename C1, typename C2, typename Compare>
-bool c_includes(const C1& c1, const C2& c2, Compare&& comp) {
+template <typename C1, typename C2, typename LessThan>
+bool c_includes(const C1& c1, const C2& c2, LessThan&& comp) {
return std::includes(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_set_union()
@@ -1243,7 +1243,7 @@ OutputIterator c_set_union(const C1& c1, const C2& c2, OutputIterator output) {
// Overload of c_set_union() for performing a merge using a `comp` other than
// `operator<`.
-template <typename C1, typename C2, typename OutputIterator, typename Compare,
+template <typename C1, typename C2, typename OutputIterator, typename LessThan,
typename = typename std::enable_if<
!container_algorithm_internal::IsUnorderedContainer<C1>::value,
void>::type,
@@ -1251,18 +1251,18 @@ template <typename C1, typename C2, typename OutputIterator, typename Compare,
!container_algorithm_internal::IsUnorderedContainer<C2>::value,
void>::type>
OutputIterator c_set_union(const C1& c1, const C2& c2, OutputIterator output,
- Compare&& comp) {
+ LessThan&& comp) {
return std::set_union(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2), output,
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_set_intersection()
//
// Container-based version of the <algorithm> `std::set_intersection()` function
-// to return an iterator containing the intersection of two containers.
+// to return an iterator containing the intersection of two sorted containers.
template <typename C1, typename C2, typename OutputIterator,
typename = typename std::enable_if<
!container_algorithm_internal::IsUnorderedContainer<C1>::value,
@@ -1272,6 +1272,11 @@ template <typename C1, typename C2, typename OutputIterator,
void>::type>
OutputIterator c_set_intersection(const C1& c1, const C2& c2,
OutputIterator output) {
+ // In debug builds, ensure that both containers are sorted with respect to the
+ // default comparator. std::set_intersection requires the containers be sorted
+ // using operator<.
+ assert(absl::c_is_sorted(c1));
+ assert(absl::c_is_sorted(c2));
return std::set_intersection(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
@@ -1280,7 +1285,7 @@ OutputIterator c_set_intersection(const C1& c1, const C2& c2,
// Overload of c_set_intersection() for performing a merge using a `comp` other
// than `operator<`.
-template <typename C1, typename C2, typename OutputIterator, typename Compare,
+template <typename C1, typename C2, typename OutputIterator, typename LessThan,
typename = typename std::enable_if<
!container_algorithm_internal::IsUnorderedContainer<C1>::value,
void>::type,
@@ -1288,12 +1293,17 @@ template <typename C1, typename C2, typename OutputIterator, typename Compare,
!container_algorithm_internal::IsUnorderedContainer<C2>::value,
void>::type>
OutputIterator c_set_intersection(const C1& c1, const C2& c2,
- OutputIterator output, Compare&& comp) {
+ OutputIterator output, LessThan&& comp) {
+ // In debug builds, ensure that both containers are sorted with respect to the
+ // default comparator. std::set_intersection requires the containers be sorted
+ // using the same comparator.
+ assert(absl::c_is_sorted(c1, comp));
+ assert(absl::c_is_sorted(c2, comp));
return std::set_intersection(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2), output,
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_set_difference()
@@ -1318,7 +1328,7 @@ OutputIterator c_set_difference(const C1& c1, const C2& c2,
// Overload of c_set_difference() for performing a merge using a `comp` other
// than `operator<`.
-template <typename C1, typename C2, typename OutputIterator, typename Compare,
+template <typename C1, typename C2, typename OutputIterator, typename LessThan,
typename = typename std::enable_if<
!container_algorithm_internal::IsUnorderedContainer<C1>::value,
void>::type,
@@ -1326,12 +1336,12 @@ template <typename C1, typename C2, typename OutputIterator, typename Compare,
!container_algorithm_internal::IsUnorderedContainer<C2>::value,
void>::type>
OutputIterator c_set_difference(const C1& c1, const C2& c2,
- OutputIterator output, Compare&& comp) {
+ OutputIterator output, LessThan&& comp) {
return std::set_difference(container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2), output,
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_set_symmetric_difference()
@@ -1357,7 +1367,7 @@ OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2,
// Overload of c_set_symmetric_difference() for performing a merge using a
// `comp` other than `operator<`.
-template <typename C1, typename C2, typename OutputIterator, typename Compare,
+template <typename C1, typename C2, typename OutputIterator, typename LessThan,
typename = typename std::enable_if<
!container_algorithm_internal::IsUnorderedContainer<C1>::value,
void>::type,
@@ -1366,13 +1376,13 @@ template <typename C1, typename C2, typename OutputIterator, typename Compare,
void>::type>
OutputIterator c_set_symmetric_difference(const C1& c1, const C2& c2,
OutputIterator output,
- Compare&& comp) {
+ LessThan&& comp) {
return std::set_symmetric_difference(
container_algorithm_internal::c_begin(c1),
container_algorithm_internal::c_end(c1),
container_algorithm_internal::c_begin(c2),
container_algorithm_internal::c_end(c2), output,
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
@@ -1391,11 +1401,11 @@ void c_push_heap(RandomAccessContainer& sequence) {
// Overload of c_push_heap() for performing a push operation on a heap using a
// `comp` other than `operator<`.
-template <typename RandomAccessContainer, typename Compare>
-void c_push_heap(RandomAccessContainer& sequence, Compare&& comp) {
+template <typename RandomAccessContainer, typename LessThan>
+void c_push_heap(RandomAccessContainer& sequence, LessThan&& comp) {
std::push_heap(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_pop_heap()
@@ -1410,11 +1420,11 @@ void c_pop_heap(RandomAccessContainer& sequence) {
// Overload of c_pop_heap() for performing a pop operation on a heap using a
// `comp` other than `operator<`.
-template <typename RandomAccessContainer, typename Compare>
-void c_pop_heap(RandomAccessContainer& sequence, Compare&& comp) {
+template <typename RandomAccessContainer, typename LessThan>
+void c_pop_heap(RandomAccessContainer& sequence, LessThan&& comp) {
std::pop_heap(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_make_heap()
@@ -1429,11 +1439,11 @@ void c_make_heap(RandomAccessContainer& sequence) {
// Overload of c_make_heap() for performing heap comparisons using a
// `comp` other than `operator<`
-template <typename RandomAccessContainer, typename Compare>
-void c_make_heap(RandomAccessContainer& sequence, Compare&& comp) {
+template <typename RandomAccessContainer, typename LessThan>
+void c_make_heap(RandomAccessContainer& sequence, LessThan&& comp) {
std::make_heap(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_sort_heap()
@@ -1448,11 +1458,11 @@ void c_sort_heap(RandomAccessContainer& sequence) {
// Overload of c_sort_heap() for performing heap comparisons using a
// `comp` other than `operator<`
-template <typename RandomAccessContainer, typename Compare>
-void c_sort_heap(RandomAccessContainer& sequence, Compare&& comp) {
+template <typename RandomAccessContainer, typename LessThan>
+void c_sort_heap(RandomAccessContainer& sequence, LessThan&& comp) {
std::sort_heap(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_is_heap()
@@ -1467,11 +1477,11 @@ bool c_is_heap(const RandomAccessContainer& sequence) {
// Overload of c_is_heap() for performing heap comparisons using a
// `comp` other than `operator<`
-template <typename RandomAccessContainer, typename Compare>
-bool c_is_heap(const RandomAccessContainer& sequence, Compare&& comp) {
+template <typename RandomAccessContainer, typename LessThan>
+bool c_is_heap(const RandomAccessContainer& sequence, LessThan&& comp) {
return std::is_heap(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_is_heap_until()
@@ -1487,12 +1497,12 @@ c_is_heap_until(RandomAccessContainer& sequence) {
// Overload of c_is_heap_until() for performing heap comparisons using a
// `comp` other than `operator<`
-template <typename RandomAccessContainer, typename Compare>
+template <typename RandomAccessContainer, typename LessThan>
container_algorithm_internal::ContainerIter<RandomAccessContainer>
-c_is_heap_until(RandomAccessContainer& sequence, Compare&& comp) {
+c_is_heap_until(RandomAccessContainer& sequence, LessThan&& comp) {
return std::is_heap_until(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
@@ -1513,12 +1523,12 @@ container_algorithm_internal::ContainerIter<Sequence> c_min_element(
// Overload of c_min_element() for performing a `comp` comparison other than
// `operator<`.
-template <typename Sequence, typename Compare>
+template <typename Sequence, typename LessThan>
container_algorithm_internal::ContainerIter<Sequence> c_min_element(
- Sequence& sequence, Compare&& comp) {
+ Sequence& sequence, LessThan&& comp) {
return std::min_element(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_max_element()
@@ -1535,12 +1545,12 @@ container_algorithm_internal::ContainerIter<Sequence> c_max_element(
// Overload of c_max_element() for performing a `comp` comparison other than
// `operator<`.
-template <typename Sequence, typename Compare>
+template <typename Sequence, typename LessThan>
container_algorithm_internal::ContainerIter<Sequence> c_max_element(
- Sequence& sequence, Compare&& comp) {
+ Sequence& sequence, LessThan&& comp) {
return std::max_element(container_algorithm_internal::c_begin(sequence),
container_algorithm_internal::c_end(sequence),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_minmax_element()
@@ -1558,12 +1568,12 @@ c_minmax_element(C& c) {
// Overload of c_minmax_element() for performing `comp` comparisons other than
// `operator<`.
-template <typename C, typename Compare>
+template <typename C, typename LessThan>
container_algorithm_internal::ContainerIterPairType<C, C>
-c_minmax_element(C& c, Compare&& comp) {
+c_minmax_element(C& c, LessThan&& comp) {
return std::minmax_element(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
@@ -1588,15 +1598,15 @@ bool c_lexicographical_compare(Sequence1&& sequence1, Sequence2&& sequence2) {
// Overload of c_lexicographical_compare() for performing a lexicographical
// comparison using a `comp` operator instead of `operator<`.
-template <typename Sequence1, typename Sequence2, typename Compare>
+template <typename Sequence1, typename Sequence2, typename LessThan>
bool c_lexicographical_compare(Sequence1&& sequence1, Sequence2&& sequence2,
- Compare&& comp) {
+ LessThan&& comp) {
return std::lexicographical_compare(
container_algorithm_internal::c_begin(sequence1),
container_algorithm_internal::c_end(sequence1),
container_algorithm_internal::c_begin(sequence2),
container_algorithm_internal::c_end(sequence2),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_next_permutation()
@@ -1612,11 +1622,11 @@ bool c_next_permutation(C& c) {
// Overload of c_next_permutation() for performing a lexicographical
// comparison using a `comp` operator instead of `operator<`.
-template <typename C, typename Compare>
-bool c_next_permutation(C& c, Compare&& comp) {
+template <typename C, typename LessThan>
+bool c_next_permutation(C& c, LessThan&& comp) {
return std::next_permutation(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
// c_prev_permutation()
@@ -1632,11 +1642,11 @@ bool c_prev_permutation(C& c) {
// Overload of c_prev_permutation() for performing a lexicographical
// comparison using a `comp` operator instead of `operator<`.
-template <typename C, typename Compare>
-bool c_prev_permutation(C& c, Compare&& comp) {
+template <typename C, typename LessThan>
+bool c_prev_permutation(C& c, LessThan&& comp) {
return std::prev_permutation(container_algorithm_internal::c_begin(c),
container_algorithm_internal::c_end(c),
- std::forward<Compare>(comp));
+ std::forward<LessThan>(comp));
}
//------------------------------------------------------------------------------
diff --git a/grpc/third_party/abseil-cpp/absl/base/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/base/BUILD.bazel
index 65ff0dde..4769efda 100644
--- a/grpc/third_party/abseil-cpp/absl/base/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/base/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -594,75 +593,6 @@ cc_test(
)
cc_library(
- name = "exponential_biased",
- srcs = ["internal/exponential_biased.cc"],
- hdrs = ["internal/exponential_biased.h"],
- linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = [
- "//absl:__subpackages__",
- ],
- deps = [
- ":config",
- ":core_headers",
- ],
-)
-
-cc_test(
- name = "exponential_biased_test",
- size = "small",
- srcs = ["internal/exponential_biased_test.cc"],
- copts = ABSL_TEST_COPTS,
- linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = ["//visibility:private"],
- deps = [
- ":exponential_biased",
- "//absl/strings",
- "@com_google_googletest//:gtest_main",
- ],
-)
-
-cc_library(
- name = "periodic_sampler",
- srcs = ["internal/periodic_sampler.cc"],
- hdrs = ["internal/periodic_sampler.h"],
- copts = ABSL_DEFAULT_COPTS,
- linkopts = ABSL_DEFAULT_LINKOPTS,
- deps = [
- ":core_headers",
- ":exponential_biased",
- ],
-)
-
-cc_test(
- name = "periodic_sampler_test",
- size = "small",
- srcs = ["internal/periodic_sampler_test.cc"],
- copts = ABSL_TEST_COPTS,
- linkopts = ABSL_DEFAULT_LINKOPTS,
- visibility = ["//visibility:private"],
- deps = [
- ":core_headers",
- ":periodic_sampler",
- "@com_google_googletest//:gtest_main",
- ],
-)
-
-cc_binary(
- name = "periodic_sampler_benchmark",
- testonly = 1,
- srcs = ["internal/periodic_sampler_benchmark.cc"],
- copts = ABSL_TEST_COPTS,
- linkopts = ABSL_DEFAULT_LINKOPTS,
- tags = ["benchmark"],
- visibility = ["//visibility:private"],
- deps = [
- ":core_headers",
- ":periodic_sampler",
- "@com_github_google_benchmark//:benchmark_main",
- ],
-)
-
-cc_library(
name = "scoped_set_env",
testonly = 1,
srcs = ["internal/scoped_set_env.cc"],
diff --git a/grpc/third_party/abseil-cpp/absl/base/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/base/CMakeLists.txt
index 981b8cc0..c7233cb3 100644
--- a/grpc/third_party/abseil-cpp/absl/base/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/base/CMakeLists.txt
@@ -230,7 +230,7 @@ absl_cc_library(
${ABSL_DEFAULT_COPTS}
DEPS
absl::config
- gtest
+ GTest::gtest
TESTONLY
)
@@ -259,7 +259,7 @@ absl_cc_library(
absl::meta
absl::strings
absl::utility
- gtest
+ GTest::gtest
TESTONLY
)
@@ -273,7 +273,7 @@ absl_cc_test(
DEPS
absl::exception_safety_testing
absl::memory
- gtest_main
+ GTest::gtest_main
)
absl_cc_library(
@@ -300,8 +300,8 @@ absl_cc_test(
absl::atomic_hook_test_helper
absl::atomic_hook
absl::core_headers
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -314,7 +314,7 @@ absl_cc_test(
DEPS
absl::base
absl::core_headers
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -327,8 +327,8 @@ absl_cc_test(
DEPS
absl::errno_saver
absl::strerror
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -342,7 +342,7 @@ absl_cc_test(
absl::base
absl::config
absl::throw_delegate
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -357,7 +357,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::base_internal
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -371,8 +371,8 @@ absl_cc_test(
absl::base_internal
absl::memory
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_library(
@@ -388,7 +388,7 @@ absl_cc_library(
absl::base_internal
absl::core_headers
absl::synchronization
- gtest
+ GTest::gtest
TESTONLY
)
@@ -406,7 +406,7 @@ absl_cc_test(
absl::config
absl::core_headers
absl::synchronization
- gtest_main
+ GTest::gtest_main
)
absl_cc_library(
@@ -435,7 +435,7 @@ absl_cc_test(
absl::base
absl::config
absl::endian
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -448,7 +448,7 @@ absl_cc_test(
DEPS
absl::config
absl::synchronization
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -462,7 +462,7 @@ absl_cc_test(
absl::base
absl::core_headers
absl::synchronization
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -475,7 +475,7 @@ absl_cc_test(
DEPS
absl::raw_logging_internal
absl::strings
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -488,7 +488,7 @@ absl_cc_test(
DEPS
absl::base
absl::synchronization
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -516,61 +516,7 @@ absl_cc_test(
absl::core_headers
absl::synchronization
Threads::Threads
- gtest_main
-)
-
-absl_cc_library(
- NAME
- exponential_biased
- SRCS
- "internal/exponential_biased.cc"
- HDRS
- "internal/exponential_biased.h"
- COPTS
- ${ABSL_DEFAULT_COPTS}
- DEPS
- absl::config
- absl::core_headers
-)
-
-absl_cc_test(
- NAME
- exponential_biased_test
- SRCS
- "internal/exponential_biased_test.cc"
- COPTS
- ${ABSL_TEST_COPTS}
- DEPS
- absl::exponential_biased
- absl::strings
- gmock_main
-)
-
-absl_cc_library(
- NAME
- periodic_sampler
- SRCS
- "internal/periodic_sampler.cc"
- HDRS
- "internal/periodic_sampler.h"
- COPTS
- ${ABSL_DEFAULT_COPTS}
- DEPS
- absl::core_headers
- absl::exponential_biased
-)
-
-absl_cc_test(
- NAME
- periodic_sampler_test
- SRCS
- "internal/periodic_sampler_test.cc"
- COPTS
- ${ABSL_TEST_COPTS}
- DEPS
- absl::core_headers
- absl::periodic_sampler
- gmock_main
+ GTest::gtest_main
)
absl_cc_library(
@@ -596,7 +542,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::scoped_set_env
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -620,8 +566,8 @@ absl_cc_test(
absl::flags_marshalling
absl::log_severity
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_library(
@@ -651,8 +597,8 @@ absl_cc_test(
DEPS
absl::strerror
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_library(
@@ -677,7 +623,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::fast_type_id
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -690,5 +636,5 @@ absl_cc_test(
DEPS
absl::core_headers
absl::optional
- gtest_main
+ GTest::gtest_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/base/attributes.h b/grpc/third_party/abseil-cpp/absl/base/attributes.h
index cf2cb550..e3907827 100644
--- a/grpc/third_party/abseil-cpp/absl/base/attributes.h
+++ b/grpc/third_party/abseil-cpp/absl/base/attributes.h
@@ -131,14 +131,14 @@
// ABSL_ATTRIBUTE_WEAK
//
// Tags a function as weak for the purposes of compilation and linking.
-// Weak attributes currently do not work properly in LLVM's Windows backend,
-// so disable them there. See https://bugs.llvm.org/show_bug.cgi?id=37598
+// Weak attributes did not work properly in LLVM's Windows backend before
+// 9.0.0, so disable them there. See https://bugs.llvm.org/show_bug.cgi?id=37598
// for further information.
// The MinGW compiler doesn't complain about the weak attribute until the link
// step, presumably because Windows doesn't use ELF binaries.
#if (ABSL_HAVE_ATTRIBUTE(weak) || \
(defined(__GNUC__) && !defined(__clang__))) && \
- !(defined(__llvm__) && defined(_WIN32)) && !defined(__MINGW32__)
+ (!defined(_WIN32) || __clang_major__ < 9) && !defined(__MINGW32__)
#undef ABSL_ATTRIBUTE_WEAK
#define ABSL_ATTRIBUTE_WEAK __attribute__((weak))
#define ABSL_HAVE_ATTRIBUTE_WEAK 1
@@ -281,10 +281,7 @@
// ABSL_ATTRIBUTE_RETURNS_NONNULL
//
// Tells the compiler that a particular function never returns a null pointer.
-#if ABSL_HAVE_ATTRIBUTE(returns_nonnull) || \
- (defined(__GNUC__) && \
- (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \
- !defined(__clang__))
+#if ABSL_HAVE_ATTRIBUTE(returns_nonnull)
#define ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull))
#else
#define ABSL_ATTRIBUTE_RETURNS_NONNULL
@@ -321,8 +318,16 @@
// `__start_ ## name` and `__stop_ ## name` symbols to bracket the section.
// This functionality is supported by GNU linker.
#ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE
+#ifdef _AIX
+// __attribute__((section(#name))) on AIX is achived by using the `.csect` psudo
+// op which includes an additional integer as part of its syntax indcating
+// alignment. If data fall under different alignments then you might get a
+// compilation error indicating a `Section type conflict`.
+#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name)
+#else
#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name)))
#endif
+#endif
// ABSL_DECLARE_ATTRIBUTE_SECTION_VARS
//
@@ -524,6 +529,13 @@
// ABSL_ATTRIBUTE_UNUSED
//
// Prevents the compiler from complaining about variables that appear unused.
+//
+// For code or headers that are assured to only build with C++17 and up, prefer
+// just using the standard '[[maybe_unused]]' directly over this macro.
+//
+// Due to differences in positioning requirements between the old, compiler
+// specific __attribute__ syntax and the now standard [[maybe_unused]], this
+// macro does not attempt to take advantage of '[[maybe_unused]]'.
#if ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__))
#undef ABSL_ATTRIBUTE_UNUSED
#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__))
@@ -544,13 +556,19 @@
// ABSL_ATTRIBUTE_PACKED
//
// Instructs the compiler not to use natural alignment for a tagged data
-// structure, but instead to reduce its alignment to 1. This attribute can
-// either be applied to members of a structure or to a structure in its
-// entirety. Applying this attribute (judiciously) to a structure in its
-// entirety to optimize the memory footprint of very commonly-used structs is
-// fine. Do not apply this attribute to a structure in its entirety if the
-// purpose is to control the offsets of the members in the structure. Instead,
-// apply this attribute only to structure members that need it.
+// structure, but instead to reduce its alignment to 1.
+//
+// Therefore, DO NOT APPLY THIS ATTRIBUTE TO STRUCTS CONTAINING ATOMICS. Doing
+// so can cause atomic variables to be mis-aligned and silently violate
+// atomicity on x86.
+//
+// This attribute can either be applied to members of a structure or to a
+// structure in its entirety. Applying this attribute (judiciously) to a
+// structure in its entirety to optimize the memory footprint of very
+// commonly-used structs is fine. Do not apply this attribute to a structure in
+// its entirety if the purpose is to control the offsets of the members in the
+// structure. Instead, apply this attribute only to structure members that need
+// it.
//
// When applying ABSL_ATTRIBUTE_PACKED only to specific structure members the
// natural alignment of structure members not annotated is preserved. Aligned
@@ -595,31 +613,24 @@
// case 42:
// ...
//
-// Notes: when compiled with clang in C++11 mode, the ABSL_FALLTHROUGH_INTENDED
-// macro is expanded to the [[clang::fallthrough]] attribute, which is analysed
-// when performing switch labels fall-through diagnostic
-// (`-Wimplicit-fallthrough`). See clang documentation on language extensions
-// for details:
+// Notes: When supported, GCC and Clang can issue a warning on switch labels
+// with unannotated fallthrough using the warning `-Wimplicit-fallthrough`. See
+// clang documentation on language extensions for details:
// https://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough
//
-// When used with unsupported compilers, the ABSL_FALLTHROUGH_INTENDED macro
-// has no effect on diagnostics. In any case this macro has no effect on runtime
+// When used with unsupported compilers, the ABSL_FALLTHROUGH_INTENDED macro has
+// no effect on diagnostics. In any case this macro has no effect on runtime
// behavior and performance of code.
#ifdef ABSL_FALLTHROUGH_INTENDED
#error "ABSL_FALLTHROUGH_INTENDED should not be defined."
-#endif
-
-// TODO(zhangxy): Use c++17 standard [[fallthrough]] macro, when supported.
-#if defined(__clang__) && defined(__has_warning)
-#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+#elif ABSL_HAVE_CPP_ATTRIBUTE(fallthrough)
+#define ABSL_FALLTHROUGH_INTENDED [[fallthrough]]
+#elif ABSL_HAVE_CPP_ATTRIBUTE(clang::fallthrough)
#define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]]
-#endif
-#elif defined(__GNUC__) && __GNUC__ >= 7
+#elif ABSL_HAVE_CPP_ATTRIBUTE(gnu::fallthrough)
#define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
-#endif
-
-#ifndef ABSL_FALLTHROUGH_INTENDED
+#else
#define ABSL_FALLTHROUGH_INTENDED \
do { \
} while (0)
@@ -699,4 +710,26 @@
#define ABSL_ATTRIBUTE_PURE_FUNCTION
#endif
+// ABSL_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function
+// parameter or implicit object parameter is retained by the return value of the
+// annotated function (or, for a parameter of a constructor, in the value of the
+// constructed object). This attribute causes warnings to be produced if a
+// temporary object does not live long enough.
+//
+// When applied to a reference parameter, the referenced object is assumed to be
+// retained by the return value of the function. When applied to a non-reference
+// parameter (for example, a pointer or a class type), all temporaries
+// referenced by the parameter are assumed to be retained by the return value of
+// the function.
+//
+// See also the upstream documentation:
+// https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
+#if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound)
+#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]]
+#elif ABSL_HAVE_ATTRIBUTE(lifetimebound)
+#define ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound))
+#else
+#define ABSL_ATTRIBUTE_LIFETIME_BOUND
+#endif
+
#endif // ABSL_BASE_ATTRIBUTES_H_
diff --git a/grpc/third_party/abseil-cpp/absl/base/config.h b/grpc/third_party/abseil-cpp/absl/base/config.h
index 95449969..585485c3 100644
--- a/grpc/third_party/abseil-cpp/absl/base/config.h
+++ b/grpc/third_party/abseil-cpp/absl/base/config.h
@@ -66,6 +66,35 @@
#include "absl/base/options.h"
#include "absl/base/policy_checks.h"
+// Abseil long-term support (LTS) releases will define
+// `ABSL_LTS_RELEASE_VERSION` to the integer representing the date string of the
+// LTS release version, and will define `ABSL_LTS_RELEASE_PATCH_LEVEL` to the
+// integer representing the patch-level for that release.
+//
+// For example, for LTS release version "20300401.2", this would give us
+// ABSL_LTS_RELEASE_VERSION == 20300401 && ABSL_LTS_RELEASE_PATCH_LEVEL == 2
+//
+// These symbols will not be defined in non-LTS code.
+//
+// Abseil recommends that clients live-at-head. Therefore, if you are using
+// these symbols to assert a minimum version requirement, we recommend you do it
+// as
+//
+// #if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20300401
+// #error Project foo requires Abseil LTS version >= 20300401
+// #endif
+//
+// The `defined(ABSL_LTS_RELEASE_VERSION)` part of the check excludes
+// live-at-head clients from the minimum version assertion.
+//
+// See https://abseil.io/about/releases for more information on Abseil release
+// management.
+//
+// LTS releases can be obtained from
+// https://github.com/abseil/abseil-cpp/releases.
+#define ABSL_LTS_RELEASE_VERSION 20211102
+#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
+
// Helper macro to convert a CPP variable to a string literal.
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
#define ABSL_INTERNAL_TOKEN_STR(x) ABSL_INTERNAL_DO_TOKEN_STR(x)
@@ -166,6 +195,22 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#define ABSL_HAVE_FEATURE(f) 0
#endif
+// Portable check for GCC minimum version:
+// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
+#define ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) \
+ (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
+#else
+#define ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) 0
+#endif
+
+#if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__)
+#define ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) \
+ (__clang_major__ > (x) || __clang_major__ == (x) && __clang_minor__ >= (y))
+#else
+#define ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) 0
+#endif
+
// ABSL_HAVE_TLS is defined to 1 when __thread should be supported.
// We assume __thread is supported on Linux when compiled with Clang or compiled
// against libstdc++ with _GLIBCXX_HAVE_TLS defined.
@@ -183,10 +228,9 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// gcc >= 4.8.1 using libstdc++, and Visual Studio.
#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE
#error ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set
-#elif defined(_LIBCPP_VERSION) || \
- (!defined(__clang__) && defined(__GNUC__) && defined(__GLIBCXX__) && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) || \
- defined(_MSC_VER)
+#elif defined(_LIBCPP_VERSION) || defined(_MSC_VER) || \
+ (!defined(__clang__) && defined(__GLIBCXX__) && \
+ ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(4, 8))
#define ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1
#endif
@@ -199,16 +243,17 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
//
// Checks whether `std::is_trivially_copy_assignable<T>` is supported.
-// Notes: Clang with libc++ supports these features, as does gcc >= 5.1 with
-// either libc++ or libstdc++, and Visual Studio (but not NVCC).
+// Notes: Clang with libc++ supports these features, as does gcc >= 7.4 with
+// libstdc++, or gcc >= 8.2 with libc++, and Visual Studio (but not NVCC).
#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE)
#error ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set
#elif defined(ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE)
#error ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set
-#elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \
- (!defined(__clang__) && defined(__GNUC__) && \
- (__GNUC__ > 7 || (__GNUC__ == 7 && __GNUC_MINOR__ >= 4)) && \
- (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \
+#elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \
+ (!defined(__clang__) && \
+ ((ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(7, 4) && defined(__GLIBCXX__)) || \
+ (ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(8, 2) && \
+ defined(_LIBCPP_VERSION)))) || \
(defined(_MSC_VER) && !defined(__NVCC__))
#define ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1
#define ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1
@@ -222,7 +267,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#if ABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \
ABSL_INTERNAL_HAS_KEYWORD(__builtin_FILE)
#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1
-#elif defined(__GNUC__) && __GNUC__ >= 5
+#elif ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0)
#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1
#endif
#endif
@@ -319,25 +364,21 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// For further details, consult the compiler's documentation.
#ifdef ABSL_HAVE_EXCEPTIONS
#error ABSL_HAVE_EXCEPTIONS cannot be directly set.
-
-#elif defined(__clang__)
-
-#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6)
+#elif ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(3, 6)
// Clang >= 3.6
#if ABSL_HAVE_FEATURE(cxx_exceptions)
#define ABSL_HAVE_EXCEPTIONS 1
#endif // ABSL_HAVE_FEATURE(cxx_exceptions)
-#else
+#elif defined(__clang__)
// Clang < 3.6
// http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro
#if defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions)
#define ABSL_HAVE_EXCEPTIONS 1
#endif // defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions)
-#endif // __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 6)
-
// Handle remaining special cases and default to exceptions being supported.
-#elif !(defined(__GNUC__) && (__GNUC__ < 5) && !defined(__EXCEPTIONS)) && \
- !(defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__cpp_exceptions)) && \
+#elif !(defined(__GNUC__) && (__GNUC__ < 5) && !defined(__EXCEPTIONS)) && \
+ !(ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0) && \
+ !defined(__cpp_exceptions)) && \
!(defined(_MSC_VER) && !defined(_CPPUNWIND))
#define ABSL_HAVE_EXCEPTIONS 1
#endif
@@ -369,10 +410,11 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// POSIX.1-2001.
#ifdef ABSL_HAVE_MMAP
#error ABSL_HAVE_MMAP cannot be directly set
-#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
- defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \
- defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \
- defined(__ASYLO__) || defined(__myriad2__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(_AIX) || defined(__ros__) || defined(__native_client__) || \
+ defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \
+ defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \
+ defined(__HAIKU__)
#define ABSL_HAVE_MMAP 1
#endif
@@ -383,7 +425,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM
#error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
- defined(__ros__)
+ defined(_AIX) || defined(__ros__)
#define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1
#endif
@@ -690,10 +732,6 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// a compiler instrumentation module and a run-time library.
#ifdef ABSL_HAVE_MEMORY_SANITIZER
#error "ABSL_HAVE_MEMORY_SANITIZER cannot be directly set."
-#elif defined(MEMORY_SANITIZER)
-// The MEMORY_SANITIZER macro is deprecated but we will continue to honor it
-// for now.
-#define ABSL_HAVE_MEMORY_SANITIZER 1
#elif defined(__SANITIZE_MEMORY__)
#define ABSL_HAVE_MEMORY_SANITIZER 1
#elif !defined(__native_client__) && ABSL_HAVE_FEATURE(memory_sanitizer)
@@ -705,10 +743,6 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// ThreadSanitizer (TSan) is a fast data race detector.
#ifdef ABSL_HAVE_THREAD_SANITIZER
#error "ABSL_HAVE_THREAD_SANITIZER cannot be directly set."
-#elif defined(THREAD_SANITIZER)
-// The THREAD_SANITIZER macro is deprecated but we will continue to honor it
-// for now.
-#define ABSL_HAVE_THREAD_SANITIZER 1
#elif defined(__SANITIZE_THREAD__)
#define ABSL_HAVE_THREAD_SANITIZER 1
#elif ABSL_HAVE_FEATURE(thread_sanitizer)
@@ -720,10 +754,6 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
// AddressSanitizer (ASan) is a fast memory error detector.
#ifdef ABSL_HAVE_ADDRESS_SANITIZER
#error "ABSL_HAVE_ADDRESS_SANITIZER cannot be directly set."
-#elif defined(ADDRESS_SANITIZER)
-// The ADDRESS_SANITIZER macro is deprecated but we will continue to honor it
-// for now.
-#define ABSL_HAVE_ADDRESS_SANITIZER 1
#elif defined(__SANITIZE_ADDRESS__)
#define ABSL_HAVE_ADDRESS_SANITIZER 1
#elif ABSL_HAVE_FEATURE(address_sanitizer)
diff --git a/grpc/third_party/abseil-cpp/absl/base/dynamic_annotations.h b/grpc/third_party/abseil-cpp/absl/base/dynamic_annotations.h
index 880cbf6e..3ea7c156 100644
--- a/grpc/third_party/abseil-cpp/absl/base/dynamic_annotations.h
+++ b/grpc/third_party/abseil-cpp/absl/base/dynamic_annotations.h
@@ -433,31 +433,6 @@ ABSL_NAMESPACE_END
#endif
-#ifdef __cplusplus
-#ifdef ABSL_HAVE_THREAD_SANITIZER
-ABSL_INTERNAL_BEGIN_EXTERN_C
-int RunningOnValgrind();
-double ValgrindSlowdown();
-ABSL_INTERNAL_END_EXTERN_C
-#else
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-ABSL_DEPRECATED(
- "Don't use this interface. It is misleading and is being deleted.")
-ABSL_ATTRIBUTE_ALWAYS_INLINE inline int RunningOnValgrind() { return 0; }
-ABSL_DEPRECATED(
- "Don't use this interface. It is misleading and is being deleted.")
-ABSL_ATTRIBUTE_ALWAYS_INLINE inline double ValgrindSlowdown() { return 1.0; }
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
-
-using absl::base_internal::RunningOnValgrind;
-using absl::base_internal::ValgrindSlowdown;
-#endif
-#endif
-
// -------------------------------------------------------------------------
// Address sanitizer annotations
@@ -471,7 +446,7 @@ using absl::base_internal::ValgrindSlowdown;
__sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid)
#define ABSL_ADDRESS_SANITIZER_REDZONE(name) \
struct { \
- char x[8] __attribute__((aligned(8))); \
+ alignas(8) char x[8]; \
} name
#else
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h b/grpc/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h
index 6ba89d05..77a5aec6 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h
@@ -536,7 +536,22 @@ class ThrowingValue : private exceptions_internal::TrackedObject {
}
// Memory management operators
- // Args.. allows us to overload regular and placement new in one shot
+ static void* operator new(size_t s) noexcept(
+ IsSpecified(TypeSpec::kNoThrowNew)) {
+ if (!IsSpecified(TypeSpec::kNoThrowNew)) {
+ exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true);
+ }
+ return ::operator new(s);
+ }
+
+ static void* operator new[](size_t s) noexcept(
+ IsSpecified(TypeSpec::kNoThrowNew)) {
+ if (!IsSpecified(TypeSpec::kNoThrowNew)) {
+ exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true);
+ }
+ return ::operator new[](s);
+ }
+
template <typename... Args>
static void* operator new(size_t s, Args&&... args) noexcept(
IsSpecified(TypeSpec::kNoThrowNew)) {
@@ -557,12 +572,6 @@ class ThrowingValue : private exceptions_internal::TrackedObject {
// Abseil doesn't support throwing overloaded operator delete. These are
// provided so a throwing operator-new can clean up after itself.
- //
- // We provide both regular and templated operator delete because if only the
- // templated version is provided as we did with operator new, the compiler has
- // no way of knowing which overload of operator delete to call. See
- // https://en.cppreference.com/w/cpp/memory/new/operator_delete and
- // https://en.cppreference.com/w/cpp/language/delete for the gory details.
void operator delete(void* p) noexcept { ::operator delete(p); }
template <typename... Args>
@@ -726,9 +735,8 @@ class ThrowingAllocator : private exceptions_internal::TrackedObject {
ThrowingAllocator select_on_container_copy_construction() noexcept(
IsSpecified(AllocSpec::kNoThrowAllocate)) {
- auto& out = *this;
ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION);
- return out;
+ return *this;
}
template <typename U>
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc b/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc
deleted file mode 100644
index 1b30c061..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/base/internal/exponential_biased.h"
-
-#include <stdint.h>
-
-#include <algorithm>
-#include <atomic>
-#include <cmath>
-#include <limits>
-
-#include "absl/base/attributes.h"
-#include "absl/base/optimization.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-// The algorithm generates a random number between 0 and 1 and applies the
-// inverse cumulative distribution function for an exponential. Specifically:
-// Let m be the inverse of the sample period, then the probability
-// distribution function is m*exp(-mx) so the CDF is
-// p = 1 - exp(-mx), so
-// q = 1 - p = exp(-mx)
-// log_e(q) = -mx
-// -log_e(q)/m = x
-// log_2(q) * (-log_e(2) * 1/m) = x
-// In the code, q is actually in the range 1 to 2**26, hence the -26 below
-int64_t ExponentialBiased::GetSkipCount(int64_t mean) {
- if (ABSL_PREDICT_FALSE(!initialized_)) {
- Initialize();
- }
-
- uint64_t rng = NextRandom(rng_);
- rng_ = rng;
-
- // Take the top 26 bits as the random number
- // (This plus the 1<<58 sampling bound give a max possible step of
- // 5194297183973780480 bytes.)
- // The uint32_t cast is to prevent a (hard-to-reproduce) NAN
- // under piii debug for some binaries.
- double q = static_cast<uint32_t>(rng >> (kPrngNumBits - 26)) + 1.0;
- // Put the computed p-value through the CDF of a geometric.
- double interval = bias_ + (std::log2(q) - 26) * (-std::log(2.0) * mean);
- // Very large values of interval overflow int64_t. To avoid that, we will
- // cheat and clamp any huge values to (int64_t max)/2. This is a potential
- // source of bias, but the mean would need to be such a large value that it's
- // not likely to come up. For example, with a mean of 1e18, the probability of
- // hitting this condition is about 1/1000. For a mean of 1e17, standard
- // calculators claim that this event won't happen.
- if (interval > static_cast<double>(std::numeric_limits<int64_t>::max() / 2)) {
- // Assume huge values are bias neutral, retain bias for next call.
- return std::numeric_limits<int64_t>::max() / 2;
- }
- double value = std::round(interval);
- bias_ = interval - value;
- return value;
-}
-
-int64_t ExponentialBiased::GetStride(int64_t mean) {
- return GetSkipCount(mean - 1) + 1;
-}
-
-void ExponentialBiased::Initialize() {
- // We don't get well distributed numbers from `this` so we call NextRandom() a
- // bunch to mush the bits around. We use a global_rand to handle the case
- // where the same thread (by memory address) gets created and destroyed
- // repeatedly.
- ABSL_CONST_INIT static std::atomic<uint32_t> global_rand(0);
- uint64_t r = reinterpret_cast<uint64_t>(this) +
- global_rand.fetch_add(1, std::memory_order_relaxed);
- for (int i = 0; i < 20; ++i) {
- r = NextRandom(r);
- }
- rng_ = r;
- initialized_ = true;
-}
-
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.h b/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.h
deleted file mode 100644
index 94f79a33..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 ABSL_BASE_INTERNAL_EXPONENTIAL_BIASED_H_
-#define ABSL_BASE_INTERNAL_EXPONENTIAL_BIASED_H_
-
-#include <stdint.h>
-
-#include "absl/base/config.h"
-#include "absl/base/macros.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-// ExponentialBiased provides a small and fast random number generator for a
-// rounded exponential distribution. This generator manages very little state,
-// and imposes no synchronization overhead. This makes it useful in specialized
-// scenarios requiring minimum overhead, such as stride based periodic sampling.
-//
-// ExponentialBiased provides two closely related functions, GetSkipCount() and
-// GetStride(), both returning a rounded integer defining a number of events
-// required before some event with a given mean probability occurs.
-//
-// The distribution is useful to generate a random wait time or some periodic
-// event with a given mean probability. For example, if an action is supposed to
-// happen on average once every 'N' events, then we can get a random 'stride'
-// counting down how long before the event to happen. For example, if we'd want
-// to sample one in every 1000 'Frobber' calls, our code could look like this:
-//
-// Frobber::Frobber() {
-// stride_ = exponential_biased_.GetStride(1000);
-// }
-//
-// void Frobber::Frob(int arg) {
-// if (--stride == 0) {
-// SampleFrob(arg);
-// stride_ = exponential_biased_.GetStride(1000);
-// }
-// ...
-// }
-//
-// The rounding of the return value creates a bias, especially for smaller means
-// where the distribution of the fraction is not evenly distributed. We correct
-// this bias by tracking the fraction we rounded up or down on each iteration,
-// effectively tracking the distance between the cumulative value, and the
-// rounded cumulative value. For example, given a mean of 2:
-//
-// raw = 1.63076, cumulative = 1.63076, rounded = 2, bias = -0.36923
-// raw = 0.14624, cumulative = 1.77701, rounded = 2, bias = 0.14624
-// raw = 4.93194, cumulative = 6.70895, rounded = 7, bias = -0.06805
-// raw = 0.24206, cumulative = 6.95101, rounded = 7, bias = 0.24206
-// etc...
-//
-// Adjusting with rounding bias is relatively trivial:
-//
-// double value = bias_ + exponential_distribution(mean)();
-// double rounded_value = std::round(value);
-// bias_ = value - rounded_value;
-// return rounded_value;
-//
-// This class is thread-compatible.
-class ExponentialBiased {
- public:
- // The number of bits set by NextRandom.
- static constexpr int kPrngNumBits = 48;
-
- // `GetSkipCount()` returns the number of events to skip before some chosen
- // event happens. For example, randomly tossing a coin, we will on average
- // throw heads once before we get tails. We can simulate random coin tosses
- // using GetSkipCount() as:
- //
- // ExponentialBiased eb;
- // for (...) {
- // int number_of_heads_before_tail = eb.GetSkipCount(1);
- // for (int flips = 0; flips < number_of_heads_before_tail; ++flips) {
- // printf("head...");
- // }
- // printf("tail\n");
- // }
- //
- int64_t GetSkipCount(int64_t mean);
-
- // GetStride() returns the number of events required for a specific event to
- // happen. See the class comments for a usage example. `GetStride()` is
- // equivalent to `GetSkipCount(mean - 1) + 1`. When to use `GetStride()` or
- // `GetSkipCount()` depends mostly on what best fits the use case.
- int64_t GetStride(int64_t mean);
-
- // Computes a random number in the range [0, 1<<(kPrngNumBits+1) - 1]
- //
- // This is public to enable testing.
- static uint64_t NextRandom(uint64_t rnd);
-
- private:
- void Initialize();
-
- uint64_t rng_{0};
- double bias_{0};
- bool initialized_{false};
-};
-
-// Returns the next prng value.
-// pRNG is: aX+b mod c with a = 0x5DEECE66D, b = 0xB, c = 1<<48
-// This is the lrand64 generator.
-inline uint64_t ExponentialBiased::NextRandom(uint64_t rnd) {
- const uint64_t prng_mult = uint64_t{0x5DEECE66D};
- const uint64_t prng_add = 0xB;
- const uint64_t prng_mod_power = 48;
- const uint64_t prng_mod_mask =
- ~((~static_cast<uint64_t>(0)) << prng_mod_power);
- return (prng_mult * rnd + prng_add) & prng_mod_mask;
-}
-
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
-
-#endif // ABSL_BASE_INTERNAL_EXPONENTIAL_BIASED_H_
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased_test.cc b/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased_test.cc
deleted file mode 100644
index 075583ca..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/exponential_biased_test.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/base/internal/exponential_biased.h"
-
-#include <stddef.h>
-
-#include <cmath>
-#include <cstdint>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "absl/strings/str_cat.h"
-
-using ::testing::Ge;
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-MATCHER_P2(IsBetween, a, b,
- absl::StrCat(std::string(negation ? "isn't" : "is"), " between ", a,
- " and ", b)) {
- return a <= arg && arg <= b;
-}
-
-// Tests of the quality of the random numbers generated
-// This uses the Anderson Darling test for uniformity.
-// See "Evaluating the Anderson-Darling Distribution" by Marsaglia
-// for details.
-
-// Short cut version of ADinf(z), z>0 (from Marsaglia)
-// This returns the p-value for Anderson Darling statistic in
-// the limit as n-> infinity. For finite n, apply the error fix below.
-double AndersonDarlingInf(double z) {
- if (z < 2) {
- return exp(-1.2337141 / z) / sqrt(z) *
- (2.00012 +
- (0.247105 -
- (0.0649821 - (0.0347962 - (0.011672 - 0.00168691 * z) * z) * z) *
- z) *
- z);
- }
- return exp(
- -exp(1.0776 -
- (2.30695 -
- (0.43424 - (0.082433 - (0.008056 - 0.0003146 * z) * z) * z) * z) *
- z));
-}
-
-// Corrects the approximation error in AndersonDarlingInf for small values of n
-// Add this to AndersonDarlingInf to get a better approximation
-// (from Marsaglia)
-double AndersonDarlingErrFix(int n, double x) {
- if (x > 0.8) {
- return (-130.2137 +
- (745.2337 -
- (1705.091 - (1950.646 - (1116.360 - 255.7844 * x) * x) * x) * x) *
- x) /
- n;
- }
- double cutoff = 0.01265 + 0.1757 / n;
- if (x < cutoff) {
- double t = x / cutoff;
- t = sqrt(t) * (1 - t) * (49 * t - 102);
- return t * (0.0037 / (n * n) + 0.00078 / n + 0.00006) / n;
- } else {
- double t = (x - cutoff) / (0.8 - cutoff);
- t = -0.00022633 +
- (6.54034 - (14.6538 - (14.458 - (8.259 - 1.91864 * t) * t) * t) * t) *
- t;
- return t * (0.04213 + 0.01365 / n) / n;
- }
-}
-
-// Returns the AndersonDarling p-value given n and the value of the statistic
-double AndersonDarlingPValue(int n, double z) {
- double ad = AndersonDarlingInf(z);
- double errfix = AndersonDarlingErrFix(n, ad);
- return ad + errfix;
-}
-
-double AndersonDarlingStatistic(const std::vector<double>& random_sample) {
- int n = random_sample.size();
- double ad_sum = 0;
- for (int i = 0; i < n; i++) {
- ad_sum += (2 * i + 1) *
- std::log(random_sample[i] * (1 - random_sample[n - 1 - i]));
- }
- double ad_statistic = -n - 1 / static_cast<double>(n) * ad_sum;
- return ad_statistic;
-}
-
-// Tests if the array of doubles is uniformly distributed.
-// Returns the p-value of the Anderson Darling Statistic
-// for the given set of sorted random doubles
-// See "Evaluating the Anderson-Darling Distribution" by
-// Marsaglia and Marsaglia for details.
-double AndersonDarlingTest(const std::vector<double>& random_sample) {
- double ad_statistic = AndersonDarlingStatistic(random_sample);
- double p = AndersonDarlingPValue(random_sample.size(), ad_statistic);
- return p;
-}
-
-TEST(ExponentialBiasedTest, CoinTossDemoWithGetSkipCount) {
- ExponentialBiased eb;
- for (int runs = 0; runs < 10; ++runs) {
- for (int flips = eb.GetSkipCount(1); flips > 0; --flips) {
- printf("head...");
- }
- printf("tail\n");
- }
- int heads = 0;
- for (int i = 0; i < 10000000; i += 1 + eb.GetSkipCount(1)) {
- ++heads;
- }
- printf("Heads = %d (%f%%)\n", heads, 100.0 * heads / 10000000);
-}
-
-TEST(ExponentialBiasedTest, SampleDemoWithStride) {
- ExponentialBiased eb;
- int stride = eb.GetStride(10);
- int samples = 0;
- for (int i = 0; i < 10000000; ++i) {
- if (--stride == 0) {
- ++samples;
- stride = eb.GetStride(10);
- }
- }
- printf("Samples = %d (%f%%)\n", samples, 100.0 * samples / 10000000);
-}
-
-
-// Testing that NextRandom generates uniform random numbers. Applies the
-// Anderson-Darling test for uniformity
-TEST(ExponentialBiasedTest, TestNextRandom) {
- for (auto n : std::vector<int>({
- 10, // Check short-range correlation
- 100, 1000,
- 10000 // Make sure there's no systemic error
- })) {
- uint64_t x = 1;
- // This assumes that the prng returns 48 bit numbers
- uint64_t max_prng_value = static_cast<uint64_t>(1) << 48;
- // Initialize.
- for (int i = 1; i <= 20; i++) {
- x = ExponentialBiased::NextRandom(x);
- }
- std::vector<uint64_t> int_random_sample(n);
- // Collect samples
- for (int i = 0; i < n; i++) {
- int_random_sample[i] = x;
- x = ExponentialBiased::NextRandom(x);
- }
- // First sort them...
- std::sort(int_random_sample.begin(), int_random_sample.end());
- std::vector<double> random_sample(n);
- // Convert them to uniform randoms (in the range [0,1])
- for (int i = 0; i < n; i++) {
- random_sample[i] =
- static_cast<double>(int_random_sample[i]) / max_prng_value;
- }
- // Now compute the Anderson-Darling statistic
- double ad_pvalue = AndersonDarlingTest(random_sample);
- EXPECT_GT(std::min(ad_pvalue, 1 - ad_pvalue), 0.0001)
- << "prng is not uniform: n = " << n << " p = " << ad_pvalue;
- }
-}
-
-// The generator needs to be available as a thread_local and as a static
-// variable.
-TEST(ExponentialBiasedTest, InitializationModes) {
- ABSL_CONST_INIT static ExponentialBiased eb_static;
- EXPECT_THAT(eb_static.GetSkipCount(2), Ge(0));
-
-#ifdef ABSL_HAVE_THREAD_LOCAL
- thread_local ExponentialBiased eb_thread;
- EXPECT_THAT(eb_thread.GetSkipCount(2), Ge(0));
-#endif
-
- ExponentialBiased eb_stack;
- EXPECT_THAT(eb_stack.GetSkipCount(2), Ge(0));
-}
-
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.cc b/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.cc
deleted file mode 100644
index 520dabba..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/base/internal/periodic_sampler.h"
-
-#include <atomic>
-
-#include "absl/base/internal/exponential_biased.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-int64_t PeriodicSamplerBase::GetExponentialBiased(int period) noexcept {
- return rng_.GetStride(period);
-}
-
-bool PeriodicSamplerBase::SubtleConfirmSample() noexcept {
- int current_period = period();
-
- // Deal with period case 0 (always off) and 1 (always on)
- if (ABSL_PREDICT_FALSE(current_period < 2)) {
- stride_ = 0;
- return current_period == 1;
- }
-
- // Check if this is the first call to Sample()
- if (ABSL_PREDICT_FALSE(stride_ == 1)) {
- stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period));
- if (static_cast<int64_t>(stride_) < -1) {
- ++stride_;
- return false;
- }
- }
-
- stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period));
- return true;
-}
-
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.h b/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.h
deleted file mode 100644
index f8a86796..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler.h
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 ABSL_BASE_INTERNAL_PERIODIC_SAMPLER_H_
-#define ABSL_BASE_INTERNAL_PERIODIC_SAMPLER_H_
-
-#include <stdint.h>
-
-#include <atomic>
-
-#include "absl/base/internal/exponential_biased.h"
-#include "absl/base/optimization.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-
-// PeriodicSamplerBase provides the basic period sampler implementation.
-//
-// This is the base class for the templated PeriodicSampler class, which holds
-// a global std::atomic value identified by a user defined tag, such that
-// each specific PeriodSampler implementation holds its own global period.
-//
-// PeriodicSamplerBase is thread-compatible except where stated otherwise.
-class PeriodicSamplerBase {
- public:
- // PeriodicSamplerBase is trivial / copyable / movable / destructible.
- PeriodicSamplerBase() = default;
- PeriodicSamplerBase(PeriodicSamplerBase&&) = default;
- PeriodicSamplerBase(const PeriodicSamplerBase&) = default;
-
- // Returns true roughly once every `period` calls. This is established by a
- // randomly picked `stride` that is counted down on each call to `Sample`.
- // This stride is picked such that the probability of `Sample()` returning
- // true is 1 in `period`.
- inline bool Sample() noexcept;
-
- // The below methods are intended for optimized use cases where the
- // size of the inlined fast path code is highly important. Applications
- // should use the `Sample()` method unless they have proof that their
- // specific use case requires the optimizations offered by these methods.
- //
- // An example of such a use case is SwissTable sampling. All sampling checks
- // are in inlined SwissTable methods, and the number of call sites is huge.
- // In this case, the inlined code size added to each translation unit calling
- // SwissTable methods is non-trivial.
- //
- // The `SubtleMaybeSample()` function spuriously returns true even if the
- // function should not be sampled, applications MUST match each call to
- // 'SubtleMaybeSample()' returning true with a `SubtleConfirmSample()` call,
- // and use the result of the latter as the sampling decision.
- // In other words: the code should logically be equivalent to:
- //
- // if (SubtleMaybeSample() && SubtleConfirmSample()) {
- // // Sample this call
- // }
- //
- // In the 'inline-size' optimized case, the `SubtleConfirmSample()` call can
- // be placed out of line, for example, the typical use case looks as follows:
- //
- // // --- frobber.h -----------
- // void FrobberSampled();
- //
- // inline void FrobberImpl() {
- // // ...
- // }
- //
- // inline void Frobber() {
- // if (ABSL_PREDICT_FALSE(sampler.SubtleMaybeSample())) {
- // FrobberSampled();
- // } else {
- // FrobberImpl();
- // }
- // }
- //
- // // --- frobber.cc -----------
- // void FrobberSampled() {
- // if (!sampler.SubtleConfirmSample())) {
- // // Spurious false positive
- // FrobberImpl();
- // return;
- // }
- //
- // // Sampled execution
- // // ...
- // }
- inline bool SubtleMaybeSample() noexcept;
- bool SubtleConfirmSample() noexcept;
-
- protected:
- // We explicitly don't use a virtual destructor as this class is never
- // virtually destroyed, and it keeps the class trivial, which avoids TLS
- // prologue and epilogue code for our TLS instances.
- ~PeriodicSamplerBase() = default;
-
- // Returns the next stride for our sampler.
- // This function is virtual for testing purposes only.
- virtual int64_t GetExponentialBiased(int period) noexcept;
-
- private:
- // Returns the current period of this sampler. Thread-safe.
- virtual int period() const noexcept = 0;
-
- // Keep and decrement stride_ as an unsigned integer, but compare the value
- // to zero casted as a signed int. clang and msvc do not create optimum code
- // if we use signed for the combined decrement and sign comparison.
- //
- // Below 3 alternative options, all compiles generate the best code
- // using the unsigned increment <---> signed int comparison option.
- //
- // Option 1:
- // int64_t stride_;
- // if (ABSL_PREDICT_TRUE(++stride_ < 0)) { ... }
- //
- // GCC x64 (OK) : https://gcc.godbolt.org/z/R5MzzA
- // GCC ppc (OK) : https://gcc.godbolt.org/z/z7NZAt
- // Clang x64 (BAD): https://gcc.godbolt.org/z/t4gPsd
- // ICC x64 (OK) : https://gcc.godbolt.org/z/rE6s8W
- // MSVC x64 (OK) : https://gcc.godbolt.org/z/ARMXqS
- //
- // Option 2:
- // int64_t stride_ = 0;
- // if (ABSL_PREDICT_TRUE(--stride_ >= 0)) { ... }
- //
- // GCC x64 (OK) : https://gcc.godbolt.org/z/jSQxYK
- // GCC ppc (OK) : https://gcc.godbolt.org/z/VJdYaA
- // Clang x64 (BAD): https://gcc.godbolt.org/z/Xm4NjX
- // ICC x64 (OK) : https://gcc.godbolt.org/z/4snaFd
- // MSVC x64 (BAD): https://gcc.godbolt.org/z/BgnEKE
- //
- // Option 3:
- // uint64_t stride_;
- // if (ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) { ... }
- //
- // GCC x64 (OK) : https://gcc.godbolt.org/z/bFbfPy
- // GCC ppc (OK) : https://gcc.godbolt.org/z/S9KkUE
- // Clang x64 (OK) : https://gcc.godbolt.org/z/UYzRb4
- // ICC x64 (OK) : https://gcc.godbolt.org/z/ptTNfD
- // MSVC x64 (OK) : https://gcc.godbolt.org/z/76j4-5
- uint64_t stride_ = 0;
- ExponentialBiased rng_;
-};
-
-inline bool PeriodicSamplerBase::SubtleMaybeSample() noexcept {
- // See comments on `stride_` for the unsigned increment / signed compare.
- if (ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) {
- return false;
- }
- return true;
-}
-
-inline bool PeriodicSamplerBase::Sample() noexcept {
- return ABSL_PREDICT_FALSE(SubtleMaybeSample()) ? SubtleConfirmSample()
- : false;
-}
-
-// PeriodicSampler is a concreted periodic sampler implementation.
-// The user provided Tag identifies the implementation, and is required to
-// isolate the global state of this instance from other instances.
-//
-// Typical use case:
-//
-// struct HashTablezTag {};
-// thread_local PeriodicSampler sampler;
-//
-// void HashTableSamplingLogic(...) {
-// if (sampler.Sample()) {
-// HashTableSlowSamplePath(...);
-// }
-// }
-//
-template <typename Tag, int default_period = 0>
-class PeriodicSampler final : public PeriodicSamplerBase {
- public:
- ~PeriodicSampler() = default;
-
- int period() const noexcept final {
- return period_.load(std::memory_order_relaxed);
- }
-
- // Sets the global period for this sampler. Thread-safe.
- // Setting a period of 0 disables the sampler, i.e., every call to Sample()
- // will return false. Setting a period of 1 puts the sampler in 'always on'
- // mode, i.e., every call to Sample() returns true.
- static void SetGlobalPeriod(int period) {
- period_.store(period, std::memory_order_relaxed);
- }
-
- private:
- static std::atomic<int> period_;
-};
-
-template <typename Tag, int default_period>
-std::atomic<int> PeriodicSampler<Tag, default_period>::period_(default_period);
-
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
-
-#endif // ABSL_BASE_INTERNAL_PERIODIC_SAMPLER_H_
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_benchmark.cc b/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_benchmark.cc
deleted file mode 100644
index 5ad469ce..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_benchmark.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "benchmark/benchmark.h"
-#include "absl/base/internal/periodic_sampler.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-namespace {
-
-template <typename Sampler>
-void BM_Sample(Sampler* sampler, benchmark::State& state) {
- for (auto _ : state) {
- benchmark::DoNotOptimize(sampler);
- benchmark::DoNotOptimize(sampler->Sample());
- }
-}
-
-template <typename Sampler>
-void BM_SampleMinunumInlined(Sampler* sampler, benchmark::State& state) {
- for (auto _ : state) {
- benchmark::DoNotOptimize(sampler);
- if (ABSL_PREDICT_FALSE(sampler->SubtleMaybeSample())) {
- benchmark::DoNotOptimize(sampler->SubtleConfirmSample());
- }
- }
-}
-
-void BM_PeriodicSampler_TinySample(benchmark::State& state) {
- struct Tag {};
- PeriodicSampler<Tag, 10> sampler;
- BM_Sample(&sampler, state);
-}
-BENCHMARK(BM_PeriodicSampler_TinySample);
-
-void BM_PeriodicSampler_ShortSample(benchmark::State& state) {
- struct Tag {};
- PeriodicSampler<Tag, 1024> sampler;
- BM_Sample(&sampler, state);
-}
-BENCHMARK(BM_PeriodicSampler_ShortSample);
-
-void BM_PeriodicSampler_LongSample(benchmark::State& state) {
- struct Tag {};
- PeriodicSampler<Tag, 1024 * 1024> sampler;
- BM_Sample(&sampler, state);
-}
-BENCHMARK(BM_PeriodicSampler_LongSample);
-
-void BM_PeriodicSampler_LongSampleMinunumInlined(benchmark::State& state) {
- struct Tag {};
- PeriodicSampler<Tag, 1024 * 1024> sampler;
- BM_SampleMinunumInlined(&sampler, state);
-}
-BENCHMARK(BM_PeriodicSampler_LongSampleMinunumInlined);
-
-void BM_PeriodicSampler_Disabled(benchmark::State& state) {
- struct Tag {};
- PeriodicSampler<Tag, 0> sampler;
- BM_Sample(&sampler, state);
-}
-BENCHMARK(BM_PeriodicSampler_Disabled);
-
-} // namespace
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_test.cc b/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_test.cc
deleted file mode 100644
index 3b301e37..00000000
--- a/grpc/third_party/abseil-cpp/absl/base/internal/periodic_sampler_test.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2019 The Abseil Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/base/internal/periodic_sampler.h"
-
-#include <thread> // NOLINT(build/c++11)
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "absl/base/attributes.h"
-#include "absl/base/macros.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace base_internal {
-namespace {
-
-using testing::Eq;
-using testing::Return;
-using testing::StrictMock;
-
-class MockPeriodicSampler : public PeriodicSamplerBase {
- public:
- virtual ~MockPeriodicSampler() = default;
-
- MOCK_METHOD(int, period, (), (const, noexcept));
- MOCK_METHOD(int64_t, GetExponentialBiased, (int), (noexcept));
-};
-
-TEST(PeriodicSamplerBaseTest, Sample) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(16));
- EXPECT_CALL(sampler, GetExponentialBiased(16))
- .WillOnce(Return(2))
- .WillOnce(Return(3))
- .WillOnce(Return(4));
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerBaseTest, ImmediatelySample) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16));
- EXPECT_CALL(sampler, GetExponentialBiased(16))
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .WillOnce(Return(3));
-
- EXPECT_TRUE(sampler.Sample());
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerBaseTest, Disabled) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(0));
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerBaseTest, AlwaysOn) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(1));
-
- EXPECT_TRUE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerBaseTest, Disable) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).WillOnce(Return(16));
- EXPECT_CALL(sampler, GetExponentialBiased(16)).WillOnce(Return(3));
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-
- EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(0));
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerBaseTest, Enable) {
- StrictMock<MockPeriodicSampler> sampler;
-
- EXPECT_CALL(sampler, period()).WillOnce(Return(0));
- EXPECT_FALSE(sampler.Sample());
-
- EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16));
- EXPECT_CALL(sampler, GetExponentialBiased(16))
- .Times(2)
- .WillRepeatedly(Return(3));
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
- EXPECT_TRUE(sampler.Sample());
-
- EXPECT_FALSE(sampler.Sample());
- EXPECT_FALSE(sampler.Sample());
-}
-
-TEST(PeriodicSamplerTest, ConstructConstInit) {
- struct Tag {};
- ABSL_CONST_INIT static PeriodicSampler<Tag> sampler;
- (void)sampler;
-}
-
-TEST(PeriodicSamplerTest, DefaultPeriod0) {
- struct Tag {};
- PeriodicSampler<Tag> sampler;
- EXPECT_THAT(sampler.period(), Eq(0));
-}
-
-TEST(PeriodicSamplerTest, DefaultPeriod) {
- struct Tag {};
- PeriodicSampler<Tag, 100> sampler;
- EXPECT_THAT(sampler.period(), Eq(100));
-}
-
-TEST(PeriodicSamplerTest, SetGlobalPeriod) {
- struct Tag1 {};
- struct Tag2 {};
- PeriodicSampler<Tag1, 25> sampler1;
- PeriodicSampler<Tag2, 50> sampler2;
-
- EXPECT_THAT(sampler1.period(), Eq(25));
- EXPECT_THAT(sampler2.period(), Eq(50));
-
- std::thread thread([] {
- PeriodicSampler<Tag1, 25> sampler1;
- PeriodicSampler<Tag2, 50> sampler2;
- EXPECT_THAT(sampler1.period(), Eq(25));
- EXPECT_THAT(sampler2.period(), Eq(50));
- sampler1.SetGlobalPeriod(10);
- sampler2.SetGlobalPeriod(20);
- });
- thread.join();
-
- EXPECT_THAT(sampler1.period(), Eq(10));
- EXPECT_THAT(sampler2.period(), Eq(20));
-}
-
-} // namespace
-} // namespace base_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/spinlock.h b/grpc/third_party/abseil-cpp/absl/base/internal/spinlock.h
index c73b5e09..ac40daff 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/spinlock.h
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/spinlock.h
@@ -16,13 +16,15 @@
// Most users requiring mutual exclusion should use Mutex.
// SpinLock is provided for use in two situations:
-// - for use in code that Mutex itself depends on
+// - for use by Abseil internal code that Mutex itself depends on
// - for async signal safety (see below)
// SpinLock is async signal safe. If a spinlock is used within a signal
// handler, all code that acquires the lock must ensure that the signal cannot
// arrive while they are holding the lock. Typically, this is done by blocking
// the signal.
+//
+// Threads waiting on a SpinLock may be woken in an arbitrary order.
#ifndef ABSL_BASE_INTERNAL_SPINLOCK_H_
#define ABSL_BASE_INTERNAL_SPINLOCK_H_
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h b/grpc/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h
index 579bd09f..9a1adcda 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h
@@ -39,6 +39,8 @@ struct SpinLockWaitTransition {
// satisfying 0<=i<n && trans[i].done, atomically make the transition,
// then return the old value of *w. Make any other atomic transitions
// where !trans[i].done, but continue waiting.
+//
+// Wakeups for threads blocked on SpinLockWait do not respect priorities.
uint32_t SpinLockWait(std::atomic<uint32_t> *w, int n,
const SpinLockWaitTransition trans[],
SchedulingMode scheduling_mode);
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/sysinfo.cc b/grpc/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
index 4a3b2050..a7cfb461 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/sysinfo.cc
@@ -61,9 +61,78 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace base_internal {
+namespace {
+
+#if defined(_WIN32)
+
+// Returns number of bits set in `bitMask`
+DWORD Win32CountSetBits(ULONG_PTR bitMask) {
+ for (DWORD bitSetCount = 0; ; ++bitSetCount) {
+ if (bitMask == 0) return bitSetCount;
+ bitMask &= bitMask - 1;
+ }
+}
+
+// Returns the number of logical CPUs using GetLogicalProcessorInformation(), or
+// 0 if the number of processors is not available or can not be computed.
+// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getlogicalprocessorinformation
+int Win32NumCPUs() {
+#pragma comment(lib, "kernel32.lib")
+ using Info = SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
+
+ DWORD info_size = sizeof(Info);
+ Info* info(static_cast<Info*>(malloc(info_size)));
+ if (info == nullptr) return 0;
+
+ bool success = GetLogicalProcessorInformation(info, &info_size);
+ if (!success && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+ free(info);
+ info = static_cast<Info*>(malloc(info_size));
+ if (info == nullptr) return 0;
+ success = GetLogicalProcessorInformation(info, &info_size);
+ }
+
+ DWORD logicalProcessorCount = 0;
+ if (success) {
+ Info* ptr = info;
+ DWORD byteOffset = 0;
+ while (byteOffset + sizeof(Info) <= info_size) {
+ switch (ptr->Relationship) {
+ case RelationProcessorCore:
+ logicalProcessorCount += Win32CountSetBits(ptr->ProcessorMask);
+ break;
+
+ case RelationNumaNode:
+ case RelationCache:
+ case RelationProcessorPackage:
+ // Ignore other entries
+ break;
+
+ default:
+ // Ignore unknown entries
+ break;
+ }
+ byteOffset += sizeof(Info);
+ ptr++;
+ }
+ }
+ free(info);
+ return logicalProcessorCount;
+}
+
+#endif
+
+} // namespace
+
+
static int GetNumCPUs() {
#if defined(__myriad2__)
return 1;
+#elif defined(_WIN32)
+ const unsigned hardware_concurrency = Win32NumCPUs();
+ return hardware_concurrency ? hardware_concurrency : 1;
+#elif defined(_AIX)
+ return sysconf(_SC_NPROCESSORS_ONLN);
#else
// Other possibilities:
// - Read /sys/devices/system/cpu/online and use cpumask_parse()
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.cc b/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.cc
index 6ea010ed..9950e63a 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.cc
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.cc
@@ -120,10 +120,10 @@ void SetCurrentThreadIdentity(
ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11
// Please see the comment on `CurrentThreadIdentityIfPresent` in
-// thread_identity.h. Because DLLs cannot expose thread_local variables in
-// headers, we opt for the correct-but-slower option of placing the definition
-// of this function only in a translation unit inside DLL.
-#if defined(ABSL_BUILD_DLL) || defined(ABSL_CONSUME_DLL)
+// thread_identity.h. When we cannot expose thread_local variables in
+// headers, we opt for the correct-but-slower option of not inlining this
+// function.
+#ifndef ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT
ThreadIdentity* CurrentThreadIdentityIfPresent() { return thread_identity_ptr; }
#endif
#endif
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.h b/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.h
index 9ee651a3..659694b3 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.h
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/thread_identity.h
@@ -188,25 +188,25 @@ void ClearCurrentThreadIdentity();
// May be chosen at compile time via: -DABSL_FORCE_THREAD_IDENTITY_MODE=<mode
// index>
#ifdef ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC
-#error ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be direcly set
+#error ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be directly set
#else
#define ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 0
#endif
#ifdef ABSL_THREAD_IDENTITY_MODE_USE_TLS
-#error ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be direcly set
+#error ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be directly set
#else
#define ABSL_THREAD_IDENTITY_MODE_USE_TLS 1
#endif
#ifdef ABSL_THREAD_IDENTITY_MODE_USE_CPP11
-#error ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be direcly set
+#error ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be directly set
#else
#define ABSL_THREAD_IDENTITY_MODE_USE_CPP11 2
#endif
#ifdef ABSL_THREAD_IDENTITY_MODE
-#error ABSL_THREAD_IDENTITY_MODE cannot be direcly set
+#error ABSL_THREAD_IDENTITY_MODE cannot be directly set
#elif defined(ABSL_FORCE_THREAD_IDENTITY_MODE)
#define ABSL_THREAD_IDENTITY_MODE ABSL_FORCE_THREAD_IDENTITY_MODE
#elif defined(_WIN32) && !defined(__MINGW32__)
@@ -236,13 +236,18 @@ ABSL_CONST_INIT extern thread_local ThreadIdentity* thread_identity_ptr;
#error Thread-local storage not detected on this platform
#endif
-// thread_local variables cannot be in headers exposed by DLLs. However, it is
-// important for performance reasons in general that
-// `CurrentThreadIdentityIfPresent` be inlined. This is not possible across a
-// DLL boundary so, with DLLs, we opt to have the function not be inlined. Note
+// thread_local variables cannot be in headers exposed by DLLs or in certain
+// build configurations on Apple platforms. However, it is important for
+// performance reasons in general that `CurrentThreadIdentityIfPresent` be
+// inlined. In the other cases we opt to have the function not be inlined. Note
// that `CurrentThreadIdentityIfPresent` is declared above so we can exclude
-// this entire inline definition when compiling as a DLL.
-#if !defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL)
+// this entire inline definition.
+#if !defined(__APPLE__) && !defined(ABSL_BUILD_DLL) && \
+ !defined(ABSL_CONSUME_DLL)
+#define ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT 1
+#endif
+
+#ifdef ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT
inline ThreadIdentity* CurrentThreadIdentityIfPresent() {
return thread_identity_ptr;
}
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc b/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
index 1545288c..4d352bd1 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
@@ -87,6 +87,10 @@ int64_t UnscaledCycleClock::Now() {
double UnscaledCycleClock::Frequency() {
#ifdef __GLIBC__
return __ppc_get_timebase_freq();
+#elif defined(_AIX)
+ // This is the same constant value as returned by
+ // __ppc_get_timebase_freq().
+ return static_cast<double>(512000000);
#elif defined(__FreeBSD__)
static once_flag init_timebase_frequency_once;
static double timebase_frequency = 0.0;
@@ -119,6 +123,18 @@ double UnscaledCycleClock::Frequency() {
return aarch64_timer_frequency;
}
+#elif defined(__riscv)
+
+int64_t UnscaledCycleClock::Now() {
+ int64_t virtual_timer_value;
+ asm volatile("rdcycle %0" : "=r"(virtual_timer_value));
+ return virtual_timer_value;
+}
+
+double UnscaledCycleClock::Frequency() {
+ return base_internal::NominalCPUFrequency();
+}
+
#elif defined(_M_IX86) || defined(_M_X64)
#pragma intrinsic(__rdtsc)
diff --git a/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h b/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
index 82f2c87a..681ff8f9 100644
--- a/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
+++ b/grpc/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
@@ -46,8 +46,8 @@
// The following platforms have an implementation of a hardware counter.
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
- defined(__powerpc__) || defined(__ppc__) || \
- defined(_M_IX86) || defined(_M_X64)
+ defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \
+ defined(_M_IX86) || defined(_M_X64)
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0
@@ -80,8 +80,8 @@
// This macro can be used to test if UnscaledCycleClock::Frequency()
// is NominalCPUFrequency() on a particular platform.
-#if (defined(__i386__) || defined(__x86_64__) || \
- defined(_M_IX86) || defined(_M_X64))
+#if (defined(__i386__) || defined(__x86_64__) || defined(__riscv) || \
+ defined(_M_IX86) || defined(_M_X64))
#define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY
#endif
diff --git a/grpc/third_party/abseil-cpp/absl/base/log_severity_test.cc b/grpc/third_party/abseil-cpp/absl/base/log_severity_test.cc
index 2c6872b0..55b26d17 100644
--- a/grpc/third_party/abseil-cpp/absl/base/log_severity_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/base/log_severity_test.cc
@@ -52,9 +52,9 @@ TEST(StreamTest, Works) {
Eq("absl::LogSeverity(4)"));
}
-static_assert(
- absl::flags_internal::FlagUseOneWordStorage<absl::LogSeverity>::value,
- "Flags of type absl::LogSeverity ought to be lock-free.");
+static_assert(absl::flags_internal::FlagUseValueAndInitBitStorage<
+ absl::LogSeverity>::value,
+ "Flags of type absl::LogSeverity ought to be lock-free.");
using ParseFlagFromOutOfRangeIntegerTest = TestWithParam<int64_t>;
INSTANTIATE_TEST_SUITE_P(
diff --git a/grpc/third_party/abseil-cpp/absl/base/options.h b/grpc/third_party/abseil-cpp/absl/base/options.h
index eca879af..56b4e36e 100644
--- a/grpc/third_party/abseil-cpp/absl/base/options.h
+++ b/grpc/third_party/abseil-cpp/absl/base/options.h
@@ -206,7 +206,7 @@
// allowed.
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
-#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20210324
+#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20211102
// ABSL_OPTION_HARDENED
//
diff --git a/grpc/third_party/abseil-cpp/absl/cleanup/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/cleanup/BUILD.bazel
index 5cca898f..2154d9f1 100644
--- a/grpc/third_party/abseil-cpp/absl/cleanup/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/cleanup/BUILD.bazel
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt
index a2dd78a8..26a6d0dc 100644
--- a/grpc/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/cleanup/CMakeLists.txt
@@ -51,5 +51,5 @@ absl_cc_test(
absl::cleanup
absl::config
absl::utility
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/cleanup/cleanup.h b/grpc/third_party/abseil-cpp/absl/cleanup/cleanup.h
index 61b53d55..960ccd08 100644
--- a/grpc/third_party/abseil-cpp/absl/cleanup/cleanup.h
+++ b/grpc/third_party/abseil-cpp/absl/cleanup/cleanup.h
@@ -86,25 +86,25 @@ class ABSL_MUST_USE_RESULT Cleanup final {
"Callbacks that return values are not supported.");
public:
- Cleanup(Callback callback) // NOLINT
- : storage_(std::move(callback), /* is_callback_engaged = */ true) {}
+ Cleanup(Callback callback) : storage_(std::move(callback)) {} // NOLINT
Cleanup(Cleanup&& other) = default;
void Cancel() && {
ABSL_HARDENING_ASSERT(storage_.IsCallbackEngaged());
- storage_.DisengageCallback();
+ storage_.DestroyCallback();
}
void Invoke() && {
ABSL_HARDENING_ASSERT(storage_.IsCallbackEngaged());
- storage_.DisengageCallback();
storage_.InvokeCallback();
+ storage_.DestroyCallback();
}
~Cleanup() {
if (storage_.IsCallbackEngaged()) {
storage_.InvokeCallback();
+ storage_.DestroyCallback();
}
}
diff --git a/grpc/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc b/grpc/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc
index 792595d6..46b88589 100644
--- a/grpc/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/cleanup/cleanup_test.cc
@@ -264,4 +264,48 @@ TYPED_TEST(CleanupTest, Move) {
EXPECT_FALSE(called); // Destructor shouldn't invoke the callback
}
+int DestructionCount = 0;
+
+struct DestructionCounter {
+ void operator()() {}
+
+ ~DestructionCounter() { ++DestructionCount; }
+};
+
+TYPED_TEST(CleanupTest, DestructorDestroys) {
+ {
+ auto cleanup =
+ absl::MakeCleanup(TypeParam::AsCallback(DestructionCounter()));
+ DestructionCount = 0;
+ }
+
+ EXPECT_EQ(DestructionCount, 1); // Engaged cleanup destroys
+}
+
+TYPED_TEST(CleanupTest, CancelDestroys) {
+ {
+ auto cleanup =
+ absl::MakeCleanup(TypeParam::AsCallback(DestructionCounter()));
+ DestructionCount = 0;
+
+ std::move(cleanup).Cancel();
+ EXPECT_EQ(DestructionCount, 1); // Cancel destroys
+ }
+
+ EXPECT_EQ(DestructionCount, 1); // Canceled cleanup does not double destroy
+}
+
+TYPED_TEST(CleanupTest, InvokeDestroys) {
+ {
+ auto cleanup =
+ absl::MakeCleanup(TypeParam::AsCallback(DestructionCounter()));
+ DestructionCount = 0;
+
+ std::move(cleanup).Invoke();
+ EXPECT_EQ(DestructionCount, 1); // Invoke destroys
+ }
+
+ EXPECT_EQ(DestructionCount, 1); // Invoked cleanup does not double destroy
+}
+
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h b/grpc/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h
index b4c40737..2783fcb7 100644
--- a/grpc/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h
+++ b/grpc/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h
@@ -15,10 +15,12 @@
#ifndef ABSL_CLEANUP_INTERNAL_CLEANUP_H_
#define ABSL_CLEANUP_INTERNAL_CLEANUP_H_
+#include <new>
#include <type_traits>
#include <utility>
#include "absl/base/internal/invoke.h"
+#include "absl/base/macros.h"
#include "absl/base/thread_annotations.h"
#include "absl/utility/utility.h"
@@ -45,14 +47,22 @@ class Storage {
public:
Storage() = delete;
- Storage(Callback callback, bool is_callback_engaged)
- : callback_(std::move(callback)),
- is_callback_engaged_(is_callback_engaged) {}
+ explicit Storage(Callback callback) {
+ // Placement-new into a character buffer is used for eager destruction when
+ // the cleanup is invoked or cancelled. To ensure this optimizes well, the
+ // behavior is implemented locally instead of using an absl::optional.
+ ::new (GetCallbackBuffer()) Callback(std::move(callback));
+ is_callback_engaged_ = true;
+ }
+
+ Storage(Storage&& other) {
+ ABSL_HARDENING_ASSERT(other.IsCallbackEngaged());
- Storage(Storage&& other)
- : callback_(std::move(other.callback_)),
- is_callback_engaged_(
- absl::exchange(other.is_callback_engaged_, false)) {}
+ ::new (GetCallbackBuffer()) Callback(std::move(other.GetCallback()));
+ is_callback_engaged_ = true;
+
+ other.DestroyCallback();
+ }
Storage(const Storage& other) = delete;
@@ -60,17 +70,26 @@ class Storage {
Storage& operator=(const Storage& other) = delete;
+ void* GetCallbackBuffer() { return static_cast<void*>(+callback_buffer_); }
+
+ Callback& GetCallback() {
+ return *reinterpret_cast<Callback*>(GetCallbackBuffer());
+ }
+
bool IsCallbackEngaged() const { return is_callback_engaged_; }
- void DisengageCallback() { is_callback_engaged_ = false; }
+ void DestroyCallback() {
+ is_callback_engaged_ = false;
+ GetCallback().~Callback();
+ }
void InvokeCallback() ABSL_NO_THREAD_SAFETY_ANALYSIS {
- std::move(callback_)();
+ std::move(GetCallback())();
}
private:
- Callback callback_;
bool is_callback_engaged_;
+ alignas(Callback) char callback_buffer_[sizeof(Callback)];
};
} // namespace cleanup_internal
diff --git a/grpc/third_party/abseil-cpp/absl/container/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/container/BUILD.bazel
index f22fdc60..ffaee19c 100644
--- a/grpc/third_party/abseil-cpp/absl/container/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/container/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -510,9 +509,10 @@ cc_library(
":have_sse",
"//absl/base",
"//absl/base:core_headers",
- "//absl/base:exponential_biased",
"//absl/debugging:stacktrace",
"//absl/memory",
+ "//absl/profiling:exponential_biased",
+ "//absl/profiling:sample_recorder",
"//absl/synchronization",
"//absl/utility",
],
@@ -526,6 +526,7 @@ cc_test(
":hashtablez_sampler",
":have_sse",
"//absl/base:core_headers",
+ "//absl/profiling:sample_recorder",
"//absl/synchronization",
"//absl/synchronization:thread_pool",
"//absl/time",
@@ -598,7 +599,6 @@ cc_library(
":hashtable_debug_hooks",
":hashtablez_sampler",
":have_sse",
- ":layout",
"//absl/base:config",
"//absl/base:core_headers",
"//absl/base:endian",
@@ -876,6 +876,22 @@ cc_test(
],
)
+cc_test(
+ name = "sample_element_size_test",
+ srcs = ["sample_element_size_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ tags = NOTEST_TAGS_NONMOBILE,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":flat_hash_map",
+ ":flat_hash_set",
+ ":node_hash_map",
+ ":node_hash_set",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
cc_library(
name = "btree",
srcs = [
diff --git a/grpc/third_party/abseil-cpp/absl/container/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/container/CMakeLists.txt
index 2d7d0e65..78584d2c 100644
--- a/grpc/third_party/abseil-cpp/absl/container/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/container/CMakeLists.txt
@@ -80,7 +80,7 @@ absl_cc_test(
absl::strings
absl::test_instance_tracker
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -109,7 +109,7 @@ absl_cc_test(
absl::optional
absl::test_instance_tracker
absl::utility
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -144,7 +144,7 @@ absl_cc_test(
absl::exception_testing
absl::hash_testing
absl::memory
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -158,7 +158,7 @@ absl_cc_test(
absl::fixed_array
absl::config
absl::exception_safety_testing
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -222,7 +222,7 @@ absl_cc_test(
absl::memory
absl::raw_logging_internal
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -236,7 +236,7 @@ absl_cc_test(
absl::inlined_vector
absl::config
absl::exception_safety_testing
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -262,7 +262,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::test_instance_tracker
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -297,7 +297,7 @@ absl_cc_test(
absl::unordered_map_modifiers_test
absl::any
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -335,7 +335,7 @@ absl_cc_test(
absl::memory
absl::raw_logging_internal
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -370,7 +370,7 @@ absl_cc_test(
absl::unordered_map_lookup_test
absl::unordered_map_members_test
absl::unordered_map_modifiers_test
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -404,7 +404,7 @@ absl_cc_test(
absl::unordered_set_lookup_test
absl::unordered_set_members_test
absl::unordered_set_modifiers_test
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -433,7 +433,7 @@ absl_cc_test(
absl::container_memory
absl::strings
absl::test_instance_tracker
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -465,7 +465,7 @@ absl_cc_test(
absl::hash
absl::random_random
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -507,7 +507,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::hash_policy_testing
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -531,7 +531,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::hash_policy_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -548,6 +548,7 @@ absl_cc_library(
absl::base
absl::exponential_biased
absl::have_sse
+ absl::sample_recorder
absl::synchronization
)
@@ -561,7 +562,7 @@ absl_cc_test(
DEPS
absl::hashtablez_sampler
absl::have_sse
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -618,7 +619,7 @@ absl_cc_test(
DEPS
absl::hash_policy_traits
absl::node_hash_policy
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -666,7 +667,6 @@ absl_cc_library(
absl::hash_policy_traits
absl::hashtable_debug_hooks
absl::have_sse
- absl::layout
absl::memory
absl::meta
absl::optional
@@ -693,7 +693,7 @@ absl_cc_test(
absl::core_headers
absl::raw_logging_internal
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -707,7 +707,7 @@ absl_cc_test(
absl::raw_hash_set
absl::tracked
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -740,7 +740,7 @@ absl_cc_test(
absl::core_headers
absl::raw_logging_internal
absl::span
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -765,7 +765,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -779,7 +779,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -792,7 +792,7 @@ absl_cc_library(
${ABSL_TEST_COPTS}
DEPS
absl::type_traits
- gmock
+ GTest::gmock
TESTONLY
)
@@ -806,7 +806,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -820,7 +820,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -834,7 +834,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -847,7 +847,7 @@ absl_cc_library(
${ABSL_TEST_COPTS}
DEPS
absl::type_traits
- gmock
+ GTest::gmock
TESTONLY
)
@@ -861,7 +861,7 @@ absl_cc_library(
DEPS
absl::hash_generator_testing
absl::hash_policy_testing
- gmock
+ GTest::gmock
TESTONLY
)
@@ -877,7 +877,7 @@ absl_cc_test(
absl::unordered_set_lookup_test
absl::unordered_set_members_test
absl::unordered_set_modifiers_test
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -892,5 +892,20 @@ absl_cc_test(
absl::unordered_map_lookup_test
absl::unordered_map_members_test
absl::unordered_map_modifiers_test
- gmock_main
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ sample_element_size_test
+ SRCS
+ "sample_element_size_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::flat_hash_map
+ absl::flat_hash_set
+ absl::node_hash_map
+ absl::node_hash_set
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/container/btree_map.h b/grpc/third_party/abseil-cpp/absl/container/btree_map.h
index ea49d446..f0a8d4a6 100644
--- a/grpc/third_party/abseil-cpp/absl/container/btree_map.h
+++ b/grpc/third_party/abseil-cpp/absl/container/btree_map.h
@@ -366,8 +366,8 @@ class btree_map
// Determines whether an element comparing equal to the given `key` exists
// within the `btree_map`, returning `true` if so or `false` otherwise.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::contains;
// btree_map::count()
@@ -378,8 +378,8 @@ class btree_map
// the `btree_map`. Note that this function will return either `1` or `0`
// since duplicate elements are not allowed within a `btree_map`.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::count;
// btree_map::equal_range()
@@ -395,10 +395,34 @@ class btree_map
//
// Finds an element with the passed `key` within the `btree_map`.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::find;
+ // btree_map::lower_bound()
+ //
+ // template <typename K> iterator lower_bound(const K& key):
+ // template <typename K> const_iterator lower_bound(const K& key) const:
+ //
+ // Finds the first element with a key that is not less than `key` within the
+ // `btree_map`.
+ //
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
+ using Base::lower_bound;
+
+ // btree_map::upper_bound()
+ //
+ // template <typename K> iterator upper_bound(const K& key):
+ // template <typename K> const_iterator upper_bound(const K& key) const:
+ //
+ // Finds the first element with a key that is greater than `key` within the
+ // `btree_map`.
+ //
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
+ using Base::upper_bound;
+
// btree_map::operator[]()
//
// Returns a reference to the value mapped to the passed key within the
@@ -669,9 +693,8 @@ class btree_multimap
// btree_multimap::merge()
//
- // Extracts elements from a given `source` btree_multimap into this
- // `btree_multimap`. If the destination `btree_multimap` already contains an
- // element with an equivalent key, that element is not extracted.
+ // Extracts all elements from a given `source` btree_multimap into this
+ // `btree_multimap`.
using Base::merge;
// btree_multimap::swap(btree_multimap& other)
@@ -691,8 +714,8 @@ class btree_multimap
// Determines whether an element comparing equal to the given `key` exists
// within the `btree_multimap`, returning `true` if so or `false` otherwise.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::contains;
// btree_multimap::count()
@@ -702,8 +725,8 @@ class btree_multimap
// Returns the number of elements comparing equal to the given `key` within
// the `btree_multimap`.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::count;
// btree_multimap::equal_range()
@@ -720,10 +743,34 @@ class btree_multimap
//
// Finds an element with the passed `key` within the `btree_multimap`.
//
- // Supports heterogeneous lookup, provided that the map is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
using Base::find;
+ // btree_multimap::lower_bound()
+ //
+ // template <typename K> iterator lower_bound(const K& key):
+ // template <typename K> const_iterator lower_bound(const K& key) const:
+ //
+ // Finds the first element with a key that is not less than `key` within the
+ // `btree_multimap`.
+ //
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
+ using Base::lower_bound;
+
+ // btree_multimap::upper_bound()
+ //
+ // template <typename K> iterator upper_bound(const K& key):
+ // template <typename K> const_iterator upper_bound(const K& key) const:
+ //
+ // Finds the first element with a key that is greater than `key` within the
+ // `btree_multimap`.
+ //
+ // Supports heterogeneous lookup, provided that the map has a compatible
+ // heterogeneous comparator.
+ using Base::upper_bound;
+
// btree_multimap::get_allocator()
//
// Returns the allocator function associated with this `btree_multimap`.
diff --git a/grpc/third_party/abseil-cpp/absl/container/btree_set.h b/grpc/third_party/abseil-cpp/absl/container/btree_set.h
index 21ef0a03..89739006 100644
--- a/grpc/third_party/abseil-cpp/absl/container/btree_set.h
+++ b/grpc/third_party/abseil-cpp/absl/container/btree_set.h
@@ -300,8 +300,8 @@ class btree_set
// Determines whether an element comparing equal to the given `key` exists
// within the `btree_set`, returning `true` if so or `false` otherwise.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::contains;
// btree_set::count()
@@ -312,8 +312,8 @@ class btree_set
// the `btree_set`. Note that this function will return either `1` or `0`
// since duplicate elements are not allowed within a `btree_set`.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::count;
// btree_set::equal_range()
@@ -330,10 +330,32 @@ class btree_set
//
// Finds an element with the passed `key` within the `btree_set`.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::find;
+ // btree_set::lower_bound()
+ //
+ // template <typename K> iterator lower_bound(const K& key):
+ // template <typename K> const_iterator lower_bound(const K& key) const:
+ //
+ // Finds the first element that is not less than `key` within the `btree_set`.
+ //
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
+ using Base::lower_bound;
+
+ // btree_set::upper_bound()
+ //
+ // template <typename K> iterator upper_bound(const K& key):
+ // template <typename K> const_iterator upper_bound(const K& key) const:
+ //
+ // Finds the first element that is greater than `key` within the `btree_set`.
+ //
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
+ using Base::upper_bound;
+
// btree_set::get_allocator()
//
// Returns the allocator function associated with this `btree_set`.
@@ -582,9 +604,8 @@ class btree_multiset
// btree_multiset::merge()
//
- // Extracts elements from a given `source` btree_multiset into this
- // `btree_multiset`. If the destination `btree_multiset` already contains an
- // element with an equivalent key, that element is not extracted.
+ // Extracts all elements from a given `source` btree_multiset into this
+ // `btree_multiset`.
using Base::merge;
// btree_multiset::swap(btree_multiset& other)
@@ -604,8 +625,8 @@ class btree_multiset
// Determines whether an element comparing equal to the given `key` exists
// within the `btree_multiset`, returning `true` if so or `false` otherwise.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::contains;
// btree_multiset::count()
@@ -615,8 +636,8 @@ class btree_multiset
// Returns the number of elements comparing equal to the given `key` within
// the `btree_multiset`.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::count;
// btree_multiset::equal_range()
@@ -633,10 +654,34 @@ class btree_multiset
//
// Finds an element with the passed `key` within the `btree_multiset`.
//
- // Supports heterogeneous lookup, provided that the set is provided a
- // compatible heterogeneous comparator.
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
using Base::find;
+ // btree_multiset::lower_bound()
+ //
+ // template <typename K> iterator lower_bound(const K& key):
+ // template <typename K> const_iterator lower_bound(const K& key) const:
+ //
+ // Finds the first element that is not less than `key` within the
+ // `btree_multiset`.
+ //
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
+ using Base::lower_bound;
+
+ // btree_multiset::upper_bound()
+ //
+ // template <typename K> iterator upper_bound(const K& key):
+ // template <typename K> const_iterator upper_bound(const K& key) const:
+ //
+ // Finds the first element that is greater than `key` within the
+ // `btree_multiset`.
+ //
+ // Supports heterogeneous lookup, provided that the set has a compatible
+ // heterogeneous comparator.
+ using Base::upper_bound;
+
// btree_multiset::get_allocator()
//
// Returns the allocator function associated with this `btree_multiset`.
diff --git a/grpc/third_party/abseil-cpp/absl/container/btree_test.cc b/grpc/third_party/abseil-cpp/absl/container/btree_test.cc
index 74337df2..d27cf271 100644
--- a/grpc/third_party/abseil-cpp/absl/container/btree_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/btree_test.cc
@@ -595,7 +595,7 @@ void BtreeTest() {
using V = typename remove_pair_const<typename T::value_type>::type;
const std::vector<V> random_values = GenerateValuesWithSeed<V>(
absl::GetFlag(FLAGS_test_values), 4 * absl::GetFlag(FLAGS_test_values),
- testing::GTEST_FLAG(random_seed));
+ GTEST_FLAG_GET(random_seed));
unique_checker<T, C> container;
@@ -619,7 +619,7 @@ void BtreeMultiTest() {
using V = typename remove_pair_const<typename T::value_type>::type;
const std::vector<V> random_values = GenerateValuesWithSeed<V>(
absl::GetFlag(FLAGS_test_values), 4 * absl::GetFlag(FLAGS_test_values),
- testing::GTEST_FLAG(random_seed));
+ GTEST_FLAG_GET(random_seed));
multi_checker<T, C> container;
@@ -1708,10 +1708,25 @@ TEST(Btree, StrSplitCompatible) {
EXPECT_EQ(split_set, expected_set);
}
-// We can't use EXPECT_EQ/etc. to compare absl::weak_ordering because they
-// convert literal 0 to int and absl::weak_ordering can only be compared with
-// literal 0. Defining this function allows for avoiding ClangTidy warnings.
-bool Identity(const bool b) { return b; }
+TEST(Btree, KeyComp) {
+ absl::btree_set<int> s;
+ EXPECT_TRUE(s.key_comp()(1, 2));
+ EXPECT_FALSE(s.key_comp()(2, 2));
+ EXPECT_FALSE(s.key_comp()(2, 1));
+
+ absl::btree_map<int, int> m1;
+ EXPECT_TRUE(m1.key_comp()(1, 2));
+ EXPECT_FALSE(m1.key_comp()(2, 2));
+ EXPECT_FALSE(m1.key_comp()(2, 1));
+
+ // Even though we internally adapt the comparator of `m2` to be three-way and
+ // heterogeneous, the comparator we expose through key_comp() is the original
+ // unadapted comparator.
+ absl::btree_map<std::string, int> m2;
+ EXPECT_TRUE(m2.key_comp()("a", "b"));
+ EXPECT_FALSE(m2.key_comp()("b", "b"));
+ EXPECT_FALSE(m2.key_comp()("b", "a"));
+}
TEST(Btree, ValueComp) {
absl::btree_set<int> s;
@@ -1724,13 +1739,13 @@ TEST(Btree, ValueComp) {
EXPECT_FALSE(m1.value_comp()(std::make_pair(2, 0), std::make_pair(2, 0)));
EXPECT_FALSE(m1.value_comp()(std::make_pair(2, 0), std::make_pair(1, 0)));
+ // Even though we internally adapt the comparator of `m2` to be three-way and
+ // heterogeneous, the comparator we expose through value_comp() is based on
+ // the original unadapted comparator.
absl::btree_map<std::string, int> m2;
- EXPECT_TRUE(Identity(
- m2.value_comp()(std::make_pair("a", 0), std::make_pair("b", 0)) < 0));
- EXPECT_TRUE(Identity(
- m2.value_comp()(std::make_pair("b", 0), std::make_pair("b", 0)) == 0));
- EXPECT_TRUE(Identity(
- m2.value_comp()(std::make_pair("b", 0), std::make_pair("a", 0)) > 0));
+ EXPECT_TRUE(m2.value_comp()(std::make_pair("a", 0), std::make_pair("b", 0)));
+ EXPECT_FALSE(m2.value_comp()(std::make_pair("b", 0), std::make_pair("b", 0)));
+ EXPECT_FALSE(m2.value_comp()(std::make_pair("b", 0), std::make_pair("a", 0)));
}
TEST(Btree, DefaultConstruction) {
@@ -2893,6 +2908,46 @@ TEST(Btree, AllocMoveConstructor_DifferentAlloc) {
EXPECT_EQ(bytes_used2, original_bytes_used);
}
+bool IntCmp(const int a, const int b) { return a < b; }
+
+TEST(Btree, SupportsFunctionPtrComparator) {
+ absl::btree_set<int, decltype(IntCmp) *> set(IntCmp);
+ set.insert({1, 2, 3});
+ EXPECT_THAT(set, ElementsAre(1, 2, 3));
+ EXPECT_TRUE(set.key_comp()(1, 2));
+ EXPECT_TRUE(set.value_comp()(1, 2));
+
+ absl::btree_map<int, int, decltype(IntCmp) *> map(&IntCmp);
+ map[1] = 1;
+ EXPECT_THAT(map, ElementsAre(Pair(1, 1)));
+ EXPECT_TRUE(map.key_comp()(1, 2));
+ EXPECT_TRUE(map.value_comp()(std::make_pair(1, 1), std::make_pair(2, 2)));
+}
+
+template <typename Compare>
+struct TransparentPassThroughComp {
+ using is_transparent = void;
+
+ // This will fail compilation if we attempt a comparison that Compare does not
+ // support, and the failure will happen inside the function implementation so
+ // it can't be avoided by using SFINAE on this comparator.
+ template <typename T, typename U>
+ bool operator()(const T &lhs, const U &rhs) const {
+ return Compare()(lhs, rhs);
+ }
+};
+
+TEST(Btree,
+ SupportsTransparentComparatorThatDoesNotImplementAllVisibleOperators) {
+ absl::btree_set<MultiKey, TransparentPassThroughComp<MultiKeyComp>> set;
+ set.insert(MultiKey{1, 2});
+ EXPECT_TRUE(set.contains(1));
+}
+
+TEST(Btree, ConstructImplicitlyWithUnadaptedComparator) {
+ absl::btree_set<MultiKey, MultiKeyComp> set = {{}, MultiKeyComp{}};
+}
+
} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/fixed_array.h b/grpc/third_party/abseil-cpp/absl/container/fixed_array.h
index fcb3e545..839ba0bc 100644
--- a/grpc/third_party/abseil-cpp/absl/container/fixed_array.h
+++ b/grpc/third_party/abseil-cpp/absl/container/fixed_array.h
@@ -73,11 +73,6 @@ constexpr static auto kFixedArrayUseDefault = static_cast<size_t>(-1);
// uninitialized (e.g. int, int[4], double), and others default-constructed.
// This matches the behavior of c-style arrays and `std::array`, but not
// `std::vector`.
-//
-// Note that `FixedArray` does not provide a public allocator; if it requires a
-// heap allocation, it will do so with global `::operator new[]()` and
-// `::operator delete[]()`, even if T provides class-scope overrides for these
-// operators.
template <typename T, size_t N = kFixedArrayUseDefault,
typename A = std::allocator<T>>
class FixedArray {
diff --git a/grpc/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc b/grpc/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc
index 89ec60c9..8dda1d35 100644
--- a/grpc/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc
@@ -282,6 +282,32 @@ TEST(FlatHashMap, NodeHandleMutableKeyAccess) {
}
#endif
+TEST(FlatHashMap, Reserve) {
+ // Verify that if we reserve(size() + n) then we can perform n insertions
+ // without a rehash, i.e., without invalidating any references.
+ for (size_t trial = 0; trial < 20; ++trial) {
+ for (size_t initial = 3; initial < 100; ++initial) {
+ // Fill in `initial` entries, then erase 2 of them, then reserve space for
+ // two inserts and check for reference stability while doing the inserts.
+ flat_hash_map<size_t, size_t> map;
+ for (size_t i = 0; i < initial; ++i) {
+ map[i] = i;
+ }
+ map.erase(0);
+ map.erase(1);
+ map.reserve(map.size() + 2);
+ size_t& a2 = map[2];
+ // In the event of a failure, asan will complain in one of these two
+ // assignments.
+ map[initial] = a2;
+ map[initial + 1] = a2;
+ // Fail even when not under asan:
+ size_t& a2new = map[2];
+ EXPECT_EQ(&a2, &a2new);
+ }
+ }
+}
+
} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/inlined_vector.h b/grpc/third_party/abseil-cpp/absl/container/inlined_vector.h
index 7c182342..df9e0991 100644
--- a/grpc/third_party/abseil-cpp/absl/container/inlined_vector.h
+++ b/grpc/third_party/abseil-cpp/absl/container/inlined_vector.h
@@ -72,37 +72,43 @@ class InlinedVector {
using Storage = inlined_vector_internal::Storage<T, N, A>;
- using AllocatorTraits = typename Storage::AllocatorTraits;
- using RValueReference = typename Storage::RValueReference;
- using MoveIterator = typename Storage::MoveIterator;
- using IsMemcpyOk = typename Storage::IsMemcpyOk;
-
- template <typename Iterator>
+ template <typename TheA>
+ using AllocatorTraits = inlined_vector_internal::AllocatorTraits<TheA>;
+ template <typename TheA>
+ using MoveIterator = inlined_vector_internal::MoveIterator<TheA>;
+ template <typename TheA>
+ using IsMemcpyOk = inlined_vector_internal::IsMemcpyOk<TheA>;
+
+ template <typename TheA, typename Iterator>
using IteratorValueAdapter =
- typename Storage::template IteratorValueAdapter<Iterator>;
- using CopyValueAdapter = typename Storage::CopyValueAdapter;
- using DefaultValueAdapter = typename Storage::DefaultValueAdapter;
+ inlined_vector_internal::IteratorValueAdapter<TheA, Iterator>;
+ template <typename TheA>
+ using CopyValueAdapter = inlined_vector_internal::CopyValueAdapter<TheA>;
+ template <typename TheA>
+ using DefaultValueAdapter =
+ inlined_vector_internal::DefaultValueAdapter<TheA>;
template <typename Iterator>
using EnableIfAtLeastForwardIterator = absl::enable_if_t<
- inlined_vector_internal::IsAtLeastForwardIterator<Iterator>::value>;
+ inlined_vector_internal::IsAtLeastForwardIterator<Iterator>::value, int>;
template <typename Iterator>
using DisableIfAtLeastForwardIterator = absl::enable_if_t<
- !inlined_vector_internal::IsAtLeastForwardIterator<Iterator>::value>;
+ !inlined_vector_internal::IsAtLeastForwardIterator<Iterator>::value, int>;
public:
- using allocator_type = typename Storage::allocator_type;
- using value_type = typename Storage::value_type;
- using pointer = typename Storage::pointer;
- using const_pointer = typename Storage::const_pointer;
- using size_type = typename Storage::size_type;
- using difference_type = typename Storage::difference_type;
- using reference = typename Storage::reference;
- using const_reference = typename Storage::const_reference;
- using iterator = typename Storage::iterator;
- using const_iterator = typename Storage::const_iterator;
- using reverse_iterator = typename Storage::reverse_iterator;
- using const_reverse_iterator = typename Storage::const_reverse_iterator;
+ using allocator_type = A;
+ using value_type = inlined_vector_internal::ValueType<A>;
+ using pointer = inlined_vector_internal::Pointer<A>;
+ using const_pointer = inlined_vector_internal::ConstPointer<A>;
+ using size_type = inlined_vector_internal::SizeType<A>;
+ using difference_type = inlined_vector_internal::DifferenceType<A>;
+ using reference = inlined_vector_internal::Reference<A>;
+ using const_reference = inlined_vector_internal::ConstReference<A>;
+ using iterator = inlined_vector_internal::Iterator<A>;
+ using const_iterator = inlined_vector_internal::ConstIterator<A>;
+ using reverse_iterator = inlined_vector_internal::ReverseIterator<A>;
+ using const_reverse_iterator =
+ inlined_vector_internal::ConstReverseIterator<A>;
// ---------------------------------------------------------------------------
// InlinedVector Constructors and Destructor
@@ -111,28 +117,28 @@ class InlinedVector {
// Creates an empty inlined vector with a value-initialized allocator.
InlinedVector() noexcept(noexcept(allocator_type())) : storage_() {}
- // Creates an empty inlined vector with a copy of `alloc`.
- explicit InlinedVector(const allocator_type& alloc) noexcept
- : storage_(alloc) {}
+ // Creates an empty inlined vector with a copy of `allocator`.
+ explicit InlinedVector(const allocator_type& allocator) noexcept
+ : storage_(allocator) {}
// Creates an inlined vector with `n` copies of `value_type()`.
explicit InlinedVector(size_type n,
- const allocator_type& alloc = allocator_type())
- : storage_(alloc) {
- storage_.Initialize(DefaultValueAdapter(), n);
+ const allocator_type& allocator = allocator_type())
+ : storage_(allocator) {
+ storage_.Initialize(DefaultValueAdapter<A>(), n);
}
// Creates an inlined vector with `n` copies of `v`.
InlinedVector(size_type n, const_reference v,
- const allocator_type& alloc = allocator_type())
- : storage_(alloc) {
- storage_.Initialize(CopyValueAdapter(v), n);
+ const allocator_type& allocator = allocator_type())
+ : storage_(allocator) {
+ storage_.Initialize(CopyValueAdapter<A>(std::addressof(v)), n);
}
// Creates an inlined vector with copies of the elements of `list`.
InlinedVector(std::initializer_list<value_type> list,
- const allocator_type& alloc = allocator_type())
- : InlinedVector(list.begin(), list.end(), alloc) {}
+ const allocator_type& allocator = allocator_type())
+ : InlinedVector(list.begin(), list.end(), allocator) {}
// Creates an inlined vector with elements constructed from the provided
// forward iterator range [`first`, `last`).
@@ -141,35 +147,36 @@ class InlinedVector {
// this constructor with two integral arguments and a call to the above
// `InlinedVector(size_type, const_reference)` constructor.
template <typename ForwardIterator,
- EnableIfAtLeastForwardIterator<ForwardIterator>* = nullptr>
+ EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
InlinedVector(ForwardIterator first, ForwardIterator last,
- const allocator_type& alloc = allocator_type())
- : storage_(alloc) {
- storage_.Initialize(IteratorValueAdapter<ForwardIterator>(first),
+ const allocator_type& allocator = allocator_type())
+ : storage_(allocator) {
+ storage_.Initialize(IteratorValueAdapter<A, ForwardIterator>(first),
std::distance(first, last));
}
// Creates an inlined vector with elements constructed from the provided input
// iterator range [`first`, `last`).
template <typename InputIterator,
- DisableIfAtLeastForwardIterator<InputIterator>* = nullptr>
+ DisableIfAtLeastForwardIterator<InputIterator> = 0>
InlinedVector(InputIterator first, InputIterator last,
- const allocator_type& alloc = allocator_type())
- : storage_(alloc) {
+ const allocator_type& allocator = allocator_type())
+ : storage_(allocator) {
std::copy(first, last, std::back_inserter(*this));
}
// Creates an inlined vector by copying the contents of `other` using
// `other`'s allocator.
InlinedVector(const InlinedVector& other)
- : InlinedVector(other, *other.storage_.GetAllocPtr()) {}
+ : InlinedVector(other, other.storage_.GetAllocator()) {}
- // Creates an inlined vector by copying the contents of `other` using `alloc`.
- InlinedVector(const InlinedVector& other, const allocator_type& alloc)
- : storage_(alloc) {
+ // Creates an inlined vector by copying the contents of `other` using the
+ // provided `allocator`.
+ InlinedVector(const InlinedVector& other, const allocator_type& allocator)
+ : storage_(allocator) {
if (other.empty()) {
// Empty; nothing to do.
- } else if (IsMemcpyOk::value && !other.storage_.GetIsAllocated()) {
+ } else if (IsMemcpyOk<A>::value && !other.storage_.GetIsAllocated()) {
// Memcpy-able and do not need allocation.
storage_.MemcpyFrom(other.storage_);
} else {
@@ -194,23 +201,23 @@ class InlinedVector {
InlinedVector(InlinedVector&& other) noexcept(
absl::allocator_is_nothrow<allocator_type>::value ||
std::is_nothrow_move_constructible<value_type>::value)
- : storage_(*other.storage_.GetAllocPtr()) {
- if (IsMemcpyOk::value) {
+ : storage_(other.storage_.GetAllocator()) {
+ if (IsMemcpyOk<A>::value) {
storage_.MemcpyFrom(other.storage_);
other.storage_.SetInlinedSize(0);
} else if (other.storage_.GetIsAllocated()) {
- storage_.SetAllocatedData(other.storage_.GetAllocatedData(),
- other.storage_.GetAllocatedCapacity());
+ storage_.SetAllocation({other.storage_.GetAllocatedData(),
+ other.storage_.GetAllocatedCapacity()});
storage_.SetAllocatedSize(other.storage_.GetSize());
other.storage_.SetInlinedSize(0);
} else {
- IteratorValueAdapter<MoveIterator> other_values(
- MoveIterator(other.storage_.GetInlinedData()));
+ IteratorValueAdapter<A, MoveIterator<A>> other_values(
+ MoveIterator<A>(other.storage_.GetInlinedData()));
- inlined_vector_internal::ConstructElements(
- storage_.GetAllocPtr(), storage_.GetInlinedData(), &other_values,
+ inlined_vector_internal::ConstructElements<A>(
+ storage_.GetAllocator(), storage_.GetInlinedData(), other_values,
other.storage_.GetSize());
storage_.SetInlinedSize(other.storage_.GetSize());
@@ -218,30 +225,32 @@ class InlinedVector {
}
// Creates an inlined vector by moving in the contents of `other` with a copy
- // of `alloc`.
+ // of `allocator`.
//
- // NOTE: if `other`'s allocator is not equal to `alloc`, even if `other`
+ // NOTE: if `other`'s allocator is not equal to `allocator`, even if `other`
// contains allocated memory, this move constructor will still allocate. Since
// allocation is performed, this constructor can only be `noexcept` if the
// specified allocator is also `noexcept`.
- InlinedVector(InlinedVector&& other, const allocator_type& alloc) noexcept(
- absl::allocator_is_nothrow<allocator_type>::value)
- : storage_(alloc) {
- if (IsMemcpyOk::value) {
+ InlinedVector(
+ InlinedVector&& other,
+ const allocator_type& allocator)
+ noexcept(absl::allocator_is_nothrow<allocator_type>::value)
+ : storage_(allocator) {
+ if (IsMemcpyOk<A>::value) {
storage_.MemcpyFrom(other.storage_);
other.storage_.SetInlinedSize(0);
- } else if ((*storage_.GetAllocPtr() == *other.storage_.GetAllocPtr()) &&
+ } else if ((storage_.GetAllocator() == other.storage_.GetAllocator()) &&
other.storage_.GetIsAllocated()) {
- storage_.SetAllocatedData(other.storage_.GetAllocatedData(),
- other.storage_.GetAllocatedCapacity());
+ storage_.SetAllocation({other.storage_.GetAllocatedData(),
+ other.storage_.GetAllocatedCapacity()});
storage_.SetAllocatedSize(other.storage_.GetSize());
other.storage_.SetInlinedSize(0);
} else {
- storage_.Initialize(
- IteratorValueAdapter<MoveIterator>(MoveIterator(other.data())),
- other.size());
+ storage_.Initialize(IteratorValueAdapter<A, MoveIterator<A>>(
+ MoveIterator<A>(other.data())),
+ other.size());
}
}
@@ -442,7 +451,7 @@ class InlinedVector {
// `InlinedVector::get_allocator()`
//
// Returns a copy of the inlined vector's allocator.
- allocator_type get_allocator() const { return *storage_.GetAllocPtr(); }
+ allocator_type get_allocator() const { return storage_.GetAllocator(); }
// ---------------------------------------------------------------------------
// InlinedVector Member Mutators
@@ -476,16 +485,16 @@ class InlinedVector {
// unspecified state.
InlinedVector& operator=(InlinedVector&& other) {
if (ABSL_PREDICT_TRUE(this != std::addressof(other))) {
- if (IsMemcpyOk::value || other.storage_.GetIsAllocated()) {
- inlined_vector_internal::DestroyElements(storage_.GetAllocPtr(), data(),
- size());
+ if (IsMemcpyOk<A>::value || other.storage_.GetIsAllocated()) {
+ inlined_vector_internal::DestroyElements<A>(storage_.GetAllocator(),
+ data(), size());
storage_.DeallocateIfAllocated();
storage_.MemcpyFrom(other.storage_);
other.storage_.SetInlinedSize(0);
} else {
- storage_.Assign(IteratorValueAdapter<MoveIterator>(
- MoveIterator(other.storage_.GetInlinedData())),
+ storage_.Assign(IteratorValueAdapter<A, MoveIterator<A>>(
+ MoveIterator<A>(other.storage_.GetInlinedData())),
other.size());
}
}
@@ -497,7 +506,7 @@ class InlinedVector {
//
// Replaces the contents of the inlined vector with `n` copies of `v`.
void assign(size_type n, const_reference v) {
- storage_.Assign(CopyValueAdapter(v), n);
+ storage_.Assign(CopyValueAdapter<A>(std::addressof(v)), n);
}
// Overload of `InlinedVector::assign(...)` that replaces the contents of the
@@ -511,9 +520,9 @@ class InlinedVector {
//
// NOTE: this overload is for iterators that are "forward" category or better.
template <typename ForwardIterator,
- EnableIfAtLeastForwardIterator<ForwardIterator>* = nullptr>
+ EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
void assign(ForwardIterator first, ForwardIterator last) {
- storage_.Assign(IteratorValueAdapter<ForwardIterator>(first),
+ storage_.Assign(IteratorValueAdapter<A, ForwardIterator>(first),
std::distance(first, last));
}
@@ -522,7 +531,7 @@ class InlinedVector {
//
// NOTE: this overload is for iterators that are "input" category.
template <typename InputIterator,
- DisableIfAtLeastForwardIterator<InputIterator>* = nullptr>
+ DisableIfAtLeastForwardIterator<InputIterator> = 0>
void assign(InputIterator first, InputIterator last) {
size_type i = 0;
for (; i < size() && first != last; ++i, static_cast<void>(++first)) {
@@ -541,7 +550,7 @@ class InlinedVector {
// is larger than `size()`, new elements are value-initialized.
void resize(size_type n) {
ABSL_HARDENING_ASSERT(n <= max_size());
- storage_.Resize(DefaultValueAdapter(), n);
+ storage_.Resize(DefaultValueAdapter<A>(), n);
}
// Overload of `InlinedVector::resize(...)` that resizes the inlined vector to
@@ -551,7 +560,7 @@ class InlinedVector {
// is larger than `size()`, new elements are copied-constructed from `v`.
void resize(size_type n, const_reference v) {
ABSL_HARDENING_ASSERT(n <= max_size());
- storage_.Resize(CopyValueAdapter(v), n);
+ storage_.Resize(CopyValueAdapter<A>(std::addressof(v)), n);
}
// `InlinedVector::insert(...)`
@@ -564,7 +573,7 @@ class InlinedVector {
// Overload of `InlinedVector::insert(...)` that inserts `v` at `pos` using
// move semantics, returning an `iterator` to the newly inserted element.
- iterator insert(const_iterator pos, RValueReference v) {
+ iterator insert(const_iterator pos, value_type&& v) {
return emplace(pos, std::move(v));
}
@@ -577,7 +586,8 @@ class InlinedVector {
if (ABSL_PREDICT_TRUE(n != 0)) {
value_type dealias = v;
- return storage_.Insert(pos, CopyValueAdapter(dealias), n);
+ return storage_.Insert(pos, CopyValueAdapter<A>(std::addressof(dealias)),
+ n);
} else {
return const_cast<iterator>(pos);
}
@@ -596,14 +606,15 @@ class InlinedVector {
//
// NOTE: this overload is for iterators that are "forward" category or better.
template <typename ForwardIterator,
- EnableIfAtLeastForwardIterator<ForwardIterator>* = nullptr>
+ EnableIfAtLeastForwardIterator<ForwardIterator> = 0>
iterator insert(const_iterator pos, ForwardIterator first,
ForwardIterator last) {
ABSL_HARDENING_ASSERT(pos >= begin());
ABSL_HARDENING_ASSERT(pos <= end());
if (ABSL_PREDICT_TRUE(first != last)) {
- return storage_.Insert(pos, IteratorValueAdapter<ForwardIterator>(first),
+ return storage_.Insert(pos,
+ IteratorValueAdapter<A, ForwardIterator>(first),
std::distance(first, last));
} else {
return const_cast<iterator>(pos);
@@ -616,7 +627,7 @@ class InlinedVector {
//
// NOTE: this overload is for iterators that are "input" category.
template <typename InputIterator,
- DisableIfAtLeastForwardIterator<InputIterator>* = nullptr>
+ DisableIfAtLeastForwardIterator<InputIterator> = 0>
iterator insert(const_iterator pos, InputIterator first, InputIterator last) {
ABSL_HARDENING_ASSERT(pos >= begin());
ABSL_HARDENING_ASSERT(pos <= end());
@@ -640,8 +651,8 @@ class InlinedVector {
value_type dealias(std::forward<Args>(args)...);
return storage_.Insert(pos,
- IteratorValueAdapter<MoveIterator>(
- MoveIterator(std::addressof(dealias))),
+ IteratorValueAdapter<A, MoveIterator<A>>(
+ MoveIterator<A>(std::addressof(dealias))),
1);
}
@@ -661,7 +672,7 @@ class InlinedVector {
// Overload of `InlinedVector::push_back(...)` for inserting `v` at `end()`
// using move semantics.
- void push_back(RValueReference v) {
+ void push_back(value_type&& v) {
static_cast<void>(emplace_back(std::move(v)));
}
@@ -671,7 +682,7 @@ class InlinedVector {
void pop_back() noexcept {
ABSL_HARDENING_ASSERT(!empty());
- AllocatorTraits::destroy(*storage_.GetAllocPtr(), data() + (size() - 1));
+ AllocatorTraits<A>::destroy(storage_.GetAllocator(), data() + (size() - 1));
storage_.SubtractSize(1);
}
@@ -710,8 +721,8 @@ class InlinedVector {
// Destroys all elements in the inlined vector, setting the size to `0` and
// deallocating any held memory.
void clear() noexcept {
- inlined_vector_internal::DestroyElements(storage_.GetAllocPtr(), data(),
- size());
+ inlined_vector_internal::DestroyElements<A>(storage_.GetAllocator(), data(),
+ size());
storage_.DeallocateIfAllocated();
storage_.SetInlinedSize(0);
@@ -724,15 +735,12 @@ class InlinedVector {
// `InlinedVector::shrink_to_fit()`
//
- // Reduces memory usage by freeing unused memory. After being called, calls to
- // `capacity()` will be equal to `max(N, size())`.
- //
- // If `size() <= N` and the inlined vector contains allocated memory, the
- // elements will all be moved to the inlined space and the allocated memory
- // will be deallocated.
+ // Attempts to reduce memory usage by moving elements to (or keeping elements
+ // in) the smallest available buffer sufficient for containing `size()`
+ // elements.
//
- // If `size() > N` and `size() < capacity()`, the elements will be moved to a
- // smaller allocation.
+ // If `size()` is sufficiently small, the elements will be moved into (or kept
+ // in) the inlined space.
void shrink_to_fit() {
if (storage_.GetIsAllocated()) {
storage_.ShrinkToFit();
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/btree.h b/grpc/third_party/abseil-cpp/absl/container/internal/btree.h
index 0bb38366..f636c5fc 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/btree.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/btree.h
@@ -88,7 +88,12 @@ struct StringBtreeDefaultLess {
// Compatibility constructor.
StringBtreeDefaultLess(std::less<std::string>) {} // NOLINT
- StringBtreeDefaultLess(std::less<string_view>) {} // NOLINT
+ StringBtreeDefaultLess(std::less<absl::string_view>) {} // NOLINT
+
+ // Allow converting to std::less for use in key_comp()/value_comp().
+ explicit operator std::less<std::string>() const { return {}; }
+ explicit operator std::less<absl::string_view>() const { return {}; }
+ explicit operator std::less<absl::Cord>() const { return {}; }
absl::weak_ordering operator()(absl::string_view lhs,
absl::string_view rhs) const {
@@ -115,7 +120,12 @@ struct StringBtreeDefaultGreater {
StringBtreeDefaultGreater() = default;
StringBtreeDefaultGreater(std::greater<std::string>) {} // NOLINT
- StringBtreeDefaultGreater(std::greater<string_view>) {} // NOLINT
+ StringBtreeDefaultGreater(std::greater<absl::string_view>) {} // NOLINT
+
+ // Allow converting to std::greater for use in key_comp()/value_comp().
+ explicit operator std::greater<std::string>() const { return {}; }
+ explicit operator std::greater<absl::string_view>() const { return {}; }
+ explicit operator std::greater<absl::Cord>() const { return {}; }
absl::weak_ordering operator()(absl::string_view lhs,
absl::string_view rhs) const {
@@ -217,6 +227,8 @@ struct prefers_linear_node_search<
template <typename Key, typename Compare, typename Alloc, int TargetNodeSize,
bool Multi, typename SlotPolicy>
struct common_params {
+ using original_key_compare = Compare;
+
// If Compare is a common comparator for a string-like type, then we adapt it
// to use heterogeneous lookup and to be a key-compare-to comparator.
using key_compare = typename key_compare_to_adapter<Compare>::type;
@@ -317,16 +329,21 @@ struct map_params : common_params<Key, Compare, Alloc, TargetNodeSize, Multi,
using value_type = typename super_type::value_type;
using init_type = typename super_type::init_type;
- using key_compare = typename super_type::key_compare;
- // Inherit from key_compare for empty base class optimization.
- struct value_compare : private key_compare {
- value_compare() = default;
- explicit value_compare(const key_compare &cmp) : key_compare(cmp) {}
+ using original_key_compare = typename super_type::original_key_compare;
+ // Reference: https://en.cppreference.com/w/cpp/container/map/value_compare
+ class value_compare {
+ template <typename Params>
+ friend class btree;
- template <typename T, typename U>
- auto operator()(const T &left, const U &right) const
- -> decltype(std::declval<key_compare>()(left.first, right.first)) {
- return key_compare::operator()(left.first, right.first);
+ protected:
+ explicit value_compare(original_key_compare c) : comp(std::move(c)) {}
+
+ original_key_compare comp; // NOLINT
+
+ public:
+ auto operator()(const value_type &lhs, const value_type &rhs) const
+ -> decltype(comp(lhs.first, rhs.first)) {
+ return comp(lhs.first, rhs.first);
}
};
using is_map_container = std::true_type;
@@ -392,7 +409,8 @@ struct set_params : common_params<Key, Compare, Alloc, TargetNodeSize, Multi,
set_slot_policy<Key>> {
using value_type = Key;
using slot_type = typename set_params::common_params::slot_type;
- using value_compare = typename set_params::common_params::key_compare;
+ using value_compare =
+ typename set_params::common_params::original_key_compare;
using is_map_container = std::false_type;
template <typename V>
@@ -484,8 +502,8 @@ class btree_node {
std::is_same<std::greater<key_type>,
key_compare>::value)>;
- // This class is organized by gtl::Layout as if it had the following
- // structure:
+ // This class is organized by absl::container_internal::Layout as if it had
+ // the following structure:
// // A pointer to the node's parent.
// btree_node *parent;
//
@@ -1129,6 +1147,7 @@ class btree {
using size_type = typename Params::size_type;
using difference_type = typename Params::difference_type;
using key_compare = typename Params::key_compare;
+ using original_key_compare = typename Params::original_key_compare;
using value_compare = typename Params::value_compare;
using allocator_type = typename Params::allocator_type;
using reference = typename Params::reference;
@@ -1338,7 +1357,9 @@ class btree {
return compare_internal::compare_result_as_less_than(key_comp()(a, b));
}
- value_compare value_comp() const { return value_compare(key_comp()); }
+ value_compare value_comp() const {
+ return value_compare(original_key_compare(key_comp()));
+ }
// Verifies the structure of the btree.
void verify() const;
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/btree_container.h b/grpc/third_party/abseil-cpp/absl/container/internal/btree_container.h
index 03be708e..a99668c7 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/btree_container.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/btree_container.h
@@ -20,6 +20,7 @@
#include <iterator>
#include <utility>
+#include "absl/base/attributes.h"
#include "absl/base/internal/throw_delegate.h"
#include "absl/container/internal/btree.h" // IWYU pragma: export
#include "absl/container/internal/common.h"
@@ -51,7 +52,7 @@ class btree_container {
using value_type = typename Tree::value_type;
using size_type = typename Tree::size_type;
using difference_type = typename Tree::difference_type;
- using key_compare = typename Tree::key_compare;
+ using key_compare = typename Tree::original_key_compare;
using value_compare = typename Tree::value_compare;
using allocator_type = typename Tree::allocator_type;
using reference = typename Tree::reference;
@@ -176,7 +177,7 @@ class btree_container {
}
// Utility routines.
- void clear() { tree_.clear(); }
+ ABSL_ATTRIBUTE_REINITIALIZES void clear() { tree_.clear(); }
void swap(btree_container &other) { tree_.swap(other.tree_); }
void verify() const { tree_.verify(); }
@@ -214,7 +215,7 @@ class btree_container {
allocator_type get_allocator() const { return tree_.get_allocator(); }
// The key comparator used by the btree.
- key_compare key_comp() const { return tree_.key_comp(); }
+ key_compare key_comp() const { return key_compare(tree_.key_comp()); }
value_compare value_comp() const { return tree_.value_comp(); }
// Support absl::Hash.
@@ -247,7 +248,7 @@ class btree_set_container : public btree_container<Tree> {
using key_type = typename Tree::key_type;
using value_type = typename Tree::value_type;
using size_type = typename Tree::size_type;
- using key_compare = typename Tree::key_compare;
+ using key_compare = typename Tree::original_key_compare;
using allocator_type = typename Tree::allocator_type;
using iterator = typename Tree::iterator;
using const_iterator = typename Tree::const_iterator;
@@ -398,7 +399,7 @@ class btree_map_container : public btree_set_container<Tree> {
using key_type = typename Tree::key_type;
using mapped_type = typename params_type::mapped_type;
using value_type = typename Tree::value_type;
- using key_compare = typename Tree::key_compare;
+ using key_compare = typename Tree::original_key_compare;
using allocator_type = typename Tree::allocator_type;
using iterator = typename Tree::iterator;
using const_iterator = typename Tree::const_iterator;
@@ -543,7 +544,7 @@ class btree_multiset_container : public btree_container<Tree> {
using key_type = typename Tree::key_type;
using value_type = typename Tree::value_type;
using size_type = typename Tree::size_type;
- using key_compare = typename Tree::key_compare;
+ using key_compare = typename Tree::original_key_compare;
using allocator_type = typename Tree::allocator_type;
using iterator = typename Tree::iterator;
using const_iterator = typename Tree::const_iterator;
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h b/grpc/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h
index 0683422a..250e662c 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h
@@ -78,24 +78,26 @@ struct StringHash {
}
};
+struct StringEq {
+ using is_transparent = void;
+ bool operator()(absl::string_view lhs, absl::string_view rhs) const {
+ return lhs == rhs;
+ }
+ bool operator()(const absl::Cord& lhs, const absl::Cord& rhs) const {
+ return lhs == rhs;
+ }
+ bool operator()(const absl::Cord& lhs, absl::string_view rhs) const {
+ return lhs == rhs;
+ }
+ bool operator()(absl::string_view lhs, const absl::Cord& rhs) const {
+ return lhs == rhs;
+ }
+};
+
// Supports heterogeneous lookup for string-like elements.
struct StringHashEq {
using Hash = StringHash;
- struct Eq {
- using is_transparent = void;
- bool operator()(absl::string_view lhs, absl::string_view rhs) const {
- return lhs == rhs;
- }
- bool operator()(const absl::Cord& lhs, const absl::Cord& rhs) const {
- return lhs == rhs;
- }
- bool operator()(const absl::Cord& lhs, absl::string_view rhs) const {
- return lhs == rhs;
- }
- bool operator()(absl::string_view lhs, const absl::Cord& rhs) const {
- return lhs == rhs;
- }
- };
+ using Eq = StringEq;
};
template <>
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h b/grpc/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h
index 6869fe45..f1f555a5 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h
@@ -21,11 +21,13 @@
#include <stdint.h>
#include <algorithm>
+#include <cassert>
#include <iosfwd>
#include <random>
#include <tuple>
#include <type_traits>
#include <utility>
+#include <vector>
#include "absl/container/internal/hash_policy_testing.h"
#include "absl/memory/memory.h"
@@ -153,6 +155,25 @@ using GeneratedType = decltype(
typename Container::value_type,
typename Container::key_type>::type>&>()());
+// Naive wrapper that performs a linear search of previous values.
+// Beware this is O(SQR), which is reasonable for smaller kMaxValues.
+template <class T, size_t kMaxValues = 64, class E = void>
+struct UniqueGenerator {
+ Generator<T, E> gen;
+ std::vector<T> values;
+
+ T operator()() {
+ assert(values.size() < kMaxValues);
+ for (;;) {
+ T value = gen();
+ if (std::find(values.begin(), values.end(), value) == values.end()) {
+ values.push_back(value);
+ return value;
+ }
+ }
+ }
+};
+
} // namespace hash_internal
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc
index 5a29bed7..40cce047 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc
@@ -21,10 +21,11 @@
#include <limits>
#include "absl/base/attributes.h"
-#include "absl/base/internal/exponential_biased.h"
#include "absl/container/internal/have_sse.h"
#include "absl/debugging/stacktrace.h"
#include "absl/memory/memory.h"
+#include "absl/profiling/internal/exponential_biased.h"
+#include "absl/profiling/internal/sample_recorder.h"
#include "absl/synchronization/mutex.h"
namespace absl {
@@ -37,10 +38,9 @@ ABSL_CONST_INIT std::atomic<bool> g_hashtablez_enabled{
false
};
ABSL_CONST_INIT std::atomic<int32_t> g_hashtablez_sample_parameter{1 << 10};
-ABSL_CONST_INIT std::atomic<int32_t> g_hashtablez_max_samples{1 << 20};
#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
-ABSL_PER_THREAD_TLS_KEYWORD absl::base_internal::ExponentialBiased
+ABSL_PER_THREAD_TLS_KEYWORD absl::profiling_internal::ExponentialBiased
g_exponential_biased_generator;
#endif
@@ -50,16 +50,14 @@ ABSL_PER_THREAD_TLS_KEYWORD absl::base_internal::ExponentialBiased
ABSL_PER_THREAD_TLS_KEYWORD int64_t global_next_sample = 0;
#endif // defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
-HashtablezSampler& HashtablezSampler::Global() {
+HashtablezSampler& GlobalHashtablezSampler() {
static auto* sampler = new HashtablezSampler();
return *sampler;
}
-HashtablezSampler::DisposeCallback HashtablezSampler::SetDisposeCallback(
- DisposeCallback f) {
- return dispose_.exchange(f, std::memory_order_relaxed);
-}
-
+// TODO(bradleybear): The comments at this constructors declaration say that the
+// fields are not initialized, but this definition does initialize the fields.
+// Something needs to be cleaned up.
HashtablezInfo::HashtablezInfo() { PrepareForSampling(); }
HashtablezInfo::~HashtablezInfo() = default;
@@ -73,6 +71,7 @@ void HashtablezInfo::PrepareForSampling() {
hashes_bitwise_or.store(0, std::memory_order_relaxed);
hashes_bitwise_and.store(~size_t{}, std::memory_order_relaxed);
hashes_bitwise_xor.store(0, std::memory_order_relaxed);
+ max_reserve.store(0, std::memory_order_relaxed);
create_time = absl::Now();
// The inliner makes hardcoded skip_count difficult (especially when combined
@@ -80,93 +79,6 @@ void HashtablezInfo::PrepareForSampling() {
// instead.
depth = absl::GetStackTrace(stack, HashtablezInfo::kMaxStackDepth,
/* skip_count= */ 0);
- dead = nullptr;
-}
-
-HashtablezSampler::HashtablezSampler()
- : dropped_samples_(0), size_estimate_(0), all_(nullptr), dispose_(nullptr) {
- absl::MutexLock l(&graveyard_.init_mu);
- graveyard_.dead = &graveyard_;
-}
-
-HashtablezSampler::~HashtablezSampler() {
- HashtablezInfo* s = all_.load(std::memory_order_acquire);
- while (s != nullptr) {
- HashtablezInfo* next = s->next;
- delete s;
- s = next;
- }
-}
-
-void HashtablezSampler::PushNew(HashtablezInfo* sample) {
- sample->next = all_.load(std::memory_order_relaxed);
- while (!all_.compare_exchange_weak(sample->next, sample,
- std::memory_order_release,
- std::memory_order_relaxed)) {
- }
-}
-
-void HashtablezSampler::PushDead(HashtablezInfo* sample) {
- if (auto* dispose = dispose_.load(std::memory_order_relaxed)) {
- dispose(*sample);
- }
-
- absl::MutexLock graveyard_lock(&graveyard_.init_mu);
- absl::MutexLock sample_lock(&sample->init_mu);
- sample->dead = graveyard_.dead;
- graveyard_.dead = sample;
-}
-
-HashtablezInfo* HashtablezSampler::PopDead() {
- absl::MutexLock graveyard_lock(&graveyard_.init_mu);
-
- // The list is circular, so eventually it collapses down to
- // graveyard_.dead == &graveyard_
- // when it is empty.
- HashtablezInfo* sample = graveyard_.dead;
- if (sample == &graveyard_) return nullptr;
-
- absl::MutexLock sample_lock(&sample->init_mu);
- graveyard_.dead = sample->dead;
- sample->PrepareForSampling();
- return sample;
-}
-
-HashtablezInfo* HashtablezSampler::Register() {
- int64_t size = size_estimate_.fetch_add(1, std::memory_order_relaxed);
- if (size > g_hashtablez_max_samples.load(std::memory_order_relaxed)) {
- size_estimate_.fetch_sub(1, std::memory_order_relaxed);
- dropped_samples_.fetch_add(1, std::memory_order_relaxed);
- return nullptr;
- }
-
- HashtablezInfo* sample = PopDead();
- if (sample == nullptr) {
- // Resurrection failed. Hire a new warlock.
- sample = new HashtablezInfo();
- PushNew(sample);
- }
-
- return sample;
-}
-
-void HashtablezSampler::Unregister(HashtablezInfo* sample) {
- PushDead(sample);
- size_estimate_.fetch_sub(1, std::memory_order_relaxed);
-}
-
-int64_t HashtablezSampler::Iterate(
- const std::function<void(const HashtablezInfo& stack)>& f) {
- HashtablezInfo* s = all_.load(std::memory_order_acquire);
- while (s != nullptr) {
- absl::MutexLock l(&s->init_mu);
- if (s->dead == nullptr) {
- f(*s);
- }
- s = s->next;
- }
-
- return dropped_samples_.load(std::memory_order_relaxed);
}
static bool ShouldForceSampling() {
@@ -189,10 +101,12 @@ static bool ShouldForceSampling() {
return state == kForce;
}
-HashtablezInfo* SampleSlow(int64_t* next_sample) {
+HashtablezInfo* SampleSlow(int64_t* next_sample, size_t inline_element_size) {
if (ABSL_PREDICT_FALSE(ShouldForceSampling())) {
*next_sample = 1;
- return HashtablezSampler::Global().Register();
+ HashtablezInfo* result = GlobalHashtablezSampler().Register();
+ result->inline_element_size = inline_element_size;
+ return result;
}
#if !defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
@@ -214,15 +128,17 @@ HashtablezInfo* SampleSlow(int64_t* next_sample) {
// that case.
if (first) {
if (ABSL_PREDICT_TRUE(--*next_sample > 0)) return nullptr;
- return SampleSlow(next_sample);
+ return SampleSlow(next_sample, inline_element_size);
}
- return HashtablezSampler::Global().Register();
+ HashtablezInfo* result = GlobalHashtablezSampler().Register();
+ result->inline_element_size = inline_element_size;
+ return result;
#endif
}
void UnsampleSlow(HashtablezInfo* info) {
- HashtablezSampler::Global().Unregister(info);
+ GlobalHashtablezSampler().Unregister(info);
}
void RecordInsertSlow(HashtablezInfo* info, size_t hash,
@@ -262,7 +178,7 @@ void SetHashtablezSampleParameter(int32_t rate) {
void SetHashtablezMaxSamples(int32_t max) {
if (max > 0) {
- g_hashtablez_max_samples.store(max, std::memory_order_release);
+ GlobalHashtablezSampler().SetMaxSamples(max);
} else {
ABSL_RAW_LOG(ERROR, "Invalid hashtablez max samples: %lld",
static_cast<long long>(max)); // NOLINT(runtime/int)
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h
index 85685f72..91fcdb34 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h
@@ -47,6 +47,7 @@
#include "absl/base/internal/per_thread_tls.h"
#include "absl/base/optimization.h"
#include "absl/container/internal/have_sse.h"
+#include "absl/profiling/internal/sample_recorder.h"
#include "absl/synchronization/mutex.h"
#include "absl/utility/utility.h"
@@ -57,7 +58,7 @@ namespace container_internal {
// Stores information about a sampled hashtable. All mutations to this *must*
// be made through `Record*` functions below. All reads from this *must* only
// occur in the callback to `HashtablezSampler::Iterate`.
-struct HashtablezInfo {
+struct HashtablezInfo : public profiling_internal::Sample<HashtablezInfo> {
// Constructs the object but does not fill in any fields.
HashtablezInfo();
~HashtablezInfo();
@@ -79,14 +80,7 @@ struct HashtablezInfo {
std::atomic<size_t> hashes_bitwise_or;
std::atomic<size_t> hashes_bitwise_and;
std::atomic<size_t> hashes_bitwise_xor;
-
- // `HashtablezSampler` maintains intrusive linked lists for all samples. See
- // comments on `HashtablezSampler::all_` for details on these. `init_mu`
- // guards the ability to restore the sample to a pristine state. This
- // prevents races with sampling and resurrecting an object.
- absl::Mutex init_mu;
- HashtablezInfo* next;
- HashtablezInfo* dead ABSL_GUARDED_BY(init_mu);
+ std::atomic<size_t> max_reserve;
// All of the fields below are set by `PrepareForSampling`, they must not be
// mutated in `Record*` functions. They are logically `const` in that sense.
@@ -97,6 +91,7 @@ struct HashtablezInfo {
absl::Time create_time;
int32_t depth;
void* stack[kMaxStackDepth];
+ size_t inline_element_size;
};
inline void RecordRehashSlow(HashtablezInfo* info, size_t total_probe_length) {
@@ -114,6 +109,18 @@ inline void RecordRehashSlow(HashtablezInfo* info, size_t total_probe_length) {
std::memory_order_relaxed);
}
+inline void RecordReservationSlow(HashtablezInfo* info,
+ size_t target_capacity) {
+ info->max_reserve.store(
+ (std::max)(info->max_reserve.load(std::memory_order_relaxed),
+ target_capacity),
+ std::memory_order_relaxed);
+}
+
+inline void RecordClearedReservationSlow(HashtablezInfo* info) {
+ info->max_reserve.store(0, std::memory_order_relaxed);
+}
+
inline void RecordStorageChangedSlow(HashtablezInfo* info, size_t size,
size_t capacity) {
info->size.store(size, std::memory_order_relaxed);
@@ -137,7 +144,7 @@ inline void RecordEraseSlow(HashtablezInfo* info) {
std::memory_order_relaxed);
}
-HashtablezInfo* SampleSlow(int64_t* next_sample);
+HashtablezInfo* SampleSlow(int64_t* next_sample, size_t inline_element_size);
void UnsampleSlow(HashtablezInfo* info);
#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
@@ -177,6 +184,16 @@ class HashtablezInfoHandle {
RecordRehashSlow(info_, total_probe_length);
}
+ inline void RecordReservation(size_t target_capacity) {
+ if (ABSL_PREDICT_TRUE(info_ == nullptr)) return;
+ RecordReservationSlow(info_, target_capacity);
+ }
+
+ inline void RecordClearedReservation() {
+ if (ABSL_PREDICT_TRUE(info_ == nullptr)) return;
+ RecordClearedReservationSlow(info_);
+ }
+
inline void RecordInsert(size_t hash, size_t distance_from_desired) {
if (ABSL_PREDICT_TRUE(info_ == nullptr)) return;
RecordInsertSlow(info_, hash, distance_from_desired);
@@ -206,6 +223,8 @@ class HashtablezInfoHandle {
inline void RecordStorageChanged(size_t /*size*/, size_t /*capacity*/) {}
inline void RecordRehash(size_t /*total_probe_length*/) {}
+ inline void RecordReservation(size_t /*target_capacity*/) {}
+ inline void RecordClearedReservation() {}
inline void RecordInsert(size_t /*hash*/, size_t /*distance_from_desired*/) {}
inline void RecordErase() {}
@@ -220,84 +239,24 @@ extern ABSL_PER_THREAD_TLS_KEYWORD int64_t global_next_sample;
// Returns an RAII sampling handle that manages registration and unregistation
// with the global sampler.
-inline HashtablezInfoHandle Sample() {
+inline HashtablezInfoHandle Sample(
+ size_t inline_element_size ABSL_ATTRIBUTE_UNUSED) {
#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
if (ABSL_PREDICT_TRUE(--global_next_sample > 0)) {
return HashtablezInfoHandle(nullptr);
}
- return HashtablezInfoHandle(SampleSlow(&global_next_sample));
+ return HashtablezInfoHandle(
+ SampleSlow(&global_next_sample, inline_element_size));
#else
return HashtablezInfoHandle(nullptr);
#endif // !ABSL_PER_THREAD_TLS
}
-// Holds samples and their associated stack traces with a soft limit of
-// `SetHashtablezMaxSamples()`.
-//
-// Thread safe.
-class HashtablezSampler {
- public:
- // Returns a global Sampler.
- static HashtablezSampler& Global();
-
- HashtablezSampler();
- ~HashtablezSampler();
-
- // Registers for sampling. Returns an opaque registration info.
- HashtablezInfo* Register();
+using HashtablezSampler =
+ ::absl::profiling_internal::SampleRecorder<HashtablezInfo>;
- // Unregisters the sample.
- void Unregister(HashtablezInfo* sample);
-
- // The dispose callback will be called on all samples the moment they are
- // being unregistered. Only affects samples that are unregistered after the
- // callback has been set.
- // Returns the previous callback.
- using DisposeCallback = void (*)(const HashtablezInfo&);
- DisposeCallback SetDisposeCallback(DisposeCallback f);
-
- // Iterates over all the registered `StackInfo`s. Returning the number of
- // samples that have been dropped.
- int64_t Iterate(const std::function<void(const HashtablezInfo& stack)>& f);
-
- private:
- void PushNew(HashtablezInfo* sample);
- void PushDead(HashtablezInfo* sample);
- HashtablezInfo* PopDead();
-
- std::atomic<size_t> dropped_samples_;
- std::atomic<size_t> size_estimate_;
-
- // Intrusive lock free linked lists for tracking samples.
- //
- // `all_` records all samples (they are never removed from this list) and is
- // terminated with a `nullptr`.
- //
- // `graveyard_.dead` is a circular linked list. When it is empty,
- // `graveyard_.dead == &graveyard`. The list is circular so that
- // every item on it (even the last) has a non-null dead pointer. This allows
- // `Iterate` to determine if a given sample is live or dead using only
- // information on the sample itself.
- //
- // For example, nodes [A, B, C, D, E] with [A, C, E] alive and [B, D] dead
- // looks like this (G is the Graveyard):
- //
- // +---+ +---+ +---+ +---+ +---+
- // all -->| A |--->| B |--->| C |--->| D |--->| E |
- // | | | | | | | | | |
- // +---+ | | +->| |-+ | | +->| |-+ | |
- // | G | +---+ | +---+ | +---+ | +---+ | +---+
- // | | | | | |
- // | | --------+ +--------+ |
- // +---+ |
- // ^ |
- // +--------------------------------------+
- //
- std::atomic<HashtablezInfo*> all_;
- HashtablezInfo graveyard_;
-
- std::atomic<DisposeCallback> dispose_;
-};
+// Returns a global Sampler.
+HashtablezSampler& GlobalHashtablezSampler();
// Enables or disables sampling for Swiss tables.
void SetHashtablezEnabled(bool enabled);
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc
index 5f4c83b7..449619a3 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc
@@ -22,6 +22,7 @@
#include "gtest/gtest.h"
#include "absl/base/attributes.h"
#include "absl/container/internal/have_sse.h"
+#include "absl/profiling/internal/sample_recorder.h"
#include "absl/synchronization/blocking_counter.h"
#include "absl/synchronization/internal/thread_pool.h"
#include "absl/synchronization/mutex.h"
@@ -77,10 +78,12 @@ HashtablezInfo* Register(HashtablezSampler* s, size_t size) {
TEST(HashtablezInfoTest, PrepareForSampling) {
absl::Time test_start = absl::Now();
+ const size_t test_element_size = 17;
HashtablezInfo info;
absl::MutexLock l(&info.init_mu);
info.PrepareForSampling();
+ info.inline_element_size = test_element_size;
EXPECT_EQ(info.capacity.load(), 0);
EXPECT_EQ(info.size.load(), 0);
EXPECT_EQ(info.num_erases.load(), 0);
@@ -90,7 +93,9 @@ TEST(HashtablezInfoTest, PrepareForSampling) {
EXPECT_EQ(info.hashes_bitwise_or.load(), 0);
EXPECT_EQ(info.hashes_bitwise_and.load(), ~size_t{});
EXPECT_EQ(info.hashes_bitwise_xor.load(), 0);
+ EXPECT_EQ(info.max_reserve.load(), 0);
EXPECT_GE(info.create_time, test_start);
+ EXPECT_EQ(info.inline_element_size, test_element_size);
info.capacity.store(1, std::memory_order_relaxed);
info.size.store(1, std::memory_order_relaxed);
@@ -100,6 +105,7 @@ TEST(HashtablezInfoTest, PrepareForSampling) {
info.hashes_bitwise_or.store(1, std::memory_order_relaxed);
info.hashes_bitwise_and.store(1, std::memory_order_relaxed);
info.hashes_bitwise_xor.store(1, std::memory_order_relaxed);
+ info.max_reserve.store(1, std::memory_order_relaxed);
info.create_time = test_start - absl::Hours(20);
info.PrepareForSampling();
@@ -112,6 +118,8 @@ TEST(HashtablezInfoTest, PrepareForSampling) {
EXPECT_EQ(info.hashes_bitwise_or.load(), 0);
EXPECT_EQ(info.hashes_bitwise_and.load(), ~size_t{});
EXPECT_EQ(info.hashes_bitwise_xor.load(), 0);
+ EXPECT_EQ(info.max_reserve.load(), 0);
+ EXPECT_EQ(info.inline_element_size, test_element_size);
EXPECT_GE(info.create_time, test_start);
}
@@ -150,9 +158,11 @@ TEST(HashtablezInfoTest, RecordInsert) {
}
TEST(HashtablezInfoTest, RecordErase) {
+ const size_t test_element_size = 29;
HashtablezInfo info;
absl::MutexLock l(&info.init_mu);
info.PrepareForSampling();
+ info.inline_element_size = test_element_size;
EXPECT_EQ(info.num_erases.load(), 0);
EXPECT_EQ(info.size.load(), 0);
RecordInsertSlow(&info, 0x0000FF00, 6 * kProbeLength);
@@ -160,12 +170,15 @@ TEST(HashtablezInfoTest, RecordErase) {
RecordEraseSlow(&info);
EXPECT_EQ(info.size.load(), 0);
EXPECT_EQ(info.num_erases.load(), 1);
+ EXPECT_EQ(info.inline_element_size, test_element_size);
}
TEST(HashtablezInfoTest, RecordRehash) {
+ const size_t test_element_size = 31;
HashtablezInfo info;
absl::MutexLock l(&info.init_mu);
info.PrepareForSampling();
+ info.inline_element_size = test_element_size;
RecordInsertSlow(&info, 0x1, 0);
RecordInsertSlow(&info, 0x2, kProbeLength);
RecordInsertSlow(&info, 0x4, kProbeLength);
@@ -184,16 +197,34 @@ TEST(HashtablezInfoTest, RecordRehash) {
EXPECT_EQ(info.total_probe_length.load(), 3);
EXPECT_EQ(info.num_erases.load(), 0);
EXPECT_EQ(info.num_rehashes.load(), 1);
+ EXPECT_EQ(info.inline_element_size, test_element_size);
+}
+
+TEST(HashtablezInfoTest, RecordReservation) {
+ HashtablezInfo info;
+ absl::MutexLock l(&info.init_mu);
+ info.PrepareForSampling();
+ RecordReservationSlow(&info, 3);
+ EXPECT_EQ(info.max_reserve.load(), 3);
+
+ RecordReservationSlow(&info, 2);
+ // High watermark does not change
+ EXPECT_EQ(info.max_reserve.load(), 3);
+
+ RecordReservationSlow(&info, 10);
+ // High watermark does change
+ EXPECT_EQ(info.max_reserve.load(), 10);
}
#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
TEST(HashtablezSamplerTest, SmallSampleParameter) {
+ const size_t test_element_size = 31;
SetHashtablezEnabled(true);
SetHashtablezSampleParameter(100);
for (int i = 0; i < 1000; ++i) {
int64_t next_sample = 0;
- HashtablezInfo* sample = SampleSlow(&next_sample);
+ HashtablezInfo* sample = SampleSlow(&next_sample, test_element_size);
EXPECT_GT(next_sample, 0);
EXPECT_NE(sample, nullptr);
UnsampleSlow(sample);
@@ -201,12 +232,13 @@ TEST(HashtablezSamplerTest, SmallSampleParameter) {
}
TEST(HashtablezSamplerTest, LargeSampleParameter) {
+ const size_t test_element_size = 31;
SetHashtablezEnabled(true);
SetHashtablezSampleParameter(std::numeric_limits<int32_t>::max());
for (int i = 0; i < 1000; ++i) {
int64_t next_sample = 0;
- HashtablezInfo* sample = SampleSlow(&next_sample);
+ HashtablezInfo* sample = SampleSlow(&next_sample, test_element_size);
EXPECT_GT(next_sample, 0);
EXPECT_NE(sample, nullptr);
UnsampleSlow(sample);
@@ -214,13 +246,14 @@ TEST(HashtablezSamplerTest, LargeSampleParameter) {
}
TEST(HashtablezSamplerTest, Sample) {
+ const size_t test_element_size = 31;
SetHashtablezEnabled(true);
SetHashtablezSampleParameter(100);
int64_t num_sampled = 0;
int64_t total = 0;
double sample_rate = 0.0;
for (int i = 0; i < 1000000; ++i) {
- HashtablezInfoHandle h = Sample();
+ HashtablezInfoHandle h = Sample(test_element_size);
++total;
if (HashtablezInfoHandlePeer::IsSampled(h)) {
++num_sampled;
@@ -232,7 +265,7 @@ TEST(HashtablezSamplerTest, Sample) {
}
TEST(HashtablezSamplerTest, Handle) {
- auto& sampler = HashtablezSampler::Global();
+ auto& sampler = GlobalHashtablezSampler();
HashtablezInfoHandle h(sampler.Register());
auto* info = HashtablezInfoHandlePeer::GetInfo(&h);
info->hashes_bitwise_and.store(0x12345678, std::memory_order_relaxed);
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/inlined_vector.h b/grpc/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
index b8aec45b..1d7d6cda 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/inlined_vector.h
@@ -21,8 +21,11 @@
#include <iterator>
#include <limits>
#include <memory>
+#include <new>
+#include <type_traits>
#include <utility>
+#include "absl/base/attributes.h"
#include "absl/base/macros.h"
#include "absl/container/internal/compressed_tuple.h"
#include "absl/memory/memory.h"
@@ -36,116 +39,132 @@ namespace inlined_vector_internal {
// GCC does not deal very well with the below code
#if !defined(__clang__) && defined(__GNUC__)
#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
+template <typename A>
+using AllocatorTraits = std::allocator_traits<A>;
+template <typename A>
+using ValueType = typename AllocatorTraits<A>::value_type;
+template <typename A>
+using SizeType = typename AllocatorTraits<A>::size_type;
+template <typename A>
+using Pointer = typename AllocatorTraits<A>::pointer;
+template <typename A>
+using ConstPointer = typename AllocatorTraits<A>::const_pointer;
+template <typename A>
+using SizeType = typename AllocatorTraits<A>::size_type;
+template <typename A>
+using DifferenceType = typename AllocatorTraits<A>::difference_type;
+template <typename A>
+using Reference = ValueType<A>&;
+template <typename A>
+using ConstReference = const ValueType<A>&;
+template <typename A>
+using Iterator = Pointer<A>;
+template <typename A>
+using ConstIterator = ConstPointer<A>;
+template <typename A>
+using ReverseIterator = typename std::reverse_iterator<Iterator<A>>;
+template <typename A>
+using ConstReverseIterator = typename std::reverse_iterator<ConstIterator<A>>;
+template <typename A>
+using MoveIterator = typename std::move_iterator<Iterator<A>>;
+
template <typename Iterator>
using IsAtLeastForwardIterator = std::is_convertible<
typename std::iterator_traits<Iterator>::iterator_category,
std::forward_iterator_tag>;
-template <typename AllocatorType,
- typename ValueType =
- typename absl::allocator_traits<AllocatorType>::value_type>
+template <typename A>
using IsMemcpyOk =
- absl::conjunction<std::is_same<AllocatorType, std::allocator<ValueType>>,
- absl::is_trivially_copy_constructible<ValueType>,
- absl::is_trivially_copy_assignable<ValueType>,
- absl::is_trivially_destructible<ValueType>>;
+ absl::conjunction<std::is_same<A, std::allocator<ValueType<A>>>,
+ absl::is_trivially_copy_constructible<ValueType<A>>,
+ absl::is_trivially_copy_assignable<ValueType<A>>,
+ absl::is_trivially_destructible<ValueType<A>>>;
+
+template <typename T>
+struct TypeIdentity {
+ using type = T;
+};
-template <typename AllocatorType, typename Pointer, typename SizeType>
-void DestroyElements(AllocatorType* alloc_ptr, Pointer destroy_first,
- SizeType destroy_size) {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
+// Used for function arguments in template functions to prevent ADL by forcing
+// callers to explicitly specify the template parameter.
+template <typename T>
+using NoTypeDeduction = typename TypeIdentity<T>::type;
+template <typename A>
+void DestroyElements(NoTypeDeduction<A>& allocator, Pointer<A> destroy_first,
+ SizeType<A> destroy_size) {
if (destroy_first != nullptr) {
- for (auto i = destroy_size; i != 0;) {
+ for (SizeType<A> i = destroy_size; i != 0;) {
--i;
- AllocatorTraits::destroy(*alloc_ptr, destroy_first + i);
- }
-
-#if !defined(NDEBUG)
- {
- using ValueType = typename AllocatorTraits::value_type;
-
- // Overwrite unused memory with `0xab` so we can catch uninitialized
- // usage.
- //
- // Cast to `void*` to tell the compiler that we don't care that we might
- // be scribbling on a vtable pointer.
- void* memory_ptr = destroy_first;
- auto memory_size = destroy_size * sizeof(ValueType);
- std::memset(memory_ptr, 0xab, memory_size);
+ AllocatorTraits<A>::destroy(allocator, destroy_first + i);
}
-#endif // !defined(NDEBUG)
}
}
-// If kUseMemcpy is true, memcpy(dst, src, n); else do nothing.
-// Useful to avoid compiler warnings when memcpy() is used for T values
-// that are not trivially copyable in non-reachable code.
-template <bool kUseMemcpy>
-inline void MemcpyIfAllowed(void* dst, const void* src, size_t n);
+template <typename A>
+struct Allocation {
+ Pointer<A> data;
+ SizeType<A> capacity;
+};
-// memcpy when allowed.
-template <>
-inline void MemcpyIfAllowed<true>(void* dst, const void* src, size_t n) {
- memcpy(dst, src, n);
-}
+template <typename A,
+ bool IsOverAligned =
+ (alignof(ValueType<A>) > ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT)>
+struct MallocAdapter {
+ static Allocation<A> Allocate(A& allocator, SizeType<A> requested_capacity) {
+ return {AllocatorTraits<A>::allocate(allocator, requested_capacity),
+ requested_capacity};
+ }
-// Do nothing for types that are not memcpy-able. This function is only
-// called from non-reachable branches.
-template <>
-inline void MemcpyIfAllowed<false>(void*, const void*, size_t) {}
+ static void Deallocate(A& allocator, Pointer<A> pointer,
+ SizeType<A> capacity) {
+ AllocatorTraits<A>::deallocate(allocator, pointer, capacity);
+ }
+};
-template <typename AllocatorType, typename Pointer, typename ValueAdapter,
- typename SizeType>
-void ConstructElements(AllocatorType* alloc_ptr, Pointer construct_first,
- ValueAdapter* values_ptr, SizeType construct_size) {
- for (SizeType i = 0; i < construct_size; ++i) {
- ABSL_INTERNAL_TRY {
- values_ptr->ConstructNext(alloc_ptr, construct_first + i);
- }
+template <typename A, typename ValueAdapter>
+void ConstructElements(NoTypeDeduction<A>& allocator,
+ Pointer<A> construct_first, ValueAdapter& values,
+ SizeType<A> construct_size) {
+ for (SizeType<A> i = 0; i < construct_size; ++i) {
+ ABSL_INTERNAL_TRY { values.ConstructNext(allocator, construct_first + i); }
ABSL_INTERNAL_CATCH_ANY {
- inlined_vector_internal::DestroyElements(alloc_ptr, construct_first, i);
+ DestroyElements<A>(allocator, construct_first, i);
ABSL_INTERNAL_RETHROW;
}
}
}
-template <typename Pointer, typename ValueAdapter, typename SizeType>
-void AssignElements(Pointer assign_first, ValueAdapter* values_ptr,
- SizeType assign_size) {
- for (SizeType i = 0; i < assign_size; ++i) {
- values_ptr->AssignNext(assign_first + i);
+template <typename A, typename ValueAdapter>
+void AssignElements(Pointer<A> assign_first, ValueAdapter& values,
+ SizeType<A> assign_size) {
+ for (SizeType<A> i = 0; i < assign_size; ++i) {
+ values.AssignNext(assign_first + i);
}
}
-template <typename AllocatorType>
+template <typename A>
struct StorageView {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using Pointer = typename AllocatorTraits::pointer;
- using SizeType = typename AllocatorTraits::size_type;
-
- Pointer data;
- SizeType size;
- SizeType capacity;
+ Pointer<A> data;
+ SizeType<A> size;
+ SizeType<A> capacity;
};
-template <typename AllocatorType, typename Iterator>
+template <typename A, typename Iterator>
class IteratorValueAdapter {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using Pointer = typename AllocatorTraits::pointer;
-
public:
explicit IteratorValueAdapter(const Iterator& it) : it_(it) {}
- void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) {
- AllocatorTraits::construct(*alloc_ptr, construct_at, *it_);
+ void ConstructNext(A& allocator, Pointer<A> construct_at) {
+ AllocatorTraits<A>::construct(allocator, construct_at, *it_);
++it_;
}
- void AssignNext(Pointer assign_at) {
+ void AssignNext(Pointer<A> assign_at) {
*assign_at = *it_;
++it_;
}
@@ -154,166 +173,123 @@ class IteratorValueAdapter {
Iterator it_;
};
-template <typename AllocatorType>
+template <typename A>
class CopyValueAdapter {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using ValueType = typename AllocatorTraits::value_type;
- using Pointer = typename AllocatorTraits::pointer;
- using ConstPointer = typename AllocatorTraits::const_pointer;
-
public:
- explicit CopyValueAdapter(const ValueType& v) : ptr_(std::addressof(v)) {}
+ explicit CopyValueAdapter(ConstPointer<A> p) : ptr_(p) {}
- void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) {
- AllocatorTraits::construct(*alloc_ptr, construct_at, *ptr_);
+ void ConstructNext(A& allocator, Pointer<A> construct_at) {
+ AllocatorTraits<A>::construct(allocator, construct_at, *ptr_);
}
- void AssignNext(Pointer assign_at) { *assign_at = *ptr_; }
+ void AssignNext(Pointer<A> assign_at) { *assign_at = *ptr_; }
private:
- ConstPointer ptr_;
+ ConstPointer<A> ptr_;
};
-template <typename AllocatorType>
+template <typename A>
class DefaultValueAdapter {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using ValueType = typename AllocatorTraits::value_type;
- using Pointer = typename AllocatorTraits::pointer;
-
public:
explicit DefaultValueAdapter() {}
- void ConstructNext(AllocatorType* alloc_ptr, Pointer construct_at) {
- AllocatorTraits::construct(*alloc_ptr, construct_at);
+ void ConstructNext(A& allocator, Pointer<A> construct_at) {
+ AllocatorTraits<A>::construct(allocator, construct_at);
}
- void AssignNext(Pointer assign_at) { *assign_at = ValueType(); }
+ void AssignNext(Pointer<A> assign_at) { *assign_at = ValueType<A>(); }
};
-template <typename AllocatorType>
+template <typename A>
class AllocationTransaction {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using Pointer = typename AllocatorTraits::pointer;
- using SizeType = typename AllocatorTraits::size_type;
-
public:
- explicit AllocationTransaction(AllocatorType* alloc_ptr)
- : alloc_data_(*alloc_ptr, nullptr) {}
+ explicit AllocationTransaction(A& allocator)
+ : allocator_data_(allocator, nullptr), capacity_(0) {}
~AllocationTransaction() {
if (DidAllocate()) {
- AllocatorTraits::deallocate(GetAllocator(), GetData(), GetCapacity());
+ MallocAdapter<A>::Deallocate(GetAllocator(), GetData(), GetCapacity());
}
}
AllocationTransaction(const AllocationTransaction&) = delete;
void operator=(const AllocationTransaction&) = delete;
- AllocatorType& GetAllocator() { return alloc_data_.template get<0>(); }
- Pointer& GetData() { return alloc_data_.template get<1>(); }
- SizeType& GetCapacity() { return capacity_; }
+ A& GetAllocator() { return allocator_data_.template get<0>(); }
+ Pointer<A>& GetData() { return allocator_data_.template get<1>(); }
+ SizeType<A>& GetCapacity() { return capacity_; }
bool DidAllocate() { return GetData() != nullptr; }
- Pointer Allocate(SizeType capacity) {
- GetData() = AllocatorTraits::allocate(GetAllocator(), capacity);
- GetCapacity() = capacity;
- return GetData();
+
+ Pointer<A> Allocate(SizeType<A> requested_capacity) {
+ Allocation<A> result =
+ MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity);
+ GetData() = result.data;
+ GetCapacity() = result.capacity;
+ return result.data;
+ }
+
+ ABSL_MUST_USE_RESULT Allocation<A> Release() && {
+ Allocation<A> result = {GetData(), GetCapacity()};
+ Reset();
+ return result;
}
+ private:
void Reset() {
GetData() = nullptr;
GetCapacity() = 0;
}
- private:
- container_internal::CompressedTuple<AllocatorType, Pointer> alloc_data_;
- SizeType capacity_ = 0;
+ container_internal::CompressedTuple<A, Pointer<A>> allocator_data_;
+ SizeType<A> capacity_;
};
-template <typename AllocatorType>
+template <typename A>
class ConstructionTransaction {
- using AllocatorTraits = absl::allocator_traits<AllocatorType>;
- using Pointer = typename AllocatorTraits::pointer;
- using SizeType = typename AllocatorTraits::size_type;
-
public:
- explicit ConstructionTransaction(AllocatorType* alloc_ptr)
- : alloc_data_(*alloc_ptr, nullptr) {}
+ explicit ConstructionTransaction(A& allocator)
+ : allocator_data_(allocator, nullptr), size_(0) {}
~ConstructionTransaction() {
if (DidConstruct()) {
- inlined_vector_internal::DestroyElements(std::addressof(GetAllocator()),
- GetData(), GetSize());
+ DestroyElements<A>(GetAllocator(), GetData(), GetSize());
}
}
ConstructionTransaction(const ConstructionTransaction&) = delete;
void operator=(const ConstructionTransaction&) = delete;
- AllocatorType& GetAllocator() { return alloc_data_.template get<0>(); }
- Pointer& GetData() { return alloc_data_.template get<1>(); }
- SizeType& GetSize() { return size_; }
+ A& GetAllocator() { return allocator_data_.template get<0>(); }
+ Pointer<A>& GetData() { return allocator_data_.template get<1>(); }
+ SizeType<A>& GetSize() { return size_; }
bool DidConstruct() { return GetData() != nullptr; }
template <typename ValueAdapter>
- void Construct(Pointer data, ValueAdapter* values_ptr, SizeType size) {
- inlined_vector_internal::ConstructElements(std::addressof(GetAllocator()),
- data, values_ptr, size);
+ void Construct(Pointer<A> data, ValueAdapter& values, SizeType<A> size) {
+ ConstructElements<A>(GetAllocator(), data, values, size);
GetData() = data;
GetSize() = size;
}
- void Commit() {
+ void Commit() && {
GetData() = nullptr;
GetSize() = 0;
}
private:
- container_internal::CompressedTuple<AllocatorType, Pointer> alloc_data_;
- SizeType size_ = 0;
+ container_internal::CompressedTuple<A, Pointer<A>> allocator_data_;
+ SizeType<A> size_;
};
template <typename T, size_t N, typename A>
class Storage {
public:
- using AllocatorTraits = absl::allocator_traits<A>;
- using allocator_type = typename AllocatorTraits::allocator_type;
- using value_type = typename AllocatorTraits::value_type;
- using pointer = typename AllocatorTraits::pointer;
- using const_pointer = typename AllocatorTraits::const_pointer;
- using size_type = typename AllocatorTraits::size_type;
- using difference_type = typename AllocatorTraits::difference_type;
-
- using reference = value_type&;
- using const_reference = const value_type&;
- using RValueReference = value_type&&;
- using iterator = pointer;
- using const_iterator = const_pointer;
- using reverse_iterator = std::reverse_iterator<iterator>;
- using const_reverse_iterator = std::reverse_iterator<const_iterator>;
- using MoveIterator = std::move_iterator<iterator>;
- using IsMemcpyOk = inlined_vector_internal::IsMemcpyOk<allocator_type>;
-
- using StorageView = inlined_vector_internal::StorageView<allocator_type>;
-
- template <typename Iterator>
- using IteratorValueAdapter =
- inlined_vector_internal::IteratorValueAdapter<allocator_type, Iterator>;
- using CopyValueAdapter =
- inlined_vector_internal::CopyValueAdapter<allocator_type>;
- using DefaultValueAdapter =
- inlined_vector_internal::DefaultValueAdapter<allocator_type>;
-
- using AllocationTransaction =
- inlined_vector_internal::AllocationTransaction<allocator_type>;
- using ConstructionTransaction =
- inlined_vector_internal::ConstructionTransaction<allocator_type>;
-
- static size_type NextCapacity(size_type current_capacity) {
+ static SizeType<A> NextCapacity(SizeType<A> current_capacity) {
return current_capacity * 2;
}
- static size_type ComputeCapacity(size_type current_capacity,
- size_type requested_capacity) {
+ static SizeType<A> ComputeCapacity(SizeType<A> current_capacity,
+ SizeType<A> requested_capacity) {
return (std::max)(NextCapacity(current_capacity), requested_capacity);
}
@@ -321,15 +297,15 @@ class Storage {
// Storage Constructors and Destructor
// ---------------------------------------------------------------------------
- Storage() : metadata_(allocator_type(), /* size and is_allocated */ 0) {}
+ Storage() : metadata_(A(), /* size and is_allocated */ 0) {}
- explicit Storage(const allocator_type& alloc)
- : metadata_(alloc, /* size and is_allocated */ 0) {}
+ explicit Storage(const A& allocator)
+ : metadata_(allocator, /* size and is_allocated */ 0) {}
~Storage() {
if (GetSizeAndIsAllocated() == 0) {
// Empty and not allocated; nothing to do.
- } else if (IsMemcpyOk::value) {
+ } else if (IsMemcpyOk<A>::value) {
// No destructors need to be run; just deallocate if necessary.
DeallocateIfAllocated();
} else {
@@ -341,52 +317,48 @@ class Storage {
// Storage Member Accessors
// ---------------------------------------------------------------------------
- size_type& GetSizeAndIsAllocated() { return metadata_.template get<1>(); }
+ SizeType<A>& GetSizeAndIsAllocated() { return metadata_.template get<1>(); }
- const size_type& GetSizeAndIsAllocated() const {
+ const SizeType<A>& GetSizeAndIsAllocated() const {
return metadata_.template get<1>();
}
- size_type GetSize() const { return GetSizeAndIsAllocated() >> 1; }
+ SizeType<A> GetSize() const { return GetSizeAndIsAllocated() >> 1; }
bool GetIsAllocated() const { return GetSizeAndIsAllocated() & 1; }
- pointer GetAllocatedData() { return data_.allocated.allocated_data; }
+ Pointer<A> GetAllocatedData() { return data_.allocated.allocated_data; }
- const_pointer GetAllocatedData() const {
+ ConstPointer<A> GetAllocatedData() const {
return data_.allocated.allocated_data;
}
- pointer GetInlinedData() {
- return reinterpret_cast<pointer>(
+ Pointer<A> GetInlinedData() {
+ return reinterpret_cast<Pointer<A>>(
std::addressof(data_.inlined.inlined_data[0]));
}
- const_pointer GetInlinedData() const {
- return reinterpret_cast<const_pointer>(
+ ConstPointer<A> GetInlinedData() const {
+ return reinterpret_cast<ConstPointer<A>>(
std::addressof(data_.inlined.inlined_data[0]));
}
- size_type GetAllocatedCapacity() const {
+ SizeType<A> GetAllocatedCapacity() const {
return data_.allocated.allocated_capacity;
}
- size_type GetInlinedCapacity() const { return static_cast<size_type>(N); }
+ SizeType<A> GetInlinedCapacity() const { return static_cast<SizeType<A>>(N); }
- StorageView MakeStorageView() {
- return GetIsAllocated()
- ? StorageView{GetAllocatedData(), GetSize(),
- GetAllocatedCapacity()}
- : StorageView{GetInlinedData(), GetSize(), GetInlinedCapacity()};
+ StorageView<A> MakeStorageView() {
+ return GetIsAllocated() ? StorageView<A>{GetAllocatedData(), GetSize(),
+ GetAllocatedCapacity()}
+ : StorageView<A>{GetInlinedData(), GetSize(),
+ GetInlinedCapacity()};
}
- allocator_type* GetAllocPtr() {
- return std::addressof(metadata_.template get<0>());
- }
+ A& GetAllocator() { return metadata_.template get<0>(); }
- const allocator_type* GetAllocPtr() const {
- return std::addressof(metadata_.template get<0>());
- }
+ const A& GetAllocator() const { return metadata_.template get<0>(); }
// ---------------------------------------------------------------------------
// Storage Member Mutators
@@ -395,74 +367,67 @@ class Storage {
ABSL_ATTRIBUTE_NOINLINE void InitFrom(const Storage& other);
template <typename ValueAdapter>
- void Initialize(ValueAdapter values, size_type new_size);
+ void Initialize(ValueAdapter values, SizeType<A> new_size);
template <typename ValueAdapter>
- void Assign(ValueAdapter values, size_type new_size);
+ void Assign(ValueAdapter values, SizeType<A> new_size);
template <typename ValueAdapter>
- void Resize(ValueAdapter values, size_type new_size);
+ void Resize(ValueAdapter values, SizeType<A> new_size);
template <typename ValueAdapter>
- iterator Insert(const_iterator pos, ValueAdapter values,
- size_type insert_count);
+ Iterator<A> Insert(ConstIterator<A> pos, ValueAdapter values,
+ SizeType<A> insert_count);
template <typename... Args>
- reference EmplaceBack(Args&&... args);
+ Reference<A> EmplaceBack(Args&&... args);
- iterator Erase(const_iterator from, const_iterator to);
+ Iterator<A> Erase(ConstIterator<A> from, ConstIterator<A> to);
- void Reserve(size_type requested_capacity);
+ void Reserve(SizeType<A> requested_capacity);
void ShrinkToFit();
void Swap(Storage* other_storage_ptr);
void SetIsAllocated() {
- GetSizeAndIsAllocated() |= static_cast<size_type>(1);
+ GetSizeAndIsAllocated() |= static_cast<SizeType<A>>(1);
}
void UnsetIsAllocated() {
- GetSizeAndIsAllocated() &= ((std::numeric_limits<size_type>::max)() - 1);
+ GetSizeAndIsAllocated() &= ((std::numeric_limits<SizeType<A>>::max)() - 1);
}
- void SetSize(size_type size) {
+ void SetSize(SizeType<A> size) {
GetSizeAndIsAllocated() =
- (size << 1) | static_cast<size_type>(GetIsAllocated());
+ (size << 1) | static_cast<SizeType<A>>(GetIsAllocated());
}
- void SetAllocatedSize(size_type size) {
- GetSizeAndIsAllocated() = (size << 1) | static_cast<size_type>(1);
+ void SetAllocatedSize(SizeType<A> size) {
+ GetSizeAndIsAllocated() = (size << 1) | static_cast<SizeType<A>>(1);
}
- void SetInlinedSize(size_type size) {
- GetSizeAndIsAllocated() = size << static_cast<size_type>(1);
+ void SetInlinedSize(SizeType<A> size) {
+ GetSizeAndIsAllocated() = size << static_cast<SizeType<A>>(1);
}
- void AddSize(size_type count) {
- GetSizeAndIsAllocated() += count << static_cast<size_type>(1);
+ void AddSize(SizeType<A> count) {
+ GetSizeAndIsAllocated() += count << static_cast<SizeType<A>>(1);
}
- void SubtractSize(size_type count) {
+ void SubtractSize(SizeType<A> count) {
assert(count <= GetSize());
- GetSizeAndIsAllocated() -= count << static_cast<size_type>(1);
- }
-
- void SetAllocatedData(pointer data, size_type capacity) {
- data_.allocated.allocated_data = data;
- data_.allocated.allocated_capacity = capacity;
+ GetSizeAndIsAllocated() -= count << static_cast<SizeType<A>>(1);
}
- void AcquireAllocatedData(AllocationTransaction* allocation_tx_ptr) {
- SetAllocatedData(allocation_tx_ptr->GetData(),
- allocation_tx_ptr->GetCapacity());
-
- allocation_tx_ptr->Reset();
+ void SetAllocation(Allocation<A> allocation) {
+ data_.allocated.allocated_data = allocation.data;
+ data_.allocated.allocated_capacity = allocation.capacity;
}
void MemcpyFrom(const Storage& other_storage) {
- assert(IsMemcpyOk::value || other_storage.GetIsAllocated());
+ assert(IsMemcpyOk<A>::value || other_storage.GetIsAllocated());
GetSizeAndIsAllocated() = other_storage.GetSizeAndIsAllocated();
data_ = other_storage.data_;
@@ -470,24 +435,23 @@ class Storage {
void DeallocateIfAllocated() {
if (GetIsAllocated()) {
- AllocatorTraits::deallocate(*GetAllocPtr(), GetAllocatedData(),
- GetAllocatedCapacity());
+ MallocAdapter<A>::Deallocate(GetAllocator(), GetAllocatedData(),
+ GetAllocatedCapacity());
}
}
private:
ABSL_ATTRIBUTE_NOINLINE void DestroyContents();
- using Metadata =
- container_internal::CompressedTuple<allocator_type, size_type>;
+ using Metadata = container_internal::CompressedTuple<A, SizeType<A>>;
struct Allocated {
- pointer allocated_data;
- size_type allocated_capacity;
+ Pointer<A> allocated_data;
+ SizeType<A> allocated_capacity;
};
struct Inlined {
- alignas(value_type) char inlined_data[sizeof(value_type[N])];
+ alignas(ValueType<A>) char inlined_data[sizeof(ValueType<A>[N])];
};
union Data {
@@ -496,7 +460,7 @@ class Storage {
};
template <typename... Args>
- ABSL_ATTRIBUTE_NOINLINE reference EmplaceBackSlow(Args&&... args);
+ ABSL_ATTRIBUTE_NOINLINE Reference<A> EmplaceBackSlow(Args&&... args);
Metadata metadata_;
Data data_;
@@ -504,17 +468,17 @@ class Storage {
template <typename T, size_t N, typename A>
void Storage<T, N, A>::DestroyContents() {
- pointer data = GetIsAllocated() ? GetAllocatedData() : GetInlinedData();
- inlined_vector_internal::DestroyElements(GetAllocPtr(), data, GetSize());
+ Pointer<A> data = GetIsAllocated() ? GetAllocatedData() : GetInlinedData();
+ DestroyElements<A>(GetAllocator(), data, GetSize());
DeallocateIfAllocated();
}
template <typename T, size_t N, typename A>
void Storage<T, N, A>::InitFrom(const Storage& other) {
- const auto n = other.GetSize();
+ const SizeType<A> n = other.GetSize();
assert(n > 0); // Empty sources handled handled in caller.
- const_pointer src;
- pointer dst;
+ ConstPointer<A> src;
+ Pointer<A> dst;
if (!other.GetIsAllocated()) {
dst = GetInlinedData();
src = other.GetInlinedData();
@@ -522,43 +486,48 @@ void Storage<T, N, A>::InitFrom(const Storage& other) {
// Because this is only called from the `InlinedVector` constructors, it's
// safe to take on the allocation with size `0`. If `ConstructElements(...)`
// throws, deallocation will be automatically handled by `~Storage()`.
- size_type new_capacity = ComputeCapacity(GetInlinedCapacity(), n);
- dst = AllocatorTraits::allocate(*GetAllocPtr(), new_capacity);
- SetAllocatedData(dst, new_capacity);
+ SizeType<A> requested_capacity = ComputeCapacity(GetInlinedCapacity(), n);
+ Allocation<A> allocation =
+ MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity);
+ SetAllocation(allocation);
+ dst = allocation.data;
src = other.GetAllocatedData();
}
- if (IsMemcpyOk::value) {
- MemcpyIfAllowed<IsMemcpyOk::value>(dst, src, sizeof(dst[0]) * n);
+ if (IsMemcpyOk<A>::value) {
+ std::memcpy(reinterpret_cast<char*>(dst),
+ reinterpret_cast<const char*>(src), n * sizeof(ValueType<A>));
} else {
- auto values = IteratorValueAdapter<const_pointer>(src);
- inlined_vector_internal::ConstructElements(GetAllocPtr(), dst, &values, n);
+ auto values = IteratorValueAdapter<A, ConstPointer<A>>(src);
+ ConstructElements<A>(GetAllocator(), dst, values, n);
}
GetSizeAndIsAllocated() = other.GetSizeAndIsAllocated();
}
template <typename T, size_t N, typename A>
template <typename ValueAdapter>
-auto Storage<T, N, A>::Initialize(ValueAdapter values, size_type new_size)
+auto Storage<T, N, A>::Initialize(ValueAdapter values, SizeType<A> new_size)
-> void {
// Only callable from constructors!
assert(!GetIsAllocated());
assert(GetSize() == 0);
- pointer construct_data;
+ Pointer<A> construct_data;
if (new_size > GetInlinedCapacity()) {
// Because this is only called from the `InlinedVector` constructors, it's
// safe to take on the allocation with size `0`. If `ConstructElements(...)`
// throws, deallocation will be automatically handled by `~Storage()`.
- size_type new_capacity = ComputeCapacity(GetInlinedCapacity(), new_size);
- construct_data = AllocatorTraits::allocate(*GetAllocPtr(), new_capacity);
- SetAllocatedData(construct_data, new_capacity);
+ SizeType<A> requested_capacity =
+ ComputeCapacity(GetInlinedCapacity(), new_size);
+ Allocation<A> allocation =
+ MallocAdapter<A>::Allocate(GetAllocator(), requested_capacity);
+ construct_data = allocation.data;
+ SetAllocation(allocation);
SetIsAllocated();
} else {
construct_data = GetInlinedData();
}
- inlined_vector_internal::ConstructElements(GetAllocPtr(), construct_data,
- &values, new_size);
+ ConstructElements<A>(GetAllocator(), construct_data, values, new_size);
// Since the initial size was guaranteed to be `0` and the allocated bit is
// already correct for either case, *adding* `new_size` gives us the correct
@@ -568,18 +537,20 @@ auto Storage<T, N, A>::Initialize(ValueAdapter values, size_type new_size)
template <typename T, size_t N, typename A>
template <typename ValueAdapter>
-auto Storage<T, N, A>::Assign(ValueAdapter values, size_type new_size) -> void {
- StorageView storage_view = MakeStorageView();
+auto Storage<T, N, A>::Assign(ValueAdapter values, SizeType<A> new_size)
+ -> void {
+ StorageView<A> storage_view = MakeStorageView();
- AllocationTransaction allocation_tx(GetAllocPtr());
+ AllocationTransaction<A> allocation_tx(GetAllocator());
- absl::Span<value_type> assign_loop;
- absl::Span<value_type> construct_loop;
- absl::Span<value_type> destroy_loop;
+ absl::Span<ValueType<A>> assign_loop;
+ absl::Span<ValueType<A>> construct_loop;
+ absl::Span<ValueType<A>> destroy_loop;
if (new_size > storage_view.capacity) {
- size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size);
- construct_loop = {allocation_tx.Allocate(new_capacity), new_size};
+ SizeType<A> requested_capacity =
+ ComputeCapacity(storage_view.capacity, new_size);
+ construct_loop = {allocation_tx.Allocate(requested_capacity), new_size};
destroy_loop = {storage_view.data, storage_view.size};
} else if (new_size > storage_view.size) {
assign_loop = {storage_view.data, storage_view.size};
@@ -590,18 +561,16 @@ auto Storage<T, N, A>::Assign(ValueAdapter values, size_type new_size) -> void {
destroy_loop = {storage_view.data + new_size, storage_view.size - new_size};
}
- inlined_vector_internal::AssignElements(assign_loop.data(), &values,
- assign_loop.size());
+ AssignElements<A>(assign_loop.data(), values, assign_loop.size());
- inlined_vector_internal::ConstructElements(
- GetAllocPtr(), construct_loop.data(), &values, construct_loop.size());
+ ConstructElements<A>(GetAllocator(), construct_loop.data(), values,
+ construct_loop.size());
- inlined_vector_internal::DestroyElements(GetAllocPtr(), destroy_loop.data(),
- destroy_loop.size());
+ DestroyElements<A>(GetAllocator(), destroy_loop.data(), destroy_loop.size());
if (allocation_tx.DidAllocate()) {
DeallocateIfAllocated();
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
SetIsAllocated();
}
@@ -610,19 +579,18 @@ auto Storage<T, N, A>::Assign(ValueAdapter values, size_type new_size) -> void {
template <typename T, size_t N, typename A>
template <typename ValueAdapter>
-auto Storage<T, N, A>::Resize(ValueAdapter values, size_type new_size) -> void {
- StorageView storage_view = MakeStorageView();
- auto* const base = storage_view.data;
- const size_type size = storage_view.size;
- auto* alloc = GetAllocPtr();
+auto Storage<T, N, A>::Resize(ValueAdapter values, SizeType<A> new_size)
+ -> void {
+ StorageView<A> storage_view = MakeStorageView();
+ Pointer<A> const base = storage_view.data;
+ const SizeType<A> size = storage_view.size;
+ A& alloc = GetAllocator();
if (new_size <= size) {
// Destroy extra old elements.
- inlined_vector_internal::DestroyElements(alloc, base + new_size,
- size - new_size);
+ DestroyElements<A>(alloc, base + new_size, size - new_size);
} else if (new_size <= storage_view.capacity) {
// Construct new elements in place.
- inlined_vector_internal::ConstructElements(alloc, base + size, &values,
- new_size - size);
+ ConstructElements<A>(alloc, base + size, values, new_size - size);
} else {
// Steps:
// a. Allocate new backing store.
@@ -631,21 +599,22 @@ auto Storage<T, N, A>::Resize(ValueAdapter values, size_type new_size) -> void {
// d. Destroy all elements in old backing store.
// Use transactional wrappers for the first two steps so we can roll
// back if necessary due to exceptions.
- AllocationTransaction allocation_tx(alloc);
- size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size);
- pointer new_data = allocation_tx.Allocate(new_capacity);
+ AllocationTransaction<A> allocation_tx(alloc);
+ SizeType<A> requested_capacity =
+ ComputeCapacity(storage_view.capacity, new_size);
+ Pointer<A> new_data = allocation_tx.Allocate(requested_capacity);
- ConstructionTransaction construction_tx(alloc);
- construction_tx.Construct(new_data + size, &values, new_size - size);
+ ConstructionTransaction<A> construction_tx(alloc);
+ construction_tx.Construct(new_data + size, values, new_size - size);
- IteratorValueAdapter<MoveIterator> move_values((MoveIterator(base)));
- inlined_vector_internal::ConstructElements(alloc, new_data, &move_values,
- size);
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ (MoveIterator<A>(base)));
+ ConstructElements<A>(alloc, new_data, move_values, size);
- inlined_vector_internal::DestroyElements(alloc, base, size);
- construction_tx.Commit();
+ DestroyElements<A>(alloc, base, size);
+ std::move(construction_tx).Commit();
DeallocateIfAllocated();
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
SetIsAllocated();
}
SetSize(new_size);
@@ -653,76 +622,76 @@ auto Storage<T, N, A>::Resize(ValueAdapter values, size_type new_size) -> void {
template <typename T, size_t N, typename A>
template <typename ValueAdapter>
-auto Storage<T, N, A>::Insert(const_iterator pos, ValueAdapter values,
- size_type insert_count) -> iterator {
- StorageView storage_view = MakeStorageView();
+auto Storage<T, N, A>::Insert(ConstIterator<A> pos, ValueAdapter values,
+ SizeType<A> insert_count) -> Iterator<A> {
+ StorageView<A> storage_view = MakeStorageView();
- size_type insert_index =
- std::distance(const_iterator(storage_view.data), pos);
- size_type insert_end_index = insert_index + insert_count;
- size_type new_size = storage_view.size + insert_count;
+ SizeType<A> insert_index =
+ std::distance(ConstIterator<A>(storage_view.data), pos);
+ SizeType<A> insert_end_index = insert_index + insert_count;
+ SizeType<A> new_size = storage_view.size + insert_count;
if (new_size > storage_view.capacity) {
- AllocationTransaction allocation_tx(GetAllocPtr());
- ConstructionTransaction construction_tx(GetAllocPtr());
- ConstructionTransaction move_construciton_tx(GetAllocPtr());
+ AllocationTransaction<A> allocation_tx(GetAllocator());
+ ConstructionTransaction<A> construction_tx(GetAllocator());
+ ConstructionTransaction<A> move_construction_tx(GetAllocator());
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(storage_view.data));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(storage_view.data));
- size_type new_capacity = ComputeCapacity(storage_view.capacity, new_size);
- pointer new_data = allocation_tx.Allocate(new_capacity);
+ SizeType<A> requested_capacity =
+ ComputeCapacity(storage_view.capacity, new_size);
+ Pointer<A> new_data = allocation_tx.Allocate(requested_capacity);
- construction_tx.Construct(new_data + insert_index, &values, insert_count);
+ construction_tx.Construct(new_data + insert_index, values, insert_count);
- move_construciton_tx.Construct(new_data, &move_values, insert_index);
+ move_construction_tx.Construct(new_data, move_values, insert_index);
- inlined_vector_internal::ConstructElements(
- GetAllocPtr(), new_data + insert_end_index, &move_values,
- storage_view.size - insert_index);
+ ConstructElements<A>(GetAllocator(), new_data + insert_end_index,
+ move_values, storage_view.size - insert_index);
- inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
- storage_view.size);
+ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size);
- construction_tx.Commit();
- move_construciton_tx.Commit();
+ std::move(construction_tx).Commit();
+ std::move(move_construction_tx).Commit();
DeallocateIfAllocated();
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
SetAllocatedSize(new_size);
- return iterator(new_data + insert_index);
+ return Iterator<A>(new_data + insert_index);
} else {
- size_type move_construction_destination_index =
+ SizeType<A> move_construction_destination_index =
(std::max)(insert_end_index, storage_view.size);
- ConstructionTransaction move_construction_tx(GetAllocPtr());
+ ConstructionTransaction<A> move_construction_tx(GetAllocator());
- IteratorValueAdapter<MoveIterator> move_construction_values(
- MoveIterator(storage_view.data +
- (move_construction_destination_index - insert_count)));
- absl::Span<value_type> move_construction = {
+ IteratorValueAdapter<A, MoveIterator<A>> move_construction_values(
+ MoveIterator<A>(storage_view.data +
+ (move_construction_destination_index - insert_count)));
+ absl::Span<ValueType<A>> move_construction = {
storage_view.data + move_construction_destination_index,
new_size - move_construction_destination_index};
- pointer move_assignment_values = storage_view.data + insert_index;
- absl::Span<value_type> move_assignment = {
+ Pointer<A> move_assignment_values = storage_view.data + insert_index;
+ absl::Span<ValueType<A>> move_assignment = {
storage_view.data + insert_end_index,
move_construction_destination_index - insert_end_index};
- absl::Span<value_type> insert_assignment = {move_assignment_values,
- move_construction.size()};
+ absl::Span<ValueType<A>> insert_assignment = {move_assignment_values,
+ move_construction.size()};
- absl::Span<value_type> insert_construction = {
+ absl::Span<ValueType<A>> insert_construction = {
insert_assignment.data() + insert_assignment.size(),
insert_count - insert_assignment.size()};
move_construction_tx.Construct(move_construction.data(),
- &move_construction_values,
+ move_construction_values,
move_construction.size());
- for (pointer destination = move_assignment.data() + move_assignment.size(),
- last_destination = move_assignment.data(),
- source = move_assignment_values + move_assignment.size();
+ for (Pointer<A>
+ destination = move_assignment.data() + move_assignment.size(),
+ last_destination = move_assignment.data(),
+ source = move_assignment_values + move_assignment.size();
;) {
--destination;
--source;
@@ -730,30 +699,29 @@ auto Storage<T, N, A>::Insert(const_iterator pos, ValueAdapter values,
*destination = std::move(*source);
}
- inlined_vector_internal::AssignElements(insert_assignment.data(), &values,
- insert_assignment.size());
+ AssignElements<A>(insert_assignment.data(), values,
+ insert_assignment.size());
- inlined_vector_internal::ConstructElements(
- GetAllocPtr(), insert_construction.data(), &values,
- insert_construction.size());
+ ConstructElements<A>(GetAllocator(), insert_construction.data(), values,
+ insert_construction.size());
- move_construction_tx.Commit();
+ std::move(move_construction_tx).Commit();
AddSize(insert_count);
- return iterator(storage_view.data + insert_index);
+ return Iterator<A>(storage_view.data + insert_index);
}
}
template <typename T, size_t N, typename A>
template <typename... Args>
-auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> reference {
- StorageView storage_view = MakeStorageView();
- const auto n = storage_view.size;
+auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> Reference<A> {
+ StorageView<A> storage_view = MakeStorageView();
+ const SizeType<A> n = storage_view.size;
if (ABSL_PREDICT_TRUE(n != storage_view.capacity)) {
// Fast path; new element fits.
- pointer last_ptr = storage_view.data + n;
- AllocatorTraits::construct(*GetAllocPtr(), last_ptr,
- std::forward<Args>(args)...);
+ Pointer<A> last_ptr = storage_view.data + n;
+ AllocatorTraits<A>::construct(GetAllocator(), last_ptr,
+ std::forward<Args>(args)...);
AddSize(1);
return *last_ptr;
}
@@ -763,87 +731,83 @@ auto Storage<T, N, A>::EmplaceBack(Args&&... args) -> reference {
template <typename T, size_t N, typename A>
template <typename... Args>
-auto Storage<T, N, A>::EmplaceBackSlow(Args&&... args) -> reference {
- StorageView storage_view = MakeStorageView();
- AllocationTransaction allocation_tx(GetAllocPtr());
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(storage_view.data));
- size_type new_capacity = NextCapacity(storage_view.capacity);
- pointer construct_data = allocation_tx.Allocate(new_capacity);
- pointer last_ptr = construct_data + storage_view.size;
+auto Storage<T, N, A>::EmplaceBackSlow(Args&&... args) -> Reference<A> {
+ StorageView<A> storage_view = MakeStorageView();
+ AllocationTransaction<A> allocation_tx(GetAllocator());
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(storage_view.data));
+ SizeType<A> requested_capacity = NextCapacity(storage_view.capacity);
+ Pointer<A> construct_data = allocation_tx.Allocate(requested_capacity);
+ Pointer<A> last_ptr = construct_data + storage_view.size;
// Construct new element.
- AllocatorTraits::construct(*GetAllocPtr(), last_ptr,
- std::forward<Args>(args)...);
+ AllocatorTraits<A>::construct(GetAllocator(), last_ptr,
+ std::forward<Args>(args)...);
// Move elements from old backing store to new backing store.
ABSL_INTERNAL_TRY {
- inlined_vector_internal::ConstructElements(
- GetAllocPtr(), allocation_tx.GetData(), &move_values,
- storage_view.size);
+ ConstructElements<A>(GetAllocator(), allocation_tx.GetData(), move_values,
+ storage_view.size);
}
ABSL_INTERNAL_CATCH_ANY {
- AllocatorTraits::destroy(*GetAllocPtr(), last_ptr);
+ AllocatorTraits<A>::destroy(GetAllocator(), last_ptr);
ABSL_INTERNAL_RETHROW;
}
// Destroy elements in old backing store.
- inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
- storage_view.size);
+ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size);
DeallocateIfAllocated();
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
SetIsAllocated();
AddSize(1);
return *last_ptr;
}
template <typename T, size_t N, typename A>
-auto Storage<T, N, A>::Erase(const_iterator from, const_iterator to)
- -> iterator {
- StorageView storage_view = MakeStorageView();
+auto Storage<T, N, A>::Erase(ConstIterator<A> from, ConstIterator<A> to)
+ -> Iterator<A> {
+ StorageView<A> storage_view = MakeStorageView();
- size_type erase_size = std::distance(from, to);
- size_type erase_index =
- std::distance(const_iterator(storage_view.data), from);
- size_type erase_end_index = erase_index + erase_size;
+ SizeType<A> erase_size = std::distance(from, to);
+ SizeType<A> erase_index =
+ std::distance(ConstIterator<A>(storage_view.data), from);
+ SizeType<A> erase_end_index = erase_index + erase_size;
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(storage_view.data + erase_end_index));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(storage_view.data + erase_end_index));
- inlined_vector_internal::AssignElements(storage_view.data + erase_index,
- &move_values,
- storage_view.size - erase_end_index);
+ AssignElements<A>(storage_view.data + erase_index, move_values,
+ storage_view.size - erase_end_index);
- inlined_vector_internal::DestroyElements(
- GetAllocPtr(), storage_view.data + (storage_view.size - erase_size),
- erase_size);
+ DestroyElements<A>(GetAllocator(),
+ storage_view.data + (storage_view.size - erase_size),
+ erase_size);
SubtractSize(erase_size);
- return iterator(storage_view.data + erase_index);
+ return Iterator<A>(storage_view.data + erase_index);
}
template <typename T, size_t N, typename A>
-auto Storage<T, N, A>::Reserve(size_type requested_capacity) -> void {
- StorageView storage_view = MakeStorageView();
+auto Storage<T, N, A>::Reserve(SizeType<A> requested_capacity) -> void {
+ StorageView<A> storage_view = MakeStorageView();
if (ABSL_PREDICT_FALSE(requested_capacity <= storage_view.capacity)) return;
- AllocationTransaction allocation_tx(GetAllocPtr());
+ AllocationTransaction<A> allocation_tx(GetAllocator());
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(storage_view.data));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(storage_view.data));
- size_type new_capacity =
+ SizeType<A> new_requested_capacity =
ComputeCapacity(storage_view.capacity, requested_capacity);
- pointer new_data = allocation_tx.Allocate(new_capacity);
+ Pointer<A> new_data = allocation_tx.Allocate(new_requested_capacity);
- inlined_vector_internal::ConstructElements(GetAllocPtr(), new_data,
- &move_values, storage_view.size);
+ ConstructElements<A>(GetAllocator(), new_data, move_values,
+ storage_view.size);
- inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
- storage_view.size);
+ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size);
DeallocateIfAllocated();
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
SetIsAllocated();
}
@@ -852,41 +816,44 @@ auto Storage<T, N, A>::ShrinkToFit() -> void {
// May only be called on allocated instances!
assert(GetIsAllocated());
- StorageView storage_view{GetAllocatedData(), GetSize(),
- GetAllocatedCapacity()};
+ StorageView<A> storage_view{GetAllocatedData(), GetSize(),
+ GetAllocatedCapacity()};
if (ABSL_PREDICT_FALSE(storage_view.size == storage_view.capacity)) return;
- AllocationTransaction allocation_tx(GetAllocPtr());
+ AllocationTransaction<A> allocation_tx(GetAllocator());
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(storage_view.data));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(storage_view.data));
- pointer construct_data;
+ Pointer<A> construct_data;
if (storage_view.size > GetInlinedCapacity()) {
- size_type new_capacity = storage_view.size;
- construct_data = allocation_tx.Allocate(new_capacity);
+ SizeType<A> requested_capacity = storage_view.size;
+ construct_data = allocation_tx.Allocate(requested_capacity);
+ if (allocation_tx.GetCapacity() >= storage_view.capacity) {
+ // Already using the smallest available heap allocation.
+ return;
+ }
} else {
construct_data = GetInlinedData();
}
ABSL_INTERNAL_TRY {
- inlined_vector_internal::ConstructElements(GetAllocPtr(), construct_data,
- &move_values, storage_view.size);
+ ConstructElements<A>(GetAllocator(), construct_data, move_values,
+ storage_view.size);
}
ABSL_INTERNAL_CATCH_ANY {
- SetAllocatedData(storage_view.data, storage_view.capacity);
+ SetAllocation({storage_view.data, storage_view.capacity});
ABSL_INTERNAL_RETHROW;
}
- inlined_vector_internal::DestroyElements(GetAllocPtr(), storage_view.data,
- storage_view.size);
+ DestroyElements<A>(GetAllocator(), storage_view.data, storage_view.size);
- AllocatorTraits::deallocate(*GetAllocPtr(), storage_view.data,
- storage_view.capacity);
+ MallocAdapter<A>::Deallocate(GetAllocator(), storage_view.data,
+ storage_view.capacity);
if (allocation_tx.DidAllocate()) {
- AcquireAllocatedData(&allocation_tx);
+ SetAllocation(std::move(allocation_tx).Release());
} else {
UnsetIsAllocated();
}
@@ -904,58 +871,56 @@ auto Storage<T, N, A>::Swap(Storage* other_storage_ptr) -> void {
Storage* large_ptr = other_storage_ptr;
if (small_ptr->GetSize() > large_ptr->GetSize()) swap(small_ptr, large_ptr);
- for (size_type i = 0; i < small_ptr->GetSize(); ++i) {
+ for (SizeType<A> i = 0; i < small_ptr->GetSize(); ++i) {
swap(small_ptr->GetInlinedData()[i], large_ptr->GetInlinedData()[i]);
}
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(large_ptr->GetInlinedData() + small_ptr->GetSize()));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(large_ptr->GetInlinedData() + small_ptr->GetSize()));
- inlined_vector_internal::ConstructElements(
- large_ptr->GetAllocPtr(),
- small_ptr->GetInlinedData() + small_ptr->GetSize(), &move_values,
- large_ptr->GetSize() - small_ptr->GetSize());
+ ConstructElements<A>(large_ptr->GetAllocator(),
+ small_ptr->GetInlinedData() + small_ptr->GetSize(),
+ move_values,
+ large_ptr->GetSize() - small_ptr->GetSize());
- inlined_vector_internal::DestroyElements(
- large_ptr->GetAllocPtr(),
- large_ptr->GetInlinedData() + small_ptr->GetSize(),
- large_ptr->GetSize() - small_ptr->GetSize());
+ DestroyElements<A>(large_ptr->GetAllocator(),
+ large_ptr->GetInlinedData() + small_ptr->GetSize(),
+ large_ptr->GetSize() - small_ptr->GetSize());
} else {
Storage* allocated_ptr = this;
Storage* inlined_ptr = other_storage_ptr;
if (!allocated_ptr->GetIsAllocated()) swap(allocated_ptr, inlined_ptr);
- StorageView allocated_storage_view{allocated_ptr->GetAllocatedData(),
- allocated_ptr->GetSize(),
- allocated_ptr->GetAllocatedCapacity()};
+ StorageView<A> allocated_storage_view{
+ allocated_ptr->GetAllocatedData(), allocated_ptr->GetSize(),
+ allocated_ptr->GetAllocatedCapacity()};
- IteratorValueAdapter<MoveIterator> move_values(
- MoveIterator(inlined_ptr->GetInlinedData()));
+ IteratorValueAdapter<A, MoveIterator<A>> move_values(
+ MoveIterator<A>(inlined_ptr->GetInlinedData()));
ABSL_INTERNAL_TRY {
- inlined_vector_internal::ConstructElements(
- inlined_ptr->GetAllocPtr(), allocated_ptr->GetInlinedData(),
- &move_values, inlined_ptr->GetSize());
+ ConstructElements<A>(inlined_ptr->GetAllocator(),
+ allocated_ptr->GetInlinedData(), move_values,
+ inlined_ptr->GetSize());
}
ABSL_INTERNAL_CATCH_ANY {
- allocated_ptr->SetAllocatedData(allocated_storage_view.data,
- allocated_storage_view.capacity);
+ allocated_ptr->SetAllocation(
+ {allocated_storage_view.data, allocated_storage_view.capacity});
ABSL_INTERNAL_RETHROW;
}
- inlined_vector_internal::DestroyElements(inlined_ptr->GetAllocPtr(),
- inlined_ptr->GetInlinedData(),
- inlined_ptr->GetSize());
+ DestroyElements<A>(inlined_ptr->GetAllocator(),
+ inlined_ptr->GetInlinedData(), inlined_ptr->GetSize());
- inlined_ptr->SetAllocatedData(allocated_storage_view.data,
- allocated_storage_view.capacity);
+ inlined_ptr->SetAllocation(
+ {allocated_storage_view.data, allocated_storage_view.capacity});
}
swap(GetSizeAndIsAllocated(), other_storage_ptr->GetSizeAndIsAllocated());
- swap(*GetAllocPtr(), *other_storage_ptr->GetAllocPtr());
+ swap(GetAllocator(), other_storage_ptr->GetAllocator());
}
-// End ignore "maybe-uninitialized"
+// End ignore "array-bounds" and "maybe-uninitialized"
#if !defined(__clang__) && defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/layout_test.cc b/grpc/third_party/abseil-cpp/absl/container/internal/layout_test.cc
index 1d7158ff..54e5d5bb 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/layout_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/layout_test.cc
@@ -1350,7 +1350,13 @@ TEST(Layout, CustomAlignment) {
TEST(Layout, OverAligned) {
constexpr size_t M = alignof(max_align_t);
constexpr Layout<unsigned char, Aligned<unsigned char, 2 * M>> x(1, 3);
+#ifdef __GNUC__
+ // Using __attribute__ ((aligned ())) instead of alignas to bypass a gcc bug:
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89357
+ __attribute__((aligned(2 * M))) unsigned char p[x.AllocSize()];
+#else
alignas(2 * M) unsigned char p[x.AllocSize()];
+#endif
EXPECT_EQ(2 * M + 3, x.AllocSize());
EXPECT_THAT(x.Pointers(p), Tuple(p + 0, p + 2 * M));
}
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h
index 0a02757d..c7df2efc 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h
@@ -51,8 +51,9 @@ class raw_hash_map : public raw_hash_set<Policy, Hash, Eq, Alloc> {
using key_arg = typename KeyArgImpl::template type<K, key_type>;
static_assert(!std::is_reference<key_type>::value, "");
- // TODO(alkis): remove this assertion and verify that reference mapped_type is
- // supported.
+
+ // TODO(b/187807849): Evaluate whether to support reference mapped_type and
+ // remove this assertion if/when it is supported.
static_assert(!std::is_reference<mapped_type>::value, "");
using iterator = typename raw_hash_map::raw_hash_set::iterator;
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc
index bfef071f..687bcb8a 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc
@@ -23,6 +23,12 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
+alignas(16) ABSL_CONST_INIT ABSL_DLL const ctrl_t kEmptyGroup[16] = {
+ ctrl_t::kSentinel, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty,
+ ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty,
+ ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty,
+ ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty, ctrl_t::kEmpty};
+
constexpr size_t Group::kWidth;
// Returns "random" seed.
@@ -37,24 +43,24 @@ inline size_t RandomSeed() {
return value ^ static_cast<size_t>(reinterpret_cast<uintptr_t>(&counter));
}
-bool ShouldInsertBackwards(size_t hash, ctrl_t* ctrl) {
+bool ShouldInsertBackwards(size_t hash, const ctrl_t* ctrl) {
// To avoid problems with weak hashes and single bit tests, we use % 13.
// TODO(kfm,sbenza): revisit after we do unconditional mixing
return (H1(hash, ctrl) ^ RandomSeed()) % 13 > 6;
}
-void ConvertDeletedToEmptyAndFullToDeleted(
- ctrl_t* ctrl, size_t capacity) {
- assert(ctrl[capacity] == kSentinel);
+void ConvertDeletedToEmptyAndFullToDeleted(ctrl_t* ctrl, size_t capacity) {
+ assert(ctrl[capacity] == ctrl_t::kSentinel);
assert(IsValidCapacity(capacity));
- for (ctrl_t* pos = ctrl; pos != ctrl + capacity + 1; pos += Group::kWidth) {
+ for (ctrl_t* pos = ctrl; pos < ctrl + capacity; pos += Group::kWidth) {
Group{pos}.ConvertSpecialToEmptyAndFullToDeleted(pos);
}
// Copy the cloned ctrl bytes.
- std::memcpy(ctrl + capacity + 1, ctrl, Group::kWidth);
- ctrl[capacity] = kSentinel;
+ std::memcpy(ctrl + capacity + 1, ctrl, NumClonedBytes());
+ ctrl[capacity] = ctrl_t::kSentinel;
}
-
+// Extern template instantiotion for inline function.
+template FindInfo find_first_non_full(const ctrl_t*, size_t, size_t);
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
index 8615de8b..12682b35 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
@@ -87,6 +87,17 @@
//
// This probing function guarantees that after N probes, all the groups of the
// table will be probed exactly once.
+//
+// The control state and slot array are stored contiguously in a shared heap
+// allocation. The layout of this allocation is: `capacity()` control bytes,
+// one sentinel control byte, `Group::kWidth - 1` cloned control bytes,
+// <possible padding>, `capacity()` slots. The sentinel control byte is used in
+// iteration so we know when we reach the end of the table. The cloned control
+// bytes at the end of the table are cloned from the beginning of the table so
+// groups that begin near the end of the table can see a full group. In cases in
+// which there are more than `capacity()` cloned control bytes, the extra bytes
+// are `kEmpty`, and these ensure that we always see at least one empty slot and
+// can stop an unsuccessful search.
#ifndef ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
#define ABSL_CONTAINER_INTERNAL_RAW_HASH_SET_H_
@@ -112,7 +123,6 @@
#include "absl/container/internal/hashtable_debug_hooks.h"
#include "absl/container/internal/hashtablez_sampler.h"
#include "absl/container/internal/have_sse.h"
-#include "absl/container/internal/layout.h"
#include "absl/memory/memory.h"
#include "absl/meta/type_traits.h"
#include "absl/numeric/bits.h"
@@ -252,48 +262,53 @@ class BitMask {
T mask_;
};
-using ctrl_t = signed char;
using h2_t = uint8_t;
// The values here are selected for maximum performance. See the static asserts
-// below for details.
-enum Ctrl : ctrl_t {
+// below for details. We use an enum class so that when strict aliasing is
+// enabled, the compiler knows ctrl_t doesn't alias other types.
+enum class ctrl_t : int8_t {
kEmpty = -128, // 0b10000000
kDeleted = -2, // 0b11111110
kSentinel = -1, // 0b11111111
};
static_assert(
- kEmpty & kDeleted & kSentinel & 0x80,
+ (static_cast<int8_t>(ctrl_t::kEmpty) &
+ static_cast<int8_t>(ctrl_t::kDeleted) &
+ static_cast<int8_t>(ctrl_t::kSentinel) & 0x80) != 0,
"Special markers need to have the MSB to make checking for them efficient");
-static_assert(kEmpty < kSentinel && kDeleted < kSentinel,
- "kEmpty and kDeleted must be smaller than kSentinel to make the "
- "SIMD test of IsEmptyOrDeleted() efficient");
-static_assert(kSentinel == -1,
- "kSentinel must be -1 to elide loading it from memory into SIMD "
- "registers (pcmpeqd xmm, xmm)");
-static_assert(kEmpty == -128,
- "kEmpty must be -128 to make the SIMD check for its "
+static_assert(
+ ctrl_t::kEmpty < ctrl_t::kSentinel && ctrl_t::kDeleted < ctrl_t::kSentinel,
+ "ctrl_t::kEmpty and ctrl_t::kDeleted must be smaller than "
+ "ctrl_t::kSentinel to make the SIMD test of IsEmptyOrDeleted() efficient");
+static_assert(
+ ctrl_t::kSentinel == static_cast<ctrl_t>(-1),
+ "ctrl_t::kSentinel must be -1 to elide loading it from memory into SIMD "
+ "registers (pcmpeqd xmm, xmm)");
+static_assert(ctrl_t::kEmpty == static_cast<ctrl_t>(-128),
+ "ctrl_t::kEmpty must be -128 to make the SIMD check for its "
"existence efficient (psignb xmm, xmm)");
-static_assert(~kEmpty & ~kDeleted & kSentinel & 0x7F,
- "kEmpty and kDeleted must share an unset bit that is not shared "
- "by kSentinel to make the scalar test for MatchEmptyOrDeleted() "
- "efficient");
-static_assert(kDeleted == -2,
- "kDeleted must be -2 to make the implementation of "
+static_assert(
+ (~static_cast<int8_t>(ctrl_t::kEmpty) &
+ ~static_cast<int8_t>(ctrl_t::kDeleted) &
+ static_cast<int8_t>(ctrl_t::kSentinel) & 0x7F) != 0,
+ "ctrl_t::kEmpty and ctrl_t::kDeleted must share an unset bit that is not "
+ "shared by ctrl_t::kSentinel to make the scalar test for "
+ "MatchEmptyOrDeleted() efficient");
+static_assert(ctrl_t::kDeleted == static_cast<ctrl_t>(-2),
+ "ctrl_t::kDeleted must be -2 to make the implementation of "
"ConvertSpecialToEmptyAndFullToDeleted efficient");
// A single block of empty control bytes for tables without any slots allocated.
// This enables removing a branch in the hot path of find().
+ABSL_DLL extern const ctrl_t kEmptyGroup[16];
inline ctrl_t* EmptyGroup() {
- alignas(16) static constexpr ctrl_t empty_group[] = {
- kSentinel, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty,
- kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty, kEmpty};
- return const_cast<ctrl_t*>(empty_group);
+ return const_cast<ctrl_t*>(kEmptyGroup);
}
// Mixes a randomly generated per-process seed with `hash` and `ctrl` to
// randomize insertion order within groups.
-bool ShouldInsertBackwards(size_t hash, ctrl_t* ctrl);
+bool ShouldInsertBackwards(size_t hash, const ctrl_t* ctrl);
// Returns a hash seed.
//
@@ -309,12 +324,12 @@ inline size_t HashSeed(const ctrl_t* ctrl) {
inline size_t H1(size_t hash, const ctrl_t* ctrl) {
return (hash >> 7) ^ HashSeed(ctrl);
}
-inline ctrl_t H2(size_t hash) { return hash & 0x7F; }
+inline h2_t H2(size_t hash) { return hash & 0x7F; }
-inline bool IsEmpty(ctrl_t c) { return c == kEmpty; }
-inline bool IsFull(ctrl_t c) { return c >= 0; }
-inline bool IsDeleted(ctrl_t c) { return c == kDeleted; }
-inline bool IsEmptyOrDeleted(ctrl_t c) { return c < kSentinel; }
+inline bool IsEmpty(ctrl_t c) { return c == ctrl_t::kEmpty; }
+inline bool IsFull(ctrl_t c) { return c >= static_cast<ctrl_t>(0); }
+inline bool IsDeleted(ctrl_t c) { return c == ctrl_t::kDeleted; }
+inline bool IsEmptyOrDeleted(ctrl_t c) { return c < ctrl_t::kSentinel; }
#if ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSE2
@@ -351,24 +366,24 @@ struct GroupSse2Impl {
// Returns a bitmask representing the positions of empty slots.
BitMask<uint32_t, kWidth> MatchEmpty() const {
#if ABSL_INTERNAL_RAW_HASH_SET_HAVE_SSSE3
- // This only works because kEmpty is -128.
+ // This only works because ctrl_t::kEmpty is -128.
return BitMask<uint32_t, kWidth>(
_mm_movemask_epi8(_mm_sign_epi8(ctrl, ctrl)));
#else
- return Match(static_cast<h2_t>(kEmpty));
+ return Match(static_cast<h2_t>(ctrl_t::kEmpty));
#endif
}
// Returns a bitmask representing the positions of empty or deleted slots.
BitMask<uint32_t, kWidth> MatchEmptyOrDeleted() const {
- auto special = _mm_set1_epi8(kSentinel);
+ auto special = _mm_set1_epi8(static_cast<int8_t>(ctrl_t::kSentinel));
return BitMask<uint32_t, kWidth>(
_mm_movemask_epi8(_mm_cmpgt_epi8_fixed(special, ctrl)));
}
// Returns the number of trailing empty or deleted elements in the group.
uint32_t CountLeadingEmptyOrDeleted() const {
- auto special = _mm_set1_epi8(kSentinel);
+ auto special = _mm_set1_epi8(static_cast<int8_t>(ctrl_t::kSentinel));
return TrailingZeros(static_cast<uint32_t>(
_mm_movemask_epi8(_mm_cmpgt_epi8_fixed(special, ctrl)) + 1));
}
@@ -403,7 +418,7 @@ struct GroupPortableImpl {
//
// Caveat: there are false positives but:
// - they only occur if there is a real match
- // - they never occur on kEmpty, kDeleted, kSentinel
+ // - they never occur on ctrl_t::kEmpty, ctrl_t::kDeleted, ctrl_t::kSentinel
// - they will be handled gracefully by subsequent checks in code
//
// Example:
@@ -448,6 +463,10 @@ using Group = GroupSse2Impl;
using Group = GroupPortableImpl;
#endif
+// The number of cloned control bytes that we copy from the beginning to the
+// end of the control bytes array.
+constexpr size_t NumClonedBytes() { return Group::kWidth - 1; }
+
template <class Policy, class Hash, class Eq, class Alloc>
class raw_hash_set;
@@ -455,8 +474,8 @@ inline bool IsValidCapacity(size_t n) { return ((n + 1) & n) == 0 && n > 0; }
// PRECONDITION:
// IsValidCapacity(capacity)
-// ctrl[capacity] == kSentinel
-// ctrl[i] != kSentinel for all i < capacity
+// ctrl[capacity] == ctrl_t::kSentinel
+// ctrl[i] != ctrl_t::kSentinel for all i < capacity
// Applies mapping for every byte in ctrl:
// DELETED -> EMPTY
// EMPTY -> EMPTY
@@ -498,6 +517,22 @@ inline size_t GrowthToLowerboundCapacity(size_t growth) {
return growth + static_cast<size_t>((static_cast<int64_t>(growth) - 1) / 7);
}
+template <class InputIter>
+size_t SelectBucketCountForIterRange(InputIter first, InputIter last,
+ size_t bucket_count) {
+ if (bucket_count != 0) {
+ return bucket_count;
+ }
+ using InputIterCategory =
+ typename std::iterator_traits<InputIter>::iterator_category;
+ if (std::is_base_of<std::random_access_iterator_tag,
+ InputIterCategory>::value) {
+ return GrowthToLowerboundCapacity(
+ static_cast<size_t>(std::distance(first, last)));
+ }
+ return 0;
+}
+
inline void AssertIsFull(ctrl_t* ctrl) {
ABSL_HARDENING_ASSERT((ctrl != nullptr && IsFull(*ctrl)) &&
"Invalid operation on iterator. The element might have "
@@ -525,27 +560,29 @@ struct FindInfo {
// This is important to make 1 a valid capacity.
//
// - In small mode only the first `capacity()` control bytes after the
-// sentinel are valid. The rest contain dummy kEmpty values that do not
+// sentinel are valid. The rest contain dummy ctrl_t::kEmpty values that do not
// represent a real slot. This is important to take into account on
// find_first_non_full(), where we never try ShouldInsertBackwards() for
// small tables.
inline bool is_small(size_t capacity) { return capacity < Group::kWidth - 1; }
-inline probe_seq<Group::kWidth> probe(ctrl_t* ctrl, size_t hash,
+inline probe_seq<Group::kWidth> probe(const ctrl_t* ctrl, size_t hash,
size_t capacity) {
return probe_seq<Group::kWidth>(H1(hash, ctrl), capacity);
}
// Probes the raw_hash_set with the probe sequence for hash and returns the
// pointer to the first empty or deleted slot.
-// NOTE: this function must work with tables having both kEmpty and kDelete
-// in one group. Such tables appears during drop_deletes_without_resize.
+// NOTE: this function must work with tables having both ctrl_t::kEmpty and
+// ctrl_t::kDeleted in one group. Such tables appears during
+// drop_deletes_without_resize.
//
// This function is very useful when insertions happen and:
// - the input is already a set
// - there are enough slots
// - the element with the hash is not in the table
-inline FindInfo find_first_non_full(ctrl_t* ctrl, size_t hash,
+template <typename = void>
+inline FindInfo find_first_non_full(const ctrl_t* ctrl, size_t hash,
size_t capacity) {
auto seq = probe(ctrl, hash, capacity);
while (true) {
@@ -564,8 +601,58 @@ inline FindInfo find_first_non_full(ctrl_t* ctrl, size_t hash,
return {seq.offset(mask.LowestBitSet()), seq.index()};
}
seq.next();
- assert(seq.index() < capacity && "full table!");
+ assert(seq.index() <= capacity && "full table!");
+ }
+}
+
+// Extern template for inline function keep possibility of inlining.
+// When compiler decided to not inline, no symbols will be added to the
+// corresponding translation unit.
+extern template FindInfo find_first_non_full(const ctrl_t*, size_t, size_t);
+
+// Reset all ctrl bytes back to ctrl_t::kEmpty, except the sentinel.
+inline void ResetCtrl(size_t capacity, ctrl_t* ctrl, const void* slot,
+ size_t slot_size) {
+ std::memset(ctrl, static_cast<int8_t>(ctrl_t::kEmpty),
+ capacity + 1 + NumClonedBytes());
+ ctrl[capacity] = ctrl_t::kSentinel;
+ SanitizerPoisonMemoryRegion(slot, slot_size * capacity);
+}
+
+// Sets the control byte, and if `i < NumClonedBytes()`, set the cloned byte
+// at the end too.
+inline void SetCtrl(size_t i, ctrl_t h, size_t capacity, ctrl_t* ctrl,
+ const void* slot, size_t slot_size) {
+ assert(i < capacity);
+
+ auto* slot_i = static_cast<const char*>(slot) + i * slot_size;
+ if (IsFull(h)) {
+ SanitizerUnpoisonMemoryRegion(slot_i, slot_size);
+ } else {
+ SanitizerPoisonMemoryRegion(slot_i, slot_size);
}
+
+ ctrl[i] = h;
+ ctrl[((i - NumClonedBytes()) & capacity) + (NumClonedBytes() & capacity)] = h;
+}
+
+inline void SetCtrl(size_t i, h2_t h, size_t capacity, ctrl_t* ctrl,
+ const void* slot, size_t slot_size) {
+ SetCtrl(i, static_cast<ctrl_t>(h), capacity, ctrl, slot, slot_size);
+}
+
+// The allocated block consists of `capacity + 1 + NumClonedBytes()` control
+// bytes followed by `capacity` slots, which must be aligned to `slot_align`.
+// SlotOffset returns the offset of the slots into the allocated block.
+inline size_t SlotOffset(size_t capacity, size_t slot_align) {
+ assert(IsValidCapacity(capacity));
+ const size_t num_control_bytes = capacity + 1 + NumClonedBytes();
+ return (num_control_bytes + slot_align - 1) & (~slot_align + 1);
+}
+
+// Returns the size of the allocated block. See also above comment.
+inline size_t AllocSize(size_t capacity, size_t slot_size, size_t slot_align) {
+ return SlotOffset(capacity, slot_align) + capacity * slot_size;
}
// Policy: a policy defines how to perform different operations on
@@ -624,13 +711,6 @@ class raw_hash_set {
auto KeyTypeCanBeHashed(const Hash& h, const key_type& k) -> decltype(h(k));
auto KeyTypeCanBeEq(const Eq& eq, const key_type& k) -> decltype(eq(k, k));
- using Layout = absl::container_internal::Layout<ctrl_t, slot_type>;
-
- static Layout MakeLayout(size_t capacity) {
- assert(IsValidCapacity(capacity));
- return Layout(capacity + Group::kWidth + 1, capacity);
- }
-
using AllocTraits = absl::allocator_traits<allocator_type>;
using SlotAlloc = typename absl::allocator_traits<
allocator_type>::template rebind_alloc<slot_type>;
@@ -733,7 +813,7 @@ class raw_hash_set {
ctrl_ += shift;
slot_ += shift;
}
- if (ABSL_PREDICT_FALSE(*ctrl_ == kSentinel)) ctrl_ = nullptr;
+ if (ABSL_PREDICT_FALSE(*ctrl_ == ctrl_t::kSentinel)) ctrl_ = nullptr;
}
ctrl_t* ctrl_ = nullptr;
@@ -814,7 +894,8 @@ class raw_hash_set {
raw_hash_set(InputIter first, InputIter last, size_t bucket_count = 0,
const hasher& hash = hasher(), const key_equal& eq = key_equal(),
const allocator_type& alloc = allocator_type())
- : raw_hash_set(bucket_count, hash, eq, alloc) {
+ : raw_hash_set(SelectBucketCountForIterRange(first, last, bucket_count),
+ hash, eq, alloc) {
insert(first, last);
}
@@ -902,7 +983,8 @@ class raw_hash_set {
for (const auto& v : that) {
const size_t hash = PolicyTraits::apply(HashElement{hash_ref()}, v);
auto target = find_first_non_full(ctrl_, hash, capacity_);
- set_ctrl(target.offset, H2(hash));
+ SetCtrl(target.offset, H2(hash), capacity_, ctrl_, slots_,
+ sizeof(slot_type));
emplace_at(target.offset, v);
infoz().RecordInsert(hash, target.probe_length);
}
@@ -998,6 +1080,8 @@ class raw_hash_set {
// past that we simply deallocate the array.
if (capacity_ > 127) {
destroy_slots();
+
+ infoz().RecordClearedReservation();
} else if (capacity_) {
for (size_t i = 0; i != capacity_; ++i) {
if (IsFull(ctrl_[i])) {
@@ -1005,7 +1089,7 @@ class raw_hash_set {
}
}
size_ = 0;
- reset_ctrl();
+ ResetCtrl(capacity_, ctrl_, slots_, sizeof(slot_type));
reset_growth_left();
}
assert(empty());
@@ -1311,21 +1395,31 @@ class raw_hash_set {
if (n == 0 && size_ == 0) {
destroy_slots();
infoz().RecordStorageChanged(0, 0);
+ infoz().RecordClearedReservation();
return;
}
+
// bitor is a faster way of doing `max` here. We will round up to the next
// power-of-2-minus-1, so bitor is good enough.
auto m = NormalizeCapacity(n | GrowthToLowerboundCapacity(size()));
// n == 0 unconditionally rehashes as per the standard.
if (n == 0 || m > capacity_) {
resize(m);
+
+ // This is after resize, to ensure that we have completed the allocation
+ // and have potentially sampled the hashtable.
+ infoz().RecordReservation(n);
}
}
void reserve(size_t n) {
- size_t m = GrowthToLowerboundCapacity(n);
- if (m > capacity_) {
+ if (n > size() + growth_left()) {
+ size_t m = GrowthToLowerboundCapacity(n);
resize(NormalizeCapacity(m));
+
+ // This is after resize, to ensure that we have completed the allocation
+ // and have potentially sampled the hashtable.
+ infoz().RecordReservation(n);
}
}
@@ -1352,6 +1446,7 @@ class raw_hash_set {
void prefetch(const key_arg<K>& key) const {
(void)key;
#if defined(__GNUC__)
+ prefetch_heap_block();
auto seq = probe(ctrl_, hash_ref()(key), capacity_);
__builtin_prefetch(static_cast<const void*>(ctrl_ + seq.offset()));
__builtin_prefetch(static_cast<const void*>(slots_ + seq.offset()));
@@ -1378,11 +1473,12 @@ class raw_hash_set {
}
if (ABSL_PREDICT_TRUE(g.MatchEmpty())) return end();
seq.next();
- assert(seq.index() < capacity_ && "full table!");
+ assert(seq.index() <= capacity_ && "full table!");
}
}
template <class K = key_type>
iterator find(const key_arg<K>& key) {
+ prefetch_heap_block();
return find(key, hash_ref()(key));
}
@@ -1392,6 +1488,7 @@ class raw_hash_set {
}
template <class K = key_type>
const_iterator find(const key_arg<K>& key) const {
+ prefetch_heap_block();
return find(key, hash_ref()(key));
}
@@ -1526,7 +1623,8 @@ class raw_hash_set {
static_cast<size_t>(empty_after.TrailingZeros() +
empty_before.LeadingZeros()) < Group::kWidth;
- set_ctrl(index, was_never_full ? kEmpty : kDeleted);
+ SetCtrl(index, was_never_full ? ctrl_t::kEmpty : ctrl_t::kDeleted,
+ capacity_, ctrl_, slots_, sizeof(slot_type));
growth_left() += was_never_full;
infoz().RecordErase();
}
@@ -1545,15 +1643,16 @@ class raw_hash_set {
// bound more carefully.
if (std::is_same<SlotAlloc, std::allocator<slot_type>>::value &&
slots_ == nullptr) {
- infoz() = Sample();
+ infoz() = Sample(sizeof(slot_type));
}
- auto layout = MakeLayout(capacity_);
- char* mem = static_cast<char*>(
- Allocate<Layout::Alignment()>(&alloc_ref(), layout.AllocSize()));
- ctrl_ = reinterpret_cast<ctrl_t*>(layout.template Pointer<0>(mem));
- slots_ = layout.template Pointer<1>(mem);
- reset_ctrl();
+ char* mem = static_cast<char*>(Allocate<alignof(slot_type)>(
+ &alloc_ref(),
+ AllocSize(capacity_, sizeof(slot_type), alignof(slot_type))));
+ ctrl_ = reinterpret_cast<ctrl_t*>(mem);
+ slots_ = reinterpret_cast<slot_type*>(
+ mem + SlotOffset(capacity_, alignof(slot_type)));
+ ResetCtrl(capacity_, ctrl_, slots_, sizeof(slot_type));
reset_growth_left();
infoz().RecordStorageChanged(size_, capacity_);
}
@@ -1565,10 +1664,12 @@ class raw_hash_set {
PolicyTraits::destroy(&alloc_ref(), slots_ + i);
}
}
- auto layout = MakeLayout(capacity_);
+
// Unpoison before returning the memory to the allocator.
SanitizerUnpoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_);
- Deallocate<Layout::Alignment()>(&alloc_ref(), ctrl_, layout.AllocSize());
+ Deallocate<alignof(slot_type)>(
+ &alloc_ref(), ctrl_,
+ AllocSize(capacity_, sizeof(slot_type), alignof(slot_type)));
ctrl_ = EmptyGroup();
slots_ = nullptr;
size_ = 0;
@@ -1592,16 +1693,16 @@ class raw_hash_set {
auto target = find_first_non_full(ctrl_, hash, capacity_);
size_t new_i = target.offset;
total_probe_length += target.probe_length;
- set_ctrl(new_i, H2(hash));
+ SetCtrl(new_i, H2(hash), capacity_, ctrl_, slots_, sizeof(slot_type));
PolicyTraits::transfer(&alloc_ref(), slots_ + new_i, old_slots + i);
}
}
if (old_capacity) {
SanitizerUnpoisonMemoryRegion(old_slots,
sizeof(slot_type) * old_capacity);
- auto layout = MakeLayout(old_capacity);
- Deallocate<Layout::Alignment()>(&alloc_ref(), old_ctrl,
- layout.AllocSize());
+ Deallocate<alignof(slot_type)>(
+ &alloc_ref(), old_ctrl,
+ AllocSize(old_capacity, sizeof(slot_type), alignof(slot_type)));
}
infoz().RecordRehash(total_probe_length);
}
@@ -1631,35 +1732,35 @@ class raw_hash_set {
slot_type* slot = reinterpret_cast<slot_type*>(&raw);
for (size_t i = 0; i != capacity_; ++i) {
if (!IsDeleted(ctrl_[i])) continue;
- size_t hash = PolicyTraits::apply(HashElement{hash_ref()},
- PolicyTraits::element(slots_ + i));
- auto target = find_first_non_full(ctrl_, hash, capacity_);
- size_t new_i = target.offset;
+ const size_t hash = PolicyTraits::apply(
+ HashElement{hash_ref()}, PolicyTraits::element(slots_ + i));
+ const FindInfo target = find_first_non_full(ctrl_, hash, capacity_);
+ const size_t new_i = target.offset;
total_probe_length += target.probe_length;
// Verify if the old and new i fall within the same group wrt the hash.
// If they do, we don't need to move the object as it falls already in the
// best probe we can.
- const auto probe_index = [&](size_t pos) {
- return ((pos - probe(ctrl_, hash, capacity_).offset()) & capacity_) /
- Group::kWidth;
+ const size_t probe_offset = probe(ctrl_, hash, capacity_).offset();
+ const auto probe_index = [probe_offset, this](size_t pos) {
+ return ((pos - probe_offset) & capacity_) / Group::kWidth;
};
// Element doesn't move.
if (ABSL_PREDICT_TRUE(probe_index(new_i) == probe_index(i))) {
- set_ctrl(i, H2(hash));
+ SetCtrl(i, H2(hash), capacity_, ctrl_, slots_, sizeof(slot_type));
continue;
}
if (IsEmpty(ctrl_[new_i])) {
// Transfer element to the empty spot.
- // set_ctrl poisons/unpoisons the slots so we have to call it at the
+ // SetCtrl poisons/unpoisons the slots so we have to call it at the
// right time.
- set_ctrl(new_i, H2(hash));
+ SetCtrl(new_i, H2(hash), capacity_, ctrl_, slots_, sizeof(slot_type));
PolicyTraits::transfer(&alloc_ref(), slots_ + new_i, slots_ + i);
- set_ctrl(i, kEmpty);
+ SetCtrl(i, ctrl_t::kEmpty, capacity_, ctrl_, slots_, sizeof(slot_type));
} else {
assert(IsDeleted(ctrl_[new_i]));
- set_ctrl(new_i, H2(hash));
+ SetCtrl(new_i, H2(hash), capacity_, ctrl_, slots_, sizeof(slot_type));
// Until we are done rehashing, DELETED marks previously FULL slots.
// Swap i and new_i elements.
PolicyTraits::transfer(&alloc_ref(), slot, slots_ + i);
@@ -1675,8 +1776,50 @@ class raw_hash_set {
void rehash_and_grow_if_necessary() {
if (capacity_ == 0) {
resize(1);
- } else if (size() <= CapacityToGrowth(capacity()) / 2) {
+ } else if (capacity_ > Group::kWidth &&
+ // Do these calcuations in 64-bit to avoid overflow.
+ size() * uint64_t{32} <= capacity_ * uint64_t{25}) {
// Squash DELETED without growing if there is enough capacity.
+ //
+ // Rehash in place if the current size is <= 25/32 of capacity_.
+ // Rationale for such a high factor: 1) drop_deletes_without_resize() is
+ // faster than resize, and 2) it takes quite a bit of work to add
+ // tombstones. In the worst case, seems to take approximately 4
+ // insert/erase pairs to create a single tombstone and so if we are
+ // rehashing because of tombstones, we can afford to rehash-in-place as
+ // long as we are reclaiming at least 1/8 the capacity without doing more
+ // than 2X the work. (Where "work" is defined to be size() for rehashing
+ // or rehashing in place, and 1 for an insert or erase.) But rehashing in
+ // place is faster per operation than inserting or even doubling the size
+ // of the table, so we actually afford to reclaim even less space from a
+ // resize-in-place. The decision is to rehash in place if we can reclaim
+ // at about 1/8th of the usable capacity (specifically 3/28 of the
+ // capacity) which means that the total cost of rehashing will be a small
+ // fraction of the total work.
+ //
+ // Here is output of an experiment using the BM_CacheInSteadyState
+ // benchmark running the old case (where we rehash-in-place only if we can
+ // reclaim at least 7/16*capacity_) vs. this code (which rehashes in place
+ // if we can recover 3/32*capacity_).
+ //
+ // Note that although in the worst-case number of rehashes jumped up from
+ // 15 to 190, but the number of operations per second is almost the same.
+ //
+ // Abridged output of running BM_CacheInSteadyState benchmark from
+ // raw_hash_set_benchmark. N is the number of insert/erase operations.
+ //
+ // | OLD (recover >= 7/16 | NEW (recover >= 3/32)
+ // size | N/s LoadFactor NRehashes | N/s LoadFactor NRehashes
+ // 448 | 145284 0.44 18 | 140118 0.44 19
+ // 493 | 152546 0.24 11 | 151417 0.48 28
+ // 538 | 151439 0.26 11 | 151152 0.53 38
+ // 583 | 151765 0.28 11 | 150572 0.57 50
+ // 628 | 150241 0.31 11 | 150853 0.61 66
+ // 672 | 149602 0.33 12 | 150110 0.66 90
+ // 717 | 149998 0.35 12 | 149531 0.70 129
+ // 762 | 149836 0.37 13 | 148559 0.74 190
+ // 807 | 149736 0.39 14 | 151107 0.39 14
+ // 852 | 150204 0.42 15 | 151019 0.42 15
drop_deletes_without_resize();
} else {
// Otherwise grow the container.
@@ -1696,7 +1839,7 @@ class raw_hash_set {
}
if (ABSL_PREDICT_TRUE(g.MatchEmpty())) return false;
seq.next();
- assert(seq.index() < capacity_ && "full table!");
+ assert(seq.index() <= capacity_ && "full table!");
}
return false;
}
@@ -1716,6 +1859,7 @@ class raw_hash_set {
protected:
template <class K>
std::pair<size_t, bool> find_or_prepare_insert(const K& key) {
+ prefetch_heap_block();
auto hash = hash_ref()(key);
auto seq = probe(ctrl_, hash, capacity_);
while (true) {
@@ -1728,7 +1872,7 @@ class raw_hash_set {
}
if (ABSL_PREDICT_TRUE(g.MatchEmpty())) break;
seq.next();
- assert(seq.index() < capacity_ && "full table!");
+ assert(seq.index() <= capacity_ && "full table!");
}
return {prepare_insert(hash), true};
}
@@ -1742,7 +1886,8 @@ class raw_hash_set {
}
++size_;
growth_left() -= IsEmpty(ctrl_[target.offset]);
- set_ctrl(target.offset, H2(hash));
+ SetCtrl(target.offset, H2(hash), capacity_, ctrl_, slots_,
+ sizeof(slot_type));
infoz().RecordInsert(hash, target.probe_length);
return target.offset;
}
@@ -1771,35 +1916,21 @@ class raw_hash_set {
private:
friend struct RawHashSetTestOnlyAccess;
- // Reset all ctrl bytes back to kEmpty, except the sentinel.
- void reset_ctrl() {
- std::memset(ctrl_, kEmpty, capacity_ + Group::kWidth);
- ctrl_[capacity_] = kSentinel;
- SanitizerPoisonMemoryRegion(slots_, sizeof(slot_type) * capacity_);
- }
-
void reset_growth_left() {
growth_left() = CapacityToGrowth(capacity()) - size_;
}
- // Sets the control byte, and if `i < Group::kWidth`, set the cloned byte at
- // the end too.
- void set_ctrl(size_t i, ctrl_t h) {
- assert(i < capacity_);
-
- if (IsFull(h)) {
- SanitizerUnpoisonObject(slots_ + i);
- } else {
- SanitizerPoisonObject(slots_ + i);
- }
+ size_t& growth_left() { return settings_.template get<0>(); }
- ctrl_[i] = h;
- ctrl_[((i - Group::kWidth) & capacity_) + 1 +
- ((Group::kWidth - 1) & capacity_)] = h;
+ void prefetch_heap_block() const {
+ // Prefetch the heap-allocated memory region to resolve potential TLB
+ // misses. This is intended to overlap with execution of calculating the
+ // hash for a key.
+#if defined(__GNUC__)
+ __builtin_prefetch(static_cast<const void*>(ctrl_), 0, 1);
+#endif // __GNUC__
}
- size_t& growth_left() { return settings_.template get<0>(); }
-
HashtablezInfoHandle& infoz() { return settings_.template get<1>(); }
hasher& hash_ref() { return settings_.template get<2>(); }
@@ -1814,10 +1945,10 @@ class raw_hash_set {
// TODO(alkis): Investigate removing some of these fields:
// - ctrl/slots can be derived from each other
// - size can be moved into the slot array
- ctrl_t* ctrl_ = EmptyGroup(); // [(capacity + 1) * ctrl_t]
- slot_type* slots_ = nullptr; // [capacity * slot_type]
- size_t size_ = 0; // number of full slots
- size_t capacity_ = 0; // total number of slots
+ ctrl_t* ctrl_ = EmptyGroup(); // [(capacity + 1 + NumClonedBytes()) * ctrl_t]
+ slot_type* slots_ = nullptr; // [capacity * slot_type]
+ size_t size_ = 0; // number of full slots
+ size_t capacity_ = 0; // total number of slots
absl::container_internal::CompressedTuple<size_t /* growth_left */,
HashtablezInfoHandle, hasher,
key_equal, allocator_type>
@@ -1827,11 +1958,12 @@ class raw_hash_set {
// Erases all elements that satisfy the predicate `pred` from the container `c`.
template <typename P, typename H, typename E, typename A, typename Predicate>
-void EraseIf(Predicate pred, raw_hash_set<P, H, E, A>* c) {
+void EraseIf(Predicate& pred, raw_hash_set<P, H, E, A>* c) {
for (auto it = c->begin(), last = c->end(); it != last;) {
- auto copy_it = it++;
- if (pred(*copy_it)) {
- c->erase(copy_it);
+ if (pred(*it)) {
+ c->erase(it++);
+ } else {
+ ++it;
}
}
}
@@ -1866,8 +1998,7 @@ struct HashtableDebugAccess<Set, absl::void_t<typename Set::raw_hash_set>> {
static size_t AllocatedByteSize(const Set& c) {
size_t capacity = c.capacity_;
if (capacity == 0) return 0;
- auto layout = Set::MakeLayout(capacity);
- size_t m = layout.AllocSize();
+ size_t m = AllocSize(capacity, sizeof(Slot), alignof(Slot));
size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr));
if (per_slot != ~size_t{}) {
@@ -1885,8 +2016,8 @@ struct HashtableDebugAccess<Set, absl::void_t<typename Set::raw_hash_set>> {
static size_t LowerBoundAllocatedByteSize(size_t size) {
size_t capacity = GrowthToLowerboundCapacity(size);
if (capacity == 0) return 0;
- auto layout = Set::MakeLayout(NormalizeCapacity(capacity));
- size_t m = layout.AllocSize();
+ size_t m =
+ AllocSize(NormalizeCapacity(capacity), sizeof(Slot), alignof(Slot));
size_t per_slot = Traits::space_used(static_cast<const Slot*>(nullptr));
if (per_slot != ~size_t{}) {
m += per_slot * size;
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc
index f9be2c5a..c886d3ad 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc
@@ -254,6 +254,23 @@ void BM_CopyAssign(benchmark::State& state) {
}
BENCHMARK(BM_CopyAssign)->Range(128, 4096);
+void BM_RangeCtor(benchmark::State& state) {
+ std::random_device rd;
+ std::mt19937 rng(rd());
+ std::uniform_int_distribution<uint64_t> dist(0, ~uint64_t{});
+ std::vector<int> values;
+ const size_t desired_size = state.range(0);
+ while (values.size() < desired_size) {
+ values.emplace_back(dist(rng));
+ }
+
+ for (auto unused : state) {
+ IntTable t{values.begin(), values.end()};
+ benchmark::DoNotOptimize(t);
+ }
+}
+BENCHMARK(BM_RangeCtor)->Range(128, 65536);
+
void BM_NoOpReserveIntTable(benchmark::State& state) {
IntTable t;
t.reserve(100000);
@@ -298,9 +315,17 @@ void BM_ReserveStringTable(benchmark::State& state) {
}
BENCHMARK(BM_ReserveStringTable)->Range(128, 4096);
+// Like std::iota, except that ctrl_t doesn't support operator++.
+template <typename CtrlIter>
+void Iota(CtrlIter begin, CtrlIter end, int value) {
+ for (; begin != end; ++begin, ++value) {
+ *begin = static_cast<ctrl_t>(value);
+ }
+}
+
void BM_Group_Match(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
- std::iota(group.begin(), group.end(), -4);
+ Iota(group.begin(), group.end(), -4);
Group g{group.data()};
h2_t h = 1;
for (auto _ : state) {
@@ -312,7 +337,7 @@ BENCHMARK(BM_Group_Match);
void BM_Group_MatchEmpty(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
- std::iota(group.begin(), group.end(), -4);
+ Iota(group.begin(), group.end(), -4);
Group g{group.data()};
for (auto _ : state) ::benchmark::DoNotOptimize(g.MatchEmpty());
}
@@ -320,7 +345,7 @@ BENCHMARK(BM_Group_MatchEmpty);
void BM_Group_MatchEmptyOrDeleted(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
- std::iota(group.begin(), group.end(), -4);
+ Iota(group.begin(), group.end(), -4);
Group g{group.data()};
for (auto _ : state) ::benchmark::DoNotOptimize(g.MatchEmptyOrDeleted());
}
@@ -328,7 +353,7 @@ BENCHMARK(BM_Group_MatchEmptyOrDeleted);
void BM_Group_CountLeadingEmptyOrDeleted(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
- std::iota(group.begin(), group.end(), -2);
+ Iota(group.begin(), group.end(), -2);
Group g{group.data()};
for (auto _ : state)
::benchmark::DoNotOptimize(g.CountLeadingEmptyOrDeleted());
@@ -337,7 +362,7 @@ BENCHMARK(BM_Group_CountLeadingEmptyOrDeleted);
void BM_Group_MatchFirstEmptyOrDeleted(benchmark::State& state) {
std::array<ctrl_t, Group::kWidth> group;
- std::iota(group.begin(), group.end(), -2);
+ Iota(group.begin(), group.end(), -2);
Group g{group.data()};
for (auto _ : state) ::benchmark::DoNotOptimize(*g.MatchEmptyOrDeleted());
}
@@ -346,8 +371,11 @@ BENCHMARK(BM_Group_MatchFirstEmptyOrDeleted);
void BM_DropDeletes(benchmark::State& state) {
constexpr size_t capacity = (1 << 20) - 1;
std::vector<ctrl_t> ctrl(capacity + 1 + Group::kWidth);
- ctrl[capacity] = kSentinel;
- std::vector<ctrl_t> pattern = {kEmpty, 2, kDeleted, 2, kEmpty, 1, kDeleted};
+ ctrl[capacity] = ctrl_t::kSentinel;
+ std::vector<ctrl_t> pattern = {ctrl_t::kEmpty, static_cast<ctrl_t>(2),
+ ctrl_t::kDeleted, static_cast<ctrl_t>(2),
+ ctrl_t::kEmpty, static_cast<ctrl_t>(1),
+ ctrl_t::kDeleted};
for (size_t i = 0; i != capacity; ++i) {
ctrl[i] = pattern[i % pattern.size()];
}
@@ -378,6 +406,12 @@ bool CodegenAbslRawHashSetInt64FindNeEnd(
return table->find(key) != table->end();
}
+auto CodegenAbslRawHashSetInt64Insert(absl::container_internal::IntTable* table,
+ int64_t key)
+ -> decltype(table->insert(key)) {
+ return table->insert(key);
+}
+
bool CodegenAbslRawHashSetInt64Contains(
absl::container_internal::IntTable* table, int64_t key) {
return table->contains(key);
@@ -391,6 +425,7 @@ void CodegenAbslRawHashSetInt64Iterate(
int odr =
(::benchmark::DoNotOptimize(std::make_tuple(
&CodegenAbslRawHashSetInt64Find, &CodegenAbslRawHashSetInt64FindNeEnd,
+ &CodegenAbslRawHashSetInt64Insert,
&CodegenAbslRawHashSetInt64Contains,
&CodegenAbslRawHashSetInt64Iterate)),
1);
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc
index 7dac65a0..362b3cae 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/raw_hash_set_test.cc
@@ -58,6 +58,9 @@ using ::testing::Lt;
using ::testing::Pair;
using ::testing::UnorderedElementsAre;
+// Convenience function to static cast to ctrl_t.
+ctrl_t CtrlT(int i) { return static_cast<ctrl_t>(i); }
+
TEST(Util, NormalizeCapacity) {
EXPECT_EQ(1, NormalizeCapacity(0));
EXPECT_EQ(1, NormalizeCapacity(1));
@@ -170,15 +173,19 @@ TEST(Group, EmptyGroup) {
TEST(Group, Match) {
if (Group::kWidth == 16) {
- ctrl_t group[] = {kEmpty, 1, kDeleted, 3, kEmpty, 5, kSentinel, 7,
- 7, 5, 3, 1, 1, 1, 1, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), ctrl_t::kDeleted, CtrlT(3),
+ ctrl_t::kEmpty, CtrlT(5), ctrl_t::kSentinel, CtrlT(7),
+ CtrlT(7), CtrlT(5), CtrlT(3), CtrlT(1),
+ CtrlT(1), CtrlT(1), CtrlT(1), CtrlT(1)};
EXPECT_THAT(Group{group}.Match(0), ElementsAre());
EXPECT_THAT(Group{group}.Match(1), ElementsAre(1, 11, 12, 13, 14, 15));
EXPECT_THAT(Group{group}.Match(3), ElementsAre(3, 10));
EXPECT_THAT(Group{group}.Match(5), ElementsAre(5, 9));
EXPECT_THAT(Group{group}.Match(7), ElementsAre(7, 8));
} else if (Group::kWidth == 8) {
- ctrl_t group[] = {kEmpty, 1, 2, kDeleted, 2, 1, kSentinel, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), CtrlT(2),
+ ctrl_t::kDeleted, CtrlT(2), CtrlT(1),
+ ctrl_t::kSentinel, CtrlT(1)};
EXPECT_THAT(Group{group}.Match(0), ElementsAre());
EXPECT_THAT(Group{group}.Match(1), ElementsAre(1, 5, 7));
EXPECT_THAT(Group{group}.Match(2), ElementsAre(2, 4));
@@ -189,11 +196,15 @@ TEST(Group, Match) {
TEST(Group, MatchEmpty) {
if (Group::kWidth == 16) {
- ctrl_t group[] = {kEmpty, 1, kDeleted, 3, kEmpty, 5, kSentinel, 7,
- 7, 5, 3, 1, 1, 1, 1, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), ctrl_t::kDeleted, CtrlT(3),
+ ctrl_t::kEmpty, CtrlT(5), ctrl_t::kSentinel, CtrlT(7),
+ CtrlT(7), CtrlT(5), CtrlT(3), CtrlT(1),
+ CtrlT(1), CtrlT(1), CtrlT(1), CtrlT(1)};
EXPECT_THAT(Group{group}.MatchEmpty(), ElementsAre(0, 4));
} else if (Group::kWidth == 8) {
- ctrl_t group[] = {kEmpty, 1, 2, kDeleted, 2, 1, kSentinel, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), CtrlT(2),
+ ctrl_t::kDeleted, CtrlT(2), CtrlT(1),
+ ctrl_t::kSentinel, CtrlT(1)};
EXPECT_THAT(Group{group}.MatchEmpty(), ElementsAre(0));
} else {
FAIL() << "No test coverage for Group::kWidth==" << Group::kWidth;
@@ -202,11 +213,15 @@ TEST(Group, MatchEmpty) {
TEST(Group, MatchEmptyOrDeleted) {
if (Group::kWidth == 16) {
- ctrl_t group[] = {kEmpty, 1, kDeleted, 3, kEmpty, 5, kSentinel, 7,
- 7, 5, 3, 1, 1, 1, 1, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), ctrl_t::kDeleted, CtrlT(3),
+ ctrl_t::kEmpty, CtrlT(5), ctrl_t::kSentinel, CtrlT(7),
+ CtrlT(7), CtrlT(5), CtrlT(3), CtrlT(1),
+ CtrlT(1), CtrlT(1), CtrlT(1), CtrlT(1)};
EXPECT_THAT(Group{group}.MatchEmptyOrDeleted(), ElementsAre(0, 2, 4));
} else if (Group::kWidth == 8) {
- ctrl_t group[] = {kEmpty, 1, 2, kDeleted, 2, 1, kSentinel, 1};
+ ctrl_t group[] = {ctrl_t::kEmpty, CtrlT(1), CtrlT(2),
+ ctrl_t::kDeleted, CtrlT(2), CtrlT(1),
+ ctrl_t::kSentinel, CtrlT(1)};
EXPECT_THAT(Group{group}.MatchEmptyOrDeleted(), ElementsAre(0, 3));
} else {
FAIL() << "No test coverage for Group::kWidth==" << Group::kWidth;
@@ -217,28 +232,32 @@ TEST(Batch, DropDeletes) {
constexpr size_t kCapacity = 63;
constexpr size_t kGroupWidth = container_internal::Group::kWidth;
std::vector<ctrl_t> ctrl(kCapacity + 1 + kGroupWidth);
- ctrl[kCapacity] = kSentinel;
- std::vector<ctrl_t> pattern = {kEmpty, 2, kDeleted, 2, kEmpty, 1, kDeleted};
+ ctrl[kCapacity] = ctrl_t::kSentinel;
+ std::vector<ctrl_t> pattern = {
+ ctrl_t::kEmpty, CtrlT(2), ctrl_t::kDeleted, CtrlT(2),
+ ctrl_t::kEmpty, CtrlT(1), ctrl_t::kDeleted};
for (size_t i = 0; i != kCapacity; ++i) {
ctrl[i] = pattern[i % pattern.size()];
if (i < kGroupWidth - 1)
ctrl[i + kCapacity + 1] = pattern[i % pattern.size()];
}
ConvertDeletedToEmptyAndFullToDeleted(ctrl.data(), kCapacity);
- ASSERT_EQ(ctrl[kCapacity], kSentinel);
- for (size_t i = 0; i < kCapacity + 1 + kGroupWidth; ++i) {
+ ASSERT_EQ(ctrl[kCapacity], ctrl_t::kSentinel);
+ for (size_t i = 0; i < kCapacity + kGroupWidth; ++i) {
ctrl_t expected = pattern[i % (kCapacity + 1) % pattern.size()];
- if (i == kCapacity) expected = kSentinel;
- if (expected == kDeleted) expected = kEmpty;
- if (IsFull(expected)) expected = kDeleted;
+ if (i == kCapacity) expected = ctrl_t::kSentinel;
+ if (expected == ctrl_t::kDeleted) expected = ctrl_t::kEmpty;
+ if (IsFull(expected)) expected = ctrl_t::kDeleted;
EXPECT_EQ(ctrl[i], expected)
- << i << " " << int{pattern[i % pattern.size()]};
+ << i << " " << static_cast<int>(pattern[i % pattern.size()]);
}
}
TEST(Group, CountLeadingEmptyOrDeleted) {
- const std::vector<ctrl_t> empty_examples = {kEmpty, kDeleted};
- const std::vector<ctrl_t> full_examples = {0, 1, 2, 3, 5, 9, 127, kSentinel};
+ const std::vector<ctrl_t> empty_examples = {ctrl_t::kEmpty, ctrl_t::kDeleted};
+ const std::vector<ctrl_t> full_examples = {
+ CtrlT(0), CtrlT(1), CtrlT(2), CtrlT(3),
+ CtrlT(5), CtrlT(9), CtrlT(127), ctrl_t::kSentinel};
for (ctrl_t empty : empty_examples) {
std::vector<ctrl_t> e(Group::kWidth, empty);
@@ -294,6 +313,7 @@ struct ValuePolicy {
};
using IntPolicy = ValuePolicy<int64_t>;
+using Uint8Policy = ValuePolicy<uint8_t>;
class StringPolicy {
template <class F, class K, class V,
@@ -374,6 +394,13 @@ struct IntTable
using Base::Base;
};
+struct Uint8Table
+ : raw_hash_set<Uint8Policy, container_internal::hash_default_hash<uint8_t>,
+ std::equal_to<uint8_t>, std::allocator<uint8_t>> {
+ using Base = typename Uint8Table::raw_hash_set;
+ using Base::Base;
+};
+
template <typename T>
struct CustomAlloc : std::allocator<T> {
CustomAlloc() {}
@@ -541,6 +568,37 @@ TEST(Table, InsertCollisionAndFindAfterDelete) {
EXPECT_TRUE(t.empty());
}
+TEST(Table, InsertWithinCapacity) {
+ IntTable t;
+ t.reserve(10);
+ const size_t original_capacity = t.capacity();
+ const auto addr = [&](int i) {
+ return reinterpret_cast<uintptr_t>(&*t.find(i));
+ };
+ // Inserting an element does not change capacity.
+ t.insert(0);
+ EXPECT_THAT(t.capacity(), original_capacity);
+ const uintptr_t original_addr_0 = addr(0);
+ // Inserting another element does not rehash.
+ t.insert(1);
+ EXPECT_THAT(t.capacity(), original_capacity);
+ EXPECT_THAT(addr(0), original_addr_0);
+ // Inserting lots of duplicate elements does not rehash.
+ for (int i = 0; i < 100; ++i) {
+ t.insert(i % 10);
+ }
+ EXPECT_THAT(t.capacity(), original_capacity);
+ EXPECT_THAT(addr(0), original_addr_0);
+ // Inserting a range of duplicate elements does not rehash.
+ std::vector<int> dup_range;
+ for (int i = 0; i < 100; ++i) {
+ dup_range.push_back(i % 10);
+ }
+ t.insert(dup_range.begin(), dup_range.end());
+ EXPECT_THAT(t.capacity(), original_capacity);
+ EXPECT_THAT(addr(0), original_addr_0);
+}
+
TEST(Table, LazyEmplace) {
StringTable t;
bool called = false;
@@ -588,28 +646,53 @@ TEST(Table, Contains2) {
}
int decompose_constructed;
+int decompose_copy_constructed;
+int decompose_copy_assigned;
+int decompose_move_constructed;
+int decompose_move_assigned;
struct DecomposeType {
- DecomposeType(int i) : i(i) { // NOLINT
+ DecomposeType(int i = 0) : i(i) { // NOLINT
++decompose_constructed;
}
explicit DecomposeType(const char* d) : DecomposeType(*d) {}
+ DecomposeType(const DecomposeType& other) : i(other.i) {
+ ++decompose_copy_constructed;
+ }
+ DecomposeType& operator=(const DecomposeType& other) {
+ ++decompose_copy_assigned;
+ i = other.i;
+ return *this;
+ }
+ DecomposeType(DecomposeType&& other) : i(other.i) {
+ ++decompose_move_constructed;
+ }
+ DecomposeType& operator=(DecomposeType&& other) {
+ ++decompose_move_assigned;
+ i = other.i;
+ return *this;
+ }
+
int i;
};
struct DecomposeHash {
using is_transparent = void;
- size_t operator()(DecomposeType a) const { return a.i; }
+ size_t operator()(const DecomposeType& a) const { return a.i; }
size_t operator()(int a) const { return a; }
size_t operator()(const char* a) const { return *a; }
};
struct DecomposeEq {
using is_transparent = void;
- bool operator()(DecomposeType a, DecomposeType b) const { return a.i == b.i; }
- bool operator()(DecomposeType a, int b) const { return a.i == b; }
- bool operator()(DecomposeType a, const char* b) const { return a.i == *b; }
+ bool operator()(const DecomposeType& a, const DecomposeType& b) const {
+ return a.i == b.i;
+ }
+ bool operator()(const DecomposeType& a, int b) const { return a.i == b; }
+ bool operator()(const DecomposeType& a, const char* b) const {
+ return a.i == *b;
+ }
};
struct DecomposePolicy {
@@ -619,9 +702,9 @@ struct DecomposePolicy {
template <typename T>
static void construct(void*, DecomposeType* slot, T&& v) {
- *slot = DecomposeType(std::forward<T>(v));
+ ::new (slot) DecomposeType(std::forward<T>(v));
}
- static void destroy(void*, DecomposeType*) {}
+ static void destroy(void*, DecomposeType* slot) { slot->~DecomposeType(); }
static DecomposeType& element(slot_type* slot) { return *slot; }
template <class F, class T>
@@ -636,8 +719,13 @@ void TestDecompose(bool construct_three) {
const int one = 1;
const char* three_p = "3";
const auto& three = three_p;
+ const int elem_vector_count = 256;
+ std::vector<DecomposeType> elem_vector(elem_vector_count, DecomposeType{0});
+ std::iota(elem_vector.begin(), elem_vector.end(), 0);
- raw_hash_set<DecomposePolicy, Hash, Eq, std::allocator<int>> set1;
+ using DecomposeSet =
+ raw_hash_set<DecomposePolicy, Hash, Eq, std::allocator<int>>;
+ DecomposeSet set1;
decompose_constructed = 0;
int expected_constructed = 0;
@@ -695,20 +783,72 @@ void TestDecompose(bool construct_three) {
expected_constructed += construct_three;
EXPECT_EQ(expected_constructed, decompose_constructed);
}
+
+ decompose_copy_constructed = 0;
+ decompose_copy_assigned = 0;
+ decompose_move_constructed = 0;
+ decompose_move_assigned = 0;
+ int expected_copy_constructed = 0;
+ int expected_move_constructed = 0;
+ { // raw_hash_set(first, last) with random-access iterators
+ DecomposeSet set2(elem_vector.begin(), elem_vector.end());
+ // Expect exactly one copy-constructor call for each element if no
+ // rehashing is done.
+ expected_copy_constructed += elem_vector_count;
+ EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
+ EXPECT_EQ(expected_move_constructed, decompose_move_constructed);
+ EXPECT_EQ(0, decompose_move_assigned);
+ EXPECT_EQ(0, decompose_copy_assigned);
+ }
+
+ { // raw_hash_set(first, last) with forward iterators
+ std::list<DecomposeType> elem_list(elem_vector.begin(), elem_vector.end());
+ expected_copy_constructed = decompose_copy_constructed;
+ DecomposeSet set2(elem_list.begin(), elem_list.end());
+ // Expect exactly N elements copied into set, expect at most 2*N elements
+ // moving internally for all resizing needed (for a growth factor of 2).
+ expected_copy_constructed += elem_vector_count;
+ EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
+ expected_move_constructed += elem_vector_count;
+ EXPECT_LT(expected_move_constructed, decompose_move_constructed);
+ expected_move_constructed += elem_vector_count;
+ EXPECT_GE(expected_move_constructed, decompose_move_constructed);
+ EXPECT_EQ(0, decompose_move_assigned);
+ EXPECT_EQ(0, decompose_copy_assigned);
+ expected_copy_constructed = decompose_copy_constructed;
+ expected_move_constructed = decompose_move_constructed;
+ }
+
+ { // insert(first, last)
+ DecomposeSet set2;
+ set2.insert(elem_vector.begin(), elem_vector.end());
+ // Expect exactly N elements copied into set, expect at most 2*N elements
+ // moving internally for all resizing needed (for a growth factor of 2).
+ const int expected_new_elements = elem_vector_count;
+ const int expected_max_element_moves = 2 * elem_vector_count;
+ expected_copy_constructed += expected_new_elements;
+ EXPECT_EQ(expected_copy_constructed, decompose_copy_constructed);
+ expected_move_constructed += expected_max_element_moves;
+ EXPECT_GE(expected_move_constructed, decompose_move_constructed);
+ EXPECT_EQ(0, decompose_move_assigned);
+ EXPECT_EQ(0, decompose_copy_assigned);
+ expected_copy_constructed = decompose_copy_constructed;
+ expected_move_constructed = decompose_move_constructed;
+ }
}
TEST(Table, Decompose) {
TestDecompose<DecomposeHash, DecomposeEq>(false);
struct TransparentHashIntOverload {
- size_t operator()(DecomposeType a) const { return a.i; }
+ size_t operator()(const DecomposeType& a) const { return a.i; }
size_t operator()(int a) const { return a; }
};
struct TransparentEqIntOverload {
- bool operator()(DecomposeType a, DecomposeType b) const {
+ bool operator()(const DecomposeType& a, const DecomposeType& b) const {
return a.i == b.i;
}
- bool operator()(DecomposeType a, int b) const { return a.i == b; }
+ bool operator()(const DecomposeType& a, int b) const { return a.i == b; }
};
TestDecompose<TransparentHashIntOverload, DecomposeEq>(true);
TestDecompose<TransparentHashIntOverload, TransparentEqIntOverload>(true);
@@ -750,7 +890,7 @@ TEST(Table, RehashWithNoResize) {
const size_t capacity = t.capacity();
// Remove elements from all groups except the first and the last one.
- // All elements removed from full groups will be marked as kDeleted.
+ // All elements removed from full groups will be marked as ctrl_t::kDeleted.
const size_t erase_begin = Group::kWidth / 2;
const size_t erase_end = (t.size() / Group::kWidth - 1) * Group::kWidth;
for (size_t i = erase_begin; i < erase_end; ++i) {
@@ -1898,7 +2038,7 @@ TEST(RawHashSamplerTest, Sample) {
SetHashtablezEnabled(true);
SetHashtablezSampleParameter(100);
- auto& sampler = HashtablezSampler::Global();
+ auto& sampler = GlobalHashtablezSampler();
size_t start_size = 0;
std::unordered_set<const HashtablezInfo*> preexisting_info;
start_size += sampler.Iterate([&](const HashtablezInfo& info) {
@@ -1909,16 +2049,33 @@ TEST(RawHashSamplerTest, Sample) {
std::vector<IntTable> tables;
for (int i = 0; i < 1000000; ++i) {
tables.emplace_back();
+
+ const bool do_reserve = (i % 10 > 5);
+ const bool do_rehash = !do_reserve && (i % 10 > 0);
+
+ if (do_reserve) {
+ // Don't reserve on all tables.
+ tables.back().reserve(10 * (i % 10));
+ }
+
tables.back().insert(1);
tables.back().insert(i % 5);
+
+ if (do_rehash) {
+ // Rehash some other tables.
+ tables.back().rehash(10 * (i % 10));
+ }
}
size_t end_size = 0;
std::unordered_map<size_t, int> observed_checksums;
+ std::unordered_map<ssize_t, int> reservations;
end_size += sampler.Iterate([&](const HashtablezInfo& info) {
if (preexisting_info.count(&info) == 0) {
observed_checksums[info.hashes_bitwise_xor.load(
std::memory_order_relaxed)]++;
+ reservations[info.max_reserve.load(std::memory_order_relaxed)]++;
}
+ EXPECT_EQ(info.inline_element_size, sizeof(int64_t));
++end_size;
});
@@ -1928,6 +2085,15 @@ TEST(RawHashSamplerTest, Sample) {
for (const auto& [_, count] : observed_checksums) {
EXPECT_NEAR((100 * count) / static_cast<double>(tables.size()), 0.2, 0.05);
}
+
+ EXPECT_EQ(reservations.size(), 10);
+ for (const auto& [reservation, count] : reservations) {
+ EXPECT_GE(reservation, 0);
+ EXPECT_LT(reservation, 100);
+
+ EXPECT_NEAR((100 * count) / static_cast<double>(tables.size()), 0.1, 0.05)
+ << reservation;
+ }
}
#endif // ABSL_INTERNAL_HASHTABLEZ_SAMPLE
@@ -1936,7 +2102,7 @@ TEST(RawHashSamplerTest, DoNotSampleCustomAllocators) {
SetHashtablezEnabled(true);
SetHashtablezSampleParameter(100);
- auto& sampler = HashtablezSampler::Global();
+ auto& sampler = GlobalHashtablezSampler();
size_t start_size = 0;
start_size += sampler.Iterate([&](const HashtablezInfo&) { ++start_size; });
@@ -1978,6 +2144,36 @@ TEST(Sanitizer, PoisoningOnErase) {
}
#endif // ABSL_HAVE_ADDRESS_SANITIZER
+TEST(Table, AlignOne) {
+ // We previously had a bug in which we were copying a control byte over the
+ // first slot when alignof(value_type) is 1. We test repeated
+ // insertions/erases and verify that the behavior is correct.
+ Uint8Table t;
+ std::unordered_set<uint8_t> verifier; // NOLINT
+
+ // Do repeated insertions/erases from the table.
+ for (int64_t i = 0; i < 100000; ++i) {
+ SCOPED_TRACE(i);
+ const uint8_t u = (i * -i) & 0xFF;
+ auto it = t.find(u);
+ auto verifier_it = verifier.find(u);
+ if (it == t.end()) {
+ ASSERT_EQ(verifier_it, verifier.end());
+ t.insert(u);
+ verifier.insert(u);
+ } else {
+ ASSERT_NE(verifier_it, verifier.end());
+ t.erase(it);
+ verifier.erase(verifier_it);
+ }
+ }
+
+ EXPECT_EQ(t.size(), verifier.size());
+ for (uint8_t u : t) {
+ EXPECT_EQ(verifier.count(u), 1);
+ }
+}
+
} // namespace
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h
index 3f90ad7c..c1d20f3c 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_constructor_test.h
@@ -179,7 +179,7 @@ TYPED_TEST_P(ConstructorTest, InputIteratorBucketHashEqualAlloc) {
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
- hash_internal::Generator<T>());
+ hash_internal::UniqueGenerator<T>());
TypeParam m(values.begin(), values.end(), 123, hasher, equal, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.key_eq(), equal);
@@ -198,7 +198,7 @@ void InputIteratorBucketAllocTest(std::true_type) {
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
- hash_internal::Generator<T>());
+ hash_internal::UniqueGenerator<T>());
TypeParam m(values.begin(), values.end(), 123, alloc);
EXPECT_EQ(m.get_allocator(), alloc);
EXPECT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
@@ -221,7 +221,7 @@ void InputIteratorBucketHashAllocTest(std::true_type) {
A alloc(0);
std::vector<T> values;
std::generate_n(std::back_inserter(values), 10,
- hash_internal::Generator<T>());
+ hash_internal::UniqueGenerator<T>());
TypeParam m(values.begin(), values.end(), 123, hasher, alloc);
EXPECT_EQ(m.hash_function(), hasher);
EXPECT_EQ(m.get_allocator(), alloc);
@@ -241,8 +241,9 @@ TYPED_TEST_P(ConstructorTest, CopyConstructor) {
H hasher;
E equal;
A alloc(0);
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m(123, hasher, equal, alloc);
- for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
+ for (size_t i = 0; i != 10; ++i) m.insert(gen());
TypeParam n(m);
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
@@ -262,8 +263,9 @@ void CopyConstructorAllocTest(std::true_type) {
H hasher;
E equal;
A alloc(0);
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m(123, hasher, equal, alloc);
- for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
+ for (size_t i = 0; i != 10; ++i) m.insert(gen());
TypeParam n(m, A(11));
EXPECT_EQ(m.hash_function(), n.hash_function());
EXPECT_EQ(m.key_eq(), n.key_eq());
@@ -285,8 +287,9 @@ TYPED_TEST_P(ConstructorTest, MoveConstructor) {
H hasher;
E equal;
A alloc(0);
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m(123, hasher, equal, alloc);
- for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
+ for (size_t i = 0; i != 10; ++i) m.insert(gen());
TypeParam t(m);
TypeParam n(std::move(t));
EXPECT_EQ(m.hash_function(), n.hash_function());
@@ -307,8 +310,9 @@ void MoveConstructorAllocTest(std::true_type) {
H hasher;
E equal;
A alloc(0);
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m(123, hasher, equal, alloc);
- for (size_t i = 0; i != 10; ++i) m.insert(hash_internal::Generator<T>()());
+ for (size_t i = 0; i != 10; ++i) m.insert(gen());
TypeParam t(m);
TypeParam n(std::move(t), A(1));
EXPECT_EQ(m.hash_function(), n.hash_function());
@@ -325,7 +329,7 @@ TYPED_TEST_P(ConstructorTest, MoveConstructorAlloc) {
TYPED_TEST_P(ConstructorTest, InitializerListBucketHashEqualAlloc) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
using H = typename TypeParam::hasher;
using E = typename TypeParam::key_equal;
@@ -348,7 +352,7 @@ template <typename TypeParam>
void InitializerListBucketAllocTest(std::true_type) {
using T = hash_internal::GeneratedType<TypeParam>;
using A = typename TypeParam::allocator_type;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
A alloc(0);
TypeParam m(values, 123, alloc);
@@ -371,7 +375,7 @@ void InitializerListBucketHashAllocTest(std::true_type) {
using A = typename TypeParam::allocator_type;
H hasher;
A alloc(0);
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m(values, 123, hasher, alloc);
EXPECT_EQ(m.hash_function(), hasher);
@@ -392,7 +396,7 @@ TYPED_TEST_P(ConstructorTest, Assignment) {
H hasher;
E equal;
A alloc(0);
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m({gen(), gen(), gen()}, 123, hasher, equal, alloc);
TypeParam n;
n = m;
@@ -412,7 +416,7 @@ TYPED_TEST_P(ConstructorTest, MoveAssignment) {
H hasher;
E equal;
A alloc(0);
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m({gen(), gen(), gen()}, 123, hasher, equal, alloc);
TypeParam t(m);
TypeParam n;
@@ -424,7 +428,7 @@ TYPED_TEST_P(ConstructorTest, MoveAssignment) {
TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerList) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m;
m = values;
@@ -433,7 +437,7 @@ TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerList) {
TYPED_TEST_P(ConstructorTest, AssignmentOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m({gen(), gen(), gen()});
TypeParam n({gen()});
n = m;
@@ -442,7 +446,7 @@ TYPED_TEST_P(ConstructorTest, AssignmentOverwritesExisting) {
TYPED_TEST_P(ConstructorTest, MoveAssignmentOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
TypeParam m({gen(), gen(), gen()});
TypeParam t(m);
TypeParam n({gen()});
@@ -452,7 +456,7 @@ TYPED_TEST_P(ConstructorTest, MoveAssignmentOverwritesExisting) {
TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerListOverwritesExisting) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m;
m = values;
@@ -461,7 +465,7 @@ TYPED_TEST_P(ConstructorTest, AssignmentFromInitializerListOverwritesExisting) {
TYPED_TEST_P(ConstructorTest, AssignmentOnSelf) {
using T = hash_internal::GeneratedType<TypeParam>;
- hash_internal::Generator<T> gen;
+ hash_internal::UniqueGenerator<T> gen;
std::initializer_list<T> values = {gen(), gen(), gen(), gen(), gen()};
TypeParam m(values);
m = *&m; // Avoid -Wself-assign
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h
index 8c9ca779..d3543936 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_map_modifiers_test.h
@@ -81,6 +81,38 @@ TYPED_TEST_P(ModifiersTest, InsertRange) {
ASSERT_THAT(items(m), ::testing::UnorderedElementsAreArray(values));
}
+TYPED_TEST_P(ModifiersTest, InsertWithinCapacity) {
+ using T = hash_internal::GeneratedType<TypeParam>;
+ using V = typename TypeParam::mapped_type;
+ T val = hash_internal::Generator<T>()();
+ TypeParam m;
+ m.reserve(10);
+ const size_t original_capacity = m.bucket_count();
+ m.insert(val);
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+ T val2 = {val.first, hash_internal::Generator<V>()()};
+ m.insert(val2);
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+}
+
+TYPED_TEST_P(ModifiersTest, InsertRangeWithinCapacity) {
+#if !defined(__GLIBCXX__)
+ using T = hash_internal::GeneratedType<TypeParam>;
+ std::vector<T> base_values;
+ std::generate_n(std::back_inserter(base_values), 10,
+ hash_internal::Generator<T>());
+ std::vector<T> values;
+ while (values.size() != 100) {
+ std::copy_n(base_values.begin(), 10, std::back_inserter(values));
+ }
+ TypeParam m;
+ m.reserve(10);
+ const size_t original_capacity = m.bucket_count();
+ m.insert(values.begin(), values.end());
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+#endif
+}
+
TYPED_TEST_P(ModifiersTest, InsertOrAssign) {
#ifdef UNORDERED_MAP_CXX17
using std::get;
@@ -266,9 +298,10 @@ TYPED_TEST_P(ModifiersTest, Swap) {
// TODO(alkis): Write tests for merge.
REGISTER_TYPED_TEST_CASE_P(ModifiersTest, Clear, Insert, InsertHint,
- InsertRange, InsertOrAssign, InsertOrAssignHint,
- Emplace, EmplaceHint, TryEmplace, TryEmplaceHint,
- Erase, EraseRange, EraseKey, Swap);
+ InsertRange, InsertWithinCapacity,
+ InsertRangeWithinCapacity, InsertOrAssign,
+ InsertOrAssignHint, Emplace, EmplaceHint, TryEmplace,
+ TryEmplaceHint, Erase, EraseRange, EraseKey, Swap);
template <typename Type>
struct is_unique_ptr : std::false_type {};
diff --git a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h
index 26be58d9..6e473e45 100644
--- a/grpc/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h
+++ b/grpc/third_party/abseil-cpp/absl/container/internal/unordered_set_modifiers_test.h
@@ -74,6 +74,36 @@ TYPED_TEST_P(ModifiersTest, InsertRange) {
ASSERT_THAT(keys(m), ::testing::UnorderedElementsAreArray(values));
}
+TYPED_TEST_P(ModifiersTest, InsertWithinCapacity) {
+ using T = hash_internal::GeneratedType<TypeParam>;
+ T val = hash_internal::Generator<T>()();
+ TypeParam m;
+ m.reserve(10);
+ const size_t original_capacity = m.bucket_count();
+ m.insert(val);
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+ m.insert(val);
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+}
+
+TYPED_TEST_P(ModifiersTest, InsertRangeWithinCapacity) {
+#if !defined(__GLIBCXX__)
+ using T = hash_internal::GeneratedType<TypeParam>;
+ std::vector<T> base_values;
+ std::generate_n(std::back_inserter(base_values), 10,
+ hash_internal::Generator<T>());
+ std::vector<T> values;
+ while (values.size() != 100) {
+ values.insert(values.end(), base_values.begin(), base_values.end());
+ }
+ TypeParam m;
+ m.reserve(10);
+ const size_t original_capacity = m.bucket_count();
+ m.insert(values.begin(), values.end());
+ EXPECT_EQ(m.bucket_count(), original_capacity);
+#endif
+}
+
TYPED_TEST_P(ModifiersTest, Emplace) {
using T = hash_internal::GeneratedType<TypeParam>;
T val = hash_internal::Generator<T>()();
@@ -180,8 +210,9 @@ TYPED_TEST_P(ModifiersTest, Swap) {
// TODO(alkis): Write tests for merge.
REGISTER_TYPED_TEST_CASE_P(ModifiersTest, Clear, Insert, InsertHint,
- InsertRange, Emplace, EmplaceHint, Erase, EraseRange,
- EraseKey, Swap);
+ InsertRange, InsertWithinCapacity,
+ InsertRangeWithinCapacity, Emplace, EmplaceHint,
+ Erase, EraseRange, EraseKey, Swap);
} // namespace container_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/container/sample_element_size_test.cc b/grpc/third_party/abseil-cpp/absl/container/sample_element_size_test.cc
new file mode 100644
index 00000000..b23626b4
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/container/sample_element_size_test.cc
@@ -0,0 +1,114 @@
+// Copyright 2018 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/container/flat_hash_map.h"
+#include "absl/container/flat_hash_set.h"
+#include "absl/container/node_hash_map.h"
+#include "absl/container/node_hash_set.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace container_internal {
+namespace {
+
+#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
+// Create some tables of type `Table`, then look at all the new
+// `HashtablezInfo`s to make sure that the `inline_element_size ==
+// expected_element_size`. The `inline_element_size` is the amount of memory
+// allocated for each slot of a hash table, that is `sizeof(slot_type)`. Add
+// the new `HashtablezInfo`s to `preexisting_info`. Store all the new tables
+// into `tables`.
+template <class Table>
+void TestInlineElementSize(
+ HashtablezSampler& sampler,
+ // clang-tidy gives a false positive on this declaration. This unordered
+ // set cannot be flat_hash_set, however, since that would introduce a mutex
+ // deadlock.
+ std::unordered_set<const HashtablezInfo*>& preexisting_info, // NOLINT
+ std::vector<Table>& tables, const typename Table::value_type& elt,
+ size_t expected_element_size) {
+ for (int i = 0; i < 10; ++i) {
+ // We create a new table and must store it somewhere so that when we store
+ // a pointer to the resulting `HashtablezInfo` into `preexisting_info`
+ // that we aren't storing a dangling pointer.
+ tables.emplace_back();
+ // We must insert an element to get a hashtablez to instantiate.
+ tables.back().insert(elt);
+ }
+ size_t new_count = 0;
+ sampler.Iterate([&](const HashtablezInfo& info) {
+ if (preexisting_info.insert(&info).second) {
+ EXPECT_EQ(info.inline_element_size, expected_element_size);
+ ++new_count;
+ }
+ });
+ // Make sure we actually did get a new hashtablez.
+ EXPECT_GT(new_count, 0);
+}
+
+struct bigstruct {
+ char a[1000];
+ friend bool operator==(const bigstruct& x, const bigstruct& y) {
+ return memcmp(x.a, y.a, sizeof(x.a)) == 0;
+ }
+ template <typename H>
+ friend H AbslHashValue(H h, const bigstruct& c) {
+ return H::combine_contiguous(std::move(h), c.a, sizeof(c.a));
+ }
+};
+#endif
+
+TEST(FlatHashMap, SampleElementSize) {
+#if defined(ABSL_INTERNAL_HASHTABLEZ_SAMPLE)
+ // Enable sampling even if the prod default is off.
+ SetHashtablezEnabled(true);
+ SetHashtablezSampleParameter(1);
+
+ auto& sampler = GlobalHashtablezSampler();
+ std::vector<flat_hash_map<int, bigstruct>> flat_map_tables;
+ std::vector<flat_hash_set<bigstruct>> flat_set_tables;
+ std::vector<node_hash_map<int, bigstruct>> node_map_tables;
+ std::vector<node_hash_set<bigstruct>> node_set_tables;
+
+ // It takes thousands of new tables after changing the sampling parameters
+ // before you actually get some instrumentation. And if you must actually
+ // put something into those tables.
+ for (int i = 0; i < 10000; ++i) {
+ flat_map_tables.emplace_back();
+ flat_map_tables.back()[i] = bigstruct{};
+ }
+
+ // clang-tidy gives a false positive on this declaration. This unordered set
+ // cannot be a flat_hash_set, however, since that would introduce a mutex
+ // deadlock.
+ std::unordered_set<const HashtablezInfo*> preexisting_info; // NOLINT
+ sampler.Iterate(
+ [&](const HashtablezInfo& info) { preexisting_info.insert(&info); });
+ TestInlineElementSize(sampler, preexisting_info, flat_map_tables,
+ {0, bigstruct{}}, sizeof(int) + sizeof(bigstruct));
+ TestInlineElementSize(sampler, preexisting_info, node_map_tables,
+ {0, bigstruct{}}, sizeof(void*));
+ TestInlineElementSize(sampler, preexisting_info, flat_set_tables, //
+ bigstruct{}, sizeof(bigstruct));
+ TestInlineElementSize(sampler, preexisting_info, node_set_tables, //
+ bigstruct{}, sizeof(void*));
+#endif
+}
+
+} // namespace
+} // namespace container_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake b/grpc/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake
index 9cd6fd1b..942ce90a 100644
--- a/grpc/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake
+++ b/grpc/third_party/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake
@@ -35,8 +35,7 @@ endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(ABSL_DEFAULT_COPTS "${ABSL_GCC_FLAGS}")
set(ABSL_TEST_COPTS "${ABSL_GCC_FLAGS};${ABSL_GCC_TEST_FLAGS}")
-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- # MATCHES so we get both Clang and AppleClang
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # MATCHES so we get both Clang and AppleClang
if(MSVC)
# clang-cl is half MSVC, half LLVM
set(ABSL_DEFAULT_COPTS "${ABSL_CLANG_CL_FLAGS}")
diff --git a/grpc/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake b/grpc/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake
index 51742c9b..a4ab1aa2 100644
--- a/grpc/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake
+++ b/grpc/third_party/abseil-cpp/absl/copts/GENERATED_AbseilCopts.cmake
@@ -71,12 +71,13 @@ list(APPEND ABSL_LLVM_FLAGS
"-Wformat-security"
"-Wgnu-redeclared-enum"
"-Winfinite-recursion"
+ "-Winvalid-constexpr"
"-Wliteral-conversion"
"-Wmissing-declarations"
"-Woverlength-strings"
"-Wpointer-arith"
"-Wself-assign"
- "-Wshadow"
+ "-Wshadow-all"
"-Wstring-conversion"
"-Wtautological-overlap-compare"
"-Wundef"
@@ -93,6 +94,7 @@ list(APPEND ABSL_LLVM_FLAGS
"-Wno-implicit-int-conversion"
"-Wno-shorten-64-to-32"
"-Wno-sign-conversion"
+ "-Wno-unknown-warning-option"
"-DNOMINMAX"
)
diff --git a/grpc/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl b/grpc/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl
index 6707488f..a6efc98e 100644
--- a/grpc/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl
+++ b/grpc/third_party/abseil-cpp/absl/copts/GENERATED_copts.bzl
@@ -72,12 +72,13 @@ ABSL_LLVM_FLAGS = [
"-Wformat-security",
"-Wgnu-redeclared-enum",
"-Winfinite-recursion",
+ "-Winvalid-constexpr",
"-Wliteral-conversion",
"-Wmissing-declarations",
"-Woverlength-strings",
"-Wpointer-arith",
"-Wself-assign",
- "-Wshadow",
+ "-Wshadow-all",
"-Wstring-conversion",
"-Wtautological-overlap-compare",
"-Wundef",
@@ -94,6 +95,7 @@ ABSL_LLVM_FLAGS = [
"-Wno-implicit-int-conversion",
"-Wno-shorten-64-to-32",
"-Wno-sign-conversion",
+ "-Wno-unknown-warning-option",
"-DNOMINMAX",
]
diff --git a/grpc/third_party/abseil-cpp/absl/copts/configure_copts.bzl b/grpc/third_party/abseil-cpp/absl/copts/configure_copts.bzl
index 669a9060..40d5849a 100644
--- a/grpc/third_party/abseil-cpp/absl/copts/configure_copts.bzl
+++ b/grpc/third_party/abseil-cpp/absl/copts/configure_copts.bzl
@@ -50,6 +50,7 @@ ABSL_RANDOM_RANDEN_COPTS = select({
":cpu_x64_windows": ABSL_RANDOM_HWAES_MSVC_X64_FLAGS,
":cpu_k8": ABSL_RANDOM_HWAES_X64_FLAGS,
":cpu_ppc": ["-mcrypto"],
+ ":cpu_aarch64": ABSL_RANDOM_HWAES_ARM64_FLAGS,
# Supported by default or unsupported.
"//conditions:default": [],
@@ -70,6 +71,7 @@ def absl_random_randen_copts_init():
"darwin",
"x64_windows_msvc",
"x64_windows",
+ "aarch64",
]
for cpu in cpu_configs:
native.config_setting(
diff --git a/grpc/third_party/abseil-cpp/absl/copts/copts.py b/grpc/third_party/abseil-cpp/absl/copts/copts.py
index cf52981c..0d6c1ec3 100644
--- a/grpc/third_party/abseil-cpp/absl/copts/copts.py
+++ b/grpc/third_party/abseil-cpp/absl/copts/copts.py
@@ -87,12 +87,13 @@ COPT_VARS = {
"-Wformat-security",
"-Wgnu-redeclared-enum",
"-Winfinite-recursion",
+ "-Winvalid-constexpr",
"-Wliteral-conversion",
"-Wmissing-declarations",
"-Woverlength-strings",
"-Wpointer-arith",
"-Wself-assign",
- "-Wshadow",
+ "-Wshadow-all",
"-Wstring-conversion",
"-Wtautological-overlap-compare",
"-Wundef",
@@ -111,6 +112,9 @@ COPT_VARS = {
"-Wno-implicit-int-conversion",
"-Wno-shorten-64-to-32",
"-Wno-sign-conversion",
+ # Disable warnings on unknown warning flags (when warning flags are
+ # unknown on older compiler versions)
+ "-Wno-unknown-warning-option",
# Don't define min and max macros (Build on Windows using clang)
"-DNOMINMAX",
],
diff --git a/grpc/third_party/abseil-cpp/absl/copts/generate_copts.py b/grpc/third_party/abseil-cpp/absl/copts/generate_copts.py
index 0e5dc9fa..34be2fc2 100755
--- a/grpc/third_party/abseil-cpp/absl/copts/generate_copts.py
+++ b/grpc/third_party/abseil-cpp/absl/copts/generate_copts.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
"""Generate Abseil compile compile option configs.
Usage: <path_to_absl>/copts/generate_copts.py
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/debugging/BUILD.bazel
index 5385bcb6..3c4ea8dc 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/debugging/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -34,8 +33,10 @@ cc_library(
"internal/stacktrace_aarch64-inl.inc",
"internal/stacktrace_arm-inl.inc",
"internal/stacktrace_config.h",
+ "internal/stacktrace_emscripten-inl.inc",
"internal/stacktrace_generic-inl.inc",
"internal/stacktrace_powerpc-inl.inc",
+ "internal/stacktrace_riscv-inl.inc",
"internal/stacktrace_unimplemented-inl.inc",
"internal/stacktrace_win32-inl.inc",
"internal/stacktrace_x86-inl.inc",
@@ -57,6 +58,7 @@ cc_library(
"symbolize.cc",
"symbolize_darwin.inc",
"symbolize_elf.inc",
+ "symbolize_emscripten.inc",
"symbolize_unimplemented.inc",
"symbolize_win32.inc",
],
@@ -180,6 +182,7 @@ cc_library(
],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = ["//visibility:private"],
deps = [
"//absl/base:config",
"//absl/base:core_headers",
@@ -194,6 +197,7 @@ cc_library(
srcs = ["internal/demangle.cc"],
hdrs = ["internal/demangle.h"],
copts = ABSL_DEFAULT_COPTS,
+ visibility = ["//visibility:private"],
deps = [
"//absl/base",
"//absl/base:config",
@@ -344,6 +348,7 @@ cc_test(
srcs = ["internal/stack_consumption_test.cc"],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
+ tags = ["notsan"],
deps = [
":stack_consumption",
"//absl/base:core_headers",
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/debugging/CMakeLists.txt
index 074b44cf..b16fa007 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/debugging/CMakeLists.txt
@@ -22,8 +22,10 @@ absl_cc_library(
"internal/stacktrace_aarch64-inl.inc"
"internal/stacktrace_arm-inl.inc"
"internal/stacktrace_config.h"
+ "internal/stacktrace_emscripten-inl.inc"
"internal/stacktrace_generic-inl.inc"
"internal/stacktrace_powerpc-inl.inc"
+ "internal/stacktrace_riscv-inl.inc"
"internal/stacktrace_unimplemented-inl.inc"
"internal/stacktrace_win32-inl.inc"
"internal/stacktrace_x86-inl.inc"
@@ -48,6 +50,7 @@ absl_cc_library(
"symbolize.cc"
"symbolize_darwin.inc"
"symbolize_elf.inc"
+ "symbolize_emscripten.inc"
"symbolize_unimplemented.inc"
"symbolize_win32.inc"
COPTS
@@ -87,7 +90,7 @@ absl_cc_test(
absl::memory
absl::raw_logging_internal
absl::strings
- gmock
+ GTest::gmock
)
absl_cc_library(
@@ -141,7 +144,7 @@ absl_cc_test(
absl::strings
absl::raw_logging_internal
Threads::Threads
- gmock
+ GTest::gmock
)
absl_cc_library(
@@ -194,7 +197,7 @@ absl_cc_test(
absl::core_headers
absl::memory
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -261,7 +264,7 @@ absl_cc_test(
DEPS
absl::leak_check_api_enabled_for_testing
absl::base
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -275,7 +278,7 @@ absl_cc_test(
DEPS
absl::leak_check_api_disabled_for_testing
absl::base
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -292,7 +295,7 @@ absl_cc_test(
absl::leak_check_disable
absl::base
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -322,7 +325,7 @@ absl_cc_test(
absl::stack_consumption
absl::core_headers
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
# component target
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc b/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
index a9ed6ef9..689e5979 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
@@ -136,7 +136,8 @@ static bool SetupAlternateStackOnce() {
#else
const size_t page_mask = sysconf(_SC_PAGESIZE) - 1;
#endif
- size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
+ size_t stack_size =
+ (std::max<size_t>(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
// Account for sanitizer instrumentation requiring additional stack space.
@@ -366,6 +367,7 @@ static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) {
// goes after this point.
if (fsh_options.writerfn != nullptr) {
WriteFailureInfo(signo, ucontext, my_cpu, fsh_options.writerfn);
+ fsh_options.writerfn(nullptr);
}
if (fsh_options.call_previous_handler) {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h b/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h
index 0c0f585d..500115c0 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h
+++ b/grpc/third_party/abseil-cpp/absl/debugging/failure_signal_handler.h
@@ -90,7 +90,7 @@ struct FailureSignalHandlerOptions {
// If non-null, indicates a pointer to a callback function that will be called
// upon failure, with a string argument containing failure data. This function
// may be used as a hook to write failure data to a secondary location, such
- // as a log file. This function may also be called with null data, as a hint
+ // as a log file. This function will also be called with null data, as a hint
// to flush any buffered data before the program may be terminated. Consider
// flushing any buffered data in all calls to this function.
//
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/demangle.cc b/grpc/third_party/abseil-cpp/absl/debugging/internal/demangle.cc
index 5cd56320..93ae3279 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/demangle.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/demangle.cc
@@ -1617,6 +1617,7 @@ static bool ParseUnresolvedName(State *state) {
// ::= <2-ary operator-name> <expression> <expression>
// ::= <3-ary operator-name> <expression> <expression> <expression>
// ::= cl <expression>+ E
+// ::= cp <simple-id> <expression>* E # Clang-specific.
// ::= cv <type> <expression> # type (expression)
// ::= cv <type> _ <expression>* E # type (expr-list)
// ::= st <type>
@@ -1639,14 +1640,23 @@ static bool ParseExpression(State *state) {
return true;
}
- // Object/function call expression.
ParseState copy = state->parse_state;
+
+ // Object/function call expression.
if (ParseTwoCharToken(state, "cl") && OneOrMore(ParseExpression, state) &&
ParseOneCharToken(state, 'E')) {
return true;
}
state->parse_state = copy;
+ // Clang-specific "cp <simple-id> <expression>* E"
+ // https://clang.llvm.org/doxygen/ItaniumMangle_8cpp_source.html#l04338
+ if (ParseTwoCharToken(state, "cp") && ParseSimpleId(state) &&
+ ZeroOrMore(ParseExpression, state) && ParseOneCharToken(state, 'E')) {
+ return true;
+ }
+ state->parse_state = copy;
+
// Function-param expression (level 0).
if (ParseTwoCharToken(state, "fp") && Optional(ParseCVQualifiers(state)) &&
Optional(ParseNumber(state, nullptr)) && ParseOneCharToken(state, '_')) {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc b/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc
index 24cc0130..29a28181 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc
@@ -22,6 +22,7 @@
#include <string.h>
#include <cassert>
#include <cstddef>
+#include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
// From binutils/include/elf/common.h (this doesn't appear to be documented
@@ -43,11 +44,11 @@ namespace debugging_internal {
namespace {
-#if __WORDSIZE == 32
+#if __SIZEOF_POINTER__ == 4
const int kElfClass = ELFCLASS32;
int ElfBind(const ElfW(Sym) *symbol) { return ELF32_ST_BIND(symbol->st_info); }
int ElfType(const ElfW(Sym) *symbol) { return ELF32_ST_TYPE(symbol->st_info); }
-#elif __WORDSIZE == 64
+#elif __SIZEOF_POINTER__ == 8
const int kElfClass = ELFCLASS64;
int ElfBind(const ElfW(Sym) *symbol) { return ELF64_ST_BIND(symbol->st_info); }
int ElfType(const ElfW(Sym) *symbol) { return ELF64_ST_TYPE(symbol->st_info); }
@@ -175,17 +176,17 @@ void ElfMemImage::Init(const void *base) {
}
switch (base_as_char[EI_DATA]) {
case ELFDATA2LSB: {
- if (__LITTLE_ENDIAN != __BYTE_ORDER) {
- assert(false);
- return;
- }
+#ifndef ABSL_IS_LITTLE_ENDIAN
+ assert(false);
+ return;
+#endif
break;
}
case ELFDATA2MSB: {
- if (__BIG_ENDIAN != __BYTE_ORDER) {
- assert(false);
- return;
- }
+#ifndef ABSL_IS_BIG_ENDIAN
+ assert(false);
+ return;
+#endif
break;
}
default: {
@@ -221,7 +222,7 @@ void ElfMemImage::Init(const void *base) {
reinterpret_cast<ElfW(Dyn) *>(dynamic_program_header->p_vaddr +
relocation);
for (; dynamic_entry->d_tag != DT_NULL; ++dynamic_entry) {
- const ElfW(Xword) value = dynamic_entry->d_un.d_val + relocation;
+ const auto value = dynamic_entry->d_un.d_val + relocation;
switch (dynamic_entry->d_tag) {
case DT_HASH:
hash_ = reinterpret_cast<ElfW(Word) *>(value);
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h b/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
index 46bfade3..a894bd42 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h
@@ -31,8 +31,8 @@
#error ABSL_HAVE_ELF_MEM_IMAGE cannot be directly set
#endif
-#if defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \
- !defined(__asmjs__) && !defined(__wasm__)
+#if defined(__ELF__) && !defined(__native_client__) && !defined(__asmjs__) && \
+ !defined(__wasm__)
#define ABSL_HAVE_ELF_MEM_IMAGE 1
#endif
@@ -40,6 +40,10 @@
#include <link.h> // for ElfW
+#if defined(__FreeBSD__) && !defined(ElfW)
+#define ElfW(x) __ElfN(x)
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace debugging_internal {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc b/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc
index e3dd51c3..51348649 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.cc
@@ -43,7 +43,7 @@ namespace {
// unspecified. Therefore, instead we hardcode the direction of the
// stack on platforms we know about.
#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || \
- defined(__aarch64__)
+ defined(__aarch64__) || defined(__riscv)
constexpr bool kStackGrowsDown = true;
#else
#error Need to define kStackGrowsDown
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h b/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h
index 2b5e7151..f41b64c3 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stack_consumption.h
@@ -26,7 +26,7 @@
#error ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION cannot be set directly
#elif !defined(__APPLE__) && !defined(_WIN32) && \
(defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || \
- defined(__aarch64__))
+ defined(__aarch64__) || defined(__riscv))
#define ABSL_INTERNAL_HAVE_DEBUGGING_STACK_CONSUMPTION 1
namespace absl {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
index cca410d4..ff21b719 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
@@ -35,7 +35,11 @@
// Thread local support required for UnwindImpl.
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_generic-inl.inc"
-#endif
+#endif // defined(ABSL_HAVE_THREAD_LOCAL)
+
+#elif defined(__EMSCRIPTEN__)
+#define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_emscripten-inl.inc"
#elif defined(__linux__) && !defined(__ANDROID__)
@@ -51,7 +55,7 @@
// Note: When using glibc this may require -funwind-tables to function properly.
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_generic-inl.inc"
-#endif
+#endif // __has_include(<execinfo.h>)
#elif defined(__i386__) || defined(__x86_64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_x86-inl.inc"
@@ -61,15 +65,18 @@
#elif defined(__aarch64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_aarch64-inl.inc"
+#elif defined(__riscv)
+#define ABSL_STACKTRACE_INL_HEADER \
+ "absl/debugging/internal/stacktrace_riscv-inl.inc"
#elif defined(__has_include)
#if __has_include(<execinfo.h>)
// Note: When using glibc this may require -funwind-tables to function properly.
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_generic-inl.inc"
-#endif
-#endif
+#endif // __has_include(<execinfo.h>)
+#endif // defined(__has_include)
-#endif
+#endif // defined(__linux__) && !defined(__ANDROID__)
// Fallback to the empty implementation.
#if !defined(ABSL_STACKTRACE_INL_HEADER)
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc
new file mode 100644
index 00000000..0f444514
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc
@@ -0,0 +1,110 @@
+// Copyright 2017 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Portable implementation - just use glibc
+//
+// Note: The glibc implementation may cause a call to malloc.
+// This can cause a deadlock in HeapProfiler.
+
+#ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_EMSCRIPTEN_INL_H_
+#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_EMSCRIPTEN_INL_H_
+
+#include <emscripten.h>
+
+#include <atomic>
+#include <cstring>
+
+#include "absl/base/attributes.h"
+#include "absl/debugging/stacktrace.h"
+
+extern "C" {
+uintptr_t emscripten_stack_snapshot();
+uint32_t emscripten_stack_unwind_buffer(uintptr_t pc, void *buffer,
+ uint32_t depth);
+}
+
+// Sometimes, we can try to get a stack trace from within a stack
+// trace, which can cause a self-deadlock.
+// Protect against such reentrant call by failing to get a stack trace.
+//
+// We use __thread here because the code here is extremely low level -- it is
+// called while collecting stack traces from within malloc and mmap, and thus
+// can not call anything which might call malloc or mmap itself.
+static __thread int recursive = 0;
+
+// The stack trace function might be invoked very early in the program's
+// execution (e.g. from the very first malloc).
+// As such, we suppress usage of backtrace during this early stage of execution.
+static std::atomic<bool> disable_stacktraces(true); // Disabled until healthy.
+// Waiting until static initializers run seems to be late enough.
+// This file is included into stacktrace.cc so this will only run once.
+ABSL_ATTRIBUTE_UNUSED static int stacktraces_enabler = []() {
+ // Check if we can even create stacktraces. If not, bail early and leave
+ // disable_stacktraces set as-is.
+ // clang-format off
+ if (!EM_ASM_INT({ return (typeof wasmOffsetConverter !== 'undefined'); })) {
+ return 0;
+ }
+ // clang-format on
+ disable_stacktraces.store(false, std::memory_order_relaxed);
+ return 0;
+}();
+
+template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
+static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
+ const void *ucp, int *min_dropped_frames) {
+ if (recursive || disable_stacktraces.load(std::memory_order_relaxed)) {
+ return 0;
+ }
+ ++recursive;
+
+ static_cast<void>(ucp); // Unused.
+ constexpr int kStackLength = 64;
+ void *stack[kStackLength];
+
+ int size;
+ uintptr_t pc = emscripten_stack_snapshot();
+ size = emscripten_stack_unwind_buffer(pc, stack, kStackLength);
+
+ int result_count = size - skip_count;
+ if (result_count < 0) result_count = 0;
+ if (result_count > max_depth) result_count = max_depth;
+ for (int i = 0; i < result_count; i++) result[i] = stack[i + skip_count];
+
+ if (IS_STACK_FRAMES) {
+ // No implementation for finding out the stack frame sizes yet.
+ memset(sizes, 0, sizeof(*sizes) * result_count);
+ }
+ if (min_dropped_frames != nullptr) {
+ if (size - skip_count - max_depth > 0) {
+ *min_dropped_frames = size - skip_count - max_depth;
+ } else {
+ *min_dropped_frames = 0;
+ }
+ }
+
+ --recursive;
+
+ return result_count;
+}
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace debugging_internal {
+bool StackTraceWorksForTest() { return true; }
+} // namespace debugging_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_EMSCRIPTEN_INL_H_
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc
new file mode 100644
index 00000000..8cbc7854
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc
@@ -0,0 +1,234 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_DEBUGGING_INTERNAL_STACKTRACE_RISCV_INL_H_
+#define ABSL_DEBUGGING_INTERNAL_STACKTRACE_RISCV_INL_H_
+
+// Generate stack trace for riscv
+
+#include <sys/ucontext.h>
+
+#include "absl/base/config.h"
+#if defined(__linux__)
+#include <sys/mman.h>
+#include <ucontext.h>
+#include <unistd.h>
+#endif
+
+#include <atomic>
+#include <cassert>
+#include <cstdint>
+#include <iostream>
+
+#include "absl/base/attributes.h"
+#include "absl/debugging/internal/address_is_readable.h"
+#include "absl/debugging/internal/vdso_support.h"
+#include "absl/debugging/stacktrace.h"
+
+static const uintptr_t kUnknownFrameSize = 0;
+
+#if defined(__linux__)
+// Returns the address of the VDSO __kernel_rt_sigreturn function, if present.
+static const unsigned char *GetKernelRtSigreturnAddress() {
+ constexpr uintptr_t kImpossibleAddress = 0;
+ ABSL_CONST_INIT static std::atomic<uintptr_t> memoized(kImpossibleAddress);
+ uintptr_t address = memoized.load(std::memory_order_relaxed);
+ if (address != kImpossibleAddress) {
+ return reinterpret_cast<const unsigned char *>(address);
+ }
+
+ address = reinterpret_cast<uintptr_t>(nullptr);
+
+#if ABSL_HAVE_VDSO_SUPPORT
+ absl::debugging_internal::VDSOSupport vdso;
+ if (vdso.IsPresent()) {
+ absl::debugging_internal::VDSOSupport::SymbolInfo symbol_info;
+ // Symbol versioning pulled from arch/riscv/kernel/vdso/vdso.lds at v5.10.
+ auto lookup = [&](int type) {
+ return vdso.LookupSymbol("__kernel_rt_sigreturn", "LINUX_4.15", type,
+ &symbol_info);
+ };
+ if ((!lookup(STT_FUNC) && !lookup(STT_NOTYPE)) ||
+ symbol_info.address == nullptr) {
+ // Unexpected: VDSO is present, yet the expected symbol is missing or
+ // null.
+ assert(false && "VDSO is present, but doesn't have expected symbol");
+ } else {
+ if (reinterpret_cast<uintptr_t>(symbol_info.address) !=
+ kImpossibleAddress) {
+ address = reinterpret_cast<uintptr_t>(symbol_info.address);
+ } else {
+ assert(false && "VDSO returned invalid address");
+ }
+ }
+ }
+#endif
+
+ memoized.store(address, std::memory_order_relaxed);
+ return reinterpret_cast<const unsigned char *>(address);
+}
+#endif // __linux__
+
+// Compute the size of a stack frame in [low..high). We assume that low < high.
+// Return size of kUnknownFrameSize.
+template <typename T>
+static inline uintptr_t ComputeStackFrameSize(const T *low, const T *high) {
+ const char *low_char_ptr = reinterpret_cast<const char *>(low);
+ const char *high_char_ptr = reinterpret_cast<const char *>(high);
+ return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize;
+}
+
+// Given a pointer to a stack frame, locate and return the calling stackframe,
+// or return null if no stackframe can be found. Perform sanity checks (the
+// strictness of which is controlled by the boolean parameter
+// "STRICT_UNWINDING") to reduce the chance that a bad pointer is returned.
+template <bool STRICT_UNWINDING, bool WITH_CONTEXT>
+ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
+ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
+static void ** NextStackFrame(void **old_frame_pointer, const void *uc) {
+ // .
+ // .
+ // .
+ // +-> +----------------+
+ // | | return address |
+ // | | previous fp |
+ // | | ... |
+ // | +----------------+ <-+
+ // | | return address | |
+ // +---|- previous fp | |
+ // | ... | |
+ // $fp ->|----------------+ |
+ // | return address | |
+ // | previous fp -|---+
+ // $sp ->| ... |
+ // +----------------+
+ void **new_frame_pointer = reinterpret_cast<void **>(old_frame_pointer[-2]);
+ bool check_frame_size = true;
+
+#if defined(__linux__)
+ if (WITH_CONTEXT && uc != nullptr) {
+ // Check to see if next frame's return address is __kernel_rt_sigreturn.
+ if (old_frame_pointer[-1] == GetKernelRtSigreturnAddress()) {
+ const ucontext_t *ucv = static_cast<const ucontext_t *>(uc);
+ // old_frame_pointer is not suitable for unwinding, look at ucontext to
+ // discover frame pointer before signal.
+ //
+ // RISCV ELF psABI has the frame pointer at x8/fp/s0.
+ // -- RISCV psABI Table 18.2
+ void **const pre_signal_frame_pointer =
+ reinterpret_cast<void **>(ucv->uc_mcontext.__gregs[8]);
+
+ // Check the alleged frame pointer is actually readable. This is to
+ // prevent "double fault" in case we hit the first fault due to stack
+ // corruption.
+ if (!absl::debugging_internal::AddressIsReadable(
+ pre_signal_frame_pointer))
+ return nullptr;
+
+ // Alleged frame pointer is readable, use it for further unwinding.
+ new_frame_pointer = pre_signal_frame_pointer;
+
+ // Skip frame size check if we return from a signal. We may be using an
+ // alterate stack for signals.
+ check_frame_size = false;
+ }
+ }
+#endif
+
+ // The RISCV ELF psABI mandates that the stack pointer is always 16-byte
+ // aligned.
+ // FIXME(abdulras) this doesn't hold for ILP32E which only mandates a 4-byte
+ // alignment.
+ if ((reinterpret_cast<uintptr_t>(new_frame_pointer) & 15) != 0)
+ return nullptr;
+
+ // Check frame size. In strict mode, we assume frames to be under 100,000
+ // bytes. In non-strict mode, we relax the limit to 1MB.
+ if (check_frame_size) {
+ const uintptr_t max_size = STRICT_UNWINDING ? 100000 : 1000000;
+ const uintptr_t frame_size =
+ ComputeStackFrameSize(old_frame_pointer, new_frame_pointer);
+ if (frame_size == kUnknownFrameSize || frame_size > max_size)
+ return nullptr;
+ }
+
+ return new_frame_pointer;
+}
+
+template <bool IS_STACK_FRAMES, bool IS_WITH_CONTEXT>
+ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
+ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
+static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
+ const void *ucp, int *min_dropped_frames) {
+#if defined(__GNUC__)
+ void **frame_pointer = reinterpret_cast<void **>(__builtin_frame_address(0));
+#else
+#error reading stack pointer not yet supported on this platform
+#endif
+
+ skip_count++; // Skip the frame for this function.
+ int n = 0;
+
+ // The `frame_pointer` that is computed here points to the top of the frame.
+ // The two words preceding the address are the return address and the previous
+ // frame pointer. To find a PC value associated with the current frame, we
+ // need to go down a level in the call chain. So we remember the return
+ // address of the last frame seen. This does not work for the first stack
+ // frame, which belongs to `UnwindImp()` but we skip the frame for
+ // `UnwindImp()` anyway.
+ void *prev_return_address = nullptr;
+
+ while (frame_pointer && n < max_depth) {
+ // The absl::GetStackFrames routine si called when we are in some
+ // informational context (the failure signal handler for example). Use the
+ // non-strict unwinding rules to produce a stack trace that is as complete
+ // as possible (even if it contains a few bogus entries in some rare cases).
+ void **next_frame_pointer =
+ NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(frame_pointer, ucp);
+
+ if (skip_count > 0) {
+ skip_count--;
+ } else {
+ result[n] = prev_return_address;
+ if (IS_STACK_FRAMES) {
+ sizes[n] = ComputeStackFrameSize(frame_pointer, next_frame_pointer);
+ }
+ n++;
+ }
+ prev_return_address = frame_pointer[-1];
+ frame_pointer = next_frame_pointer;
+ }
+ if (min_dropped_frames != nullptr) {
+ // Implementation detail: we clamp the max of frames we are willing to
+ // count, so as not to spend too much time in the loop below.
+ const int kMaxUnwind = 200;
+ int j = 0;
+ for (; frame_pointer != nullptr && j < kMaxUnwind; j++) {
+ frame_pointer =
+ NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(frame_pointer, ucp);
+ }
+ *min_dropped_frames = j;
+ }
+ return n;
+}
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace debugging_internal {
+bool StackTraceWorksForTest() { return true; }
+} // namespace debugging_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc
index bc320ff7..847a5473 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc
@@ -27,6 +27,7 @@
#include <cassert>
#include <cstdint>
+#include <limits>
#include "absl/base/macros.h"
#include "absl/base/port.h"
@@ -132,9 +133,8 @@ static uintptr_t GetFP(const void *vuc) {
const uintptr_t bp = 0;
const uintptr_t sp = 0;
#endif
- // Sanity-check that the base pointer is valid. It should be as long as
- // SHRINK_WRAP_FRAME_POINTER is not set, but it's possible that some code in
- // the process is compiled with --copt=-fomit-frame-pointer or
+ // Sanity-check that the base pointer is valid. It's possible that some
+ // code in the process is compiled with --copt=-fomit-frame-pointer or
// --copt=-momit-leaf-frame-pointer.
//
// TODO(bcmills): -momit-leaf-frame-pointer is currently the default
@@ -159,7 +159,8 @@ static uintptr_t GetFP(const void *vuc) {
template <bool STRICT_UNWINDING, bool WITH_CONTEXT>
ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack.
ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // May read random elements from stack.
-static void **NextStackFrame(void **old_fp, const void *uc) {
+static void **NextStackFrame(void **old_fp, const void *uc,
+ size_t stack_low, size_t stack_high) {
void **new_fp = (void **)*old_fp;
#if defined(__linux__) && defined(__i386__)
@@ -247,7 +248,7 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
// using an alternate signal stack.
//
// TODO(bcmills): The GetFP call should be completely unnecessary when
- // SHRINK_WRAP_FRAME_POINTER is set (because we should be back in the thread's
+ // ENABLE_COMBINED_UNWINDER is set (because we should be back in the thread's
// stack by this point), but it is empirically still needed (e.g. when the
// stack includes a call to abort). unw_get_reg returns UNW_EBADREG for some
// frames. Figure out why GetValidFrameAddr and/or libunwind isn't doing what
@@ -258,6 +259,18 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
// at a greater address that the current one.
if (new_fp_u <= old_fp_u) return nullptr;
if (new_fp_u - old_fp_u > kMaxFrameBytes) return nullptr;
+
+ if (stack_low < old_fp_u && old_fp_u <= stack_high) {
+ // Old BP was in the expected stack region...
+ if (!(stack_low < new_fp_u && new_fp_u <= stack_high)) {
+ // ... but new BP is outside of expected stack region.
+ // It is most likely bogus.
+ return nullptr;
+ }
+ } else {
+ // We may be here if we are executing in a co-routine with a
+ // separate stack. We can't do safety checks in this case.
+ }
} else {
if (new_fp == nullptr) return nullptr; // skip AddressIsReadable() below
// In the non-strict mode, allow discontiguous stack frames.
@@ -297,13 +310,17 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
int n = 0;
void **fp = reinterpret_cast<void **>(__builtin_frame_address(0));
+ size_t stack_low = getpagesize(); // Assume that the first page is not stack.
+ size_t stack_high = std::numeric_limits<size_t>::max() - sizeof(void *);
+
while (fp && n < max_depth) {
if (*(fp + 1) == reinterpret_cast<void *>(0)) {
// In 64-bit code, we often see a frame that
// points to itself and has a return address of 0.
break;
}
- void **next_fp = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(fp, ucp);
+ void **next_fp = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(
+ fp, ucp, stack_low, stack_high);
if (skip_count > 0) {
skip_count--;
} else {
@@ -326,7 +343,8 @@ static int UnwindImpl(void **result, int *sizes, int max_depth, int skip_count,
const int kMaxUnwind = 1000;
int j = 0;
for (; fp != nullptr && j < kMaxUnwind; j++) {
- fp = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(fp, ucp);
+ fp = NextStackFrame<!IS_STACK_FRAMES, IS_WITH_CONTEXT>(fp, ucp, stack_low,
+ stack_high);
}
*min_dropped_frames = j;
}
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/symbolize.h b/grpc/third_party/abseil-cpp/absl/debugging/internal/symbolize.h
index 4f26130f..27d5e652 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/symbolize.h
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/symbolize.h
@@ -28,8 +28,8 @@
#ifdef ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE
#error ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE cannot be directly set
-#elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) && \
- !defined(__asmjs__) && !defined(__wasm__)
+#elif defined(__ELF__) && defined(__GLIBC__) && !defined(__native_client__) \
+ && !defined(__asmjs__) && !defined(__wasm__)
#define ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE 1
#include <elf.h>
@@ -68,6 +68,12 @@ ABSL_NAMESPACE_END
#define ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE 1
#endif
+#ifdef ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE
+#error ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE cannot be directly set
+#elif defined(__EMSCRIPTEN__)
+#define ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE 1
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace debugging_internal {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc b/grpc/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc
index 6be16d90..977a9f6b 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc
@@ -20,12 +20,25 @@
#ifdef ABSL_HAVE_VDSO_SUPPORT // defined in vdso_support.h
+#if !defined(__has_include)
+#define __has_include(header) 0
+#endif
+
#include <errno.h>
#include <fcntl.h>
+#if __has_include(<syscall.h>)
+#include <syscall.h>
+#elif __has_include(<sys/syscall.h>)
#include <sys/syscall.h>
+#endif
#include <unistd.h>
-#if __GLIBC_PREREQ(2, 16) // GLIBC-2.16 implements getauxval.
+#if defined(__GLIBC__) && \
+ (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16))
+#define ABSL_HAVE_GETAUXVAL
+#endif
+
+#ifdef ABSL_HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
@@ -37,6 +50,11 @@
#define AT_SYSINFO_EHDR 33 // for crosstoolv10
#endif
+#if defined(__FreeBSD__)
+using Elf64_auxv_t = Elf64_Auxinfo;
+using Elf32_auxv_t = Elf32_Auxinfo;
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace debugging_internal {
@@ -65,7 +83,7 @@ VDSOSupport::VDSOSupport()
// the operation should be idempotent.
const void *VDSOSupport::Init() {
const auto kInvalidBase = debugging_internal::ElfMemImage::kInvalidBase;
-#if __GLIBC_PREREQ(2, 16)
+#ifdef ABSL_HAVE_GETAUXVAL
if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
errno = 0;
const void *const sysinfo_ehdr =
@@ -74,7 +92,7 @@ const void *VDSOSupport::Init() {
vdso_base_.store(sysinfo_ehdr, std::memory_order_relaxed);
}
}
-#endif // __GLIBC_PREREQ(2, 16)
+#endif // ABSL_HAVE_GETAUXVAL
if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
int fd = open("/proc/self/auxv", O_RDONLY);
if (fd == -1) {
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/stacktrace.cc b/grpc/third_party/abseil-cpp/absl/debugging/stacktrace.cc
index 1f7c7d82..ff8069f8 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/stacktrace.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/stacktrace.cc
@@ -49,8 +49,10 @@
# include "absl/debugging/internal/stacktrace_aarch64-inl.inc"
# include "absl/debugging/internal/stacktrace_arm-inl.inc"
+# include "absl/debugging/internal/stacktrace_emscripten-inl.inc"
# include "absl/debugging/internal/stacktrace_generic-inl.inc"
# include "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+# include "absl/debugging/internal/stacktrace_riscv-inl.inc"
# include "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
# include "absl/debugging/internal/stacktrace_win32-inl.inc"
# include "absl/debugging/internal/stacktrace_x86-inl.inc"
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/symbolize.cc b/grpc/third_party/abseil-cpp/absl/debugging/symbolize.cc
index 5e4a25d6..f1abdfda 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/symbolize.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/symbolize.cc
@@ -31,6 +31,8 @@
#include "absl/debugging/symbolize_win32.inc"
#elif defined(__APPLE__)
#include "absl/debugging/symbolize_darwin.inc"
+#elif defined(__EMSCRIPTEN__)
+#include "absl/debugging/symbolize_emscripten.inc"
#else
#include "absl/debugging/symbolize_unimplemented.inc"
#endif
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc
index f4d5727b..3ff343d6 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc
@@ -77,6 +77,10 @@
#include "absl/debugging/internal/vdso_support.h"
#include "absl/strings/string_view.h"
+#if defined(__FreeBSD__) && !defined(ElfW)
+#define ElfW(x) __ElfN(x)
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
@@ -701,6 +705,16 @@ static ABSL_ATTRIBUTE_NOINLINE FindSymbolResult FindSymbol(
const char *start_address =
ComputeOffset(original_start_address, relocation);
+#ifdef __arm__
+ // ARM functions are always aligned to multiples of two bytes; the
+ // lowest-order bit in start_address is ignored by the CPU and indicates
+ // whether the function contains ARM (0) or Thumb (1) code. We don't care
+ // about what encoding is being used; we just want the real start address
+ // of the function.
+ start_address = reinterpret_cast<const char *>(
+ reinterpret_cast<uintptr_t>(start_address) & ~1);
+#endif
+
if (deref_function_descriptor_pointer &&
InSection(original_start_address, opd)) {
// The opd section is mapped into memory. Just dereference
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc
new file mode 100644
index 00000000..c226c456
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc
@@ -0,0 +1,72 @@
+// Copyright 2020 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <cxxabi.h>
+#include <emscripten.h>
+
+#include <algorithm>
+#include <cstring>
+
+#include "absl/base/internal/raw_logging.h"
+#include "absl/debugging/internal/demangle.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+extern "C" {
+const char* emscripten_pc_get_function(const void* pc);
+}
+
+// clang-format off
+EM_JS(bool, HaveOffsetConverter, (),
+ { return typeof wasmOffsetConverter !== 'undefined'; });
+// clang-format on
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+
+void InitializeSymbolizer(const char*) {
+ if (!HaveOffsetConverter()) {
+ ABSL_RAW_LOG(INFO,
+ "Symbolization unavailable. Rebuild with -sWASM=1 "
+ "and -sUSE_OFFSET_CONVERTER=1.");
+ }
+}
+
+bool Symbolize(const void* pc, char* out, int out_size) {
+ // Check if we have the offset converter necessary for pc_get_function.
+ // Without it, the program will abort().
+ if (!HaveOffsetConverter()) {
+ return false;
+ }
+ const char* func_name = emscripten_pc_get_function(pc);
+ if (func_name == nullptr) {
+ return false;
+ }
+
+ strncpy(out, func_name, out_size);
+
+ if (out[out_size - 1] != '\0') {
+ // strncpy() does not '\0' terminate when it truncates.
+ static constexpr char kEllipsis[] = "...";
+ int ellipsis_size = std::min<int>(sizeof(kEllipsis) - 1, out_size - 1);
+ memcpy(out + out_size - ellipsis_size - 1, kEllipsis, ellipsis_size);
+ out[out_size - 1] = '\0';
+ }
+
+ return true;
+}
+
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/debugging/symbolize_test.cc b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_test.cc
index a2dd4956..c710a3da 100644
--- a/grpc/third_party/abseil-cpp/absl/debugging/symbolize_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/debugging/symbolize_test.cc
@@ -146,8 +146,22 @@ static const char *TrySymbolize(void *pc) {
return TrySymbolizeWithLimit(pc, sizeof(try_symbolize_buffer));
}
-#if defined(ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE) || \
- defined(ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE)
+#if defined(ABSL_INTERNAL_HAVE_ELF_SYMBOLIZE) || \
+ defined(ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE) || \
+ defined(ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE)
+
+// Test with a return address.
+void ABSL_ATTRIBUTE_NOINLINE TestWithReturnAddress() {
+#if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE)
+ void *return_address = __builtin_return_address(0);
+ const char *symbol = TrySymbolize(return_address);
+ ABSL_RAW_CHECK(symbol != nullptr, "TestWithReturnAddress failed");
+ ABSL_RAW_CHECK(strcmp(symbol, "main") == 0, "TestWithReturnAddress failed");
+ std::cout << "TestWithReturnAddress passed" << std::endl;
+#endif
+}
+
+#ifndef ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE
TEST(Symbolize, Cached) {
// Compilers should give us pointers to them.
@@ -418,6 +432,7 @@ TEST(Symbolize, ForEachSection) {
close(fd);
}
#endif // !ABSL_INTERNAL_HAVE_DARWIN_SYMBOLIZE
+#endif // !ABSL_INTERNAL_HAVE_EMSCRIPTEN_SYMBOLIZE
// x86 specific tests. Uses some inline assembler.
extern "C" {
@@ -466,17 +481,46 @@ void ABSL_ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
}
}
-// Test with a return address.
-void ABSL_ATTRIBUTE_NOINLINE TestWithReturnAddress() {
+#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+// Test that we correctly identify bounds of Thumb functions on ARM.
+//
+// Thumb functions have the lowest-order bit set in their addresses in the ELF
+// symbol table. This requires some extra logic to properly compute function
+// bounds. To test this logic, nudge a Thumb function right up against an ARM
+// function and try to symbolize the ARM function.
+//
+// A naive implementation will simply use the Thumb function's entry point as
+// written in the symbol table and will therefore treat the Thumb function as
+// extending one byte further in the instruction stream than it actually does.
+// When asked to symbolize the start of the ARM function, it will identify an
+// overlap between the Thumb and ARM functions, and it will return the name of
+// the Thumb function.
+//
+// A correct implementation, on the other hand, will null out the lowest-order
+// bit in the Thumb function's entry point. It will correctly compute the end of
+// the Thumb function, it will find no overlap between the Thumb and ARM
+// functions, and it will return the name of the ARM function.
+
+__attribute__((target("thumb"))) int ArmThumbOverlapThumb(int x) {
+ return x * x * x;
+}
+
+__attribute__((target("arm"))) int ArmThumbOverlapArm(int x) {
+ return x * x * x;
+}
+
+void ABSL_ATTRIBUTE_NOINLINE TestArmThumbOverlap() {
#if defined(ABSL_HAVE_ATTRIBUTE_NOINLINE)
- void *return_address = __builtin_return_address(0);
- const char *symbol = TrySymbolize(return_address);
- ABSL_RAW_CHECK(symbol != nullptr, "TestWithReturnAddress failed");
- ABSL_RAW_CHECK(strcmp(symbol, "main") == 0, "TestWithReturnAddress failed");
- std::cout << "TestWithReturnAddress passed" << std::endl;
+ const char *symbol = TrySymbolize((void *)&ArmThumbOverlapArm);
+ ABSL_RAW_CHECK(symbol != nullptr, "TestArmThumbOverlap failed");
+ ABSL_RAW_CHECK(strcmp("ArmThumbOverlapArm()", symbol) == 0,
+ "TestArmThumbOverlap failed");
+ std::cout << "TestArmThumbOverlap passed" << std::endl;
#endif
}
+#endif // defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+
#elif defined(_WIN32)
#if !defined(ABSL_CONSUME_DLL)
@@ -519,7 +563,6 @@ TEST(Symbolize, SymbolizeWithDemangling) {
#endif // !defined(ABSL_CONSUME_DLL)
#else // Symbolizer unimplemented
-
TEST(Symbolize, Unimplemented) {
char buf[64];
EXPECT_FALSE(absl::Symbolize((void *)(&nonstatic_func), buf, sizeof(buf)));
@@ -551,6 +594,9 @@ int main(int argc, char **argv) {
TestWithPCInsideInlineFunction();
TestWithPCInsideNonInlineFunction();
TestWithReturnAddress();
+#if defined(__arm__) && ABSL_HAVE_ATTRIBUTE(target)
+ TestArmThumbOverlap();
+#endif
#endif
return RUN_ALL_TESTS();
diff --git a/grpc/third_party/abseil-cpp/absl/flags/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/flags/BUILD.bazel
index 147249ed..d20deab4 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/flags/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -217,6 +216,7 @@ cc_library(
name = "flag",
srcs = [
"flag.cc",
+ "internal/flag_msvc.inc",
],
hdrs = [
"declare.h",
@@ -259,6 +259,7 @@ cc_library(
":reflection",
"//absl/base:config",
"//absl/base:core_headers",
+ "//absl/container:flat_hash_map",
"//absl/strings",
],
)
diff --git a/grpc/third_party/abseil-cpp/absl/flags/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/flags/CMakeLists.txt
index caac69cf..7f3298e9 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/flags/CMakeLists.txt
@@ -202,6 +202,7 @@ absl_cc_library(
HDRS
"declare.h"
"flag.h"
+ "internal/flag_msvc.inc"
COPTS
${ABSL_DEFAULT_COPTS}
LINKOPTS
@@ -239,6 +240,7 @@ absl_cc_library(
absl::flags_private_handle_accessor
absl::flags_program_name
absl::flags_reflection
+ absl::flat_hash_map
absl::strings
absl::synchronization
)
@@ -309,7 +311,7 @@ absl_cc_test(
absl::flags_reflection
absl::memory
absl::strings
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -321,7 +323,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::flags_config
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -341,7 +343,7 @@ absl_cc_test(
absl::flags_reflection
absl::strings
absl::time
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -353,7 +355,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::flags_marshalling
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -372,7 +374,7 @@ absl_cc_test(
absl::scoped_set_env
absl::span
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -384,7 +386,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::flags_path_util
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -397,7 +399,7 @@ absl_cc_test(
DEPS
absl::flags_program_name
absl::strings
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -414,7 +416,7 @@ absl_cc_test(
absl::flags_usage
absl::memory
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -428,7 +430,7 @@ absl_cc_test(
absl::base
absl::flags_internal
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -443,7 +445,7 @@ absl_cc_test(
absl::flags_path_util
absl::flags_program_name
absl::strings
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -462,5 +464,5 @@ absl_cc_test(
absl::flags_reflection
absl::flags_usage
absl::strings
- gtest
+ GTest::gtest
)
diff --git a/grpc/third_party/abseil-cpp/absl/flags/flag.h b/grpc/third_party/abseil-cpp/absl/flags/flag.h
index f09580b0..a724ccc9 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/flag.h
+++ b/grpc/third_party/abseil-cpp/absl/flags/flag.h
@@ -71,101 +71,7 @@ ABSL_NAMESPACE_BEGIN
template <typename T>
using Flag = flags_internal::Flag<T>;
#else
-// MSVC debug builds do not implement initialization with constexpr constructors
-// correctly. To work around this we add a level of indirection, so that the
-// class `absl::Flag` contains an `internal::Flag*` (instead of being an alias
-// to that class) and dynamically allocates an instance when necessary. We also
-// forward all calls to internal::Flag methods via trampoline methods. In this
-// setup the `absl::Flag` class does not have constructor and virtual methods,
-// all the data members are public and thus MSVC is able to initialize it at
-// link time. To deal with multiple threads accessing the flag for the first
-// time concurrently we use an atomic boolean indicating if flag object is
-// initialized. We also employ the double-checked locking pattern where the
-// second level of protection is a global Mutex, so if two threads attempt to
-// construct the flag concurrently only one wins.
-// This solution is based on a recomendation here:
-// https://developercommunity.visualstudio.com/content/problem/336946/class-with-constexpr-constructor-not-using-static.html?childToView=648454#comment-648454
-
-namespace flags_internal {
-absl::Mutex* GetGlobalConstructionGuard();
-} // namespace flags_internal
-
-template <typename T>
-class Flag {
- public:
- // No constructor and destructor to ensure this is an aggregate type.
- // Visual Studio 2015 still requires the constructor for class to be
- // constexpr initializable.
-#if _MSC_VER <= 1900
- constexpr Flag(const char* name, const char* filename,
- const flags_internal::HelpGenFunc help_gen,
- const flags_internal::FlagDfltGenFunc default_value_gen)
- : name_(name),
- filename_(filename),
- help_gen_(help_gen),
- default_value_gen_(default_value_gen),
- inited_(false),
- impl_(nullptr) {}
-#endif
-
- flags_internal::Flag<T>& GetImpl() const {
- if (!inited_.load(std::memory_order_acquire)) {
- absl::MutexLock l(flags_internal::GetGlobalConstructionGuard());
-
- if (inited_.load(std::memory_order_acquire)) {
- return *impl_;
- }
-
- impl_ = new flags_internal::Flag<T>(
- name_, filename_,
- {flags_internal::FlagHelpMsg(help_gen_),
- flags_internal::FlagHelpKind::kGenFunc},
- {flags_internal::FlagDefaultSrc(default_value_gen_),
- flags_internal::FlagDefaultKind::kGenFunc});
- inited_.store(true, std::memory_order_release);
- }
-
- return *impl_;
- }
-
- // Public methods of `absl::Flag<T>` are NOT part of the Abseil Flags API.
- // See https://abseil.io/docs/cpp/guides/flags
- bool IsRetired() const { return GetImpl().IsRetired(); }
- absl::string_view Name() const { return GetImpl().Name(); }
- std::string Help() const { return GetImpl().Help(); }
- bool IsModified() const { return GetImpl().IsModified(); }
- bool IsSpecifiedOnCommandLine() const {
- return GetImpl().IsSpecifiedOnCommandLine();
- }
- std::string Filename() const { return GetImpl().Filename(); }
- std::string DefaultValue() const { return GetImpl().DefaultValue(); }
- std::string CurrentValue() const { return GetImpl().CurrentValue(); }
- template <typename U>
- inline bool IsOfType() const {
- return GetImpl().template IsOfType<U>();
- }
- T Get() const {
- return flags_internal::FlagImplPeer::InvokeGet<T>(GetImpl());
- }
- void Set(const T& v) {
- flags_internal::FlagImplPeer::InvokeSet(GetImpl(), v);
- }
- void InvokeCallback() { GetImpl().InvokeCallback(); }
-
- const CommandLineFlag& Reflect() const {
- return flags_internal::FlagImplPeer::InvokeReflect(GetImpl());
- }
-
- // The data members are logically private, but they need to be public for
- // this to be an aggregate type.
- const char* name_;
- const char* filename_;
- const flags_internal::HelpGenFunc help_gen_;
- const flags_internal::FlagDfltGenFunc default_value_gen_;
-
- mutable std::atomic<bool> inited_;
- mutable flags_internal::Flag<T>* impl_;
-};
+#include "absl/flags/internal/flag_msvc.inc"
#endif
// GetFlag()
@@ -265,6 +171,8 @@ ABSL_NAMESPACE_END
//
// ABSL_FLAG(T, name, default_value, help).OnUpdate(callback);
//
+// `callback` should be convertible to `void (*)()`.
+//
// After any setting of the flag value, the callback will be called at least
// once. A rapid sequence of changes may be merged together into the same
// callback. No concurrent calls to the callback will be made for the same
@@ -279,7 +187,6 @@ ABSL_NAMESPACE_END
// Note: ABSL_FLAG.OnUpdate() does not have a public definition. Hence, this
// comment serves as its API documentation.
-
// -----------------------------------------------------------------------------
// Implementation details below this section
// -----------------------------------------------------------------------------
@@ -334,8 +241,8 @@ ABSL_NAMESPACE_END
/* default value argument. That keeps temporaries alive */ \
/* long enough for NonConst to work correctly. */ \
static constexpr absl::string_view Value( \
- absl::string_view v = ABSL_FLAG_IMPL_FLAGHELP(txt)) { \
- return v; \
+ absl::string_view absl_flag_help = ABSL_FLAG_IMPL_FLAGHELP(txt)) { \
+ return absl_flag_help; \
} \
static std::string NonConst() { return std::string(Value()); } \
}; \
@@ -347,8 +254,8 @@ ABSL_NAMESPACE_END
#define ABSL_FLAG_IMPL_DECLARE_DEF_VAL_WRAPPER(name, Type, default_value) \
struct AbslFlagDefaultGenFor##name { \
Type value = absl::flags_internal::InitDefaultValue<Type>(default_value); \
- static void Gen(void* p) { \
- new (p) Type(AbslFlagDefaultGenFor##name{}.value); \
+ static void Gen(void* absl_flag_default_loc) { \
+ new (absl_flag_default_loc) Type(AbslFlagDefaultGenFor##name{}.value); \
} \
};
diff --git a/grpc/third_party/abseil-cpp/absl/flags/flag_benchmark.cc b/grpc/third_party/abseil-cpp/absl/flags/flag_benchmark.cc
index 57584f85..fc572d9c 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/flag_benchmark.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/flag_benchmark.cc
@@ -101,7 +101,39 @@ std::string AbslUnparseFlag(const UDT&) { return ""; }
A(AbslDuration) \
A(UDT)
-#define FLAG_DEF(T) ABSL_FLAG(T, T##_flag, {}, "");
+#define REPLICATE_0(A, T, name, index) A(T, name, index)
+#define REPLICATE_1(A, T, name, index) \
+ REPLICATE_0(A, T, name, index##0) REPLICATE_0(A, T, name, index##1)
+#define REPLICATE_2(A, T, name, index) \
+ REPLICATE_1(A, T, name, index##0) REPLICATE_1(A, T, name, index##1)
+#define REPLICATE_3(A, T, name, index) \
+ REPLICATE_2(A, T, name, index##0) REPLICATE_2(A, T, name, index##1)
+#define REPLICATE_4(A, T, name, index) \
+ REPLICATE_3(A, T, name, index##0) REPLICATE_3(A, T, name, index##1)
+#define REPLICATE_5(A, T, name, index) \
+ REPLICATE_4(A, T, name, index##0) REPLICATE_4(A, T, name, index##1)
+#define REPLICATE_6(A, T, name, index) \
+ REPLICATE_5(A, T, name, index##0) REPLICATE_5(A, T, name, index##1)
+#define REPLICATE_7(A, T, name, index) \
+ REPLICATE_6(A, T, name, index##0) REPLICATE_6(A, T, name, index##1)
+#define REPLICATE_8(A, T, name, index) \
+ REPLICATE_7(A, T, name, index##0) REPLICATE_7(A, T, name, index##1)
+#define REPLICATE_9(A, T, name, index) \
+ REPLICATE_8(A, T, name, index##0) REPLICATE_8(A, T, name, index##1)
+#if defined(_MSC_VER)
+#define REPLICATE(A, T, name) \
+ REPLICATE_7(A, T, name, 0) REPLICATE_7(A, T, name, 1)
+#define SINGLE_FLAG(T) FLAGS_##T##_flag_00000000
+#else
+#define REPLICATE(A, T, name) \
+ REPLICATE_9(A, T, name, 0) REPLICATE_9(A, T, name, 1)
+#define SINGLE_FLAG(T) FLAGS_##T##_flag_0000000000
+#endif
+#define REPLICATE_ALL(A, T, name) \
+ REPLICATE_9(A, T, name, 0) REPLICATE_9(A, T, name, 1)
+
+#define COUNT(T, name, index) +1
+constexpr size_t kNumFlags = 0 REPLICATE(COUNT, _, _);
#if defined(__clang__) && defined(__linux__)
// Force the flags used for benchmarks into a separate ELF section.
@@ -110,38 +142,87 @@ std::string AbslUnparseFlag(const UDT&) { return ""; }
// benchmark results more reproducible across unrelated code changes.
#pragma clang section data = ".benchmark_flags"
#endif
+#define DEFINE_FLAG(T, name, index) ABSL_FLAG(T, name##_##index, {}, "");
+#define FLAG_DEF(T) REPLICATE(DEFINE_FLAG, T, T##_flag);
BENCHMARKED_TYPES(FLAG_DEF)
#if defined(__clang__) && defined(__linux__)
#pragma clang section data = ""
#endif
// Register thousands of flags to bloat up the size of the registry.
// This mimics real life production binaries.
-#define DEFINE_FLAG_0(name) ABSL_FLAG(int, name, 0, "");
-#define DEFINE_FLAG_1(name) DEFINE_FLAG_0(name##0) DEFINE_FLAG_0(name##1)
-#define DEFINE_FLAG_2(name) DEFINE_FLAG_1(name##0) DEFINE_FLAG_1(name##1)
-#define DEFINE_FLAG_3(name) DEFINE_FLAG_2(name##0) DEFINE_FLAG_2(name##1)
-#define DEFINE_FLAG_4(name) DEFINE_FLAG_3(name##0) DEFINE_FLAG_3(name##1)
-#define DEFINE_FLAG_5(name) DEFINE_FLAG_4(name##0) DEFINE_FLAG_4(name##1)
-#define DEFINE_FLAG_6(name) DEFINE_FLAG_5(name##0) DEFINE_FLAG_5(name##1)
-#define DEFINE_FLAG_7(name) DEFINE_FLAG_6(name##0) DEFINE_FLAG_6(name##1)
-#define DEFINE_FLAG_8(name) DEFINE_FLAG_7(name##0) DEFINE_FLAG_7(name##1)
-#define DEFINE_FLAG_9(name) DEFINE_FLAG_8(name##0) DEFINE_FLAG_8(name##1)
-#define DEFINE_FLAG_10(name) DEFINE_FLAG_9(name##0) DEFINE_FLAG_9(name##1)
-#define DEFINE_FLAG_11(name) DEFINE_FLAG_10(name##0) DEFINE_FLAG_10(name##1)
-#define DEFINE_FLAG_12(name) DEFINE_FLAG_11(name##0) DEFINE_FLAG_11(name##1)
-DEFINE_FLAG_12(bloat_flag_);
+#define BLOAT_FLAG(_unused1, _unused2, index) \
+ ABSL_FLAG(int, bloat_flag_##index, 0, "");
+REPLICATE_ALL(BLOAT_FLAG, _, _)
namespace {
-#define BM_GetFlag(T) \
- void BM_GetFlag_##T(benchmark::State& state) { \
- for (auto _ : state) { \
- benchmark::DoNotOptimize(absl::GetFlag(FLAGS_##T##_flag)); \
- } \
- } \
- BENCHMARK(BM_GetFlag_##T)->ThreadRange(1, 16);
+#define FLAG_PTR(T, name, index) &FLAGS_##name##_##index,
+#define FLAG_PTR_ARR(T) \
+ static constexpr absl::Flag<T>* FlagPtrs_##T[] = { \
+ REPLICATE(FLAG_PTR, T, T##_flag)};
+BENCHMARKED_TYPES(FLAG_PTR_ARR)
+
+#define BM_SingleGetFlag(T) \
+ void BM_SingleGetFlag_##T(benchmark::State& state) { \
+ for (auto _ : state) { \
+ benchmark::DoNotOptimize(absl::GetFlag(SINGLE_FLAG(T))); \
+ } \
+ } \
+ BENCHMARK(BM_SingleGetFlag_##T)->ThreadRange(1, 16);
+
+BENCHMARKED_TYPES(BM_SingleGetFlag)
+
+template <typename T>
+struct Accumulator {
+ using type = T;
+};
+template <>
+struct Accumulator<String> {
+ using type = size_t;
+};
+template <>
+struct Accumulator<VectorOfStrings> {
+ using type = size_t;
+};
+template <>
+struct Accumulator<OptionalInt> {
+ using type = bool;
+};
+template <>
+struct Accumulator<OptionalString> {
+ using type = bool;
+};
+template <>
+struct Accumulator<UDT> {
+ using type = bool;
+};
+
+template <typename T>
+void Accumulate(typename Accumulator<T>::type& a, const T& f) {
+ a += f;
+}
+void Accumulate(bool& a, bool f) { a = a || f; }
+void Accumulate(size_t& a, const std::string& f) { a += f.size(); }
+void Accumulate(size_t& a, const std::vector<std::string>& f) { a += f.size(); }
+void Accumulate(bool& a, const OptionalInt& f) { a |= f.has_value(); }
+void Accumulate(bool& a, const OptionalString& f) { a |= f.has_value(); }
+void Accumulate(bool& a, const UDT& f) {
+ a |= reinterpret_cast<int64_t>(&f) & 0x1;
+}
+
+#define BM_ManyGetFlag(T) \
+ void BM_ManyGetFlag_##T(benchmark::State& state) { \
+ Accumulator<T>::type res = {}; \
+ while (state.KeepRunningBatch(kNumFlags)) { \
+ for (auto* flag_ptr : FlagPtrs_##T) { \
+ Accumulate(res, absl::GetFlag(*flag_ptr)); \
+ } \
+ } \
+ benchmark::DoNotOptimize(res); \
+ } \
+ BENCHMARK(BM_ManyGetFlag_##T)->ThreadRange(1, 8);
-BENCHMARKED_TYPES(BM_GetFlag)
+BENCHMARKED_TYPES(BM_ManyGetFlag)
void BM_ThreadedFindCommandLineFlag(benchmark::State& state) {
char dummy[] = "dummy";
@@ -150,17 +231,18 @@ void BM_ThreadedFindCommandLineFlag(benchmark::State& state) {
// is finalized.
absl::ParseCommandLine(1, argv);
- for (auto s : state) {
- benchmark::DoNotOptimize(
- absl::FindCommandLineFlag("bloat_flag_010101010101"));
+ while (state.KeepRunningBatch(kNumFlags)) {
+ for (auto* flag_ptr : FlagPtrs_bool) {
+ benchmark::DoNotOptimize(absl::FindCommandLineFlag(flag_ptr->Name()));
+ }
}
}
BENCHMARK(BM_ThreadedFindCommandLineFlag)->ThreadRange(1, 16);
} // namespace
-#define InvokeGetFlag(T) \
- T AbslInvokeGetFlag##T() { return absl::GetFlag(FLAGS_##T##_flag); } \
+#define InvokeGetFlag(T) \
+ T AbslInvokeGetFlag##T() { return absl::GetFlag(SINGLE_FLAG(T)); } \
int odr##T = (benchmark::DoNotOptimize(AbslInvokeGetFlag##T), 1);
BENCHMARKED_TYPES(InvokeGetFlag)
diff --git a/grpc/third_party/abseil-cpp/absl/flags/flag_test.cc b/grpc/third_party/abseil-cpp/absl/flags/flag_test.cc
index 6912b546..6e974a5b 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/flag_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/flag_test.cc
@@ -61,6 +61,7 @@ void TestCallback() {}
struct UDT {
UDT() = default;
UDT(const UDT&) = default;
+ UDT& operator=(const UDT&) = default;
};
bool AbslParseFlag(absl::string_view, UDT*, std::string*) { return true; }
std::string AbslUnparseFlag(const UDT&) { return ""; }
@@ -102,9 +103,9 @@ struct S2 {
TEST_F(FlagTest, Traits) {
EXPECT_EQ(flags::StorageKind<int>(),
- flags::FlagValueStorageKind::kOneWordAtomic);
+ flags::FlagValueStorageKind::kValueAndInitBit);
EXPECT_EQ(flags::StorageKind<bool>(),
- flags::FlagValueStorageKind::kOneWordAtomic);
+ flags::FlagValueStorageKind::kValueAndInitBit);
EXPECT_EQ(flags::StorageKind<double>(),
flags::FlagValueStorageKind::kOneWordAtomic);
EXPECT_EQ(flags::StorageKind<int64_t>(),
@@ -723,6 +724,8 @@ ABSL_FLAG(CustomUDT, test_flag_custom_udt, CustomUDT(), "test flag custom UDT");
namespace {
TEST_F(FlagTest, TestCustomUDT) {
+ EXPECT_EQ(flags::StorageKind<CustomUDT>(),
+ flags::FlagValueStorageKind::kOneWordAtomic);
EXPECT_EQ(absl::GetFlag(FLAGS_test_flag_custom_udt), CustomUDT(1, 1));
absl::SetFlag(&FLAGS_test_flag_custom_udt, CustomUDT(2, 3));
EXPECT_EQ(absl::GetFlag(FLAGS_test_flag_custom_udt), CustomUDT(2, 3));
@@ -943,3 +946,34 @@ TEST_F(FlagTest, TestNonTriviallyCopyableUDT) {
}
} // namespace
+
+// --------------------------------------------------------------------
+
+namespace {
+
+enum TestE { A = 1, B = 2, C = 3 };
+
+struct EnumWrapper {
+ EnumWrapper() : e(A) {}
+
+ TestE e;
+};
+
+bool AbslParseFlag(absl::string_view, EnumWrapper*, std::string*) {
+ return true;
+}
+std::string AbslUnparseFlag(const EnumWrapper&) { return ""; }
+
+} // namespace
+
+ABSL_FLAG(EnumWrapper, test_enum_wrapper_flag, {}, "help");
+
+TEST_F(FlagTest, TesTypeWrappingEnum) {
+ EnumWrapper value = absl::GetFlag(FLAGS_test_enum_wrapper_flag);
+ EXPECT_EQ(value.e, A);
+
+ value.e = B;
+ absl::SetFlag(&FLAGS_test_enum_wrapper_flag, value);
+ value = absl::GetFlag(FLAGS_test_enum_wrapper_flag);
+ EXPECT_EQ(value.e, B);
+}
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/flag.cc b/grpc/third_party/abseil-cpp/absl/flags/internal/flag.cc
index f83c1fe7..1515022d 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/internal/flag.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/flag.cc
@@ -145,12 +145,7 @@ void FlagImpl::Init() {
auto def_kind = static_cast<FlagDefaultKind>(def_kind_);
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer:
- // For this storage kind the default_value_ always points to gen_func
- // during initialization.
- assert(def_kind == FlagDefaultKind::kGenFunc);
- (*default_value_.gen_func)(AlignedBufferValue());
- break;
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic: {
alignas(int64_t) std::array<char, sizeof(int64_t)> buf{};
if (def_kind == FlagDefaultKind::kGenFunc) {
@@ -159,6 +154,12 @@ void FlagImpl::Init() {
assert(def_kind != FlagDefaultKind::kDynamicValue);
std::memcpy(buf.data(), &default_value_, Sizeof(op_));
}
+ if (ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit) {
+ // We presume here the memory layout of FlagValueAndInitBit struct.
+ uint8_t initialized = 1;
+ std::memcpy(buf.data() + Sizeof(op_), &initialized,
+ sizeof(initialized));
+ }
OneWordValue().store(absl::bit_cast<int64_t>(buf),
std::memory_order_release);
break;
@@ -170,6 +171,12 @@ void FlagImpl::Init() {
(*default_value_.gen_func)(AtomicBufferValue());
break;
}
+ case FlagValueStorageKind::kAlignedBuffer:
+ // For this storage kind the default_value_ always points to gen_func
+ // during initialization.
+ assert(def_kind == FlagDefaultKind::kGenFunc);
+ (*default_value_.gen_func)(AlignedBufferValue());
+ break;
}
seq_lock_.MarkInitialized();
}
@@ -226,12 +233,10 @@ std::unique_ptr<void, DynValueDeleter> FlagImpl::MakeInitValue() const {
void FlagImpl::StoreValue(const void* src) {
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer:
- Copy(op_, src, AlignedBufferValue());
- seq_lock_.IncrementModificationCount();
- break;
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic: {
- int64_t one_word_val = 0;
+ // Load the current value to avoid setting 'init' bit manualy.
+ int64_t one_word_val = OneWordValue().load(std::memory_order_acquire);
std::memcpy(&one_word_val, src, Sizeof(op_));
OneWordValue().store(one_word_val, std::memory_order_release);
seq_lock_.IncrementModificationCount();
@@ -241,6 +246,10 @@ void FlagImpl::StoreValue(const void* src) {
seq_lock_.Write(AtomicBufferValue(), src, Sizeof(op_));
break;
}
+ case FlagValueStorageKind::kAlignedBuffer:
+ Copy(op_, src, AlignedBufferValue());
+ seq_lock_.IncrementModificationCount();
+ break;
}
modified_ = true;
InvokeCallback();
@@ -280,10 +289,7 @@ std::string FlagImpl::DefaultValue() const {
std::string FlagImpl::CurrentValue() const {
auto* guard = DataGuard(); // Make sure flag initialized
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer: {
- absl::MutexLock l(guard);
- return flags_internal::Unparse(op_, AlignedBufferValue());
- }
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic: {
const auto one_word_val =
absl::bit_cast<std::array<char, sizeof(int64_t)>>(
@@ -296,6 +302,10 @@ std::string FlagImpl::CurrentValue() const {
ReadSequenceLockedData(cloned.get());
return flags_internal::Unparse(op_, cloned.get());
}
+ case FlagValueStorageKind::kAlignedBuffer: {
+ absl::MutexLock l(guard);
+ return flags_internal::Unparse(op_, AlignedBufferValue());
+ }
}
return "";
@@ -341,11 +351,7 @@ std::unique_ptr<FlagStateInterface> FlagImpl::SaveState() {
bool modified = modified_;
bool on_command_line = on_command_line_;
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer: {
- return absl::make_unique<FlagState>(
- *this, flags_internal::Clone(op_, AlignedBufferValue()), modified,
- on_command_line, ModificationCount());
- }
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic: {
return absl::make_unique<FlagState>(
*this, OneWordValue().load(std::memory_order_acquire), modified,
@@ -361,6 +367,11 @@ std::unique_ptr<FlagStateInterface> FlagImpl::SaveState() {
return absl::make_unique<FlagState>(*this, cloned, modified,
on_command_line, ModificationCount());
}
+ case FlagValueStorageKind::kAlignedBuffer: {
+ return absl::make_unique<FlagState>(
+ *this, flags_internal::Clone(op_, AlignedBufferValue()), modified,
+ on_command_line, ModificationCount());
+ }
}
return nullptr;
}
@@ -372,13 +383,14 @@ bool FlagImpl::RestoreState(const FlagState& flag_state) {
}
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer:
- case FlagValueStorageKind::kSequenceLocked:
- StoreValue(flag_state.value_.heap_allocated);
- break;
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic:
StoreValue(&flag_state.value_.one_word);
break;
+ case FlagValueStorageKind::kSequenceLocked:
+ case FlagValueStorageKind::kAlignedBuffer:
+ StoreValue(flag_state.value_.heap_allocated);
+ break;
}
modified_ = flag_state.modified_;
@@ -407,7 +419,8 @@ std::atomic<uint64_t>* FlagImpl::AtomicBufferValue() const {
}
std::atomic<int64_t>& FlagImpl::OneWordValue() const {
- assert(ValueStorageKind() == FlagValueStorageKind::kOneWordAtomic);
+ assert(ValueStorageKind() == FlagValueStorageKind::kOneWordAtomic ||
+ ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
return OffsetValue<FlagOneWordValue>()->value;
}
@@ -433,11 +446,7 @@ std::unique_ptr<void, DynValueDeleter> FlagImpl::TryParse(
void FlagImpl::Read(void* dst) const {
auto* guard = DataGuard(); // Make sure flag initialized
switch (ValueStorageKind()) {
- case FlagValueStorageKind::kAlignedBuffer: {
- absl::MutexLock l(guard);
- flags_internal::CopyConstruct(op_, AlignedBufferValue(), dst);
- break;
- }
+ case FlagValueStorageKind::kValueAndInitBit:
case FlagValueStorageKind::kOneWordAtomic: {
const int64_t one_word_val =
OneWordValue().load(std::memory_order_acquire);
@@ -448,9 +457,31 @@ void FlagImpl::Read(void* dst) const {
ReadSequenceLockedData(dst);
break;
}
+ case FlagValueStorageKind::kAlignedBuffer: {
+ absl::MutexLock l(guard);
+ flags_internal::CopyConstruct(op_, AlignedBufferValue(), dst);
+ break;
+ }
}
}
+int64_t FlagImpl::ReadOneWord() const {
+ assert(ValueStorageKind() == FlagValueStorageKind::kOneWordAtomic ||
+ ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
+ auto* guard = DataGuard(); // Make sure flag initialized
+ (void)guard;
+ return OneWordValue().load(std::memory_order_acquire);
+}
+
+bool FlagImpl::ReadOneBool() const {
+ assert(ValueStorageKind() == FlagValueStorageKind::kValueAndInitBit);
+ auto* guard = DataGuard(); // Make sure flag initialized
+ (void)guard;
+ return absl::bit_cast<FlagValueAndInitBit<bool>>(
+ OneWordValue().load(std::memory_order_acquire))
+ .value;
+}
+
void FlagImpl::ReadSequenceLockedData(void* dst) const {
int size = Sizeof(op_);
// Attempt to read using the sequence lock.
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/flag.h b/grpc/third_party/abseil-cpp/absl/flags/internal/flag.h
index e6bade0a..124a2f1c 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/internal/flag.h
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/flag.h
@@ -29,6 +29,7 @@
#include "absl/base/attributes.h"
#include "absl/base/call_once.h"
+#include "absl/base/casts.h"
#include "absl/base/config.h"
#include "absl/base/optimization.h"
#include "absl/base/thread_annotations.h"
@@ -289,7 +290,7 @@ constexpr T InitDefaultValue(EmptyBraces) {
template <typename ValueT, typename GenT,
typename std::enable_if<std::is_integral<ValueT>::value, int>::type =
- (GenT{}, 0)>
+ ((void)GenT{}, 0)>
constexpr FlagDefaultArg DefaultArg(int) {
return {FlagDefaultSrc(GenT{}.value), FlagDefaultKind::kOneWord};
}
@@ -305,48 +306,71 @@ constexpr FlagDefaultArg DefaultArg(char) {
constexpr int64_t UninitializedFlagValue() { return 0xababababababababll; }
template <typename T>
+using FlagUseValueAndInitBitStorage = std::integral_constant<
+ bool, absl::type_traits_internal::is_trivially_copyable<T>::value &&
+ std::is_default_constructible<T>::value && (sizeof(T) < 8)>;
+
+template <typename T>
using FlagUseOneWordStorage = std::integral_constant<
bool, absl::type_traits_internal::is_trivially_copyable<T>::value &&
(sizeof(T) <= 8)>;
template <class T>
-using FlagShouldUseSequenceLock = std::integral_constant<
+using FlagUseSequenceLockStorage = std::integral_constant<
bool, absl::type_traits_internal::is_trivially_copyable<T>::value &&
(sizeof(T) > 8)>;
enum class FlagValueStorageKind : uint8_t {
- kAlignedBuffer = 0,
+ kValueAndInitBit = 0,
kOneWordAtomic = 1,
kSequenceLocked = 2,
+ kAlignedBuffer = 3,
};
template <typename T>
static constexpr FlagValueStorageKind StorageKind() {
- return FlagUseOneWordStorage<T>::value ? FlagValueStorageKind::kOneWordAtomic
- : FlagShouldUseSequenceLock<T>::value
+ return FlagUseValueAndInitBitStorage<T>::value
+ ? FlagValueStorageKind::kValueAndInitBit
+ : FlagUseOneWordStorage<T>::value
+ ? FlagValueStorageKind::kOneWordAtomic
+ : FlagUseSequenceLockStorage<T>::value
? FlagValueStorageKind::kSequenceLocked
: FlagValueStorageKind::kAlignedBuffer;
}
struct FlagOneWordValue {
- constexpr FlagOneWordValue() : value(UninitializedFlagValue()) {}
-
+ constexpr explicit FlagOneWordValue(int64_t v) : value(v) {}
std::atomic<int64_t> value;
};
+template <typename T>
+struct alignas(8) FlagValueAndInitBit {
+ T value;
+ // Use an int instead of a bool to guarantee that a non-zero value has
+ // a bit set.
+ uint8_t init;
+};
+
template <typename T,
FlagValueStorageKind Kind = flags_internal::StorageKind<T>()>
struct FlagValue;
template <typename T>
-struct FlagValue<T, FlagValueStorageKind::kAlignedBuffer> {
- bool Get(const SequenceLock&, T&) const { return false; }
-
- alignas(T) char value[sizeof(T)];
+struct FlagValue<T, FlagValueStorageKind::kValueAndInitBit> : FlagOneWordValue {
+ constexpr FlagValue() : FlagOneWordValue(0) {}
+ bool Get(const SequenceLock&, T& dst) const {
+ int64_t storage = value.load(std::memory_order_acquire);
+ if (ABSL_PREDICT_FALSE(storage == 0)) {
+ return false;
+ }
+ dst = absl::bit_cast<FlagValueAndInitBit<T>>(storage).value;
+ return true;
+ }
};
template <typename T>
struct FlagValue<T, FlagValueStorageKind::kOneWordAtomic> : FlagOneWordValue {
+ constexpr FlagValue() : FlagOneWordValue(UninitializedFlagValue()) {}
bool Get(const SequenceLock&, T& dst) const {
int64_t one_word_val = value.load(std::memory_order_acquire);
if (ABSL_PREDICT_FALSE(one_word_val == UninitializedFlagValue())) {
@@ -370,6 +394,13 @@ struct FlagValue<T, FlagValueStorageKind::kSequenceLocked> {
std::atomic<uint64_t>) std::atomic<uint64_t> value_words[kNumWords];
};
+template <typename T>
+struct FlagValue<T, FlagValueStorageKind::kAlignedBuffer> {
+ bool Get(const SequenceLock&, T&) const { return false; }
+
+ alignas(T) char value[sizeof(T)];
+};
+
///////////////////////////////////////////////////////////////////////////////
// Flag callback auxiliary structs.
@@ -415,7 +446,27 @@ class FlagImpl final : public CommandLineFlag {
data_guard_{} {}
// Constant access methods
+ int64_t ReadOneWord() const ABSL_LOCKS_EXCLUDED(*DataGuard());
+ bool ReadOneBool() const ABSL_LOCKS_EXCLUDED(*DataGuard());
void Read(void* dst) const override ABSL_LOCKS_EXCLUDED(*DataGuard());
+ void Read(bool* value) const ABSL_LOCKS_EXCLUDED(*DataGuard()) {
+ *value = ReadOneBool();
+ }
+ template <typename T,
+ absl::enable_if_t<flags_internal::StorageKind<T>() ==
+ FlagValueStorageKind::kOneWordAtomic,
+ int> = 0>
+ void Read(T* value) const ABSL_LOCKS_EXCLUDED(*DataGuard()) {
+ int64_t v = ReadOneWord();
+ std::memcpy(value, static_cast<const void*>(&v), sizeof(T));
+ }
+ template <typename T,
+ typename std::enable_if<flags_internal::StorageKind<T>() ==
+ FlagValueStorageKind::kValueAndInitBit,
+ int>::type = 0>
+ void Read(T* value) const ABSL_LOCKS_EXCLUDED(*DataGuard()) {
+ *value = absl::bit_cast<FlagValueAndInitBit<T>>(ReadOneWord()).value;
+ }
// Mutating access methods
void Write(const void* src) ABSL_LOCKS_EXCLUDED(*DataGuard());
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc b/grpc/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc
new file mode 100644
index 00000000..c31bd27f
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc
@@ -0,0 +1,116 @@
+//
+// Copyright 2021 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Do not include this file directly.
+// Include absl/flags/flag.h instead.
+
+// MSVC debug builds do not implement initialization with constexpr constructors
+// correctly. To work around this we add a level of indirection, so that the
+// class `absl::Flag` contains an `internal::Flag*` (instead of being an alias
+// to that class) and dynamically allocates an instance when necessary. We also
+// forward all calls to internal::Flag methods via trampoline methods. In this
+// setup the `absl::Flag` class does not have constructor and virtual methods,
+// all the data members are public and thus MSVC is able to initialize it at
+// link time. To deal with multiple threads accessing the flag for the first
+// time concurrently we use an atomic boolean indicating if flag object is
+// initialized. We also employ the double-checked locking pattern where the
+// second level of protection is a global Mutex, so if two threads attempt to
+// construct the flag concurrently only one wins.
+//
+// This solution is based on a recomendation here:
+// https://developercommunity.visualstudio.com/content/problem/336946/class-with-constexpr-constructor-not-using-static.html?childToView=648454#comment-648454
+
+namespace flags_internal {
+absl::Mutex* GetGlobalConstructionGuard();
+} // namespace flags_internal
+
+// Public methods of `absl::Flag<T>` are NOT part of the Abseil Flags API.
+// See https://abseil.io/docs/cpp/guides/flags
+template <typename T>
+class Flag {
+ public:
+ // No constructor and destructor to ensure this is an aggregate type.
+ // Visual Studio 2015 still requires the constructor for class to be
+ // constexpr initializable.
+#if _MSC_VER <= 1900
+ constexpr Flag(const char* name, const char* filename,
+ const flags_internal::HelpGenFunc help_gen,
+ const flags_internal::FlagDfltGenFunc default_value_gen)
+ : name_(name),
+ filename_(filename),
+ help_gen_(help_gen),
+ default_value_gen_(default_value_gen),
+ inited_(false),
+ impl_(nullptr) {}
+#endif
+
+ flags_internal::Flag<T>& GetImpl() const {
+ if (!inited_.load(std::memory_order_acquire)) {
+ absl::MutexLock l(flags_internal::GetGlobalConstructionGuard());
+
+ if (inited_.load(std::memory_order_acquire)) {
+ return *impl_;
+ }
+
+ impl_ = new flags_internal::Flag<T>(
+ name_, filename_,
+ {flags_internal::FlagHelpMsg(help_gen_),
+ flags_internal::FlagHelpKind::kGenFunc},
+ {flags_internal::FlagDefaultSrc(default_value_gen_),
+ flags_internal::FlagDefaultKind::kGenFunc});
+ inited_.store(true, std::memory_order_release);
+ }
+
+ return *impl_;
+ }
+
+ // Public methods of `absl::Flag<T>` are NOT part of the Abseil Flags API.
+ // See https://abseil.io/docs/cpp/guides/flags
+ bool IsRetired() const { return GetImpl().IsRetired(); }
+ absl::string_view Name() const { return GetImpl().Name(); }
+ std::string Help() const { return GetImpl().Help(); }
+ bool IsModified() const { return GetImpl().IsModified(); }
+ bool IsSpecifiedOnCommandLine() const {
+ return GetImpl().IsSpecifiedOnCommandLine();
+ }
+ std::string Filename() const { return GetImpl().Filename(); }
+ std::string DefaultValue() const { return GetImpl().DefaultValue(); }
+ std::string CurrentValue() const { return GetImpl().CurrentValue(); }
+ template <typename U>
+ inline bool IsOfType() const {
+ return GetImpl().template IsOfType<U>();
+ }
+ T Get() const {
+ return flags_internal::FlagImplPeer::InvokeGet<T>(GetImpl());
+ }
+ void Set(const T& v) {
+ flags_internal::FlagImplPeer::InvokeSet(GetImpl(), v);
+ }
+ void InvokeCallback() { GetImpl().InvokeCallback(); }
+
+ const CommandLineFlag& Reflect() const {
+ return flags_internal::FlagImplPeer::InvokeReflect(GetImpl());
+ }
+
+ // The data members are logically private, but they need to be public for
+ // this to be an aggregate type.
+ const char* name_;
+ const char* filename_;
+ const flags_internal::HelpGenFunc help_gen_;
+ const flags_internal::FlagDfltGenFunc default_value_gen_;
+
+ mutable std::atomic<bool> inited_;
+ mutable flags_internal::Flag<T>* impl_;
+};
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h b/grpc/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h
index 807b2a73..36318ab9 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/sequence_lock.h
@@ -49,7 +49,7 @@ inline constexpr size_t AlignUp(size_t x, size_t align) {
// The memory reads and writes protected by this lock must use the provided
// `TryRead()` and `Write()` functions. These functions behave similarly to
// `memcpy()`, with one oddity: the protected data must be an array of
-// `std::atomic<int64>`. This is to comply with the C++ standard, which
+// `std::atomic<uint64>`. This is to comply with the C++ standard, which
// considers data races on non-atomic objects to be undefined behavior. See "Can
// Seqlocks Get Along With Programming Language Memory Models?"[1] by Hans J.
// Boehm for more details.
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/usage.cc b/grpc/third_party/abseil-cpp/absl/flags/internal/usage.cc
index a588c7f7..949709e8 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/internal/usage.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/usage.cc
@@ -245,7 +245,7 @@ void FlagsHelpImpl(std::ostream& out, PerFlagFilter filter_cb,
<< XMLElement("usage", program_usage_message) << '\n';
}
- // Map of package name to
+ // Ordered map of package name to
// map of file name to
// vector of flags in the file.
// This map is used to output matching flags grouped by package and file
@@ -273,20 +273,26 @@ void FlagsHelpImpl(std::ostream& out, PerFlagFilter filter_cb,
absl::string_view package_separator; // controls blank lines between packages
absl::string_view file_separator; // controls blank lines between files
- for (const auto& package : matching_flags) {
+ for (auto& package : matching_flags) {
if (format == HelpFormat::kHumanReadable) {
out << package_separator;
package_separator = "\n\n";
}
file_separator = "";
- for (const auto& flags_in_file : package.second) {
+ for (auto& flags_in_file : package.second) {
if (format == HelpFormat::kHumanReadable) {
out << file_separator << " Flags from " << flags_in_file.first
<< ":\n";
file_separator = "\n";
}
+ std::sort(std::begin(flags_in_file.second),
+ std::end(flags_in_file.second),
+ [](const CommandLineFlag* lhs, const CommandLineFlag* rhs) {
+ return lhs->Name() < rhs->Name();
+ });
+
for (const auto* flag : flags_in_file.second) {
flags_internal::FlagHelp(out, *flag, format);
}
diff --git a/grpc/third_party/abseil-cpp/absl/flags/internal/usage_test.cc b/grpc/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
index b5c2487d..044d71c8 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/internal/usage_test.cc
@@ -45,6 +45,7 @@ static const char kTestUsageMessage[] = "Custom usage message";
struct UDT {
UDT() = default;
UDT(const UDT&) = default;
+ UDT& operator=(const UDT&) = default;
};
bool AbslParseFlag(absl::string_view, UDT*, std::string*) { return true; }
std::string AbslUnparseFlag(const UDT&) { return "UDT{}"; }
diff --git a/grpc/third_party/abseil-cpp/absl/flags/parse_test.cc b/grpc/third_party/abseil-cpp/absl/flags/parse_test.cc
index 41bc0bc6..8dc91db2 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/parse_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/parse_test.cc
@@ -46,6 +46,7 @@ using absl::base_internal::ScopedSetEnv;
struct UDT {
UDT() = default;
UDT(const UDT&) = default;
+ UDT& operator=(const UDT&) = default;
UDT(int v) : value(v) {} // NOLINT
int value;
diff --git a/grpc/third_party/abseil-cpp/absl/flags/reflection.cc b/grpc/third_party/abseil-cpp/absl/flags/reflection.cc
index 0c761101..dbce4032 100644
--- a/grpc/third_party/abseil-cpp/absl/flags/reflection.cc
+++ b/grpc/third_party/abseil-cpp/absl/flags/reflection.cc
@@ -18,11 +18,11 @@
#include <assert.h>
#include <atomic>
-#include <map>
#include <string>
#include "absl/base/config.h"
#include "absl/base/thread_annotations.h"
+#include "absl/container/flat_hash_map.h"
#include "absl/flags/commandlineflag.h"
#include "absl/flags/internal/private_handle_accessor.h"
#include "absl/flags/internal/registry.h"
@@ -68,7 +68,7 @@ class FlagRegistry {
friend void FinalizeRegistry();
// The map from name to flag, for FindFlag().
- using FlagMap = std::map<absl::string_view, CommandLineFlag*>;
+ using FlagMap = absl::flat_hash_map<absl::string_view, CommandLineFlag*>;
using FlagIterator = FlagMap::iterator;
using FlagConstIterator = FlagMap::const_iterator;
FlagMap flags_;
@@ -204,6 +204,10 @@ void FinalizeRegistry() {
for (const auto& f : registry.flags_) {
registry.flat_flags_.push_back(f.second);
}
+ std::sort(std::begin(registry.flat_flags_), std::end(registry.flat_flags_),
+ [](const CommandLineFlag* lhs, const CommandLineFlag* rhs) {
+ return lhs->Name() < rhs->Name();
+ });
registry.flags_.clear();
registry.finalized_flags_.store(true, std::memory_order_release);
}
diff --git a/grpc/third_party/abseil-cpp/absl/functional/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/functional/BUILD.bazel
index ebd9b99b..f9f2b9c2 100644
--- a/grpc/third_party/abseil-cpp/absl/functional/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/functional/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -60,6 +59,7 @@ cc_library(
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
"//absl/base:base_internal",
+ "//absl/base:core_headers",
"//absl/meta:type_traits",
],
)
diff --git a/grpc/third_party/abseil-cpp/absl/functional/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/functional/CMakeLists.txt
index cda914f2..338ddc6c 100644
--- a/grpc/third_party/abseil-cpp/absl/functional/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/functional/CMakeLists.txt
@@ -39,7 +39,7 @@ absl_cc_test(
DEPS
absl::bind_front
absl::memory
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -53,6 +53,7 @@ absl_cc_library(
${ABSL_DEFAULT_COPTS}
DEPS
absl::base_internal
+ absl::core_headers
absl::meta
PUBLIC
)
@@ -68,5 +69,5 @@ absl_cc_test(
absl::function_ref
absl::memory
absl::test_instance_tracker
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/functional/function_ref.h b/grpc/third_party/abseil-cpp/absl/functional/function_ref.h
index 6e03ac2e..824e3cea 100644
--- a/grpc/third_party/abseil-cpp/absl/functional/function_ref.h
+++ b/grpc/third_party/abseil-cpp/absl/functional/function_ref.h
@@ -50,6 +50,7 @@
#include <functional>
#include <type_traits>
+#include "absl/base/attributes.h"
#include "absl/functional/internal/function_ref.h"
#include "absl/meta/type_traits.h"
@@ -98,7 +99,8 @@ class FunctionRef<R(Args...)> {
public:
// Constructs a FunctionRef from any invokable type.
template <typename F, typename = EnableIfCompatible<const F&>>
- FunctionRef(const F& f) // NOLINT(runtime/explicit)
+ // NOLINTNEXTLINE(runtime/explicit)
+ FunctionRef(const F& f ABSL_ATTRIBUTE_LIFETIME_BOUND)
: invoker_(&absl::functional_internal::InvokeObject<F, R, Args...>) {
absl::functional_internal::AssertNonNull(f);
ptr_.obj = &f;
@@ -122,6 +124,7 @@ class FunctionRef<R(Args...)> {
// To help prevent subtle lifetime bugs, FunctionRef is not assignable.
// Typically, it should only be used as an argument type.
FunctionRef& operator=(const FunctionRef& rhs) = delete;
+ FunctionRef(const FunctionRef& rhs) = default;
// Call the underlying object.
R operator()(Args... args) const {
diff --git a/grpc/third_party/abseil-cpp/absl/hash/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/hash/BUILD.bazel
index 4b2c220f..f0640d34 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/hash/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -37,7 +36,7 @@ cc_library(
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
":city",
- ":wyhash",
+ ":low_level_hash",
"//absl/base:config",
"//absl/base:core_headers",
"//absl/base:endian",
@@ -143,27 +142,28 @@ cc_test(
)
cc_library(
- name = "wyhash",
- srcs = ["internal/wyhash.cc"],
- hdrs = ["internal/wyhash.h"],
+ name = "low_level_hash",
+ srcs = ["internal/low_level_hash.cc"],
+ hdrs = ["internal/low_level_hash.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//visibility:private"],
deps = [
"//absl/base:config",
"//absl/base:endian",
+ "//absl/numeric:bits",
"//absl/numeric:int128",
],
)
cc_test(
- name = "wyhash_test",
- srcs = ["internal/wyhash_test.cc"],
+ name = "low_level_hash_test",
+ srcs = ["internal/low_level_hash_test.cc"],
copts = ABSL_TEST_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//visibility:private"],
deps = [
- ":wyhash",
+ ":low_level_hash",
"//absl/strings",
"@com_google_googletest//:gtest_main",
],
diff --git a/grpc/third_party/abseil-cpp/absl/hash/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/hash/CMakeLists.txt
index b43bfa54..5916ae3c 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/hash/CMakeLists.txt
@@ -36,7 +36,7 @@ absl_cc_library(
absl::optional
absl::variant
absl::utility
- absl::wyhash
+ absl::low_level_hash
PUBLIC
)
@@ -52,7 +52,7 @@ absl_cc_library(
absl::meta
absl::strings
absl::variant
- gmock
+ GTest::gmock
TESTONLY
)
@@ -72,7 +72,7 @@ absl_cc_test(
absl::spy_hash_state
absl::meta
absl::int128
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -113,19 +113,20 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::city
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
NAME
- wyhash
+ low_level_hash
HDRS
- "internal/wyhash.h"
+ "internal/low_level_hash.h"
SRCS
- "internal/wyhash.cc"
+ "internal/low_level_hash.cc"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
+ absl::bits
absl::config
absl::endian
absl::int128
@@ -133,13 +134,13 @@ absl_cc_library(
absl_cc_test(
NAME
- wyhash_test
+ low_level_hash_test
SRCS
- "internal/wyhash_test.cc"
+ "internal/low_level_hash_test.cc"
COPTS
${ABSL_TEST_COPTS}
DEPS
- absl::wyhash
+ absl::low_level_hash
absl::strings
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/hash/hash.h b/grpc/third_party/abseil-cpp/absl/hash/hash.h
index 5de132ca..8282ea53 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/hash.h
+++ b/grpc/third_party/abseil-cpp/absl/hash/hash.h
@@ -73,6 +73,8 @@
#ifndef ABSL_HASH_HASH_H_
#define ABSL_HASH_HASH_H_
+#include <tuple>
+
#include "absl/hash/internal/hash.h"
namespace absl {
@@ -214,6 +216,26 @@ ABSL_NAMESPACE_BEGIN
template <typename T>
using Hash = absl::hash_internal::Hash<T>;
+// HashOf
+//
+// absl::HashOf() is a helper that generates a hash from the values of its
+// arguments. It dispatches to absl::Hash directly, as follows:
+// * HashOf(t) == absl::Hash<T>{}(t)
+// * HashOf(a, b, c) == HashOf(std::make_tuple(a, b, c))
+//
+// HashOf(a1, a2, ...) == HashOf(b1, b2, ...) is guaranteed when
+// * The argument lists have pairwise identical C++ types
+// * a1 == b1 && a2 == b2 && ...
+//
+// The requirement that the arguments match in both type and value is critical.
+// It means that `a == b` does not necessarily imply `HashOf(a) == HashOf(b)` if
+// `a` and `b` have different types. For example, `HashOf(2) != HashOf(2.0)`.
+template <int&... ExplicitArgumentBarrier, typename... Types>
+size_t HashOf(const Types&... values) {
+ auto tuple = std::tie(values...);
+ return absl::Hash<decltype(tuple)>{}(tuple);
+}
+
// HashState
//
// A type erased version of the hash state concept, for use in user-defined
diff --git a/grpc/third_party/abseil-cpp/absl/hash/hash_test.cc b/grpc/third_party/abseil-cpp/absl/hash/hash_test.cc
index 1d2e6cf0..b3ddebdd 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/hash_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/hash/hash_test.cc
@@ -973,4 +973,39 @@ TEST(HashTest, DoesNotUseImplicitConversionsToBool) {
absl::Hash<ValueWithBoolConversion>()(ValueWithBoolConversion{1}));
}
+TEST(HashOf, MatchesHashForSingleArgument) {
+ std::string s = "forty two";
+ int i = 42;
+ double d = 42.0;
+ std::tuple<int, int> t{4, 2};
+
+ EXPECT_EQ(absl::HashOf(s), absl::Hash<std::string>{}(s));
+ EXPECT_EQ(absl::HashOf(i), absl::Hash<int>{}(i));
+ EXPECT_EQ(absl::HashOf(d), absl::Hash<double>{}(d));
+ EXPECT_EQ(absl::HashOf(t), (absl::Hash<std::tuple<int, int>>{}(t)));
+}
+
+TEST(HashOf, MatchesHashOfTupleForMultipleArguments) {
+ std::string hello = "hello";
+ std::string world = "world";
+
+ EXPECT_EQ(absl::HashOf(), absl::HashOf(std::make_tuple()));
+ EXPECT_EQ(absl::HashOf(hello), absl::HashOf(std::make_tuple(hello)));
+ EXPECT_EQ(absl::HashOf(hello, world),
+ absl::HashOf(std::make_tuple(hello, world)));
+}
+
+template <typename T>
+std::true_type HashOfExplicitParameter(decltype(absl::HashOf<T>(0))) {
+ return {};
+}
+template <typename T>
+std::false_type HashOfExplicitParameter(size_t) {
+ return {};
+}
+
+TEST(HashOf, CantPassExplicitTemplateParameters) {
+ EXPECT_FALSE(HashOfExplicitParameter<int>(0));
+}
+
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/hash.cc b/grpc/third_party/abseil-cpp/absl/hash/internal/hash.cc
index 1433eb9d..11451e57 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/internal/hash.cc
+++ b/grpc/third_party/abseil-cpp/absl/hash/internal/hash.cc
@@ -18,13 +18,12 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace hash_internal {
-uint64_t HashState::CombineLargeContiguousImpl32(uint64_t state,
- const unsigned char* first,
- size_t len) {
+uint64_t MixingHashState::CombineLargeContiguousImpl32(
+ uint64_t state, const unsigned char* first, size_t len) {
while (len >= PiecewiseChunkSize()) {
- state =
- Mix(state, absl::hash_internal::CityHash32(reinterpret_cast<const char*>(first),
- PiecewiseChunkSize()));
+ state = Mix(state,
+ hash_internal::CityHash32(reinterpret_cast<const char*>(first),
+ PiecewiseChunkSize()));
len -= PiecewiseChunkSize();
first += PiecewiseChunkSize();
}
@@ -33,9 +32,8 @@ uint64_t HashState::CombineLargeContiguousImpl32(uint64_t state,
std::integral_constant<int, 4>{});
}
-uint64_t HashState::CombineLargeContiguousImpl64(uint64_t state,
- const unsigned char* first,
- size_t len) {
+uint64_t MixingHashState::CombineLargeContiguousImpl64(
+ uint64_t state, const unsigned char* first, size_t len) {
while (len >= PiecewiseChunkSize()) {
state = Mix(state, Hash64(first, PiecewiseChunkSize()));
len -= PiecewiseChunkSize();
@@ -46,23 +44,24 @@ uint64_t HashState::CombineLargeContiguousImpl64(uint64_t state,
std::integral_constant<int, 8>{});
}
-ABSL_CONST_INIT const void* const HashState::kSeed = &kSeed;
+ABSL_CONST_INIT const void* const MixingHashState::kSeed = &kSeed;
-// The salt array used by Wyhash. This array is NOT the mechanism used to make
-// absl::Hash non-deterministic between program invocations. See `Seed()` for
-// that mechanism.
+// The salt array used by LowLevelHash. This array is NOT the mechanism used to
+// make absl::Hash non-deterministic between program invocations. See `Seed()`
+// for that mechanism.
//
// Any random values are fine. These values are just digits from the decimal
// part of pi.
// https://en.wikipedia.org/wiki/Nothing-up-my-sleeve_number
-constexpr uint64_t kWyhashSalt[5] = {
+constexpr uint64_t kHashSalt[5] = {
uint64_t{0x243F6A8885A308D3}, uint64_t{0x13198A2E03707344},
uint64_t{0xA4093822299F31D0}, uint64_t{0x082EFA98EC4E6C89},
uint64_t{0x452821E638D01377},
};
-uint64_t HashState::WyhashImpl(const unsigned char* data, size_t len) {
- return Wyhash(data, len, Seed(), kWyhashSalt);
+uint64_t MixingHashState::LowLevelHashImpl(const unsigned char* data,
+ size_t len) {
+ return LowLevelHash(data, len, Seed(), kHashSalt);
}
} // namespace hash_internal
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/hash.h b/grpc/third_party/abseil-cpp/absl/hash/internal/hash.h
index 7fb0af0b..b1e33caf 100644
--- a/grpc/third_party/abseil-cpp/absl/hash/internal/hash.h
+++ b/grpc/third_party/abseil-cpp/absl/hash/internal/hash.h
@@ -21,6 +21,7 @@
#include <algorithm>
#include <array>
+#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
@@ -42,14 +43,14 @@
#include "absl/base/internal/unaligned_access.h"
#include "absl/base/port.h"
#include "absl/container/fixed_array.h"
-#include "absl/hash/internal/wyhash.h"
+#include "absl/hash/internal/city.h"
+#include "absl/hash/internal/low_level_hash.h"
#include "absl/meta/type_traits.h"
#include "absl/numeric/int128.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
#include "absl/utility/utility.h"
-#include "absl/hash/internal/city.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
@@ -379,7 +380,7 @@ template <typename H, typename... Ts>
// This SFINAE gets MSVC confused under some conditions. Let's just disable it
// for now.
H
-#else // _MSC_VER
+#else // _MSC_VER
typename std::enable_if<absl::conjunction<is_hashable<Ts>...>::value, H>::type
#endif // _MSC_VER
AbslHashValue(H hash_state, const std::tuple<Ts...>& t) {
@@ -489,8 +490,9 @@ typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
// AbslHashValue for hashing std::vector
//
-// Do not use this for vector<bool>. It does not have a .data(), and a fallback
-// for std::hash<> is most likely faster.
+// Do not use this for vector<bool> on platforms that have a working
+// implementation of std::hash. It does not have a .data(), and a fallback for
+// std::hash<> is most likely faster.
template <typename H, typename T, typename Allocator>
typename std::enable_if<is_hashable<T>::value && !std::is_same<T, bool>::value,
H>::type
@@ -500,6 +502,27 @@ AbslHashValue(H hash_state, const std::vector<T, Allocator>& vector) {
vector.size());
}
+#if defined(ABSL_IS_BIG_ENDIAN) && \
+ (defined(__GLIBCXX__) || defined(__GLIBCPP__))
+// AbslHashValue for hashing std::vector<bool>
+//
+// std::hash in libstdc++ does not work correctly with vector<bool> on Big
+// Endian platforms therefore we need to implement a custom AbslHashValue for
+// it. More details on the bug:
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531
+template <typename H, typename T, typename Allocator>
+typename std::enable_if<is_hashable<T>::value && std::is_same<T, bool>::value,
+ H>::type
+AbslHashValue(H hash_state, const std::vector<T, Allocator>& vector) {
+ typename H::AbslInternalPiecewiseCombiner combiner;
+ for (const auto& i : vector) {
+ unsigned char c = static_cast<unsigned char>(i);
+ hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
+ }
+ return H::combine(combiner.finalize(std::move(hash_state)), vector.size());
+}
+#endif
+
// -----------------------------------------------------------------------------
// AbslHashValue for Ordered Associative Containers
// -----------------------------------------------------------------------------
@@ -592,9 +615,28 @@ AbslHashValue(H hash_state, const absl::variant<T...>& v) {
// AbslHashValue for Other Types
// -----------------------------------------------------------------------------
-// AbslHashValue for hashing std::bitset is not defined, for the same reason as
-// for vector<bool> (see std::vector above): It does not expose the raw bytes,
-// and a fallback to std::hash<> is most likely faster.
+// AbslHashValue for hashing std::bitset is not defined on Little Endian
+// platforms, for the same reason as for vector<bool> (see std::vector above):
+// It does not expose the raw bytes, and a fallback to std::hash<> is most
+// likely faster.
+
+#if defined(ABSL_IS_BIG_ENDIAN) && \
+ (defined(__GLIBCXX__) || defined(__GLIBCPP__))
+// AbslHashValue for hashing std::bitset
+//
+// std::hash in libstdc++ does not work correctly with std::bitset on Big Endian
+// platforms therefore we need to implement a custom AbslHashValue for it. More
+// details on the bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102531
+template <typename H, size_t N>
+H AbslHashValue(H hash_state, const std::bitset<N>& set) {
+ typename H::AbslInternalPiecewiseCombiner combiner;
+ for (int i = 0; i < N; i++) {
+ unsigned char c = static_cast<unsigned char>(set[i]);
+ hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
+ }
+ return H::combine(combiner.finalize(std::move(hash_state)), N);
+}
+#endif
// -----------------------------------------------------------------------------
@@ -714,8 +756,8 @@ template <typename T>
struct is_hashable
: std::integral_constant<bool, HashSelect::template Apply<T>::value> {};
-// HashState
-class ABSL_DLL HashState : public HashStateBase<HashState> {
+// MixingHashState
+class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
// absl::uint128 is not an alias or a thin wrapper around the intrinsic.
// We use the intrinsic when available to improve performance.
#ifdef ABSL_HAVE_INTRINSIC_INT128
@@ -734,22 +776,23 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
public:
// Move only
- HashState(HashState&&) = default;
- HashState& operator=(HashState&&) = default;
+ MixingHashState(MixingHashState&&) = default;
+ MixingHashState& operator=(MixingHashState&&) = default;
- // HashState::combine_contiguous()
+ // MixingHashState::combine_contiguous()
//
// Fundamental base case for hash recursion: mixes the given range of bytes
// into the hash state.
- static HashState combine_contiguous(HashState hash_state,
- const unsigned char* first, size_t size) {
- return HashState(
+ static MixingHashState combine_contiguous(MixingHashState hash_state,
+ const unsigned char* first,
+ size_t size) {
+ return MixingHashState(
CombineContiguousImpl(hash_state.state_, first, size,
std::integral_constant<int, sizeof(size_t)>{}));
}
- using HashState::HashStateBase::combine_contiguous;
+ using MixingHashState::HashStateBase::combine_contiguous;
- // HashState::hash()
+ // MixingHashState::hash()
//
// For performance reasons in non-opt mode, we specialize this for
// integral types.
@@ -761,24 +804,24 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
return static_cast<size_t>(Mix(Seed(), static_cast<uint64_t>(value)));
}
- // Overload of HashState::hash()
+ // Overload of MixingHashState::hash()
template <typename T, absl::enable_if_t<!IntegralFastPath<T>::value, int> = 0>
static size_t hash(const T& value) {
- return static_cast<size_t>(combine(HashState{}, value).state_);
+ return static_cast<size_t>(combine(MixingHashState{}, value).state_);
}
private:
// Invoked only once for a given argument; that plus the fact that this is
// move-only ensures that there is only one non-moved-from object.
- HashState() : state_(Seed()) {}
+ MixingHashState() : state_(Seed()) {}
// Workaround for MSVC bug.
// We make the type copyable to fix the calling convention, even though we
// never actually copy it. Keep it private to not affect the public API of the
// type.
- HashState(const HashState&) = default;
+ MixingHashState(const MixingHashState&) = default;
- explicit HashState(uint64_t state) : state_(state) {}
+ explicit MixingHashState(uint64_t state) : state_(state) {}
// Implementation of the base case for combine_contiguous where we actually
// mix the bytes into the state.
@@ -793,7 +836,6 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
std::integral_constant<int, 8>
/* sizeof_size_t */);
-
// Slow dispatch path for calls to CombineContiguousImpl with a size argument
// larger than PiecewiseChunkSize(). Has the same effect as calling
// CombineContiguousImpl() repeatedly with the chunk stride size.
@@ -856,8 +898,15 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
}
ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Mix(uint64_t state, uint64_t v) {
+#if defined(__aarch64__)
+ // On AArch64, calculating a 128-bit product is inefficient, because it
+ // requires a sequence of two instructions to calculate the upper and lower
+ // halves of the result.
+ using MultType = uint64_t;
+#else
using MultType =
absl::conditional_t<sizeof(size_t) == 4, uint64_t, uint128>;
+#endif
// We do the addition in 64-bit space to make sure the 128-bit
// multiplication is fast. If we were to do it as MultType the compiler has
// to assume that the high word is non-zero and needs to perform 2
@@ -867,16 +916,16 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
return static_cast<uint64_t>(m ^ (m >> (sizeof(m) * 8 / 2)));
}
- // An extern to avoid bloat on a direct call to Wyhash() with fixed values for
- // both the seed and salt parameters.
- static uint64_t WyhashImpl(const unsigned char* data, size_t len);
+ // An extern to avoid bloat on a direct call to LowLevelHash() with fixed
+ // values for both the seed and salt parameters.
+ static uint64_t LowLevelHashImpl(const unsigned char* data, size_t len);
ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Hash64(const unsigned char* data,
size_t len) {
#ifdef ABSL_HAVE_INTRINSIC_INT128
- return WyhashImpl(data, len);
+ return LowLevelHashImpl(data, len);
#else
- return absl::hash_internal::CityHash64(reinterpret_cast<const char*>(data), len);
+ return hash_internal::CityHash64(reinterpret_cast<const char*>(data), len);
#endif
}
@@ -911,8 +960,8 @@ class ABSL_DLL HashState : public HashStateBase<HashState> {
uint64_t state_;
};
-// HashState::CombineContiguousImpl()
-inline uint64_t HashState::CombineContiguousImpl(
+// MixingHashState::CombineContiguousImpl()
+inline uint64_t MixingHashState::CombineContiguousImpl(
uint64_t state, const unsigned char* first, size_t len,
std::integral_constant<int, 4> /* sizeof_size_t */) {
// For large values we use CityHash, for small ones we just use a
@@ -922,7 +971,7 @@ inline uint64_t HashState::CombineContiguousImpl(
if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) {
return CombineLargeContiguousImpl32(state, first, len);
}
- v = absl::hash_internal::CityHash32(reinterpret_cast<const char*>(first), len);
+ v = hash_internal::CityHash32(reinterpret_cast<const char*>(first), len);
} else if (len >= 4) {
v = Read4To8(first, len);
} else if (len > 0) {
@@ -934,12 +983,12 @@ inline uint64_t HashState::CombineContiguousImpl(
return Mix(state, v);
}
-// Overload of HashState::CombineContiguousImpl()
-inline uint64_t HashState::CombineContiguousImpl(
+// Overload of MixingHashState::CombineContiguousImpl()
+inline uint64_t MixingHashState::CombineContiguousImpl(
uint64_t state, const unsigned char* first, size_t len,
std::integral_constant<int, 8> /* sizeof_size_t */) {
- // For large values we use Wyhash or CityHash depending on the platform, for
- // small ones we just use a multiplicative hash.
+ // For large values we use LowLevelHash or CityHash depending on the platform,
+ // for small ones we just use a multiplicative hash.
uint64_t v;
if (len > 16) {
if (ABSL_PREDICT_FALSE(len > PiecewiseChunkSize())) {
@@ -976,7 +1025,9 @@ struct PoisonedHash : private AggregateBarrier {
template <typename T>
struct HashImpl {
- size_t operator()(const T& value) const { return HashState::hash(value); }
+ size_t operator()(const T& value) const {
+ return MixingHashState::hash(value);
+ }
};
template <typename T>
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc
new file mode 100644
index 00000000..6f9cb9c7
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc
@@ -0,0 +1,123 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/hash/internal/low_level_hash.h"
+
+#include "absl/base/internal/unaligned_access.h"
+#include "absl/numeric/bits.h"
+#include "absl/numeric/int128.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace hash_internal {
+
+static uint64_t Mix(uint64_t v0, uint64_t v1) {
+#if !defined(__aarch64__)
+ // The default bit-mixer uses 64x64->128-bit multiplication.
+ absl::uint128 p = v0;
+ p *= v1;
+ return absl::Uint128Low64(p) ^ absl::Uint128High64(p);
+#else
+ // The default bit-mixer above would perform poorly on some ARM microarchs,
+ // where calculating a 128-bit product requires a sequence of two
+ // instructions with a high combined latency and poor throughput.
+ // Instead, we mix bits using only 64-bit arithmetic, which is faster.
+ uint64_t p = v0 ^ absl::rotl(v1, 40);
+ p *= v1 ^ absl::rotl(v0, 39);
+ return p ^ (p >> 11);
+#endif
+}
+
+uint64_t LowLevelHash(const void* data, size_t len, uint64_t seed,
+ const uint64_t salt[]) {
+ const uint8_t* ptr = static_cast<const uint8_t*>(data);
+ uint64_t starting_length = static_cast<uint64_t>(len);
+ uint64_t current_state = seed ^ salt[0];
+
+ if (len > 64) {
+ // If we have more than 64 bytes, we're going to handle chunks of 64
+ // bytes at a time. We're going to build up two separate hash states
+ // which we will then hash together.
+ uint64_t duplicated_state = current_state;
+
+ do {
+ uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
+ uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
+ uint64_t c = absl::base_internal::UnalignedLoad64(ptr + 16);
+ uint64_t d = absl::base_internal::UnalignedLoad64(ptr + 24);
+ uint64_t e = absl::base_internal::UnalignedLoad64(ptr + 32);
+ uint64_t f = absl::base_internal::UnalignedLoad64(ptr + 40);
+ uint64_t g = absl::base_internal::UnalignedLoad64(ptr + 48);
+ uint64_t h = absl::base_internal::UnalignedLoad64(ptr + 56);
+
+ uint64_t cs0 = Mix(a ^ salt[1], b ^ current_state);
+ uint64_t cs1 = Mix(c ^ salt[2], d ^ current_state);
+ current_state = (cs0 ^ cs1);
+
+ uint64_t ds0 = Mix(e ^ salt[3], f ^ duplicated_state);
+ uint64_t ds1 = Mix(g ^ salt[4], h ^ duplicated_state);
+ duplicated_state = (ds0 ^ ds1);
+
+ ptr += 64;
+ len -= 64;
+ } while (len > 64);
+
+ current_state = current_state ^ duplicated_state;
+ }
+
+ // We now have a data `ptr` with at most 64 bytes and the current state
+ // of the hashing state machine stored in current_state.
+ while (len > 16) {
+ uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
+ uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
+
+ current_state = Mix(a ^ salt[1], b ^ current_state);
+
+ ptr += 16;
+ len -= 16;
+ }
+
+ // We now have a data `ptr` with at most 16 bytes.
+ uint64_t a = 0;
+ uint64_t b = 0;
+ if (len > 8) {
+ // When we have at least 9 and at most 16 bytes, set A to the first 64
+ // bits of the input and B to the last 64 bits of the input. Yes, they will
+ // overlap in the middle if we are working with less than the full 16
+ // bytes.
+ a = absl::base_internal::UnalignedLoad64(ptr);
+ b = absl::base_internal::UnalignedLoad64(ptr + len - 8);
+ } else if (len > 3) {
+ // If we have at least 4 and at most 8 bytes, set A to the first 32
+ // bits and B to the last 32 bits.
+ a = absl::base_internal::UnalignedLoad32(ptr);
+ b = absl::base_internal::UnalignedLoad32(ptr + len - 4);
+ } else if (len > 0) {
+ // If we have at least 1 and at most 3 bytes, read all of the provided
+ // bits into A, with some adjustments.
+ a = ((ptr[0] << 16) | (ptr[len >> 1] << 8) | ptr[len - 1]);
+ b = 0;
+ } else {
+ a = 0;
+ b = 0;
+ }
+
+ uint64_t w = Mix(a ^ salt[1], b ^ current_state);
+ uint64_t z = salt[1] ^ starting_length;
+ return Mix(w, z);
+}
+
+} // namespace hash_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h
new file mode 100644
index 00000000..439968aa
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h
@@ -0,0 +1,50 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 provides the Google-internal implementation of LowLevelHash.
+//
+// LowLevelHash is a fast hash function for hash tables, the fastest we've
+// currently (late 2020) found that passes the SMHasher tests. The algorithm
+// relies on intrinsic 128-bit multiplication for speed. This is not meant to be
+// secure - just fast.
+//
+// It is closely based on a version of wyhash, but does not maintain or
+// guarantee future compatibility with it.
+
+#ifndef ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_
+#define ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "absl/base/config.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace hash_internal {
+
+// Hash function for a byte array. A 64-bit seed and a set of five 64-bit
+// integers are hashed into the result.
+//
+// To allow all hashable types (including string_view and Span) to depend on
+// this algorithm, we keep the API low-level, with as few dependencies as
+// possible.
+uint64_t LowLevelHash(const void* data, size_t len, uint64_t seed,
+ const uint64_t salt[5]);
+
+} // namespace hash_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_HASH_INTERNAL_LOW_LEVEL_HASH_H_
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc
new file mode 100644
index 00000000..ae930b34
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/hash/internal/low_level_hash_test.cc
@@ -0,0 +1,580 @@
+// Copyright 2020 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/hash/internal/low_level_hash.h"
+
+#include <cinttypes>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/strings/escaping.h"
+
+#define UPDATE_GOLDEN 0
+
+namespace {
+
+static const uint64_t kSalt[5] = {0xa0761d6478bd642f, 0xe7037ed1a0b428dbl,
+ 0x8ebc6af09c88c6e3, 0x589965cc75374cc3l,
+ 0x1d8e4e27c47d124f};
+
+TEST(LowLevelHashTest, VerifyGolden) {
+ constexpr size_t kNumGoldenOutputs = 134;
+ static struct {
+ absl::string_view base64_data;
+ uint64_t seed;
+ } cases[] = {
+ {"", uint64_t{0xec42b7ab404b8acb}},
+ {"ICAg", uint64_t{0}},
+ {"YWFhYQ==", uint64_t{0}},
+ {"AQID", uint64_t{0}},
+ {"AQIDBA==", uint64_t{0}},
+ {"dGhpcmRfcGFydHl8d3loYXNofDY0", uint64_t{0}},
+ {"Zw==", uint64_t{0xeeee074043a3ee0f}},
+ {"xmk=", uint64_t{0x857902089c393de}},
+ {"c1H/", uint64_t{0x993df040024ca3af}},
+ {"SuwpzQ==", uint64_t{0xc4e4c2acea740e96}},
+ {"uqvy++M=", uint64_t{0x6a214b3db872d0cf}},
+ {"RnzCVPgb", uint64_t{0x44343db6a89dba4d}},
+ {"6OeNdlouYw==", uint64_t{0x77b5d6d1ae1dd483}},
+ {"M5/JmmYyDbc=", uint64_t{0x89ab8ecb44d221f1}},
+ {"MVijWiVdBRdY", uint64_t{0x60244b17577ca81b}},
+ {"6V7Uq7LNxpu0VA==", uint64_t{0x59a08dcee0717067}},
+ {"EQ6CdEEhPdyHcOk=", uint64_t{0xf5f20db3ade57396}},
+ {"PqFB4fxnPgF+l+rc", uint64_t{0xbf8dee0751ad3efb}},
+ {"a5aPOFwq7LA7+zKvPA==", uint64_t{0x6b7a06b268d63e30}},
+ {"VOwY21wCGv5D+/qqOvs=", uint64_t{0xb8c37f0ae0f54c82}},
+ {"KdHmBTx8lHXYvmGJ+Vy7", uint64_t{0x9fcbed0c38e50eef}},
+ {"qJkPlbHr8bMF7/cA6aE65Q==", uint64_t{0x2af4bade1d8e3a1d}},
+ {"ygvL0EhHZL0fIx6oHHtkxRQ=", uint64_t{0x714e3aa912da2f2c}},
+ {"c1rFXkt5YztwZCQRngncqtSs", uint64_t{0xf5ee75e3cbb82c1c}},
+ {"8hsQrzszzeNQSEcVXLtvIhm6mw==", uint64_t{0x620e7007321b93b9}},
+ {"ffUL4RocfyP4KfikGxO1yk7omDI=", uint64_t{0xc08528cac2e551fc}},
+ {"OOB5TT00vF9Od/rLbAWshiErqhpV", uint64_t{0x6a1debf9cc3ad39}},
+ {"or5wtXM7BFzTNpSzr+Lw5J5PMhVJ/Q==", uint64_t{0x7e0a3c88111fc226}},
+ {"gk6pCHDUsoopVEiaCrzVDhioRKxb844=", uint64_t{0x1301fef15df39edb}},
+ {"TNctmwlC5QbEM6/No4R/La3UdkfeMhzs", uint64_t{0x64e181f3d5817ab}},
+ {"SsQw9iAjhWz7sgcE9OwLuSC6hsM+BfHs2Q==", uint64_t{0xafafc44961078ecb}},
+ {"ZzO3mVCj4xTT2TT3XqDyEKj2BZQBvrS8RHg=", uint64_t{0x4f7bb45549250094}},
+ {"+klp5iPQGtppan5MflEls0iEUzqU+zGZkDJX", uint64_t{0xa30061abaa2818c}},
+ {"RO6bvOnlJc8I9eniXlNgqtKy0IX6VNg16NRmgg==",
+ uint64_t{0xd902ee3e44a5705f}},
+ {"ZJjZqId1ZXBaij9igClE3nyliU5XWdNRrayGlYA=", uint64_t{0x316d36da516f583}},
+ {"7BfkhfGMDGbxfMB8uyL85GbaYQtjr2K8g7RpLzr/",
+ uint64_t{0x402d83f9f834f616}},
+ {"rycWk6wHH7htETQtje9PidS2YzXBx+Qkg2fY7ZYS7A==",
+ uint64_t{0x9c604164c016b72c}},
+ {"RTkC2OUK+J13CdGllsH0H5WqgspsSa6QzRZouqx6pvI=",
+ uint64_t{0x3f4507e01f9e73ba}},
+ {"tKjKmbLCNyrLCM9hycOAXm4DKNpM12oZ7dLTmUx5iwAi",
+ uint64_t{0xc3fe0d5be8d2c7c7}},
+ {"VprUGNH+5NnNRaORxgH/ySrZFQFDL+4VAodhfBNinmn8cg==",
+ uint64_t{0x531858a40bfa7ea1}},
+ {"gc1xZaY+q0nPcUvOOnWnT3bqfmT/geth/f7Dm2e/DemMfk4=",
+ uint64_t{0x86689478a7a7e8fa}},
+ {"Mr35fIxqx1ukPAL0su1yFuzzAU3wABCLZ8+ZUFsXn47UmAph",
+ uint64_t{0x4ec948b8e7f27288}},
+ {"A9G8pw2+m7+rDtWYAdbl8tb2fT7FFo4hLi2vAsa5Y8mKH3CX3g==",
+ uint64_t{0xce46c7213c10032}},
+ {"DFaJGishGwEHDdj9ixbCoaTjz9KS0phLNWHVVdFsM93CvPft3hM=",
+ uint64_t{0xf63e96ee6f32a8b6}},
+ {"7+Ugx+Kr3aRNgYgcUxru62YkTDt5Hqis+2po81hGBkcrJg4N0uuy",
+ uint64_t{0x1cfe85e65fc5225}},
+ {"H2w6O8BUKqu6Tvj2xxaecxEI2wRgIgqnTTG1WwOgDSINR13Nm4d4Vg==",
+ uint64_t{0x45c474f1cee1d2e8}},
+ {"1XBMnIbqD5jy65xTDaf6WtiwtdtQwv1dCVoqpeKj+7cTR1SaMWMyI04=",
+ uint64_t{0x6e024e14015f329c}},
+ {"znZbdXG2TSFrKHEuJc83gPncYpzXGbAebUpP0XxzH0rpe8BaMQ17nDbt",
+ uint64_t{0x760c40502103ae1c}},
+ {"ylu8Atu13j1StlcC1MRMJJXIl7USgDDS22HgVv0WQ8hx/8pNtaiKB17hCQ==",
+ uint64_t{0x17fd05c3c560c320}},
+ {"M6ZVVzsd7vAvbiACSYHioH/440dp4xG2mLlBnxgiqEvI/aIEGpD0Sf4VS0g=",
+ uint64_t{0x8b34200a6f8e90d9}},
+ {"li3oFSXLXI+ubUVGJ4blP6mNinGKLHWkvGruun85AhVn6iuMtocbZPVhqxzn",
+ uint64_t{0x6be89e50818bdf69}},
+ {"kFuQHuUCqBF3Tc3hO4dgdIp223ShaCoog48d5Do5zMqUXOh5XpGK1t5XtxnfGA==",
+ uint64_t{0xfb389773315b47d8}},
+ {"jWmOad0v0QhXVJd1OdGuBZtDYYS8wBVHlvOeTQx9ZZnm8wLEItPMeihj72E0nWY=",
+ uint64_t{0x4f2512a23f61efee}},
+ {"z+DHU52HaOQdW4JrZwDQAebEA6rm13Zg/9lPYA3txt3NjTBqFZlOMvTRnVzRbl23",
+ uint64_t{0x59ccd92fc16c6fda}},
+ {"MmBiGDfYeTayyJa/tVycg+rN7f9mPDFaDc+23j0TlW9094er0ADigsl4QX7V3gG/qw==",
+ uint64_t{0x25c5a7f5bd330919}},
+ {"774RK+9rOL4iFvs1q2qpo/JVc/I39buvNjqEFDtDvyoB0FXxPI2vXqOrk08VPfIHkmU=",
+ uint64_t{0x51df4174d34c97d7}},
+ {"+slatXiQ7/2lK0BkVUI1qzNxOOLP3I1iK6OfHaoxgqT63FpzbElwEXSwdsryq3UlHK0I",
+ uint64_t{0x80ce6d76f89cb57}},
+ {"64mVTbQ47dHjHlOHGS/hjJwr/"
+ "K2frCNpn87exOqMzNUVYiPKmhCbfS7vBUce5tO6Ec9osQ==",
+ uint64_t{0x20961c911965f684}},
+ {"fIsaG1r530SFrBqaDj1kqE0AJnvvK8MNEZbII2Yw1OK77v0V59xabIh0B5axaz/"
+ "+a2V5WpA=",
+ uint64_t{0x4e5b926ec83868e7}},
+ {"PGih0zDEOWCYGxuHGDFu9Ivbff/"
+ "iE7BNUq65tycTR2R76TerrXALRosnzaNYO5fjFhTi+CiS",
+ uint64_t{0x3927b30b922eecef}},
+ {"RnpA/"
+ "zJnEnnLjmICORByRVb9bCOgxF44p3VMiW10G7PvW7IhwsWajlP9kIwNA9FjAD2GoQHk2Q="
+ "=",
+ uint64_t{0xbd0291284a49b61c}},
+ {"qFklMceaTHqJpy2qavJE+EVBiNFOi6OxjOA3LeIcBop1K7w8xQi3TrDk+"
+ "BrWPRIbfprszSaPfrI=",
+ uint64_t{0x73a77c575bcc956}},
+ {"cLbfUtLl3EcQmITWoTskUR8da/VafRDYF/ylPYwk7/"
+ "zazk6ssyrzxMN3mmSyvrXR2yDGNZ3WDrTT",
+ uint64_t{0x766a0e2ade6d09a6}},
+ {"s/"
+ "Jf1+"
+ "FbsbCpXWPTUSeWyMH6e4CvTFvPE5Fs6Z8hvFITGyr0dtukHzkI84oviVLxhM1xMxrMAy1db"
+ "w==",
+ uint64_t{0x2599f4f905115869}},
+ {"FvyQ00+j7nmYZVQ8hI1Edxd0AWplhTfWuFGiu34AK5X8u2hLX1bE97sZM0CmeLe+"
+ "7LgoUT1fJ/axybE=",
+ uint64_t{0xd8256e5444d21e53}},
+ {"L8ncxMaYLBH3g9buPu8hfpWZNlOF7nvWLNv9IozH07uQsIBWSKxoPy8+"
+ "LW4tTuzC6CIWbRGRRD1sQV/4",
+ uint64_t{0xf664a91333fb8dfd}},
+ {"CDK0meI07yrgV2kQlZZ+"
+ "wuVqhc2NmzqeLH7bmcA6kchsRWFPeVF5Wqjjaj556ABeUoUr3yBmfU3kWOakkg==",
+ uint64_t{0x9625b859be372cd1}},
+ {"d23/vc5ONh/"
+ "HkMiq+gYk4gaCNYyuFKwUkvn46t+dfVcKfBTYykr4kdvAPNXGYLjM4u1YkAEFpJP+"
+ "nX7eOvs=",
+ uint64_t{0x7b99940782e29898}},
+ {"NUR3SRxBkxTSbtQORJpu/GdR6b/h6sSGfsMj/KFd99ahbh+9r7LSgSGmkGVB/"
+ "mGoT0pnMTQst7Lv2q6QN6Vm",
+ uint64_t{0x4fe12fa5383b51a8}},
+ {"2BOFlcI3Z0RYDtS9T9Ie9yJoXlOdigpPeeT+CRujb/"
+ "O39Ih5LPC9hP6RQk1kYESGyaLZZi3jtabHs7DiVx/VDg==",
+ uint64_t{0xe2ccb09ac0f5b4b6}},
+ {"FF2HQE1FxEvWBpg6Z9zAMH+Zlqx8S1JD/"
+ "wIlViL6ZDZY63alMDrxB0GJQahmAtjlm26RGLnjW7jmgQ4Ie3I+014=",
+ uint64_t{0x7d0a37adbd7b753b}},
+ {"tHmO7mqVL/PX11nZrz50Hc+M17Poj5lpnqHkEN+4bpMx/"
+ "YGbkrGOaYjoQjgmt1X2QyypK7xClFrjeWrCMdlVYtbW",
+ uint64_t{0xd3ae96ef9f7185f2}},
+ {"/WiHi9IQcxRImsudkA/KOTqGe8/"
+ "gXkhKIHkjddv5S9hi02M049dIK3EUyAEjkjpdGLUs+BN0QzPtZqjIYPOgwsYE9g==",
+ uint64_t{0x4fb88ea63f79a0d8}},
+ {"qds+1ExSnU11L4fTSDz/QE90g4Jh6ioqSh3KDOTOAo2pQGL1k/"
+ "9CCC7J23YF27dUTzrWsCQA2m4epXoCc3yPHb3xElA=",
+ uint64_t{0xed564e259bb5ebe9}},
+ {"8FVYHx40lSQPTHheh08Oq0/"
+ "pGm2OlG8BEf8ezvAxHuGGdgCkqpXIueJBF2mQJhTfDy5NncO8ntS7vaKs7sCNdDaNGOEi",
+ uint64_t{0x3e3256b60c428000}},
+ {"4ZoEIrJtstiCkeew3oRzmyJHVt/pAs2pj0HgHFrBPztbQ10NsQ/"
+ "lM6DM439QVxpznnBSiHMgMQJhER+70l72LqFTO1JiIQ==",
+ uint64_t{0xfb05bad59ec8705}},
+ {"hQPtaYI+wJyxXgwD5n8jGIKFKaFA/"
+ "P83KqCKZfPthnjwdOFysqEOYwAaZuaaiv4cDyi9TyS8hk5cEbNP/jrI7q6pYGBLbsM=",
+ uint64_t{0xafdc251dbf97b5f8}},
+ {"S4gpMSKzMD7CWPsSfLeYyhSpfWOntyuVZdX1xSBjiGvsspwOZcxNKCRIOqAA0moUfOh3I5+"
+ "juQV4rsqYElMD/gWfDGpsWZKQ",
+ uint64_t{0x10ec9c92ddb5dcbc}},
+ {"oswxop+"
+ "bthuDLT4j0PcoSKby4LhF47ZKg8K17xxHf74UsGCzTBbOz0MM8hQEGlyqDT1iUiAYnaPaUp"
+ "L2mRK0rcIUYA4qLt5uOw==",
+ uint64_t{0x9a767d5822c7dac4}},
+ {"0II/"
+ "697p+"
+ "BtLSjxj5989OXI004TogEb94VUnDzOVSgMXie72cuYRvTFNIBgtXlKfkiUjeqVpd4a+"
+ "n5bxNOD1TGrjQtzKU5r7obo=",
+ uint64_t{0xee46254080d6e2db}},
+ {"E84YZW2qipAlMPmctrg7TKlwLZ68l4L+c0xRDUfyyFrA4MAti0q9sHq3TDFviH0Y+"
+ "Kq3tEE5srWFA8LM9oomtmvm5PYxoaarWPLc",
+ uint64_t{0xbbb669588d8bf398}},
+ {"x3pa4HIElyZG0Nj7Vdy9IdJIR4izLmypXw5PCmZB5y68QQ4uRaVVi3UthsoJROvbjDJkP2D"
+ "Q6L/eN8pFeLFzNPKBYzcmuMOb5Ull7w==",
+ uint64_t{0xdc2afaa529beef44}},
+ {"jVDKGYIuWOP/"
+ "QKLdd2wi8B2VJA8Wh0c8PwrXJVM8FOGM3voPDVPyDJOU6QsBDPseoR8uuKd19OZ/"
+ "zAvSCB+zlf6upAsBlheUKgCfKww=",
+ uint64_t{0xf1f67391d45013a8}},
+ {"mkquunhmYe1aR2wmUz4vcvLEcKBoe6H+kjUok9VUn2+eTSkWs4oDDtJvNCWtY5efJwg/"
+ "j4PgjRYWtqnrCkhaqJaEvkkOwVfgMIwF3e+d",
+ uint64_t{0x16fce2b8c65a3429}},
+ {"fRelvKYonTQ+s+rnnvQw+JzGfFoPixtna0vzcSjiDqX5s2Kg2//"
+ "UGrK+AVCyMUhO98WoB1DDbrsOYSw2QzrcPe0+3ck9sePvb+Q/IRaHbw==",
+ uint64_t{0xf4b096699f49fe67}},
+ {"DUwXFJzagljo44QeJ7/"
+ "6ZKw4QXV18lhkYT2jglMr8WB3CHUU4vdsytvw6AKv42ZcG6fRkZkq9fpnmXy6xG0aO3WPT1"
+ "eHuyFirAlkW+zKtwg=",
+ uint64_t{0xca584c4bc8198682}},
+ {"cYmZCrOOBBongNTr7e4nYn52uQUy2mfe48s50JXx2AZ6cRAt/"
+ "xRHJ5QbEoEJOeOHsJyM4nbzwFm++SlT6gFZZHJpkXJ92JkR86uS/eV1hJUR",
+ uint64_t{0xed269fc3818b6aad}},
+ {"EXeHBDfhwzAKFhsMcH9+2RHwV+mJaN01+9oacF6vgm8mCXRd6jeN9U2oAb0of5c5cO4i+"
+ "Vb/LlHZSMI490SnHU0bejhSCC2gsC5d2K30ER3iNA==",
+ uint64_t{0x33f253cbb8fe66a8}},
+ {"FzkzRYoNjkxFhZDso94IHRZaJUP61nFYrh5MwDwv9FNoJ5jyNCY/"
+ "eazPZk+tbmzDyJIGw2h3GxaWZ9bSlsol/vK98SbkMKCQ/wbfrXRLcDzdd/8=",
+ uint64_t{0xd0b76b2c1523d99c}},
+ {"Re4aXISCMlYY/XsX7zkIFR04ta03u4zkL9dVbLXMa/q6hlY/CImVIIYRN3VKP4pnd0AUr/"
+ "ugkyt36JcstAInb4h9rpAGQ7GMVOgBniiMBZ/MGU7H",
+ uint64_t{0xfd28f0811a2a237f}},
+ {"ueLyMcqJXX+MhO4UApylCN9WlTQ+"
+ "ltJmItgG7vFUtqs2qNwBMjmAvr5u0sAKd8jpzV0dDPTwchbIeAW5zbtkA2NABJV6hFM48ib"
+ "4/J3A5mseA3cS8w==",
+ uint64_t{0x6261fb136482e84}},
+ {"6Si7Yi11L+jZMkwaN+GUuzXMrlvEqviEkGOilNq0h8TdQyYKuFXzkYc/"
+ "q74gP3pVCyiwz9KpVGMM9vfnq36riMHRknkmhQutxLZs5fbmOgEO69HglCU=",
+ uint64_t{0x458efc750bca7c3a}},
+ {"Q6AbOofGuTJOegPh9Clm/"
+ "9crtUMQqylKrTc1fhfJo1tqvpXxhU4k08kntL1RG7woRnFrVh2UoMrL1kjin+s9CanT+"
+ "y4hHwLqRranl9FjvxfVKm3yvg68",
+ uint64_t{0xa7e69ff84e5e7c27}},
+ {"ieQEbIPvqY2YfIjHnqfJiO1/MIVRk0RoaG/WWi3kFrfIGiNLCczYoklgaecHMm/"
+ "1sZ96AjO+a5stQfZbJQwS7Sc1ODABEdJKcTsxeW2hbh9A6CFzpowP1A==",
+ uint64_t{0x3c59bfd0c29efe9e}},
+ {"zQUv8hFB3zh2GGl3KTvCmnfzE+"
+ "SUgQPVaSVIELFX5H9cE3FuVFGmymkPQZJLAyzC90Cmi8GqYCvPqTuAAB//"
+ "XTJxy4bCcVArgZG9zJXpjowpNBfr3ngWrSE=",
+ uint64_t{0x10befacc6afd298d}},
+ {"US4hcC1+op5JKGC7eIs8CUgInjKWKlvKQkapulxW262E/"
+ "B2ye79QxOexf188u2mFwwe3WTISJHRZzS61IwljqAWAWoBAqkUnW8SHmIDwHUP31J0p5sGd"
+ "P47L",
+ uint64_t{0x41d5320b0a38efa7}},
+ {"9bHUWFna2LNaGF6fQLlkx1Hkt24nrkLE2CmFdWgTQV3FFbUe747SSqYw6ebpTa07MWSpWRP"
+ "sHesVo2B9tqHbe7eQmqYebPDFnNqrhSdZwFm9arLQVs+7a3Ic6A==",
+ uint64_t{0x58db1c7450fe17f3}},
+ {"Kb3DpHRUPhtyqgs3RuXjzA08jGb59hjKTOeFt1qhoINfYyfTt2buKhD6YVffRCPsgK9SeqZ"
+ "qRPJSyaqsa0ovyq1WnWW8jI/NhvAkZTVHUrX2pC+cD3OPYT05Dag=",
+ uint64_t{0x6098c055a335b7a6}},
+ {"gzxyMJIPlU+bJBwhFUCHSofZ/"
+ "319LxqMoqnt3+L6h2U2+ZXJCSsYpE80xmR0Ta77Jq54o92SMH87HV8dGOaCTuAYF+"
+ "lDL42SY1P316Cl0sZTS2ow3ZqwGbcPNs/1",
+ uint64_t{0x1bbacec67845a801}},
+ {"uR7V0TW+FGVMpsifnaBAQ3IGlr1wx5sKd7TChuqRe6OvUXTlD4hKWy8S+"
+ "8yyOw8lQabism19vOQxfmocEOW/"
+ "vzY0pEa87qHrAZy4s9fH2Bltu8vaOIe+agYohhYORQ==",
+ uint64_t{0xc419cfc7442190}},
+ {"1UR5eoo2aCwhacjZHaCh9bkOsITp6QunUxHQ2SfeHv0imHetzt/"
+ "Z70mhyWZBalv6eAx+YfWKCUib2SHDtz/"
+ "A2dc3hqUWX5VfAV7FQsghPUAtu6IiRatq4YSLpDvKZBQ=",
+ uint64_t{0xc95e510d94ba270c}},
+ {"opubR7H63BH7OtY+Avd7QyQ25UZ8kLBdFDsBTwZlY6gA/"
+ "u+x+"
+ "czC9AaZMgmQrUy15DH7YMGsvdXnviTtI4eVI4aF1H9Rl3NXMKZgwFOsdTfdcZeeHVRzBBKX"
+ "8jUfh1il",
+ uint64_t{0xff1ae05c98089c3f}},
+ {"DC0kXcSXtfQ9FbSRwirIn5tgPri0sbzHSa78aDZVDUKCMaBGyFU6BmrulywYX8yzvwprdLs"
+ "oOwTWN2wMjHlPDqrvVHNEjnmufRDblW+nSS+xtKNs3N5xsxXdv6JXDrAB/Q==",
+ uint64_t{0x90c02b8dceced493}},
+ {"BXRBk+3wEP3Lpm1y75wjoz+PgB0AMzLe8tQ1AYU2/"
+ "oqrQB2YMC6W+9QDbcOfkGbeH+b7IBkt/"
+ "gwCMw2HaQsRFEsurXtcQ3YwRuPz5XNaw5NAvrNa67Fm7eRzdE1+hWLKtA8=",
+ uint64_t{0x9f8a76697ab1aa36}},
+ {"RRBSvEGYnzR9E45Aps/+WSnpCo/X7gJLO4DRnUqFrJCV/kzWlusLE/"
+ "6ZU6RoUf2ROwcgEvUiXTGjLs7ts3t9SXnJHxC1KiOzxHdYLMhVvgNd3hVSAXODpKFSkVXND"
+ "55G2L1W",
+ uint64_t{0x6ba1bf3d811a531d}},
+ {"jeh6Qazxmdi57pa9S3XSnnZFIRrnc6s8QLrah5OX3SB/V2ErSPoEAumavzQPkdKF1/"
+ "SfvmdL+qgF1C+Yawy562QaFqwVGq7+tW0yxP8FStb56ZRgNI4IOmI30s1Ei7iops9Uuw==",
+ uint64_t{0x6a418974109c67b4}},
+ {"6QO5nnDrY2/"
+ "wrUXpltlKy2dSBcmK15fOY092CR7KxAjNfaY+"
+ "aAmtWbbzQk3MjBg03x39afSUN1fkrWACdyQKRaGxgwq6MGNxI6W+8DLWJBHzIXrntrE/"
+ "ml6fnNXEpxplWJ1vEs4=",
+ uint64_t{0x8472f1c2b3d230a3}},
+ {"0oPxeEHhqhcFuwonNfLd5jF3RNATGZS6NPoS0WklnzyokbTqcl4BeBkMn07+fDQv83j/"
+ "BpGUwcWO05f3+DYzocfnizpFjLJemFGsls3gxcBYxcbqWYev51tG3lN9EvRE+X9+Pwww",
+ uint64_t{0x5e06068f884e73a7}},
+ {"naSBSjtOKgAOg8XVbR5cHAW3Y+QL4Pb/JO9/"
+ "oy6L08wvVRZqo0BrssMwhzBP401Um7A4ppAupbQeJFdMrysY34AuSSNvtNUy5VxjNECwiNt"
+ "gwYHw7yakDUv8WvonctmnoSPKENegQg==",
+ uint64_t{0x55290b1a8f170f59}},
+ {"vPyl8DxVeRe1OpilKb9KNwpGkQRtA94UpAHetNh+"
+ "95V7nIW38v7PpzhnTWIml5kw3So1Si0TXtIUPIbsu32BNhoH7QwFvLM+"
+ "JACgSpc5e3RjsL6Qwxxi11npwxRmRUqATDeMUfRAjxg=",
+ uint64_t{0x5501cfd83dfe706a}},
+ {"QC9i2GjdTMuNC1xQJ74ngKfrlA4w3o58FhvNCltdIpuMhHP1YsDA78scQPLbZ3OCUgeQguY"
+ "f/vw6zAaVKSgwtaykqg5ka/4vhz4hYqWU5ficdXqClHl+zkWEY26slCNYOM5nnDlly8Cj",
+ uint64_t{0xe43ed13d13a66990}},
+ {"7CNIgQhAHX27nxI0HeB5oUTnTdgKpRDYDKwRcXfSFGP1XeT9nQF6WKCMjL1tBV6x7KuJ91G"
+ "Zz11F4c+8s+MfqEAEpd4FHzamrMNjGcjCyrVtU6y+7HscMVzr7Q/"
+ "ODLcPEFztFnwjvCjmHw==",
+ uint64_t{0xdf43bc375cf5283f}},
+ {"Qa/hC2RPXhANSospe+gUaPfjdK/yhQvfm4cCV6/pdvCYWPv8p1kMtKOX3h5/"
+ "8oZ31fsmx4Axphu5qXJokuhZKkBUJueuMpxRyXpwSWz2wELx5glxF7CM0Fn+"
+ "OevnkhUn5jsPlG2r5jYlVn8=",
+ uint64_t{0x8112b806d288d7b5}},
+ {"kUw/0z4l3a89jTwN5jpG0SHY5km/"
+ "IVhTjgM5xCiPRLncg40aqWrJ5vcF891AOq5hEpSq0bUCJUMFXgct7kvnys905HjerV7Vs1G"
+ "y84tgVJ70/2+pAZTsB/PzNOE/G6sOj4+GbTzkQu819OLB",
+ uint64_t{0xd52a18abb001cb46}},
+ {"VDdfSDbO8Tdj3T5W0XM3EI7iHh5xpIutiM6dvcJ/fhe23V/srFEkDy5iZf/"
+ "VnA9kfi2C79ENnFnbOReeuZW1b3MUXB9lgC6U4pOTuC+"
+ "jHK3Qnpyiqzj7h3ISJSuo2pob7vY6VHZo6Fn7exEqHg==",
+ uint64_t{0xe12b76a2433a1236}},
+ {"Ldfvy3ORdquM/R2fIkhH/ONi69mcP1AEJ6n/"
+ "oropwecAsLJzQSgezSY8bEiEs0VnFTBBsW+RtZY6tDj03fnb3amNUOq1b7jbqyQkL9hpl+"
+ "2Z2J8IaVSeownWl+bQcsR5/xRktIMckC5AtF4YHfU=",
+ uint64_t{0x175bf7319cf1fa00}},
+ {"BrbNpb42+"
+ "VzZAjJw6QLirXzhweCVRfwlczzZ0VX2xluskwBqyfnGovz5EuX79JJ31VNXa5hTkAyQat3l"
+ "YKRADTdAdwE5PqM1N7YaMqqsqoAAAeuYVXuk5eWCykYmClNdSspegwgCuT+403JigBzi",
+ uint64_t{0xd63d57b3f67525ae}},
+ {"gB3NGHJJvVcuPyF0ZSvHwnWSIfmaI7La24VMPQVoIIWF7Z74NltPZZpx2f+cocESM+"
+ "ILzQW9p+BC8x5IWz7N4Str2WLGKMdgmaBfNkEhSHQDU0IJEOnpUt0HmjhFaBlx0/"
+ "LTmhua+rQ6Wup8ezLwfg==",
+ uint64_t{0x933faea858832b73}},
+ {"hTKHlRxx6Pl4gjG+6ksvvj0CWFicUg3WrPdSJypDpq91LUWRni2KF6+"
+ "81ZoHBFhEBrCdogKqeK+hy9bLDnx7g6rAFUjtn1+cWzQ2YjiOpz4+"
+ "ROBB7lnwjyTGWzJD1rXtlso1g2qVH8XJVigC5M9AIxM=",
+ uint64_t{0x53d061e5f8e7c04f}},
+ {"IWQBelSQnhrr0F3BhUpXUIDauhX6f95Qp+A0diFXiUK7irwPG1oqBiqHyK/SH/"
+ "9S+"
+ "rln9DlFROAmeFdH0OCJi2tFm4afxYzJTFR4HnR4cG4x12JqHaZLQx6iiu6CE3rtWBVz99oA"
+ "wCZUOEXIsLU24o2Y",
+ uint64_t{0xdb4124556dd515e0}},
+ {"TKo+l+"
+ "1dOXdLvIrFqeLaHdm0HZnbcdEgOoLVcGRiCbAMR0j5pIFw8D36tefckAS1RCFOH5IgP8yiF"
+ "T0Gd0a2hI3+"
+ "fTKA7iK96NekxWeoeqzJyctc6QsoiyBlkZerRxs5RplrxoeNg29kKDTM0K94mnhD9g==",
+ uint64_t{0x4fb31a0dd681ee71}},
+ {"YU4e7G6EfQYvxCFoCrrT0EFgVLHFfOWRTJQJ5gxM3G2b+"
+ "1kJf9YPrpsxF6Xr6nYtS8reEEbDoZJYqnlk9lXSkVArm88Cqn6d25VCx3+"
+ "49MqC0trIlXtb7SXUUhwpJK16T0hJUfPH7s5cMZXc6YmmbFuBNPE=",
+ uint64_t{0x27cc72eefa138e4c}},
+ {"/I/"
+ "eImMwPo1U6wekNFD1Jxjk9XQVi1D+"
+ "FPdqcHifYXQuP5aScNQfxMAmaPR2XhuOQhADV5tTVbBKwCDCX4E3jcDNHzCiPvViZF1W27t"
+ "xaf2BbFQdwKrNCmrtzcluBFYu0XZfc7RU1RmxK/RtnF1qHsq/O4pp",
+ uint64_t{0x44bc2dfba4bd3ced}},
+ {"CJTT9WGcY2XykTdo8KodRIA29qsqY0iHzWZRjKHb9alwyJ7RZAE3V5Juv4MY3MeYEr1EPCC"
+ "MxO7yFXqT8XA8YTjaMp3bafRt17Pw8JC4iKJ1zN+WWKOESrj+"
+ "3aluGQqn8z1EzqY4PH7rLG575PYeWsP98BugdA==",
+ uint64_t{0x242da1e3a439bed8}},
+ {"ZlhyQwLhXQyIUEnMH/"
+ "AEW27vh9xrbNKJxpWGtrEmKhd+nFqAfbeNBQjW0SfG1YI0xQkQMHXjuTt4P/"
+ "EpZRtA47ibZDVS8TtaxwyBjuIDwqcN09eCtpC+Ls+"
+ "vWDTLmBeDM3u4hmzz4DQAYsLiZYSJcldg9Q3wszw=",
+ uint64_t{0xdc559c746e35c139}},
+ {"v2KU8y0sCrBghmnm8lzGJlwo6D6ObccAxCf10heoDtYLosk4ztTpLlpSFEyu23MLA1tJkcg"
+ "Rko04h19QMG0mOw/"
+ "wc93EXAweriBqXfvdaP85sZABwiKO+6rtS9pacRVpYYhHJeVTQ5NzrvBvi1huxAr+"
+ "xswhVMfL",
+ uint64_t{0xd0b0350275b9989}},
+ {"QhKlnIS6BuVCTQsnoE67E/"
+ "yrgogE8EwO7xLaEGei26m0gEU4OksefJgppDh3X0x0Cs78Dr9IHK5b977CmZlrTRmwhlP8p"
+ "M+UzXPNRNIZuN3ntOum/QhUWP8SGpirheXENWsXMQ/"
+ "nxtxakyEtrNkKk471Oov9juP8oQ==",
+ uint64_t{0xb04489e41d17730c}},
+ {"/ZRMgnoRt+Uo6fUPr9FqQvKX7syhgVqWu+"
+ "WUSsiQ68UlN0efSP6Eced5gJZL6tg9gcYJIkhjuQNITU0Q3TjVAnAcobgbJikCn6qZ6pRxK"
+ "BY4MTiAlfGD3T7R7hwJwx554MAy++Zb/YUFlnCaCJiwQMnowF7aQzwYFCo=",
+ uint64_t{0x2217285eb4572156}},
+ {"NB7tU5fNE8nI+SXGfipc7sRkhnSkUF1krjeo6k+8FITaAtdyz+"
+ "o7mONgXmGLulBPH9bEwyYhKNVY0L+njNQrZ9YC2aXsFD3PdZsxAFaBT3VXEzh+"
+ "NGBTjDASNL3mXyS8Yv1iThGfHoY7T4aR0NYGJ+k+pR6f+KrPC96M",
+ uint64_t{0x12c2e8e68aede73b}},
+ {"8T6wrqCtEO6/rwxF6lvMeyuigVOLwPipX/FULvwyu+1wa5sQGav/"
+ "2FsLHUVn6cGSi0LlFwLewGHPFJDLR0u4t7ZUyM//"
+ "x6da0sWgOa5hzDqjsVGmjxEHXiaXKW3i4iSZNuxoNbMQkIbVML+"
+ "DkYu9ND0O2swg4itGeVSzXA==",
+ uint64_t{0x4d612125bdc4fd00}},
+ {"Ntf1bMRdondtMv1CYr3G80iDJ4WSAlKy5H34XdGruQiCrnRGDBa+"
+ "eUi7vKp4gp3BBcVGl8eYSasVQQjn7MLvb3BjtXx6c/"
+ "bCL7JtpzQKaDnPr9GWRxpBXVxKREgMM7d8lm35EODv0w+"
+ "hQLfVSh8OGs7fsBb68nNWPLeeSOo=",
+ uint64_t{0x81826b553954464e}},
+ {"VsSAw72Ro6xks02kaiLuiTEIWBC5bgqr4WDnmP8vglXzAhixk7td926rm9jNimL+"
+ "kroPSygZ9gl63aF5DCPOACXmsbmhDrAQuUzoh9ZKhWgElLQsrqo1KIjWoZT5b5QfVUXY9lS"
+ "IBg3U75SqORoTPq7HalxxoIT5diWOcJQi",
+ uint64_t{0xc2e5d345dc0ddd2d}},
+ {"j+loZ+C87+"
+ "bJxNVebg94gU0mSLeDulcHs84tQT7BZM2rzDSLiCNxUedHr1ZWJ9ejTiBa0dqy2I2ABc++"
+ "xzOLcv+//YfibtjKtYggC6/3rv0XCc7xu6d/"
+ "O6xO+XOBhOWAQ+IHJVHf7wZnDxIXB8AUHsnjEISKj7823biqXjyP3g==",
+ uint64_t{0x3da6830a9e32631e}},
+ {"f3LlpcPElMkspNtDq5xXyWU62erEaKn7RWKlo540gR6mZsNpK1czV/"
+ "sOmqaq8XAQLEn68LKj6/"
+ "cFkJukxRzCa4OF1a7cCAXYFp9+wZDu0bw4y63qbpjhdCl8GO6Z2lkcXy7KOzbPE01ukg7+"
+ "gN+7uKpoohgAhIwpAKQXmX5xtd0=",
+ uint64_t{0xc9ae5c8759b4877a}},
+ };
+
+#if defined(ABSL_IS_BIG_ENDIAN)
+ constexpr uint64_t kGolden[kNumGoldenOutputs] = {
+ 0xe5a40d39ab796423, 0x1766974bf7527d81, 0x5c3bbbe230db17a8,
+ 0xa6630143a7e6aa6f, 0x17645cb7318b86b, 0x218b175f30ba61f8,
+ 0xa6564b468248c683, 0xef192f401b116e1c, 0xbe8dc0c54617639d,
+ 0xe7b01610fc22dbb8, 0x99d9f694404af913, 0xf4eecd37464b45c5,
+ 0x7d2c653d63596d9b, 0x3f15c8544ec5393a, 0x6b9dc0c1704f796c,
+ 0xf1ded7a7eae5ed5a, 0x2db2fd7c6dd4641b, 0x151ca2d3d4cd33ab,
+ 0xa5af5994ac2ccd64, 0x2b2a4ca3191d2fce, 0xf89e68c9364e7c05,
+ 0x71724c70b799c21, 0x70536fabfd157369, 0xdee92794c3c3082b,
+ 0xac033a6743d3b3eb, 0xed2956b506cd5151, 0xbd669644755264b6,
+ 0x6ab1ff5d5f549a63, 0xf6bd551a2e3e04e, 0x7b5a8cef6875ea73,
+ 0x22bccf4d4db0a91c, 0x4f2bc07754c7c7eb, 0xfb6b8342a86725db,
+ 0x13a1a0d4c5854da, 0x5f6e44655f7dedac, 0x54a9198dff2bdf85,
+ 0xdb17e6915d4e4042, 0xa69926cf5c3b89f, 0xf77f031bfd74c096,
+ 0x1d6f916fdd50ec3c, 0x334ac76013ade393, 0x99370f899111de15,
+ 0x352457a03ada6de, 0x341974d4f42d854d, 0xda89ab02872aeb5,
+ 0x6ec2b74e143b10d9, 0x6f284c0b5cd60522, 0xf9670de353438f88,
+ 0xde920913adf0a2b4, 0xb7a07d7c0c17a8ec, 0x879a69f558ba3a98,
+ 0x360cf6d802df20f9, 0x53530f8046673738, 0xbd8f5f2bcf35e483,
+ 0x3f171f047144b983, 0x644d04e820823465, 0x50e44773a20b2702,
+ 0xe584ed4c05c745dd, 0x9a825c85b95ab6c0, 0xbce2931deb74e775,
+ 0x10468e9e705c7cfe, 0x12e01de3104141e2, 0x5c11ae2ee3713abd,
+ 0x6ac5ffb0860319e6, 0xc1e6da1849d30fc9, 0xa0e4d247a458b447,
+ 0x4530d4615c32b89b, 0x116aa09107a76505, 0xf941339d00d9bb73,
+ 0x573a0fc1615afb33, 0xa975c81dc868b258, 0x3ab2c5250ab54bda,
+ 0x37f99f208a3e3b11, 0x4b49b0ff706689d, 0x30bafa0b8f0a87fe,
+ 0xea6787a65cc20cdd, 0x55861729f1fc3ab8, 0xea38e009c5be9b72,
+ 0xcb8522cba33c3c66, 0x352e77653fe306f3, 0xe0bb760793bac064,
+ 0xf66ec59322662956, 0x637aa320455d56f8, 0x46ee546be5824a89,
+ 0x9e6842421e83d8a4, 0xf98ac2bc96b9fb8c, 0xf2c1002fd9a70b99,
+ 0x4c2b62b1e39e9405, 0x3248555fa3ade9c4, 0xd4d04c37f6417c21,
+ 0xf40cd506b1bf5653, 0x6c45d6005c760d2f, 0x61d88a7e61ff0d7e,
+ 0x131591e8a53cc967, 0xdae85cb9bc29bab6, 0xe98835334905e626,
+ 0x7cce50a2b66b8754, 0x5b0b3d0c5ac498ae, 0xd35a218c974d1756,
+ 0xfce436ddc1d003c, 0xd183901de90bb741, 0x9378f8f34974a66,
+ 0x21f11ae0a0402368, 0xf2fbd7c94ef89cb6, 0xc329c69d0f0d080b,
+ 0xf2841cba16216a61, 0x47aba97b44916df1, 0x724d4e00a8019fcf,
+ 0x2df9005c2a728d63, 0xc788892a1a5d7515, 0x9e993a65f9df0480,
+ 0x76876721ff49f969, 0xbe7a796cfba15bf5, 0xa4c8bd54586f5488,
+ 0xb390a325275501ab, 0x893f11317427ccf1, 0x92f2bb57da5695b9,
+ 0x30985b90da88269f, 0x2c690e268e086de8, 0x1c02df6097997196,
+ 0x1f9778f8bbdf6455, 0x7d57378c7bf8416d, 0xba8582a5f8d84d38,
+ 0xe8ca43b85050be4e, 0x5048cf6bed8a5d9f, 0xfbc5ba80917d0ea4,
+ 0x8011026525bf1691, 0x26b8dc6aed9fb50d, 0x191f5bfee77c1fe3,
+ 0xdd497891465a2cc1, 0x6f1fe8c57a33072e, 0x2c9f4ec078c460c0,
+ 0x9a725bde8f6a1437, 0x6ce545fa3ef61e4d,
+ };
+#elif defined(__aarch64__)
+ constexpr uint64_t kGolden[kNumGoldenOutputs] = {
+ 0x45c0aadee165dcbe, 0x25ed8587f6f20d06, 0x5f23ae668ce7926d,
+ 0xfef74d1da0846719, 0x54478408e68cb7d4, 0xee27ddaf88c6fe68,
+ 0xb7ac7031e81867ca, 0xf1168f818ec6c36d, 0x1dd0b734a83b019a,
+ 0xd6ae30d4142b54fe, 0xcd860c721ccb80fb, 0x068acf8493794756,
+ 0xd4ada0be58681307, 0x13ffe0f64ca540ed, 0xffc1d7a3401aec02,
+ 0xd81c4d865cf95fb9, 0x1dd0793acede62e0, 0xa6722abbca8fe4cf,
+ 0x5453d3e4111a7e40, 0xf29b3e3204c9dcd2, 0x23be2980e43117f7,
+ 0x74e2ccbc286f08eb, 0x19ef7c0f9496003a, 0xbfbf1c3e49b27987,
+ 0x6e6c179eb4a82c70, 0x07f4e184216bc4fc, 0xf17fbc4254927554,
+ 0xe57696b70a45b1b6, 0x6d3b144631b320e8, 0xccf8729792c75a2d,
+ 0xe832495b41fa980b, 0x5c96cfdc7b227d34, 0xc4dca234ef4e43f4,
+ 0x5fc801abf9abe307, 0xe41e3c5076d88f4d, 0x522346200ddec3c3,
+ 0x72bed1946fd7aaa4, 0x0ac1f84dcc335f96, 0x3af78db5e0a47670,
+ 0x6100ebf1481f1caf, 0xf5fd10037fc651a3, 0xa01227d8944665f3,
+ 0x7217681c4bbc9420, 0x4adee538e3eb10d1, 0x35e1761ad96de9a7,
+ 0x8b370aef9613bfba, 0x824506f749eeaf59, 0x85e805fa04423991,
+ 0xb61e9c33283c3de7, 0xc79721bbcb039ed6, 0x04e1c19a3a1e6639,
+ 0x6aaf6346b68dd638, 0x601a4b496be6d0c4, 0x3ece355f91c41787,
+ 0xd2fc8998448d7888, 0xd7529804f843efa9, 0xabdcc38a288536aa,
+ 0xdd323e48a9718648, 0x2090279c0030a52a, 0xe2f90faca88a3cd1,
+ 0x3e0c4e92fc50e4aa, 0xa26d308798e801dd, 0x432eefeedee8c02e,
+ 0xca4ce494614b77df, 0xbba82911e838066d, 0x4b00821016adee4b,
+ 0x4cf6e526dfb5a20f, 0x5b8466495142cba2, 0xe28ac1406e88a68c,
+ 0x8511e5f9d3100999, 0x05acbfe02798890b, 0x74c249c7ce4a8425,
+ 0xdbe7468d09bc34bc, 0x11079ab10e3b9b58, 0xb7788dec9032035a,
+ 0xb7e8daa786513f80, 0x34c3288831f46b45, 0x014cce5f0c21ecc6,
+ 0xc6a8f7b024551a28, 0x49784e902e207fd8, 0x4720d32af0b55158,
+ 0x8df3ec5de0c1da00, 0xf4db677b2c9e6853, 0xaa419abea78d312d,
+ 0x181e0f91bd757443, 0xa8c45136fada083b, 0x91303b93f5f0582c,
+ 0x883b95c6ddc62a08, 0x93186a8875fe952b, 0xd94f533928e957e2,
+ 0x6ba343003e10c172, 0xc8623b620c715d6a, 0x8ca0c512e180e244,
+ 0xdc9b74c2536b6216, 0x8eb5fdc61b295d96, 0x2ad83966b37c95ba,
+ 0xb90bf154ac5edec9, 0x902cf847b326cfb3, 0x7b02d0c0ca7808ca,
+ 0x492f310d003ea15f, 0x3eb6497a47c95990, 0x5d46b0ced31428b7,
+ 0x081afa67d1986157, 0x043482ec286b20eb, 0xc103c8f18c1a2a53,
+ 0xe8e9995a81481e83, 0x6bb3295822bc90b5, 0xeec75297a3fa5672,
+ 0x591c8440c4857412, 0x74947f455aaf24ad, 0xcf0e571586ec77a9,
+ 0x0c2553ea8c0400ad, 0x380219118066255f, 0x7595adb88b15ebe2,
+ 0xb33c00696c64ae23, 0xa143516ddd7c9857, 0x39179af229248d26,
+ 0x65d387a6f2ee2079, 0x89f8a9b21cd2f195, 0xbfef032d25df92e6,
+ 0x6b7e18a36c69da71, 0x4b3b15f6c28974e6, 0x032a75917f6c544c,
+ 0xe3b97ecca6d287cd, 0xa4a563110d3cda81, 0x35e09e8134f4e7f1,
+ 0xc9419dd03a9a390e, 0x7b86fae9000fd329, 0x1e044f8d54fe74c3,
+ 0x9c4991d7a47e9666, 0xfb485f3a1df4fdb6, 0xb11519969eeb94ff,
+ 0x3224ea1c44caeb8d, 0x86570bbd7cc6b80d,
+ };
+#else
+ constexpr uint64_t kGolden[kNumGoldenOutputs] = {
+ 0xe5a40d39ab796423, 0x1766974bf7527d81, 0x5c3bbbe230db17a8,
+ 0xa6630143a7e6aa6f, 0x8787cb2d04b0c984, 0x33603654ff574ac2,
+ 0xa6564b468248c683, 0xef192f401b116e1c, 0xbe8dc0c54617639d,
+ 0x93d7f665b5521c8e, 0x646d70bb42445f28, 0x96a7b1e3cc9bd426,
+ 0x76020289ab0790c4, 0x39f842e4133b9b44, 0x2b8d7047be4bcaab,
+ 0x99628abef6716a97, 0x4432e02ba42b2740, 0x74d810efcad7918a,
+ 0x88c84e986002507f, 0x4f99acf193cf39b9, 0xd90e7a3655891e37,
+ 0x3bb378b1d4df8fcf, 0xf78e94045c052d47, 0x26da0b2130da6b40,
+ 0x30b4d426af8c6986, 0x5413b4aaf3baaeae, 0x756ab265370a1597,
+ 0xdaf5f4b7d09814fb, 0x8f874ae37742b75e, 0x8fecd03956121ce8,
+ 0x229c292ea7a08285, 0x0bb4bf0692d14bae, 0x207b24ca3bdac1db,
+ 0x64f6cd6745d3825b, 0xa2b2e1656b58df1e, 0x0d01d30d9ee7a148,
+ 0x1cb4cd00ab804e3b, 0x4697f2637fd90999, 0x8383a756b5688c07,
+ 0x695c29cb3696a975, 0xda2e5a5a5e971521, 0x7935d4befa056b2b,
+ 0x38dd541ca95420fe, 0xcc06c7a4963f967f, 0xbf0f6f66e232fb20,
+ 0xf7efb32d373fe71a, 0xe2e64634b1c12660, 0x285b8fd1638e306d,
+ 0x658e8a4e3b714d6c, 0xf391fb968e0eb398, 0x744a9ea0cc144bf2,
+ 0x12636f2be11012f1, 0x29c57de825948f80, 0x58c6f99ab0d1c021,
+ 0x13e7b5a7b82fe3bb, 0x10fbc87901e02b63, 0xa24c9184901b748b,
+ 0xcac4fd4c5080e581, 0xc38bdb7483ba68e1, 0xdb2a8069b2ceaffa,
+ 0xdf9fe91d0d1c7887, 0xe83f49e96e2e6a08, 0x0c69e61b62ca2b62,
+ 0xb4a4f3f85f8298fe, 0x167a1b39e1e95f41, 0xf8a2a5649855ee41,
+ 0x27992565b595c498, 0x3e08cca5b71f9346, 0xad406b10c770a6d2,
+ 0xd1713ce6e552bcf2, 0x753b287194c73ad3, 0x5ae41a95f600af1c,
+ 0x4a61163b86a8bb4c, 0x42eeaa79e760c7e4, 0x698df622ef465b0a,
+ 0x157583111e1a6026, 0xaa1388f078e793e0, 0xf10d68d0f3309360,
+ 0x2af056184457a3de, 0x6d0058e1590b2489, 0x638f287f68817f12,
+ 0xc46b71fecefd5467, 0x2c8e94679d964e0a, 0x8612b797ce22503a,
+ 0x59f929babfba7170, 0x9527556923fb49a0, 0x1039ab644f5e150b,
+ 0x7816c83f3aa05e6d, 0xf51d2f564518c619, 0x67d494cff03ac004,
+ 0x2802d636ced1cfbb, 0xf64e20bad771cb12, 0x0b9a6cf84a83e15e,
+ 0x8da6630319609301, 0x40946a86e2a996f3, 0xcab7f5997953fa76,
+ 0x39129ca0e04fc465, 0x5238221fd685e1b8, 0x175130c407dbcaab,
+ 0x02f20e7536c0b0df, 0x2742cb488a04ad56, 0xd6afb593879ff93b,
+ 0xf50ad64caac0ca7f, 0x2ade95c4261364ae, 0x5c4f3299faacd07a,
+ 0xfffe3bff0ae5e9bc, 0x1db785c0005166e4, 0xea000d962ad18418,
+ 0xe42aef38359362d9, 0xc8e95657348a3891, 0xc162eca864f238c6,
+ 0xbe1fb373e20579ad, 0x628a1d4f40aa6ffd, 0xa87bdb7456340f90,
+ 0x5960ef3ba982c801, 0x5026586df9a431ec, 0xfe4b8a20fdf0840b,
+ 0xdcb761867da7072f, 0xc10d4653667275b7, 0x727720deec13110b,
+ 0x710b009662858dc9, 0xfbf8f7a3ecac1eb7, 0xb6fc4fcd0722e3df,
+ 0x7cb86dcc55104aac, 0x19e71e9b45c3a51e, 0x51de38573c2bea48,
+ 0xa73ab6996d6df158, 0x55ef2b8c930817b2, 0xb2850bf5fae87157,
+ 0xecf3de1acd04651f, 0xcc0a40552559ff32, 0xc385c374f20315b1,
+ 0xb90208a4c7234183, 0x58aa1ca7a4c075d9,
+ };
+#endif
+
+#if UPDATE_GOLDEN
+ (void)kGolden; // Silence warning.
+ for (size_t i = 0; i < kNumGoldenOutputs; ++i) {
+ std::string str;
+ ASSERT_TRUE(absl::Base64Unescape(cases[i].base64_data, &str));
+ uint64_t h = absl::hash_internal::LowLevelHash(str.data(), str.size(),
+ cases[i].seed, kSalt);
+ printf("0x%016" PRIx64 ", ", h);
+ if (i % 3 == 2) {
+ printf("\n");
+ }
+ }
+ printf("\n\n\n");
+ EXPECT_FALSE(true);
+#else
+ for (size_t i = 0; i < kNumGoldenOutputs; ++i) {
+ SCOPED_TRACE(::testing::Message()
+ << "i = " << i << "; input = " << cases[i].base64_data);
+ std::string str;
+ ASSERT_TRUE(absl::Base64Unescape(cases[i].base64_data, &str));
+ EXPECT_EQ(absl::hash_internal::LowLevelHash(str.data(), str.size(),
+ cases[i].seed, kSalt),
+ kGolden[i]);
+ }
+#endif
+}
+
+} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.cc b/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.cc
deleted file mode 100644
index 642bde43..00000000
--- a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2020 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/hash/internal/wyhash.h"
-
-#include "absl/base/internal/unaligned_access.h"
-#include "absl/numeric/int128.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace hash_internal {
-
-static uint64_t WyhashMix(uint64_t v0, uint64_t v1) {
- absl::uint128 p = v0;
- p *= v1;
- return absl::Uint128Low64(p) ^ absl::Uint128High64(p);
-}
-
-uint64_t Wyhash(const void* data, size_t len, uint64_t seed,
- const uint64_t salt[]) {
- const uint8_t* ptr = static_cast<const uint8_t*>(data);
- uint64_t starting_length = static_cast<uint64_t>(len);
- uint64_t current_state = seed ^ salt[0];
-
- if (len > 64) {
- // If we have more than 64 bytes, we're going to handle chunks of 64
- // bytes at a time. We're going to build up two separate hash states
- // which we will then hash together.
- uint64_t duplicated_state = current_state;
-
- do {
- uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
- uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
- uint64_t c = absl::base_internal::UnalignedLoad64(ptr + 16);
- uint64_t d = absl::base_internal::UnalignedLoad64(ptr + 24);
- uint64_t e = absl::base_internal::UnalignedLoad64(ptr + 32);
- uint64_t f = absl::base_internal::UnalignedLoad64(ptr + 40);
- uint64_t g = absl::base_internal::UnalignedLoad64(ptr + 48);
- uint64_t h = absl::base_internal::UnalignedLoad64(ptr + 56);
-
- uint64_t cs0 = WyhashMix(a ^ salt[1], b ^ current_state);
- uint64_t cs1 = WyhashMix(c ^ salt[2], d ^ current_state);
- current_state = (cs0 ^ cs1);
-
- uint64_t ds0 = WyhashMix(e ^ salt[3], f ^ duplicated_state);
- uint64_t ds1 = WyhashMix(g ^ salt[4], h ^ duplicated_state);
- duplicated_state = (ds0 ^ ds1);
-
- ptr += 64;
- len -= 64;
- } while (len > 64);
-
- current_state = current_state ^ duplicated_state;
- }
-
- // We now have a data `ptr` with at most 64 bytes and the current state
- // of the hashing state machine stored in current_state.
- while (len > 16) {
- uint64_t a = absl::base_internal::UnalignedLoad64(ptr);
- uint64_t b = absl::base_internal::UnalignedLoad64(ptr + 8);
-
- current_state = WyhashMix(a ^ salt[1], b ^ current_state);
-
- ptr += 16;
- len -= 16;
- }
-
- // We now have a data `ptr` with at most 16 bytes.
- uint64_t a = 0;
- uint64_t b = 0;
- if (len > 8) {
- // When we have at least 9 and at most 16 bytes, set A to the first 64
- // bits of the input and B to the last 64 bits of the input. Yes, they will
- // overlap in the middle if we are working with less than the full 16
- // bytes.
- a = absl::base_internal::UnalignedLoad64(ptr);
- b = absl::base_internal::UnalignedLoad64(ptr + len - 8);
- } else if (len > 3) {
- // If we have at least 4 and at most 8 bytes, set A to the first 32
- // bits and B to the last 32 bits.
- a = absl::base_internal::UnalignedLoad32(ptr);
- b = absl::base_internal::UnalignedLoad32(ptr + len - 4);
- } else if (len > 0) {
- // If we have at least 1 and at most 3 bytes, read all of the provided
- // bits into A, with some adjustments.
- a = ((ptr[0] << 16) | (ptr[len >> 1] << 8) | ptr[len - 1]);
- b = 0;
- } else {
- a = 0;
- b = 0;
- }
-
- uint64_t w = WyhashMix(a ^ salt[1], b ^ current_state);
- uint64_t z = salt[1] ^ starting_length;
- return WyhashMix(w, z);
-}
-
-} // namespace hash_internal
-ABSL_NAMESPACE_END
-} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.h b/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.h
deleted file mode 100644
index 4aff4e93..00000000
--- a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2020 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 provides the Google-internal implementation of the Wyhash
-// algorithm.
-//
-// Wyhash is a fast hash function for hash tables, the fastest we've currently
-// (late 2020) found that passes the SMHasher tests. The algorithm relies on
-// intrinsic 128-bit multiplication for speed. This is not meant to be secure -
-// just fast.
-
-#ifndef ABSL_HASH_INTERNAL_WYHASH_H_
-#define ABSL_HASH_INTERNAL_WYHASH_H_
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "absl/base/config.h"
-
-namespace absl {
-ABSL_NAMESPACE_BEGIN
-namespace hash_internal {
-
-// Hash function for a byte array. A 64-bit seed and a set of five 64-bit
-// integers are hashed into the result.
-//
-// To allow all hashable types (including string_view and Span) to depend on
-// this algoritm, we keep the API low-level, with as few dependencies as
-// possible.
-uint64_t Wyhash(const void* data, size_t len, uint64_t seed,
- const uint64_t salt[5]);
-
-} // namespace hash_internal
-ABSL_NAMESPACE_END
-} // namespace absl
-
-#endif // ABSL_HASH_INTERNAL_WYHASH_H_
diff --git a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc b/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc
deleted file mode 100644
index 9fb06d23..00000000
--- a/grpc/third_party/abseil-cpp/absl/hash/internal/wyhash_test.cc
+++ /dev/null
@@ -1,486 +0,0 @@
-// Copyright 2020 The Abseil Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 "absl/hash/internal/wyhash.h"
-
-#include "absl/strings/escaping.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace {
-
-static const uint64_t kCurrentSeed = 0;
-static const uint64_t kSalt[5] = {0xa0761d6478bd642f, 0xe7037ed1a0b428dbl,
- 0x8ebc6af09c88c6e3, 0x589965cc75374cc3l,
- 0x1d8e4e27c47d124f};
-
-// Note: We don't account for endianness, so the values here are only correct if
-// you're also running on a little endian platform.
-
-TEST(WyhashTest, EmptyString) {
- const std::string s = "";
- EXPECT_EQ(
- absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
- 4808886099364463827);
-}
-
-TEST(WyhashTest, Spaces) {
- const std::string s = " ";
- EXPECT_EQ(
- absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
- 1686201463024549249);
-}
-
-TEST(WyhashTest, RepeatingString) {
- const std::string s = "aaaa";
- EXPECT_EQ(
- absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
- 6646112255271966632);
-}
-
-TEST(WyhashTest, HexString) {
- const std::string small = "\x01\x02\x03";
- const std::string med = "\x01\x02\x03\x04";
-
- EXPECT_EQ(absl::hash_internal::Wyhash(small.c_str(), small.length(),
- kCurrentSeed, kSalt),
- 11989428023081740911ULL);
- EXPECT_EQ(absl::hash_internal::Wyhash(med.c_str(), med.length(), kCurrentSeed,
- kSalt),
- 9765997711188871556ULL);
-}
-
-TEST(WyhashTest, Words) {
- const std::string s = "third_party|wyhash|64";
- EXPECT_EQ(
- absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
- 3702018632387611330);
-}
-
-TEST(WyhashTest, LongString) {
- const std::string s =
- "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz"
- "0123456789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOp"
- "QrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEf"
- "GhIjKlMnOpQrStUvWxYz0123456789AbCdEfGhIjKlMnOpQrStUvWxYz012345"
- "6789AbCdEfGhIjKlMnOpQrStUvWxYz0123456789";
-
- EXPECT_EQ(
- absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
- 9245411362605796064ULL);
-}
-
-TEST(WyhashTest, BigReference) {
- struct ExpectedResult {
- absl::string_view base64_data;
- uint64_t seed;
- uint64_t hash;
- } expected_results[] = {
- {"", uint64_t{0xec42b7ab404b8acb}, uint64_t{0xe5a40d39ab796423}},
- {"Zw==", uint64_t{0xeeee074043a3ee0f}, uint64_t{0xa6564b468248c683}},
- {"xmk=", uint64_t{0x857902089c393de}, uint64_t{0xef192f401b116e1c}},
- {"c1H/", uint64_t{0x993df040024ca3af}, uint64_t{0xbe8dc0c54617639d}},
- {"SuwpzQ==", uint64_t{0xc4e4c2acea740e96}, uint64_t{0x93d7f665b5521c8e}},
- {"uqvy++M=", uint64_t{0x6a214b3db872d0cf}, uint64_t{0x646d70bb42445f28}},
- {"RnzCVPgb", uint64_t{0x44343db6a89dba4d}, uint64_t{0x96a7b1e3cc9bd426}},
- {"6OeNdlouYw==", uint64_t{0x77b5d6d1ae1dd483},
- uint64_t{0x76020289ab0790c4}},
- {"M5/JmmYyDbc=", uint64_t{0x89ab8ecb44d221f1},
- uint64_t{0x39f842e4133b9b44}},
- {"MVijWiVdBRdY", uint64_t{0x60244b17577ca81b},
- uint64_t{0x2b8d7047be4bcaab}},
- {"6V7Uq7LNxpu0VA==", uint64_t{0x59a08dcee0717067},
- uint64_t{0x99628abef6716a97}},
- {"EQ6CdEEhPdyHcOk=", uint64_t{0xf5f20db3ade57396},
- uint64_t{0x4432e02ba42b2740}},
- {"PqFB4fxnPgF+l+rc", uint64_t{0xbf8dee0751ad3efb},
- uint64_t{0x74d810efcad7918a}},
- {"a5aPOFwq7LA7+zKvPA==", uint64_t{0x6b7a06b268d63e30},
- uint64_t{0x88c84e986002507f}},
- {"VOwY21wCGv5D+/qqOvs=", uint64_t{0xb8c37f0ae0f54c82},
- uint64_t{0x4f99acf193cf39b9}},
- {"KdHmBTx8lHXYvmGJ+Vy7", uint64_t{0x9fcbed0c38e50eef},
- uint64_t{0xd90e7a3655891e37}},
- {"qJkPlbHr8bMF7/cA6aE65Q==", uint64_t{0x2af4bade1d8e3a1d},
- uint64_t{0x3bb378b1d4df8fcf}},
- {"ygvL0EhHZL0fIx6oHHtkxRQ=", uint64_t{0x714e3aa912da2f2c},
- uint64_t{0xf78e94045c052d47}},
- {"c1rFXkt5YztwZCQRngncqtSs", uint64_t{0xf5ee75e3cbb82c1c},
- uint64_t{0x26da0b2130da6b40}},
- {"8hsQrzszzeNQSEcVXLtvIhm6mw==", uint64_t{0x620e7007321b93b9},
- uint64_t{0x30b4d426af8c6986}},
- {"ffUL4RocfyP4KfikGxO1yk7omDI=", uint64_t{0xc08528cac2e551fc},
- uint64_t{0x5413b4aaf3baaeae}},
- {"OOB5TT00vF9Od/rLbAWshiErqhpV", uint64_t{0x6a1debf9cc3ad39},
- uint64_t{0x756ab265370a1597}},
- {"or5wtXM7BFzTNpSzr+Lw5J5PMhVJ/Q==", uint64_t{0x7e0a3c88111fc226},
- uint64_t{0xdaf5f4b7d09814fb}},
- {"gk6pCHDUsoopVEiaCrzVDhioRKxb844=", uint64_t{0x1301fef15df39edb},
- uint64_t{0x8f874ae37742b75e}},
- {"TNctmwlC5QbEM6/No4R/La3UdkfeMhzs", uint64_t{0x64e181f3d5817ab},
- uint64_t{0x8fecd03956121ce8}},
- {"SsQw9iAjhWz7sgcE9OwLuSC6hsM+BfHs2Q==", uint64_t{0xafafc44961078ecb},
- uint64_t{0x229c292ea7a08285}},
- {"ZzO3mVCj4xTT2TT3XqDyEKj2BZQBvrS8RHg=", uint64_t{0x4f7bb45549250094},
- uint64_t{0xbb4bf0692d14bae}},
- {"+klp5iPQGtppan5MflEls0iEUzqU+zGZkDJX", uint64_t{0xa30061abaa2818c},
- uint64_t{0x207b24ca3bdac1db}},
- {"RO6bvOnlJc8I9eniXlNgqtKy0IX6VNg16NRmgg==", uint64_t{0xd902ee3e44a5705f},
- uint64_t{0x64f6cd6745d3825b}},
- {"ZJjZqId1ZXBaij9igClE3nyliU5XWdNRrayGlYA=", uint64_t{0x316d36da516f583},
- uint64_t{0xa2b2e1656b58df1e}},
- {"7BfkhfGMDGbxfMB8uyL85GbaYQtjr2K8g7RpLzr/", uint64_t{0x402d83f9f834f616},
- uint64_t{0xd01d30d9ee7a148}},
- {"rycWk6wHH7htETQtje9PidS2YzXBx+Qkg2fY7ZYS7A==",
- uint64_t{0x9c604164c016b72c}, uint64_t{0x1cb4cd00ab804e3b}},
- {"RTkC2OUK+J13CdGllsH0H5WqgspsSa6QzRZouqx6pvI=",
- uint64_t{0x3f4507e01f9e73ba}, uint64_t{0x4697f2637fd90999}},
- {"tKjKmbLCNyrLCM9hycOAXm4DKNpM12oZ7dLTmUx5iwAi",
- uint64_t{0xc3fe0d5be8d2c7c7}, uint64_t{0x8383a756b5688c07}},
- {"VprUGNH+5NnNRaORxgH/ySrZFQFDL+4VAodhfBNinmn8cg==",
- uint64_t{0x531858a40bfa7ea1}, uint64_t{0x695c29cb3696a975}},
- {"gc1xZaY+q0nPcUvOOnWnT3bqfmT/geth/f7Dm2e/DemMfk4=",
- uint64_t{0x86689478a7a7e8fa}, uint64_t{0xda2e5a5a5e971521}},
- {"Mr35fIxqx1ukPAL0su1yFuzzAU3wABCLZ8+ZUFsXn47UmAph",
- uint64_t{0x4ec948b8e7f27288}, uint64_t{0x7935d4befa056b2b}},
- {"A9G8pw2+m7+rDtWYAdbl8tb2fT7FFo4hLi2vAsa5Y8mKH3CX3g==",
- uint64_t{0xce46c7213c10032}, uint64_t{0x38dd541ca95420fe}},
- {"DFaJGishGwEHDdj9ixbCoaTjz9KS0phLNWHVVdFsM93CvPft3hM=",
- uint64_t{0xf63e96ee6f32a8b6}, uint64_t{0xcc06c7a4963f967f}},
- {"7+Ugx+Kr3aRNgYgcUxru62YkTDt5Hqis+2po81hGBkcrJg4N0uuy",
- uint64_t{0x1cfe85e65fc5225}, uint64_t{0xbf0f6f66e232fb20}},
- {"H2w6O8BUKqu6Tvj2xxaecxEI2wRgIgqnTTG1WwOgDSINR13Nm4d4Vg==",
- uint64_t{0x45c474f1cee1d2e8}, uint64_t{0xf7efb32d373fe71a}},
- {"1XBMnIbqD5jy65xTDaf6WtiwtdtQwv1dCVoqpeKj+7cTR1SaMWMyI04=",
- uint64_t{0x6e024e14015f329c}, uint64_t{0xe2e64634b1c12660}},
- {"znZbdXG2TSFrKHEuJc83gPncYpzXGbAebUpP0XxzH0rpe8BaMQ17nDbt",
- uint64_t{0x760c40502103ae1c}, uint64_t{0x285b8fd1638e306d}},
- {"ylu8Atu13j1StlcC1MRMJJXIl7USgDDS22HgVv0WQ8hx/8pNtaiKB17hCQ==",
- uint64_t{0x17fd05c3c560c320}, uint64_t{0x658e8a4e3b714d6c}},
- {"M6ZVVzsd7vAvbiACSYHioH/440dp4xG2mLlBnxgiqEvI/aIEGpD0Sf4VS0g=",
- uint64_t{0x8b34200a6f8e90d9}, uint64_t{0xf391fb968e0eb398}},
- {"li3oFSXLXI+ubUVGJ4blP6mNinGKLHWkvGruun85AhVn6iuMtocbZPVhqxzn",
- uint64_t{0x6be89e50818bdf69}, uint64_t{0x744a9ea0cc144bf2}},
- {"kFuQHuUCqBF3Tc3hO4dgdIp223ShaCoog48d5Do5zMqUXOh5XpGK1t5XtxnfGA==",
- uint64_t{0xfb389773315b47d8}, uint64_t{0x12636f2be11012f1}},
- {"jWmOad0v0QhXVJd1OdGuBZtDYYS8wBVHlvOeTQx9ZZnm8wLEItPMeihj72E0nWY=",
- uint64_t{0x4f2512a23f61efee}, uint64_t{0x29c57de825948f80}},
- {"z+DHU52HaOQdW4JrZwDQAebEA6rm13Zg/9lPYA3txt3NjTBqFZlOMvTRnVzRbl23",
- uint64_t{0x59ccd92fc16c6fda}, uint64_t{0x58c6f99ab0d1c021}},
- {"MmBiGDfYeTayyJa/tVycg+rN7f9mPDFaDc+23j0TlW9094er0ADigsl4QX7V3gG/qw==",
- uint64_t{0x25c5a7f5bd330919}, uint64_t{0x13e7b5a7b82fe3bb}},
- {"774RK+9rOL4iFvs1q2qpo/JVc/I39buvNjqEFDtDvyoB0FXxPI2vXqOrk08VPfIHkmU=",
- uint64_t{0x51df4174d34c97d7}, uint64_t{0x10fbc87901e02b63}},
- {"+slatXiQ7/2lK0BkVUI1qzNxOOLP3I1iK6OfHaoxgqT63FpzbElwEXSwdsryq3UlHK0I",
- uint64_t{0x80ce6d76f89cb57}, uint64_t{0xa24c9184901b748b}},
- {"64mVTbQ47dHjHlOHGS/hjJwr/"
- "K2frCNpn87exOqMzNUVYiPKmhCbfS7vBUce5tO6Ec9osQ==",
- uint64_t{0x20961c911965f684}, uint64_t{0xcac4fd4c5080e581}},
- {"fIsaG1r530SFrBqaDj1kqE0AJnvvK8MNEZbII2Yw1OK77v0V59xabIh0B5axaz/"
- "+a2V5WpA=",
- uint64_t{0x4e5b926ec83868e7}, uint64_t{0xc38bdb7483ba68e1}},
- {"PGih0zDEOWCYGxuHGDFu9Ivbff/"
- "iE7BNUq65tycTR2R76TerrXALRosnzaNYO5fjFhTi+CiS",
- uint64_t{0x3927b30b922eecef}, uint64_t{0xdb2a8069b2ceaffa}},
- {"RnpA/"
- "zJnEnnLjmICORByRVb9bCOgxF44p3VMiW10G7PvW7IhwsWajlP9kIwNA9FjAD2GoQHk2Q="
- "=",
- uint64_t{0xbd0291284a49b61c}, uint64_t{0xdf9fe91d0d1c7887}},
- {"qFklMceaTHqJpy2qavJE+EVBiNFOi6OxjOA3LeIcBop1K7w8xQi3TrDk+"
- "BrWPRIbfprszSaPfrI=",
- uint64_t{0x73a77c575bcc956}, uint64_t{0xe83f49e96e2e6a08}},
- {"cLbfUtLl3EcQmITWoTskUR8da/VafRDYF/ylPYwk7/"
- "zazk6ssyrzxMN3mmSyvrXR2yDGNZ3WDrTT",
- uint64_t{0x766a0e2ade6d09a6}, uint64_t{0xc69e61b62ca2b62}},
- {"s/"
- "Jf1+"
- "FbsbCpXWPTUSeWyMH6e4CvTFvPE5Fs6Z8hvFITGyr0dtukHzkI84oviVLxhM1xMxrMAy1db"
- "w==",
- uint64_t{0x2599f4f905115869}, uint64_t{0xb4a4f3f85f8298fe}},
- {"FvyQ00+j7nmYZVQ8hI1Edxd0AWplhTfWuFGiu34AK5X8u2hLX1bE97sZM0CmeLe+"
- "7LgoUT1fJ/axybE=",
- uint64_t{0xd8256e5444d21e53}, uint64_t{0x167a1b39e1e95f41}},
- {"L8ncxMaYLBH3g9buPu8hfpWZNlOF7nvWLNv9IozH07uQsIBWSKxoPy8+"
- "LW4tTuzC6CIWbRGRRD1sQV/4",
- uint64_t{0xf664a91333fb8dfd}, uint64_t{0xf8a2a5649855ee41}},
- {"CDK0meI07yrgV2kQlZZ+"
- "wuVqhc2NmzqeLH7bmcA6kchsRWFPeVF5Wqjjaj556ABeUoUr3yBmfU3kWOakkg==",
- uint64_t{0x9625b859be372cd1}, uint64_t{0x27992565b595c498}},
- {"d23/vc5ONh/"
- "HkMiq+gYk4gaCNYyuFKwUkvn46t+dfVcKfBTYykr4kdvAPNXGYLjM4u1YkAEFpJP+"
- "nX7eOvs=",
- uint64_t{0x7b99940782e29898}, uint64_t{0x3e08cca5b71f9346}},
- {"NUR3SRxBkxTSbtQORJpu/GdR6b/h6sSGfsMj/KFd99ahbh+9r7LSgSGmkGVB/"
- "mGoT0pnMTQst7Lv2q6QN6Vm",
- uint64_t{0x4fe12fa5383b51a8}, uint64_t{0xad406b10c770a6d2}},
- {"2BOFlcI3Z0RYDtS9T9Ie9yJoXlOdigpPeeT+CRujb/"
- "O39Ih5LPC9hP6RQk1kYESGyaLZZi3jtabHs7DiVx/VDg==",
- uint64_t{0xe2ccb09ac0f5b4b6}, uint64_t{0xd1713ce6e552bcf2}},
- {"FF2HQE1FxEvWBpg6Z9zAMH+Zlqx8S1JD/"
- "wIlViL6ZDZY63alMDrxB0GJQahmAtjlm26RGLnjW7jmgQ4Ie3I+014=",
- uint64_t{0x7d0a37adbd7b753b}, uint64_t{0x753b287194c73ad3}},
- {"tHmO7mqVL/PX11nZrz50Hc+M17Poj5lpnqHkEN+4bpMx/"
- "YGbkrGOaYjoQjgmt1X2QyypK7xClFrjeWrCMdlVYtbW",
- uint64_t{0xd3ae96ef9f7185f2}, uint64_t{0x5ae41a95f600af1c}},
- {"/WiHi9IQcxRImsudkA/KOTqGe8/"
- "gXkhKIHkjddv5S9hi02M049dIK3EUyAEjkjpdGLUs+BN0QzPtZqjIYPOgwsYE9g==",
- uint64_t{0x4fb88ea63f79a0d8}, uint64_t{0x4a61163b86a8bb4c}},
- {"qds+1ExSnU11L4fTSDz/QE90g4Jh6ioqSh3KDOTOAo2pQGL1k/"
- "9CCC7J23YF27dUTzrWsCQA2m4epXoCc3yPHb3xElA=",
- uint64_t{0xed564e259bb5ebe9}, uint64_t{0x42eeaa79e760c7e4}},
- {"8FVYHx40lSQPTHheh08Oq0/"
- "pGm2OlG8BEf8ezvAxHuGGdgCkqpXIueJBF2mQJhTfDy5NncO8ntS7vaKs7sCNdDaNGOEi",
- uint64_t{0x3e3256b60c428000}, uint64_t{0x698df622ef465b0a}},
- {"4ZoEIrJtstiCkeew3oRzmyJHVt/pAs2pj0HgHFrBPztbQ10NsQ/"
- "lM6DM439QVxpznnBSiHMgMQJhER+70l72LqFTO1JiIQ==",
- uint64_t{0xfb05bad59ec8705}, uint64_t{0x157583111e1a6026}},
- {"hQPtaYI+wJyxXgwD5n8jGIKFKaFA/"
- "P83KqCKZfPthnjwdOFysqEOYwAaZuaaiv4cDyi9TyS8hk5cEbNP/jrI7q6pYGBLbsM=",
- uint64_t{0xafdc251dbf97b5f8}, uint64_t{0xaa1388f078e793e0}},
- {"S4gpMSKzMD7CWPsSfLeYyhSpfWOntyuVZdX1xSBjiGvsspwOZcxNKCRIOqAA0moUfOh3I5+"
- "juQV4rsqYElMD/gWfDGpsWZKQ",
- uint64_t{0x10ec9c92ddb5dcbc}, uint64_t{0xf10d68d0f3309360}},
- {"oswxop+"
- "bthuDLT4j0PcoSKby4LhF47ZKg8K17xxHf74UsGCzTBbOz0MM8hQEGlyqDT1iUiAYnaPaUp"
- "L2mRK0rcIUYA4qLt5uOw==",
- uint64_t{0x9a767d5822c7dac4}, uint64_t{0x2af056184457a3de}},
- {"0II/"
- "697p+"
- "BtLSjxj5989OXI004TogEb94VUnDzOVSgMXie72cuYRvTFNIBgtXlKfkiUjeqVpd4a+"
- "n5bxNOD1TGrjQtzKU5r7obo=",
- uint64_t{0xee46254080d6e2db}, uint64_t{0x6d0058e1590b2489}},
- {"E84YZW2qipAlMPmctrg7TKlwLZ68l4L+c0xRDUfyyFrA4MAti0q9sHq3TDFviH0Y+"
- "Kq3tEE5srWFA8LM9oomtmvm5PYxoaarWPLc",
- uint64_t{0xbbb669588d8bf398}, uint64_t{0x638f287f68817f12}},
- {"x3pa4HIElyZG0Nj7Vdy9IdJIR4izLmypXw5PCmZB5y68QQ4uRaVVi3UthsoJROvbjDJkP2D"
- "Q6L/eN8pFeLFzNPKBYzcmuMOb5Ull7w==",
- uint64_t{0xdc2afaa529beef44}, uint64_t{0xc46b71fecefd5467}},
- {"jVDKGYIuWOP/"
- "QKLdd2wi8B2VJA8Wh0c8PwrXJVM8FOGM3voPDVPyDJOU6QsBDPseoR8uuKd19OZ/"
- "zAvSCB+zlf6upAsBlheUKgCfKww=",
- uint64_t{0xf1f67391d45013a8}, uint64_t{0x2c8e94679d964e0a}},
- {"mkquunhmYe1aR2wmUz4vcvLEcKBoe6H+kjUok9VUn2+eTSkWs4oDDtJvNCWtY5efJwg/"
- "j4PgjRYWtqnrCkhaqJaEvkkOwVfgMIwF3e+d",
- uint64_t{0x16fce2b8c65a3429}, uint64_t{0x8612b797ce22503a}},
- {"fRelvKYonTQ+s+rnnvQw+JzGfFoPixtna0vzcSjiDqX5s2Kg2//"
- "UGrK+AVCyMUhO98WoB1DDbrsOYSw2QzrcPe0+3ck9sePvb+Q/IRaHbw==",
- uint64_t{0xf4b096699f49fe67}, uint64_t{0x59f929babfba7170}},
- {"DUwXFJzagljo44QeJ7/"
- "6ZKw4QXV18lhkYT2jglMr8WB3CHUU4vdsytvw6AKv42ZcG6fRkZkq9fpnmXy6xG0aO3WPT1"
- "eHuyFirAlkW+zKtwg=",
- uint64_t{0xca584c4bc8198682}, uint64_t{0x9527556923fb49a0}},
- {"cYmZCrOOBBongNTr7e4nYn52uQUy2mfe48s50JXx2AZ6cRAt/"
- "xRHJ5QbEoEJOeOHsJyM4nbzwFm++SlT6gFZZHJpkXJ92JkR86uS/eV1hJUR",
- uint64_t{0xed269fc3818b6aad}, uint64_t{0x1039ab644f5e150b}},
- {"EXeHBDfhwzAKFhsMcH9+2RHwV+mJaN01+9oacF6vgm8mCXRd6jeN9U2oAb0of5c5cO4i+"
- "Vb/LlHZSMI490SnHU0bejhSCC2gsC5d2K30ER3iNA==",
- uint64_t{0x33f253cbb8fe66a8}, uint64_t{0x7816c83f3aa05e6d}},
- {"FzkzRYoNjkxFhZDso94IHRZaJUP61nFYrh5MwDwv9FNoJ5jyNCY/"
- "eazPZk+tbmzDyJIGw2h3GxaWZ9bSlsol/vK98SbkMKCQ/wbfrXRLcDzdd/8=",
- uint64_t{0xd0b76b2c1523d99c}, uint64_t{0xf51d2f564518c619}},
- {"Re4aXISCMlYY/XsX7zkIFR04ta03u4zkL9dVbLXMa/q6hlY/CImVIIYRN3VKP4pnd0AUr/"
- "ugkyt36JcstAInb4h9rpAGQ7GMVOgBniiMBZ/MGU7H",
- uint64_t{0xfd28f0811a2a237f}, uint64_t{0x67d494cff03ac004}},
- {"ueLyMcqJXX+MhO4UApylCN9WlTQ+"
- "ltJmItgG7vFUtqs2qNwBMjmAvr5u0sAKd8jpzV0dDPTwchbIeAW5zbtkA2NABJV6hFM48ib"
- "4/J3A5mseA3cS8w==",
- uint64_t{0x6261fb136482e84}, uint64_t{0x2802d636ced1cfbb}},
- {"6Si7Yi11L+jZMkwaN+GUuzXMrlvEqviEkGOilNq0h8TdQyYKuFXzkYc/"
- "q74gP3pVCyiwz9KpVGMM9vfnq36riMHRknkmhQutxLZs5fbmOgEO69HglCU=",
- uint64_t{0x458efc750bca7c3a}, uint64_t{0xf64e20bad771cb12}},
- {"Q6AbOofGuTJOegPh9Clm/"
- "9crtUMQqylKrTc1fhfJo1tqvpXxhU4k08kntL1RG7woRnFrVh2UoMrL1kjin+s9CanT+"
- "y4hHwLqRranl9FjvxfVKm3yvg68",
- uint64_t{0xa7e69ff84e5e7c27}, uint64_t{0xb9a6cf84a83e15e}},
- {"ieQEbIPvqY2YfIjHnqfJiO1/MIVRk0RoaG/WWi3kFrfIGiNLCczYoklgaecHMm/"
- "1sZ96AjO+a5stQfZbJQwS7Sc1ODABEdJKcTsxeW2hbh9A6CFzpowP1A==",
- uint64_t{0x3c59bfd0c29efe9e}, uint64_t{0x8da6630319609301}},
- {"zQUv8hFB3zh2GGl3KTvCmnfzE+"
- "SUgQPVaSVIELFX5H9cE3FuVFGmymkPQZJLAyzC90Cmi8GqYCvPqTuAAB//"
- "XTJxy4bCcVArgZG9zJXpjowpNBfr3ngWrSE=",
- uint64_t{0x10befacc6afd298d}, uint64_t{0x40946a86e2a996f3}},
- {"US4hcC1+op5JKGC7eIs8CUgInjKWKlvKQkapulxW262E/"
- "B2ye79QxOexf188u2mFwwe3WTISJHRZzS61IwljqAWAWoBAqkUnW8SHmIDwHUP31J0p5sGd"
- "P47L",
- uint64_t{0x41d5320b0a38efa7}, uint64_t{0xcab7f5997953fa76}},
- {"9bHUWFna2LNaGF6fQLlkx1Hkt24nrkLE2CmFdWgTQV3FFbUe747SSqYw6ebpTa07MWSpWRP"
- "sHesVo2B9tqHbe7eQmqYebPDFnNqrhSdZwFm9arLQVs+7a3Ic6A==",
- uint64_t{0x58db1c7450fe17f3}, uint64_t{0x39129ca0e04fc465}},
- {"Kb3DpHRUPhtyqgs3RuXjzA08jGb59hjKTOeFt1qhoINfYyfTt2buKhD6YVffRCPsgK9SeqZ"
- "qRPJSyaqsa0ovyq1WnWW8jI/NhvAkZTVHUrX2pC+cD3OPYT05Dag=",
- uint64_t{0x6098c055a335b7a6}, uint64_t{0x5238221fd685e1b8}},
- {"gzxyMJIPlU+bJBwhFUCHSofZ/"
- "319LxqMoqnt3+L6h2U2+ZXJCSsYpE80xmR0Ta77Jq54o92SMH87HV8dGOaCTuAYF+"
- "lDL42SY1P316Cl0sZTS2ow3ZqwGbcPNs/1",
- uint64_t{0x1bbacec67845a801}, uint64_t{0x175130c407dbcaab}},
- {"uR7V0TW+FGVMpsifnaBAQ3IGlr1wx5sKd7TChuqRe6OvUXTlD4hKWy8S+"
- "8yyOw8lQabism19vOQxfmocEOW/"
- "vzY0pEa87qHrAZy4s9fH2Bltu8vaOIe+agYohhYORQ==",
- uint64_t{0xc419cfc7442190}, uint64_t{0x2f20e7536c0b0df}},
- {"1UR5eoo2aCwhacjZHaCh9bkOsITp6QunUxHQ2SfeHv0imHetzt/"
- "Z70mhyWZBalv6eAx+YfWKCUib2SHDtz/"
- "A2dc3hqUWX5VfAV7FQsghPUAtu6IiRatq4YSLpDvKZBQ=",
- uint64_t{0xc95e510d94ba270c}, uint64_t{0x2742cb488a04ad56}},
- {"opubR7H63BH7OtY+Avd7QyQ25UZ8kLBdFDsBTwZlY6gA/"
- "u+x+"
- "czC9AaZMgmQrUy15DH7YMGsvdXnviTtI4eVI4aF1H9Rl3NXMKZgwFOsdTfdcZeeHVRzBBKX"
- "8jUfh1il",
- uint64_t{0xff1ae05c98089c3f}, uint64_t{0xd6afb593879ff93b}},
- {"DC0kXcSXtfQ9FbSRwirIn5tgPri0sbzHSa78aDZVDUKCMaBGyFU6BmrulywYX8yzvwprdLs"
- "oOwTWN2wMjHlPDqrvVHNEjnmufRDblW+nSS+xtKNs3N5xsxXdv6JXDrAB/Q==",
- uint64_t{0x90c02b8dceced493}, uint64_t{0xf50ad64caac0ca7f}},
- {"BXRBk+3wEP3Lpm1y75wjoz+PgB0AMzLe8tQ1AYU2/"
- "oqrQB2YMC6W+9QDbcOfkGbeH+b7IBkt/"
- "gwCMw2HaQsRFEsurXtcQ3YwRuPz5XNaw5NAvrNa67Fm7eRzdE1+hWLKtA8=",
- uint64_t{0x9f8a76697ab1aa36}, uint64_t{0x2ade95c4261364ae}},
- {"RRBSvEGYnzR9E45Aps/+WSnpCo/X7gJLO4DRnUqFrJCV/kzWlusLE/"
- "6ZU6RoUf2ROwcgEvUiXTGjLs7ts3t9SXnJHxC1KiOzxHdYLMhVvgNd3hVSAXODpKFSkVXND"
- "55G2L1W",
- uint64_t{0x6ba1bf3d811a531d}, uint64_t{0x5c4f3299faacd07a}},
- {"jeh6Qazxmdi57pa9S3XSnnZFIRrnc6s8QLrah5OX3SB/V2ErSPoEAumavzQPkdKF1/"
- "SfvmdL+qgF1C+Yawy562QaFqwVGq7+tW0yxP8FStb56ZRgNI4IOmI30s1Ei7iops9Uuw==",
- uint64_t{0x6a418974109c67b4}, uint64_t{0xfffe3bff0ae5e9bc}},
- {"6QO5nnDrY2/"
- "wrUXpltlKy2dSBcmK15fOY092CR7KxAjNfaY+"
- "aAmtWbbzQk3MjBg03x39afSUN1fkrWACdyQKRaGxgwq6MGNxI6W+8DLWJBHzIXrntrE/"
- "ml6fnNXEpxplWJ1vEs4=",
- uint64_t{0x8472f1c2b3d230a3}, uint64_t{0x1db785c0005166e4}},
- {"0oPxeEHhqhcFuwonNfLd5jF3RNATGZS6NPoS0WklnzyokbTqcl4BeBkMn07+fDQv83j/"
- "BpGUwcWO05f3+DYzocfnizpFjLJemFGsls3gxcBYxcbqWYev51tG3lN9EvRE+X9+Pwww",
- uint64_t{0x5e06068f884e73a7}, uint64_t{0xea000d962ad18418}},
- {"naSBSjtOKgAOg8XVbR5cHAW3Y+QL4Pb/JO9/"
- "oy6L08wvVRZqo0BrssMwhzBP401Um7A4ppAupbQeJFdMrysY34AuSSNvtNUy5VxjNECwiNt"
- "gwYHw7yakDUv8WvonctmnoSPKENegQg==",
- uint64_t{0x55290b1a8f170f59}, uint64_t{0xe42aef38359362d9}},
- {"vPyl8DxVeRe1OpilKb9KNwpGkQRtA94UpAHetNh+"
- "95V7nIW38v7PpzhnTWIml5kw3So1Si0TXtIUPIbsu32BNhoH7QwFvLM+"
- "JACgSpc5e3RjsL6Qwxxi11npwxRmRUqATDeMUfRAjxg=",
- uint64_t{0x5501cfd83dfe706a}, uint64_t{0xc8e95657348a3891}},
- {"QC9i2GjdTMuNC1xQJ74ngKfrlA4w3o58FhvNCltdIpuMhHP1YsDA78scQPLbZ3OCUgeQguY"
- "f/vw6zAaVKSgwtaykqg5ka/4vhz4hYqWU5ficdXqClHl+zkWEY26slCNYOM5nnDlly8Cj",
- uint64_t{0xe43ed13d13a66990}, uint64_t{0xc162eca864f238c6}},
- {"7CNIgQhAHX27nxI0HeB5oUTnTdgKpRDYDKwRcXfSFGP1XeT9nQF6WKCMjL1tBV6x7KuJ91G"
- "Zz11F4c+8s+MfqEAEpd4FHzamrMNjGcjCyrVtU6y+7HscMVzr7Q/"
- "ODLcPEFztFnwjvCjmHw==",
- uint64_t{0xdf43bc375cf5283f}, uint64_t{0xbe1fb373e20579ad}},
- {"Qa/hC2RPXhANSospe+gUaPfjdK/yhQvfm4cCV6/pdvCYWPv8p1kMtKOX3h5/"
- "8oZ31fsmx4Axphu5qXJokuhZKkBUJueuMpxRyXpwSWz2wELx5glxF7CM0Fn+"
- "OevnkhUn5jsPlG2r5jYlVn8=",
- uint64_t{0x8112b806d288d7b5}, uint64_t{0x628a1d4f40aa6ffd}},
- {"kUw/0z4l3a89jTwN5jpG0SHY5km/"
- "IVhTjgM5xCiPRLncg40aqWrJ5vcF891AOq5hEpSq0bUCJUMFXgct7kvnys905HjerV7Vs1G"
- "y84tgVJ70/2+pAZTsB/PzNOE/G6sOj4+GbTzkQu819OLB",
- uint64_t{0xd52a18abb001cb46}, uint64_t{0xa87bdb7456340f90}},
- {"VDdfSDbO8Tdj3T5W0XM3EI7iHh5xpIutiM6dvcJ/fhe23V/srFEkDy5iZf/"
- "VnA9kfi2C79ENnFnbOReeuZW1b3MUXB9lgC6U4pOTuC+"
- "jHK3Qnpyiqzj7h3ISJSuo2pob7vY6VHZo6Fn7exEqHg==",
- uint64_t{0xe12b76a2433a1236}, uint64_t{0x5960ef3ba982c801}},
- {"Ldfvy3ORdquM/R2fIkhH/ONi69mcP1AEJ6n/"
- "oropwecAsLJzQSgezSY8bEiEs0VnFTBBsW+RtZY6tDj03fnb3amNUOq1b7jbqyQkL9hpl+"
- "2Z2J8IaVSeownWl+bQcsR5/xRktIMckC5AtF4YHfU=",
- uint64_t{0x175bf7319cf1fa00}, uint64_t{0x5026586df9a431ec}},
- {"BrbNpb42+"
- "VzZAjJw6QLirXzhweCVRfwlczzZ0VX2xluskwBqyfnGovz5EuX79JJ31VNXa5hTkAyQat3l"
- "YKRADTdAdwE5PqM1N7YaMqqsqoAAAeuYVXuk5eWCykYmClNdSspegwgCuT+403JigBzi",
- uint64_t{0xd63d57b3f67525ae}, uint64_t{0xfe4b8a20fdf0840b}},
- {"gB3NGHJJvVcuPyF0ZSvHwnWSIfmaI7La24VMPQVoIIWF7Z74NltPZZpx2f+cocESM+"
- "ILzQW9p+BC8x5IWz7N4Str2WLGKMdgmaBfNkEhSHQDU0IJEOnpUt0HmjhFaBlx0/"
- "LTmhua+rQ6Wup8ezLwfg==",
- uint64_t{0x933faea858832b73}, uint64_t{0xdcb761867da7072f}},
- {"hTKHlRxx6Pl4gjG+6ksvvj0CWFicUg3WrPdSJypDpq91LUWRni2KF6+"
- "81ZoHBFhEBrCdogKqeK+hy9bLDnx7g6rAFUjtn1+cWzQ2YjiOpz4+"
- "ROBB7lnwjyTGWzJD1rXtlso1g2qVH8XJVigC5M9AIxM=",
- uint64_t{0x53d061e5f8e7c04f}, uint64_t{0xc10d4653667275b7}},
- {"IWQBelSQnhrr0F3BhUpXUIDauhX6f95Qp+A0diFXiUK7irwPG1oqBiqHyK/SH/"
- "9S+"
- "rln9DlFROAmeFdH0OCJi2tFm4afxYzJTFR4HnR4cG4x12JqHaZLQx6iiu6CE3rtWBVz99oA"
- "wCZUOEXIsLU24o2Y",
- uint64_t{0xdb4124556dd515e0}, uint64_t{0x727720deec13110b}},
- {"TKo+l+"
- "1dOXdLvIrFqeLaHdm0HZnbcdEgOoLVcGRiCbAMR0j5pIFw8D36tefckAS1RCFOH5IgP8yiF"
- "T0Gd0a2hI3+"
- "fTKA7iK96NekxWeoeqzJyctc6QsoiyBlkZerRxs5RplrxoeNg29kKDTM0K94mnhD9g==",
- uint64_t{0x4fb31a0dd681ee71}, uint64_t{0x710b009662858dc9}},
- {"YU4e7G6EfQYvxCFoCrrT0EFgVLHFfOWRTJQJ5gxM3G2b+"
- "1kJf9YPrpsxF6Xr6nYtS8reEEbDoZJYqnlk9lXSkVArm88Cqn6d25VCx3+"
- "49MqC0trIlXtb7SXUUhwpJK16T0hJUfPH7s5cMZXc6YmmbFuBNPE=",
- uint64_t{0x27cc72eefa138e4c}, uint64_t{0xfbf8f7a3ecac1eb7}},
- {"/I/"
- "eImMwPo1U6wekNFD1Jxjk9XQVi1D+"
- "FPdqcHifYXQuP5aScNQfxMAmaPR2XhuOQhADV5tTVbBKwCDCX4E3jcDNHzCiPvViZF1W27t"
- "xaf2BbFQdwKrNCmrtzcluBFYu0XZfc7RU1RmxK/RtnF1qHsq/O4pp",
- uint64_t{0x44bc2dfba4bd3ced}, uint64_t{0xb6fc4fcd0722e3df}},
- {"CJTT9WGcY2XykTdo8KodRIA29qsqY0iHzWZRjKHb9alwyJ7RZAE3V5Juv4MY3MeYEr1EPCC"
- "MxO7yFXqT8XA8YTjaMp3bafRt17Pw8JC4iKJ1zN+WWKOESrj+"
- "3aluGQqn8z1EzqY4PH7rLG575PYeWsP98BugdA==",
- uint64_t{0x242da1e3a439bed8}, uint64_t{0x7cb86dcc55104aac}},
- {"ZlhyQwLhXQyIUEnMH/"
- "AEW27vh9xrbNKJxpWGtrEmKhd+nFqAfbeNBQjW0SfG1YI0xQkQMHXjuTt4P/"
- "EpZRtA47ibZDVS8TtaxwyBjuIDwqcN09eCtpC+Ls+"
- "vWDTLmBeDM3u4hmzz4DQAYsLiZYSJcldg9Q3wszw=",
- uint64_t{0xdc559c746e35c139}, uint64_t{0x19e71e9b45c3a51e}},
- {"v2KU8y0sCrBghmnm8lzGJlwo6D6ObccAxCf10heoDtYLosk4ztTpLlpSFEyu23MLA1tJkcg"
- "Rko04h19QMG0mOw/"
- "wc93EXAweriBqXfvdaP85sZABwiKO+6rtS9pacRVpYYhHJeVTQ5NzrvBvi1huxAr+"
- "xswhVMfL",
- uint64_t{0xd0b0350275b9989}, uint64_t{0x51de38573c2bea48}},
- {"QhKlnIS6BuVCTQsnoE67E/"
- "yrgogE8EwO7xLaEGei26m0gEU4OksefJgppDh3X0x0Cs78Dr9IHK5b977CmZlrTRmwhlP8p"
- "M+UzXPNRNIZuN3ntOum/QhUWP8SGpirheXENWsXMQ/"
- "nxtxakyEtrNkKk471Oov9juP8oQ==",
- uint64_t{0xb04489e41d17730c}, uint64_t{0xa73ab6996d6df158}},
- {"/ZRMgnoRt+Uo6fUPr9FqQvKX7syhgVqWu+"
- "WUSsiQ68UlN0efSP6Eced5gJZL6tg9gcYJIkhjuQNITU0Q3TjVAnAcobgbJikCn6qZ6pRxK"
- "BY4MTiAlfGD3T7R7hwJwx554MAy++Zb/YUFlnCaCJiwQMnowF7aQzwYFCo=",
- uint64_t{0x2217285eb4572156}, uint64_t{0x55ef2b8c930817b2}},
- {"NB7tU5fNE8nI+SXGfipc7sRkhnSkUF1krjeo6k+8FITaAtdyz+"
- "o7mONgXmGLulBPH9bEwyYhKNVY0L+njNQrZ9YC2aXsFD3PdZsxAFaBT3VXEzh+"
- "NGBTjDASNL3mXyS8Yv1iThGfHoY7T4aR0NYGJ+k+pR6f+KrPC96M",
- uint64_t{0x12c2e8e68aede73b}, uint64_t{0xb2850bf5fae87157}},
- {"8T6wrqCtEO6/rwxF6lvMeyuigVOLwPipX/FULvwyu+1wa5sQGav/"
- "2FsLHUVn6cGSi0LlFwLewGHPFJDLR0u4t7ZUyM//"
- "x6da0sWgOa5hzDqjsVGmjxEHXiaXKW3i4iSZNuxoNbMQkIbVML+"
- "DkYu9ND0O2swg4itGeVSzXA==",
- uint64_t{0x4d612125bdc4fd00}, uint64_t{0xecf3de1acd04651f}},
- {"Ntf1bMRdondtMv1CYr3G80iDJ4WSAlKy5H34XdGruQiCrnRGDBa+"
- "eUi7vKp4gp3BBcVGl8eYSasVQQjn7MLvb3BjtXx6c/"
- "bCL7JtpzQKaDnPr9GWRxpBXVxKREgMM7d8lm35EODv0w+"
- "hQLfVSh8OGs7fsBb68nNWPLeeSOo=",
- uint64_t{0x81826b553954464e}, uint64_t{0xcc0a40552559ff32}},
- {"VsSAw72Ro6xks02kaiLuiTEIWBC5bgqr4WDnmP8vglXzAhixk7td926rm9jNimL+"
- "kroPSygZ9gl63aF5DCPOACXmsbmhDrAQuUzoh9ZKhWgElLQsrqo1KIjWoZT5b5QfVUXY9lS"
- "IBg3U75SqORoTPq7HalxxoIT5diWOcJQi",
- uint64_t{0xc2e5d345dc0ddd2d}, uint64_t{0xc385c374f20315b1}},
- {"j+loZ+C87+"
- "bJxNVebg94gU0mSLeDulcHs84tQT7BZM2rzDSLiCNxUedHr1ZWJ9ejTiBa0dqy2I2ABc++"
- "xzOLcv+//YfibtjKtYggC6/3rv0XCc7xu6d/"
- "O6xO+XOBhOWAQ+IHJVHf7wZnDxIXB8AUHsnjEISKj7823biqXjyP3g==",
- uint64_t{0x3da6830a9e32631e}, uint64_t{0xb90208a4c7234183}},
- {"f3LlpcPElMkspNtDq5xXyWU62erEaKn7RWKlo540gR6mZsNpK1czV/"
- "sOmqaq8XAQLEn68LKj6/"
- "cFkJukxRzCa4OF1a7cCAXYFp9+wZDu0bw4y63qbpjhdCl8GO6Z2lkcXy7KOzbPE01ukg7+"
- "gN+7uKpoohgAhIwpAKQXmX5xtd0=",
- uint64_t{0xc9ae5c8759b4877a}, uint64_t{0x58aa1ca7a4c075d9}},
- };
-
- for (const auto& expected_result : expected_results) {
- std::string str;
- ASSERT_TRUE(absl::Base64Unescape(expected_result.base64_data, &str));
- EXPECT_EQ(absl::hash_internal::Wyhash(str.data(), str.size(),
- expected_result.seed, kSalt),
- expected_result.hash);
- }
-}
-
-} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/memory/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/memory/BUILD.bazel
index d2824a05..c16bf8a9 100644
--- a/grpc/third_party/abseil-cpp/absl/memory/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/memory/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/memory/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/memory/CMakeLists.txt
index 78fb7e1b..9d50e1dc 100644
--- a/grpc/third_party/abseil-cpp/absl/memory/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/memory/CMakeLists.txt
@@ -37,7 +37,7 @@ absl_cc_test(
DEPS
absl::memory
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -51,5 +51,5 @@ absl_cc_test(
absl::memory
absl::config
absl::exception_safety_testing
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/memory/memory.h b/grpc/third_party/abseil-cpp/absl/memory/memory.h
index 2b5ff623..d6332606 100644
--- a/grpc/third_party/abseil-cpp/absl/memory/memory.h
+++ b/grpc/third_party/abseil-cpp/absl/memory/memory.h
@@ -420,7 +420,7 @@ struct pointer_traits<T*> {
//
// A C++11 compatible implementation of C++17's std::allocator_traits.
//
-#if __cplusplus >= 201703L
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
using std::allocator_traits;
#else // __cplusplus >= 201703L
template <typename Alloc>
diff --git a/grpc/third_party/abseil-cpp/absl/meta/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/meta/BUILD.bazel
index 5585fcca..fb379251 100644
--- a/grpc/third_party/abseil-cpp/absl/meta/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/meta/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/meta/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/meta/CMakeLists.txt
index 672ead2f..9de4bd37 100644
--- a/grpc/third_party/abseil-cpp/absl/meta/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/meta/CMakeLists.txt
@@ -35,7 +35,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
# component target
diff --git a/grpc/third_party/abseil-cpp/absl/meta/type_traits.h b/grpc/third_party/abseil-cpp/absl/meta/type_traits.h
index d5cb5f3b..d886cb30 100644
--- a/grpc/third_party/abseil-cpp/absl/meta/type_traits.h
+++ b/grpc/third_party/abseil-cpp/absl/meta/type_traits.h
@@ -35,7 +35,7 @@
#ifndef ABSL_META_TYPE_TRAITS_H_
#define ABSL_META_TYPE_TRAITS_H_
-#include <stddef.h>
+#include <cstddef>
#include <functional>
#include <type_traits>
@@ -47,6 +47,14 @@
#define ABSL_META_INTERNAL_STD_CONSTRUCTION_TRAITS_DONT_CHECK_DESTRUCTION 1
#endif
+// Defines the default alignment. `__STDCPP_DEFAULT_NEW_ALIGNMENT__` is a C++17
+// feature.
+#if defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
+#define ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT __STDCPP_DEFAULT_NEW_ALIGNMENT__
+#else // defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
+#define ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT alignof(std::max_align_t)
+#endif // defined(__STDCPP_DEFAULT_NEW_ALIGNMENT__)
+
namespace absl {
ABSL_NAMESPACE_BEGIN
@@ -499,6 +507,27 @@ struct is_trivially_copy_assignable
#endif // ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE
};
+#if defined(__cpp_lib_remove_cvref) && __cpp_lib_remove_cvref >= 201711L
+template <typename T>
+using remove_cvref = std::remove_cvref<T>;
+
+template <typename T>
+using remove_cvref_t = typename std::remove_cvref<T>::type;
+#else
+// remove_cvref()
+//
+// C++11 compatible implementation of std::remove_cvref which was added in
+// C++20.
+template <typename T>
+struct remove_cvref {
+ using type =
+ typename std::remove_cv<typename std::remove_reference<T>::type>::type;
+};
+
+template <typename T>
+using remove_cvref_t = typename remove_cvref<T>::type;
+#endif
+
namespace type_traits_internal {
// is_trivially_copyable()
//
@@ -613,7 +642,8 @@ using underlying_type_t = typename std::underlying_type<T>::type;
namespace type_traits_internal {
-#if __cplusplus >= 201703L
+#if (defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703L) || \
+ (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
// std::result_of is deprecated (C++17) or removed (C++20)
template<typename> struct result_of;
template<typename F, typename... Args>
diff --git a/grpc/third_party/abseil-cpp/absl/meta/type_traits_test.cc b/grpc/third_party/abseil-cpp/absl/meta/type_traits_test.cc
index 1aafd0d4..0ef5b665 100644
--- a/grpc/third_party/abseil-cpp/absl/meta/type_traits_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/meta/type_traits_test.cc
@@ -942,6 +942,34 @@ TEST(TypeTraitsTest, TestTriviallyCopyable) {
absl::type_traits_internal::is_trivially_copyable<Trivial&>::value);
}
+TEST(TypeTraitsTest, TestRemoveCVRef) {
+ EXPECT_TRUE(
+ (std::is_same<typename absl::remove_cvref<int>::type, int>::value));
+ EXPECT_TRUE(
+ (std::is_same<typename absl::remove_cvref<int&>::type, int>::value));
+ EXPECT_TRUE(
+ (std::is_same<typename absl::remove_cvref<int&&>::type, int>::value));
+ EXPECT_TRUE((
+ std::is_same<typename absl::remove_cvref<const int&>::type, int>::value));
+ EXPECT_TRUE(
+ (std::is_same<typename absl::remove_cvref<int*>::type, int*>::value));
+ // Does not remove const in this case.
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<const int*>::type,
+ const int*>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<int[2]>::type,
+ int[2]>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<int(&)[2]>::type,
+ int[2]>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<int(&&)[2]>::type,
+ int[2]>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<const int[2]>::type,
+ int[2]>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<const int(&)[2]>::type,
+ int[2]>::value));
+ EXPECT_TRUE((std::is_same<typename absl::remove_cvref<const int(&&)[2]>::type,
+ int[2]>::value));
+}
+
#define ABSL_INTERNAL_EXPECT_ALIAS_EQUIVALENCE(trait_name, ...) \
EXPECT_TRUE((std::is_same<typename std::trait_name<__VA_ARGS__>::type, \
absl::trait_name##_t<__VA_ARGS__>>::value))
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/numeric/BUILD.bazel
index ea587bfa..1f9e0f20 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/numeric/BUILD.bazel
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/numeric/CMakeLists.txt
index 781987dc..26df5cf7 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/numeric/CMakeLists.txt
@@ -38,7 +38,7 @@ absl_cc_test(
absl::bits
absl::core_headers
absl::random_random
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -73,7 +73,7 @@ absl_cc_test(
absl::core_headers
absl::hash_testing
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
# component target
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/int128.cc b/grpc/third_party/abseil-cpp/absl/numeric/int128.cc
index 5160df79..17d88744 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/int128.cc
+++ b/grpc/third_party/abseil-cpp/absl/numeric/int128.cc
@@ -138,28 +138,21 @@ uint128::uint128(float v) : uint128(MakeUint128FromFloat(v)) {}
uint128::uint128(double v) : uint128(MakeUint128FromFloat(v)) {}
uint128::uint128(long double v) : uint128(MakeUint128FromFloat(v)) {}
+#if !defined(ABSL_HAVE_INTRINSIC_INT128)
uint128 operator/(uint128 lhs, uint128 rhs) {
-#if defined(ABSL_HAVE_INTRINSIC_INT128)
- return static_cast<unsigned __int128>(lhs) /
- static_cast<unsigned __int128>(rhs);
-#else // ABSL_HAVE_INTRINSIC_INT128
uint128 quotient = 0;
uint128 remainder = 0;
DivModImpl(lhs, rhs, &quotient, &remainder);
return quotient;
-#endif // ABSL_HAVE_INTRINSIC_INT128
}
+
uint128 operator%(uint128 lhs, uint128 rhs) {
-#if defined(ABSL_HAVE_INTRINSIC_INT128)
- return static_cast<unsigned __int128>(lhs) %
- static_cast<unsigned __int128>(rhs);
-#else // ABSL_HAVE_INTRINSIC_INT128
uint128 quotient = 0;
uint128 remainder = 0;
DivModImpl(lhs, rhs, &quotient, &remainder);
return remainder;
-#endif // ABSL_HAVE_INTRINSIC_INT128
}
+#endif // !defined(ABSL_HAVE_INTRINSIC_INT128)
namespace {
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/int128.h b/grpc/third_party/abseil-cpp/absl/numeric/int128.h
index 0dd814a8..c7ad96be 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/int128.h
+++ b/grpc/third_party/abseil-cpp/absl/numeric/int128.h
@@ -18,6 +18,10 @@
// -----------------------------------------------------------------------------
//
// This header file defines 128-bit integer types, `uint128` and `int128`.
+//
+// TODO(absl-team): This module is inconsistent as many inline `uint128` methods
+// are defined in this file, while many inline `int128` methods are defined in
+// the `int128_*_intrinsic.inc` files.
#ifndef ABSL_NUMERIC_INT128_H_
#define ABSL_NUMERIC_INT128_H_
@@ -582,10 +586,10 @@ inline uint128& uint128::operator=(int128 v) {
// Arithmetic operators.
-uint128 operator<<(uint128 lhs, int amount);
-uint128 operator>>(uint128 lhs, int amount);
-uint128 operator+(uint128 lhs, uint128 rhs);
-uint128 operator-(uint128 lhs, uint128 rhs);
+constexpr uint128 operator<<(uint128 lhs, int amount);
+constexpr uint128 operator>>(uint128 lhs, int amount);
+constexpr uint128 operator+(uint128 lhs, uint128 rhs);
+constexpr uint128 operator-(uint128 lhs, uint128 rhs);
uint128 operator*(uint128 lhs, uint128 rhs);
uint128 operator/(uint128 lhs, uint128 rhs);
uint128 operator%(uint128 lhs, uint128 rhs);
@@ -782,16 +786,19 @@ inline uint128::operator long double() const {
// Comparison operators.
-inline bool operator==(uint128 lhs, uint128 rhs) {
+constexpr bool operator==(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) ==
+ static_cast<unsigned __int128>(rhs);
+#else
return (Uint128Low64(lhs) == Uint128Low64(rhs) &&
Uint128High64(lhs) == Uint128High64(rhs));
+#endif
}
-inline bool operator!=(uint128 lhs, uint128 rhs) {
- return !(lhs == rhs);
-}
+constexpr bool operator!=(uint128 lhs, uint128 rhs) { return !(lhs == rhs); }
-inline bool operator<(uint128 lhs, uint128 rhs) {
+constexpr bool operator<(uint128 lhs, uint128 rhs) {
#ifdef ABSL_HAVE_INTRINSIC_INT128
return static_cast<unsigned __int128>(lhs) <
static_cast<unsigned __int128>(rhs);
@@ -802,118 +809,169 @@ inline bool operator<(uint128 lhs, uint128 rhs) {
#endif
}
-inline bool operator>(uint128 lhs, uint128 rhs) { return rhs < lhs; }
+constexpr bool operator>(uint128 lhs, uint128 rhs) { return rhs < lhs; }
-inline bool operator<=(uint128 lhs, uint128 rhs) { return !(rhs < lhs); }
+constexpr bool operator<=(uint128 lhs, uint128 rhs) { return !(rhs < lhs); }
-inline bool operator>=(uint128 lhs, uint128 rhs) { return !(lhs < rhs); }
+constexpr bool operator>=(uint128 lhs, uint128 rhs) { return !(lhs < rhs); }
// Unary operators.
-inline uint128 operator-(uint128 val) {
- uint64_t hi = ~Uint128High64(val);
- uint64_t lo = ~Uint128Low64(val) + 1;
- if (lo == 0) ++hi; // carry
- return MakeUint128(hi, lo);
+constexpr inline uint128 operator+(uint128 val) {
+ return val;
+}
+
+constexpr inline int128 operator+(int128 val) {
+ return val;
}
-inline bool operator!(uint128 val) {
+constexpr uint128 operator-(uint128 val) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return -static_cast<unsigned __int128>(val);
+#else
+ return MakeUint128(
+ ~Uint128High64(val) + static_cast<unsigned long>(Uint128Low64(val) == 0),
+ ~Uint128Low64(val) + 1);
+#endif
+}
+
+constexpr inline bool operator!(uint128 val) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return !static_cast<unsigned __int128>(val);
+#else
return !Uint128High64(val) && !Uint128Low64(val);
+#endif
}
// Logical operators.
-inline uint128 operator~(uint128 val) {
+constexpr inline uint128 operator~(uint128 val) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return ~static_cast<unsigned __int128>(val);
+#else
return MakeUint128(~Uint128High64(val), ~Uint128Low64(val));
+#endif
}
-inline uint128 operator|(uint128 lhs, uint128 rhs) {
+constexpr inline uint128 operator|(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) |
+ static_cast<unsigned __int128>(rhs);
+#else
return MakeUint128(Uint128High64(lhs) | Uint128High64(rhs),
- Uint128Low64(lhs) | Uint128Low64(rhs));
+ Uint128Low64(lhs) | Uint128Low64(rhs));
+#endif
}
-inline uint128 operator&(uint128 lhs, uint128 rhs) {
+constexpr inline uint128 operator&(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) &
+ static_cast<unsigned __int128>(rhs);
+#else
return MakeUint128(Uint128High64(lhs) & Uint128High64(rhs),
- Uint128Low64(lhs) & Uint128Low64(rhs));
+ Uint128Low64(lhs) & Uint128Low64(rhs));
+#endif
}
-inline uint128 operator^(uint128 lhs, uint128 rhs) {
+constexpr inline uint128 operator^(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) ^
+ static_cast<unsigned __int128>(rhs);
+#else
return MakeUint128(Uint128High64(lhs) ^ Uint128High64(rhs),
- Uint128Low64(lhs) ^ Uint128Low64(rhs));
+ Uint128Low64(lhs) ^ Uint128Low64(rhs));
+#endif
}
inline uint128& uint128::operator|=(uint128 other) {
- hi_ |= other.hi_;
- lo_ |= other.lo_;
+ *this = *this | other;
return *this;
}
inline uint128& uint128::operator&=(uint128 other) {
- hi_ &= other.hi_;
- lo_ &= other.lo_;
+ *this = *this & other;
return *this;
}
inline uint128& uint128::operator^=(uint128 other) {
- hi_ ^= other.hi_;
- lo_ ^= other.lo_;
+ *this = *this ^ other;
return *this;
}
// Arithmetic operators.
-inline uint128 operator<<(uint128 lhs, int amount) {
+constexpr uint128 operator<<(uint128 lhs, int amount) {
#ifdef ABSL_HAVE_INTRINSIC_INT128
return static_cast<unsigned __int128>(lhs) << amount;
#else
// uint64_t shifts of >= 64 are undefined, so we will need some
// special-casing.
- if (amount < 64) {
- if (amount != 0) {
- return MakeUint128(
- (Uint128High64(lhs) << amount) | (Uint128Low64(lhs) >> (64 - amount)),
- Uint128Low64(lhs) << amount);
- }
- return lhs;
- }
- return MakeUint128(Uint128Low64(lhs) << (amount - 64), 0);
+ return amount >= 64 ? MakeUint128(Uint128Low64(lhs) << (amount - 64), 0)
+ : amount == 0 ? lhs
+ : MakeUint128((Uint128High64(lhs) << amount) |
+ (Uint128Low64(lhs) >> (64 - amount)),
+ Uint128Low64(lhs) << amount);
#endif
}
-inline uint128 operator>>(uint128 lhs, int amount) {
+constexpr uint128 operator>>(uint128 lhs, int amount) {
#ifdef ABSL_HAVE_INTRINSIC_INT128
return static_cast<unsigned __int128>(lhs) >> amount;
#else
// uint64_t shifts of >= 64 are undefined, so we will need some
// special-casing.
- if (amount < 64) {
- if (amount != 0) {
- return MakeUint128(Uint128High64(lhs) >> amount,
- (Uint128Low64(lhs) >> amount) |
- (Uint128High64(lhs) << (64 - amount)));
- }
- return lhs;
- }
- return MakeUint128(0, Uint128High64(lhs) >> (amount - 64));
+ return amount >= 64 ? MakeUint128(0, Uint128High64(lhs) >> (amount - 64))
+ : amount == 0 ? lhs
+ : MakeUint128(Uint128High64(lhs) >> amount,
+ (Uint128Low64(lhs) >> amount) |
+ (Uint128High64(lhs) << (64 - amount)));
#endif
}
-inline uint128 operator+(uint128 lhs, uint128 rhs) {
- uint128 result = MakeUint128(Uint128High64(lhs) + Uint128High64(rhs),
- Uint128Low64(lhs) + Uint128Low64(rhs));
- if (Uint128Low64(result) < Uint128Low64(lhs)) { // check for carry
- return MakeUint128(Uint128High64(result) + 1, Uint128Low64(result));
- }
- return result;
+#if !defined(ABSL_HAVE_INTRINSIC_INT128)
+namespace int128_internal {
+constexpr uint128 AddResult(uint128 result, uint128 lhs) {
+ // check for carry
+ return (Uint128Low64(result) < Uint128Low64(lhs))
+ ? MakeUint128(Uint128High64(result) + 1, Uint128Low64(result))
+ : result;
}
+} // namespace int128_internal
+#endif
-inline uint128 operator-(uint128 lhs, uint128 rhs) {
- uint128 result = MakeUint128(Uint128High64(lhs) - Uint128High64(rhs),
- Uint128Low64(lhs) - Uint128Low64(rhs));
- if (Uint128Low64(lhs) < Uint128Low64(rhs)) { // check for carry
- return MakeUint128(Uint128High64(result) - 1, Uint128Low64(result));
- }
- return result;
+constexpr uint128 operator+(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) +
+ static_cast<unsigned __int128>(rhs);
+#else
+ return int128_internal::AddResult(
+ MakeUint128(Uint128High64(lhs) + Uint128High64(rhs),
+ Uint128Low64(lhs) + Uint128Low64(rhs)),
+ lhs);
+#endif
+}
+
+#if !defined(ABSL_HAVE_INTRINSIC_INT128)
+namespace int128_internal {
+constexpr uint128 SubstructResult(uint128 result, uint128 lhs, uint128 rhs) {
+ // check for carry
+ return (Uint128Low64(lhs) < Uint128Low64(rhs))
+ ? MakeUint128(Uint128High64(result) - 1, Uint128Low64(result))
+ : result;
+}
+} // namespace int128_internal
+#endif
+
+constexpr uint128 operator-(uint128 lhs, uint128 rhs) {
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+ return static_cast<unsigned __int128>(lhs) -
+ static_cast<unsigned __int128>(rhs);
+#else
+ return int128_internal::SubstructResult(
+ MakeUint128(Uint128High64(lhs) - Uint128High64(rhs),
+ Uint128Low64(lhs) - Uint128Low64(rhs)),
+ lhs, rhs);
+#endif
}
inline uint128 operator*(uint128 lhs, uint128 rhs) {
@@ -943,6 +1001,18 @@ inline uint128 operator*(uint128 lhs, uint128 rhs) {
#endif // ABSL_HAVE_INTRINSIC128
}
+#if defined(ABSL_HAVE_INTRINSIC_INT128)
+inline uint128 operator/(uint128 lhs, uint128 rhs) {
+ return static_cast<unsigned __int128>(lhs) /
+ static_cast<unsigned __int128>(rhs);
+}
+
+inline uint128 operator%(uint128 lhs, uint128 rhs) {
+ return static_cast<unsigned __int128>(lhs) %
+ static_cast<unsigned __int128>(rhs);
+}
+#endif
+
// Increment/decrement operators.
inline uint128 uint128::operator++(int) {
@@ -1000,17 +1070,17 @@ inline int128& int128::operator=(unsigned long long v) {
}
// Arithmetic operators.
-
-int128 operator+(int128 lhs, int128 rhs);
-int128 operator-(int128 lhs, int128 rhs);
+constexpr int128 operator-(int128 v);
+constexpr int128 operator+(int128 lhs, int128 rhs);
+constexpr int128 operator-(int128 lhs, int128 rhs);
int128 operator*(int128 lhs, int128 rhs);
int128 operator/(int128 lhs, int128 rhs);
int128 operator%(int128 lhs, int128 rhs);
-int128 operator|(int128 lhs, int128 rhs);
-int128 operator&(int128 lhs, int128 rhs);
-int128 operator^(int128 lhs, int128 rhs);
-int128 operator<<(int128 lhs, int amount);
-int128 operator>>(int128 lhs, int amount);
+constexpr int128 operator|(int128 lhs, int128 rhs);
+constexpr int128 operator&(int128 lhs, int128 rhs);
+constexpr int128 operator^(int128 lhs, int128 rhs);
+constexpr int128 operator<<(int128 lhs, int amount);
+constexpr int128 operator>>(int128 lhs, int amount);
inline int128& int128::operator+=(int128 other) {
*this = *this + other;
@@ -1062,6 +1132,9 @@ inline int128& int128::operator>>=(int amount) {
return *this;
}
+// Forward declaration for comparison operators.
+constexpr bool operator!=(int128 lhs, int128 rhs);
+
namespace int128_internal {
// Casts from unsigned to signed while preserving the underlying binary
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc b/grpc/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc
index d6c76dd3..3945fa29 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc
+++ b/grpc/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc
@@ -155,7 +155,7 @@ constexpr int128::operator unsigned __int128() const {
#if defined(__clang__) && !defined(__ppc64__)
inline int128::operator float() const { return static_cast<float>(v_); }
-inline int128::operator double () const { return static_cast<double>(v_); }
+inline int128::operator double() const { return static_cast<double>(v_); }
inline int128::operator long double() const {
return static_cast<long double>(v_);
@@ -163,8 +163,8 @@ inline int128::operator long double() const {
#else // Clang on PowerPC
// Forward declaration for conversion operators to floating point types.
-int128 operator-(int128 v);
-bool operator!=(int128 lhs, int128 rhs);
+constexpr int128 operator-(int128 v);
+constexpr bool operator!=(int128 lhs, int128 rhs);
inline int128::operator float() const {
// We must convert the absolute value and then negate as needed, because
@@ -199,51 +199,45 @@ inline int128::operator long double() const {
// Comparison operators.
-inline bool operator==(int128 lhs, int128 rhs) {
+constexpr bool operator==(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) == static_cast<__int128>(rhs);
}
-inline bool operator!=(int128 lhs, int128 rhs) {
+constexpr bool operator!=(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) != static_cast<__int128>(rhs);
}
-inline bool operator<(int128 lhs, int128 rhs) {
+constexpr bool operator<(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) < static_cast<__int128>(rhs);
}
-inline bool operator>(int128 lhs, int128 rhs) {
+constexpr bool operator>(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) > static_cast<__int128>(rhs);
}
-inline bool operator<=(int128 lhs, int128 rhs) {
+constexpr bool operator<=(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) <= static_cast<__int128>(rhs);
}
-inline bool operator>=(int128 lhs, int128 rhs) {
+constexpr bool operator>=(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) >= static_cast<__int128>(rhs);
}
// Unary operators.
-inline int128 operator-(int128 v) {
- return -static_cast<__int128>(v);
-}
+constexpr int128 operator-(int128 v) { return -static_cast<__int128>(v); }
-inline bool operator!(int128 v) {
- return !static_cast<__int128>(v);
-}
+constexpr bool operator!(int128 v) { return !static_cast<__int128>(v); }
-inline int128 operator~(int128 val) {
- return ~static_cast<__int128>(val);
-}
+constexpr int128 operator~(int128 val) { return ~static_cast<__int128>(val); }
// Arithmetic operators.
-inline int128 operator+(int128 lhs, int128 rhs) {
+constexpr int128 operator+(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) + static_cast<__int128>(rhs);
}
-inline int128 operator-(int128 lhs, int128 rhs) {
+constexpr int128 operator-(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) - static_cast<__int128>(rhs);
}
@@ -281,22 +275,22 @@ inline int128& int128::operator--() {
return *this;
}
-inline int128 operator|(int128 lhs, int128 rhs) {
+constexpr int128 operator|(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) | static_cast<__int128>(rhs);
}
-inline int128 operator&(int128 lhs, int128 rhs) {
+constexpr int128 operator&(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) & static_cast<__int128>(rhs);
}
-inline int128 operator^(int128 lhs, int128 rhs) {
+constexpr int128 operator^(int128 lhs, int128 rhs) {
return static_cast<__int128>(lhs) ^ static_cast<__int128>(rhs);
}
-inline int128 operator<<(int128 lhs, int amount) {
+constexpr int128 operator<<(int128 lhs, int amount) {
return static_cast<__int128>(lhs) << amount;
}
-inline int128 operator>>(int128 lhs, int amount) {
+constexpr int128 operator>>(int128 lhs, int amount) {
return static_cast<__int128>(lhs) >> amount;
}
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc b/grpc/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc
index c753771a..8834804c 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc
+++ b/grpc/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc
@@ -134,10 +134,6 @@ constexpr int128::operator unsigned long long() const { // NOLINT(runtime/int)
return static_cast<unsigned long long>(lo_); // NOLINT(runtime/int)
}
-// Forward declaration for conversion operators to floating point types.
-int128 operator-(int128 v);
-bool operator!=(int128 lhs, int128 rhs);
-
inline int128::operator float() const {
// We must convert the absolute value and then negate as needed, because
// floating point types are typically sign-magnitude. Otherwise, the
@@ -169,76 +165,80 @@ inline int128::operator long double() const {
// Comparison operators.
-inline bool operator==(int128 lhs, int128 rhs) {
+constexpr bool operator==(int128 lhs, int128 rhs) {
return (Int128Low64(lhs) == Int128Low64(rhs) &&
Int128High64(lhs) == Int128High64(rhs));
}
-inline bool operator!=(int128 lhs, int128 rhs) {
- return !(lhs == rhs);
-}
+constexpr bool operator!=(int128 lhs, int128 rhs) { return !(lhs == rhs); }
-inline bool operator<(int128 lhs, int128 rhs) {
+constexpr bool operator<(int128 lhs, int128 rhs) {
return (Int128High64(lhs) == Int128High64(rhs))
? (Int128Low64(lhs) < Int128Low64(rhs))
: (Int128High64(lhs) < Int128High64(rhs));
}
-inline bool operator>(int128 lhs, int128 rhs) {
+constexpr bool operator>(int128 lhs, int128 rhs) {
return (Int128High64(lhs) == Int128High64(rhs))
? (Int128Low64(lhs) > Int128Low64(rhs))
: (Int128High64(lhs) > Int128High64(rhs));
}
-inline bool operator<=(int128 lhs, int128 rhs) {
- return !(lhs > rhs);
-}
+constexpr bool operator<=(int128 lhs, int128 rhs) { return !(lhs > rhs); }
-inline bool operator>=(int128 lhs, int128 rhs) {
- return !(lhs < rhs);
-}
+constexpr bool operator>=(int128 lhs, int128 rhs) { return !(lhs < rhs); }
// Unary operators.
-inline int128 operator-(int128 v) {
- int64_t hi = ~Int128High64(v);
- uint64_t lo = ~Int128Low64(v) + 1;
- if (lo == 0) ++hi; // carry
- return MakeInt128(hi, lo);
+constexpr int128 operator-(int128 v) {
+ return MakeInt128(~Int128High64(v) + (Int128Low64(v) == 0),
+ ~Int128Low64(v) + 1);
}
-inline bool operator!(int128 v) {
+constexpr bool operator!(int128 v) {
return !Int128Low64(v) && !Int128High64(v);
}
-inline int128 operator~(int128 val) {
+constexpr int128 operator~(int128 val) {
return MakeInt128(~Int128High64(val), ~Int128Low64(val));
}
// Arithmetic operators.
-inline int128 operator+(int128 lhs, int128 rhs) {
- int128 result = MakeInt128(Int128High64(lhs) + Int128High64(rhs),
- Int128Low64(lhs) + Int128Low64(rhs));
- if (Int128Low64(result) < Int128Low64(lhs)) { // check for carry
- return MakeInt128(Int128High64(result) + 1, Int128Low64(result));
- }
- return result;
+namespace int128_internal {
+constexpr int128 SignedAddResult(int128 result, int128 lhs) {
+ // check for carry
+ return (Int128Low64(result) < Int128Low64(lhs))
+ ? MakeInt128(Int128High64(result) + 1, Int128Low64(result))
+ : result;
+}
+} // namespace int128_internal
+constexpr int128 operator+(int128 lhs, int128 rhs) {
+ return int128_internal::SignedAddResult(
+ MakeInt128(Int128High64(lhs) + Int128High64(rhs),
+ Int128Low64(lhs) + Int128Low64(rhs)),
+ lhs);
}
-inline int128 operator-(int128 lhs, int128 rhs) {
- int128 result = MakeInt128(Int128High64(lhs) - Int128High64(rhs),
- Int128Low64(lhs) - Int128Low64(rhs));
- if (Int128Low64(lhs) < Int128Low64(rhs)) { // check for carry
- return MakeInt128(Int128High64(result) - 1, Int128Low64(result));
- }
- return result;
+namespace int128_internal {
+constexpr int128 SignedSubstructResult(int128 result, int128 lhs, int128 rhs) {
+ // check for carry
+ return (Int128Low64(lhs) < Int128Low64(rhs))
+ ? MakeInt128(Int128High64(result) - 1, Int128Low64(result))
+ : result;
+}
+} // namespace int128_internal
+constexpr int128 operator-(int128 lhs, int128 rhs) {
+ return int128_internal::SignedSubstructResult(
+ MakeInt128(Int128High64(lhs) - Int128High64(rhs),
+ Int128Low64(lhs) - Int128Low64(rhs)),
+ lhs, rhs);
}
inline int128 operator*(int128 lhs, int128 rhs) {
- uint128 result = uint128(lhs) * rhs;
- return MakeInt128(int128_internal::BitCastToSigned(Uint128High64(result)),
- Uint128Low64(result));
+ return MakeInt128(
+ int128_internal::BitCastToSigned(Uint128High64(uint128(lhs) * rhs)),
+ Uint128Low64(uint128(lhs) * rhs));
}
inline int128 int128::operator++(int) {
@@ -263,46 +263,49 @@ inline int128& int128::operator--() {
return *this;
}
-inline int128 operator|(int128 lhs, int128 rhs) {
+constexpr int128 operator|(int128 lhs, int128 rhs) {
return MakeInt128(Int128High64(lhs) | Int128High64(rhs),
Int128Low64(lhs) | Int128Low64(rhs));
}
-inline int128 operator&(int128 lhs, int128 rhs) {
+constexpr int128 operator&(int128 lhs, int128 rhs) {
return MakeInt128(Int128High64(lhs) & Int128High64(rhs),
Int128Low64(lhs) & Int128Low64(rhs));
}
-inline int128 operator^(int128 lhs, int128 rhs) {
+constexpr int128 operator^(int128 lhs, int128 rhs) {
return MakeInt128(Int128High64(lhs) ^ Int128High64(rhs),
Int128Low64(lhs) ^ Int128Low64(rhs));
}
-inline int128 operator<<(int128 lhs, int amount) {
- // uint64_t shifts of >= 64 are undefined, so we need some special-casing.
- if (amount < 64) {
- if (amount != 0) {
- return MakeInt128(
- (Int128High64(lhs) << amount) |
- static_cast<int64_t>(Int128Low64(lhs) >> (64 - amount)),
- Int128Low64(lhs) << amount);
- }
- return lhs;
- }
- return MakeInt128(static_cast<int64_t>(Int128Low64(lhs) << (amount - 64)), 0);
-}
-
-inline int128 operator>>(int128 lhs, int amount) {
- // uint64_t shifts of >= 64 are undefined, so we need some special-casing.
- if (amount < 64) {
- if (amount != 0) {
- return MakeInt128(
- Int128High64(lhs) >> amount,
- (Int128Low64(lhs) >> amount) |
- (static_cast<uint64_t>(Int128High64(lhs)) << (64 - amount)));
- }
- return lhs;
- }
- return MakeInt128(0,
- static_cast<uint64_t>(Int128High64(lhs) >> (amount - 64)));
+constexpr int128 operator<<(int128 lhs, int amount) {
+ // int64_t shifts of >= 64 are undefined, so we need some special-casing.
+ return amount >= 64
+ ? MakeInt128(
+ static_cast<int64_t>(Int128Low64(lhs) << (amount - 64)), 0)
+ : amount == 0
+ ? lhs
+ : MakeInt128(
+ (Int128High64(lhs) << amount) |
+ static_cast<int64_t>(Int128Low64(lhs) >> (64 - amount)),
+ Int128Low64(lhs) << amount);
+}
+
+constexpr int128 operator>>(int128 lhs, int amount) {
+ // int64_t shifts of >= 64 are undefined, so we need some special-casing.
+ // The (Int128High64(lhs) >> 32) >> 32 "trick" causes the the most significant
+ // int64 to be inititialized with all zeros or all ones correctly. It takes
+ // into account whether the number is negative or positive, and whether the
+ // current architecture does arithmetic or logical right shifts for negative
+ // numbers.
+ return amount >= 64
+ ? MakeInt128(
+ (Int128High64(lhs) >> 32) >> 32,
+ static_cast<uint64_t>(Int128High64(lhs) >> (amount - 64)))
+ : amount == 0
+ ? lhs
+ : MakeInt128(Int128High64(lhs) >> amount,
+ (Int128Low64(lhs) >> amount) |
+ (static_cast<uint64_t>(Int128High64(lhs))
+ << (64 - amount)));
}
diff --git a/grpc/third_party/abseil-cpp/absl/numeric/int128_test.cc b/grpc/third_party/abseil-cpp/absl/numeric/int128_test.cc
index bc86c714..dd9425d7 100644
--- a/grpc/third_party/abseil-cpp/absl/numeric/int128_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/numeric/int128_test.cc
@@ -226,6 +226,11 @@ TEST(Uint128, AllTests) {
EXPECT_EQ(test >>= 1, one);
EXPECT_EQ(test <<= 1, two);
+ EXPECT_EQ(big, +big);
+ EXPECT_EQ(two, +two);
+ EXPECT_EQ(absl::Uint128Max(), +absl::Uint128Max());
+ EXPECT_EQ(zero, +zero);
+
EXPECT_EQ(big, -(-big));
EXPECT_EQ(two, -((-one) - 1));
EXPECT_EQ(absl::Uint128Max(), -one);
@@ -234,6 +239,24 @@ TEST(Uint128, AllTests) {
EXPECT_EQ(absl::Uint128Max(), absl::kuint128max);
}
+TEST(Int128, RightShiftOfNegativeNumbers) {
+ absl::int128 minus_six = -6;
+ absl::int128 minus_three = -3;
+ absl::int128 minus_two = -2;
+ absl::int128 minus_one = -1;
+ if ((-6 >> 1) == -3) {
+ // Right shift is arithmetic (sign propagates)
+ EXPECT_EQ(minus_six >> 1, minus_three);
+ EXPECT_EQ(minus_six >> 2, minus_two);
+ EXPECT_EQ(minus_six >> 65, minus_one);
+ } else {
+ // Right shift is logical (zeros shifted in at MSB)
+ EXPECT_EQ(minus_six >> 1, absl::int128(absl::uint128(minus_six) >> 1));
+ EXPECT_EQ(minus_six >> 2, absl::int128(absl::uint128(minus_six) >> 2));
+ EXPECT_EQ(minus_six >> 65, absl::int128(absl::uint128(minus_six) >> 65));
+ }
+}
+
TEST(Uint128, ConversionTests) {
EXPECT_TRUE(absl::MakeUint128(1, 0));
@@ -769,6 +792,19 @@ TEST(Int128, ComparisonTest) {
}
}
+TEST(Int128, UnaryPlusTest) {
+ int64_t values64[] = {0, 1, 12345, 0x4000000000000000,
+ std::numeric_limits<int64_t>::max()};
+ for (int64_t value : values64) {
+ SCOPED_TRACE(::testing::Message() << "value = " << value);
+
+ EXPECT_EQ(absl::int128(value), +absl::int128(value));
+ EXPECT_EQ(absl::int128(-value), +absl::int128(-value));
+ EXPECT_EQ(absl::MakeInt128(value, 0), +absl::MakeInt128(value, 0));
+ EXPECT_EQ(absl::MakeInt128(-value, 0), +absl::MakeInt128(-value, 0));
+ }
+}
+
TEST(Int128, UnaryNegationTest) {
int64_t values64[] = {0, 1, 12345, 0x4000000000000000,
std::numeric_limits<int64_t>::max()};
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/profiling/BUILD.bazel
new file mode 100644
index 00000000..496a06b2
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/BUILD.bazel
@@ -0,0 +1,126 @@
+# Copyright 2021 The Abseil Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load(
+ "//absl:copts/configure_copts.bzl",
+ "ABSL_DEFAULT_COPTS",
+ "ABSL_DEFAULT_LINKOPTS",
+ "ABSL_TEST_COPTS",
+)
+
+package(default_visibility = ["//visibility:private"])
+
+licenses(["notice"])
+
+cc_library(
+ name = "sample_recorder",
+ hdrs = ["internal/sample_recorder.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/synchronization",
+ "//absl/time",
+ ],
+)
+
+cc_test(
+ name = "sample_recorder_test",
+ srcs = ["internal/sample_recorder_test.cc"],
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ deps = [
+ ":sample_recorder",
+ "//absl/base:core_headers",
+ "//absl/synchronization",
+ "//absl/synchronization:thread_pool",
+ "//absl/time",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_library(
+ name = "exponential_biased",
+ srcs = ["internal/exponential_biased.cc"],
+ hdrs = ["internal/exponential_biased.h"],
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ ],
+)
+
+cc_test(
+ name = "exponential_biased_test",
+ size = "small",
+ srcs = ["internal/exponential_biased_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":exponential_biased",
+ "//absl/strings",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_library(
+ name = "periodic_sampler",
+ srcs = ["internal/periodic_sampler.cc"],
+ hdrs = ["internal/periodic_sampler.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ ":exponential_biased",
+ "//absl/base:core_headers",
+ ],
+)
+
+cc_test(
+ name = "periodic_sampler_test",
+ size = "small",
+ srcs = ["internal/periodic_sampler_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":periodic_sampler",
+ "//absl/base:core_headers",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_binary(
+ name = "periodic_sampler_benchmark",
+ testonly = 1,
+ srcs = ["internal/periodic_sampler_benchmark.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ tags = ["benchmark"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":periodic_sampler",
+ "//absl/base:core_headers",
+ "@com_github_google_benchmark//:benchmark_main",
+ ],
+)
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/profiling/CMakeLists.txt
new file mode 100644
index 00000000..9b3a7102
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/CMakeLists.txt
@@ -0,0 +1,93 @@
+# Copyright 2021 The Abseil Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+absl_cc_library(
+ NAME
+ sample_recorder
+ HDRS
+ "internal/sample_recorder.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::base
+ absl::synchronization
+)
+
+absl_cc_test(
+ NAME
+ sample_recorder_test
+ SRCS
+ "internal/sample_recorder_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::sample_recorder
+ absl::time
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ exponential_biased
+ SRCS
+ "internal/exponential_biased.cc"
+ HDRS
+ "internal/exponential_biased.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+ absl::core_headers
+)
+
+absl_cc_test(
+ NAME
+ exponential_biased_test
+ SRCS
+ "internal/exponential_biased_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::exponential_biased
+ absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ periodic_sampler
+ SRCS
+ "internal/periodic_sampler.cc"
+ HDRS
+ "internal/periodic_sampler.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::core_headers
+ absl::exponential_biased
+)
+
+absl_cc_test(
+ NAME
+ periodic_sampler_test
+ SRCS
+ "internal/periodic_sampler_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::core_headers
+ absl::periodic_sampler
+ GTest::gmock_main
+)
+
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc
new file mode 100644
index 00000000..81d9a757
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc
@@ -0,0 +1,93 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/exponential_biased.h"
+
+#include <stdint.h>
+
+#include <algorithm>
+#include <atomic>
+#include <cmath>
+#include <limits>
+
+#include "absl/base/attributes.h"
+#include "absl/base/optimization.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+// The algorithm generates a random number between 0 and 1 and applies the
+// inverse cumulative distribution function for an exponential. Specifically:
+// Let m be the inverse of the sample period, then the probability
+// distribution function is m*exp(-mx) so the CDF is
+// p = 1 - exp(-mx), so
+// q = 1 - p = exp(-mx)
+// log_e(q) = -mx
+// -log_e(q)/m = x
+// log_2(q) * (-log_e(2) * 1/m) = x
+// In the code, q is actually in the range 1 to 2**26, hence the -26 below
+int64_t ExponentialBiased::GetSkipCount(int64_t mean) {
+ if (ABSL_PREDICT_FALSE(!initialized_)) {
+ Initialize();
+ }
+
+ uint64_t rng = NextRandom(rng_);
+ rng_ = rng;
+
+ // Take the top 26 bits as the random number
+ // (This plus the 1<<58 sampling bound give a max possible step of
+ // 5194297183973780480 bytes.)
+ // The uint32_t cast is to prevent a (hard-to-reproduce) NAN
+ // under piii debug for some binaries.
+ double q = static_cast<uint32_t>(rng >> (kPrngNumBits - 26)) + 1.0;
+ // Put the computed p-value through the CDF of a geometric.
+ double interval = bias_ + (std::log2(q) - 26) * (-std::log(2.0) * mean);
+ // Very large values of interval overflow int64_t. To avoid that, we will
+ // cheat and clamp any huge values to (int64_t max)/2. This is a potential
+ // source of bias, but the mean would need to be such a large value that it's
+ // not likely to come up. For example, with a mean of 1e18, the probability of
+ // hitting this condition is about 1/1000. For a mean of 1e17, standard
+ // calculators claim that this event won't happen.
+ if (interval > static_cast<double>(std::numeric_limits<int64_t>::max() / 2)) {
+ // Assume huge values are bias neutral, retain bias for next call.
+ return std::numeric_limits<int64_t>::max() / 2;
+ }
+ double value = std::rint(interval);
+ bias_ = interval - value;
+ return value;
+}
+
+int64_t ExponentialBiased::GetStride(int64_t mean) {
+ return GetSkipCount(mean - 1) + 1;
+}
+
+void ExponentialBiased::Initialize() {
+ // We don't get well distributed numbers from `this` so we call NextRandom() a
+ // bunch to mush the bits around. We use a global_rand to handle the case
+ // where the same thread (by memory address) gets created and destroyed
+ // repeatedly.
+ ABSL_CONST_INIT static std::atomic<uint32_t> global_rand(0);
+ uint64_t r = reinterpret_cast<uint64_t>(this) +
+ global_rand.fetch_add(1, std::memory_order_relaxed);
+ for (int i = 0; i < 20; ++i) {
+ r = NextRandom(r);
+ }
+ rng_ = r;
+ initialized_ = true;
+}
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h
new file mode 100644
index 00000000..d31f7782
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h
@@ -0,0 +1,130 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_PROFILING_INTERNAL_EXPONENTIAL_BIASED_H_
+#define ABSL_PROFILING_INTERNAL_EXPONENTIAL_BIASED_H_
+
+#include <stdint.h>
+
+#include "absl/base/config.h"
+#include "absl/base/macros.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+// ExponentialBiased provides a small and fast random number generator for a
+// rounded exponential distribution. This generator manages very little state,
+// and imposes no synchronization overhead. This makes it useful in specialized
+// scenarios requiring minimum overhead, such as stride based periodic sampling.
+//
+// ExponentialBiased provides two closely related functions, GetSkipCount() and
+// GetStride(), both returning a rounded integer defining a number of events
+// required before some event with a given mean probability occurs.
+//
+// The distribution is useful to generate a random wait time or some periodic
+// event with a given mean probability. For example, if an action is supposed to
+// happen on average once every 'N' events, then we can get a random 'stride'
+// counting down how long before the event to happen. For example, if we'd want
+// to sample one in every 1000 'Frobber' calls, our code could look like this:
+//
+// Frobber::Frobber() {
+// stride_ = exponential_biased_.GetStride(1000);
+// }
+//
+// void Frobber::Frob(int arg) {
+// if (--stride == 0) {
+// SampleFrob(arg);
+// stride_ = exponential_biased_.GetStride(1000);
+// }
+// ...
+// }
+//
+// The rounding of the return value creates a bias, especially for smaller means
+// where the distribution of the fraction is not evenly distributed. We correct
+// this bias by tracking the fraction we rounded up or down on each iteration,
+// effectively tracking the distance between the cumulative value, and the
+// rounded cumulative value. For example, given a mean of 2:
+//
+// raw = 1.63076, cumulative = 1.63076, rounded = 2, bias = -0.36923
+// raw = 0.14624, cumulative = 1.77701, rounded = 2, bias = 0.14624
+// raw = 4.93194, cumulative = 6.70895, rounded = 7, bias = -0.06805
+// raw = 0.24206, cumulative = 6.95101, rounded = 7, bias = 0.24206
+// etc...
+//
+// Adjusting with rounding bias is relatively trivial:
+//
+// double value = bias_ + exponential_distribution(mean)();
+// double rounded_value = std::rint(value);
+// bias_ = value - rounded_value;
+// return rounded_value;
+//
+// This class is thread-compatible.
+class ExponentialBiased {
+ public:
+ // The number of bits set by NextRandom.
+ static constexpr int kPrngNumBits = 48;
+
+ // `GetSkipCount()` returns the number of events to skip before some chosen
+ // event happens. For example, randomly tossing a coin, we will on average
+ // throw heads once before we get tails. We can simulate random coin tosses
+ // using GetSkipCount() as:
+ //
+ // ExponentialBiased eb;
+ // for (...) {
+ // int number_of_heads_before_tail = eb.GetSkipCount(1);
+ // for (int flips = 0; flips < number_of_heads_before_tail; ++flips) {
+ // printf("head...");
+ // }
+ // printf("tail\n");
+ // }
+ //
+ int64_t GetSkipCount(int64_t mean);
+
+ // GetStride() returns the number of events required for a specific event to
+ // happen. See the class comments for a usage example. `GetStride()` is
+ // equivalent to `GetSkipCount(mean - 1) + 1`. When to use `GetStride()` or
+ // `GetSkipCount()` depends mostly on what best fits the use case.
+ int64_t GetStride(int64_t mean);
+
+ // Computes a random number in the range [0, 1<<(kPrngNumBits+1) - 1]
+ //
+ // This is public to enable testing.
+ static uint64_t NextRandom(uint64_t rnd);
+
+ private:
+ void Initialize();
+
+ uint64_t rng_{0};
+ double bias_{0};
+ bool initialized_{false};
+};
+
+// Returns the next prng value.
+// pRNG is: aX+b mod c with a = 0x5DEECE66D, b = 0xB, c = 1<<48
+// This is the lrand64 generator.
+inline uint64_t ExponentialBiased::NextRandom(uint64_t rnd) {
+ const uint64_t prng_mult = uint64_t{0x5DEECE66D};
+ const uint64_t prng_add = 0xB;
+ const uint64_t prng_mod_power = 48;
+ const uint64_t prng_mod_mask =
+ ~((~static_cast<uint64_t>(0)) << prng_mod_power);
+ return (prng_mult * rnd + prng_add) & prng_mod_mask;
+}
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_PROFILING_INTERNAL_EXPONENTIAL_BIASED_H_
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc
new file mode 100644
index 00000000..5675001d
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/exponential_biased_test.cc
@@ -0,0 +1,199 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/exponential_biased.h"
+
+#include <stddef.h>
+
+#include <cmath>
+#include <cstdint>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/strings/str_cat.h"
+
+using ::testing::Ge;
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+MATCHER_P2(IsBetween, a, b,
+ absl::StrCat(std::string(negation ? "isn't" : "is"), " between ", a,
+ " and ", b)) {
+ return a <= arg && arg <= b;
+}
+
+// Tests of the quality of the random numbers generated
+// This uses the Anderson Darling test for uniformity.
+// See "Evaluating the Anderson-Darling Distribution" by Marsaglia
+// for details.
+
+// Short cut version of ADinf(z), z>0 (from Marsaglia)
+// This returns the p-value for Anderson Darling statistic in
+// the limit as n-> infinity. For finite n, apply the error fix below.
+double AndersonDarlingInf(double z) {
+ if (z < 2) {
+ return exp(-1.2337141 / z) / sqrt(z) *
+ (2.00012 +
+ (0.247105 -
+ (0.0649821 - (0.0347962 - (0.011672 - 0.00168691 * z) * z) * z) *
+ z) *
+ z);
+ }
+ return exp(
+ -exp(1.0776 -
+ (2.30695 -
+ (0.43424 - (0.082433 - (0.008056 - 0.0003146 * z) * z) * z) * z) *
+ z));
+}
+
+// Corrects the approximation error in AndersonDarlingInf for small values of n
+// Add this to AndersonDarlingInf to get a better approximation
+// (from Marsaglia)
+double AndersonDarlingErrFix(int n, double x) {
+ if (x > 0.8) {
+ return (-130.2137 +
+ (745.2337 -
+ (1705.091 - (1950.646 - (1116.360 - 255.7844 * x) * x) * x) * x) *
+ x) /
+ n;
+ }
+ double cutoff = 0.01265 + 0.1757 / n;
+ if (x < cutoff) {
+ double t = x / cutoff;
+ t = sqrt(t) * (1 - t) * (49 * t - 102);
+ return t * (0.0037 / (n * n) + 0.00078 / n + 0.00006) / n;
+ } else {
+ double t = (x - cutoff) / (0.8 - cutoff);
+ t = -0.00022633 +
+ (6.54034 - (14.6538 - (14.458 - (8.259 - 1.91864 * t) * t) * t) * t) *
+ t;
+ return t * (0.04213 + 0.01365 / n) / n;
+ }
+}
+
+// Returns the AndersonDarling p-value given n and the value of the statistic
+double AndersonDarlingPValue(int n, double z) {
+ double ad = AndersonDarlingInf(z);
+ double errfix = AndersonDarlingErrFix(n, ad);
+ return ad + errfix;
+}
+
+double AndersonDarlingStatistic(const std::vector<double>& random_sample) {
+ int n = random_sample.size();
+ double ad_sum = 0;
+ for (int i = 0; i < n; i++) {
+ ad_sum += (2 * i + 1) *
+ std::log(random_sample[i] * (1 - random_sample[n - 1 - i]));
+ }
+ double ad_statistic = -n - 1 / static_cast<double>(n) * ad_sum;
+ return ad_statistic;
+}
+
+// Tests if the array of doubles is uniformly distributed.
+// Returns the p-value of the Anderson Darling Statistic
+// for the given set of sorted random doubles
+// See "Evaluating the Anderson-Darling Distribution" by
+// Marsaglia and Marsaglia for details.
+double AndersonDarlingTest(const std::vector<double>& random_sample) {
+ double ad_statistic = AndersonDarlingStatistic(random_sample);
+ double p = AndersonDarlingPValue(random_sample.size(), ad_statistic);
+ return p;
+}
+
+TEST(ExponentialBiasedTest, CoinTossDemoWithGetSkipCount) {
+ ExponentialBiased eb;
+ for (int runs = 0; runs < 10; ++runs) {
+ for (int flips = eb.GetSkipCount(1); flips > 0; --flips) {
+ printf("head...");
+ }
+ printf("tail\n");
+ }
+ int heads = 0;
+ for (int i = 0; i < 10000000; i += 1 + eb.GetSkipCount(1)) {
+ ++heads;
+ }
+ printf("Heads = %d (%f%%)\n", heads, 100.0 * heads / 10000000);
+}
+
+TEST(ExponentialBiasedTest, SampleDemoWithStride) {
+ ExponentialBiased eb;
+ int stride = eb.GetStride(10);
+ int samples = 0;
+ for (int i = 0; i < 10000000; ++i) {
+ if (--stride == 0) {
+ ++samples;
+ stride = eb.GetStride(10);
+ }
+ }
+ printf("Samples = %d (%f%%)\n", samples, 100.0 * samples / 10000000);
+}
+
+
+// Testing that NextRandom generates uniform random numbers. Applies the
+// Anderson-Darling test for uniformity
+TEST(ExponentialBiasedTest, TestNextRandom) {
+ for (auto n : std::vector<int>({
+ 10, // Check short-range correlation
+ 100, 1000,
+ 10000 // Make sure there's no systemic error
+ })) {
+ uint64_t x = 1;
+ // This assumes that the prng returns 48 bit numbers
+ uint64_t max_prng_value = static_cast<uint64_t>(1) << 48;
+ // Initialize.
+ for (int i = 1; i <= 20; i++) {
+ x = ExponentialBiased::NextRandom(x);
+ }
+ std::vector<uint64_t> int_random_sample(n);
+ // Collect samples
+ for (int i = 0; i < n; i++) {
+ int_random_sample[i] = x;
+ x = ExponentialBiased::NextRandom(x);
+ }
+ // First sort them...
+ std::sort(int_random_sample.begin(), int_random_sample.end());
+ std::vector<double> random_sample(n);
+ // Convert them to uniform randoms (in the range [0,1])
+ for (int i = 0; i < n; i++) {
+ random_sample[i] =
+ static_cast<double>(int_random_sample[i]) / max_prng_value;
+ }
+ // Now compute the Anderson-Darling statistic
+ double ad_pvalue = AndersonDarlingTest(random_sample);
+ EXPECT_GT(std::min(ad_pvalue, 1 - ad_pvalue), 0.0001)
+ << "prng is not uniform: n = " << n << " p = " << ad_pvalue;
+ }
+}
+
+// The generator needs to be available as a thread_local and as a static
+// variable.
+TEST(ExponentialBiasedTest, InitializationModes) {
+ ABSL_CONST_INIT static ExponentialBiased eb_static;
+ EXPECT_THAT(eb_static.GetSkipCount(2), Ge(0));
+
+#ifdef ABSL_HAVE_THREAD_LOCAL
+ thread_local ExponentialBiased eb_thread;
+ EXPECT_THAT(eb_thread.GetSkipCount(2), Ge(0));
+#endif
+
+ ExponentialBiased eb_stack;
+ EXPECT_THAT(eb_stack.GetSkipCount(2), Ge(0));
+}
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.cc
new file mode 100644
index 00000000..a738a82c
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.cc
@@ -0,0 +1,53 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/periodic_sampler.h"
+
+#include <atomic>
+
+#include "absl/profiling/internal/exponential_biased.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+int64_t PeriodicSamplerBase::GetExponentialBiased(int period) noexcept {
+ return rng_.GetStride(period);
+}
+
+bool PeriodicSamplerBase::SubtleConfirmSample() noexcept {
+ int current_period = period();
+
+ // Deal with period case 0 (always off) and 1 (always on)
+ if (ABSL_PREDICT_FALSE(current_period < 2)) {
+ stride_ = 0;
+ return current_period == 1;
+ }
+
+ // Check if this is the first call to Sample()
+ if (ABSL_PREDICT_FALSE(stride_ == 1)) {
+ stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period));
+ if (static_cast<int64_t>(stride_) < -1) {
+ ++stride_;
+ return false;
+ }
+ }
+
+ stride_ = static_cast<uint64_t>(-GetExponentialBiased(current_period));
+ return true;
+}
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h
new file mode 100644
index 00000000..54f0af45
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler.h
@@ -0,0 +1,211 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_
+#define ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_
+
+#include <stdint.h>
+
+#include <atomic>
+
+#include "absl/base/optimization.h"
+#include "absl/profiling/internal/exponential_biased.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+// PeriodicSamplerBase provides the basic period sampler implementation.
+//
+// This is the base class for the templated PeriodicSampler class, which holds
+// a global std::atomic value identified by a user defined tag, such that
+// each specific PeriodSampler implementation holds its own global period.
+//
+// PeriodicSamplerBase is thread-compatible except where stated otherwise.
+class PeriodicSamplerBase {
+ public:
+ // PeriodicSamplerBase is trivial / copyable / movable / destructible.
+ PeriodicSamplerBase() = default;
+ PeriodicSamplerBase(PeriodicSamplerBase&&) = default;
+ PeriodicSamplerBase(const PeriodicSamplerBase&) = default;
+
+ // Returns true roughly once every `period` calls. This is established by a
+ // randomly picked `stride` that is counted down on each call to `Sample`.
+ // This stride is picked such that the probability of `Sample()` returning
+ // true is 1 in `period`.
+ inline bool Sample() noexcept;
+
+ // The below methods are intended for optimized use cases where the
+ // size of the inlined fast path code is highly important. Applications
+ // should use the `Sample()` method unless they have proof that their
+ // specific use case requires the optimizations offered by these methods.
+ //
+ // An example of such a use case is SwissTable sampling. All sampling checks
+ // are in inlined SwissTable methods, and the number of call sites is huge.
+ // In this case, the inlined code size added to each translation unit calling
+ // SwissTable methods is non-trivial.
+ //
+ // The `SubtleMaybeSample()` function spuriously returns true even if the
+ // function should not be sampled, applications MUST match each call to
+ // 'SubtleMaybeSample()' returning true with a `SubtleConfirmSample()` call,
+ // and use the result of the latter as the sampling decision.
+ // In other words: the code should logically be equivalent to:
+ //
+ // if (SubtleMaybeSample() && SubtleConfirmSample()) {
+ // // Sample this call
+ // }
+ //
+ // In the 'inline-size' optimized case, the `SubtleConfirmSample()` call can
+ // be placed out of line, for example, the typical use case looks as follows:
+ //
+ // // --- frobber.h -----------
+ // void FrobberSampled();
+ //
+ // inline void FrobberImpl() {
+ // // ...
+ // }
+ //
+ // inline void Frobber() {
+ // if (ABSL_PREDICT_FALSE(sampler.SubtleMaybeSample())) {
+ // FrobberSampled();
+ // } else {
+ // FrobberImpl();
+ // }
+ // }
+ //
+ // // --- frobber.cc -----------
+ // void FrobberSampled() {
+ // if (!sampler.SubtleConfirmSample())) {
+ // // Spurious false positive
+ // FrobberImpl();
+ // return;
+ // }
+ //
+ // // Sampled execution
+ // // ...
+ // }
+ inline bool SubtleMaybeSample() noexcept;
+ bool SubtleConfirmSample() noexcept;
+
+ protected:
+ // We explicitly don't use a virtual destructor as this class is never
+ // virtually destroyed, and it keeps the class trivial, which avoids TLS
+ // prologue and epilogue code for our TLS instances.
+ ~PeriodicSamplerBase() = default;
+
+ // Returns the next stride for our sampler.
+ // This function is virtual for testing purposes only.
+ virtual int64_t GetExponentialBiased(int period) noexcept;
+
+ private:
+ // Returns the current period of this sampler. Thread-safe.
+ virtual int period() const noexcept = 0;
+
+ // Keep and decrement stride_ as an unsigned integer, but compare the value
+ // to zero casted as a signed int. clang and msvc do not create optimum code
+ // if we use signed for the combined decrement and sign comparison.
+ //
+ // Below 3 alternative options, all compiles generate the best code
+ // using the unsigned increment <---> signed int comparison option.
+ //
+ // Option 1:
+ // int64_t stride_;
+ // if (ABSL_PREDICT_TRUE(++stride_ < 0)) { ... }
+ //
+ // GCC x64 (OK) : https://gcc.godbolt.org/z/R5MzzA
+ // GCC ppc (OK) : https://gcc.godbolt.org/z/z7NZAt
+ // Clang x64 (BAD): https://gcc.godbolt.org/z/t4gPsd
+ // ICC x64 (OK) : https://gcc.godbolt.org/z/rE6s8W
+ // MSVC x64 (OK) : https://gcc.godbolt.org/z/ARMXqS
+ //
+ // Option 2:
+ // int64_t stride_ = 0;
+ // if (ABSL_PREDICT_TRUE(--stride_ >= 0)) { ... }
+ //
+ // GCC x64 (OK) : https://gcc.godbolt.org/z/jSQxYK
+ // GCC ppc (OK) : https://gcc.godbolt.org/z/VJdYaA
+ // Clang x64 (BAD): https://gcc.godbolt.org/z/Xm4NjX
+ // ICC x64 (OK) : https://gcc.godbolt.org/z/4snaFd
+ // MSVC x64 (BAD): https://gcc.godbolt.org/z/BgnEKE
+ //
+ // Option 3:
+ // uint64_t stride_;
+ // if (ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) { ... }
+ //
+ // GCC x64 (OK) : https://gcc.godbolt.org/z/bFbfPy
+ // GCC ppc (OK) : https://gcc.godbolt.org/z/S9KkUE
+ // Clang x64 (OK) : https://gcc.godbolt.org/z/UYzRb4
+ // ICC x64 (OK) : https://gcc.godbolt.org/z/ptTNfD
+ // MSVC x64 (OK) : https://gcc.godbolt.org/z/76j4-5
+ uint64_t stride_ = 0;
+ absl::profiling_internal::ExponentialBiased rng_;
+};
+
+inline bool PeriodicSamplerBase::SubtleMaybeSample() noexcept {
+ // See comments on `stride_` for the unsigned increment / signed compare.
+ if (ABSL_PREDICT_TRUE(static_cast<int64_t>(++stride_) < 0)) {
+ return false;
+ }
+ return true;
+}
+
+inline bool PeriodicSamplerBase::Sample() noexcept {
+ return ABSL_PREDICT_FALSE(SubtleMaybeSample()) ? SubtleConfirmSample()
+ : false;
+}
+
+// PeriodicSampler is a concreted periodic sampler implementation.
+// The user provided Tag identifies the implementation, and is required to
+// isolate the global state of this instance from other instances.
+//
+// Typical use case:
+//
+// struct HashTablezTag {};
+// thread_local PeriodicSampler sampler;
+//
+// void HashTableSamplingLogic(...) {
+// if (sampler.Sample()) {
+// HashTableSlowSamplePath(...);
+// }
+// }
+//
+template <typename Tag, int default_period = 0>
+class PeriodicSampler final : public PeriodicSamplerBase {
+ public:
+ ~PeriodicSampler() = default;
+
+ int period() const noexcept final {
+ return period_.load(std::memory_order_relaxed);
+ }
+
+ // Sets the global period for this sampler. Thread-safe.
+ // Setting a period of 0 disables the sampler, i.e., every call to Sample()
+ // will return false. Setting a period of 1 puts the sampler in 'always on'
+ // mode, i.e., every call to Sample() returns true.
+ static void SetGlobalPeriod(int period) {
+ period_.store(period, std::memory_order_relaxed);
+ }
+
+ private:
+ static std::atomic<int> period_;
+};
+
+template <typename Tag, int default_period>
+std::atomic<int> PeriodicSampler<Tag, default_period>::period_(default_period);
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_PROFILING_INTERNAL_PERIODIC_SAMPLER_H_
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_benchmark.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_benchmark.cc
new file mode 100644
index 00000000..8f0e5574
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_benchmark.cc
@@ -0,0 +1,79 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/periodic_sampler.h"
+#include "benchmark/benchmark.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+namespace {
+
+template <typename Sampler>
+void BM_Sample(Sampler* sampler, benchmark::State& state) {
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(sampler);
+ benchmark::DoNotOptimize(sampler->Sample());
+ }
+}
+
+template <typename Sampler>
+void BM_SampleMinunumInlined(Sampler* sampler, benchmark::State& state) {
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(sampler);
+ if (ABSL_PREDICT_FALSE(sampler->SubtleMaybeSample())) {
+ benchmark::DoNotOptimize(sampler->SubtleConfirmSample());
+ }
+ }
+}
+
+void BM_PeriodicSampler_TinySample(benchmark::State& state) {
+ struct Tag {};
+ PeriodicSampler<Tag, 10> sampler;
+ BM_Sample(&sampler, state);
+}
+BENCHMARK(BM_PeriodicSampler_TinySample);
+
+void BM_PeriodicSampler_ShortSample(benchmark::State& state) {
+ struct Tag {};
+ PeriodicSampler<Tag, 1024> sampler;
+ BM_Sample(&sampler, state);
+}
+BENCHMARK(BM_PeriodicSampler_ShortSample);
+
+void BM_PeriodicSampler_LongSample(benchmark::State& state) {
+ struct Tag {};
+ PeriodicSampler<Tag, 1024 * 1024> sampler;
+ BM_Sample(&sampler, state);
+}
+BENCHMARK(BM_PeriodicSampler_LongSample);
+
+void BM_PeriodicSampler_LongSampleMinunumInlined(benchmark::State& state) {
+ struct Tag {};
+ PeriodicSampler<Tag, 1024 * 1024> sampler;
+ BM_SampleMinunumInlined(&sampler, state);
+}
+BENCHMARK(BM_PeriodicSampler_LongSampleMinunumInlined);
+
+void BM_PeriodicSampler_Disabled(benchmark::State& state) {
+ struct Tag {};
+ PeriodicSampler<Tag, 0> sampler;
+ BM_Sample(&sampler, state);
+}
+BENCHMARK(BM_PeriodicSampler_Disabled);
+
+} // namespace
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc
new file mode 100644
index 00000000..ef986f38
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/periodic_sampler_test.cc
@@ -0,0 +1,177 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/periodic_sampler.h"
+
+#include <thread> // NOLINT(build/c++11)
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/attributes.h"
+#include "absl/base/macros.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+namespace {
+
+using testing::Eq;
+using testing::Return;
+using testing::StrictMock;
+
+class MockPeriodicSampler : public PeriodicSamplerBase {
+ public:
+ virtual ~MockPeriodicSampler() = default;
+
+ MOCK_METHOD(int, period, (), (const, noexcept));
+ MOCK_METHOD(int64_t, GetExponentialBiased, (int), (noexcept));
+};
+
+TEST(PeriodicSamplerBaseTest, Sample) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(16));
+ EXPECT_CALL(sampler, GetExponentialBiased(16))
+ .WillOnce(Return(2))
+ .WillOnce(Return(3))
+ .WillOnce(Return(4));
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerBaseTest, ImmediatelySample) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16));
+ EXPECT_CALL(sampler, GetExponentialBiased(16))
+ .WillOnce(Return(1))
+ .WillOnce(Return(2))
+ .WillOnce(Return(3));
+
+ EXPECT_TRUE(sampler.Sample());
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerBaseTest, Disabled) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(0));
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerBaseTest, AlwaysOn) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(1));
+
+ EXPECT_TRUE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerBaseTest, Disable) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).WillOnce(Return(16));
+ EXPECT_CALL(sampler, GetExponentialBiased(16)).WillOnce(Return(3));
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+
+ EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(0));
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerBaseTest, Enable) {
+ StrictMock<MockPeriodicSampler> sampler;
+
+ EXPECT_CALL(sampler, period()).WillOnce(Return(0));
+ EXPECT_FALSE(sampler.Sample());
+
+ EXPECT_CALL(sampler, period()).Times(2).WillRepeatedly(Return(16));
+ EXPECT_CALL(sampler, GetExponentialBiased(16))
+ .Times(2)
+ .WillRepeatedly(Return(3));
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_TRUE(sampler.Sample());
+
+ EXPECT_FALSE(sampler.Sample());
+ EXPECT_FALSE(sampler.Sample());
+}
+
+TEST(PeriodicSamplerTest, ConstructConstInit) {
+ struct Tag {};
+ ABSL_CONST_INIT static PeriodicSampler<Tag> sampler;
+ (void)sampler;
+}
+
+TEST(PeriodicSamplerTest, DefaultPeriod0) {
+ struct Tag {};
+ PeriodicSampler<Tag> sampler;
+ EXPECT_THAT(sampler.period(), Eq(0));
+}
+
+TEST(PeriodicSamplerTest, DefaultPeriod) {
+ struct Tag {};
+ PeriodicSampler<Tag, 100> sampler;
+ EXPECT_THAT(sampler.period(), Eq(100));
+}
+
+TEST(PeriodicSamplerTest, SetGlobalPeriod) {
+ struct Tag1 {};
+ struct Tag2 {};
+ PeriodicSampler<Tag1, 25> sampler1;
+ PeriodicSampler<Tag2, 50> sampler2;
+
+ EXPECT_THAT(sampler1.period(), Eq(25));
+ EXPECT_THAT(sampler2.period(), Eq(50));
+
+ std::thread thread([] {
+ PeriodicSampler<Tag1, 25> sampler1;
+ PeriodicSampler<Tag2, 50> sampler2;
+ EXPECT_THAT(sampler1.period(), Eq(25));
+ EXPECT_THAT(sampler2.period(), Eq(50));
+ sampler1.SetGlobalPeriod(10);
+ sampler2.SetGlobalPeriod(20);
+ });
+ thread.join();
+
+ EXPECT_THAT(sampler1.period(), Eq(10));
+ EXPECT_THAT(sampler2.period(), Eq(20));
+}
+
+} // namespace
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h b/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h
new file mode 100644
index 00000000..5e04a9cd
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h
@@ -0,0 +1,230 @@
+// Copyright 2018 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// -----------------------------------------------------------------------------
+// File: sample_recorder.h
+// -----------------------------------------------------------------------------
+//
+// This header file defines a lock-free linked list for recording samples
+// collected from a random/stochastic process.
+//
+// This utility is internal-only. Use at your own risk.
+
+#ifndef ABSL_PROFILING_INTERNAL_SAMPLE_RECORDER_H_
+#define ABSL_PROFILING_INTERNAL_SAMPLE_RECORDER_H_
+
+#include <atomic>
+#include <cstddef>
+#include <functional>
+
+#include "absl/base/config.h"
+#include "absl/base/thread_annotations.h"
+#include "absl/synchronization/mutex.h"
+#include "absl/time/time.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+// Sample<T> that has members required for linking samples in the linked list of
+// samples maintained by the SampleRecorder. Type T defines the sampled data.
+template <typename T>
+struct Sample {
+ // Guards the ability to restore the sample to a pristine state. This
+ // prevents races with sampling and resurrecting an object.
+ absl::Mutex init_mu;
+ T* next = nullptr;
+ T* dead ABSL_GUARDED_BY(init_mu) = nullptr;
+};
+
+// Holds samples and their associated stack traces with a soft limit of
+// `SetHashtablezMaxSamples()`.
+//
+// Thread safe.
+template <typename T>
+class SampleRecorder {
+ public:
+ SampleRecorder();
+ ~SampleRecorder();
+
+ // Registers for sampling. Returns an opaque registration info.
+ T* Register();
+
+ // Unregisters the sample.
+ void Unregister(T* sample);
+
+ // The dispose callback will be called on all samples the moment they are
+ // being unregistered. Only affects samples that are unregistered after the
+ // callback has been set.
+ // Returns the previous callback.
+ using DisposeCallback = void (*)(const T&);
+ DisposeCallback SetDisposeCallback(DisposeCallback f);
+
+ // Iterates over all the registered `StackInfo`s. Returning the number of
+ // samples that have been dropped.
+ int64_t Iterate(const std::function<void(const T& stack)>& f);
+
+ void SetMaxSamples(int32_t max);
+
+ private:
+ void PushNew(T* sample);
+ void PushDead(T* sample);
+ T* PopDead();
+
+ std::atomic<size_t> dropped_samples_;
+ std::atomic<size_t> size_estimate_;
+ std::atomic<int32_t> max_samples_{1 << 20};
+
+ // Intrusive lock free linked lists for tracking samples.
+ //
+ // `all_` records all samples (they are never removed from this list) and is
+ // terminated with a `nullptr`.
+ //
+ // `graveyard_.dead` is a circular linked list. When it is empty,
+ // `graveyard_.dead == &graveyard`. The list is circular so that
+ // every item on it (even the last) has a non-null dead pointer. This allows
+ // `Iterate` to determine if a given sample is live or dead using only
+ // information on the sample itself.
+ //
+ // For example, nodes [A, B, C, D, E] with [A, C, E] alive and [B, D] dead
+ // looks like this (G is the Graveyard):
+ //
+ // +---+ +---+ +---+ +---+ +---+
+ // all -->| A |--->| B |--->| C |--->| D |--->| E |
+ // | | | | | | | | | |
+ // +---+ | | +->| |-+ | | +->| |-+ | |
+ // | G | +---+ | +---+ | +---+ | +---+ | +---+
+ // | | | | | |
+ // | | --------+ +--------+ |
+ // +---+ |
+ // ^ |
+ // +--------------------------------------+
+ //
+ std::atomic<T*> all_;
+ T graveyard_;
+
+ std::atomic<DisposeCallback> dispose_;
+};
+
+template <typename T>
+typename SampleRecorder<T>::DisposeCallback
+SampleRecorder<T>::SetDisposeCallback(DisposeCallback f) {
+ return dispose_.exchange(f, std::memory_order_relaxed);
+}
+
+template <typename T>
+SampleRecorder<T>::SampleRecorder()
+ : dropped_samples_(0), size_estimate_(0), all_(nullptr), dispose_(nullptr) {
+ absl::MutexLock l(&graveyard_.init_mu);
+ graveyard_.dead = &graveyard_;
+}
+
+template <typename T>
+SampleRecorder<T>::~SampleRecorder() {
+ T* s = all_.load(std::memory_order_acquire);
+ while (s != nullptr) {
+ T* next = s->next;
+ delete s;
+ s = next;
+ }
+}
+
+template <typename T>
+void SampleRecorder<T>::PushNew(T* sample) {
+ sample->next = all_.load(std::memory_order_relaxed);
+ while (!all_.compare_exchange_weak(sample->next, sample,
+ std::memory_order_release,
+ std::memory_order_relaxed)) {
+ }
+}
+
+template <typename T>
+void SampleRecorder<T>::PushDead(T* sample) {
+ if (auto* dispose = dispose_.load(std::memory_order_relaxed)) {
+ dispose(*sample);
+ }
+
+ absl::MutexLock graveyard_lock(&graveyard_.init_mu);
+ absl::MutexLock sample_lock(&sample->init_mu);
+ sample->dead = graveyard_.dead;
+ graveyard_.dead = sample;
+}
+
+template <typename T>
+T* SampleRecorder<T>::PopDead() {
+ absl::MutexLock graveyard_lock(&graveyard_.init_mu);
+
+ // The list is circular, so eventually it collapses down to
+ // graveyard_.dead == &graveyard_
+ // when it is empty.
+ T* sample = graveyard_.dead;
+ if (sample == &graveyard_) return nullptr;
+
+ absl::MutexLock sample_lock(&sample->init_mu);
+ graveyard_.dead = sample->dead;
+ sample->dead = nullptr;
+ sample->PrepareForSampling();
+ return sample;
+}
+
+template <typename T>
+T* SampleRecorder<T>::Register() {
+ int64_t size = size_estimate_.fetch_add(1, std::memory_order_relaxed);
+ if (size > max_samples_.load(std::memory_order_relaxed)) {
+ size_estimate_.fetch_sub(1, std::memory_order_relaxed);
+ dropped_samples_.fetch_add(1, std::memory_order_relaxed);
+ return nullptr;
+ }
+
+ T* sample = PopDead();
+ if (sample == nullptr) {
+ // Resurrection failed. Hire a new warlock.
+ sample = new T();
+ PushNew(sample);
+ }
+
+ return sample;
+}
+
+template <typename T>
+void SampleRecorder<T>::Unregister(T* sample) {
+ PushDead(sample);
+ size_estimate_.fetch_sub(1, std::memory_order_relaxed);
+}
+
+template <typename T>
+int64_t SampleRecorder<T>::Iterate(
+ const std::function<void(const T& stack)>& f) {
+ T* s = all_.load(std::memory_order_acquire);
+ while (s != nullptr) {
+ absl::MutexLock l(&s->init_mu);
+ if (s->dead == nullptr) {
+ f(*s);
+ }
+ s = s->next;
+ }
+
+ return dropped_samples_.load(std::memory_order_relaxed);
+}
+
+template <typename T>
+void SampleRecorder<T>::SetMaxSamples(int32_t max) {
+ max_samples_.store(max, std::memory_order_release);
+}
+
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_PROFILING_INTERNAL_SAMPLE_RECORDER_H_
diff --git a/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc b/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc
new file mode 100644
index 00000000..ec6e0fa2
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc
@@ -0,0 +1,171 @@
+// Copyright 2018 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/profiling/internal/sample_recorder.h"
+
+#include <atomic>
+#include <random>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "absl/base/thread_annotations.h"
+#include "absl/synchronization/internal/thread_pool.h"
+#include "absl/synchronization/mutex.h"
+#include "absl/synchronization/notification.h"
+#include "absl/time/time.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace profiling_internal {
+
+namespace {
+using ::absl::synchronization_internal::ThreadPool;
+using ::testing::IsEmpty;
+using ::testing::UnorderedElementsAre;
+
+struct Info : public Sample<Info> {
+ public:
+ void PrepareForSampling() {}
+ std::atomic<size_t> size;
+ absl::Time create_time;
+};
+
+std::vector<size_t> GetSizes(SampleRecorder<Info>* s) {
+ std::vector<size_t> res;
+ s->Iterate([&](const Info& info) {
+ res.push_back(info.size.load(std::memory_order_acquire));
+ });
+ return res;
+}
+
+Info* Register(SampleRecorder<Info>* s, size_t size) {
+ auto* info = s->Register();
+ assert(info != nullptr);
+ info->size.store(size);
+ return info;
+}
+
+TEST(SampleRecorderTest, Registration) {
+ SampleRecorder<Info> sampler;
+ auto* info1 = Register(&sampler, 1);
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(1));
+
+ auto* info2 = Register(&sampler, 2);
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(1, 2));
+ info1->size.store(3);
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(3, 2));
+
+ sampler.Unregister(info1);
+ sampler.Unregister(info2);
+}
+
+TEST(SampleRecorderTest, Unregistration) {
+ SampleRecorder<Info> sampler;
+ std::vector<Info*> infos;
+ for (size_t i = 0; i < 3; ++i) {
+ infos.push_back(Register(&sampler, i));
+ }
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 1, 2));
+
+ sampler.Unregister(infos[1]);
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2));
+
+ infos.push_back(Register(&sampler, 3));
+ infos.push_back(Register(&sampler, 4));
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2, 3, 4));
+ sampler.Unregister(infos[3]);
+ EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2, 4));
+
+ sampler.Unregister(infos[0]);
+ sampler.Unregister(infos[2]);
+ sampler.Unregister(infos[4]);
+ EXPECT_THAT(GetSizes(&sampler), IsEmpty());
+}
+
+TEST(SampleRecorderTest, MultiThreaded) {
+ SampleRecorder<Info> sampler;
+ Notification stop;
+ ThreadPool pool(10);
+
+ for (int i = 0; i < 10; ++i) {
+ pool.Schedule([&sampler, &stop]() {
+ std::random_device rd;
+ std::mt19937 gen(rd());
+
+ std::vector<Info*> infoz;
+ while (!stop.HasBeenNotified()) {
+ if (infoz.empty()) {
+ infoz.push_back(sampler.Register());
+ }
+ switch (std::uniform_int_distribution<>(0, 2)(gen)) {
+ case 0: {
+ infoz.push_back(sampler.Register());
+ break;
+ }
+ case 1: {
+ size_t p =
+ std::uniform_int_distribution<>(0, infoz.size() - 1)(gen);
+ Info* info = infoz[p];
+ infoz[p] = infoz.back();
+ infoz.pop_back();
+ sampler.Unregister(info);
+ break;
+ }
+ case 2: {
+ absl::Duration oldest = absl::ZeroDuration();
+ sampler.Iterate([&](const Info& info) {
+ oldest = std::max(oldest, absl::Now() - info.create_time);
+ });
+ ASSERT_GE(oldest, absl::ZeroDuration());
+ break;
+ }
+ }
+ }
+ });
+ }
+ // The threads will hammer away. Give it a little bit of time for tsan to
+ // spot errors.
+ absl::SleepFor(absl::Seconds(3));
+ stop.Notify();
+}
+
+TEST(SampleRecorderTest, Callback) {
+ SampleRecorder<Info> sampler;
+
+ auto* info1 = Register(&sampler, 1);
+ auto* info2 = Register(&sampler, 2);
+
+ static const Info* expected;
+
+ auto callback = [](const Info& info) {
+ // We can't use `info` outside of this callback because the object will be
+ // disposed as soon as we return from here.
+ EXPECT_EQ(&info, expected);
+ };
+
+ // Set the callback.
+ EXPECT_EQ(sampler.SetDisposeCallback(callback), nullptr);
+ expected = info1;
+ sampler.Unregister(info1);
+
+ // Unset the callback.
+ EXPECT_EQ(callback, sampler.SetDisposeCallback(nullptr));
+ expected = nullptr; // no more calls.
+ sampler.Unregister(info2);
+}
+
+} // namespace
+} // namespace profiling_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/random/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/random/BUILD.bazel
index 66ffcbc7..fdde78b6 100644
--- a/grpc/third_party/abseil-cpp/absl/random/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/random/BUILD.bazel
@@ -16,7 +16,6 @@
# ABSL random-number generation libraries.
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/random/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/random/CMakeLists.txt
index 3009a034..9d1c67fb 100644
--- a/grpc/third_party/abseil-cpp/absl/random/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/random/CMakeLists.txt
@@ -62,8 +62,8 @@ absl_cc_test(
absl::random_random
absl::random_internal_sequence_urbg
absl::fast_type_id
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -119,8 +119,8 @@ absl_cc_library(
absl::type_traits
absl::utility
absl::variant
- gmock
- gtest
+ GTest::gmock
+ GTest::gtest
TESTONLY
)
@@ -136,8 +136,8 @@ absl_cc_test(
DEPS
absl::random_mocking_bit_gen
absl::random_random
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -153,8 +153,8 @@ absl_cc_test(
absl::random_bit_gen_ref
absl::random_mocking_bit_gen
absl::random_random
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_library(
@@ -245,8 +245,8 @@ absl_cc_test(
absl::random_random
absl::random_internal_sequence_urbg
absl::random_internal_pcg_engine
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -268,8 +268,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::str_format
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -285,8 +285,8 @@ absl_cc_test(
absl::random_distributions
absl::random_random
absl::random_internal_distribution_test_util
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -301,8 +301,8 @@ absl_cc_test(
absl::random_distributions
absl::random_random
absl::raw_logging_internal
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -322,8 +322,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::str_format
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -343,8 +343,8 @@ absl_cc_test(
absl::random_random
absl::raw_logging_internal
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -367,8 +367,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::str_format
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -391,8 +391,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::str_format
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -414,8 +414,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::str_format
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -435,8 +435,8 @@ absl_cc_test(
absl::random_random
absl::raw_logging_internal
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -456,8 +456,8 @@ absl_cc_test(
absl::random_internal_sequence_urbg
absl::random_random
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -477,8 +477,8 @@ absl_cc_test(
absl::random_random
absl::raw_logging_internal
absl::strings
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
absl_cc_test(
@@ -492,7 +492,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_random
- gtest_main
+ GTest::gtest_main
)
absl_cc_test(
@@ -508,8 +508,8 @@ absl_cc_test(
absl::random_seed_sequences
absl::random_internal_nonsecure_base
absl::random_random
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -894,7 +894,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_traits
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -911,7 +911,7 @@ absl_cc_test(
absl::bits
absl::flags
absl::random_internal_generate_real
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -926,7 +926,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_distribution_test_util
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -941,7 +941,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_fastmath
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -957,8 +957,8 @@ absl_cc_test(
DEPS
absl::random_internal_explicit_seed_seq
absl::random_seed_sequences
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -973,8 +973,8 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_salted_seed_seq
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -990,7 +990,7 @@ absl_cc_test(
DEPS
absl::core_headers
absl::random_internal_distribution_test_util
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1005,7 +1005,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_fast_uniform_bits
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1024,7 +1024,7 @@ absl_cc_test(
absl::random_distributions
absl::random_seed_sequences
absl::strings
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1039,8 +1039,8 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_seed_material
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1057,7 +1057,7 @@ absl_cc_test(
absl::random_internal_pool_urbg
absl::span
absl::type_traits
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1074,8 +1074,8 @@ absl_cc_test(
absl::random_internal_explicit_seed_seq
absl::random_internal_pcg_engine
absl::time
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1094,8 +1094,8 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::time
- gmock
- gtest_main
+ GTest::gmock
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1111,7 +1111,7 @@ absl_cc_test(
DEPS
absl::random_internal_randen
absl::type_traits
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1127,7 +1127,7 @@ absl_cc_test(
DEPS
absl::endian
absl::random_internal_randen_slow
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1146,8 +1146,8 @@ absl_cc_test(
absl::random_internal_randen_hwaes_impl
absl::raw_logging_internal
absl::str_format
- gmock
- gtest
+ GTest::gmock
+ GTest::gtest
)
# Internal-only target, do not depend on directly.
@@ -1178,7 +1178,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_uniform_helper
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1193,7 +1193,7 @@ absl_cc_test(
${ABSL_DEFAULT_LINKOPTS}
DEPS
absl::random_internal_iostream_state_saver
- gtest_main
+ GTest::gtest_main
)
# Internal-only target, do not depend on directly.
@@ -1210,5 +1210,5 @@ absl_cc_test(
absl::random_internal_wide_multiply
absl::bits
absl::int128
- gtest_main
+ GTest::gtest_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/random/beta_distribution_test.cc b/grpc/third_party/abseil-cpp/absl/random/beta_distribution_test.cc
index 44cdfdd0..d980c969 100644
--- a/grpc/third_party/abseil-cpp/absl/random/beta_distribution_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/beta_distribution_test.cc
@@ -15,6 +15,7 @@
#include "absl/random/beta_distribution.h"
#include <algorithm>
+#include <cfloat>
#include <cstddef>
#include <cstdint>
#include <iterator>
@@ -558,6 +559,14 @@ TEST(BetaDistributionTest, StabilityTest) {
// dependencies of the distribution change, such as RandU64ToDouble, then this
// is also likely to change.
TEST(BetaDistributionTest, AlgorithmBounds) {
+#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
+ // We're using an x87-compatible FPU, and intermediate operations are
+ // performed with 80-bit floats. This produces slightly different results from
+ // what we expect below.
+ GTEST_SKIP()
+ << "Skipping the test because we detected x87 floating-point semantics";
+#endif
+
{
absl::random_internal::sequence_urbg urbg(
{0x7fbe76c8b4395800ull, 0x8000000000000000ull});
diff --git a/grpc/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc b/grpc/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc
index 6d007006..415b14cc 100644
--- a/grpc/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/discrete_distribution_test.cc
@@ -99,6 +99,7 @@ TYPED_TEST(DiscreteDistributionTypeTest, Constructor) {
}
TEST(DiscreteDistributionTest, InitDiscreteDistribution) {
+ using testing::_;
using testing::Pair;
{
@@ -111,8 +112,8 @@ TEST(DiscreteDistributionTest, InitDiscreteDistribution) {
// Each bucket is p=1/3, so bucket 0 will send half it's traffic
// to bucket 2, while the rest will retain all of their traffic.
EXPECT_THAT(q, testing::ElementsAre(Pair(0.5, 2), //
- Pair(1.0, 1), //
- Pair(1.0, 2)));
+ Pair(1.0, _), //
+ Pair(1.0, _)));
}
{
@@ -135,7 +136,7 @@ TEST(DiscreteDistributionTest, InitDiscreteDistribution) {
EXPECT_THAT(q, testing::ElementsAre(Pair(b0, 3), //
Pair(b1, 3), //
- Pair(1.0, 2), //
+ Pair(1.0, _), //
Pair(b3, 2), //
Pair(b1, 3)));
}
diff --git a/grpc/third_party/abseil-cpp/absl/random/distributions_test.cc b/grpc/third_party/abseil-cpp/absl/random/distributions_test.cc
index 5866a072..d3a5dd75 100644
--- a/grpc/third_party/abseil-cpp/absl/random/distributions_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/distributions_test.cc
@@ -14,6 +14,7 @@
#include "absl/random/distributions.h"
+#include <cfloat>
#include <cmath>
#include <cstdint>
#include <random>
@@ -224,6 +225,15 @@ TEST_F(RandomDistributionsTest, UniformNoBounds) {
TEST_F(RandomDistributionsTest, UniformNonsenseRanges) {
// The ranges used in this test are undefined behavior.
// The results are arbitrary and subject to future changes.
+
+#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
+ // We're using an x87-compatible FPU, and intermediate operations can be
+ // performed with 80-bit floats. This produces slightly different results from
+ // what we expect below.
+ GTEST_SKIP()
+ << "Skipping the test because we detected x87 floating-point semantics";
+#endif
+
absl::InsecureBitGen gen;
// <uint>
diff --git a/grpc/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc b/grpc/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc
index af11d61c..81a5d17b 100644
--- a/grpc/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/exponential_distribution_test.cc
@@ -15,6 +15,7 @@
#include "absl/random/exponential_distribution.h"
#include <algorithm>
+#include <cfloat>
#include <cmath>
#include <cstddef>
#include <cstdint>
@@ -384,6 +385,15 @@ TEST(ExponentialDistributionTest, StabilityTest) {
TEST(ExponentialDistributionTest, AlgorithmBounds) {
// Relies on absl::uniform_real_distribution, so some of these comments
// reference that.
+
+#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
+ // We're using an x87-compatible FPU, and intermediate operations can be
+ // performed with 80-bit floats. This produces slightly different results from
+ // what we expect below.
+ GTEST_SKIP()
+ << "Skipping the test because we detected x87 floating-point semantics";
+#endif
+
absl::exponential_distribution<double> dist;
{
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/random/internal/BUILD.bazel
index 612b1505..e93eebb6 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/BUILD.bazel
@@ -14,8 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
-
# Internal-only implementation classes for Abseil Random
load(
"//absl:copts/configure_copts.bzl",
@@ -82,6 +80,7 @@ cc_library(
deps = [
":fast_uniform_bits",
"//absl/base:core_headers",
+ "//absl/base:dynamic_annotations",
"//absl/base:raw_logging_internal",
"//absl/strings",
"//absl/types:optional",
@@ -296,6 +295,8 @@ cc_library(
":platform",
"//absl/base:config",
"//absl/base:core_headers",
+ "//absl/base:endian",
+ "//absl/numeric:int128",
],
)
@@ -336,6 +337,7 @@ cc_library(
":platform",
"//absl/base:config",
"//absl/base:core_headers",
+ "//absl/numeric:int128",
],
)
@@ -622,7 +624,7 @@ cc_test(
name = "randen_hwaes_test",
size = "small",
srcs = ["randen_hwaes_test.cc"],
- copts = ABSL_TEST_COPTS,
+ copts = ABSL_TEST_COPTS + ABSL_RANDOM_RANDEN_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
tags = ABSL_RANDOM_NONPORTABLE_TAGS,
deps = [
@@ -717,7 +719,6 @@ cc_test(
cc_test(
name = "iostream_state_saver_test",
- size = "small",
srcs = ["iostream_state_saver_test.cc"],
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h b/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h
index e3aa31a1..25f79153 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq.h
@@ -74,7 +74,7 @@ class ExplicitSeedSeq {
template <typename OutIterator>
void generate(OutIterator begin, OutIterator end) {
for (size_t index = 0; begin != end; begin++) {
- *begin = state_.empty() ? 0 : little_endian::FromHost32(state_[index++]);
+ *begin = state_.empty() ? 0 : state_[index++];
if (index >= state_.size()) {
index = 0;
}
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc b/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc
index a55ad739..f867f610 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/explicit_seed_seq_test.cc
@@ -24,6 +24,8 @@
namespace {
+using ::absl::random_internal::ExplicitSeedSeq;
+
template <typename Sseq>
bool ConformsToInterface() {
// Check that the SeedSequence can be default-constructed.
@@ -64,14 +66,14 @@ TEST(SeedSequences, CheckInterfaces) {
EXPECT_TRUE(ConformsToInterface<std::seed_seq>());
// Abseil classes
- EXPECT_TRUE(ConformsToInterface<absl::random_internal::ExplicitSeedSeq>());
+ EXPECT_TRUE(ConformsToInterface<ExplicitSeedSeq>());
}
TEST(ExplicitSeedSeq, DefaultConstructorGeneratesZeros) {
const size_t kNumBlocks = 128;
uint32_t outputs[kNumBlocks];
- absl::random_internal::ExplicitSeedSeq seq;
+ ExplicitSeedSeq seq;
seq.generate(outputs, &outputs[kNumBlocks]);
for (uint32_t& seed : outputs) {
@@ -87,8 +89,7 @@ TEST(ExplicitSeeqSeq, SeedMaterialIsForwardedIdentically) {
for (uint32_t& seed : seed_material) {
seed = urandom();
}
- absl::random_internal::ExplicitSeedSeq seq(seed_material,
- &seed_material[kNumBlocks]);
+ ExplicitSeedSeq seq(seed_material, &seed_material[kNumBlocks]);
// Check that output is same as seed-material provided to constructor.
{
@@ -133,11 +134,10 @@ TEST(ExplicitSeedSeq, CopyAndMoveConstructors) {
for (uint32_t& entry : entropy) {
entry = urandom();
}
- absl::random_internal::ExplicitSeedSeq seq_from_entropy(std::begin(entropy),
- std::end(entropy));
+ ExplicitSeedSeq seq_from_entropy(std::begin(entropy), std::end(entropy));
// Copy constructor.
{
- absl::random_internal::ExplicitSeedSeq seq_copy(seq_from_entropy);
+ ExplicitSeedSeq seq_copy(seq_from_entropy);
EXPECT_EQ(seq_copy.size(), seq_from_entropy.size());
std::vector<uint32_t> seeds_1;
@@ -155,8 +155,7 @@ TEST(ExplicitSeedSeq, CopyAndMoveConstructors) {
for (uint32_t& entry : entropy) {
entry = urandom();
}
- absl::random_internal::ExplicitSeedSeq another_seq(std::begin(entropy),
- std::end(entropy));
+ ExplicitSeedSeq another_seq(std::begin(entropy), std::end(entropy));
std::vector<uint32_t> seeds_1;
seeds_1.resize(1000, 0);
@@ -202,3 +201,35 @@ TEST(ExplicitSeedSeq, CopyAndMoveConstructors) {
EXPECT_THAT(seeds_1, Each(Eq(0)));
}
}
+
+TEST(ExplicitSeedSeq, StdURBGGoldenTests) {
+ // Verify that for std::- URBG instances the results are stable across
+ // platforms (these should have deterministic output).
+ {
+ ExplicitSeedSeq seed_sequence{12, 34, 56};
+ std::minstd_rand rng(seed_sequence);
+
+ std::minstd_rand::result_type values[4] = {rng(), rng(), rng(), rng()};
+ EXPECT_THAT(values,
+ testing::ElementsAre(579252, 43785881, 464353103, 1501811174));
+ }
+
+ {
+ ExplicitSeedSeq seed_sequence{12, 34, 56};
+ std::mt19937 rng(seed_sequence);
+
+ std::mt19937::result_type values[4] = {rng(), rng(), rng(), rng()};
+ EXPECT_THAT(values, testing::ElementsAre(138416803, 151130212, 33817739,
+ 138416803));
+ }
+
+ {
+ ExplicitSeedSeq seed_sequence{12, 34, 56};
+ std::mt19937_64 rng(seed_sequence);
+
+ std::mt19937_64::result_type values[4] = {rng(), rng(), rng(), rng()};
+ EXPECT_THAT(values,
+ testing::ElementsAre(19738651785169348, 1464811352364190456,
+ 18054685302720800, 19738651785169348));
+ }
+}
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/generate_real.h b/grpc/third_party/abseil-cpp/absl/random/internal/generate_real.h
index 4f62873d..d5fbb44c 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/generate_real.h
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/generate_real.h
@@ -127,10 +127,8 @@ inline RealType GenerateRealFromBits(uint64_t bits, int exp_bias = 0) {
// Construct the 32-bit or 64-bit IEEE 754 floating-point value from
// the individual fields: sign, exp, mantissa(bits).
- uint_type val =
- (std::is_same<SignedTag, GeneratePositiveTag>::value ? 0u : sign) |
- (static_cast<uint_type>(exp) << kExp) |
- (static_cast<uint_type>(bits) & kMask);
+ uint_type val = sign | (static_cast<uint_type>(exp) << kExp) |
+ (static_cast<uint_type>(bits) & kMask);
// bit_cast to the output-type
real_type result;
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc b/grpc/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
index 5bee5307..725100a4 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
@@ -194,11 +194,10 @@ RandenPoolEntry* PoolAlignedAlloc() {
// Not all the platforms that we build for have std::aligned_alloc, however
// since we never free these objects, we can over allocate and munge the
// pointers to the correct alignment.
- void* memory = std::malloc(sizeof(RandenPoolEntry) + kAlignment);
- auto x = reinterpret_cast<intptr_t>(memory);
+ intptr_t x = reinterpret_cast<intptr_t>(
+ new char[sizeof(RandenPoolEntry) + kAlignment]);
auto y = x % kAlignment;
- void* aligned =
- (y == 0) ? memory : reinterpret_cast<void*>(x + kAlignment - y);
+ void* aligned = reinterpret_cast<void*>(y == 0 ? x : (x + kAlignment - y));
return new (aligned) RandenPoolEntry();
}
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_engine.h b/grpc/third_party/abseil-cpp/absl/random/internal/randen_engine.h
index 92bb8905..372c3ac2 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_engine.h
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_engine.h
@@ -121,6 +121,13 @@ class alignas(16) randen_engine {
const size_t requested_entropy = (entropy_size == 0) ? 8u : entropy_size;
std::fill(std::begin(buffer) + requested_entropy, std::end(buffer), 0);
seq.generate(std::begin(buffer), std::begin(buffer) + requested_entropy);
+#ifdef ABSL_IS_BIG_ENDIAN
+ // Randen expects the seed buffer to be in Little Endian; reverse it on
+ // Big Endian platforms.
+ for (sequence_result_type& e : buffer) {
+ e = absl::little_endian::FromHost(e);
+ }
+#endif
// The Randen paper suggests preferentially initializing even-numbered
// 128-bit vectors of the randen state (there are 16 such vectors).
// The seed data is merged into the state offset by 128-bits, which
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc b/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc
index b5a3f90a..fee6677c 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc
@@ -23,49 +23,20 @@
#include <cstring>
#include "absl/base/attributes.h"
+#include "absl/numeric/int128.h"
#include "absl/random/internal/platform.h"
#include "absl/random/internal/randen_traits.h"
// ABSL_RANDEN_HWAES_IMPL indicates whether this file will contain
// a hardware accelerated implementation of randen, or whether it
// will contain stubs that exit the process.
-#if defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32)
-// The platform.h directives are sufficient to indicate whether
-// we should build accelerated implementations for x86.
-#if (ABSL_HAVE_ACCELERATED_AES || ABSL_RANDOM_INTERNAL_AES_DISPATCH)
-#define ABSL_RANDEN_HWAES_IMPL 1
-#endif
-#elif defined(ABSL_ARCH_PPC)
-// The platform.h directives are sufficient to indicate whether
-// we should build accelerated implementations for PPC.
-//
-// NOTE: This has mostly been tested on 64-bit Power variants,
-// and not embedded cpus such as powerpc32-8540
#if ABSL_HAVE_ACCELERATED_AES
+// The following plaforms have implemented RandenHwAes.
+#if defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32) || \
+ defined(ABSL_ARCH_PPC) || defined(ABSL_ARCH_ARM) || \
+ defined(ABSL_ARCH_AARCH64)
#define ABSL_RANDEN_HWAES_IMPL 1
#endif
-#elif defined(ABSL_ARCH_ARM) || defined(ABSL_ARCH_AARCH64)
-// ARM is somewhat more complicated. We might support crypto natively...
-#if ABSL_HAVE_ACCELERATED_AES || \
- (defined(__ARM_NEON) && defined(__ARM_FEATURE_CRYPTO))
-#define ABSL_RANDEN_HWAES_IMPL 1
-
-#elif ABSL_RANDOM_INTERNAL_AES_DISPATCH && !defined(__APPLE__) && \
- (defined(__GNUC__) && __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 9)
-// ...or, on GCC, we can use an ASM directive to
-// instruct the assember to allow crypto instructions.
-#define ABSL_RANDEN_HWAES_IMPL 1
-#define ABSL_RANDEN_HWAES_IMPL_CRYPTO_DIRECTIVE 1
-#endif
-#else
-// HWAES is unsupported by these architectures / platforms:
-// __myriad2__
-// __mips__
-//
-// Other architectures / platforms are unknown.
-//
-// See the Abseil documentation on supported macros at:
-// https://abseil.io/docs/cpp/platforms/macros
#endif
#if !defined(ABSL_RANDEN_HWAES_IMPL)
@@ -120,11 +91,6 @@ namespace {
using absl::random_internal::RandenTraits;
-// Randen operates on 128-bit vectors.
-struct alignas(16) u64x2 {
- uint64_t data[2];
-};
-
} // namespace
// TARGET_CRYPTO defines a crypto attribute for each architecture.
@@ -186,7 +152,7 @@ inline ABSL_TARGET_CRYPTO Vector128 AesRound(const Vector128& state,
}
// Enables native loads in the round loop by pre-swapping.
-inline ABSL_TARGET_CRYPTO void SwapEndian(u64x2* state) {
+inline ABSL_TARGET_CRYPTO void SwapEndian(absl::uint128* state) {
for (uint32_t block = 0; block < RandenTraits::kFeistelBlocks; ++block) {
Vector128Store(ReverseBytes(Vector128Load(state + block)), state + block);
}
@@ -196,22 +162,6 @@ inline ABSL_TARGET_CRYPTO void SwapEndian(u64x2* state) {
#elif defined(ABSL_ARCH_ARM) || defined(ABSL_ARCH_AARCH64)
-// This asm directive will cause the file to be compiled with crypto extensions
-// whether or not the cpu-architecture supports it.
-#if ABSL_RANDEN_HWAES_IMPL_CRYPTO_DIRECTIVE
-asm(".arch_extension crypto\n");
-
-// Override missing defines.
-#if !defined(__ARM_NEON)
-#define __ARM_NEON 1
-#endif
-
-#if !defined(__ARM_FEATURE_CRYPTO)
-#define __ARM_FEATURE_CRYPTO 1
-#endif
-
-#endif
-
// Rely on the ARM NEON+Crypto advanced simd types, defined in <arm_neon.h>.
// uint8x16_t is the user alias for underlying __simd128_uint8_t type.
// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0073a/IHI0073A_arm_neon_intrinsics_ref.pdf
@@ -261,7 +211,7 @@ inline ABSL_TARGET_CRYPTO void SwapEndian(void*) {}
#elif defined(ABSL_ARCH_X86_64) || defined(ABSL_ARCH_X86_32)
// On x86 we rely on the aesni instructions
-#include <wmmintrin.h>
+#include <immintrin.h>
namespace {
@@ -270,7 +220,7 @@ namespace {
class Vector128 {
public:
// Convert from/to intrinsics.
- inline explicit Vector128(const __m128i& Vector128) : data_(Vector128) {}
+ inline explicit Vector128(const __m128i& v) : data_(v) {}
inline __m128i data() const { return data_; }
@@ -327,7 +277,7 @@ namespace {
// Block shuffles applies a shuffle to the entire state between AES rounds.
// Improved odd-even shuffle from "New criterion for diffusion property".
-inline ABSL_TARGET_CRYPTO void BlockShuffle(u64x2* state) {
+inline ABSL_TARGET_CRYPTO void BlockShuffle(absl::uint128* state) {
static_assert(RandenTraits::kFeistelBlocks == 16,
"Expecting 16 FeistelBlocks.");
@@ -374,8 +324,9 @@ inline ABSL_TARGET_CRYPTO void BlockShuffle(u64x2* state) {
// per 16 bytes (vs. 10 for AES-CTR). Computing eight round functions in
// parallel hides the 7-cycle AESNI latency on HSW. Note that the Feistel
// XORs are 'free' (included in the second AES instruction).
-inline ABSL_TARGET_CRYPTO const u64x2* FeistelRound(
- u64x2* state, const u64x2* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
+inline ABSL_TARGET_CRYPTO const absl::uint128* FeistelRound(
+ absl::uint128* state,
+ const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
static_assert(RandenTraits::kFeistelBlocks == 16,
"Expecting 16 FeistelBlocks.");
@@ -436,7 +387,8 @@ inline ABSL_TARGET_CRYPTO const u64x2* FeistelRound(
// 2^64 queries if the round function is a PRF. This is similar to the b=8 case
// of Simpira v2, but more efficient than its generic construction for b=16.
inline ABSL_TARGET_CRYPTO void Permute(
- u64x2* state, const u64x2* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
+ absl::uint128* state,
+ const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
// (Successfully unrolled; the first iteration jumps into the second half)
#ifdef __clang__
#pragma clang loop unroll_count(2)
@@ -473,10 +425,11 @@ void ABSL_TARGET_CRYPTO RandenHwAes::Absorb(const void* seed_void,
static_assert(RandenTraits::kStateBytes / sizeof(Vector128) == 16,
"Unexpected Randen kStateBlocks");
- auto* state =
- reinterpret_cast<u64x2 * ABSL_RANDOM_INTERNAL_RESTRICT>(state_void);
+ auto* state = reinterpret_cast<absl::uint128 * ABSL_RANDOM_INTERNAL_RESTRICT>(
+ state_void);
const auto* seed =
- reinterpret_cast<const u64x2 * ABSL_RANDOM_INTERNAL_RESTRICT>(seed_void);
+ reinterpret_cast<const absl::uint128 * ABSL_RANDOM_INTERNAL_RESTRICT>(
+ seed_void);
Vector128 b1 = Vector128Load(state + 1);
b1 ^= Vector128Load(seed + 0);
@@ -545,8 +498,8 @@ void ABSL_TARGET_CRYPTO RandenHwAes::Generate(const void* keys_void,
static_assert(RandenTraits::kCapacityBytes == sizeof(Vector128),
"Capacity mismatch");
- auto* state = reinterpret_cast<u64x2*>(state_void);
- const auto* keys = reinterpret_cast<const u64x2*>(keys_void);
+ auto* state = reinterpret_cast<absl::uint128*>(state_void);
+ const auto* keys = reinterpret_cast<const absl::uint128*>(keys_void);
const Vector128 prev_inner = Vector128Load(state);
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc b/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc
index 66ddb43f..2348b55c 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_hwaes_test.cc
@@ -27,44 +27,39 @@ namespace {
using absl::random_internal::RandenHwAes;
using absl::random_internal::RandenTraits;
-// Local state parameters.
-constexpr size_t kSeedBytes =
- RandenTraits::kStateBytes - RandenTraits::kCapacityBytes;
-constexpr size_t kStateSizeT = RandenTraits::kStateBytes / sizeof(uint64_t);
-constexpr size_t kSeedSizeT = kSeedBytes / sizeof(uint32_t);
-
-struct alignas(16) randen {
- uint64_t state[kStateSizeT];
- uint32_t seed[kSeedSizeT];
-};
-
TEST(RandenHwAesTest, Default) {
EXPECT_TRUE(absl::random_internal::CPUSupportsRandenHwAes());
- constexpr uint64_t kGolden[] = {
- 0x6c6534090ee6d3ee, 0x044e2b9b9d5333c6, 0xc3c14f134e433977,
- 0xdda9f47cd90410ee, 0x887bf3087fd8ca10, 0xf0b780f545c72912,
- 0x15dbb1d37696599f, 0x30ec63baff3c6d59, 0xb29f73606f7f20a6,
- 0x02808a316f49a54c, 0x3b8feaf9d5c8e50e, 0x9cbf605e3fd9de8a,
- 0xc970ae1a78183bbb, 0xd8b2ffd356301ed5, 0xf4b327fe0fc73c37,
- 0xcdfd8d76eb8f9a19, 0xc3a506eb91420c9d, 0xd5af05dd3eff9556,
- 0x48db1bb78f83c4a1, 0x7023920e0d6bfe8c, 0x58d3575834956d42,
- 0xed1ef4c26b87b840, 0x8eef32a23e0b2df3, 0x497cabf3431154fc,
- 0x4e24370570029a8b, 0xd88b5749f090e5ea, 0xc651a582a970692f,
- 0x78fcec2cbb6342f5, 0x463cb745612f55db, 0x352ee4ad1816afe3,
- 0x026ff374c101da7e, 0x811ef0821c3de851,
+ constexpr uint8_t kGolden[] = {
+ 0xee, 0xd3, 0xe6, 0x0e, 0x09, 0x34, 0x65, 0x6c, 0xc6, 0x33, 0x53, 0x9d,
+ 0x9b, 0x2b, 0x4e, 0x04, 0x77, 0x39, 0x43, 0x4e, 0x13, 0x4f, 0xc1, 0xc3,
+ 0xee, 0x10, 0x04, 0xd9, 0x7c, 0xf4, 0xa9, 0xdd, 0x10, 0xca, 0xd8, 0x7f,
+ 0x08, 0xf3, 0x7b, 0x88, 0x12, 0x29, 0xc7, 0x45, 0xf5, 0x80, 0xb7, 0xf0,
+ 0x9f, 0x59, 0x96, 0x76, 0xd3, 0xb1, 0xdb, 0x15, 0x59, 0x6d, 0x3c, 0xff,
+ 0xba, 0x63, 0xec, 0x30, 0xa6, 0x20, 0x7f, 0x6f, 0x60, 0x73, 0x9f, 0xb2,
+ 0x4c, 0xa5, 0x49, 0x6f, 0x31, 0x8a, 0x80, 0x02, 0x0e, 0xe5, 0xc8, 0xd5,
+ 0xf9, 0xea, 0x8f, 0x3b, 0x8a, 0xde, 0xd9, 0x3f, 0x5e, 0x60, 0xbf, 0x9c,
+ 0xbb, 0x3b, 0x18, 0x78, 0x1a, 0xae, 0x70, 0xc9, 0xd5, 0x1e, 0x30, 0x56,
+ 0xd3, 0xff, 0xb2, 0xd8, 0x37, 0x3c, 0xc7, 0x0f, 0xfe, 0x27, 0xb3, 0xf4,
+ 0x19, 0x9a, 0x8f, 0xeb, 0x76, 0x8d, 0xfd, 0xcd, 0x9d, 0x0c, 0x42, 0x91,
+ 0xeb, 0x06, 0xa5, 0xc3, 0x56, 0x95, 0xff, 0x3e, 0xdd, 0x05, 0xaf, 0xd5,
+ 0xa1, 0xc4, 0x83, 0x8f, 0xb7, 0x1b, 0xdb, 0x48, 0x8c, 0xfe, 0x6b, 0x0d,
+ 0x0e, 0x92, 0x23, 0x70, 0x42, 0x6d, 0x95, 0x34, 0x58, 0x57, 0xd3, 0x58,
+ 0x40, 0xb8, 0x87, 0x6b, 0xc2, 0xf4, 0x1e, 0xed, 0xf3, 0x2d, 0x0b, 0x3e,
+ 0xa2, 0x32, 0xef, 0x8e, 0xfc, 0x54, 0x11, 0x43, 0xf3, 0xab, 0x7c, 0x49,
+ 0x8b, 0x9a, 0x02, 0x70, 0x05, 0x37, 0x24, 0x4e, 0xea, 0xe5, 0x90, 0xf0,
+ 0x49, 0x57, 0x8b, 0xd8, 0x2f, 0x69, 0x70, 0xa9, 0x82, 0xa5, 0x51, 0xc6,
+ 0xf5, 0x42, 0x63, 0xbb, 0x2c, 0xec, 0xfc, 0x78, 0xdb, 0x55, 0x2f, 0x61,
+ 0x45, 0xb7, 0x3c, 0x46, 0xe3, 0xaf, 0x16, 0x18, 0xad, 0xe4, 0x2e, 0x35,
+ 0x7e, 0xda, 0x01, 0xc1, 0x74, 0xf3, 0x6f, 0x02, 0x51, 0xe8, 0x3d, 0x1c,
+ 0x82, 0xf0, 0x1e, 0x81,
};
- alignas(16) randen d;
- memset(d.state, 0, sizeof(d.state));
- RandenHwAes::Generate(RandenHwAes::GetKeys(), d.state);
+ alignas(16) uint8_t state[RandenTraits::kStateBytes];
+ std::memset(state, 0, sizeof(state));
- uint64_t* id = d.state;
- for (const auto& elem : kGolden) {
- auto a = absl::StrFormat("%#x", elem);
- auto b = absl::StrFormat("%#x", *id++);
- EXPECT_EQ(a, b);
- }
+ RandenHwAes::Generate(RandenHwAes::GetKeys(), state);
+ EXPECT_EQ(0, std::memcmp(state, kGolden, sizeof(state)));
}
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow.cc b/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow.cc
index 4e5f3dc1..9bfd2a40 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow.cc
@@ -19,6 +19,8 @@
#include <cstring>
#include "absl/base/attributes.h"
+#include "absl/base/internal/endian.h"
+#include "absl/numeric/int128.h"
#include "absl/random/internal/platform.h"
#include "absl/random/internal/randen_traits.h"
@@ -38,192 +40,193 @@
namespace {
// AES portions based on rijndael-alg-fst.c,
-// https://fastcrypto.org/front/misc/rijndael-alg-fst.c
+// https://fastcrypto.org/front/misc/rijndael-alg-fst.c, and modified for
+// platform-endianness.
//
// Implementation of
// http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf
constexpr uint32_t te0[256] = {
- 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd,
- 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
- 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d,
- 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
- 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7,
- 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a,
- 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4,
- 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f,
- 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1,
- 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d,
- 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e,
- 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb,
- 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e,
- 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c,
- 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46,
- 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a,
- 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7,
- 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81,
- 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe,
- 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504,
- 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a,
- 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f,
- 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2,
- 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395,
- 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e,
- 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c,
- 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256,
- 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4,
- 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4,
- 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7,
- 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa,
- 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818,
- 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1,
- 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21,
- 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42,
- 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12,
- 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158,
- 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133,
- 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22,
- 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
- 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631,
- 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11,
- 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
+ 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, 0xbd6b6bd6,
+ 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, 0xa96767ce, 0x7d2b2b56,
+ 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, 0x9a7676ec, 0x45caca8f, 0x9d82821f,
+ 0x40c9c989, 0x877d7dfa, 0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb,
+ 0xecadad41, 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453,
+ 0x967272e4, 0x5bc0c09b, 0xc2b7b775, 0x1cfdfde1, 0xae93933d, 0x6a26264c,
+ 0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83, 0x5c343468, 0xf4a5a551,
+ 0x34e5e5d1, 0x08f1f1f9, 0x937171e2, 0x73d8d8ab, 0x53313162, 0x3f15152a,
+ 0x0c040408, 0x52c7c795, 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637,
+ 0x0f05050a, 0xb59a9a2f, 0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df,
+ 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, 0x1b090912, 0x9e83831d,
+ 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, 0xee5a5ab4, 0xfba0a05b,
+ 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, 0xceb3b37d, 0x7b292952, 0x3ee3e3dd,
+ 0x712f2f5e, 0x97848413, 0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1,
+ 0x60202040, 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, 0xbe6a6ad4, 0x46cbcb8d,
+ 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, 0x4acfcf85,
+ 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, 0xc5434386, 0xd74d4d9a,
+ 0x55333366, 0x94858511, 0xcf45458a, 0x10f9f9e9, 0x06020204, 0x817f7ffe,
+ 0xf05050a0, 0x443c3c78, 0xba9f9f25, 0xe3a8a84b, 0xf35151a2, 0xfea3a35d,
+ 0xc0404080, 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1,
+ 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, 0x1affffe5,
+ 0x0ef3f3fd, 0x6dd2d2bf, 0x4ccdcd81, 0x140c0c18, 0x35131326, 0x2fececc3,
+ 0xe15f5fbe, 0xa2979735, 0xcc444488, 0x3917172e, 0x57c4c493, 0xf2a7a755,
+ 0x827e7efc, 0x473d3d7a, 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6,
+ 0xa06060c0, 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54,
+ 0xab90903b, 0x8388880b, 0xca46468c, 0x29eeeec7, 0xd3b8b86b, 0x3c141428,
+ 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, 0x3be0e0db, 0x56323264,
+ 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, 0x0a06060c, 0x6c242448, 0xe45c5cb8,
+ 0x5dc2c29f, 0x6ed3d3bd, 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531,
+ 0x37e4e4d3, 0x8b7979f2, 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda,
+ 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, 0xb46c6cd8, 0xfa5656ac,
+ 0x07f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, 0xe9aeae47, 0x18080810,
+ 0xd5baba6f, 0x887878f0, 0x6f25254a, 0x722e2e5c, 0x241c1c38, 0xf1a6a657,
+ 0xc7b4b473, 0x51c6c697, 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e,
+ 0xdd4b4b96, 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, 0x907070e0, 0x423e3e7c,
+ 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x05030306, 0x01f6f6f7, 0x120e0e1c,
+ 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, 0x91868617, 0x58c1c199,
+ 0x271d1d3a, 0xb99e9e27, 0x38e1e1d9, 0x13f8f8eb, 0xb398982b, 0x33111122,
+ 0xbb6969d2, 0x70d9d9a9, 0x898e8e07, 0xa7949433, 0xb69b9b2d, 0x221e1e3c,
+ 0x92878715, 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5,
+ 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, 0x31e6e6d7,
+ 0xc6424284, 0xb86868d0, 0xc3414182, 0xb0999929, 0x772d2d5a, 0x110f0f1e,
+ 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, 0x3a16162c,
};
constexpr uint32_t te1[256] = {
- 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b,
- 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
- 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282,
- 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
- 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4,
- 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626,
- 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5,
- 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515,
- 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696,
- 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2,
- 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383,
- 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0,
- 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3,
- 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded,
- 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb,
- 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf,
- 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d,
- 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f,
- 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3,
- 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5,
- 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff,
- 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec,
- 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7,
- 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373,
- 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a,
- 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414,
- 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232,
- 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c,
- 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595,
- 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d,
- 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656,
- 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808,
- 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6,
- 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f,
- 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e,
- 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e,
- 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1,
- 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111,
- 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e,
- 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
- 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6,
- 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f,
- 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
+ 0x6363c6a5, 0x7c7cf884, 0x7777ee99, 0x7b7bf68d, 0xf2f2ff0d, 0x6b6bd6bd,
+ 0x6f6fdeb1, 0xc5c59154, 0x30306050, 0x01010203, 0x6767cea9, 0x2b2b567d,
+ 0xfefee719, 0xd7d7b562, 0xabab4de6, 0x7676ec9a, 0xcaca8f45, 0x82821f9d,
+ 0xc9c98940, 0x7d7dfa87, 0xfafaef15, 0x5959b2eb, 0x47478ec9, 0xf0f0fb0b,
+ 0xadad41ec, 0xd4d4b367, 0xa2a25ffd, 0xafaf45ea, 0x9c9c23bf, 0xa4a453f7,
+ 0x7272e496, 0xc0c09b5b, 0xb7b775c2, 0xfdfde11c, 0x93933dae, 0x26264c6a,
+ 0x36366c5a, 0x3f3f7e41, 0xf7f7f502, 0xcccc834f, 0x3434685c, 0xa5a551f4,
+ 0xe5e5d134, 0xf1f1f908, 0x7171e293, 0xd8d8ab73, 0x31316253, 0x15152a3f,
+ 0x0404080c, 0xc7c79552, 0x23234665, 0xc3c39d5e, 0x18183028, 0x969637a1,
+ 0x05050a0f, 0x9a9a2fb5, 0x07070e09, 0x12122436, 0x80801b9b, 0xe2e2df3d,
+ 0xebebcd26, 0x27274e69, 0xb2b27fcd, 0x7575ea9f, 0x0909121b, 0x83831d9e,
+ 0x2c2c5874, 0x1a1a342e, 0x1b1b362d, 0x6e6edcb2, 0x5a5ab4ee, 0xa0a05bfb,
+ 0x5252a4f6, 0x3b3b764d, 0xd6d6b761, 0xb3b37dce, 0x2929527b, 0xe3e3dd3e,
+ 0x2f2f5e71, 0x84841397, 0x5353a6f5, 0xd1d1b968, 0x00000000, 0xededc12c,
+ 0x20204060, 0xfcfce31f, 0xb1b179c8, 0x5b5bb6ed, 0x6a6ad4be, 0xcbcb8d46,
+ 0xbebe67d9, 0x3939724b, 0x4a4a94de, 0x4c4c98d4, 0x5858b0e8, 0xcfcf854a,
+ 0xd0d0bb6b, 0xefefc52a, 0xaaaa4fe5, 0xfbfbed16, 0x434386c5, 0x4d4d9ad7,
+ 0x33336655, 0x85851194, 0x45458acf, 0xf9f9e910, 0x02020406, 0x7f7ffe81,
+ 0x5050a0f0, 0x3c3c7844, 0x9f9f25ba, 0xa8a84be3, 0x5151a2f3, 0xa3a35dfe,
+ 0x404080c0, 0x8f8f058a, 0x92923fad, 0x9d9d21bc, 0x38387048, 0xf5f5f104,
+ 0xbcbc63df, 0xb6b677c1, 0xdadaaf75, 0x21214263, 0x10102030, 0xffffe51a,
+ 0xf3f3fd0e, 0xd2d2bf6d, 0xcdcd814c, 0x0c0c1814, 0x13132635, 0xececc32f,
+ 0x5f5fbee1, 0x979735a2, 0x444488cc, 0x17172e39, 0xc4c49357, 0xa7a755f2,
+ 0x7e7efc82, 0x3d3d7a47, 0x6464c8ac, 0x5d5dbae7, 0x1919322b, 0x7373e695,
+ 0x6060c0a0, 0x81811998, 0x4f4f9ed1, 0xdcdca37f, 0x22224466, 0x2a2a547e,
+ 0x90903bab, 0x88880b83, 0x46468cca, 0xeeeec729, 0xb8b86bd3, 0x1414283c,
+ 0xdedea779, 0x5e5ebce2, 0x0b0b161d, 0xdbdbad76, 0xe0e0db3b, 0x32326456,
+ 0x3a3a744e, 0x0a0a141e, 0x494992db, 0x06060c0a, 0x2424486c, 0x5c5cb8e4,
+ 0xc2c29f5d, 0xd3d3bd6e, 0xacac43ef, 0x6262c4a6, 0x919139a8, 0x959531a4,
+ 0xe4e4d337, 0x7979f28b, 0xe7e7d532, 0xc8c88b43, 0x37376e59, 0x6d6ddab7,
+ 0x8d8d018c, 0xd5d5b164, 0x4e4e9cd2, 0xa9a949e0, 0x6c6cd8b4, 0x5656acfa,
+ 0xf4f4f307, 0xeaeacf25, 0x6565caaf, 0x7a7af48e, 0xaeae47e9, 0x08081018,
+ 0xbaba6fd5, 0x7878f088, 0x25254a6f, 0x2e2e5c72, 0x1c1c3824, 0xa6a657f1,
+ 0xb4b473c7, 0xc6c69751, 0xe8e8cb23, 0xdddda17c, 0x7474e89c, 0x1f1f3e21,
+ 0x4b4b96dd, 0xbdbd61dc, 0x8b8b0d86, 0x8a8a0f85, 0x7070e090, 0x3e3e7c42,
+ 0xb5b571c4, 0x6666ccaa, 0x484890d8, 0x03030605, 0xf6f6f701, 0x0e0e1c12,
+ 0x6161c2a3, 0x35356a5f, 0x5757aef9, 0xb9b969d0, 0x86861791, 0xc1c19958,
+ 0x1d1d3a27, 0x9e9e27b9, 0xe1e1d938, 0xf8f8eb13, 0x98982bb3, 0x11112233,
+ 0x6969d2bb, 0xd9d9a970, 0x8e8e0789, 0x949433a7, 0x9b9b2db6, 0x1e1e3c22,
+ 0x87871592, 0xe9e9c920, 0xcece8749, 0x5555aaff, 0x28285078, 0xdfdfa57a,
+ 0x8c8c038f, 0xa1a159f8, 0x89890980, 0x0d0d1a17, 0xbfbf65da, 0xe6e6d731,
+ 0x424284c6, 0x6868d0b8, 0x414182c3, 0x999929b0, 0x2d2d5a77, 0x0f0f1e11,
+ 0xb0b07bcb, 0x5454a8fc, 0xbbbb6dd6, 0x16162c3a,
};
constexpr uint32_t te2[256] = {
- 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b,
- 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
- 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82,
- 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
- 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4,
- 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26,
- 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5,
- 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15,
- 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796,
- 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2,
- 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83,
- 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0,
- 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3,
- 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed,
- 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb,
- 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf,
- 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d,
- 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f,
- 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3,
- 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5,
- 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff,
- 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec,
- 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7,
- 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673,
- 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a,
- 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814,
- 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432,
- 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c,
- 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195,
- 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d,
- 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56,
- 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008,
- 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6,
- 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f,
- 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e,
- 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e,
- 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1,
- 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211,
- 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e,
- 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
- 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6,
- 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f,
- 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
+ 0x63c6a563, 0x7cf8847c, 0x77ee9977, 0x7bf68d7b, 0xf2ff0df2, 0x6bd6bd6b,
+ 0x6fdeb16f, 0xc59154c5, 0x30605030, 0x01020301, 0x67cea967, 0x2b567d2b,
+ 0xfee719fe, 0xd7b562d7, 0xab4de6ab, 0x76ec9a76, 0xca8f45ca, 0x821f9d82,
+ 0xc98940c9, 0x7dfa877d, 0xfaef15fa, 0x59b2eb59, 0x478ec947, 0xf0fb0bf0,
+ 0xad41ecad, 0xd4b367d4, 0xa25ffda2, 0xaf45eaaf, 0x9c23bf9c, 0xa453f7a4,
+ 0x72e49672, 0xc09b5bc0, 0xb775c2b7, 0xfde11cfd, 0x933dae93, 0x264c6a26,
+ 0x366c5a36, 0x3f7e413f, 0xf7f502f7, 0xcc834fcc, 0x34685c34, 0xa551f4a5,
+ 0xe5d134e5, 0xf1f908f1, 0x71e29371, 0xd8ab73d8, 0x31625331, 0x152a3f15,
+ 0x04080c04, 0xc79552c7, 0x23466523, 0xc39d5ec3, 0x18302818, 0x9637a196,
+ 0x050a0f05, 0x9a2fb59a, 0x070e0907, 0x12243612, 0x801b9b80, 0xe2df3de2,
+ 0xebcd26eb, 0x274e6927, 0xb27fcdb2, 0x75ea9f75, 0x09121b09, 0x831d9e83,
+ 0x2c58742c, 0x1a342e1a, 0x1b362d1b, 0x6edcb26e, 0x5ab4ee5a, 0xa05bfba0,
+ 0x52a4f652, 0x3b764d3b, 0xd6b761d6, 0xb37dceb3, 0x29527b29, 0xe3dd3ee3,
+ 0x2f5e712f, 0x84139784, 0x53a6f553, 0xd1b968d1, 0x00000000, 0xedc12ced,
+ 0x20406020, 0xfce31ffc, 0xb179c8b1, 0x5bb6ed5b, 0x6ad4be6a, 0xcb8d46cb,
+ 0xbe67d9be, 0x39724b39, 0x4a94de4a, 0x4c98d44c, 0x58b0e858, 0xcf854acf,
+ 0xd0bb6bd0, 0xefc52aef, 0xaa4fe5aa, 0xfbed16fb, 0x4386c543, 0x4d9ad74d,
+ 0x33665533, 0x85119485, 0x458acf45, 0xf9e910f9, 0x02040602, 0x7ffe817f,
+ 0x50a0f050, 0x3c78443c, 0x9f25ba9f, 0xa84be3a8, 0x51a2f351, 0xa35dfea3,
+ 0x4080c040, 0x8f058a8f, 0x923fad92, 0x9d21bc9d, 0x38704838, 0xf5f104f5,
+ 0xbc63dfbc, 0xb677c1b6, 0xdaaf75da, 0x21426321, 0x10203010, 0xffe51aff,
+ 0xf3fd0ef3, 0xd2bf6dd2, 0xcd814ccd, 0x0c18140c, 0x13263513, 0xecc32fec,
+ 0x5fbee15f, 0x9735a297, 0x4488cc44, 0x172e3917, 0xc49357c4, 0xa755f2a7,
+ 0x7efc827e, 0x3d7a473d, 0x64c8ac64, 0x5dbae75d, 0x19322b19, 0x73e69573,
+ 0x60c0a060, 0x81199881, 0x4f9ed14f, 0xdca37fdc, 0x22446622, 0x2a547e2a,
+ 0x903bab90, 0x880b8388, 0x468cca46, 0xeec729ee, 0xb86bd3b8, 0x14283c14,
+ 0xdea779de, 0x5ebce25e, 0x0b161d0b, 0xdbad76db, 0xe0db3be0, 0x32645632,
+ 0x3a744e3a, 0x0a141e0a, 0x4992db49, 0x060c0a06, 0x24486c24, 0x5cb8e45c,
+ 0xc29f5dc2, 0xd3bd6ed3, 0xac43efac, 0x62c4a662, 0x9139a891, 0x9531a495,
+ 0xe4d337e4, 0x79f28b79, 0xe7d532e7, 0xc88b43c8, 0x376e5937, 0x6ddab76d,
+ 0x8d018c8d, 0xd5b164d5, 0x4e9cd24e, 0xa949e0a9, 0x6cd8b46c, 0x56acfa56,
+ 0xf4f307f4, 0xeacf25ea, 0x65caaf65, 0x7af48e7a, 0xae47e9ae, 0x08101808,
+ 0xba6fd5ba, 0x78f08878, 0x254a6f25, 0x2e5c722e, 0x1c38241c, 0xa657f1a6,
+ 0xb473c7b4, 0xc69751c6, 0xe8cb23e8, 0xdda17cdd, 0x74e89c74, 0x1f3e211f,
+ 0x4b96dd4b, 0xbd61dcbd, 0x8b0d868b, 0x8a0f858a, 0x70e09070, 0x3e7c423e,
+ 0xb571c4b5, 0x66ccaa66, 0x4890d848, 0x03060503, 0xf6f701f6, 0x0e1c120e,
+ 0x61c2a361, 0x356a5f35, 0x57aef957, 0xb969d0b9, 0x86179186, 0xc19958c1,
+ 0x1d3a271d, 0x9e27b99e, 0xe1d938e1, 0xf8eb13f8, 0x982bb398, 0x11223311,
+ 0x69d2bb69, 0xd9a970d9, 0x8e07898e, 0x9433a794, 0x9b2db69b, 0x1e3c221e,
+ 0x87159287, 0xe9c920e9, 0xce8749ce, 0x55aaff55, 0x28507828, 0xdfa57adf,
+ 0x8c038f8c, 0xa159f8a1, 0x89098089, 0x0d1a170d, 0xbf65dabf, 0xe6d731e6,
+ 0x4284c642, 0x68d0b868, 0x4182c341, 0x9929b099, 0x2d5a772d, 0x0f1e110f,
+ 0xb07bcbb0, 0x54a8fc54, 0xbb6dd6bb, 0x162c3a16,
};
constexpr uint32_t te3[256] = {
- 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6,
- 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
- 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f,
- 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
- 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753,
- 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c,
- 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451,
- 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a,
- 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137,
- 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf,
- 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d,
- 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b,
- 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd,
- 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1,
- 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d,
- 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85,
- 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a,
- 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe,
- 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d,
- 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1,
- 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5,
- 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3,
- 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255,
- 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6,
- 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54,
- 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28,
- 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664,
- 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8,
- 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431,
- 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da,
- 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac,
- 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810,
- 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157,
- 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e,
- 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c,
- 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c,
- 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899,
- 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322,
- 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c,
- 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
- 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7,
- 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e,
- 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
+ 0xc6a56363, 0xf8847c7c, 0xee997777, 0xf68d7b7b, 0xff0df2f2, 0xd6bd6b6b,
+ 0xdeb16f6f, 0x9154c5c5, 0x60503030, 0x02030101, 0xcea96767, 0x567d2b2b,
+ 0xe719fefe, 0xb562d7d7, 0x4de6abab, 0xec9a7676, 0x8f45caca, 0x1f9d8282,
+ 0x8940c9c9, 0xfa877d7d, 0xef15fafa, 0xb2eb5959, 0x8ec94747, 0xfb0bf0f0,
+ 0x41ecadad, 0xb367d4d4, 0x5ffda2a2, 0x45eaafaf, 0x23bf9c9c, 0x53f7a4a4,
+ 0xe4967272, 0x9b5bc0c0, 0x75c2b7b7, 0xe11cfdfd, 0x3dae9393, 0x4c6a2626,
+ 0x6c5a3636, 0x7e413f3f, 0xf502f7f7, 0x834fcccc, 0x685c3434, 0x51f4a5a5,
+ 0xd134e5e5, 0xf908f1f1, 0xe2937171, 0xab73d8d8, 0x62533131, 0x2a3f1515,
+ 0x080c0404, 0x9552c7c7, 0x46652323, 0x9d5ec3c3, 0x30281818, 0x37a19696,
+ 0x0a0f0505, 0x2fb59a9a, 0x0e090707, 0x24361212, 0x1b9b8080, 0xdf3de2e2,
+ 0xcd26ebeb, 0x4e692727, 0x7fcdb2b2, 0xea9f7575, 0x121b0909, 0x1d9e8383,
+ 0x58742c2c, 0x342e1a1a, 0x362d1b1b, 0xdcb26e6e, 0xb4ee5a5a, 0x5bfba0a0,
+ 0xa4f65252, 0x764d3b3b, 0xb761d6d6, 0x7dceb3b3, 0x527b2929, 0xdd3ee3e3,
+ 0x5e712f2f, 0x13978484, 0xa6f55353, 0xb968d1d1, 0x00000000, 0xc12ceded,
+ 0x40602020, 0xe31ffcfc, 0x79c8b1b1, 0xb6ed5b5b, 0xd4be6a6a, 0x8d46cbcb,
+ 0x67d9bebe, 0x724b3939, 0x94de4a4a, 0x98d44c4c, 0xb0e85858, 0x854acfcf,
+ 0xbb6bd0d0, 0xc52aefef, 0x4fe5aaaa, 0xed16fbfb, 0x86c54343, 0x9ad74d4d,
+ 0x66553333, 0x11948585, 0x8acf4545, 0xe910f9f9, 0x04060202, 0xfe817f7f,
+ 0xa0f05050, 0x78443c3c, 0x25ba9f9f, 0x4be3a8a8, 0xa2f35151, 0x5dfea3a3,
+ 0x80c04040, 0x058a8f8f, 0x3fad9292, 0x21bc9d9d, 0x70483838, 0xf104f5f5,
+ 0x63dfbcbc, 0x77c1b6b6, 0xaf75dada, 0x42632121, 0x20301010, 0xe51affff,
+ 0xfd0ef3f3, 0xbf6dd2d2, 0x814ccdcd, 0x18140c0c, 0x26351313, 0xc32fecec,
+ 0xbee15f5f, 0x35a29797, 0x88cc4444, 0x2e391717, 0x9357c4c4, 0x55f2a7a7,
+ 0xfc827e7e, 0x7a473d3d, 0xc8ac6464, 0xbae75d5d, 0x322b1919, 0xe6957373,
+ 0xc0a06060, 0x19988181, 0x9ed14f4f, 0xa37fdcdc, 0x44662222, 0x547e2a2a,
+ 0x3bab9090, 0x0b838888, 0x8cca4646, 0xc729eeee, 0x6bd3b8b8, 0x283c1414,
+ 0xa779dede, 0xbce25e5e, 0x161d0b0b, 0xad76dbdb, 0xdb3be0e0, 0x64563232,
+ 0x744e3a3a, 0x141e0a0a, 0x92db4949, 0x0c0a0606, 0x486c2424, 0xb8e45c5c,
+ 0x9f5dc2c2, 0xbd6ed3d3, 0x43efacac, 0xc4a66262, 0x39a89191, 0x31a49595,
+ 0xd337e4e4, 0xf28b7979, 0xd532e7e7, 0x8b43c8c8, 0x6e593737, 0xdab76d6d,
+ 0x018c8d8d, 0xb164d5d5, 0x9cd24e4e, 0x49e0a9a9, 0xd8b46c6c, 0xacfa5656,
+ 0xf307f4f4, 0xcf25eaea, 0xcaaf6565, 0xf48e7a7a, 0x47e9aeae, 0x10180808,
+ 0x6fd5baba, 0xf0887878, 0x4a6f2525, 0x5c722e2e, 0x38241c1c, 0x57f1a6a6,
+ 0x73c7b4b4, 0x9751c6c6, 0xcb23e8e8, 0xa17cdddd, 0xe89c7474, 0x3e211f1f,
+ 0x96dd4b4b, 0x61dcbdbd, 0x0d868b8b, 0x0f858a8a, 0xe0907070, 0x7c423e3e,
+ 0x71c4b5b5, 0xccaa6666, 0x90d84848, 0x06050303, 0xf701f6f6, 0x1c120e0e,
+ 0xc2a36161, 0x6a5f3535, 0xaef95757, 0x69d0b9b9, 0x17918686, 0x9958c1c1,
+ 0x3a271d1d, 0x27b99e9e, 0xd938e1e1, 0xeb13f8f8, 0x2bb39898, 0x22331111,
+ 0xd2bb6969, 0xa970d9d9, 0x07898e8e, 0x33a79494, 0x2db69b9b, 0x3c221e1e,
+ 0x15928787, 0xc920e9e9, 0x8749cece, 0xaaff5555, 0x50782828, 0xa57adfdf,
+ 0x038f8c8c, 0x59f8a1a1, 0x09808989, 0x1a170d0d, 0x65dabfbf, 0xd731e6e6,
+ 0x84c64242, 0xd0b86868, 0x82c34141, 0x29b09999, 0x5a772d2d, 0x1e110f0f,
+ 0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, 0x2c3a1616,
};
// Software implementation of the Vector128 class, using uint32_t
@@ -235,45 +238,13 @@ struct alignas(16) Vector128 {
inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE Vector128
Vector128Load(const void* from) {
Vector128 result;
- const uint8_t* src = reinterpret_cast<const uint8_t*>(from);
- result.s[0] = static_cast<uint32_t>(src[0]) << 24 |
- static_cast<uint32_t>(src[1]) << 16 |
- static_cast<uint32_t>(src[2]) << 8 |
- static_cast<uint32_t>(src[3]);
- result.s[1] = static_cast<uint32_t>(src[4]) << 24 |
- static_cast<uint32_t>(src[5]) << 16 |
- static_cast<uint32_t>(src[6]) << 8 |
- static_cast<uint32_t>(src[7]);
- result.s[2] = static_cast<uint32_t>(src[8]) << 24 |
- static_cast<uint32_t>(src[9]) << 16 |
- static_cast<uint32_t>(src[10]) << 8 |
- static_cast<uint32_t>(src[11]);
- result.s[3] = static_cast<uint32_t>(src[12]) << 24 |
- static_cast<uint32_t>(src[13]) << 16 |
- static_cast<uint32_t>(src[14]) << 8 |
- static_cast<uint32_t>(src[15]);
+ std::memcpy(result.s, from, sizeof(Vector128));
return result;
}
inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void Vector128Store(
const Vector128& v, void* to) {
- uint8_t* dst = reinterpret_cast<uint8_t*>(to);
- dst[0] = static_cast<uint8_t>(v.s[0] >> 24);
- dst[1] = static_cast<uint8_t>(v.s[0] >> 16);
- dst[2] = static_cast<uint8_t>(v.s[0] >> 8);
- dst[3] = static_cast<uint8_t>(v.s[0]);
- dst[4] = static_cast<uint8_t>(v.s[1] >> 24);
- dst[5] = static_cast<uint8_t>(v.s[1] >> 16);
- dst[6] = static_cast<uint8_t>(v.s[1] >> 8);
- dst[7] = static_cast<uint8_t>(v.s[1]);
- dst[8] = static_cast<uint8_t>(v.s[2] >> 24);
- dst[9] = static_cast<uint8_t>(v.s[2] >> 16);
- dst[10] = static_cast<uint8_t>(v.s[2] >> 8);
- dst[11] = static_cast<uint8_t>(v.s[2]);
- dst[12] = static_cast<uint8_t>(v.s[3] >> 24);
- dst[13] = static_cast<uint8_t>(v.s[3] >> 16);
- dst[14] = static_cast<uint8_t>(v.s[3] >> 8);
- dst[15] = static_cast<uint8_t>(v.s[3]);
+ std::memcpy(to, v.s, sizeof(Vector128));
}
// One round of AES. "round_key" is a public constant for breaking the
@@ -281,39 +252,57 @@ inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void Vector128Store(
inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE Vector128
AesRound(const Vector128& state, const Vector128& round_key) {
Vector128 result;
+#ifdef ABSL_IS_LITTLE_ENDIAN
result.s[0] = round_key.s[0] ^ //
- te0[uint8_t(state.s[0] >> 24)] ^ //
- te1[uint8_t(state.s[1] >> 16)] ^ //
- te2[uint8_t(state.s[2] >> 8)] ^ //
- te3[uint8_t(state.s[3])];
+ te0[uint8_t(state.s[0])] ^ //
+ te1[uint8_t(state.s[1] >> 8)] ^ //
+ te2[uint8_t(state.s[2] >> 16)] ^ //
+ te3[uint8_t(state.s[3] >> 24)];
result.s[1] = round_key.s[1] ^ //
- te0[uint8_t(state.s[1] >> 24)] ^ //
- te1[uint8_t(state.s[2] >> 16)] ^ //
- te2[uint8_t(state.s[3] >> 8)] ^ //
- te3[uint8_t(state.s[0])];
+ te0[uint8_t(state.s[1])] ^ //
+ te1[uint8_t(state.s[2] >> 8)] ^ //
+ te2[uint8_t(state.s[3] >> 16)] ^ //
+ te3[uint8_t(state.s[0] >> 24)];
result.s[2] = round_key.s[2] ^ //
- te0[uint8_t(state.s[2] >> 24)] ^ //
- te1[uint8_t(state.s[3] >> 16)] ^ //
- te2[uint8_t(state.s[0] >> 8)] ^ //
- te3[uint8_t(state.s[1])];
+ te0[uint8_t(state.s[2])] ^ //
+ te1[uint8_t(state.s[3] >> 8)] ^ //
+ te2[uint8_t(state.s[0] >> 16)] ^ //
+ te3[uint8_t(state.s[1] >> 24)];
result.s[3] = round_key.s[3] ^ //
- te0[uint8_t(state.s[3] >> 24)] ^ //
- te1[uint8_t(state.s[0] >> 16)] ^ //
- te2[uint8_t(state.s[1] >> 8)] ^ //
- te3[uint8_t(state.s[2])];
+ te0[uint8_t(state.s[3])] ^ //
+ te1[uint8_t(state.s[0] >> 8)] ^ //
+ te2[uint8_t(state.s[1] >> 16)] ^ //
+ te3[uint8_t(state.s[2] >> 24)];
+#else
+ result.s[0] = round_key.s[0] ^ //
+ te0[uint8_t(state.s[0])] ^ //
+ te1[uint8_t(state.s[3] >> 8)] ^ //
+ te2[uint8_t(state.s[2] >> 16)] ^ //
+ te3[uint8_t(state.s[1] >> 24)];
+ result.s[1] = round_key.s[1] ^ //
+ te0[uint8_t(state.s[1])] ^ //
+ te1[uint8_t(state.s[0] >> 8)] ^ //
+ te2[uint8_t(state.s[3] >> 16)] ^ //
+ te3[uint8_t(state.s[2] >> 24)];
+ result.s[2] = round_key.s[2] ^ //
+ te0[uint8_t(state.s[2])] ^ //
+ te1[uint8_t(state.s[1] >> 8)] ^ //
+ te2[uint8_t(state.s[0] >> 16)] ^ //
+ te3[uint8_t(state.s[3] >> 24)];
+ result.s[3] = round_key.s[3] ^ //
+ te0[uint8_t(state.s[3])] ^ //
+ te1[uint8_t(state.s[2] >> 8)] ^ //
+ te2[uint8_t(state.s[1] >> 16)] ^ //
+ te3[uint8_t(state.s[0] >> 24)];
+#endif
return result;
}
using ::absl::random_internal::RandenTraits;
-// Randen operates on 128-bit vectors.
-struct alignas(16) u64x2 {
- uint64_t data[2];
-};
-
// The improved Feistel block shuffle function for 16 blocks.
inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void BlockShuffle(
- u64x2* state) {
+ absl::uint128* state) {
static_assert(RandenTraits::kFeistelBlocks == 16,
"Feistel block shuffle only works for 16 blocks.");
@@ -323,31 +312,31 @@ inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void BlockShuffle(
// The fully unrolled loop without the memcpy improves the speed by about
// 30% over the equivalent:
#if 0
- u64x2 source[RandenTraits::kFeistelBlocks];
+ absl::uint128 source[RandenTraits::kFeistelBlocks];
std::memcpy(source, state, sizeof(source));
for (size_t i = 0; i < RandenTraits::kFeistelBlocks; i++) {
- const u64x2 v0 = source[shuffle[i]];
+ const absl::uint128 v0 = source[shuffle[i]];
state[i] = v0;
}
return;
#endif
- const u64x2 v0 = state[shuffle[0]];
- const u64x2 v1 = state[shuffle[1]];
- const u64x2 v2 = state[shuffle[2]];
- const u64x2 v3 = state[shuffle[3]];
- const u64x2 v4 = state[shuffle[4]];
- const u64x2 v5 = state[shuffle[5]];
- const u64x2 v6 = state[shuffle[6]];
- const u64x2 v7 = state[shuffle[7]];
- const u64x2 w0 = state[shuffle[8]];
- const u64x2 w1 = state[shuffle[9]];
- const u64x2 w2 = state[shuffle[10]];
- const u64x2 w3 = state[shuffle[11]];
- const u64x2 w4 = state[shuffle[12]];
- const u64x2 w5 = state[shuffle[13]];
- const u64x2 w6 = state[shuffle[14]];
- const u64x2 w7 = state[shuffle[15]];
+ const absl::uint128 v0 = state[shuffle[0]];
+ const absl::uint128 v1 = state[shuffle[1]];
+ const absl::uint128 v2 = state[shuffle[2]];
+ const absl::uint128 v3 = state[shuffle[3]];
+ const absl::uint128 v4 = state[shuffle[4]];
+ const absl::uint128 v5 = state[shuffle[5]];
+ const absl::uint128 v6 = state[shuffle[6]];
+ const absl::uint128 v7 = state[shuffle[7]];
+ const absl::uint128 w0 = state[shuffle[8]];
+ const absl::uint128 w1 = state[shuffle[9]];
+ const absl::uint128 w2 = state[shuffle[10]];
+ const absl::uint128 w3 = state[shuffle[11]];
+ const absl::uint128 w4 = state[shuffle[12]];
+ const absl::uint128 w5 = state[shuffle[13]];
+ const absl::uint128 w6 = state[shuffle[14]];
+ const absl::uint128 w7 = state[shuffle[15]];
state[0] = v0;
state[1] = v1;
state[2] = v2;
@@ -371,9 +360,9 @@ inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void BlockShuffle(
// per 16 bytes (vs. 10 for AES-CTR). Computing eight round functions in
// parallel hides the 7-cycle AESNI latency on HSW. Note that the Feistel
// XORs are 'free' (included in the second AES instruction).
-inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE const u64x2* FeistelRound(
- u64x2* ABSL_RANDOM_INTERNAL_RESTRICT state,
- const u64x2* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
+inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE const absl::uint128*
+FeistelRound(absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT state,
+ const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
for (size_t branch = 0; branch < RandenTraits::kFeistelBlocks; branch += 4) {
const Vector128 s0 = Vector128Load(state + branch);
const Vector128 s1 = Vector128Load(state + branch + 1);
@@ -398,13 +387,31 @@ inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE const u64x2* FeistelRound(
// 2^64 queries if the round function is a PRF. This is similar to the b=8 case
// of Simpira v2, but more efficient than its generic construction for b=16.
inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void Permute(
- u64x2* state, const u64x2* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
+ absl::uint128* state,
+ const absl::uint128* ABSL_RANDOM_INTERNAL_RESTRICT keys) {
for (size_t round = 0; round < RandenTraits::kFeistelRounds; ++round) {
keys = FeistelRound(state, keys);
BlockShuffle(state);
}
}
+// Enables native loads in the round loop by pre-swapping.
+inline ABSL_RANDOM_INTERNAL_ATTRIBUTE_ALWAYS_INLINE void SwapEndian(
+ absl::uint128* state) {
+#ifdef ABSL_IS_BIG_ENDIAN
+ for (uint32_t block = 0; block < RandenTraits::kFeistelBlocks; ++block) {
+ uint64_t new_lo = absl::little_endian::ToHost64(
+ static_cast<uint64_t>(state[block] >> 64));
+ uint64_t new_hi = absl::little_endian::ToHost64(
+ static_cast<uint64_t>((state[block] << 64) >> 64));
+ state[block] = (static_cast<absl::uint128>(new_hi) << 64) | new_lo;
+ }
+#else
+ // Avoid warning about unused variable.
+ (void)state;
+#endif
+}
+
} // namespace
namespace absl {
@@ -414,7 +421,11 @@ namespace random_internal {
const void* RandenSlow::GetKeys() {
// Round keys for one AES per Feistel round and branch.
// The canonical implementation uses first digits of Pi.
+#ifdef ABSL_IS_LITTLE_ENDIAN
return kRandenRoundKeys;
+#else
+ return kRandenRoundKeysBE;
+#endif
}
void RandenSlow::Absorb(const void* seed_void, void* state_void) {
@@ -437,19 +448,22 @@ void RandenSlow::Absorb(const void* seed_void, void* state_void) {
}
void RandenSlow::Generate(const void* keys_void, void* state_void) {
- static_assert(RandenTraits::kCapacityBytes == sizeof(u64x2),
+ static_assert(RandenTraits::kCapacityBytes == sizeof(absl::uint128),
"Capacity mismatch");
- auto* state = reinterpret_cast<u64x2*>(state_void);
- const auto* keys = reinterpret_cast<const u64x2*>(keys_void);
+ auto* state = reinterpret_cast<absl::uint128*>(state_void);
+ const auto* keys = reinterpret_cast<const absl::uint128*>(keys_void);
- const u64x2 prev_inner = state[0];
+ const absl::uint128 prev_inner = state[0];
+
+ SwapEndian(state);
Permute(state, keys);
+ SwapEndian(state);
+
// Ensure backtracking resistance.
- state[0].data[0] ^= prev_inner.data[0];
- state[0].data[1] ^= prev_inner.data[1];
+ *state ^= prev_inner;
}
} // namespace random_internal
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc b/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc
index 4861ffa4..ed603958 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_slow_test.cc
@@ -25,40 +25,37 @@ namespace {
using absl::random_internal::RandenSlow;
using absl::random_internal::RandenTraits;
-// Local state parameters.
-constexpr size_t kSeedBytes =
- RandenTraits::kStateBytes - RandenTraits::kCapacityBytes;
-constexpr size_t kStateSizeT = RandenTraits::kStateBytes / sizeof(uint64_t);
-constexpr size_t kSeedSizeT = kSeedBytes / sizeof(uint32_t);
-
-struct alignas(16) randen {
- uint64_t state[kStateSizeT];
- uint32_t seed[kSeedSizeT];
-};
-
TEST(RandenSlowTest, Default) {
- constexpr uint64_t kGolden[] = {
- 0x6c6534090ee6d3ee, 0x044e2b9b9d5333c6, 0xc3c14f134e433977,
- 0xdda9f47cd90410ee, 0x887bf3087fd8ca10, 0xf0b780f545c72912,
- 0x15dbb1d37696599f, 0x30ec63baff3c6d59, 0xb29f73606f7f20a6,
- 0x02808a316f49a54c, 0x3b8feaf9d5c8e50e, 0x9cbf605e3fd9de8a,
- 0xc970ae1a78183bbb, 0xd8b2ffd356301ed5, 0xf4b327fe0fc73c37,
- 0xcdfd8d76eb8f9a19, 0xc3a506eb91420c9d, 0xd5af05dd3eff9556,
- 0x48db1bb78f83c4a1, 0x7023920e0d6bfe8c, 0x58d3575834956d42,
- 0xed1ef4c26b87b840, 0x8eef32a23e0b2df3, 0x497cabf3431154fc,
- 0x4e24370570029a8b, 0xd88b5749f090e5ea, 0xc651a582a970692f,
- 0x78fcec2cbb6342f5, 0x463cb745612f55db, 0x352ee4ad1816afe3,
- 0x026ff374c101da7e, 0x811ef0821c3de851,
+ constexpr uint8_t kGolden[] = {
+ 0xee, 0xd3, 0xe6, 0x0e, 0x09, 0x34, 0x65, 0x6c, 0xc6, 0x33, 0x53, 0x9d,
+ 0x9b, 0x2b, 0x4e, 0x04, 0x77, 0x39, 0x43, 0x4e, 0x13, 0x4f, 0xc1, 0xc3,
+ 0xee, 0x10, 0x04, 0xd9, 0x7c, 0xf4, 0xa9, 0xdd, 0x10, 0xca, 0xd8, 0x7f,
+ 0x08, 0xf3, 0x7b, 0x88, 0x12, 0x29, 0xc7, 0x45, 0xf5, 0x80, 0xb7, 0xf0,
+ 0x9f, 0x59, 0x96, 0x76, 0xd3, 0xb1, 0xdb, 0x15, 0x59, 0x6d, 0x3c, 0xff,
+ 0xba, 0x63, 0xec, 0x30, 0xa6, 0x20, 0x7f, 0x6f, 0x60, 0x73, 0x9f, 0xb2,
+ 0x4c, 0xa5, 0x49, 0x6f, 0x31, 0x8a, 0x80, 0x02, 0x0e, 0xe5, 0xc8, 0xd5,
+ 0xf9, 0xea, 0x8f, 0x3b, 0x8a, 0xde, 0xd9, 0x3f, 0x5e, 0x60, 0xbf, 0x9c,
+ 0xbb, 0x3b, 0x18, 0x78, 0x1a, 0xae, 0x70, 0xc9, 0xd5, 0x1e, 0x30, 0x56,
+ 0xd3, 0xff, 0xb2, 0xd8, 0x37, 0x3c, 0xc7, 0x0f, 0xfe, 0x27, 0xb3, 0xf4,
+ 0x19, 0x9a, 0x8f, 0xeb, 0x76, 0x8d, 0xfd, 0xcd, 0x9d, 0x0c, 0x42, 0x91,
+ 0xeb, 0x06, 0xa5, 0xc3, 0x56, 0x95, 0xff, 0x3e, 0xdd, 0x05, 0xaf, 0xd5,
+ 0xa1, 0xc4, 0x83, 0x8f, 0xb7, 0x1b, 0xdb, 0x48, 0x8c, 0xfe, 0x6b, 0x0d,
+ 0x0e, 0x92, 0x23, 0x70, 0x42, 0x6d, 0x95, 0x34, 0x58, 0x57, 0xd3, 0x58,
+ 0x40, 0xb8, 0x87, 0x6b, 0xc2, 0xf4, 0x1e, 0xed, 0xf3, 0x2d, 0x0b, 0x3e,
+ 0xa2, 0x32, 0xef, 0x8e, 0xfc, 0x54, 0x11, 0x43, 0xf3, 0xab, 0x7c, 0x49,
+ 0x8b, 0x9a, 0x02, 0x70, 0x05, 0x37, 0x24, 0x4e, 0xea, 0xe5, 0x90, 0xf0,
+ 0x49, 0x57, 0x8b, 0xd8, 0x2f, 0x69, 0x70, 0xa9, 0x82, 0xa5, 0x51, 0xc6,
+ 0xf5, 0x42, 0x63, 0xbb, 0x2c, 0xec, 0xfc, 0x78, 0xdb, 0x55, 0x2f, 0x61,
+ 0x45, 0xb7, 0x3c, 0x46, 0xe3, 0xaf, 0x16, 0x18, 0xad, 0xe4, 0x2e, 0x35,
+ 0x7e, 0xda, 0x01, 0xc1, 0x74, 0xf3, 0x6f, 0x02, 0x51, 0xe8, 0x3d, 0x1c,
+ 0x82, 0xf0, 0x1e, 0x81,
};
- alignas(16) randen d;
- std::memset(d.state, 0, sizeof(d.state));
- RandenSlow::Generate(RandenSlow::GetKeys(), d.state);
+ alignas(16) uint8_t state[RandenTraits::kStateBytes];
+ std::memset(state, 0, sizeof(state));
- uint64_t* id = d.state;
- for (const auto& elem : kGolden) {
- EXPECT_EQ(absl::little_endian::FromHost64(elem), *id++);
- }
+ RandenSlow::Generate(RandenSlow::GetKeys(), state);
+ EXPECT_EQ(0, std::memcmp(state, kGolden, sizeof(state)));
}
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/randen_test.cc b/grpc/third_party/abseil-cpp/absl/random/internal/randen_test.cc
index c186fe0d..92773b8d 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/randen_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/randen_test.cc
@@ -23,9 +23,6 @@ namespace {
using absl::random_internal::Randen;
-// Local state parameters.
-constexpr size_t kStateSizeT = Randen::kStateBytes / sizeof(uint64_t);
-
TEST(RandenTest, CopyAndMove) {
static_assert(std::is_copy_constructible<Randen>::value,
"Randen must be copy constructible");
@@ -41,30 +38,38 @@ TEST(RandenTest, CopyAndMove) {
}
TEST(RandenTest, Default) {
- constexpr uint64_t kGolden[] = {
- 0x6c6534090ee6d3ee, 0x044e2b9b9d5333c6, 0xc3c14f134e433977,
- 0xdda9f47cd90410ee, 0x887bf3087fd8ca10, 0xf0b780f545c72912,
- 0x15dbb1d37696599f, 0x30ec63baff3c6d59, 0xb29f73606f7f20a6,
- 0x02808a316f49a54c, 0x3b8feaf9d5c8e50e, 0x9cbf605e3fd9de8a,
- 0xc970ae1a78183bbb, 0xd8b2ffd356301ed5, 0xf4b327fe0fc73c37,
- 0xcdfd8d76eb8f9a19, 0xc3a506eb91420c9d, 0xd5af05dd3eff9556,
- 0x48db1bb78f83c4a1, 0x7023920e0d6bfe8c, 0x58d3575834956d42,
- 0xed1ef4c26b87b840, 0x8eef32a23e0b2df3, 0x497cabf3431154fc,
- 0x4e24370570029a8b, 0xd88b5749f090e5ea, 0xc651a582a970692f,
- 0x78fcec2cbb6342f5, 0x463cb745612f55db, 0x352ee4ad1816afe3,
- 0x026ff374c101da7e, 0x811ef0821c3de851,
+ constexpr uint8_t kGolden[] = {
+ 0xee, 0xd3, 0xe6, 0x0e, 0x09, 0x34, 0x65, 0x6c, 0xc6, 0x33, 0x53, 0x9d,
+ 0x9b, 0x2b, 0x4e, 0x04, 0x77, 0x39, 0x43, 0x4e, 0x13, 0x4f, 0xc1, 0xc3,
+ 0xee, 0x10, 0x04, 0xd9, 0x7c, 0xf4, 0xa9, 0xdd, 0x10, 0xca, 0xd8, 0x7f,
+ 0x08, 0xf3, 0x7b, 0x88, 0x12, 0x29, 0xc7, 0x45, 0xf5, 0x80, 0xb7, 0xf0,
+ 0x9f, 0x59, 0x96, 0x76, 0xd3, 0xb1, 0xdb, 0x15, 0x59, 0x6d, 0x3c, 0xff,
+ 0xba, 0x63, 0xec, 0x30, 0xa6, 0x20, 0x7f, 0x6f, 0x60, 0x73, 0x9f, 0xb2,
+ 0x4c, 0xa5, 0x49, 0x6f, 0x31, 0x8a, 0x80, 0x02, 0x0e, 0xe5, 0xc8, 0xd5,
+ 0xf9, 0xea, 0x8f, 0x3b, 0x8a, 0xde, 0xd9, 0x3f, 0x5e, 0x60, 0xbf, 0x9c,
+ 0xbb, 0x3b, 0x18, 0x78, 0x1a, 0xae, 0x70, 0xc9, 0xd5, 0x1e, 0x30, 0x56,
+ 0xd3, 0xff, 0xb2, 0xd8, 0x37, 0x3c, 0xc7, 0x0f, 0xfe, 0x27, 0xb3, 0xf4,
+ 0x19, 0x9a, 0x8f, 0xeb, 0x76, 0x8d, 0xfd, 0xcd, 0x9d, 0x0c, 0x42, 0x91,
+ 0xeb, 0x06, 0xa5, 0xc3, 0x56, 0x95, 0xff, 0x3e, 0xdd, 0x05, 0xaf, 0xd5,
+ 0xa1, 0xc4, 0x83, 0x8f, 0xb7, 0x1b, 0xdb, 0x48, 0x8c, 0xfe, 0x6b, 0x0d,
+ 0x0e, 0x92, 0x23, 0x70, 0x42, 0x6d, 0x95, 0x34, 0x58, 0x57, 0xd3, 0x58,
+ 0x40, 0xb8, 0x87, 0x6b, 0xc2, 0xf4, 0x1e, 0xed, 0xf3, 0x2d, 0x0b, 0x3e,
+ 0xa2, 0x32, 0xef, 0x8e, 0xfc, 0x54, 0x11, 0x43, 0xf3, 0xab, 0x7c, 0x49,
+ 0x8b, 0x9a, 0x02, 0x70, 0x05, 0x37, 0x24, 0x4e, 0xea, 0xe5, 0x90, 0xf0,
+ 0x49, 0x57, 0x8b, 0xd8, 0x2f, 0x69, 0x70, 0xa9, 0x82, 0xa5, 0x51, 0xc6,
+ 0xf5, 0x42, 0x63, 0xbb, 0x2c, 0xec, 0xfc, 0x78, 0xdb, 0x55, 0x2f, 0x61,
+ 0x45, 0xb7, 0x3c, 0x46, 0xe3, 0xaf, 0x16, 0x18, 0xad, 0xe4, 0x2e, 0x35,
+ 0x7e, 0xda, 0x01, 0xc1, 0x74, 0xf3, 0x6f, 0x02, 0x51, 0xe8, 0x3d, 0x1c,
+ 0x82, 0xf0, 0x1e, 0x81,
};
- alignas(16) uint64_t state[kStateSizeT];
+ alignas(16) uint8_t state[Randen::kStateBytes];
std::memset(state, 0, sizeof(state));
Randen r;
r.Generate(state);
- auto id = std::begin(state);
- for (const auto& elem : kGolden) {
- EXPECT_EQ(elem, *id++);
- }
+ EXPECT_EQ(0, std::memcmp(state, kGolden, sizeof(state)));
}
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/random/internal/seed_material.cc b/grpc/third_party/abseil-cpp/absl/random/internal/seed_material.cc
index 4d38a574..c03cad85 100644
--- a/grpc/third_party/abseil-cpp/absl/random/internal/seed_material.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/internal/seed_material.cc
@@ -28,6 +28,7 @@
#include <cstdlib>
#include <cstring>
+#include "absl/base/dynamic_annotations.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
@@ -50,6 +51,18 @@
#endif
+#if defined(__GLIBC__) && \
+ (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))
+// glibc >= 2.25 has getentropy()
+#define ABSL_RANDOM_USE_GET_ENTROPY 1
+#endif
+
+#if defined(__EMSCRIPTEN__)
+#include <sys/random.h>
+// Emscripten has getentropy, but it resides in a different header.
+#define ABSL_RANDOM_USE_GET_ENTROPY 1
+#endif
+
#if defined(ABSL_RANDOM_USE_BCRYPT)
#include <bcrypt.h>
@@ -122,8 +135,32 @@ bool ReadSeedMaterialFromOSEntropyImpl(absl::Span<uint32_t> values) {
#else
+#if defined(ABSL_RANDOM_USE_GET_ENTROPY)
+// On *nix, use getentropy() if supported. Note that libc may support
+// getentropy(), but the kernel may not, in which case this function will return
+// false.
+bool ReadSeedMaterialFromGetEntropy(absl::Span<uint32_t> values) {
+ auto buffer = reinterpret_cast<uint8_t*>(values.data());
+ size_t buffer_size = sizeof(uint32_t) * values.size();
+ while (buffer_size > 0) {
+ // getentropy() has a maximum permitted length of 256.
+ size_t to_read = std::min<size_t>(buffer_size, 256);
+ int result = getentropy(buffer, to_read);
+ if (result < 0) {
+ return false;
+ }
+ // https://github.com/google/sanitizers/issues/1173
+ // MemorySanitizer can't see through getentropy().
+ ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, to_read);
+ buffer += to_read;
+ buffer_size -= to_read;
+ }
+ return true;
+}
+#endif // defined(ABSL_RANDOM_GETENTROPY)
+
// On *nix, read entropy from /dev/urandom.
-bool ReadSeedMaterialFromOSEntropyImpl(absl::Span<uint32_t> values) {
+bool ReadSeedMaterialFromDevURandom(absl::Span<uint32_t> values) {
const char kEntropyFile[] = "/dev/urandom";
auto buffer = reinterpret_cast<uint8_t*>(values.data());
@@ -150,6 +187,17 @@ bool ReadSeedMaterialFromOSEntropyImpl(absl::Span<uint32_t> values) {
return success;
}
+bool ReadSeedMaterialFromOSEntropyImpl(absl::Span<uint32_t> values) {
+#if defined(ABSL_RANDOM_USE_GET_ENTROPY)
+ if (ReadSeedMaterialFromGetEntropy(values)) {
+ return true;
+ }
+#endif
+ // Libc may support getentropy, but the kernel may not, so we still have
+ // to fallback to ReadSeedMaterialFromDevURandom().
+ return ReadSeedMaterialFromDevURandom(values);
+}
+
#endif
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc b/grpc/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc
index f63b6e42..c713ceaf 100644
--- a/grpc/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/mocking_bit_gen_test.cc
@@ -15,6 +15,7 @@
//
#include "absl/random/mocking_bit_gen.h"
+#include <cmath>
#include <numeric>
#include <random>
@@ -328,8 +329,9 @@ TEST(BasicMocking, WillByDefaultWithArgs) {
absl::MockingBitGen gen;
ON_CALL(absl::MockPoisson<int>(), Call(gen, _))
- .WillByDefault(
- [](double lambda) { return static_cast<int>(lambda * 10); });
+ .WillByDefault([](double lambda) {
+ return static_cast<int>(std::rint(lambda * 10));
+ });
EXPECT_EQ(absl::Poisson<int>(gen, 1.7), 17);
EXPECT_EQ(absl::Poisson<int>(gen, 0.03), 0);
}
diff --git a/grpc/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc b/grpc/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc
index 18bcd3bc..035bd284 100644
--- a/grpc/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc
@@ -14,6 +14,7 @@
#include "absl/random/uniform_real_distribution.h"
+#include <cfloat>
#include <cmath>
#include <cstdint>
#include <iterator>
@@ -70,6 +71,14 @@ using RealTypes =
TYPED_TEST_SUITE(UniformRealDistributionTest, RealTypes);
TYPED_TEST(UniformRealDistributionTest, ParamSerializeTest) {
+#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
+ // We're using an x87-compatible FPU, and intermediate operations are
+ // performed with 80-bit floats. This produces slightly different results from
+ // what we expect below.
+ GTEST_SKIP()
+ << "Skipping the test because we detected x87 floating-point semantics";
+#endif
+
using param_type =
typename absl::uniform_real_distribution<TypeParam>::param_type;
diff --git a/grpc/third_party/abseil-cpp/absl/status/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/status/BUILD.bazel
index 189bd73d..bae5156f 100644
--- a/grpc/third_party/abseil-cpp/absl/status/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/status/BUILD.bazel
@@ -17,7 +17,6 @@
# It will expand later to have utilities around `Status` like `StatusOr`,
# `StatusBuilder` and macros.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -48,6 +47,7 @@ cc_library(
"//absl/container:inlined_vector",
"//absl/debugging:stacktrace",
"//absl/debugging:symbolize",
+ "//absl/functional:function_ref",
"//absl/strings",
"//absl/strings:cord",
"//absl/strings:str_format",
@@ -78,6 +78,7 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
deps = [
":status",
+ "//absl/base",
"//absl/base:core_headers",
"//absl/base:raw_logging_internal",
"//absl/meta:type_traits",
@@ -96,6 +97,7 @@ cc_test(
":statusor",
"//absl/base",
"//absl/memory",
+ "//absl/strings",
"//absl/types:any",
"//absl/utility",
"@com_google_googletest//:gtest_main",
diff --git a/grpc/third_party/abseil-cpp/absl/status/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/status/CMakeLists.txt
index f0d798a3..f107c85b 100644
--- a/grpc/third_party/abseil-cpp/absl/status/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/status/CMakeLists.txt
@@ -29,6 +29,7 @@ absl_cc_library(
absl::atomic_hook
absl::config
absl::core_headers
+ absl::function_ref
absl::raw_logging_internal
absl::inlined_vector
absl::stacktrace
@@ -50,7 +51,7 @@ absl_cc_test(
DEPS
absl::status
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -64,6 +65,7 @@ absl_cc_library(
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
+ absl::base
absl::status
absl::core_headers
absl::raw_logging_internal
@@ -84,5 +86,5 @@ absl_cc_test(
DEPS
absl::status
absl::statusor
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/status/internal/status_internal.h b/grpc/third_party/abseil-cpp/absl/status/internal/status_internal.h
index 99a2d964..ac12940a 100644
--- a/grpc/third_party/abseil-cpp/absl/status/internal/status_internal.h
+++ b/grpc/third_party/abseil-cpp/absl/status/internal/status_internal.h
@@ -47,12 +47,12 @@ using Payloads = absl::InlinedVector<Payload, 1>;
// Reference-counted representation of Status data.
struct StatusRep {
- StatusRep(absl::StatusCode code, std::string message,
- std::unique_ptr<status_internal::Payloads> payloads)
+ StatusRep(absl::StatusCode code_arg, absl::string_view message_arg,
+ std::unique_ptr<status_internal::Payloads> payloads_arg)
: ref(int32_t{1}),
- code(code),
- message(std::move(message)),
- payloads(std::move(payloads)) {}
+ code(code_arg),
+ message(message_arg),
+ payloads(std::move(payloads_arg)) {}
std::atomic<int32_t> ref;
absl::StatusCode code;
diff --git a/grpc/third_party/abseil-cpp/absl/status/status.cc b/grpc/third_party/abseil-cpp/absl/status/status.cc
index 51a0d268..bcf3413e 100644
--- a/grpc/third_party/abseil-cpp/absl/status/status.cc
+++ b/grpc/third_party/abseil-cpp/absl/status/status.cc
@@ -161,7 +161,7 @@ bool Status::ErasePayload(absl::string_view type_url) {
}
void Status::ForEachPayload(
- const std::function<void(absl::string_view, const absl::Cord&)>& visitor)
+ absl::FunctionRef<void(absl::string_view, const absl::Cord&)> visitor)
const {
if (auto* payloads = GetPayloads()) {
bool in_reverse =
@@ -207,19 +207,10 @@ void Status::UnrefNonInlined(uintptr_t rep) {
}
}
-uintptr_t Status::NewRep(
- absl::StatusCode code, absl::string_view msg,
- std::unique_ptr<status_internal::Payloads> payloads) {
- status_internal::StatusRep* rep = new status_internal::StatusRep(
- code, std::string(msg.data(), msg.size()),
- std::move(payloads));
- return PointerToRep(rep);
-}
-
Status::Status(absl::StatusCode code, absl::string_view msg)
: rep_(CodeToInlinedRep(code)) {
if (code != absl::StatusCode::kOk && !msg.empty()) {
- rep_ = NewRep(code, msg, nullptr);
+ rep_ = PointerToRep(new status_internal::StatusRep(code, msg, nullptr));
}
}
@@ -238,9 +229,9 @@ absl::StatusCode Status::code() const {
void Status::PrepareToModify() {
ABSL_RAW_CHECK(!ok(), "PrepareToModify shouldn't be called on OK status.");
if (IsInlined(rep_)) {
- rep_ =
- NewRep(static_cast<absl::StatusCode>(raw_code()), absl::string_view(),
- nullptr);
+ rep_ = PointerToRep(new status_internal::StatusRep(
+ static_cast<absl::StatusCode>(raw_code()), absl::string_view(),
+ nullptr));
return;
}
@@ -251,8 +242,9 @@ void Status::PrepareToModify() {
if (rep->payloads) {
payloads = absl::make_unique<status_internal::Payloads>(*rep->payloads);
}
- rep_ = NewRep(rep->code, message(),
- std::move(payloads));
+ status_internal::StatusRep* const new_rep = new status_internal::StatusRep(
+ rep->code, message(), std::move(payloads));
+ rep_ = PointerToRep(new_rep);
UnrefNonInlined(rep_i);
}
}
@@ -316,7 +308,7 @@ std::string Status::ToStringSlow(StatusToStringMode mode) const {
}
std::ostream& operator<<(std::ostream& os, const Status& x) {
- os << x.ToString();
+ os << x.ToString(StatusToStringMode::kWithEverything);
return os;
}
diff --git a/grpc/third_party/abseil-cpp/absl/status/status.h b/grpc/third_party/abseil-cpp/absl/status/status.h
index 61486fee..39071e5f 100644
--- a/grpc/third_party/abseil-cpp/absl/status/status.h
+++ b/grpc/third_party/abseil-cpp/absl/status/status.h
@@ -55,6 +55,7 @@
#include <string>
#include "absl/container/inlined_vector.h"
+#include "absl/functional/function_ref.h"
#include "absl/status/internal/status_internal.h"
#include "absl/strings/cord.h"
#include "absl/strings/string_view.h"
@@ -80,7 +81,7 @@ ABSL_NAMESPACE_BEGIN
// `kFailedPrecondition` if both codes apply. Similarly prefer `kNotFound` or
// `kAlreadyExists` over `kFailedPrecondition`.
//
-// Because these errors may travel RPC boundaries, these codes are tied to the
+// Because these errors may cross RPC boundaries, these codes are tied to the
// `google.rpc.Code` definitions within
// https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
// The string value of these RPC codes is denoted within each enum below.
@@ -114,10 +115,10 @@ enum class StatusCode : int {
// StatusCode::kInvalidArgument
//
// kInvalidArgument (gRPC code "INVALID_ARGUMENT") indicates the caller
- // specified an invalid argument, such a malformed filename. Note that such
- // errors should be narrowly limited to indicate to the invalid nature of the
- // arguments themselves. Errors with validly formed arguments that may cause
- // errors with the state of the receiving system should be denoted with
+ // specified an invalid argument, such as a malformed filename. Note that use
+ // of such errors should be narrowly limited to indicate the invalid nature of
+ // the arguments themselves. Errors with validly formed arguments that may
+ // cause errors with the state of the receiving system should be denoted with
// `kFailedPrecondition` instead.
kInvalidArgument = 3,
@@ -137,14 +138,15 @@ enum class StatusCode : int {
//
// `kNotFound` is useful if a request should be denied for an entire class of
// users, such as during a gradual feature rollout or undocumented allow list.
- // If, instead, a request should be denied for specific sets of users, such as
- // through user-based access control, use `kPermissionDenied` instead.
+ // If a request should be denied for specific sets of users, such as through
+ // user-based access control, use `kPermissionDenied` instead.
kNotFound = 5,
// StatusCode::kAlreadyExists
//
- // kAlreadyExists (gRPC code "ALREADY_EXISTS") indicates the entity that a
- // caller attempted to create (such as file or directory) is already present.
+ // kAlreadyExists (gRPC code "ALREADY_EXISTS") indicates that the entity a
+ // caller attempted to create (such as a file or directory) is already
+ // present.
kAlreadyExists = 6,
// StatusCode::kPermissionDenied
@@ -183,7 +185,7 @@ enum class StatusCode : int {
// level (such as when a client-specified test-and-set fails, indicating
// the client should restart a read-modify-write sequence).
// (c) Use `kFailedPrecondition` if the client should not retry until
- // the system state has been explicitly fixed. For example, if an "rmdir"
+ // the system state has been explicitly fixed. For example, if a "rmdir"
// fails because the directory is non-empty, `kFailedPrecondition`
// should be returned since the client should not retry unless
// the files are deleted from the directory.
@@ -283,7 +285,7 @@ std::ostream& operator<<(std::ostream& os, StatusCode code);
// absl::StatusToStringMode
//
// An `absl::StatusToStringMode` is an enumerated type indicating how
-// `absl::Status::ToString()` should construct the output string for an non-ok
+// `absl::Status::ToString()` should construct the output string for a non-ok
// status.
enum class StatusToStringMode : int {
// ToString will not contain any extra data (such as payloads). It will only
@@ -293,6 +295,8 @@ enum class StatusToStringMode : int {
kWithPayload = 1 << 0,
// ToString will include all the extra data this Status has.
kWithEverything = ~kWithNoExtraData,
+ // Default mode used by ToString. Its exact value might change in the future.
+ kDefault = kWithPayload,
};
// absl::StatusToStringMode is specified as a bitmask type, which means the
@@ -343,7 +347,7 @@ inline StatusToStringMode& operator^=(StatusToStringMode& lhs,
// API developers should construct their functions to return `absl::OkStatus()`
// upon success, or an `absl::StatusCode` upon another type of error (e.g
// an `absl::StatusCode::kInvalidArgument` error). The API provides convenience
-// functions to constuct each status code.
+// functions to construct each status code.
//
// Example:
//
@@ -491,7 +495,7 @@ class Status final {
// Returns the error message associated with this error code, if available.
// Note that this message rarely describes the error code. It is not unusual
// for the error message to be the empty string. As a result, prefer
- // `Status::ToString()` for debug logging.
+ // `operator<<` or `Status::ToString()` for debug logging.
absl::string_view message() const;
friend bool operator==(const Status&, const Status&);
@@ -509,7 +513,7 @@ class Status final {
// result, and the payloads to be printed use the status payload printer
// mechanism (which is internal).
std::string ToString(
- StatusToStringMode mode = StatusToStringMode::kWithPayload) const;
+ StatusToStringMode mode = StatusToStringMode::kDefault) const;
// Status::IgnoreError()
//
@@ -587,7 +591,7 @@ class Status final {
// NOTE: Any mutation on the same 'absl::Status' object during visitation is
// forbidden and could result in undefined behavior.
void ForEachPayload(
- const std::function<void(absl::string_view, const absl::Cord&)>& visitor)
+ absl::FunctionRef<void(absl::string_view, const absl::Cord&)> visitor)
const;
private:
diff --git a/grpc/third_party/abseil-cpp/absl/status/status_test.cc b/grpc/third_party/abseil-cpp/absl/status/status_test.cc
index 0e1a43ce..1b038f6d 100644
--- a/grpc/third_party/abseil-cpp/absl/status/status_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/status/status_test.cc
@@ -36,7 +36,9 @@ TEST(StatusCode, InsertionOperator) {
// its creator, and its classifier.
struct ErrorTest {
absl::StatusCode code;
- using Creator = absl::Status (*)(absl::string_view);
+ using Creator = absl::Status (*)(
+ absl::string_view
+ );
using Classifier = bool (*)(const absl::Status&);
Creator creator;
Classifier classifier;
@@ -78,7 +80,9 @@ TEST(Status, CreateAndClassify) {
// expected error code and message.
std::string message =
absl::StrCat("error code ", test.code, " test message");
- absl::Status status = test.creator(message);
+ absl::Status status = test.creator(
+ message
+ );
EXPECT_EQ(test.code, status.code());
EXPECT_EQ(message, status.message());
diff --git a/grpc/third_party/abseil-cpp/absl/status/statusor.cc b/grpc/third_party/abseil-cpp/absl/status/statusor.cc
index b954b45e..96642b34 100644
--- a/grpc/third_party/abseil-cpp/absl/status/statusor.cc
+++ b/grpc/third_party/abseil-cpp/absl/status/statusor.cc
@@ -16,6 +16,7 @@
#include <cstdlib>
#include <utility>
+#include "absl/base/call_once.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
@@ -26,13 +27,44 @@ ABSL_NAMESPACE_BEGIN
BadStatusOrAccess::BadStatusOrAccess(absl::Status status)
: status_(std::move(status)) {}
-BadStatusOrAccess::~BadStatusOrAccess() = default;
+BadStatusOrAccess::BadStatusOrAccess(const BadStatusOrAccess& other)
+ : status_(other.status_) {}
+
+BadStatusOrAccess& BadStatusOrAccess::operator=(
+ const BadStatusOrAccess& other) {
+ // Ensure assignment is correct regardless of whether this->InitWhat() has
+ // already been called.
+ other.InitWhat();
+ status_ = other.status_;
+ what_ = other.what_;
+ return *this;
+}
+
+BadStatusOrAccess& BadStatusOrAccess::operator=(BadStatusOrAccess&& other) {
+ // Ensure assignment is correct regardless of whether this->InitWhat() has
+ // already been called.
+ other.InitWhat();
+ status_ = std::move(other.status_);
+ what_ = std::move(other.what_);
+ return *this;
+}
+
+BadStatusOrAccess::BadStatusOrAccess(BadStatusOrAccess&& other)
+ : status_(std::move(other.status_)) {}
+
const char* BadStatusOrAccess::what() const noexcept {
- return "Bad StatusOr access";
+ InitWhat();
+ return what_.c_str();
}
const absl::Status& BadStatusOrAccess::status() const { return status_; }
+void BadStatusOrAccess::InitWhat() const {
+ absl::call_once(init_what_, [this] {
+ what_ = absl::StrCat("Bad StatusOr access: ", status_.ToString());
+ });
+}
+
namespace internal_statusor {
void Helper::HandleInvalidStatusCtorArg(absl::Status* status) {
diff --git a/grpc/third_party/abseil-cpp/absl/status/statusor.h b/grpc/third_party/abseil-cpp/absl/status/statusor.h
index b7c55cc8..c051fbb3 100644
--- a/grpc/third_party/abseil-cpp/absl/status/statusor.h
+++ b/grpc/third_party/abseil-cpp/absl/status/statusor.h
@@ -44,6 +44,7 @@
#include <utility>
#include "absl/base/attributes.h"
+#include "absl/base/call_once.h"
#include "absl/meta/type_traits.h"
#include "absl/status/internal/statusor_internal.h"
#include "absl/status/status.h"
@@ -72,13 +73,18 @@ ABSL_NAMESPACE_BEGIN
class BadStatusOrAccess : public std::exception {
public:
explicit BadStatusOrAccess(absl::Status status);
- ~BadStatusOrAccess() override;
+ ~BadStatusOrAccess() override = default;
+
+ BadStatusOrAccess(const BadStatusOrAccess& other);
+ BadStatusOrAccess& operator=(const BadStatusOrAccess& other);
+ BadStatusOrAccess(BadStatusOrAccess&& other);
+ BadStatusOrAccess& operator=(BadStatusOrAccess&& other);
// BadStatusOrAccess::what()
//
// Returns the associated explanatory string of the `absl::StatusOr<T>`
- // object's error code. This function only returns the string literal "Bad
- // StatusOr Access" for cases when evaluating general exceptions.
+ // object's error code. This function contains information about the failing
+ // status, but its exact formatting may change and should not be depended on.
//
// The pointer of this string is guaranteed to be valid until any non-const
// function is invoked on the exception object.
@@ -91,7 +97,11 @@ class BadStatusOrAccess : public std::exception {
const absl::Status& status() const;
private:
+ void InitWhat() const;
+
absl::Status status_;
+ mutable absl::once_flag init_what_;
+ mutable std::string what_;
};
// Returned StatusOr objects may not be ignored.
@@ -419,8 +429,8 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
// if `T` can be constructed from a `U`. Can accept move or copy constructors.
//
// This constructor is explicit if `U` is not convertible to `T`. To avoid
- // ambiguity, this constuctor is disabled if `U` is a `StatusOr<J>`, where `J`
- // is convertible to `T`.
+ // ambiguity, this constructor is disabled if `U` is a `StatusOr<J>`, where
+ // `J` is convertible to `T`.
template <
typename U = T,
absl::enable_if_t<
@@ -437,8 +447,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
T, U&&>>>>>::value,
int> = 0>
StatusOr(U&& u) // NOLINT
- : StatusOr(absl::in_place, std::forward<U>(u)) {
- }
+ : StatusOr(absl::in_place, std::forward<U>(u)) {}
template <
typename U = T,
@@ -457,8 +466,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
absl::negation<std::is_convertible<U&&, T>>>::value,
int> = 0>
explicit StatusOr(U&& u) // NOLINT
- : StatusOr(absl::in_place, std::forward<U>(u)) {
- }
+ : StatusOr(absl::in_place, std::forward<U>(u)) {}
// StatusOr<T>::ok()
//
@@ -481,7 +489,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
// Returns a reference to the current `absl::Status` contained within the
// `absl::StatusOr<T>`. If `absl::StatusOr<T>` contains a `T`, then this
// function returns `absl::OkStatus()`.
- const Status& status() const &;
+ const Status& status() const&;
Status status() &&;
// StatusOr<T>::value()
@@ -510,10 +518,10 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
//
// The `std::move` on statusor instead of on the whole expression enables
// warnings about possible uses of the statusor object after the move.
- const T& value() const&;
- T& value() &;
- const T&& value() const&&;
- T&& value() &&;
+ const T& value() const& ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ T& value() & ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ const T&& value() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ T&& value() && ABSL_ATTRIBUTE_LIFETIME_BOUND;
// StatusOr<T>:: operator*()
//
@@ -525,10 +533,10 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
// `absl::StatusOr<T>`. Alternatively, see the `value()` member function for a
// similar API that guarantees crashing or throwing an exception if there is
// no current value.
- const T& operator*() const&;
- T& operator*() &;
- const T&& operator*() const&&;
- T&& operator*() &&;
+ const T& operator*() const& ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ T& operator*() & ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ const T&& operator*() const&& ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ T&& operator*() && ABSL_ATTRIBUTE_LIFETIME_BOUND;
// StatusOr<T>::operator->()
//
@@ -537,8 +545,8 @@ class StatusOr : private internal_statusor::StatusOrData<T>,
// REQUIRES: `this->ok() == true`, otherwise the behavior is undefined.
//
// Use `this->ok()` to verify that there is a current value.
- const T* operator->() const;
- T* operator->();
+ const T* operator->() const ABSL_ATTRIBUTE_LIFETIME_BOUND;
+ T* operator->() ABSL_ATTRIBUTE_LIFETIME_BOUND;
// StatusOr<T>::value_or()
//
@@ -661,7 +669,9 @@ StatusOr<T>::StatusOr(absl::in_place_t, std::initializer_list<U> ilist,
: Base(absl::in_place, ilist, std::forward<Args>(args)...) {}
template <typename T>
-const Status& StatusOr<T>::status() const & { return this->status_; }
+const Status& StatusOr<T>::status() const& {
+ return this->status_;
+}
template <typename T>
Status StatusOr<T>::status() && {
return ok() ? OkStatus() : std::move(this->status_);
diff --git a/grpc/third_party/abseil-cpp/absl/status/statusor_test.cc b/grpc/third_party/abseil-cpp/absl/status/statusor_test.cc
index c2e8fb7e..7cae90e1 100644
--- a/grpc/third_party/abseil-cpp/absl/status/statusor_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/status/statusor_test.cc
@@ -17,6 +17,7 @@
#include <array>
#include <initializer_list>
#include <memory>
+#include <string>
#include <type_traits>
#include <utility>
@@ -25,6 +26,7 @@
#include "absl/base/casts.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
+#include "absl/strings/string_view.h"
#include "absl/types/any.h"
#include "absl/utility/utility.h"
@@ -34,6 +36,7 @@ using ::testing::AllOf;
using ::testing::AnyWith;
using ::testing::ElementsAre;
using ::testing::Field;
+using ::testing::HasSubstr;
using ::testing::Ne;
using ::testing::Not;
using ::testing::Pointee;
@@ -257,9 +260,9 @@ TEST(StatusOr, TestMoveOnlyInitializationFromTemporaryByValueOrDie) {
TEST(StatusOr, TestValueOrDieOverloadForConstTemporary) {
static_assert(
- std::is_same<const int&&,
- decltype(
- std::declval<const absl::StatusOr<int>&&>().value())>(),
+ std::is_same<
+ const int&&,
+ decltype(std::declval<const absl::StatusOr<int>&&>().value())>(),
"value() for const temporaries should return const T&&");
}
@@ -303,20 +306,57 @@ TEST(StatusOr, StatusCtorForwards) {
EXPECT_NE(status.message(), "Some error");
}
+TEST(BadStatusOrAccessTest, CopyConstructionWhatOk) {
+ absl::Status error =
+ absl::InternalError("some arbitrary message too big for the sso buffer");
+ absl::BadStatusOrAccess e1{error};
+ absl::BadStatusOrAccess e2{e1};
+ EXPECT_THAT(e1.what(), HasSubstr(error.ToString()));
+ EXPECT_THAT(e2.what(), HasSubstr(error.ToString()));
+}
+
+TEST(BadStatusOrAccessTest, CopyAssignmentWhatOk) {
+ absl::Status error =
+ absl::InternalError("some arbitrary message too big for the sso buffer");
+ absl::BadStatusOrAccess e1{error};
+ absl::BadStatusOrAccess e2{absl::InternalError("other")};
+ e2 = e1;
+ EXPECT_THAT(e1.what(), HasSubstr(error.ToString()));
+ EXPECT_THAT(e2.what(), HasSubstr(error.ToString()));
+}
+
+TEST(BadStatusOrAccessTest, MoveConstructionWhatOk) {
+ absl::Status error =
+ absl::InternalError("some arbitrary message too big for the sso buffer");
+ absl::BadStatusOrAccess e1{error};
+ absl::BadStatusOrAccess e2{std::move(e1)};
+ EXPECT_THAT(e2.what(), HasSubstr(error.ToString()));
+}
+
+TEST(BadStatusOrAccessTest, MoveAssignmentWhatOk) {
+ absl::Status error =
+ absl::InternalError("some arbitrary message too big for the sso buffer");
+ absl::BadStatusOrAccess e1{error};
+ absl::BadStatusOrAccess e2{absl::InternalError("other")};
+ e2 = std::move(e1);
+ EXPECT_THAT(e2.what(), HasSubstr(error.ToString()));
+}
+
// Define `EXPECT_DEATH_OR_THROW` to test the behavior of `StatusOr::value`,
// which either throws `BadStatusOrAccess` or `LOG(FATAL)` based on whether
// exceptions are enabled.
#ifdef ABSL_HAVE_EXCEPTIONS
-#define EXPECT_DEATH_OR_THROW(statement, status_) \
- EXPECT_THROW( \
- { \
- try { \
- statement; \
- } catch (const absl::BadStatusOrAccess& e) { \
- EXPECT_EQ(e.status(), status_); \
- throw; \
- } \
- }, \
+#define EXPECT_DEATH_OR_THROW(statement, status_) \
+ EXPECT_THROW( \
+ { \
+ try { \
+ statement; \
+ } catch (const absl::BadStatusOrAccess& e) { \
+ EXPECT_EQ(e.status(), status_); \
+ EXPECT_THAT(e.what(), HasSubstr(e.status().ToString())); \
+ throw; \
+ } \
+ }, \
absl::BadStatusOrAccess);
#else // ABSL_HAVE_EXCEPTIONS
#define EXPECT_DEATH_OR_THROW(statement, status) \
@@ -412,8 +452,6 @@ TEST(StatusOr, TestStatusCtor) {
EXPECT_EQ(thing.status().code(), absl::StatusCode::kCancelled);
}
-
-
TEST(StatusOr, TestValueCtor) {
const int kI = 4;
const absl::StatusOr<int> thing(kI);
@@ -1300,8 +1338,6 @@ TEST(StatusOr, TestPointerDefaultCtor) {
EXPECT_EQ(thing.status().code(), absl::StatusCode::kUnknown);
}
-
-
TEST(StatusOr, TestPointerStatusCtor) {
absl::StatusOr<int*> thing(absl::CancelledError());
EXPECT_FALSE(thing.ok());
diff --git a/grpc/third_party/abseil-cpp/absl/strings/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/strings/BUILD.bazel
index 123b5efb..090fc58a 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/strings/BUILD.bazel
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -269,10 +268,18 @@ cc_library(
name = "cord_internal",
srcs = [
"internal/cord_internal.cc",
+ "internal/cord_rep_btree.cc",
+ "internal/cord_rep_btree_navigator.cc",
+ "internal/cord_rep_btree_reader.cc",
+ "internal/cord_rep_consume.cc",
"internal/cord_rep_ring.cc",
],
hdrs = [
"internal/cord_internal.h",
+ "internal/cord_rep_btree.h",
+ "internal/cord_rep_btree_navigator.h",
+ "internal/cord_rep_btree_reader.h",
+ "internal/cord_rep_consume.h",
"internal/cord_rep_flat.h",
"internal/cord_rep_ring.h",
"internal/cord_rep_ring_reader.h",
@@ -292,7 +299,92 @@ cc_library(
"//absl/container:compressed_tuple",
"//absl/container:inlined_vector",
"//absl/container:layout",
+ "//absl/functional:function_ref",
"//absl/meta:type_traits",
+ "//absl/types:span",
+ ],
+)
+
+cc_test(
+ name = "cord_internal_test",
+ srcs = ["internal/cord_internal_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord_internal",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cord_rep_btree_test",
+ size = "medium",
+ srcs = ["internal/cord_rep_btree_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord_internal",
+ ":cord_rep_test_util",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:raw_logging_internal",
+ "//absl/cleanup",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cord_rep_btree_navigator_test",
+ size = "medium",
+ srcs = ["internal/cord_rep_btree_navigator_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord_internal",
+ ":cord_rep_test_util",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:raw_logging_internal",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cord_rep_btree_reader_test",
+ size = "medium",
+ srcs = ["internal/cord_rep_btree_reader_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord",
+ ":cord_internal",
+ ":cord_rep_test_util",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:raw_logging_internal",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_library(
+ name = "cordz_update_tracker",
+ hdrs = ["internal/cordz_update_tracker.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = ["//absl/base:config"],
+)
+
+cc_test(
+ name = "cordz_update_tracker_test",
+ srcs = ["internal/cordz_update_tracker_test.cc"],
+ deps = [
+ ":cordz_update_tracker",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/synchronization",
+ "@com_google_googletest//:gtest_main",
],
)
@@ -307,10 +399,16 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
deps = [
":cord_internal",
+ ":cordz_functions",
+ ":cordz_info",
+ ":cordz_statistics",
+ ":cordz_update_scope",
+ ":cordz_update_tracker",
":internal",
":str_format",
":strings",
"//absl/base",
+ "//absl/base:config",
"//absl/base:core_headers",
"//absl/base:endian",
"//absl/base:raw_logging_internal",
@@ -323,6 +421,215 @@ cc_library(
)
cc_library(
+ name = "cordz_handle",
+ srcs = ["internal/cordz_handle.cc"],
+ hdrs = ["internal/cordz_handle.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ "//absl/base",
+ "//absl/base:config",
+ "//absl/base:raw_logging_internal",
+ "//absl/synchronization",
+ ],
+)
+
+cc_library(
+ name = "cordz_info",
+ srcs = ["internal/cordz_info.cc"],
+ hdrs = ["internal/cordz_info.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ ":cord_internal",
+ ":cordz_functions",
+ ":cordz_handle",
+ ":cordz_statistics",
+ ":cordz_update_tracker",
+ "//absl/base",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ "//absl/container:inlined_vector",
+ "//absl/debugging:stacktrace",
+ "//absl/synchronization",
+ "//absl/types:span",
+ ],
+)
+
+cc_library(
+ name = "cordz_update_scope",
+ hdrs = ["internal/cordz_update_scope.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ ":cord_internal",
+ ":cordz_info",
+ ":cordz_update_tracker",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ ],
+)
+
+cc_test(
+ name = "cordz_update_scope_test",
+ srcs = ["internal/cordz_update_scope_test.cc"],
+ copts = ABSL_DEFAULT_COPTS,
+ deps = [
+ ":cord_internal",
+ ":cordz_info",
+ ":cordz_test_helpers",
+ ":cordz_update_scope",
+ ":cordz_update_tracker",
+ "//absl/base:config",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_library(
+ name = "cordz_sample_token",
+ srcs = ["internal/cordz_sample_token.cc"],
+ hdrs = ["internal/cordz_sample_token.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ ":cordz_handle",
+ ":cordz_info",
+ "//absl/base:config",
+ ],
+)
+
+cc_library(
+ name = "cordz_functions",
+ srcs = ["internal/cordz_functions.cc"],
+ hdrs = ["internal/cordz_functions.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ "//absl/profiling:exponential_biased",
+ ],
+)
+
+cc_library(
+ name = "cordz_statistics",
+ hdrs = ["internal/cordz_statistics.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+ deps = [
+ ":cordz_update_tracker",
+ "//absl/base:config",
+ ],
+)
+
+cc_test(
+ name = "cordz_functions_test",
+ srcs = [
+ "internal/cordz_functions_test.cc",
+ ],
+ deps = [
+ ":cordz_functions",
+ ":cordz_test_helpers",
+ "//absl/base:config",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cordz_handle_test",
+ srcs = [
+ "internal/cordz_handle_test.cc",
+ ],
+ deps = [
+ ":cordz_handle",
+ "//absl/base:config",
+ "//absl/memory",
+ "//absl/random",
+ "//absl/random:distributions",
+ "//absl/synchronization",
+ "//absl/synchronization:thread_pool",
+ "//absl/time",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cordz_info_test",
+ srcs = [
+ "internal/cordz_info_test.cc",
+ ],
+ deps = [
+ ":cord_internal",
+ ":cordz_handle",
+ ":cordz_info",
+ ":cordz_statistics",
+ ":cordz_test_helpers",
+ ":cordz_update_tracker",
+ ":strings",
+ "//absl/base:config",
+ "//absl/debugging:stacktrace",
+ "//absl/debugging:symbolize",
+ "//absl/types:span",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cordz_info_statistics_test",
+ srcs = [
+ "internal/cordz_info_statistics_test.cc",
+ ],
+ deps = [
+ ":cord",
+ ":cord_internal",
+ ":cordz_info",
+ ":cordz_sample_token",
+ ":cordz_statistics",
+ ":cordz_update_scope",
+ ":cordz_update_tracker",
+ "//absl/base:config",
+ "//absl/synchronization",
+ "//absl/synchronization:thread_pool",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cordz_sample_token_test",
+ srcs = [
+ "internal/cordz_sample_token_test.cc",
+ ],
+ deps = [
+ ":cord_internal",
+ ":cordz_handle",
+ ":cordz_info",
+ ":cordz_sample_token",
+ ":cordz_test_helpers",
+ "//absl/base:config",
+ "//absl/memory",
+ "//absl/random",
+ "//absl/synchronization",
+ "//absl/synchronization:thread_pool",
+ "//absl/time",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_library(
name = "cord_test_helpers",
testonly = 1,
hdrs = [
@@ -331,6 +638,41 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
deps = [
":cord",
+ ":cord_internal",
+ ":strings",
+ "//absl/base:config",
+ ],
+)
+
+cc_library(
+ name = "cord_rep_test_util",
+ testonly = 1,
+ hdrs = ["internal/cord_rep_test_util.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ deps = [
+ ":cord_internal",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:raw_logging_internal",
+ ],
+)
+
+cc_library(
+ name = "cordz_test_helpers",
+ testonly = 1,
+ hdrs = ["cordz_test_helpers.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ deps = [
+ ":cord",
+ ":cord_internal",
+ ":cordz_info",
+ ":cordz_sample_token",
+ ":cordz_statistics",
+ ":cordz_update_tracker",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "@com_google_googletest//:gtest",
],
)
@@ -343,6 +685,8 @@ cc_test(
deps = [
":cord",
":cord_test_helpers",
+ ":cordz_functions",
+ ":cordz_test_helpers",
":str_format",
":strings",
"//absl/base",
@@ -351,6 +695,56 @@ cc_test(
"//absl/base:endian",
"//absl/base:raw_logging_internal",
"//absl/container:fixed_array",
+ "//absl/random",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cordz_test",
+ size = "medium",
+ srcs = ["cordz_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ tags = [
+ "benchmark",
+ "no_test_android_arm",
+ "no_test_android_arm64",
+ "no_test_android_x86",
+ "no_test_darwin_x86_64",
+ "no_test_ios_x86_64",
+ "no_test_loonix",
+ "no_test_msvc_x64",
+ ],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord",
+ ":cord_test_helpers",
+ ":cordz_functions",
+ ":cordz_info",
+ ":cordz_sample_token",
+ ":cordz_statistics",
+ ":cordz_test_helpers",
+ ":cordz_update_tracker",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/base:raw_logging_internal",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "cord_rep_consume_test",
+ size = "medium",
+ srcs = ["internal/cord_rep_consume_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ ":cord_internal",
+ ":strings",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/debugging:leak_check",
"@com_google_googletest//:gtest_main",
],
)
@@ -434,6 +828,7 @@ cc_test(
":strings",
"//absl/base:core_headers",
"//absl/base:dynamic_annotations",
+ "//absl/container:btree",
"//absl/container:flat_hash_map",
"//absl/container:node_hash_map",
"@com_google_googletest//:gtest_main",
diff --git a/grpc/third_party/abseil-cpp/absl/strings/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/strings/CMakeLists.txt
index 3b7ae639..d6801fe6 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/strings/CMakeLists.txt
@@ -101,7 +101,7 @@ absl_cc_test(
DEPS
absl::strings
absl::base
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -115,7 +115,7 @@ absl_cc_test(
absl::strings
absl::core_headers
absl::fixed_array
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -128,7 +128,7 @@ absl_cc_test(
DEPS
absl::strings
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -142,7 +142,7 @@ absl_cc_test(
DEPS
absl::strings
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -156,7 +156,7 @@ absl_cc_test(
absl::strings_internal
absl::base
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -169,7 +169,7 @@ absl_cc_test(
DEPS
absl::strings
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -184,7 +184,7 @@ absl_cc_test(
absl::config
absl::core_headers
absl::dynamic_annotations
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -197,7 +197,7 @@ absl_cc_test(
DEPS
absl::strings
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -209,7 +209,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -221,12 +221,12 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::strings
- absl::base
absl::core_headers
absl::dynamic_annotations
+ absl::btree
absl::flat_hash_map
absl::node_hash_map
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -238,7 +238,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::strings_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -253,7 +253,7 @@ absl_cc_test(
absl::base
absl::core_headers
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -268,7 +268,7 @@ absl_cc_test(
absl::base
absl::core_headers
absl::memory
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -281,7 +281,7 @@ absl_cc_test(
DEPS
absl::strings
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -301,7 +301,7 @@ absl_cc_test(
absl::random_random
absl::random_distributions
absl::strings_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -314,7 +314,7 @@ absl_cc_test(
DEPS
absl::strings
absl::base
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -326,7 +326,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::strings_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -340,7 +340,7 @@ absl_cc_test(
absl::strings
absl::str_format
absl::pow10_helper
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -355,7 +355,7 @@ absl_cc_test(
absl::strings
absl::config
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -370,7 +370,7 @@ absl_cc_test(
DEPS
absl::strings
absl::config
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -428,7 +428,7 @@ absl_cc_test(
absl::cord
absl::strings
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -442,7 +442,7 @@ absl_cc_test(
absl::str_format
absl::str_format_internal
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -455,7 +455,7 @@ absl_cc_test(
DEPS
absl::str_format
absl::str_format_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -467,7 +467,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::str_format_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -479,7 +479,7 @@ absl_cc_test(
${ABSL_TEST_COPTS}
DEPS
absl::str_format
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -494,7 +494,7 @@ absl_cc_test(
absl::str_format_internal
absl::raw_logging_internal
absl::int128
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -507,7 +507,7 @@ absl_cc_test(
DEPS
absl::str_format_internal
absl::cord
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -520,7 +520,7 @@ absl_cc_test(
DEPS
absl::str_format_internal
absl::core_headers
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -547,52 +547,359 @@ absl_cc_test(
DEPS
absl::pow10_helper
absl::str_format
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
NAME
- cord
+ cord_internal
HDRS
- "cord.h"
- SRCS
- "cord.cc"
- "internal/cord_internal.cc"
"internal/cord_internal.h"
+ "internal/cord_rep_btree.h"
+ "internal/cord_rep_btree_navigator.h"
+ "internal/cord_rep_btree_reader.h"
+ "internal/cord_rep_consume.h"
+ "internal/cord_rep_flat.h"
"internal/cord_rep_ring.h"
- "internal/cord_rep_ring.cc"
"internal/cord_rep_ring_reader.h"
- "internal/cord_rep_flat.h"
+ SRCS
+ "internal/cord_internal.cc"
+ "internal/cord_rep_btree.cc"
+ "internal/cord_rep_btree_navigator.cc"
+ "internal/cord_rep_btree_reader.cc"
+ "internal/cord_rep_consume.cc"
+ "internal/cord_rep_ring.cc"
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
- absl::base
absl::base_internal
absl::compressed_tuple
absl::config
absl::core_headers
absl::endian
+ absl::inlined_vector
+ absl::layout
+ absl::raw_logging_internal
+ absl::strings
+ absl::throw_delegate
+ absl::type_traits
+)
+
+absl_cc_library(
+ NAME
+ cordz_update_tracker
+ HDRS
+ "internal/cordz_update_tracker.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+)
+
+absl_cc_test(
+ NAME
+ cordz_update_tracker_test
+ SRCS
+ "internal/cordz_update_tracker_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cordz_update_tracker
+ absl::core_headers
+ absl::synchronization
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cordz_functions
+ HDRS
+ "internal/cordz_functions.h"
+ SRCS
+ "internal/cordz_functions.cc"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+ absl::core_headers
+ absl::exponential_biased
+ absl::raw_logging_internal
+)
+
+absl_cc_test(
+ NAME
+ cordz_functions_test
+ SRCS
+ "internal/cordz_functions_test.cc"
+ DEPS
+ absl::config
+ absl::cordz_functions
+ absl::cordz_test_helpers
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cordz_statistics
+ HDRS
+ "internal/cordz_statistics.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+ absl::core_headers
+ absl::cordz_update_tracker
+ absl::synchronization
+)
+
+absl_cc_library(
+ NAME
+ cordz_handle
+ HDRS
+ "internal/cordz_handle.h"
+ SRCS
+ "internal/cordz_handle.cc"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::base
+ absl::config
+ absl::raw_logging_internal
+ absl::synchronization
+)
+
+absl_cc_test(
+ NAME
+ cordz_handle_test
+ SRCS
+ "internal/cordz_handle_test.cc"
+ DEPS
+ absl::config
+ absl::cordz_handle
+ absl::cordz_test_helpers
+ absl::memory
+ absl::random_random
+ absl::random_distributions
+ absl::synchronization
+ absl::time
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cordz_info
+ HDRS
+ "internal/cordz_info.h"
+ SRCS
+ "internal/cordz_info.cc"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::base
+ absl::config
+ absl::cord_internal
+ absl::cordz_functions
+ absl::cordz_handle
+ absl::cordz_statistics
+ absl::cordz_update_tracker
+ absl::core_headers
+ absl::inlined_vector
+ absl::span
+ absl::raw_logging_internal
+ absl::stacktrace
+ absl::synchronization
+)
+
+absl_cc_test(
+ NAME
+ cordz_info_test
+ SRCS
+ "internal/cordz_info_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cord_internal
+ absl::cordz_test_helpers
+ absl::cordz_handle
+ absl::cordz_info
+ absl::cordz_statistics
+ absl::cordz_test_helpers
+ absl::cordz_update_tracker
+ absl::span
+ absl::stacktrace
+ absl::symbolize
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cordz_info_statistics_test
+ SRCS
+ "internal/cordz_info_statistics_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cord
+ absl::cord_internal
+ absl::cordz_info
+ absl::cordz_sample_token
+ absl::cordz_statistics
+ absl::cordz_update_scope
+ absl::cordz_update_tracker
+ absl::thread_pool
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cordz_sample_token
+ HDRS
+ "internal/cordz_sample_token.h"
+ SRCS
+ "internal/cordz_sample_token.cc"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+ absl::cordz_handle
+ absl::cordz_info
+)
+
+absl_cc_test(
+ NAME
+ cordz_sample_token_test
+ SRCS
+ "internal/cordz_sample_token_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cord_internal
+ absl::cordz_handle
+ absl::cordz_info
+ absl::cordz_info
+ absl::cordz_sample_token
+ absl::cordz_test_helpers
+ absl::memory
+ absl::random_random
+ absl::synchronization
+ absl::thread_pool
+ absl::time
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cordz_update_scope
+ HDRS
+ "internal/cordz_update_scope.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
+ absl::cord_internal
+ absl::cordz_info
+ absl::cordz_update_tracker
+ absl::core_headers
+)
+
+absl_cc_test(
+ NAME
+ cordz_update_scope_test
+ SRCS
+ "internal/cordz_update_scope_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cord_internal
+ absl::cordz_info
+ absl::cordz_test_helpers
+ absl::cordz_update_scope
+ absl::cordz_update_tracker
+ absl::core_headers
+ GTest::gmock_main
+)
+
+absl_cc_library(
+ NAME
+ cord
+ HDRS
+ "cord.h"
+ SRCS
+ "cord.cc"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::base
+ absl::config
+ absl::cord_internal
+ absl::cordz_functions
+ absl::cordz_info
+ absl::cordz_update_scope
+ absl::cordz_update_tracker
+ absl::core_headers
+ absl::endian
absl::fixed_array
absl::function_ref
absl::inlined_vector
absl::optional
absl::raw_logging_internal
absl::strings
- absl::strings_internal
- absl::throw_delegate
absl::type_traits
PUBLIC
)
absl_cc_library(
NAME
+ cord_rep_test_util
+ HDRS
+ "internal/cord_rep_test_util.h"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
+ absl::cord_internal
+ absl::raw_logging_internal
+ absl::strings
+ TESTONLY
+)
+
+absl_cc_library(
+ NAME
cord_test_helpers
HDRS
"cord_test_helpers.h"
COPTS
${ABSL_TEST_COPTS}
DEPS
+ absl::config
+ absl::cord
+ absl::cord_internal
+ absl::strings
+ TESTONLY
+)
+
+absl_cc_library(
+ NAME
+ cordz_test_helpers
+ HDRS
+ "cordz_test_helpers.h"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::config
absl::cord
+ absl::cord_internal
+ absl::cordz_info
+ absl::cordz_sample_token
+ absl::cordz_statistics
+ absl::cordz_update_tracker
+ absl::core_headers
+ absl::strings
TESTONLY
)
@@ -609,28 +916,116 @@ absl_cc_test(
absl::strings
absl::base
absl::config
+ absl::cord_test_helpers
+ absl::cordz_test_helpers
absl::core_headers
absl::endian
+ absl::random_random
absl::raw_logging_internal
absl::fixed_array
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
NAME
- cord_ring_test
+ cord_rep_consume_test
SRCS
- "cord_ring_test.cc"
+ "internal/cord_rep_consume_test.cc"
COPTS
${ABSL_TEST_COPTS}
DEPS
+ absl::base
absl::config
- absl::cord
+ absl::cord_internal
+ absl::core_headers
+ absl::function_ref
+ absl::raw_logging_internal
absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cord_internal_test
+ SRCS
+ "internal/cord_internal_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::cord_internal
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cord_rep_btree_test
+ SRCS
+ "internal/cord_rep_btree_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::base
+ absl::cleanup
+ absl::config
+ absl::cord_internal
+ absl::cord_rep_test_util
+ absl::core_headers
+ absl::raw_logging_internal
+ absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cord_rep_btree_navigator_test
+ SRCS
+ "internal/cord_rep_btree_navigator_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::base
+ absl::config
+ absl::cord_internal
+ absl::cord_rep_test_util
+ absl::core_headers
+ absl::raw_logging_internal
+ absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cord_rep_btree_reader_test
+ SRCS
+ "internal/cord_rep_btree_reader_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::base
+ absl::config
+ absl::cord_internal
+ absl::cord_rep_test_util
+ absl::core_headers
+ absl::raw_logging_internal
+ absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cord_ring_test
+ SRCS
+ "cord_ring_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
absl::base
+ absl::config
+ absl::cord_internal
absl::core_headers
absl::raw_logging_internal
- gmock_main
+ absl::strings
+ GTest::gmock_main
)
absl_cc_test(
@@ -641,9 +1036,33 @@ absl_cc_test(
COPTS
${ABSL_TEST_COPTS}
DEPS
- absl::cord
+ absl::base
+ absl::cord_internal
+ absl::core_headers
absl::strings
+ GTest::gmock_main
+)
+
+absl_cc_test(
+ NAME
+ cordz_test
+ SRCS
+ "cordz_test.cc"
+ COPTS
+ ${ABSL_TEST_COPTS}
+ DEPS
+ absl::cord
+ absl::cord_test_helpers
+ absl::cordz_test_helpers
+ absl::cordz_functions
+ absl::cordz_info
+ absl::cordz_sample_token
+ absl::cordz_statistics
+ absl::cordz_update_tracker
absl::base
+ absl::config
absl::core_headers
- gmock_main
+ absl::raw_logging_internal
+ absl::strings
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/strings/charconv.cc b/grpc/third_party/abseil-cpp/absl/strings/charconv.cc
index b8674c28..fefcfc90 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/charconv.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/charconv.cc
@@ -111,7 +111,7 @@ struct FloatTraits<double> {
return sign ? -ldexp(mantissa, exponent) : ldexp(mantissa, exponent);
#else
constexpr uint64_t kMantissaMask =
- (uint64_t(1) << (kTargetMantissaBits - 1)) - 1;
+ (uint64_t{1} << (kTargetMantissaBits - 1)) - 1;
uint64_t dbl = static_cast<uint64_t>(sign) << 63;
if (mantissa > kMantissaMask) {
// Normal value.
@@ -151,7 +151,7 @@ struct FloatTraits<float> {
return sign ? -ldexpf(mantissa, exponent) : ldexpf(mantissa, exponent);
#else
constexpr uint32_t kMantissaMask =
- (uint32_t(1) << (kTargetMantissaBits - 1)) - 1;
+ (uint32_t{1} << (kTargetMantissaBits - 1)) - 1;
uint32_t flt = static_cast<uint32_t>(sign) << 31;
if (mantissa > kMantissaMask) {
// Normal value.
@@ -499,7 +499,7 @@ bool MustRoundUp(uint64_t guess_mantissa, int guess_exponent,
template <typename FloatType>
CalculatedFloat CalculatedFloatFromRawValues(uint64_t mantissa, int exponent) {
CalculatedFloat result;
- if (mantissa == uint64_t(1) << FloatTraits<FloatType>::kTargetMantissaBits) {
+ if (mantissa == uint64_t{1} << FloatTraits<FloatType>::kTargetMantissaBits) {
mantissa >>= 1;
exponent += 1;
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/charconv.h b/grpc/third_party/abseil-cpp/absl/strings/charconv.h
index e04be32f..7c509812 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/charconv.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/charconv.h
@@ -64,8 +64,9 @@ struct from_chars_result {
// the result in `value`.
//
// The matching pattern format is almost the same as that of strtod(), except
-// that C locale is not respected, and an initial '+' character in the input
-// range will never be matched.
+// that (1) C locale is not respected, (2) an initial '+' character in the
+// input range will never be matched, and (3) leading whitespaces are not
+// ignored.
//
// If `fmt` is set, it must be one of the enumerator values of the chars_format.
// (This is despite the fact that chars_format is a bitmask type.) If set to
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord.cc b/grpc/third_party/abseil-cpp/absl/strings/cord.cc
index 93533757..854047ca 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord.cc
@@ -36,8 +36,11 @@
#include "absl/container/inlined_vector.h"
#include "absl/strings/escaping.h"
#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
#include "absl/strings/internal/cord_rep_flat.h"
-#include "absl/strings/internal/cord_rep_ring.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_scope.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/strings/internal/resize_uninitialized.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@@ -48,19 +51,15 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
using ::absl::cord_internal::CordRep;
+using ::absl::cord_internal::CordRepBtree;
using ::absl::cord_internal::CordRepConcat;
using ::absl::cord_internal::CordRepExternal;
using ::absl::cord_internal::CordRepFlat;
-using ::absl::cord_internal::CordRepRing;
using ::absl::cord_internal::CordRepSubstring;
-using ::absl::cord_internal::kMinFlatLength;
+using ::absl::cord_internal::CordzUpdateTracker;
+using ::absl::cord_internal::InlineData;
using ::absl::cord_internal::kMaxFlatLength;
-
-using ::absl::cord_internal::CONCAT;
-using ::absl::cord_internal::EXTERNAL;
-using ::absl::cord_internal::FLAT;
-using ::absl::cord_internal::RING;
-using ::absl::cord_internal::SUBSTRING;
+using ::absl::cord_internal::kMinFlatLength;
using ::absl::cord_internal::kInlinedVectorSize;
using ::absl::cord_internal::kMaxBytesToCopy;
@@ -95,13 +94,13 @@ static constexpr uint64_t min_length[] = {
static const int kMinLengthSize = ABSL_ARRAYSIZE(min_length);
-static inline bool cord_ring_enabled() {
- return cord_internal::cord_ring_buffer_enabled.load(
+static inline bool btree_enabled() {
+ return cord_internal::cord_btree_enabled.load(
std::memory_order_relaxed);
}
static inline bool IsRootBalanced(CordRep* node) {
- if (node->tag != CONCAT) {
+ if (!node->IsConcat()) {
return true;
} else if (node->concat()->depth() <= 15) {
return true;
@@ -138,7 +137,7 @@ static inline CordRep* VerifyTree(CordRep* node) {
// Return the depth of a node
static int Depth(const CordRep* rep) {
- if (rep->tag == CONCAT) {
+ if (rep->IsConcat()) {
return rep->concat()->depth();
} else {
return 0;
@@ -171,7 +170,7 @@ static CordRep* RawConcat(CordRep* left, CordRep* right) {
}
CordRepConcat* rep = new CordRepConcat();
- rep->tag = CONCAT;
+ rep->tag = cord_internal::CONCAT;
SetConcatChildren(rep, left, right);
return rep;
@@ -206,36 +205,32 @@ static CordRep* MakeBalancedTree(CordRep** reps, size_t n) {
}
static CordRepFlat* CreateFlat(const char* data, size_t length,
- size_t alloc_hint) {
+ size_t alloc_hint) {
CordRepFlat* flat = CordRepFlat::New(length + alloc_hint);
flat->length = length;
memcpy(flat->Data(), data, length);
return flat;
}
-// Creates a new flat or ringbuffer out of the specified array.
+// Creates a new flat or Btree out of the specified array.
// The returned node has a refcount of 1.
-static CordRep* RingNewTree(const char* data, size_t length,
- size_t alloc_hint) {
+static CordRep* NewBtree(const char* data, size_t length, size_t alloc_hint) {
if (length <= kMaxFlatLength) {
return CreateFlat(data, length, alloc_hint);
}
CordRepFlat* flat = CreateFlat(data, kMaxFlatLength, 0);
data += kMaxFlatLength;
length -= kMaxFlatLength;
- size_t extra = (length - 1) / kMaxFlatLength + 1;
- auto* root = CordRepRing::Create(flat, extra);
- return CordRepRing::Append(root, {data, length}, alloc_hint);
+ auto* root = CordRepBtree::Create(flat);
+ return CordRepBtree::Append(root, {data, length}, alloc_hint);
}
// Create a new tree out of the specified array.
// The returned node has a refcount of 1.
-static CordRep* NewTree(const char* data,
- size_t length,
- size_t alloc_hint) {
+static CordRep* NewTree(const char* data, size_t length, size_t alloc_hint) {
if (length == 0) return nullptr;
- if (cord_ring_enabled()) {
- return RingNewTree(data, length, alloc_hint);
+ if (btree_enabled()) {
+ return NewBtree(data, length, alloc_hint);
}
absl::FixedArray<CordRep*> reps((length - 1) / kMaxFlatLength + 1);
size_t n = 0;
@@ -272,13 +267,42 @@ static CordRep* NewSubstring(CordRep* child, size_t offset, size_t length) {
CordRepSubstring* rep = new CordRepSubstring();
assert((offset + length) <= child->length);
rep->length = length;
- rep->tag = SUBSTRING;
+ rep->tag = cord_internal::SUBSTRING;
rep->start = offset;
rep->child = child;
return VerifyTree(rep);
}
}
+// Creates a CordRep from the provided string. If the string is large enough,
+// and not wasteful, we move the string into an external cord rep, preserving
+// the already allocated string contents.
+// Requires the provided string length to be larger than `kMaxInline`.
+static CordRep* CordRepFromString(std::string&& src) {
+ assert(src.length() > cord_internal::kMaxInline);
+ if (
+ // String is short: copy data to avoid external block overhead.
+ src.size() <= kMaxBytesToCopy ||
+ // String is wasteful: copy data to avoid pinning too much unused memory.
+ src.size() < src.capacity() / 2
+ ) {
+ return NewTree(src.data(), src.size(), 0);
+ }
+
+ struct StringReleaser {
+ void operator()(absl::string_view /* data */) {}
+ std::string data;
+ };
+ const absl::string_view original_data = src;
+ auto* rep =
+ static_cast<::absl::cord_internal::CordRepExternalImpl<StringReleaser>*>(
+ absl::cord_internal::NewExternalRep(original_data,
+ StringReleaser{std::move(src)}));
+ // Moving src may have invalidated its data pointer, so adjust it.
+ rep->base = rep->template get<0>().data.data();
+ return rep;
+}
+
// --------------------------------------------------------------------
// Cord::InlineRep functions
@@ -299,20 +323,6 @@ inline char* Cord::InlineRep::set_data(size_t n) {
return data_.as_chars();
}
-inline CordRep* Cord::InlineRep::force_tree(size_t extra_hint) {
- if (data_.is_tree()) {
- return data_.as_tree();
- }
-
- size_t len = inline_size();
- CordRepFlat* result = CordRepFlat::New(len + extra_hint);
- result->length = len;
- static_assert(kMinFlatLength >= sizeof(data_), "");
- memcpy(result->Data(), data_.as_chars(), sizeof(data_));
- set_tree(result);
- return result;
-}
-
inline void Cord::InlineRep::reduce_size(size_t n) {
size_t tag = inline_size();
assert(tag <= kMaxInline);
@@ -328,31 +338,78 @@ inline void Cord::InlineRep::remove_prefix(size_t n) {
reduce_size(n);
}
-// Returns `rep` converted into a CordRepRing.
-// Directly returns `rep` if `rep` is already a CordRepRing.
-static CordRepRing* ForceRing(CordRep* rep, size_t extra) {
- return (rep->tag == RING) ? rep->ring() : CordRepRing::Create(rep, extra);
+// Returns `rep` converted into a CordRepBtree.
+// Directly returns `rep` if `rep` is already a CordRepBtree.
+static CordRepBtree* ForceBtree(CordRep* rep) {
+ return rep->IsBtree() ? rep->btree() : CordRepBtree::Create(rep);
}
-void Cord::InlineRep::AppendTree(CordRep* tree) {
+void Cord::InlineRep::AppendTreeToInlined(CordRep* tree,
+ MethodIdentifier method) {
+ assert(!is_tree());
+ if (!data_.is_empty()) {
+ CordRepFlat* flat = MakeFlatWithExtraCapacity(0);
+ if (btree_enabled()) {
+ tree = CordRepBtree::Append(CordRepBtree::Create(flat), tree);
+ } else {
+ tree = Concat(flat, tree);
+ }
+ }
+ EmplaceTree(tree, method);
+}
+
+void Cord::InlineRep::AppendTreeToTree(CordRep* tree, MethodIdentifier method) {
+ assert(is_tree());
+ const CordzUpdateScope scope(data_.cordz_info(), method);
+ if (btree_enabled()) {
+ tree = CordRepBtree::Append(ForceBtree(data_.as_tree()), tree);
+ } else {
+ tree = Concat(data_.as_tree(), tree);
+ }
+ SetTree(tree, scope);
+}
+
+void Cord::InlineRep::AppendTree(CordRep* tree, MethodIdentifier method) {
if (tree == nullptr) return;
- if (data_.is_empty()) {
- set_tree(tree);
- } else if (cord_ring_enabled()) {
- set_tree(CordRepRing::Append(ForceRing(force_tree(0), 1), tree));
+ if (data_.is_tree()) {
+ AppendTreeToTree(tree, method);
} else {
- set_tree(Concat(force_tree(0), tree));
+ AppendTreeToInlined(tree, method);
+ }
+}
+
+void Cord::InlineRep::PrependTreeToInlined(CordRep* tree,
+ MethodIdentifier method) {
+ assert(!is_tree());
+ if (!data_.is_empty()) {
+ CordRepFlat* flat = MakeFlatWithExtraCapacity(0);
+ if (btree_enabled()) {
+ tree = CordRepBtree::Prepend(CordRepBtree::Create(flat), tree);
+ } else {
+ tree = Concat(tree, flat);
+ }
}
+ EmplaceTree(tree, method);
}
-void Cord::InlineRep::PrependTree(CordRep* tree) {
+void Cord::InlineRep::PrependTreeToTree(CordRep* tree,
+ MethodIdentifier method) {
+ assert(is_tree());
+ const CordzUpdateScope scope(data_.cordz_info(), method);
+ if (btree_enabled()) {
+ tree = CordRepBtree::Prepend(ForceBtree(data_.as_tree()), tree);
+ } else {
+ tree = Concat(tree, data_.as_tree());
+ }
+ SetTree(tree, scope);
+}
+
+void Cord::InlineRep::PrependTree(CordRep* tree, MethodIdentifier method) {
assert(tree != nullptr);
- if (data_.is_empty()) {
- set_tree(tree);
- } else if (cord_ring_enabled()) {
- set_tree(CordRepRing::Prepend(ForceRing(force_tree(0), 1), tree));
+ if (data_.is_tree()) {
+ PrependTreeToTree(tree, method);
} else {
- set_tree(Concat(tree, force_tree(0)));
+ PrependTreeToInlined(tree, method);
}
}
@@ -362,8 +419,8 @@ void Cord::InlineRep::PrependTree(CordRep* tree) {
// written to region and the actual size increase will be written to size.
static inline bool PrepareAppendRegion(CordRep* root, char** region,
size_t* size, size_t max_length) {
- if (root->tag == RING && root->refcount.IsOne()) {
- Span<char> span = root->ring()->GetAppendBuffer(max_length);
+ if (root->IsBtree() && root->refcount.IsMutable()) {
+ Span<char> span = root->btree()->GetAppendBuffer(max_length);
if (!span.empty()) {
*region = span.data();
*size = span.size();
@@ -373,11 +430,11 @@ static inline bool PrepareAppendRegion(CordRep* root, char** region,
// Search down the right-hand path for a non-full FLAT node.
CordRep* dst = root;
- while (dst->tag == CONCAT && dst->refcount.IsOne()) {
+ while (dst->IsConcat() && dst->refcount.IsMutable()) {
dst = dst->concat()->right;
}
- if (dst->tag < FLAT || !dst->refcount.IsOne()) {
+ if (!dst->IsFlat() || !dst->refcount.IsMutable()) {
*region = nullptr;
*size = 0;
return false;
@@ -404,148 +461,140 @@ static inline bool PrepareAppendRegion(CordRep* root, char** region,
return true;
}
+template <bool has_length>
void Cord::InlineRep::GetAppendRegion(char** region, size_t* size,
- size_t max_length) {
- if (max_length == 0) {
- *region = nullptr;
- *size = 0;
- return;
- }
-
- // Try to fit in the inline buffer if possible.
- if (!is_tree()) {
- size_t inline_length = inline_size();
- if (max_length <= kMaxInline - inline_length) {
- *region = data_.as_chars() + inline_length;
- *size = max_length;
- set_inline_size(inline_length + max_length);
+ size_t length) {
+ auto constexpr method = CordzUpdateTracker::kGetAppendRegion;
+
+ CordRep* root = tree();
+ size_t sz = root ? root->length : inline_size();
+ if (root == nullptr) {
+ size_t available = kMaxInline - sz;
+ if (available >= (has_length ? length : 1)) {
+ *region = data_.as_chars() + sz;
+ *size = has_length ? length : available;
+ set_inline_size(has_length ? sz + length : kMaxInline);
return;
}
}
- CordRep* root = force_tree(max_length);
-
- if (PrepareAppendRegion(root, region, size, max_length)) {
+ size_t extra = has_length ? length : (std::max)(sz, kMinFlatLength);
+ CordRep* rep = root ? root : MakeFlatWithExtraCapacity(extra);
+ CordzUpdateScope scope(root ? data_.cordz_info() : nullptr, method);
+ if (PrepareAppendRegion(rep, region, size, length)) {
+ CommitTree(root, rep, scope, method);
return;
}
// Allocate new node.
- CordRepFlat* new_node =
- CordRepFlat::New(std::max(static_cast<size_t>(root->length), max_length));
- new_node->length = std::min(new_node->Capacity(), max_length);
+ CordRepFlat* new_node = CordRepFlat::New(extra);
+ new_node->length = std::min(new_node->Capacity(), length);
*region = new_node->Data();
*size = new_node->length;
- if (cord_ring_enabled()) {
- replace_tree(CordRepRing::Append(ForceRing(root, 1), new_node));
- return;
+ if (btree_enabled()) {
+ rep = CordRepBtree::Append(ForceBtree(rep), new_node);
+ } else {
+ rep = Concat(rep, new_node);
}
- replace_tree(Concat(root, new_node));
+ CommitTree(root, rep, scope, method);
}
-void Cord::InlineRep::GetAppendRegion(char** region, size_t* size) {
- const size_t max_length = std::numeric_limits<size_t>::max();
-
- // Try to fit in the inline buffer if possible.
- if (!data_.is_tree()) {
- size_t inline_length = inline_size();
- if (inline_length < kMaxInline) {
- *region = data_.as_chars() + inline_length;
- *size = kMaxInline - inline_length;
- set_inline_size(kMaxInline);
- return;
- }
+// Computes the memory side of the provided edge which must be a valid data edge
+// for a btrtee, i.e., a FLAT, EXTERNAL or SUBSTRING of a FLAT or EXTERNAL node.
+static bool RepMemoryUsageDataEdge(const CordRep* rep,
+ size_t* total_mem_usage) {
+ size_t maybe_sub_size = 0;
+ if (ABSL_PREDICT_FALSE(rep->IsSubstring())) {
+ maybe_sub_size = sizeof(cord_internal::CordRepSubstring);
+ rep = rep->substring()->child;
}
-
- CordRep* root = force_tree(max_length);
-
- if (PrepareAppendRegion(root, region, size, max_length)) {
- return;
+ if (rep->IsFlat()) {
+ *total_mem_usage += maybe_sub_size + rep->flat()->AllocatedSize();
+ return true;
}
-
- // Allocate new node.
- CordRepFlat* new_node = CordRepFlat::New(root->length);
- new_node->length = new_node->Capacity();
- *region = new_node->Data();
- *size = new_node->length;
-
- if (cord_ring_enabled()) {
- replace_tree(CordRepRing::Append(ForceRing(root, 1), new_node));
- return;
+ if (rep->IsExternal()) {
+ // We don't know anything about the embedded / bound data, but we can safely
+ // assume it is 'at least' a word / pointer to data. In the future we may
+ // choose to use the 'data' byte as a tag to identify the types of some
+ // well-known externals, such as a std::string instance.
+ *total_mem_usage += maybe_sub_size +
+ sizeof(cord_internal::CordRepExternalImpl<intptr_t>) +
+ rep->length;
+ return true;
}
- replace_tree(Concat(root, new_node));
+ return false;
}
// If the rep is a leaf, this will increment the value at total_mem_usage and
// will return true.
static bool RepMemoryUsageLeaf(const CordRep* rep, size_t* total_mem_usage) {
- if (rep->tag >= FLAT) {
+ if (rep->IsFlat()) {
*total_mem_usage += rep->flat()->AllocatedSize();
return true;
}
- if (rep->tag == EXTERNAL) {
- *total_mem_usage += sizeof(CordRepConcat) + rep->length;
+ if (rep->IsExternal()) {
+ // We don't know anything about the embedded / bound data, but we can safely
+ // assume it is 'at least' a word / pointer to data. In the future we may
+ // choose to use the 'data' byte as a tag to identify the types of some
+ // well-known externals, such as a std::string instance.
+ *total_mem_usage +=
+ sizeof(cord_internal::CordRepExternalImpl<intptr_t>) + rep->length;
return true;
}
return false;
}
void Cord::InlineRep::AssignSlow(const Cord::InlineRep& src) {
- ClearSlow();
+ assert(&src != this);
+ assert(is_tree() || src.is_tree());
+ auto constexpr method = CordzUpdateTracker::kAssignCord;
+ if (ABSL_PREDICT_TRUE(!is_tree())) {
+ EmplaceTree(CordRep::Ref(src.as_tree()), src.data_, method);
+ return;
+ }
- data_ = src.data_;
- if (is_tree()) {
- data_.set_profiled(false);
- CordRep::Ref(tree());
- clear_cordz_info();
+ CordRep* tree = as_tree();
+ if (CordRep* src_tree = src.tree()) {
+ // Leave any existing `cordz_info` in place, and let MaybeTrackCord()
+ // decide if this cord should be (or remains to be) sampled or not.
+ data_.set_tree(CordRep::Ref(src_tree));
+ CordzInfo::MaybeTrackCord(data_, src.data_, method);
+ } else {
+ CordzInfo::MaybeUntrackCord(data_.cordz_info());
+ data_ = src.data_;
}
+ CordRep::Unref(tree);
}
-void Cord::InlineRep::ClearSlow() {
+void Cord::InlineRep::UnrefTree() {
if (is_tree()) {
+ CordzInfo::MaybeUntrackCord(data_.cordz_info());
CordRep::Unref(tree());
}
- ResetToEmpty();
}
// --------------------------------------------------------------------
// Constructors and destructors
-Cord::Cord(absl::string_view src) {
+Cord::Cord(absl::string_view src, MethodIdentifier method)
+ : contents_(InlineData::kDefaultInit) {
const size_t n = src.size();
if (n <= InlineRep::kMaxInline) {
- contents_.set_data(src.data(), n, false);
+ contents_.set_data(src.data(), n, true);
} else {
- contents_.set_tree(NewTree(src.data(), n, 0));
+ CordRep* rep = NewTree(src.data(), n, 0);
+ contents_.EmplaceTree(rep, method);
}
}
template <typename T, Cord::EnableIfString<T>>
-Cord::Cord(T&& src) {
- if (
- // String is short: copy data to avoid external block overhead.
- src.size() <= kMaxBytesToCopy ||
- // String is wasteful: copy data to avoid pinning too much unused memory.
- src.size() < src.capacity() / 2
- ) {
- if (src.size() <= InlineRep::kMaxInline) {
- contents_.set_data(src.data(), src.size(), false);
- } else {
- contents_.set_tree(NewTree(src.data(), src.size(), 0));
- }
+Cord::Cord(T&& src) : contents_(InlineData::kDefaultInit) {
+ if (src.size() <= InlineRep::kMaxInline) {
+ contents_.set_data(src.data(), src.size(), true);
} else {
- struct StringReleaser {
- void operator()(absl::string_view /* data */) {}
- std::string data;
- };
- const absl::string_view original_data = src;
- auto* rep = static_cast<
- ::absl::cord_internal::CordRepExternalImpl<StringReleaser>*>(
- absl::cord_internal::NewExternalRep(
- original_data, StringReleaser{std::forward<T>(src)}));
- // Moving src may have invalidated its data pointer, so adjust it.
- rep->base = rep->template get<0>().data.data();
- contents_.set_tree(rep);
+ CordRep* rep = CordRepFromString(std::forward<T>(src));
+ contents_.EmplaceTree(rep, CordzUpdateTracker::kConstructorString);
}
}
@@ -554,9 +603,9 @@ template Cord::Cord(std::string&& src);
// The destruction code is separate so that the compiler can determine
// that it does not need to call the destructor on a moved-from Cord.
void Cord::DestroyCordSlow() {
- if (CordRep* tree = contents_.tree()) {
- CordRep::Unref(VerifyTree(tree));
- }
+ assert(contents_.is_tree());
+ CordzInfo::MaybeUntrackCord(contents_.cordz_info());
+ CordRep::Unref(VerifyTree(contents_.as_tree()));
}
// --------------------------------------------------------------------
@@ -568,109 +617,116 @@ void Cord::Clear() {
}
}
-Cord& Cord::operator=(absl::string_view src) {
+Cord& Cord::AssignLargeString(std::string&& src) {
+ auto constexpr method = CordzUpdateTracker::kAssignString;
+ assert(src.size() > kMaxBytesToCopy);
+ CordRep* rep = CordRepFromString(std::move(src));
+ if (CordRep* tree = contents_.tree()) {
+ CordzUpdateScope scope(contents_.cordz_info(), method);
+ contents_.SetTree(rep, scope);
+ CordRep::Unref(tree);
+ } else {
+ contents_.EmplaceTree(rep, method);
+ }
+ return *this;
+}
+Cord& Cord::operator=(absl::string_view src) {
+ auto constexpr method = CordzUpdateTracker::kAssignString;
const char* data = src.data();
size_t length = src.size();
CordRep* tree = contents_.tree();
if (length <= InlineRep::kMaxInline) {
- // Embed into this->contents_
+ // Embed into this->contents_, which is somewhat subtle:
+ // - MaybeUntrackCord must be called before Unref(tree).
+ // - MaybeUntrackCord must be called before set_data() clobbers cordz_info.
+ // - set_data() must be called before Unref(tree) as it may reference tree.
+ if (tree != nullptr) CordzInfo::MaybeUntrackCord(contents_.cordz_info());
contents_.set_data(data, length, true);
- if (tree) CordRep::Unref(tree);
- return *this;
- }
- if (tree != nullptr && tree->tag >= FLAT &&
- tree->flat()->Capacity() >= length &&
- tree->refcount.IsOne()) {
- // Copy in place if the existing FLAT node is reusable.
- memmove(tree->flat()->Data(), data, length);
- tree->length = length;
- VerifyTree(tree);
+ if (tree != nullptr) CordRep::Unref(tree);
return *this;
}
- contents_.set_tree(NewTree(data, length, 0));
- if (tree) CordRep::Unref(tree);
- return *this;
-}
-
-template <typename T, Cord::EnableIfString<T>>
-Cord& Cord::operator=(T&& src) {
- if (src.size() <= kMaxBytesToCopy) {
- *this = absl::string_view(src);
+ if (tree != nullptr) {
+ CordzUpdateScope scope(contents_.cordz_info(), method);
+ if (tree->IsFlat() && tree->flat()->Capacity() >= length &&
+ tree->refcount.IsMutable()) {
+ // Copy in place if the existing FLAT node is reusable.
+ memmove(tree->flat()->Data(), data, length);
+ tree->length = length;
+ VerifyTree(tree);
+ return *this;
+ }
+ contents_.SetTree(NewTree(data, length, 0), scope);
+ CordRep::Unref(tree);
} else {
- *this = Cord(std::forward<T>(src));
+ contents_.EmplaceTree(NewTree(data, length, 0), method);
}
return *this;
}
-template Cord& Cord::operator=(std::string&& src);
-
// TODO(sanjay): Move to Cord::InlineRep section of file. For now,
// we keep it here to make diffs easier.
-void Cord::InlineRep::AppendArray(const char* src_data, size_t src_size) {
- if (src_size == 0) return; // memcpy(_, nullptr, 0) is undefined.
+void Cord::InlineRep::AppendArray(absl::string_view src,
+ MethodIdentifier method) {
+ if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
size_t appended = 0;
- CordRep* root = nullptr;
- if (is_tree()) {
- root = data_.as_tree();
+ CordRep* rep = tree();
+ const CordRep* const root = rep;
+ CordzUpdateScope scope(root ? cordz_info() : nullptr, method);
+ if (root != nullptr) {
char* region;
- if (PrepareAppendRegion(root, &region, &appended, src_size)) {
- memcpy(region, src_data, appended);
+ if (PrepareAppendRegion(rep, &region, &appended, src.size())) {
+ memcpy(region, src.data(), appended);
}
} else {
// Try to fit in the inline buffer if possible.
size_t inline_length = inline_size();
- if (src_size <= kMaxInline - inline_length) {
+ if (src.size() <= kMaxInline - inline_length) {
// Append new data to embedded array
- memcpy(data_.as_chars() + inline_length, src_data, src_size);
- set_inline_size(inline_length + src_size);
+ memcpy(data_.as_chars() + inline_length, src.data(), src.size());
+ set_inline_size(inline_length + src.size());
return;
}
- // It is possible that src_data == data_, but when we transition from an
- // InlineRep to a tree we need to assign data_ = root via set_tree. To
- // avoid corrupting the source data before we copy it, delay calling
- // set_tree until after we've copied data.
- // We are going from an inline size to beyond inline size. Make the new size
- // either double the inlined size, or the added size + 10%.
- const size_t size1 = inline_length * 2 + src_size;
- const size_t size2 = inline_length + src_size / 10;
- root = CordRepFlat::New(std::max<size_t>(size1, size2));
- appended = std::min(
- src_size, root->flat()->Capacity() - inline_length);
- memcpy(root->flat()->Data(), data_.as_chars(), inline_length);
- memcpy(root->flat()->Data() + inline_length, src_data, appended);
- root->length = inline_length + appended;
- set_tree(root);
- }
-
- src_data += appended;
- src_size -= appended;
- if (src_size == 0) {
- return;
+ // Allocate flat to be a perfect fit on first append exceeding inlined size.
+ // Subsequent growth will use amortized growth until we reach maximum flat
+ // size.
+ rep = CordRepFlat::New(inline_length + src.size());
+ appended = std::min(src.size(), rep->flat()->Capacity() - inline_length);
+ memcpy(rep->flat()->Data(), data_.as_chars(), inline_length);
+ memcpy(rep->flat()->Data() + inline_length, src.data(), appended);
+ rep->length = inline_length + appended;
}
- if (cord_ring_enabled()) {
- absl::string_view data(src_data, src_size);
- root = ForceRing(root, (data.size() - 1) / kMaxFlatLength + 1);
- replace_tree(CordRepRing::Append(root->ring(), data));
+ src.remove_prefix(appended);
+ if (src.empty()) {
+ CommitTree(root, rep, scope, method);
return;
}
- // Use new block(s) for any remaining bytes that were not handled above.
- // Alloc extra memory only if the right child of the root of the new tree is
- // going to be a FLAT node, which will permit further inplace appends.
- size_t length = src_size;
- if (src_size < kMaxFlatLength) {
- // The new length is either
- // - old size + 10%
- // - old_size + src_size
- // This will cause a reasonable conservative step-up in size that is still
- // large enough to avoid excessive amounts of small fragments being added.
- length = std::max<size_t>(root->length / 10, src_size);
+ if (btree_enabled()) {
+ // TODO(b/192061034): keep legacy 10% growth rate: consider other rates.
+ rep = ForceBtree(rep);
+ const size_t min_growth = std::max<size_t>(rep->length / 10, src.size());
+ rep = CordRepBtree::Append(rep->btree(), src, min_growth - src.size());
+ } else {
+ // Use new block(s) for any remaining bytes that were not handled above.
+ // Alloc extra memory only if the right child of the root of the new tree
+ // is going to be a FLAT node, which will permit further inplace appends.
+ size_t length = src.size();
+ if (src.size() < kMaxFlatLength) {
+ // The new length is either
+ // - old size + 10%
+ // - old_size + src.size()
+ // This will cause a reasonable conservative step-up in size that is
+ // still large enough to avoid excessive amounts of small fragments
+ // being added.
+ length = std::max<size_t>(rep->length / 10, src.size());
+ }
+ rep = Concat(rep, NewTree(src.data(), src.size(), length - src.size()));
}
- set_tree(Concat(root, NewTree(src_data, src_size, length - src_size)));
+ CommitTree(root, rep, scope, method);
}
inline CordRep* Cord::TakeRep() const& {
@@ -685,10 +741,17 @@ inline CordRep* Cord::TakeRep() && {
template <typename C>
inline void Cord::AppendImpl(C&& src) {
+ auto constexpr method = CordzUpdateTracker::kAppendCord;
if (empty()) {
- // In case of an empty destination avoid allocating a new node, do not copy
- // data.
- *this = std::forward<C>(src);
+ // Since destination is empty, we can avoid allocating a node,
+ if (src.contents_.is_tree()) {
+ // by taking the tree directly
+ CordRep* rep = std::forward<C>(src).TakeRep();
+ contents_.EmplaceTree(rep, method);
+ } else {
+ // or copying over inline data
+ contents_.data_ = src.contents_.data_;
+ }
return;
}
@@ -698,12 +761,12 @@ inline void Cord::AppendImpl(C&& src) {
CordRep* src_tree = src.contents_.tree();
if (src_tree == nullptr) {
// src has embedded data.
- contents_.AppendArray(src.contents_.data(), src_size);
+ contents_.AppendArray({src.contents_.data(), src_size}, method);
return;
}
- if (src_tree->tag >= FLAT) {
+ if (src_tree->IsFlat()) {
// src tree just has one flat node.
- contents_.AppendArray(src_tree->flat()->Data(), src_size);
+ contents_.AppendArray({src_tree->flat()->Data(), src_size}, method);
return;
}
if (&src == this) {
@@ -719,19 +782,25 @@ inline void Cord::AppendImpl(C&& src) {
}
// Guaranteed to be a tree (kMaxBytesToCopy > kInlinedSize)
- contents_.AppendTree(std::forward<C>(src).TakeRep());
+ CordRep* rep = std::forward<C>(src).TakeRep();
+ contents_.AppendTree(rep, CordzUpdateTracker::kAppendCord);
}
-void Cord::Append(const Cord& src) { AppendImpl(src); }
+void Cord::Append(const Cord& src) {
+ AppendImpl(src);
+}
-void Cord::Append(Cord&& src) { AppendImpl(std::move(src)); }
+void Cord::Append(Cord&& src) {
+ AppendImpl(std::move(src));
+}
template <typename T, Cord::EnableIfString<T>>
void Cord::Append(T&& src) {
if (src.size() <= kMaxBytesToCopy) {
Append(absl::string_view(src));
} else {
- Append(Cord(std::forward<T>(src)));
+ CordRep* rep = CordRepFromString(std::forward<T>(src));
+ contents_.AppendTree(rep, CordzUpdateTracker::kAppendString);
}
}
@@ -741,7 +810,7 @@ void Cord::Prepend(const Cord& src) {
CordRep* src_tree = src.contents_.tree();
if (src_tree != nullptr) {
CordRep::Ref(src_tree);
- contents_.PrependTree(src_tree);
+ contents_.PrependTree(src_tree, CordzUpdateTracker::kPrependCord);
return;
}
@@ -750,7 +819,7 @@ void Cord::Prepend(const Cord& src) {
return Prepend(src_contents);
}
-void Cord::Prepend(absl::string_view src) {
+void Cord::PrependArray(absl::string_view src, MethodIdentifier method) {
if (src.empty()) return; // memcpy(_, nullptr, 0) is undefined.
if (!contents_.is_tree()) {
size_t cur_size = contents_.inline_size();
@@ -764,7 +833,8 @@ void Cord::Prepend(absl::string_view src) {
return;
}
}
- contents_.PrependTree(NewTree(src.data(), src.size(), 0));
+ CordRep* rep = NewTree(src.data(), src.size(), 0);
+ contents_.PrependTree(rep, method);
}
template <typename T, Cord::EnableIfString<T>>
@@ -772,7 +842,8 @@ inline void Cord::Prepend(T&& src) {
if (src.size() <= kMaxBytesToCopy) {
Prepend(absl::string_view(src));
} else {
- Prepend(Cord(std::forward<T>(src)));
+ CordRep* rep = CordRepFromString(std::forward<T>(src));
+ contents_.PrependTree(rep, CordzUpdateTracker::kPrependString);
}
}
@@ -783,7 +854,7 @@ static CordRep* RemovePrefixFrom(CordRep* node, size_t n) {
if (n == 0) return CordRep::Ref(node);
absl::InlinedVector<CordRep*, kInlinedVectorSize> rhs_stack;
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
assert(n <= node->length);
if (n < node->concat()->left->length) {
// Push right to stack, descend left.
@@ -802,7 +873,7 @@ static CordRep* RemovePrefixFrom(CordRep* node, size_t n) {
} else {
size_t start = n;
size_t len = node->length - n;
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
// Consider in-place update of node, similar to in RemoveSuffixFrom().
start += node->substring()->start;
node = node->substring()->child;
@@ -823,9 +894,9 @@ static CordRep* RemoveSuffixFrom(CordRep* node, size_t n) {
if (n >= node->length) return nullptr;
if (n == 0) return CordRep::Ref(node);
absl::InlinedVector<CordRep*, kInlinedVectorSize> lhs_stack;
- bool inplace_ok = node->refcount.IsOne();
+ bool inplace_ok = node->refcount.IsMutable();
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
assert(n <= node->length);
if (n < node->concat()->right->length) {
// Push left to stack, descend right.
@@ -836,13 +907,13 @@ static CordRep* RemoveSuffixFrom(CordRep* node, size_t n) {
n -= node->concat()->right->length;
node = node->concat()->left;
}
- inplace_ok = inplace_ok && node->refcount.IsOne();
+ inplace_ok = inplace_ok && node->refcount.IsMutable();
}
assert(n <= node->length);
if (n == 0) {
CordRep::Ref(node);
- } else if (inplace_ok && node->tag != EXTERNAL) {
+ } else if (inplace_ok && !node->IsExternal()) {
// Consider making a new buffer if the current node capacity is much
// larger than the new length.
CordRep::Ref(node);
@@ -850,7 +921,7 @@ static CordRep* RemoveSuffixFrom(CordRep* node, size_t n) {
} else {
size_t start = 0;
size_t len = node->length - n;
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
start = node->substring()->start;
node = node->substring()->child;
}
@@ -870,12 +941,19 @@ void Cord::RemovePrefix(size_t n) {
CordRep* tree = contents_.tree();
if (tree == nullptr) {
contents_.remove_prefix(n);
- } else if (tree->tag == RING) {
- contents_.replace_tree(CordRepRing::RemovePrefix(tree->ring(), n));
} else {
- CordRep* newrep = RemovePrefixFrom(tree, n);
- CordRep::Unref(tree);
- contents_.replace_tree(VerifyTree(newrep));
+ auto constexpr method = CordzUpdateTracker::kRemovePrefix;
+ CordzUpdateScope scope(contents_.cordz_info(), method);
+ if (tree->IsBtree()) {
+ CordRep* old = tree;
+ tree = tree->btree()->SubTree(n, tree->length - n);
+ CordRep::Unref(old);
+ } else {
+ CordRep* newrep = RemovePrefixFrom(tree, n);
+ CordRep::Unref(tree);
+ tree = VerifyTree(newrep);
+ }
+ contents_.SetTreeOrEmpty(tree, scope);
}
}
@@ -886,12 +964,17 @@ void Cord::RemoveSuffix(size_t n) {
CordRep* tree = contents_.tree();
if (tree == nullptr) {
contents_.reduce_size(n);
- } else if (tree->tag == RING) {
- contents_.replace_tree(CordRepRing::RemoveSuffix(tree->ring(), n));
} else {
- CordRep* newrep = RemoveSuffixFrom(tree, n);
- CordRep::Unref(tree);
- contents_.replace_tree(VerifyTree(newrep));
+ auto constexpr method = CordzUpdateTracker::kRemoveSuffix;
+ CordzUpdateScope scope(contents_.cordz_info(), method);
+ if (tree->IsBtree()) {
+ tree = CordRepBtree::RemoveSuffix(tree->btree(), n);
+ } else {
+ CordRep* newrep = RemoveSuffixFrom(tree, n);
+ CordRep::Unref(tree);
+ tree = VerifyTree(newrep);
+ }
+ contents_.SetTreeOrEmpty(tree, scope);
}
}
@@ -924,8 +1007,8 @@ static CordRep* NewSubRange(CordRep* node, size_t pos, size_t n) {
results.push_back(Concat(left, right));
} else if (pos == 0 && n == node->length) {
results.push_back(CordRep::Ref(node));
- } else if (node->tag != CONCAT) {
- if (node->tag == SUBSTRING) {
+ } else if (!node->IsConcat()) {
+ if (node->IsSubstring()) {
pos += node->substring()->start;
node = node->substring()->child;
}
@@ -951,17 +1034,20 @@ Cord Cord::Subcord(size_t pos, size_t new_size) const {
size_t length = size();
if (pos > length) pos = length;
if (new_size > length - pos) new_size = length - pos;
+ if (new_size == 0) return sub_cord;
+
CordRep* tree = contents_.tree();
if (tree == nullptr) {
// sub_cord is newly constructed, no need to re-zero-out the tail of
// contents_ memory.
sub_cord.contents_.set_data(contents_.data() + pos, new_size, false);
- } else if (new_size == 0) {
- // We want to return empty subcord, so nothing to do.
- } else if (new_size <= InlineRep::kMaxInline) {
+ return sub_cord;
+ }
+
+ if (new_size <= InlineRep::kMaxInline) {
+ char* dest = sub_cord.contents_.data_.as_chars();
Cord::ChunkIterator it = chunk_begin();
it.AdvanceBytes(pos);
- char* dest = sub_cord.contents_.data_.as_chars();
size_t remaining_size = new_size;
while (remaining_size > it->size()) {
cord_internal::SmallMemmove(dest, it->data(), it->size());
@@ -971,12 +1057,16 @@ Cord Cord::Subcord(size_t pos, size_t new_size) const {
}
cord_internal::SmallMemmove(dest, it->data(), remaining_size);
sub_cord.contents_.set_inline_size(new_size);
- } else if (tree->tag == RING) {
- tree = CordRepRing::SubRing(CordRep::Ref(tree)->ring(), pos, new_size);
- sub_cord.contents_.set_tree(tree);
+ return sub_cord;
+ }
+
+ if (tree->IsBtree()) {
+ tree = tree->btree()->SubTree(pos, new_size);
} else {
- sub_cord.contents_.set_tree(NewSubRange(tree, pos, new_size));
+ tree = NewSubRange(tree, pos, new_size);
}
+ sub_cord.contents_.EmplaceTree(tree, contents_.data_,
+ CordzUpdateTracker::kSubCord);
return sub_cord;
}
@@ -995,7 +1085,7 @@ class CordForest {
CordRep* node = pending.back();
pending.pop_back();
CheckNode(node);
- if (ABSL_PREDICT_FALSE(node->tag != CONCAT)) {
+ if (ABSL_PREDICT_FALSE(!node->IsConcat())) {
AddNode(node);
continue;
}
@@ -1089,7 +1179,7 @@ class CordForest {
static void CheckNode(CordRep* node) {
ABSL_INTERNAL_CHECK(node->length != 0u, "");
- if (node->tag == CONCAT) {
+ if (node->IsConcat()) {
ABSL_INTERNAL_CHECK(node->concat()->left != nullptr, "");
ABSL_INTERNAL_CHECK(node->concat()->right != nullptr, "");
ABSL_INTERNAL_CHECK(node->length == (node->concat()->left->length +
@@ -1109,7 +1199,7 @@ class CordForest {
static CordRep* Rebalance(CordRep* node) {
VerifyTree(node);
- assert(node->tag == CONCAT);
+ assert(node->IsConcat());
if (node->length == 0) {
return nullptr;
@@ -1159,28 +1249,33 @@ bool ComputeCompareResult<bool>(int memcmp_res) {
} // namespace
-// Helper routine. Locates the first flat chunk of the Cord without
-// initializing the iterator.
+// Helper routine. Locates the first flat or external chunk of the Cord without
+// initializing the iterator, and returns a string_view referencing the data.
inline absl::string_view Cord::InlineRep::FindFlatStartPiece() const {
if (!is_tree()) {
return absl::string_view(data_.as_chars(), data_.inline_size());
}
CordRep* node = tree();
- if (node->tag >= FLAT) {
+ if (node->IsFlat()) {
return absl::string_view(node->flat()->Data(), node->length);
}
- if (node->tag == EXTERNAL) {
+ if (node->IsExternal()) {
return absl::string_view(node->external()->base, node->length);
}
- if (node->tag == RING) {
- return node->ring()->entry_data(node->ring()->head());
+ if (node->IsBtree()) {
+ CordRepBtree* tree = node->btree();
+ int height = tree->height();
+ while (--height >= 0) {
+ tree = tree->Edge(CordRepBtree::kFront)->btree();
+ }
+ return tree->Data(tree->begin());
}
// Walk down the left branches until we hit a non-CONCAT node.
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
node = node->concat()->left;
}
@@ -1189,16 +1284,16 @@ inline absl::string_view Cord::InlineRep::FindFlatStartPiece() const {
size_t length = node->length;
assert(length != 0);
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
offset = node->substring()->start;
node = node->substring()->child;
}
- if (node->tag >= FLAT) {
+ if (node->IsFlat()) {
return absl::string_view(node->flat()->Data() + offset, length);
}
- assert((node->tag == EXTERNAL) && "Expect FLAT or EXTERNAL node here");
+ assert(node->IsExternal() && "Expect FLAT or EXTERNAL node here");
return absl::string_view(node->external()->base + offset, length);
}
@@ -1392,7 +1487,7 @@ Cord::ChunkIterator& Cord::ChunkIterator::AdvanceStack() {
// Walk down the left branches until we hit a non-CONCAT node. Save the
// right children to the stack for subsequent traversal.
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
stack_of_right_children.push_back(node->concat()->right);
node = node->concat()->left;
}
@@ -1400,15 +1495,15 @@ Cord::ChunkIterator& Cord::ChunkIterator::AdvanceStack() {
// Get the child node if we encounter a SUBSTRING.
size_t offset = 0;
size_t length = node->length;
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
offset = node->substring()->start;
node = node->substring()->child;
}
- assert(node->tag == EXTERNAL || node->tag >= FLAT);
+ assert(node->IsExternal() || node->IsFlat());
assert(length != 0);
const char* data =
- node->tag == EXTERNAL ? node->external()->base : node->flat()->Data();
+ node->IsExternal() ? node->external()->base : node->flat()->Data();
current_chunk_ = absl::string_view(data + offset, length);
current_leaf_ = node;
return *this;
@@ -1418,6 +1513,7 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
ABSL_HARDENING_ASSERT(bytes_remaining_ >= n &&
"Attempted to iterate past `end()`");
Cord subcord;
+ auto constexpr method = CordzUpdateTracker::kCordReader;
if (n <= InlineRep::kMaxInline) {
// Range to read fits in inline data. Flatten it.
@@ -1437,21 +1533,21 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
return subcord;
}
- if (ring_reader_) {
+ if (btree_reader_) {
size_t chunk_size = current_chunk_.size();
if (n <= chunk_size && n <= kMaxBytesToCopy) {
- subcord = Cord(current_chunk_.substr(0, n));
- } else {
- auto* ring = CordRep::Ref(ring_reader_.ring())->ring();
- size_t offset = ring_reader_.length() - bytes_remaining_;
- subcord.contents_.set_tree(CordRepRing::SubRing(ring, offset, n));
- }
- if (n < chunk_size) {
- bytes_remaining_ -= n;
- current_chunk_.remove_prefix(n);
+ subcord = Cord(current_chunk_.substr(0, n), method);
+ if (n < chunk_size) {
+ current_chunk_.remove_prefix(n);
+ } else {
+ current_chunk_ = btree_reader_.Next();
+ }
} else {
- AdvanceBytesRing(n);
+ CordRep* rep;
+ current_chunk_ = btree_reader_.Read(n, chunk_size, rep);
+ subcord.contents_.EmplaceTree(rep, method);
}
+ bytes_remaining_ -= n;
return subcord;
}
@@ -1460,10 +1556,10 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
// Range to read is a proper subrange of the current chunk.
assert(current_leaf_ != nullptr);
CordRep* subnode = CordRep::Ref(current_leaf_);
- const char* data = subnode->tag == EXTERNAL ? subnode->external()->base
- : subnode->flat()->Data();
+ const char* data = subnode->IsExternal() ? subnode->external()->base
+ : subnode->flat()->Data();
subnode = NewSubstring(subnode, current_chunk_.data() - data, n);
- subcord.contents_.set_tree(VerifyTree(subnode));
+ subcord.contents_.EmplaceTree(VerifyTree(subnode), method);
RemoveChunkPrefix(n);
return subcord;
}
@@ -1473,8 +1569,8 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
assert(current_leaf_ != nullptr);
CordRep* subnode = CordRep::Ref(current_leaf_);
if (current_chunk_.size() < subnode->length) {
- const char* data = subnode->tag == EXTERNAL ? subnode->external()->base
- : subnode->flat()->Data();
+ const char* data = subnode->IsExternal() ? subnode->external()->base
+ : subnode->flat()->Data();
subnode = NewSubstring(subnode, current_chunk_.data() - data,
current_chunk_.size());
}
@@ -1506,13 +1602,13 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
if (node == nullptr) {
// We have reached the end of the Cord.
assert(bytes_remaining_ == 0);
- subcord.contents_.set_tree(VerifyTree(subnode));
+ subcord.contents_.EmplaceTree(VerifyTree(subnode), method);
return subcord;
}
// Walk down the appropriate branches until we hit a non-CONCAT node. Save the
// right children to the stack for subsequent traversal.
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
if (node->concat()->left->length > n) {
// Push right, descend left.
stack_of_right_children.push_back(node->concat()->right);
@@ -1529,24 +1625,24 @@ Cord Cord::ChunkIterator::AdvanceAndReadBytes(size_t n) {
// Get the child node if we encounter a SUBSTRING.
size_t offset = 0;
size_t length = node->length;
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
offset = node->substring()->start;
node = node->substring()->child;
}
// Range to read ends with a proper (possibly empty) subrange of the current
// chunk.
- assert(node->tag == EXTERNAL || node->tag >= FLAT);
+ assert(node->IsExternal() || node->IsFlat());
assert(length > n);
if (n > 0) {
subnode = Concat(subnode, NewSubstring(CordRep::Ref(node), offset, n));
}
const char* data =
- node->tag == EXTERNAL ? node->external()->base : node->flat()->Data();
+ node->IsExternal() ? node->external()->base : node->flat()->Data();
current_chunk_ = absl::string_view(data + offset + n, length - n);
current_leaf_ = node;
bytes_remaining_ -= n;
- subcord.contents_.set_tree(VerifyTree(subnode));
+ subcord.contents_.EmplaceTree(VerifyTree(subnode), method);
return subcord;
}
@@ -1585,7 +1681,7 @@ void Cord::ChunkIterator::AdvanceBytesSlowPath(size_t n) {
// Walk down the appropriate branches until we hit a non-CONCAT node. Save the
// right children to the stack for subsequent traversal.
- while (node->tag == CONCAT) {
+ while (node->IsConcat()) {
if (node->concat()->left->length > n) {
// Push right, descend left.
stack_of_right_children.push_back(node->concat()->right);
@@ -1601,15 +1697,15 @@ void Cord::ChunkIterator::AdvanceBytesSlowPath(size_t n) {
// Get the child node if we encounter a SUBSTRING.
size_t offset = 0;
size_t length = node->length;
- if (node->tag == SUBSTRING) {
+ if (node->IsSubstring()) {
offset = node->substring()->start;
node = node->substring()->child;
}
- assert(node->tag == EXTERNAL || node->tag >= FLAT);
+ assert(node->IsExternal() || node->IsFlat());
assert(length > n);
const char* data =
- node->tag == EXTERNAL ? node->external()->base : node->flat()->Data();
+ node->IsExternal() ? node->external()->base : node->flat()->Data();
current_chunk_ = absl::string_view(data + offset + n, length - n);
current_leaf_ = node;
bytes_remaining_ -= n;
@@ -1625,15 +1721,15 @@ char Cord::operator[](size_t i) const {
while (true) {
assert(rep != nullptr);
assert(offset < rep->length);
- if (rep->tag >= FLAT) {
+ if (rep->IsFlat()) {
// Get the "i"th character directly from the flat array.
return rep->flat()->Data()[offset];
- } else if (rep->tag == RING) {
- return rep->ring()->GetCharacter(offset);
- } else if (rep->tag == EXTERNAL) {
+ } else if (rep->IsBtree()) {
+ return rep->btree()->GetCharacter(offset);
+ } else if (rep->IsExternal()) {
// Get the "i"th character from the external array.
return rep->external()->base[offset];
- } else if (rep->tag == CONCAT) {
+ } else if (rep->IsConcat()) {
// Recursively branch to the side of the concatenation that the "i"th
// character is on.
size_t left_length = rep->concat()->left->length;
@@ -1645,7 +1741,7 @@ char Cord::operator[](size_t i) const {
}
} else {
// This must be a substring a node, so bypass it to get to the child.
- assert(rep->tag == SUBSTRING);
+ assert(rep->IsSubstring());
offset += rep->substring()->start;
rep = rep->substring()->child;
}
@@ -1653,6 +1749,7 @@ char Cord::operator[](size_t i) const {
}
absl::string_view Cord::FlattenSlowPath() {
+ assert(contents_.is_tree());
size_t total_size = size();
CordRep* new_rep;
char* new_buffer;
@@ -1673,31 +1770,35 @@ absl::string_view Cord::FlattenSlowPath() {
s.size());
});
}
- if (CordRep* tree = contents_.tree()) {
- CordRep::Unref(tree);
- }
- contents_.set_tree(new_rep);
+ CordzUpdateScope scope(contents_.cordz_info(), CordzUpdateTracker::kFlatten);
+ CordRep::Unref(contents_.as_tree());
+ contents_.SetTree(new_rep, scope);
return absl::string_view(new_buffer, total_size);
}
/* static */ bool Cord::GetFlatAux(CordRep* rep, absl::string_view* fragment) {
assert(rep != nullptr);
- if (rep->tag >= FLAT) {
+ if (rep->IsFlat()) {
*fragment = absl::string_view(rep->flat()->Data(), rep->length);
return true;
- } else if (rep->tag == EXTERNAL) {
+ } else if (rep->IsExternal()) {
*fragment = absl::string_view(rep->external()->base, rep->length);
return true;
- } else if (rep->tag == SUBSTRING) {
+ } else if (rep->IsBtree()) {
+ return rep->btree()->IsFlat(fragment);
+ } else if (rep->IsSubstring()) {
CordRep* child = rep->substring()->child;
- if (child->tag >= FLAT) {
+ if (child->IsFlat()) {
*fragment = absl::string_view(
child->flat()->Data() + rep->substring()->start, rep->length);
return true;
- } else if (child->tag == EXTERNAL) {
+ } else if (child->IsExternal()) {
*fragment = absl::string_view(
child->external()->base + rep->substring()->start, rep->length);
return true;
+ } else if (child->IsBtree()) {
+ return child->btree()->IsFlat(rep->substring()->start, rep->length,
+ fragment);
}
}
return false;
@@ -1706,7 +1807,7 @@ absl::string_view Cord::FlattenSlowPath() {
/* static */ void Cord::ForEachChunkAux(
absl::cord_internal::CordRep* rep,
absl::FunctionRef<void(absl::string_view)> callback) {
- if (rep->tag == RING) {
+ if (rep->IsBtree()) {
ChunkIterator it(rep), end;
while (it != end) {
callback(*it);
@@ -1722,7 +1823,7 @@ absl::string_view Cord::FlattenSlowPath() {
absl::cord_internal::CordRep* stack[stack_max];
absl::cord_internal::CordRep* current_node = rep;
while (true) {
- if (current_node->tag == CONCAT) {
+ if (current_node->IsConcat()) {
if (stack_pos == stack_max) {
// There's no more room on our stack array to add another right branch,
// and the idea is to avoid allocations, so call this function
@@ -1769,38 +1870,29 @@ static void DumpNode(CordRep* rep, bool include_data, std::ostream* os,
*os << "]";
*os << " " << (IsRootBalanced(rep) ? 'b' : 'u');
*os << " " << std::setw(indent) << "";
- if (rep->tag == CONCAT) {
+ if (rep->IsConcat()) {
*os << "CONCAT depth=" << Depth(rep) << "\n";
indent += kIndentStep;
indents.push_back(indent);
stack.push_back(rep->concat()->right);
rep = rep->concat()->left;
- } else if (rep->tag == SUBSTRING) {
+ } else if (rep->IsSubstring()) {
*os << "SUBSTRING @ " << rep->substring()->start << "\n";
indent += kIndentStep;
rep = rep->substring()->child;
} else { // Leaf or ring
- if (rep->tag == EXTERNAL) {
+ if (rep->IsExternal()) {
*os << "EXTERNAL [";
if (include_data)
*os << absl::CEscape(std::string(rep->external()->base, rep->length));
*os << "]\n";
- } else if (rep->tag >= FLAT) {
- *os << "FLAT cap=" << rep->flat()->Capacity()
- << " [";
+ } else if (rep->IsFlat()) {
+ *os << "FLAT cap=" << rep->flat()->Capacity() << " [";
if (include_data)
*os << absl::CEscape(std::string(rep->flat()->Data(), rep->length));
*os << "]\n";
} else {
- assert(rep->tag == RING);
- auto* ring = rep->ring();
- *os << "RING, entries = " << ring->entries() << "\n";
- CordRepRing::index_type head = ring->head();
- do {
- DumpNode(ring->entry_child(head), include_data, os,
- indent + kIndentStep);
- head = ring->advance(head);;
- } while (head != ring->tail());
+ CordRepBtree::Dump(rep, /*label=*/ "", include_data, *os);
}
if (stack.empty()) break;
rep = stack.back();
@@ -1832,7 +1924,7 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
ABSL_INTERNAL_CHECK(node->length != 0, ReportError(root, node));
}
- if (node->tag == CONCAT) {
+ if (node->IsConcat()) {
ABSL_INTERNAL_CHECK(node->concat()->left != nullptr,
ReportError(root, node));
ABSL_INTERNAL_CHECK(node->concat()->right != nullptr,
@@ -1844,14 +1936,13 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
worklist.push_back(node->concat()->right);
worklist.push_back(node->concat()->left);
}
- } else if (node->tag >= FLAT) {
- ABSL_INTERNAL_CHECK(
- node->length <= node->flat()->Capacity(),
- ReportError(root, node));
- } else if (node->tag == EXTERNAL) {
+ } else if (node->IsFlat()) {
+ ABSL_INTERNAL_CHECK(node->length <= node->flat()->Capacity(),
+ ReportError(root, node));
+ } else if (node->IsExternal()) {
ABSL_INTERNAL_CHECK(node->external()->base != nullptr,
ReportError(root, node));
- } else if (node->tag == SUBSTRING) {
+ } else if (node->IsSubstring()) {
ABSL_INTERNAL_CHECK(
node->substring()->start < node->substring()->child->length,
ReportError(root, node));
@@ -1880,7 +1971,7 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
while (true) {
const CordRep* next_node = nullptr;
- if (cur_node->tag == CONCAT) {
+ if (cur_node->IsConcat()) {
total_mem_usage += sizeof(CordRepConcat);
const CordRep* left = cur_node->concat()->left;
if (!RepMemoryUsageLeaf(left, &total_mem_usage)) {
@@ -1894,18 +1985,21 @@ static bool VerifyNode(CordRep* root, CordRep* start_node,
}
next_node = right;
}
- } else if (cur_node->tag == RING) {
- total_mem_usage += CordRepRing::AllocSize(cur_node->ring()->capacity());
- const CordRepRing* ring = cur_node->ring();
- CordRepRing::index_type pos = ring->head(), tail = ring->tail();
- do {
- CordRep* node = ring->entry_child(pos);
- assert(node->tag >= FLAT || node->tag == EXTERNAL);
- RepMemoryUsageLeaf(node, &total_mem_usage);
- } while ((pos = ring->advance(pos)) != tail);
+ } else if (cur_node->IsBtree()) {
+ total_mem_usage += sizeof(CordRepBtree);
+ const CordRepBtree* node = cur_node->btree();
+ if (node->height() == 0) {
+ for (const CordRep* edge : node->Edges()) {
+ RepMemoryUsageDataEdge(edge, &total_mem_usage);
+ }
+ } else {
+ for (const CordRep* edge : node->Edges()) {
+ tree_stack.push_back(edge);
+ }
+ }
} else {
// Since cur_node is not a leaf or a concat node it must be a substring.
- assert(cur_node->tag == SUBSTRING);
+ assert(cur_node->IsSubstring());
total_mem_usage += sizeof(CordRepSubstring);
next_node = cur_node->substring()->child;
if (RepMemoryUsageLeaf(next_node, &total_mem_usage)) {
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord.h b/grpc/third_party/abseil-cpp/absl/strings/cord.h
index fa9cb913..f0a19914 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord.h
@@ -70,6 +70,7 @@
#include <string>
#include <type_traits>
+#include "absl/base/config.h"
#include "absl/base/internal/endian.h"
#include "absl/base/internal/per_thread_tls.h"
#include "absl/base/macros.h"
@@ -78,8 +79,14 @@
#include "absl/functional/function_ref.h"
#include "absl/meta/type_traits.h"
#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_btree_reader.h"
#include "absl/strings/internal/cord_rep_ring.h"
-#include "absl/strings/internal/cord_rep_ring_reader.h"
+#include "absl/strings/internal/cordz_functions.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_scope.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/strings/internal/resize_uninitialized.h"
#include "absl/strings/internal/string_constant.h"
#include "absl/strings/string_view.h"
@@ -249,9 +256,7 @@ class Cord {
// swap()
//
// Swaps the contents of two Cords.
- friend void swap(Cord& x, Cord& y) noexcept {
- x.swap(y);
- }
+ friend void swap(Cord& x, Cord& y) noexcept { x.swap(y); }
// Cord::size()
//
@@ -364,8 +369,8 @@ class Cord {
private:
using CordRep = absl::cord_internal::CordRep;
- using CordRepRing = absl::cord_internal::CordRepRing;
- using CordRepRingReader = absl::cord_internal::CordRepRingReader;
+ using CordRepBtree = absl::cord_internal::CordRepBtree;
+ using CordRepBtreeReader = absl::cord_internal::CordRepBtreeReader;
// Stack of right children of concat nodes that we have to visit.
// Keep this at the end of the structure to avoid cache-thrashing.
@@ -391,9 +396,9 @@ class Cord {
// Stack specific operator++
ChunkIterator& AdvanceStack();
- // Ring buffer specific operator++
- ChunkIterator& AdvanceRing();
- void AdvanceBytesRing(size_t n);
+ // Btree specific operator++
+ ChunkIterator& AdvanceBtree();
+ void AdvanceBytesBtree(size_t n);
// Iterates `n` bytes, where `n` is expected to be greater than or equal to
// `current_chunk_.size()`.
@@ -409,8 +414,8 @@ class Cord {
// The number of bytes left in the `Cord` over which we are iterating.
size_t bytes_remaining_ = 0;
- // Cord reader for ring buffers. Empty if not traversing a ring buffer.
- CordRepRingReader ring_reader_;
+ // Cord reader for cord btrees. Empty if not traversing a btree.
+ CordRepBtreeReader btree_reader_;
// See 'Stack' alias definition.
Stack stack_of_right_children_;
@@ -455,6 +460,16 @@ class Cord {
// `Cord::chunk_begin()` and `Cord::chunk_end()`.
class ChunkRange {
public:
+ // Fulfill minimum c++ container requirements [container.requirements]
+ // Theses (partial) container type definitions allow ChunkRange to be used
+ // in various utilities expecting a subset of [container.requirements].
+ // For example, the below enables using `::testing::ElementsAre(...)`
+ using value_type = absl::string_view;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using iterator = ChunkIterator;
+ using const_iterator = ChunkIterator;
+
explicit ChunkRange(const Cord* cord) : cord_(cord) {}
ChunkIterator begin() const;
@@ -586,6 +601,16 @@ class Cord {
// `Cord::char_begin()` and `Cord::char_end()`.
class CharRange {
public:
+ // Fulfill minimum c++ container requirements [container.requirements]
+ // Theses (partial) container type definitions allow CharRange to be used
+ // in various utilities expecting a subset of [container.requirements].
+ // For example, the below enables using `::testing::ElementsAre(...)`
+ using value_type = char;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using iterator = CharIterator;
+ using const_iterator = CharIterator;
+
explicit CharRange(const Cord* cord) : cord_(cord) {}
CharIterator begin() const;
@@ -664,10 +689,24 @@ class Cord {
explicit constexpr Cord(strings_internal::StringConstant<T>);
private:
+ using CordRep = absl::cord_internal::CordRep;
+ using CordRepFlat = absl::cord_internal::CordRepFlat;
+ using CordzInfo = cord_internal::CordzInfo;
+ using CordzUpdateScope = cord_internal::CordzUpdateScope;
+ using CordzUpdateTracker = cord_internal::CordzUpdateTracker;
+ using InlineData = cord_internal::InlineData;
+ using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+
+ // Creates a cord instance with `method` representing the originating
+ // public API call causing the cord to be created.
+ explicit Cord(absl::string_view src, MethodIdentifier method);
+
friend class CordTestPeer;
friend bool operator==(const Cord& lhs, const Cord& rhs);
friend bool operator==(const Cord& lhs, absl::string_view rhs);
+ friend const CordzInfo* GetCordzInfoForTesting(const Cord& cord);
+
// Calls the provided function once for each cord chunk, in order. Unlike
// Chunks(), this API will not allocate memory.
void ForEachChunk(absl::FunctionRef<void(absl::string_view)>) const;
@@ -687,6 +726,7 @@ class Cord {
static_assert(kMaxInline >= sizeof(absl::cord_internal::CordRep*), "");
constexpr InlineRep() : data_() {}
+ explicit InlineRep(InlineData::DefaultInitType init) : data_(init) {}
InlineRep(const InlineRep& src);
InlineRep(InlineRep&& src);
InlineRep& operator=(const InlineRep& src);
@@ -700,27 +740,60 @@ class Cord {
const char* data() const; // Returns nullptr if holding pointer
void set_data(const char* data, size_t n,
bool nullify_tail); // Discards pointer, if any
- char* set_data(size_t n); // Write data to the result
+ char* set_data(size_t n); // Write data to the result
// Returns nullptr if holding bytes
absl::cord_internal::CordRep* tree() const;
absl::cord_internal::CordRep* as_tree() const;
- // Discards old pointer, if any
- void set_tree(absl::cord_internal::CordRep* rep);
- // Replaces a tree with a new root. This is faster than set_tree, but it
- // should only be used when it's clear that the old rep was a tree.
- void replace_tree(absl::cord_internal::CordRep* rep);
// Returns non-null iff was holding a pointer
absl::cord_internal::CordRep* clear();
// Converts to pointer if necessary.
- absl::cord_internal::CordRep* force_tree(size_t extra_hint);
- void reduce_size(size_t n); // REQUIRES: holding data
+ void reduce_size(size_t n); // REQUIRES: holding data
void remove_prefix(size_t n); // REQUIRES: holding data
- void AppendArray(const char* src_data, size_t src_size);
+ void AppendArray(absl::string_view src, MethodIdentifier method);
absl::string_view FindFlatStartPiece() const;
- void AppendTree(absl::cord_internal::CordRep* tree);
- void PrependTree(absl::cord_internal::CordRep* tree);
- void GetAppendRegion(char** region, size_t* size, size_t max_length);
- void GetAppendRegion(char** region, size_t* size);
+
+ // Creates a CordRepFlat instance from the current inlined data with `extra'
+ // bytes of desired additional capacity.
+ CordRepFlat* MakeFlatWithExtraCapacity(size_t extra);
+
+ // Sets the tree value for this instance. `rep` must not be null.
+ // Requires the current instance to hold a tree, and a lock to be held on
+ // any CordzInfo referenced by this instance. The latter is enforced through
+ // the CordzUpdateScope argument. If the current instance is sampled, then
+ // the CordzInfo instance is updated to reference the new `rep` value.
+ void SetTree(CordRep* rep, const CordzUpdateScope& scope);
+
+ // Identical to SetTree(), except that `rep` is allowed to be null, in
+ // which case the current instance is reset to an empty value.
+ void SetTreeOrEmpty(CordRep* rep, const CordzUpdateScope& scope);
+
+ // Sets the tree value for this instance, and randomly samples this cord.
+ // This function disregards existing contents in `data_`, and should be
+ // called when a Cord is 'promoted' from an 'uninitialized' or 'inlined'
+ // value to a non-inlined (tree / ring) value.
+ void EmplaceTree(CordRep* rep, MethodIdentifier method);
+
+ // Identical to EmplaceTree, except that it copies the parent stack from
+ // the provided `parent` data if the parent is sampled.
+ void EmplaceTree(CordRep* rep, const InlineData& parent,
+ MethodIdentifier method);
+
+ // Commits the change of a newly created, or updated `rep` root value into
+ // this cord. `old_rep` indicates the old (inlined or tree) value of the
+ // cord, and determines if the commit invokes SetTree() or EmplaceTree().
+ void CommitTree(const CordRep* old_rep, CordRep* rep,
+ const CordzUpdateScope& scope, MethodIdentifier method);
+
+ void AppendTreeToInlined(CordRep* tree, MethodIdentifier method);
+ void AppendTreeToTree(CordRep* tree, MethodIdentifier method);
+ void AppendTree(CordRep* tree, MethodIdentifier method);
+ void PrependTreeToInlined(CordRep* tree, MethodIdentifier method);
+ void PrependTreeToTree(CordRep* tree, MethodIdentifier method);
+ void PrependTree(CordRep* tree, MethodIdentifier method);
+
+ template <bool has_length>
+ void GetAppendRegion(char** region, size_t* size, size_t length);
+
bool IsSame(const InlineRep& other) const {
return memcmp(&data_, &other.data_, sizeof(data_)) == 0;
}
@@ -776,8 +849,8 @@ class Cord {
friend class Cord;
void AssignSlow(const InlineRep& src);
- // Unrefs the tree, stops profiling, and zeroes the contents
- void ClearSlow();
+ // Unrefs the tree and stops profiling.
+ void UnrefTree();
void ResetToEmpty() { data_ = {}; }
@@ -828,6 +901,14 @@ class Cord {
template <typename C>
void AppendImpl(C&& src);
+ // Prepends the provided data to this instance. `method` contains the public
+ // API method for this action which is tracked for Cordz sampling purposes.
+ void PrependArray(absl::string_view src, MethodIdentifier method);
+
+ // Assigns the value in 'src' to this instance, 'stealing' its contents.
+ // Requires src.length() > kMaxBytesToCopy.
+ Cord& AssignLargeString(std::string&& src);
+
// Helper for AbslHashValue().
template <typename H>
H HashFragmented(H hash_state) const {
@@ -930,8 +1011,11 @@ inline CordRep* NewExternalRep(absl::string_view data,
template <typename Releaser>
Cord MakeCordFromExternal(absl::string_view data, Releaser&& releaser) {
Cord cord;
- cord.contents_.set_tree(::absl::cord_internal::NewExternalRep(
- data, std::forward<Releaser>(releaser)));
+ if (auto* rep = ::absl::cord_internal::NewExternalRep(
+ data, std::forward<Releaser>(releaser))) {
+ cord.contents_.EmplaceTree(rep,
+ Cord::MethodIdentifier::kMakeCordFromExternal);
+ }
return cord;
}
@@ -939,15 +1023,16 @@ constexpr Cord::InlineRep::InlineRep(cord_internal::InlineData data)
: data_(data) {}
inline Cord::InlineRep::InlineRep(const Cord::InlineRep& src)
- : data_(src.data_) {
- if (is_tree()) {
- data_.clear_cordz_info();
- absl::cord_internal::CordRep::Ref(as_tree());
+ : data_(InlineData::kDefaultInit) {
+ if (CordRep* tree = src.tree()) {
+ EmplaceTree(CordRep::Ref(tree), src.data_,
+ CordzUpdateTracker::kConstructorCord);
+ } else {
+ data_ = src.data_;
}
}
-inline Cord::InlineRep::InlineRep(Cord::InlineRep&& src) {
- data_ = src.data_;
+inline Cord::InlineRep::InlineRep(Cord::InlineRep&& src) : data_(src.data_) {
src.ResetToEmpty();
}
@@ -966,7 +1051,7 @@ inline Cord::InlineRep& Cord::InlineRep::operator=(const Cord::InlineRep& src) {
inline Cord::InlineRep& Cord::InlineRep::operator=(
Cord::InlineRep&& src) noexcept {
if (is_tree()) {
- ClearSlow();
+ UnrefTree();
}
data_ = src.data_;
src.ResetToEmpty();
@@ -1003,31 +1088,62 @@ inline size_t Cord::InlineRep::size() const {
return is_tree() ? as_tree()->length : inline_size();
}
-inline void Cord::InlineRep::set_tree(absl::cord_internal::CordRep* rep) {
- if (rep == nullptr) {
- ResetToEmpty();
+inline cord_internal::CordRepFlat* Cord::InlineRep::MakeFlatWithExtraCapacity(
+ size_t extra) {
+ static_assert(cord_internal::kMinFlatLength >= sizeof(data_), "");
+ size_t len = data_.inline_size();
+ auto* result = CordRepFlat::New(len + extra);
+ result->length = len;
+ memcpy(result->Data(), data_.as_chars(), sizeof(data_));
+ return result;
+}
+
+inline void Cord::InlineRep::EmplaceTree(CordRep* rep,
+ MethodIdentifier method) {
+ assert(rep);
+ data_.make_tree(rep);
+ CordzInfo::MaybeTrackCord(data_, method);
+}
+
+inline void Cord::InlineRep::EmplaceTree(CordRep* rep, const InlineData& parent,
+ MethodIdentifier method) {
+ data_.make_tree(rep);
+ CordzInfo::MaybeTrackCord(data_, parent, method);
+}
+
+inline void Cord::InlineRep::SetTree(CordRep* rep,
+ const CordzUpdateScope& scope) {
+ assert(rep);
+ assert(data_.is_tree());
+ data_.set_tree(rep);
+ scope.SetCordRep(rep);
+}
+
+inline void Cord::InlineRep::SetTreeOrEmpty(CordRep* rep,
+ const CordzUpdateScope& scope) {
+ assert(data_.is_tree());
+ if (rep) {
+ data_.set_tree(rep);
} else {
- if (data_.is_tree()) {
- // `data_` already holds a 'tree' value and an optional cordz_info value.
- // Replace the tree value only, leaving the cordz_info value unchanged.
- data_.set_tree(rep);
- } else {
- // `data_` contains inlined data: initialize data_ to tree value `rep`.
- data_.make_tree(rep);
- }
+ data_ = {};
}
+ scope.SetCordRep(rep);
}
-inline void Cord::InlineRep::replace_tree(absl::cord_internal::CordRep* rep) {
- ABSL_ASSERT(is_tree());
- if (ABSL_PREDICT_FALSE(rep == nullptr)) {
- set_tree(rep);
- return;
+inline void Cord::InlineRep::CommitTree(const CordRep* old_rep, CordRep* rep,
+ const CordzUpdateScope& scope,
+ MethodIdentifier method) {
+ if (old_rep) {
+ SetTree(rep, scope);
+ } else {
+ EmplaceTree(rep, method);
}
- data_.set_tree(rep);
}
inline absl::cord_internal::CordRep* Cord::InlineRep::clear() {
+ if (is_tree()) {
+ CordzInfo::MaybeUntrackCord(cordz_info());
+ }
absl::cord_internal::CordRep* result = tree();
ResetToEmpty();
return result;
@@ -1042,6 +1158,9 @@ inline void Cord::InlineRep::CopyToArray(char* dst) const {
constexpr inline Cord::Cord() noexcept {}
+inline Cord::Cord(absl::string_view src)
+ : Cord(src, CordzUpdateTracker::kConstructorString) {}
+
template <typename T>
constexpr Cord::Cord(strings_internal::StringConstant<T>)
: contents_(strings_internal::StringConstant<T>::value.size() <=
@@ -1057,6 +1176,15 @@ inline Cord& Cord::operator=(const Cord& x) {
return *this;
}
+template <typename T, Cord::EnableIfString<T>>
+Cord& Cord::operator=(T&& src) {
+ if (src.size() <= cord_internal::kMaxBytesToCopy) {
+ return operator=(absl::string_view(src));
+ } else {
+ return AssignLargeString(std::forward<T>(src));
+ }
+}
+
inline Cord::Cord(const Cord& src) : contents_(src.contents_) {}
inline Cord::Cord(Cord&& src) noexcept : contents_(std::move(src.contents_)) {}
@@ -1071,7 +1199,6 @@ inline Cord& Cord::operator=(Cord&& x) noexcept {
}
extern template Cord::Cord(std::string&& src);
-extern template Cord& Cord::operator=(std::string&& src);
inline size_t Cord::size() const {
// Length is 1st field in str.rep_
@@ -1114,7 +1241,11 @@ inline absl::string_view Cord::Flatten() {
}
inline void Cord::Append(absl::string_view src) {
- contents_.AppendArray(src.data(), src.size());
+ contents_.AppendArray(src, CordzUpdateTracker::kAppendString);
+}
+
+inline void Cord::Prepend(absl::string_view src) {
+ PrependArray(src, CordzUpdateTracker::kPrependString);
}
extern template void Cord::Append(std::string&& src);
@@ -1143,8 +1274,8 @@ inline bool Cord::StartsWith(absl::string_view rhs) const {
}
inline void Cord::ChunkIterator::InitTree(cord_internal::CordRep* tree) {
- if (tree->tag == cord_internal::RING) {
- current_chunk_ = ring_reader_.Reset(tree->ring());
+ if (tree->tag == cord_internal::BTREE) {
+ current_chunk_ = btree_reader_.Init(tree->btree());
return;
}
@@ -1167,20 +1298,20 @@ inline Cord::ChunkIterator::ChunkIterator(const Cord* cord)
}
}
-inline Cord::ChunkIterator& Cord::ChunkIterator::AdvanceRing() {
- current_chunk_ = ring_reader_.Next();
+inline Cord::ChunkIterator& Cord::ChunkIterator::AdvanceBtree() {
+ current_chunk_ = btree_reader_.Next();
return *this;
}
-inline void Cord::ChunkIterator::AdvanceBytesRing(size_t n) {
+inline void Cord::ChunkIterator::AdvanceBytesBtree(size_t n) {
assert(n >= current_chunk_.size());
bytes_remaining_ -= n;
if (bytes_remaining_) {
if (n == current_chunk_.size()) {
- current_chunk_ = ring_reader_.Next();
+ current_chunk_ = btree_reader_.Next();
} else {
- size_t offset = ring_reader_.length() - bytes_remaining_;
- current_chunk_ = ring_reader_.Seek(offset);
+ size_t offset = btree_reader_.length() - bytes_remaining_;
+ current_chunk_ = btree_reader_.Seek(offset);
}
} else {
current_chunk_ = {};
@@ -1193,7 +1324,7 @@ inline Cord::ChunkIterator& Cord::ChunkIterator::operator++() {
assert(bytes_remaining_ >= current_chunk_.size());
bytes_remaining_ -= current_chunk_.size();
if (bytes_remaining_ > 0) {
- return ring_reader_ ? AdvanceRing() : AdvanceStack();
+ return btree_reader_ ? AdvanceBtree() : AdvanceStack();
} else {
current_chunk_ = {};
}
@@ -1235,7 +1366,7 @@ inline void Cord::ChunkIterator::AdvanceBytes(size_t n) {
if (ABSL_PREDICT_TRUE(n < current_chunk_.size())) {
RemoveChunkPrefix(n);
} else if (n != 0) {
- ring_reader_ ? AdvanceBytesRing(n) : AdvanceBytesSlowPath(n);
+ btree_reader_ ? AdvanceBytesBtree(n) : AdvanceBytesSlowPath(n);
}
}
@@ -1335,12 +1466,8 @@ inline bool operator==(const Cord& lhs, const Cord& rhs) {
}
inline bool operator!=(const Cord& x, const Cord& y) { return !(x == y); }
-inline bool operator<(const Cord& x, const Cord& y) {
- return x.Compare(y) < 0;
-}
-inline bool operator>(const Cord& x, const Cord& y) {
- return x.Compare(y) > 0;
-}
+inline bool operator<(const Cord& x, const Cord& y) { return x.Compare(y) < 0; }
+inline bool operator>(const Cord& x, const Cord& y) { return x.Compare(y) > 0; }
inline bool operator<=(const Cord& x, const Cord& y) {
return x.Compare(y) <= 0;
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord_ring_reader_test.cc b/grpc/third_party/abseil-cpp/absl/strings/cord_ring_reader_test.cc
index 585616f3..d9a9a76d 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord_ring_reader_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord_ring_reader_test.cc
@@ -78,6 +78,7 @@ TEST(CordRingReaderTest, Reset) {
EXPECT_TRUE(static_cast<bool>(reader));
EXPECT_THAT(reader.ring(), Eq(ring));
EXPECT_THAT(reader.index(), Eq(ring->head()));
+ EXPECT_THAT(reader.node(), Eq(ring->entry_child(ring->head())));
EXPECT_THAT(reader.length(), Eq(ring->length));
EXPECT_THAT(reader.consumed(), Eq(flats[0].length()));
EXPECT_THAT(reader.remaining(), Eq(ring->length - reader.consumed()));
@@ -99,11 +100,13 @@ TEST(CordRingReaderTest, Next) {
size_t consumed = reader.consumed();
size_t remaining = reader.remaining();
for (int i = 1; i < flats.size(); ++i) {
+ CordRepRing::index_type index = ring->advance(head, i);
consumed += flats[i].length();
remaining -= flats[i].length();
absl::string_view next = reader.Next();
ASSERT_THAT(next, Eq(flats[i]));
- ASSERT_THAT(reader.index(), Eq(ring->advance(head, i)));
+ ASSERT_THAT(reader.index(), Eq(index));
+ ASSERT_THAT(reader.node(), Eq(ring->entry_child(index)));
ASSERT_THAT(reader.consumed(), Eq(consumed));
ASSERT_THAT(reader.remaining(), Eq(remaining));
}
@@ -125,13 +128,15 @@ TEST(CordRingReaderTest, SeekForward) {
size_t consumed = 0;
size_t remaining = ring->length;;
for (int i = 0; i < flats.size(); ++i) {
+ CordRepRing::index_type index = ring->advance(head, i);
size_t offset = consumed;
consumed += flats[i].length();
remaining -= flats[i].length();
for (int off = 0; off < flats[i].length(); ++off) {
absl::string_view chunk = reader.Seek(offset + off);
ASSERT_THAT(chunk, Eq(flats[i].substr(off)));
- ASSERT_THAT(reader.index(), Eq(ring->advance(head, i)));
+ ASSERT_THAT(reader.index(), Eq(index));
+ ASSERT_THAT(reader.node(), Eq(ring->entry_child(index)));
ASSERT_THAT(reader.consumed(), Eq(consumed));
ASSERT_THAT(reader.remaining(), Eq(remaining));
}
@@ -150,11 +155,13 @@ TEST(CordRingReaderTest, SeekBackward) {
size_t consumed = ring->length;
size_t remaining = 0;
for (int i = flats.size() - 1; i >= 0; --i) {
+ CordRepRing::index_type index = ring->advance(head, i);
size_t offset = consumed - flats[i].length();
for (int off = 0; off < flats[i].length(); ++off) {
absl::string_view chunk = reader.Seek(offset + off);
ASSERT_THAT(chunk, Eq(flats[i].substr(off)));
- ASSERT_THAT(reader.index(), Eq(ring->advance(head, i)));
+ ASSERT_THAT(reader.index(), Eq(index));
+ ASSERT_THAT(reader.node(), Eq(ring->entry_child(index)));
ASSERT_THAT(reader.consumed(), Eq(consumed));
ASSERT_THAT(reader.remaining(), Eq(remaining));
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord_ring_test.cc b/grpc/third_party/abseil-cpp/absl/strings/cord_ring_test.cc
index 7d75e106..f1318595 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord_ring_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord_ring_test.cc
@@ -31,9 +31,6 @@
extern thread_local bool cord_ring;
-// TOOD(b/177688959): weird things happened with the original test
-#define ASAN_BUG_177688959_FIXED false
-
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
@@ -101,15 +98,22 @@ using TestParams = std::vector<TestParam>;
// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivate, param, rep,
absl::StrCat("Equal 0x", absl::Hex(rep), " if private")) {
- return param.refcount_is_one ? arg == rep : arg != rep;
+ return param.refcount_is_one ? arg == rep : true;
}
// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivateAndCapacity, param, rep,
absl::StrCat("Equal 0x", absl::Hex(rep),
" if private and capacity")) {
- return (param.refcount_is_one && param.with_capacity) ? arg == rep
- : arg != rep;
+ return (param.refcount_is_one && param.with_capacity) ? arg == rep : true;
+}
+
+// Matcher validating a shared ring was re-allocated. Should only be used for
+// tests doing exactly one update as subsequent updates could return the
+// original (freed and re-used) pointer.
+MATCHER_P2(NeIfShared, param, rep,
+ absl::StrCat("Not equal 0x", absl::Hex(rep), " if shared")) {
+ return param.refcount_is_one ? true : arg != rep;
}
MATCHER_P2(EqIfInputPrivate, param, rep, "Equal if input is private") {
@@ -219,7 +223,7 @@ CordRepExternal* MakeFakeExternal(size_t length) {
std::string s;
explicit Rep(size_t len) {
this->tag = EXTERNAL;
- this->base = this->storage;
+ this->base = reinterpret_cast<const char*>(this->storage);
this->length = len;
this->releaser_invoker = [](CordRepExternal* self) {
delete static_cast<Rep*>(self);
@@ -271,7 +275,7 @@ CordRepConcat* MakeConcat(CordRep* left, CordRep* right, int depth = 0) {
enum Composition { kMix, kAppend, kPrepend };
Composition RandomComposition() {
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
return (rng() & 1) ? kMix : ((rng() & 1) ? kAppend : kPrepend);
}
@@ -340,19 +344,15 @@ std::string TestParamToString(const testing::TestParamInfo<TestParam>& info) {
class CordRingTest : public testing::Test {
public:
~CordRingTest() override {
-#if ASAN_BUG_177688959_FIXED
for (CordRep* rep : unrefs_) {
CordRep::Unref(rep);
}
-#endif
}
template <typename CordRepType>
CordRepType* NeedsUnref(CordRepType* rep) {
assert(rep);
-#if ASAN_BUG_177688959_FIXED
unrefs_.push_back(rep);
-#endif
return rep;
}
@@ -362,26 +362,16 @@ class CordRingTest : public testing::Test {
return NeedsUnref(rep);
}
- void Unref(CordRep* rep) {
-#if !ASAN_BUG_177688959_FIXED
- CordRep::Unref(rep);
-#endif
- }
-
private:
-#if ASAN_BUG_177688959_FIXED
std::vector<CordRep*> unrefs_;
-#endif
};
class CordRingTestWithParam : public testing::TestWithParam<TestParam> {
public:
~CordRingTestWithParam() override {
-#if ASAN_BUG_177688959_FIXED
for (CordRep* rep : unrefs_) {
CordRep::Unref(rep);
}
-#endif
}
CordRepRing* CreateWithCapacity(CordRep* child, size_t extra_capacity) {
@@ -400,9 +390,7 @@ class CordRingTestWithParam : public testing::TestWithParam<TestParam> {
template <typename CordRepType>
CordRepType* NeedsUnref(CordRepType* rep) {
assert(rep);
-#if ASAN_BUG_177688959_FIXED
unrefs_.push_back(rep);
-#endif
return rep;
}
@@ -412,43 +400,23 @@ class CordRingTestWithParam : public testing::TestWithParam<TestParam> {
return NeedsUnref(rep);
}
- void Unref(CordRep* rep) {
-#if !ASAN_BUG_177688959_FIXED
- CordRep::Unref(rep);
-#endif
- }
-
template <typename CordRepType>
CordRepType* RefIfShared(CordRepType* rep) {
return Shared() ? Ref(rep) : rep;
}
- void UnrefIfShared(CordRep* rep) {
- if (Shared()) Unref(rep);
- }
-
template <typename CordRepType>
CordRepType* RefIfInputShared(CordRepType* rep) {
return InputShared() ? Ref(rep) : rep;
}
- void UnrefIfInputShared(CordRep* rep) {
- if (InputShared()) Unref(rep);
- }
-
template <typename CordRepType>
CordRepType* RefIfInputSharedIndirect(CordRepType* rep) {
return InputSharedIndirect() ? Ref(rep) : rep;
}
- void UnrefIfInputSharedIndirect(CordRep* rep) {
- if (InputSharedIndirect()) Unref(rep);
- }
-
private:
-#if ASAN_BUG_177688959_FIXED
std::vector<CordRep*> unrefs_;
-#endif
};
class CordRingCreateTest : public CordRingTestWithParam {
@@ -520,26 +488,26 @@ class CordRingBuildInputTest : public CordRingTestWithParam {
}
};
-INSTANTIATE_TEST_CASE_P(WithParam, CordRingSubTest,
- testing::ValuesIn(CordRingSubTest::CreateTestParams()),
- TestParamToString);
+INSTANTIATE_TEST_SUITE_P(WithParam, CordRingSubTest,
+ testing::ValuesIn(CordRingSubTest::CreateTestParams()),
+ TestParamToString);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
WithParam, CordRingCreateTest,
testing::ValuesIn(CordRingCreateTest::CreateTestParams()),
TestParamToString);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
WithParam, CordRingCreateFromTreeTest,
testing::ValuesIn(CordRingCreateFromTreeTest::CreateTestParams()),
TestParamToString);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
WithParam, CordRingBuildTest,
testing::ValuesIn(CordRingBuildTest::CreateTestParams()),
TestParamToString);
-INSTANTIATE_TEST_CASE_P(
+INSTANTIATE_TEST_SUITE_P(
WithParam, CordRingBuildInputTest,
testing::ValuesIn(CordRingBuildInputTest::CreateTestParams()),
TestParamToString);
@@ -550,7 +518,6 @@ TEST_P(CordRingCreateTest, CreateFromFlat) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str1.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str1));
- Unref(result);
}
TEST_P(CordRingCreateTest, CreateFromRing) {
@@ -558,9 +525,8 @@ TEST_P(CordRingCreateTest, CreateFromRing) {
CordRepRing* result = NeedsUnref(CordRepRing::Create(ring));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAreArray(kFoxFlats));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringRing) {
@@ -570,23 +536,20 @@ TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringRing) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfInputPrivate(GetParam(), ring));
EXPECT_THAT(ToString(result), string_view(kFox).substr(2, 11));
- UnrefIfInputSharedIndirect(ring);
- UnrefIfInputShared(sub);
- Unref(result);
}
TEST_F(CordRingTest, CreateWithIllegalExtraCapacity) {
- CordRep* flat = NeedsUnref(MakeFlat("Hello world"));
#if defined(ABSL_HAVE_EXCEPTIONS)
+ CordRep* flat = NeedsUnref(MakeFlat("Hello world"));
try {
CordRepRing::Create(flat, CordRepRing::kMaxCapacity);
GTEST_FAIL() << "expected std::length_error exception";
} catch (const std::length_error&) {
}
#elif defined(GTEST_HAS_DEATH_TEST)
+ CordRep* flat = NeedsUnref(MakeFlat("Hello world"));
EXPECT_DEATH(CordRepRing::Create(flat, CordRepRing::kMaxCapacity), ".*");
#endif
- Unref(flat);
}
TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfFlat) {
@@ -597,9 +560,6 @@ TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfFlat) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(20));
EXPECT_THAT(ToFlats(result), ElementsAre(str1.substr(4, 20)));
- Unref(result);
- UnrefIfInputShared(flat);
- UnrefIfInputSharedIndirect(child);
}
TEST_P(CordRingCreateTest, CreateFromExternal) {
@@ -609,8 +569,6 @@ TEST_P(CordRingCreateTest, CreateFromExternal) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str1.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str1));
- Unref(result);
- UnrefIfInputShared(child);
}
TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfExternal) {
@@ -621,9 +579,6 @@ TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfExternal) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(24));
EXPECT_THAT(ToFlats(result), ElementsAre(str1.substr(1, 24)));
- Unref(result);
- UnrefIfInputShared(external);
- UnrefIfInputSharedIndirect(child);
}
TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfLargeExternal) {
@@ -637,9 +592,6 @@ TEST_P(CordRingCreateFromTreeTest, CreateFromSubstringOfLargeExternal) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str.size()));
EXPECT_THAT(ToRawFlats(result), ElementsAre(str));
- Unref(result);
- UnrefIfInputShared(external);
- UnrefIfInputSharedIndirect(child);
}
TEST_P(CordRingBuildInputTest, CreateFromConcat) {
@@ -652,10 +604,6 @@ TEST_P(CordRingBuildInputTest, CreateFromConcat) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(26));
EXPECT_THAT(ToString(result), Eq(kAlphabet));
- UnrefIfInputSharedIndirect(flats[0]);
- UnrefIfInputSharedIndirect(flats[3]);
- UnrefIfInputShared(concat);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, CreateFromSubstringConcat) {
@@ -671,10 +619,6 @@ TEST_P(CordRingBuildInputTest, CreateFromSubstringConcat) {
ASSERT_THAT(result, IsValidRingBuffer());
ASSERT_THAT(result->length, Eq(len));
ASSERT_THAT(ToString(result), string_view(kAlphabet).substr(off, len));
- UnrefIfInputSharedIndirect(flats[0]);
- UnrefIfInputSharedIndirect(flats[3]);
- UnrefIfInputShared(child);
- Unref(result);
}
}
}
@@ -689,7 +633,6 @@ TEST_P(CordRingCreateTest, Properties) {
EXPECT_THAT(result->capacity(), Le(2 * 120 + 1));
EXPECT_THAT(result->entries(), Eq(1));
EXPECT_THAT(result->begin_pos(), Eq(0));
- Unref(result);
}
TEST_P(CordRingCreateTest, EntryForNewFlat) {
@@ -700,7 +643,6 @@ TEST_P(CordRingCreateTest, EntryForNewFlat) {
EXPECT_THAT(result->entry_child(0), Eq(child));
EXPECT_THAT(result->entry_end_pos(0), Eq(str1.length()));
EXPECT_THAT(result->entry_data_offset(0), Eq(0));
- Unref(result);
}
TEST_P(CordRingCreateTest, EntryForNewFlatSubstring) {
@@ -712,7 +654,6 @@ TEST_P(CordRingCreateTest, EntryForNewFlatSubstring) {
EXPECT_THAT(result->entry_child(0), Eq(child));
EXPECT_THAT(result->entry_end_pos(0), Eq(26));
EXPECT_THAT(result->entry_data_offset(0), Eq(10));
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendFlat) {
@@ -722,10 +663,9 @@ TEST_P(CordRingBuildTest, AppendFlat) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, MakeFlat(str2)));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str1, str2));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, PrependFlat) {
@@ -735,10 +675,9 @@ TEST_P(CordRingBuildTest, PrependFlat) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, MakeFlat(str2)));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str2, str1));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendString) {
@@ -748,10 +687,9 @@ TEST_P(CordRingBuildTest, AppendString) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, str2));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str1, str2));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendStringHavingExtra) {
@@ -762,8 +700,7 @@ TEST_P(CordRingBuildTest, AppendStringHavingExtra) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
- UnrefIfShared(ring);
- Unref(result);
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
}
TEST_P(CordRingBuildTest, AppendStringHavingPartialExtra) {
@@ -785,13 +722,12 @@ TEST_P(CordRingBuildTest, AppendStringHavingPartialExtra) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
if (GetParam().refcount_is_one) {
EXPECT_THAT(ToFlats(result), ElementsAre(StrCat(str1, str1a), str2a));
} else {
EXPECT_THAT(ToFlats(result), ElementsAre(str1, str2));
}
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendStringHavingExtraInSubstring) {
@@ -802,14 +738,13 @@ TEST_P(CordRingBuildTest, AppendStringHavingExtraInSubstring) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, str2));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(4 + str2.size()));
if (GetParam().refcount_is_one) {
EXPECT_THAT(ToFlats(result), ElementsAre(StrCat("1234", str2)));
} else {
EXPECT_THAT(ToFlats(result), ElementsAre("1234", str2));
}
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendStringHavingSharedExtra) {
@@ -837,10 +772,9 @@ TEST_P(CordRingBuildTest, AppendStringHavingSharedExtra) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, str2));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(4 + str2.size()));
EXPECT_THAT(ToFlats(result), ElementsAre("1234", str2));
- UnrefIfShared(ring);
- Unref(result);
CordRep::Unref(shared_type == 1 ? flat1 : flat);
}
@@ -857,8 +791,6 @@ TEST_P(CordRingBuildTest, AppendStringWithExtra) {
EXPECT_THAT(result->length, Eq(str1.size() + str2.size() + str3.size()));
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre(str1, StrCat(str2, str3)));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, PrependString) {
@@ -875,8 +807,6 @@ TEST_P(CordRingBuildTest, PrependString) {
}
EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
EXPECT_THAT(ToFlats(result), ElementsAre(str2, str1));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, PrependStringHavingExtra) {
@@ -887,14 +817,13 @@ TEST_P(CordRingBuildTest, PrependStringHavingExtra) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, str2));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(result->length, Eq(4 + str2.size()));
if (GetParam().refcount_is_one) {
EXPECT_THAT(ToFlats(result), ElementsAre(StrCat(str2, "1234")));
} else {
EXPECT_THAT(ToFlats(result), ElementsAre(str2, "1234"));
}
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, PrependStringHavingSharedExtra) {
@@ -920,9 +849,8 @@ TEST_P(CordRingBuildTest, PrependStringHavingSharedExtra) {
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result->length, Eq(str1a.size() + str2.size()));
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre(str2, str1a));
- UnrefIfShared(ring);
- Unref(result);
CordRep::Unref(shared_type == 1 ? flat1 : flat);
}
}
@@ -938,8 +866,6 @@ TEST_P(CordRingBuildTest, PrependStringWithExtra) {
EXPECT_THAT(result->length, Eq(str1.size() + str2.size() + str3.size()));
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre(StrCat(str3, str2), str1));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendPrependStringMix) {
@@ -950,12 +876,10 @@ TEST_P(CordRingBuildTest, AppendPrependStringMix) {
result = CordRepRing::Prepend(result, flats[4 - i]);
result = CordRepRing::Append(result, flats[4 + i]);
}
- UnrefIfShared(ring);
NeedsUnref(result);
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
EXPECT_THAT(ToString(result), kFox);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendPrependStringMixWithExtra) {
@@ -976,8 +900,6 @@ TEST_P(CordRingBuildTest, AppendPrependStringMixWithExtra) {
EXPECT_THAT(ToFlats(result), ElementsAre("The quick brown fox ", "jumps ",
"over the lazy dog"));
}
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendPrependStringMixWithPrependedExtra) {
@@ -998,8 +920,6 @@ TEST_P(CordRingBuildTest, AppendPrependStringMixWithPrependedExtra) {
EXPECT_THAT(ToFlats(result), ElementsAre("The quick brown fox ", "jumps ",
"over the lazy dog"));
}
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingSubTest, SubRing) {
@@ -1011,16 +931,14 @@ TEST_P(CordRingSubTest, SubRing) {
CordRepRing* ring = RefIfShared(FromFlats(flats, composition));
CordRepRing* result = CordRepRing::SubRing(ring, offset, 0);
EXPECT_THAT(result, nullptr);
- UnrefIfShared(ring);
for (size_t len = 1; len < all.size() - offset; ++len) {
ring = RefIfShared(FromFlats(flats, composition));
result = NeedsUnref(CordRepRing::SubRing(ring, offset, len));
ASSERT_THAT(result, IsValidRingBuffer());
ASSERT_THAT(result, EqIfPrivate(GetParam(), ring));
+ ASSERT_THAT(result, NeIfShared(GetParam(), ring));
ASSERT_THAT(ToString(result), Eq(all.substr(offset, len)));
- UnrefIfShared(ring);
- Unref(result);
}
}
}
@@ -1039,18 +957,16 @@ TEST_P(CordRingSubTest, SubRingFromLargeExternal) {
CordRepRing* ring = RefIfShared(FromFlats(flats, composition));
CordRepRing* result = CordRepRing::SubRing(ring, offset, 0);
EXPECT_THAT(result, nullptr);
- UnrefIfShared(ring);
for (size_t len = all.size() - 30; len < all.size() - offset; ++len) {
ring = RefIfShared(FromFlats(flats, composition));
result = NeedsUnref(CordRepRing::SubRing(ring, offset, len));
ASSERT_THAT(result, IsValidRingBuffer());
ASSERT_THAT(result, EqIfPrivate(GetParam(), ring));
+ ASSERT_THAT(result, NeIfShared(GetParam(), ring));
auto str = ToString(result);
ASSERT_THAT(str, SizeIs(len));
ASSERT_THAT(str, Eq(all.substr(offset, len)));
- UnrefIfShared(ring);
- Unref(result);
}
}
}
@@ -1063,16 +979,14 @@ TEST_P(CordRingSubTest, RemovePrefix) {
CordRepRing* ring = RefIfShared(FromFlats(flats, composition));
CordRepRing* result = CordRepRing::RemovePrefix(ring, all.size());
EXPECT_THAT(result, nullptr);
- UnrefIfShared(ring);
for (size_t len = 1; len < all.size(); ++len) {
ring = RefIfShared(FromFlats(flats, composition));
result = NeedsUnref(CordRepRing::RemovePrefix(ring, len));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
+ ASSERT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToString(result), Eq(all.substr(len)));
- UnrefIfShared(ring);
- Unref(result);
}
}
@@ -1087,7 +1001,6 @@ TEST_P(CordRingSubTest, RemovePrefixFromLargeExternal) {
ElementsAre(
not_a_string_view(external1->base, 1 << 20).remove_prefix(1 << 16),
not_a_string_view(external2->base, 1 << 20)));
- Unref(result);
}
TEST_P(CordRingSubTest, RemoveSuffix) {
@@ -1098,16 +1011,14 @@ TEST_P(CordRingSubTest, RemoveSuffix) {
CordRepRing* ring = RefIfShared(FromFlats(flats, composition));
CordRepRing* result = CordRepRing::RemoveSuffix(ring, all.size());
EXPECT_THAT(result, nullptr);
- UnrefIfShared(ring);
for (size_t len = 1; len < all.size(); ++len) {
ring = RefIfShared(FromFlats(flats, composition));
result = NeedsUnref(CordRepRing::RemoveSuffix(ring, len));
ASSERT_THAT(result, IsValidRingBuffer());
- EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
- EXPECT_THAT(ToString(result), Eq(all.substr(0, all.size() - len)));
- UnrefIfShared(ring);
- Unref(result);
+ ASSERT_THAT(result, EqIfPrivate(GetParam(), ring));
+ ASSERT_THAT(result, NeIfShared(GetParam(), ring));
+ ASSERT_THAT(ToString(result), Eq(all.substr(0, all.size() - len)));
}
}
@@ -1120,9 +1031,8 @@ TEST_P(CordRingSubTest, AppendRing) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, child));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAreArray(kFoxFlats));
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, AppendRingWithFlatOffset) {
@@ -1135,11 +1045,9 @@ TEST_P(CordRingBuildInputTest, AppendRingWithFlatOffset) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("Head", "brown ", "fox ", "jumps ",
"over ", "the ", "lazy ", "dog"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, AppendRingWithBrokenOffset) {
@@ -1152,11 +1060,9 @@ TEST_P(CordRingBuildInputTest, AppendRingWithBrokenOffset) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result),
ElementsAre("Head", "umps ", "over ", "the ", "lazy ", "dog"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, AppendRingWithFlatLength) {
@@ -1169,11 +1075,9 @@ TEST_P(CordRingBuildInputTest, AppendRingWithFlatLength) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("Head", "The ", "quick ", "brown ",
"fox ", "jumps ", "over ", "the "));
- UnrefIfInputSharedIndirect(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendRingWithBrokenFlatLength) {
@@ -1186,11 +1090,9 @@ TEST_P(CordRingBuildTest, AppendRingWithBrokenFlatLength) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("Head", "The ", "quick ", "brown ",
"fox ", "jumps ", "ov"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendRingMiddlePiece) {
@@ -1203,11 +1105,9 @@ TEST_P(CordRingBuildTest, AppendRingMiddlePiece) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result),
ElementsAre("Head", "ck ", "brown ", "fox ", "jum"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildTest, AppendRingSinglePiece) {
@@ -1220,11 +1120,8 @@ TEST_P(CordRingBuildTest, AppendRingSinglePiece) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("Head", "row"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfInputShared(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, AppendRingSinglePieceWithPrefix) {
@@ -1241,11 +1138,8 @@ TEST_P(CordRingBuildInputTest, AppendRingSinglePieceWithPrefix) {
CordRepRing* result = NeedsUnref(CordRepRing::Append(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("Prepend", "Head", "row"));
- UnrefIfInputSharedIndirect(child);
- UnrefIfInputShared(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRing) {
@@ -1258,10 +1152,8 @@ TEST_P(CordRingBuildInputTest, PrependRing) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, child));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAreArray(kFoxFlats));
- UnrefIfInputShared(child);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingWithFlatOffset) {
@@ -1274,12 +1166,9 @@ TEST_P(CordRingBuildInputTest, PrependRingWithFlatOffset) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("brown ", "fox ", "jumps ", "over ",
"the ", "lazy ", "dog", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingWithBrokenOffset) {
@@ -1291,12 +1180,9 @@ TEST_P(CordRingBuildInputTest, PrependRingWithBrokenOffset) {
CordRep* stripped = RefIfInputSharedIndirect(RemovePrefix(21, child));
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result),
ElementsAre("umps ", "over ", "the ", "lazy ", "dog", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingWithFlatLength) {
@@ -1309,12 +1195,9 @@ TEST_P(CordRingBuildInputTest, PrependRingWithFlatLength) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("The ", "quick ", "brown ", "fox ",
"jumps ", "over ", "the ", "Tail"));
- UnrefIfShared(ring);
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingWithBrokenFlatLength) {
@@ -1327,12 +1210,9 @@ TEST_P(CordRingBuildInputTest, PrependRingWithBrokenFlatLength) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("The ", "quick ", "brown ", "fox ",
"jumps ", "ov", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingMiddlePiece) {
@@ -1346,12 +1226,9 @@ TEST_P(CordRingBuildInputTest, PrependRingMiddlePiece) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result),
ElementsAre("ck ", "brown ", "fox ", "jum", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingSinglePiece) {
@@ -1364,11 +1241,8 @@ TEST_P(CordRingBuildInputTest, PrependRingSinglePiece) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("row", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_P(CordRingBuildInputTest, PrependRingSinglePieceWithPrefix) {
@@ -1384,11 +1258,8 @@ TEST_P(CordRingBuildInputTest, PrependRingSinglePieceWithPrefix) {
CordRepRing* result = NeedsUnref(CordRepRing::Prepend(ring, stripped));
ASSERT_THAT(result, IsValidRingBuffer());
EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
+ EXPECT_THAT(result, NeIfShared(GetParam(), ring));
EXPECT_THAT(ToFlats(result), ElementsAre("row", "Prepend", "Tail"));
- UnrefIfInputShared(child);
- UnrefIfInputSharedIndirect(stripped);
- UnrefIfShared(ring);
- Unref(result);
}
TEST_F(CordRingTest, Find) {
@@ -1406,7 +1277,6 @@ TEST_F(CordRingTest, Find) {
ASSERT_THAT(found.offset, Lt(data.length()));
ASSERT_THAT(data[found.offset], Eq(value[i]));
}
- Unref(ring);
}
TEST_F(CordRingTest, FindWithHint) {
@@ -1442,7 +1312,6 @@ TEST_F(CordRingTest, FindWithHint) {
++flat_pos;
flat_offset += flat.length();
}
- Unref(ring);
}
TEST_F(CordRingTest, FindInLargeRing) {
@@ -1464,7 +1333,6 @@ TEST_F(CordRingTest, FindInLargeRing) {
ASSERT_THAT(pos.offset, Lt(data.length()));
ASSERT_THAT(data[pos.offset], Eq(value[i]));
}
- Unref(ring);
}
TEST_F(CordRingTest, FindTail) {
@@ -1483,7 +1351,6 @@ TEST_F(CordRingTest, FindTail) {
ASSERT_THAT(pos.offset, Lt(data.length()));
ASSERT_THAT(data[data.length() - pos.offset - 1], Eq(value[i]));
}
- Unref(ring);
}
TEST_F(CordRingTest, FindTailWithHint) {
@@ -1510,7 +1377,6 @@ TEST_F(CordRingTest, FindTailWithHint) {
ASSERT_THAT(pos.offset, Lt(data.length()));
ASSERT_THAT(data[data.length() - pos.offset - 1], Eq(value[i]));
}
- Unref(ring);
}
TEST_F(CordRingTest, FindTailInLargeRing) {
@@ -1532,7 +1398,6 @@ TEST_F(CordRingTest, FindTailInLargeRing) {
ASSERT_THAT(pos.offset, Lt(data.length()));
ASSERT_THAT(data[data.length() - pos.offset - 1], Eq(value[i]));
}
- Unref(ring);
}
TEST_F(CordRingTest, GetCharacter) {
@@ -1544,7 +1409,6 @@ TEST_F(CordRingTest, GetCharacter) {
for (int i = 0; i < value.length(); ++i) {
ASSERT_THAT(result->GetCharacter(i), Eq(value[i]));
}
- Unref(result);
}
TEST_F(CordRingTest, GetCharacterWithSubstring) {
@@ -1556,7 +1420,67 @@ TEST_F(CordRingTest, GetCharacterWithSubstring) {
for (int i = 0; i < value.length(); ++i) {
ASSERT_THAT(result->GetCharacter(i), Eq(value[i]));
}
- Unref(result);
+}
+
+TEST_F(CordRingTest, IsFlatSingleFlat) {
+ for (bool external : {false, true}) {
+ SCOPED_TRACE(external ? "With External" : "With Flat");
+ absl::string_view str = "Hello world";
+ CordRep* rep = external ? MakeExternal(str) : MakeFlat(str);
+ CordRepRing* ring = NeedsUnref(CordRepRing::Create(rep));
+
+ // The ring is a single non-fragmented flat:
+ absl::string_view fragment;
+ EXPECT_TRUE(ring->IsFlat(nullptr));
+ EXPECT_TRUE(ring->IsFlat(&fragment));
+ EXPECT_THAT(fragment, Eq("Hello world"));
+ fragment = "";
+ EXPECT_TRUE(ring->IsFlat(0, 11, nullptr));
+ EXPECT_TRUE(ring->IsFlat(0, 11, &fragment));
+ EXPECT_THAT(fragment, Eq("Hello world"));
+
+ // Arbitrary ranges must check true as well.
+ EXPECT_TRUE(ring->IsFlat(1, 4, &fragment));
+ EXPECT_THAT(fragment, Eq("ello"));
+ EXPECT_TRUE(ring->IsFlat(6, 5, &fragment));
+ EXPECT_THAT(fragment, Eq("world"));
+ }
+}
+
+TEST_F(CordRingTest, IsFlatMultiFlat) {
+ for (bool external : {false, true}) {
+ SCOPED_TRACE(external ? "With External" : "With Flat");
+ absl::string_view str1 = "Hello world";
+ absl::string_view str2 = "Halt and catch fire";
+ CordRep* rep1 = external ? MakeExternal(str1) : MakeFlat(str1);
+ CordRep* rep2 = external ? MakeExternal(str2) : MakeFlat(str2);
+ CordRepRing* ring = CordRepRing::Append(CordRepRing::Create(rep1), rep2);
+ NeedsUnref(ring);
+
+ // The ring is fragmented, IsFlat() on the entire cord must be false.
+ EXPECT_FALSE(ring->IsFlat(nullptr));
+ absl::string_view fragment = "Don't touch this";
+ EXPECT_FALSE(ring->IsFlat(&fragment));
+ EXPECT_THAT(fragment, Eq("Don't touch this"));
+
+ // Check for ranges exactly within both flats.
+ EXPECT_TRUE(ring->IsFlat(0, 11, &fragment));
+ EXPECT_THAT(fragment, Eq("Hello world"));
+ EXPECT_TRUE(ring->IsFlat(11, 19, &fragment));
+ EXPECT_THAT(fragment, Eq("Halt and catch fire"));
+
+ // Check for arbitrary partial range inside each flat.
+ EXPECT_TRUE(ring->IsFlat(1, 4, &fragment));
+ EXPECT_THAT(fragment, "ello");
+ EXPECT_TRUE(ring->IsFlat(26, 4, &fragment));
+ EXPECT_THAT(fragment, "fire");
+
+ // Check ranges spanning across both flats
+ fragment = "Don't touch this";
+ EXPECT_FALSE(ring->IsFlat(1, 18, &fragment));
+ EXPECT_FALSE(ring->IsFlat(10, 2, &fragment));
+ EXPECT_THAT(fragment, Eq("Don't touch this"));
+ }
}
TEST_F(CordRingTest, Dump) {
@@ -1564,7 +1488,6 @@ TEST_F(CordRingTest, Dump) {
auto flats = MakeSpan(kFoxFlats);
CordRepRing* ring = NeedsUnref(FromFlats(flats, kPrepend));
ss << *ring;
- Unref(ring);
}
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord_test.cc b/grpc/third_party/abseil-cpp/absl/strings/cord_test.cc
index f9982428..cced9bba 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord_test.cc
@@ -34,7 +34,9 @@
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h"
#include "absl/container/fixed_array.h"
+#include "absl/random/random.h"
#include "absl/strings/cord_test_helpers.h"
+#include "absl/strings/cordz_test_helpers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
@@ -187,12 +189,50 @@ class CordTestPeer {
static cord_internal::CordzInfo* GetCordzInfo(const Cord& c) {
return c.contents_.cordz_info();
}
+
+ static Cord MakeSubstring(Cord src, size_t offset, size_t length) {
+ ABSL_RAW_CHECK(src.contents_.is_tree(), "Can not be inlined");
+ Cord cord;
+ auto* rep = new cord_internal::CordRepSubstring;
+ rep->tag = cord_internal::SUBSTRING;
+ rep->child = cord_internal::CordRep::Ref(src.contents_.tree());
+ rep->start = offset;
+ rep->length = length;
+ cord.contents_.EmplaceTree(rep,
+ cord_internal::CordzUpdateTracker::kSubCord);
+ return cord;
+ }
};
ABSL_NAMESPACE_END
} // namespace absl
-TEST(Cord, AllFlatSizes) {
+// The CordTest fixture runs all tests with and without Cord Btree enabled.
+class CordTest : public testing::TestWithParam<bool> {
+ public:
+ CordTest() : was_btree_(absl::cord_internal::cord_btree_enabled.load()) {
+ absl::cord_internal::cord_btree_enabled.store(UseBtree());
+ }
+ ~CordTest() override {
+ absl::cord_internal::cord_btree_enabled.store(was_btree_);
+ }
+
+ // Returns true if test is running with btree enabled.
+ bool UseBtree() const { return GetParam(); }
+
+ // Returns human readable string representation of the test parameter.
+ static std::string ToString(testing::TestParamInfo<bool> param) {
+ return param.param ? "Btree" : "Concat";
+ }
+
+ private:
+ const bool was_btree_;
+};
+
+INSTANTIATE_TEST_SUITE_P(WithParam, CordTest, testing::Bool(),
+ CordTest::ToString);
+
+TEST_P(CordTest, AllFlatSizes) {
using absl::strings_internal::CordTestAccess;
for (size_t s = 0; s < CordTestAccess::MaxFlatLength(); s++) {
@@ -210,7 +250,7 @@ TEST(Cord, AllFlatSizes) {
// We create a Cord at least 128GB in size using the fact that Cords can
// internally reference-count; thus the Cord is enormous without actually
// consuming very much memory.
-TEST(GigabyteCord, FromExternal) {
+TEST_P(CordTest, GigabyteCordFromExternal) {
const size_t one_gig = 1024U * 1024U * 1024U;
size_t max_size = 2 * one_gig;
if (sizeof(max_size) > 4) max_size = 128 * one_gig;
@@ -227,7 +267,6 @@ TEST(GigabyteCord, FromExternal) {
// caused crashes in production. We grow exponentially so that the code will
// execute in a reasonable amount of time.
absl::Cord c;
- ABSL_RAW_LOG(INFO, "Made a Cord with %zu bytes!", c.size());
c.Append(from);
while (c.size() < max_size) {
c.Append(c);
@@ -260,7 +299,7 @@ static absl::Cord MakeExternalCord(int size) {
extern bool my_unique_true_boolean;
bool my_unique_true_boolean = true;
-TEST(Cord, Assignment) {
+TEST_P(CordTest, Assignment) {
absl::Cord x(absl::string_view("hi there"));
absl::Cord y(x);
ASSERT_EQ(std::string(x), "hi there");
@@ -314,7 +353,7 @@ TEST(Cord, Assignment) {
}
}
-TEST(Cord, StartsEndsWith) {
+TEST_P(CordTest, StartsEndsWith) {
absl::Cord x(absl::string_view("abcde"));
absl::Cord empty("");
@@ -347,13 +386,13 @@ TEST(Cord, StartsEndsWith) {
ASSERT_TRUE(!empty.EndsWith("xyz"));
}
-TEST(Cord, Subcord) {
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+TEST_P(CordTest, Subcord) {
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
const std::string s = RandomLowercaseString(&rng, 1024);
absl::Cord a;
AppendWithFragments(s, &rng, &a);
- ASSERT_EQ(s.size(), a.size());
+ ASSERT_EQ(s, std::string(a));
// Check subcords of a, from a variety of interesting points.
std::set<size_t> positions;
@@ -408,7 +447,7 @@ TEST(Cord, Subcord) {
EXPECT_TRUE(sa.empty());
}
-TEST(Cord, Swap) {
+TEST_P(CordTest, Swap) {
absl::string_view a("Dexter");
absl::string_view b("Mandark");
absl::Cord x(a);
@@ -440,7 +479,7 @@ static void VerifyCopyToString(const absl::Cord& cord) {
}
}
-TEST(Cord, CopyToString) {
+TEST_P(CordTest, CopyToString) {
VerifyCopyToString(absl::Cord());
VerifyCopyToString(absl::Cord("small cord"));
VerifyCopyToString(
@@ -448,50 +487,80 @@ TEST(Cord, CopyToString) {
"copying ", "to ", "a ", "string."}));
}
-TEST(TryFlat, Empty) {
+TEST_P(CordTest, TryFlatEmpty) {
absl::Cord c;
EXPECT_EQ(c.TryFlat(), "");
}
-TEST(TryFlat, Flat) {
+TEST_P(CordTest, TryFlatFlat) {
absl::Cord c("hello");
EXPECT_EQ(c.TryFlat(), "hello");
}
-TEST(TryFlat, SubstrInlined) {
+TEST_P(CordTest, TryFlatSubstrInlined) {
absl::Cord c("hello");
c.RemovePrefix(1);
EXPECT_EQ(c.TryFlat(), "ello");
}
-TEST(TryFlat, SubstrFlat) {
+TEST_P(CordTest, TryFlatSubstrFlat) {
absl::Cord c("longer than 15 bytes");
- c.RemovePrefix(1);
- EXPECT_EQ(c.TryFlat(), "onger than 15 bytes");
+ absl::Cord sub = absl::CordTestPeer::MakeSubstring(c, 1, c.size() - 1);
+ EXPECT_EQ(sub.TryFlat(), "onger than 15 bytes");
}
-TEST(TryFlat, Concat) {
+TEST_P(CordTest, TryFlatConcat) {
absl::Cord c = absl::MakeFragmentedCord({"hel", "lo"});
EXPECT_EQ(c.TryFlat(), absl::nullopt);
}
-TEST(TryFlat, External) {
+TEST_P(CordTest, TryFlatExternal) {
absl::Cord c = absl::MakeCordFromExternal("hell", [](absl::string_view) {});
EXPECT_EQ(c.TryFlat(), "hell");
}
-TEST(TryFlat, SubstrExternal) {
+TEST_P(CordTest, TryFlatSubstrExternal) {
absl::Cord c = absl::MakeCordFromExternal("hell", [](absl::string_view) {});
- c.RemovePrefix(1);
- EXPECT_EQ(c.TryFlat(), "ell");
+ absl::Cord sub = absl::CordTestPeer::MakeSubstring(c, 1, c.size() - 1);
+ EXPECT_EQ(sub.TryFlat(), "ell");
}
-TEST(TryFlat, SubstrConcat) {
+TEST_P(CordTest, TryFlatSubstrConcat) {
absl::Cord c = absl::MakeFragmentedCord({"hello", " world"});
+ absl::Cord sub = absl::CordTestPeer::MakeSubstring(c, 1, c.size() - 1);
+ EXPECT_EQ(sub.TryFlat(), absl::nullopt);
c.RemovePrefix(1);
EXPECT_EQ(c.TryFlat(), absl::nullopt);
}
+TEST_P(CordTest, TryFlatCommonlyAssumedInvariants) {
+ // The behavior tested below is not part of the API contract of Cord, but it's
+ // something we intend to be true in our current implementation. This test
+ // exists to detect and prevent accidental breakage of the implementation.
+ absl::string_view fragments[] = {"A fragmented test",
+ " cord",
+ " to test subcords",
+ " of ",
+ "a",
+ " cord for",
+ " each chunk "
+ "returned by the ",
+ "iterator"};
+ absl::Cord c = absl::MakeFragmentedCord(fragments);
+ int fragment = 0;
+ int offset = 0;
+ absl::Cord::CharIterator itc = c.char_begin();
+ for (absl::string_view sv : c.Chunks()) {
+ absl::string_view expected = fragments[fragment];
+ absl::Cord subcord1 = c.Subcord(offset, sv.length());
+ absl::Cord subcord2 = absl::Cord::AdvanceAndRead(&itc, sv.size());
+ EXPECT_EQ(subcord1.TryFlat(), expected);
+ EXPECT_EQ(subcord2.TryFlat(), expected);
+ ++fragment;
+ offset += sv.length();
+ }
+}
+
static bool IsFlat(const absl::Cord& c) {
return c.chunk_begin() == c.chunk_end() || ++c.chunk_begin() == c.chunk_end();
}
@@ -520,14 +589,14 @@ static void VerifyFlatten(absl::Cord c) {
EXPECT_TRUE(IsFlat(c));
}
-TEST(Cord, Flatten) {
+TEST_P(CordTest, Flatten) {
VerifyFlatten(absl::Cord());
VerifyFlatten(absl::Cord("small cord"));
VerifyFlatten(absl::Cord("larger than small buffer optimization"));
VerifyFlatten(absl::MakeFragmentedCord({"small ", "fragmented ", "cord"}));
// Test with a cord that is longer than the largest flat buffer
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
VerifyFlatten(absl::Cord(RandomLowercaseString(&rng, 8192)));
}
@@ -574,7 +643,7 @@ class TestData {
};
} // namespace
-TEST(Cord, MultipleLengths) {
+TEST_P(CordTest, MultipleLengths) {
TestData d;
for (size_t i = 0; i < d.size(); i++) {
std::string a = d.data(i);
@@ -650,7 +719,7 @@ TEST(Cord, MultipleLengths) {
namespace {
-TEST(Cord, RemoveSuffixWithExternalOrSubstring) {
+TEST_P(CordTest, RemoveSuffixWithExternalOrSubstring) {
absl::Cord cord = absl::MakeCordFromExternal(
"foo bar baz", [](absl::string_view s) { DoNothing(s, nullptr); });
@@ -665,7 +734,7 @@ TEST(Cord, RemoveSuffixWithExternalOrSubstring) {
EXPECT_EQ("foo", std::string(cord));
}
-TEST(Cord, RemoveSuffixMakesZeroLengthNode) {
+TEST_P(CordTest, RemoveSuffixMakesZeroLengthNode) {
absl::Cord c;
c.Append(absl::Cord(std::string(100, 'x')));
absl::Cord other_ref = c; // Prevent inplace appends
@@ -692,7 +761,7 @@ absl::Cord CordWithZedBlock(size_t size) {
}
// Establish that ZedBlock does what we think it does.
-TEST(CordSpliceTest, ZedBlock) {
+TEST_P(CordTest, CordSpliceTestZedBlock) {
absl::Cord blob = CordWithZedBlock(10);
EXPECT_EQ(10, blob.size());
std::string s;
@@ -700,7 +769,7 @@ TEST(CordSpliceTest, ZedBlock) {
EXPECT_EQ("zzzzzzzzzz", s);
}
-TEST(CordSpliceTest, ZedBlock0) {
+TEST_P(CordTest, CordSpliceTestZedBlock0) {
absl::Cord blob = CordWithZedBlock(0);
EXPECT_EQ(0, blob.size());
std::string s;
@@ -708,7 +777,7 @@ TEST(CordSpliceTest, ZedBlock0) {
EXPECT_EQ("", s);
}
-TEST(CordSpliceTest, ZedBlockSuffix1) {
+TEST_P(CordTest, CordSpliceTestZedBlockSuffix1) {
absl::Cord blob = CordWithZedBlock(10);
EXPECT_EQ(10, blob.size());
absl::Cord suffix(blob);
@@ -720,7 +789,7 @@ TEST(CordSpliceTest, ZedBlockSuffix1) {
}
// Remove all of a prefix block
-TEST(CordSpliceTest, ZedBlockSuffix0) {
+TEST_P(CordTest, CordSpliceTestZedBlockSuffix0) {
absl::Cord blob = CordWithZedBlock(10);
EXPECT_EQ(10, blob.size());
absl::Cord suffix(blob);
@@ -752,7 +821,7 @@ absl::Cord SpliceCord(const absl::Cord& blob, int64_t offset,
}
// Taking an empty suffix of a block breaks appending.
-TEST(CordSpliceTest, RemoveEntireBlock1) {
+TEST_P(CordTest, CordSpliceTestRemoveEntireBlock1) {
absl::Cord zero = CordWithZedBlock(10);
absl::Cord suffix(zero);
suffix.RemovePrefix(10);
@@ -760,7 +829,7 @@ TEST(CordSpliceTest, RemoveEntireBlock1) {
result.Append(suffix);
}
-TEST(CordSpliceTest, RemoveEntireBlock2) {
+TEST_P(CordTest, CordSpliceTestRemoveEntireBlock2) {
absl::Cord zero = CordWithZedBlock(10);
absl::Cord prefix(zero);
prefix.RemoveSuffix(10);
@@ -770,7 +839,7 @@ TEST(CordSpliceTest, RemoveEntireBlock2) {
result.Append(suffix);
}
-TEST(CordSpliceTest, RemoveEntireBlock3) {
+TEST_P(CordTest, CordSpliceTestRemoveEntireBlock3) {
absl::Cord blob = CordWithZedBlock(10);
absl::Cord block = BigCord(10, 'b');
blob = SpliceCord(blob, 0, block);
@@ -801,7 +870,7 @@ void VerifyComparison(const CordCompareTestCase& test_case) {
<< "LHS=" << rhs_string << "; RHS=" << lhs_string;
}
-TEST(Cord, Compare) {
+TEST_P(CordTest, Compare) {
absl::Cord subcord("aaaaaBBBBBcccccDDDDD");
subcord = subcord.Subcord(3, 10);
@@ -864,7 +933,7 @@ TEST(Cord, Compare) {
}
}
-TEST(Cord, CompareAfterAssign) {
+TEST_P(CordTest, CompareAfterAssign) {
absl::Cord a("aaaaaa1111111");
absl::Cord b("aaaaaa2222222");
a = "cccccc";
@@ -893,8 +962,8 @@ static void TestCompare(const absl::Cord& c, const absl::Cord& d,
EXPECT_EQ(expected, sign(c.Compare(d))) << c << ", " << d;
}
-TEST(Compare, ComparisonIsUnsigned) {
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+TEST_P(CordTest, CompareComparisonIsUnsigned) {
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
std::uniform_int_distribution<uint32_t> uniform_uint8(0, 255);
char x = static_cast<char>(uniform_uint8(rng));
TestCompare(
@@ -902,9 +971,9 @@ TEST(Compare, ComparisonIsUnsigned) {
absl::Cord(std::string(GetUniformRandomUpTo(&rng, 100), x ^ 0x80)), &rng);
}
-TEST(Compare, RandomComparisons) {
+TEST_P(CordTest, CompareRandomComparisons) {
const int kIters = 5000;
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
int n = GetUniformRandomUpTo(&rng, 5000);
absl::Cord a[] = {MakeExternalCord(n),
@@ -960,43 +1029,43 @@ void CompareOperators() {
EXPECT_FALSE(b <= a);
}
-TEST(ComparisonOperators, Cord_Cord) {
+TEST_P(CordTest, ComparisonOperators_Cord_Cord) {
CompareOperators<absl::Cord, absl::Cord>();
}
-TEST(ComparisonOperators, Cord_StringPiece) {
+TEST_P(CordTest, ComparisonOperators_Cord_StringPiece) {
CompareOperators<absl::Cord, absl::string_view>();
}
-TEST(ComparisonOperators, StringPiece_Cord) {
+TEST_P(CordTest, ComparisonOperators_StringPiece_Cord) {
CompareOperators<absl::string_view, absl::Cord>();
}
-TEST(ComparisonOperators, Cord_string) {
+TEST_P(CordTest, ComparisonOperators_Cord_string) {
CompareOperators<absl::Cord, std::string>();
}
-TEST(ComparisonOperators, string_Cord) {
+TEST_P(CordTest, ComparisonOperators_string_Cord) {
CompareOperators<std::string, absl::Cord>();
}
-TEST(ComparisonOperators, stdstring_Cord) {
+TEST_P(CordTest, ComparisonOperators_stdstring_Cord) {
CompareOperators<std::string, absl::Cord>();
}
-TEST(ComparisonOperators, Cord_stdstring) {
+TEST_P(CordTest, ComparisonOperators_Cord_stdstring) {
CompareOperators<absl::Cord, std::string>();
}
-TEST(ComparisonOperators, charstar_Cord) {
+TEST_P(CordTest, ComparisonOperators_charstar_Cord) {
CompareOperators<const char*, absl::Cord>();
}
-TEST(ComparisonOperators, Cord_charstar) {
+TEST_P(CordTest, ComparisonOperators_Cord_charstar) {
CompareOperators<absl::Cord, const char*>();
}
-TEST(ConstructFromExternal, ReleaserInvoked) {
+TEST_P(CordTest, ConstructFromExternalReleaserInvoked) {
// Empty external memory means the releaser should be called immediately.
{
bool invoked = false;
@@ -1038,8 +1107,8 @@ TEST(ConstructFromExternal, ReleaserInvoked) {
}
}
-TEST(ConstructFromExternal, CompareContents) {
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+TEST_P(CordTest, ConstructFromExternalCompareContents) {
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
for (int length = 1; length <= 2048; length *= 2) {
std::string data = RandomLowercaseString(&rng, length);
@@ -1054,8 +1123,8 @@ TEST(ConstructFromExternal, CompareContents) {
}
}
-TEST(ConstructFromExternal, LargeReleaser) {
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+TEST_P(CordTest, ConstructFromExternalLargeReleaser) {
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
constexpr size_t kLength = 256;
std::string data = RandomLowercaseString(&rng, kLength);
std::array<char, kLength> data_array;
@@ -1069,7 +1138,7 @@ TEST(ConstructFromExternal, LargeReleaser) {
EXPECT_TRUE(invoked);
}
-TEST(ConstructFromExternal, FunctionPointerReleaser) {
+TEST_P(CordTest, ConstructFromExternalFunctionPointerReleaser) {
static absl::string_view data("hello world");
static bool invoked;
auto* releaser =
@@ -1086,7 +1155,7 @@ TEST(ConstructFromExternal, FunctionPointerReleaser) {
EXPECT_TRUE(invoked);
}
-TEST(ConstructFromExternal, MoveOnlyReleaser) {
+TEST_P(CordTest, ConstructFromExternalMoveOnlyReleaser) {
struct Releaser {
explicit Releaser(bool* invoked) : invoked(invoked) {}
Releaser(Releaser&& other) noexcept : invoked(other.invoked) {}
@@ -1100,20 +1169,20 @@ TEST(ConstructFromExternal, MoveOnlyReleaser) {
EXPECT_TRUE(invoked);
}
-TEST(ConstructFromExternal, NoArgLambda) {
+TEST_P(CordTest, ConstructFromExternalNoArgLambda) {
bool invoked = false;
(void)absl::MakeCordFromExternal("dummy", [&invoked]() { invoked = true; });
EXPECT_TRUE(invoked);
}
-TEST(ConstructFromExternal, StringViewArgLambda) {
+TEST_P(CordTest, ConstructFromExternalStringViewArgLambda) {
bool invoked = false;
(void)absl::MakeCordFromExternal(
"dummy", [&invoked](absl::string_view) { invoked = true; });
EXPECT_TRUE(invoked);
}
-TEST(ConstructFromExternal, NonTrivialReleaserDestructor) {
+TEST_P(CordTest, ConstructFromExternalNonTrivialReleaserDestructor) {
struct Releaser {
explicit Releaser(bool* destroyed) : destroyed(destroyed) {}
~Releaser() { *destroyed = true; }
@@ -1128,7 +1197,7 @@ TEST(ConstructFromExternal, NonTrivialReleaserDestructor) {
EXPECT_TRUE(destroyed);
}
-TEST(ConstructFromExternal, ReferenceQualifierOverloads) {
+TEST_P(CordTest, ConstructFromExternalReferenceQualifierOverloads) {
struct Releaser {
void operator()(absl::string_view) & { *lvalue_invoked = true; }
void operator()(absl::string_view) && { *rvalue_invoked = true; }
@@ -1156,7 +1225,7 @@ TEST(ConstructFromExternal, ReferenceQualifierOverloads) {
EXPECT_TRUE(rvalue_invoked);
}
-TEST(ExternalMemory, BasicUsage) {
+TEST_P(CordTest, ExternalMemoryBasicUsage) {
static const char* strings[] = {"", "hello", "there"};
for (const char* str : strings) {
absl::Cord dst("(prefix)");
@@ -1167,7 +1236,7 @@ TEST(ExternalMemory, BasicUsage) {
}
}
-TEST(ExternalMemory, RemovePrefixSuffix) {
+TEST_P(CordTest, ExternalMemoryRemovePrefixSuffix) {
// Exhaustively try all sub-strings.
absl::Cord cord = MakeComposite();
std::string s = std::string(cord);
@@ -1182,7 +1251,7 @@ TEST(ExternalMemory, RemovePrefixSuffix) {
}
}
-TEST(ExternalMemory, Get) {
+TEST_P(CordTest, ExternalMemoryGet) {
absl::Cord cord("hello");
AddExternalMemory(" world!", &cord);
AddExternalMemory(" how are ", &cord);
@@ -1201,16 +1270,16 @@ TEST(ExternalMemory, Get) {
// Additionally we have some whiteboxed expectations based on our knowledge of
// the layout and size of empty and inlined cords, and flat nodes.
-TEST(CordMemoryUsage, Empty) {
+TEST_P(CordTest, CordMemoryUsageEmpty) {
EXPECT_EQ(sizeof(absl::Cord), absl::Cord().EstimatedMemoryUsage());
}
-TEST(CordMemoryUsage, Embedded) {
+TEST_P(CordTest, CordMemoryUsageEmbedded) {
absl::Cord a("hello");
EXPECT_EQ(a.EstimatedMemoryUsage(), sizeof(absl::Cord));
}
-TEST(CordMemoryUsage, EmbeddedAppend) {
+TEST_P(CordTest, CordMemoryUsageEmbeddedAppend) {
absl::Cord a("a");
absl::Cord b("bcd");
EXPECT_EQ(b.EstimatedMemoryUsage(), sizeof(absl::Cord));
@@ -1218,7 +1287,7 @@ TEST(CordMemoryUsage, EmbeddedAppend) {
EXPECT_EQ(a.EstimatedMemoryUsage(), sizeof(absl::Cord));
}
-TEST(CordMemoryUsage, ExternalMemory) {
+TEST_P(CordTest, CordMemoryUsageExternalMemory) {
static const int kLength = 1000;
absl::Cord cord;
AddExternalMemory(std::string(kLength, 'x'), &cord);
@@ -1226,14 +1295,14 @@ TEST(CordMemoryUsage, ExternalMemory) {
EXPECT_LE(cord.EstimatedMemoryUsage(), kLength * 1.5);
}
-TEST(CordMemoryUsage, Flat) {
+TEST_P(CordTest, CordMemoryUsageFlat) {
static const int kLength = 125;
absl::Cord a(std::string(kLength, 'a'));
EXPECT_GT(a.EstimatedMemoryUsage(), kLength);
EXPECT_LE(a.EstimatedMemoryUsage(), kLength * 1.5);
}
-TEST(CordMemoryUsage, AppendFlat) {
+TEST_P(CordTest, CordMemoryUsageAppendFlat) {
using absl::strings_internal::CordTestAccess;
absl::Cord a(std::string(CordTestAccess::MaxFlatLength(), 'a'));
size_t length = a.EstimatedMemoryUsage();
@@ -1243,9 +1312,32 @@ TEST(CordMemoryUsage, AppendFlat) {
EXPECT_LE(delta, CordTestAccess::MaxFlatLength() * 1.5);
}
+TEST_P(CordTest, CordMemoryUsageAppendExternal) {
+ static const int kLength = 1000;
+ using absl::strings_internal::CordTestAccess;
+ absl::Cord a(std::string(CordTestAccess::MaxFlatLength(), 'a'));
+ size_t length = a.EstimatedMemoryUsage();
+ AddExternalMemory(std::string(kLength, 'b'), &a);
+ size_t delta = a.EstimatedMemoryUsage() - length;
+ EXPECT_GT(delta, kLength);
+ EXPECT_LE(delta, kLength * 1.5);
+}
+
+TEST_P(CordTest, CordMemoryUsageSubString) {
+ static const int kLength = 2000;
+ using absl::strings_internal::CordTestAccess;
+ absl::Cord a(std::string(kLength, 'a'));
+ size_t length = a.EstimatedMemoryUsage();
+ AddExternalMemory(std::string(kLength, 'b'), &a);
+ absl::Cord b = a.Subcord(0, kLength + kLength / 2);
+ size_t delta = b.EstimatedMemoryUsage() - length;
+ EXPECT_GT(delta, kLength);
+ EXPECT_LE(delta, kLength * 1.5);
+}
+
// Regtest for a change that had to be rolled back because it expanded out
// of the InlineRep too soon, which was observable through MemoryUsage().
-TEST(CordMemoryUsage, InlineRep) {
+TEST_P(CordTest, CordMemoryUsageInlineRep) {
constexpr size_t kMaxInline = 15; // Cord::InlineRep::N
const std::string small_string(kMaxInline, 'x');
absl::Cord c1(small_string);
@@ -1259,7 +1351,7 @@ TEST(CordMemoryUsage, InlineRep) {
} // namespace
// Regtest for 7510292 (fix a bug introduced by 7465150)
-TEST(Cord, Concat_Append) {
+TEST_P(CordTest, Concat_Append) {
// Create a rep of type CONCAT
absl::Cord s1("foobarbarbarbarbar");
s1.Append("abcdefgabcdefgabcdefgabcdefgabcdefgabcdefgabcdefg");
@@ -1274,7 +1366,80 @@ TEST(Cord, Concat_Append) {
EXPECT_EQ(s2.size(), size + 1);
}
-TEST(MakeFragmentedCord, MakeFragmentedCordFromInitializerList) {
+TEST_P(CordTest, DiabolicalGrowth) {
+ // This test exercises a diabolical Append(<one char>) on a cord, making the
+ // cord shared before each Append call resulting in a terribly fragmented
+ // resulting cord.
+ // TODO(b/183983616): Apply some minimum compaction when copying a shared
+ // source cord into a mutable copy for updates in CordRepRing.
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
+ const std::string expected = RandomLowercaseString(&rng, 5000);
+ absl::Cord cord;
+ for (char c : expected) {
+ absl::Cord shared(cord);
+ cord.Append(absl::string_view(&c, 1));
+ }
+ std::string value;
+ absl::CopyCordToString(cord, &value);
+ EXPECT_EQ(value, expected);
+ ABSL_RAW_LOG(INFO, "Diabolical size allocated = %zu",
+ cord.EstimatedMemoryUsage());
+}
+
+// The following tests check support for >4GB cords in 64-bit binaries, and
+// 2GB-4GB cords in 32-bit binaries. This function returns the large cord size
+// that's appropriate for the binary.
+
+// Construct a huge cord with the specified valid prefix.
+static absl::Cord MakeHuge(absl::string_view prefix) {
+ absl::Cord cord;
+ if (sizeof(size_t) > 4) {
+ // In 64-bit binaries, test 64-bit Cord support.
+ const size_t size =
+ static_cast<size_t>(std::numeric_limits<uint32_t>::max()) + 314;
+ cord.Append(absl::MakeCordFromExternal(
+ absl::string_view(prefix.data(), size),
+ [](absl::string_view s) { DoNothing(s, nullptr); }));
+ } else {
+ // Cords are limited to 32-bit lengths in 32-bit binaries. The following
+ // tests check for use of "signed int" to represent Cord length/offset.
+ // However absl::string_view does not allow lengths >= (1u<<31), so we need
+ // to append in two parts;
+ const size_t s1 = (1u << 31) - 1;
+ // For shorter cord, `Append` copies the data rather than allocating a new
+ // node. The threshold is currently set to 511, so `s2` needs to be bigger
+ // to not trigger the copy.
+ const size_t s2 = 600;
+ cord.Append(absl::MakeCordFromExternal(
+ absl::string_view(prefix.data(), s1),
+ [](absl::string_view s) { DoNothing(s, nullptr); }));
+ cord.Append(absl::MakeCordFromExternal(
+ absl::string_view("", s2),
+ [](absl::string_view s) { DoNothing(s, nullptr); }));
+ }
+ return cord;
+}
+
+TEST_P(CordTest, HugeCord) {
+ absl::Cord cord = MakeHuge("huge cord");
+ EXPECT_LE(cord.size(), cord.EstimatedMemoryUsage());
+ EXPECT_GE(cord.size() + 100, cord.EstimatedMemoryUsage());
+}
+
+// Tests that Append() works ok when handed a self reference
+TEST_P(CordTest, AppendSelf) {
+ // We run the test until data is ~16K
+ // This guarantees it covers small, medium and large data.
+ std::string control_data = "Abc";
+ absl::Cord data(control_data);
+ while (control_data.length() < 0x4000) {
+ data.Append(data);
+ control_data.append(control_data);
+ ASSERT_EQ(control_data, data);
+ }
+}
+
+TEST_P(CordTest, MakeFragmentedCordFromInitializerList) {
absl::Cord fragmented =
absl::MakeFragmentedCord({"A ", "fragmented ", "Cord"});
@@ -1294,7 +1459,7 @@ TEST(MakeFragmentedCord, MakeFragmentedCordFromInitializerList) {
ASSERT_TRUE(++chunk_it == fragmented.chunk_end());
}
-TEST(MakeFragmentedCord, MakeFragmentedCordFromVector) {
+TEST_P(CordTest, MakeFragmentedCordFromVector) {
std::vector<absl::string_view> chunks = {"A ", "fragmented ", "Cord"};
absl::Cord fragmented = absl::MakeFragmentedCord(chunks);
@@ -1314,7 +1479,7 @@ TEST(MakeFragmentedCord, MakeFragmentedCordFromVector) {
ASSERT_TRUE(++chunk_it == fragmented.chunk_end());
}
-TEST(CordChunkIterator, Traits) {
+TEST_P(CordTest, CordChunkIteratorTraits) {
static_assert(std::is_copy_constructible<absl::Cord::ChunkIterator>::value,
"");
static_assert(std::is_copy_assignable<absl::Cord::ChunkIterator>::value, "");
@@ -1395,7 +1560,7 @@ static void VerifyChunkIterator(const absl::Cord& cord,
EXPECT_TRUE(post_iter == cord.chunk_end()); // NOLINT
}
-TEST(CordChunkIterator, Operations) {
+TEST_P(CordTest, CordChunkIteratorOperations) {
absl::Cord empty_cord;
VerifyChunkIterator(empty_cord, 0);
@@ -1420,14 +1585,14 @@ TEST(CordChunkIterator, Operations) {
VerifyChunkIterator(reused_nodes_cord, expected_chunks);
}
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
absl::Cord flat_cord(RandomLowercaseString(&rng, 256));
absl::Cord subcords;
for (int i = 0; i < 128; ++i) subcords.Prepend(flat_cord.Subcord(i, 128));
VerifyChunkIterator(subcords, 128);
}
-TEST(CordCharIterator, Traits) {
+TEST_P(CordTest, CharIteratorTraits) {
static_assert(std::is_copy_constructible<absl::Cord::CharIterator>::value,
"");
static_assert(std::is_copy_assignable<absl::Cord::CharIterator>::value, "");
@@ -1536,7 +1701,7 @@ static void VerifyCharIterator(const absl::Cord& cord) {
}
}
-TEST(CordCharIterator, Operations) {
+TEST_P(CordTest, CharIteratorOperations) {
absl::Cord empty_cord;
VerifyCharIterator(empty_cord);
@@ -1558,14 +1723,49 @@ TEST(CordCharIterator, Operations) {
VerifyCharIterator(reused_nodes_cord);
}
- RandomEngine rng(testing::GTEST_FLAG(random_seed));
+ RandomEngine rng(GTEST_FLAG_GET(random_seed));
absl::Cord flat_cord(RandomLowercaseString(&rng, 256));
absl::Cord subcords;
for (int i = 0; i < 4; ++i) subcords.Prepend(flat_cord.Subcord(16 * i, 128));
VerifyCharIterator(subcords);
}
-TEST(Cord, StreamingOutput) {
+TEST_P(CordTest, CharIteratorAdvanceAndRead) {
+ // Create a Cord holding 6 flats of 2500 bytes each, and then iterate over it
+ // reading 150, 1500, 2500 and 3000 bytes. This will result in all possible
+ // partial, full and straddled read combinations including reads below
+ // kMaxBytesToCopy. b/197776822 surfaced a bug for a specific partial, small
+ // read 'at end' on Cord which caused a failure on attempting to read past the
+ // end in CordRepBtreeReader which was not covered by any existing test.
+ constexpr int kBlocks = 6;
+ constexpr size_t kBlockSize = 2500;
+ constexpr size_t kChunkSize1 = 1500;
+ constexpr size_t kChunkSize2 = 2500;
+ constexpr size_t kChunkSize3 = 3000;
+ constexpr size_t kChunkSize4 = 150;
+ RandomEngine rng;
+ std::string data = RandomLowercaseString(&rng, kBlocks * kBlockSize);
+ absl::Cord cord;
+ for (int i = 0; i < kBlocks; ++i) {
+ const std::string block = data.substr(i * kBlockSize, kBlockSize);
+ cord.Append(absl::Cord(block));
+ }
+
+ for (size_t chunk_size :
+ {kChunkSize1, kChunkSize2, kChunkSize3, kChunkSize4}) {
+ absl::Cord::CharIterator it = cord.char_begin();
+ size_t offset = 0;
+ while (offset < data.length()) {
+ const size_t n = std::min<size_t>(data.length() - offset, chunk_size);
+ absl::Cord chunk = cord.AdvanceAndRead(&it, n);
+ ASSERT_EQ(chunk.size(), n);
+ ASSERT_EQ(chunk.Compare(data.substr(offset, n)), 0);
+ offset += n;
+ }
+ }
+}
+
+TEST_P(CordTest, StreamingOutput) {
absl::Cord c =
absl::MakeFragmentedCord({"A ", "small ", "fragmented ", "Cord", "."});
std::stringstream output;
@@ -1573,7 +1773,7 @@ TEST(Cord, StreamingOutput) {
EXPECT_EQ("A small fragmented Cord.", output.str());
}
-TEST(Cord, ForEachChunk) {
+TEST_P(CordTest, ForEachChunk) {
for (int num_elements : {1, 10, 200}) {
SCOPED_TRACE(num_elements);
std::vector<std::string> cord_chunks;
@@ -1591,7 +1791,7 @@ TEST(Cord, ForEachChunk) {
}
}
-TEST(Cord, SmallBufferAssignFromOwnData) {
+TEST_P(CordTest, SmallBufferAssignFromOwnData) {
constexpr size_t kMaxInline = 15;
std::string contents = "small buff cord";
EXPECT_EQ(contents.size(), kMaxInline);
@@ -1606,7 +1806,7 @@ TEST(Cord, SmallBufferAssignFromOwnData) {
}
}
-TEST(Cord, Format) {
+TEST_P(CordTest, Format) {
absl::Cord c;
absl::Format(&c, "There were %04d little %s.", 3, "pigs");
EXPECT_EQ(c, "There were 0003 little pigs.");
@@ -1614,7 +1814,7 @@ TEST(Cord, Format) {
EXPECT_EQ(c, "There were 0003 little pigs.And 1 bad wolf!");
}
-TEST(CordDeathTest, Hardening) {
+TEST_P(CordTest, Hardening) {
absl::Cord cord("hello");
// These statement should abort the program in all builds modes.
EXPECT_DEATH_IF_SUPPORTED(cord.RemovePrefix(6), "");
@@ -1634,6 +1834,48 @@ TEST(CordDeathTest, Hardening) {
EXPECT_DEATH_IF_SUPPORTED(++cord.chunk_end(), "");
}
+// This test mimics a specific (and rare) application repeatedly splitting a
+// cord, inserting (overwriting) a string value, and composing a new cord from
+// the three pieces. This is hostile towards a Btree implementation: A split of
+// a node at any level is likely to have the right-most edge of the left split,
+// and the left-most edge of the right split shared. For example, splitting a
+// leaf node with 6 edges will result likely in a 1-6, 2-5, 3-4, etc. split,
+// sharing the 'split node'. When recomposing such nodes, we 'injected' an edge
+// in that node. As this happens with some probability on each level of the
+// tree, this will quickly grow the tree until it reaches maximum height.
+TEST_P(CordTest, BtreeHostileSplitInsertJoin) {
+ absl::BitGen bitgen;
+
+ // Start with about 1GB of data
+ std::string data(1 << 10, 'x');
+ absl::Cord buffer(data);
+ absl::Cord cord;
+ for (int i = 0; i < 1000000; ++i) {
+ cord.Append(buffer);
+ }
+
+ for (int j = 0; j < 1000; ++j) {
+ size_t offset = absl::Uniform(bitgen, 0u, cord.size());
+ size_t length = absl::Uniform(bitgen, 100u, data.size());
+ if (cord.size() == offset) {
+ cord.Append(absl::string_view(data.data(), length));
+ } else {
+ absl::Cord suffix;
+ if (offset + length < cord.size()) {
+ suffix = cord;
+ suffix.RemovePrefix(offset + length);
+ }
+ if (cord.size() > offset) {
+ cord.RemoveSuffix(cord.size() - offset);
+ }
+ cord.Append(absl::string_view(data.data(), length));
+ if (!suffix.empty()) {
+ cord.Append(suffix);
+ }
+ }
+ }
+}
+
class AfterExitCordTester {
public:
bool Set(absl::Cord* cord, absl::string_view expected) {
@@ -1707,7 +1949,7 @@ struct LongView {
};
-TEST(Cord, ConstinitConstructor) {
+TEST_P(CordTest, ConstinitConstructor) {
TestConstinitConstructor(
absl::strings_internal::MakeStringConstant(ShortView{}));
TestConstinitConstructor(
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cord_test_helpers.h b/grpc/third_party/abseil-cpp/absl/strings/cord_test_helpers.h
index f1036e3b..31a1dc89 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/cord_test_helpers.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/cord_test_helpers.h
@@ -17,11 +17,73 @@
#ifndef ABSL_STRINGS_CORD_TEST_HELPERS_H_
#define ABSL_STRINGS_CORD_TEST_HELPERS_H_
+#include <cstdint>
+#include <iostream>
+#include <string>
+
+#include "absl/base/config.h"
#include "absl/strings/cord.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/string_view.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
+// Cord sizes relevant for testing
+enum class TestCordSize {
+ // An empty value
+ kEmpty = 0,
+
+ // An inlined string value
+ kInlined = cord_internal::kMaxInline / 2 + 1,
+
+ // 'Well known' SSO lengths (excluding terminating zero).
+ // libstdcxx has a maximum SSO of 15, libc++ has a maximum SSO of 22.
+ kStringSso1 = 15,
+ kStringSso2 = 22,
+
+ // A string value which is too large to fit in inlined data, but small enough
+ // such that Cord prefers copying the value if possible, i.e.: not stealing
+ // std::string inputs, or referencing existing CordReps on Append, etc.
+ kSmall = cord_internal::kMaxBytesToCopy / 2 + 1,
+
+ // A string value large enough that Cord prefers to reference or steal from
+ // existing inputs rather than copying contents of the input.
+ kMedium = cord_internal::kMaxFlatLength / 2 + 1,
+
+ // A string value large enough to cause it to be stored in mutliple flats.
+ kLarge = cord_internal::kMaxFlatLength * 4
+};
+
+// To string helper
+inline absl::string_view ToString(TestCordSize size) {
+ switch (size) {
+ case TestCordSize::kEmpty:
+ return "Empty";
+ case TestCordSize::kInlined:
+ return "Inlined";
+ case TestCordSize::kSmall:
+ return "Small";
+ case TestCordSize::kStringSso1:
+ return "StringSso1";
+ case TestCordSize::kStringSso2:
+ return "StringSso2";
+ case TestCordSize::kMedium:
+ return "Medium";
+ case TestCordSize::kLarge:
+ return "Large";
+ }
+ return "???";
+}
+
+// Returns the length matching the specified size
+inline size_t Length(TestCordSize size) { return static_cast<size_t>(size); }
+
+// Stream output helper
+inline std::ostream& operator<<(std::ostream& stream, TestCordSize size) {
+ return stream << ToString(size);
+}
+
// Creates a multi-segment Cord from an iterable container of strings. The
// resulting Cord is guaranteed to have one segment for every string in the
// container. This allows code to be unit tested with multi-segment Cord
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cordz_test.cc b/grpc/third_party/abseil-cpp/absl/strings/cordz_test.cc
new file mode 100644
index 00000000..2b7d30b0
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/cordz_test.cc
@@ -0,0 +1,466 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <cstdint>
+#include <string>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/base/macros.h"
+#include "absl/strings/cord.h"
+#include "absl/strings/cord_test_helpers.h"
+#include "absl/strings/cordz_test_helpers.h"
+#include "absl/strings/internal/cordz_functions.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_sample_token.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+#ifdef ABSL_INTERNAL_CORDZ_ENABLED
+
+using testing::Eq;
+using testing::AnyOf;
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+
+using cord_internal::CordzInfo;
+using cord_internal::CordzSampleToken;
+using cord_internal::CordzStatistics;
+using cord_internal::CordzUpdateTracker;
+using Method = CordzUpdateTracker::MethodIdentifier;
+
+// Do not print cord contents, we only care about 'size' perhaps.
+// Note that this method must be inside the named namespace.
+inline void PrintTo(const Cord& cord, std::ostream* s) {
+ if (s) *s << "Cord[" << cord.size() << "]";
+}
+
+namespace {
+
+auto constexpr kMaxInline = cord_internal::kMaxInline;
+
+// Returns a string_view value of the specified length
+// We do this to avoid 'consuming' large strings in Cord by default.
+absl::string_view MakeString(size_t size) {
+ thread_local std::string str;
+ str = std::string(size, '.');
+ return str;
+}
+
+absl::string_view MakeString(TestCordSize size) {
+ return MakeString(Length(size));
+}
+
+// Returns a cord with a sampled method of kAppendString.
+absl::Cord MakeAppendStringCord(TestCordSize size) {
+ CordzSamplingIntervalHelper always(1);
+ absl::Cord cord;
+ cord.Append(MakeString(size));
+ return cord;
+}
+
+std::string TestParamToString(::testing::TestParamInfo<TestCordSize> size) {
+ return absl::StrCat("On", ToString(size.param), "Cord");
+}
+
+class CordzUpdateTest : public testing::TestWithParam<TestCordSize> {
+ public:
+ Cord& cord() { return cord_; }
+
+ Method InitialOr(Method method) const {
+ return (GetParam() > TestCordSize::kInlined) ? Method::kConstructorString
+ : method;
+ }
+
+ private:
+ CordzSamplingIntervalHelper sample_every_{1};
+ Cord cord_{MakeString(GetParam())};
+};
+
+template <typename T>
+std::string ParamToString(::testing::TestParamInfo<T> param) {
+ return std::string(ToString(param.param));
+}
+
+INSTANTIATE_TEST_SUITE_P(WithParam, CordzUpdateTest,
+ testing::Values(TestCordSize::kEmpty,
+ TestCordSize::kInlined,
+ TestCordSize::kLarge),
+ TestParamToString);
+
+class CordzStringTest : public testing::TestWithParam<TestCordSize> {
+ private:
+ CordzSamplingIntervalHelper sample_every_{1};
+};
+
+INSTANTIATE_TEST_SUITE_P(WithParam, CordzStringTest,
+ testing::Values(TestCordSize::kInlined,
+ TestCordSize::kStringSso1,
+ TestCordSize::kStringSso2,
+ TestCordSize::kSmall,
+ TestCordSize::kLarge),
+ ParamToString<TestCordSize>);
+
+TEST(CordzTest, ConstructSmallArray) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord(MakeString(TestCordSize::kSmall));
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+}
+
+TEST(CordzTest, ConstructLargeArray) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord(MakeString(TestCordSize::kLarge));
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+}
+
+TEST_P(CordzStringTest, ConstructString) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord(std::string(Length(GetParam()), '.'));
+ if (Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ }
+}
+
+TEST(CordzTest, CopyConstructFromUnsampled) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ Cord cord(src);
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+}
+
+TEST(CordzTest, CopyConstructFromSampled) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ Cord cord(src);
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+}
+
+TEST(CordzTest, MoveConstruct) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord src(MakeString(TestCordSize::kLarge));
+ Cord cord(std::move(src));
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+}
+
+TEST_P(CordzUpdateTest, AssignUnsampledCord) {
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ const CordzInfo* info = GetCordzInfoForTesting(cord());
+ cord() = src;
+ EXPECT_THAT(GetCordzInfoForTesting(cord()), Eq(nullptr));
+ EXPECT_FALSE(CordzInfoIsListed(info));
+}
+
+TEST_P(CordzUpdateTest, AssignSampledCord) {
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ cord() = src;
+ ASSERT_THAT(cord(), HasValidCordzInfoOf(Method::kAssignCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord())->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kConstructorString), Eq(0));
+}
+
+TEST(CordzUpdateTest, AssignSampledCordToInlined) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord cord;
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ cord = src;
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kAssignCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kConstructorString), Eq(0));
+}
+
+TEST(CordzUpdateTest, AssignSampledCordToUnsampledCord) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord cord = UnsampledCord(MakeString(TestCordSize::kLarge));
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ cord = src;
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kAssignCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kConstructorString), Eq(0));
+}
+
+TEST(CordzUpdateTest, AssignUnsampledCordToSampledCordWithoutSampling) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord cord = MakeAppendStringCord(TestCordSize::kLarge);
+ const CordzInfo* info = GetCordzInfoForTesting(cord);
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ cord = src;
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+ EXPECT_FALSE(CordzInfoIsListed(info));
+}
+
+TEST(CordzUpdateTest, AssignUnsampledCordToSampledCordWithSampling) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord = MakeAppendStringCord(TestCordSize::kLarge);
+ const CordzInfo* info = GetCordzInfoForTesting(cord);
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ cord = src;
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+ EXPECT_FALSE(CordzInfoIsListed(info));
+}
+
+TEST(CordzUpdateTest, AssignSampledCordToSampledCord) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ Cord cord(MakeString(TestCordSize::kLarge));
+ cord = src;
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kAssignCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kConstructorString), Eq(0));
+}
+
+TEST(CordzUpdateTest, AssignUnsampledCordToSampledCord) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ Cord cord(MakeString(TestCordSize::kLarge));
+ cord = src;
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kAssignCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kConstructorString), Eq(0));
+}
+
+TEST(CordzTest, AssignInlinedCordToSampledCord) {
+ CordzSampleToken token;
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord(MakeString(TestCordSize::kLarge));
+ const CordzInfo* info = GetCordzInfoForTesting(cord);
+ Cord src = UnsampledCord(MakeString(TestCordSize::kInlined));
+ cord = src;
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+ EXPECT_FALSE(CordzInfoIsListed(info));
+}
+
+TEST(CordzUpdateTest, MoveAssignCord) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord;
+ Cord src(MakeString(TestCordSize::kLarge));
+ cord = std::move(src);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+}
+
+TEST_P(CordzUpdateTest, AssignLargeArray) {
+ cord() = MakeString(TestCordSize::kSmall);
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(Method::kAssignString));
+}
+
+TEST_P(CordzUpdateTest, AssignSmallArray) {
+ cord() = MakeString(TestCordSize::kSmall);
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(Method::kAssignString));
+}
+
+TEST_P(CordzUpdateTest, AssignInlinedArray) {
+ cord() = MakeString(TestCordSize::kInlined);
+ EXPECT_THAT(GetCordzInfoForTesting(cord()), Eq(nullptr));
+}
+
+TEST_P(CordzStringTest, AssignStringToInlined) {
+ Cord cord;
+ cord = std::string(Length(GetParam()), '.');
+ if (Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kAssignString));
+ }
+}
+
+TEST_P(CordzStringTest, AssignStringToCord) {
+ Cord cord(MakeString(TestCordSize::kLarge));
+ cord = std::string(Length(GetParam()), '.');
+ if (Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kAssignString, 1));
+ }
+}
+
+TEST_P(CordzUpdateTest, AssignInlinedString) {
+ cord() = std::string(Length(TestCordSize::kInlined), '.');
+ EXPECT_THAT(GetCordzInfoForTesting(cord()), Eq(nullptr));
+}
+
+TEST_P(CordzUpdateTest, AppendCord) {
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ cord().Append(src);
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kAppendCord)));
+}
+
+TEST_P(CordzUpdateTest, MoveAppendCord) {
+ cord().Append(UnsampledCord(MakeString(TestCordSize::kLarge)));
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kAppendCord)));
+}
+
+TEST_P(CordzUpdateTest, AppendSmallArray) {
+ cord().Append(MakeString(TestCordSize::kSmall));
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kAppendString)));
+}
+
+TEST_P(CordzUpdateTest, AppendLargeArray) {
+ cord().Append(MakeString(TestCordSize::kLarge));
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kAppendString)));
+}
+
+TEST_P(CordzStringTest, AppendStringToEmpty) {
+ Cord cord;
+ cord.Append(std::string(Length(GetParam()), '.'));
+ if (Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kAppendString));
+ }
+}
+
+TEST_P(CordzStringTest, AppendStringToInlined) {
+ Cord cord(MakeString(TestCordSize::kInlined));
+ cord.Append(std::string(Length(GetParam()), '.'));
+ if (Length(TestCordSize::kInlined) + Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kAppendString));
+ }
+}
+
+TEST_P(CordzStringTest, AppendStringToCord) {
+ Cord cord(MakeString(TestCordSize::kLarge));
+ cord.Append(std::string(Length(GetParam()), '.'));
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kAppendString, 1));
+}
+
+TEST(CordzTest, MakeCordFromExternal) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord = MakeCordFromExternal("Hello world", [](absl::string_view) {});
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kMakeCordFromExternal));
+}
+
+TEST(CordzTest, MakeCordFromEmptyExternal) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord cord = MakeCordFromExternal({}, [](absl::string_view) {});
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+}
+
+TEST_P(CordzUpdateTest, PrependCord) {
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ cord().Prepend(src);
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kPrependCord)));
+}
+
+TEST_P(CordzUpdateTest, PrependSmallArray) {
+ cord().Prepend(MakeString(TestCordSize::kSmall));
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kPrependString)));
+}
+
+TEST_P(CordzUpdateTest, PrependLargeArray) {
+ cord().Prepend(MakeString(TestCordSize::kLarge));
+ EXPECT_THAT(cord(), HasValidCordzInfoOf(InitialOr(Method::kPrependString)));
+}
+
+TEST_P(CordzStringTest, PrependStringToEmpty) {
+ Cord cord;
+ cord.Prepend(std::string(Length(GetParam()), '.'));
+ if (Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kPrependString));
+ }
+}
+
+TEST_P(CordzStringTest, PrependStringToInlined) {
+ Cord cord(MakeString(TestCordSize::kInlined));
+ cord.Prepend(std::string(Length(GetParam()), '.'));
+ if (Length(TestCordSize::kInlined) + Length(GetParam()) > kMaxInline) {
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kPrependString));
+ }
+}
+
+TEST_P(CordzStringTest, PrependStringToCord) {
+ Cord cord(MakeString(TestCordSize::kLarge));
+ cord.Prepend(std::string(Length(GetParam()), '.'));
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kPrependString, 1));
+}
+
+TEST(CordzTest, RemovePrefix) {
+ CordzSamplingIntervalHelper sample_every(1);
+ Cord cord(MakeString(TestCordSize::kLarge));
+
+ // Half the cord
+ cord.RemovePrefix(cord.size() / 2);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kRemovePrefix, 1));
+
+ // TODO(mvels): RemovePrefix does not reset to inlined, except if empty?
+ cord.RemovePrefix(cord.size() - kMaxInline);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kRemovePrefix, 2));
+
+ cord.RemovePrefix(cord.size());
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+}
+
+TEST(CordzTest, RemoveSuffix) {
+ CordzSamplingIntervalHelper sample_every(1);
+ Cord cord(MakeString(TestCordSize::kLarge));
+
+ // Half the cord
+ cord.RemoveSuffix(cord.size() / 2);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kRemoveSuffix, 1));
+
+ // TODO(mvels): RemoveSuffix does not reset to inlined, except if empty?
+ cord.RemoveSuffix(cord.size() - kMaxInline);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kConstructorString));
+ EXPECT_THAT(cord, CordzMethodCountEq(Method::kRemoveSuffix, 2));
+
+ cord.RemoveSuffix(cord.size());
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+}
+
+TEST(CordzTest, SubCordFromUnsampledCord) {
+ CordzSamplingIntervalHelper sample_every{1};
+ Cord src = UnsampledCord(MakeString(TestCordSize::kLarge));
+ Cord cord = src.Subcord(10, src.size() / 2);
+ EXPECT_THAT(GetCordzInfoForTesting(cord), Eq(nullptr));
+}
+
+TEST(CordzTest, SubCordFromSampledCord) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ Cord cord = src.Subcord(10, src.size() / 2);
+ ASSERT_THAT(cord, HasValidCordzInfoOf(Method::kSubCord));
+ CordzStatistics stats = GetCordzInfoForTesting(cord)->GetCordzStatistics();
+ EXPECT_THAT(stats.parent_method, Eq(Method::kAppendString));
+ EXPECT_THAT(stats.update_tracker.Value(Method::kAppendString), Eq(1));
+}
+
+TEST(CordzTest, SmallSubCord) {
+ CordzSamplingIntervalHelper sample_never{99999};
+ Cord src = MakeAppendStringCord(TestCordSize::kLarge);
+ Cord cord = src.Subcord(10, kMaxInline + 1);
+ EXPECT_THAT(cord, HasValidCordzInfoOf(Method::kSubCord));
+}
+
+} // namespace
+
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_INTERNAL_CORDZ_ENABLED
diff --git a/grpc/third_party/abseil-cpp/absl/strings/cordz_test_helpers.h b/grpc/third_party/abseil-cpp/absl/strings/cordz_test_helpers.h
new file mode 100644
index 00000000..e410eecf
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/cordz_test_helpers.h
@@ -0,0 +1,151 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_CORDZ_TEST_HELPERS_H_
+#define ABSL_STRINGS_CORDZ_TEST_HELPERS_H_
+
+#include <utility>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/base/macros.h"
+#include "absl/strings/cord.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_sample_token.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/strings/str_cat.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+
+// Returns the CordzInfo for the cord, or nullptr if the cord is not sampled.
+inline const cord_internal::CordzInfo* GetCordzInfoForTesting(
+ const Cord& cord) {
+ if (!cord.contents_.is_tree()) return nullptr;
+ return cord.contents_.cordz_info();
+}
+
+// Returns true if the provided cordz_info is in the list of sampled cords.
+inline bool CordzInfoIsListed(const cord_internal::CordzInfo* cordz_info,
+ cord_internal::CordzSampleToken token = {}) {
+ for (const cord_internal::CordzInfo& info : token) {
+ if (cordz_info == &info) return true;
+ }
+ return false;
+}
+
+// Matcher on Cord that verifies all of:
+// - the cord is sampled
+// - the CordzInfo of the cord is listed / discoverable.
+// - the reported CordzStatistics match the cord's actual properties
+// - the cord has an (initial) UpdateTracker count of 1 for `method`
+MATCHER_P(HasValidCordzInfoOf, method, "CordzInfo matches cord") {
+ const cord_internal::CordzInfo* cord_info = GetCordzInfoForTesting(arg);
+ if (cord_info == nullptr) {
+ *result_listener << "cord is not sampled";
+ return false;
+ }
+ if (!CordzInfoIsListed(cord_info)) {
+ *result_listener << "cord is sampled, but not listed";
+ return false;
+ }
+ cord_internal::CordzStatistics stat = cord_info->GetCordzStatistics();
+ if (stat.size != arg.size()) {
+ *result_listener << "cordz size " << stat.size
+ << " does not match cord size " << arg.size();
+ return false;
+ }
+ if (stat.update_tracker.Value(method) != 1) {
+ *result_listener << "Expected method count 1 for " << method << ", found "
+ << stat.update_tracker.Value(method);
+ return false;
+ }
+ return true;
+}
+
+// Matcher on Cord that verifies that the cord is sampled and that the CordzInfo
+// update tracker has 'method' with a call count of 'n'
+MATCHER_P2(CordzMethodCountEq, method, n,
+ absl::StrCat("CordzInfo method count equals ", n)) {
+ const cord_internal::CordzInfo* cord_info = GetCordzInfoForTesting(arg);
+ if (cord_info == nullptr) {
+ *result_listener << "cord is not sampled";
+ return false;
+ }
+ cord_internal::CordzStatistics stat = cord_info->GetCordzStatistics();
+ if (stat.update_tracker.Value(method) != n) {
+ *result_listener << "Expected method count " << n << " for " << method
+ << ", found " << stat.update_tracker.Value(method);
+ return false;
+ }
+ return true;
+}
+
+// Cordz will only update with a new rate once the previously scheduled event
+// has fired. When we disable Cordz, a long delay takes place where we won't
+// consider profiling new Cords. CordzSampleIntervalHelper will burn through
+// that interval and allow for testing that assumes that the average sampling
+// interval is a particular value.
+class CordzSamplingIntervalHelper {
+ public:
+ explicit CordzSamplingIntervalHelper(int32_t interval)
+ : orig_mean_interval_(absl::cord_internal::get_cordz_mean_interval()) {
+ absl::cord_internal::set_cordz_mean_interval(interval);
+ absl::cord_internal::cordz_set_next_sample_for_testing(interval);
+ }
+
+ ~CordzSamplingIntervalHelper() {
+ absl::cord_internal::set_cordz_mean_interval(orig_mean_interval_);
+ absl::cord_internal::cordz_set_next_sample_for_testing(orig_mean_interval_);
+ }
+
+ private:
+ int32_t orig_mean_interval_;
+};
+
+// Wrapper struct managing a small CordRep `rep`
+struct TestCordRep {
+ cord_internal::CordRepFlat* rep;
+
+ TestCordRep() {
+ rep = cord_internal::CordRepFlat::New(100);
+ rep->length = 100;
+ memset(rep->Data(), 1, 100);
+ }
+ ~TestCordRep() { cord_internal::CordRep::Unref(rep); }
+};
+
+// Wrapper struct managing a small CordRep `rep`, and
+// an InlineData `data` initialized with that CordRep.
+struct TestCordData {
+ TestCordRep rep;
+ cord_internal::InlineData data{rep.rep};
+};
+
+// Creates a Cord that is not sampled
+template <typename... Args>
+Cord UnsampledCord(Args... args) {
+ CordzSamplingIntervalHelper never(9999);
+ Cord cord(std::forward<Args>(args)...);
+ ABSL_ASSERT(GetCordzInfoForTesting(cord) == nullptr);
+ return cord;
+}
+
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_CORDZ_TEST_HELPERS_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc
index 8b11868c..d29acaf4 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc
@@ -52,7 +52,7 @@ static_assert(std::numeric_limits<double>::digits == 53, "IEEE double fact");
// The lowest valued 19-digit decimal mantissa we can read still contains
// sufficient information to reconstruct a binary mantissa.
-static_assert(1000000000000000000u > (uint64_t(1) << (53 + 3)), "(b) above");
+static_assert(1000000000000000000u > (uint64_t{1} << (53 + 3)), "(b) above");
// ParseFloat<16> will read the first 15 significant digits of the mantissa.
//
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc
index 905ffd0c..1767e6fc 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc
@@ -18,6 +18,7 @@
#include <memory>
#include "absl/container/inlined_vector.h"
+#include "absl/strings/internal/cord_rep_btree.h"
#include "absl/strings/internal/cord_rep_flat.h"
#include "absl/strings/internal/cord_rep_ring.h"
@@ -25,10 +26,12 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace cord_internal {
+ABSL_CONST_INIT std::atomic<bool> cord_btree_enabled(kCordEnableBtreeDefault);
ABSL_CONST_INIT std::atomic<bool> cord_ring_buffer_enabled(
kCordEnableRingBufferDefault);
ABSL_CONST_INIT std::atomic<bool> shallow_subcords_enabled(
kCordShallowSubcordsDefault);
+ABSL_CONST_INIT std::atomic<bool> cord_btree_exhaustive_validation(false);
void CordRep::Destroy(CordRep* rep) {
assert(rep != nullptr);
@@ -49,6 +52,9 @@ void CordRep::Destroy(CordRep* rep) {
rep = left;
continue;
}
+ } else if (rep->tag == BTREE) {
+ CordRepBtree::Destroy(rep->btree());
+ rep = nullptr;
} else if (rep->tag == RING) {
CordRepRing::Destroy(rep->ring());
rep = nullptr;
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
index a1ba67fe..bfe5564e 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal.h
@@ -37,13 +37,25 @@ class CordzInfo;
// Default feature enable states for cord ring buffers
enum CordFeatureDefaults {
+ kCordEnableBtreeDefault = true,
kCordEnableRingBufferDefault = false,
kCordShallowSubcordsDefault = false
};
+extern std::atomic<bool> cord_btree_enabled;
extern std::atomic<bool> cord_ring_buffer_enabled;
extern std::atomic<bool> shallow_subcords_enabled;
+// `cord_btree_exhaustive_validation` can be set to force exhaustive validation
+// in debug assertions, and code that calls `IsValid()` explicitly. By default,
+// assertions should be relatively cheap and AssertValid() can easily lead to
+// O(n^2) complexity as recursive / full tree validation is O(n).
+extern std::atomic<bool> cord_btree_exhaustive_validation;
+
+inline void enable_cord_btree(bool enable) {
+ cord_btree_enabled.store(enable, std::memory_order_relaxed);
+}
+
inline void enable_cord_ring_buffer(bool enable) {
cord_ring_buffer_enabled.store(enable, std::memory_order_relaxed);
}
@@ -68,12 +80,16 @@ enum Constants {
kMaxBytesToCopy = 511
};
-// Wraps std::atomic for reference counting.
-class Refcount {
+// Compact class for tracking the reference count and state flags for CordRep
+// instances. Data is stored in an atomic int32_t for compactness and speed.
+class RefcountAndFlags {
public:
- constexpr Refcount() : count_{kRefIncrement} {}
+ constexpr RefcountAndFlags() : count_{kRefIncrement} {}
struct Immortal {};
- explicit constexpr Refcount(Immortal) : count_(kImmortalTag) {}
+ explicit constexpr RefcountAndFlags(Immortal) : count_(kImmortalFlag) {}
+ struct WithCrc {};
+ explicit constexpr RefcountAndFlags(WithCrc)
+ : count_(kCrcFlag | kRefIncrement) {}
// Increments the reference count. Imposes no memory ordering.
inline void Increment() {
@@ -86,55 +102,82 @@ class Refcount {
// Returns false if there are no references outstanding; true otherwise.
// Inserts barriers to ensure that state written before this method returns
// false will be visible to a thread that just observed this method returning
- // false.
+ // false. Always returns false when the immortal bit is set.
inline bool Decrement() {
- int32_t refcount = count_.load(std::memory_order_acquire);
- assert(refcount > 0 || refcount & kImmortalTag);
+ int32_t refcount = count_.load(std::memory_order_acquire) & kRefcountMask;
+ assert(refcount > 0 || refcount & kImmortalFlag);
return refcount != kRefIncrement &&
- count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel) !=
- kRefIncrement;
+ (count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel) &
+ kRefcountMask) != kRefIncrement;
}
// Same as Decrement but expect that refcount is greater than 1.
inline bool DecrementExpectHighRefcount() {
int32_t refcount =
- count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel);
- assert(refcount > 0 || refcount & kImmortalTag);
+ count_.fetch_sub(kRefIncrement, std::memory_order_acq_rel) &
+ kRefcountMask;
+ assert(refcount > 0 || refcount & kImmortalFlag);
return refcount != kRefIncrement;
}
// Returns the current reference count using acquire semantics.
inline int32_t Get() const {
- return count_.load(std::memory_order_acquire) >> kImmortalShift;
+ return count_.load(std::memory_order_acquire) >> kNumFlags;
}
- // Returns whether the atomic integer is 1.
- // If the reference count is used in the conventional way, a
- // reference count of 1 implies that the current thread owns the
- // reference and no other thread shares it.
- // This call performs the test for a reference count of one, and
- // performs the memory barrier needed for the owning thread
- // to act on the object, knowing that it has exclusive access to the
- // object.
+ // Returns true if the referenced object carries a CRC value.
+ bool HasCrc() const {
+ return (count_.load(std::memory_order_relaxed) & kCrcFlag) != 0;
+ }
+
+ // Returns true iff the atomic integer is 1 and this node does not store
+ // a CRC. When both these conditions are met, the current thread owns
+ // the reference and no other thread shares it, so its contents may be
+ // safely mutated.
+ //
+ // If the referenced item is shared, carries a CRC, or is immortal,
+ // it should not be modified in-place, and this function returns false.
+ //
+ // This call performs the memory barrier needed for the owning thread
+ // to act on the object, so that if it returns true, it may safely
+ // assume exclusive access to the object.
+ inline bool IsMutable() {
+ return (count_.load(std::memory_order_acquire)) == kRefIncrement;
+ }
+
+ // Returns whether the atomic integer is 1. Similar to IsMutable(),
+ // but does not check for a stored CRC. (An unshared node with a CRC is not
+ // mutable, because changing its data would invalidate the CRC.)
+ //
+ // When this returns true, there are no other references, and data sinks
+ // may safely adopt the children of the CordRep.
inline bool IsOne() {
- return count_.load(std::memory_order_acquire) == kRefIncrement;
+ return (count_.load(std::memory_order_acquire) & kRefcountMask) ==
+ kRefIncrement;
}
bool IsImmortal() const {
- return (count_.load(std::memory_order_relaxed) & kImmortalTag) != 0;
+ return (count_.load(std::memory_order_relaxed) & kImmortalFlag) != 0;
}
private:
- // We reserve the bottom bit to tag a reference count as immortal.
- // By making it `1` we ensure that we never reach `0` when adding/subtracting
- // `2`, thus it never looks as if it should be destroyed.
- // These are used for the StringConstant constructor where we do not increase
- // the refcount at construction time (due to constinit requirements) but we
- // will still decrease it at destruction time to avoid branching on Unref.
+ // We reserve the bottom bits for flags.
+ // kImmortalBit indicates that this entity should never be collected; it is
+ // used for the StringConstant constructor to avoid collecting immutable
+ // constant cords.
+ // kReservedFlag is reserved for future use.
enum {
- kImmortalShift = 1,
- kRefIncrement = 1 << kImmortalShift,
- kImmortalTag = kRefIncrement - 1
+ kNumFlags = 2,
+
+ kImmortalFlag = 0x1,
+ kCrcFlag = 0x2,
+ kRefIncrement = (1 << kNumFlags),
+
+ // Bitmask to use when checking refcount by equality. This masks out
+ // all flags except kImmortalFlag, which is part of the refcount for
+ // purposes of equality. (A refcount of 0 or 1 does not count as 0 or 1
+ // if the immortal bit is set.)
+ kRefcountMask = ~kCrcFlag,
};
std::atomic<int32_t> count_;
@@ -150,37 +193,67 @@ struct CordRepExternal;
struct CordRepFlat;
struct CordRepSubstring;
class CordRepRing;
+class CordRepBtree;
// Various representations that we allow
enum CordRepKind {
CONCAT = 0,
- EXTERNAL = 1,
- SUBSTRING = 2,
+ SUBSTRING = 1,
+ BTREE = 2,
RING = 3,
+ EXTERNAL = 4,
// We have different tags for different sized flat arrays,
- // starting with FLAT, and limited to MAX_FLAT_TAG. The 224 value is based on
+ // starting with FLAT, and limited to MAX_FLAT_TAG. The 225 value is based on
// the current 'size to tag' encoding of 8 / 32 bytes. If a new tag is needed
// in the future, then 'FLAT' and 'MAX_FLAT_TAG' should be adjusted as well
// as the Tag <---> Size logic so that FLAT stil represents the minimum flat
// allocation size. (32 bytes as of now).
- FLAT = 4,
- MAX_FLAT_TAG = 224
+ FLAT = 5,
+ MAX_FLAT_TAG = 225
};
+// There are various locations where we want to check if some rep is a 'plain'
+// data edge, i.e. an external or flat rep. By having FLAT == EXTERNAL + 1, we
+// can perform this check in a single branch as 'tag >= EXTERNAL'
+// Likewise, we have some locations where we check for 'ring or external/flat',
+// so likewise align RING to EXTERNAL.
+// Note that we can leave this optimization to the compiler. The compiler will
+// DTRT when it sees a condition like `tag == EXTERNAL || tag >= FLAT`.
+static_assert(RING == BTREE + 1, "BTREE and RING not consecutive");
+static_assert(EXTERNAL == RING + 1, "BTREE and EXTERNAL not consecutive");
+static_assert(FLAT == EXTERNAL + 1, "EXTERNAL and FLAT not consecutive");
+
struct CordRep {
CordRep() = default;
- constexpr CordRep(Refcount::Immortal immortal, size_t l)
+ constexpr CordRep(RefcountAndFlags::Immortal immortal, size_t l)
: length(l), refcount(immortal), tag(EXTERNAL), storage{} {}
// The following three fields have to be less than 32 bytes since
// that is the smallest supported flat node size.
size_t length;
- Refcount refcount;
+ RefcountAndFlags refcount;
// If tag < FLAT, it represents CordRepKind and indicates the type of node.
// Otherwise, the node type is CordRepFlat and the tag is the encoded size.
uint8_t tag;
- char storage[1]; // Starting point for flat array: MUST BE LAST FIELD
+
+ // `storage` provides two main purposes:
+ // - the starting point for FlatCordRep.Data() [flexible-array-member]
+ // - 3 bytes of additional storage for use by derived classes.
+ // The latter is used by CordrepConcat and CordRepBtree. CordRepConcat stores
+ // a 'depth' value in storage[0], and the (future) CordRepBtree class stores
+ // `height`, `begin` and `end` in the 3 entries. Otherwise we would need to
+ // allocate room for these in the derived class, as not all compilers reuse
+ // padding space from the base class (clang and gcc do, MSVC does not, etc)
+ uint8_t storage[3];
+
+ // Returns true if this instance's tag matches the requested type.
+ constexpr bool IsRing() const { return tag == RING; }
+ constexpr bool IsConcat() const { return tag == CONCAT; }
+ constexpr bool IsSubstring() const { return tag == SUBSTRING; }
+ constexpr bool IsExternal() const { return tag == EXTERNAL; }
+ constexpr bool IsFlat() const { return tag >= FLAT; }
+ constexpr bool IsBtree() const { return tag == BTREE; }
inline CordRepRing* ring();
inline const CordRepRing* ring() const;
@@ -192,6 +265,8 @@ struct CordRep {
inline const CordRepExternal* external() const;
inline CordRepFlat* flat();
inline const CordRepFlat* flat() const;
+ inline CordRepBtree* btree();
+ inline const CordRepBtree* btree() const;
// --------------------------------------------------------------------
// Memory management
@@ -212,8 +287,8 @@ struct CordRepConcat : public CordRep {
CordRep* left;
CordRep* right;
- uint8_t depth() const { return static_cast<uint8_t>(storage[0]); }
- void set_depth(uint8_t depth) { storage[0] = static_cast<char>(depth); }
+ uint8_t depth() const { return storage[0]; }
+ void set_depth(uint8_t depth) { storage[0] = depth; }
};
struct CordRepSubstring : public CordRep {
@@ -231,7 +306,7 @@ using ExternalReleaserInvoker = void (*)(CordRepExternal*);
struct CordRepExternal : public CordRep {
CordRepExternal() = default;
explicit constexpr CordRepExternal(absl::string_view str)
- : CordRep(Refcount::Immortal{}, str.size()),
+ : CordRep(RefcountAndFlags::Immortal{}, str.size()),
base(str.data()),
releaser_invoker(nullptr) {}
@@ -240,7 +315,7 @@ struct CordRepExternal : public CordRep {
ExternalReleaserInvoker releaser_invoker;
// Deletes (releases) the external rep.
- // Requires rep != nullptr and rep->tag == EXTERNAL
+ // Requires rep != nullptr and rep->IsExternal()
static void Delete(CordRep* rep);
};
@@ -283,7 +358,7 @@ struct CordRepExternalImpl
};
inline void CordRepExternal::Delete(CordRep* rep) {
- assert(rep != nullptr && rep->tag == EXTERNAL);
+ assert(rep != nullptr && rep->IsExternal());
auto* rep_external = static_cast<CordRepExternal*>(rep);
assert(rep_external->releaser_invoker != nullptr);
rep_external->releaser_invoker(rep_external);
@@ -329,18 +404,17 @@ static constexpr cordz_info_t BigEndianByte(unsigned char value) {
class InlineData {
public:
+ // DefaultInitType forces the use of the default initialization constructor.
+ enum DefaultInitType { kDefaultInit };
+
// kNullCordzInfo holds the big endian representation of intptr_t(1)
// This is the 'null' / initial value of 'cordz_info'. The null value
// is specifically big endian 1 as with 64-bit pointers, the last
// byte of cordz_info overlaps with the last byte holding the tag.
static constexpr cordz_info_t kNullCordzInfo = BigEndianByte(1);
- // kFakeCordzInfo holds a 'fake', non-null cordz-info value we use to
- // emulate the previous 'kProfiled' tag logic in 'set_profiled' until
- // cord code is changed to store cordz_info values in InlineData.
- static constexpr cordz_info_t kFakeCordzInfo = BigEndianByte(9);
-
constexpr InlineData() : as_chars_{0} {}
+ explicit InlineData(DefaultInitType) {}
explicit constexpr InlineData(CordRep* rep) : as_tree_(rep) {}
explicit constexpr InlineData(absl::string_view chars)
: as_chars_{
@@ -367,6 +441,16 @@ class InlineData {
return as_tree_.cordz_info != kNullCordzInfo;
}
+ // Returns true if either of the provided instances hold a cordz_info value.
+ // This method is more efficient than the equivalent `data1.is_profiled() ||
+ // data2.is_profiled()`. Requires both arguments to hold a tree.
+ static bool is_either_profiled(const InlineData& data1,
+ const InlineData& data2) {
+ assert(data1.is_tree() && data2.is_tree());
+ return (data1.as_tree_.cordz_info | data2.as_tree_.cordz_info) !=
+ kNullCordzInfo;
+ }
+
// Returns the cordz_info sampling instance for this instance, or nullptr
// if the current instance is not sampled and does not have CordzInfo data.
// Requires the current instance to hold a tree value.
@@ -454,13 +538,6 @@ class InlineData {
tag() = static_cast<char>(size << 1);
}
- // Sets or unsets the 'is_profiled' state of this instance.
- // Requires the current instance to hold a tree value.
- void set_profiled(bool profiled) {
- assert(is_tree());
- as_tree_.cordz_info = profiled ? kFakeCordzInfo : kNullCordzInfo;
- }
-
private:
// See cordz_info_t for forced alignment and size of `cordz_info` details.
struct AsTree {
@@ -483,7 +560,7 @@ class InlineData {
// store the size in the last char of `as_chars_` shifted left + 1.
// Else we store it in a tree and store a pointer to that tree in
// `as_tree_.rep` and store a tag in `tagged_size`.
- union {
+ union {
char as_chars_[kMaxInline + 1];
AsTree as_tree_;
};
@@ -492,32 +569,32 @@ class InlineData {
static_assert(sizeof(InlineData) == kMaxInline + 1, "");
inline CordRepConcat* CordRep::concat() {
- assert(tag == CONCAT);
+ assert(IsConcat());
return static_cast<CordRepConcat*>(this);
}
inline const CordRepConcat* CordRep::concat() const {
- assert(tag == CONCAT);
+ assert(IsConcat());
return static_cast<const CordRepConcat*>(this);
}
inline CordRepSubstring* CordRep::substring() {
- assert(tag == SUBSTRING);
+ assert(IsSubstring());
return static_cast<CordRepSubstring*>(this);
}
inline const CordRepSubstring* CordRep::substring() const {
- assert(tag == SUBSTRING);
+ assert(IsSubstring());
return static_cast<const CordRepSubstring*>(this);
}
inline CordRepExternal* CordRep::external() {
- assert(tag == EXTERNAL);
+ assert(IsExternal());
return static_cast<CordRepExternal*>(this);
}
inline const CordRepExternal* CordRep::external() const {
- assert(tag == EXTERNAL);
+ assert(IsExternal());
return static_cast<const CordRepExternal*>(this);
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal_test.cc
new file mode 100644
index 00000000..0758dfef
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_internal_test.cc
@@ -0,0 +1,116 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_internal.h"
+
+#include "gmock/gmock.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+TEST(RefcountAndFlags, NormalRefcount) {
+ for (bool expect_high_refcount : {false, true}) {
+ SCOPED_TRACE(expect_high_refcount);
+ RefcountAndFlags refcount;
+ // count = 1
+
+ EXPECT_FALSE(refcount.HasCrc());
+ EXPECT_TRUE(refcount.IsMutable());
+ EXPECT_TRUE(refcount.IsOne());
+
+ refcount.Increment();
+ // count = 2
+
+ EXPECT_FALSE(refcount.HasCrc());
+ EXPECT_FALSE(refcount.IsMutable());
+ EXPECT_FALSE(refcount.IsOne());
+
+ // Decrementing should return true, since a reference is outstanding.
+ if (expect_high_refcount) {
+ EXPECT_TRUE(refcount.DecrementExpectHighRefcount());
+ } else {
+ EXPECT_TRUE(refcount.Decrement());
+ }
+ // count = 1
+
+ EXPECT_FALSE(refcount.HasCrc());
+ EXPECT_TRUE(refcount.IsMutable());
+ EXPECT_TRUE(refcount.IsOne());
+
+ // One more decremnt will return false, as no references remain.
+ if (expect_high_refcount) {
+ EXPECT_FALSE(refcount.DecrementExpectHighRefcount());
+ } else {
+ EXPECT_FALSE(refcount.Decrement());
+ }
+ }
+}
+
+TEST(RefcountAndFlags, CrcRefcount) {
+ for (bool expect_high_refcount : {false, true}) {
+ SCOPED_TRACE(expect_high_refcount);
+ RefcountAndFlags refcount(RefcountAndFlags::WithCrc{});
+ // count = 1
+
+ // A CRC-carrying node is never mutable, but can be unshared
+ EXPECT_TRUE(refcount.HasCrc());
+ EXPECT_FALSE(refcount.IsMutable());
+ EXPECT_TRUE(refcount.IsOne());
+
+ refcount.Increment();
+ // count = 2
+
+ EXPECT_TRUE(refcount.HasCrc());
+ EXPECT_FALSE(refcount.IsMutable());
+ EXPECT_FALSE(refcount.IsOne());
+
+ // Decrementing should return true, since a reference is outstanding.
+ if (expect_high_refcount) {
+ EXPECT_TRUE(refcount.DecrementExpectHighRefcount());
+ } else {
+ EXPECT_TRUE(refcount.Decrement());
+ }
+ // count = 1
+
+ EXPECT_TRUE(refcount.HasCrc());
+ EXPECT_FALSE(refcount.IsMutable());
+ EXPECT_TRUE(refcount.IsOne());
+
+ // One more decremnt will return false, as no references remain.
+ if (expect_high_refcount) {
+ EXPECT_FALSE(refcount.DecrementExpectHighRefcount());
+ } else {
+ EXPECT_FALSE(refcount.Decrement());
+ }
+ }
+}
+
+TEST(RefcountAndFlags, ImmortalRefcount) {
+ RefcountAndFlags immortal_refcount(RefcountAndFlags::Immortal{});
+
+ for (int i = 0; i < 100; ++i) {
+ // An immortal refcount is never unshared, and decrementing never causes
+ // a collection.
+ EXPECT_FALSE(immortal_refcount.HasCrc());
+ EXPECT_FALSE(immortal_refcount.IsMutable());
+ EXPECT_FALSE(immortal_refcount.IsOne());
+ EXPECT_TRUE(immortal_refcount.Decrement());
+ EXPECT_TRUE(immortal_refcount.DecrementExpectHighRefcount());
+ }
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc
new file mode 100644
index 00000000..4404f33a
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc
@@ -0,0 +1,1128 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree.h"
+
+#include <cassert>
+#include <cstdint>
+#include <iostream>
+#include <string>
+
+#include "absl/base/attributes.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_consume.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+constexpr size_t CordRepBtree::kMaxCapacity; // NOLINT: needed for c++ < c++17
+
+namespace {
+
+using NodeStack = CordRepBtree * [CordRepBtree::kMaxDepth];
+using EdgeType = CordRepBtree::EdgeType;
+using OpResult = CordRepBtree::OpResult;
+using CopyResult = CordRepBtree::CopyResult;
+
+constexpr auto kFront = CordRepBtree::kFront;
+constexpr auto kBack = CordRepBtree::kBack;
+
+inline bool exhaustive_validation() {
+ return cord_btree_exhaustive_validation.load(std::memory_order_relaxed);
+}
+
+// Implementation of the various 'Dump' functions.
+// Prints the entire tree structure or 'rep'. External callers should
+// not specify 'depth' and leave it to its default (0) value.
+// Rep may be a CordRepBtree tree, or a SUBSTRING / EXTERNAL / FLAT node.
+void DumpAll(const CordRep* rep, bool include_contents, std::ostream& stream,
+ int depth = 0) {
+ // Allow for full height trees + substring -> flat / external nodes.
+ assert(depth <= CordRepBtree::kMaxDepth + 2);
+ std::string sharing = const_cast<CordRep*>(rep)->refcount.IsOne()
+ ? std::string("Private")
+ : absl::StrCat("Shared(", rep->refcount.Get(), ")");
+ std::string sptr = absl::StrCat("0x", absl::Hex(rep));
+
+ // Dumps the data contents of `rep` if `include_contents` is true.
+ // Always emits a new line character.
+ auto maybe_dump_data = [&stream, include_contents](const CordRep* r) {
+ if (include_contents) {
+ // Allow for up to 60 wide display of content data, which with some
+ // indentation and prefix / labels keeps us within roughly 80-100 wide.
+ constexpr size_t kMaxDataLength = 60;
+ stream << ", data = \""
+ << CordRepBtree::EdgeData(r).substr(0, kMaxDataLength)
+ << (r->length > kMaxDataLength ? "\"..." : "\"");
+ }
+ stream << '\n';
+ };
+
+ // For each level, we print the 'shared/private' state and the rep pointer,
+ // indented by two spaces per recursive depth.
+ stream << std::string(depth * 2, ' ') << sharing << " (" << sptr << ") ";
+
+ if (rep->IsBtree()) {
+ const CordRepBtree* node = rep->btree();
+ std::string label =
+ node->height() ? absl::StrCat("Node(", node->height(), ")") : "Leaf";
+ stream << label << ", len = " << node->length
+ << ", begin = " << node->begin() << ", end = " << node->end()
+ << "\n";
+ for (CordRep* edge : node->Edges()) {
+ DumpAll(edge, include_contents, stream, depth + 1);
+ }
+ } else if (rep->tag == SUBSTRING) {
+ const CordRepSubstring* substring = rep->substring();
+ stream << "Substring, len = " << rep->length
+ << ", start = " << substring->start;
+ maybe_dump_data(rep);
+ DumpAll(substring->child, include_contents, stream, depth + 1);
+ } else if (rep->tag >= FLAT) {
+ stream << "Flat, len = " << rep->length
+ << ", cap = " << rep->flat()->Capacity();
+ maybe_dump_data(rep);
+ } else if (rep->tag == EXTERNAL) {
+ stream << "Extn, len = " << rep->length;
+ maybe_dump_data(rep);
+ }
+}
+
+// TODO(b/192061034): add 'bytes to copy' logic to avoid large slop on substring
+// small data out of large reps, and general efficiency of 'always copy small
+// data'. Consider making this a cord rep internal library function.
+CordRepSubstring* CreateSubstring(CordRep* rep, size_t offset, size_t n) {
+ assert(n != 0);
+ assert(offset + n <= rep->length);
+ assert(offset != 0 || n != rep->length);
+
+ if (rep->tag == SUBSTRING) {
+ CordRepSubstring* substring = rep->substring();
+ offset += substring->start;
+ rep = CordRep::Ref(substring->child);
+ CordRep::Unref(substring);
+ }
+ CordRepSubstring* substring = new CordRepSubstring();
+ substring->length = n;
+ substring->tag = SUBSTRING;
+ substring->start = offset;
+ substring->child = rep;
+ return substring;
+}
+
+// TODO(b/192061034): consider making this a cord rep library function.
+inline CordRep* MakeSubstring(CordRep* rep, size_t offset, size_t n) {
+ if (n == rep->length) return rep;
+ if (n == 0) return CordRep::Unref(rep), nullptr;
+ return CreateSubstring(rep, offset, n);
+}
+
+// TODO(b/192061034): consider making this a cord rep library function.
+inline CordRep* MakeSubstring(CordRep* rep, size_t offset) {
+ if (offset == 0) return rep;
+ return CreateSubstring(rep, offset, rep->length - offset);
+}
+
+// Resizes `edge` to the provided `length`. Adopts a reference on `edge`.
+// This method directly returns `edge` if `length` equals `edge->length`.
+// If `is_mutable` is set to true, this function may return `edge` with
+// `edge->length` set to the new length depending on the type and size of
+// `edge`. Otherwise, this function returns a new CordRepSubstring value.
+// Requires `length > 0 && length <= edge->length`.
+CordRep* ResizeEdge(CordRep* edge, size_t length, bool is_mutable) {
+ assert(length > 0);
+ assert(length <= edge->length);
+ assert(CordRepBtree::IsDataEdge(edge));
+ if (length >= edge->length) return edge;
+
+ if (is_mutable && (edge->tag >= FLAT || edge->tag == SUBSTRING)) {
+ edge->length = length;
+ return edge;
+ }
+
+ return CreateSubstring(edge, 0, length);
+}
+
+template <EdgeType edge_type>
+inline absl::string_view Consume(absl::string_view s, size_t n) {
+ return edge_type == kBack ? s.substr(n) : s.substr(0, s.size() - n);
+}
+
+template <EdgeType edge_type>
+inline absl::string_view Consume(char* dst, absl::string_view s, size_t n) {
+ if (edge_type == kBack) {
+ memcpy(dst, s.data(), n);
+ return s.substr(n);
+ } else {
+ const size_t offset = s.size() - n;
+ memcpy(dst, s.data() + offset, n);
+ return s.substr(0, offset);
+ }
+}
+
+// Known issue / optimization weirdness: the store associated with the
+// decrement introduces traffic between cpus (even if the result of that
+// traffic does nothing), making this faster than a single call to
+// refcount.Decrement() checking the zero refcount condition.
+template <typename R, typename Fn>
+inline void FastUnref(R* r, Fn&& fn) {
+ if (r->refcount.IsOne()) {
+ fn(r);
+ } else if (!r->refcount.DecrementExpectHighRefcount()) {
+ fn(r);
+ }
+}
+
+// Deletes a leaf node data edge. Requires `rep` to be an EXTERNAL or FLAT
+// node, or a SUBSTRING of an EXTERNAL or FLAT node.
+void DeleteLeafEdge(CordRep* rep) {
+ for (;;) {
+ if (rep->tag >= FLAT) {
+ CordRepFlat::Delete(rep->flat());
+ return;
+ }
+ if (rep->tag == EXTERNAL) {
+ CordRepExternal::Delete(rep->external());
+ return;
+ }
+ assert(rep->tag == SUBSTRING);
+ CordRepSubstring* substring = rep->substring();
+ rep = substring->child;
+ assert(rep->tag == EXTERNAL || rep->tag >= FLAT);
+ delete substring;
+ if (rep->refcount.Decrement()) return;
+ }
+}
+
+// StackOperations contains the logic to build a left-most or right-most stack
+// (leg) down to the leaf level of a btree, and 'unwind' / 'Finalize' methods to
+// propagate node changes up the stack.
+template <EdgeType edge_type>
+struct StackOperations {
+ // Returns true if the node at 'depth' is mutable, i.e. has a refcount
+ // of one, carries no CRC, and all of its parent nodes have a refcount of one.
+ inline bool owned(int depth) const { return depth < share_depth; }
+
+ // Returns the node at 'depth'.
+ inline CordRepBtree* node(int depth) const { return stack[depth]; }
+
+ // Builds a `depth` levels deep stack starting at `tree` recording which nodes
+ // are private in the form of the 'share depth' where nodes are shared.
+ inline CordRepBtree* BuildStack(CordRepBtree* tree, int depth) {
+ assert(depth <= tree->height());
+ int current_depth = 0;
+ while (current_depth < depth && tree->refcount.IsMutable()) {
+ stack[current_depth++] = tree;
+ tree = tree->Edge(edge_type)->btree();
+ }
+ share_depth = current_depth + (tree->refcount.IsMutable() ? 1 : 0);
+ while (current_depth < depth) {
+ stack[current_depth++] = tree;
+ tree = tree->Edge(edge_type)->btree();
+ }
+ return tree;
+ }
+
+ // Builds a stack with the invariant that all nodes are private owned / not
+ // shared and carry no CRC data. This is used in iterative updates where a
+ // previous propagation guaranteed all nodes have this property.
+ inline void BuildOwnedStack(CordRepBtree* tree, int height) {
+ assert(height <= CordRepBtree::kMaxHeight);
+ int depth = 0;
+ while (depth < height) {
+ assert(tree->refcount.IsMutable());
+ stack[depth++] = tree;
+ tree = tree->Edge(edge_type)->btree();
+ }
+ assert(tree->refcount.IsMutable());
+ share_depth = depth + 1;
+ }
+
+ // Processes the final 'top level' result action for the tree.
+ // See the 'Action' enum for the various action implications.
+ static inline CordRepBtree* Finalize(CordRepBtree* tree, OpResult result) {
+ switch (result.action) {
+ case CordRepBtree::kPopped:
+ tree = edge_type == kBack ? CordRepBtree::New(tree, result.tree)
+ : CordRepBtree::New(result.tree, tree);
+ if (ABSL_PREDICT_FALSE(tree->height() > CordRepBtree::kMaxHeight)) {
+ tree = CordRepBtree::Rebuild(tree);
+ ABSL_RAW_CHECK(tree->height() <= CordRepBtree::kMaxHeight,
+ "Max height exceeded");
+ }
+ return tree;
+ case CordRepBtree::kCopied:
+ CordRep::Unref(tree);
+ ABSL_FALLTHROUGH_INTENDED;
+ case CordRepBtree::kSelf:
+ return result.tree;
+ }
+ ABSL_INTERNAL_UNREACHABLE;
+ return result.tree;
+ }
+
+ // Propagate the action result in 'result' up into all nodes of the stack
+ // starting at depth 'depth'. 'length' contains the extra length of data that
+ // was added at the lowest level, and is updated into all nodes of the stack.
+ // See the 'Action' enum for the various action implications.
+ // If 'propagate' is true, then any copied node values are updated into the
+ // stack, which is used for iterative processing on the same stack.
+ template <bool propagate = false>
+ inline CordRepBtree* Unwind(CordRepBtree* tree, int depth, size_t length,
+ OpResult result) {
+ // TODO(mvels): revisit the below code to check if 3 loops with 3
+ // (incremental) conditions is faster than 1 loop with a switch.
+ // Benchmarking and perf recordings indicate the loop with switch is
+ // fastest, likely because of indirect jumps on the tight case values and
+ // dense branches. But it's worth considering 3 loops, as the `action`
+ // transitions are mono directional. E.g.:
+ // while (action == kPopped) {
+ // ...
+ // }
+ // while (action == kCopied) {
+ // ...
+ // }
+ // ...
+ // We also found that an "if () do {}" loop here seems faster, possibly
+ // because it allows the branch predictor more granular heuristics on
+ // 'single leaf' (`depth` == 0) and 'single depth' (`depth` == 1) cases
+ // which appear to be the most common use cases.
+ if (depth != 0) {
+ do {
+ CordRepBtree* node = stack[--depth];
+ const bool owned = depth < share_depth;
+ switch (result.action) {
+ case CordRepBtree::kPopped:
+ assert(!propagate);
+ result = node->AddEdge<edge_type>(owned, result.tree, length);
+ break;
+ case CordRepBtree::kCopied:
+ result = node->SetEdge<edge_type>(owned, result.tree, length);
+ if (propagate) stack[depth] = result.tree;
+ break;
+ case CordRepBtree::kSelf:
+ node->length += length;
+ while (depth > 0) {
+ node = stack[--depth];
+ node->length += length;
+ }
+ return node;
+ }
+ } while (depth > 0);
+ }
+ return Finalize(tree, result);
+ }
+
+ // Invokes `Unwind` with `propagate=true` to update the stack node values.
+ inline CordRepBtree* Propagate(CordRepBtree* tree, int depth, size_t length,
+ OpResult result) {
+ return Unwind</*propagate=*/true>(tree, depth, length, result);
+ }
+
+ // `share_depth` contains the depth at which the nodes in the stack cannot
+ // be mutated. I.e., if the top most level is shared (i.e.:
+ // `!refcount.IsMutable()`), then `share_depth` is 0. If the 2nd node
+ // is shared (and implicitly all nodes below that) then `share_depth` is 1,
+ // etc. A `share_depth` greater than the depth of the stack indicates that
+ // none of the nodes in the stack are shared.
+ int share_depth;
+
+ NodeStack stack;
+};
+
+} // namespace
+
+void CordRepBtree::Dump(const CordRep* rep, absl::string_view label,
+ bool include_contents, std::ostream& stream) {
+ stream << "===================================\n";
+ if (!label.empty()) {
+ stream << label << '\n';
+ stream << "-----------------------------------\n";
+ }
+ if (rep) {
+ DumpAll(rep, include_contents, stream);
+ } else {
+ stream << "NULL\n";
+ }
+}
+
+void CordRepBtree::Dump(const CordRep* rep, absl::string_view label,
+ std::ostream& stream) {
+ Dump(rep, label, false, stream);
+}
+
+void CordRepBtree::Dump(const CordRep* rep, std::ostream& stream) {
+ Dump(rep, absl::string_view(), false, stream);
+}
+
+void CordRepBtree::DestroyLeaf(CordRepBtree* tree, size_t begin, size_t end) {
+ for (CordRep* edge : tree->Edges(begin, end)) {
+ FastUnref(edge, DeleteLeafEdge);
+ }
+ Delete(tree);
+}
+
+void CordRepBtree::DestroyNonLeaf(CordRepBtree* tree, size_t begin,
+ size_t end) {
+ for (CordRep* edge : tree->Edges(begin, end)) {
+ FastUnref(edge->btree(), Destroy);
+ }
+ Delete(tree);
+}
+
+bool CordRepBtree::IsValid(const CordRepBtree* tree, bool shallow) {
+#define NODE_CHECK_VALID(x) \
+ if (!(x)) { \
+ ABSL_RAW_LOG(ERROR, "CordRepBtree::CheckValid() FAILED: %s", #x); \
+ return false; \
+ }
+#define NODE_CHECK_EQ(x, y) \
+ if ((x) != (y)) { \
+ ABSL_RAW_LOG(ERROR, \
+ "CordRepBtree::CheckValid() FAILED: %s != %s (%s vs %s)", #x, \
+ #y, absl::StrCat(x).c_str(), absl::StrCat(y).c_str()); \
+ return false; \
+ }
+
+ NODE_CHECK_VALID(tree != nullptr);
+ NODE_CHECK_VALID(tree->IsBtree());
+ NODE_CHECK_VALID(tree->height() <= kMaxHeight);
+ NODE_CHECK_VALID(tree->begin() < tree->capacity());
+ NODE_CHECK_VALID(tree->end() <= tree->capacity());
+ NODE_CHECK_VALID(tree->begin() <= tree->end());
+ size_t child_length = 0;
+ for (CordRep* edge : tree->Edges()) {
+ NODE_CHECK_VALID(edge != nullptr);
+ if (tree->height() > 0) {
+ NODE_CHECK_VALID(edge->IsBtree());
+ NODE_CHECK_VALID(edge->btree()->height() == tree->height() - 1);
+ } else {
+ NODE_CHECK_VALID(IsDataEdge(edge));
+ }
+ child_length += edge->length;
+ }
+ NODE_CHECK_EQ(child_length, tree->length);
+ if ((!shallow || exhaustive_validation()) && tree->height() > 0) {
+ for (CordRep* edge : tree->Edges()) {
+ if (!IsValid(edge->btree(), shallow)) return false;
+ }
+ }
+ return true;
+
+#undef NODE_CHECK_VALID
+#undef NODE_CHECK_EQ
+}
+
+#ifndef NDEBUG
+
+CordRepBtree* CordRepBtree::AssertValid(CordRepBtree* tree, bool shallow) {
+ if (!IsValid(tree, shallow)) {
+ Dump(tree, "CordRepBtree validation failed:", false, std::cout);
+ ABSL_RAW_LOG(FATAL, "CordRepBtree::CheckValid() FAILED");
+ }
+ return tree;
+}
+
+const CordRepBtree* CordRepBtree::AssertValid(const CordRepBtree* tree,
+ bool shallow) {
+ if (!IsValid(tree, shallow)) {
+ Dump(tree, "CordRepBtree validation failed:", false, std::cout);
+ ABSL_RAW_LOG(FATAL, "CordRepBtree::CheckValid() FAILED");
+ }
+ return tree;
+}
+
+#endif // NDEBUG
+
+template <EdgeType edge_type>
+inline OpResult CordRepBtree::AddEdge(bool owned, CordRep* edge, size_t delta) {
+ if (size() >= kMaxCapacity) return {New(edge), kPopped};
+ OpResult result = ToOpResult(owned);
+ result.tree->Add<edge_type>(edge);
+ result.tree->length += delta;
+ return result;
+}
+
+template <EdgeType edge_type>
+OpResult CordRepBtree::SetEdge(bool owned, CordRep* edge, size_t delta) {
+ OpResult result;
+ const size_t idx = index(edge_type);
+ if (owned) {
+ result = {this, kSelf};
+ CordRep::Unref(edges_[idx]);
+ } else {
+ // Create a copy containing all unchanged edges. Unchanged edges are the
+ // open interval [begin, back) or [begin + 1, end) depending on `edge_type`.
+ // We conveniently cover both case using a constexpr `shift` being 0 or 1
+ // as `end :== back + 1`.
+ result = {CopyRaw(), kCopied};
+ constexpr int shift = edge_type == kFront ? 1 : 0;
+ for (CordRep* r : Edges(begin() + shift, back() + shift)) {
+ CordRep::Ref(r);
+ }
+ }
+ result.tree->edges_[idx] = edge;
+ result.tree->length += delta;
+ return result;
+}
+
+template <EdgeType edge_type>
+CordRepBtree* CordRepBtree::AddCordRep(CordRepBtree* tree, CordRep* rep) {
+ const int depth = tree->height();
+ const size_t length = rep->length;
+ StackOperations<edge_type> ops;
+ CordRepBtree* leaf = ops.BuildStack(tree, depth);
+ const OpResult result =
+ leaf->AddEdge<edge_type>(ops.owned(depth), rep, length);
+ return ops.Unwind(tree, depth, length, result);
+}
+
+template <>
+CordRepBtree* CordRepBtree::NewLeaf<kBack>(absl::string_view data,
+ size_t extra) {
+ CordRepBtree* leaf = CordRepBtree::New(0);
+ size_t length = 0;
+ size_t end = 0;
+ const size_t cap = leaf->capacity();
+ while (!data.empty() && end != cap) {
+ auto* flat = CordRepFlat::New(data.length() + extra);
+ flat->length = (std::min)(data.length(), flat->Capacity());
+ length += flat->length;
+ leaf->edges_[end++] = flat;
+ data = Consume<kBack>(flat->Data(), data, flat->length);
+ }
+ leaf->length = length;
+ leaf->set_end(end);
+ return leaf;
+}
+
+template <>
+CordRepBtree* CordRepBtree::NewLeaf<kFront>(absl::string_view data,
+ size_t extra) {
+ CordRepBtree* leaf = CordRepBtree::New(0);
+ size_t length = 0;
+ size_t begin = leaf->capacity();
+ leaf->set_end(leaf->capacity());
+ while (!data.empty() && begin != 0) {
+ auto* flat = CordRepFlat::New(data.length() + extra);
+ flat->length = (std::min)(data.length(), flat->Capacity());
+ length += flat->length;
+ leaf->edges_[--begin] = flat;
+ data = Consume<kFront>(flat->Data(), data, flat->length);
+ }
+ leaf->length = length;
+ leaf->set_begin(begin);
+ return leaf;
+}
+
+template <>
+absl::string_view CordRepBtree::AddData<kBack>(absl::string_view data,
+ size_t extra) {
+ assert(!data.empty());
+ assert(size() < capacity());
+ AlignBegin();
+ const size_t cap = capacity();
+ do {
+ CordRepFlat* flat = CordRepFlat::New(data.length() + extra);
+ const size_t n = (std::min)(data.length(), flat->Capacity());
+ flat->length = n;
+ edges_[fetch_add_end(1)] = flat;
+ data = Consume<kBack>(flat->Data(), data, n);
+ } while (!data.empty() && end() != cap);
+ return data;
+}
+
+template <>
+absl::string_view CordRepBtree::AddData<kFront>(absl::string_view data,
+ size_t extra) {
+ assert(!data.empty());
+ assert(size() < capacity());
+ AlignEnd();
+ do {
+ CordRepFlat* flat = CordRepFlat::New(data.length() + extra);
+ const size_t n = (std::min)(data.length(), flat->Capacity());
+ flat->length = n;
+ edges_[sub_fetch_begin(1)] = flat;
+ data = Consume<kFront>(flat->Data(), data, n);
+ } while (!data.empty() && begin() != 0);
+ return data;
+}
+
+template <EdgeType edge_type>
+CordRepBtree* CordRepBtree::AddData(CordRepBtree* tree, absl::string_view data,
+ size_t extra) {
+ if (ABSL_PREDICT_FALSE(data.empty())) return tree;
+
+ const size_t original_data_size = data.size();
+ int depth = tree->height();
+ StackOperations<edge_type> ops;
+ CordRepBtree* leaf = ops.BuildStack(tree, depth);
+
+ // If there is capacity in the last edge, append as much data
+ // as possible into this last edge.
+ if (leaf->size() < leaf->capacity()) {
+ OpResult result = leaf->ToOpResult(ops.owned(depth));
+ data = result.tree->AddData<edge_type>(data, extra);
+ if (data.empty()) {
+ result.tree->length += original_data_size;
+ return ops.Unwind(tree, depth, original_data_size, result);
+ }
+
+ // We added some data into this leaf, but not all. Propagate the added
+ // length to the top most node, and rebuild the stack with any newly copied
+ // or updated nodes. From this point on, the path (leg) from the top most
+ // node to the right-most node towards the leaf node is privately owned.
+ size_t delta = original_data_size - data.size();
+ assert(delta > 0);
+ result.tree->length += delta;
+ tree = ops.Propagate(tree, depth, delta, result);
+ ops.share_depth = depth + 1;
+ }
+
+ // We were unable to append all data into the existing right-most leaf node.
+ // This means all remaining data must be put into (a) new leaf node(s) which
+ // we append to the tree. To make this efficient, we iteratively build full
+ // leaf nodes from `data` until the created leaf contains all remaining data.
+ // We utilize the `Unwind` method to merge the created leaf into the first
+ // level towards root that has capacity. On each iteration with remaining
+ // data, we rebuild the stack in the knowledge that right-most nodes are
+ // privately owned after the first `Unwind` completes.
+ for (;;) {
+ OpResult result = {CordRepBtree::NewLeaf<edge_type>(data, extra), kPopped};
+ if (result.tree->length == data.size()) {
+ return ops.Unwind(tree, depth, result.tree->length, result);
+ }
+ data = Consume<edge_type>(data, result.tree->length);
+ tree = ops.Unwind(tree, depth, result.tree->length, result);
+ depth = tree->height();
+ ops.BuildOwnedStack(tree, depth);
+ }
+}
+
+template <EdgeType edge_type>
+CordRepBtree* CordRepBtree::Merge(CordRepBtree* dst, CordRepBtree* src) {
+ assert(dst->height() >= src->height());
+
+ // Capture source length as we may consume / destroy `src`.
+ const size_t length = src->length;
+
+ // We attempt to merge `src` at its corresponding height in `dst`.
+ const int depth = dst->height() - src->height();
+ StackOperations<edge_type> ops;
+ CordRepBtree* merge_node = ops.BuildStack(dst, depth);
+
+ // If there is enough space in `merge_node` for all edges from `src`, add all
+ // edges to this node, making a fresh copy as needed if not privately owned.
+ // If `merge_node` does not have capacity for `src`, we rely on `Unwind` and
+ // `Finalize` to merge `src` into the first level towards `root` where there
+ // is capacity for another edge, or create a new top level node.
+ OpResult result;
+ if (merge_node->size() + src->size() <= kMaxCapacity) {
+ result = merge_node->ToOpResult(ops.owned(depth));
+ result.tree->Add<edge_type>(src->Edges());
+ result.tree->length += src->length;
+ if (src->refcount.IsOne()) {
+ Delete(src);
+ } else {
+ for (CordRep* edge : src->Edges()) CordRep::Ref(edge);
+ CordRepBtree::Unref(src);
+ }
+ } else {
+ result = {src, kPopped};
+ }
+
+ // Unless we merged at the top level (i.e.: src and dst are equal height),
+ // unwind the result towards the top level, and finalize the result.
+ if (depth) {
+ return ops.Unwind(dst, depth, length, result);
+ }
+ return ops.Finalize(dst, result);
+}
+
+CopyResult CordRepBtree::CopySuffix(size_t offset) {
+ assert(offset < this->length);
+
+ // As long as `offset` starts inside the last edge, we can 'drop' the current
+ // depth. For the most extreme example: if offset references the last data
+ // edge in the tree, there is only a single edge / path from the top of the
+ // tree to that last edge, so we can drop all the nodes except that edge.
+ // The fast path check for this is `back->length >= length - offset`.
+ int height = this->height();
+ CordRepBtree* node = this;
+ size_t len = node->length - offset;
+ CordRep* back = node->Edge(kBack);
+ while (back->length >= len) {
+ offset = back->length - len;
+ if (--height < 0) {
+ return {MakeSubstring(CordRep::Ref(back), offset), height};
+ }
+ node = back->btree();
+ back = node->Edge(kBack);
+ }
+ if (offset == 0) return {CordRep::Ref(node), height};
+
+ // Offset does not point into the last edge, so we span at least two edges.
+ // Find the index of offset with `IndexBeyond` which provides us the edge
+ // 'beyond' the offset if offset is not a clean starting point of an edge.
+ Position pos = node->IndexBeyond(offset);
+ CordRepBtree* sub = node->CopyToEndFrom(pos.index, len);
+ const CopyResult result = {sub, height};
+
+ // `pos.n` contains a non zero value if the offset is not an exact starting
+ // point of an edge. In this case, `pos.n` contains the 'trailing' amount of
+ // bytes of the edge preceding that in `pos.index`. We need to iteratively
+ // adjust the preceding edge with the 'broken' offset until we have a perfect
+ // start of the edge.
+ while (pos.n != 0) {
+ assert(pos.index >= 1);
+ const size_t begin = pos.index - 1;
+ sub->set_begin(begin);
+ CordRep* const edge = node->Edge(begin);
+
+ len = pos.n;
+ offset = edge->length - len;
+
+ if (--height < 0) {
+ sub->edges_[begin] = MakeSubstring(CordRep::Ref(edge), offset, len);
+ return result;
+ }
+
+ node = edge->btree();
+ pos = node->IndexBeyond(offset);
+
+ CordRepBtree* nsub = node->CopyToEndFrom(pos.index, len);
+ sub->edges_[begin] = nsub;
+ sub = nsub;
+ }
+ sub->set_begin(pos.index);
+ return result;
+}
+
+CopyResult CordRepBtree::CopyPrefix(size_t n, bool allow_folding) {
+ assert(n > 0);
+ assert(n <= this->length);
+
+ // As long as `n` does not exceed the length of the first edge, we can 'drop'
+ // the current depth. For the most extreme example: if we'd copy a 1 byte
+ // prefix from a tree, there is only a single edge / path from the top of the
+ // tree to the single data edge containing this byte, so we can drop all the
+ // nodes except the data node.
+ int height = this->height();
+ CordRepBtree* node = this;
+ CordRep* front = node->Edge(kFront);
+ if (allow_folding) {
+ while (front->length >= n) {
+ if (--height < 0) return {MakeSubstring(CordRep::Ref(front), 0, n), -1};
+ node = front->btree();
+ front = node->Edge(kFront);
+ }
+ }
+ if (node->length == n) return {CordRep::Ref(node), height};
+
+ // `n` spans at least two nodes, find the end point of the span.
+ Position pos = node->IndexOf(n);
+
+ // Create a partial copy of the node up to `pos.index`, with a defined length
+ // of `n`. Any 'partial last edge' is added further below as needed.
+ CordRepBtree* sub = node->CopyBeginTo(pos.index, n);
+ const CopyResult result = {sub, height};
+
+ // `pos.n` contains the 'offset inside the edge for IndexOf(n)'. As long as
+ // this is not zero, we don't have a 'clean cut', so we need to make a
+ // (partial) copy of that last edge, and repeat this until pos.n is zero.
+ while (pos.n != 0) {
+ size_t end = pos.index;
+ n = pos.n;
+
+ CordRep* edge = node->Edge(pos.index);
+ if (--height < 0) {
+ sub->edges_[end++] = MakeSubstring(CordRep::Ref(edge), 0, n);
+ sub->set_end(end);
+ AssertValid(result.edge->btree());
+ return result;
+ }
+
+ node = edge->btree();
+ pos = node->IndexOf(n);
+ CordRepBtree* nsub = node->CopyBeginTo(pos.index, n);
+ sub->edges_[end++] = nsub;
+ sub->set_end(end);
+ sub = nsub;
+ }
+ sub->set_end(pos.index);
+ AssertValid(result.edge->btree());
+ return result;
+}
+
+CordRep* CordRepBtree::ExtractFront(CordRepBtree* tree) {
+ CordRep* front = tree->Edge(tree->begin());
+ if (tree->refcount.IsMutable()) {
+ Unref(tree->Edges(tree->begin() + 1, tree->end()));
+ CordRepBtree::Delete(tree);
+ } else {
+ CordRep::Ref(front);
+ CordRep::Unref(tree);
+ }
+ return front;
+}
+
+CordRepBtree* CordRepBtree::ConsumeBeginTo(CordRepBtree* tree, size_t end,
+ size_t new_length) {
+ assert(end <= tree->end());
+ if (tree->refcount.IsMutable()) {
+ Unref(tree->Edges(end, tree->end()));
+ tree->set_end(end);
+ tree->length = new_length;
+ } else {
+ CordRepBtree* old = tree;
+ tree = tree->CopyBeginTo(end, new_length);
+ CordRep::Unref(old);
+ }
+ return tree;
+}
+
+CordRep* CordRepBtree::RemoveSuffix(CordRepBtree* tree, size_t n) {
+ // Check input and deal with trivial cases 'Remove all/none'
+ assert(tree != nullptr);
+ assert(n <= tree->length);
+ const size_t len = tree->length;
+ if (ABSL_PREDICT_FALSE(n == 0)) {
+ return tree;
+ }
+ if (ABSL_PREDICT_FALSE(n >= len)) {
+ CordRepBtree::Unref(tree);
+ return nullptr;
+ }
+
+ size_t length = len - n;
+ int height = tree->height();
+ bool is_mutable = tree->refcount.IsMutable();
+
+ // Extract all top nodes which are reduced to size = 1
+ Position pos = tree->IndexOfLength(length);
+ while (pos.index == tree->begin()) {
+ CordRep* edge = ExtractFront(tree);
+ is_mutable &= edge->refcount.IsMutable();
+ if (height-- == 0) return ResizeEdge(edge, length, is_mutable);
+ tree = edge->btree();
+ pos = tree->IndexOfLength(length);
+ }
+
+ // Repeat the following sequence traversing down the tree:
+ // - Crop the top node to the 'last remaining edge' adjusting length.
+ // - Set the length for down edges to the partial length in that last edge.
+ // - Repeat this until the last edge is 'included in full'
+ // - If we hit the data edge level, resize and return the last data edge
+ CordRepBtree* top = tree = ConsumeBeginTo(tree, pos.index + 1, length);
+ CordRep* edge = tree->Edge(pos.index);
+ length = pos.n;
+ while (length != edge->length) {
+ // ConsumeBeginTo guarantees `tree` is a clean, privately owned copy.
+ assert(tree->refcount.IsMutable());
+ const bool edge_is_mutable = edge->refcount.IsMutable();
+
+ if (height-- == 0) {
+ tree->edges_[pos.index] = ResizeEdge(edge, length, edge_is_mutable);
+ return AssertValid(top);
+ }
+
+ if (!edge_is_mutable) {
+ // We can't 'in place' remove any suffixes down this edge.
+ // Replace this edge with a prefix copy instead.
+ tree->edges_[pos.index] = edge->btree()->CopyPrefix(length, false).edge;
+ CordRep::Unref(edge);
+ return AssertValid(top);
+ }
+
+ // Move down one level, rinse repeat.
+ tree = edge->btree();
+ pos = tree->IndexOfLength(length);
+ tree = ConsumeBeginTo(edge->btree(), pos.index + 1, length);
+ edge = tree->Edge(pos.index);
+ length = pos.n;
+ }
+
+ return AssertValid(top);
+}
+
+CordRep* CordRepBtree::SubTree(size_t offset, size_t n) {
+ assert(n <= this->length);
+ assert(offset <= this->length - n);
+ if (ABSL_PREDICT_FALSE(n == 0)) return nullptr;
+
+ CordRepBtree* node = this;
+ int height = node->height();
+ Position front = node->IndexOf(offset);
+ CordRep* left = node->edges_[front.index];
+ while (front.n + n <= left->length) {
+ if (--height < 0) return MakeSubstring(CordRep::Ref(left), front.n, n);
+ node = left->btree();
+ front = node->IndexOf(front.n);
+ left = node->edges_[front.index];
+ }
+
+ const Position back = node->IndexBefore(front, n);
+ CordRep* const right = node->edges_[back.index];
+ assert(back.index > front.index);
+
+ // Get partial suffix and prefix entries.
+ CopyResult prefix;
+ CopyResult suffix;
+ if (height > 0) {
+ // Copy prefix and suffix of the boundary nodes.
+ prefix = left->btree()->CopySuffix(front.n);
+ suffix = right->btree()->CopyPrefix(back.n);
+
+ // If there is an edge between the prefix and suffix edges, then the tree
+ // must remain at its previous (full) height. If we have no edges between
+ // prefix and suffix edges, then the tree must be as high as either the
+ // suffix or prefix edges (which are collapsed to their minimum heights).
+ if (front.index + 1 == back.index) {
+ height = (std::max)(prefix.height, suffix.height) + 1;
+ }
+
+ // Raise prefix and suffixes to the new tree height.
+ for (int h = prefix.height + 1; h < height; ++h) {
+ prefix.edge = CordRepBtree::New(prefix.edge);
+ }
+ for (int h = suffix.height + 1; h < height; ++h) {
+ suffix.edge = CordRepBtree::New(suffix.edge);
+ }
+ } else {
+ // Leaf node, simply take substrings for prefix and suffix.
+ prefix = CopyResult{MakeSubstring(CordRep::Ref(left), front.n), -1};
+ suffix = CopyResult{MakeSubstring(CordRep::Ref(right), 0, back.n), -1};
+ }
+
+ // Compose resulting tree.
+ CordRepBtree* sub = CordRepBtree::New(height);
+ size_t end = 0;
+ sub->edges_[end++] = prefix.edge;
+ for (CordRep* r : node->Edges(front.index + 1, back.index)) {
+ sub->edges_[end++] = CordRep::Ref(r);
+ }
+ sub->edges_[end++] = suffix.edge;
+ sub->set_end(end);
+ sub->length = n;
+ return AssertValid(sub);
+}
+
+CordRepBtree* CordRepBtree::MergeTrees(CordRepBtree* left,
+ CordRepBtree* right) {
+ return left->height() >= right->height() ? Merge<kBack>(left, right)
+ : Merge<kFront>(right, left);
+}
+
+bool CordRepBtree::IsFlat(absl::string_view* fragment) const {
+ if (height() == 0 && size() == 1) {
+ if (fragment) *fragment = Data(begin());
+ return true;
+ }
+ return false;
+}
+
+bool CordRepBtree::IsFlat(size_t offset, const size_t n,
+ absl::string_view* fragment) const {
+ assert(n <= this->length);
+ assert(offset <= this->length - n);
+ if (ABSL_PREDICT_FALSE(n == 0)) return false;
+ int height = this->height();
+ const CordRepBtree* node = this;
+ for (;;) {
+ const Position front = node->IndexOf(offset);
+ const CordRep* edge = node->Edge(front.index);
+ if (edge->length < front.n + n) return false;
+ if (--height < 0) {
+ if (fragment) *fragment = EdgeData(edge).substr(front.n, n);
+ return true;
+ }
+ offset = front.n;
+ node = node->Edge(front.index)->btree();
+ }
+}
+
+char CordRepBtree::GetCharacter(size_t offset) const {
+ assert(offset < length);
+ const CordRepBtree* node = this;
+ int height = node->height();
+ for (;;) {
+ Position front = node->IndexOf(offset);
+ if (--height < 0) return node->Data(front.index)[front.n];
+ offset = front.n;
+ node = node->Edge(front.index)->btree();
+ }
+}
+
+Span<char> CordRepBtree::GetAppendBufferSlow(size_t size) {
+ // The inlined version in `GetAppendBuffer()` deals with all heights <= 3.
+ assert(height() >= 4);
+ assert(refcount.IsMutable());
+
+ // Build a stack of nodes we may potentially need to update if we find a
+ // non-shared FLAT with capacity at the leaf level.
+ const int depth = height();
+ CordRepBtree* node = this;
+ CordRepBtree* stack[kMaxDepth];
+ for (int i = 0; i < depth; ++i) {
+ node = node->Edge(kBack)->btree();
+ if (!node->refcount.IsMutable()) return {};
+ stack[i] = node;
+ }
+
+ // Must be a privately owned, mutable flat.
+ CordRep* const edge = node->Edge(kBack);
+ if (!edge->refcount.IsMutable() || edge->tag < FLAT) return {};
+
+ // Must have capacity.
+ const size_t avail = edge->flat()->Capacity() - edge->length;
+ if (avail == 0) return {};
+
+ // Build span on remaining capacity.
+ size_t delta = (std::min)(size, avail);
+ Span<char> span = {edge->flat()->Data() + edge->length, delta};
+ edge->length += delta;
+ this->length += delta;
+ for (int i = 0; i < depth; ++i) {
+ stack[i]->length += delta;
+ }
+ return span;
+}
+
+CordRepBtree* CordRepBtree::CreateSlow(CordRep* rep) {
+ if (rep->IsBtree()) return rep->btree();
+
+ CordRepBtree* node = nullptr;
+ auto consume = [&node](CordRep* r, size_t offset, size_t length) {
+ r = MakeSubstring(r, offset, length);
+ if (node == nullptr) {
+ node = New(r);
+ } else {
+ node = CordRepBtree::AddCordRep<kBack>(node, r);
+ }
+ };
+ Consume(rep, consume);
+ return node;
+}
+
+CordRepBtree* CordRepBtree::AppendSlow(CordRepBtree* tree, CordRep* rep) {
+ if (ABSL_PREDICT_TRUE(rep->IsBtree())) {
+ return MergeTrees(tree, rep->btree());
+ }
+ auto consume = [&tree](CordRep* r, size_t offset, size_t length) {
+ r = MakeSubstring(r, offset, length);
+ tree = CordRepBtree::AddCordRep<kBack>(tree, r);
+ };
+ Consume(rep, consume);
+ return tree;
+}
+
+CordRepBtree* CordRepBtree::PrependSlow(CordRepBtree* tree, CordRep* rep) {
+ if (ABSL_PREDICT_TRUE(rep->IsBtree())) {
+ return MergeTrees(rep->btree(), tree);
+ }
+ auto consume = [&tree](CordRep* r, size_t offset, size_t length) {
+ r = MakeSubstring(r, offset, length);
+ tree = CordRepBtree::AddCordRep<kFront>(tree, r);
+ };
+ ReverseConsume(rep, consume);
+ return tree;
+}
+
+CordRepBtree* CordRepBtree::Append(CordRepBtree* tree, absl::string_view data,
+ size_t extra) {
+ return CordRepBtree::AddData<kBack>(tree, data, extra);
+}
+
+CordRepBtree* CordRepBtree::Prepend(CordRepBtree* tree, absl::string_view data,
+ size_t extra) {
+ return CordRepBtree::AddData<kFront>(tree, data, extra);
+}
+
+template CordRepBtree* CordRepBtree::AddCordRep<kFront>(CordRepBtree* tree,
+ CordRep* rep);
+template CordRepBtree* CordRepBtree::AddCordRep<kBack>(CordRepBtree* tree,
+ CordRep* rep);
+template CordRepBtree* CordRepBtree::AddData<kFront>(CordRepBtree* tree,
+ absl::string_view data,
+ size_t extra);
+template CordRepBtree* CordRepBtree::AddData<kBack>(CordRepBtree* tree,
+ absl::string_view data,
+ size_t extra);
+
+void CordRepBtree::Rebuild(CordRepBtree** stack, CordRepBtree* tree,
+ bool consume) {
+ bool owned = consume && tree->refcount.IsOne();
+ if (tree->height() == 0) {
+ for (CordRep* edge : tree->Edges()) {
+ if (!owned) edge = CordRep::Ref(edge);
+ size_t height = 0;
+ size_t length = edge->length;
+ CordRepBtree* node = stack[0];
+ OpResult result = node->AddEdge<kBack>(true, edge, length);
+ while (result.action == CordRepBtree::kPopped) {
+ stack[height] = result.tree;
+ if (stack[++height] == nullptr) {
+ result.action = CordRepBtree::kSelf;
+ stack[height] = CordRepBtree::New(node, result.tree);
+ } else {
+ node = stack[height];
+ result = node->AddEdge<kBack>(true, result.tree, length);
+ }
+ }
+ while (stack[++height] != nullptr) {
+ stack[height]->length += length;
+ }
+ }
+ } else {
+ for (CordRep* rep : tree->Edges()) {
+ Rebuild(stack, rep->btree(), owned);
+ }
+ }
+ if (consume) {
+ if (owned) {
+ CordRepBtree::Delete(tree);
+ } else {
+ CordRepBtree::Unref(tree);
+ }
+ }
+}
+
+CordRepBtree* CordRepBtree::Rebuild(CordRepBtree* tree) {
+ // Set up initial stack with empty leaf node.
+ CordRepBtree* node = CordRepBtree::New();
+ CordRepBtree* stack[CordRepBtree::kMaxDepth + 1] = {node};
+
+ // Recursively build the tree, consuming the input tree.
+ Rebuild(stack, tree, /* consume reference */ true);
+
+ // Return top most node
+ for (CordRepBtree* parent : stack) {
+ if (parent == nullptr) return node;
+ node = parent;
+ }
+
+ // Unreachable
+ assert(false);
+ return nullptr;
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h
new file mode 100644
index 00000000..bb38f0c3
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h
@@ -0,0 +1,939 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_H_
+#define ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_H_
+
+#include <cassert>
+#include <cstdint>
+#include <iosfwd>
+
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/base/optimization.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/span.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+class CordRepBtreeNavigator;
+
+// CordRepBtree is as the name implies a btree implementation of a Cordrep tree.
+// Data is stored at the leaf level only, non leaf nodes contain down pointers
+// only. Allowed types of data edges are FLAT, EXTERNAL and SUBSTRINGs of FLAT
+// or EXTERNAL nodes. The implementation allows for data to be added to either
+// end of the tree only, it does not provide any 'insert' logic. This has the
+// benefit that we can expect good fill ratios: all nodes except the outer
+// 'legs' will have 100% fill ratios for trees built using Append/Prepend
+// methods. Merged trees will typically have a fill ratio well above 50% as in a
+// similar fashion, one side of the merged tree will typically have a 100% fill
+// ratio, and the 'open' end will average 50%. All operations are O(log(n)) or
+// better, and the tree never needs balancing.
+//
+// All methods accepting a CordRep* or CordRepBtree* adopt a reference on that
+// input unless explicitly stated otherwise. All functions returning a CordRep*
+// or CordRepBtree* instance transfer a reference back to the caller.
+// Simplified, callers both 'donate' and 'consume' a reference count on each
+// call, simplifying the API. An example of building a tree:
+//
+// CordRepBtree* tree = CordRepBtree::Create(MakeFlat("Hello"));
+// tree = CordRepBtree::Append(tree, MakeFlat("world"));
+//
+// In the above example, all inputs are consumed, making each call affecting
+// `tree` reference count neutral. The returned `tree` value can be different
+// from the input if the input is shared with other threads, or if the tree
+// grows in height, but callers typically never have to concern themselves with
+// that and trust that all methods DTRT at all times.
+class CordRepBtree : public CordRep {
+ public:
+ // EdgeType identifies `front` and `back` enum values.
+ // Various implementations in CordRepBtree such as `Add` and `Edge` are
+ // generic and templated on operating on either of the boundary edges.
+ // For more information on the possible edges contained in a CordRepBtree
+ // instance see the documentation for `edges_`.
+ enum class EdgeType { kFront, kBack };
+
+ // Convenience constants into `EdgeType`
+ static constexpr EdgeType kFront = EdgeType::kFront;
+ static constexpr EdgeType kBack = EdgeType::kBack;
+
+ // Maximum number of edges: based on experiments and performance data, we can
+ // pick suitable values resulting in optimum cacheline aligned values. The
+ // preferred values are based on 64-bit systems where we aim to align this
+ // class onto 64 bytes, i.e.: 6 = 64 bytes, 14 = 128 bytes, etc.
+ // TODO(b/192061034): experiment with alternative sizes.
+ static constexpr size_t kMaxCapacity = 6;
+
+ // Reasonable maximum height of the btree. We can expect a fill ratio of at
+ // least 50%: trees are always expanded at the front or back. Concatenating
+ // trees will then typically fold at the top most node, where the lower nodes
+ // are at least at capacity on one side of joined inputs. At a lower fill
+ // rate of 4 edges per node, we have capacity for ~16 million leaf nodes.
+ // We will fail / abort if an application ever exceeds this height, which
+ // should be extremely rare (near impossible) and be an indication of an
+ // application error: we do not assume it reasonable for any application to
+ // operate correctly with such monster trees.
+ // Another compelling reason for the number `12` is that any contextual stack
+ // required for navigation or insertion requires 12 words and 12 bytes, which
+ // fits inside 2 cache lines with some room to spare, and is reasonable as a
+ // local stack variable compared to Cord's current near 400 bytes stack use.
+ // The maximum `height` value of a node is then `kMaxDepth - 1` as node height
+ // values start with a value of 0 for leaf nodes.
+ static constexpr int kMaxDepth = 12;
+ static constexpr int kMaxHeight = kMaxDepth - 1;
+
+ // `Action` defines the action for unwinding changes done at the btree's leaf
+ // level that need to be propagated up to the parent node(s). Each operation
+ // on a node has an effect / action defined as follows:
+ // - kSelf
+ // The operation (add / update, etc) was performed directly on the node as
+ // the node is private to the current thread (i.e.: not shared directly or
+ // indirectly through a refcount > 1). Changes can be propagated directly to
+ // all parent nodes as all parent nodes are also then private to the current
+ // thread.
+ // - kCopied
+ // The operation (add / update, etc) was performed on a copy of the original
+ // node, as the node is (potentially) directly or indirectly shared with
+ // other threads. Changes need to be propagated into the parent nodes where
+ // the old down pointer must be unreffed and replaced with this new copy.
+ // Such changes to parent nodes may themselves require a copy if the parent
+ // node is also shared. A kCopied action can propagate all the way to the
+ // top node where we then must unref the `tree` input provided by the
+ // caller, and return the new copy.
+ // - kPopped
+ // The operation (typically add) could not be satisfied due to insufficient
+ // capacity in the targeted node, and a new 'leg' was created that needs to
+ // be added into the parent node. For example, adding a FLAT inside a leaf
+ // node that is at capacity will create a new leaf node containing that
+ // FLAT, that needs to be 'popped' up the btree. Such 'pop' actions can
+ // cascade up the tree if parent nodes are also at capacity. A 'Popped'
+ // action propagating all the way to the top of the tree will result in
+ // the tree becoming one level higher than the current tree through a final
+ // `CordRepBtree::New(tree, popped)` call, resulting in a new top node
+ // referencing the old tree and the new (fully popped upwards) 'leg'.
+ enum Action { kSelf, kCopied, kPopped };
+
+ // Result of an operation on a node. See the `Action` enum for details.
+ struct OpResult {
+ CordRepBtree* tree;
+ Action action;
+ };
+
+ // Return value of the CopyPrefix and CopySuffix methods which can
+ // return a node or data edge at any height inside the tree.
+ // A height of 0 defines the lowest (leaf) node, a height of -1 identifies
+ // `edge` as being a plain data node: EXTERNAL / FLAT or SUBSTRING thereof.
+ struct CopyResult {
+ CordRep* edge;
+ int height;
+ };
+
+ // Logical position inside a node:
+ // - index: index of the edge.
+ // - n: size or offset value depending on context.
+ struct Position {
+ size_t index;
+ size_t n;
+ };
+
+ // Creates a btree from the given input. Adopts a ref of `rep`.
+ // If the input `rep` is itself a btree, i.e., `IsBtree()`, then this
+ // function immediately returns `rep->btree()`. If the input is a valid data
+ // edge (see IsDataEdge()), then a new leaf node is returned containing `rep`
+ // as the sole data edge. Else, the input is assumed to be a (legacy) concat
+ // tree, and the input is consumed and transformed into a btree().
+ static CordRepBtree* Create(CordRep* rep);
+
+ // Destroys the provided tree. Should only be called by cord internal API's,
+ // typically after a ref_count.Decrement() on the last reference count.
+ static void Destroy(CordRepBtree* tree);
+
+ // Use CordRep::Unref() as we overload for absl::Span<CordRep* const>.
+ using CordRep::Unref;
+
+ // Unrefs all edges in `edges` which are assumed to be 'likely one'.
+ static void Unref(absl::Span<CordRep* const> edges);
+
+ // Appends / Prepends an existing CordRep instance to this tree.
+ // The below methods accept three types of input:
+ // 1) `rep` is a data node (See `IsDataNode` for valid data edges).
+ // `rep` is appended or prepended to this tree 'as is'.
+ // 2) `rep` is a BTREE.
+ // `rep` is merged into `tree` respecting the Append/Prepend order.
+ // 3) `rep` is some other (legacy) type.
+ // `rep` is converted in place and added to `tree`
+ // Requires `tree` and `rep` to be not null.
+ static CordRepBtree* Append(CordRepBtree* tree, CordRep* rep);
+ static CordRepBtree* Prepend(CordRepBtree* tree, CordRep* rep);
+
+ // Append/Prepend the data in `data` to this tree.
+ // The `extra` parameter defines how much extra capacity should be allocated
+ // for any additional FLAT being allocated. This is an optimization hint from
+ // the caller. For example, a caller may need to add 2 string_views of data
+ // "abc" and "defghi" which are not consecutive. The caller can in this case
+ // invoke `AddData(tree, "abc", 6)`, and any newly added flat is allocated
+ // where possible with at least 6 bytes of extra capacity beyond `length`.
+ // This helps avoiding data getting fragmented over multiple flats.
+ // There is no limit on the size of `data`. If `data` can not be stored inside
+ // a single flat, then the function will iteratively add flats until all data
+ // has been consumed and appended or prepended to the tree.
+ static CordRepBtree* Append(CordRepBtree* tree, string_view data,
+ size_t extra = 0);
+ static CordRepBtree* Prepend(CordRepBtree* tree, string_view data,
+ size_t extra = 0);
+
+ // Returns a new tree, containing `n` bytes of data from this instance
+ // starting at offset `offset`. Where possible, the returned tree shares
+ // (re-uses) data edges and nodes with this instance to minimize the
+ // combined memory footprint of both trees.
+ // Requires `offset + n <= length`. Returns `nullptr` if `n` is zero.
+ CordRep* SubTree(size_t offset, size_t n);
+
+ // Removes `n` trailing bytes from `tree`, and returns the resulting tree
+ // or data edge. Returns `tree` if n is zero, and nullptr if n == length.
+ // This function is logically identical to:
+ // result = tree->SubTree(0, tree->length - n);
+ // Unref(tree);
+ // return result;
+ // However, the actual implementation will as much as possible perform 'in
+ // place' modifications on the tree on all nodes and edges that are mutable.
+ // For example, in a fully privately owned tree with the last edge being a
+ // flat of length 12, RemoveSuffix(1) will simply set the length of that data
+ // edge to 11, and reduce the length of all nodes on the edge path by 1.
+ static CordRep* RemoveSuffix(CordRepBtree* tree, size_t n);
+
+ // Returns the character at the given offset.
+ char GetCharacter(size_t offset) const;
+
+ // Returns true if this node holds a single data edge, and if so, sets
+ // `fragment` to reference the contained data. `fragment` is an optional
+ // output parameter and allowed to be null.
+ bool IsFlat(absl::string_view* fragment) const;
+
+ // Returns true if the data of `n` bytes starting at offset `offset`
+ // is contained in a single data edge, and if so, sets fragment to reference
+ // the contained data. `fragment` is an optional output parameter and allowed
+ // to be null.
+ bool IsFlat(size_t offset, size_t n, absl::string_view* fragment) const;
+
+ // Returns a span (mutable range of bytes) of up to `size` bytes into the
+ // last FLAT data edge inside this tree under the following conditions:
+ // - none of the nodes down into the FLAT node are shared.
+ // - the last data edge in this tree is a non-shared FLAT.
+ // - the referenced FLAT has additional capacity available.
+ // If all these conditions are met, a non-empty span is returned, and the
+ // length of the flat node and involved tree nodes have been increased by
+ // `span.length()`. The caller is responsible for immediately assigning values
+ // to all uninitialized data reference by the returned span.
+ // Requires `this->refcount.IsMutable()`: this function forces the
+ // caller to do this fast path check on the top level node, as this is the
+ // most commonly shared node of a cord tree.
+ Span<char> GetAppendBuffer(size_t size);
+
+ // Returns the `height` of the tree. The height of a tree is limited to
+ // kMaxHeight. `height` is implemented as an `int` as in some places we
+ // use negative (-1) values for 'data edges'.
+ int height() const { return static_cast<int>(storage[0]); }
+
+ // Properties: begin, back, end, front/back boundary indexes.
+ size_t begin() const { return static_cast<size_t>(storage[1]); }
+ size_t back() const { return static_cast<size_t>(storage[2]) - 1; }
+ size_t end() const { return static_cast<size_t>(storage[2]); }
+ size_t index(EdgeType edge) const {
+ return edge == kFront ? begin() : back();
+ }
+
+ // Properties: size and capacity.
+ // `capacity` contains the current capacity of this instance, where
+ // `kMaxCapacity` contains the maximum capacity of a btree node.
+ // For now, `capacity` and `kMaxCapacity` return the same value, but this may
+ // change in the future if we see benefit in dynamically sizing 'small' nodes
+ // to 'large' nodes for large data trees.
+ size_t size() const { return end() - begin(); }
+ size_t capacity() const { return kMaxCapacity; }
+
+ // Edge access
+ inline CordRep* Edge(size_t index) const;
+ inline CordRep* Edge(EdgeType edge_type) const;
+ inline absl::Span<CordRep* const> Edges() const;
+ inline absl::Span<CordRep* const> Edges(size_t begin, size_t end) const;
+
+ // Returns reference to the data edge at `index`.
+ // Requires this instance to be a leaf node, and `index` to be valid index.
+ inline absl::string_view Data(size_t index) const;
+
+ static const char* EdgeDataPtr(const CordRep* r);
+ static absl::string_view EdgeData(const CordRep* r);
+
+ // Returns true if the provided rep is a FLAT, EXTERNAL or a SUBSTRING node
+ // holding a FLAT or EXTERNAL child rep.
+ static bool IsDataEdge(const CordRep* rep);
+
+ // Diagnostics: returns true if `tree` is valid and internally consistent.
+ // If `shallow` is false, then the provided top level node and all child nodes
+ // below it are recursively checked. If `shallow` is true, only the provided
+ // node in `tree` and the cumulative length, type and height of the direct
+ // child nodes of `tree` are checked. The value of `shallow` is ignored if the
+ // internal `cord_btree_exhaustive_validation` diagnostics variable is true,
+ // in which case the performed validations works as if `shallow` were false.
+ // This function is intended for debugging and testing purposes only.
+ static bool IsValid(const CordRepBtree* tree, bool shallow = false);
+
+ // Diagnostics: asserts that the provided tree is valid.
+ // `AssertValid()` performs a shallow validation by default. `shallow` can be
+ // set to false in which case an exhaustive validation is performed. This
+ // function is implemented in terms of calling `IsValid()` and asserting the
+ // return value to be true. See `IsValid()` for more information.
+ // This function is intended for debugging and testing purposes only.
+ static CordRepBtree* AssertValid(CordRepBtree* tree, bool shallow = true);
+ static const CordRepBtree* AssertValid(const CordRepBtree* tree,
+ bool shallow = true);
+
+ // Diagnostics: dump the contents of this tree to `stream`.
+ // This function is intended for debugging and testing purposes only.
+ static void Dump(const CordRep* rep, std::ostream& stream);
+ static void Dump(const CordRep* rep, absl::string_view label,
+ std::ostream& stream);
+ static void Dump(const CordRep* rep, absl::string_view label,
+ bool include_contents, std::ostream& stream);
+
+ // Adds the edge `edge` to this node if possible. `owned` indicates if the
+ // current node is potentially shared or not with other threads. Returns:
+ // - {kSelf, <this>}
+ // The edge was directly added to this node.
+ // - {kCopied, <node>}
+ // The edge was added to a copy of this node.
+ // - {kPopped, New(edge, height())}
+ // A new leg with the edge was created as this node has no extra capacity.
+ template <EdgeType edge_type>
+ inline OpResult AddEdge(bool owned, CordRep* edge, size_t delta);
+
+ // Replaces the front or back edge with the provided new edge. Returns:
+ // - {kSelf, <this>}
+ // The edge was directly set in this node. The old edge is unreffed.
+ // - {kCopied, <node>}
+ // A copy of this node was created with the new edge value.
+ // In both cases, the function adopts a reference on `edge`.
+ template <EdgeType edge_type>
+ OpResult SetEdge(bool owned, CordRep* edge, size_t delta);
+
+ // Creates a new empty node at the specified height.
+ static CordRepBtree* New(int height = 0);
+
+ // Creates a new node containing `rep`, with the height being computed
+ // automatically based on the type of `rep`.
+ static CordRepBtree* New(CordRep* rep);
+
+ // Creates a new node containing both `front` and `back` at height
+ // `front.height() + 1`. Requires `back.height() == front.height()`.
+ static CordRepBtree* New(CordRepBtree* front, CordRepBtree* back);
+
+ // Creates a fully balanced tree from the provided tree by rebuilding a new
+ // tree from all data edges in the input. This function is automatically
+ // invoked internally when the tree exceeds the maximum height.
+ static CordRepBtree* Rebuild(CordRepBtree* tree);
+
+ private:
+ CordRepBtree() = default;
+ ~CordRepBtree() = default;
+
+ // Initializes the main properties `tag`, `begin`, `end`, `height`.
+ inline void InitInstance(int height, size_t begin = 0, size_t end = 0);
+
+ // Direct property access begin / end
+ void set_begin(size_t begin) { storage[1] = static_cast<uint8_t>(begin); }
+ void set_end(size_t end) { storage[2] = static_cast<uint8_t>(end); }
+
+ // Decreases the value of `begin` by `n`, and returns the new value. Notice
+ // how this returns the new value unlike atomic::fetch_add which returns the
+ // old value. This is because this is used to prepend edges at 'begin - 1'.
+ size_t sub_fetch_begin(size_t n) {
+ storage[1] -= static_cast<uint8_t>(n);
+ return storage[1];
+ }
+
+ // Increases the value of `end` by `n`, and returns the previous value. This
+ // function is typically used to append edges at 'end'.
+ size_t fetch_add_end(size_t n) {
+ const uint8_t current = storage[2];
+ storage[2] = static_cast<uint8_t>(current + n);
+ return current;
+ }
+
+ // Returns the index of the last edge starting on, or before `offset`, with
+ // `n` containing the relative offset of `offset` inside that edge.
+ // Requires `offset` < length.
+ Position IndexOf(size_t offset) const;
+
+ // Returns the index of the last edge starting before `offset`, with `n`
+ // containing the relative offset of `offset` inside that edge.
+ // This function is useful to find the edges for some span of bytes ending at
+ // `offset` (i.e., `n` bytes). For example:
+ //
+ // Position pos = IndexBefore(n)
+ // edges = Edges(begin(), pos.index) // All full edges (may be empty)
+ // last = Sub(Edge(pos.index), 0, pos.n) // Last partial edge (may be empty)
+ //
+ // Requires 0 < `offset` <= length.
+ Position IndexBefore(size_t offset) const;
+
+ // Returns the index of the edge ending at (or on) length `length`, and the
+ // number of bytes inside that edge up to `length`. For example, if we have a
+ // Node with 2 edges, one of 10 and one of 20 long, then IndexOfLength(27)
+ // will return {1, 17}, and IndexOfLength(10) will return {0, 10}.
+ Position IndexOfLength(size_t n) const;
+
+ // Identical to the above function except starting from the position `front`.
+ // This function is equivalent to `IndexBefore(front.n + offset)`, with
+ // the difference that this function is optimized to start at `front.index`.
+ Position IndexBefore(Position front, size_t offset) const;
+
+ // Returns the index of the edge directly beyond the edge containing offset
+ // `offset`, with `n` containing the distance of that edge from `offset`.
+ // This function is useful for iteratively finding suffix nodes and remaining
+ // partial bytes in left-most suffix nodes as for example in CopySuffix.
+ // Requires `offset` < length.
+ Position IndexBeyond(size_t offset) const;
+
+ // Destruction
+ static void DestroyLeaf(CordRepBtree* tree, size_t begin, size_t end);
+ static void DestroyNonLeaf(CordRepBtree* tree, size_t begin, size_t end);
+ static void DestroyTree(CordRepBtree* tree, size_t begin, size_t end);
+ static void Delete(CordRepBtree* tree) { delete tree; }
+
+ // Creates a new leaf node containing as much data as possible from `data`.
+ // The data is added either forwards or reversed depending on `edge_type`.
+ // Callers must check the length of the returned node to determine if all data
+ // was copied or not.
+ // See the `Append/Prepend` function for the meaning and purpose of `extra`.
+ template <EdgeType edge_type>
+ static CordRepBtree* NewLeaf(absl::string_view data, size_t extra);
+
+ // Creates a raw copy of this Btree node, copying all properties, but
+ // without adding any references to existing edges.
+ CordRepBtree* CopyRaw() const;
+
+ // Creates a full copy of this Btree node, adding a reference on all edges.
+ CordRepBtree* Copy() const;
+
+ // Creates a partial copy of this Btree node, copying all edges up to `end`,
+ // adding a reference on each copied edge, and sets the length of the newly
+ // created copy to `new_length`.
+ CordRepBtree* CopyBeginTo(size_t end, size_t new_length) const;
+
+ // Returns a tree containing the edges [tree->begin(), end) and length
+ // of `new_length`. This method consumes a reference on the provided
+ // tree, and logically performs the following operation:
+ // result = tree->CopyBeginTo(end, new_length);
+ // CordRep::Unref(tree);
+ // return result;
+ static CordRepBtree* ConsumeBeginTo(CordRepBtree* tree, size_t end,
+ size_t new_length);
+
+ // Creates a partial copy of this Btree node, copying all edges starting at
+ // `begin`, adding a reference on each copied edge, and sets the length of
+ // the newly created copy to `new_length`.
+ CordRepBtree* CopyToEndFrom(size_t begin, size_t new_length) const;
+
+ // Extracts and returns the front edge from the provided tree.
+ // This method consumes a reference on the provided tree, and logically
+ // performs the following operation:
+ // edge = CordRep::Ref(tree->Edge(kFront));
+ // CordRep::Unref(tree);
+ // return edge;
+ static CordRep* ExtractFront(CordRepBtree* tree);
+
+ // Returns a tree containing the result of appending `right` to `left`.
+ static CordRepBtree* MergeTrees(CordRepBtree* left, CordRepBtree* right);
+
+ // Fallback functions for `Create()`, `Append()` and `Prepend()` which
+ // deal with legacy / non conforming input, i.e.: CONCAT trees.
+ static CordRepBtree* CreateSlow(CordRep* rep);
+ static CordRepBtree* AppendSlow(CordRepBtree*, CordRep* rep);
+ static CordRepBtree* PrependSlow(CordRepBtree*, CordRep* rep);
+
+ // Recursively rebuilds `tree` into `stack`. If 'consume` is set to true, the
+ // function will consume a reference on `tree`. `stack` is a null terminated
+ // array containing the new tree's state, with the current leaf node at
+ // stack[0], and parent nodes above that, or null for 'top of tree'.
+ static void Rebuild(CordRepBtree** stack, CordRepBtree* tree, bool consume);
+
+ // Aligns existing edges to start at index 0, to allow for a new edge to be
+ // added to the back of the current edges.
+ inline void AlignBegin();
+
+ // Aligns existing edges to end at `capacity`, to allow for a new edge to be
+ // added in front of the current edges.
+ inline void AlignEnd();
+
+ // Adds the provided edge to this node.
+ // Requires this node to have capacity for the edge. Realigns / moves
+ // existing edges as needed to prepend or append the new edge.
+ template <EdgeType edge_type>
+ inline void Add(CordRep* rep);
+
+ // Adds the provided edges to this node.
+ // Requires this node to have capacity for the edges. Realigns / moves
+ // existing edges as needed to prepend or append the new edges.
+ template <EdgeType edge_type>
+ inline void Add(absl::Span<CordRep* const>);
+
+ // Adds data from `data` to this node until either all data has been consumed,
+ // or there is no more capacity for additional flat nodes inside this node.
+ // Requires the current node to be a leaf node, data to be non empty, and the
+ // current node to have capacity for at least one more data edge.
+ // Returns any remaining data from `data` that was not added, which is
+ // depending on the edge type (front / back) either the remaining prefix of
+ // suffix of the input.
+ // See the `Append/Prepend` function for the meaning and purpose of `extra`.
+ template <EdgeType edge_type>
+ absl::string_view AddData(absl::string_view data, size_t extra);
+
+ // Replace the front or back edge with the provided value.
+ // Adopts a reference on `edge` and unrefs the old edge.
+ template <EdgeType edge_type>
+ inline void SetEdge(CordRep* edge);
+
+ // Returns a partial copy of the current tree containing the first `n` bytes
+ // of data. `CopyResult` contains both the resulting edge and its height. The
+ // resulting tree may be less high than the current tree, or even be a single
+ // matching data edge if `allow_folding` is set to true.
+ // For example, if `n == 1`, then the result will be the single data edge, and
+ // height will be set to -1 (one below the owning leaf node). If n == 0, this
+ // function returns null. Requires `n <= length`
+ CopyResult CopyPrefix(size_t n, bool allow_folding = true);
+
+ // Returns a partial copy of the current tree containing all data starting
+ // after `offset`. `CopyResult` contains both the resulting edge and its
+ // height. The resulting tree may be less high than the current tree, or even
+ // be a single matching data edge. For example, if `n == length - 1`, then the
+ // result will be a single data edge, and height will be set to -1 (one below
+ // the owning leaf node).
+ // Requires `offset < length`
+ CopyResult CopySuffix(size_t offset);
+
+ // Returns a OpResult value of {this, kSelf} or {Copy(), kCopied}
+ // depending on the value of `owned`.
+ inline OpResult ToOpResult(bool owned);
+
+ // Adds `rep` to the specified tree, returning the modified tree.
+ template <EdgeType edge_type>
+ static CordRepBtree* AddCordRep(CordRepBtree* tree, CordRep* rep);
+
+ // Adds `data` to the specified tree, returning the modified tree.
+ // See the `Append/Prepend` function for the meaning and purpose of `extra`.
+ template <EdgeType edge_type>
+ static CordRepBtree* AddData(CordRepBtree* tree, absl::string_view data,
+ size_t extra = 0);
+
+ // Merges `src` into `dst` with `src` being added either before (kFront) or
+ // after (kBack) `dst`. Requires the height of `dst` to be greater than or
+ // equal to the height of `src`.
+ template <EdgeType edge_type>
+ static CordRepBtree* Merge(CordRepBtree* dst, CordRepBtree* src);
+
+ // Fallback version of GetAppendBuffer for large trees: GetAppendBuffer()
+ // implements an inlined version for trees of limited height (3 levels),
+ // GetAppendBufferSlow implements the logic for large trees.
+ Span<char> GetAppendBufferSlow(size_t size);
+
+ // `edges_` contains all edges starting from this instance.
+ // These are explicitly `child` edges only, a cord btree (or any cord tree in
+ // that respect) does not store `parent` pointers anywhere: multiple trees /
+ // parents can reference the same shared child edge. The type of these edges
+ // depends on the height of the node. `Leaf nodes` (height == 0) contain `data
+ // edges` (external or flat nodes, or sub-strings thereof). All other nodes
+ // (height > 0) contain pointers to BTREE nodes with a height of `height - 1`.
+ CordRep* edges_[kMaxCapacity];
+
+ friend class CordRepBtreeTestPeer;
+ friend class CordRepBtreeNavigator;
+};
+
+inline CordRepBtree* CordRep::btree() {
+ assert(IsBtree());
+ return static_cast<CordRepBtree*>(this);
+}
+
+inline const CordRepBtree* CordRep::btree() const {
+ assert(IsBtree());
+ return static_cast<const CordRepBtree*>(this);
+}
+
+inline void CordRepBtree::InitInstance(int height, size_t begin, size_t end) {
+ tag = BTREE;
+ storage[0] = static_cast<uint8_t>(height);
+ storage[1] = static_cast<uint8_t>(begin);
+ storage[2] = static_cast<uint8_t>(end);
+}
+
+inline CordRep* CordRepBtree::Edge(size_t index) const {
+ assert(index >= begin());
+ assert(index < end());
+ return edges_[index];
+}
+
+inline CordRep* CordRepBtree::Edge(EdgeType edge_type) const {
+ return edges_[edge_type == kFront ? begin() : back()];
+}
+
+inline absl::Span<CordRep* const> CordRepBtree::Edges() const {
+ return {edges_ + begin(), size()};
+}
+
+inline absl::Span<CordRep* const> CordRepBtree::Edges(size_t begin,
+ size_t end) const {
+ assert(begin <= end);
+ assert(begin >= this->begin());
+ assert(end <= this->end());
+ return {edges_ + begin, static_cast<size_t>(end - begin)};
+}
+
+inline const char* CordRepBtree::EdgeDataPtr(const CordRep* r) {
+ assert(IsDataEdge(r));
+ size_t offset = 0;
+ if (r->tag == SUBSTRING) {
+ offset = r->substring()->start;
+ r = r->substring()->child;
+ }
+ return (r->tag >= FLAT ? r->flat()->Data() : r->external()->base) + offset;
+}
+
+inline absl::string_view CordRepBtree::EdgeData(const CordRep* r) {
+ return absl::string_view(EdgeDataPtr(r), r->length);
+}
+
+inline absl::string_view CordRepBtree::Data(size_t index) const {
+ assert(height() == 0);
+ return EdgeData(Edge(index));
+}
+
+inline bool CordRepBtree::IsDataEdge(const CordRep* rep) {
+ // The fast path is that `rep` is an EXTERNAL or FLAT node, making the below
+ // if a single, well predicted branch. We then repeat the FLAT or EXTERNAL
+ // check in the slow path the SUBSTRING check to optimize for the hot path.
+ if (rep->tag == EXTERNAL || rep->tag >= FLAT) return true;
+ if (rep->tag == SUBSTRING) rep = rep->substring()->child;
+ return rep->tag == EXTERNAL || rep->tag >= FLAT;
+}
+
+inline CordRepBtree* CordRepBtree::New(int height) {
+ CordRepBtree* tree = new CordRepBtree;
+ tree->length = 0;
+ tree->InitInstance(height);
+ return tree;
+}
+
+inline CordRepBtree* CordRepBtree::New(CordRep* rep) {
+ CordRepBtree* tree = new CordRepBtree;
+ int height = rep->IsBtree() ? rep->btree()->height() + 1 : 0;
+ tree->length = rep->length;
+ tree->InitInstance(height, /*begin=*/0, /*end=*/1);
+ tree->edges_[0] = rep;
+ return tree;
+}
+
+inline CordRepBtree* CordRepBtree::New(CordRepBtree* front,
+ CordRepBtree* back) {
+ assert(front->height() == back->height());
+ CordRepBtree* tree = new CordRepBtree;
+ tree->length = front->length + back->length;
+ tree->InitInstance(front->height() + 1, /*begin=*/0, /*end=*/2);
+ tree->edges_[0] = front;
+ tree->edges_[1] = back;
+ return tree;
+}
+
+inline void CordRepBtree::DestroyTree(CordRepBtree* tree, size_t begin,
+ size_t end) {
+ if (tree->height() == 0) {
+ DestroyLeaf(tree, begin, end);
+ } else {
+ DestroyNonLeaf(tree, begin, end);
+ }
+}
+
+inline void CordRepBtree::Destroy(CordRepBtree* tree) {
+ DestroyTree(tree, tree->begin(), tree->end());
+}
+
+inline void CordRepBtree::Unref(absl::Span<CordRep* const> edges) {
+ for (CordRep* edge : edges) {
+ if (ABSL_PREDICT_FALSE(!edge->refcount.Decrement())) {
+ CordRep::Destroy(edge);
+ }
+ }
+}
+
+inline CordRepBtree* CordRepBtree::CopyRaw() const {
+ auto* tree = static_cast<CordRepBtree*>(::operator new(sizeof(CordRepBtree)));
+ memcpy(static_cast<void*>(tree), this, sizeof(CordRepBtree));
+ new (&tree->refcount) RefcountAndFlags;
+ return tree;
+}
+
+inline CordRepBtree* CordRepBtree::Copy() const {
+ CordRepBtree* tree = CopyRaw();
+ for (CordRep* rep : Edges()) CordRep::Ref(rep);
+ return tree;
+}
+
+inline CordRepBtree* CordRepBtree::CopyToEndFrom(size_t begin,
+ size_t new_length) const {
+ assert(begin >= this->begin());
+ assert(begin <= this->end());
+ CordRepBtree* tree = CopyRaw();
+ tree->length = new_length;
+ tree->set_begin(begin);
+ for (CordRep* edge : tree->Edges()) CordRep::Ref(edge);
+ return tree;
+}
+
+inline CordRepBtree* CordRepBtree::CopyBeginTo(size_t end,
+ size_t new_length) const {
+ assert(end <= capacity());
+ assert(end >= this->begin());
+ CordRepBtree* tree = CopyRaw();
+ tree->length = new_length;
+ tree->set_end(end);
+ for (CordRep* edge : tree->Edges()) CordRep::Ref(edge);
+ return tree;
+}
+
+inline void CordRepBtree::AlignBegin() {
+ // The below code itself does not need to be fast as typically we have
+ // mono-directional append/prepend calls, and `begin` / `end` are typically
+ // adjusted no more than once. But we want to avoid potential register clobber
+ // effects, making the compiler emit register save/store/spills, and minimize
+ // the size of code.
+ const size_t delta = begin();
+ if (ABSL_PREDICT_FALSE(delta != 0)) {
+ const size_t new_end = end() - delta;
+ set_begin(0);
+ set_end(new_end);
+ // TODO(mvels): we can write this using 2 loads / 2 stores depending on
+ // total size for the kMaxCapacity = 6 case. I.e., we can branch (switch) on
+ // size, and then do overlapping load/store of up to 4 pointers (inlined as
+ // XMM, YMM or ZMM load/store) and up to 2 pointers (XMM / YMM), which is a)
+ // compact and b) not clobbering any registers.
+ ABSL_INTERNAL_ASSUME(new_end <= kMaxCapacity);
+#ifdef __clang__
+#pragma unroll 1
+#endif
+ for (size_t i = 0; i < new_end; ++i) {
+ edges_[i] = edges_[i + delta];
+ }
+ }
+}
+
+inline void CordRepBtree::AlignEnd() {
+ // See comments in `AlignBegin` for motivation on the hand-rolled for loops.
+ const size_t delta = capacity() - end();
+ if (delta != 0) {
+ const size_t new_begin = begin() + delta;
+ const size_t new_end = end() + delta;
+ set_begin(new_begin);
+ set_end(new_end);
+ ABSL_INTERNAL_ASSUME(new_end <= kMaxCapacity);
+#ifdef __clang__
+#pragma unroll 1
+#endif
+ for (size_t i = new_end - 1; i >= new_begin; --i) {
+ edges_[i] = edges_[i - delta];
+ }
+ }
+}
+
+template <>
+inline void CordRepBtree::Add<CordRepBtree::kBack>(CordRep* rep) {
+ AlignBegin();
+ edges_[fetch_add_end(1)] = rep;
+}
+
+template <>
+inline void CordRepBtree::Add<CordRepBtree::kBack>(
+ absl::Span<CordRep* const> edges) {
+ AlignBegin();
+ size_t new_end = end();
+ for (CordRep* edge : edges) edges_[new_end++] = edge;
+ set_end(new_end);
+}
+
+template <>
+inline void CordRepBtree::Add<CordRepBtree::kFront>(CordRep* rep) {
+ AlignEnd();
+ edges_[sub_fetch_begin(1)] = rep;
+}
+
+template <>
+inline void CordRepBtree::Add<CordRepBtree::kFront>(
+ absl::Span<CordRep* const> edges) {
+ AlignEnd();
+ size_t new_begin = begin() - edges.size();
+ set_begin(new_begin);
+ for (CordRep* edge : edges) edges_[new_begin++] = edge;
+}
+
+template <CordRepBtree::EdgeType edge_type>
+inline void CordRepBtree::SetEdge(CordRep* edge) {
+ const int idx = edge_type == kFront ? begin() : back();
+ CordRep::Unref(edges_[idx]);
+ edges_[idx] = edge;
+}
+
+inline CordRepBtree::OpResult CordRepBtree::ToOpResult(bool owned) {
+ return owned ? OpResult{this, kSelf} : OpResult{Copy(), kCopied};
+}
+
+inline CordRepBtree::Position CordRepBtree::IndexOf(size_t offset) const {
+ assert(offset < length);
+ size_t index = begin();
+ while (offset >= edges_[index]->length) offset -= edges_[index++]->length;
+ return {index, offset};
+}
+
+inline CordRepBtree::Position CordRepBtree::IndexBefore(size_t offset) const {
+ assert(offset > 0);
+ assert(offset <= length);
+ size_t index = begin();
+ while (offset > edges_[index]->length) offset -= edges_[index++]->length;
+ return {index, offset};
+}
+
+inline CordRepBtree::Position CordRepBtree::IndexBefore(Position front,
+ size_t offset) const {
+ size_t index = front.index;
+ offset = offset + front.n;
+ while (offset > edges_[index]->length) offset -= edges_[index++]->length;
+ return {index, offset};
+}
+
+inline CordRepBtree::Position CordRepBtree::IndexOfLength(size_t n) const {
+ assert(n <= length);
+ size_t index = back();
+ size_t strip = length - n;
+ while (strip >= edges_[index]->length) strip -= edges_[index--]->length;
+ return {index, edges_[index]->length - strip};
+}
+
+inline CordRepBtree::Position CordRepBtree::IndexBeyond(
+ const size_t offset) const {
+ // We need to find the edge which `starting offset` is beyond (>=)`offset`.
+ // For this we can't use the `offset -= length` logic of IndexOf. Instead, we
+ // track the offset of the `current edge` in `off`, which we increase as we
+ // iterate over the edges until we find the matching edge.
+ size_t off = 0;
+ size_t index = begin();
+ while (offset > off) off += edges_[index++]->length;
+ return {index, off - offset};
+}
+
+inline CordRepBtree* CordRepBtree::Create(CordRep* rep) {
+ if (IsDataEdge(rep)) return New(rep);
+ return CreateSlow(rep);
+}
+
+inline Span<char> CordRepBtree::GetAppendBuffer(size_t size) {
+ assert(refcount.IsMutable());
+ CordRepBtree* tree = this;
+ const int height = this->height();
+ CordRepBtree* n1 = tree;
+ CordRepBtree* n2 = tree;
+ CordRepBtree* n3 = tree;
+ switch (height) {
+ case 3:
+ tree = tree->Edge(kBack)->btree();
+ if (!tree->refcount.IsMutable()) return {};
+ n2 = tree;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 2:
+ tree = tree->Edge(kBack)->btree();
+ if (!tree->refcount.IsMutable()) return {};
+ n1 = tree;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 1:
+ tree = tree->Edge(kBack)->btree();
+ if (!tree->refcount.IsMutable()) return {};
+ ABSL_FALLTHROUGH_INTENDED;
+ case 0:
+ CordRep* edge = tree->Edge(kBack);
+ if (!edge->refcount.IsMutable()) return {};
+ if (edge->tag < FLAT) return {};
+ size_t avail = edge->flat()->Capacity() - edge->length;
+ if (avail == 0) return {};
+ size_t delta = (std::min)(size, avail);
+ Span<char> span = {edge->flat()->Data() + edge->length, delta};
+ edge->length += delta;
+ switch (height) {
+ case 3:
+ n3->length += delta;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 2:
+ n2->length += delta;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 1:
+ n1->length += delta;
+ ABSL_FALLTHROUGH_INTENDED;
+ case 0:
+ tree->length += delta;
+ return span;
+ }
+ break;
+ }
+ return GetAppendBufferSlow(size);
+}
+
+extern template CordRepBtree* CordRepBtree::AddCordRep<CordRepBtree::kBack>(
+ CordRepBtree* tree, CordRep* rep);
+
+extern template CordRepBtree* CordRepBtree::AddCordRep<CordRepBtree::kFront>(
+ CordRepBtree* tree, CordRep* rep);
+
+inline CordRepBtree* CordRepBtree::Append(CordRepBtree* tree, CordRep* rep) {
+ if (ABSL_PREDICT_TRUE(IsDataEdge(rep))) {
+ return CordRepBtree::AddCordRep<kBack>(tree, rep);
+ }
+ return AppendSlow(tree, rep);
+}
+
+inline CordRepBtree* CordRepBtree::Prepend(CordRepBtree* tree, CordRep* rep) {
+ if (ABSL_PREDICT_TRUE(IsDataEdge(rep))) {
+ return CordRepBtree::AddCordRep<kFront>(tree, rep);
+ }
+ return PrependSlow(tree, rep);
+}
+
+#ifdef NDEBUG
+
+inline CordRepBtree* CordRepBtree::AssertValid(CordRepBtree* tree,
+ bool /* shallow */) {
+ return tree;
+}
+
+inline const CordRepBtree* CordRepBtree::AssertValid(const CordRepBtree* tree,
+ bool /* shallow */) {
+ return tree;
+}
+
+#endif
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc
new file mode 100644
index 00000000..d1f9995d
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc
@@ -0,0 +1,185 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree_navigator.h"
+
+#include <cassert>
+
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+using ReadResult = CordRepBtreeNavigator::ReadResult;
+
+namespace {
+
+// Returns a `CordRepSubstring` from `rep` starting at `offset` of size `n`.
+// If `rep` is already a `CordRepSubstring` instance, an adjusted instance is
+// created based on the old offset and new offset.
+// Adopts a reference on `rep`. Rep must be a valid data edge. Returns
+// nullptr if `n == 0`, `rep` if `n == rep->length`.
+// Requires `offset < rep->length` and `offset + n <= rep->length`.
+// TODO(192061034): move to utility library in internal and optimize for small
+// substrings of larger reps.
+inline CordRep* Substring(CordRep* rep, size_t offset, size_t n) {
+ assert(n <= rep->length);
+ assert(offset < rep->length);
+ assert(offset <= rep->length - n);
+ assert(CordRepBtree::IsDataEdge(rep));
+
+ if (n == 0) return nullptr;
+ if (n == rep->length) return CordRep::Ref(rep);
+
+ if (rep->tag == SUBSTRING) {
+ offset += rep->substring()->start;
+ rep = rep->substring()->child;
+ }
+
+ CordRepSubstring* substring = new CordRepSubstring();
+ substring->length = n;
+ substring->tag = SUBSTRING;
+ substring->start = offset;
+ substring->child = CordRep::Ref(rep);
+ return substring;
+}
+
+inline CordRep* Substring(CordRep* rep, size_t offset) {
+ return Substring(rep, offset, rep->length - offset);
+}
+
+} // namespace
+
+CordRepBtreeNavigator::Position CordRepBtreeNavigator::Skip(size_t n) {
+ int height = 0;
+ size_t index = index_[0];
+ CordRepBtree* node = node_[0];
+ CordRep* edge = node->Edge(index);
+
+ // Overall logic: Find an edge of at least the length we need to skip.
+ // We consume all edges which are smaller (i.e., must be 100% skipped).
+ // If we exhausted all edges on the current level, we move one level
+ // up the tree, and repeat until we either find the edge, or until we hit
+ // the top of the tree meaning the skip exceeds tree->length.
+ while (n >= edge->length) {
+ n -= edge->length;
+ while (++index == node->end()) {
+ if (++height > height_) return {nullptr, n};
+ node = node_[height];
+ index = index_[height];
+ }
+ edge = node->Edge(index);
+ }
+
+ // If we moved up the tree, descend down to the leaf level, consuming all
+ // edges that must be skipped.
+ while (height > 0) {
+ node = edge->btree();
+ index_[height] = index;
+ node_[--height] = node;
+ index = node->begin();
+ edge = node->Edge(index);
+ while (n >= edge->length) {
+ n -= edge->length;
+ ++index;
+ assert(index != node->end());
+ edge = node->Edge(index);
+ }
+ }
+ index_[0] = index;
+ return {edge, n};
+}
+
+ReadResult CordRepBtreeNavigator::Read(size_t edge_offset, size_t n) {
+ int height = 0;
+ size_t length = edge_offset + n;
+ size_t index = index_[0];
+ CordRepBtree* node = node_[0];
+ CordRep* edge = node->Edge(index);
+ assert(edge_offset < edge->length);
+
+ if (length < edge->length) {
+ return {Substring(edge, edge_offset, n), length};
+ }
+
+ // Similar to 'Skip', we consume all edges that are inside the 'length' of
+ // data that needs to be read. If we exhaust the current level, we move one
+ // level up the tree and repeat until we hit the final edge that must be
+ // (partially) read. We consume all edges into `subtree`.
+ CordRepBtree* subtree = CordRepBtree::New(Substring(edge, edge_offset));
+ size_t subtree_end = 1;
+ do {
+ length -= edge->length;
+ while (++index == node->end()) {
+ index_[height] = index;
+ if (++height > height_) {
+ subtree->set_end(subtree_end);
+ if (length == 0) return {subtree, 0};
+ CordRep::Unref(subtree);
+ return {nullptr, length};
+ }
+ if (length != 0) {
+ subtree->set_end(subtree_end);
+ subtree = CordRepBtree::New(subtree);
+ subtree_end = 1;
+ }
+ node = node_[height];
+ index = index_[height];
+ }
+ edge = node->Edge(index);
+ if (length >= edge->length) {
+ subtree->length += edge->length;
+ subtree->edges_[subtree_end++] = CordRep::Ref(edge);
+ }
+ } while (length >= edge->length);
+ CordRepBtree* tree = subtree;
+ subtree->length += length;
+
+ // If we moved up the tree, descend down to the leaf level, consuming all
+ // edges that must be read, adding 'down' nodes to `subtree`.
+ while (height > 0) {
+ node = edge->btree();
+ index_[height] = index;
+ node_[--height] = node;
+ index = node->begin();
+ edge = node->Edge(index);
+
+ if (length != 0) {
+ CordRepBtree* right = CordRepBtree::New(height);
+ right->length = length;
+ subtree->edges_[subtree_end++] = right;
+ subtree->set_end(subtree_end);
+ subtree = right;
+ subtree_end = 0;
+ while (length >= edge->length) {
+ subtree->edges_[subtree_end++] = CordRep::Ref(edge);
+ length -= edge->length;
+ edge = node->Edge(++index);
+ }
+ }
+ }
+ // Add any (partial) edge still remaining at the leaf level.
+ if (length != 0) {
+ subtree->edges_[subtree_end++] = Substring(edge, 0, length);
+ }
+ subtree->set_end(subtree_end);
+ index_[0] = index;
+ return {tree, length};
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h
new file mode 100644
index 00000000..971b92ed
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h
@@ -0,0 +1,265 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_NAVIGATOR_H_
+#define ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_NAVIGATOR_H_
+
+#include <cassert>
+#include <iostream>
+
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordRepBtreeNavigator is a bi-directional navigator allowing callers to
+// navigate all the (leaf) data edges in a CordRepBtree instance.
+//
+// A CordRepBtreeNavigator instance is by default empty. Callers initialize a
+// navigator instance by calling one of `InitFirst()`, `InitLast()` or
+// `InitOffset()`, which establishes a current position. Callers can then
+// navigate using the `Next`, `Previous`, `Skip` and `Seek` methods.
+//
+// The navigator instance does not take or adopt a reference on the provided
+// `tree` on any of the initialization calls. Callers are responsible for
+// guaranteeing the lifecycle of the provided tree. A navigator instance can
+// be reset to the empty state by calling `Reset`.
+//
+// A navigator only keeps positional state on the 'current data edge', it does
+// explicitly not keep any 'offset' state. The class does accept and return
+// offsets in the `Read()`, `Skip()` and 'Seek()` methods as these would
+// otherwise put a big burden on callers. Callers are expected to maintain
+// (returned) offset info if they require such granular state.
+class CordRepBtreeNavigator {
+ public:
+ // The logical position as returned by the Seek() and Skip() functions.
+ // Returns the current leaf edge for the desired seek or skip position and
+ // the offset of that position inside that edge.
+ struct Position {
+ CordRep* edge;
+ size_t offset;
+ };
+
+ // The read result as returned by the Read() function.
+ // `tree` contains the resulting tree which is identical to the result
+ // of calling CordRepBtree::SubTree(...) on the tree being navigated.
+ // `n` contains the number of bytes used from the last navigated to
+ // edge of the tree.
+ struct ReadResult {
+ CordRep* tree;
+ size_t n;
+ };
+
+ // Returns true if this instance is not empty.
+ explicit operator bool() const;
+
+ // Returns the tree for this instance or nullptr if empty.
+ CordRepBtree* btree() const;
+
+ // Returns the data edge of the current position.
+ // Requires this instance to not be empty.
+ CordRep* Current() const;
+
+ // Resets this navigator to `tree`, returning the first data edge in the tree.
+ CordRep* InitFirst(CordRepBtree* tree);
+
+ // Resets this navigator to `tree`, returning the last data edge in the tree.
+ CordRep* InitLast(CordRepBtree* tree);
+
+ // Resets this navigator to `tree` returning the data edge at position
+ // `offset` and the relative offset of `offset` into that data edge.
+ // Returns `Position.edge = nullptr` if the provided offset is greater
+ // than or equal to the length of the tree, in which case the state of
+ // the navigator instance remains unchanged.
+ Position InitOffset(CordRepBtree* tree, size_t offset);
+
+ // Navigates to the next data edge.
+ // Returns the next data edge or nullptr if there is no next data edge, in
+ // which case the current position remains unchanged.
+ CordRep* Next();
+
+ // Navigates to the previous data edge.
+ // Returns the previous data edge or nullptr if there is no previous data
+ // edge, in which case the current position remains unchanged.
+ CordRep* Previous();
+
+ // Navigates to the data edge at position `offset`. Returns the navigated to
+ // data edge in `Position.edge` and the relative offset of `offset` into that
+ // data edge in `Position.offset`. Returns `Position.edge = nullptr` if the
+ // provide offset is greater than or equal to the tree's length.
+ Position Seek(size_t offset);
+
+ // Reads `n` bytes of data starting at offset `edge_offset` of the current
+ // data edge, and returns the result in `ReadResult.tree`. `ReadResult.n`
+ // contains the 'bytes used` from the last / current data edge in the tree.
+ // This allows users that mix regular navigation (using string views) and
+ // 'read into cord' navigation to keep track of the current state, and which
+ // bytes have been consumed from a navigator.
+ // This function returns `ReadResult.tree = nullptr` if the requested length
+ // exceeds the length of the tree starting at the current data edge.
+ ReadResult Read(size_t edge_offset, size_t n);
+
+ // Skips `n` bytes forward from the current data edge, returning the navigated
+ // to data edge in `Position.edge` and `Position.offset` containing the offset
+ // inside that data edge. Note that the state of the navigator is left
+ // unchanged if `n` is smaller than the length of the current data edge.
+ Position Skip(size_t n);
+
+ // Resets this instance to the default / empty state.
+ void Reset();
+
+ private:
+ // Slow path for Next() if Next() reached the end of a leaf node. Backtracks
+ // up the stack until it finds a node that has a 'next' position available,
+ // and then does a 'front dive' towards the next leaf node.
+ CordRep* NextUp();
+
+ // Slow path for Previous() if Previous() reached the beginning of a leaf
+ // node. Backtracks up the stack until it finds a node that has a 'previous'
+ // position available, and then does a 'back dive' towards the previous leaf
+ // node.
+ CordRep* PreviousUp();
+
+ // Generic implementation of InitFirst() and InitLast().
+ template <CordRepBtree::EdgeType edge_type>
+ CordRep* Init(CordRepBtree* tree);
+
+ // `height_` contains the height of the current tree, or -1 if empty.
+ int height_ = -1;
+
+ // `index_` and `node_` contain the navigation state as the 'path' to the
+ // current data edge which is at `node_[0]->Edge(index_[0])`. The contents
+ // of these are undefined until the instance is initialized (`height_ >= 0`).
+ uint8_t index_[CordRepBtree::kMaxHeight];
+ CordRepBtree* node_[CordRepBtree::kMaxHeight];
+};
+
+// Returns true if this instance is not empty.
+inline CordRepBtreeNavigator::operator bool() const { return height_ >= 0; }
+
+inline CordRepBtree* CordRepBtreeNavigator::btree() const {
+ return height_ >= 0 ? node_[height_] : nullptr;
+}
+
+inline CordRep* CordRepBtreeNavigator::Current() const {
+ assert(height_ >= 0);
+ return node_[0]->Edge(index_[0]);
+}
+
+inline void CordRepBtreeNavigator::Reset() { height_ = -1; }
+
+inline CordRep* CordRepBtreeNavigator::InitFirst(CordRepBtree* tree) {
+ return Init<CordRepBtree::kFront>(tree);
+}
+
+inline CordRep* CordRepBtreeNavigator::InitLast(CordRepBtree* tree) {
+ return Init<CordRepBtree::kBack>(tree);
+}
+
+template <CordRepBtree::EdgeType edge_type>
+inline CordRep* CordRepBtreeNavigator::Init(CordRepBtree* tree) {
+ assert(tree != nullptr);
+ assert(tree->size() > 0);
+ int height = height_ = tree->height();
+ size_t index = tree->index(edge_type);
+ node_[height] = tree;
+ index_[height] = static_cast<uint8_t>(index);
+ while (--height >= 0) {
+ tree = tree->Edge(index)->btree();
+ node_[height] = tree;
+ index = tree->index(edge_type);
+ index_[height] = static_cast<uint8_t>(index);
+ }
+ return node_[0]->Edge(index);
+}
+
+inline CordRepBtreeNavigator::Position CordRepBtreeNavigator::Seek(
+ size_t offset) {
+ assert(btree() != nullptr);
+ int height = height_;
+ CordRepBtree* edge = node_[height];
+ if (ABSL_PREDICT_FALSE(offset >= edge->length)) return {nullptr, 0};
+ CordRepBtree::Position index = edge->IndexOf(offset);
+ index_[height] = static_cast<uint8_t>(index.index);
+ while (--height >= 0) {
+ edge = edge->Edge(index.index)->btree();
+ node_[height] = edge;
+ index = edge->IndexOf(index.n);
+ index_[height] = static_cast<uint8_t>(index.index);
+ }
+ return {edge->Edge(index.index), index.n};
+}
+
+inline CordRepBtreeNavigator::Position CordRepBtreeNavigator::InitOffset(
+ CordRepBtree* tree, size_t offset) {
+ assert(tree != nullptr);
+ if (ABSL_PREDICT_FALSE(offset >= tree->length)) return {nullptr, 0};
+ height_ = tree->height();
+ node_[height_] = tree;
+ return Seek(offset);
+}
+
+inline CordRep* CordRepBtreeNavigator::Next() {
+ CordRepBtree* edge = node_[0];
+ return index_[0] == edge->back() ? NextUp() : edge->Edge(++index_[0]);
+}
+
+inline CordRep* CordRepBtreeNavigator::Previous() {
+ CordRepBtree* edge = node_[0];
+ return index_[0] == edge->begin() ? PreviousUp() : edge->Edge(--index_[0]);
+}
+
+inline CordRep* CordRepBtreeNavigator::NextUp() {
+ assert(index_[0] == node_[0]->back());
+ CordRepBtree* edge;
+ size_t index;
+ int height = 0;
+ do {
+ if (++height > height_) return nullptr;
+ edge = node_[height];
+ index = index_[height] + 1;
+ } while (index == edge->end());
+ index_[height] = static_cast<uint8_t>(index);
+ do {
+ node_[--height] = edge = edge->Edge(index)->btree();
+ index_[height] = static_cast<uint8_t>(index = edge->begin());
+ } while (height > 0);
+ return edge->Edge(index);
+}
+
+inline CordRep* CordRepBtreeNavigator::PreviousUp() {
+ assert(index_[0] == node_[0]->begin());
+ CordRepBtree* edge;
+ size_t index;
+ int height = 0;
+ do {
+ if (++height > height_) return nullptr;
+ edge = node_[height];
+ index = index_[height];
+ } while (index == edge->begin());
+ index_[height] = static_cast<uint8_t>(--index);
+ do {
+ node_[--height] = edge = edge->Edge(index)->btree();
+ index_[height] = static_cast<uint8_t>(index = edge->back());
+ } while (height > 0);
+ return edge->Edge(index);
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_NAVIGATOR_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc
new file mode 100644
index 00000000..ce09b199
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator_test.cc
@@ -0,0 +1,325 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree_navigator.h"
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_test_util.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::Eq;
+using ::testing::Ne;
+
+using ::absl::cordrep_testing::CordRepBtreeFromFlats;
+using ::absl::cordrep_testing::CordToString;
+using ::absl::cordrep_testing::CreateFlatsFromString;
+using ::absl::cordrep_testing::CreateRandomString;
+using ::absl::cordrep_testing::MakeFlat;
+using ::absl::cordrep_testing::MakeSubstring;
+
+using ReadResult = CordRepBtreeNavigator::ReadResult;
+using Position = CordRepBtreeNavigator::Position;
+
+// CordRepBtreeNavigatorTest is a test fixture which automatically creates a
+// tree to test navigation logic on. The parameter `count' defines the number of
+// data edges in the test tree.
+class CordRepBtreeNavigatorTest : public testing::TestWithParam<int> {
+ public:
+ using Flats = std::vector<CordRep*>;
+ static constexpr size_t kCharsPerFlat = 3;
+
+ CordRepBtreeNavigatorTest() {
+ data_ = CreateRandomString(count() * kCharsPerFlat);
+ flats_ = CreateFlatsFromString(data_, kCharsPerFlat);
+
+ // Turn flat 0 or 1 into a substring to cover partial reads on substrings.
+ if (count() > 1) {
+ CordRep::Unref(flats_[1]);
+ flats_[1] = MakeSubstring(kCharsPerFlat, kCharsPerFlat, MakeFlat(data_));
+ } else {
+ CordRep::Unref(flats_[0]);
+ flats_[0] = MakeSubstring(0, kCharsPerFlat, MakeFlat(data_));
+ }
+
+ tree_ = CordRepBtreeFromFlats(flats_);
+ }
+
+ ~CordRepBtreeNavigatorTest() override { CordRep::Unref(tree_); }
+
+ int count() const { return GetParam(); }
+ CordRepBtree* tree() { return tree_; }
+ const std::string& data() const { return data_; }
+ const std::vector<CordRep*>& flats() const { return flats_; }
+
+ static std::string ToString(testing::TestParamInfo<int> param) {
+ return absl::StrCat(param.param, "_Flats");
+ }
+
+ private:
+ std::string data_;
+ Flats flats_;
+ CordRepBtree* tree_;
+};
+
+INSTANTIATE_TEST_SUITE_P(
+ WithParam, CordRepBtreeNavigatorTest,
+ testing::Values(1, CordRepBtree::kMaxCapacity - 1,
+ CordRepBtree::kMaxCapacity,
+ CordRepBtree::kMaxCapacity* CordRepBtree::kMaxCapacity - 1,
+ CordRepBtree::kMaxCapacity* CordRepBtree::kMaxCapacity,
+ CordRepBtree::kMaxCapacity* CordRepBtree::kMaxCapacity + 1,
+ CordRepBtree::kMaxCapacity* CordRepBtree::kMaxCapacity * 2 +
+ 17),
+ CordRepBtreeNavigatorTest::ToString);
+
+TEST(CordRepBtreeNavigatorTest, Uninitialized) {
+ CordRepBtreeNavigator nav;
+ EXPECT_FALSE(nav);
+ EXPECT_THAT(nav.btree(), Eq(nullptr));
+#if defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+ EXPECT_DEATH(nav.Current(), ".*");
+#endif
+}
+
+TEST_P(CordRepBtreeNavigatorTest, InitFirst) {
+ CordRepBtreeNavigator nav;
+ CordRep* edge = nav.InitFirst(tree());
+ EXPECT_TRUE(nav);
+ EXPECT_THAT(nav.btree(), Eq(tree()));
+ EXPECT_THAT(nav.Current(), Eq(flats().front()));
+ EXPECT_THAT(edge, Eq(flats().front()));
+}
+
+TEST_P(CordRepBtreeNavigatorTest, InitLast) {
+ CordRepBtreeNavigator nav;
+ CordRep* edge = nav.InitLast(tree());
+ EXPECT_TRUE(nav);
+ EXPECT_THAT(nav.btree(), Eq(tree()));
+ EXPECT_THAT(nav.Current(), Eq(flats().back()));
+ EXPECT_THAT(edge, Eq(flats().back()));
+}
+
+TEST_P(CordRepBtreeNavigatorTest, NextPrev) {
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+ const Flats& flats = this->flats();
+
+ EXPECT_THAT(nav.Previous(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.front()));
+ for (int i = 1; i < flats.size(); ++i) {
+ ASSERT_THAT(nav.Next(), Eq(flats[i]));
+ EXPECT_THAT(nav.Current(), Eq(flats[i]));
+ }
+ EXPECT_THAT(nav.Next(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.back()));
+ for (int i = static_cast<int>(flats.size()) - 2; i >= 0; --i) {
+ ASSERT_THAT(nav.Previous(), Eq(flats[i]));
+ EXPECT_THAT(nav.Current(), Eq(flats[i]));
+ }
+ EXPECT_THAT(nav.Previous(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.front()));
+}
+
+TEST_P(CordRepBtreeNavigatorTest, PrevNext) {
+ CordRepBtreeNavigator nav;
+ nav.InitLast(tree());
+ const Flats& flats = this->flats();
+
+ EXPECT_THAT(nav.Next(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.back()));
+ for (int i = static_cast<int>(flats.size()) - 2; i >= 0; --i) {
+ ASSERT_THAT(nav.Previous(), Eq(flats[i]));
+ EXPECT_THAT(nav.Current(), Eq(flats[i]));
+ }
+ EXPECT_THAT(nav.Previous(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.front()));
+ for (int i = 1; i < flats.size(); ++i) {
+ ASSERT_THAT(nav.Next(), Eq(flats[i]));
+ EXPECT_THAT(nav.Current(), Eq(flats[i]));
+ }
+ EXPECT_THAT(nav.Next(), Eq(nullptr));
+ EXPECT_THAT(nav.Current(), Eq(flats.back()));
+}
+
+TEST(CordRepBtreeNavigatorTest, Reset) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat("abc"));
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree);
+ nav.Reset();
+ EXPECT_FALSE(nav);
+ EXPECT_THAT(nav.btree(), Eq(nullptr));
+#if defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+ EXPECT_DEATH(nav.Current(), ".*");
+#endif
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeNavigatorTest, Skip) {
+ int count = this->count();
+ const Flats& flats = this->flats();
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+
+ for (int char_offset = 0; char_offset < kCharsPerFlat; ++char_offset) {
+ Position pos = nav.Skip(char_offset);
+ EXPECT_THAT(pos.edge, Eq(nav.Current()));
+ EXPECT_THAT(pos.edge, Eq(flats[0]));
+ EXPECT_THAT(pos.offset, Eq(char_offset));
+ }
+
+ for (int index1 = 0; index1 < count; ++index1) {
+ for (int index2 = index1; index2 < count; ++index2) {
+ for (int char_offset = 0; char_offset < kCharsPerFlat; ++char_offset) {
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+
+ size_t length1 = index1 * kCharsPerFlat;
+ Position pos1 = nav.Skip(length1 + char_offset);
+ ASSERT_THAT(pos1.edge, Eq(flats[index1]));
+ ASSERT_THAT(pos1.edge, Eq(nav.Current()));
+ ASSERT_THAT(pos1.offset, Eq(char_offset));
+
+ size_t length2 = index2 * kCharsPerFlat;
+ Position pos2 = nav.Skip(length2 - length1 + char_offset);
+ ASSERT_THAT(pos2.edge, Eq(flats[index2]));
+ ASSERT_THAT(pos2.edge, Eq(nav.Current()));
+ ASSERT_THAT(pos2.offset, Eq(char_offset));
+ }
+ }
+ }
+}
+
+TEST_P(CordRepBtreeNavigatorTest, Seek) {
+ int count = this->count();
+ const Flats& flats = this->flats();
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+
+ for (int char_offset = 0; char_offset < kCharsPerFlat; ++char_offset) {
+ Position pos = nav.Seek(char_offset);
+ EXPECT_THAT(pos.edge, Eq(nav.Current()));
+ EXPECT_THAT(pos.edge, Eq(flats[0]));
+ EXPECT_THAT(pos.offset, Eq(char_offset));
+ }
+
+ for (int index = 0; index < count; ++index) {
+ for (int char_offset = 0; char_offset < kCharsPerFlat; ++char_offset) {
+ size_t offset = index * kCharsPerFlat + char_offset;
+ Position pos1 = nav.Seek(offset);
+ ASSERT_THAT(pos1.edge, Eq(flats[index]));
+ ASSERT_THAT(pos1.edge, Eq(nav.Current()));
+ ASSERT_THAT(pos1.offset, Eq(char_offset));
+ }
+ }
+}
+
+TEST(CordRepBtreeNavigatorTest, InitOffset) {
+ // Whitebox: InitOffset() is implemented in terms of Seek() which is
+ // exhaustively tested. Only test it initializes / forwards properly..
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat("abc"));
+ tree = CordRepBtree::Append(tree, MakeFlat("def"));
+ CordRepBtreeNavigator nav;
+ Position pos = nav.InitOffset(tree, 5);
+ EXPECT_TRUE(nav);
+ EXPECT_THAT(nav.btree(), Eq(tree));
+ EXPECT_THAT(pos.edge, Eq(tree->Edges()[1]));
+ EXPECT_THAT(pos.edge, Eq(nav.Current()));
+ EXPECT_THAT(pos.offset, Eq(2));
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepBtreeNavigatorTest, InitOffsetAndSeekBeyondLength) {
+ CordRepBtree* tree1 = CordRepBtree::Create(MakeFlat("abc"));
+ CordRepBtree* tree2 = CordRepBtree::Create(MakeFlat("def"));
+
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree1);
+ EXPECT_THAT(nav.Seek(3).edge, Eq(nullptr));
+ EXPECT_THAT(nav.Seek(100).edge, Eq(nullptr));
+ EXPECT_THAT(nav.btree(), Eq(tree1));
+ EXPECT_THAT(nav.Current(), Eq(tree1->Edges().front()));
+
+ EXPECT_THAT(nav.InitOffset(tree2, 3).edge, Eq(nullptr));
+ EXPECT_THAT(nav.InitOffset(tree2, 100).edge, Eq(nullptr));
+ EXPECT_THAT(nav.btree(), Eq(tree1));
+ EXPECT_THAT(nav.Current(), Eq(tree1->Edges().front()));
+
+ CordRep::Unref(tree1);
+ CordRep::Unref(tree2);
+}
+
+TEST_P(CordRepBtreeNavigatorTest, Read) {
+ const Flats& flats = this->flats();
+ const std::string& data = this->data();
+
+ for (size_t offset = 0; offset < data.size(); ++offset) {
+ for (size_t length = 1; length <= data.size() - offset; ++length) {
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+
+ // Skip towards edge holding offset
+ size_t edge_offset = nav.Skip(offset).offset;
+
+ // Read node
+ ReadResult result = nav.Read(edge_offset, length);
+ ASSERT_THAT(result.tree, Ne(nullptr));
+ EXPECT_THAT(result.tree->length, Eq(length));
+ if (result.tree->tag == BTREE) {
+ ASSERT_TRUE(CordRepBtree::IsValid(result.tree->btree()));
+ }
+
+ // Verify contents
+ std::string value = CordToString(result.tree);
+ EXPECT_THAT(value, Eq(data.substr(offset, length)));
+
+ // Verify 'partial last edge' reads.
+ size_t partial = (offset + length) % kCharsPerFlat;
+ ASSERT_THAT(result.n, Eq(partial));
+
+ // Verify ending position if not EOF
+ if (offset + length < data.size()) {
+ size_t index = (offset + length) / kCharsPerFlat;
+ EXPECT_THAT(nav.Current(), Eq(flats[index]));
+ }
+
+ CordRep::Unref(result.tree);
+ }
+ }
+}
+
+TEST_P(CordRepBtreeNavigatorTest, ReadBeyondLengthOfTree) {
+ CordRepBtreeNavigator nav;
+ nav.InitFirst(tree());
+ ReadResult result = nav.Read(2, tree()->length);
+ ASSERT_THAT(result.tree, Eq(nullptr));
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc
new file mode 100644
index 00000000..5dc76966
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc
@@ -0,0 +1,68 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree_reader.h"
+
+#include <cassert>
+
+#include "absl/base/config.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_btree_navigator.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+absl::string_view CordRepBtreeReader::Read(size_t n, size_t chunk_size,
+ CordRep*& tree) {
+ assert(chunk_size <= navigator_.Current()->length);
+
+ // If chunk_size is non-zero, we need to start inside last returned edge.
+ // Else we start reading at the next data edge of the tree.
+ CordRep* edge = chunk_size ? navigator_.Current() : navigator_.Next();
+ const size_t offset = chunk_size ? edge->length - chunk_size : 0;
+
+ // Read the sub tree and verify we got what we wanted.
+ ReadResult result = navigator_.Read(offset, n);
+ tree = result.tree;
+
+ // If the data returned in `tree` was covered entirely by `chunk_size`, i.e.,
+ // read from the 'previous' edge, we did not consume any additional data, and
+ // can directly return the substring into the current data edge as the next
+ // chunk. We can easily establish from the above code that `navigator_.Next()`
+ // has not been called as that requires `chunk_size` to be zero.
+ if (n < chunk_size) return CordRepBtree::EdgeData(edge).substr(result.n);
+
+ // The amount of data taken from the last edge is `chunk_size` and `result.n`
+ // contains the offset into the current edge trailing the read data (which can
+ // be 0). As the call to `navigator_.Read()` could have consumed all remaining
+ // data, calling `navigator_.Current()` is not safe before checking if we
+ // already consumed all remaining data.
+ const size_t consumed_by_read = n - chunk_size - result.n;
+ if (consumed_by_read >= remaining_) {
+ remaining_ = 0;
+ return {};
+ }
+
+ // We did not read all data, return remaining data from current edge.
+ edge = navigator_.Current();
+ remaining_ -= consumed_by_read + edge->length;
+ return CordRepBtree::EdgeData(edge).substr(result.n);
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h
new file mode 100644
index 00000000..7aa79dbf
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h
@@ -0,0 +1,211 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_READER_H_
+#define ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_READER_H_
+
+#include <cassert>
+
+#include "absl/base/config.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_btree_navigator.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordRepBtreeReader implements logic to iterate over cord btrees.
+// References to the underlying data are returned as absl::string_view values.
+// The most typical use case is a forward only iteration over tree data.
+// The class also provides `Skip()`, `Seek()` and `Read()` methods similar to
+// CordRepBtreeNavigator that allow more advanced navigation.
+//
+// Example: iterate over all data inside a cord btree:
+//
+// CordRepBtreeReader reader;
+// for (string_view sv = reader.Init(tree); !sv.Empty(); sv = sv.Next()) {
+// DoSomethingWithDataIn(sv);
+// }
+//
+// All navigation methods always return the next 'chunk' of data. The class
+// assumes that all data is directly 'consumed' by the caller. For example:
+// invoking `Skip()` will skip the desired number of bytes, and directly
+// read and return the next chunk of data directly after the skipped bytes.
+//
+// Example: iterate over all data inside a btree skipping the first 100 bytes:
+//
+// CordRepBtreeReader reader;
+// absl::string_view sv = reader.Init(tree);
+// if (sv.length() > 100) {
+// sv.RemovePrefix(100);
+// } else {
+// sv = reader.Skip(100 - sv.length());
+// }
+// while (!sv.empty()) {
+// DoSomethingWithDataIn(sv);
+// absl::string_view sv = reader.Next();
+// }
+//
+// It is important to notice that `remaining` is based on the end position of
+// the last data edge returned to the caller, not the cumulative data returned
+// to the caller which can be less in cases of skipping or seeking over data.
+//
+// For example, consider a cord btree with five data edges: "abc", "def", "ghi",
+// "jkl" and "mno":
+//
+// absl::string_view sv;
+// CordRepBtreeReader reader;
+//
+// sv = reader.Init(tree); // sv = "abc", remaining = 12
+// sv = reader.Skip(4); // sv = "hi", remaining = 6
+// sv = reader.Skip(2); // sv = "l", remaining = 3
+// sv = reader.Next(); // sv = "mno", remaining = 0
+// sv = reader.Seek(1); // sv = "bc", remaining = 12
+//
+class CordRepBtreeReader {
+ public:
+ using ReadResult = CordRepBtreeNavigator::ReadResult;
+ using Position = CordRepBtreeNavigator::Position;
+
+ // Returns true if this instance is not empty.
+ explicit operator bool() const { return navigator_.btree() != nullptr; }
+
+ // Returns the tree referenced by this instance or nullptr if empty.
+ CordRepBtree* btree() const { return navigator_.btree(); }
+
+ // Returns the current data edge inside the referenced btree.
+ // Requires that the current instance is not empty.
+ CordRep* node() const { return navigator_.Current(); }
+
+ // Returns the length of the referenced tree.
+ // Requires that the current instance is not empty.
+ size_t length() const;
+
+ // Returns the number of remaining bytes available for iteration, which is the
+ // number of bytes directly following the end of the last chunk returned.
+ // This value will be zero if we iterated over the last edge in the bound
+ // tree, in which case any call to Next() or Skip() will return an empty
+ // string_view reflecting the EOF state.
+ // Note that a call to `Seek()` resets `remaining` to a value based on the
+ // end position of the chunk returned by that call.
+ size_t remaining() const { return remaining_; }
+
+ // Resets this instance to an empty value.
+ void Reset() { navigator_.Reset(); }
+
+ // Initializes this instance with `tree`. `tree` must not be null.
+ // Returns a reference to the first data edge of the provided tree.
+ absl::string_view Init(CordRepBtree* tree);
+
+ // Navigates to and returns the next data edge of the referenced tree.
+ // Returns an empty string_view if an attempt is made to read beyond the end
+ // of the tree, i.e.: if `remaining()` is zero indicating an EOF condition.
+ // Requires that the current instance is not empty.
+ absl::string_view Next();
+
+ // Skips the provided amount of bytes and returns a reference to the data
+ // directly following the skipped bytes.
+ absl::string_view Skip(size_t skip);
+
+ // Reads `n` bytes into `tree`.
+ // If `chunk_size` is zero, starts reading at the next data edge. If
+ // `chunk_size` is non zero, the read starts at the last `chunk_size` bytes of
+ // the last returned data edge. Effectively, this means that the read starts
+ // at offset `consumed() - chunk_size`.
+ // Requires that `chunk_size` is less than or equal to the length of the
+ // last returned data edge. The purpose of `chunk_size` is to simplify code
+ // partially consuming a returned chunk and wanting to include the remaining
+ // bytes in the Read call. For example, the below code will read 1000 bytes of
+ // data into a cord tree if the first chunk starts with "big:":
+ //
+ // CordRepBtreeReader reader;
+ // absl::string_view sv = reader.Init(tree);
+ // if (absl::StartsWith(sv, "big:")) {
+ // CordRepBtree tree;
+ // sv = reader.Read(1000, sv.size() - 4 /* "big:" */, &tree);
+ // }
+ //
+ // This method will return an empty string view if all remaining data was
+ // read. If `n` exceeded the amount of remaining data this function will
+ // return an empty string view and `tree` will be set to nullptr.
+ // In both cases, `consumed` will be set to `length`.
+ absl::string_view Read(size_t n, size_t chunk_size, CordRep*& tree);
+
+ // Navigates to the chunk at offset `offset`.
+ // Returns a reference into the navigated to chunk, adjusted for the relative
+ // position of `offset` into that chunk. For example, calling `Seek(13)` on a
+ // cord tree containing 2 chunks of 10 and 20 bytes respectively will return
+ // a string view into the second chunk starting at offset 3 with a size of 17.
+ // Returns an empty string view if `offset` is equal to or greater than the
+ // length of the referenced tree.
+ absl::string_view Seek(size_t offset);
+
+ private:
+ size_t remaining_ = 0;
+ CordRepBtreeNavigator navigator_;
+};
+
+inline size_t CordRepBtreeReader::length() const {
+ assert(btree() != nullptr);
+ return btree()->length;
+}
+
+inline absl::string_view CordRepBtreeReader::Init(CordRepBtree* tree) {
+ assert(tree != nullptr);
+ const CordRep* edge = navigator_.InitFirst(tree);
+ remaining_ = tree->length - edge->length;
+ return CordRepBtree::EdgeData(edge);
+}
+
+inline absl::string_view CordRepBtreeReader::Next() {
+ if (remaining_ == 0) return {};
+ const CordRep* edge = navigator_.Next();
+ assert(edge != nullptr);
+ remaining_ -= edge->length;
+ return CordRepBtree::EdgeData(edge);
+}
+
+inline absl::string_view CordRepBtreeReader::Skip(size_t skip) {
+ // As we are always positioned on the last 'consumed' edge, we
+ // need to skip the current edge as well as `skip`.
+ const size_t edge_length = navigator_.Current()->length;
+ CordRepBtreeNavigator::Position pos = navigator_.Skip(skip + edge_length);
+ if (ABSL_PREDICT_FALSE(pos.edge == nullptr)) {
+ remaining_ = 0;
+ return {};
+ }
+ // The combined length of all edges skipped before `pos.edge` is `skip -
+ // pos.offset`, all of which are 'consumed', as well as the current edge.
+ remaining_ -= skip - pos.offset + pos.edge->length;
+ return CordRepBtree::EdgeData(pos.edge).substr(pos.offset);
+}
+
+inline absl::string_view CordRepBtreeReader::Seek(size_t offset) {
+ const CordRepBtreeNavigator::Position pos = navigator_.Seek(offset);
+ if (ABSL_PREDICT_FALSE(pos.edge == nullptr)) {
+ remaining_ = 0;
+ return {};
+ }
+ absl::string_view chunk = CordRepBtree::EdgeData(pos.edge).substr(pos.offset);
+ remaining_ = length() - offset - chunk.length();
+ return chunk;
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORD_REP_BTREE_READER_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc
new file mode 100644
index 00000000..9b27a81f
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader_test.cc
@@ -0,0 +1,293 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree_reader.h"
+
+#include <iostream>
+#include <random>
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/strings/cord.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_test_util.h"
+#include "absl/strings/string_view.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::Eq;
+using ::testing::IsEmpty;
+using ::testing::Ne;
+using ::testing::Not;
+
+using ::absl::cordrep_testing::CordRepBtreeFromFlats;
+using ::absl::cordrep_testing::MakeFlat;
+using ::absl::cordrep_testing::CordToString;
+using ::absl::cordrep_testing::CreateFlatsFromString;
+using ::absl::cordrep_testing::CreateRandomString;
+
+using ReadResult = CordRepBtreeReader::ReadResult;
+
+TEST(CordRepBtreeReaderTest, Next) {
+ constexpr size_t kChars = 3;
+ const size_t cap = CordRepBtree::kMaxCapacity;
+ int counts[] = {1, 2, cap, cap * cap, cap * cap + 1, cap * cap * 2 + 17};
+
+ for (int count : counts) {
+ std::string data = CreateRandomString(count * kChars);
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, kChars);
+ CordRepBtree* node = CordRepBtreeFromFlats(flats);
+
+ CordRepBtreeReader reader;
+ size_t remaining = data.length();
+ absl::string_view chunk = reader.Init(node);
+ EXPECT_THAT(chunk, Eq(data.substr(0, chunk.length())));
+
+ remaining -= chunk.length();
+ EXPECT_THAT(reader.remaining(), Eq(remaining));
+
+ while (remaining > 0) {
+ const size_t offset = data.length() - remaining;
+ chunk = reader.Next();
+ EXPECT_THAT(chunk, Eq(data.substr(offset, chunk.length())));
+
+ remaining -= chunk.length();
+ EXPECT_THAT(reader.remaining(), Eq(remaining));
+ }
+
+ EXPECT_THAT(reader.remaining(), Eq(0));
+
+ // Verify trying to read beyond EOF returns empty string_view
+ EXPECT_THAT(reader.Next(), testing::IsEmpty());
+
+ CordRep::Unref(node);
+ }
+}
+
+TEST(CordRepBtreeReaderTest, Skip) {
+ constexpr size_t kChars = 3;
+ const size_t cap = CordRepBtree::kMaxCapacity;
+ int counts[] = {1, 2, cap, cap * cap, cap * cap + 1, cap * cap * 2 + 17};
+
+ for (int count : counts) {
+ std::string data = CreateRandomString(count * kChars);
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, kChars);
+ CordRepBtree* node = CordRepBtreeFromFlats(flats);
+
+ for (size_t skip1 = 0; skip1 < data.length() - kChars; ++skip1) {
+ for (size_t skip2 = 0; skip2 < data.length() - kChars; ++skip2) {
+ CordRepBtreeReader reader;
+ size_t remaining = data.length();
+ absl::string_view chunk = reader.Init(node);
+ remaining -= chunk.length();
+
+ chunk = reader.Skip(skip1);
+ size_t offset = data.length() - remaining;
+ ASSERT_THAT(chunk, Eq(data.substr(offset + skip1, chunk.length())));
+ remaining -= chunk.length() + skip1;
+ ASSERT_THAT(reader.remaining(), Eq(remaining));
+
+ if (remaining == 0) continue;
+
+ size_t skip = std::min(remaining - 1, skip2);
+ chunk = reader.Skip(skip);
+ offset = data.length() - remaining;
+ ASSERT_THAT(chunk, Eq(data.substr(offset + skip, chunk.length())));
+ }
+ }
+
+ CordRep::Unref(node);
+ }
+}
+
+TEST(CordRepBtreeReaderTest, SkipBeyondLength) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat("abc"));
+ tree = CordRepBtree::Append(tree, MakeFlat("def"));
+ CordRepBtreeReader reader;
+ reader.Init(tree);
+ EXPECT_THAT(reader.Skip(100), IsEmpty());
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepBtreeReaderTest, Seek) {
+ constexpr size_t kChars = 3;
+ const size_t cap = CordRepBtree::kMaxCapacity;
+ int counts[] = {1, 2, cap, cap * cap, cap * cap + 1, cap * cap * 2 + 17};
+
+ for (int count : counts) {
+ std::string data = CreateRandomString(count * kChars);
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, kChars);
+ CordRepBtree* node = CordRepBtreeFromFlats(flats);
+
+ for (size_t seek = 0; seek < data.length() - 1; ++seek) {
+ CordRepBtreeReader reader;
+ reader.Init(node);
+ absl::string_view chunk = reader.Seek(seek);
+ ASSERT_THAT(chunk, Not(IsEmpty()));
+ ASSERT_THAT(chunk, Eq(data.substr(seek, chunk.length())));
+ ASSERT_THAT(reader.remaining(),
+ Eq(data.length() - seek - chunk.length()));
+ }
+
+ CordRep::Unref(node);
+ }
+}
+
+TEST(CordRepBtreeReaderTest, SeekBeyondLength) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat("abc"));
+ tree = CordRepBtree::Append(tree, MakeFlat("def"));
+ CordRepBtreeReader reader;
+ reader.Init(tree);
+ EXPECT_THAT(reader.Seek(6), IsEmpty());
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ EXPECT_THAT(reader.Seek(100), IsEmpty());
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepBtreeReaderTest, Read) {
+ std::string data = "abcdefghijklmno";
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, 5);
+ CordRepBtree* node = CordRepBtreeFromFlats(flats);
+
+ CordRep* tree;
+ CordRepBtreeReader reader;
+ absl::string_view chunk;
+
+ // Read zero bytes
+ chunk = reader.Init(node);
+ chunk = reader.Read(0, chunk.length(), tree);
+ EXPECT_THAT(tree, Eq(nullptr));
+ EXPECT_THAT(chunk, Eq("abcde"));
+ EXPECT_THAT(reader.remaining(), Eq(10));
+ EXPECT_THAT(reader.Next(), Eq("fghij"));
+
+ // Read in full
+ chunk = reader.Init(node);
+ chunk = reader.Read(15, chunk.length(), tree);
+ EXPECT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("abcdefghijklmno"));
+ EXPECT_THAT(chunk, Eq(""));
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ CordRep::Unref(tree);
+
+ // Read < chunk bytes
+ chunk = reader.Init(node);
+ chunk = reader.Read(3, chunk.length(), tree);
+ ASSERT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("abc"));
+ EXPECT_THAT(chunk, Eq("de"));
+ EXPECT_THAT(reader.remaining(), Eq(10));
+ EXPECT_THAT(reader.Next(), Eq("fghij"));
+ CordRep::Unref(tree);
+
+ // Read < chunk bytes at offset
+ chunk = reader.Init(node);
+ chunk = reader.Read(2, chunk.length() - 2, tree);
+ ASSERT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("cd"));
+ EXPECT_THAT(chunk, Eq("e"));
+ EXPECT_THAT(reader.remaining(), Eq(10));
+ EXPECT_THAT(reader.Next(), Eq("fghij"));
+ CordRep::Unref(tree);
+
+ // Read from consumed chunk
+ chunk = reader.Init(node);
+ chunk = reader.Read(3, 0, tree);
+ ASSERT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("fgh"));
+ EXPECT_THAT(chunk, Eq("ij"));
+ EXPECT_THAT(reader.remaining(), Eq(5));
+ EXPECT_THAT(reader.Next(), Eq("klmno"));
+ CordRep::Unref(tree);
+
+ // Read across chunks
+ chunk = reader.Init(node);
+ chunk = reader.Read(12, chunk.length() - 2, tree);
+ ASSERT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("cdefghijklmn"));
+ EXPECT_THAT(chunk, Eq("o"));
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ CordRep::Unref(tree);
+
+ // Read across chunks landing on exact edge boundary
+ chunk = reader.Init(node);
+ chunk = reader.Read(10 - 2, chunk.length() - 2, tree);
+ ASSERT_THAT(tree, Ne(nullptr));
+ EXPECT_THAT(CordToString(tree), Eq("cdefghij"));
+ EXPECT_THAT(chunk, Eq("klmno"));
+ EXPECT_THAT(reader.remaining(), Eq(0));
+ CordRep::Unref(tree);
+
+ CordRep::Unref(node);
+}
+
+TEST(CordRepBtreeReaderTest, ReadExhaustive) {
+ constexpr size_t kChars = 3;
+ const size_t cap = CordRepBtree::kMaxCapacity;
+ int counts[] = {1, 2, cap, cap * cap + 1, cap * cap * cap * 2 + 17};
+
+ for (int count : counts) {
+ std::string data = CreateRandomString(count * kChars);
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, kChars);
+ CordRepBtree* node = CordRepBtreeFromFlats(flats);
+
+ for (size_t read_size : {kChars - 1, kChars, kChars + 7, cap * cap}) {
+ CordRepBtreeReader reader;
+ absl::string_view chunk = reader.Init(node);
+
+ // `consumed` tracks the end of last consumed chunk which is the start of
+ // the next chunk: we always read with `chunk_size = chunk.length()`.
+ size_t consumed = 0;
+ size_t remaining = data.length();
+ while (remaining > 0) {
+ CordRep* tree;
+ size_t n = (std::min)(remaining, read_size);
+ chunk = reader.Read(n, chunk.length(), tree);
+ EXPECT_THAT(tree, Ne(nullptr));
+ if (tree) {
+ EXPECT_THAT(CordToString(tree), Eq(data.substr(consumed, n)));
+ CordRep::Unref(tree);
+ }
+
+ consumed += n;
+ remaining -= n;
+ EXPECT_THAT(reader.remaining(), Eq(remaining - chunk.length()));
+
+ if (remaining > 0) {
+ ASSERT_FALSE(chunk.empty());
+ ASSERT_THAT(chunk, Eq(data.substr(consumed, chunk.length())));
+ } else {
+ ASSERT_TRUE(chunk.empty()) << chunk;
+ }
+ }
+ }
+
+ CordRep::Unref(node);
+ }
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc
new file mode 100644
index 00000000..be9473d4
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_test.cc
@@ -0,0 +1,1489 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_btree.h"
+
+#include <cmath>
+#include <deque>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/cleanup/cleanup.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_test_util.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+class CordRepBtreeTestPeer {
+ public:
+ static void SetEdge(CordRepBtree* node, size_t idx, CordRep* edge) {
+ node->edges_[idx] = edge;
+ }
+ static void AddEdge(CordRepBtree* node, CordRep* edge) {
+ node->edges_[node->fetch_add_end(1)] = edge;
+ }
+};
+
+namespace {
+
+using ::absl::cordrep_testing::AutoUnref;
+using ::absl::cordrep_testing::CordCollectRepsIf;
+using ::absl::cordrep_testing::CordToString;
+using ::absl::cordrep_testing::CordVisitReps;
+using ::absl::cordrep_testing::CreateFlatsFromString;
+using ::absl::cordrep_testing::CreateRandomString;
+using ::absl::cordrep_testing::MakeConcat;
+using ::absl::cordrep_testing::MakeExternal;
+using ::absl::cordrep_testing::MakeFlat;
+using ::absl::cordrep_testing::MakeSubstring;
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::AnyOf;
+using ::testing::Conditional;
+using ::testing::ElementsAre;
+using ::testing::ElementsAreArray;
+using ::testing::Eq;
+using ::testing::HasSubstr;
+using ::testing::Le;
+using ::testing::Ne;
+using ::testing::Not;
+using ::testing::SizeIs;
+using ::testing::TypedEq;
+
+MATCHER_P(EqFlatHolding, data, "Equals flat holding data") {
+ if (arg->tag < FLAT) {
+ *result_listener << "Expected FLAT, got tag " << static_cast<int>(arg->tag);
+ return false;
+ }
+ std::string actual = CordToString(arg);
+ if (actual != data) {
+ *result_listener << "Expected flat holding \"" << data
+ << "\", got flat holding \"" << actual << "\"";
+ return false;
+ }
+ return true;
+}
+
+MATCHER_P(IsNode, height, absl::StrCat("Is a valid node of height ", height)) {
+ if (arg == nullptr) {
+ *result_listener << "Expected NODE, got nullptr";
+ return false;
+ }
+ if (arg->tag != BTREE) {
+ *result_listener << "Expected NODE, got " << static_cast<int>(arg->tag);
+ return false;
+ }
+ if (!CordRepBtree::IsValid(arg->btree())) {
+ CordRepBtree::Dump(arg->btree(), "Expected valid NODE, got:", false,
+ *result_listener->stream());
+ return false;
+ }
+ if (arg->btree()->height() != height) {
+ *result_listener << "Expected NODE of height " << height << ", got "
+ << arg->btree()->height();
+ return false;
+ }
+ return true;
+}
+
+MATCHER_P2(IsSubstring, start, length,
+ absl::StrCat("Is a substring(start = ", start, ", length = ", length,
+ ")")) {
+ if (arg == nullptr) {
+ *result_listener << "Expected substring, got nullptr";
+ return false;
+ }
+ if (arg->tag != SUBSTRING) {
+ *result_listener << "Expected SUBSTRING, got "
+ << static_cast<int>(arg->tag);
+ return false;
+ }
+ const CordRepSubstring* const substr = arg->substring();
+ if (substr->start != start || substr->length != length) {
+ *result_listener << "Expected substring(" << start << ", " << length
+ << "), got substring(" << substr->start << ", "
+ << substr->length << ")";
+ return false;
+ }
+ return true;
+}
+
+// DataConsumer is a simple helper class used by tests to 'consume' string
+// fragments from the provided input in forward or backward direction.
+class DataConsumer {
+ public:
+ // Starts consumption of `data`. Caller must make sure `data` outlives this
+ // instance. Consumes data starting at the front if `forward` is true, else
+ // consumes data from the back.
+ DataConsumer(absl::string_view data, bool forward)
+ : data_(data), forward_(forward) {}
+
+ // Return the next `n` bytes from referenced data.
+ absl::string_view Next(size_t n) {
+ assert(n <= data_.size() - consumed_);
+ consumed_ += n;
+ return data_.substr(forward_ ? consumed_ - n : data_.size() - consumed_, n);
+ }
+
+ // Returns all data consumed so far.
+ absl::string_view Consumed() const {
+ return forward_ ? data_.substr(0, consumed_)
+ : data_.substr(data_.size() - consumed_);
+ }
+
+ private:
+ absl::string_view data_;
+ size_t consumed_ = 0;
+ bool forward_;
+};
+
+// BtreeAdd returns either CordRepBtree::Append or CordRepBtree::Prepend.
+CordRepBtree* BtreeAdd(CordRepBtree* node, bool append,
+ absl::string_view data) {
+ return append ? CordRepBtree::Append(node, data)
+ : CordRepBtree::Prepend(node, data);
+}
+
+// Recursively collects all leaf edges from `tree` and appends them to `edges`.
+void GetLeafEdges(const CordRepBtree* tree, std::vector<CordRep*>& edges) {
+ if (tree->height() == 0) {
+ for (CordRep* edge : tree->Edges()) {
+ edges.push_back(edge);
+ }
+ } else {
+ for (CordRep* edge : tree->Edges()) {
+ GetLeafEdges(edge->btree(), edges);
+ }
+ }
+}
+
+// Recursively collects and returns all leaf edges from `tree`.
+std::vector<CordRep*> GetLeafEdges(const CordRepBtree* tree) {
+ std::vector<CordRep*> edges;
+ GetLeafEdges(tree, edges);
+ return edges;
+}
+
+// Creates a flat containing the hexadecimal value of `i` zero padded
+// to at least 4 digits prefixed with "0x", e.g.: "0x04AC".
+CordRepFlat* MakeHexFlat(size_t i) {
+ return MakeFlat(absl::StrCat("0x", absl::Hex(i, absl::kZeroPad4)));
+}
+
+CordRepBtree* MakeLeaf(size_t size = CordRepBtree::kMaxCapacity) {
+ assert(size <= CordRepBtree::kMaxCapacity);
+ CordRepBtree* leaf = CordRepBtree::Create(MakeHexFlat(0));
+ for (size_t i = 1; i < size; ++i) {
+ leaf = CordRepBtree::Append(leaf, MakeHexFlat(i));
+ }
+ return leaf;
+}
+
+CordRepBtree* MakeTree(size_t size, bool append = true) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeHexFlat(0));
+ for (size_t i = 1; i < size; ++i) {
+ tree = append ? CordRepBtree::Append(tree, MakeHexFlat(i))
+ : CordRepBtree::Prepend(tree, MakeHexFlat(i));
+ }
+ return tree;
+}
+
+CordRepBtree* CreateTree(absl::Span<CordRep* const> reps) {
+ auto it = reps.begin();
+ CordRepBtree* tree = CordRepBtree::Create(*it);
+ while (++it != reps.end()) tree = CordRepBtree::Append(tree, *it);
+ return tree;
+}
+
+CordRepBtree* CreateTree(absl::string_view data, size_t chunk_size) {
+ return CreateTree(CreateFlatsFromString(data, chunk_size));
+}
+
+CordRepBtree* CreateTreeReverse(absl::string_view data, size_t chunk_size) {
+ std::vector<CordRep*> flats = CreateFlatsFromString(data, chunk_size);
+ auto rit = flats.rbegin();
+ CordRepBtree* tree = CordRepBtree::Create(*rit);
+ while (++rit != flats.rend()) tree = CordRepBtree::Prepend(tree, *rit);
+ return tree;
+}
+
+class CordRepBtreeTest : public testing::TestWithParam<bool> {
+ public:
+ bool shared() const { return GetParam(); }
+
+ static std::string ToString(testing::TestParamInfo<bool> param) {
+ return param.param ? "Shared" : "Private";
+ }
+};
+
+INSTANTIATE_TEST_SUITE_P(WithParam, CordRepBtreeTest, testing::Bool(),
+ CordRepBtreeTest::ToString);
+
+class CordRepBtreeHeightTest : public testing::TestWithParam<int> {
+ public:
+ int height() const { return GetParam(); }
+
+ static std::string ToString(testing::TestParamInfo<int> param) {
+ return absl::StrCat(param.param);
+ }
+};
+
+INSTANTIATE_TEST_SUITE_P(WithHeights, CordRepBtreeHeightTest,
+ testing::Range(0, CordRepBtree::kMaxHeight),
+ CordRepBtreeHeightTest::ToString);
+
+using TwoBools = testing::tuple<bool, bool>;
+
+class CordRepBtreeDualTest : public testing::TestWithParam<TwoBools> {
+ public:
+ bool first_shared() const { return std::get<0>(GetParam()); }
+ bool second_shared() const { return std::get<1>(GetParam()); }
+
+ static std::string ToString(testing::TestParamInfo<TwoBools> param) {
+ if (std::get<0>(param.param)) {
+ return std::get<1>(param.param) ? "BothShared" : "FirstShared";
+ }
+ return std::get<1>(param.param) ? "SecondShared" : "Private";
+ }
+};
+
+INSTANTIATE_TEST_SUITE_P(WithParam, CordRepBtreeDualTest,
+ testing::Combine(testing::Bool(), testing::Bool()),
+ CordRepBtreeDualTest::ToString);
+
+TEST(CordRepBtreeTest, SizeIsMultipleOf64) {
+ // Only enforce for fully 64-bit platforms.
+ if (sizeof(size_t) == 8 && sizeof(void*) == 8) {
+ EXPECT_THAT(sizeof(CordRepBtree) % 64, Eq(0)) << "Should be multiple of 64";
+ }
+}
+
+TEST(CordRepBtreeTest, NewDestroyEmptyTree) {
+ auto* tree = CordRepBtree::New();
+ EXPECT_THAT(tree->size(), Eq(0));
+ EXPECT_THAT(tree->height(), Eq(0));
+ EXPECT_THAT(tree->Edges(), ElementsAre());
+ CordRepBtree::Destroy(tree);
+}
+
+TEST(CordRepBtreeTest, NewDestroyEmptyTreeAtHeight) {
+ auto* tree = CordRepBtree::New(3);
+ EXPECT_THAT(tree->size(), Eq(0));
+ EXPECT_THAT(tree->height(), Eq(3));
+ EXPECT_THAT(tree->Edges(), ElementsAre());
+ CordRepBtree::Destroy(tree);
+}
+
+TEST(CordRepBtreeTest, Btree) {
+ CordRep* rep = CordRepBtree::New();
+ EXPECT_THAT(rep->btree(), Eq(rep));
+ EXPECT_THAT(static_cast<const CordRep*>(rep)->btree(), Eq(rep));
+ CordRep::Unref(rep);
+#if defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+ rep = MakeFlat("Hello world");
+ EXPECT_DEATH(rep->btree(), ".*");
+ EXPECT_DEATH(static_cast<const CordRep*>(rep)->btree(), ".*");
+ CordRep::Unref(rep);
+#endif
+}
+
+TEST(CordRepBtreeTest, EdgeData) {
+ CordRepFlat* flat = MakeFlat("Hello world");
+ CordRepExternal* external = MakeExternal("Hello external");
+ CordRep* substr1 = MakeSubstring(1, 6, CordRep::Ref(flat));
+ CordRep* substr2 = MakeSubstring(1, 6, CordRep::Ref(external));
+ CordRep* concat = MakeConcat(CordRep::Ref(flat), CordRep::Ref(external));
+ CordRep* bad_substr = MakeSubstring(1, 2, CordRep::Ref(substr1));
+
+ EXPECT_TRUE(CordRepBtree::IsDataEdge(flat));
+ EXPECT_THAT(CordRepBtree::EdgeDataPtr(flat),
+ TypedEq<const void*>(flat->Data()));
+ EXPECT_THAT(CordRepBtree::EdgeData(flat), Eq("Hello world"));
+
+ EXPECT_TRUE(CordRepBtree::IsDataEdge(external));
+ EXPECT_THAT(CordRepBtree::EdgeDataPtr(external),
+ TypedEq<const void*>(external->base));
+ EXPECT_THAT(CordRepBtree::EdgeData(external), Eq("Hello external"));
+
+ EXPECT_TRUE(CordRepBtree::IsDataEdge(substr1));
+ EXPECT_THAT(CordRepBtree::EdgeDataPtr(substr1),
+ TypedEq<const void*>(flat->Data() + 1));
+ EXPECT_THAT(CordRepBtree::EdgeData(substr1), Eq("ello w"));
+
+ EXPECT_TRUE(CordRepBtree::IsDataEdge(substr2));
+ EXPECT_THAT(CordRepBtree::EdgeDataPtr(substr2),
+ TypedEq<const void*>(external->base + 1));
+ EXPECT_THAT(CordRepBtree::EdgeData(substr2), Eq("ello e"));
+
+ EXPECT_FALSE(CordRepBtree::IsDataEdge(concat));
+ EXPECT_FALSE(CordRepBtree::IsDataEdge(bad_substr));
+#if defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+ EXPECT_DEATH(CordRepBtree::EdgeData(concat), ".*");
+ EXPECT_DEATH(CordRepBtree::EdgeDataPtr(concat), ".*");
+ EXPECT_DEATH(CordRepBtree::EdgeData(bad_substr), ".*");
+ EXPECT_DEATH(CordRepBtree::EdgeDataPtr(bad_substr), ".*");
+#endif
+
+ CordRep::Unref(bad_substr);
+ CordRep::Unref(concat);
+ CordRep::Unref(substr2);
+ CordRep::Unref(substr1);
+ CordRep::Unref(external);
+ CordRep::Unref(flat);
+}
+
+TEST(CordRepBtreeTest, CreateUnrefLeaf) {
+ auto* flat = MakeFlat("a");
+ auto* leaf = CordRepBtree::Create(flat);
+ EXPECT_THAT(leaf->size(), Eq(1));
+ EXPECT_THAT(leaf->height(), Eq(0));
+ EXPECT_THAT(leaf->Edges(), ElementsAre(flat));
+ CordRepBtree::Unref(leaf);
+}
+
+TEST(CordRepBtreeTest, NewUnrefNode) {
+ auto* leaf = CordRepBtree::Create(MakeFlat("a"));
+ CordRepBtree* tree = CordRepBtree::New(leaf);
+ EXPECT_THAT(tree->size(), Eq(1));
+ EXPECT_THAT(tree->height(), Eq(1));
+ EXPECT_THAT(tree->Edges(), ElementsAre(leaf));
+ CordRepBtree::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, AppendToLeafToCapacity) {
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+ flats.push_back(MakeHexFlat(0));
+ auto* leaf = CordRepBtree::Create(flats.back());
+
+ for (size_t i = 1; i < CordRepBtree::kMaxCapacity; ++i) {
+ refs.RefIf(shared(), leaf);
+ flats.push_back(MakeHexFlat(i));
+ auto* result = CordRepBtree::Append(leaf, flats.back());
+ EXPECT_THAT(result->height(), Eq(0));
+ EXPECT_THAT(result, Conditional(shared(), Ne(leaf), Eq(leaf)));
+ EXPECT_THAT(result->Edges(), ElementsAreArray(flats));
+ leaf = result;
+ }
+ CordRep::Unref(leaf);
+}
+
+TEST_P(CordRepBtreeTest, PrependToLeafToCapacity) {
+ AutoUnref refs;
+ std::deque<CordRep*> flats;
+ flats.push_front(MakeHexFlat(0));
+ auto* leaf = CordRepBtree::Create(flats.front());
+
+ for (size_t i = 1; i < CordRepBtree::kMaxCapacity; ++i) {
+ refs.RefIf(shared(), leaf);
+ flats.push_front(MakeHexFlat(i));
+ auto* result = CordRepBtree::Prepend(leaf, flats.front());
+ EXPECT_THAT(result->height(), Eq(0));
+ EXPECT_THAT(result, Conditional(shared(), Ne(leaf), Eq(leaf)));
+ EXPECT_THAT(result->Edges(), ElementsAreArray(flats));
+ leaf = result;
+ }
+ CordRep::Unref(leaf);
+}
+
+// This test specifically aims at code aligning data at either the front or the
+// back of the contained `edges[]` array, alternating Append and Prepend will
+// move `begin()` and `end()` values as needed for each added value.
+TEST_P(CordRepBtreeTest, AppendPrependToLeafToCapacity) {
+ AutoUnref refs;
+ std::deque<CordRep*> flats;
+ flats.push_front(MakeHexFlat(0));
+ auto* leaf = CordRepBtree::Create(flats.front());
+
+ for (size_t i = 1; i < CordRepBtree::kMaxCapacity; ++i) {
+ refs.RefIf(shared(), leaf);
+ CordRepBtree* result;
+ if (i % 2 != 0) {
+ flats.push_front(MakeHexFlat(i));
+ result = CordRepBtree::Prepend(leaf, flats.front());
+ } else {
+ flats.push_back(MakeHexFlat(i));
+ result = CordRepBtree::Append(leaf, flats.back());
+ }
+ EXPECT_THAT(result->height(), Eq(0));
+ EXPECT_THAT(result, Conditional(shared(), Ne(leaf), Eq(leaf)));
+ EXPECT_THAT(result->Edges(), ElementsAreArray(flats));
+ leaf = result;
+ }
+ CordRep::Unref(leaf);
+}
+
+TEST_P(CordRepBtreeTest, AppendToLeafBeyondCapacity) {
+ AutoUnref refs;
+ auto* leaf = MakeLeaf();
+ refs.RefIf(shared(), leaf);
+ CordRep* flat = MakeFlat("abc");
+ auto* result = CordRepBtree::Append(leaf, flat);
+ ASSERT_THAT(result, IsNode(1));
+ EXPECT_THAT(result, Ne(leaf));
+ absl::Span<CordRep* const> edges = result->Edges();
+ ASSERT_THAT(edges, ElementsAre(leaf, IsNode(0)));
+ EXPECT_THAT(edges[1]->btree()->Edges(), ElementsAre(flat));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeTest, PrependToLeafBeyondCapacity) {
+ AutoUnref refs;
+ auto* leaf = MakeLeaf();
+ refs.RefIf(shared(), leaf);
+ CordRep* flat = MakeFlat("abc");
+ auto* result = CordRepBtree::Prepend(leaf, flat);
+ ASSERT_THAT(result, IsNode(1));
+ EXPECT_THAT(result, Ne(leaf));
+ absl::Span<CordRep* const> edges = result->Edges();
+ ASSERT_THAT(edges, ElementsAre(IsNode(0), leaf));
+ EXPECT_THAT(edges[0]->btree()->Edges(), ElementsAre(flat));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeTest, AppendToTreeOneDeep) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+ flats.push_back(MakeHexFlat(0));
+ CordRepBtree* tree = CordRepBtree::Create(flats.back());
+ for (size_t i = 1; i <= max_cap; ++i) {
+ flats.push_back(MakeHexFlat(i));
+ tree = CordRepBtree::Append(tree, flats.back());
+ }
+ ASSERT_THAT(tree, IsNode(1));
+
+ for (size_t i = max_cap + 1; i < max_cap * max_cap; ++i) {
+ // Ref top level tree based on param.
+ // Ref leaf node once every 4 iterations, which should not have an
+ // observable effect other than that the leaf itself is copied.
+ refs.RefIf(shared(), tree);
+ refs.RefIf(i % 4 == 0, tree->Edges().back());
+
+ flats.push_back(MakeHexFlat(i));
+ CordRepBtree* result = CordRepBtree::Append(tree, flats.back());
+ ASSERT_THAT(result, IsNode(1));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ std::vector<CordRep*> edges = GetLeafEdges(result);
+ ASSERT_THAT(edges, ElementsAreArray(flats));
+ tree = result;
+ }
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, AppendToTreeTwoDeep) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+ flats.push_back(MakeHexFlat(0));
+ CordRepBtree* tree = CordRepBtree::Create(flats.back());
+ for (size_t i = 1; i <= max_cap * max_cap; ++i) {
+ flats.push_back(MakeHexFlat(i));
+ tree = CordRepBtree::Append(tree, flats.back());
+ }
+ ASSERT_THAT(tree, IsNode(2));
+ for (size_t i = max_cap * max_cap + 1; i < max_cap * max_cap * max_cap; ++i) {
+ // Ref top level tree based on param.
+ // Ref child node once every 16 iterations, and leaf node every 4
+ // iterrations which which should not have an observable effect other than
+ // the node and/or the leaf below it being copied.
+ refs.RefIf(shared(), tree);
+ refs.RefIf(i % 16 == 0, tree->Edges().back());
+ refs.RefIf(i % 4 == 0, tree->Edges().back()->btree()->Edges().back());
+
+ flats.push_back(MakeHexFlat(i));
+ CordRepBtree* result = CordRepBtree::Append(tree, flats.back());
+ ASSERT_THAT(result, IsNode(2));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ std::vector<CordRep*> edges = GetLeafEdges(result);
+ ASSERT_THAT(edges, ElementsAreArray(flats));
+ tree = result;
+ }
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, PrependToTreeOneDeep) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ AutoUnref refs;
+ std::deque<CordRep*> flats;
+ flats.push_back(MakeHexFlat(0));
+ CordRepBtree* tree = CordRepBtree::Create(flats.back());
+ for (size_t i = 1; i <= max_cap; ++i) {
+ flats.push_front(MakeHexFlat(i));
+ tree = CordRepBtree::Prepend(tree, flats.front());
+ }
+ ASSERT_THAT(tree, IsNode(1));
+
+ for (size_t i = max_cap + 1; i < max_cap * max_cap; ++i) {
+ // Ref top level tree based on param.
+ // Ref leaf node once every 4 iterations which should not have an observable
+ // effect other than than the leaf itself is copied.
+ refs.RefIf(shared(), tree);
+ refs.RefIf(i % 4 == 0, tree->Edges().back());
+
+ flats.push_front(MakeHexFlat(i));
+ CordRepBtree* result = CordRepBtree::Prepend(tree, flats.front());
+ ASSERT_THAT(result, IsNode(1));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ std::vector<CordRep*> edges = GetLeafEdges(result);
+ ASSERT_THAT(edges, ElementsAreArray(flats));
+ tree = result;
+ }
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, PrependToTreeTwoDeep) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ AutoUnref refs;
+ std::deque<CordRep*> flats;
+ flats.push_back(MakeHexFlat(0));
+ CordRepBtree* tree = CordRepBtree::Create(flats.back());
+ for (size_t i = 1; i <= max_cap * max_cap; ++i) {
+ flats.push_front(MakeHexFlat(i));
+ tree = CordRepBtree::Prepend(tree, flats.front());
+ }
+ ASSERT_THAT(tree, IsNode(2));
+ for (size_t i = max_cap * max_cap + 1; i < max_cap * max_cap * max_cap; ++i) {
+ // Ref top level tree based on param.
+ // Ref child node once every 16 iterations, and leaf node every 4
+ // iterrations which which should not have an observable effect other than
+ // the node and/or the leaf below it being copied.
+ refs.RefIf(shared(), tree);
+ refs.RefIf(i % 16 == 0, tree->Edges().back());
+ refs.RefIf(i % 4 == 0, tree->Edges().back()->btree()->Edges().back());
+
+ flats.push_front(MakeHexFlat(i));
+ CordRepBtree* result = CordRepBtree::Prepend(tree, flats.front());
+ ASSERT_THAT(result, IsNode(2));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ std::vector<CordRep*> edges = GetLeafEdges(result);
+ ASSERT_THAT(edges, ElementsAreArray(flats));
+ tree = result;
+ }
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeDualTest, MergeLeafsNotExceedingCapacity) {
+ for (bool use_append : {false, true}) {
+ SCOPED_TRACE(use_append ? "Using Append" : "Using Prepend");
+
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+
+ // Build `left` side leaf appending all contained flats to `flats`
+ CordRepBtree* left = MakeLeaf(3);
+ GetLeafEdges(left, flats);
+ refs.RefIf(first_shared(), left);
+
+ // Build `right` side leaf appending all contained flats to `flats`
+ CordRepBtree* right = MakeLeaf(2);
+ GetLeafEdges(right, flats);
+ refs.RefIf(second_shared(), right);
+
+ CordRepBtree* tree = use_append ? CordRepBtree::Append(left, right)
+ : CordRepBtree::Prepend(right, left);
+ EXPECT_THAT(tree, IsNode(0));
+
+ // `tree` contains all flats originally belonging to `left` and `right`.
+ EXPECT_THAT(tree->Edges(), ElementsAreArray(flats));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeDualTest, MergeLeafsExceedingCapacity) {
+ for (bool use_append : {false, true}) {
+ SCOPED_TRACE(use_append ? "Using Append" : "Using Prepend");
+
+ AutoUnref refs;
+
+ // Build `left` side tree appending all contained flats to `flats`
+ CordRepBtree* left = MakeLeaf(CordRepBtree::kMaxCapacity - 2);
+ refs.RefIf(first_shared(), left);
+
+ // Build `right` side tree appending all contained flats to `flats`
+ CordRepBtree* right = MakeLeaf(CordRepBtree::kMaxCapacity - 1);
+ refs.RefIf(second_shared(), right);
+
+ CordRepBtree* tree = use_append ? CordRepBtree::Append(left, right)
+ : CordRepBtree::Prepend(right, left);
+ EXPECT_THAT(tree, IsNode(1));
+ EXPECT_THAT(tree->Edges(), ElementsAre(left, right));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeDualTest, MergeEqualHeightTrees) {
+ for (bool use_append : {false, true}) {
+ SCOPED_TRACE(use_append ? "Using Append" : "Using Prepend");
+
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+
+ // Build `left` side tree appending all contained flats to `flats`
+ CordRepBtree* left = MakeTree(CordRepBtree::kMaxCapacity * 3);
+ GetLeafEdges(left, flats);
+ refs.RefIf(first_shared(), left);
+
+ // Build `right` side tree appending all contained flats to `flats`
+ CordRepBtree* right = MakeTree(CordRepBtree::kMaxCapacity * 2);
+ GetLeafEdges(right, flats);
+ refs.RefIf(second_shared(), right);
+
+ CordRepBtree* tree = use_append ? CordRepBtree::Append(left, right)
+ : CordRepBtree::Prepend(right, left);
+ EXPECT_THAT(tree, IsNode(1));
+ EXPECT_THAT(tree->Edges(), SizeIs(5));
+
+ // `tree` contains all flats originally belonging to `left` and `right`.
+ EXPECT_THAT(GetLeafEdges(tree), ElementsAreArray(flats));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeDualTest, MergeLeafWithTreeNotExceedingLeafCapacity) {
+ for (bool use_append : {false, true}) {
+ SCOPED_TRACE(use_append ? "Using Append" : "Using Prepend");
+
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+
+ // Build `left` side tree appending all added flats to `flats`
+ CordRepBtree* left = MakeTree(CordRepBtree::kMaxCapacity * 2 + 2);
+ GetLeafEdges(left, flats);
+ refs.RefIf(first_shared(), left);
+
+ // Build `right` side tree appending all added flats to `flats`
+ CordRepBtree* right = MakeTree(3);
+ GetLeafEdges(right, flats);
+ refs.RefIf(second_shared(), right);
+
+ CordRepBtree* tree = use_append ? CordRepBtree::Append(left, right)
+ : CordRepBtree::Prepend(right, left);
+ EXPECT_THAT(tree, IsNode(1));
+ EXPECT_THAT(tree->Edges(), SizeIs(3));
+
+ // `tree` contains all flats originally belonging to `left` and `right`.
+ EXPECT_THAT(GetLeafEdges(tree), ElementsAreArray(flats));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeDualTest, MergeLeafWithTreeExceedingLeafCapacity) {
+ for (bool use_append : {false, true}) {
+ SCOPED_TRACE(use_append ? "Using Append" : "Using Prepend");
+
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+
+ // Build `left` side tree appending all added flats to `flats`
+ CordRepBtree* left = MakeTree(CordRepBtree::kMaxCapacity * 3 - 2);
+ GetLeafEdges(left, flats);
+ refs.RefIf(first_shared(), left);
+
+ // Build `right` side tree appending all added flats to `flats`
+ CordRepBtree* right = MakeTree(3);
+ GetLeafEdges(right, flats);
+ refs.RefIf(second_shared(), right);
+
+ CordRepBtree* tree = use_append ? CordRepBtree::Append(left, right)
+ : CordRepBtree::Prepend(right, left);
+ EXPECT_THAT(tree, IsNode(1));
+ EXPECT_THAT(tree->Edges(), SizeIs(4));
+
+ // `tree` contains all flats originally belonging to `left` and `right`.
+ EXPECT_THAT(GetLeafEdges(tree), ElementsAreArray(flats));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+void RefEdgesAt(size_t depth, AutoUnref& refs, CordRepBtree* tree) {
+ absl::Span<CordRep* const> edges = tree->Edges();
+ if (depth == 0) {
+ refs.Ref(edges.front());
+ refs.Ref(edges.back());
+ } else {
+ assert(tree->height() > 0);
+ RefEdgesAt(depth - 1, refs, edges.front()->btree());
+ RefEdgesAt(depth - 1, refs, edges.back()->btree());
+ }
+}
+
+TEST(CordRepBtreeTest, MergeFuzzTest) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ std::minstd_rand rnd;
+ std::uniform_int_distribution<int> coin_flip(0, 1);
+ std::uniform_int_distribution<int> dice_throw(1, 6);
+
+ auto random_leaf_count = [&]() {
+ std::uniform_int_distribution<int> dist_height(0, 3);
+ std::uniform_int_distribution<int> dist_leaf(0, max_cap - 1);
+ const size_t height = dist_height(rnd);
+ return (height ? pow(max_cap, height) : 0) + dist_leaf(rnd);
+ };
+
+ for (int i = 0; i < 10000; ++i) {
+ AutoUnref refs;
+ std::vector<CordRep*> flats;
+
+ CordRepBtree* left = MakeTree(random_leaf_count(), coin_flip(rnd));
+ GetLeafEdges(left, flats);
+ if (dice_throw(rnd) == 1) {
+ std::uniform_int_distribution<int> dist(0, left->height());
+ RefEdgesAt(dist(rnd), refs, left);
+ }
+
+ CordRepBtree* right = MakeTree(random_leaf_count(), coin_flip(rnd));
+ GetLeafEdges(right, flats);
+ if (dice_throw(rnd) == 1) {
+ std::uniform_int_distribution<int> dist(0, right->height());
+ RefEdgesAt(dist(rnd), refs, right);
+ }
+
+ CordRepBtree* tree = CordRepBtree::Append(left, right);
+ EXPECT_THAT(GetLeafEdges(tree), ElementsAreArray(flats));
+ CordRepBtree::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeTest, RemoveSuffix) {
+ // Create tree of 1, 2 and 3 levels high
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ for (size_t cap : {max_cap - 1, max_cap * 2, max_cap * max_cap * 2}) {
+ const std::string data = CreateRandomString(cap * 512);
+
+ {
+ // Verify RemoveSuffix(<all>)
+ AutoUnref refs;
+ CordRepBtree* node = refs.RefIf(shared(), CreateTree(data, 512));
+ EXPECT_THAT(CordRepBtree::RemoveSuffix(node, data.length()), Eq(nullptr));
+
+ // Verify RemoveSuffix(<none>)
+ node = refs.RefIf(shared(), CreateTree(data, 512));
+ EXPECT_THAT(CordRepBtree::RemoveSuffix(node, 0), Eq(node));
+ CordRep::Unref(node);
+ }
+
+ for (int n = 1; n < data.length(); ++n) {
+ AutoUnref refs;
+ auto flats = CreateFlatsFromString(data, 512);
+ CordRepBtree* node = refs.RefIf(shared(), CreateTree(flats));
+ CordRep* rep = refs.Add(CordRepBtree::RemoveSuffix(node, n));
+ EXPECT_THAT(CordToString(rep), Eq(data.substr(0, data.length() - n)));
+
+ // Collect all flats
+ auto is_flat = [](CordRep* rep) { return rep->tag >= FLAT; };
+ std::vector<CordRep*> edges = CordCollectRepsIf(is_flat, rep);
+ ASSERT_THAT(edges.size(), Le(flats.size()));
+
+ // Isolate last edge
+ CordRep* last_edge = edges.back();
+ edges.pop_back();
+ const size_t last_length = rep->length - edges.size() * 512;
+
+ // All flats except the last edge must be kept or copied 'as is'
+ int index = 0;
+ for (CordRep* edge : edges) {
+ ASSERT_THAT(edge, Eq(flats[index++]));
+ ASSERT_THAT(edge->length, Eq(512));
+ }
+
+ // CordRepBtree may optimize small substrings to avoid waste, so only
+ // check for flat sharing / updates where the code should always do this.
+ if (last_length >= 500) {
+ EXPECT_THAT(last_edge, Eq(flats[index++]));
+ if (shared()) {
+ EXPECT_THAT(last_edge->length, Eq(512));
+ } else {
+ EXPECT_TRUE(last_edge->refcount.IsOne());
+ EXPECT_THAT(last_edge->length, Eq(last_length));
+ }
+ }
+ }
+ }
+}
+
+TEST(CordRepBtreeTest, SubTree) {
+ // Create tree of at least 2 levels high
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ const size_t n = max_cap * max_cap * 2;
+ const std::string data = CreateRandomString(n * 3);
+ std::vector<CordRep*> flats;
+ for (absl::string_view s = data; !s.empty(); s.remove_prefix(3)) {
+ flats.push_back(MakeFlat(s.substr(0, 3)));
+ }
+ CordRepBtree* node = CordRepBtree::Create(CordRep::Ref(flats[0]));
+ for (size_t i = 1; i < flats.size(); ++i) {
+ node = CordRepBtree::Append(node, CordRep::Ref(flats[i]));
+ }
+
+ for (int offset = 0; offset < data.length(); ++offset) {
+ for (int length = 1; length <= data.length() - offset; ++length) {
+ CordRep* rep = node->SubTree(offset, length);
+ EXPECT_THAT(CordToString(rep), Eq(data.substr(offset, length)));
+ CordRep::Unref(rep);
+ }
+ }
+ CordRepBtree::Unref(node);
+ for (CordRep* rep : flats) {
+ CordRep::Unref(rep);
+ }
+}
+
+TEST(CordRepBtreeTest, SubTreeOnExistingSubstring) {
+ // This test verifies that a SubTree call on a pre-existing (large) substring
+ // adjusts the existing substring if not shared, and else rewrites the
+ // existing substring.
+ AutoUnref refs;
+ std::string data = CreateRandomString(1000);
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat("abc"));
+ CordRep* flat = MakeFlat(data);
+ leaf = CordRepBtree::Append(leaf, flat);
+
+ // Setup tree containing substring.
+ CordRep* result = leaf->SubTree(0, 3 + 990);
+ ASSERT_THAT(result->tag, Eq(BTREE));
+ CordRep::Unref(leaf);
+ leaf = result->btree();
+ ASSERT_THAT(leaf->Edges(), ElementsAre(_, IsSubstring(0, 990)));
+ EXPECT_THAT(leaf->Edges()[1]->substring()->child, Eq(flat));
+
+ // Verify substring of substring.
+ result = leaf->SubTree(3 + 5, 970);
+ ASSERT_THAT(result, IsSubstring(5, 970));
+ EXPECT_THAT(result->substring()->child, Eq(flat));
+ CordRep::Unref(result);
+
+ CordRep::Unref(leaf);
+}
+
+TEST_P(CordRepBtreeTest, AddDataToLeaf) {
+ const size_t n = CordRepBtree::kMaxCapacity;
+ const std::string data = CreateRandomString(n * 3);
+
+ for (bool append : {true, false}) {
+ AutoUnref refs;
+ DataConsumer consumer(data, append);
+ SCOPED_TRACE(append ? "Append" : "Prepend");
+
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat(consumer.Next(3)));
+ for (size_t i = 1; i < n; ++i) {
+ refs.RefIf(shared(), leaf);
+ CordRepBtree* result = BtreeAdd(leaf, append, consumer.Next(3));
+ EXPECT_THAT(result, Conditional(shared(), Ne(leaf), Eq(leaf)));
+ EXPECT_THAT(CordToString(result), Eq(consumer.Consumed()));
+ leaf = result;
+ }
+ CordRep::Unref(leaf);
+ }
+}
+
+TEST_P(CordRepBtreeTest, AppendDataToTree) {
+ AutoUnref refs;
+ size_t n = CordRepBtree::kMaxCapacity + CordRepBtree::kMaxCapacity / 2;
+ std::string data = CreateRandomString(n * 3);
+ CordRepBtree* tree = refs.RefIf(shared(), CreateTree(data, 3));
+ CordRepBtree* leaf0 = tree->Edges()[0]->btree();
+ CordRepBtree* leaf1 = tree->Edges()[1]->btree();
+ CordRepBtree* result = CordRepBtree::Append(tree, "123456789");
+ EXPECT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ EXPECT_THAT(result->Edges(),
+ ElementsAre(leaf0, Conditional(shared(), Ne(leaf1), Eq(leaf1))));
+ EXPECT_THAT(CordToString(result), Eq(data + "123456789"));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeTest, PrependDataToTree) {
+ AutoUnref refs;
+ size_t n = CordRepBtree::kMaxCapacity + CordRepBtree::kMaxCapacity / 2;
+ std::string data = CreateRandomString(n * 3);
+ CordRepBtree* tree = refs.RefIf(shared(), CreateTreeReverse(data, 3));
+ CordRepBtree* leaf0 = tree->Edges()[0]->btree();
+ CordRepBtree* leaf1 = tree->Edges()[1]->btree();
+ CordRepBtree* result = CordRepBtree::Prepend(tree, "123456789");
+ EXPECT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ EXPECT_THAT(result->Edges(),
+ ElementsAre(Conditional(shared(), Ne(leaf0), Eq(leaf0)), leaf1));
+ EXPECT_THAT(CordToString(result), Eq("123456789" + data));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeTest, AddDataToTreeThreeLevelsDeep) {
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ const size_t n = max_cap * max_cap * max_cap;
+ const std::string data = CreateRandomString(n * 3);
+
+ for (bool append : {true, false}) {
+ AutoUnref refs;
+ DataConsumer consumer(data, append);
+ SCOPED_TRACE(append ? "Append" : "Prepend");
+
+ // Fill leaf
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat(consumer.Next(3)));
+ for (size_t i = 1; i < max_cap; ++i) {
+ tree = BtreeAdd(tree, append, consumer.Next(3));
+ }
+ ASSERT_THAT(CordToString(tree), Eq(consumer.Consumed()));
+
+ // Fill to maximum at one deep
+ refs.RefIf(shared(), tree);
+ CordRepBtree* result = BtreeAdd(tree, append, consumer.Next(3));
+ ASSERT_THAT(result, IsNode(1));
+ ASSERT_THAT(result, Ne(tree));
+ ASSERT_THAT(CordToString(result), Eq(consumer.Consumed()));
+ tree = result;
+ for (size_t i = max_cap + 1; i < max_cap * max_cap; ++i) {
+ refs.RefIf(shared(), tree);
+ result = BtreeAdd(tree, append, consumer.Next(3));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ ASSERT_THAT(CordToString(result), Eq(consumer.Consumed()));
+ tree = result;
+ }
+
+ // Fill to maximum at two deep
+ refs.RefIf(shared(), tree);
+ result = BtreeAdd(tree, append, consumer.Next(3));
+ ASSERT_THAT(result, IsNode(2));
+ ASSERT_THAT(result, Ne(tree));
+ ASSERT_THAT(CordToString(result), Eq(consumer.Consumed()));
+ tree = result;
+ for (size_t i = max_cap * max_cap + 1; i < max_cap * max_cap * max_cap;
+ ++i) {
+ refs.RefIf(shared(), tree);
+ result = BtreeAdd(tree, append, consumer.Next(3));
+ ASSERT_THAT(result, Conditional(shared(), Ne(tree), Eq(tree)));
+ ASSERT_THAT(CordToString(result), Eq(consumer.Consumed()));
+ tree = result;
+ }
+
+ CordRep::Unref(tree);
+ }
+}
+
+TEST_P(CordRepBtreeTest, AddLargeDataToLeaf) {
+ const size_t max_cap = CordRepBtree::kMaxCapacity;
+ const size_t n = max_cap * max_cap * max_cap * 3 + 2;
+ const std::string data = CreateRandomString(n * kMaxFlatLength);
+
+ for (bool append : {true, false}) {
+ AutoUnref refs;
+ SCOPED_TRACE(append ? "Append" : "Prepend");
+
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat("abc"));
+ refs.RefIf(shared(), leaf);
+ CordRepBtree* result = BtreeAdd(leaf, append, data);
+ EXPECT_THAT(CordToString(result), Eq(append ? "abc" + data : data + "abc"));
+ CordRep::Unref(result);
+ }
+}
+
+TEST_P(CordRepBtreeDualTest, CreateFromConcat) {
+ AutoUnref refs;
+ CordRep* flats[] = {MakeFlat("abcdefgh"), MakeFlat("ijklm"),
+ MakeFlat("nopqrstuv"), MakeFlat("wxyz")};
+ auto* left = MakeConcat(flats[0], flats[1]);
+ auto* right = MakeConcat(flats[2], refs.RefIf(first_shared(), flats[3]));
+ auto* concat = refs.RefIf(second_shared(), MakeConcat(left, right));
+ CordRepBtree* result = CordRepBtree::Create(concat);
+ ASSERT_TRUE(CordRepBtree::IsValid(result));
+ EXPECT_THAT(result->length, Eq(26));
+ EXPECT_THAT(CordToString(result), Eq("abcdefghijklmnopqrstuvwxyz"));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeDualTest, AppendConcat) {
+ AutoUnref refs;
+ CordRep* flats[] = {MakeFlat("defgh"), MakeFlat("ijklm"),
+ MakeFlat("nopqrstuv"), MakeFlat("wxyz")};
+ auto* left = MakeConcat(flats[0], flats[1]);
+ auto* right = MakeConcat(flats[2], refs.RefIf(first_shared(), flats[3]));
+ auto* concat = refs.RefIf(second_shared(), MakeConcat(left, right));
+ CordRepBtree* result = CordRepBtree::Create(MakeFlat("abc"));
+ result = CordRepBtree::Append(result, concat);
+ ASSERT_TRUE(CordRepBtree::IsValid(result));
+ EXPECT_THAT(result->length, Eq(26));
+ EXPECT_THAT(CordToString(result), Eq("abcdefghijklmnopqrstuvwxyz"));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeDualTest, PrependConcat) {
+ AutoUnref refs;
+ CordRep* flats[] = {MakeFlat("abcdefgh"), MakeFlat("ijklm"),
+ MakeFlat("nopqrstuv"), MakeFlat("wx")};
+ auto* left = MakeConcat(flats[0], flats[1]);
+ auto* right = MakeConcat(flats[2], refs.RefIf(first_shared(), flats[3]));
+ auto* concat = refs.RefIf(second_shared(), MakeConcat(left, right));
+ CordRepBtree* result = CordRepBtree::Create(MakeFlat("yz"));
+ result = CordRepBtree::Prepend(result, concat);
+ ASSERT_TRUE(CordRepBtree::IsValid(result));
+ EXPECT_THAT(result->length, Eq(26));
+ EXPECT_THAT(CordToString(result), Eq("abcdefghijklmnopqrstuvwxyz"));
+ CordRep::Unref(result);
+}
+
+TEST_P(CordRepBtreeTest, CreateFromTreeReturnsTree) {
+ AutoUnref refs;
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat("Hello world"));
+ refs.RefIf(shared(), leaf);
+ CordRepBtree* result = CordRepBtree::Create(leaf);
+ EXPECT_THAT(result, Eq(leaf));
+ CordRep::Unref(result);
+}
+
+TEST(CordRepBtreeTest, GetCharacter) {
+ size_t n = CordRepBtree::kMaxCapacity * CordRepBtree::kMaxCapacity + 2;
+ std::string data = CreateRandomString(n * 3);
+ CordRepBtree* tree = CreateTree(data, 3);
+ // Add a substring node for good measure.
+ tree = tree->Append(tree, MakeSubstring(4, 5, MakeFlat("abcdefghijklm")));
+ data += "efghi";
+ for (size_t i = 0; i < data.length(); ++i) {
+ ASSERT_THAT(tree->GetCharacter(i), Eq(data[i]));
+ }
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, IsFlatSingleFlat) {
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat("Hello world"));
+
+ absl::string_view fragment;
+ EXPECT_TRUE(leaf->IsFlat(nullptr));
+ EXPECT_TRUE(leaf->IsFlat(&fragment));
+ EXPECT_THAT(fragment, Eq("Hello world"));
+ fragment = "";
+ EXPECT_TRUE(leaf->IsFlat(0, 11, nullptr));
+ EXPECT_TRUE(leaf->IsFlat(0, 11, &fragment));
+ EXPECT_THAT(fragment, Eq("Hello world"));
+
+ // Arbitrary ranges must check true as well.
+ EXPECT_TRUE(leaf->IsFlat(1, 4, &fragment));
+ EXPECT_THAT(fragment, Eq("ello"));
+ EXPECT_TRUE(leaf->IsFlat(6, 5, &fragment));
+ EXPECT_THAT(fragment, Eq("world"));
+
+ CordRep::Unref(leaf);
+}
+
+TEST(CordRepBtreeTest, IsFlatMultiFlat) {
+ size_t n = CordRepBtree::kMaxCapacity * CordRepBtree::kMaxCapacity + 2;
+ std::string data = CreateRandomString(n * 3);
+ CordRepBtree* tree = CreateTree(data, 3);
+ // Add substring nodes for good measure.
+ tree = tree->Append(tree, MakeSubstring(4, 3, MakeFlat("abcdefghijklm")));
+ tree = tree->Append(tree, MakeSubstring(8, 3, MakeFlat("abcdefghijklm")));
+ data += "efgijk";
+
+ EXPECT_FALSE(tree->IsFlat(nullptr));
+ absl::string_view fragment = "Can't touch this";
+ EXPECT_FALSE(tree->IsFlat(&fragment));
+ EXPECT_THAT(fragment, Eq("Can't touch this"));
+
+ for (size_t offset = 0; offset < data.size(); offset += 3) {
+ EXPECT_TRUE(tree->IsFlat(offset, 3, nullptr));
+ EXPECT_TRUE(tree->IsFlat(offset, 3, &fragment));
+ EXPECT_THAT(fragment, Eq(data.substr(offset, 3)));
+
+ fragment = "Can't touch this";
+ if (offset > 0) {
+ EXPECT_FALSE(tree->IsFlat(offset - 1, 4, nullptr));
+ EXPECT_FALSE(tree->IsFlat(offset - 1, 4, &fragment));
+ EXPECT_THAT(fragment, Eq("Can't touch this"));
+ }
+ if (offset < data.size() - 4) {
+ EXPECT_FALSE(tree->IsFlat(offset, 4, nullptr));
+ EXPECT_FALSE(tree->IsFlat(offset, 4, &fragment));
+ EXPECT_THAT(fragment, Eq("Can't touch this"));
+ }
+ }
+
+ CordRep::Unref(tree);
+}
+
+#if defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferNotPrivate) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeExternal("Foo"));
+ CordRepBtree::Ref(tree);
+ EXPECT_DEATH(tree->GetAppendBuffer(1), ".*");
+ CordRepBtree::Unref(tree);
+ CordRepBtree::Unref(tree);
+}
+
+#endif // defined(GTEST_HAS_DEATH_TEST) && !defined(NDEBUG)
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferNotFlat) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeExternal("Foo"));
+ for (int i = 1; i <= height(); ++i) {
+ tree = CordRepBtree::New(tree);
+ }
+ EXPECT_THAT(tree->GetAppendBuffer(1), SizeIs(0));
+ CordRepBtree::Unref(tree);
+}
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferFlatNotPrivate) {
+ CordRepFlat* flat = MakeFlat("abc");
+ CordRepBtree* tree = CordRepBtree::Create(CordRep::Ref(flat));
+ for (int i = 1; i <= height(); ++i) {
+ tree = CordRepBtree::New(tree);
+ }
+ EXPECT_THAT(tree->GetAppendBuffer(1), SizeIs(0));
+ CordRepBtree::Unref(tree);
+ CordRep::Unref(flat);
+}
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferTreeNotPrivate) {
+ if (height() == 0) return;
+ AutoUnref refs;
+ CordRepFlat* flat = MakeFlat("abc");
+ CordRepBtree* tree = CordRepBtree::Create(CordRep::Ref(flat));
+ for (int i = 1; i <= height(); ++i) {
+ if (i == (height() + 1) / 2) refs.Ref(tree);
+ tree = CordRepBtree::New(tree);
+ }
+ EXPECT_THAT(tree->GetAppendBuffer(1), SizeIs(0));
+ CordRepBtree::Unref(tree);
+ CordRep::Unref(flat);
+}
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferFlatNoCapacity) {
+ CordRepFlat* flat = MakeFlat("abc");
+ flat->length = flat->Capacity();
+ CordRepBtree* tree = CordRepBtree::Create(flat);
+ for (int i = 1; i <= height(); ++i) {
+ tree = CordRepBtree::New(tree);
+ }
+ EXPECT_THAT(tree->GetAppendBuffer(1), SizeIs(0));
+ CordRepBtree::Unref(tree);
+}
+
+TEST_P(CordRepBtreeHeightTest, GetAppendBufferFlatWithCapacity) {
+ CordRepFlat* flat = MakeFlat("abc");
+ CordRepBtree* tree = CordRepBtree::Create(flat);
+ for (int i = 1; i <= height(); ++i) {
+ tree = CordRepBtree::New(tree);
+ }
+ absl::Span<char> span = tree->GetAppendBuffer(2);
+ EXPECT_THAT(span, SizeIs(2));
+ EXPECT_THAT(span.data(), TypedEq<void*>(flat->Data() + 3));
+ EXPECT_THAT(tree->length, Eq(5));
+
+ size_t avail = flat->Capacity() - 5;
+ span = tree->GetAppendBuffer(avail + 100);
+ EXPECT_THAT(span, SizeIs(avail));
+ EXPECT_THAT(span.data(), TypedEq<void*>(flat->Data() + 5));
+ EXPECT_THAT(tree->length, Eq(5 + avail));
+
+ CordRepBtree::Unref(tree);
+}
+
+TEST(CordRepBtreeTest, Dump) {
+ // Handles nullptr
+ std::stringstream ss;
+ CordRepBtree::Dump(nullptr, ss);
+ CordRepBtree::Dump(nullptr, "Once upon a label", ss);
+ CordRepBtree::Dump(nullptr, "Once upon a label", false, ss);
+ CordRepBtree::Dump(nullptr, "Once upon a label", true, ss);
+
+ // Cover legal edges
+ CordRepFlat* flat = MakeFlat("Hello world");
+ CordRepExternal* external = MakeExternal("Hello external");
+ CordRep* substr_flat = MakeSubstring(1, 6, CordRep::Ref(flat));
+ CordRep* substr_external = MakeSubstring(2, 7, CordRep::Ref(external));
+
+ // Build tree
+ CordRepBtree* tree = CordRepBtree::Create(flat);
+ tree = CordRepBtree::Append(tree, external);
+ tree = CordRepBtree::Append(tree, substr_flat);
+ tree = CordRepBtree::Append(tree, substr_external);
+
+ // Repeat until we have a tree
+ while (tree->height() == 0) {
+ tree = CordRepBtree::Append(tree, CordRep::Ref(flat));
+ tree = CordRepBtree::Append(tree, CordRep::Ref(external));
+ tree = CordRepBtree::Append(tree, CordRep::Ref(substr_flat));
+ tree = CordRepBtree::Append(tree, CordRep::Ref(substr_external));
+ }
+
+ for (int api = 0; api <= 3; ++api) {
+ absl::string_view api_scope;
+ std::stringstream ss;
+ switch (api) {
+ case 0:
+ api_scope = "Bare";
+ CordRepBtree::Dump(tree, ss);
+ break;
+ case 1:
+ api_scope = "Label only";
+ CordRepBtree::Dump(tree, "Once upon a label", ss);
+ break;
+ case 2:
+ api_scope = "Label no content";
+ CordRepBtree::Dump(tree, "Once upon a label", false, ss);
+ break;
+ default:
+ api_scope = "Label and content";
+ CordRepBtree::Dump(tree, "Once upon a label", true, ss);
+ break;
+ }
+ SCOPED_TRACE(api_scope);
+ std::string str = ss.str();
+
+ // Contains Node(depth) / Leaf and private / shared indicators
+ EXPECT_THAT(str, AllOf(HasSubstr("Node(1)"), HasSubstr("Leaf"),
+ HasSubstr("Private"), HasSubstr("Shared")));
+
+ // Contains length and start offset of all data edges
+ EXPECT_THAT(str, AllOf(HasSubstr("len = 11"), HasSubstr("len = 14"),
+ HasSubstr("len = 6"), HasSubstr("len = 7"),
+ HasSubstr("start = 1"), HasSubstr("start = 2")));
+
+ // Contains address of all data edges
+ EXPECT_THAT(
+ str, AllOf(HasSubstr(absl::StrCat("0x", absl::Hex(flat))),
+ HasSubstr(absl::StrCat("0x", absl::Hex(external))),
+ HasSubstr(absl::StrCat("0x", absl::Hex(substr_flat))),
+ HasSubstr(absl::StrCat("0x", absl::Hex(substr_external)))));
+
+ if (api != 0) {
+ // Contains label
+ EXPECT_THAT(str, HasSubstr("Once upon a label"));
+ }
+
+ if (api != 3) {
+ // Does not contain contents
+ EXPECT_THAT(str, Not(AnyOf((HasSubstr("data = \"Hello world\""),
+ HasSubstr("data = \"Hello external\""),
+ HasSubstr("data = \"ello w\""),
+ HasSubstr("data = \"llo ext\"")))));
+ } else {
+ // Contains contents
+ EXPECT_THAT(str, AllOf((HasSubstr("data = \"Hello world\""),
+ HasSubstr("data = \"Hello external\""),
+ HasSubstr("data = \"ello w\""),
+ HasSubstr("data = \"llo ext\""))));
+ }
+ }
+
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepBtreeTest, IsValid) {
+ EXPECT_FALSE(CordRepBtree::IsValid(nullptr));
+
+ CordRepBtree* empty = CordRepBtree::New(0);
+ EXPECT_TRUE(CordRepBtree::IsValid(empty));
+ CordRep::Unref(empty);
+
+ for (bool as_tree : {false, true}) {
+ CordRepBtree* leaf = CordRepBtree::Create(MakeFlat("abc"));
+ CordRepBtree* tree = as_tree ? CordRepBtree::New(leaf) : nullptr;
+ CordRepBtree* check = as_tree ? tree : leaf;
+
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ leaf->length--;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->length++;
+
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ leaf->tag--;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->tag++;
+
+ // Height
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ leaf->storage[0] = static_cast<uint8_t>(CordRepBtree::kMaxHeight + 1);
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->storage[0] = 1;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->storage[0] = 0;
+
+ // Begin
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ const uint8_t begin = leaf->storage[1];
+ leaf->storage[1] = static_cast<uint8_t>(CordRepBtree::kMaxCapacity);
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->storage[1] = 2;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->storage[1] = begin;
+
+ // End
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ const uint8_t end = leaf->storage[2];
+ leaf->storage[2] = static_cast<uint8_t>(CordRepBtree::kMaxCapacity + 1);
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->storage[2] = end;
+
+ // DataEdge tag and value
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ CordRep* const edge = leaf->Edges()[0];
+ const uint8_t tag = edge->tag;
+ CordRepBtreeTestPeer::SetEdge(leaf, begin, nullptr);
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ CordRepBtreeTestPeer::SetEdge(leaf, begin, edge);
+ edge->tag = BTREE;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ edge->tag = tag;
+
+ if (as_tree) {
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ leaf->length--;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ leaf->length++;
+
+ // Height
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ tree->storage[0] = static_cast<uint8_t>(2);
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ tree->storage[0] = 1;
+
+ // Btree edge
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ CordRep* const edge = tree->Edges()[0];
+ const uint8_t tag = edge->tag;
+ edge->tag = FLAT;
+ EXPECT_FALSE(CordRepBtree::IsValid(check));
+ edge->tag = tag;
+ }
+
+ ASSERT_TRUE(CordRepBtree::IsValid(check));
+ CordRep::Unref(check);
+ }
+}
+
+TEST(CordRepBtreeTest, AssertValid) {
+ CordRepBtree* tree = CordRepBtree::Create(MakeFlat("abc"));
+ const CordRepBtree* ctree = tree;
+ EXPECT_THAT(CordRepBtree::AssertValid(tree), Eq(tree));
+ EXPECT_THAT(CordRepBtree::AssertValid(ctree), Eq(ctree));
+
+#if defined(GTEST_HAS_DEATH_TEST)
+ CordRepBtree* nulltree = nullptr;
+ const CordRepBtree* cnulltree = nullptr;
+ EXPECT_DEBUG_DEATH(
+ EXPECT_THAT(CordRepBtree::AssertValid(nulltree), Eq(nulltree)), ".*");
+ EXPECT_DEBUG_DEATH(
+ EXPECT_THAT(CordRepBtree::AssertValid(cnulltree), Eq(cnulltree)), ".*");
+
+ tree->length--;
+ EXPECT_DEBUG_DEATH(EXPECT_THAT(CordRepBtree::AssertValid(tree), Eq(tree)),
+ ".*");
+ EXPECT_DEBUG_DEATH(EXPECT_THAT(CordRepBtree::AssertValid(ctree), Eq(ctree)),
+ ".*");
+ tree->length++;
+#endif
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepBtreeTest, CheckAssertValidShallowVsDeep) {
+ // Restore exhaustive validation on any exit.
+ const bool exhaustive_validation = cord_btree_exhaustive_validation.load();
+ auto cleanup = absl::MakeCleanup([exhaustive_validation] {
+ cord_btree_exhaustive_validation.store(exhaustive_validation);
+ });
+
+ // Create a tree of at least 2 levels, and mess with the original flat, which
+ // should go undetected in shallow mode as the flat is too far away, but
+ // should be detected in forced non-shallow mode.
+ CordRep* flat = MakeFlat("abc");
+ CordRepBtree* tree = CordRepBtree::Create(flat);
+ constexpr size_t max_cap = CordRepBtree::kMaxCapacity;
+ const size_t n = max_cap * max_cap * 2;
+ for (size_t i = 0; i < n; ++i) {
+ tree = CordRepBtree::Append(tree, MakeFlat("Hello world"));
+ }
+ flat->length = 100;
+
+ cord_btree_exhaustive_validation.store(false);
+ EXPECT_FALSE(CordRepBtree::IsValid(tree));
+ EXPECT_TRUE(CordRepBtree::IsValid(tree, true));
+ EXPECT_FALSE(CordRepBtree::IsValid(tree, false));
+ CordRepBtree::AssertValid(tree);
+ CordRepBtree::AssertValid(tree, true);
+#if defined(GTEST_HAS_DEATH_TEST)
+ EXPECT_DEBUG_DEATH(CordRepBtree::AssertValid(tree, false), ".*");
+#endif
+
+ cord_btree_exhaustive_validation.store(true);
+ EXPECT_FALSE(CordRepBtree::IsValid(tree));
+ EXPECT_FALSE(CordRepBtree::IsValid(tree, true));
+ EXPECT_FALSE(CordRepBtree::IsValid(tree, false));
+#if defined(GTEST_HAS_DEATH_TEST)
+ EXPECT_DEBUG_DEATH(CordRepBtree::AssertValid(tree), ".*");
+ EXPECT_DEBUG_DEATH(CordRepBtree::AssertValid(tree, true), ".*");
+#endif
+
+ flat->length = 3;
+ CordRep::Unref(tree);
+}
+
+TEST_P(CordRepBtreeTest, Rebuild) {
+ for (size_t size : {3, 8, 100, 10000, 1000000}) {
+ SCOPED_TRACE(absl::StrCat("Rebuild @", size));
+
+ std::vector<CordRepFlat*> flats;
+ for (int i = 0; i < size; ++i) {
+ flats.push_back(CordRepFlat::New(2));
+ flats.back()->Data()[0] = 'x';
+ flats.back()->length = 1;
+ }
+
+ // Build the tree into 'right', and each so many 'split_limit' edges,
+ // combine 'left' + 'right' into a new 'left', and start a new 'right'.
+ // This guarantees we get a reasonable amount of chaos in the tree.
+ size_t split_count = 0;
+ size_t split_limit = 3;
+ auto it = flats.begin();
+ CordRepBtree* left = nullptr;
+ CordRepBtree* right = CordRepBtree::New(*it);
+ while (++it != flats.end()) {
+ if (++split_count >= split_limit) {
+ split_limit += split_limit / 16;
+ left = left ? CordRepBtree::Append(left, right) : right;
+ right = CordRepBtree::New(*it);
+ } else {
+ right = CordRepBtree::Append(right, *it);
+ }
+ }
+
+ // Finalize tree
+ left = left ? CordRepBtree::Append(left, right) : right;
+
+ // Rebuild
+ AutoUnref ref;
+ left = ref.Add(CordRepBtree::Rebuild(ref.RefIf(shared(), left)));
+ ASSERT_TRUE(CordRepBtree::IsValid(left));
+
+ // Verify we have the exact same edges in the exact same order.
+ bool ok = true;
+ it = flats.begin();
+ CordVisitReps(left, [&](CordRep* edge) {
+ if (edge->tag < FLAT) return;
+ ok = ok && (it != flats.end() && *it++ == edge);
+ });
+ EXPECT_TRUE(ok && it == flats.end()) << "Rebuild edges mismatch";
+ }
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc
new file mode 100644
index 00000000..81514543
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc
@@ -0,0 +1,129 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_consume.h"
+
+#include <array>
+#include <utility>
+
+#include "absl/container/inlined_vector.h"
+#include "absl/functional/function_ref.h"
+#include "absl/strings/internal/cord_internal.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+namespace {
+
+// Unrefs the provided `substring`, and returns `substring->child`
+// Adds or assumes a reference on `substring->child`
+CordRep* ClipSubstring(CordRepSubstring* substring) {
+ CordRep* child = substring->child;
+ if (substring->refcount.IsOne()) {
+ delete substring;
+ } else {
+ CordRep::Ref(child);
+ CordRep::Unref(substring);
+ }
+ return child;
+}
+
+// Unrefs the provided `concat`, and returns `{concat->left, concat->right}`
+// Adds or assumes a reference on `concat->left` and `concat->right`.
+// Returns an array of 2 elements containing the left and right nodes.
+std::array<CordRep*, 2> ClipConcat(CordRepConcat* concat) {
+ std::array<CordRep*, 2> result{concat->left, concat->right};
+ if (concat->refcount.IsOne()) {
+ delete concat;
+ } else {
+ CordRep::Ref(result[0]);
+ CordRep::Ref(result[1]);
+ CordRep::Unref(concat);
+ }
+ return result;
+}
+
+void Consume(bool forward, CordRep* rep, ConsumeFn consume_fn) {
+ size_t offset = 0;
+ size_t length = rep->length;
+ struct Entry {
+ CordRep* rep;
+ size_t offset;
+ size_t length;
+ };
+ absl::InlinedVector<Entry, 40> stack;
+
+ for (;;) {
+ if (rep->tag == CONCAT) {
+ std::array<CordRep*, 2> res = ClipConcat(rep->concat());
+ CordRep* left = res[0];
+ CordRep* right = res[1];
+
+ if (left->length <= offset) {
+ // Don't need left node
+ offset -= left->length;
+ CordRep::Unref(left);
+ rep = right;
+ continue;
+ }
+
+ size_t length_left = left->length - offset;
+ if (length_left >= length) {
+ // Don't need right node
+ CordRep::Unref(right);
+ rep = left;
+ continue;
+ }
+
+ // Need both nodes
+ size_t length_right = length - length_left;
+ if (forward) {
+ stack.push_back({right, 0, length_right});
+ rep = left;
+ length = length_left;
+ } else {
+ stack.push_back({left, offset, length_left});
+ rep = right;
+ offset = 0;
+ length = length_right;
+ }
+ } else if (rep->tag == SUBSTRING) {
+ offset += rep->substring()->start;
+ rep = ClipSubstring(rep->substring());
+ } else {
+ consume_fn(rep, offset, length);
+ if (stack.empty()) return;
+
+ rep = stack.back().rep;
+ offset = stack.back().offset;
+ length = stack.back().length;
+ stack.pop_back();
+ }
+ }
+}
+
+} // namespace
+
+void Consume(CordRep* rep, ConsumeFn consume_fn) {
+ return Consume(true, rep, std::move(consume_fn));
+}
+
+void ReverseConsume(CordRep* rep, ConsumeFn consume_fn) {
+ return Consume(false, rep, std::move(consume_fn));
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h
new file mode 100644
index 00000000..d46fca2b
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h
@@ -0,0 +1,50 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORD_REP_CONSUME_H_
+#define ABSL_STRINGS_INTERNAL_CORD_REP_CONSUME_H_
+
+#include <functional>
+
+#include "absl/functional/function_ref.h"
+#include "absl/strings/internal/cord_internal.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// Functor for the Consume() and ReverseConsume() functions:
+// void ConsumeFunc(CordRep* rep, size_t offset, size_t length);
+// See the Consume() and ReverseConsume() function comments for documentation.
+using ConsumeFn = FunctionRef<void(CordRep*, size_t, size_t)>;
+
+// Consume() and ReverseConsume() consume CONCAT based trees and invoke the
+// provided functor with the contained nodes in the proper forward or reverse
+// order, which is used to convert CONCAT trees into other tree or cord data.
+// All CONCAT and SUBSTRING nodes are processed internally. The 'offset`
+// parameter of the functor is non-zero for any nodes below SUBSTRING nodes.
+// It's up to the caller to form these back into SUBSTRING nodes or otherwise
+// store offset / prefix information. These functions are intended to be used
+// only for migration / transitional code where due to factors such as ODR
+// violations, we can not 100% guarantee that all code respects 'new format'
+// settings and flags, so we need to be able to parse old data on the fly until
+// all old code is deprecated / no longer the default format.
+void Consume(CordRep* rep, ConsumeFn consume_fn);
+void ReverseConsume(CordRep* rep, ConsumeFn consume_fn);
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORD_REP_CONSUME_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume_test.cc
new file mode 100644
index 00000000..e507824b
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume_test.cc
@@ -0,0 +1,173 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cord_rep_consume.h"
+
+#include <functional>
+#include <utility>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using testing::InSequence;
+using testing::MockFunction;
+
+// Returns the depth of a node
+int Depth(const CordRep* rep) {
+ return (rep->tag == CONCAT) ? rep->concat()->depth() : 0;
+}
+
+// Creates a concatenation of the specified nodes.
+CordRepConcat* CreateConcat(CordRep* left, CordRep* right) {
+ auto* concat = new CordRepConcat();
+ concat->tag = CONCAT;
+ concat->left = left;
+ concat->right = right;
+ concat->length = left->length + right->length;
+ concat->set_depth(1 + (std::max)(Depth(left), Depth(right)));
+ return concat;
+}
+
+// Creates a flat with the length set to `length`
+CordRepFlat* CreateFlatWithLength(size_t length) {
+ auto* flat = CordRepFlat::New(length);
+ flat->length = length;
+ return flat;
+}
+
+// Creates a substring node on the specified child.
+CordRepSubstring* CreateSubstring(CordRep* child, size_t start, size_t length) {
+ auto* rep = new CordRepSubstring();
+ rep->length = length;
+ rep->tag = SUBSTRING;
+ rep->start = start;
+ rep->child = child;
+ return rep;
+}
+
+// Flats we use in the tests
+CordRep* flat[6];
+
+// Creates a test tree
+CordRep* CreateTestTree() {
+ flat[0] = CreateFlatWithLength(1);
+ flat[1] = CreateFlatWithLength(7);
+ CordRepConcat* left = CreateConcat(flat[0], CreateSubstring(flat[1], 2, 4));
+
+ flat[2] = CreateFlatWithLength(9);
+ flat[3] = CreateFlatWithLength(13);
+ CordRepConcat* right1 = CreateConcat(flat[2], flat[3]);
+
+ flat[4] = CreateFlatWithLength(15);
+ flat[5] = CreateFlatWithLength(19);
+ CordRepConcat* right2 = CreateConcat(flat[4], flat[5]);
+
+ CordRepConcat* right = CreateConcat(right1, CreateSubstring(right2, 5, 17));
+ return CreateConcat(left, right);
+}
+
+TEST(CordRepConsumeTest, Consume) {
+ InSequence in_sequence;
+ CordRep* tree = CreateTestTree();
+ MockFunction<void(CordRep*, size_t, size_t)> consume;
+ EXPECT_CALL(consume, Call(flat[0], 0, 1));
+ EXPECT_CALL(consume, Call(flat[1], 2, 4));
+ EXPECT_CALL(consume, Call(flat[2], 0, 9));
+ EXPECT_CALL(consume, Call(flat[3], 0, 13));
+ EXPECT_CALL(consume, Call(flat[4], 5, 10));
+ EXPECT_CALL(consume, Call(flat[5], 0, 7));
+ Consume(tree, consume.AsStdFunction());
+ for (CordRep* rep : flat) {
+ EXPECT_TRUE(rep->refcount.IsOne());
+ CordRep::Unref(rep);
+ }
+}
+
+TEST(CordRepConsumeTest, ConsumeShared) {
+ InSequence in_sequence;
+ CordRep* tree = CreateTestTree();
+ MockFunction<void(CordRep*, size_t, size_t)> consume;
+ EXPECT_CALL(consume, Call(flat[0], 0, 1));
+ EXPECT_CALL(consume, Call(flat[1], 2, 4));
+ EXPECT_CALL(consume, Call(flat[2], 0, 9));
+ EXPECT_CALL(consume, Call(flat[3], 0, 13));
+ EXPECT_CALL(consume, Call(flat[4], 5, 10));
+ EXPECT_CALL(consume, Call(flat[5], 0, 7));
+ Consume(CordRep::Ref(tree), consume.AsStdFunction());
+ for (CordRep* rep : flat) {
+ EXPECT_FALSE(rep->refcount.IsOne());
+ CordRep::Unref(rep);
+ }
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepConsumeTest, Reverse) {
+ InSequence in_sequence;
+ CordRep* tree = CreateTestTree();
+ MockFunction<void(CordRep*, size_t, size_t)> consume;
+ EXPECT_CALL(consume, Call(flat[5], 0, 7));
+ EXPECT_CALL(consume, Call(flat[4], 5, 10));
+ EXPECT_CALL(consume, Call(flat[3], 0, 13));
+ EXPECT_CALL(consume, Call(flat[2], 0, 9));
+ EXPECT_CALL(consume, Call(flat[1], 2, 4));
+ EXPECT_CALL(consume, Call(flat[0], 0, 1));
+ ReverseConsume(tree, consume.AsStdFunction());
+ for (CordRep* rep : flat) {
+ EXPECT_TRUE(rep->refcount.IsOne());
+ CordRep::Unref(rep);
+ }
+}
+
+TEST(CordRepConsumeTest, ReverseShared) {
+ InSequence in_sequence;
+ CordRep* tree = CreateTestTree();
+ MockFunction<void(CordRep*, size_t, size_t)> consume;
+ EXPECT_CALL(consume, Call(flat[5], 0, 7));
+ EXPECT_CALL(consume, Call(flat[4], 5, 10));
+ EXPECT_CALL(consume, Call(flat[3], 0, 13));
+ EXPECT_CALL(consume, Call(flat[2], 0, 9));
+ EXPECT_CALL(consume, Call(flat[1], 2, 4));
+ EXPECT_CALL(consume, Call(flat[0], 0, 1));
+ ReverseConsume(CordRep::Ref(tree), consume.AsStdFunction());
+ for (CordRep* rep : flat) {
+ EXPECT_FALSE(rep->refcount.IsOne());
+ CordRep::Unref(rep);
+ }
+ CordRep::Unref(tree);
+}
+
+TEST(CordRepConsumeTest, UnreachableFlat) {
+ InSequence in_sequence;
+ CordRepFlat* flat1 = CreateFlatWithLength(10);
+ CordRepFlat* flat2 = CreateFlatWithLength(20);
+ CordRepConcat* concat = CreateConcat(flat1, flat2);
+ CordRepSubstring* tree = CreateSubstring(concat, 15, 10);
+ MockFunction<void(CordRep*, size_t, size_t)> consume;
+ EXPECT_CALL(consume, Call(flat2, 5, 10));
+ Consume(tree, consume.AsStdFunction());
+ EXPECT_TRUE(flat2->refcount.IsOne());
+ CordRep::Unref(flat2);
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h
index a98aa9df..4d0f9886 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h
@@ -44,11 +44,11 @@ static constexpr size_t kMaxFlatLength = kMaxFlatSize - kFlatOverhead;
static constexpr size_t kMinFlatLength = kMinFlatSize - kFlatOverhead;
constexpr uint8_t AllocatedSizeToTagUnchecked(size_t size) {
- return static_cast<uint8_t>((size <= 1024) ? size / 8
- : 128 + size / 32 - 1024 / 32);
+ return static_cast<uint8_t>((size <= 1024) ? size / 8 + 1
+ : 129 + size / 32 - 1024 / 32);
}
-static_assert(kMinFlatSize / 8 >= FLAT, "");
+static_assert(kMinFlatSize / 8 + 1 >= FLAT, "");
static_assert(AllocatedSizeToTagUnchecked(kMaxFlatSize) <= MAX_FLAT_TAG, "");
// Helper functions for rounded div, and rounding to exact sizes.
@@ -73,7 +73,7 @@ inline uint8_t AllocatedSizeToTag(size_t size) {
// Converts the provided tag to the corresponding allocated size
constexpr size_t TagToAllocatedSize(uint8_t tag) {
- return (tag <= 128) ? (tag * 8) : (1024 + (tag - 128) * 32);
+ return (tag <= 129) ? ((tag - 1) * 8) : (1024 + (tag - 129) * 32);
}
// Converts the provided tag to the corresponding available data length
@@ -82,7 +82,7 @@ constexpr size_t TagToLength(uint8_t tag) {
}
// Enforce that kMaxFlatSize maps to a well-known exact tag value.
-static_assert(TagToAllocatedSize(224) == kMaxFlatSize, "Bad tag logic");
+static_assert(TagToAllocatedSize(225) == kMaxFlatSize, "Bad tag logic");
struct CordRepFlat : public CordRep {
// Creates a new flat node.
@@ -118,8 +118,8 @@ struct CordRepFlat : public CordRep {
}
// Returns a pointer to the data inside this flat rep.
- char* Data() { return storage; }
- const char* Data() const { return storage; }
+ char* Data() { return reinterpret_cast<char*>(storage); }
+ const char* Data() const { return reinterpret_cast<const char*>(storage); }
// Returns the maximum capacity (payload size) of this instance.
size_t Capacity() const { return TagToLength(tag); }
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc
index 4d31d1d9..07c77eb3 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc
@@ -26,21 +26,13 @@
#include "absl/base/macros.h"
#include "absl/container/inlined_vector.h"
#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_consume.h"
#include "absl/strings/internal/cord_rep_flat.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace cord_internal {
-// See https://bugs.llvm.org/show_bug.cgi?id=48477
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wshadow"
-#if __has_warning("-Wshadow-field")
-#pragma clang diagnostic ignored "-Wshadow-field"
-#endif
-#endif
-
namespace {
using index_type = CordRepRing::index_type;
@@ -48,7 +40,7 @@ using index_type = CordRepRing::index_type;
enum class Direction { kForward, kReversed };
inline bool IsFlatOrExternal(CordRep* rep) {
- return rep->tag >= FLAT || rep->tag == EXTERNAL;
+ return rep->IsFlat() || rep->IsExternal();
}
// Verifies that n + extra <= kMaxCapacity: throws std::length_error otherwise.
@@ -58,14 +50,6 @@ inline void CheckCapacity(size_t n, size_t extra) {
}
}
-// Removes a reference from `rep` only.
-// Asserts that the refcount after decrement is not zero.
-inline bool UnrefNeverOne(CordRep* rep) {
- bool result = rep->refcount.Decrement();
- assert(result);
- return result;
-}
-
// Creates a flat from the provided string data, allocating up to `extra`
// capacity in the returned flat depending on kMaxFlatLength limitations.
// Requires `len` to be less or equal to `kMaxFlatLength`
@@ -77,40 +61,6 @@ CordRepFlat* CreateFlat(const char* s, size_t n, size_t extra = 0) { // NOLINT
return rep;
}
-// Unrefs the provided `substring`, and returns `substring->child`
-// Adds or assumes a reference on `substring->child`
-CordRep* ClipSubstring(CordRepSubstring* substring) {
- CordRep* child = substring->child;
- if (substring->refcount.IsOne()) {
- delete substring;
- } else {
- CordRep::Ref(child);
- if (ABSL_PREDICT_FALSE(!substring->refcount.Decrement())) {
- UnrefNeverOne(child);
- delete substring;
- }
- }
- return child;
-}
-
-// Unrefs the provided `concat`, and returns `{concat->left, concat->right}`
-// Adds or assumes a reference on `concat->left` and `concat->right`.
-std::pair<CordRep*, CordRep*> ClipConcat(CordRepConcat* concat) {
- auto result = std::make_pair(concat->left, concat->right);
- if (concat->refcount.IsOne()) {
- delete concat;
- } else {
- CordRep::Ref(result.first);
- CordRep::Ref(result.second);
- if (ABSL_PREDICT_FALSE(!concat->refcount.Decrement())) {
- UnrefNeverOne(result.first);
- UnrefNeverOne(result.second);
- delete concat;
- }
- }
- return result;
-}
-
// Unrefs the entries in `[head, tail)`.
// Requires all entries to be a FLAT or EXTERNAL node.
void UnrefEntries(const CordRepRing* rep, index_type head, index_type tail) {
@@ -126,79 +76,6 @@ void UnrefEntries(const CordRepRing* rep, index_type head, index_type tail) {
});
}
-template <typename F>
-void Consume(Direction direction, CordRep* rep, F&& fn) {
- size_t offset = 0;
- size_t length = rep->length;
- struct Entry {
- CordRep* rep;
- size_t offset;
- size_t length;
- };
- absl::InlinedVector<Entry, 40> stack;
-
- for (;;) {
- if (rep->tag >= FLAT || rep->tag == EXTERNAL || rep->tag == RING) {
- fn(rep, offset, length);
- if (stack.empty()) return;
-
- rep = stack.back().rep;
- offset = stack.back().offset;
- length = stack.back().length;
- stack.pop_back();
- } else if (rep->tag == SUBSTRING) {
- offset += rep->substring()->start;
- rep = ClipSubstring(rep->substring());
- } else if (rep->tag == CONCAT) {
- auto res = ClipConcat(rep->concat());
- CordRep* left = res.first;
- CordRep* right = res.second;
-
- if (left->length <= offset) {
- // Don't need left node
- offset -= left->length;
- CordRep::Unref(left);
- rep = right;
- continue;
- }
-
- size_t length_left = left->length - offset;
- if (length_left >= length) {
- // Don't need right node
- CordRep::Unref(right);
- rep = left;
- continue;
- }
-
- // Need both nodes
- size_t length_right = length - length_left;
- if (direction == Direction::kReversed) {
- stack.push_back({left, offset, length_left});
- rep = right;
- offset = 0;
- length = length_right;
- } else {
- stack.push_back({right, 0, length_right});
- rep = left;
- length = length_left;
- }
- } else {
- assert("Valid tag" == nullptr);
- return;
- }
- }
-}
-
-template <typename F>
-void Consume(CordRep* rep, F&& fn) {
- return Consume(Direction::kForward, rep, std::forward<F>(fn));
-}
-
-template <typename F>
-void RConsume(CordRep* rep, F&& fn) {
- return Consume(Direction::kReversed, rep, std::forward<F>(fn));
-}
-
} // namespace
std::ostream& operator<<(std::ostream& s, const CordRepRing& rep) {
@@ -301,7 +178,7 @@ bool CordRepRing::IsValid(std::ostream& output) const {
if (offset >= child->length || entry_length > child->length - offset) {
output << "entry[" << head << "] has offset " << offset
<< " and entry length " << entry_length
- << " which are outside of the childs length of " << child->length;
+ << " which are outside of the child's length of " << child->length;
return false;
}
@@ -352,7 +229,7 @@ void CordRepRing::SetCapacityForTesting(size_t capacity) {
}
void CordRepRing::Delete(CordRepRing* rep) {
- assert(rep != nullptr && rep->tag == RING);
+ assert(rep != nullptr && rep->IsRing());
#if defined(__cpp_sized_deallocation)
size_t size = AllocSize(rep->capacity_);
rep->~CordRepRing();
@@ -400,10 +277,11 @@ CordRepRing* CordRepRing::Mutable(CordRepRing* rep, size_t extra) {
// Get current number of entries, and check for max capacity.
size_t entries = rep->entries();
- size_t min_extra = (std::max)(extra, rep->capacity() * 2 - entries);
- if (!rep->refcount.IsOne()) {
- return Copy(rep, rep->head(), rep->tail(), min_extra);
+ if (!rep->refcount.IsMutable()) {
+ return Copy(rep, rep->head(), rep->tail(), extra);
} else if (entries + extra > rep->capacity()) {
+ const size_t min_grow = rep->capacity() + rep->capacity() / 2;
+ const size_t min_extra = (std::max)(extra, min_grow - entries);
CordRepRing* newrep = CordRepRing::New(entries, min_extra);
newrep->Fill<false>(rep, rep->head(), rep->tail());
CordRepRing::Delete(rep);
@@ -414,10 +292,10 @@ CordRepRing* CordRepRing::Mutable(CordRepRing* rep, size_t extra) {
}
Span<char> CordRepRing::GetAppendBuffer(size_t size) {
- assert(refcount.IsOne());
+ assert(refcount.IsMutable());
index_type back = retreat(tail_);
CordRep* child = entry_child(back);
- if (child->tag >= FLAT && child->refcount.IsOne()) {
+ if (child->tag >= FLAT && child->refcount.IsMutable()) {
size_t capacity = child->flat()->Capacity();
pos_type end_pos = entry_end_pos(back);
size_t data_offset = entry_data_offset(back);
@@ -434,10 +312,10 @@ Span<char> CordRepRing::GetAppendBuffer(size_t size) {
}
Span<char> CordRepRing::GetPrependBuffer(size_t size) {
- assert(refcount.IsOne());
+ assert(refcount.IsMutable());
CordRep* child = entry_child(head_);
size_t data_offset = entry_data_offset(head_);
- if (data_offset && child->refcount.IsOne() && child->tag >= FLAT) {
+ if (data_offset && child->refcount.IsMutable() && child->tag >= FLAT) {
size_t n = (std::min)(data_offset, size);
this->length += n;
begin_pos_ -= n;
@@ -449,12 +327,12 @@ Span<char> CordRepRing::GetPrependBuffer(size_t size) {
}
CordRepRing* CordRepRing::CreateFromLeaf(CordRep* child, size_t offset,
- size_t length, size_t extra) {
+ size_t len, size_t extra) {
CordRepRing* rep = CordRepRing::New(1, extra);
rep->head_ = 0;
rep->tail_ = rep->advance(0);
- rep->length = length;
- rep->entry_end_pos()[0] = length;
+ rep->length = len;
+ rep->entry_end_pos()[0] = len;
rep->entry_child()[0] = child;
rep->entry_data_offset()[0] = static_cast<offset_type>(offset);
return Validate(rep);
@@ -462,16 +340,16 @@ CordRepRing* CordRepRing::CreateFromLeaf(CordRep* child, size_t offset,
CordRepRing* CordRepRing::CreateSlow(CordRep* child, size_t extra) {
CordRepRing* rep = nullptr;
- Consume(child, [&](CordRep* child, size_t offset, size_t length) {
- if (IsFlatOrExternal(child)) {
- rep = rep ? AppendLeaf(rep, child, offset, length)
- : CreateFromLeaf(child, offset, length, extra);
+ Consume(child, [&](CordRep* child_arg, size_t offset, size_t len) {
+ if (IsFlatOrExternal(child_arg)) {
+ rep = rep ? AppendLeaf(rep, child_arg, offset, len)
+ : CreateFromLeaf(child_arg, offset, len, extra);
} else if (rep) {
- rep = AddRing<AddMode::kAppend>(rep, child->ring(), offset, length);
- } else if (offset == 0 && child->length == length) {
- rep = Mutable(child->ring(), extra);
+ rep = AddRing<AddMode::kAppend>(rep, child_arg->ring(), offset, len);
+ } else if (offset == 0 && child_arg->length == len) {
+ rep = Mutable(child_arg->ring(), extra);
} else {
- rep = SubRing(child->ring(), offset, length, extra);
+ rep = SubRing(child_arg->ring(), offset, len, extra);
}
});
return Validate(rep, nullptr, __LINE__);
@@ -482,7 +360,7 @@ CordRepRing* CordRepRing::Create(CordRep* child, size_t extra) {
if (IsFlatOrExternal(child)) {
return CreateFromLeaf(child, 0, length, extra);
}
- if (child->tag == RING) {
+ if (child->IsRing()) {
return Mutable(child->ring(), extra);
}
return CreateSlow(child, extra);
@@ -490,18 +368,18 @@ CordRepRing* CordRepRing::Create(CordRep* child, size_t extra) {
template <CordRepRing::AddMode mode>
CordRepRing* CordRepRing::AddRing(CordRepRing* rep, CordRepRing* ring,
- size_t offset, size_t length) {
+ size_t offset, size_t len) {
assert(offset < ring->length);
constexpr bool append = mode == AddMode::kAppend;
Position head = ring->Find(offset);
- Position tail = ring->FindTail(head.index, offset + length);
+ Position tail = ring->FindTail(head.index, offset + len);
const index_type entries = ring->entries(head.index, tail.index);
rep = Mutable(rep, entries);
// The delta for making ring[head].end_pos into 'len - offset'
const pos_type delta_length =
- (append ? rep->begin_pos_ + rep->length : rep->begin_pos_ - length) -
+ (append ? rep->begin_pos_ + rep->length : rep->begin_pos_ - len) -
ring->entry_begin_pos(head.index) - head.offset;
// Start filling at `tail`, or `entries` before `head`
@@ -542,36 +420,36 @@ CordRepRing* CordRepRing::AddRing(CordRepRing* rep, CordRepRing* ring,
}
// Commit changes
- rep->length += length;
+ rep->length += len;
if (append) {
rep->tail_ = filler.pos();
} else {
rep->head_ = filler.head();
- rep->begin_pos_ -= length;
+ rep->begin_pos_ -= len;
}
return Validate(rep);
}
CordRepRing* CordRepRing::AppendSlow(CordRepRing* rep, CordRep* child) {
- Consume(child, [&rep](CordRep* child, size_t offset, size_t length) {
- if (child->tag == RING) {
- rep = AddRing<AddMode::kAppend>(rep, child->ring(), offset, length);
+ Consume(child, [&rep](CordRep* child_arg, size_t offset, size_t len) {
+ if (child_arg->IsRing()) {
+ rep = AddRing<AddMode::kAppend>(rep, child_arg->ring(), offset, len);
} else {
- rep = AppendLeaf(rep, child, offset, length);
+ rep = AppendLeaf(rep, child_arg, offset, len);
}
});
return rep;
}
CordRepRing* CordRepRing::AppendLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t length) {
+ size_t offset, size_t len) {
rep = Mutable(rep, 1);
index_type back = rep->tail_;
const pos_type begin_pos = rep->begin_pos_ + rep->length;
rep->tail_ = rep->advance(rep->tail_);
- rep->length += length;
- rep->entry_end_pos()[back] = begin_pos + length;
+ rep->length += len;
+ rep->entry_end_pos()[back] = begin_pos + len;
rep->entry_child()[back] = child;
rep->entry_data_offset()[back] = static_cast<offset_type>(offset);
return Validate(rep, nullptr, __LINE__);
@@ -582,31 +460,31 @@ CordRepRing* CordRepRing::Append(CordRepRing* rep, CordRep* child) {
if (IsFlatOrExternal(child)) {
return AppendLeaf(rep, child, 0, length);
}
- if (child->tag == RING) {
+ if (child->IsRing()) {
return AddRing<AddMode::kAppend>(rep, child->ring(), 0, length);
}
return AppendSlow(rep, child);
}
CordRepRing* CordRepRing::PrependSlow(CordRepRing* rep, CordRep* child) {
- RConsume(child, [&](CordRep* child, size_t offset, size_t length) {
- if (IsFlatOrExternal(child)) {
- rep = PrependLeaf(rep, child, offset, length);
+ ReverseConsume(child, [&](CordRep* child_arg, size_t offset, size_t len) {
+ if (IsFlatOrExternal(child_arg)) {
+ rep = PrependLeaf(rep, child_arg, offset, len);
} else {
- rep = AddRing<AddMode::kPrepend>(rep, child->ring(), offset, length);
+ rep = AddRing<AddMode::kPrepend>(rep, child_arg->ring(), offset, len);
}
});
return Validate(rep);
}
CordRepRing* CordRepRing::PrependLeaf(CordRepRing* rep, CordRep* child,
- size_t offset, size_t length) {
+ size_t offset, size_t len) {
rep = Mutable(rep, 1);
index_type head = rep->retreat(rep->head_);
pos_type end_pos = rep->begin_pos_;
rep->head_ = head;
- rep->length += length;
- rep->begin_pos_ -= length;
+ rep->length += len;
+ rep->begin_pos_ -= len;
rep->entry_end_pos()[head] = end_pos;
rep->entry_child()[head] = child;
rep->entry_data_offset()[head] = static_cast<offset_type>(offset);
@@ -618,7 +496,7 @@ CordRepRing* CordRepRing::Prepend(CordRepRing* rep, CordRep* child) {
if (IsFlatOrExternal(child)) {
return PrependLeaf(rep, child, 0, length);
}
- if (child->tag == RING) {
+ if (child->IsRing()) {
return AddRing<AddMode::kPrepend>(rep, child->ring(), 0, length);
}
return PrependSlow(rep, child);
@@ -626,7 +504,7 @@ CordRepRing* CordRepRing::Prepend(CordRepRing* rep, CordRep* child) {
CordRepRing* CordRepRing::Append(CordRepRing* rep, absl::string_view data,
size_t extra) {
- if (rep->refcount.IsOne()) {
+ if (rep->refcount.IsMutable()) {
Span<char> avail = rep->GetAppendBuffer(data.length());
if (!avail.empty()) {
memcpy(avail.data(), data.data(), avail.length());
@@ -660,7 +538,7 @@ CordRepRing* CordRepRing::Append(CordRepRing* rep, absl::string_view data,
CordRepRing* CordRepRing::Prepend(CordRepRing* rep, absl::string_view data,
size_t extra) {
- if (rep->refcount.IsOne()) {
+ if (rep->refcount.IsMutable()) {
Span<char> avail = rep->GetPrependBuffer(data.length());
if (!avail.empty()) {
const char* tail = data.data() + data.length() - avail.length();
@@ -786,21 +664,21 @@ char CordRepRing::GetCharacter(size_t offset) const {
}
CordRepRing* CordRepRing::SubRing(CordRepRing* rep, size_t offset,
- size_t length, size_t extra) {
+ size_t len, size_t extra) {
assert(offset <= rep->length);
- assert(offset <= rep->length - length);
+ assert(offset <= rep->length - len);
- if (length == 0) {
+ if (len == 0) {
CordRep::Unref(rep);
return nullptr;
}
// Find position of first byte
Position head = rep->Find(offset);
- Position tail = rep->FindTail(head.index, offset + length);
+ Position tail = rep->FindTail(head.index, offset + len);
const size_t new_entries = rep->entries(head.index, tail.index);
- if (rep->refcount.IsOne() && extra <= (rep->capacity() - new_entries)) {
+ if (rep->refcount.IsMutable() && extra <= (rep->capacity() - new_entries)) {
// We adopt a privately owned rep and no extra entries needed.
if (head.index != rep->head_) UnrefEntries(rep, rep->head_, head.index);
if (tail.index != rep->tail_) UnrefEntries(rep, tail.index, rep->tail_);
@@ -814,7 +692,7 @@ CordRepRing* CordRepRing::SubRing(CordRepRing* rep, size_t offset,
}
// Adjust begin_pos and length
- rep->length = length;
+ rep->length = len;
rep->begin_pos_ += offset;
// Adjust head and tail blocks
@@ -837,7 +715,7 @@ CordRepRing* CordRepRing::RemovePrefix(CordRepRing* rep, size_t len,
}
Position head = rep->Find(len);
- if (rep->refcount.IsOne()) {
+ if (rep->refcount.IsMutable()) {
if (head.index != rep->head_) UnrefEntries(rep, rep->head_, head.index);
rep->head_ = head.index;
} else {
@@ -867,7 +745,7 @@ CordRepRing* CordRepRing::RemoveSuffix(CordRepRing* rep, size_t len,
}
Position tail = rep->FindTail(rep->length - len);
- if (rep->refcount.IsOne()) {
+ if (rep->refcount.IsMutable()) {
// We adopt a privately owned rep, scrub.
if (tail.index != rep->tail_) UnrefEntries(rep, tail.index, rep->tail_);
rep->tail_ = tail.index;
@@ -888,10 +766,6 @@ CordRepRing* CordRepRing::RemoveSuffix(CordRepRing* rep, size_t len,
return Validate(rep);
}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
} // namespace cord_internal
ABSL_NAMESPACE_END
} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h
index c74d3353..2000e21e 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h
@@ -30,15 +30,6 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace cord_internal {
-// See https://bugs.llvm.org/show_bug.cgi?id=48477
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wshadow"
-#if __has_warning("-Wshadow-field")
-#pragma clang diagnostic ignored "-Wshadow-field"
-#endif
-#endif
-
// All operations modifying a ring buffer are implemented as static methods
// requiring a CordRepRing instance with a reference adopted by the method.
//
@@ -210,23 +201,23 @@ class CordRepRing : public CordRep {
// referencing up to `size` capacity directly before the existing data.
Span<char> GetPrependBuffer(size_t size);
- // Returns a cord ring buffer containing `length` bytes of data starting at
+ // Returns a cord ring buffer containing `len` bytes of data starting at
// `offset`. If the input is not shared, this function will remove all head
// and tail child nodes outside of the requested range, and adjust the new
// head and tail nodes as required. If the input is shared, this function
// returns a new instance sharing some or all of the nodes from the input.
- static CordRepRing* SubRing(CordRepRing* r, size_t offset, size_t length,
+ static CordRepRing* SubRing(CordRepRing* r, size_t offset, size_t len,
size_t extra = 0);
- // Returns a cord ring buffer with the first `length` bytes removed.
+ // Returns a cord ring buffer with the first `len` bytes removed.
// If the input is not shared, this function will remove all head child nodes
// fully inside the first `length` bytes, and adjust the new head as required.
// If the input is shared, this function returns a new instance sharing some
// or all of the nodes from the input.
- static CordRepRing* RemoveSuffix(CordRepRing* r, size_t length,
+ static CordRepRing* RemoveSuffix(CordRepRing* r, size_t len,
size_t extra = 0);
- // Returns a cord ring buffer with the last `length` bytes removed.
+ // Returns a cord ring buffer with the last `len` bytes removed.
// If the input is not shared, this function will remove all head child nodes
// fully inside the first `length` bytes, and adjust the new head as required.
// If the input is shared, this function returns a new instance sharing some
@@ -237,6 +228,18 @@ class CordRepRing : public CordRep {
// Returns the character at `offset`. Requires that `offset < length`.
char GetCharacter(size_t offset) const;
+ // Returns true if this instance manages a single contiguous buffer, in which
+ // case the (optional) output parameter `fragment` is set. Otherwise, the
+ // function returns false, and `fragment` is left unchanged.
+ bool IsFlat(absl::string_view* fragment) const;
+
+ // Returns true if the data starting at `offset` with length `len` is
+ // managed by this instance inside a single contiguous buffer, in which case
+ // the (optional) output parameter `fragment` is set to the contiguous memory
+ // starting at offset `offset` with length `length`. Otherwise, the function
+ // returns false, and `fragment` is left unchanged.
+ bool IsFlat(size_t offset, size_t len, absl::string_view* fragment) const;
+
// Testing only: set capacity to requested capacity.
void SetCapacityForTesting(size_t capacity);
@@ -380,8 +383,8 @@ class CordRepRing : public CordRep {
// Destroys the provided ring buffer, decrementing the reference count of all
// contained child CordReps. The provided 1\`rep` should have a ref count of
- // one (pre decrement destroy call observing `refcount.IsOne()`) or zero (post
- // decrement destroy call observing `!refcount.Decrement()`).
+ // one (pre decrement destroy call observing `refcount.IsOne()`) or zero
+ // (post decrement destroy call observing `!refcount.Decrement()`).
static void Destroy(CordRepRing* rep);
// Returns a mutable reference to the logical end position array.
@@ -461,10 +464,10 @@ class CordRepRing : public CordRep {
size_t length, size_t extra);
// Appends or prepends (depending on AddMode) the ring buffer in `ring' to
- // `rep` starting at `offset` with length `length`.
+ // `rep` starting at `offset` with length `len`.
template <AddMode mode>
static CordRepRing* AddRing(CordRepRing* rep, CordRepRing* ring,
- size_t offset, size_t length);
+ size_t offset, size_t len);
// Increases the data offset for entry `index` by `n`.
void AddDataOffset(index_type index, size_t n);
@@ -567,20 +570,35 @@ inline CordRepRing::Position CordRepRing::FindTail(index_type head,
// Now that CordRepRing is defined, we can define CordRep's helper casts:
inline CordRepRing* CordRep::ring() {
- assert(tag == RING);
+ assert(IsRing());
return static_cast<CordRepRing*>(this);
}
inline const CordRepRing* CordRep::ring() const {
- assert(tag == RING);
+ assert(IsRing());
return static_cast<const CordRepRing*>(this);
}
-std::ostream& operator<<(std::ostream& s, const CordRepRing& rep);
+inline bool CordRepRing::IsFlat(absl::string_view* fragment) const {
+ if (entries() == 1) {
+ if (fragment) *fragment = entry_data(head());
+ return true;
+ }
+ return false;
+}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
+inline bool CordRepRing::IsFlat(size_t offset, size_t len,
+ absl::string_view* fragment) const {
+ const Position pos = Find(offset);
+ const absl::string_view data = entry_data(pos.index);
+ if (data.length() >= len && data.length() - len >= pos.offset) {
+ if (fragment) *fragment = data.substr(pos.offset, len);
+ return true;
+ }
+ return false;
+}
+
+std::ostream& operator<<(std::ostream& s, const CordRepRing& rep);
} // namespace cord_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h
index 396c0e2c..7ceeaa00 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h
@@ -40,6 +40,10 @@ class CordRepRingReader {
// The returned value is undefined if this instance is empty.
CordRepRing::index_type index() const { return index_; }
+ // Returns the current node inside the ring buffer for this instance.
+ // The returned value is undefined if this instance is empty.
+ CordRep* node() const { return ring_->entry_child(index_); }
+
// Returns the length of the referenced ring buffer.
// Requires the current instance to be non empty.
size_t length() const {
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_test_util.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_test_util.h
new file mode 100644
index 00000000..ad828af2
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cord_rep_test_util.h
@@ -0,0 +1,220 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORD_REP_TEST_UTIL_H_
+#define ABSL_STRINGS_INTERNAL_CORD_REP_TEST_UTIL_H_
+
+#include <cassert>
+#include <memory>
+#include <random>
+#include <string>
+#include <vector>
+
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/string_view.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cordrep_testing {
+
+inline cord_internal::CordRepSubstring* MakeSubstring(
+ size_t start, size_t len, cord_internal::CordRep* rep) {
+ auto* sub = new cord_internal::CordRepSubstring;
+ sub->tag = cord_internal::SUBSTRING;
+ sub->start = start;
+ sub->length = len <= 0 ? rep->length - start + len : len;
+ sub->child = rep;
+ return sub;
+}
+
+inline cord_internal::CordRepConcat* MakeConcat(cord_internal::CordRep* left,
+ cord_internal::CordRep* right,
+ int depth = 0) {
+ auto* concat = new cord_internal::CordRepConcat;
+ concat->tag = cord_internal::CONCAT;
+ concat->length = left->length + right->length;
+ concat->left = left;
+ concat->right = right;
+ concat->set_depth(depth);
+ return concat;
+}
+
+inline cord_internal::CordRepFlat* MakeFlat(absl::string_view value) {
+ assert(value.length() <= cord_internal::kMaxFlatLength);
+ auto* flat = cord_internal::CordRepFlat::New(value.length());
+ flat->length = value.length();
+ memcpy(flat->Data(), value.data(), value.length());
+ return flat;
+}
+
+// Creates an external node for testing
+inline cord_internal::CordRepExternal* MakeExternal(absl::string_view s) {
+ struct Rep : public cord_internal::CordRepExternal {
+ std::string s;
+ explicit Rep(absl::string_view sv) : s(sv) {
+ this->tag = cord_internal::EXTERNAL;
+ this->base = s.data();
+ this->length = s.length();
+ this->releaser_invoker = [](cord_internal::CordRepExternal* self) {
+ delete static_cast<Rep*>(self);
+ };
+ }
+ };
+ return new Rep(s);
+}
+
+inline std::string CreateRandomString(size_t n) {
+ absl::string_view data =
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789~!@#$%^&*()_+=-<>?:\"{}[]|";
+ std::minstd_rand rnd;
+ std::uniform_int_distribution<size_t> dist(0, data.size() - 1);
+ std::string s(n, ' ');
+ for (size_t i = 0; i < n; ++i) {
+ s[i] = data[dist(rnd)];
+ }
+ return s;
+}
+
+// Creates an array of flats from the provided string, chopping
+// the provided string up into flats of size `chunk_size` characters
+// resulting in roughly `data.size() / chunk_size` total flats.
+inline std::vector<cord_internal::CordRep*> CreateFlatsFromString(
+ absl::string_view data, size_t chunk_size) {
+ assert(chunk_size > 0);
+ std::vector<cord_internal::CordRep*> flats;
+ for (absl::string_view s = data; !s.empty(); s.remove_prefix(chunk_size)) {
+ flats.push_back(MakeFlat(s.substr(0, chunk_size)));
+ }
+ return flats;
+}
+
+inline cord_internal::CordRepBtree* CordRepBtreeFromFlats(
+ absl::Span<cord_internal::CordRep* const> flats) {
+ assert(!flats.empty());
+ auto* node = cord_internal::CordRepBtree::Create(flats[0]);
+ for (size_t i = 1; i < flats.size(); ++i) {
+ node = cord_internal::CordRepBtree::Append(node, flats[i]);
+ }
+ return node;
+}
+
+template <typename Fn>
+inline void CordVisitReps(cord_internal::CordRep* rep, Fn&& fn) {
+ fn(rep);
+ while (rep->tag == cord_internal::SUBSTRING) {
+ rep = rep->substring()->child;
+ fn(rep);
+ }
+ if (rep->tag == cord_internal::BTREE) {
+ for (cord_internal::CordRep* edge : rep->btree()->Edges()) {
+ CordVisitReps(edge, fn);
+ }
+ } else if (rep->tag == cord_internal::CONCAT) {
+ CordVisitReps(rep->concat()->left, fn);
+ CordVisitReps(rep->concat()->right, fn);
+ }
+}
+
+template <typename Predicate>
+inline std::vector<cord_internal::CordRep*> CordCollectRepsIf(
+ Predicate&& predicate, cord_internal::CordRep* rep) {
+ std::vector<cord_internal::CordRep*> reps;
+ CordVisitReps(rep, [&reps, &predicate](cord_internal::CordRep* rep) {
+ if (predicate(rep)) reps.push_back(rep);
+ });
+ return reps;
+}
+
+inline std::vector<cord_internal::CordRep*> CordCollectReps(
+ cord_internal::CordRep* rep) {
+ std::vector<cord_internal::CordRep*> reps;
+ auto fn = [&reps](cord_internal::CordRep* rep) { reps.push_back(rep); };
+ CordVisitReps(rep, fn);
+ return reps;
+}
+
+inline void CordToString(cord_internal::CordRep* rep, std::string& s) {
+ size_t offset = 0;
+ size_t length = rep->length;
+ while (rep->tag == cord_internal::SUBSTRING) {
+ offset += rep->substring()->start;
+ rep = rep->substring()->child;
+ }
+ if (rep->tag == cord_internal::BTREE) {
+ for (cord_internal::CordRep* edge : rep->btree()->Edges()) {
+ CordToString(edge, s);
+ }
+ } else if (rep->tag >= cord_internal::FLAT) {
+ s.append(rep->flat()->Data() + offset, length);
+ } else if (rep->tag == cord_internal::EXTERNAL) {
+ s.append(rep->external()->base + offset, length);
+ } else {
+ ABSL_RAW_LOG(FATAL, "Unsupported tag %d", rep->tag);
+ }
+}
+
+inline std::string CordToString(cord_internal::CordRep* rep) {
+ std::string s;
+ s.reserve(rep->length);
+ CordToString(rep, s);
+ return s;
+}
+
+// RAII Helper class to automatically unref reps on destruction.
+class AutoUnref {
+ public:
+ ~AutoUnref() {
+ for (CordRep* rep : unrefs_) CordRep::Unref(rep);
+ }
+
+ // Adds `rep` to the list of reps to be unreffed at destruction.
+ template <typename CordRepType>
+ CordRepType* Add(CordRepType* rep) {
+ unrefs_.push_back(rep);
+ return rep;
+ }
+
+ // Increments the reference count of `rep` by one, and adds it to
+ // the list of reps to be unreffed at destruction.
+ template <typename CordRepType>
+ CordRepType* Ref(CordRepType* rep) {
+ unrefs_.push_back(CordRep::Ref(rep));
+ return rep;
+ }
+
+ // Increments the reference count of `rep` by one if `condition` is true,
+ // and adds it to the list of reps to be unreffed at destruction.
+ template <typename CordRepType>
+ CordRepType* RefIf(bool condition, CordRepType* rep) {
+ if (condition) unrefs_.push_back(CordRep::Ref(rep));
+ return rep;
+ }
+
+ private:
+ using CordRep = absl::cord_internal::CordRep;
+
+ std::vector<CordRep*> unrefs_;
+};
+
+} // namespace cordrep_testing
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORD_REP_TEST_UTIL_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc
new file mode 100644
index 00000000..20d314f0
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc
@@ -0,0 +1,96 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_functions.h"
+
+#include <atomic>
+#include <cmath>
+#include <limits>
+#include <random>
+
+#include "absl/base/attributes.h"
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/profiling/internal/exponential_biased.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+// The average interval until the next sample. A value of 0 disables profiling
+// while a value of 1 will profile all Cords.
+std::atomic<int> g_cordz_mean_interval(50000);
+
+} // namespace
+
+#ifdef ABSL_INTERNAL_CORDZ_ENABLED
+
+// Special negative 'not initialized' per thread value for cordz_next_sample.
+static constexpr int64_t kInitCordzNextSample = -1;
+
+ABSL_CONST_INIT thread_local int64_t cordz_next_sample = kInitCordzNextSample;
+
+// kIntervalIfDisabled is the number of profile-eligible events need to occur
+// before the code will confirm that cordz is still disabled.
+constexpr int64_t kIntervalIfDisabled = 1 << 16;
+
+ABSL_ATTRIBUTE_NOINLINE bool cordz_should_profile_slow() {
+
+ thread_local absl::profiling_internal::ExponentialBiased
+ exponential_biased_generator;
+ int32_t mean_interval = get_cordz_mean_interval();
+
+ // Check if we disabled profiling. If so, set the next sample to a "large"
+ // number to minimize the overhead of the should_profile codepath.
+ if (mean_interval <= 0) {
+ cordz_next_sample = kIntervalIfDisabled;
+ return false;
+ }
+
+ // Check if we're always sampling.
+ if (mean_interval == 1) {
+ cordz_next_sample = 1;
+ return true;
+ }
+
+ if (cordz_next_sample <= 0) {
+ // If first check on current thread, check cordz_should_profile()
+ // again using the created (initial) stride in cordz_next_sample.
+ const bool initialized = cordz_next_sample != kInitCordzNextSample;
+ cordz_next_sample = exponential_biased_generator.GetStride(mean_interval);
+ return initialized || cordz_should_profile();
+ }
+
+ --cordz_next_sample;
+ return false;
+}
+
+void cordz_set_next_sample_for_testing(int64_t next_sample) {
+ cordz_next_sample = next_sample;
+}
+
+#endif // ABSL_INTERNAL_CORDZ_ENABLED
+
+int32_t get_cordz_mean_interval() {
+ return g_cordz_mean_interval.load(std::memory_order_acquire);
+}
+
+void set_cordz_mean_interval(int32_t mean_interval) {
+ g_cordz_mean_interval.store(mean_interval, std::memory_order_release);
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h
new file mode 100644
index 00000000..c9ba1450
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h
@@ -0,0 +1,85 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_CORDZ_FUNCTIONS_H_
+#define ABSL_STRINGS_CORDZ_FUNCTIONS_H_
+
+#include <stdint.h>
+
+#include "absl/base/attributes.h"
+#include "absl/base/config.h"
+#include "absl/base/optimization.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// Returns the current sample rate. This represents the average interval
+// between samples.
+int32_t get_cordz_mean_interval();
+
+// Sets the sample rate with the average interval between samples.
+void set_cordz_mean_interval(int32_t mean_interval);
+
+// Enable cordz unless any of the following applies:
+// - no thread local support
+// - MSVC build
+// - Android build
+// - Apple build
+// - DLL build
+// Hashtablez is turned off completely in opensource builds.
+// MSVC's static atomics are dynamically initialized in debug mode, which breaks
+// sampling.
+#if defined(ABSL_HAVE_THREAD_LOCAL) && !defined(_MSC_VER) && \
+ !defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL) && \
+ !defined(__ANDROID__) && !defined(__APPLE__)
+#define ABSL_INTERNAL_CORDZ_ENABLED 1
+#endif
+
+#ifdef ABSL_INTERNAL_CORDZ_ENABLED
+
+// cordz_next_sample is the number of events until the next sample event. If
+// the value is 1 or less, the code will check on the next event if cordz is
+// enabled, and if so, will sample the Cord. cordz is only enabled when we can
+// use thread locals.
+ABSL_CONST_INIT extern thread_local int64_t cordz_next_sample;
+
+// Determines if the next sample should be profiled. If it is, the value pointed
+// at by next_sample will be set with the interval until the next sample.
+bool cordz_should_profile_slow();
+
+// Returns true if the next cord should be sampled.
+inline bool cordz_should_profile() {
+ if (ABSL_PREDICT_TRUE(cordz_next_sample > 1)) {
+ cordz_next_sample--;
+ return false;
+ }
+ return cordz_should_profile_slow();
+}
+
+// Sets the interval until the next sample (for testing only)
+void cordz_set_next_sample_for_testing(int64_t next_sample);
+
+#else // ABSL_INTERNAL_CORDZ_ENABLED
+
+inline bool cordz_should_profile() { return false; }
+inline void cordz_set_next_sample_for_testing(int64_t) {}
+
+#endif // ABSL_INTERNAL_CORDZ_ENABLED
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_CORDZ_FUNCTIONS_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions_test.cc
new file mode 100644
index 00000000..350623c1
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_functions_test.cc
@@ -0,0 +1,149 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_functions.h"
+
+#include <thread> // NOLINT we need real clean new threads
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::Eq;
+using ::testing::Ge;
+using ::testing::Le;
+
+TEST(CordzFunctionsTest, SampleRate) {
+ int32_t orig_sample_rate = get_cordz_mean_interval();
+ int32_t expected_sample_rate = 123;
+ set_cordz_mean_interval(expected_sample_rate);
+ EXPECT_THAT(get_cordz_mean_interval(), Eq(expected_sample_rate));
+ set_cordz_mean_interval(orig_sample_rate);
+}
+
+// Cordz is disabled when we don't have thread_local. All calls to
+// should_profile will return false when cordz is diabled, so we might want to
+// avoid those tests.
+#ifdef ABSL_INTERNAL_CORDZ_ENABLED
+
+TEST(CordzFunctionsTest, ShouldProfileDisable) {
+ int32_t orig_sample_rate = get_cordz_mean_interval();
+
+ set_cordz_mean_interval(0);
+ cordz_set_next_sample_for_testing(0);
+ EXPECT_FALSE(cordz_should_profile());
+ // 1 << 16 is from kIntervalIfDisabled in cordz_functions.cc.
+ EXPECT_THAT(cordz_next_sample, Eq(1 << 16));
+
+ set_cordz_mean_interval(orig_sample_rate);
+}
+
+TEST(CordzFunctionsTest, ShouldProfileAlways) {
+ int32_t orig_sample_rate = get_cordz_mean_interval();
+
+ set_cordz_mean_interval(1);
+ cordz_set_next_sample_for_testing(1);
+ EXPECT_TRUE(cordz_should_profile());
+ EXPECT_THAT(cordz_next_sample, Le(1));
+
+ set_cordz_mean_interval(orig_sample_rate);
+}
+
+TEST(CordzFunctionsTest, DoesNotAlwaysSampleFirstCord) {
+ // Set large enough interval such that the chance of 'tons' of threads
+ // randomly sampling the first call is infinitely small.
+ set_cordz_mean_interval(10000);
+ int tries = 0;
+ bool sampled = false;
+ do {
+ ++tries;
+ ASSERT_THAT(tries, Le(1000));
+ std::thread thread([&sampled] {
+ sampled = cordz_should_profile();
+ });
+ thread.join();
+ } while (sampled);
+}
+
+TEST(CordzFunctionsTest, ShouldProfileRate) {
+ static constexpr int kDesiredMeanInterval = 1000;
+ static constexpr int kSamples = 10000;
+ int32_t orig_sample_rate = get_cordz_mean_interval();
+
+ set_cordz_mean_interval(kDesiredMeanInterval);
+
+ int64_t sum_of_intervals = 0;
+ for (int i = 0; i < kSamples; i++) {
+ // Setting next_sample to 0 will force cordz_should_profile to generate a
+ // new value for next_sample each iteration.
+ cordz_set_next_sample_for_testing(0);
+ cordz_should_profile();
+ sum_of_intervals += cordz_next_sample;
+ }
+
+ // The sum of independent exponential variables is an Erlang distribution,
+ // which is a gamma distribution where the shape parameter is equal to the
+ // number of summands. The distribution used for cordz_should_profile is
+ // actually floor(Exponential(1/mean)) which introduces bias. However, we can
+ // apply the squint-really-hard correction factor. That is, when mean is
+ // large, then if we squint really hard the shape of the distribution between
+ // N and N+1 looks like a uniform distribution. On average, each value for
+ // next_sample will be about 0.5 lower than we would expect from an
+ // exponential distribution. This squint-really-hard correction approach won't
+ // work when mean is smaller than about 10 but works fine when mean is 1000.
+ //
+ // We can use R to calculate a confidence interval. This
+ // shows how to generate a confidence interval with a false positive rate of
+ // one in a billion.
+ //
+ // $ R -q
+ // > mean = 1000
+ // > kSamples = 10000
+ // > errorRate = 1e-9
+ // > correction = -kSamples / 2
+ // > low = qgamma(errorRate/2, kSamples, 1/mean) + correction
+ // > high = qgamma(1 - errorRate/2, kSamples, 1/mean) + correction
+ // > low
+ // [1] 9396115
+ // > high
+ // [1] 10618100
+ EXPECT_THAT(sum_of_intervals, Ge(9396115));
+ EXPECT_THAT(sum_of_intervals, Le(10618100));
+
+ set_cordz_mean_interval(orig_sample_rate);
+}
+
+#else // ABSL_INTERNAL_CORDZ_ENABLED
+
+TEST(CordzFunctionsTest, ShouldProfileDisabled) {
+ int32_t orig_sample_rate = get_cordz_mean_interval();
+
+ set_cordz_mean_interval(1);
+ cordz_set_next_sample_for_testing(0);
+ EXPECT_FALSE(cordz_should_profile());
+
+ set_cordz_mean_interval(orig_sample_rate);
+}
+
+#endif // ABSL_INTERNAL_CORDZ_ENABLED
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc
new file mode 100644
index 00000000..a73fefed
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc
@@ -0,0 +1,139 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_handle.h"
+
+#include <atomic>
+
+#include "absl/base/internal/raw_logging.h" // For ABSL_RAW_CHECK
+#include "absl/base/internal/spinlock.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+using ::absl::base_internal::SpinLockHolder;
+
+ABSL_CONST_INIT CordzHandle::Queue CordzHandle::global_queue_(absl::kConstInit);
+
+CordzHandle::CordzHandle(bool is_snapshot) : is_snapshot_(is_snapshot) {
+ if (is_snapshot) {
+ SpinLockHolder lock(&queue_->mutex);
+ CordzHandle* dq_tail = queue_->dq_tail.load(std::memory_order_acquire);
+ if (dq_tail != nullptr) {
+ dq_prev_ = dq_tail;
+ dq_tail->dq_next_ = this;
+ }
+ queue_->dq_tail.store(this, std::memory_order_release);
+ }
+}
+
+CordzHandle::~CordzHandle() {
+ ODRCheck();
+ if (is_snapshot_) {
+ std::vector<CordzHandle*> to_delete;
+ {
+ SpinLockHolder lock(&queue_->mutex);
+ CordzHandle* next = dq_next_;
+ if (dq_prev_ == nullptr) {
+ // We were head of the queue, delete every CordzHandle until we reach
+ // either the end of the list, or a snapshot handle.
+ while (next && !next->is_snapshot_) {
+ to_delete.push_back(next);
+ next = next->dq_next_;
+ }
+ } else {
+ // Another CordzHandle existed before this one, don't delete anything.
+ dq_prev_->dq_next_ = next;
+ }
+ if (next) {
+ next->dq_prev_ = dq_prev_;
+ } else {
+ queue_->dq_tail.store(dq_prev_, std::memory_order_release);
+ }
+ }
+ for (CordzHandle* handle : to_delete) {
+ delete handle;
+ }
+ }
+}
+
+bool CordzHandle::SafeToDelete() const {
+ return is_snapshot_ || queue_->IsEmpty();
+}
+
+void CordzHandle::Delete(CordzHandle* handle) {
+ assert(handle);
+ if (handle) {
+ handle->ODRCheck();
+ Queue* const queue = handle->queue_;
+ if (!handle->SafeToDelete()) {
+ SpinLockHolder lock(&queue->mutex);
+ CordzHandle* dq_tail = queue->dq_tail.load(std::memory_order_acquire);
+ if (dq_tail != nullptr) {
+ handle->dq_prev_ = dq_tail;
+ dq_tail->dq_next_ = handle;
+ queue->dq_tail.store(handle, std::memory_order_release);
+ return;
+ }
+ }
+ delete handle;
+ }
+}
+
+std::vector<const CordzHandle*> CordzHandle::DiagnosticsGetDeleteQueue() {
+ std::vector<const CordzHandle*> handles;
+ SpinLockHolder lock(&global_queue_.mutex);
+ CordzHandle* dq_tail = global_queue_.dq_tail.load(std::memory_order_acquire);
+ for (const CordzHandle* p = dq_tail; p; p = p->dq_prev_) {
+ handles.push_back(p);
+ }
+ return handles;
+}
+
+bool CordzHandle::DiagnosticsHandleIsSafeToInspect(
+ const CordzHandle* handle) const {
+ ODRCheck();
+ if (!is_snapshot_) return false;
+ if (handle == nullptr) return true;
+ if (handle->is_snapshot_) return false;
+ bool snapshot_found = false;
+ SpinLockHolder lock(&queue_->mutex);
+ for (const CordzHandle* p = queue_->dq_tail; p; p = p->dq_prev_) {
+ if (p == handle) return !snapshot_found;
+ if (p == this) snapshot_found = true;
+ }
+ ABSL_ASSERT(snapshot_found); // Assert that 'this' is in delete queue.
+ return true;
+}
+
+std::vector<const CordzHandle*>
+CordzHandle::DiagnosticsGetSafeToInspectDeletedHandles() {
+ ODRCheck();
+ std::vector<const CordzHandle*> handles;
+ if (!is_snapshot()) {
+ return handles;
+ }
+
+ SpinLockHolder lock(&queue_->mutex);
+ for (const CordzHandle* p = dq_next_; p != nullptr; p = p->dq_next_) {
+ if (!p->is_snapshot()) {
+ handles.push_back(p);
+ }
+ }
+ return handles;
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h
new file mode 100644
index 00000000..5df53c78
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h
@@ -0,0 +1,131 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_CORDZ_HANDLE_H_
+#define ABSL_STRINGS_CORDZ_HANDLE_H_
+
+#include <atomic>
+#include <vector>
+
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/base/internal/spinlock.h"
+#include "absl/synchronization/mutex.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// This base class allows multiple types of object (CordzInfo and
+// CordzSampleToken) to exist simultaneously on the delete queue (pointed to by
+// global_dq_tail and traversed using dq_prev_ and dq_next_). The
+// delete queue guarantees that once a profiler creates a CordzSampleToken and
+// has gained visibility into a CordzInfo object, that CordzInfo object will not
+// be deleted prematurely. This allows the profiler to inspect all CordzInfo
+// objects that are alive without needing to hold a global lock.
+class CordzHandle {
+ public:
+ CordzHandle() : CordzHandle(false) {}
+
+ bool is_snapshot() const { return is_snapshot_; }
+
+ // Returns true if this instance is safe to be deleted because it is either a
+ // snapshot, which is always safe to delete, or not included in the global
+ // delete queue and thus not included in any snapshot.
+ // Callers are responsible for making sure this instance can not be newly
+ // discovered by other threads. For example, CordzInfo instances first de-list
+ // themselves from the global CordzInfo list before determining if they are
+ // safe to be deleted directly.
+ // If SafeToDelete returns false, callers MUST use the Delete() method to
+ // safely queue CordzHandle instances for deletion.
+ bool SafeToDelete() const;
+
+ // Deletes the provided instance, or puts it on the delete queue to be deleted
+ // once there are no more sample tokens (snapshot) instances potentially
+ // referencing the instance. `handle` should not be null.
+ static void Delete(CordzHandle* handle);
+
+ // Returns the current entries in the delete queue in LIFO order.
+ static std::vector<const CordzHandle*> DiagnosticsGetDeleteQueue();
+
+ // Returns true if the provided handle is nullptr or guarded by this handle.
+ // Since the CordzSnapshot token is itself a CordzHandle, this method will
+ // allow tests to check if that token is keeping an arbitrary CordzHandle
+ // alive.
+ bool DiagnosticsHandleIsSafeToInspect(const CordzHandle* handle) const;
+
+ // Returns the current entries in the delete queue, in LIFO order, that are
+ // protected by this. CordzHandle objects are only placed on the delete queue
+ // after CordzHandle::Delete is called with them as an argument. Only
+ // CordzHandle objects that are not also CordzSnapshot objects will be
+ // included in the return vector. For each of the handles in the return
+ // vector, the earliest that their memory can be freed is when this
+ // CordzSnapshot object is deleted.
+ std::vector<const CordzHandle*> DiagnosticsGetSafeToInspectDeletedHandles();
+
+ protected:
+ explicit CordzHandle(bool is_snapshot);
+ virtual ~CordzHandle();
+
+ private:
+ // Global queue data. CordzHandle stores a pointer to the global queue
+ // instance to harden against ODR violations.
+ struct Queue {
+ constexpr explicit Queue(absl::ConstInitType)
+ : mutex(absl::kConstInit,
+ absl::base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL) {}
+
+ absl::base_internal::SpinLock mutex;
+ std::atomic<CordzHandle*> dq_tail ABSL_GUARDED_BY(mutex){nullptr};
+
+ // Returns true if this delete queue is empty. This method does not acquire
+ // the lock, but does a 'load acquire' observation on the delete queue tail.
+ // It is used inside Delete() to check for the presence of a delete queue
+ // without holding the lock. The assumption is that the caller is in the
+ // state of 'being deleted', and can not be newly discovered by a concurrent
+ // 'being constructed' snapshot instance. Practically, this means that any
+ // such discovery (`find`, 'first' or 'next', etc) must have proper 'happens
+ // before / after' semantics and atomic fences.
+ bool IsEmpty() const ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ return dq_tail.load(std::memory_order_acquire) == nullptr;
+ }
+ };
+
+ void ODRCheck() const {
+#ifndef NDEBUG
+ ABSL_RAW_CHECK(queue_ == &global_queue_, "ODR violation in Cord");
+#endif
+ }
+
+ ABSL_CONST_INIT static Queue global_queue_;
+ Queue* const queue_ = &global_queue_;
+ const bool is_snapshot_;
+
+ // dq_prev_ and dq_next_ require the global queue mutex to be held.
+ // Unfortunately we can't use thread annotations such that the thread safety
+ // analysis understands that queue_ and global_queue_ are one and the same.
+ CordzHandle* dq_prev_ = nullptr;
+ CordzHandle* dq_next_ = nullptr;
+};
+
+class CordzSnapshot : public CordzHandle {
+ public:
+ CordzSnapshot() : CordzHandle(true) {}
+};
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_CORDZ_HANDLE_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle_test.cc
new file mode 100644
index 00000000..fd68e06b
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_handle_test.cc
@@ -0,0 +1,265 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_handle.h"
+
+#include <random>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/memory/memory.h"
+#include "absl/synchronization/internal/thread_pool.h"
+#include "absl/synchronization/notification.h"
+#include "absl/time/clock.h"
+#include "absl/time/time.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::ElementsAre;
+using ::testing::Gt;
+using ::testing::IsEmpty;
+using ::testing::SizeIs;
+
+// Local less verbose helper
+std::vector<const CordzHandle*> DeleteQueue() {
+ return CordzHandle::DiagnosticsGetDeleteQueue();
+}
+
+struct CordzHandleDeleteTracker : public CordzHandle {
+ bool* deleted;
+ explicit CordzHandleDeleteTracker(bool* deleted) : deleted(deleted) {}
+ ~CordzHandleDeleteTracker() override { *deleted = true; }
+};
+
+TEST(CordzHandleTest, DeleteQueueIsEmpty) {
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+}
+
+TEST(CordzHandleTest, CordzHandleCreateDelete) {
+ bool deleted = false;
+ auto* handle = new CordzHandleDeleteTracker(&deleted);
+ EXPECT_FALSE(handle->is_snapshot());
+ EXPECT_TRUE(handle->SafeToDelete());
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+
+ CordzHandle::Delete(handle);
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+ EXPECT_TRUE(deleted);
+}
+
+TEST(CordzHandleTest, CordzSnapshotCreateDelete) {
+ auto* snapshot = new CordzSnapshot();
+ EXPECT_TRUE(snapshot->is_snapshot());
+ EXPECT_TRUE(snapshot->SafeToDelete());
+ EXPECT_THAT(DeleteQueue(), ElementsAre(snapshot));
+ delete snapshot;
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+}
+
+TEST(CordzHandleTest, CordzHandleCreateDeleteWithSnapshot) {
+ bool deleted = false;
+ auto* snapshot = new CordzSnapshot();
+ auto* handle = new CordzHandleDeleteTracker(&deleted);
+ EXPECT_FALSE(handle->SafeToDelete());
+
+ CordzHandle::Delete(handle);
+ EXPECT_THAT(DeleteQueue(), ElementsAre(handle, snapshot));
+ EXPECT_FALSE(deleted);
+ EXPECT_FALSE(handle->SafeToDelete());
+
+ delete snapshot;
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+ EXPECT_TRUE(deleted);
+}
+
+TEST(CordzHandleTest, MultiSnapshot) {
+ bool deleted[3] = {false, false, false};
+
+ CordzSnapshot* snapshot[3];
+ CordzHandleDeleteTracker* handle[3];
+ for (int i = 0; i < 3; ++i) {
+ snapshot[i] = new CordzSnapshot();
+ handle[i] = new CordzHandleDeleteTracker(&deleted[i]);
+ CordzHandle::Delete(handle[i]);
+ }
+
+ EXPECT_THAT(DeleteQueue(), ElementsAre(handle[2], snapshot[2], handle[1],
+ snapshot[1], handle[0], snapshot[0]));
+ EXPECT_THAT(deleted, ElementsAre(false, false, false));
+
+ delete snapshot[1];
+ EXPECT_THAT(DeleteQueue(), ElementsAre(handle[2], snapshot[2], handle[1],
+ handle[0], snapshot[0]));
+ EXPECT_THAT(deleted, ElementsAre(false, false, false));
+
+ delete snapshot[0];
+ EXPECT_THAT(DeleteQueue(), ElementsAre(handle[2], snapshot[2]));
+ EXPECT_THAT(deleted, ElementsAre(true, true, false));
+
+ delete snapshot[2];
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+ EXPECT_THAT(deleted, ElementsAre(true, true, deleted));
+}
+
+TEST(CordzHandleTest, DiagnosticsHandleIsSafeToInspect) {
+ CordzSnapshot snapshot1;
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(nullptr));
+
+ auto* handle1 = new CordzHandle();
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(handle1));
+
+ CordzHandle::Delete(handle1);
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(handle1));
+
+ CordzSnapshot snapshot2;
+ auto* handle2 = new CordzHandle();
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(handle1));
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(handle2));
+ EXPECT_FALSE(snapshot2.DiagnosticsHandleIsSafeToInspect(handle1));
+ EXPECT_TRUE(snapshot2.DiagnosticsHandleIsSafeToInspect(handle2));
+
+ CordzHandle::Delete(handle2);
+ EXPECT_TRUE(snapshot1.DiagnosticsHandleIsSafeToInspect(handle1));
+}
+
+TEST(CordzHandleTest, DiagnosticsGetSafeToInspectDeletedHandles) {
+ EXPECT_THAT(DeleteQueue(), IsEmpty());
+
+ auto* handle = new CordzHandle();
+ auto* snapshot1 = new CordzSnapshot();
+
+ // snapshot1 should be able to see handle.
+ EXPECT_THAT(DeleteQueue(), ElementsAre(snapshot1));
+ EXPECT_TRUE(snapshot1->DiagnosticsHandleIsSafeToInspect(handle));
+ EXPECT_THAT(snapshot1->DiagnosticsGetSafeToInspectDeletedHandles(),
+ IsEmpty());
+
+ // This handle will be safe to inspect as long as snapshot1 is alive. However,
+ // since only snapshot1 can prove that it's alive, it will be hidden from
+ // snapshot2.
+ CordzHandle::Delete(handle);
+
+ // This snapshot shouldn't be able to see handle because handle was already
+ // sent to Delete.
+ auto* snapshot2 = new CordzSnapshot();
+
+ // DeleteQueue elements are LIFO order.
+ EXPECT_THAT(DeleteQueue(), ElementsAre(snapshot2, handle, snapshot1));
+
+ EXPECT_TRUE(snapshot1->DiagnosticsHandleIsSafeToInspect(handle));
+ EXPECT_FALSE(snapshot2->DiagnosticsHandleIsSafeToInspect(handle));
+
+ EXPECT_THAT(snapshot1->DiagnosticsGetSafeToInspectDeletedHandles(),
+ ElementsAre(handle));
+ EXPECT_THAT(snapshot2->DiagnosticsGetSafeToInspectDeletedHandles(),
+ IsEmpty());
+
+ CordzHandle::Delete(snapshot1);
+ EXPECT_THAT(DeleteQueue(), ElementsAre(snapshot2));
+
+ CordzHandle::Delete(snapshot2);
+ EXPECT_THAT(DeleteQueue(), IsEmpty());
+}
+
+// Create and delete CordzHandle and CordzSnapshot objects in multiple threads
+// so that tsan has some time to chew on it and look for memory problems.
+TEST(CordzHandleTest, MultiThreaded) {
+ Notification stop;
+ static constexpr int kNumThreads = 4;
+ // Keep the number of handles relatively small so that the test will naturally
+ // transition to an empty delete queue during the test. If there are, say, 100
+ // handles, that will virtually never happen. With 10 handles and around 50k
+ // iterations in each of 4 threads, the delete queue appears to become empty
+ // around 200 times.
+ static constexpr int kNumHandles = 10;
+
+ // Each thread is going to pick a random index and atomically swap its
+ // CordzHandle with one in handles. This way, each thread can avoid
+ // manipulating a CordzHandle that might be operated upon in another thread.
+ std::vector<std::atomic<CordzHandle*>> handles(kNumHandles);
+
+ // global bool which is set when any thread did get some 'safe to inspect'
+ // handles. On some platforms and OSS tests, we might risk that some pool
+ // threads are starved, stalled, or just got a few unlikely random 'handle'
+ // coin tosses, so we satisfy this test with simply observing 'some' thread
+ // did something meaningful, which should minimize the potential for flakes.
+ std::atomic<bool> found_safe_to_inspect(false);
+
+ {
+ absl::synchronization_internal::ThreadPool pool(kNumThreads);
+ for (int i = 0; i < kNumThreads; ++i) {
+ pool.Schedule([&stop, &handles, &found_safe_to_inspect]() {
+ std::minstd_rand gen;
+ std::uniform_int_distribution<int> dist_type(0, 2);
+ std::uniform_int_distribution<int> dist_handle(0, kNumHandles - 1);
+
+ while (!stop.HasBeenNotified()) {
+ CordzHandle* handle;
+ switch (dist_type(gen)) {
+ case 0:
+ handle = new CordzHandle();
+ break;
+ case 1:
+ handle = new CordzSnapshot();
+ break;
+ default:
+ handle = nullptr;
+ break;
+ }
+ CordzHandle* old_handle = handles[dist_handle(gen)].exchange(handle);
+ if (old_handle != nullptr) {
+ std::vector<const CordzHandle*> safe_to_inspect =
+ old_handle->DiagnosticsGetSafeToInspectDeletedHandles();
+ for (const CordzHandle* handle : safe_to_inspect) {
+ // We're in a tight loop, so don't generate too many error
+ // messages.
+ ASSERT_FALSE(handle->is_snapshot());
+ }
+ if (!safe_to_inspect.empty()) {
+ found_safe_to_inspect.store(true);
+ }
+ CordzHandle::Delete(old_handle);
+ }
+ }
+
+ // Have each thread attempt to clean up everything. Some thread will be
+ // the last to reach this cleanup code, and it will be guaranteed to
+ // clean up everything because nothing remains to create new handles.
+ for (auto& h : handles) {
+ if (CordzHandle* handle = h.exchange(nullptr)) {
+ CordzHandle::Delete(handle);
+ }
+ }
+ });
+ }
+
+ // The threads will hammer away. Give it a little bit of time for tsan to
+ // spot errors.
+ absl::SleepFor(absl::Seconds(3));
+ stop.Notify();
+ }
+
+ // Confirm that the test did *something*. This check will be satisfied as
+ // long as any thread has deleted a CordzSnapshot object and a non-snapshot
+ // CordzHandle was deleted after the CordzSnapshot was created.
+ // See also comments on `found_safe_to_inspect`
+ EXPECT_TRUE(found_safe_to_inspect.load());
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc
new file mode 100644
index 00000000..5c18bbc5
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc
@@ -0,0 +1,445 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_info.h"
+
+#include "absl/base/config.h"
+#include "absl/base/internal/spinlock.h"
+#include "absl/container/inlined_vector.h"
+#include "absl/debugging/stacktrace.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_ring.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/synchronization/mutex.h"
+#include "absl/types/span.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+using ::absl::base_internal::SpinLockHolder;
+
+constexpr int CordzInfo::kMaxStackDepth;
+
+ABSL_CONST_INIT CordzInfo::List CordzInfo::global_list_{absl::kConstInit};
+
+namespace {
+
+// CordRepAnalyzer performs the analysis of a cord.
+//
+// It computes absolute node counts and total memory usage, and an 'estimated
+// fair share memory usage` statistic.
+// Conceptually, it divides the 'memory usage' at each location in the 'cord
+// graph' by the cumulative reference count of that location. The cumulative
+// reference count is the factored total of all edges leading into that node.
+//
+// The top level node is treated specially: we assume the current thread
+// (typically called from the CordzHandler) to hold a reference purely to
+// perform a safe analysis, and not being part of the application. So we
+// substract 1 from the reference count of the top node to compute the
+// 'application fair share' excluding the reference of the current thread.
+//
+// An example of fair sharing, and why we multiply reference counts:
+// Assume we have 2 CordReps, both being a Substring referencing a Flat:
+// CordSubstring A (refcount = 5) --> child Flat C (refcount = 2)
+// CordSubstring B (refcount = 9) --> child Flat C (refcount = 2)
+//
+// Flat C has 2 incoming edges from the 2 substrings (refcount = 2) and is not
+// referenced directly anywhere else. Translated into a 'fair share', we then
+// attribute 50% of the memory (memory / refcount = 2) to each incoming edge.
+// Rep A has a refcount of 5, so we attribute each incoming edge 1 / 5th of the
+// memory cost below it, i.e.: the fair share of Rep A of the memory used by C
+// is then 'memory C / (refcount C * refcount A) + (memory A / refcount A)'.
+// It is also easy to see how all incoming edges add up to 100%.
+class CordRepAnalyzer {
+ public:
+ // Creates an analyzer instance binding to `statistics`.
+ explicit CordRepAnalyzer(CordzStatistics& statistics)
+ : statistics_(statistics) {}
+
+ // Analyzes the memory statistics and node counts for the provided `rep`, and
+ // adds the results to `statistics`. Note that node counts and memory sizes
+ // are not initialized, computed values are added to any existing values.
+ void AnalyzeCordRep(const CordRep* rep) {
+ // Process all linear nodes.
+ // As per the class comments, use refcout - 1 on the top level node, as the
+ // top level node is assumed to be referenced only for analysis purposes.
+ size_t refcount = rep->refcount.Get();
+ RepRef repref{rep, (refcount > 1) ? refcount - 1 : 1};
+
+ // Process all top level linear nodes (substrings and flats).
+ repref = CountLinearReps(repref, memory_usage_);
+
+ if (repref.rep != nullptr) {
+ if (repref.rep->tag == RING) {
+ AnalyzeRing(repref);
+ } else if (repref.rep->tag == BTREE) {
+ AnalyzeBtree(repref);
+ } else if (repref.rep->tag == CONCAT) {
+ AnalyzeConcat(repref);
+ } else {
+ // We should have either a concat, btree, or ring node if not null.
+ assert(false);
+ }
+ }
+
+ // Adds values to output
+ statistics_.estimated_memory_usage += memory_usage_.total;
+ statistics_.estimated_fair_share_memory_usage +=
+ static_cast<size_t>(memory_usage_.fair_share);
+ }
+
+ private:
+ // RepRef identifies a CordRep* inside the Cord tree with its cumulative
+ // refcount including itself. For example, a tree consisting of a substring
+ // with a refcount of 3 and a child flat with a refcount of 4 will have RepRef
+ // refcounts of 3 and 12 respectively.
+ struct RepRef {
+ const CordRep* rep;
+ size_t refcount;
+
+ // Returns a 'child' RepRef which contains the cumulative reference count of
+ // this instance multiplied by the child's reference count.
+ RepRef Child(const CordRep* child) const {
+ return RepRef{child, refcount * child->refcount.Get()};
+ }
+ };
+
+ // Memory usage values
+ struct MemoryUsage {
+ size_t total = 0;
+ double fair_share = 0.0;
+
+ // Adds 'size` memory usage to this class, with a cumulative (recursive)
+ // reference count of `refcount`
+ void Add(size_t size, size_t refcount) {
+ total += size;
+ fair_share += static_cast<double>(size) / refcount;
+ }
+ };
+
+ // Returns `rr` if `rr.rep` is not null and a CONCAT type.
+ // Asserts that `rr.rep` is a concat node or null.
+ static RepRef AssertConcat(RepRef repref) {
+ const CordRep* rep = repref.rep;
+ assert(rep == nullptr || rep->tag == CONCAT);
+ return (rep != nullptr && rep->tag == CONCAT) ? repref : RepRef{nullptr, 0};
+ }
+
+ // Counts a flat of the provide allocated size
+ void CountFlat(size_t size) {
+ statistics_.node_count++;
+ statistics_.node_counts.flat++;
+ if (size <= 64) {
+ statistics_.node_counts.flat_64++;
+ } else if (size <= 128) {
+ statistics_.node_counts.flat_128++;
+ } else if (size <= 256) {
+ statistics_.node_counts.flat_256++;
+ } else if (size <= 512) {
+ statistics_.node_counts.flat_512++;
+ } else if (size <= 1024) {
+ statistics_.node_counts.flat_1k++;
+ }
+ }
+
+ // Processes 'linear' reps (substring, flat, external) not requiring iteration
+ // or recursion. Returns RefRep{null} if all reps were processed, else returns
+ // the top-most non-linear concat or ring cordrep.
+ // Node counts are updated into `statistics_`, memory usage is update into
+ // `memory_usage`, which typically references `memory_usage_` except for ring
+ // buffers where we count children unrounded.
+ RepRef CountLinearReps(RepRef rep, MemoryUsage& memory_usage) {
+ // Consume all substrings
+ while (rep.rep->tag == SUBSTRING) {
+ statistics_.node_count++;
+ statistics_.node_counts.substring++;
+ memory_usage.Add(sizeof(CordRepSubstring), rep.refcount);
+ rep = rep.Child(rep.rep->substring()->child);
+ }
+
+ // Consume possible FLAT
+ if (rep.rep->tag >= FLAT) {
+ size_t size = rep.rep->flat()->AllocatedSize();
+ CountFlat(size);
+ memory_usage.Add(size, rep.refcount);
+ return RepRef{nullptr, 0};
+ }
+
+ // Consume possible external
+ if (rep.rep->tag == EXTERNAL) {
+ statistics_.node_count++;
+ statistics_.node_counts.external++;
+ size_t size = rep.rep->length + sizeof(CordRepExternalImpl<intptr_t>);
+ memory_usage.Add(size, rep.refcount);
+ return RepRef{nullptr, 0};
+ }
+
+ return rep;
+ }
+
+ // Analyzes the provided concat node in a flattened recursive way.
+ void AnalyzeConcat(RepRef rep) {
+ absl::InlinedVector<RepRef, 47> pending;
+
+ while (rep.rep != nullptr) {
+ const CordRepConcat* concat = rep.rep->concat();
+ RepRef left = rep.Child(concat->left);
+ RepRef right = rep.Child(concat->right);
+
+ statistics_.node_count++;
+ statistics_.node_counts.concat++;
+ memory_usage_.Add(sizeof(CordRepConcat), rep.refcount);
+
+ right = AssertConcat(CountLinearReps(right, memory_usage_));
+ rep = AssertConcat(CountLinearReps(left, memory_usage_));
+ if (rep.rep != nullptr) {
+ if (right.rep != nullptr) {
+ pending.push_back(right);
+ }
+ } else if (right.rep != nullptr) {
+ rep = right;
+ } else if (!pending.empty()) {
+ rep = pending.back();
+ pending.pop_back();
+ }
+ }
+ }
+
+ // Analyzes the provided ring.
+ void AnalyzeRing(RepRef rep) {
+ statistics_.node_count++;
+ statistics_.node_counts.ring++;
+ const CordRepRing* ring = rep.rep->ring();
+ memory_usage_.Add(CordRepRing::AllocSize(ring->capacity()), rep.refcount);
+ ring->ForEach([&](CordRepRing::index_type pos) {
+ CountLinearReps(rep.Child(ring->entry_child(pos)), memory_usage_);
+ });
+ }
+
+ // Analyzes the provided btree.
+ void AnalyzeBtree(RepRef rep) {
+ statistics_.node_count++;
+ statistics_.node_counts.btree++;
+ memory_usage_.Add(sizeof(CordRepBtree), rep.refcount);
+ const CordRepBtree* tree = rep.rep->btree();
+ if (tree->height() > 0) {
+ for (CordRep* edge : tree->Edges()) {
+ AnalyzeBtree(rep.Child(edge));
+ }
+ } else {
+ for (CordRep* edge : tree->Edges()) {
+ CountLinearReps(rep.Child(edge), memory_usage_);
+ }
+ }
+ }
+
+ CordzStatistics& statistics_;
+ MemoryUsage memory_usage_;
+};
+
+} // namespace
+
+CordzInfo* CordzInfo::Head(const CordzSnapshot& snapshot) {
+ ABSL_ASSERT(snapshot.is_snapshot());
+
+ // We can do an 'unsafe' load of 'head', as we are guaranteed that the
+ // instance it points to is kept alive by the provided CordzSnapshot, so we
+ // can simply return the current value using an acquire load.
+ // We do enforce in DEBUG builds that the 'head' value is present in the
+ // delete queue: ODR violations may lead to 'snapshot' and 'global_list_'
+ // being in different libraries / modules.
+ CordzInfo* head = global_list_.head.load(std::memory_order_acquire);
+ ABSL_ASSERT(snapshot.DiagnosticsHandleIsSafeToInspect(head));
+ return head;
+}
+
+CordzInfo* CordzInfo::Next(const CordzSnapshot& snapshot) const {
+ ABSL_ASSERT(snapshot.is_snapshot());
+
+ // Similar to the 'Head()' function, we do not need a mutex here.
+ CordzInfo* next = ci_next_.load(std::memory_order_acquire);
+ ABSL_ASSERT(snapshot.DiagnosticsHandleIsSafeToInspect(this));
+ ABSL_ASSERT(snapshot.DiagnosticsHandleIsSafeToInspect(next));
+ return next;
+}
+
+void CordzInfo::TrackCord(InlineData& cord, MethodIdentifier method) {
+ assert(cord.is_tree());
+ assert(!cord.is_profiled());
+ CordzInfo* cordz_info = new CordzInfo(cord.as_tree(), nullptr, method);
+ cord.set_cordz_info(cordz_info);
+ cordz_info->Track();
+}
+
+void CordzInfo::TrackCord(InlineData& cord, const InlineData& src,
+ MethodIdentifier method) {
+ assert(cord.is_tree());
+ assert(src.is_tree());
+
+ // Unsample current as we the current cord is being replaced with 'src',
+ // so any method history is no longer relevant.
+ CordzInfo* cordz_info = cord.cordz_info();
+ if (cordz_info != nullptr) cordz_info->Untrack();
+
+ // Start new cord sample
+ cordz_info = new CordzInfo(cord.as_tree(), src.cordz_info(), method);
+ cord.set_cordz_info(cordz_info);
+ cordz_info->Track();
+}
+
+void CordzInfo::MaybeTrackCordImpl(InlineData& cord, const InlineData& src,
+ MethodIdentifier method) {
+ if (src.is_profiled()) {
+ TrackCord(cord, src, method);
+ } else if (cord.is_profiled()) {
+ cord.cordz_info()->Untrack();
+ cord.clear_cordz_info();
+ }
+}
+
+CordzInfo::MethodIdentifier CordzInfo::GetParentMethod(const CordzInfo* src) {
+ if (src == nullptr) return MethodIdentifier::kUnknown;
+ return src->parent_method_ != MethodIdentifier::kUnknown ? src->parent_method_
+ : src->method_;
+}
+
+int CordzInfo::FillParentStack(const CordzInfo* src, void** stack) {
+ assert(stack);
+ if (src == nullptr) return 0;
+ if (src->parent_stack_depth_) {
+ memcpy(stack, src->parent_stack_, src->parent_stack_depth_ * sizeof(void*));
+ return src->parent_stack_depth_;
+ }
+ memcpy(stack, src->stack_, src->stack_depth_ * sizeof(void*));
+ return src->stack_depth_;
+}
+
+CordzInfo::CordzInfo(CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method)
+ : rep_(rep),
+ stack_depth_(absl::GetStackTrace(stack_, /*max_depth=*/kMaxStackDepth,
+ /*skip_count=*/1)),
+ parent_stack_depth_(FillParentStack(src, parent_stack_)),
+ method_(method),
+ parent_method_(GetParentMethod(src)),
+ create_time_(absl::Now()) {
+ update_tracker_.LossyAdd(method);
+ if (src) {
+ // Copy parent counters.
+ update_tracker_.LossyAdd(src->update_tracker_);
+ }
+}
+
+CordzInfo::~CordzInfo() {
+ // `rep_` is potentially kept alive if CordzInfo is included
+ // in a collection snapshot (which should be rare).
+ if (ABSL_PREDICT_FALSE(rep_)) {
+ CordRep::Unref(rep_);
+ }
+}
+
+void CordzInfo::Track() {
+ SpinLockHolder l(&list_->mutex);
+
+ CordzInfo* const head = list_->head.load(std::memory_order_acquire);
+ if (head != nullptr) {
+ head->ci_prev_.store(this, std::memory_order_release);
+ }
+ ci_next_.store(head, std::memory_order_release);
+ list_->head.store(this, std::memory_order_release);
+}
+
+void CordzInfo::Untrack() {
+ ODRCheck();
+ {
+ SpinLockHolder l(&list_->mutex);
+
+ CordzInfo* const head = list_->head.load(std::memory_order_acquire);
+ CordzInfo* const next = ci_next_.load(std::memory_order_acquire);
+ CordzInfo* const prev = ci_prev_.load(std::memory_order_acquire);
+
+ if (next) {
+ ABSL_ASSERT(next->ci_prev_.load(std::memory_order_acquire) == this);
+ next->ci_prev_.store(prev, std::memory_order_release);
+ }
+ if (prev) {
+ ABSL_ASSERT(head != this);
+ ABSL_ASSERT(prev->ci_next_.load(std::memory_order_acquire) == this);
+ prev->ci_next_.store(next, std::memory_order_release);
+ } else {
+ ABSL_ASSERT(head == this);
+ list_->head.store(next, std::memory_order_release);
+ }
+ }
+
+ // We can no longer be discovered: perform a fast path check if we are not
+ // listed on any delete queue, so we can directly delete this instance.
+ if (SafeToDelete()) {
+ UnsafeSetCordRep(nullptr);
+ delete this;
+ return;
+ }
+
+ // We are likely part of a snapshot, extend the life of the CordRep
+ {
+ absl::MutexLock lock(&mutex_);
+ if (rep_) CordRep::Ref(rep_);
+ }
+ CordzHandle::Delete(this);
+}
+
+void CordzInfo::Lock(MethodIdentifier method)
+ ABSL_EXCLUSIVE_LOCK_FUNCTION(mutex_) {
+ mutex_.Lock();
+ update_tracker_.LossyAdd(method);
+ assert(rep_);
+}
+
+void CordzInfo::Unlock() ABSL_UNLOCK_FUNCTION(mutex_) {
+ bool tracked = rep_ != nullptr;
+ mutex_.Unlock();
+ if (!tracked) {
+ Untrack();
+ }
+}
+
+absl::Span<void* const> CordzInfo::GetStack() const {
+ return absl::MakeConstSpan(stack_, stack_depth_);
+}
+
+absl::Span<void* const> CordzInfo::GetParentStack() const {
+ return absl::MakeConstSpan(parent_stack_, parent_stack_depth_);
+}
+
+CordzStatistics CordzInfo::GetCordzStatistics() const {
+ CordzStatistics stats;
+ stats.method = method_;
+ stats.parent_method = parent_method_;
+ stats.update_tracker = update_tracker_;
+ if (CordRep* rep = RefCordRep()) {
+ stats.size = rep->length;
+ CordRepAnalyzer analyzer(stats);
+ analyzer.AnalyzeCordRep(rep);
+ CordRep::Unref(rep);
+ }
+ return stats;
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.h
new file mode 100644
index 00000000..026d5b99
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info.h
@@ -0,0 +1,298 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_CORDZ_INFO_H_
+#define ABSL_STRINGS_CORDZ_INFO_H_
+
+#include <atomic>
+#include <cstdint>
+#include <functional>
+
+#include "absl/base/config.h"
+#include "absl/base/internal/raw_logging.h"
+#include "absl/base/internal/spinlock.h"
+#include "absl/base/thread_annotations.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cordz_functions.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/synchronization/mutex.h"
+#include "absl/types/span.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordzInfo tracks a profiled Cord. Each of these objects can be in two places.
+// If a Cord is alive, the CordzInfo will be in the global_cordz_infos map, and
+// can also be retrieved via the linked list starting with
+// global_cordz_infos_head and continued via the cordz_info_next() method. When
+// a Cord has reached the end of its lifespan, the CordzInfo object will be
+// migrated out of the global_cordz_infos list and the global_cordz_infos_map,
+// and will either be deleted or appended to the global_delete_queue. If it is
+// placed on the global_delete_queue, the CordzInfo object will be cleaned in
+// the destructor of a CordzSampleToken object.
+class ABSL_LOCKABLE CordzInfo : public CordzHandle {
+ public:
+ using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+
+ // TrackCord creates a CordzInfo instance which tracks important metrics of
+ // a sampled cord, and stores the created CordzInfo instance into `cord'. All
+ // CordzInfo instances are placed in a global list which is used to discover
+ // and snapshot all actively tracked cords. Callers are responsible for
+ // calling UntrackCord() before the tracked Cord instance is deleted, or to
+ // stop tracking the sampled Cord. Callers are also responsible for guarding
+ // changes to the 'tree' value of a Cord (InlineData.tree) through the Lock()
+ // and Unlock() calls. Any change resulting in a new tree value for the cord
+ // requires a call to SetCordRep() before the old tree has been unreffed
+ // and/or deleted. `method` identifies the Cord public API method initiating
+ // the cord to be sampled.
+ // Requires `cord` to hold a tree, and `cord.cordz_info()` to be null.
+ static void TrackCord(InlineData& cord, MethodIdentifier method);
+
+ // Identical to TrackCord(), except that this function fills the
+ // `parent_stack` and `parent_method` properties of the returned CordzInfo
+ // instance from the provided `src` instance if `src` is sampled.
+ // This function should be used for sampling 'copy constructed' and 'copy
+ // assigned' cords. This function allows 'cord` to be already sampled, in
+ // which case the CordzInfo will be newly created from `src`.
+ static void TrackCord(InlineData& cord, const InlineData& src,
+ MethodIdentifier method);
+
+ // Maybe sample the cord identified by 'cord' for method 'method'.
+ // Uses `cordz_should_profile` to randomly pick cords to be sampled, and if
+ // so, invokes `TrackCord` to start sampling `cord`.
+ static void MaybeTrackCord(InlineData& cord, MethodIdentifier method);
+
+ // Maybe sample the cord identified by 'cord' for method 'method'.
+ // `src` identifies a 'parent' cord which is assigned to `cord`, typically the
+ // input cord for a copy constructor, or an assign method such as `operator=`
+ // `cord` will be sampled if (and only if) `src` is sampled.
+ // If `cord` is currently being sampled and `src` is not being sampled, then
+ // this function will stop sampling the cord and reset the cord's cordz_info.
+ //
+ // Previously this function defined that `cord` will be sampled if either
+ // `src` is sampled, or if `cord` is randomly picked for sampling. However,
+ // this can cause issues, as there may be paths where some cord is assigned an
+ // indirect copy of it's own value. As such a 'string of copies' would then
+ // remain sampled (`src.is_profiled`), then assigning such a cord back to
+ // 'itself' creates a cycle where the cord will converge to 'always sampled`.
+ //
+ // For example:
+ //
+ // Cord x;
+ // for (...) {
+ // // Copy ctor --> y.is_profiled := x.is_profiled | random(...)
+ // Cord y = x;
+ // ...
+ // // Assign x = y --> x.is_profiled = y.is_profiled | random(...)
+ // // ==> x.is_profiled |= random(...)
+ // // ==> x converges to 'always profiled'
+ // x = y;
+ // }
+ static void MaybeTrackCord(InlineData& cord, const InlineData& src,
+ MethodIdentifier method);
+
+ // Stops tracking changes for a sampled cord, and deletes the provided info.
+ // This function must be called before the sampled cord instance is deleted,
+ // and before the root cordrep of the sampled cord is unreffed.
+ // This function may extend the lifetime of the cordrep in cases where the
+ // CordInfo instance is being held by a concurrent collection thread.
+ void Untrack();
+
+ // Invokes UntrackCord() on `info` if `info` is not null.
+ static void MaybeUntrackCord(CordzInfo* info);
+
+ CordzInfo() = delete;
+ CordzInfo(const CordzInfo&) = delete;
+ CordzInfo& operator=(const CordzInfo&) = delete;
+
+ // Retrieves the oldest existing CordzInfo.
+ static CordzInfo* Head(const CordzSnapshot& snapshot)
+ ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ // Retrieves the next oldest existing CordzInfo older than 'this' instance.
+ CordzInfo* Next(const CordzSnapshot& snapshot) const
+ ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ // Locks this instance for the update identified by `method`.
+ // Increases the count for `method` in `update_tracker`.
+ void Lock(MethodIdentifier method) ABSL_EXCLUSIVE_LOCK_FUNCTION(mutex_);
+
+ // Unlocks this instance. If the contained `rep` has been set to null
+ // indicating the Cord has been cleared or is otherwise no longer sampled,
+ // then this method will delete this CordzInfo instance.
+ void Unlock() ABSL_UNLOCK_FUNCTION(mutex_);
+
+ // Asserts that this CordzInfo instance is locked.
+ void AssertHeld() ABSL_ASSERT_EXCLUSIVE_LOCK(mutex_);
+
+ // Updates the `rep` property of this instance. This methods is invoked by
+ // Cord logic each time the root node of a sampled Cord changes, and before
+ // the old root reference count is deleted. This guarantees that collection
+ // code can always safely take a reference on the tracked cord.
+ // Requires a lock to be held through the `Lock()` method.
+ // TODO(b/117940323): annotate with ABSL_EXCLUSIVE_LOCKS_REQUIRED once all
+ // Cord code is in a state where this can be proven true by the compiler.
+ void SetCordRep(CordRep* rep);
+
+ // Returns the current `rep` property of this instance with a reference
+ // added, or null if this instance represents a cord that has since been
+ // deleted or untracked.
+ CordRep* RefCordRep() const ABSL_LOCKS_EXCLUDED(mutex_);
+
+ // Returns the current value of `rep_` for testing purposes only.
+ CordRep* GetCordRepForTesting() const ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ return rep_;
+ }
+
+ // Sets the current value of `rep_` for testing purposes only.
+ void SetCordRepForTesting(CordRep* rep) ABSL_NO_THREAD_SAFETY_ANALYSIS {
+ rep_ = rep;
+ }
+
+ // Returns the stack trace for where the cord was first sampled. Cords are
+ // potentially sampled when they promote from an inlined cord to a tree or
+ // ring representation, which is not necessarily the location where the cord
+ // was first created. Some cords are created as inlined cords, and only as
+ // data is added do they become a non-inlined cord. However, typically the
+ // location represents reasonably well where the cord is 'created'.
+ absl::Span<void* const> GetStack() const;
+
+ // Returns the stack trace for a sampled cord's 'parent stack trace'. This
+ // value may be set if the cord is sampled (promoted) after being created
+ // from, or being assigned the value of an existing (sampled) cord.
+ absl::Span<void* const> GetParentStack() const;
+
+ // Retrieves the CordzStatistics associated with this Cord. The statistics
+ // are only updated when a Cord goes through a mutation, such as an Append
+ // or RemovePrefix.
+ CordzStatistics GetCordzStatistics() const;
+
+ private:
+ using SpinLock = absl::base_internal::SpinLock;
+ using SpinLockHolder = ::absl::base_internal::SpinLockHolder;
+
+ // Global cordz info list. CordzInfo stores a pointer to the global list
+ // instance to harden against ODR violations.
+ struct List {
+ constexpr explicit List(absl::ConstInitType)
+ : mutex(absl::kConstInit,
+ absl::base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL) {}
+
+ SpinLock mutex;
+ std::atomic<CordzInfo*> head ABSL_GUARDED_BY(mutex){nullptr};
+ };
+
+ static constexpr int kMaxStackDepth = 64;
+
+ explicit CordzInfo(CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method);
+ ~CordzInfo() override;
+
+ // Sets `rep_` without holding a lock.
+ void UnsafeSetCordRep(CordRep* rep) ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ void Track();
+
+ // Returns the parent method from `src`, which is either `parent_method_` or
+ // `method_` depending on `parent_method_` being kUnknown.
+ // Returns kUnknown if `src` is null.
+ static MethodIdentifier GetParentMethod(const CordzInfo* src);
+
+ // Fills the provided stack from `src`, copying either `parent_stack_` or
+ // `stack_` depending on `parent_stack_` being empty, returning the size of
+ // the parent stack.
+ // Returns 0 if `src` is null.
+ static int FillParentStack(const CordzInfo* src, void** stack);
+
+ void ODRCheck() const {
+#ifndef NDEBUG
+ ABSL_RAW_CHECK(list_ == &global_list_, "ODR violation in Cord");
+#endif
+ }
+
+ // Non-inlined implementation of `MaybeTrackCord`, which is executed if
+ // either `src` is sampled or `cord` is sampled, and either untracks or
+ // tracks `cord` as documented per `MaybeTrackCord`.
+ static void MaybeTrackCordImpl(InlineData& cord, const InlineData& src,
+ MethodIdentifier method);
+
+ ABSL_CONST_INIT static List global_list_;
+ List* const list_ = &global_list_;
+
+ // ci_prev_ and ci_next_ require the global list mutex to be held.
+ // Unfortunately we can't use thread annotations such that the thread safety
+ // analysis understands that list_ and global_list_ are one and the same.
+ std::atomic<CordzInfo*> ci_prev_{nullptr};
+ std::atomic<CordzInfo*> ci_next_{nullptr};
+
+ mutable absl::Mutex mutex_;
+ CordRep* rep_ ABSL_GUARDED_BY(mutex_);
+
+ void* stack_[kMaxStackDepth];
+ void* parent_stack_[kMaxStackDepth];
+ const int stack_depth_;
+ const int parent_stack_depth_;
+ const MethodIdentifier method_;
+ const MethodIdentifier parent_method_;
+ CordzUpdateTracker update_tracker_;
+ const absl::Time create_time_;
+};
+
+inline ABSL_ATTRIBUTE_ALWAYS_INLINE void CordzInfo::MaybeTrackCord(
+ InlineData& cord, MethodIdentifier method) {
+ if (ABSL_PREDICT_FALSE(cordz_should_profile())) {
+ TrackCord(cord, method);
+ }
+}
+
+inline ABSL_ATTRIBUTE_ALWAYS_INLINE void CordzInfo::MaybeTrackCord(
+ InlineData& cord, const InlineData& src, MethodIdentifier method) {
+ if (ABSL_PREDICT_FALSE(InlineData::is_either_profiled(cord, src))) {
+ MaybeTrackCordImpl(cord, src, method);
+ }
+}
+
+inline ABSL_ATTRIBUTE_ALWAYS_INLINE void CordzInfo::MaybeUntrackCord(
+ CordzInfo* info) {
+ if (ABSL_PREDICT_FALSE(info)) {
+ info->Untrack();
+ }
+}
+
+inline void CordzInfo::AssertHeld() ABSL_ASSERT_EXCLUSIVE_LOCK(mutex_) {
+#ifndef NDEBUG
+ mutex_.AssertHeld();
+#endif
+}
+
+inline void CordzInfo::SetCordRep(CordRep* rep) {
+ AssertHeld();
+ rep_ = rep;
+}
+
+inline void CordzInfo::UnsafeSetCordRep(CordRep* rep) { rep_ = rep; }
+
+inline CordRep* CordzInfo::RefCordRep() const ABSL_LOCKS_EXCLUDED(mutex_) {
+ MutexLock lock(&mutex_);
+ return rep_ ? CordRep::Ref(rep_) : nullptr;
+}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_CORDZ_INFO_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc
new file mode 100644
index 00000000..7430d281
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_statistics_test.cc
@@ -0,0 +1,625 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <iostream>
+#include <random>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/strings/cord.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cord_rep_btree.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/internal/cord_rep_ring.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_sample_token.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_scope.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/synchronization/internal/thread_pool.h"
+#include "absl/synchronization/notification.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// Do not print statistics contents, the matcher prints them as needed.
+inline void PrintTo(const CordzStatistics& stats, std::ostream* s) {
+ if (s) *s << "CordzStatistics{...}";
+}
+
+namespace {
+
+using ::testing::Ge;
+
+// Creates a flat of the specified allocated size
+CordRepFlat* Flat(size_t size) {
+ // Round up to a tag size, as we are going to poke an exact tag size back into
+ // the allocated flat. 'size returning allocators' could grant us more than we
+ // wanted, but we are ok to poke the 'requested' size in the tag, even in the
+ // presence of sized deletes, so we need to make sure the size rounds
+ // perfectly to a tag value.
+ assert(size >= kMinFlatSize);
+ size = RoundUpForTag(size);
+ CordRepFlat* flat = CordRepFlat::New(size - kFlatOverhead);
+ flat->tag = AllocatedSizeToTag(size);
+ flat->length = size - kFlatOverhead;
+ return flat;
+}
+
+// Creates an external of the specified length
+CordRepExternal* External(int length = 512) {
+ return static_cast<CordRepExternal*>(
+ NewExternalRep(absl::string_view("", length), [](absl::string_view) {}));
+}
+
+// Creates a substring on the provided rep of length - 1
+CordRepSubstring* Substring(CordRep* rep) {
+ auto* substring = new CordRepSubstring;
+ substring->length = rep->length - 1;
+ substring->tag = SUBSTRING;
+ substring->child = rep;
+ return substring;
+}
+
+// Creates a concat on the provided reps
+CordRepConcat* Concat(CordRep* left, CordRep* right) {
+ auto* concat = new CordRepConcat;
+ concat->length = left->length + right->length;
+ concat->tag = CONCAT;
+ concat->left = left;
+ concat->right = right;
+ return concat;
+}
+
+// Reference count helper
+struct RefHelper {
+ std::vector<CordRep*> refs;
+
+ ~RefHelper() {
+ for (CordRep* rep : refs) {
+ CordRep::Unref(rep);
+ }
+ }
+
+ // Invokes CordRep::Unref() on `rep` when this instance is destroyed.
+ template <typename T>
+ T* NeedsUnref(T* rep) {
+ refs.push_back(rep);
+ return rep;
+ }
+
+ // Adds `n` reference counts to `rep` which will be unreffed when this
+ // instance is destroyed.
+ template <typename T>
+ T* Ref(T* rep, size_t n = 1) {
+ while (n--) {
+ NeedsUnref(CordRep::Ref(rep));
+ }
+ return rep;
+ }
+};
+
+// Sizeof helper. Returns the allocated size of `p`, excluding any child
+// elements for substring, concat and ring cord reps.
+template <typename T>
+size_t SizeOf(const T* rep) {
+ return sizeof(T);
+}
+
+template <>
+size_t SizeOf(const CordRepFlat* rep) {
+ return rep->AllocatedSize();
+}
+
+template <>
+size_t SizeOf(const CordRepExternal* rep) {
+ // See cord.cc
+ return sizeof(CordRepExternalImpl<intptr_t>) + rep->length;
+}
+
+template <>
+size_t SizeOf(const CordRepRing* rep) {
+ return CordRepRing::AllocSize(rep->capacity());
+}
+
+// Computes fair share memory used in a naive 'we dare to recurse' way.
+double FairShareImpl(CordRep* rep, size_t ref) {
+ double self = 0.0, children = 0.0;
+ ref *= rep->refcount.Get();
+ if (rep->tag >= FLAT) {
+ self = SizeOf(rep->flat());
+ } else if (rep->tag == EXTERNAL) {
+ self = SizeOf(rep->external());
+ } else if (rep->tag == SUBSTRING) {
+ self = SizeOf(rep->substring());
+ children = FairShareImpl(rep->substring()->child, ref);
+ } else if (rep->tag == BTREE) {
+ self = SizeOf(rep->btree());
+ for (CordRep*edge : rep->btree()->Edges()) {
+ children += FairShareImpl(edge, ref);
+ }
+ } else if (rep->tag == RING) {
+ self = SizeOf(rep->ring());
+ rep->ring()->ForEach([&](CordRepRing::index_type i) {
+ self += FairShareImpl(rep->ring()->entry_child(i), 1);
+ });
+ } else if (rep->tag == CONCAT) {
+ self = SizeOf(rep->concat());
+ children = FairShareImpl(rep->concat()->left, ref) +
+ FairShareImpl(rep->concat()->right, ref);
+ } else {
+ assert(false);
+ }
+ return self / ref + children;
+}
+
+// Returns the fair share memory size from `ShareFhareImpl()` as a size_t.
+size_t FairShare(CordRep* rep, size_t ref = 1) {
+ return static_cast<size_t>(FairShareImpl(rep, ref));
+}
+
+// Samples the cord and returns CordzInfo::GetStatistics()
+CordzStatistics SampleCord(CordRep* rep) {
+ InlineData cord(rep);
+ CordzInfo::TrackCord(cord, CordzUpdateTracker::kUnknown);
+ CordzStatistics stats = cord.cordz_info()->GetCordzStatistics();
+ cord.cordz_info()->Untrack();
+ return stats;
+}
+
+MATCHER_P(EqStatistics, stats, "Statistics equal expected values") {
+ bool ok = true;
+
+#define STATS_MATCHER_EXPECT_EQ(member) \
+ if (stats.member != arg.member) { \
+ *result_listener << "\n stats." << #member \
+ << ": actual = " << arg.member << ", expected " \
+ << stats.member; \
+ ok = false; \
+ }
+
+ STATS_MATCHER_EXPECT_EQ(size);
+ STATS_MATCHER_EXPECT_EQ(node_count);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat_64);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat_128);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat_256);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat_512);
+ STATS_MATCHER_EXPECT_EQ(node_counts.flat_1k);
+ STATS_MATCHER_EXPECT_EQ(node_counts.external);
+ STATS_MATCHER_EXPECT_EQ(node_counts.concat);
+ STATS_MATCHER_EXPECT_EQ(node_counts.substring);
+ STATS_MATCHER_EXPECT_EQ(node_counts.ring);
+ STATS_MATCHER_EXPECT_EQ(node_counts.btree);
+ STATS_MATCHER_EXPECT_EQ(estimated_memory_usage);
+ STATS_MATCHER_EXPECT_EQ(estimated_fair_share_memory_usage);
+
+#undef STATS_MATCHER_EXPECT_EQ
+
+ return ok;
+}
+
+TEST(CordzInfoStatisticsTest, Flat) {
+ RefHelper ref;
+ auto* flat = ref.NeedsUnref(Flat(512));
+
+ CordzStatistics expected;
+ expected.size = flat->length;
+ expected.estimated_memory_usage = SizeOf(flat);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+ expected.node_count = 1;
+ expected.node_counts.flat = 1;
+ expected.node_counts.flat_512 = 1;
+
+ EXPECT_THAT(SampleCord(flat), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, SharedFlat) {
+ RefHelper ref;
+ auto* flat = ref.Ref(ref.NeedsUnref(Flat(64)));
+
+ CordzStatistics expected;
+ expected.size = flat->length;
+ expected.estimated_memory_usage = SizeOf(flat);
+ expected.estimated_fair_share_memory_usage = SizeOf(flat) / 2;
+ expected.node_count = 1;
+ expected.node_counts.flat = 1;
+ expected.node_counts.flat_64 = 1;
+
+ EXPECT_THAT(SampleCord(flat), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, External) {
+ RefHelper ref;
+ auto* external = ref.NeedsUnref(External());
+
+ CordzStatistics expected;
+ expected.size = external->length;
+ expected.estimated_memory_usage = SizeOf(external);
+ expected.estimated_fair_share_memory_usage = SizeOf(external);
+ expected.node_count = 1;
+ expected.node_counts.external = 1;
+
+ EXPECT_THAT(SampleCord(external), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, SharedExternal) {
+ RefHelper ref;
+ auto* external = ref.Ref(ref.NeedsUnref(External()));
+
+ CordzStatistics expected;
+ expected.size = external->length;
+ expected.estimated_memory_usage = SizeOf(external);
+ expected.estimated_fair_share_memory_usage = SizeOf(external) / 2;
+ expected.node_count = 1;
+ expected.node_counts.external = 1;
+
+ EXPECT_THAT(SampleCord(external), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, Substring) {
+ RefHelper ref;
+ auto* flat = Flat(1024);
+ auto* substring = ref.NeedsUnref(Substring(flat));
+
+ CordzStatistics expected;
+ expected.size = substring->length;
+ expected.estimated_memory_usage = SizeOf(substring) + SizeOf(flat);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+ expected.node_count = 2;
+ expected.node_counts.flat = 1;
+ expected.node_counts.flat_1k = 1;
+ expected.node_counts.substring = 1;
+
+ EXPECT_THAT(SampleCord(substring), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, SharedSubstring) {
+ RefHelper ref;
+ auto* flat = ref.Ref(Flat(511), 2);
+ auto* substring = ref.Ref(ref.NeedsUnref(Substring(flat)));
+
+ CordzStatistics expected;
+ expected.size = substring->length;
+ expected.estimated_memory_usage = SizeOf(flat) + SizeOf(substring);
+ expected.estimated_fair_share_memory_usage =
+ SizeOf(substring) / 2 + SizeOf(flat) / 6;
+ expected.node_count = 2;
+ expected.node_counts.flat = 1;
+ expected.node_counts.flat_512 = 1;
+ expected.node_counts.substring = 1;
+
+ EXPECT_THAT(SampleCord(substring), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, Concat) {
+ RefHelper ref;
+ auto* flat1 = Flat(300);
+ auto* flat2 = Flat(2000);
+ auto* concat = ref.NeedsUnref(Concat(flat1, flat2));
+
+ CordzStatistics expected;
+ expected.size = concat->length;
+ expected.estimated_memory_usage =
+ SizeOf(concat) + SizeOf(flat1) + SizeOf(flat2);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+ expected.node_count = 3;
+ expected.node_counts.flat = 2;
+ expected.node_counts.flat_512 = 1;
+ expected.node_counts.concat = 1;
+
+ EXPECT_THAT(SampleCord(concat), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, DeepConcat) {
+ RefHelper ref;
+ auto* flat1 = Flat(300);
+ auto* flat2 = Flat(2000);
+ auto* flat3 = Flat(400);
+ auto* external = External(3000);
+ auto* substring = Substring(external);
+ auto* concat1 = Concat(flat1, flat2);
+ auto* concat2 = Concat(flat3, substring);
+ auto* concat = ref.NeedsUnref(Concat(concat1, concat2));
+
+ CordzStatistics expected;
+ expected.size = concat->length;
+ expected.estimated_memory_usage = SizeOf(concat) * 3 + SizeOf(flat1) +
+ SizeOf(flat2) + SizeOf(flat3) +
+ SizeOf(external) + SizeOf(substring);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+
+ expected.node_count = 8;
+ expected.node_counts.flat = 3;
+ expected.node_counts.flat_512 = 2;
+ expected.node_counts.external = 1;
+ expected.node_counts.concat = 3;
+ expected.node_counts.substring = 1;
+
+ EXPECT_THAT(SampleCord(concat), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, DeepSharedConcat) {
+ RefHelper ref;
+ auto* flat1 = Flat(40);
+ auto* flat2 = ref.Ref(Flat(2000), 4);
+ auto* flat3 = Flat(70);
+ auto* external = ref.Ref(External(3000));
+ auto* substring = ref.Ref(Substring(external), 3);
+ auto* concat1 = Concat(flat1, flat2);
+ auto* concat2 = Concat(flat3, substring);
+ auto* concat = ref.Ref(ref.NeedsUnref(Concat(concat1, concat2)));
+
+ CordzStatistics expected;
+ expected.size = concat->length;
+ expected.estimated_memory_usage = SizeOf(concat) * 3 + SizeOf(flat1) +
+ SizeOf(flat2) + SizeOf(flat3) +
+ SizeOf(external) + SizeOf(substring);
+ expected.estimated_fair_share_memory_usage = FairShare(concat);
+ expected.node_count = 8;
+ expected.node_counts.flat = 3;
+ expected.node_counts.flat_64 = 1;
+ expected.node_counts.flat_128 = 1;
+ expected.node_counts.external = 1;
+ expected.node_counts.concat = 3;
+ expected.node_counts.substring = 1;
+
+ EXPECT_THAT(SampleCord(concat), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, Ring) {
+ RefHelper ref;
+ auto* flat1 = Flat(240);
+ auto* flat2 = Flat(2000);
+ auto* flat3 = Flat(70);
+ auto* external = External(3000);
+ CordRepRing* ring = CordRepRing::Create(flat1);
+ ring = CordRepRing::Append(ring, flat2);
+ ring = CordRepRing::Append(ring, flat3);
+ ring = ref.NeedsUnref(CordRepRing::Append(ring, external));
+
+ CordzStatistics expected;
+ expected.size = ring->length;
+ expected.estimated_memory_usage = SizeOf(ring) + SizeOf(flat1) +
+ SizeOf(flat2) + SizeOf(flat3) +
+ SizeOf(external);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+ expected.node_count = 5;
+ expected.node_counts.flat = 3;
+ expected.node_counts.flat_128 = 1;
+ expected.node_counts.flat_256 = 1;
+ expected.node_counts.external = 1;
+ expected.node_counts.ring = 1;
+
+ EXPECT_THAT(SampleCord(ring), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, SharedSubstringRing) {
+ RefHelper ref;
+ auto* flat1 = ref.Ref(Flat(240));
+ auto* flat2 = Flat(200);
+ auto* flat3 = Flat(70);
+ auto* external = ref.Ref(External(3000), 5);
+ CordRepRing* ring = CordRepRing::Create(flat1);
+ ring = CordRepRing::Append(ring, flat2);
+ ring = CordRepRing::Append(ring, flat3);
+ ring = ref.Ref(CordRepRing::Append(ring, external), 4);
+ auto* substring = ref.Ref(ref.NeedsUnref(Substring(ring)));
+
+
+ CordzStatistics expected;
+ expected.size = substring->length;
+ expected.estimated_memory_usage = SizeOf(ring) + SizeOf(flat1) +
+ SizeOf(flat2) + SizeOf(flat3) +
+ SizeOf(external) + SizeOf(substring);
+ expected.estimated_fair_share_memory_usage = FairShare(substring);
+ expected.node_count = 6;
+ expected.node_counts.flat = 3;
+ expected.node_counts.flat_128 = 1;
+ expected.node_counts.flat_256 = 2;
+ expected.node_counts.external = 1;
+ expected.node_counts.ring = 1;
+ expected.node_counts.substring = 1;
+
+ EXPECT_THAT(SampleCord(substring), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, BtreeLeaf) {
+ ASSERT_THAT(CordRepBtree::kMaxCapacity, Ge(3));
+ RefHelper ref;
+ auto* flat1 = Flat(2000);
+ auto* flat2 = Flat(200);
+ auto* substr = Substring(flat2);
+ auto* external = External(3000);
+
+ CordRepBtree* tree = CordRepBtree::Create(flat1);
+ tree = CordRepBtree::Append(tree, substr);
+ tree = CordRepBtree::Append(tree, external);
+ size_t flat3_count = CordRepBtree::kMaxCapacity - 3;
+ size_t flat3_size = 0;
+ for (size_t i = 0; i < flat3_count; ++i) {
+ auto* flat3 = Flat(70);
+ flat3_size += SizeOf(flat3);
+ tree = CordRepBtree::Append(tree, flat3);
+ }
+ ref.NeedsUnref(tree);
+
+ CordzStatistics expected;
+ expected.size = tree->length;
+ expected.estimated_memory_usage = SizeOf(tree) + SizeOf(flat1) +
+ SizeOf(flat2) + SizeOf(substr) +
+ flat3_size + SizeOf(external);
+ expected.estimated_fair_share_memory_usage = expected.estimated_memory_usage;
+ expected.node_count = 1 + 3 + 1 + flat3_count;
+ expected.node_counts.flat = 2 + flat3_count;
+ expected.node_counts.flat_128 = flat3_count;
+ expected.node_counts.flat_256 = 1;
+ expected.node_counts.external = 1;
+ expected.node_counts.substring = 1;
+ expected.node_counts.btree = 1;
+
+ EXPECT_THAT(SampleCord(tree), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, BtreeNodeShared) {
+ RefHelper ref;
+ static constexpr int leaf_count = 3;
+ const size_t flat3_count = CordRepBtree::kMaxCapacity - 3;
+ ASSERT_THAT(flat3_count, Ge(0));
+
+ CordRepBtree* tree = nullptr;
+ size_t mem_size = 0;
+ for (int i = 0; i < leaf_count; ++i) {
+ auto* flat1 = ref.Ref(Flat(2000), 9);
+ mem_size += SizeOf(flat1);
+ if (i == 0) {
+ tree = CordRepBtree::Create(flat1);
+ } else {
+ tree = CordRepBtree::Append(tree, flat1);
+ }
+
+ auto* flat2 = Flat(200);
+ auto* substr = Substring(flat2);
+ mem_size += SizeOf(flat2) + SizeOf(substr);
+ tree = CordRepBtree::Append(tree, substr);
+
+ auto* external = External(30);
+ mem_size += SizeOf(external);
+ tree = CordRepBtree::Append(tree, external);
+
+ for (size_t i = 0; i < flat3_count; ++i) {
+ auto* flat3 = Flat(70);
+ mem_size += SizeOf(flat3);
+ tree = CordRepBtree::Append(tree, flat3);
+ }
+
+ if (i == 0) {
+ mem_size += SizeOf(tree);
+ } else {
+ mem_size += SizeOf(tree->Edges().back()->btree());
+ }
+ }
+ ref.NeedsUnref(tree);
+
+ // Ref count: 2 for top (add 1), 5 for leaf 0 (add 4).
+ ref.Ref(tree, 1);
+ ref.Ref(tree->Edges().front(), 4);
+
+ CordzStatistics expected;
+ expected.size = tree->length;
+ expected.estimated_memory_usage = SizeOf(tree) + mem_size;
+ expected.estimated_fair_share_memory_usage = FairShare(tree);
+
+ expected.node_count = 1 + leaf_count * (1 + 3 + 1 + flat3_count);
+ expected.node_counts.flat = leaf_count * (2 + flat3_count);
+ expected.node_counts.flat_128 = leaf_count * flat3_count;
+ expected.node_counts.flat_256 = leaf_count;
+ expected.node_counts.external = leaf_count;
+ expected.node_counts.substring = leaf_count;
+ expected.node_counts.btree = 1 + leaf_count;
+
+ EXPECT_THAT(SampleCord(tree), EqStatistics(expected));
+}
+
+TEST(CordzInfoStatisticsTest, ThreadSafety) {
+ Notification stop;
+ static constexpr int kNumThreads = 8;
+ int64_t sampled_node_count = 0;
+
+ {
+ absl::synchronization_internal::ThreadPool pool(kNumThreads);
+
+ // Run analyzer thread emulating a CordzHandler collection.
+ pool.Schedule([&]() {
+ while (!stop.HasBeenNotified()) {
+ // Run every 10us (about 100K total collections).
+ absl::SleepFor(absl::Microseconds(10));
+ CordzSampleToken token;
+ for (const CordzInfo& cord_info : token) {
+ CordzStatistics stats = cord_info.GetCordzStatistics();
+ sampled_node_count += stats.node_count;
+ }
+ }
+ });
+
+ // Run 'application threads'
+ for (int i = 0; i < kNumThreads; ++i) {
+ pool.Schedule([&]() {
+ // Track 0 - 2 cordz infos at a time, providing permutations of 0, 1
+ // and 2 CordzHandle and CordzInfo queues being active, with plenty of
+ // 'empty to non empty' transitions.
+ InlineData cords[2];
+ std::minstd_rand gen;
+ std::uniform_int_distribution<int> coin_toss(0, 1);
+
+ while (!stop.HasBeenNotified()) {
+ for (InlineData& cord : cords) {
+ // 50/50 flip the state of the cord
+ if (coin_toss(gen) != 0) {
+ if (cord.is_tree()) {
+ // 50/50 simulate delete (untrack) or 'edit to empty'
+ if (coin_toss(gen) != 0) {
+ CordzInfo::MaybeUntrackCord(cord.cordz_info());
+ } else {
+ CordzUpdateScope scope(cord.cordz_info(),
+ CordzUpdateTracker::kUnknown);
+ scope.SetCordRep(nullptr);
+ }
+ CordRep::Unref(cord.as_tree());
+ cord.set_inline_size(0);
+ } else {
+ // Coin toss to 25% ring, 25% btree, and 50% flat.
+ CordRep* rep = Flat(256);
+ if (coin_toss(gen) != 0) {
+ if (coin_toss(gen) != 0) {
+ rep = CordRepRing::Create(rep);
+ } else {
+ rep = CordRepBtree::Create(rep);
+ }
+ }
+ cord.make_tree(rep);
+
+ // 50/50 sample
+ if (coin_toss(gen) != 0) {
+ CordzInfo::TrackCord(cord, CordzUpdateTracker::kUnknown);
+ }
+ }
+ }
+ }
+ }
+ for (InlineData& cord : cords) {
+ if (cord.is_tree()) {
+ CordzInfo::MaybeUntrackCord(cord.cordz_info());
+ CordRep::Unref(cord.as_tree());
+ }
+ }
+ });
+ }
+
+ // Run for 1 second to give memory and thread safety analyzers plenty of
+ // time to detect any mishaps or undefined behaviors.
+ absl::SleepFor(absl::Seconds(1));
+ stop.Notify();
+ }
+
+ std::cout << "Sampled " << sampled_node_count << " nodes\n";
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_test.cc
new file mode 100644
index 00000000..b98343ae
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_info_test.cc
@@ -0,0 +1,341 @@
+// Copyright 2019 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_info.h"
+
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/debugging/stacktrace.h"
+#include "absl/debugging/symbolize.h"
+#include "absl/strings/cordz_test_helpers.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+#include "absl/strings/str_cat.h"
+#include "absl/types/span.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::HasSubstr;
+using ::testing::Ne;
+using ::testing::SizeIs;
+
+// Used test values
+auto constexpr kUnknownMethod = CordzUpdateTracker::kUnknown;
+auto constexpr kTrackCordMethod = CordzUpdateTracker::kConstructorString;
+auto constexpr kChildMethod = CordzUpdateTracker::kConstructorCord;
+auto constexpr kUpdateMethod = CordzUpdateTracker::kAppendString;
+
+// Local less verbose helper
+std::vector<const CordzHandle*> DeleteQueue() {
+ return CordzHandle::DiagnosticsGetDeleteQueue();
+}
+
+std::string FormatStack(absl::Span<void* const> raw_stack) {
+ static constexpr size_t buf_size = 1 << 14;
+ std::unique_ptr<char[]> buf(new char[buf_size]);
+ std::string output;
+ for (void* stackp : raw_stack) {
+ if (absl::Symbolize(stackp, buf.get(), buf_size)) {
+ absl::StrAppend(&output, " ", buf.get(), "\n");
+ }
+ }
+ return output;
+}
+
+TEST(CordzInfoTest, TrackCord) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+ ASSERT_THAT(info, Ne(nullptr));
+ EXPECT_FALSE(info->is_snapshot());
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(info));
+ EXPECT_THAT(info->GetCordRepForTesting(), Eq(data.rep.rep));
+ info->Untrack();
+}
+
+TEST(CordzInfoTest, MaybeTrackChildCordWithoutSampling) {
+ CordzSamplingIntervalHelper sample_none(99999);
+ TestCordData parent, child;
+ CordzInfo::MaybeTrackCord(child.data, parent.data, kTrackCordMethod);
+ EXPECT_THAT(child.data.cordz_info(), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, MaybeTrackChildCordWithSampling) {
+ CordzSamplingIntervalHelper sample_all(1);
+ TestCordData parent, child;
+ CordzInfo::MaybeTrackCord(child.data, parent.data, kTrackCordMethod);
+ EXPECT_THAT(child.data.cordz_info(), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, MaybeTrackChildCordWithoutSamplingParentSampled) {
+ CordzSamplingIntervalHelper sample_none(99999);
+ TestCordData parent, child;
+ CordzInfo::TrackCord(parent.data, kTrackCordMethod);
+ CordzInfo::MaybeTrackCord(child.data, parent.data, kTrackCordMethod);
+ CordzInfo* parent_info = parent.data.cordz_info();
+ CordzInfo* child_info = child.data.cordz_info();
+ ASSERT_THAT(child_info, Ne(nullptr));
+ EXPECT_THAT(child_info->GetCordRepForTesting(), Eq(child.rep.rep));
+ EXPECT_THAT(child_info->GetParentStack(), parent_info->GetStack());
+ parent_info->Untrack();
+ child_info->Untrack();
+}
+
+TEST(CordzInfoTest, MaybeTrackChildCordWithoutSamplingChildSampled) {
+ CordzSamplingIntervalHelper sample_none(99999);
+ TestCordData parent, child;
+ CordzInfo::TrackCord(child.data, kTrackCordMethod);
+ CordzInfo::MaybeTrackCord(child.data, parent.data, kTrackCordMethod);
+ EXPECT_THAT(child.data.cordz_info(), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, MaybeTrackChildCordWithSamplingChildSampled) {
+ CordzSamplingIntervalHelper sample_all(1);
+ TestCordData parent, child;
+ CordzInfo::TrackCord(child.data, kTrackCordMethod);
+ CordzInfo::MaybeTrackCord(child.data, parent.data, kTrackCordMethod);
+ EXPECT_THAT(child.data.cordz_info(), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, UntrackCord) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+
+ info->Untrack();
+ EXPECT_THAT(DeleteQueue(), SizeIs(0));
+}
+
+TEST(CordzInfoTest, UntrackCordWithSnapshot) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+
+ CordzSnapshot snapshot;
+ info->Untrack();
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(nullptr));
+ EXPECT_THAT(info->GetCordRepForTesting(), Eq(data.rep.rep));
+ EXPECT_THAT(DeleteQueue(), ElementsAre(info, &snapshot));
+}
+
+TEST(CordzInfoTest, SetCordRep) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+
+ TestCordRep rep;
+ info->Lock(CordzUpdateTracker::kAppendCord);
+ info->SetCordRep(rep.rep);
+ info->Unlock();
+ EXPECT_THAT(info->GetCordRepForTesting(), Eq(rep.rep));
+
+ info->Untrack();
+}
+
+TEST(CordzInfoTest, SetCordRepNullUntracksCordOnUnlock) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+
+ info->Lock(CordzUpdateTracker::kAppendString);
+ info->SetCordRep(nullptr);
+ EXPECT_THAT(info->GetCordRepForTesting(), Eq(nullptr));
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(info));
+
+ info->Unlock();
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, RefCordRep) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+
+ size_t refcount = data.rep.rep->refcount.Get();
+ EXPECT_THAT(info->RefCordRep(), Eq(data.rep.rep));
+ EXPECT_THAT(data.rep.rep->refcount.Get(), Eq(refcount + 1));
+ CordRep::Unref(data.rep.rep);
+ info->Untrack();
+}
+
+#if GTEST_HAS_DEATH_TEST
+
+TEST(CordzInfoTest, SetCordRepRequiresMutex) {
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+ TestCordRep rep;
+ EXPECT_DEBUG_DEATH(info->SetCordRep(rep.rep), ".*");
+ info->Untrack();
+}
+
+#endif // GTEST_HAS_DEATH_TEST
+
+TEST(CordzInfoTest, TrackUntrackHeadFirstV2) {
+ CordzSnapshot snapshot;
+ EXPECT_THAT(CordzInfo::Head(snapshot), Eq(nullptr));
+
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info1 = data.data.cordz_info();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info1));
+ EXPECT_THAT(info1->Next(snapshot), Eq(nullptr));
+
+ TestCordData data2;
+ CordzInfo::TrackCord(data2.data, kTrackCordMethod);
+ CordzInfo* info2 = data2.data.cordz_info();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info2));
+ EXPECT_THAT(info2->Next(snapshot), Eq(info1));
+ EXPECT_THAT(info1->Next(snapshot), Eq(nullptr));
+
+ info2->Untrack();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info1));
+ EXPECT_THAT(info1->Next(snapshot), Eq(nullptr));
+
+ info1->Untrack();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, TrackUntrackTailFirstV2) {
+ CordzSnapshot snapshot;
+ EXPECT_THAT(CordzInfo::Head(snapshot), Eq(nullptr));
+
+ TestCordData data;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info1 = data.data.cordz_info();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info1));
+ EXPECT_THAT(info1->Next(snapshot), Eq(nullptr));
+
+ TestCordData data2;
+ CordzInfo::TrackCord(data2.data, kTrackCordMethod);
+ CordzInfo* info2 = data2.data.cordz_info();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info2));
+ EXPECT_THAT(info2->Next(snapshot), Eq(info1));
+ EXPECT_THAT(info1->Next(snapshot), Eq(nullptr));
+
+ info1->Untrack();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(info2));
+ EXPECT_THAT(info2->Next(snapshot), Eq(nullptr));
+
+ info2->Untrack();
+ ASSERT_THAT(CordzInfo::Head(snapshot), Eq(nullptr));
+}
+
+TEST(CordzInfoTest, StackV2) {
+ TestCordData data;
+ // kMaxStackDepth is intentionally less than 64 (which is the max depth that
+ // Cordz will record) because if the actual stack depth is over 64
+ // (which it is on Apple platforms) then the expected_stack will end up
+ // catching a few frames at the end that the actual_stack didn't get and
+ // it will no longer be subset. At the time of this writing 58 is the max
+ // that will allow this test to pass (with a minimum os version of iOS 9), so
+ // rounded down to 50 to hopefully not run into this in the future if Apple
+ // makes small modifications to its testing stack. 50 is sufficient to prove
+ // that we got a decent stack.
+ static constexpr int kMaxStackDepth = 50;
+ CordzInfo::TrackCord(data.data, kTrackCordMethod);
+ CordzInfo* info = data.data.cordz_info();
+ std::vector<void*> local_stack;
+ local_stack.resize(kMaxStackDepth);
+ // In some environments we don't get stack traces. For example in Android
+ // absl::GetStackTrace will return 0 indicating it didn't find any stack. The
+ // resultant formatted stack will be "", but that still equals the stack
+ // recorded in CordzInfo, which is also empty. The skip_count is 1 so that the
+ // line number of the current stack isn't included in the HasSubstr check.
+ local_stack.resize(absl::GetStackTrace(local_stack.data(), kMaxStackDepth,
+ /*skip_count=*/1));
+
+ std::string got_stack = FormatStack(info->GetStack());
+ std::string expected_stack = FormatStack(local_stack);
+ // If TrackCord is inlined, got_stack should match expected_stack. If it isn't
+ // inlined, got_stack should include an additional frame not present in
+ // expected_stack. Either way, expected_stack should be a substring of
+ // got_stack.
+ EXPECT_THAT(got_stack, HasSubstr(expected_stack));
+
+ info->Untrack();
+}
+
+// Local helper functions to get different stacks for child and parent.
+CordzInfo* TrackChildCord(InlineData& data, const InlineData& parent) {
+ CordzInfo::TrackCord(data, parent, kChildMethod);
+ return data.cordz_info();
+}
+CordzInfo* TrackParentCord(InlineData& data) {
+ CordzInfo::TrackCord(data, kTrackCordMethod);
+ return data.cordz_info();
+}
+
+TEST(CordzInfoTest, GetStatistics) {
+ TestCordData data;
+ CordzInfo* info = TrackParentCord(data.data);
+
+ CordzStatistics statistics = info->GetCordzStatistics();
+ EXPECT_THAT(statistics.size, Eq(data.rep.rep->length));
+ EXPECT_THAT(statistics.method, Eq(kTrackCordMethod));
+ EXPECT_THAT(statistics.parent_method, Eq(kUnknownMethod));
+ EXPECT_THAT(statistics.update_tracker.Value(kTrackCordMethod), Eq(1));
+
+ info->Untrack();
+}
+
+TEST(CordzInfoTest, LockCountsMethod) {
+ TestCordData data;
+ CordzInfo* info = TrackParentCord(data.data);
+
+ info->Lock(kUpdateMethod);
+ info->Unlock();
+ info->Lock(kUpdateMethod);
+ info->Unlock();
+
+ CordzStatistics statistics = info->GetCordzStatistics();
+ EXPECT_THAT(statistics.update_tracker.Value(kUpdateMethod), Eq(2));
+
+ info->Untrack();
+}
+
+TEST(CordzInfoTest, FromParent) {
+ TestCordData parent;
+ TestCordData child;
+ CordzInfo* info_parent = TrackParentCord(parent.data);
+ CordzInfo* info_child = TrackChildCord(child.data, parent.data);
+
+ std::string stack = FormatStack(info_parent->GetStack());
+ std::string parent_stack = FormatStack(info_child->GetParentStack());
+ EXPECT_THAT(stack, Eq(parent_stack));
+
+ CordzStatistics statistics = info_child->GetCordzStatistics();
+ EXPECT_THAT(statistics.size, Eq(child.rep.rep->length));
+ EXPECT_THAT(statistics.method, Eq(kChildMethod));
+ EXPECT_THAT(statistics.parent_method, Eq(kTrackCordMethod));
+ EXPECT_THAT(statistics.update_tracker.Value(kChildMethod), Eq(1));
+
+ info_parent->Untrack();
+ info_child->Untrack();
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.cc
new file mode 100644
index 00000000..ba1270d8
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.cc
@@ -0,0 +1,64 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_sample_token.h"
+
+#include "absl/base/config.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_info.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+CordzSampleToken::Iterator& CordzSampleToken::Iterator::operator++() {
+ if (current_) {
+ current_ = current_->Next(*token_);
+ }
+ return *this;
+}
+
+CordzSampleToken::Iterator CordzSampleToken::Iterator::operator++(int) {
+ Iterator it(*this);
+ operator++();
+ return it;
+}
+
+bool operator==(const CordzSampleToken::Iterator& lhs,
+ const CordzSampleToken::Iterator& rhs) {
+ return lhs.current_ == rhs.current_ &&
+ (lhs.current_ == nullptr || lhs.token_ == rhs.token_);
+}
+
+bool operator!=(const CordzSampleToken::Iterator& lhs,
+ const CordzSampleToken::Iterator& rhs) {
+ return !(lhs == rhs);
+}
+
+CordzSampleToken::Iterator::reference CordzSampleToken::Iterator::operator*()
+ const {
+ return *current_;
+}
+
+CordzSampleToken::Iterator::pointer CordzSampleToken::Iterator::operator->()
+ const {
+ return current_;
+}
+
+CordzSampleToken::Iterator::Iterator(const CordzSampleToken* token)
+ : token_(token), current_(CordzInfo::Head(*token)) {}
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h
new file mode 100644
index 00000000..28a1d70c
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token.h
@@ -0,0 +1,97 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/base/config.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_info.h"
+
+#ifndef ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_
+#define ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// The existence of a CordzSampleToken guarantees that a reader can traverse the
+// global_cordz_infos_head linked-list without needing to hold a mutex. When a
+// CordzSampleToken exists, all CordzInfo objects that would be destroyed are
+// instead appended to a deletion queue. When the CordzSampleToken is destroyed,
+// it will also clean up any of these CordzInfo objects.
+//
+// E.g., ST are CordzSampleToken objects and CH are CordzHandle objects.
+// ST1 <- CH1 <- CH2 <- ST2 <- CH3 <- global_delete_queue_tail
+//
+// This list tracks that CH1 and CH2 were created after ST1, so the thread
+// holding ST1 might have a referece to CH1, CH2, ST2, and CH3. However, ST2 was
+// created later, so the thread holding the ST2 token cannot have a reference to
+// ST1, CH1, or CH2. If ST1 is cleaned up first, that thread will delete ST1,
+// CH1, and CH2. If instead ST2 is cleaned up first, that thread will only
+// delete ST2.
+//
+// If ST1 is cleaned up first, the new list will be:
+// ST2 <- CH3 <- global_delete_queue_tail
+//
+// If ST2 is cleaned up first, the new list will be:
+// ST1 <- CH1 <- CH2 <- CH3 <- global_delete_queue_tail
+//
+// All new CordzHandle objects are appended to the list, so if a new thread
+// comes along before either ST1 or ST2 are cleaned up, the new list will be:
+// ST1 <- CH1 <- CH2 <- ST2 <- CH3 <- ST3 <- global_delete_queue_tail
+//
+// A thread must hold the global_delete_queue_mu mutex whenever it's altering
+// this list.
+//
+// It is safe for thread that holds a CordzSampleToken to read
+// global_cordz_infos at any time since the objects it is able to retrieve will
+// not be deleted while the CordzSampleToken exists.
+class CordzSampleToken : public CordzSnapshot {
+ public:
+ class Iterator {
+ public:
+ using iterator_category = std::input_iterator_tag;
+ using value_type = const CordzInfo&;
+ using difference_type = ptrdiff_t;
+ using pointer = const CordzInfo*;
+ using reference = value_type;
+
+ Iterator() = default;
+
+ Iterator& operator++();
+ Iterator operator++(int);
+ friend bool operator==(const Iterator& lhs, const Iterator& rhs);
+ friend bool operator!=(const Iterator& lhs, const Iterator& rhs);
+ reference operator*() const;
+ pointer operator->() const;
+
+ private:
+ friend class CordzSampleToken;
+ explicit Iterator(const CordzSampleToken* token);
+
+ const CordzSampleToken* token_ = nullptr;
+ pointer current_ = nullptr;
+ };
+
+ CordzSampleToken() = default;
+ CordzSampleToken(const CordzSampleToken&) = delete;
+ CordzSampleToken& operator=(const CordzSampleToken&) = delete;
+
+ Iterator begin() { return Iterator(this); }
+ Iterator end() { return Iterator(); }
+};
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_CORDZ_SAMPLE_TOKEN_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc
new file mode 100644
index 00000000..9f54301d
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc
@@ -0,0 +1,208 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_sample_token.h"
+
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/memory/memory.h"
+#include "absl/random/random.h"
+#include "absl/strings/cordz_test_helpers.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/synchronization/internal/thread_pool.h"
+#include "absl/synchronization/notification.h"
+#include "absl/time/clock.h"
+#include "absl/time/time.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::ElementsAre;
+using ::testing::Eq;
+using ::testing::Ne;
+
+// Used test values
+auto constexpr kTrackCordMethod = CordzUpdateTracker::kConstructorString;
+
+TEST(CordzSampleTokenTest, IteratorTraits) {
+ static_assert(std::is_copy_constructible<CordzSampleToken::Iterator>::value,
+ "");
+ static_assert(std::is_copy_assignable<CordzSampleToken::Iterator>::value, "");
+ static_assert(std::is_move_constructible<CordzSampleToken::Iterator>::value,
+ "");
+ static_assert(std::is_move_assignable<CordzSampleToken::Iterator>::value, "");
+ static_assert(
+ std::is_same<
+ std::iterator_traits<CordzSampleToken::Iterator>::iterator_category,
+ std::input_iterator_tag>::value,
+ "");
+ static_assert(
+ std::is_same<std::iterator_traits<CordzSampleToken::Iterator>::value_type,
+ const CordzInfo&>::value,
+ "");
+ static_assert(
+ std::is_same<
+ std::iterator_traits<CordzSampleToken::Iterator>::difference_type,
+ ptrdiff_t>::value,
+ "");
+ static_assert(
+ std::is_same<std::iterator_traits<CordzSampleToken::Iterator>::pointer,
+ const CordzInfo*>::value,
+ "");
+ static_assert(
+ std::is_same<std::iterator_traits<CordzSampleToken::Iterator>::reference,
+ const CordzInfo&>::value,
+ "");
+}
+
+TEST(CordzSampleTokenTest, IteratorEmpty) {
+ CordzSampleToken token;
+ EXPECT_THAT(token.begin(), Eq(token.end()));
+}
+
+TEST(CordzSampleTokenTest, Iterator) {
+ TestCordData cord1, cord2, cord3;
+ CordzInfo::TrackCord(cord1.data, kTrackCordMethod);
+ CordzInfo* info1 = cord1.data.cordz_info();
+ CordzInfo::TrackCord(cord2.data, kTrackCordMethod);
+ CordzInfo* info2 = cord2.data.cordz_info();
+ CordzInfo::TrackCord(cord3.data, kTrackCordMethod);
+ CordzInfo* info3 = cord3.data.cordz_info();
+
+ CordzSampleToken token;
+ std::vector<const CordzInfo*> found;
+ for (const CordzInfo& cord_info : token) {
+ found.push_back(&cord_info);
+ }
+
+ EXPECT_THAT(found, ElementsAre(info3, info2, info1));
+
+ info1->Untrack();
+ info2->Untrack();
+ info3->Untrack();
+}
+
+TEST(CordzSampleTokenTest, IteratorEquality) {
+ TestCordData cord1;
+ TestCordData cord2;
+ TestCordData cord3;
+ CordzInfo::TrackCord(cord1.data, kTrackCordMethod);
+ CordzInfo* info1 = cord1.data.cordz_info();
+
+ CordzSampleToken token1;
+ // lhs starts with the CordzInfo corresponding to cord1 at the head.
+ CordzSampleToken::Iterator lhs = token1.begin();
+
+ CordzInfo::TrackCord(cord2.data, kTrackCordMethod);
+ CordzInfo* info2 = cord2.data.cordz_info();
+
+ CordzSampleToken token2;
+ // rhs starts with the CordzInfo corresponding to cord2 at the head.
+ CordzSampleToken::Iterator rhs = token2.begin();
+
+ CordzInfo::TrackCord(cord3.data, kTrackCordMethod);
+ CordzInfo* info3 = cord3.data.cordz_info();
+
+ // lhs is on cord1 while rhs is on cord2.
+ EXPECT_THAT(lhs, Ne(rhs));
+
+ rhs++;
+ // lhs and rhs are both on cord1, but they didn't come from the same
+ // CordzSampleToken.
+ EXPECT_THAT(lhs, Ne(rhs));
+
+ lhs++;
+ rhs++;
+ // Both lhs and rhs are done, so they are on nullptr.
+ EXPECT_THAT(lhs, Eq(rhs));
+
+ info1->Untrack();
+ info2->Untrack();
+ info3->Untrack();
+}
+
+TEST(CordzSampleTokenTest, MultiThreaded) {
+ Notification stop;
+ static constexpr int kNumThreads = 4;
+ static constexpr int kNumCords = 3;
+ static constexpr int kNumTokens = 3;
+ absl::synchronization_internal::ThreadPool pool(kNumThreads);
+
+ for (int i = 0; i < kNumThreads; ++i) {
+ pool.Schedule([&stop]() {
+ absl::BitGen gen;
+ TestCordData cords[kNumCords];
+ std::unique_ptr<CordzSampleToken> tokens[kNumTokens];
+
+ while (!stop.HasBeenNotified()) {
+ // Randomly perform one of five actions:
+ // 1) Untrack
+ // 2) Track
+ // 3) Iterate over Cords visible to a token.
+ // 4) Unsample
+ // 5) Sample
+ int index = absl::Uniform(gen, 0, kNumCords);
+ if (absl::Bernoulli(gen, 0.5)) {
+ TestCordData& cord = cords[index];
+ // Track/untrack.
+ if (cord.data.is_profiled()) {
+ // 1) Untrack
+ cord.data.cordz_info()->Untrack();
+ cord.data.clear_cordz_info();;
+ } else {
+ // 2) Track
+ CordzInfo::TrackCord(cord.data, kTrackCordMethod);
+ }
+ } else {
+ std::unique_ptr<CordzSampleToken>& token = tokens[index];
+ if (token) {
+ if (absl::Bernoulli(gen, 0.5)) {
+ // 3) Iterate over Cords visible to a token.
+ for (const CordzInfo& info : *token) {
+ // This is trivial work to allow us to compile the loop.
+ EXPECT_THAT(info.Next(*token), Ne(&info));
+ }
+ } else {
+ // 4) Unsample
+ token = nullptr;
+ }
+ } else {
+ // 5) Sample
+ token = absl::make_unique<CordzSampleToken>();
+ }
+ }
+ }
+ for (TestCordData& cord : cords) {
+ CordzInfo::MaybeUntrackCord(cord.data.cordz_info());
+ }
+ });
+ }
+ // The threads will hammer away. Give it a little bit of time for tsan to
+ // spot errors.
+ absl::SleepFor(absl::Seconds(3));
+ stop.Notify();
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h
new file mode 100644
index 00000000..da4c7dbb
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h
@@ -0,0 +1,87 @@
+// Copyright 2019 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_
+#define ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_
+
+#include <cstdint>
+
+#include "absl/base/config.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordzStatistics captures some meta information about a Cord's shape.
+struct CordzStatistics {
+ using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+
+ // Node counts information
+ struct NodeCounts {
+ size_t flat = 0; // #flats
+ size_t flat_64 = 0; // #flats up to 64 bytes
+ size_t flat_128 = 0; // #flats up to 128 bytes
+ size_t flat_256 = 0; // #flats up to 256 bytes
+ size_t flat_512 = 0; // #flats up to 512 bytes
+ size_t flat_1k = 0; // #flats up to 1K bytes
+ size_t external = 0; // #external reps
+ size_t substring = 0; // #substring reps
+ size_t concat = 0; // #concat reps
+ size_t ring = 0; // #ring buffer reps
+ size_t btree = 0; // #btree reps
+ };
+
+ // The size of the cord in bytes. This matches the result of Cord::size().
+ int64_t size = 0;
+
+ // The estimated memory used by the sampled cord. This value matches the
+ // value as reported by Cord::EstimatedMemoryUsage().
+ // A value of 0 implies the property has not been recorded.
+ int64_t estimated_memory_usage = 0;
+
+ // The effective memory used by the sampled cord, inversely weighted by the
+ // effective indegree of each allocated node. This is a representation of the
+ // fair share of memory usage that should be attributed to the sampled cord.
+ // This value is more useful for cases where one or more nodes are referenced
+ // by multiple Cord instances, and for cases where a Cord includes the same
+ // node multiple times (either directly or indirectly).
+ // A value of 0 implies the property has not been recorded.
+ int64_t estimated_fair_share_memory_usage = 0;
+
+ // The total number of nodes referenced by this cord.
+ // For ring buffer Cords, this includes the 'ring buffer' node.
+ // For btree Cords, this includes all 'CordRepBtree' tree nodes as well as all
+ // the substring, flat and external nodes referenced by the tree.
+ // A value of 0 implies the property has not been recorded.
+ int64_t node_count = 0;
+
+ // Detailed node counts per type
+ NodeCounts node_counts;
+
+ // The cord method responsible for sampling the cord.
+ MethodIdentifier method = MethodIdentifier::kUnknown;
+
+ // The cord method responsible for sampling the parent cord if applicable.
+ MethodIdentifier parent_method = MethodIdentifier::kUnknown;
+
+ // Update tracker tracking invocation count per cord method.
+ CordzUpdateTracker update_tracker;
+};
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h
new file mode 100644
index 00000000..57ba75de
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h
@@ -0,0 +1,71 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_SCOPE_H_
+#define ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_SCOPE_H_
+
+#include "absl/base/config.h"
+#include "absl/base/optimization.h"
+#include "absl/base/thread_annotations.h"
+#include "absl/strings/internal/cord_internal.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordzUpdateScope scopes an update to the provided CordzInfo.
+// The class invokes `info->Lock(method)` and `info->Unlock()` to guard
+// cordrep updates. This class does nothing if `info` is null.
+// See also the 'Lock`, `Unlock` and `SetCordRep` methods in `CordzInfo`.
+class ABSL_SCOPED_LOCKABLE CordzUpdateScope {
+ public:
+ CordzUpdateScope(CordzInfo* info, CordzUpdateTracker::MethodIdentifier method)
+ ABSL_EXCLUSIVE_LOCK_FUNCTION(info)
+ : info_(info) {
+ if (ABSL_PREDICT_FALSE(info_)) {
+ info->Lock(method);
+ }
+ }
+
+ // CordzUpdateScope can not be copied or assigned to.
+ CordzUpdateScope(CordzUpdateScope&& rhs) = delete;
+ CordzUpdateScope(const CordzUpdateScope&) = delete;
+ CordzUpdateScope& operator=(CordzUpdateScope&& rhs) = delete;
+ CordzUpdateScope& operator=(const CordzUpdateScope&) = delete;
+
+ ~CordzUpdateScope() ABSL_UNLOCK_FUNCTION() {
+ if (ABSL_PREDICT_FALSE(info_)) {
+ info_->Unlock();
+ }
+ }
+
+ void SetCordRep(CordRep* rep) const {
+ if (ABSL_PREDICT_FALSE(info_)) {
+ info_->SetCordRep(rep);
+ }
+ }
+
+ CordzInfo* info() const { return info_; }
+
+ private:
+ CordzInfo* info_;
+};
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_SCOPE_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc
new file mode 100644
index 00000000..3d08c622
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope_test.cc
@@ -0,0 +1,49 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_update_scope.h"
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/config.h"
+#include "absl/strings/cordz_test_helpers.h"
+#include "absl/strings/internal/cord_rep_flat.h"
+#include "absl/strings/internal/cordz_info.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+namespace {
+
+// Used test values
+auto constexpr kTrackCordMethod = CordzUpdateTracker::kConstructorString;
+
+TEST(CordzUpdateScopeTest, ScopeNullptr) {
+ CordzUpdateScope scope(nullptr, kTrackCordMethod);
+}
+
+TEST(CordzUpdateScopeTest, ScopeSampledCord) {
+ TestCordData cord;
+ CordzInfo::TrackCord(cord.data, kTrackCordMethod);
+ CordzUpdateScope scope(cord.data.cordz_info(), kTrackCordMethod);
+ cord.data.cordz_info()->SetCordRep(nullptr);
+}
+
+} // namespace
+ABSL_NAMESPACE_END
+} // namespace cord_internal
+
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h
new file mode 100644
index 00000000..1f764486
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h
@@ -0,0 +1,121 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_TRACKER_H_
+#define ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_TRACKER_H_
+
+#include <atomic>
+#include <cstdint>
+
+#include "absl/base/config.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+
+// CordzUpdateTracker tracks counters for Cord update methods.
+//
+// The purpose of CordzUpdateTracker is to track the number of calls to methods
+// updating Cord data for sampled cords. The class internally uses 'lossy'
+// atomic operations: Cord is thread-compatible, so there is no need to
+// synchronize updates. However, Cordz collection threads may call 'Value()' at
+// any point, so the class needs to provide thread safe access.
+//
+// This class is thread-safe. But as per above comments, all non-const methods
+// should be used single-threaded only: updates are thread-safe but lossy.
+class CordzUpdateTracker {
+ public:
+ // Tracked update methods.
+ enum MethodIdentifier {
+ kUnknown,
+ kAppendBuffer,
+ kAppendCord,
+ kAppendExternalMemory,
+ kAppendString,
+ kAssignCord,
+ kAssignString,
+ kClear,
+ kConstructorCord,
+ kConstructorString,
+ kCordReader,
+ kFlatten,
+ kGetAppendRegion,
+ kMakeCordFromExternal,
+ kMoveAppendCord,
+ kMoveAssignCord,
+ kMovePrependCord,
+ kPrependBuffer,
+ kPrependCord,
+ kPrependString,
+ kRemovePrefix,
+ kRemoveSuffix,
+ kSubCord,
+
+ // kNumMethods defines the number of entries: must be the last entry.
+ kNumMethods,
+ };
+
+ // Constructs a new instance. All counters are zero-initialized.
+ constexpr CordzUpdateTracker() noexcept : values_{} {}
+
+ // Copy constructs a new instance.
+ CordzUpdateTracker(const CordzUpdateTracker& rhs) noexcept { *this = rhs; }
+
+ // Assigns the provided value to this instance.
+ CordzUpdateTracker& operator=(const CordzUpdateTracker& rhs) noexcept {
+ for (int i = 0; i < kNumMethods; ++i) {
+ values_[i].store(rhs.values_[i].load(std::memory_order_relaxed),
+ std::memory_order_relaxed);
+ }
+ return *this;
+ }
+
+ // Returns the value for the specified method.
+ int64_t Value(MethodIdentifier method) const {
+ return values_[method].load(std::memory_order_relaxed);
+ }
+
+ // Increases the value for the specified method by `n`
+ void LossyAdd(MethodIdentifier method, int64_t n = 1) {
+ auto& value = values_[method];
+ value.store(value.load(std::memory_order_relaxed) + n,
+ std::memory_order_relaxed);
+ }
+
+ // Adds all the values from `src` to this instance
+ void LossyAdd(const CordzUpdateTracker& src) {
+ for (int i = 0; i < kNumMethods; ++i) {
+ MethodIdentifier method = static_cast<MethodIdentifier>(i);
+ if (int64_t value = src.Value(method)) {
+ LossyAdd(method, value);
+ }
+ }
+ }
+
+ private:
+ // Until C++20 std::atomic is not constexpr default-constructible, so we need
+ // a wrapper for this class to be constexpr constructible.
+ class Counter : public std::atomic<int64_t> {
+ public:
+ constexpr Counter() noexcept : std::atomic<int64_t>(0) {}
+ };
+
+ Counter values_[kNumMethods];
+};
+
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
+
+#endif // ABSL_STRINGS_INTERNAL_CORDZ_UPDATE_TRACKER_H_
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc
new file mode 100644
index 00000000..2348a175
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker_test.cc
@@ -0,0 +1,145 @@
+// Copyright 2021 The Abseil Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 "absl/strings/internal/cordz_update_tracker.h"
+
+#include <array>
+#include <thread> // NOLINT
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "absl/base/attributes.h"
+#include "absl/base/config.h"
+#include "absl/synchronization/notification.h"
+
+namespace absl {
+ABSL_NAMESPACE_BEGIN
+namespace cord_internal {
+namespace {
+
+using ::testing::AnyOf;
+using ::testing::Eq;
+
+using Method = CordzUpdateTracker::MethodIdentifier;
+using Methods = std::array<Method, Method::kNumMethods>;
+
+// Returns an array of all methods defined in `MethodIdentifier`
+Methods AllMethods() {
+ return Methods{Method::kUnknown,
+ Method::kAppendBuffer,
+ Method::kAppendCord,
+ Method::kAppendExternalMemory,
+ Method::kAppendString,
+ Method::kAssignCord,
+ Method::kAssignString,
+ Method::kClear,
+ Method::kConstructorCord,
+ Method::kConstructorString,
+ Method::kCordReader,
+ Method::kFlatten,
+ Method::kGetAppendRegion,
+ Method::kMakeCordFromExternal,
+ Method::kMoveAppendCord,
+ Method::kMoveAssignCord,
+ Method::kMovePrependCord,
+ Method::kPrependBuffer,
+ Method::kPrependCord,
+ Method::kPrependString,
+ Method::kRemovePrefix,
+ Method::kRemoveSuffix,
+ Method::kSubCord};
+}
+
+TEST(CordzUpdateTracker, IsConstExprAndInitializesToZero) {
+ constexpr CordzUpdateTracker tracker;
+ for (Method method : AllMethods()) {
+ ASSERT_THAT(tracker.Value(method), Eq(0));
+ }
+}
+
+TEST(CordzUpdateTracker, LossyAdd) {
+ int64_t n = 1;
+ CordzUpdateTracker tracker;
+ for (Method method : AllMethods()) {
+ tracker.LossyAdd(method, n);
+ EXPECT_THAT(tracker.Value(method), Eq(n));
+ n += 2;
+ }
+}
+
+TEST(CordzUpdateTracker, CopyConstructor) {
+ int64_t n = 1;
+ CordzUpdateTracker src;
+ for (Method method : AllMethods()) {
+ src.LossyAdd(method, n);
+ n += 2;
+ }
+
+ n = 1;
+ CordzUpdateTracker tracker(src);
+ for (Method method : AllMethods()) {
+ EXPECT_THAT(tracker.Value(method), Eq(n));
+ n += 2;
+ }
+}
+
+TEST(CordzUpdateTracker, OperatorAssign) {
+ int64_t n = 1;
+ CordzUpdateTracker src;
+ CordzUpdateTracker tracker;
+ for (Method method : AllMethods()) {
+ src.LossyAdd(method, n);
+ n += 2;
+ }
+
+ n = 1;
+ tracker = src;
+ for (Method method : AllMethods()) {
+ EXPECT_THAT(tracker.Value(method), Eq(n));
+ n += 2;
+ }
+}
+
+TEST(CordzUpdateTracker, ThreadSanitizedValueCheck) {
+ absl::Notification done;
+ CordzUpdateTracker tracker;
+
+ std::thread reader([&done, &tracker] {
+ while (!done.HasBeenNotified()) {
+ int n = 1;
+ for (Method method : AllMethods()) {
+ EXPECT_THAT(tracker.Value(method), AnyOf(Eq(n), Eq(0)));
+ n += 2;
+ }
+ }
+ int n = 1;
+ for (Method method : AllMethods()) {
+ EXPECT_THAT(tracker.Value(method), Eq(n));
+ n += 2;
+ }
+ });
+
+ int64_t n = 1;
+ for (Method method : AllMethods()) {
+ tracker.LossyAdd(method, n);
+ n += 2;
+ }
+ done.Notify();
+ reader.join();
+}
+
+} // namespace
+} // namespace cord_internal
+ABSL_NAMESPACE_END
+} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h b/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h
index e42628e3..49859dcc 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h
@@ -17,6 +17,7 @@
#ifndef ABSL_STRINGS_INTERNAL_RESIZE_UNINITIALIZED_H_
#define ABSL_STRINGS_INTERNAL_RESIZE_UNINITIALIZED_H_
+#include <algorithm>
#include <string>
#include <type_traits>
#include <utility>
@@ -28,8 +29,9 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace strings_internal {
-// Is a subclass of true_type or false_type, depending on whether or not
-// T has a __resize_default_init member.
+// In this type trait, we look for a __resize_default_init member function, and
+// we use it if available, otherwise, we use resize. We provide HasMember to
+// indicate whether __resize_default_init is present.
template <typename string_type, typename = void>
struct ResizeUninitializedTraits {
using HasMember = std::false_type;
@@ -66,6 +68,50 @@ inline void STLStringResizeUninitialized(string_type* s, size_t new_size) {
ResizeUninitializedTraits<string_type>::Resize(s, new_size);
}
+// Used to ensure exponential growth so that the amortized complexity of
+// increasing the string size by a small amount is O(1), in contrast to
+// O(str->size()) in the case of precise growth.
+template <typename string_type>
+void STLStringReserveAmortized(string_type* s, size_t new_size) {
+ const size_t cap = s->capacity();
+ if (new_size > cap) {
+ // Make sure to always grow by at least a factor of 2x.
+ s->reserve((std::max)(new_size, 2 * cap));
+ }
+}
+
+// In this type trait, we look for an __append_default_init member function, and
+// we use it if available, otherwise, we use append.
+template <typename string_type, typename = void>
+struct AppendUninitializedTraits {
+ static void Append(string_type* s, size_t n) {
+ s->append(n, typename string_type::value_type());
+ }
+};
+
+template <typename string_type>
+struct AppendUninitializedTraits<
+ string_type, absl::void_t<decltype(std::declval<string_type&>()
+ .__append_default_init(237))> > {
+ static void Append(string_type* s, size_t n) {
+ s->__append_default_init(n);
+ }
+};
+
+// Like STLStringResizeUninitialized(str, new_size), except guaranteed to use
+// exponential growth so that the amortized complexity of increasing the string
+// size by a small amount is O(1), in contrast to O(str->size()) in the case of
+// precise growth.
+template <typename string_type>
+void STLStringResizeUninitializedAmortized(string_type* s, size_t new_size) {
+ const size_t size = s->size();
+ if (new_size > size) {
+ AppendUninitializedTraits<string_type>::Append(s, new_size - size);
+ } else {
+ s->erase(new_size);
+ }
+}
+
} // namespace strings_internal
ABSL_NAMESPACE_END
} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc
index 0f8b3c2a..ad1b9c58 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc
@@ -19,64 +19,115 @@
namespace {
int resize_call_count = 0;
+int append_call_count = 0;
// A mock string class whose only purpose is to track how many times its
-// resize() method has been called.
+// resize()/append() methods have been called.
struct resizable_string {
+ using value_type = char;
size_t size() const { return 0; }
+ size_t capacity() const { return 0; }
char& operator[](size_t) {
static char c = '\0';
return c;
}
void resize(size_t) { resize_call_count += 1; }
+ void append(size_t, value_type) { append_call_count += 1; }
+ void reserve(size_t) {}
+ resizable_string& erase(size_t = 0, size_t = 0) { return *this; }
};
int resize_default_init_call_count = 0;
+int append_default_init_call_count = 0;
// A mock string class whose only purpose is to track how many times its
-// resize() and __resize_default_init() methods have been called.
-struct resize_default_init_string {
+// resize()/__resize_default_init()/append()/__append_default_init() methods
+// have been called.
+struct default_init_string {
size_t size() const { return 0; }
+ size_t capacity() const { return 0; }
char& operator[](size_t) {
static char c = '\0';
return c;
}
void resize(size_t) { resize_call_count += 1; }
void __resize_default_init(size_t) { resize_default_init_call_count += 1; }
+ void __append_default_init(size_t) { append_default_init_call_count += 1; }
+ void reserve(size_t) {}
+ default_init_string& erase(size_t = 0, size_t = 0) { return *this; }
};
TEST(ResizeUninit, WithAndWithout) {
resize_call_count = 0;
+ append_call_count = 0;
resize_default_init_call_count = 0;
+ append_default_init_call_count = 0;
{
resizable_string rs;
EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
EXPECT_FALSE(
absl::strings_internal::STLStringSupportsNontrashingResize(&rs));
EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
absl::strings_internal::STLStringResizeUninitialized(&rs, 237);
EXPECT_EQ(resize_call_count, 1);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
+ absl::strings_internal::STLStringResizeUninitializedAmortized(&rs, 1000);
+ EXPECT_EQ(resize_call_count, 1);
+ EXPECT_EQ(append_call_count, 1);
+ EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
}
resize_call_count = 0;
+ append_call_count = 0;
resize_default_init_call_count = 0;
+ append_default_init_call_count = 0;
{
- resize_default_init_string rus;
+ default_init_string rus;
EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
EXPECT_TRUE(
absl::strings_internal::STLStringSupportsNontrashingResize(&rus));
EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 0);
+ EXPECT_EQ(append_default_init_call_count, 0);
absl::strings_internal::STLStringResizeUninitialized(&rus, 237);
EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
+ EXPECT_EQ(resize_default_init_call_count, 1);
+ EXPECT_EQ(append_default_init_call_count, 0);
+ absl::strings_internal::STLStringResizeUninitializedAmortized(&rus, 1000);
+ EXPECT_EQ(resize_call_count, 0);
+ EXPECT_EQ(append_call_count, 0);
EXPECT_EQ(resize_default_init_call_count, 1);
+ EXPECT_EQ(append_default_init_call_count, 1);
+ }
+}
+
+TEST(ResizeUninit, Amortized) {
+ std::string str;
+ size_t prev_cap = str.capacity();
+ int cap_increase_count = 0;
+ for (int i = 0; i < 1000; ++i) {
+ absl::strings_internal::STLStringResizeUninitializedAmortized(&str, i);
+ size_t new_cap = str.capacity();
+ if (new_cap > prev_cap) ++cap_increase_count;
+ prev_cap = new_cap;
}
+ EXPECT_LT(cap_increase_count, 50);
}
} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h
index 7040c866..3c91be70 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h
@@ -122,6 +122,14 @@ StringConvertResult FormatConvertImpl(const std::string& v,
StringConvertResult FormatConvertImpl(string_view v,
FormatConversionSpecImpl conv,
FormatSinkImpl* sink);
+#if defined(ABSL_HAVE_STD_STRING_VIEW) && !defined(ABSL_USES_STD_STRING_VIEW)
+inline StringConvertResult FormatConvertImpl(std::string_view v,
+ FormatConversionSpecImpl conv,
+ FormatSinkImpl* sink) {
+ return FormatConvertImpl(absl::string_view(v.data(), v.size()), conv, sink);
+}
+#endif // ABSL_HAVE_STD_STRING_VIEW && !ABSL_USES_STD_STRING_VIEW
+
ArgConvertResult<FormatConversionCharSetUnion(
FormatConversionCharSetInternal::s, FormatConversionCharSetInternal::p)>
FormatConvertImpl(const char* v, const FormatConversionSpecImpl conv,
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc
index 4e68b90b..c988ba8f 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc
@@ -58,7 +58,7 @@ inline bool ArgContext::Bind(const UnboundConversion* unbound,
if (static_cast<size_t>(arg_position - 1) >= pack_.size()) return false;
arg = &pack_[arg_position - 1]; // 1-based
- if (!unbound->flags.basic) {
+ if (unbound->flags != Flags::kBasic) {
int width = unbound->width.value();
bool force_left = false;
if (unbound->width.is_from_arg()) {
@@ -84,9 +84,8 @@ inline bool ArgContext::Bind(const UnboundConversion* unbound,
FormatConversionSpecImplFriend::SetPrecision(precision, bound);
if (force_left) {
- Flags flags = unbound->flags;
- flags.left = true;
- FormatConversionSpecImplFriend::SetFlags(flags, bound);
+ FormatConversionSpecImplFriend::SetFlags(unbound->flags | Flags::kLeft,
+ bound);
} else {
FormatConversionSpecImplFriend::SetFlags(unbound->flags, bound);
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h
index 267cc0ef..b26cff66 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h
@@ -100,7 +100,7 @@ class FormatSpecTemplate
// We use the 'unavailable' attribute to give a better compiler error than
// just 'method is deleted'.
// To avoid checking the format twice, we just check that the format is
- // constexpr. If is it valid, then the overload below will kick in.
+ // constexpr. If it is valid, then the overload below will kick in.
// We add the template here to make this overload have lower priority.
template <typename = void>
FormatSpecTemplate(const char* s) // NOLINT
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc
index 926283cf..91e03609 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/convert_test.cc
@@ -229,6 +229,9 @@ TEST_F(FormatConvertTest, BasicString) {
TestStringConvert(static_cast<const char*>("hello"));
TestStringConvert(std::string("hello"));
TestStringConvert(string_view("hello"));
+#if defined(ABSL_HAVE_STD_STRING_VIEW)
+ TestStringConvert(std::string_view("hello"));
+#endif // ABSL_HAVE_STD_STRING_VIEW
}
TEST_F(FormatConvertTest, NullString) {
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc
index bb0d96cf..484f6ebf 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc
@@ -23,13 +23,13 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace str_format_internal {
-std::string Flags::ToString() const {
+std::string FlagsToString(Flags v) {
std::string s;
- s.append(left ? "-" : "");
- s.append(show_pos ? "+" : "");
- s.append(sign_col ? " " : "");
- s.append(alt ? "#" : "");
- s.append(zero ? "0" : "");
+ s.append(FlagsContains(v, Flags::kLeft) ? "-" : "");
+ s.append(FlagsContains(v, Flags::kShowPos) ? "+" : "");
+ s.append(FlagsContains(v, Flags::kSignCol) ? " " : "");
+ s.append(FlagsContains(v, Flags::kAlt) ? "#" : "");
+ s.append(FlagsContains(v, Flags::kZero) ? "0" : "");
return s;
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
index a9b9e137..55cbb56d 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h
@@ -128,19 +128,33 @@ class FormatSinkImpl {
char buf_[1024];
};
-struct Flags {
- bool basic : 1; // fastest conversion: no flags, width, or precision
- bool left : 1; // "-"
- bool show_pos : 1; // "+"
- bool sign_col : 1; // " "
- bool alt : 1; // "#"
- bool zero : 1; // "0"
- std::string ToString() const;
- friend std::ostream& operator<<(std::ostream& os, const Flags& v) {
- return os << v.ToString();
- }
+enum class Flags : uint8_t {
+ kBasic = 0,
+ kLeft = 1 << 0,
+ kShowPos = 1 << 1,
+ kSignCol = 1 << 2,
+ kAlt = 1 << 3,
+ kZero = 1 << 4,
+ // This is not a real flag. It just exists to turn off kBasic when no other
+ // flags are set. This is for when width/precision are specified.
+ kNonBasic = 1 << 5,
};
+constexpr Flags operator|(Flags a, Flags b) {
+ return static_cast<Flags>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
+}
+
+constexpr bool FlagsContains(Flags haystack, Flags needle) {
+ return (static_cast<uint8_t>(haystack) & static_cast<uint8_t>(needle)) ==
+ static_cast<uint8_t>(needle);
+}
+
+std::string FlagsToString(Flags v);
+
+inline std::ostream& operator<<(std::ostream& os, Flags v) {
+ return os << FlagsToString(v);
+}
+
// clang-format off
#define ABSL_INTERNAL_CONVERSION_CHARS_EXPAND_(X_VAL, X_SEP) \
/* text */ \
@@ -257,12 +271,16 @@ struct FormatConversionSpecImplFriend;
class FormatConversionSpecImpl {
public:
// Width and precison are not specified, no flags are set.
- bool is_basic() const { return flags_.basic; }
- bool has_left_flag() const { return flags_.left; }
- bool has_show_pos_flag() const { return flags_.show_pos; }
- bool has_sign_col_flag() const { return flags_.sign_col; }
- bool has_alt_flag() const { return flags_.alt; }
- bool has_zero_flag() const { return flags_.zero; }
+ bool is_basic() const { return flags_ == Flags::kBasic; }
+ bool has_left_flag() const { return FlagsContains(flags_, Flags::kLeft); }
+ bool has_show_pos_flag() const {
+ return FlagsContains(flags_, Flags::kShowPos);
+ }
+ bool has_sign_col_flag() const {
+ return FlagsContains(flags_, Flags::kSignCol);
+ }
+ bool has_alt_flag() const { return FlagsContains(flags_, Flags::kAlt); }
+ bool has_zero_flag() const { return FlagsContains(flags_, Flags::kZero); }
FormatConversionChar conversion_char() const {
// Keep this field first in the struct . It generates better code when
@@ -306,7 +324,7 @@ struct FormatConversionSpecImplFriend final {
conv->precision_ = p;
}
static std::string FlagsToString(const FormatConversionSpecImpl& spec) {
- return spec.flags_.ToString();
+ return str_format_internal::FlagsToString(spec.flags_);
}
};
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc
index f308d023..2c9c07da 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc
@@ -34,60 +34,67 @@ namespace str_format_internal {
using CC = FormatConversionCharInternal;
using LM = LengthMod;
+// Abbreviations to fit in the table below.
+constexpr auto f_sign = Flags::kSignCol;
+constexpr auto f_alt = Flags::kAlt;
+constexpr auto f_pos = Flags::kShowPos;
+constexpr auto f_left = Flags::kLeft;
+constexpr auto f_zero = Flags::kZero;
+
ABSL_CONST_INIT const ConvTag kTags[256] = {
- {}, {}, {}, {}, {}, {}, {}, {}, // 00-07
- {}, {}, {}, {}, {}, {}, {}, {}, // 08-0f
- {}, {}, {}, {}, {}, {}, {}, {}, // 10-17
- {}, {}, {}, {}, {}, {}, {}, {}, // 18-1f
- {}, {}, {}, {}, {}, {}, {}, {}, // 20-27
- {}, {}, {}, {}, {}, {}, {}, {}, // 28-2f
- {}, {}, {}, {}, {}, {}, {}, {}, // 30-37
- {}, {}, {}, {}, {}, {}, {}, {}, // 38-3f
- {}, CC::A, {}, {}, {}, CC::E, CC::F, CC::G, // @ABCDEFG
- {}, {}, {}, {}, LM::L, {}, {}, {}, // HIJKLMNO
- {}, {}, {}, {}, {}, {}, {}, {}, // PQRSTUVW
- CC::X, {}, {}, {}, {}, {}, {}, {}, // XYZ[\]^_
- {}, CC::a, {}, CC::c, CC::d, CC::e, CC::f, CC::g, // `abcdefg
- LM::h, CC::i, LM::j, {}, LM::l, {}, CC::n, CC::o, // hijklmno
- CC::p, LM::q, {}, CC::s, LM::t, CC::u, {}, {}, // pqrstuvw
- CC::x, {}, LM::z, {}, {}, {}, {}, {}, // xyz{|}!
- {}, {}, {}, {}, {}, {}, {}, {}, // 80-87
- {}, {}, {}, {}, {}, {}, {}, {}, // 88-8f
- {}, {}, {}, {}, {}, {}, {}, {}, // 90-97
- {}, {}, {}, {}, {}, {}, {}, {}, // 98-9f
- {}, {}, {}, {}, {}, {}, {}, {}, // a0-a7
- {}, {}, {}, {}, {}, {}, {}, {}, // a8-af
- {}, {}, {}, {}, {}, {}, {}, {}, // b0-b7
- {}, {}, {}, {}, {}, {}, {}, {}, // b8-bf
- {}, {}, {}, {}, {}, {}, {}, {}, // c0-c7
- {}, {}, {}, {}, {}, {}, {}, {}, // c8-cf
- {}, {}, {}, {}, {}, {}, {}, {}, // d0-d7
- {}, {}, {}, {}, {}, {}, {}, {}, // d8-df
- {}, {}, {}, {}, {}, {}, {}, {}, // e0-e7
- {}, {}, {}, {}, {}, {}, {}, {}, // e8-ef
- {}, {}, {}, {}, {}, {}, {}, {}, // f0-f7
- {}, {}, {}, {}, {}, {}, {}, {}, // f8-ff
+ {}, {}, {}, {}, {}, {}, {}, {}, // 00-07
+ {}, {}, {}, {}, {}, {}, {}, {}, // 08-0f
+ {}, {}, {}, {}, {}, {}, {}, {}, // 10-17
+ {}, {}, {}, {}, {}, {}, {}, {}, // 18-1f
+ f_sign, {}, {}, f_alt, {}, {}, {}, {}, // !"#$%&'
+ {}, {}, {}, f_pos, {}, f_left, {}, {}, // ()*+,-./
+ f_zero, {}, {}, {}, {}, {}, {}, {}, // 01234567
+ {}, {}, {}, {}, {}, {}, {}, {}, // 89:;<=>?
+ {}, CC::A, {}, {}, {}, CC::E, CC::F, CC::G, // @ABCDEFG
+ {}, {}, {}, {}, LM::L, {}, {}, {}, // HIJKLMNO
+ {}, {}, {}, {}, {}, {}, {}, {}, // PQRSTUVW
+ CC::X, {}, {}, {}, {}, {}, {}, {}, // XYZ[\]^_
+ {}, CC::a, {}, CC::c, CC::d, CC::e, CC::f, CC::g, // `abcdefg
+ LM::h, CC::i, LM::j, {}, LM::l, {}, CC::n, CC::o, // hijklmno
+ CC::p, LM::q, {}, CC::s, LM::t, CC::u, {}, {}, // pqrstuvw
+ CC::x, {}, LM::z, {}, {}, {}, {}, {}, // xyz{|}!
+ {}, {}, {}, {}, {}, {}, {}, {}, // 80-87
+ {}, {}, {}, {}, {}, {}, {}, {}, // 88-8f
+ {}, {}, {}, {}, {}, {}, {}, {}, // 90-97
+ {}, {}, {}, {}, {}, {}, {}, {}, // 98-9f
+ {}, {}, {}, {}, {}, {}, {}, {}, // a0-a7
+ {}, {}, {}, {}, {}, {}, {}, {}, // a8-af
+ {}, {}, {}, {}, {}, {}, {}, {}, // b0-b7
+ {}, {}, {}, {}, {}, {}, {}, {}, // b8-bf
+ {}, {}, {}, {}, {}, {}, {}, {}, // c0-c7
+ {}, {}, {}, {}, {}, {}, {}, {}, // c8-cf
+ {}, {}, {}, {}, {}, {}, {}, {}, // d0-d7
+ {}, {}, {}, {}, {}, {}, {}, {}, // d8-df
+ {}, {}, {}, {}, {}, {}, {}, {}, // e0-e7
+ {}, {}, {}, {}, {}, {}, {}, {}, // e8-ef
+ {}, {}, {}, {}, {}, {}, {}, {}, // f0-f7
+ {}, {}, {}, {}, {}, {}, {}, {}, // f8-ff
};
namespace {
bool CheckFastPathSetting(const UnboundConversion& conv) {
- bool should_be_basic = !conv.flags.left && //
- !conv.flags.show_pos && //
- !conv.flags.sign_col && //
- !conv.flags.alt && //
- !conv.flags.zero && //
- (conv.width.value() == -1) &&
- (conv.precision.value() == -1);
- if (should_be_basic != conv.flags.basic) {
+ bool width_precision_needed =
+ conv.width.value() >= 0 || conv.precision.value() >= 0;
+ if (width_precision_needed && conv.flags == Flags::kBasic) {
fprintf(stderr,
"basic=%d left=%d show_pos=%d sign_col=%d alt=%d zero=%d "
"width=%d precision=%d\n",
- conv.flags.basic, conv.flags.left, conv.flags.show_pos,
- conv.flags.sign_col, conv.flags.alt, conv.flags.zero,
- conv.width.value(), conv.precision.value());
+ conv.flags == Flags::kBasic ? 1 : 0,
+ FlagsContains(conv.flags, Flags::kLeft) ? 1 : 0,
+ FlagsContains(conv.flags, Flags::kShowPos) ? 1 : 0,
+ FlagsContains(conv.flags, Flags::kSignCol) ? 1 : 0,
+ FlagsContains(conv.flags, Flags::kAlt) ? 1 : 0,
+ FlagsContains(conv.flags, Flags::kZero) ? 1 : 0, conv.width.value(),
+ conv.precision.value());
+ return false;
}
- return should_be_basic == conv.flags.basic;
+ return true;
}
template <bool is_positional>
@@ -131,40 +138,21 @@ const char *ConsumeConversion(const char *pos, const char *const end,
ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
// We should start with the basic flag on.
- assert(conv->flags.basic);
+ assert(conv->flags == Flags::kBasic);
// Any non alpha character makes this conversion not basic.
// This includes flags (-+ #0), width (1-9, *) or precision (.).
// All conversion characters and length modifiers are alpha characters.
if (c < 'A') {
- conv->flags.basic = false;
-
- for (; c <= '0';) {
- // FIXME: We might be able to speed this up reusing the lookup table from
- // above. It might require changing Flags to be a plain integer where we
- // can |= a value.
- switch (c) {
- case '-':
- conv->flags.left = true;
- break;
- case '+':
- conv->flags.show_pos = true;
- break;
- case ' ':
- conv->flags.sign_col = true;
- break;
- case '#':
- conv->flags.alt = true;
- break;
- case '0':
- conv->flags.zero = true;
- break;
- default:
- goto flags_done;
+ while (c <= '0') {
+ auto tag = GetTagForChar(c);
+ if (tag.is_flags()) {
+ conv->flags = conv->flags | tag.as_flags();
+ ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
+ } else {
+ break;
}
- ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
}
-flags_done:
if (c <= '9') {
if (c >= '0') {
@@ -173,12 +161,12 @@ flags_done:
if (ABSL_PREDICT_FALSE(*next_arg != 0)) return nullptr;
// Positional conversion.
*next_arg = -1;
- conv->flags = Flags();
- conv->flags.basic = true;
return ConsumeConversion<true>(original_pos, end, conv, next_arg);
}
+ conv->flags = conv->flags | Flags::kNonBasic;
conv->width.set_value(maybe_width);
} else if (c == '*') {
+ conv->flags = conv->flags | Flags::kNonBasic;
ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
if (is_positional) {
if (ABSL_PREDICT_FALSE(c < '1' || c > '9')) return nullptr;
@@ -192,6 +180,7 @@ flags_done:
}
if (c == '.') {
+ conv->flags = conv->flags | Flags::kNonBasic;
ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR();
if (std::isdigit(c)) {
conv->precision.set_value(parse_digits());
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h
index 6504dd3d..ad8646ed 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h
@@ -41,10 +41,7 @@ std::string LengthModToString(LengthMod v);
// The analyzed properties of a single specified conversion.
struct UnboundConversion {
- UnboundConversion()
- : flags() /* This is required to zero all the fields of flags. */ {
- flags.basic = true;
- }
+ UnboundConversion() {}
class InputValue {
public:
@@ -79,7 +76,7 @@ struct UnboundConversion {
InputValue width;
InputValue precision;
- Flags flags;
+ Flags flags = Flags::kBasic;
LengthMod length_mod = LengthMod::none;
FormatConversionChar conv = FormatConversionCharInternal::kNone;
};
@@ -93,32 +90,43 @@ const char* ConsumeUnboundConversion(const char* p, const char* end,
UnboundConversion* conv, int* next_arg);
// Helper tag class for the table below.
-// It allows fast `char -> ConversionChar/LengthMod` checking and
+// It allows fast `char -> ConversionChar/LengthMod/Flags` checking and
// conversions.
class ConvTag {
public:
constexpr ConvTag(FormatConversionChar conversion_char) // NOLINT
- : tag_(static_cast<int8_t>(conversion_char)) {}
- // We invert the length modifiers to make them negative so that we can easily
- // test for them.
+ : tag_(static_cast<uint8_t>(conversion_char)) {}
constexpr ConvTag(LengthMod length_mod) // NOLINT
- : tag_(~static_cast<std::int8_t>(length_mod)) {}
- // Everything else is -128, which is negative to make is_conv() simpler.
- constexpr ConvTag() : tag_(-128) {}
+ : tag_(0x80 | static_cast<uint8_t>(length_mod)) {}
+ constexpr ConvTag(Flags flags) // NOLINT
+ : tag_(0xc0 | static_cast<uint8_t>(flags)) {}
+ constexpr ConvTag() : tag_(0xFF) {}
+
+ bool is_conv() const { return (tag_ & 0x80) == 0; }
+ bool is_length() const { return (tag_ & 0xC0) == 0x80; }
+ bool is_flags() const { return (tag_ & 0xE0) == 0xC0; }
- bool is_conv() const { return tag_ >= 0; }
- bool is_length() const { return tag_ < 0 && tag_ != -128; }
FormatConversionChar as_conv() const {
assert(is_conv());
+ assert(!is_length());
+ assert(!is_flags());
return static_cast<FormatConversionChar>(tag_);
}
LengthMod as_length() const {
+ assert(!is_conv());
assert(is_length());
- return static_cast<LengthMod>(~tag_);
+ assert(!is_flags());
+ return static_cast<LengthMod>(tag_ & 0x3F);
+ }
+ Flags as_flags() const {
+ assert(!is_conv());
+ assert(!is_length());
+ assert(is_flags());
+ return static_cast<Flags>(tag_ & 0x1F);
}
private:
- std::int8_t tag_;
+ uint8_t tag_;
};
extern const ConvTag kTags[256];
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc
index a5fa1c79..fe0d2963 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc
@@ -270,15 +270,22 @@ TEST_F(ConsumeUnboundConversionTest, Flags) {
for (int k = 0; k < kNumFlags; ++k)
if ((i >> k) & 1) fmt += kAllFlags[k];
// flag order shouldn't matter
- if (rev == 1) { std::reverse(fmt.begin(), fmt.end()); }
+ if (rev == 1) {
+ std::reverse(fmt.begin(), fmt.end());
+ }
fmt += 'd';
SCOPED_TRACE(fmt);
EXPECT_TRUE(Run(fmt.c_str()));
- EXPECT_EQ(fmt.find('-') == std::string::npos, !o.flags.left);
- EXPECT_EQ(fmt.find('+') == std::string::npos, !o.flags.show_pos);
- EXPECT_EQ(fmt.find(' ') == std::string::npos, !o.flags.sign_col);
- EXPECT_EQ(fmt.find('#') == std::string::npos, !o.flags.alt);
- EXPECT_EQ(fmt.find('0') == std::string::npos, !o.flags.zero);
+ EXPECT_EQ(fmt.find('-') == std::string::npos,
+ !FlagsContains(o.flags, Flags::kLeft));
+ EXPECT_EQ(fmt.find('+') == std::string::npos,
+ !FlagsContains(o.flags, Flags::kShowPos));
+ EXPECT_EQ(fmt.find(' ') == std::string::npos,
+ !FlagsContains(o.flags, Flags::kSignCol));
+ EXPECT_EQ(fmt.find('#') == std::string::npos,
+ !FlagsContains(o.flags, Flags::kAlt));
+ EXPECT_EQ(fmt.find('0') == std::string::npos,
+ !FlagsContains(o.flags, Flags::kZero));
}
}
}
@@ -288,14 +295,14 @@ TEST_F(ConsumeUnboundConversionTest, BasicFlag) {
for (const char* fmt : {"d", "llx", "G", "1$X"}) {
SCOPED_TRACE(fmt);
EXPECT_TRUE(Run(fmt));
- EXPECT_TRUE(o.flags.basic);
+ EXPECT_EQ(o.flags, Flags::kBasic);
}
// Flag is off
for (const char* fmt : {"3d", ".llx", "-G", "1$#X"}) {
SCOPED_TRACE(fmt);
EXPECT_TRUE(Run(fmt));
- EXPECT_FALSE(o.flags.basic);
+ EXPECT_NE(o.flags, Flags::kBasic);
}
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h b/grpc/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h
index a2f41c15..e7664216 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h
@@ -32,7 +32,7 @@
#include <array>
#include <initializer_list>
#include <iterator>
-#include <map>
+#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
@@ -64,7 +64,7 @@ class ConvertibleToStringView {
ConvertibleToStringView(const std::string& s) // NOLINT(runtime/explicit)
: value_(s) {}
- // Matches rvalue strings and moves their data to a member.
+ // Disable conversion from rvalue strings.
ConvertibleToStringView(std::string&& s) = delete;
ConvertibleToStringView(const std::string&& s) = delete;
@@ -182,6 +182,13 @@ template <typename T>
struct HasConstIterator<T, absl::void_t<typename T::const_iterator>>
: std::true_type {};
+// HasEmplace<T>::value is true iff there exists a method T::emplace().
+template <typename T, typename = void>
+struct HasEmplace : std::false_type {};
+template <typename T>
+struct HasEmplace<T, absl::void_t<decltype(std::declval<T>().emplace())>>
+ : std::true_type {};
+
// IsInitializerList<T>::value is true iff T is an std::initializer_list. More
// details below in Splitter<> where this is used.
std::false_type IsInitializerListDispatch(...); // default: No
@@ -372,50 +379,43 @@ class Splitter {
// value.
template <typename Container, typename First, typename Second>
struct ConvertToContainer<Container, std::pair<const First, Second>, true> {
+ using iterator = typename Container::iterator;
+
Container operator()(const Splitter& splitter) const {
Container m;
- typename Container::iterator it;
+ iterator it;
bool insert = true;
- for (const auto& sp : splitter) {
+ for (const absl::string_view sv : splitter) {
if (insert) {
- it = Inserter<Container>::Insert(&m, First(sp), Second());
+ it = InsertOrEmplace(&m, sv);
} else {
- it->second = Second(sp);
+ it->second = Second(sv);
}
insert = !insert;
}
return m;
}
- // Inserts the key and value into the given map, returning an iterator to
- // the inserted item. Specialized for std::map and std::multimap to use
- // emplace() and adapt emplace()'s return value.
- template <typename Map>
- struct Inserter {
- using M = Map;
- template <typename... Args>
- static typename M::iterator Insert(M* m, Args&&... args) {
- return m->insert(std::make_pair(std::forward<Args>(args)...)).first;
- }
- };
-
- template <typename... Ts>
- struct Inserter<std::map<Ts...>> {
- using M = std::map<Ts...>;
- template <typename... Args>
- static typename M::iterator Insert(M* m, Args&&... args) {
- return m->emplace(std::make_pair(std::forward<Args>(args)...)).first;
- }
- };
-
- template <typename... Ts>
- struct Inserter<std::multimap<Ts...>> {
- using M = std::multimap<Ts...>;
- template <typename... Args>
- static typename M::iterator Insert(M* m, Args&&... args) {
- return m->emplace(std::make_pair(std::forward<Args>(args)...));
- }
- };
+ // Inserts the key and an empty value into the map, returning an iterator to
+ // the inserted item. We use emplace() if available, otherwise insert().
+ template <typename M>
+ static absl::enable_if_t<HasEmplace<M>::value, iterator> InsertOrEmplace(
+ M* m, absl::string_view key) {
+ // Use piecewise_construct to support old versions of gcc in which pair
+ // constructor can't otherwise construct string from string_view.
+ return ToIter(m->emplace(std::piecewise_construct, std::make_tuple(key),
+ std::tuple<>()));
+ }
+ template <typename M>
+ static absl::enable_if_t<!HasEmplace<M>::value, iterator> InsertOrEmplace(
+ M* m, absl::string_view key) {
+ return ToIter(m->insert(std::make_pair(First(key), Second(""))));
+ }
+
+ static iterator ToIter(std::pair<iterator, bool> pair) {
+ return pair.first;
+ }
+ static iterator ToIter(iterator iter) { return iter; }
};
StringType text_;
diff --git a/grpc/third_party/abseil-cpp/absl/strings/numbers.cc b/grpc/third_party/abseil-cpp/absl/strings/numbers.cc
index 966d94bd..cbd84c91 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/numbers.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/numbers.cc
@@ -505,7 +505,7 @@ size_t numbers_internal::SixDigitsToBuffer(double d, char* const buffer) {
*out++ = '-';
d = -d;
}
- if (std::isinf(d)) {
+ if (d > std::numeric_limits<double>::max()) {
strcpy(out, "inf"); // NOLINT(runtime/printf)
return out + 3 - buffer;
}
diff --git a/grpc/third_party/abseil-cpp/absl/strings/numbers.h b/grpc/third_party/abseil-cpp/absl/strings/numbers.h
index 1780bb44..4ae07c2d 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/numbers.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/numbers.h
@@ -96,6 +96,25 @@ ABSL_MUST_USE_RESULT bool SimpleAtod(absl::string_view str, double* out);
// unspecified state.
ABSL_MUST_USE_RESULT bool SimpleAtob(absl::string_view str, bool* out);
+// SimpleHexAtoi()
+//
+// Converts a hexadecimal string (optionally followed or preceded by ASCII
+// whitespace) to an integer, returning `true` if successful. Only valid base-16
+// hexadecimal integers whose value falls within the range of the integer type
+// (optionally preceded by a `+` or `-`) can be converted. A valid hexadecimal
+// value may include both upper and lowercase character symbols, and may
+// optionally include a leading "0x" (or "0X") number prefix, which is ignored
+// by this function. If any errors are encountered, this function returns
+// `false`, leaving `out` in an unspecified state.
+template <typename int_type>
+ABSL_MUST_USE_RESULT bool SimpleHexAtoi(absl::string_view str, int_type* out);
+
+// Overloads of SimpleHexAtoi() for 128 bit integers.
+ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(absl::string_view str,
+ absl::int128* out);
+ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(absl::string_view str,
+ absl::uint128* out);
+
ABSL_NAMESPACE_END
} // namespace absl
@@ -260,6 +279,21 @@ ABSL_MUST_USE_RESULT inline bool SimpleAtoi(absl::string_view str,
return numbers_internal::safe_strtou128_base(str, out, 10);
}
+template <typename int_type>
+ABSL_MUST_USE_RESULT bool SimpleHexAtoi(absl::string_view str, int_type* out) {
+ return numbers_internal::safe_strtoi_base(str, out, 16);
+}
+
+ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(absl::string_view str,
+ absl::int128* out) {
+ return numbers_internal::safe_strto128_base(str, out, 16);
+}
+
+ABSL_MUST_USE_RESULT inline bool SimpleHexAtoi(absl::string_view str,
+ absl::uint128* out) {
+ return numbers_internal::safe_strtou128_base(str, out, 16);
+}
+
ABSL_NAMESPACE_END
} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/strings/numbers_test.cc b/grpc/third_party/abseil-cpp/absl/strings/numbers_test.cc
index f3103106..498c210d 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/numbers_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/numbers_test.cc
@@ -47,6 +47,7 @@
namespace {
using absl::SimpleAtoi;
+using absl::SimpleHexAtoi;
using absl::numbers_internal::kSixDigitsToBufferSize;
using absl::numbers_internal::safe_strto32_base;
using absl::numbers_internal::safe_strto64_base;
@@ -468,6 +469,148 @@ TEST(NumbersTest, Atoenum) {
VerifySimpleAtoiGood<E_biguint>(E_biguint_max32, E_biguint_max32);
}
+template <typename int_type, typename in_val_type>
+void VerifySimpleHexAtoiGood(in_val_type in_value, int_type exp_value) {
+ std::string s;
+ // uint128 can be streamed but not StrCat'd
+ absl::strings_internal::OStringStream strm(&s);
+ if (in_value >= 0) {
+ strm << std::hex << in_value;
+ } else {
+ // Inefficient for small integers, but works with all integral types.
+ strm << "-" << std::hex << -absl::uint128(in_value);
+ }
+ int_type x = static_cast<int_type>(~exp_value);
+ EXPECT_TRUE(SimpleHexAtoi(s, &x))
+ << "in_value=" << std::hex << in_value << " s=" << s << " x=" << x;
+ EXPECT_EQ(exp_value, x);
+ x = static_cast<int_type>(~exp_value);
+ EXPECT_TRUE(SimpleHexAtoi(
+ s.c_str(), &x)); // NOLINT: readability-redundant-string-conversions
+ EXPECT_EQ(exp_value, x);
+}
+
+template <typename int_type, typename in_val_type>
+void VerifySimpleHexAtoiBad(in_val_type in_value) {
+ std::string s;
+ // uint128 can be streamed but not StrCat'd
+ absl::strings_internal::OStringStream strm(&s);
+ if (in_value >= 0) {
+ strm << std::hex << in_value;
+ } else {
+ // Inefficient for small integers, but works with all integral types.
+ strm << "-" << std::hex << -absl::uint128(in_value);
+ }
+ int_type x;
+ EXPECT_FALSE(SimpleHexAtoi(s, &x));
+ EXPECT_FALSE(SimpleHexAtoi(
+ s.c_str(), &x)); // NOLINT: readability-redundant-string-conversions
+}
+
+TEST(NumbersTest, HexAtoi) {
+ // SimpleHexAtoi(absl::string_view, int32_t)
+ VerifySimpleHexAtoiGood<int32_t>(0, 0);
+ VerifySimpleHexAtoiGood<int32_t>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<int32_t>(-0x42, -0x42);
+
+ VerifySimpleHexAtoiGood<int32_t>(std::numeric_limits<int32_t>::min(),
+ std::numeric_limits<int32_t>::min());
+ VerifySimpleHexAtoiGood<int32_t>(std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<int32_t>::max());
+
+ // SimpleHexAtoi(absl::string_view, uint32_t)
+ VerifySimpleHexAtoiGood<uint32_t>(0, 0);
+ VerifySimpleHexAtoiGood<uint32_t>(0x42, 0x42);
+ VerifySimpleHexAtoiBad<uint32_t>(-0x42);
+
+ VerifySimpleHexAtoiBad<uint32_t>(std::numeric_limits<int32_t>::min());
+ VerifySimpleHexAtoiGood<uint32_t>(std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<int32_t>::max());
+ VerifySimpleHexAtoiGood<uint32_t>(std::numeric_limits<uint32_t>::max(),
+ std::numeric_limits<uint32_t>::max());
+ VerifySimpleHexAtoiBad<uint32_t>(std::numeric_limits<int64_t>::min());
+ VerifySimpleHexAtoiBad<uint32_t>(std::numeric_limits<int64_t>::max());
+ VerifySimpleHexAtoiBad<uint32_t>(std::numeric_limits<uint64_t>::max());
+
+ // SimpleHexAtoi(absl::string_view, int64_t)
+ VerifySimpleHexAtoiGood<int64_t>(0, 0);
+ VerifySimpleHexAtoiGood<int64_t>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<int64_t>(-0x42, -0x42);
+
+ VerifySimpleHexAtoiGood<int64_t>(std::numeric_limits<int32_t>::min(),
+ std::numeric_limits<int32_t>::min());
+ VerifySimpleHexAtoiGood<int64_t>(std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<int32_t>::max());
+ VerifySimpleHexAtoiGood<int64_t>(std::numeric_limits<uint32_t>::max(),
+ std::numeric_limits<uint32_t>::max());
+ VerifySimpleHexAtoiGood<int64_t>(std::numeric_limits<int64_t>::min(),
+ std::numeric_limits<int64_t>::min());
+ VerifySimpleHexAtoiGood<int64_t>(std::numeric_limits<int64_t>::max(),
+ std::numeric_limits<int64_t>::max());
+ VerifySimpleHexAtoiBad<int64_t>(std::numeric_limits<uint64_t>::max());
+
+ // SimpleHexAtoi(absl::string_view, uint64_t)
+ VerifySimpleHexAtoiGood<uint64_t>(0, 0);
+ VerifySimpleHexAtoiGood<uint64_t>(0x42, 0x42);
+ VerifySimpleHexAtoiBad<uint64_t>(-0x42);
+
+ VerifySimpleHexAtoiBad<uint64_t>(std::numeric_limits<int32_t>::min());
+ VerifySimpleHexAtoiGood<uint64_t>(std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<int32_t>::max());
+ VerifySimpleHexAtoiGood<uint64_t>(std::numeric_limits<uint32_t>::max(),
+ std::numeric_limits<uint32_t>::max());
+ VerifySimpleHexAtoiBad<uint64_t>(std::numeric_limits<int64_t>::min());
+ VerifySimpleHexAtoiGood<uint64_t>(std::numeric_limits<int64_t>::max(),
+ std::numeric_limits<int64_t>::max());
+ VerifySimpleHexAtoiGood<uint64_t>(std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max());
+
+ // SimpleHexAtoi(absl::string_view, absl::uint128)
+ VerifySimpleHexAtoiGood<absl::uint128>(0, 0);
+ VerifySimpleHexAtoiGood<absl::uint128>(0x42, 0x42);
+ VerifySimpleHexAtoiBad<absl::uint128>(-0x42);
+
+ VerifySimpleHexAtoiBad<absl::uint128>(std::numeric_limits<int32_t>::min());
+ VerifySimpleHexAtoiGood<absl::uint128>(std::numeric_limits<int32_t>::max(),
+ std::numeric_limits<int32_t>::max());
+ VerifySimpleHexAtoiGood<absl::uint128>(std::numeric_limits<uint32_t>::max(),
+ std::numeric_limits<uint32_t>::max());
+ VerifySimpleHexAtoiBad<absl::uint128>(std::numeric_limits<int64_t>::min());
+ VerifySimpleHexAtoiGood<absl::uint128>(std::numeric_limits<int64_t>::max(),
+ std::numeric_limits<int64_t>::max());
+ VerifySimpleHexAtoiGood<absl::uint128>(std::numeric_limits<uint64_t>::max(),
+ std::numeric_limits<uint64_t>::max());
+ VerifySimpleHexAtoiGood<absl::uint128>(
+ std::numeric_limits<absl::uint128>::max(),
+ std::numeric_limits<absl::uint128>::max());
+
+ // Some other types
+ VerifySimpleHexAtoiGood<int>(-0x42, -0x42);
+ VerifySimpleHexAtoiGood<int32_t>(-0x42, -0x42);
+ VerifySimpleHexAtoiGood<uint32_t>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<unsigned int>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<int64_t>(-0x42, -0x42);
+ VerifySimpleHexAtoiGood<long>(-0x42, -0x42); // NOLINT: runtime-int
+ VerifySimpleHexAtoiGood<uint64_t>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<size_t>(0x42, 0x42);
+ VerifySimpleHexAtoiGood<std::string::size_type>(0x42, 0x42);
+
+ // Number prefix
+ int32_t value;
+ EXPECT_TRUE(safe_strto32_base("0x34234324", &value, 16));
+ EXPECT_EQ(0x34234324, value);
+
+ EXPECT_TRUE(safe_strto32_base("0X34234324", &value, 16));
+ EXPECT_EQ(0x34234324, value);
+
+ // ASCII whitespace
+ EXPECT_TRUE(safe_strto32_base(" \t\n 34234324", &value, 16));
+ EXPECT_EQ(0x34234324, value);
+
+ EXPECT_TRUE(safe_strto32_base("34234324 \t\n ", &value, 16));
+ EXPECT_EQ(0x34234324, value);
+}
+
TEST(stringtest, safe_strto32_base) {
int32_t value;
EXPECT_TRUE(safe_strto32_base("0x34234324", &value, 16));
diff --git a/grpc/third_party/abseil-cpp/absl/strings/str_cat.cc b/grpc/third_party/abseil-cpp/absl/strings/str_cat.cc
index dd5d25b0..f4a77493 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/str_cat.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/str_cat.cc
@@ -174,7 +174,7 @@ void AppendPieces(std::string* dest,
ASSERT_NO_OVERLAP(*dest, piece);
total_size += piece.size();
}
- strings_internal::STLStringResizeUninitialized(dest, total_size);
+ strings_internal::STLStringResizeUninitializedAmortized(dest, total_size);
char* const begin = &(*dest)[0];
char* out = begin + old_size;
@@ -199,7 +199,7 @@ void StrAppend(std::string* dest, const AlphaNum& a, const AlphaNum& b) {
ASSERT_NO_OVERLAP(*dest, a);
ASSERT_NO_OVERLAP(*dest, b);
std::string::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitialized(
+ strings_internal::STLStringResizeUninitializedAmortized(
dest, old_size + a.size() + b.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
@@ -214,7 +214,7 @@ void StrAppend(std::string* dest, const AlphaNum& a, const AlphaNum& b,
ASSERT_NO_OVERLAP(*dest, b);
ASSERT_NO_OVERLAP(*dest, c);
std::string::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitialized(
+ strings_internal::STLStringResizeUninitializedAmortized(
dest, old_size + a.size() + b.size() + c.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
@@ -231,7 +231,7 @@ void StrAppend(std::string* dest, const AlphaNum& a, const AlphaNum& b,
ASSERT_NO_OVERLAP(*dest, c);
ASSERT_NO_OVERLAP(*dest, d);
std::string::size_type old_size = dest->size();
- strings_internal::STLStringResizeUninitialized(
+ strings_internal::STLStringResizeUninitializedAmortized(
dest, old_size + a.size() + b.size() + c.size() + d.size());
char* const begin = &(*dest)[0];
char* out = begin + old_size;
diff --git a/grpc/third_party/abseil-cpp/absl/strings/str_format.h b/grpc/third_party/abseil-cpp/absl/strings/str_format.h
index 01465107..4b05c70c 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/str_format.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/str_format.h
@@ -536,8 +536,7 @@ using FormatArg = str_format_internal::FormatArgImpl;
// The arguments are provided in an `absl::Span<const absl::FormatArg>`.
// Each `absl::FormatArg` object binds to a single argument and keeps a
// reference to it. The values used to create the `FormatArg` objects must
-// outlive this function call. (See `str_format_arg.h` for information on
-// the `FormatArg` class.)_
+// outlive this function call.
//
// Example:
//
diff --git a/grpc/third_party/abseil-cpp/absl/strings/str_split_test.cc b/grpc/third_party/abseil-cpp/absl/strings/str_split_test.cc
index 7f7c097f..1b4427b8 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/str_split_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/str_split_test.cc
@@ -29,6 +29,8 @@
#include "gtest/gtest.h"
#include "absl/base/dynamic_annotations.h"
#include "absl/base/macros.h"
+#include "absl/container/btree_map.h"
+#include "absl/container/btree_set.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/node_hash_map.h"
#include "absl/strings/numbers.h"
@@ -405,6 +407,10 @@ TEST(Splitter, ConversionOperator) {
TestConversionOperator<std::set<std::string>>(splitter);
TestConversionOperator<std::multiset<absl::string_view>>(splitter);
TestConversionOperator<std::multiset<std::string>>(splitter);
+ TestConversionOperator<absl::btree_set<absl::string_view>>(splitter);
+ TestConversionOperator<absl::btree_set<std::string>>(splitter);
+ TestConversionOperator<absl::btree_multiset<absl::string_view>>(splitter);
+ TestConversionOperator<absl::btree_multiset<std::string>>(splitter);
TestConversionOperator<std::unordered_set<std::string>>(splitter);
// Tests conversion to map-like objects.
@@ -421,6 +427,22 @@ TEST(Splitter, ConversionOperator) {
TestMapConversionOperator<std::multimap<std::string, absl::string_view>>(
splitter);
TestMapConversionOperator<std::multimap<std::string, std::string>>(splitter);
+ TestMapConversionOperator<
+ absl::btree_map<absl::string_view, absl::string_view>>(splitter);
+ TestMapConversionOperator<absl::btree_map<absl::string_view, std::string>>(
+ splitter);
+ TestMapConversionOperator<absl::btree_map<std::string, absl::string_view>>(
+ splitter);
+ TestMapConversionOperator<absl::btree_map<std::string, std::string>>(
+ splitter);
+ TestMapConversionOperator<
+ absl::btree_multimap<absl::string_view, absl::string_view>>(splitter);
+ TestMapConversionOperator<
+ absl::btree_multimap<absl::string_view, std::string>>(splitter);
+ TestMapConversionOperator<
+ absl::btree_multimap<std::string, absl::string_view>>(splitter);
+ TestMapConversionOperator<absl::btree_multimap<std::string, std::string>>(
+ splitter);
TestMapConversionOperator<std::unordered_map<std::string, std::string>>(
splitter);
TestMapConversionOperator<
@@ -921,8 +943,14 @@ TEST(Delimiter, ByLength) {
}
TEST(Split, WorksWithLargeStrings) {
+#if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
+ defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
+ constexpr size_t kSize = (uint32_t{1} << 26) + 1; // 64M + 1 byte
+#else
+ constexpr size_t kSize = (uint32_t{1} << 31) + 1; // 2G + 1 byte
+#endif
if (sizeof(size_t) > 4) {
- std::string s((uint32_t{1} << 31) + 1, 'x'); // 2G + 1 byte
+ std::string s(kSize, 'x');
s.back() = '-';
std::vector<absl::string_view> v = absl::StrSplit(s, '-');
EXPECT_EQ(2, v.size());
diff --git a/grpc/third_party/abseil-cpp/absl/strings/string_view.cc b/grpc/third_party/abseil-cpp/absl/strings/string_view.cc
index c5f5de93..d596e08c 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/string_view.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/string_view.cc
@@ -78,8 +78,8 @@ std::ostream& operator<<(std::ostream& o, string_view piece) {
return o;
}
-string_view::size_type string_view::find(string_view s, size_type pos) const
- noexcept {
+string_view::size_type string_view::find(string_view s,
+ size_type pos) const noexcept {
if (empty() || pos > length_) {
if (empty() && pos == 0 && s.empty()) return 0;
return npos;
@@ -98,8 +98,8 @@ string_view::size_type string_view::find(char c, size_type pos) const noexcept {
return result != nullptr ? result - ptr_ : npos;
}
-string_view::size_type string_view::rfind(string_view s, size_type pos) const
- noexcept {
+string_view::size_type string_view::rfind(string_view s,
+ size_type pos) const noexcept {
if (length_ < s.length_) return npos;
if (s.empty()) return std::min(length_, pos);
const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_;
@@ -108,8 +108,8 @@ string_view::size_type string_view::rfind(string_view s, size_type pos) const
}
// Search range is [0..pos] inclusive. If pos == npos, search everything.
-string_view::size_type string_view::rfind(char c, size_type pos) const
- noexcept {
+string_view::size_type string_view::rfind(char c,
+ size_type pos) const noexcept {
// Note: memrchr() is not available on Windows.
if (empty()) return npos;
for (size_type i = std::min(pos, length_ - 1);; --i) {
@@ -121,9 +121,8 @@ string_view::size_type string_view::rfind(char c, size_type pos) const
return npos;
}
-string_view::size_type string_view::find_first_of(string_view s,
- size_type pos) const
- noexcept {
+string_view::size_type string_view::find_first_of(
+ string_view s, size_type pos) const noexcept {
if (empty() || s.empty()) {
return npos;
}
@@ -138,9 +137,8 @@ string_view::size_type string_view::find_first_of(string_view s,
return npos;
}
-string_view::size_type string_view::find_first_not_of(string_view s,
- size_type pos) const
- noexcept {
+string_view::size_type string_view::find_first_not_of(
+ string_view s, size_type pos) const noexcept {
if (empty()) return npos;
// Avoid the cost of LookupTable() for a single-character search.
if (s.length_ == 1) return find_first_not_of(s.ptr_[0], pos);
@@ -153,9 +151,8 @@ string_view::size_type string_view::find_first_not_of(string_view s,
return npos;
}
-string_view::size_type string_view::find_first_not_of(char c,
- size_type pos) const
- noexcept {
+string_view::size_type string_view::find_first_not_of(
+ char c, size_type pos) const noexcept {
if (empty()) return npos;
for (; pos < length_; ++pos) {
if (ptr_[pos] != c) {
@@ -180,9 +177,8 @@ string_view::size_type string_view::find_last_of(string_view s,
return npos;
}
-string_view::size_type string_view::find_last_not_of(string_view s,
- size_type pos) const
- noexcept {
+string_view::size_type string_view::find_last_not_of(
+ string_view s, size_type pos) const noexcept {
if (empty()) return npos;
size_type i = std::min(pos, length_ - 1);
if (s.empty()) return i;
@@ -198,9 +194,8 @@ string_view::size_type string_view::find_last_not_of(string_view s,
return npos;
}
-string_view::size_type string_view::find_last_not_of(char c,
- size_type pos) const
- noexcept {
+string_view::size_type string_view::find_last_not_of(
+ char c, size_type pos) const noexcept {
if (empty()) return npos;
size_type i = std::min(pos, length_ - 1);
for (;; --i) {
diff --git a/grpc/third_party/abseil-cpp/absl/strings/string_view.h b/grpc/third_party/abseil-cpp/absl/strings/string_view.h
index 5260b5b7..a4c9a652 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/string_view.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/string_view.h
@@ -36,6 +36,7 @@
#include <limits>
#include <string>
+#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/base/internal/throw_delegate.h"
#include "absl/base/macros.h"
@@ -61,6 +62,12 @@ ABSL_NAMESPACE_END
#define ABSL_INTERNAL_STRING_VIEW_MEMCMP memcmp
#endif // ABSL_HAVE_BUILTIN(__builtin_memcmp)
+#if defined(__cplusplus) && __cplusplus >= 201402L
+#define ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR constexpr
+#else
+#define ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
@@ -180,18 +187,20 @@ class string_view {
template <typename Allocator>
string_view( // NOLINT(runtime/explicit)
- const std::basic_string<char, std::char_traits<char>, Allocator>&
- str) noexcept
+ const std::basic_string<char, std::char_traits<char>, Allocator>& str
+ ABSL_ATTRIBUTE_LIFETIME_BOUND) noexcept
// This is implemented in terms of `string_view(p, n)` so `str.size()`
// doesn't need to be reevaluated after `ptr_` is set.
- : string_view(str.data(), str.size()) {}
+ // The length check is also skipped since it is unnecessary and causes
+ // code bloat.
+ : string_view(str.data(), str.size(), SkipCheckLengthTag{}) {}
// Implicit constructor of a `string_view` from NUL-terminated `str`. When
// accepting possibly null strings, use `absl::NullSafeStringView(str)`
// instead (see below).
+ // The length check is skipped since it is unnecessary and causes code bloat.
constexpr string_view(const char* str) // NOLINT(runtime/explicit)
- : ptr_(str),
- length_(str ? CheckLengthInternal(StrlenInternal(str)) : 0) {}
+ : ptr_(str), length_(str ? StrlenInternal(str) : 0) {}
// Implicit constructor of a `string_view` from a `const char*` and length.
constexpr string_view(const char* data, size_type len)
@@ -264,9 +273,7 @@ class string_view {
// string_view::size()
//
// Returns the number of characters in the `string_view`.
- constexpr size_type size() const noexcept {
- return length_;
- }
+ constexpr size_type size() const noexcept { return length_; }
// string_view::length()
//
@@ -333,7 +340,7 @@ class string_view {
//
// Removes the first `n` characters from the `string_view`. Note that the
// underlying string is not changed, only the view.
- void remove_prefix(size_type n) {
+ ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR void remove_prefix(size_type n) {
ABSL_HARDENING_ASSERT(n <= length_);
ptr_ += n;
length_ -= n;
@@ -343,7 +350,7 @@ class string_view {
//
// Removes the last `n` characters from the `string_view`. Note that the
// underlying string is not changed, only the view.
- void remove_suffix(size_type n) {
+ ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR void remove_suffix(size_type n) {
ABSL_HARDENING_ASSERT(n <= length_);
length_ -= n;
}
@@ -351,7 +358,7 @@ class string_view {
// string_view::swap()
//
// Swaps this `string_view` with another `string_view`.
- void swap(string_view& s) noexcept {
+ ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR void swap(string_view& s) noexcept {
auto t = *this;
*this = s;
s = t;
@@ -388,7 +395,7 @@ class string_view {
// `n`) as another string_view. This function throws `std::out_of_bounds` if
// `pos > size`.
// Use absl::ClippedSubstr if you need a truncating substr operation.
- constexpr string_view substr(size_type pos, size_type n = npos) const {
+ constexpr string_view substr(size_type pos = 0, size_type n = npos) const {
return ABSL_PREDICT_FALSE(pos > length_)
? (base_internal::ThrowStdOutOfRange(
"absl::string_view::substr"),
@@ -398,12 +405,10 @@ class string_view {
// string_view::compare()
//
- // Performs a lexicographical comparison between the `string_view` and
- // another `absl::string_view`, returning -1 if `this` is less than, 0 if
- // `this` is equal to, and 1 if `this` is greater than the passed string
- // view. Note that in the case of data equality, a further comparison is made
- // on the respective sizes of the two `string_view`s to determine which is
- // smaller, equal, or greater.
+ // Performs a lexicographical comparison between this `string_view` and
+ // another `string_view` `x`, returning a negative value if `*this` is less
+ // than `x`, 0 if `*this` is equal to `x`, and a positive value if `*this`
+ // is greater than `x`.
constexpr int compare(string_view x) const noexcept {
return CompareImpl(length_, x.length_,
Min(length_, x.length_) == 0
@@ -414,31 +419,31 @@ class string_view {
// Overload of `string_view::compare()` for comparing a substring of the
// 'string_view` and another `absl::string_view`.
- int compare(size_type pos1, size_type count1, string_view v) const {
+ constexpr int compare(size_type pos1, size_type count1, string_view v) const {
return substr(pos1, count1).compare(v);
}
// Overload of `string_view::compare()` for comparing a substring of the
// `string_view` and a substring of another `absl::string_view`.
- int compare(size_type pos1, size_type count1, string_view v, size_type pos2,
- size_type count2) const {
+ constexpr int compare(size_type pos1, size_type count1, string_view v,
+ size_type pos2, size_type count2) const {
return substr(pos1, count1).compare(v.substr(pos2, count2));
}
// Overload of `string_view::compare()` for comparing a `string_view` and a
- // a different C-style string `s`.
- int compare(const char* s) const { return compare(string_view(s)); }
+ // a different C-style string `s`.
+ constexpr int compare(const char* s) const { return compare(string_view(s)); }
// Overload of `string_view::compare()` for comparing a substring of the
// `string_view` and a different string C-style string `s`.
- int compare(size_type pos1, size_type count1, const char* s) const {
+ constexpr int compare(size_type pos1, size_type count1, const char* s) const {
return substr(pos1, count1).compare(string_view(s));
}
// Overload of `string_view::compare()` for comparing a substring of the
// `string_view` and a substring of a different C-style string `s`.
- int compare(size_type pos1, size_type count1, const char* s,
- size_type count2) const {
+ constexpr int compare(size_type pos1, size_type count1, const char* s,
+ size_type count2) const {
return substr(pos1, count1).compare(string_view(s, count2));
}
@@ -455,48 +460,92 @@ class string_view {
// within the `string_view`.
size_type find(char c, size_type pos = 0) const noexcept;
+ // Overload of `string_view::find()` for finding a substring of a different
+ // C-style string `s` within the `string_view`.
+ size_type find(const char* s, size_type pos, size_type count) const {
+ return find(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::find()` for finding a different C-style string
+ // `s` within the `string_view`.
+ size_type find(const char* s, size_type pos = 0) const {
+ return find(string_view(s), pos);
+ }
+
// string_view::rfind()
//
// Finds the last occurrence of a substring `s` within the `string_view`,
// returning the position of the first character's match, or `npos` if no
// match was found.
- size_type rfind(string_view s, size_type pos = npos) const
- noexcept;
+ size_type rfind(string_view s, size_type pos = npos) const noexcept;
// Overload of `string_view::rfind()` for finding the last given character `c`
// within the `string_view`.
size_type rfind(char c, size_type pos = npos) const noexcept;
+ // Overload of `string_view::rfind()` for finding a substring of a different
+ // C-style string `s` within the `string_view`.
+ size_type rfind(const char* s, size_type pos, size_type count) const {
+ return rfind(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::rfind()` for finding a different C-style string
+ // `s` within the `string_view`.
+ size_type rfind(const char* s, size_type pos = npos) const {
+ return rfind(string_view(s), pos);
+ }
+
// string_view::find_first_of()
//
// Finds the first occurrence of any of the characters in `s` within the
// `string_view`, returning the start position of the match, or `npos` if no
// match was found.
- size_type find_first_of(string_view s, size_type pos = 0) const
- noexcept;
+ size_type find_first_of(string_view s, size_type pos = 0) const noexcept;
// Overload of `string_view::find_first_of()` for finding a character `c`
// within the `string_view`.
- size_type find_first_of(char c, size_type pos = 0) const
- noexcept {
+ size_type find_first_of(char c, size_type pos = 0) const noexcept {
return find(c, pos);
}
+ // Overload of `string_view::find_first_of()` for finding a substring of a
+ // different C-style string `s` within the `string_view`.
+ size_type find_first_of(const char* s, size_type pos,
+ size_type count) const {
+ return find_first_of(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::find_first_of()` for finding a different C-style
+ // string `s` within the `string_view`.
+ size_type find_first_of(const char* s, size_type pos = 0) const {
+ return find_first_of(string_view(s), pos);
+ }
+
// string_view::find_last_of()
//
// Finds the last occurrence of any of the characters in `s` within the
// `string_view`, returning the start position of the match, or `npos` if no
// match was found.
- size_type find_last_of(string_view s, size_type pos = npos) const
- noexcept;
+ size_type find_last_of(string_view s, size_type pos = npos) const noexcept;
// Overload of `string_view::find_last_of()` for finding a character `c`
// within the `string_view`.
- size_type find_last_of(char c, size_type pos = npos) const
- noexcept {
+ size_type find_last_of(char c, size_type pos = npos) const noexcept {
return rfind(c, pos);
}
+ // Overload of `string_view::find_last_of()` for finding a substring of a
+ // different C-style string `s` within the `string_view`.
+ size_type find_last_of(const char* s, size_type pos, size_type count) const {
+ return find_last_of(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::find_last_of()` for finding a different C-style
+ // string `s` within the `string_view`.
+ size_type find_last_of(const char* s, size_type pos = npos) const {
+ return find_last_of(string_view(s), pos);
+ }
+
// string_view::find_first_not_of()
//
// Finds the first occurrence of any of the characters not in `s` within the
@@ -508,20 +557,51 @@ class string_view {
// that is not `c` within the `string_view`.
size_type find_first_not_of(char c, size_type pos = 0) const noexcept;
+ // Overload of `string_view::find_first_not_of()` for finding a substring of a
+ // different C-style string `s` within the `string_view`.
+ size_type find_first_not_of(const char* s, size_type pos,
+ size_type count) const {
+ return find_first_not_of(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::find_first_not_of()` for finding a different
+ // C-style string `s` within the `string_view`.
+ size_type find_first_not_of(const char* s, size_type pos = 0) const {
+ return find_first_not_of(string_view(s), pos);
+ }
+
// string_view::find_last_not_of()
//
// Finds the last occurrence of any of the characters not in `s` within the
// `string_view`, returning the start position of the last non-match, or
// `npos` if no non-match was found.
size_type find_last_not_of(string_view s,
- size_type pos = npos) const noexcept;
+ size_type pos = npos) const noexcept;
// Overload of `string_view::find_last_not_of()` for finding a character
// that is not `c` within the `string_view`.
- size_type find_last_not_of(char c, size_type pos = npos) const
- noexcept;
+ size_type find_last_not_of(char c, size_type pos = npos) const noexcept;
+
+ // Overload of `string_view::find_last_not_of()` for finding a substring of a
+ // different C-style string `s` within the `string_view`.
+ size_type find_last_not_of(const char* s, size_type pos,
+ size_type count) const {
+ return find_last_not_of(string_view(s, count), pos);
+ }
+
+ // Overload of `string_view::find_last_not_of()` for finding a different
+ // C-style string `s` within the `string_view`.
+ size_type find_last_not_of(const char* s, size_type pos = npos) const {
+ return find_last_not_of(string_view(s), pos);
+ }
private:
+ // The constructor from std::string delegates to this constructor.
+ // See the comment on that constructor for the rationale.
+ struct SkipCheckLengthTag {};
+ string_view(const char* data, size_type len, SkipCheckLengthTag) noexcept
+ : ptr_(data), length_(len) {}
+
static constexpr size_type kMaxSize =
(std::numeric_limits<difference_type>::max)();
@@ -597,6 +677,7 @@ std::ostream& operator<<(std::ostream& o, string_view piece);
ABSL_NAMESPACE_END
} // namespace absl
+#undef ABSL_INTERNAL_STRING_VIEW_CXX14_CONSTEXPR
#undef ABSL_INTERNAL_STRING_VIEW_MEMCMP
#endif // ABSL_USES_STD_STRING_VIEW
diff --git a/grpc/third_party/abseil-cpp/absl/strings/string_view_test.cc b/grpc/third_party/abseil-cpp/absl/strings/string_view_test.cc
index 643af8f8..2c13dd1c 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/string_view_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/string_view_test.cc
@@ -449,6 +449,24 @@ TEST(StringViewTest, STL2) {
EXPECT_EQ(d.find('x', 4), absl::string_view::npos);
EXPECT_EQ(e.find('x', 7), absl::string_view::npos);
+ EXPECT_EQ(a.find(b.data(), 1, 0), 1);
+ EXPECT_EQ(a.find(c.data(), 9, 0), 9);
+ EXPECT_EQ(a.find(c.data(), absl::string_view::npos, 0),
+ absl::string_view::npos);
+ EXPECT_EQ(b.find(c.data(), absl::string_view::npos, 0),
+ absl::string_view::npos);
+ // empty string nonsense
+ EXPECT_EQ(d.find(b.data(), 4, 0), absl::string_view::npos);
+ EXPECT_EQ(e.find(b.data(), 7, 0), absl::string_view::npos);
+
+ EXPECT_EQ(a.find(b.data(), 1), absl::string_view::npos);
+ EXPECT_EQ(a.find(c.data(), 9), 23);
+ EXPECT_EQ(a.find(c.data(), absl::string_view::npos), absl::string_view::npos);
+ EXPECT_EQ(b.find(c.data(), absl::string_view::npos), absl::string_view::npos);
+ // empty string nonsense
+ EXPECT_EQ(d.find(b.data(), 4), absl::string_view::npos);
+ EXPECT_EQ(e.find(b.data(), 7), absl::string_view::npos);
+
EXPECT_EQ(a.rfind(b), 0);
EXPECT_EQ(a.rfind(b, 1), 0);
EXPECT_EQ(a.rfind(c), 23);
@@ -490,6 +508,14 @@ TEST(StringViewTest, STL2) {
EXPECT_EQ(e.rfind('o'), absl::string_view::npos);
EXPECT_EQ(d.rfind('o', 4), absl::string_view::npos);
EXPECT_EQ(e.rfind('o', 7), absl::string_view::npos);
+
+ EXPECT_EQ(a.rfind(b.data(), 1, 0), 1);
+ EXPECT_EQ(a.rfind(c.data(), 22, 0), 22);
+ EXPECT_EQ(a.rfind(c.data(), 1, 0), 1);
+ EXPECT_EQ(a.rfind(c.data(), 0, 0), 0);
+ EXPECT_EQ(b.rfind(c.data(), 0, 0), 0);
+ EXPECT_EQ(d.rfind(b.data(), 4, 0), 0);
+ EXPECT_EQ(e.rfind(b.data(), 7, 0), 0);
}
// Continued from STL2
@@ -678,6 +704,7 @@ TEST(StringViewTest, STL2Substr) {
EXPECT_EQ(a.substr(23, 3), c);
EXPECT_EQ(a.substr(23, 99), c);
EXPECT_EQ(a.substr(0), a);
+ EXPECT_EQ(a.substr(), a);
EXPECT_EQ(a.substr(3, 2), "de");
// empty string nonsense
EXPECT_EQ(d.substr(0, 99), e);
@@ -1087,7 +1114,24 @@ TEST(StringViewTest, ConstexprCompiles) {
EXPECT_EQ(sp_npos, -1);
}
-TEST(StringViewTest, ConstexprSubstr) {
+constexpr char ConstexprMethodsHelper() {
+#if defined(__cplusplus) && __cplusplus >= 201402L
+ absl::string_view str("123", 3);
+ str.remove_prefix(1);
+ str.remove_suffix(1);
+ absl::string_view bar;
+ str.swap(bar);
+ return bar.front();
+#else
+ return '2';
+#endif
+}
+
+TEST(StringViewTest, ConstexprMethods) {
+ // remove_prefix, remove_suffix, swap
+ static_assert(ConstexprMethodsHelper() == '2', "");
+
+ // substr
constexpr absl::string_view foobar("foobar", 6);
constexpr absl::string_view foo = foobar.substr(0, 3);
constexpr absl::string_view bar = foobar.substr(3);
diff --git a/grpc/third_party/abseil-cpp/absl/strings/substitute.cc b/grpc/third_party/abseil-cpp/absl/strings/substitute.cc
index 1f3c7409..8980b198 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/substitute.cc
+++ b/grpc/third_party/abseil-cpp/absl/strings/substitute.cc
@@ -75,7 +75,8 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format,
// Build the string.
size_t original_size = output->size();
- strings_internal::STLStringResizeUninitialized(output, original_size + size);
+ strings_internal::STLStringResizeUninitializedAmortized(output,
+ original_size + size);
char* target = &(*output)[original_size];
for (size_t i = 0; i < format.size(); i++) {
if (format[i] == '$') {
diff --git a/grpc/third_party/abseil-cpp/absl/strings/substitute.h b/grpc/third_party/abseil-cpp/absl/strings/substitute.h
index c6da4dc6..151c56f5 100644
--- a/grpc/third_party/abseil-cpp/absl/strings/substitute.h
+++ b/grpc/third_party/abseil-cpp/absl/strings/substitute.h
@@ -361,43 +361,49 @@ inline void SubstituteAndAppend(
// This body of functions catches cases where the number of placeholders
// doesn't match the number of data arguments.
void SubstituteAndAppend(std::string* output, const char* format)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0,
- "There were no substitution arguments "
- "but this format string has a $[0-9] in it");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 0,
+ "There were no substitution arguments "
+ "but this format string either has a $[0-9] in it or contains "
+ "an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0)
ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1,
"There was 1 substitution argument given, but "
- "this format string is either missing its $0, or "
- "contains one of $1-$9");
+ "this format string is missing its $0, contains "
+ "one of $1-$9, or contains an unescaped $ character (use "
+ "$$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 3,
- "There were 2 substitution arguments given, but "
- "this format string is either missing its $0/$1, or "
- "contains one of $2-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 3,
+ "There were 2 substitution arguments given, but this format string is "
+ "missing its $0/$1, contains one of $2-$9, or contains an "
+ "unescaped $ character (use $$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 7,
- "There were 3 substitution arguments given, but "
- "this format string is either missing its $0/$1/$2, or "
- "contains one of $3-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 7,
+ "There were 3 substitution arguments given, but "
+ "this format string is missing its $0/$1/$2, contains one of "
+ "$3-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 15,
- "There were 4 substitution arguments given, but "
- "this format string is either missing its $0-$3, or "
- "contains one of $4-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 15,
+ "There were 4 substitution arguments given, but "
+ "this format string is missing its $0-$3, contains one of "
+ "$4-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0,
@@ -405,10 +411,11 @@ void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 31,
- "There were 5 substitution arguments given, but "
- "this format string is either missing its $0-$4, or "
- "contains one of $5-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 31,
+ "There were 5 substitution arguments given, but "
+ "this format string is missing its $0-$4, contains one of "
+ "$5-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a0,
@@ -417,20 +424,22 @@ void SubstituteAndAppend(std::string* output, const char* format,
const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 63,
- "There were 6 substitution arguments given, but "
- "this format string is either missing its $0-$5, or "
- "contains one of $6-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 63,
+ "There were 6 substitution arguments given, but "
+ "this format string is missing its $0-$5, contains one of "
+ "$6-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
std::string* output, const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1, const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 127,
- "There were 7 substitution arguments given, but "
- "this format string is either missing its $0-$6, or "
- "contains one of $7-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 127,
+ "There were 7 substitution arguments given, but "
+ "this format string is missing its $0-$6, contains one of "
+ "$7-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
std::string* output, const char* format, const substitute_internal::Arg& a0,
@@ -438,10 +447,11 @@ void SubstituteAndAppend(
const substitute_internal::Arg& a3, const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
const substitute_internal::Arg& a7)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 255,
- "There were 8 substitution arguments given, but "
- "this format string is either missing its $0-$7, or "
- "contains one of $8-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 255,
+ "There were 8 substitution arguments given, but "
+ "this format string is missing its $0-$7, contains one of "
+ "$8-$9, or contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
std::string* output, const char* format, const substitute_internal::Arg& a0,
@@ -452,7 +462,8 @@ void SubstituteAndAppend(
ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 511,
"There were 9 substitution arguments given, but "
- "this format string is either missing its $0-$8, or contains a $9");
+ "this format string is missing its $0-$8, contains a $9, or "
+ "contains an unescaped $ character (use $$ instead)");
void SubstituteAndAppend(
std::string* output, const char* format, const substitute_internal::Arg& a0,
@@ -461,9 +472,11 @@ void SubstituteAndAppend(
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
const substitute_internal::Arg& a7, const substitute_internal::Arg& a8,
const substitute_internal::Arg& a9)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1023,
- "There were 10 substitution arguments given, but this "
- "format string doesn't contain all of $0 through $9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 1023,
+ "There were 10 substitution arguments given, but this "
+ "format string either doesn't contain all of $0 through $9 or "
+ "contains an unescaped $ character (use $$ instead)");
#endif // ABSL_BAD_CALL_IF
// Substitute()
@@ -589,47 +602,53 @@ ABSL_MUST_USE_RESULT inline std::string Substitute(
std::string Substitute(const char* format)
ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0,
"There were no substitution arguments "
- "but this format string has a $[0-9] in it");
+ "but this format string either has a $[0-9] in it or "
+ "contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1,
- "There was 1 substitution argument given, but "
- "this format string is either missing its $0, or "
- "contains one of $1-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 1,
+ "There was 1 substitution argument given, but "
+ "this format string is missing its $0, contains one of $1-$9, "
+ "or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 3,
- "There were 2 substitution arguments given, but "
- "this format string is either missing its $0/$1, or "
- "contains one of $2-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 3,
+ "There were 2 substitution arguments given, but "
+ "this format string is missing its $0/$1, contains one of "
+ "$2-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 7,
- "There were 3 substitution arguments given, but "
- "this format string is either missing its $0/$1/$2, or "
- "contains one of $3-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 7,
+ "There were 3 substitution arguments given, but "
+ "this format string is missing its $0/$1/$2, contains one of "
+ "$3-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 15,
- "There were 4 substitution arguments given, but "
- "this format string is either missing its $0-$3, or "
- "contains one of $4-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 15,
+ "There were 4 substitution arguments given, but "
+ "this format string is missing its $0-$3, contains one of "
+ "$4-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
const substitute_internal::Arg& a2,
const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 31,
- "There were 5 substitution arguments given, but "
- "this format string is either missing its $0-$4, or "
- "contains one of $5-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 31,
+ "There were 5 substitution arguments given, but "
+ "this format string is missing its $0-$4, contains one of "
+ "$5-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
@@ -637,10 +656,11 @@ std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a3,
const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 63,
- "There were 6 substitution arguments given, but "
- "this format string is either missing its $0-$5, or "
- "contains one of $6-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 63,
+ "There were 6 substitution arguments given, but "
+ "this format string is missing its $0-$5, contains one of "
+ "$6-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
@@ -649,10 +669,11 @@ std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a4,
const substitute_internal::Arg& a5,
const substitute_internal::Arg& a6)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 127,
- "There were 7 substitution arguments given, but "
- "this format string is either missing its $0-$6, or "
- "contains one of $7-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 127,
+ "There were 7 substitution arguments given, but "
+ "this format string is missing its $0-$6, contains one of "
+ "$7-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a1,
@@ -662,10 +683,11 @@ std::string Substitute(const char* format, const substitute_internal::Arg& a0,
const substitute_internal::Arg& a5,
const substitute_internal::Arg& a6,
const substitute_internal::Arg& a7)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 255,
- "There were 8 substitution arguments given, but "
- "this format string is either missing its $0-$7, or "
- "contains one of $8-$9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 255,
+ "There were 8 substitution arguments given, but "
+ "this format string is missing its $0-$7, contains one of "
+ "$8-$9, or contains an unescaped $ character (use $$ instead)");
std::string Substitute(
const char* format, const substitute_internal::Arg& a0,
@@ -676,7 +698,8 @@ std::string Substitute(
ABSL_BAD_CALL_IF(
substitute_internal::PlaceholderBitmask(format) != 511,
"There were 9 substitution arguments given, but "
- "this format string is either missing its $0-$8, or contains a $9");
+ "this format string is missing its $0-$8, contains a $9, or "
+ "contains an unescaped $ character (use $$ instead)");
std::string Substitute(
const char* format, const substitute_internal::Arg& a0,
@@ -685,9 +708,11 @@ std::string Substitute(
const substitute_internal::Arg& a5, const substitute_internal::Arg& a6,
const substitute_internal::Arg& a7, const substitute_internal::Arg& a8,
const substitute_internal::Arg& a9)
- ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1023,
- "There were 10 substitution arguments given, but this "
- "format string doesn't contain all of $0 through $9");
+ ABSL_BAD_CALL_IF(
+ substitute_internal::PlaceholderBitmask(format) != 1023,
+ "There were 10 substitution arguments given, but this "
+ "format string either doesn't contain all of $0 through $9 or "
+ "contains an unescaped $ character (use $$ instead)");
#endif // ABSL_BAD_CALL_IF
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/synchronization/BUILD.bazel
index 5ce16958..d7195473 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
@@ -136,6 +135,21 @@ cc_test(
],
)
+cc_binary(
+ name = "blocking_counter_benchmark",
+ testonly = 1,
+ srcs = ["blocking_counter_benchmark.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ tags = ["benchmark"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":synchronization",
+ ":thread_pool",
+ "@com_github_google_benchmark//:benchmark_main",
+ ],
+)
+
cc_test(
name = "graphcycles_test",
size = "medium",
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt
index e633d0bf..605efe2d 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/CMakeLists.txt
@@ -95,7 +95,7 @@ absl_cc_test(
DEPS
absl::synchronization
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -108,7 +108,7 @@ absl_cc_test(
DEPS
absl::synchronization
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -122,7 +122,7 @@ absl_cc_test(
absl::graphcycles_internal
absl::core_headers
absl::raw_logging_internal
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -154,7 +154,7 @@ absl_cc_test(
absl::memory
absl::raw_logging_internal
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -167,7 +167,7 @@ absl_cc_test(
DEPS
absl::synchronization
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -183,7 +183,7 @@ absl_cc_library(
absl::config
absl::strings
absl::time
- gmock
+ GTest::gmock
TESTONLY
)
@@ -199,7 +199,7 @@ absl_cc_test(
absl::synchronization
absl::strings
absl::time
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc
index 3cea7aed..d2f82da3 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc
@@ -14,41 +14,51 @@
#include "absl/synchronization/blocking_counter.h"
+#include <atomic>
+
#include "absl/base/internal/raw_logging.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
-// Return whether int *arg is zero.
-static bool IsZero(void *arg) {
- return 0 == *reinterpret_cast<int *>(arg);
+namespace {
+
+// Return whether int *arg is true.
+bool IsDone(void *arg) { return *reinterpret_cast<bool *>(arg); }
+
+} // namespace
+
+BlockingCounter::BlockingCounter(int initial_count)
+ : count_(initial_count),
+ num_waiting_(0),
+ done_{initial_count == 0 ? true : false} {
+ ABSL_RAW_CHECK(initial_count >= 0, "BlockingCounter initial_count negative");
}
bool BlockingCounter::DecrementCount() {
- MutexLock l(&lock_);
- count_--;
- if (count_ < 0) {
- ABSL_RAW_LOG(
- FATAL,
- "BlockingCounter::DecrementCount() called too many times. count=%d",
- count_);
+ int count = count_.fetch_sub(1, std::memory_order_acq_rel) - 1;
+ ABSL_RAW_CHECK(count >= 0,
+ "BlockingCounter::DecrementCount() called too many times");
+ if (count == 0) {
+ MutexLock l(&lock_);
+ done_ = true;
+ return true;
}
- return count_ == 0;
+ return false;
}
void BlockingCounter::Wait() {
MutexLock l(&this->lock_);
- ABSL_RAW_CHECK(count_ >= 0, "BlockingCounter underflow");
// only one thread may call Wait(). To support more than one thread,
// implement a counter num_to_exit, like in the Barrier class.
ABSL_RAW_CHECK(num_waiting_ == 0, "multiple threads called Wait()");
num_waiting_++;
- this->lock_.Await(Condition(IsZero, &this->count_));
+ this->lock_.Await(Condition(IsDone, &this->done_));
- // At this point, We know that all threads executing DecrementCount have
- // released the lock, and so will not touch this object again.
+ // At this point, we know that all threads executing DecrementCount
+ // will not touch this object again.
// Therefore, the thread calling this method is free to delete the object
// after we return from this method.
}
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.h b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.h
index 1f53f9f2..1908fdb1 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.h
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter.h
@@ -20,6 +20,8 @@
#ifndef ABSL_SYNCHRONIZATION_BLOCKING_COUNTER_H_
#define ABSL_SYNCHRONIZATION_BLOCKING_COUNTER_H_
+#include <atomic>
+
#include "absl/base/thread_annotations.h"
#include "absl/synchronization/mutex.h"
@@ -60,8 +62,7 @@ ABSL_NAMESPACE_BEGIN
//
class BlockingCounter {
public:
- explicit BlockingCounter(int initial_count)
- : count_(initial_count), num_waiting_(0) {}
+ explicit BlockingCounter(int initial_count);
BlockingCounter(const BlockingCounter&) = delete;
BlockingCounter& operator=(const BlockingCounter&) = delete;
@@ -89,8 +90,9 @@ class BlockingCounter {
private:
Mutex lock_;
- int count_ ABSL_GUARDED_BY(lock_);
+ std::atomic<int> count_;
int num_waiting_ ABSL_GUARDED_BY(lock_);
+ bool done_ ABSL_GUARDED_BY(lock_);
};
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_benchmark.cc b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_benchmark.cc
new file mode 100644
index 00000000..b504d1a5
--- /dev/null
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_benchmark.cc
@@ -0,0 +1,83 @@
+// Copyright 2021 The Abseil Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT 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 <limits>
+
+#include "absl/synchronization/blocking_counter.h"
+#include "absl/synchronization/internal/thread_pool.h"
+#include "benchmark/benchmark.h"
+
+namespace {
+
+void BM_BlockingCounter_SingleThread(benchmark::State& state) {
+ for (auto _ : state) {
+ int iterations = state.range(0);
+ absl::BlockingCounter counter{iterations};
+ for (int i = 0; i < iterations; ++i) {
+ counter.DecrementCount();
+ }
+ counter.Wait();
+ }
+}
+BENCHMARK(BM_BlockingCounter_SingleThread)
+ ->ArgName("iterations")
+ ->Arg(2)
+ ->Arg(4)
+ ->Arg(16)
+ ->Arg(64)
+ ->Arg(256);
+
+void BM_BlockingCounter_DecrementCount(benchmark::State& state) {
+ static absl::BlockingCounter* counter =
+ new absl::BlockingCounter{std::numeric_limits<int>::max()};
+ for (auto _ : state) {
+ counter->DecrementCount();
+ }
+}
+BENCHMARK(BM_BlockingCounter_DecrementCount)
+ ->Threads(2)
+ ->Threads(4)
+ ->Threads(6)
+ ->Threads(8)
+ ->Threads(10)
+ ->Threads(12)
+ ->Threads(16)
+ ->Threads(32)
+ ->Threads(64)
+ ->Threads(128);
+
+void BM_BlockingCounter_Wait(benchmark::State& state) {
+ int num_threads = state.range(0);
+ absl::synchronization_internal::ThreadPool pool(num_threads);
+ for (auto _ : state) {
+ absl::BlockingCounter counter{num_threads};
+ pool.Schedule([num_threads, &counter, &pool]() {
+ for (int i = 0; i < num_threads; ++i) {
+ pool.Schedule([&counter]() { counter.DecrementCount(); });
+ }
+ });
+ counter.Wait();
+ }
+}
+BENCHMARK(BM_BlockingCounter_Wait)
+ ->ArgName("threads")
+ ->Arg(2)
+ ->Arg(4)
+ ->Arg(8)
+ ->Arg(16)
+ ->Arg(32)
+ ->Arg(64)
+ ->Arg(128);
+
+} // namespace
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc
index 2926224a..06885f57 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/blocking_counter_test.cc
@@ -63,6 +63,18 @@ TEST(BlockingCounterTest, BasicFunctionality) {
}
}
+TEST(BlockingCounterTest, WaitZeroInitialCount) {
+ BlockingCounter counter(0);
+ counter.Wait();
+}
+
+#if GTEST_HAS_DEATH_TEST
+TEST(BlockingCounterTest, WaitNegativeInitialCount) {
+ EXPECT_DEATH(BlockingCounter counter(-1),
+ "BlockingCounter initial_count negative");
+}
+#endif
+
} // namespace
ABSL_NAMESPACE_END
} // namespace absl
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc b/grpc/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc
index 8cf59e64..db1184e6 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem_test.cc
@@ -159,7 +159,7 @@ TEST_F(PerThreadSemTest, Timeouts) {
const absl::Duration elapsed = absl::Now() - start;
// Allow for a slight early return, to account for quality of implementation
// issues on various platforms.
- const absl::Duration slop = absl::Microseconds(200);
+ const absl::Duration slop = absl::Milliseconds(1);
EXPECT_LE(delay - slop, elapsed)
<< "Wait returned " << delay - elapsed
<< " early (with " << slop << " slop), start time was " << start;
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc b/grpc/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc
index 2123be60..28ef311e 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc
@@ -79,6 +79,7 @@ bool Waiter::Wait(KernelTimeout t) {
// Note that, since the thread ticker is just reset, we don't need to check
// whether the thread is idle on the very first pass of the loop.
bool first_pass = true;
+
while (true) {
int32_t x = futex_.load(std::memory_order_relaxed);
while (x != 0) {
@@ -90,7 +91,6 @@ bool Waiter::Wait(KernelTimeout t) {
return true; // Consumed a wakeup, we are done.
}
-
if (!first_pass) MaybeBecomeIdle();
const int err = Futex::WaitUntil(&futex_, 0, t);
if (err != 0) {
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/mutex.h b/grpc/third_party/abseil-cpp/absl/synchronization/mutex.h
index f49e0c83..38338f24 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/mutex.h
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/mutex.h
@@ -778,9 +778,9 @@ class Condition {
//
// Usage to wake T is:
// mu.Lock();
-// // process data, possibly establishing C
-// if (C) { cv->Signal(); }
-// mu.Unlock();
+// // process data, possibly establishing C
+// if (C) { cv->Signal(); }
+// mu.Unlock();
//
// If C may be useful to more than one waiter, use `SignalAll()` instead of
// `Signal()`.
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/mutex_benchmark.cc b/grpc/third_party/abseil-cpp/absl/synchronization/mutex_benchmark.cc
index e35aed8b..b5d2fbc4 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/mutex_benchmark.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/mutex_benchmark.cc
@@ -97,7 +97,7 @@ void BM_MutexEnqueue(benchmark::State& state) {
// Mutex queueing behavior is modified.
const bool multiple_priorities = state.range(0);
ScopedThreadMutexPriority priority_setter(
- (multiple_priorities && state.thread_index != 0) ? 1 : 0);
+ (multiple_priorities && state.thread_index() != 0) ? 1 : 0);
struct Shared {
absl::Mutex mu;
@@ -176,7 +176,7 @@ BENCHMARK(BM_MutexEnqueue)
template <typename MutexType>
void BM_Contended(benchmark::State& state) {
- int priority = state.thread_index % state.range(1);
+ int priority = state.thread_index() % state.range(1);
ScopedThreadMutexPriority priority_setter(priority);
struct Shared {
@@ -196,7 +196,7 @@ void BM_Contended(benchmark::State& state) {
// To achieve this amount of local work is multiplied by number of threads
// to keep ratio between local work and critical section approximately
// equal regardless of number of threads.
- DelayNs(100 * state.threads, &local);
+ DelayNs(100 * state.threads(), &local);
RaiiLocker<MutexType> locker(&shared->mu);
DelayNs(state.range(0), &shared->data);
}
diff --git a/grpc/third_party/abseil-cpp/absl/synchronization/mutex_test.cc b/grpc/third_party/abseil-cpp/absl/synchronization/mutex_test.cc
index f8fbf948..4f403176 100644
--- a/grpc/third_party/abseil-cpp/absl/synchronization/mutex_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/synchronization/mutex_test.cc
@@ -26,6 +26,7 @@
#include <random>
#include <string>
#include <thread> // NOLINT(build/c++11)
+#include <type_traits>
#include <vector>
#include "gtest/gtest.h"
@@ -870,33 +871,6 @@ TEST(Mutex, LockedMutexDestructionBug) ABSL_NO_THREAD_SAFETY_ANALYSIS {
}
}
-// --------------------------------------------------------
-// Test for bug with pattern of readers using a condvar. The bug was that if a
-// reader went to sleep on a condition variable while one or more other readers
-// held the lock, but there were no waiters, the reader count (held in the
-// mutex word) would be lost. (This is because Enqueue() had at one time
-// always placed the thread on the Mutex queue. Later (CL 4075610), to
-// tolerate re-entry into Mutex from a Condition predicate, Enqueue() was
-// changed so that it could also place a thread on a condition-variable. This
-// introduced the case where Enqueue() returned with an empty queue, and this
-// case was handled incorrectly in one place.)
-
-static void ReaderForReaderOnCondVar(absl::Mutex *mu, absl::CondVar *cv,
- int *running) {
- std::random_device dev;
- std::mt19937 gen(dev());
- std::uniform_int_distribution<int> random_millis(0, 15);
- mu->ReaderLock();
- while (*running == 3) {
- absl::SleepFor(absl::Milliseconds(random_millis(gen)));
- cv->WaitWithTimeout(mu, absl::Milliseconds(random_millis(gen)));
- }
- mu->ReaderUnlock();
- mu->Lock();
- (*running)--;
- mu->Unlock();
-}
-
struct True {
template <class... Args>
bool operator()(Args...) const {
@@ -945,6 +919,33 @@ TEST(Mutex, FunctorCondition) {
}
}
+// --------------------------------------------------------
+// Test for bug with pattern of readers using a condvar. The bug was that if a
+// reader went to sleep on a condition variable while one or more other readers
+// held the lock, but there were no waiters, the reader count (held in the
+// mutex word) would be lost. (This is because Enqueue() had at one time
+// always placed the thread on the Mutex queue. Later (CL 4075610), to
+// tolerate re-entry into Mutex from a Condition predicate, Enqueue() was
+// changed so that it could also place a thread on a condition-variable. This
+// introduced the case where Enqueue() returned with an empty queue, and this
+// case was handled incorrectly in one place.)
+
+static void ReaderForReaderOnCondVar(absl::Mutex *mu, absl::CondVar *cv,
+ int *running) {
+ std::random_device dev;
+ std::mt19937 gen(dev());
+ std::uniform_int_distribution<int> random_millis(0, 15);
+ mu->ReaderLock();
+ while (*running == 3) {
+ absl::SleepFor(absl::Milliseconds(random_millis(gen)));
+ cv->WaitWithTimeout(mu, absl::Milliseconds(random_millis(gen)));
+ }
+ mu->ReaderUnlock();
+ mu->Lock();
+ (*running)--;
+ mu->Unlock();
+}
+
static bool IntIsZero(int *x) { return *x == 0; }
// Test for reader waiting condition variable when there are other readers
diff --git a/grpc/third_party/abseil-cpp/absl/time/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/time/BUILD.bazel
index 3e25ca26..e8c49660 100644
--- a/grpc/third_party/abseil-cpp/absl/time/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/time/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/time/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/time/CMakeLists.txt
index 00bdd499..f6ff8bd1 100644
--- a/grpc/third_party/abseil-cpp/absl/time/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/time/CMakeLists.txt
@@ -102,7 +102,7 @@ absl_cc_library(
absl::config
absl::raw_logging_internal
absl::time_zone
- gmock
+ GTest::gmock
TESTONLY
)
@@ -124,5 +124,5 @@ absl_cc_test(
absl::config
absl::core_headers
absl::time_zone
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/time/civil_time.cc b/grpc/third_party/abseil-cpp/absl/time/civil_time.cc
index bdfe9ce0..6a231edb 100644
--- a/grpc/third_party/abseil-cpp/absl/time/civil_time.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/civil_time.cc
@@ -38,9 +38,7 @@ std::string FormatYearAnd(string_view fmt, CivilSecond cs) {
const CivilSecond ncs(NormalizeYear(cs.year()), cs.month(), cs.day(),
cs.hour(), cs.minute(), cs.second());
const TimeZone utc = UTCTimeZone();
- // TODO(absl-team): Avoid conversion of fmt string.
- return StrCat(cs.year(),
- FormatTime(std::string(fmt), FromCivil(ncs, utc), utc));
+ return StrCat(cs.year(), FormatTime(fmt, FromCivil(ncs, utc), utc));
}
template <typename CivilT>
diff --git a/grpc/third_party/abseil-cpp/absl/time/clock_test.cc b/grpc/third_party/abseil-cpp/absl/time/clock_test.cc
index 4bcfc6bc..bc77dbc2 100644
--- a/grpc/third_party/abseil-cpp/absl/time/clock_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/clock_test.cc
@@ -18,6 +18,10 @@
#if defined(ABSL_HAVE_ALARM)
#include <signal.h>
#include <unistd.h>
+#ifdef _AIX
+// sig_t is not defined in AIX.
+typedef void (*sig_t)(int);
+#endif
#elif defined(__linux__) || defined(__APPLE__)
#error all known Linux and Apple targets have alarm
#endif
diff --git a/grpc/third_party/abseil-cpp/absl/time/duration_test.cc b/grpc/third_party/abseil-cpp/absl/time/duration_test.cc
index fb28fa98..b7209e1c 100644
--- a/grpc/third_party/abseil-cpp/absl/time/duration_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/duration_test.cc
@@ -17,6 +17,7 @@
#endif
#include <chrono> // NOLINT(build/c++11)
+#include <cfloat>
#include <cmath>
#include <cstdint>
#include <ctime>
@@ -1320,7 +1321,7 @@ TEST(Duration, SmallConversions) {
EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(0));
// TODO(bww): Is the next one OK?
- EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(0.124999999e-9));
+ EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(std::nextafter(0.125e-9, 0)));
EXPECT_EQ(absl::Nanoseconds(1) / 4, absl::Seconds(0.125e-9));
EXPECT_EQ(absl::Nanoseconds(1) / 4, absl::Seconds(0.250e-9));
EXPECT_EQ(absl::Nanoseconds(1) / 2, absl::Seconds(0.375e-9));
@@ -1330,7 +1331,7 @@ TEST(Duration, SmallConversions) {
EXPECT_EQ(absl::Nanoseconds(1), absl::Seconds(0.875e-9));
EXPECT_EQ(absl::Nanoseconds(1), absl::Seconds(1.000e-9));
- EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(-0.124999999e-9));
+ EXPECT_EQ(absl::ZeroDuration(), absl::Seconds(std::nextafter(-0.125e-9, 0)));
EXPECT_EQ(-absl::Nanoseconds(1) / 4, absl::Seconds(-0.125e-9));
EXPECT_EQ(-absl::Nanoseconds(1) / 4, absl::Seconds(-0.250e-9));
EXPECT_EQ(-absl::Nanoseconds(1) / 2, absl::Seconds(-0.375e-9));
@@ -1390,6 +1391,14 @@ void VerifyApproxSameAsMul(double time_as_seconds, int* const misses) {
// Seconds(point) returns a duration near point * Seconds(1.0). (They may
// not be exactly equal due to fused multiply/add contraction.)
TEST(Duration, ToDoubleSecondsCheckEdgeCases) {
+#if (defined(__i386__) || defined(_M_IX86)) && FLT_EVAL_METHOD != 0
+ // We're using an x87-compatible FPU, and intermediate operations can be
+ // performed with 80-bit floats. This means the edge cases are different than
+ // what we expect here, so just skip this test.
+ GTEST_SKIP()
+ << "Skipping the test because we detected x87 floating-point semantics";
+#endif
+
constexpr uint32_t kTicksPerSecond = absl::time_internal::kTicksPerSecond;
constexpr auto duration_tick = absl::time_internal::MakeDuration(0, 1u);
int misses = 0;
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel
index 45a95292..bdc2e309 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/BUILD.bazel
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
-
package(features = ["-parse_headers"])
licenses(["notice"])
@@ -26,14 +24,14 @@ filegroup(
config_setting(
name = "osx",
constraint_values = [
- "@bazel_tools//platforms:osx",
+ "@platforms//os:osx",
],
)
config_setting(
name = "ios",
constraint_values = [
- "@bazel_tools//platforms:ios",
+ "@platforms//os:ios",
],
)
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h
index 5562a37b..6e382dc6 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h
@@ -22,6 +22,7 @@
#include <chrono>
#include <cstdint>
+#include <limits>
#include <string>
#include <utility>
@@ -41,20 +42,9 @@ using sys_seconds = seconds; // Deprecated. Use cctz::seconds instead.
namespace detail {
template <typename D>
-inline std::pair<time_point<seconds>, D> split_seconds(
- const time_point<D>& tp) {
- auto sec = std::chrono::time_point_cast<seconds>(tp);
- auto sub = tp - sec;
- if (sub.count() < 0) {
- sec -= seconds(1);
- sub += seconds(1);
- }
- return {sec, std::chrono::duration_cast<D>(sub)};
-}
-inline std::pair<time_point<seconds>, seconds> split_seconds(
- const time_point<seconds>& tp) {
- return {tp, seconds::zero()};
-}
+std::pair<time_point<seconds>, D> split_seconds(const time_point<D>& tp);
+std::pair<time_point<seconds>, seconds> split_seconds(
+ const time_point<seconds>& tp);
} // namespace detail
// cctz::time_zone is an opaque, small, value-type class representing a
@@ -279,6 +269,20 @@ std::string format(const std::string&, const time_point<seconds>&,
const femtoseconds&, const time_zone&);
bool parse(const std::string&, const std::string&, const time_zone&,
time_point<seconds>*, femtoseconds*, std::string* err = nullptr);
+template <typename Rep, std::intmax_t Denom>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds& fs,
+ time_point<std::chrono::duration<Rep, std::ratio<1, Denom>>>* tpp);
+template <typename Rep, std::intmax_t Num>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds& fs,
+ time_point<std::chrono::duration<Rep, std::ratio<Num, 1>>>* tpp);
+template <typename Rep>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds& fs,
+ time_point<std::chrono::duration<Rep, std::ratio<1, 1>>>* tpp);
+bool join_seconds(const time_point<seconds>& sec, const femtoseconds&,
+ time_point<seconds>* tpp);
} // namespace detail
// Formats the given time_point in the given cctz::time_zone according to
@@ -369,15 +373,84 @@ inline bool parse(const std::string& fmt, const std::string& input,
const time_zone& tz, time_point<D>* tpp) {
time_point<seconds> sec;
detail::femtoseconds fs;
- const bool b = detail::parse(fmt, input, tz, &sec, &fs);
- if (b) {
- // TODO: Return false if unrepresentable as a time_point<D>.
- *tpp = std::chrono::time_point_cast<D>(sec);
- *tpp += std::chrono::duration_cast<D>(fs);
+ return detail::parse(fmt, input, tz, &sec, &fs) &&
+ detail::join_seconds(sec, fs, tpp);
+}
+
+namespace detail {
+
+// Split a time_point<D> into a time_point<seconds> and a D subseconds.
+// Undefined behavior if time_point<seconds> is not of sufficient range.
+// Note that this means it is UB to call cctz::time_zone::lookup(tp) or
+// cctz::format(fmt, tp, tz) with a time_point that is outside the range
+// of a 64-bit std::time_t.
+template <typename D>
+std::pair<time_point<seconds>, D> split_seconds(const time_point<D>& tp) {
+ auto sec = std::chrono::time_point_cast<seconds>(tp);
+ auto sub = tp - sec;
+ if (sub.count() < 0) {
+ sec -= seconds(1);
+ sub += seconds(1);
}
- return b;
+ return {sec, std::chrono::duration_cast<D>(sub)};
+}
+
+inline std::pair<time_point<seconds>, seconds> split_seconds(
+ const time_point<seconds>& tp) {
+ return {tp, seconds::zero()};
}
+// Join a time_point<seconds> and femto subseconds into a time_point<D>.
+// Floors to the resolution of time_point<D>. Returns false if time_point<D>
+// is not of sufficient range.
+template <typename Rep, std::intmax_t Denom>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds& fs,
+ time_point<std::chrono::duration<Rep, std::ratio<1, Denom>>>* tpp) {
+ using D = std::chrono::duration<Rep, std::ratio<1, Denom>>;
+ // TODO(#199): Return false if result unrepresentable as a time_point<D>.
+ *tpp = std::chrono::time_point_cast<D>(sec);
+ *tpp += std::chrono::duration_cast<D>(fs);
+ return true;
+}
+
+template <typename Rep, std::intmax_t Num>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds&,
+ time_point<std::chrono::duration<Rep, std::ratio<Num, 1>>>* tpp) {
+ using D = std::chrono::duration<Rep, std::ratio<Num, 1>>;
+ auto count = sec.time_since_epoch().count();
+ if (count >= 0 || count % Num == 0) {
+ count /= Num;
+ } else {
+ count /= Num;
+ count -= 1;
+ }
+ if (count > (std::numeric_limits<Rep>::max)()) return false;
+ if (count < (std::numeric_limits<Rep>::min)()) return false;
+ *tpp = time_point<D>() + D{static_cast<Rep>(count)};
+ return true;
+}
+
+template <typename Rep>
+bool join_seconds(
+ const time_point<seconds>& sec, const femtoseconds&,
+ time_point<std::chrono::duration<Rep, std::ratio<1, 1>>>* tpp) {
+ using D = std::chrono::duration<Rep, std::ratio<1, 1>>;
+ auto count = sec.time_since_epoch().count();
+ if (count > (std::numeric_limits<Rep>::max)()) return false;
+ if (count < (std::numeric_limits<Rep>::min)()) return false;
+ *tpp = time_point<D>() + D{static_cast<Rep>(count)};
+ return true;
+}
+
+inline bool join_seconds(const time_point<seconds>& sec, const femtoseconds&,
+ time_point<seconds>* tpp) {
+ *tpp = sec;
+ return true;
+}
+
+} // namespace detail
} // namespace cctz
} // namespace time_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc
index 4e39188f..6770ad6b 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc
@@ -648,6 +648,7 @@ const char* const kTimeZoneNames[] = {"Africa/Abidjan",
"Pacific/Guam",
"Pacific/Honolulu",
"Pacific/Johnston",
+ "Pacific/Kanton",
"Pacific/Kiritimati",
"Pacific/Kosrae",
"Pacific/Kwajalein",
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc
index 303c0244..f2b3294e 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc
@@ -53,7 +53,7 @@ int Parse02d(const char* p) {
} // namespace
bool FixedOffsetFromName(const std::string& name, seconds* offset) {
- if (name.compare(0, std::string::npos, "UTC", 3) == 0) {
+ if (name == "UTC" || name == "UTC0") {
*offset = seconds::zero();
return true;
}
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc
index a11f93e2..6487fa93 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc
@@ -13,6 +13,7 @@
// limitations under the License.
#include <chrono>
+#include <cstdint>
#include <iomanip>
#include <sstream>
#include <string>
@@ -1135,7 +1136,7 @@ TEST(Parse, ExtendedSeconds) {
// All %E<prec>S cases are treated the same as %E*S on input.
auto precisions = {"*", "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15"};
- for (const std::string& prec : precisions) {
+ for (const std::string prec : precisions) {
const std::string fmt = "%E" + prec + "S";
SCOPED_TRACE(fmt);
time_point<chrono::nanoseconds> tp = unix_epoch;
@@ -1217,7 +1218,7 @@ TEST(Parse, ExtendedSubeconds) {
// All %E<prec>f cases are treated the same as %E*f on input.
auto precisions = {"*", "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15"};
- for (const std::string& prec : precisions) {
+ for (const std::string prec : precisions) {
const std::string fmt = "%E" + prec + "f";
SCOPED_TRACE(fmt);
time_point<chrono::nanoseconds> tp = unix_epoch - chrono::seconds(1);
@@ -1504,7 +1505,7 @@ TEST(Parse, MaxRange) {
parse(RFC3339_sec, "292277026596-12-04T14:30:07-01:00", utc, &tp));
EXPECT_EQ(tp, time_point<absl::time_internal::cctz::seconds>::max());
EXPECT_FALSE(
- parse(RFC3339_sec, "292277026596-12-04T15:30:07-01:00", utc, &tp));
+ parse(RFC3339_sec, "292277026596-12-04T14:30:08-01:00", utc, &tp));
// tests the lower limit using +00:00 offset
EXPECT_TRUE(
@@ -1525,10 +1526,82 @@ TEST(Parse, MaxRange) {
parse(RFC3339_sec, "9223372036854775807-12-31T23:59:59-00:01", utc, &tp));
EXPECT_FALSE(parse(RFC3339_sec, "-9223372036854775808-01-01T00:00:00+00:01",
utc, &tp));
+}
+
+TEST(Parse, TimePointOverflow) {
+ const time_zone utc = utc_time_zone();
+
+ using D = chrono::duration<std::int64_t, std::nano>;
+ time_point<D> tp;
+
+ EXPECT_TRUE(
+ parse(RFC3339_full, "2262-04-11T23:47:16.8547758079+00:00", utc, &tp));
+ EXPECT_EQ(tp, time_point<D>::max());
+ EXPECT_EQ("2262-04-11T23:47:16.854775807+00:00",
+ format(RFC3339_full, tp, utc));
+#if 0
+ // TODO(#199): Will fail until cctz::parse() properly detects overflow.
+ EXPECT_FALSE(
+ parse(RFC3339_full, "2262-04-11T23:47:16.8547758080+00:00", utc, &tp));
+ EXPECT_TRUE(
+ parse(RFC3339_full, "1677-09-21T00:12:43.1452241920+00:00", utc, &tp));
+ EXPECT_EQ(tp, time_point<D>::min());
+ EXPECT_EQ("1677-09-21T00:12:43.145224192+00:00",
+ format(RFC3339_full, tp, utc));
+ EXPECT_FALSE(
+ parse(RFC3339_full, "1677-09-21T00:12:43.1452241919+00:00", utc, &tp));
+#endif
+
+ using DS = chrono::duration<std::int8_t, chrono::seconds::period>;
+ time_point<DS> stp;
+
+ EXPECT_TRUE(parse(RFC3339_full, "1970-01-01T00:02:07.9+00:00", utc, &stp));
+ EXPECT_EQ(stp, time_point<DS>::max());
+ EXPECT_EQ("1970-01-01T00:02:07+00:00", format(RFC3339_full, stp, utc));
+ EXPECT_FALSE(parse(RFC3339_full, "1970-01-01T00:02:08+00:00", utc, &stp));
+
+ EXPECT_TRUE(parse(RFC3339_full, "1969-12-31T23:57:52+00:00", utc, &stp));
+ EXPECT_EQ(stp, time_point<DS>::min());
+ EXPECT_EQ("1969-12-31T23:57:52+00:00", format(RFC3339_full, stp, utc));
+ EXPECT_FALSE(parse(RFC3339_full, "1969-12-31T23:57:51.9+00:00", utc, &stp));
- // TODO: Add tests that parsing times with fractional seconds overflow
- // appropriately. This can't be done until cctz::parse() properly detects
- // overflow when combining the chrono seconds and femto.
+ using DM = chrono::duration<std::int8_t, chrono::minutes::period>;
+ time_point<DM> mtp;
+
+ EXPECT_TRUE(parse(RFC3339_full, "1970-01-01T02:07:59+00:00", utc, &mtp));
+ EXPECT_EQ(mtp, time_point<DM>::max());
+ EXPECT_EQ("1970-01-01T02:07:00+00:00", format(RFC3339_full, mtp, utc));
+ EXPECT_FALSE(parse(RFC3339_full, "1970-01-01T02:08:00+00:00", utc, &mtp));
+
+ EXPECT_TRUE(parse(RFC3339_full, "1969-12-31T21:52:00+00:00", utc, &mtp));
+ EXPECT_EQ(mtp, time_point<DM>::min());
+ EXPECT_EQ("1969-12-31T21:52:00+00:00", format(RFC3339_full, mtp, utc));
+ EXPECT_FALSE(parse(RFC3339_full, "1969-12-31T21:51:59+00:00", utc, &mtp));
+}
+
+TEST(Parse, TimePointOverflowFloor) {
+ const time_zone utc = utc_time_zone();
+
+ using D = chrono::duration<std::int64_t, std::micro>;
+ time_point<D> tp;
+
+ EXPECT_TRUE(
+ parse(RFC3339_full, "294247-01-10T04:00:54.7758079+00:00", utc, &tp));
+ EXPECT_EQ(tp, time_point<D>::max());
+ EXPECT_EQ("294247-01-10T04:00:54.775807+00:00",
+ format(RFC3339_full, tp, utc));
+#if 0
+ // TODO(#199): Will fail until cctz::parse() properly detects overflow.
+ EXPECT_FALSE(
+ parse(RFC3339_full, "294247-01-10T04:00:54.7758080+00:00", utc, &tp));
+ EXPECT_TRUE(
+ parse(RFC3339_full, "-290308-12-21T19:59:05.2241920+00:00", utc, &tp));
+ EXPECT_EQ(tp, time_point<D>::min());
+ EXPECT_EQ("-290308-12-21T19:59:05.224192+00:00",
+ format(RFC3339_full, tp, utc));
+ EXPECT_FALSE(
+ parse(RFC3339_full, "-290308-12-21T19:59:05.2241919+00:00", utc, &tp));
+#endif
}
//
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h
index 32c0891c..7d3e42d3 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h
@@ -56,7 +56,8 @@ class TimeZoneIf {
// Convert between time_point<seconds> and a count of seconds since the
// Unix epoch. We assume that the std::chrono::system_clock and the
-// Unix clock are second aligned, but not that they share an epoch.
+// Unix clock are second aligned, and that the results are representable.
+// (That is, that they share an epoch, which is required since C++20.)
inline std::int_fast64_t ToUnixSeconds(const time_point<seconds>& tp) {
return (tp - std::chrono::time_point_cast<seconds>(
std::chrono::system_clock::from_time_t(0)))
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
index 8039353e..4f175d95 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
@@ -39,10 +39,12 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <fstream>
#include <functional>
#include <memory>
#include <sstream>
#include <string>
+#include <utility>
#include "absl/base/config.h"
#include "absl/time/internal/cctz/include/cctz/civil_time.h"
@@ -576,14 +578,17 @@ bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
namespace {
+using FilePtr = std::unique_ptr<FILE, int (*)(FILE*)>;
+
// fopen(3) adaptor.
-inline FILE* FOpen(const char* path, const char* mode) {
+inline FilePtr FOpen(const char* path, const char* mode) {
#if defined(_MSC_VER)
FILE* fp;
if (fopen_s(&fp, path, mode) != 0) fp = nullptr;
- return fp;
+ return FilePtr(fp, fclose);
#else
- return fopen(path, mode); // TODO: Enable the close-on-exec flag.
+ // TODO: Enable the close-on-exec flag.
+ return FilePtr(fopen(path, mode), fclose);
#endif
}
@@ -611,11 +616,11 @@ class FileZoneInfoSource : public ZoneInfoSource {
protected:
explicit FileZoneInfoSource(
- FILE* fp, std::size_t len = std::numeric_limits<std::size_t>::max())
- : fp_(fp, fclose), len_(len) {}
+ FilePtr fp, std::size_t len = std::numeric_limits<std::size_t>::max())
+ : fp_(std::move(fp)), len_(len) {}
private:
- std::unique_ptr<FILE, int (*)(FILE*)> fp_;
+ FilePtr fp_;
std::size_t len_;
};
@@ -644,17 +649,9 @@ std::unique_ptr<ZoneInfoSource> FileZoneInfoSource::Open(
path.append(name, pos, std::string::npos);
// Open the zoneinfo file.
- FILE* fp = FOpen(path.c_str(), "rb");
+ auto fp = FOpen(path.c_str(), "rb");
if (fp == nullptr) return nullptr;
- std::size_t length = 0;
- if (fseek(fp, 0, SEEK_END) == 0) {
- long offset = ftell(fp);
- if (offset >= 0) {
- length = static_cast<std::size_t>(offset);
- }
- rewind(fp);
- }
- return std::unique_ptr<ZoneInfoSource>(new FileZoneInfoSource(fp, length));
+ return std::unique_ptr<ZoneInfoSource>(new FileZoneInfoSource(std::move(fp)));
}
class AndroidZoneInfoSource : public FileZoneInfoSource {
@@ -663,8 +660,9 @@ class AndroidZoneInfoSource : public FileZoneInfoSource {
std::string Version() const override { return version_; }
private:
- explicit AndroidZoneInfoSource(FILE* fp, std::size_t len, const char* vers)
- : FileZoneInfoSource(fp, len), version_(vers) {}
+ explicit AndroidZoneInfoSource(FilePtr fp, std::size_t len,
+ std::string version)
+ : FileZoneInfoSource(std::move(fp), len), version_(std::move(version)) {}
std::string version_;
};
@@ -676,8 +674,8 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
// See Android's libc/tzcode/bionic.cpp for additional information.
for (const char* tzdata : {"/data/misc/zoneinfo/current/tzdata",
"/system/usr/share/zoneinfo/tzdata"}) {
- std::unique_ptr<FILE, int (*)(FILE*)> fp(FOpen(tzdata, "rb"), fclose);
- if (fp.get() == nullptr) continue;
+ auto fp = FOpen(tzdata, "rb");
+ if (fp == nullptr) continue;
char hbuf[24]; // covers header.zonetab_offset too
if (fread(hbuf, 1, sizeof(hbuf), fp.get()) != sizeof(hbuf)) continue;
@@ -703,7 +701,7 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
if (strcmp(name.c_str() + pos, ebuf) == 0) {
if (fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0) break;
return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
- fp.release(), static_cast<std::size_t>(length), vers));
+ std::move(fp), static_cast<std::size_t>(length), vers));
}
}
}
@@ -711,6 +709,69 @@ std::unique_ptr<ZoneInfoSource> AndroidZoneInfoSource::Open(
return nullptr;
}
+// A zoneinfo source for use inside Fuchsia components. This attempts to
+// read zoneinfo files from one of several known paths in a component's
+// incoming namespace. [Config data][1] is preferred, but package-specific
+// resources are also supported.
+//
+// Fuchsia's implementation supports `FileZoneInfoSource::Version()`.
+//
+// [1]:
+// https://fuchsia.dev/fuchsia-src/development/components/data#using_config_data_in_your_component
+class FuchsiaZoneInfoSource : public FileZoneInfoSource {
+ public:
+ static std::unique_ptr<ZoneInfoSource> Open(const std::string& name);
+ std::string Version() const override { return version_; }
+
+ private:
+ explicit FuchsiaZoneInfoSource(FilePtr fp, std::string version)
+ : FileZoneInfoSource(std::move(fp)), version_(std::move(version)) {}
+ std::string version_;
+};
+
+std::unique_ptr<ZoneInfoSource> FuchsiaZoneInfoSource::Open(
+ const std::string& name) {
+ // Use of the "file:" prefix is intended for testing purposes only.
+ const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
+
+ // Prefixes where a Fuchsia component might find zoneinfo files,
+ // in descending order of preference.
+ const auto kTzdataPrefixes = {
+ "/config/data/tzdata/",
+ "/pkg/data/tzdata/",
+ "/data/tzdata/",
+ };
+ const auto kEmptyPrefix = {""};
+ const bool name_absolute = (pos != name.size() && name[pos] == '/');
+ const auto prefixes = name_absolute ? kEmptyPrefix : kTzdataPrefixes;
+
+ // Fuchsia builds place zoneinfo files at "<prefix><format><name>".
+ for (const std::string prefix : prefixes) {
+ std::string path = prefix;
+ if (!prefix.empty()) path += "zoneinfo/tzif2/"; // format
+ path.append(name, pos, std::string::npos);
+
+ auto fp = FOpen(path.c_str(), "rb");
+ if (fp == nullptr) continue;
+
+ std::string version;
+ if (!prefix.empty()) {
+ // Fuchsia builds place the version in "<prefix>revision.txt".
+ std::ifstream version_stream(prefix + "revision.txt");
+ if (version_stream.is_open()) {
+ // revision.txt should contain no newlines, but to be
+ // defensive we read just the first line.
+ std::getline(version_stream, version);
+ }
+ }
+
+ return std::unique_ptr<ZoneInfoSource>(
+ new FuchsiaZoneInfoSource(std::move(fp), std::move(version)));
+ }
+
+ return nullptr;
+}
+
} // namespace
bool TimeZoneInfo::Load(const std::string& name) {
@@ -728,6 +789,7 @@ bool TimeZoneInfo::Load(const std::string& name) {
name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
if (auto z = FileZoneInfoSource::Open(n)) return z;
if (auto z = AndroidZoneInfoSource::Open(n)) return z;
+ if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
return nullptr;
});
return zip != nullptr && Load(zip.get());
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc
index efdea64b..898d04c1 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc
@@ -28,6 +28,13 @@
#include <vector>
#endif
+#if defined(__Fuchsia__)
+#include <fuchsia/intl/cpp/fidl.h>
+#include <lib/async-loop/cpp/loop.h>
+#include <lib/sys/cpp/component_context.h>
+#include <zircon/types.h>
+#endif
+
#include <cstdlib>
#include <cstring>
#include <string>
@@ -140,6 +147,48 @@ time_zone local_time_zone() {
}
CFRelease(tz_default);
#endif
+#if defined(__Fuchsia__)
+ std::string primary_tz;
+ [&]() {
+ // Note: We can't use the synchronous FIDL API here because it doesn't
+ // allow timeouts; if the FIDL call failed, local_time_zone() would never
+ // return.
+
+ const zx::duration kTimeout = zx::msec(500);
+
+ // Don't attach to the thread because otherwise the thread's dispatcher
+ // would be set to null when the loop is destroyed, causing any other FIDL
+ // code running on the same thread to crash.
+ async::Loop loop(&kAsyncLoopConfigNeverAttachToThread);
+ std::unique_ptr<sys::ComponentContext> context =
+ sys::ComponentContext::Create();
+
+ fuchsia::intl::PropertyProviderHandle handle;
+ zx_status_t status = context->svc()->Connect(handle.NewRequest());
+ if (status != ZX_OK) {
+ return;
+ }
+
+ fuchsia::intl::PropertyProviderPtr intl_provider;
+ status = intl_provider.Bind(std::move(handle), loop.dispatcher());
+ if (status != ZX_OK) {
+ return;
+ }
+
+ intl_provider->GetProfile(
+ [&loop, &primary_tz](fuchsia::intl::Profile profile) {
+ if (!profile.time_zones().empty()) {
+ primary_tz = profile.time_zones()[0].id;
+ }
+ loop.Quit();
+ });
+ loop.Run(zx::deadline_after(kTimeout));
+ }();
+
+ if (!primary_tz.empty()) {
+ zone = primary_tz.c_str();
+ }
+#endif
// Allow ${TZ} to override to default zone.
char* tz_env = nullptr;
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc
index 9a1a8d6e..0226ab71 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc
@@ -579,6 +579,7 @@ const char* const kTimeZoneNames[] = {"Africa/Abidjan",
"Pacific/Guam",
"Pacific/Honolulu",
"Pacific/Johnston",
+ "Pacific/Kanton",
"Pacific/Kiritimati",
"Pacific/Kosrae",
"Pacific/Kwajalein",
@@ -717,6 +718,18 @@ TEST(TimeZones, LoadZonesConcurrently) {
}
#endif
+TEST(TimeZone, UTC) {
+ const time_zone utc = utc_time_zone();
+
+ time_zone loaded_utc;
+ EXPECT_TRUE(load_time_zone("UTC", &loaded_utc));
+ EXPECT_EQ(loaded_utc, utc);
+
+ time_zone loaded_utc0;
+ EXPECT_TRUE(load_time_zone("UTC0", &loaded_utc0));
+ EXPECT_EQ(loaded_utc0, utc);
+}
+
TEST(TimeZone, NamedTimeZones) {
const time_zone utc = utc_time_zone();
EXPECT_EQ("UTC", utc.name());
@@ -1014,8 +1027,12 @@ TEST(MakeTime, SysSecondsLimits) {
#endif
const year_t min_tm_year = year_t{std::numeric_limits<int>::min()} + 1900;
tp = convert(civil_second(min_tm_year, 1, 1, 0, 0, 0), cut);
+#if defined(__Fuchsia__)
+ // Fuchsia's gmtime_r() fails on extreme negative values (fxbug.dev/78527).
+#else
EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", format(RFC3339, tp, cut));
#endif
+#endif
}
}
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h
index 269fa36c..31e85982 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h
@@ -43,7 +43,7 @@
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
- char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
+ char tzh_version[1]; /* '\0' or '2'-'4' as of 2021 */
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
diff --git a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc
index 72095339..5ab5a59e 100644
--- a/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc
+++ b/grpc/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc
@@ -65,7 +65,7 @@ ZoneInfoSourceFactory zone_info_source_factory __attribute__((weak)) =
extern ZoneInfoSourceFactory zone_info_source_factory;
extern ZoneInfoSourceFactory default_factory;
ZoneInfoSourceFactory default_factory = DefaultFactory;
-#if defined(_M_IX86)
+#if defined(_M_IX86) || defined(_M_ARM)
#pragma comment( \
linker, \
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
@@ -83,8 +83,7 @@ ZoneInfoSourceFactory default_factory = DefaultFactory;
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \
"@@ZA")
-#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM) || \
- defined(_M_ARM64)
+#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64)
#pragma comment( \
linker, \
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \
diff --git a/grpc/third_party/abseil-cpp/absl/time/time.h b/grpc/third_party/abseil-cpp/absl/time/time.h
index 2df68581..5abd815a 100644
--- a/grpc/third_party/abseil-cpp/absl/time/time.h
+++ b/grpc/third_party/abseil-cpp/absl/time/time.h
@@ -182,18 +182,29 @@ class Duration {
// Overloads that forward to either the int64_t or double overloads above.
// Integer operands must be representable as int64_t.
- template <typename T>
+ template <typename T, time_internal::EnableIfIntegral<T> = 0>
Duration& operator*=(T r) {
int64_t x = r;
return *this *= x;
}
- template <typename T>
+
+ template <typename T, time_internal::EnableIfIntegral<T> = 0>
Duration& operator/=(T r) {
int64_t x = r;
return *this /= x;
}
- Duration& operator*=(float r) { return *this *= static_cast<double>(r); }
- Duration& operator/=(float r) { return *this /= static_cast<double>(r); }
+
+ template <typename T, time_internal::EnableIfFloat<T> = 0>
+ Duration& operator*=(T r) {
+ double x = r;
+ return *this *= x;
+ }
+
+ template <typename T, time_internal::EnableIfFloat<T> = 0>
+ Duration& operator/=(T r) {
+ double x = r;
+ return *this /= x;
+ }
template <typename H>
friend H AbslHashValue(H h, Duration d) {
@@ -392,12 +403,30 @@ constexpr Duration InfiniteDuration();
//
// absl::Duration a = absl::Seconds(60);
// absl::Duration b = absl::Minutes(1); // b == a
-constexpr Duration Nanoseconds(int64_t n);
-constexpr Duration Microseconds(int64_t n);
-constexpr Duration Milliseconds(int64_t n);
-constexpr Duration Seconds(int64_t n);
-constexpr Duration Minutes(int64_t n);
-constexpr Duration Hours(int64_t n);
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Nanoseconds(T n) {
+ return time_internal::FromInt64(n, std::nano{});
+}
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Microseconds(T n) {
+ return time_internal::FromInt64(n, std::micro{});
+}
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Milliseconds(T n) {
+ return time_internal::FromInt64(n, std::milli{});
+}
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Seconds(T n) {
+ return time_internal::FromInt64(n, std::ratio<1>{});
+}
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Minutes(T n) {
+ return time_internal::FromInt64(n, std::ratio<60>{});
+}
+template <typename T, time_internal::EnableIfIntegral<T> = 0>
+constexpr Duration Hours(T n) {
+ return time_internal::FromInt64(n, std::ratio<3600>{});
+}
// Factory overloads for constructing `Duration` values from a floating-point
// number of the unit indicated by the factory function's name. These functions
@@ -451,8 +480,9 @@ Duration Hours(T n) {
// ToInt64Hours()
//
// Helper functions that convert a Duration to an integral count of the
-// indicated unit. These functions are shorthand for the `IDivDuration()`
-// function above; see its documentation for details about overflow, etc.
+// indicated unit. These return the same results as the `IDivDuration()`
+// function, though they usually do so more efficiently; see the
+// documentation of `IDivDuration()` for details about overflow, etc.
//
// Example:
//
@@ -547,10 +577,20 @@ inline std::ostream& operator<<(std::ostream& os, Duration d) {
// `ZeroDuration()`. Parses "inf" and "-inf" as +/- `InfiniteDuration()`.
bool ParseDuration(absl::string_view dur_string, Duration* d);
-// Support for flag values of type Duration. Duration flags must be specified
-// in a format that is valid input for absl::ParseDuration().
+// AbslParseFlag()
+//
+// Parses a command-line flag string representation `text` into a a Duration
+// value. Duration flags must be specified in a format that is valid input for
+// `absl::ParseDuration()`.
bool AbslParseFlag(absl::string_view text, Duration* dst, std::string* error);
+
+
+// AbslUnparseFlag()
+//
+// Unparses a Duration value into a command-line string representation using
+// the format specified by `absl::ParseDuration()`.
std::string AbslUnparseFlag(Duration d);
+
ABSL_DEPRECATED("Use AbslParseFlag() instead.")
bool ParseFlag(const std::string& text, Duration* dst, std::string* error);
ABSL_DEPRECATED("Use AbslUnparseFlag() instead.")
@@ -813,8 +853,12 @@ Time FromChrono(const std::chrono::system_clock::time_point& tp);
// // tp == std::chrono::system_clock::from_time_t(123);
std::chrono::system_clock::time_point ToChronoTime(Time);
-// Support for flag values of type Time. Time flags must be specified in a
-// format that matches absl::RFC3339_full. For example:
+// AbslParseFlag()
+//
+// Parses the command-line flag string representation `text` into a Time value.
+// Time flags must be specified in a format that matches absl::RFC3339_full.
+//
+// For example:
//
// --start_time=2016-01-02T03:04:05.678+08:00
//
@@ -824,7 +868,13 @@ std::chrono::system_clock::time_point ToChronoTime(Time);
// seconds/milliseconds/etc from the Unix epoch, use an absl::Duration flag
// and add that duration to absl::UnixEpoch() to get an absl::Time.
bool AbslParseFlag(absl::string_view text, Time* t, std::string* error);
+
+// AbslUnparseFlag()
+//
+// Unparses a Time value into a command-line string representation using
+// the format specified by `absl::ParseTime()`.
std::string AbslUnparseFlag(Time t);
+
ABSL_DEPRECATED("Use AbslParseFlag() instead.")
bool ParseFlag(const std::string& text, Time* t, std::string* error);
ABSL_DEPRECATED("Use AbslUnparseFlag() instead.")
@@ -1352,7 +1402,7 @@ constexpr Duration MakeDuration(int64_t hi, int64_t lo) {
inline Duration MakePosDoubleDuration(double n) {
const int64_t int_secs = static_cast<int64_t>(n);
const uint32_t ticks = static_cast<uint32_t>(
- (n - static_cast<double>(int_secs)) * kTicksPerSecond + 0.5);
+ std::round((n - static_cast<double>(int_secs)) * kTicksPerSecond));
return ticks < kTicksPerSecond
? MakeDuration(int_secs, ticks)
: MakeDuration(int_secs + 1, ticks - kTicksPerSecond);
@@ -1476,25 +1526,6 @@ T ToChronoDuration(Duration d) {
} // namespace time_internal
-constexpr Duration Nanoseconds(int64_t n) {
- return time_internal::FromInt64(n, std::nano{});
-}
-constexpr Duration Microseconds(int64_t n) {
- return time_internal::FromInt64(n, std::micro{});
-}
-constexpr Duration Milliseconds(int64_t n) {
- return time_internal::FromInt64(n, std::milli{});
-}
-constexpr Duration Seconds(int64_t n) {
- return time_internal::FromInt64(n, std::ratio<1>{});
-}
-constexpr Duration Minutes(int64_t n) {
- return time_internal::FromInt64(n, std::ratio<60>{});
-}
-constexpr Duration Hours(int64_t n) {
- return time_internal::FromInt64(n, std::ratio<3600>{});
-}
-
constexpr bool operator<(Duration lhs, Duration rhs) {
return time_internal::GetRepHi(lhs) != time_internal::GetRepHi(rhs)
? time_internal::GetRepHi(lhs) < time_internal::GetRepHi(rhs)
diff --git a/grpc/third_party/abseil-cpp/absl/types/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/types/BUILD.bazel
index 83be9360..38ed2286 100644
--- a/grpc/third_party/abseil-cpp/absl/types/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/types/BUILD.bazel
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/types/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/types/CMakeLists.txt
index c356b211..d7e8614e 100644
--- a/grpc/third_party/abseil-cpp/absl/types/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/types/CMakeLists.txt
@@ -69,7 +69,7 @@ absl_cc_test(
absl::exception_testing
absl::raw_logging_internal
absl::test_instance_tracker
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -85,7 +85,7 @@ absl_cc_test(
absl::exception_testing
absl::raw_logging_internal
absl::test_instance_tracker
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -99,7 +99,7 @@ absl_cc_test(
absl::any
absl::config
absl::exception_safety_testing
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -136,7 +136,7 @@ absl_cc_test(
absl::inlined_vector
absl::hash_testing
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -156,7 +156,7 @@ absl_cc_test(
absl::inlined_vector
absl::hash_testing
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -222,7 +222,7 @@ absl_cc_test(
absl::raw_logging_internal
absl::strings
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -236,7 +236,7 @@ absl_cc_test(
absl::optional
absl::config
absl::exception_safety_testing
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -258,7 +258,7 @@ absl_cc_library(
absl::type_traits
absl::strings
absl::utility
- gmock_main
+ GTest::gmock_main
TESTONLY
)
@@ -275,7 +275,7 @@ absl_cc_test(
DEPS
absl::conformance_testing
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -288,7 +288,7 @@ absl_cc_test(
DEPS
absl::conformance_testing
absl::type_traits
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -324,7 +324,7 @@ absl_cc_test(
absl::memory
absl::type_traits
absl::strings
- gmock_main
+ GTest::gmock_main
)
absl_cc_library(
@@ -350,7 +350,7 @@ absl_cc_test(
DEPS
absl::base
absl::compare
- gmock_main
+ GTest::gmock_main
)
absl_cc_test(
@@ -365,5 +365,5 @@ absl_cc_test(
absl::config
absl::exception_safety_testing
absl::memory
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/absl/types/bad_optional_access.h b/grpc/third_party/abseil-cpp/absl/types/bad_optional_access.h
index a500286a..049e72ad 100644
--- a/grpc/third_party/abseil-cpp/absl/types/bad_optional_access.h
+++ b/grpc/third_party/abseil-cpp/absl/types/bad_optional_access.h
@@ -67,7 +67,7 @@ class bad_optional_access : public std::exception {
namespace optional_internal {
// throw delegator
-[[noreturn]] void throw_bad_optional_access();
+[[noreturn]] ABSL_DLL void throw_bad_optional_access();
} // namespace optional_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/types/bad_variant_access.h b/grpc/third_party/abseil-cpp/absl/types/bad_variant_access.h
index 095969f9..8ab215e9 100644
--- a/grpc/third_party/abseil-cpp/absl/types/bad_variant_access.h
+++ b/grpc/third_party/abseil-cpp/absl/types/bad_variant_access.h
@@ -70,8 +70,8 @@ class bad_variant_access : public std::exception {
namespace variant_internal {
-[[noreturn]] void ThrowBadVariantAccess();
-[[noreturn]] void Rethrow();
+[[noreturn]] ABSL_DLL void ThrowBadVariantAccess();
+[[noreturn]] ABSL_DLL void Rethrow();
} // namespace variant_internal
ABSL_NAMESPACE_END
diff --git a/grpc/third_party/abseil-cpp/absl/types/span.h b/grpc/third_party/abseil-cpp/absl/types/span.h
index 95fe7926..6272bb7a 100644
--- a/grpc/third_party/abseil-cpp/absl/types/span.h
+++ b/grpc/third_party/abseil-cpp/absl/types/span.h
@@ -40,7 +40,6 @@
// * `absl::Span` has compiler-provided move and copy constructors and
// assignment. This is due to them being specified as `constexpr`, but that
// implies const in C++11.
-// * `absl::Span` has no `element_type` typedef
// * A read-only `absl::Span<const T>` can be implicitly constructed from an
// initializer list.
// * `absl::Span` has no `bytes()`, `size_bytes()`, `as_bytes()`, or
@@ -170,6 +169,7 @@ class Span {
typename std::enable_if<!std::is_const<T>::value, U>::type;
public:
+ using element_type = T;
using value_type = absl::remove_cv_t<T>;
using pointer = T*;
using const_pointer = const T*;
@@ -243,8 +243,8 @@ class Span {
//
template <typename LazyT = T,
typename = EnableIfConstView<LazyT>>
- Span(
- std::initializer_list<value_type> v) noexcept // NOLINT(runtime/explicit)
+ Span(std::initializer_list<value_type> v
+ ABSL_ATTRIBUTE_LIFETIME_BOUND) noexcept // NOLINT(runtime/explicit)
: Span(v.begin(), v.size()) {}
// Accessors
diff --git a/grpc/third_party/abseil-cpp/absl/types/span_test.cc b/grpc/third_party/abseil-cpp/absl/types/span_test.cc
index 2584339b..13264aae 100644
--- a/grpc/third_party/abseil-cpp/absl/types/span_test.cc
+++ b/grpc/third_party/abseil-cpp/absl/types/span_test.cc
@@ -661,6 +661,8 @@ TEST(IntSpan, ExposesContainerTypesAndConsts) {
CheckType<absl::Span<int>::const_reverse_iterator>(slice.crend());
testing::StaticAssertTypeEq<int, absl::Span<int>::value_type>();
testing::StaticAssertTypeEq<int, absl::Span<const int>::value_type>();
+ testing::StaticAssertTypeEq<int, absl::Span<int>::element_type>();
+ testing::StaticAssertTypeEq<const int, absl::Span<const int>::element_type>();
testing::StaticAssertTypeEq<int*, absl::Span<int>::pointer>();
testing::StaticAssertTypeEq<const int*, absl::Span<const int>::pointer>();
testing::StaticAssertTypeEq<int&, absl::Span<int>::reference>();
diff --git a/grpc/third_party/abseil-cpp/absl/utility/BUILD.bazel b/grpc/third_party/abseil-cpp/absl/utility/BUILD.bazel
index 02b2c407..ca4bc0a6 100644
--- a/grpc/third_party/abseil-cpp/absl/utility/BUILD.bazel
+++ b/grpc/third_party/abseil-cpp/absl/utility/BUILD.bazel
@@ -14,7 +14,6 @@
# limitations under the License.
#
-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(
"//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
diff --git a/grpc/third_party/abseil-cpp/absl/utility/CMakeLists.txt b/grpc/third_party/abseil-cpp/absl/utility/CMakeLists.txt
index e1edd19a..865b758f 100644
--- a/grpc/third_party/abseil-cpp/absl/utility/CMakeLists.txt
+++ b/grpc/third_party/abseil-cpp/absl/utility/CMakeLists.txt
@@ -40,5 +40,5 @@ absl_cc_test(
absl::core_headers
absl::memory
absl::strings
- gmock_main
+ GTest::gmock_main
)
diff --git a/grpc/third_party/abseil-cpp/ci/cmake_common.sh b/grpc/third_party/abseil-cpp/ci/cmake_common.sh
index aec8a117..51f31069 100644
--- a/grpc/third_party/abseil-cpp/ci/cmake_common.sh
+++ b/grpc/third_party/abseil-cpp/ci/cmake_common.sh
@@ -14,7 +14,7 @@
# The commit of GoogleTest to be used in the CMake tests in this directory.
# Keep this in sync with the commit in the WORKSPACE file.
-readonly ABSL_GOOGLETEST_COMMIT="8567b09290fe402cf01923e2131c5635b8ed851b"
+readonly ABSL_GOOGLETEST_COMMIT="8d51ffdfab10b3fba636ae69bc03da4b54f8c235"
# Avoid depending on GitHub by looking for a cached copy of the commit first.
if [[ -r "${KOKORO_GFILE_DIR:-}/distdir/${ABSL_GOOGLETEST_COMMIT}.zip" ]]; then
diff --git a/grpc/third_party/abseil-cpp/ci/cmake_install_test.sh b/grpc/third_party/abseil-cpp/ci/cmake_install_test.sh
index ffc6b516..97ed8478 100755
--- a/grpc/third_party/abseil-cpp/ci/cmake_install_test.sh
+++ b/grpc/third_party/abseil-cpp/ci/cmake_install_test.sh
@@ -36,8 +36,11 @@ for link_type in ${LINK_TYPE}; do
--tmpfs=/abseil-cpp:exec \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
+ -e "ABSL_GOOGLETEST_COMMIT=${ABSL_GOOGLETEST_COMMIT}" \
+ -e "ABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL}" \
-e "LINK_TYPE=${link_type}" \
--rm \
+ ${DOCKER_EXTRA_ARGS:-} \
${DOCKER_CONTAINER} \
/bin/bash -c "cp -r /abseil-cpp-ro/* . && CMake/install_test_project/test.sh"
done
diff --git a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
index ffbb8327..5245933a 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
@@ -83,6 +83,7 @@ for std in ${STD}; do
--copt="-fsanitize=undefined" \
--copt="-fno-sanitize-blacklist" \
--copt=-Werror \
+ --distdir="/bazel-distdir" \
--keep_going \
--linkopt="-fsanitize=address" \
--linkopt="-fsanitize-link-c++-runtime" \
diff --git a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
index f6a2221e..e0fe653d 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
@@ -85,6 +85,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \
--copt=-Werror \
--define=\"absl=1\" \
+ --distdir=\"/bazel-distdir\" \
--keep_going \
--show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \
diff --git a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
index e70e8214..555f6b1c 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
@@ -81,6 +81,7 @@ for std in ${STD}; do
--copt="-fsanitize=thread" \
--copt="-fno-sanitize-blacklist" \
--copt=-Werror \
+ --distdir="/bazel-distdir" \
--keep_going \
--linkopt="-fsanitize=thread" \
--show_timestamps \
diff --git a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
index 0986ff40..36fdf82c 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
@@ -25,7 +25,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
fi
if [[ -z ${STD:-} ]]; then
- STD="c++11 c++14 c++17 c++20"
+ STD="c++11 c++14 c++17"
fi
if [[ -z ${COMPILATION_MODE:-} ]]; then
@@ -78,6 +78,7 @@ for std in ${STD}; do
--copt="${exceptions_mode}" \
--copt=-Werror \
--define="absl=1" \
+ --distdir="/bazel-distdir" \
--keep_going \
--linkopt="--gcc-toolchain=/usr/local" \
--show_timestamps \
diff --git a/grpc/third_party/abseil-cpp/ci/linux_docker_containers.sh b/grpc/third_party/abseil-cpp/ci/linux_docker_containers.sh
index 1c29d9a1..32865b83 100644
--- a/grpc/third_party/abseil-cpp/ci/linux_docker_containers.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_docker_containers.sh
@@ -16,6 +16,6 @@
# Test scripts should source this file to get the identifiers.
readonly LINUX_ALPINE_CONTAINER="gcr.io/google.com/absl-177019/alpine:20201026"
-readonly LINUX_CLANG_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20201008"
-readonly LINUX_GCC_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20201008"
-readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20201015"
+readonly LINUX_CLANG_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
+readonly LINUX_GCC_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
+readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20210617"
diff --git a/grpc/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh
index 224aef81..54ab68a3 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh
@@ -77,6 +77,7 @@ for std in ${STD}; do
--copt="${exceptions_mode}" \
--copt=-Werror \
--define="absl=1" \
+ --distdir="/bazel-distdir" \
--keep_going \
--show_timestamps \
--test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \
diff --git a/grpc/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh b/grpc/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
index 37d89d9f..0555eced 100755
--- a/grpc/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
@@ -83,6 +83,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \
--copt=-Werror \
--define=\"absl=1\" \
+ --distdir=\"/bazel-distdir\" \
--keep_going \
--show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \
diff --git a/grpc/third_party/abseil-cpp/ci/macos_xcode_bazel.sh b/grpc/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
index 738adf94..9e14e660 100755
--- a/grpc/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
+++ b/grpc/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
@@ -24,7 +24,7 @@ if [[ -z ${ABSEIL_ROOT:-} ]]; then
fi
# If we are running on Kokoro, check for a versioned Bazel binary.
-KOKORO_GFILE_BAZEL_BIN="bazel-2.0.0-darwin-x86_64"
+KOKORO_GFILE_BAZEL_BIN="bazel-3.7.0-darwin-x86_64"
if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then
BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
chmod +x ${BAZEL_BIN}
diff --git a/grpc/third_party/abseil-cpp/create_lts.py b/grpc/third_party/abseil-cpp/create_lts.py
index a98c76b4..56170806 100755
--- a/grpc/third_party/abseil-cpp/create_lts.py
+++ b/grpc/third_party/abseil-cpp/create_lts.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2021 The Abseil Authors.
#
@@ -96,6 +96,13 @@ def main(argv):
# Replacement directives go here.
ReplaceStringsInFile(
+ 'absl/base/config.h', {
+ '#undef ABSL_LTS_RELEASE_VERSION':
+ '#define ABSL_LTS_RELEASE_VERSION {}'.format(datestamp),
+ '#undef ABSL_LTS_RELEASE_PATCH_LEVEL':
+ '#define ABSL_LTS_RELEASE_PATCH_LEVEL 0'
+ })
+ ReplaceStringsInFile(
'absl/base/options.h', {
'#define ABSL_OPTION_USE_INLINE_NAMESPACE 0':
'#define ABSL_OPTION_USE_INLINE_NAMESPACE 1',
@@ -108,11 +115,16 @@ def main(argv):
'project(absl LANGUAGES CXX)':
'project(absl LANGUAGES CXX VERSION {})'.format(datestamp)
})
- # Set the SOVERSION to YYYYMMDD.0.0 - The first 0 means we only have
- # ABI compatible changes, and the second 0 means we can increment it
- # to mark changes as ABI-compatible, for patch releases.
- ReplaceStringsInFile('CMake/AbseilHelpers.cmake',
- {'SOVERSION 0': 'SOVERSION "{}.0.0"'.format(datestamp)})
+ # Set the SOVERSION to YYMM.0.0 - The first 0 means we only have ABI
+ # compatible changes, and the second 0 means we can increment it to
+ # mark changes as ABI-compatible, for patch releases. Note that we
+ # only use the last two digits of the year and the month because the
+ # MacOS linker requires the first part of the SOVERSION to fit into
+ # 16 bits.
+ # https://www.sicpers.info/2013/03/how-to-version-a-mach-o-library/
+ ReplaceStringsInFile(
+ 'CMake/AbseilHelpers.cmake',
+ {'SOVERSION 0': 'SOVERSION "{}.0.0"'.format(datestamp[2:6])})
StripContentBetweenTags('CMakeLists.txt', '# absl:lts-remove-begin',
'# absl:lts-remove-end')
diff --git a/grpc/third_party/address_sorting/address_sorting_posix.c b/grpc/third_party/address_sorting/address_sorting_posix.c
index d0dfe124..dd969559 100644
--- a/grpc/third_party/address_sorting/address_sorting_posix.c
+++ b/grpc/third_party/address_sorting/address_sorting_posix.c
@@ -54,6 +54,7 @@ static bool posix_source_addr_factory_get_source_addr(
address_sorting_source_addr_factory* factory,
const address_sorting_address* dest_addr,
address_sorting_address* source_addr) {
+ (void)factory;
bool source_addr_exists = false;
// Android sets SOCK_CLOEXEC. Don't set this here for portability.
int s = socket(((struct sockaddr*)dest_addr)->sa_family, SOCK_DGRAM, 0);
diff --git a/grpc/third_party/android/BUILD b/grpc/third_party/android/BUILD
new file mode 100644
index 00000000..12a7f707
--- /dev/null
+++ b/grpc/third_party/android/BUILD
@@ -0,0 +1,3 @@
+exports_files([
+ "android_configure.bzl",
+])
diff --git a/grpc/third_party/android/android_configure.bzl b/grpc/third_party/android/android_configure.bzl
new file mode 100644
index 00000000..40e7f105
--- /dev/null
+++ b/grpc/third_party/android/android_configure.bzl
@@ -0,0 +1,62 @@
+"""Repository rule for Android SDK and NDK autoconfiguration.
+
+This rule is a no-op unless the required android environment variables are set.
+"""
+
+# Based on https://github.com/tensorflow/tensorflow/tree/34c03ed67692eb76cb3399cebca50ea8bcde064c/third_party/android
+# Workaround for https://github.com/bazelbuild/bazel/issues/14260
+
+_ANDROID_NDK_HOME = "ANDROID_NDK_HOME"
+_ANDROID_SDK_HOME = "ANDROID_HOME"
+
+def _escape_for_windows(path):
+ """Properly escape backslashes for Windows.
+
+ Ideally, we would do this conditionally, but there is seemingly no way to
+ determine whether or not this is being called from Windows.
+ """
+ return path.replace("\\", "\\\\")
+
+def _android_autoconf_impl(repository_ctx):
+ sdk_home = repository_ctx.os.environ.get(_ANDROID_SDK_HOME)
+ ndk_home = repository_ctx.os.environ.get(_ANDROID_NDK_HOME)
+
+ # version 31.0.0 won't work https://stackoverflow.com/a/68036845
+ sdk_rule = ""
+ if sdk_home:
+ sdk_rule = """
+ native.android_sdk_repository(
+ name="androidsdk",
+ path="{}",
+ build_tools_version="30.0.3",
+ )
+""".format(_escape_for_windows(sdk_home))
+
+ # Note that Bazel does not support NDK 22 yet, and Bazel 3.7.1 only
+ # supports up to API level 29 for NDK 21
+ ndk_rule = ""
+ if ndk_home:
+ ndk_rule = """
+ native.android_ndk_repository(
+ name="androidndk",
+ path="{}",
+ )
+""".format(_escape_for_windows(ndk_home))
+
+ if ndk_rule == "" and sdk_rule == "":
+ sdk_rule = "pass"
+
+ repository_ctx.file("BUILD.bazel", "")
+ repository_ctx.file("android_configure.bzl", """
+def android_workspace():
+ {}
+ {}
+ """.format(sdk_rule, ndk_rule))
+
+android_configure = repository_rule(
+ implementation = _android_autoconf_impl,
+ environ = [
+ _ANDROID_NDK_HOME,
+ _ANDROID_SDK_HOME,
+ ],
+)
diff --git a/grpc/third_party/cares/cares.BUILD b/grpc/third_party/cares/cares.BUILD
index 7939021a..43e8ac7b 100644
--- a/grpc/third_party/cares/cares.BUILD
+++ b/grpc/third_party/cares/cares.BUILD
@@ -121,86 +121,91 @@ copy_file(
cc_library(
name = "ares",
srcs = [
- "ares__close_sockets.c",
- "ares__get_hostent.c",
- "ares__read_line.c",
- "ares__timeval.c",
- "ares_android.c",
- "ares_cancel.c",
- "ares_create_query.c",
- "ares_data.c",
- "ares_destroy.c",
- "ares_expand_name.c",
- "ares_expand_string.c",
- "ares_fds.c",
- "ares_free_hostent.c",
- "ares_free_string.c",
- "ares_getenv.c",
- "ares_gethostbyaddr.c",
- "ares_gethostbyname.c",
- "ares_getnameinfo.c",
- "ares_getopt.c",
- "ares_getsock.c",
- "ares_init.c",
- "ares_library_init.c",
- "ares_llist.c",
- "ares_mkquery.c",
- "ares_nowarn.c",
- "ares_options.c",
- "ares_parse_a_reply.c",
- "ares_parse_aaaa_reply.c",
- "ares_parse_mx_reply.c",
- "ares_parse_naptr_reply.c",
- "ares_parse_ns_reply.c",
- "ares_parse_ptr_reply.c",
- "ares_parse_soa_reply.c",
- "ares_parse_srv_reply.c",
- "ares_parse_txt_reply.c",
- "ares_platform.c",
- "ares_process.c",
- "ares_query.c",
- "ares_search.c",
- "ares_send.c",
- "ares_strcasecmp.c",
- "ares_strdup.c",
- "ares_strsplit.c",
- "ares_strerror.c",
- "ares_timeout.c",
- "ares_version.c",
- "ares_writev.c",
- "bitncmp.c",
- "inet_net_pton.c",
- "inet_ntop.c",
- "windows_port.c",
+ "src/lib/ares_init.c",
+ "src/lib/ares_expand_string.c",
+ "src/lib/ares_strcasecmp.c",
+ "src/lib/ares_destroy.c",
+ "src/lib/ares_free_string.c",
+ "src/lib/ares__timeval.c",
+ "src/lib/ares_library_init.c",
+ "src/lib/ares_getsock.c",
+ "src/lib/ares_process.c",
+ "src/lib/ares_create_query.c",
+ "src/lib/ares_fds.c",
+ "src/lib/ares_gethostbyname.c",
+ "src/lib/ares_mkquery.c",
+ "src/lib/ares_freeaddrinfo.c",
+ "src/lib/ares_strdup.c",
+ "src/lib/ares_timeout.c",
+ "src/lib/ares_getnameinfo.c",
+ "src/lib/ares_parse_soa_reply.c",
+ "src/lib/ares_parse_naptr_reply.c",
+ "src/lib/ares_parse_a_reply.c",
+ "src/lib/ares_send.c",
+ "src/lib/ares_nowarn.c",
+ "src/lib/ares__sortaddrinfo.c",
+ "src/lib/ares_android.c",
+ "src/lib/ares_strerror.c",
+ "src/lib/ares_parse_caa_reply.c",
+ "src/lib/ares__close_sockets.c",
+ "src/lib/ares_llist.c",
+ "src/lib/ares_parse_aaaa_reply.c",
+ "src/lib/ares_getaddrinfo.c",
+ "src/lib/ares_parse_ns_reply.c",
+ "src/lib/windows_port.c",
+ "src/lib/bitncmp.c",
+ "src/lib/ares_strsplit.c",
+ "src/lib/ares_data.c",
+ "src/lib/ares_free_hostent.c",
+ "src/lib/ares_platform.c",
+ "src/lib/ares_parse_txt_reply.c",
+ "src/lib/ares__parse_into_addrinfo.c",
+ "src/lib/ares_gethostbyaddr.c",
+ "src/lib/ares_parse_srv_reply.c",
+ "src/lib/ares_version.c",
+ "src/lib/ares_getenv.c",
+ "src/lib/ares_search.c",
+ "src/lib/ares_parse_mx_reply.c",
+ "src/lib/ares__get_hostent.c",
+ "src/lib/ares__readaddrinfo.c",
+ "src/lib/ares_parse_ptr_reply.c",
+ "src/lib/ares__read_line.c",
+ "src/lib/ares_query.c",
+ "src/lib/ares_options.c",
+ "src/lib/inet_net_pton.c",
+ "src/lib/ares_expand_name.c",
+ "src/lib/inet_ntop.c",
+ "src/lib/ares_cancel.c",
+ "src/lib/ares_writev.c",
],
hdrs = [
- "ares.h",
- "ares_android.h",
"ares_build.h",
"ares_config.h",
- "ares_data.h",
- "ares_dns.h",
- "ares_getenv.h",
- "ares_getopt.h",
- "ares_inet_net_pton.h",
- "ares_iphlpapi.h",
- "ares_ipv6.h",
- "ares_library_init.h",
- "ares_llist.h",
- "ares_nowarn.h",
- "ares_platform.h",
- "ares_private.h",
- "ares_rules.h",
- "ares_setup.h",
- "ares_strcasecmp.h",
- "ares_strdup.h",
- "ares_strsplit.h",
- "ares_version.h",
- "ares_writev.h",
- "bitncmp.h",
- "config-win32.h",
- "nameser.h",
- "setup_once.h",
+ "include/ares_version.h",
+ "include/ares.h",
+ "include/ares_rules.h",
+ "include/ares_dns.h",
+ "src/lib/ares_data.h",
+ "src/lib/ares_strsplit.h",
+ "src/lib/bitncmp.h",
+ "src/lib/ares_iphlpapi.h",
+ "src/lib/ares_inet_net_pton.h",
+ "src/lib/ares_getenv.h",
+ "src/lib/ares_platform.h",
+ "src/lib/ares_writev.h",
+ "src/lib/ares_private.h",
+ "src/lib/ares_setup.h",
+ "src/lib/config-win32.h",
+ "src/lib/ares_strcasecmp.h",
+ "src/lib/setup_once.h",
+ "src/lib/ares_ipv6.h",
+ "src/lib/ares_library_init.h",
+ "src/lib/ares_nameser.h",
+ "src/lib/ares_strdup.h",
+ "src/lib/config-dos.h",
+ "src/lib/ares_llist.h",
+ "src/lib/ares_nowarn.h",
+ "src/lib/ares_android.h",
],
copts = [
"-D_GNU_SOURCE",
@@ -216,7 +221,7 @@ cc_library(
"//conditions:default": [],
}),
defines = ["CARES_STATICLIB"],
- includes = ["."],
+ includes = ["include", "."],
linkopts = select({
":windows": ["-defaultlib:ws2_32.lib"],
"//conditions:default": [],
diff --git a/grpc/third_party/cares/cares/.travis.yml b/grpc/third_party/cares/cares/.travis.yml
index ce94743f..426a21f9 100644
--- a/grpc/third_party/cares/cares/.travis.yml
+++ b/grpc/third_party/cares/cares/.travis.yml
@@ -1,17 +1,14 @@
language: c++
-dist: trusty
+dist: bionic
sudo: false
addons:
apt:
- sources:
- - ubuntu-toolchain-r-test
- - llvm-toolchain-trusty-5.0
packages:
- - cmake3
+ - cmake
- lcov
- - clang-5.0
- - clang-tools-5.0
+ - clang-tools-7
- valgrind
+
matrix:
include:
- os: linux
@@ -35,37 +32,44 @@ matrix:
- os: linux
compiler: clang
env: BUILD_TYPE=asan
- sudo: true # ASAN requires ptrace which is disabled in containers (https://github.com/travis-ci/travis-ci/issues/9033)
- os: linux
compiler: clang
env: BUILD_TYPE=lsan
- sudo: true # LSAN requires ptrace which is disabled in containers (https://github.com/travis-ci/travis-ci/issues/9033)
- os: linux
compiler: clang
- env: BUILD_TYPE=analyse
+ env: BUILD_TYPE=analyze
- os: linux
compiler: gcc
env: BUILD_TYPE=valgrind
- os: osx
+ osx_image: xcode11.4
compiler: gcc
env: BUILD_TYPE=normal
- os: osx
+ osx_image: xcode11.4
compiler: clang
env: BUILD_TYPE=normal
- os: osx
+ osx_image: xcode11.4
compiler: clang
env: BUILD_TYPE=cmake
- os: osx
+ osx_image: xcode11.4
compiler: clang
language: objective-c
env: BUILD_TYPE=ios
+ - os: osx
+ osx_image: xcode11.4
+ compiler: clang
+ language: objective-c
+ env: BUILD_TYPE=ios-cmake
install:
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then pip install --user cpp-coveralls > /dev/null; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi
before_script:
- |
if [ "$BUILD_TYPE" = "coverage" ]; then
- export CONFIG_OPTS="--enable-debug --disable-shared --enable-code-coverage"
+ export CONFIG_OPTS="--enable-debug --disable-shared --enable-code-coverage --enable-tests"
fi
- |
if [ "$BUILD_TYPE" = "asan" ]; then
@@ -87,27 +91,36 @@ before_script:
export LDFLAGS="-fsanitize=undefined"
fi
- |
- if [ "$BUILD_TYPE" = "analyse" ]; then
- export SCAN_WRAP="scan-build-5.0 --status-bugs"
- export CONFIG_OPTS="--enable-debug"
- export CXX="clang++-5.0"
- export CC="clang-5.0"
+ if [ "$BUILD_TYPE" = "analyze" ]; then
+ export SCAN_WRAP="scan-build-7 --status-bugs"
+ export CONFIG_OPTS="--enable-debug --disable-tests"
+ export CXX="clang++-7"
+ export CC="clang-7"
fi
- |
if [ "$BUILD_TYPE" = "valgrind" ]; then
- export TEST_WRAP='libtool --mode=execute valgrind --leak-check=full'
+ export TEST_WRAP='valgrind --leak-check=full'
# Skip container tests as valgrind doesn't cope with clone()
- export TEST_FILTER="--gtest_filter=-*Container*"
+ export TEST_FILTER="--gtest_filter=-*Container*:-*LiveSearchANY*"
fi
- |
if [ "$BUILD_TYPE" = "ios" ]; then
- export CONFIG_OPTS=--host=arm-apple-darwin10
+ export CONFIG_OPTS="--host=arm-apple-darwin10 --disable-tests"
export DEVPATH=`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer
export IOSFLAGS="-isysroot $DEVPATH/SDKs/iPhoneOS.sdk -arch armv7 -miphoneos-version-min=8.0.0"
export CFLAGS=$IOSFLAGS
export CXXFLAGS=$IOSFLAGS
export LDFLAGS=$IOSFLAGS
fi
+ - |
+ if [ "$BUILD_TYPE" = "ios-cmake" ]; then
+ export SYSROOT="$(xcode-select -print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/"
+ export IOSFLAGS="-miphoneos-version-min=10.0"
+ export ARCHITECTURES="armv7;armv7s;arm64"
+ export CFLAGS=$IOSFLAGS
+ export CXXFLAGS=$IOSFLAGS
+ export LDFLAGS=$IOSFLAGS
+ fi
script:
- ./travis/build.sh && ./travis/test.sh
- if [ "$BUILD_TYPE" = "normal" ]; then ./travis/distcheck.sh ; fi
diff --git a/grpc/third_party/cares/cares/CMakeLists.txt b/grpc/third_party/cares/cares/CMakeLists.txt
index dd028abe..3f42d145 100644
--- a/grpc/third_party/cares/cares/CMakeLists.txt
+++ b/grpc/third_party/cares/cares/CMakeLists.txt
@@ -7,12 +7,13 @@ INCLUDE (CheckSymbolExists)
INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)
-INCLUDE (GNUInstallDirs)
-PROJECT (c-ares C)
+PROJECT (c-ares LANGUAGES C VERSION "1.17.2" )
# Set this version before release
-SET (CARES_VERSION "1.15.0")
+SET (CARES_VERSION "${PROJECT_VERSION}")
+
+INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are wrong.
# This is for libtool compatibility, and specified in a form that is easily
# translatable from libtool (even if the actual form doesn't make sense).
@@ -25,7 +26,7 @@ SET (CARES_VERSION "1.15.0")
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
-SET (CARES_LIB_VERSIONINFO "5:0:3")
+SET (CARES_LIB_VERSIONINFO "6:3:4")
OPTION (CARES_STATIC "Build as a static library" OFF)
@@ -33,8 +34,16 @@ OPTION (CARES_SHARED "Build as a shared library"
OPTION (CARES_INSTALL "Create installation targets (chain builders may want to disable this)" ON)
OPTION (CARES_STATIC_PIC "Build the static library as PIC (position independent)" OFF)
OPTION (CARES_BUILD_TESTS "Build and run tests" OFF)
+OPTION (CARES_BUILD_CONTAINER_TESTS "Build and run container tests (implies CARES_BUILD_TESTS, Linux only)" OFF)
OPTION (CARES_BUILD_TOOLS "Build tools" ON)
+# Tests require static to be enabled on Windows to be able to access otherwise hidden symbols
+IF (CARES_BUILD_TESTS AND (NOT CARES_STATIC) AND WIN32)
+ SET (CARES_STATIC ON)
+ SET (CARES_STATIC_PIC ON)
+ MESSAGE (WARNING "Static building was requested be disabled, but reenabled to support tests")
+ENDIF ()
+
# allow linking against the static runtime library in msvc
IF (MSVC)
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)
@@ -58,21 +67,33 @@ IF (MSVC)
ENDIF ()
# Keep build organized.
-SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
-SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
-SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
+SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
+SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
+SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
SET (PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package)
# Destinations for installing different kinds of targets (pass to install command).
SET (TARGETS_INST_DEST
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
+# Function in Library
+# CHECK_LIBRARY_EXISTS can't be used as it will return true if the function
+# is found in a different dependent library.
+MACRO (CARES_FUNCTION_IN_LIBRARY func lib var)
+ CHECK_FUNCTION_EXISTS ("${func}" "_CARES_FUNC_IN_LIB_GLOBAL_${func}")
+ IF ("${_CARES_FUNC_IN_LIB_GLOBAL_${func}}")
+ SET (${var} FALSE)
+ ELSE ()
+ CHECK_LIBRARY_EXISTS ("${lib}" "${func}" "" ${var})
+ ENDIF ()
+ENDMACRO ()
+
# Look for dependent/required libraries
-CHECK_LIBRARY_EXISTS (resolv res_servicename "" HAVE_RES_SERVICENAME_IN_LIBRESOLV)
+CARES_FUNCTION_IN_LIBRARY (res_servicename resolv HAVE_RES_SERVICENAME_IN_LIBRESOLV)
IF (HAVE_RES_SERVICENAME_IN_LIBRESOLV)
SET (HAVE_LIBRESOLV 1)
ENDIF ()
@@ -118,17 +139,18 @@ return 0;
MACOS_V1012)
ENDIF ()
-IF (IOS AND HAVE_LIBRESOLV)
+IF ((IOS OR APPLE OR ZOS) AND HAVE_LIBRESOLV)
SET (CARES_USE_LIBRESOLV 1)
ENDIF()
-CHECK_LIBRARY_EXISTS (nsl gethostbyname "" HAVE_LIBNSL)
-CHECK_LIBRARY_EXISTS (socket gethostbyname "" HAVE_GHBN_LIBSOCKET)
-CHECK_LIBRARY_EXISTS (socket socket "" HAVE_SOCKET_LIBSOCKET)
+
+CARES_FUNCTION_IN_LIBRARY (gethostbyname nsl HAVE_LIBNSL)
+CARES_FUNCTION_IN_LIBRARY (gethostbyname socket HAVE_GHBN_LIBSOCKET)
+CARES_FUNCTION_IN_LIBRARY (socket socket HAVE_SOCKET_LIBSOCKET)
IF (HAVE_GHBN_LIBSOCKET OR HAVE_SOCKET_LIBSOCKET)
SET(HAVE_LIBSOCKET TRUE)
ENDIF ()
-CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
+CARES_FUNCTION_IN_LIBRARY (clock_gettime rt HAVE_LIBRT)
# Look for necessary includes
@@ -146,7 +168,6 @@ CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
-CHECK_INCLUDE_FILES (netinet/tcp.h HAVE_NETINET_TCP_H)
CHECK_INCLUDE_FILES (net/if.h HAVE_NET_IF_H)
CHECK_INCLUDE_FILES (signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILES (socket.h HAVE_SOCKET_H)
@@ -159,15 +180,20 @@ CHECK_INCLUDE_FILES (stropts.h HAVE_STROPTS_H)
CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H)
-CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES (sys/uio.h HAVE_SYS_UIO_H)
CHECK_INCLUDE_FILES (time.h HAVE_TIME_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
+# On OpenBSD, you must include sys/types.h before netinet/tcp.h
+IF (HAVE_SYS_TYPES_H)
+ CHECK_INCLUDE_FILES ("sys/types.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
+ELSE ()
+ CHECK_INCLUDE_FILES (netinet/tcp.h HAVE_NETINET_TCP_H)
+ENDIF ()
+
# Include order matters for these windows files.
CHECK_INCLUDE_FILES ("winsock2.h;windows.h" HAVE_WINSOCK2_H)
CHECK_INCLUDE_FILES ("winsock2.h;ws2tcpip.h;windows.h" HAVE_WS2TCPIP_H)
@@ -207,7 +233,7 @@ IF (HAVE_LIBRT)
LIST (APPEND CARES_DEPENDENT_LIBS rt)
ENDIF ()
IF (WIN32)
- LIST (APPEND CARES_DEPENDENT_LIBS ws2_32)
+ LIST (APPEND CARES_DEPENDENT_LIBS ws2_32 Advapi32)
ENDIF ()
@@ -323,6 +349,7 @@ CHECK_SYMBOL_EXISTS (gethostbyname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOST
CHECK_SYMBOL_EXISTS (gethostname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETHOSTNAME)
CHECK_SYMBOL_EXISTS (getnameinfo "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETNAMEINFO)
CHECK_SYMBOL_EXISTS (getservbyport_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERVBYPORT_R)
+CHECK_SYMBOL_EXISTS (getservbyname_r "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETSERVBYNAME_R)
CHECK_SYMBOL_EXISTS (gettimeofday "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_GETTIMEOFDAY)
CHECK_SYMBOL_EXISTS (if_indextoname "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_IF_INDEXTONAME)
CHECK_SYMBOL_EXISTS (inet_net_pton "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_INET_NET_PTON)
@@ -360,6 +387,10 @@ SET (CMAKE_REQUIRED_DEFINITIONS)
SET (CMAKE_REQUIRED_LIBRARIES)
+find_file(CARES_RANDOM_FILE urandom /dev)
+mark_as_advanced(CARES_RANDOM_FILE)
+
+
################################################################################
# recv, recvfrom, send, getnameinfo, gethostname
# ARGUMENTS AND RETURN VALUES
@@ -397,10 +428,17 @@ ELSE ()
SET (GETNAMEINFO_TYPE_ARG46 int)
ENDIF ()
+IF (WIN32)
+ SET (RECV_TYPE_ARG2 "char *")
+ELSE ()
+ SET (RECV_TYPE_ARG2 "void *")
+ENDIF ()
+
# Functions are typically consistent so the equivalent fields map ... equivalently
SET (RECV_TYPE_RETV ${RECVFROM_TYPE_RETV})
SET (SEND_TYPE_RETV ${RECVFROM_TYPE_RETV})
SET (RECV_TYPE_ARG1 ${RECVFROM_TYPE_ARG1})
+SET (RECVFROM_TYPE_ARG2 ${RECV_TYPE_ARG2})
SET (SEND_TYPE_ARG1 ${RECVFROM_TYPE_ARG1})
SET (RECV_TYPE_ARG3 ${RECVFROM_TYPE_ARG3})
SET (SEND_TYPE_ARG3 ${RECVFROM_TYPE_ARG3})
@@ -408,10 +446,8 @@ SET (GETHOSTNAME_TYPE_ARG2 ${RECVFROM_TYPE_ARG3})
# These should always be "sane" values to use always
SET (RECVFROM_QUAL_ARG5 )
-SET (RECVFROM_TYPE_ARG2 "void *")
SET (RECVFROM_TYPE_ARG4 int)
SET (RECVFROM_TYPE_ARG5 "struct sockaddr *")
-SET (RECV_TYPE_ARG2 "void *")
SET (RECV_TYPE_ARG4 int)
SET (GETNAMEINFO_TYPE_ARG1 "struct sockaddr *")
SET (GETNAMEINFO_TYPE_ARG7 int)
@@ -492,6 +528,19 @@ IF (HAVE_GETSERVBYPORT_R)
ENDIF ()
ENDIF ()
+IF (HAVE_GETSERVBYNAME_R)
+ # TODO : Should probably autodetect
+ IF (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+ SET (GETSERVBYNAME_R_ARGS 5)
+ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
+ CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+ SET (GETSERVBYNAME_R_ARGS 4)
+ ELSE ()
+ # Probably linux
+ SET (GETSERVBYNAME_R_ARGS 6)
+ ENDIF ()
+ENDIF ()
+
# Set some aliases used for ares_build.h
IF (HAVE_SYS_TYPES_H)
SET (CARES_HAVE_SYS_TYPES_H 1)
@@ -509,11 +558,8 @@ IF (HAVE_WINDOWS_H)
SET (CARES_HAVE_WINDOWS_H 1)
ENDIF()
-# Write ares_build.h configuration file. This is an installed file.
-CONFIGURE_FILE (ares_build.h.cmake ${PROJECT_BINARY_DIR}/ares_build.h)
-
-# Write ares_config.h configuration file. This is used only for the build.
-CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
+# Record toplevel CMakeLists.txt path
+set(CARES_TOPLEVEL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
# TRANSFORM_MAKEFILE_INC
@@ -547,99 +593,21 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
endfunction()
-# run the function...
-transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/Makefile.inc.cmake")
-include(${PROJECT_BINARY_DIR}/Makefile.inc.cmake)
-
-
-# Build the dynamic/shared library
-IF (CARES_SHARED)
- ADD_LIBRARY (${PROJECT_NAME} SHARED ${CSOURCES})
-
- # Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION
- # Convert from ":" separated into CMake list format using ";"
- STRING (REPLACE ":" ";" CARES_LIB_VERSIONINFO ${CARES_LIB_VERSIONINFO})
- LIST (GET CARES_LIB_VERSIONINFO 0 CARES_LIB_VERSION_CURRENT)
- LIST (GET CARES_LIB_VERSIONINFO 1 CARES_LIB_VERSION_REVISION)
- LIST (GET CARES_LIB_VERSIONINFO 2 CARES_LIB_VERSION_AGE)
- MATH (EXPR CARES_LIB_VERSION_MAJOR "${CARES_LIB_VERSION_CURRENT} - ${CARES_LIB_VERSION_AGE}")
- SET (CARES_LIB_VERSION_MINOR "${CARES_LIB_VERSION_AGE}")
- SET (CARES_LIB_VERSION_RELEASE "${CARES_LIB_VERSION_REVISION}")
-
- SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES
- EXPORT_NAME cares
- OUTPUT_NAME cares
- VERSION "${CARES_LIB_VERSION_MAJOR}.${CARES_LIB_VERSION_MINOR}.${CARES_LIB_VERSION_RELEASE}"
- SOVERSION "${CARES_LIB_VERSION_MAJOR}"
- )
+# Directory for includes
+ADD_SUBDIRECTORY (include)
- TARGET_INCLUDE_DIRECTORIES (${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>")
- TARGET_INCLUDE_DIRECTORIES (${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>")
+# Directory for lib and tools
+ADD_SUBDIRECTORY (src)
- TARGET_COMPILE_DEFINITIONS (${PROJECT_NAME} PRIVATE HAVE_CONFIG_H=1 CARES_BUILDING_LIBRARY)
+# Docs
+ADD_SUBDIRECTORY (docs)
- TARGET_LINK_LIBRARIES (${PROJECT_NAME} PUBLIC ${CARES_DEPENDENT_LIBS})
-
- IF (CARES_INSTALL)
- INSTALL (TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets
- ${TARGETS_INST_DEST}
- )
- ENDIF ()
- SET (STATIC_SUFFIX "_static")
-
- # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares).
- ADD_LIBRARY (${PROJECT_NAME}::cares_shared ALIAS ${PROJECT_NAME})
- ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${PROJECT_NAME})
-ENDIF ()
-
-# Build the static library
-IF (CARES_STATIC)
- SET (LIBNAME ${PROJECT_NAME}${STATIC_SUFFIX})
-
- ADD_LIBRARY (${LIBNAME} STATIC ${CSOURCES})
-
- SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES
- EXPORT_NAME cares${STATIC_SUFFIX}
- OUTPUT_NAME cares${STATIC_SUFFIX}
- )
-
- IF (CARES_STATIC_PIC)
- SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES POSITION_INDEPENDENT_CODE True)
- ENDIF ()
-
- TARGET_INCLUDE_DIRECTORIES (${LIBNAME} PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>")
- TARGET_INCLUDE_DIRECTORIES (${LIBNAME} PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>")
-
- TARGET_COMPILE_DEFINITIONS (${LIBNAME}
- PUBLIC CARES_STATICLIB
- PRIVATE HAVE_CONFIG_H=1
- )
-
- TARGET_LINK_LIBRARIES (${LIBNAME} PUBLIC ${CARES_DEPENDENT_LIBS})
- IF (CARES_INSTALL)
- INSTALL (TARGETS ${LIBNAME} EXPORT ${PROJECT_NAME}-targets
- ${TARGETS_INST_DEST}
- )
- ENDIF ()
-
- # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares).
- ADD_LIBRARY (${PROJECT_NAME}::cares_static ALIAS ${LIBNAME})
- IF (NOT TARGET ${PROJECT_NAME}::cares)
- # Only use static for the generic alias if shared lib wasn't built.
- ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${LIBNAME})
- ENDIF ()
-ENDIF ()
-
-IF (CARES_BUILD_TESTS)
+# Tests
+IF (CARES_BUILD_TESTS OR CARES_BUILD_CONTAINER_TESTS)
ENABLE_TESTING ()
ADD_SUBDIRECTORY (test)
ENDIF ()
-# Headers installation target
-IF (CARES_INSTALL)
- SET (CARES_HEADERS ares.h ares_version.h ares_dns.h "${PROJECT_BINARY_DIR}/ares_build.h" ares_rules.h)
- INSTALL (FILES ${CARES_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-ENDIF ()
# Export targets
IF (CARES_INSTALL)
@@ -650,8 +618,10 @@ IF (CARES_INSTALL)
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
- INSTALL (EXPORT ${PROJECT_NAME}-targets DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAMESPACE ${PROJECT_NAME}::)
- INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" DESTINATION ${CMAKECONFIG_INSTALL_DIR})
+
+ WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_NAME}-config-version.cmake VERSION "${CARES_VERSION}" COMPATIBILITY SameMajorVersion)
+ INSTALL (EXPORT ${PROJECT_NAME}-targets COMPONENT Devel DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAMESPACE ${PROJECT_NAME}::)
+ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" COMPONENT Devel DESTINATION ${CMAKECONFIG_INSTALL_DIR})
# pkgconfig support
IF (NOT CARES_SHARED)
@@ -661,38 +631,118 @@ IF (CARES_INSTALL)
ENDFOREACH ()
ENDIF ()
CONFIGURE_FILE("libcares.pc.cmake" "libcares.pc" @ONLY)
- INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
ENDIF ()
+
# Legacy chain-building variables (provided for compatibility with old code).
# Don't use these, external code should be updated to refer to the aliases directly (e.g., Cares::cares).
SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND")
SET (CARES_LIBRARIES ${PROJECT_NAME}::cares CACHE INTERNAL "CARES LIBRARIES")
-IF (CARES_BUILD_TOOLS)
- # Build ahost
- ADD_EXECUTABLE (ahost ahost.c ${SAMPLESOURCES})
- TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1)
- TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME})
- IF (CARES_INSTALL)
- INSTALL (TARGETS ahost ${TARGETS_INST_DEST})
- ENDIF ()
-
-
- # Build adig
- ADD_EXECUTABLE (adig adig.c ${SAMPLESOURCES})
- TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1)
- TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME})
- IF (CARES_INSTALL)
- INSTALL (TARGETS adig ${TARGETS_INST_DEST})
- ENDIF ()
-
- # Build acountry
- ADD_EXECUTABLE (acountry acountry.c ${SAMPLESOURCES})
- TARGET_COMPILE_DEFINITIONS (acountry PRIVATE HAVE_CONFIG_H=1)
- TARGET_LINK_LIBRARIES (acountry PRIVATE ${PROJECT_NAME})
- IF (CARES_INSTALL)
- INSTALL (TARGETS acountry ${TARGETS_INST_DEST})
- ENDIF ()
+IF (CARES_INSTALL)
+ # Package creation
+ set( CPACK_PACKAGE_NAME ${PROJECT_NAME} )
+ set( CPACK_PACKAGE_VENDOR "Daniel Stenberg" ) # Github project owner
+ set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A C library for asynchronous DNS requests" )
+ set( CPACK_PACKAGE_HOMEPAGE_URL "https://c-ares.haxx.se/" )
+ set( CPACK_PACKAGE_CONTACT "https://c-ares.haxx.se/" )
+ set( CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} )
+ set( CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR} )
+ set( CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH} )
+ set( CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} )
+ set( CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME} )
+ set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" )
+ set( CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md" )
+
+ set( CPACK_COMPONENT_Library_DISPLAY_NAME "c-ares Library" )
+ set( CPACK_COMPONENT_Library_DESCRIPTION "The c-ares binary library." )
+ set( CPACK_COMPONENT_Library_REQUIRED 1 )
+ set( CPACK_COMPONENT_Devel_DISPLAY_NAME "c-ares Development Files" )
+ set( CPACK_COMPONENT_Devel_DESCRIPTION "Development files for compiling against c-ares." )
+ set( CPACK_COMPONENT_Devel_REQUIRED 0 )
+ IF (CARES_BUILD_TOOLS)
+ set( CPACK_COMPONENT_Tools_DISPLAY_NAME "c-ares Tools" )
+ set( CPACK_COMPONENT_Tools_DESCRIPTION "Tools for using c-ares." )
+ set( CPACK_COMPONENT_Tools_REQUIRED 0 )
+ ENDIF ()
+
+ if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
+
+ if ( "${CPACK_PACKAGE_ARCHITECTURE}" STREQUAL "" )
+ # Note: the architecture should default to the local architecture, but it
+ # in fact comes up empty. We call `uname -m` to ask the kernel instead.
+ EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE )
+ endif()
+
+ set( CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1 )
+ set( CPACK_PACKAGE_RELEASE 1 )
+
+
+ # RPM - https://cmake.org/cmake/help/latest/cpack_gen/rpm.html
+ set( CPACK_RPM_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} )
+ set( CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE} )
+ set( CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} )
+ set( CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_HOMEPAGE_URL} )
+ set( CPACK_RPM_PACKAGE_LICENSE "MIT" )
+ set( CPACK_RPM_COMPONENT_INSTALL 1 )
+ set( CPACK_RPM_COMPRESSION_TYPE "xz" )
+ set( CPACK_RPM_PACKAGE_AUTOPROV 1 )
+
+ set( CPACK_RPM_Library_PACKAGE_SUMMARY ${CPACK_COMPONENT_Library_DESCRIPTION} )
+ set( CPACK_RPM_Library_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} )
+ set( CPACK_RPM_Library_PACKAGE_NAME "libcares${CARES_LIB_VERSION_MAJOR}" )
+ set( CPACK_RPM_Library_FILE_NAME "RPM-DEFAULT" )
+
+ set( CPACK_RPM_Devel_PACKAGE_REQUIRES "cmake >= ${CMAKE_MINIMUM_REQUIRED_VERSION}, ${CPACK_RPM_Library_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" )
+ set( CPACK_RPM_Devel_PACKAGE_SUMMARY ${CPACK_COMPONENT_Devel_DESCRIPTION} )
+ set( CPACK_RPM_Devel_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} )
+ set( CPACK_RPM_Devel_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-devel" )
+ set( CPACK_RPM_Devel_FILE_NAME "RPM-DEFAULT" )
+
+ IF (CARES_BUILD_TOOLS)
+ set( CPACK_RPM_Tools_PACKAGE_REQUIRES "${CPACK_RPM_Library_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" )
+ set( CPACK_RPM_Tools_PACKAGE_SUMMARY ${CPACK_COMPONENT_Tools_DESCRIPTION} )
+ set( CPACK_RPM_Tools_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE} )
+ set( CPACK_RPM_Tools_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tools" )
+ set( CPACK_RPM_Tools_FILE_NAME "RPM-DEFAULT" )
+ ENDIF ()
+
+
+ # DEB - https://cmake.org/cmake/help/latest/cpack_gen/deb.html
+ set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} )
+ set( CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE_URL} )
+ set( CPACK_DEB_COMPONENT_INSTALL 1 )
+ set( CPACK_DEBIAN_COMPRESSION_TYPE "xz")
+ set( CPACK_DEBIAN_PACKAGE_SHLIBDEPS 1 )
+
+ if ( ${CPACK_PACKAGE_ARCHITECTURE} STREQUAL "x86_64" )
+ set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64" ) # DEB doesn't always use the kernel's arch name
+ else()
+ set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CPACK_PACKAGE_ARCHITECTURE} )
+ endif()
+
+ set( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" ) # Use default naming scheme
+
+ set( CPACK_DEBIAN_LIBRARY_PACKAGE_NAME ${CPACK_RPM_Library_PACKAGE_NAME} )
+
+ set( CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "cmake (>= ${CMAKE_MINIMUM_REQUIRED_VERSION}), ${CPACK_DEBIAN_LIBRARY_PACKAGE_NAME} (>= ${CPACK_PACKAGE_VERSION})" )
+ set( CPACK_DEBIAN_DEVEL_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dev" )
+
+ IF (CARES_BUILD_TOOLS)
+ set( CPACK_DEBIAN_TOOLS_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tools" )
+ set( CPACK_DEBIAN_TOOLS_PACKAGE_SHLIBDEPS OFF ) # dpkg-shlibdeps can't find the libs we built
+ set( CPACK_DEBIAN_TOOLS_PACKAGE_DEPENDS "${CPACK_DEBIAN_LIBRARY_PACKAGE_NAME} (>= ${CPACK_PACKAGE_VERSION})" )
+ ENDIF ()
+
+ elseif( ${CMAKE_HOST_WIN32} )
+ set( CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON )
+ set( CPACK_NSIS_DISPLAY_NAME ${PROJECT_NAME} )
+ set( CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME} )
+ set( CPACK_NSIS_URL_INFO_ABOUT ${CPACK_PACKAGE_HOMEPAGE_URL} )
+ endif()
+
+ # This must always be last!
+ include( CPack )
ENDIF ()
diff --git a/grpc/third_party/cares/cares/INSTALL.md b/grpc/third_party/cares/cares/INSTALL.md
index cbf1fc8f..f042cdc9 100644
--- a/grpc/third_party/cares/cares/INSTALL.md
+++ b/grpc/third_party/cares/cares/INSTALL.md
@@ -39,7 +39,6 @@ unpacked the source archive):
./configure
make
- make ahost adig acountry (optional)
make install
You probably need to be root when doing the last command.
@@ -334,11 +333,6 @@ provided that you installed Visual C/C++ 6 in the default directory.
Further details in [README.msvc](README.msvc)
-### MSVC IDEs
-
-Details in [README.msvc](README.msvc)
-
-
### Important static c-ares usage note
When building an application that uses the static c-ares library, you must
diff --git a/grpc/third_party/cares/cares/Makefile.am b/grpc/third_party/cares/cares/Makefile.am
index 55330565..eef3d3d1 100644
--- a/grpc/third_party/cares/cares/Makefile.am
+++ b/grpc/third_party/cares/cares/Makefile.am
@@ -1,209 +1,31 @@
-AUTOMAKE_OPTIONS = foreign nostdinc
+AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6
+ACLOCAL_AMFLAGS = -I m4 --install
-ACLOCAL_AMFLAGS = -I m4
-
-# Specify our include paths here, and do it relative to $(top_srcdir) and
-# $(top_builddir), to ensure that these paths which belong to the library
-# being currently built and tested are searched before the library which
-# might possibly already be installed in the system.
-#
-# When using the low-level hard-hacking memory leak tracking code from
-# libcurl the generated curl/curlbuild.h file must also be reachable.
-# Using the libcurl lowlevel code from within c-ares library is ugly and
-# only works when c-ares is built and linked with a similarly debug-build
-# libcurl, but we do this anyway for convenience.
-#
-# $(top_builddir)/../include/curl for generated curlbuild.h included from curl.h
-# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
-# $(top_srcdir)/../include is for libcurl's external include files
-# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
-# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
-# $(top_builddir) is for c-ares's generated ares_config.h file
-# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
-
-if CURLDEBUG
-AM_CPPFLAGS = -I$(top_builddir)/../include/curl \
- -I$(top_builddir)/../include \
- -I$(top_srcdir)/../include \
- -I$(top_builddir)/../lib \
- -I$(top_srcdir)/../lib \
- -I$(top_builddir) \
- -I$(top_srcdir)
-else
-AM_CPPFLAGS = -I$(top_builddir) \
- -I$(top_srcdir)
-endif
-
-lib_LTLIBRARIES = libcares.la
-
-man_MANS = $(MANPAGES)
-
-MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \
- vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw \
- msvc_ver.inc
-
-if CURLDEBUG
-PROGS =
-else
-PROGS = ahost adig acountry
-endif
-
-noinst_PROGRAMS =$(PROGS)
+MSVCFILES = msvc_ver.inc buildconf.bat
# adig and ahost are just sample programs and thus not mentioned with the
# regular sources and headers
-EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
- Makefile.m32 Makefile.netware Makefile.msvc Makefile.Watcom $(man_MANS) \
- config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
- TODO ares_build.h.in cares.rc README.msvc $(MSVCFILES) \
- $(CSOURCES) $(HHEADERS) config-dos.h acountry.1 adig.1 ahost.1 INSTALL.md \
- CMakeLists.txt ares_build.h.cmake ares_config.h.cmake c-ares-config.cmake.in \
- libcares.pc.cmake README.md LICENSE.md RELEASE-PROCEDURE.md
+EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \
+ c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \
+ maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \
+ CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \
+ Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO
+
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
-DISTCLEANFILES = ares_build.h
+DISTCLEANFILES = include/ares_build.h
-DIST_SUBDIRS = test
+DIST_SUBDIRS = include src test docs
+
+SUBDIRS = @BUILD_SUBDIRS@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcares.pc
-CARES_VERSION_INFO = -version-info 5:0:3
-# This flag accepts an argument of the form current[:revision[:age]]. So,
-# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
-# 1.
-#
-# If either revision or age are omitted, they default to 0. Also note that age
-# must be less than or equal to the current interface number.
-#
-# Here are a set of rules to help you update your library version information:
-#
-# 1.Start with version information of 0:0:0 for each libtool library.
-#
-# 2.Update the version information only immediately before a public release of
-# your software. More frequent updates are unnecessary, and only guarantee
-# that the current interface number gets larger faster.
-#
-# 3.If the library source code has changed at all since the last update, then
-# increment revision (c:r+1:a)
-#
-# 4.If any interfaces have been added, removed, or changed since the last
-# update, increment current, and set revision to 0. (c+1:r=0:a)
-#
-# 5.If any interfaces have been added since the last public release, then
-# increment age. (c:r:a+1)
-#
-# 6.If any interfaces have been removed since the last public release, then
-# set age to 0. (c:r:a=0)
-#
-
-AM_LDFLAGS =
-
-libcares_la_LDFLAGS_EXTRA =
-
-if CARES_LT_SHLIB_USE_VERSION_INFO
-libcares_la_LDFLAGS_EXTRA += $(CARES_VERSION_INFO)
-endif
-
-if CARES_LT_SHLIB_USE_NO_UNDEFINED
-libcares_la_LDFLAGS_EXTRA += -no-undefined
-endif
-
-if CARES_LT_SHLIB_USE_MIMPURE_TEXT
-libcares_la_LDFLAGS_EXTRA += -mimpure-text
-endif
-
-libcares_la_LDFLAGS = $(AM_LDFLAGS) $(libcares_la_LDFLAGS_EXTRA)
-
-# Add -Werror if defined
-CFLAGS += @CARES_CFLAG_EXTRAS@
-
-if USE_CPPFLAG_CARES_STATICLIB
-AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB)
-endif
-
-libcares_la_CFLAGS_EXTRA =
-
-libcares_la_CPPFLAGS_EXTRA = -DCARES_BUILDING_LIBRARY
-
-if DOING_CARES_SYMBOL_HIDING
-libcares_la_CFLAGS_EXTRA += $(CFLAG_CARES_SYMBOL_HIDING)
-libcares_la_CPPFLAGS_EXTRA += -DCARES_SYMBOL_HIDING
-endif
-
-@CODE_COVERAGE_RULES@
-libcares_la_LDFLAGS += $(CODE_COVERAGE_LDFLAGS)
-libcares_la_CFLAGS_EXTRA += $(CODE_COVERAGE_CFLAGS)
-
-libcares_la_CFLAGS = $(AM_CFLAGS) $(libcares_la_CFLAGS_EXTRA)
-
-libcares_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcares_la_CPPFLAGS_EXTRA)
-
-# Makefile.inc provides the CSOURCES and HHEADERS defines
-include Makefile.inc
-
-libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
-
# where to install the c-ares headers
libcares_ladir = $(includedir)
-# what headers to install on 'make install':
-libcares_la_HEADERS = ares.h ares_version.h ares_dns.h \
- ares_build.h ares_rules.h
-
-ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
-ahost_LDADD = $(top_builddir)/libcares.la
-ahost_CFLAGS = $(AM_CFLAGS)
-ahost_CPPFLAGS = $(AM_CPPFLAGS)
-
-adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
-adig_LDADD = $(top_builddir)/libcares.la
-adig_CFLAGS = $(AM_CFLAGS)
-adig_CPPFLAGS = $(AM_CPPFLAGS)
-
-acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
-acountry_LDADD = $(top_builddir)/libcares.la
-acountry_CFLAGS = $(AM_CFLAGS)
-acountry_CPPFLAGS = $(AM_CPPFLAGS)
-
-SOURCEDMANDIR = man3
-SOURCEDMANPAGES = ares_init.3
-
-clean-local: clean-sourced-manpages
-
-clean-sourced-manpages:
- @srcdmandir='$(SOURCEDMANDIR)'; \
- echo "rm -rf $(top_builddir)/$$srcdmandir"; \
- rm -rf $(top_builddir)/$$srcdmandir
-
-sourced-manpages: clean-sourced-manpages
- @srcdmandir='$(SOURCEDMANDIR)'; \
- srcdmanfiles='$(SOURCEDMANPAGES)'; \
- mkdir $(top_builddir)/$$srcdmandir; \
- for file in $$srcdmanfiles; do \
- if test -f $(top_srcdir)/$$file; then \
- echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \
- cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \
- fi; \
- done
-
-MAN2HTML = roffit --mandir=. < $< >$@
-
-SUFFIXES = .3 .html
-
-html: sourced-manpages $(HTMLPAGES)
-
-.3.html:
- $(MAN2HTML)
-
-pdf: sourced-manpages $(PDFPAGES)
-.3.pdf:
- @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
- groff -Tps -man $< >$$foo.ps; \
- ps2pdf $$foo.ps $@; \
- rm $$foo.ps; \
- echo "converted $< to $@")
# Make files named *.dist replace the file without .dist extension
dist-hook:
diff --git a/grpc/third_party/cares/cares/Makefile.dj b/grpc/third_party/cares/cares/Makefile.dj
index f891f7fe..a88aae21 100644
--- a/grpc/third_party/cares/cares/Makefile.dj
+++ b/grpc/third_party/cares/cares/Makefile.dj
@@ -1,85 +1,102 @@
#
# c-ares Makefile for djgpp/gcc/Watt-32.
-# By Gisle Vanem <gvanem@yahoo.no> 2004.
+# By Gisle Vanem <gvanem@yahoo.no> 2004 - 2020.
#
+include src/lib/Makefile.inc
+CSOURCES := $(addprefix src/lib/, $(CSOURCES))
+CSOURCES := $(filter-out src/lib/windows_port.c, $(CSOURCES))
-TOPDIR = ..
+VPATH = src/lib src/tools
-DEPEND_PREREQ = ares_config.h
+#
+# Root directory for Waterloo tcp/ip.
+# WATT_ROOT should be set during Watt-32 install.
+#
+WATT32_ROOT = $(realpath $(WATT_ROOT))
+WATT32_LIB = $(WATT32_ROOT)/lib/libwatt.a
-include ../packages/DOS/common.dj
-include Makefile.inc
+OBJ_DIR = djgpp
-CFLAGS += -DWATT32 -Dselect=select_s
+CFLAGS = -g -O2 -I./include -I./src/lib \
+ -I$(WATT32_ROOT)/inc -Wall \
+ -DWATT32 -DHAVE_CONFIG_H \
+ -Dselect=select_s
LDFLAGS = -s
-ifeq ($(USE_CURLDEBUG),1)
- EX_LIBS = ../lib/libcurl.a
- OBJ_HACK = $(OBJECTS)
-else
- OBJ_HACK = libcares.a
-endif
+ifeq ($(OS),Windows_NT)
+ #
+ # Windows hosted djgpp cross compiler. Get it from:
+ # https://github.com/andrewwutw/build-djgpp/releases
+ #
+ DJ_PREFIX ?= c:/some-path/djgpp/bin/i586-pc-msdosdjgpp-
+ CC = $(DJ_PREFIX)gcc
-ifeq ($(USE_SSL),1)
- EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a
+else
+ #
+ # The normal djgpp 'gcc' for MSDOS.
+ #
+ CC = gcc
endif
-ifeq ($(USE_ZLIB),1)
- EX_LIBS += $(ZLIB_ROOT)/libz.a
-endif
+OBJECTS = $(addprefix $(OBJ_DIR)/, \
+ $(notdir $(CSOURCES:.c=.o)))
-ifeq ($(USE_IDNA),1)
- EX_LIBS += $(LIBIDN_ROOT)/lib/dj_obj/libidn.a -liconv
-endif
+GENERATED = src/lib/ares_config.h \
+ include/ares_build.h
-EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
+TARGETS = libcares.a acountry.exe adig.exe ahost.exe
-OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
+.SECONDARY: $(OBJ_DIR)/ares_getopt.o
-all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe
+all: $(OBJ_DIR) $(GENERATED) $(TARGETS)
@echo Welcome to c-ares.
libcares.a: $(OBJECTS)
- ar rs $@ $?
-
-ares_config.h: config-dos.h
- $(COPY) $^ $@
+ ar rs $@ $(OBJECTS)
-ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
+src/lib/ares_config.h: src/lib/config-dos.h
+ cp --update $< $@
-adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
+include/ares_build.h: include/ares_build.h.dist
+ cp --update $< $@
-acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
+%.exe: src/tools/%.c $(OBJ_DIR)/ares_getopt.o libcares.a
+ $(call compile_and_link, $@, $^ $(WATT32_LIB))
-# clean generated files
+# Clean generated files and objects.
#
-genclean:
- - $(DELETE) ares_config.h
+clean:
+ - rm -f depend.dj $(GENERATED) $(OBJ_DIR)/*.o
+ - rmdir $(OBJ_DIR)
-# clean object files and subdir
+# Clean everything
#
-objclean: genclean
- - $(DELETE) $(OBJ_DIR)$(DS)*.o
- - $(RMDIR) $(OBJ_DIR)
+realclean vclean: clean
+ - rm -f $(TARGETS) $(TARGETS:.exe=.map)
-# clean without removing built library and programs
-#
-clean: objclean
- - $(DELETE) depend.dj
+$(OBJ_DIR):
+ - mkdir $@
+
+$(OBJ_DIR)/%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
+ @echo
+
+define compile_and_link
+ $(CC) -o $(1) $(CFLAGS) $(LDFLAGS) -Wl,--print-map,--sort-common $(2) > $(1:.exe=.map)
+ @echo
+endef
+
+DEP_REPLACE = sed -e 's@\(.*\)\.o: @\n$$(OBJ_DIR)\/\1.o: @' \
+ -e 's@$(WATT32_ROOT)@$$(WATT32_ROOT)@g'
-# clean everything
#
-realclean vclean: clean
- - $(DELETE) libcares.a
- - $(DELETE) acountry.exe
- - $(DELETE) adig.exe
- - $(DELETE) ahost.exe
- - $(DELETE) libcares.a
+# One may have to do 'make -f Makefile.dj clean' first in case
+# a foreign 'curl_config.h' is making trouble.
+#
+depend: $(GENERATED) Makefile.dj
+ $(CC) -MM $(CFLAGS) $(CSOURCES) | $(DEP_REPLACE) > depend.dj
-include depend.dj
diff --git a/grpc/third_party/cares/cares/Makefile.inc b/grpc/third_party/cares/cares/Makefile.inc
deleted file mode 100644
index 30e00461..00000000
--- a/grpc/third_party/cares/cares/Makefile.inc
+++ /dev/null
@@ -1,250 +0,0 @@
-
-CSOURCES = ares__close_sockets.c \
- ares__get_hostent.c \
- ares__read_line.c \
- ares__timeval.c \
- ares_android.c \
- ares_cancel.c \
- ares_data.c \
- ares_destroy.c \
- ares_expand_name.c \
- ares_expand_string.c \
- ares_fds.c \
- ares_free_hostent.c \
- ares_free_string.c \
- ares_getenv.c \
- ares_gethostbyaddr.c \
- ares_gethostbyname.c \
- ares_getnameinfo.c \
- ares_getsock.c \
- ares_init.c \
- ares_library_init.c \
- ares_llist.c \
- ares_mkquery.c \
- ares_create_query.c \
- ares_nowarn.c \
- ares_options.c \
- ares_parse_a_reply.c \
- ares_parse_aaaa_reply.c \
- ares_parse_mx_reply.c \
- ares_parse_naptr_reply.c \
- ares_parse_ns_reply.c \
- ares_parse_ptr_reply.c \
- ares_parse_soa_reply.c \
- ares_parse_srv_reply.c \
- ares_parse_txt_reply.c \
- ares_platform.c \
- ares_process.c \
- ares_query.c \
- ares_search.c \
- ares_send.c \
- ares_strcasecmp.c \
- ares_strdup.c \
- ares_strerror.c \
- ares_strsplit.c \
- ares_timeout.c \
- ares_version.c \
- ares_writev.c \
- bitncmp.c \
- inet_net_pton.c \
- inet_ntop.c \
- windows_port.c
-
-HHEADERS = ares.h \
- ares_android.h \
- ares_build.h \
- ares_data.h \
- ares_dns.h \
- ares_getenv.h \
- ares_inet_net_pton.h \
- ares_iphlpapi.h \
- ares_ipv6.h \
- ares_library_init.h \
- ares_llist.h \
- ares_nowarn.h \
- ares_platform.h \
- ares_private.h \
- ares_rules.h \
- ares_strcasecmp.h \
- ares_strdup.h \
- ares_strsplit.h \
- ares_version.h \
- ares_writev.h \
- bitncmp.h \
- nameser.h \
- ares_setup.h \
- setup_once.h
-
-MANPAGES = ares_cancel.3 \
- ares_create_query.3 \
- ares_destroy.3 \
- ares_destroy_options.3 \
- ares_dup.3 \
- ares_expand_name.3 \
- ares_expand_string.3 \
- ares_fds.3 \
- ares_free_data.3 \
- ares_free_hostent.3 \
- ares_free_string.3 \
- ares_get_servers.3 \
- ares_get_servers_ports.3 \
- ares_gethostbyaddr.3 \
- ares_gethostbyname.3 \
- ares_gethostbyname_file.3 \
- ares_getnameinfo.3 \
- ares_getsock.3 \
- ares_inet_ntop.3 \
- ares_inet_pton.3 \
- ares_init.3 \
- ares_init_options.3 \
- ares_library_cleanup.3 \
- ares_library_init.3 \
- ares_library_init_android.3 \
- ares_library_initialized.3 \
- ares_mkquery.3 \
- ares_parse_a_reply.3 \
- ares_parse_aaaa_reply.3 \
- ares_parse_mx_reply.3 \
- ares_parse_naptr_reply.3 \
- ares_parse_ns_reply.3 \
- ares_parse_ptr_reply.3 \
- ares_parse_soa_reply.3 \
- ares_parse_srv_reply.3 \
- ares_parse_txt_reply.3 \
- ares_process.3 \
- ares_query.3 \
- ares_save_options.3 \
- ares_search.3 \
- ares_send.3 \
- ares_set_local_dev.3 \
- ares_set_local_ip4.3 \
- ares_set_local_ip6.3 \
- ares_set_servers.3 \
- ares_set_servers_csv.3 \
- ares_set_servers_ports.3 \
- ares_set_servers_ports_csv.3 \
- ares_set_socket_callback.3 \
- ares_set_socket_configure_callback.3 \
- ares_set_socket_functions.3 \
- ares_set_sortlist.3 \
- ares_strerror.3 \
- ares_timeout.3 \
- ares_version.3
-
-HTMLPAGES = ares_cancel.html \
- ares_create_query.html \
- ares_destroy.html \
- ares_destroy_options.html \
- ares_dup.html \
- ares_expand_name.html \
- ares_expand_string.html \
- ares_fds.html \
- ares_free_data.html \
- ares_free_hostent.html \
- ares_free_string.html \
- ares_get_servers.html \
- ares_get_servers_ports.html \
- ares_gethostbyaddr.html \
- ares_gethostbyname.html \
- ares_gethostbyname_file.html \
- ares_getnameinfo.html \
- ares_getsock.html \
- ares_inet_ntop.html \
- ares_inet_pton.html \
- ares_init.html \
- ares_init_options.html \
- ares_library_cleanup.html \
- ares_library_init.html \
- ares_library_init_android.html \
- ares_library_initialized.html \
- ares_mkquery.html \
- ares_parse_a_reply.html \
- ares_parse_aaaa_reply.html \
- ares_parse_mx_reply.html \
- ares_parse_ns_reply.html \
- ares_parse_ptr_reply.html \
- ares_parse_soa_reply.html \
- ares_parse_srv_reply.html \
- ares_parse_txt_reply.html \
- ares_process.html \
- ares_query.html \
- ares_save_options.html \
- ares_search.html \
- ares_send.html \
- ares_set_local_dev.html \
- ares_set_local_ip4.html \
- ares_set_local_ip6.html \
- ares_set_servers.html \
- ares_set_servers_csv.html \
- ares_set_servers_ports.html \
- ares_set_servers_ports_csv.html \
- ares_set_socket_callback.html \
- ares_set_socket_configure_callback.html \
- ares_set_socket_functions.html \
- ares_set_sortlist.html \
- ares_strerror.html \
- ares_timeout.html \
- ares_version.html
-
-PDFPAGES = ares_cancel.pdf \
- ares_create_query.pdf \
- ares_destroy.pdf \
- ares_destroy_options.pdf \
- ares_dup.pdf \
- ares_expand_name.pdf \
- ares_expand_string.pdf \
- ares_fds.pdf \
- ares_free_data.pdf \
- ares_free_hostent.pdf \
- ares_free_string.pdf \
- ares_get_servers.pdf \
- ares_get_servers_ports.pdf \
- ares_gethostbyaddr.pdf \
- ares_gethostbyname.pdf \
- ares_gethostbyname_file.pdf \
- ares_getnameinfo.pdf \
- ares_getsock.pdf \
- ares_inet_ntop.pdf \
- ares_inet_pton.pdf \
- ares_init.pdf \
- ares_init_options.pdf \
- ares_library_cleanup.pdf \
- ares_library_init.pdf \
- ares_library_init_android.pdf \
- ares_library_initialized.pdf \
- ares_mkquery.pdf \
- ares_parse_a_reply.pdf \
- ares_parse_aaaa_reply.pdf \
- ares_parse_mx_reply.pdf \
- ares_parse_ns_reply.pdf \
- ares_parse_ptr_reply.pdf \
- ares_parse_soa_reply.pdf \
- ares_parse_srv_reply.pdf \
- ares_parse_txt_reply.pdf \
- ares_process.pdf \
- ares_query.pdf \
- ares_save_options.pdf \
- ares_search.pdf \
- ares_send.pdf \
- ares_set_local_dev.pdf \
- ares_set_local_ip4.pdf \
- ares_set_local_ip6.pdf \
- ares_set_servers.pdf \
- ares_set_servers_csv.pdf \
- ares_set_servers_ports.pdf \
- ares_set_servers_ports_csv.pdf \
- ares_set_socket_callback.pdf \
- ares_set_socket_configure_callback.pdf \
- ares_set_socket_functions.pdf \
- ares_set_sortlist.pdf \
- ares_strerror.pdf \
- ares_timeout.pdf \
- ares_version.pdf
-
-SAMPLESOURCES = ares_getopt.c \
- ares_nowarn.c \
- ares_strcasecmp.c
-
-SAMPLEHEADERS = ares_getopt.h \
- ares_nowarn.h \
- ares_strcasecmp.h
diff --git a/grpc/third_party/cares/cares/Makefile.m32 b/grpc/third_party/cares/cares/Makefile.m32
index 97a28c2e..e7a423be 100644
--- a/grpc/third_party/cares/cares/Makefile.m32
+++ b/grpc/third_party/cares/cares/Makefile.m32
@@ -8,7 +8,7 @@
########################################################
## Nothing more to do below this line!
-LIB = libcares.a
+LIB = src/lib/libcares.a
AR = $(CROSSPREFIX)ar
CC = $(CROSSPREFIX)gcc
@@ -17,15 +17,15 @@ RANLIB = $(CROSSPREFIX)ranlib
#RM = rm -f
CP = cp -afv
-CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I. -D_WIN32_WINNT=0x0600
+CFLAGS = $(CARES_CFLAG_EXTRAS) -O2 -Wall -I./include -I./src/lib -D_WIN32_WINNT=0x0600
CFLAGS += -DCARES_STATICLIB
LDFLAGS = $(CARES_LDFLAG_EXTRAS) -s
LIBS = -lwsock32
# Makefile.inc provides the CSOURCES and HHEADERS defines
-include Makefile.inc
+include src/lib/Makefile.inc
-OBJLIB := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
+OBJLIB := $(patsubst %.c,src/lib/%.o,$(strip $(CSOURCES)))
$(LIB): $(OBJLIB)
@@ -34,21 +34,21 @@ $(LIB): $(OBJLIB)
all: $(LIB) demos
-demos: adig.exe ahost.exe acountry.exe
+demos: src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe
tags:
etags *.[ch]
-%.exe: %.o ares_getopt.o $(LIB)
+%.exe: %.o src/tools/ares_getopt.o $(LIB)
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-$(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
+$(OBJLIB): include/ares.h include/ares_dns.h include/ares_build.h
.c.o:
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(CFLAGS) -o $@ -c $<
-ares_build.h:
- $(CP) ares_build.h.dist ares_build.h
+include/ares_build.h:
+ $(CP) include/ares_build.h.dist include/ares_build.h
check:
@@ -59,18 +59,19 @@ install:
${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
chmod u-w ${DESTDIR}${libdir}/$(LIB)
- ${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
- ${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
- ${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
+ ${INSTALL} -m 444 ${srcdir}/include/ares.h ${DESTDIR}${includedir}
+ ${INSTALL} -m 444 ${srcdir}/include/ares_build.h ${DESTDIR}${includedir}
+ ${INSTALL} -m 444 ${srcdir}/include/ares_rules.h ${DESTDIR}${includedir}
+ ${INSTALL} -m 444 ${srcdir}/include/ares_version.h ${DESTDIR}${includedir}
(for man in $(MANPAGES); do \
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
done)
clean:
- $(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe
+ $(RM) src/tools/ares_getopt.o $(OBJLIB) $(LIB) src/tools/adig.exe src/tools/ahost.exe src/tools/acountry.exe
distclean: clean
$(RM) config.cache config.log config.status Makefile
-ifeq "$(wildcard ares_build.h.dist)" "ares_build.h.dist"
- $(RM) ares_build.h
+ifeq "$(wildcard include/ares_build.h.dist)" "include/ares_build.h.dist"
+ $(RM) include/ares_build.h
endif
diff --git a/grpc/third_party/cares/cares/Makefile.msvc b/grpc/third_party/cares/cares/Makefile.msvc
index 8f7c838f..21d3de66 100644
--- a/grpc/third_party/cares/cares/Makefile.msvc
+++ b/grpc/third_party/cares/cares/Makefile.msvc
@@ -80,7 +80,7 @@ USE_WATT32 = 0
# Verify that current subdir is the c-ares source one
# ----------------------------------------------------
-!IF ! EXIST(.\ares_init.c)
+!IF ! EXIST(.\src\lib\ares_init.c)
! MESSAGE Can not process Makefile.msvc from outside of c-ares source subdirectory.
! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again.
! ERROR See previous message.
@@ -212,7 +212,7 @@ RT_ERROR_CHECKING = /RTCsu
CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2
CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING)
-CC_CFLAGS = $(CFLAGS) /I. /W3 /EHsc /FD
+CC_CFLAGS = $(CFLAGS) /I.\src\lib /I.\include /W3 /EHsc /FD
RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
@@ -280,7 +280,8 @@ RC_CMD = $(RC_CMD_DBG)
# Makefile.inc provides lists of source files
# --------------------------------------------
-!INCLUDE .\Makefile.inc
+!INCLUDE .\src\lib\Makefile.inc
+!INCLUDE .\src\tools\Makefile.inc
# ----------------------------
# Build lists of object files
@@ -308,6 +309,7 @@ CARES_OBJS = $(CARES_OBJS) $(CARES_OBJDIR)\cares.res
!ERROR Problem generating PROG1_OBJS list.
!ENDIF
PROG1_OBJS = $(PROG1_OBJS:.c=.obj)
+PROG1_OBJS = $(PROG1_OBJS:/=\)
PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj
!IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES: = $(PROG2_OBJDIR^)\) > .\prog2_objs.inc] == 0
@@ -318,6 +320,7 @@ PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj
!ERROR Problem generating PROG2_OBJS list.
!ENDIF
PROG2_OBJS = $(PROG2_OBJS:.c=.obj)
+PROG2_OBJS = $(PROG2_OBJS:/=\)
PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj
!IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES: = $(PROG3_OBJDIR^)\) > .\prog3_objs.inc] == 0
@@ -328,10 +331,12 @@ PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj
!ERROR Problem generating PROG3_OBJS list.
!ENDIF
PROG3_OBJS = $(PROG3_OBJS:.c=.obj)
+PROG3_OBJS = $(PROG3_OBJS:/=\)
PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
!ENDIF
+
# --------------------------------
# Only our custom inference rules
# --------------------------------
@@ -339,21 +344,33 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
.SUFFIXES:
.SUFFIXES: .c .rc
-{$(SRCDIR)}.rc{$(CARES_OBJDIR)}.res:
+{$(SRCDIR)\src\lib}.rc{$(CARES_OBJDIR)}.res:
$(RC_CMD) /Fo $@ $<
-{$(SRCDIR)}.c{$(CARES_OBJDIR)}.obj:
+{$(SRCDIR)\src\lib}.c{$(CARES_OBJDIR)}.obj:
$(CC_CMD) $(CC_CFLAGS) $(CARES_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
-{$(SRCDIR)}.c{$(PROG1_OBJDIR)}.obj:
+{$(SRCDIR)\src\tools}.c{$(PROG1_OBJDIR)}.obj:
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
-{$(SRCDIR)}.c{$(PROG2_OBJDIR)}.obj:
+{$(SRCDIR)\src\tools}.c{$(PROG2_OBJDIR)}.obj:
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
-{$(SRCDIR)}.c{$(PROG3_OBJDIR)}.obj:
+{$(SRCDIR)\src\tools}.c{$(PROG3_OBJDIR)}.obj:
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
+# Hack Alert! we reference ../lib/ files in the Makefile.inc for tools as they
+# share some files with the library itself. We need to hack around that here.
+
+{$(SRCDIR)\src\lib}.c{$(PROG1_OBJDIR)\..\lib}.obj:
+ $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG1_OBJDIR)\$(@F) /Fd$(PROG1_OBJDIR)\ /c $<
+
+{$(SRCDIR)\src\lib}.c{$(PROG2_OBJDIR)\..\lib}.obj:
+ $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG2_OBJDIR)\$(@F) /Fd$(PROG2_OBJDIR)\ /c $<
+
+{$(SRCDIR)\src\lib}.c{$(PROG3_OBJDIR)\..\lib}.obj:
+ $(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$(PROG3_OBJDIR)\$(@F) /Fd$(PROG3_OBJDIR)\ /c $<
+
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #
# Default target when no CFG library type has been specified, #
@@ -364,10 +381,10 @@ PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
!IF "$(VALID_CFGSET)" == "FALSE"
ALL:
- $(MAKE) /f .\Makefile.msvc CFG=lib-release ALL
- $(MAKE) /f .\Makefile.msvc CFG=lib-debug ALL
- $(MAKE) /f .\Makefile.msvc CFG=dll-release ALL
- $(MAKE) /f .\Makefile.msvc CFG=dll-debug ALL
+ $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-release ALL
+ $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=lib-debug ALL
+ $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-release ALL
+ $(MAKE) /NOLOGO /f .\Makefile.msvc CFG=dll-debug ALL
clean:
@-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1
@@ -389,22 +406,26 @@ install:
ALL: c-ares acountry adig ahost
@
-c-ares: $(HHEADERS) $(CSOURCES) $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR)
+# $(HHEADERS) $(CSOURCES)
+c-ares: $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR)
$(CARES_LINK) $(CARES_LFLAGS) /out:$(CARES_OUTDIR)\$(CARES_TARGET) $(CARES_OBJS)
! IF "$(USE_RES_FILE)" == "TRUE"
@if exist $(CARES_OUTDIR)\$(CARES_TARGET).manifest mt -nologo -manifest $(CARES_OUTDIR)\$(CARES_TARGET).manifest -outputresource:$(CARES_OUTDIR)\$(CARES_TARGET);2
! ENDIF
-acountry: c-ares acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG1_OBJDIR) $(PROG1_OBJS) $(PROG1_OUTDIR)
- $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG1_OUTDIR)\acountry.exe $(PROG1_OBJS)
+# acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+acountry: c-ares $(PROG1_OBJDIR) $(PROG1_OBJS) $(PROG1_OUTDIR)
+ $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG1_OUTDIR)\acountry.exe $(PROG1_OBJS:..\lib=)
@if exist $(PROG1_OUTDIR)\acountry.exe.manifest mt -nologo -manifest $(PROG1_OUTDIR)\acountry.exe.manifest -outputresource:$(PROG1_OUTDIR)\acountry.exe;1
-adig: c-ares adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG2_OBJDIR) $(PROG2_OBJS) $(PROG2_OUTDIR)
- $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG2_OUTDIR)\adig.exe $(PROG2_OBJS)
+# adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+adig: c-ares $(PROG2_OBJDIR) $(PROG2_OBJS) $(PROG2_OUTDIR)
+ $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG2_OUTDIR)\adig.exe $(PROG2_OBJS:..\lib=)
@if exist $(PROG2_OUTDIR)\adig.exe.manifest mt -nologo -manifest $(PROG2_OUTDIR)\adig.exe.manifest -outputresource:$(PROG2_OUTDIR)\adig.exe;1
-ahost: c-ares ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR)
- $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG3_OUTDIR)\ahost.exe $(PROG3_OBJS)
+# ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+ahost: c-ares $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR)
+ $(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG3_OUTDIR)\ahost.exe $(PROG3_OBJS:..\lib=)
@if exist $(PROG3_OUTDIR)\ahost.exe.manifest mt -nologo -manifest $(PROG3_OUTDIR)\ahost.exe.manifest -outputresource:$(PROG3_OUTDIR)\ahost.exe;1
$(CARES_OUTDIR): $(CARES_DIR)
@@ -443,11 +464,11 @@ install:
@if not exist "$(INSTALL_DIR)" mkdir "$(INSTALL_DIR)"
@if not exist "$(INSTALL_DIR_LIB)" mkdir "$(INSTALL_DIR_LIB)"
@if not exist "$(INSTALL_DIR_INC)" mkdir "$(INSTALL_DIR_INC)"
- @copy /y $(CARES_OUTDIR)\*.* "$(INSTALL_DIR_LIB)" >NUL
- @copy /y $(SRCDIR)\ares.h "$(INSTALL_DIR_INC)" >NUL
- @copy /y $(SRCDIR)\ares_build.h "$(INSTALL_DIR_INC)" >NUL
- @copy /y $(SRCDIR)\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
- @copy /y $(SRCDIR)\ares_version.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(CARES_OUTDIR)\*.* "$(INSTALL_DIR_LIB)" >NUL
+ @copy /y $(SRCDIR)\include\ares.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\include\ares_build.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\include\ares_rules.h "$(INSTALL_DIR_INC)" >NUL
+ @copy /y $(SRCDIR)\include\ares_version.h "$(INSTALL_DIR_INC)" >NUL
@echo Installed c-ares $(CFG)
!ENDIF
diff --git a/grpc/third_party/cares/cares/Makefile.netware b/grpc/third_party/cares/cares/Makefile.netware
index fa8f8317..e1a8a552 100644
--- a/grpc/third_party/cares/cares/Makefile.netware
+++ b/grpc/third_party/cares/cares/Makefile.netware
@@ -34,7 +34,7 @@ ifndef LIBARCH
LIBARCH = LIBC
endif
-# must be equal to NDEBUG or DEBUG, CURLDEBUG
+# must be equal to NDEBUG or DEBUG
ifndef DB
DB = NDEBUG
endif
@@ -134,9 +134,7 @@ else
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
# INCLUDES += -I$(SDK_CLIB)/include
endif
-ifeq ($(DB),CURLDEBUG)
-INCLUDES += -I../include
-endif
+
CFLAGS += -I. $(INCLUDES)
ifeq ($(MTSAFE),YES)
diff --git a/grpc/third_party/cares/cares/README.md b/grpc/third_party/cares/cares/README.md
index 93c1f5f8..148338f9 100644
--- a/grpc/third_party/cares/cares/README.md
+++ b/grpc/third_party/cares/cares/README.md
@@ -2,9 +2,10 @@ c-ares
======
[![Build Status](https://travis-ci.org/c-ares/c-ares.svg?branch=master)](https://travis-ci.org/c-ares/c-ares)
-[![Windows Build Status](https://ci.appveyor.com/api/projects/status/03i7151772eq3wn3/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares)
+[![Windows Build Status](https://ci.appveyor.com/api/projects/status/aevgc5914tm72pvs/branch/master?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares/branch/master)
[![Coverage Status](https://coveralls.io/repos/c-ares/c-ares/badge.svg?branch=master&service=github)](https://coveralls.io/github/c-ares/c-ares?branch=master)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
+[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)
[![Releases](https://coderelease.io/badge/c-ares/c-ares)](https://coderelease.io/github/repository/c-ares/c-ares)
This is c-ares, an asynchronous resolver library. It is intended for
diff --git a/grpc/third_party/cares/cares/README.msvc b/grpc/third_party/cares/cares/README.msvc
index 4ff8700c..396f497d 100644
--- a/grpc/third_party/cares/cares/README.msvc
+++ b/grpc/third_party/cares/cares/README.msvc
@@ -1,6 +1,6 @@
- ___ __ _ _ __ ___ ___
+ ___ __ _ _ __ ___ ___
/ __| ___ / _` | '__/ _ \/ __|
| (_ |___| (_| | | | __/\__ \
\___| \__,_|_| \___||___/
@@ -64,46 +64,6 @@
to c-ares source folder where Makefile.msvc file is located.
- How to build using Visual Studio 6 IDE
- --------------------------------------
-
- A VC++ 6.0 reference workspace (vc6aws.dsw) is available within the 'vc'
- folder to allow proper building of the library and sample programs.
-
- 1) Open the vc6aws.dsw workspace with MSVC6's IDE.
- 2) Select 'Build' from top menu.
- 3) Select 'Batch Build' from dropdown menu.
- 4) Make sure that the sixteen project configurations are 'checked'.
- 5) Click on the 'Build' button.
- 6) Once the sixteen project configurations are built you are done.
-
- Dynamic and static c-ares libraries are built in debug and release flavours,
- and can be located each one in its own subdirectory, dll-debug, dll-release,
- lib-debug and lib-release, all of them below the 'vc\cares' subdirectory.
-
- In the same way four executable versions of each sample program are built,
- each using its respective library. The resulting sample executables are
- located in its own subdirectory, dll-debug, dll-release, lib-debug and
- lib-release, below the 'vc\acountry', 'vc\adig' and 'vc\ahost'folders.
-
- These reference VC++ 6.0 configurations are generated using the dynamic CRT.
-
-
- How to build using Visual Studio 2003 or newer IDE
- --------------------------------------------------
-
- First you have to convert the VC++ 6.0 reference workspace and project files
- to the Visual Studio IDE version you are using, following next steps:
-
- 1) Open vc\vc6aws.dsw with VS20XX.
- 2) Allow VS20XX to update all projects and workspaces.
- 3) Save ALL and close VS20XX.
- 4) Open vc\vc6aws.sln with VS20XX.
- 5) Select batch build, check 'all' projects and click 'build' button.
-
- Same comments relative to generated files and folders as done above for
- Visual Studio 6 IDE apply here.
-
Relationship between c-ares library file names and versions
-----------------------------------------------------------
@@ -139,4 +99,4 @@
Have Fun!
-
+
diff --git a/grpc/third_party/cares/cares/RELEASE-NOTES b/grpc/third_party/cares/cares/RELEASE-NOTES
index 62276fdf..adb9b945 100644
--- a/grpc/third_party/cares/cares/RELEASE-NOTES
+++ b/grpc/third_party/cares/cares/RELEASE-NOTES
@@ -1,43 +1,83 @@
-c-ares version 1.15.0
+c-ares version 1.17.2
+
+This is a security and bugfix release. It addresses a few security related
+issues along with various bugfixes mostly related to portability.
+
+Security:
+ o NodeJS passes NULL for addr and 0 for addrlen to ares_parse_ptr_reply() on
+ systems where malloc(0) returns NULL. This would cause a crash. [8]
+ o When building c-ares with CMake, the RANDOM_FILE would not be set and
+ therefore downgrade to the less secure random number generator [12]
+ o If ares_getaddrinfo() was terminated by an ares_destroy(), it would cause
+ a crash [13]
+ o Crash in sortaddrinfo() if the list size equals 0 due to an unexpected
+ DNS response [14]
+ o Expand number of escaped characters in DNS replies as per RFC1035 5.1 to
+ prevent spoofing [16], [17]
+ o Perform validation on hostnames to prevent possible XSS due to applications
+ not performing valiation themselves [18]
Changes:
- o Add ares_init_options() configurability for path to resolv.conf file [1]
- o Ability to exclude building of tools (adig, ahost, acountry) in CMake [3]
- o Android: Support for domain search suffix [4]
- o Report ARES_ENOTFOUND for .onion domain names as per RFC7686. [13]
+ o Use non-blocking /dev/urandom for random data to prevent early startup
+ performance issues [5]
+ o z/OS port [6]
+ o ares_malloc(0) is now defined behavior (returns NULL) rather than
+ system-specific to catch edge cases [7]
Bug fixes:
- o AIX build fix for trying to include both nameser_compat.h and
- onameser_compat.h [2]
- o Windows: Improve DNS suffixes extracting from WinNT registry [5]
- o Fix modern GCC warnings [6]
- o Apply the IPv6 server blacklist to all nameserver sources, not just Windows
- [7]
- o Fix warnings emitted by MSVC when using -W4 [8]
- o Prevent changing name servers while queries are outstanding [9]
- o Harden and rationalize c-ares timeout computation [10]
- o Distribute ares_android.h [11]
- o ares_set_servers_csv() on failure should not leave channel in a bad state
- [12]
- o Add missing docs to distribution
+ o Fuzz testing files were not distributed with official archives [1]
+ o Building tests should not force building of static libraries except on
+ Windows [2]
+ o Windows builds of the tools would fail if built as static due to a missing
+ CARES_STATICLIB definition [3]
+ o Relative headers must use double quotes to prevent pulling in a system
+ library [4]
+ o Fix OpenBSD building by implementing portability updates for including
+ arpa/nameser.h [9]
+ o Fix building out-of-tree for autotools [10]
+ o Make install on MacOS/iOS with CMake was missing the bundle destination so
+ libraries weren't actually installed [11]
+ o Fix retrieving DNS server configuration on MacOS and iOS if the configuration
+ did not include search domains [15]
+ o ares_parse_a_reply and ares_parse_aaa_reply were erroneously using strdup()
+ instead of ares_strdup() [19]
+
Thanks go to these friendly people for their efforts and contributions:
- @afalin, Andi Schnebinger, Ben Noordhuis, Brad House, Brad Spencer,
- David Hotham, @flyingdutchman23, John Schember, Ruslan Baratov,
- Sarat Addepalli, Tobias Nießen (11 contributors)
+ Anton Danielsson (@anton-danielsson)
+ Brad House (@bradh352)
+ Daniel Stenberg (@bagder)
+ Dhrumil Rana (@dhrumilrana)
+ Frantiơek Dvoƙák (@valtri)
+ @halx99
+ Jay Freeman (@saurik)
+ Jean-pierre Cartal (@jeanpierrecartal)
+ Michael Kourlas
+ Philipp Jeitner
+ @vburdo
+(11 contributors)
References to bug reports and discussions on issues:
- [1] = https://github.com/c-ares/c-ares/issues/220
- [2] = https://github.com/c-ares/c-ares/issues/224
- [3] = https://github.com/c-ares/c-ares/issues/200
- [4] = https://github.com/c-ares/c-ares/issues/207
- [5] = https://github.com/c-ares/c-ares/pull/202
- [6] = https://github.com/c-ares/c-ares/pull/201
- [7] = https://github.com/c-ares/c-ares/pull/193
- [8] = https://github.com/c-ares/c-ares/pull/192
- [9] = https://github.com/c-ares/c-ares/pull/191
- [10] = https://github.com/c-ares/c-ares/pull/187
- [11] = https://c-ares.haxx.se/mail/c-ares-archive-2018-04/0000.shtml
- [12] = https://c-ares.haxx.se/mail/c-ares-archive-2018-03/0000.shtml
- [13] = https://github.com/c-ares/c-ares/issues/196
+ [1] = https://github.com/c-ares/c-ares/issues/379
+ [2] = https://github.com/c-ares/c-ares/issues/380
+ [3] = https://github.com/c-ares/c-ares/issues/384
+ [4] = https://github.com/c-ares/c-ares/pull/386
+ [5] = https://github.com/c-ares/c-ares/pull/391
+ [6] = https://github.com/c-ares/c-ares/pull/390
+ [7] = https://github.com/c-ares/c-ares/commit/485fb66
+ [8] = https://github.com/c-ares/c-ares/issues/392
+ [9] = https://github.com/c-ares/c-ares/issues/388
+ [10] = https://github.com/c-ares/c-ares/pull/394
+ [11] = https://github.com/c-ares/c-ares/pull/395
+ [12] = https://github.com/c-ares/c-ares/pull/397
+ [13] = https://github.com/c-ares/c-ares/commit/df94703
+ [14] = https://github.com/c-ares/c-ares/pull/400
+ [15] = https://github.com/c-ares/c-ares/pull/401
+ [16] = https://github.com/c-ares/c-ares/commit/362f91d
+ [17] = https://github.com/c-ares/c-ares/commit/44c009b
+ [18] = https://github.com/c-ares/c-ares/commit/c9b6c60
+ [19] = https://github.com/c-ares/c-ares/pull/408
+
+
+
diff --git a/grpc/third_party/cares/cares/RELEASE-PROCEDURE.md b/grpc/third_party/cares/cares/RELEASE-PROCEDURE.md
index b2fe5863..bca6c7f5 100644
--- a/grpc/third_party/cares/cares/RELEASE-PROCEDURE.md
+++ b/grpc/third_party/cares/cares/RELEASE-PROCEDURE.md
@@ -6,7 +6,7 @@ in the source code repo
- edit `RELEASE-NOTES` to be accurate
-- edit `Makefile.am`'s `CARES_VERSION_INFO`, and `CMakeLists.txt`'s
+- edit `configure.ac`'s `CARES_VERSION_INFO`, and `CMakeLists.txt`'s
`CARES_LIB_VERSIONINFO` set to the same value to denote the current shared
object versioning.
diff --git a/grpc/third_party/cares/cares/acountry.1 b/grpc/third_party/cares/cares/acountry.1
deleted file mode 100644
index 74c4e346..00000000
--- a/grpc/third_party/cares/cares/acountry.1
+++ /dev/null
@@ -1,53 +0,0 @@
-.TH ACOUNTRY "1" "April 2011" "c-ares utilities"
-.SH NAME
-acountry \- print the country where an IPv4 address or host is located
-.SH SYNOPSIS
-.B acountry
-[\fIOPTION\fR]... \fIHOST\fR...
-.SH DESCRIPTION
-.PP
-.\" Add any additional description here
-.PP
-Print the country where HOST (an IPv4 address or hostname) is located,
-using the countries.nerd.dk DNS domain to identify the country.
-.PP
-This utility comes with the \fBc\-ares\fR asynchronous resolver library.
-.SH OPTIONS
-.TP
-\fB\-d\fR
-Print some extra debugging output.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Display this help and exit.
-.TP
-\fB\-v\fR
-Be more verbose. Print extra information.
-.SH "REPORTING BUGS"
-Report bugs to the c-ares mailing list:
-\fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR
-.SH "SEE ALSO"
-.PP
-adig(1), ahost(1).
-.PP
-The DNSBL countries.nerd.dk
-.br
-\fBhttp://countries.nerd.dk/\fR
-.SH COPYRIGHT
-This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
-carrying the following notice:
-.br
-Copyright 1998 by the Massachusetts Institute of Technology.
-.br
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of M.I.T. not be used in
-advertising or publicity pertaining to distribution of the software
-without specific, written prior permission. M.I.T. makes no
-representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
-.br
-No further copyright claims are being made by the author(s) of this utility.
-.SH AUTHOR
-Gisle Vanem
diff --git a/grpc/third_party/cares/cares/acountry.c b/grpc/third_party/cares/cares/acountry.c
deleted file mode 100644
index 2f20ff48..00000000
--- a/grpc/third_party/cares/cares/acountry.c
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- *
- * IP-address/hostname to country converter.
- *
- * Problem; you want to know where IP a.b.c.d is located.
- *
- * Use ares_gethostbyname ("d.c.b.a.zz.countries.nerd.dk")
- * and get the CNAME (host->h_name). Result will be:
- * CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
- * CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
- *
- * The 2 letter country code is in <CC> and the ISO-3166 country
- * number is in x.y (number = x*256 + y). Version 2 of the protocol is missing
- * the <CC> number.
- *
- * Ref: http://countries.nerd.dk/more.html
- *
- * Written by G. Vanem <gvanem@yahoo.no> 2006, 2007
- *
- * NB! This program may not be big-endian aware.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#if defined(WIN32) && !defined(WATT32)
- #include <winsock.h>
-#else
- #include <arpa/inet.h>
- #include <netinet/in.h>
- #include <netdb.h>
-#endif
-
-#include "ares.h"
-#include "ares_getopt.h"
-#include "ares_nowarn.h"
-
-#ifndef HAVE_STRDUP
-# include "ares_strdup.h"
-# define strdup(ptr) ares_strdup(ptr)
-#endif
-
-#ifndef HAVE_STRCASECMP
-# include "ares_strcasecmp.h"
-# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
-#endif
-
-#ifndef HAVE_STRNCASECMP
-# include "ares_strcasecmp.h"
-# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
-#endif
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
-static const char *usage = "acountry [-vh?] {host|addr} ...\n";
-static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
-static const char *nerd_ver1 = nerd_fmt + 14; /* .countries.nerd.dk */
-static const char *nerd_ver2 = nerd_fmt + 11; /* .zz.countries.nerd.dk */
-static int verbose = 0;
-
-#define TRACE(fmt) do { \
- if (verbose > 0) \
- printf fmt ; \
- } WHILE_FALSE
-
-static void wait_ares(ares_channel channel);
-static void callback(void *arg, int status, int timeouts, struct hostent *host);
-static void callback2(void *arg, int status, int timeouts, struct hostent *host);
-static void find_country_from_cname(const char *cname, struct in_addr addr);
-
-static void Abort(const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
- exit(1);
-}
-
-int main(int argc, char **argv)
-{
- ares_channel channel;
- int ch, status;
-
-#if defined(WIN32) && !defined(WATT32)
- WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
- WSADATA wsaData;
- WSAStartup(wVersionRequested, &wsaData);
-#endif
-
- status = ares_library_init(ARES_LIB_INIT_ALL);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
- return 1;
- }
-
- while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
- switch (ch)
- {
- case 'd':
-#ifdef WATT32
- dbug_init();
-#endif
- break;
- case 'v':
- verbose++;
- break;
- case 'h':
- case '?':
- default:
- Abort(usage);
- }
-
- argc -= optind;
- argv += optind;
- if (argc < 1)
- Abort(usage);
-
- status = ares_init(&channel);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
- return 1;
- }
-
- /* Initiate the queries, one per command-line argument. */
- for ( ; *argv; argv++)
- {
- struct in_addr addr;
- char buf[100];
-
- /* If this fails, assume '*argv' is a host-name that
- * must be resolved first
- */
- if (ares_inet_pton(AF_INET, *argv, &addr) != 1)
- {
- ares_gethostbyname(channel, *argv, AF_INET, callback2, &addr);
- wait_ares(channel);
- if (addr.s_addr == INADDR_NONE)
- {
- printf("Failed to lookup %s\n", *argv);
- continue;
- }
- }
-
- sprintf(buf, nerd_fmt,
- (unsigned int)(addr.s_addr >> 24),
- (unsigned int)((addr.s_addr >> 16) & 255),
- (unsigned int)((addr.s_addr >> 8) & 255),
- (unsigned int)(addr.s_addr & 255));
- TRACE(("Looking up %s...", buf));
- fflush(stdout);
- ares_gethostbyname(channel, buf, AF_INET, callback, buf);
- }
-
- wait_ares(channel);
- ares_destroy(channel);
-
- ares_library_cleanup();
-
-#if defined(WIN32) && !defined(WATT32)
- WSACleanup();
-#endif
-
- return 0;
-}
-
-/*
- * Wait for the queries to complete.
- */
-static void wait_ares(ares_channel channel)
-{
- for (;;)
- {
- struct timeval *tvp, tv;
- fd_set read_fds, write_fds;
- int nfds;
-
- FD_ZERO(&read_fds);
- FD_ZERO(&write_fds);
- nfds = ares_fds(channel, &read_fds, &write_fds);
- if (nfds == 0)
- break;
- tvp = ares_timeout(channel, NULL, &tv);
- nfds = select(nfds, &read_fds, &write_fds, NULL, tvp);
- if (nfds < 0)
- continue;
- ares_process(channel, &read_fds, &write_fds);
- }
-}
-
-/*
- * This is the callback used when we have the IP-address of interest.
- * Extract the CNAME and figure out the country-code from it.
- */
-static void callback(void *arg, int status, int timeouts, struct hostent *host)
-{
- const char *name = (const char*)arg;
- const char *cname;
- char buf[20];
-
- (void)timeouts;
-
- if (!host || status != ARES_SUCCESS)
- {
- printf("Failed to lookup %s: %s\n", name, ares_strerror(status));
- return;
- }
-
- TRACE(("\nFound address %s, name %s\n",
- ares_inet_ntop(AF_INET,(const char*)host->h_addr,buf,sizeof(buf)),
- host->h_name));
-
- cname = host->h_name; /* CNAME gets put here */
- if (!cname)
- printf("Failed to get CNAME for %s\n", name);
- else
- find_country_from_cname(cname, *(struct in_addr*)host->h_addr);
-}
-
-/*
- * This is the callback used to obtain the IP-address of the host of interest.
- */
-static void callback2(void *arg, int status, int timeouts, struct hostent *host)
-{
- struct in_addr *addr = (struct in_addr*) arg;
-
- (void)timeouts;
- if (!host || status != ARES_SUCCESS)
- memset(addr, INADDR_NONE, sizeof(*addr));
- else
- memcpy(addr, host->h_addr, sizeof(*addr));
-}
-
-struct search_list {
- int country_number; /* ISO-3166 country number */
- char short_name[3]; /* A2 short country code */
- const char *long_name; /* normal country name */
- };
-
-static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
-{
- while (num > 0 && list->long_name)
- {
- if (list->country_number == number)
- return (list);
- num--;
- list++;
- }
- return (NULL);
-}
-
-/*
- * Ref: ftp://ftp.ripe.net/iso3166-countrycodes.txt
- */
-static const struct search_list country_list[] = {
- { 4, "af", "Afghanistan" },
- { 248, "ax", "Åland Island" },
- { 8, "al", "Albania" },
- { 12, "dz", "Algeria" },
- { 16, "as", "American Samoa" },
- { 20, "ad", "Andorra" },
- { 24, "ao", "Angola" },
- { 660, "ai", "Anguilla" },
- { 10, "aq", "Antarctica" },
- { 28, "ag", "Antigua & Barbuda" },
- { 32, "ar", "Argentina" },
- { 51, "am", "Armenia" },
- { 533, "aw", "Aruba" },
- { 36, "au", "Australia" },
- { 40, "at", "Austria" },
- { 31, "az", "Azerbaijan" },
- { 44, "bs", "Bahamas" },
- { 48, "bh", "Bahrain" },
- { 50, "bd", "Bangladesh" },
- { 52, "bb", "Barbados" },
- { 112, "by", "Belarus" },
- { 56, "be", "Belgium" },
- { 84, "bz", "Belize" },
- { 204, "bj", "Benin" },
- { 60, "bm", "Bermuda" },
- { 64, "bt", "Bhutan" },
- { 68, "bo", "Bolivia" },
- { 70, "ba", "Bosnia & Herzegowina" },
- { 72, "bw", "Botswana" },
- { 74, "bv", "Bouvet Island" },
- { 76, "br", "Brazil" },
- { 86, "io", "British Indian Ocean Territory" },
- { 96, "bn", "Brunei Darussalam" },
- { 100, "bg", "Bulgaria" },
- { 854, "bf", "Burkina Faso" },
- { 108, "bi", "Burundi" },
- { 116, "kh", "Cambodia" },
- { 120, "cm", "Cameroon" },
- { 124, "ca", "Canada" },
- { 132, "cv", "Cape Verde" },
- { 136, "ky", "Cayman Islands" },
- { 140, "cf", "Central African Republic" },
- { 148, "td", "Chad" },
- { 152, "cl", "Chile" },
- { 156, "cn", "China" },
- { 162, "cx", "Christmas Island" },
- { 166, "cc", "Cocos Islands" },
- { 170, "co", "Colombia" },
- { 174, "km", "Comoros" },
- { 178, "cg", "Congo" },
- { 180, "cd", "Congo" },
- { 184, "ck", "Cook Islands" },
- { 188, "cr", "Costa Rica" },
- { 384, "ci", "Cote d'Ivoire" },
- { 191, "hr", "Croatia" },
- { 192, "cu", "Cuba" },
- { 196, "cy", "Cyprus" },
- { 203, "cz", "Czech Republic" },
- { 208, "dk", "Denmark" },
- { 262, "dj", "Djibouti" },
- { 212, "dm", "Dominica" },
- { 214, "do", "Dominican Republic" },
- { 218, "ec", "Ecuador" },
- { 818, "eg", "Egypt" },
- { 222, "sv", "El Salvador" },
- { 226, "gq", "Equatorial Guinea" },
- { 232, "er", "Eritrea" },
- { 233, "ee", "Estonia" },
- { 231, "et", "Ethiopia" },
- { 238, "fk", "Falkland Islands" },
- { 234, "fo", "Faroe Islands" },
- { 242, "fj", "Fiji" },
- { 246, "fi", "Finland" },
- { 250, "fr", "France" },
- { 249, "fx", "France, Metropolitan" },
- { 254, "gf", "French Guiana" },
- { 258, "pf", "French Polynesia" },
- { 260, "tf", "French Southern Territories" },
- { 266, "ga", "Gabon" },
- { 270, "gm", "Gambia" },
- { 268, "ge", "Georgia" },
- { 276, "de", "Germany" },
- { 288, "gh", "Ghana" },
- { 292, "gi", "Gibraltar" },
- { 300, "gr", "Greece" },
- { 304, "gl", "Greenland" },
- { 308, "gd", "Grenada" },
- { 312, "gp", "Guadeloupe" },
- { 316, "gu", "Guam" },
- { 320, "gt", "Guatemala" },
- { 324, "gn", "Guinea" },
- { 624, "gw", "Guinea-Bissau" },
- { 328, "gy", "Guyana" },
- { 332, "ht", "Haiti" },
- { 334, "hm", "Heard & Mc Donald Islands" },
- { 336, "va", "Vatican City" },
- { 340, "hn", "Honduras" },
- { 344, "hk", "Hong kong" },
- { 348, "hu", "Hungary" },
- { 352, "is", "Iceland" },
- { 356, "in", "India" },
- { 360, "id", "Indonesia" },
- { 364, "ir", "Iran" },
- { 368, "iq", "Iraq" },
- { 372, "ie", "Ireland" },
- { 376, "il", "Israel" },
- { 380, "it", "Italy" },
- { 388, "jm", "Jamaica" },
- { 392, "jp", "Japan" },
- { 400, "jo", "Jordan" },
- { 398, "kz", "Kazakhstan" },
- { 404, "ke", "Kenya" },
- { 296, "ki", "Kiribati" },
- { 408, "kp", "Korea (north)" },
- { 410, "kr", "Korea (south)" },
- { 414, "kw", "Kuwait" },
- { 417, "kg", "Kyrgyzstan" },
- { 418, "la", "Laos" },
- { 428, "lv", "Latvia" },
- { 422, "lb", "Lebanon" },
- { 426, "ls", "Lesotho" },
- { 430, "lr", "Liberia" },
- { 434, "ly", "Libya" },
- { 438, "li", "Liechtenstein" },
- { 440, "lt", "Lithuania" },
- { 442, "lu", "Luxembourg" },
- { 446, "mo", "Macao" },
- { 807, "mk", "Macedonia" },
- { 450, "mg", "Madagascar" },
- { 454, "mw", "Malawi" },
- { 458, "my", "Malaysia" },
- { 462, "mv", "Maldives" },
- { 466, "ml", "Mali" },
- { 470, "mt", "Malta" },
- { 584, "mh", "Marshall Islands" },
- { 474, "mq", "Martinique" },
- { 478, "mr", "Mauritania" },
- { 480, "mu", "Mauritius" },
- { 175, "yt", "Mayotte" },
- { 484, "mx", "Mexico" },
- { 583, "fm", "Micronesia" },
- { 498, "md", "Moldova" },
- { 492, "mc", "Monaco" },
- { 496, "mn", "Mongolia" },
- { 500, "ms", "Montserrat" },
- { 504, "ma", "Morocco" },
- { 508, "mz", "Mozambique" },
- { 104, "mm", "Myanmar" },
- { 516, "na", "Namibia" },
- { 520, "nr", "Nauru" },
- { 524, "np", "Nepal" },
- { 528, "nl", "Netherlands" },
- { 530, "an", "Netherlands Antilles" },
- { 540, "nc", "New Caledonia" },
- { 554, "nz", "New Zealand" },
- { 558, "ni", "Nicaragua" },
- { 562, "ne", "Niger" },
- { 566, "ng", "Nigeria" },
- { 570, "nu", "Niue" },
- { 574, "nf", "Norfolk Island" },
- { 580, "mp", "Northern Mariana Islands" },
- { 578, "no", "Norway" },
- { 512, "om", "Oman" },
- { 586, "pk", "Pakistan" },
- { 585, "pw", "Palau" },
- { 275, "ps", "Palestinian Territory" },
- { 591, "pa", "Panama" },
- { 598, "pg", "Papua New Guinea" },
- { 600, "py", "Paraguay" },
- { 604, "pe", "Peru" },
- { 608, "ph", "Philippines" },
- { 612, "pn", "Pitcairn" },
- { 616, "pl", "Poland" },
- { 620, "pt", "Portugal" },
- { 630, "pr", "Puerto Rico" },
- { 634, "qa", "Qatar" },
- { 638, "re", "Reunion" },
- { 642, "ro", "Romania" },
- { 643, "ru", "Russia" },
- { 646, "rw", "Rwanda" },
- { 659, "kn", "Saint Kitts & Nevis" },
- { 662, "lc", "Saint Lucia" },
- { 670, "vc", "Saint Vincent" },
- { 882, "ws", "Samoa" },
- { 674, "sm", "San Marino" },
- { 678, "st", "Sao Tome & Principe" },
- { 682, "sa", "Saudi Arabia" },
- { 686, "sn", "Senegal" },
- { 891, "cs", "Serbia and Montenegro" },
- { 690, "sc", "Seychelles" },
- { 694, "sl", "Sierra Leone" },
- { 702, "sg", "Singapore" },
- { 703, "sk", "Slovakia" },
- { 705, "si", "Slovenia" },
- { 90, "sb", "Solomon Islands" },
- { 706, "so", "Somalia" },
- { 710, "za", "South Africa" },
- { 239, "gs", "South Georgia" },
- { 724, "es", "Spain" },
- { 144, "lk", "Sri Lanka" },
- { 654, "sh", "St. Helena" },
- { 666, "pm", "St. Pierre & Miquelon" },
- { 736, "sd", "Sudan" },
- { 740, "sr", "Suriname" },
- { 744, "sj", "Svalbard & Jan Mayen Islands" },
- { 748, "sz", "Swaziland" },
- { 752, "se", "Sweden" },
- { 756, "ch", "Switzerland" },
- { 760, "sy", "Syrian Arab Republic" },
- { 626, "tl", "Timor-Leste" },
- { 158, "tw", "Taiwan" },
- { 762, "tj", "Tajikistan" },
- { 834, "tz", "Tanzania" },
- { 764, "th", "Thailand" },
- { 768, "tg", "Togo" },
- { 772, "tk", "Tokelau" },
- { 776, "to", "Tonga" },
- { 780, "tt", "Trinidad & Tobago" },
- { 788, "tn", "Tunisia" },
- { 792, "tr", "Turkey" },
- { 795, "tm", "Turkmenistan" },
- { 796, "tc", "Turks & Caicos Islands" },
- { 798, "tv", "Tuvalu" },
- { 800, "ug", "Uganda" },
- { 804, "ua", "Ukraine" },
- { 784, "ae", "United Arab Emirates" },
- { 826, "gb", "United Kingdom" },
- { 840, "us", "United States" },
- { 581, "um", "United States Minor Outlying Islands" },
- { 858, "uy", "Uruguay" },
- { 860, "uz", "Uzbekistan" },
- { 548, "vu", "Vanuatu" },
- { 862, "ve", "Venezuela" },
- { 704, "vn", "Vietnam" },
- { 92, "vg", "Virgin Islands (British)" },
- { 850, "vi", "Virgin Islands (US)" },
- { 876, "wf", "Wallis & Futuna Islands" },
- { 732, "eh", "Western Sahara" },
- { 887, "ye", "Yemen" },
- { 894, "zm", "Zambia" },
- { 716, "zw", "Zimbabwe" }
- };
-
-/*
- * Check if start of 'str' is simply an IPv4 address.
- */
-#define BYTE_OK(x) ((x) >= 0 && (x) <= 255)
-
-static int is_addr(char *str, char **end)
-{
- int a0, a1, a2, a3, num, rc = 0, length = 0;
-
- num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
- if( (num == 4) &&
- BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
- length >= (3+4))
- {
- rc = 1;
- *end = str + length;
- }
- return rc;
-}
-
-/*
- * Find the country-code and name from the CNAME. E.g.:
- * version 1: CNAME = zzno.countries.nerd.dk with address 127.0.2.66
- * yields ccode_A" = "no" and cnumber 578 (2.66).
- * version 2: CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.2.66
- * yields cnumber 578 (2.66). ccode_A is "";
- */
-static void find_country_from_cname(const char *cname, struct in_addr addr)
-{
- const struct search_list *country;
- char ccode_A2[3], *ccopy, *dot_4;
- int cnumber, z0, z1, ver_1, ver_2;
- unsigned long ip;
-
- ip = ntohl(addr.s_addr);
- z0 = TOLOWER(cname[0]);
- z1 = TOLOWER(cname[1]);
- ccopy = strdup(cname);
- dot_4 = NULL;
-
- ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
- ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
-
- if (ver_1)
- {
- const char *dot = strchr(cname, '.');
- if (dot != cname+4)
- {
- printf("Unexpected CNAME %s (ver_1)\n", cname);
- free(ccopy);
- return;
- }
- }
- else if (ver_2)
- {
- z0 = TOLOWER(dot_4[1]);
- z1 = TOLOWER(dot_4[2]);
- if (z0 != 'z' && z1 != 'z')
- {
- printf("Unexpected CNAME %s (ver_2)\n", cname);
- free(ccopy);
- return;
- }
- }
- else
- {
- printf("Unexpected CNAME %s (ver?)\n", cname);
- free(ccopy);
- return;
- }
-
- if (ver_1)
- {
- ccode_A2[0] = (char)TOLOWER(cname[2]);
- ccode_A2[1] = (char)TOLOWER(cname[3]);
- ccode_A2[2] = '\0';
- }
- else
- ccode_A2[0] = '\0';
-
- cnumber = ip & 0xFFFF;
-
- TRACE(("Found country-code `%s', number %d\n",
- ver_1 ? ccode_A2 : "<n/a>", cnumber));
-
- country = list_lookup(cnumber, country_list,
- sizeof(country_list) / sizeof(country_list[0]));
- if (!country)
- printf("Name for country-number %d not found.\n", cnumber);
- else
- {
- if (ver_1)
- {
- if ((country->short_name[0] != ccode_A2[0]) ||
- (country->short_name[1] != ccode_A2[1]) ||
- (country->short_name[2] != ccode_A2[2]))
- printf("short-name mismatch; %s vs %s\n",
- country->short_name, ccode_A2);
- }
- printf("%s (%s), number %d.\n",
- country->long_name, country->short_name, cnumber);
- }
- free(ccopy);
-}
diff --git a/grpc/third_party/cares/cares/adig.1 b/grpc/third_party/cares/cares/adig.1
deleted file mode 100644
index 76e96891..00000000
--- a/grpc/third_party/cares/cares/adig.1
+++ /dev/null
@@ -1,71 +0,0 @@
-.TH ADIG "1" "April 2011" "c-ares utilities"
-.SH NAME
-adig \- print information collected from Domain Name System (DNS) servers
-.SH SYNOPSIS
-.B adig
-[\fIOPTION\fR]... \fINAME\fR...
-.SH DESCRIPTION
-.PP
-.\" Add any additional description here
-.PP
-Send queries to DNS servers about \fINAME\fR and print received
-information, where \fINAME\fR is a valid DNS name (e.g. www.example.com,
-1.2.3.10.in-addr.arpa).
-.PP
-This utility comes with the \fBc\-ares\fR asynchronous resolver library.
-.SH OPTIONS
-.TP
-\fB\-c\fR class
-Set the query class.
-Possible values for class are
-NY, CHAOS, HS, IN (default).
-.TP
-\fB\-d\fR
-Print some extra debugging output.
-.TP
-\fB\-f\fR flag
-Add a flag.
-Possible values for flag are
-igntc, noaliases, norecurse, primary, stayopen, usevc.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Display this help and exit.
-.TP
-\fB\-T\fR port
-Use specified TCP port to connect to DNS server.
-.TP
-\fB\-s\fR server
-Connect to specified DNS server, instead of the system's default one(s).
-.TP
-\fB\-t\fR type
-Query records of specified type.
-Possible values for type are
-A (default), AAAA, AFSDB, ANY, AXFR, CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA,
-MAILB, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL,
-PTR, PX, RP, RT, SIG, SOA, SRV, TXT, WKS, X25,
-.TP
-\fB\-U\fR port
-Use specified UDP port to connect to DNS server.
-.SH "REPORTING BUGS"
-Report bugs to the c-ares mailing list:
-\fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR
-.SH "SEE ALSO"
-.PP
-acountry(1), ahost(1).
-.SH COPYRIGHT
-This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
-carrying the following notice:
-.br
-Copyright 1998 by the Massachusetts Institute of Technology.
-.br
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of M.I.T. not be used in
-advertising or publicity pertaining to distribution of the software
-without specific, written prior permission. M.I.T. makes no
-representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
-.br
-No further copyright claims are being made by the author(s) of this utility.
diff --git a/grpc/third_party/cares/cares/adig.c b/grpc/third_party/cares/cares/adig.c
deleted file mode 100644
index e112dc04..00000000
--- a/grpc/third_party/cares/cares/adig.c
+++ /dev/null
@@ -1,827 +0,0 @@
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_getopt.h"
-#include "ares_nowarn.h"
-
-#ifndef HAVE_STRDUP
-# include "ares_strdup.h"
-# define strdup(ptr) ares_strdup(ptr)
-#endif
-
-#ifndef HAVE_STRCASECMP
-# include "ares_strcasecmp.h"
-# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
-#endif
-
-#ifndef HAVE_STRNCASECMP
-# include "ares_strcasecmp.h"
-# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
-#endif
-
-#ifdef WATT32
-#undef WIN32 /* Redefined in MingW headers */
-#endif
-
-#ifndef T_SRV
-# define T_SRV 33 /* Server selection */
-#endif
-#ifndef T_NAPTR
-# define T_NAPTR 35 /* Naming authority pointer */
-#endif
-#ifndef T_DS
-# define T_DS 43 /* Delegation Signer (RFC4034) */
-#endif
-#ifndef T_SSHFP
-# define T_SSHFP 44 /* SSH Key Fingerprint (RFC4255) */
-#endif
-#ifndef T_RRSIG
-# define T_RRSIG 46 /* Resource Record Signature (RFC4034) */
-#endif
-#ifndef T_NSEC
-# define T_NSEC 47 /* Next Secure (RFC4034) */
-#endif
-#ifndef T_DNSKEY
-# define T_DNSKEY 48 /* DNS Public Key (RFC4034) */
-#endif
-
-struct nv {
- const char *name;
- int value;
-};
-
-static const struct nv flags[] = {
- { "usevc", ARES_FLAG_USEVC },
- { "primary", ARES_FLAG_PRIMARY },
- { "igntc", ARES_FLAG_IGNTC },
- { "norecurse", ARES_FLAG_NORECURSE },
- { "stayopen", ARES_FLAG_STAYOPEN },
- { "noaliases", ARES_FLAG_NOALIASES }
-};
-static const int nflags = sizeof(flags) / sizeof(flags[0]);
-
-static const struct nv classes[] = {
- { "IN", C_IN },
- { "CHAOS", C_CHAOS },
- { "HS", C_HS },
- { "ANY", C_ANY }
-};
-static const int nclasses = sizeof(classes) / sizeof(classes[0]);
-
-static const struct nv types[] = {
- { "A", T_A },
- { "NS", T_NS },
- { "MD", T_MD },
- { "MF", T_MF },
- { "CNAME", T_CNAME },
- { "SOA", T_SOA },
- { "MB", T_MB },
- { "MG", T_MG },
- { "MR", T_MR },
- { "NULL", T_NULL },
- { "WKS", T_WKS },
- { "PTR", T_PTR },
- { "HINFO", T_HINFO },
- { "MINFO", T_MINFO },
- { "MX", T_MX },
- { "TXT", T_TXT },
- { "RP", T_RP },
- { "AFSDB", T_AFSDB },
- { "X25", T_X25 },
- { "ISDN", T_ISDN },
- { "RT", T_RT },
- { "NSAP", T_NSAP },
- { "NSAP_PTR", T_NSAP_PTR },
- { "SIG", T_SIG },
- { "KEY", T_KEY },
- { "PX", T_PX },
- { "GPOS", T_GPOS },
- { "AAAA", T_AAAA },
- { "LOC", T_LOC },
- { "SRV", T_SRV },
- { "AXFR", T_AXFR },
- { "MAILB", T_MAILB },
- { "MAILA", T_MAILA },
- { "NAPTR", T_NAPTR },
- { "DS", T_DS },
- { "SSHFP", T_SSHFP },
- { "RRSIG", T_RRSIG },
- { "NSEC", T_NSEC },
- { "DNSKEY", T_DNSKEY },
- { "ANY", T_ANY }
-};
-static const int ntypes = sizeof(types) / sizeof(types[0]);
-
-static const char *opcodes[] = {
- "QUERY", "IQUERY", "STATUS", "(reserved)", "NOTIFY",
- "(unknown)", "(unknown)", "(unknown)", "(unknown)",
- "UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
- "ZONEINIT", "ZONEREF"
-};
-
-static const char *rcodes[] = {
- "NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
- "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)",
- "(unknown)", "(unknown)", "(unknown)", "(unknown)", "NOCHANGE"
-};
-
-static void callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen);
-static const unsigned char *display_question(const unsigned char *aptr,
- const unsigned char *abuf,
- int alen);
-static const unsigned char *display_rr(const unsigned char *aptr,
- const unsigned char *abuf, int alen);
-static const char *type_name(int type);
-static const char *class_name(int dnsclass);
-static void usage(void);
-static void destroy_addr_list(struct ares_addr_node *head);
-static void append_addr_list(struct ares_addr_node **head,
- struct ares_addr_node *node);
-
-int main(int argc, char **argv)
-{
- ares_channel channel;
- int c, i, optmask = ARES_OPT_FLAGS, dnsclass = C_IN, type = T_A;
- int status, nfds, count;
- struct ares_options options;
- struct hostent *hostent;
- fd_set read_fds, write_fds;
- struct timeval *tvp, tv;
- struct ares_addr_node *srvr, *servers = NULL;
-
-#ifdef USE_WINSOCK
- WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
- WSADATA wsaData;
- WSAStartup(wVersionRequested, &wsaData);
-#endif
-
- status = ares_library_init(ARES_LIB_INIT_ALL);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
- return 1;
- }
-
- options.flags = ARES_FLAG_NOCHECKRESP;
- options.servers = NULL;
- options.nservers = 0;
- while ((c = ares_getopt(argc, argv, "df:s:c:t:T:U:")) != -1)
- {
- switch (c)
- {
- case 'd':
-#ifdef WATT32
- dbug_init();
-#endif
- break;
-
- case 'f':
- /* Add a flag. */
- for (i = 0; i < nflags; i++)
- {
- if (strcmp(flags[i].name, optarg) == 0)
- break;
- }
- if (i < nflags)
- options.flags |= flags[i].value;
- else
- usage();
- break;
-
- case 's':
- /* User-specified name servers override default ones. */
- srvr = malloc(sizeof(struct ares_addr_node));
- if (!srvr)
- {
- fprintf(stderr, "Out of memory!\n");
- destroy_addr_list(servers);
- return 1;
- }
- append_addr_list(&servers, srvr);
- if (ares_inet_pton(AF_INET, optarg, &srvr->addr.addr4) > 0)
- srvr->family = AF_INET;
- else if (ares_inet_pton(AF_INET6, optarg, &srvr->addr.addr6) > 0)
- srvr->family = AF_INET6;
- else
- {
- hostent = gethostbyname(optarg);
- if (!hostent)
- {
- fprintf(stderr, "adig: server %s not found.\n", optarg);
- destroy_addr_list(servers);
- return 1;
- }
- switch (hostent->h_addrtype)
- {
- case AF_INET:
- srvr->family = AF_INET;
- memcpy(&srvr->addr.addr4, hostent->h_addr,
- sizeof(srvr->addr.addr4));
- break;
- case AF_INET6:
- srvr->family = AF_INET6;
- memcpy(&srvr->addr.addr6, hostent->h_addr,
- sizeof(srvr->addr.addr6));
- break;
- default:
- fprintf(stderr,
- "adig: server %s unsupported address family.\n", optarg);
- destroy_addr_list(servers);
- return 1;
- }
- }
- /* Notice that calling ares_init_options() without servers in the
- * options struct and with ARES_OPT_SERVERS set simultaneously in
- * the options mask, results in an initialization with no servers.
- * When alternative name servers have been specified these are set
- * later calling ares_set_servers() overriding any existing server
- * configuration. To prevent initial configuration with default
- * servers that will be discarded later, ARES_OPT_SERVERS is set.
- * If this flag is not set here the result shall be the same but
- * ares_init_options() will do needless work. */
- optmask |= ARES_OPT_SERVERS;
- break;
-
- case 'c':
- /* Set the query class. */
- for (i = 0; i < nclasses; i++)
- {
- if (strcasecmp(classes[i].name, optarg) == 0)
- break;
- }
- if (i < nclasses)
- dnsclass = classes[i].value;
- else
- usage();
- break;
-
- case 't':
- /* Set the query type. */
- for (i = 0; i < ntypes; i++)
- {
- if (strcasecmp(types[i].name, optarg) == 0)
- break;
- }
- if (i < ntypes)
- type = types[i].value;
- else
- usage();
- break;
-
- case 'T':
- /* Set the TCP port number. */
- if (!ISDIGIT(*optarg))
- usage();
- options.tcp_port = (unsigned short)strtol(optarg, NULL, 0);
- optmask |= ARES_OPT_TCP_PORT;
- break;
-
- case 'U':
- /* Set the UDP port number. */
- if (!ISDIGIT(*optarg))
- usage();
- options.udp_port = (unsigned short)strtol(optarg, NULL, 0);
- optmask |= ARES_OPT_UDP_PORT;
- break;
- }
- }
- argc -= optind;
- argv += optind;
- if (argc == 0)
- usage();
-
- status = ares_init_options(&channel, &options, optmask);
-
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_init_options: %s\n",
- ares_strerror(status));
- return 1;
- }
-
- if(servers)
- {
- status = ares_set_servers(channel, servers);
- destroy_addr_list(servers);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_init_options: %s\n",
- ares_strerror(status));
- return 1;
- }
- }
-
- /* Initiate the queries, one per command-line argument. If there is
- * only one query to do, supply NULL as the callback argument;
- * otherwise, supply the query name as an argument so we can
- * distinguish responses for the user when printing them out.
- */
- if (argc == 1)
- ares_query(channel, *argv, dnsclass, type, callback, (char *) NULL);
- else
- {
- for (; *argv; argv++)
- ares_query(channel, *argv, dnsclass, type, callback, *argv);
- }
-
- /* Wait for all queries to complete. */
- for (;;)
- {
- FD_ZERO(&read_fds);
- FD_ZERO(&write_fds);
- nfds = ares_fds(channel, &read_fds, &write_fds);
- if (nfds == 0)
- break;
- tvp = ares_timeout(channel, NULL, &tv);
- count = select(nfds, &read_fds, &write_fds, NULL, tvp);
- if (count < 0 && (status = SOCKERRNO) != EINVAL)
- {
- printf("select fail: %d", status);
- return 1;
- }
- ares_process(channel, &read_fds, &write_fds);
- }
-
- ares_destroy(channel);
-
- ares_library_cleanup();
-
-#ifdef USE_WINSOCK
- WSACleanup();
-#endif
-
- return 0;
-}
-
-static void callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen)
-{
- char *name = (char *) arg;
- int id, qr, opcode, aa, tc, rd, ra, rcode;
- unsigned int qdcount, ancount, nscount, arcount, i;
- const unsigned char *aptr;
-
- (void) timeouts;
-
- /* Display the query name if given. */
- if (name)
- printf("Answer for query %s:\n", name);
-
- /* Display an error message if there was an error, but only stop if
- * we actually didn't get an answer buffer.
- */
- if (status != ARES_SUCCESS)
- {
- printf("%s\n", ares_strerror(status));
- if (!abuf)
- return;
- }
-
- /* Won't happen, but check anyway, for safety. */
- if (alen < HFIXEDSZ)
- return;
-
- /* Parse the answer header. */
- id = DNS_HEADER_QID(abuf);
- qr = DNS_HEADER_QR(abuf);
- opcode = DNS_HEADER_OPCODE(abuf);
- aa = DNS_HEADER_AA(abuf);
- tc = DNS_HEADER_TC(abuf);
- rd = DNS_HEADER_RD(abuf);
- ra = DNS_HEADER_RA(abuf);
- rcode = DNS_HEADER_RCODE(abuf);
- qdcount = DNS_HEADER_QDCOUNT(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
- nscount = DNS_HEADER_NSCOUNT(abuf);
- arcount = DNS_HEADER_ARCOUNT(abuf);
-
- /* Display the answer header. */
- printf("id: %d\n", id);
- printf("flags: %s%s%s%s%s\n",
- qr ? "qr " : "",
- aa ? "aa " : "",
- tc ? "tc " : "",
- rd ? "rd " : "",
- ra ? "ra " : "");
- printf("opcode: %s\n", opcodes[opcode]);
- printf("rcode: %s\n", rcodes[rcode]);
-
- /* Display the questions. */
- printf("Questions:\n");
- aptr = abuf + HFIXEDSZ;
- for (i = 0; i < qdcount; i++)
- {
- aptr = display_question(aptr, abuf, alen);
- if (aptr == NULL)
- return;
- }
-
- /* Display the answers. */
- printf("Answers:\n");
- for (i = 0; i < ancount; i++)
- {
- aptr = display_rr(aptr, abuf, alen);
- if (aptr == NULL)
- return;
- }
-
- /* Display the NS records. */
- printf("NS records:\n");
- for (i = 0; i < nscount; i++)
- {
- aptr = display_rr(aptr, abuf, alen);
- if (aptr == NULL)
- return;
- }
-
- /* Display the additional records. */
- printf("Additional records:\n");
- for (i = 0; i < arcount; i++)
- {
- aptr = display_rr(aptr, abuf, alen);
- if (aptr == NULL)
- return;
- }
-}
-
-static const unsigned char *display_question(const unsigned char *aptr,
- const unsigned char *abuf,
- int alen)
-{
- char *name;
- int type, dnsclass, status;
- long len;
-
- /* Parse the question name. */
- status = ares_expand_name(aptr, abuf, alen, &name, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- aptr += len;
-
- /* Make sure there's enough data after the name for the fixed part
- * of the question.
- */
- if (aptr + QFIXEDSZ > abuf + alen)
- {
- ares_free_string(name);
- return NULL;
- }
-
- /* Parse the question type and class. */
- type = DNS_QUESTION_TYPE(aptr);
- dnsclass = DNS_QUESTION_CLASS(aptr);
- aptr += QFIXEDSZ;
-
- /* Display the question, in a format sort of similar to how we will
- * display RRs.
- */
- printf("\t%-15s.\t", name);
- if (dnsclass != C_IN)
- printf("\t%s", class_name(dnsclass));
- printf("\t%s\n", type_name(type));
- ares_free_string(name);
- return aptr;
-}
-
-static const unsigned char *display_rr(const unsigned char *aptr,
- const unsigned char *abuf, int alen)
-{
- const unsigned char *p;
- int type, dnsclass, ttl, dlen, status;
- long len;
- char addr[46];
- union {
- unsigned char * as_uchar;
- char * as_char;
- } name;
-
- /* Parse the RR name. */
- status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- aptr += len;
-
- /* Make sure there is enough data after the RR name for the fixed
- * part of the RR.
- */
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- ares_free_string(name.as_char);
- return NULL;
- }
-
- /* Parse the fixed part of the RR, and advance to the RR data
- * field. */
- type = DNS_RR_TYPE(aptr);
- dnsclass = DNS_RR_CLASS(aptr);
- ttl = DNS_RR_TTL(aptr);
- dlen = DNS_RR_LEN(aptr);
- aptr += RRFIXEDSZ;
- if (aptr + dlen > abuf + alen)
- {
- ares_free_string(name.as_char);
- return NULL;
- }
-
- /* Display the RR name, class, and type. */
- printf("\t%-15s.\t%d", name.as_char, ttl);
- if (dnsclass != C_IN)
- printf("\t%s", class_name(dnsclass));
- printf("\t%s", type_name(type));
- ares_free_string(name.as_char);
-
- /* Display the RR data. Don't touch aptr. */
- switch (type)
- {
- case T_CNAME:
- case T_MB:
- case T_MD:
- case T_MF:
- case T_MG:
- case T_MR:
- case T_NS:
- case T_PTR:
- /* For these types, the RR data is just a domain name. */
- status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_HINFO:
- /* The RR data is two length-counted character strings. */
- p = aptr;
- len = *p;
- if (p + len + 1 > aptr + dlen)
- return NULL;
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s", name.as_char);
- ares_free_string(name.as_char);
- p += len;
- len = *p;
- if (p + len + 1 > aptr + dlen)
- return NULL;
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_MINFO:
- /* The RR data is two domain names. */
- p = aptr;
- status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.", name.as_char);
- ares_free_string(name.as_char);
- p += len;
- status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_MX:
- /* The RR data is two bytes giving a preference ordering, and
- * then a domain name.
- */
- if (dlen < 2)
- return NULL;
- printf("\t%d", (int)DNS__16BIT(aptr));
- status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_SOA:
- /* The RR data is two domain names and then five four-byte
- * numbers giving the serial number and some timeouts.
- */
- p = aptr;
- status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.\n", name.as_char);
- ares_free_string(name.as_char);
- p += len;
- status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t\t\t\t\t\t%s.\n", name.as_char);
- ares_free_string(name.as_char);
- p += len;
- if (p + 20 > aptr + dlen)
- return NULL;
- printf("\t\t\t\t\t\t( %u %u %u %u %u )",
- DNS__32BIT(p), DNS__32BIT(p+4),
- DNS__32BIT(p+8), DNS__32BIT(p+12),
- DNS__32BIT(p+16));
- break;
-
- case T_TXT:
- /* The RR data is one or more length-counted character
- * strings. */
- p = aptr;
- while (p < aptr + dlen)
- {
- len = *p;
- if (p + len + 1 > aptr + dlen)
- return NULL;
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s", name.as_char);
- ares_free_string(name.as_char);
- p += len;
- }
- break;
-
- case T_A:
- /* The RR data is a four-byte Internet address. */
- if (dlen != 4)
- return NULL;
- printf("\t%s", ares_inet_ntop(AF_INET,aptr,addr,sizeof(addr)));
- break;
-
- case T_AAAA:
- /* The RR data is a 16-byte IPv6 address. */
- if (dlen != 16)
- return NULL;
- printf("\t%s", ares_inet_ntop(AF_INET6,aptr,addr,sizeof(addr)));
- break;
-
- case T_WKS:
- /* Not implemented yet */
- break;
-
- case T_SRV:
- /* The RR data is three two-byte numbers representing the
- * priority, weight, and port, followed by a domain name.
- */
-
- printf("\t%d", (int)DNS__16BIT(aptr));
- printf(" %d", (int)DNS__16BIT(aptr + 2));
- printf(" %d", (int)DNS__16BIT(aptr + 4));
-
- status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t%s.", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_NAPTR:
-
- printf("\t%d", (int)DNS__16BIT(aptr)); /* order */
- printf(" %d\n", (int)DNS__16BIT(aptr + 2)); /* preference */
-
- p = aptr + 4;
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t\t\t\t\t\t%s\n", name.as_char);
- ares_free_string(name.as_char);
- p += len;
-
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t\t\t\t\t\t%s\n", name.as_char);
- ares_free_string(name.as_char);
- p += len;
-
- status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t\t\t\t\t\t%s\n", name.as_char);
- ares_free_string(name.as_char);
- p += len;
-
- status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
- if (status != ARES_SUCCESS)
- return NULL;
- printf("\t\t\t\t\t\t%s", name.as_char);
- ares_free_string(name.as_char);
- break;
-
- case T_DS:
- case T_SSHFP:
- case T_RRSIG:
- case T_NSEC:
- case T_DNSKEY:
- printf("\t[RR type parsing unavailable]");
- break;
-
- default:
- printf("\t[Unknown RR; cannot parse]");
- break;
- }
- printf("\n");
-
- return aptr + dlen;
-}
-
-static const char *type_name(int type)
-{
- int i;
-
- for (i = 0; i < ntypes; i++)
- {
- if (types[i].value == type)
- return types[i].name;
- }
- return "(unknown)";
-}
-
-static const char *class_name(int dnsclass)
-{
- int i;
-
- for (i = 0; i < nclasses; i++)
- {
- if (classes[i].value == dnsclass)
- return classes[i].name;
- }
- return "(unknown)";
-}
-
-static void usage(void)
-{
- fprintf(stderr, "usage: adig [-f flag] [-s server] [-c class] "
- "[-t type] [-p port] name ...\n");
- exit(1);
-}
-
-static void destroy_addr_list(struct ares_addr_node *head)
-{
- while(head)
- {
- struct ares_addr_node *detached = head;
- head = head->next;
- free(detached);
- }
-}
-
-static void append_addr_list(struct ares_addr_node **head,
- struct ares_addr_node *node)
-{
- struct ares_addr_node *last;
- node->next = NULL;
- if(*head)
- {
- last = *head;
- while(last->next)
- last = last->next;
- last->next = node;
- }
- else
- *head = node;
-}
diff --git a/grpc/third_party/cares/cares/ahost.1 b/grpc/third_party/cares/cares/ahost.1
deleted file mode 100644
index c83cfcf9..00000000
--- a/grpc/third_party/cares/cares/ahost.1
+++ /dev/null
@@ -1,58 +0,0 @@
-.TH AHOST "1" "April 2011" "c-ares utilities"
-.SH NAME
-ahost \- print the A or AAAA record associated with a hostname or IP address
-.SH SYNOPSIS
-.B ahost
-[\fIOPTION\fR]... \fIHOST\fR...
-.SH DESCRIPTION
-.PP
-.\" Add any additional description here
-.PP
-Look up the DNS A or AAAA record associated with HOST (a hostname or an
-IP address).
-.PP
-This utility comes with the \fBc\-ares\fR asynchronous resolver library.
-.SH OPTIONS
-.TP
-\fB\-d\fR
-Print some extra debugging output.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Display this help and exit.
-.TP
-\fB\-t\fR type
-If type is "a", print the A record (default).
-If type is "aaaa", print the AAAA record.
-If type is "u", look for either AAAA or A record (in that order).
-.TP
-\fB\-s\fR \fIdomain\fP
-Specify the \fIdomain\fP to search instead of using the default values from
-.br
-/etc/resolv.conf. This option only has an effect on platforms that use
-.br
-/etc/resolv.conf
-for DNS configuration; it has no effect on other platforms (such as Win32
-or Android).
-.SH "REPORTING BUGS"
-Report bugs to the c-ares mailing list:
-\fBhttp://cool.haxx.se/mailman/listinfo/c-ares\fR
-.SH "SEE ALSO"
-.PP
-acountry(1), adig(1).
-.SH COPYRIGHT
-This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
-carrying the following notice:
-.br
-Copyright 1998 by the Massachusetts Institute of Technology.
-.br
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of M.I.T. not be used in
-advertising or publicity pertaining to distribution of the software
-without specific, written prior permission. M.I.T. makes no
-representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
-.br
-No further copyright claims are being made by the author(s) of this utility.
diff --git a/grpc/third_party/cares/cares/ahost.c b/grpc/third_party/cares/cares/ahost.c
deleted file mode 100644
index 7fbfd641..00000000
--- a/grpc/third_party/cares/cares/ahost.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#if !defined(WIN32) || defined(WATT32)
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_getopt.h"
-#include "ares_ipv6.h"
-#include "ares_nowarn.h"
-
-#ifndef HAVE_STRDUP
-# include "ares_strdup.h"
-# define strdup(ptr) ares_strdup(ptr)
-#endif
-
-#ifndef HAVE_STRCASECMP
-# include "ares_strcasecmp.h"
-# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
-#endif
-
-#ifndef HAVE_STRNCASECMP
-# include "ares_strcasecmp.h"
-# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
-#endif
-
-static void callback(void *arg, int status, int timeouts, struct hostent *host);
-static void usage(void);
-
-int main(int argc, char **argv)
-{
- struct ares_options options;
- int optmask = 0;
- ares_channel channel;
- int status, nfds, c, addr_family = AF_INET;
- fd_set read_fds, write_fds;
- struct timeval *tvp, tv;
- struct in_addr addr4;
- struct ares_in6_addr addr6;
-
-#ifdef USE_WINSOCK
- WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
- WSADATA wsaData;
- WSAStartup(wVersionRequested, &wsaData);
-#endif
-
- memset(&options, 0, sizeof(options));
-
- status = ares_library_init(ARES_LIB_INIT_ALL);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
- return 1;
- }
-
- while ((c = ares_getopt(argc,argv,"dt:hs:")) != -1)
- {
- switch (c)
- {
- case 'd':
-#ifdef WATT32
- dbug_init();
-#endif
- break;
- case 's':
- optmask |= ARES_OPT_DOMAINS;
- options.ndomains++;
- options.domains = (char **)realloc(options.domains,
- options.ndomains * sizeof(char *));
- options.domains[options.ndomains - 1] = strdup(optarg);
- break;
- case 't':
- if (!strcasecmp(optarg,"a"))
- addr_family = AF_INET;
- else if (!strcasecmp(optarg,"aaaa"))
- addr_family = AF_INET6;
- else if (!strcasecmp(optarg,"u"))
- addr_family = AF_UNSPEC;
- else
- usage();
- break;
- case 'h':
- default:
- usage();
- break;
- }
- }
-
- argc -= optind;
- argv += optind;
- if (argc < 1)
- usage();
-
- status = ares_init_options(&channel, &options, optmask);
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
- return 1;
- }
-
- /* Initiate the queries, one per command-line argument. */
- for ( ; *argv; argv++)
- {
- if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
- {
- ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback,
- *argv);
- }
- else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1)
- {
- ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback,
- *argv);
- }
- else
- {
- ares_gethostbyname(channel, *argv, addr_family, callback, *argv);
- }
- }
-
- /* Wait for all queries to complete. */
- for (;;)
- {
- int res;
- FD_ZERO(&read_fds);
- FD_ZERO(&write_fds);
- nfds = ares_fds(channel, &read_fds, &write_fds);
- if (nfds == 0)
- break;
- tvp = ares_timeout(channel, NULL, &tv);
- res = select(nfds, &read_fds, &write_fds, NULL, tvp);
- if (-1 == res)
- break;
- ares_process(channel, &read_fds, &write_fds);
- }
-
- ares_destroy(channel);
-
- ares_library_cleanup();
-
-#ifdef USE_WINSOCK
- WSACleanup();
-#endif
-
- return 0;
-}
-
-static void callback(void *arg, int status, int timeouts, struct hostent *host)
-{
- char **p;
-
- (void)timeouts;
-
- if (status != ARES_SUCCESS)
- {
- fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
- return;
- }
-
- for (p = host->h_addr_list; *p; p++)
- {
- char addr_buf[46] = "??";
-
- ares_inet_ntop(host->h_addrtype, *p, addr_buf, sizeof(addr_buf));
- printf("%-32s\t%s", host->h_name, addr_buf);
-#if 0
- if (host->h_aliases[0])
- {
- int i;
-
- printf (", Aliases: ");
- for (i = 0; host->h_aliases[i]; i++)
- printf("%s ", host->h_aliases[i]);
- }
-#endif
- puts("");
- }
-}
-
-static void usage(void)
-{
- fprintf(stderr, "usage: ahost [-t {a|aaaa|u}] {host|addr} ...\n");
- exit(1);
-}
diff --git a/grpc/third_party/cares/cares/appveyor.yml b/grpc/third_party/cares/cares/appveyor.yml
index fc991d6f..94eebd56 100644
--- a/grpc/third_party/cares/cares/appveyor.yml
+++ b/grpc/third_party/cares/cares/appveyor.yml
@@ -1,15 +1,103 @@
-platform:
- - x64
- - x86
- - mingw
+image: Visual Studio 2015
+
+# Github/Bitbucket only: get source code for one particular commit as zip archive, instead of git clone'ing.
+shallow_clone: true
+
+# Github/Bitbucket only: per-file commit filtering
+skip_commits:
+ files:
+ - .gitignore
+ - '**/*.md'
+ - .travis.yml
+
+# List of build configurations to test.
+configuration:
+ - RelWithDebInfo
+
+# Note: You can set extra cmake args for a particular matrix entry with CMAKE_EXTRA_OPTIONS. For example:
+# CMAKE_EXTRA_OPTIONS: -DOPENSSL_ROOT_DIR=C:/OpenSSL-Win32
+environment:
+ matrix:
+ # MSVC 2015, 32-bit x86 (cmake)
+ - COMPILER: MSVC
+ BUILDTOOL: CMAKE
+ MSVC_SETUP_ARG: x86
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+
+ # MSVC 2015, 64-bit x86 (cmake)
+ - COMPILER: MSVC
+ BUILDTOOL: CMAKE
+ MSVC_SETUP_ARG: x64
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+
+ # MinGW, 32-bit x86 (cmake)
+ - COMPILER: MINGW
+ BUILDTOOL: CMAKE
+ PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
+
+ # MSVC 2015, 32-bit x86 (nmake)
+ - COMPILER: MSVC
+ BUILDTOOL: NMAKE
+ MSVC_SETUP_ARG: x86
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+
+ # MSVC 2015, 64-bit x86 (nmake)
+ - COMPILER: MSVC
+ BUILDTOOL: NMAKE
+ MSVC_SETUP_ARG: x64
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+
+ # MinGW, 32-bit x86 (makefiles)
+ - COMPILER: MINGW
+ BUILDTOOL: MAKE
+ PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
+
+install:
+ - if "%COMPILER%" == "MINGW" rename "C:\Program Files\Git\usr\bin\sh.exe" "sh2.exe"
+
+before_build:
+ # Setup build environment for the selected compiler (not all compilers need to do anything here).
+ # -- Visual Studio --
+ - if "%COMPILER%" == "MSVC" call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
+
build_script:
- - if "%platform%" == "x86" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
- - if "%platform%" == "x64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- - if "%platform%" == "x64" call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
- - if "%platform%" == "mingw" set PATH=%PATH%;C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin
- - copy ares_build.h.dist ares_build.h
- - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 demos ) else ( nmake /f Makefile.msvc )
- - cd test
- - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 ) else ( nmake /f Makefile.msvc vtest )
- - if "%platform%" == "mingw" ( mingw32-make.exe -f Makefile.m32 aresfuzz.exe aresfuzzname.exe dnsdump.exe ) else ( nmake /f Makefile.msvc aresfuzz aresfuzzname dnsdump )
- - if "%platform%" == "mingw" ( .\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa ) else ( .\msvc\arestest\lib-debug\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa )
+ - if "%BUILDTOOL%" == "NMAKE" copy .\include\ares_build.h.dist .\include\ares_build.h
+ - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc
+ - if "%BUILDTOOL%" == "CMAKE" mkdir C:\projects\build-cares
+ - if "%BUILDTOOL%" == "CMAKE" cd C:\projects\build-cares
+ - if "%BUILDTOOL%" == "CMAKE" cmake -GNinja -DCMAKE_BUILD_TYPE=%configuration% -DCMAKE_INSTALL_PREFIX=C:\projects\build-cares\test_install -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON %CMAKE_EXTRA_OPTIONS% %APPVEYOR_BUILD_FOLDER%
+ - if "%BUILDTOOL%" == "CMAKE" ninja install
+ - if "%BUILDTOOL%" == "MAKE" copy .\include\ares_build.h.dist .\include\ares_build.h
+ - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32 demos
+
+test_script:
+ # We can't use powershell for tests due to treating stderr as an error
+ - if "%BUILDTOOL%" == "NMAKE" cd test
+ - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc vtest
+ - if "%BUILDTOOL%" == "NMAKE" nmake /NOLOGO /f .\Makefile.msvc aresfuzz aresfuzzname dnsdump
+ - if "%BUILDTOOL%" == "NMAKE" .\msvc\arestest\lib-debug\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa
+ - if "%BUILDTOOL%" == "MAKE" cd test
+ - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32
+ - if "%BUILDTOOL%" == "MAKE" mingw32-make.exe -f Makefile.m32 aresfuzz.exe aresfuzzname.exe dnsdump.exe
+ - if "%BUILDTOOL%" == "MAKE" .\dnsdump.exe fuzzinput\answer_a fuzzinput\answer_aaaa
+ - if "%BUILDTOOL%" == "CMAKE" cd C:\projects\build-cares\bin
+ - if "%BUILDTOOL%" == "CMAKE" .\adig.exe www.google.com
+ - if "%BUILDTOOL%" == "CMAKE" .\acountry.exe www.google.com
+ - if "%BUILDTOOL%" == "CMAKE" .\ahost.exe www.google.com
+ - if "%BUILDTOOL%" == "CMAKE" .\arestest.exe -4 -v
+# Windows cant do shell expansion
+# - if "%BUILDTOOL%" == "CMAKE" .\aresfuzz.exe %APPVEYOR_BUILD_FOLDER%\test\fuzzinput\*
+# - if "%BUILDTOOL%" == "CMAKE" .\aresfuzzname.exe %APPVEYOR_BUILD_FOLDER%\test\fuzznames\*
+ - if "%BUILDTOOL%" == "CMAKE" .\dnsdump.exe "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_a" "%APPVEYOR_BUILD_FOLDER%\test\fuzzinput\answer_aaaa"
+
+#on_finish:
+# - cd C:\projects\build-cares\test
+# - dir /B *.log > list.txt
+# - cmake -E tar cfv all_tests.zip --format=zip --files-from=list.txt
+# - appveyor PushArtifact all_tests.zip
+# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+# Force build worker to stay open after build is done, so we can RDP into it.
+
+# Enable RDP connections into build worker.
+#init:
+# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
diff --git a/grpc/third_party/cares/cares/ares.h b/grpc/third_party/cares/cares/ares.h
deleted file mode 100644
index 06f60b33..00000000
--- a/grpc/third_party/cares/cares/ares.h
+++ /dev/null
@@ -1,670 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2007-2013 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#ifndef ARES__H
-#define ARES__H
-
-#include "ares_version.h" /* c-ares version defines */
-#include "ares_build.h" /* c-ares build definitions */
-#include "ares_rules.h" /* c-ares rules enforcement */
-
-/*
- * Define WIN32 when build target is Win32 API
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && \
- !defined(WIN32) && !defined(__SYMBIAN32__)
-# define WIN32
-#endif
-
-#include <sys/types.h>
-
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on system that are known to
- require it! */
-#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
- defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
- defined(__QNXNTO__)
-#include <sys/select.h>
-#endif
-#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
-#include <sys/bsdskt.h>
-#endif
-
-#if defined(WATT32)
-# include <netinet/in.h>
-# include <sys/socket.h>
-# include <tcp.h>
-#elif defined(_WIN32_WCE)
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
-# include <winsock.h>
-#elif defined(WIN32)
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
-# include <winsock2.h>
-# include <ws2tcpip.h>
-#else
-# include <sys/socket.h>
-# include <netinet/in.h>
-#endif
-
-#if defined(ANDROID) || defined(__ANDROID__)
-#include <jni.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** c-ares external API function linkage decorations.
-*/
-
-#ifdef CARES_STATICLIB
-# define CARES_EXTERN
-#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
-# if defined(CARES_BUILDING_LIBRARY)
-# define CARES_EXTERN __declspec(dllexport)
-# else
-# define CARES_EXTERN __declspec(dllimport)
-# endif
-#elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
-# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
-#else
-# define CARES_EXTERN
-#endif
-
-
-#define ARES_SUCCESS 0
-
-/* Server error codes (ARES_ENODATA indicates no relevant answer) */
-#define ARES_ENODATA 1
-#define ARES_EFORMERR 2
-#define ARES_ESERVFAIL 3
-#define ARES_ENOTFOUND 4
-#define ARES_ENOTIMP 5
-#define ARES_EREFUSED 6
-
-/* Locally generated error codes */
-#define ARES_EBADQUERY 7
-#define ARES_EBADNAME 8
-#define ARES_EBADFAMILY 9
-#define ARES_EBADRESP 10
-#define ARES_ECONNREFUSED 11
-#define ARES_ETIMEOUT 12
-#define ARES_EOF 13
-#define ARES_EFILE 14
-#define ARES_ENOMEM 15
-#define ARES_EDESTRUCTION 16
-#define ARES_EBADSTR 17
-
-/* ares_getnameinfo error codes */
-#define ARES_EBADFLAGS 18
-
-/* ares_getaddrinfo error codes */
-#define ARES_ENONAME 19
-#define ARES_EBADHINTS 20
-
-/* Uninitialized library error code */
-#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
-
-/* ares_library_init error codes */
-#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
-#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
-
-/* More error codes */
-#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
-
-/* Flag values */
-#define ARES_FLAG_USEVC (1 << 0)
-#define ARES_FLAG_PRIMARY (1 << 1)
-#define ARES_FLAG_IGNTC (1 << 2)
-#define ARES_FLAG_NORECURSE (1 << 3)
-#define ARES_FLAG_STAYOPEN (1 << 4)
-#define ARES_FLAG_NOSEARCH (1 << 5)
-#define ARES_FLAG_NOALIASES (1 << 6)
-#define ARES_FLAG_NOCHECKRESP (1 << 7)
-#define ARES_FLAG_EDNS (1 << 8)
-
-/* Option mask values */
-#define ARES_OPT_FLAGS (1 << 0)
-#define ARES_OPT_TIMEOUT (1 << 1)
-#define ARES_OPT_TRIES (1 << 2)
-#define ARES_OPT_NDOTS (1 << 3)
-#define ARES_OPT_UDP_PORT (1 << 4)
-#define ARES_OPT_TCP_PORT (1 << 5)
-#define ARES_OPT_SERVERS (1 << 6)
-#define ARES_OPT_DOMAINS (1 << 7)
-#define ARES_OPT_LOOKUPS (1 << 8)
-#define ARES_OPT_SOCK_STATE_CB (1 << 9)
-#define ARES_OPT_SORTLIST (1 << 10)
-#define ARES_OPT_SOCK_SNDBUF (1 << 11)
-#define ARES_OPT_SOCK_RCVBUF (1 << 12)
-#define ARES_OPT_TIMEOUTMS (1 << 13)
-#define ARES_OPT_ROTATE (1 << 14)
-#define ARES_OPT_EDNSPSZ (1 << 15)
-#define ARES_OPT_NOROTATE (1 << 16)
-#define ARES_OPT_RESOLVCONF (1 << 17)
-
-/* Nameinfo flag values */
-#define ARES_NI_NOFQDN (1 << 0)
-#define ARES_NI_NUMERICHOST (1 << 1)
-#define ARES_NI_NAMEREQD (1 << 2)
-#define ARES_NI_NUMERICSERV (1 << 3)
-#define ARES_NI_DGRAM (1 << 4)
-#define ARES_NI_TCP 0
-#define ARES_NI_UDP ARES_NI_DGRAM
-#define ARES_NI_SCTP (1 << 5)
-#define ARES_NI_DCCP (1 << 6)
-#define ARES_NI_NUMERICSCOPE (1 << 7)
-#define ARES_NI_LOOKUPHOST (1 << 8)
-#define ARES_NI_LOOKUPSERVICE (1 << 9)
-/* Reserved for future use */
-#define ARES_NI_IDN (1 << 10)
-#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
-#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
-
-/* Addrinfo flag values */
-#define ARES_AI_CANONNAME (1 << 0)
-#define ARES_AI_NUMERICHOST (1 << 1)
-#define ARES_AI_PASSIVE (1 << 2)
-#define ARES_AI_NUMERICSERV (1 << 3)
-#define ARES_AI_V4MAPPED (1 << 4)
-#define ARES_AI_ALL (1 << 5)
-#define ARES_AI_ADDRCONFIG (1 << 6)
-/* Reserved for future use */
-#define ARES_AI_IDN (1 << 10)
-#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
-#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
-#define ARES_AI_CANONIDN (1 << 13)
-
-#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
- ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
- ARES_AI_ADDRCONFIG)
-#define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this
- many sockets */
-#define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
-#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
- ARES_GETSOCK_MAXNUM)))
-
-/* c-ares library initialization flag values */
-#define ARES_LIB_INIT_NONE (0)
-#define ARES_LIB_INIT_WIN32 (1 << 0)
-#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
-
-
-/*
- * Typedef our socket type
- */
-
-#ifndef ares_socket_typedef
-#ifdef WIN32
-typedef SOCKET ares_socket_t;
-#define ARES_SOCKET_BAD INVALID_SOCKET
-#else
-typedef int ares_socket_t;
-#define ARES_SOCKET_BAD -1
-#endif
-#define ares_socket_typedef
-#endif /* ares_socket_typedef */
-
-typedef void (*ares_sock_state_cb)(void *data,
- ares_socket_t socket_fd,
- int readable,
- int writable);
-
-struct apattern;
-
-/* NOTE about the ares_options struct to users and developers.
-
- This struct will remain looking like this. It will not be extended nor
- shrunk in future releases, but all new options will be set by ares_set_*()
- options instead of with the ares_init_options() function.
-
- Eventually (in a galaxy far far away), all options will be settable by
- ares_set_*() options and the ares_init_options() function will become
- deprecated.
-
- When new options are added to c-ares, they are not added to this
- struct. And they are not "saved" with the ares_save_options() function but
- instead we encourage the use of the ares_dup() function. Needless to say,
- if you add config options to c-ares you need to make sure ares_dup()
- duplicates this new option.
-
- */
-struct ares_options {
- int flags;
- int timeout; /* in seconds or milliseconds, depending on options */
- int tries;
- int ndots;
- unsigned short udp_port;
- unsigned short tcp_port;
- int socket_send_buffer_size;
- int socket_receive_buffer_size;
- struct in_addr *servers;
- int nservers;
- char **domains;
- int ndomains;
- char *lookups;
- ares_sock_state_cb sock_state_cb;
- void *sock_state_cb_data;
- struct apattern *sortlist;
- int nsort;
- int ednspsz;
- char *resolvconf_path;
-};
-
-struct hostent;
-struct timeval;
-struct sockaddr;
-struct ares_channeldata;
-
-typedef struct ares_channeldata *ares_channel;
-
-typedef void (*ares_callback)(void *arg,
- int status,
- int timeouts,
- unsigned char *abuf,
- int alen);
-
-typedef void (*ares_host_callback)(void *arg,
- int status,
- int timeouts,
- struct hostent *hostent);
-
-typedef void (*ares_nameinfo_callback)(void *arg,
- int status,
- int timeouts,
- char *node,
- char *service);
-
-typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
- int type,
- void *data);
-
-typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
- int type,
- void *data);
-
-CARES_EXTERN int ares_library_init(int flags);
-
-CARES_EXTERN int ares_library_init_mem(int flags,
- void *(*amalloc)(size_t size),
- void (*afree)(void *ptr),
- void *(*arealloc)(void *ptr, size_t size));
-
-#if defined(ANDROID) || defined(__ANDROID__)
-CARES_EXTERN void ares_library_init_jvm(JavaVM *jvm);
-CARES_EXTERN int ares_library_init_android(jobject connectivity_manager);
-CARES_EXTERN int ares_library_android_initialized(void);
-#endif
-
-CARES_EXTERN int ares_library_initialized(void);
-
-CARES_EXTERN void ares_library_cleanup(void);
-
-CARES_EXTERN const char *ares_version(int *version);
-
-CARES_EXTERN int ares_init(ares_channel *channelptr);
-
-CARES_EXTERN int ares_init_options(ares_channel *channelptr,
- struct ares_options *options,
- int optmask);
-
-CARES_EXTERN int ares_save_options(ares_channel channel,
- struct ares_options *options,
- int *optmask);
-
-CARES_EXTERN void ares_destroy_options(struct ares_options *options);
-
-CARES_EXTERN int ares_dup(ares_channel *dest,
- ares_channel src);
-
-CARES_EXTERN void ares_destroy(ares_channel channel);
-
-CARES_EXTERN void ares_cancel(ares_channel channel);
-
-/* These next 3 configure local binding for the out-going socket
- * connection. Use these to specify source IP and/or network device
- * on multi-homed systems.
- */
-CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip);
-
-/* local_ip6 should be 16 bytes in length */
-CARES_EXTERN void ares_set_local_ip6(ares_channel channel,
- const unsigned char* local_ip6);
-
-/* local_dev_name should be null terminated. */
-CARES_EXTERN void ares_set_local_dev(ares_channel channel,
- const char* local_dev_name);
-
-CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
- ares_sock_create_callback callback,
- void *user_data);
-
-CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel,
- ares_sock_config_callback callback,
- void *user_data);
-
-CARES_EXTERN int ares_set_sortlist(ares_channel channel,
- const char *sortstr);
-
-/*
- * Virtual function set to have user-managed socket IO.
- * Note that all functions need to be defined, and when
- * set, the library will not do any bind nor set any
- * socket options, assuming the client handles these
- * through either socket creation or the
- * ares_sock_config_callback call.
- */
-struct iovec;
-struct ares_socket_functions {
- ares_socket_t(*asocket)(int, int, int, void *);
- int(*aclose)(ares_socket_t, void *);
- int(*aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
- ares_ssize_t(*arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *);
- ares_ssize_t(*asendv)(ares_socket_t, const struct iovec *, int, void *);
-};
-
-CARES_EXTERN void ares_set_socket_functions(ares_channel channel,
- const struct ares_socket_functions * funcs,
- void *user_data);
-
-CARES_EXTERN void ares_send(ares_channel channel,
- const unsigned char *qbuf,
- int qlen,
- ares_callback callback,
- void *arg);
-
-CARES_EXTERN void ares_query(ares_channel channel,
- const char *name,
- int dnsclass,
- int type,
- ares_callback callback,
- void *arg);
-
-CARES_EXTERN void ares_search(ares_channel channel,
- const char *name,
- int dnsclass,
- int type,
- ares_callback callback,
- void *arg);
-
-CARES_EXTERN void ares_gethostbyname(ares_channel channel,
- const char *name,
- int family,
- ares_host_callback callback,
- void *arg);
-
-CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
- const char *name,
- int family,
- struct hostent **host);
-
-CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
- const void *addr,
- int addrlen,
- int family,
- ares_host_callback callback,
- void *arg);
-
-CARES_EXTERN void ares_getnameinfo(ares_channel channel,
- const struct sockaddr *sa,
- ares_socklen_t salen,
- int flags,
- ares_nameinfo_callback callback,
- void *arg);
-
-CARES_EXTERN int ares_fds(ares_channel channel,
- fd_set *read_fds,
- fd_set *write_fds);
-
-CARES_EXTERN int ares_getsock(ares_channel channel,
- ares_socket_t *socks,
- int numsocks);
-
-CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
- struct timeval *maxtv,
- struct timeval *tv);
-
-CARES_EXTERN void ares_process(ares_channel channel,
- fd_set *read_fds,
- fd_set *write_fds);
-
-CARES_EXTERN void ares_process_fd(ares_channel channel,
- ares_socket_t read_fd,
- ares_socket_t write_fd);
-
-CARES_EXTERN int ares_create_query(const char *name,
- int dnsclass,
- int type,
- unsigned short id,
- int rd,
- unsigned char **buf,
- int *buflen,
- int max_udp_size);
-
-CARES_EXTERN int ares_mkquery(const char *name,
- int dnsclass,
- int type,
- unsigned short id,
- int rd,
- unsigned char **buf,
- int *buflen);
-
-CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
- const unsigned char *abuf,
- int alen,
- char **s,
- long *enclen);
-
-CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
- const unsigned char *abuf,
- int alen,
- unsigned char **s,
- long *enclen);
-
-/*
- * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
- * struct below when ares itself was built, but many apps would use this
- * private version since the header checked a HAVE_* define for it. Starting
- * with 1.7.0 we always declare and use our own to stop relying on the
- * system's one.
- */
-struct ares_in6_addr {
- union {
- unsigned char _S6_u8[16];
- } _S6_un;
-};
-
-struct ares_addrttl {
- struct in_addr ipaddr;
- int ttl;
-};
-
-struct ares_addr6ttl {
- struct ares_in6_addr ip6addr;
- int ttl;
-};
-
-struct ares_srv_reply {
- struct ares_srv_reply *next;
- char *host;
- unsigned short priority;
- unsigned short weight;
- unsigned short port;
-};
-
-struct ares_mx_reply {
- struct ares_mx_reply *next;
- char *host;
- unsigned short priority;
-};
-
-struct ares_txt_reply {
- struct ares_txt_reply *next;
- unsigned char *txt;
- size_t length; /* length excludes null termination */
-};
-
-/* NOTE: This structure is a superset of ares_txt_reply
- */
-struct ares_txt_ext {
- struct ares_txt_ext *next;
- unsigned char *txt;
- size_t length;
- /* 1 - if start of new record
- * 0 - if a chunk in the same record */
- unsigned char record_start;
-};
-
-struct ares_naptr_reply {
- struct ares_naptr_reply *next;
- unsigned char *flags;
- unsigned char *service;
- unsigned char *regexp;
- char *replacement;
- unsigned short order;
- unsigned short preference;
-};
-
-struct ares_soa_reply {
- char *nsname;
- char *hostmaster;
- unsigned int serial;
- unsigned int refresh;
- unsigned int retry;
- unsigned int expire;
- unsigned int minttl;
-};
-
-/*
-** Parse the buffer, starting at *abuf and of length alen bytes, previously
-** obtained from an ares_search call. Put the results in *host, if nonnull.
-** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
-** their TTLs in that array, and set *naddrttls to the number of addresses
-** so written.
-*/
-
-CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
- int alen,
- struct hostent **host,
- struct ares_addrttl *addrttls,
- int *naddrttls);
-
-CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
- int alen,
- struct hostent **host,
- struct ares_addr6ttl *addrttls,
- int *naddrttls);
-
-CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
- int alen,
- const void *addr,
- int addrlen,
- int family,
- struct hostent **host);
-
-CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
- int alen,
- struct hostent **host);
-
-CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
- int alen,
- struct ares_srv_reply** srv_out);
-
-CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf,
- int alen,
- struct ares_mx_reply** mx_out);
-
-CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
- int alen,
- struct ares_txt_reply** txt_out);
-
-CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf,
- int alen,
- struct ares_txt_ext** txt_out);
-
-CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf,
- int alen,
- struct ares_naptr_reply** naptr_out);
-
-CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf,
- int alen,
- struct ares_soa_reply** soa_out);
-
-CARES_EXTERN void ares_free_string(void *str);
-
-CARES_EXTERN void ares_free_hostent(struct hostent *host);
-
-CARES_EXTERN void ares_free_data(void *dataptr);
-
-CARES_EXTERN const char *ares_strerror(int code);
-
-struct ares_addr_node {
- struct ares_addr_node *next;
- int family;
- union {
- struct in_addr addr4;
- struct ares_in6_addr addr6;
- } addr;
-};
-
-struct ares_addr_port_node {
- struct ares_addr_port_node *next;
- int family;
- union {
- struct in_addr addr4;
- struct ares_in6_addr addr6;
- } addr;
- int udp_port;
- int tcp_port;
-};
-
-CARES_EXTERN int ares_set_servers(ares_channel channel,
- struct ares_addr_node *servers);
-CARES_EXTERN int ares_set_servers_ports(ares_channel channel,
- struct ares_addr_port_node *servers);
-
-/* Incomming string format: host[:port][,host[:port]]... */
-CARES_EXTERN int ares_set_servers_csv(ares_channel channel,
- const char* servers);
-CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel,
- const char* servers);
-
-CARES_EXTERN int ares_get_servers(ares_channel channel,
- struct ares_addr_node **servers);
-CARES_EXTERN int ares_get_servers_ports(ares_channel channel,
- struct ares_addr_port_node **servers);
-
-CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
- ares_socklen_t size);
-
-CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ARES__H */
diff --git a/grpc/third_party/cares/cares/ares__close_sockets.c b/grpc/third_party/cares/cares/ares__close_sockets.c
deleted file mode 100644
index f07904e8..00000000
--- a/grpc/third_party/cares/cares/ares__close_sockets.c
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#include "ares.h"
-#include "ares_private.h"
-
-void ares__close_sockets(ares_channel channel, struct server_state *server)
-{
- struct send_request *sendreq;
-
- /* Free all pending output buffers. */
- while (server->qhead)
- {
- /* Advance server->qhead; pull out query as we go. */
- sendreq = server->qhead;
- server->qhead = sendreq->next;
- if (sendreq->data_storage != NULL)
- ares_free(sendreq->data_storage);
- ares_free(sendreq);
- }
- server->qtail = NULL;
-
- /* Reset any existing input buffer. */
- if (server->tcp_buffer)
- ares_free(server->tcp_buffer);
- server->tcp_buffer = NULL;
- server->tcp_lenbuf_pos = 0;
-
- /* Reset brokenness */
- server->is_broken = 0;
-
- /* Close the TCP and UDP sockets. */
- if (server->tcp_socket != ARES_SOCKET_BAD)
- {
- SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
- ares__socket_close(channel, server->tcp_socket);
- server->tcp_socket = ARES_SOCKET_BAD;
- server->tcp_connection_generation = ++channel->tcp_connection_generation;
- }
- if (server->udp_socket != ARES_SOCKET_BAD)
- {
- SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
- ares__socket_close(channel, server->udp_socket);
- server->udp_socket = ARES_SOCKET_BAD;
- }
-}
diff --git a/grpc/third_party/cares/cares/ares__get_hostent.c b/grpc/third_party/cares/cares/ares__get_hostent.c
deleted file mode 100644
index d2f95034..00000000
--- a/grpc/third_party/cares/cares/ares__get_hostent.c
+++ /dev/null
@@ -1,261 +0,0 @@
-
-/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-
-#include "ares.h"
-#include "ares_inet_net_pton.h"
-#include "ares_nowarn.h"
-#include "ares_private.h"
-
-int ares__get_hostent(FILE *fp, int family, struct hostent **host)
-{
- char *line = NULL, *p, *q, **alias;
- char *txtaddr, *txthost, *txtalias;
- int status;
- size_t addrlen, linesize, naliases;
- struct ares_addr addr;
- struct hostent *hostent = NULL;
-
- *host = NULL; /* Assume failure */
-
- /* Validate family */
- switch (family) {
- case AF_INET:
- case AF_INET6:
- case AF_UNSPEC:
- break;
- default:
- return ARES_EBADFAMILY;
- }
-
- while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
- {
-
- /* Trim line comment. */
- p = line;
- while (*p && (*p != '#'))
- p++;
- *p = '\0';
-
- /* Trim trailing whitespace. */
- q = p - 1;
- while ((q >= line) && ISSPACE(*q))
- q--;
- *++q = '\0';
-
- /* Skip leading whitespace. */
- p = line;
- while (*p && ISSPACE(*p))
- p++;
- if (!*p)
- /* Ignore line if empty. */
- continue;
-
- /* Pointer to start of IPv4 or IPv6 address part. */
- txtaddr = p;
-
- /* Advance past address part. */
- while (*p && !ISSPACE(*p))
- p++;
- if (!*p)
- /* Ignore line if reached end of line. */
- continue;
-
- /* Null terminate address part. */
- *p = '\0';
-
- /* Advance to host name */
- p++;
- while (*p && ISSPACE(*p))
- p++;
- if (!*p)
- /* Ignore line if reached end of line. */
- continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */
-
- /* Pointer to start of host name. */
- txthost = p;
-
- /* Advance past host name. */
- while (*p && !ISSPACE(*p))
- p++;
-
- /* Pointer to start of first alias. */
- txtalias = NULL;
- if (*p)
- {
- q = p + 1;
- while (*q && ISSPACE(*q))
- q++;
- if (*q)
- txtalias = q;
- }
-
- /* Null terminate host name. */
- *p = '\0';
-
- /* find out number of aliases. */
- naliases = 0;
- if (txtalias)
- {
- p = txtalias;
- while (*p)
- {
- while (*p && !ISSPACE(*p))
- p++;
- while (*p && ISSPACE(*p))
- p++;
- naliases++;
- }
- }
-
- /* Convert address string to network address for the requested family. */
- addrlen = 0;
- addr.family = AF_UNSPEC;
- addr.addrV4.s_addr = INADDR_NONE;
- if ((family == AF_INET) || (family == AF_UNSPEC))
- {
- addr.addrV4.s_addr = inet_addr(txtaddr);
- if (addr.addrV4.s_addr != INADDR_NONE)
- {
- /* Actual network address family and length. */
- addr.family = AF_INET;
- addrlen = sizeof(addr.addrV4);
- }
- }
- if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
- {
- if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0)
- {
- /* Actual network address family and length. */
- addr.family = AF_INET6;
- addrlen = sizeof(addr.addrV6);
- }
- }
- if (!addrlen)
- /* Ignore line if invalid address string for the requested family. */
- continue;
-
- /*
- ** Actual address family possible values are AF_INET and AF_INET6 only.
- */
-
- /* Allocate memory for the hostent structure. */
- hostent = ares_malloc(sizeof(struct hostent));
- if (!hostent)
- break;
-
- /* Initialize fields for out of memory condition. */
- hostent->h_aliases = NULL;
- hostent->h_addr_list = NULL;
-
- /* Copy official host name. */
- hostent->h_name = ares_strdup(txthost);
- if (!hostent->h_name)
- break;
-
- /* Copy network address. */
- hostent->h_addr_list = ares_malloc(2 * sizeof(char *));
- if (!hostent->h_addr_list)
- break;
- hostent->h_addr_list[1] = NULL;
- hostent->h_addr_list[0] = ares_malloc(addrlen);
- if (!hostent->h_addr_list[0])
- break;
- if (addr.family == AF_INET)
- memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4));
- else
- memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6));
-
- /* Copy aliases. */
- hostent->h_aliases = ares_malloc((naliases + 1) * sizeof(char *));
- if (!hostent->h_aliases)
- break;
- alias = hostent->h_aliases;
- while (naliases)
- *(alias + naliases--) = NULL;
- *alias = NULL;
- while (txtalias)
- {
- p = txtalias;
- while (*p && !ISSPACE(*p))
- p++;
- q = p;
- while (*q && ISSPACE(*q))
- q++;
- *p = '\0';
- if ((*alias = ares_strdup(txtalias)) == NULL)
- break;
- alias++;
- txtalias = *q ? q : NULL;
- }
- if (txtalias)
- /* Alias memory allocation failure. */
- break;
-
- /* Copy actual network address family and length. */
- hostent->h_addrtype = aresx_sitoss(addr.family);
- hostent->h_length = aresx_uztoss(addrlen);
-
- /* Free line buffer. */
- ares_free(line);
-
- /* Return hostent successfully */
- *host = hostent;
- return ARES_SUCCESS;
-
- }
-
- /* If allocated, free line buffer. */
- if (line)
- ares_free(line);
-
- if (status == ARES_SUCCESS)
- {
- /* Memory allocation failure; clean up. */
- if (hostent)
- {
- if (hostent->h_name)
- ares_free((char *) hostent->h_name);
- if (hostent->h_aliases)
- {
- for (alias = hostent->h_aliases; *alias; alias++)
- ares_free(*alias);
- ares_free(hostent->h_aliases);
- }
- if (hostent->h_addr_list)
- {
- if (hostent->h_addr_list[0])
- ares_free(hostent->h_addr_list[0]);
- ares_free(hostent->h_addr_list);
- }
- ares_free(hostent);
- }
- return ARES_ENOMEM;
- }
-
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_android.c b/grpc/third_party/cares/cares/ares_android.c
deleted file mode 100644
index bf77131b..00000000
--- a/grpc/third_party/cares/cares/ares_android.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/* Copyright (C) 2017 by John Schember <john@nachtimwald.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-#if defined(ANDROID) || defined(__ANDROID__)
-
-#include <jni.h>
-
-#include "ares_setup.h"
-#include "ares.h"
-#include "ares_android.h"
-#include "ares_private.h"
-
-static JavaVM *android_jvm = NULL;
-static jobject android_connectivity_manager = NULL;
-
-/* ConnectivityManager.getActiveNetwork */
-static jmethodID android_cm_active_net_mid = NULL;
-/* ConnectivityManager.getLinkProperties */
-static jmethodID android_cm_link_props_mid = NULL;
-/* LinkProperties.getDnsServers */
-static jmethodID android_lp_dns_servers_mid = NULL;
-/* LinkProperties.getDomains */
-static jmethodID android_lp_domains_mid = NULL;
-/* List.size */
-static jmethodID android_list_size_mid = NULL;
-/* List.get */
-static jmethodID android_list_get_mid = NULL;
-/* InetAddress.getHostAddress */
-static jmethodID android_ia_host_addr_mid = NULL;
-
-static jclass jni_get_class(JNIEnv *env, const char *path)
-{
- jclass cls = NULL;
-
- if (env == NULL || path == NULL || *path == '\0')
- return NULL;
-
- cls = (*env)->FindClass(env, path);
- if ((*env)->ExceptionOccurred(env)) {
- (*env)->ExceptionClear(env);
- return NULL;
- }
- return cls;
-}
-
-static jmethodID jni_get_method_id(JNIEnv *env, jclass cls,
- const char *func_name, const char *signature)
-{
- jmethodID mid = NULL;
-
- if (env == NULL || cls == NULL || func_name == NULL || *func_name == '\0' ||
- signature == NULL || *signature == '\0')
- {
- return NULL;
- }
-
- mid = (*env)->GetMethodID(env, cls, func_name, signature);
- if ((*env)->ExceptionOccurred(env))
- {
- (*env)->ExceptionClear(env);
- return NULL;
- }
-
- return mid;
-}
-
-void ares_library_init_jvm(JavaVM *jvm)
-{
- android_jvm = jvm;
-}
-
-int ares_library_init_android(jobject connectivity_manager)
-{
- JNIEnv *env = NULL;
- int need_detatch = 0;
- int res;
- int ret = ARES_ENOTINITIALIZED;
- jclass obj_cls = NULL;
-
- if (android_jvm == NULL)
- goto cleanup;
-
- res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
- if (res == JNI_EDETACHED)
- {
- env = NULL;
- res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
- need_detatch = 1;
- }
- if (res != JNI_OK || env == NULL)
- goto cleanup;
-
- android_connectivity_manager =
- (*env)->NewGlobalRef(env, connectivity_manager);
- if (android_connectivity_manager == NULL)
- goto cleanup;
-
- /* Initialization has succeeded. Now attempt to cache the methods that will be
- * called by ares_get_android_server_list. */
- ret = ARES_SUCCESS;
-
- /* ConnectivityManager in API 1. */
- obj_cls = jni_get_class(env, "android/net/ConnectivityManager");
- if (obj_cls == NULL)
- goto cleanup;
-
- /* ConnectivityManager.getActiveNetwork in API 23. */
- android_cm_active_net_mid =
- jni_get_method_id(env, obj_cls, "getActiveNetwork",
- "()Landroid/net/Network;");
- if (android_cm_active_net_mid == NULL)
- goto cleanup;
-
- /* ConnectivityManager.getLinkProperties in API 21. */
- android_cm_link_props_mid =
- jni_get_method_id(env, obj_cls, "getLinkProperties",
- "(Landroid/net/Network;)Landroid/net/LinkProperties;");
- if (android_cm_link_props_mid == NULL)
- goto cleanup;
-
- /* LinkProperties in API 21. */
- (*env)->DeleteLocalRef(env, obj_cls);
- obj_cls = jni_get_class(env, "android/net/LinkProperties");
- if (obj_cls == NULL)
- goto cleanup;
-
- /* getDnsServers in API 21. */
- android_lp_dns_servers_mid = jni_get_method_id(env, obj_cls, "getDnsServers",
- "()Ljava/util/List;");
- if (android_lp_dns_servers_mid == NULL)
- goto cleanup;
-
- /* getDomains in API 21. */
- android_lp_domains_mid = jni_get_method_id(env, obj_cls, "getDomains",
- "()Ljava/lang/String;");
- if (android_lp_domains_mid == NULL)
- goto cleanup;
-
- (*env)->DeleteLocalRef(env, obj_cls);
- obj_cls = jni_get_class(env, "java/util/List");
- if (obj_cls == NULL)
- goto cleanup;
-
- android_list_size_mid = jni_get_method_id(env, obj_cls, "size", "()I");
- if (android_list_size_mid == NULL)
- goto cleanup;
-
- android_list_get_mid = jni_get_method_id(env, obj_cls, "get",
- "(I)Ljava/lang/Object;");
- if (android_list_get_mid == NULL)
- goto cleanup;
-
- (*env)->DeleteLocalRef(env, obj_cls);
- obj_cls = jni_get_class(env, "java/net/InetAddress");
- if (obj_cls == NULL)
- goto cleanup;
-
- android_ia_host_addr_mid = jni_get_method_id(env, obj_cls, "getHostAddress",
- "()Ljava/lang/String;");
- if (android_ia_host_addr_mid == NULL)
- goto cleanup;
-
- (*env)->DeleteLocalRef(env, obj_cls);
- goto done;
-
-cleanup:
- if (obj_cls != NULL)
- (*env)->DeleteLocalRef(env, obj_cls);
-
- android_cm_active_net_mid = NULL;
- android_cm_link_props_mid = NULL;
- android_lp_dns_servers_mid = NULL;
- android_lp_domains_mid = NULL;
- android_list_size_mid = NULL;
- android_list_get_mid = NULL;
- android_ia_host_addr_mid = NULL;
-
-done:
- if (need_detatch)
- (*android_jvm)->DetachCurrentThread(android_jvm);
-
- return ret;
-}
-
-int ares_library_android_initialized(void)
-{
- if (android_jvm == NULL || android_connectivity_manager == NULL)
- return ARES_ENOTINITIALIZED;
- return ARES_SUCCESS;
-}
-
-void ares_library_cleanup_android(void)
-{
- JNIEnv *env = NULL;
- int need_detatch = 0;
- int res;
-
- if (android_jvm == NULL || android_connectivity_manager == NULL)
- return;
-
- res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
- if (res == JNI_EDETACHED)
- {
- env = NULL;
- res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
- need_detatch = 1;
- }
- if (res != JNI_OK || env == NULL)
- return;
-
- android_cm_active_net_mid = NULL;
- android_cm_link_props_mid = NULL;
- android_lp_dns_servers_mid = NULL;
- android_lp_domains_mid = NULL;
- android_list_size_mid = NULL;
- android_list_get_mid = NULL;
- android_ia_host_addr_mid = NULL;
-
- (*env)->DeleteGlobalRef(env, android_connectivity_manager);
- android_connectivity_manager = NULL;
-
- if (need_detatch)
- (*android_jvm)->DetachCurrentThread(android_jvm);
-}
-
-char **ares_get_android_server_list(size_t max_servers,
- size_t *num_servers)
-{
- JNIEnv *env = NULL;
- jobject active_network = NULL;
- jobject link_properties = NULL;
- jobject server_list = NULL;
- jobject server = NULL;
- jstring str = NULL;
- jint nserv;
- const char *ch_server_address;
- int res;
- size_t i;
- char **dns_list = NULL;
- int need_detatch = 0;
-
- if (android_jvm == NULL || android_connectivity_manager == NULL ||
- max_servers == 0 || num_servers == NULL)
- {
- return NULL;
- }
-
- if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL ||
- android_lp_dns_servers_mid == NULL || android_list_size_mid == NULL ||
- android_list_get_mid == NULL || android_ia_host_addr_mid == NULL)
- {
- return NULL;
- }
-
- res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
- if (res == JNI_EDETACHED)
- {
- env = NULL;
- res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
- need_detatch = 1;
- }
- if (res != JNI_OK || env == NULL)
- goto done;
-
- /* JNI below is equivalent to this Java code.
- import android.content.Context;
- import android.net.ConnectivityManager;
- import android.net.LinkProperties;
- import android.net.Network;
- import java.net.InetAddress;
- import java.util.List;
-
- ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext()
- .getSystemService(Context.CONNECTIVITY_SERVICE);
- Network an = cm.getActiveNetwork();
- LinkProperties lp = cm.getLinkProperties(an);
- List<InetAddress> dns = lp.getDnsServers();
- for (InetAddress ia: dns) {
- String ha = ia.getHostAddress();
- }
-
- Note: The JNI ConnectivityManager object and all method IDs were previously
- initialized in ares_library_init_android.
- */
-
- active_network = (*env)->CallObjectMethod(env, android_connectivity_manager,
- android_cm_active_net_mid);
- if (active_network == NULL)
- goto done;
-
- link_properties =
- (*env)->CallObjectMethod(env, android_connectivity_manager,
- android_cm_link_props_mid, active_network);
- if (link_properties == NULL)
- goto done;
-
- server_list = (*env)->CallObjectMethod(env, link_properties,
- android_lp_dns_servers_mid);
- if (server_list == NULL)
- goto done;
-
- nserv = (*env)->CallIntMethod(env, server_list, android_list_size_mid);
- if (nserv > (jint)max_servers)
- nserv = (jint)max_servers;
- if (nserv <= 0)
- goto done;
- *num_servers = (size_t)nserv;
-
- dns_list = ares_malloc(sizeof(*dns_list)*(*num_servers));
- for (i=0; i<*num_servers; i++)
- {
- server = (*env)->CallObjectMethod(env, server_list, android_list_get_mid,
- (jint)i);
- dns_list[i] = ares_malloc(64);
- dns_list[i][0] = 0;
- if (server == NULL)
- {
- continue;
- }
- str = (*env)->CallObjectMethod(env, server, android_ia_host_addr_mid);
- ch_server_address = (*env)->GetStringUTFChars(env, str, 0);
- strncpy(dns_list[i], ch_server_address, 64);
- (*env)->ReleaseStringUTFChars(env, str, ch_server_address);
- (*env)->DeleteLocalRef(env, str);
- (*env)->DeleteLocalRef(env, server);
- }
-
-done:
- if ((*env)->ExceptionOccurred(env))
- (*env)->ExceptionClear(env);
-
- if (server_list != NULL)
- (*env)->DeleteLocalRef(env, server_list);
- if (link_properties != NULL)
- (*env)->DeleteLocalRef(env, link_properties);
- if (active_network != NULL)
- (*env)->DeleteLocalRef(env, active_network);
-
- if (need_detatch)
- (*android_jvm)->DetachCurrentThread(android_jvm);
- return dns_list;
-}
-
-char *ares_get_android_search_domains_list(void)
-{
- JNIEnv *env = NULL;
- jobject active_network = NULL;
- jobject link_properties = NULL;
- jstring domains = NULL;
- const char *domain;
- int res;
- size_t i;
- size_t cnt = 0;
- char *domain_list = NULL;
- int need_detatch = 0;
-
- if (android_jvm == NULL || android_connectivity_manager == NULL)
- {
- return NULL;
- }
-
- if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL ||
- android_lp_domains_mid == NULL)
- {
- return NULL;
- }
-
- res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
- if (res == JNI_EDETACHED)
- {
- env = NULL;
- res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
- need_detatch = 1;
- }
- if (res != JNI_OK || env == NULL)
- goto done;
-
- /* JNI below is equivalent to this Java code.
- import android.content.Context;
- import android.net.ConnectivityManager;
- import android.net.LinkProperties;
-
- ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext()
- .getSystemService(Context.CONNECTIVITY_SERVICE);
- Network an = cm.getActiveNetwork();
- LinkProperties lp = cm.getLinkProperties(an);
- String domains = lp.getDomains();
- for (String domain: domains.split(",")) {
- String d = domain;
- }
-
- Note: The JNI ConnectivityManager object and all method IDs were previously
- initialized in ares_library_init_android.
- */
-
- active_network = (*env)->CallObjectMethod(env, android_connectivity_manager,
- android_cm_active_net_mid);
- if (active_network == NULL)
- goto done;
-
- link_properties =
- (*env)->CallObjectMethod(env, android_connectivity_manager,
- android_cm_link_props_mid, active_network);
- if (link_properties == NULL)
- goto done;
-
- /* Get the domains. It is a common separated list of domains to search. */
- domains = (*env)->CallObjectMethod(env, link_properties,
- android_lp_domains_mid);
- if (domains == NULL)
- goto done;
-
- /* Split on , */
- domain = (*env)->GetStringUTFChars(env, domains, 0);
- domain_list = ares_strdup(domain);
- (*env)->ReleaseStringUTFChars(env, domains, domain);
- (*env)->DeleteLocalRef(env, domains);
-
-done:
- if ((*env)->ExceptionOccurred(env))
- (*env)->ExceptionClear(env);
-
- if (link_properties != NULL)
- (*env)->DeleteLocalRef(env, link_properties);
- if (active_network != NULL)
- (*env)->DeleteLocalRef(env, active_network);
-
- if (need_detatch)
- (*android_jvm)->DetachCurrentThread(android_jvm);
- return domain_list;
-}
-#else
-/* warning: ISO C forbids an empty translation unit */
-typedef int dummy_make_iso_compilers_happy;
-#endif
diff --git a/grpc/third_party/cares/cares/ares_config.h.cmake b/grpc/third_party/cares/cares/ares_config.h.cmake
deleted file mode 100644
index 49f3b214..00000000
--- a/grpc/third_party/cares/cares/ares_config.h.cmake
+++ /dev/null
@@ -1,426 +0,0 @@
-/* Generated from ares_config.h.cmake*/
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* define this if ares is built for a big endian system */
-#undef ARES_BIG_ENDIAN
-
-/* when building as static part of libcurl */
-#undef BUILDING_LIBCURL
-
-/* Defined for build that exposes internal static functions for testing. */
-#undef CARES_EXPOSE_STATICS
-
-/* Defined for build with symbol hiding. */
-#undef CARES_SYMBOL_HIDING
-
-/* Definition to make a library symbol externally visible. */
-#undef CARES_SYMBOL_SCOPE_EXTERN
-
-/* Use resolver library to configure cares */
-#cmakedefine CARES_USE_LIBRESOLV
-
-/* if a /etc/inet dir is being used */
-#undef ETC_INET
-
-/* Define to the type of arg 2 for gethostname. */
-#define GETHOSTNAME_TYPE_ARG2 @GETHOSTNAME_TYPE_ARG2@
-
-/* Define to the type qualifier of arg 1 for getnameinfo. */
-#define GETNAMEINFO_QUAL_ARG1 @GETNAMEINFO_QUAL_ARG1@
-
-/* Define to the type of arg 1 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG1 @GETNAMEINFO_TYPE_ARG1@
-
-/* Define to the type of arg 2 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG2 @GETNAMEINFO_TYPE_ARG2@
-
-/* Define to the type of args 4 and 6 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG46 @GETNAMEINFO_TYPE_ARG46@
-
-/* Define to the type of arg 7 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG7 @GETNAMEINFO_TYPE_ARG7@
-
-/* Specifies the number of arguments to getservbyport_r */
-#define GETSERVBYPORT_R_ARGS @GETSERVBYPORT_R_ARGS@
-
-/* Define to 1 if you have AF_INET6. */
-#cmakedefine HAVE_AF_INET6
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#cmakedefine HAVE_ARPA_INET_H
-
-/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
-#cmakedefine HAVE_ARPA_NAMESER_COMPAT_H
-
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#cmakedefine HAVE_ARPA_NAMESER_H
-
-/* Define to 1 if you have the <assert.h> header file. */
-#cmakedefine HAVE_ASSERT_H
-
-/* Define to 1 if you have the `bitncmp' function. */
-#cmakedefine HAVE_BITNCMP
-
-/* Define to 1 if bool is an available type. */
-#cmakedefine HAVE_BOOL_T
-
-/* Define to 1 if you have the clock_gettime function and monotonic timer. */
-#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC
-
-/* Define to 1 if you have the closesocket function. */
-#cmakedefine HAVE_CLOSESOCKET
-
-/* Define to 1 if you have the CloseSocket camel case function. */
-#cmakedefine HAVE_CLOSESOCKET_CAMEL
-
-/* Define to 1 if you have the connect function. */
-#cmakedefine HAVE_CONNECT
-
-/* define if the compiler supports basic C++11 syntax */
-#cmakedefine HAVE_CXX11
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H
-
-/* Define to 1 if you have the <errno.h> header file. */
-#cmakedefine HAVE_ERRNO_H
-
-/* Define to 1 if you have the fcntl function. */
-#cmakedefine HAVE_FCNTL
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#cmakedefine HAVE_FCNTL_H
-
-/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
-#cmakedefine HAVE_FCNTL_O_NONBLOCK
-
-/* Define to 1 if you have the freeaddrinfo function. */
-#cmakedefine HAVE_FREEADDRINFO
-
-/* Define to 1 if you have a working getaddrinfo function. */
-#cmakedefine HAVE_GETADDRINFO
-
-/* Define to 1 if the getaddrinfo function is threadsafe. */
-#cmakedefine HAVE_GETADDRINFO_THREADSAFE
-
-/* Define to 1 if you have the getenv function. */
-#cmakedefine HAVE_GETENV
-
-/* Define to 1 if you have the gethostbyaddr function. */
-#cmakedefine HAVE_GETHOSTBYADDR
-
-/* Define to 1 if you have the gethostbyname function. */
-#cmakedefine HAVE_GETHOSTBYNAME
-
-/* Define to 1 if you have the gethostname function. */
-#cmakedefine HAVE_GETHOSTNAME
-
-/* Define to 1 if you have the getnameinfo function. */
-#cmakedefine HAVE_GETNAMEINFO
-
-/* Define to 1 if you have the getservbyport_r function. */
-#cmakedefine HAVE_GETSERVBYPORT_R
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#cmakedefine HAVE_GETTIMEOFDAY
-
-/* Define to 1 if you have the `if_indextoname' function. */
-#cmakedefine HAVE_IF_INDEXTONAME
-
-/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */
-#cmakedefine HAVE_INET_NET_PTON
-
-/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
-#cmakedefine HAVE_INET_NTOP
-
-/* Define to 1 if you have a IPv6 capable working inet_pton function. */
-#cmakedefine HAVE_INET_PTON
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H
-
-/* Define to 1 if you have the ioctl function. */
-#cmakedefine HAVE_IOCTL
-
-/* Define to 1 if you have the ioctlsocket function. */
-#cmakedefine HAVE_IOCTLSOCKET
-
-/* Define to 1 if you have the IoctlSocket camel case function. */
-#cmakedefine HAVE_IOCTLSOCKET_CAMEL
-
-/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
- */
-#cmakedefine HAVE_IOCTLSOCKET_CAMEL_FIONBIO
-
-/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
-#cmakedefine HAVE_IOCTLSOCKET_FIONBIO
-
-/* Define to 1 if you have a working ioctl FIONBIO function. */
-#cmakedefine HAVE_IOCTL_FIONBIO
-
-/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
-#cmakedefine HAVE_IOCTL_SIOCGIFADDR
-
-/* Define to 1 if you have the `resolve' library (-lresolve). */
-#cmakedefine HAVE_LIBRESOLV
-
-/* Define to 1 if you have the <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H
-
-/* if your compiler supports LL */
-#cmakedefine HAVE_LL
-
-/* Define to 1 if the compiler supports the 'long long' data type. */
-#cmakedefine HAVE_LONGLONG
-
-/* Define to 1 if you have the malloc.h header file. */
-#cmakedefine HAVE_MALLOC_H
-
-/* Define to 1 if you have the memory.h header file. */
-#cmakedefine HAVE_MEMORY_H
-
-/* Define to 1 if you have the MSG_NOSIGNAL flag. */
-#cmakedefine HAVE_MSG_NOSIGNAL
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#cmakedefine HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#cmakedefine HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#cmakedefine HAVE_NETINET_TCP_H
-
-/* Define to 1 if you have the <net/if.h> header file. */
-#cmakedefine HAVE_NET_IF_H
-
-/* Define to 1 if you have PF_INET6. */
-#cmakedefine HAVE_PF_INET6
-
-/* Define to 1 if you have the recv function. */
-#cmakedefine HAVE_RECV
-
-/* Define to 1 if you have the recvfrom function. */
-#cmakedefine HAVE_RECVFROM
-
-/* Define to 1 if you have the send function. */
-#cmakedefine HAVE_SEND
-
-/* Define to 1 if you have the setsockopt function. */
-#cmakedefine HAVE_SETSOCKOPT
-
-/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
-#cmakedefine HAVE_SETSOCKOPT_SO_NONBLOCK
-
-/* Define to 1 if you have the <signal.h> header file. */
-#cmakedefine HAVE_SIGNAL_H
-
-/* Define to 1 if sig_atomic_t is an available typedef. */
-#cmakedefine HAVE_SIG_ATOMIC_T
-
-/* Define to 1 if sig_atomic_t is already defined as volatile. */
-#cmakedefine HAVE_SIG_ATOMIC_T_VOLATILE
-
-/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
-#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-
-/* Define to 1 if you have the socket function. */
-#cmakedefine HAVE_SOCKET
-
-/* Define to 1 if you have the <socket.h> header file. */
-#cmakedefine HAVE_SOCKET_H
-
-/* Define to 1 if you have the <stdbool.h> header file. */
-#cmakedefine HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define to 1 if you have the strcasecmp function. */
-#cmakedefine HAVE_STRCASECMP
-
-/* Define to 1 if you have the strcmpi function. */
-#cmakedefine HAVE_STRCMPI
-
-/* Define to 1 if you have the strdup function. */
-#cmakedefine HAVE_STRDUP
-
-/* Define to 1 if you have the stricmp function. */
-#cmakedefine HAVE_STRICMP
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
-/* Define to 1 if you have the strncasecmp function. */
-#cmakedefine HAVE_STRNCASECMP
-
-/* Define to 1 if you have the strncmpi function. */
-#cmakedefine HAVE_STRNCMPI
-
-/* Define to 1 if you have the strnicmp function. */
-#cmakedefine HAVE_STRNICMP
-
-/* Define to 1 if you have the <stropts.h> header file. */
-#cmakedefine HAVE_STROPTS_H
-
-/* Define to 1 if you have struct addrinfo. */
-#cmakedefine HAVE_STRUCT_ADDRINFO
-
-/* Define to 1 if you have struct in6_addr. */
-#cmakedefine HAVE_STRUCT_IN6_ADDR
-
-/* Define to 1 if you have struct sockaddr_in6. */
-#cmakedefine HAVE_STRUCT_SOCKADDR_IN6
-
-/* if struct sockaddr_storage is defined */
-#cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE
-
-/* Define to 1 if you have the timeval struct. */
-#cmakedefine HAVE_STRUCT_TIMEVAL
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#cmakedefine HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#cmakedefine HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#cmakedefine HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#cmakedefine HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#cmakedefine HAVE_SYS_UIO_H
-
-/* Define to 1 if you have the <time.h> header file. */
-#cmakedefine HAVE_TIME_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H
-
-/* Define to 1 if you have the windows.h header file. */
-#cmakedefine HAVE_WINDOWS_H
-
-/* Define to 1 if you have the winsock2.h header file. */
-#cmakedefine HAVE_WINSOCK2_H
-
-/* Define to 1 if you have the winsock.h header file. */
-#cmakedefine HAVE_WINSOCK_H
-
-/* Define to 1 if you have the writev function. */
-#cmakedefine HAVE_WRITEV
-
-/* Define to 1 if you have the ws2tcpip.h header file. */
-#cmakedefine HAVE_WS2TCPIP_H
-
-/* Define to 1 if you have the __system_property_get function */
-#cmakedefine HAVE___SYSTEM_PROPERTY_GET
-
-/* Define to 1 if you need the malloc.h header file even with stdlib.h */
-#cmakedefine NEED_MALLOC_H
-
-/* Define to 1 if you need the memory.h header file even with stdlib.h */
-#cmakedefine NEED_MEMORY_H
-
-/* a suitable file/device to read random data from */
-#cmakedefine RANDOM_FILE
-
-/* Define to the type qualifier pointed by arg 5 for recvfrom. */
-#define RECVFROM_QUAL_ARG5 @RECVFROM_QUAL_ARG5@
-
-/* Define to the type of arg 1 for recvfrom. */
-#define RECVFROM_TYPE_ARG1 @RECVFROM_TYPE_ARG1@
-
-/* Define to the type pointed by arg 2 for recvfrom. */
-#define RECVFROM_TYPE_ARG2 @RECVFROM_TYPE_ARG2@
-
-/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
-#cmakedefine01 RECVFROM_TYPE_ARG2_IS_VOID
-
-/* Define to the type of arg 3 for recvfrom. */
-#define RECVFROM_TYPE_ARG3 @RECVFROM_TYPE_ARG3@
-
-/* Define to the type of arg 4 for recvfrom. */
-#define RECVFROM_TYPE_ARG4 @RECVFROM_TYPE_ARG4@
-
-/* Define to the type pointed by arg 5 for recvfrom. */
-#define RECVFROM_TYPE_ARG5 @RECVFROM_TYPE_ARG5@
-
-/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
-#cmakedefine01 RECVFROM_TYPE_ARG5_IS_VOID
-
-/* Define to the type pointed by arg 6 for recvfrom. */
-#define RECVFROM_TYPE_ARG6 @RECVFROM_TYPE_ARG6@
-
-/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
-#cmakedefine01 RECVFROM_TYPE_ARG6_IS_VOID
-
-/* Define to the function return type for recvfrom. */
-#define RECVFROM_TYPE_RETV @RECVFROM_TYPE_RETV@
-
-/* Define to the type of arg 1 for recv. */
-#define RECV_TYPE_ARG1 @RECV_TYPE_ARG1@
-
-/* Define to the type of arg 2 for recv. */
-#define RECV_TYPE_ARG2 @RECV_TYPE_ARG2@
-
-/* Define to the type of arg 3 for recv. */
-#define RECV_TYPE_ARG3 @RECV_TYPE_ARG3@
-
-/* Define to the type of arg 4 for recv. */
-#define RECV_TYPE_ARG4 @RECV_TYPE_ARG4@
-
-/* Define to the function return type for recv. */
-#define RECV_TYPE_RETV @RECV_TYPE_RETV@
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE @RETSIGTYPE@
-
-/* Define to the type qualifier of arg 2 for send. */
-#define SEND_QUAL_ARG2 @SEND_QUAL_ARG2@
-
-/* Define to the type of arg 1 for send. */
-#define SEND_TYPE_ARG1 @SEND_TYPE_ARG1@
-
-/* Define to the type of arg 2 for send. */
-#define SEND_TYPE_ARG2 @SEND_TYPE_ARG2@
-
-/* Define to the type of arg 3 for send. */
-#define SEND_TYPE_ARG3 @SEND_TYPE_ARG3@
-
-/* Define to the type of arg 4 for send. */
-#define SEND_TYPE_ARG4 @SEND_TYPE_ARG4@
-
-/* Define to the function return type for send. */
-#define SEND_TYPE_RETV @SEND_TYPE_RETV@
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#cmakedefine TIME_WITH_SYS_TIME
-
-/* Define to disable non-blocking sockets. */
-#undef USE_BLOCKING_SOCKETS
-
-/* Define to avoid automatic inclusion of winsock.h */
-#undef WIN32_LEAN_AND_MEAN
-
-/* Type to use in place of in_addr_t when system does not provide it. */
-#undef in_addr_t
-
diff --git a/grpc/third_party/cares/cares/ares_create_query.c b/grpc/third_party/cares/cares/ares_create_query.c
deleted file mode 100644
index 1606b1a1..00000000
--- a/grpc/third_party/cares/cares/ares_create_query.c
+++ /dev/null
@@ -1,206 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_private.h"
-
-#ifndef T_OPT
-# define T_OPT 41 /* EDNS0 option (meta-RR) */
-#endif
-
-/* Header format, from RFC 1035:
- * 1 1 1 1 1 1
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | ID |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | QDCOUNT |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | ANCOUNT |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | NSCOUNT |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | ARCOUNT |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- *
- * AA, TC, RA, and RCODE are only set in responses. Brief description
- * of the remaining fields:
- * ID Identifier to match responses with queries
- * QR Query (0) or response (1)
- * Opcode For our purposes, always QUERY
- * RD Recursion desired
- * Z Reserved (zero)
- * QDCOUNT Number of queries
- * ANCOUNT Number of answers
- * NSCOUNT Number of name server records
- * ARCOUNT Number of additional records
- *
- * Question format, from RFC 1035:
- * 1 1 1 1 1 1
- * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | |
- * / QNAME /
- * / /
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | QTYPE |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- * | QCLASS |
- * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- *
- * The query name is encoded as a series of labels, each represented
- * as a one-byte length (maximum 63) followed by the text of the
- * label. The list is terminated by a label of length zero (which can
- * be thought of as the root domain).
- */
-
-int ares_create_query(const char *name, int dnsclass, int type,
- unsigned short id, int rd, unsigned char **bufp,
- int *buflenp, int max_udp_size)
-{
- size_t len;
- unsigned char *q;
- const char *p;
- size_t buflen;
- unsigned char *buf;
-
- /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
- if (ares__is_onion_domain(name))
- return ARES_ENOTFOUND;
-
- /* Set our results early, in case we bail out early with an error. */
- *buflenp = 0;
- *bufp = NULL;
-
- /* Allocate a memory area for the maximum size this packet might need. +2
- * is for the length byte and zero termination if no dots or ecscaping is
- * used.
- */
- len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ +
- (max_udp_size ? EDNSFIXEDSZ : 0);
- buf = ares_malloc(len);
- if (!buf)
- return ARES_ENOMEM;
-
- /* Set up the header. */
- q = buf;
- memset(q, 0, HFIXEDSZ);
- DNS_HEADER_SET_QID(q, id);
- DNS_HEADER_SET_OPCODE(q, QUERY);
- if (rd) {
- DNS_HEADER_SET_RD(q, 1);
- }
- else {
- DNS_HEADER_SET_RD(q, 0);
- }
- DNS_HEADER_SET_QDCOUNT(q, 1);
-
- if (max_udp_size) {
- DNS_HEADER_SET_ARCOUNT(q, 1);
- }
-
- /* A name of "." is a screw case for the loop below, so adjust it. */
- if (strcmp(name, ".") == 0)
- name++;
-
- /* Start writing out the name after the header. */
- q += HFIXEDSZ;
- while (*name)
- {
- if (*name == '.') {
- ares_free (buf);
- return ARES_EBADNAME;
- }
-
- /* Count the number of bytes in this label. */
- len = 0;
- for (p = name; *p && *p != '.'; p++)
- {
- if (*p == '\\' && *(p + 1) != 0)
- p++;
- len++;
- }
- if (len > MAXLABEL) {
- ares_free (buf);
- return ARES_EBADNAME;
- }
-
- /* Encode the length and copy the data. */
- *q++ = (unsigned char)len;
- for (p = name; *p && *p != '.'; p++)
- {
- if (*p == '\\' && *(p + 1) != 0)
- p++;
- *q++ = *p;
- }
-
- /* Go to the next label and repeat, unless we hit the end. */
- if (!*p)
- break;
- name = p + 1;
- }
-
- /* Add the zero-length label at the end. */
- *q++ = 0;
-
- /* Finish off the question with the type and class. */
- DNS_QUESTION_SET_TYPE(q, type);
- DNS_QUESTION_SET_CLASS(q, dnsclass);
-
- q += QFIXEDSZ;
- if (max_udp_size)
- {
- memset(q, 0, EDNSFIXEDSZ);
- q++;
- DNS_RR_SET_TYPE(q, T_OPT);
- DNS_RR_SET_CLASS(q, max_udp_size);
- q += (EDNSFIXEDSZ-1);
- }
- buflen = (q - buf);
-
- /* Reject names that are longer than the maximum of 255 bytes that's
- * specified in RFC 1035 ("To simplify implementations, the total length of
- * a domain name (i.e., label octets and label length octets) is restricted
- * to 255 octets or less."). */
- if (buflen > (size_t)(MAXCDNAME + HFIXEDSZ + QFIXEDSZ +
- (max_udp_size ? EDNSFIXEDSZ : 0))) {
- ares_free (buf);
- return ARES_EBADNAME;
- }
-
- /* we know this fits in an int at this point */
- *buflenp = (int) buflen;
- *bufp = buf;
-
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_data.c b/grpc/third_party/cares/cares/ares_data.c
deleted file mode 100644
index 18dd650c..00000000
--- a/grpc/third_party/cares/cares/ares_data.c
+++ /dev/null
@@ -1,222 +0,0 @@
-
-/* Copyright (C) 2009-2013 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-
-#include "ares_setup.h"
-
-#include <stddef.h>
-
-#include "ares.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-
-/*
-** ares_free_data() - c-ares external API function.
-**
-** This function must be used by the application to free data memory that
-** has been internally allocated by some c-ares function and for which a
-** pointer has already been returned to the calling application. The list
-** of c-ares functions returning pointers that must be free'ed using this
-** function is:
-**
-** ares_get_servers()
-** ares_parse_srv_reply()
-** ares_parse_txt_reply()
-*/
-
-void ares_free_data(void *dataptr)
-{
- while (dataptr != NULL) {
- struct ares_data *ptr;
- void *next_data = NULL;
-
-#ifdef __INTEL_COMPILER
-# pragma warning(push)
-# pragma warning(disable:1684)
- /* 1684: conversion from pointer to same-sized integral type */
-#endif
-
- ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
-
-#ifdef __INTEL_COMPILER
-# pragma warning(pop)
-#endif
-
- if (ptr->mark != ARES_DATATYPE_MARK)
- return;
-
- switch (ptr->type)
- {
- case ARES_DATATYPE_MX_REPLY:
-
- if (ptr->data.mx_reply.next)
- next_data = ptr->data.mx_reply.next;
- if (ptr->data.mx_reply.host)
- ares_free(ptr->data.mx_reply.host);
- break;
-
- case ARES_DATATYPE_SRV_REPLY:
-
- if (ptr->data.srv_reply.next)
- next_data = ptr->data.srv_reply.next;
- if (ptr->data.srv_reply.host)
- ares_free(ptr->data.srv_reply.host);
- break;
-
- case ARES_DATATYPE_TXT_REPLY:
- case ARES_DATATYPE_TXT_EXT:
-
- if (ptr->data.txt_reply.next)
- next_data = ptr->data.txt_reply.next;
- if (ptr->data.txt_reply.txt)
- ares_free(ptr->data.txt_reply.txt);
- break;
-
- case ARES_DATATYPE_ADDR_NODE:
-
- if (ptr->data.addr_node.next)
- next_data = ptr->data.addr_node.next;
- break;
-
- case ARES_DATATYPE_ADDR_PORT_NODE:
-
- if (ptr->data.addr_port_node.next)
- next_data = ptr->data.addr_port_node.next;
- break;
-
- case ARES_DATATYPE_NAPTR_REPLY:
-
- if (ptr->data.naptr_reply.next)
- next_data = ptr->data.naptr_reply.next;
- if (ptr->data.naptr_reply.flags)
- ares_free(ptr->data.naptr_reply.flags);
- if (ptr->data.naptr_reply.service)
- ares_free(ptr->data.naptr_reply.service);
- if (ptr->data.naptr_reply.regexp)
- ares_free(ptr->data.naptr_reply.regexp);
- if (ptr->data.naptr_reply.replacement)
- ares_free(ptr->data.naptr_reply.replacement);
- break;
-
- case ARES_DATATYPE_SOA_REPLY:
- if (ptr->data.soa_reply.nsname)
- ares_free(ptr->data.soa_reply.nsname);
- if (ptr->data.soa_reply.hostmaster)
- ares_free(ptr->data.soa_reply.hostmaster);
- break;
-
- default:
- return;
- }
-
- ares_free(ptr);
- dataptr = next_data;
- }
-}
-
-
-/*
-** ares_malloc_data() - c-ares internal helper function.
-**
-** This function allocates memory for a c-ares private ares_data struct
-** for the specified ares_datatype, initializes c-ares private fields
-** and zero initializes those which later might be used from the public
-** API. It returns an interior pointer which can be passed by c-ares
-** functions to the calling application, and that must be free'ed using
-** c-ares external API function ares_free_data().
-*/
-
-void *ares_malloc_data(ares_datatype type)
-{
- struct ares_data *ptr;
-
- ptr = ares_malloc(sizeof(struct ares_data));
- if (!ptr)
- return NULL;
-
- switch (type)
- {
- case ARES_DATATYPE_MX_REPLY:
- ptr->data.mx_reply.next = NULL;
- ptr->data.mx_reply.host = NULL;
- ptr->data.mx_reply.priority = 0;
- break;
-
- case ARES_DATATYPE_SRV_REPLY:
- ptr->data.srv_reply.next = NULL;
- ptr->data.srv_reply.host = NULL;
- ptr->data.srv_reply.priority = 0;
- ptr->data.srv_reply.weight = 0;
- ptr->data.srv_reply.port = 0;
- break;
-
- case ARES_DATATYPE_TXT_EXT:
- ptr->data.txt_ext.record_start = 0;
- /* FALLTHROUGH */
-
- case ARES_DATATYPE_TXT_REPLY:
- ptr->data.txt_reply.next = NULL;
- ptr->data.txt_reply.txt = NULL;
- ptr->data.txt_reply.length = 0;
- break;
-
- case ARES_DATATYPE_ADDR_NODE:
- ptr->data.addr_node.next = NULL;
- ptr->data.addr_node.family = 0;
- memset(&ptr->data.addr_node.addrV6, 0,
- sizeof(ptr->data.addr_node.addrV6));
- break;
-
- case ARES_DATATYPE_ADDR_PORT_NODE:
- ptr->data.addr_port_node.next = NULL;
- ptr->data.addr_port_node.family = 0;
- ptr->data.addr_port_node.udp_port = 0;
- ptr->data.addr_port_node.tcp_port = 0;
- memset(&ptr->data.addr_port_node.addrV6, 0,
- sizeof(ptr->data.addr_port_node.addrV6));
- break;
-
- case ARES_DATATYPE_NAPTR_REPLY:
- ptr->data.naptr_reply.next = NULL;
- ptr->data.naptr_reply.flags = NULL;
- ptr->data.naptr_reply.service = NULL;
- ptr->data.naptr_reply.regexp = NULL;
- ptr->data.naptr_reply.replacement = NULL;
- ptr->data.naptr_reply.order = 0;
- ptr->data.naptr_reply.preference = 0;
- break;
-
- case ARES_DATATYPE_SOA_REPLY:
- ptr->data.soa_reply.nsname = NULL;
- ptr->data.soa_reply.hostmaster = NULL;
- ptr->data.soa_reply.serial = 0;
- ptr->data.soa_reply.refresh = 0;
- ptr->data.soa_reply.retry = 0;
- ptr->data.soa_reply.expire = 0;
- ptr->data.soa_reply.minttl = 0;
- break;
-
- default:
- ares_free(ptr);
- return NULL;
- }
-
- ptr->mark = ARES_DATATYPE_MARK;
- ptr->type = type;
-
- return &ptr->data;
-}
diff --git a/grpc/third_party/cares/cares/ares_data.h b/grpc/third_party/cares/cares/ares_data.h
deleted file mode 100644
index ffee2be6..00000000
--- a/grpc/third_party/cares/cares/ares_data.h
+++ /dev/null
@@ -1,72 +0,0 @@
-
-/* Copyright (C) 2009-2013 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-typedef enum {
- ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */
- ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */
- ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */
- ARES_DATATYPE_TXT_EXT, /* struct ares_txt_ext - introduced in 1.11.0 */
- ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */
- ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */
- ARES_DATATYPE_NAPTR_REPLY,/* struct ares_naptr_reply - introduced in 1.7.6 */
- ARES_DATATYPE_SOA_REPLY, /* struct ares_soa_reply - introduced in 1.9.0 */
-#if 0
- ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */
- ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */
- ARES_DATATYPE_HOSTENT, /* struct hostent */
- ARES_DATATYPE_OPTIONS, /* struct ares_options */
-#endif
- ARES_DATATYPE_ADDR_PORT_NODE, /* struct ares_addr_port_node - introduced in 1.11.0 */
- ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */
-} ares_datatype;
-
-#define ARES_DATATYPE_MARK 0xbead
-
-/*
- * ares_data struct definition is internal to c-ares and shall not
- * be exposed by the public API in order to allow future changes
- * and extensions to it without breaking ABI. This will be used
- * internally by c-ares as the container of multiple types of data
- * dynamically allocated for which a reference will be returned
- * to the calling application.
- *
- * c-ares API functions returning a pointer to c-ares internally
- * allocated data will actually be returning an interior pointer
- * into this ares_data struct.
- *
- * All this is 'invisible' to the calling application, the only
- * requirement is that this kind of data must be free'ed by the
- * calling application using ares_free_data() with the pointer
- * it has received from a previous c-ares function call.
- */
-
-struct ares_data {
- ares_datatype type; /* Actual data type identifier. */
- unsigned int mark; /* Private ares_data signature. */
- union {
- struct ares_txt_reply txt_reply;
- struct ares_txt_ext txt_ext;
- struct ares_srv_reply srv_reply;
- struct ares_addr_node addr_node;
- struct ares_addr_port_node addr_port_node;
- struct ares_mx_reply mx_reply;
- struct ares_naptr_reply naptr_reply;
- struct ares_soa_reply soa_reply;
- } data;
-};
-
-void *ares_malloc_data(ares_datatype type);
-
diff --git a/grpc/third_party/cares/cares/ares_dns.h b/grpc/third_party/cares/cares/ares_dns.h
deleted file mode 100644
index 79f993b9..00000000
--- a/grpc/third_party/cares/cares/ares_dns.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef HEADER_CARES_DNS_H
-#define HEADER_CARES_DNS_H
-
-/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-/*
- * Macro DNS__16BIT reads a network short (16 bit) given in network
- * byte order, and returns its value as an unsigned short.
- */
-#define DNS__16BIT(p) ((unsigned short)((unsigned int) 0xffff & \
- (((unsigned int)((unsigned char)(p)[0]) << 8U) | \
- ((unsigned int)((unsigned char)(p)[1])))))
-
-/*
- * Macro DNS__32BIT reads a network long (32 bit) given in network
- * byte order, and returns its value as an unsigned int.
- */
-#define DNS__32BIT(p) ((unsigned int) \
- (((unsigned int)((unsigned char)(p)[0]) << 24U) | \
- ((unsigned int)((unsigned char)(p)[1]) << 16U) | \
- ((unsigned int)((unsigned char)(p)[2]) << 8U) | \
- ((unsigned int)((unsigned char)(p)[3]))))
-
-#define DNS__SET16BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 8) & 0xff)), \
- ((p)[1] = (unsigned char)((v) & 0xff)))
-#define DNS__SET32BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 24) & 0xff)), \
- ((p)[1] = (unsigned char)(((v) >> 16) & 0xff)), \
- ((p)[2] = (unsigned char)(((v) >> 8) & 0xff)), \
- ((p)[3] = (unsigned char)((v) & 0xff)))
-
-#if 0
-/* we cannot use this approach on systems where we can't access 16/32 bit
- data on un-aligned addresses */
-#define DNS__16BIT(p) ntohs(*(unsigned short*)(p))
-#define DNS__32BIT(p) ntohl(*(unsigned long*)(p))
-#define DNS__SET16BIT(p, v) *(unsigned short*)(p) = htons(v)
-#define DNS__SET32BIT(p, v) *(unsigned long*)(p) = htonl(v)
-#endif
-
-/* Macros for parsing a DNS header */
-#define DNS_HEADER_QID(h) DNS__16BIT(h)
-#define DNS_HEADER_QR(h) (((h)[2] >> 7) & 0x1)
-#define DNS_HEADER_OPCODE(h) (((h)[2] >> 3) & 0xf)
-#define DNS_HEADER_AA(h) (((h)[2] >> 2) & 0x1)
-#define DNS_HEADER_TC(h) (((h)[2] >> 1) & 0x1)
-#define DNS_HEADER_RD(h) ((h)[2] & 0x1)
-#define DNS_HEADER_RA(h) (((h)[3] >> 7) & 0x1)
-#define DNS_HEADER_Z(h) (((h)[3] >> 4) & 0x7)
-#define DNS_HEADER_RCODE(h) ((h)[3] & 0xf)
-#define DNS_HEADER_QDCOUNT(h) DNS__16BIT((h) + 4)
-#define DNS_HEADER_ANCOUNT(h) DNS__16BIT((h) + 6)
-#define DNS_HEADER_NSCOUNT(h) DNS__16BIT((h) + 8)
-#define DNS_HEADER_ARCOUNT(h) DNS__16BIT((h) + 10)
-
-/* Macros for constructing a DNS header */
-#define DNS_HEADER_SET_QID(h, v) DNS__SET16BIT(h, v)
-#define DNS_HEADER_SET_QR(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 7))
-#define DNS_HEADER_SET_OPCODE(h, v) ((h)[2] |= (unsigned char)(((v) & 0xf) << 3))
-#define DNS_HEADER_SET_AA(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 2))
-#define DNS_HEADER_SET_TC(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 1))
-#define DNS_HEADER_SET_RD(h, v) ((h)[2] |= (unsigned char)((v) & 0x1))
-#define DNS_HEADER_SET_RA(h, v) ((h)[3] |= (unsigned char)(((v) & 0x1) << 7))
-#define DNS_HEADER_SET_Z(h, v) ((h)[3] |= (unsigned char)(((v) & 0x7) << 4))
-#define DNS_HEADER_SET_RCODE(h, v) ((h)[3] |= (unsigned char)((v) & 0xf))
-#define DNS_HEADER_SET_QDCOUNT(h, v) DNS__SET16BIT((h) + 4, v)
-#define DNS_HEADER_SET_ANCOUNT(h, v) DNS__SET16BIT((h) + 6, v)
-#define DNS_HEADER_SET_NSCOUNT(h, v) DNS__SET16BIT((h) + 8, v)
-#define DNS_HEADER_SET_ARCOUNT(h, v) DNS__SET16BIT((h) + 10, v)
-
-/* Macros for parsing the fixed part of a DNS question */
-#define DNS_QUESTION_TYPE(q) DNS__16BIT(q)
-#define DNS_QUESTION_CLASS(q) DNS__16BIT((q) + 2)
-
-/* Macros for constructing the fixed part of a DNS question */
-#define DNS_QUESTION_SET_TYPE(q, v) DNS__SET16BIT(q, v)
-#define DNS_QUESTION_SET_CLASS(q, v) DNS__SET16BIT((q) + 2, v)
-
-/* Macros for parsing the fixed part of a DNS resource record */
-#define DNS_RR_TYPE(r) DNS__16BIT(r)
-#define DNS_RR_CLASS(r) DNS__16BIT((r) + 2)
-#define DNS_RR_TTL(r) DNS__32BIT((r) + 4)
-#define DNS_RR_LEN(r) DNS__16BIT((r) + 8)
-
-/* Macros for constructing the fixed part of a DNS resource record */
-#define DNS_RR_SET_TYPE(r, v) DNS__SET16BIT(r, v)
-#define DNS_RR_SET_CLASS(r, v) DNS__SET16BIT((r) + 2, v)
-#define DNS_RR_SET_TTL(r, v) DNS__SET32BIT((r) + 4, v)
-#define DNS_RR_SET_LEN(r, v) DNS__SET16BIT((r) + 8, v)
-
-#endif /* HEADER_CARES_DNS_H */
diff --git a/grpc/third_party/cares/cares/ares_expand_name.c b/grpc/third_party/cares/cares/ares_expand_name.c
deleted file mode 100644
index 3a38e673..00000000
--- a/grpc/third_party/cares/cares/ares_expand_name.c
+++ /dev/null
@@ -1,209 +0,0 @@
-
-/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_nowarn.h"
-#include "ares_private.h" /* for the memdebug */
-
-/* Maximum number of indirections allowed for a name */
-#define MAX_INDIRS 50
-
-static int name_length(const unsigned char *encoded, const unsigned char *abuf,
- int alen);
-
-/* Expand an RFC1035-encoded domain name given by encoded. The
- * containing message is given by abuf and alen. The result given by
- * *s, which is set to a NUL-terminated allocated buffer. *enclen is
- * set to the length of the encoded name (not the length of the
- * expanded name; the goal is to tell the caller how many bytes to
- * move forward to get past the encoded name).
- *
- * In the simple case, an encoded name is a series of labels, each
- * composed of a one-byte length (limited to values between 0 and 63
- * inclusive) followed by the label contents. The name is terminated
- * by a zero-length label.
- *
- * In the more complicated case, a label may be terminated by an
- * indirection pointer, specified by two bytes with the high bits of
- * the first byte (corresponding to INDIR_MASK) set to 11. With the
- * two high bits of the first byte stripped off, the indirection
- * pointer gives an offset from the beginning of the containing
- * message with more labels to decode. Indirection can happen an
- * arbitrary number of times, so we have to detect loops.
- *
- * Since the expanded name uses '.' as a label separator, we use
- * backslashes to escape periods or backslashes in the expanded name.
- */
-
-int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
- int alen, char **s, long *enclen)
-{
- int len, indir = 0;
- char *q;
- const unsigned char *p;
- union {
- ares_ssize_t sig;
- size_t uns;
- } nlen;
-
- nlen.sig = name_length(encoded, abuf, alen);
- if (nlen.sig < 0)
- return ARES_EBADNAME;
-
- *s = ares_malloc(nlen.uns + 1);
- if (!*s)
- return ARES_ENOMEM;
- q = *s;
-
- if (nlen.uns == 0) {
- /* RFC2181 says this should be ".": the root of the DNS tree.
- * Since this function strips trailing dots though, it becomes ""
- */
- q[0] = '\0';
-
- /* indirect root label (like 0xc0 0x0c) is 2 bytes long (stupid, but
- valid) */
- if ((*encoded & INDIR_MASK) == INDIR_MASK)
- *enclen = 2L;
- else
- *enclen = 1L; /* the caller should move one byte to get past this */
-
- return ARES_SUCCESS;
- }
-
- /* No error-checking necessary; it was all done by name_length(). */
- p = encoded;
- while (*p)
- {
- if ((*p & INDIR_MASK) == INDIR_MASK)
- {
- if (!indir)
- {
- *enclen = aresx_uztosl(p + 2U - encoded);
- indir = 1;
- }
- p = abuf + ((*p & ~INDIR_MASK) << 8 | *(p + 1));
- }
- else
- {
- len = *p;
- p++;
- while (len--)
- {
- if (*p == '.' || *p == '\\')
- *q++ = '\\';
- *q++ = *p;
- p++;
- }
- *q++ = '.';
- }
- }
- if (!indir)
- *enclen = aresx_uztosl(p + 1U - encoded);
-
- /* Nuke the trailing period if we wrote one. */
- if (q > *s)
- *(q - 1) = 0;
- else
- *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */
-
- return ARES_SUCCESS;
-}
-
-/* Return the length of the expansion of an encoded domain name, or
- * -1 if the encoding is invalid.
- */
-static int name_length(const unsigned char *encoded, const unsigned char *abuf,
- int alen)
-{
- int n = 0, offset, indir = 0, top;
-
- /* Allow the caller to pass us abuf + alen and have us check for it. */
- if (encoded >= abuf + alen)
- return -1;
-
- while (*encoded)
- {
- top = (*encoded & INDIR_MASK);
- if (top == INDIR_MASK)
- {
- /* Check the offset and go there. */
- if (encoded + 1 >= abuf + alen)
- return -1;
- offset = (*encoded & ~INDIR_MASK) << 8 | *(encoded + 1);
- if (offset >= alen)
- return -1;
- encoded = abuf + offset;
-
- /* If we've seen more indirects than the message length,
- * then there's a loop.
- */
- ++indir;
- if (indir > alen || indir > MAX_INDIRS)
- return -1;
- }
- else if (top == 0x00)
- {
- offset = *encoded;
- if (encoded + offset + 1 >= abuf + alen)
- return -1;
- encoded++;
- while (offset--)
- {
- n += (*encoded == '.' || *encoded == '\\') ? 2 : 1;
- encoded++;
- }
- n++;
- }
- else
- {
- /* RFC 1035 4.1.4 says other options (01, 10) for top 2
- * bits are reserved.
- */
- return -1;
- }
- }
-
- /* If there were any labels at all, then the number of dots is one
- * less than the number of labels, so subtract one.
- */
- return (n) ? n - 1 : n;
-}
-
-/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
-int ares__expand_name_for_response(const unsigned char *encoded,
- const unsigned char *abuf, int alen,
- char **s, long *enclen)
-{
- int status = ares_expand_name(encoded, abuf, alen, s, enclen);
- if (status == ARES_EBADNAME)
- status = ARES_EBADRESP;
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_expand_string.c b/grpc/third_party/cares/cares/ares_expand_string.c
deleted file mode 100644
index d35df752..00000000
--- a/grpc/third_party/cares/cares/ares_expand_string.c
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-
-#include "ares.h"
-#include "ares_private.h" /* for the memdebug */
-
-/* Simply decodes a length-encoded character string. The first byte of the
- * input is the length of the string to be returned and the bytes thereafter
- * are the characters of the string. The returned result will be NULL
- * terminated.
- */
-int ares_expand_string(const unsigned char *encoded,
- const unsigned char *abuf,
- int alen,
- unsigned char **s,
- long *enclen)
-{
- unsigned char *q;
- union {
- ares_ssize_t sig;
- size_t uns;
- } elen;
-
- if (encoded == abuf+alen)
- return ARES_EBADSTR;
-
- elen.uns = *encoded;
- if (encoded+elen.sig+1 > abuf+alen)
- return ARES_EBADSTR;
-
- encoded++;
-
- *s = ares_malloc(elen.uns+1);
- if (*s == NULL)
- return ARES_ENOMEM;
- q = *s;
- strncpy((char *)q, (char *)encoded, elen.uns);
- q[elen.uns] = '\0';
-
- *s = q;
-
- *enclen = (long)(elen.sig+1);
-
- return ARES_SUCCESS;
-}
-
diff --git a/grpc/third_party/cares/cares/ares_free_hostent.c b/grpc/third_party/cares/cares/ares_free_hostent.c
deleted file mode 100644
index cfc5f81f..00000000
--- a/grpc/third_party/cares/cares/ares_free_hostent.c
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include "ares.h"
-#include "ares_private.h" /* for memdebug */
-
-void ares_free_hostent(struct hostent *host)
-{
- char **p;
-
- if (!host)
- return;
-
- ares_free((char *)(host->h_name));
- for (p = host->h_aliases; *p; p++)
- ares_free(*p);
- ares_free(host->h_aliases);
- ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries,
- there is only one malloc for all of them */
- ares_free(host->h_addr_list);
- ares_free(host);
-}
diff --git a/grpc/third_party/cares/cares/ares_getenv.c b/grpc/third_party/cares/cares/ares_getenv.c
deleted file mode 100644
index 1b2e85d2..00000000
--- a/grpc/third_party/cares/cares/ares_getenv.c
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-#include "ares_getenv.h"
-
-#ifndef HAVE_GETENV
-
-char *ares_getenv(const char *name)
-{
-#ifdef _WIN32_WCE
- return NULL;
-#endif
-}
-
-#endif
diff --git a/grpc/third_party/cares/cares/ares_gethostbyaddr.c b/grpc/third_party/cares/cares/ares_gethostbyaddr.c
deleted file mode 100644
index a8ca0f57..00000000
--- a/grpc/third_party/cares/cares/ares_gethostbyaddr.c
+++ /dev/null
@@ -1,294 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_inet_net_pton.h"
-#include "ares_platform.h"
-#include "ares_private.h"
-
-#ifdef WATT32
-#undef WIN32
-#endif
-
-struct addr_query {
- /* Arguments passed to ares_gethostbyaddr() */
- ares_channel channel;
- struct ares_addr addr;
- ares_host_callback callback;
- void *arg;
-
- const char *remaining_lookups;
- int timeouts;
-};
-
-static void next_lookup(struct addr_query *aquery);
-static void addr_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen);
-static void end_aquery(struct addr_query *aquery, int status,
- struct hostent *host);
-static int file_lookup(struct ares_addr *addr, struct hostent **host);
-static void ptr_rr_name(char *name, const struct ares_addr *addr);
-
-void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
- int family, ares_host_callback callback, void *arg)
-{
- struct addr_query *aquery;
-
- if (family != AF_INET && family != AF_INET6)
- {
- callback(arg, ARES_ENOTIMP, 0, NULL);
- return;
- }
-
- if ((family == AF_INET && addrlen != sizeof(aquery->addr.addrV4)) ||
- (family == AF_INET6 && addrlen != sizeof(aquery->addr.addrV6)))
- {
- callback(arg, ARES_ENOTIMP, 0, NULL);
- return;
- }
-
- aquery = ares_malloc(sizeof(struct addr_query));
- if (!aquery)
- {
- callback(arg, ARES_ENOMEM, 0, NULL);
- return;
- }
- aquery->channel = channel;
- if (family == AF_INET)
- memcpy(&aquery->addr.addrV4, addr, sizeof(aquery->addr.addrV4));
- else
- memcpy(&aquery->addr.addrV6, addr, sizeof(aquery->addr.addrV6));
- aquery->addr.family = family;
- aquery->callback = callback;
- aquery->arg = arg;
- aquery->remaining_lookups = channel->lookups;
- aquery->timeouts = 0;
-
- next_lookup(aquery);
-}
-
-static void next_lookup(struct addr_query *aquery)
-{
- const char *p;
- char name[128];
- int status;
- struct hostent *host;
-
- for (p = aquery->remaining_lookups; *p; p++)
- {
- switch (*p)
- {
- case 'b':
- ptr_rr_name(name, &aquery->addr);
- aquery->remaining_lookups = p + 1;
- ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
- aquery);
- return;
- case 'f':
- status = file_lookup(&aquery->addr, &host);
-
- /* this status check below previously checked for !ARES_ENOTFOUND,
- but we should not assume that this single error code is the one
- that can occur, as that is in fact no longer the case */
- if (status == ARES_SUCCESS)
- {
- end_aquery(aquery, status, host);
- return;
- }
- break;
- }
- }
- end_aquery(aquery, ARES_ENOTFOUND, NULL);
-}
-
-static void addr_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen)
-{
- struct addr_query *aquery = (struct addr_query *) arg;
- struct hostent *host;
- size_t addrlen;
-
- aquery->timeouts += timeouts;
- if (status == ARES_SUCCESS)
- {
- if (aquery->addr.family == AF_INET)
- {
- addrlen = sizeof(aquery->addr.addrV4);
- status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
- (int)addrlen, AF_INET, &host);
- }
- else
- {
- addrlen = sizeof(aquery->addr.addrV6);
- status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
- (int)addrlen, AF_INET6, &host);
- }
- end_aquery(aquery, status, host);
- }
- else if (status == ARES_EDESTRUCTION || status == ARES_ECANCELLED)
- end_aquery(aquery, status, NULL);
- else
- next_lookup(aquery);
-}
-
-static void end_aquery(struct addr_query *aquery, int status,
- struct hostent *host)
-{
- aquery->callback(aquery->arg, status, aquery->timeouts, host);
- if (host)
- ares_free_hostent(host);
- ares_free(aquery);
-}
-
-static int file_lookup(struct ares_addr *addr, struct hostent **host)
-{
- FILE *fp;
- int status;
- int error;
-
-#ifdef WIN32
- char PATH_HOSTS[MAX_PATH];
- win_platform platform;
-
- PATH_HOSTS[0] = '\0';
-
- platform = ares__getplatform();
-
- if (platform == WIN_NT) {
- char tmp[MAX_PATH];
- HKEY hkeyHosts;
-
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
- &hkeyHosts) == ERROR_SUCCESS)
- {
- DWORD dwLength = MAX_PATH;
- RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
- &dwLength);
- ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
- RegCloseKey(hkeyHosts);
- }
- }
- else if (platform == WIN_9X)
- GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
- else
- return ARES_ENOTFOUND;
-
- strcat(PATH_HOSTS, WIN_PATH_HOSTS);
-
-#elif defined(WATT32)
- extern const char *_w32_GetHostsFile (void);
- const char *PATH_HOSTS = _w32_GetHostsFile();
-
- if (!PATH_HOSTS)
- return ARES_ENOTFOUND;
-#endif
-
- fp = fopen(PATH_HOSTS, "r");
- if (!fp)
- {
- error = ERRNO;
- switch(error)
- {
- case ENOENT:
- case ESRCH:
- return ARES_ENOTFOUND;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
- PATH_HOSTS));
- *host = NULL;
- return ARES_EFILE;
- }
- }
- while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
- {
- if (addr->family != (*host)->h_addrtype)
- {
- ares_free_hostent(*host);
- continue;
- }
- if (addr->family == AF_INET)
- {
- if (memcmp((*host)->h_addr, &addr->addrV4,
- sizeof(addr->addrV4)) == 0)
- break;
- }
- else if (addr->family == AF_INET6)
- {
- if (memcmp((*host)->h_addr, &addr->addrV6,
- sizeof(addr->addrV6)) == 0)
- break;
- }
- ares_free_hostent(*host);
- }
- fclose(fp);
- if (status == ARES_EOF)
- status = ARES_ENOTFOUND;
- if (status != ARES_SUCCESS)
- *host = NULL;
- return status;
-}
-
-static void ptr_rr_name(char *name, const struct ares_addr *addr)
-{
- if (addr->family == AF_INET)
- {
- unsigned long laddr = ntohl(addr->addrV4.s_addr);
- unsigned long a1 = (laddr >> 24UL) & 0xFFUL;
- unsigned long a2 = (laddr >> 16UL) & 0xFFUL;
- unsigned long a3 = (laddr >> 8UL) & 0xFFUL;
- unsigned long a4 = laddr & 0xFFUL;
- sprintf(name, "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1);
- }
- else
- {
- unsigned char *bytes = (unsigned char *)&addr->addrV6;
- /* There are too many arguments to do this in one line using
- * minimally C89-compliant compilers */
- sprintf(name,
- "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
- bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
- bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
- bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
- bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4);
- sprintf(name+strlen(name),
- "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
- bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
- bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
- bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
- bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4);
- }
-}
diff --git a/grpc/third_party/cares/cares/ares_gethostbyname.c b/grpc/third_party/cares/cares/ares_gethostbyname.c
deleted file mode 100644
index 8187746b..00000000
--- a/grpc/third_party/cares/cares/ares_gethostbyname.c
+++ /dev/null
@@ -1,529 +0,0 @@
-
-/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_inet_net_pton.h"
-#include "bitncmp.h"
-#include "ares_platform.h"
-#include "ares_nowarn.h"
-#include "ares_private.h"
-
-#ifdef WATT32
-#undef WIN32
-#endif
-
-struct host_query {
- /* Arguments passed to ares_gethostbyname() */
- ares_channel channel;
- char *name;
- ares_host_callback callback;
- void *arg;
- int sent_family; /* this family is what was is being used */
- int want_family; /* this family is what is asked for in the API */
- const char *remaining_lookups;
- int timeouts;
-};
-
-static void next_lookup(struct host_query *hquery, int status_code);
-static void host_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen);
-static void end_hquery(struct host_query *hquery, int status,
- struct hostent *host);
-static int fake_hostent(const char *name, int family,
- ares_host_callback callback, void *arg);
-static int file_lookup(const char *name, int family, struct hostent **host);
-static void sort_addresses(struct hostent *host,
- const struct apattern *sortlist, int nsort);
-static void sort6_addresses(struct hostent *host,
- const struct apattern *sortlist, int nsort);
-static int get_address_index(const struct in_addr *addr,
- const struct apattern *sortlist, int nsort);
-static int get6_address_index(const struct ares_in6_addr *addr,
- const struct apattern *sortlist, int nsort);
-
-void ares_gethostbyname(ares_channel channel, const char *name, int family,
- ares_host_callback callback, void *arg)
-{
- struct host_query *hquery;
-
- /* Right now we only know how to look up Internet addresses - and unspec
- means try both basically. */
- switch (family) {
- case AF_INET:
- case AF_INET6:
- case AF_UNSPEC:
- break;
- default:
- callback(arg, ARES_ENOTIMP, 0, NULL);
- return;
- }
-
- /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
- if (ares__is_onion_domain(name))
- {
- callback(arg, ARES_ENOTFOUND, 0, NULL);
- return;
- }
-
- if (fake_hostent(name, family, callback, arg))
- return;
-
- /* Allocate and fill in the host query structure. */
- hquery = ares_malloc(sizeof(struct host_query));
- if (!hquery)
- {
- callback(arg, ARES_ENOMEM, 0, NULL);
- return;
- }
- hquery->channel = channel;
- hquery->name = ares_strdup(name);
- hquery->want_family = family;
- hquery->sent_family = -1; /* nothing is sent yet */
- if (!hquery->name) {
- ares_free(hquery);
- callback(arg, ARES_ENOMEM, 0, NULL);
- return;
- }
- hquery->callback = callback;
- hquery->arg = arg;
- hquery->remaining_lookups = channel->lookups;
- hquery->timeouts = 0;
-
- /* Start performing lookups according to channel->lookups. */
- next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */);
-}
-
-static void next_lookup(struct host_query *hquery, int status_code)
-{
- const char *p;
- struct hostent *host;
- int status = status_code;
-
- for (p = hquery->remaining_lookups; *p; p++)
- {
- switch (*p)
- {
- case 'b':
- /* DNS lookup */
- hquery->remaining_lookups = p + 1;
- if ((hquery->want_family == AF_INET6) ||
- (hquery->want_family == AF_UNSPEC)) {
- /* if inet6 or unspec, start out with AAAA */
- hquery->sent_family = AF_INET6;
- ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
- host_callback, hquery);
- }
- else {
- hquery->sent_family = AF_INET;
- ares_search(hquery->channel, hquery->name, C_IN, T_A,
- host_callback, hquery);
- }
- return;
-
- case 'f':
- /* Host file lookup */
- status = file_lookup(hquery->name, hquery->want_family, &host);
-
- /* this status check below previously checked for !ARES_ENOTFOUND,
- but we should not assume that this single error code is the one
- that can occur, as that is in fact no longer the case */
- if (status == ARES_SUCCESS)
- {
- end_hquery(hquery, status, host);
- return;
- }
- status = status_code; /* Use original status code */
- break;
- }
- }
- end_hquery(hquery, status, NULL);
-}
-
-static void host_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen)
-{
- struct host_query *hquery = (struct host_query *) arg;
- ares_channel channel = hquery->channel;
- struct hostent *host = NULL;
-
- hquery->timeouts += timeouts;
- if (status == ARES_SUCCESS)
- {
- if (hquery->sent_family == AF_INET)
- {
- status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
- if (host && channel->nsort)
- sort_addresses(host, channel->sortlist, channel->nsort);
- }
- else if (hquery->sent_family == AF_INET6)
- {
- status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
- if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
- (status == ARES_SUCCESS && host && host->h_addr_list[0] == NULL)) &&
- hquery->want_family == AF_UNSPEC) {
- /* The query returned something but either there were no AAAA
- records (e.g. just CNAME) or the response was malformed. Try
- looking up A instead. */
- if (host)
- ares_free_hostent(host);
- hquery->sent_family = AF_INET;
- ares_search(hquery->channel, hquery->name, C_IN, T_A,
- host_callback, hquery);
- return;
- }
- if (host && channel->nsort)
- sort6_addresses(host, channel->sortlist, channel->nsort);
- }
- end_hquery(hquery, status, host);
- }
- else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
- status == ARES_ETIMEOUT) && (hquery->sent_family == AF_INET6 &&
- hquery->want_family == AF_UNSPEC))
- {
- /* The AAAA query yielded no useful result. Now look up an A instead. */
- hquery->sent_family = AF_INET;
- ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
- hquery);
- }
- else if (status == ARES_EDESTRUCTION)
- end_hquery(hquery, status, NULL);
- else
- next_lookup(hquery, status);
-}
-
-static void end_hquery(struct host_query *hquery, int status,
- struct hostent *host)
-{
- hquery->callback(hquery->arg, status, hquery->timeouts, host);
- if (host)
- ares_free_hostent(host);
- ares_free(hquery->name);
- ares_free(hquery);
-}
-
-/* If the name looks like an IP address, fake up a host entry, end the
- * query immediately, and return true. Otherwise return false.
- */
-static int fake_hostent(const char *name, int family,
- ares_host_callback callback, void *arg)
-{
- struct hostent hostent;
- char *aliases[1] = { NULL };
- char *addrs[2];
- int result = 0;
- struct in_addr in;
- struct ares_in6_addr in6;
-
- if (family == AF_INET || family == AF_INET6)
- {
- /* It only looks like an IP address if it's all numbers and dots. */
- int numdots = 0, valid = 1;
- const char *p;
- for (p = name; *p; p++)
- {
- if (!ISDIGIT(*p) && *p != '.') {
- valid = 0;
- break;
- } else if (*p == '.') {
- numdots++;
- }
- }
-
- /* if we don't have 3 dots, it is illegal
- * (although inet_addr doesn't think so).
- */
- if (numdots != 3 || !valid)
- result = 0;
- else
- result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
-
- if (result)
- family = AF_INET;
- }
- if (family == AF_INET6)
- result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
-
- if (!result)
- return 0;
-
- if (family == AF_INET)
- {
- hostent.h_length = (int)sizeof(struct in_addr);
- addrs[0] = (char *)&in;
- }
- else if (family == AF_INET6)
- {
- hostent.h_length = (int)sizeof(struct ares_in6_addr);
- addrs[0] = (char *)&in6;
- }
- /* Duplicate the name, to avoid a constness violation. */
- hostent.h_name = ares_strdup(name);
- if (!hostent.h_name)
- {
- callback(arg, ARES_ENOMEM, 0, NULL);
- return 1;
- }
-
- /* Fill in the rest of the host structure and terminate the query. */
- addrs[1] = NULL;
- hostent.h_aliases = aliases;
- hostent.h_addrtype = aresx_sitoss(family);
- hostent.h_addr_list = addrs;
- callback(arg, ARES_SUCCESS, 0, &hostent);
-
- ares_free((char *)(hostent.h_name));
- return 1;
-}
-
-/* This is an API method */
-int ares_gethostbyname_file(ares_channel channel, const char *name,
- int family, struct hostent **host)
-{
- int result;
-
- /* We only take the channel to ensure that ares_init() been called. */
- if(channel == NULL)
- {
- /* Anything will do, really. This seems fine, and is consistent with
- other error cases. */
- *host = NULL;
- return ARES_ENOTFOUND;
- }
-
- /* Just chain to the internal implementation we use here; it's exactly
- * what we want.
- */
- result = file_lookup(name, family, host);
- if(result != ARES_SUCCESS)
- {
- /* We guarantee a NULL hostent on failure. */
- *host = NULL;
- }
- return result;
-}
-
-static int file_lookup(const char *name, int family, struct hostent **host)
-{
- FILE *fp;
- char **alias;
- int status;
- int error;
-
- /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
- if (ares__is_onion_domain(name))
- return ARES_ENOTFOUND;
-
-#ifdef WIN32
- char PATH_HOSTS[MAX_PATH];
- win_platform platform;
-
- PATH_HOSTS[0] = '\0';
-
- platform = ares__getplatform();
-
- if (platform == WIN_NT) {
- char tmp[MAX_PATH];
- HKEY hkeyHosts;
-
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
- &hkeyHosts) == ERROR_SUCCESS)
- {
- DWORD dwLength = MAX_PATH;
- RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
- &dwLength);
- ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
- RegCloseKey(hkeyHosts);
- }
- }
- else if (platform == WIN_9X)
- GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
- else
- return ARES_ENOTFOUND;
-
- strcat(PATH_HOSTS, WIN_PATH_HOSTS);
-
-#elif defined(WATT32)
- extern const char *_w32_GetHostsFile (void);
- const char *PATH_HOSTS = _w32_GetHostsFile();
-
- if (!PATH_HOSTS)
- return ARES_ENOTFOUND;
-#endif
-
- fp = fopen(PATH_HOSTS, "r");
- if (!fp)
- {
- error = ERRNO;
- switch(error)
- {
- case ENOENT:
- case ESRCH:
- return ARES_ENOTFOUND;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
- PATH_HOSTS));
- *host = NULL;
- return ARES_EFILE;
- }
- }
- while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
- {
- if (strcasecmp((*host)->h_name, name) == 0)
- break;
- for (alias = (*host)->h_aliases; *alias; alias++)
- {
- if (strcasecmp(*alias, name) == 0)
- break;
- }
- if (*alias)
- break;
- ares_free_hostent(*host);
- }
- fclose(fp);
- if (status == ARES_EOF)
- status = ARES_ENOTFOUND;
- if (status != ARES_SUCCESS)
- *host = NULL;
- return status;
-}
-
-static void sort_addresses(struct hostent *host,
- const struct apattern *sortlist, int nsort)
-{
- struct in_addr a1, a2;
- int i1, i2, ind1, ind2;
-
- /* This is a simple insertion sort, not optimized at all. i1 walks
- * through the address list, with the loop invariant that everything
- * to the left of i1 is sorted. In the loop body, the value at i1 is moved
- * back through the list (via i2) until it is in sorted order.
- */
- for (i1 = 0; host->h_addr_list[i1]; i1++)
- {
- memcpy(&a1, host->h_addr_list[i1], sizeof(struct in_addr));
- ind1 = get_address_index(&a1, sortlist, nsort);
- for (i2 = i1 - 1; i2 >= 0; i2--)
- {
- memcpy(&a2, host->h_addr_list[i2], sizeof(struct in_addr));
- ind2 = get_address_index(&a2, sortlist, nsort);
- if (ind2 <= ind1)
- break;
- memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct in_addr));
- }
- memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct in_addr));
- }
-}
-
-/* Find the first entry in sortlist which matches addr. Return nsort
- * if none of them match.
- */
-static int get_address_index(const struct in_addr *addr,
- const struct apattern *sortlist,
- int nsort)
-{
- int i;
-
- for (i = 0; i < nsort; i++)
- {
- if (sortlist[i].family != AF_INET)
- continue;
- if (sortlist[i].type == PATTERN_MASK)
- {
- if ((addr->s_addr & sortlist[i].mask.addr4.s_addr)
- == sortlist[i].addrV4.s_addr)
- break;
- }
- else
- {
- if (!ares__bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
- sortlist[i].mask.bits))
- break;
- }
- }
- return i;
-}
-
-static void sort6_addresses(struct hostent *host,
- const struct apattern *sortlist, int nsort)
-{
- struct ares_in6_addr a1, a2;
- int i1, i2, ind1, ind2;
-
- /* This is a simple insertion sort, not optimized at all. i1 walks
- * through the address list, with the loop invariant that everything
- * to the left of i1 is sorted. In the loop body, the value at i1 is moved
- * back through the list (via i2) until it is in sorted order.
- */
- for (i1 = 0; host->h_addr_list[i1]; i1++)
- {
- memcpy(&a1, host->h_addr_list[i1], sizeof(struct ares_in6_addr));
- ind1 = get6_address_index(&a1, sortlist, nsort);
- for (i2 = i1 - 1; i2 >= 0; i2--)
- {
- memcpy(&a2, host->h_addr_list[i2], sizeof(struct ares_in6_addr));
- ind2 = get6_address_index(&a2, sortlist, nsort);
- if (ind2 <= ind1)
- break;
- memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct ares_in6_addr));
- }
- memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct ares_in6_addr));
- }
-}
-
-/* Find the first entry in sortlist which matches addr. Return nsort
- * if none of them match.
- */
-static int get6_address_index(const struct ares_in6_addr *addr,
- const struct apattern *sortlist,
- int nsort)
-{
- int i;
-
- for (i = 0; i < nsort; i++)
- {
- if (sortlist[i].family != AF_INET6)
- continue;
- if (!ares__bitncmp(addr, &sortlist[i].addrV6, sortlist[i].mask.bits))
- break;
- }
- return i;
-}
diff --git a/grpc/third_party/cares/cares/ares_getnameinfo.c b/grpc/third_party/cares/cares/ares_getnameinfo.c
deleted file mode 100644
index aa089417..00000000
--- a/grpc/third_party/cares/cares/ares_getnameinfo.c
+++ /dev/null
@@ -1,453 +0,0 @@
-
-/* Copyright 2005 by Dominick Meglio
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-#include "ares_setup.h"
-
-#ifdef HAVE_GETSERVBYPORT_R
-# if !defined(GETSERVBYPORT_R_ARGS) || \
- (GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
-# error "you MUST specifiy a valid number of arguments for getservbyport_r"
-# endif
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-
-#include "ares.h"
-#include "ares_ipv6.h"
-#include "ares_nowarn.h"
-#include "ares_private.h"
-
-struct nameinfo_query {
- ares_nameinfo_callback callback;
- void *arg;
- union {
- struct sockaddr_in addr4;
- struct sockaddr_in6 addr6;
- } addr;
- int family;
- int flags;
- int timeouts;
-};
-
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-#define IPBUFSIZ \
- (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") + IF_NAMESIZE)
-#else
-#define IPBUFSIZ \
- (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"))
-#endif
-
-static void nameinfo_callback(void *arg, int status, int timeouts,
- struct hostent *host);
-static char *lookup_service(unsigned short port, int flags,
- char *buf, size_t buflen);
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
- char *buf, size_t buflen);
-#endif
-STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2);
-
-void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
- ares_socklen_t salen,
- int flags, ares_nameinfo_callback callback, void *arg)
-{
- struct sockaddr_in *addr = NULL;
- struct sockaddr_in6 *addr6 = NULL;
- struct nameinfo_query *niquery;
- unsigned int port = 0;
-
- /* Validate socket address family and length */
- if ((sa->sa_family == AF_INET) &&
- (salen == sizeof(struct sockaddr_in)))
- {
- addr = (struct sockaddr_in *)sa;
- port = addr->sin_port;
- }
- else if ((sa->sa_family == AF_INET6) &&
- (salen == sizeof(struct sockaddr_in6)))
- {
- addr6 = (struct sockaddr_in6 *)sa;
- port = addr6->sin6_port;
- }
- else
- {
- callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
- return;
- }
-
- /* If neither, assume they want a host */
- if (!(flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
- flags |= ARES_NI_LOOKUPHOST;
-
- /* All they want is a service, no need for DNS */
- if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
- {
- char buf[33], *service;
-
- service = lookup_service((unsigned short)(port & 0xffff),
- flags, buf, sizeof(buf));
- callback(arg, ARES_SUCCESS, 0, NULL, service);
- return;
- }
-
- /* They want a host lookup */
- if ((flags & ARES_NI_LOOKUPHOST))
- {
- /* A numeric host can be handled without DNS */
- if ((flags & ARES_NI_NUMERICHOST))
- {
- char ipbuf[IPBUFSIZ];
- char srvbuf[33];
- char *service = NULL;
- ipbuf[0] = 0;
-
- /* Specifying not to lookup a host, but then saying a host
- * is required has to be illegal.
- */
- if (flags & ARES_NI_NAMEREQD)
- {
- callback(arg, ARES_EBADFLAGS, 0, NULL, NULL);
- return;
- }
- if (salen == sizeof(struct sockaddr_in6))
- {
- ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
- /* If the system supports scope IDs, use it */
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
- append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
-#endif
- }
- else
- {
- ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
- }
- /* They also want a service */
- if (flags & ARES_NI_LOOKUPSERVICE)
- service = lookup_service((unsigned short)(port & 0xffff),
- flags, srvbuf, sizeof(srvbuf));
- callback(arg, ARES_SUCCESS, 0, ipbuf, service);
- return;
- }
- /* This is where a DNS lookup becomes necessary */
- else
- {
- niquery = ares_malloc(sizeof(struct nameinfo_query));
- if (!niquery)
- {
- callback(arg, ARES_ENOMEM, 0, NULL, NULL);
- return;
- }
- niquery->callback = callback;
- niquery->arg = arg;
- niquery->flags = flags;
- niquery->timeouts = 0;
- if (sa->sa_family == AF_INET)
- {
- niquery->family = AF_INET;
- memcpy(&niquery->addr.addr4, addr, sizeof(niquery->addr.addr4));
- ares_gethostbyaddr(channel, &addr->sin_addr,
- sizeof(struct in_addr), AF_INET,
- nameinfo_callback, niquery);
- }
- else
- {
- niquery->family = AF_INET6;
- memcpy(&niquery->addr.addr6, addr6, sizeof(niquery->addr.addr6));
- ares_gethostbyaddr(channel, &addr6->sin6_addr,
- sizeof(struct ares_in6_addr), AF_INET6,
- nameinfo_callback, niquery);
- }
- }
- }
-}
-
-static void nameinfo_callback(void *arg, int status, int timeouts,
- struct hostent *host)
-{
- struct nameinfo_query *niquery = (struct nameinfo_query *) arg;
- char srvbuf[33];
- char *service = NULL;
-
- niquery->timeouts += timeouts;
- if (status == ARES_SUCCESS)
- {
- /* They want a service too */
- if (niquery->flags & ARES_NI_LOOKUPSERVICE)
- {
- if (niquery->family == AF_INET)
- service = lookup_service(niquery->addr.addr4.sin_port,
- niquery->flags, srvbuf, sizeof(srvbuf));
- else
- service = lookup_service(niquery->addr.addr6.sin6_port,
- niquery->flags, srvbuf, sizeof(srvbuf));
- }
- /* NOFQDN means we have to strip off the domain name portion. We do
- this by determining our own domain name, then searching the string
- for this domain name and removing it.
- */
-#ifdef HAVE_GETHOSTNAME
- if (niquery->flags & ARES_NI_NOFQDN)
- {
- char buf[255];
- char *domain;
- gethostname(buf, 255);
- if ((domain = strchr(buf, '.')) != NULL)
- {
- char *end = ares_striendstr(host->h_name, domain);
- if (end)
- *end = 0;
- }
- }
-#endif
- niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts,
- (char *)(host->h_name),
- service);
- ares_free(niquery);
- return;
- }
- /* We couldn't find the host, but it's OK, we can use the IP */
- else if (status == ARES_ENOTFOUND && !(niquery->flags & ARES_NI_NAMEREQD))
- {
- char ipbuf[IPBUFSIZ];
- if (niquery->family == AF_INET)
- ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf,
- IPBUFSIZ);
- else
- {
- ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf,
- IPBUFSIZ);
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
- append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf,
- sizeof(ipbuf));
-#endif
- }
- /* They want a service too */
- if (niquery->flags & ARES_NI_LOOKUPSERVICE)
- {
- if (niquery->family == AF_INET)
- service = lookup_service(niquery->addr.addr4.sin_port,
- niquery->flags, srvbuf, sizeof(srvbuf));
- else
- service = lookup_service(niquery->addr.addr6.sin6_port,
- niquery->flags, srvbuf, sizeof(srvbuf));
- }
- niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf,
- service);
- ares_free(niquery);
- return;
- }
- niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL);
- ares_free(niquery);
-}
-
-static char *lookup_service(unsigned short port, int flags,
- char *buf, size_t buflen)
-{
- const char *proto;
- struct servent *sep;
-#ifdef HAVE_GETSERVBYPORT_R
- struct servent se;
-#endif
- char tmpbuf[4096];
- char *name;
- size_t name_len;
-
- if (port)
- {
- if (flags & ARES_NI_NUMERICSERV)
- sep = NULL;
- else
- {
- if (flags & ARES_NI_UDP)
- proto = "udp";
- else if (flags & ARES_NI_SCTP)
- proto = "sctp";
- else if (flags & ARES_NI_DCCP)
- proto = "dccp";
- else
- proto = "tcp";
-#ifdef HAVE_GETSERVBYPORT_R
- memset(&se, 0, sizeof(se));
- sep = &se;
- memset(tmpbuf, 0, sizeof(tmpbuf));
-#if GETSERVBYPORT_R_ARGS == 6
- if (getservbyport_r(port, proto, &se, (void *)tmpbuf,
- sizeof(tmpbuf), &sep) != 0)
- sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */
-#elif GETSERVBYPORT_R_ARGS == 5
- sep = getservbyport_r(port, proto, &se, (void *)tmpbuf,
- sizeof(tmpbuf));
-#elif GETSERVBYPORT_R_ARGS == 4
- if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0)
- sep = NULL;
-#else
- /* Lets just hope the OS uses TLS! */
- sep = getservbyport(port, proto);
-#endif
-#else
- /* Lets just hope the OS uses TLS! */
-#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
- sep = getservbyport(port, (char*)proto);
-#else
- sep = getservbyport(port, proto);
-#endif
-#endif
- }
- if (sep && sep->s_name)
- {
- /* get service name */
- name = sep->s_name;
- }
- else
- {
- /* get port as a string */
- sprintf(tmpbuf, "%u", (unsigned int)ntohs(port));
- name = tmpbuf;
- }
- name_len = strlen(name);
- if (name_len < buflen)
- /* return it if buffer big enough */
- memcpy(buf, name, name_len + 1);
- else
- /* avoid reusing previous one */
- buf[0] = '\0'; /* LCOV_EXCL_LINE: no real service names are too big */
- return buf;
- }
- buf[0] = '\0';
- return NULL;
-}
-
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
- char *buf, size_t buflen)
-{
-#ifdef HAVE_IF_INDEXTONAME
- int is_ll, is_mcll;
-#endif
- char tmpbuf[IF_NAMESIZE + 2];
- size_t bufl;
- int is_scope_long = sizeof(addr6->sin6_scope_id) > sizeof(unsigned int);
-
- tmpbuf[0] = '%';
-
-#ifdef HAVE_IF_INDEXTONAME
- is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
- is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
- if ((flags & ARES_NI_NUMERICSCOPE) ||
- (!is_ll && !is_mcll))
- {
- if (is_scope_long)
- {
- sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
- }
- else
- {
- sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
- }
- }
- else
- {
- if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL)
- {
- if (is_scope_long)
- {
- sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
- }
- else
- {
- sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
- }
- }
- }
-#else
- if (is_scope_long)
- {
- sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
- }
- else
- {
- sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
- }
- (void) flags;
-#endif
- tmpbuf[IF_NAMESIZE + 1] = '\0';
- bufl = strlen(buf);
-
- if(bufl + strlen(tmpbuf) < buflen)
- /* only append the scopeid string if it fits in the target buffer */
- strcpy(&buf[bufl], tmpbuf);
-}
-#endif
-
-/* Determines if s1 ends with the string in s2 (case-insensitive) */
-STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2)
-{
- const char *c1, *c2, *c1_begin;
- int lo1, lo2;
- size_t s1_len = strlen(s1), s2_len = strlen(s2);
-
- /* If the substr is longer than the full str, it can't match */
- if (s2_len > s1_len)
- return NULL;
-
- /* Jump to the end of s1 minus the length of s2 */
- c1_begin = s1+s1_len-s2_len;
- c1 = (const char *)c1_begin;
- c2 = s2;
- while (c2 < s2+s2_len)
- {
- lo1 = TOLOWER(*c1);
- lo2 = TOLOWER(*c2);
- if (lo1 != lo2)
- return NULL;
- else
- {
- c1++;
- c2++;
- }
- }
- return (char *)c1_begin;
-}
-
-int ares__is_onion_domain(const char *name)
-{
- if (ares_striendstr(name, ".onion"))
- return 1;
-
- if (ares_striendstr(name, ".onion."))
- return 1;
-
- return 0;
-}
diff --git a/grpc/third_party/cares/cares/ares_init.c b/grpc/third_party/cares/cares/ares_init.c
deleted file mode 100644
index ff0dbdf7..00000000
--- a/grpc/third_party/cares/cares/ares_init.c
+++ /dev/null
@@ -1,2615 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2007-2013 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#if defined(ANDROID) || defined(__ANDROID__)
-#include <sys/system_properties.h>
-#include "ares_android.h"
-/* From the Bionic sources */
-#define DNS_PROP_NAME_PREFIX "net.dns"
-#define MAX_DNS_PROPERTIES 8
-#endif
-
-#if defined(CARES_USE_LIBRESOLV)
-#include <resolv.h>
-#endif
-
-#include "ares.h"
-#include "ares_inet_net_pton.h"
-#include "ares_library_init.h"
-#include "ares_nowarn.h"
-#include "ares_platform.h"
-#include "ares_private.h"
-
-#ifdef WATT32
-#undef WIN32 /* Redefined in MingW/MSVC headers */
-#endif
-
-static int init_by_options(ares_channel channel,
- const struct ares_options *options,
- int optmask);
-static int init_by_environment(ares_channel channel);
-static int init_by_resolv_conf(ares_channel channel);
-static int init_by_defaults(ares_channel channel);
-
-#ifndef WATT32
-static int config_nameserver(struct server_state **servers, int *nservers,
- char *str);
-#endif
-static int set_search(ares_channel channel, const char *str);
-static int set_options(ares_channel channel, const char *str);
-static const char *try_option(const char *p, const char *q, const char *opt);
-static int init_id_key(rc4_key* key,int key_data_len);
-
-static int config_sortlist(struct apattern **sortlist, int *nsort,
- const char *str);
-static int sortlist_alloc(struct apattern **sortlist, int *nsort,
- struct apattern *pat);
-static int ip_addr(const char *s, ares_ssize_t len, struct in_addr *addr);
-static void natural_mask(struct apattern *pat);
-#if !defined(WIN32) && !defined(WATT32) && \
- !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
-static int config_domain(ares_channel channel, char *str);
-static int config_lookup(ares_channel channel, const char *str,
- const char *bindch, const char *altbindch,
- const char *filech);
-static char *try_config(char *s, const char *opt, char scc);
-#endif
-
-#define ARES_CONFIG_CHECK(x) (x->lookups && x->nsort > -1 && \
- x->nservers > -1 && \
- x->ndomains > -1 && \
- x->ndots > -1 && x->timeout > -1 && \
- x->tries > -1)
-
-int ares_init(ares_channel *channelptr)
-{
- return ares_init_options(channelptr, NULL, 0);
-}
-
-int ares_init_options(ares_channel *channelptr, struct ares_options *options,
- int optmask)
-{
- ares_channel channel;
- int i;
- int status = ARES_SUCCESS;
- struct timeval now;
-
-#ifdef CURLDEBUG
- const char *env = getenv("CARES_MEMDEBUG");
-
- if (env)
- curl_memdebug(env);
- env = getenv("CARES_MEMLIMIT");
- if (env) {
- char *endptr;
- long num = strtol(env, &endptr, 10);
- if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
- curl_memlimit(num);
- }
-#endif
-
- if (ares_library_initialized() != ARES_SUCCESS)
- return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */
-
- channel = ares_malloc(sizeof(struct ares_channeldata));
- if (!channel) {
- *channelptr = NULL;
- return ARES_ENOMEM;
- }
-
- now = ares__tvnow();
-
- /* Set everything to distinguished values so we know they haven't
- * been set yet.
- */
- channel->flags = -1;
- channel->timeout = -1;
- channel->tries = -1;
- channel->ndots = -1;
- channel->rotate = -1;
- channel->udp_port = -1;
- channel->tcp_port = -1;
- channel->ednspsz = -1;
- channel->socket_send_buffer_size = -1;
- channel->socket_receive_buffer_size = -1;
- channel->nservers = -1;
- channel->ndomains = -1;
- channel->nsort = -1;
- channel->tcp_connection_generation = 0;
- channel->lookups = NULL;
- channel->domains = NULL;
- channel->sortlist = NULL;
- channel->servers = NULL;
- channel->sock_state_cb = NULL;
- channel->sock_state_cb_data = NULL;
- channel->sock_create_cb = NULL;
- channel->sock_create_cb_data = NULL;
- channel->sock_config_cb = NULL;
- channel->sock_config_cb_data = NULL;
- channel->sock_funcs = NULL;
- channel->sock_func_cb_data = NULL;
- channel->resolvconf_path = NULL;
-
- channel->last_server = 0;
- channel->last_timeout_processed = (time_t)now.tv_sec;
-
- memset(&channel->local_dev_name, 0, sizeof(channel->local_dev_name));
- channel->local_ip4 = 0;
- memset(&channel->local_ip6, 0, sizeof(channel->local_ip6));
-
- /* Initialize our lists of queries */
- ares__init_list_head(&(channel->all_queries));
- for (i = 0; i < ARES_QID_TABLE_SIZE; i++)
- {
- ares__init_list_head(&(channel->queries_by_qid[i]));
- }
- for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++)
- {
- ares__init_list_head(&(channel->queries_by_timeout[i]));
- }
-
- /* Initialize configuration by each of the four sources, from highest
- * precedence to lowest.
- */
-
- status = init_by_options(channel, options, optmask);
- if (status != ARES_SUCCESS) {
- DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n",
- ares_strerror(status)));
- /* If we fail to apply user-specified options, fail the whole init process */
- goto done;
- }
- status = init_by_environment(channel);
- if (status != ARES_SUCCESS)
- DEBUGF(fprintf(stderr, "Error: init_by_environment failed: %s\n",
- ares_strerror(status)));
- if (status == ARES_SUCCESS) {
- status = init_by_resolv_conf(channel);
- if (status != ARES_SUCCESS)
- DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
- ares_strerror(status)));
- }
-
- /*
- * No matter what failed or succeeded, seed defaults to provide
- * useful behavior for things that we missed.
- */
- status = init_by_defaults(channel);
- if (status != ARES_SUCCESS)
- DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
- ares_strerror(status)));
-
- /* Generate random key */
-
- if (status == ARES_SUCCESS) {
- status = init_id_key(&channel->id_key, ARES_ID_KEY_LEN);
- if (status == ARES_SUCCESS)
- channel->next_id = ares__generate_new_id(&channel->id_key);
- else
- DEBUGF(fprintf(stderr, "Error: init_id_key failed: %s\n",
- ares_strerror(status)));
- }
-
-done:
- if (status != ARES_SUCCESS)
- {
- /* Something failed; clean up memory we may have allocated. */
- if (channel->servers)
- ares_free(channel->servers);
- if (channel->ndomains != -1)
- ares_strsplit_free(channel->domains, channel->ndomains);
- if (channel->sortlist)
- ares_free(channel->sortlist);
- if(channel->lookups)
- ares_free(channel->lookups);
- if(channel->resolvconf_path)
- ares_free(channel->resolvconf_path);
- ares_free(channel);
- return status;
- }
-
- /* Trim to one server if ARES_FLAG_PRIMARY is set. */
- if ((channel->flags & ARES_FLAG_PRIMARY) && channel->nservers > 1)
- channel->nservers = 1;
-
- ares__init_servers_state(channel);
-
- *channelptr = channel;
- return ARES_SUCCESS;
-}
-
-/* ares_dup() duplicates a channel handle with all its options and returns a
- new channel handle */
-int ares_dup(ares_channel *dest, ares_channel src)
-{
- struct ares_options opts;
- struct ares_addr_port_node *servers;
- int non_v4_default_port = 0;
- int i, rc;
- int optmask;
-
- *dest = NULL; /* in case of failure return NULL explicitly */
-
- /* First get the options supported by the old ares_save_options() function,
- which is most of them */
- rc = ares_save_options(src, &opts, &optmask);
- if(rc)
- {
- ares_destroy_options(&opts);
- return rc;
- }
-
- /* Then create the new channel with those options */
- rc = ares_init_options(dest, &opts, optmask);
-
- /* destroy the options copy to not leak any memory */
- ares_destroy_options(&opts);
-
- if(rc)
- return rc;
-
- /* Now clone the options that ares_save_options() doesn't support. */
- (*dest)->sock_create_cb = src->sock_create_cb;
- (*dest)->sock_create_cb_data = src->sock_create_cb_data;
- (*dest)->sock_config_cb = src->sock_config_cb;
- (*dest)->sock_config_cb_data = src->sock_config_cb_data;
- (*dest)->sock_funcs = src->sock_funcs;
- (*dest)->sock_func_cb_data = src->sock_func_cb_data;
-
- strncpy((*dest)->local_dev_name, src->local_dev_name,
- sizeof((*dest)->local_dev_name));
- (*dest)->local_ip4 = src->local_ip4;
- memcpy((*dest)->local_ip6, src->local_ip6, sizeof(src->local_ip6));
-
- /* Full name server cloning required if there is a non-IPv4, or non-default port, nameserver */
- for (i = 0; i < src->nservers; i++)
- {
- if ((src->servers[i].addr.family != AF_INET) ||
- (src->servers[i].addr.udp_port != 0) ||
- (src->servers[i].addr.tcp_port != 0)) {
- non_v4_default_port++;
- break;
- }
- }
- if (non_v4_default_port) {
- rc = ares_get_servers_ports(src, &servers);
- if (rc != ARES_SUCCESS) {
- ares_destroy(*dest);
- *dest = NULL;
- return rc;
- }
- rc = ares_set_servers_ports(*dest, servers);
- ares_free_data(servers);
- if (rc != ARES_SUCCESS) {
- ares_destroy(*dest);
- *dest = NULL;
- return rc;
- }
- }
-
- return ARES_SUCCESS; /* everything went fine */
-}
-
-/* Save options from initialized channel */
-int ares_save_options(ares_channel channel, struct ares_options *options,
- int *optmask)
-{
- int i, j;
- int ipv4_nservers = 0;
-
- /* Zero everything out */
- memset(options, 0, sizeof(struct ares_options));
-
- if (!ARES_CONFIG_CHECK(channel))
- return ARES_ENODATA;
-
- /* Traditionally the optmask wasn't saved in the channel struct so it was
- recreated here. ROTATE is the first option that has no struct field of
- its own in the public config struct */
- (*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
- ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
- ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
- ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS);
- (*optmask) |= (channel->rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE);
-
- if (channel->resolvconf_path)
- (*optmask) |= ARES_OPT_RESOLVCONF;
-
- /* Copy easy stuff */
- options->flags = channel->flags;
-
- /* We return full millisecond resolution but that's only because we don't
- set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */
- options->timeout = channel->timeout;
- options->tries = channel->tries;
- options->ndots = channel->ndots;
- options->udp_port = ntohs(aresx_sitous(channel->udp_port));
- options->tcp_port = ntohs(aresx_sitous(channel->tcp_port));
- options->sock_state_cb = channel->sock_state_cb;
- options->sock_state_cb_data = channel->sock_state_cb_data;
-
- /* Copy IPv4 servers that use the default port */
- if (channel->nservers) {
- for (i = 0; i < channel->nservers; i++)
- {
- if ((channel->servers[i].addr.family == AF_INET) &&
- (channel->servers[i].addr.udp_port == 0) &&
- (channel->servers[i].addr.tcp_port == 0))
- ipv4_nservers++;
- }
- if (ipv4_nservers) {
- options->servers = ares_malloc(ipv4_nservers * sizeof(struct in_addr));
- if (!options->servers)
- return ARES_ENOMEM;
- for (i = j = 0; i < channel->nservers; i++)
- {
- if ((channel->servers[i].addr.family == AF_INET) &&
- (channel->servers[i].addr.udp_port == 0) &&
- (channel->servers[i].addr.tcp_port == 0))
- memcpy(&options->servers[j++],
- &channel->servers[i].addr.addrV4,
- sizeof(channel->servers[i].addr.addrV4));
- }
- }
- }
- options->nservers = ipv4_nservers;
-
- /* copy domains */
- if (channel->ndomains) {
- options->domains = ares_malloc(channel->ndomains * sizeof(char *));
- if (!options->domains)
- return ARES_ENOMEM;
-
- for (i = 0; i < channel->ndomains; i++)
- {
- options->ndomains = i;
- options->domains[i] = ares_strdup(channel->domains[i]);
- if (!options->domains[i])
- return ARES_ENOMEM;
- }
- }
- options->ndomains = channel->ndomains;
-
- /* copy lookups */
- if (channel->lookups) {
- options->lookups = ares_strdup(channel->lookups);
- if (!options->lookups && channel->lookups)
- return ARES_ENOMEM;
- }
-
- /* copy sortlist */
- if (channel->nsort) {
- options->sortlist = ares_malloc(channel->nsort * sizeof(struct apattern));
- if (!options->sortlist)
- return ARES_ENOMEM;
- for (i = 0; i < channel->nsort; i++)
- options->sortlist[i] = channel->sortlist[i];
- }
- options->nsort = channel->nsort;
-
- /* copy path for resolv.conf file */
- if (channel->resolvconf_path) {
- options->resolvconf_path = ares_strdup(channel->resolvconf_path);
- if (!options->resolvconf_path)
- return ARES_ENOMEM;
- }
-
- return ARES_SUCCESS;
-}
-
-static int init_by_options(ares_channel channel,
- const struct ares_options *options,
- int optmask)
-{
- int i;
-
- /* Easy stuff. */
- if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
- channel->flags = options->flags;
- if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1)
- channel->timeout = options->timeout;
- else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
- channel->timeout = options->timeout * 1000;
- if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
- channel->tries = options->tries;
- if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
- channel->ndots = options->ndots;
- if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
- channel->rotate = 1;
- if ((optmask & ARES_OPT_NOROTATE) && channel->rotate == -1)
- channel->rotate = 0;
- if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
- channel->udp_port = htons(options->udp_port);
- if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
- channel->tcp_port = htons(options->tcp_port);
- if ((optmask & ARES_OPT_SOCK_STATE_CB) && channel->sock_state_cb == NULL)
- {
- channel->sock_state_cb = options->sock_state_cb;
- channel->sock_state_cb_data = options->sock_state_cb_data;
- }
- if ((optmask & ARES_OPT_SOCK_SNDBUF)
- && channel->socket_send_buffer_size == -1)
- channel->socket_send_buffer_size = options->socket_send_buffer_size;
- if ((optmask & ARES_OPT_SOCK_RCVBUF)
- && channel->socket_receive_buffer_size == -1)
- channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
-
- if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1)
- channel->ednspsz = options->ednspsz;
-
- /* Copy the IPv4 servers, if given. */
- if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
- {
- /* Avoid zero size allocations at any cost */
- if (options->nservers > 0)
- {
- channel->servers =
- ares_malloc(options->nservers * sizeof(struct server_state));
- if (!channel->servers)
- return ARES_ENOMEM;
- for (i = 0; i < options->nservers; i++)
- {
- channel->servers[i].addr.family = AF_INET;
- channel->servers[i].addr.udp_port = 0;
- channel->servers[i].addr.tcp_port = 0;
- memcpy(&channel->servers[i].addr.addrV4,
- &options->servers[i],
- sizeof(channel->servers[i].addr.addrV4));
- }
- }
- channel->nservers = options->nservers;
- }
-
- /* Copy the domains, if given. Keep channel->ndomains consistent so
- * we can clean up in case of error.
- */
- if ((optmask & ARES_OPT_DOMAINS) && channel->ndomains == -1)
- {
- /* Avoid zero size allocations at any cost */
- if (options->ndomains > 0)
- {
- channel->domains = ares_malloc(options->ndomains * sizeof(char *));
- if (!channel->domains)
- return ARES_ENOMEM;
- for (i = 0; i < options->ndomains; i++)
- {
- channel->ndomains = i;
- channel->domains[i] = ares_strdup(options->domains[i]);
- if (!channel->domains[i])
- return ARES_ENOMEM;
- }
- }
- channel->ndomains = options->ndomains;
- }
-
- /* Set lookups, if given. */
- if ((optmask & ARES_OPT_LOOKUPS) && !channel->lookups)
- {
- channel->lookups = ares_strdup(options->lookups);
- if (!channel->lookups)
- return ARES_ENOMEM;
- }
-
- /* copy sortlist */
- if ((optmask & ARES_OPT_SORTLIST) && (channel->nsort == -1)) {
- if (options->nsort > 0) {
- channel->sortlist = ares_malloc(options->nsort * sizeof(struct apattern));
- if (!channel->sortlist)
- return ARES_ENOMEM;
- for (i = 0; i < options->nsort; i++)
- channel->sortlist[i] = options->sortlist[i];
- }
- channel->nsort = options->nsort;
- }
-
- /* Set path for resolv.conf file, if given. */
- if ((optmask & ARES_OPT_RESOLVCONF) && !channel->resolvconf_path)
- {
- channel->resolvconf_path = ares_strdup(options->resolvconf_path);
- if (!channel->resolvconf_path && options->resolvconf_path)
- return ARES_ENOMEM;
- }
-
- channel->optmask = optmask;
-
- return ARES_SUCCESS;
-}
-
-static int init_by_environment(ares_channel channel)
-{
- const char *localdomain, *res_options;
- int status;
-
- localdomain = getenv("LOCALDOMAIN");
- if (localdomain && channel->ndomains == -1)
- {
- status = set_search(channel, localdomain);
- if (status != ARES_SUCCESS)
- return status;
- }
-
- res_options = getenv("RES_OPTIONS");
- if (res_options)
- {
- status = set_options(channel, res_options);
- if (status != ARES_SUCCESS)
- return status; /* LCOV_EXCL_LINE: set_options() never fails */
- }
-
- return ARES_SUCCESS;
-}
-
-#ifdef WIN32
-/*
- * get_REG_SZ()
- *
- * Given a 'hKey' handle to an open registry key and a 'leafKeyName' pointer
- * to the name of the registry leaf key to be queried, fetch it's string
- * value and return a pointer in *outptr to a newly allocated memory area
- * holding it as a null-terminated string.
- *
- * Returns 0 and nullifies *outptr upon inability to return a string value.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Supported on Windows NT 3.5 and newer.
- */
-static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr)
-{
- DWORD size = 0;
- int res;
-
- *outptr = NULL;
-
- /* Find out size of string stored in registry */
- res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, NULL, &size);
- if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size)
- return 0;
-
- /* Allocate buffer of indicated size plus one given that string
- might have been stored without null termination */
- *outptr = ares_malloc(size+1);
- if (!*outptr)
- return 0;
-
- /* Get the value for real */
- res = RegQueryValueExA(hKey, leafKeyName, 0, NULL,
- (unsigned char *)*outptr, &size);
- if ((res != ERROR_SUCCESS) || (size == 1))
- {
- ares_free(*outptr);
- *outptr = NULL;
- return 0;
- }
-
- /* Null terminate buffer allways */
- *(*outptr + size) = '\0';
-
- return 1;
-}
-
-/*
- * get_REG_SZ_9X()
- *
- * Functionally identical to get_REG_SZ()
- *
- * Supported on Windows 95, 98 and ME.
- */
-static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr)
-{
- DWORD dataType = 0;
- DWORD size = 0;
- int res;
-
- *outptr = NULL;
-
- /* Find out size of string stored in registry */
- res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType, NULL, &size);
- if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size)
- return 0;
-
- /* Allocate buffer of indicated size plus one given that string
- might have been stored without null termination */
- *outptr = ares_malloc(size+1);
- if (!*outptr)
- return 0;
-
- /* Get the value for real */
- res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType,
- (unsigned char *)*outptr, &size);
- if ((res != ERROR_SUCCESS) || (size == 1))
- {
- ares_free(*outptr);
- *outptr = NULL;
- return 0;
- }
-
- /* Null terminate buffer allways */
- *(*outptr + size) = '\0';
-
- return 1;
-}
-
-/*
- * get_enum_REG_SZ()
- *
- * Given a 'hKeyParent' handle to an open registry key and a 'leafKeyName'
- * pointer to the name of the registry leaf key to be queried, parent key
- * is enumerated searching in child keys for given leaf key name and its
- * associated string value. When located, this returns a pointer in *outptr
- * to a newly allocated memory area holding it as a null-terminated string.
- *
- * Returns 0 and nullifies *outptr upon inability to return a string value.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Supported on Windows NT 3.5 and newer.
- */
-static int get_enum_REG_SZ(HKEY hKeyParent, const char *leafKeyName,
- char **outptr)
-{
- char enumKeyName[256];
- DWORD enumKeyNameBuffSize;
- DWORD enumKeyIdx = 0;
- HKEY hKeyEnum;
- int gotString;
- int res;
-
- *outptr = NULL;
-
- for(;;)
- {
- enumKeyNameBuffSize = sizeof(enumKeyName);
- res = RegEnumKeyExA(hKeyParent, enumKeyIdx++, enumKeyName,
- &enumKeyNameBuffSize, 0, NULL, NULL, NULL);
- if (res != ERROR_SUCCESS)
- break;
- res = RegOpenKeyExA(hKeyParent, enumKeyName, 0, KEY_QUERY_VALUE,
- &hKeyEnum);
- if (res != ERROR_SUCCESS)
- continue;
- gotString = get_REG_SZ(hKeyEnum, leafKeyName, outptr);
- RegCloseKey(hKeyEnum);
- if (gotString)
- break;
- }
-
- if (!*outptr)
- return 0;
-
- return 1;
-}
-
-/*
- * get_DNS_Registry_9X()
- *
- * Functionally identical to get_DNS_Registry()
- *
- * Implementation supports Windows 95, 98 and ME.
- */
-static int get_DNS_Registry_9X(char **outptr)
-{
- HKEY hKey_VxD_MStcp;
- int gotString;
- int res;
-
- *outptr = NULL;
-
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X, 0, KEY_READ,
- &hKey_VxD_MStcp);
- if (res != ERROR_SUCCESS)
- return 0;
-
- gotString = get_REG_SZ_9X(hKey_VxD_MStcp, NAMESERVER, outptr);
- RegCloseKey(hKey_VxD_MStcp);
-
- if (!gotString || !*outptr)
- return 0;
-
- return 1;
-}
-
-/*
- * get_DNS_Registry_NT()
- *
- * Functionally identical to get_DNS_Registry()
- *
- * Refs: Microsoft Knowledge Base articles KB120642 and KB314053.
- *
- * Implementation supports Windows NT 3.5 and newer.
- */
-static int get_DNS_Registry_NT(char **outptr)
-{
- HKEY hKey_Interfaces = NULL;
- HKEY hKey_Tcpip_Parameters;
- int gotString;
- int res;
-
- *outptr = NULL;
-
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
- &hKey_Tcpip_Parameters);
- if (res != ERROR_SUCCESS)
- return 0;
-
- /*
- ** Global DNS settings override adapter specific parameters when both
- ** are set. Additionally static DNS settings override DHCP-configured
- ** parameters when both are set.
- */
-
- /* Global DNS static parameters */
- gotString = get_REG_SZ(hKey_Tcpip_Parameters, NAMESERVER, outptr);
- if (gotString)
- goto done;
-
- /* Global DNS DHCP-configured parameters */
- gotString = get_REG_SZ(hKey_Tcpip_Parameters, DHCPNAMESERVER, outptr);
- if (gotString)
- goto done;
-
- /* Try adapter specific parameters */
- res = RegOpenKeyExA(hKey_Tcpip_Parameters, "Interfaces", 0,
- KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
- &hKey_Interfaces);
- if (res != ERROR_SUCCESS)
- {
- hKey_Interfaces = NULL;
- goto done;
- }
-
- /* Adapter specific DNS static parameters */
- gotString = get_enum_REG_SZ(hKey_Interfaces, NAMESERVER, outptr);
- if (gotString)
- goto done;
-
- /* Adapter specific DNS DHCP-configured parameters */
- gotString = get_enum_REG_SZ(hKey_Interfaces, DHCPNAMESERVER, outptr);
-
-done:
- if (hKey_Interfaces)
- RegCloseKey(hKey_Interfaces);
-
- RegCloseKey(hKey_Tcpip_Parameters);
-
- if (!gotString || !*outptr)
- return 0;
-
- return 1;
-}
-
-/*
- * get_DNS_Registry()
- *
- * Locates DNS info in the registry. When located, this returns a pointer
- * in *outptr to a newly allocated memory area holding a null-terminated
- * string with a space or comma seperated list of DNS IP addresses.
- *
- * Returns 0 and nullifies *outptr upon inability to return DNSes string.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- */
-static int get_DNS_Registry(char **outptr)
-{
- win_platform platform;
- int gotString = 0;
-
- *outptr = NULL;
-
- platform = ares__getplatform();
-
- if (platform == WIN_NT)
- gotString = get_DNS_Registry_NT(outptr);
- else if (platform == WIN_9X)
- gotString = get_DNS_Registry_9X(outptr);
-
- if (!gotString)
- return 0;
-
- return 1;
-}
-
-static void commanjoin(char** dst, const char* const src, const size_t len)
-{
- char *newbuf;
- size_t newsize;
-
- /* 1 for terminating 0 and 2 for , and terminating 0 */
- newsize = len + (*dst ? (strlen(*dst) + 2) : 1);
- newbuf = ares_realloc(*dst, newsize);
- if (!newbuf)
- return;
- if (*dst == NULL)
- *newbuf = '\0';
- *dst = newbuf;
- if (strlen(*dst) != 0)
- strcat(*dst, ",");
- strncat(*dst, src, len);
-}
-
-/*
- * commajoin()
- *
- * RTF code.
- */
-static void commajoin(char **dst, const char *src)
-{
- commanjoin(dst, src, strlen(src));
-}
-
-/*
- * get_DNS_NetworkParams()
- *
- * Locates DNS info using GetNetworkParams() function from the Internet
- * Protocol Helper (IP Helper) API. When located, this returns a pointer
- * in *outptr to a newly allocated memory area holding a null-terminated
- * string with a space or comma seperated list of DNS IP addresses.
- *
- * Returns 0 and nullifies *outptr upon inability to return DNSes string.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Implementation supports Windows 98 and newer.
- *
- * Note: Ancient PSDK required in order to build a W98 target.
- */
-static int get_DNS_NetworkParams(char **outptr)
-{
- FIXED_INFO *fi, *newfi;
- struct ares_addr namesrvr;
- char *txtaddr;
- IP_ADDR_STRING *ipAddr;
- int res;
- DWORD size = sizeof (*fi);
-
- *outptr = NULL;
-
- /* Verify run-time availability of GetNetworkParams() */
- if (ares_fpGetNetworkParams == ZERO_NULL)
- return 0;
-
- fi = ares_malloc(size);
- if (!fi)
- return 0;
-
- res = (*ares_fpGetNetworkParams) (fi, &size);
- if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
- goto done;
-
- newfi = ares_realloc(fi, size);
- if (!newfi)
- goto done;
-
- fi = newfi;
- res = (*ares_fpGetNetworkParams) (fi, &size);
- if (res != ERROR_SUCCESS)
- goto done;
-
- for (ipAddr = &fi->DnsServerList; ipAddr; ipAddr = ipAddr->Next)
- {
- txtaddr = &ipAddr->IpAddress.String[0];
-
- /* Validate converting textual address to binary format. */
- if (ares_inet_pton(AF_INET, txtaddr, &namesrvr.addrV4) == 1)
- {
- if ((namesrvr.addrV4.S_un.S_addr == INADDR_ANY) ||
- (namesrvr.addrV4.S_un.S_addr == INADDR_NONE))
- continue;
- }
- else if (ares_inet_pton(AF_INET6, txtaddr, &namesrvr.addrV6) == 1)
- {
- if (memcmp(&namesrvr.addrV6, &ares_in6addr_any,
- sizeof(namesrvr.addrV6)) == 0)
- continue;
- }
- else
- continue;
-
- commajoin(outptr, txtaddr);
-
- if (!*outptr)
- break;
- }
-
-done:
- if (fi)
- ares_free(fi);
-
- if (!*outptr)
- return 0;
-
- return 1;
-}
-
-static BOOL ares_IsWindowsVistaOrGreater(void)
-{
- OSVERSIONINFO vinfo;
- memset(&vinfo, 0, sizeof(vinfo));
- vinfo.dwOSVersionInfoSize = sizeof(vinfo);
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4996) /* warning C4996: 'GetVersionExW': was declared deprecated */
-#endif
- if (!GetVersionEx(&vinfo) || vinfo.dwMajorVersion < 6)
- return FALSE;
- return TRUE;
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-}
-
-/* A structure to hold the string form of IPv4 and IPv6 addresses so we can
- * sort them by a metric.
- */
-typedef struct
-{
- /* The metric we sort them by. */
- ULONG metric;
-
- /* Original index of the item, used as a secondary sort parameter to make
- * qsort() stable if the metrics are equal */
- size_t orig_idx;
-
- /* Room enough for the string form of any IPv4 or IPv6 address that
- * ares_inet_ntop() will create. Based on the existing c-ares practice.
- */
- char text[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
-} Address;
-
-/* Sort Address values \a left and \a right by metric, returning the usual
- * indicators for qsort().
- */
-static int compareAddresses(const void *arg1,
- const void *arg2)
-{
- const Address * const left = arg1;
- const Address * const right = arg2;
- /* Lower metric the more preferred */
- if(left->metric < right->metric) return -1;
- if(left->metric > right->metric) return 1;
- /* If metrics are equal, lower original index more preferred */
- if(left->orig_idx < right->orig_idx) return -1;
- if(left->orig_idx > right->orig_idx) return 1;
- return 0;
-}
-
-/* There can be multiple routes to "the Internet". And there can be different
- * DNS servers associated with each of the interfaces that offer those routes.
- * We have to assume that any DNS server can serve any request. But, some DNS
- * servers may only respond if requested over their associated interface. But
- * we also want to use "the preferred route to the Internet" whenever possible
- * (and not use DNS servers on a non-preferred route even by forcing request
- * to go out on the associated non-preferred interface). i.e. We want to use
- * the DNS servers associated with the same interface that we would use to
- * make a general request to anything else.
- *
- * But, Windows won't sort the DNS servers by the metrics associated with the
- * routes and interfaces _even_ though it obviously sends IP packets based on
- * those same routes and metrics. So, we must do it ourselves.
- *
- * So, we sort the DNS servers by the same metric values used to determine how
- * an outgoing IP packet will go, thus effectively using the DNS servers
- * associated with the interface that the DNS requests themselves will
- * travel. This gives us optimal routing and avoids issues where DNS servers
- * won't respond to requests that don't arrive via some specific subnetwork
- * (and thus some specific interface).
- *
- * This function computes the metric we use to sort. On the interface
- * identified by \a luid, it determines the best route to \a dest and combines
- * that route's metric with \a interfaceMetric to compute a metric for the
- * destination address on that interface. This metric can be used as a weight
- * to sort the DNS server addresses associated with each interface (lower is
- * better).
- *
- * Note that by restricting the route search to the specific interface with
- * which the DNS servers are associated, this function asks the question "What
- * is the metric for sending IP packets to this DNS server?" which allows us
- * to sort the DNS servers correctly.
- */
-static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */
- const SOCKADDR_INET * const dest,
- const ULONG interfaceMetric)
-{
- /* On this interface, get the best route to that destination. */
- MIB_IPFORWARD_ROW2 row;
- SOCKADDR_INET ignored;
- if(!ares_fpGetBestRoute2 ||
- ares_fpGetBestRoute2(/* The interface to use. The index is ignored since we are
- * passing a LUID.
- */
- luid, 0,
- /* No specific source address. */
- NULL,
- /* Our destination address. */
- dest,
- /* No options. */
- 0,
- /* The route row. */
- &row,
- /* The best source address, which we don't need. */
- &ignored) != NO_ERROR
- /* If the metric is "unused" (-1) or too large for us to add the two
- * metrics, use the worst possible, thus sorting this last.
- */
- || row.Metric == (ULONG)-1
- || row.Metric > ((ULONG)-1) - interfaceMetric) {
- /* Return the worst possible metric. */
- return (ULONG)-1;
- }
-
- /* Return the metric value from that row, plus the interface metric.
- *
- * See
- * http://msdn.microsoft.com/en-us/library/windows/desktop/aa814494(v=vs.85).aspx
- * which describes the combination as a "sum".
- */
- return row.Metric + interfaceMetric;
-}
-
-/*
- * get_DNS_AdaptersAddresses()
- *
- * Locates DNS info using GetAdaptersAddresses() function from the Internet
- * Protocol Helper (IP Helper) API. When located, this returns a pointer
- * in *outptr to a newly allocated memory area holding a null-terminated
- * string with a space or comma seperated list of DNS IP addresses.
- *
- * Returns 0 and nullifies *outptr upon inability to return DNSes string.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Implementation supports Windows XP and newer.
- */
-#define IPAA_INITIAL_BUF_SZ 15 * 1024
-#define IPAA_MAX_TRIES 3
-static int get_DNS_AdaptersAddresses(char **outptr)
-{
- IP_ADAPTER_DNS_SERVER_ADDRESS *ipaDNSAddr;
- IP_ADAPTER_ADDRESSES *ipaa, *newipaa, *ipaaEntry;
- ULONG ReqBufsz = IPAA_INITIAL_BUF_SZ;
- ULONG Bufsz = IPAA_INITIAL_BUF_SZ;
- ULONG AddrFlags = 0;
- int trying = IPAA_MAX_TRIES;
- int res;
-
- /* The capacity of addresses, in elements. */
- size_t addressesSize;
- /* The number of elements in addresses. */
- size_t addressesIndex = 0;
- /* The addresses we will sort. */
- Address *addresses;
-
- union {
- struct sockaddr *sa;
- struct sockaddr_in *sa4;
- struct sockaddr_in6 *sa6;
- } namesrvr;
-
- *outptr = NULL;
-
- /* Verify run-time availability of GetAdaptersAddresses() */
- if (ares_fpGetAdaptersAddresses == ZERO_NULL)
- return 0;
-
- ipaa = ares_malloc(Bufsz);
- if (!ipaa)
- return 0;
-
- /* Start with enough room for a few DNS server addresses and we'll grow it
- * as we encounter more.
- */
- addressesSize = 4;
- addresses = (Address*)ares_malloc(sizeof(Address) * addressesSize);
- if(addresses == NULL) {
- /* We need room for at least some addresses to function. */
- ares_free(ipaa);
- return 0;
- }
-
- /* Usually this call suceeds with initial buffer size */
- res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
- ipaa, &ReqBufsz);
- if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
- goto done;
-
- while ((res == ERROR_BUFFER_OVERFLOW) && (--trying))
- {
- if (Bufsz < ReqBufsz)
- {
- newipaa = ares_realloc(ipaa, ReqBufsz);
- if (!newipaa)
- goto done;
- Bufsz = ReqBufsz;
- ipaa = newipaa;
- }
- res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
- ipaa, &ReqBufsz);
- if (res == ERROR_SUCCESS)
- break;
- }
- if (res != ERROR_SUCCESS)
- goto done;
-
- for (ipaaEntry = ipaa; ipaaEntry; ipaaEntry = ipaaEntry->Next)
- {
- if(ipaaEntry->OperStatus != IfOperStatusUp)
- continue;
-
- /* For each interface, find any associated DNS servers as IPv4 or IPv6
- * addresses. For each found address, find the best route to that DNS
- * server address _on_ _that_ _interface_ (at this moment in time) and
- * compute the resulting total metric, just as Windows routing will do.
- * Then, sort all the addresses found by the metric.
- */
- for (ipaDNSAddr = ipaaEntry->FirstDnsServerAddress;
- ipaDNSAddr;
- ipaDNSAddr = ipaDNSAddr->Next)
- {
- namesrvr.sa = ipaDNSAddr->Address.lpSockaddr;
-
- if (namesrvr.sa->sa_family == AF_INET)
- {
- if ((namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_ANY) ||
- (namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_NONE))
- continue;
-
- /* Allocate room for another address, if necessary, else skip. */
- if(addressesIndex == addressesSize) {
- const size_t newSize = addressesSize + 4;
- Address * const newMem =
- (Address*)ares_realloc(addresses, sizeof(Address) * newSize);
- if(newMem == NULL) {
- continue;
- }
- addresses = newMem;
- addressesSize = newSize;
- }
-
- /* Vista required for Luid or Ipv4Metric */
- if (ares_IsWindowsVistaOrGreater())
- {
- /* Save the address as the next element in addresses. */
- addresses[addressesIndex].metric =
- getBestRouteMetric(&ipaaEntry->Luid,
- (SOCKADDR_INET*)(namesrvr.sa),
- ipaaEntry->Ipv4Metric);
- }
- else
- {
- addresses[addressesIndex].metric = (ULONG)-1;
- }
-
- /* Record insertion index to make qsort stable */
- addresses[addressesIndex].orig_idx = addressesIndex;
-
- if (! ares_inet_ntop(AF_INET, &namesrvr.sa4->sin_addr,
- addresses[addressesIndex].text,
- sizeof(addresses[0].text))) {
- continue;
- }
- ++addressesIndex;
- }
- else if (namesrvr.sa->sa_family == AF_INET6)
- {
- if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
- sizeof(namesrvr.sa6->sin6_addr)) == 0)
- continue;
-
- /* Allocate room for another address, if necessary, else skip. */
- if(addressesIndex == addressesSize) {
- const size_t newSize = addressesSize + 4;
- Address * const newMem =
- (Address*)ares_realloc(addresses, sizeof(Address) * newSize);
- if(newMem == NULL) {
- continue;
- }
- addresses = newMem;
- addressesSize = newSize;
- }
-
- /* Vista required for Luid or Ipv4Metric */
- if (ares_IsWindowsVistaOrGreater())
- {
- /* Save the address as the next element in addresses. */
- addresses[addressesIndex].metric =
- getBestRouteMetric(&ipaaEntry->Luid,
- (SOCKADDR_INET*)(namesrvr.sa),
- ipaaEntry->Ipv6Metric);
- }
- else
- {
- addresses[addressesIndex].metric = (ULONG)-1;
- }
-
- /* Record insertion index to make qsort stable */
- addresses[addressesIndex].orig_idx = addressesIndex;
-
- if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
- addresses[addressesIndex].text,
- sizeof(addresses[0].text))) {
- continue;
- }
- ++addressesIndex;
- }
- else {
- /* Skip non-IPv4/IPv6 addresses completely. */
- continue;
- }
- }
- }
-
- /* Sort all of the textual addresses by their metric (and original index if
- * metrics are equal). */
- qsort(addresses, addressesIndex, sizeof(*addresses), compareAddresses);
-
- /* Join them all into a single string, removing duplicates. */
- {
- size_t i;
- for(i = 0; i < addressesIndex; ++i) {
- size_t j;
- /* Look for this address text appearing previously in the results. */
- for(j = 0; j < i; ++j) {
- if(strcmp(addresses[j].text, addresses[i].text) == 0) {
- break;
- }
- }
- /* Iff we didn't emit this address already, emit it now. */
- if(j == i) {
- /* Add that to outptr (if we can). */
- commajoin(outptr, addresses[i].text);
- }
- }
- }
-
-done:
- ares_free(addresses);
-
- if (ipaa)
- ares_free(ipaa);
-
- if (!*outptr) {
- return 0;
- }
-
- return 1;
-}
-
-/*
- * get_DNS_Windows()
- *
- * Locates DNS info from Windows employing most suitable methods available at
- * run-time no matter which Windows version it is. When located, this returns
- * a pointer in *outptr to a newly allocated memory area holding a string with
- * a space or comma seperated list of DNS IP addresses, null-terminated.
- *
- * Returns 0 and nullifies *outptr upon inability to return DNSes string.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Implementation supports Windows 95 and newer.
- */
-static int get_DNS_Windows(char **outptr)
-{
- /* Try using IP helper API GetAdaptersAddresses(). IPv4 + IPv6, also sorts
- * DNS servers by interface route metrics to try to use the best DNS server. */
- if (get_DNS_AdaptersAddresses(outptr))
- return 1;
-
- /* Try using IP helper API GetNetworkParams(). IPv4 only. */
- if (get_DNS_NetworkParams(outptr))
- return 1;
-
- /* Fall-back to registry information */
- return get_DNS_Registry(outptr);
-}
-
-/*
- * get_SuffixList_Windows()
- *
- * Reads the "DNS Suffix Search List" from registry and writes the list items
- * whitespace separated to outptr. If the Search List is empty, the
- * "Primary Dns Suffix" is written to outptr.
- *
- * Returns 0 and nullifies *outptr upon inability to return the suffix list.
- *
- * Returns 1 and sets *outptr when returning a dynamically allocated string.
- *
- * Implementation supports Windows Server 2003 and newer
- */
-static int get_SuffixList_Windows(char **outptr)
-{
- HKEY hKey, hKeyEnum;
- char keyName[256];
- DWORD keyNameBuffSize;
- DWORD keyIdx = 0;
- char *p = NULL;
-
- *outptr = NULL;
-
- if (ares__getplatform() != WIN_NT)
- return 0;
-
- /* 1. Global DNS Suffix Search List */
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
- KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- get_REG_SZ(hKey, SEARCHLIST_KEY, outptr);
- if (get_REG_SZ(hKey, DOMAIN_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- RegCloseKey(hKey);
- }
-
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NT_DNSCLIENT, 0,
- KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- if (get_REG_SZ(hKey, SEARCHLIST_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- RegCloseKey(hKey);
- }
-
- /* 2. Connection Specific Search List composed of:
- * a. Primary DNS Suffix */
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_DNSCLIENT, 0,
- KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- if (get_REG_SZ(hKey, PRIMARYDNSSUFFIX_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- RegCloseKey(hKey);
- }
-
- /* b. Interface SearchList, Domain, DhcpDomain */
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY "\\" INTERFACES_KEY, 0,
- KEY_READ, &hKey) == ERROR_SUCCESS)
- {
- for(;;)
- {
- keyNameBuffSize = sizeof(keyName);
- if (RegEnumKeyExA(hKey, keyIdx++, keyName, &keyNameBuffSize,
- 0, NULL, NULL, NULL)
- != ERROR_SUCCESS)
- break;
- if (RegOpenKeyExA(hKey, keyName, 0, KEY_QUERY_VALUE, &hKeyEnum)
- != ERROR_SUCCESS)
- continue;
- /* p can be comma separated (SearchList) */
- if (get_REG_SZ(hKeyEnum, SEARCHLIST_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- if (get_REG_SZ(hKeyEnum, DOMAIN_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- if (get_REG_SZ(hKeyEnum, DHCPDOMAIN_KEY, &p))
- {
- commajoin(outptr, p);
- ares_free(p);
- p = NULL;
- }
- RegCloseKey(hKeyEnum);
- }
- RegCloseKey(hKey);
- }
-
- return *outptr != NULL;
-}
-
-#endif
-
-static int init_by_resolv_conf(ares_channel channel)
-{
-#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(WATT32) && \
- !defined(CARES_USE_LIBRESOLV)
- char *line = NULL;
-#endif
- int status = -1, nservers = 0, nsort = 0;
- struct server_state *servers = NULL;
- struct apattern *sortlist = NULL;
-
-#ifdef WIN32
-
- if (channel->nservers > -1) /* don't override ARES_OPT_SERVER */
- return ARES_SUCCESS;
-
- if (get_DNS_Windows(&line))
- {
- status = config_nameserver(&servers, &nservers, line);
- ares_free(line);
- }
-
- if (channel->ndomains == -1 && get_SuffixList_Windows(&line))
- {
- status = set_search(channel, line);
- ares_free(line);
- }
-
- if (status == ARES_SUCCESS)
- status = ARES_EOF;
- else
- /* Catch the case when all the above checks fail (which happens when there
- is no network card or the cable is unplugged) */
- status = ARES_EFILE;
-
-#elif defined(__riscos__)
-
- /* Under RISC OS, name servers are listed in the
- system variable Inet$Resolvers, space separated. */
-
- line = getenv("Inet$Resolvers");
- status = ARES_EOF;
- if (line) {
- char *resolvers = ares_strdup(line), *pos, *space;
-
- if (!resolvers)
- return ARES_ENOMEM;
-
- pos = resolvers;
- do {
- space = strchr(pos, ' ');
- if (space)
- *space = '\0';
- status = config_nameserver(&servers, &nservers, pos);
- if (status != ARES_SUCCESS)
- break;
- pos = space + 1;
- } while (space);
-
- if (status == ARES_SUCCESS)
- status = ARES_EOF;
-
- ares_free(resolvers);
- }
-
-#elif defined(WATT32)
- int i;
-
- sock_init();
- for (i = 0; def_nameservers[i]; i++)
- ;
- if (i == 0)
- return ARES_SUCCESS; /* use localhost DNS server */
-
- nservers = i;
- servers = ares_malloc(sizeof(struct server_state));
- if (!servers)
- return ARES_ENOMEM;
- memset(servers, 0, sizeof(struct server_state));
-
- for (i = 0; def_nameservers[i]; i++)
- {
- servers[i].addr.addrV4.s_addr = htonl(def_nameservers[i]);
- servers[i].addr.family = AF_INET;
- servers[i].addr.udp_port = 0;
- servers[i].addr.tcp_port = 0;
- }
- status = ARES_EOF;
-
-#elif defined(ANDROID) || defined(__ANDROID__)
- unsigned int i;
- char propname[PROP_NAME_MAX];
- char propvalue[PROP_VALUE_MAX]="";
- char **dns_servers;
- char *domains;
- size_t num_servers;
-
- /* Use the Android connectivity manager to get a list
- * of DNS servers. As of Android 8 (Oreo) net.dns#
- * system properties are no longer available. Google claims this
- * improves privacy. Apps now need the ACCESS_NETWORK_STATE
- * permission and must use the ConnectivityManager which
- * is Java only. */
- dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers);
- if (dns_servers != NULL)
- {
- for (i = 0; i < num_servers; i++)
- {
- status = config_nameserver(&servers, &nservers, dns_servers[i]);
- if (status != ARES_SUCCESS)
- break;
- status = ARES_EOF;
- }
- for (i = 0; i < num_servers; i++)
- {
- ares_free(dns_servers[i]);
- }
- ares_free(dns_servers);
- }
- if (channel->ndomains == -1)
- {
- domains = ares_get_android_search_domains_list();
- set_search(channel, domains);
- ares_free(domains);
- }
-
-# ifdef HAVE___SYSTEM_PROPERTY_GET
- /* Old way using the system property still in place as
- * a fallback. Older android versions can still use this.
- * it's possible for older apps not not have added the new
- * permission and we want to try to avoid breaking those.
- *
- * We'll only run this if we don't have any dns servers
- * because this will get the same ones (if it works). */
- if (status != ARES_EOF) {
- for (i = 1; i <= MAX_DNS_PROPERTIES; i++) {
- snprintf(propname, sizeof(propname), "%s%u", DNS_PROP_NAME_PREFIX, i);
- if (__system_property_get(propname, propvalue) < 1) {
- status = ARES_EOF;
- break;
- }
-
- status = config_nameserver(&servers, &nservers, propvalue);
- if (status != ARES_SUCCESS)
- break;
- status = ARES_EOF;
- }
- }
-# endif /* HAVE___SYSTEM_PROPERTY_GET */
-#elif defined(CARES_USE_LIBRESOLV)
- struct __res_state res;
- memset(&res, 0, sizeof(res));
- int result = res_ninit(&res);
- if (result == 0 && (res.options & RES_INIT)) {
- status = ARES_EOF;
-
- if (channel->nservers == -1) {
- union res_sockaddr_union addr[MAXNS];
- int nscount = res_getservers(&res, addr, MAXNS);
- for (int i = 0; i < nscount; ++i) {
- char str[INET6_ADDRSTRLEN];
- int config_status;
- sa_family_t family = addr[i].sin.sin_family;
- if (family == AF_INET) {
- ares_inet_ntop(family, &addr[i].sin.sin_addr, str, sizeof(str));
- } else if (family == AF_INET6) {
- ares_inet_ntop(family, &addr[i].sin6.sin6_addr, str, sizeof(str));
- } else {
- continue;
- }
-
- config_status = config_nameserver(&servers, &nservers, str);
- if (config_status != ARES_SUCCESS) {
- status = config_status;
- break;
- }
- }
- }
- if (channel->ndomains == -1) {
- int entries = 0;
- while ((entries < MAXDNSRCH) && res.dnsrch[entries])
- entries++;
-
- channel->domains = ares_malloc(entries * sizeof(char *));
- if (!channel->domains) {
- status = ARES_ENOMEM;
- } else {
- channel->ndomains = entries;
- for (int i = 0; i < channel->ndomains; ++i) {
- channel->domains[i] = ares_strdup(res.dnsrch[i]);
- if (!channel->domains[i])
- status = ARES_ENOMEM;
- }
- }
- }
- if (channel->ndots == -1)
- channel->ndots = res.ndots;
- if (channel->tries == -1)
- channel->tries = res.retry;
- if (channel->rotate == -1)
- channel->rotate = res.options & RES_ROTATE;
- if (channel->timeout == -1)
- channel->timeout = res.retrans * 1000;
-
- res_ndestroy(&res);
- }
-#else
- {
- char *p;
- FILE *fp;
- size_t linesize;
- int error;
- int update_domains;
- const char *resolvconf_path;
-
- /* Don't read resolv.conf and friends if we don't have to */
- if (ARES_CONFIG_CHECK(channel))
- return ARES_SUCCESS;
-
- /* Only update search domains if they're not already specified */
- update_domains = (channel->ndomains == -1);
-
- /* Support path for resolvconf filename set by ares_init_options */
- if(channel->resolvconf_path) {
- resolvconf_path = channel->resolvconf_path;
- } else {
- resolvconf_path = PATH_RESOLV_CONF;
- }
-
- fp = fopen(resolvconf_path, "r");
- if (fp) {
- while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
- {
- if ((p = try_config(line, "domain", ';')) && update_domains)
- status = config_domain(channel, p);
- else if ((p = try_config(line, "lookup", ';')) && !channel->lookups)
- status = config_lookup(channel, p, "bind", NULL, "file");
- else if ((p = try_config(line, "search", ';')) && update_domains)
- status = set_search(channel, p);
- else if ((p = try_config(line, "nameserver", ';')) &&
- channel->nservers == -1)
- status = config_nameserver(&servers, &nservers, p);
- else if ((p = try_config(line, "sortlist", ';')) &&
- channel->nsort == -1)
- status = config_sortlist(&sortlist, &nsort, p);
- else if ((p = try_config(line, "options", ';')))
- status = set_options(channel, p);
- else
- status = ARES_SUCCESS;
- if (status != ARES_SUCCESS)
- break;
- }
- fclose(fp);
- }
- else {
- error = ERRNO;
- switch(error) {
- case ENOENT:
- case ESRCH:
- status = ARES_EOF;
- break;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n", PATH_RESOLV_CONF));
- status = ARES_EFILE;
- }
- }
-
- if ((status == ARES_EOF) && (!channel->lookups)) {
- /* Many systems (Solaris, Linux, BSD's) use nsswitch.conf */
- fp = fopen("/etc/nsswitch.conf", "r");
- if (fp) {
- while ((status = ares__read_line(fp, &line, &linesize)) ==
- ARES_SUCCESS)
- {
- if ((p = try_config(line, "hosts:", '\0')) && !channel->lookups)
- (void)config_lookup(channel, p, "dns", "resolve", "files");
- }
- fclose(fp);
- }
- else {
- error = ERRNO;
- switch(error) {
- case ENOENT:
- case ESRCH:
- break;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
- "/etc/nsswitch.conf"));
- }
-
- /* ignore error, maybe we will get luck in next if clause */
- status = ARES_EOF;
- }
- }
-
- if ((status == ARES_EOF) && (!channel->lookups)) {
- /* Linux / GNU libc 2.x and possibly others have host.conf */
- fp = fopen("/etc/host.conf", "r");
- if (fp) {
- while ((status = ares__read_line(fp, &line, &linesize)) ==
- ARES_SUCCESS)
- {
- if ((p = try_config(line, "order", '\0')) && !channel->lookups)
- /* ignore errors */
- (void)config_lookup(channel, p, "bind", NULL, "hosts");
- }
- fclose(fp);
- }
- else {
- error = ERRNO;
- switch(error) {
- case ENOENT:
- case ESRCH:
- break;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
- "/etc/host.conf"));
- }
-
- /* ignore error, maybe we will get luck in next if clause */
- status = ARES_EOF;
- }
- }
-
- if ((status == ARES_EOF) && (!channel->lookups)) {
- /* Tru64 uses /etc/svc.conf */
- fp = fopen("/etc/svc.conf", "r");
- if (fp) {
- while ((status = ares__read_line(fp, &line, &linesize)) ==
- ARES_SUCCESS)
- {
- if ((p = try_config(line, "hosts=", '\0')) && !channel->lookups)
- /* ignore errors */
- (void)config_lookup(channel, p, "bind", NULL, "local");
- }
- fclose(fp);
- }
- else {
- error = ERRNO;
- switch(error) {
- case ENOENT:
- case ESRCH:
- break;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n", "/etc/svc.conf"));
- }
-
- /* ignore error, default value will be chosen for `channel->lookups` */
- status = ARES_EOF;
- }
- }
-
- if(line)
- ares_free(line);
- }
-
-#endif
-
- /* Handle errors. */
- if (status != ARES_EOF)
- {
- if (servers != NULL)
- ares_free(servers);
- if (sortlist != NULL)
- ares_free(sortlist);
- return status;
- }
-
- /* If we got any name server entries, fill them in. */
- if (servers)
- {
- channel->servers = servers;
- channel->nservers = nservers;
- }
-
- /* If we got any sortlist entries, fill them in. */
- if (sortlist)
- {
- channel->sortlist = sortlist;
- channel->nsort = nsort;
- }
-
- return ARES_SUCCESS;
-}
-
-static int init_by_defaults(ares_channel channel)
-{
- char *hostname = NULL;
- int rc = ARES_SUCCESS;
-#ifdef HAVE_GETHOSTNAME
- char *dot;
-#endif
-
- if (channel->flags == -1)
- channel->flags = 0;
- if (channel->timeout == -1)
- channel->timeout = DEFAULT_TIMEOUT;
- if (channel->tries == -1)
- channel->tries = DEFAULT_TRIES;
- if (channel->ndots == -1)
- channel->ndots = 1;
- if (channel->rotate == -1)
- channel->rotate = 0;
- if (channel->udp_port == -1)
- channel->udp_port = htons(NAMESERVER_PORT);
- if (channel->tcp_port == -1)
- channel->tcp_port = htons(NAMESERVER_PORT);
-
- if (channel->ednspsz == -1)
- channel->ednspsz = EDNSPACKETSZ;
-
- if (channel->nservers == -1) {
- /* If nobody specified servers, try a local named. */
- channel->servers = ares_malloc(sizeof(struct server_state));
- if (!channel->servers) {
- rc = ARES_ENOMEM;
- goto error;
- }
- channel->servers[0].addr.family = AF_INET;
- channel->servers[0].addr.addrV4.s_addr = htonl(INADDR_LOOPBACK);
- channel->servers[0].addr.udp_port = 0;
- channel->servers[0].addr.tcp_port = 0;
- channel->nservers = 1;
- }
-
-#if defined(USE_WINSOCK)
-#define toolong(x) (x == -1) && (SOCKERRNO == WSAEFAULT)
-#elif defined(ENAMETOOLONG)
-#define toolong(x) (x == -1) && ((SOCKERRNO == ENAMETOOLONG) || \
- (SOCKERRNO == EINVAL))
-#else
-#define toolong(x) (x == -1) && (SOCKERRNO == EINVAL)
-#endif
-
- if (channel->ndomains == -1) {
- /* Derive a default domain search list from the kernel hostname,
- * or set it to empty if the hostname isn't helpful.
- */
-#ifndef HAVE_GETHOSTNAME
- channel->ndomains = 0; /* default to none */
-#else
- GETHOSTNAME_TYPE_ARG2 lenv = 64;
- size_t len = 64;
- int res;
- channel->ndomains = 0; /* default to none */
-
- hostname = ares_malloc(len);
- if(!hostname) {
- rc = ARES_ENOMEM;
- goto error;
- }
-
- do {
- res = gethostname(hostname, lenv);
-
- if(toolong(res)) {
- char *p;
- len *= 2;
- lenv *= 2;
- p = ares_realloc(hostname, len);
- if(!p) {
- rc = ARES_ENOMEM;
- goto error;
- }
- hostname = p;
- continue;
- }
- else if(res) {
- /* Lets not treat a gethostname failure as critical, since we
- * are ok if gethostname doesn't even exist */
- *hostname = '\0';
- break;
- }
-
- } while (res != 0);
-
- dot = strchr(hostname, '.');
- if (dot) {
- /* a dot was found */
- channel->domains = ares_malloc(sizeof(char *));
- if (!channel->domains) {
- rc = ARES_ENOMEM;
- goto error;
- }
- channel->domains[0] = ares_strdup(dot + 1);
- if (!channel->domains[0]) {
- rc = ARES_ENOMEM;
- goto error;
- }
- channel->ndomains = 1;
- }
-#endif
- }
-
- if (channel->nsort == -1) {
- channel->sortlist = NULL;
- channel->nsort = 0;
- }
-
- if (!channel->lookups) {
- channel->lookups = ares_strdup("fb");
- if (!channel->lookups)
- rc = ARES_ENOMEM;
- }
-
- error:
- if(rc) {
- if(channel->servers) {
- ares_free(channel->servers);
- channel->servers = NULL;
- }
-
- if(channel->domains && channel->domains[0])
- ares_free(channel->domains[0]);
- if(channel->domains) {
- ares_free(channel->domains);
- channel->domains = NULL;
- }
-
- if(channel->lookups) {
- ares_free(channel->lookups);
- channel->lookups = NULL;
- }
-
- if(channel->resolvconf_path) {
- ares_free(channel->resolvconf_path);
- channel->resolvconf_path = NULL;
- }
- }
-
- if(hostname)
- ares_free(hostname);
-
- return rc;
-}
-
-#if !defined(WIN32) && !defined(WATT32) && \
- !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
-static int config_domain(ares_channel channel, char *str)
-{
- char *q;
-
- /* Set a single search domain. */
- q = str;
- while (*q && !ISSPACE(*q))
- q++;
- *q = '\0';
- return set_search(channel, str);
-}
-
-#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \
- defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__)
- /* workaround icc 9.1 optimizer issue */
-# define vqualifier volatile
-#else
-# define vqualifier
-#endif
-
-static int config_lookup(ares_channel channel, const char *str,
- const char *bindch, const char *altbindch,
- const char *filech)
-{
- char lookups[3], *l;
- const char *vqualifier p;
-
- if (altbindch == NULL)
- altbindch = bindch;
-
- /* Set the lookup order. Only the first letter of each work
- * is relevant, and it has to be "b" for DNS or "f" for the
- * host file. Ignore everything else.
- */
- l = lookups;
- p = str;
- while (*p)
- {
- if ((*p == *bindch || *p == *altbindch || *p == *filech) && l < lookups + 2) {
- if (*p == *bindch || *p == *altbindch) *l++ = 'b';
- else *l++ = 'f';
- }
- while (*p && !ISSPACE(*p) && (*p != ','))
- p++;
- while (*p && (ISSPACE(*p) || (*p == ',')))
- p++;
- }
- *l = '\0';
- channel->lookups = ares_strdup(lookups);
- return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
-}
-#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ & !CARES_USE_LIBRESOLV */
-
-#ifndef WATT32
-/* Validate that the ip address matches the subnet (network base and network
- * mask) specified. Addresses are specified in standard Network Byte Order as
- * 16 bytes, and the netmask is 0 to 128 (bits).
- */
-static int ares_ipv6_subnet_matches(const unsigned char netbase[16],
- unsigned char netmask,
- const unsigned char ipaddr[16])
-{
- unsigned char mask[16] = { 0 };
- unsigned char i;
-
- /* Misuse */
- if (netmask > 128)
- return 0;
-
- /* Quickly set whole bytes */
- memset(mask, 0xFF, netmask / 8);
-
- /* Set remaining bits */
- if(netmask % 8) {
- mask[netmask / 8] = (unsigned char)(0xff << (8 - (netmask % 8)));
- }
-
- for (i=0; i<16; i++) {
- if ((netbase[i] & mask[i]) != (ipaddr[i] & mask[i]))
- return 0;
- }
-
- return 1;
-}
-
-/* Return true iff the IPv6 ipaddr is blacklisted. */
-static int ares_ipv6_server_blacklisted(const unsigned char ipaddr[16])
-{
- /* A list of blacklisted IPv6 subnets. */
- const struct {
- const unsigned char netbase[16];
- unsigned char netmask;
- } blacklist[] = {
- /* fec0::/10 was deprecated by [RFC3879] in September 2004. Formerly a
- * Site-Local scoped address prefix. These are never valid DNS servers,
- * but are known to be returned at least sometimes on Windows and Android.
- */
- {
- {
- 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- },
- 10
- }
- };
- size_t i;
-
- /* See if ipaddr matches any of the entries in the blacklist. */
- for (i = 0; i < sizeof(blacklist) / sizeof(blacklist[0]); ++i) {
- if (ares_ipv6_subnet_matches(
- blacklist[i].netbase, blacklist[i].netmask, ipaddr))
- return 1;
- }
- return 0;
-}
-
-/* Add the IPv4 or IPv6 nameservers in str (separated by commas) to the
- * servers list, updating servers and nservers as required.
- *
- * This will silently ignore blacklisted IPv6 nameservers as detected by
- * ares_ipv6_server_blacklisted().
- *
- * Returns an error code on failure, else ARES_SUCCESS.
- */
-static int config_nameserver(struct server_state **servers, int *nservers,
- char *str)
-{
- struct ares_addr host;
- struct server_state *newserv;
- char *p, *txtaddr;
- /* On Windows, there may be more than one nameserver specified in the same
- * registry key, so we parse input as a space or comma seperated list.
- */
- for (p = str; p;)
- {
- /* Skip whitespace and commas. */
- while (*p && (ISSPACE(*p) || (*p == ',')))
- p++;
- if (!*p)
- /* No more input, done. */
- break;
-
- /* Pointer to start of IPv4 or IPv6 address part. */
- txtaddr = p;
-
- /* Advance past this address. */
- while (*p && !ISSPACE(*p) && (*p != ','))
- p++;
- if (*p)
- /* Null terminate this address. */
- *p++ = '\0';
- else
- /* Reached end of input, done when this address is processed. */
- p = NULL;
-
- /* Convert textual address to binary format. */
- if (ares_inet_pton(AF_INET, txtaddr, &host.addrV4) == 1)
- host.family = AF_INET;
- else if (ares_inet_pton(AF_INET6, txtaddr, &host.addrV6) == 1
- /* Silently skip blacklisted IPv6 servers. */
- && !ares_ipv6_server_blacklisted(
- (const unsigned char *)&host.addrV6))
- host.family = AF_INET6;
- else
- continue;
-
- /* Resize servers state array. */
- newserv = ares_realloc(*servers, (*nservers + 1) *
- sizeof(struct server_state));
- if (!newserv)
- return ARES_ENOMEM;
-
- /* Store address data. */
- newserv[*nservers].addr.family = host.family;
- newserv[*nservers].addr.udp_port = 0;
- newserv[*nservers].addr.tcp_port = 0;
- if (host.family == AF_INET)
- memcpy(&newserv[*nservers].addr.addrV4, &host.addrV4,
- sizeof(host.addrV4));
- else
- memcpy(&newserv[*nservers].addr.addrV6, &host.addrV6,
- sizeof(host.addrV6));
-
- /* Update arguments. */
- *servers = newserv;
- *nservers += 1;
- }
-
- return ARES_SUCCESS;
-}
-#endif /* !WATT32 */
-
-static int config_sortlist(struct apattern **sortlist, int *nsort,
- const char *str)
-{
- struct apattern pat;
- const char *q;
-
- /* Add sortlist entries. */
- while (*str && *str != ';')
- {
- int bits;
- char ipbuf[16], ipbufpfx[32];
- /* Find just the IP */
- q = str;
- while (*q && *q != '/' && *q != ';' && !ISSPACE(*q))
- q++;
- memcpy(ipbuf, str, q-str);
- ipbuf[q-str] = '\0';
- /* Find the prefix */
- if (*q == '/')
- {
- const char *str2 = q+1;
- while (*q && *q != ';' && !ISSPACE(*q))
- q++;
- memcpy(ipbufpfx, str, q-str);
- ipbufpfx[q-str] = '\0';
- str = str2;
- }
- else
- ipbufpfx[0] = '\0';
- /* Lets see if it is CIDR */
- /* First we'll try IPv6 */
- if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
- &pat.addrV6,
- sizeof(pat.addrV6))) > 0)
- {
- pat.type = PATTERN_CIDR;
- pat.mask.bits = (unsigned short)bits;
- pat.family = AF_INET6;
- if (!sortlist_alloc(sortlist, nsort, &pat)) {
- ares_free(*sortlist);
- *sortlist = NULL;
- return ARES_ENOMEM;
- }
- }
- else if (ipbufpfx[0] &&
- (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
- sizeof(pat.addrV4))) > 0)
- {
- pat.type = PATTERN_CIDR;
- pat.mask.bits = (unsigned short)bits;
- pat.family = AF_INET;
- if (!sortlist_alloc(sortlist, nsort, &pat)) {
- ares_free(*sortlist);
- *sortlist = NULL;
- return ARES_ENOMEM;
- }
- }
- /* See if it is just a regular IP */
- else if (ip_addr(ipbuf, q-str, &pat.addrV4) == 0)
- {
- if (ipbufpfx[0])
- {
- memcpy(ipbuf, str, q-str);
- ipbuf[q-str] = '\0';
- if (ip_addr(ipbuf, q-str, &pat.mask.addr4) != 0)
- natural_mask(&pat);
- }
- else
- natural_mask(&pat);
- pat.family = AF_INET;
- pat.type = PATTERN_MASK;
- if (!sortlist_alloc(sortlist, nsort, &pat)) {
- ares_free(*sortlist);
- *sortlist = NULL;
- return ARES_ENOMEM;
- }
- }
- else
- {
- while (*q && *q != ';' && !ISSPACE(*q))
- q++;
- }
- str = q;
- while (ISSPACE(*str))
- str++;
- }
-
- return ARES_SUCCESS;
-}
-
-static int set_search(ares_channel channel, const char *str)
-{
- size_t cnt;
-
- if(channel->ndomains != -1) {
- /* LCOV_EXCL_START: all callers check ndomains == -1 */
- /* if we already have some domains present, free them first */
- ares_strsplit_free(channel->domains, channel->ndomains);
- channel->domains = NULL;
- channel->ndomains = -1;
- } /* LCOV_EXCL_STOP */
-
- channel->domains = ares_strsplit(str, ", ", 1, &cnt);
- channel->ndomains = (int)cnt;
- if (channel->domains == NULL || channel->ndomains == 0) {
- channel->domains = NULL;
- channel->ndomains = -1;
- }
-
- return ARES_SUCCESS;
-}
-
-static int set_options(ares_channel channel, const char *str)
-{
- const char *p, *q, *val;
-
- p = str;
- while (*p)
- {
- q = p;
- while (*q && !ISSPACE(*q))
- q++;
- val = try_option(p, q, "ndots:");
- if (val && channel->ndots == -1)
- channel->ndots = aresx_sltosi(strtol(val, NULL, 10));
- val = try_option(p, q, "retrans:");
- if (val && channel->timeout == -1)
- channel->timeout = aresx_sltosi(strtol(val, NULL, 10));
- val = try_option(p, q, "retry:");
- if (val && channel->tries == -1)
- channel->tries = aresx_sltosi(strtol(val, NULL, 10));
- val = try_option(p, q, "rotate");
- if (val && channel->rotate == -1)
- channel->rotate = 1;
- p = q;
- while (ISSPACE(*p))
- p++;
- }
-
- return ARES_SUCCESS;
-}
-
-static const char *try_option(const char *p, const char *q, const char *opt)
-{
- size_t len = strlen(opt);
- return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
-}
-
-#if !defined(WIN32) && !defined(WATT32) && \
- !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
-static char *try_config(char *s, const char *opt, char scc)
-{
- size_t len;
- char *p;
- char *q;
-
- if (!s || !opt)
- /* no line or no option */
- return NULL; /* LCOV_EXCL_LINE */
-
- /* Hash '#' character is always used as primary comment char, additionally
- a not-NUL secondary comment char will be considered when specified. */
-
- /* trim line comment */
- p = s;
- if(scc)
- while (*p && (*p != '#') && (*p != scc))
- p++;
- else
- while (*p && (*p != '#'))
- p++;
- *p = '\0';
-
- /* trim trailing whitespace */
- q = p - 1;
- while ((q >= s) && ISSPACE(*q))
- q--;
- *++q = '\0';
-
- /* skip leading whitespace */
- p = s;
- while (*p && ISSPACE(*p))
- p++;
-
- if (!*p)
- /* empty line */
- return NULL;
-
- if ((len = strlen(opt)) == 0)
- /* empty option */
- return NULL; /* LCOV_EXCL_LINE */
-
- if (strncmp(p, opt, len) != 0)
- /* line and option do not match */
- return NULL;
-
- /* skip over given option name */
- p += len;
-
- if (!*p)
- /* no option value */
- return NULL; /* LCOV_EXCL_LINE */
-
- if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p))
- /* whitespace between option name and value is mandatory
- for given option names which do not end with ':' or '=' */
- return NULL;
-
- /* skip over whitespace */
- while (*p && ISSPACE(*p))
- p++;
-
- if (!*p)
- /* no option value */
- return NULL;
-
- /* return pointer to option value */
- return p;
-}
-#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */
-
-static int ip_addr(const char *ipbuf, ares_ssize_t len, struct in_addr *addr)
-{
-
- /* Four octets and three periods yields at most 15 characters. */
- if (len > 15)
- return -1;
-
- addr->s_addr = inet_addr(ipbuf);
- if (addr->s_addr == INADDR_NONE && strcmp(ipbuf, "255.255.255.255") != 0)
- return -1;
- return 0;
-}
-
-static void natural_mask(struct apattern *pat)
-{
- struct in_addr addr;
-
- /* Store a host-byte-order copy of pat in a struct in_addr. Icky,
- * but portable.
- */
- addr.s_addr = ntohl(pat->addrV4.s_addr);
-
- /* This is out of date in the CIDR world, but some people might
- * still rely on it.
- */
- if (IN_CLASSA(addr.s_addr))
- pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET);
- else if (IN_CLASSB(addr.s_addr))
- pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET);
- else
- pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
-}
-
-static int sortlist_alloc(struct apattern **sortlist, int *nsort,
- struct apattern *pat)
-{
- struct apattern *newsort;
- newsort = ares_realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern));
- if (!newsort)
- return 0;
- newsort[*nsort] = *pat;
- *sortlist = newsort;
- (*nsort)++;
- return 1;
-}
-
-/* initialize an rc4 key. If possible a cryptographically secure random key
- is generated using a suitable function (for example win32's RtlGenRandom as
- described in
- http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
- otherwise the code defaults to cross-platform albeit less secure mechanism
- using rand
-*/
-static void randomize_key(unsigned char* key,int key_data_len)
-{
- int randomized = 0;
- int counter=0;
-#ifdef WIN32
- BOOLEAN res;
- if (ares_fpSystemFunction036)
- {
- res = (*ares_fpSystemFunction036) (key, key_data_len);
- if (res)
- randomized = 1;
- }
-#else /* !WIN32 */
-#ifdef RANDOM_FILE
- FILE *f = fopen(RANDOM_FILE, "rb");
- if(f) {
- counter = aresx_uztosi(fread(key, 1, key_data_len, f));
- fclose(f);
- }
-#endif
-#endif /* WIN32 */
-
- if (!randomized) {
- for (;counter<key_data_len;counter++)
- key[counter]=(unsigned char)(rand() % 256); /* LCOV_EXCL_LINE */
- }
-}
-
-static int init_id_key(rc4_key* key,int key_data_len)
-{
- unsigned char index1;
- unsigned char index2;
- unsigned char* state;
- short counter;
- unsigned char *key_data_ptr = 0;
-
- key_data_ptr = ares_malloc(key_data_len);
- if (!key_data_ptr)
- return ARES_ENOMEM;
- memset(key_data_ptr, 0, key_data_len);
-
- state = &key->state[0];
- for(counter = 0; counter < 256; counter++)
- /* unnecessary AND but it keeps some compilers happier */
- state[counter] = (unsigned char)(counter & 0xff);
- randomize_key(key->state,key_data_len);
- key->x = 0;
- key->y = 0;
- index1 = 0;
- index2 = 0;
- for(counter = 0; counter < 256; counter++)
- {
- index2 = (unsigned char)((key_data_ptr[index1] + state[counter] +
- index2) % 256);
- ARES_SWAP_BYTE(&state[counter], &state[index2]);
-
- index1 = (unsigned char)((index1 + 1) % key_data_len);
- }
- ares_free(key_data_ptr);
- return ARES_SUCCESS;
-}
-
-void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
-{
- channel->local_ip4 = local_ip;
-}
-
-/* local_ip6 should be 16 bytes in length */
-void ares_set_local_ip6(ares_channel channel,
- const unsigned char* local_ip6)
-{
- memcpy(&channel->local_ip6, local_ip6, sizeof(channel->local_ip6));
-}
-
-/* local_dev_name should be null terminated. */
-void ares_set_local_dev(ares_channel channel,
- const char* local_dev_name)
-{
- strncpy(channel->local_dev_name, local_dev_name,
- sizeof(channel->local_dev_name));
- channel->local_dev_name[sizeof(channel->local_dev_name) - 1] = 0;
-}
-
-
-void ares_set_socket_callback(ares_channel channel,
- ares_sock_create_callback cb,
- void *data)
-{
- channel->sock_create_cb = cb;
- channel->sock_create_cb_data = data;
-}
-
-void ares_set_socket_configure_callback(ares_channel channel,
- ares_sock_config_callback cb,
- void *data)
-{
- channel->sock_config_cb = cb;
- channel->sock_config_cb_data = data;
-}
-
-void ares_set_socket_functions(ares_channel channel,
- const struct ares_socket_functions * funcs,
- void *data)
-{
- channel->sock_funcs = funcs;
- channel->sock_func_cb_data = data;
-}
-
-int ares_set_sortlist(ares_channel channel, const char *sortstr)
-{
- int nsort = 0;
- struct apattern *sortlist = NULL;
- int status;
-
- if (!channel)
- return ARES_ENODATA;
-
- status = config_sortlist(&sortlist, &nsort, sortstr);
- if (status == ARES_SUCCESS && sortlist) {
- if (channel->sortlist)
- ares_free(channel->sortlist);
- channel->sortlist = sortlist;
- channel->nsort = nsort;
- }
- return status;
-}
-
-void ares__init_servers_state(ares_channel channel)
-{
- struct server_state *server;
- int i;
-
- for (i = 0; i < channel->nservers; i++)
- {
- server = &channel->servers[i];
- server->udp_socket = ARES_SOCKET_BAD;
- server->tcp_socket = ARES_SOCKET_BAD;
- server->tcp_connection_generation = ++channel->tcp_connection_generation;
- server->tcp_lenbuf_pos = 0;
- server->tcp_buffer_pos = 0;
- server->tcp_buffer = NULL;
- server->tcp_length = 0;
- server->qhead = NULL;
- server->qtail = NULL;
- ares__init_list_head(&server->queries_to_server);
- server->channel = channel;
- server->is_broken = 0;
- }
-}
diff --git a/grpc/third_party/cares/cares/ares_init_options.3 b/grpc/third_party/cares/cares/ares_init_options.3
deleted file mode 100644
index df5f6d34..00000000
--- a/grpc/third_party/cares/cares/ares_init_options.3
+++ /dev/null
@@ -1,295 +0,0 @@
-.\"
-.\" Copyright 1998 by the Massachusetts Institute of Technology.
-.\" Copyright (C) 2004-2010 by Daniel Stenberg
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_INIT 3 "5 March 2010"
-.SH NAME
-ares_init_options \- Initialize a resolver channel
-.SH SYNOPSIS
-.nf
-#include <ares.h>
-
-struct ares_options {
- int flags;
- int timeout; /* in seconds or milliseconds, depending on options */
- int tries;
- int ndots;
- unsigned short udp_port;
- unsigned short tcp_port;
- int socket_send_buffer_size;
- int socket_receive_buffer_size;
- struct in_addr *servers;
- int nservers;
- char **domains;
- int ndomains;
- char *lookups;
- ares_sock_state_cb sock_state_cb;
- void *sock_state_cb_data;
- struct apattern *sortlist;
- int nsort;
- int ednspsz;
- char *resolvconf_path;
-};
-
-int ares_init_options(ares_channel *\fIchannelptr\fP,
- struct ares_options *\fIoptions\fP,
- int \fIoptmask\fP)
-.fi
-.SH DESCRIPTION
-The \fBares_init_options(3)\fP function initializes a communications channel
-for name service lookups. If it returns successfully,
-\fBares_init_options(3)\fP will set the variable pointed to by
-\fIchannelptr\fP to a handle used to identify the name service channel. The
-caller should invoke \fIares_destroy(3)\fP on the handle when the channel is
-no longer needed.
-
-The \fIoptmask\fP parameter generally specifies which fields in the structure pointed to
-by \fIoptions\fP are set, as follows:
-.TP 18
-.B ARES_OPT_FLAGS
-.B int \fIflags\fP;
-.br
-Flags controlling the behavior of the resolver. See below for a
-description of possible flag values.
-.TP 18
-.B ARES_OPT_TIMEOUT
-.B int \fItimeout\fP;
-.br
-The number of seconds each name server is given to respond to a query on the
-first try. (After the first try, the timeout algorithm becomes more
-complicated, but scales linearly with the value of \fItimeout\fP.) The
-default is five seconds. This option is being deprecated by
-\fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2.
-.TP 18
-.B ARES_OPT_TIMEOUTMS
-.B int \fItimeout\fP;
-.br
-The number of milliseconds each name server is given to respond to a query on
-the first try. (After the first try, the timeout algorithm becomes more
-complicated, but scales linearly with the value of \fItimeout\fP.) The
-default is five seconds. Note that this option is specified with the same
-struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits
-that tell c-ares how to interpret the number. This option was added in c-ares
-1.5.2.
-.TP 18
-.B ARES_OPT_TRIES
-.B int \fItries\fP;
-.br
-The number of tries the resolver will try contacting each name server
-before giving up. The default is four tries.
-.TP 18
-.B ARES_OPT_NDOTS
-.B int \fIndots\fP;
-.br
-The number of dots which must be present in a domain name for it to be
-queried for "as is" prior to querying for it with the default domain
-extensions appended. The default value is 1 unless set otherwise by
-resolv.conf or the RES_OPTIONS environment variable.
-.TP 18
-.B ARES_OPT_UDP_PORT
-.B unsigned short \fIudp_port\fP;
-.br
-The port to use for queries over UDP, in network byte order.
-The default value is 53 (in network byte order), the standard name
-service port.
-.TP 18
-.B ARES_OPT_TCP_PORT
-.B unsigned short \fItcp_port\fP;
-.br
-The port to use for queries over TCP, in network byte order.
-The default value is 53 (in network byte order), the standard name
-service port.
-.TP 18
-.B ARES_OPT_SERVERS
-.B struct in_addr *\fIservers\fP;
-.br
-.B int \fInservers\fP;
-.br
-The list of IPv4 servers to contact, instead of the servers specified in
-resolv.conf or the local named. In order to allow specification of either
-IPv4 or IPv6 name servers, the
-.BR ares_set_servers(3)
-function must be used instead.
-.TP 18
-.B ARES_OPT_DOMAINS
-.B char **\fIdomains\fP;
-.br
-.B int \fIndomains\fP;
-.br
-The domains to search, instead of the domains specified in resolv.conf
-or the domain derived from the kernel hostname variable.
-.TP 18
-.B ARES_OPT_LOOKUPS
-.B char *\fIlookups\fP;
-.br
-The lookups to perform for host queries.
-.I lookups
-should be set to a string of the characters "b" or "f", where "b"
-indicates a DNS lookup and "f" indicates a lookup in the hosts file.
-.TP 18
-.B ARES_OPT_SOCK_STATE_CB
-.B void (*\fIsock_state_cb\fP)(void *data, ares_socket_t socket_fd, int readable, int writable);
-.br
-.B void *\fIsock_state_cb_data\fP;
-.br
-A callback function to be invoked when a socket changes state.
-.I socket_fd
-will be passed the socket whose state has changed;
-.I readable
-will be set to true if the socket should listen for read events, and
-.I writable
-will be set to true if the socket should listen for write events.
-The value of
-.I sock_state_cb_data
-will be passed as the
-.I data
-argument.
-.TP 18
-.B ARES_OPT_SORTLIST
-.B struct apattern *\fIsortlist\fP;
-.br
-.B int \fInsort\fP;
-.br
-A list of IP address ranges that specifies the order of preference that
-results from \fIares_gethostbyname\fP should be returned in. Note that
-this can only be used with a sortlist retrieved via
-\fBares_save_options(3)\fP (because
-.B struct apattern
-is opaque); to set a fresh sort list, use \fBares_set_sortlist(3)\fP.
-.TP 18
-.B ARES_OPT_SOCK_SNDBUF
-.B int \fIsocket_send_buffer_size\fP;
-.br
-The send buffer size to set for the socket.
-.TP 18
-.B ARES_OPT_SOCK_RCVBUF
-.B int \fIsocket_receive_buffer_size\fP;
-.br
-The receive buffer size to set for the socket.
-.TP 18
-.B ARES_OPT_EDNSPSZ
-.B int \fIednspsz\fP;
-.br
-.TP 18
-.B ARES_OPT_RESOLVCONF
-.B char *\fIresolvconf_path\fP;
-The path to use for reading the resolv.conf file. The
-.I resolvconf_path
-should be set to a path string, and will be honoured on *nix like systems. The
-default is
-.B /etc/resolv.conf
-.br
-The message size to be advertized in EDNS; only takes effect if the
-.B ARES_FLAG_EDNS
-flag is set.
-.br
-.PP
-The \fIoptmask\fP parameter also includes options without a corresponding
-field in the
-.B ares_options
-structure, as follows:
-.TP 23
-.B ARES_OPT_ROTATE
-Perform round-robin selection of the nameservers configured for the channel
-for each resolution.
-.TP 23
-.B ARES_OPT_NOROTATE
-Do not perform round-robin nameserver selection; always use the list of
-nameservers in the same order.
-.PP
-The
-.I flags
-field should be the bitwise or of some subset of the following values:
-.TP 23
-.B ARES_FLAG_USEVC
-Always use TCP queries (the "virtual circuit") instead of UDP
-queries. Normally, TCP is only used if a UDP query yields a truncated
-result.
-.TP 23
-.B ARES_FLAG_PRIMARY
-Only query the first server in the list of servers to query.
-.TP 23
-.B ARES_FLAG_IGNTC
-If a truncated response to a UDP query is received, do not fall back
-to TCP; simply continue on with the truncated response.
-.TP 23
-.B ARES_FLAG_NORECURSE
-Do not set the "recursion desired" bit on outgoing queries, so that the name
-server being contacted will not try to fetch the answer from other servers if
-it doesn't know the answer locally. Be aware that ares will not do the
-recursion for you. Recursion must be handled by the application calling ares
-if \fIARES_FLAG_NORECURSE\fP is set.
-.TP 23
-.B ARES_FLAG_STAYOPEN
-Do not close communications sockets when the number of active queries
-drops to zero.
-.TP 23
-.B ARES_FLAG_NOSEARCH
-Do not use the default search domains; only query hostnames as-is or
-as aliases.
-.TP 23
-.B ARES_FLAG_NOALIASES
-Do not honor the HOSTALIASES environment variable, which normally
-specifies a file of hostname translations.
-.TP 23
-.B ARES_FLAG_NOCHECKRESP
-Do not discard responses with the SERVFAIL, NOTIMP, or REFUSED
-response code or responses whose questions don't match the questions
-in the request. Primarily useful for writing clients which might be
-used to test or debug name servers.
-.TP 23
-.B ARES_FLAG_EDNS
-Include an EDNS pseudo-resource record (RFC 2671) in generated requests.
-.SH RETURN VALUES
-\fBares_init_options(3)\fP can return any of the following values:
-.TP 14
-.B ARES_SUCCESS
-Initialization succeeded.
-.TP 14
-.B ARES_EFILE
-A configuration file could not be read.
-.TP 14
-.B ARES_ENOMEM
-The process's available memory was exhausted.
-.TP 14
-.B ARES_ENOTINITIALIZED
-c-ares library initialization not yet performed.
-.SH NOTES
-When initializing from
-.B /etc/resolv.conf,
-(or, alternatively when specified by the
-.I resolvconf_path
-path location)
-\fBares_init_options(3)\fP reads the \fIdomain\fP and \fIsearch\fP directives
-to allow lookups of short names relative to the domains specified. The
-\fIdomain\fP and \fIsearch\fP directives override one another. If more that
-one instance of either \fIdomain\fP or \fIsearch\fP directives is specified,
-the last occurrence wins. For more information, please see the
-.BR resolv.conf (5)
-manual page.
-.SH SEE ALSO
-.BR ares_init(3),
-.BR ares_destroy(3),
-.BR ares_dup(3),
-.BR ares_library_init(3),
-.BR ares_save_options(3),
-.BR ares_set_servers(3),
-.BR ares_set_sortlist(3)
-.SH AUTHOR
-Greg Hudson, MIT Information Systems
-.br
-Copyright 1998 by the Massachusetts Institute of Technology.
-.br
-Copyright (C) 2004-2010 by Daniel Stenberg.
diff --git a/grpc/third_party/cares/cares/ares_ipv6.h b/grpc/third_party/cares/cares/ares_ipv6.h
deleted file mode 100644
index b0017f16..00000000
--- a/grpc/third_party/cares/cares/ares_ipv6.h
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/* Copyright (C) 2005 by Dominick Meglio
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#ifndef ARES_IPV6_H
-#define ARES_IPV6_H
-
-#ifndef HAVE_PF_INET6
-#define PF_INET6 AF_INET6
-#endif
-
-#ifndef HAVE_STRUCT_SOCKADDR_IN6
-struct sockaddr_in6
-{
- unsigned short sin6_family;
- unsigned short sin6_port;
- unsigned long sin6_flowinfo;
- struct ares_in6_addr sin6_addr;
- unsigned int sin6_scope_id;
-};
-#endif
-
-#ifndef HAVE_STRUCT_ADDRINFO
-struct addrinfo
-{
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
- char *ai_canonname;
- struct sockaddr *ai_addr;
- struct addrinfo *ai_next;
-};
-#endif
-
-#ifndef NS_IN6ADDRSZ
-#ifndef HAVE_STRUCT_IN6_ADDR
-/* We cannot have it set to zero, so we pick a fixed value here */
-#define NS_IN6ADDRSZ 16
-#else
-#define NS_IN6ADDRSZ sizeof(struct in6_addr)
-#endif
-#endif
-
-#ifndef NS_INADDRSZ
-#define NS_INADDRSZ sizeof(struct in_addr)
-#endif
-
-#ifndef NS_INT16SZ
-#define NS_INT16SZ 2
-#endif
-
-#ifndef IF_NAMESIZE
-#ifdef IFNAMSIZ
-#define IF_NAMESIZE IFNAMSIZ
-#else
-#define IF_NAMESIZE 256
-#endif
-#endif
-
-/* Defined in inet_net_pton.c for no particular reason. */
-extern const struct ares_in6_addr ares_in6addr_any; /* :: */
-
-
-#endif /* ARES_IPV6_H */
diff --git a/grpc/third_party/cares/cares/ares_library_init.c b/grpc/third_party/cares/cares/ares_library_init.c
deleted file mode 100644
index 67563499..00000000
--- a/grpc/third_party/cares/cares/ares_library_init.c
+++ /dev/null
@@ -1,195 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2009 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#include "ares.h"
-#include "ares_library_init.h"
-#include "ares_private.h"
-
-/* library-private global and unique instance vars */
-
-#ifdef USE_WINSOCK
-fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
-fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
-fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses = ZERO_NULL;
-fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL;
-#endif
-
-#if defined(ANDROID) || defined(__ANDROID__)
-#include "ares_android.h"
-#endif
-
-/* library-private global vars with source visibility restricted to this file */
-
-static unsigned int ares_initialized;
-static int ares_init_flags;
-
-/* library-private global vars with visibility across the whole library */
-#if defined(WIN32)
-/* We need indirections to handle Windows DLL rules. */
-static void *default_malloc(size_t size) { return malloc(size); }
-static void *default_realloc(void *p, size_t size) { return realloc(p, size); }
-static void default_free(void *p) { free(p); }
-#else
-# define default_malloc malloc
-# define default_realloc realloc
-# define default_free free
-#endif
-void *(*ares_malloc)(size_t size) = default_malloc;
-void *(*ares_realloc)(void *ptr, size_t size) = default_realloc;
-void (*ares_free)(void *ptr) = default_free;
-
-#ifdef USE_WINSOCK
-static HMODULE hnd_iphlpapi;
-static HMODULE hnd_advapi32;
-#endif
-
-
-static int ares_win32_init(void)
-{
-#ifdef USE_WINSOCK
-
- hnd_iphlpapi = 0;
- hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
- if (!hnd_iphlpapi)
- return ARES_ELOADIPHLPAPI;
-
- ares_fpGetNetworkParams = (fpGetNetworkParams_t)
- GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
- if (!ares_fpGetNetworkParams)
- {
- FreeLibrary(hnd_iphlpapi);
- return ARES_EADDRGETNETWORKPARAMS;
- }
-
- ares_fpGetAdaptersAddresses = (fpGetAdaptersAddresses_t)
- GetProcAddress(hnd_iphlpapi, "GetAdaptersAddresses");
- if (!ares_fpGetAdaptersAddresses)
- {
- /* This can happen on clients before WinXP, I don't
- think it should be an error, unless we don't want to
- support Windows 2000 anymore */
- }
-
- ares_fpGetBestRoute2 = (fpGetBestRoute2_t)
- GetProcAddress(hnd_iphlpapi, "GetBestRoute2");
- if (!ares_fpGetBestRoute2)
- {
- /* This can happen on clients before Vista, I don't
- think it should be an error, unless we don't want to
- support Windows XP anymore */
- }
-
- /*
- * When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
- * also known as RtlGenRandom, which is the case for Windows versions prior
- * to WinXP then c-ares uses portable rand() function. Then don't error here.
- */
-
- hnd_advapi32 = 0;
- hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
- if (hnd_advapi32)
- {
- ares_fpSystemFunction036 = (fpSystemFunction036_t)
- GetProcAddress(hnd_advapi32, "SystemFunction036");
- }
-
-#endif
- return ARES_SUCCESS;
-}
-
-
-static void ares_win32_cleanup(void)
-{
-#ifdef USE_WINSOCK
- if (hnd_advapi32)
- FreeLibrary(hnd_advapi32);
- if (hnd_iphlpapi)
- FreeLibrary(hnd_iphlpapi);
-#endif
-}
-
-
-int ares_library_init(int flags)
-{
- int res;
-
- if (ares_initialized)
- {
- ares_initialized++;
- return ARES_SUCCESS;
- }
- ares_initialized++;
-
- if (flags & ARES_LIB_INIT_WIN32)
- {
- res = ares_win32_init();
- if (res != ARES_SUCCESS)
- return res; /* LCOV_EXCL_LINE: can't test Win32 init failure */
- }
-
- ares_init_flags = flags;
-
- return ARES_SUCCESS;
-}
-
-int ares_library_init_mem(int flags,
- void *(*amalloc)(size_t size),
- void (*afree)(void *ptr),
- void *(*arealloc)(void *ptr, size_t size))
-{
- if (amalloc)
- ares_malloc = amalloc;
- if (arealloc)
- ares_realloc = arealloc;
- if (afree)
- ares_free = afree;
- return ares_library_init(flags);
-}
-
-
-void ares_library_cleanup(void)
-{
- if (!ares_initialized)
- return;
- ares_initialized--;
- if (ares_initialized)
- return;
-
- if (ares_init_flags & ARES_LIB_INIT_WIN32)
- ares_win32_cleanup();
-
-#if defined(ANDROID) || defined(__ANDROID__)
- ares_library_cleanup_android();
-#endif
-
- ares_init_flags = ARES_LIB_INIT_NONE;
- ares_malloc = malloc;
- ares_realloc = realloc;
- ares_free = free;
-}
-
-
-int ares_library_initialized(void)
-{
-#ifdef USE_WINSOCK
- if (!ares_initialized)
- return ARES_ENOTINITIALIZED;
-#endif
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_library_init.h b/grpc/third_party/cares/cares/ares_library_init.h
deleted file mode 100644
index 2a2ba118..00000000
--- a/grpc/third_party/cares/cares/ares_library_init.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef HEADER_CARES_LIBRARY_INIT_H
-#define HEADER_CARES_LIBRARY_INIT_H
-
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2011 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef USE_WINSOCK
-
-#include <iphlpapi.h>
-#include <ares_iphlpapi.h>
-
-typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
-typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
-typedef ULONG (WINAPI *fpGetAdaptersAddresses_t) ( ULONG, ULONG, void*, IP_ADAPTER_ADDRESSES*, ULONG* );
-typedef NETIO_STATUS (WINAPI *fpGetBestRoute2_t) ( NET_LUID *, NET_IFINDEX, const SOCKADDR_INET *, const SOCKADDR_INET *, ULONG, PMIB_IPFORWARD_ROW2, SOCKADDR_INET * );
-/* Forward-declaration of variables defined in ares_library_init.c */
-/* that are global and unique instances for whole c-ares library. */
-
-extern fpGetNetworkParams_t ares_fpGetNetworkParams;
-extern fpSystemFunction036_t ares_fpSystemFunction036;
-extern fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses;
-extern fpGetBestRoute2_t ares_fpGetBestRoute2;
-
-#endif /* USE_WINSOCK */
-
-#endif /* HEADER_CARES_LIBRARY_INIT_H */
-
diff --git a/grpc/third_party/cares/cares/ares_library_init_android.3 b/grpc/third_party/cares/cares/ares_library_init_android.3
deleted file mode 100644
index c0372e51..00000000
--- a/grpc/third_party/cares/cares/ares_library_init_android.3
+++ /dev/null
@@ -1,155 +0,0 @@
-.\"
-.\" Copyright (C) 2017 by John Schember
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_LIBRARY_INIT_ANDROID 3 "13 Sept 2017"
-.SH NAME
-ares_library_init_android \- c-ares library Android initialization
-.SH SYNOPSIS
-.nf
-#include <ares.h>
-
-int ares_library_init_android(jobject \fIconnectivity_manager\fP)
-
-int ares_library_android_initialized();
-
-void ares_library_init_jvm(JavaVM *\fIjvm\fP)
-
-.fi
-.SH DESCRIPTION
-.PP
-The
-.B ares_library_init_android
-function performs initializations internally required by the c-ares
-library when used on Android. This can take place anytime after
-\fIares_library_init(3)\fP. It must take place after
-\fIares_library_init_jvm\fP. ares_library_init_android must be called
-before DNS resolution will work on Android 8 (Oreo) or newer when
-targetSdkVersion is set to 26+.
-.PP
-As of Android 8 (API level 26) getting DNS server information has
-becomei more restrictive and can only be accessed using the
-Connectivity Manager. It is necessary to pass the connectivity
-manager to c-ares via JNI. Also, the ACCESS_NETWORK_STATE permission
-must be present in the Android application.
-.PP
-Android older than 8 do not need to to be initalized as they
-are less restrictive. However, this is a run time not compile time
-limitation. Proper Android initalization should take place regardless
-of the targeted Android version.
-.PP
-
-.PP
-Deinitalization will take place though \fIares_library_cleanup(3)\fP.
-.PP
-The
-.B ares_library_init_jvm
-function allows the caller to register the JVM with c-ares.
-It's meant to be called during JNI_OnLoad because you're guaranteed
-to have the JVM in that function. The JVM is required in order
-to use the Connectivty Manager registered using
-\fIares_library_android_init\fP. This must be call before
-\fIares_library_android_init\fP.
-.PP
-The
-.B ares_library_android_initialized
-function can be used to check whether c-ares has been initalized for use
-with Android.
-.SH RETURN VALUES
-ARES_SUCCESS will be returned on success otherwise an error code will
-be returned.
-.SH THREAD SAFETY
-.B These init functions are not thread safe.
-You have to call it once the program has started, but this call must be done
-before the program starts any other thread. This is required to avoid
-potential race conditions in library initialization, and also due to the fact
-these might call functions from other libraries that
-are thread unsafe, and could conflict with any other thread that is already
-using these other libraries.
-.SH JNI
-Accesing the Connectivity Manager though Java:
-.PP
-Register the \fIares_library_android_init\fP.
-.PP
-.Bd -literal
- static JNINativeMethod funcs[] = {
- { "initialize_native", "(Landroid/net/ConnectivityManager;)I",
- (void *)&ares_library_init_android}
- };
-
- JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
- {
- JNIEnv *env = NULL;
- jclass cls = NULL;
- jint res;
-
- if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_6) != JNI_OK)
- return -1;
-
- cls = (*env)->FindClass(env, JNIT_CLASS);
- if (cls == NULL)
- return -1;
-
- res = (*env)->RegisterNatives(env, cls, funcs, sizeof(funcs)/sizeof(funcs[0]));
- if (res != 0)
- return -1;
-
- ares_library_init_jvm(vm);
- return JNI_VERSION_1_6;
- }
-.Ed
-.PP
-Calling the registered function from Java:
-.PP
-.Bd -literal
- public class MyObject {
- static {
- System.loadLibrary("cares");
- }
-
- private static native boolean initialize_native(ConnectivityManager
- connectivity_manager);
-
- public static boolean initialize(Context context) {
- initialize_native((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE));
- }
- }
-.Ed
-.PP
-Initalizing the Connectivity Manager in JNI directly using an Android Context. It is assumed
-the JVM has aleady been registered through \fIJNI_OnLoad\fP.
-.PP
-.Bd -literal
- void initialize(jobject android_context)
- {
- jclass obj_cls = jni_get_class(env, "android/content/Context");
- jmethodID obj_mid = jni_get_method_id(env, obj_cls, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
- jfieldID fid = (*env)->GetStaticFieldID(env, obj_cls, "CONNECTIVITY_SERVICE", "Ljava/lang/String;");
- jstring str = (*env)->GetStaticObjectField(env, obj_cls, fid);
- connectivity_manager = (*env)->CallObjectMethod(env, android_context, obj_mid, str);
- if (connectivity_manager == NULL)
- return;
- ares_library_init_android(connectivity_manager);
- }
-.Ed
-.SH AVAILABILITY
-This function was first introduced in c-ares version 1.14.0.
-.SH SEE ALSO
-.BR ares_library_init(3),
-.BR ares_library_cleanup(3),
-.SH AUTHOR
-John Schember
-.PP
-Copyright (C) 2017 by John Schember
-
diff --git a/grpc/third_party/cares/cares/ares_parse_a_reply.3 b/grpc/third_party/cares/cares/ares_parse_a_reply.3
deleted file mode 100644
index 8db8ed9a..00000000
--- a/grpc/third_party/cares/cares/ares_parse_a_reply.3
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" Copyright 1998 by the Massachusetts Institute of Technology.
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
-.SH NAME
-ares_parse_a_reply \- Parse a reply to a DNS query of type A
-.SH SYNOPSIS
-.nf
-.B #include <ares.h>
-.PP
-.B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
-.B struct hostent **\fIhost\fP,
-.B struct ares_addrttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
-.fi
-.SH DESCRIPTION
-The
-.B ares_parse_a_reply
-function parses the response to a query of type A into a
-.BR "struct hostent"
-and/or an array of
-.BR "struct ares_addrttls" .
-The parameters
-.I abuf
-and
-.I alen
-give the contents of the response. The result is stored in allocated
-memory and a pointer to it stored into the variable pointed to by
-.IR host ,
-if host is nonnull.
-It is the caller's responsibility to free the resulting host structure
-using
-.BR ares_free_hostent (3)
-when it is no longer needed.
-.PP
-If
-.IR addrttls
-and
-.IR naddrttls
-are both nonnull,
-then up to *naddrttls
-.BR "struct ares_addrttl"
-records are stored in the array pointed to by addrttls,
-and then *naddrttls is set to the number of records so stored.
-Note that the memory for these records is supplied by the caller.
-.SH RETURN VALUES
-.B ares_parse_a_reply
-can return any of the following values:
-.TP 15
-.B ARES_SUCCESS
-The response was successfully parsed.
-.TP 15
-.B ARES_EBADRESP
-The response was malformatted.
-.TP 15
-.B ARES_ENODATA
-The response did not contain an answer to the query.
-.TP 15
-.B ARES_ENOMEM
-Memory was exhausted.
-.SH SEE ALSO
-.BR ares_gethostbyname (3),
-.BR ares_free_hostent (3)
-.SH AUTHOR
-Greg Hudson, MIT Information Systems
-.br
-Copyright 1998 by the Massachusetts Institute of Technology.
diff --git a/grpc/third_party/cares/cares/ares_parse_a_reply.c b/grpc/third_party/cares/cares/ares_parse_a_reply.c
deleted file mode 100644
index 0422bd38..00000000
--- a/grpc/third_party/cares/cares/ares_parse_a_reply.c
+++ /dev/null
@@ -1,264 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_private.h"
-
-int ares_parse_a_reply(const unsigned char *abuf, int alen,
- struct hostent **host,
- struct ares_addrttl *addrttls, int *naddrttls)
-{
- unsigned int qdcount, ancount;
- int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
- int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
- int naliases;
- long len;
- const unsigned char *aptr;
- char *hostname, *rr_name, *rr_data, **aliases;
- struct in_addr *addrs;
- struct hostent *hostent;
- const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
-
- /* Set *host to NULL for all failure cases. */
- if (host)
- *host = NULL;
- /* Same with *naddrttls. */
- if (naddrttls)
- *naddrttls = 0;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free(hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- if (host)
- {
- /* Allocate addresses and aliases; ancount gives an upper bound for
- both. */
- addrs = ares_malloc(ancount * sizeof(struct in_addr));
- if (!addrs)
- {
- ares_free(hostname);
- return ARES_ENOMEM;
- }
- aliases = ares_malloc((ancount + 1) * sizeof(char *));
- if (!aliases)
- {
- ares_free(hostname);
- ares_free(addrs);
- return ARES_ENOMEM;
- }
- }
- else
- {
- addrs = NULL;
- aliases = NULL;
- }
-
- naddrs = 0;
- naliases = 0;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < (int)ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- break;
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE(aptr);
- rr_class = DNS_RR_CLASS(aptr);
- rr_len = DNS_RR_LEN(aptr);
- rr_ttl = DNS_RR_TTL(aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
-
- if (rr_class == C_IN && rr_type == T_A
- && rr_len == sizeof(struct in_addr)
- && strcasecmp(rr_name, hostname) == 0)
- {
- if (addrs)
- {
- if (aptr + sizeof(struct in_addr) > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- memcpy(&addrs[naddrs], aptr, sizeof(struct in_addr));
- }
- if (naddrs < max_addr_ttls)
- {
- struct ares_addrttl * const at = &addrttls[naddrs];
- if (aptr + sizeof(struct in_addr) > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- memcpy(&at->ipaddr, aptr, sizeof(struct in_addr));
- at->ttl = rr_ttl;
- }
- naddrs++;
- status = ARES_SUCCESS;
- }
-
- if (rr_class == C_IN && rr_type == T_CNAME)
- {
- /* Record the RR name as an alias. */
- if (aliases)
- aliases[naliases] = rr_name;
- else
- ares_free(rr_name);
- naliases++;
-
- /* Decode the RR data and replace the hostname with it. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
- &len);
- if (status != ARES_SUCCESS)
- break;
- ares_free(hostname);
- hostname = rr_data;
-
- /* Take the min of the TTLs we see in the CNAME chain. */
- if (cname_ttl > rr_ttl)
- cname_ttl = rr_ttl;
- }
- else
- ares_free(rr_name);
-
- aptr += rr_len;
- if (aptr > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- }
-
- if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
- /* the check for naliases to be zero is to make sure CNAME responses
- don't get caught here */
- status = ARES_ENODATA;
- if (status == ARES_SUCCESS)
- {
- /* We got our answer. */
- if (naddrttls)
- {
- const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
- for (i = 0; i < n; i++)
- {
- /* Ensure that each A TTL is no larger than the CNAME TTL. */
- if (addrttls[i].ttl > cname_ttl)
- addrttls[i].ttl = cname_ttl;
- }
- *naddrttls = n;
- }
- if (aliases)
- aliases[naliases] = NULL;
- if (host)
- {
- /* Allocate memory to build the host entry. */
- hostent = ares_malloc(sizeof(struct hostent));
- if (hostent)
- {
- hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *));
- if (hostent->h_addr_list)
- {
- /* Fill in the hostent and return successfully. */
- hostent->h_name = hostname;
- hostent->h_aliases = aliases;
- hostent->h_addrtype = AF_INET;
- hostent->h_length = sizeof(struct in_addr);
- for (i = 0; i < naddrs; i++)
- hostent->h_addr_list[i] = (char *) &addrs[i];
- hostent->h_addr_list[naddrs] = NULL;
- if (!naddrs && addrs)
- ares_free(addrs);
- *host = hostent;
- return ARES_SUCCESS;
- }
- ares_free(hostent);
- }
- status = ARES_ENOMEM;
- }
- }
- if (aliases)
- {
- for (i = 0; i < naliases; i++)
- ares_free(aliases[i]);
- ares_free(aliases);
- }
- ares_free(addrs);
- ares_free(hostname);
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_aaaa_reply.3 b/grpc/third_party/cares/cares/ares_parse_aaaa_reply.3
deleted file mode 100644
index 476a3f1b..00000000
--- a/grpc/third_party/cares/cares/ares_parse_aaaa_reply.3
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" Copyright 2005 by Dominick Meglio.
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_PARSE_AAAA_REPLY 3 "20 Nov 2009"
-.SH NAME
-ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
-.SH SYNOPSIS
-.nf
-.B #include <ares.h>
-.PP
-.B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
-.B struct hostent **\fIhost\fP,
-.B struct ares_addr6ttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
-.fi
-.SH DESCRIPTION
-The
-.B ares_parse_aaaa_reply
-function parses the response to a query of type AAAA into a
-.BR "struct hostent"
-and/or an array of
-.BR "struct ares_addr6ttl" .
-The parameters
-.I abuf
-and
-.I alen
-give the contents of the response. The result is stored in allocated
-memory and a pointer to it stored into the variable pointed to by
-.IR host ,
-if host is nonnull.
-It is the caller's responsibility to free the resulting host structure
-using
-.BR ares_free_hostent (3)
-when it is no longer needed.
-.PP
-If
-.IR addrttls
-and
-.IR naddrttls
-are both nonnull,
-then up to *naddrttls
-.BR "struct ares_addr6ttl"
-records are stored in the array pointed to by addrttls,
-and then *naddrttls is set to the number of records so stored.
-Note that the memory for these records is supplied by the caller.
-.SH RETURN VALUES
-.B ares_parse_aaaa_reply
-can return any of the following values:
-.TP 15
-.B ARES_SUCCESS
-The response was successfully parsed.
-.TP 15
-.B ARES_EBADRESP
-The response was malformatted.
-.TP 15
-.B ARES_ENODATA
-The response did not contain an answer to the query.
-.TP 15
-.B ARES_ENOMEM
-Memory was exhausted.
-.SH SEE ALSO
-.BR ares_gethostbyname (3),
-.BR ares_free_hostent (3)
-.SH AUTHOR
-Dominick Meglio
-.br
-Copyright 2005 by Dominick Meglio.
diff --git a/grpc/third_party/cares/cares/ares_parse_aaaa_reply.c b/grpc/third_party/cares/cares/ares_parse_aaaa_reply.c
deleted file mode 100644
index 5b38bb57..00000000
--- a/grpc/third_party/cares/cares/ares_parse_aaaa_reply.c
+++ /dev/null
@@ -1,264 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright 2005 Dominick Meglio
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_inet_net_pton.h"
-#include "ares_private.h"
-
-int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
- struct hostent **host, struct ares_addr6ttl *addrttls,
- int *naddrttls)
-{
- unsigned int qdcount, ancount;
- int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
- int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
- int naliases;
- long len;
- const unsigned char *aptr;
- char *hostname, *rr_name, *rr_data, **aliases;
- struct ares_in6_addr *addrs;
- struct hostent *hostent;
- const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
-
- /* Set *host to NULL for all failure cases. */
- if (host)
- *host = NULL;
- /* Same with *naddrttls. */
- if (naddrttls)
- *naddrttls = 0;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free(hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Allocate addresses and aliases; ancount gives an upper bound for both. */
- if (host)
- {
- addrs = ares_malloc(ancount * sizeof(struct ares_in6_addr));
- if (!addrs)
- {
- ares_free(hostname);
- return ARES_ENOMEM;
- }
- aliases = ares_malloc((ancount + 1) * sizeof(char *));
- if (!aliases)
- {
- ares_free(hostname);
- ares_free(addrs);
- return ARES_ENOMEM;
- }
- }
- else
- {
- addrs = NULL;
- aliases = NULL;
- }
- naddrs = 0;
- naliases = 0;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < (int)ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- break;
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE(aptr);
- rr_class = DNS_RR_CLASS(aptr);
- rr_len = DNS_RR_LEN(aptr);
- rr_ttl = DNS_RR_TTL(aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
-
- if (rr_class == C_IN && rr_type == T_AAAA
- && rr_len == sizeof(struct ares_in6_addr)
- && strcasecmp(rr_name, hostname) == 0)
- {
- if (addrs)
- {
- if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- memcpy(&addrs[naddrs], aptr, sizeof(struct ares_in6_addr));
- }
- if (naddrs < max_addr_ttls)
- {
- struct ares_addr6ttl * const at = &addrttls[naddrs];
- if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- memcpy(&at->ip6addr, aptr, sizeof(struct ares_in6_addr));
- at->ttl = rr_ttl;
- }
- naddrs++;
- status = ARES_SUCCESS;
- }
-
- if (rr_class == C_IN && rr_type == T_CNAME)
- {
- /* Record the RR name as an alias. */
- if (aliases)
- aliases[naliases] = rr_name;
- else
- ares_free(rr_name);
- naliases++;
-
- /* Decode the RR data and replace the hostname with it. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
- &len);
- if (status != ARES_SUCCESS)
- break;
- ares_free(hostname);
- hostname = rr_data;
-
- /* Take the min of the TTLs we see in the CNAME chain. */
- if (cname_ttl > rr_ttl)
- cname_ttl = rr_ttl;
- }
- else
- ares_free(rr_name);
-
- aptr += rr_len;
- if (aptr > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- }
-
- /* the check for naliases to be zero is to make sure CNAME responses
- don't get caught here */
- if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
- status = ARES_ENODATA;
- if (status == ARES_SUCCESS)
- {
- /* We got our answer. */
- if (naddrttls)
- {
- const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
- for (i = 0; i < n; i++)
- {
- /* Ensure that each A TTL is no larger than the CNAME TTL. */
- if (addrttls[i].ttl > cname_ttl)
- addrttls[i].ttl = cname_ttl;
- }
- *naddrttls = n;
- }
- if (aliases)
- aliases[naliases] = NULL;
- if (host)
- {
- /* Allocate memory to build the host entry. */
- hostent = ares_malloc(sizeof(struct hostent));
- if (hostent)
- {
- hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *));
- if (hostent->h_addr_list)
- {
- /* Fill in the hostent and return successfully. */
- hostent->h_name = hostname;
- hostent->h_aliases = aliases;
- hostent->h_addrtype = AF_INET6;
- hostent->h_length = sizeof(struct ares_in6_addr);
- for (i = 0; i < naddrs; i++)
- hostent->h_addr_list[i] = (char *) &addrs[i];
- hostent->h_addr_list[naddrs] = NULL;
- if (!naddrs && addrs)
- ares_free(addrs);
- *host = hostent;
- return ARES_SUCCESS;
- }
- ares_free(hostent);
- }
- status = ARES_ENOMEM;
- }
- }
- if (aliases)
- {
- for (i = 0; i < naliases; i++)
- ares_free(aliases[i]);
- ares_free(aliases);
- }
- ares_free(addrs);
- ares_free(hostname);
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_mx_reply.c b/grpc/third_party/cares/cares/ares_parse_mx_reply.c
deleted file mode 100644
index e6336473..00000000
--- a/grpc/third_party/cares/cares/ares_parse_mx_reply.c
+++ /dev/null
@@ -1,170 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2010 Jeremy Lal <kapouer@melix.org>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-int
-ares_parse_mx_reply (const unsigned char *abuf, int alen,
- struct ares_mx_reply **mx_out)
-{
- unsigned int qdcount, ancount, i;
- const unsigned char *aptr, *vptr;
- int status, rr_type, rr_class, rr_len;
- long len;
- char *hostname = NULL, *rr_name = NULL;
- struct ares_mx_reply *mx_head = NULL;
- struct ares_mx_reply *mx_last = NULL;
- struct ares_mx_reply *mx_curr;
-
- /* Set *mx_out to NULL for all failure cases. */
- *mx_out = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT (abuf);
- ancount = DNS_HEADER_ANCOUNT (abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
- if (ancount == 0)
- return ARES_ENODATA;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
-
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free (hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- {
- break;
- }
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE (aptr);
- rr_class = DNS_RR_CLASS (aptr);
- rr_len = DNS_RR_LEN (aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Check if we are really looking at a MX record */
- if (rr_class == C_IN && rr_type == T_MX)
- {
- /* parse the MX record itself */
- if (rr_len < 2)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Allocate storage for this MX answer appending it to the list */
- mx_curr = ares_malloc_data(ARES_DATATYPE_MX_REPLY);
- if (!mx_curr)
- {
- status = ARES_ENOMEM;
- break;
- }
- if (mx_last)
- {
- mx_last->next = mx_curr;
- }
- else
- {
- mx_head = mx_curr;
- }
- mx_last = mx_curr;
-
- vptr = aptr;
- mx_curr->priority = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
-
- status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len);
- if (status != ARES_SUCCESS)
- break;
- }
-
- /* Don't lose memory in the next iteration */
- ares_free (rr_name);
- rr_name = NULL;
-
- /* Move on to the next record */
- aptr += rr_len;
- }
-
- if (hostname)
- ares_free (hostname);
- if (rr_name)
- ares_free (rr_name);
-
- /* clean up on error */
- if (status != ARES_SUCCESS)
- {
- if (mx_head)
- ares_free_data (mx_head);
- return status;
- }
-
- /* everything looks fine, return the data */
- *mx_out = mx_head;
-
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_naptr_reply.c b/grpc/third_party/cares/cares/ares_parse_naptr_reply.c
deleted file mode 100644
index a14c226a..00000000
--- a/grpc/third_party/cares/cares/ares_parse_naptr_reply.c
+++ /dev/null
@@ -1,194 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-/* AIX portability check */
-#ifndef T_NAPTR
- #define T_NAPTR 35 /* naming authority pointer */
-#endif
-
-int
-ares_parse_naptr_reply (const unsigned char *abuf, int alen,
- struct ares_naptr_reply **naptr_out)
-{
- unsigned int qdcount, ancount, i;
- const unsigned char *aptr, *vptr;
- int status, rr_type, rr_class, rr_len;
- long len;
- char *hostname = NULL, *rr_name = NULL;
- struct ares_naptr_reply *naptr_head = NULL;
- struct ares_naptr_reply *naptr_last = NULL;
- struct ares_naptr_reply *naptr_curr;
-
- /* Set *naptr_out to NULL for all failure cases. */
- *naptr_out = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT (abuf);
- ancount = DNS_HEADER_ANCOUNT (abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
- if (ancount == 0)
- return ARES_ENODATA;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
-
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free (hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- {
- break;
- }
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE (aptr);
- rr_class = DNS_RR_CLASS (aptr);
- rr_len = DNS_RR_LEN (aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Check if we are really looking at a NAPTR record */
- if (rr_class == C_IN && rr_type == T_NAPTR)
- {
- /* parse the NAPTR record itself */
-
- /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
- if (rr_len < 7)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Allocate storage for this NAPTR answer appending it to the list */
- naptr_curr = ares_malloc_data(ARES_DATATYPE_NAPTR_REPLY);
- if (!naptr_curr)
- {
- status = ARES_ENOMEM;
- break;
- }
- if (naptr_last)
- {
- naptr_last->next = naptr_curr;
- }
- else
- {
- naptr_head = naptr_curr;
- }
- naptr_last = naptr_curr;
-
- vptr = aptr;
- naptr_curr->order = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
- naptr_curr->preference = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
-
- status = ares_expand_string(vptr, abuf, alen, &naptr_curr->flags, &len);
- if (status != ARES_SUCCESS)
- break;
- vptr += len;
-
- status = ares_expand_string(vptr, abuf, alen, &naptr_curr->service, &len);
- if (status != ARES_SUCCESS)
- break;
- vptr += len;
-
- status = ares_expand_string(vptr, abuf, alen, &naptr_curr->regexp, &len);
- if (status != ARES_SUCCESS)
- break;
- vptr += len;
-
- status = ares_expand_name(vptr, abuf, alen, &naptr_curr->replacement, &len);
- if (status != ARES_SUCCESS)
- break;
- }
-
- /* Don't lose memory in the next iteration */
- ares_free (rr_name);
- rr_name = NULL;
-
- /* Move on to the next record */
- aptr += rr_len;
- }
-
- if (hostname)
- ares_free (hostname);
- if (rr_name)
- ares_free (rr_name);
-
- /* clean up on error */
- if (status != ARES_SUCCESS)
- {
- if (naptr_head)
- ares_free_data (naptr_head);
- return status;
- }
-
- /* everything looks fine, return the data */
- *naptr_out = naptr_head;
-
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_ns_reply.c b/grpc/third_party/cares/cares/ares_parse_ns_reply.c
deleted file mode 100644
index 7bb51429..00000000
--- a/grpc/third_party/cares/cares/ares_parse_ns_reply.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-/*
- * ares_parse_ns_reply created by Vlad Dinulescu <vlad.dinulescu@avira.com>
- * on behalf of AVIRA Gmbh - http://www.avira.com
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_private.h"
-
-int ares_parse_ns_reply( const unsigned char* abuf, int alen,
- struct hostent** host )
-{
- unsigned int qdcount, ancount;
- int status, i, rr_type, rr_class, rr_len;
- int nameservers_num;
- long len;
- const unsigned char *aptr;
- char* hostname, *rr_name, *rr_data, **nameservers;
- struct hostent *hostent;
-
- /* Set *host to NULL for all failure cases. */
- *host = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if ( alen < HFIXEDSZ )
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT( abuf );
- ancount = DNS_HEADER_ANCOUNT( abuf );
- if ( qdcount != 1 )
- return ARES_EBADRESP;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
- if ( status != ARES_SUCCESS )
- return status;
- if ( aptr + len + QFIXEDSZ > abuf + alen )
- {
- ares_free( hostname );
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Allocate nameservers array; ancount gives an upper bound */
- nameservers = ares_malloc( ( ancount + 1 ) * sizeof( char * ) );
- if ( !nameservers )
- {
- ares_free( hostname );
- return ARES_ENOMEM;
- }
- nameservers_num = 0;
-
- /* Examine each answer resource record (RR) in turn. */
- for ( i = 0; i < ( int ) ancount; i++ )
- {
- /* Decode the RR up to the data field. */
- status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
- if ( status != ARES_SUCCESS )
- break;
- aptr += len;
- if ( aptr + RRFIXEDSZ > abuf + alen )
- {
- status = ARES_EBADRESP;
- ares_free(rr_name);
- break;
- }
- rr_type = DNS_RR_TYPE( aptr );
- rr_class = DNS_RR_CLASS( aptr );
- rr_len = DNS_RR_LEN( aptr );
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
-
- if ( rr_class == C_IN && rr_type == T_NS )
- {
- /* Decode the RR data and add it to the nameservers list */
- status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
- &len);
- if ( status != ARES_SUCCESS )
- {
- ares_free(rr_name);
- break;
- }
-
- nameservers[nameservers_num] = ares_malloc(strlen(rr_data)+1);
-
- if (nameservers[nameservers_num]==NULL)
- {
- ares_free(rr_name);
- ares_free(rr_data);
- status=ARES_ENOMEM;
- break;
- }
- strcpy(nameservers[nameservers_num],rr_data);
- ares_free(rr_data);
-
- nameservers_num++;
- }
-
- ares_free( rr_name );
-
- aptr += rr_len;
- if ( aptr > abuf + alen )
- { /* LCOV_EXCL_START: already checked above */
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- }
-
- if ( status == ARES_SUCCESS && nameservers_num == 0 )
- {
- status = ARES_ENODATA;
- }
- if ( status == ARES_SUCCESS )
- {
- /* We got our answer. Allocate memory to build the host entry. */
- nameservers[nameservers_num] = NULL;
- hostent = ares_malloc( sizeof( struct hostent ) );
- if ( hostent )
- {
- hostent->h_addr_list = ares_malloc( 1 * sizeof( char * ) );
- if ( hostent->h_addr_list )
- {
- /* Fill in the hostent and return successfully. */
- hostent->h_name = hostname;
- hostent->h_aliases = nameservers;
- hostent->h_addrtype = AF_INET;
- hostent->h_length = sizeof( struct in_addr );
- hostent->h_addr_list[0] = NULL;
- *host = hostent;
- return ARES_SUCCESS;
- }
- ares_free( hostent );
- }
- status = ARES_ENOMEM;
- }
- for ( i = 0; i < nameservers_num; i++ )
- ares_free( nameservers[i] );
- ares_free( nameservers );
- ares_free( hostname );
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_ptr_reply.c b/grpc/third_party/cares/cares/ares_parse_ptr_reply.c
deleted file mode 100644
index 29e22cb1..00000000
--- a/grpc/third_party/cares/cares/ares_parse_ptr_reply.c
+++ /dev/null
@@ -1,221 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_nowarn.h"
-#include "ares_private.h"
-
-int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
- int addrlen, int family, struct hostent **host)
-{
- unsigned int qdcount, ancount;
- int status, i, rr_type, rr_class, rr_len;
- long len;
- const unsigned char *aptr;
- char *ptrname, *hostname, *rr_name, *rr_data;
- struct hostent *hostent;
- int aliascnt = 0;
- int alias_alloc = 8;
- char ** aliases;
- size_t rr_data_len;
-
- /* Set *host to NULL for all failure cases. */
- *host = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
- if (status != ARES_SUCCESS)
- return status;
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free(ptrname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Examine each answer resource record (RR) in turn. */
- hostname = NULL;
- aliases = ares_malloc(alias_alloc * sizeof(char *));
- if (!aliases)
- {
- ares_free(ptrname);
- return ARES_ENOMEM;
- }
- for (i = 0; i < (int)ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- break;
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE(aptr);
- rr_class = DNS_RR_CLASS(aptr);
- rr_len = DNS_RR_LEN(aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- ares_free(rr_name);
- status = ARES_EBADRESP;
- break;
- }
-
- if (rr_class == C_IN && rr_type == T_PTR
- && strcasecmp(rr_name, ptrname) == 0)
- {
- /* Decode the RR data and set hostname to it. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
- &len);
- if (status != ARES_SUCCESS)
- {
- ares_free(rr_name);
- break;
- }
- if (hostname)
- ares_free(hostname);
- hostname = rr_data;
- rr_data_len = strlen(rr_data)+1;
- aliases[aliascnt] = ares_malloc(rr_data_len * sizeof(char));
- if (!aliases[aliascnt])
- {
- ares_free(rr_name);
- status = ARES_ENOMEM;
- break;
- }
- strncpy(aliases[aliascnt], rr_data, rr_data_len);
- aliascnt++;
- if (aliascnt >= alias_alloc) {
- char **ptr;
- alias_alloc *= 2;
- ptr = ares_realloc(aliases, alias_alloc * sizeof(char *));
- if(!ptr) {
- ares_free(rr_name);
- status = ARES_ENOMEM;
- break;
- }
- aliases = ptr;
- }
- }
-
- if (rr_class == C_IN && rr_type == T_CNAME)
- {
- /* Decode the RR data and replace ptrname with it. */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
- &len);
- if (status != ARES_SUCCESS)
- {
- ares_free(rr_name);
- break;
- }
- ares_free(ptrname);
- ptrname = rr_data;
- }
-
- ares_free(rr_name);
- aptr += rr_len;
- if (aptr > abuf + alen)
- { /* LCOV_EXCL_START: already checked above */
- status = ARES_EBADRESP;
- break;
- } /* LCOV_EXCL_STOP */
- }
-
- if (status == ARES_SUCCESS && !hostname)
- status = ARES_ENODATA;
- if (status == ARES_SUCCESS)
- {
- /* We got our answer. Allocate memory to build the host entry. */
- hostent = ares_malloc(sizeof(struct hostent));
- if (hostent)
- {
- hostent->h_addr_list = ares_malloc(2 * sizeof(char *));
- if (hostent->h_addr_list)
- {
- hostent->h_addr_list[0] = ares_malloc(addrlen);
- if (hostent->h_addr_list[0])
- {
- hostent->h_aliases = ares_malloc((aliascnt+1) * sizeof (char *));
- if (hostent->h_aliases)
- {
- /* Fill in the hostent and return successfully. */
- hostent->h_name = hostname;
- for (i=0 ; i<aliascnt ; i++)
- hostent->h_aliases[i] = aliases[i];
- hostent->h_aliases[aliascnt] = NULL;
- hostent->h_addrtype = aresx_sitoss(family);
- hostent->h_length = aresx_sitoss(addrlen);
- memcpy(hostent->h_addr_list[0], addr, addrlen);
- hostent->h_addr_list[1] = NULL;
- *host = hostent;
- ares_free(aliases);
- ares_free(ptrname);
- return ARES_SUCCESS;
- }
- ares_free(hostent->h_addr_list[0]);
- }
- ares_free(hostent->h_addr_list);
- }
- ares_free(hostent);
- }
- status = ARES_ENOMEM;
- }
- for (i=0 ; i<aliascnt ; i++)
- if (aliases[i])
- ares_free(aliases[i]);
- ares_free(aliases);
- if (hostname)
- ares_free(hostname);
- ares_free(ptrname);
- return status;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_soa_reply.c b/grpc/third_party/cares/cares/ares_parse_soa_reply.c
deleted file mode 100644
index 35af0a75..00000000
--- a/grpc/third_party/cares/cares/ares_parse_soa_reply.c
+++ /dev/null
@@ -1,133 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2012 Marko Kreen <markokr@gmail.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-int
-ares_parse_soa_reply(const unsigned char *abuf, int alen,
- struct ares_soa_reply **soa_out)
-{
- const unsigned char *aptr;
- long len;
- char *qname = NULL, *rr_name = NULL;
- struct ares_soa_reply *soa = NULL;
- int qdcount, ancount;
- int status;
-
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* parse message header */
- qdcount = DNS_HEADER_QDCOUNT(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
- if (qdcount != 1 || ancount != 1)
- return ARES_EBADRESP;
- aptr = abuf + HFIXEDSZ;
-
- /* query name */
- status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len);
- if (status != ARES_SUCCESS)
- goto failed_stat;
- aptr += len;
-
- /* skip qtype & qclass */
- if (aptr + QFIXEDSZ > abuf + alen)
- goto failed;
- aptr += QFIXEDSZ;
-
- /* rr_name */
- status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- goto failed_stat;
- aptr += len;
-
- /* skip rr_type, rr_class, rr_ttl, rr_rdlen */
- if (aptr + RRFIXEDSZ > abuf + alen)
- goto failed;
- aptr += RRFIXEDSZ;
-
- /* allocate result struct */
- soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY);
- if (!soa)
- {
- status = ARES_ENOMEM;
- goto failed_stat;
- }
-
- /* nsname */
- status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname, &len);
- if (status != ARES_SUCCESS)
- goto failed_stat;
- aptr += len;
-
- /* hostmaster */
- status = ares__expand_name_for_response(aptr, abuf, alen, &soa->hostmaster, &len);
- if (status != ARES_SUCCESS)
- goto failed_stat;
- aptr += len;
-
- /* integer fields */
- if (aptr + 5 * 4 > abuf + alen)
- goto failed;
- soa->serial = DNS__32BIT(aptr + 0 * 4);
- soa->refresh = DNS__32BIT(aptr + 1 * 4);
- soa->retry = DNS__32BIT(aptr + 2 * 4);
- soa->expire = DNS__32BIT(aptr + 3 * 4);
- soa->minttl = DNS__32BIT(aptr + 4 * 4);
-
- ares_free(qname);
- ares_free(rr_name);
-
- *soa_out = soa;
-
- return ARES_SUCCESS;
-
-failed:
- status = ARES_EBADRESP;
-
-failed_stat:
- ares_free_data(soa);
- if (qname)
- ares_free(qname);
- if (rr_name)
- ares_free(rr_name);
- return status;
-}
-
diff --git a/grpc/third_party/cares/cares/ares_parse_srv_reply.c b/grpc/third_party/cares/cares/ares_parse_srv_reply.c
deleted file mode 100644
index 824ff3ae..00000000
--- a/grpc/third_party/cares/cares/ares_parse_srv_reply.c
+++ /dev/null
@@ -1,179 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-/* AIX portability check */
-#ifndef T_SRV
-# define T_SRV 33 /* server selection */
-#endif
-
-int
-ares_parse_srv_reply (const unsigned char *abuf, int alen,
- struct ares_srv_reply **srv_out)
-{
- unsigned int qdcount, ancount, i;
- const unsigned char *aptr, *vptr;
- int status, rr_type, rr_class, rr_len;
- long len;
- char *hostname = NULL, *rr_name = NULL;
- struct ares_srv_reply *srv_head = NULL;
- struct ares_srv_reply *srv_last = NULL;
- struct ares_srv_reply *srv_curr;
-
- /* Set *srv_out to NULL for all failure cases. */
- *srv_out = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT (abuf);
- ancount = DNS_HEADER_ANCOUNT (abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
- if (ancount == 0)
- return ARES_ENODATA;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
-
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free (hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- {
- break;
- }
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE (aptr);
- rr_class = DNS_RR_CLASS (aptr);
- rr_len = DNS_RR_LEN (aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Check if we are really looking at a SRV record */
- if (rr_class == C_IN && rr_type == T_SRV)
- {
- /* parse the SRV record itself */
- if (rr_len < 6)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Allocate storage for this SRV answer appending it to the list */
- srv_curr = ares_malloc_data(ARES_DATATYPE_SRV_REPLY);
- if (!srv_curr)
- {
- status = ARES_ENOMEM;
- break;
- }
- if (srv_last)
- {
- srv_last->next = srv_curr;
- }
- else
- {
- srv_head = srv_curr;
- }
- srv_last = srv_curr;
-
- vptr = aptr;
- srv_curr->priority = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
- srv_curr->weight = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
- srv_curr->port = DNS__16BIT(vptr);
- vptr += sizeof(unsigned short);
-
- status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len);
- if (status != ARES_SUCCESS)
- break;
- }
-
- /* Don't lose memory in the next iteration */
- ares_free (rr_name);
- rr_name = NULL;
-
- /* Move on to the next record */
- aptr += rr_len;
- }
-
- if (hostname)
- ares_free (hostname);
- if (rr_name)
- ares_free (rr_name);
-
- /* clean up on error */
- if (status != ARES_SUCCESS)
- {
- if (srv_head)
- ares_free_data (srv_head);
- return status;
- }
-
- /* everything looks fine, return the data */
- *srv_out = srv_head;
-
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_parse_txt_reply.c b/grpc/third_party/cares/cares/ares_parse_txt_reply.c
deleted file mode 100644
index 4856b4ce..00000000
--- a/grpc/third_party/cares/cares/ares_parse_txt_reply.c
+++ /dev/null
@@ -1,220 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_data.h"
-#include "ares_private.h"
-
-static int
-ares__parse_txt_reply (const unsigned char *abuf, int alen,
- int ex, void **txt_out)
-{
- size_t substr_len;
- unsigned int qdcount, ancount, i;
- const unsigned char *aptr;
- const unsigned char *strptr;
- int status, rr_type, rr_class, rr_len;
- long len;
- char *hostname = NULL, *rr_name = NULL;
- struct ares_txt_ext *txt_head = NULL;
- struct ares_txt_ext *txt_last = NULL;
- struct ares_txt_ext *txt_curr;
-
- /* Set *txt_out to NULL for all failure cases. */
- *txt_out = NULL;
-
- /* Give up if abuf doesn't have room for a header. */
- if (alen < HFIXEDSZ)
- return ARES_EBADRESP;
-
- /* Fetch the question and answer count from the header. */
- qdcount = DNS_HEADER_QDCOUNT (abuf);
- ancount = DNS_HEADER_ANCOUNT (abuf);
- if (qdcount != 1)
- return ARES_EBADRESP;
- if (ancount == 0)
- return ARES_ENODATA;
-
- /* Expand the name from the question, and skip past the question. */
- aptr = abuf + HFIXEDSZ;
- status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
- if (status != ARES_SUCCESS)
- return status;
-
- if (aptr + len + QFIXEDSZ > abuf + alen)
- {
- ares_free (hostname);
- return ARES_EBADRESP;
- }
- aptr += len + QFIXEDSZ;
-
- /* Examine each answer resource record (RR) in turn. */
- for (i = 0; i < ancount; i++)
- {
- /* Decode the RR up to the data field. */
- status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
- if (status != ARES_SUCCESS)
- {
- break;
- }
- aptr += len;
- if (aptr + RRFIXEDSZ > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
- rr_type = DNS_RR_TYPE (aptr);
- rr_class = DNS_RR_CLASS (aptr);
- rr_len = DNS_RR_LEN (aptr);
- aptr += RRFIXEDSZ;
- if (aptr + rr_len > abuf + alen)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Check if we are really looking at a TXT record */
- if (rr_class == C_IN && rr_type == T_TXT)
- {
- /*
- * There may be multiple substrings in a single TXT record. Each
- * substring may be up to 255 characters in length, with a
- * "length byte" indicating the size of the substring payload.
- * RDATA contains both the length-bytes and payloads of all
- * substrings contained therein.
- */
-
- strptr = aptr;
- while (strptr < (aptr + rr_len))
- {
- substr_len = (unsigned char)*strptr;
- if (strptr + substr_len + 1 > aptr + rr_len)
- {
- status = ARES_EBADRESP;
- break;
- }
-
- /* Allocate storage for this TXT answer appending it to the list */
- txt_curr = ares_malloc_data(ex ? ARES_DATATYPE_TXT_EXT :
- ARES_DATATYPE_TXT_REPLY);
- if (!txt_curr)
- {
- status = ARES_ENOMEM;
- break;
- }
- if (txt_last)
- {
- txt_last->next = txt_curr;
- }
- else
- {
- txt_head = txt_curr;
- }
- txt_last = txt_curr;
-
- if (ex)
- txt_curr->record_start = (strptr == aptr);
- txt_curr->length = substr_len;
- txt_curr->txt = ares_malloc (substr_len + 1/* Including null byte */);
- if (txt_curr->txt == NULL)
- {
- status = ARES_ENOMEM;
- break;
- }
-
- ++strptr;
- memcpy ((char *) txt_curr->txt, strptr, substr_len);
-
- /* Make sure we NULL-terminate */
- txt_curr->txt[substr_len] = 0;
-
- strptr += substr_len;
- }
- }
-
- /* Propagate any failures */
- if (status != ARES_SUCCESS)
- {
- break;
- }
-
- /* Don't lose memory in the next iteration */
- ares_free (rr_name);
- rr_name = NULL;
-
- /* Move on to the next record */
- aptr += rr_len;
- }
-
- if (hostname)
- ares_free (hostname);
- if (rr_name)
- ares_free (rr_name);
-
- /* clean up on error */
- if (status != ARES_SUCCESS)
- {
- if (txt_head)
- ares_free_data (txt_head);
- return status;
- }
-
- /* everything looks fine, return the data */
- *txt_out = txt_head;
-
- return ARES_SUCCESS;
-}
-
-int
-ares_parse_txt_reply (const unsigned char *abuf, int alen,
- struct ares_txt_reply **txt_out)
-{
- return ares__parse_txt_reply(abuf, alen, 0, (void **) txt_out);
-}
-
-
-int
-ares_parse_txt_reply_ext (const unsigned char *abuf, int alen,
- struct ares_txt_ext **txt_out)
-{
- return ares__parse_txt_reply(abuf, alen, 1, (void **) txt_out);
-}
diff --git a/grpc/third_party/cares/cares/ares_private.h b/grpc/third_party/cares/cares/ares_private.h
deleted file mode 100644
index 1990f690..00000000
--- a/grpc/third_party/cares/cares/ares_private.h
+++ /dev/null
@@ -1,382 +0,0 @@
-#ifndef __ARES_PRIVATE_H
-#define __ARES_PRIVATE_H
-
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2010 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-/*
- * Define WIN32 when build target is Win32 API
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-#define WIN32
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef WATT32
-#include <tcp.h>
-#include <sys/ioctl.h>
-#define writev(s,v,c) writev_s(s,v,c)
-#define HAVE_WRITEV 1
-#endif
-
-#define DEFAULT_TIMEOUT 5000 /* milliseconds */
-#define DEFAULT_TRIES 4
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
-#ifdef CARES_EXPOSE_STATICS
-/* Make some internal functions visible for testing */
-#define STATIC_TESTABLE
-#else
-#define STATIC_TESTABLE static
-#endif
-
-#if defined(WIN32) && !defined(WATT32)
-
-#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
-#define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
-#define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient"
-#define WIN_NT_DNSCLIENT "Software\\Policies\\Microsoft\\Windows NT\\DNSClient"
-#define NAMESERVER "NameServer"
-#define DHCPNAMESERVER "DhcpNameServer"
-#define DATABASEPATH "DatabasePath"
-#define WIN_PATH_HOSTS "\\hosts"
-#define SEARCHLIST_KEY "SearchList"
-#define PRIMARYDNSSUFFIX_KEY "PrimaryDNSSuffix"
-#define INTERFACES_KEY "Interfaces"
-#define DOMAIN_KEY "Domain"
-#define DHCPDOMAIN_KEY "DhcpDomain"
-
-#elif defined(WATT32)
-
-#define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
-
-#elif defined(NETWARE)
-
-#define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
-#define PATH_HOSTS "sys:/etc/hosts"
-
-#elif defined(__riscos__)
-
-#define PATH_HOSTS "InetDBase:Hosts"
-
-#else
-
-#define PATH_RESOLV_CONF "/etc/resolv.conf"
-#ifdef ETC_INET
-#define PATH_HOSTS "/etc/inet/hosts"
-#else
-#define PATH_HOSTS "/etc/hosts"
-#endif
-
-#endif
-
-#define ARES_ID_KEY_LEN 31
-
-#include "ares_ipv6.h"
-#include "ares_llist.h"
-
-#ifndef HAVE_GETENV
-# include "ares_getenv.h"
-# define getenv(ptr) ares_getenv(ptr)
-#endif
-
-#include "ares_strdup.h"
-#include "ares_strsplit.h"
-
-#ifndef HAVE_STRCASECMP
-# include "ares_strcasecmp.h"
-# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
-#endif
-
-#ifndef HAVE_STRNCASECMP
-# include "ares_strcasecmp.h"
-# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
-#endif
-
-#ifndef HAVE_WRITEV
-# include "ares_writev.h"
-# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
-#endif
-
-/********* EDNS defines section ******/
-#define EDNSPACKETSZ 1280 /* Reasonable UDP payload size, as suggested
- in RFC2671 */
-#define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */
-#define EDNSFIXEDSZ 11 /* Size of EDNS header */
-/********* EDNS defines section ******/
-
-struct ares_addr {
- int family;
- union {
- struct in_addr addr4;
- struct ares_in6_addr addr6;
- } addr;
- int udp_port; /* stored in network order */
- int tcp_port; /* stored in network order */
-};
-#define addrV4 addr.addr4
-#define addrV6 addr.addr6
-
-struct query;
-
-struct send_request {
- /* Remaining data to send */
- const unsigned char *data;
- size_t len;
-
- /* The query for which we're sending this data */
- struct query* owner_query;
- /* The buffer we're using, if we have our own copy of the packet */
- unsigned char *data_storage;
-
- /* Next request in queue */
- struct send_request *next;
-};
-
-struct server_state {
- struct ares_addr addr;
- ares_socket_t udp_socket;
- ares_socket_t tcp_socket;
-
- /* Mini-buffer for reading the length word */
- unsigned char tcp_lenbuf[2];
- int tcp_lenbuf_pos;
- int tcp_length;
-
- /* Buffer for reading actual TCP data */
- unsigned char *tcp_buffer;
- int tcp_buffer_pos;
-
- /* TCP output queue */
- struct send_request *qhead;
- struct send_request *qtail;
-
- /* Which incarnation of this connection is this? We don't want to
- * retransmit requests into the very same socket, but if the server
- * closes on us and we re-open the connection, then we do want to
- * re-send. */
- int tcp_connection_generation;
-
- /* Circular, doubly-linked list of outstanding queries to this server */
- struct list_node queries_to_server;
-
- /* Link back to owning channel */
- ares_channel channel;
-
- /* Is this server broken? We mark connections as broken when a
- * request that is queued for sending times out.
- */
- int is_broken;
-};
-
-/* State to represent a DNS query */
-struct query {
- /* Query ID from qbuf, for faster lookup, and current timeout */
- unsigned short qid;
- struct timeval timeout;
-
- /*
- * Links for the doubly-linked lists in which we insert a query.
- * These circular, doubly-linked lists that are hash-bucketed based
- * the attributes we care about, help making most important
- * operations O(1).
- */
- struct list_node queries_by_qid; /* hopefully in same cache line as qid */
- struct list_node queries_by_timeout;
- struct list_node queries_to_server;
- struct list_node all_queries;
-
- /* Query buf with length at beginning, for TCP transmission */
- unsigned char *tcpbuf;
- int tcplen;
-
- /* Arguments passed to ares_send() (qbuf points into tcpbuf) */
- const unsigned char *qbuf;
- int qlen;
- ares_callback callback;
- void *arg;
-
- /* Query status */
- int try_count; /* Number of times we tried this query already. */
- int server; /* Server this query has last been sent to. */
- struct query_server_info *server_info; /* per-server state */
- int using_tcp;
- int error_status;
- int timeouts; /* number of timeouts we saw for this request */
-};
-
-/* Per-server state for a query */
-struct query_server_info {
- int skip_server; /* should we skip server, due to errors, etc? */
- int tcp_connection_generation; /* into which TCP connection did we send? */
-};
-
-/* An IP address pattern; matches an IP address X if X & mask == addr */
-#define PATTERN_MASK 0x1
-#define PATTERN_CIDR 0x2
-
-struct apattern {
- union
- {
- struct in_addr addr4;
- struct ares_in6_addr addr6;
- } addr;
- union
- {
- struct in_addr addr4;
- struct ares_in6_addr addr6;
- unsigned short bits;
- } mask;
- int family;
- unsigned short type;
-};
-
-typedef struct rc4_key
-{
- unsigned char state[256];
- unsigned char x;
- unsigned char y;
-} rc4_key;
-
-struct ares_channeldata {
- /* Configuration data */
- int flags;
- int timeout; /* in milliseconds */
- int tries;
- int ndots;
- int rotate; /* if true, all servers specified are used */
- int udp_port; /* stored in network order */
- int tcp_port; /* stored in network order */
- int socket_send_buffer_size;
- int socket_receive_buffer_size;
- char **domains;
- int ndomains;
- struct apattern *sortlist;
- int nsort;
- char *lookups;
- int ednspsz;
-
- /* For binding to local devices and/or IP addresses. Leave
- * them null/zero for no binding.
- */
- char local_dev_name[32];
- unsigned int local_ip4;
- unsigned char local_ip6[16];
-
- int optmask; /* the option bitfield passed in at init time */
-
- /* Server addresses and communications state */
- struct server_state *servers;
- int nservers;
-
- /* ID to use for next query */
- unsigned short next_id;
- /* key to use when generating new ids */
- rc4_key id_key;
-
- /* Generation number to use for the next TCP socket open/close */
- int tcp_connection_generation;
-
- /* The time at which we last called process_timeouts(). Uses integer seconds
- just to draw the line somewhere. */
- time_t last_timeout_processed;
-
- /* Last server we sent a query to. */
- int last_server;
-
- /* Circular, doubly-linked list of queries, bucketed various ways.... */
- /* All active queries in a single list: */
- struct list_node all_queries;
- /* Queries bucketed by qid, for quickly dispatching DNS responses: */
-#define ARES_QID_TABLE_SIZE 2048
- struct list_node queries_by_qid[ARES_QID_TABLE_SIZE];
- /* Queries bucketed by timeout, for quickly handling timeouts: */
-#define ARES_TIMEOUT_TABLE_SIZE 1024
- struct list_node queries_by_timeout[ARES_TIMEOUT_TABLE_SIZE];
-
- ares_sock_state_cb sock_state_cb;
- void *sock_state_cb_data;
-
- ares_sock_create_callback sock_create_cb;
- void *sock_create_cb_data;
-
- ares_sock_config_callback sock_config_cb;
- void *sock_config_cb_data;
-
- const struct ares_socket_functions * sock_funcs;
- void *sock_func_cb_data;
-
- /* Path for resolv.conf file, configurable via ares_options */
- char *resolvconf_path;
-};
-
-/* Does the domain end in ".onion" or ".onion."? Case-insensitive. */
-int ares__is_onion_domain(const char *name);
-
-/* Memory management functions */
-extern void *(*ares_malloc)(size_t size);
-extern void *(*ares_realloc)(void *ptr, size_t size);
-extern void (*ares_free)(void *ptr);
-
-/* return true if now is exactly check time or later */
-int ares__timedout(struct timeval *now,
- struct timeval *check);
-
-void ares__send_query(ares_channel channel, struct query *query,
- struct timeval *now);
-void ares__close_sockets(ares_channel channel, struct server_state *server);
-int ares__get_hostent(FILE *fp, int family, struct hostent **host);
-int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
-void ares__free_query(struct query *query);
-unsigned short ares__generate_new_id(rc4_key* key);
-struct timeval ares__tvnow(void);
-int ares__expand_name_for_response(const unsigned char *encoded,
- const unsigned char *abuf, int alen,
- char **s, long *enclen);
-void ares__init_servers_state(ares_channel channel);
-void ares__destroy_servers_state(ares_channel channel);
-#if 0 /* Not used */
-long ares__tvdiff(struct timeval t1, struct timeval t2);
-#endif
-
-void ares__socket_close(ares_channel, ares_socket_t);
-
-#define ARES_SWAP_BYTE(a,b) \
- { unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
-
-#define SOCK_STATE_CALLBACK(c, s, r, w) \
- do { \
- if ((c)->sock_state_cb) \
- (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
- } WHILE_FALSE
-
-#ifdef CURLDEBUG
-/* This is low-level hard-hacking memory leak tracking and similar. Using the
- libcurl lowlevel code from within library is ugly and only works when
- c-ares is built and linked with a similarly curldebug-enabled libcurl,
- but we do this anyway for convenience. */
-#define HEADER_CURL_SETUP_ONCE_H
-#include "../lib/memdebug.h"
-#endif
-
-#endif /* __ARES_PRIVATE_H */
diff --git a/grpc/third_party/cares/cares/ares_process.c b/grpc/third_party/cares/cares/ares_process.c
deleted file mode 100644
index df9f290b..00000000
--- a/grpc/third_party/cares/cares/ares_process.c
+++ /dev/null
@@ -1,1473 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2004-2017 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_SYS_UIO_H
-# include <sys/uio.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-# include <netinet/tcp.h>
-#endif
-#ifdef HAVE_NETDB_H
-# include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-#ifdef NETWARE
-# include <sys/filio.h>
-#endif
-
-#include <assert.h>
-#include <fcntl.h>
-#include <limits.h>
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_nowarn.h"
-#include "ares_private.h"
-
-
-static int try_again(int errnum);
-static void write_tcp_data(ares_channel channel, fd_set *write_fds,
- ares_socket_t write_fd, struct timeval *now);
-static void read_tcp_data(ares_channel channel, fd_set *read_fds,
- ares_socket_t read_fd, struct timeval *now);
-static void read_udp_packets(ares_channel channel, fd_set *read_fds,
- ares_socket_t read_fd, struct timeval *now);
-static void advance_tcp_send_queue(ares_channel channel, int whichserver,
- ares_ssize_t num_bytes);
-static void process_timeouts(ares_channel channel, struct timeval *now);
-static void process_broken_connections(ares_channel channel,
- struct timeval *now);
-static void process_answer(ares_channel channel, unsigned char *abuf,
- int alen, int whichserver, int tcp,
- struct timeval *now);
-static void handle_error(ares_channel channel, int whichserver,
- struct timeval *now);
-static void skip_server(ares_channel channel, struct query *query,
- int whichserver);
-static void next_server(ares_channel channel, struct query *query,
- struct timeval *now);
-static int open_tcp_socket(ares_channel channel, struct server_state *server);
-static int open_udp_socket(ares_channel channel, struct server_state *server);
-static int same_questions(const unsigned char *qbuf, int qlen,
- const unsigned char *abuf, int alen);
-static int same_address(struct sockaddr *sa, struct ares_addr *aa);
-static void end_query(ares_channel channel, struct query *query, int status,
- unsigned char *abuf, int alen);
-
-/* return true if now is exactly check time or later */
-int ares__timedout(struct timeval *now,
- struct timeval *check)
-{
- long secs = (now->tv_sec - check->tv_sec);
-
- if(secs > 0)
- return 1; /* yes, timed out */
- if(secs < 0)
- return 0; /* nope, not timed out */
-
- /* if the full seconds were identical, check the sub second parts */
- return (now->tv_usec - check->tv_usec >= 0);
-}
-
-/* add the specific number of milliseconds to the time in the first argument */
-static void timeadd(struct timeval *now, int millisecs)
-{
- now->tv_sec += millisecs/1000;
- now->tv_usec += (millisecs%1000)*1000;
-
- if(now->tv_usec >= 1000000) {
- ++(now->tv_sec);
- now->tv_usec -= 1000000;
- }
-}
-
-/*
- * generic process function
- */
-static void processfds(ares_channel channel,
- fd_set *read_fds, ares_socket_t read_fd,
- fd_set *write_fds, ares_socket_t write_fd)
-{
- struct timeval now = ares__tvnow();
-
- write_tcp_data(channel, write_fds, write_fd, &now);
- read_tcp_data(channel, read_fds, read_fd, &now);
- read_udp_packets(channel, read_fds, read_fd, &now);
- process_timeouts(channel, &now);
- process_broken_connections(channel, &now);
-}
-
-/* Something interesting happened on the wire, or there was a timeout.
- * See what's up and respond accordingly.
- */
-void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
-{
- processfds(channel, read_fds, ARES_SOCKET_BAD, write_fds, ARES_SOCKET_BAD);
-}
-
-/* Something interesting happened on the wire, or there was a timeout.
- * See what's up and respond accordingly.
- */
-void ares_process_fd(ares_channel channel,
- ares_socket_t read_fd, /* use ARES_SOCKET_BAD or valid
- file descriptors */
- ares_socket_t write_fd)
-{
- processfds(channel, NULL, read_fd, NULL, write_fd);
-}
-
-
-/* Return 1 if the specified error number describes a readiness error, or 0
- * otherwise. This is mostly for HP-UX, which could return EAGAIN or
- * EWOULDBLOCK. See this man page
- *
- * http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?
- * manpage=/usr/share/man/man2.Z/send.2
- */
-static int try_again(int errnum)
-{
-#if !defined EWOULDBLOCK && !defined EAGAIN
-#error "Neither EWOULDBLOCK nor EAGAIN defined"
-#endif
- switch (errnum)
- {
-#ifdef EWOULDBLOCK
- case EWOULDBLOCK:
- return 1;
-#endif
-#if defined EAGAIN && EAGAIN != EWOULDBLOCK
- case EAGAIN:
- return 1;
-#endif
- }
- return 0;
-}
-
-static ares_ssize_t socket_writev(ares_channel channel, ares_socket_t s, const struct iovec * vec, int len)
-{
- if (channel->sock_funcs)
- return channel->sock_funcs->asendv(s, vec, len, channel->sock_func_cb_data);
-
- return writev(s, vec, len);
-}
-
-static ares_ssize_t socket_write(ares_channel channel, ares_socket_t s, const void * data, size_t len)
-{
- if (channel->sock_funcs)
- {
- struct iovec vec;
- vec.iov_base = (void*)data;
- vec.iov_len = len;
- return channel->sock_funcs->asendv(s, &vec, 1, channel->sock_func_cb_data);
- }
- return swrite(s, data, len);
-}
-
-/* If any TCP sockets select true for writing, write out queued data
- * we have for them.
- */
-static void write_tcp_data(ares_channel channel,
- fd_set *write_fds,
- ares_socket_t write_fd,
- struct timeval *now)
-{
- struct server_state *server;
- struct send_request *sendreq;
- struct iovec *vec;
- int i;
- ares_ssize_t scount;
- ares_ssize_t wcount;
- size_t n;
-
- if(!write_fds && (write_fd == ARES_SOCKET_BAD))
- /* no possible action */
- return;
-
- for (i = 0; i < channel->nservers; i++)
- {
- /* Make sure server has data to send and is selected in write_fds or
- write_fd. */
- server = &channel->servers[i];
- if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD ||
- server->is_broken)
- continue;
-
- if(write_fds) {
- if(!FD_ISSET(server->tcp_socket, write_fds))
- continue;
- }
- else {
- if(server->tcp_socket != write_fd)
- continue;
- }
-
- if(write_fds)
- /* If there's an error and we close this socket, then open
- * another with the same fd to talk to another server, then we
- * don't want to think that it was the new socket that was
- * ready. This is not disastrous, but is likely to result in
- * extra system calls and confusion. */
- FD_CLR(server->tcp_socket, write_fds);
-
- /* Count the number of send queue items. */
- n = 0;
- for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
- n++;
-
- /* Allocate iovecs so we can send all our data at once. */
- vec = ares_malloc(n * sizeof(struct iovec));
- if (vec)
- {
- /* Fill in the iovecs and send. */
- n = 0;
- for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
- {
- vec[n].iov_base = (char *) sendreq->data;
- vec[n].iov_len = sendreq->len;
- n++;
- }
- wcount = socket_writev(channel, server->tcp_socket, vec, (int)n);
- ares_free(vec);
- if (wcount < 0)
- {
- if (!try_again(SOCKERRNO))
- handle_error(channel, i, now);
- continue;
- }
-
- /* Advance the send queue by as many bytes as we sent. */
- advance_tcp_send_queue(channel, i, wcount);
- }
- else
- {
- /* Can't allocate iovecs; just send the first request. */
- sendreq = server->qhead;
-
- scount = socket_write(channel, server->tcp_socket, sendreq->data, sendreq->len);
- if (scount < 0)
- {
- if (!try_again(SOCKERRNO))
- handle_error(channel, i, now);
- continue;
- }
-
- /* Advance the send queue by as many bytes as we sent. */
- advance_tcp_send_queue(channel, i, scount);
- }
- }
-}
-
-/* Consume the given number of bytes from the head of the TCP send queue. */
-static void advance_tcp_send_queue(ares_channel channel, int whichserver,
- ares_ssize_t num_bytes)
-{
- struct send_request *sendreq;
- struct server_state *server = &channel->servers[whichserver];
- while (num_bytes > 0) {
- sendreq = server->qhead;
- if ((size_t)num_bytes >= sendreq->len) {
- num_bytes -= sendreq->len;
- server->qhead = sendreq->next;
- if (sendreq->data_storage)
- ares_free(sendreq->data_storage);
- ares_free(sendreq);
- if (server->qhead == NULL) {
- SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
- server->qtail = NULL;
-
- /* qhead is NULL so we cannot continue this loop */
- break;
- }
- }
- else {
- sendreq->data += num_bytes;
- sendreq->len -= num_bytes;
- num_bytes = 0;
- }
- }
-}
-
-static ares_ssize_t socket_recvfrom(ares_channel channel,
- ares_socket_t s,
- void * data,
- size_t data_len,
- int flags,
- struct sockaddr *from,
- ares_socklen_t *from_len)
-{
- if (channel->sock_funcs)
- return channel->sock_funcs->arecvfrom(s, data, data_len,
- flags, from, from_len,
- channel->sock_func_cb_data);
-
-#ifdef HAVE_RECVFROM
- return recvfrom(s, data, data_len, flags, from, from_len);
-#else
- return sread(s, data, data_len);
-#endif
-}
-
-static ares_ssize_t socket_recv(ares_channel channel,
- ares_socket_t s,
- void * data,
- size_t data_len)
-{
- if (channel->sock_funcs)
- return channel->sock_funcs->arecvfrom(s, data, data_len, 0, 0, 0,
- channel->sock_func_cb_data);
-
- return sread(s, data, data_len);
-}
-
-/* If any TCP socket selects true for reading, read some data,
- * allocate a buffer if we finish reading the length word, and process
- * a packet if we finish reading one.
- */
-static void read_tcp_data(ares_channel channel, fd_set *read_fds,
- ares_socket_t read_fd, struct timeval *now)
-{
- struct server_state *server;
- int i;
- ares_ssize_t count;
-
- if(!read_fds && (read_fd == ARES_SOCKET_BAD))
- /* no possible action */
- return;
-
- for (i = 0; i < channel->nservers; i++)
- {
- /* Make sure the server has a socket and is selected in read_fds. */
- server = &channel->servers[i];
- if (server->tcp_socket == ARES_SOCKET_BAD || server->is_broken)
- continue;
-
- if(read_fds) {
- if(!FD_ISSET(server->tcp_socket, read_fds))
- continue;
- }
- else {
- if(server->tcp_socket != read_fd)
- continue;
- }
-
- if(read_fds)
- /* If there's an error and we close this socket, then open another
- * with the same fd to talk to another server, then we don't want to
- * think that it was the new socket that was ready. This is not
- * disastrous, but is likely to result in extra system calls and
- * confusion. */
- FD_CLR(server->tcp_socket, read_fds);
-
- if (server->tcp_lenbuf_pos != 2)
- {
- /* We haven't yet read a length word, so read that (or
- * what's left to read of it).
- */
- count = socket_recv(channel, server->tcp_socket,
- server->tcp_lenbuf + server->tcp_lenbuf_pos,
- 2 - server->tcp_lenbuf_pos);
- if (count <= 0)
- {
- if (!(count == -1 && try_again(SOCKERRNO)))
- handle_error(channel, i, now);
- continue;
- }
-
- server->tcp_lenbuf_pos += (int)count;
- if (server->tcp_lenbuf_pos == 2)
- {
- /* We finished reading the length word. Decode the
- * length and allocate a buffer for the data.
- */
- server->tcp_length = server->tcp_lenbuf[0] << 8
- | server->tcp_lenbuf[1];
- server->tcp_buffer = ares_malloc(server->tcp_length);
- if (!server->tcp_buffer) {
- handle_error(channel, i, now);
- return; /* bail out on malloc failure. TODO: make this
- function return error codes */
- }
- server->tcp_buffer_pos = 0;
- }
- }
- else
- {
- /* Read data into the allocated buffer. */
- count = socket_recv(channel, server->tcp_socket,
- server->tcp_buffer + server->tcp_buffer_pos,
- server->tcp_length - server->tcp_buffer_pos);
- if (count <= 0)
- {
- if (!(count == -1 && try_again(SOCKERRNO)))
- handle_error(channel, i, now);
- continue;
- }
-
- server->tcp_buffer_pos += (int)count;
- if (server->tcp_buffer_pos == server->tcp_length)
- {
- /* We finished reading this answer; process it and
- * prepare to read another length word.
- */
- process_answer(channel, server->tcp_buffer, server->tcp_length,
- i, 1, now);
- ares_free(server->tcp_buffer);
- server->tcp_buffer = NULL;
- server->tcp_lenbuf_pos = 0;
- server->tcp_buffer_pos = 0;
- }
- }
- }
-}
-
-/* If any UDP sockets select true for reading, process them. */
-static void read_udp_packets(ares_channel channel, fd_set *read_fds,
- ares_socket_t read_fd, struct timeval *now)
-{
- struct server_state *server;
- int i;
- ares_ssize_t count;
- unsigned char buf[MAXENDSSZ + 1];
-#ifdef HAVE_RECVFROM
- ares_socklen_t fromlen;
- union {
- struct sockaddr sa;
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
- } from;
-#endif
-
- if(!read_fds && (read_fd == ARES_SOCKET_BAD))
- /* no possible action */
- return;
-
- for (i = 0; i < channel->nservers; i++)
- {
- /* Make sure the server has a socket and is selected in read_fds. */
- server = &channel->servers[i];
-
- if (server->udp_socket == ARES_SOCKET_BAD || server->is_broken)
- continue;
-
- if(read_fds) {
- if(!FD_ISSET(server->udp_socket, read_fds))
- continue;
- }
- else {
- if(server->udp_socket != read_fd)
- continue;
- }
-
- if(read_fds)
- /* If there's an error and we close this socket, then open
- * another with the same fd to talk to another server, then we
- * don't want to think that it was the new socket that was
- * ready. This is not disastrous, but is likely to result in
- * extra system calls and confusion. */
- FD_CLR(server->udp_socket, read_fds);
-
- /* To reduce event loop overhead, read and process as many
- * packets as we can. */
- do {
- if (server->udp_socket == ARES_SOCKET_BAD)
- count = 0;
-
- else {
- if (server->addr.family == AF_INET)
- fromlen = sizeof(from.sa4);
- else
- fromlen = sizeof(from.sa6);
- count = socket_recvfrom(channel, server->udp_socket, (void *)buf,
- sizeof(buf), 0, &from.sa, &fromlen);
- }
-
- if (count == -1 && try_again(SOCKERRNO))
- continue;
- else if (count <= 0)
- handle_error(channel, i, now);
-#ifdef HAVE_RECVFROM
- else if (!same_address(&from.sa, &server->addr))
- /* The address the response comes from does not match the address we
- * sent the request to. Someone may be attempting to perform a cache
- * poisoning attack. */
- break;
-#endif
- else
- process_answer(channel, buf, (int)count, i, 0, now);
- } while (count > 0);
- }
-}
-
-/* If any queries have timed out, note the timeout and move them on. */
-static void process_timeouts(ares_channel channel, struct timeval *now)
-{
- time_t t; /* the time of the timeouts we're processing */
- struct query *query;
- struct list_node* list_head;
- struct list_node* list_node;
-
- /* Process all the timeouts that have fired since the last time we processed
- * timeouts. If things are going well, then we'll have hundreds/thousands of
- * queries that fall into future buckets, and only a handful of requests
- * that fall into the "now" bucket, so this should be quite quick.
- */
- for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
- {
- list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
- for (list_node = list_head->next; list_node != list_head; )
- {
- query = list_node->data;
- list_node = list_node->next; /* in case the query gets deleted */
- if (query->timeout.tv_sec && ares__timedout(now, &query->timeout))
- {
- query->error_status = ARES_ETIMEOUT;
- ++query->timeouts;
- next_server(channel, query, now);
- }
- }
- }
- channel->last_timeout_processed = now->tv_sec;
-}
-
-/* Handle an answer from a server. */
-static void process_answer(ares_channel channel, unsigned char *abuf,
- int alen, int whichserver, int tcp,
- struct timeval *now)
-{
- int tc, rcode, packetsz;
- unsigned short id;
- struct query *query;
- struct list_node* list_head;
- struct list_node* list_node;
-
- /* If there's no room in the answer for a header, we can't do much
- * with it. */
- if (alen < HFIXEDSZ)
- return;
-
- /* Grab the query ID, truncate bit, and response code from the packet. */
- id = DNS_HEADER_QID(abuf);
- tc = DNS_HEADER_TC(abuf);
- rcode = DNS_HEADER_RCODE(abuf);
-
- /* Find the query corresponding to this packet. The queries are
- * hashed/bucketed by query id, so this lookup should be quick. Note that
- * both the query id and the questions must be the same; when the query id
- * wraps around we can have multiple outstanding queries with the same query
- * id, so we need to check both the id and question.
- */
- query = NULL;
- list_head = &(channel->queries_by_qid[id % ARES_QID_TABLE_SIZE]);
- for (list_node = list_head->next; list_node != list_head;
- list_node = list_node->next)
- {
- struct query *q = list_node->data;
- if ((q->qid == id) && same_questions(q->qbuf, q->qlen, abuf, alen))
- {
- query = q;
- break;
- }
- }
- if (!query)
- return;
-
- packetsz = PACKETSZ;
- /* If we use EDNS and server answers with one of these RCODES, the protocol
- * extension is not understood by the responder. We must retry the query
- * without EDNS enabled.
- */
- if (channel->flags & ARES_FLAG_EDNS)
- {
- packetsz = channel->ednspsz;
- if (rcode == NOTIMP || rcode == FORMERR || rcode == SERVFAIL)
- {
- int qlen = (query->tcplen - 2) - EDNSFIXEDSZ;
- channel->flags ^= ARES_FLAG_EDNS;
- query->tcplen -= EDNSFIXEDSZ;
- query->qlen -= EDNSFIXEDSZ;
- query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
- query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
- DNS_HEADER_SET_ARCOUNT(query->tcpbuf + 2, 0);
- query->tcpbuf = ares_realloc(query->tcpbuf, query->tcplen);
- query->qbuf = query->tcpbuf + 2;
- ares__send_query(channel, query, now);
- return;
- }
- }
-
- /* If we got a truncated UDP packet and are not ignoring truncation,
- * don't accept the packet, and switch the query to TCP if we hadn't
- * done so already.
- */
- if ((tc || alen > packetsz) && !tcp && !(channel->flags & ARES_FLAG_IGNTC))
- {
- if (!query->using_tcp)
- {
- query->using_tcp = 1;
- ares__send_query(channel, query, now);
- }
- return;
- }
-
- /* Limit alen to PACKETSZ if we aren't using TCP (only relevant if we
- * are ignoring truncation.
- */
- if (alen > packetsz && !tcp)
- alen = packetsz;
-
- /* If we aren't passing through all error packets, discard packets
- * with SERVFAIL, NOTIMP, or REFUSED response codes.
- */
- if (!(channel->flags & ARES_FLAG_NOCHECKRESP))
- {
- if (rcode == SERVFAIL || rcode == NOTIMP || rcode == REFUSED)
- {
- skip_server(channel, query, whichserver);
- if (query->server == whichserver)
- next_server(channel, query, now);
- return;
- }
- }
-
- end_query(channel, query, ARES_SUCCESS, abuf, alen);
-}
-
-/* Close all the connections that are no longer usable. */
-static void process_broken_connections(ares_channel channel,
- struct timeval *now)
-{
- int i;
- for (i = 0; i < channel->nservers; i++)
- {
- struct server_state *server = &channel->servers[i];
- if (server->is_broken)
- {
- handle_error(channel, i, now);
- }
- }
-}
-
-/* Swap the contents of two lists */
-static void swap_lists(struct list_node* head_a,
- struct list_node* head_b)
-{
- int is_a_empty = ares__is_list_empty(head_a);
- int is_b_empty = ares__is_list_empty(head_b);
- struct list_node old_a = *head_a;
- struct list_node old_b = *head_b;
-
- if (is_a_empty) {
- ares__init_list_head(head_b);
- } else {
- *head_b = old_a;
- old_a.next->prev = head_b;
- old_a.prev->next = head_b;
- }
- if (is_b_empty) {
- ares__init_list_head(head_a);
- } else {
- *head_a = old_b;
- old_b.next->prev = head_a;
- old_b.prev->next = head_a;
- }
-}
-
-static void handle_error(ares_channel channel, int whichserver,
- struct timeval *now)
-{
- struct server_state *server;
- struct query *query;
- struct list_node list_head;
- struct list_node* list_node;
-
- server = &channel->servers[whichserver];
-
- /* Reset communications with this server. */
- ares__close_sockets(channel, server);
-
- /* Tell all queries talking to this server to move on and not try this
- * server again. We steal the current list of queries that were in-flight to
- * this server, since when we call next_server this can cause the queries to
- * be re-sent to this server, which will re-insert these queries in that
- * same server->queries_to_server list.
- */
- ares__init_list_head(&list_head);
- swap_lists(&list_head, &(server->queries_to_server));
- for (list_node = list_head.next; list_node != &list_head; )
- {
- query = list_node->data;
- list_node = list_node->next; /* in case the query gets deleted */
- assert(query->server == whichserver);
- skip_server(channel, query, whichserver);
- next_server(channel, query, now);
- }
- /* Each query should have removed itself from our temporary list as
- * it re-sent itself or finished up...
- */
- assert(ares__is_list_empty(&list_head));
-}
-
-static void skip_server(ares_channel channel, struct query *query,
- int whichserver)
-{
- /* The given server gave us problems with this query, so if we have the
- * luxury of using other servers, then let's skip the potentially broken
- * server and just use the others. If we only have one server and we need to
- * retry then we should just go ahead and re-use that server, since it's our
- * only hope; perhaps we just got unlucky, and retrying will work (eg, the
- * server timed out our TCP connection just as we were sending another
- * request).
- */
- if (channel->nservers > 1)
- {
- query->server_info[whichserver].skip_server = 1;
- }
-}
-
-static void next_server(ares_channel channel, struct query *query,
- struct timeval *now)
-{
- /* We need to try each server channel->tries times. We have channel->nservers
- * servers to try. In total, we need to do channel->nservers * channel->tries
- * attempts. Use query->try to remember how many times we already attempted
- * this query. Use modular arithmetic to find the next server to try. */
- while (++(query->try_count) < (channel->nservers * channel->tries))
- {
- struct server_state *server;
-
- /* Move on to the next server. */
- query->server = (query->server + 1) % channel->nservers;
- server = &channel->servers[query->server];
-
- /* We don't want to use this server if (1) we decided this connection is
- * broken, and thus about to be closed, (2) we've decided to skip this
- * server because of earlier errors we encountered, or (3) we already
- * sent this query over this exact connection.
- */
- if (!server->is_broken &&
- !query->server_info[query->server].skip_server &&
- !(query->using_tcp &&
- (query->server_info[query->server].tcp_connection_generation ==
- server->tcp_connection_generation)))
- {
- ares__send_query(channel, query, now);
- return;
- }
-
- /* You might think that with TCP we only need one try. However, even
- * when using TCP, servers can time-out our connection just as we're
- * sending a request, or close our connection because they die, or never
- * send us a reply because they get wedged or tickle a bug that drops
- * our request.
- */
- }
-
- /* If we are here, all attempts to perform query failed. */
- end_query(channel, query, query->error_status, NULL, 0);
-}
-
-void ares__send_query(ares_channel channel, struct query *query,
- struct timeval *now)
-{
- struct send_request *sendreq;
- struct server_state *server;
- int timeplus;
-
- server = &channel->servers[query->server];
- if (query->using_tcp)
- {
- /* Make sure the TCP socket for this server is set up and queue
- * a send request.
- */
- if (server->tcp_socket == ARES_SOCKET_BAD)
- {
- if (open_tcp_socket(channel, server) == -1)
- {
- skip_server(channel, query, query->server);
- next_server(channel, query, now);
- return;
- }
- }
- sendreq = ares_malloc(sizeof(struct send_request));
- if (!sendreq)
- {
- end_query(channel, query, ARES_ENOMEM, NULL, 0);
- return;
- }
- memset(sendreq, 0, sizeof(struct send_request));
- /* To make the common case fast, we avoid copies by using the query's
- * tcpbuf for as long as the query is alive. In the rare case where the
- * query ends while it's queued for transmission, then we give the
- * sendreq its own copy of the request packet and put it in
- * sendreq->data_storage.
- */
- sendreq->data_storage = NULL;
- sendreq->data = query->tcpbuf;
- sendreq->len = query->tcplen;
- sendreq->owner_query = query;
- sendreq->next = NULL;
- if (server->qtail)
- server->qtail->next = sendreq;
- else
- {
- SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 1);
- server->qhead = sendreq;
- }
- server->qtail = sendreq;
- query->server_info[query->server].tcp_connection_generation =
- server->tcp_connection_generation;
- }
- else
- {
- if (server->udp_socket == ARES_SOCKET_BAD)
- {
- if (open_udp_socket(channel, server) == -1)
- {
- skip_server(channel, query, query->server);
- next_server(channel, query, now);
- return;
- }
- }
- if (socket_write(channel, server->udp_socket, query->qbuf, query->qlen) == -1)
- {
- /* FIXME: Handle EAGAIN here since it likely can happen. */
- skip_server(channel, query, query->server);
- next_server(channel, query, now);
- return;
- }
- }
-
- /* For each trip through the entire server list, double the channel's
- * assigned timeout, avoiding overflow. If channel->timeout is negative,
- * leave it as-is, even though that should be impossible here.
- */
- timeplus = channel->timeout;
- {
- /* How many times do we want to double it? Presume sane values here. */
- const int shift = query->try_count / channel->nservers;
-
- /* Is there enough room to shift timeplus left that many times?
- *
- * To find out, confirm that all of the bits we'll shift away are zero.
- * Stop considering a shift if we get to the point where we could shift
- * a 1 into the sign bit (i.e. when shift is within two of the bit
- * count).
- *
- * This has the side benefit of leaving negative numbers unchanged.
- */
- if(shift <= (int)(sizeof(int) * CHAR_BIT - 1)
- && (timeplus >> (sizeof(int) * CHAR_BIT - 1 - shift)) == 0)
- {
- timeplus <<= shift;
- }
- }
-
- query->timeout = *now;
- timeadd(&query->timeout, timeplus);
- /* Keep track of queries bucketed by timeout, so we can process
- * timeout events quickly.
- */
- ares__remove_from_list(&(query->queries_by_timeout));
- ares__insert_in_list(
- &(query->queries_by_timeout),
- &(channel->queries_by_timeout[query->timeout.tv_sec %
- ARES_TIMEOUT_TABLE_SIZE]));
-
- /* Keep track of queries bucketed by server, so we can process server
- * errors quickly.
- */
- ares__remove_from_list(&(query->queries_to_server));
- ares__insert_in_list(&(query->queries_to_server),
- &(server->queries_to_server));
-}
-
-/*
- * setsocknonblock sets the given socket to either blocking or non-blocking
- * mode based on the 'nonblock' boolean argument. This function is highly
- * portable.
- */
-static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
- int nonblock /* TRUE or FALSE */)
-{
-#if defined(USE_BLOCKING_SOCKETS)
-
- return 0; /* returns success */
-
-#elif defined(HAVE_FCNTL_O_NONBLOCK)
-
- /* most recent unix versions */
- int flags;
- flags = fcntl(sockfd, F_GETFL, 0);
- if (FALSE != nonblock)
- return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
- else
- return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); /* LCOV_EXCL_LINE */
-
-#elif defined(HAVE_IOCTL_FIONBIO)
-
- /* older unix versions */
- int flags = nonblock ? 1 : 0;
- return ioctl(sockfd, FIONBIO, &flags);
-
-#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
-
-#ifdef WATT32
- char flags = nonblock ? 1 : 0;
-#else
- /* Windows */
- unsigned long flags = nonblock ? 1UL : 0UL;
-#endif
- return ioctlsocket(sockfd, FIONBIO, &flags);
-
-#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
-
- /* Amiga */
- long flags = nonblock ? 1L : 0L;
- return IoctlSocket(sockfd, FIONBIO, flags);
-
-#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
-
- /* BeOS */
- long b = nonblock ? 1L : 0L;
- return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
-
-#else
-# error "no non-blocking method was found/used/set"
-#endif
-}
-
-static int configure_socket(ares_socket_t s, int family, ares_channel channel)
-{
- union {
- struct sockaddr sa;
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
- } local;
-
- /* do not set options for user-managed sockets */
- if (channel->sock_funcs)
- return 0;
-
- (void)setsocknonblock(s, TRUE);
-
-#if defined(FD_CLOEXEC) && !defined(MSDOS)
- /* Configure the socket fd as close-on-exec. */
- if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1)
- return -1; /* LCOV_EXCL_LINE */
-#endif
-
- /* Set the socket's send and receive buffer sizes. */
- if ((channel->socket_send_buffer_size > 0) &&
- setsockopt(s, SOL_SOCKET, SO_SNDBUF,
- (void *)&channel->socket_send_buffer_size,
- sizeof(channel->socket_send_buffer_size)) == -1)
- return -1;
-
- if ((channel->socket_receive_buffer_size > 0) &&
- setsockopt(s, SOL_SOCKET, SO_RCVBUF,
- (void *)&channel->socket_receive_buffer_size,
- sizeof(channel->socket_receive_buffer_size)) == -1)
- return -1;
-
-#ifdef SO_BINDTODEVICE
- if (channel->local_dev_name[0]) {
- if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE,
- channel->local_dev_name, sizeof(channel->local_dev_name))) {
- /* Only root can do this, and usually not fatal if it doesn't work, so */
- /* just continue on. */
- }
- }
-#endif
-
- if (family == AF_INET) {
- if (channel->local_ip4) {
- memset(&local.sa4, 0, sizeof(local.sa4));
- local.sa4.sin_family = AF_INET;
- local.sa4.sin_addr.s_addr = htonl(channel->local_ip4);
- if (bind(s, &local.sa, sizeof(local.sa4)) < 0)
- return -1;
- }
- }
- else if (family == AF_INET6) {
- if (memcmp(channel->local_ip6, &ares_in6addr_any,
- sizeof(channel->local_ip6)) != 0) {
- memset(&local.sa6, 0, sizeof(local.sa6));
- local.sa6.sin6_family = AF_INET6;
- memcpy(&local.sa6.sin6_addr, channel->local_ip6,
- sizeof(channel->local_ip6));
- if (bind(s, &local.sa, sizeof(local.sa6)) < 0)
- return -1;
- }
- }
-
- return 0;
-}
-
-static ares_socket_t open_socket(ares_channel channel, int af, int type, int protocol)
-{
- if (channel->sock_funcs != 0)
- return channel->sock_funcs->asocket(af,
- type,
- protocol,
- channel->sock_func_cb_data);
-
- return socket(af, type, protocol);
-}
-
-static int connect_socket(ares_channel channel, ares_socket_t sockfd,
- const struct sockaddr * addr,
- ares_socklen_t addrlen)
-{
- if (channel->sock_funcs != 0)
- return channel->sock_funcs->aconnect(sockfd,
- addr,
- addrlen,
- channel->sock_func_cb_data);
-
- return connect(sockfd, addr, addrlen);
-}
-
-static int open_tcp_socket(ares_channel channel, struct server_state *server)
-{
- ares_socket_t s;
- int opt;
- ares_socklen_t salen;
- union {
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
- } saddr;
- struct sockaddr *sa;
-
- switch (server->addr.family)
- {
- case AF_INET:
- sa = (void *)&saddr.sa4;
- salen = sizeof(saddr.sa4);
- memset(sa, 0, salen);
- saddr.sa4.sin_family = AF_INET;
- if (server->addr.tcp_port) {
- saddr.sa4.sin_port = aresx_sitous(server->addr.tcp_port);
- } else {
- saddr.sa4.sin_port = aresx_sitous(channel->tcp_port);
- }
- memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4,
- sizeof(server->addr.addrV4));
- break;
- case AF_INET6:
- sa = (void *)&saddr.sa6;
- salen = sizeof(saddr.sa6);
- memset(sa, 0, salen);
- saddr.sa6.sin6_family = AF_INET6;
- if (server->addr.tcp_port) {
- saddr.sa6.sin6_port = aresx_sitous(server->addr.tcp_port);
- } else {
- saddr.sa6.sin6_port = aresx_sitous(channel->tcp_port);
- }
- memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6,
- sizeof(server->addr.addrV6));
- break;
- default:
- return -1; /* LCOV_EXCL_LINE */
- }
-
- /* Acquire a socket. */
- s = open_socket(channel, server->addr.family, SOCK_STREAM, 0);
- if (s == ARES_SOCKET_BAD)
- return -1;
-
- /* Configure it. */
- if (configure_socket(s, server->addr.family, channel) < 0)
- {
- ares__socket_close(channel, s);
- return -1;
- }
-
-#ifdef TCP_NODELAY
- /*
- * Disable the Nagle algorithm (only relevant for TCP sockets, and thus not
- * in configure_socket). In general, in DNS lookups we're pretty much
- * interested in firing off a single request and then waiting for a reply,
- * so batching isn't very interesting.
- */
- opt = 1;
- if (channel->sock_funcs == 0
- &&
- setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
- (void *)&opt, sizeof(opt)) == -1)
- {
- ares__socket_close(channel, s);
- return -1;
- }
-#endif
-
- if (channel->sock_config_cb)
- {
- int err = channel->sock_config_cb(s, SOCK_STREAM,
- channel->sock_config_cb_data);
- if (err < 0)
- {
- ares__socket_close(channel, s);
- return err;
- }
- }
-
- /* Connect to the server. */
- if (connect_socket(channel, s, sa, salen) == -1)
- {
- int err = SOCKERRNO;
-
- if (err != EINPROGRESS && err != EWOULDBLOCK)
- {
- ares__socket_close(channel, s);
- return -1;
- }
- }
-
- if (channel->sock_create_cb)
- {
- int err = channel->sock_create_cb(s, SOCK_STREAM,
- channel->sock_create_cb_data);
- if (err < 0)
- {
- ares__socket_close(channel, s);
- return err;
- }
- }
-
- SOCK_STATE_CALLBACK(channel, s, 1, 0);
- server->tcp_buffer_pos = 0;
- server->tcp_socket = s;
- server->tcp_connection_generation = ++channel->tcp_connection_generation;
- return 0;
-}
-
-static int open_udp_socket(ares_channel channel, struct server_state *server)
-{
- ares_socket_t s;
- ares_socklen_t salen;
- union {
- struct sockaddr_in sa4;
- struct sockaddr_in6 sa6;
- } saddr;
- struct sockaddr *sa;
-
- switch (server->addr.family)
- {
- case AF_INET:
- sa = (void *)&saddr.sa4;
- salen = sizeof(saddr.sa4);
- memset(sa, 0, salen);
- saddr.sa4.sin_family = AF_INET;
- if (server->addr.udp_port) {
- saddr.sa4.sin_port = aresx_sitous(server->addr.udp_port);
- } else {
- saddr.sa4.sin_port = aresx_sitous(channel->udp_port);
- }
- memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4,
- sizeof(server->addr.addrV4));
- break;
- case AF_INET6:
- sa = (void *)&saddr.sa6;
- salen = sizeof(saddr.sa6);
- memset(sa, 0, salen);
- saddr.sa6.sin6_family = AF_INET6;
- if (server->addr.udp_port) {
- saddr.sa6.sin6_port = aresx_sitous(server->addr.udp_port);
- } else {
- saddr.sa6.sin6_port = aresx_sitous(channel->udp_port);
- }
- memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6,
- sizeof(server->addr.addrV6));
- break;
- default:
- return -1; /* LCOV_EXCL_LINE */
- }
-
- /* Acquire a socket. */
- s = open_socket(channel, server->addr.family, SOCK_DGRAM, 0);
- if (s == ARES_SOCKET_BAD)
- return -1;
-
- /* Set the socket non-blocking. */
- if (configure_socket(s, server->addr.family, channel) < 0)
- {
- ares__socket_close(channel, s);
- return -1;
- }
-
- if (channel->sock_config_cb)
- {
- int err = channel->sock_config_cb(s, SOCK_DGRAM,
- channel->sock_config_cb_data);
- if (err < 0)
- {
- ares__socket_close(channel, s);
- return err;
- }
- }
-
- /* Connect to the server. */
- if (connect_socket(channel, s, sa, salen) == -1)
- {
- int err = SOCKERRNO;
-
- if (err != EINPROGRESS && err != EWOULDBLOCK)
- {
- ares__socket_close(channel, s);
- return -1;
- }
- }
-
- if (channel->sock_create_cb)
- {
- int err = channel->sock_create_cb(s, SOCK_DGRAM,
- channel->sock_create_cb_data);
- if (err < 0)
- {
- ares__socket_close(channel, s);
- return err;
- }
- }
-
- SOCK_STATE_CALLBACK(channel, s, 1, 0);
-
- server->udp_socket = s;
- return 0;
-}
-
-static int same_questions(const unsigned char *qbuf, int qlen,
- const unsigned char *abuf, int alen)
-{
- struct {
- const unsigned char *p;
- int qdcount;
- char *name;
- long namelen;
- int type;
- int dnsclass;
- } q, a;
- int i, j;
-
- if (qlen < HFIXEDSZ || alen < HFIXEDSZ)
- return 0;
-
- /* Extract qdcount from the request and reply buffers and compare them. */
- q.qdcount = DNS_HEADER_QDCOUNT(qbuf);
- a.qdcount = DNS_HEADER_QDCOUNT(abuf);
- if (q.qdcount != a.qdcount)
- return 0;
-
- /* For each question in qbuf, find it in abuf. */
- q.p = qbuf + HFIXEDSZ;
- for (i = 0; i < q.qdcount; i++)
- {
- /* Decode the question in the query. */
- if (ares_expand_name(q.p, qbuf, qlen, &q.name, &q.namelen)
- != ARES_SUCCESS)
- return 0;
- q.p += q.namelen;
- if (q.p + QFIXEDSZ > qbuf + qlen)
- {
- ares_free(q.name);
- return 0;
- }
- q.type = DNS_QUESTION_TYPE(q.p);
- q.dnsclass = DNS_QUESTION_CLASS(q.p);
- q.p += QFIXEDSZ;
-
- /* Search for this question in the answer. */
- a.p = abuf + HFIXEDSZ;
- for (j = 0; j < a.qdcount; j++)
- {
- /* Decode the question in the answer. */
- if (ares_expand_name(a.p, abuf, alen, &a.name, &a.namelen)
- != ARES_SUCCESS)
- {
- ares_free(q.name);
- return 0;
- }
- a.p += a.namelen;
- if (a.p + QFIXEDSZ > abuf + alen)
- {
- ares_free(q.name);
- ares_free(a.name);
- return 0;
- }
- a.type = DNS_QUESTION_TYPE(a.p);
- a.dnsclass = DNS_QUESTION_CLASS(a.p);
- a.p += QFIXEDSZ;
-
- /* Compare the decoded questions. */
- if (strcasecmp(q.name, a.name) == 0 && q.type == a.type
- && q.dnsclass == a.dnsclass)
- {
- ares_free(a.name);
- break;
- }
- ares_free(a.name);
- }
-
- ares_free(q.name);
- if (j == a.qdcount)
- return 0;
- }
- return 1;
-}
-
-static int same_address(struct sockaddr *sa, struct ares_addr *aa)
-{
- void *addr1;
- void *addr2;
-
- if (sa->sa_family == aa->family)
- {
- switch (aa->family)
- {
- case AF_INET:
- addr1 = &aa->addrV4;
- addr2 = &((struct sockaddr_in *)sa)->sin_addr;
- if (memcmp(addr1, addr2, sizeof(aa->addrV4)) == 0)
- return 1; /* match */
- break;
- case AF_INET6:
- addr1 = &aa->addrV6;
- addr2 = &((struct sockaddr_in6 *)sa)->sin6_addr;
- if (memcmp(addr1, addr2, sizeof(aa->addrV6)) == 0)
- return 1; /* match */
- break;
- default:
- break; /* LCOV_EXCL_LINE */
- }
- }
- return 0; /* different */
-}
-
-static void end_query (ares_channel channel, struct query *query, int status,
- unsigned char *abuf, int alen)
-{
- int i;
-
- /* First we check to see if this query ended while one of our send
- * queues still has pointers to it.
- */
- for (i = 0; i < channel->nservers; i++)
- {
- struct server_state *server = &channel->servers[i];
- struct send_request *sendreq;
- for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
- if (sendreq->owner_query == query)
- {
- sendreq->owner_query = NULL;
- assert(sendreq->data_storage == NULL);
- if (status == ARES_SUCCESS)
- {
- /* We got a reply for this query, but this queued sendreq
- * points into this soon-to-be-gone query's tcpbuf. Probably
- * this means we timed out and queued the query for
- * retransmission, then received a response before actually
- * retransmitting. This is perfectly fine, so we want to keep
- * the connection running smoothly if we can. But in the worst
- * case we may have sent only some prefix of the query, with
- * some suffix of the query left to send. Also, the buffer may
- * be queued on multiple queues. To prevent dangling pointers
- * to the query's tcpbuf and handle these cases, we just give
- * such sendreqs their own copy of the query packet.
- */
- sendreq->data_storage = ares_malloc(sendreq->len);
- if (sendreq->data_storage != NULL)
- {
- memcpy(sendreq->data_storage, sendreq->data, sendreq->len);
- sendreq->data = sendreq->data_storage;
- }
- }
- if ((status != ARES_SUCCESS) || (sendreq->data_storage == NULL))
- {
- /* We encountered an error (probably a timeout, suggesting the
- * DNS server we're talking to is probably unreachable,
- * wedged, or severely overloaded) or we couldn't copy the
- * request, so mark the connection as broken. When we get to
- * process_broken_connections() we'll close the connection and
- * try to re-send requests to another server.
- */
- server->is_broken = 1;
- /* Just to be paranoid, zero out this sendreq... */
- sendreq->data = NULL;
- sendreq->len = 0;
- }
- }
- }
-
- /* Invoke the callback */
- query->callback(query->arg, status, query->timeouts, abuf, alen);
- ares__free_query(query);
-
- /* Simple cleanup policy: if no queries are remaining, close all network
- * sockets unless STAYOPEN is set.
- */
- if (!(channel->flags & ARES_FLAG_STAYOPEN) &&
- ares__is_list_empty(&(channel->all_queries)))
- {
- for (i = 0; i < channel->nservers; i++)
- ares__close_sockets(channel, &channel->servers[i]);
- }
-}
-
-void ares__free_query(struct query *query)
-{
- /* Remove the query from all the lists in which it is linked */
- ares__remove_from_list(&(query->queries_by_qid));
- ares__remove_from_list(&(query->queries_by_timeout));
- ares__remove_from_list(&(query->queries_to_server));
- ares__remove_from_list(&(query->all_queries));
- /* Zero out some important stuff, to help catch bugs */
- query->callback = NULL;
- query->arg = NULL;
- /* Deallocate the memory associated with the query */
- ares_free(query->tcpbuf);
- ares_free(query->server_info);
- ares_free(query);
-}
-
-void ares__socket_close(ares_channel channel, ares_socket_t s)
-{
- if (channel->sock_funcs)
- channel->sock_funcs->aclose(s, channel->sock_func_cb_data);
- else
- sclose(s);
-}
diff --git a/grpc/third_party/cares/cares/ares_query.c b/grpc/third_party/cares/cares/ares_query.c
deleted file mode 100644
index b38b8a6c..00000000
--- a/grpc/third_party/cares/cares/ares_query.c
+++ /dev/null
@@ -1,186 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_private.h"
-
-struct qquery {
- ares_callback callback;
- void *arg;
-};
-
-static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
-
-static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
-{
- unsigned char x;
- unsigned char y;
- unsigned char* state;
- unsigned char xorIndex;
- short counter;
-
- x = key->x;
- y = key->y;
-
- state = &key->state[0];
- for(counter = 0; counter < buffer_len; counter ++)
- {
- x = (unsigned char)((x + 1) % 256);
- y = (unsigned char)((state[x] + y) % 256);
- ARES_SWAP_BYTE(&state[x], &state[y]);
-
- xorIndex = (unsigned char)((state[x] + state[y]) % 256);
-
- buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]);
- }
- key->x = x;
- key->y = y;
-}
-
-static struct query* find_query_by_id(ares_channel channel, unsigned short id)
-{
- unsigned short qid;
- struct list_node* list_head;
- struct list_node* list_node;
- DNS_HEADER_SET_QID(((unsigned char*)&qid), id);
-
- /* Find the query corresponding to this packet. */
- list_head = &(channel->queries_by_qid[qid % ARES_QID_TABLE_SIZE]);
- for (list_node = list_head->next; list_node != list_head;
- list_node = list_node->next)
- {
- struct query *q = list_node->data;
- if (q->qid == qid)
- return q;
- }
- return NULL;
-}
-
-
-/* a unique query id is generated using an rc4 key. Since the id may already
- be used by a running query (as infrequent as it may be), a lookup is
- performed per id generation. In practice this search should happen only
- once per newly generated id
-*/
-static unsigned short generate_unique_id(ares_channel channel)
-{
- unsigned short id;
-
- do {
- id = ares__generate_new_id(&channel->id_key);
- } while (find_query_by_id(channel, id));
-
- return (unsigned short)id;
-}
-
-unsigned short ares__generate_new_id(rc4_key* key)
-{
- unsigned short r=0;
- rc4(key, (unsigned char *)&r, sizeof(r));
- return r;
-}
-
-void ares_query(ares_channel channel, const char *name, int dnsclass,
- int type, ares_callback callback, void *arg)
-{
- struct qquery *qquery;
- unsigned char *qbuf;
- int qlen, rd, status;
-
- /* Compose the query. */
- rd = !(channel->flags & ARES_FLAG_NORECURSE);
- status = ares_create_query(name, dnsclass, type, channel->next_id, rd, &qbuf,
- &qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0);
- if (status != ARES_SUCCESS)
- {
- if (qbuf != NULL) ares_free(qbuf);
- callback(arg, status, 0, NULL, 0);
- return;
- }
-
- channel->next_id = generate_unique_id(channel);
-
- /* Allocate and fill in the query structure. */
- qquery = ares_malloc(sizeof(struct qquery));
- if (!qquery)
- {
- ares_free_string(qbuf);
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
- qquery->callback = callback;
- qquery->arg = arg;
-
- /* Send it off. qcallback will be called when we get an answer. */
- ares_send(channel, qbuf, qlen, qcallback, qquery);
- ares_free_string(qbuf);
-}
-
-static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
-{
- struct qquery *qquery = (struct qquery *) arg;
- unsigned int ancount;
- int rcode;
-
- if (status != ARES_SUCCESS)
- qquery->callback(qquery->arg, status, timeouts, abuf, alen);
- else
- {
- /* Pull the response code and answer count from the packet. */
- rcode = DNS_HEADER_RCODE(abuf);
- ancount = DNS_HEADER_ANCOUNT(abuf);
-
- /* Convert errors. */
- switch (rcode)
- {
- case NOERROR:
- status = (ancount > 0) ? ARES_SUCCESS : ARES_ENODATA;
- break;
- case FORMERR:
- status = ARES_EFORMERR;
- break;
- case SERVFAIL:
- status = ARES_ESERVFAIL;
- break;
- case NXDOMAIN:
- status = ARES_ENOTFOUND;
- break;
- case NOTIMP:
- status = ARES_ENOTIMP;
- break;
- case REFUSED:
- status = ARES_EREFUSED;
- break;
- }
- qquery->callback(qquery->arg, status, timeouts, abuf, alen);
- }
- ares_free(qquery);
-}
diff --git a/grpc/third_party/cares/cares/ares_search.c b/grpc/third_party/cares/cares/ares_search.c
deleted file mode 100644
index 001c3482..00000000
--- a/grpc/third_party/cares/cares/ares_search.c
+++ /dev/null
@@ -1,323 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#include "ares.h"
-#include "ares_private.h"
-
-struct search_query {
- /* Arguments passed to ares_search */
- ares_channel channel;
- char *name; /* copied into an allocated buffer */
- int dnsclass;
- int type;
- ares_callback callback;
- void *arg;
-
- int status_as_is; /* error status from trying as-is */
- int next_domain; /* next search domain to try */
- int trying_as_is; /* current query is for name as-is */
- int timeouts; /* number of timeouts we saw for this request */
- int ever_got_nodata; /* did we ever get ARES_ENODATA along the way? */
-};
-
-static void search_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen);
-static void end_squery(struct search_query *squery, int status,
- unsigned char *abuf, int alen);
-static int cat_domain(const char *name, const char *domain, char **s);
-STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s);
-
-void ares_search(ares_channel channel, const char *name, int dnsclass,
- int type, ares_callback callback, void *arg)
-{
- struct search_query *squery;
- char *s;
- const char *p;
- int status, ndots;
-
- /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
- if (ares__is_onion_domain(name))
- {
- callback(arg, ARES_ENOTFOUND, 0, NULL, 0);
- return;
- }
-
- /* If name only yields one domain to search, then we don't have
- * to keep extra state, so just do an ares_query().
- */
- status = single_domain(channel, name, &s);
- if (status != ARES_SUCCESS)
- {
- callback(arg, status, 0, NULL, 0);
- return;
- }
- if (s)
- {
- ares_query(channel, s, dnsclass, type, callback, arg);
- ares_free(s);
- return;
- }
-
- /* Allocate a search_query structure to hold the state necessary for
- * doing multiple lookups.
- */
- squery = ares_malloc(sizeof(struct search_query));
- if (!squery)
- {
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
- squery->channel = channel;
- squery->name = ares_strdup(name);
- if (!squery->name)
- {
- ares_free(squery);
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
- squery->dnsclass = dnsclass;
- squery->type = type;
- squery->status_as_is = -1;
- squery->callback = callback;
- squery->arg = arg;
- squery->timeouts = 0;
- squery->ever_got_nodata = 0;
-
- /* Count the number of dots in name. */
- ndots = 0;
- for (p = name; *p; p++)
- {
- if (*p == '.')
- ndots++;
- }
-
- /* If ndots is at least the channel ndots threshold (usually 1),
- * then we try the name as-is first. Otherwise, we try the name
- * as-is last.
- */
- if (ndots >= channel->ndots)
- {
- /* Try the name as-is first. */
- squery->next_domain = 0;
- squery->trying_as_is = 1;
- ares_query(channel, name, dnsclass, type, search_callback, squery);
- }
- else
- {
- /* Try the name as-is last; start with the first search domain. */
- squery->next_domain = 1;
- squery->trying_as_is = 0;
- status = cat_domain(name, channel->domains[0], &s);
- if (status == ARES_SUCCESS)
- {
- ares_query(channel, s, dnsclass, type, search_callback, squery);
- ares_free(s);
- }
- else
- {
- /* failed, free the malloc()ed memory */
- ares_free(squery->name);
- ares_free(squery);
- callback(arg, status, 0, NULL, 0);
- }
- }
-}
-
-static void search_callback(void *arg, int status, int timeouts,
- unsigned char *abuf, int alen)
-{
- struct search_query *squery = (struct search_query *) arg;
- ares_channel channel = squery->channel;
- char *s;
-
- squery->timeouts += timeouts;
-
- /* Stop searching unless we got a non-fatal error. */
- if (status != ARES_ENODATA && status != ARES_ESERVFAIL
- && status != ARES_ENOTFOUND)
- end_squery(squery, status, abuf, alen);
- else
- {
- /* Save the status if we were trying as-is. */
- if (squery->trying_as_is)
- squery->status_as_is = status;
-
- /*
- * If we ever get ARES_ENODATA along the way, record that; if the search
- * should run to the very end and we got at least one ARES_ENODATA,
- * then callers like ares_gethostbyname() may want to try a T_A search
- * even if the last domain we queried for T_AAAA resource records
- * returned ARES_ENOTFOUND.
- */
- if (status == ARES_ENODATA)
- squery->ever_got_nodata = 1;
-
- if (squery->next_domain < channel->ndomains)
- {
- /* Try the next domain. */
- status = cat_domain(squery->name,
- channel->domains[squery->next_domain], &s);
- if (status != ARES_SUCCESS)
- end_squery(squery, status, NULL, 0);
- else
- {
- squery->trying_as_is = 0;
- squery->next_domain++;
- ares_query(channel, s, squery->dnsclass, squery->type,
- search_callback, squery);
- ares_free(s);
- }
- }
- else if (squery->status_as_is == -1)
- {
- /* Try the name as-is at the end. */
- squery->trying_as_is = 1;
- ares_query(channel, squery->name, squery->dnsclass, squery->type,
- search_callback, squery);
- }
- else {
- if (squery->status_as_is == ARES_ENOTFOUND && squery->ever_got_nodata) {
- end_squery(squery, ARES_ENODATA, NULL, 0);
- }
- else
- end_squery(squery, squery->status_as_is, NULL, 0);
- }
- }
-}
-
-static void end_squery(struct search_query *squery, int status,
- unsigned char *abuf, int alen)
-{
- squery->callback(squery->arg, status, squery->timeouts, abuf, alen);
- ares_free(squery->name);
- ares_free(squery);
-}
-
-/* Concatenate two domains. */
-static int cat_domain(const char *name, const char *domain, char **s)
-{
- size_t nlen = strlen(name);
- size_t dlen = strlen(domain);
-
- *s = ares_malloc(nlen + 1 + dlen + 1);
- if (!*s)
- return ARES_ENOMEM;
- memcpy(*s, name, nlen);
- (*s)[nlen] = '.';
- memcpy(*s + nlen + 1, domain, dlen);
- (*s)[nlen + 1 + dlen] = 0;
- return ARES_SUCCESS;
-}
-
-/* Determine if this name only yields one query. If it does, set *s to
- * the string we should query, in an allocated buffer. If not, set *s
- * to NULL.
- */
-STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s)
-{
- size_t len = strlen(name);
- const char *hostaliases;
- FILE *fp;
- char *line = NULL;
- int status;
- size_t linesize;
- const char *p, *q;
- int error;
-
- /* If the name contains a trailing dot, then the single query is the name
- * sans the trailing dot.
- */
- if ((len > 0) && (name[len - 1] == '.'))
- {
- *s = ares_strdup(name);
- return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
- }
-
- if (!(channel->flags & ARES_FLAG_NOALIASES) && !strchr(name, '.'))
- {
- /* The name might be a host alias. */
- hostaliases = getenv("HOSTALIASES");
- if (hostaliases)
- {
- fp = fopen(hostaliases, "r");
- if (fp)
- {
- while ((status = ares__read_line(fp, &line, &linesize))
- == ARES_SUCCESS)
- {
- if (strncasecmp(line, name, len) != 0 ||
- !ISSPACE(line[len]))
- continue;
- p = line + len;
- while (ISSPACE(*p))
- p++;
- if (*p)
- {
- q = p + 1;
- while (*q && !ISSPACE(*q))
- q++;
- *s = ares_malloc(q - p + 1);
- if (*s)
- {
- memcpy(*s, p, q - p);
- (*s)[q - p] = 0;
- }
- ares_free(line);
- fclose(fp);
- return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
- }
- }
- ares_free(line);
- fclose(fp);
- if (status != ARES_SUCCESS && status != ARES_EOF)
- return status;
- }
- else
- {
- error = ERRNO;
- switch(error)
- {
- case ENOENT:
- case ESRCH:
- break;
- default:
- DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
- error, strerror(error)));
- DEBUGF(fprintf(stderr, "Error opening file: %s\n",
- hostaliases));
- *s = NULL;
- return ARES_EFILE;
- }
- }
- }
- }
-
- if (channel->flags & ARES_FLAG_NOSEARCH || channel->ndomains == 0)
- {
- /* No domain search to do; just try the name as-is. */
- *s = ares_strdup(name);
- return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
- }
-
- *s = NULL;
- return ARES_SUCCESS;
-}
diff --git a/grpc/third_party/cares/cares/ares_send.c b/grpc/third_party/cares/cares/ares_send.c
deleted file mode 100644
index f4f1f951..00000000
--- a/grpc/third_party/cares/cares/ares_send.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_dns.h"
-#include "ares_private.h"
-
-void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
- ares_callback callback, void *arg)
-{
- struct query *query;
- int i, packetsz;
- struct timeval now;
-
- /* Verify that the query is at least long enough to hold the header. */
- if (qlen < HFIXEDSZ || qlen >= (1 << 16))
- {
- callback(arg, ARES_EBADQUERY, 0, NULL, 0);
- return;
- }
-
- /* Allocate space for query and allocated fields. */
- query = ares_malloc(sizeof(struct query));
- if (!query)
- {
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
- query->tcpbuf = ares_malloc(qlen + 2);
- if (!query->tcpbuf)
- {
- ares_free(query);
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
- if (channel->nservers < 1)
- {
- ares_free(query);
- callback(arg, ARES_ESERVFAIL, 0, NULL, 0);
- return;
- }
- query->server_info = ares_malloc(channel->nservers *
- sizeof(query->server_info[0]));
- if (!query->server_info)
- {
- ares_free(query->tcpbuf);
- ares_free(query);
- callback(arg, ARES_ENOMEM, 0, NULL, 0);
- return;
- }
-
- /* Compute the query ID. Start with no timeout. */
- query->qid = DNS_HEADER_QID(qbuf);
- query->timeout.tv_sec = 0;
- query->timeout.tv_usec = 0;
-
- /* Form the TCP query buffer by prepending qlen (as two
- * network-order bytes) to qbuf.
- */
- query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
- query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
- memcpy(query->tcpbuf + 2, qbuf, qlen);
- query->tcplen = qlen + 2;
-
- /* Fill in query arguments. */
- query->qbuf = query->tcpbuf + 2;
- query->qlen = qlen;
- query->callback = callback;
- query->arg = arg;
-
- /* Initialize query status. */
- query->try_count = 0;
-
- /* Choose the server to send the query to. If rotation is enabled, keep track
- * of the next server we want to use. */
- query->server = channel->last_server;
- if (channel->rotate == 1)
- channel->last_server = (channel->last_server + 1) % channel->nservers;
-
- for (i = 0; i < channel->nservers; i++)
- {
- query->server_info[i].skip_server = 0;
- query->server_info[i].tcp_connection_generation = 0;
- }
-
- packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
- query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
-
- query->error_status = ARES_ECONNREFUSED;
- query->timeouts = 0;
-
- /* Initialize our list nodes. */
- ares__init_list_node(&(query->queries_by_qid), query);
- ares__init_list_node(&(query->queries_by_timeout), query);
- ares__init_list_node(&(query->queries_to_server), query);
- ares__init_list_node(&(query->all_queries), query);
-
- /* Chain the query into the list of all queries. */
- ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
- /* Keep track of queries bucketed by qid, so we can process DNS
- * responses quickly.
- */
- ares__insert_in_list(
- &(query->queries_by_qid),
- &(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
-
- /* Perform the first query action. */
- now = ares__tvnow();
- ares__send_query(channel, query, &now);
-}
diff --git a/grpc/third_party/cares/cares/ares_set_local_ip4.3 b/grpc/third_party/cares/cares/ares_set_local_ip4.3
deleted file mode 100644
index 82f5fae5..00000000
--- a/grpc/third_party/cares/cares/ares_set_local_ip4.3
+++ /dev/null
@@ -1,34 +0,0 @@
-.\"
-.\" Copyright 2010 by Ben Greear <greearb@candelatech.com>
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_SET_LOCAL_IP4 3 "30 June 2010"
-.SH NAME
-ares_set_local_ip4 \- Set local IPv4 address outgoing requests.
-.SH SYNOPSIS
-.nf
-.B #include <ares.h>
-.PP
-.B void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP)
-.fi
-.SH DESCRIPTION
-The \fBares_set_local_ip4\fP function sets the IP address for outbound
-requests. This allows users to specify outbound interfaces when used
-on multi-homed systems.
-.SH SEE ALSO
-.BR ares_set_local_ip6 (3)
-.SH NOTES
-This function was added in c-ares 1.7.4
-.SH AUTHOR
-Ben Greear
diff --git a/grpc/third_party/cares/cares/ares_set_local_ip6.3 b/grpc/third_party/cares/cares/ares_set_local_ip6.3
deleted file mode 100644
index cafa963f..00000000
--- a/grpc/third_party/cares/cares/ares_set_local_ip6.3
+++ /dev/null
@@ -1,34 +0,0 @@
-.\"
-.\" Copyright 2010 by Ben Greear <greearb@candelatech.com>
-.\"
-.\" Permission to use, copy, modify, and distribute this
-.\" software and its documentation for any purpose and without
-.\" fee is hereby granted, provided that the above copyright
-.\" notice appear in all copies and that both that copyright
-.\" notice and this permission notice appear in supporting
-.\" documentation, and that the name of M.I.T. not be used in
-.\" advertising or publicity pertaining to distribution of the
-.\" software without specific, written prior permission.
-.\" M.I.T. makes no representations about the suitability of
-.\" this software for any purpose. It is provided "as is"
-.\" without express or implied warranty.
-.\"
-.TH ARES_SET_LOCAL_IP6 3 "30 June 2010"
-.SH NAME
-ares_set_local_ip6 \- Set local IPv6 address outgoing requests.
-.SH SYNOPSIS
-.nf
-.B #include <ares.h>
-.PP
-.B void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP)
-.fi
-.SH DESCRIPTION
-The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound
-IPv6 requests. This allows users to specify outbound interfaces when used
-on multi-homed systems. The local_ip6 argument must be 16 bytes in length.
-.SH SEE ALSO
-.BR ares_set_local_ip4 (3)
-.SH NOTES
-This function was added in c-ares 1.7.4
-.SH AUTHOR
-Ben Greear
diff --git a/grpc/third_party/cares/cares/ares_setup.h b/grpc/third_party/cares/cares/ares_setup.h
deleted file mode 100644
index 4df79611..00000000
--- a/grpc/third_party/cares/cares/ares_setup.h
+++ /dev/null
@@ -1,217 +0,0 @@
-#ifndef HEADER_CARES_SETUP_H
-#define HEADER_CARES_SETUP_H
-
-
-/* Copyright (C) 2004 - 2012 by Daniel Stenberg et al
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-/*
- * Define WIN32 when build target is Win32 API
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-#define WIN32
-#endif
-
-/*
- * Include configuration script results or hand-crafted
- * configuration file for platforms which lack config tool.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "ares_config.h"
-#else
-
-#ifdef WIN32
-#include "config-win32.h"
-#endif
-
-#endif /* HAVE_CONFIG_H */
-
-/* ================================================================ */
-/* Definition of preprocessor macros/symbols which modify compiler */
-/* behaviour or generated code characteristics must be done here, */
-/* as appropriate, before any system header file is included. It is */
-/* also possible to have them defined in the config file included */
-/* before this point. As a result of all this we frown inclusion of */
-/* system header files in our config files, avoid this at any cost. */
-/* ================================================================ */
-
-/*
- * AIX 4.3 and newer needs _THREAD_SAFE defined to build
- * proper reentrant code. Others may also need it.
- */
-
-#ifdef NEED_THREAD_SAFE
-# ifndef _THREAD_SAFE
-# define _THREAD_SAFE
-# endif
-#endif
-
-/*
- * Tru64 needs _REENTRANT set for a few function prototypes and
- * things to appear in the system header files. Unixware needs it
- * to build proper reentrant code. Others may also need it.
- */
-
-#ifdef NEED_REENTRANT
-# ifndef _REENTRANT
-# define _REENTRANT
-# endif
-#endif
-
-/* ================================================================ */
-/* If you need to include a system header file for your platform, */
-/* please, do it beyond the point further indicated in this file. */
-/* ================================================================ */
-
-/*
- * c-ares external interface definitions are also used internally,
- * and might also include required system header files to define them.
- */
-
-#include <ares_build.h>
-
-/*
- * Compile time sanity checks must also be done when building the library.
- */
-
-#include <ares_rules.h>
-
-/* ================================================================= */
-/* No system header file shall be included in this file before this */
-/* point. The only allowed ones are those included from ares_build.h */
-/* ================================================================= */
-
-/*
- * Include header files for windows builds before redefining anything.
- * Use this preproessor block only to include or exclude windows.h,
- * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
- * to any other further and independent block. Under Cygwin things work
- * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
- * never be included when __CYGWIN__ is defined. configure script takes
- * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
- * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
- */
-
-#ifdef HAVE_WINDOWS_H
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
-# ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-# ifdef HAVE_WS2TCPIP_H
-# include <ws2tcpip.h>
-# endif
-# else
-# ifdef HAVE_WINSOCK_H
-# include <winsock.h>
-# endif
-# endif
-#endif
-
-/*
- * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
- * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
- * undefine USE_WINSOCK.
- */
-
-#undef USE_WINSOCK
-
-#ifdef HAVE_WINSOCK2_H
-# define USE_WINSOCK 2
-#else
-# ifdef HAVE_WINSOCK_H
-# define USE_WINSOCK 1
-# endif
-#endif
-
-/*
- * Work-arounds for systems without configure support
- */
-
-#ifndef HAVE_CONFIG_H
-
-#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
-#define HAVE_SYS_TIME_H
-#endif
-
-#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
-#define HAVE_UNISTD_H 1
-#endif
-
-#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
-#define HAVE_SYS_UIO_H
-#endif
-
-#endif /* HAVE_CONFIG_H */
-
-/*
- * Arg 2 type for gethostname in case it hasn't been defined in config file.
- */
-
-#ifndef GETHOSTNAME_TYPE_ARG2
-# ifdef USE_WINSOCK
-# define GETHOSTNAME_TYPE_ARG2 int
-# else
-# define GETHOSTNAME_TYPE_ARG2 size_t
-# endif
-#endif
-
-#ifdef __POCC__
-# include <sys/types.h>
-# include <unistd.h>
-# define ESRCH 3
-#endif
-
-/*
- * Android does have the arpa/nameser.h header which is detected by configure
- * but it appears to be empty with recent NDK r7b / r7c, so we undefine here.
- */
-#if (defined(ANDROID) || defined(__ANDROID__)) && defined(HAVE_ARPA_NAMESER_H)
-# undef HAVE_ARPA_NAMESER_H
-#endif
-
-/*
- * Recent autoconf versions define these symbols in ares_config.h. We don't
- * want them (since they collide with the libcurl ones when we build
- * --enable-debug) so we undef them again here.
- */
-
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef VERSION
-#undef PACKAGE
-
-/* IPv6 compatibility */
-#if !defined(HAVE_AF_INET6)
-#if defined(HAVE_PF_INET6)
-#define AF_INET6 PF_INET6
-#else
-#define AF_INET6 AF_MAX+1
-#endif
-#endif
-
-/*
- * Include macros and defines that should only be processed once.
- */
-
-#ifndef __SETUP_ONCE_H
-#include "setup_once.h"
-#endif
-
-#endif /* HEADER_CARES_SETUP_H */
diff --git a/grpc/third_party/cares/cares/ares_strsplit.c b/grpc/third_party/cares/cares/ares_strsplit.c
deleted file mode 100644
index b57a30f2..00000000
--- a/grpc/third_party/cares/cares/ares_strsplit.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Copyright (C) 2018 by John Schember <john@nachtimwald.com>
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include "ares_setup.h"
-#include "ares_strsplit.h"
-#include "ares.h"
-#include "ares_private.h"
-
-static int list_contains(char * const *list, size_t num_elem, const char *str, int insensitive)
-{
- size_t len;
- size_t i;
-
- len = strlen(str);
- for (i=0; i<num_elem; i++)
- {
- if (insensitive)
- {
-#ifdef WIN32
- if (strnicmp(list[i], str, len) == 0)
-#else
- if (strncasecmp(list[i], str, len) == 0)
-#endif
- return 1;
- }
- else
- {
- if (strncmp(list[i], str, len) == 0)
- return 1;
- }
- }
-
- return 0;
-}
-
-static int is_delim(char c, const char *delims, size_t num_delims)
-{
- size_t i;
-
- for (i=0; i<num_delims; i++)
- {
- if (c == delims[i])
- return 1;
- }
- return 0;
-}
-
-
-void ares_strsplit_free(char **elms, size_t num_elm)
-{
- size_t i;
-
- if (elms == NULL)
- return;
-
- for (i=0; i<num_elm; i++)
- ares_free(elms[i]);
- ares_free(elms);
-}
-
-
-char **ares_strsplit(const char *in, const char *delms, int make_set, size_t *num_elm)
-{
- char *parsestr;
- char **temp;
- char **out;
- size_t cnt;
- size_t nelms;
- size_t in_len;
- size_t num_delims;
- size_t i;
-
- if (in == NULL || delms == NULL || num_elm == NULL)
- return NULL;
-
- *num_elm = 0;
-
- in_len = strlen(in);
- num_delims = strlen(delms);
-
- /* Figure out how many elements. */
- nelms = 1;
- for (i=0; i<in_len; i++)
- {
- if (is_delim(in[i], delms, num_delims))
- {
- nelms++;
- }
- }
-
- /* Copy of input so we can cut it up. */
- parsestr = ares_strdup(in);
- if (parsestr == NULL)
- return NULL;
-
- /* Temporary array to store locations of start of each element
- * within parsestr. */
- temp = ares_malloc(nelms * sizeof(*temp));
- if (temp == NULL)
- {
- ares_free(parsestr);
- return NULL;
- }
- temp[0] = parsestr;
- cnt = 1;
- for (i=0; i<in_len && cnt<nelms; i++)
- {
- if (!is_delim(parsestr[i], delms, num_delims))
- continue;
-
- /* Replace sep with NULL. */
- parsestr[i] = '\0';
- /* Add the pointer to the array of elements */
- temp[cnt] = parsestr+i+1;
- cnt++;
- }
-
- /* Copy each element to our output array. */
- out = ares_malloc(nelms * sizeof(*out));
- if (out == NULL)
- {
- ares_free(parsestr);
- ares_free(temp);
- return NULL;
- }
-
- nelms = 0;
- for (i=0; i<cnt; i++)
- {
- if (temp[i][0] == '\0')
- continue;
-
- if (make_set && list_contains(out, nelms, temp[i], 1))
- continue;
-
- out[nelms] = ares_strdup(temp[i]);
- if (out[nelms] == NULL)
- {
- ares_strsplit_free(out, nelms);
- ares_free(parsestr);
- ares_free(temp);
- return NULL;
- }
- nelms++;
- }
-
-
- /* If there are no elements don't return an empty allocated
- * array. */
- if (nelms == 0)
- {
- ares_strsplit_free(out, nelms);
- out = NULL;
- }
-
- /* Get the true number of elements (recalculated because of make_set) */
- *num_elm = nelms;
-
- ares_free(parsestr);
- ares_free(temp);
- return out;
-}
diff --git a/grpc/third_party/cares/cares/ares_version.h b/grpc/third_party/cares/cares/ares_version.h
deleted file mode 100644
index 61b2b98a..00000000
--- a/grpc/third_party/cares/cares/ares_version.h
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#ifndef ARES__VERSION_H
-#define ARES__VERSION_H
-
-/* This is the global package copyright */
-#define ARES_COPYRIGHT "2004 - 2017 Daniel Stenberg, <daniel@haxx.se>."
-
-#define ARES_VERSION_MAJOR 1
-#define ARES_VERSION_MINOR 14
-#define ARES_VERSION_PATCH 0
-#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
- (ARES_VERSION_MINOR<<8)|\
- (ARES_VERSION_PATCH))
-#define ARES_VERSION_STR "1.14.0"
-
-#if (ARES_VERSION >= 0x010700)
-# define CARES_HAVE_ARES_LIBRARY_INIT 1
-# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
-#else
-# undef CARES_HAVE_ARES_LIBRARY_INIT
-# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
-#endif
-
-#endif
diff --git a/grpc/third_party/cares/cares/buildconf b/grpc/third_party/cares/cares/buildconf
index a779d86d..4e4c17e9 100755
--- a/grpc/third_party/cares/cares/buildconf
+++ b/grpc/third_party/cares/cares/buildconf
@@ -1,297 +1,4 @@
#!/bin/sh
-#--------------------------------------------------------------------------
-# die prints argument string to stdout and exits this shell script.
-#
-die(){
- echo "buildconf: $@"
- exit 1
-}
-
-#--------------------------------------------------------------------------
-# findtool works as 'which' but we use a different name to make it more
-# obvious we aren't using 'which'! ;-)
-#
-findtool(){
- file="$1"
-
- if { echo "$file" | grep "/" >/dev/null 2>&1; } then
- # when file is given with a path check it first
- if test -f "$file"; then
- echo "$file"
- return
- fi
- fi
-
- old_IFS=$IFS; IFS=':'
- for path in $PATH
- do
- IFS=$old_IFS
- # echo "checks for $file in $path" >&2
- if test -f "$path/$file"; then
- echo "$path/$file"
- return
- fi
- done
- IFS=$old_IFS
-}
-
-#--------------------------------------------------------------------------
-# removethis() removes all files and subdirectories with the given name,
-# inside and below the current subdirectory at invocation time.
-#
-removethis(){
- if test "$#" = "1"; then
- find . -depth -name $1 -print > buildconf.tmp.$$
- while read fdname
- do
- if test -f "$fdname"; then
- rm -f "$fdname"
- elif test -d "$fdname"; then
- rm -f -r "$fdname"
- fi
- done < buildconf.tmp.$$
- rm -f buildconf.tmp.$$
- fi
-}
-
-#--------------------------------------------------------------------------
-# Ensure that buildconf runs from the subdirectory where configure.ac lives
-#
-if test ! -f configure.ac ||
- test ! -f ares_init.c ||
- test ! -f m4/cares-functions.m4; then
- echo "Can not run buildconf from outside of c-ares source subdirectory!"
- echo "Change to the subdirectory where buildconf is found, and try again."
- exit 1
-fi
-
-#--------------------------------------------------------------------------
-# GNU libtool preliminary check
-#
-want_lt_major=1
-want_lt_minor=4
-want_lt_patch=2
-want_lt_version=1.4.2
-
-# This approach that tries 'glibtoolize first is intended for systems that
-# have GNU libtool named as 'glibtoolize' and libtoolize not being GNU's.
-
-libtoolize=`findtool glibtoolize 2>/dev/null`
-if test ! -x "$libtoolize"; then
- libtoolize=`findtool ${LIBTOOLIZE:-libtoolize}`
-fi
-if test -z "$libtoolize"; then
- echo "buildconf: libtoolize not found."
- echo " You need GNU libtoolize $want_lt_version or newer installed."
- exit 1
-fi
-
-lt_pver=`$libtoolize --version 2>/dev/null|head -n 1`
-lt_qver=`echo $lt_pver|sed -e "s/([^)]*)//g" -e "s/^[^0-9]*//g"`
-lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"`
-if test -z "$lt_version"; then
- echo "buildconf: libtoolize not found."
- echo " You need GNU libtoolize $want_lt_version or newer installed."
- exit 1
-fi
-old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS
-lt_major=$1
-lt_minor=$2
-lt_patch=$3
-
-if test -z "$lt_major"; then
- lt_status="bad"
-elif test "$lt_major" -gt "$want_lt_major"; then
- lt_status="good"
-elif test "$lt_major" -lt "$want_lt_major"; then
- lt_status="bad"
-elif test -z "$lt_minor"; then
- lt_status="bad"
-elif test "$lt_minor" -gt "$want_lt_minor"; then
- lt_status="good"
-elif test "$lt_minor" -lt "$want_lt_minor"; then
- lt_status="bad"
-elif test -z "$lt_patch"; then
- lt_status="bad"
-elif test "$lt_patch" -gt "$want_lt_patch"; then
- lt_status="good"
-elif test "$lt_patch" -lt "$want_lt_patch"; then
- lt_status="bad"
-else
- lt_status="good"
-fi
-if test "$lt_status" != "good"; then
- echo "buildconf: libtoolize version $lt_version found."
- echo " You need GNU libtoolize $want_lt_version or newer installed."
- exit 1
-fi
-
-#--------------------------------------------------------------------------
-# perl check
-#
-PERL=`findtool ${PERL:-perl}`
-if test -z "$PERL"; then
- echo "buildconf: perl not found"
- exit 1
-fi
-
-#--------------------------------------------------------------------------
-# Remove files generated on previous buildconf/configure run.
-#
-for fname in .deps \
- .libs \
- *.la \
- *.lo \
- *.a \
- *.o \
- Makefile \
- Makefile.in \
- aclocal.m4 \
- aclocal.m4.bak \
- ares_build.h \
- ares_config.h \
- ares_config.h.in \
- autom4te.cache \
- compile \
- config.guess \
- config.log \
- config.lt \
- config.status \
- config.sub \
- configure \
- depcomp \
- libcares.pc \
- libtool \
- libtool.m4 \
- libtool.m4.tmp \
- ltmain.sh \
- ltoptions.m4 \
- ltsugar.m4 \
- ltversion.m4 \
- lt~obsolete.m4 \
- missing \
- stamp-h1 \
- stamp-h2 ; do
- removethis "$fname"
-done
-
-#--------------------------------------------------------------------------
-# run the correct scripts now
-#
-
-echo "buildconf: running libtoolize"
-${libtoolize} --copy --automake --force || die "libtoolize command failed"
-
-# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
-# subdirectory and this local copy is patched to fix some warnings that
-# are triggered when running aclocal and using autoconf 2.62 or later.
-
-if test "$lt_major" = "1" && test "$lt_minor" = "5"; then
- if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then
- echo "buildconf: copying libtool.m4 to local m4 subdir"
- ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir`
- if test -f $ac_dir/libtool.m4; then
- cp -f $ac_dir/libtool.m4 m4/libtool.m4
- else
- echo "buildconf: $ac_dir/libtool.m4 not found"
- fi
- if test -f m4/libtool.m4; then
- echo "buildconf: renaming some variables in local m4/libtool.m4"
- $PERL -i.tmp -pe \
- 's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \
- s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \
- m4/libtool.m4
- rm -f m4/libtool.m4.tmp
- fi
- fi
-fi
-
-if test -f m4/libtool.m4; then
- echo "buildconf: converting all mv to mv -f in local m4/libtool.m4"
- $PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4
- rm -f m4/libtool.m4.tmp
-fi
-
-echo "buildconf: running aclocal"
-${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "aclocal command failed"
-
-echo "buildconf: converting all mv to mv -f in local aclocal.m4"
-$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
-
-echo "buildconf: running autoheader"
-${AUTOHEADER:-autoheader} || die "autoheader command failed"
-
-echo "buildconf: running autoconf"
-${AUTOCONF:-autoconf} || die "autoconf command failed"
-
-echo "buildconf: running automake"
-${AUTOMAKE:-automake} --add-missing --copy || die "automake command failed"
-
-#--------------------------------------------------------------------------
-# GNU libtool complementary check
-#
-# Depending on the libtool and automake versions being used, config.guess
-# might not be installed in the subdirectory until automake has finished.
-# So we can not attempt to use it until this very last buildconf stage.
-#
-if test ! -f ./config.guess; then
- echo "buildconf: config.guess not found"
-else
- buildhost=`./config.guess 2>/dev/null|head -n 1`
- case $buildhost in
- *-*-darwin*)
- need_lt_major=1
- need_lt_minor=5
- need_lt_patch=26
- need_lt_check="yes"
- ;;
- *-*-hpux*)
- need_lt_major=1
- need_lt_minor=5
- need_lt_patch=24
- need_lt_check="yes"
- ;;
- esac
- if test ! -z "$need_lt_check"; then
- if test -z "$lt_major"; then
- lt_status="bad"
- elif test "$lt_major" -gt "$need_lt_major"; then
- lt_status="good"
- elif test "$lt_major" -lt "$need_lt_major"; then
- lt_status="bad"
- elif test -z "$lt_minor"; then
- lt_status="bad"
- elif test "$lt_minor" -gt "$need_lt_minor"; then
- lt_status="good"
- elif test "$lt_minor" -lt "$need_lt_minor"; then
- lt_status="bad"
- elif test -z "$lt_patch"; then
- lt_status="bad"
- elif test "$lt_patch" -gt "$need_lt_patch"; then
- lt_status="good"
- elif test "$lt_patch" -lt "$need_lt_patch"; then
- lt_status="bad"
- else
- lt_status="good"
- fi
- if test "$lt_status" != "good"; then
- need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch"
- echo "buildconf: libtool version $lt_version found."
- echo " $buildhost requires GNU libtool $need_lt_version or newer installed."
- rm -f configure
- exit 1
- fi
- fi
-fi
-
-#--------------------------------------------------------------------------
-# Finished successfully.
-#
-echo "buildconf: OK"
-
-if test -f "test/buildconf"; then
- cd test && ./buildconf
-fi
-
-exit 0
+echo "*** Do not use buildconf. Instead, just use: autoreconf -fi" >&2
+exec ${AUTORECONF:-autoreconf} -fi "${@}"
diff --git a/grpc/third_party/cares/cares/buildconf.bat b/grpc/third_party/cares/cares/buildconf.bat
index 7097b726..dcee4523 100644
--- a/grpc/third_party/cares/cares/buildconf.bat
+++ b/grpc/third_party/cares/cares/buildconf.bat
@@ -12,8 +12,8 @@ ECHO ERROR: This file shall only be used with a c-ares git checkout.
goto end_all
:start_doing
-if not exist ares_build.h.dist goto end_ares_build_h
-copy /Y ares_build.h.dist ares_build.h
+if not exist include\ares_build.h.dist goto end_ares_build_h
+copy /Y include\ares_build.h.dist include\ares_build.h
:end_ares_build_h
:end_all
diff --git a/grpc/third_party/cares/cares/c-ares-config.cmake.in b/grpc/third_party/cares/cares/c-ares-config.cmake.in
index a069648b..464837b3 100644
--- a/grpc/third_party/cares/cares/c-ares-config.cmake.in
+++ b/grpc/third_party/cares/cares/c-ares-config.cmake.in
@@ -2,6 +2,7 @@
set_and_check(c-ares_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
+include("${CMAKE_CURRENT_LIST_DIR}/c-ares-config-version.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/c-ares-targets.cmake")
set(c-ares_LIBRARY c-ares::cares)
diff --git a/grpc/third_party/cares/cares/cares.rc b/grpc/third_party/cares/cares/cares.rc
deleted file mode 100644
index 76ec06c1..00000000
--- a/grpc/third_party/cares/cares/cares.rc
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/* Copyright (C) 2009-2016 by Daniel Stenberg
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- */
-
-#include <winver.h>
-#include "ares_version.h"
-
-LANGUAGE 0x09,0x01
-
-#define RC_VERSION ARES_VERSION_MAJOR, ARES_VERSION_MINOR, ARES_VERSION_PATCH, 0
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION RC_VERSION
- PRODUCTVERSION RC_VERSION
- FILEFLAGSMASK 0x3fL
-#if defined(DEBUGBUILD) || defined(_DEBUG)
- FILEFLAGS 1
-#else
- FILEFLAGS 0
-#endif
- FILEOS VOS__WINDOWS32
- FILETYPE VFT_DLL
- FILESUBTYPE 0x0L
-
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "The c-ares library, https://c-ares.haxx.se/\0"
-#if defined(DEBUGBUILD) || defined(_DEBUG)
- VALUE "FileDescription", "c-ares Debug Shared Library\0"
- VALUE "FileVersion", ARES_VERSION_STR "\0"
- VALUE "InternalName", "c-ares\0"
- VALUE "OriginalFilename", "caresd.dll\0"
-#else
- VALUE "FileDescription", "c-ares Shared Library\0"
- VALUE "FileVersion", ARES_VERSION_STR "\0"
- VALUE "InternalName", "c-ares\0"
- VALUE "OriginalFilename", "cares.dll\0"
-#endif
- VALUE "ProductName", "The c-ares library\0"
- VALUE "ProductVersion", ARES_VERSION_STR "\0"
- VALUE "LegalCopyright", "© " ARES_COPYRIGHT "\0"
- VALUE "License", "https://c-ares.haxx.se/license.html\0"
- END
- END
-
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
diff --git a/grpc/third_party/cares/cares/config-dos.h b/grpc/third_party/cares/cares/config-dos.h
deleted file mode 100644
index 114db511..00000000
--- a/grpc/third_party/cares/cares/config-dos.h
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef HEADER_CONFIG_DOS_H
-#define HEADER_CONFIG_DOS_H
-
-
-/* ================================================================ */
-/* ares/config-dos.h - Hand crafted config file for DOS */
-/* ================================================================ */
-
-#define PACKAGE "c-ares"
-
-#define HAVE_ERRNO_H 1
-#define HAVE_GETENV 1
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_IOCTLSOCKET 1
-#define HAVE_IOCTLSOCKET_FIONBIO 1
-#define HAVE_LIMITS_H 1
-#define HAVE_NET_IF_H 1
-#define HAVE_RECV 1
-#define HAVE_RECVFROM 1
-#define HAVE_SEND 1
-#define HAVE_STRDUP 1
-#define HAVE_STRICMP 1
-#define HAVE_STRUCT_IN6_ADDR 1
-#define HAVE_STRUCT_TIMEVAL 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_SOCKET_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_TIME_H 1
-#define HAVE_UNISTD_H 1
-
-#define NEED_MALLOC_H 1
-
-#define RETSIGTYPE void
-#define TIME_WITH_SYS_TIME 1
-
-/* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */
-
-#define SEND_TYPE_ARG1 int
-#define SEND_QUAL_ARG2 const
-#define SEND_TYPE_ARG2 void *
-#define SEND_TYPE_ARG3 int
-#define SEND_TYPE_ARG4 int
-#define SEND_TYPE_RETV int
-
-#define RECV_TYPE_ARG1 int
-#define RECV_TYPE_ARG2 void *
-#define RECV_TYPE_ARG3 int
-#define RECV_TYPE_ARG4 int
-#define RECV_TYPE_RETV int
-
-#define RECVFROM_TYPE_ARG1 int
-#define RECVFROM_TYPE_ARG2 void
-#define RECVFROM_TYPE_ARG3 int
-#define RECVFROM_TYPE_ARG4 int
-#define RECVFROM_TYPE_ARG5 struct sockaddr
-#define RECVFROM_TYPE_ARG6 int
-#define RECVFROM_TYPE_RETV int
-#define RECVFROM_TYPE_ARG2_IS_VOID 1
-
-#define BSD
-
-/* Target HAVE_x section */
-
-#if defined(DJGPP)
- #define HAVE_STRCASECMP 1
- #define HAVE_STRNCASECMP 1
- #define HAVE_SYS_TIME_H 1
- #define HAVE_VARIADIC_MACROS_GCC 1
-
- /* Because djgpp <= 2.03 doesn't have snprintf() etc. */
- #if (DJGPP_MINOR < 4)
- #define _MPRINTF_REPLACE
- #endif
-
-#elif defined(__WATCOMC__)
- #define HAVE_STRCASECMP 1
-
-#elif defined(__HIGHC__)
- #define HAVE_SYS_TIME_H 1
- #define strerror(e) strerror_s_((e))
-#endif
-
-#ifdef WATT32
- #define HAVE_AF_INET6 1
- #define HAVE_ARPA_INET_H 1
- #define HAVE_ARPA_NAMESER_H 1
- #define HAVE_CLOSE_S 1
- #define HAVE_GETHOSTNAME 1
- #define HAVE_NETDB_H 1
- #define HAVE_NETINET_IN_H 1
- #define HAVE_NETINET_TCP_H 1
- #define HAVE_PF_INET6 1
- #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
- #define HAVE_STRUCT_ADDRINFO 1
- #define HAVE_STRUCT_IN6_ADDR 1
- #define HAVE_STRUCT_SOCKADDR_IN6 1
- #define HAVE_SYS_SOCKET_H 1
- #define HAVE_SYS_UIO_H 1
- #define NS_INADDRSZ 4
- #define HAVE_STRUCT_SOCKADDR_IN6 1
-#endif
-
-#undef word
-#undef byte
-
-#endif /* HEADER_CONFIG_DOS_H */
-
diff --git a/grpc/third_party/cares/cares/configure.ac b/grpc/third_party/cares/cares/configure.ac
index 6334458b..c21b8ff3 100644
--- a/grpc/third_party/cares/cares/configure.ac
+++ b/grpc/third_party/cares/cares/configure.ac
@@ -1,14 +1,44 @@
AC_PREREQ(2.57)
-AC_INIT([c-ares], [1.15.0],
+AC_INIT([c-ares], [1.17.2],
[c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares])
+CARES_VERSION_INFO="6:3:4"
+dnl This flag accepts an argument of the form current[:revision[:age]]. So,
+dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
+dnl 1.
+dnl
+dnl If either revision or age are omitted, they default to 0. Also note that age
+dnl must be less than or equal to the current interface number.
+dnl
+dnl Here are a set of rules to help you update your library version information:
+dnl
+dnl 1.Start with version information of 0:0:0 for each libtool library.
+dnl
+dnl 2.Update the version information only immediately before a public release of
+dnl your software. More frequent updates are unnecessary, and only guarantee
+dnl that the current interface number gets larger faster.
+dnl
+dnl 3.If the library source code has changed at all since the last update, then
+dnl increment revision (c:r+1:a)
+dnl
+dnl 4.If any interfaces have been added, removed, or changed since the last
+dnl update, increment current, and set revision to 0. (c+1:r=0:a)
+dnl
+dnl 5.If any interfaces have been added since the last public release, then
+dnl increment age. (c:r:a+1)
+dnl
+dnl 6.If any interfaces have been removed since the last public release, then
+dnl set age to 0. (c:r:a=0)
+dnl
+AC_SUBST([CARES_VERSION_INFO])
+
XC_OVR_ZZ50
XC_OVR_ZZ60
CARES_OVERRIDE_AUTOCONF
-AC_CONFIG_SRCDIR([ares_ipv6.h])
-AC_CONFIG_HEADERS([ares_config.h ares_build.h])
+AC_CONFIG_SRCDIR([src/lib/ares_ipv6.h])
+AC_CONFIG_HEADERS([src/lib/ares_config.h include/ares_build.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -17,7 +47,6 @@ CARES_CHECK_OPTION_DEBUG
CARES_CHECK_OPTION_OPTIMIZE
CARES_CHECK_OPTION_WARNINGS
CARES_CHECK_OPTION_WERROR
-CARES_CHECK_OPTION_CURLDEBUG
CARES_CHECK_OPTION_SYMBOL_HIDING
CARES_CHECK_OPTION_EXPOSE_STATICS
@@ -70,10 +99,6 @@ AC_SUBST([AR])
AX_CODE_COVERAGE
-dnl Remove non-configure distributed ares_build.h
-if test -f ${srcdir}/ares_build.h; then
- rm -f ${srcdir}/ares_build.h
-fi
dnl
dnl Detect the canonical host and target build environment
@@ -106,6 +131,7 @@ esac
XC_LIBTOOL
+
#
# Automake conditionals based on libtool related checks
#
@@ -175,16 +201,13 @@ CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CARES_CHECK_COMPILER_PROTOTYPE_MISMATCH
CARES_CHECK_COMPILER_SYMBOL_HIDING
-CARES_CHECK_CURLDEBUG
-AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
-
dnl **********************************************************************
dnl Compilation based checks should not be done before this point.
dnl **********************************************************************
dnl **********************************************************************
-dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
-dnl and ws2tcpip.h take precedence over any other further checks which
+dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
+dnl and ws2tcpip.h take precedence over any other further checks which
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
dnl this specific header files. And do them before its results are used.
dnl **********************************************************************
@@ -354,27 +377,21 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
fi
-dnl resolv lib for iPhone
+dnl resolv lib for Apple (MacOS and iOS)
AS_IF([test "x$host_vendor" = "xapple"], [
- AC_MSG_CHECKING([for iPhone target])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#include "TargetConditionals.h"
- ]], [[
-#if TARGET_OS_IPHONE == 0
-#error Not an iPhone target
-#endif
-return 0;
- ]])
- ],[
- AC_MSG_RESULT([yes])
- AC_SEARCH_LIBS([res_servicename], [resolv], [
- AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares])
- ], [
- AC_MSG_ERROR([Unable to find libresolv which is required for iPhone targets])
- ])
- ],[
- AC_MSG_RESULT([no])
+ AC_SEARCH_LIBS([res_servicename], [resolv], [
+ AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares])
+ ], [
+ AC_MSG_ERROR([Unable to find libresolv which is required for iPhone targets])
+ ])
+])
+
+dnl resolv lib for z/OS
+AS_IF([test "x$host_vendor" = "xibm" -a "x$host_os" = "xopenedition" ], [
+ AC_SEARCH_LIBS([res_init], [resolv], [
+ AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares])
+ ], [
+ AC_MSG_ERROR([Unable to find libresolv which is required for z/OS])
])
])
@@ -539,7 +556,7 @@ CURL_CHECK_STRUCT_TIMEVAL
AC_CHECK_TYPE(long long,
[AC_DEFINE(HAVE_LONGLONG, 1,
[Define to 1 if the compiler supports the 'long long' data type.])]
- longlong="yes"
+ longlong="yes"
)
if test "xyes" = "x$longlong"; then
@@ -643,7 +660,7 @@ CARES_CHECK_CONSTANT(
#include <sys/socket.h>
#endif
#endif
- ], [PF_INET6],
+ ], [PF_INET6],
AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.])
)
@@ -667,7 +684,7 @@ CARES_CHECK_CONSTANT(
#include <sys/socket.h>
#endif
#endif
- ], [AF_INET6],
+ ], [AF_INET6],
AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.])
)
@@ -695,7 +712,7 @@ CARES_CHECK_STRUCT(
#include <netinet/in.h>
#endif
#endif
- ], [in6_addr],
+ ], [in6_addr],
AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.])
)
@@ -722,7 +739,7 @@ CARES_CHECK_STRUCT(
#include <netinet/in.h>
#endif
#endif
- ], [sockaddr_in6],
+ ], [sockaddr_in6],
AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1,
[Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
)
@@ -833,22 +850,22 @@ dnl Check for user-specified random device
AC_ARG_WITH(random,
AC_HELP_STRING([--with-random=FILE],
[read randomness from FILE (default=/dev/urandom)]),
- [ RANDOM_FILE="$withval" ],
+ [ CARES_RANDOM_FILE="$withval" ],
[
dnl Check for random device. If we're cross compiling, we can't
dnl check, and it's better to assume it doesn't exist than it is
dnl to fail on AC_CHECK_FILE or later.
if test "$cross_compiling" = "no"; then
- AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
+ AC_CHECK_FILE("/dev/urandom", [ CARES_RANDOM_FILE="/dev/urandom"] )
else
AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
fi
-
+
]
)
-if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
- AC_SUBST(RANDOM_FILE)
- AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
+if test -n "$CARES_RANDOM_FILE" && test X"$CARES_RANDOM_FILE" != Xno ; then
+ AC_SUBST(CARES_RANDOM_FILE)
+ AC_DEFINE_UNQUOTED(CARES_RANDOM_FILE, "$CARES_RANDOM_FILE",
[a suitable file/device to read random data from])
fi
@@ -900,10 +917,22 @@ if test "x$build_tests" = "xyes" ; then
fi
AC_MSG_RESULT([$build_tests])
+
+BUILD_SUBDIRS="include src docs"
if test "x$build_tests" = "xyes" ; then
AC_CONFIG_SUBDIRS([test])
+ BUILD_SUBDIRS="${BUILD_SUBDIRS} test"
fi
-AC_CONFIG_FILES([Makefile libcares.pc])
+AC_SUBST(BUILD_SUBDIRS)
+
+AC_CONFIG_FILES([Makefile \
+ include/Makefile \
+ src/Makefile \
+ src/lib/Makefile \
+ src/tools/Makefile \
+ docs/Makefile \
+ libcares.pc ])
+
AC_OUTPUT
XC_AMEND_DISTCLEAN(['.'])
diff --git a/grpc/third_party/cares/cares/docs/CMakeLists.txt b/grpc/third_party/cares/cares/docs/CMakeLists.txt
new file mode 100644
index 00000000..5b91d313
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Headers and Man Pages installation target
+IF (CARES_INSTALL)
+ # ManPages
+ FILE (GLOB DevelManPages "." "*.3")
+ INSTALL (FILES ${DevelManPages}
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
+ COMPONENT Devel
+ )
+
+ IF (CARES_BUILD_TOOLS)
+ FILE (GLOB ToolManPages "." "*.1")
+ INSTALL (FILES ${ToolManPages}
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+ COMPONENT Tools
+ )
+ ENDIF ()
+ENDIF ()
diff --git a/grpc/third_party/cares/cares/docs/Makefile.am b/grpc/third_party/cares/cares/docs/Makefile.am
new file mode 100644
index 00000000..289445ce
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/Makefile.am
@@ -0,0 +1,11 @@
+#***************************************************************************
+
+###########################################################################
+
+AUTOMAKE_OPTIONS = foreign subdir-objects no-dependencies
+
+include Makefile.inc
+
+man_MANS = $(MANPAGES)
+
+EXTRA_DIST = $(MANPAGES) ahost.1 adig.1 acountry.1 Makefile.inc CMakeLists.txt
diff --git a/grpc/third_party/cares/cares/docs/Makefile.inc b/grpc/third_party/cares/cares/docs/Makefile.inc
new file mode 100644
index 00000000..fbd7492c
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/Makefile.inc
@@ -0,0 +1,58 @@
+MANPAGES = ares_cancel.3 \
+ ares_create_query.3 \
+ ares_destroy.3 \
+ ares_destroy_options.3 \
+ ares_dup.3 \
+ ares_expand_name.3 \
+ ares_expand_string.3 \
+ ares_fds.3 \
+ ares_free_data.3 \
+ ares_free_hostent.3 \
+ ares_free_string.3 \
+ ares_freeaddrinfo.3 \
+ ares_get_servers.3 \
+ ares_get_servers_ports.3 \
+ ares_getaddrinfo.3 \
+ ares_gethostbyaddr.3 \
+ ares_gethostbyname.3 \
+ ares_gethostbyname_file.3 \
+ ares_getnameinfo.3 \
+ ares_getsock.3 \
+ ares_inet_ntop.3 \
+ ares_inet_pton.3 \
+ ares_init.3 \
+ ares_init_options.3 \
+ ares_library_cleanup.3 \
+ ares_library_init.3 \
+ ares_library_init_android.3 \
+ ares_library_initialized.3 \
+ ares_mkquery.3 \
+ ares_parse_a_reply.3 \
+ ares_parse_aaaa_reply.3 \
+ ares_parse_caa_reply.3 \
+ ares_parse_mx_reply.3 \
+ ares_parse_naptr_reply.3 \
+ ares_parse_ns_reply.3 \
+ ares_parse_ptr_reply.3 \
+ ares_parse_soa_reply.3 \
+ ares_parse_srv_reply.3 \
+ ares_parse_txt_reply.3 \
+ ares_process.3 \
+ ares_query.3 \
+ ares_save_options.3 \
+ ares_search.3 \
+ ares_send.3 \
+ ares_set_local_dev.3 \
+ ares_set_local_ip4.3 \
+ ares_set_local_ip6.3 \
+ ares_set_servers.3 \
+ ares_set_servers_csv.3 \
+ ares_set_servers_ports.3 \
+ ares_set_servers_ports_csv.3 \
+ ares_set_socket_callback.3 \
+ ares_set_socket_configure_callback.3 \
+ ares_set_socket_functions.3 \
+ ares_set_sortlist.3 \
+ ares_strerror.3 \
+ ares_timeout.3 \
+ ares_version.3
diff --git a/grpc/third_party/cares/cares/docs/acountry.1 b/grpc/third_party/cares/cares/docs/acountry.1
new file mode 100644
index 00000000..269ae1f9
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/acountry.1
@@ -0,0 +1,54 @@
+.TH ACOUNTRY "1" "April 2011" "c-ares utilities"
+.SH NAME
+acountry \- print the country where an IPv4 address or host is located
+.SH SYNOPSIS
+.B acountry
+[\fIOPTION\fR]... \fIHOST\fR...
+.SH DESCRIPTION
+.PP
+.\" Add any additional description here
+.PP
+Print the country where HOST (an IPv4 address or hostname) is located,
+using the countries.nerd.dk DNS domain to identify the country.
+.PP
+This utility comes with the \fBc\-ares\fR asynchronous resolver library.
+.SH OPTIONS
+.TP
+\fB\-d\fR
+Print some extra debugging output.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help and exit.
+.TP
+\fB\-v\fR
+Be more verbose. Print extra information.
+.SH "REPORTING BUGS"
+Report bugs to the c-ares mailing list:
+.br
+\fBhttps://cool.haxx.se/mailman/listinfo/c-ares\fR
+.SH "SEE ALSO"
+.PP
+adig(1), ahost(1).
+.PP
+The DNSBL countries.nerd.dk
+.br
+\fBhttp://countries.nerd.dk/\fR
+.SH COPYRIGHT
+This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
+carrying the following notice:
+.br
+Copyright 1998 by the Massachusetts Institute of Technology.
+.br
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of M.I.T. not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission. M.I.T. makes no
+representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+.br
+No further copyright claims are being made by the author(s) of this utility.
+.SH AUTHOR
+Gisle Vanem
diff --git a/grpc/third_party/cares/cares/docs/adig.1 b/grpc/third_party/cares/cares/docs/adig.1
new file mode 100644
index 00000000..fa5c766f
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/adig.1
@@ -0,0 +1,85 @@
+.TH ADIG "1" "April 2011" "c-ares utilities"
+.SH NAME
+adig \- print information collected from Domain Name System (DNS) servers
+.SH SYNOPSIS
+.B adig
+[\fIOPTION\fR]... \fINAME\fR...
+.SH DESCRIPTION
+.PP
+.\" Add any additional description here
+.PP
+Send queries to DNS servers about \fINAME\fR and print received
+information, where \fINAME\fR is a valid DNS name (e.g. www.example.com,
+1.2.3.10.in-addr.arpa).
+.PP
+This utility comes with the \fBc\-ares\fR asynchronous resolver library.
+.SH OPTIONS
+.TP
+\fB\-c\fR class
+Set the query class.
+Possible values for class are
+NY, CHAOS, HS, IN (default).
+.TP
+\fB\-d\fR
+Print some extra debugging output.
+.TP
+\fB\-f\fR flag
+Add a flag.
+Possible values for flag are
+igntc, noaliases, norecurse, primary, stayopen, usevc.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help and exit.
+.TP
+\fB\-T\fR port
+Use specified TCP port to connect to DNS server.
+.TP
+\fB\-s\fR server
+Connect to specified DNS server, instead of the system's default one(s).
+.TP
+\fB\-t\fR type
+Query records of specified type.
+Possible values for type are
+A (default), AAAA, AFSDB, ANY, AXFR, CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA,
+MAILB, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL,
+PTR, PX, RP, RT, SIG, SOA, SRV, TXT, WKS, X25,
+.TP
+\fB\-U\fR port
+Use specified UDP port to connect to DNS server.
+.TP
+\fB\-x\fR
+For an IPv4 \fB-t PTR a.b.c.d\fR lookup, query for
+.br
+\fBd.c.b.a.in-addr.arpa.\fR
+This more often gives correct names in the \fBANSWER\fR.
+.br
+For an IPv6 \fB-t PTR addr\fR lookup, query for \fBa.b.c....z.IP6.ARPA.\fR
+.TP
+\fB\-xx\fR
+As for \fB-x\fR and an IPv6 address, compact \fBa.b.c....z.IP6.ARPA.\fR into a RFC-2673 bit-string.
+This compacted \fBbit-string\fR form is not supported by many DNS-servers.
+
+.SH "REPORTING BUGS"
+Report bugs to the c-ares mailing list:
+.br
+\fBhttps://cool.haxx.se/mailman/listinfo/c-ares\fR
+.SH "SEE ALSO"
+.PP
+acountry(1), ahost(1).
+.SH COPYRIGHT
+This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
+carrying the following notice:
+.br
+Copyright 1998 by the Massachusetts Institute of Technology.
+.br
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of M.I.T. not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission. M.I.T. makes no
+representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+.br
+No further copyright claims are being made by the author(s) of this utility.
diff --git a/grpc/third_party/cares/cares/docs/ahost.1 b/grpc/third_party/cares/cares/docs/ahost.1
new file mode 100644
index 00000000..89a39205
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ahost.1
@@ -0,0 +1,59 @@
+.TH AHOST "1" "April 2011" "c-ares utilities"
+.SH NAME
+ahost \- print the A or AAAA record associated with a hostname or IP address
+.SH SYNOPSIS
+.B ahost
+[\fIOPTION\fR]... \fIHOST\fR...
+.SH DESCRIPTION
+.PP
+.\" Add any additional description here
+.PP
+Look up the DNS A or AAAA record associated with HOST (a hostname or an
+IP address).
+.PP
+This utility comes with the \fBc\-ares\fR asynchronous resolver library.
+.SH OPTIONS
+.TP
+\fB\-d\fR
+Print some extra debugging output.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help and exit.
+.TP
+\fB\-t\fR type
+If type is "a", print the A record (default).
+If type is "aaaa", print the AAAA record.
+If type is "u", look for either AAAA or A record (in that order).
+.TP
+\fB\-s\fR \fIdomain\fP
+Specify the \fIdomain\fP to search instead of using the default values from
+.br
+/etc/resolv.conf. This option only has an effect on platforms that use
+.br
+/etc/resolv.conf
+for DNS configuration; it has no effect on other platforms (such as Win32
+or Android).
+.SH "REPORTING BUGS"
+Report bugs to the c-ares mailing list:
+.br
+\fBhttps://cool.haxx.se/mailman/listinfo/c-ares\fR
+.SH "SEE ALSO"
+.PP
+acountry(1), adig(1).
+.SH COPYRIGHT
+This utility is based on code/ideas contained in sofware written by Greg Hudson (ares)
+carrying the following notice:
+.br
+Copyright 1998 by the Massachusetts Institute of Technology.
+.br
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of M.I.T. not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission. M.I.T. makes no
+representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+.br
+No further copyright claims are being made by the author(s) of this utility.
diff --git a/grpc/third_party/cares/cares/ares_cancel.3 b/grpc/third_party/cares/cares/docs/ares_cancel.3
index 1a2d3f58..1a2d3f58 100644
--- a/grpc/third_party/cares/cares/ares_cancel.3
+++ b/grpc/third_party/cares/cares/docs/ares_cancel.3
diff --git a/grpc/third_party/cares/cares/ares_create_query.3 b/grpc/third_party/cares/cares/docs/ares_create_query.3
index 1ab0624e..1ab0624e 100644
--- a/grpc/third_party/cares/cares/ares_create_query.3
+++ b/grpc/third_party/cares/cares/docs/ares_create_query.3
diff --git a/grpc/third_party/cares/cares/ares_destroy.3 b/grpc/third_party/cares/cares/docs/ares_destroy.3
index 9cdee30a..9cdee30a 100644
--- a/grpc/third_party/cares/cares/ares_destroy.3
+++ b/grpc/third_party/cares/cares/docs/ares_destroy.3
diff --git a/grpc/third_party/cares/cares/ares_destroy_options.3 b/grpc/third_party/cares/cares/docs/ares_destroy_options.3
index 31e346b7..31e346b7 100644
--- a/grpc/third_party/cares/cares/ares_destroy_options.3
+++ b/grpc/third_party/cares/cares/docs/ares_destroy_options.3
diff --git a/grpc/third_party/cares/cares/ares_dup.3 b/grpc/third_party/cares/cares/docs/ares_dup.3
index e64c1042..e64c1042 100644
--- a/grpc/third_party/cares/cares/ares_dup.3
+++ b/grpc/third_party/cares/cares/docs/ares_dup.3
diff --git a/grpc/third_party/cares/cares/ares_expand_name.3 b/grpc/third_party/cares/cares/docs/ares_expand_name.3
index fc18df3e..fc18df3e 100644
--- a/grpc/third_party/cares/cares/ares_expand_name.3
+++ b/grpc/third_party/cares/cares/docs/ares_expand_name.3
diff --git a/grpc/third_party/cares/cares/ares_expand_string.3 b/grpc/third_party/cares/cares/docs/ares_expand_string.3
index 33dd7bda..33dd7bda 100644
--- a/grpc/third_party/cares/cares/ares_expand_string.3
+++ b/grpc/third_party/cares/cares/docs/ares_expand_string.3
diff --git a/grpc/third_party/cares/cares/ares_fds.3 b/grpc/third_party/cares/cares/docs/ares_fds.3
index 07063fb0..07063fb0 100644
--- a/grpc/third_party/cares/cares/ares_fds.3
+++ b/grpc/third_party/cares/cares/docs/ares_fds.3
diff --git a/grpc/third_party/cares/cares/ares_free_data.3 b/grpc/third_party/cares/cares/docs/ares_free_data.3
index f8a65b93..f8a65b93 100644
--- a/grpc/third_party/cares/cares/ares_free_data.3
+++ b/grpc/third_party/cares/cares/docs/ares_free_data.3
diff --git a/grpc/third_party/cares/cares/ares_free_hostent.3 b/grpc/third_party/cares/cares/docs/ares_free_hostent.3
index d692801b..d692801b 100644
--- a/grpc/third_party/cares/cares/ares_free_hostent.3
+++ b/grpc/third_party/cares/cares/docs/ares_free_hostent.3
diff --git a/grpc/third_party/cares/cares/ares_free_string.3 b/grpc/third_party/cares/cares/docs/ares_free_string.3
index 61d88aa2..61d88aa2 100644
--- a/grpc/third_party/cares/cares/ares_free_string.3
+++ b/grpc/third_party/cares/cares/docs/ares_free_string.3
diff --git a/grpc/third_party/cares/cares/docs/ares_freeaddrinfo.3 b/grpc/third_party/cares/cares/docs/ares_freeaddrinfo.3
new file mode 100644
index 00000000..8a8ad591
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_freeaddrinfo.3
@@ -0,0 +1,37 @@
+.\"
+.\" Copyright 1998 by the Massachusetts Institute of Technology.
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_FREEADDRINFO 3 "31 October 2018"
+.SH NAME
+ares_freeaddrinfo \- Free addrinfo structure allocated by ares functions
+.SH SYNOPSIS
+.nf
+#include <ares.h>
+
+void ares_freeaddrinfo(struct ares_addrinfo *\fIai\fP)
+.fi
+.SH DESCRIPTION
+The
+.B ares_freeaddrinfo
+function frees a
+.B struct ares_addrinfo
+returned in \fIresult\fP of
+.B ares_addrinfo_callback
+.SH SEE ALSO
+.BR ares_getaddrinfo (3),
+.SH AUTHOR
+Christian Ammer
+.BR
+Andrew Selivanov <andrew.selivanov@gmail.com>
diff --git a/grpc/third_party/cares/cares/ares_get_servers.3 b/grpc/third_party/cares/cares/docs/ares_get_servers.3
index d6064289..d6064289 100644
--- a/grpc/third_party/cares/cares/ares_get_servers.3
+++ b/grpc/third_party/cares/cares/docs/ares_get_servers.3
diff --git a/grpc/third_party/cares/cares/ares_get_servers_ports.3 b/grpc/third_party/cares/cares/docs/ares_get_servers_ports.3
index 1f5d1f70..1f5d1f70 100644
--- a/grpc/third_party/cares/cares/ares_get_servers_ports.3
+++ b/grpc/third_party/cares/cares/docs/ares_get_servers_ports.3
diff --git a/grpc/third_party/cares/cares/docs/ares_getaddrinfo.3 b/grpc/third_party/cares/cares/docs/ares_getaddrinfo.3
new file mode 100644
index 00000000..6cae0ff5
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_getaddrinfo.3
@@ -0,0 +1,195 @@
+.\"
+.\" Copyright 1998 by the Massachusetts Institute of Technology.
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_GETADDRINFO 3 "4 November 2018"
+.SH NAME
+ares_getaddrinfo \- Initiate a host query by name and service
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B typedef void (*ares_addrinfo_callback)(void *\fIarg\fP, int \fIstatus\fP,
+.B int \fItimeouts\fP, struct ares_addrinfo *\fIresult\fP)
+.PP
+.B void ares_getaddrinfo(ares_channel \fIchannel\fP, const char *\fIname\fP,
+.B const char* \fIservice\fP, const struct ares_addrinfo_hints *\fIhints\fP,
+.B ares_addrinfo_callback \fIcallback\fP, void *\fIarg\fP)
+.fi
+.SH DESCRIPTION
+The
+.B ares_getaddrinfo
+function initiates a host query by name on the name service channel
+identified by
+.IR channel .
+The
+.I name
+and
+.I service
+parameters give the hostname and service as NULL-terminated C strings.
+The
+.I hints
+parameter is an
+.BR ares_addrinfo_hints
+structure:
+.PP
+.RS
+.EX
+struct ares_addrinfo_hints {
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+};
+.EE
+.RE
+.TP
+.I ai_family
+Specifies desired address family. AF_UNSPEC means return both AF_INET and AF_INET6.
+.TP
+.I ai_socktype
+Specifies desired socket type, for example SOCK_STREAM or SOCK_DGRAM.
+Setting this to 0 means any type.
+.TP
+.I ai_protocol
+Setting this to 0 means any protocol.
+.TP
+.I ai_flags
+Specifies additional options, see below.
+.PP
+.TP 19
+.B ARES_AI_NUMERICSERV
+If this option is set
+.I service
+field will be treated as a numeric value.
+.TP 19
+.B ARES_AI_CANONNAME
+The ares_addrinfo structure will return a canonical names list.
+.TP 19
+.B ARES_AI_NOSORT
+Result addresses will not be sorted and no connections to resolved addresses will be attempted.
+.TP 19
+.B ARES_AI_ENVHOSTS
+Read hosts file path from the environment variable
+.I CARES_HOSTS .
+.PP
+When the query is complete or has failed, the ares library will invoke \fIcallback\fP.
+Completion or failure of the query may happen immediately, or may happen
+during a later call to \fIares_process(3)\fP, \fIares_destroy(3)\fP or
+\fIares_cancel(3)\fP.
+.PP
+The callback argument
+.I arg
+is copied from the
+.B ares_getaddrinfo
+argument
+.IR arg .
+The callback argument
+.I status
+indicates whether the query succeeded and, if not, how it failed. It
+may have any of the following values:
+.TP 19
+.B ARES_SUCCESS
+The host lookup completed successfully.
+.TP 19
+.B ARES_ENOTIMP
+The ares library does not know how to find addresses of type
+.IR family .
+.TP 19
+.B ARES_ENOTFOUND
+The
+.I name
+was not found.
+.TP 19
+.B ARES_ENOMEM
+Memory was exhausted.
+.TP 19
+.B ARES_ECANCELLED
+The query was cancelled.
+.TP 19
+.B ARES_EDESTRUCTION
+The name service channel
+.I channel
+is being destroyed; the query will not be completed.
+.PP
+On successful completion of the query, the callback argument
+.I result
+points to a
+.B struct ares_addrinfo
+which contains two linked lists, one with resolved addresses and another with canonical names.
+.PP
+.RS
+.EX
+struct ares_addrinfo {
+ struct ares_addrinfo_cname *cnames;
+ struct ares_addrinfo_node *nodes;
+};
+.EE
+.RE
+.PP
+.I ares_addrinfo_node
+structure is similar to RFC3493 addrinfo, but without canonname and with extra ttl field.
+.RS
+.PP
+.EX
+struct ares_addrinfo_node {
+ int ai_ttl;
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ ares_socklen_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ struct ares_addrinfo_node *ai_next;
+};
+.EE
+.RE
+.PP
+.I ares_addrinfo_cname
+structure is a linked list of CNAME records where
+.I ttl
+is a time to live
+.I alias
+is a label of the resource record and
+.I name
+is a value (canonical name) of the resource record.
+See RFC2181 10.1.1. CNAME terminology.
+.RS
+.PP
+.EX
+struct ares_addrinfo_cname {
+ int ttl;
+ char *alias;
+ char *name;
+ struct ares_addrinfo_cname *next;
+};
+.EE
+.RE
+.PP
+The reserved memory has to be deleted by
+.B ares_freeaddrinfo.
+
+The result is sorted according to RFC6724 except:
+ - Rule 3 (Avoid deprecated addresses)
+ - Rule 4 (Prefer home addresses)
+ - Rule 7 (Prefer native transport)
+
+Please note that the function will attempt a connection
+on each of the resolved addresses as per RFC6724.
+.SH SEE ALSO
+.BR ares_freeaddrinfo (3)
+.SH AUTHOR
+Christian Ammer
+.br
+Andrew Selivanov <andrew.selivanov@gmail.com>
diff --git a/grpc/third_party/cares/cares/ares_gethostbyaddr.3 b/grpc/third_party/cares/cares/docs/ares_gethostbyaddr.3
index 77273075..77273075 100644
--- a/grpc/third_party/cares/cares/ares_gethostbyaddr.3
+++ b/grpc/third_party/cares/cares/docs/ares_gethostbyaddr.3
diff --git a/grpc/third_party/cares/cares/ares_gethostbyname.3 b/grpc/third_party/cares/cares/docs/ares_gethostbyname.3
index cfd6a0a1..cfd6a0a1 100644
--- a/grpc/third_party/cares/cares/ares_gethostbyname.3
+++ b/grpc/third_party/cares/cares/docs/ares_gethostbyname.3
diff --git a/grpc/third_party/cares/cares/ares_gethostbyname_file.3 b/grpc/third_party/cares/cares/docs/ares_gethostbyname_file.3
index 8f59b415..8f59b415 100644
--- a/grpc/third_party/cares/cares/ares_gethostbyname_file.3
+++ b/grpc/third_party/cares/cares/docs/ares_gethostbyname_file.3
diff --git a/grpc/third_party/cares/cares/ares_getnameinfo.3 b/grpc/third_party/cares/cares/docs/ares_getnameinfo.3
index 10174321..10174321 100644
--- a/grpc/third_party/cares/cares/ares_getnameinfo.3
+++ b/grpc/third_party/cares/cares/docs/ares_getnameinfo.3
diff --git a/grpc/third_party/cares/cares/ares_getsock.3 b/grpc/third_party/cares/cares/docs/ares_getsock.3
index 13732911..13732911 100644
--- a/grpc/third_party/cares/cares/ares_getsock.3
+++ b/grpc/third_party/cares/cares/docs/ares_getsock.3
diff --git a/grpc/third_party/cares/cares/ares_inet_ntop.3 b/grpc/third_party/cares/cares/docs/ares_inet_ntop.3
index 93ee09cf..93ee09cf 100644
--- a/grpc/third_party/cares/cares/ares_inet_ntop.3
+++ b/grpc/third_party/cares/cares/docs/ares_inet_ntop.3
diff --git a/grpc/third_party/cares/cares/ares_inet_pton.3 b/grpc/third_party/cares/cares/docs/ares_inet_pton.3
index b7d86bb4..b7d86bb4 100644
--- a/grpc/third_party/cares/cares/ares_inet_pton.3
+++ b/grpc/third_party/cares/cares/docs/ares_inet_pton.3
diff --git a/grpc/third_party/cares/cares/ares_init.3 b/grpc/third_party/cares/cares/docs/ares_init.3
index 0baf4b76..0baf4b76 100644
--- a/grpc/third_party/cares/cares/ares_init.3
+++ b/grpc/third_party/cares/cares/docs/ares_init.3
diff --git a/grpc/third_party/cares/cares/docs/ares_init_options.3 b/grpc/third_party/cares/cares/docs/ares_init_options.3
new file mode 100644
index 00000000..b9d52a89
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_init_options.3
@@ -0,0 +1,295 @@
+.\"
+.\" Copyright 1998 by the Massachusetts Institute of Technology.
+.\" Copyright (C) 2004-2010 by Daniel Stenberg
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_INIT 3 "5 March 2010"
+.SH NAME
+ares_init_options \- Initialize a resolver channel
+.SH SYNOPSIS
+.nf
+#include <ares.h>
+
+struct ares_options {
+ int flags;
+ int timeout; /* in seconds or milliseconds, depending on options */
+ int tries;
+ int ndots;
+ unsigned short udp_port;
+ unsigned short tcp_port;
+ int socket_send_buffer_size;
+ int socket_receive_buffer_size;
+ struct in_addr *servers;
+ int nservers;
+ char **domains;
+ int ndomains;
+ char *lookups;
+ ares_sock_state_cb sock_state_cb;
+ void *sock_state_cb_data;
+ struct apattern *sortlist;
+ int nsort;
+ int ednspsz;
+ char *resolvconf_path;
+};
+
+int ares_init_options(ares_channel *\fIchannelptr\fP,
+ struct ares_options *\fIoptions\fP,
+ int \fIoptmask\fP)
+.fi
+.SH DESCRIPTION
+The \fBares_init_options(3)\fP function initializes a communications channel
+for name service lookups. If it returns successfully,
+\fBares_init_options(3)\fP will set the variable pointed to by
+\fIchannelptr\fP to a handle used to identify the name service channel. The
+caller should invoke \fIares_destroy(3)\fP on the handle when the channel is
+no longer needed.
+
+The \fIoptmask\fP parameter generally specifies which fields in the structure pointed to
+by \fIoptions\fP are set, as follows:
+.TP 18
+.B ARES_OPT_FLAGS
+.B int \fIflags\fP;
+.br
+Flags controlling the behavior of the resolver. See below for a
+description of possible flag values.
+.TP 18
+.B ARES_OPT_TIMEOUT
+.B int \fItimeout\fP;
+.br
+The number of seconds each name server is given to respond to a query on the
+first try. (After the first try, the timeout algorithm becomes more
+complicated, but scales linearly with the value of \fItimeout\fP.) The
+default is five seconds. This option is being deprecated by
+\fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2.
+.TP 18
+.B ARES_OPT_TIMEOUTMS
+.B int \fItimeout\fP;
+.br
+The number of milliseconds each name server is given to respond to a query on
+the first try. (After the first try, the timeout algorithm becomes more
+complicated, but scales linearly with the value of \fItimeout\fP.) The
+default is five seconds. Note that this option is specified with the same
+struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits
+that tell c-ares how to interpret the number. This option was added in c-ares
+1.5.2.
+.TP 18
+.B ARES_OPT_TRIES
+.B int \fItries\fP;
+.br
+The number of tries the resolver will try contacting each name server
+before giving up. The default is four tries.
+.TP 18
+.B ARES_OPT_NDOTS
+.B int \fIndots\fP;
+.br
+The number of dots which must be present in a domain name for it to be
+queried for "as is" prior to querying for it with the default domain
+extensions appended. The default value is 1 unless set otherwise by
+resolv.conf or the RES_OPTIONS environment variable.
+.TP 18
+.B ARES_OPT_UDP_PORT
+.B unsigned short \fIudp_port\fP;
+.br
+The port to use for queries over UDP, in network byte order.
+The default value is 53 (in network byte order), the standard name
+service port.
+.TP 18
+.B ARES_OPT_TCP_PORT
+.B unsigned short \fItcp_port\fP;
+.br
+The port to use for queries over TCP, in network byte order.
+The default value is 53 (in network byte order), the standard name
+service port.
+.TP 18
+.B ARES_OPT_SERVERS
+.B struct in_addr *\fIservers\fP;
+.br
+.B int \fInservers\fP;
+.br
+The list of IPv4 servers to contact, instead of the servers specified in
+resolv.conf or the local named. In order to allow specification of either
+IPv4 or IPv6 name servers, the
+.BR ares_set_servers(3)
+function must be used instead.
+.TP 18
+.B ARES_OPT_DOMAINS
+.B char **\fIdomains\fP;
+.br
+.B int \fIndomains\fP;
+.br
+The domains to search, instead of the domains specified in resolv.conf
+or the domain derived from the kernel hostname variable.
+.TP 18
+.B ARES_OPT_LOOKUPS
+.B char *\fIlookups\fP;
+.br
+The lookups to perform for host queries.
+.I lookups
+should be set to a string of the characters "b" or "f", where "b"
+indicates a DNS lookup and "f" indicates a lookup in the hosts file.
+.TP 18
+.B ARES_OPT_SOCK_STATE_CB
+.B void (*\fIsock_state_cb\fP)(void *data, ares_socket_t socket_fd, int readable, int writable);
+.br
+.B void *\fIsock_state_cb_data\fP;
+.br
+A callback function to be invoked when a socket changes state.
+.I socket_fd
+will be passed the socket whose state has changed;
+.I readable
+will be set to true if the socket should listen for read events, and
+.I writable
+will be set to true if the socket should listen for write events.
+The value of
+.I sock_state_cb_data
+will be passed as the
+.I data
+argument.
+.TP 18
+.B ARES_OPT_SORTLIST
+.B struct apattern *\fIsortlist\fP;
+.br
+.B int \fInsort\fP;
+.br
+A list of IP address ranges that specifies the order of preference that
+results from \fIares_gethostbyname\fP should be returned in. Note that
+this can only be used with a sortlist retrieved via
+\fBares_save_options(3)\fP (because
+.B struct apattern
+is opaque); to set a fresh sort list, use \fBares_set_sortlist(3)\fP.
+.TP 18
+.B ARES_OPT_SOCK_SNDBUF
+.B int \fIsocket_send_buffer_size\fP;
+.br
+The send buffer size to set for the socket.
+.TP 18
+.B ARES_OPT_SOCK_RCVBUF
+.B int \fIsocket_receive_buffer_size\fP;
+.br
+The receive buffer size to set for the socket.
+.TP 18
+.B ARES_OPT_EDNSPSZ
+.B int \fIednspsz\fP;
+.br
+The message size to be advertized in EDNS; only takes effect if the
+.B ARES_FLAG_EDNS
+flag is set.
+.TP 18
+.B ARES_OPT_RESOLVCONF
+.B char *\fIresolvconf_path\fP;
+.br
+The path to use for reading the resolv.conf file. The
+.I resolvconf_path
+should be set to a path string, and will be honoured on *nix like systems. The
+default is
+.B /etc/resolv.conf
+.br
+.PP
+The \fIoptmask\fP parameter also includes options without a corresponding
+field in the
+.B ares_options
+structure, as follows:
+.TP 23
+.B ARES_OPT_ROTATE
+Perform round-robin selection of the nameservers configured for the channel
+for each resolution.
+.TP 23
+.B ARES_OPT_NOROTATE
+Do not perform round-robin nameserver selection; always use the list of
+nameservers in the same order.
+.PP
+The
+.I flags
+field should be the bitwise or of some subset of the following values:
+.TP 23
+.B ARES_FLAG_USEVC
+Always use TCP queries (the "virtual circuit") instead of UDP
+queries. Normally, TCP is only used if a UDP query yields a truncated
+result.
+.TP 23
+.B ARES_FLAG_PRIMARY
+Only query the first server in the list of servers to query.
+.TP 23
+.B ARES_FLAG_IGNTC
+If a truncated response to a UDP query is received, do not fall back
+to TCP; simply continue on with the truncated response.
+.TP 23
+.B ARES_FLAG_NORECURSE
+Do not set the "recursion desired" bit on outgoing queries, so that the name
+server being contacted will not try to fetch the answer from other servers if
+it doesn't know the answer locally. Be aware that ares will not do the
+recursion for you. Recursion must be handled by the application calling ares
+if \fIARES_FLAG_NORECURSE\fP is set.
+.TP 23
+.B ARES_FLAG_STAYOPEN
+Do not close communications sockets when the number of active queries
+drops to zero.
+.TP 23
+.B ARES_FLAG_NOSEARCH
+Do not use the default search domains; only query hostnames as-is or
+as aliases.
+.TP 23
+.B ARES_FLAG_NOALIASES
+Do not honor the HOSTALIASES environment variable, which normally
+specifies a file of hostname translations.
+.TP 23
+.B ARES_FLAG_NOCHECKRESP
+Do not discard responses with the SERVFAIL, NOTIMP, or REFUSED
+response code or responses whose questions don't match the questions
+in the request. Primarily useful for writing clients which might be
+used to test or debug name servers.
+.TP 23
+.B ARES_FLAG_EDNS
+Include an EDNS pseudo-resource record (RFC 2671) in generated requests.
+.SH RETURN VALUES
+\fBares_init_options(3)\fP can return any of the following values:
+.TP 14
+.B ARES_SUCCESS
+Initialization succeeded.
+.TP 14
+.B ARES_EFILE
+A configuration file could not be read.
+.TP 14
+.B ARES_ENOMEM
+The process's available memory was exhausted.
+.TP 14
+.B ARES_ENOTINITIALIZED
+c-ares library initialization not yet performed.
+.SH NOTES
+When initializing from
+.B /etc/resolv.conf,
+(or, alternatively when specified by the
+.I resolvconf_path
+path location)
+\fBares_init_options(3)\fP reads the \fIdomain\fP and \fIsearch\fP directives
+to allow lookups of short names relative to the domains specified. The
+\fIdomain\fP and \fIsearch\fP directives override one another. If more that
+one instance of either \fIdomain\fP or \fIsearch\fP directives is specified,
+the last occurrence wins. For more information, please see the
+.BR resolv.conf (5)
+manual page.
+.SH SEE ALSO
+.BR ares_init(3),
+.BR ares_destroy(3),
+.BR ares_dup(3),
+.BR ares_library_init(3),
+.BR ares_save_options(3),
+.BR ares_set_servers(3),
+.BR ares_set_sortlist(3)
+.SH AUTHOR
+Greg Hudson, MIT Information Systems
+.br
+Copyright 1998 by the Massachusetts Institute of Technology.
+.br
+Copyright (C) 2004-2010 by Daniel Stenberg.
diff --git a/grpc/third_party/cares/cares/ares_library_cleanup.3 b/grpc/third_party/cares/cares/docs/ares_library_cleanup.3
index a1ffa6a9..a1ffa6a9 100644
--- a/grpc/third_party/cares/cares/ares_library_cleanup.3
+++ b/grpc/third_party/cares/cares/docs/ares_library_cleanup.3
diff --git a/grpc/third_party/cares/cares/ares_library_init.3 b/grpc/third_party/cares/cares/docs/ares_library_init.3
index b38cf325..b38cf325 100644
--- a/grpc/third_party/cares/cares/ares_library_init.3
+++ b/grpc/third_party/cares/cares/docs/ares_library_init.3
diff --git a/grpc/third_party/cares/cares/docs/ares_library_init_android.3 b/grpc/third_party/cares/cares/docs/ares_library_init_android.3
new file mode 100644
index 00000000..9e1ac4cd
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_library_init_android.3
@@ -0,0 +1,142 @@
+.\"
+.\" Copyright (C) 2017 by John Schember
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_LIBRARY_INIT_ANDROID 3 "13 Sept 2017"
+.SH NAME
+ares_library_init_android \- c-ares library Android initialization
+.SH SYNOPSIS
+.nf
+#include <ares.h>
+
+int ares_library_init_android(jobject \fIconnectivity_manager\fP)
+
+int ares_library_android_initialized();
+
+void ares_library_init_jvm(JavaVM *\fIjvm\fP)
+
+.fi
+.SH DESCRIPTION
+The \fIares_library_init_android(3)\fP function performs initializations
+internally required by the c-ares library when used on Android. This can take
+place anytime after \fIares_library_init(3)\fP. It must take place after
+\fIares_library_init_jvm\fP. ares_library_init_android must be called before
+DNS resolution will work on Android 8 (Oreo) or newer when targetSdkVersion is
+set to 26+.
+
+As of Android 8 (API level 26) getting DNS server information has
+becomei more restrictive and can only be accessed using the
+Connectivity Manager. It is necessary to pass the connectivity
+manager to c-ares via JNI. Also, the ACCESS_NETWORK_STATE permission
+must be present in the Android application.
+
+Android older than 8 do not need to to be initialized as they
+are less restrictive. However, this is a run time not compile time
+limitation. Proper Android initialization should take place regardless
+of the targeted Android version.
+
+Deinitialization will take place though \fIares_library_cleanup(3)\fP.
+
+The \fBares_library_init_jvm\fP function allows the caller to register the JVM
+with c-ares. It's meant to be called during JNI_OnLoad because you're
+guaranteed to have the JVM in that function. The JVM is required in order to
+use the Connectivty Manager registered using
+\fIares_library_init_android(3)\fP. This must be call before
+\fIares_library_init_android(3)\fP.
+
+The \fBares_library_android_initialized\fP function can be used to check
+whether c-ares has been initialized for use with Android.
+.SH RETURN VALUES
+ARES_SUCCESS will be returned on success otherwise an error code will be
+returned.
+.SH THREAD SAFETY
+.B These init functions are not thread safe.
+You have to call it once the program has started, but this call must be done
+before the program starts any other thread. This is required to avoid
+potential race conditions in library initialization, and also due to the fact
+these might call functions from other libraries that
+are thread unsafe, and could conflict with any other thread that is already
+using these other libraries.
+.SH JNI
+Accessing the Connectivity Manager though Java:
+
+Register the \fIares_library_android_init\fP.
+.nf
+ static JNINativeMethod funcs[] = {
+ { "initialize_native", "(Landroid/net/ConnectivityManager;)I",
+ (void *)&ares_library_init_android}
+ };
+
+ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
+ {
+ JNIEnv *env = NULL;
+ jclass cls = NULL;
+ jint res;
+
+ if ((*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_6) != JNI_OK)
+ return -1;
+
+ cls = (*env)->FindClass(env, JNIT_CLASS);
+ if (cls == NULL)
+ return -1;
+
+ res = (*env)->RegisterNatives(env, cls, funcs, sizeof(funcs)/sizeof(funcs[0]));
+ if (res != 0)
+ return -1;
+
+ ares_library_init_jvm(vm);
+ return JNI_VERSION_1_6;
+ }
+.fi
+Calling the registered function from Java:
+.nf
+ public class MyObject {
+ static {
+ System.loadLibrary("cares");
+ }
+
+ private static native boolean initialize_native(ConnectivityManager
+ connectivity_manager);
+
+ public static boolean initialize(Context context) {
+ initialize_native((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE));
+ }
+ }
+.fi
+Initializing the Connectivity Manager in JNI directly using an Android
+Context. It is assumed the JVM has aleady been registered through
+\fIJNI_OnLoad\fP.
+.nf
+ void initialize(jobject android_context)
+ {
+ jclass obj_cls = jni_get_class(env, "android/content/Context");
+ jmethodID obj_mid = jni_get_method_id(env, obj_cls, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
+ jfieldID fid = (*env)->GetStaticFieldID(env, obj_cls, "CONNECTIVITY_SERVICE", "Ljava/lang/String;");
+ jstring str = (*env)->GetStaticObjectField(env, obj_cls, fid);
+ connectivity_manager = (*env)->CallObjectMethod(env, android_context, obj_mid, str);
+ if (connectivity_manager == NULL)
+ return;
+ ares_library_init_android(connectivity_manager);
+ }
+.fi
+.SH AVAILABILITY
+This function was first introduced in c-ares version 1.15.0.
+.SH SEE ALSO
+.BR ares_library_init(3),
+.BR ares_library_cleanup(3),
+.SH AUTHOR
+John Schember
+.PP
+Copyright (C) 2017 by John Schember
+
diff --git a/grpc/third_party/cares/cares/ares_library_initialized.3 b/grpc/third_party/cares/cares/docs/ares_library_initialized.3
index 3e2727f8..3e2727f8 100644
--- a/grpc/third_party/cares/cares/ares_library_initialized.3
+++ b/grpc/third_party/cares/cares/docs/ares_library_initialized.3
diff --git a/grpc/third_party/cares/cares/ares_mkquery.3 b/grpc/third_party/cares/cares/docs/ares_mkquery.3
index c8afad83..c8afad83 100644
--- a/grpc/third_party/cares/cares/ares_mkquery.3
+++ b/grpc/third_party/cares/cares/docs/ares_mkquery.3
diff --git a/grpc/third_party/cares/cares/docs/ares_parse_a_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_a_reply.3
new file mode 100644
index 00000000..8e4908a7
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_parse_a_reply.3
@@ -0,0 +1,80 @@
+.\"
+.\" Copyright 1998 by the Massachusetts Institute of Technology.
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
+.SH NAME
+ares_parse_a_reply \- Parse a reply to a DNS query of type A
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
+.B struct hostent **\fIhost\fP,
+.B struct ares_addrttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
+.fi
+.SH DESCRIPTION
+The
+.B ares_parse_a_reply
+function parses the response to a query of type A into a
+.BR "struct hostent"
+and/or an array of
+.BR "struct ares_addrttls" .
+The parameters
+.I abuf
+and
+.I alen
+give the contents of the response. The result is stored in allocated
+memory and a pointer to it stored into the variable pointed to by
+.IR host ,
+if host is nonnull.
+It is the caller's responsibility to free the resulting host structure
+using
+.BR ares_free_hostent (3)
+when it is no longer needed.
+.PP
+If
+.IR addrttls
+and
+.IR naddrttls
+are both nonnull,
+then up to *naddrttls
+.BR "struct ares_addrttl"
+records are stored in the array pointed to by addrttls,
+and then *naddrttls is set to the number of records so stored.
+Note that the memory for these records is supplied by the caller.
+.SH RETURN VALUES
+.B ares_parse_a_reply
+can return any of the following values:
+.TP 15
+.B ARES_SUCCESS
+The response was successfully parsed.
+.TP 15
+.B ARES_EBADRESP
+The response was malformatted.
+.TP 15
+.B ARES_ENODATA
+The response did not contain an answer to the query.
+.TP 15
+.B ARES_ENOMEM
+Memory was exhausted.
+.SH SEE ALSO
+.BR ares_gethostbyname (3),
+.BR ares_free_hostent (3)
+.SH AUTHOR
+Greg Hudson, MIT Information Systems
+.br
+Andrew Selivanov <andrew.selivanov@gmail.com>
+.br
+Copyright 1998 by the Massachusetts Institute of Technology.
diff --git a/grpc/third_party/cares/cares/docs/ares_parse_aaaa_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_aaaa_reply.3
new file mode 100644
index 00000000..674acc5c
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_parse_aaaa_reply.3
@@ -0,0 +1,80 @@
+.\"
+.\" Copyright 2005 by Dominick Meglio.
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_PARSE_AAAA_REPLY 3 "20 Nov 2009"
+.SH NAME
+ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
+.B struct hostent **\fIhost\fP,
+.B struct ares_addr6ttl *\fIaddrttls\fP, int *\fInaddrttls\fP);
+.fi
+.SH DESCRIPTION
+The
+.B ares_parse_aaaa_reply
+function parses the response to a query of type AAAA into a
+.BR "struct hostent"
+and/or an array of
+.BR "struct ares_addr6ttl" .
+The parameters
+.I abuf
+and
+.I alen
+give the contents of the response. The result is stored in allocated
+memory and a pointer to it stored into the variable pointed to by
+.IR host ,
+if host is nonnull.
+It is the caller's responsibility to free the resulting host structure
+using
+.BR ares_free_hostent (3)
+when it is no longer needed.
+.PP
+If
+.IR addrttls
+and
+.IR naddrttls
+are both nonnull,
+then up to *naddrttls
+.BR "struct ares_addr6ttl"
+records are stored in the array pointed to by addrttls,
+and then *naddrttls is set to the number of records so stored.
+Note that the memory for these records is supplied by the caller.
+.SH RETURN VALUES
+.B ares_parse_aaaa_reply
+can return any of the following values:
+.TP 15
+.B ARES_SUCCESS
+The response was successfully parsed.
+.TP 15
+.B ARES_EBADRESP
+The response was malformatted.
+.TP 15
+.B ARES_ENODATA
+The response did not contain an answer to the query.
+.TP 15
+.B ARES_ENOMEM
+Memory was exhausted.
+.SH SEE ALSO
+.BR ares_gethostbyname (3),
+.BR ares_free_hostent (3)
+.SH AUTHOR
+Dominick Meglio
+.br
+Copyright 2005 by Dominick Meglio.
+.BR
+Andrew Selivanov <andrew.selivanov@gmail.com>
diff --git a/grpc/third_party/cares/cares/docs/ares_parse_caa_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_caa_reply.3
new file mode 100644
index 00000000..71bd6be9
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_parse_caa_reply.3
@@ -0,0 +1,171 @@
+.\"
+.\" Copyright 2020 Danny Sonnenschein <my.card.god@web.de>
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_PARSE_CAA_REPLY 3 "16 September 2020"
+.SH NAME
+ares_parse_caa_reply \- Parse a reply to a DNS query of type CAA
+.SH SYNOPSIS
+.nf
+#include <ares.h>
+
+int ares_parse_caa_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
+ struct ares_caa_reply **\fIcaa_out\fP);
+.fi
+.SH DESCRIPTION
+The
+.BR "ares_parse_caa_reply"
+function parses the response to a query of type CAA into a
+linked list (one element per sub-string) of
+.IR "struct ares_caa_reply"
+The parameters
+.I abuf
+and
+.I alen
+give the contents of the response. The result is stored in allocated
+memory and a pointer to it stored into the variable pointed to by
+.IR caa_out .
+It is the caller's responsibility to free the resulting
+.IR caa_out
+structure when it is no longer needed using the function
+.B ares_free_data(3)
+.PP
+The structure
+.I ares_caa_reply(3)
+contains the following fields:
+.sp
+.in +4n
+.nf
+struct ares_caa_reply {
+ struct ares_caa_reply *next;
+ int critical;
+ unsigned char *property;
+ size_t plength; /* plength excludes null */
+ unsigned char *value;
+ size_t length; /* length excludes null */
+};
+.fi
+.in
+.PP
+.SH RETURN VALUES
+.BR "ares_parse_caa_reply"
+can return any of the following values:
+.TP 15
+.B ARES_SUCCESS
+The response was successfully parsed.
+.TP 15
+.B ARES_EBADRESP
+The response was malformatted.
+.TP 15
+.B ARES_ENODATA
+The response did not contain an answer to the query.
+.TP 15
+.B ARES_ENOMEM
+Memory was exhausted.
+.SH EXAMPLE
+.nf
+#include <arpa/inet.h>
+#include <time.h>
+#include <sys/time.h>
+#include <netdb.h>
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "ares.h"
+
+static void dns_callback(void *arg,
+ int status,
+ int timeouts,
+ unsigned char *abuf,
+ int alen)
+ {
+ struct ares_caa_reply *caa_out;
+ int err;
+
+ err = ares_parse_caa_reply (abuf, alen, &caa_out);
+ if (err == ARES_SUCCESS)
+ {
+ struct ares_caa_reply *caa_curr;
+ for (caa_curr=caa_out; caa_curr; caa_curr=caa_curr->next)
+ printf ("%s. CAA %i %s \\"%s\\"\\n", arg,
+ caa_curr->critical,
+ caa_curr->property,
+ caa_curr->value);
+ }
+ else
+ {
+ printf ("err=%i\\n", err);
+ }
+ ares_free_data (caa_out);
+ }
+
+static void main_loop(ares_channel *channel)
+ {
+ int nfds, count;
+ fd_set readers, writers;
+ struct timeval tv, *tvp;
+ while (1)
+ {
+ FD_ZERO (&readers);
+ FD_ZERO (&writers);
+ nfds = ares_fds (*channel, &readers, &writers);
+ if (nfds == 0)
+ break;
+ tvp = ares_timeout (*channel, NULL, &tv);
+ count = select (nfds, &readers, &writers, NULL, tvp);
+ ares_process (*channel, &readers, &writers);
+ }
+ }
+
+int main(int argc, char **argv)
+ {
+ const char *sversion;
+ int iversion;
+ int err;
+
+ sversion = ares_version (&iversion);
+ printf ("c-ares version %s\\n", sversion);
+
+ char *domain = "wikipedia.org";
+ if (argc > 1)
+ domain = argv[1];
+
+ ares_channel channel;
+ if ((err = ares_init (&channel)) != ARES_SUCCESS)
+ {
+ printf ("ares_init() failed (%i)\\n", err);
+ exit (EXIT_FAILURE);
+ }
+
+ ares_query (channel, domain,
+ 1, /* ns_c_in */
+ 257, /* T_CAA */
+ dns_callback, domain);
+
+ main_loop (&channel);
+
+ ares_destroy (channel);
+
+ exit (EXIT_SUCCESS);
+ }
+.fi
+.SH AVAILABILITY
+This function was first introduced in c-ares version 1.17.0.
+.SH SEE ALSO
+.BR ares_query (3)
+.BR ares_free_data (3)
+.SH AUTHOR
+Written by Danny Sonnenschein <my.card.god@web.de>, on behalf of platynum, https://platynum.ch
diff --git a/grpc/third_party/cares/cares/ares_parse_mx_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_mx_reply.3
index 87df4592..87df4592 100644
--- a/grpc/third_party/cares/cares/ares_parse_mx_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_mx_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_naptr_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_naptr_reply.3
index 2a5f1e5b..2a5f1e5b 100644
--- a/grpc/third_party/cares/cares/ares_parse_naptr_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_naptr_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_ns_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_ns_reply.3
index b6340ac8..b6340ac8 100644
--- a/grpc/third_party/cares/cares/ares_parse_ns_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_ns_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_ptr_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_ptr_reply.3
index 1016a682..1016a682 100644
--- a/grpc/third_party/cares/cares/ares_parse_ptr_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_ptr_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_soa_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_soa_reply.3
index 1c4456f0..1c4456f0 100644
--- a/grpc/third_party/cares/cares/ares_parse_soa_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_soa_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_srv_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_srv_reply.3
index 9b561ffa..9b561ffa 100644
--- a/grpc/third_party/cares/cares/ares_parse_srv_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_srv_reply.3
diff --git a/grpc/third_party/cares/cares/ares_parse_txt_reply.3 b/grpc/third_party/cares/cares/docs/ares_parse_txt_reply.3
index e15d0eac..e15d0eac 100644
--- a/grpc/third_party/cares/cares/ares_parse_txt_reply.3
+++ b/grpc/third_party/cares/cares/docs/ares_parse_txt_reply.3
diff --git a/grpc/third_party/cares/cares/ares_process.3 b/grpc/third_party/cares/cares/docs/ares_process.3
index caabbf13..caabbf13 100644
--- a/grpc/third_party/cares/cares/ares_process.3
+++ b/grpc/third_party/cares/cares/docs/ares_process.3
diff --git a/grpc/third_party/cares/cares/ares_query.3 b/grpc/third_party/cares/cares/docs/ares_query.3
index 733fbc97..733fbc97 100644
--- a/grpc/third_party/cares/cares/ares_query.3
+++ b/grpc/third_party/cares/cares/docs/ares_query.3
diff --git a/grpc/third_party/cares/cares/ares_save_options.3 b/grpc/third_party/cares/cares/docs/ares_save_options.3
index bddae049..bddae049 100644
--- a/grpc/third_party/cares/cares/ares_save_options.3
+++ b/grpc/third_party/cares/cares/docs/ares_save_options.3
diff --git a/grpc/third_party/cares/cares/ares_search.3 b/grpc/third_party/cares/cares/docs/ares_search.3
index 2c85d20f..2c85d20f 100644
--- a/grpc/third_party/cares/cares/ares_search.3
+++ b/grpc/third_party/cares/cares/docs/ares_search.3
diff --git a/grpc/third_party/cares/cares/ares_send.3 b/grpc/third_party/cares/cares/docs/ares_send.3
index b89abfeb..b89abfeb 100644
--- a/grpc/third_party/cares/cares/ares_send.3
+++ b/grpc/third_party/cares/cares/docs/ares_send.3
diff --git a/grpc/third_party/cares/cares/ares_set_local_dev.3 b/grpc/third_party/cares/cares/docs/ares_set_local_dev.3
index 7d82133a..7d82133a 100644
--- a/grpc/third_party/cares/cares/ares_set_local_dev.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_local_dev.3
diff --git a/grpc/third_party/cares/cares/docs/ares_set_local_ip4.3 b/grpc/third_party/cares/cares/docs/ares_set_local_ip4.3
new file mode 100644
index 00000000..e68e80e7
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_set_local_ip4.3
@@ -0,0 +1,34 @@
+.\"
+.\" Copyright 2010 by Ben Greear <greearb@candelatech.com>
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_SET_LOCAL_IP4 3 "30 June 2010"
+.SH NAME
+ares_set_local_ip4 \- Set local IPv4 address outgoing requests.
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B void ares_set_local_ip4(ares_channel \fIchannel\fP, unsigned int \fIlocal_ip\fP)
+.fi
+.SH DESCRIPTION
+The \fBares_set_local_ip4\fP function sets the IP address for outbound
+requests. The parameter \fIlocal_ip\fP is specified in host byte order. This
+allows users to specify outbound interfaces when used on multi-homed systems.
+.SH SEE ALSO
+.BR ares_set_local_ip6 (3)
+.SH NOTES
+This function was added in c-ares 1.7.4
+.SH AUTHOR
+Ben Greear
diff --git a/grpc/third_party/cares/cares/docs/ares_set_local_ip6.3 b/grpc/third_party/cares/cares/docs/ares_set_local_ip6.3
new file mode 100644
index 00000000..e659f5c9
--- /dev/null
+++ b/grpc/third_party/cares/cares/docs/ares_set_local_ip6.3
@@ -0,0 +1,35 @@
+.\"
+.\" Copyright 2010 by Ben Greear <greearb@candelatech.com>
+.\"
+.\" Permission to use, copy, modify, and distribute this
+.\" software and its documentation for any purpose and without
+.\" fee is hereby granted, provided that the above copyright
+.\" notice appear in all copies and that both that copyright
+.\" notice and this permission notice appear in supporting
+.\" documentation, and that the name of M.I.T. not be used in
+.\" advertising or publicity pertaining to distribution of the
+.\" software without specific, written prior permission.
+.\" M.I.T. makes no representations about the suitability of
+.\" this software for any purpose. It is provided "as is"
+.\" without express or implied warranty.
+.\"
+.TH ARES_SET_LOCAL_IP6 3 "30 June 2010"
+.SH NAME
+ares_set_local_ip6 \- Set local IPv6 address outgoing requests.
+.SH SYNOPSIS
+.nf
+.B #include <ares.h>
+.PP
+.B void ares_set_local_ip6(ares_channel \fIchannel\fP, const unsigned char* \fIlocal_ip6\fP)
+.fi
+.SH DESCRIPTION
+The \fBares_set_local_ip6\fP function sets the IPv6 address for outbound
+IPv6 requests. The parameter \fIlocal_ip6\fP is specified in network byte
+order. This allows users to specify outbound interfaces when used on
+multi-homed systems. The local_ip6 argument must be 16 bytes in length.
+.SH SEE ALSO
+.BR ares_set_local_ip4 (3)
+.SH NOTES
+This function was added in c-ares 1.7.4
+.SH AUTHOR
+Ben Greear
diff --git a/grpc/third_party/cares/cares/ares_set_servers.3 b/grpc/third_party/cares/cares/docs/ares_set_servers.3
index 65ad1e16..65ad1e16 100644
--- a/grpc/third_party/cares/cares/ares_set_servers.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_servers.3
diff --git a/grpc/third_party/cares/cares/ares_set_servers_csv.3 b/grpc/third_party/cares/cares/docs/ares_set_servers_csv.3
index 638d2698..638d2698 100644
--- a/grpc/third_party/cares/cares/ares_set_servers_csv.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_servers_csv.3
diff --git a/grpc/third_party/cares/cares/ares_set_servers_ports.3 b/grpc/third_party/cares/cares/docs/ares_set_servers_ports.3
index a3be1893..a3be1893 100644
--- a/grpc/third_party/cares/cares/ares_set_servers_ports.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_servers_ports.3
diff --git a/grpc/third_party/cares/cares/ares_set_servers_ports_csv.3 b/grpc/third_party/cares/cares/docs/ares_set_servers_ports_csv.3
index 30535c69..30535c69 100644
--- a/grpc/third_party/cares/cares/ares_set_servers_ports_csv.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_servers_ports_csv.3
diff --git a/grpc/third_party/cares/cares/ares_set_socket_callback.3 b/grpc/third_party/cares/cares/docs/ares_set_socket_callback.3
index 14a5ad2d..14a5ad2d 100644
--- a/grpc/third_party/cares/cares/ares_set_socket_callback.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_socket_callback.3
diff --git a/grpc/third_party/cares/cares/ares_set_socket_configure_callback.3 b/grpc/third_party/cares/cares/docs/ares_set_socket_configure_callback.3
index d3b2f930..d3b2f930 100644
--- a/grpc/third_party/cares/cares/ares_set_socket_configure_callback.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_socket_configure_callback.3
diff --git a/grpc/third_party/cares/cares/ares_set_socket_functions.3 b/grpc/third_party/cares/cares/docs/ares_set_socket_functions.3
index 1cb0b855..1cb0b855 100644
--- a/grpc/third_party/cares/cares/ares_set_socket_functions.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_socket_functions.3
diff --git a/grpc/third_party/cares/cares/ares_set_sortlist.3 b/grpc/third_party/cares/cares/docs/ares_set_sortlist.3
index 24a97906..24a97906 100644
--- a/grpc/third_party/cares/cares/ares_set_sortlist.3
+++ b/grpc/third_party/cares/cares/docs/ares_set_sortlist.3
diff --git a/grpc/third_party/cares/cares/ares_strerror.3 b/grpc/third_party/cares/cares/docs/ares_strerror.3
index 4b50d5bb..4b50d5bb 100644
--- a/grpc/third_party/cares/cares/ares_strerror.3
+++ b/grpc/third_party/cares/cares/docs/ares_strerror.3
diff --git a/grpc/third_party/cares/cares/ares_timeout.3 b/grpc/third_party/cares/cares/docs/ares_timeout.3
index c57685dc..c57685dc 100644
--- a/grpc/third_party/cares/cares/ares_timeout.3
+++ b/grpc/third_party/cares/cares/docs/ares_timeout.3
diff --git a/grpc/third_party/cares/cares/ares_version.3 b/grpc/third_party/cares/cares/docs/ares_version.3
index 9ba7831f..9ba7831f 100644
--- a/grpc/third_party/cares/cares/ares_version.3
+++ b/grpc/third_party/cares/cares/docs/ares_version.3
diff --git a/grpc/third_party/cares/cares/include/CMakeLists.txt b/grpc/third_party/cares/cares/include/CMakeLists.txt
new file mode 100644
index 00000000..439e7bb2
--- /dev/null
+++ b/grpc/third_party/cares/cares/include/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Write ares_build.h configuration file. This is an installed file.
+CONFIGURE_FILE (ares_build.h.cmake ${PROJECT_BINARY_DIR}/ares_build.h)
+
+# Headers installation target
+IF (CARES_INSTALL)
+ SET (CARES_HEADERS ares.h ares_version.h "${PROJECT_BINARY_DIR}/ares_build.h" ares_rules.h ares_dns.h)
+ INSTALL (FILES ${CARES_HEADERS} COMPONENT Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ENDIF ()
diff --git a/grpc/third_party/cares/cares/include/Makefile.am b/grpc/third_party/cares/cares/include/Makefile.am
new file mode 100644
index 00000000..125a686a
--- /dev/null
+++ b/grpc/third_party/cares/cares/include/Makefile.am
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6
+ACLOCAL_AMFLAGS = -I m4 --install
+
+# what headers to install on 'make install':
+include_HEADERS = ares.h ares_version.h ares_build.h ares_rules.h ares_dns.h
+
+EXTRA_DIST = ares_build.h.cmake ares_build.h.in ares_build.h.dist CMakeLists.txt
diff --git a/grpc/third_party/cares/cares/include/ares.h b/grpc/third_party/cares/cares/include/ares.h
new file mode 100644
index 00000000..b341d609
--- /dev/null
+++ b/grpc/third_party/cares/cares/include/ares.h
@@ -0,0 +1,742 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2007-2013 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#ifndef ARES__H
+#define ARES__H
+
+#include "ares_version.h" /* c-ares version defines */
+#include "ares_build.h" /* c-ares build definitions */
+#include "ares_rules.h" /* c-ares rules enforcement */
+
+/*
+ * Define WIN32 when build target is Win32 API
+ */
+
+#if (defined(_WIN32) || defined(__WIN32__)) && \
+ !defined(WIN32) && !defined(__SYMBIAN32__)
+# define WIN32
+#endif
+
+#include <sys/types.h>
+
+/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
+ libc5-based Linux systems. Only include it on system that are known to
+ require it! */
+#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
+ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
+ defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
+ defined(__QNXNTO__) || defined(__MVS__)
+#include <sys/select.h>
+#endif
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+#include <sys/bsdskt.h>
+#endif
+
+#if defined(WATT32)
+# include <netinet/in.h>
+# include <sys/socket.h>
+# include <tcp.h>
+#elif defined(_WIN32_WCE)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock.h>
+#elif defined(WIN32)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock2.h>
+# include <ws2tcpip.h>
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+#endif
+
+#if defined(ANDROID) || defined(__ANDROID__)
+#include <jni.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** c-ares external API function linkage decorations.
+*/
+
+#ifdef CARES_STATICLIB
+# define CARES_EXTERN
+#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
+# if defined(CARES_BUILDING_LIBRARY)
+# define CARES_EXTERN __declspec(dllexport)
+# else
+# define CARES_EXTERN __declspec(dllimport)
+# endif
+#elif defined(CARES_BUILDING_LIBRARY) && defined(CARES_SYMBOL_HIDING)
+# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
+#else
+# define CARES_EXTERN
+#endif
+
+
+#define ARES_SUCCESS 0
+
+/* Server error codes (ARES_ENODATA indicates no relevant answer) */
+#define ARES_ENODATA 1
+#define ARES_EFORMERR 2
+#define ARES_ESERVFAIL 3
+#define ARES_ENOTFOUND 4
+#define ARES_ENOTIMP 5
+#define ARES_EREFUSED 6
+
+/* Locally generated error codes */
+#define ARES_EBADQUERY 7
+#define ARES_EBADNAME 8
+#define ARES_EBADFAMILY 9
+#define ARES_EBADRESP 10
+#define ARES_ECONNREFUSED 11
+#define ARES_ETIMEOUT 12
+#define ARES_EOF 13
+#define ARES_EFILE 14
+#define ARES_ENOMEM 15
+#define ARES_EDESTRUCTION 16
+#define ARES_EBADSTR 17
+
+/* ares_getnameinfo error codes */
+#define ARES_EBADFLAGS 18
+
+/* ares_getaddrinfo error codes */
+#define ARES_ENONAME 19
+#define ARES_EBADHINTS 20
+
+/* Uninitialized library error code */
+#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
+
+/* ares_library_init error codes */
+#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
+#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
+
+/* More error codes */
+#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
+
+/* More ares_getaddrinfo error codes */
+#define ARES_ESERVICE 25 /* introduced in 1.?.0 */
+
+/* Flag values */
+#define ARES_FLAG_USEVC (1 << 0)
+#define ARES_FLAG_PRIMARY (1 << 1)
+#define ARES_FLAG_IGNTC (1 << 2)
+#define ARES_FLAG_NORECURSE (1 << 3)
+#define ARES_FLAG_STAYOPEN (1 << 4)
+#define ARES_FLAG_NOSEARCH (1 << 5)
+#define ARES_FLAG_NOALIASES (1 << 6)
+#define ARES_FLAG_NOCHECKRESP (1 << 7)
+#define ARES_FLAG_EDNS (1 << 8)
+
+/* Option mask values */
+#define ARES_OPT_FLAGS (1 << 0)
+#define ARES_OPT_TIMEOUT (1 << 1)
+#define ARES_OPT_TRIES (1 << 2)
+#define ARES_OPT_NDOTS (1 << 3)
+#define ARES_OPT_UDP_PORT (1 << 4)
+#define ARES_OPT_TCP_PORT (1 << 5)
+#define ARES_OPT_SERVERS (1 << 6)
+#define ARES_OPT_DOMAINS (1 << 7)
+#define ARES_OPT_LOOKUPS (1 << 8)
+#define ARES_OPT_SOCK_STATE_CB (1 << 9)
+#define ARES_OPT_SORTLIST (1 << 10)
+#define ARES_OPT_SOCK_SNDBUF (1 << 11)
+#define ARES_OPT_SOCK_RCVBUF (1 << 12)
+#define ARES_OPT_TIMEOUTMS (1 << 13)
+#define ARES_OPT_ROTATE (1 << 14)
+#define ARES_OPT_EDNSPSZ (1 << 15)
+#define ARES_OPT_NOROTATE (1 << 16)
+#define ARES_OPT_RESOLVCONF (1 << 17)
+
+/* Nameinfo flag values */
+#define ARES_NI_NOFQDN (1 << 0)
+#define ARES_NI_NUMERICHOST (1 << 1)
+#define ARES_NI_NAMEREQD (1 << 2)
+#define ARES_NI_NUMERICSERV (1 << 3)
+#define ARES_NI_DGRAM (1 << 4)
+#define ARES_NI_TCP 0
+#define ARES_NI_UDP ARES_NI_DGRAM
+#define ARES_NI_SCTP (1 << 5)
+#define ARES_NI_DCCP (1 << 6)
+#define ARES_NI_NUMERICSCOPE (1 << 7)
+#define ARES_NI_LOOKUPHOST (1 << 8)
+#define ARES_NI_LOOKUPSERVICE (1 << 9)
+/* Reserved for future use */
+#define ARES_NI_IDN (1 << 10)
+#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
+#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
+
+/* Addrinfo flag values */
+#define ARES_AI_CANONNAME (1 << 0)
+#define ARES_AI_NUMERICHOST (1 << 1)
+#define ARES_AI_PASSIVE (1 << 2)
+#define ARES_AI_NUMERICSERV (1 << 3)
+#define ARES_AI_V4MAPPED (1 << 4)
+#define ARES_AI_ALL (1 << 5)
+#define ARES_AI_ADDRCONFIG (1 << 6)
+#define ARES_AI_NOSORT (1 << 7)
+#define ARES_AI_ENVHOSTS (1 << 8)
+/* Reserved for future use */
+#define ARES_AI_IDN (1 << 10)
+#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
+#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
+#define ARES_AI_CANONIDN (1 << 13)
+
+#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
+ ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
+ ARES_AI_ADDRCONFIG)
+#define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about this
+ many sockets */
+#define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
+#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
+ ARES_GETSOCK_MAXNUM)))
+
+/* c-ares library initialization flag values */
+#define ARES_LIB_INIT_NONE (0)
+#define ARES_LIB_INIT_WIN32 (1 << 0)
+#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
+
+
+/*
+ * Typedef our socket type
+ */
+
+#ifndef ares_socket_typedef
+#ifdef WIN32
+typedef SOCKET ares_socket_t;
+#define ARES_SOCKET_BAD INVALID_SOCKET
+#else
+typedef int ares_socket_t;
+#define ARES_SOCKET_BAD -1
+#endif
+#define ares_socket_typedef
+#endif /* ares_socket_typedef */
+
+typedef void (*ares_sock_state_cb)(void *data,
+ ares_socket_t socket_fd,
+ int readable,
+ int writable);
+
+struct apattern;
+
+/* NOTE about the ares_options struct to users and developers.
+
+ This struct will remain looking like this. It will not be extended nor
+ shrunk in future releases, but all new options will be set by ares_set_*()
+ options instead of with the ares_init_options() function.
+
+ Eventually (in a galaxy far far away), all options will be settable by
+ ares_set_*() options and the ares_init_options() function will become
+ deprecated.
+
+ When new options are added to c-ares, they are not added to this
+ struct. And they are not "saved" with the ares_save_options() function but
+ instead we encourage the use of the ares_dup() function. Needless to say,
+ if you add config options to c-ares you need to make sure ares_dup()
+ duplicates this new option.
+
+ */
+struct ares_options {
+ int flags;
+ int timeout; /* in seconds or milliseconds, depending on options */
+ int tries;
+ int ndots;
+ unsigned short udp_port;
+ unsigned short tcp_port;
+ int socket_send_buffer_size;
+ int socket_receive_buffer_size;
+ struct in_addr *servers;
+ int nservers;
+ char **domains;
+ int ndomains;
+ char *lookups;
+ ares_sock_state_cb sock_state_cb;
+ void *sock_state_cb_data;
+ struct apattern *sortlist;
+ int nsort;
+ int ednspsz;
+ char *resolvconf_path;
+};
+
+struct hostent;
+struct timeval;
+struct sockaddr;
+struct ares_channeldata;
+struct ares_addrinfo;
+struct ares_addrinfo_hints;
+
+typedef struct ares_channeldata *ares_channel;
+
+typedef void (*ares_callback)(void *arg,
+ int status,
+ int timeouts,
+ unsigned char *abuf,
+ int alen);
+
+typedef void (*ares_host_callback)(void *arg,
+ int status,
+ int timeouts,
+ struct hostent *hostent);
+
+typedef void (*ares_nameinfo_callback)(void *arg,
+ int status,
+ int timeouts,
+ char *node,
+ char *service);
+
+typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
+ int type,
+ void *data);
+
+typedef int (*ares_sock_config_callback)(ares_socket_t socket_fd,
+ int type,
+ void *data);
+
+typedef void (*ares_addrinfo_callback)(void *arg,
+ int status,
+ int timeouts,
+ struct ares_addrinfo *res);
+
+CARES_EXTERN int ares_library_init(int flags);
+
+CARES_EXTERN int ares_library_init_mem(int flags,
+ void *(*amalloc)(size_t size),
+ void (*afree)(void *ptr),
+ void *(*arealloc)(void *ptr, size_t size));
+
+#if defined(ANDROID) || defined(__ANDROID__)
+CARES_EXTERN void ares_library_init_jvm(JavaVM *jvm);
+CARES_EXTERN int ares_library_init_android(jobject connectivity_manager);
+CARES_EXTERN int ares_library_android_initialized(void);
+#endif
+
+CARES_EXTERN int ares_library_initialized(void);
+
+CARES_EXTERN void ares_library_cleanup(void);
+
+CARES_EXTERN const char *ares_version(int *version);
+
+CARES_EXTERN int ares_init(ares_channel *channelptr);
+
+CARES_EXTERN int ares_init_options(ares_channel *channelptr,
+ struct ares_options *options,
+ int optmask);
+
+CARES_EXTERN int ares_save_options(ares_channel channel,
+ struct ares_options *options,
+ int *optmask);
+
+CARES_EXTERN void ares_destroy_options(struct ares_options *options);
+
+CARES_EXTERN int ares_dup(ares_channel *dest,
+ ares_channel src);
+
+CARES_EXTERN void ares_destroy(ares_channel channel);
+
+CARES_EXTERN void ares_cancel(ares_channel channel);
+
+/* These next 3 configure local binding for the out-going socket
+ * connection. Use these to specify source IP and/or network device
+ * on multi-homed systems.
+ */
+CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip);
+
+/* local_ip6 should be 16 bytes in length */
+CARES_EXTERN void ares_set_local_ip6(ares_channel channel,
+ const unsigned char* local_ip6);
+
+/* local_dev_name should be null terminated. */
+CARES_EXTERN void ares_set_local_dev(ares_channel channel,
+ const char* local_dev_name);
+
+CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
+ ares_sock_create_callback callback,
+ void *user_data);
+
+CARES_EXTERN void ares_set_socket_configure_callback(ares_channel channel,
+ ares_sock_config_callback callback,
+ void *user_data);
+
+CARES_EXTERN int ares_set_sortlist(ares_channel channel,
+ const char *sortstr);
+
+CARES_EXTERN void ares_getaddrinfo(ares_channel channel,
+ const char* node,
+ const char* service,
+ const struct ares_addrinfo_hints* hints,
+ ares_addrinfo_callback callback,
+ void* arg);
+
+CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo* ai);
+
+/*
+ * Virtual function set to have user-managed socket IO.
+ * Note that all functions need to be defined, and when
+ * set, the library will not do any bind nor set any
+ * socket options, assuming the client handles these
+ * through either socket creation or the
+ * ares_sock_config_callback call.
+ */
+struct iovec;
+struct ares_socket_functions {
+ ares_socket_t(*asocket)(int, int, int, void *);
+ int(*aclose)(ares_socket_t, void *);
+ int(*aconnect)(ares_socket_t, const struct sockaddr *, ares_socklen_t, void *);
+ ares_ssize_t(*arecvfrom)(ares_socket_t, void *, size_t, int, struct sockaddr *, ares_socklen_t *, void *);
+ ares_ssize_t(*asendv)(ares_socket_t, const struct iovec *, int, void *);
+};
+
+CARES_EXTERN void ares_set_socket_functions(ares_channel channel,
+ const struct ares_socket_functions * funcs,
+ void *user_data);
+
+CARES_EXTERN void ares_send(ares_channel channel,
+ const unsigned char *qbuf,
+ int qlen,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_query(ares_channel channel,
+ const char *name,
+ int dnsclass,
+ int type,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_search(ares_channel channel,
+ const char *name,
+ int dnsclass,
+ int type,
+ ares_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_gethostbyname(ares_channel channel,
+ const char *name,
+ int family,
+ ares_host_callback callback,
+ void *arg);
+
+CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
+ const char *name,
+ int family,
+ struct hostent **host);
+
+CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
+ const void *addr,
+ int addrlen,
+ int family,
+ ares_host_callback callback,
+ void *arg);
+
+CARES_EXTERN void ares_getnameinfo(ares_channel channel,
+ const struct sockaddr *sa,
+ ares_socklen_t salen,
+ int flags,
+ ares_nameinfo_callback callback,
+ void *arg);
+
+CARES_EXTERN int ares_fds(ares_channel channel,
+ fd_set *read_fds,
+ fd_set *write_fds);
+
+CARES_EXTERN int ares_getsock(ares_channel channel,
+ ares_socket_t *socks,
+ int numsocks);
+
+CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
+ struct timeval *maxtv,
+ struct timeval *tv);
+
+CARES_EXTERN void ares_process(ares_channel channel,
+ fd_set *read_fds,
+ fd_set *write_fds);
+
+CARES_EXTERN void ares_process_fd(ares_channel channel,
+ ares_socket_t read_fd,
+ ares_socket_t write_fd);
+
+CARES_EXTERN int ares_create_query(const char *name,
+ int dnsclass,
+ int type,
+ unsigned short id,
+ int rd,
+ unsigned char **buf,
+ int *buflen,
+ int max_udp_size);
+
+CARES_EXTERN int ares_mkquery(const char *name,
+ int dnsclass,
+ int type,
+ unsigned short id,
+ int rd,
+ unsigned char **buf,
+ int *buflen);
+
+CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen,
+ char **s,
+ long *enclen);
+
+CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen,
+ unsigned char **s,
+ long *enclen);
+
+/*
+ * NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
+ * struct below when ares itself was built, but many apps would use this
+ * private version since the header checked a HAVE_* define for it. Starting
+ * with 1.7.0 we always declare and use our own to stop relying on the
+ * system's one.
+ */
+struct ares_in6_addr {
+ union {
+ unsigned char _S6_u8[16];
+ } _S6_un;
+};
+
+struct ares_addrttl {
+ struct in_addr ipaddr;
+ int ttl;
+};
+
+struct ares_addr6ttl {
+ struct ares_in6_addr ip6addr;
+ int ttl;
+};
+
+struct ares_caa_reply {
+ struct ares_caa_reply *next;
+ int critical;
+ unsigned char *property;
+ size_t plength; /* plength excludes null termination */
+ unsigned char *value;
+ size_t length; /* length excludes null termination */
+};
+
+struct ares_srv_reply {
+ struct ares_srv_reply *next;
+ char *host;
+ unsigned short priority;
+ unsigned short weight;
+ unsigned short port;
+};
+
+struct ares_mx_reply {
+ struct ares_mx_reply *next;
+ char *host;
+ unsigned short priority;
+};
+
+struct ares_txt_reply {
+ struct ares_txt_reply *next;
+ unsigned char *txt;
+ size_t length; /* length excludes null termination */
+};
+
+/* NOTE: This structure is a superset of ares_txt_reply
+ */
+struct ares_txt_ext {
+ struct ares_txt_ext *next;
+ unsigned char *txt;
+ size_t length;
+ /* 1 - if start of new record
+ * 0 - if a chunk in the same record */
+ unsigned char record_start;
+};
+
+struct ares_naptr_reply {
+ struct ares_naptr_reply *next;
+ unsigned char *flags;
+ unsigned char *service;
+ unsigned char *regexp;
+ char *replacement;
+ unsigned short order;
+ unsigned short preference;
+};
+
+struct ares_soa_reply {
+ char *nsname;
+ char *hostmaster;
+ unsigned int serial;
+ unsigned int refresh;
+ unsigned int retry;
+ unsigned int expire;
+ unsigned int minttl;
+};
+
+/*
+ * Similar to addrinfo, but with extra ttl and missing canonname.
+ */
+struct ares_addrinfo_node {
+ int ai_ttl;
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ ares_socklen_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ struct ares_addrinfo_node *ai_next;
+};
+
+/*
+ * alias - label of the resource record.
+ * name - value (canonical name) of the resource record.
+ * See RFC2181 10.1.1. CNAME terminology.
+ */
+struct ares_addrinfo_cname {
+ int ttl;
+ char *alias;
+ char *name;
+ struct ares_addrinfo_cname *next;
+};
+
+struct ares_addrinfo {
+ struct ares_addrinfo_cname *cnames;
+ struct ares_addrinfo_node *nodes;
+};
+
+struct ares_addrinfo_hints {
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+};
+
+/*
+** Parse the buffer, starting at *abuf and of length alen bytes, previously
+** obtained from an ares_search call. Put the results in *host, if nonnull.
+** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
+** their TTLs in that array, and set *naddrttls to the number of addresses
+** so written.
+*/
+
+CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host,
+ struct ares_addrttl *addrttls,
+ int *naddrttls);
+
+CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host,
+ struct ares_addr6ttl *addrttls,
+ int *naddrttls);
+
+CARES_EXTERN int ares_parse_caa_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_caa_reply** caa_out);
+
+CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
+ int alen,
+ const void *addr,
+ int addrlen,
+ int family,
+ struct hostent **host);
+
+CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
+ int alen,
+ struct hostent **host);
+
+CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_srv_reply** srv_out);
+
+CARES_EXTERN int ares_parse_mx_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_mx_reply** mx_out);
+
+CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_txt_reply** txt_out);
+
+CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf,
+ int alen,
+ struct ares_txt_ext** txt_out);
+
+CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_naptr_reply** naptr_out);
+
+CARES_EXTERN int ares_parse_soa_reply(const unsigned char* abuf,
+ int alen,
+ struct ares_soa_reply** soa_out);
+
+CARES_EXTERN void ares_free_string(void *str);
+
+CARES_EXTERN void ares_free_hostent(struct hostent *host);
+
+CARES_EXTERN void ares_free_data(void *dataptr);
+
+CARES_EXTERN const char *ares_strerror(int code);
+
+struct ares_addr_node {
+ struct ares_addr_node *next;
+ int family;
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+};
+
+struct ares_addr_port_node {
+ struct ares_addr_port_node *next;
+ int family;
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+ int udp_port;
+ int tcp_port;
+};
+
+CARES_EXTERN int ares_set_servers(ares_channel channel,
+ struct ares_addr_node *servers);
+CARES_EXTERN int ares_set_servers_ports(ares_channel channel,
+ struct ares_addr_port_node *servers);
+
+/* Incomming string format: host[:port][,host[:port]]... */
+CARES_EXTERN int ares_set_servers_csv(ares_channel channel,
+ const char* servers);
+CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel,
+ const char* servers);
+
+CARES_EXTERN int ares_get_servers(ares_channel channel,
+ struct ares_addr_node **servers);
+CARES_EXTERN int ares_get_servers_ports(ares_channel channel,
+ struct ares_addr_port_node **servers);
+
+CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst,
+ ares_socklen_t size);
+
+CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ARES__H */
diff --git a/grpc/third_party/cares/cares/ares_build.h.cmake b/grpc/third_party/cares/cares/include/ares_build.h.cmake
index ac32d47f..ac32d47f 100644
--- a/grpc/third_party/cares/cares/ares_build.h.cmake
+++ b/grpc/third_party/cares/cares/include/ares_build.h.cmake
diff --git a/grpc/third_party/cares/cares/ares_build.h.dist b/grpc/third_party/cares/cares/include/ares_build.h.dist
index 5e3ba9f0..5e3ba9f0 100644
--- a/grpc/third_party/cares/cares/ares_build.h.dist
+++ b/grpc/third_party/cares/cares/include/ares_build.h.dist
diff --git a/grpc/third_party/cares/cares/ares_build.h.in b/grpc/third_party/cares/cares/include/ares_build.h.in
index 24e3a989..24e3a989 100644
--- a/grpc/third_party/cares/cares/ares_build.h.in
+++ b/grpc/third_party/cares/cares/include/ares_build.h.in
diff --git a/grpc/third_party/cares/cares/include/ares_dns.h b/grpc/third_party/cares/cares/include/ares_dns.h
new file mode 100644
index 00000000..bc8aa7b1
--- /dev/null
+++ b/grpc/third_party/cares/cares/include/ares_dns.h
@@ -0,0 +1,112 @@
+#ifndef HEADER_CARES_DNS_H
+#define HEADER_CARES_DNS_H
+
+/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/*
+ * NOTE TO INTEGRATORS:
+ *
+ * This header is made public due to legacy projects relying on it.
+ * Please do not use the macros within this header, or include this
+ * header in your project as it may be removed in the future.
+ */
+
+
+/*
+ * Macro DNS__16BIT reads a network short (16 bit) given in network
+ * byte order, and returns its value as an unsigned short.
+ */
+#define DNS__16BIT(p) ((unsigned short)((unsigned int) 0xffff & \
+ (((unsigned int)((unsigned char)(p)[0]) << 8U) | \
+ ((unsigned int)((unsigned char)(p)[1])))))
+
+/*
+ * Macro DNS__32BIT reads a network long (32 bit) given in network
+ * byte order, and returns its value as an unsigned int.
+ */
+#define DNS__32BIT(p) ((unsigned int) \
+ (((unsigned int)((unsigned char)(p)[0]) << 24U) | \
+ ((unsigned int)((unsigned char)(p)[1]) << 16U) | \
+ ((unsigned int)((unsigned char)(p)[2]) << 8U) | \
+ ((unsigned int)((unsigned char)(p)[3]))))
+
+#define DNS__SET16BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 8) & 0xff)), \
+ ((p)[1] = (unsigned char)((v) & 0xff)))
+#define DNS__SET32BIT(p, v) (((p)[0] = (unsigned char)(((v) >> 24) & 0xff)), \
+ ((p)[1] = (unsigned char)(((v) >> 16) & 0xff)), \
+ ((p)[2] = (unsigned char)(((v) >> 8) & 0xff)), \
+ ((p)[3] = (unsigned char)((v) & 0xff)))
+
+#if 0
+/* we cannot use this approach on systems where we can't access 16/32 bit
+ data on un-aligned addresses */
+#define DNS__16BIT(p) ntohs(*(unsigned short*)(p))
+#define DNS__32BIT(p) ntohl(*(unsigned long*)(p))
+#define DNS__SET16BIT(p, v) *(unsigned short*)(p) = htons(v)
+#define DNS__SET32BIT(p, v) *(unsigned long*)(p) = htonl(v)
+#endif
+
+/* Macros for parsing a DNS header */
+#define DNS_HEADER_QID(h) DNS__16BIT(h)
+#define DNS_HEADER_QR(h) (((h)[2] >> 7) & 0x1)
+#define DNS_HEADER_OPCODE(h) (((h)[2] >> 3) & 0xf)
+#define DNS_HEADER_AA(h) (((h)[2] >> 2) & 0x1)
+#define DNS_HEADER_TC(h) (((h)[2] >> 1) & 0x1)
+#define DNS_HEADER_RD(h) ((h)[2] & 0x1)
+#define DNS_HEADER_RA(h) (((h)[3] >> 7) & 0x1)
+#define DNS_HEADER_Z(h) (((h)[3] >> 4) & 0x7)
+#define DNS_HEADER_RCODE(h) ((h)[3] & 0xf)
+#define DNS_HEADER_QDCOUNT(h) DNS__16BIT((h) + 4)
+#define DNS_HEADER_ANCOUNT(h) DNS__16BIT((h) + 6)
+#define DNS_HEADER_NSCOUNT(h) DNS__16BIT((h) + 8)
+#define DNS_HEADER_ARCOUNT(h) DNS__16BIT((h) + 10)
+
+/* Macros for constructing a DNS header */
+#define DNS_HEADER_SET_QID(h, v) DNS__SET16BIT(h, v)
+#define DNS_HEADER_SET_QR(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 7))
+#define DNS_HEADER_SET_OPCODE(h, v) ((h)[2] |= (unsigned char)(((v) & 0xf) << 3))
+#define DNS_HEADER_SET_AA(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 2))
+#define DNS_HEADER_SET_TC(h, v) ((h)[2] |= (unsigned char)(((v) & 0x1) << 1))
+#define DNS_HEADER_SET_RD(h, v) ((h)[2] |= (unsigned char)((v) & 0x1))
+#define DNS_HEADER_SET_RA(h, v) ((h)[3] |= (unsigned char)(((v) & 0x1) << 7))
+#define DNS_HEADER_SET_Z(h, v) ((h)[3] |= (unsigned char)(((v) & 0x7) << 4))
+#define DNS_HEADER_SET_RCODE(h, v) ((h)[3] |= (unsigned char)((v) & 0xf))
+#define DNS_HEADER_SET_QDCOUNT(h, v) DNS__SET16BIT((h) + 4, v)
+#define DNS_HEADER_SET_ANCOUNT(h, v) DNS__SET16BIT((h) + 6, v)
+#define DNS_HEADER_SET_NSCOUNT(h, v) DNS__SET16BIT((h) + 8, v)
+#define DNS_HEADER_SET_ARCOUNT(h, v) DNS__SET16BIT((h) + 10, v)
+
+/* Macros for parsing the fixed part of a DNS question */
+#define DNS_QUESTION_TYPE(q) DNS__16BIT(q)
+#define DNS_QUESTION_CLASS(q) DNS__16BIT((q) + 2)
+
+/* Macros for constructing the fixed part of a DNS question */
+#define DNS_QUESTION_SET_TYPE(q, v) DNS__SET16BIT(q, v)
+#define DNS_QUESTION_SET_CLASS(q, v) DNS__SET16BIT((q) + 2, v)
+
+/* Macros for parsing the fixed part of a DNS resource record */
+#define DNS_RR_TYPE(r) DNS__16BIT(r)
+#define DNS_RR_CLASS(r) DNS__16BIT((r) + 2)
+#define DNS_RR_TTL(r) DNS__32BIT((r) + 4)
+#define DNS_RR_LEN(r) DNS__16BIT((r) + 8)
+
+/* Macros for constructing the fixed part of a DNS resource record */
+#define DNS_RR_SET_TYPE(r, v) DNS__SET16BIT(r, v)
+#define DNS_RR_SET_CLASS(r, v) DNS__SET16BIT((r) + 2, v)
+#define DNS_RR_SET_TTL(r, v) DNS__SET32BIT((r) + 4, v)
+#define DNS_RR_SET_LEN(r, v) DNS__SET16BIT((r) + 8, v)
+
+#endif /* HEADER_CARES_DNS_H */
diff --git a/grpc/third_party/cares/cares/ares_rules.h b/grpc/third_party/cares/cares/include/ares_rules.h
index cac23cf2..cac23cf2 100644
--- a/grpc/third_party/cares/cares/ares_rules.h
+++ b/grpc/third_party/cares/cares/include/ares_rules.h
diff --git a/grpc/third_party/cares/cares/include/ares_version.h b/grpc/third_party/cares/cares/include/ares_version.h
new file mode 100644
index 00000000..4b16a62c
--- /dev/null
+++ b/grpc/third_party/cares/cares/include/ares_version.h
@@ -0,0 +1,24 @@
+
+#ifndef ARES__VERSION_H
+#define ARES__VERSION_H
+
+/* This is the global package copyright */
+#define ARES_COPYRIGHT "2004 - 2020 Daniel Stenberg, <daniel@haxx.se>."
+
+#define ARES_VERSION_MAJOR 1
+#define ARES_VERSION_MINOR 17
+#define ARES_VERSION_PATCH 0
+#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
+ (ARES_VERSION_MINOR<<8)|\
+ (ARES_VERSION_PATCH))
+#define ARES_VERSION_STR "1.17.0"
+
+#if (ARES_VERSION >= 0x010700)
+# define CARES_HAVE_ARES_LIBRARY_INIT 1
+# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
+#else
+# undef CARES_HAVE_ARES_LIBRARY_INIT
+# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
+#endif
+
+#endif
diff --git a/grpc/third_party/cares/cares/inet_net_pton.c b/grpc/third_party/cares/cares/inet_net_pton.c
deleted file mode 100644
index af1a534a..00000000
--- a/grpc/third_party/cares/cares/inet_net_pton.c
+++ /dev/null
@@ -1,450 +0,0 @@
-
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1996,1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_ipv6.h"
-#include "ares_nowarn.h"
-#include "ares_inet_net_pton.h"
-
-
-const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
-
-
-#ifndef HAVE_INET_NET_PTON
-
-/*
- * static int
- * inet_net_pton_ipv4(src, dst, size)
- * convert IPv4 network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not an IPv4 network specification.
- * note:
- * network byte order assumed. this means 192.5.5.240/28 has
- * 0b11110000 in its fourth octet.
- * note:
- * On Windows we store the error in the thread errno, not
- * in the winsock error code. This is to avoid loosing the
- * actual last winsock error. So use macro ERRNO to fetch the
- * errno this funtion sets when returning (-1), not SOCKERRNO.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-static int
-inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
-{
- static const char xdigits[] = "0123456789abcdef";
- static const char digits[] = "0123456789";
- int n, ch, tmp = 0, dirty, bits;
- const unsigned char *odst = dst;
-
- ch = *src++;
- if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
- && ISASCII(src[1])
- && ISXDIGIT(src[1])) {
- /* Hexadecimal: Eat nybble string. */
- if (!size)
- goto emsgsize;
- dirty = 0;
- src++; /* skip x or X. */
- while ((ch = *src++) != '\0' && ISASCII(ch) && ISXDIGIT(ch)) {
- if (ISUPPER(ch))
- ch = tolower(ch);
- n = aresx_sztosi(strchr(xdigits, ch) - xdigits);
- if (dirty == 0)
- tmp = n;
- else
- tmp = (tmp << 4) | n;
- if (++dirty == 2) {
- if (!size--)
- goto emsgsize;
- *dst++ = (unsigned char) tmp;
- dirty = 0;
- }
- }
- if (dirty) { /* Odd trailing nybble? */
- if (!size--)
- goto emsgsize;
- *dst++ = (unsigned char) (tmp << 4);
- }
- } else if (ISASCII(ch) && ISDIGIT(ch)) {
- /* Decimal: eat dotted digit string. */
- for (;;) {
- tmp = 0;
- do {
- n = aresx_sztosi(strchr(digits, ch) - digits);
- tmp *= 10;
- tmp += n;
- if (tmp > 255)
- goto enoent;
- } while ((ch = *src++) != '\0' &&
- ISASCII(ch) && ISDIGIT(ch));
- if (!size--)
- goto emsgsize;
- *dst++ = (unsigned char) tmp;
- if (ch == '\0' || ch == '/')
- break;
- if (ch != '.')
- goto enoent;
- ch = *src++;
- if (!ISASCII(ch) || !ISDIGIT(ch))
- goto enoent;
- }
- } else
- goto enoent;
-
- bits = -1;
- if (ch == '/' && ISASCII(src[0]) &&
- ISDIGIT(src[0]) && dst > odst) {
- /* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
- bits = 0;
- do {
- n = aresx_sztosi(strchr(digits, ch) - digits);
- bits *= 10;
- bits += n;
- if (bits > 32)
- goto enoent;
- } while ((ch = *src++) != '\0' && ISASCII(ch) && ISDIGIT(ch));
- if (ch != '\0')
- goto enoent;
- }
-
- /* Firey death and destruction unless we prefetched EOS. */
- if (ch != '\0')
- goto enoent;
-
- /* If nothing was written to the destination, we found no address. */
- if (dst == odst)
- goto enoent; /* LCOV_EXCL_LINE: all valid paths above increment dst */
- /* If no CIDR spec was given, infer width from net class. */
- if (bits == -1) {
- if (*odst >= 240) /* Class E */
- bits = 32;
- else if (*odst >= 224) /* Class D */
- bits = 8;
- else if (*odst >= 192) /* Class C */
- bits = 24;
- else if (*odst >= 128) /* Class B */
- bits = 16;
- else /* Class A */
- bits = 8;
- /* If imputed mask is narrower than specified octets, widen. */
- if (bits < ((dst - odst) * 8))
- bits = aresx_sztosi(dst - odst) * 8;
- /*
- * If there are no additional bits specified for a class D
- * address adjust bits to 4.
- */
- if (bits == 8 && *odst == 224)
- bits = 4;
- }
- /* Extend network to cover the actual mask. */
- while (bits > ((dst - odst) * 8)) {
- if (!size--)
- goto emsgsize;
- *dst++ = '\0';
- }
- return (bits);
-
- enoent:
- SET_ERRNO(ENOENT);
- return (-1);
-
- emsgsize:
- SET_ERRNO(EMSGSIZE);
- return (-1);
-}
-
-static int
-getbits(const char *src, int *bitsp)
-{
- static const char digits[] = "0123456789";
- int n;
- int val;
- char ch;
-
- val = 0;
- n = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- pch = strchr(digits, ch);
- if (pch != NULL) {
- if (n++ != 0 && val == 0) /* no leading zeros */
- return (0);
- val *= 10;
- val += aresx_sztosi(pch - digits);
- if (val > 128) /* range */
- return (0);
- continue;
- }
- return (0);
- }
- if (n == 0)
- return (0);
- *bitsp = val;
- return (1);
-}
-
-static int
-getv4(const char *src, unsigned char *dst, int *bitsp)
-{
- static const char digits[] = "0123456789";
- unsigned char *odst = dst;
- int n;
- unsigned int val;
- char ch;
-
- val = 0;
- n = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- pch = strchr(digits, ch);
- if (pch != NULL) {
- if (n++ != 0 && val == 0) /* no leading zeros */
- return (0);
- val *= 10;
- val += aresx_sztoui(pch - digits);
- if (val > 255) /* range */
- return (0);
- continue;
- }
- if (ch == '.' || ch == '/') {
- if (dst - odst > 3) /* too many octets? */
- return (0);
- *dst++ = (unsigned char)val;
- if (ch == '/')
- return (getbits(src, bitsp));
- val = 0;
- n = 0;
- continue;
- }
- return (0);
- }
- if (n == 0)
- return (0);
- if (dst - odst > 3) /* too many octets? */
- return (0);
- *dst = (unsigned char)val;
- return 1;
-}
-
-static int
-inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
-{
- static const char xdigits_l[] = "0123456789abcdef",
- xdigits_u[] = "0123456789ABCDEF";
- unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *xdigits, *curtok;
- int ch, saw_xdigit;
- unsigned int val;
- int digits;
- int bits;
- size_t bytes;
- int words;
- int ipv4;
-
- memset((tp = tmp), '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- goto enoent;
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- digits = 0;
- bits = -1;
- ipv4 = 0;
- while ((ch = *src++) != '\0') {
- const char *pch;
-
- if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
- pch = strchr((xdigits = xdigits_u), ch);
- if (pch != NULL) {
- val <<= 4;
- val |= aresx_sztoui(pch - xdigits);
- if (++digits > 4)
- goto enoent;
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':') {
- curtok = src;
- if (!saw_xdigit) {
- if (colonp)
- goto enoent;
- colonp = tp;
- continue;
- } else if (*src == '\0')
- goto enoent;
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (unsigned char)((val >> 8) & 0xff);
- *tp++ = (unsigned char)(val & 0xff);
- saw_xdigit = 0;
- digits = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- getv4(curtok, tp, &bits) > 0) {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- ipv4 = 1;
- break; /* '\0' was seen by inet_pton4(). */
- }
- if (ch == '/' && getbits(src, &bits) > 0)
- break;
- goto enoent;
- }
- if (saw_xdigit) {
- if (tp + NS_INT16SZ > endp)
- goto enoent;
- *tp++ = (unsigned char)((val >> 8) & 0xff);
- *tp++ = (unsigned char)(val & 0xff);
- }
- if (bits == -1)
- bits = 128;
-
- words = (bits + 15) / 16;
- if (words < 2)
- words = 2;
- if (ipv4)
- words = 8;
- endp = tmp + 2 * words;
-
- if (colonp != NULL) {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const ares_ssize_t n = tp - colonp;
- ares_ssize_t i;
-
- if (tp == endp)
- goto enoent;
- for (i = 1; i <= n; i++) {
- *(endp - i) = *(colonp + n - i);
- *(colonp + n - i) = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- goto enoent;
-
- bytes = (bits + 7) / 8;
- if (bytes > size)
- goto emsgsize;
- memcpy(dst, tmp, bytes);
- return (bits);
-
- enoent:
- SET_ERRNO(ENOENT);
- return (-1);
-
- emsgsize:
- SET_ERRNO(EMSGSIZE);
- return (-1);
-}
-
-/*
- * int
- * inet_net_pton(af, src, dst, size)
- * convert network number from presentation to network format.
- * accepts hex octets, hex strings, decimal octets, and /CIDR.
- * "size" is in bytes and describes "dst".
- * return:
- * number of bits, either imputed classfully or specified with /CIDR,
- * or -1 if some failure occurred (check errno). ENOENT means it was
- * not a valid network specification.
- * note:
- * On Windows we store the error in the thread errno, not
- * in the winsock error code. This is to avoid loosing the
- * actual last winsock error. So use macro ERRNO to fetch the
- * errno this funtion sets when returning (-1), not SOCKERRNO.
- * author:
- * Paul Vixie (ISC), June 1996
- */
-int
-ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
-{
- switch (af) {
- case AF_INET:
- return (inet_net_pton_ipv4(src, dst, size));
- case AF_INET6:
- return (inet_net_pton_ipv6(src, dst, size));
- default:
- SET_ERRNO(EAFNOSUPPORT);
- return (-1);
- }
-}
-
-#endif /* HAVE_INET_NET_PTON */
-
-#ifndef HAVE_INET_PTON
-int ares_inet_pton(int af, const char *src, void *dst)
-{
- int result;
- size_t size;
-
- if (af == AF_INET)
- size = sizeof(struct in_addr);
- else if (af == AF_INET6)
- size = sizeof(struct ares_in6_addr);
- else
- {
- SET_ERRNO(EAFNOSUPPORT);
- return -1;
- }
- result = ares_inet_net_pton(af, src, dst, size);
- if (result == -1 && ERRNO == ENOENT)
- return 0;
- return (result > -1 ? 1 : -1);
-}
-#else /* HAVE_INET_PTON */
-int ares_inet_pton(int af, const char *src, void *dst)
-{
- /* just relay this to the underlying function */
- return inet_pton(af, src, dst);
-}
-
-#endif
diff --git a/grpc/third_party/cares/cares/inet_ntop.c b/grpc/third_party/cares/cares/inet_ntop.c
deleted file mode 100644
index 1935a871..00000000
--- a/grpc/third_party/cares/cares/inet_ntop.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
- * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "ares_setup.h"
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-# include <arpa/nameser.h>
-#else
-# include "nameser.h"
-#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-# include <arpa/nameser_compat.h>
-#endif
-
-#include "ares.h"
-#include "ares_ipv6.h"
-
-#ifndef HAVE_INET_NTOP
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
-static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * note:
- * On Windows we store the error in the thread errno, not
- * in the winsock error code. This is to avoid loosing the
- * actual last winsock error. So use macro ERRNO to fetch the
- * errno this function sets when returning NULL, not SOCKERRNO.
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
-{
- switch (af) {
- case AF_INET:
- return (inet_ntop4(src, dst, (size_t)size));
- case AF_INET6:
- return (inet_ntop6(src, dst, (size_t)size));
- default:
- SET_ERRNO(EAFNOSUPPORT);
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a unsigned char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4(const unsigned char *src, char *dst, size_t size)
-{
- static const char fmt[] = "%u.%u.%u.%u";
- char tmp[sizeof("255.255.255.255")];
-
- if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) {
- SET_ERRNO(ENOSPC);
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6(const unsigned char *src, char *dst, size_t size)
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
- char *tp;
- struct { int base, len; } best, cur;
- unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset(words, '\0', sizeof(words));
- for (i = 0; i < NS_IN6ADDRSZ; i++)
- words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
- best.base = -1;
- best.len = 0;
- cur.base = -1;
- cur.len = 0;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- if (words[i] == 0) {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- } else {
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1) {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base &&
- i < (best.base + best.len)) {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 && (best.len == 6 ||
- (best.len == 7 && words[7] != 0x0001) ||
- (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
- return (NULL);
- tp += strlen(tp);
- break;
- }
- tp += sprintf(tp, "%x", words[i]);
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
- SET_ERRNO(ENOSPC);
- return (NULL);
- }
- strcpy(dst, tmp);
- return (dst);
-}
-
-#else /* HAVE_INET_NTOP */
-
-const char *
-ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
-{
- /* just relay this to the underlying function */
- return inet_ntop(af, src, dst, size);
-}
-
-#endif /* HAVE_INET_NTOP */
diff --git a/grpc/third_party/cares/cares/m4/ax_code_coverage.m4 b/grpc/third_party/cares/cares/m4/ax_code_coverage.m4
index 5120c3bb..67b2774b 100644
--- a/grpc/third_party/cares/cares/m4/ax_code_coverage.m4
+++ b/grpc/third_party/cares/cares/m4/ax_code_coverage.m4
@@ -104,7 +104,7 @@ AC_DEFUN([AX_CODE_COVERAGE],[
])
# List of supported lcov versions.
- lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
+ lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.13"
AC_CHECK_PROG([LCOV], [lcov], [lcov])
AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
diff --git a/grpc/third_party/cares/cares/m4/cares-compilers.m4 b/grpc/third_party/cares/cares/m4/cares-compilers.m4
index 2b98a688..542003b4 100644
--- a/grpc/third_party/cares/cares/m4/cares-compilers.m4
+++ b/grpc/third_party/cares/cares/m4/cares-compilers.m4
@@ -1179,97 +1179,6 @@ squeeze() {
])
-dnl CARES_CHECK_CURLDEBUG
-dnl -------------------------------------------------
-dnl Settings which depend on configure's curldebug given
-dnl option, and other additional configure pre-requisites.
-dnl Using the curl debug memory tracking feature in c-ares
-dnl is a hack that actually can only be used/enabled when
-dnl c-ares is built directly in curl's CVS tree, as a static
-dnl library or as a shared one on those systems on which
-dnl shared libraries support undefined symbols, along with
-dnl an equally configured libcurl.
-
-AC_DEFUN([CARES_CHECK_CURLDEBUG], [
- AC_REQUIRE([XC_LIBTOOL])dnl
- AC_REQUIRE([CARES_SHFUNC_SQUEEZE])dnl
- cares_builddir=`pwd`
- supports_curldebug="unknown"
- if test "$want_curldebug" = "yes"; then
- if test "x$enable_shared" != "xno" &&
- test "x$enable_shared" != "xyes"; then
- AC_MSG_WARN([unknown enable_shared setting.])
- supports_curldebug="no"
- fi
- if test "x$enable_static" != "xno" &&
- test "x$enable_static" != "xyes"; then
- AC_MSG_WARN([unknown enable_static setting.])
- supports_curldebug="no"
- fi
- if test "$supports_curldebug" != "no"; then
- if test "$enable_shared" = "yes" &&
- test "x$xc_lt_shlib_use_no_undefined" = 'xyes'; then
- supports_curldebug="no"
- AC_MSG_WARN([shared library does not support undefined symbols.])
- fi
- if test ! -f "$srcdir/../include/curl/curlbuild.h.dist"; then
- AC_MSG_WARN([c-ares source not embedded in curl's CVS tree.])
- supports_curldebug="no"
- elif test ! -f "$srcdir/../include/curl/Makefile.in"; then
- AC_MSG_WARN([curl's buildconf has not been run.])
- supports_curldebug="no"
- elif test ! -f "$cares_builddir/../libcurl.pc" ||
- test ! -f "$cares_builddir/../include/curl/curlbuild.h"; then
- AC_MSG_WARN([curl's configure has not been run.])
- supports_curldebug="no"
- elif test ! -f "$cares_builddir/../lib/curl_config.h"; then
- AC_MSG_WARN([libcurl's curl_config.h is missing.])
- supports_curldebug="no"
- elif test ! -f "$cares_builddir/../config.status"; then
- AC_MSG_WARN([curl's config.status is missing.])
- supports_curldebug="no"
- fi
- if test "$supports_curldebug" != "no"; then
- grep '^#define USE_ARES' "$cares_builddir/../lib/curl_config.h" >/dev/null
- if test "$?" -ne "0"; then
- AC_MSG_WARN([libcurl configured without c-ares support.])
- supports_curldebug="no"
- fi
- fi
- if test "$supports_curldebug" != "no"; then
- grep 'CPPFLAGS.*CURLDEBUG' "$cares_builddir/../config.status" >/dev/null
- if test "$?" -ne "0"; then
- AC_MSG_WARN([libcurl configured without curldebug support.])
- supports_curldebug="no"
- fi
- fi
- fi
- fi
- #
- if test "$want_curldebug" = "yes"; then
- AC_MSG_CHECKING([if curl debug memory tracking can be enabled])
- test "$supports_curldebug" = "no" || supports_curldebug="yes"
- AC_MSG_RESULT([$supports_curldebug])
- if test "$supports_curldebug" = "no"; then
- AC_MSG_WARN([cannot enable curl debug memory tracking.])
- want_curldebug="no"
- fi
- fi
- #
- if test "$want_curldebug" = "yes"; then
- dnl TODO: Verify if the BUILDING_LIBCURL definition is still required.
- AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
- CPPFLAGS="-DCURLDEBUG $CPPFLAGS"
- squeeze CPPFLAGS
- fi
- #
- if test "$want_debug" = "yes"; then
- CPPFLAGS="-DDEBUGBUILD $CPPFLAGS"
- squeeze CPPFLAGS
- fi
-])
-
-
dnl CARES_CHECK_COMPILER_HALT_ON_ERROR
dnl -------------------------------------------------
dnl Verifies if the compiler actually halts after the
diff --git a/grpc/third_party/cares/cares/m4/cares-confopts.m4 b/grpc/third_party/cares/cares/m4/cares-confopts.m4
index 135036a7..eb52ee7b 100644
--- a/grpc/third_party/cares/cares/m4/cares-confopts.m4
+++ b/grpc/third_party/cares/cares/m4/cares-confopts.m4
@@ -18,45 +18,6 @@
# serial 11
-dnl CARES_CHECK_OPTION_CURLDEBUG
-dnl -------------------------------------------------
-dnl Verify if configure has been invoked with option
-dnl --enable-curldebug or --disable-curldebug, and set
-dnl shell variable want_curldebug value as appropriate.
-
-AC_DEFUN([CARES_CHECK_OPTION_CURLDEBUG], [
- AC_BEFORE([$0],[CARES_CHECK_CURLDEBUG])dnl
- AC_MSG_CHECKING([whether to enable curl debug memory tracking])
- OPT_CURLDEBUG_BUILD="default"
- AC_ARG_ENABLE(curldebug,
-AC_HELP_STRING([--enable-curldebug],[Enable curl debug memory tracking])
-AC_HELP_STRING([--disable-curldebug],[Disable curl debug memory tracking]),
- OPT_CURLDEBUG_BUILD=$enableval)
- case "$OPT_CURLDEBUG_BUILD" in
- no)
- dnl --disable-curldebug option used
- want_curldebug="no"
- ;;
- default)
- dnl configure option not specified
- want_curldebug="no"
- ;;
- *)
- dnl --enable-curldebug option used.
- dnl The use of this option value is a request to enable curl's
- dnl debug memory tracking for the c-ares library. This is a big
- dnl hack that can only be done when a whole bunch of requisites
- dnl are simultaneously satisfied. Later on, these requisites are
- dnl verified and if they are not fully satisfied the option will
- dnl be ignored and act as if --disable-curldebug had been given
- dnl setting shell variable want_curldebug to 'no'.
- want_curldebug="yes"
- ;;
- esac
- AC_MSG_RESULT([$want_curldebug])
-])
-
-
dnl CARES_CHECK_OPTION_DEBUG
dnl -------------------------------------------------
dnl Verify if configure has been invoked with option
@@ -65,7 +26,6 @@ dnl variable want_debug value as appropriate.
AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [
AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl
- AC_BEFORE([$0],[CARES_CHECK_OPTION_CURLDEBUG])dnl
AC_BEFORE([$0],[XC_CHECK_PROG_CC])dnl
AC_MSG_CHECKING([whether to enable debug build options])
OPT_DEBUG_BUILD="default"
diff --git a/grpc/third_party/cares/cares/m4/cares-functions.m4 b/grpc/third_party/cares/cares/m4/cares-functions.m4
index 7c7c92b5..0f3992c7 100644
--- a/grpc/third_party/cares/cares/m4/cares-functions.m4
+++ b/grpc/third_party/cares/cares/m4/cares-functions.m4
@@ -1661,6 +1661,146 @@ AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYPORT_R], [
])
+dnl CARES_CHECK_FUNC_GETSERVBYNAME_R
+dnl -------------------------------------------------
+dnl Verify if getservbyname_r is available, prototyped,
+dnl and can be compiled. If all of these are true, and
+dnl usage has not been previously disallowed with
+dnl shell variable cares_disallow_getservbyname_r, then
+dnl HAVE_GETSERVBYNAME_R will be defined.
+
+AC_DEFUN([CARES_CHECK_FUNC_GETSERVBYNAME_R], [
+ AC_REQUIRE([CARES_INCLUDES_NETDB])dnl
+ #
+ tst_links_getservbyname_r="unknown"
+ tst_proto_getservbyname_r="unknown"
+ tst_compi_getservbyname_r="unknown"
+ tst_allow_getservbyname_r="unknown"
+ tst_nargs_getservbyname_r="unknown"
+ #
+ AC_MSG_CHECKING([if getservbyname_r can be linked])
+ AC_LINK_IFELSE([
+ AC_LANG_FUNC_LINK_TRY([getservbyname_r])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_links_getservbyname_r="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_links_getservbyname_r="no"
+ ])
+ #
+ if test "$tst_links_getservbyname_r" = "yes"; then
+ AC_MSG_CHECKING([if getservbyname_r is prototyped])
+ AC_EGREP_CPP([getservbyname_r],[
+ $cares_includes_netdb
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_proto_getservbyname_r="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_proto_getservbyname_r="no"
+ ])
+ fi
+ #
+ if test "$tst_proto_getservbyname_r" = "yes"; then
+ if test "$tst_nargs_getservbyname_r" = "unknown"; then
+ AC_MSG_CHECKING([if getservbyname_r takes 4 args.])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $cares_includes_netdb
+ ]],[[
+ if(0 != getservbyname_r(0, 0, 0, 0))
+ return 1;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_compi_getservbyname_r="yes"
+ tst_nargs_getservbyname_r="4"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_compi_getservbyname_r="no"
+ ])
+ fi
+ if test "$tst_nargs_getservbyname_r" = "unknown"; then
+ AC_MSG_CHECKING([if getservbyname_r takes 5 args.])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $cares_includes_netdb
+ ]],[[
+ if(0 != getservbyname_r(0, 0, 0, 0, 0))
+ return 1;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_compi_getservbyname_r="yes"
+ tst_nargs_getservbyname_r="5"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_compi_getservbyname_r="no"
+ ])
+ fi
+ if test "$tst_nargs_getservbyname_r" = "unknown"; then
+ AC_MSG_CHECKING([if getservbyname_r takes 6 args.])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $cares_includes_netdb
+ ]],[[
+ if(0 != getservbyname_r(0, 0, 0, 0, 0, 0))
+ return 1;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_compi_getservbyname_r="yes"
+ tst_nargs_getservbyname_r="6"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_compi_getservbyname_r="no"
+ ])
+ fi
+ AC_MSG_CHECKING([if getservbyname_r is compilable])
+ if test "$tst_compi_getservbyname_r" = "yes"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ #
+ if test "$tst_compi_getservbyname_r" = "yes"; then
+ AC_MSG_CHECKING([if getservbyname_r usage allowed])
+ if test "x$cares_disallow_getservbyname_r" != "xyes"; then
+ AC_MSG_RESULT([yes])
+ tst_allow_getservbyname_r="yes"
+ else
+ AC_MSG_RESULT([no])
+ tst_allow_getservbyname_r="no"
+ fi
+ fi
+ #
+ AC_MSG_CHECKING([if getservbyname_r might be used])
+ if test "$tst_links_getservbyname_r" = "yes" &&
+ test "$tst_proto_getservbyname_r" = "yes" &&
+ test "$tst_compi_getservbyname_r" = "yes" &&
+ test "$tst_allow_getservbyname_r" = "yes"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE_UNQUOTED(HAVE_GETSERVBYNAME_R, 1,
+ [Define to 1 if you have the getservbyname_r function.])
+ AC_DEFINE_UNQUOTED(GETSERVBYNAME_R_ARGS, $tst_nargs_getservbyname_r,
+ [Specifies the number of arguments to getservbyname_r])
+ if test "$tst_nargs_getservbyname_r" -eq "4"; then
+ AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, sizeof(struct servent_data),
+ [Specifies the size of the buffer to pass to getservbyname_r])
+ else
+ AC_DEFINE(GETSERVBYNAME_R_BUFSIZE, 4096,
+ [Specifies the size of the buffer to pass to getservbyname_r])
+ fi
+ ac_cv_func_getservbyname_r="yes"
+ else
+ AC_MSG_RESULT([no])
+ ac_cv_func_getservbyname_r="no"
+ fi
+])
+
+
dnl CARES_CHECK_FUNC_INET_NET_PTON
dnl -------------------------------------------------
dnl Verify if inet_net_pton is available, prototyped, can
diff --git a/grpc/third_party/cares/cares/m4/xc-cc-check.m4 b/grpc/third_party/cares/cares/m4/xc-cc-check.m4
index cd554053..777decf2 100644
--- a/grpc/third_party/cares/cares/m4/xc-cc-check.m4
+++ b/grpc/third_party/cares/cares/m4/xc-cc-check.m4
@@ -59,7 +59,7 @@ dnl Private macro.
AC_DEFUN([_XC_PROG_CC], [
AC_REQUIRE([_XC_PROG_CC_PREAMBLE])dnl
- AC_REQUIRE([XC_CHECK_USER_FLAGS])dnl
+ AC_REQUIRE([XC_CHECK_BUILD_FLAGS])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AM_PROG_CC_C_O])dnl
diff --git a/grpc/third_party/cares/cares/maketgz b/grpc/third_party/cares/cares/maketgz
index 684dd832..ec1ecea5 100755
--- a/grpc/third_party/cares/cares/maketgz
+++ b/grpc/third_party/cares/cares/maketgz
@@ -7,7 +7,7 @@ if($version eq "") {
exit;
}
-if(!-f "ares.h") {
+if(!-f "include/ares.h") {
print "run this script in the ares source root dir\n";
exit;
}
@@ -18,9 +18,9 @@ $major += 0;
$minor += 0;
$patch += 0;
-open(VER, "<ares_version.h") ||
- die "can't open ares_version.h";
-open(NEWV, ">ares_version.h.dist");
+open(VER, "<include/ares_version.h") ||
+ die "can't open include/ares_version.h";
+open(NEWV, ">include/ares_version.h.dist");
while(<VER>) {
$_ =~ s/^\#define ARES_VERSION_MAJOR .*/\#define ARES_VERSION_MAJOR $major/;
$_ =~ s/^\#define ARES_VERSION_MINOR .*/\#define ARES_VERSION_MINOR $minor/;
@@ -31,7 +31,7 @@ while(<VER>) {
}
close(VER);
close(NEWV);
-print "ares_version.h.dist created\n";
+print "include/ares_version.h.dist created\n";
if(!-f "configure") {
print "running buildconf\n";
@@ -64,6 +64,6 @@ print "running make dist\n";
print "removing temporary configure.ac file\n";
`rm configure.ac.dist`;
print "removing temporary ares_version.h file\n";
-`rm ares_version.h.dist`;
+`rm include/ares_version.h.dist`;
print "NOTE: now tag this release!\n";
diff --git a/grpc/third_party/cares/cares/nameser.h b/grpc/third_party/cares/cares/nameser.h
deleted file mode 100644
index a0302fd3..00000000
--- a/grpc/third_party/cares/cares/nameser.h
+++ /dev/null
@@ -1,211 +0,0 @@
-
-#ifndef ARES_NAMESER_H
-#define ARES_NAMESER_H
-
-/* header file provided by liren@vivisimo.com */
-
-#ifndef HAVE_ARPA_NAMESER_H
-
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 256 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT16SZ 2
-#define NS_INADDRSZ 4
-#define NS_IN6ADDRSZ 16
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-typedef enum __ns_class {
- ns_c_invalid = 0, /* Cookie. */
- ns_c_in = 1, /* Internet. */
- ns_c_2 = 2, /* unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-typedef enum __ns_type {
- ns_t_invalid = 0, /* Cookie. */
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- ns_t_kx = 36, /* Key Exchange */
- ns_t_cert = 37, /* Certification record */
- ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
- ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
- ns_t_sink = 40, /* Kitchen sink (experimentatl) */
- ns_t_opt = 41, /* EDNS0 option (meta-RR) */
- ns_t_apl = 42, /* Address prefix list (RFC3123) */
- ns_t_ds = 43, /* Delegation Signer (RFC4034) */
- ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */
- ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */
- ns_t_nsec = 47, /* Next Secure (RFC4034) */
- ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */
- ns_t_tkey = 249, /* Transaction key */
- ns_t_tsig = 250, /* Transaction signature. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
- ns_t_max = 65536
-} ns_type;
-
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11,
- /* The following are TSIG extended errors */
- ns_r_badsig = 16,
- ns_r_badkey = 17,
- ns_r_badtime = 18
-} ns_rcode;
-
-#endif /* HAVE_ARPA_NAMESER_H */
-
-#ifndef HAVE_ARPA_NAMESER_COMPAT_H
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define QUERY ns_o_query
-
-#define SERVFAIL ns_r_servfail
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#undef NOERROR /* it seems this is already defined in winerror.h */
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define NXDOMAIN ns_r_nxdomain
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_KX ns_t_kx
-#define T_CERT ns_t_cert
-#define T_A6 ns_t_a6
-#define T_DNAME ns_t_dname
-#define T_SINK ns_t_sink
-#define T_OPT ns_t_opt
-#define T_APL ns_t_apl
-#define T_DS ns_t_ds
-#define T_SSHFP ns_t_sshfp
-#define T_RRSIG ns_t_rrsig
-#define T_NSEC ns_t_nsec
-#define T_DNSKEY ns_t_dnskey
-#define T_TKEY ns_t_tkey
-#define T_TSIG ns_t_tsig
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#endif /* HAVE_ARPA_NAMESER_COMPAT_H */
-
-#endif /* ARES_NAMESER_H */
diff --git a/grpc/third_party/cares/cares/src/CMakeLists.txt b/grpc/third_party/cares/cares/src/CMakeLists.txt
new file mode 100644
index 00000000..6750c178
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/CMakeLists.txt
@@ -0,0 +1,2 @@
+ADD_SUBDIRECTORY (lib)
+ADD_SUBDIRECTORY (tools)
diff --git a/grpc/third_party/cares/cares/src/Makefile.am b/grpc/third_party/cares/cares/src/Makefile.am
new file mode 100644
index 00000000..2e97e422
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST=CMakeLists.txt
+SUBDIRS=lib tools
diff --git a/grpc/third_party/cares/cares/src/lib/CMakeLists.txt b/grpc/third_party/cares/cares/src/lib/CMakeLists.txt
new file mode 100644
index 00000000..7d37be21
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/CMakeLists.txt
@@ -0,0 +1,115 @@
+
+# Transform Makefile.inc
+transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake")
+include(${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake)
+
+# Write ares_config.h configuration file. This is used only for the build.
+CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
+
+# Build the dynamic/shared library
+IF (CARES_SHARED)
+ ADD_LIBRARY (${PROJECT_NAME} SHARED ${CSOURCES})
+
+ # Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION
+ # Convert from ":" separated into CMake list format using ";"
+ STRING (REPLACE ":" ";" CARES_LIB_VERSIONINFO ${CARES_LIB_VERSIONINFO})
+ LIST (GET CARES_LIB_VERSIONINFO 0 CARES_LIB_VERSION_CURRENT)
+ LIST (GET CARES_LIB_VERSIONINFO 1 CARES_LIB_VERSION_REVISION)
+ LIST (GET CARES_LIB_VERSIONINFO 2 CARES_LIB_VERSION_AGE)
+ MATH (EXPR CARES_LIB_VERSION_MAJOR "${CARES_LIB_VERSION_CURRENT} - ${CARES_LIB_VERSION_AGE}")
+ SET (CARES_LIB_VERSION_MINOR "${CARES_LIB_VERSION_AGE}")
+ SET (CARES_LIB_VERSION_RELEASE "${CARES_LIB_VERSION_REVISION}")
+
+ SET_TARGET_PROPERTIES (${PROJECT_NAME} PROPERTIES
+ EXPORT_NAME cares
+ OUTPUT_NAME cares
+ COMPILE_PDB_NAME cares
+ COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ SOVERSION ${CARES_LIB_VERSION_MAJOR}
+ VERSION "${CARES_LIB_VERSION_MAJOR}.${CARES_LIB_VERSION_MINOR}.${CARES_LIB_VERSION_RELEASE}"
+ )
+
+ TARGET_INCLUDE_DIRECTORIES (${PROJECT_NAME}
+ PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+ "$<BUILD_INTERFACE:${CARES_TOPLEVEL_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+
+ TARGET_COMPILE_DEFINITIONS (${PROJECT_NAME} PRIVATE HAVE_CONFIG_H=1 CARES_BUILDING_LIBRARY)
+
+ TARGET_LINK_LIBRARIES (${PROJECT_NAME} PUBLIC ${CARES_DEPENDENT_LIBS})
+
+ IF (CARES_INSTALL)
+ INSTALL (TARGETS ${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-targets
+ COMPONENT Library
+ ${TARGETS_INST_DEST}
+ )
+ INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cares.pdb
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT Library
+ OPTIONAL
+ )
+ ENDIF ()
+ SET (STATIC_SUFFIX "_static")
+
+ # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares).
+ ADD_LIBRARY (${PROJECT_NAME}::cares_shared ALIAS ${PROJECT_NAME})
+ ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${PROJECT_NAME})
+ENDIF ()
+
+# Build the static library
+IF (CARES_STATIC)
+ SET (LIBNAME ${PROJECT_NAME}${STATIC_SUFFIX})
+
+ ADD_LIBRARY (${LIBNAME} STATIC ${CSOURCES})
+
+ SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES
+ EXPORT_NAME cares${STATIC_SUFFIX}
+ OUTPUT_NAME cares${STATIC_SUFFIX}
+ COMPILE_PDB_NAME cares${STATIC_SUFFIX}
+ COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ )
+
+ IF (CARES_STATIC_PIC)
+ SET_TARGET_PROPERTIES (${LIBNAME} PROPERTIES POSITION_INDEPENDENT_CODE True)
+ ENDIF ()
+
+ TARGET_INCLUDE_DIRECTORIES (${LIBNAME}
+ PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+ "$<BUILD_INTERFACE:${CARES_TOPLEVEL_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+
+ TARGET_COMPILE_DEFINITIONS (${LIBNAME}
+ PUBLIC CARES_STATICLIB
+ PRIVATE HAVE_CONFIG_H=1
+ )
+
+ TARGET_LINK_LIBRARIES (${LIBNAME} PUBLIC ${CARES_DEPENDENT_LIBS})
+ IF (CARES_INSTALL)
+ INSTALL (TARGETS ${LIBNAME} EXPORT ${PROJECT_NAME}-targets COMPONENT Devel
+ ${TARGETS_INST_DEST}
+ )
+ INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cares${STATIC_SUFFIX}.pdb
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT Library
+ OPTIONAL
+ )
+ ENDIF ()
+
+ # For chain building: add alias targets that look like import libs that would be returned by find_package(c-ares).
+ ADD_LIBRARY (${PROJECT_NAME}::cares_static ALIAS ${LIBNAME})
+ IF (NOT TARGET ${PROJECT_NAME}::cares)
+ # Only use static for the generic alias if shared lib wasn't built.
+ ADD_LIBRARY (${PROJECT_NAME}::cares ALIAS ${LIBNAME})
+ ENDIF ()
+ENDIF ()
+
+
+
+
diff --git a/grpc/third_party/cares/cares/src/lib/Makefile.am b/grpc/third_party/cares/cares/src/lib/Makefile.am
new file mode 100644
index 00000000..0a73d7aa
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/Makefile.am
@@ -0,0 +1,73 @@
+AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6
+ACLOCAL_AMFLAGS = -I m4 --install
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+
+AM_CPPFLAGS = -I$(top_builddir)/include \
+ -I$(top_builddir)/src/lib \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/lib
+
+lib_LTLIBRARIES = libcares.la
+
+man_MANS = $(MANPAGES)
+
+# adig and ahost are just sample programs and thus not mentioned with the
+# regular sources and headers
+EXTRA_DIST = Makefile.inc config-win32.h CMakeLists.txt \
+ ares_config.h.in ares_config.h.cmake cares.rc \
+ $(CSOURCES) $(HHEADERS) config-dos.h
+
+DISTCLEANFILES = ares_config.h
+
+DIST_SUBDIRS =
+
+AM_LDFLAGS =
+
+libcares_la_LDFLAGS_EXTRA =
+
+if CARES_LT_SHLIB_USE_VERSION_INFO
+libcares_la_LDFLAGS_EXTRA += -version-info @CARES_VERSION_INFO@
+endif
+
+if CARES_LT_SHLIB_USE_NO_UNDEFINED
+libcares_la_LDFLAGS_EXTRA += -no-undefined
+endif
+
+if CARES_LT_SHLIB_USE_MIMPURE_TEXT
+libcares_la_LDFLAGS_EXTRA += -mimpure-text
+endif
+
+libcares_la_LDFLAGS = $(AM_LDFLAGS) $(libcares_la_LDFLAGS_EXTRA)
+
+# Add -Werror if defined
+CFLAGS += @CARES_CFLAG_EXTRAS@
+
+if USE_CPPFLAG_CARES_STATICLIB
+AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB)
+endif
+
+libcares_la_CFLAGS_EXTRA =
+
+libcares_la_CPPFLAGS_EXTRA = -DCARES_BUILDING_LIBRARY
+
+if DOING_CARES_SYMBOL_HIDING
+libcares_la_CFLAGS_EXTRA += $(CFLAG_CARES_SYMBOL_HIDING)
+libcares_la_CPPFLAGS_EXTRA += -DCARES_SYMBOL_HIDING
+endif
+
+@CODE_COVERAGE_RULES@
+libcares_la_LDFLAGS += $(CODE_COVERAGE_LDFLAGS)
+libcares_la_CFLAGS_EXTRA += $(CODE_COVERAGE_CFLAGS)
+
+libcares_la_CFLAGS = $(AM_CFLAGS) $(libcares_la_CFLAGS_EXTRA)
+
+libcares_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcares_la_CPPFLAGS_EXTRA)
+
+# Makefile.inc provides the CSOURCES and HHEADERS defines
+include Makefile.inc
+
+libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
diff --git a/grpc/third_party/cares/cares/src/lib/Makefile.inc b/grpc/third_party/cares/cares/src/lib/Makefile.inc
new file mode 100644
index 00000000..51be62cb
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/Makefile.inc
@@ -0,0 +1,79 @@
+
+CSOURCES = ares__close_sockets.c \
+ ares__get_hostent.c \
+ ares__parse_into_addrinfo.c \
+ ares__readaddrinfo.c \
+ ares__sortaddrinfo.c \
+ ares__read_line.c \
+ ares__timeval.c \
+ ares_android.c \
+ ares_cancel.c \
+ ares_data.c \
+ ares_destroy.c \
+ ares_expand_name.c \
+ ares_expand_string.c \
+ ares_fds.c \
+ ares_free_hostent.c \
+ ares_free_string.c \
+ ares_freeaddrinfo.c \
+ ares_getaddrinfo.c \
+ ares_getenv.c \
+ ares_gethostbyaddr.c \
+ ares_gethostbyname.c \
+ ares_getnameinfo.c \
+ ares_getsock.c \
+ ares_init.c \
+ ares_library_init.c \
+ ares_llist.c \
+ ares_mkquery.c \
+ ares_create_query.c \
+ ares_nowarn.c \
+ ares_options.c \
+ ares_parse_a_reply.c \
+ ares_parse_aaaa_reply.c \
+ ares_parse_caa_reply.c \
+ ares_parse_mx_reply.c \
+ ares_parse_naptr_reply.c \
+ ares_parse_ns_reply.c \
+ ares_parse_ptr_reply.c \
+ ares_parse_soa_reply.c \
+ ares_parse_srv_reply.c \
+ ares_parse_txt_reply.c \
+ ares_platform.c \
+ ares_process.c \
+ ares_query.c \
+ ares_search.c \
+ ares_send.c \
+ ares_strcasecmp.c \
+ ares_strdup.c \
+ ares_strerror.c \
+ ares_strsplit.c \
+ ares_timeout.c \
+ ares_version.c \
+ ares_writev.c \
+ bitncmp.c \
+ inet_net_pton.c \
+ inet_ntop.c \
+ windows_port.c
+
+HHEADERS = ares_android.h \
+ ares_data.h \
+ ares_getenv.h \
+ ares_inet_net_pton.h \
+ ares_iphlpapi.h \
+ ares_ipv6.h \
+ ares_library_init.h \
+ ares_llist.h \
+ ares_nowarn.h \
+ ares_platform.h \
+ ares_private.h \
+ ares_strcasecmp.h \
+ ares_strdup.h \
+ ares_strsplit.h \
+ ares_writev.h \
+ bitncmp.h \
+ ares_nameser.h \
+ ares_setup.h \
+ setup_once.h
+
+
diff --git a/grpc/third_party/cares/cares/src/lib/ares__close_sockets.c b/grpc/third_party/cares/cares/src/lib/ares__close_sockets.c
new file mode 100644
index 00000000..0477174e
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares__close_sockets.c
@@ -0,0 +1,61 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#include "ares.h"
+#include "ares_private.h"
+
+void ares__close_sockets(ares_channel channel, struct server_state *server)
+{
+ struct send_request *sendreq;
+
+ /* Free all pending output buffers. */
+ while (server->qhead)
+ {
+ /* Advance server->qhead; pull out query as we go. */
+ sendreq = server->qhead;
+ server->qhead = sendreq->next;
+ if (sendreq->data_storage != NULL)
+ ares_free(sendreq->data_storage);
+ ares_free(sendreq);
+ }
+ server->qtail = NULL;
+
+ /* Reset any existing input buffer. */
+ if (server->tcp_buffer)
+ ares_free(server->tcp_buffer);
+ server->tcp_buffer = NULL;
+ server->tcp_lenbuf_pos = 0;
+
+ /* Reset brokenness */
+ server->is_broken = 0;
+
+ /* Close the TCP and UDP sockets. */
+ if (server->tcp_socket != ARES_SOCKET_BAD)
+ {
+ SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
+ ares__close_socket(channel, server->tcp_socket);
+ server->tcp_socket = ARES_SOCKET_BAD;
+ server->tcp_connection_generation = ++channel->tcp_connection_generation;
+ }
+ if (server->udp_socket != ARES_SOCKET_BAD)
+ {
+ SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
+ ares__close_socket(channel, server->udp_socket);
+ server->udp_socket = ARES_SOCKET_BAD;
+ }
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares__get_hostent.c b/grpc/third_party/cares/cares/src/lib/ares__get_hostent.c
new file mode 100644
index 00000000..367f3903
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares__get_hostent.c
@@ -0,0 +1,260 @@
+
+/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares.h"
+#include "ares_inet_net_pton.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+int ares__get_hostent(FILE *fp, int family, struct hostent **host)
+{
+ char *line = NULL, *p, *q, **alias;
+ char *txtaddr, *txthost, *txtalias;
+ int status;
+ size_t addrlen, linesize, naliases;
+ struct ares_addr addr;
+ struct hostent *hostent = NULL;
+
+ *host = NULL; /* Assume failure */
+
+ /* Validate family */
+ switch (family) {
+ case AF_INET:
+ case AF_INET6:
+ case AF_UNSPEC:
+ break;
+ default:
+ return ARES_EBADFAMILY;
+ }
+
+ while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
+ {
+
+ /* Trim line comment. */
+ p = line;
+ while (*p && (*p != '#'))
+ p++;
+ *p = '\0';
+
+ /* Trim trailing whitespace. */
+ q = p - 1;
+ while ((q >= line) && ISSPACE(*q))
+ q--;
+ *++q = '\0';
+
+ /* Skip leading whitespace. */
+ p = line;
+ while (*p && ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if empty. */
+ continue;
+
+ /* Pointer to start of IPv4 or IPv6 address part. */
+ txtaddr = p;
+
+ /* Advance past address part. */
+ while (*p && !ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if reached end of line. */
+ continue;
+
+ /* Null terminate address part. */
+ *p = '\0';
+
+ /* Advance to host name */
+ p++;
+ while (*p && ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if reached end of line. */
+ continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */
+
+ /* Pointer to start of host name. */
+ txthost = p;
+
+ /* Advance past host name. */
+ while (*p && !ISSPACE(*p))
+ p++;
+
+ /* Pointer to start of first alias. */
+ txtalias = NULL;
+ if (*p)
+ {
+ q = p + 1;
+ while (*q && ISSPACE(*q))
+ q++;
+ if (*q)
+ txtalias = q;
+ }
+
+ /* Null terminate host name. */
+ *p = '\0';
+
+ /* find out number of aliases. */
+ naliases = 0;
+ if (txtalias)
+ {
+ p = txtalias;
+ while (*p)
+ {
+ while (*p && !ISSPACE(*p))
+ p++;
+ while (*p && ISSPACE(*p))
+ p++;
+ naliases++;
+ }
+ }
+
+ /* Convert address string to network address for the requested family. */
+ addrlen = 0;
+ addr.family = AF_UNSPEC;
+ addr.addrV4.s_addr = INADDR_NONE;
+ if ((family == AF_INET) || (family == AF_UNSPEC))
+ {
+ if (ares_inet_pton(AF_INET, txtaddr, &addr.addrV4) > 0)
+ {
+ /* Actual network address family and length. */
+ addr.family = AF_INET;
+ addrlen = sizeof(addr.addrV4);
+ }
+ }
+ if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
+ {
+ if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0)
+ {
+ /* Actual network address family and length. */
+ addr.family = AF_INET6;
+ addrlen = sizeof(addr.addrV6);
+ }
+ }
+ if (!addrlen)
+ /* Ignore line if invalid address string for the requested family. */
+ continue;
+
+ /*
+ ** Actual address family possible values are AF_INET and AF_INET6 only.
+ */
+
+ /* Allocate memory for the hostent structure. */
+ hostent = ares_malloc(sizeof(struct hostent));
+ if (!hostent)
+ break;
+
+ /* Initialize fields for out of memory condition. */
+ hostent->h_aliases = NULL;
+ hostent->h_addr_list = NULL;
+
+ /* Copy official host name. */
+ hostent->h_name = ares_strdup(txthost);
+ if (!hostent->h_name)
+ break;
+
+ /* Copy network address. */
+ hostent->h_addr_list = ares_malloc(2 * sizeof(char *));
+ if (!hostent->h_addr_list)
+ break;
+ hostent->h_addr_list[1] = NULL;
+ hostent->h_addr_list[0] = ares_malloc(addrlen);
+ if (!hostent->h_addr_list[0])
+ break;
+ if (addr.family == AF_INET)
+ memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4));
+ else
+ memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6));
+
+ /* Copy aliases. */
+ hostent->h_aliases = ares_malloc((naliases + 1) * sizeof(char *));
+ if (!hostent->h_aliases)
+ break;
+ alias = hostent->h_aliases;
+ while (naliases)
+ *(alias + naliases--) = NULL;
+ *alias = NULL;
+ while (txtalias)
+ {
+ p = txtalias;
+ while (*p && !ISSPACE(*p))
+ p++;
+ q = p;
+ while (*q && ISSPACE(*q))
+ q++;
+ *p = '\0';
+ if ((*alias = ares_strdup(txtalias)) == NULL)
+ break;
+ alias++;
+ txtalias = *q ? q : NULL;
+ }
+ if (txtalias)
+ /* Alias memory allocation failure. */
+ break;
+
+ /* Copy actual network address family and length. */
+ hostent->h_addrtype = aresx_sitoss(addr.family);
+ hostent->h_length = aresx_uztoss(addrlen);
+
+ /* Free line buffer. */
+ ares_free(line);
+
+ /* Return hostent successfully */
+ *host = hostent;
+ return ARES_SUCCESS;
+
+ }
+
+ /* If allocated, free line buffer. */
+ if (line)
+ ares_free(line);
+
+ if (status == ARES_SUCCESS)
+ {
+ /* Memory allocation failure; clean up. */
+ if (hostent)
+ {
+ if (hostent->h_name)
+ ares_free((char *) hostent->h_name);
+ if (hostent->h_aliases)
+ {
+ for (alias = hostent->h_aliases; *alias; alias++)
+ ares_free(*alias);
+ ares_free(hostent->h_aliases);
+ }
+ if (hostent->h_addr_list)
+ {
+ if (hostent->h_addr_list[0])
+ ares_free(hostent->h_addr_list[0]);
+ ares_free(hostent->h_addr_list);
+ }
+ ares_free(hostent);
+ }
+ return ARES_ENOMEM;
+ }
+
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c b/grpc/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c
new file mode 100644
index 00000000..7550abab
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c
@@ -0,0 +1,260 @@
+/* Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+int ares__parse_into_addrinfo2(const unsigned char *abuf,
+ int alen,
+ char **question_hostname,
+ struct ares_addrinfo *ai)
+{
+ unsigned int qdcount, ancount;
+ int status, i, rr_type, rr_class, rr_len, rr_ttl;
+ int got_a = 0, got_aaaa = 0, got_cname = 0;
+ long len;
+ const unsigned char *aptr;
+ char *hostname, *rr_name = NULL, *rr_data;
+ struct ares_addrinfo_cname *cname, *cnames = NULL;
+ struct ares_addrinfo_node *node, *nodes = NULL;
+ struct sockaddr_in *sin;
+ struct sockaddr_in6 *sin6;
+
+ *question_hostname = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares__expand_name_for_response(aptr, abuf, alen, question_hostname, &len, 0);
+ if (status != ARES_SUCCESS)
+ return status;
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ return ARES_EBADRESP;
+ }
+
+ hostname = *question_hostname;
+
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < (int)ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len, 0);
+ if (status != ARES_SUCCESS)
+ {
+ rr_name = NULL;
+ goto failed_stat;
+ }
+
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ }
+ rr_type = DNS_RR_TYPE(aptr);
+ rr_class = DNS_RR_CLASS(aptr);
+ rr_len = DNS_RR_LEN(aptr);
+ rr_ttl = DNS_RR_TTL(aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ }
+
+ if (rr_class == C_IN && rr_type == T_A
+ && rr_len == sizeof(struct in_addr)
+ && strcasecmp(rr_name, hostname) == 0)
+ {
+ got_a = 1;
+ if (aptr + sizeof(struct in_addr) > abuf + alen)
+ { /* LCOV_EXCL_START: already checked above */
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ } /* LCOV_EXCL_STOP */
+
+ node = ares__append_addrinfo_node(&nodes);
+ if (!node)
+ {
+ status = ARES_ENOMEM;
+ goto failed_stat;
+ }
+
+ sin = ares_malloc(sizeof(struct sockaddr_in));
+ if (!sin)
+ {
+ status = ARES_ENOMEM;
+ goto failed_stat;
+ }
+ memset(sin, 0, sizeof(struct sockaddr_in));
+ memcpy(&sin->sin_addr.s_addr, aptr, sizeof(struct in_addr));
+ sin->sin_family = AF_INET;
+
+ node->ai_addr = (struct sockaddr *)sin;
+ node->ai_family = AF_INET;
+ node->ai_addrlen = sizeof(struct sockaddr_in);
+
+ node->ai_ttl = rr_ttl;
+
+ status = ARES_SUCCESS;
+ }
+ else if (rr_class == C_IN && rr_type == T_AAAA
+ && rr_len == sizeof(struct ares_in6_addr)
+ && strcasecmp(rr_name, hostname) == 0)
+ {
+ got_aaaa = 1;
+ if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
+ { /* LCOV_EXCL_START: already checked above */
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ } /* LCOV_EXCL_STOP */
+
+ node = ares__append_addrinfo_node(&nodes);
+ if (!node)
+ {
+ status = ARES_ENOMEM;
+ goto failed_stat;
+ }
+
+ sin6 = ares_malloc(sizeof(struct sockaddr_in6));
+ if (!sin6)
+ {
+ status = ARES_ENOMEM;
+ goto failed_stat;
+ }
+
+ memset(sin6, 0, sizeof(struct sockaddr_in6));
+ memcpy(&sin6->sin6_addr.s6_addr, aptr, sizeof(struct ares_in6_addr));
+ sin6->sin6_family = AF_INET6;
+
+ node->ai_addr = (struct sockaddr *)sin6;
+ node->ai_family = AF_INET6;
+ node->ai_addrlen = sizeof(struct sockaddr_in6);
+
+ node->ai_ttl = rr_ttl;
+
+ status = ARES_SUCCESS;
+ }
+
+ if (rr_class == C_IN && rr_type == T_CNAME)
+ {
+ got_cname = 1;
+ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
+ &len, 1);
+ if (status != ARES_SUCCESS)
+ {
+ goto failed_stat;
+ }
+
+ /* Decode the RR data and replace the hostname with it. */
+ /* SA: Seems wrong as it introduses order dependency. */
+ hostname = rr_data;
+
+ cname = ares__append_addrinfo_cname(&cnames);
+ if (!cname)
+ {
+ status = ARES_ENOMEM;
+ ares_free(rr_data);
+ goto failed_stat;
+ }
+ cname->ttl = rr_ttl;
+ cname->alias = rr_name;
+ cname->name = rr_data;
+ }
+ else
+ {
+ ares_free(rr_name);
+ }
+
+
+ aptr += rr_len;
+ if (aptr > abuf + alen)
+ { /* LCOV_EXCL_START: already checked above */
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ } /* LCOV_EXCL_STOP */
+ }
+
+ if (status == ARES_SUCCESS)
+ {
+ ares__addrinfo_cat_nodes(&ai->nodes, nodes);
+ if (got_cname)
+ {
+ ares__addrinfo_cat_cnames(&ai->cnames, cnames);
+ return status;
+ }
+ else if (got_a == 0 && got_aaaa == 0)
+ {
+ /* the check for naliases to be zero is to make sure CNAME responses
+ don't get caught here */
+ status = ARES_ENODATA;
+ }
+ }
+
+ return status;
+
+failed_stat:
+ ares_free(rr_name);
+ ares__freeaddrinfo_cnames(cnames);
+ ares__freeaddrinfo_nodes(nodes);
+ return status;
+}
+
+int ares__parse_into_addrinfo(const unsigned char *abuf,
+ int alen,
+ struct ares_addrinfo *ai)
+{
+ int status;
+ char *question_hostname;
+ status = ares__parse_into_addrinfo2(abuf, alen, &question_hostname, ai);
+ ares_free(question_hostname);
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/ares__read_line.c b/grpc/third_party/cares/cares/src/lib/ares__read_line.c
index c62ad2a2..c62ad2a2 100644
--- a/grpc/third_party/cares/cares/ares__read_line.c
+++ b/grpc/third_party/cares/cares/src/lib/ares__read_line.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares__readaddrinfo.c b/grpc/third_party/cares/cares/src/lib/ares__readaddrinfo.c
new file mode 100644
index 00000000..2b5bb40c
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares__readaddrinfo.c
@@ -0,0 +1,264 @@
+/* Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares.h"
+#include "ares_inet_net_pton.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+#define MAX_ALIASES 40
+
+int ares__readaddrinfo(FILE *fp,
+ const char *name,
+ unsigned short port,
+ const struct ares_addrinfo_hints *hints,
+ struct ares_addrinfo *ai)
+{
+ char *line = NULL, *p, *q;
+ char *txtaddr, *txthost, *txtalias;
+ char *aliases[MAX_ALIASES];
+ unsigned int i, alias_count;
+ int status;
+ size_t linesize;
+ ares_sockaddr addr;
+ struct ares_addrinfo_cname *cname = NULL, *cnames = NULL;
+ struct ares_addrinfo_node *node = NULL, *nodes = NULL;
+ int match_with_alias, match_with_canonical;
+ int want_cname = hints->ai_flags & ARES_AI_CANONNAME;
+
+ /* Validate family */
+ switch (hints->ai_family) {
+ case AF_INET:
+ case AF_INET6:
+ case AF_UNSPEC:
+ break;
+ default:
+ return ARES_EBADFAMILY;
+ }
+
+
+ while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
+ {
+ match_with_alias = 0;
+ match_with_canonical = 0;
+ alias_count = 0;
+ /* Trim line comment. */
+ p = line;
+ while (*p && (*p != '#'))
+ p++;
+ *p = '\0';
+
+ /* Trim trailing whitespace. */
+ q = p - 1;
+ while ((q >= line) && ISSPACE(*q))
+ q--;
+ *++q = '\0';
+
+ /* Skip leading whitespace. */
+ p = line;
+ while (*p && ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if empty. */
+ continue;
+
+ /* Pointer to start of IPv4 or IPv6 address part. */
+ txtaddr = p;
+
+ /* Advance past address part. */
+ while (*p && !ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if reached end of line. */
+ continue;
+
+ /* Null terminate address part. */
+ *p = '\0';
+
+ /* Advance to host name */
+ p++;
+ while (*p && ISSPACE(*p))
+ p++;
+ if (!*p)
+ /* Ignore line if reached end of line. */
+ continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */
+
+ /* Pointer to start of host name. */
+ txthost = p;
+
+ /* Advance past host name. */
+ while (*p && !ISSPACE(*p))
+ p++;
+
+ /* Pointer to start of first alias. */
+ txtalias = NULL;
+ if (*p)
+ {
+ q = p + 1;
+ while (*q && ISSPACE(*q))
+ q++;
+ if (*q)
+ txtalias = q;
+ }
+
+ /* Null terminate host name. */
+ *p = '\0';
+
+ /* Find out if host name matches with canonical host name. */
+ if (strcasecmp(txthost, name) == 0)
+ {
+ match_with_canonical = 1;
+ }
+
+ /* Find out if host name matches with one of the aliases. */
+ while (txtalias)
+ {
+ p = txtalias;
+ while (*p && !ISSPACE(*p))
+ p++;
+ q = p;
+ while (*q && ISSPACE(*q))
+ q++;
+ *p = '\0';
+ if (strcasecmp(txtalias, name) == 0)
+ {
+ match_with_alias = 1;
+ if (!want_cname)
+ break;
+ }
+ if (alias_count < MAX_ALIASES)
+ {
+ aliases[alias_count++] = txtalias;
+ }
+ txtalias = *q ? q : NULL;
+ }
+
+ /* Try next line if host does not match. */
+ if (!match_with_alias && !match_with_canonical)
+ {
+ continue;
+ }
+
+ /* Zero-out 'addr' struct, as there are members that we may not set, especially
+ * for ipv6. We don't want garbage data */
+ memset(&addr, 0, sizeof(addr));
+
+ /*
+ * Convert address string to network address for the requested families.
+ * Actual address family possible values are AF_INET and AF_INET6 only.
+ */
+ if ((hints->ai_family == AF_INET) || (hints->ai_family == AF_UNSPEC))
+ {
+ addr.sa4.sin_port = htons(port);
+ if (ares_inet_pton(AF_INET, txtaddr, &addr.sa4.sin_addr) > 0)
+ {
+ node = ares__append_addrinfo_node(&nodes);
+ if(!node)
+ {
+ goto enomem;
+ }
+
+ node->ai_family = addr.sa.sa_family = AF_INET;
+ node->ai_addrlen = sizeof(addr.sa4);
+ node->ai_addr = ares_malloc(sizeof(addr.sa4));
+ if (!node->ai_addr)
+ {
+ goto enomem;
+ }
+ memcpy(node->ai_addr, &addr.sa4, sizeof(addr.sa4));
+ }
+ }
+ if ((hints->ai_family == AF_INET6) || (hints->ai_family == AF_UNSPEC))
+ {
+ addr.sa6.sin6_port = htons(port);
+ if (ares_inet_pton(AF_INET6, txtaddr, &addr.sa6.sin6_addr) > 0)
+ {
+ node = ares__append_addrinfo_node(&nodes);
+ if (!node)
+ {
+ goto enomem;
+ }
+
+ node->ai_family = addr.sa.sa_family = AF_INET6;
+ node->ai_addrlen = sizeof(addr.sa6);
+ node->ai_addr = ares_malloc(sizeof(addr.sa6));
+ if (!node->ai_addr)
+ {
+ goto enomem;
+ }
+ memcpy(node->ai_addr, &addr.sa6, sizeof(addr.sa6));
+ }
+ }
+ if (!node)
+ /* Ignore line if invalid address string for the requested family. */
+ continue;
+
+ if (want_cname)
+ {
+ for (i = 0; i < alias_count; ++i)
+ {
+ cname = ares__append_addrinfo_cname(&cnames);
+ if (!cname)
+ {
+ goto enomem;
+ }
+ cname->alias = ares_strdup(aliases[i]);
+ cname->name = ares_strdup(txthost);
+ }
+ /* No aliases, cname only. */
+ if(!alias_count)
+ {
+ cname = ares__append_addrinfo_cname(&cnames);
+ if (!cname)
+ {
+ goto enomem;
+ }
+ cname->name = ares_strdup(txthost);
+ }
+ }
+ }
+
+ /* Last read failed. */
+ if (status == ARES_ENOMEM)
+ {
+ goto enomem;
+ }
+
+ /* Free line buffer. */
+ ares_free(line);
+
+ ares__addrinfo_cat_cnames(&ai->cnames, cnames);
+ ares__addrinfo_cat_nodes(&ai->nodes, nodes);
+
+ return node ? ARES_SUCCESS : ARES_ENOTFOUND;
+
+enomem:
+ ares_free(line);
+ ares__freeaddrinfo_cnames(cnames);
+ ares__freeaddrinfo_nodes(nodes);
+ return ARES_ENOMEM;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares__sortaddrinfo.c b/grpc/third_party/cares/cares/src/lib/ares__sortaddrinfo.c
new file mode 100644
index 00000000..6e56cc90
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares__sortaddrinfo.c
@@ -0,0 +1,499 @@
+/*
+ * Original file name getaddrinfo.c
+ * Lifted from the 'Android Bionic' project with the BSD license.
+ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2019 by Andrew Selivanov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include <assert.h>
+#include <limits.h>
+
+#include "ares.h"
+#include "ares_private.h"
+
+struct addrinfo_sort_elem
+{
+ struct ares_addrinfo_node *ai;
+ int has_src_addr;
+ ares_sockaddr src_addr;
+ int original_order;
+};
+
+#define ARES_IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
+
+#define ARES_IPV6_ADDR_SCOPE_NODELOCAL 0x01
+#define ARES_IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
+#define ARES_IPV6_ADDR_SCOPE_LINKLOCAL 0x02
+#define ARES_IPV6_ADDR_SCOPE_SITELOCAL 0x05
+#define ARES_IPV6_ADDR_SCOPE_ORGLOCAL 0x08
+#define ARES_IPV6_ADDR_SCOPE_GLOBAL 0x0e
+
+#define ARES_IN_LOOPBACK(a) ((((long int)(a)) & 0xff000000) == 0x7f000000)
+
+/* RFC 4193. */
+#define ARES_IN6_IS_ADDR_ULA(a) (((a)->s6_addr[0] & 0xfe) == 0xfc)
+
+/* These macros are modelled after the ones in <netinet/in6.h>. */
+/* RFC 4380, section 2.6 */
+#define ARES_IN6_IS_ADDR_TEREDO(a) \
+ ((*(const unsigned int *)(const void *)(&(a)->s6_addr[0]) == ntohl(0x20010000)))
+/* RFC 3056, section 2. */
+#define ARES_IN6_IS_ADDR_6TO4(a) \
+ (((a)->s6_addr[0] == 0x20) && ((a)->s6_addr[1] == 0x02))
+/* 6bone testing address area (3ffe::/16), deprecated in RFC 3701. */
+#define ARES_IN6_IS_ADDR_6BONE(a) \
+ (((a)->s6_addr[0] == 0x3f) && ((a)->s6_addr[1] == 0xfe))
+
+
+static int get_scope(const struct sockaddr *addr)
+{
+ if (addr->sa_family == AF_INET6)
+ {
+ const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr);
+ if (IN6_IS_ADDR_MULTICAST(&addr6->sin6_addr))
+ {
+ return ARES_IPV6_ADDR_MC_SCOPE(&addr6->sin6_addr);
+ }
+ else if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr) ||
+ IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr))
+ {
+ /*
+ * RFC 4291 section 2.5.3 says loopback is to be treated as having
+ * link-local scope.
+ */
+ return ARES_IPV6_ADDR_SCOPE_LINKLOCAL;
+ }
+ else if (IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr))
+ {
+ return ARES_IPV6_ADDR_SCOPE_SITELOCAL;
+ }
+ else
+ {
+ return ARES_IPV6_ADDR_SCOPE_GLOBAL;
+ }
+ }
+ else if (addr->sa_family == AF_INET)
+ {
+ const struct sockaddr_in *addr4 = CARES_INADDR_CAST(const struct sockaddr_in *, addr);
+ unsigned long int na = ntohl(addr4->sin_addr.s_addr);
+ if (ARES_IN_LOOPBACK(na) || /* 127.0.0.0/8 */
+ (na & 0xffff0000) == 0xa9fe0000) /* 169.254.0.0/16 */
+ {
+ return ARES_IPV6_ADDR_SCOPE_LINKLOCAL;
+ }
+ else
+ {
+ /*
+ * RFC 6724 section 3.2. Other IPv4 addresses, including private
+ * addresses and shared addresses (100.64.0.0/10), are assigned global
+ * scope.
+ */
+ return ARES_IPV6_ADDR_SCOPE_GLOBAL;
+ }
+ }
+ else
+ {
+ /*
+ * This should never happen.
+ * Return a scope with low priority as a last resort.
+ */
+ return ARES_IPV6_ADDR_SCOPE_NODELOCAL;
+ }
+}
+
+static int get_label(const struct sockaddr *addr)
+{
+ if (addr->sa_family == AF_INET)
+ {
+ return 4;
+ }
+ else if (addr->sa_family == AF_INET6)
+ {
+ const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr);
+ if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr))
+ {
+ return 0;
+ }
+ else if (IN6_IS_ADDR_V4MAPPED(&addr6->sin6_addr))
+ {
+ return 4;
+ }
+ else if (ARES_IN6_IS_ADDR_6TO4(&addr6->sin6_addr))
+ {
+ return 2;
+ }
+ else if (ARES_IN6_IS_ADDR_TEREDO(&addr6->sin6_addr))
+ {
+ return 5;
+ }
+ else if (ARES_IN6_IS_ADDR_ULA(&addr6->sin6_addr))
+ {
+ return 13;
+ }
+ else if (IN6_IS_ADDR_V4COMPAT(&addr6->sin6_addr))
+ {
+ return 3;
+ }
+ else if (IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr))
+ {
+ return 11;
+ }
+ else if (ARES_IN6_IS_ADDR_6BONE(&addr6->sin6_addr))
+ {
+ return 12;
+ }
+ else
+ {
+ /* All other IPv6 addresses, including global unicast addresses. */
+ return 1;
+ }
+ }
+ else
+ {
+ /*
+ * This should never happen.
+ * Return a semi-random label as a last resort.
+ */
+ return 1;
+ }
+}
+
+/*
+ * Get the precedence for a given IPv4/IPv6 address.
+ * RFC 6724, section 2.1.
+ */
+static int get_precedence(const struct sockaddr *addr)
+{
+ if (addr->sa_family == AF_INET)
+ {
+ return 35;
+ }
+ else if (addr->sa_family == AF_INET6)
+ {
+ const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr);
+ if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr))
+ {
+ return 50;
+ }
+ else if (IN6_IS_ADDR_V4MAPPED(&addr6->sin6_addr))
+ {
+ return 35;
+ }
+ else if (ARES_IN6_IS_ADDR_6TO4(&addr6->sin6_addr))
+ {
+ return 30;
+ }
+ else if (ARES_IN6_IS_ADDR_TEREDO(&addr6->sin6_addr))
+ {
+ return 5;
+ }
+ else if (ARES_IN6_IS_ADDR_ULA(&addr6->sin6_addr))
+ {
+ return 3;
+ }
+ else if (IN6_IS_ADDR_V4COMPAT(&addr6->sin6_addr) ||
+ IN6_IS_ADDR_SITELOCAL(&addr6->sin6_addr) ||
+ ARES_IN6_IS_ADDR_6BONE(&addr6->sin6_addr))
+ {
+ return 1;
+ }
+ else
+ {
+ /* All other IPv6 addresses, including global unicast addresses. */
+ return 40;
+ }
+ }
+ else
+ {
+ return 1;
+ }
+}
+
+/*
+ * Find number of matching initial bits between the two addresses a1 and a2.
+ */
+static int common_prefix_len(const struct in6_addr *a1,
+ const struct in6_addr *a2)
+{
+ const char *p1 = (const char *)a1;
+ const char *p2 = (const char *)a2;
+ unsigned i;
+ for (i = 0; i < sizeof(*a1); ++i)
+ {
+ int x, j;
+ if (p1[i] == p2[i])
+ {
+ continue;
+ }
+ x = p1[i] ^ p2[i];
+ for (j = 0; j < CHAR_BIT; ++j)
+ {
+ if (x & (1 << (CHAR_BIT - 1)))
+ {
+ return i * CHAR_BIT + j;
+ }
+ x <<= 1;
+ }
+ }
+ return sizeof(*a1) * CHAR_BIT;
+}
+
+/*
+ * Compare two source/destination address pairs.
+ * RFC 6724, section 6.
+ */
+static int rfc6724_compare(const void *ptr1, const void *ptr2)
+{
+ const struct addrinfo_sort_elem *a1 = (const struct addrinfo_sort_elem *)ptr1;
+ const struct addrinfo_sort_elem *a2 = (const struct addrinfo_sort_elem *)ptr2;
+ int scope_src1, scope_dst1, scope_match1;
+ int scope_src2, scope_dst2, scope_match2;
+ int label_src1, label_dst1, label_match1;
+ int label_src2, label_dst2, label_match2;
+ int precedence1, precedence2;
+ int prefixlen1, prefixlen2;
+
+ /* Rule 1: Avoid unusable destinations. */
+ if (a1->has_src_addr != a2->has_src_addr)
+ {
+ return a2->has_src_addr - a1->has_src_addr;
+ }
+
+ /* Rule 2: Prefer matching scope. */
+ scope_src1 = get_scope(&a1->src_addr.sa);
+ scope_dst1 = get_scope(a1->ai->ai_addr);
+ scope_match1 = (scope_src1 == scope_dst1);
+
+ scope_src2 = get_scope(&a2->src_addr.sa);
+ scope_dst2 = get_scope(a2->ai->ai_addr);
+ scope_match2 = (scope_src2 == scope_dst2);
+
+ if (scope_match1 != scope_match2)
+ {
+ return scope_match2 - scope_match1;
+ }
+
+ /* Rule 3: Avoid deprecated addresses. */
+
+ /* Rule 4: Prefer home addresses. */
+
+ /* Rule 5: Prefer matching label. */
+ label_src1 = get_label(&a1->src_addr.sa);
+ label_dst1 = get_label(a1->ai->ai_addr);
+ label_match1 = (label_src1 == label_dst1);
+
+ label_src2 = get_label(&a2->src_addr.sa);
+ label_dst2 = get_label(a2->ai->ai_addr);
+ label_match2 = (label_src2 == label_dst2);
+
+ if (label_match1 != label_match2)
+ {
+ return label_match2 - label_match1;
+ }
+
+ /* Rule 6: Prefer higher precedence. */
+ precedence1 = get_precedence(a1->ai->ai_addr);
+ precedence2 = get_precedence(a2->ai->ai_addr);
+ if (precedence1 != precedence2)
+ {
+ return precedence2 - precedence1;
+ }
+
+ /* Rule 7: Prefer native transport. */
+
+ /* Rule 8: Prefer smaller scope. */
+ if (scope_dst1 != scope_dst2)
+ {
+ return scope_dst1 - scope_dst2;
+ }
+
+ /* Rule 9: Use longest matching prefix. */
+ if (a1->has_src_addr && a1->ai->ai_addr->sa_family == AF_INET6 &&
+ a2->has_src_addr && a2->ai->ai_addr->sa_family == AF_INET6)
+ {
+ const struct sockaddr_in6 *a1_src = &a1->src_addr.sa6;
+ const struct sockaddr_in6 *a1_dst =
+ CARES_INADDR_CAST(const struct sockaddr_in6 *, a1->ai->ai_addr);
+ const struct sockaddr_in6 *a2_src = &a2->src_addr.sa6;
+ const struct sockaddr_in6 *a2_dst =
+ CARES_INADDR_CAST(const struct sockaddr_in6 *, a2->ai->ai_addr);
+ prefixlen1 = common_prefix_len(&a1_src->sin6_addr, &a1_dst->sin6_addr);
+ prefixlen2 = common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr);
+ if (prefixlen1 != prefixlen2)
+ {
+ return prefixlen2 - prefixlen1;
+ }
+ }
+
+ /*
+ * Rule 10: Leave the order unchanged.
+ * We need this since qsort() is not necessarily stable.
+ */
+ return a1->original_order - a2->original_order;
+}
+
+/*
+ * Find the source address that will be used if trying to connect to the given
+ * address.
+ *
+ * Returns 1 if a source address was found, 0 if the address is unreachable,
+ * and -1 if a fatal error occurred. If 0 or 1, the contents of src_addr are
+ * undefined.
+ */
+static int find_src_addr(ares_channel channel,
+ const struct sockaddr *addr,
+ struct sockaddr *src_addr)
+{
+ ares_socket_t sock;
+ int ret;
+ ares_socklen_t len;
+
+ switch (addr->sa_family)
+ {
+ case AF_INET:
+ len = sizeof(struct sockaddr_in);
+ break;
+ case AF_INET6:
+ len = sizeof(struct sockaddr_in6);
+ break;
+ default:
+ /* No known usable source address for non-INET families. */
+ return 0;
+ }
+
+ sock = ares__open_socket(channel, addr->sa_family, SOCK_DGRAM, IPPROTO_UDP);
+ if (sock == ARES_SOCKET_BAD)
+ {
+ if (errno == EAFNOSUPPORT)
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ do
+ {
+ ret = ares__connect_socket(channel, sock, addr, len);
+ }
+ while (ret == -1 && errno == EINTR);
+
+ if (ret == -1)
+ {
+ ares__close_socket(channel, sock);
+ return 0;
+ }
+
+ if (getsockname(sock, src_addr, &len) != 0)
+ {
+ ares__close_socket(channel, sock);
+ return -1;
+ }
+ ares__close_socket(channel, sock);
+ return 1;
+}
+
+/*
+ * Sort the linked list starting at sentinel->ai_next in RFC6724 order.
+ * Will leave the list unchanged if an error occurs.
+ */
+int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *list_sentinel)
+{
+ struct ares_addrinfo_node *cur;
+ int nelem = 0, i;
+ int has_src_addr;
+ struct addrinfo_sort_elem *elems;
+
+ cur = list_sentinel->ai_next;
+ while (cur)
+ {
+ ++nelem;
+ cur = cur->ai_next;
+ }
+
+ if (!nelem)
+ return ARES_ENODATA;
+
+ elems = (struct addrinfo_sort_elem *)ares_malloc(
+ nelem * sizeof(struct addrinfo_sort_elem));
+ if (!elems)
+ {
+ return ARES_ENOMEM;
+ }
+
+ /*
+ * Convert the linked list to an array that also contains the candidate
+ * source address for each destination address.
+ */
+ for (i = 0, cur = list_sentinel->ai_next; i < nelem; ++i, cur = cur->ai_next)
+ {
+ assert(cur != NULL);
+ elems[i].ai = cur;
+ elems[i].original_order = i;
+ has_src_addr = find_src_addr(channel, cur->ai_addr, &elems[i].src_addr.sa);
+ if (has_src_addr == -1)
+ {
+ ares_free(elems);
+ return ARES_ENOTFOUND;
+ }
+ elems[i].has_src_addr = has_src_addr;
+ }
+
+ /* Sort the addresses, and rearrange the linked list so it matches the sorted
+ * order. */
+ qsort((void *)elems, nelem, sizeof(struct addrinfo_sort_elem),
+ rfc6724_compare);
+
+ list_sentinel->ai_next = elems[0].ai;
+ for (i = 0; i < nelem - 1; ++i)
+ {
+ elems[i].ai->ai_next = elems[i + 1].ai;
+ }
+ elems[nelem - 1].ai->ai_next = NULL;
+
+ ares_free(elems);
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/ares__timeval.c b/grpc/third_party/cares/cares/src/lib/ares__timeval.c
index 94efb7db..94efb7db 100644
--- a/grpc/third_party/cares/cares/ares__timeval.c
+++ b/grpc/third_party/cares/cares/src/lib/ares__timeval.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_android.c b/grpc/third_party/cares/cares/src/lib/ares_android.c
new file mode 100644
index 00000000..5b00b806
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_android.c
@@ -0,0 +1,444 @@
+/* Copyright (C) 2017 by John Schember <john@nachtimwald.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+#if defined(ANDROID) || defined(__ANDROID__)
+
+#include <jni.h>
+
+#include "ares_setup.h"
+#include "ares.h"
+#include "ares_android.h"
+#include "ares_private.h"
+
+static JavaVM *android_jvm = NULL;
+static jobject android_connectivity_manager = NULL;
+
+/* ConnectivityManager.getActiveNetwork */
+static jmethodID android_cm_active_net_mid = NULL;
+/* ConnectivityManager.getLinkProperties */
+static jmethodID android_cm_link_props_mid = NULL;
+/* LinkProperties.getDnsServers */
+static jmethodID android_lp_dns_servers_mid = NULL;
+/* LinkProperties.getDomains */
+static jmethodID android_lp_domains_mid = NULL;
+/* List.size */
+static jmethodID android_list_size_mid = NULL;
+/* List.get */
+static jmethodID android_list_get_mid = NULL;
+/* InetAddress.getHostAddress */
+static jmethodID android_ia_host_addr_mid = NULL;
+
+static jclass jni_get_class(JNIEnv *env, const char *path)
+{
+ jclass cls = NULL;
+
+ if (env == NULL || path == NULL || *path == '\0')
+ return NULL;
+
+ cls = (*env)->FindClass(env, path);
+ if ((*env)->ExceptionOccurred(env)) {
+ (*env)->ExceptionClear(env);
+ return NULL;
+ }
+ return cls;
+}
+
+static jmethodID jni_get_method_id(JNIEnv *env, jclass cls,
+ const char *func_name, const char *signature)
+{
+ jmethodID mid = NULL;
+
+ if (env == NULL || cls == NULL || func_name == NULL || *func_name == '\0' ||
+ signature == NULL || *signature == '\0')
+ {
+ return NULL;
+ }
+
+ mid = (*env)->GetMethodID(env, cls, func_name, signature);
+ if ((*env)->ExceptionOccurred(env))
+ {
+ (*env)->ExceptionClear(env);
+ return NULL;
+ }
+
+ return mid;
+}
+
+void ares_library_init_jvm(JavaVM *jvm)
+{
+ android_jvm = jvm;
+}
+
+int ares_library_init_android(jobject connectivity_manager)
+{
+ JNIEnv *env = NULL;
+ int need_detatch = 0;
+ int res;
+ int ret = ARES_ENOTINITIALIZED;
+ jclass obj_cls = NULL;
+
+ if (android_jvm == NULL)
+ goto cleanup;
+
+ res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
+ if (res == JNI_EDETACHED)
+ {
+ env = NULL;
+ res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
+ need_detatch = 1;
+ }
+ if (res != JNI_OK || env == NULL)
+ goto cleanup;
+
+ android_connectivity_manager =
+ (*env)->NewGlobalRef(env, connectivity_manager);
+ if (android_connectivity_manager == NULL)
+ goto cleanup;
+
+ /* Initialization has succeeded. Now attempt to cache the methods that will be
+ * called by ares_get_android_server_list. */
+ ret = ARES_SUCCESS;
+
+ /* ConnectivityManager in API 1. */
+ obj_cls = jni_get_class(env, "android/net/ConnectivityManager");
+ if (obj_cls == NULL)
+ goto cleanup;
+
+ /* ConnectivityManager.getActiveNetwork in API 23. */
+ android_cm_active_net_mid =
+ jni_get_method_id(env, obj_cls, "getActiveNetwork",
+ "()Landroid/net/Network;");
+ if (android_cm_active_net_mid == NULL)
+ goto cleanup;
+
+ /* ConnectivityManager.getLinkProperties in API 21. */
+ android_cm_link_props_mid =
+ jni_get_method_id(env, obj_cls, "getLinkProperties",
+ "(Landroid/net/Network;)Landroid/net/LinkProperties;");
+ if (android_cm_link_props_mid == NULL)
+ goto cleanup;
+
+ /* LinkProperties in API 21. */
+ (*env)->DeleteLocalRef(env, obj_cls);
+ obj_cls = jni_get_class(env, "android/net/LinkProperties");
+ if (obj_cls == NULL)
+ goto cleanup;
+
+ /* getDnsServers in API 21. */
+ android_lp_dns_servers_mid = jni_get_method_id(env, obj_cls, "getDnsServers",
+ "()Ljava/util/List;");
+ if (android_lp_dns_servers_mid == NULL)
+ goto cleanup;
+
+ /* getDomains in API 21. */
+ android_lp_domains_mid = jni_get_method_id(env, obj_cls, "getDomains",
+ "()Ljava/lang/String;");
+ if (android_lp_domains_mid == NULL)
+ goto cleanup;
+
+ (*env)->DeleteLocalRef(env, obj_cls);
+ obj_cls = jni_get_class(env, "java/util/List");
+ if (obj_cls == NULL)
+ goto cleanup;
+
+ android_list_size_mid = jni_get_method_id(env, obj_cls, "size", "()I");
+ if (android_list_size_mid == NULL)
+ goto cleanup;
+
+ android_list_get_mid = jni_get_method_id(env, obj_cls, "get",
+ "(I)Ljava/lang/Object;");
+ if (android_list_get_mid == NULL)
+ goto cleanup;
+
+ (*env)->DeleteLocalRef(env, obj_cls);
+ obj_cls = jni_get_class(env, "java/net/InetAddress");
+ if (obj_cls == NULL)
+ goto cleanup;
+
+ android_ia_host_addr_mid = jni_get_method_id(env, obj_cls, "getHostAddress",
+ "()Ljava/lang/String;");
+ if (android_ia_host_addr_mid == NULL)
+ goto cleanup;
+
+ (*env)->DeleteLocalRef(env, obj_cls);
+ goto done;
+
+cleanup:
+ if (obj_cls != NULL)
+ (*env)->DeleteLocalRef(env, obj_cls);
+
+ android_cm_active_net_mid = NULL;
+ android_cm_link_props_mid = NULL;
+ android_lp_dns_servers_mid = NULL;
+ android_lp_domains_mid = NULL;
+ android_list_size_mid = NULL;
+ android_list_get_mid = NULL;
+ android_ia_host_addr_mid = NULL;
+
+done:
+ if (need_detatch)
+ (*android_jvm)->DetachCurrentThread(android_jvm);
+
+ return ret;
+}
+
+int ares_library_android_initialized(void)
+{
+ if (android_jvm == NULL || android_connectivity_manager == NULL)
+ return ARES_ENOTINITIALIZED;
+ return ARES_SUCCESS;
+}
+
+void ares_library_cleanup_android(void)
+{
+ JNIEnv *env = NULL;
+ int need_detatch = 0;
+ int res;
+
+ if (android_jvm == NULL || android_connectivity_manager == NULL)
+ return;
+
+ res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
+ if (res == JNI_EDETACHED)
+ {
+ env = NULL;
+ res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
+ need_detatch = 1;
+ }
+ if (res != JNI_OK || env == NULL)
+ return;
+
+ android_cm_active_net_mid = NULL;
+ android_cm_link_props_mid = NULL;
+ android_lp_dns_servers_mid = NULL;
+ android_lp_domains_mid = NULL;
+ android_list_size_mid = NULL;
+ android_list_get_mid = NULL;
+ android_ia_host_addr_mid = NULL;
+
+ (*env)->DeleteGlobalRef(env, android_connectivity_manager);
+ android_connectivity_manager = NULL;
+
+ if (need_detatch)
+ (*android_jvm)->DetachCurrentThread(android_jvm);
+}
+
+char **ares_get_android_server_list(size_t max_servers,
+ size_t *num_servers)
+{
+ JNIEnv *env = NULL;
+ jobject active_network = NULL;
+ jobject link_properties = NULL;
+ jobject server_list = NULL;
+ jobject server = NULL;
+ jstring str = NULL;
+ jint nserv;
+ const char *ch_server_address;
+ int res;
+ size_t i;
+ char **dns_list = NULL;
+ int need_detatch = 0;
+
+ if (android_jvm == NULL || android_connectivity_manager == NULL ||
+ max_servers == 0 || num_servers == NULL)
+ {
+ return NULL;
+ }
+
+ if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL ||
+ android_lp_dns_servers_mid == NULL || android_list_size_mid == NULL ||
+ android_list_get_mid == NULL || android_ia_host_addr_mid == NULL)
+ {
+ return NULL;
+ }
+
+ res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
+ if (res == JNI_EDETACHED)
+ {
+ env = NULL;
+ res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
+ need_detatch = 1;
+ }
+ if (res != JNI_OK || env == NULL)
+ goto done;
+
+ /* JNI below is equivalent to this Java code.
+ import android.content.Context;
+ import android.net.ConnectivityManager;
+ import android.net.LinkProperties;
+ import android.net.Network;
+ import java.net.InetAddress;
+ import java.util.List;
+
+ ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext()
+ .getSystemService(Context.CONNECTIVITY_SERVICE);
+ Network an = cm.getActiveNetwork();
+ LinkProperties lp = cm.getLinkProperties(an);
+ List<InetAddress> dns = lp.getDnsServers();
+ for (InetAddress ia: dns) {
+ String ha = ia.getHostAddress();
+ }
+
+ Note: The JNI ConnectivityManager object and all method IDs were previously
+ initialized in ares_library_init_android.
+ */
+
+ active_network = (*env)->CallObjectMethod(env, android_connectivity_manager,
+ android_cm_active_net_mid);
+ if (active_network == NULL)
+ goto done;
+
+ link_properties =
+ (*env)->CallObjectMethod(env, android_connectivity_manager,
+ android_cm_link_props_mid, active_network);
+ if (link_properties == NULL)
+ goto done;
+
+ server_list = (*env)->CallObjectMethod(env, link_properties,
+ android_lp_dns_servers_mid);
+ if (server_list == NULL)
+ goto done;
+
+ nserv = (*env)->CallIntMethod(env, server_list, android_list_size_mid);
+ if (nserv > (jint)max_servers)
+ nserv = (jint)max_servers;
+ if (nserv <= 0)
+ goto done;
+ *num_servers = (size_t)nserv;
+
+ dns_list = ares_malloc(sizeof(*dns_list)*(*num_servers));
+ for (i=0; i<*num_servers; i++)
+ {
+ server = (*env)->CallObjectMethod(env, server_list, android_list_get_mid,
+ (jint)i);
+ dns_list[i] = ares_malloc(64);
+ dns_list[i][0] = 0;
+ if (server == NULL)
+ {
+ continue;
+ }
+ str = (*env)->CallObjectMethod(env, server, android_ia_host_addr_mid);
+ ch_server_address = (*env)->GetStringUTFChars(env, str, 0);
+ strncpy(dns_list[i], ch_server_address, 64);
+ (*env)->ReleaseStringUTFChars(env, str, ch_server_address);
+ (*env)->DeleteLocalRef(env, str);
+ (*env)->DeleteLocalRef(env, server);
+ }
+
+done:
+ if ((*env)->ExceptionOccurred(env))
+ (*env)->ExceptionClear(env);
+
+ if (server_list != NULL)
+ (*env)->DeleteLocalRef(env, server_list);
+ if (link_properties != NULL)
+ (*env)->DeleteLocalRef(env, link_properties);
+ if (active_network != NULL)
+ (*env)->DeleteLocalRef(env, active_network);
+
+ if (need_detatch)
+ (*android_jvm)->DetachCurrentThread(android_jvm);
+ return dns_list;
+}
+
+char *ares_get_android_search_domains_list(void)
+{
+ JNIEnv *env = NULL;
+ jobject active_network = NULL;
+ jobject link_properties = NULL;
+ jstring domains = NULL;
+ const char *domain;
+ int res;
+ char *domain_list = NULL;
+ int need_detatch = 0;
+
+ if (android_jvm == NULL || android_connectivity_manager == NULL)
+ {
+ return NULL;
+ }
+
+ if (android_cm_active_net_mid == NULL || android_cm_link_props_mid == NULL ||
+ android_lp_domains_mid == NULL)
+ {
+ return NULL;
+ }
+
+ res = (*android_jvm)->GetEnv(android_jvm, (void **)&env, JNI_VERSION_1_6);
+ if (res == JNI_EDETACHED)
+ {
+ env = NULL;
+ res = (*android_jvm)->AttachCurrentThread(android_jvm, &env, NULL);
+ need_detatch = 1;
+ }
+ if (res != JNI_OK || env == NULL)
+ goto done;
+
+ /* JNI below is equivalent to this Java code.
+ import android.content.Context;
+ import android.net.ConnectivityManager;
+ import android.net.LinkProperties;
+
+ ConnectivityManager cm = (ConnectivityManager)this.getApplicationContext()
+ .getSystemService(Context.CONNECTIVITY_SERVICE);
+ Network an = cm.getActiveNetwork();
+ LinkProperties lp = cm.getLinkProperties(an);
+ String domains = lp.getDomains();
+ for (String domain: domains.split(",")) {
+ String d = domain;
+ }
+
+ Note: The JNI ConnectivityManager object and all method IDs were previously
+ initialized in ares_library_init_android.
+ */
+
+ active_network = (*env)->CallObjectMethod(env, android_connectivity_manager,
+ android_cm_active_net_mid);
+ if (active_network == NULL)
+ goto done;
+
+ link_properties =
+ (*env)->CallObjectMethod(env, android_connectivity_manager,
+ android_cm_link_props_mid, active_network);
+ if (link_properties == NULL)
+ goto done;
+
+ /* Get the domains. It is a common separated list of domains to search. */
+ domains = (*env)->CallObjectMethod(env, link_properties,
+ android_lp_domains_mid);
+ if (domains == NULL)
+ goto done;
+
+ /* Split on , */
+ domain = (*env)->GetStringUTFChars(env, domains, 0);
+ domain_list = ares_strdup(domain);
+ (*env)->ReleaseStringUTFChars(env, domains, domain);
+ (*env)->DeleteLocalRef(env, domains);
+
+done:
+ if ((*env)->ExceptionOccurred(env))
+ (*env)->ExceptionClear(env);
+
+ if (link_properties != NULL)
+ (*env)->DeleteLocalRef(env, link_properties);
+ if (active_network != NULL)
+ (*env)->DeleteLocalRef(env, active_network);
+
+ if (need_detatch)
+ (*android_jvm)->DetachCurrentThread(android_jvm);
+ return domain_list;
+}
+#else
+/* warning: ISO C forbids an empty translation unit */
+typedef int dummy_make_iso_compilers_happy;
+#endif
diff --git a/grpc/third_party/cares/cares/ares_android.h b/grpc/third_party/cares/cares/src/lib/ares_android.h
index 93fb75f5..93fb75f5 100644
--- a/grpc/third_party/cares/cares/ares_android.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_android.h
diff --git a/grpc/third_party/cares/cares/ares_cancel.c b/grpc/third_party/cares/cares/src/lib/ares_cancel.c
index 465cc9e9..465cc9e9 100644
--- a/grpc/third_party/cares/cares/ares_cancel.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_cancel.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_config.h.cmake b/grpc/third_party/cares/cares/src/lib/ares_config.h.cmake
new file mode 100644
index 00000000..fddb7853
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_config.h.cmake
@@ -0,0 +1,432 @@
+/* Generated from ares_config.h.cmake */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* define this if ares is built for a big endian system */
+#undef ARES_BIG_ENDIAN
+
+/* when building as static part of libcurl */
+#undef BUILDING_LIBCURL
+
+/* Defined for build that exposes internal static functions for testing. */
+#undef CARES_EXPOSE_STATICS
+
+/* Defined for build with symbol hiding. */
+#undef CARES_SYMBOL_HIDING
+
+/* Definition to make a library symbol externally visible. */
+#undef CARES_SYMBOL_SCOPE_EXTERN
+
+/* Use resolver library to configure cares */
+#cmakedefine CARES_USE_LIBRESOLV
+
+/* if a /etc/inet dir is being used */
+#undef ETC_INET
+
+/* Define to the type of arg 2 for gethostname. */
+#define GETHOSTNAME_TYPE_ARG2 @GETHOSTNAME_TYPE_ARG2@
+
+/* Define to the type qualifier of arg 1 for getnameinfo. */
+#define GETNAMEINFO_QUAL_ARG1 @GETNAMEINFO_QUAL_ARG1@
+
+/* Define to the type of arg 1 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG1 @GETNAMEINFO_TYPE_ARG1@
+
+/* Define to the type of arg 2 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG2 @GETNAMEINFO_TYPE_ARG2@
+
+/* Define to the type of args 4 and 6 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG46 @GETNAMEINFO_TYPE_ARG46@
+
+/* Define to the type of arg 7 for getnameinfo. */
+#define GETNAMEINFO_TYPE_ARG7 @GETNAMEINFO_TYPE_ARG7@
+
+/* Specifies the number of arguments to getservbyport_r */
+#define GETSERVBYPORT_R_ARGS @GETSERVBYPORT_R_ARGS@
+
+/* Specifies the number of arguments to getservbyname_r */
+#define GETSERVBYNAME_R_ARGS @GETSERVBYNAME_R_ARGS@
+
+/* Define to 1 if you have AF_INET6. */
+#cmakedefine HAVE_AF_INET6
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
+#cmakedefine HAVE_ARPA_NAMESER_COMPAT_H
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#cmakedefine HAVE_ARPA_NAMESER_H
+
+/* Define to 1 if you have the <assert.h> header file. */
+#cmakedefine HAVE_ASSERT_H
+
+/* Define to 1 if you have the `bitncmp' function. */
+#cmakedefine HAVE_BITNCMP
+
+/* Define to 1 if bool is an available type. */
+#cmakedefine HAVE_BOOL_T
+
+/* Define to 1 if you have the clock_gettime function and monotonic timer. */
+#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC
+
+/* Define to 1 if you have the closesocket function. */
+#cmakedefine HAVE_CLOSESOCKET
+
+/* Define to 1 if you have the CloseSocket camel case function. */
+#cmakedefine HAVE_CLOSESOCKET_CAMEL
+
+/* Define to 1 if you have the connect function. */
+#cmakedefine HAVE_CONNECT
+
+/* define if the compiler supports basic C++11 syntax */
+#cmakedefine HAVE_CXX11
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#cmakedefine HAVE_ERRNO_H
+
+/* Define to 1 if you have the fcntl function. */
+#cmakedefine HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H
+
+/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
+#cmakedefine HAVE_FCNTL_O_NONBLOCK
+
+/* Define to 1 if you have the freeaddrinfo function. */
+#cmakedefine HAVE_FREEADDRINFO
+
+/* Define to 1 if you have a working getaddrinfo function. */
+#cmakedefine HAVE_GETADDRINFO
+
+/* Define to 1 if the getaddrinfo function is threadsafe. */
+#cmakedefine HAVE_GETADDRINFO_THREADSAFE
+
+/* Define to 1 if you have the getenv function. */
+#cmakedefine HAVE_GETENV
+
+/* Define to 1 if you have the gethostbyaddr function. */
+#cmakedefine HAVE_GETHOSTBYADDR
+
+/* Define to 1 if you have the gethostbyname function. */
+#cmakedefine HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the gethostname function. */
+#cmakedefine HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the getnameinfo function. */
+#cmakedefine HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the getservbyport_r function. */
+#cmakedefine HAVE_GETSERVBYPORT_R
+
+/* Define to 1 if you have the getservbyname_r function. */
+#cmakedefine HAVE_GETSERVBYNAME_R
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `if_indextoname' function. */
+#cmakedefine HAVE_IF_INDEXTONAME
+
+/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */
+#cmakedefine HAVE_INET_NET_PTON
+
+/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
+#cmakedefine HAVE_INET_NTOP
+
+/* Define to 1 if you have a IPv6 capable working inet_pton function. */
+#cmakedefine HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H
+
+/* Define to 1 if you have the ioctl function. */
+#cmakedefine HAVE_IOCTL
+
+/* Define to 1 if you have the ioctlsocket function. */
+#cmakedefine HAVE_IOCTLSOCKET
+
+/* Define to 1 if you have the IoctlSocket camel case function. */
+#cmakedefine HAVE_IOCTLSOCKET_CAMEL
+
+/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
+ */
+#cmakedefine HAVE_IOCTLSOCKET_CAMEL_FIONBIO
+
+/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
+#cmakedefine HAVE_IOCTLSOCKET_FIONBIO
+
+/* Define to 1 if you have a working ioctl FIONBIO function. */
+#cmakedefine HAVE_IOCTL_FIONBIO
+
+/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
+#cmakedefine HAVE_IOCTL_SIOCGIFADDR
+
+/* Define to 1 if you have the `resolve' library (-lresolve). */
+#cmakedefine HAVE_LIBRESOLV
+
+/* Define to 1 if you have the <limits.h> header file. */
+#cmakedefine HAVE_LIMITS_H
+
+/* if your compiler supports LL */
+#cmakedefine HAVE_LL
+
+/* Define to 1 if the compiler supports the 'long long' data type. */
+#cmakedefine HAVE_LONGLONG
+
+/* Define to 1 if you have the malloc.h header file. */
+#cmakedefine HAVE_MALLOC_H
+
+/* Define to 1 if you have the memory.h header file. */
+#cmakedefine HAVE_MEMORY_H
+
+/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+#cmakedefine HAVE_MSG_NOSIGNAL
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#cmakedefine HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#cmakedefine HAVE_NETINET_TCP_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#cmakedefine HAVE_NET_IF_H
+
+/* Define to 1 if you have PF_INET6. */
+#cmakedefine HAVE_PF_INET6
+
+/* Define to 1 if you have the recv function. */
+#cmakedefine HAVE_RECV
+
+/* Define to 1 if you have the recvfrom function. */
+#cmakedefine HAVE_RECVFROM
+
+/* Define to 1 if you have the send function. */
+#cmakedefine HAVE_SEND
+
+/* Define to 1 if you have the setsockopt function. */
+#cmakedefine HAVE_SETSOCKOPT
+
+/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
+#cmakedefine HAVE_SETSOCKOPT_SO_NONBLOCK
+
+/* Define to 1 if you have the <signal.h> header file. */
+#cmakedefine HAVE_SIGNAL_H
+
+/* Define to 1 if sig_atomic_t is an available typedef. */
+#cmakedefine HAVE_SIG_ATOMIC_T
+
+/* Define to 1 if sig_atomic_t is already defined as volatile. */
+#cmakedefine HAVE_SIG_ATOMIC_T_VOLATILE
+
+/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
+#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+
+/* Define to 1 if you have the socket function. */
+#cmakedefine HAVE_SOCKET
+
+/* Define to 1 if you have the <socket.h> header file. */
+#cmakedefine HAVE_SOCKET_H
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#cmakedefine HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H
+
+/* Define to 1 if you have the strcasecmp function. */
+#cmakedefine HAVE_STRCASECMP
+
+/* Define to 1 if you have the strcmpi function. */
+#cmakedefine HAVE_STRCMPI
+
+/* Define to 1 if you have the strdup function. */
+#cmakedefine HAVE_STRDUP
+
+/* Define to 1 if you have the stricmp function. */
+#cmakedefine HAVE_STRICMP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H
+
+/* Define to 1 if you have the strncasecmp function. */
+#cmakedefine HAVE_STRNCASECMP
+
+/* Define to 1 if you have the strncmpi function. */
+#cmakedefine HAVE_STRNCMPI
+
+/* Define to 1 if you have the strnicmp function. */
+#cmakedefine HAVE_STRNICMP
+
+/* Define to 1 if you have the <stropts.h> header file. */
+#cmakedefine HAVE_STROPTS_H
+
+/* Define to 1 if you have struct addrinfo. */
+#cmakedefine HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if you have struct in6_addr. */
+#cmakedefine HAVE_STRUCT_IN6_ADDR
+
+/* Define to 1 if you have struct sockaddr_in6. */
+#cmakedefine HAVE_STRUCT_SOCKADDR_IN6
+
+/* if struct sockaddr_storage is defined */
+#cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if you have the timeval struct. */
+#cmakedefine HAVE_STRUCT_TIMEVAL
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#cmakedefine HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#cmakedefine HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#cmakedefine HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#cmakedefine HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <time.h> header file. */
+#cmakedefine HAVE_TIME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H
+
+/* Define to 1 if you have the windows.h header file. */
+#cmakedefine HAVE_WINDOWS_H
+
+/* Define to 1 if you have the winsock2.h header file. */
+#cmakedefine HAVE_WINSOCK2_H
+
+/* Define to 1 if you have the winsock.h header file. */
+#cmakedefine HAVE_WINSOCK_H
+
+/* Define to 1 if you have the writev function. */
+#cmakedefine HAVE_WRITEV
+
+/* Define to 1 if you have the ws2tcpip.h header file. */
+#cmakedefine HAVE_WS2TCPIP_H
+
+/* Define to 1 if you have the __system_property_get function */
+#cmakedefine HAVE___SYSTEM_PROPERTY_GET
+
+/* Define to 1 if you need the malloc.h header file even with stdlib.h */
+#cmakedefine NEED_MALLOC_H
+
+/* Define to 1 if you need the memory.h header file even with stdlib.h */
+#cmakedefine NEED_MEMORY_H
+
+/* a suitable file/device to read random data from */
+#cmakedefine CARES_RANDOM_FILE "@CARES_RANDOM_FILE@"
+
+/* Define to the type qualifier pointed by arg 5 for recvfrom. */
+#define RECVFROM_QUAL_ARG5 @RECVFROM_QUAL_ARG5@
+
+/* Define to the type of arg 1 for recvfrom. */
+#define RECVFROM_TYPE_ARG1 @RECVFROM_TYPE_ARG1@
+
+/* Define to the type pointed by arg 2 for recvfrom. */
+#define RECVFROM_TYPE_ARG2 @RECVFROM_TYPE_ARG2@
+
+/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
+#cmakedefine01 RECVFROM_TYPE_ARG2_IS_VOID
+
+/* Define to the type of arg 3 for recvfrom. */
+#define RECVFROM_TYPE_ARG3 @RECVFROM_TYPE_ARG3@
+
+/* Define to the type of arg 4 for recvfrom. */
+#define RECVFROM_TYPE_ARG4 @RECVFROM_TYPE_ARG4@
+
+/* Define to the type pointed by arg 5 for recvfrom. */
+#define RECVFROM_TYPE_ARG5 @RECVFROM_TYPE_ARG5@
+
+/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
+#cmakedefine01 RECVFROM_TYPE_ARG5_IS_VOID
+
+/* Define to the type pointed by arg 6 for recvfrom. */
+#define RECVFROM_TYPE_ARG6 @RECVFROM_TYPE_ARG6@
+
+/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
+#cmakedefine01 RECVFROM_TYPE_ARG6_IS_VOID
+
+/* Define to the function return type for recvfrom. */
+#define RECVFROM_TYPE_RETV @RECVFROM_TYPE_RETV@
+
+/* Define to the type of arg 1 for recv. */
+#define RECV_TYPE_ARG1 @RECV_TYPE_ARG1@
+
+/* Define to the type of arg 2 for recv. */
+#define RECV_TYPE_ARG2 @RECV_TYPE_ARG2@
+
+/* Define to the type of arg 3 for recv. */
+#define RECV_TYPE_ARG3 @RECV_TYPE_ARG3@
+
+/* Define to the type of arg 4 for recv. */
+#define RECV_TYPE_ARG4 @RECV_TYPE_ARG4@
+
+/* Define to the function return type for recv. */
+#define RECV_TYPE_RETV @RECV_TYPE_RETV@
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE @RETSIGTYPE@
+
+/* Define to the type qualifier of arg 2 for send. */
+#define SEND_QUAL_ARG2 @SEND_QUAL_ARG2@
+
+/* Define to the type of arg 1 for send. */
+#define SEND_TYPE_ARG1 @SEND_TYPE_ARG1@
+
+/* Define to the type of arg 2 for send. */
+#define SEND_TYPE_ARG2 @SEND_TYPE_ARG2@
+
+/* Define to the type of arg 3 for send. */
+#define SEND_TYPE_ARG3 @SEND_TYPE_ARG3@
+
+/* Define to the type of arg 4 for send. */
+#define SEND_TYPE_ARG4 @SEND_TYPE_ARG4@
+
+/* Define to the function return type for send. */
+#define SEND_TYPE_RETV @SEND_TYPE_RETV@
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#cmakedefine TIME_WITH_SYS_TIME
+
+/* Define to disable non-blocking sockets. */
+#undef USE_BLOCKING_SOCKETS
+
+/* Define to avoid automatic inclusion of winsock.h */
+#undef WIN32_LEAN_AND_MEAN
+
+/* Type to use in place of in_addr_t when system does not provide it. */
+#undef in_addr_t
+
diff --git a/grpc/third_party/cares/cares/src/lib/ares_create_query.c b/grpc/third_party/cares/cares/src/lib/ares_create_query.c
new file mode 100644
index 00000000..e3d874b4
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_create_query.c
@@ -0,0 +1,197 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+
+/* Header format, from RFC 1035:
+ * 1 1 1 1 1 1
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | ID |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | QDCOUNT |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | ANCOUNT |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | NSCOUNT |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | ARCOUNT |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *
+ * AA, TC, RA, and RCODE are only set in responses. Brief description
+ * of the remaining fields:
+ * ID Identifier to match responses with queries
+ * QR Query (0) or response (1)
+ * Opcode For our purposes, always O_QUERY
+ * RD Recursion desired
+ * Z Reserved (zero)
+ * QDCOUNT Number of queries
+ * ANCOUNT Number of answers
+ * NSCOUNT Number of name server records
+ * ARCOUNT Number of additional records
+ *
+ * Question format, from RFC 1035:
+ * 1 1 1 1 1 1
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | |
+ * / QNAME /
+ * / /
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | QTYPE |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | QCLASS |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ *
+ * The query name is encoded as a series of labels, each represented
+ * as a one-byte length (maximum 63) followed by the text of the
+ * label. The list is terminated by a label of length zero (which can
+ * be thought of as the root domain).
+ */
+
+int ares_create_query(const char *name, int dnsclass, int type,
+ unsigned short id, int rd, unsigned char **bufp,
+ int *buflenp, int max_udp_size)
+{
+ size_t len;
+ unsigned char *q;
+ const char *p;
+ size_t buflen;
+ unsigned char *buf;
+
+ /* Set our results early, in case we bail out early with an error. */
+ *buflenp = 0;
+ *bufp = NULL;
+
+ /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
+ if (ares__is_onion_domain(name))
+ return ARES_ENOTFOUND;
+
+ /* Allocate a memory area for the maximum size this packet might need. +2
+ * is for the length byte and zero termination if no dots or ecscaping is
+ * used.
+ */
+ len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ +
+ (max_udp_size ? EDNSFIXEDSZ : 0);
+ buf = ares_malloc(len);
+ if (!buf)
+ return ARES_ENOMEM;
+
+ /* Set up the header. */
+ q = buf;
+ memset(q, 0, HFIXEDSZ);
+ DNS_HEADER_SET_QID(q, id);
+ DNS_HEADER_SET_OPCODE(q, O_QUERY);
+ if (rd) {
+ DNS_HEADER_SET_RD(q, 1);
+ }
+ else {
+ DNS_HEADER_SET_RD(q, 0);
+ }
+ DNS_HEADER_SET_QDCOUNT(q, 1);
+
+ if (max_udp_size) {
+ DNS_HEADER_SET_ARCOUNT(q, 1);
+ }
+
+ /* A name of "." is a screw case for the loop below, so adjust it. */
+ if (strcmp(name, ".") == 0)
+ name++;
+
+ /* Start writing out the name after the header. */
+ q += HFIXEDSZ;
+ while (*name)
+ {
+ if (*name == '.') {
+ ares_free (buf);
+ return ARES_EBADNAME;
+ }
+
+ /* Count the number of bytes in this label. */
+ len = 0;
+ for (p = name; *p && *p != '.'; p++)
+ {
+ if (*p == '\\' && *(p + 1) != 0)
+ p++;
+ len++;
+ }
+ if (len > MAXLABEL) {
+ ares_free (buf);
+ return ARES_EBADNAME;
+ }
+
+ /* Encode the length and copy the data. */
+ *q++ = (unsigned char)len;
+ for (p = name; *p && *p != '.'; p++)
+ {
+ if (*p == '\\' && *(p + 1) != 0)
+ p++;
+ *q++ = *p;
+ }
+
+ /* Go to the next label and repeat, unless we hit the end. */
+ if (!*p)
+ break;
+ name = p + 1;
+ }
+
+ /* Add the zero-length label at the end. */
+ *q++ = 0;
+
+ /* Finish off the question with the type and class. */
+ DNS_QUESTION_SET_TYPE(q, type);
+ DNS_QUESTION_SET_CLASS(q, dnsclass);
+
+ q += QFIXEDSZ;
+ if (max_udp_size)
+ {
+ memset(q, 0, EDNSFIXEDSZ);
+ q++;
+ DNS_RR_SET_TYPE(q, T_OPT);
+ DNS_RR_SET_CLASS(q, max_udp_size);
+ q += (EDNSFIXEDSZ-1);
+ }
+ buflen = (q - buf);
+
+ /* Reject names that are longer than the maximum of 255 bytes that's
+ * specified in RFC 1035 ("To simplify implementations, the total length of
+ * a domain name (i.e., label octets and label length octets) is restricted
+ * to 255 octets or less."). */
+ if (buflen > (size_t)(MAXCDNAME + HFIXEDSZ + QFIXEDSZ +
+ (max_udp_size ? EDNSFIXEDSZ : 0))) {
+ ares_free (buf);
+ return ARES_EBADNAME;
+ }
+
+ /* we know this fits in an int at this point */
+ *buflenp = (int) buflen;
+ *bufp = buf;
+
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_data.c b/grpc/third_party/cares/cares/src/lib/ares_data.c
new file mode 100644
index 00000000..aa925b8b
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_data.c
@@ -0,0 +1,240 @@
+
+/* Copyright (C) 2009-2013 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+
+#include "ares_setup.h"
+
+#include <stddef.h>
+
+#include "ares.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+
+/*
+** ares_free_data() - c-ares external API function.
+**
+** This function must be used by the application to free data memory that
+** has been internally allocated by some c-ares function and for which a
+** pointer has already been returned to the calling application. The list
+** of c-ares functions returning pointers that must be free'ed using this
+** function is:
+**
+** ares_get_servers()
+** ares_parse_srv_reply()
+** ares_parse_txt_reply()
+*/
+
+void ares_free_data(void *dataptr)
+{
+ while (dataptr != NULL) {
+ struct ares_data *ptr;
+ void *next_data = NULL;
+
+#ifdef __INTEL_COMPILER
+# pragma warning(push)
+# pragma warning(disable:1684)
+ /* 1684: conversion from pointer to same-sized integral type */
+#endif
+
+ ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
+
+#ifdef __INTEL_COMPILER
+# pragma warning(pop)
+#endif
+
+ if (ptr->mark != ARES_DATATYPE_MARK)
+ return;
+
+ switch (ptr->type)
+ {
+ case ARES_DATATYPE_MX_REPLY:
+
+ if (ptr->data.mx_reply.next)
+ next_data = ptr->data.mx_reply.next;
+ if (ptr->data.mx_reply.host)
+ ares_free(ptr->data.mx_reply.host);
+ break;
+
+ case ARES_DATATYPE_SRV_REPLY:
+
+ if (ptr->data.srv_reply.next)
+ next_data = ptr->data.srv_reply.next;
+ if (ptr->data.srv_reply.host)
+ ares_free(ptr->data.srv_reply.host);
+ break;
+
+ case ARES_DATATYPE_TXT_REPLY:
+ case ARES_DATATYPE_TXT_EXT:
+
+ if (ptr->data.txt_reply.next)
+ next_data = ptr->data.txt_reply.next;
+ if (ptr->data.txt_reply.txt)
+ ares_free(ptr->data.txt_reply.txt);
+ break;
+
+ case ARES_DATATYPE_ADDR_NODE:
+
+ if (ptr->data.addr_node.next)
+ next_data = ptr->data.addr_node.next;
+ break;
+
+ case ARES_DATATYPE_ADDR_PORT_NODE:
+
+ if (ptr->data.addr_port_node.next)
+ next_data = ptr->data.addr_port_node.next;
+ break;
+
+ case ARES_DATATYPE_NAPTR_REPLY:
+
+ if (ptr->data.naptr_reply.next)
+ next_data = ptr->data.naptr_reply.next;
+ if (ptr->data.naptr_reply.flags)
+ ares_free(ptr->data.naptr_reply.flags);
+ if (ptr->data.naptr_reply.service)
+ ares_free(ptr->data.naptr_reply.service);
+ if (ptr->data.naptr_reply.regexp)
+ ares_free(ptr->data.naptr_reply.regexp);
+ if (ptr->data.naptr_reply.replacement)
+ ares_free(ptr->data.naptr_reply.replacement);
+ break;
+
+ case ARES_DATATYPE_SOA_REPLY:
+ if (ptr->data.soa_reply.nsname)
+ ares_free(ptr->data.soa_reply.nsname);
+ if (ptr->data.soa_reply.hostmaster)
+ ares_free(ptr->data.soa_reply.hostmaster);
+ break;
+
+ case ARES_DATATYPE_CAA_REPLY:
+
+ if (ptr->data.caa_reply.next)
+ next_data = ptr->data.caa_reply.next;
+ if (ptr->data.caa_reply.property)
+ ares_free(ptr->data.caa_reply.property);
+ if (ptr->data.caa_reply.value)
+ ares_free(ptr->data.caa_reply.value);
+ break;
+
+ default:
+ return;
+ }
+
+ ares_free(ptr);
+ dataptr = next_data;
+ }
+}
+
+
+/*
+** ares_malloc_data() - c-ares internal helper function.
+**
+** This function allocates memory for a c-ares private ares_data struct
+** for the specified ares_datatype, initializes c-ares private fields
+** and zero initializes those which later might be used from the public
+** API. It returns an interior pointer which can be passed by c-ares
+** functions to the calling application, and that must be free'ed using
+** c-ares external API function ares_free_data().
+*/
+
+void *ares_malloc_data(ares_datatype type)
+{
+ struct ares_data *ptr;
+
+ ptr = ares_malloc(sizeof(struct ares_data));
+ if (!ptr)
+ return NULL;
+
+ switch (type)
+ {
+ case ARES_DATATYPE_MX_REPLY:
+ ptr->data.mx_reply.next = NULL;
+ ptr->data.mx_reply.host = NULL;
+ ptr->data.mx_reply.priority = 0;
+ break;
+
+ case ARES_DATATYPE_SRV_REPLY:
+ ptr->data.srv_reply.next = NULL;
+ ptr->data.srv_reply.host = NULL;
+ ptr->data.srv_reply.priority = 0;
+ ptr->data.srv_reply.weight = 0;
+ ptr->data.srv_reply.port = 0;
+ break;
+
+ case ARES_DATATYPE_TXT_EXT:
+ ptr->data.txt_ext.record_start = 0;
+ /* FALLTHROUGH */
+
+ case ARES_DATATYPE_TXT_REPLY:
+ ptr->data.txt_reply.next = NULL;
+ ptr->data.txt_reply.txt = NULL;
+ ptr->data.txt_reply.length = 0;
+ break;
+
+ case ARES_DATATYPE_CAA_REPLY:
+ ptr->data.caa_reply.next = NULL;
+ ptr->data.caa_reply.plength = 0;
+ ptr->data.caa_reply.property = NULL;
+ ptr->data.caa_reply.length = 0;
+ ptr->data.caa_reply.value = NULL;
+ break;
+
+ case ARES_DATATYPE_ADDR_NODE:
+ ptr->data.addr_node.next = NULL;
+ ptr->data.addr_node.family = 0;
+ memset(&ptr->data.addr_node.addrV6, 0,
+ sizeof(ptr->data.addr_node.addrV6));
+ break;
+
+ case ARES_DATATYPE_ADDR_PORT_NODE:
+ ptr->data.addr_port_node.next = NULL;
+ ptr->data.addr_port_node.family = 0;
+ ptr->data.addr_port_node.udp_port = 0;
+ ptr->data.addr_port_node.tcp_port = 0;
+ memset(&ptr->data.addr_port_node.addrV6, 0,
+ sizeof(ptr->data.addr_port_node.addrV6));
+ break;
+
+ case ARES_DATATYPE_NAPTR_REPLY:
+ ptr->data.naptr_reply.next = NULL;
+ ptr->data.naptr_reply.flags = NULL;
+ ptr->data.naptr_reply.service = NULL;
+ ptr->data.naptr_reply.regexp = NULL;
+ ptr->data.naptr_reply.replacement = NULL;
+ ptr->data.naptr_reply.order = 0;
+ ptr->data.naptr_reply.preference = 0;
+ break;
+
+ case ARES_DATATYPE_SOA_REPLY:
+ ptr->data.soa_reply.nsname = NULL;
+ ptr->data.soa_reply.hostmaster = NULL;
+ ptr->data.soa_reply.serial = 0;
+ ptr->data.soa_reply.refresh = 0;
+ ptr->data.soa_reply.retry = 0;
+ ptr->data.soa_reply.expire = 0;
+ ptr->data.soa_reply.minttl = 0;
+ break;
+
+ default:
+ ares_free(ptr);
+ return NULL;
+ }
+
+ ptr->mark = ARES_DATATYPE_MARK;
+ ptr->type = type;
+
+ return &ptr->data;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_data.h b/grpc/third_party/cares/cares/src/lib/ares_data.h
new file mode 100644
index 00000000..b0182fd6
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_data.h
@@ -0,0 +1,74 @@
+
+/* Copyright (C) 2009-2013 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+typedef enum {
+ ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */
+ ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */
+ ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */
+ ARES_DATATYPE_TXT_EXT, /* struct ares_txt_ext - introduced in 1.11.0 */
+ ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */
+ ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */
+ ARES_DATATYPE_NAPTR_REPLY,/* struct ares_naptr_reply - introduced in 1.7.6 */
+ ARES_DATATYPE_SOA_REPLY, /* struct ares_soa_reply - introduced in 1.9.0 */
+#if 0
+ ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */
+ ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */
+ ARES_DATATYPE_HOSTENT, /* struct hostent */
+ ARES_DATATYPE_OPTIONS, /* struct ares_options */
+#endif
+ ARES_DATATYPE_ADDR_PORT_NODE, /* struct ares_addr_port_node - introduced in 1.11.0 */
+ ARES_DATATYPE_CAA_REPLY, /* struct ares_caa_reply - introduced in 1.17 */
+ ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */
+} ares_datatype;
+
+#define ARES_DATATYPE_MARK 0xbead
+
+/*
+ * ares_data struct definition is internal to c-ares and shall not
+ * be exposed by the public API in order to allow future changes
+ * and extensions to it without breaking ABI. This will be used
+ * internally by c-ares as the container of multiple types of data
+ * dynamically allocated for which a reference will be returned
+ * to the calling application.
+ *
+ * c-ares API functions returning a pointer to c-ares internally
+ * allocated data will actually be returning an interior pointer
+ * into this ares_data struct.
+ *
+ * All this is 'invisible' to the calling application, the only
+ * requirement is that this kind of data must be free'ed by the
+ * calling application using ares_free_data() with the pointer
+ * it has received from a previous c-ares function call.
+ */
+
+struct ares_data {
+ ares_datatype type; /* Actual data type identifier. */
+ unsigned int mark; /* Private ares_data signature. */
+ union {
+ struct ares_txt_reply txt_reply;
+ struct ares_txt_ext txt_ext;
+ struct ares_srv_reply srv_reply;
+ struct ares_addr_node addr_node;
+ struct ares_addr_port_node addr_port_node;
+ struct ares_mx_reply mx_reply;
+ struct ares_naptr_reply naptr_reply;
+ struct ares_soa_reply soa_reply;
+ struct ares_caa_reply caa_reply;
+ } data;
+};
+
+void *ares_malloc_data(ares_datatype type);
+
diff --git a/grpc/third_party/cares/cares/ares_destroy.c b/grpc/third_party/cares/cares/src/lib/ares_destroy.c
index fed2009a..fed2009a 100644
--- a/grpc/third_party/cares/cares/ares_destroy.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_destroy.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_expand_name.c b/grpc/third_party/cares/cares/src/lib/ares_expand_name.c
new file mode 100644
index 00000000..a62c982e
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_expand_name.c
@@ -0,0 +1,300 @@
+
+/* Copyright 1998, 2011 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_nowarn.h"
+#include "ares_private.h" /* for the memdebug */
+
+/* Maximum number of indirections allowed for a name */
+#define MAX_INDIRS 50
+
+static int name_length(const unsigned char *encoded, const unsigned char *abuf,
+ int alen, int is_hostname);
+
+/* Reserved characters for names that need to be escaped */
+static int is_reservedch(int ch)
+{
+ switch (ch) {
+ case '"':
+ case '.':
+ case ';':
+ case '\\':
+ case '(':
+ case ')':
+ case '@':
+ case '$':
+ return 1;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static int ares__isprint(int ch)
+{
+ if (ch >= 0x20 && ch <= 0x7E)
+ return 1;
+ return 0;
+}
+
+/* Character set allowed by hostnames */
+static int is_hostnamech(int ch)
+{
+ /* [A-Za-z0-9-.]
+ * Don't use isalnum() as it is locale-specific
+ */
+ if (ch >= 'A' && ch <= 'Z')
+ return 1;
+ if (ch >= 'a' && ch <= 'z')
+ return 1;
+ if (ch >= '0' && ch <= '9')
+ return 1;
+ if (ch == '-' || ch == '.')
+ return 1;
+
+ return 0;
+}
+
+/* Expand an RFC1035-encoded domain name given by encoded. The
+ * containing message is given by abuf and alen. The result given by
+ * *s, which is set to a NUL-terminated allocated buffer. *enclen is
+ * set to the length of the encoded name (not the length of the
+ * expanded name; the goal is to tell the caller how many bytes to
+ * move forward to get past the encoded name).
+ *
+ * In the simple case, an encoded name is a series of labels, each
+ * composed of a one-byte length (limited to values between 0 and 63
+ * inclusive) followed by the label contents. The name is terminated
+ * by a zero-length label.
+ *
+ * In the more complicated case, a label may be terminated by an
+ * indirection pointer, specified by two bytes with the high bits of
+ * the first byte (corresponding to INDIR_MASK) set to 11. With the
+ * two high bits of the first byte stripped off, the indirection
+ * pointer gives an offset from the beginning of the containing
+ * message with more labels to decode. Indirection can happen an
+ * arbitrary number of times, so we have to detect loops.
+ *
+ * Since the expanded name uses '.' as a label separator, we use
+ * backslashes to escape periods or backslashes in the expanded name.
+ *
+ * If the result is expected to be a hostname, then no escaped data is allowed
+ * and will return error.
+ */
+
+int ares__expand_name_validated(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen, char **s, long *enclen,
+ int is_hostname)
+{
+ int len, indir = 0;
+ char *q;
+ const unsigned char *p;
+ union {
+ ares_ssize_t sig;
+ size_t uns;
+ } nlen;
+
+ nlen.sig = name_length(encoded, abuf, alen, is_hostname);
+ if (nlen.sig < 0)
+ return ARES_EBADNAME;
+
+ *s = ares_malloc(nlen.uns + 1);
+ if (!*s)
+ return ARES_ENOMEM;
+ q = *s;
+
+ if (nlen.uns == 0) {
+ /* RFC2181 says this should be ".": the root of the DNS tree.
+ * Since this function strips trailing dots though, it becomes ""
+ */
+ q[0] = '\0';
+
+ /* indirect root label (like 0xc0 0x0c) is 2 bytes long (stupid, but
+ valid) */
+ if ((*encoded & INDIR_MASK) == INDIR_MASK)
+ *enclen = 2L;
+ else
+ *enclen = 1L; /* the caller should move one byte to get past this */
+
+ return ARES_SUCCESS;
+ }
+
+ /* No error-checking necessary; it was all done by name_length(). */
+ p = encoded;
+ while (*p)
+ {
+ if ((*p & INDIR_MASK) == INDIR_MASK)
+ {
+ if (!indir)
+ {
+ *enclen = aresx_uztosl(p + 2U - encoded);
+ indir = 1;
+ }
+ p = abuf + ((*p & ~INDIR_MASK) << 8 | *(p + 1));
+ }
+ else
+ {
+ int name_len = *p;
+ len = name_len;
+ p++;
+
+ while (len--)
+ {
+ /* Output as \DDD for consistency with RFC1035 5.1, except
+ * for the special case of a root name response */
+ if (!ares__isprint(*p) && !(name_len == 1 && *p == 0))
+ {
+ *q++ = '\\';
+ *q++ = '0' + *p / 100;
+ *q++ = '0' + (*p % 100) / 10;
+ *q++ = '0' + (*p % 10);
+ }
+ else if (is_reservedch(*p))
+ {
+ *q++ = '\\';
+ *q++ = *p;
+ }
+ else
+ {
+ *q++ = *p;
+ }
+ p++;
+ }
+ *q++ = '.';
+ }
+ }
+
+ if (!indir)
+ *enclen = aresx_uztosl(p + 1U - encoded);
+
+ /* Nuke the trailing period if we wrote one. */
+ if (q > *s)
+ *(q - 1) = 0;
+ else
+ *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */
+
+ return ARES_SUCCESS;
+}
+
+
+int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
+ int alen, char **s, long *enclen)
+{
+ return ares__expand_name_validated(encoded, abuf, alen, s, enclen, 0);
+}
+
+/* Return the length of the expansion of an encoded domain name, or
+ * -1 if the encoding is invalid.
+ */
+static int name_length(const unsigned char *encoded, const unsigned char *abuf,
+ int alen, int is_hostname)
+{
+ int n = 0, offset, indir = 0, top;
+
+ /* Allow the caller to pass us abuf + alen and have us check for it. */
+ if (encoded >= abuf + alen)
+ return -1;
+
+ while (*encoded)
+ {
+ top = (*encoded & INDIR_MASK);
+ if (top == INDIR_MASK)
+ {
+ /* Check the offset and go there. */
+ if (encoded + 1 >= abuf + alen)
+ return -1;
+ offset = (*encoded & ~INDIR_MASK) << 8 | *(encoded + 1);
+ if (offset >= alen)
+ return -1;
+ encoded = abuf + offset;
+
+ /* If we've seen more indirects than the message length,
+ * then there's a loop.
+ */
+ ++indir;
+ if (indir > alen || indir > MAX_INDIRS)
+ return -1;
+ }
+ else if (top == 0x00)
+ {
+ int name_len = *encoded;
+ offset = name_len;
+ if (encoded + offset + 1 >= abuf + alen)
+ return -1;
+ encoded++;
+
+ while (offset--)
+ {
+ if (!ares__isprint(*encoded) && !(name_len == 1 && *encoded == 0))
+ {
+ if (is_hostname)
+ return -1;
+ n += 4;
+ }
+ else if (is_reservedch(*encoded))
+ {
+ if (is_hostname)
+ return -1;
+ n += 2;
+ }
+ else
+ {
+ if (is_hostname && !is_hostnamech(*encoded))
+ return -1;
+ n += 1;
+ }
+ encoded++;
+ }
+
+ n++;
+ }
+ else
+ {
+ /* RFC 1035 4.1.4 says other options (01, 10) for top 2
+ * bits are reserved.
+ */
+ return -1;
+ }
+ }
+
+ /* If there were any labels at all, then the number of dots is one
+ * less than the number of labels, so subtract one.
+ */
+ return (n) ? n - 1 : n;
+}
+
+/* Like ares_expand_name_validated but returns EBADRESP in case of invalid
+ * input. */
+int ares__expand_name_for_response(const unsigned char *encoded,
+ const unsigned char *abuf, int alen,
+ char **s, long *enclen, int is_hostname)
+{
+ int status = ares__expand_name_validated(encoded, abuf, alen, s, enclen,
+ is_hostname);
+ if (status == ARES_EBADNAME)
+ status = ARES_EBADRESP;
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_expand_string.c b/grpc/third_party/cares/cares/src/lib/ares_expand_string.c
new file mode 100644
index 00000000..03e39299
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_expand_string.c
@@ -0,0 +1,67 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_private.h" /* for the memdebug */
+
+/* Simply decodes a length-encoded character string. The first byte of the
+ * input is the length of the string to be returned and the bytes thereafter
+ * are the characters of the string. The returned result will be NULL
+ * terminated.
+ */
+int ares_expand_string(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen,
+ unsigned char **s,
+ long *enclen)
+{
+ unsigned char *q;
+ union {
+ ares_ssize_t sig;
+ size_t uns;
+ } elen;
+
+ if (encoded == abuf+alen)
+ return ARES_EBADSTR;
+
+ elen.uns = *encoded;
+ if (encoded+elen.sig+1 > abuf+alen)
+ return ARES_EBADSTR;
+
+ encoded++;
+
+ *s = ares_malloc(elen.uns+1);
+ if (*s == NULL)
+ return ARES_ENOMEM;
+ q = *s;
+ strncpy((char *)q, (char *)encoded, elen.uns);
+ q[elen.uns] = '\0';
+
+ *s = q;
+
+ *enclen = (long)(elen.sig+1);
+
+ return ARES_SUCCESS;
+}
+
diff --git a/grpc/third_party/cares/cares/ares_fds.c b/grpc/third_party/cares/cares/src/lib/ares_fds.c
index f405fc04..f405fc04 100644
--- a/grpc/third_party/cares/cares/ares_fds.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_fds.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_free_hostent.c b/grpc/third_party/cares/cares/src/lib/ares_free_hostent.c
new file mode 100644
index 00000000..ea28ff0e
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_free_hostent.c
@@ -0,0 +1,43 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include "ares.h"
+#include "ares_private.h" /* for memdebug */
+
+void ares_free_hostent(struct hostent *host)
+{
+ char **p;
+
+ if (!host)
+ return;
+
+ ares_free((char *)(host->h_name));
+ for (p = host->h_aliases; p && *p; p++)
+ ares_free(*p);
+ ares_free(host->h_aliases);
+ if (host->h_addr_list) {
+ ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries,
+ there is only one malloc for all of them */
+ ares_free(host->h_addr_list);
+ }
+ ares_free(host);
+}
diff --git a/grpc/third_party/cares/cares/ares_free_string.c b/grpc/third_party/cares/cares/src/lib/ares_free_string.c
index 024992e1..024992e1 100644
--- a/grpc/third_party/cares/cares/ares_free_string.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_free_string.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_freeaddrinfo.c b/grpc/third_party/cares/cares/src/lib/ares_freeaddrinfo.c
new file mode 100644
index 00000000..d8891bbf
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_freeaddrinfo.c
@@ -0,0 +1,59 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#include "ares.h"
+#include "ares_private.h"
+
+void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *head)
+{
+ struct ares_addrinfo_cname *current;
+ while (head)
+ {
+ current = head;
+ head = head->next;
+ ares_free(current->alias);
+ ares_free(current->name);
+ ares_free(current);
+ }
+}
+
+void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *head)
+{
+ struct ares_addrinfo_node *current;
+ while (head)
+ {
+ current = head;
+ head = head->ai_next;
+ ares_free(current->ai_addr);
+ ares_free(current);
+ }
+}
+
+void ares_freeaddrinfo(struct ares_addrinfo *ai)
+{
+ if (ai == NULL)
+ return;
+ ares__freeaddrinfo_cnames(ai->cnames);
+ ares__freeaddrinfo_nodes(ai->nodes);
+ ares_free(ai);
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_getaddrinfo.c b/grpc/third_party/cares/cares/src/lib/ares_getaddrinfo.c
new file mode 100644
index 00000000..db17a670
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_getaddrinfo.c
@@ -0,0 +1,772 @@
+
+/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2017 - 2018 by Christian Ammer
+ * Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_GETSERVBYNAME_R
+# if !defined(GETSERVBYNAME_R_ARGS) || \
+ (GETSERVBYNAME_R_ARGS < 4) || (GETSERVBYNAME_R_ARGS > 6)
+# error "you MUST specifiy a valid number of arguments for getservbyname_r"
+# endif
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <assert.h>
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include "ares.h"
+#include "bitncmp.h"
+#include "ares_private.h"
+
+#ifdef WATT32
+#undef WIN32
+#endif
+#ifdef WIN32
+# include "ares_platform.h"
+#endif
+
+struct host_query
+{
+ ares_channel channel;
+ char *name;
+ unsigned short port; /* in host order */
+ ares_addrinfo_callback callback;
+ void *arg;
+ struct ares_addrinfo_hints hints;
+ int sent_family; /* this family is what was is being used */
+ int timeouts; /* number of timeouts we saw for this request */
+ const char *remaining_lookups; /* types of lookup we need to perform ("fb" by
+ default, file and dns respectively) */
+ struct ares_addrinfo *ai; /* store results between lookups */
+ int remaining; /* number of DNS answers waiting for */
+ int next_domain; /* next search domain to try */
+};
+
+static const struct ares_addrinfo_hints default_hints = {
+ 0, /* ai_flags */
+ AF_UNSPEC, /* ai_family */
+ 0, /* ai_socktype */
+ 0, /* ai_protocol */
+};
+
+static const struct ares_addrinfo_cname empty_addrinfo_cname = {
+ INT_MAX, /* ttl */
+ NULL, /* alias */
+ NULL, /* name */
+ NULL, /* next */
+};
+
+static const struct ares_addrinfo_node empty_addrinfo_node = {
+ 0, /* ai_ttl */
+ 0, /* ai_flags */
+ 0, /* ai_family */
+ 0, /* ai_socktype */
+ 0, /* ai_protocol */
+ 0, /* ai_addrlen */
+ NULL, /* ai_addr */
+ NULL /* ai_next */
+};
+
+static const struct ares_addrinfo empty_addrinfo = {
+ NULL, /* cnames */
+ NULL /* nodes */
+};
+
+/* forward declarations */
+static void host_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen);
+static int as_is_first(const struct host_query *hquery);
+static int next_dns_lookup(struct host_query *hquery);
+
+struct ares_addrinfo_cname *ares__malloc_addrinfo_cname()
+{
+ struct ares_addrinfo_cname *cname = ares_malloc(sizeof(struct ares_addrinfo_cname));
+ if (!cname)
+ return NULL;
+
+ *cname = empty_addrinfo_cname;
+ return cname;
+}
+
+struct ares_addrinfo_cname *ares__append_addrinfo_cname(struct ares_addrinfo_cname **head)
+{
+ struct ares_addrinfo_cname *tail = ares__malloc_addrinfo_cname();
+ struct ares_addrinfo_cname *last = *head;
+ if (!last)
+ {
+ *head = tail;
+ return tail;
+ }
+
+ while (last->next)
+ {
+ last = last->next;
+ }
+
+ last->next = tail;
+ return tail;
+}
+
+void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head,
+ struct ares_addrinfo_cname *tail)
+{
+ struct ares_addrinfo_cname *last = *head;
+ if (!last)
+ {
+ *head = tail;
+ return;
+ }
+
+ while (last->next)
+ {
+ last = last->next;
+ }
+
+ last->next = tail;
+}
+
+struct ares_addrinfo *ares__malloc_addrinfo()
+{
+ struct ares_addrinfo *ai = ares_malloc(sizeof(struct ares_addrinfo));
+ if (!ai)
+ return NULL;
+
+ *ai = empty_addrinfo;
+ return ai;
+}
+
+struct ares_addrinfo_node *ares__malloc_addrinfo_node()
+{
+ struct ares_addrinfo_node *node =
+ ares_malloc(sizeof(struct ares_addrinfo_node));
+ if (!node)
+ return NULL;
+
+ *node = empty_addrinfo_node;
+ return node;
+}
+
+/* Allocate new addrinfo and append to the tail. */
+struct ares_addrinfo_node *ares__append_addrinfo_node(struct ares_addrinfo_node **head)
+{
+ struct ares_addrinfo_node *tail = ares__malloc_addrinfo_node();
+ struct ares_addrinfo_node *last = *head;
+ if (!last)
+ {
+ *head = tail;
+ return tail;
+ }
+
+ while (last->ai_next)
+ {
+ last = last->ai_next;
+ }
+
+ last->ai_next = tail;
+ return tail;
+}
+
+void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head,
+ struct ares_addrinfo_node *tail)
+{
+ struct ares_addrinfo_node *last = *head;
+ if (!last)
+ {
+ *head = tail;
+ return;
+ }
+
+ while (last->ai_next)
+ {
+ last = last->ai_next;
+ }
+
+ last->ai_next = tail;
+}
+
+/* Resolve service name into port number given in host byte order.
+ * If not resolved, return 0.
+ */
+static unsigned short lookup_service(const char *service, int flags)
+{
+ const char *proto;
+ struct servent *sep;
+#ifdef HAVE_GETSERVBYNAME_R
+ struct servent se;
+ char tmpbuf[4096];
+#endif
+
+ if (service)
+ {
+ if (flags & ARES_NI_UDP)
+ proto = "udp";
+ else if (flags & ARES_NI_SCTP)
+ proto = "sctp";
+ else if (flags & ARES_NI_DCCP)
+ proto = "dccp";
+ else
+ proto = "tcp";
+#ifdef HAVE_GETSERVBYNAME_R
+ memset(&se, 0, sizeof(se));
+ sep = &se;
+ memset(tmpbuf, 0, sizeof(tmpbuf));
+#if GETSERVBYNAME_R_ARGS == 6
+ if (getservbyname_r(service, proto, &se, (void *)tmpbuf, sizeof(tmpbuf),
+ &sep) != 0)
+ sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */
+#elif GETSERVBYNAME_R_ARGS == 5
+ sep =
+ getservbyname_r(service, proto, &se, (void *)tmpbuf, sizeof(tmpbuf));
+#elif GETSERVBYNAME_R_ARGS == 4
+ if (getservbyname_r(service, proto, &se, (void *)tmpbuf) != 0)
+ sep = NULL;
+#else
+ /* Lets just hope the OS uses TLS! */
+ sep = getservbyname(service, proto);
+#endif
+#else
+ /* Lets just hope the OS uses TLS! */
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+ sep = getservbyname(service, (char *)proto);
+#else
+ sep = getservbyname(service, proto);
+#endif
+#endif
+ return (sep ? ntohs((unsigned short)sep->s_port) : 0);
+ }
+ return 0;
+}
+
+/* If the name looks like an IP address or an error occured,
+ * fake up a host entry, end the query immediately, and return true.
+ * Otherwise return false.
+ */
+static int fake_addrinfo(const char *name,
+ unsigned short port,
+ const struct ares_addrinfo_hints *hints,
+ struct ares_addrinfo *ai,
+ ares_addrinfo_callback callback,
+ void *arg)
+{
+ struct ares_addrinfo_cname *cname;
+ struct ares_addrinfo_node *node;
+ ares_sockaddr addr;
+ size_t addrlen;
+ int result = 0;
+ int family = hints->ai_family;
+ if (family == AF_INET || family == AF_INET6 || family == AF_UNSPEC)
+ {
+ /* It only looks like an IP address if it's all numbers and dots. */
+ int numdots = 0, valid = 1;
+ const char *p;
+ for (p = name; *p; p++)
+ {
+ if (!ISDIGIT(*p) && *p != '.')
+ {
+ valid = 0;
+ break;
+ }
+ else if (*p == '.')
+ {
+ numdots++;
+ }
+ }
+
+ memset(&addr, 0, sizeof(addr));
+
+ /* if we don't have 3 dots, it is illegal
+ * (although inet_pton doesn't think so).
+ */
+ if (numdots != 3 || !valid)
+ result = 0;
+ else
+ result =
+ (ares_inet_pton(AF_INET, name, &addr.sa4.sin_addr) < 1 ? 0 : 1);
+
+ if (result)
+ {
+ family = addr.sa.sa_family = AF_INET;
+ addr.sa4.sin_port = htons(port);
+ addrlen = sizeof(addr.sa4);
+ }
+ }
+
+ if (family == AF_INET6 || family == AF_UNSPEC)
+ {
+ result =
+ (ares_inet_pton(AF_INET6, name, &addr.sa6.sin6_addr) < 1 ? 0 : 1);
+ addr.sa6.sin6_family = AF_INET6;
+ addr.sa6.sin6_port = htons(port);
+ addrlen = sizeof(addr.sa6);
+ }
+
+ if (!result)
+ return 0;
+
+ node = ares__malloc_addrinfo_node();
+ if (!node)
+ {
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return 1;
+ }
+
+ ai->nodes = node;
+
+ node->ai_addr = ares_malloc(addrlen);
+ if (!node->ai_addr)
+ {
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return 1;
+ }
+
+ node->ai_addrlen = (unsigned int)addrlen;
+ node->ai_family = addr.sa.sa_family;
+ if (addr.sa.sa_family == AF_INET)
+ memcpy(node->ai_addr, &addr.sa4, sizeof(addr.sa4));
+ else
+ memcpy(node->ai_addr, &addr.sa6, sizeof(addr.sa6));
+
+ if (hints->ai_flags & ARES_AI_CANONNAME)
+ {
+ cname = ares__append_addrinfo_cname(&ai->cnames);
+ if (!cname)
+ {
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return 1;
+ }
+
+ /* Duplicate the name, to avoid a constness violation. */
+ cname->name = ares_strdup(name);
+ if (!cname->name)
+ {
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return 1;
+ }
+ }
+
+ node->ai_socktype = hints->ai_socktype;
+ node->ai_protocol = hints->ai_protocol;
+
+ callback(arg, ARES_SUCCESS, 0, ai);
+ return 1;
+}
+
+static void end_hquery(struct host_query *hquery, int status)
+{
+ struct ares_addrinfo_node sentinel;
+ struct ares_addrinfo_node *next;
+ if (status == ARES_SUCCESS)
+ {
+ if (!(hquery->hints.ai_flags & ARES_AI_NOSORT) && hquery->ai->nodes)
+ {
+ sentinel.ai_next = hquery->ai->nodes;
+ ares__sortaddrinfo(hquery->channel, &sentinel);
+ hquery->ai->nodes = sentinel.ai_next;
+ }
+ next = hquery->ai->nodes;
+ /* Set port into each address (resolved separately). */
+ while (next)
+ {
+ next->ai_socktype = hquery->hints.ai_socktype;
+ next->ai_protocol = hquery->hints.ai_protocol;
+ if (next->ai_family == AF_INET)
+ {
+ (CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr))->sin_port = htons(hquery->port);
+ }
+ else
+ {
+ (CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr))->sin6_port = htons(hquery->port);
+ }
+ next = next->ai_next;
+ }
+ }
+ else
+ {
+ /* Clean up what we have collected by so far. */
+ ares_freeaddrinfo(hquery->ai);
+ hquery->ai = NULL;
+ }
+
+ hquery->callback(hquery->arg, status, hquery->timeouts, hquery->ai);
+ ares_free(hquery->name);
+ ares_free(hquery);
+}
+
+static int file_lookup(struct host_query *hquery)
+{
+ FILE *fp;
+ int error;
+ int status;
+ const char *path_hosts = NULL;
+
+ if (hquery->hints.ai_flags & ARES_AI_ENVHOSTS)
+ {
+ path_hosts = getenv("CARES_HOSTS");
+ }
+
+ if (!path_hosts)
+ {
+#ifdef WIN32
+ char PATH_HOSTS[MAX_PATH];
+ win_platform platform;
+
+ PATH_HOSTS[0] = '\0';
+
+ platform = ares__getplatform();
+
+ if (platform == WIN_NT)
+ {
+ char tmp[MAX_PATH];
+ HKEY hkeyHosts;
+
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
+ &hkeyHosts) == ERROR_SUCCESS)
+ {
+ DWORD dwLength = MAX_PATH;
+ RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
+ &dwLength);
+ ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
+ RegCloseKey(hkeyHosts);
+ }
+ }
+ else if (platform == WIN_9X)
+ GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
+ else
+ return ARES_ENOTFOUND;
+
+ strcat(PATH_HOSTS, WIN_PATH_HOSTS);
+ path_hosts = PATH_HOSTS;
+
+#elif defined(WATT32)
+ const char *PATH_HOSTS = _w32_GetHostsFile();
+
+ if (!PATH_HOSTS)
+ return ARES_ENOTFOUND;
+#endif
+ path_hosts = PATH_HOSTS;
+ }
+
+ fp = fopen(path_hosts, "r");
+ if (!fp)
+ {
+ error = ERRNO;
+ switch (error)
+ {
+ case ENOENT:
+ case ESRCH:
+ return ARES_ENOTFOUND;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n", error,
+ strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n", path_hosts));
+ return ARES_EFILE;
+ }
+ }
+ status = ares__readaddrinfo(fp, hquery->name, hquery->port, &hquery->hints, hquery->ai);
+ fclose(fp);
+ return status;
+}
+
+static void next_lookup(struct host_query *hquery, int status)
+{
+ switch (*hquery->remaining_lookups)
+ {
+ case 'b':
+ /* DNS lookup */
+ if (next_dns_lookup(hquery))
+ break;
+ hquery->remaining_lookups++;
+ next_lookup(hquery, status);
+ break;
+
+ case 'f':
+ /* Host file lookup */
+ if (file_lookup(hquery) == ARES_SUCCESS)
+ {
+ end_hquery(hquery, ARES_SUCCESS);
+ break;
+ }
+ hquery->remaining_lookups++;
+ next_lookup(hquery, status);
+ break;
+ default:
+ /* No lookup left */
+ end_hquery(hquery, status);
+ break;
+ }
+}
+
+static void host_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen)
+{
+ struct host_query *hquery = (struct host_query*)arg;
+ int addinfostatus = ARES_SUCCESS;
+ hquery->timeouts += timeouts;
+ hquery->remaining--;
+
+ if (status == ARES_SUCCESS)
+ {
+ addinfostatus = ares__parse_into_addrinfo(abuf, alen, hquery->ai);
+ }
+
+ if (!hquery->remaining)
+ {
+ if (addinfostatus != ARES_SUCCESS)
+ {
+ /* error in parsing result e.g. no memory */
+ end_hquery(hquery, addinfostatus);
+ }
+ else if (hquery->ai->nodes)
+ {
+ /* at least one query ended with ARES_SUCCESS */
+ end_hquery(hquery, ARES_SUCCESS);
+ }
+ else if (status == ARES_ENOTFOUND)
+ {
+ next_lookup(hquery, status);
+ }
+ else if (status == ARES_EDESTRUCTION)
+ {
+ /* NOTE: Could also be ARES_EDESTRUCTION. We need to only call this
+ * once all queries (there can be multiple for getaddrinfo) are
+ * terminated. */
+ end_hquery(hquery, status);
+ }
+ else
+ {
+ end_hquery(hquery, status);
+ }
+ }
+
+ /* at this point we keep on waiting for the next query to finish */
+}
+
+void ares_getaddrinfo(ares_channel channel,
+ const char* name, const char* service,
+ const struct ares_addrinfo_hints* hints,
+ ares_addrinfo_callback callback, void* arg)
+{
+ struct host_query *hquery;
+ unsigned short port = 0;
+ int family;
+ struct ares_addrinfo *ai;
+
+ if (!hints)
+ {
+ hints = &default_hints;
+ }
+
+ family = hints->ai_family;
+
+ /* Right now we only know how to look up Internet addresses
+ and unspec means try both basically. */
+ if (family != AF_INET &&
+ family != AF_INET6 &&
+ family != AF_UNSPEC)
+ {
+ callback(arg, ARES_ENOTIMP, 0, NULL);
+ return;
+ }
+
+ if (ares__is_onion_domain(name))
+ {
+ callback(arg, ARES_ENOTFOUND, 0, NULL);
+ return;
+ }
+
+ if (service)
+ {
+ if (hints->ai_flags & ARES_AI_NUMERICSERV)
+ {
+ port = (unsigned short)strtoul(service, NULL, 0);
+ if (!port)
+ {
+ callback(arg, ARES_ESERVICE, 0, NULL);
+ return;
+ }
+ }
+ else
+ {
+ port = lookup_service(service, 0);
+ if (!port)
+ {
+ port = (unsigned short)strtoul(service, NULL, 0);
+ if (!port)
+ {
+ callback(arg, ARES_ESERVICE, 0, NULL);
+ return;
+ }
+ }
+ }
+ }
+
+ ai = ares__malloc_addrinfo();
+ if (!ai)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+
+ if (fake_addrinfo(name, port, hints, ai, callback, arg))
+ {
+ return;
+ }
+
+ /* Allocate and fill in the host query structure. */
+ hquery = ares_malloc(sizeof(struct host_query));
+ if (!hquery)
+ {
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+
+ hquery->name = ares_strdup(name);
+ if (!hquery->name)
+ {
+ ares_free(hquery);
+ ares_freeaddrinfo(ai);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+
+ hquery->port = port;
+ hquery->channel = channel;
+ hquery->hints = *hints;
+ hquery->sent_family = -1; /* nothing is sent yet */
+ hquery->callback = callback;
+ hquery->arg = arg;
+ hquery->remaining_lookups = channel->lookups;
+ hquery->timeouts = 0;
+ hquery->ai = ai;
+ hquery->next_domain = -1;
+ hquery->remaining = 0;
+
+ /* Start performing lookups according to channel->lookups. */
+ next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */);
+}
+
+static int next_dns_lookup(struct host_query *hquery)
+{
+ char *s = NULL;
+ int is_s_allocated = 0;
+ int status;
+
+ /* if next_domain == -1 and as_is_first is true, try hquery->name */
+ if (hquery->next_domain == -1)
+ {
+ if (as_is_first(hquery))
+ {
+ s = hquery->name;
+ }
+ hquery->next_domain = 0;
+ }
+
+ /* if as_is_first is false, try hquery->name at last */
+ if (!s && hquery->next_domain == hquery->channel->ndomains) {
+ if (!as_is_first(hquery))
+ {
+ s = hquery->name;
+ }
+ hquery->next_domain++;
+ }
+
+ if (!s && hquery->next_domain < hquery->channel->ndomains)
+ {
+ status = ares__cat_domain(
+ hquery->name,
+ hquery->channel->domains[hquery->next_domain++],
+ &s);
+ if (status == ARES_SUCCESS)
+ {
+ is_s_allocated = 1;
+ }
+ }
+
+ if (s)
+ {
+ switch (hquery->hints.ai_family)
+ {
+ case AF_INET:
+ hquery->remaining += 1;
+ ares_query(hquery->channel, s, C_IN, T_A, host_callback, hquery);
+ break;
+ case AF_INET6:
+ hquery->remaining += 1;
+ ares_query(hquery->channel, s, C_IN, T_AAAA, host_callback, hquery);
+ break;
+ case AF_UNSPEC:
+ hquery->remaining += 2;
+ ares_query(hquery->channel, s, C_IN, T_A, host_callback, hquery);
+ ares_query(hquery->channel, s, C_IN, T_AAAA, host_callback, hquery);
+ break;
+ default: break;
+ }
+ if (is_s_allocated)
+ {
+ ares_free(s);
+ }
+ return 1;
+ }
+ else
+ {
+ assert(!hquery->ai->nodes);
+ return 0;
+ }
+}
+
+static int as_is_first(const struct host_query* hquery)
+{
+ char* p;
+ int ndots = 0;
+ size_t nname = strlen(hquery->name);
+ for (p = hquery->name; *p; p++)
+ {
+ if (*p == '.')
+ {
+ ndots++;
+ }
+ }
+ if (nname && hquery->name[nname-1] == '.')
+ {
+ /* prevent ARES_EBADNAME for valid FQDN, where ndots < channel->ndots */
+ return 1;
+ }
+ return ndots >= hquery->channel->ndots;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_getenv.c b/grpc/third_party/cares/cares/src/lib/ares_getenv.c
new file mode 100644
index 00000000..f6e4dc29
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_getenv.c
@@ -0,0 +1,28 @@
+
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+#include "ares_getenv.h"
+
+#ifndef HAVE_GETENV
+
+char *ares_getenv(const char *name)
+{
+ return NULL;
+}
+
+#endif
diff --git a/grpc/third_party/cares/cares/ares_getenv.h b/grpc/third_party/cares/cares/src/lib/ares_getenv.h
index 6da6cc50..6da6cc50 100644
--- a/grpc/third_party/cares/cares/ares_getenv.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_getenv.h
diff --git a/grpc/third_party/cares/cares/src/lib/ares_gethostbyaddr.c b/grpc/third_party/cares/cares/src/lib/ares_gethostbyaddr.c
new file mode 100644
index 00000000..c62d230d
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_gethostbyaddr.c
@@ -0,0 +1,287 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_inet_net_pton.h"
+#include "ares_platform.h"
+#include "ares_private.h"
+
+#ifdef WATT32
+#undef WIN32
+#endif
+
+struct addr_query {
+ /* Arguments passed to ares_gethostbyaddr() */
+ ares_channel channel;
+ struct ares_addr addr;
+ ares_host_callback callback;
+ void *arg;
+
+ const char *remaining_lookups;
+ int timeouts;
+};
+
+static void next_lookup(struct addr_query *aquery);
+static void addr_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen);
+static void end_aquery(struct addr_query *aquery, int status,
+ struct hostent *host);
+static int file_lookup(struct ares_addr *addr, struct hostent **host);
+static void ptr_rr_name(char *name, const struct ares_addr *addr);
+
+void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
+ int family, ares_host_callback callback, void *arg)
+{
+ struct addr_query *aquery;
+
+ if (family != AF_INET && family != AF_INET6)
+ {
+ callback(arg, ARES_ENOTIMP, 0, NULL);
+ return;
+ }
+
+ if ((family == AF_INET && addrlen != sizeof(aquery->addr.addrV4)) ||
+ (family == AF_INET6 && addrlen != sizeof(aquery->addr.addrV6)))
+ {
+ callback(arg, ARES_ENOTIMP, 0, NULL);
+ return;
+ }
+
+ aquery = ares_malloc(sizeof(struct addr_query));
+ if (!aquery)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+ aquery->channel = channel;
+ if (family == AF_INET)
+ memcpy(&aquery->addr.addrV4, addr, sizeof(aquery->addr.addrV4));
+ else
+ memcpy(&aquery->addr.addrV6, addr, sizeof(aquery->addr.addrV6));
+ aquery->addr.family = family;
+ aquery->callback = callback;
+ aquery->arg = arg;
+ aquery->remaining_lookups = channel->lookups;
+ aquery->timeouts = 0;
+
+ next_lookup(aquery);
+}
+
+static void next_lookup(struct addr_query *aquery)
+{
+ const char *p;
+ char name[128];
+ int status;
+ struct hostent *host;
+
+ for (p = aquery->remaining_lookups; *p; p++)
+ {
+ switch (*p)
+ {
+ case 'b':
+ ptr_rr_name(name, &aquery->addr);
+ aquery->remaining_lookups = p + 1;
+ ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
+ aquery);
+ return;
+ case 'f':
+ status = file_lookup(&aquery->addr, &host);
+
+ /* this status check below previously checked for !ARES_ENOTFOUND,
+ but we should not assume that this single error code is the one
+ that can occur, as that is in fact no longer the case */
+ if (status == ARES_SUCCESS)
+ {
+ end_aquery(aquery, status, host);
+ return;
+ }
+ break;
+ }
+ }
+ end_aquery(aquery, ARES_ENOTFOUND, NULL);
+}
+
+static void addr_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen)
+{
+ struct addr_query *aquery = (struct addr_query *) arg;
+ struct hostent *host;
+ size_t addrlen;
+
+ aquery->timeouts += timeouts;
+ if (status == ARES_SUCCESS)
+ {
+ if (aquery->addr.family == AF_INET)
+ {
+ addrlen = sizeof(aquery->addr.addrV4);
+ status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
+ (int)addrlen, AF_INET, &host);
+ }
+ else
+ {
+ addrlen = sizeof(aquery->addr.addrV6);
+ status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
+ (int)addrlen, AF_INET6, &host);
+ }
+ end_aquery(aquery, status, host);
+ }
+ else if (status == ARES_EDESTRUCTION || status == ARES_ECANCELLED)
+ end_aquery(aquery, status, NULL);
+ else
+ next_lookup(aquery);
+}
+
+static void end_aquery(struct addr_query *aquery, int status,
+ struct hostent *host)
+{
+ aquery->callback(aquery->arg, status, aquery->timeouts, host);
+ if (host)
+ ares_free_hostent(host);
+ ares_free(aquery);
+}
+
+static int file_lookup(struct ares_addr *addr, struct hostent **host)
+{
+ FILE *fp;
+ int status;
+ int error;
+
+#ifdef WIN32
+ char PATH_HOSTS[MAX_PATH];
+ win_platform platform;
+
+ PATH_HOSTS[0] = '\0';
+
+ platform = ares__getplatform();
+
+ if (platform == WIN_NT) {
+ char tmp[MAX_PATH];
+ HKEY hkeyHosts;
+
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
+ &hkeyHosts) == ERROR_SUCCESS)
+ {
+ DWORD dwLength = MAX_PATH;
+ RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
+ &dwLength);
+ ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
+ RegCloseKey(hkeyHosts);
+ }
+ }
+ else if (platform == WIN_9X)
+ GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
+ else
+ return ARES_ENOTFOUND;
+
+ strcat(PATH_HOSTS, WIN_PATH_HOSTS);
+
+#elif defined(WATT32)
+ const char *PATH_HOSTS = _w32_GetHostsFile();
+
+ if (!PATH_HOSTS)
+ return ARES_ENOTFOUND;
+#endif
+
+ fp = fopen(PATH_HOSTS, "r");
+ if (!fp)
+ {
+ error = ERRNO;
+ switch(error)
+ {
+ case ENOENT:
+ case ESRCH:
+ return ARES_ENOTFOUND;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ PATH_HOSTS));
+ *host = NULL;
+ return ARES_EFILE;
+ }
+ }
+ while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
+ {
+ if (addr->family != (*host)->h_addrtype)
+ {
+ ares_free_hostent(*host);
+ continue;
+ }
+ if (addr->family == AF_INET)
+ {
+ if (memcmp((*host)->h_addr, &addr->addrV4,
+ sizeof(addr->addrV4)) == 0)
+ break;
+ }
+ else if (addr->family == AF_INET6)
+ {
+ if (memcmp((*host)->h_addr, &addr->addrV6,
+ sizeof(addr->addrV6)) == 0)
+ break;
+ }
+ ares_free_hostent(*host);
+ }
+ fclose(fp);
+ if (status == ARES_EOF)
+ status = ARES_ENOTFOUND;
+ if (status != ARES_SUCCESS)
+ *host = NULL;
+ return status;
+}
+
+static void ptr_rr_name(char *name, const struct ares_addr *addr)
+{
+ if (addr->family == AF_INET)
+ {
+ unsigned long laddr = ntohl(addr->addrV4.s_addr);
+ unsigned long a1 = (laddr >> 24UL) & 0xFFUL;
+ unsigned long a2 = (laddr >> 16UL) & 0xFFUL;
+ unsigned long a3 = (laddr >> 8UL) & 0xFFUL;
+ unsigned long a4 = laddr & 0xFFUL;
+ sprintf(name, "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1);
+ }
+ else
+ {
+ unsigned char *bytes = (unsigned char *)&addr->addrV6;
+ /* There are too many arguments to do this in one line using
+ * minimally C89-compliant compilers */
+ sprintf(name,
+ "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
+ bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
+ bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
+ bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
+ bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4);
+ sprintf(name+strlen(name),
+ "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
+ bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
+ bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
+ bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
+ bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4);
+ }
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_gethostbyname.c b/grpc/third_party/cares/cares/src/lib/ares_gethostbyname.c
new file mode 100644
index 00000000..e0936363
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_gethostbyname.c
@@ -0,0 +1,534 @@
+
+/* Copyright 1998, 2011, 2013 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_inet_net_pton.h"
+#include "bitncmp.h"
+#include "ares_platform.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+#ifdef WATT32
+#undef WIN32
+#endif
+
+struct host_query {
+ /* Arguments passed to ares_gethostbyname() */
+ ares_channel channel;
+ char *name;
+ ares_host_callback callback;
+ void *arg;
+ int sent_family; /* this family is what was is being used */
+ int want_family; /* this family is what is asked for in the API */
+ const char *remaining_lookups;
+ int timeouts;
+};
+
+static void next_lookup(struct host_query *hquery, int status_code);
+static void host_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen);
+static void end_hquery(struct host_query *hquery, int status,
+ struct hostent *host);
+static int fake_hostent(const char *name, int family,
+ ares_host_callback callback, void *arg);
+static int file_lookup(const char *name, int family, struct hostent **host);
+static void sort_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort);
+static void sort6_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort);
+static int get_address_index(const struct in_addr *addr,
+ const struct apattern *sortlist, int nsort);
+static int get6_address_index(const struct ares_in6_addr *addr,
+ const struct apattern *sortlist, int nsort);
+
+void ares_gethostbyname(ares_channel channel, const char *name, int family,
+ ares_host_callback callback, void *arg)
+{
+ struct host_query *hquery;
+
+ /* Right now we only know how to look up Internet addresses - and unspec
+ means try both basically. */
+ switch (family) {
+ case AF_INET:
+ case AF_INET6:
+ case AF_UNSPEC:
+ break;
+ default:
+ callback(arg, ARES_ENOTIMP, 0, NULL);
+ return;
+ }
+
+ /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
+ if (ares__is_onion_domain(name))
+ {
+ callback(arg, ARES_ENOTFOUND, 0, NULL);
+ return;
+ }
+
+ if (fake_hostent(name, family, callback, arg))
+ return;
+
+ /* Allocate and fill in the host query structure. */
+ hquery = ares_malloc(sizeof(struct host_query));
+ if (!hquery)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+ hquery->channel = channel;
+ hquery->name = ares_strdup(name);
+ hquery->want_family = family;
+ hquery->sent_family = -1; /* nothing is sent yet */
+ if (!hquery->name) {
+ ares_free(hquery);
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return;
+ }
+ hquery->callback = callback;
+ hquery->arg = arg;
+ hquery->remaining_lookups = channel->lookups;
+ hquery->timeouts = 0;
+
+ /* Start performing lookups according to channel->lookups. */
+ next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */);
+}
+
+static void next_lookup(struct host_query *hquery, int status_code)
+{
+ const char *p;
+ struct hostent *host;
+ int status = status_code;
+
+ for (p = hquery->remaining_lookups; *p; p++)
+ {
+ switch (*p)
+ {
+ case 'b':
+ /* DNS lookup */
+ hquery->remaining_lookups = p + 1;
+ if ((hquery->want_family == AF_INET6) ||
+ (hquery->want_family == AF_UNSPEC)) {
+ /* if inet6 or unspec, start out with AAAA */
+ hquery->sent_family = AF_INET6;
+ ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
+ host_callback, hquery);
+ }
+ else {
+ hquery->sent_family = AF_INET;
+ ares_search(hquery->channel, hquery->name, C_IN, T_A,
+ host_callback, hquery);
+ }
+ return;
+
+ case 'f':
+ /* Host file lookup */
+ status = file_lookup(hquery->name, hquery->want_family, &host);
+
+ /* this status check below previously checked for !ARES_ENOTFOUND,
+ but we should not assume that this single error code is the one
+ that can occur, as that is in fact no longer the case */
+ if (status == ARES_SUCCESS)
+ {
+ end_hquery(hquery, status, host);
+ return;
+ }
+ status = status_code; /* Use original status code */
+ break;
+ }
+ }
+ end_hquery(hquery, status, NULL);
+}
+
+static void host_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen)
+{
+ struct host_query *hquery = (struct host_query *) arg;
+ ares_channel channel = hquery->channel;
+ struct hostent *host = NULL;
+
+ hquery->timeouts += timeouts;
+ if (status == ARES_SUCCESS)
+ {
+ if (hquery->sent_family == AF_INET)
+ {
+ status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
+ if (host && channel->nsort)
+ sort_addresses(host, channel->sortlist, channel->nsort);
+ }
+ else if (hquery->sent_family == AF_INET6)
+ {
+ status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
+ if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
+ (status == ARES_SUCCESS && host && host->h_addr_list[0] == NULL)) &&
+ hquery->want_family == AF_UNSPEC) {
+ /* The query returned something but either there were no AAAA
+ records (e.g. just CNAME) or the response was malformed. Try
+ looking up A instead. */
+ if (host)
+ ares_free_hostent(host);
+ hquery->sent_family = AF_INET;
+ ares_search(hquery->channel, hquery->name, C_IN, T_A,
+ host_callback, hquery);
+ return;
+ }
+ if (host && channel->nsort)
+ sort6_addresses(host, channel->sortlist, channel->nsort);
+ }
+ if (status == ARES_SUCCESS && host && host->h_addr_list[0] == NULL)
+ {
+ /* The query returned something but had no A/AAAA record
+ (even after potentially retrying AAAA with A)
+ so we should treat this as an error */
+ status = ARES_ENODATA;
+ }
+ end_hquery(hquery, status, host);
+ }
+ else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
+ status == ARES_ETIMEOUT) && (hquery->sent_family == AF_INET6 &&
+ hquery->want_family == AF_UNSPEC))
+ {
+ /* The AAAA query yielded no useful result. Now look up an A instead. */
+ hquery->sent_family = AF_INET;
+ ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
+ hquery);
+ }
+ else if (status == ARES_EDESTRUCTION)
+ end_hquery(hquery, status, NULL);
+ else
+ next_lookup(hquery, status);
+}
+
+static void end_hquery(struct host_query *hquery, int status,
+ struct hostent *host)
+{
+ hquery->callback(hquery->arg, status, hquery->timeouts, host);
+ if (host)
+ ares_free_hostent(host);
+ ares_free(hquery->name);
+ ares_free(hquery);
+}
+
+/* If the name looks like an IP address, fake up a host entry, end the
+ * query immediately, and return true. Otherwise return false.
+ */
+static int fake_hostent(const char *name, int family,
+ ares_host_callback callback, void *arg)
+{
+ struct hostent hostent;
+ char *aliases[1] = { NULL };
+ char *addrs[2];
+ int result = 0;
+ struct in_addr in;
+ struct ares_in6_addr in6;
+
+ if (family == AF_INET || family == AF_UNSPEC)
+ {
+ /* It only looks like an IP address if it's all numbers and dots. */
+ int numdots = 0, valid = 1;
+ const char *p;
+ for (p = name; *p; p++)
+ {
+ if (!ISDIGIT(*p) && *p != '.') {
+ valid = 0;
+ break;
+ } else if (*p == '.') {
+ numdots++;
+ }
+ }
+
+ /* if we don't have 3 dots, it is illegal
+ * (although inet_pton doesn't think so).
+ */
+ if (numdots != 3 || !valid) {
+ result = 0;
+ } else {
+ result = (ares_inet_pton(AF_INET, name, &in) < 1 ? 0 : 1);
+ }
+
+ /*
+ * Set address family in case of failure,
+ * as we will try to convert it later afterwards
+ */
+ family = result ? AF_INET : AF_INET6;
+ }
+ if (family == AF_INET6)
+ result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
+
+ if (!result)
+ return 0;
+
+ if (family == AF_INET)
+ {
+ hostent.h_length = (int)sizeof(struct in_addr);
+ addrs[0] = (char *)&in;
+ }
+ else if (family == AF_INET6)
+ {
+ hostent.h_length = (int)sizeof(struct ares_in6_addr);
+ addrs[0] = (char *)&in6;
+ }
+ /* Duplicate the name, to avoid a constness violation. */
+ hostent.h_name = ares_strdup(name);
+ if (!hostent.h_name)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL);
+ return 1;
+ }
+
+ /* Fill in the rest of the host structure and terminate the query. */
+ addrs[1] = NULL;
+ hostent.h_aliases = aliases;
+ hostent.h_addrtype = aresx_sitoss(family);
+ hostent.h_addr_list = addrs;
+ callback(arg, ARES_SUCCESS, 0, &hostent);
+
+ ares_free((char *)(hostent.h_name));
+ return 1;
+}
+
+/* This is an API method */
+int ares_gethostbyname_file(ares_channel channel, const char *name,
+ int family, struct hostent **host)
+{
+ int result;
+
+ /* We only take the channel to ensure that ares_init() been called. */
+ if(channel == NULL)
+ {
+ /* Anything will do, really. This seems fine, and is consistent with
+ other error cases. */
+ *host = NULL;
+ return ARES_ENOTFOUND;
+ }
+
+ /* Just chain to the internal implementation we use here; it's exactly
+ * what we want.
+ */
+ result = file_lookup(name, family, host);
+ if(result != ARES_SUCCESS)
+ {
+ /* We guarantee a NULL hostent on failure. */
+ *host = NULL;
+ }
+ return result;
+}
+
+static int file_lookup(const char *name, int family, struct hostent **host)
+{
+ FILE *fp;
+ char **alias;
+ int status;
+ int error;
+
+#ifdef WIN32
+ char PATH_HOSTS[MAX_PATH];
+ win_platform platform;
+
+ PATH_HOSTS[0] = '\0';
+
+ platform = ares__getplatform();
+
+ if (platform == WIN_NT) {
+ char tmp[MAX_PATH];
+ HKEY hkeyHosts;
+
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
+ &hkeyHosts) == ERROR_SUCCESS)
+ {
+ DWORD dwLength = MAX_PATH;
+ RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
+ &dwLength);
+ ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH);
+ RegCloseKey(hkeyHosts);
+ }
+ }
+ else if (platform == WIN_9X)
+ GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH);
+ else
+ return ARES_ENOTFOUND;
+
+ strcat(PATH_HOSTS, WIN_PATH_HOSTS);
+
+#elif defined(WATT32)
+ const char *PATH_HOSTS = _w32_GetHostsFile();
+
+ if (!PATH_HOSTS)
+ return ARES_ENOTFOUND;
+#endif
+
+ /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
+ if (ares__is_onion_domain(name))
+ return ARES_ENOTFOUND;
+
+
+ fp = fopen(PATH_HOSTS, "r");
+ if (!fp)
+ {
+ error = ERRNO;
+ switch(error)
+ {
+ case ENOENT:
+ case ESRCH:
+ return ARES_ENOTFOUND;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ PATH_HOSTS));
+ *host = NULL;
+ return ARES_EFILE;
+ }
+ }
+ while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
+ {
+ if (strcasecmp((*host)->h_name, name) == 0)
+ break;
+ for (alias = (*host)->h_aliases; *alias; alias++)
+ {
+ if (strcasecmp(*alias, name) == 0)
+ break;
+ }
+ if (*alias)
+ break;
+ ares_free_hostent(*host);
+ }
+ fclose(fp);
+ if (status == ARES_EOF)
+ status = ARES_ENOTFOUND;
+ if (status != ARES_SUCCESS)
+ *host = NULL;
+ return status;
+}
+
+static void sort_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort)
+{
+ struct in_addr a1, a2;
+ int i1, i2, ind1, ind2;
+
+ /* This is a simple insertion sort, not optimized at all. i1 walks
+ * through the address list, with the loop invariant that everything
+ * to the left of i1 is sorted. In the loop body, the value at i1 is moved
+ * back through the list (via i2) until it is in sorted order.
+ */
+ for (i1 = 0; host->h_addr_list[i1]; i1++)
+ {
+ memcpy(&a1, host->h_addr_list[i1], sizeof(struct in_addr));
+ ind1 = get_address_index(&a1, sortlist, nsort);
+ for (i2 = i1 - 1; i2 >= 0; i2--)
+ {
+ memcpy(&a2, host->h_addr_list[i2], sizeof(struct in_addr));
+ ind2 = get_address_index(&a2, sortlist, nsort);
+ if (ind2 <= ind1)
+ break;
+ memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct in_addr));
+ }
+ memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct in_addr));
+ }
+}
+
+/* Find the first entry in sortlist which matches addr. Return nsort
+ * if none of them match.
+ */
+static int get_address_index(const struct in_addr *addr,
+ const struct apattern *sortlist,
+ int nsort)
+{
+ int i;
+
+ for (i = 0; i < nsort; i++)
+ {
+ if (sortlist[i].family != AF_INET)
+ continue;
+ if (sortlist[i].type == PATTERN_MASK)
+ {
+ if ((addr->s_addr & sortlist[i].mask.addr4.s_addr)
+ == sortlist[i].addrV4.s_addr)
+ break;
+ }
+ else
+ {
+ if (!ares__bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
+ sortlist[i].mask.bits))
+ break;
+ }
+ }
+ return i;
+}
+
+static void sort6_addresses(struct hostent *host,
+ const struct apattern *sortlist, int nsort)
+{
+ struct ares_in6_addr a1, a2;
+ int i1, i2, ind1, ind2;
+
+ /* This is a simple insertion sort, not optimized at all. i1 walks
+ * through the address list, with the loop invariant that everything
+ * to the left of i1 is sorted. In the loop body, the value at i1 is moved
+ * back through the list (via i2) until it is in sorted order.
+ */
+ for (i1 = 0; host->h_addr_list[i1]; i1++)
+ {
+ memcpy(&a1, host->h_addr_list[i1], sizeof(struct ares_in6_addr));
+ ind1 = get6_address_index(&a1, sortlist, nsort);
+ for (i2 = i1 - 1; i2 >= 0; i2--)
+ {
+ memcpy(&a2, host->h_addr_list[i2], sizeof(struct ares_in6_addr));
+ ind2 = get6_address_index(&a2, sortlist, nsort);
+ if (ind2 <= ind1)
+ break;
+ memcpy(host->h_addr_list[i2 + 1], &a2, sizeof(struct ares_in6_addr));
+ }
+ memcpy(host->h_addr_list[i2 + 1], &a1, sizeof(struct ares_in6_addr));
+ }
+}
+
+/* Find the first entry in sortlist which matches addr. Return nsort
+ * if none of them match.
+ */
+static int get6_address_index(const struct ares_in6_addr *addr,
+ const struct apattern *sortlist,
+ int nsort)
+{
+ int i;
+
+ for (i = 0; i < nsort; i++)
+ {
+ if (sortlist[i].family != AF_INET6)
+ continue;
+ if (!ares__bitncmp(addr, &sortlist[i].addrV6, sortlist[i].mask.bits))
+ break;
+ }
+ return i;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_getnameinfo.c b/grpc/third_party/cares/cares/src/lib/ares_getnameinfo.c
new file mode 100644
index 00000000..966919ac
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_getnameinfo.c
@@ -0,0 +1,447 @@
+
+/* Copyright 2005 by Dominick Meglio
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+#include "ares_setup.h"
+
+#ifdef HAVE_GETSERVBYPORT_R
+# if !defined(GETSERVBYPORT_R_ARGS) || \
+ (GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
+# error "you MUST specifiy a valid number of arguments for getservbyport_r"
+# endif
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#include "ares.h"
+#include "ares_ipv6.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+struct nameinfo_query {
+ ares_nameinfo_callback callback;
+ void *arg;
+ union {
+ struct sockaddr_in addr4;
+ struct sockaddr_in6 addr6;
+ } addr;
+ int family;
+ int flags;
+ int timeouts;
+};
+
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+#define IPBUFSIZ \
+ (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") + IF_NAMESIZE)
+#else
+#define IPBUFSIZ \
+ (sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"))
+#endif
+
+static void nameinfo_callback(void *arg, int status, int timeouts,
+ struct hostent *host);
+static char *lookup_service(unsigned short port, int flags,
+ char *buf, size_t buflen);
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
+ char *buf, size_t buflen);
+#endif
+STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2);
+
+void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
+ ares_socklen_t salen,
+ int flags, ares_nameinfo_callback callback, void *arg)
+{
+ struct sockaddr_in *addr = NULL;
+ struct sockaddr_in6 *addr6 = NULL;
+ struct nameinfo_query *niquery;
+ unsigned int port = 0;
+
+ /* Validate socket address family and length */
+ if ((sa->sa_family == AF_INET) &&
+ (salen == sizeof(struct sockaddr_in)))
+ {
+ addr = CARES_INADDR_CAST(struct sockaddr_in *, sa);
+ port = addr->sin_port;
+ }
+ else if ((sa->sa_family == AF_INET6) &&
+ (salen == sizeof(struct sockaddr_in6)))
+ {
+ addr6 = CARES_INADDR_CAST(struct sockaddr_in6 *, sa);
+ port = addr6->sin6_port;
+ }
+ else
+ {
+ callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
+ return;
+ }
+
+ /* If neither, assume they want a host */
+ if (!(flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
+ flags |= ARES_NI_LOOKUPHOST;
+
+ /* All they want is a service, no need for DNS */
+ if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
+ {
+ char buf[33], *service;
+
+ service = lookup_service((unsigned short)(port & 0xffff),
+ flags, buf, sizeof(buf));
+ callback(arg, ARES_SUCCESS, 0, NULL, service);
+ return;
+ }
+
+ /* They want a host lookup */
+ if ((flags & ARES_NI_LOOKUPHOST))
+ {
+ /* A numeric host can be handled without DNS */
+ if ((flags & ARES_NI_NUMERICHOST))
+ {
+ char ipbuf[IPBUFSIZ];
+ char srvbuf[33];
+ char *service = NULL;
+ ipbuf[0] = 0;
+
+ /* Specifying not to lookup a host, but then saying a host
+ * is required has to be illegal.
+ */
+ if (flags & ARES_NI_NAMEREQD)
+ {
+ callback(arg, ARES_EBADFLAGS, 0, NULL, NULL);
+ return;
+ }
+ if (salen == sizeof(struct sockaddr_in6))
+ {
+ ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
+ /* If the system supports scope IDs, use it */
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+ append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
+#endif
+ }
+ else
+ {
+ ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
+ }
+ /* They also want a service */
+ if (flags & ARES_NI_LOOKUPSERVICE)
+ service = lookup_service((unsigned short)(port & 0xffff),
+ flags, srvbuf, sizeof(srvbuf));
+ callback(arg, ARES_SUCCESS, 0, ipbuf, service);
+ return;
+ }
+ /* This is where a DNS lookup becomes necessary */
+ else
+ {
+ niquery = ares_malloc(sizeof(struct nameinfo_query));
+ if (!niquery)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL, NULL);
+ return;
+ }
+ niquery->callback = callback;
+ niquery->arg = arg;
+ niquery->flags = flags;
+ niquery->timeouts = 0;
+ if (sa->sa_family == AF_INET)
+ {
+ niquery->family = AF_INET;
+ memcpy(&niquery->addr.addr4, addr, sizeof(niquery->addr.addr4));
+ ares_gethostbyaddr(channel, &addr->sin_addr,
+ sizeof(struct in_addr), AF_INET,
+ nameinfo_callback, niquery);
+ }
+ else
+ {
+ niquery->family = AF_INET6;
+ memcpy(&niquery->addr.addr6, addr6, sizeof(niquery->addr.addr6));
+ ares_gethostbyaddr(channel, &addr6->sin6_addr,
+ sizeof(struct ares_in6_addr), AF_INET6,
+ nameinfo_callback, niquery);
+ }
+ }
+ }
+}
+
+static void nameinfo_callback(void *arg, int status, int timeouts,
+ struct hostent *host)
+{
+ struct nameinfo_query *niquery = (struct nameinfo_query *) arg;
+ char srvbuf[33];
+ char *service = NULL;
+
+ niquery->timeouts += timeouts;
+ if (status == ARES_SUCCESS)
+ {
+ /* They want a service too */
+ if (niquery->flags & ARES_NI_LOOKUPSERVICE)
+ {
+ if (niquery->family == AF_INET)
+ service = lookup_service(niquery->addr.addr4.sin_port,
+ niquery->flags, srvbuf, sizeof(srvbuf));
+ else
+ service = lookup_service(niquery->addr.addr6.sin6_port,
+ niquery->flags, srvbuf, sizeof(srvbuf));
+ }
+ /* NOFQDN means we have to strip off the domain name portion. We do
+ this by determining our own domain name, then searching the string
+ for this domain name and removing it.
+ */
+#ifdef HAVE_GETHOSTNAME
+ if (niquery->flags & ARES_NI_NOFQDN)
+ {
+ char buf[255];
+ char *domain;
+ gethostname(buf, 255);
+ if ((domain = strchr(buf, '.')) != NULL)
+ {
+ char *end = ares_striendstr(host->h_name, domain);
+ if (end)
+ *end = 0;
+ }
+ }
+#endif
+ niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts,
+ (char *)(host->h_name),
+ service);
+ ares_free(niquery);
+ return;
+ }
+ /* We couldn't find the host, but it's OK, we can use the IP */
+ else if (status == ARES_ENOTFOUND && !(niquery->flags & ARES_NI_NAMEREQD))
+ {
+ char ipbuf[IPBUFSIZ];
+ if (niquery->family == AF_INET)
+ ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf,
+ IPBUFSIZ);
+ else
+ {
+ ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf,
+ IPBUFSIZ);
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+ append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf,
+ sizeof(ipbuf));
+#endif
+ }
+ /* They want a service too */
+ if (niquery->flags & ARES_NI_LOOKUPSERVICE)
+ {
+ if (niquery->family == AF_INET)
+ service = lookup_service(niquery->addr.addr4.sin_port,
+ niquery->flags, srvbuf, sizeof(srvbuf));
+ else
+ service = lookup_service(niquery->addr.addr6.sin6_port,
+ niquery->flags, srvbuf, sizeof(srvbuf));
+ }
+ niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf,
+ service);
+ ares_free(niquery);
+ return;
+ }
+ niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL);
+ ares_free(niquery);
+}
+
+static char *lookup_service(unsigned short port, int flags,
+ char *buf, size_t buflen)
+{
+ const char *proto;
+ struct servent *sep;
+#ifdef HAVE_GETSERVBYPORT_R
+ struct servent se;
+#endif
+ char tmpbuf[4096];
+ char *name;
+ size_t name_len;
+
+ if (port)
+ {
+ if (flags & ARES_NI_NUMERICSERV)
+ sep = NULL;
+ else
+ {
+ if (flags & ARES_NI_UDP)
+ proto = "udp";
+ else if (flags & ARES_NI_SCTP)
+ proto = "sctp";
+ else if (flags & ARES_NI_DCCP)
+ proto = "dccp";
+ else
+ proto = "tcp";
+#ifdef HAVE_GETSERVBYPORT_R
+ memset(&se, 0, sizeof(se));
+ sep = &se;
+ memset(tmpbuf, 0, sizeof(tmpbuf));
+#if GETSERVBYPORT_R_ARGS == 6
+ if (getservbyport_r(port, proto, &se, (void *)tmpbuf,
+ sizeof(tmpbuf), &sep) != 0)
+ sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */
+#elif GETSERVBYPORT_R_ARGS == 5
+ sep = getservbyport_r(port, proto, &se, (void *)tmpbuf,
+ sizeof(tmpbuf));
+#elif GETSERVBYPORT_R_ARGS == 4
+ if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0)
+ sep = NULL;
+#else
+ /* Lets just hope the OS uses TLS! */
+ sep = getservbyport(port, proto);
+#endif
+#else
+ /* Lets just hope the OS uses TLS! */
+#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
+ sep = getservbyport(port, (char*)proto);
+#else
+ sep = getservbyport(port, proto);
+#endif
+#endif
+ }
+ if (sep && sep->s_name)
+ {
+ /* get service name */
+ name = sep->s_name;
+ }
+ else
+ {
+ /* get port as a string */
+ sprintf(tmpbuf, "%u", (unsigned int)ntohs(port));
+ name = tmpbuf;
+ }
+ name_len = strlen(name);
+ if (name_len < buflen)
+ /* return it if buffer big enough */
+ memcpy(buf, name, name_len + 1);
+ else
+ /* avoid reusing previous one */
+ buf[0] = '\0'; /* LCOV_EXCL_LINE: no real service names are too big */
+ return buf;
+ }
+ buf[0] = '\0';
+ return NULL;
+}
+
+#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
+static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
+ char *buf, size_t buflen)
+{
+#ifdef HAVE_IF_INDEXTONAME
+ int is_ll, is_mcll;
+#endif
+ char tmpbuf[IF_NAMESIZE + 2];
+ size_t bufl;
+ int is_scope_long = sizeof(addr6->sin6_scope_id) > sizeof(unsigned int);
+
+ tmpbuf[0] = '%';
+
+#ifdef HAVE_IF_INDEXTONAME
+ is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
+ is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
+ if ((flags & ARES_NI_NUMERICSCOPE) ||
+ (!is_ll && !is_mcll))
+ {
+ if (is_scope_long)
+ {
+ sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
+ }
+ else
+ {
+ sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
+ }
+ }
+ else
+ {
+ if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL)
+ {
+ if (is_scope_long)
+ {
+ sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
+ }
+ else
+ {
+ sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
+ }
+ }
+ }
+#else
+ if (is_scope_long)
+ {
+ sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id);
+ }
+ else
+ {
+ sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id);
+ }
+ (void) flags;
+#endif
+ tmpbuf[IF_NAMESIZE + 1] = '\0';
+ bufl = strlen(buf);
+
+ if(bufl + strlen(tmpbuf) < buflen)
+ /* only append the scopeid string if it fits in the target buffer */
+ strcpy(&buf[bufl], tmpbuf);
+}
+#endif
+
+/* Determines if s1 ends with the string in s2 (case-insensitive) */
+STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2)
+{
+ const char *c1, *c2, *c1_begin;
+ int lo1, lo2;
+ size_t s1_len = strlen(s1), s2_len = strlen(s2);
+
+ /* If the substr is longer than the full str, it can't match */
+ if (s2_len > s1_len)
+ return NULL;
+
+ /* Jump to the end of s1 minus the length of s2 */
+ c1_begin = s1+s1_len-s2_len;
+ c1 = (const char *)c1_begin;
+ c2 = s2;
+ while (c2 < s2+s2_len)
+ {
+ lo1 = TOLOWER(*c1);
+ lo2 = TOLOWER(*c2);
+ if (lo1 != lo2)
+ return NULL;
+ else
+ {
+ c1++;
+ c2++;
+ }
+ }
+ return (char *)c1_begin;
+}
+
+int ares__is_onion_domain(const char *name)
+{
+ if (ares_striendstr(name, ".onion"))
+ return 1;
+
+ if (ares_striendstr(name, ".onion."))
+ return 1;
+
+ return 0;
+}
diff --git a/grpc/third_party/cares/cares/ares_getsock.c b/grpc/third_party/cares/cares/src/lib/ares_getsock.c
index 22d34467..22d34467 100644
--- a/grpc/third_party/cares/cares/ares_getsock.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_getsock.c
diff --git a/grpc/third_party/cares/cares/ares_inet_net_pton.h b/grpc/third_party/cares/cares/src/lib/ares_inet_net_pton.h
index 90da2cc6..90da2cc6 100644
--- a/grpc/third_party/cares/cares/ares_inet_net_pton.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_inet_net_pton.h
diff --git a/grpc/third_party/cares/cares/src/lib/ares_init.c b/grpc/third_party/cares/cares/src/lib/ares_init.c
new file mode 100644
index 00000000..0917dce2
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_init.c
@@ -0,0 +1,2654 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2007-2013 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#if defined(ANDROID) || defined(__ANDROID__)
+#include <sys/system_properties.h>
+#include "ares_android.h"
+/* From the Bionic sources */
+#define DNS_PROP_NAME_PREFIX "net.dns"
+#define MAX_DNS_PROPERTIES 8
+#endif
+
+#if defined(CARES_USE_LIBRESOLV)
+#include <resolv.h>
+#endif
+
+#include "ares.h"
+#include "ares_inet_net_pton.h"
+#include "ares_library_init.h"
+#include "ares_nowarn.h"
+#include "ares_platform.h"
+#include "ares_private.h"
+
+#ifdef WATT32
+#undef WIN32 /* Redefined in MingW/MSVC headers */
+#endif
+
+static int init_by_options(ares_channel channel,
+ const struct ares_options *options,
+ int optmask);
+static int init_by_environment(ares_channel channel);
+static int init_by_resolv_conf(ares_channel channel);
+static int init_by_defaults(ares_channel channel);
+
+#ifndef WATT32
+static int config_nameserver(struct server_state **servers, int *nservers,
+ char *str);
+#endif
+static int set_search(ares_channel channel, const char *str);
+static int set_options(ares_channel channel, const char *str);
+static const char *try_option(const char *p, const char *q, const char *opt);
+static int init_id_key(rc4_key* key,int key_data_len);
+
+static int config_sortlist(struct apattern **sortlist, int *nsort,
+ const char *str);
+static int sortlist_alloc(struct apattern **sortlist, int *nsort,
+ struct apattern *pat);
+static int ip_addr(const char *s, ares_ssize_t len, struct in_addr *addr);
+static void natural_mask(struct apattern *pat);
+#if !defined(WIN32) && !defined(WATT32) && \
+ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
+static int config_domain(ares_channel channel, char *str);
+static int config_lookup(ares_channel channel, const char *str,
+ const char *bindch, const char *altbindch,
+ const char *filech);
+static char *try_config(char *s, const char *opt, char scc);
+#endif
+
+#define ARES_CONFIG_CHECK(x) (x->lookups && x->nsort > -1 && \
+ x->nservers > -1 && \
+ x->ndomains > -1 && \
+ x->ndots > -1 && x->timeout > -1 && \
+ x->tries > -1)
+
+int ares_init(ares_channel *channelptr)
+{
+ return ares_init_options(channelptr, NULL, 0);
+}
+
+int ares_init_options(ares_channel *channelptr, struct ares_options *options,
+ int optmask)
+{
+ ares_channel channel;
+ int i;
+ int status = ARES_SUCCESS;
+ struct timeval now;
+
+ if (ares_library_initialized() != ARES_SUCCESS)
+ return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */
+
+ channel = ares_malloc(sizeof(struct ares_channeldata));
+ if (!channel) {
+ *channelptr = NULL;
+ return ARES_ENOMEM;
+ }
+
+ now = ares__tvnow();
+
+ /* Set everything to distinguished values so we know they haven't
+ * been set yet.
+ */
+ channel->flags = -1;
+ channel->timeout = -1;
+ channel->tries = -1;
+ channel->ndots = -1;
+ channel->rotate = -1;
+ channel->udp_port = -1;
+ channel->tcp_port = -1;
+ channel->ednspsz = -1;
+ channel->socket_send_buffer_size = -1;
+ channel->socket_receive_buffer_size = -1;
+ channel->nservers = -1;
+ channel->ndomains = -1;
+ channel->nsort = -1;
+ channel->tcp_connection_generation = 0;
+ channel->lookups = NULL;
+ channel->domains = NULL;
+ channel->sortlist = NULL;
+ channel->servers = NULL;
+ channel->sock_state_cb = NULL;
+ channel->sock_state_cb_data = NULL;
+ channel->sock_create_cb = NULL;
+ channel->sock_create_cb_data = NULL;
+ channel->sock_config_cb = NULL;
+ channel->sock_config_cb_data = NULL;
+ channel->sock_funcs = NULL;
+ channel->sock_func_cb_data = NULL;
+ channel->resolvconf_path = NULL;
+
+ channel->last_server = 0;
+ channel->last_timeout_processed = (time_t)now.tv_sec;
+
+ memset(&channel->local_dev_name, 0, sizeof(channel->local_dev_name));
+ channel->local_ip4 = 0;
+ memset(&channel->local_ip6, 0, sizeof(channel->local_ip6));
+
+ /* Initialize our lists of queries */
+ ares__init_list_head(&(channel->all_queries));
+ for (i = 0; i < ARES_QID_TABLE_SIZE; i++)
+ {
+ ares__init_list_head(&(channel->queries_by_qid[i]));
+ }
+ for (i = 0; i < ARES_TIMEOUT_TABLE_SIZE; i++)
+ {
+ ares__init_list_head(&(channel->queries_by_timeout[i]));
+ }
+
+ /* Initialize configuration by each of the four sources, from highest
+ * precedence to lowest.
+ */
+
+ status = init_by_options(channel, options, optmask);
+ if (status != ARES_SUCCESS) {
+ DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n",
+ ares_strerror(status)));
+ /* If we fail to apply user-specified options, fail the whole init process */
+ goto done;
+ }
+ status = init_by_environment(channel);
+ if (status != ARES_SUCCESS)
+ DEBUGF(fprintf(stderr, "Error: init_by_environment failed: %s\n",
+ ares_strerror(status)));
+ if (status == ARES_SUCCESS) {
+ status = init_by_resolv_conf(channel);
+ if (status != ARES_SUCCESS)
+ DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
+ ares_strerror(status)));
+ }
+
+ /*
+ * No matter what failed or succeeded, seed defaults to provide
+ * useful behavior for things that we missed.
+ */
+ status = init_by_defaults(channel);
+ if (status != ARES_SUCCESS)
+ DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
+ ares_strerror(status)));
+
+ /* Generate random key */
+
+ if (status == ARES_SUCCESS) {
+ status = init_id_key(&channel->id_key, ARES_ID_KEY_LEN);
+ if (status == ARES_SUCCESS)
+ channel->next_id = ares__generate_new_id(&channel->id_key);
+ else
+ DEBUGF(fprintf(stderr, "Error: init_id_key failed: %s\n",
+ ares_strerror(status)));
+ }
+
+done:
+ if (status != ARES_SUCCESS)
+ {
+ /* Something failed; clean up memory we may have allocated. */
+ if (channel->servers)
+ ares_free(channel->servers);
+ if (channel->ndomains != -1)
+ ares_strsplit_free(channel->domains, channel->ndomains);
+ if (channel->sortlist)
+ ares_free(channel->sortlist);
+ if(channel->lookups)
+ ares_free(channel->lookups);
+ if(channel->resolvconf_path)
+ ares_free(channel->resolvconf_path);
+ ares_free(channel);
+ return status;
+ }
+
+ /* Trim to one server if ARES_FLAG_PRIMARY is set. */
+ if ((channel->flags & ARES_FLAG_PRIMARY) && channel->nservers > 1)
+ channel->nservers = 1;
+
+ ares__init_servers_state(channel);
+
+ *channelptr = channel;
+ return ARES_SUCCESS;
+}
+
+/* ares_dup() duplicates a channel handle with all its options and returns a
+ new channel handle */
+int ares_dup(ares_channel *dest, ares_channel src)
+{
+ struct ares_options opts;
+ struct ares_addr_port_node *servers;
+ int non_v4_default_port = 0;
+ int i, rc;
+ int optmask;
+
+ *dest = NULL; /* in case of failure return NULL explicitly */
+
+ /* First get the options supported by the old ares_save_options() function,
+ which is most of them */
+ rc = ares_save_options(src, &opts, &optmask);
+ if(rc)
+ {
+ ares_destroy_options(&opts);
+ return rc;
+ }
+
+ /* Then create the new channel with those options */
+ rc = ares_init_options(dest, &opts, optmask);
+
+ /* destroy the options copy to not leak any memory */
+ ares_destroy_options(&opts);
+
+ if(rc)
+ return rc;
+
+ /* Now clone the options that ares_save_options() doesn't support. */
+ (*dest)->sock_create_cb = src->sock_create_cb;
+ (*dest)->sock_create_cb_data = src->sock_create_cb_data;
+ (*dest)->sock_config_cb = src->sock_config_cb;
+ (*dest)->sock_config_cb_data = src->sock_config_cb_data;
+ (*dest)->sock_funcs = src->sock_funcs;
+ (*dest)->sock_func_cb_data = src->sock_func_cb_data;
+
+ strncpy((*dest)->local_dev_name, src->local_dev_name,
+ sizeof((*dest)->local_dev_name));
+ (*dest)->local_ip4 = src->local_ip4;
+ memcpy((*dest)->local_ip6, src->local_ip6, sizeof(src->local_ip6));
+
+ /* Full name server cloning required if there is a non-IPv4, or non-default port, nameserver */
+ for (i = 0; i < src->nservers; i++)
+ {
+ if ((src->servers[i].addr.family != AF_INET) ||
+ (src->servers[i].addr.udp_port != 0) ||
+ (src->servers[i].addr.tcp_port != 0)) {
+ non_v4_default_port++;
+ break;
+ }
+ }
+ if (non_v4_default_port) {
+ rc = ares_get_servers_ports(src, &servers);
+ if (rc != ARES_SUCCESS) {
+ ares_destroy(*dest);
+ *dest = NULL;
+ return rc;
+ }
+ rc = ares_set_servers_ports(*dest, servers);
+ ares_free_data(servers);
+ if (rc != ARES_SUCCESS) {
+ ares_destroy(*dest);
+ *dest = NULL;
+ return rc;
+ }
+ }
+
+ return ARES_SUCCESS; /* everything went fine */
+}
+
+/* Save options from initialized channel */
+int ares_save_options(ares_channel channel, struct ares_options *options,
+ int *optmask)
+{
+ int i, j;
+ int ipv4_nservers = 0;
+
+ /* Zero everything out */
+ memset(options, 0, sizeof(struct ares_options));
+
+ if (!ARES_CONFIG_CHECK(channel))
+ return ARES_ENODATA;
+
+ /* Traditionally the optmask wasn't saved in the channel struct so it was
+ recreated here. ROTATE is the first option that has no struct field of
+ its own in the public config struct */
+ (*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
+ ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
+ ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
+ ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS);
+ (*optmask) |= (channel->rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE);
+
+ if (channel->resolvconf_path)
+ (*optmask) |= ARES_OPT_RESOLVCONF;
+
+ /* Copy easy stuff */
+ options->flags = channel->flags;
+
+ /* We return full millisecond resolution but that's only because we don't
+ set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */
+ options->timeout = channel->timeout;
+ options->tries = channel->tries;
+ options->ndots = channel->ndots;
+ options->udp_port = ntohs(aresx_sitous(channel->udp_port));
+ options->tcp_port = ntohs(aresx_sitous(channel->tcp_port));
+ options->sock_state_cb = channel->sock_state_cb;
+ options->sock_state_cb_data = channel->sock_state_cb_data;
+
+ /* Copy IPv4 servers that use the default port */
+ if (channel->nservers) {
+ for (i = 0; i < channel->nservers; i++)
+ {
+ if ((channel->servers[i].addr.family == AF_INET) &&
+ (channel->servers[i].addr.udp_port == 0) &&
+ (channel->servers[i].addr.tcp_port == 0))
+ ipv4_nservers++;
+ }
+ if (ipv4_nservers) {
+ options->servers = ares_malloc(ipv4_nservers * sizeof(struct in_addr));
+ if (!options->servers)
+ return ARES_ENOMEM;
+ for (i = j = 0; i < channel->nservers; i++)
+ {
+ if ((channel->servers[i].addr.family == AF_INET) &&
+ (channel->servers[i].addr.udp_port == 0) &&
+ (channel->servers[i].addr.tcp_port == 0))
+ memcpy(&options->servers[j++],
+ &channel->servers[i].addr.addrV4,
+ sizeof(channel->servers[i].addr.addrV4));
+ }
+ }
+ }
+ options->nservers = ipv4_nservers;
+
+ /* copy domains */
+ if (channel->ndomains) {
+ options->domains = ares_malloc(channel->ndomains * sizeof(char *));
+ if (!options->domains)
+ return ARES_ENOMEM;
+
+ for (i = 0; i < channel->ndomains; i++)
+ {
+ options->ndomains = i;
+ options->domains[i] = ares_strdup(channel->domains[i]);
+ if (!options->domains[i])
+ return ARES_ENOMEM;
+ }
+ }
+ options->ndomains = channel->ndomains;
+
+ /* copy lookups */
+ if (channel->lookups) {
+ options->lookups = ares_strdup(channel->lookups);
+ if (!options->lookups && channel->lookups)
+ return ARES_ENOMEM;
+ }
+
+ /* copy sortlist */
+ if (channel->nsort) {
+ options->sortlist = ares_malloc(channel->nsort * sizeof(struct apattern));
+ if (!options->sortlist)
+ return ARES_ENOMEM;
+ for (i = 0; i < channel->nsort; i++)
+ options->sortlist[i] = channel->sortlist[i];
+ }
+ options->nsort = channel->nsort;
+
+ /* copy path for resolv.conf file */
+ if (channel->resolvconf_path) {
+ options->resolvconf_path = ares_strdup(channel->resolvconf_path);
+ if (!options->resolvconf_path)
+ return ARES_ENOMEM;
+ }
+
+ return ARES_SUCCESS;
+}
+
+static int init_by_options(ares_channel channel,
+ const struct ares_options *options,
+ int optmask)
+{
+ int i;
+
+ /* Easy stuff. */
+ if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
+ channel->flags = options->flags;
+ if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1)
+ channel->timeout = options->timeout;
+ else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
+ channel->timeout = options->timeout * 1000;
+ if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
+ channel->tries = options->tries;
+ if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
+ channel->ndots = options->ndots;
+ if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
+ channel->rotate = 1;
+ if ((optmask & ARES_OPT_NOROTATE) && channel->rotate == -1)
+ channel->rotate = 0;
+ if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
+ channel->udp_port = htons(options->udp_port);
+ if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
+ channel->tcp_port = htons(options->tcp_port);
+ if ((optmask & ARES_OPT_SOCK_STATE_CB) && channel->sock_state_cb == NULL)
+ {
+ channel->sock_state_cb = options->sock_state_cb;
+ channel->sock_state_cb_data = options->sock_state_cb_data;
+ }
+ if ((optmask & ARES_OPT_SOCK_SNDBUF)
+ && channel->socket_send_buffer_size == -1)
+ channel->socket_send_buffer_size = options->socket_send_buffer_size;
+ if ((optmask & ARES_OPT_SOCK_RCVBUF)
+ && channel->socket_receive_buffer_size == -1)
+ channel->socket_receive_buffer_size = options->socket_receive_buffer_size;
+
+ if ((optmask & ARES_OPT_EDNSPSZ) && channel->ednspsz == -1)
+ channel->ednspsz = options->ednspsz;
+
+ /* Copy the IPv4 servers, if given. */
+ if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
+ {
+ /* Avoid zero size allocations at any cost */
+ if (options->nservers > 0)
+ {
+ channel->servers =
+ ares_malloc(options->nservers * sizeof(struct server_state));
+ if (!channel->servers)
+ return ARES_ENOMEM;
+ for (i = 0; i < options->nservers; i++)
+ {
+ channel->servers[i].addr.family = AF_INET;
+ channel->servers[i].addr.udp_port = 0;
+ channel->servers[i].addr.tcp_port = 0;
+ memcpy(&channel->servers[i].addr.addrV4,
+ &options->servers[i],
+ sizeof(channel->servers[i].addr.addrV4));
+ }
+ }
+ channel->nservers = options->nservers;
+ }
+
+ /* Copy the domains, if given. Keep channel->ndomains consistent so
+ * we can clean up in case of error.
+ */
+ if ((optmask & ARES_OPT_DOMAINS) && channel->ndomains == -1)
+ {
+ /* Avoid zero size allocations at any cost */
+ if (options->ndomains > 0)
+ {
+ channel->domains = ares_malloc(options->ndomains * sizeof(char *));
+ if (!channel->domains)
+ return ARES_ENOMEM;
+ for (i = 0; i < options->ndomains; i++)
+ {
+ channel->ndomains = i;
+ channel->domains[i] = ares_strdup(options->domains[i]);
+ if (!channel->domains[i])
+ return ARES_ENOMEM;
+ }
+ }
+ channel->ndomains = options->ndomains;
+ }
+
+ /* Set lookups, if given. */
+ if ((optmask & ARES_OPT_LOOKUPS) && !channel->lookups)
+ {
+ channel->lookups = ares_strdup(options->lookups);
+ if (!channel->lookups)
+ return ARES_ENOMEM;
+ }
+
+ /* copy sortlist */
+ if ((optmask & ARES_OPT_SORTLIST) && (channel->nsort == -1)) {
+ if (options->nsort > 0) {
+ channel->sortlist = ares_malloc(options->nsort * sizeof(struct apattern));
+ if (!channel->sortlist)
+ return ARES_ENOMEM;
+ for (i = 0; i < options->nsort; i++)
+ channel->sortlist[i] = options->sortlist[i];
+ }
+ channel->nsort = options->nsort;
+ }
+
+ /* Set path for resolv.conf file, if given. */
+ if ((optmask & ARES_OPT_RESOLVCONF) && !channel->resolvconf_path)
+ {
+ channel->resolvconf_path = ares_strdup(options->resolvconf_path);
+ if (!channel->resolvconf_path && options->resolvconf_path)
+ return ARES_ENOMEM;
+ }
+
+ channel->optmask = optmask;
+
+ return ARES_SUCCESS;
+}
+
+static int init_by_environment(ares_channel channel)
+{
+ const char *localdomain, *res_options;
+ int status;
+
+ localdomain = getenv("LOCALDOMAIN");
+ if (localdomain && channel->ndomains == -1)
+ {
+ status = set_search(channel, localdomain);
+ if (status != ARES_SUCCESS)
+ return status;
+ }
+
+ res_options = getenv("RES_OPTIONS");
+ if (res_options)
+ {
+ status = set_options(channel, res_options);
+ if (status != ARES_SUCCESS)
+ return status; /* LCOV_EXCL_LINE: set_options() never fails */
+ }
+
+ return ARES_SUCCESS;
+}
+
+#ifdef WIN32
+/*
+ * get_REG_SZ()
+ *
+ * Given a 'hKey' handle to an open registry key and a 'leafKeyName' pointer
+ * to the name of the registry leaf key to be queried, fetch it's string
+ * value and return a pointer in *outptr to a newly allocated memory area
+ * holding it as a null-terminated string.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return a string value.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Supported on Windows NT 3.5 and newer.
+ */
+static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr)
+{
+ DWORD size = 0;
+ int res;
+
+ *outptr = NULL;
+
+ /* Find out size of string stored in registry */
+ res = RegQueryValueExA(hKey, leafKeyName, 0, NULL, NULL, &size);
+ if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size)
+ return 0;
+
+ /* Allocate buffer of indicated size plus one given that string
+ might have been stored without null termination */
+ *outptr = ares_malloc(size+1);
+ if (!*outptr)
+ return 0;
+
+ /* Get the value for real */
+ res = RegQueryValueExA(hKey, leafKeyName, 0, NULL,
+ (unsigned char *)*outptr, &size);
+ if ((res != ERROR_SUCCESS) || (size == 1))
+ {
+ ares_free(*outptr);
+ *outptr = NULL;
+ return 0;
+ }
+
+ /* Null terminate buffer allways */
+ *(*outptr + size) = '\0';
+
+ return 1;
+}
+
+/*
+ * get_REG_SZ_9X()
+ *
+ * Functionally identical to get_REG_SZ()
+ *
+ * Supported on Windows 95, 98 and ME.
+ */
+static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr)
+{
+ DWORD dataType = 0;
+ DWORD size = 0;
+ int res;
+
+ *outptr = NULL;
+
+ /* Find out size of string stored in registry */
+ res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType, NULL, &size);
+ if ((res != ERROR_SUCCESS && res != ERROR_MORE_DATA) || !size)
+ return 0;
+
+ /* Allocate buffer of indicated size plus one given that string
+ might have been stored without null termination */
+ *outptr = ares_malloc(size+1);
+ if (!*outptr)
+ return 0;
+
+ /* Get the value for real */
+ res = RegQueryValueExA(hKey, leafKeyName, 0, &dataType,
+ (unsigned char *)*outptr, &size);
+ if ((res != ERROR_SUCCESS) || (size == 1))
+ {
+ ares_free(*outptr);
+ *outptr = NULL;
+ return 0;
+ }
+
+ /* Null terminate buffer allways */
+ *(*outptr + size) = '\0';
+
+ return 1;
+}
+
+/*
+ * get_enum_REG_SZ()
+ *
+ * Given a 'hKeyParent' handle to an open registry key and a 'leafKeyName'
+ * pointer to the name of the registry leaf key to be queried, parent key
+ * is enumerated searching in child keys for given leaf key name and its
+ * associated string value. When located, this returns a pointer in *outptr
+ * to a newly allocated memory area holding it as a null-terminated string.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return a string value.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Supported on Windows NT 3.5 and newer.
+ */
+static int get_enum_REG_SZ(HKEY hKeyParent, const char *leafKeyName,
+ char **outptr)
+{
+ char enumKeyName[256];
+ DWORD enumKeyNameBuffSize;
+ DWORD enumKeyIdx = 0;
+ HKEY hKeyEnum;
+ int gotString;
+ int res;
+
+ *outptr = NULL;
+
+ for(;;)
+ {
+ enumKeyNameBuffSize = sizeof(enumKeyName);
+ res = RegEnumKeyExA(hKeyParent, enumKeyIdx++, enumKeyName,
+ &enumKeyNameBuffSize, 0, NULL, NULL, NULL);
+ if (res != ERROR_SUCCESS)
+ break;
+ res = RegOpenKeyExA(hKeyParent, enumKeyName, 0, KEY_QUERY_VALUE,
+ &hKeyEnum);
+ if (res != ERROR_SUCCESS)
+ continue;
+ gotString = get_REG_SZ(hKeyEnum, leafKeyName, outptr);
+ RegCloseKey(hKeyEnum);
+ if (gotString)
+ break;
+ }
+
+ if (!*outptr)
+ return 0;
+
+ return 1;
+}
+
+/*
+ * get_DNS_Registry_9X()
+ *
+ * Functionally identical to get_DNS_Registry()
+ *
+ * Implementation supports Windows 95, 98 and ME.
+ */
+static int get_DNS_Registry_9X(char **outptr)
+{
+ HKEY hKey_VxD_MStcp;
+ int gotString;
+ int res;
+
+ *outptr = NULL;
+
+ res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_9X, 0, KEY_READ,
+ &hKey_VxD_MStcp);
+ if (res != ERROR_SUCCESS)
+ return 0;
+
+ gotString = get_REG_SZ_9X(hKey_VxD_MStcp, NAMESERVER, outptr);
+ RegCloseKey(hKey_VxD_MStcp);
+
+ if (!gotString || !*outptr)
+ return 0;
+
+ return 1;
+}
+
+/*
+ * get_DNS_Registry_NT()
+ *
+ * Functionally identical to get_DNS_Registry()
+ *
+ * Refs: Microsoft Knowledge Base articles KB120642 and KB314053.
+ *
+ * Implementation supports Windows NT 3.5 and newer.
+ */
+static int get_DNS_Registry_NT(char **outptr)
+{
+ HKEY hKey_Interfaces = NULL;
+ HKEY hKey_Tcpip_Parameters;
+ int gotString;
+ int res;
+
+ *outptr = NULL;
+
+ res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
+ &hKey_Tcpip_Parameters);
+ if (res != ERROR_SUCCESS)
+ return 0;
+
+ /*
+ ** Global DNS settings override adapter specific parameters when both
+ ** are set. Additionally static DNS settings override DHCP-configured
+ ** parameters when both are set.
+ */
+
+ /* Global DNS static parameters */
+ gotString = get_REG_SZ(hKey_Tcpip_Parameters, NAMESERVER, outptr);
+ if (gotString)
+ goto done;
+
+ /* Global DNS DHCP-configured parameters */
+ gotString = get_REG_SZ(hKey_Tcpip_Parameters, DHCPNAMESERVER, outptr);
+ if (gotString)
+ goto done;
+
+ /* Try adapter specific parameters */
+ res = RegOpenKeyExA(hKey_Tcpip_Parameters, "Interfaces", 0,
+ KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS,
+ &hKey_Interfaces);
+ if (res != ERROR_SUCCESS)
+ {
+ hKey_Interfaces = NULL;
+ goto done;
+ }
+
+ /* Adapter specific DNS static parameters */
+ gotString = get_enum_REG_SZ(hKey_Interfaces, NAMESERVER, outptr);
+ if (gotString)
+ goto done;
+
+ /* Adapter specific DNS DHCP-configured parameters */
+ gotString = get_enum_REG_SZ(hKey_Interfaces, DHCPNAMESERVER, outptr);
+
+done:
+ if (hKey_Interfaces)
+ RegCloseKey(hKey_Interfaces);
+
+ RegCloseKey(hKey_Tcpip_Parameters);
+
+ if (!gotString || !*outptr)
+ return 0;
+
+ return 1;
+}
+
+/*
+ * get_DNS_Registry()
+ *
+ * Locates DNS info in the registry. When located, this returns a pointer
+ * in *outptr to a newly allocated memory area holding a null-terminated
+ * string with a space or comma seperated list of DNS IP addresses.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return DNSes string.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ */
+static int get_DNS_Registry(char **outptr)
+{
+ win_platform platform;
+ int gotString = 0;
+
+ *outptr = NULL;
+
+ platform = ares__getplatform();
+
+ if (platform == WIN_NT)
+ gotString = get_DNS_Registry_NT(outptr);
+ else if (platform == WIN_9X)
+ gotString = get_DNS_Registry_9X(outptr);
+
+ if (!gotString)
+ return 0;
+
+ return 1;
+}
+
+static void commanjoin(char** dst, const char* const src, const size_t len)
+{
+ char *newbuf;
+ size_t newsize;
+
+ /* 1 for terminating 0 and 2 for , and terminating 0 */
+ newsize = len + (*dst ? (strlen(*dst) + 2) : 1);
+ newbuf = ares_realloc(*dst, newsize);
+ if (!newbuf)
+ return;
+ if (*dst == NULL)
+ *newbuf = '\0';
+ *dst = newbuf;
+ if (strlen(*dst) != 0)
+ strcat(*dst, ",");
+ strncat(*dst, src, len);
+}
+
+/*
+ * commajoin()
+ *
+ * RTF code.
+ */
+static void commajoin(char **dst, const char *src)
+{
+ commanjoin(dst, src, strlen(src));
+}
+
+/*
+ * get_DNS_NetworkParams()
+ *
+ * Locates DNS info using GetNetworkParams() function from the Internet
+ * Protocol Helper (IP Helper) API. When located, this returns a pointer
+ * in *outptr to a newly allocated memory area holding a null-terminated
+ * string with a space or comma seperated list of DNS IP addresses.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return DNSes string.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Implementation supports Windows 98 and newer.
+ *
+ * Note: Ancient PSDK required in order to build a W98 target.
+ */
+static int get_DNS_NetworkParams(char **outptr)
+{
+ FIXED_INFO *fi, *newfi;
+ struct ares_addr namesrvr;
+ char *txtaddr;
+ IP_ADDR_STRING *ipAddr;
+ int res;
+ DWORD size = sizeof (*fi);
+
+ *outptr = NULL;
+
+ /* Verify run-time availability of GetNetworkParams() */
+ if (ares_fpGetNetworkParams == ZERO_NULL)
+ return 0;
+
+ fi = ares_malloc(size);
+ if (!fi)
+ return 0;
+
+ res = (*ares_fpGetNetworkParams) (fi, &size);
+ if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
+ goto done;
+
+ newfi = ares_realloc(fi, size);
+ if (!newfi)
+ goto done;
+
+ fi = newfi;
+ res = (*ares_fpGetNetworkParams) (fi, &size);
+ if (res != ERROR_SUCCESS)
+ goto done;
+
+ for (ipAddr = &fi->DnsServerList; ipAddr; ipAddr = ipAddr->Next)
+ {
+ txtaddr = &ipAddr->IpAddress.String[0];
+
+ /* Validate converting textual address to binary format. */
+ if (ares_inet_pton(AF_INET, txtaddr, &namesrvr.addrV4) == 1)
+ {
+ if ((namesrvr.addrV4.S_un.S_addr == INADDR_ANY) ||
+ (namesrvr.addrV4.S_un.S_addr == INADDR_NONE))
+ continue;
+ }
+ else if (ares_inet_pton(AF_INET6, txtaddr, &namesrvr.addrV6) == 1)
+ {
+ if (memcmp(&namesrvr.addrV6, &ares_in6addr_any,
+ sizeof(namesrvr.addrV6)) == 0)
+ continue;
+ }
+ else
+ continue;
+
+ commajoin(outptr, txtaddr);
+
+ if (!*outptr)
+ break;
+ }
+
+done:
+ if (fi)
+ ares_free(fi);
+
+ if (!*outptr)
+ return 0;
+
+ return 1;
+}
+
+static BOOL ares_IsWindowsVistaOrGreater(void)
+{
+ OSVERSIONINFO vinfo;
+ memset(&vinfo, 0, sizeof(vinfo));
+ vinfo.dwOSVersionInfoSize = sizeof(vinfo);
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4996) /* warning C4996: 'GetVersionExW': was declared deprecated */
+#endif
+ if (!GetVersionEx(&vinfo) || vinfo.dwMajorVersion < 6)
+ return FALSE;
+ return TRUE;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+}
+
+/* A structure to hold the string form of IPv4 and IPv6 addresses so we can
+ * sort them by a metric.
+ */
+typedef struct
+{
+ /* The metric we sort them by. */
+ ULONG metric;
+
+ /* Original index of the item, used as a secondary sort parameter to make
+ * qsort() stable if the metrics are equal */
+ size_t orig_idx;
+
+ /* Room enough for the string form of any IPv4 or IPv6 address that
+ * ares_inet_ntop() will create. Based on the existing c-ares practice.
+ */
+ char text[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+} Address;
+
+/* Sort Address values \a left and \a right by metric, returning the usual
+ * indicators for qsort().
+ */
+static int compareAddresses(const void *arg1,
+ const void *arg2)
+{
+ const Address * const left = arg1;
+ const Address * const right = arg2;
+ /* Lower metric the more preferred */
+ if(left->metric < right->metric) return -1;
+ if(left->metric > right->metric) return 1;
+ /* If metrics are equal, lower original index more preferred */
+ if(left->orig_idx < right->orig_idx) return -1;
+ if(left->orig_idx > right->orig_idx) return 1;
+ return 0;
+}
+
+/* There can be multiple routes to "the Internet". And there can be different
+ * DNS servers associated with each of the interfaces that offer those routes.
+ * We have to assume that any DNS server can serve any request. But, some DNS
+ * servers may only respond if requested over their associated interface. But
+ * we also want to use "the preferred route to the Internet" whenever possible
+ * (and not use DNS servers on a non-preferred route even by forcing request
+ * to go out on the associated non-preferred interface). i.e. We want to use
+ * the DNS servers associated with the same interface that we would use to
+ * make a general request to anything else.
+ *
+ * But, Windows won't sort the DNS servers by the metrics associated with the
+ * routes and interfaces _even_ though it obviously sends IP packets based on
+ * those same routes and metrics. So, we must do it ourselves.
+ *
+ * So, we sort the DNS servers by the same metric values used to determine how
+ * an outgoing IP packet will go, thus effectively using the DNS servers
+ * associated with the interface that the DNS requests themselves will
+ * travel. This gives us optimal routing and avoids issues where DNS servers
+ * won't respond to requests that don't arrive via some specific subnetwork
+ * (and thus some specific interface).
+ *
+ * This function computes the metric we use to sort. On the interface
+ * identified by \a luid, it determines the best route to \a dest and combines
+ * that route's metric with \a interfaceMetric to compute a metric for the
+ * destination address on that interface. This metric can be used as a weight
+ * to sort the DNS server addresses associated with each interface (lower is
+ * better).
+ *
+ * Note that by restricting the route search to the specific interface with
+ * which the DNS servers are associated, this function asks the question "What
+ * is the metric for sending IP packets to this DNS server?" which allows us
+ * to sort the DNS servers correctly.
+ */
+static ULONG getBestRouteMetric(IF_LUID * const luid, /* Can't be const :( */
+ const SOCKADDR_INET * const dest,
+ const ULONG interfaceMetric)
+{
+ /* On this interface, get the best route to that destination. */
+ MIB_IPFORWARD_ROW2 row;
+ SOCKADDR_INET ignored;
+ if(!ares_fpGetBestRoute2 ||
+ ares_fpGetBestRoute2(/* The interface to use. The index is ignored since we are
+ * passing a LUID.
+ */
+ luid, 0,
+ /* No specific source address. */
+ NULL,
+ /* Our destination address. */
+ dest,
+ /* No options. */
+ 0,
+ /* The route row. */
+ &row,
+ /* The best source address, which we don't need. */
+ &ignored) != NO_ERROR
+ /* If the metric is "unused" (-1) or too large for us to add the two
+ * metrics, use the worst possible, thus sorting this last.
+ */
+ || row.Metric == (ULONG)-1
+ || row.Metric > ((ULONG)-1) - interfaceMetric) {
+ /* Return the worst possible metric. */
+ return (ULONG)-1;
+ }
+
+ /* Return the metric value from that row, plus the interface metric.
+ *
+ * See
+ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa814494(v=vs.85).aspx
+ * which describes the combination as a "sum".
+ */
+ return row.Metric + interfaceMetric;
+}
+
+/*
+ * get_DNS_AdaptersAddresses()
+ *
+ * Locates DNS info using GetAdaptersAddresses() function from the Internet
+ * Protocol Helper (IP Helper) API. When located, this returns a pointer
+ * in *outptr to a newly allocated memory area holding a null-terminated
+ * string with a space or comma seperated list of DNS IP addresses.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return DNSes string.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Implementation supports Windows XP and newer.
+ */
+#define IPAA_INITIAL_BUF_SZ 15 * 1024
+#define IPAA_MAX_TRIES 3
+static int get_DNS_AdaptersAddresses(char **outptr)
+{
+ IP_ADAPTER_DNS_SERVER_ADDRESS *ipaDNSAddr;
+ IP_ADAPTER_ADDRESSES *ipaa, *newipaa, *ipaaEntry;
+ ULONG ReqBufsz = IPAA_INITIAL_BUF_SZ;
+ ULONG Bufsz = IPAA_INITIAL_BUF_SZ;
+ ULONG AddrFlags = 0;
+ int trying = IPAA_MAX_TRIES;
+ int res;
+
+ /* The capacity of addresses, in elements. */
+ size_t addressesSize;
+ /* The number of elements in addresses. */
+ size_t addressesIndex = 0;
+ /* The addresses we will sort. */
+ Address *addresses;
+
+ union {
+ struct sockaddr *sa;
+ struct sockaddr_in *sa4;
+ struct sockaddr_in6 *sa6;
+ } namesrvr;
+
+ *outptr = NULL;
+
+ /* Verify run-time availability of GetAdaptersAddresses() */
+ if (ares_fpGetAdaptersAddresses == ZERO_NULL)
+ return 0;
+
+ ipaa = ares_malloc(Bufsz);
+ if (!ipaa)
+ return 0;
+
+ /* Start with enough room for a few DNS server addresses and we'll grow it
+ * as we encounter more.
+ */
+ addressesSize = 4;
+ addresses = (Address*)ares_malloc(sizeof(Address) * addressesSize);
+ if(addresses == NULL) {
+ /* We need room for at least some addresses to function. */
+ ares_free(ipaa);
+ return 0;
+ }
+
+ /* Usually this call suceeds with initial buffer size */
+ res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
+ ipaa, &ReqBufsz);
+ if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
+ goto done;
+
+ while ((res == ERROR_BUFFER_OVERFLOW) && (--trying))
+ {
+ if (Bufsz < ReqBufsz)
+ {
+ newipaa = ares_realloc(ipaa, ReqBufsz);
+ if (!newipaa)
+ goto done;
+ Bufsz = ReqBufsz;
+ ipaa = newipaa;
+ }
+ res = (*ares_fpGetAdaptersAddresses) (AF_UNSPEC, AddrFlags, NULL,
+ ipaa, &ReqBufsz);
+ if (res == ERROR_SUCCESS)
+ break;
+ }
+ if (res != ERROR_SUCCESS)
+ goto done;
+
+ for (ipaaEntry = ipaa; ipaaEntry; ipaaEntry = ipaaEntry->Next)
+ {
+ if(ipaaEntry->OperStatus != IfOperStatusUp)
+ continue;
+
+ /* For each interface, find any associated DNS servers as IPv4 or IPv6
+ * addresses. For each found address, find the best route to that DNS
+ * server address _on_ _that_ _interface_ (at this moment in time) and
+ * compute the resulting total metric, just as Windows routing will do.
+ * Then, sort all the addresses found by the metric.
+ */
+ for (ipaDNSAddr = ipaaEntry->FirstDnsServerAddress;
+ ipaDNSAddr;
+ ipaDNSAddr = ipaDNSAddr->Next)
+ {
+ namesrvr.sa = ipaDNSAddr->Address.lpSockaddr;
+
+ if (namesrvr.sa->sa_family == AF_INET)
+ {
+ if ((namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_ANY) ||
+ (namesrvr.sa4->sin_addr.S_un.S_addr == INADDR_NONE))
+ continue;
+
+ /* Allocate room for another address, if necessary, else skip. */
+ if(addressesIndex == addressesSize) {
+ const size_t newSize = addressesSize + 4;
+ Address * const newMem =
+ (Address*)ares_realloc(addresses, sizeof(Address) * newSize);
+ if(newMem == NULL) {
+ continue;
+ }
+ addresses = newMem;
+ addressesSize = newSize;
+ }
+
+ /* Vista required for Luid or Ipv4Metric */
+ if (ares_IsWindowsVistaOrGreater())
+ {
+ /* Save the address as the next element in addresses. */
+ addresses[addressesIndex].metric =
+ getBestRouteMetric(&ipaaEntry->Luid,
+ (SOCKADDR_INET*)(namesrvr.sa),
+ ipaaEntry->Ipv4Metric);
+ }
+ else
+ {
+ addresses[addressesIndex].metric = (ULONG)-1;
+ }
+
+ /* Record insertion index to make qsort stable */
+ addresses[addressesIndex].orig_idx = addressesIndex;
+
+ if (! ares_inet_ntop(AF_INET, &namesrvr.sa4->sin_addr,
+ addresses[addressesIndex].text,
+ sizeof(addresses[0].text))) {
+ continue;
+ }
+ ++addressesIndex;
+ }
+ else if (namesrvr.sa->sa_family == AF_INET6)
+ {
+ if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
+ sizeof(namesrvr.sa6->sin6_addr)) == 0)
+ continue;
+
+ /* Allocate room for another address, if necessary, else skip. */
+ if(addressesIndex == addressesSize) {
+ const size_t newSize = addressesSize + 4;
+ Address * const newMem =
+ (Address*)ares_realloc(addresses, sizeof(Address) * newSize);
+ if(newMem == NULL) {
+ continue;
+ }
+ addresses = newMem;
+ addressesSize = newSize;
+ }
+
+ /* Vista required for Luid or Ipv4Metric */
+ if (ares_IsWindowsVistaOrGreater())
+ {
+ /* Save the address as the next element in addresses. */
+ addresses[addressesIndex].metric =
+ getBestRouteMetric(&ipaaEntry->Luid,
+ (SOCKADDR_INET*)(namesrvr.sa),
+ ipaaEntry->Ipv6Metric);
+ }
+ else
+ {
+ addresses[addressesIndex].metric = (ULONG)-1;
+ }
+
+ /* Record insertion index to make qsort stable */
+ addresses[addressesIndex].orig_idx = addressesIndex;
+
+ if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
+ addresses[addressesIndex].text,
+ sizeof(addresses[0].text))) {
+ continue;
+ }
+ ++addressesIndex;
+ }
+ else {
+ /* Skip non-IPv4/IPv6 addresses completely. */
+ continue;
+ }
+ }
+ }
+
+ /* Sort all of the textual addresses by their metric (and original index if
+ * metrics are equal). */
+ qsort(addresses, addressesIndex, sizeof(*addresses), compareAddresses);
+
+ /* Join them all into a single string, removing duplicates. */
+ {
+ size_t i;
+ for(i = 0; i < addressesIndex; ++i) {
+ size_t j;
+ /* Look for this address text appearing previously in the results. */
+ for(j = 0; j < i; ++j) {
+ if(strcmp(addresses[j].text, addresses[i].text) == 0) {
+ break;
+ }
+ }
+ /* Iff we didn't emit this address already, emit it now. */
+ if(j == i) {
+ /* Add that to outptr (if we can). */
+ commajoin(outptr, addresses[i].text);
+ }
+ }
+ }
+
+done:
+ ares_free(addresses);
+
+ if (ipaa)
+ ares_free(ipaa);
+
+ if (!*outptr) {
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * get_DNS_Windows()
+ *
+ * Locates DNS info from Windows employing most suitable methods available at
+ * run-time no matter which Windows version it is. When located, this returns
+ * a pointer in *outptr to a newly allocated memory area holding a string with
+ * a space or comma seperated list of DNS IP addresses, null-terminated.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return DNSes string.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Implementation supports Windows 95 and newer.
+ */
+static int get_DNS_Windows(char **outptr)
+{
+ /* Try using IP helper API GetAdaptersAddresses(). IPv4 + IPv6, also sorts
+ * DNS servers by interface route metrics to try to use the best DNS server. */
+ if (get_DNS_AdaptersAddresses(outptr))
+ return 1;
+
+ /* Try using IP helper API GetNetworkParams(). IPv4 only. */
+ if (get_DNS_NetworkParams(outptr))
+ return 1;
+
+ /* Fall-back to registry information */
+ return get_DNS_Registry(outptr);
+}
+
+/*
+ * get_SuffixList_Windows()
+ *
+ * Reads the "DNS Suffix Search List" from registry and writes the list items
+ * whitespace separated to outptr. If the Search List is empty, the
+ * "Primary Dns Suffix" is written to outptr.
+ *
+ * Returns 0 and nullifies *outptr upon inability to return the suffix list.
+ *
+ * Returns 1 and sets *outptr when returning a dynamically allocated string.
+ *
+ * Implementation supports Windows Server 2003 and newer
+ */
+static int get_SuffixList_Windows(char **outptr)
+{
+ HKEY hKey, hKeyEnum;
+ char keyName[256];
+ DWORD keyNameBuffSize;
+ DWORD keyIdx = 0;
+ char *p = NULL;
+
+ *outptr = NULL;
+
+ if (ares__getplatform() != WIN_NT)
+ return 0;
+
+ /* 1. Global DNS Suffix Search List */
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
+ KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ get_REG_SZ(hKey, SEARCHLIST_KEY, outptr);
+ if (get_REG_SZ(hKey, DOMAIN_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ RegCloseKey(hKey);
+ }
+
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NT_DNSCLIENT, 0,
+ KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ if (get_REG_SZ(hKey, SEARCHLIST_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ RegCloseKey(hKey);
+ }
+
+ /* 2. Connection Specific Search List composed of:
+ * a. Primary DNS Suffix */
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_DNSCLIENT, 0,
+ KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ if (get_REG_SZ(hKey, PRIMARYDNSSUFFIX_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ RegCloseKey(hKey);
+ }
+
+ /* b. Interface SearchList, Domain, DhcpDomain */
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY "\\" INTERFACES_KEY, 0,
+ KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ for(;;)
+ {
+ keyNameBuffSize = sizeof(keyName);
+ if (RegEnumKeyExA(hKey, keyIdx++, keyName, &keyNameBuffSize,
+ 0, NULL, NULL, NULL)
+ != ERROR_SUCCESS)
+ break;
+ if (RegOpenKeyExA(hKey, keyName, 0, KEY_QUERY_VALUE, &hKeyEnum)
+ != ERROR_SUCCESS)
+ continue;
+ /* p can be comma separated (SearchList) */
+ if (get_REG_SZ(hKeyEnum, SEARCHLIST_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ if (get_REG_SZ(hKeyEnum, DOMAIN_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ if (get_REG_SZ(hKeyEnum, DHCPDOMAIN_KEY, &p))
+ {
+ commajoin(outptr, p);
+ ares_free(p);
+ p = NULL;
+ }
+ RegCloseKey(hKeyEnum);
+ }
+ RegCloseKey(hKey);
+ }
+
+ return *outptr != NULL;
+}
+
+#endif
+
+static int init_by_resolv_conf(ares_channel channel)
+{
+#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(WATT32) && \
+ !defined(CARES_USE_LIBRESOLV)
+ char *line = NULL;
+#endif
+ int status = -1, nservers = 0, nsort = 0;
+ struct server_state *servers = NULL;
+ struct apattern *sortlist = NULL;
+
+#ifdef WIN32
+
+ if (channel->nservers > -1) /* don't override ARES_OPT_SERVER */
+ return ARES_SUCCESS;
+
+ if (get_DNS_Windows(&line))
+ {
+ status = config_nameserver(&servers, &nservers, line);
+ ares_free(line);
+ }
+
+ if (channel->ndomains == -1 && get_SuffixList_Windows(&line))
+ {
+ status = set_search(channel, line);
+ ares_free(line);
+ }
+
+ if (status == ARES_SUCCESS)
+ status = ARES_EOF;
+ else
+ /* Catch the case when all the above checks fail (which happens when there
+ is no network card or the cable is unplugged) */
+ status = ARES_EFILE;
+#elif defined(__MVS__)
+
+ struct __res_state *res = 0;
+ int count4, count6;
+ __STATEEXTIPV6 *v6;
+ struct server_state *pserver
+ if (0 == res) {
+ int rc = res_init();
+ while (rc == -1 && h_errno == TRY_AGAIN) {
+ rc = res_init();
+ }
+ if (rc == -1) {
+ return ARES_ENOMEM;
+ }
+ res = __res();
+ }
+
+ v6 = res->__res_extIPv6;
+ count4 = res->nscount;
+ if (v6) {
+ count6 = v6->__stat_nscount;
+ } else {
+ count6 = 0;
+ }
+
+ nservers = count4 + count6;
+ servers = ares_malloc(nservers * sizeof(struct server_state));
+ if (!servers)
+ return ARES_ENOMEM;
+
+ memset(servers, 0, nservers * sizeof(struct server_state));
+
+ pserver = servers;
+ for (int i = 0; i < count4; ++i, ++pserver) {
+ struct sockaddr_in *addr_in = &(res->nsaddr_list[i]);
+ pserver->addr.addrV4.s_addr = addr_in->sin_addr.s_addr;
+ pserver->addr.family = AF_INET;
+ pserver->addr.udp_port = addr_in->sin_port;
+ pserver->addr.tcp_port = addr_in->sin_port;
+ }
+
+ for (int j = 0; j < count6; ++j, ++pserver) {
+ struct sockaddr_in6 *addr_in = &(v6->__stat_nsaddr_list[j]);
+ memcpy(&(pserver->addr.addr.addr6), &(addr_in->sin6_addr),
+ sizeof(addr_in->sin6_addr));
+ pserver->addr.family = AF_INET6;
+ pserver->addr.udp_port = addr_in->sin6_port;
+ pserver->addr.tcp_port = addr_in->sin6_port;
+ }
+
+ status = ARES_EOF;
+
+#elif defined(__riscos__)
+
+ /* Under RISC OS, name servers are listed in the
+ system variable Inet$Resolvers, space separated. */
+
+ line = getenv("Inet$Resolvers");
+ status = ARES_EOF;
+ if (line) {
+ char *resolvers = ares_strdup(line), *pos, *space;
+
+ if (!resolvers)
+ return ARES_ENOMEM;
+
+ pos = resolvers;
+ do {
+ space = strchr(pos, ' ');
+ if (space)
+ *space = '\0';
+ status = config_nameserver(&servers, &nservers, pos);
+ if (status != ARES_SUCCESS)
+ break;
+ pos = space + 1;
+ } while (space);
+
+ if (status == ARES_SUCCESS)
+ status = ARES_EOF;
+
+ ares_free(resolvers);
+ }
+
+#elif defined(WATT32)
+ int i;
+
+ sock_init();
+ for (i = 0; def_nameservers[i]; i++)
+ ;
+ if (i == 0)
+ return ARES_SUCCESS; /* use localhost DNS server */
+
+ nservers = i;
+ servers = ares_malloc(sizeof(struct server_state));
+ if (!servers)
+ return ARES_ENOMEM;
+ memset(servers, 0, sizeof(struct server_state));
+
+ for (i = 0; def_nameservers[i]; i++)
+ {
+ servers[i].addr.addrV4.s_addr = htonl(def_nameservers[i]);
+ servers[i].addr.family = AF_INET;
+ servers[i].addr.udp_port = 0;
+ servers[i].addr.tcp_port = 0;
+ }
+ status = ARES_EOF;
+
+#elif defined(ANDROID) || defined(__ANDROID__)
+ unsigned int i;
+ char **dns_servers;
+ char *domains;
+ size_t num_servers;
+
+ /* Use the Android connectivity manager to get a list
+ * of DNS servers. As of Android 8 (Oreo) net.dns#
+ * system properties are no longer available. Google claims this
+ * improves privacy. Apps now need the ACCESS_NETWORK_STATE
+ * permission and must use the ConnectivityManager which
+ * is Java only. */
+ dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers);
+ if (dns_servers != NULL)
+ {
+ for (i = 0; i < num_servers; i++)
+ {
+ status = config_nameserver(&servers, &nservers, dns_servers[i]);
+ if (status != ARES_SUCCESS)
+ break;
+ status = ARES_EOF;
+ }
+ for (i = 0; i < num_servers; i++)
+ {
+ ares_free(dns_servers[i]);
+ }
+ ares_free(dns_servers);
+ }
+ if (channel->ndomains == -1)
+ {
+ domains = ares_get_android_search_domains_list();
+ set_search(channel, domains);
+ ares_free(domains);
+ }
+
+# ifdef HAVE___SYSTEM_PROPERTY_GET
+ /* Old way using the system property still in place as
+ * a fallback. Older android versions can still use this.
+ * it's possible for older apps not not have added the new
+ * permission and we want to try to avoid breaking those.
+ *
+ * We'll only run this if we don't have any dns servers
+ * because this will get the same ones (if it works). */
+ if (status != ARES_EOF) {
+ char propname[PROP_NAME_MAX];
+ char propvalue[PROP_VALUE_MAX]="";
+ for (i = 1; i <= MAX_DNS_PROPERTIES; i++) {
+ snprintf(propname, sizeof(propname), "%s%u", DNS_PROP_NAME_PREFIX, i);
+ if (__system_property_get(propname, propvalue) < 1) {
+ status = ARES_EOF;
+ break;
+ }
+
+ status = config_nameserver(&servers, &nservers, propvalue);
+ if (status != ARES_SUCCESS)
+ break;
+ status = ARES_EOF;
+ }
+ }
+# endif /* HAVE___SYSTEM_PROPERTY_GET */
+#elif defined(CARES_USE_LIBRESOLV)
+ struct __res_state res;
+ memset(&res, 0, sizeof(res));
+ int result = res_ninit(&res);
+ if (result == 0 && (res.options & RES_INIT)) {
+ status = ARES_EOF;
+
+ if (channel->nservers == -1) {
+ union res_sockaddr_union addr[MAXNS];
+ int nscount = res_getservers(&res, addr, MAXNS);
+ int i;
+ for (i = 0; i < nscount; ++i) {
+ char str[INET6_ADDRSTRLEN];
+ int config_status;
+ sa_family_t family = addr[i].sin.sin_family;
+ if (family == AF_INET) {
+ ares_inet_ntop(family, &addr[i].sin.sin_addr, str, sizeof(str));
+ } else if (family == AF_INET6) {
+ ares_inet_ntop(family, &addr[i].sin6.sin6_addr, str, sizeof(str));
+ } else {
+ continue;
+ }
+
+ config_status = config_nameserver(&servers, &nservers, str);
+ if (config_status != ARES_SUCCESS) {
+ status = config_status;
+ break;
+ }
+ }
+ }
+ if (channel->ndomains == -1) {
+ int entries = 0;
+ while ((entries < MAXDNSRCH) && res.dnsrch[entries])
+ entries++;
+ if(entries) {
+ channel->domains = ares_malloc(entries * sizeof(char *));
+ if (!channel->domains) {
+ status = ARES_ENOMEM;
+ } else {
+ int i;
+ channel->ndomains = entries;
+ for (i = 0; i < channel->ndomains; ++i) {
+ channel->domains[i] = ares_strdup(res.dnsrch[i]);
+ if (!channel->domains[i])
+ status = ARES_ENOMEM;
+ }
+ }
+ }
+ }
+ if (channel->ndots == -1)
+ channel->ndots = res.ndots;
+ if (channel->tries == -1)
+ channel->tries = res.retry;
+ if (channel->rotate == -1)
+ channel->rotate = res.options & RES_ROTATE;
+ if (channel->timeout == -1)
+ channel->timeout = res.retrans * 1000;
+
+ res_ndestroy(&res);
+ }
+#else
+ {
+ char *p;
+ FILE *fp;
+ size_t linesize;
+ int error;
+ int update_domains;
+ const char *resolvconf_path;
+
+ /* Don't read resolv.conf and friends if we don't have to */
+ if (ARES_CONFIG_CHECK(channel))
+ return ARES_SUCCESS;
+
+ /* Only update search domains if they're not already specified */
+ update_domains = (channel->ndomains == -1);
+
+ /* Support path for resolvconf filename set by ares_init_options */
+ if(channel->resolvconf_path) {
+ resolvconf_path = channel->resolvconf_path;
+ } else {
+ resolvconf_path = PATH_RESOLV_CONF;
+ }
+
+ fp = fopen(resolvconf_path, "r");
+ if (fp) {
+ while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
+ {
+ if ((p = try_config(line, "domain", ';')) && update_domains)
+ status = config_domain(channel, p);
+ else if ((p = try_config(line, "lookup", ';')) && !channel->lookups)
+ status = config_lookup(channel, p, "bind", NULL, "file");
+ else if ((p = try_config(line, "search", ';')) && update_domains)
+ status = set_search(channel, p);
+ else if ((p = try_config(line, "nameserver", ';')) &&
+ channel->nservers == -1)
+ status = config_nameserver(&servers, &nservers, p);
+ else if ((p = try_config(line, "sortlist", ';')) &&
+ channel->nsort == -1)
+ status = config_sortlist(&sortlist, &nsort, p);
+ else if ((p = try_config(line, "options", ';')))
+ status = set_options(channel, p);
+ else
+ status = ARES_SUCCESS;
+ if (status != ARES_SUCCESS)
+ break;
+ }
+ fclose(fp);
+ }
+ else {
+ error = ERRNO;
+ switch(error) {
+ case ENOENT:
+ case ESRCH:
+ status = ARES_EOF;
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n", PATH_RESOLV_CONF));
+ status = ARES_EFILE;
+ }
+ }
+
+ if ((status == ARES_EOF) && (!channel->lookups)) {
+ /* Many systems (Solaris, Linux, BSD's) use nsswitch.conf */
+ fp = fopen("/etc/nsswitch.conf", "r");
+ if (fp) {
+ while ((status = ares__read_line(fp, &line, &linesize)) ==
+ ARES_SUCCESS)
+ {
+ if ((p = try_config(line, "hosts:", '\0')) && !channel->lookups)
+ (void)config_lookup(channel, p, "dns", "resolve", "files");
+ }
+ fclose(fp);
+ }
+ else {
+ error = ERRNO;
+ switch(error) {
+ case ENOENT:
+ case ESRCH:
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ "/etc/nsswitch.conf"));
+ }
+
+ /* ignore error, maybe we will get luck in next if clause */
+ status = ARES_EOF;
+ }
+ }
+
+ if ((status == ARES_EOF) && (!channel->lookups)) {
+ /* Linux / GNU libc 2.x and possibly others have host.conf */
+ fp = fopen("/etc/host.conf", "r");
+ if (fp) {
+ while ((status = ares__read_line(fp, &line, &linesize)) ==
+ ARES_SUCCESS)
+ {
+ if ((p = try_config(line, "order", '\0')) && !channel->lookups)
+ /* ignore errors */
+ (void)config_lookup(channel, p, "bind", NULL, "hosts");
+ }
+ fclose(fp);
+ }
+ else {
+ error = ERRNO;
+ switch(error) {
+ case ENOENT:
+ case ESRCH:
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ "/etc/host.conf"));
+ }
+
+ /* ignore error, maybe we will get luck in next if clause */
+ status = ARES_EOF;
+ }
+ }
+
+ if ((status == ARES_EOF) && (!channel->lookups)) {
+ /* Tru64 uses /etc/svc.conf */
+ fp = fopen("/etc/svc.conf", "r");
+ if (fp) {
+ while ((status = ares__read_line(fp, &line, &linesize)) ==
+ ARES_SUCCESS)
+ {
+ if ((p = try_config(line, "hosts=", '\0')) && !channel->lookups)
+ /* ignore errors */
+ (void)config_lookup(channel, p, "bind", NULL, "local");
+ }
+ fclose(fp);
+ }
+ else {
+ error = ERRNO;
+ switch(error) {
+ case ENOENT:
+ case ESRCH:
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n", "/etc/svc.conf"));
+ }
+
+ /* ignore error, default value will be chosen for `channel->lookups` */
+ status = ARES_EOF;
+ }
+ }
+
+ if(line)
+ ares_free(line);
+ }
+
+#endif
+
+ /* Handle errors. */
+ if (status != ARES_EOF)
+ {
+ if (servers != NULL)
+ ares_free(servers);
+ if (sortlist != NULL)
+ ares_free(sortlist);
+ return status;
+ }
+
+ /* If we got any name server entries, fill them in. */
+ if (servers)
+ {
+ channel->servers = servers;
+ channel->nservers = nservers;
+ }
+
+ /* If we got any sortlist entries, fill them in. */
+ if (sortlist)
+ {
+ channel->sortlist = sortlist;
+ channel->nsort = nsort;
+ }
+
+ return ARES_SUCCESS;
+}
+
+static int init_by_defaults(ares_channel channel)
+{
+ char *hostname = NULL;
+ int rc = ARES_SUCCESS;
+#ifdef HAVE_GETHOSTNAME
+ char *dot;
+#endif
+
+ if (channel->flags == -1)
+ channel->flags = 0;
+ if (channel->timeout == -1)
+ channel->timeout = DEFAULT_TIMEOUT;
+ if (channel->tries == -1)
+ channel->tries = DEFAULT_TRIES;
+ if (channel->ndots == -1)
+ channel->ndots = 1;
+ if (channel->rotate == -1)
+ channel->rotate = 0;
+ if (channel->udp_port == -1)
+ channel->udp_port = htons(NAMESERVER_PORT);
+ if (channel->tcp_port == -1)
+ channel->tcp_port = htons(NAMESERVER_PORT);
+
+ if (channel->ednspsz == -1)
+ channel->ednspsz = EDNSPACKETSZ;
+
+ if (channel->nservers == -1) {
+ /* If nobody specified servers, try a local named. */
+ channel->servers = ares_malloc(sizeof(struct server_state));
+ if (!channel->servers) {
+ rc = ARES_ENOMEM;
+ goto error;
+ }
+ channel->servers[0].addr.family = AF_INET;
+ channel->servers[0].addr.addrV4.s_addr = htonl(INADDR_LOOPBACK);
+ channel->servers[0].addr.udp_port = 0;
+ channel->servers[0].addr.tcp_port = 0;
+ channel->nservers = 1;
+ }
+
+#if defined(USE_WINSOCK)
+#define toolong(x) (x == -1) && (SOCKERRNO == WSAEFAULT)
+#elif defined(ENAMETOOLONG)
+#define toolong(x) (x == -1) && ((SOCKERRNO == ENAMETOOLONG) || \
+ (SOCKERRNO == EINVAL))
+#else
+#define toolong(x) (x == -1) && (SOCKERRNO == EINVAL)
+#endif
+
+ if (channel->ndomains == -1) {
+ /* Derive a default domain search list from the kernel hostname,
+ * or set it to empty if the hostname isn't helpful.
+ */
+#ifndef HAVE_GETHOSTNAME
+ channel->ndomains = 0; /* default to none */
+#else
+ GETHOSTNAME_TYPE_ARG2 lenv = 64;
+ size_t len = 64;
+ int res;
+ channel->ndomains = 0; /* default to none */
+
+ hostname = ares_malloc(len);
+ if(!hostname) {
+ rc = ARES_ENOMEM;
+ goto error;
+ }
+
+ do {
+ res = gethostname(hostname, lenv);
+
+ if(toolong(res)) {
+ char *p;
+ len *= 2;
+ lenv *= 2;
+ p = ares_realloc(hostname, len);
+ if(!p) {
+ rc = ARES_ENOMEM;
+ goto error;
+ }
+ hostname = p;
+ continue;
+ }
+ else if(res) {
+ /* Lets not treat a gethostname failure as critical, since we
+ * are ok if gethostname doesn't even exist */
+ *hostname = '\0';
+ break;
+ }
+
+ } while (res != 0);
+
+ dot = strchr(hostname, '.');
+ if (dot) {
+ /* a dot was found */
+ channel->domains = ares_malloc(sizeof(char *));
+ if (!channel->domains) {
+ rc = ARES_ENOMEM;
+ goto error;
+ }
+ channel->domains[0] = ares_strdup(dot + 1);
+ if (!channel->domains[0]) {
+ rc = ARES_ENOMEM;
+ goto error;
+ }
+ channel->ndomains = 1;
+ }
+#endif
+ }
+
+ if (channel->nsort == -1) {
+ channel->sortlist = NULL;
+ channel->nsort = 0;
+ }
+
+ if (!channel->lookups) {
+ channel->lookups = ares_strdup("fb");
+ if (!channel->lookups)
+ rc = ARES_ENOMEM;
+ }
+
+ error:
+ if(rc) {
+ if(channel->servers) {
+ ares_free(channel->servers);
+ channel->servers = NULL;
+ }
+
+ if(channel->domains && channel->domains[0])
+ ares_free(channel->domains[0]);
+ if(channel->domains) {
+ ares_free(channel->domains);
+ channel->domains = NULL;
+ }
+
+ if(channel->lookups) {
+ ares_free(channel->lookups);
+ channel->lookups = NULL;
+ }
+
+ if(channel->resolvconf_path) {
+ ares_free(channel->resolvconf_path);
+ channel->resolvconf_path = NULL;
+ }
+ }
+
+ if(hostname)
+ ares_free(hostname);
+
+ return rc;
+}
+
+#if !defined(WIN32) && !defined(WATT32) && \
+ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
+static int config_domain(ares_channel channel, char *str)
+{
+ char *q;
+
+ /* Set a single search domain. */
+ q = str;
+ while (*q && !ISSPACE(*q))
+ q++;
+ *q = '\0';
+ return set_search(channel, str);
+}
+
+#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \
+ defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__)
+ /* workaround icc 9.1 optimizer issue */
+# define vqualifier volatile
+#else
+# define vqualifier
+#endif
+
+static int config_lookup(ares_channel channel, const char *str,
+ const char *bindch, const char *altbindch,
+ const char *filech)
+{
+ char lookups[3], *l;
+ const char *vqualifier p;
+ int found;
+
+ if (altbindch == NULL)
+ altbindch = bindch;
+
+ /* Set the lookup order. Only the first letter of each work
+ * is relevant, and it has to be "b" for DNS or "f" for the
+ * host file. Ignore everything else.
+ */
+ l = lookups;
+ p = str;
+ found = 0;
+ while (*p)
+ {
+ if ((*p == *bindch || *p == *altbindch || *p == *filech) && l < lookups + 2) {
+ if (*p == *bindch || *p == *altbindch) *l++ = 'b';
+ else *l++ = 'f';
+ found = 1;
+ }
+ while (*p && !ISSPACE(*p) && (*p != ','))
+ p++;
+ while (*p && (ISSPACE(*p) || (*p == ',')))
+ p++;
+ }
+ if (!found)
+ return ARES_ENOTINITIALIZED;
+ *l = '\0';
+ channel->lookups = ares_strdup(lookups);
+ return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
+}
+#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ & !CARES_USE_LIBRESOLV */
+
+#ifndef WATT32
+/* Validate that the ip address matches the subnet (network base and network
+ * mask) specified. Addresses are specified in standard Network Byte Order as
+ * 16 bytes, and the netmask is 0 to 128 (bits).
+ */
+static int ares_ipv6_subnet_matches(const unsigned char netbase[16],
+ unsigned char netmask,
+ const unsigned char ipaddr[16])
+{
+ unsigned char mask[16] = { 0 };
+ unsigned char i;
+
+ /* Misuse */
+ if (netmask > 128)
+ return 0;
+
+ /* Quickly set whole bytes */
+ memset(mask, 0xFF, netmask / 8);
+
+ /* Set remaining bits */
+ if(netmask % 8) {
+ mask[netmask / 8] = (unsigned char)(0xff << (8 - (netmask % 8)));
+ }
+
+ for (i=0; i<16; i++) {
+ if ((netbase[i] & mask[i]) != (ipaddr[i] & mask[i]))
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Return true iff the IPv6 ipaddr is blacklisted. */
+static int ares_ipv6_server_blacklisted(const unsigned char ipaddr[16])
+{
+ /* A list of blacklisted IPv6 subnets. */
+ const struct {
+ const unsigned char netbase[16];
+ unsigned char netmask;
+ } blacklist[] = {
+ /* fec0::/10 was deprecated by [RFC3879] in September 2004. Formerly a
+ * Site-Local scoped address prefix. These are never valid DNS servers,
+ * but are known to be returned at least sometimes on Windows and Android.
+ */
+ {
+ {
+ 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ },
+ 10
+ }
+ };
+ size_t i;
+
+ /* See if ipaddr matches any of the entries in the blacklist. */
+ for (i = 0; i < sizeof(blacklist) / sizeof(blacklist[0]); ++i) {
+ if (ares_ipv6_subnet_matches(
+ blacklist[i].netbase, blacklist[i].netmask, ipaddr))
+ return 1;
+ }
+ return 0;
+}
+
+/* Add the IPv4 or IPv6 nameservers in str (separated by commas) to the
+ * servers list, updating servers and nservers as required.
+ *
+ * This will silently ignore blacklisted IPv6 nameservers as detected by
+ * ares_ipv6_server_blacklisted().
+ *
+ * Returns an error code on failure, else ARES_SUCCESS.
+ */
+static int config_nameserver(struct server_state **servers, int *nservers,
+ char *str)
+{
+ struct ares_addr host;
+ struct server_state *newserv;
+ char *p, *txtaddr;
+ /* On Windows, there may be more than one nameserver specified in the same
+ * registry key, so we parse input as a space or comma seperated list.
+ */
+ for (p = str; p;)
+ {
+ /* Skip whitespace and commas. */
+ while (*p && (ISSPACE(*p) || (*p == ',')))
+ p++;
+ if (!*p)
+ /* No more input, done. */
+ break;
+
+ /* Pointer to start of IPv4 or IPv6 address part. */
+ txtaddr = p;
+
+ /* Advance past this address. */
+ while (*p && !ISSPACE(*p) && (*p != ','))
+ p++;
+ if (*p)
+ /* Null terminate this address. */
+ *p++ = '\0';
+ else
+ /* Reached end of input, done when this address is processed. */
+ p = NULL;
+
+ /* Convert textual address to binary format. */
+ if (ares_inet_pton(AF_INET, txtaddr, &host.addrV4) == 1)
+ host.family = AF_INET;
+ else if (ares_inet_pton(AF_INET6, txtaddr, &host.addrV6) == 1
+ /* Silently skip blacklisted IPv6 servers. */
+ && !ares_ipv6_server_blacklisted(
+ (const unsigned char *)&host.addrV6))
+ host.family = AF_INET6;
+ else
+ continue;
+
+ /* Resize servers state array. */
+ newserv = ares_realloc(*servers, (*nservers + 1) *
+ sizeof(struct server_state));
+ if (!newserv)
+ return ARES_ENOMEM;
+
+ /* Store address data. */
+ newserv[*nservers].addr.family = host.family;
+ newserv[*nservers].addr.udp_port = 0;
+ newserv[*nservers].addr.tcp_port = 0;
+ if (host.family == AF_INET)
+ memcpy(&newserv[*nservers].addr.addrV4, &host.addrV4,
+ sizeof(host.addrV4));
+ else
+ memcpy(&newserv[*nservers].addr.addrV6, &host.addrV6,
+ sizeof(host.addrV6));
+
+ /* Update arguments. */
+ *servers = newserv;
+ *nservers += 1;
+ }
+
+ return ARES_SUCCESS;
+}
+#endif /* !WATT32 */
+
+static int config_sortlist(struct apattern **sortlist, int *nsort,
+ const char *str)
+{
+ struct apattern pat;
+ const char *q;
+
+ /* Add sortlist entries. */
+ while (*str && *str != ';')
+ {
+ int bits;
+ char ipbuf[16], ipbufpfx[32];
+ /* Find just the IP */
+ q = str;
+ while (*q && *q != '/' && *q != ';' && !ISSPACE(*q))
+ q++;
+ memcpy(ipbuf, str, q-str);
+ ipbuf[q-str] = '\0';
+ /* Find the prefix */
+ if (*q == '/')
+ {
+ const char *str2 = q+1;
+ while (*q && *q != ';' && !ISSPACE(*q))
+ q++;
+ memcpy(ipbufpfx, str, q-str);
+ ipbufpfx[q-str] = '\0';
+ str = str2;
+ }
+ else
+ ipbufpfx[0] = '\0';
+ /* Lets see if it is CIDR */
+ /* First we'll try IPv6 */
+ if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
+ &pat.addrV6,
+ sizeof(pat.addrV6))) > 0)
+ {
+ pat.type = PATTERN_CIDR;
+ pat.mask.bits = (unsigned short)bits;
+ pat.family = AF_INET6;
+ if (!sortlist_alloc(sortlist, nsort, &pat)) {
+ ares_free(*sortlist);
+ *sortlist = NULL;
+ return ARES_ENOMEM;
+ }
+ }
+ else if (ipbufpfx[0] &&
+ (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
+ sizeof(pat.addrV4))) > 0)
+ {
+ pat.type = PATTERN_CIDR;
+ pat.mask.bits = (unsigned short)bits;
+ pat.family = AF_INET;
+ if (!sortlist_alloc(sortlist, nsort, &pat)) {
+ ares_free(*sortlist);
+ *sortlist = NULL;
+ return ARES_ENOMEM;
+ }
+ }
+ /* See if it is just a regular IP */
+ else if (ip_addr(ipbuf, q-str, &pat.addrV4) == 0)
+ {
+ if (ipbufpfx[0])
+ {
+ memcpy(ipbuf, str, q-str);
+ ipbuf[q-str] = '\0';
+ if (ip_addr(ipbuf, q-str, &pat.mask.addr4) != 0)
+ natural_mask(&pat);
+ }
+ else
+ natural_mask(&pat);
+ pat.family = AF_INET;
+ pat.type = PATTERN_MASK;
+ if (!sortlist_alloc(sortlist, nsort, &pat)) {
+ ares_free(*sortlist);
+ *sortlist = NULL;
+ return ARES_ENOMEM;
+ }
+ }
+ else
+ {
+ while (*q && *q != ';' && !ISSPACE(*q))
+ q++;
+ }
+ str = q;
+ while (ISSPACE(*str))
+ str++;
+ }
+
+ return ARES_SUCCESS;
+}
+
+static int set_search(ares_channel channel, const char *str)
+{
+ size_t cnt;
+
+ if(channel->ndomains != -1) {
+ /* LCOV_EXCL_START: all callers check ndomains == -1 */
+ /* if we already have some domains present, free them first */
+ ares_strsplit_free(channel->domains, channel->ndomains);
+ channel->domains = NULL;
+ channel->ndomains = -1;
+ } /* LCOV_EXCL_STOP */
+
+ channel->domains = ares_strsplit(str, ", ", 1, &cnt);
+ channel->ndomains = (int)cnt;
+ if (channel->domains == NULL || channel->ndomains == 0) {
+ channel->domains = NULL;
+ channel->ndomains = -1;
+ }
+
+ return ARES_SUCCESS;
+}
+
+static int set_options(ares_channel channel, const char *str)
+{
+ const char *p, *q, *val;
+
+ p = str;
+ while (*p)
+ {
+ q = p;
+ while (*q && !ISSPACE(*q))
+ q++;
+ val = try_option(p, q, "ndots:");
+ if (val && channel->ndots == -1)
+ channel->ndots = aresx_sltosi(strtol(val, NULL, 10));
+ val = try_option(p, q, "retrans:");
+ if (val && channel->timeout == -1)
+ channel->timeout = aresx_sltosi(strtol(val, NULL, 10));
+ val = try_option(p, q, "retry:");
+ if (val && channel->tries == -1)
+ channel->tries = aresx_sltosi(strtol(val, NULL, 10));
+ val = try_option(p, q, "rotate");
+ if (val && channel->rotate == -1)
+ channel->rotate = 1;
+ p = q;
+ while (ISSPACE(*p))
+ p++;
+ }
+
+ return ARES_SUCCESS;
+}
+
+static const char *try_option(const char *p, const char *q, const char *opt)
+{
+ size_t len = strlen(opt);
+ return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
+}
+
+#if !defined(WIN32) && !defined(WATT32) && \
+ !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV)
+static char *try_config(char *s, const char *opt, char scc)
+{
+ size_t len;
+ char *p;
+ char *q;
+
+ if (!s || !opt)
+ /* no line or no option */
+ return NULL; /* LCOV_EXCL_LINE */
+
+ /* Hash '#' character is always used as primary comment char, additionally
+ a not-NUL secondary comment char will be considered when specified. */
+
+ /* trim line comment */
+ p = s;
+ if(scc)
+ while (*p && (*p != '#') && (*p != scc))
+ p++;
+ else
+ while (*p && (*p != '#'))
+ p++;
+ *p = '\0';
+
+ /* trim trailing whitespace */
+ q = p - 1;
+ while ((q >= s) && ISSPACE(*q))
+ q--;
+ *++q = '\0';
+
+ /* skip leading whitespace */
+ p = s;
+ while (*p && ISSPACE(*p))
+ p++;
+
+ if (!*p)
+ /* empty line */
+ return NULL;
+
+ if ((len = strlen(opt)) == 0)
+ /* empty option */
+ return NULL; /* LCOV_EXCL_LINE */
+
+ if (strncmp(p, opt, len) != 0)
+ /* line and option do not match */
+ return NULL;
+
+ /* skip over given option name */
+ p += len;
+
+ if (!*p)
+ /* no option value */
+ return NULL; /* LCOV_EXCL_LINE */
+
+ if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p))
+ /* whitespace between option name and value is mandatory
+ for given option names which do not end with ':' or '=' */
+ return NULL;
+
+ /* skip over whitespace */
+ while (*p && ISSPACE(*p))
+ p++;
+
+ if (!*p)
+ /* no option value */
+ return NULL;
+
+ /* return pointer to option value */
+ return p;
+}
+#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */
+
+static int ip_addr(const char *ipbuf, ares_ssize_t len, struct in_addr *addr)
+{
+
+ /* Four octets and three periods yields at most 15 characters. */
+ if (len > 15)
+ return -1;
+
+ if (ares_inet_pton(AF_INET, ipbuf, addr) < 1)
+ return -1;
+
+ return 0;
+}
+
+static void natural_mask(struct apattern *pat)
+{
+ struct in_addr addr;
+
+ /* Store a host-byte-order copy of pat in a struct in_addr. Icky,
+ * but portable.
+ */
+ addr.s_addr = ntohl(pat->addrV4.s_addr);
+
+ /* This is out of date in the CIDR world, but some people might
+ * still rely on it.
+ */
+ if (IN_CLASSA(addr.s_addr))
+ pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET);
+ else if (IN_CLASSB(addr.s_addr))
+ pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET);
+ else
+ pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
+}
+
+static int sortlist_alloc(struct apattern **sortlist, int *nsort,
+ struct apattern *pat)
+{
+ struct apattern *newsort;
+ newsort = ares_realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern));
+ if (!newsort)
+ return 0;
+ newsort[*nsort] = *pat;
+ *sortlist = newsort;
+ (*nsort)++;
+ return 1;
+}
+
+/* initialize an rc4 key. If possible a cryptographically secure random key
+ is generated using a suitable function (for example win32's RtlGenRandom as
+ described in
+ http://blogs.msdn.com/michael_howard/archive/2005/01/14/353379.aspx
+ otherwise the code defaults to cross-platform albeit less secure mechanism
+ using rand
+*/
+static void randomize_key(unsigned char* key,int key_data_len)
+{
+ int randomized = 0;
+ int counter=0;
+#ifdef WIN32
+ BOOLEAN res;
+ if (ares_fpSystemFunction036)
+ {
+ res = (*ares_fpSystemFunction036) (key, key_data_len);
+ if (res)
+ randomized = 1;
+ }
+#else /* !WIN32 */
+#ifdef CARES_RANDOM_FILE
+ FILE *f = fopen(CARES_RANDOM_FILE, "rb");
+ if(f) {
+ setvbuf(f, NULL, _IONBF, 0);
+ counter = aresx_uztosi(fread(key, 1, key_data_len, f));
+ fclose(f);
+ }
+#endif
+#endif /* WIN32 */
+
+ if (!randomized) {
+ for (;counter<key_data_len;counter++)
+ key[counter]=(unsigned char)(rand() % 256); /* LCOV_EXCL_LINE */
+ }
+}
+
+static int init_id_key(rc4_key* key,int key_data_len)
+{
+ unsigned char index1;
+ unsigned char index2;
+ unsigned char* state;
+ short counter;
+ unsigned char *key_data_ptr = 0;
+
+ key_data_ptr = ares_malloc(key_data_len);
+ if (!key_data_ptr)
+ return ARES_ENOMEM;
+ memset(key_data_ptr, 0, key_data_len);
+
+ state = &key->state[0];
+ for(counter = 0; counter < 256; counter++)
+ /* unnecessary AND but it keeps some compilers happier */
+ state[counter] = (unsigned char)(counter & 0xff);
+ randomize_key(key->state,key_data_len);
+ key->x = 0;
+ key->y = 0;
+ index1 = 0;
+ index2 = 0;
+ for(counter = 0; counter < 256; counter++)
+ {
+ index2 = (unsigned char)((key_data_ptr[index1] + state[counter] +
+ index2) % 256);
+ ARES_SWAP_BYTE(&state[counter], &state[index2]);
+
+ index1 = (unsigned char)((index1 + 1) % key_data_len);
+ }
+ ares_free(key_data_ptr);
+ return ARES_SUCCESS;
+}
+
+void ares_set_local_ip4(ares_channel channel, unsigned int local_ip)
+{
+ channel->local_ip4 = local_ip;
+}
+
+/* local_ip6 should be 16 bytes in length */
+void ares_set_local_ip6(ares_channel channel,
+ const unsigned char* local_ip6)
+{
+ memcpy(&channel->local_ip6, local_ip6, sizeof(channel->local_ip6));
+}
+
+/* local_dev_name should be null terminated. */
+void ares_set_local_dev(ares_channel channel,
+ const char* local_dev_name)
+{
+ strncpy(channel->local_dev_name, local_dev_name,
+ sizeof(channel->local_dev_name));
+ channel->local_dev_name[sizeof(channel->local_dev_name) - 1] = 0;
+}
+
+
+void ares_set_socket_callback(ares_channel channel,
+ ares_sock_create_callback cb,
+ void *data)
+{
+ channel->sock_create_cb = cb;
+ channel->sock_create_cb_data = data;
+}
+
+void ares_set_socket_configure_callback(ares_channel channel,
+ ares_sock_config_callback cb,
+ void *data)
+{
+ channel->sock_config_cb = cb;
+ channel->sock_config_cb_data = data;
+}
+
+void ares_set_socket_functions(ares_channel channel,
+ const struct ares_socket_functions * funcs,
+ void *data)
+{
+ channel->sock_funcs = funcs;
+ channel->sock_func_cb_data = data;
+}
+
+int ares_set_sortlist(ares_channel channel, const char *sortstr)
+{
+ int nsort = 0;
+ struct apattern *sortlist = NULL;
+ int status;
+
+ if (!channel)
+ return ARES_ENODATA;
+
+ status = config_sortlist(&sortlist, &nsort, sortstr);
+ if (status == ARES_SUCCESS && sortlist) {
+ if (channel->sortlist)
+ ares_free(channel->sortlist);
+ channel->sortlist = sortlist;
+ channel->nsort = nsort;
+ }
+ return status;
+}
+
+void ares__init_servers_state(ares_channel channel)
+{
+ struct server_state *server;
+ int i;
+
+ for (i = 0; i < channel->nservers; i++)
+ {
+ server = &channel->servers[i];
+ server->udp_socket = ARES_SOCKET_BAD;
+ server->tcp_socket = ARES_SOCKET_BAD;
+ server->tcp_connection_generation = ++channel->tcp_connection_generation;
+ server->tcp_lenbuf_pos = 0;
+ server->tcp_buffer_pos = 0;
+ server->tcp_buffer = NULL;
+ server->tcp_length = 0;
+ server->qhead = NULL;
+ server->qtail = NULL;
+ ares__init_list_head(&server->queries_to_server);
+ server->channel = channel;
+ server->is_broken = 0;
+ }
+}
diff --git a/grpc/third_party/cares/cares/ares_iphlpapi.h b/grpc/third_party/cares/cares/src/lib/ares_iphlpapi.h
index 343aee3f..343aee3f 100644
--- a/grpc/third_party/cares/cares/ares_iphlpapi.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_iphlpapi.h
diff --git a/grpc/third_party/cares/cares/src/lib/ares_ipv6.h b/grpc/third_party/cares/cares/src/lib/ares_ipv6.h
new file mode 100644
index 00000000..fdbc21fe
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_ipv6.h
@@ -0,0 +1,85 @@
+
+/* Copyright (C) 2005 by Dominick Meglio
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#ifndef ARES_IPV6_H
+#define ARES_IPV6_H
+
+#ifndef HAVE_PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
+#ifndef HAVE_STRUCT_SOCKADDR_IN6
+struct sockaddr_in6
+{
+ unsigned short sin6_family;
+ unsigned short sin6_port;
+ unsigned long sin6_flowinfo;
+ struct ares_in6_addr sin6_addr;
+ unsigned int sin6_scope_id;
+};
+#endif
+
+typedef union
+{
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+} ares_sockaddr;
+
+#ifndef HAVE_STRUCT_ADDRINFO
+struct addrinfo
+{
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
+ char *ai_canonname;
+ struct sockaddr *ai_addr;
+ struct addrinfo *ai_next;
+};
+#endif
+
+#ifndef NS_IN6ADDRSZ
+#ifndef HAVE_STRUCT_IN6_ADDR
+/* We cannot have it set to zero, so we pick a fixed value here */
+#define NS_IN6ADDRSZ 16
+#else
+#define NS_IN6ADDRSZ sizeof(struct in6_addr)
+#endif
+#endif
+
+#ifndef NS_INADDRSZ
+#define NS_INADDRSZ sizeof(struct in_addr)
+#endif
+
+#ifndef NS_INT16SZ
+#define NS_INT16SZ 2
+#endif
+
+#ifndef IF_NAMESIZE
+#ifdef IFNAMSIZ
+#define IF_NAMESIZE IFNAMSIZ
+#else
+#define IF_NAMESIZE 256
+#endif
+#endif
+
+/* Defined in inet_net_pton.c for no particular reason. */
+extern const struct ares_in6_addr ares_in6addr_any; /* :: */
+
+
+#endif /* ARES_IPV6_H */
diff --git a/grpc/third_party/cares/cares/src/lib/ares_library_init.c b/grpc/third_party/cares/cares/src/lib/ares_library_init.c
new file mode 100644
index 00000000..e0055d44
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_library_init.c
@@ -0,0 +1,200 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004-2009 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#include "ares.h"
+#include "ares_library_init.h"
+#include "ares_private.h"
+
+/* library-private global and unique instance vars */
+
+#ifdef USE_WINSOCK
+fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
+fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
+fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses = ZERO_NULL;
+fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL;
+#endif
+
+#if defined(ANDROID) || defined(__ANDROID__)
+#include "ares_android.h"
+#endif
+
+/* library-private global vars with source visibility restricted to this file */
+
+static unsigned int ares_initialized;
+static int ares_init_flags;
+
+/* library-private global vars with visibility across the whole library */
+
+/* Some systems may return either NULL or a valid pointer on malloc(0). c-ares should
+ * never call malloc(0) so lets return NULL so we're more likely to find an issue if it
+ * were to occur. */
+
+static void *default_malloc(size_t size) { if (size == 0) { return NULL; } return malloc(size); }
+
+#if defined(WIN32)
+/* We need indirections to handle Windows DLL rules. */
+static void *default_realloc(void *p, size_t size) { return realloc(p, size); }
+static void default_free(void *p) { free(p); }
+#else
+# define default_realloc realloc
+# define default_free free
+#endif
+void *(*ares_malloc)(size_t size) = default_malloc;
+void *(*ares_realloc)(void *ptr, size_t size) = default_realloc;
+void (*ares_free)(void *ptr) = default_free;
+
+#ifdef USE_WINSOCK
+static HMODULE hnd_iphlpapi;
+static HMODULE hnd_advapi32;
+#endif
+
+
+static int ares_win32_init(void)
+{
+#ifdef USE_WINSOCK
+
+ hnd_iphlpapi = 0;
+ hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
+ if (!hnd_iphlpapi)
+ return ARES_ELOADIPHLPAPI;
+
+ ares_fpGetNetworkParams = (fpGetNetworkParams_t)
+ GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
+ if (!ares_fpGetNetworkParams)
+ {
+ FreeLibrary(hnd_iphlpapi);
+ return ARES_EADDRGETNETWORKPARAMS;
+ }
+
+ ares_fpGetAdaptersAddresses = (fpGetAdaptersAddresses_t)
+ GetProcAddress(hnd_iphlpapi, "GetAdaptersAddresses");
+ if (!ares_fpGetAdaptersAddresses)
+ {
+ /* This can happen on clients before WinXP, I don't
+ think it should be an error, unless we don't want to
+ support Windows 2000 anymore */
+ }
+
+ ares_fpGetBestRoute2 = (fpGetBestRoute2_t)
+ GetProcAddress(hnd_iphlpapi, "GetBestRoute2");
+ if (!ares_fpGetBestRoute2)
+ {
+ /* This can happen on clients before Vista, I don't
+ think it should be an error, unless we don't want to
+ support Windows XP anymore */
+ }
+
+ /*
+ * When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
+ * also known as RtlGenRandom, which is the case for Windows versions prior
+ * to WinXP then c-ares uses portable rand() function. Then don't error here.
+ */
+
+ hnd_advapi32 = 0;
+ hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
+ if (hnd_advapi32)
+ {
+ ares_fpSystemFunction036 = (fpSystemFunction036_t)
+ GetProcAddress(hnd_advapi32, "SystemFunction036");
+ }
+
+#endif
+ return ARES_SUCCESS;
+}
+
+
+static void ares_win32_cleanup(void)
+{
+#ifdef USE_WINSOCK
+ if (hnd_advapi32)
+ FreeLibrary(hnd_advapi32);
+ if (hnd_iphlpapi)
+ FreeLibrary(hnd_iphlpapi);
+#endif
+}
+
+
+int ares_library_init(int flags)
+{
+ int res;
+
+ if (ares_initialized)
+ {
+ ares_initialized++;
+ return ARES_SUCCESS;
+ }
+ ares_initialized++;
+
+ if (flags & ARES_LIB_INIT_WIN32)
+ {
+ res = ares_win32_init();
+ if (res != ARES_SUCCESS)
+ return res; /* LCOV_EXCL_LINE: can't test Win32 init failure */
+ }
+
+ ares_init_flags = flags;
+
+ return ARES_SUCCESS;
+}
+
+int ares_library_init_mem(int flags,
+ void *(*amalloc)(size_t size),
+ void (*afree)(void *ptr),
+ void *(*arealloc)(void *ptr, size_t size))
+{
+ if (amalloc)
+ ares_malloc = amalloc;
+ if (arealloc)
+ ares_realloc = arealloc;
+ if (afree)
+ ares_free = afree;
+ return ares_library_init(flags);
+}
+
+
+void ares_library_cleanup(void)
+{
+ if (!ares_initialized)
+ return;
+ ares_initialized--;
+ if (ares_initialized)
+ return;
+
+ if (ares_init_flags & ARES_LIB_INIT_WIN32)
+ ares_win32_cleanup();
+
+#if defined(ANDROID) || defined(__ANDROID__)
+ ares_library_cleanup_android();
+#endif
+
+ ares_init_flags = ARES_LIB_INIT_NONE;
+ ares_malloc = malloc;
+ ares_realloc = realloc;
+ ares_free = free;
+}
+
+
+int ares_library_initialized(void)
+{
+#ifdef USE_WINSOCK
+ if (!ares_initialized)
+ return ARES_ENOTINITIALIZED;
+#endif
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_library_init.h b/grpc/third_party/cares/cares/src/lib/ares_library_init.h
new file mode 100644
index 00000000..b3896d9f
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_library_init.h
@@ -0,0 +1,43 @@
+#ifndef HEADER_CARES_LIBRARY_INIT_H
+#define HEADER_CARES_LIBRARY_INIT_H
+
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004-2011 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef USE_WINSOCK
+
+#include <iphlpapi.h>
+#include "ares_iphlpapi.h"
+
+typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
+typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
+typedef ULONG (WINAPI *fpGetAdaptersAddresses_t) ( ULONG, ULONG, void*, IP_ADAPTER_ADDRESSES*, ULONG* );
+typedef NETIO_STATUS (WINAPI *fpGetBestRoute2_t) ( NET_LUID *, NET_IFINDEX, const SOCKADDR_INET *, const SOCKADDR_INET *, ULONG, PMIB_IPFORWARD_ROW2, SOCKADDR_INET * );
+/* Forward-declaration of variables defined in ares_library_init.c */
+/* that are global and unique instances for whole c-ares library. */
+
+extern fpGetNetworkParams_t ares_fpGetNetworkParams;
+extern fpSystemFunction036_t ares_fpSystemFunction036;
+extern fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses;
+extern fpGetBestRoute2_t ares_fpGetBestRoute2;
+
+#endif /* USE_WINSOCK */
+
+#endif /* HEADER_CARES_LIBRARY_INIT_H */
+
diff --git a/grpc/third_party/cares/cares/ares_llist.c b/grpc/third_party/cares/cares/src/lib/ares_llist.c
index 36ca84c4..36ca84c4 100644
--- a/grpc/third_party/cares/cares/ares_llist.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_llist.c
diff --git a/grpc/third_party/cares/cares/ares_llist.h b/grpc/third_party/cares/cares/src/lib/ares_llist.h
index 20f4d1ce..20f4d1ce 100644
--- a/grpc/third_party/cares/cares/ares_llist.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_llist.h
diff --git a/grpc/third_party/cares/cares/ares_mkquery.c b/grpc/third_party/cares/cares/src/lib/ares_mkquery.c
index 5aea914b..5aea914b 100644
--- a/grpc/third_party/cares/cares/ares_mkquery.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_mkquery.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_nameser.h b/grpc/third_party/cares/cares/src/lib/ares_nameser.h
new file mode 100644
index 00000000..5270e5a3
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_nameser.h
@@ -0,0 +1,482 @@
+
+#ifndef ARES_NAMESER_H
+#define ARES_NAMESER_H
+
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+# include <arpa/nameser_compat.h>
+#endif
+
+/* ============================================================================
+ * arpa/nameser.h may or may not provide ALL of the below defines, so check
+ * each one individually and set if not
+ * ============================================================================
+ */
+
+#ifndef NS_PACKETSZ
+# define NS_PACKETSZ 512 /* maximum packet size */
+#endif
+
+#ifndef NS_MAXDNAME
+# define NS_MAXDNAME 256 /* maximum domain name */
+#endif
+
+#ifndef NS_MAXCDNAME
+# define NS_MAXCDNAME 255 /* maximum compressed domain name */
+#endif
+
+#ifndef NS_MAXLABEL
+# define NS_MAXLABEL 63
+#endif
+
+#ifndef NS_HFIXEDSZ
+# define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
+#endif
+
+#ifndef NS_QFIXEDSZ
+# define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
+#endif
+
+#ifndef NS_RRFIXEDSZ
+# define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
+#endif
+
+#ifndef NS_INT16SZ
+# define NS_INT16SZ 2
+#endif
+
+#ifndef NS_INADDRSZ
+# define NS_INADDRSZ 4
+#endif
+
+#ifndef NS_IN6ADDRSZ
+# define NS_IN6ADDRSZ 16
+#endif
+
+#ifndef NS_CMPRSFLGS
+# define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
+#endif
+
+#ifndef NS_DEFAULTPORT
+# define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
+#endif
+
+/* ============================================================================
+ * arpa/nameser.h should provide these enumerations always, so if not found,
+ * provide them
+ * ============================================================================
+ */
+#ifndef HAVE_ARPA_NAMESER_H
+
+typedef enum __ns_class {
+ ns_c_invalid = 0, /* Cookie. */
+ ns_c_in = 1, /* Internet. */
+ ns_c_2 = 2, /* unallocated/unsupported. */
+ ns_c_chaos = 3, /* MIT Chaos-net. */
+ ns_c_hs = 4, /* MIT Hesiod. */
+ /* Query class values which do not appear in resource records */
+ ns_c_none = 254, /* for prereq. sections in update requests */
+ ns_c_any = 255, /* Wildcard match. */
+ ns_c_max = 65536
+} ns_class;
+
+typedef enum __ns_type {
+ ns_t_invalid = 0, /* Cookie. */
+ ns_t_a = 1, /* Host address. */
+ ns_t_ns = 2, /* Authoritative server. */
+ ns_t_md = 3, /* Mail destination. */
+ ns_t_mf = 4, /* Mail forwarder. */
+ ns_t_cname = 5, /* Canonical name. */
+ ns_t_soa = 6, /* Start of authority zone. */
+ ns_t_mb = 7, /* Mailbox domain name. */
+ ns_t_mg = 8, /* Mail group member. */
+ ns_t_mr = 9, /* Mail rename name. */
+ ns_t_null = 10, /* Null resource record. */
+ ns_t_wks = 11, /* Well known service. */
+ ns_t_ptr = 12, /* Domain name pointer. */
+ ns_t_hinfo = 13, /* Host information. */
+ ns_t_minfo = 14, /* Mailbox information. */
+ ns_t_mx = 15, /* Mail routing information. */
+ ns_t_txt = 16, /* Text strings. */
+ ns_t_rp = 17, /* Responsible person. */
+ ns_t_afsdb = 18, /* AFS cell database. */
+ ns_t_x25 = 19, /* X_25 calling address. */
+ ns_t_isdn = 20, /* ISDN calling address. */
+ ns_t_rt = 21, /* Router. */
+ ns_t_nsap = 22, /* NSAP address. */
+ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
+ ns_t_sig = 24, /* Security signature. */
+ ns_t_key = 25, /* Security key. */
+ ns_t_px = 26, /* X.400 mail mapping. */
+ ns_t_gpos = 27, /* Geographical position (withdrawn). */
+ ns_t_aaaa = 28, /* Ip6 Address. */
+ ns_t_loc = 29, /* Location Information. */
+ ns_t_nxt = 30, /* Next domain (security). */
+ ns_t_eid = 31, /* Endpoint identifier. */
+ ns_t_nimloc = 32, /* Nimrod Locator. */
+ ns_t_srv = 33, /* Server Selection. */
+ ns_t_atma = 34, /* ATM Address */
+ ns_t_naptr = 35, /* Naming Authority PoinTeR */
+ ns_t_kx = 36, /* Key Exchange */
+ ns_t_cert = 37, /* Certification record */
+ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
+ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
+ ns_t_sink = 40, /* Kitchen sink (experimentatl) */
+ ns_t_opt = 41, /* EDNS0 option (meta-RR) */
+ ns_t_apl = 42, /* Address prefix list (RFC3123) */
+ ns_t_ds = 43, /* Delegation Signer (RFC4034) */
+ ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */
+ ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */
+ ns_t_nsec = 47, /* Next Secure (RFC4034) */
+ ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */
+ ns_t_tkey = 249, /* Transaction key */
+ ns_t_tsig = 250, /* Transaction signature. */
+ ns_t_ixfr = 251, /* Incremental zone transfer. */
+ ns_t_axfr = 252, /* Transfer zone of authority. */
+ ns_t_mailb = 253, /* Transfer mailbox records. */
+ ns_t_maila = 254, /* Transfer mail agent records. */
+ ns_t_any = 255, /* Wildcard match. */
+ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
+ ns_t_caa = 257, /* Certification Authority Authorization. */
+ ns_t_max = 65536
+} ns_type;
+
+typedef enum __ns_opcode {
+ ns_o_query = 0, /* Standard query. */
+ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
+ ns_o_status = 2, /* Name server status query (unsupported). */
+ /* Opcode 3 is undefined/reserved. */
+ ns_o_notify = 4, /* Zone change notification. */
+ ns_o_update = 5, /* Zone update message. */
+ ns_o_max = 6
+} ns_opcode;
+
+typedef enum __ns_rcode {
+ ns_r_noerror = 0, /* No error occurred. */
+ ns_r_formerr = 1, /* Format error. */
+ ns_r_servfail = 2, /* Server failure. */
+ ns_r_nxdomain = 3, /* Name error. */
+ ns_r_notimpl = 4, /* Unimplemented. */
+ ns_r_refused = 5, /* Operation refused. */
+ /* these are for BIND_UPDATE */
+ ns_r_yxdomain = 6, /* Name exists */
+ ns_r_yxrrset = 7, /* RRset exists */
+ ns_r_nxrrset = 8, /* RRset does not exist */
+ ns_r_notauth = 9, /* Not authoritative for zone */
+ ns_r_notzone = 10, /* Zone of record different from zone section */
+ ns_r_max = 11,
+ /* The following are TSIG extended errors */
+ ns_r_badsig = 16,
+ ns_r_badkey = 17,
+ ns_r_badtime = 18
+} ns_rcode;
+
+#endif /* HAVE_ARPA_NAMESER_H */
+
+
+/* ============================================================================
+ * arpa/nameser_compat.h typically sets these. However on some systems
+ * arpa/nameser.h does, but may not set all of them. Lets conditionally
+ * define each
+ * ============================================================================
+ */
+
+#ifndef PACKETSZ
+# define PACKETSZ NS_PACKETSZ
+#endif
+
+#ifndef MAXDNAME
+# define MAXDNAME NS_MAXDNAME
+#endif
+
+#ifndef MAXCDNAME
+# define MAXCDNAME NS_MAXCDNAME
+#endif
+
+#ifndef MAXLABEL
+# define MAXLABEL NS_MAXLABEL
+#endif
+
+#ifndef HFIXEDSZ
+# define HFIXEDSZ NS_HFIXEDSZ
+#endif
+
+#ifndef QFIXEDSZ
+# define QFIXEDSZ NS_QFIXEDSZ
+#endif
+
+#ifndef RRFIXEDSZ
+# define RRFIXEDSZ NS_RRFIXEDSZ
+#endif
+
+#ifndef INDIR_MASK
+# define INDIR_MASK NS_CMPRSFLGS
+#endif
+
+#ifndef NAMESERVER_PORT
+# define NAMESERVER_PORT NS_DEFAULTPORT
+#endif
+
+
+/* opcodes */
+#ifndef O_QUERY
+# define O_QUERY 0 /* ns_o_query */
+#endif
+#ifndef O_IQUERY
+# define O_IQUERY 1 /* ns_o_iquery */
+#endif
+#ifndef O_STATUS
+# define O_STATUS 2 /* ns_o_status */
+#endif
+#ifndef O_NOTIFY
+# define O_NOTIFY 4 /* ns_o_notify */
+#endif
+#ifndef O_UPDATE
+# define O_UPDATE 5 /* ns_o_update */
+#endif
+
+
+/* response codes */
+#ifndef SERVFAIL
+# define SERVFAIL ns_r_servfail
+#endif
+#ifndef NOTIMP
+# define NOTIMP ns_r_notimpl
+#endif
+#ifndef REFUSED
+# define REFUSED ns_r_refused
+#endif
+#if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR)
+# undef NOERROR /* it seems this is already defined in winerror.h */
+#endif
+#ifndef NOERROR
+# define NOERROR ns_r_noerror
+#endif
+#ifndef FORMERR
+# define FORMERR ns_r_formerr
+#endif
+#ifndef NXDOMAIN
+# define NXDOMAIN ns_r_nxdomain
+#endif
+/* Non-standard response codes, use numeric values */
+#ifndef YXDOMAIN
+# define YXDOMAIN 6 /* ns_r_yxdomain */
+#endif
+#ifndef YXRRSET
+# define YXRRSET 7 /* ns_r_yxrrset */
+#endif
+#ifndef NXRRSET
+# define NXRRSET 8 /* ns_r_nxrrset */
+#endif
+#ifndef NOTAUTH
+# define NOTAUTH 9 /* ns_r_notauth */
+#endif
+#ifndef NOTZONE
+# define NOTZONE 10 /* ns_r_notzone */
+#endif
+#ifndef TSIG_BADSIG
+# define TSIG_BADSIG 16 /* ns_r_badsig */
+#endif
+#ifndef TSIG_BADKEY
+# define TSIG_BADKEY 17 /* ns_r_badkey */
+#endif
+#ifndef TSIG_BADTIME
+# define TSIG_BADTIME 18 /* ns_r_badtime */
+#endif
+
+
+/* classes */
+#ifndef C_IN
+# define C_IN 1 /* ns_c_in */
+#endif
+#ifndef C_CHAOS
+# define C_CHAOS 3 /* ns_c_chaos */
+#endif
+#ifndef C_HS
+# define C_HS 4 /* ns_c_hs */
+#endif
+#ifndef C_NONE
+# define C_NONE 254 /* ns_c_none */
+#endif
+#ifndef C_ANY
+# define C_ANY 255 /* ns_c_any */
+#endif
+
+
+/* types */
+#ifndef T_A
+# define T_A 1 /* ns_t_a */
+#endif
+#ifndef T_NS
+# define T_NS 2 /* ns_t_ns */
+#endif
+#ifndef T_MD
+# define T_MD 3 /* ns_t_md */
+#endif
+#ifndef T_MF
+# define T_MF 4 /* ns_t_mf */
+#endif
+#ifndef T_CNAME
+# define T_CNAME 5 /* ns_t_cname */
+#endif
+#ifndef T_SOA
+# define T_SOA 6 /* ns_t_soa */
+#endif
+#ifndef T_MB
+# define T_MB 7 /* ns_t_mb */
+#endif
+#ifndef T_MG
+# define T_MG 8 /* ns_t_mg */
+#endif
+#ifndef T_MR
+# define T_MR 9 /* ns_t_mr */
+#endif
+#ifndef T_NULL
+# define T_NULL 10 /* ns_t_null */
+#endif
+#ifndef T_WKS
+# define T_WKS 11 /* ns_t_wks */
+#endif
+#ifndef T_PTR
+# define T_PTR 12 /* ns_t_ptr */
+#endif
+#ifndef T_HINFO
+# define T_HINFO 13 /* ns_t_hinfo */
+#endif
+#ifndef T_MINFO
+# define T_MINFO 14 /* ns_t_minfo */
+#endif
+#ifndef T_MX
+# define T_MX 15 /* ns_t_mx */
+#endif
+#ifndef T_TXT
+# define T_TXT 16 /* ns_t_txt */
+#endif
+#ifndef T_RP
+# define T_RP 17 /* ns_t_rp */
+#endif
+#ifndef T_AFSDB
+# define T_AFSDB 18 /* ns_t_afsdb */
+#endif
+#ifndef T_X25
+# define T_X25 19 /* ns_t_x25 */
+#endif
+#ifndef T_ISDN
+# define T_ISDN 20 /* ns_t_isdn */
+#endif
+#ifndef T_RT
+# define T_RT 21 /* ns_t_rt */
+#endif
+#ifndef T_NSAP
+# define T_NSAP 22 /* ns_t_nsap */
+#endif
+#ifndef T_NSAP_PTR
+# define T_NSAP_PTR 23 /* ns_t_nsap_ptr */
+#endif
+#ifndef T_SIG
+# define T_SIG 24 /* ns_t_sig */
+#endif
+#ifndef T_KEY
+# define T_KEY 25 /* ns_t_key */
+#endif
+#ifndef T_PX
+# define T_PX 26 /* ns_t_px */
+#endif
+#ifndef T_GPOS
+# define T_GPOS 27 /* ns_t_gpos */
+#endif
+#ifndef T_AAAA
+# define T_AAAA 28 /* ns_t_aaaa */
+#endif
+#ifndef T_LOC
+# define T_LOC 29 /* ns_t_loc */
+#endif
+#ifndef T_NXT
+# define T_NXT 30 /* ns_t_nxt */
+#endif
+#ifndef T_EID
+# define T_EID 31 /* ns_t_eid */
+#endif
+#ifndef T_NIMLOC
+# define T_NIMLOC 32 /* ns_t_nimloc */
+#endif
+#ifndef T_SRV
+# define T_SRV 33 /* ns_t_srv */
+#endif
+#ifndef T_ATMA
+# define T_ATMA 34 /* ns_t_atma */
+#endif
+#ifndef T_NAPTR
+# define T_NAPTR 35 /* ns_t_naptr */
+#endif
+#ifndef T_KX
+# define T_KX 36 /* ns_t_kx */
+#endif
+#ifndef T_CERT
+# define T_CERT 37 /* ns_t_cert */
+#endif
+#ifndef T_A6
+# define T_A6 38 /* ns_t_a6 */
+#endif
+#ifndef T_DNAME
+# define T_DNAME 39 /* ns_t_dname */
+#endif
+#ifndef T_SINK
+# define T_SINK 40 /* ns_t_sink */
+#endif
+#ifndef T_OPT
+# define T_OPT 41 /* ns_t_opt */
+#endif
+#ifndef T_APL
+# define T_APL 42 /* ns_t_apl */
+#endif
+#ifndef T_DS
+# define T_DS 43 /* ns_t_ds */
+#endif
+#ifndef T_SSHFP
+# define T_SSHFP 44 /* ns_t_sshfp */
+#endif
+#ifndef T_RRSIG
+# define T_RRSIG 46 /* ns_t_rrsig */
+#endif
+#ifndef T_NSEC
+# define T_NSEC 47 /* ns_t_nsec */
+#endif
+#ifndef T_DNSKEY
+# define T_DNSKEY 48 /* ns_t_dnskey */
+#endif
+#ifndef T_TKEY
+# define T_TKEY 249 /* ns_t_tkey */
+#endif
+#ifndef T_TSIG
+# define T_TSIG 250 /* ns_t_tsig */
+#endif
+#ifndef T_IXFR
+# define T_IXFR 251 /* ns_t_ixfr */
+#endif
+#ifndef T_AXFR
+# define T_AXFR 252 /* ns_t_axfr */
+#endif
+#ifndef T_MAILB
+# define T_MAILB 253 /* ns_t_mailb */
+#endif
+#ifndef T_MAILA
+# define T_MAILA 254 /* ns_t_maila */
+#endif
+#ifndef T_ANY
+# define T_ANY 255 /* ns_t_any */
+#endif
+#ifndef T_ZXFR
+# define T_ZXFR 256 /* ns_t_zxfr */
+#endif
+#ifndef T_CAA
+# define T_CAA 257 /* ns_t_caa */
+#endif
+#ifndef T_MAX
+# define T_MAX 65536 /* ns_t_max */
+#endif
+
+
+#endif /* ARES_NAMESER_H */
diff --git a/grpc/third_party/cares/cares/ares_nowarn.c b/grpc/third_party/cares/cares/src/lib/ares_nowarn.c
index f63d9135..f63d9135 100644
--- a/grpc/third_party/cares/cares/ares_nowarn.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_nowarn.c
diff --git a/grpc/third_party/cares/cares/ares_nowarn.h b/grpc/third_party/cares/cares/src/lib/ares_nowarn.h
index 505e6220..505e6220 100644
--- a/grpc/third_party/cares/cares/ares_nowarn.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_nowarn.h
diff --git a/grpc/third_party/cares/cares/ares_options.c b/grpc/third_party/cares/cares/src/lib/ares_options.c
index de49de46..de49de46 100644
--- a/grpc/third_party/cares/cares/ares_options.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_options.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_a_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_a_reply.c
new file mode 100644
index 00000000..b08ac876
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_a_reply.c
@@ -0,0 +1,209 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+int ares_parse_a_reply(const unsigned char *abuf, int alen,
+ struct hostent **host,
+ struct ares_addrttl *addrttls, int *naddrttls)
+{
+ struct ares_addrinfo ai;
+ struct ares_addrinfo_node *next;
+ struct ares_addrinfo_cname *next_cname;
+ char **aliases = NULL;
+ char *question_hostname = NULL;
+ struct hostent *hostent = NULL;
+ struct in_addr *addrs = NULL;
+ int naliases = 0, naddrs = 0, alias = 0, i;
+ int cname_ttl = INT_MAX;
+ int status;
+
+ memset(&ai, 0, sizeof(ai));
+
+ status = ares__parse_into_addrinfo2(abuf, alen, &question_hostname, &ai);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(question_hostname);
+
+ if (naddrttls)
+ {
+ *naddrttls = 0;
+ }
+
+ return status;
+ }
+
+ hostent = ares_malloc(sizeof(struct hostent));
+ if (!hostent)
+ {
+ goto enomem;
+ }
+
+ next = ai.nodes;
+ while (next)
+ {
+ if (next->ai_family == AF_INET)
+ {
+ ++naddrs;
+ }
+ next = next->ai_next;
+ }
+
+ next_cname = ai.cnames;
+ while (next_cname)
+ {
+ if(next_cname->alias)
+ ++naliases;
+ next_cname = next_cname->next;
+ }
+
+ aliases = ares_malloc((naliases + 1) * sizeof(char *));
+ if (!aliases)
+ {
+ goto enomem;
+ }
+
+ if (naliases)
+ {
+ next_cname = ai.cnames;
+ while (next_cname)
+ {
+ if(next_cname->alias)
+ aliases[alias++] = ares_strdup(next_cname->alias);
+ if(next_cname->ttl < cname_ttl)
+ cname_ttl = next_cname->ttl;
+ next_cname = next_cname->next;
+ }
+ }
+
+ aliases[alias] = NULL;
+
+ hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *));
+ if (!hostent->h_addr_list)
+ {
+ goto enomem;
+ }
+
+ for (i = 0; i < naddrs + 1; ++i)
+ {
+ hostent->h_addr_list[i] = NULL;
+ }
+
+ if (ai.cnames)
+ {
+ hostent->h_name = ares_strdup(ai.cnames->name);
+ ares_free(question_hostname);
+ }
+ else
+ {
+ hostent->h_name = question_hostname;
+ }
+
+ hostent->h_aliases = aliases;
+ hostent->h_addrtype = AF_INET;
+ hostent->h_length = sizeof(struct in_addr);
+
+ if (naddrs)
+ {
+ addrs = ares_malloc(naddrs * sizeof(struct in_addr));
+ if (!addrs)
+ {
+ goto enomem;
+ }
+
+ i = 0;
+ next = ai.nodes;
+ while (next)
+ {
+ if (next->ai_family == AF_INET)
+ {
+ hostent->h_addr_list[i] = (char *)&addrs[i];
+ memcpy(hostent->h_addr_list[i],
+ &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr),
+ sizeof(struct in_addr));
+ if (naddrttls && i < *naddrttls)
+ {
+ if (next->ai_ttl > cname_ttl)
+ addrttls[i].ttl = cname_ttl;
+ else
+ addrttls[i].ttl = next->ai_ttl;
+
+ memcpy(&addrttls[i].ipaddr,
+ &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr),
+ sizeof(struct in_addr));
+ }
+ ++i;
+ }
+ next = next->ai_next;
+ }
+ if (i == 0)
+ {
+ ares_free(addrs);
+ }
+ }
+
+ if (host)
+ {
+ *host = hostent;
+ }
+ else
+ {
+ ares_free_hostent(hostent);
+ }
+
+ if (naddrttls)
+ {
+ /* Truncated to at most *naddrttls entries */
+ *naddrttls = (naddrs > *naddrttls)?*naddrttls:naddrs;
+ }
+
+ ares__freeaddrinfo_cnames(ai.cnames);
+ ares__freeaddrinfo_nodes(ai.nodes);
+ return ARES_SUCCESS;
+
+enomem:
+ ares_free(aliases);
+ ares_free(hostent);
+ ares__freeaddrinfo_cnames(ai.cnames);
+ ares__freeaddrinfo_nodes(ai.nodes);
+ ares_free(question_hostname);
+ return ARES_ENOMEM;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c
new file mode 100644
index 00000000..6f4744a8
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c
@@ -0,0 +1,212 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright 2005 Dominick Meglio
+ * Copyright (C) 2019 by Andrew Selivanov
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#ifdef HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_inet_net_pton.h"
+#include "ares_private.h"
+
+int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
+ struct hostent **host, struct ares_addr6ttl *addrttls,
+ int *naddrttls)
+{
+ struct ares_addrinfo ai;
+ struct ares_addrinfo_node *next;
+ struct ares_addrinfo_cname *next_cname;
+ char **aliases = NULL;
+ char *question_hostname = NULL;
+ struct hostent *hostent = NULL;
+ struct ares_in6_addr *addrs = NULL;
+ int naliases = 0, naddrs = 0, alias = 0, i;
+ int cname_ttl = INT_MAX;
+ int status;
+
+ memset(&ai, 0, sizeof(ai));
+
+ status = ares__parse_into_addrinfo2(abuf, alen, &question_hostname, &ai);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(question_hostname);
+
+ if (naddrttls)
+ {
+ *naddrttls = 0;
+ }
+
+ return status;
+ }
+
+ hostent = ares_malloc(sizeof(struct hostent));
+ if (!hostent)
+ {
+ goto enomem;
+ }
+
+ next = ai.nodes;
+ while (next)
+ {
+ if(next->ai_family == AF_INET6)
+ {
+ ++naddrs;
+ }
+ next = next->ai_next;
+ }
+
+ next_cname = ai.cnames;
+ while (next_cname)
+ {
+ if(next_cname->alias)
+ ++naliases;
+ next_cname = next_cname->next;
+ }
+
+ aliases = ares_malloc((naliases + 1) * sizeof(char *));
+ if (!aliases)
+ {
+ goto enomem;
+ }
+
+ if (naliases)
+ {
+ next_cname = ai.cnames;
+ while (next_cname)
+ {
+ if(next_cname->alias)
+ aliases[alias++] = ares_strdup(next_cname->alias);
+ if(next_cname->ttl < cname_ttl)
+ cname_ttl = next_cname->ttl;
+ next_cname = next_cname->next;
+ }
+ }
+
+ aliases[alias] = NULL;
+
+ hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *));
+ if (!hostent->h_addr_list)
+ {
+ goto enomem;
+ }
+
+ for (i = 0; i < naddrs + 1; ++i)
+ {
+ hostent->h_addr_list[i] = NULL;
+ }
+
+ if (ai.cnames)
+ {
+ hostent->h_name = ares_strdup(ai.cnames->name);
+ ares_free(question_hostname);
+ }
+ else
+ {
+ hostent->h_name = question_hostname;
+ }
+
+ hostent->h_aliases = aliases;
+ hostent->h_addrtype = AF_INET6;
+ hostent->h_length = sizeof(struct ares_in6_addr);
+
+ if (naddrs)
+ {
+ addrs = ares_malloc(naddrs * sizeof(struct ares_in6_addr));
+ if (!addrs)
+ {
+ goto enomem;
+ }
+
+ i = 0;
+ next = ai.nodes;
+ while (next)
+ {
+ if(next->ai_family == AF_INET6)
+ {
+ hostent->h_addr_list[i] = (char*)&addrs[i];
+ memcpy(hostent->h_addr_list[i],
+ &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr),
+ sizeof(struct ares_in6_addr));
+ if (naddrttls && i < *naddrttls)
+ {
+ if(next->ai_ttl > cname_ttl)
+ addrttls[i].ttl = cname_ttl;
+ else
+ addrttls[i].ttl = next->ai_ttl;
+
+ memcpy(&addrttls[i].ip6addr,
+ &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr),
+ sizeof(struct ares_in6_addr));
+ }
+ ++i;
+ }
+ next = next->ai_next;
+ }
+
+ if (i == 0)
+ {
+ ares_free(addrs);
+ }
+ }
+
+ if (host)
+ {
+ *host = hostent;
+ }
+ else
+ {
+ ares_free_hostent(hostent);
+ }
+
+ if (naddrttls)
+ {
+ /* Truncated to at most *naddrttls entries */
+ *naddrttls = (naddrs > *naddrttls)?*naddrttls:naddrs;
+ }
+
+ ares__freeaddrinfo_cnames(ai.cnames);
+ ares__freeaddrinfo_nodes(ai.nodes);
+ return ARES_SUCCESS;
+
+enomem:
+ ares_free(aliases);
+ ares_free(hostent);
+ ares__freeaddrinfo_cnames(ai.cnames);
+ ares__freeaddrinfo_nodes(ai.nodes);
+ ares_free(question_hostname);
+ return ARES_ENOMEM;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_caa_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_caa_reply.c
new file mode 100644
index 00000000..f6d4d3c6
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_caa_reply.c
@@ -0,0 +1,199 @@
+
+/* Copyright 2020 by <danny.sonnenschein@platynum.ch>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+int
+ares_parse_caa_reply (const unsigned char *abuf, int alen,
+ struct ares_caa_reply **caa_out)
+{
+ unsigned int qdcount, ancount, i;
+ const unsigned char *aptr;
+ const unsigned char *strptr;
+ int status, rr_type, rr_class, rr_len;
+ long len;
+ char *hostname = NULL, *rr_name = NULL;
+ struct ares_caa_reply *caa_head = NULL;
+ struct ares_caa_reply *caa_last = NULL;
+ struct ares_caa_reply *caa_curr;
+
+ /* Set *caa_out to NULL for all failure cases. */
+ *caa_out = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT (abuf);
+ ancount = DNS_HEADER_ANCOUNT (abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_ENODATA;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
+ if (status != ARES_SUCCESS)
+ return status;
+
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free (hostname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE (aptr);
+ rr_class = DNS_RR_CLASS (aptr);
+ rr_len = DNS_RR_LEN (aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Check if we are really looking at a CAA record */
+ if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_CAA)
+ {
+ strptr = aptr;
+
+ /* Allocate storage for this CAA answer appending it to the list */
+ caa_curr = ares_malloc_data(ARES_DATATYPE_CAA_REPLY);
+ if (!caa_curr)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ if (caa_last)
+ {
+ caa_last->next = caa_curr;
+ }
+ else
+ {
+ caa_head = caa_curr;
+ }
+ caa_last = caa_curr;
+ if (rr_len < 2)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ caa_curr->critical = (int)*strptr++;
+ caa_curr->plength = (int)*strptr++;
+ if (caa_curr->plength <= 0 || (int)caa_curr->plength >= rr_len - 2)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ caa_curr->property = ares_malloc (caa_curr->plength + 1/* Including null byte */);
+ if (caa_curr->property == NULL)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ memcpy ((char *) caa_curr->property, strptr, caa_curr->plength);
+ /* Make sure we NULL-terminate */
+ caa_curr->property[caa_curr->plength] = 0;
+ strptr += caa_curr->plength;
+
+ caa_curr->length = rr_len - caa_curr->plength - 2;
+ if (caa_curr->length <= 0)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ caa_curr->value = ares_malloc (caa_curr->length + 1/* Including null byte */);
+ if (caa_curr->value == NULL)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ memcpy ((char *) caa_curr->value, strptr, caa_curr->length);
+ /* Make sure we NULL-terminate */
+ caa_curr->value[caa_curr->length] = 0;
+ }
+
+ /* Propagate any failures */
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+
+ /* Don't lose memory in the next iteration */
+ ares_free (rr_name);
+ rr_name = NULL;
+
+ /* Move on to the next record */
+ aptr += rr_len;
+ }
+
+ if (hostname)
+ ares_free (hostname);
+ if (rr_name)
+ ares_free (rr_name);
+
+ /* clean up on error */
+ if (status != ARES_SUCCESS)
+ {
+ if (caa_head)
+ ares_free_data (caa_head);
+ return status;
+ }
+
+ /* everything looks fine, return the data */
+ *caa_out = caa_head;
+
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_mx_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_mx_reply.c
new file mode 100644
index 00000000..a497f558
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_mx_reply.c
@@ -0,0 +1,164 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2010 Jeremy Lal <kapouer@melix.org>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+int
+ares_parse_mx_reply (const unsigned char *abuf, int alen,
+ struct ares_mx_reply **mx_out)
+{
+ unsigned int qdcount, ancount, i;
+ const unsigned char *aptr, *vptr;
+ int status, rr_type, rr_class, rr_len;
+ long len;
+ char *hostname = NULL, *rr_name = NULL;
+ struct ares_mx_reply *mx_head = NULL;
+ struct ares_mx_reply *mx_last = NULL;
+ struct ares_mx_reply *mx_curr;
+
+ /* Set *mx_out to NULL for all failure cases. */
+ *mx_out = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT (abuf);
+ ancount = DNS_HEADER_ANCOUNT (abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_ENODATA;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
+ if (status != ARES_SUCCESS)
+ return status;
+
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free (hostname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE (aptr);
+ rr_class = DNS_RR_CLASS (aptr);
+ rr_len = DNS_RR_LEN (aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Check if we are really looking at a MX record */
+ if (rr_class == C_IN && rr_type == T_MX)
+ {
+ /* parse the MX record itself */
+ if (rr_len < 2)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Allocate storage for this MX answer appending it to the list */
+ mx_curr = ares_malloc_data(ARES_DATATYPE_MX_REPLY);
+ if (!mx_curr)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ if (mx_last)
+ {
+ mx_last->next = mx_curr;
+ }
+ else
+ {
+ mx_head = mx_curr;
+ }
+ mx_last = mx_curr;
+
+ vptr = aptr;
+ mx_curr->priority = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+
+ status = ares_expand_name (vptr, abuf, alen, &mx_curr->host, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ }
+
+ /* Don't lose memory in the next iteration */
+ ares_free (rr_name);
+ rr_name = NULL;
+
+ /* Move on to the next record */
+ aptr += rr_len;
+ }
+
+ if (hostname)
+ ares_free (hostname);
+ if (rr_name)
+ ares_free (rr_name);
+
+ /* clean up on error */
+ if (status != ARES_SUCCESS)
+ {
+ if (mx_head)
+ ares_free_data (mx_head);
+ return status;
+ }
+
+ /* everything looks fine, return the data */
+ *mx_out = mx_head;
+
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c
new file mode 100644
index 00000000..dd984c0f
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c
@@ -0,0 +1,183 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+int
+ares_parse_naptr_reply (const unsigned char *abuf, int alen,
+ struct ares_naptr_reply **naptr_out)
+{
+ unsigned int qdcount, ancount, i;
+ const unsigned char *aptr, *vptr;
+ int status, rr_type, rr_class, rr_len;
+ long len;
+ char *hostname = NULL, *rr_name = NULL;
+ struct ares_naptr_reply *naptr_head = NULL;
+ struct ares_naptr_reply *naptr_last = NULL;
+ struct ares_naptr_reply *naptr_curr;
+
+ /* Set *naptr_out to NULL for all failure cases. */
+ *naptr_out = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT (abuf);
+ ancount = DNS_HEADER_ANCOUNT (abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_ENODATA;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
+ if (status != ARES_SUCCESS)
+ return status;
+
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free (hostname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE (aptr);
+ rr_class = DNS_RR_CLASS (aptr);
+ rr_len = DNS_RR_LEN (aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Check if we are really looking at a NAPTR record */
+ if (rr_class == C_IN && rr_type == T_NAPTR)
+ {
+ /* parse the NAPTR record itself */
+
+ /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
+ if (rr_len < 7)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Allocate storage for this NAPTR answer appending it to the list */
+ naptr_curr = ares_malloc_data(ARES_DATATYPE_NAPTR_REPLY);
+ if (!naptr_curr)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ if (naptr_last)
+ {
+ naptr_last->next = naptr_curr;
+ }
+ else
+ {
+ naptr_head = naptr_curr;
+ }
+ naptr_last = naptr_curr;
+
+ vptr = aptr;
+ naptr_curr->order = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+ naptr_curr->preference = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+
+ status = ares_expand_string(vptr, abuf, alen, &naptr_curr->flags, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ vptr += len;
+
+ status = ares_expand_string(vptr, abuf, alen, &naptr_curr->service, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ vptr += len;
+
+ status = ares_expand_string(vptr, abuf, alen, &naptr_curr->regexp, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ vptr += len;
+
+ status = ares_expand_name(vptr, abuf, alen, &naptr_curr->replacement, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ }
+
+ /* Don't lose memory in the next iteration */
+ ares_free (rr_name);
+ rr_name = NULL;
+
+ /* Move on to the next record */
+ aptr += rr_len;
+ }
+
+ if (hostname)
+ ares_free (hostname);
+ if (rr_name)
+ ares_free (rr_name);
+
+ /* clean up on error */
+ if (status != ARES_SUCCESS)
+ {
+ if (naptr_head)
+ ares_free_data (naptr_head);
+ return status;
+ }
+
+ /* everything looks fine, return the data */
+ *naptr_out = naptr_head;
+
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_ns_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_ns_reply.c
new file mode 100644
index 00000000..47d12994
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_ns_reply.c
@@ -0,0 +1,177 @@
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/*
+ * ares_parse_ns_reply created by Vlad Dinulescu <vlad.dinulescu@avira.com>
+ * on behalf of AVIRA Gmbh - http://www.avira.com
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+int ares_parse_ns_reply( const unsigned char* abuf, int alen,
+ struct hostent** host )
+{
+ unsigned int qdcount, ancount;
+ int status, i, rr_type, rr_class, rr_len;
+ int nameservers_num;
+ long len;
+ const unsigned char *aptr;
+ char* hostname, *rr_name, *rr_data, **nameservers;
+ struct hostent *hostent;
+
+ /* Set *host to NULL for all failure cases. */
+ *host = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if ( alen < HFIXEDSZ )
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT( abuf );
+ ancount = DNS_HEADER_ANCOUNT( abuf );
+ if ( qdcount != 1 )
+ return ARES_EBADRESP;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len, 0);
+ if ( status != ARES_SUCCESS )
+ return status;
+ if ( aptr + len + QFIXEDSZ > abuf + alen )
+ {
+ ares_free( hostname );
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Allocate nameservers array; ancount gives an upper bound */
+ nameservers = ares_malloc( ( ancount + 1 ) * sizeof( char * ) );
+ if ( !nameservers )
+ {
+ ares_free( hostname );
+ return ARES_ENOMEM;
+ }
+ nameservers_num = 0;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for ( i = 0; i < ( int ) ancount; i++ )
+ {
+ /* Decode the RR up to the data field. */
+ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len, 0);
+ if ( status != ARES_SUCCESS )
+ break;
+ aptr += len;
+ if ( aptr + RRFIXEDSZ > abuf + alen )
+ {
+ status = ARES_EBADRESP;
+ ares_free(rr_name);
+ break;
+ }
+ rr_type = DNS_RR_TYPE( aptr );
+ rr_class = DNS_RR_CLASS( aptr );
+ rr_len = DNS_RR_LEN( aptr );
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ ares_free(rr_name);
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ if ( rr_class == C_IN && rr_type == T_NS )
+ {
+ /* Decode the RR data and add it to the nameservers list */
+ status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
+ &len, 1);
+ if ( status != ARES_SUCCESS )
+ {
+ ares_free(rr_name);
+ break;
+ }
+
+ nameservers[nameservers_num] = ares_malloc(strlen(rr_data)+1);
+
+ if (nameservers[nameservers_num]==NULL)
+ {
+ ares_free(rr_name);
+ ares_free(rr_data);
+ status=ARES_ENOMEM;
+ break;
+ }
+ strcpy(nameservers[nameservers_num],rr_data);
+ ares_free(rr_data);
+
+ nameservers_num++;
+ }
+
+ ares_free( rr_name );
+
+ aptr += rr_len;
+ if ( aptr > abuf + alen )
+ { /* LCOV_EXCL_START: already checked above */
+ status = ARES_EBADRESP;
+ break;
+ } /* LCOV_EXCL_STOP */
+ }
+
+ if ( status == ARES_SUCCESS && nameservers_num == 0 )
+ {
+ status = ARES_ENODATA;
+ }
+ if ( status == ARES_SUCCESS )
+ {
+ /* We got our answer. Allocate memory to build the host entry. */
+ nameservers[nameservers_num] = NULL;
+ hostent = ares_malloc( sizeof( struct hostent ) );
+ if ( hostent )
+ {
+ hostent->h_addr_list = ares_malloc( 1 * sizeof( char * ) );
+ if ( hostent->h_addr_list )
+ {
+ /* Fill in the hostent and return successfully. */
+ hostent->h_name = hostname;
+ hostent->h_aliases = nameservers;
+ hostent->h_addrtype = AF_INET;
+ hostent->h_length = sizeof( struct in_addr );
+ hostent->h_addr_list[0] = NULL;
+ *host = hostent;
+ return ARES_SUCCESS;
+ }
+ ares_free( hostent );
+ }
+ status = ARES_ENOMEM;
+ }
+ for ( i = 0; i < nameservers_num; i++ )
+ ares_free( nameservers[i] );
+ ares_free( nameservers );
+ ares_free( hostname );
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c
new file mode 100644
index 00000000..ae78edf1
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c
@@ -0,0 +1,228 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
+ int addrlen, int family, struct hostent **host)
+{
+ unsigned int qdcount, ancount;
+ int status, i, rr_type, rr_class, rr_len;
+ long len;
+ const unsigned char *aptr;
+ char *ptrname, *hostname, *rr_name, *rr_data;
+ struct hostent *hostent = NULL;
+ int aliascnt = 0;
+ int alias_alloc = 8;
+ char ** aliases;
+ size_t rr_data_len;
+
+ /* Set *host to NULL for all failure cases. */
+ *host = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len, 0);
+ if (status != ARES_SUCCESS)
+ return status;
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free(ptrname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ hostname = NULL;
+ aliases = ares_malloc(alias_alloc * sizeof(char *));
+ if (!aliases)
+ {
+ ares_free(ptrname);
+ return ARES_ENOMEM;
+ }
+ for (i = 0; i < (int)ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len, 0);
+ if (status != ARES_SUCCESS)
+ break;
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ ares_free(rr_name);
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE(aptr);
+ rr_class = DNS_RR_CLASS(aptr);
+ rr_len = DNS_RR_LEN(aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ ares_free(rr_name);
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ if (rr_class == C_IN && rr_type == T_PTR
+ && strcasecmp(rr_name, ptrname) == 0)
+ {
+ /* Decode the RR data and set hostname to it. */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
+ &len, 1);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(rr_name);
+ break;
+ }
+ if (hostname)
+ ares_free(hostname);
+ hostname = rr_data;
+ rr_data_len = strlen(rr_data)+1;
+ aliases[aliascnt] = ares_malloc(rr_data_len * sizeof(char));
+ if (!aliases[aliascnt])
+ {
+ ares_free(rr_name);
+ status = ARES_ENOMEM;
+ break;
+ }
+ strncpy(aliases[aliascnt], rr_data, rr_data_len);
+ aliascnt++;
+ if (aliascnt >= alias_alloc) {
+ char **ptr;
+ alias_alloc *= 2;
+ ptr = ares_realloc(aliases, alias_alloc * sizeof(char *));
+ if(!ptr) {
+ ares_free(rr_name);
+ status = ARES_ENOMEM;
+ break;
+ }
+ aliases = ptr;
+ }
+ }
+
+ if (rr_class == C_IN && rr_type == T_CNAME)
+ {
+ /* Decode the RR data and replace ptrname with it. */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
+ &len, 1);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(rr_name);
+ break;
+ }
+ ares_free(ptrname);
+ ptrname = rr_data;
+ }
+
+ ares_free(rr_name);
+ aptr += rr_len;
+ if (aptr > abuf + alen)
+ { /* LCOV_EXCL_START: already checked above */
+ status = ARES_EBADRESP;
+ break;
+ } /* LCOV_EXCL_STOP */
+ }
+
+ if (status == ARES_SUCCESS && !hostname)
+ status = ARES_ENODATA;
+ if (status == ARES_SUCCESS)
+ {
+ /* If we don't reach the end, we must have failed due to out of memory */
+ status = ARES_ENOMEM;
+
+ /* We got our answer. Allocate memory to build the host entry. */
+ hostent = ares_malloc(sizeof(*hostent));
+ if (!hostent)
+ goto fail;
+
+ /* If we don't memset here, cleanups may fail */
+ memset(hostent, 0, sizeof(*hostent));
+
+ hostent->h_addr_list = ares_malloc(2 * sizeof(char *));
+ if (!hostent->h_addr_list)
+ goto fail;
+
+
+ if (addr && addrlen) {
+ hostent->h_addr_list[0] = ares_malloc(addrlen);
+ if (!hostent->h_addr_list[0])
+ goto fail;
+ } else {
+ hostent->h_addr_list[0] = NULL;
+ }
+
+ hostent->h_aliases = ares_malloc((aliascnt+1) * sizeof (char *));
+ if (!hostent->h_aliases)
+ goto fail;
+
+ /* Fill in the hostent and return successfully. */
+ hostent->h_name = hostname;
+ for (i=0 ; i<aliascnt ; i++)
+ hostent->h_aliases[i] = aliases[i];
+ hostent->h_aliases[aliascnt] = NULL;
+ hostent->h_addrtype = aresx_sitoss(family);
+ hostent->h_length = aresx_sitoss(addrlen);
+ if (addr && addrlen)
+ memcpy(hostent->h_addr_list[0], addr, addrlen);
+ hostent->h_addr_list[1] = NULL;
+ *host = hostent;
+ ares_free(aliases);
+ ares_free(ptrname);
+
+ return ARES_SUCCESS;
+ }
+
+fail:
+ ares_free_hostent(hostent);
+
+ for (i=0 ; i<aliascnt ; i++)
+ if (aliases[i])
+ ares_free(aliases[i]);
+ ares_free(aliases);
+ if (hostname)
+ ares_free(hostname);
+ ares_free(ptrname);
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_soa_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_soa_reply.c
new file mode 100644
index 00000000..3935eec9
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_soa_reply.c
@@ -0,0 +1,179 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2012 Marko Kreen <markokr@gmail.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+int
+ares_parse_soa_reply(const unsigned char *abuf, int alen,
+ struct ares_soa_reply **soa_out)
+{
+ const unsigned char *aptr;
+ long len;
+ char *qname = NULL, *rr_name = NULL;
+ struct ares_soa_reply *soa = NULL;
+ int qdcount, ancount, qclass;
+ int status, i, rr_type, rr_class, rr_len;
+
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* parse message header */
+ qdcount = DNS_HEADER_QDCOUNT(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_EBADRESP;
+
+ aptr = abuf + HFIXEDSZ;
+
+ /* query name */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len, 0);
+ if (status != ARES_SUCCESS)
+ goto failed_stat;
+
+ if (alen <= len + HFIXEDSZ + 1)
+ goto failed;
+ aptr += len;
+
+ qclass = DNS_QUESTION_TYPE(aptr);
+
+ /* skip qtype & qclass */
+ if (aptr + QFIXEDSZ > abuf + alen)
+ goto failed;
+ aptr += QFIXEDSZ;
+
+ /* qclass of SOA with multiple answers */
+ if (qclass == T_SOA && ancount > 1)
+ goto failed;
+
+ /* examine all the records, break and return if found soa */
+ for (i = 0; i < ancount; i++)
+ {
+ rr_name = NULL;
+ status = ares__expand_name_for_response (aptr, abuf, alen, &rr_name, &len, 0);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(rr_name);
+ goto failed_stat;
+ }
+
+ aptr += len;
+ if ( aptr + RRFIXEDSZ > abuf + alen )
+ {
+ ares_free(rr_name);
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ }
+ rr_type = DNS_RR_TYPE( aptr );
+ rr_class = DNS_RR_CLASS( aptr );
+ rr_len = DNS_RR_LEN( aptr );
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ ares_free(rr_name);
+ status = ARES_EBADRESP;
+ goto failed_stat;
+ }
+ if ( rr_class == C_IN && rr_type == T_SOA )
+ {
+ /* allocate result struct */
+ soa = ares_malloc_data(ARES_DATATYPE_SOA_REPLY);
+ if (!soa)
+ {
+ ares_free(rr_name);
+ status = ARES_ENOMEM;
+ goto failed_stat;
+ }
+
+ /* nsname */
+ status = ares__expand_name_for_response(aptr, abuf, alen, &soa->nsname,
+ &len, 0);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(rr_name);
+ goto failed_stat;
+ }
+ aptr += len;
+
+ /* hostmaster */
+ status = ares__expand_name_for_response(aptr, abuf, alen,
+ &soa->hostmaster, &len, 0);
+ if (status != ARES_SUCCESS)
+ {
+ ares_free(rr_name);
+ goto failed_stat;
+ }
+ aptr += len;
+
+ /* integer fields */
+ if (aptr + 5 * 4 > abuf + alen)
+ {
+ ares_free(rr_name);
+ goto failed;
+ }
+ soa->serial = DNS__32BIT(aptr + 0 * 4);
+ soa->refresh = DNS__32BIT(aptr + 1 * 4);
+ soa->retry = DNS__32BIT(aptr + 2 * 4);
+ soa->expire = DNS__32BIT(aptr + 3 * 4);
+ soa->minttl = DNS__32BIT(aptr + 4 * 4);
+
+ ares_free(qname);
+ ares_free(rr_name);
+
+ *soa_out = soa;
+
+ return ARES_SUCCESS;
+ }
+ aptr += rr_len;
+
+ ares_free(rr_name);
+
+ if (aptr > abuf + alen)
+ goto failed_stat;
+ }
+ /* no SOA record found */
+ status = ARES_EBADRESP;
+ goto failed_stat;
+failed:
+ status = ARES_EBADRESP;
+
+failed_stat:
+ if (soa)
+ ares_free_data(soa);
+ if (qname)
+ ares_free(qname);
+ return status;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_srv_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_srv_reply.c
new file mode 100644
index 00000000..0d8f4d20
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_srv_reply.c
@@ -0,0 +1,168 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+int
+ares_parse_srv_reply (const unsigned char *abuf, int alen,
+ struct ares_srv_reply **srv_out)
+{
+ unsigned int qdcount, ancount, i;
+ const unsigned char *aptr, *vptr;
+ int status, rr_type, rr_class, rr_len;
+ long len;
+ char *hostname = NULL, *rr_name = NULL;
+ struct ares_srv_reply *srv_head = NULL;
+ struct ares_srv_reply *srv_last = NULL;
+ struct ares_srv_reply *srv_curr;
+
+ /* Set *srv_out to NULL for all failure cases. */
+ *srv_out = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT (abuf);
+ ancount = DNS_HEADER_ANCOUNT (abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_ENODATA;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
+ if (status != ARES_SUCCESS)
+ return status;
+
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free (hostname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE (aptr);
+ rr_class = DNS_RR_CLASS (aptr);
+ rr_len = DNS_RR_LEN (aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Check if we are really looking at a SRV record */
+ if (rr_class == C_IN && rr_type == T_SRV)
+ {
+ /* parse the SRV record itself */
+ if (rr_len < 6)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Allocate storage for this SRV answer appending it to the list */
+ srv_curr = ares_malloc_data(ARES_DATATYPE_SRV_REPLY);
+ if (!srv_curr)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ if (srv_last)
+ {
+ srv_last->next = srv_curr;
+ }
+ else
+ {
+ srv_head = srv_curr;
+ }
+ srv_last = srv_curr;
+
+ vptr = aptr;
+ srv_curr->priority = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+ srv_curr->weight = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+ srv_curr->port = DNS__16BIT(vptr);
+ vptr += sizeof(unsigned short);
+
+ status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len);
+ if (status != ARES_SUCCESS)
+ break;
+ }
+
+ /* Don't lose memory in the next iteration */
+ ares_free (rr_name);
+ rr_name = NULL;
+
+ /* Move on to the next record */
+ aptr += rr_len;
+ }
+
+ if (hostname)
+ ares_free (hostname);
+ if (rr_name)
+ ares_free (rr_name);
+
+ /* clean up on error */
+ if (status != ARES_SUCCESS)
+ {
+ if (srv_head)
+ ares_free_data (srv_head);
+ return status;
+ }
+
+ /* everything looks fine, return the data */
+ *srv_out = srv_head;
+
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_parse_txt_reply.c b/grpc/third_party/cares/cares/src/lib/ares_parse_txt_reply.c
new file mode 100644
index 00000000..6848a092
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_parse_txt_reply.c
@@ -0,0 +1,214 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_data.h"
+#include "ares_private.h"
+
+static int
+ares__parse_txt_reply (const unsigned char *abuf, int alen,
+ int ex, void **txt_out)
+{
+ size_t substr_len;
+ unsigned int qdcount, ancount, i;
+ const unsigned char *aptr;
+ const unsigned char *strptr;
+ int status, rr_type, rr_class, rr_len;
+ long len;
+ char *hostname = NULL, *rr_name = NULL;
+ struct ares_txt_ext *txt_head = NULL;
+ struct ares_txt_ext *txt_last = NULL;
+ struct ares_txt_ext *txt_curr;
+
+ /* Set *txt_out to NULL for all failure cases. */
+ *txt_out = NULL;
+
+ /* Give up if abuf doesn't have room for a header. */
+ if (alen < HFIXEDSZ)
+ return ARES_EBADRESP;
+
+ /* Fetch the question and answer count from the header. */
+ qdcount = DNS_HEADER_QDCOUNT (abuf);
+ ancount = DNS_HEADER_ANCOUNT (abuf);
+ if (qdcount != 1)
+ return ARES_EBADRESP;
+ if (ancount == 0)
+ return ARES_ENODATA;
+
+ /* Expand the name from the question, and skip past the question. */
+ aptr = abuf + HFIXEDSZ;
+ status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
+ if (status != ARES_SUCCESS)
+ return status;
+
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ {
+ ares_free (hostname);
+ return ARES_EBADRESP;
+ }
+ aptr += len + QFIXEDSZ;
+
+ /* Examine each answer resource record (RR) in turn. */
+ for (i = 0; i < ancount; i++)
+ {
+ /* Decode the RR up to the data field. */
+ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+ aptr += len;
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+ rr_type = DNS_RR_TYPE (aptr);
+ rr_class = DNS_RR_CLASS (aptr);
+ rr_len = DNS_RR_LEN (aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + rr_len > abuf + alen)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Check if we are really looking at a TXT record */
+ if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_TXT)
+ {
+ /*
+ * There may be multiple substrings in a single TXT record. Each
+ * substring may be up to 255 characters in length, with a
+ * "length byte" indicating the size of the substring payload.
+ * RDATA contains both the length-bytes and payloads of all
+ * substrings contained therein.
+ */
+
+ strptr = aptr;
+ while (strptr < (aptr + rr_len))
+ {
+ substr_len = (unsigned char)*strptr;
+ if (strptr + substr_len + 1 > aptr + rr_len)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
+ /* Allocate storage for this TXT answer appending it to the list */
+ txt_curr = ares_malloc_data(ex ? ARES_DATATYPE_TXT_EXT :
+ ARES_DATATYPE_TXT_REPLY);
+ if (!txt_curr)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+ if (txt_last)
+ {
+ txt_last->next = txt_curr;
+ }
+ else
+ {
+ txt_head = txt_curr;
+ }
+ txt_last = txt_curr;
+
+ if (ex)
+ txt_curr->record_start = (strptr == aptr);
+ txt_curr->length = substr_len;
+ txt_curr->txt = ares_malloc (substr_len + 1/* Including null byte */);
+ if (txt_curr->txt == NULL)
+ {
+ status = ARES_ENOMEM;
+ break;
+ }
+
+ ++strptr;
+ memcpy ((char *) txt_curr->txt, strptr, substr_len);
+
+ /* Make sure we NULL-terminate */
+ txt_curr->txt[substr_len] = 0;
+
+ strptr += substr_len;
+ }
+ }
+
+ /* Propagate any failures */
+ if (status != ARES_SUCCESS)
+ {
+ break;
+ }
+
+ /* Don't lose memory in the next iteration */
+ ares_free (rr_name);
+ rr_name = NULL;
+
+ /* Move on to the next record */
+ aptr += rr_len;
+ }
+
+ if (hostname)
+ ares_free (hostname);
+ if (rr_name)
+ ares_free (rr_name);
+
+ /* clean up on error */
+ if (status != ARES_SUCCESS)
+ {
+ if (txt_head)
+ ares_free_data (txt_head);
+ return status;
+ }
+
+ /* everything looks fine, return the data */
+ *txt_out = txt_head;
+
+ return ARES_SUCCESS;
+}
+
+int
+ares_parse_txt_reply (const unsigned char *abuf, int alen,
+ struct ares_txt_reply **txt_out)
+{
+ return ares__parse_txt_reply(abuf, alen, 0, (void **) txt_out);
+}
+
+
+int
+ares_parse_txt_reply_ext (const unsigned char *abuf, int alen,
+ struct ares_txt_ext **txt_out)
+{
+ return ares__parse_txt_reply(abuf, alen, 1, (void **) txt_out);
+}
diff --git a/grpc/third_party/cares/cares/ares_platform.c b/grpc/third_party/cares/cares/src/lib/ares_platform.c
index 6c749dcc..6c749dcc 100644
--- a/grpc/third_party/cares/cares/ares_platform.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_platform.c
diff --git a/grpc/third_party/cares/cares/ares_platform.h b/grpc/third_party/cares/cares/src/lib/ares_platform.h
index e6885ae5..e6885ae5 100644
--- a/grpc/third_party/cares/cares/ares_platform.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_platform.h
diff --git a/grpc/third_party/cares/cares/src/lib/ares_private.h b/grpc/third_party/cares/cares/src/lib/ares_private.h
new file mode 100644
index 00000000..09f65062
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_private.h
@@ -0,0 +1,423 @@
+#ifndef __ARES_PRIVATE_H
+#define __ARES_PRIVATE_H
+
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004-2010 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/*
+ * Define WIN32 when build target is Win32 API
+ */
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+#define WIN32
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef WATT32
+#include <tcp.h>
+#include <sys/ioctl.h>
+#define writev(s,v,c) writev_s(s,v,c)
+#define HAVE_WRITEV 1
+#endif
+
+#define DEFAULT_TIMEOUT 5000 /* milliseconds */
+#define DEFAULT_TRIES 4
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
+
+#ifdef CARES_EXPOSE_STATICS
+/* Make some internal functions visible for testing */
+#define STATIC_TESTABLE
+#else
+#define STATIC_TESTABLE static
+#endif
+
+/* By using a double cast, we can get rid of the bogus warning of
+ * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align]
+ */
+#define CARES_INADDR_CAST(type, var) ((type)((void *)var))
+
+#if defined(WIN32) && !defined(WATT32)
+
+#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
+#define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
+#define WIN_DNSCLIENT "Software\\Policies\\Microsoft\\System\\DNSClient"
+#define WIN_NT_DNSCLIENT "Software\\Policies\\Microsoft\\Windows NT\\DNSClient"
+#define NAMESERVER "NameServer"
+#define DHCPNAMESERVER "DhcpNameServer"
+#define DATABASEPATH "DatabasePath"
+#define WIN_PATH_HOSTS "\\hosts"
+#define SEARCHLIST_KEY "SearchList"
+#define PRIMARYDNSSUFFIX_KEY "PrimaryDNSSuffix"
+#define INTERFACES_KEY "Interfaces"
+#define DOMAIN_KEY "Domain"
+#define DHCPDOMAIN_KEY "DhcpDomain"
+
+#elif defined(WATT32)
+
+#define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
+W32_FUNC const char *_w32_GetHostsFile (void);
+
+#elif defined(NETWARE)
+
+#define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
+#define PATH_HOSTS "sys:/etc/hosts"
+
+#elif defined(__riscos__)
+
+#define PATH_HOSTS "InetDBase:Hosts"
+
+#else
+
+#define PATH_RESOLV_CONF "/etc/resolv.conf"
+#ifdef ETC_INET
+#define PATH_HOSTS "/etc/inet/hosts"
+#else
+#define PATH_HOSTS "/etc/hosts"
+#endif
+
+#endif
+
+#define ARES_ID_KEY_LEN 31
+
+#include "ares_ipv6.h"
+#include "ares_llist.h"
+
+#ifndef HAVE_GETENV
+# include "ares_getenv.h"
+# define getenv(ptr) ares_getenv(ptr)
+#endif
+
+#include "ares_strdup.h"
+#include "ares_strsplit.h"
+
+#ifndef HAVE_STRCASECMP
+# include "ares_strcasecmp.h"
+# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
+#endif
+
+#ifndef HAVE_STRNCASECMP
+# include "ares_strcasecmp.h"
+# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
+#endif
+
+#ifndef HAVE_WRITEV
+# include "ares_writev.h"
+# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
+#endif
+
+/********* EDNS defines section ******/
+#define EDNSPACKETSZ 1280 /* Reasonable UDP payload size, as suggested
+ in RFC2671 */
+#define MAXENDSSZ 4096 /* Maximum (local) limit for edns packet size */
+#define EDNSFIXEDSZ 11 /* Size of EDNS header */
+/********* EDNS defines section ******/
+
+struct ares_addr {
+ int family;
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+ int udp_port; /* stored in network order */
+ int tcp_port; /* stored in network order */
+};
+#define addrV4 addr.addr4
+#define addrV6 addr.addr6
+
+struct query;
+
+struct send_request {
+ /* Remaining data to send */
+ const unsigned char *data;
+ size_t len;
+
+ /* The query for which we're sending this data */
+ struct query* owner_query;
+ /* The buffer we're using, if we have our own copy of the packet */
+ unsigned char *data_storage;
+
+ /* Next request in queue */
+ struct send_request *next;
+};
+
+struct server_state {
+ struct ares_addr addr;
+ ares_socket_t udp_socket;
+ ares_socket_t tcp_socket;
+
+ /* Mini-buffer for reading the length word */
+ unsigned char tcp_lenbuf[2];
+ int tcp_lenbuf_pos;
+ int tcp_length;
+
+ /* Buffer for reading actual TCP data */
+ unsigned char *tcp_buffer;
+ int tcp_buffer_pos;
+
+ /* TCP output queue */
+ struct send_request *qhead;
+ struct send_request *qtail;
+
+ /* Which incarnation of this connection is this? We don't want to
+ * retransmit requests into the very same socket, but if the server
+ * closes on us and we re-open the connection, then we do want to
+ * re-send. */
+ int tcp_connection_generation;
+
+ /* Circular, doubly-linked list of outstanding queries to this server */
+ struct list_node queries_to_server;
+
+ /* Link back to owning channel */
+ ares_channel channel;
+
+ /* Is this server broken? We mark connections as broken when a
+ * request that is queued for sending times out.
+ */
+ int is_broken;
+};
+
+/* State to represent a DNS query */
+struct query {
+ /* Query ID from qbuf, for faster lookup, and current timeout */
+ unsigned short qid;
+ struct timeval timeout;
+
+ /*
+ * Links for the doubly-linked lists in which we insert a query.
+ * These circular, doubly-linked lists that are hash-bucketed based
+ * the attributes we care about, help making most important
+ * operations O(1).
+ */
+ struct list_node queries_by_qid; /* hopefully in same cache line as qid */
+ struct list_node queries_by_timeout;
+ struct list_node queries_to_server;
+ struct list_node all_queries;
+
+ /* Query buf with length at beginning, for TCP transmission */
+ unsigned char *tcpbuf;
+ int tcplen;
+
+ /* Arguments passed to ares_send() (qbuf points into tcpbuf) */
+ const unsigned char *qbuf;
+ int qlen;
+ ares_callback callback;
+ void *arg;
+
+ /* Query status */
+ int try_count; /* Number of times we tried this query already. */
+ int server; /* Server this query has last been sent to. */
+ struct query_server_info *server_info; /* per-server state */
+ int using_tcp;
+ int error_status;
+ int timeouts; /* number of timeouts we saw for this request */
+};
+
+/* Per-server state for a query */
+struct query_server_info {
+ int skip_server; /* should we skip server, due to errors, etc? */
+ int tcp_connection_generation; /* into which TCP connection did we send? */
+};
+
+/* An IP address pattern; matches an IP address X if X & mask == addr */
+#define PATTERN_MASK 0x1
+#define PATTERN_CIDR 0x2
+
+struct apattern {
+ union
+ {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+ union
+ {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ unsigned short bits;
+ } mask;
+ int family;
+ unsigned short type;
+};
+
+typedef struct rc4_key
+{
+ unsigned char state[256];
+ unsigned char x;
+ unsigned char y;
+} rc4_key;
+
+struct ares_channeldata {
+ /* Configuration data */
+ int flags;
+ int timeout; /* in milliseconds */
+ int tries;
+ int ndots;
+ int rotate; /* if true, all servers specified are used */
+ int udp_port; /* stored in network order */
+ int tcp_port; /* stored in network order */
+ int socket_send_buffer_size;
+ int socket_receive_buffer_size;
+ char **domains;
+ int ndomains;
+ struct apattern *sortlist;
+ int nsort;
+ char *lookups;
+ int ednspsz;
+
+ /* For binding to local devices and/or IP addresses. Leave
+ * them null/zero for no binding.
+ */
+ char local_dev_name[32];
+ unsigned int local_ip4;
+ unsigned char local_ip6[16];
+
+ int optmask; /* the option bitfield passed in at init time */
+
+ /* Server addresses and communications state */
+ struct server_state *servers;
+ int nservers;
+
+ /* ID to use for next query */
+ unsigned short next_id;
+ /* key to use when generating new ids */
+ rc4_key id_key;
+
+ /* Generation number to use for the next TCP socket open/close */
+ int tcp_connection_generation;
+
+ /* The time at which we last called process_timeouts(). Uses integer seconds
+ just to draw the line somewhere. */
+ time_t last_timeout_processed;
+
+ /* Last server we sent a query to. */
+ int last_server;
+
+ /* Circular, doubly-linked list of queries, bucketed various ways.... */
+ /* All active queries in a single list: */
+ struct list_node all_queries;
+ /* Queries bucketed by qid, for quickly dispatching DNS responses: */
+#define ARES_QID_TABLE_SIZE 2048
+ struct list_node queries_by_qid[ARES_QID_TABLE_SIZE];
+ /* Queries bucketed by timeout, for quickly handling timeouts: */
+#define ARES_TIMEOUT_TABLE_SIZE 1024
+ struct list_node queries_by_timeout[ARES_TIMEOUT_TABLE_SIZE];
+
+ ares_sock_state_cb sock_state_cb;
+ void *sock_state_cb_data;
+
+ ares_sock_create_callback sock_create_cb;
+ void *sock_create_cb_data;
+
+ ares_sock_config_callback sock_config_cb;
+ void *sock_config_cb_data;
+
+ const struct ares_socket_functions * sock_funcs;
+ void *sock_func_cb_data;
+
+ /* Path for resolv.conf file, configurable via ares_options */
+ char *resolvconf_path;
+};
+
+/* Does the domain end in ".onion" or ".onion."? Case-insensitive. */
+int ares__is_onion_domain(const char *name);
+
+/* Memory management functions */
+extern void *(*ares_malloc)(size_t size);
+extern void *(*ares_realloc)(void *ptr, size_t size);
+extern void (*ares_free)(void *ptr);
+
+/* return true if now is exactly check time or later */
+int ares__timedout(struct timeval *now,
+ struct timeval *check);
+
+void ares__send_query(ares_channel channel, struct query *query,
+ struct timeval *now);
+void ares__close_sockets(ares_channel channel, struct server_state *server);
+int ares__get_hostent(FILE *fp, int family, struct hostent **host);
+int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
+void ares__free_query(struct query *query);
+unsigned short ares__generate_new_id(rc4_key* key);
+struct timeval ares__tvnow(void);
+int ares__expand_name_validated(const unsigned char *encoded,
+ const unsigned char *abuf,
+ int alen, char **s, long *enclen,
+ int is_hostname);
+int ares__expand_name_for_response(const unsigned char *encoded,
+ const unsigned char *abuf, int alen,
+ char **s, long *enclen, int is_hostname);
+void ares__init_servers_state(ares_channel channel);
+void ares__destroy_servers_state(ares_channel channel);
+int ares__parse_qtype_reply(const unsigned char* abuf, int alen, int* qtype);
+int ares__single_domain(ares_channel channel, const char *name, char **s);
+int ares__cat_domain(const char *name, const char *domain, char **s);
+int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *ai_node);
+int ares__readaddrinfo(FILE *fp, const char *name, unsigned short port,
+ const struct ares_addrinfo_hints *hints,
+ struct ares_addrinfo *ai);
+
+struct ares_addrinfo *ares__malloc_addrinfo(void);
+
+struct ares_addrinfo_node *ares__malloc_addrinfo_node(void);
+void ares__freeaddrinfo_nodes(struct ares_addrinfo_node *ai_node);
+
+struct ares_addrinfo_node *ares__append_addrinfo_node(struct ares_addrinfo_node **ai_node);
+void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head,
+ struct ares_addrinfo_node *tail);
+
+struct ares_addrinfo_cname *ares__malloc_addrinfo_cname(void);
+void ares__freeaddrinfo_cnames(struct ares_addrinfo_cname *ai_cname);
+
+struct ares_addrinfo_cname *ares__append_addrinfo_cname(struct ares_addrinfo_cname **ai_cname);
+
+void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head,
+ struct ares_addrinfo_cname *tail);
+
+int ares__parse_into_addrinfo(const unsigned char *abuf,
+ int alen,
+ struct ares_addrinfo *ai);
+
+int ares__parse_into_addrinfo2(const unsigned char *abuf,
+ int alen,
+ char **question_hostname,
+ struct ares_addrinfo *ai);
+
+#if 0 /* Not used */
+long ares__tvdiff(struct timeval t1, struct timeval t2);
+#endif
+
+ares_socket_t ares__open_socket(ares_channel channel,
+ int af, int type, int protocol);
+void ares__close_socket(ares_channel, ares_socket_t);
+int ares__connect_socket(ares_channel channel,
+ ares_socket_t sockfd,
+ const struct sockaddr *addr,
+ ares_socklen_t addrlen);
+
+#define ARES_SWAP_BYTE(a,b) \
+ { unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
+
+#define SOCK_STATE_CALLBACK(c, s, r, w) \
+ do { \
+ if ((c)->sock_state_cb) \
+ (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
+ } WHILE_FALSE
+
+#endif /* __ARES_PRIVATE_H */
diff --git a/grpc/third_party/cares/cares/src/lib/ares_process.c b/grpc/third_party/cares/cares/src/lib/ares_process.c
new file mode 100644
index 00000000..87329e35
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_process.c
@@ -0,0 +1,1548 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004-2017 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef NETWARE
+# include <sys/filio.h>
+#endif
+
+#include <assert.h>
+#include <fcntl.h>
+#include <limits.h>
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_nowarn.h"
+#include "ares_private.h"
+
+
+static int try_again(int errnum);
+static void write_tcp_data(ares_channel channel, fd_set *write_fds,
+ ares_socket_t write_fd, struct timeval *now);
+static void read_tcp_data(ares_channel channel, fd_set *read_fds,
+ ares_socket_t read_fd, struct timeval *now);
+static void read_udp_packets(ares_channel channel, fd_set *read_fds,
+ ares_socket_t read_fd, struct timeval *now);
+static void advance_tcp_send_queue(ares_channel channel, int whichserver,
+ ares_ssize_t num_bytes);
+static void process_timeouts(ares_channel channel, struct timeval *now);
+static void process_broken_connections(ares_channel channel,
+ struct timeval *now);
+static void process_answer(ares_channel channel, unsigned char *abuf,
+ int alen, int whichserver, int tcp,
+ struct timeval *now);
+static void handle_error(ares_channel channel, int whichserver,
+ struct timeval *now);
+static void skip_server(ares_channel channel, struct query *query,
+ int whichserver);
+static void next_server(ares_channel channel, struct query *query,
+ struct timeval *now);
+static int open_tcp_socket(ares_channel channel, struct server_state *server);
+static int open_udp_socket(ares_channel channel, struct server_state *server);
+static int same_questions(const unsigned char *qbuf, int qlen,
+ const unsigned char *abuf, int alen);
+static int same_address(struct sockaddr *sa, struct ares_addr *aa);
+static int has_opt_rr(const unsigned char *abuf, int alen);
+static void end_query(ares_channel channel, struct query *query, int status,
+ unsigned char *abuf, int alen);
+
+/* return true if now is exactly check time or later */
+int ares__timedout(struct timeval *now,
+ struct timeval *check)
+{
+ long secs = (now->tv_sec - check->tv_sec);
+
+ if(secs > 0)
+ return 1; /* yes, timed out */
+ if(secs < 0)
+ return 0; /* nope, not timed out */
+
+ /* if the full seconds were identical, check the sub second parts */
+ return (now->tv_usec - check->tv_usec >= 0);
+}
+
+/* add the specific number of milliseconds to the time in the first argument */
+static void timeadd(struct timeval *now, int millisecs)
+{
+ now->tv_sec += millisecs/1000;
+ now->tv_usec += (millisecs%1000)*1000;
+
+ if(now->tv_usec >= 1000000) {
+ ++(now->tv_sec);
+ now->tv_usec -= 1000000;
+ }
+}
+
+/*
+ * generic process function
+ */
+static void processfds(ares_channel channel,
+ fd_set *read_fds, ares_socket_t read_fd,
+ fd_set *write_fds, ares_socket_t write_fd)
+{
+ struct timeval now = ares__tvnow();
+
+ write_tcp_data(channel, write_fds, write_fd, &now);
+ read_tcp_data(channel, read_fds, read_fd, &now);
+ read_udp_packets(channel, read_fds, read_fd, &now);
+ process_timeouts(channel, &now);
+ process_broken_connections(channel, &now);
+}
+
+/* Something interesting happened on the wire, or there was a timeout.
+ * See what's up and respond accordingly.
+ */
+void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
+{
+ processfds(channel, read_fds, ARES_SOCKET_BAD, write_fds, ARES_SOCKET_BAD);
+}
+
+/* Something interesting happened on the wire, or there was a timeout.
+ * See what's up and respond accordingly.
+ */
+void ares_process_fd(ares_channel channel,
+ ares_socket_t read_fd, /* use ARES_SOCKET_BAD or valid
+ file descriptors */
+ ares_socket_t write_fd)
+{
+ processfds(channel, NULL, read_fd, NULL, write_fd);
+}
+
+
+/* Return 1 if the specified error number describes a readiness error, or 0
+ * otherwise. This is mostly for HP-UX, which could return EAGAIN or
+ * EWOULDBLOCK. See this man page
+ *
+ * http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?
+ * manpage=/usr/share/man/man2.Z/send.2
+ */
+static int try_again(int errnum)
+{
+#if !defined EWOULDBLOCK && !defined EAGAIN
+#error "Neither EWOULDBLOCK nor EAGAIN defined"
+#endif
+ switch (errnum)
+ {
+#ifdef EWOULDBLOCK
+ case EWOULDBLOCK:
+ return 1;
+#endif
+#if defined EAGAIN && EAGAIN != EWOULDBLOCK
+ case EAGAIN:
+ return 1;
+#endif
+ }
+ return 0;
+}
+
+static ares_ssize_t socket_writev(ares_channel channel, ares_socket_t s, const struct iovec * vec, int len)
+{
+ if (channel->sock_funcs)
+ return channel->sock_funcs->asendv(s, vec, len, channel->sock_func_cb_data);
+
+ return writev(s, vec, len);
+}
+
+static ares_ssize_t socket_write(ares_channel channel, ares_socket_t s, const void * data, size_t len)
+{
+ if (channel->sock_funcs)
+ {
+ struct iovec vec;
+ vec.iov_base = (void*)data;
+ vec.iov_len = len;
+ return channel->sock_funcs->asendv(s, &vec, 1, channel->sock_func_cb_data);
+ }
+ return swrite(s, data, len);
+}
+
+/* If any TCP sockets select true for writing, write out queued data
+ * we have for them.
+ */
+static void write_tcp_data(ares_channel channel,
+ fd_set *write_fds,
+ ares_socket_t write_fd,
+ struct timeval *now)
+{
+ struct server_state *server;
+ struct send_request *sendreq;
+ struct iovec *vec;
+ int i;
+ ares_ssize_t scount;
+ ares_ssize_t wcount;
+ size_t n;
+
+ if(!write_fds && (write_fd == ARES_SOCKET_BAD))
+ /* no possible action */
+ return;
+
+ for (i = 0; i < channel->nservers; i++)
+ {
+ /* Make sure server has data to send and is selected in write_fds or
+ write_fd. */
+ server = &channel->servers[i];
+ if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD ||
+ server->is_broken)
+ continue;
+
+ if(write_fds) {
+ if(!FD_ISSET(server->tcp_socket, write_fds))
+ continue;
+ }
+ else {
+ if(server->tcp_socket != write_fd)
+ continue;
+ }
+
+ if(write_fds)
+ /* If there's an error and we close this socket, then open
+ * another with the same fd to talk to another server, then we
+ * don't want to think that it was the new socket that was
+ * ready. This is not disastrous, but is likely to result in
+ * extra system calls and confusion. */
+ FD_CLR(server->tcp_socket, write_fds);
+
+ /* Count the number of send queue items. */
+ n = 0;
+ for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
+ n++;
+
+ /* Allocate iovecs so we can send all our data at once. */
+ vec = ares_malloc(n * sizeof(struct iovec));
+ if (vec)
+ {
+ /* Fill in the iovecs and send. */
+ n = 0;
+ for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
+ {
+ vec[n].iov_base = (char *) sendreq->data;
+ vec[n].iov_len = sendreq->len;
+ n++;
+ }
+ wcount = socket_writev(channel, server->tcp_socket, vec, (int)n);
+ ares_free(vec);
+ if (wcount < 0)
+ {
+ if (!try_again(SOCKERRNO))
+ handle_error(channel, i, now);
+ continue;
+ }
+
+ /* Advance the send queue by as many bytes as we sent. */
+ advance_tcp_send_queue(channel, i, wcount);
+ }
+ else
+ {
+ /* Can't allocate iovecs; just send the first request. */
+ sendreq = server->qhead;
+
+ scount = socket_write(channel, server->tcp_socket, sendreq->data, sendreq->len);
+ if (scount < 0)
+ {
+ if (!try_again(SOCKERRNO))
+ handle_error(channel, i, now);
+ continue;
+ }
+
+ /* Advance the send queue by as many bytes as we sent. */
+ advance_tcp_send_queue(channel, i, scount);
+ }
+ }
+}
+
+/* Consume the given number of bytes from the head of the TCP send queue. */
+static void advance_tcp_send_queue(ares_channel channel, int whichserver,
+ ares_ssize_t num_bytes)
+{
+ struct send_request *sendreq;
+ struct server_state *server = &channel->servers[whichserver];
+ while (num_bytes > 0) {
+ sendreq = server->qhead;
+ if ((size_t)num_bytes >= sendreq->len) {
+ num_bytes -= sendreq->len;
+ server->qhead = sendreq->next;
+ if (sendreq->data_storage)
+ ares_free(sendreq->data_storage);
+ ares_free(sendreq);
+ if (server->qhead == NULL) {
+ SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
+ server->qtail = NULL;
+
+ /* qhead is NULL so we cannot continue this loop */
+ break;
+ }
+ }
+ else {
+ sendreq->data += num_bytes;
+ sendreq->len -= num_bytes;
+ num_bytes = 0;
+ }
+ }
+}
+
+static ares_ssize_t socket_recvfrom(ares_channel channel,
+ ares_socket_t s,
+ void * data,
+ size_t data_len,
+ int flags,
+ struct sockaddr *from,
+ ares_socklen_t *from_len)
+{
+ if (channel->sock_funcs)
+ return channel->sock_funcs->arecvfrom(s, data, data_len,
+ flags, from, from_len,
+ channel->sock_func_cb_data);
+
+#ifdef HAVE_RECVFROM
+ return recvfrom(s, data, data_len, flags, from, from_len);
+#else
+ return sread(s, data, data_len);
+#endif
+}
+
+static ares_ssize_t socket_recv(ares_channel channel,
+ ares_socket_t s,
+ void * data,
+ size_t data_len)
+{
+ if (channel->sock_funcs)
+ return channel->sock_funcs->arecvfrom(s, data, data_len, 0, 0, 0,
+ channel->sock_func_cb_data);
+
+ return sread(s, data, data_len);
+}
+
+/* If any TCP socket selects true for reading, read some data,
+ * allocate a buffer if we finish reading the length word, and process
+ * a packet if we finish reading one.
+ */
+static void read_tcp_data(ares_channel channel, fd_set *read_fds,
+ ares_socket_t read_fd, struct timeval *now)
+{
+ struct server_state *server;
+ int i;
+ ares_ssize_t count;
+
+ if(!read_fds && (read_fd == ARES_SOCKET_BAD))
+ /* no possible action */
+ return;
+
+ for (i = 0; i < channel->nservers; i++)
+ {
+ /* Make sure the server has a socket and is selected in read_fds. */
+ server = &channel->servers[i];
+ if (server->tcp_socket == ARES_SOCKET_BAD || server->is_broken)
+ continue;
+
+ if(read_fds) {
+ if(!FD_ISSET(server->tcp_socket, read_fds))
+ continue;
+ }
+ else {
+ if(server->tcp_socket != read_fd)
+ continue;
+ }
+
+ if(read_fds)
+ /* If there's an error and we close this socket, then open another
+ * with the same fd to talk to another server, then we don't want to
+ * think that it was the new socket that was ready. This is not
+ * disastrous, but is likely to result in extra system calls and
+ * confusion. */
+ FD_CLR(server->tcp_socket, read_fds);
+
+ if (server->tcp_lenbuf_pos != 2)
+ {
+ /* We haven't yet read a length word, so read that (or
+ * what's left to read of it).
+ */
+ count = socket_recv(channel, server->tcp_socket,
+ server->tcp_lenbuf + server->tcp_lenbuf_pos,
+ 2 - server->tcp_lenbuf_pos);
+ if (count <= 0)
+ {
+ if (!(count == -1 && try_again(SOCKERRNO)))
+ handle_error(channel, i, now);
+ continue;
+ }
+
+ server->tcp_lenbuf_pos += (int)count;
+ if (server->tcp_lenbuf_pos == 2)
+ {
+ /* We finished reading the length word. Decode the
+ * length and allocate a buffer for the data.
+ */
+ server->tcp_length = server->tcp_lenbuf[0] << 8
+ | server->tcp_lenbuf[1];
+ server->tcp_buffer = ares_malloc(server->tcp_length);
+ if (!server->tcp_buffer) {
+ handle_error(channel, i, now);
+ return; /* bail out on malloc failure. TODO: make this
+ function return error codes */
+ }
+ server->tcp_buffer_pos = 0;
+ }
+ }
+ else
+ {
+ /* Read data into the allocated buffer. */
+ count = socket_recv(channel, server->tcp_socket,
+ server->tcp_buffer + server->tcp_buffer_pos,
+ server->tcp_length - server->tcp_buffer_pos);
+ if (count <= 0)
+ {
+ if (!(count == -1 && try_again(SOCKERRNO)))
+ handle_error(channel, i, now);
+ continue;
+ }
+
+ server->tcp_buffer_pos += (int)count;
+ if (server->tcp_buffer_pos == server->tcp_length)
+ {
+ /* We finished reading this answer; process it and
+ * prepare to read another length word.
+ */
+ process_answer(channel, server->tcp_buffer, server->tcp_length,
+ i, 1, now);
+ ares_free(server->tcp_buffer);
+ server->tcp_buffer = NULL;
+ server->tcp_lenbuf_pos = 0;
+ server->tcp_buffer_pos = 0;
+ }
+ }
+ }
+}
+
+/* If any UDP sockets select true for reading, process them. */
+static void read_udp_packets(ares_channel channel, fd_set *read_fds,
+ ares_socket_t read_fd, struct timeval *now)
+{
+ struct server_state *server;
+ int i;
+ ares_ssize_t count;
+ unsigned char buf[MAXENDSSZ + 1];
+#ifdef HAVE_RECVFROM
+ ares_socklen_t fromlen;
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+ } from;
+#endif
+
+ if(!read_fds && (read_fd == ARES_SOCKET_BAD))
+ /* no possible action */
+ return;
+
+ for (i = 0; i < channel->nservers; i++)
+ {
+ /* Make sure the server has a socket and is selected in read_fds. */
+ server = &channel->servers[i];
+
+ if (server->udp_socket == ARES_SOCKET_BAD || server->is_broken)
+ continue;
+
+ if(read_fds) {
+ if(!FD_ISSET(server->udp_socket, read_fds))
+ continue;
+ }
+ else {
+ if(server->udp_socket != read_fd)
+ continue;
+ }
+
+ if(read_fds)
+ /* If there's an error and we close this socket, then open
+ * another with the same fd to talk to another server, then we
+ * don't want to think that it was the new socket that was
+ * ready. This is not disastrous, but is likely to result in
+ * extra system calls and confusion. */
+ FD_CLR(server->udp_socket, read_fds);
+
+ /* To reduce event loop overhead, read and process as many
+ * packets as we can. */
+ do {
+ if (server->udp_socket == ARES_SOCKET_BAD)
+ count = 0;
+
+ else {
+ if (server->addr.family == AF_INET)
+ fromlen = sizeof(from.sa4);
+ else
+ fromlen = sizeof(from.sa6);
+ count = socket_recvfrom(channel, server->udp_socket, (void *)buf,
+ sizeof(buf), 0, &from.sa, &fromlen);
+ }
+
+ if (count == -1 && try_again(SOCKERRNO))
+ continue;
+ else if (count <= 0)
+ handle_error(channel, i, now);
+#ifdef HAVE_RECVFROM
+ else if (!same_address(&from.sa, &server->addr))
+ /* The address the response comes from does not match the address we
+ * sent the request to. Someone may be attempting to perform a cache
+ * poisoning attack. */
+ break;
+#endif
+ else
+ process_answer(channel, buf, (int)count, i, 0, now);
+ } while (count > 0);
+ }
+}
+
+/* If any queries have timed out, note the timeout and move them on. */
+static void process_timeouts(ares_channel channel, struct timeval *now)
+{
+ time_t t; /* the time of the timeouts we're processing */
+ struct query *query;
+ struct list_node* list_head;
+ struct list_node* list_node;
+
+ /* Process all the timeouts that have fired since the last time we processed
+ * timeouts. If things are going well, then we'll have hundreds/thousands of
+ * queries that fall into future buckets, and only a handful of requests
+ * that fall into the "now" bucket, so this should be quite quick.
+ */
+ for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
+ {
+ list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
+ for (list_node = list_head->next; list_node != list_head; )
+ {
+ query = list_node->data;
+ list_node = list_node->next; /* in case the query gets deleted */
+ if (query->timeout.tv_sec && ares__timedout(now, &query->timeout))
+ {
+ query->error_status = ARES_ETIMEOUT;
+ ++query->timeouts;
+ next_server(channel, query, now);
+ }
+ }
+ }
+ channel->last_timeout_processed = now->tv_sec;
+}
+
+/* Handle an answer from a server. */
+static void process_answer(ares_channel channel, unsigned char *abuf,
+ int alen, int whichserver, int tcp,
+ struct timeval *now)
+{
+ int tc, rcode, packetsz;
+ unsigned short id;
+ struct query *query;
+ struct list_node* list_head;
+ struct list_node* list_node;
+
+ /* If there's no room in the answer for a header, we can't do much
+ * with it. */
+ if (alen < HFIXEDSZ)
+ return;
+
+ /* Grab the query ID, truncate bit, and response code from the packet. */
+ id = DNS_HEADER_QID(abuf);
+ tc = DNS_HEADER_TC(abuf);
+ rcode = DNS_HEADER_RCODE(abuf);
+
+ /* Find the query corresponding to this packet. The queries are
+ * hashed/bucketed by query id, so this lookup should be quick. Note that
+ * both the query id and the questions must be the same; when the query id
+ * wraps around we can have multiple outstanding queries with the same query
+ * id, so we need to check both the id and question.
+ */
+ query = NULL;
+ list_head = &(channel->queries_by_qid[id % ARES_QID_TABLE_SIZE]);
+ for (list_node = list_head->next; list_node != list_head;
+ list_node = list_node->next)
+ {
+ struct query *q = list_node->data;
+ if ((q->qid == id) && same_questions(q->qbuf, q->qlen, abuf, alen))
+ {
+ query = q;
+ break;
+ }
+ }
+ if (!query)
+ return;
+
+ packetsz = PACKETSZ;
+ /* If we use EDNS and server answers with FORMERR without an OPT RR, the protocol
+ * extension is not understood by the responder. We must retry the query
+ * without EDNS enabled. */
+ if (channel->flags & ARES_FLAG_EDNS)
+ {
+ packetsz = channel->ednspsz;
+ if (rcode == FORMERR && has_opt_rr(abuf, alen) != 1)
+ {
+ int qlen = (query->tcplen - 2) - EDNSFIXEDSZ;
+ channel->flags ^= ARES_FLAG_EDNS;
+ query->tcplen -= EDNSFIXEDSZ;
+ query->qlen -= EDNSFIXEDSZ;
+ query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
+ query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
+ DNS_HEADER_SET_ARCOUNT(query->tcpbuf + 2, 0);
+ query->tcpbuf = ares_realloc(query->tcpbuf, query->tcplen);
+ query->qbuf = query->tcpbuf + 2;
+ ares__send_query(channel, query, now);
+ return;
+ }
+ }
+
+ /* If we got a truncated UDP packet and are not ignoring truncation,
+ * don't accept the packet, and switch the query to TCP if we hadn't
+ * done so already.
+ */
+ if ((tc || alen > packetsz) && !tcp && !(channel->flags & ARES_FLAG_IGNTC))
+ {
+ if (!query->using_tcp)
+ {
+ query->using_tcp = 1;
+ ares__send_query(channel, query, now);
+ }
+ return;
+ }
+
+ /* Limit alen to PACKETSZ if we aren't using TCP (only relevant if we
+ * are ignoring truncation.
+ */
+ if (alen > packetsz && !tcp)
+ alen = packetsz;
+
+ /* If we aren't passing through all error packets, discard packets
+ * with SERVFAIL, NOTIMP, or REFUSED response codes.
+ */
+ if (!(channel->flags & ARES_FLAG_NOCHECKRESP))
+ {
+ if (rcode == SERVFAIL || rcode == NOTIMP || rcode == REFUSED)
+ {
+ skip_server(channel, query, whichserver);
+ if (query->server == whichserver)
+ next_server(channel, query, now);
+ return;
+ }
+ }
+
+ end_query(channel, query, ARES_SUCCESS, abuf, alen);
+}
+
+/* Close all the connections that are no longer usable. */
+static void process_broken_connections(ares_channel channel,
+ struct timeval *now)
+{
+ int i;
+ for (i = 0; i < channel->nservers; i++)
+ {
+ struct server_state *server = &channel->servers[i];
+ if (server->is_broken)
+ {
+ handle_error(channel, i, now);
+ }
+ }
+}
+
+/* Swap the contents of two lists */
+static void swap_lists(struct list_node* head_a,
+ struct list_node* head_b)
+{
+ int is_a_empty = ares__is_list_empty(head_a);
+ int is_b_empty = ares__is_list_empty(head_b);
+ struct list_node old_a = *head_a;
+ struct list_node old_b = *head_b;
+
+ if (is_a_empty) {
+ ares__init_list_head(head_b);
+ } else {
+ *head_b = old_a;
+ old_a.next->prev = head_b;
+ old_a.prev->next = head_b;
+ }
+ if (is_b_empty) {
+ ares__init_list_head(head_a);
+ } else {
+ *head_a = old_b;
+ old_b.next->prev = head_a;
+ old_b.prev->next = head_a;
+ }
+}
+
+static void handle_error(ares_channel channel, int whichserver,
+ struct timeval *now)
+{
+ struct server_state *server;
+ struct query *query;
+ struct list_node list_head;
+ struct list_node* list_node;
+
+ server = &channel->servers[whichserver];
+
+ /* Reset communications with this server. */
+ ares__close_sockets(channel, server);
+
+ /* Tell all queries talking to this server to move on and not try this
+ * server again. We steal the current list of queries that were in-flight to
+ * this server, since when we call next_server this can cause the queries to
+ * be re-sent to this server, which will re-insert these queries in that
+ * same server->queries_to_server list.
+ */
+ ares__init_list_head(&list_head);
+ swap_lists(&list_head, &(server->queries_to_server));
+ for (list_node = list_head.next; list_node != &list_head; )
+ {
+ query = list_node->data;
+ list_node = list_node->next; /* in case the query gets deleted */
+ assert(query->server == whichserver);
+ skip_server(channel, query, whichserver);
+ next_server(channel, query, now);
+ }
+ /* Each query should have removed itself from our temporary list as
+ * it re-sent itself or finished up...
+ */
+ assert(ares__is_list_empty(&list_head));
+}
+
+static void skip_server(ares_channel channel, struct query *query,
+ int whichserver)
+{
+ /* The given server gave us problems with this query, so if we have the
+ * luxury of using other servers, then let's skip the potentially broken
+ * server and just use the others. If we only have one server and we need to
+ * retry then we should just go ahead and re-use that server, since it's our
+ * only hope; perhaps we just got unlucky, and retrying will work (eg, the
+ * server timed out our TCP connection just as we were sending another
+ * request).
+ */
+ if (channel->nservers > 1)
+ {
+ query->server_info[whichserver].skip_server = 1;
+ }
+}
+
+static void next_server(ares_channel channel, struct query *query,
+ struct timeval *now)
+{
+ /* We need to try each server channel->tries times. We have channel->nservers
+ * servers to try. In total, we need to do channel->nservers * channel->tries
+ * attempts. Use query->try to remember how many times we already attempted
+ * this query. Use modular arithmetic to find the next server to try. */
+ while (++(query->try_count) < (channel->nservers * channel->tries))
+ {
+ struct server_state *server;
+
+ /* Move on to the next server. */
+ query->server = (query->server + 1) % channel->nservers;
+ server = &channel->servers[query->server];
+
+ /* We don't want to use this server if (1) we decided this connection is
+ * broken, and thus about to be closed, (2) we've decided to skip this
+ * server because of earlier errors we encountered, or (3) we already
+ * sent this query over this exact connection.
+ */
+ if (!server->is_broken &&
+ !query->server_info[query->server].skip_server &&
+ !(query->using_tcp &&
+ (query->server_info[query->server].tcp_connection_generation ==
+ server->tcp_connection_generation)))
+ {
+ ares__send_query(channel, query, now);
+ return;
+ }
+
+ /* You might think that with TCP we only need one try. However, even
+ * when using TCP, servers can time-out our connection just as we're
+ * sending a request, or close our connection because they die, or never
+ * send us a reply because they get wedged or tickle a bug that drops
+ * our request.
+ */
+ }
+
+ /* If we are here, all attempts to perform query failed. */
+ end_query(channel, query, query->error_status, NULL, 0);
+}
+
+void ares__send_query(ares_channel channel, struct query *query,
+ struct timeval *now)
+{
+ struct send_request *sendreq;
+ struct server_state *server;
+ int timeplus;
+
+ server = &channel->servers[query->server];
+ if (query->using_tcp)
+ {
+ /* Make sure the TCP socket for this server is set up and queue
+ * a send request.
+ */
+ if (server->tcp_socket == ARES_SOCKET_BAD)
+ {
+ if (open_tcp_socket(channel, server) == -1)
+ {
+ skip_server(channel, query, query->server);
+ next_server(channel, query, now);
+ return;
+ }
+ }
+ sendreq = ares_malloc(sizeof(struct send_request));
+ if (!sendreq)
+ {
+ end_query(channel, query, ARES_ENOMEM, NULL, 0);
+ return;
+ }
+ memset(sendreq, 0, sizeof(struct send_request));
+ /* To make the common case fast, we avoid copies by using the query's
+ * tcpbuf for as long as the query is alive. In the rare case where the
+ * query ends while it's queued for transmission, then we give the
+ * sendreq its own copy of the request packet and put it in
+ * sendreq->data_storage.
+ */
+ sendreq->data_storage = NULL;
+ sendreq->data = query->tcpbuf;
+ sendreq->len = query->tcplen;
+ sendreq->owner_query = query;
+ sendreq->next = NULL;
+ if (server->qtail)
+ server->qtail->next = sendreq;
+ else
+ {
+ SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 1);
+ server->qhead = sendreq;
+ }
+ server->qtail = sendreq;
+ query->server_info[query->server].tcp_connection_generation =
+ server->tcp_connection_generation;
+ }
+ else
+ {
+ if (server->udp_socket == ARES_SOCKET_BAD)
+ {
+ if (open_udp_socket(channel, server) == -1)
+ {
+ skip_server(channel, query, query->server);
+ next_server(channel, query, now);
+ return;
+ }
+ }
+ if (socket_write(channel, server->udp_socket, query->qbuf, query->qlen) == -1)
+ {
+ /* FIXME: Handle EAGAIN here since it likely can happen. */
+ skip_server(channel, query, query->server);
+ next_server(channel, query, now);
+ return;
+ }
+ }
+
+ /* For each trip through the entire server list, double the channel's
+ * assigned timeout, avoiding overflow. If channel->timeout is negative,
+ * leave it as-is, even though that should be impossible here.
+ */
+ timeplus = channel->timeout;
+ {
+ /* How many times do we want to double it? Presume sane values here. */
+ const int shift = query->try_count / channel->nservers;
+
+ /* Is there enough room to shift timeplus left that many times?
+ *
+ * To find out, confirm that all of the bits we'll shift away are zero.
+ * Stop considering a shift if we get to the point where we could shift
+ * a 1 into the sign bit (i.e. when shift is within two of the bit
+ * count).
+ *
+ * This has the side benefit of leaving negative numbers unchanged.
+ */
+ if(shift <= (int)(sizeof(int) * CHAR_BIT - 1)
+ && (timeplus >> (sizeof(int) * CHAR_BIT - 1 - shift)) == 0)
+ {
+ timeplus <<= shift;
+ }
+ }
+
+ query->timeout = *now;
+ timeadd(&query->timeout, timeplus);
+ /* Keep track of queries bucketed by timeout, so we can process
+ * timeout events quickly.
+ */
+ ares__remove_from_list(&(query->queries_by_timeout));
+ ares__insert_in_list(
+ &(query->queries_by_timeout),
+ &(channel->queries_by_timeout[query->timeout.tv_sec %
+ ARES_TIMEOUT_TABLE_SIZE]));
+
+ /* Keep track of queries bucketed by server, so we can process server
+ * errors quickly.
+ */
+ ares__remove_from_list(&(query->queries_to_server));
+ ares__insert_in_list(&(query->queries_to_server),
+ &(server->queries_to_server));
+}
+
+/*
+ * setsocknonblock sets the given socket to either blocking or non-blocking
+ * mode based on the 'nonblock' boolean argument. This function is highly
+ * portable.
+ */
+static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
+ int nonblock /* TRUE or FALSE */)
+{
+#if defined(USE_BLOCKING_SOCKETS)
+
+ return 0; /* returns success */
+
+#elif defined(HAVE_FCNTL_O_NONBLOCK)
+
+ /* most recent unix versions */
+ int flags;
+ flags = fcntl(sockfd, F_GETFL, 0);
+ if (FALSE != nonblock)
+ return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
+ else
+ return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); /* LCOV_EXCL_LINE */
+
+#elif defined(HAVE_IOCTL_FIONBIO)
+
+ /* older unix versions */
+ int flags = nonblock ? 1 : 0;
+ return ioctl(sockfd, FIONBIO, &flags);
+
+#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
+
+#ifdef WATT32
+ char flags = nonblock ? 1 : 0;
+#else
+ /* Windows */
+ unsigned long flags = nonblock ? 1UL : 0UL;
+#endif
+ return ioctlsocket(sockfd, FIONBIO, &flags);
+
+#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
+
+ /* Amiga */
+ long flags = nonblock ? 1L : 0L;
+ return IoctlSocket(sockfd, FIONBIO, flags);
+
+#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
+
+ /* BeOS */
+ long b = nonblock ? 1L : 0L;
+ return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
+
+#else
+# error "no non-blocking method was found/used/set"
+#endif
+}
+
+static int configure_socket(ares_socket_t s, int family, ares_channel channel)
+{
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+ } local;
+
+ /* do not set options for user-managed sockets */
+ if (channel->sock_funcs)
+ return 0;
+
+ (void)setsocknonblock(s, TRUE);
+
+#if defined(FD_CLOEXEC) && !defined(MSDOS)
+ /* Configure the socket fd as close-on-exec. */
+ if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1)
+ return -1; /* LCOV_EXCL_LINE */
+#endif
+
+ /* Set the socket's send and receive buffer sizes. */
+ if ((channel->socket_send_buffer_size > 0) &&
+ setsockopt(s, SOL_SOCKET, SO_SNDBUF,
+ (void *)&channel->socket_send_buffer_size,
+ sizeof(channel->socket_send_buffer_size)) == -1)
+ return -1;
+
+ if ((channel->socket_receive_buffer_size > 0) &&
+ setsockopt(s, SOL_SOCKET, SO_RCVBUF,
+ (void *)&channel->socket_receive_buffer_size,
+ sizeof(channel->socket_receive_buffer_size)) == -1)
+ return -1;
+
+#ifdef SO_BINDTODEVICE
+ if (channel->local_dev_name[0]) {
+ if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE,
+ channel->local_dev_name, sizeof(channel->local_dev_name))) {
+ /* Only root can do this, and usually not fatal if it doesn't work, so */
+ /* just continue on. */
+ }
+ }
+#endif
+
+ if (family == AF_INET) {
+ if (channel->local_ip4) {
+ memset(&local.sa4, 0, sizeof(local.sa4));
+ local.sa4.sin_family = AF_INET;
+ local.sa4.sin_addr.s_addr = htonl(channel->local_ip4);
+ if (bind(s, &local.sa, sizeof(local.sa4)) < 0)
+ return -1;
+ }
+ }
+ else if (family == AF_INET6) {
+ if (memcmp(channel->local_ip6, &ares_in6addr_any,
+ sizeof(channel->local_ip6)) != 0) {
+ memset(&local.sa6, 0, sizeof(local.sa6));
+ local.sa6.sin6_family = AF_INET6;
+ memcpy(&local.sa6.sin6_addr, channel->local_ip6,
+ sizeof(channel->local_ip6));
+ if (bind(s, &local.sa, sizeof(local.sa6)) < 0)
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static int open_tcp_socket(ares_channel channel, struct server_state *server)
+{
+ ares_socket_t s;
+ int opt;
+ ares_socklen_t salen;
+ union {
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+ } saddr;
+ struct sockaddr *sa;
+
+ switch (server->addr.family)
+ {
+ case AF_INET:
+ sa = (void *)&saddr.sa4;
+ salen = sizeof(saddr.sa4);
+ memset(sa, 0, salen);
+ saddr.sa4.sin_family = AF_INET;
+ if (server->addr.tcp_port) {
+ saddr.sa4.sin_port = aresx_sitous(server->addr.tcp_port);
+ } else {
+ saddr.sa4.sin_port = aresx_sitous(channel->tcp_port);
+ }
+ memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4,
+ sizeof(server->addr.addrV4));
+ break;
+ case AF_INET6:
+ sa = (void *)&saddr.sa6;
+ salen = sizeof(saddr.sa6);
+ memset(sa, 0, salen);
+ saddr.sa6.sin6_family = AF_INET6;
+ if (server->addr.tcp_port) {
+ saddr.sa6.sin6_port = aresx_sitous(server->addr.tcp_port);
+ } else {
+ saddr.sa6.sin6_port = aresx_sitous(channel->tcp_port);
+ }
+ memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6,
+ sizeof(server->addr.addrV6));
+ break;
+ default:
+ return -1; /* LCOV_EXCL_LINE */
+ }
+
+ /* Acquire a socket. */
+ s = ares__open_socket(channel, server->addr.family, SOCK_STREAM, 0);
+ if (s == ARES_SOCKET_BAD)
+ return -1;
+
+ /* Configure it. */
+ if (configure_socket(s, server->addr.family, channel) < 0)
+ {
+ ares__close_socket(channel, s);
+ return -1;
+ }
+
+#ifdef TCP_NODELAY
+ /*
+ * Disable the Nagle algorithm (only relevant for TCP sockets, and thus not
+ * in configure_socket). In general, in DNS lookups we're pretty much
+ * interested in firing off a single request and then waiting for a reply,
+ * so batching isn't very interesting.
+ */
+ opt = 1;
+ if (channel->sock_funcs == 0
+ &&
+ setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
+ (void *)&opt, sizeof(opt)) == -1)
+ {
+ ares__close_socket(channel, s);
+ return -1;
+ }
+#endif
+
+ if (channel->sock_config_cb)
+ {
+ int err = channel->sock_config_cb(s, SOCK_STREAM,
+ channel->sock_config_cb_data);
+ if (err < 0)
+ {
+ ares__close_socket(channel, s);
+ return err;
+ }
+ }
+
+ /* Connect to the server. */
+ if (ares__connect_socket(channel, s, sa, salen) == -1)
+ {
+ int err = SOCKERRNO;
+
+ if (err != EINPROGRESS && err != EWOULDBLOCK)
+ {
+ ares__close_socket(channel, s);
+ return -1;
+ }
+ }
+
+ if (channel->sock_create_cb)
+ {
+ int err = channel->sock_create_cb(s, SOCK_STREAM,
+ channel->sock_create_cb_data);
+ if (err < 0)
+ {
+ ares__close_socket(channel, s);
+ return err;
+ }
+ }
+
+ SOCK_STATE_CALLBACK(channel, s, 1, 0);
+ server->tcp_buffer_pos = 0;
+ server->tcp_socket = s;
+ server->tcp_connection_generation = ++channel->tcp_connection_generation;
+ return 0;
+}
+
+static int open_udp_socket(ares_channel channel, struct server_state *server)
+{
+ ares_socket_t s;
+ ares_socklen_t salen;
+ union {
+ struct sockaddr_in sa4;
+ struct sockaddr_in6 sa6;
+ } saddr;
+ struct sockaddr *sa;
+
+ switch (server->addr.family)
+ {
+ case AF_INET:
+ sa = (void *)&saddr.sa4;
+ salen = sizeof(saddr.sa4);
+ memset(sa, 0, salen);
+ saddr.sa4.sin_family = AF_INET;
+ if (server->addr.udp_port) {
+ saddr.sa4.sin_port = aresx_sitous(server->addr.udp_port);
+ } else {
+ saddr.sa4.sin_port = aresx_sitous(channel->udp_port);
+ }
+ memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4,
+ sizeof(server->addr.addrV4));
+ break;
+ case AF_INET6:
+ sa = (void *)&saddr.sa6;
+ salen = sizeof(saddr.sa6);
+ memset(sa, 0, salen);
+ saddr.sa6.sin6_family = AF_INET6;
+ if (server->addr.udp_port) {
+ saddr.sa6.sin6_port = aresx_sitous(server->addr.udp_port);
+ } else {
+ saddr.sa6.sin6_port = aresx_sitous(channel->udp_port);
+ }
+ memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6,
+ sizeof(server->addr.addrV6));
+ break;
+ default:
+ return -1; /* LCOV_EXCL_LINE */
+ }
+
+ /* Acquire a socket. */
+ s = ares__open_socket(channel, server->addr.family, SOCK_DGRAM, 0);
+ if (s == ARES_SOCKET_BAD)
+ return -1;
+
+ /* Set the socket non-blocking. */
+ if (configure_socket(s, server->addr.family, channel) < 0)
+ {
+ ares__close_socket(channel, s);
+ return -1;
+ }
+
+ if (channel->sock_config_cb)
+ {
+ int err = channel->sock_config_cb(s, SOCK_DGRAM,
+ channel->sock_config_cb_data);
+ if (err < 0)
+ {
+ ares__close_socket(channel, s);
+ return err;
+ }
+ }
+
+ /* Connect to the server. */
+ if (ares__connect_socket(channel, s, sa, salen) == -1)
+ {
+ int err = SOCKERRNO;
+
+ if (err != EINPROGRESS && err != EWOULDBLOCK)
+ {
+ ares__close_socket(channel, s);
+ return -1;
+ }
+ }
+
+ if (channel->sock_create_cb)
+ {
+ int err = channel->sock_create_cb(s, SOCK_DGRAM,
+ channel->sock_create_cb_data);
+ if (err < 0)
+ {
+ ares__close_socket(channel, s);
+ return err;
+ }
+ }
+
+ SOCK_STATE_CALLBACK(channel, s, 1, 0);
+
+ server->udp_socket = s;
+ return 0;
+}
+
+static int same_questions(const unsigned char *qbuf, int qlen,
+ const unsigned char *abuf, int alen)
+{
+ struct {
+ const unsigned char *p;
+ int qdcount;
+ char *name;
+ long namelen;
+ int type;
+ int dnsclass;
+ } q, a;
+ int i, j;
+
+ if (qlen < HFIXEDSZ || alen < HFIXEDSZ)
+ return 0;
+
+ /* Extract qdcount from the request and reply buffers and compare them. */
+ q.qdcount = DNS_HEADER_QDCOUNT(qbuf);
+ a.qdcount = DNS_HEADER_QDCOUNT(abuf);
+ if (q.qdcount != a.qdcount)
+ return 0;
+
+ /* For each question in qbuf, find it in abuf. */
+ q.p = qbuf + HFIXEDSZ;
+ for (i = 0; i < q.qdcount; i++)
+ {
+ /* Decode the question in the query. */
+ if (ares_expand_name(q.p, qbuf, qlen, &q.name, &q.namelen)
+ != ARES_SUCCESS)
+ return 0;
+ q.p += q.namelen;
+ if (q.p + QFIXEDSZ > qbuf + qlen)
+ {
+ ares_free(q.name);
+ return 0;
+ }
+ q.type = DNS_QUESTION_TYPE(q.p);
+ q.dnsclass = DNS_QUESTION_CLASS(q.p);
+ q.p += QFIXEDSZ;
+
+ /* Search for this question in the answer. */
+ a.p = abuf + HFIXEDSZ;
+ for (j = 0; j < a.qdcount; j++)
+ {
+ /* Decode the question in the answer. */
+ if (ares_expand_name(a.p, abuf, alen, &a.name, &a.namelen)
+ != ARES_SUCCESS)
+ {
+ ares_free(q.name);
+ return 0;
+ }
+ a.p += a.namelen;
+ if (a.p + QFIXEDSZ > abuf + alen)
+ {
+ ares_free(q.name);
+ ares_free(a.name);
+ return 0;
+ }
+ a.type = DNS_QUESTION_TYPE(a.p);
+ a.dnsclass = DNS_QUESTION_CLASS(a.p);
+ a.p += QFIXEDSZ;
+
+ /* Compare the decoded questions. */
+ if (strcasecmp(q.name, a.name) == 0 && q.type == a.type
+ && q.dnsclass == a.dnsclass)
+ {
+ ares_free(a.name);
+ break;
+ }
+ ares_free(a.name);
+ }
+
+ ares_free(q.name);
+ if (j == a.qdcount)
+ return 0;
+ }
+ return 1;
+}
+
+static int same_address(struct sockaddr *sa, struct ares_addr *aa)
+{
+ void *addr1;
+ void *addr2;
+
+ if (sa->sa_family == aa->family)
+ {
+ switch (aa->family)
+ {
+ case AF_INET:
+ addr1 = &aa->addrV4;
+ addr2 = &(CARES_INADDR_CAST(struct sockaddr_in *, sa))->sin_addr;
+ if (memcmp(addr1, addr2, sizeof(aa->addrV4)) == 0)
+ return 1; /* match */
+ break;
+ case AF_INET6:
+ addr1 = &aa->addrV6;
+ addr2 = &(CARES_INADDR_CAST(struct sockaddr_in6 *, sa))->sin6_addr;
+ if (memcmp(addr1, addr2, sizeof(aa->addrV6)) == 0)
+ return 1; /* match */
+ break;
+ default:
+ break; /* LCOV_EXCL_LINE */
+ }
+ }
+ return 0; /* different */
+}
+
+/* search for an OPT RR in the response */
+static int has_opt_rr(const unsigned char *abuf, int alen)
+{
+ unsigned int qdcount, ancount, nscount, arcount, i;
+ const unsigned char *aptr;
+ int status;
+
+ if (alen < HFIXEDSZ)
+ return -1;
+
+ /* Parse the answer header. */
+ qdcount = DNS_HEADER_QDCOUNT(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+ nscount = DNS_HEADER_NSCOUNT(abuf);
+ arcount = DNS_HEADER_ARCOUNT(abuf);
+
+ aptr = abuf + HFIXEDSZ;
+
+ /* skip the questions */
+ for (i = 0; i < qdcount; i++)
+ {
+ char* name;
+ long len;
+ status = ares_expand_name(aptr, abuf, alen, &name, &len);
+ if (status != ARES_SUCCESS)
+ return -1;
+ ares_free_string(name);
+ if (aptr + len + QFIXEDSZ > abuf + alen)
+ return -1;
+ aptr += len + QFIXEDSZ;
+ }
+
+ /* skip the ancount and nscount */
+ for (i = 0; i < ancount + nscount; i++)
+ {
+ char* name;
+ long len;
+ int dlen;
+ status = ares_expand_name(aptr, abuf, alen, &name, &len);
+ if (status != ARES_SUCCESS)
+ return -1;
+ ares_free_string(name);
+ if (aptr + len + RRFIXEDSZ > abuf + alen)
+ return -1;
+ aptr += len;
+ dlen = DNS_RR_LEN(aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + dlen > abuf + alen)
+ return -1;
+ aptr += dlen;
+ }
+
+ /* search for rr type (41) - opt */
+ for (i = 0; i < arcount; i++)
+ {
+ char* name;
+ long len;
+ int dlen;
+ status = ares_expand_name(aptr, abuf, alen, &name, &len);
+ if (status != ARES_SUCCESS)
+ return -1;
+ ares_free_string(name);
+ if (aptr + len + RRFIXEDSZ > abuf + alen)
+ return -1;
+ aptr += len;
+
+ if (DNS_RR_TYPE(aptr) == T_OPT)
+ return 1;
+
+ dlen = DNS_RR_LEN(aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + dlen > abuf + alen)
+ return -1;
+ aptr += dlen;
+ }
+
+ return 0;
+}
+
+static void end_query (ares_channel channel, struct query *query, int status,
+ unsigned char *abuf, int alen)
+{
+ int i;
+
+ /* First we check to see if this query ended while one of our send
+ * queues still has pointers to it.
+ */
+ for (i = 0; i < channel->nservers; i++)
+ {
+ struct server_state *server = &channel->servers[i];
+ struct send_request *sendreq;
+ for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
+ if (sendreq->owner_query == query)
+ {
+ sendreq->owner_query = NULL;
+ assert(sendreq->data_storage == NULL);
+ if (status == ARES_SUCCESS)
+ {
+ /* We got a reply for this query, but this queued sendreq
+ * points into this soon-to-be-gone query's tcpbuf. Probably
+ * this means we timed out and queued the query for
+ * retransmission, then received a response before actually
+ * retransmitting. This is perfectly fine, so we want to keep
+ * the connection running smoothly if we can. But in the worst
+ * case we may have sent only some prefix of the query, with
+ * some suffix of the query left to send. Also, the buffer may
+ * be queued on multiple queues. To prevent dangling pointers
+ * to the query's tcpbuf and handle these cases, we just give
+ * such sendreqs their own copy of the query packet.
+ */
+ sendreq->data_storage = ares_malloc(sendreq->len);
+ if (sendreq->data_storage != NULL)
+ {
+ memcpy(sendreq->data_storage, sendreq->data, sendreq->len);
+ sendreq->data = sendreq->data_storage;
+ }
+ }
+ if ((status != ARES_SUCCESS) || (sendreq->data_storage == NULL))
+ {
+ /* We encountered an error (probably a timeout, suggesting the
+ * DNS server we're talking to is probably unreachable,
+ * wedged, or severely overloaded) or we couldn't copy the
+ * request, so mark the connection as broken. When we get to
+ * process_broken_connections() we'll close the connection and
+ * try to re-send requests to another server.
+ */
+ server->is_broken = 1;
+ /* Just to be paranoid, zero out this sendreq... */
+ sendreq->data = NULL;
+ sendreq->len = 0;
+ }
+ }
+ }
+
+ /* Invoke the callback */
+ query->callback(query->arg, status, query->timeouts, abuf, alen);
+ ares__free_query(query);
+
+ /* Simple cleanup policy: if no queries are remaining, close all network
+ * sockets unless STAYOPEN is set.
+ */
+ if (!(channel->flags & ARES_FLAG_STAYOPEN) &&
+ ares__is_list_empty(&(channel->all_queries)))
+ {
+ for (i = 0; i < channel->nservers; i++)
+ ares__close_sockets(channel, &channel->servers[i]);
+ }
+}
+
+void ares__free_query(struct query *query)
+{
+ /* Remove the query from all the lists in which it is linked */
+ ares__remove_from_list(&(query->queries_by_qid));
+ ares__remove_from_list(&(query->queries_by_timeout));
+ ares__remove_from_list(&(query->queries_to_server));
+ ares__remove_from_list(&(query->all_queries));
+ /* Zero out some important stuff, to help catch bugs */
+ query->callback = NULL;
+ query->arg = NULL;
+ /* Deallocate the memory associated with the query */
+ ares_free(query->tcpbuf);
+ ares_free(query->server_info);
+ ares_free(query);
+}
+
+ares_socket_t ares__open_socket(ares_channel channel,
+ int af, int type, int protocol)
+{
+ if (channel->sock_funcs)
+ return channel->sock_funcs->asocket(af,
+ type,
+ protocol,
+ channel->sock_func_cb_data);
+ else
+ return socket(af, type, protocol);
+}
+
+int ares__connect_socket(ares_channel channel,
+ ares_socket_t sockfd,
+ const struct sockaddr *addr,
+ ares_socklen_t addrlen)
+{
+ if (channel->sock_funcs)
+ return channel->sock_funcs->aconnect(sockfd,
+ addr,
+ addrlen,
+ channel->sock_func_cb_data);
+ else
+ return connect(sockfd, addr, addrlen);
+}
+
+void ares__close_socket(ares_channel channel, ares_socket_t s)
+{
+ if (channel->sock_funcs)
+ channel->sock_funcs->aclose(s, channel->sock_func_cb_data);
+ else
+ sclose(s);
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_query.c b/grpc/third_party/cares/cares/src/lib/ares_query.c
new file mode 100644
index 00000000..508274db
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_query.c
@@ -0,0 +1,180 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+struct qquery {
+ ares_callback callback;
+ void *arg;
+};
+
+static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen);
+
+static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
+{
+ unsigned char x;
+ unsigned char y;
+ unsigned char* state;
+ unsigned char xorIndex;
+ int counter;
+
+ x = key->x;
+ y = key->y;
+
+ state = &key->state[0];
+ for(counter = 0; counter < buffer_len; counter ++)
+ {
+ x = (unsigned char)((x + 1) % 256);
+ y = (unsigned char)((state[x] + y) % 256);
+ ARES_SWAP_BYTE(&state[x], &state[y]);
+
+ xorIndex = (unsigned char)((state[x] + state[y]) % 256);
+
+ buffer_ptr[counter] = (unsigned char)(buffer_ptr[counter]^state[xorIndex]);
+ }
+ key->x = x;
+ key->y = y;
+}
+
+static struct query* find_query_by_id(ares_channel channel, unsigned short id)
+{
+ unsigned short qid;
+ struct list_node* list_head;
+ struct list_node* list_node;
+ DNS_HEADER_SET_QID(((unsigned char*)&qid), id);
+
+ /* Find the query corresponding to this packet. */
+ list_head = &(channel->queries_by_qid[qid % ARES_QID_TABLE_SIZE]);
+ for (list_node = list_head->next; list_node != list_head;
+ list_node = list_node->next)
+ {
+ struct query *q = list_node->data;
+ if (q->qid == qid)
+ return q;
+ }
+ return NULL;
+}
+
+
+/* a unique query id is generated using an rc4 key. Since the id may already
+ be used by a running query (as infrequent as it may be), a lookup is
+ performed per id generation. In practice this search should happen only
+ once per newly generated id
+*/
+static unsigned short generate_unique_id(ares_channel channel)
+{
+ unsigned short id;
+
+ do {
+ id = ares__generate_new_id(&channel->id_key);
+ } while (find_query_by_id(channel, id));
+
+ return (unsigned short)id;
+}
+
+unsigned short ares__generate_new_id(rc4_key* key)
+{
+ unsigned short r=0;
+ rc4(key, (unsigned char *)&r, sizeof(r));
+ return r;
+}
+
+void ares_query(ares_channel channel, const char *name, int dnsclass,
+ int type, ares_callback callback, void *arg)
+{
+ struct qquery *qquery;
+ unsigned char *qbuf;
+ int qlen, rd, status;
+
+ /* Compose the query. */
+ rd = !(channel->flags & ARES_FLAG_NORECURSE);
+ status = ares_create_query(name, dnsclass, type, channel->next_id, rd, &qbuf,
+ &qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0);
+ if (status != ARES_SUCCESS)
+ {
+ if (qbuf != NULL) ares_free(qbuf);
+ callback(arg, status, 0, NULL, 0);
+ return;
+ }
+
+ channel->next_id = generate_unique_id(channel);
+
+ /* Allocate and fill in the query structure. */
+ qquery = ares_malloc(sizeof(struct qquery));
+ if (!qquery)
+ {
+ ares_free_string(qbuf);
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+ qquery->callback = callback;
+ qquery->arg = arg;
+
+ /* Send it off. qcallback will be called when we get an answer. */
+ ares_send(channel, qbuf, qlen, qcallback, qquery);
+ ares_free_string(qbuf);
+}
+
+static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
+{
+ struct qquery *qquery = (struct qquery *) arg;
+ unsigned int ancount;
+ int rcode;
+
+ if (status != ARES_SUCCESS)
+ qquery->callback(qquery->arg, status, timeouts, abuf, alen);
+ else
+ {
+ /* Pull the response code and answer count from the packet. */
+ rcode = DNS_HEADER_RCODE(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+
+ /* Convert errors. */
+ switch (rcode)
+ {
+ case NOERROR:
+ status = (ancount > 0) ? ARES_SUCCESS : ARES_ENODATA;
+ break;
+ case FORMERR:
+ status = ARES_EFORMERR;
+ break;
+ case SERVFAIL:
+ status = ARES_ESERVFAIL;
+ break;
+ case NXDOMAIN:
+ status = ARES_ENOTFOUND;
+ break;
+ case NOTIMP:
+ status = ARES_ENOTIMP;
+ break;
+ case REFUSED:
+ status = ARES_EREFUSED;
+ break;
+ }
+ qquery->callback(qquery->arg, status, timeouts, abuf, alen);
+ }
+ ares_free(qquery);
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_search.c b/grpc/third_party/cares/cares/src/lib/ares_search.c
new file mode 100644
index 00000000..c4b0424f
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_search.c
@@ -0,0 +1,321 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_private.h"
+
+struct search_query {
+ /* Arguments passed to ares_search */
+ ares_channel channel;
+ char *name; /* copied into an allocated buffer */
+ int dnsclass;
+ int type;
+ ares_callback callback;
+ void *arg;
+
+ int status_as_is; /* error status from trying as-is */
+ int next_domain; /* next search domain to try */
+ int trying_as_is; /* current query is for name as-is */
+ int timeouts; /* number of timeouts we saw for this request */
+ int ever_got_nodata; /* did we ever get ARES_ENODATA along the way? */
+};
+
+static void search_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen);
+static void end_squery(struct search_query *squery, int status,
+ unsigned char *abuf, int alen);
+
+void ares_search(ares_channel channel, const char *name, int dnsclass,
+ int type, ares_callback callback, void *arg)
+{
+ struct search_query *squery;
+ char *s;
+ const char *p;
+ int status, ndots;
+
+ /* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
+ if (ares__is_onion_domain(name))
+ {
+ callback(arg, ARES_ENOTFOUND, 0, NULL, 0);
+ return;
+ }
+
+ /* If name only yields one domain to search, then we don't have
+ * to keep extra state, so just do an ares_query().
+ */
+ status = ares__single_domain(channel, name, &s);
+ if (status != ARES_SUCCESS)
+ {
+ callback(arg, status, 0, NULL, 0);
+ return;
+ }
+ if (s)
+ {
+ ares_query(channel, s, dnsclass, type, callback, arg);
+ ares_free(s);
+ return;
+ }
+
+ /* Allocate a search_query structure to hold the state necessary for
+ * doing multiple lookups.
+ */
+ squery = ares_malloc(sizeof(struct search_query));
+ if (!squery)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+ squery->channel = channel;
+ squery->name = ares_strdup(name);
+ if (!squery->name)
+ {
+ ares_free(squery);
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+ squery->dnsclass = dnsclass;
+ squery->type = type;
+ squery->status_as_is = -1;
+ squery->callback = callback;
+ squery->arg = arg;
+ squery->timeouts = 0;
+ squery->ever_got_nodata = 0;
+
+ /* Count the number of dots in name. */
+ ndots = 0;
+ for (p = name; *p; p++)
+ {
+ if (*p == '.')
+ ndots++;
+ }
+
+ /* If ndots is at least the channel ndots threshold (usually 1),
+ * then we try the name as-is first. Otherwise, we try the name
+ * as-is last.
+ */
+ if (ndots >= channel->ndots)
+ {
+ /* Try the name as-is first. */
+ squery->next_domain = 0;
+ squery->trying_as_is = 1;
+ ares_query(channel, name, dnsclass, type, search_callback, squery);
+ }
+ else
+ {
+ /* Try the name as-is last; start with the first search domain. */
+ squery->next_domain = 1;
+ squery->trying_as_is = 0;
+ status = ares__cat_domain(name, channel->domains[0], &s);
+ if (status == ARES_SUCCESS)
+ {
+ ares_query(channel, s, dnsclass, type, search_callback, squery);
+ ares_free(s);
+ }
+ else
+ {
+ /* failed, free the malloc()ed memory */
+ ares_free(squery->name);
+ ares_free(squery);
+ callback(arg, status, 0, NULL, 0);
+ }
+ }
+}
+
+static void search_callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen)
+{
+ struct search_query *squery = (struct search_query *) arg;
+ ares_channel channel = squery->channel;
+ char *s;
+
+ squery->timeouts += timeouts;
+
+ /* Stop searching unless we got a non-fatal error. */
+ if (status != ARES_ENODATA && status != ARES_ESERVFAIL
+ && status != ARES_ENOTFOUND)
+ end_squery(squery, status, abuf, alen);
+ else
+ {
+ /* Save the status if we were trying as-is. */
+ if (squery->trying_as_is)
+ squery->status_as_is = status;
+
+ /*
+ * If we ever get ARES_ENODATA along the way, record that; if the search
+ * should run to the very end and we got at least one ARES_ENODATA,
+ * then callers like ares_gethostbyname() may want to try a T_A search
+ * even if the last domain we queried for T_AAAA resource records
+ * returned ARES_ENOTFOUND.
+ */
+ if (status == ARES_ENODATA)
+ squery->ever_got_nodata = 1;
+
+ if (squery->next_domain < channel->ndomains)
+ {
+ /* Try the next domain. */
+ status = ares__cat_domain(squery->name,
+ channel->domains[squery->next_domain], &s);
+ if (status != ARES_SUCCESS)
+ end_squery(squery, status, NULL, 0);
+ else
+ {
+ squery->trying_as_is = 0;
+ squery->next_domain++;
+ ares_query(channel, s, squery->dnsclass, squery->type,
+ search_callback, squery);
+ ares_free(s);
+ }
+ }
+ else if (squery->status_as_is == -1)
+ {
+ /* Try the name as-is at the end. */
+ squery->trying_as_is = 1;
+ ares_query(channel, squery->name, squery->dnsclass, squery->type,
+ search_callback, squery);
+ }
+ else {
+ if (squery->status_as_is == ARES_ENOTFOUND && squery->ever_got_nodata) {
+ end_squery(squery, ARES_ENODATA, NULL, 0);
+ }
+ else
+ end_squery(squery, squery->status_as_is, NULL, 0);
+ }
+ }
+}
+
+static void end_squery(struct search_query *squery, int status,
+ unsigned char *abuf, int alen)
+{
+ squery->callback(squery->arg, status, squery->timeouts, abuf, alen);
+ ares_free(squery->name);
+ ares_free(squery);
+}
+
+/* Concatenate two domains. */
+int ares__cat_domain(const char *name, const char *domain, char **s)
+{
+ size_t nlen = strlen(name);
+ size_t dlen = strlen(domain);
+
+ *s = ares_malloc(nlen + 1 + dlen + 1);
+ if (!*s)
+ return ARES_ENOMEM;
+ memcpy(*s, name, nlen);
+ (*s)[nlen] = '.';
+ memcpy(*s + nlen + 1, domain, dlen);
+ (*s)[nlen + 1 + dlen] = 0;
+ return ARES_SUCCESS;
+}
+
+/* Determine if this name only yields one query. If it does, set *s to
+ * the string we should query, in an allocated buffer. If not, set *s
+ * to NULL.
+ */
+int ares__single_domain(ares_channel channel, const char *name, char **s)
+{
+ size_t len = strlen(name);
+ const char *hostaliases;
+ FILE *fp;
+ char *line = NULL;
+ int status;
+ size_t linesize;
+ const char *p, *q;
+ int error;
+
+ /* If the name contains a trailing dot, then the single query is the name
+ * sans the trailing dot.
+ */
+ if ((len > 0) && (name[len - 1] == '.'))
+ {
+ *s = ares_strdup(name);
+ return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
+ }
+
+ if (!(channel->flags & ARES_FLAG_NOALIASES) && !strchr(name, '.'))
+ {
+ /* The name might be a host alias. */
+ hostaliases = getenv("HOSTALIASES");
+ if (hostaliases)
+ {
+ fp = fopen(hostaliases, "r");
+ if (fp)
+ {
+ while ((status = ares__read_line(fp, &line, &linesize))
+ == ARES_SUCCESS)
+ {
+ if (strncasecmp(line, name, len) != 0 ||
+ !ISSPACE(line[len]))
+ continue;
+ p = line + len;
+ while (ISSPACE(*p))
+ p++;
+ if (*p)
+ {
+ q = p + 1;
+ while (*q && !ISSPACE(*q))
+ q++;
+ *s = ares_malloc(q - p + 1);
+ if (*s)
+ {
+ memcpy(*s, p, q - p);
+ (*s)[q - p] = 0;
+ }
+ ares_free(line);
+ fclose(fp);
+ return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
+ }
+ }
+ ares_free(line);
+ fclose(fp);
+ if (status != ARES_SUCCESS && status != ARES_EOF)
+ return status;
+ }
+ else
+ {
+ error = ERRNO;
+ switch(error)
+ {
+ case ENOENT:
+ case ESRCH:
+ break;
+ default:
+ DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
+ error, strerror(error)));
+ DEBUGF(fprintf(stderr, "Error opening file: %s\n",
+ hostaliases));
+ *s = NULL;
+ return ARES_EFILE;
+ }
+ }
+ }
+ }
+
+ if (channel->flags & ARES_FLAG_NOSEARCH || channel->ndomains == 0)
+ {
+ /* No domain search to do; just try the name as-is. */
+ *s = ares_strdup(name);
+ return (*s) ? ARES_SUCCESS : ARES_ENOMEM;
+ }
+
+ *s = NULL;
+ return ARES_SUCCESS;
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_send.c b/grpc/third_party/cares/cares/src/lib/ares_send.c
new file mode 100644
index 00000000..75ba9e4c
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_send.c
@@ -0,0 +1,131 @@
+
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_private.h"
+
+void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
+ ares_callback callback, void *arg)
+{
+ struct query *query;
+ int i, packetsz;
+ struct timeval now;
+
+ /* Verify that the query is at least long enough to hold the header. */
+ if (qlen < HFIXEDSZ || qlen >= (1 << 16))
+ {
+ callback(arg, ARES_EBADQUERY, 0, NULL, 0);
+ return;
+ }
+
+ /* Allocate space for query and allocated fields. */
+ query = ares_malloc(sizeof(struct query));
+ if (!query)
+ {
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+ query->tcpbuf = ares_malloc(qlen + 2);
+ if (!query->tcpbuf)
+ {
+ ares_free(query);
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+ if (channel->nservers < 1)
+ {
+ ares_free(query);
+ callback(arg, ARES_ESERVFAIL, 0, NULL, 0);
+ return;
+ }
+ query->server_info = ares_malloc(channel->nservers *
+ sizeof(query->server_info[0]));
+ if (!query->server_info)
+ {
+ ares_free(query->tcpbuf);
+ ares_free(query);
+ callback(arg, ARES_ENOMEM, 0, NULL, 0);
+ return;
+ }
+
+ /* Compute the query ID. Start with no timeout. */
+ query->qid = DNS_HEADER_QID(qbuf);
+ query->timeout.tv_sec = 0;
+ query->timeout.tv_usec = 0;
+
+ /* Form the TCP query buffer by prepending qlen (as two
+ * network-order bytes) to qbuf.
+ */
+ query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
+ query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
+ memcpy(query->tcpbuf + 2, qbuf, qlen);
+ query->tcplen = qlen + 2;
+
+ /* Fill in query arguments. */
+ query->qbuf = query->tcpbuf + 2;
+ query->qlen = qlen;
+ query->callback = callback;
+ query->arg = arg;
+
+ /* Initialize query status. */
+ query->try_count = 0;
+
+ /* Choose the server to send the query to. If rotation is enabled, keep track
+ * of the next server we want to use. */
+ query->server = channel->last_server;
+ if (channel->rotate == 1)
+ channel->last_server = (channel->last_server + 1) % channel->nservers;
+
+ for (i = 0; i < channel->nservers; i++)
+ {
+ query->server_info[i].skip_server = 0;
+ query->server_info[i].tcp_connection_generation = 0;
+ }
+
+ packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
+ query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
+
+ query->error_status = ARES_ECONNREFUSED;
+ query->timeouts = 0;
+
+ /* Initialize our list nodes. */
+ ares__init_list_node(&(query->queries_by_qid), query);
+ ares__init_list_node(&(query->queries_by_timeout), query);
+ ares__init_list_node(&(query->queries_to_server), query);
+ ares__init_list_node(&(query->all_queries), query);
+
+ /* Chain the query into the list of all queries. */
+ ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
+ /* Keep track of queries bucketed by qid, so we can process DNS
+ * responses quickly.
+ */
+ ares__insert_in_list(
+ &(query->queries_by_qid),
+ &(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
+
+ /* Perform the first query action. */
+ now = ares__tvnow();
+ ares__send_query(channel, query, &now);
+}
diff --git a/grpc/third_party/cares/cares/src/lib/ares_setup.h b/grpc/third_party/cares/cares/src/lib/ares_setup.h
new file mode 100644
index 00000000..6ad2cee6
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_setup.h
@@ -0,0 +1,220 @@
+#ifndef HEADER_CARES_SETUP_H
+#define HEADER_CARES_SETUP_H
+
+
+/* Copyright (C) 2004 - 2012 by Daniel Stenberg et al
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/*
+ * Define WIN32 when build target is Win32 API
+ */
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+#define WIN32
+#endif
+
+/*
+ * Include configuration script results or hand-crafted
+ * configuration file for platforms which lack config tool.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "ares_config.h"
+#else
+
+#ifdef WIN32
+#include "config-win32.h"
+#endif
+
+#endif /* HAVE_CONFIG_H */
+
+/* ================================================================ */
+/* Definition of preprocessor macros/symbols which modify compiler */
+/* behaviour or generated code characteristics must be done here, */
+/* as appropriate, before any system header file is included. It is */
+/* also possible to have them defined in the config file included */
+/* before this point. As a result of all this we frown inclusion of */
+/* system header files in our config files, avoid this at any cost. */
+/* ================================================================ */
+
+/*
+ * AIX 4.3 and newer needs _THREAD_SAFE defined to build
+ * proper reentrant code. Others may also need it.
+ */
+
+#ifdef NEED_THREAD_SAFE
+# ifndef _THREAD_SAFE
+# define _THREAD_SAFE
+# endif
+#endif
+
+/*
+ * Tru64 needs _REENTRANT set for a few function prototypes and
+ * things to appear in the system header files. Unixware needs it
+ * to build proper reentrant code. Others may also need it.
+ */
+
+#ifdef NEED_REENTRANT
+# ifndef _REENTRANT
+# define _REENTRANT
+# endif
+#endif
+
+/* ================================================================ */
+/* If you need to include a system header file for your platform, */
+/* please, do it beyond the point further indicated in this file. */
+/* ================================================================ */
+
+/*
+ * c-ares external interface definitions are also used internally,
+ * and might also include required system header files to define them.
+ */
+
+#include <ares_build.h>
+
+/*
+ * Compile time sanity checks must also be done when building the library.
+ */
+
+#include <ares_rules.h>
+
+/* ================================================================= */
+/* No system header file shall be included in this file before this */
+/* point. The only allowed ones are those included from ares_build.h */
+/* ================================================================= */
+
+/*
+ * Include header files for windows builds before redefining anything.
+ * Use this preproessor block only to include or exclude windows.h,
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
+ * to any other further and independent block. Under Cygwin things work
+ * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
+ * never be included when __CYGWIN__ is defined. configure script takes
+ * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
+ * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
+ */
+
+#ifdef HAVE_WINDOWS_H
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# ifdef HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+# endif
+# else
+# ifdef HAVE_WINSOCK_H
+# include <winsock.h>
+# endif
+# endif
+#endif
+
+/*
+ * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
+ * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
+ * undefine USE_WINSOCK.
+ */
+
+#undef USE_WINSOCK
+
+#ifdef HAVE_WINSOCK2_H
+# define USE_WINSOCK 2
+#else
+# ifdef HAVE_WINSOCK_H
+# define USE_WINSOCK 1
+# endif
+#endif
+
+/*
+ * Work-arounds for systems without configure support
+ */
+
+#ifndef HAVE_CONFIG_H
+
+#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
+#define HAVE_SYS_TIME_H
+#endif
+
+#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
+#define HAVE_UNISTD_H 1
+#endif
+
+#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
+#define HAVE_SYS_UIO_H
+#endif
+
+#endif /* HAVE_CONFIG_H */
+
+/*
+ * Arg 2 type for gethostname in case it hasn't been defined in config file.
+ */
+
+#ifndef GETHOSTNAME_TYPE_ARG2
+# ifdef USE_WINSOCK
+# define GETHOSTNAME_TYPE_ARG2 int
+# else
+# define GETHOSTNAME_TYPE_ARG2 size_t
+# endif
+#endif
+
+#ifdef __POCC__
+# include <sys/types.h>
+# include <unistd.h>
+# define ESRCH 3
+#endif
+
+/*
+ * Android does have the arpa/nameser.h header which is detected by configure
+ * but it appears to be empty with recent NDK r7b / r7c, so we undefine here.
+ * z/OS does have the arpa/nameser.h header which is detected by configure
+ * but it is not fully implemented and missing identifiers, so udefine here.
+ */
+#if (defined(ANDROID) || defined(__ANDROID__) || defined(__MVS__)) && \
+ defined(HAVE_ARPA_NAMESER_H)
+# undef HAVE_ARPA_NAMESER_H
+#endif
+
+/*
+ * Recent autoconf versions define these symbols in ares_config.h. We don't
+ * want them (since they collide with the libcurl ones when we build
+ * --enable-debug) so we undef them again here.
+ */
+
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef VERSION
+#undef PACKAGE
+
+/* IPv6 compatibility */
+#if !defined(HAVE_AF_INET6)
+#if defined(HAVE_PF_INET6)
+#define AF_INET6 PF_INET6
+#else
+#define AF_INET6 AF_MAX+1
+#endif
+#endif
+
+/*
+ * Include macros and defines that should only be processed once.
+ */
+
+#ifndef __SETUP_ONCE_H
+#include "setup_once.h"
+#endif
+
+#endif /* HEADER_CARES_SETUP_H */
diff --git a/grpc/third_party/cares/cares/ares_strcasecmp.c b/grpc/third_party/cares/cares/src/lib/ares_strcasecmp.c
index f9c85e20..f9c85e20 100644
--- a/grpc/third_party/cares/cares/ares_strcasecmp.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_strcasecmp.c
diff --git a/grpc/third_party/cares/cares/ares_strcasecmp.h b/grpc/third_party/cares/cares/src/lib/ares_strcasecmp.h
index 57d86f96..57d86f96 100644
--- a/grpc/third_party/cares/cares/ares_strcasecmp.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_strcasecmp.h
diff --git a/grpc/third_party/cares/cares/ares_strdup.c b/grpc/third_party/cares/cares/src/lib/ares_strdup.c
index 0c3dcffc..0c3dcffc 100644
--- a/grpc/third_party/cares/cares/ares_strdup.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_strdup.c
diff --git a/grpc/third_party/cares/cares/ares_strdup.h b/grpc/third_party/cares/cares/src/lib/ares_strdup.h
index 67f2a74f..67f2a74f 100644
--- a/grpc/third_party/cares/cares/ares_strdup.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_strdup.h
diff --git a/grpc/third_party/cares/cares/ares_strerror.c b/grpc/third_party/cares/cares/src/lib/ares_strerror.c
index c3ecbd7b..c3ecbd7b 100644
--- a/grpc/third_party/cares/cares/ares_strerror.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_strerror.c
diff --git a/grpc/third_party/cares/cares/src/lib/ares_strsplit.c b/grpc/third_party/cares/cares/src/lib/ares_strsplit.c
new file mode 100644
index 00000000..97b4e5d5
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/ares_strsplit.c
@@ -0,0 +1,178 @@
+/* Copyright (C) 2018 by John Schember <john@nachtimwald.com>
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#if defined(__MVS__)
+#include <strings.h>
+#endif
+
+#include "ares_setup.h"
+#include "ares_strsplit.h"
+#include "ares.h"
+#include "ares_private.h"
+
+static int list_contains(char * const *list, size_t num_elem, const char *str, int insensitive)
+{
+ size_t len;
+ size_t i;
+
+ len = strlen(str);
+ for (i=0; i<num_elem; i++)
+ {
+ if (insensitive)
+ {
+#ifdef WIN32
+ if (strnicmp(list[i], str, len) == 0)
+#else
+ if (strncasecmp(list[i], str, len) == 0)
+#endif
+ return 1;
+ }
+ else
+ {
+ if (strncmp(list[i], str, len) == 0)
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int is_delim(char c, const char *delims, size_t num_delims)
+{
+ size_t i;
+
+ for (i=0; i<num_delims; i++)
+ {
+ if (c == delims[i])
+ return 1;
+ }
+ return 0;
+}
+
+
+void ares_strsplit_free(char **elms, size_t num_elm)
+{
+ size_t i;
+
+ if (elms == NULL)
+ return;
+
+ for (i=0; i<num_elm; i++)
+ ares_free(elms[i]);
+ ares_free(elms);
+}
+
+
+char **ares_strsplit(const char *in, const char *delms, int make_set, size_t *num_elm)
+{
+ char *parsestr;
+ char **temp;
+ char **out;
+ size_t cnt;
+ size_t nelms;
+ size_t in_len;
+ size_t num_delims;
+ size_t i;
+
+ if (in == NULL || delms == NULL || num_elm == NULL)
+ return NULL;
+
+ *num_elm = 0;
+
+ in_len = strlen(in);
+ num_delims = strlen(delms);
+
+ /* Figure out how many elements. */
+ nelms = 1;
+ for (i=0; i<in_len; i++)
+ {
+ if (is_delim(in[i], delms, num_delims))
+ {
+ nelms++;
+ }
+ }
+
+ /* Copy of input so we can cut it up. */
+ parsestr = ares_strdup(in);
+ if (parsestr == NULL)
+ return NULL;
+
+ /* Temporary array to store locations of start of each element
+ * within parsestr. */
+ temp = ares_malloc(nelms * sizeof(*temp));
+ if (temp == NULL)
+ {
+ ares_free(parsestr);
+ return NULL;
+ }
+ temp[0] = parsestr;
+ cnt = 1;
+ for (i=0; i<in_len && cnt<nelms; i++)
+ {
+ if (!is_delim(parsestr[i], delms, num_delims))
+ continue;
+
+ /* Replace sep with NULL. */
+ parsestr[i] = '\0';
+ /* Add the pointer to the array of elements */
+ temp[cnt] = parsestr+i+1;
+ cnt++;
+ }
+
+ /* Copy each element to our output array. */
+ out = ares_malloc(nelms * sizeof(*out));
+ if (out == NULL)
+ {
+ ares_free(parsestr);
+ ares_free(temp);
+ return NULL;
+ }
+
+ nelms = 0;
+ for (i=0; i<cnt; i++)
+ {
+ if (temp[i][0] == '\0')
+ continue;
+
+ if (make_set && list_contains(out, nelms, temp[i], 1))
+ continue;
+
+ out[nelms] = ares_strdup(temp[i]);
+ if (out[nelms] == NULL)
+ {
+ ares_strsplit_free(out, nelms);
+ ares_free(parsestr);
+ ares_free(temp);
+ return NULL;
+ }
+ nelms++;
+ }
+
+
+ /* If there are no elements don't return an empty allocated
+ * array. */
+ if (nelms == 0)
+ {
+ ares_strsplit_free(out, nelms);
+ out = NULL;
+ }
+
+ /* Get the true number of elements (recalculated because of make_set) */
+ *num_elm = nelms;
+
+ ares_free(parsestr);
+ ares_free(temp);
+ return out;
+}
diff --git a/grpc/third_party/cares/cares/ares_strsplit.h b/grpc/third_party/cares/cares/src/lib/ares_strsplit.h
index e00fd14d..e00fd14d 100644
--- a/grpc/third_party/cares/cares/ares_strsplit.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_strsplit.h
diff --git a/grpc/third_party/cares/cares/ares_timeout.c b/grpc/third_party/cares/cares/src/lib/ares_timeout.c
index 293e4af0..293e4af0 100644
--- a/grpc/third_party/cares/cares/ares_timeout.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_timeout.c
diff --git a/grpc/third_party/cares/cares/ares_version.c b/grpc/third_party/cares/cares/src/lib/ares_version.c
index 4f8c42f2..4f8c42f2 100644
--- a/grpc/third_party/cares/cares/ares_version.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_version.c
diff --git a/grpc/third_party/cares/cares/ares_writev.c b/grpc/third_party/cares/cares/src/lib/ares_writev.c
index e812c09e..e812c09e 100644
--- a/grpc/third_party/cares/cares/ares_writev.c
+++ b/grpc/third_party/cares/cares/src/lib/ares_writev.c
diff --git a/grpc/third_party/cares/cares/ares_writev.h b/grpc/third_party/cares/cares/src/lib/ares_writev.h
index 65cea870..65cea870 100644
--- a/grpc/third_party/cares/cares/ares_writev.h
+++ b/grpc/third_party/cares/cares/src/lib/ares_writev.h
diff --git a/grpc/third_party/cares/cares/bitncmp.c b/grpc/third_party/cares/cares/src/lib/bitncmp.c
index 1468d492..1468d492 100644
--- a/grpc/third_party/cares/cares/bitncmp.c
+++ b/grpc/third_party/cares/cares/src/lib/bitncmp.c
diff --git a/grpc/third_party/cares/cares/bitncmp.h b/grpc/third_party/cares/cares/src/lib/bitncmp.h
index 7b8d66c1..7b8d66c1 100644
--- a/grpc/third_party/cares/cares/bitncmp.h
+++ b/grpc/third_party/cares/cares/src/lib/bitncmp.h
diff --git a/grpc/third_party/cares/cares/src/lib/cares.rc b/grpc/third_party/cares/cares/src/lib/cares.rc
new file mode 100644
index 00000000..7da7e11a
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/cares.rc
@@ -0,0 +1,65 @@
+
+/* Copyright (C) 2009-2016 by Daniel Stenberg
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include <winver.h>
+#include "../../include/ares_version.h"
+
+LANGUAGE 0x09,0x01
+
+#define RC_VERSION ARES_VERSION_MAJOR, ARES_VERSION_MINOR, ARES_VERSION_PATCH, 0
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION RC_VERSION
+ PRODUCTVERSION RC_VERSION
+ FILEFLAGSMASK 0x3fL
+#if defined(DEBUGBUILD) || defined(_DEBUG)
+ FILEFLAGS 1
+#else
+ FILEFLAGS 0
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "The c-ares library, https://c-ares.haxx.se/\0"
+#if defined(DEBUGBUILD) || defined(_DEBUG)
+ VALUE "FileDescription", "c-ares Debug Shared Library\0"
+ VALUE "FileVersion", ARES_VERSION_STR "\0"
+ VALUE "InternalName", "c-ares\0"
+ VALUE "OriginalFilename", "caresd.dll\0"
+#else
+ VALUE "FileDescription", "c-ares Shared Library\0"
+ VALUE "FileVersion", ARES_VERSION_STR "\0"
+ VALUE "InternalName", "c-ares\0"
+ VALUE "OriginalFilename", "cares.dll\0"
+#endif
+ VALUE "ProductName", "The c-ares library\0"
+ VALUE "ProductVersion", ARES_VERSION_STR "\0"
+ VALUE "LegalCopyright", "© " ARES_COPYRIGHT "\0"
+ VALUE "License", "https://c-ares.haxx.se/license.html\0"
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/grpc/third_party/cares/cares/src/lib/config-dos.h b/grpc/third_party/cares/cares/src/lib/config-dos.h
new file mode 100644
index 00000000..b241d69a
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/config-dos.h
@@ -0,0 +1,115 @@
+#ifndef HEADER_CONFIG_DOS_H
+#define HEADER_CONFIG_DOS_H
+
+
+/* ================================================================ */
+/* ares/config-dos.h - Hand crafted config file for DOS */
+/* ================================================================ */
+
+#define PACKAGE "c-ares"
+
+#define HAVE_ERRNO_H 1
+#define HAVE_GETENV 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_IOCTLSOCKET 1
+#define HAVE_IOCTLSOCKET_FIONBIO 1
+#define HAVE_LIMITS_H 1
+#define HAVE_NET_IF_H 1
+#define HAVE_RECV 1
+#define HAVE_RECVFROM 1
+#define HAVE_SEND 1
+#define HAVE_STRDUP 1
+#define HAVE_STRICMP 1
+#define HAVE_STRUCT_IN6_ADDR 1
+#define HAVE_STRUCT_TIMEVAL 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_SOCKET_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_TIME_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_WRITEV 1
+
+#define NEED_MALLOC_H 1
+
+#define RETSIGTYPE void
+#define TIME_WITH_SYS_TIME 1
+
+/* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */
+
+#define SEND_TYPE_ARG1 int
+#define SEND_QUAL_ARG2 const
+#define SEND_TYPE_ARG2 void *
+#define SEND_TYPE_ARG3 int
+#define SEND_TYPE_ARG4 int
+#define SEND_TYPE_RETV int
+
+#define RECV_TYPE_ARG1 int
+#define RECV_TYPE_ARG2 void *
+#define RECV_TYPE_ARG3 int
+#define RECV_TYPE_ARG4 int
+#define RECV_TYPE_RETV int
+
+#define RECVFROM_TYPE_ARG1 int
+#define RECVFROM_TYPE_ARG2 void
+#define RECVFROM_TYPE_ARG3 int
+#define RECVFROM_TYPE_ARG4 int
+#define RECVFROM_TYPE_ARG5 struct sockaddr
+#define RECVFROM_TYPE_ARG6 int
+#define RECVFROM_TYPE_RETV int
+#define RECVFROM_TYPE_ARG2_IS_VOID 1
+
+#define BSD
+
+/* Target HAVE_x section */
+
+#if defined(DJGPP)
+ #undef _SSIZE_T
+ #include <sys/types.h> /* For 'ssize_t' */
+
+ #define HAVE_STRCASECMP 1
+ #define HAVE_STRNCASECMP 1
+ #define HAVE_SYS_TIME_H 1
+ #define HAVE_VARIADIC_MACROS_GCC 1
+
+ /* Because djgpp <= 2.03 doesn't have snprintf() etc. */
+ #if (DJGPP_MINOR < 4)
+ #define _MPRINTF_REPLACE
+ #endif
+
+#elif defined(__WATCOMC__)
+ #define HAVE_STRCASECMP 1
+
+#elif defined(__HIGHC__)
+ #define HAVE_SYS_TIME_H 1
+ #define strerror(e) strerror_s_((e))
+#endif
+
+#ifdef WATT32
+ #define HAVE_AF_INET6 1
+ #define HAVE_ARPA_INET_H 1
+ #define HAVE_ARPA_NAMESER_H 1
+ #define HAVE_CLOSE_S 1
+ #define HAVE_GETHOSTNAME 1
+ #define HAVE_NETDB_H 1
+ #define HAVE_NETINET_IN_H 1
+ #define HAVE_NETINET_TCP_H 1
+ #define HAVE_PF_INET6 1
+ #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+ #define HAVE_STRUCT_ADDRINFO 1
+ #define HAVE_STRUCT_IN6_ADDR 1
+ #define HAVE_STRUCT_SOCKADDR_IN6 1
+ #define HAVE_SYS_SOCKET_H 1
+ #define HAVE_SYS_UIO_H 1
+ #define NS_INADDRSZ 4
+ #define HAVE_STRUCT_SOCKADDR_IN6 1
+
+ #define HAVE_GETSERVBYPORT_R 1
+ #define GETSERVBYPORT_R_ARGS 5
+#endif
+
+#undef word
+#undef byte
+
+#endif /* HEADER_CONFIG_DOS_H */
+
diff --git a/grpc/third_party/cares/cares/config-win32.h b/grpc/third_party/cares/cares/src/lib/config-win32.h
index cc8e4430..cc8e4430 100644
--- a/grpc/third_party/cares/cares/config-win32.h
+++ b/grpc/third_party/cares/cares/src/lib/config-win32.h
diff --git a/grpc/third_party/cares/cares/src/lib/inet_net_pton.c b/grpc/third_party/cares/cares/src/lib/inet_net_pton.c
new file mode 100644
index 00000000..840de506
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/inet_net_pton.c
@@ -0,0 +1,444 @@
+
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_ipv6.h"
+#include "ares_nowarn.h"
+#include "ares_inet_net_pton.h"
+
+
+const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+
+
+#ifndef HAVE_INET_NET_PTON
+
+/*
+ * static int
+ * inet_net_pton_ipv4(src, dst, size)
+ * convert IPv4 network number from presentation to network format.
+ * accepts hex octets, hex strings, decimal octets, and /CIDR.
+ * "size" is in bytes and describes "dst".
+ * return:
+ * number of bits, either imputed classfully or specified with /CIDR,
+ * or -1 if some failure occurred (check errno). ENOENT means it was
+ * not an IPv4 network specification.
+ * note:
+ * network byte order assumed. this means 192.5.5.240/28 has
+ * 0b11110000 in its fourth octet.
+ * note:
+ * On Windows we store the error in the thread errno, not
+ * in the winsock error code. This is to avoid loosing the
+ * actual last winsock error. So use macro ERRNO to fetch the
+ * errno this funtion sets when returning (-1), not SOCKERRNO.
+ * author:
+ * Paul Vixie (ISC), June 1996
+ */
+static int
+inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
+{
+ static const char xdigits[] = "0123456789abcdef";
+ static const char digits[] = "0123456789";
+ int n, ch, tmp = 0, dirty, bits;
+ const unsigned char *odst = dst;
+
+ ch = *src++;
+ if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
+ && ISASCII(src[1])
+ && ISXDIGIT(src[1])) {
+ /* Hexadecimal: Eat nybble string. */
+ if (!size)
+ goto emsgsize;
+ dirty = 0;
+ src++; /* skip x or X. */
+ while ((ch = *src++) != '\0' && ISASCII(ch) && ISXDIGIT(ch)) {
+ if (ISUPPER(ch))
+ ch = tolower(ch);
+ n = aresx_sztosi(strchr(xdigits, ch) - xdigits);
+ if (dirty == 0)
+ tmp = n;
+ else
+ tmp = (tmp << 4) | n;
+ if (++dirty == 2) {
+ if (!size--)
+ goto emsgsize;
+ *dst++ = (unsigned char) tmp;
+ dirty = 0;
+ }
+ }
+ if (dirty) { /* Odd trailing nybble? */
+ if (!size--)
+ goto emsgsize;
+ *dst++ = (unsigned char) (tmp << 4);
+ }
+ } else if (ISASCII(ch) && ISDIGIT(ch)) {
+ /* Decimal: eat dotted digit string. */
+ for (;;) {
+ tmp = 0;
+ do {
+ n = aresx_sztosi(strchr(digits, ch) - digits);
+ tmp *= 10;
+ tmp += n;
+ if (tmp > 255)
+ goto enoent;
+ } while ((ch = *src++) != '\0' &&
+ ISASCII(ch) && ISDIGIT(ch));
+ if (!size--)
+ goto emsgsize;
+ *dst++ = (unsigned char) tmp;
+ if (ch == '\0' || ch == '/')
+ break;
+ if (ch != '.')
+ goto enoent;
+ ch = *src++;
+ if (!ISASCII(ch) || !ISDIGIT(ch))
+ goto enoent;
+ }
+ } else
+ goto enoent;
+
+ bits = -1;
+ if (ch == '/' && ISASCII(src[0]) &&
+ ISDIGIT(src[0]) && dst > odst) {
+ /* CIDR width specifier. Nothing can follow it. */
+ ch = *src++; /* Skip over the /. */
+ bits = 0;
+ do {
+ n = aresx_sztosi(strchr(digits, ch) - digits);
+ bits *= 10;
+ bits += n;
+ if (bits > 32)
+ goto enoent;
+ } while ((ch = *src++) != '\0' && ISASCII(ch) && ISDIGIT(ch));
+ if (ch != '\0')
+ goto enoent;
+ }
+
+ /* Firey death and destruction unless we prefetched EOS. */
+ if (ch != '\0')
+ goto enoent;
+
+ /* If nothing was written to the destination, we found no address. */
+ if (dst == odst)
+ goto enoent; /* LCOV_EXCL_LINE: all valid paths above increment dst */
+ /* If no CIDR spec was given, infer width from net class. */
+ if (bits == -1) {
+ if (*odst >= 240) /* Class E */
+ bits = 32;
+ else if (*odst >= 224) /* Class D */
+ bits = 8;
+ else if (*odst >= 192) /* Class C */
+ bits = 24;
+ else if (*odst >= 128) /* Class B */
+ bits = 16;
+ else /* Class A */
+ bits = 8;
+ /* If imputed mask is narrower than specified octets, widen. */
+ if (bits < ((dst - odst) * 8))
+ bits = aresx_sztosi(dst - odst) * 8;
+ /*
+ * If there are no additional bits specified for a class D
+ * address adjust bits to 4.
+ */
+ if (bits == 8 && *odst == 224)
+ bits = 4;
+ }
+ /* Extend network to cover the actual mask. */
+ while (bits > ((dst - odst) * 8)) {
+ if (!size--)
+ goto emsgsize;
+ *dst++ = '\0';
+ }
+ return (bits);
+
+ enoent:
+ SET_ERRNO(ENOENT);
+ return (-1);
+
+ emsgsize:
+ SET_ERRNO(EMSGSIZE);
+ return (-1);
+}
+
+static int
+getbits(const char *src, int *bitsp)
+{
+ static const char digits[] = "0123456789";
+ int n;
+ int val;
+ char ch;
+
+ val = 0;
+ n = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ pch = strchr(digits, ch);
+ if (pch != NULL) {
+ if (n++ != 0 && val == 0) /* no leading zeros */
+ return (0);
+ val *= 10;
+ val += aresx_sztosi(pch - digits);
+ if (val > 128) /* range */
+ return (0);
+ continue;
+ }
+ return (0);
+ }
+ if (n == 0)
+ return (0);
+ *bitsp = val;
+ return (1);
+}
+
+static int
+getv4(const char *src, unsigned char *dst, int *bitsp)
+{
+ static const char digits[] = "0123456789";
+ unsigned char *odst = dst;
+ int n;
+ unsigned int val;
+ char ch;
+
+ val = 0;
+ n = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ pch = strchr(digits, ch);
+ if (pch != NULL) {
+ if (n++ != 0 && val == 0) /* no leading zeros */
+ return (0);
+ val *= 10;
+ val += aresx_sztoui(pch - digits);
+ if (val > 255) /* range */
+ return (0);
+ continue;
+ }
+ if (ch == '.' || ch == '/') {
+ if (dst - odst > 3) /* too many octets? */
+ return (0);
+ *dst++ = (unsigned char)val;
+ if (ch == '/')
+ return (getbits(src, bitsp));
+ val = 0;
+ n = 0;
+ continue;
+ }
+ return (0);
+ }
+ if (n == 0)
+ return (0);
+ if (dst - odst > 3) /* too many octets? */
+ return (0);
+ *dst = (unsigned char)val;
+ return 1;
+}
+
+static int
+inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
+{
+ static const char xdigits_l[] = "0123456789abcdef",
+ xdigits_u[] = "0123456789ABCDEF";
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+ const char *xdigits, *curtok;
+ int ch, saw_xdigit;
+ unsigned int val;
+ int digits;
+ int bits;
+ size_t bytes;
+ int words;
+ int ipv4;
+
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
+ colonp = NULL;
+ /* Leading :: requires some special handling. */
+ if (*src == ':')
+ if (*++src != ':')
+ goto enoent;
+ curtok = src;
+ saw_xdigit = 0;
+ val = 0;
+ digits = 0;
+ bits = -1;
+ ipv4 = 0;
+ while ((ch = *src++) != '\0') {
+ const char *pch;
+
+ if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_u), ch);
+ if (pch != NULL) {
+ val <<= 4;
+ val |= aresx_sztoui(pch - xdigits);
+ if (++digits > 4)
+ goto enoent;
+ saw_xdigit = 1;
+ continue;
+ }
+ if (ch == ':') {
+ curtok = src;
+ if (!saw_xdigit) {
+ if (colonp)
+ goto enoent;
+ colonp = tp;
+ continue;
+ } else if (*src == '\0')
+ goto enoent;
+ if (tp + NS_INT16SZ > endp)
+ return (0);
+ *tp++ = (unsigned char)((val >> 8) & 0xff);
+ *tp++ = (unsigned char)(val & 0xff);
+ saw_xdigit = 0;
+ digits = 0;
+ val = 0;
+ continue;
+ }
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+ getv4(curtok, tp, &bits) > 0) {
+ tp += NS_INADDRSZ;
+ saw_xdigit = 0;
+ ipv4 = 1;
+ break; /* '\0' was seen by inet_pton4(). */
+ }
+ if (ch == '/' && getbits(src, &bits) > 0)
+ break;
+ goto enoent;
+ }
+ if (saw_xdigit) {
+ if (tp + NS_INT16SZ > endp)
+ goto enoent;
+ *tp++ = (unsigned char)((val >> 8) & 0xff);
+ *tp++ = (unsigned char)(val & 0xff);
+ }
+ if (bits == -1)
+ bits = 128;
+
+ words = (bits + 15) / 16;
+ if (words < 2)
+ words = 2;
+ if (ipv4)
+ words = 8;
+ endp = tmp + 2 * words;
+
+ if (colonp != NULL) {
+ /*
+ * Since some memmove()'s erroneously fail to handle
+ * overlapping regions, we'll do the shift by hand.
+ */
+ const ares_ssize_t n = tp - colonp;
+ ares_ssize_t i;
+
+ if (tp == endp)
+ goto enoent;
+ for (i = 1; i <= n; i++) {
+ *(endp - i) = *(colonp + n - i);
+ *(colonp + n - i) = 0;
+ }
+ tp = endp;
+ }
+ if (tp != endp)
+ goto enoent;
+
+ bytes = (bits + 7) / 8;
+ if (bytes > size)
+ goto emsgsize;
+ memcpy(dst, tmp, bytes);
+ return (bits);
+
+ enoent:
+ SET_ERRNO(ENOENT);
+ return (-1);
+
+ emsgsize:
+ SET_ERRNO(EMSGSIZE);
+ return (-1);
+}
+
+/*
+ * int
+ * inet_net_pton(af, src, dst, size)
+ * convert network number from presentation to network format.
+ * accepts hex octets, hex strings, decimal octets, and /CIDR.
+ * "size" is in bytes and describes "dst".
+ * return:
+ * number of bits, either imputed classfully or specified with /CIDR,
+ * or -1 if some failure occurred (check errno). ENOENT means it was
+ * not a valid network specification.
+ * note:
+ * On Windows we store the error in the thread errno, not
+ * in the winsock error code. This is to avoid loosing the
+ * actual last winsock error. So use macro ERRNO to fetch the
+ * errno this funtion sets when returning (-1), not SOCKERRNO.
+ * author:
+ * Paul Vixie (ISC), June 1996
+ */
+int
+ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
+{
+ switch (af) {
+ case AF_INET:
+ return (inet_net_pton_ipv4(src, dst, size));
+ case AF_INET6:
+ return (inet_net_pton_ipv6(src, dst, size));
+ default:
+ SET_ERRNO(EAFNOSUPPORT);
+ return (-1);
+ }
+}
+
+#endif /* HAVE_INET_NET_PTON */
+
+#ifndef HAVE_INET_PTON
+int ares_inet_pton(int af, const char *src, void *dst)
+{
+ int result;
+ size_t size;
+
+ if (af == AF_INET)
+ size = sizeof(struct in_addr);
+ else if (af == AF_INET6)
+ size = sizeof(struct ares_in6_addr);
+ else
+ {
+ SET_ERRNO(EAFNOSUPPORT);
+ return -1;
+ }
+ result = ares_inet_net_pton(af, src, dst, size);
+ if (result == -1 && ERRNO == ENOENT)
+ return 0;
+ return (result > -1 ? 1 : -1);
+}
+#else /* HAVE_INET_PTON */
+int ares_inet_pton(int af, const char *src, void *dst)
+{
+ /* just relay this to the underlying function */
+ return inet_pton(af, src, dst);
+}
+
+#endif
diff --git a/grpc/third_party/cares/cares/src/lib/inet_ntop.c b/grpc/third_party/cares/cares/src/lib/inet_ntop.c
new file mode 100644
index 00000000..6645c0a4
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/lib/inet_ntop.c
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#include "ares_nameser.h"
+
+#include "ares.h"
+#include "ares_ipv6.h"
+
+#ifndef HAVE_INET_NTOP
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
+static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ * convert a network format address to presentation format.
+ * return:
+ * pointer to presentation format address (`dst'), or NULL (see errno).
+ * note:
+ * On Windows we store the error in the thread errno, not
+ * in the winsock error code. This is to avoid loosing the
+ * actual last winsock error. So use macro ERRNO to fetch the
+ * errno this function sets when returning NULL, not SOCKERRNO.
+ * author:
+ * Paul Vixie, 1996.
+ */
+const char *
+ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
+{
+ switch (af) {
+ case AF_INET:
+ return (inet_ntop4(src, dst, (size_t)size));
+ case AF_INET6:
+ return (inet_ntop6(src, dst, (size_t)size));
+ default:
+ SET_ERRNO(EAFNOSUPPORT);
+ return (NULL);
+ }
+ /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ * format an IPv4 address
+ * return:
+ * `dst' (as a const)
+ * notes:
+ * (1) uses no statics
+ * (2) takes a unsigned char* not an in_addr as input
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4(const unsigned char *src, char *dst, size_t size)
+{
+ static const char fmt[] = "%u.%u.%u.%u";
+ char tmp[sizeof("255.255.255.255")];
+
+ if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) {
+ SET_ERRNO(ENOSPC);
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+
+/* const char *
+ * inet_ntop6(src, dst, size)
+ * convert IPv6 binary address into presentation (printable) format
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6(const unsigned char *src, char *dst, size_t size)
+{
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+ char *tp;
+ struct { int base, len; } best, cur;
+ unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ int i;
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset(words, '\0', sizeof(words));
+ for (i = 0; i < NS_IN6ADDRSZ; i++)
+ words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
+ best.base = -1;
+ best.len = 0;
+ cur.base = -1;
+ cur.len = 0;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ if (words[i] == 0) {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ } else {
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1) {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base &&
+ i < (best.base + best.len)) {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 && (best.len == 6 ||
+ (best.len == 7 && words[7] != 0x0001) ||
+ (best.len == 5 && words[5] == 0xffff))) {
+ if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
+ return (NULL);
+ tp += strlen(tp);
+ break;
+ }
+ tp += sprintf(tp, "%x", words[i]);
+ }
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
+ *tp++ = ':';
+ *tp++ = '\0';
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((size_t)(tp - tmp) > size) {
+ SET_ERRNO(ENOSPC);
+ return (NULL);
+ }
+ strcpy(dst, tmp);
+ return (dst);
+}
+
+#else /* HAVE_INET_NTOP */
+
+const char *
+ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size)
+{
+ /* just relay this to the underlying function */
+ return inet_ntop(af, src, dst, size);
+}
+
+#endif /* HAVE_INET_NTOP */
diff --git a/grpc/third_party/cares/cares/setup_once.h b/grpc/third_party/cares/cares/src/lib/setup_once.h
index a8cfe6be..a8cfe6be 100644
--- a/grpc/third_party/cares/cares/setup_once.h
+++ b/grpc/third_party/cares/cares/src/lib/setup_once.h
diff --git a/grpc/third_party/cares/cares/windows_port.c b/grpc/third_party/cares/cares/src/lib/windows_port.c
index 03acd1c1..03acd1c1 100644
--- a/grpc/third_party/cares/cares/windows_port.c
+++ b/grpc/third_party/cares/cares/src/lib/windows_port.c
diff --git a/grpc/third_party/cares/cares/src/tools/CMakeLists.txt b/grpc/third_party/cares/cares/src/tools/CMakeLists.txt
new file mode 100644
index 00000000..0c44216f
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/CMakeLists.txt
@@ -0,0 +1,55 @@
+IF (CARES_BUILD_TOOLS)
+ # Transform Makefile.inc
+ transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/src/tools/Makefile.inc.cmake")
+ include(${PROJECT_BINARY_DIR}/src/tools/Makefile.inc.cmake)
+
+ # Build ahost
+ ADD_EXECUTABLE (ahost ahost.c ${SAMPLESOURCES})
+ TARGET_INCLUDE_DIRECTORIES (ahost
+ PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>"
+ "$<BUILD_INTERFACE:${CARES_TOPLEVEL_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+ TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1)
+ TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME})
+ IF (CARES_INSTALL)
+ INSTALL (TARGETS ahost COMPONENT Tools ${TARGETS_INST_DEST})
+ ENDIF ()
+
+
+ # Build adig
+ ADD_EXECUTABLE (adig adig.c ${SAMPLESOURCES})
+ TARGET_INCLUDE_DIRECTORIES (adig
+ PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>"
+ "$<BUILD_INTERFACE:${CARES_TOPLEVEL_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+ TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1)
+ TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME})
+ IF (CARES_INSTALL)
+ INSTALL (TARGETS adig COMPONENT Tools ${TARGETS_INST_DEST})
+ ENDIF ()
+
+
+ # Build acountry
+ ADD_EXECUTABLE (acountry acountry.c ${SAMPLESOURCES})
+ TARGET_INCLUDE_DIRECTORIES (acountry
+ PUBLIC "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>"
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>"
+ "$<BUILD_INTERFACE:${CARES_TOPLEVEL_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
+ )
+ TARGET_COMPILE_DEFINITIONS (acountry PRIVATE HAVE_CONFIG_H=1)
+ TARGET_LINK_LIBRARIES (acountry PRIVATE ${PROJECT_NAME})
+ IF (CARES_INSTALL)
+ INSTALL (TARGETS acountry COMPONENT Tools ${TARGETS_INST_DEST})
+ ENDIF ()
+ENDIF ()
diff --git a/grpc/third_party/cares/cares/src/tools/Makefile.am b/grpc/third_party/cares/cares/src/tools/Makefile.am
new file mode 100644
index 00000000..c503723c
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/Makefile.am
@@ -0,0 +1,36 @@
+AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6
+PROGS = ahost adig acountry
+
+EXTRA_DIST = CMakeLists.txt Makefile.inc
+
+noinst_PROGRAMS =$(PROGS)
+
+# Specify our include paths here, and do it relative to $(top_srcdir) and
+# $(top_builddir), to ensure that these paths which belong to the library
+# being currently built and tested are searched before the library which
+# might possibly already be installed in the system.
+
+AM_CPPFLAGS = -I$(top_builddir)/include \
+ -I$(top_builddir)/src/lib \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src/lib
+
+if USE_CPPFLAG_CARES_STATICLIB
+AM_CPPFLAGS += $(CPPFLAG_CARES_STATICLIB)
+endif
+
+include Makefile.inc
+
+LDADD = $(top_builddir)/src/lib/libcares.la
+
+ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+ahost_CFLAGS = $(AM_CFLAGS)
+ahost_CPPFLAGS = $(AM_CPPFLAGS)
+
+adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+adig_CFLAGS = $(AM_CFLAGS)
+adig_CPPFLAGS = $(AM_CPPFLAGS)
+
+acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
+acountry_CFLAGS = $(AM_CFLAGS)
+acountry_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/grpc/third_party/cares/cares/src/tools/Makefile.inc b/grpc/third_party/cares/cares/src/tools/Makefile.inc
new file mode 100644
index 00000000..7aea8e5f
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/Makefile.inc
@@ -0,0 +1,7 @@
+SAMPLESOURCES = ares_getopt.c \
+ ../lib/ares_nowarn.c \
+ ../lib/ares_strcasecmp.c
+
+SAMPLEHEADERS = ares_getopt.h \
+ ../lib/ares_nowarn.h \
+ ../lib/ares_strcasecmp.h
diff --git a/grpc/third_party/cares/cares/src/tools/acountry.c b/grpc/third_party/cares/cares/src/tools/acountry.c
new file mode 100644
index 00000000..a86d7cb0
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/acountry.c
@@ -0,0 +1,652 @@
+/*
+ *
+ * IP-address/hostname to country converter.
+ *
+ * Problem; you want to know where IP a.b.c.d is located.
+ *
+ * Use ares_gethostbyname ("d.c.b.a.zz.countries.nerd.dk")
+ * and get the CNAME (host->h_name). Result will be:
+ * CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
+ * CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
+ *
+ * The 2 letter country code is in <CC> and the ISO-3166 country
+ * number is in x.y (number = x*256 + y). Version 2 of the protocol is missing
+ * the <CC> number.
+ *
+ * Ref: http://countries.nerd.dk/more.html
+ *
+ * Written by G. Vanem <gvanem@yahoo.no> 2006, 2007
+ *
+ * NB! This program may not be big-endian aware.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#if defined(WIN32) && !defined(WATT32)
+ #include <winsock.h>
+#else
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+#endif
+
+#include "ares.h"
+#include "ares_getopt.h"
+#include "ares_nowarn.h"
+
+#ifndef HAVE_STRDUP
+# include "ares_strdup.h"
+# define strdup(ptr) ares_strdup(ptr)
+#endif
+
+#ifndef HAVE_STRCASECMP
+# include "ares_strcasecmp.h"
+# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
+#endif
+
+#ifndef HAVE_STRNCASECMP
+# include "ares_strcasecmp.h"
+# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
+#endif
+
+#ifndef INADDR_NONE
+#define INADDR_NONE 0xffffffff
+#endif
+
+/* By using a double cast, we can get rid of the bogus warning of
+ * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align]
+ */
+#define CARES_INADDR_CAST(type, var) ((type)((void *)var))
+
+static const char *usage = "acountry [-?hdv] {host|addr} ...\n";
+static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
+static const char *nerd_ver1 = nerd_fmt + 14; /* .countries.nerd.dk */
+static const char *nerd_ver2 = nerd_fmt + 11; /* .zz.countries.nerd.dk */
+static int verbose = 0;
+
+#define TRACE(fmt) do { \
+ if (verbose > 0) \
+ printf fmt ; \
+ } WHILE_FALSE
+
+static void wait_ares(ares_channel channel);
+static void callback(void *arg, int status, int timeouts, struct hostent *host);
+static void callback2(void *arg, int status, int timeouts, struct hostent *host);
+static void find_country_from_cname(const char *cname, struct in_addr addr);
+static void print_help_info_acountry(void);
+
+static void Abort(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ ares_channel channel;
+ int ch, status;
+
+#if defined(WIN32) && !defined(WATT32)
+ WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ status = ares_library_init(ARES_LIB_INIT_ALL);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
+ while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
+ switch (ch)
+ {
+ case 'd':
+#ifdef WATT32
+ dbug_init();
+#endif
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'h':
+ print_help_info_acountry();
+ break;
+ case '?':
+ print_help_info_acountry();
+ break;
+ default:
+ Abort(usage);
+ }
+
+ argc -= optind;
+ argv += optind;
+ if (argc < 1)
+ Abort(usage);
+
+ status = ares_init(&channel);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
+ /* Initiate the queries, one per command-line argument. */
+ for ( ; *argv; argv++)
+ {
+ struct in_addr addr;
+ char buf[100];
+
+ /* If this fails, assume '*argv' is a host-name that
+ * must be resolved first
+ */
+ if (ares_inet_pton(AF_INET, *argv, &addr) != 1)
+ {
+ ares_gethostbyname(channel, *argv, AF_INET, callback2, &addr);
+ wait_ares(channel);
+ if (addr.s_addr == INADDR_NONE)
+ {
+ printf("Failed to lookup %s\n", *argv);
+ continue;
+ }
+ }
+
+ sprintf(buf, nerd_fmt,
+ (unsigned int)(addr.s_addr >> 24),
+ (unsigned int)((addr.s_addr >> 16) & 255),
+ (unsigned int)((addr.s_addr >> 8) & 255),
+ (unsigned int)(addr.s_addr & 255));
+ TRACE(("Looking up %s...", buf));
+ fflush(stdout);
+ ares_gethostbyname(channel, buf, AF_INET, callback, buf);
+ }
+
+ wait_ares(channel);
+ ares_destroy(channel);
+
+ ares_library_cleanup();
+
+#if defined(WIN32) && !defined(WATT32)
+ WSACleanup();
+#endif
+
+ return 0;
+}
+
+/*
+ * Wait for the queries to complete.
+ */
+static void wait_ares(ares_channel channel)
+{
+ for (;;)
+ {
+ struct timeval *tvp, tv;
+ fd_set read_fds, write_fds;
+ int nfds;
+
+ FD_ZERO(&read_fds);
+ FD_ZERO(&write_fds);
+ nfds = ares_fds(channel, &read_fds, &write_fds);
+ if (nfds == 0)
+ break;
+ tvp = ares_timeout(channel, NULL, &tv);
+ nfds = select(nfds, &read_fds, &write_fds, NULL, tvp);
+ if (nfds < 0)
+ continue;
+ ares_process(channel, &read_fds, &write_fds);
+ }
+}
+
+/*
+ * This is the callback used when we have the IP-address of interest.
+ * Extract the CNAME and figure out the country-code from it.
+ */
+static void callback(void *arg, int status, int timeouts, struct hostent *host)
+{
+ const char *name = (const char*)arg;
+ const char *cname;
+ char buf[20];
+
+ (void)timeouts;
+
+ if (!host || status != ARES_SUCCESS)
+ {
+ printf("Failed to lookup %s: %s\n", name, ares_strerror(status));
+ return;
+ }
+
+ TRACE(("\nFound address %s, name %s\n",
+ ares_inet_ntop(AF_INET,(const char*)host->h_addr,buf,sizeof(buf)),
+ host->h_name));
+
+ cname = host->h_name; /* CNAME gets put here */
+ if (!cname)
+ printf("Failed to get CNAME for %s\n", name);
+ else
+ find_country_from_cname(cname, *(CARES_INADDR_CAST(struct in_addr *, host->h_addr)));
+}
+
+/*
+ * This is the callback used to obtain the IP-address of the host of interest.
+ */
+static void callback2(void *arg, int status, int timeouts, struct hostent *host)
+{
+ struct in_addr *addr = (struct in_addr*) arg;
+
+ (void)timeouts;
+ if (!host || status != ARES_SUCCESS)
+ memset(addr, INADDR_NONE, sizeof(*addr));
+ else
+ memcpy(addr, host->h_addr, sizeof(*addr));
+}
+
+struct search_list {
+ int country_number; /* ISO-3166 country number */
+ char short_name[3]; /* A2 short country code */
+ const char *long_name; /* normal country name */
+ };
+
+static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
+{
+ while (num > 0 && list->long_name)
+ {
+ if (list->country_number == number)
+ return (list);
+ num--;
+ list++;
+ }
+ return (NULL);
+}
+
+/*
+ * Ref: https://en.wikipedia.org/wiki/ISO_3166-1
+ */
+static const struct search_list country_list[] = {
+ { 4, "af", "Afghanistan" },
+ { 248, "ax", "Åland Island" },
+ { 8, "al", "Albania" },
+ { 12, "dz", "Algeria" },
+ { 16, "as", "American Samoa" },
+ { 20, "ad", "Andorra" },
+ { 24, "ao", "Angola" },
+ { 660, "ai", "Anguilla" },
+ { 10, "aq", "Antarctica" },
+ { 28, "ag", "Antigua & Barbuda" },
+ { 32, "ar", "Argentina" },
+ { 51, "am", "Armenia" },
+ { 533, "aw", "Aruba" },
+ { 36, "au", "Australia" },
+ { 40, "at", "Austria" },
+ { 31, "az", "Azerbaijan" },
+ { 44, "bs", "Bahamas" },
+ { 48, "bh", "Bahrain" },
+ { 50, "bd", "Bangladesh" },
+ { 52, "bb", "Barbados" },
+ { 112, "by", "Belarus" },
+ { 56, "be", "Belgium" },
+ { 84, "bz", "Belize" },
+ { 204, "bj", "Benin" },
+ { 60, "bm", "Bermuda" },
+ { 64, "bt", "Bhutan" },
+ { 68, "bo", "Bolivia" },
+ { 535, "bq", "Bonaire, Sint Eustatius and Saba" }, /* Formerly 'Bonaire' / 'Netherlands Antilles' */
+ { 70, "ba", "Bosnia & Herzegovina" },
+ { 72, "bw", "Botswana" },
+ { 74, "bv", "Bouvet Island" },
+ { 76, "br", "Brazil" },
+ { 86, "io", "British Indian Ocean Territory" },
+ { 96, "bn", "Brunei Darussalam" },
+ { 100, "bg", "Bulgaria" },
+ { 854, "bf", "Burkina Faso" },
+ { 108, "bi", "Burundi" },
+ { 116, "kh", "Cambodia" },
+ { 120, "cm", "Cameroon" },
+ { 124, "ca", "Canada" },
+ { 132, "cv", "Cape Verde" },
+ { 136, "ky", "Cayman Islands" },
+ { 140, "cf", "Central African Republic" },
+ { 148, "td", "Chad" },
+ { 152, "cl", "Chile" },
+ { 156, "cn", "China" },
+ { 162, "cx", "Christmas Island" },
+ { 166, "cc", "Cocos Islands" },
+ { 170, "co", "Colombia" },
+ { 174, "km", "Comoros" },
+ { 178, "cg", "Congo" },
+ { 180, "cd", "Congo" },
+ { 184, "ck", "Cook Islands" },
+ { 188, "cr", "Costa Rica" },
+ { 384, "ci", "Cote d'Ivoire" },
+ { 191, "hr", "Croatia" },
+ { 192, "cu", "Cuba" },
+ { 531, "cw", "Curaçao" },
+ { 196, "cy", "Cyprus" },
+ { 203, "cz", "Czech Republic" },
+ { 208, "dk", "Denmark" },
+ { 262, "dj", "Djibouti" },
+ { 212, "dm", "Dominica" },
+ { 214, "do", "Dominican Republic" },
+ { 218, "ec", "Ecuador" },
+ { 818, "eg", "Egypt" },
+ { 222, "sv", "El Salvador" },
+ { 226, "gq", "Equatorial Guinea" },
+ { 232, "er", "Eritrea" },
+ { 233, "ee", "Estonia" },
+ { 748, "sz", "Eswatini" }, /* Formerly Swaziland */
+ { 231, "et", "Ethiopia" },
+ { 65281, "eu", "European Union" }, /* 127.0.255.1 */
+ { 238, "fk", "Falkland Islands" },
+ { 234, "fo", "Faroe Islands" },
+ { 242, "fj", "Fiji" },
+ { 246, "fi", "Finland" },
+ { 250, "fr", "France" },
+ { 249, "fx", "France, Metropolitan" },
+ { 254, "gf", "French Guiana" },
+ { 258, "pf", "French Polynesia" },
+ { 260, "tf", "French Southern Territories" },
+ { 266, "ga", "Gabon" },
+ { 270, "gm", "Gambia" },
+ { 268, "ge", "Georgia" },
+ { 276, "de", "Germany" },
+ { 288, "gh", "Ghana" },
+ { 292, "gi", "Gibraltar" },
+ { 300, "gr", "Greece" },
+ { 304, "gl", "Greenland" },
+ { 308, "gd", "Grenada" },
+ { 312, "gp", "Guadeloupe" },
+ { 316, "gu", "Guam" },
+ { 320, "gt", "Guatemala" },
+ { 831, "gg", "Guernsey" },
+ { 324, "gn", "Guinea" },
+ { 624, "gw", "Guinea-Bissau" },
+ { 328, "gy", "Guyana" },
+ { 332, "ht", "Haiti" },
+ { 334, "hm", "Heard & Mc Donald Islands" },
+ { 336, "va", "Holy See" }, /* Vatican City */
+ { 340, "hn", "Honduras" },
+ { 344, "hk", "Hong kong" },
+ { 348, "hu", "Hungary" },
+ { 352, "is", "Iceland" },
+ { 356, "in", "India" },
+ { 360, "id", "Indonesia" },
+ { 364, "ir", "Iran" },
+ { 368, "iq", "Iraq" },
+ { 372, "ie", "Ireland" },
+ { 833, "im", "Isle of Man" },
+ { 376, "il", "Israel" },
+ { 380, "it", "Italy" },
+ { 388, "jm", "Jamaica" },
+ { 392, "jp", "Japan" },
+ { 832, "je", "Jersey" },
+ { 400, "jo", "Jordan" },
+ { 398, "kz", "Kazakhstan" },
+ { 404, "ke", "Kenya" },
+ { 296, "ki", "Kiribati" },
+ { 408, "kp", "Korea (north)" },
+ { 410, "kr", "Korea (south)" },
+ { 0, "xk", "Kosovo" }, /* https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */
+ { 414, "kw", "Kuwait" },
+ { 417, "kg", "Kyrgyzstan" },
+ { 418, "la", "Laos" },
+ { 428, "lv", "Latvia" },
+ { 422, "lb", "Lebanon" },
+ { 426, "ls", "Lesotho" },
+ { 430, "lr", "Liberia" },
+ { 434, "ly", "Libya" },
+ { 438, "li", "Liechtenstein" },
+ { 440, "lt", "Lithuania" },
+ { 442, "lu", "Luxembourg" },
+ { 446, "mo", "Macao" },
+ { 450, "mg", "Madagascar" },
+ { 454, "mw", "Malawi" },
+ { 458, "my", "Malaysia" },
+ { 462, "mv", "Maldives" },
+ { 466, "ml", "Mali" },
+ { 470, "mt", "Malta" },
+ { 584, "mh", "Marshall Islands" },
+ { 474, "mq", "Martinique" },
+ { 478, "mr", "Mauritania" },
+ { 480, "mu", "Mauritius" },
+ { 175, "yt", "Mayotte" },
+ { 484, "mx", "Mexico" },
+ { 583, "fm", "Micronesia" },
+ { 498, "md", "Moldova" },
+ { 492, "mc", "Monaco" },
+ { 496, "mn", "Mongolia" },
+ { 499, "me", "Montenegro" },
+ { 500, "ms", "Montserrat" },
+ { 504, "ma", "Morocco" },
+ { 508, "mz", "Mozambique" },
+ { 104, "mm", "Myanmar" },
+ { 516, "na", "Namibia" },
+ { 520, "nr", "Nauru" },
+ { 524, "np", "Nepal" },
+ { 528, "nl", "Netherlands" },
+ { 540, "nc", "New Caledonia" },
+ { 554, "nz", "New Zealand" },
+ { 558, "ni", "Nicaragua" },
+ { 562, "ne", "Niger" },
+ { 566, "ng", "Nigeria" },
+ { 570, "nu", "Niue" },
+ { 574, "nf", "Norfolk Island" },
+ { 807, "mk", "North Macedonia" }, /* 'Macedonia' until February 2019 */
+ { 580, "mp", "Northern Mariana Islands" },
+ { 578, "no", "Norway" },
+ { 512, "om", "Oman" },
+ { 586, "pk", "Pakistan" },
+ { 585, "pw", "Palau" },
+ { 275, "ps", "Palestinian Territory" },
+ { 591, "pa", "Panama" },
+ { 598, "pg", "Papua New Guinea" },
+ { 600, "py", "Paraguay" },
+ { 604, "pe", "Peru" },
+ { 608, "ph", "Philippines" },
+ { 612, "pn", "Pitcairn" },
+ { 616, "pl", "Poland" },
+ { 620, "pt", "Portugal" },
+ { 630, "pr", "Puerto Rico" },
+ { 634, "qa", "Qatar" },
+ { 638, "re", "Reunion" },
+ { 642, "ro", "Romania" },
+ { 643, "ru", "Russian Federation" },
+ { 646, "rw", "Rwanda" },
+ { 0, "bl", "Saint Barthélemy" }, /* https://en.wikipedia.org/wiki/ISO_3166-2:BL */
+ { 659, "kn", "Saint Kitts & Nevis" },
+ { 662, "lc", "Saint Lucia" },
+ { 663, "mf", "Saint Martin" },
+ { 670, "vc", "Saint Vincent" },
+ { 882, "ws", "Samoa" },
+ { 674, "sm", "San Marino" },
+ { 678, "st", "Sao Tome & Principe" },
+ { 682, "sa", "Saudi Arabia" },
+ { 686, "sn", "Senegal" },
+ { 688, "rs", "Serbia" },
+ { 690, "sc", "Seychelles" },
+ { 694, "sl", "Sierra Leone" },
+ { 702, "sg", "Singapore" },
+ { 534, "sx", "Sint Maarten" },
+ { 703, "sk", "Slovakia" },
+ { 705, "si", "Slovenia" },
+ { 90, "sb", "Solomon Islands" },
+ { 706, "so", "Somalia" },
+ { 710, "za", "South Africa" },
+ { 239, "gs", "South Georgia & South Sandwich Is." },
+ { 728, "ss", "South Sudan" },
+ { 724, "es", "Spain" },
+ { 144, "lk", "Sri Lanka" },
+ { 654, "sh", "St. Helena" },
+ { 666, "pm", "St. Pierre & Miquelon" },
+ { 736, "sd", "Sudan" },
+ { 740, "sr", "Suriname" },
+ { 744, "sj", "Svalbard & Jan Mayen Islands" },
+ { 752, "se", "Sweden" },
+ { 756, "ch", "Switzerland" },
+ { 760, "sy", "Syrian Arab Republic" },
+ { 158, "tw", "Taiwan" },
+ { 762, "tj", "Tajikistan" },
+ { 834, "tz", "Tanzania" },
+ { 764, "th", "Thailand" },
+ { 626, "tl", "Timor-Leste" },
+ { 768, "tg", "Togo" },
+ { 772, "tk", "Tokelau" },
+ { 776, "to", "Tonga" },
+ { 780, "tt", "Trinidad & Tobago" },
+ { 788, "tn", "Tunisia" },
+ { 792, "tr", "Turkey" },
+ { 795, "tm", "Turkmenistan" },
+ { 796, "tc", "Turks & Caicos Islands" },
+ { 798, "tv", "Tuvalu" },
+ { 800, "ug", "Uganda" },
+ { 804, "ua", "Ukraine" },
+ { 784, "ae", "United Arab Emirates" },
+ { 826, "gb", "United Kingdom" },
+ { 840, "us", "United States" },
+ { 581, "um", "United States Minor Outlying Islands" },
+ { 858, "uy", "Uruguay" },
+ { 860, "uz", "Uzbekistan" },
+ { 548, "vu", "Vanuatu" },
+ { 862, "ve", "Venezuela" },
+ { 704, "vn", "Vietnam" },
+ { 92, "vg", "Virgin Islands (British)" },
+ { 850, "vi", "Virgin Islands (US)" },
+ { 876, "wf", "Wallis & Futuna Islands" },
+ { 732, "eh", "Western Sahara" },
+ { 887, "ye", "Yemen" },
+ { 894, "zm", "Zambia" },
+ { 716, "zw", "Zimbabwe" }
+ };
+
+/*
+ * Check if start of 'str' is simply an IPv4 address.
+ */
+#define BYTE_OK(x) ((x) >= 0 && (x) <= 255)
+
+static int is_addr(char *str, char **end)
+{
+ int a0, a1, a2, a3, num, rc = 0, length = 0;
+
+ num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
+ if( (num == 4) &&
+ BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
+ length >= (3+4))
+ {
+ rc = 1;
+ *end = str + length;
+ }
+ return rc;
+}
+
+/*
+ * Find the country-code and name from the CNAME. E.g.:
+ * version 1: CNAME = zzno.countries.nerd.dk with address 127.0.2.66
+ * yields ccode_A" = "no" and cnumber 578 (2.66).
+ * version 2: CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.2.66
+ * yields cnumber 578 (2.66). ccode_A is "";
+ */
+static void find_country_from_cname(const char *cname, struct in_addr addr)
+{
+ const struct search_list *country;
+ char ccode_A2[3], *ccopy, *dot_4;
+ int cnumber, z0, z1, ver_1, ver_2;
+ unsigned long ip;
+
+ ip = ntohl(addr.s_addr);
+ z0 = TOLOWER(cname[0]);
+ z1 = TOLOWER(cname[1]);
+ ccopy = strdup(cname);
+ dot_4 = NULL;
+
+ ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
+ ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
+
+ if (ver_1)
+ {
+ const char *dot = strchr(cname, '.');
+ if (dot != cname+4)
+ {
+ printf("Unexpected CNAME %s (ver_1)\n", cname);
+ free(ccopy);
+ return;
+ }
+ }
+ else if (ver_2)
+ {
+ z0 = TOLOWER(dot_4[1]);
+ z1 = TOLOWER(dot_4[2]);
+ if (z0 != 'z' && z1 != 'z')
+ {
+ printf("Unexpected CNAME %s (ver_2)\n", cname);
+ free(ccopy);
+ return;
+ }
+ }
+ else
+ {
+ printf("Unexpected CNAME %s (ver?)\n", cname);
+ free(ccopy);
+ return;
+ }
+
+ if (ver_1)
+ {
+ ccode_A2[0] = (char)TOLOWER(cname[2]);
+ ccode_A2[1] = (char)TOLOWER(cname[3]);
+ ccode_A2[2] = '\0';
+ }
+ else
+ ccode_A2[0] = '\0';
+
+ cnumber = ip & 0xFFFF;
+
+ TRACE(("Found country-code `%s', number %d\n",
+ ver_1 ? ccode_A2 : "<n/a>", cnumber));
+
+ country = list_lookup(cnumber, country_list,
+ sizeof(country_list) / sizeof(country_list[0]));
+ if (!country)
+ printf("Name for country-number %d not found.\n", cnumber);
+ else
+ {
+ if (ver_1)
+ {
+ if ((country->short_name[0] != ccode_A2[0]) ||
+ (country->short_name[1] != ccode_A2[1]) ||
+ (country->short_name[2] != ccode_A2[2]))
+ printf("short-name mismatch; %s vs %s\n",
+ country->short_name, ccode_A2);
+ }
+ printf("%s (%s), number %d.\n",
+ country->long_name, country->short_name, cnumber);
+ }
+ free(ccopy);
+}
+
+/* Information from the man page. Formatting taken from man -h */
+static void print_help_info_acountry(void) {
+ printf("acountry, version %s \n\n", ARES_VERSION_STR);
+ printf("usage: acountry [-hdv] {host|addr} ...\n\n"
+ " d : Print some extra debugging output.\n"
+ " h : Display this help and exit.\n"
+ " v : Be more verbose. Print extra information.\n\n");
+ exit(0);
+}
diff --git a/grpc/third_party/cares/cares/src/tools/adig.c b/grpc/third_party/cares/cares/src/tools/adig.c
new file mode 100644
index 00000000..3f99f7f0
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/adig.c
@@ -0,0 +1,970 @@
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#include "ares_nameser.h"
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_getopt.h"
+#include "ares_nowarn.h"
+
+#ifndef HAVE_STRDUP
+# include "ares_strdup.h"
+# define strdup(ptr) ares_strdup(ptr)
+#endif
+
+#ifndef HAVE_STRCASECMP
+# include "ares_strcasecmp.h"
+# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
+#endif
+
+#ifndef HAVE_STRNCASECMP
+# include "ares_strcasecmp.h"
+# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
+#endif
+
+#ifdef WATT32
+#undef WIN32 /* Redefined in MingW headers */
+#endif
+
+
+struct nv {
+ const char *name;
+ int value;
+};
+
+static const struct nv flags[] = {
+ { "usevc", ARES_FLAG_USEVC },
+ { "primary", ARES_FLAG_PRIMARY },
+ { "igntc", ARES_FLAG_IGNTC },
+ { "norecurse", ARES_FLAG_NORECURSE },
+ { "stayopen", ARES_FLAG_STAYOPEN },
+ { "noaliases", ARES_FLAG_NOALIASES }
+};
+static const int nflags = sizeof(flags) / sizeof(flags[0]);
+
+static const struct nv classes[] = {
+ { "IN", C_IN },
+ { "CHAOS", C_CHAOS },
+ { "HS", C_HS },
+ { "ANY", C_ANY }
+};
+static const int nclasses = sizeof(classes) / sizeof(classes[0]);
+
+static const struct nv types[] = {
+ { "A", T_A },
+ { "NS", T_NS },
+ { "MD", T_MD },
+ { "MF", T_MF },
+ { "CNAME", T_CNAME },
+ { "SOA", T_SOA },
+ { "MB", T_MB },
+ { "MG", T_MG },
+ { "MR", T_MR },
+ { "NULL", T_NULL },
+ { "WKS", T_WKS },
+ { "PTR", T_PTR },
+ { "HINFO", T_HINFO },
+ { "MINFO", T_MINFO },
+ { "MX", T_MX },
+ { "TXT", T_TXT },
+ { "RP", T_RP },
+ { "AFSDB", T_AFSDB },
+ { "X25", T_X25 },
+ { "ISDN", T_ISDN },
+ { "RT", T_RT },
+ { "NSAP", T_NSAP },
+ { "NSAP_PTR", T_NSAP_PTR },
+ { "SIG", T_SIG },
+ { "KEY", T_KEY },
+ { "PX", T_PX },
+ { "GPOS", T_GPOS },
+ { "AAAA", T_AAAA },
+ { "LOC", T_LOC },
+ { "SRV", T_SRV },
+ { "AXFR", T_AXFR },
+ { "MAILB", T_MAILB },
+ { "MAILA", T_MAILA },
+ { "NAPTR", T_NAPTR },
+ { "DS", T_DS },
+ { "SSHFP", T_SSHFP },
+ { "RRSIG", T_RRSIG },
+ { "NSEC", T_NSEC },
+ { "DNSKEY", T_DNSKEY },
+ { "CAA", T_CAA },
+ { "ANY", T_ANY }
+};
+static const int ntypes = sizeof(types) / sizeof(types[0]);
+
+static const char *opcodes[] = {
+ "QUERY", "IQUERY", "STATUS", "(reserved)", "NOTIFY",
+ "(unknown)", "(unknown)", "(unknown)", "(unknown)",
+ "UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
+ "ZONEINIT", "ZONEREF"
+};
+
+static const char *rcodes[] = {
+ "NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
+ "(unknown)", "(unknown)", "(unknown)", "(unknown)", "(unknown)",
+ "(unknown)", "(unknown)", "(unknown)", "(unknown)", "NOCHANGE"
+};
+
+static void callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen);
+static const unsigned char *display_question(const unsigned char *aptr,
+ const unsigned char *abuf,
+ int alen);
+static const unsigned char *display_rr(const unsigned char *aptr,
+ const unsigned char *abuf, int alen);
+static int convert_query (char **name, int use_bitstring);
+static const char *type_name(int type);
+static const char *class_name(int dnsclass);
+static void usage(void);
+static void destroy_addr_list(struct ares_addr_node *head);
+static void append_addr_list(struct ares_addr_node **head,
+ struct ares_addr_node *node);
+static void print_help_info_adig(void);
+
+int main(int argc, char **argv)
+{
+ ares_channel channel;
+ int c, i, optmask = ARES_OPT_FLAGS, dnsclass = C_IN, type = T_A;
+ int status, nfds, count;
+ int use_ptr_helper = 0;
+ struct ares_options options;
+ struct hostent *hostent;
+ fd_set read_fds, write_fds;
+ struct timeval *tvp, tv;
+ struct ares_addr_node *srvr, *servers = NULL;
+
+#ifdef USE_WINSOCK
+ WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ status = ares_library_init(ARES_LIB_INIT_ALL);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
+ options.flags = ARES_FLAG_NOCHECKRESP;
+ options.servers = NULL;
+ options.nservers = 0;
+ while ((c = ares_getopt(argc, argv, "dh?f:s:c:t:T:U:x")) != -1)
+ {
+ switch (c)
+ {
+ case 'd':
+#ifdef WATT32
+ dbug_init();
+#endif
+ break;
+ case 'h':
+ print_help_info_adig();
+ break;
+ case '?':
+ print_help_info_adig();
+ break;
+ case 'f':
+ /* Add a flag. */
+ for (i = 0; i < nflags; i++)
+ {
+ if (strcmp(flags[i].name, optarg) == 0)
+ break;
+ }
+ if (i < nflags)
+ options.flags |= flags[i].value;
+ else
+ usage();
+ break;
+
+ case 's':
+ /* User-specified name servers override default ones. */
+ srvr = malloc(sizeof(struct ares_addr_node));
+ if (!srvr)
+ {
+ fprintf(stderr, "Out of memory!\n");
+ destroy_addr_list(servers);
+ return 1;
+ }
+ append_addr_list(&servers, srvr);
+ if (ares_inet_pton(AF_INET, optarg, &srvr->addr.addr4) > 0)
+ srvr->family = AF_INET;
+ else if (ares_inet_pton(AF_INET6, optarg, &srvr->addr.addr6) > 0)
+ srvr->family = AF_INET6;
+ else
+ {
+ hostent = gethostbyname(optarg);
+ if (!hostent)
+ {
+ fprintf(stderr, "adig: server %s not found.\n", optarg);
+ destroy_addr_list(servers);
+ return 1;
+ }
+ switch (hostent->h_addrtype)
+ {
+ case AF_INET:
+ srvr->family = AF_INET;
+ memcpy(&srvr->addr.addr4, hostent->h_addr,
+ sizeof(srvr->addr.addr4));
+ break;
+ case AF_INET6:
+ srvr->family = AF_INET6;
+ memcpy(&srvr->addr.addr6, hostent->h_addr,
+ sizeof(srvr->addr.addr6));
+ break;
+ default:
+ fprintf(stderr,
+ "adig: server %s unsupported address family.\n", optarg);
+ destroy_addr_list(servers);
+ return 1;
+ }
+ }
+ /* Notice that calling ares_init_options() without servers in the
+ * options struct and with ARES_OPT_SERVERS set simultaneously in
+ * the options mask, results in an initialization with no servers.
+ * When alternative name servers have been specified these are set
+ * later calling ares_set_servers() overriding any existing server
+ * configuration. To prevent initial configuration with default
+ * servers that will be discarded later, ARES_OPT_SERVERS is set.
+ * If this flag is not set here the result shall be the same but
+ * ares_init_options() will do needless work. */
+ optmask |= ARES_OPT_SERVERS;
+ break;
+
+ case 'c':
+ /* Set the query class. */
+ for (i = 0; i < nclasses; i++)
+ {
+ if (strcasecmp(classes[i].name, optarg) == 0)
+ break;
+ }
+ if (i < nclasses)
+ dnsclass = classes[i].value;
+ else
+ usage();
+ break;
+
+ case 't':
+ /* Set the query type. */
+ for (i = 0; i < ntypes; i++)
+ {
+ if (strcasecmp(types[i].name, optarg) == 0)
+ break;
+ }
+ if (i < ntypes)
+ type = types[i].value;
+ else
+ usage();
+ break;
+
+ case 'T':
+ /* Set the TCP port number. */
+ if (!ISDIGIT(*optarg))
+ usage();
+ options.tcp_port = (unsigned short)strtol(optarg, NULL, 0);
+ optmask |= ARES_OPT_TCP_PORT;
+ break;
+
+ case 'U':
+ /* Set the UDP port number. */
+ if (!ISDIGIT(*optarg))
+ usage();
+ options.udp_port = (unsigned short)strtol(optarg, NULL, 0);
+ optmask |= ARES_OPT_UDP_PORT;
+ break;
+
+ case 'x':
+ use_ptr_helper++;
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ if (argc == 0)
+ usage();
+
+ status = ares_init_options(&channel, &options, optmask);
+
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_init_options: %s\n",
+ ares_strerror(status));
+ return 1;
+ }
+
+ if(servers)
+ {
+ status = ares_set_servers(channel, servers);
+ destroy_addr_list(servers);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_init_options: %s\n",
+ ares_strerror(status));
+ return 1;
+ }
+ }
+
+ /* Initiate the queries, one per command-line argument. If there is
+ * only one query to do, supply NULL as the callback argument;
+ * otherwise, supply the query name as an argument so we can
+ * distinguish responses for the user when printing them out.
+ */
+ for (i = 1; *argv; i++, argv++)
+ {
+ char *query = *argv;
+
+ if (type == T_PTR && dnsclass == C_IN && use_ptr_helper)
+ if (!convert_query (&query, use_ptr_helper >= 2))
+ continue;
+
+ ares_query(channel, query, dnsclass, type, callback, i < argc-1 ? (void*)query : NULL);
+ }
+
+ /* Wait for all queries to complete. */
+ for (;;)
+ {
+ FD_ZERO(&read_fds);
+ FD_ZERO(&write_fds);
+ nfds = ares_fds(channel, &read_fds, &write_fds);
+ if (nfds == 0)
+ break;
+ tvp = ares_timeout(channel, NULL, &tv);
+ count = select(nfds, &read_fds, &write_fds, NULL, tvp);
+ if (count < 0 && (status = SOCKERRNO) != EINVAL)
+ {
+ printf("select fail: %d", status);
+ return 1;
+ }
+ ares_process(channel, &read_fds, &write_fds);
+ }
+
+ ares_destroy(channel);
+
+ ares_library_cleanup();
+
+#ifdef USE_WINSOCK
+ WSACleanup();
+#endif
+
+ return 0;
+}
+
+static void callback(void *arg, int status, int timeouts,
+ unsigned char *abuf, int alen)
+{
+ char *name = (char *) arg;
+ int id, qr, opcode, aa, tc, rd, ra, rcode;
+ unsigned int qdcount, ancount, nscount, arcount, i;
+ const unsigned char *aptr;
+
+ (void) timeouts;
+
+ /* Display the query name if given. */
+ if (name)
+ printf("Answer for query %s:\n", name);
+
+ /* Display an error message if there was an error, but only stop if
+ * we actually didn't get an answer buffer.
+ */
+ if (status != ARES_SUCCESS)
+ {
+ printf("%s\n", ares_strerror(status));
+ if (!abuf)
+ return;
+ }
+
+ /* Won't happen, but check anyway, for safety. */
+ if (alen < HFIXEDSZ)
+ return;
+
+ /* Parse the answer header. */
+ id = DNS_HEADER_QID(abuf);
+ qr = DNS_HEADER_QR(abuf);
+ opcode = DNS_HEADER_OPCODE(abuf);
+ aa = DNS_HEADER_AA(abuf);
+ tc = DNS_HEADER_TC(abuf);
+ rd = DNS_HEADER_RD(abuf);
+ ra = DNS_HEADER_RA(abuf);
+ rcode = DNS_HEADER_RCODE(abuf);
+ qdcount = DNS_HEADER_QDCOUNT(abuf);
+ ancount = DNS_HEADER_ANCOUNT(abuf);
+ nscount = DNS_HEADER_NSCOUNT(abuf);
+ arcount = DNS_HEADER_ARCOUNT(abuf);
+
+ /* Display the answer header. */
+ printf("id: %d\n", id);
+ printf("flags: %s%s%s%s%s\n",
+ qr ? "qr " : "",
+ aa ? "aa " : "",
+ tc ? "tc " : "",
+ rd ? "rd " : "",
+ ra ? "ra " : "");
+ printf("opcode: %s\n", opcodes[opcode]);
+ printf("rcode: %s\n", rcodes[rcode]);
+
+ /* Display the questions. */
+ printf("Questions:\n");
+ aptr = abuf + HFIXEDSZ;
+ for (i = 0; i < qdcount; i++)
+ {
+ aptr = display_question(aptr, abuf, alen);
+ if (aptr == NULL)
+ return;
+ }
+
+ /* Display the answers. */
+ printf("Answers:\n");
+ for (i = 0; i < ancount; i++)
+ {
+ aptr = display_rr(aptr, abuf, alen);
+ if (aptr == NULL)
+ return;
+ }
+
+ /* Display the NS records. */
+ printf("NS records:\n");
+ for (i = 0; i < nscount; i++)
+ {
+ aptr = display_rr(aptr, abuf, alen);
+ if (aptr == NULL)
+ return;
+ }
+
+ /* Display the additional records. */
+ printf("Additional records:\n");
+ for (i = 0; i < arcount; i++)
+ {
+ aptr = display_rr(aptr, abuf, alen);
+ if (aptr == NULL)
+ return;
+ }
+}
+
+static const unsigned char *display_question(const unsigned char *aptr,
+ const unsigned char *abuf,
+ int alen)
+{
+ char *name;
+ int type, dnsclass, status;
+ long len;
+
+ /* Parse the question name. */
+ status = ares_expand_name(aptr, abuf, alen, &name, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ aptr += len;
+
+ /* Make sure there's enough data after the name for the fixed part
+ * of the question.
+ */
+ if (aptr + QFIXEDSZ > abuf + alen)
+ {
+ ares_free_string(name);
+ return NULL;
+ }
+
+ /* Parse the question type and class. */
+ type = DNS_QUESTION_TYPE(aptr);
+ dnsclass = DNS_QUESTION_CLASS(aptr);
+ aptr += QFIXEDSZ;
+
+ /* Display the question, in a format sort of similar to how we will
+ * display RRs.
+ */
+ printf("\t%-15s.\t", name);
+ if (dnsclass != C_IN)
+ printf("\t%s", class_name(dnsclass));
+ printf("\t%s\n", type_name(type));
+ ares_free_string(name);
+ return aptr;
+}
+
+static const unsigned char *display_rr(const unsigned char *aptr,
+ const unsigned char *abuf, int alen)
+{
+ const unsigned char *p;
+ int type, dnsclass, ttl, dlen, status;
+ long len;
+ int vlen;
+ char addr[46];
+ union {
+ unsigned char * as_uchar;
+ char * as_char;
+ } name;
+
+ /* Parse the RR name. */
+ status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ aptr += len;
+
+ /* Make sure there is enough data after the RR name for the fixed
+ * part of the RR.
+ */
+ if (aptr + RRFIXEDSZ > abuf + alen)
+ {
+ ares_free_string(name.as_char);
+ return NULL;
+ }
+
+ /* Parse the fixed part of the RR, and advance to the RR data
+ * field. */
+ type = DNS_RR_TYPE(aptr);
+ dnsclass = DNS_RR_CLASS(aptr);
+ ttl = DNS_RR_TTL(aptr);
+ dlen = DNS_RR_LEN(aptr);
+ aptr += RRFIXEDSZ;
+ if (aptr + dlen > abuf + alen)
+ {
+ ares_free_string(name.as_char);
+ return NULL;
+ }
+
+ /* Display the RR name, class, and type. */
+ printf("\t%-15s.\t%d", name.as_char, ttl);
+ if (dnsclass != C_IN)
+ printf("\t%s", class_name(dnsclass));
+ printf("\t%s", type_name(type));
+ ares_free_string(name.as_char);
+
+ /* Display the RR data. Don't touch aptr. */
+ switch (type)
+ {
+ case T_CNAME:
+ case T_MB:
+ case T_MD:
+ case T_MF:
+ case T_MG:
+ case T_MR:
+ case T_NS:
+ case T_PTR:
+ /* For these types, the RR data is just a domain name. */
+ status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_HINFO:
+ /* The RR data is two length-counted character strings. */
+ p = aptr;
+ len = *p;
+ if (p + len + 1 > aptr + dlen)
+ return NULL;
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+ len = *p;
+ if (p + len + 1 > aptr + dlen)
+ return NULL;
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_MINFO:
+ /* The RR data is two domain names. */
+ p = aptr;
+ status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+ status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_MX:
+ /* The RR data is two bytes giving a preference ordering, and
+ * then a domain name.
+ */
+ if (dlen < 2)
+ return NULL;
+ printf("\t%d", (int)DNS__16BIT(aptr));
+ status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_SOA:
+ /* The RR data is two domain names and then five four-byte
+ * numbers giving the serial number and some timeouts.
+ */
+ p = aptr;
+ status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.\n", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+ status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t\t\t\t\t\t%s.\n", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+ if (p + 20 > aptr + dlen)
+ return NULL;
+ printf("\t\t\t\t\t\t( %u %u %u %u %u )",
+ DNS__32BIT(p), DNS__32BIT(p+4),
+ DNS__32BIT(p+8), DNS__32BIT(p+12),
+ DNS__32BIT(p+16));
+ break;
+
+ case T_TXT:
+ /* The RR data is one or more length-counted character
+ * strings. */
+ p = aptr;
+ while (p < aptr + dlen)
+ {
+ len = *p;
+ if (p + len + 1 > aptr + dlen)
+ return NULL;
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+ }
+ break;
+
+ case T_CAA:
+
+ p = aptr;
+
+ /* Flags */
+ printf(" %u", (int)*p);
+ p += 1;
+
+ /* Remainder of record */
+ vlen = (int)dlen - ((char)*p) - 2;
+
+ /* The Property identifier, one of:
+ - "issue",
+ - "iodef", or
+ - "issuewild" */
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf(" %s", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+
+ if (p + vlen > abuf + alen)
+ return NULL;
+
+ /* A sequence of octets representing the Property Value */
+ printf(" %.*s", vlen, p);
+ break;
+
+ case T_A:
+ /* The RR data is a four-byte Internet address. */
+ if (dlen != 4)
+ return NULL;
+ printf("\t%s", ares_inet_ntop(AF_INET,aptr,addr,sizeof(addr)));
+ break;
+
+ case T_AAAA:
+ /* The RR data is a 16-byte IPv6 address. */
+ if (dlen != 16)
+ return NULL;
+ printf("\t%s", ares_inet_ntop(AF_INET6,aptr,addr,sizeof(addr)));
+ break;
+
+ case T_WKS:
+ /* Not implemented yet */
+ break;
+
+ case T_SRV:
+ /* The RR data is three two-byte numbers representing the
+ * priority, weight, and port, followed by a domain name.
+ */
+
+ printf("\t%d", (int)DNS__16BIT(aptr));
+ printf(" %d", (int)DNS__16BIT(aptr + 2));
+ printf(" %d", (int)DNS__16BIT(aptr + 4));
+
+ status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t%s.", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_NAPTR:
+
+ printf("\t%d", (int)DNS__16BIT(aptr)); /* order */
+ printf(" %d\n", (int)DNS__16BIT(aptr + 2)); /* preference */
+
+ p = aptr + 4;
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t\t\t\t\t\t%s\n", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t\t\t\t\t\t%s\n", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+
+ status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t\t\t\t\t\t%s\n", name.as_char);
+ ares_free_string(name.as_char);
+ p += len;
+
+ status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
+ if (status != ARES_SUCCESS)
+ return NULL;
+ printf("\t\t\t\t\t\t%s", name.as_char);
+ ares_free_string(name.as_char);
+ break;
+
+ case T_DS:
+ case T_SSHFP:
+ case T_RRSIG:
+ case T_NSEC:
+ case T_DNSKEY:
+ printf("\t[RR type parsing unavailable]");
+ break;
+
+ default:
+ printf("\t[Unknown RR; cannot parse]");
+ break;
+ }
+ printf("\n");
+
+ return aptr + dlen;
+}
+
+/*
+ * With the '-x' (or '-xx') and '-t PTR' options, convert a query for an
+ * address into a more useful 'T_PTR' type question.
+ * Like with an input 'query':
+ * "a.b.c.d" -> "d.c.b.a".in-addr.arpa" for an IPv4 address.
+ * "a.b.c....x.y.z" -> "z.y.x....c.d.e.IP6.ARPA" for an IPv6 address.
+ *
+ * An example from 'dig -x PTR 2001:470:1:1b9::31':
+ *
+ * QUESTION SECTION:
+ * 1.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.b.1.0.1.0.0.0.0.7.4.0.1.0.0.2.IP6.ARPA. IN PTR
+ *
+ * ANSWER SECTION:
+ * 1.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.b.1.0.1.0.0.0.0.7.4.0.1.0.0.2.IP6.ARPA. 254148 IN PTR ipv6.cybernode.com.
+ *
+ * If 'use_bitstring == 1', try to use the more compact RFC-2673 bitstring format.
+ * Thus the above 'dig' query should become:
+ * [x13000000000000009b10100007401002].IP6.ARPA. IN PTR
+ */
+static int convert_query (char **name_p, int use_bitstring)
+{
+#ifndef MAX_IP6_RR
+#define MAX_IP6_RR (16*sizeof(".x.x") + sizeof(".IP6.ARPA") + 1)
+#endif
+
+#ifdef HAVE_INET_PTON
+ #define ACCEPTED_RETVAL4 1
+ #define ACCEPTED_RETVAL6 1
+#else
+ #define ACCEPTED_RETVAL4 32
+ #define ACCEPTED_RETVAL6 128
+#endif
+
+ static char new_name [MAX_IP6_RR];
+ static const char hex_chars[] = "0123456789ABCDEF";
+
+ union {
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+ } addr;
+
+ if (ares_inet_pton (AF_INET, *name_p, &addr.addr4) == 1)
+ {
+ unsigned long laddr = ntohl(addr.addr4.s_addr);
+ unsigned long a1 = (laddr >> 24UL) & 0xFFUL;
+ unsigned long a2 = (laddr >> 16UL) & 0xFFUL;
+ unsigned long a3 = (laddr >> 8UL) & 0xFFUL;
+ unsigned long a4 = laddr & 0xFFUL;
+
+ snprintf(new_name, sizeof(new_name), "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1);
+ *name_p = new_name;
+ return (1);
+ }
+
+ if (ares_inet_pton(AF_INET6, *name_p, &addr.addr6) == 1)
+ {
+ char *c = new_name;
+ const unsigned char *ip = (const unsigned char*) &addr.addr6;
+ int max_i = (int)sizeof(addr.addr6) - 1;
+ int i, hi, lo;
+
+ /* Use the more compact RFC-2673 notation?
+ * Currently doesn't work or unsupported by the DNS-servers I've tested against.
+ */
+ if (use_bitstring)
+ {
+ *c++ = '\\';
+ *c++ = '[';
+ *c++ = 'x';
+ for (i = max_i; i >= 0; i--)
+ {
+ hi = ip[i] >> 4;
+ lo = ip[i] & 15;
+ *c++ = hex_chars [lo];
+ *c++ = hex_chars [hi];
+ }
+ strcpy (c, "].IP6.ARPA");
+ }
+ else
+ {
+ for (i = max_i; i >= 0; i--)
+ {
+ hi = ip[i] >> 4;
+ lo = ip[i] & 15;
+ *c++ = hex_chars [lo];
+ *c++ = '.';
+ *c++ = hex_chars [hi];
+ *c++ = '.';
+ }
+ strcpy (c, "IP6.ARPA");
+ }
+ *name_p = new_name;
+ return (1);
+ }
+ printf("Address %s was not legal for this query.\n", *name_p);
+ return (0);
+}
+
+static const char *type_name(int type)
+{
+ int i;
+
+ for (i = 0; i < ntypes; i++)
+ {
+ if (types[i].value == type)
+ return types[i].name;
+ }
+ return "(unknown)";
+}
+
+static const char *class_name(int dnsclass)
+{
+ int i;
+
+ for (i = 0; i < nclasses; i++)
+ {
+ if (classes[i].value == dnsclass)
+ return classes[i].name;
+ }
+ return "(unknown)";
+}
+
+static void usage(void)
+{
+ fprintf(stderr, "usage: adig [-h] [-d] [-f flag] [-s server] [-c class] "
+ "[-t type] [-T|U port] [-x|-xx] name ...\n");
+ exit(1);
+}
+
+static void destroy_addr_list(struct ares_addr_node *head)
+{
+ while(head)
+ {
+ struct ares_addr_node *detached = head;
+ head = head->next;
+ free(detached);
+ }
+}
+
+static void append_addr_list(struct ares_addr_node **head,
+ struct ares_addr_node *node)
+{
+ struct ares_addr_node *last;
+ node->next = NULL;
+ if(*head)
+ {
+ last = *head;
+ while(last->next)
+ last = last->next;
+ last->next = node;
+ }
+ else
+ *head = node;
+}
+
+
+/* Information from the man page. Formatting taken from man -h */
+static void print_help_info_adig(void) {
+ printf("adig, version %s \n\n", ARES_VERSION_STR);
+ printf("usage: adig [-h] [-d] [-f flag] [-s server] [-c class] [-t type] [-T|U port] [-x | -xx] name ...\n\n"
+ " d : Print some extra debugging output.\n"
+ " f : Add a flag. Possible values for flag are igntc, noaliases, norecurse, primary, stayopen, usevc.\n"
+ " h : Display this help and exit.\n\n"
+ " T port : Use specified TCP port to connect to DNS server.\n"
+ " U port : Use specified UDP port to connect to DNS server.\n"
+ " c class : Set the query class. Possible values for class are NY, CHAOS, HS, IN (default).\n"
+ " s server : Connect to specified DNS server, instead of the system's default one(s).\n"
+ " t type : Query records of specified type. \n"
+ " Possible values for type are A \n"
+ " (default), AAAA, AFSDB, ANY,\n"
+ " AXFR, CNAME, GPOS, HINFO, ISDN,\n"
+ " KEY, LOC, MAILA, MAILB, MB, MD,\n"
+ " MF, MG, MINFO, MR, MX, NAPTR, NS,\n"
+ " NSAP, NSAP_PTR, NULL, PTR, PX, RP,\n"
+ " RT, SIG, SOA, SRV, TXT, WKS, X25\n\n"
+ " -x : For a '-t PTR a.b.c.d' lookup, query for 'd.c.b.a.in-addr.arpa.'\n"
+ " -xx : As above, but for IPv6, compact the format into a bitstring like\n"
+ " '[xabcdef00000000000000000000000000].IP6.ARPA.'\n");
+ exit(0);
+}
diff --git a/grpc/third_party/cares/cares/src/tools/ahost.c b/grpc/third_party/cares/cares/src/tools/ahost.c
new file mode 100644
index 00000000..77ca7cd0
--- /dev/null
+++ b/grpc/third_party/cares/cares/src/tools/ahost.c
@@ -0,0 +1,231 @@
+/* Copyright 1998 by the Massachusetts Institute of Technology.
+ *
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software and its documentation for any purpose and without
+ * fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+
+#include "ares_setup.h"
+
+#if !defined(WIN32) || defined(WATT32)
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#include "ares.h"
+#include "ares_dns.h"
+#include "ares_getopt.h"
+#include "ares_ipv6.h"
+#include "ares_nowarn.h"
+
+#ifndef HAVE_STRDUP
+# include "ares_strdup.h"
+# define strdup(ptr) ares_strdup(ptr)
+#endif
+
+#ifndef HAVE_STRCASECMP
+# include "ares_strcasecmp.h"
+# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
+#endif
+
+#ifndef HAVE_STRNCASECMP
+# include "ares_strcasecmp.h"
+# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
+#endif
+
+static void callback(void *arg, int status, int timeouts, struct hostent *host);
+static void usage(void);
+static void print_help_info_ahost(void);
+
+int main(int argc, char **argv)
+{
+ struct ares_options options;
+ int optmask = 0;
+ ares_channel channel;
+ int status, nfds, c, addr_family = AF_INET;
+ fd_set read_fds, write_fds;
+ struct timeval *tvp, tv;
+ struct in_addr addr4;
+ struct ares_in6_addr addr6;
+
+#ifdef USE_WINSOCK
+ WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+ memset(&options, 0, sizeof(options));
+
+ status = ares_library_init(ARES_LIB_INIT_ALL);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
+ while ((c = ares_getopt(argc,argv,"dt:h?s:")) != -1)
+ {
+ switch (c)
+ {
+ case 'd':
+#ifdef WATT32
+ dbug_init();
+#endif
+ break;
+ case 's':
+ optmask |= ARES_OPT_DOMAINS;
+ options.ndomains++;
+ options.domains = (char **)realloc(options.domains,
+ options.ndomains * sizeof(char *));
+ options.domains[options.ndomains - 1] = strdup(optarg);
+ break;
+ case 't':
+ if (!strcasecmp(optarg,"a"))
+ addr_family = AF_INET;
+ else if (!strcasecmp(optarg,"aaaa"))
+ addr_family = AF_INET6;
+ else if (!strcasecmp(optarg,"u"))
+ addr_family = AF_UNSPEC;
+ else
+ usage();
+ break;
+ case 'h':
+ print_help_info_ahost();
+ break;
+ case '?':
+ print_help_info_ahost();
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+ if (argc < 1)
+ usage();
+
+ status = ares_init_options(&channel, &options, optmask);
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
+ return 1;
+ }
+
+ /* Initiate the queries, one per command-line argument. */
+ for ( ; *argv; argv++)
+ {
+ if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
+ {
+ ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback,
+ *argv);
+ }
+ else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1)
+ {
+ ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback,
+ *argv);
+ }
+ else
+ {
+ ares_gethostbyname(channel, *argv, addr_family, callback, *argv);
+ }
+ }
+
+ /* Wait for all queries to complete. */
+ for (;;)
+ {
+ int res;
+ FD_ZERO(&read_fds);
+ FD_ZERO(&write_fds);
+ nfds = ares_fds(channel, &read_fds, &write_fds);
+ if (nfds == 0)
+ break;
+ tvp = ares_timeout(channel, NULL, &tv);
+ res = select(nfds, &read_fds, &write_fds, NULL, tvp);
+ if (-1 == res)
+ break;
+ ares_process(channel, &read_fds, &write_fds);
+ }
+
+ ares_destroy(channel);
+
+ ares_library_cleanup();
+
+#ifdef USE_WINSOCK
+ WSACleanup();
+#endif
+
+ return 0;
+}
+
+static void callback(void *arg, int status, int timeouts, struct hostent *host)
+{
+ char **p;
+
+ (void)timeouts;
+
+ if (status != ARES_SUCCESS)
+ {
+ fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
+ return;
+ }
+
+ for (p = host->h_addr_list; *p; p++)
+ {
+ char addr_buf[46] = "??";
+
+ ares_inet_ntop(host->h_addrtype, *p, addr_buf, sizeof(addr_buf));
+ printf("%-32s\t%s", host->h_name, addr_buf);
+#if 0
+ if (host->h_aliases[0])
+ {
+ int i;
+
+ printf (", Aliases: ");
+ for (i = 0; host->h_aliases[i]; i++)
+ printf("%s ", host->h_aliases[i]);
+ }
+#endif
+ puts("");
+ }
+}
+
+static void usage(void)
+{
+ fprintf(stderr, "usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n");
+ exit(1);
+}
+
+/* Information from the man page. Formatting taken from man -h */
+static void print_help_info_ahost(void) {
+ printf("ahost, version %s \n\n", ARES_VERSION_STR);
+ printf("usage: ahost [-h] [-d] [-s {domain}] [-t {a|aaaa|u}] {host|addr} ...\n\n"
+ " d : Print some extra debugging output.\n"
+ " h : Display this help and exit.\n\n"
+ " s domain : Specify the domain to search instead of \n"
+ " using the default values from \n"
+ " /etc/resolv.conf. This option only has an \n"
+ " effect on platforms that use /etc/resolv.conf\n"
+ " for DNS configuration; it has no effect on other\n"
+ " platforms (such as Win32 or Android).\n"
+ " t type : If type is \"a\", print the A record (default).\n"
+ " If type is \"aaaa\", print the AAAA record. If\n"
+ " type is \"u\", look for either AAAA or A record\n"
+ " (in that order).\n\n");
+ exit(0);
+}
diff --git a/grpc/third_party/cares/cares/ares_getopt.c b/grpc/third_party/cares/cares/src/tools/ares_getopt.c
index 1e02d086..1e02d086 100644
--- a/grpc/third_party/cares/cares/ares_getopt.c
+++ b/grpc/third_party/cares/cares/src/tools/ares_getopt.c
diff --git a/grpc/third_party/cares/cares/ares_getopt.h b/grpc/third_party/cares/cares/src/tools/ares_getopt.h
index 63acb3b4..63acb3b4 100644
--- a/grpc/third_party/cares/cares/ares_getopt.h
+++ b/grpc/third_party/cares/cares/src/tools/ares_getopt.h
diff --git a/grpc/third_party/cares/cares/test/CMakeLists.txt b/grpc/third_party/cares/cares/test/CMakeLists.txt
index a3acb81a..714ad972 100644
--- a/grpc/third_party/cares/cares/test/CMakeLists.txt
+++ b/grpc/third_party/cares/cares/test/CMakeLists.txt
@@ -7,11 +7,22 @@ enable_language(CXX)
find_package(Threads)
# create target to access and use internal cares library
-set(ARES_SRC_DIR ${c-ares_SOURCE_DIR})
add_library(caresinternal INTERFACE)
target_compile_definitions(caresinternal INTERFACE HAVE_CONFIG_H=1)
-target_include_directories(caresinternal INTERFACE ${ARES_SRC_DIR})
-target_link_libraries(caresinternal INTERFACE ${PROJECT_NAME})
+
+target_include_directories(caresinternal
+ INTERFACE "${PROJECT_BINARY_DIR}"
+ "${PROJECT_SOURCE_DIR}"
+ "${PROJECT_SOURCE_DIR}/src/lib"
+ "${CARES_TOPLEVEL_DIR}/include"
+ "${CMAKE_INSTALL_INCLUDEDIR}"
+)
+
+IF (CARES_STATIC)
+ target_link_libraries(caresinternal INTERFACE ${PROJECT_NAME}::cares_static)
+ELSE ()
+ target_link_libraries(caresinternal INTERFACE ${PROJECT_NAME}::cares)
+ENDIF ()
# Google Test and Mock
set(GMOCK_DIR gmock-1.8.0)
@@ -28,12 +39,16 @@ target_link_libraries(gmock PRIVATE ${CMAKE_THREAD_LIBS_INIT})
transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include(${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake)
-configure_file(${ARES_SRC_DIR}/ares_config.h.cmake config.h)
+configure_file(${CARES_TOPLEVEL_DIR}/src/lib/ares_config.h.cmake config.h)
add_executable(arestest ${TESTSOURCES} ${TESTHEADERS})
target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(arestest PRIVATE caresinternal gmock)
+IF (CARES_BUILD_CONTAINER_TESTS)
+ target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE)
+ENDIF ()
+
add_executable(aresfuzz ${FUZZSOURCES})
target_link_libraries(aresfuzz PRIVATE caresinternal)
diff --git a/grpc/third_party/cares/cares/test/Makefile.am b/grpc/third_party/cares/cares/test/Makefile.am
index 6ae503bd..f2d982da 100644
--- a/grpc/third_party/cares/cares/test/Makefile.am
+++ b/grpc/third_party/cares/cares/test/Makefile.am
@@ -1,12 +1,16 @@
-# Where to find the c-ares source code; needed because the tests use library-internal headers
-ARES_SRC_DIR = ..
-# Where to find the built c-ares static library
-ARES_BLD_DIR = ..
-AUTOMAKE_OPTIONS = foreign
-ACLOCAL_AMFLAGS = -I ../m4
-GMOCK_DIR = gmock-1.8.0
+ARES_BLD_DIR = $(top_builddir)/..
+ARES_SRC_DIR = $(top_srcdir)/..
+
+AUTOMAKE_OPTIONS = foreign subdir-objects nostdinc 1.9.6
+ACLOCAL_AMFLAGS = -I ../m4 --install
+
# Note use of -isystem to force use of local gMock/gTest even if there's an installed version.
-CPPFLAGS += -I$(ARES_SRC_DIR) -isystem $(GMOCK_DIR)
+CPPFLAGS += -I$(ARES_BLD_DIR)/include \
+ -I$(ARES_BLD_DIR)/src/lib \
+ -I$(ARES_SRC_DIR)/include \
+ -I$(ARES_SRC_DIR)/src/lib \
+ -I$(top_builddir) \
+ -isystem $(srcdir)/gmock-1.8.0
CXXFLAGS += -Wall $(PTHREAD_CFLAGS)
# Makefile.inc provides the various *SOURCES and *HEADERS defines
@@ -14,31 +18,34 @@ include Makefile.inc
TESTS = arestest fuzzcheck.sh
+noinst_LTLIBRARIES = libgmock.la
+
+libgmock_la_SOURCES = \
+ gmock-1.8.0/gmock-gtest-all.cc \
+ gmock-1.8.0/gmock/gmock.h \
+ gmock-1.8.0/gtest/gtest.h
+
+libgmock_la_CPPFLAGS = -isystem $(srcdir)/gmock-1.8.0
+
+
noinst_PROGRAMS = arestest aresfuzz aresfuzzname dnsdump
-EXTRA_DIST = fuzzcheck.sh CMakeLists.txt
+EXTRA_DIST = fuzzcheck.sh CMakeLists.txt Makefile.m32 Makefile.msvc README.md buildconf $(srcdir)/fuzzinput/* $(srcdir)/fuzznames/*
arestest_SOURCES = $(TESTSOURCES) $(TESTHEADERS)
-arestest_LDADD = libgmock.la $(ARES_BLD_DIR)/libcares.la $(PTHREAD_LIBS)
+arestest_LDADD = libgmock.la $(ARES_BLD_DIR)/src/lib/libcares.la $(PTHREAD_LIBS)
# Not interested in coverage of test code, but linking the test binary needs the coverage option
@CODE_COVERAGE_RULES@
arestest_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
-noinst_LTLIBRARIES = libgmock.la
-
-libgmock_la_SOURCES = \
- $(GMOCK_DIR)/gmock-gtest-all.cc \
- $(GMOCK_DIR)/gmock/gmock.h \
- $(GMOCK_DIR)/gtest/gtest.h
-libgmock_la_CPPFLAGS = -isystem $(GMOCK_DIR)
aresfuzz_SOURCES = $(FUZZSOURCES)
-aresfuzz_LDADD = $(ARES_BLD_DIR)/libcares.la
+aresfuzz_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la
aresfuzzname_SOURCES = $(FUZZNAMESOURCES)
-aresfuzzname_LDADD = $(ARES_BLD_DIR)/libcares.la
+aresfuzzname_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la
dnsdump_SOURCES = $(DUMPSOURCES)
-dnsdump_LDADD = $(ARES_BLD_DIR)/libcares.la
+dnsdump_LDADD = $(ARES_BLD_DIR)/src/lib/libcares.la
test: check
diff --git a/grpc/third_party/cares/cares/test/Makefile.inc b/grpc/third_party/cares/cares/test/Makefile.inc
index add55341..2c2769dc 100644
--- a/grpc/third_party/cares/cares/test/Makefile.inc
+++ b/grpc/third_party/cares/cares/test/Makefile.inc
@@ -5,22 +5,26 @@ TESTSOURCES = ares-test-main.cc \
ares-test-parse.cc \
ares-test-parse-a.cc \
ares-test-parse-aaaa.cc \
+ ares-test-parse-caa.cc \
ares-test-parse-mx.cc \
ares-test-parse-naptr.cc \
ares-test-parse-ns.cc \
ares-test-parse-ptr.cc \
ares-test-parse-soa.cc \
+ ares-test-parse-soa-any.cc \
ares-test-parse-srv.cc \
ares-test-parse-txt.cc \
ares-test-misc.cc \
ares-test-live.cc \
ares-test-mock.cc \
+ ares-test-mock-ai.cc \
ares-test-internal.cc \
dns-proto.cc \
dns-proto-test.cc
TESTHEADERS = ares-test.h \
- dns-proto.h
+ dns-proto.h \
+ ares-test-ai.h
FUZZSOURCES = ares-test-fuzz.c \
ares-fuzz.c
diff --git a/grpc/third_party/cares/cares/test/Makefile.m32 b/grpc/third_party/cares/cares/test/Makefile.m32
index f1eaca89..1b308c44 100644
--- a/grpc/third_party/cares/cares/test/Makefile.m32
+++ b/grpc/third_party/cares/cares/test/Makefile.m32
@@ -12,9 +12,9 @@ LD = g++
ARES_SRC_DIR = ..
# Where to find the built c-ares static library
ARES_BLD_DIR = ..
-ARESLIB = $(ARES_BLD_DIR)/libcares.a
+ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a
GMOCK_DIR = gmock-1.8.0
-CPPFLAGS = -I$(ARES_SRC_DIR) -I$(GMOCK_DIR) -DCARES_STATICLIB
+CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(GMOCK_DIR) -DCARES_STATICLIB
CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++11
LDFLAGS =
LDLIBS = -lwsock32
@@ -30,16 +30,16 @@ DNSDUMPOBJS := $(patsubst %.cc,%.o,$(strip $(DUMPSOURCES)))
all: arestest.exe aresfuzz.exe aresfuzzname.exe dnsdump.exe
arestest.exe: $(OBJS) gmock-gtest-all.o
- $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR) -lcares $(LDLIBS)
+ $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS)
aresfuzz.exe: $(FUZZOBJS)
- $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR) -lcares $(LDLIBS)
+ $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS)
aresfuzzname.exe: $(FUZZNAMEOBJS)
- $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR) -lcares $(LDLIBS)
+ $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS)
dnsdump.exe: $(DNSDUMPOBJS)
- $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR) -lcares $(LDLIBS)
+ $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS)
$(OBJS): $(TESTHEADERS)
diff --git a/grpc/third_party/cares/cares/test/Makefile.msvc b/grpc/third_party/cares/cares/test/Makefile.msvc
index cd50d72d..e0337db3 100644
--- a/grpc/third_party/cares/cares/test/Makefile.msvc
+++ b/grpc/third_party/cares/cares/test/Makefile.msvc
@@ -68,7 +68,7 @@ RTLIBD = /MTd
# Verify that current subdir is below the c-ares source one
# ---------------------------------------------------------
-!IF ! EXIST(..\ares_init.c)
+!IF ! EXIST(..\src\lib\ares_init.c)
! MESSAGE Can not process Makefile.msvc from outside of c-ares test subdirectory.
! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again.
! ERROR See previous message.
@@ -167,7 +167,7 @@ RT_ERROR_CHECKING = /RTCsu
CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2 /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS
CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi /D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS $(RT_ERROR_CHECKING)
-CC_CFLAGS = $(CFLAGS) /I. /I.. /I $(GMOCK_DIR) /W3 /EHsc /FD
+CC_CFLAGS = $(CFLAGS) /I. /I../src/lib /I../include /I $(GMOCK_DIR) /W3 /EHsc /FD
RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
diff --git a/grpc/third_party/cares/cares/test/README.md b/grpc/third_party/cares/cares/test/README.md
index 988abb67..98814467 100644
--- a/grpc/third_party/cares/cares/test/README.md
+++ b/grpc/third_party/cares/cares/test/README.md
@@ -81,30 +81,22 @@ Fuzzing
### libFuzzer
To fuzz the packet parsing code with libFuzzer, follow the main
-[libFuzzer build instructions](http://llvm.org/docs/LibFuzzer.html#building):
+[libFuzzer instructions](http://llvm.org/docs/LibFuzzer.html):
- Configure the c-ares library and test suite with a recent Clang and a sanitizer, for example:
```console
- % export CFLAGS="-fsanitize=address -fsanitize-coverage=edge"
+ % export CFLAGS="-fsanitize=fuzzer-no-link,address"
% export CC=clang
% ./configure --disable-shared && make
```
- - Download and build the libFuzzer code:
-
- ```console
- % cd test
- % svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer
- % clang++ -c -g -O2 -std=c++11 Fuzzer/*.cpp -IFuzzer
- % ar ruv libFuzzer.a Fuzzer*.o
- ```
- Link each of the fuzzer entrypoints in with `ares-fuzz.cc`:
```
- % $CC $CFLAGS -I.. -c ares-test-fuzz.c
- % $CC $CFLAGS -I.. -c ares-test-fuzz-name.c
- % clang++ $CFLAGS ares-test-fuzz.o ../.libs/libcares.a libFuzzer.a -o ares-libfuzzer
- % clang++ $CFLAGS ares-test-fuzz-name.o ../.libs/libcares.a libFuzzer.a -o ares-libfuzzer-name
+ % clang -I.. -c ares-test-fuzz.c
+ % clang -I.. -c ares-test-fuzz-name.c
+ % clang++ -fsanitize=fuzzer,address ares-test-fuzz.o ../.libs/libcares.a -o ares-libfuzzer
+ % clang++ -fsanitize=fuzzer,address ares-test-fuzz-name.o ../.libs/libcares.a -o ares-libfuzzer-name
```
- Run the fuzzer using the starting corpus with:
diff --git a/grpc/third_party/cares/cares/test/ares-test-ai.h b/grpc/third_party/cares/cares/test/ares-test-ai.h
new file mode 100644
index 00000000..7cf27e33
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/ares-test-ai.h
@@ -0,0 +1,57 @@
+#ifndef ARES_TEST_AI_H
+#define ARES_TEST_AI_H
+
+#include <utility>
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "ares-test.h"
+
+namespace ares {
+namespace test {
+
+class MockChannelTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface< std::pair<int, bool> > {
+ public:
+ MockChannelTestAI() : MockChannelOptsTest(1, GetParam().first, GetParam().second, nullptr, 0) {}
+};
+
+class MockUDPChannelTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface<int> {
+ public:
+ MockUDPChannelTestAI() : MockChannelOptsTest(1, GetParam(), false, nullptr, 0) {}
+};
+
+class MockTCPChannelTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface<int> {
+ public:
+ MockTCPChannelTestAI() : MockChannelOptsTest(1, GetParam(), true, nullptr, 0) {}
+};
+
+
+// Test fixture that uses a default channel.
+class DefaultChannelTestAI : public LibraryTest {
+ public:
+ DefaultChannelTestAI() : channel_(nullptr) {
+ EXPECT_EQ(ARES_SUCCESS, ares_init(&channel_));
+ EXPECT_NE(nullptr, channel_);
+ }
+
+ ~DefaultChannelTestAI() {
+ ares_destroy(channel_);
+ channel_ = nullptr;
+ }
+
+ // Process all pending work on ares-owned file descriptors.
+ void Process();
+
+ protected:
+ ares_channel channel_;
+};
+
+}
+}
+
+#endif
diff --git a/grpc/third_party/cares/cares/test/ares-test-fuzz-name.c b/grpc/third_party/cares/cares/test/ares-test-fuzz-name.c
index 378da373..82df7437 100644
--- a/grpc/third_party/cares/cares/test/ares-test-fuzz-name.c
+++ b/grpc/third_party/cares/cares/test/ares-test-fuzz-name.c
@@ -4,7 +4,7 @@
#include "ares.h"
// Include ares internal file for DNS protocol constants
-#include "nameser.h"
+#include "ares_nameser.h"
// Entrypoint for Clang's libfuzzer, exercising query creation.
int LLVMFuzzerTestOneInput(const unsigned char *data,
@@ -16,7 +16,7 @@ int LLVMFuzzerTestOneInput(const unsigned char *data,
unsigned char *buf = NULL;
int buflen = 0;
- ares_create_query(name, ns_c_in, ns_t_aaaa, 1234, 0, &buf, &buflen, 1024);
+ ares_create_query(name, C_IN, T_AAAA, 1234, 0, &buf, &buflen, 1024);
free(buf);
free(name);
return 0;
diff --git a/grpc/third_party/cares/cares/test/ares-test-fuzz.c b/grpc/third_party/cares/cares/test/ares-test-fuzz.c
index d6574f48..d7f54fc6 100644
--- a/grpc/third_party/cares/cares/test/ares-test-fuzz.c
+++ b/grpc/third_party/cares/cares/test/ares-test-fuzz.c
@@ -47,5 +47,9 @@ int LLVMFuzzerTestOneInput(const unsigned char *data,
ares_parse_naptr_reply(data, size, &naptr);
if (naptr) ares_free_data(naptr);
+ struct ares_caa_reply* caa = NULL;
+ ares_parse_caa_reply(data, size, &caa);
+ if (caa) ares_free_data(caa);
+
return 0;
}
diff --git a/grpc/third_party/cares/cares/test/ares-test-init.cc b/grpc/third_party/cares/cares/test/ares-test-init.cc
index 9177ba16..ff6c6c6e 100644
--- a/grpc/third_party/cares/cares/test/ares-test-init.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-init.cc
@@ -469,6 +469,24 @@ CONTAINED_TEST_F(LibraryTest, ContainerSvcConfInit,
return HasFailure();
}
+NameContentList malformedresolvconflookup = {
+ {"/etc/resolv.conf", "nameserver 1.2.3.4\n"
+ "lookup garbage\n"}}; // malformed line
+CONTAINED_TEST_F(LibraryTest, ContainerMalformedResolvConfLookup,
+ "myhostname", "mydomainname.org", malformedresolvconflookup) {
+ ares_channel channel = nullptr;
+ EXPECT_EQ(ARES_SUCCESS, ares_init(&channel));
+
+ struct ares_options opts;
+ int optmask = 0;
+ ares_save_options(channel, &opts, &optmask);
+ EXPECT_EQ(std::string("fb"), std::string(opts.lookups));
+ ares_destroy_options(&opts);
+
+ ares_destroy(channel);
+ return HasFailure();
+}
+
// Failures when expected config filenames are inaccessible.
class MakeUnreadable {
public:
diff --git a/grpc/third_party/cares/cares/test/ares-test-internal.cc b/grpc/third_party/cares/cares/test/ares-test-internal.cc
index a021033c..96d4edec 100644
--- a/grpc/third_party/cares/cares/test/ares-test-internal.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-internal.cc
@@ -356,6 +356,107 @@ TEST_F(LibraryTest, GetHostentAllocFail) {
fclose(fp);
}
+TEST_F(DefaultChannelTest, GetAddrInfoHostsPositive) {
+ TempFile hostsfile("1.2.3.4 example.com \n"
+ " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n"
+ "#comment\n"
+ "4.5.6.7\n"
+ "1.3.5.7 \n"
+ "::1 ipv6.com");
+ EnvValue with_env("CARES_HOSTS", hostsfile.filename());
+ struct ares_addrinfo_hints hints = {};
+ AddrInfoResult result = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{example.com addr=[1.2.3.4]}", ss.str());
+}
+
+TEST_F(DefaultChannelTest, GetAddrInfoHostsSpaces) {
+ TempFile hostsfile("1.2.3.4 example.com \n"
+ " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n"
+ "#comment\n"
+ "4.5.6.7\n"
+ "1.3.5.7 \n"
+ "::1 ipv6.com");
+ EnvValue with_env("CARES_HOSTS", hostsfile.filename());
+ struct ares_addrinfo_hints hints = {};
+ AddrInfoResult result = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "google.com", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{www.google.com->google.com, www2.google.com->google.com addr=[2.3.4.5]}", ss.str());
+}
+
+TEST_F(DefaultChannelTest, GetAddrInfoHostsByALias) {
+ TempFile hostsfile("1.2.3.4 example.com \n"
+ " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n"
+ "#comment\n"
+ "4.5.6.7\n"
+ "1.3.5.7 \n"
+ "::1 ipv6.com");
+ EnvValue with_env("CARES_HOSTS", hostsfile.filename());
+ struct ares_addrinfo_hints hints = {};
+ AddrInfoResult result = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www2.google.com", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{www.google.com->google.com, www2.google.com->google.com addr=[2.3.4.5]}", ss.str());
+}
+
+TEST_F(DefaultChannelTest, GetAddrInfoHostsIPV6) {
+ TempFile hostsfile("1.2.3.4 example.com \n"
+ " 2.3.4.5\tgoogle.com www.google.com\twww2.google.com\n"
+ "#comment\n"
+ "4.5.6.7\n"
+ "1.3.5.7 \n"
+ "::1 ipv6.com");
+ EnvValue with_env("CARES_HOSTS", hostsfile.filename());
+ struct ares_addrinfo_hints hints = {};
+ AddrInfoResult result = {};
+ hints.ai_family = AF_INET6;
+ hints.ai_flags = ARES_AI_CANONNAME | ARES_AI_ENVHOSTS | ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "ipv6.com", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{ipv6.com addr=[[0000:0000:0000:0000:0000:0000:0000:0001]]}", ss.str());
+}
+
+TEST_F(LibraryTest, GetAddrInfoAllocFail) {
+ TempFile hostsfile("1.2.3.4 example.com alias1 alias2\n");
+ struct ares_addrinfo_hints hints;
+ unsigned short port = 80;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET;
+
+ FILE *fp = fopen(hostsfile.filename(), "r");
+ ASSERT_NE(nullptr, fp);
+
+ for (int ii = 1; ii <= 3; ii++) {
+ rewind(fp);
+ ClearFails();
+ SetAllocFail(ii);
+ struct ares_addrinfo ai;
+ EXPECT_EQ(ARES_ENOMEM, ares__readaddrinfo(fp, "example.com", port, &hints, &ai)) << ii;
+ }
+ fclose(fp);
+}
+
TEST(Misc, OnionDomain) {
EXPECT_EQ(0, ares__is_onion_domain("onion.no"));
EXPECT_EQ(0, ares__is_onion_domain(".onion.no"));
@@ -383,23 +484,23 @@ TEST_F(LibraryTest, Striendstr) {
const char *str = "plugh";
EXPECT_NE(nullptr, ares_striendstr(str, str));
}
-extern "C" int single_domain(ares_channel, const char*, char**);
+extern "C" int ares__single_domain(ares_channel, const char*, char**);
TEST_F(DefaultChannelTest, SingleDomain) {
TempFile aliases("www www.google.com\n");
EnvValue with_env("HOSTALIASES", aliases.filename());
SetAllocSizeFail(128);
char *ptr = nullptr;
- EXPECT_EQ(ARES_ENOMEM, single_domain(channel_, "www", &ptr));
+ EXPECT_EQ(ARES_ENOMEM, ares__single_domain(channel_, "www", &ptr));
channel_->flags |= ARES_FLAG_NOSEARCH|ARES_FLAG_NOALIASES;
- EXPECT_EQ(ARES_SUCCESS, single_domain(channel_, "www", &ptr));
+ EXPECT_EQ(ARES_SUCCESS, ares__single_domain(channel_, "www", &ptr));
EXPECT_EQ("www", std::string(ptr));
ares_free(ptr);
ptr = nullptr;
SetAllocFail(1);
- EXPECT_EQ(ARES_ENOMEM, single_domain(channel_, "www", &ptr));
+ EXPECT_EQ(ARES_ENOMEM, ares__single_domain(channel_, "www", &ptr));
EXPECT_EQ(nullptr, ptr);
}
#endif
@@ -477,7 +578,7 @@ const struct ares_socket_functions VirtualizeIO::default_functions = {
#endif
},
[](ares_socket_t s, const struct iovec * vec, int len, void *) {
-#ifdef _WIN32
+#ifndef HAVE_WRITEV
return ares_writev(s, vec, len);
#else
return :: writev(s, vec, len);
diff --git a/grpc/third_party/cares/cares/test/ares-test-live.cc b/grpc/third_party/cares/cares/test/ares-test-live.cc
index 35087054..bce97a6a 100644
--- a/grpc/third_party/cares/cares/test/ares-test-live.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-live.cc
@@ -18,6 +18,70 @@ unsigned char gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08};
unsigned char gdns_addr6[16] = {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88};
+MATCHER_P(IncludesAtLeastNumAddresses, n, "") {
+ if(!arg)
+ return false;
+ int cnt = 0;
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next)
+ cnt++;
+ return cnt >= n;
+}
+
+MATCHER_P(OnlyIncludesAddrType, addrtype, "") {
+ if(!arg)
+ return false;
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next)
+ if (ai->ai_family != addrtype)
+ return false;
+ return true;
+}
+
+MATCHER_P(IncludesAddrType, addrtype, "") {
+ if(!arg)
+ return false;
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next)
+ if (ai->ai_family == addrtype)
+ return true;
+ return false;
+}
+
+//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV4) {
+ //struct ares_addrinfo_hints hints = {};
+ //hints.ai_family = AF_INET;
+ //AddrInfoResult result;
+ //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ //Process();
+ //EXPECT_TRUE(result.done_);
+ //EXPECT_EQ(ARES_SUCCESS, result.status_);
+ //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(1));
+ //EXPECT_THAT(result.ai_, OnlyIncludesAddrType(AF_INET));
+//}
+
+//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoV6) {
+ //struct ares_addrinfo_hints hints = {};
+ //hints.ai_family = AF_INET6;
+ //AddrInfoResult result;
+ //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ //Process();
+ //EXPECT_TRUE(result.done_);
+ //EXPECT_EQ(ARES_SUCCESS, result.status_);
+ //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(1));
+ //EXPECT_THAT(result.ai_, OnlyIncludesAddrType(AF_INET6));
+//}
+
+//VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetAddrInfoUnspec) {
+ //struct ares_addrinfo_hints hints = {};
+ //hints.ai_family = AF_UNSPEC;
+ //AddrInfoResult result;
+ //ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ //Process();
+ //EXPECT_TRUE(result.done_);
+ //EXPECT_EQ(ARES_SUCCESS, result.status_);
+ //EXPECT_THAT(result.ai_, IncludesAtLeastNumAddresses(2));
+ //EXPECT_THAT(result.ai_, IncludesAddrType(AF_INET6));
+ //EXPECT_THAT(result.ai_, IncludesAddrType(AF_INET));
+//}
+
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveGetHostByNameV4) {
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -150,8 +214,11 @@ TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV4) {
EXPECT_EQ(ARES_SUCCESS, result.status_);
EXPECT_LT(0, (int)result.host_.addrs_.size());
EXPECT_EQ(AF_INET, result.host_.addrtype_);
- EXPECT_NE(std::string::npos,
- result.host_.name_.find("localhost"));
+ // oddly, travis does not resolve to localhost, but a random hostname starting with travis-job
+ if (result.host_.name_.find("travis-job") == std::string::npos) {
+ EXPECT_NE(std::string::npos,
+ result.host_.name_.find("localhost"));
+ }
}
}
@@ -167,8 +234,9 @@ TEST_P(DefaultChannelModeTest, LiveGetLocalhostByAddrV6) {
EXPECT_EQ(ARES_SUCCESS, result.status_);
EXPECT_LT(0, (int)result.host_.addrs_.size());
EXPECT_EQ(AF_INET6, result.host_.addrtype_);
- EXPECT_NE(std::string::npos,
- result.host_.name_.find("localhost"));
+ const std::string& name = result.host_.name_;
+ EXPECT_TRUE(std::string::npos != name.find("localhost") ||
+ std::string::npos != name.find("ip6-loopback"));
}
}
@@ -205,7 +273,7 @@ INSTANTIATE_TEST_CASE_P(Modes, DefaultChannelModeTest,
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchA) {
SearchResult result;
- ares_search(channel_, "www.youtube.com.", ns_c_in, ns_t_a,
+ ares_search(channel_, "www.youtube.com.", C_IN, T_A,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -214,7 +282,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchA) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchEmptyA) {
SearchResult result;
- ares_search(channel_, "", ns_c_in, ns_t_a,
+ ares_search(channel_, "", C_IN, T_A,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -223,7 +291,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchEmptyA) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchNS) {
SearchResult result;
- ares_search(channel_, "google.com.", ns_c_in, ns_t_ns,
+ ares_search(channel_, "google.com.", C_IN, T_NS,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -232,7 +300,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchNS) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchMX) {
SearchResult result;
- ares_search(channel_, "google.com.", ns_c_in, ns_t_mx,
+ ares_search(channel_, "google.com.", C_IN, T_MX,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -241,7 +309,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchMX) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchTXT) {
SearchResult result;
- ares_search(channel_, "google.com.", ns_c_in, ns_t_txt,
+ ares_search(channel_, "google.com.", C_IN, T_TXT,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -250,7 +318,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchTXT) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSOA) {
SearchResult result;
- ares_search(channel_, "google.com.", ns_c_in, ns_t_soa,
+ ares_search(channel_, "google.com.", C_IN, T_SOA,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -259,7 +327,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSOA) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSRV) {
SearchResult result;
- ares_search(channel_, "_imap._tcp.gmail.com.", ns_c_in, ns_t_srv,
+ ares_search(channel_, "_imap._tcp.gmail.com.", C_IN, T_SRV,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -268,7 +336,7 @@ VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchSRV) {
VIRT_NONVIRT_TEST_F(DefaultChannelTest, LiveSearchANY) {
SearchResult result;
- ares_search(channel_, "google.com.", ns_c_in, ns_t_any,
+ ares_search(channel_, "google.com.", C_IN, T_ANY,
SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
@@ -628,6 +696,54 @@ TEST_F(DefaultChannelTest, VerifySocketFunctionCallback) {
}
+TEST_F(DefaultChannelTest, LiveSetServers) {
+ struct ares_addr_node server1;
+ struct ares_addr_node server2;
+ server1.next = &server2;
+ server1.family = AF_INET;
+ server1.addr.addr4.s_addr = htonl(0x01020304);
+ server2.next = nullptr;
+ server2.family = AF_INET;
+ server2.addr.addr4.s_addr = htonl(0x02030405);
+
+ // Change not allowed while request is pending
+ HostResult result;
+ ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
+ EXPECT_EQ(ARES_ENOTIMP, ares_set_servers(channel_, &server1));
+ ares_cancel(channel_);
+}
+
+TEST_F(DefaultChannelTest, LiveSetServersPorts) {
+ struct ares_addr_port_node server1;
+ struct ares_addr_port_node server2;
+ server1.next = &server2;
+ server1.family = AF_INET;
+ server1.addr.addr4.s_addr = htonl(0x01020304);
+ server1.udp_port = 111;
+ server1.tcp_port = 111;
+ server2.next = nullptr;
+ server2.family = AF_INET;
+ server2.addr.addr4.s_addr = htonl(0x02030405);
+ server2.udp_port = 0;
+ server2.tcp_port = 0;;
+ EXPECT_EQ(ARES_ENODATA, ares_set_servers_ports(nullptr, &server1));
+
+ // Change not allowed while request is pending
+ HostResult result;
+ ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
+ EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports(channel_, &server1));
+ ares_cancel(channel_);
+}
+
+TEST_F(DefaultChannelTest, LiveSetServersCSV) {
+ // Change not allowed while request is pending
+ HostResult result;
+ ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
+ EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_csv(channel_, "1.2.3.4,2.3.4.5"));
+ EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports_csv(channel_, "1.2.3.4:56,2.3.4.5:67"));
+ ares_cancel(channel_);
+}
+
} // namespace test
} // namespace ares
diff --git a/grpc/third_party/cares/cares/test/ares-test-misc.cc b/grpc/third_party/cares/cares/test/ares-test-misc.cc
index c7643917..b11b04ba 100644
--- a/grpc/third_party/cares/cares/test/ares-test-misc.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-misc.cc
@@ -45,12 +45,6 @@ TEST_F(DefaultChannelTest, SetServers) {
EXPECT_EQ(ARES_SUCCESS, ares_set_servers(channel_, &server1));
std::vector<std::string> expected = {"1.2.3.4", "2.3.4.5"};
EXPECT_EQ(expected, GetNameServers(channel_));
-
- // Change not allowed while request is pending
- HostResult result;
- ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
- EXPECT_EQ(ARES_ENOTIMP, ares_set_servers(channel_, &server1));
- ares_cancel(channel_);
}
TEST_F(DefaultChannelTest, SetServersPorts) {
@@ -75,12 +69,6 @@ TEST_F(DefaultChannelTest, SetServersPorts) {
EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports(channel_, &server1));
std::vector<std::string> expected = {"1.2.3.4:111", "2.3.4.5"};
EXPECT_EQ(expected, GetNameServers(channel_));
-
- // Change not allowed while request is pending
- HostResult result;
- ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
- EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports(channel_, &server1));
- ares_cancel(channel_);
}
TEST_F(DefaultChannelTest, SetServersCSV) {
@@ -108,13 +96,6 @@ TEST_F(DefaultChannelTest, SetServersCSV) {
std::vector<std::string> expected2 = {"1.2.3.4:54", "[0102:0304:0506:0708:0910:1112:1314:1516]:80", "2.3.4.5:55"};
EXPECT_EQ(expected2, GetNameServers(channel_));
- // Change not allowed while request is pending
- HostResult result;
- ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
- EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_csv(channel_, "1.2.3.4,2.3.4.5"));
- EXPECT_EQ(ARES_ENOTIMP, ares_set_servers_ports_csv(channel_, "1.2.3.4:56,2.3.4.5:67"));
- ares_cancel(channel_);
-
// Should survive duplication
ares_channel channel2;
EXPECT_EQ(ARES_SUCCESS, ares_dup(&channel2, channel_));
@@ -185,13 +166,13 @@ TEST_F(LibraryTest, InetNtoP) {
TEST_F(LibraryTest, Mkquery) {
byte* p;
int len;
- ares_mkquery("example.com", ns_c_in, ns_t_a, 0x1234, 0, &p, &len);
+ ares_mkquery("example.com", C_IN, T_A, 0x1234, 0, &p, &len);
std::vector<byte> data(p, p + len);
ares_free_string(p);
std::string actual = PacketToString(data);
DNSPacket pkt;
- pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", ns_t_a));
+ pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", T_A));
std::string expected = PacketToString(pkt.data());
EXPECT_EQ(expected, actual);
}
@@ -200,14 +181,14 @@ TEST_F(LibraryTest, CreateQuery) {
byte* p;
int len;
EXPECT_EQ(ARES_SUCCESS,
- ares_create_query("exam\\@le.com", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("exam\\@le.com", C_IN, T_A, 0x1234, 0,
&p, &len, 0));
std::vector<byte> data(p, p + len);
ares_free_string(p);
std::string actual = PacketToString(data);
DNSPacket pkt;
- pkt.set_qid(0x1234).add_question(new DNSQuestion("exam@le.com", ns_t_a));
+ pkt.set_qid(0x1234).add_question(new DNSQuestion("exam@le.com", T_A));
std::string expected = PacketToString(pkt.data());
EXPECT_EQ(expected, actual);
}
@@ -216,7 +197,7 @@ TEST_F(LibraryTest, CreateQueryTrailingEscapedDot) {
byte* p;
int len;
EXPECT_EQ(ARES_SUCCESS,
- ares_create_query("example.com\\.", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("example.com\\.", C_IN, T_A, 0x1234, 0,
&p, &len, 0));
std::vector<byte> data(p, p + len);
ares_free_string(p);
@@ -234,7 +215,7 @@ TEST_F(LibraryTest, CreateQueryNameTooLong) {
"a1234567890123456789.b1234567890123456789.c1234567890123456789.d1234567890123456789."
"a1234567890123456789.b1234567890123456789.c1234567890123456789.d1234567890123456789."
"x1234567890123456789.y1234567890123456789.",
- ns_c_in, ns_t_a, 0x1234, 0, &p, &len, 0));
+ C_IN, T_A, 0x1234, 0, &p, &len, 0));
}
TEST_F(LibraryTest, CreateQueryFailures) {
@@ -247,7 +228,7 @@ TEST_F(LibraryTest, CreateQueryFailures) {
}
p = nullptr;
EXPECT_EQ(ARES_EBADNAME,
- ares_create_query(longname.c_str(), ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query(longname.c_str(), C_IN, T_A, 0x1234, 0,
&p, &len, 0));
if (p) ares_free_string(p);
@@ -255,7 +236,7 @@ TEST_F(LibraryTest, CreateQueryFailures) {
p = nullptr;
EXPECT_EQ(ARES_ENOMEM,
- ares_create_query("example.com", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("example.com", C_IN, T_A, 0x1234, 0,
&p, &len, 0));
if (p) ares_free_string(p);
@@ -263,14 +244,14 @@ TEST_F(LibraryTest, CreateQueryFailures) {
std::string longlabel = "a.a123456789b123456789c123456789d123456789e123456789f123456789g123456789.org";
p = nullptr;
EXPECT_EQ(ARES_EBADNAME,
- ares_create_query(longlabel.c_str(), ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query(longlabel.c_str(), C_IN, T_A, 0x1234, 0,
&p, &len, 0));
if (p) ares_free_string(p);
// Empty non-terminal label
p = nullptr;
EXPECT_EQ(ARES_EBADNAME,
- ares_create_query("example..com", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("example..com", C_IN, T_A, 0x1234, 0,
&p, &len, 0));
if (p) ares_free_string(p);
}
@@ -279,7 +260,7 @@ TEST_F(LibraryTest, CreateQueryOnionDomain) {
byte* p;
int len;
EXPECT_EQ(ARES_ENOTFOUND,
- ares_create_query("dontleak.onion", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("dontleak.onion", C_IN, T_A, 0x1234, 0,
&p, &len, 0));
}
@@ -296,12 +277,21 @@ TEST_F(DefaultChannelTest, HostByNameFileOnionDomain) {
ares_gethostbyname_file(channel_, "dontleak.onion", AF_INET, &h));
}
+TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain) {
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_UNSPEC;
+ ares_getaddrinfo(channel_, "dontleak.onion", NULL, &hints, AddrInfoCallback, &result);
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ENOTFOUND, result.status_);
+}
+
// Interesting question: should tacking on a search domain let the query
// through? It seems safer to reject it because "supersecret.onion.search"
// still leaks information about the query to malicious resolvers.
TEST_F(DefaultChannelTest, SearchOnionDomain) {
SearchResult result;
- ares_search(channel_, "dontleak.onion", ns_c_in, ns_t_a,
+ ares_search(channel_, "dontleak.onion", C_IN, T_A,
SearchCallback, &result);
EXPECT_TRUE(result.done_);
EXPECT_EQ(ARES_ENOTFOUND, result.status_);
@@ -464,14 +454,14 @@ TEST_F(LibraryTest, CreateEDNSQuery) {
byte* p;
int len;
EXPECT_EQ(ARES_SUCCESS,
- ares_create_query("example.com", ns_c_in, ns_t_a, 0x1234, 0,
+ ares_create_query("example.com", C_IN, T_A, 0x1234, 0,
&p, &len, 1280));
std::vector<byte> data(p, p + len);
ares_free_string(p);
std::string actual = PacketToString(data);
DNSPacket pkt;
- pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", ns_t_a))
+ pkt.set_qid(0x1234).add_question(new DNSQuestion("example.com", T_A))
.add_additional(new DNSOptRR(0, 1280));
std::string expected = PacketToString(pkt.data());
EXPECT_EQ(expected, actual);
@@ -480,13 +470,13 @@ TEST_F(LibraryTest, CreateEDNSQuery) {
TEST_F(LibraryTest, CreateRootQuery) {
byte* p;
int len;
- ares_create_query(".", ns_c_in, ns_t_a, 0x1234, 0, &p, &len, 0);
+ ares_create_query(".", C_IN, T_A, 0x1234, 0, &p, &len, 0);
std::vector<byte> data(p, p + len);
ares_free_string(p);
std::string actual = PacketToString(data);
DNSPacket pkt;
- pkt.set_qid(0x1234).add_question(new DNSQuestion("", ns_t_a));
+ pkt.set_qid(0x1234).add_question(new DNSQuestion("", T_A));
std::string expected = PacketToString(pkt.data());
EXPECT_EQ(expected, actual);
}
diff --git a/grpc/third_party/cares/cares/test/ares-test-mock-ai.cc b/grpc/third_party/cares/cares/test/ares-test-mock-ai.cc
new file mode 100644
index 00000000..0de315a5
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/ares-test-mock-ai.cc
@@ -0,0 +1,777 @@
+#include "ares-test-ai.h"
+#include "dns-proto.h"
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <sstream>
+#include <vector>
+
+using testing::InvokeWithoutArgs;
+using testing::DoAll;
+
+namespace ares {
+namespace test {
+
+MATCHER_P(IncludesNumAddresses, n, "") {
+ if(!arg)
+ return false;
+ int cnt = 0;
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next)
+ cnt++;
+ return n == cnt;
+}
+
+MATCHER_P(IncludesV4Address, address, "") {
+ if(!arg)
+ return false;
+ in_addr addressnum = {};
+ if (!ares_inet_pton(AF_INET, address, &addressnum))
+ return false; // wrong number format?
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) {
+ if (ai->ai_family != AF_INET)
+ continue;
+ if (reinterpret_cast<sockaddr_in*>(ai->ai_addr)->sin_addr.s_addr ==
+ addressnum.s_addr)
+ return true; // found
+ }
+ return false;
+}
+
+MATCHER_P(IncludesV6Address, address, "") {
+ if(!arg)
+ return false;
+ in6_addr addressnum = {};
+ if (!ares_inet_pton(AF_INET6, address, &addressnum)) {
+ return false; // wrong number format?
+ }
+ for (const ares_addrinfo_node* ai = arg->nodes; ai != NULL; ai = ai->ai_next) {
+ if (ai->ai_family != AF_INET6)
+ continue;
+ if (!memcmp(
+ reinterpret_cast<sockaddr_in6*>(ai->ai_addr)->sin6_addr.s6_addr,
+ addressnum.s6_addr, sizeof(addressnum.s6_addr)))
+ return true; // found
+ }
+ return false;
+}
+
+// UDP only so mock server doesn't get confused by concatenated requests
+TEST_P(MockUDPChannelTestAI, GetAddrInfoParallelLookups) {
+ DNSPacket rsp1;
+ rsp1.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A))
+ .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp1));
+ DNSPacket rsp2;
+ rsp2.set_response().set_aa()
+ .add_question(new DNSQuestion("www.example.com", T_A))
+ .add_answer(new DNSARR("www.example.com", 100, {1, 2, 3, 4}));
+ ON_CALL(server_, OnRequest("www.example.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp2));
+
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ AddrInfoResult result1;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result1);
+ AddrInfoResult result2;
+ ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result2);
+ AddrInfoResult result3;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result3);
+ Process();
+
+ EXPECT_TRUE(result1.done_);
+ EXPECT_EQ(result1.status_, ARES_SUCCESS);
+ EXPECT_THAT(result1.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result1.ai_, IncludesV4Address("2.3.4.5"));
+
+ EXPECT_TRUE(result2.done_);
+ EXPECT_EQ(result2.status_, ARES_SUCCESS);
+ EXPECT_THAT(result2.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result2.ai_, IncludesV4Address("1.2.3.4"));
+
+ EXPECT_TRUE(result3.done_);
+ EXPECT_EQ(result3.status_, ARES_SUCCESS);
+ EXPECT_THAT(result3.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result3.ai_, IncludesV4Address("2.3.4.5"));
+}
+
+// UDP to TCP specific test
+TEST_P(MockUDPChannelTestAI, TruncationRetry) {
+ DNSPacket rsptruncated;
+ rsptruncated.set_response().set_aa().set_tc()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ DNSPacket rspok;
+ rspok.set_response()
+ .add_question(new DNSQuestion("www.google.com", T_A))
+ .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4}));
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsptruncated))
+ .WillOnce(SetReply(&server_, &rspok));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(result.status_, ARES_SUCCESS);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4"));
+}
+
+// TCP only to prevent retries
+TEST_P(MockTCPChannelTestAI, MalformedResponse) {
+ std::vector<byte> one = {0x01};
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReplyData(&server_, one));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ETIMEOUT, result.status_);
+}
+
+TEST_P(MockTCPChannelTestAI, FormErrResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(FORMERR);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_EFORMERR, result.status_);
+}
+
+TEST_P(MockTCPChannelTestAI, ServFailResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(SERVFAIL);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ // ARES_FLAG_NOCHECKRESP not set, so SERVFAIL consumed
+ EXPECT_EQ(ARES_ECONNREFUSED, result.status_);
+}
+
+TEST_P(MockTCPChannelTestAI, NotImplResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(NOTIMP);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ // ARES_FLAG_NOCHECKRESP not set, so NOTIMP consumed
+ EXPECT_EQ(ARES_ECONNREFUSED, result.status_);
+}
+
+TEST_P(MockTCPChannelTestAI, RefusedResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(REFUSED);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ // ARES_FLAG_NOCHECKRESP not set, so REFUSED consumed
+ EXPECT_EQ(ARES_ECONNREFUSED, result.status_);
+}
+
+TEST_P(MockTCPChannelTestAI, YXDomainResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(YXDOMAIN);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ENODATA, result.status_);
+}
+
+class MockExtraOptsTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface< std::pair<int, bool> > {
+ public:
+ MockExtraOptsTestAI()
+ : MockChannelOptsTest(1, GetParam().first, GetParam().second,
+ FillOptions(&opts_),
+ ARES_OPT_SOCK_SNDBUF|ARES_OPT_SOCK_RCVBUF) {}
+ static struct ares_options* FillOptions(struct ares_options * opts) {
+ memset(opts, 0, sizeof(struct ares_options));
+ // Set a few options that affect socket communications
+ opts->socket_send_buffer_size = 514;
+ opts->socket_receive_buffer_size = 514;
+ return opts;
+ }
+ private:
+ struct ares_options opts_;
+};
+
+TEST_P(MockExtraOptsTestAI, SimpleQuery) {
+ ares_set_local_ip4(channel_, 0x7F000001);
+ byte addr6[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+ ares_set_local_ip6(channel_, addr6);
+ ares_set_local_dev(channel_, "dummy");
+
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A))
+ .add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_SUCCESS, result.status_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+}
+
+class MockExtraOptsNDotsTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface< std::pair<int, bool> > {
+ public:
+ MockExtraOptsNDotsTestAI(int ndots)
+ : MockChannelOptsTest(1, GetParam().first, GetParam().second,
+ FillOptions(&opts_, ndots),
+ ARES_OPT_SOCK_SNDBUF|ARES_OPT_SOCK_RCVBUF|ARES_OPT_NDOTS) {}
+ static struct ares_options* FillOptions(struct ares_options * opts, int ndots) {
+ memset(opts, 0, sizeof(struct ares_options));
+ // Set a few options that affect socket communications
+ opts->socket_send_buffer_size = 514;
+ opts->socket_receive_buffer_size = 514;
+ opts->ndots = ndots;
+ return opts;
+ }
+ private:
+ struct ares_options opts_;
+};
+
+class MockExtraOptsNDots5TestAI : public MockExtraOptsNDotsTestAI {
+ public:
+ MockExtraOptsNDots5TestAI() : MockExtraOptsNDotsTestAI(5) {}
+};
+
+TEST_P(MockExtraOptsNDots5TestAI, SimpleQuery) {
+ ares_set_local_ip4(channel_, 0x7F000001);
+ byte addr6[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+ ares_set_local_ip6(channel_, addr6);
+ ares_set_local_dev(channel_, "dummy");
+
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("dynamodb.us-east-1.amazonaws.com", T_A))
+ .add_answer(new DNSARR("dynamodb.us-east-1.amazonaws.com", 100, {123, 45, 67, 8}));
+ ON_CALL(server_, OnRequest("dynamodb.us-east-1.amazonaws.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "dynamodb.us-east-1.amazonaws.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_SUCCESS, result.status_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("123.45.67.8"));
+}
+
+class MockFlagsChannelOptsTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface< std::pair<int, bool> > {
+ public:
+ MockFlagsChannelOptsTestAI(int flags)
+ : MockChannelOptsTest(1, GetParam().first, GetParam().second,
+ FillOptions(&opts_, flags), ARES_OPT_FLAGS) {}
+ static struct ares_options* FillOptions(struct ares_options * opts, int flags) {
+ memset(opts, 0, sizeof(struct ares_options));
+ opts->flags = flags;
+ return opts;
+ }
+ private:
+ struct ares_options opts_;
+};
+
+class MockNoCheckRespChannelTestAI : public MockFlagsChannelOptsTestAI {
+ public:
+ MockNoCheckRespChannelTestAI() : MockFlagsChannelOptsTestAI(ARES_FLAG_NOCHECKRESP) {}
+};
+
+TEST_P(MockNoCheckRespChannelTestAI, ServFailResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(SERVFAIL);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ESERVFAIL, result.status_);
+}
+
+TEST_P(MockNoCheckRespChannelTestAI, NotImplResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(NOTIMP);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ENOTIMP, result.status_);
+}
+
+TEST_P(MockNoCheckRespChannelTestAI, RefusedResponse) {
+ DNSPacket rsp;
+ rsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(REFUSED);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_EREFUSED, result.status_);
+}
+
+TEST_P(MockChannelTestAI, FamilyV6) {
+ DNSPacket rsp6;
+ rsp6.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_AAAA))
+ .add_answer(new DNSAaaaRR("example.com", 100,
+ {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03}));
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
+ .WillByDefault(SetReply(&server_, &rsp6));
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET6;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
+ AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303"));
+}
+
+TEST_P(MockChannelTestAI, FamilyV4) {
+ DNSPacket rsp4;
+ rsp4.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_A))
+ .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("example.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp4));
+ AddrInfoResult result = {};
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
+ AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+}
+
+TEST_P(MockChannelTestAI, FamilyV4_MultipleAddresses) {
+ DNSPacket rsp4;
+ rsp4.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_A))
+ .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5}))
+ .add_answer(new DNSARR("example.com", 100, {7, 8, 9, 0}));
+ ON_CALL(server_, OnRequest("example.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp4));
+ AddrInfoResult result = {};
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
+ AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{addr=[2.3.4.5], addr=[7.8.9.0]}", ss.str());
+}
+
+TEST_P(MockChannelTestAI, FamilyUnspecified) {
+ DNSPacket rsp6;
+ rsp6.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_AAAA))
+ .add_answer(new DNSAaaaRR("example.com", 100,
+ {0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03}));
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
+ .WillByDefault(SetReply(&server_, &rsp6));
+ DNSPacket rsp4;
+ rsp4.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_A))
+ .add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("example.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp4));
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com.", NULL, &hints,
+ AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(2));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+ EXPECT_THAT(result.ai_, IncludesV6Address("2121:0000:0000:0000:0000:0000:0000:0303"));
+}
+
+class MockEDNSChannelTestAI : public MockFlagsChannelOptsTestAI {
+ public:
+ MockEDNSChannelTestAI() : MockFlagsChannelOptsTestAI(ARES_FLAG_EDNS) {}
+};
+
+TEST_P(MockEDNSChannelTestAI, RetryWithoutEDNS) {
+ DNSPacket rspfail;
+ rspfail.set_response().set_aa().set_rcode(FORMERR)
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ DNSPacket rspok;
+ rspok.set_response()
+ .add_question(new DNSQuestion("www.google.com", T_A))
+ .add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4}));
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
+ .WillOnce(SetReply(&server_, &rspfail))
+ .WillOnce(SetReply(&server_, &rspok));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.google.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("1.2.3.4"));
+}
+
+TEST_P(MockChannelTestAI, SearchDomains) {
+ DNSPacket nofirst;
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
+ .WillByDefault(SetReply(&server_, &nofirst));
+ DNSPacket nosecond;
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
+ .WillByDefault(SetReply(&server_, &nosecond));
+ DNSPacket yesthird;
+ yesthird.set_response().set_aa()
+ .add_question(new DNSQuestion("www.third.gov", T_A))
+ .add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
+ .WillByDefault(SetReply(&server_, &yesthird));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+}
+
+TEST_P(MockChannelTestAI, SearchDomainsServFailOnAAAA) {
+ DNSPacket nofirst;
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_AAAA));
+ ON_CALL(server_, OnRequest("www.first.com", T_AAAA))
+ .WillByDefault(SetReply(&server_, &nofirst));
+ DNSPacket nofirst4;
+ nofirst4.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
+ .WillByDefault(SetReply(&server_, &nofirst4));
+
+ DNSPacket nosecond;
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_AAAA));
+ ON_CALL(server_, OnRequest("www.second.org", T_AAAA))
+ .WillByDefault(SetReply(&server_, &nosecond));
+ DNSPacket yessecond4;
+ yessecond4.set_response().set_aa()
+ .add_question(new DNSQuestion("www.second.org", T_A))
+ .add_answer(new DNSARR("www.second.org", 0x0200, {2, 3, 4, 5}));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
+ .WillByDefault(SetReply(&server_, &yessecond4));
+
+ DNSPacket failthird;
+ failthird.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.third.gov", T_AAAA));
+ ON_CALL(server_, OnRequest("www.third.gov", T_AAAA))
+ .WillByDefault(SetReply(&server_, &failthird));
+ DNSPacket failthird4;
+ failthird4.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.third.gov", T_A));
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
+ .WillByDefault(SetReply(&server_, &failthird4));
+
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+}
+
+class MockMultiServerChannelTestAI
+ : public MockChannelOptsTest,
+ public ::testing::WithParamInterface< std::pair<int, bool> > {
+ public:
+ MockMultiServerChannelTestAI(bool rotate)
+ : MockChannelOptsTest(3, GetParam().first, GetParam().second, nullptr, rotate ? ARES_OPT_ROTATE : ARES_OPT_NOROTATE) {}
+ void CheckExample() {
+ AddrInfoResult result;
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "www.example.com.", NULL, &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(result.status_, ARES_SUCCESS);
+ EXPECT_THAT(result.ai_, IncludesNumAddresses(1));
+ EXPECT_THAT(result.ai_, IncludesV4Address("2.3.4.5"));
+ }
+};
+
+class RotateMultiMockTestAI : public MockMultiServerChannelTestAI {
+ public:
+ RotateMultiMockTestAI() : MockMultiServerChannelTestAI(true) {}
+};
+
+class NoRotateMultiMockTestAI : public MockMultiServerChannelTestAI {
+ public:
+ NoRotateMultiMockTestAI() : MockMultiServerChannelTestAI(false) {}
+};
+
+
+TEST_P(RotateMultiMockTestAI, ThirdServer) {
+ struct ares_options opts = {0};
+ int optmask = 0;
+ EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask));
+ EXPECT_EQ(0, (optmask & ARES_OPT_NOROTATE));
+ ares_destroy_options(&opts);
+
+ DNSPacket servfailrsp;
+ servfailrsp.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.example.com", T_A));
+ DNSPacket notimplrsp;
+ notimplrsp.set_response().set_aa().set_rcode(NOTIMP)
+ .add_question(new DNSQuestion("www.example.com", T_A));
+ DNSPacket okrsp;
+ okrsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.example.com", T_A))
+ .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5}));
+
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &okrsp));
+ CheckExample();
+
+ // Second time around, starts from server [1].
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &okrsp));
+ CheckExample();
+
+ // Third time around, starts from server [2].
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &okrsp));
+ CheckExample();
+}
+
+TEST_P(NoRotateMultiMockTestAI, ThirdServer) {
+ struct ares_options opts = {0};
+ int optmask = 0;
+ EXPECT_EQ(ARES_SUCCESS, ares_save_options(channel_, &opts, &optmask));
+ EXPECT_EQ(ARES_OPT_NOROTATE, (optmask & ARES_OPT_NOROTATE));
+ ares_destroy_options(&opts);
+
+ DNSPacket servfailrsp;
+ servfailrsp.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.example.com", T_A));
+ DNSPacket notimplrsp;
+ notimplrsp.set_response().set_aa().set_rcode(NOTIMP)
+ .add_question(new DNSQuestion("www.example.com", T_A));
+ DNSPacket okrsp;
+ okrsp.set_response().set_aa()
+ .add_question(new DNSQuestion("www.example.com", T_A))
+ .add_answer(new DNSARR("www.example.com", 100, {2,3,4,5}));
+
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &okrsp));
+ CheckExample();
+
+ // Second time around, still starts from server [0].
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &okrsp));
+ CheckExample();
+
+ // Third time around, still starts from server [0].
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[0].get(), &servfailrsp));
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[1].get(), &notimplrsp));
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
+ .WillOnce(SetReply(servers_[2].get(), &okrsp));
+ CheckExample();
+}
+
+TEST_P(MockChannelTestAI, FamilyV4ServiceName) {
+ DNSPacket rsp4;
+ rsp4.set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_A))
+ .add_answer(new DNSARR("example.com", 100, {1, 1, 1, 1}))
+ .add_answer(new DNSARR("example.com", 100, {2, 2, 2, 2}));
+ ON_CALL(server_, OnRequest("example.com", T_A))
+ .WillByDefault(SetReply(&server_, &rsp4));
+ AddrInfoResult result = {};
+ struct ares_addrinfo_hints hints = {};
+ hints.ai_family = AF_INET;
+ hints.ai_flags = ARES_AI_NOSORT;
+ ares_getaddrinfo(channel_, "example.com", "http", &hints, AddrInfoCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ std::stringstream ss;
+ ss << result.ai_;
+ EXPECT_EQ("{addr=[1.1.1.1:80], addr=[2.2.2.2:80]}", ss.str());
+}
+
+// force-tcp does currently not work, possibly test DNS server swallows
+// bytes from second query
+//INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockChannelTestAI,
+// ::testing::ValuesIn(ares::test::families_modes));
+//const std::vector<std::pair<int, bool>> both_families_udponly = {
+// std::make_pair<int, bool>(AF_INET, false),
+// std::make_pair<int, bool>(AF_INET6, false)
+//};
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockChannelTestAI,
+ ::testing::Values(std::make_pair<int, bool>(AF_INET, false)));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockUDPChannelTestAI,
+ ::testing::ValuesIn(ares::test::families));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockTCPChannelTestAI,
+ ::testing::ValuesIn(ares::test::families));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockExtraOptsTestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockExtraOptsNDots5TestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockNoCheckRespChannelTestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+INSTANTIATE_TEST_CASE_P(AddressFamiliesAI, MockEDNSChannelTestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+INSTANTIATE_TEST_CASE_P(TransportModesAI, RotateMultiMockTestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+INSTANTIATE_TEST_CASE_P(TransportModesAI, NoRotateMultiMockTestAI,
+ ::testing::ValuesIn(ares::test::families_modes));
+
+
+} // namespace test
+} // namespace ares
diff --git a/grpc/third_party/cares/cares/test/ares-test-mock.cc b/grpc/third_party/cares/cares/test/ares-test-mock.cc
index 7deecb83..f4e773cf 100644
--- a/grpc/third_party/cares/cares/test/ares-test-mock.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-mock.cc
@@ -38,7 +38,7 @@ TEST_P(MockChannelTest, Basic) {
0x01, 0x02, 0x03, 0x04
};
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReplyData(&server_, reply));
HostResult result;
@@ -51,18 +51,18 @@ TEST_P(MockChannelTest, Basic) {
}
// UDP only so mock server doesn't get confused by concatenated requests
-TEST_P(MockUDPChannelTest, ParallelLookups) {
+TEST_P(MockUDPChannelTest, GetHostByNameParallelLookups) {
DNSPacket rsp1;
rsp1.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &rsp1));
DNSPacket rsp2;
rsp2.set_response().set_aa()
- .add_question(new DNSQuestion("www.example.com", ns_t_a))
+ .add_question(new DNSQuestion("www.example.com", T_A))
.add_answer(new DNSARR("www.example.com", 100, {1, 2, 3, 4}));
- ON_CALL(server_, OnRequest("www.example.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp2));
HostResult result1;
@@ -90,12 +90,12 @@ TEST_P(MockUDPChannelTest, ParallelLookups) {
TEST_P(MockUDPChannelTest, TruncationRetry) {
DNSPacket rsptruncated;
rsptruncated.set_response().set_aa().set_tc()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
+ .add_question(new DNSQuestion("www.google.com", T_A));
DNSPacket rspok;
rspok.set_response()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4}));
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsptruncated))
.WillOnce(SetReply(&server_, &rspok));
HostResult result;
@@ -118,9 +118,9 @@ static int SocketConnectCallback(ares_socket_t fd, int type, void *data) {
TEST_P(MockChannelTest, SockCallback) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
// Get notified of new sockets
@@ -163,9 +163,9 @@ static int SocketConfigureCallback(ares_socket_t fd, int type, void *data) {
TEST_P(MockChannelTest, SockConfigureCallback) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
// Get notified of new sockets
@@ -200,7 +200,7 @@ TEST_P(MockChannelTest, SockConfigureFailCallback) {
// TCP only to prevent retries
TEST_P(MockTCPChannelTest, MalformedResponse) {
std::vector<byte> one = {0x01};
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReplyData(&server_, one));
HostResult result;
@@ -213,9 +213,9 @@ TEST_P(MockTCPChannelTest, MalformedResponse) {
TEST_P(MockTCPChannelTest, FormErrResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_formerr);
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(FORMERR);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -227,9 +227,9 @@ TEST_P(MockTCPChannelTest, FormErrResponse) {
TEST_P(MockTCPChannelTest, ServFailResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_servfail);
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(SERVFAIL);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -242,24 +242,24 @@ TEST_P(MockTCPChannelTest, ServFailResponse) {
TEST_P(MockTCPChannelTest, NotImplResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_notimpl);
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(NOTIMP);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
Process();
EXPECT_TRUE(result.done_);
- // ARES_FLAG_NOCHECKRESP not set, so NOTIMPL consumed
+ // ARES_FLAG_NOCHECKRESP not set, so NOTIMP consumed
EXPECT_EQ(ARES_ECONNREFUSED, result.status_);
}
TEST_P(MockTCPChannelTest, RefusedResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_refused);
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(REFUSED);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -272,9 +272,9 @@ TEST_P(MockTCPChannelTest, RefusedResponse) {
TEST_P(MockTCPChannelTest, YXDomainResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_yxdomain);
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(YXDOMAIN);
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -311,9 +311,9 @@ TEST_P(MockExtraOptsTest, SimpleQuery) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &rsp));
HostResult result;
@@ -349,9 +349,9 @@ class MockNoCheckRespChannelTest : public MockFlagsChannelOptsTest {
TEST_P(MockNoCheckRespChannelTest, ServFailResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_servfail);
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(SERVFAIL);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -363,9 +363,9 @@ TEST_P(MockNoCheckRespChannelTest, ServFailResponse) {
TEST_P(MockNoCheckRespChannelTest, NotImplResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_notimpl);
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(NOTIMP);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -377,9 +377,9 @@ TEST_P(MockNoCheckRespChannelTest, NotImplResponse) {
TEST_P(MockNoCheckRespChannelTest, RefusedResponse) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
- rsp.set_rcode(ns_r_refused);
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A));
+ rsp.set_rcode(REFUSED);
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &rsp));
HostResult result;
ares_gethostbyname(channel_, "www.google.com.", AF_INET, HostCallback, &result);
@@ -395,13 +395,13 @@ class MockEDNSChannelTest : public MockFlagsChannelOptsTest {
TEST_P(MockEDNSChannelTest, RetryWithoutEDNS) {
DNSPacket rspfail;
- rspfail.set_response().set_aa().set_rcode(ns_r_servfail)
- .add_question(new DNSQuestion("www.google.com", ns_t_a));
+ rspfail.set_response().set_aa().set_rcode(FORMERR)
+ .add_question(new DNSQuestion("www.google.com", T_A));
DNSPacket rspok;
rspok.set_response()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 100, {1, 2, 3, 4}));
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReply(&server_, &rspfail))
.WillOnce(SetReply(&server_, &rspok));
HostResult result;
@@ -415,20 +415,20 @@ TEST_P(MockEDNSChannelTest, RetryWithoutEDNS) {
TEST_P(MockChannelTest, SearchDomains) {
DNSPacket nofirst;
- nofirst.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
- nosecond.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket yesthird;
yesthird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A))
.add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &yesthird));
HostResult result;
@@ -443,21 +443,21 @@ TEST_P(MockChannelTest, SearchDomains) {
// Relies on retries so is UDP-only
TEST_P(MockUDPChannelTest, SearchDomainsWithResentReply) {
DNSPacket nofirst;
- nofirst.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- EXPECT_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ EXPECT_CALL(server_, OnRequest("www.first.com", T_A))
.WillOnce(SetReply(&server_, &nofirst));
DNSPacket nosecond;
- nosecond.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- EXPECT_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ EXPECT_CALL(server_, OnRequest("www.second.org", T_A))
.WillOnce(SetReply(&server_, &nosecond));
DNSPacket yesthird;
yesthird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A))
.add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5}));
// Before sending the real answer, resend an earlier reply
- EXPECT_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.third.gov", T_A))
.WillOnce(DoAll(SetReply(&server_, &nofirst),
SetReplyQID(&server_, 123)))
.WillOnce(DoAll(SetReply(&server_, &yesthird),
@@ -474,25 +474,25 @@ TEST_P(MockUDPChannelTest, SearchDomainsWithResentReply) {
TEST_P(MockChannelTest, SearchDomainsBare) {
DNSPacket nofirst;
- nofirst.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
- nosecond.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket nothird;
- nothird.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.third.gov", ns_t_a));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ nothird.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.third.gov", T_A));
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &nothird));
DNSPacket yesbare;
yesbare.set_response().set_aa()
- .add_question(new DNSQuestion("www", ns_t_a))
+ .add_question(new DNSQuestion("www", T_A))
.add_answer(new DNSARR("www", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www", ns_t_a))
+ ON_CALL(server_, OnRequest("www", T_A))
.WillByDefault(SetReply(&server_, &yesbare));
HostResult result;
@@ -508,19 +508,19 @@ TEST_P(MockChannelTest, SearchNoDataThenSuccess) {
// First two search domains recognize the name but have no A records.
DNSPacket nofirst;
nofirst.set_response().set_aa()
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
nosecond.set_response().set_aa()
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket yesthird;
yesthird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A))
.add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &yesthird));
HostResult result;
@@ -536,23 +536,23 @@ TEST_P(MockChannelTest, SearchNoDataThenNoDataBare) {
// First two search domains recognize the name but have no A records.
DNSPacket nofirst;
nofirst.set_response().set_aa()
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
nosecond.set_response().set_aa()
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket nothird;
nothird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A));
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &nothird));
DNSPacket nobare;
nobare.set_response().set_aa()
- .add_question(new DNSQuestion("www", ns_t_a));
- ON_CALL(server_, OnRequest("www", ns_t_a))
+ .add_question(new DNSQuestion("www", T_A));
+ ON_CALL(server_, OnRequest("www", T_A))
.WillByDefault(SetReply(&server_, &nobare));
HostResult result;
@@ -566,23 +566,23 @@ TEST_P(MockChannelTest, SearchNoDataThenFail) {
// First two search domains recognize the name but have no A records.
DNSPacket nofirst;
nofirst.set_response().set_aa()
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
nosecond.set_response().set_aa()
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket nothird;
nothird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A));
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &nothird));
DNSPacket nobare;
- nobare.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www", ns_t_a));
- ON_CALL(server_, OnRequest("www", ns_t_a))
+ nobare.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www", T_A));
+ ON_CALL(server_, OnRequest("www", T_A))
.WillByDefault(SetReply(&server_, &nobare));
HostResult result;
@@ -595,7 +595,7 @@ TEST_P(MockChannelTest, SearchNoDataThenFail) {
TEST_P(MockChannelTest, SearchAllocFailure) {
SearchResult result;
SetAllocFail(1);
- ares_search(channel_, "fully.qualified.", ns_c_in, ns_t_a, SearchCallback, &result);
+ ares_search(channel_, "fully.qualified.", C_IN, T_A, SearchCallback, &result);
/* Already done */
EXPECT_TRUE(result.done_);
EXPECT_EQ(ARES_ENOMEM, result.status_);
@@ -603,19 +603,19 @@ TEST_P(MockChannelTest, SearchAllocFailure) {
TEST_P(MockChannelTest, SearchHighNdots) {
DNSPacket nobare;
- nobare.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("a.b.c.w.w.w", ns_t_a));
- ON_CALL(server_, OnRequest("a.b.c.w.w.w", ns_t_a))
+ nobare.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("a.b.c.w.w.w", T_A));
+ ON_CALL(server_, OnRequest("a.b.c.w.w.w", T_A))
.WillByDefault(SetReply(&server_, &nobare));
DNSPacket yesfirst;
yesfirst.set_response().set_aa()
- .add_question(new DNSQuestion("a.b.c.w.w.w.first.com", ns_t_a))
+ .add_question(new DNSQuestion("a.b.c.w.w.w.first.com", T_A))
.add_answer(new DNSARR("a.b.c.w.w.w.first.com", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("a.b.c.w.w.w.first.com", ns_t_a))
+ ON_CALL(server_, OnRequest("a.b.c.w.w.w.first.com", T_A))
.WillByDefault(SetReply(&server_, &yesfirst));
SearchResult result;
- ares_search(channel_, "a.b.c.w.w.w", ns_c_in, ns_t_a, SearchCallback, &result);
+ ares_search(channel_, "a.b.c.w.w.w", C_IN, T_A, SearchCallback, &result);
Process();
EXPECT_TRUE(result.done_);
EXPECT_EQ(ARES_SUCCESS, result.status_);
@@ -629,11 +629,11 @@ TEST_P(MockChannelTest, SearchHighNdots) {
TEST_P(MockChannelTest, UnspecifiedFamilyV6) {
DNSPacket rsp6;
rsp6.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSAaaaRR("example.com", 100,
{0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03}));
- ON_CALL(server_, OnRequest("example.com", ns_t_aaaa))
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp6));
HostResult result;
@@ -649,14 +649,14 @@ TEST_P(MockChannelTest, UnspecifiedFamilyV6) {
TEST_P(MockChannelTest, UnspecifiedFamilyV4) {
DNSPacket rsp6;
rsp6.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa));
- ON_CALL(server_, OnRequest("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA));
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp6));
DNSPacket rsp4;
rsp4.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A))
.add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("example.com", ns_t_a))
+ ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4));
HostResult result;
@@ -671,14 +671,14 @@ TEST_P(MockChannelTest, UnspecifiedFamilyV4) {
TEST_P(MockChannelTest, UnspecifiedFamilyNoData) {
DNSPacket rsp6;
rsp6.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSCnameRR("example.com", 100, "elsewhere.com"));
- ON_CALL(server_, OnRequest("example.com", ns_t_aaaa))
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp6));
DNSPacket rsp4;
rsp4.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a));
- ON_CALL(server_, OnRequest("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A));
+ ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4));
HostResult result;
@@ -693,15 +693,15 @@ TEST_P(MockChannelTest, UnspecifiedFamilyNoData) {
TEST_P(MockChannelTest, UnspecifiedFamilyCname6A4) {
DNSPacket rsp6;
rsp6.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSCnameRR("example.com", 100, "elsewhere.com"));
- ON_CALL(server_, OnRequest("example.com", ns_t_aaaa))
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp6));
DNSPacket rsp4;
rsp4.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A))
.add_answer(new DNSARR("example.com", 100, {1, 2, 3, 4}));
- ON_CALL(server_, OnRequest("example.com", ns_t_a))
+ ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp4));
HostResult result;
@@ -734,11 +734,11 @@ TEST_P(MockChannelTest, ExplicitIPAllocFail) {
TEST_P(MockChannelTest, SortListV4) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A))
.add_answer(new DNSARR("example.com", 100, {22, 23, 24, 25}))
.add_answer(new DNSARR("example.com", 100, {12, 13, 14, 15}))
.add_answer(new DNSARR("example.com", 100, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("example.com", ns_t_a))
+ ON_CALL(server_, OnRequest("example.com", T_A))
.WillByDefault(SetReply(&server_, &rsp));
{
@@ -772,14 +772,14 @@ TEST_P(MockChannelTest, SortListV4) {
TEST_P(MockChannelTest, SortListV6) {
DNSPacket rsp;
rsp.set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSAaaaRR("example.com", 100,
{0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02}))
.add_answer(new DNSAaaaRR("example.com", 100,
{0x21, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03}));
- ON_CALL(server_, OnRequest("example.com", ns_t_aaaa))
+ ON_CALL(server_, OnRequest("example.com", T_AAAA))
.WillByDefault(SetReply(&server_, &rsp));
{
@@ -809,20 +809,20 @@ TEST_P(MockChannelTest, SortListV6) {
// Relies on retries so is UDP-only
TEST_P(MockUDPChannelTest, SearchDomainsAllocFail) {
DNSPacket nofirst;
- nofirst.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.first.com", ns_t_a));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ nofirst.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.first.com", T_A));
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &nofirst));
DNSPacket nosecond;
- nosecond.set_response().set_aa().set_rcode(ns_r_nxdomain)
- .add_question(new DNSQuestion("www.second.org", ns_t_a));
- ON_CALL(server_, OnRequest("www.second.org", ns_t_a))
+ nosecond.set_response().set_aa().set_rcode(NXDOMAIN)
+ .add_question(new DNSQuestion("www.second.org", T_A));
+ ON_CALL(server_, OnRequest("www.second.org", T_A))
.WillByDefault(SetReply(&server_, &nosecond));
DNSPacket yesthird;
yesthird.set_response().set_aa()
- .add_question(new DNSQuestion("www.third.gov", ns_t_a))
+ .add_question(new DNSQuestion("www.third.gov", T_A))
.add_answer(new DNSARR("www.third.gov", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.third.gov", ns_t_a))
+ ON_CALL(server_, OnRequest("www.third.gov", T_A))
.WillByDefault(SetReply(&server_, &yesthird));
// Fail a variety of different memory allocations, and confirm
@@ -856,10 +856,10 @@ TEST_P(MockUDPChannelTest, Resend) {
std::vector<byte> nothing;
DNSPacket reply;
reply.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04}));
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReplyData(&server_, nothing))
.WillOnce(SetReplyData(&server_, nothing))
.WillOnce(SetReply(&server_, &reply));
@@ -900,7 +900,7 @@ TEST_P(MockUDPChannelTest, CancelLater) {
std::vector<byte> nothing;
// On second request, cancel the channel.
- EXPECT_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ EXPECT_CALL(server_, OnRequest("www.google.com", T_A))
.WillOnce(SetReplyData(&server_, nothing))
.WillOnce(CancelChannel(&server_, channel_));
@@ -936,6 +936,21 @@ TEST_P(MockChannelTest, GetHostByNameDestroyRelative) {
EXPECT_EQ(0, result.timeouts_);
}
+TEST_P(MockChannelTest, GetHostByNameCNAMENoData) {
+ DNSPacket response;
+ response.set_response().set_aa()
+ .add_question(new DNSQuestion("cname.first.com", T_A))
+ .add_answer(new DNSCnameRR("cname.first.com", 100, "a.first.com"));
+ ON_CALL(server_, OnRequest("cname.first.com", T_A))
+ .WillByDefault(SetReply(&server_, &response));
+
+ HostResult result;
+ ares_gethostbyname(channel_, "cname.first.com", AF_INET, HostCallback, &result);
+ Process();
+ EXPECT_TRUE(result.done_);
+ EXPECT_EQ(ARES_ENODATA, result.status_);
+}
+
TEST_P(MockChannelTest, GetHostByAddrDestroy) {
unsigned char gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08};
HostResult result;
@@ -953,9 +968,9 @@ TEST_P(MockChannelTest, GetHostByAddrDestroy) {
TEST_P(MockChannelTest, HostAlias) {
DNSPacket reply;
reply.set_response().set_aa()
- .add_question(new DNSQuestion("www.google.com", ns_t_a))
+ .add_question(new DNSQuestion("www.google.com", T_A))
.add_answer(new DNSARR("www.google.com", 0x0100, {0x01, 0x02, 0x03, 0x04}));
- ON_CALL(server_, OnRequest("www.google.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.google.com", T_A))
.WillByDefault(SetReply(&server_, &reply));
TempFile aliases("\n\n# www commentedout\nwww www.google.com\n");
@@ -973,9 +988,9 @@ TEST_P(MockChannelTest, HostAlias) {
TEST_P(MockChannelTest, HostAliasMissing) {
DNSPacket yesfirst;
yesfirst.set_response().set_aa()
- .add_question(new DNSQuestion("www.first.com", ns_t_a))
+ .add_question(new DNSQuestion("www.first.com", T_A))
.add_answer(new DNSARR("www.first.com", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &yesfirst));
TempFile aliases("\n\n# www commentedout\nww www.google.com\n");
@@ -992,9 +1007,9 @@ TEST_P(MockChannelTest, HostAliasMissing) {
TEST_P(MockChannelTest, HostAliasMissingFile) {
DNSPacket yesfirst;
yesfirst.set_response().set_aa()
- .add_question(new DNSQuestion("www.first.com", ns_t_a))
+ .add_question(new DNSQuestion("www.first.com", T_A))
.add_answer(new DNSARR("www.first.com", 0x0200, {2, 3, 4, 5}));
- ON_CALL(server_, OnRequest("www.first.com", ns_t_a))
+ ON_CALL(server_, OnRequest("www.first.com", T_A))
.WillByDefault(SetReply(&server_, &yesfirst));
EnvValue with_env("HOSTALIASES", "bogus.mcfile");
@@ -1056,39 +1071,39 @@ TEST_P(RotateMultiMockTest, ThirdServer) {
ares_destroy_options(&opts);
DNSPacket servfailrsp;
- servfailrsp.set_response().set_aa().set_rcode(ns_r_servfail)
- .add_question(new DNSQuestion("www.example.com", ns_t_a));
+ servfailrsp.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.example.com", T_A));
DNSPacket notimplrsp;
- notimplrsp.set_response().set_aa().set_rcode(ns_r_notimpl)
- .add_question(new DNSQuestion("www.example.com", ns_t_a));
+ notimplrsp.set_response().set_aa().set_rcode(NOTIMP)
+ .add_question(new DNSQuestion("www.example.com", T_A));
DNSPacket okrsp;
okrsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.example.com", ns_t_a))
+ .add_question(new DNSQuestion("www.example.com", T_A))
.add_answer(new DNSARR("www.example.com", 100, {2,3,4,5}));
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &servfailrsp));
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &notimplrsp));
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &okrsp));
CheckExample();
// Second time around, starts from server [1].
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &servfailrsp));
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &notimplrsp));
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &okrsp));
CheckExample();
// Third time around, starts from server [2].
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &servfailrsp));
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &notimplrsp));
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &okrsp));
CheckExample();
}
@@ -1101,39 +1116,39 @@ TEST_P(NoRotateMultiMockTest, ThirdServer) {
ares_destroy_options(&opts);
DNSPacket servfailrsp;
- servfailrsp.set_response().set_aa().set_rcode(ns_r_servfail)
- .add_question(new DNSQuestion("www.example.com", ns_t_a));
+ servfailrsp.set_response().set_aa().set_rcode(SERVFAIL)
+ .add_question(new DNSQuestion("www.example.com", T_A));
DNSPacket notimplrsp;
- notimplrsp.set_response().set_aa().set_rcode(ns_r_notimpl)
- .add_question(new DNSQuestion("www.example.com", ns_t_a));
+ notimplrsp.set_response().set_aa().set_rcode(NOTIMP)
+ .add_question(new DNSQuestion("www.example.com", T_A));
DNSPacket okrsp;
okrsp.set_response().set_aa()
- .add_question(new DNSQuestion("www.example.com", ns_t_a))
+ .add_question(new DNSQuestion("www.example.com", T_A))
.add_answer(new DNSARR("www.example.com", 100, {2,3,4,5}));
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &servfailrsp));
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &notimplrsp));
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &okrsp));
CheckExample();
// Second time around, still starts from server [0].
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &servfailrsp));
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &notimplrsp));
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &okrsp));
CheckExample();
// Third time around, still starts from server [0].
- EXPECT_CALL(*servers_[0], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[0], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[0].get(), &servfailrsp));
- EXPECT_CALL(*servers_[1], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[1], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[1].get(), &notimplrsp));
- EXPECT_CALL(*servers_[2], OnRequest("www.example.com", ns_t_a))
+ EXPECT_CALL(*servers_[2], OnRequest("www.example.com", T_A))
.WillOnce(SetReply(servers_[2].get(), &okrsp));
CheckExample();
}
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-a.cc b/grpc/third_party/cares/cares/test/ares-test-parse-a.cc
index 77d9591c..f8050ac7 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-a.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-a.cc
@@ -10,14 +10,15 @@ namespace test {
TEST_F(LibraryTest, ParseAReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
- .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5}));
+ .add_question(new DNSQuestion("example.com", T_A))
+ .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5}))
+ .add_answer(new DNSAaaaRR("example.com", 0x01020304, {0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5}));
std::vector<byte> data = {
0x12, 0x34, // qid
0x84, // response + query + AA + not-TC + not-RD
0x00, // not-RA + not-Z + not-AD + not-CD + rc=NoError
0x00, 0x01, // num questions
- 0x00, 0x01, // num answer RRs
+ 0x00, 0x02, // num answer RRs
0x00, 0x00, // num authority RRs
0x00, 0x00, // num additional RRs
// Question
@@ -35,6 +36,15 @@ TEST_F(LibraryTest, ParseAReplyOK) {
0x01, 0x02, 0x03, 0x04, // TTL
0x00, 0x04, // rdata length
0x02, 0x03, 0x04, 0x05,
+ // Answer 2
+ 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e',
+ 0x03, 'c', 'o', 'm',
+ 0x00,
+ 0x00, 0x1c, // RR type
+ 0x00, 0x01, // class IN
+ 0x01, 0x02, 0x03, 0x04, // TTL
+ 0x00, 0x10, // rdata length
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x04, 0x05,
};
EXPECT_EQ(data, pkt.data());
struct hostent *host = nullptr;
@@ -68,7 +78,7 @@ TEST_F(LibraryTest, ParseMalformedAReply) {
0x84, // [2] response + query + AA + not-TC + not-RD
0x00, // [3] not-RA + not-Z + not-AD + not-CD + rc=NoError
0x00, 0x01, // [4:6) num questions
- 0x00, 0x01, // [6:8) num answer RRs
+ 0x00, 0x02, // [6:8) num answer RRs
0x00, 0x00, // [8:10) num authority RRs
0x00, 0x00, // [10:12) num additional RRs
// Question
@@ -109,7 +119,7 @@ TEST_F(LibraryTest, ParseMalformedAReply) {
TEST_F(LibraryTest, ParseAReplyNoData) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a));
+ .add_question(new DNSQuestion("example.com", T_A));
std::vector<byte> data = pkt.data();
struct hostent *host = nullptr;
struct ares_addrttl info[2];
@@ -121,16 +131,22 @@ TEST_F(LibraryTest, ParseAReplyNoData) {
// Again but with a CNAME.
pkt.add_answer(new DNSCnameRR("example.com", 200, "c.example.com"));
- EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(),
+ data = pkt.data();
+ // Expect success as per https://github.com/c-ares/c-ares/commit/2c63440127feed70ccefb148b8f938a2df6c15f8
+ EXPECT_EQ(ARES_SUCCESS, ares_parse_a_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(0, count);
- EXPECT_EQ(nullptr, host);
+ EXPECT_NE(nullptr, host);
+ std::stringstream ss;
+ ss << HostEnt(host);
+ EXPECT_EQ("{'c.example.com' aliases=[example.com] addrs=[]}", ss.str());
+ ares_free_hostent(host);
}
TEST_F(LibraryTest, ParseAReplyVariantA) {
DNSPacket pkt;
pkt.set_qid(6366).set_rd().set_ra()
- .add_question(new DNSQuestion("mit.edu", ns_t_a))
+ .add_question(new DNSQuestion("mit.edu", T_A))
.add_answer(new DNSARR("mit.edu", 52, {18,7,22,69}))
.add_auth(new DNSNsRR("mit.edu", 292, "W20NS.mit.edu"))
.add_auth(new DNSNsRR("mit.edu", 292, "BITSY.mit.edu"))
@@ -151,7 +167,7 @@ TEST_F(LibraryTest, ParseAReplyVariantA) {
TEST_F(LibraryTest, ParseAReplyJustCname) {
DNSPacket pkt;
pkt.set_qid(6366).set_rd().set_ra()
- .add_question(new DNSQuestion("mit.edu", ns_t_a))
+ .add_question(new DNSQuestion("mit.edu", T_A))
.add_answer(new DNSCnameRR("mit.edu", 52, "other.mit.edu"));
struct hostent *host = nullptr;
struct ares_addrttl info[2];
@@ -170,7 +186,7 @@ TEST_F(LibraryTest, ParseAReplyJustCname) {
TEST_F(LibraryTest, ParseAReplyVariantCname) {
DNSPacket pkt;
pkt.set_qid(6366).set_rd().set_ra()
- .add_question(new DNSQuestion("query.example.com", ns_t_a))
+ .add_question(new DNSQuestion("query.example.com", T_A))
.add_answer(new DNSCnameRR("query.example.com", 200, "redirect.query.example.com"))
.add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,22}))
.add_auth(new DNSNsRR("example.com", 218, "aa.ns1.example.com"))
@@ -202,7 +218,7 @@ TEST_F(LibraryTest, ParseAReplyVariantCname) {
TEST_F(LibraryTest, ParseAReplyVariantCnameChain) {
DNSPacket pkt;
pkt.set_qid(6366).set_rd().set_ra()
- .add_question(new DNSQuestion("c1.localhost", ns_t_a))
+ .add_question(new DNSQuestion("c1.localhost", T_A))
.add_answer(new DNSCnameRR("c1.localhost", 604800, "c2.localhost"))
.add_answer(new DNSCnameRR("c2.localhost", 604800, "c3.localhost"))
.add_answer(new DNSCnameRR("c3.localhost", 604800, "c4.localhost"))
@@ -227,7 +243,7 @@ TEST_F(LibraryTest, ParseAReplyVariantCnameChain) {
TEST_F(LibraryTest, DISABLED_ParseAReplyVariantCnameLast) {
DNSPacket pkt;
pkt.set_qid(6366).set_rd().set_ra()
- .add_question(new DNSQuestion("query.example.com", ns_t_a))
+ .add_question(new DNSQuestion("query.example.com", T_A))
.add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,221}))
.add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,222}))
.add_answer(new DNSARR("redirect.query.example.com", 300, {129,97,123,223}))
@@ -255,7 +271,7 @@ TEST_F(LibraryTest, DISABLED_ParseAReplyVariantCnameLast) {
TEST_F(LibraryTest, ParseAReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A))
.add_answer(new DNSARR("example.com", 100, {0x02, 0x03, 0x04, 0x05}));
std::vector<byte> data;
@@ -269,17 +285,17 @@ TEST_F(LibraryTest, ParseAReplyErrors) {
EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
- pkt.add_question(new DNSQuestion("example.com", ns_t_a));
+ pkt.add_question(new DNSQuestion("example.com", T_A));
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_a));
+ pkt.add_question(new DNSQuestion("Axample.com", T_A));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_a));
+ pkt.add_question(new DNSQuestion("example.com", T_A));
#ifdef DISABLED
// Not a response.
@@ -291,22 +307,22 @@ TEST_F(LibraryTest, ParseAReplyErrors) {
pkt.set_response(true);
// Bad return code.
- pkt.set_rcode(ns_r_formerr);
+ pkt.set_rcode(FORMERR);
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_a_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
- pkt.set_rcode(ns_r_noerror);
+ pkt.set_rcode(NOERROR);
#endif
// Two questions
- pkt.add_question(new DNSQuestion("example.com", ns_t_a));
+ pkt.add_question(new DNSQuestion("example.com", T_A));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_a_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_a));
+ pkt.add_question(new DNSQuestion("example.com", T_A));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -340,7 +356,7 @@ TEST_F(LibraryTest, ParseAReplyErrors) {
TEST_F(LibraryTest, ParseAReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_a))
+ .add_question(new DNSQuestion("example.com", T_A))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSARR("c.example.com", 500, {0x02, 0x03, 0x04, 0x05}));
std::vector<byte> data = pkt.data();
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-aaaa.cc b/grpc/third_party/cares/cares/test/ares-test-parse-aaaa.cc
index 9d0457e6..df565296 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-aaaa.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-aaaa.cc
@@ -10,10 +10,11 @@ namespace test {
TEST_F(LibraryTest, ParseAaaaReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSAaaaRR("example.com", 100,
{0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
- 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04}));
+ 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04}))
+ .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5}));
std::vector<byte> data = pkt.data();
struct hostent *host = nullptr;
struct ares_addr6ttl info[5];
@@ -39,7 +40,7 @@ TEST_F(LibraryTest, ParseAaaaReplyOK) {
TEST_F(LibraryTest, ParseAaaaReplyCname) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSCnameRR("example.com", 50, "c.example.com"))
.add_answer(new DNSAaaaRR("c.example.com", 100,
{0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
@@ -74,7 +75,7 @@ TEST_F(LibraryTest, ParseAaaaReplyCname) {
TEST_F(LibraryTest, ParseAaaaReplyNoData) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa));
+ .add_question(new DNSQuestion("example.com", T_AAAA));
std::vector<byte> data = pkt.data();
struct hostent *host = nullptr;
struct ares_addr6ttl info[2];
@@ -95,7 +96,7 @@ TEST_F(LibraryTest, ParseAaaaReplyNoData) {
TEST_F(LibraryTest, ParseAaaaReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSAaaaRR("example.com", 100,
{0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04}));
@@ -111,26 +112,26 @@ TEST_F(LibraryTest, ParseAaaaReplyErrors) {
EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
- pkt.add_question(new DNSQuestion("example.com", ns_t_aaaa));
+ pkt.add_question(new DNSQuestion("example.com", T_AAAA));
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_aaaa));
+ pkt.add_question(new DNSQuestion("Axample.com", T_AAAA));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_aaaa_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_aaaa));
+ pkt.add_question(new DNSQuestion("example.com", T_AAAA));
// Two questions.
- pkt.add_question(new DNSQuestion("example.com", ns_t_aaaa));
+ pkt.add_question(new DNSQuestion("example.com", T_AAAA));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_aaaa_reply(data.data(), data.size(),
&host, info, &count));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_aaaa));
+ pkt.add_question(new DNSQuestion("example.com", T_AAAA));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -168,7 +169,7 @@ TEST_F(LibraryTest, ParseAaaaReplyErrors) {
TEST_F(LibraryTest, ParseAaaaReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_aaaa))
+ .add_question(new DNSQuestion("example.com", T_AAAA))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSAaaaRR("c.example.com", 100,
{0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-caa.cc b/grpc/third_party/cares/cares/test/ares-test-parse-caa.cc
new file mode 100644
index 00000000..99903edf
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-caa.cc
@@ -0,0 +1,113 @@
+#include "ares-test.h"
+#include "dns-proto.h"
+
+#include <sstream>
+#include <vector>
+
+namespace ares {
+namespace test {
+
+TEST_F(LibraryTest, ParseCaaReplyMultipleOK) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x77, 0x69, 0x6B, // '............wik
+ 0x69, 0x70, 0x65, 0x64, 0x69, 0x61, 0x03, 0x6F, 0x72, 0x67, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, // ipedia.org......
+ 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x15, 0x00, 0x05, 0x69, 0x73, 0x73, // ........#....iss
+ 0x75, 0x65, 0x67, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x69, 0x67, 0x6E, 0x2E, 0x63, 0x6F, 0x6D, // ueglobalsign.com
+ 0xC0, 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x13, 0x00, 0x05, 0x69, 0x73, // .........#....is
+ 0x73, 0x75, 0x65, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0xC0, // suedigicert.com.
+ 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x16, 0x00, 0x05, 0x69, 0x73, 0x73, // ........#....iss
+ 0x75, 0x65, 0x6C, 0x65, 0x74, 0x73, 0x65, 0x6E, 0x63, 0x72, 0x79, 0x70, 0x74, 0x2E, 0x6F, 0x72, // ueletsencrypt.or
+ 0x67, 0xC0, 0x0C, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x23, 0x00, 0x25, 0x00, 0x05, 0x69, // g.........#.%..i
+ 0x6F, 0x64, 0x65, 0x66, 0x6D, 0x61, 0x69, 0x6C, 0x74, 0x6F, 0x3A, 0x64, 0x6E, 0x73, 0x2D, 0x61, // odefmailto:dns-a
+ 0x64, 0x6D, 0x69, 0x6E, 0x40, 0x77, 0x69, 0x6B, 0x69, 0x6D, 0x65, 0x64, 0x69, 0x61, 0x2E, 0x6F, // dmin@wikimedia.o
+ 0x72, 0x67 // rg
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_SUCCESS, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_NE(nullptr, caa);
+ ASSERT_NE(nullptr, caa->next);
+ ASSERT_NE(nullptr, caa->next->next);
+ ASSERT_NE(nullptr, caa->next->next->next);
+
+ ares_free_data(caa);
+}
+
+TEST_F(LibraryTest, ParseCaaReplySingleOK) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo
+ 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com.........
+ 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep
+ 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_SUCCESS, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_NE(nullptr, caa);
+
+ EXPECT_EQ(caa->critical, 0);
+ EXPECT_EQ(caa->plength, 5);
+ EXPECT_STREQ((char *)caa->property, "issue");
+ EXPECT_EQ(caa->length, 8);
+ EXPECT_STREQ((char *)caa->value, "pki.goog");
+
+ ares_free_data(caa);
+}
+
+TEST_F(LibraryTest, ParseCaaBogusReply1) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo
+ 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com.........
+ 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x00, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep
+ 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_EQ(nullptr, caa);
+}
+
+TEST_F(LibraryTest, ParseCaaBogusReply2) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo
+ 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com.........
+ 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x0F, 0x00, 0x0e, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep
+ 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_EQ(nullptr, caa);
+}
+
+TEST_F(LibraryTest, ParseCaaBogusReply3) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x67, 0x6F, 0x6F, // '............goo
+ 0x67, 0x6C, 0x65, 0x03, 0x63, 0x6F, 0x6D, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, 0x01, 0x01, // gle.com.........
+ 0x00, 0x01, 0x00, 0x01, 0x43, 0xBE, 0x00, 0x10, 0x00, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x70, // ....C.....issuep
+ 0x6B, 0x69, 0x2E, 0x67, 0x6F, 0x6F, 0x67 // ki.goog
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_EQ(nullptr, caa);
+}
+
+TEST_F(LibraryTest, ParseCaaEmptyReply) {
+ std::vector<byte> data = {
+ 0x27, 0x86, 0x81, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0x77, 0x69, 0x6B, // '............wik
+ 0x69, 0x70, 0x65, 0x64, 0x69, 0x61, 0x02, 0x64, 0x65, 0x00, 0x01, 0x01, 0x00, 0x01, 0xC0, 0x0C, // ipedia.de.......
+ 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x02, 0x58, 0x00, 0x3B, 0x04, 0x6E, 0x73, 0x38, 0x31, 0x0D, // .......X.;.ns81.
+ 0x64, 0x6F, 0x6D, 0x61, 0x69, 0x6E, 0x63, 0x6F, 0x6E, 0x74, 0x72, 0x6F, 0x6C, 0x03, 0x63, 0x6F, // domaincontrol.co
+ 0x6D, 0x00, 0x03, 0x64, 0x6E, 0x73, 0x05, 0x6A, 0x6F, 0x6D, 0x61, 0x78, 0x03, 0x6E, 0x65, 0x74, // m..dns.jomax.net
+ 0x00, 0x78, 0x67, 0xFE, 0x34, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x3A, // .xg.4..p.... ..:
+ 0x80, 0x00, 0x00, 0x02, 0x58 // ....X
+ };
+
+ struct ares_caa_reply* caa = nullptr;
+ EXPECT_EQ(ARES_ENODATA, ares_parse_caa_reply(data.data(), data.size(), &caa));
+ ASSERT_EQ(nullptr, caa);
+}
+
+} // namespace test
+} // namespace ares
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-mx.cc b/grpc/third_party/cares/cares/test/ares-test-parse-mx.cc
index 37324a6d..db8fa894 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-mx.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-mx.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseMxReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com"))
.add_answer(new DNSMxRR("example.com", 100, 200, "mx2.example.com"));
std::vector<byte> data = pkt.data();
@@ -65,7 +65,7 @@ TEST_F(LibraryTest, ParseMxReplyMalformed) {
TEST_F(LibraryTest, ParseMxReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com"));
std::vector<byte> data;
struct ares_mx_reply* mx = nullptr;
@@ -75,25 +75,25 @@ TEST_F(LibraryTest, ParseMxReplyErrors) {
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx));
EXPECT_EQ(nullptr, mx);
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("Axample.com", T_MX));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
#endif
// Two questions.
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_mx_reply(data.data(), data.size(), &mx));
EXPECT_EQ(nullptr, mx);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
// Wrong sort of answer.
// TODO(drysdale): check if this should be ARES_ENODATA?
@@ -124,7 +124,7 @@ TEST_F(LibraryTest, ParseMxReplyErrors) {
TEST_F(LibraryTest, ParseMxReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSMxRR("c.example.com", 100, 100, "mx1.example.com"));
std::vector<byte> data = pkt.data();
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-naptr.cc b/grpc/third_party/cares/cares/test/ares-test-parse-naptr.cc
index 3238a192..aa1a2a50 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-naptr.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-naptr.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseNaptrReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_naptr))
+ .add_question(new DNSQuestion("example.com", T_NAPTR))
.add_answer(new DNSNaptrRR("example.com", 100,
10, 20, "SP", "service", "regexp", "replace"))
.add_answer(new DNSNaptrRR("example.com", 0x0010,
@@ -43,7 +43,7 @@ TEST_F(LibraryTest, ParseNaptrReplyOK) {
TEST_F(LibraryTest, ParseNaptrReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_naptr))
+ .add_question(new DNSQuestion("example.com", T_NAPTR))
.add_answer(new DNSNaptrRR("example.com", 100,
10, 20, "SP", "service", "regexp", "replace"));
std::vector<byte> data;
@@ -53,24 +53,24 @@ TEST_F(LibraryTest, ParseNaptrReplyErrors) {
pkt.questions_.clear();
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_naptr_reply(data.data(), data.size(), &naptr));
- pkt.add_question(new DNSQuestion("example.com", ns_t_naptr));
+ pkt.add_question(new DNSQuestion("example.com", T_NAPTR));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_naptr));
+ pkt.add_question(new DNSQuestion("Axample.com", T_NAPTR));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_naptr_reply(data.data(), data.size(), &naptr));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_naptr));
+ pkt.add_question(new DNSQuestion("example.com", T_NAPTR));
#endif
// Two questions
- pkt.add_question(new DNSQuestion("example.com", ns_t_naptr));
+ pkt.add_question(new DNSQuestion("example.com", T_NAPTR));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_naptr_reply(data.data(), data.size(), &naptr));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_naptr));
+ pkt.add_question(new DNSQuestion("example.com", T_NAPTR));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -129,7 +129,7 @@ TEST_F(LibraryTest, ParseNaptrReplyTooShort) {
TEST_F(LibraryTest, ParseNaptrReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_naptr))
+ .add_question(new DNSQuestion("example.com", T_NAPTR))
.add_answer(new DNSNaptrRR("example.com", 100,
10, 20, "SP", "service", "regexp", "replace"))
.add_answer(new DNSNaptrRR("example.com", 0x0010,
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-ns.cc b/grpc/third_party/cares/cares/test/ares-test-parse-ns.cc
index cd653189..31649217 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-ns.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-ns.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseNsReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_ns))
+ .add_question(new DNSQuestion("example.com", T_NS))
.add_answer(new DNSNsRR("example.com", 100, "ns.example.com"));
std::vector<byte> data = pkt.data();
@@ -26,7 +26,7 @@ TEST_F(LibraryTest, ParseNsReplyOK) {
TEST_F(LibraryTest, ParseNsReplyMultiple) {
DNSPacket pkt;
pkt.set_qid(10501).set_response().set_rd().set_ra()
- .add_question(new DNSQuestion("google.com", ns_t_ns))
+ .add_question(new DNSQuestion("google.com", T_NS))
.add_answer(new DNSNsRR("google.com", 59, "ns1.google.com"))
.add_answer(new DNSNsRR("google.com", 59, "ns2.google.com"))
.add_answer(new DNSNsRR("google.com", 59, "ns3.google.com"))
@@ -49,7 +49,7 @@ TEST_F(LibraryTest, ParseNsReplyMultiple) {
TEST_F(LibraryTest, ParseNsReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_ns))
+ .add_question(new DNSQuestion("example.com", T_NS))
.add_answer(new DNSNsRR("example.com", 100, "ns.example.com"));
std::vector<byte> data;
struct hostent *host = nullptr;
@@ -58,24 +58,24 @@ TEST_F(LibraryTest, ParseNsReplyErrors) {
pkt.questions_.clear();
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_ns_reply(data.data(), data.size(), &host));
- pkt.add_question(new DNSQuestion("example.com", ns_t_ns));
+ pkt.add_question(new DNSQuestion("example.com", T_NS));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_ns));
+ pkt.add_question(new DNSQuestion("Axample.com", T_NS));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_ns_reply(data.data(), data.size(), &host));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_ns));
+ pkt.add_question(new DNSQuestion("example.com", T_NS));
#endif
// Two questions.
- pkt.add_question(new DNSQuestion("example.com", ns_t_ns));
+ pkt.add_question(new DNSQuestion("example.com", T_NS));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_ns_reply(data.data(), data.size(), &host));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_ns));
+ pkt.add_question(new DNSQuestion("example.com", T_NS));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -101,7 +101,7 @@ TEST_F(LibraryTest, ParseNsReplyErrors) {
TEST_F(LibraryTest, ParseNsReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_ns))
+ .add_question(new DNSQuestion("example.com", T_NS))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSNsRR("c.example.com", 100, "ns.example.com"));
std::vector<byte> data = pkt.data();
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-ptr.cc b/grpc/third_party/cares/cares/test/ares-test-parse-ptr.cc
index c769b29c..6fdaf3ea 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-ptr.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-ptr.cc
@@ -11,7 +11,7 @@ TEST_F(LibraryTest, ParsePtrReplyOK) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com"));
std::vector<byte> data = pkt.data();
@@ -29,7 +29,7 @@ TEST_F(LibraryTest, ParsePtrReplyCname) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa"))
.add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com"));
std::vector<byte> data = pkt.data();
@@ -63,7 +63,7 @@ TEST_F(LibraryTest, ParsePtrReplyMalformedCname) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSMalformedCnameRR("64.48.32.16.in-addr.arpa", 50, "64.48.32.8.in-addr.arpa"))
.add_answer(new DNSPtrRR("64.48.32.8.in-addr.arpa", 100, "other.com"));
std::vector<byte> data = pkt.data();
@@ -78,7 +78,7 @@ TEST_F(LibraryTest, ParseManyPtrReply) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com"))
@@ -102,7 +102,7 @@ TEST_F(LibraryTest, ParsePtrReplyAdditional) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 55, "other.com"))
.add_auth(new DNSNsRR("16.in-addr.arpa", 234, "ns1.other.com"))
.add_auth(new DNSNsRR("16.in-addr.arpa", 234, "bb.ns2.other.com"))
@@ -126,7 +126,7 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other.com"));
std::vector<byte> data;
struct hostent *host = nullptr;
@@ -136,26 +136,26 @@ TEST_F(LibraryTest, ParsePtrReplyErrors) {
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(),
addrv4, sizeof(addrv4), AF_INET, &host));
- pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR));
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("99.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("99.48.32.16.in-addr.arpa", T_PTR));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_ptr_reply(data.data(), data.size(),
addrv4, sizeof(addrv4), AF_INET, &host));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR));
// Two questions.
- pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_ptr_reply(data.data(), data.size(),
addrv4, sizeof(addrv4), AF_INET, &host));
EXPECT_EQ(nullptr, host);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -197,7 +197,7 @@ TEST_F(LibraryTest, ParsePtrReplyAllocFailSome) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com"))
@@ -217,7 +217,7 @@ TEST_F(LibraryTest, ParsePtrReplyAllocFailMany) {
byte addrv4[4] = {0x10, 0x20, 0x30, 0x40};
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr))
+ .add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "main.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other1.com"))
.add_answer(new DNSPtrRR("64.48.32.16.in-addr.arpa", 100, "other2.com"))
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-soa-any.cc b/grpc/third_party/cares/cares/test/ares-test-parse-soa-any.cc
new file mode 100644
index 00000000..700073c5
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-soa-any.cc
@@ -0,0 +1,111 @@
+#include "ares-test.h"
+#include "dns-proto.h"
+
+#include <sstream>
+#include <vector>
+
+namespace ares {
+namespace test {
+
+TEST_F(LibraryTest, ParseSoaAnyReplyOK) {
+ DNSPacket pkt;
+ pkt.set_qid(0x1234).set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_ANY))\
+ .add_answer(new DNSARR("example.com", 0x01020304, {2,3,4,5}))
+ .add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com"))
+ .add_answer(new DNSMxRR("example.com", 100, 200, "mx2.example.com"))
+ .add_answer(new DNSSoaRR("example.com", 100,
+ "soa1.example.com", "fred.example.com",
+ 1, 2, 3, 4, 5));
+ std::vector<byte> data = pkt.data();
+
+ struct ares_soa_reply* soa = nullptr;
+ EXPECT_EQ(ARES_SUCCESS, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ ASSERT_NE(nullptr, soa);
+ EXPECT_EQ("soa1.example.com", std::string(soa->nsname));
+ EXPECT_EQ("fred.example.com", std::string(soa->hostmaster));
+ EXPECT_EQ(1, soa->serial);
+ EXPECT_EQ(2, soa->refresh);
+ EXPECT_EQ(3, soa->retry);
+ EXPECT_EQ(4, soa->expire);
+ EXPECT_EQ(5, soa->minttl);
+ ares_free_data(soa);
+}
+
+TEST_F(LibraryTest, ParseSoaAnyReplyErrors) {
+ DNSPacket pkt;
+ pkt.set_qid(0x1234).set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_ANY))
+ .add_answer(new DNSSoaRR("example.com", 100,
+ "soa1.example.com", "fred.example.com",
+ 1, 2, 3, 4, 5));
+ std::vector<byte> data;
+ struct ares_soa_reply* soa = nullptr;
+
+ // No question.
+ pkt.questions_.clear();
+ data = pkt.data();
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ pkt.add_question(new DNSQuestion("example.com", T_ANY));
+
+#ifdef DISABLED
+ // Question != answer
+ pkt.questions_.clear();
+ pkt.add_question(new DNSQuestion("Axample.com", T_ANY));
+ data = pkt.data();
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ pkt.questions_.clear();
+ pkt.add_question(new DNSQuestion("example.com", T_ANY));
+#endif
+
+ // Two questions
+ pkt.add_question(new DNSQuestion("example.com", T_ANY));
+ data = pkt.data();
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ pkt.questions_.clear();
+ pkt.add_question(new DNSQuestion("example.com", T_ANY));
+
+ // Wrong sort of answer.
+ pkt.answers_.clear();
+ pkt.add_answer(new DNSMxRR("example.com", 100, 100, "mx1.example.com"));
+ data = pkt.data();
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ pkt.answers_.clear();
+ pkt.add_answer(new DNSSoaRR("example.com", 100,
+ "soa1.example.com", "fred.example.com",
+ 1, 2, 3, 4, 5));
+
+ // No answer.
+ pkt.answers_.clear();
+ data = pkt.data();
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ pkt.add_answer(new DNSSoaRR("example.com", 100,
+ "soa1.example.com", "fred.example.com",
+ 1, 2, 3, 4, 5));
+
+ // Truncated packets.
+ data = pkt.data();
+ for (size_t len = 1; len < data.size(); len++) {
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), len, &soa));
+ }
+}
+
+TEST_F(LibraryTest, ParseSoaAnyReplyAllocFail) {
+ DNSPacket pkt;
+ pkt.set_qid(0x1234).set_response().set_aa()
+ .add_question(new DNSQuestion("example.com", T_ANY))
+ .add_answer(new DNSSoaRR("example.com", 100,
+ "soa1.example.com", "fred.example.com",
+ 1, 2, 3, 4, 5));
+ std::vector<byte> data = pkt.data();
+ struct ares_soa_reply* soa = nullptr;
+
+ for (int ii = 1; ii <= 5; ii++) {
+ ClearFails();
+ SetAllocFail(ii);
+ EXPECT_EQ(ARES_ENOMEM, ares_parse_soa_reply(data.data(), data.size(), &soa)) << ii;
+ }
+}
+
+} // namespace test
+} // namespace ares
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-soa.cc b/grpc/third_party/cares/cares/test/ares-test-parse-soa.cc
index afa4b7ab..22a78e5f 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-soa.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-soa.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseSoaReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_soa))
+ .add_question(new DNSQuestion("example.com", T_SOA))
.add_answer(new DNSSoaRR("example.com", 100,
"soa1.example.com", "fred.example.com",
1, 2, 3, 4, 5));
@@ -32,7 +32,7 @@ TEST_F(LibraryTest, ParseSoaReplyOK) {
TEST_F(LibraryTest, ParseSoaReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_soa))
+ .add_question(new DNSQuestion("example.com", T_SOA))
.add_answer(new DNSSoaRR("example.com", 100,
"soa1.example.com", "fred.example.com",
1, 2, 3, 4, 5));
@@ -43,24 +43,24 @@ TEST_F(LibraryTest, ParseSoaReplyErrors) {
pkt.questions_.clear();
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
- pkt.add_question(new DNSQuestion("example.com", ns_t_soa));
+ pkt.add_question(new DNSQuestion("example.com", T_SOA));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_soa));
+ pkt.add_question(new DNSQuestion("Axample.com", T_SOA));
data = pkt.data();
- EXPECT_EQ(ARES_ENODATA, ares_parse_soa_reply(data.data(), data.size(), &soa));
+ EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_soa));
+ pkt.add_question(new DNSQuestion("example.com", T_SOA));
#endif
// Two questions
- pkt.add_question(new DNSQuestion("example.com", ns_t_soa));
+ pkt.add_question(new DNSQuestion("example.com", T_SOA));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_soa_reply(data.data(), data.size(), &soa));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_soa));
+ pkt.add_question(new DNSQuestion("example.com", T_SOA));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -90,7 +90,7 @@ TEST_F(LibraryTest, ParseSoaReplyErrors) {
TEST_F(LibraryTest, ParseSoaReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_soa))
+ .add_question(new DNSQuestion("example.com", T_SOA))
.add_answer(new DNSSoaRR("example.com", 100,
"soa1.example.com", "fred.example.com",
1, 2, 3, 4, 5));
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-srv.cc b/grpc/third_party/cares/cares/test/ares-test-parse-srv.cc
index cc651d6d..b0047598 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-srv.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-srv.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseSrvReplyOK) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_srv))
+ .add_question(new DNSQuestion("example.com", T_SRV))
.add_answer(new DNSSrvRR("example.com", 100, 10, 20, 30, "srv.example.com"))
.add_answer(new DNSSrvRR("example.com", 100, 11, 21, 31, "srv2.example.com"));
std::vector<byte> data = pkt.data();
@@ -38,7 +38,7 @@ TEST_F(LibraryTest, ParseSrvReplyOK) {
TEST_F(LibraryTest, ParseSrvReplySingle) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.abc.def.com", ns_t_srv))
+ .add_question(new DNSQuestion("example.abc.def.com", T_SRV))
.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com"))
.add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com"))
.add_auth(new DNSNsRR("abc.def.com", 44, "else2.where.com"))
@@ -96,7 +96,7 @@ TEST_F(LibraryTest, ParseSrvReplyMalformed) {
TEST_F(LibraryTest, ParseSrvReplyMultiple) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_ra().set_rd()
- .add_question(new DNSQuestion("srv.example.com", ns_t_srv))
+ .add_question(new DNSQuestion("srv.example.com", T_SRV))
.add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 6789, "a1.srv.example.com"))
.add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 4567, "a2.srv.example.com"))
.add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 5678, "a3.srv.example.com"))
@@ -142,7 +142,7 @@ TEST_F(LibraryTest, ParseSrvReplyMultiple) {
TEST_F(LibraryTest, ParseSrvReplyCname) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.abc.def.com", ns_t_srv))
+ .add_question(new DNSQuestion("example.abc.def.com", T_SRV))
.add_answer(new DNSCnameRR("example.abc.def.com", 300, "cname.abc.def.com"))
.add_answer(new DNSSrvRR("cname.abc.def.com", 300, 0, 10, 1234, "srv.abc.def.com"))
.add_auth(new DNSNsRR("abc.def.com", 44, "else1.where.com"))
@@ -170,7 +170,7 @@ TEST_F(LibraryTest, ParseSrvReplyCname) {
TEST_F(LibraryTest, ParseSrvReplyCnameMultiple) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_ra().set_rd()
- .add_question(new DNSQuestion("query.example.com", ns_t_srv))
+ .add_question(new DNSQuestion("query.example.com", T_SRV))
.add_answer(new DNSCnameRR("query.example.com", 300, "srv.example.com"))
.add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 6789, "a1.srv.example.com"))
.add_answer(new DNSSrvRR("srv.example.com", 300, 0, 5, 4567, "a2.srv.example.com"))
@@ -217,7 +217,7 @@ TEST_F(LibraryTest, ParseSrvReplyCnameMultiple) {
TEST_F(LibraryTest, ParseSrvReplyErrors) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.abc.def.com", ns_t_srv))
+ .add_question(new DNSQuestion("example.abc.def.com", T_SRV))
.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com"));
std::vector<byte> data;
struct ares_srv_reply* srv = nullptr;
@@ -226,24 +226,24 @@ TEST_F(LibraryTest, ParseSrvReplyErrors) {
pkt.questions_.clear();
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_srv_reply(data.data(), data.size(), &srv));
- pkt.add_question(new DNSQuestion("example.abc.def.com", ns_t_srv));
+ pkt.add_question(new DNSQuestion("example.abc.def.com", T_SRV));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_srv));
+ pkt.add_question(new DNSQuestion("Axample.com", T_SRV));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_srv_reply(data.data(), data.size(), &srv));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_srv));
+ pkt.add_question(new DNSQuestion("example.com", T_SRV));
#endif
// Two questions.
- pkt.add_question(new DNSQuestion("example.abc.def.com", ns_t_srv));
+ pkt.add_question(new DNSQuestion("example.abc.def.com", T_SRV));
data = pkt.data();
EXPECT_EQ(ARES_EBADRESP, ares_parse_srv_reply(data.data(), data.size(), &srv));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", ns_t_ptr));
+ pkt.add_question(new DNSQuestion("64.48.32.16.in-addr.arpa", T_PTR));
// Wrong sort of answer.
pkt.answers_.clear();
@@ -271,7 +271,7 @@ TEST_F(LibraryTest, ParseSrvReplyErrors) {
TEST_F(LibraryTest, ParseSrvReplyAllocFail) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.abc.def.com", ns_t_srv))
+ .add_question(new DNSQuestion("example.abc.def.com", T_SRV))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSSrvRR("example.abc.def.com", 180, 0, 10, 8160, "example.abc.def.com"));
std::vector<byte> data = pkt.data();
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse-txt.cc b/grpc/third_party/cares/cares/test/ares-test-parse-txt.cc
index 8aaaaa3b..b33fb2de 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse-txt.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse-txt.cc
@@ -13,7 +13,7 @@ TEST_F(LibraryTest, ParseTxtReplyOK) {
std::string expected2a = "txt2a";
std::string expected2b("ABC\0ABC", 7);
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSTxtRR("example.com", 100, {expected1}))
.add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b}));
std::vector<byte> data = pkt.data();
@@ -44,7 +44,7 @@ TEST_F(LibraryTest, ParseTxtExtReplyOK) {
std::string expected2a = "txt2a";
std::string expected2b("ABC\0ABC", 7);
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSTxtRR("example.com", 100, {expected1}))
.add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b}));
std::vector<byte> data = pkt.data();
@@ -190,7 +190,7 @@ TEST_F(LibraryTest, ParseTxtReplyErrors) {
std::string expected2a = "txt2a";
std::string expected2b = "txt2b";
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSTxtRR("example.com", 100, {expected1}))
.add_answer(new DNSTxtRR("example.com", 100, {expected1}))
.add_answer(new DNSTxtRR("example.com", 100, {expected2a, expected2b}));
@@ -203,26 +203,26 @@ TEST_F(LibraryTest, ParseTxtReplyErrors) {
txt = nullptr;
EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt));
EXPECT_EQ(nullptr, txt);
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
#ifdef DISABLED
// Question != answer
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("Axample.com", ns_t_txt));
+ pkt.add_question(new DNSQuestion("Axample.com", T_TXT));
data = pkt.data();
EXPECT_EQ(ARES_ENODATA, ares_parse_txt_reply(data.data(), data.size(), &txt));
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_txt));
+ pkt.add_question(new DNSQuestion("example.com", T_TXT));
#endif
// Two questions.
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
data = pkt.data();
txt = nullptr;
EXPECT_EQ(ARES_EBADRESP, ares_parse_txt_reply(data.data(), data.size(), &txt));
EXPECT_EQ(nullptr, txt);
pkt.questions_.clear();
- pkt.add_question(new DNSQuestion("example.com", ns_t_mx));
+ pkt.add_question(new DNSQuestion("example.com", T_MX));
// No answer.
pkt.answers_.clear();
@@ -246,7 +246,7 @@ TEST_F(LibraryTest, ParseTxtReplyAllocFail) {
std::string expected2a = "txt2a";
std::string expected2b = "txt2b";
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com", ns_t_mx))
+ .add_question(new DNSQuestion("example.com", T_MX))
.add_answer(new DNSCnameRR("example.com", 300, "c.example.com"))
.add_answer(new DNSTxtRR("c.example.com", 100, {expected1}))
.add_answer(new DNSTxtRR("c.example.com", 100, {expected1}))
diff --git a/grpc/third_party/cares/cares/test/ares-test-parse.cc b/grpc/third_party/cares/cares/test/ares-test-parse.cc
index 4c54fc99..87ab0bd2 100644
--- a/grpc/third_party/cares/cares/test/ares-test-parse.cc
+++ b/grpc/third_party/cares/cares/test/ares-test-parse.cc
@@ -10,7 +10,7 @@ namespace test {
TEST_F(LibraryTest, ParseRootName) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion(".", ns_t_a))
+ .add_question(new DNSQuestion(".", T_A))
.add_answer(new DNSARR(".", 100, {0x02, 0x03, 0x04, 0x05}));
std::vector<byte> data = pkt.data();
@@ -60,6 +60,8 @@ TEST_F(LibraryTest, ParseIndirectRootName) {
ares_free_hostent(host);
}
+
+#if 0 /* We are validating hostnames now, its not clear how this would ever be valid */
TEST_F(LibraryTest, ParseEscapedName) {
std::vector<byte> data = {
0x12, 0x34, // qid
@@ -105,6 +107,7 @@ TEST_F(LibraryTest, ParseEscapedName) {
EXPECT_EQ('c', hent.name_[6]);
ares_free_hostent(host);
}
+#endif
TEST_F(LibraryTest, ParsePartialCompressedName) {
std::vector<byte> data = {
diff --git a/grpc/third_party/cares/cares/test/ares-test.cc b/grpc/third_party/cares/cares/test/ares-test.cc
index 594320da..0c0e6bc5 100644
--- a/grpc/third_party/cares/cares/test/ares-test.cc
+++ b/grpc/third_party/cares/cares/test/ares-test.cc
@@ -1,8 +1,11 @@
+#include "ares_setup.h"
+#include "ares.h"
+#include "ares_nameser.h"
#include "ares-test.h"
+#include "ares-test-ai.h"
#include "dns-proto.h"
// Include ares internal files for DNS protocol details
-#include "nameser.h"
#include "ares_dns.h"
#ifdef HAVE_NETDB_H
@@ -29,7 +32,8 @@ namespace ares {
namespace test {
bool verbose = false;
-int mock_port = 5300;
+static constexpr int dynamic_port = 0;
+int mock_port = dynamic_port;
const std::vector<int> both_families = {AF_INET, AF_INET6};
const std::vector<int> ipv4_family = {AF_INET};
@@ -133,7 +137,7 @@ bool LibraryTest::ShouldAllocFail(size_t size) {
// static
void* LibraryTest::amalloc(size_t size) {
- if (ShouldAllocFail(size)) {
+ if (ShouldAllocFail(size) || size == 0) {
if (verbose) std::cerr << "Failing malloc(" << size << ") request" << std::endl;
return nullptr;
} else {
@@ -168,8 +172,8 @@ void DefaultChannelModeTest::Process() {
ProcessWork(channel_, NoExtraFDs, nullptr);
}
-MockServer::MockServer(int family, int port, int tcpport)
- : udpport_(port), tcpport_(tcpport ? tcpport : udpport_), qid_(-1) {
+MockServer::MockServer(int family, int port)
+ : udpport_(port), tcpport_(port), qid_(-1) {
// Create a TCP socket to receive data on.
tcpfd_ = socket(family, SOCK_STREAM, 0);
EXPECT_NE(-1, tcpfd_);
@@ -196,6 +200,21 @@ MockServer::MockServer(int family, int port, int tcpport)
addr.sin_port = htons(udpport_);
int udprc = bind(udpfd_, (struct sockaddr*)&addr, sizeof(addr));
EXPECT_EQ(0, udprc) << "Failed to bind AF_INET to UDP port " << udpport_;
+ // retrieve system-assigned port
+ if (udpport_ == dynamic_port) {
+ ares_socklen_t len = sizeof(addr);
+ auto result = getsockname(udpfd_, (struct sockaddr*)&addr, &len);
+ EXPECT_EQ(0, result);
+ udpport_ = ntohs(addr.sin_port);
+ EXPECT_NE(dynamic_port, udpport_);
+ }
+ if (tcpport_ == dynamic_port) {
+ ares_socklen_t len = sizeof(addr);
+ auto result = getsockname(tcpfd_, (struct sockaddr*)&addr, &len);
+ EXPECT_EQ(0, result);
+ tcpport_ = ntohs(addr.sin_port);
+ EXPECT_NE(dynamic_port, tcpport_);
+ }
} else {
EXPECT_EQ(AF_INET6, family);
struct sockaddr_in6 addr;
@@ -208,6 +227,21 @@ MockServer::MockServer(int family, int port, int tcpport)
addr.sin6_port = htons(udpport_);
int udprc = bind(udpfd_, (struct sockaddr*)&addr, sizeof(addr));
EXPECT_EQ(0, udprc) << "Failed to bind AF_INET6 to UDP port " << udpport_;
+ // retrieve system-assigned port
+ if (udpport_ == dynamic_port) {
+ ares_socklen_t len = sizeof(addr);
+ auto result = getsockname(udpfd_, (struct sockaddr*)&addr, &len);
+ EXPECT_EQ(0, result);
+ udpport_ = ntohs(addr.sin6_port);
+ EXPECT_NE(dynamic_port, udpport_);
+ }
+ if (tcpport_ == dynamic_port) {
+ ares_socklen_t len = sizeof(addr);
+ auto result = getsockname(tcpfd_, (struct sockaddr*)&addr, &len);
+ EXPECT_EQ(0, result);
+ tcpport_ = ntohs(addr.sin6_port);
+ EXPECT_NE(dynamic_port, tcpport_);
+ }
}
if (verbose) std::cerr << "Configured "
<< (family == AF_INET ? "IPv4" : "IPv6")
@@ -280,7 +314,7 @@ void MockServer::ProcessFD(int fd) {
std::cerr << "Not a request" << std::endl;
return;
}
- if (DNS_HEADER_OPCODE(data) != ns_o_query) {
+ if (DNS_HEADER_OPCODE(data) != O_QUERY) {
std::cerr << "Not a query (opcode " << DNS_HEADER_OPCODE(data)
<< ")" << std::endl;
return;
@@ -310,7 +344,7 @@ void MockServer::ProcessFD(int fd) {
<< " bytes after name)" << std::endl;
return;
}
- if (DNS_QUESTION_CLASS(question) != ns_c_in) {
+ if (DNS_QUESTION_CLASS(question) != C_IN) {
std::cerr << "Unexpected question class (" << DNS_QUESTION_CLASS(question)
<< ")" << std::endl;
return;
@@ -380,7 +414,8 @@ MockChannelOptsTest::NiceMockServers MockChannelOptsTest::BuildServers(int count
NiceMockServers servers;
assert(count > 0);
for (int ii = 0; ii < count; ii++) {
- std::unique_ptr<NiceMockServer> server(new NiceMockServer(family, base_port + ii));
+ int port = base_port == dynamic_port ? dynamic_port : base_port + ii;
+ std::unique_ptr<NiceMockServer> server(new NiceMockServer(family, port));
servers.push_back(std::move(server));
}
return servers;
@@ -402,9 +437,9 @@ MockChannelOptsTest::MockChannelOptsTest(int count,
}
// Point the library at the first mock server by default (overridden below).
- opts.udp_port = mock_port;
+ opts.udp_port = server_.udpport();
optmask |= ARES_OPT_UDP_PORT;
- opts.tcp_port = mock_port;
+ opts.tcp_port = server_.tcpport();
optmask |= ARES_OPT_TCP_PORT;
// If not already overridden, set short-ish timeouts.
@@ -564,6 +599,79 @@ void HostCallback(void *data, int status, int timeouts,
if (verbose) std::cerr << "HostCallback(" << *result << ")" << std::endl;
}
+std::ostream& operator<<(std::ostream& os, const AddrInfoResult& result) {
+ os << '{';
+ if (result.done_ && result.ai_) {
+ os << StatusToString(result.status_) << " " << result.ai_;
+ } else {
+ os << "(incomplete)";
+ }
+ os << '}';
+ return os;
+}
+
+std::ostream& operator<<(std::ostream& os, const AddrInfo& ai) {
+ os << '{';
+ if (ai == nullptr) {
+ os << "nullptr}";
+ return os;
+ }
+
+ struct ares_addrinfo_cname *next_cname = ai->cnames;
+ while(next_cname) {
+ if(next_cname->alias) {
+ os << next_cname->alias << "->";
+ }
+ if(next_cname->name) {
+ os << next_cname->name;
+ }
+ if((next_cname = next_cname->next))
+ os << ", ";
+ else
+ os << " ";
+ }
+
+ struct ares_addrinfo_node *next = ai->nodes;
+ while(next) {
+ //if(next->ai_canonname) {
+ //os << "'" << next->ai_canonname << "' ";
+ //}
+ unsigned short port = 0;
+ os << "addr=[";
+ if(next->ai_family == AF_INET) {
+ sockaddr_in* sin = (sockaddr_in*)next->ai_addr;
+ port = ntohs(sin->sin_port);
+ os << AddressToString(&sin->sin_addr, 4);
+ }
+ else if (next->ai_family == AF_INET6) {
+ sockaddr_in6* sin = (sockaddr_in6*)next->ai_addr;
+ port = ntohs(sin->sin6_port);
+ os << "[" << AddressToString(&sin->sin6_addr, 16) << "]";
+ }
+ else
+ os << "unknown family";
+ if(port) {
+ os << ":" << port;
+ }
+ os << "]";
+ if((next = next->ai_next))
+ os << ", ";
+ }
+ os << '}';
+ return os;
+}
+
+void AddrInfoCallback(void *data, int status, int timeouts,
+ struct ares_addrinfo *ai) {
+ EXPECT_NE(nullptr, data);
+ AddrInfoResult* result = reinterpret_cast<AddrInfoResult*>(data);
+ result->done_ = true;
+ result->status_ = status;
+ result->timeouts_= timeouts;
+ result->ai_ = AddrInfo(ai);
+ if (verbose) std::cerr << "AddrInfoCallback(" << *result << ")" << std::endl;
+}
+
std::ostream& operator<<(std::ostream& os, const SearchResult& result) {
os << '{';
if (result.done_) {
diff --git a/grpc/third_party/cares/cares/test/ares-test.h b/grpc/third_party/cares/cares/test/ares-test.h
index abcc508d..63dcc022 100644
--- a/grpc/third_party/cares/cares/test/ares-test.h
+++ b/grpc/third_party/cares/cares/test/ares-test.h
@@ -2,13 +2,13 @@
#ifndef ARES_TEST_H
#define ARES_TEST_H
-#include "dns-proto.h"
-// Include ares internal file for DNS protocol constants
-#include "nameser.h"
-
#include "ares_setup.h"
#include "ares.h"
+#include "dns-proto.h"
+// Include ares internal file for DNS protocol constants
+#include "ares_nameser.h"
+
#include "gtest/gtest.h"
#include "gmock/gmock.h"
@@ -136,7 +136,7 @@ class DefaultChannelModeTest
// Mock DNS server to allow responses to be scripted by tests.
class MockServer {
public:
- MockServer(int family, int port, int tcpport = 0);
+ MockServer(int family, int port);
~MockServer();
// Mock method indicating the processing of a particular <name, RRtype>
@@ -279,6 +279,30 @@ struct NameInfoResult {
};
std::ostream& operator<<(std::ostream& os, const NameInfoResult& result);
+struct AddrInfoDeleter {
+ void operator() (ares_addrinfo *ptr) {
+ if (ptr) ares_freeaddrinfo(ptr);
+ }
+};
+
+// C++ wrapper for struct ares_addrinfo.
+using AddrInfo = std::unique_ptr<ares_addrinfo, AddrInfoDeleter>;
+
+std::ostream& operator<<(std::ostream& os, const AddrInfo& result);
+
+// Structure that describes the result of an ares_addrinfo_callback invocation.
+struct AddrInfoResult {
+ AddrInfoResult() : done_(false), status_(-1), timeouts_(0) {}
+ // Whether the callback has been invoked.
+ bool done_;
+ // Explicitly provided result information.
+ int status_;
+ int timeouts_;
+ // Contents of the ares_addrinfo structure, if provided.
+ AddrInfo ai_;
+};
+std::ostream& operator<<(std::ostream& os, const AddrInfoResult& result);
+
// Standard implementation of ares callbacks that fill out the corresponding
// structures.
void HostCallback(void *data, int status, int timeouts,
@@ -287,6 +311,8 @@ void SearchCallback(void *data, int status, int timeouts,
unsigned char *abuf, int alen);
void NameInfoCallback(void *data, int status, int timeouts,
char *node, char *service);
+void AddrInfoCallback(void *data, int status, int timeouts,
+ struct ares_addrinfo *res);
// Retrieve the name servers used by a channel.
std::vector<std::string> GetNameServers(ares_channel channel);
@@ -322,7 +348,40 @@ class TempFile : public TransientFile {
const char* filename() const { return filename_.c_str(); }
};
-#ifndef WIN32
+#ifdef _WIN32
+extern "C" {
+
+static int setenv(const char *name, const char *value, int overwrite)
+{
+ char *buffer;
+ size_t buf_size;
+
+ if (name == NULL)
+ return -1;
+
+ if (value == NULL)
+ value = ""; /* For unset */
+
+ if (!overwrite && getenv(name) != NULL) {
+ return -1;
+ }
+
+ buf_size = strlen(name) + strlen(value) + 1 /* = */ + 1 /* NULL */;
+ buffer = (char *)malloc(buf_size);
+ _snprintf(buffer, buf_size, "%s=%s", name, value);
+ _putenv(buffer);
+ free(buffer);
+ return 0;
+}
+
+static int unsetenv(const char *name)
+{
+ return setenv(name, NULL, 1);
+}
+
+} /* extern "C" */
+#endif
+
// RAII class for a temporary environment variable value.
class EnvValue {
public:
@@ -346,7 +405,6 @@ class EnvValue {
bool restore_;
std::string original_;
};
-#endif
#ifdef HAVE_CONTAINER
@@ -428,7 +486,6 @@ private:
} \
void VCLASS_NAME(casename, testname)::InnerTestBody()
-
} // namespace test
} // namespace ares
diff --git a/grpc/third_party/cares/cares/test/dns-proto-test.cc b/grpc/third_party/cares/cares/test/dns-proto-test.cc
index 0c36a0c9..3dadeeee 100644
--- a/grpc/third_party/cares/cares/test/dns-proto-test.cc
+++ b/grpc/third_party/cares/cares/test/dns-proto-test.cc
@@ -9,8 +9,8 @@ namespace test {
TEST(DNSProto, EncodeQuestions) {
DNSPacket pkt;
pkt.set_qid(0x1234).set_response().set_aa()
- .add_question(new DNSQuestion("example.com.", ns_t_a))
- .add_question(new DNSQuestion("www.example.com", ns_t_aaaa, ns_c_chaos));
+ .add_question(new DNSQuestion("example.com.", T_A))
+ .add_question(new DNSQuestion("www.example.com", T_AAAA, C_CHAOS));
std::vector<byte> data = {
0x12, 0x34, // qid
@@ -42,7 +42,7 @@ TEST(DNSProto, EncodeSingleNameAnswers) {
pkt.qid_ = 0x1234;
pkt.response_ = true;
pkt.aa_ = true;
- pkt.opcode_ = ns_o_query;
+ pkt.opcode_ = O_QUERY;
pkt.add_answer(new DNSCnameRR("example.com", 0x01020304, "other.com."));
pkt.add_auth(new DNSPtrRR("www.example.com", 0x01020304, "www.other.com"));
@@ -87,7 +87,7 @@ TEST(DNSProto, EncodeAddressAnswers) {
pkt.qid_ = 0x1234;
pkt.response_ = true;
pkt.aa_ = true;
- pkt.opcode_ = ns_o_query;
+ pkt.opcode_ = O_QUERY;
std::vector<byte> addrv4 = {0x02, 0x03, 0x04, 0x05};
pkt.add_answer(new DNSARR("example.com", 0x01020304, addrv4));
byte addrv6[16] = {0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02,
diff --git a/grpc/third_party/cares/cares/test/dns-proto.cc b/grpc/third_party/cares/cares/test/dns-proto.cc
index d2fa8b15..63cf3743 100644
--- a/grpc/third_party/cares/cares/test/dns-proto.cc
+++ b/grpc/third_party/cares/cares/test/dns-proto.cc
@@ -1,9 +1,9 @@
-#include "dns-proto.h"
// Include ares internal file for DNS protocol details
#include "ares_setup.h"
#include "ares.h"
#include "ares_dns.h"
+#include "dns-proto.h"
#include <stdio.h>
#include <stdlib.h>
@@ -63,93 +63,93 @@ std::string StatusToString(int status) {
std::string RcodeToString(int rcode) {
switch (rcode) {
- case ns_r_noerror: return "NOERROR";
- case ns_r_formerr: return "FORMERR";
- case ns_r_servfail: return "SERVFAIL";
- case ns_r_nxdomain: return "NXDOMAIN";
- case ns_r_notimpl: return "NOTIMPL";
- case ns_r_refused: return "REFUSED";
- case ns_r_yxdomain: return "YXDOMAIN";
- case ns_r_yxrrset: return "YXRRSET";
- case ns_r_nxrrset: return "NXRRSET";
- case ns_r_notauth: return "NOTAUTH";
- case ns_r_notzone: return "NOTZONE";
- case ns_r_badsig: return "BADSIG";
- case ns_r_badkey: return "BADKEY";
- case ns_r_badtime: return "BADTIME";
+ case NOERROR: return "NOERROR";
+ case FORMERR: return "FORMERR";
+ case SERVFAIL: return "SERVFAIL";
+ case NXDOMAIN: return "NXDOMAIN";
+ case NOTIMP: return "NOTIMP";
+ case REFUSED: return "REFUSED";
+ case YXDOMAIN: return "YXDOMAIN";
+ case YXRRSET: return "YXRRSET";
+ case NXRRSET: return "NXRRSET";
+ case NOTAUTH: return "NOTAUTH";
+ case NOTZONE: return "NOTZONE";
+ case TSIG_BADSIG: return "BADSIG";
+ case TSIG_BADKEY: return "BADKEY";
+ case TSIG_BADTIME: return "BADTIME";
default: return "UNKNOWN";
}
}
std::string RRTypeToString(int rrtype) {
switch (rrtype) {
- case ns_t_a: return "A";
- case ns_t_ns: return "NS";
- case ns_t_md: return "MD";
- case ns_t_mf: return "MF";
- case ns_t_cname: return "CNAME";
- case ns_t_soa: return "SOA";
- case ns_t_mb: return "MB";
- case ns_t_mg: return "MG";
- case ns_t_mr: return "MR";
- case ns_t_null: return "NULL";
- case ns_t_wks: return "WKS";
- case ns_t_ptr: return "PTR";
- case ns_t_hinfo: return "HINFO";
- case ns_t_minfo: return "MINFO";
- case ns_t_mx: return "MX";
- case ns_t_txt: return "TXT";
- case ns_t_rp: return "RP";
- case ns_t_afsdb: return "AFSDB";
- case ns_t_x25: return "X25";
- case ns_t_isdn: return "ISDN";
- case ns_t_rt: return "RT";
- case ns_t_nsap: return "NSAP";
- case ns_t_nsap_ptr: return "NSAP_PTR";
- case ns_t_sig: return "SIG";
- case ns_t_key: return "KEY";
- case ns_t_px: return "PX";
- case ns_t_gpos: return "GPOS";
- case ns_t_aaaa: return "AAAA";
- case ns_t_loc: return "LOC";
- case ns_t_nxt: return "NXT";
- case ns_t_eid: return "EID";
- case ns_t_nimloc: return "NIMLOC";
- case ns_t_srv: return "SRV";
- case ns_t_atma: return "ATMA";
- case ns_t_naptr: return "NAPTR";
- case ns_t_kx: return "KX";
- case ns_t_cert: return "CERT";
- case ns_t_a6: return "A6";
- case ns_t_dname: return "DNAME";
- case ns_t_sink: return "SINK";
- case ns_t_opt: return "OPT";
- case ns_t_apl: return "APL";
- case ns_t_ds: return "DS";
- case ns_t_sshfp: return "SSHFP";
- case ns_t_rrsig: return "RRSIG";
- case ns_t_nsec: return "NSEC";
- case ns_t_dnskey: return "DNSKEY";
- case ns_t_tkey: return "TKEY";
- case ns_t_tsig: return "TSIG";
- case ns_t_ixfr: return "IXFR";
- case ns_t_axfr: return "AXFR";
- case ns_t_mailb: return "MAILB";
- case ns_t_maila: return "MAILA";
- case ns_t_any: return "ANY";
- case ns_t_zxfr: return "ZXFR";
- case ns_t_max: return "MAX";
+ case T_A: return "A";
+ case T_NS: return "NS";
+ case T_MD: return "MD";
+ case T_MF: return "MF";
+ case T_CNAME: return "CNAME";
+ case T_SOA: return "SOA";
+ case T_MB: return "MB";
+ case T_MG: return "MG";
+ case T_MR: return "MR";
+ case T_NULL: return "NULL";
+ case T_WKS: return "WKS";
+ case T_PTR: return "PTR";
+ case T_HINFO: return "HINFO";
+ case T_MINFO: return "MINFO";
+ case T_MX: return "MX";
+ case T_TXT: return "TXT";
+ case T_RP: return "RP";
+ case T_AFSDB: return "AFSDB";
+ case T_X25: return "X25";
+ case T_ISDN: return "ISDN";
+ case T_RT: return "RT";
+ case T_NSAP: return "NSAP";
+ case T_NSAP_PTR: return "NSAP_PTR";
+ case T_SIG: return "SIG";
+ case T_KEY: return "KEY";
+ case T_PX: return "PX";
+ case T_GPOS: return "GPOS";
+ case T_AAAA: return "AAAA";
+ case T_LOC: return "LOC";
+ case T_NXT: return "NXT";
+ case T_EID: return "EID";
+ case T_NIMLOC: return "NIMLOC";
+ case T_SRV: return "SRV";
+ case T_ATMA: return "ATMA";
+ case T_NAPTR: return "NAPTR";
+ case T_KX: return "KX";
+ case T_CERT: return "CERT";
+ case T_A6: return "A6";
+ case T_DNAME: return "DNAME";
+ case T_SINK: return "SINK";
+ case T_OPT: return "OPT";
+ case T_APL: return "APL";
+ case T_DS: return "DS";
+ case T_SSHFP: return "SSHFP";
+ case T_RRSIG: return "RRSIG";
+ case T_NSEC: return "NSEC";
+ case T_DNSKEY: return "DNSKEY";
+ case T_TKEY: return "TKEY";
+ case T_TSIG: return "TSIG";
+ case T_IXFR: return "IXFR";
+ case T_AXFR: return "AXFR";
+ case T_MAILB: return "MAILB";
+ case T_MAILA: return "MAILA";
+ case T_ANY: return "ANY";
+ case T_ZXFR: return "ZXFR";
+ case T_MAX: return "MAX";
default: return "UNKNOWN";
}
}
std::string ClassToString(int qclass) {
switch (qclass) {
- case ns_c_in: return "IN";
- case ns_c_chaos: return "CHAOS";
- case ns_c_hs: return "HESIOD";
- case ns_c_none: return "NONE";
- case ns_c_any: return "ANY";
+ case C_IN: return "IN";
+ case C_CHAOS: return "CHAOS";
+ case C_HS: return "HESIOD";
+ case C_NONE: return "NONE";
+ case C_ANY: return "ANY";
default: return "UNKNOWN";
}
}
@@ -188,11 +188,11 @@ std::string PacketToString(const std::vector<byte>& packet) {
}
ss << ((DNS_HEADER_QR(data) == 0) ? "REQ " : "RSP ");
switch (DNS_HEADER_OPCODE(data)) {
- case ns_o_query: ss << "QRY "; break;
- case ns_o_iquery: ss << "IQRY "; break;
- case ns_o_status: ss << "STATUS "; break;
- case ns_o_notify: ss << "NOTIFY "; break;
- case ns_o_update: ss << "UPDATE "; break;
+ case O_QUERY: ss << "QRY "; break;
+ case O_IQUERY: ss << "IQRY "; break;
+ case O_STATUS: ss << "STATUS "; break;
+ case O_NOTIFY: ss << "NOTIFY "; break;
+ case O_UPDATE: ss << "UPDATE "; break;
default: ss << "UNKNOWN(" << DNS_HEADER_OPCODE(data) << ") "; break;
}
if (DNS_HEADER_AA(data)) ss << "AA ";
@@ -292,7 +292,7 @@ std::string RRToString(const std::vector<byte>& packet,
return ss.str();
}
int rrtype = DNS_RR_TYPE(*data);
- if (rrtype == ns_t_opt) {
+ if (rrtype == T_OPT) {
ss << "MAXUDP=" << DNS_RR_CLASS(*data) << " ";
ss << RRTypeToString(rrtype) << " ";
ss << "RCODE2=" << DNS_RR_TTL(*data);
@@ -309,11 +309,11 @@ std::string RRToString(const std::vector<byte>& packet,
ss << "(RR too long at " << rdatalen << ", len left " << *len << ")";
} else {
switch (rrtype) {
- case ns_t_a:
- case ns_t_aaaa:
+ case T_A:
+ case T_AAAA:
ss << " " << AddressToString(*data, rdatalen);
break;
- case ns_t_txt: {
+ case T_TXT: {
const byte* p = *data;
while (p < (*data + rdatalen)) {
int len = *p++;
@@ -327,9 +327,9 @@ std::string RRToString(const std::vector<byte>& packet,
}
break;
}
- case ns_t_cname:
- case ns_t_ns:
- case ns_t_ptr: {
+ case T_CNAME:
+ case T_NS:
+ case T_PTR: {
int rc = ares_expand_name(*data, packet.data(), packet.size(), &name, &enclen);
if (rc != ARES_SUCCESS) {
ss << "(error from ares_expand_name)";
@@ -339,7 +339,7 @@ std::string RRToString(const std::vector<byte>& packet,
ares_free_string(name);
break;
}
- case ns_t_mx:
+ case T_MX:
if (rdatalen > 2) {
int rc = ares_expand_name(*data + 2, packet.data(), packet.size(), &name, &enclen);
if (rc != ARES_SUCCESS) {
@@ -352,7 +352,7 @@ std::string RRToString(const std::vector<byte>& packet,
ss << "(RR too short)";
}
break;
- case ns_t_srv: {
+ case T_SRV: {
if (rdatalen > 6) {
const byte* p = *data;
unsigned long prio = DNS__16BIT(p);
@@ -371,7 +371,7 @@ std::string RRToString(const std::vector<byte>& packet,
}
break;
}
- case ns_t_soa: {
+ case T_SOA: {
const byte* p = *data;
int rc = ares_expand_name(p, packet.data(), packet.size(), &name, &enclen);
if (rc != ARES_SUCCESS) {
@@ -401,7 +401,7 @@ std::string RRToString(const std::vector<byte>& packet,
}
break;
}
- case ns_t_naptr: {
+ case T_NAPTR: {
if (rdatalen > 7) {
const byte* p = *data;
unsigned long order = DNS__16BIT(p);
diff --git a/grpc/third_party/cares/cares/test/dns-proto.h b/grpc/third_party/cares/cares/test/dns-proto.h
index 346711df..854c99a9 100644
--- a/grpc/third_party/cares/cares/test/dns-proto.h
+++ b/grpc/third_party/cares/cares/test/dns-proto.h
@@ -3,8 +3,10 @@
#define DNS_PROTO_H
// Utilities for processing DNS packet contents
+#include "ares_setup.h"
+#include "ares.h"
// Include ares internal file for DNS protocol constants
-#include "nameser.h"
+#include "ares_nameser.h"
#include <memory>
#include <string>
@@ -41,21 +43,21 @@ void PushInt16(std::vector<byte>* data, int value);
std::vector<byte> EncodeString(const std::string& name);
struct DNSQuestion {
- DNSQuestion(const std::string& name, ns_type rrtype, ns_class qclass)
+ DNSQuestion(const std::string& name, int rrtype, int qclass)
: name_(name), rrtype_(rrtype), qclass_(qclass) {}
- DNSQuestion(const std::string& name, ns_type rrtype)
- : name_(name), rrtype_(rrtype), qclass_(ns_c_in) {}
+ DNSQuestion(const std::string& name, int rrtype)
+ : name_(name), rrtype_(rrtype), qclass_(C_IN) {}
virtual ~DNSQuestion() {}
virtual std::vector<byte> data() const;
std::string name_;
- ns_type rrtype_;
- ns_class qclass_;
+ int rrtype_;
+ int qclass_;
};
struct DNSRR : public DNSQuestion {
- DNSRR(const std::string& name, ns_type rrtype, ns_class qclass, int ttl)
+ DNSRR(const std::string& name, int rrtype, int qclass, int ttl)
: DNSQuestion(name, rrtype, qclass), ttl_(ttl) {}
- DNSRR(const std::string& name, ns_type rrtype, int ttl)
+ DNSRR(const std::string& name, int rrtype, int ttl)
: DNSQuestion(name, rrtype), ttl_(ttl) {}
virtual ~DNSRR() {}
virtual std::vector<byte> data() const = 0;
@@ -63,10 +65,10 @@ struct DNSRR : public DNSQuestion {
};
struct DNSAddressRR : public DNSRR {
- DNSAddressRR(const std::string& name, ns_type rrtype, int ttl,
+ DNSAddressRR(const std::string& name, int rrtype, int ttl,
const byte* addr, int addrlen)
: DNSRR(name, rrtype, ttl), addr_(addr, addr + addrlen) {}
- DNSAddressRR(const std::string& name, ns_type rrtype, int ttl,
+ DNSAddressRR(const std::string& name, int rrtype, int ttl,
const std::vector<byte>& addr)
: DNSRR(name, rrtype, ttl), addr_(addr) {}
virtual std::vector<byte> data() const;
@@ -75,20 +77,20 @@ struct DNSAddressRR : public DNSRR {
struct DNSARR : public DNSAddressRR {
DNSARR(const std::string& name, int ttl, const byte* addr, int addrlen)
- : DNSAddressRR(name, ns_t_a, ttl, addr, addrlen) {}
+ : DNSAddressRR(name, T_A, ttl, addr, addrlen) {}
DNSARR(const std::string& name, int ttl, const std::vector<byte>& addr)
- : DNSAddressRR(name, ns_t_a, ttl, addr) {}
+ : DNSAddressRR(name, T_A, ttl, addr) {}
};
struct DNSAaaaRR : public DNSAddressRR {
DNSAaaaRR(const std::string& name, int ttl, const byte* addr, int addrlen)
- : DNSAddressRR(name, ns_t_aaaa, ttl, addr, addrlen) {}
+ : DNSAddressRR(name, T_AAAA, ttl, addr, addrlen) {}
DNSAaaaRR(const std::string& name, int ttl, const std::vector<byte>& addr)
- : DNSAddressRR(name, ns_t_aaaa, ttl, addr) {}
+ : DNSAddressRR(name, T_AAAA, ttl, addr) {}
};
struct DNSSingleNameRR : public DNSRR {
- DNSSingleNameRR(const std::string& name, ns_type rrtype, int ttl,
+ DNSSingleNameRR(const std::string& name, int rrtype, int ttl,
const std::string& other)
: DNSRR(name, rrtype, ttl), other_(other) {}
virtual std::vector<byte> data() const;
@@ -97,29 +99,29 @@ struct DNSSingleNameRR : public DNSRR {
struct DNSCnameRR : public DNSSingleNameRR {
DNSCnameRR(const std::string& name, int ttl, const std::string& other)
- : DNSSingleNameRR(name, ns_t_cname, ttl, other) {}
+ : DNSSingleNameRR(name, T_CNAME, ttl, other) {}
};
struct DNSNsRR : public DNSSingleNameRR {
DNSNsRR(const std::string& name, int ttl, const std::string& other)
- : DNSSingleNameRR(name, ns_t_ns, ttl, other) {}
+ : DNSSingleNameRR(name, T_NS, ttl, other) {}
};
struct DNSPtrRR : public DNSSingleNameRR {
DNSPtrRR(const std::string& name, int ttl, const std::string& other)
- : DNSSingleNameRR(name, ns_t_ptr, ttl, other) {}
+ : DNSSingleNameRR(name, T_PTR, ttl, other) {}
};
struct DNSTxtRR : public DNSRR {
DNSTxtRR(const std::string& name, int ttl, const std::vector<std::string>& txt)
- : DNSRR(name, ns_t_txt, ttl), txt_(txt) {}
+ : DNSRR(name, T_TXT, ttl), txt_(txt) {}
virtual std::vector<byte> data() const;
std::vector<std::string> txt_;
};
struct DNSMxRR : public DNSRR {
DNSMxRR(const std::string& name, int ttl, int pref, const std::string& other)
- : DNSRR(name, ns_t_mx, ttl), pref_(pref), other_(other) {}
+ : DNSRR(name, T_MX, ttl), pref_(pref), other_(other) {}
virtual std::vector<byte> data() const;
int pref_;
std::string other_;
@@ -128,7 +130,7 @@ struct DNSMxRR : public DNSRR {
struct DNSSrvRR : public DNSRR {
DNSSrvRR(const std::string& name, int ttl,
int prio, int weight, int port, const std::string& target)
- : DNSRR(name, ns_t_srv, ttl), prio_(prio), weight_(weight), port_(port), target_(target) {}
+ : DNSRR(name, T_SRV, ttl), prio_(prio), weight_(weight), port_(port), target_(target) {}
virtual std::vector<byte> data() const;
int prio_;
int weight_;
@@ -140,7 +142,7 @@ struct DNSSoaRR : public DNSRR {
DNSSoaRR(const std::string& name, int ttl,
const std::string& nsname, const std::string& rname,
int serial, int refresh, int retry, int expire, int minimum)
- : DNSRR(name, ns_t_soa, ttl), nsname_(nsname), rname_(rname),
+ : DNSRR(name, T_SOA, ttl), nsname_(nsname), rname_(rname),
serial_(serial), refresh_(refresh), retry_(retry),
expire_(expire), minimum_(minimum) {}
virtual std::vector<byte> data() const;
@@ -160,7 +162,7 @@ struct DNSNaptrRR : public DNSRR {
const std::string& service,
const std::string& regexp,
const std::string& replacement)
- : DNSRR(name, ns_t_naptr, ttl), order_(order), pref_(pref),
+ : DNSRR(name, T_NAPTR, ttl), order_(order), pref_(pref),
flags_(flags), service_(service), regexp_(regexp), replacement_(replacement) {}
virtual std::vector<byte> data() const;
int order_;
@@ -178,16 +180,16 @@ struct DNSOption {
struct DNSOptRR : public DNSRR {
DNSOptRR(int extrcode, int udpsize)
- : DNSRR("", ns_t_opt, static_cast<ns_class>(udpsize), extrcode) {}
+ : DNSRR("", T_OPT, static_cast<int>(udpsize), extrcode) {}
virtual std::vector<byte> data() const;
std::vector<DNSOption> opts_;
};
struct DNSPacket {
DNSPacket()
- : qid_(0), response_(false), opcode_(ns_o_query),
+ : qid_(0), response_(false), opcode_(O_QUERY),
aa_(false), tc_(false), rd_(false), ra_(false),
- z_(false), ad_(false), cd_(false), rcode_(ns_r_noerror) {}
+ z_(false), ad_(false), cd_(false), rcode_(NOERROR) {}
// Convenience functions that take ownership of given pointers.
DNSPacket& add_question(DNSQuestion *q) {
questions_.push_back(std::unique_ptr<DNSQuestion>(q));
@@ -215,14 +217,14 @@ struct DNSPacket {
DNSPacket& set_z(bool v = true) { z_ = v; return *this; }
DNSPacket& set_ad(bool v = true) { ad_ = v; return *this; }
DNSPacket& set_cd(bool v = true) { cd_ = v; return *this; }
- DNSPacket& set_rcode(ns_rcode rcode) { rcode_ = rcode; return *this; }
+ DNSPacket& set_rcode(int rcode) { rcode_ = rcode; return *this; }
// Return the encoded packet.
std::vector<byte> data() const;
int qid_;
bool response_;
- ns_opcode opcode_;
+ int opcode_;
bool aa_;
bool tc_;
bool rd_;
@@ -230,7 +232,7 @@ struct DNSPacket {
bool z_;
bool ad_;
bool cd_;
- ns_rcode rcode_;
+ int rcode_;
std::vector<std::unique_ptr<DNSQuestion>> questions_;
std::vector<std::unique_ptr<DNSRR>> answers_;
std::vector<std::unique_ptr<DNSRR>> auths_;
diff --git a/grpc/third_party/cares/cares/test/fuzzcheck.sh b/grpc/third_party/cares/cares/test/fuzzcheck.sh
index 4c50ff21..3a137661 100755
--- a/grpc/third_party/cares/cares/test/fuzzcheck.sh
+++ b/grpc/third_party/cares/cares/test/fuzzcheck.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
# Check that all of the base fuzzing corpus parse without errors
./aresfuzz fuzzinput/*
./aresfuzzname fuzznames/*
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5637790584012800 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5637790584012800
new file mode 100644
index 00000000..745108b6
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5637790584012800
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5650695891451904 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5650695891451904
new file mode 100644
index 00000000..1aba3b32
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5650695891451904
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5651369832218624 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5651369832218624
new file mode 100644
index 00000000..7e5184cf
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5651369832218624
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5674462260756480 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5674462260756480
new file mode 100644
index 00000000..c7b7c65d
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5674462260756480
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5680630672654336 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5680630672654336
new file mode 100644
index 00000000..7b5f9cbf
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5680630672654336
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5683497160671232 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5683497160671232
new file mode 100644
index 00000000..8d70a178
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5683497160671232
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5687310655422464 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5687310655422464
new file mode 100644
index 00000000..cdb78175
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5687310655422464
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5695341573177344 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5695341573177344
new file mode 100644
index 00000000..b96ddd47
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5695341573177344
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5697835103682560 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5697835103682560
new file mode 100644
index 00000000..f5ef00f6
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5697835103682560
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5728518081609728 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5728518081609728
new file mode 100644
index 00000000..31f69570
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5728518081609728
Binary files differ
diff --git a/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5732960017317888 b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5732960017317888
new file mode 100644
index 00000000..5596018c
--- /dev/null
+++ b/grpc/third_party/cares/cares/test/fuzzinput/clusterfuzz-5732960017317888
Binary files differ
diff --git a/grpc/third_party/cares/cares/travis/build.sh b/grpc/third_party/cares/cares/travis/build.sh
index b0e20b62..6dfe5473 100755
--- a/grpc/third_party/cares/cares/travis/build.sh
+++ b/grpc/third_party/cares/cares/travis/build.sh
@@ -1,11 +1,28 @@
#!/bin/sh
set -e
-if [ "$BUILD_TYPE" != "cmake" ]; then
+if [ "$BUILD_TYPE" != "cmake" -a "$BUILD_TYPE" != "valgrind" -a "$BUILD_TYPE" != "ios-cmake" ]; then
./buildconf
- $SCAN_WRAP ./configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug $CONFIG_OPTS
+ mkdir atoolsbld
+ cd atoolsbld
+ $SCAN_WRAP ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug $CONFIG_OPTS
$SCAN_WRAP make
+elif [ "$BUILD_TYPE" = "ios-cmake" ] ; then
+ mkdir cmakebld
+ cd cmakebld
+ cmake \
+ -DCMAKE_BUILD_TYPE=DEBUG \
+ -DCARES_STATIC=ON \
+ -DCARES_STATIC_PIC=ON \
+ -DCARES_BUILD_TESTS=OFF \
+ -DCMAKE_C_FLAGS=$CFLAGS \
+ -DCMAKE_CXX_FLAGS=$CXXFLAGS \
+ -DCMAKE_OSX_SYSROOT=$SYSROOT \
+ -DCMAKE_OSX_ARCHITECTURES=$ARCHITECTURES \
+ ..
+ make
else
+ # Use cmake for valgrind to prevent libtool script wrapping of tests that interfere with valgrind
mkdir cmakebld
cd cmakebld
cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON ..
diff --git a/grpc/third_party/cares/cares/travis/covupload.sh b/grpc/third_party/cares/cares/travis/covupload.sh
index 99486d95..9e518d59 100755
--- a/grpc/third_party/cares/cares/travis/covupload.sh
+++ b/grpc/third_party/cares/cares/travis/covupload.sh
@@ -1,5 +1,5 @@
#!/bin/sh
set -e
if [ "$BUILD_TYPE" = "coverage" ]; then
- coveralls --gcov /usr/bin/gcov-4.8 --gcov-options '\-lp'
+ coveralls --gcov-options '\-lp'
fi
diff --git a/grpc/third_party/cares/cares/travis/distcheck.sh b/grpc/third_party/cares/cares/travis/distcheck.sh
index 89333628..ca6f98fc 100755
--- a/grpc/third_party/cares/cares/travis/distcheck.sh
+++ b/grpc/third_party/cares/cares/travis/distcheck.sh
@@ -2,16 +2,25 @@
set -e
if [ "$BUILD_TYPE" = "normal" -a "$TRAVIS_OS_NAME" = "linux" ]; then
+ # Make distribution tarball
./maketgz 99.98.97
+ # Extract distribution tarball for building
tar xvf c-ares-99.98.97.tar.gz
cd c-ares-99.98.97
- ./configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug
+ # Build autotools
+ mkdir build-autotools
+ cd build-autotools
+ ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug
make
-
cd test
+ $TEST_WRAP ./arestest -4 -v $TEST_FILTER
+ cd ../..
+ # Build CMake
+ mkdir build-cmake
+ cd build-cmake
+ cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON ..
make
+ cd bin
$TEST_WRAP ./arestest -4 -v $TEST_FILTER
- cd ..
-
- cd ..
+ cd ../..
fi
diff --git a/grpc/third_party/cares/cares/travis/test.sh b/grpc/third_party/cares/cares/travis/test.sh
index e5446b0e..fee3858e 100755
--- a/grpc/third_party/cares/cares/travis/test.sh
+++ b/grpc/third_party/cares/cares/travis/test.sh
@@ -1,24 +1,37 @@
#!/bin/sh
set -e
-if [ "$BUILD_TYPE" != "ios" -a "$BUILD_TYPE" != "analyse" -a "$BUILD_TYPE" != "cmake" ]; then
- $TEST_WRAP ./adig www.google.com
- $TEST_WRAP ./acountry www.google.com
- $TEST_WRAP ./ahost www.google.com
- cd test
- make
- $TEST_WRAP ./arestest -4 -v $TEST_FILTER
- ./fuzzcheck.sh
- ./dnsdump fuzzinput/answer_a fuzzinput/answer_aaaa
- cd ..
-elif [ "$BUILD_TYPE" = "cmake" ] ; then
- TESTDIR=../../test/
- cd cmakebld/bin
- $TEST_WRAP ./adig www.google.com
- $TEST_WRAP ./acountry www.google.com
- $TEST_WRAP ./ahost www.google.com
- $TEST_WRAP ./arestest -4 -v $TEST_FILTER
- ./aresfuzz $TESTDIR/fuzzinput/*
- ./aresfuzzname $TESTDIR/fuzznames/*
- ./dnsdump $TESTDIR/fuzzinput/answer_a $TESTDIR/fuzzinput/answer_aaaa
- cd ../..
+
+# Travis on MacOS uses CloudFlare's DNS (1.1.1.1/1.0.0.1) which rejects ANY requests
+# Note res_ninit() and /etc/resolv.conf actually have different configs, bad Travis
+[ -z "$TEST_FILTER" ] && export TEST_FILTER="--gtest_filter=-*LiveSearchANY*"
+
+# No tests for ios as it is a cross-compile
+if [ "$BUILD_TYPE" = "ios" -o "$BUILD_TYPE" = "ios-cmake" ] ; then
+ exit 0
fi
+
+# Analyze tests don't need runtime, its static analysis
+if [ "$BUILD_TYPE" = "analyze" ] ; then
+ exit 0
+fi
+
+PWD=`pwd`
+TESTDIR="${PWD}/test"
+
+if [ "$BUILD_TYPE" = "cmake" -o "$BUILD_TYPE" = "valgrind" ] ; then
+ TOOLSBIN="${PWD}/cmakebld/bin"
+ TESTSBIN="${PWD}/cmakebld/bin"
+else
+ TOOLSBIN="${PWD}/atoolsbld/src/tools"
+ TESTSBIN="${PWD}/atoolsbld/test"
+fi
+
+$TEST_WRAP "${TOOLSBIN}/adig" www.google.com
+$TEST_WRAP "${TOOLSBIN}/acountry" www.google.com
+$TEST_WRAP "${TOOLSBIN}/ahost" www.google.com
+cd "${TESTSBIN}"
+$TEST_WRAP ./arestest -4 -v $TEST_FILTER
+./aresfuzz ${TESTDIR}/fuzzinput/*
+./aresfuzzname ${TESTDIR}/fuzznames/*
+./dnsdump "${TESTDIR}/fuzzinput/answer_a" "${TESTDIR}/fuzzinput/answer_aaaa"
+cd "${PWD}"
diff --git a/grpc/third_party/cares/cares/vc/cares/vc6cares.dsp b/grpc/third_party/cares/cares/vc/cares/vc6cares.dsp
deleted file mode 100644
index 02a49091..00000000
--- a/grpc/third_party/cares/cares/vc/cares/vc6cares.dsp
+++ /dev/null
@@ -1,453 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cares" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=cares - Win32 LIB Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "vc6cares.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "vc6cares.mak" CFG="cares - Win32 LIB Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cares - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "cares - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "cares - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "cares - Win32 LIB Release" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-
-!IF "$(CFG)" == "cares - Win32 DLL Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "dll-debug"
-# PROP BASE Intermediate_Dir "dll-debug/obj"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "dll-debug"
-# PROP Intermediate_Dir "dll-debug/obj"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "DEBUGBUILD" /D "CARES_BUILDING_LIBRARY" /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "DEBUGBUILD" /D "CARES_BUILDING_LIBRARY" /FD /GZ /c
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/caresd.dll" /implib:"dll-debug/caresd.lib" /pdbtype:con /fixed:no
-# ADD LINK32 ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"dll-debug/caresd.dll" /implib:"dll-debug/caresd.lib" /pdbtype:con /fixed:no
-
-!ELSEIF "$(CFG)" == "cares - Win32 DLL Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "dll-release"
-# PROP BASE Intermediate_Dir "dll-release/obj"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "dll-release"
-# PROP Intermediate_Dir "dll-release/obj"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "CARES_BUILDING_LIBRARY" /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "CARES_BUILDING_LIBRARY" /FD /c
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/cares.dll" /implib:"dll-release/cares.lib" /fixed:no /release /incremental:no
-# ADD LINK32 ws2_32.lib advapi32.lib kernel32.lib /nologo /dll /pdb:none /machine:I386 /out:"dll-release/cares.dll" /implib:"dll-release/cares.lib" /fixed:no /release /incremental:no
-
-!ELSEIF "$(CFG)" == "cares - Win32 LIB Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "lib-debug"
-# PROP BASE Intermediate_Dir "lib-debug/obj"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "lib-debug"
-# PROP Intermediate_Dir "lib-debug/obj"
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "DEBUGBUILD" /D "CARES_BUILDING_LIBRARY" /D "CARES_STATICLIB" /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\.." /D "_DEBUG" /D "WIN32" /D "DEBUGBUILD" /D "CARES_BUILDING_LIBRARY" /D "CARES_STATICLIB" /FD /GZ /c
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"lib-debug/libcaresd.lib" /machine:I386
-# ADD LIB32 /nologo /out:"lib-debug/libcaresd.lib" /machine:I386
-
-!ELSEIF "$(CFG)" == "cares - Win32 LIB Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "lib-release"
-# PROP BASE Intermediate_Dir "lib-release/obj"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "lib-release"
-# PROP Intermediate_Dir "lib-release/obj"
-# PROP Target_Dir ""
-CPP=cl.exe
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "CARES_BUILDING_LIBRARY" /D "CARES_STATICLIB" /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "NDEBUG" /D "WIN32" /D "CARES_BUILDING_LIBRARY" /D "CARES_STATICLIB" /FD /c
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"lib-release/libcares.lib" /machine:I386
-# ADD LIB32 /nologo /out:"lib-release/libcares.lib" /machine:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "cares - Win32 DLL Debug"
-# Name "cares - Win32 DLL Release"
-# Name "cares - Win32 LIB Debug"
-# Name "cares - Win32 LIB Release"
-# Begin Group "Source Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\ares__close_sockets.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares__get_hostent.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares__read_line.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares__timeval.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_cancel.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_create_query.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_data.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_destroy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_expand_name.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_expand_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_fds.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_free_hostent.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_free_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_getenv.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_gethostbyaddr.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_gethostbyname.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_getnameinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_getsock.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_init.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_library_init.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_llist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_mkquery.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_nowarn.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_options.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_a_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_aaaa_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_mx_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_naptr_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_ns_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_ptr_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_soa_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_srv_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_parse_txt_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_platform.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_process.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_query.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_search.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_send.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_strcasecmp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_strdup.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_strerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_timeout.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_version.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_writev.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\bitncmp.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\inet_net_pton.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\inet_ntop.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\windows_port.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\ares.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_build.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_data.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_dns.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_getenv.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_iphlpapi.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_ipv6.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_library_init.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_llist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_nowarn.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_platform.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_rules.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_setup.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_strcasecmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_strdup.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_version.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\ares_writev.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\bitncmp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\config-win32.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\inet_net_pton.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\inet_ntop.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\nameser.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\setup_once.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\cares.rc
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/grpc/third_party/cares/cares/vc/cares/vc6cares.dsw b/grpc/third_party/cares/cares/vc/cares/vc6cares.dsw
deleted file mode 100644
index 5bad3757..00000000
--- a/grpc/third_party/cares/cares/vc/cares/vc6cares.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "cares"=".\vc6cares.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/grpc/third_party/cares/cares/vc/vc6aws.dsw b/grpc/third_party/cares/cares/vc/vc6aws.dsw
deleted file mode 100644
index 9543a5a4..00000000
--- a/grpc/third_party/cares/cares/vc/vc6aws.dsw
+++ /dev/null
@@ -1,74 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "cares"=".\cares\vc6cares.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "acountry"=".\acountry\vc6acountry.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name cares
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "adig"=".\adig\vc6adig.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name cares
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ahost"=".\ahost\vc6ahost.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name cares
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/grpc/third_party/istio/security/proto/providers/google/meshca.proto b/grpc/third_party/istio/security/proto/providers/google/meshca.proto
deleted file mode 100644
index c02b7f58..00000000
--- a/grpc/third_party/istio/security/proto/providers/google/meshca.proto
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2019 Istio Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package google.security.meshca.v1;
-
-import "google/protobuf/duration.proto";
-
-option java_multiple_files = true;
-option java_outer_classname = "MeshCaProto";
-option java_package = "com.google.security.meshca.v1";
-
-// Certificate request message.
-message MeshCertificateRequest {
- // The request ID must be a valid UUID with the exception that zero UUID is
- // not supported (00000000-0000-0000-0000-000000000000).
- string request_id = 1;
- // PEM-encoded certificate request.
- string csr = 2;
- // Optional: requested certificate validity period.
- google.protobuf.Duration validity = 3;
- // Reserved 4
-}
-
-// Certificate response message.
-message MeshCertificateResponse {
- // PEM-encoded certificate chain.
- // Leaf cert is element '0'. Root cert is element 'n'.
- repeated string cert_chain = 1;
-}
-
-// Service for managing certificates issued by the CSM CA.
-service MeshCertificateService {
- // Using provided CSR, returns a signed certificate that represents a GCP
- // service account identity.
- rpc CreateCertificate(MeshCertificateRequest)
- returns (MeshCertificateResponse) {
- }
-}
diff --git a/grpc/third_party/libprotobuf_mutator.BUILD b/grpc/third_party/libprotobuf_mutator.BUILD
new file mode 100644
index 00000000..107993ed
--- /dev/null
+++ b/grpc/third_party/libprotobuf_mutator.BUILD
@@ -0,0 +1,30 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+licenses(["notice"])
+
+cc_library(
+ name = "libprotobuf_mutator",
+ srcs = glob(
+ ["src/*.cc", "src/libfuzzer/*.cc"],
+ exclude = ["src/*_test.cc", "src/libfuzzer/*_test.cc"]
+ ),
+ hdrs = glob(["src/*.h", "port/*.h", "src/libfuzzer/*.h"]),
+ deps = [
+ "@com_google_protobuf//:protobuf",
+ "@com_google_googletest//:gtest",
+ ],
+ visibility = ["//visibility:public"],
+ includes = ["."]
+)
diff --git a/grpc/third_party/libuv.BUILD b/grpc/third_party/libuv.BUILD
index 17446148..ebb8556f 100644
--- a/grpc/third_party/libuv.BUILD
+++ b/grpc/third_party/libuv.BUILD
@@ -1,3 +1,132 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+config_setting(
+ name = "darwin",
+ values = {"cpu": "darwin"},
+)
+
+config_setting(
+ name = "darwin_x86_64",
+ values = {"cpu": "darwin_x86_64"},
+)
+
+config_setting(
+ name = "darwin_arm64",
+ values = {"cpu": "darwin_arm64"},
+)
+
+config_setting(
+ name = "darwin_arm64e",
+ values = {"cpu": "darwin_arm64e"},
+)
+
+config_setting(
+ name = "windows",
+ values = {"cpu": "x64_windows"},
+)
+
+config_setting(
+ name = "freebsd",
+ constraint_values = ["@platforms//os:freebsd"],
+)
+
+# Android is not officially supported through C++.
+# This just helps with the build for now.
+config_setting(
+ name = "android",
+ values = {
+ "crosstool_top": "//external:android/crosstool",
+ },
+)
+
+# iOS is not officially supported through C++.
+# This just helps with the build for now.
+config_setting(
+ name = "ios_x86_64",
+ values = {"cpu": "ios_x86_64"},
+)
+
+config_setting(
+ name = "ios_armv7",
+ values = {"cpu": "ios_armv7"},
+)
+
+config_setting(
+ name = "ios_armv7s",
+ values = {"cpu": "ios_armv7s"},
+)
+
+config_setting(
+ name = "ios_arm64",
+ values = {"cpu": "ios_arm64"},
+)
+
+# The following architectures are found in
+# https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java
+config_setting(
+ name = "tvos_x86_64",
+ values = {"cpu": "tvos_x86_64"},
+)
+
+config_setting(
+ name = "tvos_arm64",
+ values = {"cpu": "tvos_arm64"},
+)
+
+config_setting(
+ name = "watchos_i386",
+ values = {"cpu": "watchos_i386"},
+)
+
+config_setting(
+ name = "watchos_x86_64",
+ values = {"cpu": "watchos_x86_64"},
+)
+
+config_setting(
+ name = "watchos_armv7k",
+ values = {"cpu": "watchos_armv7k"},
+)
+
+config_setting(
+ name = "watchos_arm64_32",
+ values = {"cpu": "watchos_arm64_32"},
+)
+
+selects.config_setting_group(
+ name = "apple",
+ match_any = [
+ ":darwin",
+ ":darwin_x86_64",
+ ":darwin_arm64",
+ ":darwin_arm64e",
+ "ios_x86_64",
+ "ios_armv7",
+ "ios_armv7s",
+ "ios_arm64",
+ "tvos_x86_64",
+ "tvos_arm64",
+ "watchos_i386",
+ "watchos_x86_64",
+ "watchos_armv7k",
+ "watchos_arm64_32",
+ ],
+)
+
COMMON_LIBUV_HEADERS = [
"include/uv.h",
"include/uv/errno.h",
@@ -139,17 +268,15 @@ WINDOWS_LIBUV_SOURCES = [
cc_library(
name = "libuv",
srcs = select({
- "//tools/cc_target_os:android": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES + ANDROID_LIBUV_SOURCES,
- "//tools/cc_target_os:apple": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + DARWIN_LIBUV_SOURCES,
- "//tools/cc_target_os:windows": COMMON_LIBUV_SOURCES + WINDOWS_LIBUV_SOURCES,
+ ":android": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES + ANDROID_LIBUV_SOURCES,
+ ":apple": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + DARWIN_LIBUV_SOURCES,
+ ":windows": COMMON_LIBUV_SOURCES + WINDOWS_LIBUV_SOURCES,
"//conditions:default": COMMON_LIBUV_SOURCES + UNIX_LIBUV_SOURCES + LINUX_LIBUV_SOURCES,
}),
- hdrs = [
- "include/uv.h",
- ] + select({
- "//tools/cc_target_os:android": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS + ANDROID_LIBUV_HEADERS,
- "//tools/cc_target_os:apple": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + DARWIN_LIBUV_HEADERS,
- "//tools/cc_target_os:windows": COMMON_LIBUV_HEADERS + WINDOWS_LIBUV_HEADERS,
+ hdrs = select({
+ ":android": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS + ANDROID_LIBUV_HEADERS,
+ ":apple": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + DARWIN_LIBUV_HEADERS,
+ ":windows": COMMON_LIBUV_HEADERS + WINDOWS_LIBUV_HEADERS,
"//conditions:default": COMMON_LIBUV_HEADERS + UNIX_LIBUV_HEADERS + LINUX_LIBUV_HEADERS,
}),
copts = [
@@ -167,8 +294,8 @@ cc_library(
"-Wno-unused-function",
"-Wno-unused-variable",
] + select({
- "//tools/cc_target_os:apple": [],
- "//tools/cc_target_os:windows": [
+ ":apple": [],
+ ":windows": [
"-DWIN32_LEAN_AND_MEAN",
"-D_WIN32_WINNT=0x0600",
],
@@ -184,7 +311,68 @@ cc_library(
"src",
],
linkopts = select({
- "//tools/cc_target_os:windows": [
+ ":windows": [
+ "-Xcrosstool-compilation-mode=$(COMPILATION_MODE)",
+ "-Wl,Iphlpapi.lib",
+ "-Wl,Psapi.lib",
+ "-Wl,User32.lib",
+ "-Wl,Userenv.lib",
+ ],
+ "//conditions:default": [],
+ }),
+ visibility = [
+ "//visibility:public",
+ ],
+)
+
+cc_library(
+ name = "libuv_test",
+ srcs = [
+ "test/test-timer.c",
+ "test/test-timer-again.c",
+ "test/test-timer-from-check.c",
+ ],
+ hdrs = [
+ "test/runner.h",
+ "test/runner-unix.h",
+ "test/task.h",
+ ],
+ includes = [
+ "include",
+ "src",
+ ],
+ deps = [
+ ":libuv"
+ ],
+ copts = [
+ "-D_LARGEFILE_SOURCE",
+ "-D_FILE_OFFSET_BITS=64",
+ "-D_GNU_SOURCE",
+ "-pthread",
+ "--std=gnu89",
+ "-pedantic",
+ "-Wno-error",
+ "-Wno-strict-aliasing",
+ "-Wstrict-aliasing",
+ "-O2",
+ "-Wno-implicit-function-declaration",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ ] + select({
+ ":apple": [],
+ ":windows": [
+ "-DWIN32_LEAN_AND_MEAN",
+ "-D_WIN32_WINNT=0x0600",
+ ],
+ "//conditions:default": [
+ "-Wno-tree-vrp",
+ "-Wno-omit-frame-pointer",
+ "-D_DARWIN_USE_64_BIT_INODE=1",
+ "-D_DARWIN_UNLIMITED_SELECT=1",
+ ],
+ }),
+ linkopts = select({
+ ":windows": [
"-Xcrosstool-compilation-mode=$(COMPILATION_MODE)",
"-Wl,Iphlpapi.lib",
"-Wl,Psapi.lib",
diff --git a/grpc/third_party/protobuf.patch b/grpc/third_party/protobuf.patch
index f7ff1dd6..669fdae7 100644
--- a/grpc/third_party/protobuf.patch
+++ b/grpc/third_party/protobuf.patch
@@ -5,7 +5,7 @@ index 97ac28028..8b7585d9d 100644
@@ -31,3 +31,9 @@
# Copyright 2007 Google Inc. All Rights Reserved.
- __version__ = '3.15.8'
+ __version__ = '3.19.5'
+
+if __name__ != '__main__':
+ try:
diff --git a/grpc/third_party/protoc-gen-validate.patch b/grpc/third_party/protoc-gen-validate.patch
new file mode 100644
index 00000000..bea7b87c
--- /dev/null
+++ b/grpc/third_party/protoc-gen-validate.patch
@@ -0,0 +1,14 @@
+index 5b2443d..c26a9dd 100644
+--- a/dependencies.bzl
++++ b/dependencies.bzl
+@@ -104,8 +104,8 @@ def go_third_party():
+ go_repository(
+ name = "org_golang_google_protobuf",
+ importpath = "google.golang.org/protobuf",
+- sum = "h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=",
+- version = "v1.27.1",
++ sum = "h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=",
++ version = "v1.28.0",
+ )
+ go_repository(
+ name = "org_golang_x_crypto",
diff --git a/grpc/third_party/py/BUILD.tpl b/grpc/third_party/py/BUILD.tpl
index 8f010f85..a64eaeaa 100644
--- a/grpc/third_party/py/BUILD.tpl
+++ b/grpc/third_party/py/BUILD.tpl
@@ -9,11 +9,6 @@ config_setting(
)
config_setting(
- name="python2",
- flag_values = {"@rules_python//python:python_version": "PY2"}
-)
-
-config_setting(
name="python3",
flag_values = {"@rules_python//python:python_version": "PY3"}
)
@@ -21,7 +16,6 @@ config_setting(
cc_library(
name = "python_lib",
deps = select({
- ":python2": ["//_python2:_python2_lib"],
":python3": ["//_python3:_python3_lib"],
"//conditions:default": ["not-existing.lib"],
})
@@ -30,7 +24,6 @@ cc_library(
cc_library(
name = "python_headers",
deps = select({
- ":python2": ["//_python2:_python2_headers"],
":python3": ["//_python3:_python3_headers"],
"//conditions:default": ["not-existing.headers"],
})
diff --git a/grpc/third_party/py/python_configure.bzl b/grpc/third_party/py/python_configure.bzl
index fa47d89e..7ec4459d 100644
--- a/grpc/third_party/py/python_configure.bzl
+++ b/grpc/third_party/py/python_configure.bzl
@@ -3,19 +3,17 @@
`python_configure` depends on the following environment variables:
- * `PYTHON2_BIN_PATH`: location of python binary.
- * `PYTHON2_LIB_PATH`: Location of python libraries.
+ * `PYTHON3_BIN_PATH`: location of python binary.
+ * `PYTHON3_LIB_PATH`: Location of python libraries.
"""
_BAZEL_SH = "BAZEL_SH"
-_PYTHON2_BIN_PATH = "PYTHON2_BIN_PATH"
-_PYTHON2_LIB_PATH = "PYTHON2_LIB_PATH"
_PYTHON3_BIN_PATH = "PYTHON3_BIN_PATH"
_PYTHON3_LIB_PATH = "PYTHON3_LIB_PATH"
_HEADERS_HELP = (
- "Are Python headers installed? Try installing python-dev or " +
- "python3-dev on Debian-based systems. Try python-devel or python3-devel " +
+ "Are Python headers installed? Try installing " +
+ "python3-dev on Debian-based systems. Try python3-devel " +
"on Redhat-based systems."
)
@@ -201,14 +199,14 @@ def _get_python_lib(repository_ctx, python_bin, lib_path_key):
" python_paths = os.getenv('PYTHONPATH').split(':')\n" + "try:\n" +
" library_paths = site.getsitepackages()\n" +
"except AttributeError:\n" +
- " from distutils.sysconfig import get_python_lib\n" +
- " library_paths = [get_python_lib()]\n" +
+ " import sysconfig\n" +
+ " library_paths = [sysconfig.get_path('purelib')]\n" +
"all_paths = set(python_paths + library_paths)\n" + "paths = []\n" +
"for path in all_paths:\n" + " if os.path.isdir(path):\n" +
" paths.append(path)\n" + "if len(paths) >=1:\n" +
" print(paths[0])\n" + "END"
)
- cmd = "%s - %s" % (python_bin, print_lib)
+ cmd = '"%s" - %s' % (python_bin, print_lib)
result = repository_ctx.execute([_get_bash_bin(repository_ctx), "-c", cmd])
return result.stdout.strip("\n")
@@ -239,14 +237,13 @@ def _get_python_include(repository_ctx, python_bin):
python_bin,
"-c",
"from __future__ import print_function;" +
- "from distutils import sysconfig;" +
- "print(sysconfig.get_python_inc())",
+ "import sysconfig;" +
+ "print(sysconfig.get_path('include'))",
],
error_msg = "Problem getting python include path for {}.".format(python_bin),
error_details = (
"Is the Python binary path set up right? " + "(See ./configure or " +
- python_bin + ".) " + "Is distutils installed? " +
- _HEADERS_HELP
+ python_bin + ".) " + _HEADERS_HELP
),
)
include_path = result.stdout.splitlines()[0]
@@ -256,7 +253,7 @@ def _get_python_include(repository_ctx, python_bin):
python_bin,
"-c",
"import os;" +
- "main_header = os.path.join('{}', 'Python.h');".format(include_path) +
+ "main_header = os.path.join(r'{}', 'Python.h');".format(include_path) +
"assert os.path.exists(main_header), main_header + ' does not exist.'",
],
error_msg = "Unable to find Python headers for {}".format(python_bin),
@@ -346,14 +343,6 @@ def _python_autoconf_impl(repository_ctx):
"""Implementation of the python_autoconf repository rule."""
_create_single_version_package(
repository_ctx,
- "_python2",
- _PYTHON2_BIN_PATH,
- "python2",
- _PYTHON2_LIB_PATH,
- True
- )
- _create_single_version_package(
- repository_ctx,
"_python3",
_PYTHON3_BIN_PATH,
"python3",
@@ -366,8 +355,6 @@ python_configure = repository_rule(
implementation = _python_autoconf_impl,
environ = [
_BAZEL_SH,
- _PYTHON2_BIN_PATH,
- _PYTHON2_LIB_PATH,
_PYTHON3_BIN_PATH,
_PYTHON3_LIB_PATH,
],
@@ -384,8 +371,7 @@ python_configure = repository_rule(
)
"""Detects and configures the local Python.
-It is expected that the system have both a working Python 2 and python 3
-installation
+It expects the system have a working Python 3 installation.
Add the following to your WORKSPACE FILE:
diff --git a/grpc/third_party/rake-compiler-dock/rake_arm64-darwin/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_arm64-darwin/Dockerfile
new file mode 100644
index 00000000..5a94b536
--- /dev/null
+++ b/grpc/third_party/rake-compiler-dock/rake_arm64-darwin/Dockerfile
@@ -0,0 +1 @@
+FROM larskanis/rake-compiler-dock-mri-arm64-darwin:1.2.1
diff --git a/grpc/third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile
index 66637714..96c23e57 100644
--- a/grpc/third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile
+++ b/grpc/third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile
@@ -1,3 +1,17 @@
-FROM larskanis/rake-compiler-dock-mri-x64-mingw32:1.1.0
+FROM larskanis/rake-compiler-dock-mri-x64-mingw32:1.2.1
RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/third_party/rake-compiler-dock/rake_x86-linux/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_x86-linux/Dockerfile
index 50aaae24..e7fa5726 100644
--- a/grpc/third_party/rake-compiler-dock/rake_x86-linux/Dockerfile
+++ b/grpc/third_party/rake-compiler-dock/rake_x86-linux/Dockerfile
@@ -1 +1,15 @@
-FROM larskanis/rake-compiler-dock-mri-x86-linux:1.1.0
+FROM larskanis/rake-compiler-dock-mri-x86-linux:1.2.1
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile
index 6a2880a9..63f69dfa 100644
--- a/grpc/third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile
+++ b/grpc/third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile
@@ -1,3 +1,17 @@
-FROM larskanis/rake-compiler-dock-mri-x86-mingw32:1.1.0
+FROM larskanis/rake-compiler-dock-mri-x86-mingw32:1.2.1
RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/third_party/rake-compiler-dock/rake_x86_64-darwin/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_x86_64-darwin/Dockerfile
new file mode 100644
index 00000000..1579cda0
--- /dev/null
+++ b/grpc/third_party/rake-compiler-dock/rake_x86_64-darwin/Dockerfile
@@ -0,0 +1 @@
+FROM larskanis/rake-compiler-dock-mri-x86_64-darwin:1.2.1
diff --git a/grpc/third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile b/grpc/third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile
index ede37a24..f35690ae 100644
--- a/grpc/third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile
+++ b/grpc/third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile
@@ -1 +1,15 @@
-FROM larskanis/rake-compiler-dock-mri-x86_64-linux:1.1.0
+FROM larskanis/rake-compiler-dock-mri-x86_64-linux:1.2.1
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/third_party/re2/.github/bazel.sh b/grpc/third_party/re2/.github/bazel.sh
new file mode 100755
index 00000000..fbe92e65
--- /dev/null
+++ b/grpc/third_party/re2/.github/bazel.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -eux
+
+bazel clean
+bazel build --compilation_mode=dbg -- //:all
+bazel test --compilation_mode=dbg --test_output=errors -- //:all \
+ -//:dfa_test \
+ -//:exhaustive1_test \
+ -//:exhaustive2_test \
+ -//:exhaustive3_test \
+ -//:exhaustive_test \
+ -//:random_test
+
+bazel clean
+bazel build --compilation_mode=opt -- //:all
+bazel test --compilation_mode=opt --test_output=errors -- //:all \
+ -//:dfa_test \
+ -//:exhaustive1_test \
+ -//:exhaustive2_test \
+ -//:exhaustive3_test \
+ -//:exhaustive_test \
+ -//:random_test
+
+exit 0
diff --git a/grpc/third_party/re2/.github/cmake.sh b/grpc/third_party/re2/.github/cmake.sh
new file mode 100755
index 00000000..145a843c
--- /dev/null
+++ b/grpc/third_party/re2/.github/cmake.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -eux
+
+cmake . -D CMAKE_BUILD_TYPE=Debug
+cmake --build . --config Debug --clean-first
+ctest -C Debug --output-on-failure -E 'dfa|exhaustive|random'
+
+cmake . -D CMAKE_BUILD_TYPE=Release
+cmake --build . --config Release --clean-first
+ctest -C Release --output-on-failure -E 'dfa|exhaustive|random'
+
+exit 0
diff --git a/grpc/third_party/re2/.github/workflows/ci-bazel.yml b/grpc/third_party/re2/.github/workflows/ci-bazel.yml
new file mode 100644
index 00000000..681034de
--- /dev/null
+++ b/grpc/third_party/re2/.github/workflows/ci-bazel.yml
@@ -0,0 +1,17 @@
+name: CI (Bazel)
+on:
+ push:
+ branches: [main]
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, ubuntu-latest, windows-latest]
+ env:
+ BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v2
+ - run: .github/bazel.sh
+ shell: bash
diff --git a/grpc/third_party/re2/.github/workflows/ci-cmake.yml b/grpc/third_party/re2/.github/workflows/ci-cmake.yml
new file mode 100644
index 00000000..585c386c
--- /dev/null
+++ b/grpc/third_party/re2/.github/workflows/ci-cmake.yml
@@ -0,0 +1,15 @@
+name: CI (CMake)
+on:
+ push:
+ branches: [main]
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, ubuntu-latest, windows-latest]
+ steps:
+ - uses: actions/checkout@v2
+ - run: .github/cmake.sh
+ shell: bash
diff --git a/grpc/third_party/re2/.github/workflows/ci.yml b/grpc/third_party/re2/.github/workflows/ci.yml
new file mode 100644
index 00000000..1dfa9e7d
--- /dev/null
+++ b/grpc/third_party/re2/.github/workflows/ci.yml
@@ -0,0 +1,51 @@
+name: CI
+on:
+ push:
+ branches: [main]
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, ubuntu-latest]
+ env:
+ CC: clang
+ CXX: clang++
+ steps:
+ - uses: actions/checkout@v2
+ - run: make && make test
+ shell: bash
+ build-clang:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ tag: [9, 10, 11, 12, 13]
+ env:
+ CC: clang-${{ matrix.tag }}
+ CXX: clang++-${{ matrix.tag }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Clang ${{ matrix.tag }}
+ run: |
+ wget https://apt.llvm.org/llvm.sh
+ chmod +x ./llvm.sh
+ sudo ./llvm.sh ${{ matrix.tag }}
+ shell: bash
+ - run: make && make test
+ shell: bash
+ build-gcc:
+ runs-on: ubuntu-latest
+ container: gcc:${{ matrix.tag }}
+ strategy:
+ fail-fast: false
+ matrix:
+ tag: [4, 5, 6, 7, 8, 9, 10, 11]
+ env:
+ CC: gcc
+ CXX: g++
+ steps:
+ - uses: actions/checkout@v2
+ - run: make && make test
+ shell: bash
diff --git a/grpc/third_party/re2/.travis.yml b/grpc/third_party/re2/.travis.yml
deleted file mode 100644
index a3740ce8..00000000
--- a/grpc/third_party/re2/.travis.yml
+++ /dev/null
@@ -1,210 +0,0 @@
-language: cpp
-jobs:
- include:
-
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-4.8
- env:
- - MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-4.9
- env:
- - MATRIX_EVAL="CC=gcc-4.9 CXX=g++-4.9"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-5
- env:
- - MATRIX_EVAL="CC=gcc-5 CXX=g++-5"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-6
- env:
- - MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-7
- env:
- - MATRIX_EVAL="CC=gcc-7 CXX=g++-7"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-8
- env:
- - MATRIX_EVAL="CC=gcc-8 CXX=g++-8"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-9
- env:
- - MATRIX_EVAL="CC=gcc-9 CXX=g++-9"
-
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-3.8
- env:
- - MATRIX_EVAL="CC=clang-3.8 CXX=clang++-3.8"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-3.9
- env:
- - MATRIX_EVAL="CC=clang-3.9 CXX=clang++-3.9"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-4.0
- env:
- - MATRIX_EVAL="CC=clang-4.0 CXX=clang++-4.0"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-5.0
- env:
- - MATRIX_EVAL="CC=clang-5.0 CXX=clang++-5.0"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-6.0
- env:
- - MATRIX_EVAL="CC=clang-6.0 CXX=clang++-6.0"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-7
- env:
- - MATRIX_EVAL="CC=clang-7 CXX=clang++-7"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-8
- env:
- - MATRIX_EVAL="CC=clang-8 CXX=clang++-8"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-9
- env:
- - MATRIX_EVAL="CC=clang-9 CXX=clang++-9"
- - os: linux
- dist: xenial
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main'
- key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- packages:
- - clang-10
- env:
- - MATRIX_EVAL="CC=clang-10 CXX=clang++-10"
-
- - os: osx
- osx_image: xcode7.3
- env:
- - MATRIX_EVAL="CC=clang CXX=clang++"
- - os: osx
- osx_image: xcode8.3
- env:
- - MATRIX_EVAL="CC=clang CXX=clang++"
- - os: osx
- osx_image: xcode9.4
- env:
- - MATRIX_EVAL="CC=clang CXX=clang++"
- - os: osx
- osx_image: xcode10.3
- env:
- - MATRIX_EVAL="CC=clang CXX=clang++"
- - os: osx
- osx_image: xcode11.3
- env:
- - MATRIX_EVAL="CC=clang CXX=clang++"
-
-before_script:
- - eval "${MATRIX_EVAL}"
-script:
- - make
- - make test
diff --git a/grpc/third_party/re2/BUILD b/grpc/third_party/re2/BUILD
index 480646fc..3dc27d5c 100644
--- a/grpc/third_party/re2/BUILD
+++ b/grpc/third_party/re2/BUILD
@@ -9,18 +9,18 @@ licenses(["notice"])
exports_files(["LICENSE"])
config_setting(
- name = "darwin",
+ name = "macos",
values = {"cpu": "darwin"},
)
config_setting(
- name = "windows",
- values = {"cpu": "x64_windows"},
+ name = "wasm",
+ values = {"cpu": "wasm32"},
)
config_setting(
- name = "windows_msvc",
- values = {"cpu": "x64_windows_msvc"},
+ name = "windows",
+ values = {"cpu": "x64_windows"},
)
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
@@ -75,17 +75,17 @@ cc_library(
"re2/stringpiece.h",
],
copts = select({
+ ":wasm": [],
":windows": [],
- ":windows_msvc": [],
"//conditions:default": ["-pthread"],
}),
linkopts = select({
- # Darwin doesn't need `-pthread' when linking and it appears that
+ # macOS doesn't need `-pthread' when linking and it appears that
# older versions of Clang will warn about the unused command line
# argument, so just don't pass it.
- ":darwin": [],
+ ":macos": [],
+ ":wasm": [],
":windows": [],
- ":windows_msvc": [],
"//conditions:default": ["-pthread"],
}),
visibility = ["//visibility:public"],
diff --git a/grpc/third_party/re2/CMakeLists.txt b/grpc/third_party/re2/CMakeLists.txt
index 44a47720..fcd3870f 100644
--- a/grpc/third_party/re2/CMakeLists.txt
+++ b/grpc/third_party/re2/CMakeLists.txt
@@ -5,10 +5,6 @@
# Old enough to support Ubuntu Xenial.
cmake_minimum_required(VERSION 3.5.1)
-if(POLICY CMP0048)
- cmake_policy(SET CMP0048 NEW)
-endif()
-
project(RE2 CXX)
include(CTest)
include(GNUInstallDirs)
@@ -25,6 +21,10 @@ option(USEPCRE "use PCRE in tests and benchmarks" OFF)
# so we provide an option similar to BUILD_TESTING, but just for RE2.
option(RE2_BUILD_TESTING "enable testing for RE2" ON)
+# ABI version
+# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
+set(SONAME 9)
+
set(EXTRA_TARGET_LINK_LIBRARIES)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
@@ -47,8 +47,8 @@ if(WIN32)
add_definitions(-DUNICODE -D_UNICODE -DSTRICT -DNOMINMAX)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
elseif(UNIX)
- add_compile_options(-pthread)
- list(APPEND EXTRA_TARGET_LINK_LIBRARIES -pthread)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
endif()
if(USEPCRE)
@@ -56,8 +56,6 @@ if(USEPCRE)
list(APPEND EXTRA_TARGET_LINK_LIBRARIES pcre)
endif()
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
set(RE2_SOURCES
re2/bitstate.cc
re2/compile.cc
@@ -84,8 +82,14 @@ set(RE2_SOURCES
)
add_library(re2 ${RE2_SOURCES})
+target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
+set_target_properties(re2 PROPERTIES SOVERSION ${SONAME} VERSION ${SONAME}.0.0)
add_library(re2::re2 ALIAS re2)
+if(UNIX)
+ target_link_libraries(re2 PUBLIC Threads::Threads)
+endif()
+
if(RE2_BUILD_TESTING)
set(TESTING_SOURCES
re2/testing/backtrack.cc
@@ -99,6 +103,7 @@ if(RE2_BUILD_TESTING)
)
add_library(testing STATIC ${TESTING_SOURCES})
+ target_link_libraries(testing PUBLIC re2)
set(TEST_TARGETS
charclass_test
@@ -130,14 +135,14 @@ if(RE2_BUILD_TESTING)
foreach(target ${TEST_TARGETS})
add_executable(${target} re2/testing/${target}.cc util/test.cc)
- target_link_libraries(${target} testing re2 ${EXTRA_TARGET_LINK_LIBRARIES})
+ target_link_libraries(${target} testing ${EXTRA_TARGET_LINK_LIBRARIES})
add_test(NAME ${target} COMMAND ${target})
- endforeach(target)
+ endforeach()
foreach(target ${BENCHMARK_TARGETS})
add_executable(${target} re2/testing/${target}.cc util/benchmark.cc)
- target_link_libraries(${target} testing re2 ${EXTRA_TARGET_LINK_LIBRARIES})
- endforeach(target)
+ target_link_libraries(${target} testing ${EXTRA_TARGET_LINK_LIBRARIES})
+ endforeach()
endif()
set(RE2_HEADERS
diff --git a/grpc/third_party/re2/Makefile b/grpc/third_party/re2/Makefile
index 20b8d0f3..ba5e4f6e 100644
--- a/grpc/third_party/re2/Makefile
+++ b/grpc/third_party/re2/Makefile
@@ -44,7 +44,7 @@ endif
# ABI version
# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
-SONAME=7
+SONAME=9
# To rebuild the Tables generated by Perl and Python scripts (requires Internet
# access for Unicode data), uncomment the following line:
@@ -55,7 +55,7 @@ ifeq ($(shell uname),Darwin)
SOEXT=dylib
SOEXTVER=$(SONAME).$(SOEXT)
SOEXTVER00=$(SONAME).0.0.$(SOEXT)
-MAKE_SHARED_LIBRARY=$(CXX) -dynamiclib -Wl,-install_name,$(libdir)/libre2.$(SOEXTVER),-exported_symbols_list,libre2.symbols.darwin $(RE2_LDFLAGS) $(LDFLAGS)
+MAKE_SHARED_LIBRARY=$(CXX) -dynamiclib -Wl,-compatibility_version,$(SONAME),-current_version,$(SONAME).0.0,-install_name,$(libdir)/libre2.$(SOEXTVER),-exported_symbols_list,libre2.symbols.darwin $(RE2_LDFLAGS) $(LDFLAGS)
else ifeq ($(shell uname),SunOS)
SOEXT=so
SOEXTVER=$(SOEXT).$(SONAME)
@@ -203,7 +203,7 @@ obj/dbg/libre2.a: $(DOFILES)
$(AR) $(ARFLAGS) obj/dbg/libre2.a $(DOFILES)
.PRECIOUS: obj/so/libre2.$(SOEXT)
-obj/so/libre2.$(SOEXT): $(SOFILES)
+obj/so/libre2.$(SOEXT): $(SOFILES) libre2.symbols libre2.symbols.darwin
@mkdir -p obj/so
$(MAKE_SHARED_LIBRARY) -o obj/so/libre2.$(SOEXTVER) $(SOFILES)
ln -sf libre2.$(SOEXTVER) $@
diff --git a/grpc/third_party/re2/README b/grpc/third_party/re2/README
index d1ef431b..caee6afb 100644
--- a/grpc/third_party/re2/README
+++ b/grpc/third_party/re2/README
@@ -27,12 +27,16 @@ under the BSD-style license found in the LICENSE file.
RE2's native language is C++.
+The Python wrapper is at https://github.com/google/re2/tree/abseil/python
+and on PyPI (https://pypi.org/project/google-re2/).
+
A C wrapper is at https://github.com/marcomaggi/cre2/.
+A D wrapper is at https://github.com/ShigekiKarita/re2d/ and on DUB (code.dlang.org).
An Erlang wrapper is at https://github.com/dukesoferl/re2/ and on Hex (hex.pm).
An Inferno wrapper is at https://github.com/powerman/inferno-re2/.
A Node.js wrapper is at https://github.com/uhop/node-re2/ and on NPM (npmjs.com).
An OCaml wrapper is at https://github.com/janestreet/re2/ and on OPAM (opam.ocaml.org).
A Perl wrapper is at https://github.com/dgl/re-engine-RE2/ and on CPAN (cpan.org).
-A Python wrapper is at https://github.com/facebook/pyre2/ and on PyPI (pypi.org).
-An R wrapper is at https://github.com/qinwf/re2r/ and on CRAN (cran.r-project.org).
+An R wrapper is at https://github.com/girishji/re2/ and on CRAN (cran.r-project.org).
A Ruby wrapper is at https://github.com/mudge/re2/ and on RubyGems (rubygems.org).
+A WebAssembly wrapper is at https://github.com/google/re2-wasm/ and on NPM (npmjs.com).
diff --git a/grpc/third_party/re2/SECURITY.md b/grpc/third_party/re2/SECURITY.md
new file mode 100644
index 00000000..39ba0e93
--- /dev/null
+++ b/grpc/third_party/re2/SECURITY.md
@@ -0,0 +1,4 @@
+To report a security issue, please use https://g.co/vulnz. We use
+https://g.co/vulnz for our intake, and do coordination and disclosure here on
+GitHub (including using GitHub Security Advisory). The Google Security Team will
+respond within 5 working days of your report on https://g.co/vulnz.
diff --git a/grpc/third_party/re2/WORKSPACE b/grpc/third_party/re2/WORKSPACE
index 484abfe2..ec1292ee 100644
--- a/grpc/third_party/re2/WORKSPACE
+++ b/grpc/third_party/re2/WORKSPACE
@@ -10,6 +10,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_cc",
- strip_prefix = "rules_cc-master",
- urls = ["https://github.com/bazelbuild/rules_cc/archive/master.zip"],
+ strip_prefix = "rules_cc-main",
+ urls = ["https://github.com/bazelbuild/rules_cc/archive/main.zip"],
)
diff --git a/grpc/third_party/re2/doc/mksyntaxgo b/grpc/third_party/re2/doc/mksyntaxgo
index caad9b60..d30d2814 100755
--- a/grpc/third_party/re2/doc/mksyntaxgo
+++ b/grpc/third_party/re2/doc/mksyntaxgo
@@ -15,7 +15,7 @@ sam -d $out <<'!'
,s/\n\n\n+/\n\n/g
,x/(^.* .*\n)+/ | awk -F' ' '{printf(" %-14s %s\n", $1, $2)}'
1,2c
-// Copyright 2012 The Go Authors. All rights reserved.
+// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -33,6 +33,7 @@ Parts of the syntax can be disabled by passing alternate flags to Parse.
.
$a
+Unicode character classes are those in unicode.Categories and unicode.Scripts.
*/
package syntax
.
diff --git a/grpc/third_party/re2/kokoro/bazel.sh b/grpc/third_party/re2/kokoro/bazel.sh
deleted file mode 100755
index 75edc02a..00000000
--- a/grpc/third_party/re2/kokoro/bazel.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-set -eux
-
-cd git/re2
-
-case "${KOKORO_JOB_NAME}" in
- */windows-*)
- choco upgrade bazel -y -i
- # Pin to Visual Studio 2015, which is the minimum that we support.
- export BAZEL_VC='C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC'
- ;;
- *)
- # Use the script provided by Kokoro.
- use_bazel.sh latest
- ;;
-esac
-
-bazel clean
-bazel build --compilation_mode=dbg -- //:all
-bazel test --compilation_mode=dbg --test_output=errors -- //:all \
- -//:dfa_test \
- -//:exhaustive1_test \
- -//:exhaustive2_test \
- -//:exhaustive3_test \
- -//:exhaustive_test \
- -//:random_test
-
-bazel clean
-bazel build --compilation_mode=opt -- //:all
-bazel test --compilation_mode=opt --test_output=errors -- //:all \
- -//:dfa_test \
- -//:exhaustive1_test \
- -//:exhaustive2_test \
- -//:exhaustive3_test \
- -//:exhaustive_test \
- -//:random_test
-
-exit 0
diff --git a/grpc/third_party/re2/kokoro/cmake.sh b/grpc/third_party/re2/kokoro/cmake.sh
deleted file mode 100755
index 7e355f85..00000000
--- a/grpc/third_party/re2/kokoro/cmake.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-set -eux
-
-cd git/re2
-
-case "${KOKORO_JOB_NAME}" in
- */windows-*)
- export PATH+=':/cygdrive/c/Program Files/CMake/bin'
- # Pin to Visual Studio 2015, which is the minimum that we support.
- CMAKE_G_A_FLAGS=('-G' 'Visual Studio 14 2015' '-A' 'x64')
- ;;
- *)
- CMAKE_G_A_FLAGS=()
- # Work around a bug in older versions of bash. :/
- set +u
- ;;
-esac
-
-cmake -D CMAKE_BUILD_TYPE=Debug "${CMAKE_G_A_FLAGS[@]}" .
-cmake --build . --config Debug --clean-first
-ctest -C Debug --output-on-failure -E 'dfa|exhaustive|random'
-
-cmake -D CMAKE_BUILD_TYPE=Release "${CMAKE_G_A_FLAGS[@]}" .
-cmake --build . --config Release --clean-first
-ctest -C Release --output-on-failure -E 'dfa|exhaustive|random'
-
-exit 0
diff --git a/grpc/third_party/re2/kokoro/macos-bazel.cfg b/grpc/third_party/re2/kokoro/macos-bazel.cfg
deleted file mode 100644
index 79019814..00000000
--- a/grpc/third_party/re2/kokoro/macos-bazel.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/macos-bazel.sh"
diff --git a/grpc/third_party/re2/kokoro/macos-bazel.sh b/grpc/third_party/re2/kokoro/macos-bazel.sh
deleted file mode 100755
index e43c8521..00000000
--- a/grpc/third_party/re2/kokoro/macos-bazel.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-set -eux
-bash git/re2/kokoro/bazel.sh
-exit $?
diff --git a/grpc/third_party/re2/kokoro/macos-cmake.cfg b/grpc/third_party/re2/kokoro/macos-cmake.cfg
deleted file mode 100644
index 5c459e7c..00000000
--- a/grpc/third_party/re2/kokoro/macos-cmake.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/macos-cmake.sh"
diff --git a/grpc/third_party/re2/kokoro/macos-cmake.sh b/grpc/third_party/re2/kokoro/macos-cmake.sh
deleted file mode 100755
index ef4b7dcd..00000000
--- a/grpc/third_party/re2/kokoro/macos-cmake.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-set -eux
-bash git/re2/kokoro/cmake.sh
-exit $?
diff --git a/grpc/third_party/re2/kokoro/ubuntu-bazel.cfg b/grpc/third_party/re2/kokoro/ubuntu-bazel.cfg
deleted file mode 100644
index 884d14f4..00000000
--- a/grpc/third_party/re2/kokoro/ubuntu-bazel.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/ubuntu-bazel.sh"
diff --git a/grpc/third_party/re2/kokoro/ubuntu-bazel.sh b/grpc/third_party/re2/kokoro/ubuntu-bazel.sh
deleted file mode 100755
index e43c8521..00000000
--- a/grpc/third_party/re2/kokoro/ubuntu-bazel.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-set -eux
-bash git/re2/kokoro/bazel.sh
-exit $?
diff --git a/grpc/third_party/re2/kokoro/ubuntu-cmake.cfg b/grpc/third_party/re2/kokoro/ubuntu-cmake.cfg
deleted file mode 100644
index 63d4f915..00000000
--- a/grpc/third_party/re2/kokoro/ubuntu-cmake.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/ubuntu-cmake.sh"
diff --git a/grpc/third_party/re2/kokoro/ubuntu-cmake.sh b/grpc/third_party/re2/kokoro/ubuntu-cmake.sh
deleted file mode 100755
index ef4b7dcd..00000000
--- a/grpc/third_party/re2/kokoro/ubuntu-cmake.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-set -eux
-bash git/re2/kokoro/cmake.sh
-exit $?
diff --git a/grpc/third_party/re2/kokoro/windows-bazel.bat b/grpc/third_party/re2/kokoro/windows-bazel.bat
deleted file mode 100755
index 283f8d21..00000000
--- a/grpc/third_party/re2/kokoro/windows-bazel.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-bash git/re2/kokoro/bazel.sh
-EXIT /B %ERRORLEVEL%
diff --git a/grpc/third_party/re2/kokoro/windows-bazel.cfg b/grpc/third_party/re2/kokoro/windows-bazel.cfg
deleted file mode 100644
index 18b1ed73..00000000
--- a/grpc/third_party/re2/kokoro/windows-bazel.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/windows-bazel.bat"
diff --git a/grpc/third_party/re2/kokoro/windows-cmake.bat b/grpc/third_party/re2/kokoro/windows-cmake.bat
deleted file mode 100755
index 77a4db9d..00000000
--- a/grpc/third_party/re2/kokoro/windows-cmake.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-bash git/re2/kokoro/cmake.sh
-EXIT /B %ERRORLEVEL%
diff --git a/grpc/third_party/re2/kokoro/windows-cmake.cfg b/grpc/third_party/re2/kokoro/windows-cmake.cfg
deleted file mode 100644
index 4453eb6e..00000000
--- a/grpc/third_party/re2/kokoro/windows-cmake.cfg
+++ /dev/null
@@ -1 +0,0 @@
-build_file: "re2/kokoro/windows-cmake.bat"
diff --git a/grpc/third_party/re2/libre2.symbols b/grpc/third_party/re2/libre2.symbols
index 8308b648..93b71b48 100644
--- a/grpc/third_party/re2/libre2.symbols
+++ b/grpc/third_party/re2/libre2.symbols
@@ -11,6 +11,9 @@
# re2::FilteredRE2*
_ZN3re211FilteredRE2*;
_ZNK3re211FilteredRE2*;
+ # re2::re2_internal*
+ _ZN3re212re2_internal*;
+ _ZNK3re212re2_internal*;
local:
*;
};
diff --git a/grpc/third_party/re2/libre2.symbols.darwin b/grpc/third_party/re2/libre2.symbols.darwin
index 31e8c522..41ac96f9 100644
--- a/grpc/third_party/re2/libre2.symbols.darwin
+++ b/grpc/third_party/re2/libre2.symbols.darwin
@@ -10,3 +10,6 @@ __ZN3re2ls*
# re2::FilteredRE2*
__ZN3re211FilteredRE2*
__ZNK3re211FilteredRE2*
+# re2::re2_internal*
+__ZN3re212re2_internal*
+__ZNK3re212re2_internal*
diff --git a/grpc/third_party/re2/re2/compile.cc b/grpc/third_party/re2/re2/compile.cc
index 30e55f5e..61d801a6 100644
--- a/grpc/third_party/re2/re2/compile.cc
+++ b/grpc/third_party/re2/re2/compile.cc
@@ -30,92 +30,60 @@ namespace re2 {
// See http://swtch.com/~rsc/regexp/regexp1.html for inspiration.
//
// Because the out and out1 fields in Inst are no longer pointers,
-// we can't use pointers directly here either. Instead, p refers
-// to inst_[p>>1].out (p&1 == 0) or inst_[p>>1].out1 (p&1 == 1).
-// p == 0 represents the NULL list. This is okay because instruction #0
+// we can't use pointers directly here either. Instead, head refers
+// to inst_[head>>1].out (head&1 == 0) or inst_[head>>1].out1 (head&1 == 1).
+// head == 0 represents the NULL list. This is okay because instruction #0
// is always the fail instruction, which never appears on a list.
-
struct PatchList {
- uint32_t p;
-
// Returns patch list containing just p.
- static PatchList Mk(uint32_t p);
+ static PatchList Mk(uint32_t p) {
+ return {p, p};
+ }
- // Patches all the entries on l to have value v.
+ // Patches all the entries on l to have value p.
// Caller must not ever use patch list again.
- static void Patch(Prog::Inst *inst0, PatchList l, uint32_t v);
-
- // Deref returns the next pointer pointed at by p.
- static PatchList Deref(Prog::Inst *inst0, PatchList l);
-
- // Appends two patch lists and returns result.
- static PatchList Append(Prog::Inst *inst0, PatchList l1, PatchList l2);
-};
-
-static PatchList nullPatchList = { 0 };
-
-// Returns patch list containing just p.
-PatchList PatchList::Mk(uint32_t p) {
- PatchList l;
- l.p = p;
- return l;
-}
-
-// Returns the next pointer pointed at by l.
-PatchList PatchList::Deref(Prog::Inst* inst0, PatchList l) {
- Prog::Inst* ip = &inst0[l.p>>1];
- if (l.p&1)
- l.p = ip->out1();
- else
- l.p = ip->out();
- return l;
-}
-
-// Patches all the entries on l to have value v.
-void PatchList::Patch(Prog::Inst *inst0, PatchList l, uint32_t val) {
- while (l.p != 0) {
- Prog::Inst* ip = &inst0[l.p>>1];
- if (l.p&1) {
- l.p = ip->out1();
- ip->out1_ = val;
- } else {
- l.p = ip->out();
- ip->set_out(val);
+ static void Patch(Prog::Inst* inst0, PatchList l, uint32_t p) {
+ while (l.head != 0) {
+ Prog::Inst* ip = &inst0[l.head>>1];
+ if (l.head&1) {
+ l.head = ip->out1();
+ ip->out1_ = p;
+ } else {
+ l.head = ip->out();
+ ip->set_out(p);
+ }
}
}
-}
-// Appends two patch lists and returns result.
-PatchList PatchList::Append(Prog::Inst* inst0, PatchList l1, PatchList l2) {
- if (l1.p == 0)
- return l2;
- if (l2.p == 0)
- return l1;
-
- PatchList l = l1;
- for (;;) {
- PatchList next = PatchList::Deref(inst0, l);
- if (next.p == 0)
- break;
- l = next;
+ // Appends two patch lists and returns result.
+ static PatchList Append(Prog::Inst* inst0, PatchList l1, PatchList l2) {
+ if (l1.head == 0)
+ return l2;
+ if (l2.head == 0)
+ return l1;
+ Prog::Inst* ip = &inst0[l1.tail>>1];
+ if (l1.tail&1)
+ ip->out1_ = l2.head;
+ else
+ ip->set_out(l2.head);
+ return {l1.head, l2.tail};
}
- Prog::Inst* ip = &inst0[l.p>>1];
- if (l.p&1)
- ip->out1_ = l2.p;
- else
- ip->set_out(l2.p);
+ uint32_t head;
+ uint32_t tail; // for constant-time append
+};
- return l1;
-}
+static const PatchList kNullPatchList = {0, 0};
// Compiled program fragment.
struct Frag {
uint32_t begin;
PatchList end;
+ bool nullable;
- Frag() : begin(0) { end.p = 0; } // needed so Frag can go in vector
- Frag(uint32_t begin, PatchList end) : begin(begin), end(end) {}
+ Frag() : begin(0), end(kNullPatchList), nullable(false) {}
+ Frag(uint32_t begin, PatchList end, bool nullable)
+ : begin(begin), end(end), nullable(nullable) {}
};
// Input encodings.
@@ -212,8 +180,8 @@ class Compiler : public Regexp::Walker<Frag> {
int AddSuffixRecursive(int root, int id);
// Finds the trie node for the given suffix. Returns a Frag in order to
- // distinguish between pointing at the root node directly (end.p == 0)
- // and pointing at an Alt's out1 or out (end.p&1 == 1 or 0, respectively).
+ // distinguish between pointing at the root node directly (end.head == 0)
+ // and pointing at an Alt's out1 or out (end.head&1 == 1 or 0, respectively).
Frag FindByteRange(int root, int id);
// Compares two ByteRanges and returns true iff they are equal.
@@ -298,7 +266,7 @@ int Compiler::AllocInst(int n) {
// Returns an unmatchable fragment.
Frag Compiler::NoMatch() {
- return Frag(0, nullPatchList);
+ return Frag();
}
// Is a an unmatchable fragment?
@@ -314,7 +282,7 @@ Frag Compiler::Cat(Frag a, Frag b) {
// Elide no-op.
Prog::Inst* begin = &inst_[a.begin];
if (begin->opcode() == kInstNop &&
- a.end.p == (a.begin << 1) &&
+ a.end.head == (a.begin << 1) &&
begin->out() == 0) {
// in case refs to a somewhere
PatchList::Patch(inst_.data(), a.end, b.begin);
@@ -324,11 +292,11 @@ Frag Compiler::Cat(Frag a, Frag b) {
// To run backward over string, reverse all concatenations.
if (reversed_) {
PatchList::Patch(inst_.data(), b.end, a.begin);
- return Frag(b.begin, a.end);
+ return Frag(b.begin, a.end, b.nullable && a.nullable);
}
PatchList::Patch(inst_.data(), a.end, b.begin);
- return Frag(a.begin, b.end);
+ return Frag(a.begin, b.end, a.nullable && b.nullable);
}
// Given fragments for a and b, returns fragment for a|b.
@@ -344,7 +312,8 @@ Frag Compiler::Alt(Frag a, Frag b) {
return NoMatch();
inst_[id].InitAlt(a.begin, b.begin);
- return Frag(id, PatchList::Append(inst_.data(), a.end, b.end));
+ return Frag(id, PatchList::Append(inst_.data(), a.end, b.end),
+ a.nullable || b.nullable);
}
// When capturing submatches in like-Perl mode, a kOpAlt Inst
@@ -354,27 +323,44 @@ Frag Compiler::Alt(Frag a, Frag b) {
// then the operator is greedy. If out1_ is the repetition
// (and out_ moves forward), then the operator is non-greedy.
-// Given a fragment a, returns a fragment for a* or a*? (if nongreedy)
-Frag Compiler::Star(Frag a, bool nongreedy) {
+// Given a fragment for a, returns a fragment for a+ or a+? (if nongreedy)
+Frag Compiler::Plus(Frag a, bool nongreedy) {
int id = AllocInst(1);
if (id < 0)
return NoMatch();
- inst_[id].InitAlt(0, 0);
- PatchList::Patch(inst_.data(), a.end, id);
+ PatchList pl;
if (nongreedy) {
- inst_[id].out1_ = a.begin;
- return Frag(id, PatchList::Mk(id << 1));
+ inst_[id].InitAlt(0, a.begin);
+ pl = PatchList::Mk(id << 1);
} else {
- inst_[id].set_out(a.begin);
- return Frag(id, PatchList::Mk((id << 1) | 1));
+ inst_[id].InitAlt(a.begin, 0);
+ pl = PatchList::Mk((id << 1) | 1);
}
+ PatchList::Patch(inst_.data(), a.end, id);
+ return Frag(a.begin, pl, a.nullable);
}
-// Given a fragment for a, returns a fragment for a+ or a+? (if nongreedy)
-Frag Compiler::Plus(Frag a, bool nongreedy) {
- // a+ is just a* with a different entry point.
- Frag f = Star(a, nongreedy);
- return Frag(a.begin, f.end);
+// Given a fragment for a, returns a fragment for a* or a*? (if nongreedy)
+Frag Compiler::Star(Frag a, bool nongreedy) {
+ // When the subexpression is nullable, one Alt isn't enough to guarantee
+ // correct priority ordering within the transitive closure. The simplest
+ // solution is to handle it as (a+)? instead, which adds the second Alt.
+ if (a.nullable)
+ return Quest(Plus(a, nongreedy), nongreedy);
+
+ int id = AllocInst(1);
+ if (id < 0)
+ return NoMatch();
+ PatchList pl;
+ if (nongreedy) {
+ inst_[id].InitAlt(0, a.begin);
+ pl = PatchList::Mk(id << 1);
+ } else {
+ inst_[id].InitAlt(a.begin, 0);
+ pl = PatchList::Mk((id << 1) | 1);
+ }
+ PatchList::Patch(inst_.data(), a.end, id);
+ return Frag(id, pl, true);
}
// Given a fragment for a, returns a fragment for a? or a?? (if nongreedy)
@@ -392,7 +378,7 @@ Frag Compiler::Quest(Frag a, bool nongreedy) {
inst_[id].InitAlt(a.begin, 0);
pl = PatchList::Mk((id << 1) | 1);
}
- return Frag(id, PatchList::Append(inst_.data(), pl, a.end));
+ return Frag(id, PatchList::Append(inst_.data(), pl, a.end), true);
}
// Returns a fragment for the byte range lo-hi.
@@ -401,7 +387,7 @@ Frag Compiler::ByteRange(int lo, int hi, bool foldcase) {
if (id < 0)
return NoMatch();
inst_[id].InitByteRange(lo, hi, foldcase, 0);
- return Frag(id, PatchList::Mk(id << 1));
+ return Frag(id, PatchList::Mk(id << 1), false);
}
// Returns a no-op fragment. Sometimes unavoidable.
@@ -410,7 +396,7 @@ Frag Compiler::Nop() {
if (id < 0)
return NoMatch();
inst_[id].InitNop(0);
- return Frag(id, PatchList::Mk(id << 1));
+ return Frag(id, PatchList::Mk(id << 1), true);
}
// Returns a fragment that signals a match.
@@ -419,7 +405,7 @@ Frag Compiler::Match(int32_t match_id) {
if (id < 0)
return NoMatch();
inst_[id].InitMatch(match_id);
- return Frag(id, nullPatchList);
+ return Frag(id, kNullPatchList, false);
}
// Returns a fragment matching a particular empty-width op (like ^ or $)
@@ -428,7 +414,7 @@ Frag Compiler::EmptyWidth(EmptyOp empty) {
if (id < 0)
return NoMatch();
inst_[id].InitEmptyWidth(empty, 0);
- return Frag(id, PatchList::Mk(id << 1));
+ return Frag(id, PatchList::Mk(id << 1), true);
}
// Given a fragment a, returns a fragment with capturing parens around a.
@@ -442,7 +428,7 @@ Frag Compiler::Capture(Frag a, int n) {
inst_[id+1].InitCapture(2*n+1, 0);
PatchList::Patch(inst_.data(), a.end, id+1);
- return Frag(id, PatchList::Mk((id+1) << 1));
+ return Frag(id, PatchList::Mk((id+1) << 1), a.nullable);
}
// A Rune is a name for a Unicode code point.
@@ -467,7 +453,7 @@ static int MaxRune(int len) {
void Compiler::BeginRange() {
rune_cache_.clear();
rune_range_.begin = 0;
- rune_range_.end = nullPatchList;
+ rune_range_.end = kNullPatchList;
}
int Compiler::UncachedRuneByteSuffix(uint8_t lo, uint8_t hi, bool foldcase,
@@ -548,9 +534,9 @@ int Compiler::AddSuffixRecursive(int root, int id) {
}
int br;
- if (f.end.p == 0)
+ if (f.end.head == 0)
br = root;
- else if (f.end.p&1)
+ else if (f.end.head&1)
br = inst_[f.begin].out1();
else
br = inst_[f.begin].out();
@@ -566,9 +552,9 @@ int Compiler::AddSuffixRecursive(int root, int id) {
// Ensure that the parent points to the clone, not to the original.
// Note that this could leave the head unreachable except via the cache.
br = byterange;
- if (f.end.p == 0)
+ if (f.end.head == 0)
root = br;
- else if (f.end.p&1)
+ else if (f.end.head&1)
inst_[f.begin].out1_ = br;
else
inst_[f.begin].set_out(br);
@@ -601,7 +587,7 @@ bool Compiler::ByteRangeEqual(int id1, int id2) {
Frag Compiler::FindByteRange(int root, int id) {
if (inst_[root].opcode() == kInstByteRange) {
if (ByteRangeEqual(root, id))
- return Frag(root, nullPatchList);
+ return Frag(root, kNullPatchList, false);
else
return NoMatch();
}
@@ -609,7 +595,7 @@ Frag Compiler::FindByteRange(int root, int id) {
while (inst_[root].opcode() == kInstAlt) {
int out1 = inst_[root].out1();
if (ByteRangeEqual(out1, id))
- return Frag(root, PatchList::Mk((root << 1) | 1));
+ return Frag(root, PatchList::Mk((root << 1) | 1), false);
// CharClass is a sorted list of ranges, so if out1 of the root Alt wasn't
// what we're looking for, then we can stop immediately. Unfortunately, we
@@ -621,7 +607,7 @@ Frag Compiler::FindByteRange(int root, int id) {
if (inst_[out].opcode() == kInstAlt)
root = out;
else if (ByteRangeEqual(out, id))
- return Frag(root, PatchList::Mk(root << 1));
+ return Frag(root, PatchList::Mk(root << 1), false);
else
return NoMatch();
}
@@ -1190,12 +1176,8 @@ Prog* Compiler::Finish(Regexp* re) {
if (!prog_->reversed()) {
std::string prefix;
bool prefix_foldcase;
- if (re->RequiredPrefixForAccel(&prefix, &prefix_foldcase) &&
- !prefix_foldcase) {
- prog_->prefix_size_ = prefix.size();
- prog_->prefix_front_ = prefix.front();
- prog_->prefix_back_ = prefix.back();
- }
+ if (re->RequiredPrefixForAccel(&prefix, &prefix_foldcase))
+ prog_->ConfigurePrefixAccel(prefix, prefix_foldcase);
}
// Record remaining memory for DFA.
diff --git a/grpc/third_party/re2/re2/dfa.cc b/grpc/third_party/re2/re2/dfa.cc
index b25cc97f..583303ee 100644
--- a/grpc/third_party/re2/re2/dfa.cc
+++ b/grpc/third_party/re2/re2/dfa.cc
@@ -56,6 +56,10 @@ namespace re2 {
// Controls whether the DFA should bail out early if the NFA would be faster.
static bool dfa_should_bail_when_slow = true;
+void Prog::TESTING_ONLY_set_dfa_should_bail_when_slow(bool b) {
+ dfa_should_bail_when_slow = b;
+}
+
// Changing this to true compiles in prints that trace execution of the DFA.
// Generates a lot of output -- only useful for debugging.
static const bool ExtraDebug = false;
@@ -167,6 +171,9 @@ class DFA {
typedef std::unordered_set<State*, StateHash, StateEqual> StateSet;
private:
+ // Make it easier to swap in a scalable reader-writer mutex.
+ using CacheMutex = Mutex;
+
enum {
// Indices into start_ for unanchored searches.
// Add kStartAnchored for anchored searches.
@@ -280,10 +287,10 @@ class DFA {
// The generic search loop, inlined to create specialized versions.
// cache_mutex_.r <= L < mutex_
// Might unlock and relock cache_mutex_ via params->cache_lock.
- inline bool InlinedSearchLoop(SearchParams* params,
- bool can_prefix_accel,
- bool want_earliest_match,
- bool run_forward);
+ template <bool can_prefix_accel,
+ bool want_earliest_match,
+ bool run_forward>
+ inline bool InlinedSearchLoop(SearchParams* params);
// The specialized versions of InlinedSearchLoop. The three letters
// at the ends of the name denote the true/false values used as the
@@ -305,13 +312,6 @@ class DFA {
// Might unlock and relock cache_mutex_ via params->cache_lock.
bool FastSearchLoop(SearchParams* params);
- // For debugging, a slow search loop that calls InlinedSearchLoop
- // directly -- because the booleans passed are not constants, the
- // loop is not specialized like the SearchFFF etc. versions, so it
- // runs much more slowly. Useful only for debugging.
- // cache_mutex_.r <= L < mutex_
- // Might unlock and relock cache_mutex_ via params->cache_lock.
- bool SlowSearchLoop(SearchParams* params);
// Looks up bytes in bytemap_ but handles case c == kByteEndText too.
int ByteMap(int c) {
@@ -338,7 +338,7 @@ class DFA {
// while holding cache_mutex_ for writing, to avoid interrupting other
// readers. Any State* pointers are only valid while cache_mutex_
// is held.
- Mutex cache_mutex_;
+ CacheMutex cache_mutex_;
int64_t mem_budget_; // Total memory budget for all States.
int64_t state_budget_; // Amount of memory remaining for new States.
StateSet state_cache_; // All States computed so far.
@@ -1113,7 +1113,7 @@ DFA::State* DFA::RunStateOnByte(State* state, int c) {
class DFA::RWLocker {
public:
- explicit RWLocker(Mutex* mu);
+ explicit RWLocker(CacheMutex* mu);
~RWLocker();
// If the lock is only held for reading right now,
@@ -1123,14 +1123,14 @@ class DFA::RWLocker {
void LockForWriting();
private:
- Mutex* mu_;
+ CacheMutex* mu_;
bool writing_;
RWLocker(const RWLocker&) = delete;
RWLocker& operator=(const RWLocker&) = delete;
};
-DFA::RWLocker::RWLocker(Mutex* mu) : mu_(mu), writing_(false) {
+DFA::RWLocker::RWLocker(CacheMutex* mu) : mu_(mu), writing_(false) {
mu_->ReaderLock();
}
@@ -1321,10 +1321,10 @@ DFA::State* DFA::StateSaver::Restore() {
// The bools are equal to the same-named variables in params, but
// making them function arguments lets the inliner specialize
// this function to each combination (see two paragraphs above).
-inline bool DFA::InlinedSearchLoop(SearchParams* params,
- bool can_prefix_accel,
- bool want_earliest_match,
- bool run_forward) {
+template <bool can_prefix_accel,
+ bool want_earliest_match,
+ bool run_forward>
+inline bool DFA::InlinedSearchLoop(SearchParams* params) {
State* start = params->start;
const uint8_t* bp = BytePtr(params->text.data()); // start of text
const uint8_t* p = bp; // text scanning point
@@ -1549,36 +1549,28 @@ inline bool DFA::InlinedSearchLoop(SearchParams* params,
// Inline specializations of the general loop.
bool DFA::SearchFFF(SearchParams* params) {
- return InlinedSearchLoop(params, 0, 0, 0);
+ return InlinedSearchLoop<false, false, false>(params);
}
bool DFA::SearchFFT(SearchParams* params) {
- return InlinedSearchLoop(params, 0, 0, 1);
+ return InlinedSearchLoop<false, false, true>(params);
}
bool DFA::SearchFTF(SearchParams* params) {
- return InlinedSearchLoop(params, 0, 1, 0);
+ return InlinedSearchLoop<false, true, false>(params);
}
bool DFA::SearchFTT(SearchParams* params) {
- return InlinedSearchLoop(params, 0, 1, 1);
+ return InlinedSearchLoop<false, true, true>(params);
}
bool DFA::SearchTFF(SearchParams* params) {
- return InlinedSearchLoop(params, 1, 0, 0);
+ return InlinedSearchLoop<true, false, false>(params);
}
bool DFA::SearchTFT(SearchParams* params) {
- return InlinedSearchLoop(params, 1, 0, 1);
+ return InlinedSearchLoop<true, false, true>(params);
}
bool DFA::SearchTTF(SearchParams* params) {
- return InlinedSearchLoop(params, 1, 1, 0);
+ return InlinedSearchLoop<true, true, false>(params);
}
bool DFA::SearchTTT(SearchParams* params) {
- return InlinedSearchLoop(params, 1, 1, 1);
-}
-
-// For debugging, calls the general code directly.
-bool DFA::SlowSearchLoop(SearchParams* params) {
- return InlinedSearchLoop(params,
- params->can_prefix_accel,
- params->want_earliest_match,
- params->run_forward);
+ return InlinedSearchLoop<true, true, true>(params);
}
// For performance, calls the appropriate specialized version
@@ -1978,10 +1970,6 @@ int Prog::BuildEntireDFA(MatchKind kind, const DFAStateCallback& cb) {
return GetDFA(kind)->BuildAllStates(cb);
}
-void Prog::TEST_dfa_should_bail_when_slow(bool b) {
- dfa_should_bail_when_slow = b;
-}
-
// Computes min and max for matching string.
// Won't return strings bigger than maxlen.
bool DFA::PossibleMatchRange(std::string* min, std::string* max, int maxlen) {
diff --git a/grpc/third_party/re2/re2/filtered_re2.cc b/grpc/third_party/re2/re2/filtered_re2.cc
index e5d8de5c..5df97456 100644
--- a/grpc/third_party/re2/re2/filtered_re2.cc
+++ b/grpc/third_party/re2/re2/filtered_re2.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
#include <string>
+#include <utility>
#include "util/util.h"
#include "util/logging.h"
@@ -27,7 +28,22 @@ FilteredRE2::FilteredRE2(int min_atom_len)
FilteredRE2::~FilteredRE2() {
for (size_t i = 0; i < re2_vec_.size(); i++)
delete re2_vec_[i];
- delete prefilter_tree_;
+}
+
+FilteredRE2::FilteredRE2(FilteredRE2&& other)
+ : re2_vec_(std::move(other.re2_vec_)),
+ compiled_(other.compiled_),
+ prefilter_tree_(std::move(other.prefilter_tree_)) {
+ other.re2_vec_.clear();
+ other.re2_vec_.shrink_to_fit();
+ other.compiled_ = false;
+ other.prefilter_tree_.reset(new PrefilterTree());
+}
+
+FilteredRE2& FilteredRE2::operator=(FilteredRE2&& other) {
+ this->~FilteredRE2();
+ (void) new (this) FilteredRE2(std::move(other));
+ return *this;
}
RE2::ErrorCode FilteredRE2::Add(const StringPiece& pattern,
@@ -38,7 +54,7 @@ RE2::ErrorCode FilteredRE2::Add(const StringPiece& pattern,
if (!re->ok()) {
if (options.log_errors()) {
LOG(ERROR) << "Couldn't compile regular expression, skipping: "
- << re << " due to error " << re->error();
+ << pattern << " due to error " << re->error();
}
delete re;
} else {
diff --git a/grpc/third_party/re2/re2/filtered_re2.h b/grpc/third_party/re2/re2/filtered_re2.h
index 86fa5868..dd618c70 100644
--- a/grpc/third_party/re2/re2/filtered_re2.h
+++ b/grpc/third_party/re2/re2/filtered_re2.h
@@ -21,6 +21,7 @@
// or AllMatches with a vector of indices of strings that were found
// in the text to get the actual regexp matches.
+#include <memory>
#include <string>
#include <vector>
@@ -36,12 +37,19 @@ class FilteredRE2 {
explicit FilteredRE2(int min_atom_len);
~FilteredRE2();
+ // Not copyable.
+ FilteredRE2(const FilteredRE2&) = delete;
+ FilteredRE2& operator=(const FilteredRE2&) = delete;
+ // Movable.
+ FilteredRE2(FilteredRE2&& other);
+ FilteredRE2& operator=(FilteredRE2&& other);
+
// Uses RE2 constructor to create a RE2 object (re). Returns
// re->error_code(). If error_code is other than NoError, then re is
// deleted and not added to re2_vec_.
RE2::ErrorCode Add(const StringPiece& pattern,
const RE2::Options& options,
- int *id);
+ int* id);
// Prepares the regexps added by Add for filtering. Returns a set
// of strings that the caller should check for in candidate texts.
@@ -98,10 +106,7 @@ class FilteredRE2 {
bool compiled_;
// An AND-OR tree of string atoms used for filtering regexps.
- PrefilterTree* prefilter_tree_;
-
- FilteredRE2(const FilteredRE2&) = delete;
- FilteredRE2& operator=(const FilteredRE2&) = delete;
+ std::unique_ptr<PrefilterTree> prefilter_tree_;
};
} // namespace re2
diff --git a/grpc/third_party/re2/re2/fuzzing/re2_fuzzer.cc b/grpc/third_party/re2/re2/fuzzing/re2_fuzzer.cc
index 8306f887..af1129f2 100644
--- a/grpc/third_party/re2/re2/fuzzing/re2_fuzzer.cc
+++ b/grpc/third_party/re2/re2/fuzzing/re2_fuzzer.cc
@@ -12,6 +12,7 @@
#include "re2/prefilter.h"
#include "re2/re2.h"
+#include "re2/regexp.h"
using re2::StringPiece;
@@ -50,6 +51,10 @@ void TestOneInput(StringPiece pattern, const RE2::Options& options,
if (backslash_p > 1)
return;
+ // The default is 1000. Even 100 turned out to be too generous
+ // for fuzzing, empirically speaking, so let's try 10 instead.
+ re2::Regexp::FUZZING_ONLY_set_maximum_repeat_count(10);
+
RE2 re(pattern, options);
if (!re.ok())
return;
diff --git a/grpc/third_party/re2/re2/make_perl_groups.pl b/grpc/third_party/re2/re2/make_perl_groups.pl
index d9fcdafa..ed0d509d 100755
--- a/grpc/third_party/re2/re2/make_perl_groups.pl
+++ b/grpc/third_party/re2/re2/make_perl_groups.pl
@@ -76,7 +76,7 @@ sub PrintClass($$@) {
} else {
$negname =~ y/a-z/A-Z/;
}
- return "{ \"$escname\", +1, code$cnum, $n }", "{ \"$negname\", -1, code$cnum, $n }";
+ return "{ \"$escname\", +1, code$cnum, $n, 0, 0 }", "{ \"$negname\", -1, code$cnum, $n, 0, 0 }";
}
my $cnum = 0;
diff --git a/grpc/third_party/re2/re2/nfa.cc b/grpc/third_party/re2/re2/nfa.cc
index 19ee08de..e858451c 100644
--- a/grpc/third_party/re2/re2/nfa.cc
+++ b/grpc/third_party/re2/re2/nfa.cc
@@ -600,7 +600,7 @@ bool NFA::Search(const StringPiece& text, const StringPiece& const_context,
// by simply not continuing the loop.
// This complements the special case in NFA::Step().
if (p == NULL) {
- (void)Step(runq, nextq, p < etext_ ? p[0] & 0xFF : -1, context, p);
+ (void) Step(runq, nextq, -1, context, p);
DCHECK_EQ(runq->size(), 0);
using std::swap;
swap(nextq, runq);
diff --git a/grpc/third_party/re2/re2/parse.cc b/grpc/third_party/re2/re2/parse.cc
index e741603d..85f16f06 100644
--- a/grpc/third_party/re2/re2/parse.cc
+++ b/grpc/third_party/re2/re2/parse.cc
@@ -44,12 +44,12 @@
namespace re2 {
-// Reduce the maximum repeat count by an order of magnitude when fuzzing.
-#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-static const int kMaxRepeat = 100;
-#else
-static const int kMaxRepeat = 1000;
-#endif
+// Controls the maximum repeat count permitted by the parser.
+static int maximum_repeat_count = 1000;
+
+void Regexp::FUZZING_ONLY_set_maximum_repeat_count(int i) {
+ maximum_repeat_count = i;
+}
// Regular expression parse state.
// The list of parsed regexps so far is maintained as a vector of
@@ -568,7 +568,9 @@ int RepetitionWalker::ShortVisit(Regexp* re, int parent_arg) {
bool Regexp::ParseState::PushRepetition(int min, int max,
const StringPiece& s,
bool nongreedy) {
- if ((max != -1 && max < min) || min > kMaxRepeat || max > kMaxRepeat) {
+ if ((max != -1 && max < min) ||
+ min > maximum_repeat_count ||
+ max > maximum_repeat_count) {
status_->set_code(kRegexpRepeatSize);
status_->set_error_arg(s);
return false;
@@ -591,7 +593,7 @@ bool Regexp::ParseState::PushRepetition(int min, int max,
stacktop_ = re;
if (min >= 2 || max >= 2) {
RepetitionWalker w;
- if (w.Walk(stacktop_, kMaxRepeat) == 0) {
+ if (w.Walk(stacktop_, maximum_repeat_count) == 0) {
status_->set_code(kRegexpRepeatSize);
status_->set_error_arg(s);
return false;
@@ -685,7 +687,7 @@ bool Regexp::ParseState::DoRightParen() {
if ((r1 = stacktop_) == NULL ||
(r2 = r1->down_) == NULL ||
r2->op() != kLeftParen) {
- status_->set_code(kRegexpMissingParen);
+ status_->set_code(kRegexpUnexpectedParen);
status_->set_error_arg(whole_regexp_);
return false;
}
@@ -1407,13 +1409,15 @@ static int StringPieceToRune(Rune *r, StringPiece *sp, RegexpStatus* status) {
}
}
- status->set_code(kRegexpBadUTF8);
- status->set_error_arg(StringPiece());
+ if (status != NULL) {
+ status->set_code(kRegexpBadUTF8);
+ status->set_error_arg(StringPiece());
+ }
return -1;
}
-// Return whether name is valid UTF-8.
-// If not, set status to kRegexpBadUTF8.
+// Returns whether name is valid UTF-8.
+// If not, sets status to kRegexpBadUTF8.
static bool IsValidUTF8(const StringPiece& s, RegexpStatus* status) {
StringPiece t = s;
Rune r;
@@ -2011,19 +2015,34 @@ bool Regexp::ParseState::ParseCharClass(StringPiece* s,
return true;
}
-// Is this a valid capture name? [A-Za-z0-9_]+
-// PCRE limits names to 32 bytes.
-// Python rejects names starting with digits.
-// We don't enforce either of those.
+// Returns whether name is a valid capture name.
static bool IsValidCaptureName(const StringPiece& name) {
if (name.empty())
return false;
- for (size_t i = 0; i < name.size(); i++) {
- int c = name[i];
- if (('0' <= c && c <= '9') ||
- ('a' <= c && c <= 'z') ||
- ('A' <= c && c <= 'Z') ||
- c == '_')
+
+ // Historically, we effectively used [0-9A-Za-z_]+ to validate; that
+ // followed Python 2 except for not restricting the first character.
+ // As of Python 3, Unicode characters beyond ASCII are also allowed;
+ // accordingly, we permit the Lu, Ll, Lt, Lm, Lo, Nl, Mn, Mc, Nd and
+ // Pc categories, but again without restricting the first character.
+ // Also, Unicode normalization (e.g. NFKC) isn't performed: Python 3
+ // performs it for identifiers, but seemingly not for capture names;
+ // if they start doing that for capture names, we won't follow suit.
+ static const CharClass* const cc = []() {
+ CharClassBuilder ccb;
+ for (StringPiece group :
+ {"Lu", "Ll", "Lt", "Lm", "Lo", "Nl", "Mn", "Mc", "Nd", "Pc"})
+ AddUGroup(&ccb, LookupGroup(group, unicode_groups, num_unicode_groups),
+ +1, Regexp::NoParseFlags);
+ return ccb.GetCharClass();
+ }();
+
+ StringPiece t = name;
+ Rune r;
+ while (!t.empty()) {
+ if (StringPieceToRune(&r, &t, NULL) < 0)
+ return false;
+ if (cc->Contains(r))
continue;
return false;
}
diff --git a/grpc/third_party/re2/re2/perl_groups.cc b/grpc/third_party/re2/re2/perl_groups.cc
index 422b3882..46874445 100644
--- a/grpc/third_party/re2/re2/perl_groups.cc
+++ b/grpc/third_party/re2/re2/perl_groups.cc
@@ -20,12 +20,12 @@ static const URange16 code3[] = { /* \w */
{ 0x61, 0x7a },
};
const UGroup perl_groups[] = {
- { "\\d", +1, code1, 1 },
- { "\\D", -1, code1, 1 },
- { "\\s", +1, code2, 3 },
- { "\\S", -1, code2, 3 },
- { "\\w", +1, code3, 4 },
- { "\\W", -1, code3, 4 },
+ { "\\d", +1, code1, 1, 0, 0 },
+ { "\\D", -1, code1, 1, 0, 0 },
+ { "\\s", +1, code2, 3, 0, 0 },
+ { "\\S", -1, code2, 3, 0, 0 },
+ { "\\w", +1, code3, 4, 0, 0 },
+ { "\\W", -1, code3, 4, 0, 0 },
};
const int num_perl_groups = 6;
static const URange16 code4[] = { /* [:alnum:] */
@@ -85,34 +85,34 @@ static const URange16 code17[] = { /* [:xdigit:] */
{ 0x61, 0x66 },
};
const UGroup posix_groups[] = {
- { "[:alnum:]", +1, code4, 3 },
- { "[:^alnum:]", -1, code4, 3 },
- { "[:alpha:]", +1, code5, 2 },
- { "[:^alpha:]", -1, code5, 2 },
- { "[:ascii:]", +1, code6, 1 },
- { "[:^ascii:]", -1, code6, 1 },
- { "[:blank:]", +1, code7, 2 },
- { "[:^blank:]", -1, code7, 2 },
- { "[:cntrl:]", +1, code8, 2 },
- { "[:^cntrl:]", -1, code8, 2 },
- { "[:digit:]", +1, code9, 1 },
- { "[:^digit:]", -1, code9, 1 },
- { "[:graph:]", +1, code10, 1 },
- { "[:^graph:]", -1, code10, 1 },
- { "[:lower:]", +1, code11, 1 },
- { "[:^lower:]", -1, code11, 1 },
- { "[:print:]", +1, code12, 1 },
- { "[:^print:]", -1, code12, 1 },
- { "[:punct:]", +1, code13, 4 },
- { "[:^punct:]", -1, code13, 4 },
- { "[:space:]", +1, code14, 2 },
- { "[:^space:]", -1, code14, 2 },
- { "[:upper:]", +1, code15, 1 },
- { "[:^upper:]", -1, code15, 1 },
- { "[:word:]", +1, code16, 4 },
- { "[:^word:]", -1, code16, 4 },
- { "[:xdigit:]", +1, code17, 3 },
- { "[:^xdigit:]", -1, code17, 3 },
+ { "[:alnum:]", +1, code4, 3, 0, 0 },
+ { "[:^alnum:]", -1, code4, 3, 0, 0 },
+ { "[:alpha:]", +1, code5, 2, 0, 0 },
+ { "[:^alpha:]", -1, code5, 2, 0, 0 },
+ { "[:ascii:]", +1, code6, 1, 0, 0 },
+ { "[:^ascii:]", -1, code6, 1, 0, 0 },
+ { "[:blank:]", +1, code7, 2, 0, 0 },
+ { "[:^blank:]", -1, code7, 2, 0, 0 },
+ { "[:cntrl:]", +1, code8, 2, 0, 0 },
+ { "[:^cntrl:]", -1, code8, 2, 0, 0 },
+ { "[:digit:]", +1, code9, 1, 0, 0 },
+ { "[:^digit:]", -1, code9, 1, 0, 0 },
+ { "[:graph:]", +1, code10, 1, 0, 0 },
+ { "[:^graph:]", -1, code10, 1, 0, 0 },
+ { "[:lower:]", +1, code11, 1, 0, 0 },
+ { "[:^lower:]", -1, code11, 1, 0, 0 },
+ { "[:print:]", +1, code12, 1, 0, 0 },
+ { "[:^print:]", -1, code12, 1, 0, 0 },
+ { "[:punct:]", +1, code13, 4, 0, 0 },
+ { "[:^punct:]", -1, code13, 4, 0, 0 },
+ { "[:space:]", +1, code14, 2, 0, 0 },
+ { "[:^space:]", -1, code14, 2, 0, 0 },
+ { "[:upper:]", +1, code15, 1, 0, 0 },
+ { "[:^upper:]", -1, code15, 1, 0, 0 },
+ { "[:word:]", +1, code16, 4, 0, 0 },
+ { "[:^word:]", -1, code16, 4, 0, 0 },
+ { "[:xdigit:]", +1, code17, 3, 0, 0 },
+ { "[:^xdigit:]", -1, code17, 3, 0, 0 },
};
const int num_posix_groups = 28;
diff --git a/grpc/third_party/re2/re2/prefilter.cc b/grpc/third_party/re2/re2/prefilter.cc
index f61d54b8..a47b3120 100644
--- a/grpc/third_party/re2/re2/prefilter.cc
+++ b/grpc/third_party/re2/re2/prefilter.cc
@@ -648,14 +648,15 @@ Prefilter* Prefilter::FromRegexp(Regexp* re) {
return NULL;
Regexp* simple = re->Simplify();
- Prefilter::Info *info = BuildInfo(simple);
+ if (simple == NULL)
+ return NULL;
+ Prefilter::Info* info = BuildInfo(simple);
simple->Decref();
if (info == NULL)
return NULL;
Prefilter* m = info->TakeMatch();
-
delete info;
return m;
}
diff --git a/grpc/third_party/re2/re2/prog.cc b/grpc/third_party/re2/re2/prog.cc
index ac9c0852..396b46c1 100644
--- a/grpc/third_party/re2/re2/prog.cc
+++ b/grpc/third_party/re2/re2/prog.cc
@@ -115,9 +115,8 @@ Prog::Prog()
start_unanchored_(0),
size_(0),
bytemap_range_(0),
+ prefix_foldcase_(false),
prefix_size_(0),
- prefix_front_(-1),
- prefix_back_(-1),
list_count_(0),
dfa_mem_(0),
dfa_first_(NULL),
@@ -127,6 +126,8 @@ Prog::Prog()
Prog::~Prog() {
DeleteDFA(dfa_longest_);
DeleteDFA(dfa_first_);
+ if (prefix_foldcase_)
+ delete[] prefix_dfa_;
}
typedef SparseSet Workq;
@@ -916,6 +917,183 @@ void Prog::ComputeHints(std::vector<Inst>* flat, int begin, int end) {
}
}
+// The final state will always be this, which frees up a register for the hot
+// loop and thus avoids the spilling that can occur when building with Clang.
+static const size_t kShiftDFAFinal = 9;
+
+// This function takes the prefix as std::string (i.e. not const std::string&
+// as normal) because it's going to clobber it, so a temporary is convenient.
+static uint64_t* BuildShiftDFA(std::string prefix) {
+ // This constant is for convenience now and also for correctness later when
+ // we clobber the prefix, but still need to know how long it was initially.
+ const size_t size = prefix.size();
+
+ // Construct the NFA.
+ // The table is indexed by input byte; each element is a bitfield of states
+ // reachable by the input byte. Given a bitfield of the current states, the
+ // bitfield of states reachable from those is - for this specific purpose -
+ // always ((ncurr << 1) | 1). Intersecting the reachability bitfields gives
+ // the bitfield of the next states reached by stepping over the input byte.
+ // Credits for this technique: the Hyperscan paper by Geoff Langdale et al.
+ uint16_t nfa[256]{};
+ for (size_t i = 0; i < size; ++i) {
+ uint8_t b = prefix[i];
+ nfa[b] |= 1 << (i+1);
+ }
+ // This is the `\C*?` for unanchored search.
+ for (int b = 0; b < 256; ++b)
+ nfa[b] |= 1;
+
+ // This maps from DFA state to NFA states; the reverse mapping is used when
+ // recording transitions and gets implemented with plain old linear search.
+ // The "Shift DFA" technique limits this to ten states when using uint64_t;
+ // to allow for the initial state, we use at most nine bytes of the prefix.
+ // That same limit is also why uint16_t is sufficient for the NFA bitfield.
+ uint16_t states[kShiftDFAFinal+1]{};
+ states[0] = 1;
+ for (size_t dcurr = 0; dcurr < size; ++dcurr) {
+ uint8_t b = prefix[dcurr];
+ uint16_t ncurr = states[dcurr];
+ uint16_t nnext = nfa[b] & ((ncurr << 1) | 1);
+ size_t dnext = dcurr+1;
+ if (dnext == size)
+ dnext = kShiftDFAFinal;
+ states[dnext] = nnext;
+ }
+
+ // Sort and unique the bytes of the prefix to avoid repeating work while we
+ // record transitions. This clobbers the prefix, but it's no longer needed.
+ std::sort(prefix.begin(), prefix.end());
+ prefix.erase(std::unique(prefix.begin(), prefix.end()), prefix.end());
+
+ // Construct the DFA.
+ // The table is indexed by input byte; each element is effectively a packed
+ // array of uint6_t; each array value will be multiplied by six in order to
+ // avoid having to do so later in the hot loop as well as masking/shifting.
+ // Credits for this technique: "Shift-based DFAs" on GitHub by Per Vognsen.
+ uint64_t* dfa = new uint64_t[256]{};
+ // Record a transition from each state for each of the bytes of the prefix.
+ // Note that all other input bytes go back to the initial state by default.
+ for (size_t dcurr = 0; dcurr < size; ++dcurr) {
+ for (uint8_t b : prefix) {
+ uint16_t ncurr = states[dcurr];
+ uint16_t nnext = nfa[b] & ((ncurr << 1) | 1);
+ size_t dnext = 0;
+ while (states[dnext] != nnext)
+ ++dnext;
+ dfa[b] |= static_cast<uint64_t>(dnext * 6) << (dcurr * 6);
+ // Convert ASCII letters to uppercase and record the extra transitions.
+ // Note that ASCII letters are guaranteed to be lowercase at this point
+ // because that's how the parser normalises them. #FunFact: 'k' and 's'
+ // match U+212A and U+017F, respectively, so they won't occur here when
+ // using UTF-8 encoding because the parser will emit character classes.
+ if ('a' <= b && b <= 'z') {
+ b -= 'a' - 'A';
+ dfa[b] |= static_cast<uint64_t>(dnext * 6) << (dcurr * 6);
+ }
+ }
+ }
+ // This lets the final state "saturate", which will matter for performance:
+ // in the hot loop, we check for a match only at the end of each iteration,
+ // so we must keep signalling the match until we get around to checking it.
+ for (int b = 0; b < 256; ++b)
+ dfa[b] |= static_cast<uint64_t>(kShiftDFAFinal * 6) << (kShiftDFAFinal * 6);
+
+ return dfa;
+}
+
+void Prog::ConfigurePrefixAccel(const std::string& prefix,
+ bool prefix_foldcase) {
+ prefix_foldcase_ = prefix_foldcase;
+ prefix_size_ = prefix.size();
+ if (prefix_foldcase_) {
+ // Use PrefixAccel_ShiftDFA().
+ // ... and no more than nine bytes of the prefix. (See above for details.)
+ prefix_size_ = std::min(prefix_size_, kShiftDFAFinal);
+ prefix_dfa_ = BuildShiftDFA(prefix.substr(0, prefix_size_));
+ } else if (prefix_size_ != 1) {
+ // Use PrefixAccel_FrontAndBack().
+ prefix_front_ = prefix.front();
+ prefix_back_ = prefix.back();
+ } else {
+ // Use memchr(3).
+ prefix_front_ = prefix.front();
+ }
+}
+
+const void* Prog::PrefixAccel_ShiftDFA(const void* data, size_t size) {
+ if (size < prefix_size_)
+ return NULL;
+
+ uint64_t curr = 0;
+
+ // At the time of writing, rough benchmarks on a Broadwell machine showed
+ // that this unroll factor (i.e. eight) achieves a speedup factor of two.
+ if (size >= 8) {
+ const uint8_t* p = reinterpret_cast<const uint8_t*>(data);
+ const uint8_t* endp = p + (size&~7);
+ do {
+ uint8_t b0 = p[0];
+ uint8_t b1 = p[1];
+ uint8_t b2 = p[2];
+ uint8_t b3 = p[3];
+ uint8_t b4 = p[4];
+ uint8_t b5 = p[5];
+ uint8_t b6 = p[6];
+ uint8_t b7 = p[7];
+
+ uint64_t next0 = prefix_dfa_[b0];
+ uint64_t next1 = prefix_dfa_[b1];
+ uint64_t next2 = prefix_dfa_[b2];
+ uint64_t next3 = prefix_dfa_[b3];
+ uint64_t next4 = prefix_dfa_[b4];
+ uint64_t next5 = prefix_dfa_[b5];
+ uint64_t next6 = prefix_dfa_[b6];
+ uint64_t next7 = prefix_dfa_[b7];
+
+ uint64_t curr0 = next0 >> (curr & 63);
+ uint64_t curr1 = next1 >> (curr0 & 63);
+ uint64_t curr2 = next2 >> (curr1 & 63);
+ uint64_t curr3 = next3 >> (curr2 & 63);
+ uint64_t curr4 = next4 >> (curr3 & 63);
+ uint64_t curr5 = next5 >> (curr4 & 63);
+ uint64_t curr6 = next6 >> (curr5 & 63);
+ uint64_t curr7 = next7 >> (curr6 & 63);
+
+ if ((curr7 & 63) == kShiftDFAFinal * 6) {
+ // At the time of writing, using the same masking subexpressions from
+ // the preceding lines caused Clang to clutter the hot loop computing
+ // them - even though they aren't actually needed for shifting! Hence
+ // these rewritten conditions, which achieve a speedup factor of two.
+ if (((curr7-curr0) & 63) == 0) return p+1-prefix_size_;
+ if (((curr7-curr1) & 63) == 0) return p+2-prefix_size_;
+ if (((curr7-curr2) & 63) == 0) return p+3-prefix_size_;
+ if (((curr7-curr3) & 63) == 0) return p+4-prefix_size_;
+ if (((curr7-curr4) & 63) == 0) return p+5-prefix_size_;
+ if (((curr7-curr5) & 63) == 0) return p+6-prefix_size_;
+ if (((curr7-curr6) & 63) == 0) return p+7-prefix_size_;
+ if (((curr7-curr7) & 63) == 0) return p+8-prefix_size_;
+ }
+
+ curr = curr7;
+ p += 8;
+ } while (p != endp);
+ data = p;
+ size = size&7;
+ }
+
+ const uint8_t* p = reinterpret_cast<const uint8_t*>(data);
+ const uint8_t* endp = p + size;
+ while (p != endp) {
+ uint8_t b = *p++;
+ uint64_t next = prefix_dfa_[b];
+ curr = next >> (curr & 63);
+ if ((curr & 63) == kShiftDFAFinal * 6)
+ return p-prefix_size_;
+ }
+ return NULL;
+}
+
#if defined(__AVX2__)
// Finds the least significant non-zero bit in n.
static int FindLSBSet(uint32_t n) {
@@ -958,7 +1136,7 @@ const void* Prog::PrefixAccel_FrontAndBack(const void* data, size_t size) {
const __m256i* endfp = fp + size/sizeof(__m256i);
const __m256i f_set1 = _mm256_set1_epi8(prefix_front_);
const __m256i b_set1 = _mm256_set1_epi8(prefix_back_);
- while (fp != endfp) {
+ do {
const __m256i f_loadu = _mm256_loadu_si256(fp++);
const __m256i b_loadu = _mm256_loadu_si256(bp++);
const __m256i f_cmpeq = _mm256_cmpeq_epi8(f_set1, f_loadu);
@@ -970,7 +1148,7 @@ const void* Prog::PrefixAccel_FrontAndBack(const void* data, size_t size) {
const int fb_ctz = FindLSBSet(fb_movemask);
return reinterpret_cast<const char*>(fp-1) + fb_ctz;
}
- }
+ } while (fp != endfp);
data = fp;
size = size%sizeof(__m256i);
}
diff --git a/grpc/third_party/re2/re2/prog.h b/grpc/third_party/re2/re2/prog.h
index e9ce682d..8ca98807 100644
--- a/grpc/third_party/re2/re2/prog.h
+++ b/grpc/third_party/re2/re2/prog.h
@@ -220,11 +220,23 @@ class Prog {
// Accelerates to the first likely occurrence of the prefix.
// Returns a pointer to the first byte or NULL if not found.
const void* PrefixAccel(const void* data, size_t size) {
- DCHECK_GE(prefix_size_, 1);
- return prefix_size_ == 1 ? memchr(data, prefix_front_, size)
- : PrefixAccel_FrontAndBack(data, size);
+ DCHECK(can_prefix_accel());
+ if (prefix_foldcase_) {
+ return PrefixAccel_ShiftDFA(data, size);
+ } else if (prefix_size_ != 1) {
+ return PrefixAccel_FrontAndBack(data, size);
+ } else {
+ return memchr(data, prefix_front_, size);
+ }
}
+ // Configures prefix accel using the analysis performed during compilation.
+ void ConfigurePrefixAccel(const std::string& prefix, bool prefix_foldcase);
+
+ // An implementation of prefix accel that uses prefix_dfa_ to perform
+ // case-insensitive search.
+ const void* PrefixAccel_ShiftDFA(const void* data, size_t size);
+
// An implementation of prefix accel that looks for prefix_front_ and
// prefix_back_ to return fewer false positives than memchr(3) alone.
const void* PrefixAccel_FrontAndBack(const void* data, size_t size);
@@ -298,10 +310,6 @@ class Prog {
// FOR TESTING OR EXPERIMENTAL PURPOSES ONLY.
int BuildEntireDFA(MatchKind kind, const DFAStateCallback& cb);
- // Controls whether the DFA should bail out early if the NFA would be faster.
- // FOR TESTING ONLY.
- static void TEST_dfa_should_bail_when_slow(bool b);
-
// Compute bytemap.
void ComputeByteMap();
@@ -390,6 +398,10 @@ class Prog {
// Computes hints for ByteRange instructions in [begin, end).
void ComputeHints(std::vector<Inst>* flat, int begin, int end);
+ // Controls whether the DFA should bail out early if the NFA would be faster.
+ // FOR TESTING ONLY.
+ static void TESTING_ONLY_set_dfa_should_bail_when_slow(bool b);
+
private:
friend class Compiler;
@@ -406,9 +418,16 @@ class Prog {
int start_unanchored_; // unanchored entry point for program
int size_; // number of instructions
int bytemap_range_; // bytemap_[x] < bytemap_range_
+
+ bool prefix_foldcase_; // whether prefix is case-insensitive
size_t prefix_size_; // size of prefix (0 if no prefix)
- int prefix_front_; // first byte of prefix (-1 if no prefix)
- int prefix_back_; // last byte of prefix (-1 if no prefix)
+ union {
+ uint64_t* prefix_dfa_; // "Shift DFA" for prefix
+ struct {
+ int prefix_front_; // first byte of prefix
+ int prefix_back_; // last byte of prefix
+ };
+ };
int list_count_; // count of lists (see above)
int inst_count_[kNumInst]; // count of instructions by opcode
diff --git a/grpc/third_party/re2/re2/re2.cc b/grpc/third_party/re2/re2/re2.cc
index 35fd1cc3..128c8bd4 100644
--- a/grpc/third_party/re2/re2/re2.cc
+++ b/grpc/third_party/re2/re2/re2.cc
@@ -83,6 +83,8 @@ static RE2::ErrorCode RegexpErrorToRE2(re2::RegexpStatusCode code) {
return RE2::ErrorMissingBracket;
case re2::kRegexpMissingParen:
return RE2::ErrorMissingParen;
+ case re2::kRegexpUnexpectedParen:
+ return RE2::ErrorUnexpectedParen;
case re2::kRegexpTrailingBackslash:
return RE2::ErrorTrailingBackslash;
case re2::kRegexpRepeatArgument:
@@ -799,7 +801,7 @@ bool RE2::Match(const StringPiece& text,
// it doesn't have the shared state and occasional mutex that
// the DFA does.
if (can_one_pass && text.size() <= 4096 &&
- (ncap > 1 || text.size() <= 8)) {
+ (ncap > 1 || text.size() <= 16)) {
skipped_test = true;
break;
}
@@ -1038,41 +1040,49 @@ bool RE2::Rewrite(std::string* out,
/***** Parsers for various types *****/
-bool RE2::Arg::parse_null(const char* str, size_t n, void* dest) {
+namespace re2_internal {
+
+template <>
+bool Parse(const char* str, size_t n, void* dest) {
// We fail if somebody asked us to store into a non-NULL void* pointer
return (dest == NULL);
}
-bool RE2::Arg::parse_string(const char* str, size_t n, void* dest) {
+template <>
+bool Parse(const char* str, size_t n, std::string* dest) {
if (dest == NULL) return true;
- reinterpret_cast<std::string*>(dest)->assign(str, n);
+ dest->assign(str, n);
return true;
}
-bool RE2::Arg::parse_stringpiece(const char* str, size_t n, void* dest) {
+template <>
+bool Parse(const char* str, size_t n, StringPiece* dest) {
if (dest == NULL) return true;
- *(reinterpret_cast<StringPiece*>(dest)) = StringPiece(str, n);
+ *dest = StringPiece(str, n);
return true;
}
-bool RE2::Arg::parse_char(const char* str, size_t n, void* dest) {
+template <>
+bool Parse(const char* str, size_t n, char* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<char*>(dest)) = str[0];
+ *dest = str[0];
return true;
}
-bool RE2::Arg::parse_schar(const char* str, size_t n, void* dest) {
+template <>
+bool Parse(const char* str, size_t n, signed char* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<signed char*>(dest)) = str[0];
+ *dest = str[0];
return true;
}
-bool RE2::Arg::parse_uchar(const char* str, size_t n, void* dest) {
+template <>
+bool Parse(const char* str, size_t n, unsigned char* dest) {
if (n != 1) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<unsigned char*>(dest)) = str[0];
+ *dest = str[0];
return true;
}
@@ -1136,10 +1146,40 @@ static const char* TerminateNumber(char* buf, size_t nbuf, const char* str,
return buf;
}
-bool RE2::Arg::parse_long_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, float* dest) {
+ if (n == 0) return false;
+ static const int kMaxLength = 200;
+ char buf[kMaxLength+1];
+ str = TerminateNumber(buf, sizeof buf, str, &n, true);
+ char* end;
+ errno = 0;
+ float r = strtof(str, &end);
+ if (end != str + n) return false; // Leftover junk
+ if (errno) return false;
+ if (dest == NULL) return true;
+ *dest = r;
+ return true;
+}
+
+template <>
+bool Parse(const char* str, size_t n, double* dest) {
+ if (n == 0) return false;
+ static const int kMaxLength = 200;
+ char buf[kMaxLength+1];
+ str = TerminateNumber(buf, sizeof buf, str, &n, true);
+ char* end;
+ errno = 0;
+ double r = strtod(str, &end);
+ if (end != str + n) return false; // Leftover junk
+ if (errno) return false;
+ if (dest == NULL) return true;
+ *dest = r;
+ return true;
+}
+
+template <>
+bool Parse(const char* str, size_t n, long* dest, int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
@@ -1149,14 +1189,12 @@ bool RE2::Arg::parse_long_radix(const char* str,
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<long*>(dest)) = r;
+ *dest = r;
return true;
}
-bool RE2::Arg::parse_ulong_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, unsigned long* dest, int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
@@ -1172,62 +1210,52 @@ bool RE2::Arg::parse_ulong_radix(const char* str,
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<unsigned long*>(dest)) = r;
+ *dest = r;
return true;
}
-bool RE2::Arg::parse_short_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, short* dest, int radix) {
long r;
- if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
- if ((short)r != r) return false; // Out of range
+ if (!Parse(str, n, &r, radix)) return false; // Could not parse
+ if ((short)r != r) return false; // Out of range
if (dest == NULL) return true;
- *(reinterpret_cast<short*>(dest)) = (short)r;
+ *dest = (short)r;
return true;
}
-bool RE2::Arg::parse_ushort_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, unsigned short* dest, int radix) {
unsigned long r;
- if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
- if ((unsigned short)r != r) return false; // Out of range
+ if (!Parse(str, n, &r, radix)) return false; // Could not parse
+ if ((unsigned short)r != r) return false; // Out of range
if (dest == NULL) return true;
- *(reinterpret_cast<unsigned short*>(dest)) = (unsigned short)r;
+ *dest = (unsigned short)r;
return true;
}
-bool RE2::Arg::parse_int_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, int* dest, int radix) {
long r;
- if (!parse_long_radix(str, n, &r, radix)) return false; // Could not parse
- if ((int)r != r) return false; // Out of range
+ if (!Parse(str, n, &r, radix)) return false; // Could not parse
+ if ((int)r != r) return false; // Out of range
if (dest == NULL) return true;
- *(reinterpret_cast<int*>(dest)) = (int)r;
+ *dest = (int)r;
return true;
}
-bool RE2::Arg::parse_uint_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, unsigned int* dest, int radix) {
unsigned long r;
- if (!parse_ulong_radix(str, n, &r, radix)) return false; // Could not parse
- if ((unsigned int)r != r) return false; // Out of range
+ if (!Parse(str, n, &r, radix)) return false; // Could not parse
+ if ((unsigned int)r != r) return false; // Out of range
if (dest == NULL) return true;
- *(reinterpret_cast<unsigned int*>(dest)) = (unsigned int)r;
+ *dest = (unsigned int)r;
return true;
}
-bool RE2::Arg::parse_longlong_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, long long* dest, int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
@@ -1237,14 +1265,12 @@ bool RE2::Arg::parse_longlong_radix(const char* str,
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<long long*>(dest)) = r;
+ *dest = r;
return true;
}
-bool RE2::Arg::parse_ulonglong_radix(const char* str,
- size_t n,
- void* dest,
- int radix) {
+template <>
+bool Parse(const char* str, size_t n, unsigned long long* dest, int radix) {
if (n == 0) return false;
char buf[kMaxNumberLength+1];
str = TerminateNumber(buf, sizeof buf, str, &n, false);
@@ -1259,68 +1285,11 @@ bool RE2::Arg::parse_ulonglong_radix(const char* str,
if (end != str + n) return false; // Leftover junk
if (errno) return false;
if (dest == NULL) return true;
- *(reinterpret_cast<unsigned long long*>(dest)) = r;
- return true;
-}
-
-static bool parse_double_float(const char* str, size_t n, bool isfloat,
- void* dest) {
- if (n == 0) return false;
- static const int kMaxLength = 200;
- char buf[kMaxLength+1];
- str = TerminateNumber(buf, sizeof buf, str, &n, true);
- char* end;
- errno = 0;
- double r;
- if (isfloat) {
- r = strtof(str, &end);
- } else {
- r = strtod(str, &end);
- }
- if (end != str + n) return false; // Leftover junk
- if (errno) return false;
- if (dest == NULL) return true;
- if (isfloat) {
- *(reinterpret_cast<float*>(dest)) = (float)r;
- } else {
- *(reinterpret_cast<double*>(dest)) = r;
- }
+ *dest = r;
return true;
}
-bool RE2::Arg::parse_double(const char* str, size_t n, void* dest) {
- return parse_double_float(str, n, false, dest);
-}
-
-bool RE2::Arg::parse_float(const char* str, size_t n, void* dest) {
- return parse_double_float(str, n, true, dest);
-}
-
-#define DEFINE_INTEGER_PARSER(name) \
- bool RE2::Arg::parse_##name(const char* str, size_t n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 10); \
- } \
- bool RE2::Arg::parse_##name##_hex(const char* str, size_t n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 16); \
- } \
- bool RE2::Arg::parse_##name##_octal(const char* str, size_t n, void* dest) { \
- return parse_##name##_radix(str, n, dest, 8); \
- } \
- bool RE2::Arg::parse_##name##_cradix(const char* str, size_t n, \
- void* dest) { \
- return parse_##name##_radix(str, n, dest, 0); \
- }
-
-DEFINE_INTEGER_PARSER(short)
-DEFINE_INTEGER_PARSER(ushort)
-DEFINE_INTEGER_PARSER(int)
-DEFINE_INTEGER_PARSER(uint)
-DEFINE_INTEGER_PARSER(long)
-DEFINE_INTEGER_PARSER(ulong)
-DEFINE_INTEGER_PARSER(longlong)
-DEFINE_INTEGER_PARSER(ulonglong)
-
-#undef DEFINE_INTEGER_PARSER
+} // namespace re2_internal
namespace hooks {
diff --git a/grpc/third_party/re2/re2/re2.h b/grpc/third_party/re2/re2/re2.h
index 32b2718f..7fd2245c 100644
--- a/grpc/third_party/re2/re2/re2.h
+++ b/grpc/third_party/re2/re2/re2.h
@@ -40,6 +40,9 @@
// R"((?i)hello)" -- (?i) turns on case-insensitive matching
// R"(/\*(.*?)\*/)" -- .*? matches . minimum no. of times possible
//
+// When using UTF-8 encoding, case-insensitive matching will perform
+// simple case folding, not full case folding.
+//
// -----------------------------------------------------------------------
// MATCHING INTERFACE:
//
@@ -205,6 +208,7 @@
#include <map>
#include <mutex>
#include <string>
+#include <type_traits>
#include <vector>
#if defined(__APPLE__)
@@ -244,6 +248,7 @@ class RE2 {
ErrorBadCharRange, // bad character class range
ErrorMissingBracket, // missing closing ]
ErrorMissingParen, // missing closing )
+ ErrorUnexpectedParen, // unexpected closing )
ErrorTrailingBackslash, // trailing \ at end of regexp
ErrorRepeatArgument, // repeat argument missing, e.g. "*"
ErrorRepeatSize, // bad repetition argument
@@ -364,12 +369,12 @@ class RE2 {
// (void*)NULL (the corresponding matched sub-pattern is not copied)
//
// Returns true iff all of the following conditions are satisfied:
- // a. "text" matches "re" exactly
- // b. The number of matched sub-patterns is >= number of supplied pointers
+ // a. "text" matches "re" fully - from the beginning to the end of "text".
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
// c. The "i"th argument has a suitable type for holding the
// string captured as the "i"th sub-pattern. If you pass in
// NULL for the "i"th argument, or pass fewer arguments than
- // number of sub-patterns, "i"th captured sub-pattern is
+ // number of sub-patterns, the "i"th captured sub-pattern is
// ignored.
//
// CAVEAT: An optional sub-pattern that does not exist in the
@@ -383,8 +388,17 @@ class RE2 {
return Apply(FullMatchN, text, re, Arg(std::forward<A>(a))...);
}
- // Exactly like FullMatch(), except that "re" is allowed to match
- // a substring of "text".
+ // Like FullMatch(), except that "re" is allowed to match a substring
+ // of "text".
+ //
+ // Returns true iff all of the following conditions are satisfied:
+ // a. "text" matches "re" partially - for some substring of "text".
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
+ // c. The "i"th argument has a suitable type for holding the
+ // string captured as the "i"th sub-pattern. If you pass in
+ // NULL for the "i"th argument, or pass fewer arguments than
+ // number of sub-patterns, the "i"th captured sub-pattern is
+ // ignored.
template <typename... A>
static bool PartialMatch(const StringPiece& text, const RE2& re, A&&... a) {
return Apply(PartialMatchN, text, re, Arg(std::forward<A>(a))...);
@@ -393,7 +407,16 @@ class RE2 {
// Like FullMatch() and PartialMatch(), except that "re" has to match
// a prefix of the text, and "input" is advanced past the matched
// text. Note: "input" is modified iff this routine returns true
- // and "re" matched a non-empty substring of "text".
+ // and "re" matched a non-empty substring of "input".
+ //
+ // Returns true iff all of the following conditions are satisfied:
+ // a. "input" matches "re" partially - for some prefix of "input".
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
+ // c. The "i"th argument has a suitable type for holding the
+ // string captured as the "i"th sub-pattern. If you pass in
+ // NULL for the "i"th argument, or pass fewer arguments than
+ // number of sub-patterns, the "i"th captured sub-pattern is
+ // ignored.
template <typename... A>
static bool Consume(StringPiece* input, const RE2& re, A&&... a) {
return Apply(ConsumeN, input, re, Arg(std::forward<A>(a))...);
@@ -403,6 +426,15 @@ class RE2 {
// the text. That is, "re" need not start its match at the beginning
// of "input". For example, "FindAndConsume(s, "(\\w+)", &word)" finds
// the next word in "s" and stores it in "word".
+ //
+ // Returns true iff all of the following conditions are satisfied:
+ // a. "input" matches "re" partially - for some substring of "input".
+ // b. The number of matched sub-patterns is >= number of supplied pointers.
+ // c. The "i"th argument has a suitable type for holding the
+ // string captured as the "i"th sub-pattern. If you pass in
+ // NULL for the "i"th argument, or pass fewer arguments than
+ // number of sub-patterns, the "i"th captured sub-pattern is
+ // ignored.
template <typename... A>
static bool FindAndConsume(StringPiece* input, const RE2& re, A&&... a) {
return Apply(FindAndConsumeN, input, re, Arg(std::forward<A>(a))...);
@@ -703,32 +735,12 @@ class RE2 {
const Options& options() const { return options_; }
// Argument converters; see below.
- static inline Arg CRadix(short* x);
- static inline Arg CRadix(unsigned short* x);
- static inline Arg CRadix(int* x);
- static inline Arg CRadix(unsigned int* x);
- static inline Arg CRadix(long* x);
- static inline Arg CRadix(unsigned long* x);
- static inline Arg CRadix(long long* x);
- static inline Arg CRadix(unsigned long long* x);
-
- static inline Arg Hex(short* x);
- static inline Arg Hex(unsigned short* x);
- static inline Arg Hex(int* x);
- static inline Arg Hex(unsigned int* x);
- static inline Arg Hex(long* x);
- static inline Arg Hex(unsigned long* x);
- static inline Arg Hex(long long* x);
- static inline Arg Hex(unsigned long long* x);
-
- static inline Arg Octal(short* x);
- static inline Arg Octal(unsigned short* x);
- static inline Arg Octal(int* x);
- static inline Arg Octal(unsigned int* x);
- static inline Arg Octal(long* x);
- static inline Arg Octal(unsigned long* x);
- static inline Arg Octal(long long* x);
- static inline Arg Octal(unsigned long long* x);
+ template <typename T>
+ static Arg CRadix(T* ptr);
+ template <typename T>
+ static Arg Hex(T* ptr);
+ template <typename T>
+ static Arg Octal(T* ptr);
private:
void Init(const StringPiece& pattern, const Options& options);
@@ -771,130 +783,130 @@ class RE2 {
/***** Implementation details *****/
-// Hex/Octal/Binary?
-
-// Special class for parsing into objects that define a ParseFrom() method
-template <class T>
-class _RE2_MatchObject {
- public:
- static inline bool Parse(const char* str, size_t n, void* dest) {
- if (dest == NULL) return true;
- T* object = reinterpret_cast<T*>(dest);
- return object->ParseFrom(str, n);
- }
-};
+namespace re2_internal {
+
+// Types for which the 3-ary Parse() function template has specializations.
+template <typename T> struct Parse3ary : public std::false_type {};
+template <> struct Parse3ary<void> : public std::true_type {};
+template <> struct Parse3ary<std::string> : public std::true_type {};
+template <> struct Parse3ary<StringPiece> : public std::true_type {};
+template <> struct Parse3ary<char> : public std::true_type {};
+template <> struct Parse3ary<signed char> : public std::true_type {};
+template <> struct Parse3ary<unsigned char> : public std::true_type {};
+template <> struct Parse3ary<float> : public std::true_type {};
+template <> struct Parse3ary<double> : public std::true_type {};
+
+template <typename T>
+bool Parse(const char* str, size_t n, T* dest);
+
+// Types for which the 4-ary Parse() function template has specializations.
+template <typename T> struct Parse4ary : public std::false_type {};
+template <> struct Parse4ary<long> : public std::true_type {};
+template <> struct Parse4ary<unsigned long> : public std::true_type {};
+template <> struct Parse4ary<short> : public std::true_type {};
+template <> struct Parse4ary<unsigned short> : public std::true_type {};
+template <> struct Parse4ary<int> : public std::true_type {};
+template <> struct Parse4ary<unsigned int> : public std::true_type {};
+template <> struct Parse4ary<long long> : public std::true_type {};
+template <> struct Parse4ary<unsigned long long> : public std::true_type {};
+
+template <typename T>
+bool Parse(const char* str, size_t n, T* dest, int radix);
+
+} // namespace re2_internal
class RE2::Arg {
+ private:
+ template <typename T>
+ using CanParse3ary = typename std::enable_if<
+ re2_internal::Parse3ary<T>::value,
+ int>::type;
+
+ template <typename T>
+ using CanParse4ary = typename std::enable_if<
+ re2_internal::Parse4ary<T>::value,
+ int>::type;
+
+#if !defined(_MSC_VER)
+ template <typename T>
+ using CanParseFrom = typename std::enable_if<
+ std::is_member_function_pointer<
+ decltype(static_cast<bool (T::*)(const char*, size_t)>(
+ &T::ParseFrom))>::value,
+ int>::type;
+#endif
+
public:
- // Empty constructor so we can declare arrays of RE2::Arg
- Arg();
+ Arg() : Arg(nullptr) {}
+ Arg(std::nullptr_t ptr) : arg_(ptr), parser_(DoNothing) {}
- // Constructor specially designed for NULL arguments
- Arg(void*);
- Arg(std::nullptr_t);
+ template <typename T, CanParse3ary<T> = 0>
+ Arg(T* ptr) : arg_(ptr), parser_(DoParse3ary<T>) {}
+
+ template <typename T, CanParse4ary<T> = 0>
+ Arg(T* ptr) : arg_(ptr), parser_(DoParse4ary<T>) {}
+
+#if !defined(_MSC_VER)
+ template <typename T, CanParseFrom<T> = 0>
+ Arg(T* ptr) : arg_(ptr), parser_(DoParseFrom<T>) {}
+#endif
typedef bool (*Parser)(const char* str, size_t n, void* dest);
-// Type-specific parsers
-#define MAKE_PARSER(type, name) \
- Arg(type* p) : arg_(p), parser_(name) {} \
- Arg(type* p, Parser parser) : arg_(p), parser_(parser) {}
-
- MAKE_PARSER(char, parse_char)
- MAKE_PARSER(signed char, parse_schar)
- MAKE_PARSER(unsigned char, parse_uchar)
- MAKE_PARSER(float, parse_float)
- MAKE_PARSER(double, parse_double)
- MAKE_PARSER(std::string, parse_string)
- MAKE_PARSER(StringPiece, parse_stringpiece)
-
- MAKE_PARSER(short, parse_short)
- MAKE_PARSER(unsigned short, parse_ushort)
- MAKE_PARSER(int, parse_int)
- MAKE_PARSER(unsigned int, parse_uint)
- MAKE_PARSER(long, parse_long)
- MAKE_PARSER(unsigned long, parse_ulong)
- MAKE_PARSER(long long, parse_longlong)
- MAKE_PARSER(unsigned long long, parse_ulonglong)
-
-#undef MAKE_PARSER
-
- // Generic constructor templates
- template <class T> Arg(T* p)
- : arg_(p), parser_(_RE2_MatchObject<T>::Parse) { }
- template <class T> Arg(T* p, Parser parser)
- : arg_(p), parser_(parser) { }
-
- // Parse the data
- bool Parse(const char* str, size_t n) const;
+ template <typename T>
+ Arg(T* ptr, Parser parser) : arg_(ptr), parser_(parser) {}
+
+ bool Parse(const char* str, size_t n) const {
+ return (*parser_)(str, n, arg_);
+ }
private:
- void* arg_;
- Parser parser_;
+ static bool DoNothing(const char* /*str*/, size_t /*n*/, void* /*dest*/) {
+ return true;
+ }
- static bool parse_null (const char* str, size_t n, void* dest);
- static bool parse_char (const char* str, size_t n, void* dest);
- static bool parse_schar (const char* str, size_t n, void* dest);
- static bool parse_uchar (const char* str, size_t n, void* dest);
- static bool parse_float (const char* str, size_t n, void* dest);
- static bool parse_double (const char* str, size_t n, void* dest);
- static bool parse_string (const char* str, size_t n, void* dest);
- static bool parse_stringpiece (const char* str, size_t n, void* dest);
-
-#define DECLARE_INTEGER_PARSER(name) \
- private: \
- static bool parse_##name(const char* str, size_t n, void* dest); \
- static bool parse_##name##_radix(const char* str, size_t n, void* dest, \
- int radix); \
- \
- public: \
- static bool parse_##name##_hex(const char* str, size_t n, void* dest); \
- static bool parse_##name##_octal(const char* str, size_t n, void* dest); \
- static bool parse_##name##_cradix(const char* str, size_t n, void* dest);
-
- DECLARE_INTEGER_PARSER(short)
- DECLARE_INTEGER_PARSER(ushort)
- DECLARE_INTEGER_PARSER(int)
- DECLARE_INTEGER_PARSER(uint)
- DECLARE_INTEGER_PARSER(long)
- DECLARE_INTEGER_PARSER(ulong)
- DECLARE_INTEGER_PARSER(longlong)
- DECLARE_INTEGER_PARSER(ulonglong)
-
-#undef DECLARE_INTEGER_PARSER
+ template <typename T>
+ static bool DoParse3ary(const char* str, size_t n, void* dest) {
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest));
+ }
-};
+ template <typename T>
+ static bool DoParse4ary(const char* str, size_t n, void* dest) {
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 10);
+ }
-inline RE2::Arg::Arg() : arg_(NULL), parser_(parse_null) { }
-inline RE2::Arg::Arg(void* p) : arg_(p), parser_(parse_null) { }
-inline RE2::Arg::Arg(std::nullptr_t p) : arg_(p), parser_(parse_null) { }
+#if !defined(_MSC_VER)
+ template <typename T>
+ static bool DoParseFrom(const char* str, size_t n, void* dest) {
+ if (dest == NULL) return true;
+ return reinterpret_cast<T*>(dest)->ParseFrom(str, n);
+ }
+#endif
-inline bool RE2::Arg::Parse(const char* str, size_t n) const {
- return (*parser_)(str, n, arg_);
-}
+ void* arg_;
+ Parser parser_;
+};
-// This part of the parser, appropriate only for ints, deals with bases
-#define MAKE_INTEGER_PARSER(type, name) \
- inline RE2::Arg RE2::Hex(type* ptr) { \
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_hex); \
- } \
- inline RE2::Arg RE2::Octal(type* ptr) { \
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_octal); \
- } \
- inline RE2::Arg RE2::CRadix(type* ptr) { \
- return RE2::Arg(ptr, RE2::Arg::parse_##name##_cradix); \
- }
+template <typename T>
+inline RE2::Arg RE2::CRadix(T* ptr) {
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 0);
+ });
+}
-MAKE_INTEGER_PARSER(short, short)
-MAKE_INTEGER_PARSER(unsigned short, ushort)
-MAKE_INTEGER_PARSER(int, int)
-MAKE_INTEGER_PARSER(unsigned int, uint)
-MAKE_INTEGER_PARSER(long, long)
-MAKE_INTEGER_PARSER(unsigned long, ulong)
-MAKE_INTEGER_PARSER(long long, longlong)
-MAKE_INTEGER_PARSER(unsigned long long, ulonglong)
+template <typename T>
+inline RE2::Arg RE2::Hex(T* ptr) {
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 16);
+ });
+}
-#undef MAKE_INTEGER_PARSER
+template <typename T>
+inline RE2::Arg RE2::Octal(T* ptr) {
+ return RE2::Arg(ptr, [](const char* str, size_t n, void* dest) -> bool {
+ return re2_internal::Parse(str, n, reinterpret_cast<T*>(dest), 8);
+ });
+}
#ifndef SWIG
// Silence warnings about missing initializers for members of LazyRE2.
@@ -955,8 +967,11 @@ namespace hooks {
// thread_local, but for the sake of brevity, we lump together all versions
// of Apple platforms that aren't macOS. If an iOS application really needs
// the context pointee someday, we can get more specific then...
+//
+// As per https://github.com/google/re2/issues/325, thread_local support in
+// MinGW seems to be buggy. (FWIW, Abseil folks also avoid it.)
#define RE2_HAVE_THREAD_LOCAL
-#if defined(__APPLE__) && !TARGET_OS_OSX
+#if (defined(__APPLE__) && !TARGET_OS_OSX) || defined(__MINGW32__)
#undef RE2_HAVE_THREAD_LOCAL
#endif
diff --git a/grpc/third_party/re2/re2/regexp.cc b/grpc/third_party/re2/re2/regexp.cc
index 4364d0a0..2e1bfac9 100644
--- a/grpc/third_party/re2/re2/regexp.cc
+++ b/grpc/third_party/re2/re2/regexp.cc
@@ -498,6 +498,7 @@ static const char *kErrorStrings[] = {
"invalid character class range",
"missing ]",
"missing )",
+ "unexpected )",
"trailing \\",
"no argument for repetition operator",
"invalid repetition size",
@@ -721,8 +722,14 @@ bool Regexp::RequiredPrefixForAccel(std::string* prefix, bool* foldcase) {
*foldcase = false;
// No need for a walker: the regexp must either begin with or be
- // a literal char or string.
+ // a literal char or string. We "see through" capturing groups,
+ // but make no effort to glue multiple prefix fragments together.
Regexp* re = op_ == kRegexpConcat && nsub_ > 0 ? sub()[0] : this;
+ while (re->op_ == kRegexpCapture) {
+ re = re->sub()[0];
+ if (re->op_ == kRegexpConcat && re->nsub_ > 0)
+ re = re->sub()[0];
+ }
if (re->op_ != kRegexpLiteral &&
re->op_ != kRegexpLiteralString)
return false;
@@ -912,7 +919,7 @@ void CharClassBuilder::Negate() {
// The ranges are allocated in the same block as the header,
// necessitating a special allocator and Delete method.
-CharClass* CharClass::New(int maxranges) {
+CharClass* CharClass::New(size_t maxranges) {
CharClass* cc;
uint8_t* data = new uint8_t[sizeof *cc + maxranges*sizeof cc->ranges_[0]];
cc = reinterpret_cast<CharClass*>(data);
@@ -929,7 +936,7 @@ void CharClass::Delete() {
}
CharClass* CharClass::Negate() {
- CharClass* cc = CharClass::New(nranges_+1);
+ CharClass* cc = CharClass::New(static_cast<size_t>(nranges_+1));
cc->folds_ascii_ = folds_ascii_;
cc->nrunes_ = Runemax + 1 - nrunes_;
int n = 0;
@@ -948,7 +955,7 @@ CharClass* CharClass::Negate() {
return cc;
}
-bool CharClass::Contains(Rune r) {
+bool CharClass::Contains(Rune r) const {
RuneRange* rr = ranges_;
int n = nranges_;
while (n > 0) {
@@ -966,7 +973,7 @@ bool CharClass::Contains(Rune r) {
}
CharClass* CharClassBuilder::GetCharClass() {
- CharClass* cc = CharClass::New(static_cast<int>(ranges_.size()));
+ CharClass* cc = CharClass::New(ranges_.size());
int n = 0;
for (iterator it = begin(); it != end(); ++it)
cc->ranges_[n++] = *it;
diff --git a/grpc/third_party/re2/re2/regexp.h b/grpc/third_party/re2/re2/regexp.h
index 5284ab5a..b6446f9f 100644
--- a/grpc/third_party/re2/re2/regexp.h
+++ b/grpc/third_party/re2/re2/regexp.h
@@ -86,6 +86,7 @@
// form accessible to clients, so that client code can analyze the
// parsed regular expressions.
+#include <stddef.h>
#include <stdint.h>
#include <map>
#include <set>
@@ -177,6 +178,7 @@ enum RegexpStatusCode {
kRegexpBadCharRange, // bad character class range
kRegexpMissingBracket, // missing closing ]
kRegexpMissingParen, // missing closing )
+ kRegexpUnexpectedParen, // unexpected closing )
kRegexpTrailingBackslash, // at end of regexp
kRegexpRepeatArgument, // repeat argument missing, e.g. "*"
kRegexpRepeatSize, // bad repetition argument
@@ -252,13 +254,13 @@ class CharClass {
bool full() { return nrunes_ == Runemax+1; }
bool FoldsASCII() { return folds_ascii_; }
- bool Contains(Rune r);
+ bool Contains(Rune r) const;
CharClass* Negate();
private:
CharClass(); // not implemented
~CharClass(); // not implemented
- static CharClass* New(int maxranges);
+ static CharClass* New(size_t maxranges);
friend class CharClassBuilder;
@@ -447,6 +449,10 @@ class Regexp {
// regardless of the return value.
bool RequiredPrefixForAccel(std::string* prefix, bool* foldcase);
+ // Controls the maximum repeat count permitted by the parser.
+ // FOR FUZZING ONLY.
+ static void FUZZING_ONLY_set_maximum_repeat_count(int i);
+
private:
// Constructor allocates vectors as appropriate for operator.
explicit Regexp(RegexpOp op, ParseFlags parse_flags);
diff --git a/grpc/third_party/re2/re2/set.cc b/grpc/third_party/re2/re2/set.cc
index 87db6b72..18705663 100644
--- a/grpc/third_party/re2/re2/set.cc
+++ b/grpc/third_party/re2/re2/set.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <algorithm>
#include <memory>
+#include <utility>
#include "util/util.h"
#include "util/logging.h"
@@ -18,19 +19,37 @@
namespace re2 {
-RE2::Set::Set(const RE2::Options& options, RE2::Anchor anchor) {
- options_.Copy(options);
+RE2::Set::Set(const RE2::Options& options, RE2::Anchor anchor)
+ : options_(options),
+ anchor_(anchor),
+ compiled_(false),
+ size_(0) {
options_.set_never_capture(true); // might unblock some optimisations
- anchor_ = anchor;
- prog_ = NULL;
- compiled_ = false;
- size_ = 0;
}
RE2::Set::~Set() {
for (size_t i = 0; i < elem_.size(); i++)
elem_[i].second->Decref();
- delete prog_;
+}
+
+RE2::Set::Set(Set&& other)
+ : options_(other.options_),
+ anchor_(other.anchor_),
+ elem_(std::move(other.elem_)),
+ compiled_(other.compiled_),
+ size_(other.size_),
+ prog_(std::move(other.prog_)) {
+ other.elem_.clear();
+ other.elem_.shrink_to_fit();
+ other.compiled_ = false;
+ other.size_ = 0;
+ other.prog_.reset();
+}
+
+RE2::Set& RE2::Set::operator=(Set&& other) {
+ this->~Set();
+ (void) new (this) Set(std::move(other));
+ return *this;
}
int RE2::Set::Add(const StringPiece& pattern, std::string* error) {
@@ -97,9 +116,9 @@ bool RE2::Set::Compile() {
options_.ParseFlags());
re2::Regexp* re = re2::Regexp::Alternate(sub.data(), size_, pf);
- prog_ = Prog::CompileSet(re, anchor_, options_.max_mem());
+ prog_.reset(Prog::CompileSet(re, anchor_, options_.max_mem()));
re->Decref();
- return prog_ != NULL;
+ return prog_ != nullptr;
}
bool RE2::Set::Match(const StringPiece& text, std::vector<int>* v) const {
@@ -114,6 +133,9 @@ bool RE2::Set::Match(const StringPiece& text, std::vector<int>* v,
error_info->kind = kNotCompiled;
return false;
}
+#ifdef RE2_HAVE_THREAD_LOCAL
+ hooks::context = NULL;
+#endif
bool dfa_failed = false;
std::unique_ptr<SparseSet> matches;
if (v != NULL) {
diff --git a/grpc/third_party/re2/re2/set.h b/grpc/third_party/re2/re2/set.h
index 59733fd9..8d64f30c 100644
--- a/grpc/third_party/re2/re2/set.h
+++ b/grpc/third_party/re2/re2/set.h
@@ -5,6 +5,7 @@
#ifndef RE2_SET_H_
#define RE2_SET_H_
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -36,6 +37,13 @@ class RE2::Set {
Set(const RE2::Options& options, RE2::Anchor anchor);
~Set();
+ // Not copyable.
+ Set(const Set&) = delete;
+ Set& operator=(const Set&) = delete;
+ // Movable.
+ Set(Set&& other);
+ Set& operator=(Set&& other);
+
// Adds pattern to the set using the options passed to the constructor.
// Returns the index that will identify the regexp in the output of Match(),
// or -1 if the regexp cannot be parsed.
@@ -67,12 +75,9 @@ class RE2::Set {
RE2::Options options_;
RE2::Anchor anchor_;
std::vector<Elem> elem_;
- re2::Prog* prog_;
bool compiled_;
int size_;
-
- Set(const Set&) = delete;
- Set& operator=(const Set&) = delete;
+ std::unique_ptr<re2::Prog> prog_;
};
} // namespace re2
diff --git a/grpc/third_party/re2/re2/simplify.cc b/grpc/third_party/re2/re2/simplify.cc
index 270f0ff9..663d5fcd 100644
--- a/grpc/third_party/re2/re2/simplify.cc
+++ b/grpc/third_party/re2/re2/simplify.cc
@@ -28,8 +28,6 @@ bool Regexp::SimplifyRegexp(const StringPiece& src, ParseFlags flags,
Regexp* sre = re->Simplify();
re->Decref();
if (sre == NULL) {
- // Should not happen, since Simplify never fails.
- LOG(ERROR) << "Simplify failed on " << src;
if (status) {
status->set_code(kRegexpInternalError);
status->set_error_arg(src);
@@ -180,10 +178,20 @@ Regexp* Regexp::Simplify() {
CoalesceWalker cw;
Regexp* cre = cw.Walk(this, NULL);
if (cre == NULL)
- return cre;
+ return NULL;
+ if (cw.stopped_early()) {
+ cre->Decref();
+ return NULL;
+ }
SimplifyWalker sw;
Regexp* sre = sw.Walk(cre, NULL);
cre->Decref();
+ if (sre == NULL)
+ return NULL;
+ if (sw.stopped_early()) {
+ sre->Decref();
+ return NULL;
+ }
return sre;
}
diff --git a/grpc/third_party/re2/re2/testing/charclass_test.cc b/grpc/third_party/re2/re2/testing/charclass_test.cc
index a2837a69..9c2a32f6 100644
--- a/grpc/third_party/re2/re2/testing/charclass_test.cc
+++ b/grpc/third_party/re2/re2/testing/charclass_test.cc
@@ -85,7 +85,7 @@ static CCTest tests[] = {
{ {-1} } },
};
-template<class CharClass>
+template <typename CharClass>
static void Broke(const char *desc, const CCTest* t, CharClass* cc) {
if (t == NULL) {
printf("\t%s:", desc);
@@ -136,7 +136,7 @@ void Delete(CharClassBuilder* cc) {
delete cc;
}
-template<class CharClass>
+template <typename CharClass>
bool CorrectCC(CharClass *cc, CCTest *t, const char *desc) {
typename CharClass::iterator it = cc->begin();
int size = 0;
diff --git a/grpc/third_party/re2/re2/testing/compile_test.cc b/grpc/third_party/re2/re2/testing/compile_test.cc
index 2096e2f0..47188307 100644
--- a/grpc/third_party/re2/re2/testing/compile_test.cc
+++ b/grpc/third_party/re2/re2/testing/compile_test.cc
@@ -109,6 +109,20 @@ static Test tests[] = {
{ "[[-`]",
"3. byte [5b-60] 0 -> 4\n"
"4. match! 0\n" },
+ // Issue 310
+ { "(?:|a)*",
+ "3+ nop -> 7\n"
+ "4. nop -> 9\n"
+ "5+ nop -> 7\n"
+ "6. nop -> 9\n"
+ "7+ nop -> 5\n"
+ "8. byte [61-61] 0 -> 5\n"
+ "9. match! 0\n" },
+ { "(?:|a)+",
+ "3+ nop -> 5\n"
+ "4. byte [61-61] 0 -> 5\n"
+ "5+ nop -> 3\n"
+ "6. match! 0\n" },
};
TEST(TestRegexpCompileToProg, Simple) {
@@ -338,27 +352,37 @@ TEST(TestCompile, Bug35237384) {
forward);
Dump("(a*|b*)*{3,}", Regexp::Latin1|Regexp::NeverCapture, &forward, NULL);
- EXPECT_EQ("3+ nop -> 6\n"
- "4+ nop -> 8\n"
- "5. nop -> 21\n"
- "6+ byte [61-61] 1 -> 6\n"
- "7. nop -> 3\n"
- "8+ byte [62-62] 1 -> 8\n"
- "9. nop -> 3\n"
- "10+ byte [61-61] 1 -> 10\n"
- "11. nop -> 21\n"
- "12+ byte [62-62] 1 -> 12\n"
- "13. nop -> 21\n"
- "14+ byte [61-61] 1 -> 14\n"
- "15. nop -> 18\n"
- "16+ byte [62-62] 1 -> 16\n"
- "17. nop -> 18\n"
- "18+ nop -> 14\n"
- "19+ nop -> 16\n"
- "20. match! 0\n"
- "21+ nop -> 10\n"
- "22+ nop -> 12\n"
- "23. nop -> 18\n",
+ EXPECT_EQ("3+ nop -> 28\n"
+ "4. nop -> 30\n"
+ "5+ byte [61-61] 1 -> 5\n"
+ "6. nop -> 32\n"
+ "7+ byte [61-61] 1 -> 7\n"
+ "8. nop -> 26\n"
+ "9+ byte [61-61] 1 -> 9\n"
+ "10. nop -> 20\n"
+ "11+ byte [62-62] 1 -> 11\n"
+ "12. nop -> 20\n"
+ "13+ byte [62-62] 1 -> 13\n"
+ "14. nop -> 26\n"
+ "15+ byte [62-62] 1 -> 15\n"
+ "16. nop -> 32\n"
+ "17+ nop -> 9\n"
+ "18. nop -> 11\n"
+ "19. match! 0\n"
+ "20+ nop -> 17\n"
+ "21. nop -> 19\n"
+ "22+ nop -> 7\n"
+ "23. nop -> 13\n"
+ "24+ nop -> 17\n"
+ "25. nop -> 19\n"
+ "26+ nop -> 22\n"
+ "27. nop -> 24\n"
+ "28+ nop -> 5\n"
+ "29. nop -> 15\n"
+ "30+ nop -> 22\n"
+ "31. nop -> 24\n"
+ "32+ nop -> 28\n"
+ "33. nop -> 30\n",
forward);
Dump("((|S.+)+|(|S.+)+|){2}", Regexp::Latin1|Regexp::NeverCapture, &forward, NULL);
diff --git a/grpc/third_party/re2/re2/testing/dfa_test.cc b/grpc/third_party/re2/re2/testing/dfa_test.cc
index 9e15a41e..842daaff 100644
--- a/grpc/third_party/re2/re2/testing/dfa_test.cc
+++ b/grpc/third_party/re2/re2/testing/dfa_test.cc
@@ -143,7 +143,7 @@ TEST(SingleThreaded, SearchDFA) {
// NFA implementation instead. (The DFA loses its speed advantage
// if it can't get a good cache hit rate.)
// Tell the DFA to trudge along instead.
- Prog::TEST_dfa_should_bail_when_slow(false);
+ Prog::TESTING_ONLY_set_dfa_should_bail_when_slow(false);
state_cache_resets = 0;
search_failures = 0;
@@ -194,7 +194,7 @@ TEST(SingleThreaded, SearchDFA) {
re->Decref();
// Reset to original behaviour.
- Prog::TEST_dfa_should_bail_when_slow(true);
+ Prog::TESTING_ONLY_set_dfa_should_bail_when_slow(true);
ASSERT_GT(state_cache_resets, 0);
ASSERT_EQ(search_failures, 0);
}
@@ -218,7 +218,7 @@ static void DoSearch(Prog* prog, const StringPiece& match,
}
TEST(Multithreaded, SearchDFA) {
- Prog::TEST_dfa_should_bail_when_slow(false);
+ Prog::TESTING_ONLY_set_dfa_should_bail_when_slow(false);
state_cache_resets = 0;
search_failures = 0;
@@ -259,7 +259,7 @@ TEST(Multithreaded, SearchDFA) {
re->Decref();
// Reset to original behaviour.
- Prog::TEST_dfa_should_bail_when_slow(true);
+ Prog::TESTING_ONLY_set_dfa_should_bail_when_slow(true);
ASSERT_GT(state_cache_resets, 0);
ASSERT_EQ(search_failures, 0);
}
diff --git a/grpc/third_party/re2/re2/testing/filtered_re2_test.cc b/grpc/third_party/re2/re2/testing/filtered_re2_test.cc
index deef2f87..c788fdad 100644
--- a/grpc/third_party/re2/re2/testing/filtered_re2_test.cc
+++ b/grpc/third_party/re2/re2/testing/filtered_re2_test.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <utility>
#include "util/test.h"
#include "util/logging.h"
@@ -291,4 +292,49 @@ TEST(FilteredRE2Test, EmptyStringInStringSetBug) {
"EmptyStringInStringSetBug", &v));
}
+TEST(FilteredRE2Test, MoveSemantics) {
+ FilterTestVars v1;
+ int id;
+ v1.f.Add("foo\\d+", v1.opts, &id);
+ EXPECT_EQ(0, id);
+ v1.f.Compile(&v1.atoms);
+ EXPECT_EQ(1, v1.atoms.size());
+ EXPECT_EQ("foo", v1.atoms[0]);
+ v1.f.AllMatches("abc foo1 xyz", {0}, &v1.matches);
+ EXPECT_EQ(1, v1.matches.size());
+ EXPECT_EQ(0, v1.matches[0]);
+ v1.f.AllMatches("abc bar2 xyz", {0}, &v1.matches);
+ EXPECT_EQ(0, v1.matches.size());
+
+ // The moved-to object should do what the moved-from object did.
+ FilterTestVars v2;
+ v2.f = std::move(v1.f);
+ v2.f.AllMatches("abc foo1 xyz", {0}, &v2.matches);
+ EXPECT_EQ(1, v2.matches.size());
+ EXPECT_EQ(0, v2.matches[0]);
+ v2.f.AllMatches("abc bar2 xyz", {0}, &v2.matches);
+ EXPECT_EQ(0, v2.matches.size());
+
+ // The moved-from object should have been reset and be reusable.
+ v1.f.Add("bar\\d+", v1.opts, &id);
+ EXPECT_EQ(0, id);
+ v1.f.Compile(&v1.atoms);
+ EXPECT_EQ(1, v1.atoms.size());
+ EXPECT_EQ("bar", v1.atoms[0]);
+ v1.f.AllMatches("abc foo1 xyz", {0}, &v1.matches);
+ EXPECT_EQ(0, v1.matches.size());
+ v1.f.AllMatches("abc bar2 xyz", {0}, &v1.matches);
+ EXPECT_EQ(1, v1.matches.size());
+ EXPECT_EQ(0, v1.matches[0]);
+
+ // Verify that "overwriting" works and also doesn't leak memory.
+ // (The latter will need a leak detector such as LeakSanitizer.)
+ v1.f = std::move(v2.f);
+ v1.f.AllMatches("abc foo1 xyz", {0}, &v1.matches);
+ EXPECT_EQ(1, v1.matches.size());
+ EXPECT_EQ(0, v1.matches[0]);
+ v1.f.AllMatches("abc bar2 xyz", {0}, &v1.matches);
+ EXPECT_EQ(0, v1.matches.size());
+}
+
} // namespace re2
diff --git a/grpc/third_party/re2/re2/testing/parse_test.cc b/grpc/third_party/re2/re2/testing/parse_test.cc
index 34465269..e571127b 100644
--- a/grpc/third_party/re2/re2/testing/parse_test.cc
+++ b/grpc/third_party/re2/re2/testing/parse_test.cc
@@ -164,6 +164,7 @@ static Test tests[] = {
// Test named captures
{ "(?P<name>a)", "cap{name:lit{a}}" },
+ { "(?P<äž­æ–‡>a)", "cap{äž­æ–‡:lit{a}}" },
// Case-folded literals
{ "[Aa]", "litfold{a}" },
diff --git a/grpc/third_party/re2/re2/testing/re2_arg_test.cc b/grpc/third_party/re2/re2/testing/re2_arg_test.cc
index 7a38de7c..f62e17cf 100644
--- a/grpc/third_party/re2/re2/testing/re2_arg_test.cc
+++ b/grpc/third_party/re2/re2/testing/re2_arg_test.cc
@@ -11,6 +11,7 @@
#include <string.h>
#include "util/test.h"
+#include "util/logging.h"
#include "re2/re2.h"
namespace re2 {
@@ -132,4 +133,28 @@ TEST(RE2ArgTest, Uint64Test) {
PARSE_FOR_TYPE(uint64_t, 5);
}
+TEST(RE2ArgTest, ParseFromTest) {
+#if !defined(_MSC_VER)
+ struct {
+ bool ParseFrom(const char* str, size_t n) {
+ LOG(INFO) << "str = " << str << ", n = " << n;
+ return true;
+ }
+ } obj1;
+ RE2::Arg arg1(&obj1);
+ EXPECT_TRUE(arg1.Parse("one", 3));
+
+ struct {
+ bool ParseFrom(const char* str, size_t n) {
+ LOG(INFO) << "str = " << str << ", n = " << n;
+ return false;
+ }
+ // Ensure that RE2::Arg works even with overloaded ParseFrom().
+ void ParseFrom(const char* str) {}
+ } obj2;
+ RE2::Arg arg2(&obj2);
+ EXPECT_FALSE(arg2.Parse("two", 3));
+#endif
+}
+
} // namespace re2
diff --git a/grpc/third_party/re2/re2/testing/re2_test.cc b/grpc/third_party/re2/re2/testing/re2_test.cc
index ec457fbe..b1f7d733 100644
--- a/grpc/third_party/re2/re2/testing/re2_test.cc
+++ b/grpc/third_party/re2/re2/testing/re2_test.cc
@@ -485,37 +485,37 @@ TEST(ProgramFanout, BigProgram) {
std::vector<int> histogram;
- // 3 is the largest non-empty bucket and has 1 element.
+ // 3 is the largest non-empty bucket and has 2 element.
ASSERT_EQ(3, re1.ProgramFanout(&histogram));
- ASSERT_EQ(1, histogram[3]);
+ ASSERT_EQ(2, histogram[3]);
- // 6 is the largest non-empty bucket and has 10 elements.
+ // 6 is the largest non-empty bucket and has 11 elements.
ASSERT_EQ(6, re10.ProgramFanout(&histogram));
- ASSERT_EQ(10, histogram[6]);
+ ASSERT_EQ(11, histogram[6]);
- // 9 is the largest non-empty bucket and has 100 elements.
+ // 9 is the largest non-empty bucket and has 101 elements.
ASSERT_EQ(9, re100.ProgramFanout(&histogram));
- ASSERT_EQ(100, histogram[9]);
+ ASSERT_EQ(101, histogram[9]);
- // 13 is the largest non-empty bucket and has 1000 elements.
+ // 13 is the largest non-empty bucket and has 1001 elements.
ASSERT_EQ(13, re1000.ProgramFanout(&histogram));
- ASSERT_EQ(1000, histogram[13]);
+ ASSERT_EQ(1001, histogram[13]);
- // 2 is the largest non-empty bucket and has 1 element.
+ // 2 is the largest non-empty bucket and has 2 element.
ASSERT_EQ(2, re1.ReverseProgramFanout(&histogram));
- ASSERT_EQ(1, histogram[2]);
+ ASSERT_EQ(2, histogram[2]);
- // 5 is the largest non-empty bucket and has 10 elements.
+ // 5 is the largest non-empty bucket and has 11 elements.
ASSERT_EQ(5, re10.ReverseProgramFanout(&histogram));
- ASSERT_EQ(10, histogram[5]);
+ ASSERT_EQ(11, histogram[5]);
- // 9 is the largest non-empty bucket and has 100 elements.
+ // 9 is the largest non-empty bucket and has 101 elements.
ASSERT_EQ(9, re100.ReverseProgramFanout(&histogram));
- ASSERT_EQ(100, histogram[9]);
+ ASSERT_EQ(101, histogram[9]);
- // 12 is the largest non-empty bucket and has 1000 elements.
+ // 12 is the largest non-empty bucket and has 1001 elements.
ASSERT_EQ(12, re1000.ReverseProgramFanout(&histogram));
- ASSERT_EQ(1000, histogram[12]);
+ ASSERT_EQ(1001, histogram[12]);
}
// Issue 956519: handling empty character sets was
@@ -1277,38 +1277,43 @@ TEST(RE2, CL8622304) {
EXPECT_EQ(val, "1,0x2F,030,4,5");
}
-
// Check that RE2 returns correct regexp pieces on error.
// In particular, make sure it returns whole runes
// and that it always reports invalid UTF-8.
// Also check that Perl error flag piece is big enough.
static struct ErrorTest {
const char *regexp;
- const char *error;
+ RE2::ErrorCode error_code;
+ const char *error_arg;
} error_tests[] = {
- { "ab\\αcd", "\\α" },
- { "ef\\xâ˜ș01", "\\xâ˜ș0" },
- { "gh\\x1â˜ș01", "\\x1â˜ș" },
- { "ij\\x1", "\\x1" },
- { "kl\\x", "\\x" },
- { "uv\\x{0000â˜ș}", "\\x{0000â˜ș" },
- { "wx\\p{ABC", "\\p{ABC" },
- { "yz(?smiUX:abc)", "(?smiUX" }, // used to return (?s but the error is X
- { "aa(?smâ˜și", "(?smâ˜ș" },
- { "bb[abc", "[abc" },
-
- { "mn\\x1\377", "" }, // no argument string returned for invalid UTF-8
- { "op\377qr", "" },
- { "st\\x{00000\377", "" },
- { "zz\\p{\377}", "" },
- { "zz\\x{00\377}", "" },
- { "zz(?P<name\377>abc)", "" },
+ { "ab\\αcd", RE2::ErrorBadEscape, "\\α" },
+ { "ef\\xâ˜ș01", RE2::ErrorBadEscape, "\\xâ˜ș0" },
+ { "gh\\x1â˜ș01", RE2::ErrorBadEscape, "\\x1â˜ș" },
+ { "ij\\x1", RE2::ErrorBadEscape, "\\x1" },
+ { "kl\\x", RE2::ErrorBadEscape, "\\x" },
+ { "uv\\x{0000â˜ș}", RE2::ErrorBadEscape, "\\x{0000â˜ș" },
+ { "wx\\p{ABC", RE2::ErrorBadCharRange, "\\p{ABC" },
+ // used to return (?s but the error is X
+ { "yz(?smiUX:abc)", RE2::ErrorBadPerlOp, "(?smiUX" },
+ { "aa(?smâ˜și", RE2::ErrorBadPerlOp, "(?smâ˜ș" },
+ { "bb[abc", RE2::ErrorMissingBracket, "[abc" },
+ { "abc(def", RE2::ErrorMissingParen, "abc(def" },
+ { "abc)def", RE2::ErrorUnexpectedParen, "abc)def" },
+
+ // no argument string returned for invalid UTF-8
+ { "mn\\x1\377", RE2::ErrorBadUTF8, "" },
+ { "op\377qr", RE2::ErrorBadUTF8, "" },
+ { "st\\x{00000\377", RE2::ErrorBadUTF8, "" },
+ { "zz\\p{\377}", RE2::ErrorBadUTF8, "" },
+ { "zz\\x{00\377}", RE2::ErrorBadUTF8, "" },
+ { "zz(?P<name\377>abc)", RE2::ErrorBadUTF8, "" },
};
-TEST(RE2, ErrorArgs) {
+TEST(RE2, ErrorCodeAndArg) {
for (size_t i = 0; i < arraysize(error_tests); i++) {
RE2 re(error_tests[i].regexp, RE2::Quiet);
EXPECT_FALSE(re.ok());
- EXPECT_EQ(re.error_arg(), error_tests[i].error) << re.error();
+ EXPECT_EQ(re.error_code(), error_tests[i].error_code) << re.error();
+ EXPECT_EQ(re.error_arg(), error_tests[i].error_arg) << re.error();
}
}
@@ -1636,4 +1641,19 @@ TEST(RE2, Issue104) {
ASSERT_EQ("氏äșșć°ç±»ć°", s);
}
+TEST(RE2, Issue310) {
+ // (?:|a)* matched more text than (?:|a)+ did.
+
+ std::string s = "aaa";
+ StringPiece m;
+
+ RE2 star("(?:|a)*");
+ ASSERT_TRUE(star.Match(s, 0, s.size(), RE2::UNANCHORED, &m, 1));
+ ASSERT_EQ(m, "") << " got m='" << m << "', want ''";
+
+ RE2 plus("(?:|a)+");
+ ASSERT_TRUE(plus.Match(s, 0, s.size(), RE2::UNANCHORED, &m, 1));
+ ASSERT_EQ(m, "") << " got m='" << m << "', want ''";
+}
+
} // namespace re2
diff --git a/grpc/third_party/re2/re2/testing/regexp_benchmark.cc b/grpc/third_party/re2/re2/testing/regexp_benchmark.cc
index d85784f1..3eeb0988 100644
--- a/grpc/third_party/re2/re2/testing/regexp_benchmark.cc
+++ b/grpc/third_party/re2/re2/testing/regexp_benchmark.cc
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <string>
#include <thread>
+#include <unordered_map>
#include <utility>
#include "util/benchmark.h"
@@ -20,6 +21,7 @@
#include "re2/prog.h"
#include "re2/re2.h"
#include "re2/regexp.h"
+#include "util/mutex.h"
#include "util/pcre.h"
namespace re2 {
@@ -152,32 +154,38 @@ ParseImpl SearchParse1CachedPCRE, SearchParse1CachedRE2;
// Generate random text that won't contain the search string,
// to test worst-case search behavior.
-void MakeText(std::string* text, int64_t nbytes) {
- srand(1);
- text->resize(nbytes);
- for (int64_t i = 0; i < nbytes; i++) {
- // Generate a one-byte rune that isn't a control character (e.g. '\n').
- // Clipping to 0x20 introduces some bias, but we don't need uniformity.
- int byte = rand() & 0x7F;
- if (byte < 0x20)
- byte = 0x20;
- (*text)[i] = byte;
- }
+std::string RandomText(int64_t nbytes) {
+ static const std::string* const text = []() {
+ std::string* text = new std::string;
+ srand(1);
+ text->resize(16<<20);
+ for (int64_t i = 0; i < 16<<20; i++) {
+ // Generate a one-byte rune that isn't a control character (e.g. '\n').
+ // Clipping to 0x20 introduces some bias, but we don't need uniformity.
+ int byte = rand() & 0x7F;
+ if (byte < 0x20)
+ byte = 0x20;
+ (*text)[i] = byte;
+ }
+ return text;
+ }();
+ CHECK_LE(nbytes, 16<<20);
+ return text->substr(0, nbytes);
}
// Makes text of size nbytes, then calls run to search
// the text for regexp iters times.
void Search(benchmark::State& state, const char* regexp, SearchImpl* search) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
search(state, regexp, s, Prog::kUnanchored, false);
state.SetBytesProcessed(state.iterations() * state.range(0));
}
-// These two are easy because they start with an A,
-// giving the search loop something to memchr for.
+// These three are easy because they have prefixes,
+// giving the search loop something to prefix accel.
#define EASY0 "ABCDEFGHIJKLMNOPQRSTUVWXYZ$"
#define EASY1 "A[AB]B[BC]C[CD]D[DE]E[EF]F[FG]G[GH]H[HI]I[IJ]J$"
+#define EASY2 "(?i)" EASY0
// This is a little harder, since it starts with a character class
// and thus can't be memchr'ed. Could look for ABC and work backward,
@@ -221,6 +229,18 @@ BENCHMARK_RANGE(Search_Easy1_CachedPCRE, 8, 16<<20)->ThreadRange(1, NumCPUs()
#endif
BENCHMARK_RANGE(Search_Easy1_CachedRE2, 8, 16<<20)->ThreadRange(1, NumCPUs());
+void Search_Easy2_CachedDFA(benchmark::State& state) { Search(state, EASY2, SearchCachedDFA); }
+void Search_Easy2_CachedNFA(benchmark::State& state) { Search(state, EASY2, SearchCachedNFA); }
+void Search_Easy2_CachedPCRE(benchmark::State& state) { Search(state, EASY2, SearchCachedPCRE); }
+void Search_Easy2_CachedRE2(benchmark::State& state) { Search(state, EASY2, SearchCachedRE2); }
+
+BENCHMARK_RANGE(Search_Easy2_CachedDFA, 8, 16<<20)->ThreadRange(1, NumCPUs());
+BENCHMARK_RANGE(Search_Easy2_CachedNFA, 8, 256<<10)->ThreadRange(1, NumCPUs());
+#ifdef USEPCRE
+BENCHMARK_RANGE(Search_Easy2_CachedPCRE, 8, 16<<20)->ThreadRange(1, NumCPUs());
+#endif
+BENCHMARK_RANGE(Search_Easy2_CachedRE2, 8, 16<<20)->ThreadRange(1, NumCPUs());
+
void Search_Medium_CachedDFA(benchmark::State& state) { Search(state, MEDIUM, SearchCachedDFA); }
void Search_Medium_CachedNFA(benchmark::State& state) { Search(state, MEDIUM, SearchCachedNFA); }
void Search_Medium_CachedPCRE(benchmark::State& state) { Search(state, MEDIUM, SearchCachedPCRE); }
@@ -273,8 +293,7 @@ void SearchBigFixed(benchmark::State& state, SearchImpl* search) {
std::string s;
s.append(state.range(0)/2, 'x');
std::string regexp = "^" + s + ".*$";
- std::string t;
- MakeText(&t, state.range(0)/2);
+ std::string t = RandomText(state.range(0)/2);
s += t;
search(state, regexp.c_str(), s, Prog::kUnanchored, true);
state.SetBytesProcessed(state.iterations() * state.range(0));
@@ -295,8 +314,7 @@ BENCHMARK_RANGE(Search_BigFixed_CachedRE2, 8, 1<<20)->ThreadRange(1, NumCPUs
// Benchmark: FindAndConsume
void FindAndConsume(benchmark::State& state) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
s.append("Hello World");
RE2 re("((Hello World))");
for (auto _ : state) {
@@ -314,8 +332,7 @@ BENCHMARK_RANGE(FindAndConsume, 8, 16<<20)->ThreadRange(1, NumCPUs());
void SearchSuccess(benchmark::State& state, const char* regexp,
SearchImpl* search) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
search(state, regexp, s, Prog::kAnchored, true);
state.SetBytesProcessed(state.iterations() * state.range(0));
}
@@ -385,8 +402,7 @@ BENCHMARK_RANGE(Search_Success1_CachedBitState, 8, 2<<20)->ThreadRange(1, NumCPU
// Note that OnePass doesn't implement it!
void SearchAltMatch(benchmark::State& state, SearchImpl* search) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
search(state, "\\C*", s, Prog::kAnchored, true);
state.SetBytesProcessed(state.iterations() * state.range(0));
}
@@ -770,8 +786,7 @@ BENCHMARK(BM_RE2_Compile)->ThreadRange(1, NumCPUs());
// Makes text of size nbytes, then calls run to search
// the text for regexp iters times.
void SearchPhone(benchmark::State& state, ParseImpl* search) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
s.append("(650) 253-0001");
search(state, "(\\d{3}-|\\(\\d{3}\\)\\s+)(\\d{3}-\\d{4})", s);
state.SetBytesProcessed(state.iterations() * state.range(0));
@@ -939,13 +954,54 @@ void SearchRE2(benchmark::State& state, const char* regexp,
// regexp parsing and compiling once. This lets us measure
// search time without the per-regexp overhead.
+Prog* GetCachedProg(const char* regexp) {
+ static auto& mutex = *new Mutex;
+ MutexLock lock(&mutex);
+ static auto& cache = *new std::unordered_map<std::string, Prog*>;
+ Prog* prog = cache[regexp];
+ if (prog == NULL) {
+ Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
+ CHECK(re);
+ prog = re->CompileToProg(int64_t{1}<<31); // mostly for the DFA
+ CHECK(prog);
+ cache[regexp] = prog;
+ re->Decref();
+ // We must call this here - while we have exclusive access.
+ prog->IsOnePass();
+ }
+ return prog;
+}
+
+PCRE* GetCachedPCRE(const char* regexp) {
+ static auto& mutex = *new Mutex;
+ MutexLock lock(&mutex);
+ static auto& cache = *new std::unordered_map<std::string, PCRE*>;
+ PCRE* re = cache[regexp];
+ if (re == NULL) {
+ re = new PCRE(regexp, PCRE::UTF8);
+ CHECK_EQ(re->error(), "");
+ cache[regexp] = re;
+ }
+ return re;
+}
+
+RE2* GetCachedRE2(const char* regexp) {
+ static auto& mutex = *new Mutex;
+ MutexLock lock(&mutex);
+ static auto& cache = *new std::unordered_map<std::string, RE2*>;
+ RE2* re = cache[regexp];
+ if (re == NULL) {
+ re = new RE2(regexp);
+ CHECK_EQ(re->error(), "");
+ cache[regexp] = re;
+ }
+ return re;
+}
+
void SearchCachedDFA(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(int64_t{1}<<31);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
for (auto _ : state) {
bool failed = false;
CHECK_EQ(prog->SearchDFA(text, StringPiece(), anchor, Prog::kFirstMatch,
@@ -953,63 +1009,45 @@ void SearchCachedDFA(benchmark::State& state, const char* regexp,
expect_match);
CHECK(!failed);
}
- delete prog;
- re->Decref();
}
void SearchCachedNFA(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
for (auto _ : state) {
CHECK_EQ(prog->SearchNFA(text, StringPiece(), anchor, Prog::kFirstMatch,
NULL, 0),
expect_match);
}
- delete prog;
- re->Decref();
}
void SearchCachedOnePass(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->IsOnePass());
for (auto _ : state) {
CHECK_EQ(prog->SearchOnePass(text, text, anchor, Prog::kFirstMatch, NULL, 0),
expect_match);
}
- delete prog;
- re->Decref();
}
void SearchCachedBitState(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->CanBitState());
for (auto _ : state) {
CHECK_EQ(prog->SearchBitState(text, text, anchor, Prog::kFirstMatch, NULL, 0),
expect_match);
}
- delete prog;
- re->Decref();
}
void SearchCachedPCRE(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- PCRE re(regexp, PCRE::UTF8);
- CHECK_EQ(re.error(), "");
+ PCRE& re = *GetCachedPCRE(regexp);
for (auto _ : state) {
if (anchor == Prog::kAnchored)
CHECK_EQ(PCRE::FullMatch(text, re), expect_match);
@@ -1021,8 +1059,7 @@ void SearchCachedPCRE(benchmark::State& state, const char* regexp,
void SearchCachedRE2(benchmark::State& state, const char* regexp,
const StringPiece& text, Prog::Anchor anchor,
bool expect_match) {
- RE2 re(regexp);
- CHECK_EQ(re.error(), "");
+ RE2& re = *GetCachedRE2(regexp);
for (auto _ : state) {
if (anchor == Prog::kAnchored)
CHECK_EQ(RE2::FullMatch(text, re), expect_match);
@@ -1115,67 +1152,46 @@ void Parse3RE2(benchmark::State& state, const char* regexp,
void Parse3CachedNFA(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
StringPiece sp[4]; // 4 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored,
Prog::kFullMatch, sp, 4));
}
- delete prog;
- re->Decref();
}
void Parse3CachedOnePass(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->IsOnePass());
StringPiece sp[4]; // 4 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchOnePass(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 4));
}
- delete prog;
- re->Decref();
}
void Parse3CachedBitState(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->CanBitState());
StringPiece sp[4]; // 4 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchBitState(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 4));
}
- delete prog;
- re->Decref();
}
void Parse3CachedBacktrack(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
StringPiece sp[4]; // 4 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->UnsafeSearchBacktrack(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 4));
}
- delete prog;
- re->Decref();
}
void Parse3CachedPCRE(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- PCRE re(regexp, PCRE::UTF8);
- CHECK_EQ(re.error(), "");
+ PCRE& re = *GetCachedPCRE(regexp);
StringPiece sp1, sp2, sp3;
for (auto _ : state) {
CHECK(PCRE::FullMatch(text, re, &sp1, &sp2, &sp3));
@@ -1184,8 +1200,7 @@ void Parse3CachedPCRE(benchmark::State& state, const char* regexp,
void Parse3CachedRE2(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- RE2 re(regexp);
- CHECK_EQ(re.error(), "");
+ RE2& re = *GetCachedRE2(regexp);
StringPiece sp1, sp2, sp3;
for (auto _ : state) {
CHECK(RE2::FullMatch(text, re, &sp1, &sp2, &sp3));
@@ -1262,67 +1277,46 @@ void Parse1RE2(benchmark::State& state, const char* regexp,
void Parse1CachedNFA(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
StringPiece sp[2]; // 2 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchNFA(text, StringPiece(), Prog::kAnchored,
Prog::kFullMatch, sp, 2));
}
- delete prog;
- re->Decref();
}
void Parse1CachedOnePass(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->IsOnePass());
StringPiece sp[2]; // 2 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchOnePass(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 2));
}
- delete prog;
- re->Decref();
}
void Parse1CachedBitState(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
CHECK(prog->CanBitState());
StringPiece sp[2]; // 2 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->SearchBitState(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 2));
}
- delete prog;
- re->Decref();
}
void Parse1CachedBacktrack(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
- CHECK(re);
- Prog* prog = re->CompileToProg(0);
- CHECK(prog);
+ Prog* prog = GetCachedProg(regexp);
StringPiece sp[2]; // 2 because sp[0] is whole match.
for (auto _ : state) {
CHECK(prog->UnsafeSearchBacktrack(text, text, Prog::kAnchored, Prog::kFullMatch, sp, 2));
}
- delete prog;
- re->Decref();
}
void Parse1CachedPCRE(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- PCRE re(regexp, PCRE::UTF8);
- CHECK_EQ(re.error(), "");
+ PCRE& re = *GetCachedPCRE(regexp);
StringPiece sp1;
for (auto _ : state) {
CHECK(PCRE::FullMatch(text, re, &sp1));
@@ -1331,8 +1325,7 @@ void Parse1CachedPCRE(benchmark::State& state, const char* regexp,
void Parse1CachedRE2(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- RE2 re(regexp);
- CHECK_EQ(re.error(), "");
+ RE2& re = *GetCachedRE2(regexp);
StringPiece sp1;
for (auto _ : state) {
CHECK(RE2::FullMatch(text, re, &sp1));
@@ -1341,8 +1334,7 @@ void Parse1CachedRE2(benchmark::State& state, const char* regexp,
void SearchParse2CachedPCRE(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- PCRE re(regexp, PCRE::UTF8);
- CHECK_EQ(re.error(), "");
+ PCRE& re = *GetCachedPCRE(regexp);
for (auto _ : state) {
StringPiece sp1, sp2;
CHECK(PCRE::PartialMatch(text, re, &sp1, &sp2));
@@ -1351,8 +1343,7 @@ void SearchParse2CachedPCRE(benchmark::State& state, const char* regexp,
void SearchParse2CachedRE2(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- RE2 re(regexp);
- CHECK_EQ(re.error(), "");
+ RE2& re = *GetCachedRE2(regexp);
for (auto _ : state) {
StringPiece sp1, sp2;
CHECK(RE2::PartialMatch(text, re, &sp1, &sp2));
@@ -1361,8 +1352,7 @@ void SearchParse2CachedRE2(benchmark::State& state, const char* regexp,
void SearchParse1CachedPCRE(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- PCRE re(regexp, PCRE::UTF8);
- CHECK_EQ(re.error(), "");
+ PCRE& re = *GetCachedPCRE(regexp);
for (auto _ : state) {
StringPiece sp1;
CHECK(PCRE::PartialMatch(text, re, &sp1));
@@ -1371,8 +1361,7 @@ void SearchParse1CachedPCRE(benchmark::State& state, const char* regexp,
void SearchParse1CachedRE2(benchmark::State& state, const char* regexp,
const StringPiece& text) {
- RE2 re(regexp);
- CHECK_EQ(re.error(), "");
+ RE2& re = *GetCachedRE2(regexp);
for (auto _ : state) {
StringPiece sp1;
CHECK(RE2::PartialMatch(text, re, &sp1));
@@ -1507,8 +1496,7 @@ BENCHMARK(ASCIIMatchPCRE)->ThreadRange(1, NumCPUs());
BENCHMARK(ASCIIMatchRE2)->ThreadRange(1, NumCPUs());
void FullMatchPCRE(benchmark::State& state, const char *regexp) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
s += "ABCDEFGHIJ";
PCRE re(regexp);
for (auto _ : state) {
@@ -1518,8 +1506,7 @@ void FullMatchPCRE(benchmark::State& state, const char *regexp) {
}
void FullMatchRE2(benchmark::State& state, const char *regexp) {
- std::string s;
- MakeText(&s, state.range(0));
+ std::string s = RandomText(state.range(0));
s += "ABCDEFGHIJ";
RE2 re(regexp, RE2::Latin1);
for (auto _ : state) {
diff --git a/grpc/third_party/re2/re2/testing/required_prefix_test.cc b/grpc/third_party/re2/re2/testing/required_prefix_test.cc
index c00e8123..60a11f86 100644
--- a/grpc/third_party/re2/re2/testing/required_prefix_test.cc
+++ b/grpc/third_party/re2/re2/testing/required_prefix_test.cc
@@ -30,8 +30,8 @@ static PrefixTest tests[] = {
// If the regexp immediately goes into
// something not a literal match, there's no required prefix.
- { "^(abc)", false },
{ "^a*", false },
+ { "^(abc)", false },
// Otherwise, it should work.
{ "^abc$", true, "abc", false, "(?-m:$)" },
@@ -84,17 +84,25 @@ static PrefixTest for_accel_tests[] = {
// If the regexp immediately goes into
// something not a literal match, there's no required prefix.
- { "(abc)", false },
{ "a*", false },
+ // Unlike RequiredPrefix(), RequiredPrefixForAccel() can "see through"
+ // capturing groups, but doesn't try to glue prefix fragments together.
+ { "(a?)def", false },
+ { "(ab?)def", true, "a", false },
+ { "(abc?)def", true, "ab", false },
+ { "(()a)def", false },
+ { "((a)b)def", true, "a", false },
+ { "((ab)c)def", true, "ab", false },
+
// Otherwise, it should work.
- { "abc$", true, "abc", false, },
- { "abc", true, "abc", false, },
- { "(?i)abc", true, "abc", true, },
- { "abcd*", true, "abc", false, },
- { "[Aa][Bb]cd*", true, "ab", true, },
- { "ab[Cc]d*", true, "ab", false, },
- { "â˜șabc", true, "â˜șabc", false, },
+ { "abc$", true, "abc", false },
+ { "abc", true, "abc", false },
+ { "(?i)abc", true, "abc", true },
+ { "abcd*", true, "abc", false },
+ { "[Aa][Bb]cd*", true, "ab", true },
+ { "ab[Cc]d*", true, "ab", false },
+ { "â˜șabc", true, "â˜șabc", false },
};
TEST(RequiredPrefixForAccel, SimpleTests) {
@@ -123,23 +131,69 @@ TEST(RequiredPrefixForAccel, SimpleTests) {
}
}
-TEST(PrefixAccel, BasicTest) {
- Regexp* re = Regexp::Parse("abc\\d+", Regexp::LikePerl, NULL);
+TEST(RequiredPrefixForAccel, CaseFoldingForKAndS) {
+ Regexp* re;
+ std::string p;
+ bool f;
+
+ // With Latin-1 encoding, `(?i)` prefixes can include 'k' and 's'.
+ re = Regexp::Parse("(?i)KLM", Regexp::LikePerl|Regexp::Latin1, NULL);
ASSERT_TRUE(re != NULL);
- Prog* prog = re->CompileToProg(0);
- ASSERT_TRUE(prog != NULL);
- for (int i = 0; i < 100; i++) {
- std::string text(i, 'a');
- const char* p = reinterpret_cast<const char*>(
- prog->PrefixAccel(text.data(), text.size()));
- EXPECT_TRUE(p == NULL);
- text.append("abc");
- p = reinterpret_cast<const char*>(
- prog->PrefixAccel(text.data(), text.size()));
- EXPECT_EQ(i, p-text.data());
- }
- delete prog;
+ ASSERT_TRUE(re->RequiredPrefixForAccel(&p, &f));
+ ASSERT_EQ(p, "klm");
+ ASSERT_EQ(f, true);
+ re->Decref();
+
+ re = Regexp::Parse("(?i)STU", Regexp::LikePerl|Regexp::Latin1, NULL);
+ ASSERT_TRUE(re != NULL);
+ ASSERT_TRUE(re->RequiredPrefixForAccel(&p, &f));
+ ASSERT_EQ(p, "stu");
+ ASSERT_EQ(f, true);
+ re->Decref();
+
+ // With UTF-8 encoding, `(?i)` prefixes can't include 'k' and 's'.
+ // This is because they match U+212A and U+017F, respectively, and
+ // so the parser ends up emitting character classes, not literals.
+ re = Regexp::Parse("(?i)KLM", Regexp::LikePerl, NULL);
+ ASSERT_TRUE(re != NULL);
+ ASSERT_FALSE(re->RequiredPrefixForAccel(&p, &f));
re->Decref();
+
+ re = Regexp::Parse("(?i)STU", Regexp::LikePerl, NULL);
+ ASSERT_TRUE(re != NULL);
+ ASSERT_FALSE(re->RequiredPrefixForAccel(&p, &f));
+ re->Decref();
+}
+
+static const char* prefix_accel_tests[] = {
+ "aababc\\d+",
+ "(?i)AABABC\\d+",
+};
+
+TEST(PrefixAccel, SimpleTests) {
+ for (size_t i = 0; i < arraysize(prefix_accel_tests); i++) {
+ const char* pattern = prefix_accel_tests[i];
+ Regexp* re = Regexp::Parse(pattern, Regexp::LikePerl, NULL);
+ ASSERT_TRUE(re != NULL);
+ Prog* prog = re->CompileToProg(0);
+ ASSERT_TRUE(prog != NULL);
+ ASSERT_TRUE(prog->can_prefix_accel());
+ for (int j = 0; j < 100; j++) {
+ std::string text(j, 'a');
+ const char* p = reinterpret_cast<const char*>(
+ prog->PrefixAccel(text.data(), text.size()));
+ EXPECT_TRUE(p == NULL);
+ text.append("aababc");
+ for (int k = 0; k < 100; k++) {
+ text.append(k, 'a');
+ p = reinterpret_cast<const char*>(
+ prog->PrefixAccel(text.data(), text.size()));
+ EXPECT_EQ(j, p - text.data());
+ }
+ }
+ delete prog;
+ re->Decref();
+ }
}
} // namespace re2
diff --git a/grpc/third_party/re2/re2/testing/search_test.cc b/grpc/third_party/re2/re2/testing/search_test.cc
index c20f501d..5d86dbfa 100644
--- a/grpc/third_party/re2/re2/testing/search_test.cc
+++ b/grpc/third_party/re2/re2/testing/search_test.cc
@@ -308,6 +308,8 @@ RegexpTest simple_tests[] = {
// Former bugs.
{ "a\\C*|ba\\C", "baba" },
{ "\\w*I\\w*", "Inc." },
+ { "(?:|a)*", "aaa" },
+ { "(?:|a)+", "aaa" },
};
TEST(Regexp, SearchTests) {
diff --git a/grpc/third_party/re2/re2/testing/set_test.cc b/grpc/third_party/re2/re2/testing/set_test.cc
index 61d1cf29..5a760c4b 100644
--- a/grpc/third_party/re2/re2/testing/set_test.cc
+++ b/grpc/third_party/re2/re2/testing/set_test.cc
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <string>
#include <vector>
+#include <utility>
#include "util/test.h"
#include "util/logging.h"
@@ -201,4 +202,29 @@ TEST(Set, Prefix) {
ASSERT_EQ(v[0], 0);
}
+TEST(Set, MoveSemantics) {
+ RE2::Set s1(RE2::DefaultOptions, RE2::UNANCHORED);
+ ASSERT_EQ(s1.Add("foo\\d+", NULL), 0);
+ ASSERT_EQ(s1.Compile(), true);
+ ASSERT_EQ(s1.Match("abc foo1 xyz", NULL), true);
+ ASSERT_EQ(s1.Match("abc bar2 xyz", NULL), false);
+
+ // The moved-to object should do what the moved-from object did.
+ RE2::Set s2 = std::move(s1);
+ ASSERT_EQ(s2.Match("abc foo1 xyz", NULL), true);
+ ASSERT_EQ(s2.Match("abc bar2 xyz", NULL), false);
+
+ // The moved-from object should have been reset and be reusable.
+ ASSERT_EQ(s1.Add("bar\\d+", NULL), 0);
+ ASSERT_EQ(s1.Compile(), true);
+ ASSERT_EQ(s1.Match("abc foo1 xyz", NULL), false);
+ ASSERT_EQ(s1.Match("abc bar2 xyz", NULL), true);
+
+ // Verify that "overwriting" works and also doesn't leak memory.
+ // (The latter will need a leak detector such as LeakSanitizer.)
+ s1 = std::move(s2);
+ ASSERT_EQ(s1.Match("abc foo1 xyz", NULL), true);
+ ASSERT_EQ(s1.Match("abc bar2 xyz", NULL), false);
+}
+
} // namespace re2
diff --git a/grpc/third_party/re2/re2/testing/tester.cc b/grpc/third_party/re2/re2/testing/tester.cc
index 67d262c2..d2ec4fb9 100644
--- a/grpc/third_party/re2/re2/testing/tester.cc
+++ b/grpc/third_party/re2/re2/testing/tester.cc
@@ -86,6 +86,20 @@ static uint32_t Engines() {
// The result of running a match.
struct TestInstance::Result {
+ Result()
+ : skipped(false),
+ matched(false),
+ untrusted(false),
+ have_submatch(false),
+ have_submatch0(false) {
+ ClearSubmatch();
+ }
+
+ void ClearSubmatch() {
+ for (int i = 0; i < kMaxSubmatch; i++)
+ submatch[i] = StringPiece();
+ }
+
bool skipped; // test skipped: wasn't applicable
bool matched; // found a match
bool untrusted; // don't really trust the answer
@@ -292,9 +306,6 @@ void TestInstance::RunSearch(Engine type,
const StringPiece& orig_context,
Prog::Anchor anchor,
Result* result) {
- // Result is not trivial, so we cannot freely clear it with memset(3),
- // but zeroing objects like so is safe and expedient for our purposes.
- memset(reinterpret_cast<void*>(result), 0, sizeof *result);
if (regexp_ == NULL) {
result->skipped = true;
return;
@@ -478,7 +489,7 @@ void TestInstance::RunSearch(Engine type,
}
if (!result->matched)
- memset(result->submatch, 0, sizeof result->submatch);
+ result->ClearSubmatch();
}
// Checks whether r is okay given that correct is the right answer.
diff --git a/grpc/third_party/re2/re2/tostring.cc b/grpc/third_party/re2/re2/tostring.cc
index 4545a92d..9c1c038c 100644
--- a/grpc/third_party/re2/re2/tostring.cc
+++ b/grpc/third_party/re2/re2/tostring.cc
@@ -291,7 +291,7 @@ int ToStringWalker::PostVisit(Regexp* re, int parent_arg, int pre_arg,
// There's no syntax accepted by the parser to generate
// this node (it is generated by RE2::Set) so make something
// up that is readable but won't compile.
- t_->append("(?HaveMatch:%d)", re->match_id());
+ t_->append(StringPrintf("(?HaveMatch:%d)", re->match_id()));
break;
}
diff --git a/grpc/third_party/re2/re2/walker-inl.h b/grpc/third_party/re2/re2/walker-inl.h
index 8cfe7996..8e0f9466 100644
--- a/grpc/third_party/re2/re2/walker-inl.h
+++ b/grpc/third_party/re2/re2/walker-inl.h
@@ -119,7 +119,7 @@ template<typename T> T Regexp::Walker<T>::Copy(T arg) {
// State about a single level in the traversal.
template<typename T> struct WalkState {
- WalkState<T>(Regexp* re, T parent)
+ WalkState(Regexp* re, T parent)
: re(re),
n(-1),
parent_arg(parent),
diff --git a/grpc/third_party/re2/testinstall.cc b/grpc/third_party/re2/testinstall.cc
index 47db4e68..19cc9003 100644
--- a/grpc/third_party/re2/testinstall.cc
+++ b/grpc/third_party/re2/testinstall.cc
@@ -2,23 +2,26 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-#include <re2/re2.h>
-#include <re2/filtered_re2.h>
#include <stdio.h>
+#include <re2/filtered_re2.h>
+#include <re2/re2.h>
+
+int main() {
+ re2::FilteredRE2 f;
+ int id;
+ f.Add("a.*b.*c", RE2::DefaultOptions, &id);
+ std::vector<std::string> v;
+ f.Compile(&v);
+ std::vector<int> ids;
+ f.FirstMatch("abbccc", ids);
-int main(void) {
- re2::FilteredRE2 f;
- int id;
- f.Add("a.*b.*c", RE2::DefaultOptions, &id);
- std::vector<std::string> v;
- f.Compile(&v);
- std::vector<int> ids;
- f.FirstMatch("abbccc", ids);
+ int n;
+ if (RE2::FullMatch("axbyc", "a.*b.*c") &&
+ RE2::PartialMatch("foo123bar", "(\\d+)", &n) && n == 123) {
+ printf("PASS\n");
+ return 0;
+ }
- if(RE2::FullMatch("axbyc", "a.*b.*c")) {
- printf("PASS\n");
- return 0;
- }
- printf("FAIL\n");
- return 2;
+ printf("FAIL\n");
+ return 2;
}
diff --git a/grpc/third_party/re2/util/mutex.h b/grpc/third_party/re2/util/mutex.h
index e2a8715e..158046bb 100644
--- a/grpc/third_party/re2/util/mutex.h
+++ b/grpc/third_party/re2/util/mutex.h
@@ -12,6 +12,7 @@
#ifdef _WIN32
// Requires Windows Vista or Windows Server 2008 at minimum.
+#include <windows.h>
#if defined(WINVER) && WINVER >= 0x0600
#define MUTEX_IS_WIN32_SRWLOCK
#endif
@@ -26,7 +27,6 @@
#endif
#if defined(MUTEX_IS_WIN32_SRWLOCK)
-#include <windows.h>
typedef SRWLOCK MutexType;
#elif defined(MUTEX_IS_PTHREAD_RWLOCK)
#include <pthread.h>
@@ -66,7 +66,7 @@ class Mutex {
#if defined(MUTEX_IS_WIN32_SRWLOCK)
-Mutex::Mutex() { InitializeSRWLock(&mutex_); }
+Mutex::Mutex() : mutex_(SRWLOCK_INIT) { }
Mutex::~Mutex() { }
void Mutex::Lock() { AcquireSRWLockExclusive(&mutex_); }
void Mutex::Unlock() { ReleaseSRWLockExclusive(&mutex_); }
diff --git a/grpc/third_party/re2/util/pcre.h b/grpc/third_party/re2/util/pcre.h
index 644dce68..896b0bdf 100644
--- a/grpc/third_party/re2/util/pcre.h
+++ b/grpc/third_party/re2/util/pcre.h
@@ -555,7 +555,7 @@ class PCRE_Options {
// Hex/Octal/Binary?
// Special class for parsing into objects that define a ParseFrom() method
-template <class T>
+template <typename T>
class _PCRE_MatchObject {
public:
static inline bool Parse(const char* str, size_t n, void* dest) {
@@ -600,9 +600,9 @@ class PCRE::Arg {
#undef MAKE_PARSER
// Generic constructor
- template <class T> Arg(T*, Parser parser);
+ template <typename T> Arg(T*, Parser parser);
// Generic constructor template
- template <class T> Arg(T* p)
+ template <typename T> Arg(T* p)
: arg_(p), parser_(_PCRE_MatchObject<T>::Parse) {
}
diff --git a/grpc/third_party/rules_python.patch b/grpc/third_party/rules_python.patch
new file mode 100644
index 00000000..3b2b5b8d
--- /dev/null
+++ b/grpc/third_party/rules_python.patch
@@ -0,0 +1,76 @@
+diff --git a/python/pip_install/pip_repository.bzl b/python/pip_install/pip_repository.bzl
+index c3007e1..f8a9234 100644
+--- a/python/pip_install/pip_repository.bzl
++++ b/python/pip_install/pip_repository.bzl
+@@ -39,7 +39,8 @@ def _resolve_python_interpreter(rctx):
+ if "/" not in python_interpreter:
+ python_interpreter = rctx.which(python_interpreter)
+ if not python_interpreter:
+- fail("python interpreter not found")
++ print("WARNING: python interpreter not found. Python targets will not be functional")
++ return ""
+ return python_interpreter
+
+ def _parse_optional_attrs(rctx, args):
+@@ -93,13 +94,49 @@ def _parse_optional_attrs(rctx, args):
+
+ return args
+
++def _generate_stub_requirements_bzl(rctx):
++ contents = """\
++def requirement(name):
++ return "@{repo}//:empty"
++""".format(repo=rctx.attr.name)
++ rctx.file("requirements.bzl", contents)
++
+ _BUILD_FILE_CONTENTS = """\
+ package(default_visibility = ["//visibility:public"])
+
+ # Ensure the `requirements.bzl` source can be accessed by stardoc, since users load() from it
+ exports_files(["requirements.bzl"])
++
++py_library(
++ name = "empty",
++ srcs = [],
++)
+ """
+
++def _python_version_info(rctx, python_interpreter, info_index):
++ cmd = [
++ python_interpreter,
++ "-c",
++ "from __future__ import print_function; import sys; print(sys.version_info[{}])".format(info_index)
++ ]
++ result = rctx.execute(cmd)
++ if result.stderr or not result.stdout:
++ print("WARNING: Failed to get version info from {}".format(python_interpreter))
++ return None
++ return int(result.stdout.strip())
++
++def _python_version_supported(rctx, python_interpreter):
++ major_version = _python_version_info(rctx, python_interpreter, 0)
++ minor_version = _python_version_info(rctx, python_interpreter, 1)
++ if major_version == None or minor_version == None:
++ print("WARNING: Failed to get Python version of {}".format(python_interpreter))
++ return False
++ if (major_version != 3 or minor_version < 6):
++ print("WARNING: {} is of version {}.{}. This version is unsupported.".format(python_interpreter, major_version, minor_version))
++ return False
++ return True
++
++
+ def _pip_repository_impl(rctx):
+ python_interpreter = _resolve_python_interpreter(rctx)
+
+@@ -109,6 +146,11 @@ def _pip_repository_impl(rctx):
+ # We need a BUILD file to load the generated requirements.bzl
+ rctx.file("BUILD.bazel", _BUILD_FILE_CONTENTS)
+
++ # Check if python interpreter has minimum required version.
++ if not python_interpreter or not _python_version_supported(rctx, python_interpreter):
++ _generate_stub_requirements_bzl(rctx)
++ return
++
+ pypath = _construct_pypath(rctx)
+
+ if rctx.attr.incremental:
diff --git a/grpc/third_party/six.BUILD b/grpc/third_party/six.BUILD
index b048db02..423082f2 100644
--- a/grpc/third_party/six.BUILD
+++ b/grpc/third_party/six.BUILD
@@ -1,6 +1,6 @@
genrule(
name = "copy_six",
- srcs = ["six-1.12.0/six.py"],
+ srcs = ["six-1.16.0/six.py"],
outs = ["__init__.py"],
cmd = "cp $< $(@)",
)
diff --git a/grpc/third_party/toolchains/BUILD b/grpc/third_party/toolchains/BUILD
index bb0b9b4f..5a8a128b 100644
--- a/grpc/third_party/toolchains/BUILD
+++ b/grpc/third_party/toolchains/BUILD
@@ -16,7 +16,7 @@ licenses(["notice"]) # Apache v2
package(default_visibility = ["//visibility:public"])
-load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_exec_properties_dict", "merge_dicts")
+load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict")
alias(
name = "rbe_windows",
@@ -30,19 +30,10 @@ platform(
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
],
- exec_properties = merge_dicts(
- create_exec_properties_dict(
- # See rbe_win2019/Dockerfile for image details
- container_image = "docker://gcr.io/grpc-testing/rbe_windows2019_withdbg_toolchain@sha256:7b04ee7e29f942adbf4f70edd2ec4ba20a3e7237e1b54f5cae4b239c6ca41105",
- os_family = "Windows",
- ),
- # TODO(jtattermusch): specifying 'labels = {"abc": "xyz"}' in create_exec_properties_dict
- # is not possible without https://github.com/bazelbuild/bazel-toolchains/pull/748
- # and currently the toolchain we're using is too old for that. To be able to select worker
- # pools through labels, we use a workaround and populate the corresponding label values
- # manually (see create_exec_properties_dict logic for how labels get transformed)
- # Remove this workaround once we transition to a new-enough bazel toolchain.
- # The next line corresponds to 'labels = {"os": "windows_2019", "machine_size": "small"}'
- {"label:os": "windows_2019", "label:machine_size": "small"}
+ exec_properties = create_rbe_exec_properties_dict(
+ # See rbe_win2019/Dockerfile for image details
+ container_image = "docker://gcr.io/grpc-testing/rbe_windows2019_withdbg_toolchain@sha256:7b04ee7e29f942adbf4f70edd2ec4ba20a3e7237e1b54f5cae4b239c6ca41105",
+ os_family = "Windows",
+ labels = {"os": "windows_2019", "machine_size": "small"},
),
)
diff --git a/grpc/third_party/upb/.bazelci/presubmit.yml b/grpc/third_party/upb/.bazelci/presubmit.yml
index 38ca7930..29bfc53c 100644
--- a/grpc/third_party/upb/.bazelci/presubmit.yml
+++ b/grpc/third_party/upb/.bazelci/presubmit.yml
@@ -1,7 +1,9 @@
---
tasks:
ubuntu:
- platform: ubuntu1604
+ platform: ubuntu1804
+ shell_commands:
+ - "sudo apt -y update && sudo apt -y install libreadline-dev cmake"
test_targets:
- //...
macos:
diff --git a/grpc/third_party/upb/.bazelignore b/grpc/third_party/upb/.bazelignore
new file mode 100644
index 00000000..e35d8850
--- /dev/null
+++ b/grpc/third_party/upb/.bazelignore
@@ -0,0 +1 @@
+_build
diff --git a/grpc/third_party/upb/.bazelrc b/grpc/third_party/upb/.bazelrc
index 7b9da717..23492c03 100644
--- a/grpc/third_party/upb/.bazelrc
+++ b/grpc/third_party/upb/.bazelrc
@@ -1,13 +1,28 @@
+# temporary fix for https://github.com/bazelbuild/bazel/issues/12905 on macOS
+build --features=-debug_prefix_map_pwd_is_dot
+
+build --extra_toolchains=@system_python//:python_toolchain
+
# Use our custom-configured c++ toolchain.
build:m32 --copt=-m32 --linkopt=-m32
build:asan --copt=-fsanitize=address --linkopt=-fsanitize=address
-build:valgrind --run_under='valgrind --leak-check=full --error-exitcode=1'
+build:msan --copt=-fsanitize=memory --linkopt=-fsanitize=memory
+
+# For Valgrind, we have to disable checks of "possible" leaks because the Python
+# interpreter does the sorts of things that flag Valgrind "possible" leak checks.
+# Ideally we could enforce a stricter check for the non-Python tests, but I don't
+# know of an easy way to do that.
+#
+# We also have to disable pymalloc to avoid triggering Valgrind.
+build:valgrind --run_under='valgrind --leak-check=full --track-origins=yes --trace-children=yes --show-leak-kinds=all --error-exitcode=1 --num-callers=500 ' --action_env=PYTHONMALLOC=malloc
build:ubsan --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
# Workaround for the fact that Bazel links with $CC, not $CXX
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr
+# Workaround for https://bugs.llvm.org/show_bug.cgi?id=16404
+build:ubsan --linkopt=--rtlib=compiler-rt --linkopt=-lunwind
build:Werror --copt=-Werror
build:Werror --per_file_copt=json/parser@-Wno-error
@@ -19,4 +34,25 @@ build:analyzer --per_file_copt=json/parser@-fno-analyzer
build:analyzer --per_file_copt=com_google_protobuf@-fno-analyzer
build:analyzer --per_file_copt=com_github_google_benchmark@-fno-analyzer
-build:asan-fuzzer --copt=-fsanitize=address,fuzzer --linkopt=-fsanitize=address,fuzzer --define fuzz=true
+# --config=asan-libfuzzer
+build:asan-libfuzzer --action_env=CC=clang
+build:asan-libfuzzer --action_env=CXX=clang++
+build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
+build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
+build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan
+
+# --config=msan-libfuzzer
+build:msan-libfuzzer --action_env=CC=clang
+build:msan-libfuzzer --action_env=CXX=clang++
+build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
+build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
+build:msan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=msan
+
+# --config=ubsan-libfuzzer
+build:ubsan-libfuzzer --action_env=CC=clang
+build:ubsan-libfuzzer --action_env=CXX=clang++
+build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
+build:ubsan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
+build:ubsan-libfuzzer --copt=-fsanitize=undefined
+build:ubsan-libfuzzer --linkopt=-fsanitize=undefined
+build:ubsan-libfuzzer --linkopt=-fsanitize-link-c++-runtime
diff --git a/grpc/third_party/upb/.clang-format b/grpc/third_party/upb/.clang-format
new file mode 100644
index 00000000..24d97f2b
--- /dev/null
+++ b/grpc/third_party/upb/.clang-format
@@ -0,0 +1,3 @@
+BasedOnStyle: Google
+DerivePointerAlignment: false
+PointerAlignment: Left
diff --git a/grpc/third_party/upb/.github/workflows/bazel_tests.yml b/grpc/third_party/upb/.github/workflows/bazel_tests.yml
new file mode 100644
index 00000000..35927107
--- /dev/null
+++ b/grpc/third_party/upb/.github/workflows/bazel_tests.yml
@@ -0,0 +1,38 @@
+name: Bazel Tests
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+
+ ubuntu:
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ fail-fast: false # Don't cancel all jobs if one fails.
+ matrix:
+ include:
+ - { CC: clang, os: ubuntu-20.04, flags: "" }
+ - { CC: clang, os: ubuntu-20.04, flags: "-c opt" } # Some warnings only fire with -c opt
+ - { CC: gcc, os: ubuntu-20.04, flags: "-c opt" }
+ - { CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" }
+ - { CC: clang, os: ubuntu-20.04, flags: "--config=asan -c dbg -- -benchmarks:benchmark -python/..." }
+ - { CC: clang, os: ubuntu-20.04, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -upb/bindings/lua/...", install: "libunwind-dev" }
+ - { CC: clang, os: ubuntu-20.04, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" }
+ - { CC: clang, os: macos-11, flags: "" }
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup Python venv
+ run: rm -rf /tmp/venv && python3 -m venv /tmp/venv
+ - name: Install dependencies
+ run: sudo apt update && sudo apt install -y ${{ matrix.install }}
+ if: matrix.install != ''
+ - name: Run tests
+ run: cd ${{ github.workspace }} && PATH=/tmp/venv/bin:$PATH CC=${{ matrix.CC }} bazel test --test_output=errors ... ${{ matrix.flags }}
diff --git a/grpc/third_party/upb/.github/workflows/cifuzz.yml b/grpc/third_party/upb/.github/workflows/cifuzz.yml
new file mode 100644
index 00000000..092b1079
--- /dev/null
+++ b/grpc/third_party/upb/.github/workflows/cifuzz.yml
@@ -0,0 +1,29 @@
+name: CIFuzz
+on: [pull_request]
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sanitizer: [address, undefined]
+ steps:
+ - name: Build Fuzzers (${{ matrix.sanitizer }})
+ uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'upb'
+ dry-run: false
+ sanitizer: ${{ matrix.sanitizer }}
+ - name: Run Fuzzers (${{ matrix.sanitizer }})
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'upb'
+ fuzz-seconds: 600
+ dry-run: false
+ sanitizer: ${{ matrix.sanitizer }}
+ - name: Upload Crash
+ uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: ${{ matrix.sanitizer }}-artifacts
+ path: ./out/artifacts
diff --git a/grpc/third_party/upb/.github/workflows/clang_format.yml b/grpc/third_party/upb/.github/workflows/clang_format.yml
new file mode 100644
index 00000000..b6e9fe24
--- /dev/null
+++ b/grpc/third_party/upb/.github/workflows/clang_format.yml
@@ -0,0 +1,20 @@
+name: Check ClangFormat
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ check_clang_format:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: Run ClangFormat
+ run: find . | grep -E '\.(c|h|cc)$' | grep -E -v '^./(third_party|cmake)' | xargs clang-format -i
+ - name: Check for differences
+ run: git diff --exit-code
diff --git a/grpc/third_party/upb/.github/workflows/generate_files.yml b/grpc/third_party/upb/.github/workflows/generate_files.yml
new file mode 100644
index 00000000..e4462f05
--- /dev/null
+++ b/grpc/third_party/upb/.github/workflows/generate_files.yml
@@ -0,0 +1,20 @@
+name: Generate Files
+
+# After any push to the main branch, re-generate pregenerated files.
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ generate:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Merge generated branch with main
+ run: cd ${{ github.workspace }} && (git checkout generated || git checkout -b generated) && git merge --no-edit main
+ - name: Rebuild generated CMake files
+ run: cd ${{ github.workspace }} && bazel test cmake:test_generated_files || bazel-bin/cmake/test_generated_files --fix
+ - name: Commit and push changes to generated files
+ run: cd ${{ github.workspace }} && git add -A && (git diff --staged --quiet || git commit -am "Regenerated files") && git push
diff --git a/grpc/third_party/upb/.gitignore b/grpc/third_party/upb/.gitignore
index c9bd5bec..79d6c53f 100644
--- a/grpc/third_party/upb/.gitignore
+++ b/grpc/third_party/upb/.gitignore
@@ -1,4 +1,6 @@
-*.s??
+*.sw?
obj/
lib/
bazel-*
+_build
+.vscode
diff --git a/grpc/third_party/upb/BUILD b/grpc/third_party/upb/BUILD
index 2e133263..434cefe4 100644
--- a/grpc/third_party/upb/BUILD
+++ b/grpc/third_party/upb/BUILD
@@ -1,7 +1,33 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
- "upb_amalgamation", # copybara:strip_for_google3
+ "UPB_DEFAULT_CPPOPTS",
+ "make_shell_script",
)
load(
"//bazel:upb_proto_library.bzl",
@@ -11,24 +37,29 @@ load(
"upb_proto_reflection_library",
)
-# copybara:strip_for_google3_begin
+# begin:github_only
load(
- "@rules_proto//proto:defs.bzl",
- "proto_library",
+ "//bazel:build_defs.bzl",
+ "upb_amalgamation",
)
+# end:github_only
-# copybara:strip_end
+licenses(["notice"])
-licenses(["notice"]) # BSD (Google-authored w/ possible external contributions)
+exports_files(["LICENSE"])
-exports_files([
- "LICENSE",
- "build_defs",
-])
+exports_files(
+ [
+ "BUILD",
+ "WORKSPACE",
+ ],
+ visibility = ["//cmake:__pkg__"],
+)
config_setting(
name = "windows",
constraint_values = ["@bazel_tools//platforms:windows"],
+ visibility = ["//visibility:public"],
)
upb_fasttable_enabled(
@@ -57,25 +88,26 @@ cc_library(
"upb/port_def.inc",
"upb/port_undef.inc",
],
- visibility = ["//tests:__pkg__"],
+ visibility = ["//:__subpackages__"],
)
cc_library(
name = "upb",
srcs = [
"upb/decode.c",
- "upb/decode.int.h",
+ "upb/decode_internal.h",
"upb/encode.c",
"upb/msg.c",
- "upb/msg.h",
+ "upb/msg_internal.h",
"upb/table.c",
- "upb/table.int.h",
+ "upb/table_internal.h",
"upb/upb.c",
- "upb/upb.int.h",
+ "upb/upb_internal.h",
],
hdrs = [
"upb/decode.h",
"upb/encode.h",
+ "upb/msg.h",
"upb/upb.h",
"upb/upb.hpp",
],
@@ -84,23 +116,65 @@ cc_library(
deps = [
":fastdecode",
":port",
- "//third_party/wyhash",
+ "//third_party/utf8_range",
+ ],
+)
+
+cc_library(
+ name = "mini_table_internal",
+ hdrs = ["upb/msg_internal.h"],
+ deps = [
+ ":port",
+ ":table",
+ ":upb",
+ ],
+)
+
+cc_library(
+ name = "mini_table",
+ srcs = ["upb/mini_table.c"],
+ hdrs = [
+ "upb/mini_table.h",
+ "upb/mini_table.hpp",
+ ],
+ copts = UPB_DEFAULT_COPTS,
+ visibility = ["//visibility:public"],
+ deps = [
+ ":mini_table_internal",
+ ":port",
+ ":upb",
+ ],
+)
+
+cc_test(
+ name = "mini_table_test",
+ srcs = ["upb/mini_table_test.cc"],
+ deps = [
+ ":mini_table",
+ ":mini_table_internal",
+ ":upb",
+ "@com_google_absl//absl/container:flat_hash_set",
+ "@com_google_googletest//:gtest_main",
+ "@com_google_protobuf//:protobuf",
],
)
cc_library(
name = "fastdecode",
srcs = [
- "upb/decode.int.h",
+ "upb/decode.h",
"upb/decode_fast.c",
"upb/decode_fast.h",
+ "upb/decode_internal.h",
"upb/msg.h",
- "upb/upb.int.h",
+ "upb/msg_internal.h",
+ "upb/upb_internal.h",
],
copts = UPB_DEFAULT_COPTS,
deps = [
":port",
":table",
+ "//third_party/utf8_range",
],
)
@@ -113,8 +187,11 @@ cc_library(
cc_library(
name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
hdrs = [
+ "upb/decode.h",
"upb/decode_fast.h",
+ "upb/encode.h",
"upb/msg.h",
+ "upb/msg_internal.h",
"upb/port_def.inc",
"upb/port_undef.inc",
],
@@ -126,6 +203,22 @@ cc_library(
],
)
+cc_library(
+ name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
+ hdrs = [
+ "upb/def.h",
+ "upb/port_def.inc",
+ "upb/port_undef.inc",
+ ],
+ copts = UPB_DEFAULT_COPTS,
+ visibility = ["//visibility:public"],
+ deps = [
+ ":descriptor_upb_proto",
+ ":reflection",
+ ":table",
+ ],
+)
+
upb_proto_library(
name = "descriptor_upb_proto",
visibility = ["//visibility:public"],
@@ -149,6 +242,7 @@ cc_library(
"upb/def.h",
"upb/def.hpp",
"upb/reflection.h",
+ "upb/reflection.hpp",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
@@ -164,6 +258,7 @@ cc_library(
name = "textformat",
srcs = [
"upb/text_encode.c",
+ "upb/upb_internal.h",
],
hdrs = [
"upb/text_encode.h",
@@ -173,6 +268,7 @@ cc_library(
deps = [
":port",
":reflection",
+ ":table",
],
)
@@ -181,6 +277,7 @@ cc_library(
srcs = [
"upb/json_decode.c",
"upb/json_encode.c",
+ "upb/upb_internal.h",
],
hdrs = [
"upb/json_decode.h",
@@ -195,122 +292,281 @@ cc_library(
],
)
-# Internal C/C++ libraries #####################################################
+# Tests ########################################################################
-cc_library(
- name = "table",
- hdrs = [
- "upb/table.int.h",
- "upb/upb.h",
- ],
- visibility = ["//tests:__pkg__"],
+cc_test(
+ name = "test_generated_code",
+ srcs = ["upb/test_generated_code.cc"],
deps = [
- ":port",
+ ":empty_upbdefs_proto",
+ ":test_messages_proto2_proto_upb",
+ ":test_messages_proto3_proto_upb",
+ ":test_upb_proto",
+ ":upb",
+ "@com_google_googletest//:gtest_main",
],
)
-# Legacy C/C++ Libraries (not recommended for new code) ########################
+proto_library(
+ name = "test_proto",
+ testonly = 1,
+ srcs = ["upb/test.proto"],
+)
-cc_library(
- name = "handlers",
- srcs = [
- "upb/handlers.c",
- "upb/handlers-inl.h",
- "upb/sink.c",
- ],
- hdrs = [
- "upb/handlers.h",
- "upb/sink.h",
- ],
- copts = UPB_DEFAULT_COPTS,
- visibility = ["//tests:__pkg__"],
+upb_proto_library(
+ name = "test_upb_proto",
+ testonly = 1,
+ deps = [":test_proto"],
+)
+
+proto_library(
+ name = "empty_proto",
+ srcs = ["upb/empty.proto"],
+)
+
+upb_proto_reflection_library(
+ name = "empty_upbdefs_proto",
+ testonly = 1,
+ deps = [":empty_proto"],
+)
+
+upb_proto_library(
+ name = "test_messages_proto2_proto_upb",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto2_proto"],
+)
+
+upb_proto_library(
+ name = "test_messages_proto3_proto_upb",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
+)
+
+cc_test(
+ name = "msg_test",
+ srcs = ["upb/msg_test.cc"],
deps = [
- ":port",
+ ":json",
+ ":msg_test_upb_proto",
+ ":msg_test_upb_proto_reflection",
":reflection",
- ":table",
+ ":test_messages_proto3_proto_upb",
":upb",
+ "@com_google_googletest//:gtest_main",
],
)
-cc_library(
- name = "upb_pb",
- srcs = [
- "upb/pb/compile_decoder.c",
- "upb/pb/decoder.c",
- "upb/pb/decoder.int.h",
- "upb/pb/encoder.c",
- "upb/pb/textprinter.c",
- "upb/pb/varint.c",
- "upb/pb/varint.int.h",
+proto_library(
+ name = "msg_test_proto",
+ testonly = 1,
+ srcs = ["upb/msg_test.proto"],
+ deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
+)
+
+upb_proto_library(
+ name = "msg_test_upb_proto",
+ testonly = 1,
+ deps = [":msg_test_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "msg_test_upb_proto_reflection",
+ testonly = 1,
+ deps = [":msg_test_proto"],
+)
+
+proto_library(
+ name = "test_cpp_proto",
+ srcs = ["upb/test_cpp.proto"],
+ deps = ["@com_google_protobuf//:timestamp_proto"],
+)
+
+upb_proto_library(
+ name = "test_cpp_upb_proto",
+ deps = ["test_cpp_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "test_cpp_upb_proto_reflection",
+ deps = ["test_cpp_proto"],
+)
+
+upb_proto_library(
+ name = "timestamp_upb_proto",
+ deps = ["@com_google_protobuf//:timestamp_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "timestamp_upb_proto_reflection",
+ deps = ["@com_google_protobuf//:timestamp_proto"],
+)
+
+cc_test(
+ name = "test_cpp",
+ srcs = ["upb/test_cpp.cc"],
+ copts = UPB_DEFAULT_CPPOPTS,
+ deps = [
+ ":test_cpp_upb_proto",
+ ":test_cpp_upb_proto_reflection",
+ ":timestamp_upb_proto",
+ ":timestamp_upb_proto_reflection",
+ "//:json",
+ "//:port",
+ "//:reflection",
+ "//:upb",
+ "@com_google_googletest//:gtest_main",
],
- hdrs = [
- "upb/pb/decoder.h",
- "upb/pb/encoder.h",
- "upb/pb/textprinter.h",
+)
+
+cc_test(
+ name = "test_table",
+ srcs = ["upb/test_table.cc"],
+ copts = UPB_DEFAULT_CPPOPTS,
+ deps = [
+ "//:port",
+ "//:table",
+ "//:upb",
+ "@com_google_googletest//:gtest_main",
],
+)
+
+upb_proto_library(
+ name = "conformance_proto_upb",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:conformance_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "conformance_proto_upbdefs",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:conformance_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "test_messages_proto2_upbdefs",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto2_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "test_messages_proto3_upbdefs",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
+)
+
+cc_binary(
+ name = "conformance_upb",
+ testonly = 1,
+ srcs = ["upb/conformance_upb.c"],
copts = UPB_DEFAULT_COPTS,
- visibility = ["//tests:__pkg__"],
+ data = ["upb/conformance_upb_failures.txt"],
deps = [
- ":descriptor_upb_proto",
- ":handlers",
- ":port",
- ":reflection",
- ":table",
- ":upb",
+ ":conformance_proto_upb",
+ ":conformance_proto_upbdefs",
+ ":test_messages_proto2_upbdefs",
+ ":test_messages_proto3_upbdefs",
+ "//:json",
+ "//:port",
+ "//:reflection",
+ "//:textformat",
+ "//:upb",
],
)
-# copybara:strip_for_google3_begin
-cc_library(
- name = "upb_json",
- srcs = [
- "upb/json/parser.c",
- "upb/json/printer.c",
+make_shell_script(
+ name = "gen_test_conformance_upb",
+ out = "test_conformance_upb.sh",
+ contents = "external/com_google_protobuf/conformance_test_runner " +
+ " --enforce_recommended " +
+ " --failure_list ./upb/conformance_upb_failures.txt" +
+ " ./conformance_upb",
+)
+
+sh_test(
+ name = "test_conformance_upb",
+ srcs = ["test_conformance_upb.sh"],
+ data = [
+ "upb/conformance_upb_failures.txt",
+ ":conformance_upb",
+ "@com_google_protobuf//:conformance_test_runner",
],
- hdrs = [
- "upb/json/parser.h",
- "upb/json/printer.h",
+ deps = ["@bazel_tools//tools/bash/runfiles"],
+)
+
+cc_binary(
+ name = "conformance_upb_dynamic_minitable",
+ testonly = 1,
+ srcs = ["upb/conformance_upb.c"],
+ copts = UPB_DEFAULT_COPTS + [
+ "-DREBUILD_MINITABLES",
],
- copts = UPB_DEFAULT_COPTS,
- visibility = ["//tests:__pkg__"],
+ data = ["upb/conformance_upb_failures.txt"],
deps = [
- ":upb",
- ":upb_pb",
+ ":conformance_proto_upb",
+ ":conformance_proto_upbdefs",
+ ":test_messages_proto2_upbdefs",
+ ":test_messages_proto3_upbdefs",
+ "//:json",
+ "//:port",
+ "//:reflection",
+ "//:textformat",
+ "//:upb",
],
)
-genrule(
- name = "generate_json_ragel",
- srcs = ["//:upb/json/parser.rl"],
- outs = ["upb/json/parser.c"],
- cmd = "$(location @ragel//:ragelc) -C -o upb/json/parser.c $< && mv upb/json/parser.c $@",
- tools = ["@ragel//:ragelc"],
- visibility = ["//cmake:__pkg__"],
+make_shell_script(
+ name = "gen_test_conformance_upb_dynamic_minitable",
+ out = "test_conformance_upb_dynamic_minitable.sh",
+ contents = "external/com_google_protobuf/conformance_test_runner " +
+ " --enforce_recommended " +
+ " --failure_list ./upb/conformance_upb_failures.txt" +
+ " ./conformance_upb_dynamic_minitable",
)
-# Amalgamation #################################################################
+sh_test(
+ name = "test_conformance_upb_dynamic_minitable",
+ srcs = ["test_conformance_upb_dynamic_minitable.sh"],
+ data = [
+ "upb/conformance_upb_failures.txt",
+ ":conformance_upb_dynamic_minitable",
+ "@com_google_protobuf//:conformance_test_runner",
+ ],
+ deps = ["@bazel_tools//tools/bash/runfiles"],
+)
-py_binary(
- name = "amalgamate",
- srcs = ["tools/amalgamate.py"],
+# Internal C/C++ libraries #####################################################
+
+cc_library(
+ name = "table",
+ hdrs = [
+ "upb/table_internal.h",
+ "upb/upb.h",
+ ],
+ visibility = [
+ "//python:__pkg__",
+ "//tests:__pkg__",
+ ],
+ deps = [
+ ":port",
+ ],
)
+# Amalgamation #################################################################
+
+# begin:github_only
+
upb_amalgamation(
name = "gen_amalgamation",
outs = [
"upb.c",
"upb.h",
],
- amalgamator = ":amalgamate",
libs = [
":upb",
":fastdecode",
":descriptor_upb_proto",
":reflection",
- ":handlers",
":port",
- ":upb_pb",
- ":upb_json",
],
)
@@ -319,7 +575,7 @@ cc_library(
srcs = ["upb.c"],
hdrs = ["upb.h"],
copts = UPB_DEFAULT_COPTS,
- deps = ["//third_party/wyhash"],
+ deps = ["//third_party/utf8_range"],
)
upb_amalgamation(
@@ -328,7 +584,6 @@ upb_amalgamation(
"php-upb.c",
"php-upb.h",
],
- amalgamator = ":amalgamate",
libs = [
":upb",
":fastdecode",
@@ -346,7 +601,7 @@ cc_library(
srcs = ["php-upb.c"],
hdrs = ["php-upb.h"],
copts = UPB_DEFAULT_COPTS,
- deps = ["//third_party/wyhash"],
+ deps = ["//third_party/utf8_range"],
)
upb_amalgamation(
@@ -355,7 +610,6 @@ upb_amalgamation(
"ruby-upb.c",
"ruby-upb.h",
],
- amalgamator = ":amalgamate",
libs = [
":upb",
":fastdecode",
@@ -372,16 +626,7 @@ cc_library(
srcs = ["ruby-upb.c"],
hdrs = ["ruby-upb.h"],
copts = UPB_DEFAULT_COPTS,
- deps = ["//third_party/wyhash"],
-)
-
-exports_files(
- [
- "upb/json/parser.rl",
- "BUILD",
- "WORKSPACE",
- ],
- visibility = ["//cmake:__pkg__"],
+ deps = ["//third_party/utf8_range"],
)
exports_files(
@@ -389,15 +634,12 @@ exports_files(
"third_party/lunit/console.lua",
"third_party/lunit/lunit.lua",
],
- visibility = ["//tests/bindings/lua:__pkg__"],
+ visibility = ["//upb/bindings/lua:__pkg__"],
)
filegroup(
name = "cmake_files",
srcs = glob([
- "upb/json/parser.c",
- "CMakeLists.txt",
- "generated_for_cmake/**/*",
"google/**/*",
"upbc/**/*",
"upb/**/*",
@@ -407,4 +649,4 @@ filegroup(
visibility = ["//cmake:__pkg__"],
)
-# copybara:strip_end
+# end:github_only
diff --git a/grpc/third_party/upb/CONTRIBUTING.md b/grpc/third_party/upb/CONTRIBUTING.md
index 2f866b4e..df48bf63 100644
--- a/grpc/third_party/upb/CONTRIBUTING.md
+++ b/grpc/third_party/upb/CONTRIBUTING.md
@@ -1,7 +1,37 @@
-## <a name="cla"></a> Signing the CLA
-Please sign the [Google Contributor License Agreement
-(CLA)](https://cla.developers.google.com/)
-before sending pull requests. For any code changes to be
-accepted, the CLA must be signed. It's a quick process, I
-promise!
+# How to Contribute
+
+We'd love to accept your patches and contributions to this project. There are
+just a few small guidelines you need to follow.
+
+## Get in touch
+
+If your idea will take you more than, say, 30 minutes to
+implement, please get in touch first via the issue tracker
+to touch base about your plan. That will give an
+opportunity for early feedback and help avoid wasting your
+time.
+
+## Contributor License Agreement
+
+Contributions to this project must be accompanied by a Contributor License
+Agreement. You (or your employer) retain the copyright to your contribution;
+this simply gives us permission to use and redistribute your contributions as
+part of the project. Head over to <https://cla.developers.google.com/> to see
+your current agreements on file or to sign a new one.
+
+You generally only need to submit a CLA once, so if you've already submitted one
+(even if it was for a different project), you probably don't need to do it
+again.
+
+## Code Reviews
+
+All submissions, including submissions by project members, require review. We
+use GitHub pull requests for this purpose. Consult
+[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
+information on using pull requests.
+
+## Community Guidelines
+
+This project follows [Google's Open Source Community
+Guidelines](https://opensource.google/conduct/).
diff --git a/grpc/third_party/upb/DESIGN.md b/grpc/third_party/upb/DESIGN.md
index a7a8a284..73388d03 100644
--- a/grpc/third_party/upb/DESIGN.md
+++ b/grpc/third_party/upb/DESIGN.md
@@ -1,72 +1,201 @@
-ÎŒpb Design
-----------
-
-ÎŒpb has the following design goals:
-
-- C89 compatible.
-- small code size (both for the core library and generated messages).
-- fast performance (hundreds of MB/s).
-- idiomatic for C programs.
-- easy to wrap in high-level languages (Python, Ruby, Lua, etc) with
- good performance and all standard protobuf features.
-- hands-off about memory management, allowing for easy integration
- with existing VMs and/or garbage collectors.
-- offers binary ABI compatibility between apps, generated messages, and
- the core library (doesn't require re-generating messages or recompiling
- your application when the core library changes).
-- provides all features that users expect from a protobuf library
- (generated messages in C, reflection, text format, etc.).
-- layered, so the core is small and doesn't require descriptors.
-- tidy about symbol references, so that any messages or features that
- aren't used by a C program can have their code GC'd by the linker.
-- possible to use protobuf binary format without leaking message/field
- names into the binary.
-
-ÎŒpb accomplishes these goals by keeping a very small core that does not contain
-descriptors. We need some way of knowing what fields are in each message and
-where they live, but instead of descriptors, we keep a small/lightweight summary
-of the .proto file. We call this a `upb_msglayout`. It contains the bare
-minimum of what we need to know to parse and serialize protobuf binary format
-into our internal representation for messages, `upb_msg`.
-
-The core then contains functions to parse/serialize a message, given a `upb_msg*`
-and a `const upb_msglayout*`.
-
-This approach is similar to [nanopb](https://github.com/nanopb/nanopb) which
-also compiles message definitions to a compact, internal representation without
-names. However nanopb does not aim to be a fully-featured library, and has no
-support for text format, JSON, or descriptors. ÎŒpb is unique in that it has a
-small core similar to nanopb (though not quite as small), but also offers a
-full-featured protobuf library for applications that want reflection, text
-format, JSON format, etc.
-
-Without descriptors, the core doesn't have access to field names, so it cannot
-parse/serialize to protobuf text format or JSON. Instead this functionality
-lives in separate modules that depend on the module implementing descriptors.
-With the descriptor module we can parse/serialize binary descriptors and
-validate that they follow all the rules of protobuf schemas.
-
-To provide binary compatibility, we version the structs that generated messages
-use to create a `upb_msglayout*`. The current initializers are
-`upb_msglayout_msginit_v1`, `upb_msglayout_fieldinit_v1`, etc. Then
-`upb_msglayout*` uses these as its internal representation. If upb changes its
-internal representation for a `upb_msglayout*`, it will also include code to
-convert the old representation to the new representation. This will use some
-more memory/CPU at runtime to convert between the two, but apps that statically
-link ÎŒpb will never need to worry about this.
-
-TODO
-----
-
-1. revise our generated code until it is in a state where we feel comfortable
- committing to API/ABI stability for it. In particular there is an open
- question of whether non-ABI-compatible field accesses should have a
- fastpath different from the ABI-compatible field access.
-1. Add missing features (maps, extensions, unknown fields).
-1. Flesh out C++ wrappers.
-1. *(lower-priority)*: revise all of the existing encoders/decoders and
- handlers. We probably will want to keep handlers, since they let us decouple
- encoders/decoders from `upb_msg`, but we need to simplify all of that a LOT.
- Likely we will want to make handlers only per-message instead of per-field,
- except for variable-length fields.
+# upb Design
+
+upb aims to be a minimal C protobuf kernel. It has a C API, but its primary
+goal is to be the core runtime for a higher-level API.
+
+## Design goals
+
+- Full protobuf conformance
+- Small code size
+- Fast performance (without compromising code size)
+- Easy to wrap in language runtimes
+- Easy to adapt to different memory management schemes (refcounting, GC, etc)
+
+## Design parameters
+
+- C99
+- 32 or 64-bit CPU (assumes 4 or 8 byte pointers)
+- Uses pointer tagging, but avoids other implementation-defined behavior
+- Aims to never invoke undefined behavior (tests with ASAN, UBSAN, etc)
+- No global state, fully re-entrant
+
+
+## Overall Structure
+
+The upb library is divided into two main parts:
+
+- A core message representation, which supports binary format parsing
+ and serialization.
+ - `upb/upb.h`: arena allocator (`upb_arena`)
+ - `upb/msg_internal.h`: core message representation and parse tables
+ - `upb/msg.h`: accessing metadata common to all messages, like unknown fields
+ - `upb/decode.h`: binary format parsing
+ - `upb/encode.h`: binary format serialization
+ - `upb/table_internal.h`: hash table (used for maps)
+ - `upbc/protoc-gen-upbc.cc`: compiler that generates `.upb.h`/`.upb.c` APIs for
+ accessing messages without reflection.
+- A reflection add-on library that supports JSON and text format.
+ - `upb/def.h`: schema representation and loading from descriptors
+ - `upb/reflection.h`: reflective access to message data.
+ - `upb/json_encode.h`: JSON encoding
+ - `upb/json_decode.h`: JSON decoding
+ - `upb/text_encode.h`: text format encoding
+ - `upbc/protoc-gen-upbdefs.cc`: compiler that generates `.upbdefs.h`/`.upbdefs.c`
+ APIs for loading reflection.
+
+## Core Message Representation
+
+The representation for each message consists of:
+- One pointer (`upb_msg_internaldata*`) for unknown fields and extensions. This
+ pointer is `NULL` when no unknown fields or extensions are present.
+- Hasbits for any optional/required fields.
+- Case integers for each oneof.
+- Data for each field.
+
+For example, a layout for a message with two `optional int32` fields would end
+up looking something like this:
+
+```c
+// For illustration only, upb does not actually generate structs.
+typedef struct {
+ upb_msg_internaldata* internal; // Unknown fields and extensions.
+ uint32_t hasbits; // We are only using two hasbits.
+ int32_t field1;
+ int32_t field2;
+} package_name_MessageName;
+```
+
+Note in particular that messages do *not* have:
+- A pointer to reflection or a parse table (upb messages are not self-describing).
+- A pointer to an arena (the arena must be expicitly passed into any function that
+ allocates).
+
+The upb compiler computes a layout for each message, and determines the offset for
+each field using normal alignment rules (each data member must be aligned to a
+multiple of its size). This layout is then embedded into the generated `.upb.h`
+and `.upb.c` headers in two different forms. First as inline accessors that expect
+the data at a given offset:
+
+```c
+// Example of a generated accessor, from foo.upb.h
+UPB_INLINE int32_t package_name_MessageName_field1(
+ const upb_test_MessageName *msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+```
+
+Secondly, the layout is emitted as a table which is used by the parser and serializer.
+We call these tables "mini-tables" to distinguish them from the larger and more
+optimized "fast tables" used in `upb/decode_fast.c` (an experimental parser that is
+2-3x the speed of the main parser, though the main parser is already quite fast).
+
+```c
+// Definition of mini-table structure, from upb/msg_internal.h
+typedef struct {
+ uint32_t number;
+ uint16_t offset;
+ int16_t presence; /* If >0, hasbit_index. If <0, ~oneof_index. */
+ uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
+ uint8_t descriptortype;
+ int8_t mode; /* upb_fieldmode, with flags from upb_labelflags */
+} upb_msglayout_field;
+
+typedef enum {
+ _UPB_MODE_MAP = 0,
+ _UPB_MODE_ARRAY = 1,
+ _UPB_MODE_SCALAR = 2,
+} upb_fieldmode;
+
+typedef struct {
+ const struct upb_msglayout *const* submsgs;
+ const upb_msglayout_field *fields;
+ uint16_t size;
+ uint16_t field_count;
+ bool extendable;
+ uint8_t dense_below;
+ uint8_t table_mask;
+} upb_msglayout;
+
+// Example of a generated mini-table, from foo.upb.c
+static const upb_msglayout_field upb_test_MessageName__fields[2] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR},
+};
+
+const upb_msglayout upb_test_MessageName_msginit = {
+ NULL,
+ &upb_test_MessageName__fields[0],
+ UPB_SIZE(16, 16), 2, false, 2, 255,
+};
+```
+
+The upb compiler computes separate layouts for 32 and 64 bit modes, since the
+pointer size will be 4 or 8 bytes respectively. The upb compiler embeds both
+sizes into the source code, using a `UPB_SIZE(size32, size64)` macro that can
+choose the appropriate size at build time based on the size of `UINTPTR_MAX`.
+
+Note that `.upb.c` files contain data tables only. There is no "generated code"
+except for the inline accessors in the `.upb.h` files: the entire footprint
+of `.upb.c` files is in `.rodata`, none in `.text` or `.data`.
+
+## Memory Management Model
+
+All memory management in upb is built around arenas. A message is never
+considered to "own" the strings or sub-messages contained within it. Instead a
+message and all of its sub-messages/strings/etc. are all owned by an arena and
+are freed when the arena is freed. An entire message tree will probably be
+owned by a single arena, but this is not required or enforced. As far as upb is
+concerned, it is up to the client how to partition its arenas. upb only requires
+that when you ask it to serialize a message, that all reachable messages are
+still alive.
+
+The arena supports both a user-supplied initial block and a custom allocation
+callback, so there is a lot of flexibility in memory allocation strategy. The
+allocation callback can even be `NULL` for heap-free operation. The main
+constraint of the arena is that all of the memory in each arena must be freed
+together.
+
+`upb_arena` supports a novel operation called "fuse". When two arenas are fused
+together, their lifetimes are irreversibly joined, such that none of the arena
+blocks in either arena will be freed until *both* arenas are freed with
+`upb_arena_free()`. This is useful when joining two messages from separate
+arenas (making one a sub-message of the other). Fuse is an a very cheap
+operation, and an unlimited number of arenas can be fused together efficiently.
+
+## Reflection and Descriptors
+
+upb offers a fully-featured reflection library. There are two main ways of
+using reflection:
+
+1. You can load descriptors from strings using `upb_symtab_addfile()`.
+ The upb runtime will dynamically create mini-tables like what the upb compiler
+ would have created if you had compiled this type into a `.upb.c` file.
+2. You can load descriptors using generated `.upbdefs.h` interfaces.
+ This will load reflection that references the corresponding `.upb.c`
+ mini-tables instead of building a new mini-table on the fly. This lets
+ you reflect on generated types that are linked into your program.
+
+upb's design for descriptors is similar to protobuf C++ in many ways, with
+the following correspondences:
+
+| C++ Type | upb type |
+| ---------| ---------|
+| `google::protobuf::DescriptorPool` | `upb_symtab`
+| `google::protobuf::Descriptor` | `upb_msgdef`
+| `google::protobuf::FieldDescriptor` | `upb_fielddef`
+| `google::protobuf::OneofDescriptor` | `upb_oneofdef`
+| `google::protobuf::EnumDescriptor` | `upb_enumdef`
+| `google::protobuf::FileDescriptor` | `upb_filedef`
+| `google::protobuf::ServiceDescriptor` | `upb_servicedef`
+| `google::protobuf::MethodDescriptor` | `upb_methoddef`
+
+Like in C++ descriptors (defs) are created by loading a
+`google_protobuf_FileDescriptorProto` into a `upb_symtab`. This creates and
+links all of the def objects corresponding to that `.proto` file, and inserts
+the names into a symbol table so they can be looked up by name.
+
+Once you have loaded some descriptors into a `upb_symtab`, you can create and
+manipulate messages using the interfaces defined in `upb/reflection.h`. If your
+descriptors are linked to your generated layouts using option (2) above, you can
+safely access the same messages using both reflection and generated interfaces.
diff --git a/grpc/third_party/upb/LICENSE b/grpc/third_party/upb/LICENSE
index da939845..7f3bd168 100644
--- a/grpc/third_party/upb/LICENSE
+++ b/grpc/third_party/upb/LICENSE
@@ -1,5 +1,5 @@
-Copyright (c) 2009-2011, Google Inc.
+Copyright (c) 2009-2021, Google LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -10,14 +10,14 @@ modification, are permitted provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- * Neither the name of Google Inc. nor the names of any other
+ * Neither the name of Google LLC nor the names of any other
contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL GOOGLE INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+EVENT SHALL GOOGLE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
diff --git a/grpc/third_party/upb/README.md b/grpc/third_party/upb/README.md
index a08aa0e9..9b74b969 100644
--- a/grpc/third_party/upb/README.md
+++ b/grpc/third_party/upb/README.md
@@ -1,134 +1,78 @@
-# ÎŒpb - a small protobuf implementation in C
-
-|Platform|Build Status|
-|--------|------------|
-|macOS|[![Build Status](https://storage.googleapis.com/upb-kokoro-results/status-badge/macos.png)](https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Aupb%2Fmacos%2Fcontinuous)|
-|ubuntu|[![Build Status](https://storage.googleapis.com/upb-kokoro-results/status-badge/ubuntu.png)](https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Aupb%2Fubuntu%2Fcontinuous)|
-
-ÎŒpb (often written 'upb') is a small protobuf implementation written in C.
-
-upb generates a C API for creating, parsing, and serializing messages
-as declared in `.proto` files. upb is heavily arena-based: all
-messages always live in an arena (note: the arena can live in stack or
-static memory if desired). Here is a simple example:
-
-```c
-#include "conformance/conformance.upb.h"
-
-void foo(const char* data, size_t size) {
- upb_arena *arena;
-
- /* Generated message type. */
- conformance_ConformanceRequest *request;
- conformance_ConformanceResponse *response;
-
- arena = upb_arena_new();
- request = conformance_ConformanceRequest_parse(data, size, arena);
- response = conformance_ConformanceResponse_new(arena);
-
- switch (conformance_ConformanceRequest_payload_case(request)) {
- case conformance_ConformanceRequest_payload_protobuf_payload: {
- upb_strview payload = conformance_ConformanceRequest_protobuf_payload(request);
- // ...
- break;
- }
-
- case conformance_ConformanceRequest_payload_NOT_SET:
- fprintf(stderr, "conformance_upb: Request didn't have payload.\n");
- break;
-
- default: {
- static const char msg[] = "Unsupported input format.";
- conformance_ConformanceResponse_set_skipped(
- response, upb_strview_make(msg, sizeof(msg)));
- break;
- }
- }
-
- /* Frees all messages on the arena. */
- upb_arena_free(arena);
-}
-```
+# ÎŒpb: small, fast C protos
-API and ABI are both subject to change! Please do not distribute
-as a shared library for this reason (for now at least).
+ÎŒpb (often written 'upb') is a small
+[protobuf](https://github.com/protocolbuffers/protobuf) implementation written
+in C.
-## Using upb in your project
+upb is the core runtime for protobuf languages extensions in
+[Ruby](https://github.com/protocolbuffers/protobuf/tree/master/ruby),
+[PHP](https://github.com/protocolbuffers/protobuf/tree/master/php), and (soon)
+Python.
-Currently only Bazel is supported (CMake support is partial and incomplete
-but full CMake support is an eventual goal).
+While upb offers a C API, the C API & ABI **are not stable**. For this reason,
+upb is not generally offered as a C library for direct consumption, and there
+are no releases.
-To use upb in your Bazel project, first add upb to your `WORKSPACE` file,
-either as a `git_repository()` or as a `new_local_repository()` with a
-Git Submodule. (For an example, see `examples/bazel/ in this repo).
+## Features
-```python
-# Add this to your WORKSPACE file.
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+upb has comparable speed to protobuf C++, but is an order of magnitude smaller
+in code size.
-git_repository(
- name = "upb",
- remote = "https://github.com/protocolbuffers/upb.git",
- commit = "d16bf99ac4658793748cda3251226059892b3b7b",
-)
+Like the main protobuf implementation in C++, it supports:
-load("@upb//bazel:workspace_deps.bzl", "upb_deps")
+- a generated API (in C)
+- reflection
+- binary & JSON wire formats
+- text format serialization
+- all standard features of protobufs (oneofs, maps, unknown fields, extensions,
+ etc.)
+- full conformance with the protobuf conformance tests
-upb_deps()
-```
+upb also supports some features that C++ does not:
-Then in your BUILD file you can add `upb_proto_library()` rules that
-generate code for a corresponding `proto_library()` rule. For
-example:
-
-```python
-# Add this to your BUILD file.
-load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
-
-proto_library(
- name = "foo_proto",
- srcs = ["foo.proto"],
-)
-
-upb_proto_library(
- name = "foo_upbproto",
- deps = [":foo_proto"],
-)
-
-cc_binary(
- name = "test_binary",
- srcs = ["test_binary.c"],
- deps = [":foo_upbproto"],
-)
-```
+- **optional reflection:** generated messages are agnostic to whether
+ reflection will be linked in or not.
+- **no global state:** no pre-main registration or other global state.
+- **fast reflection-based parsing:** messages loaded at runtime parse
+ just as fast as compiled-in messages.
+
+However there are a few features it does not support:
+
+- text format parsing
+- deep descriptor verification: upb's descriptor validation is not as exhaustive
+ as `protoc`.
-Then in your `.c` file you can #include the generated header:
+## Install
-```c
-#include "foo.upb.h"
+For Ruby, use [RubyGems](https://rubygems.org/gems/google-protobuf):
-/* Insert code that uses generated types. */
+```
+$ gem install google-protobuf
+```
+
+For PHP, use [PECL](https://pecl.php.net/package/protobuf):
+
+```
+$ sudo pecl install protobuf
```
-## Old "handlers" interfaces
+Alternatively, you can build and install upb using
+[vcpkg](https://github.com/microsoft/vcpkg/) dependency manager:
-This library contains several semi-deprecated interfaces (see BUILD
-file for more info about which interfaces are deprecated). These
-deprecated interfaces are still used in some significant projects,
-such as the Ruby and PHP C bindings for protobuf in the [main protobuf
-repo](https://github.com/protocolbuffers/protobuf). The goal is to
-migrate the Ruby/PHP bindings to use the newer, simpler interfaces
-instead. Please do not use the old interfaces in new code.
+ git clone https://github.com/Microsoft/vcpkg.git
+ cd vcpkg
+ ./bootstrap-vcpkg.sh
+ ./vcpkg integrate install
+ ./vcpkg install upb
-## Lua bindings
+The upb port in vcpkg is kept up to date by microsoft team members and community
+contributors.
-This repo has some Lua bindings for the core library. These are
-experimental and very incomplete. These are currently included in
-order to validate that the C API is suitable for wrapping. As the
-project matures these Lua bindings may become publicly available.
+If the version is out of date, please
+[create an issue or pull request](https://github.com/Microsoft/vcpkg) on the
+vcpkg repository.
-## Contact
+## Contributing
-Author: Josh Haberman ([jhaberman@gmail.com](mailto:jhaberman@gmail.com),
-[haberman@google.com](mailto:haberman@google.com))
+Please see [CONTRIBUTING.md](CONTRIBUTING.md).
diff --git a/grpc/third_party/upb/WORKSPACE b/grpc/third_party/upb/WORKSPACE
index 870ebf74..0bd8479e 100644
--- a/grpc/third_party/upb/WORKSPACE
+++ b/grpc/third_party/upb/WORKSPACE
@@ -1,11 +1,14 @@
workspace(name = "upb")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
load("//bazel:workspace_deps.bzl", "upb_deps")
+load("//bazel:workspace_defs.bzl", "system_python")
upb_deps()
+load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
+protobuf_deps()
+
http_archive(
name = "lua",
build_file = "//bazel:lua.BUILD",
@@ -18,31 +21,44 @@ http_archive(
)
http_archive(
- name = "ragel",
- build_file = "//bazel:ragel.BUILD",
- sha256 = "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f",
- strip_prefix = "ragel-6.10",
- urls = ["http://www.colm.net/files/ragel/ragel-6.10.tar.gz"],
-)
-
-http_archive(
- name = "com_google_googletest",
- sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86",
- strip_prefix = "googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb",
- urls = ["https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip"], # 2019-01-07
+ name = "com_google_googletest",
+ urls = ["https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip"], # 2019-01-07
+ strip_prefix = "googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb",
+ sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86",
)
http_archive(
name = "com_github_google_benchmark",
- sha256 = "59f918c8ccd4d74b6ac43484467b500f1d64b40cc1010daa055375b322a43ba3",
- strip_prefix = "benchmark-16703ff83c1ae6d53e5155df3bb3ab0bc96083be",
- urls = ["https://github.com/google/benchmark/archive/16703ff83c1ae6d53e5155df3bb3ab0bc96083be.zip"],
+ urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"],
+ strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
+ sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0",
)
-new_git_repository(
+http_archive(
name = "com_google_googleapis",
- remote = "https://github.com/googleapis/googleapis.git",
- branch = "master",
+ urls = ["https://github.com/googleapis/googleapis/archive/refs/heads/master.zip"],
build_file = "//benchmarks:BUILD.googleapis",
+ strip_prefix = "googleapis-master",
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
)
+
+system_python(
+ name = "system_python"
+)
+
+register_toolchains("@system_python//:python_toolchain")
+
+http_archive(
+ name = "rules_fuzzing",
+ sha256 = "23bb074064c6f488d12044934ab1b0631e8e6898d5cf2f6bde087adb01111573",
+ strip_prefix = "rules_fuzzing-0.3.1",
+ urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.1.zip"],
+)
+
+load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
+
+rules_fuzzing_dependencies()
+
+load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")
+
+rules_fuzzing_init()
diff --git a/grpc/third_party/upb/bazel/BUILD b/grpc/third_party/upb/bazel/BUILD
index e69de29b..148f4a0b 100644
--- a/grpc/third_party/upb/bazel/BUILD
+++ b/grpc/third_party/upb/bazel/BUILD
@@ -0,0 +1,53 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+
+licenses(["notice"])
+
+py_binary(
+ name = "amalgamate",
+ srcs = ["amalgamate.py"],
+ visibility = ["//:__pkg__"],
+)
+
+# py_proto_library() is private rule, only intended for internal use by upb.
+# Hopefully py_proto_library() will eventually be availble in rules_proto or
+# another upstream package.
+bzl_library(
+ name = "py_proto_library_bzl",
+ srcs = ["py_proto_library.bzl"],
+)
+
+bzl_library(
+ name = "upb_proto_library_bzl",
+ srcs = ["upb_proto_library.bzl"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "@bazel_skylib//lib:paths",
+ "@bazel_tools//tools/cpp:toolchain_utils.bzl",
+ "@rules_proto//proto:defs",
+ ],
+)
diff --git a/grpc/third_party/upb/bazel/amalgamate.py b/grpc/third_party/upb/bazel/amalgamate.py
new file mode 100755
index 00000000..70399085
--- /dev/null
+++ b/grpc/third_party/upb/bazel/amalgamate.py
@@ -0,0 +1,129 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import sys
+import re
+import os
+
+INCLUDE_RE = re.compile('^#include "([^"]*)"$')
+
+def parse_include(line):
+ match = INCLUDE_RE.match(line)
+ return match.groups()[0] if match else None
+
+class Amalgamator:
+ def __init__(self, output_path, prefix):
+ self.include_paths = ["."]
+ self.included = set(["upb/port_def.inc", "upb/port_undef.inc"])
+ self.output_h = open(output_path + prefix + "upb.h", "w")
+ self.output_c = open(output_path + prefix + "upb.c", "w")
+
+ self.output_c.write("/* Amalgamated source file */\n")
+ self.output_c.write('#include "%supb.h"\n' % (prefix))
+ if prefix == "ruby-":
+ self.output_h.write("// Ruby is still using proto3 enum semantics for proto2\n")
+ self.output_h.write("#define UPB_DISABLE_PROTO2_ENUM_CHECKING\n")
+ self.output_c.write(open("upb/port_def.inc").read())
+
+ self.output_h.write("/* Amalgamated source file */\n")
+ self.output_h.write(open("upb/port_def.inc").read())
+
+ def add_include_path(self, path):
+ self.include_paths.append(path)
+
+ def finish(self):
+ self._add_header("upb/port_undef.inc")
+ self.add_src("upb/port_undef.inc")
+
+ def _process_file(self, infile_name, outfile):
+ file = None
+ for path in self.include_paths:
+ try:
+ full_path = os.path.join(path, infile_name)
+ file = open(full_path)
+ break
+ except IOError:
+ pass
+ if not file:
+ raise RuntimeError("Couldn't open file " + infile_name)
+
+ lines = file.readlines()
+
+ has_copyright = lines[1].startswith(" * Copyright")
+ if has_copyright:
+ while not lines[0].startswith(" */"):
+ lines.pop(0)
+ lines.pop(0)
+
+ lines.insert(0, "\n/** " + infile_name + " " + ("*" * 60) +"/");
+
+ for line in lines:
+ if not self._process_include(line, outfile):
+ outfile.write(line)
+
+ def _process_include(self, line, outfile):
+ include = parse_include(line)
+ if not include:
+ return False
+ if not (include.startswith("upb") or include.startswith("google")):
+ return False
+ if include.endswith("hpp"):
+ # Skip, we don't support the amalgamation from C++.
+ return True
+ else:
+ # Include this upb header inline.
+ if include not in self.included:
+ self.included.add(include)
+ self._add_header(include)
+ return True
+
+ def _add_header(self, filename):
+ self._process_file(filename, self.output_h)
+
+ def add_src(self, filename):
+ self._process_file(filename, self.output_c)
+
+# ---- main ----
+
+output_path = sys.argv[1]
+prefix = sys.argv[2]
+amalgamator = Amalgamator(output_path, prefix)
+files = []
+
+for arg in sys.argv[3:]:
+ arg = arg.strip()
+ if arg.startswith("-I"):
+ amalgamator.add_include_path(arg[2:])
+ elif arg.endswith(".h") or arg.endswith(".inc"):
+ pass
+ else:
+ files.append(arg)
+
+for filename in files:
+ amalgamator.add_src(filename)
+
+amalgamator.finish()
diff --git a/grpc/third_party/upb/bazel/build_defs.bzl b/grpc/third_party/upb/bazel/build_defs.bzl
index ae41577e..b5bc64f0 100644
--- a/grpc/third_party/upb/bazel/build_defs.bzl
+++ b/grpc/third_party/upb/bazel/build_defs.bzl
@@ -1,40 +1,66 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
"""Internal rules for building upb."""
load(":upb_proto_library.bzl", "GeneratedSrcsInfo")
+_DEFAULT_CPPOPTS = []
+_DEFAULT_COPTS = []
+
+# begin:github_only
+_DEFAULT_CPPOPTS.extend([
+ "-Wextra",
+ # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang)
+ "-Werror",
+ "-Wno-long-long",
+])
+_DEFAULT_COPTS.extend([
+ "-std=c99",
+ "-pedantic",
+ "-Werror=pedantic",
+ "-Wall",
+ "-Wstrict-prototypes",
+ # GCC (at least) emits spurious warnings for this that cannot be fixed
+ # without introducing redundant initialization (with runtime cost):
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
+ #"-Wno-maybe-uninitialized",
+])
+# end:github_only
+
UPB_DEFAULT_CPPOPTS = select({
"//:windows": [],
- "//conditions:default": [
- # copybara:strip_for_google3_begin
- "-Wextra",
- # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang)
- "-Werror",
- "-Wno-long-long",
- # copybara:strip_end
- ],
+ "//conditions:default": _DEFAULT_CPPOPTS,
})
UPB_DEFAULT_COPTS = select({
"//:windows": [],
"//:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"],
- "//conditions:default": [
- # copybara:strip_for_google3_begin
- "-std=c99",
- "-pedantic",
- "-Werror=pedantic",
- "-Wall",
- "-Wstrict-prototypes",
- # GCC (at least) emits spurious warnings for this that cannot be fixed
- # without introducing redundant initialization (with runtime cost):
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
- #"-Wno-maybe-uninitialized",
- # copybara:strip_end
- ],
+ "//conditions:default": _DEFAULT_COPTS,
})
-def _librule(name):
- return name + "_lib"
-
runfiles_init = """\
# --- begin runfiles.bash initialization v2 ---
# Copy-pasted from the Bazel Bash runfiles library v2.
@@ -69,18 +95,7 @@ def _get_real_roots(files):
roots[real_root] = True
return roots.keys()
-def _remove_prefix(str, prefix):
- if not str.startswith(prefix):
- fail("%s doesn't start with %s" % (str, prefix))
- return str[len(prefix):]
-
-def _remove_suffix(str, suffix):
- if not str.endswith(suffix):
- fail("%s doesn't end with %s" % (str, suffix))
- return str[:-len(suffix)]
-
def make_shell_script(name, contents, out):
- contents = runfiles_init + contents # copybara:strip_for_google3
contents = contents.replace("$", "$$")
native.genrule(
name = "gen_" + name,
@@ -124,15 +139,16 @@ def _upb_amalgamation(ctx):
outputs = ctx.outputs.outs,
arguments = [ctx.bin_dir.path + "/", ctx.attr.prefix] + [f.path for f in srcs] + ["-I" + root for root in _get_real_roots(inputs)],
progress_message = "Making amalgamation",
- executable = ctx.executable.amalgamator,
+ executable = ctx.executable._amalgamator,
)
return []
upb_amalgamation = rule(
attrs = {
- "amalgamator": attr.label(
+ "_amalgamator": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
+ default = "//bazel:amalgamate",
),
"prefix": attr.string(
default = "",
diff --git a/grpc/third_party/upb/bazel/lua.BUILD b/grpc/third_party/upb/bazel/lua.BUILD
index 113c71f9..11755a4f 100644
--- a/grpc/third_party/upb/bazel/lua.BUILD
+++ b/grpc/third_party/upb/bazel/lua.BUILD
@@ -1,3 +1,28 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
package(
default_visibility = ["//visibility:public"],
)
diff --git a/grpc/third_party/upb/bazel/protobuf.patch b/grpc/third_party/upb/bazel/protobuf.patch
new file mode 100644
index 00000000..4b3e9381
--- /dev/null
+++ b/grpc/third_party/upb/bazel/protobuf.patch
@@ -0,0 +1,89 @@
+--- BUILD
++++ BUILD
+@@ -525,7 +525,7 @@ cc_binary(
+ filegroup(
+ name = "testdata",
+ srcs = glob(["src/google/protobuf/testdata/**/*"]),
+- visibility = ["//:__subpackages__"],
++ visibility = ["//visibility:public"],
+ )
+
+ RELATIVE_LITE_TEST_PROTOS = [
+@@ -931,13 +931,10 @@ py_library(
+ [
+ "python/google/protobuf/**/*.py",
+ ],
+- exclude = [
+- "python/google/protobuf/internal/*_test.py",
+- "python/google/protobuf/internal/test_util.py",
+- ],
+ ),
+ imports = ["python"],
+ srcs_version = "PY2AND3",
++ visibility = ["//visibility:public"],
+ )
+
+ cc_binary(
+@@ -1038,13 +1035,6 @@ py_proto_library(
+ name = "protobuf_python",
+ srcs = COPIED_WELL_KNOWN_PROTOS,
+ include = "python",
+- data = select({
+- "//conditions:default": [],
+- ":use_fast_cpp_protos": [
+- ":python/google/protobuf/internal/_api_implementation.so",
+- ":python/google/protobuf/pyext/_message.so",
+- ],
+- }),
+ default_runtime = "",
+ protoc = ":protoc",
+ py_libs = [
+@@ -1080,6 +1070,7 @@ py_proto_library(
+ protoc = ":protoc",
+ srcs_version = "PY2AND3",
+ deps = [":protobuf_python"],
++ visibility = ["//visibility:public"],
+ )
+
+ py_proto_library(
+@@ -1093,6 +1084,7 @@ py_proto_library(
+ protoc = ":protoc",
+ srcs_version = "PY2AND3",
+ deps = [":python_common_test_protos"],
++ visibility = ["//visibility:public"],
+ )
+
+ py_library(
+
+--- python/google/protobuf/internal/test_util.py
++++ python/google/protobuf/internal/test_util.py
+@@ -634,6 +634,13 @@ def GoldenFile(filename):
+ # Found it. Load the golden file from the testdata directory.
+ return open(full_path, 'rb')
+
++ # Search for cross-repo path.
++ full_path = os.path.join('external/com_google_protobuf/src/google/protobuf/testdata',
++ filename)
++ if os.path.exists(full_path):
++ # Found it. Load the golden file from the testdata directory.
++ return open(full_path, 'rb')
++
+ raise RuntimeError(
+ 'Could not find golden files. This test must be run from within the '
+ 'protobuf source package so that it can read test data files from the '
+
+--- python/google/protobuf/internal/testing_refleaks.py
++++ python/google/protobuf/internal/testing_refleaks.py
+@@ -67,6 +67,12 @@ class ReferenceLeakCheckerMixin(object):
+ NB_RUNS = 3
+
+ def run(self, result=None):
++ testMethod = getattr(self, self._testMethodName)
++ expecting_failure_method = getattr(testMethod, "__unittest_expecting_failure__", False)
++ expecting_failure_class = getattr(self, "__unittest_expecting_failure__", False)
++ if expecting_failure_class or expecting_failure_method:
++ return
++
+ # python_message.py registers all Message classes to some pickle global
+ # registry, which makes the classes immortal.
+ # We save a copy of this registry, and reset it before we could references.
diff --git a/grpc/third_party/upb/bazel/py_extension.bzl b/grpc/third_party/upb/bazel/py_extension.bzl
new file mode 100644
index 00000000..eacd39b8
--- /dev/null
+++ b/grpc/third_party/upb/bazel/py_extension.bzl
@@ -0,0 +1,38 @@
+load(
+ "//bazel:build_defs.bzl",
+ "UPB_DEFAULT_COPTS",
+)
+
+def py_extension(name, srcs, deps = []):
+ version_script = name + "_version_script.lds"
+ symbol = "PyInit_" + name
+ native.genrule(
+ name = "gen_" + version_script,
+ outs = [version_script],
+ cmd = "echo 'message { global: " + symbol + "; local: *; };' > $@",
+ )
+
+ native.cc_binary(
+ name = name,
+ srcs = srcs,
+ copts = UPB_DEFAULT_COPTS + [
+ # The Python API requires patterns that are ISO C incompatible, like
+ # casts between function pointers and object pointers.
+ "-Wno-pedantic",
+ ],
+ # We use a linker script to hide all symbols except the entry point for
+ # the module.
+ linkopts = select({
+ "@platforms//os:linux": ["-Wl,--version-script,$(location :" + version_script + ")"],
+ "@platforms//os:macos": [
+ "-Wl,-exported_symbol",
+ "-Wl,_" + symbol,
+ ],
+ }),
+ linkshared = True,
+ linkstatic = True,
+ deps = deps + [
+ ":" + version_script,
+ "@system_python//:python_headers",
+ ],
+ )
diff --git a/grpc/third_party/upb/bazel/py_proto_library.bzl b/grpc/third_party/upb/bazel/py_proto_library.bzl
new file mode 100644
index 00000000..72351256
--- /dev/null
+++ b/grpc/third_party/upb/bazel/py_proto_library.bzl
@@ -0,0 +1,137 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""An implementation of py_proto_library().
+
+We have to implement this ourselves because there is currently no reasonable
+py_proto_library() rule available for Bazel.
+
+Our py_proto_library() is similar to how a real py_proto_library() should work.
+But it hasn't been deeply tested or reviewed, and upb should not be in the
+business of vending py_proto_library(), so we keep it private to upb.
+"""
+
+load("@bazel_skylib//lib:paths.bzl", "paths")
+
+# begin:github_only
+load("@rules_proto//proto:defs.bzl", "ProtoInfo")
+# end:github_only
+
+# Generic support code #########################################################
+
+def _get_real_short_path(file):
+ # For some reason, files from other archives have short paths that look like:
+ # ../com_google_protobuf/google/protobuf/descriptor.proto
+ short_path = file.short_path
+ if short_path.startswith("../"):
+ second_slash = short_path.index("/", 3)
+ short_path = short_path[second_slash + 1:]
+
+ # Sometimes it has another few prefixes like:
+ # _virtual_imports/any_proto/google/protobuf/any.proto
+ # benchmarks/_virtual_imports/100_msgs_proto/benchmarks/100_msgs.proto
+ # We want just google/protobuf/any.proto.
+ virtual_imports = "_virtual_imports/"
+ if virtual_imports in short_path:
+ short_path = short_path.split(virtual_imports)[1].split("/", 1)[1]
+ return short_path
+
+def _get_real_root(file):
+ real_short_path = _get_real_short_path(file)
+ return file.path[:-len(real_short_path) - 1]
+
+def _generate_output_file(ctx, src, extension):
+ real_short_path = _get_real_short_path(src)
+ real_short_path = paths.relativize(real_short_path, ctx.label.package)
+ output_filename = paths.replace_extension(real_short_path, extension)
+ ret = ctx.actions.declare_file(output_filename)
+ return ret
+
+# py_proto_library() ###########################################################
+
+def _py_proto_library_rule_impl(ctx):
+ # A real py_proto_library() should enforce this constraint.
+ # We don't bother for now, since it saves us some effort not to.
+ #
+ # if len(ctx.attr.deps) != 1:
+ # fail("only one deps dependency allowed.")
+
+ files = []
+ for dep in ctx.attr.deps:
+ files += dep[PyInfo].transitive_sources.to_list()
+ return [
+ DefaultInfo(files = depset(direct = files)),
+ ]
+
+def _py_proto_library_aspect_impl(target, ctx):
+ proto_info = target[ProtoInfo]
+ proto_sources = proto_info.direct_sources
+ srcs = [_generate_output_file(ctx, name, "_pb2.py") for name in proto_sources]
+ transitive_sets = proto_info.transitive_descriptor_sets.to_list()
+ ctx.actions.run(
+ inputs = depset(
+ direct = [proto_info.direct_descriptor_set],
+ transitive = [proto_info.transitive_descriptor_sets],
+ ),
+ outputs = srcs,
+ executable = ctx.executable._protoc,
+ arguments = [
+ "--python_out=" + _get_real_root(srcs[0]),
+ "--descriptor_set_in=" + ctx.configuration.host_path_separator.join([f.path for f in transitive_sets]),
+ ] +
+ [_get_real_short_path(file) for file in proto_sources],
+ progress_message = "Generating Python protos for :" + ctx.label.name,
+ )
+ outs_depset = depset(srcs)
+ return [
+ PyInfo(transitive_sources = outs_depset),
+ ]
+
+_py_proto_library_aspect = aspect(
+ attrs = {
+ "_protoc": attr.label(
+ executable = True,
+ cfg = "exec",
+ default = "@com_google_protobuf//:protoc",
+ ),
+ },
+ implementation = _py_proto_library_aspect_impl,
+ provides = [
+ PyInfo,
+ ],
+ attr_aspects = ["deps"],
+)
+
+py_proto_library = rule(
+ output_to_genfiles = True,
+ implementation = _py_proto_library_rule_impl,
+ attrs = {
+ "deps": attr.label_list(
+ aspects = [_py_proto_library_aspect],
+ allow_rules = ["proto_library"],
+ providers = [ProtoInfo],
+ ),
+ },
+)
diff --git a/grpc/third_party/upb/bazel/pyproto_test_wrapper.bzl b/grpc/third_party/upb/bazel/pyproto_test_wrapper.bzl
new file mode 100644
index 00000000..629ee9b2
--- /dev/null
+++ b/grpc/third_party/upb/bazel/pyproto_test_wrapper.bzl
@@ -0,0 +1,35 @@
+# begin:github_only
+
+def pyproto_test_wrapper(name):
+ src = name + "_wrapper.py"
+ native.py_test(
+ name = name,
+ srcs = [src],
+ legacy_create_init = False,
+ main = src,
+ data = ["@com_google_protobuf//:testdata"],
+ deps = [
+ "//python:message_ext",
+ "@com_google_protobuf//:python_common_test_protos",
+ "@com_google_protobuf//:python_specific_test_protos",
+ "@com_google_protobuf//:python_srcs",
+ ],
+ )
+
+# end:github_only
+
+# begin:google_only
+#
+# def pyproto_test_wrapper(name):
+# src = name + "_wrapper.py"
+# native.py_test(
+# name = name,
+# srcs = [src],
+# main = src,
+# deps = [
+# "//net/proto2/python/internal:" + name + "_for_deps",
+# "//net/proto2/python/public:use_upb_protos",
+# ],
+# )
+#
+# end:google_only
diff --git a/grpc/third_party/upb/bazel/ragel.BUILD b/grpc/third_party/upb/bazel/ragel.BUILD
deleted file mode 100644
index 5916bea1..00000000
--- a/grpc/third_party/upb/bazel/ragel.BUILD
+++ /dev/null
@@ -1,195 +0,0 @@
-package(
- default_visibility = ["//visibility:public"],
-)
-
-cc_binary(
- name = "ragelc",
- srcs = [
- "ragel/rubycodegen.cpp",
- "ragel/goipgoto.h",
- "ragel/cdtable.h",
- "ragel/rubycodegen.h",
- "ragel/gotable.h",
- "ragel/gocodegen.cpp",
- "ragel/rubyfflat.cpp",
- "ragel/common.cpp",
- "ragel/gofflat.cpp",
- "ragel/cdtable.cpp",
- "ragel/cdsplit.cpp",
- "ragel/rlparse.cpp",
- "ragel/csfgoto.cpp",
- "ragel/javacodegen.cpp",
- "ragel/gocodegen.h",
- "ragel/mlgoto.cpp",
- "ragel/fsmgraph.cpp",
- "ragel/version.h",
- "ragel/mlfflat.h",
- "ragel/fsmgraph.h",
- "ragel/fsmbase.cpp",
- "ragel/fsmstate.cpp",
- "ragel/gotablish.cpp",
- "ragel/rubyflat.cpp",
- "ragel/cdfgoto.h",
- "ragel/cscodegen.h",
- "ragel/mlflat.cpp",
- "ragel/rubyflat.h",
- "ragel/goftable.h",
- "ragel/rbxgoto.cpp",
- "ragel/csfflat.cpp",
- "ragel/gofgoto.cpp",
- "ragel/gofgoto.h",
- "ragel/ragel.h",
- "ragel/goftable.cpp",
- "ragel/cdcodegen.cpp",
- "ragel/rlparse.h",
- "ragel/cdsplit.h",
- "ragel/xmlcodegen.cpp",
- "ragel/goipgoto.cpp",
- "ragel/dotcodegen.h",
- "ragel/gogoto.cpp",
- "ragel/csflat.h",
- "ragel/csfflat.h",
- #"ragel/config.h.in",
- "ragel/csipgoto.cpp",
- "ragel/mltable.cpp",
- "ragel/mlflat.h",
- "ragel/csftable.cpp",
- "ragel/cdgoto.h",
- "ragel/goflat.cpp",
- "ragel/rubyfflat.h",
- "ragel/mlftable.h",
- "ragel/rubyftable.h",
- "ragel/fsmap.cpp",
- "ragel/redfsm.cpp",
- "ragel/goflat.h",
- "ragel/parsetree.cpp",
- "ragel/fsmmin.cpp",
- "ragel/dotcodegen.cpp",
- "ragel/redfsm.h",
- "ragel/mlcodegen.cpp",
- "ragel/cdfgoto.cpp",
- "ragel/cssplit.cpp",
- "ragel/cstable.cpp",
- "ragel/javacodegen.h",
- "ragel/parsedata.cpp",
- "ragel/buffer.h",
- "ragel/gogoto.h",
- "ragel/csgoto.h",
- "ragel/pcheck.h",
- "ragel/rubyftable.cpp",
- "ragel/csfgoto.h",
- "ragel/common.h",
- "ragel/cdftable.h",
- "ragel/mlgoto.h",
- "ragel/csgoto.cpp",
- "ragel/cdflat.h",
- "ragel/cdipgoto.h",
- "ragel/cstable.h",
- "ragel/gendata.h",
- "ragel/cdfflat.cpp",
- "ragel/gotable.cpp",
- "ragel/cdcodegen.h",
- "ragel/gendata.cpp",
- "ragel/rubytable.h",
- "ragel/csflat.cpp",
- "ragel/inputdata.h",
- "ragel/inputdata.cpp",
- "ragel/rubytable.cpp",
- "ragel/fsmattach.cpp",
- "ragel/csipgoto.h",
- "ragel/cscodegen.cpp",
- "ragel/cdfflat.h",
- "ragel/rbxgoto.h",
- "ragel/xmlcodegen.h",
- "ragel/gofflat.h",
- "ragel/parsedata.h",
- "ragel/mlfgoto.h",
- "ragel/cdflat.cpp",
- "ragel/config.h",
- "ragel/rlscan.cpp",
- "ragel/mlcodegen.h",
- "ragel/mlfflat.cpp",
- "ragel/mlftable.cpp",
- "ragel/mltable.h",
- "ragel/cdipgoto.cpp",
- "ragel/cdftable.cpp",
- "ragel/parsetree.h",
- "ragel/rlscan.h",
- "ragel/main.cpp",
- "ragel/cssplit.h",
- "ragel/mlfgoto.cpp",
- "ragel/csftable.h",
- "ragel/gotablish.h",
- "ragel/cdgoto.cpp",
- "aapl/avlmelkey.h",
- "aapl/dlistmel.h",
- "aapl/avliset.h",
- "aapl/avlkeyless.h",
- "aapl/sbstset.h",
- "aapl/sbsttable.h",
- "aapl/quicksort.h",
- "aapl/avlitree.h",
- "aapl/avlcommon.h",
- "aapl/bstset.h",
- "aapl/avlmel.h",
- "aapl/insertsort.h",
- "aapl/dlist.h",
- "aapl/avlmap.h",
- "aapl/mergesort.h",
- "aapl/resize.h",
- "aapl/bstcommon.h",
- "aapl/bstmap.h",
- "aapl/compare.h",
- "aapl/svector.h",
- "aapl/avlset.h",
- "aapl/bsttable.h",
- "aapl/avlikeyless.h",
- "aapl/bubblesort.h",
- "aapl/table.h",
- "aapl/avlbasic.h",
- "aapl/vector.h",
- "aapl/avlimap.h",
- "aapl/dlistval.h",
- "aapl/dlcommon.h",
- "aapl/avlibasic.h",
- "aapl/sbstmap.h",
- "aapl/avlimel.h",
- "aapl/avlimelkey.h",
- "aapl/avltree.h",
- ],
- includes = [
- "aapl",
- "ragel",
- ],
-)
-
-config_h_contents = """
-#define PACKAGE "ragel"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "ragel"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ragel 6.10"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "ragel"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "6.10"
-
-/* Version number of package */
-#define VERSION "6.10"
-"""
-
-genrule(
- name = "gen_config_h",
- outs = ["ragel/config.h"],
- cmd = "(cat <<'HEREDOC'\n%s\nHEREDOC\n) > $@" % config_h_contents,
-)
diff --git a/grpc/third_party/upb/bazel/upb_proto_library.bzl b/grpc/third_party/upb/bazel/upb_proto_library.bzl
index 155d18d9..82af0e6a 100644
--- a/grpc/third_party/upb/bazel/upb_proto_library.bzl
+++ b/grpc/third_party/upb/bazel/upb_proto_library.bzl
@@ -1,3 +1,28 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
"""Public rules for using upb protos:
- upb_proto_library()
- upb_proto_reflection_library()
@@ -5,11 +30,16 @@
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
-load("@rules_proto//proto:defs.bzl", "ProtoInfo") # copybara:strip_for_google3
# Generic support code #########################################################
-_is_bazel = True # copybara:replace_for_google3 _is_bazel = False
+# begin:github_only
+_is_google3 = False
+# end:github_only
+
+# begin:google_only
+# _is_google3 = True
+# end:google_only
def _get_real_short_path(file):
# For some reason, files from other archives have short paths that look like:
@@ -72,7 +102,7 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, dep_ccinfos):
blaze_only_args = {}
- if not _is_bazel:
+ if _is_google3:
blaze_only_args["grep_includes"] = ctx.file._grep_includes
(compilation_context, compilation_outputs) = cc_common.compile(
@@ -225,7 +255,7 @@ def _upb_proto_aspect_impl(target, ctx, generator, cc_provider, file_provider):
dep_ccinfos += [dep[_UpbDefsWrappedCcInfo].cc_info for dep in deps if _UpbDefsWrappedCcInfo in dep]
if generator == "upbdefs":
if _UpbWrappedCcInfo not in target:
- fail("Target should have _UpbDefsWrappedCcInfo provider")
+ fail("Target should have _UpbWrappedCcInfo provider")
dep_ccinfos += [target[_UpbWrappedCcInfo].cc_info]
cc_info = _cc_library_func(
ctx = ctx,
@@ -244,11 +274,11 @@ def _upb_proto_reflection_library_aspect_impl(target, ctx):
return _upb_proto_aspect_impl(target, ctx, "upbdefs", _UpbDefsWrappedCcInfo, _WrappedDefsGeneratedSrcsInfo)
def _maybe_add(d):
- if not _is_bazel:
+ if _is_google3:
d["_grep_includes"] = attr.label(
allow_single_file = True,
- cfg = "host",
- default = "//tools/cpp:grep-includes",
+ cfg = "exec",
+ default = "@bazel_tools//tools/cpp:grep-includes",
)
return d
@@ -261,12 +291,12 @@ _upb_proto_library_aspect = aspect(
),
"_gen_upb": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "//upbc:protoc-gen-upb",
),
"_protoc": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "@com_google_protobuf//:protoc",
),
"_cc_toolchain": attr.label(
@@ -274,7 +304,6 @@ _upb_proto_library_aspect = aspect(
),
"_upb": attr.label_list(default = [
"//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
- "//:upb",
]),
"_fasttable_enabled": attr.label(default = "//:fasttable_enabled"),
}),
@@ -310,12 +339,12 @@ _upb_proto_reflection_library_aspect = aspect(
),
"_gen_upbdefs": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "//upbc:protoc-gen-upbdefs",
),
"_protoc": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "@com_google_protobuf//:protoc",
),
"_cc_toolchain": attr.label(
@@ -323,8 +352,7 @@ _upb_proto_reflection_library_aspect = aspect(
),
"_upbdefs": attr.label_list(
default = [
- "//:upb",
- "//:reflection",
+ "//:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
],
),
}),
diff --git a/grpc/third_party/upb/bazel/workspace_defs.bzl b/grpc/third_party/upb/bazel/workspace_defs.bzl
new file mode 100644
index 00000000..03655b24
--- /dev/null
+++ b/grpc/third_party/upb/bazel/workspace_defs.bzl
@@ -0,0 +1,87 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Repository rule for using Python 3.x headers from the system."""
+
+_build_file = """
+load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
+cc_library(
+ name = "python_headers",
+ hdrs = glob(["python/**/*.h"]),
+ includes = ["python"],
+ visibility = ["//visibility:public"],
+)
+
+py_runtime(
+ name = "py3_runtime",
+ interpreter_path = "%s",
+ python_version = "PY3",
+)
+
+py_runtime_pair(
+ name = "runtime_pair",
+ py3_runtime = ":py3_runtime",
+)
+
+toolchain(
+ name = "python_toolchain",
+ toolchain = ":runtime_pair",
+ toolchain_type = "@rules_python//python:toolchain_type",
+)
+"""
+
+def _get_config_var(repository_ctx, name):
+ py_program = "import sysconfig; print(sysconfig.get_config_var('%s'), end='')"
+ result = repository_ctx.execute(["python3", "-c", py_program % (name)])
+ if result.return_code != 0:
+ fail("No python3 executable available on the system")
+ return result.stdout
+
+def _python_headers_impl(repository_ctx):
+ path = _get_config_var(repository_ctx, "INCLUDEPY")
+ repository_ctx.symlink(path, "python")
+ python3 = repository_ctx.which("python3")
+ repository_ctx.file("BUILD.bazel", _build_file % python3)
+
+# The system_python() repository rule exposes Python headers from the system.
+#
+# In WORKSPACE:
+# system_python(
+# name = "system_python_repo",
+# )
+#
+# This repository exposes a single rule that you can depend on from BUILD:
+# cc_library(
+# name = "foobar",
+# srcs = ["foobar.cc"],
+# deps = ["@system_python_repo//:python_headers"],
+# )
+#
+# The headers should correspond to the version of python obtained by running
+# the `python3` command on the system.
+system_python = repository_rule(
+ implementation = _python_headers_impl,
+ local = True,
+)
diff --git a/grpc/third_party/upb/bazel/workspace_deps.bzl b/grpc/third_party/upb/bazel/workspace_deps.bzl
index c724d7c2..db3afd7a 100644
--- a/grpc/third_party/upb/bazel/workspace_deps.bzl
+++ b/grpc/third_party/upb/bazel/workspace_deps.bzl
@@ -1,46 +1,44 @@
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def upb_deps():
maybe(
- git_repository,
+ http_archive,
name = "com_google_absl",
- commit = "df3ea785d8c30a9503321a3d35ee7d35808f190d", # LTS 2020-02-25
- remote = "https://github.com/abseil/abseil-cpp.git",
- shallow_since = "1583355457 -0500",
+ url = "https://github.com/abseil/abseil-cpp/archive/b9b925341f9e90f5e7aa0cf23f036c29c7e454eb.zip",
+ strip_prefix = "abseil-cpp-b9b925341f9e90f5e7aa0cf23f036c29c7e454eb",
+ sha256 = "bb2a0b57c92b6666e8acb00f4cbbfce6ddb87e83625fb851b0e78db581340617",
)
maybe(
git_repository,
name = "com_google_protobuf",
+ commit = "2f91da585e96a7efe43505f714f03c7716a94ecb",
remote = "https://github.com/protocolbuffers/protobuf.git",
- commit = "c8f76331abf682c289fa79f05b2ee39cc7bf5a48", # Need to use Git until proto3 optional is released
+ patches = [
+ "//bazel:protobuf.patch",
+ ],
+ patch_cmds = [
+ "rm python/google/protobuf/__init__.py",
+ "rm python/google/protobuf/pyext/__init__.py",
+ "rm python/google/protobuf/internal/__init__.py",
+ ],
)
+ rules_python_version = "740825b7f74930c62f44af95c9a4c1bd428d2c53" # Latest @ 2021-06-23
+
maybe(
http_archive,
name = "rules_python",
- sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6",
- strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27",
- urls = [
- "https://mirror.bazel.build/github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
- "https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
- ],
+ strip_prefix = "rules_python-{}".format(rules_python_version),
+ url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version),
+ sha256 = "09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742",
)
maybe(
http_archive,
name = "bazel_skylib",
- strip_prefix = "bazel-skylib-master",
- urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"],
- )
-
- maybe(
- http_archive,
- name = "zlib",
- build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
- sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
- strip_prefix = "zlib-1.2.11",
- url = "https://github.com/madler/zlib/archive/v1.2.11.tar.gz",
+ strip_prefix = "bazel-skylib-main",
+ urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.tar.gz"],
)
diff --git a/grpc/third_party/upb/benchmarks/BUILD b/grpc/third_party/upb/benchmarks/BUILD
index 2ab830f7..a7852c77 100644
--- a/grpc/third_party/upb/benchmarks/BUILD
+++ b/grpc/third_party/upb/benchmarks/BUILD
@@ -1,3 +1,32 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# begin:google_only
+# load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", "cc_proto_library")
+# end:google_only
+
load(
"//bazel:upb_proto_library.bzl",
"upb_proto_library",
@@ -5,10 +34,10 @@ load(
)
load(
":build_defs.bzl",
- "tmpl_cc_binary",
"cc_optimizefor_proto_library",
"expand_suffixes",
"proto_library",
+ "tmpl_cc_binary",
)
licenses(["notice"])
@@ -48,7 +77,7 @@ cc_proto_library(
deps = [":benchmark_descriptor_sv_proto"],
)
-cc_binary(
+cc_test(
name = "benchmark",
testonly = 1,
srcs = ["benchmark.cc"],
@@ -97,7 +126,6 @@ py_binary(
genrule(
name = "do_gen_synthetic_protos",
- tools = [":gen_synthetic_protos"],
outs = [
"100_msgs.proto",
"200_msgs.proto",
@@ -105,6 +133,7 @@ genrule(
"200_fields.proto",
],
cmd = "$(execpath :gen_synthetic_protos) $(RULEDIR)",
+ tools = [":gen_synthetic_protos"],
)
proto_library(
@@ -133,82 +162,87 @@ proto_library(
)
[(
-upb_proto_library(
- name = k + "_upb_proto",
- deps = [":" + k + "_proto"],
-),
-cc_proto_library(
- name = k + "_cc_proto",
- deps = [":" + k + "_proto"],
-),
-tmpl_cc_binary(
- name = k + "_upb_binary",
- testonly = 1,
- gen = ":gen_upb_binary_c",
- args = [
- package_name() + "/" + k + ".upb.h",
- "upb_benchmark_" + v,
- ],
- deps = [
- ":" + k + "_upb_proto",
- ],
-),
-tmpl_cc_binary(
- name = k + "_protobuf_binary",
- testonly = 1,
- gen = ":gen_protobuf_binary_cc",
- args = [
- package_name() + "/" + k + ".pb.h",
- "upb_benchmark::" + v,
- ],
- deps = [
- ":" + k + "_cc_proto",
- ],
-),
-cc_optimizefor_proto_library(
- srcs = [k + ".proto"],
- outs = [k + "_lite.proto"],
- name = k + "_cc_lite_proto",
- optimize_for = "LITE_RUNTIME",
-),
-tmpl_cc_binary(
- name = k + "_lite_protobuf_binary",
- testonly = 1,
- gen = ":gen_protobuf_binary_cc",
- args = [
- package_name() + "/" + k + "_lite.pb.h",
- "upb_benchmark::" + v,
- ],
- deps = [
- ":" + k + "_cc_lite_proto",
- ],
-),
-cc_optimizefor_proto_library(
- srcs = [k + ".proto"],
- outs = [k + "_codesize.proto"],
- name = k + "_cc_codesize_proto",
- optimize_for = "CODE_SIZE",
-),
-tmpl_cc_binary(
- name = k + "_codesize_protobuf_binary",
- testonly = 1,
- gen = ":gen_protobuf_binary_cc",
- args = [
- package_name() + "/" + k + "_codesize.pb.h",
- "upb_benchmark::" + v,
- ],
- deps = [
- ":" + k + "_cc_codesize_proto",
- ],
-)
+ upb_proto_library(
+ name = k + "_upb_proto",
+ deps = [":" + k + "_proto"],
+ ),
+ cc_proto_library(
+ name = k + "_cc_proto",
+ deps = [":" + k + "_proto"],
+ ),
+ tmpl_cc_binary(
+ name = k + "_upb_binary",
+ testonly = 1,
+ args = [
+ package_name() + "/" + k + ".upb.h",
+ "upb_benchmark_" + v,
+ ],
+ gen = ":gen_upb_binary_c",
+ deps = [
+ ":" + k + "_upb_proto",
+ ],
+ ),
+ tmpl_cc_binary(
+ name = k + "_protobuf_binary",
+ testonly = 1,
+ args = [
+ package_name() + "/" + k + ".pb.h",
+ "upb_benchmark::" + v,
+ ],
+ gen = ":gen_protobuf_binary_cc",
+ deps = [
+ ":" + k + "_cc_proto",
+ ],
+ ),
+ cc_optimizefor_proto_library(
+ name = k + "_cc_lite_proto",
+ srcs = [k + ".proto"],
+ outs = [k + "_lite.proto"],
+ optimize_for = "LITE_RUNTIME",
+ ),
+ tmpl_cc_binary(
+ name = k + "_lite_protobuf_binary",
+ testonly = 1,
+ args = [
+ package_name() + "/" + k + "_lite.pb.h",
+ "upb_benchmark::" + v,
+ ],
+ gen = ":gen_protobuf_binary_cc",
+ deps = [
+ ":" + k + "_cc_lite_proto",
+ ],
+ ),
+ cc_optimizefor_proto_library(
+ name = k + "_cc_codesize_proto",
+ srcs = [k + ".proto"],
+ outs = [k + "_codesize.proto"],
+ optimize_for = "CODE_SIZE",
+ ),
+ tmpl_cc_binary(
+ name = k + "_codesize_protobuf_binary",
+ testonly = 1,
+ args = [
+ package_name() + "/" + k + "_codesize.pb.h",
+ "upb_benchmark::" + v,
+ ],
+ gen = ":gen_protobuf_binary_cc",
+ deps = [
+ ":" + k + "_cc_codesize_proto",
+ ],
+ ),
) for k, v in SIZE_BENCHMARKS.items()]
genrule(
- testonly = 1,
name = "size_data",
+ testonly = 1,
srcs = expand_suffixes(
SIZE_BENCHMARKS.keys(),
- suffixes = ["_upb_binary", "_protobuf_binary", "_lite_protobuf_binary", "_codesize_protobuf_binary"],
+ suffixes = [
+ "_upb_binary",
+ "_protobuf_binary",
+ "_lite_protobuf_binary",
+ "_codesize_protobuf_binary",
+ ],
),
outs = ["size_data.txt"],
# We want --format=GNU which counts rodata with data, not text.
diff --git a/grpc/third_party/upb/benchmarks/BUILD.googleapis b/grpc/third_party/upb/benchmarks/BUILD.googleapis
index 904bdeca..a8f31b2a 100644
--- a/grpc/third_party/upb/benchmarks/BUILD.googleapis
+++ b/grpc/third_party/upb/benchmarks/BUILD.googleapis
@@ -1,3 +1,28 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
load(
"@rules_proto//proto:defs.bzl",
"proto_library",
@@ -6,7 +31,7 @@ load(
proto_library(
name = "ads_proto",
srcs = glob([
- "google/ads/googleads/v5/**/*.proto",
+ "google/ads/googleads/v7/**/*.proto",
"google/api/**/*.proto",
"google/rpc/**/*.proto",
"google/longrunning/**/*.proto",
diff --git a/grpc/third_party/upb/benchmarks/benchmark.cc b/grpc/third_party/upb/benchmarks/benchmark.cc
index 7f4765a8..368780e1 100644
--- a/grpc/third_party/upb/benchmarks/benchmark.cc
+++ b/grpc/third_party/upb/benchmarks/benchmark.cc
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <benchmark/benchmark.h>
#include <string.h>
@@ -7,21 +31,23 @@
#include "benchmarks/descriptor.upb.h"
#include "benchmarks/descriptor.upbdefs.h"
#include "benchmarks/descriptor_sv.pb.h"
-#include "google/ads/googleads/v5/services/google_ads_service.upbdefs.h"
+#include "google/ads/googleads/v7/services/google_ads_service.upbdefs.h"
#include "google/protobuf/descriptor.pb.h"
+#include "google/protobuf/dynamic_message.h"
#include "upb/def.hpp"
-upb_strview descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor;
+upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor;
namespace protobuf = ::google::protobuf;
/* A buffer big enough to parse descriptor.proto without going to heap. */
char buf[65535];
-void CollectFileDescriptors(const upb_def_init* file,
- std::vector<upb_strview>& serialized_files,
- absl::flat_hash_set<const upb_def_init*>& seen) {
+void CollectFileDescriptors(
+ const _upb_DefPool_Init* file,
+ std::vector<upb_StringView>& serialized_files,
+ absl::flat_hash_set<const _upb_DefPool_Init*>& seen) {
if (!seen.insert(file).second) return;
- for (upb_def_init **deps = file->deps; *deps; deps++) {
+ for (_upb_DefPool_Init** deps = file->deps; *deps; deps++) {
CollectFileDescriptors(*deps, serialized_files, seen);
}
serialized_files.push_back(file->descriptor);
@@ -29,69 +55,112 @@ void CollectFileDescriptors(const upb_def_init* file,
static void BM_ArenaOneAlloc(benchmark::State& state) {
for (auto _ : state) {
- upb_arena* arena = upb_arena_new();
- upb_arena_malloc(arena, 1);
- upb_arena_free(arena);
+ upb_Arena* arena = upb_Arena_New();
+ upb_Arena_Malloc(arena, 1);
+ upb_Arena_Free(arena);
}
}
BENCHMARK(BM_ArenaOneAlloc);
static void BM_ArenaInitialBlockOneAlloc(benchmark::State& state) {
for (auto _ : state) {
- upb_arena* arena = upb_arena_init(buf, sizeof(buf), NULL);
- upb_arena_malloc(arena, 1);
- upb_arena_free(arena);
+ upb_Arena* arena = upb_Arena_Init(buf, sizeof(buf), NULL);
+ upb_Arena_Malloc(arena, 1);
+ upb_Arena_Free(arena);
}
}
BENCHMARK(BM_ArenaInitialBlockOneAlloc);
-static void BM_LoadDescriptor_Upb(benchmark::State& state) {
- size_t bytes_per_iter = 0;
- for (auto _ : state) {
- upb::SymbolTable symtab;
- upb_benchmark_DescriptorProto_getmsgdef(symtab.ptr());
- bytes_per_iter = _upb_symtab_bytesloaded(symtab.ptr());
+enum LoadDescriptorMode {
+ NoLayout,
+ WithLayout,
+};
+
+// This function is mostly copied from upb/def.c, but it is modified to avoid
+// passing in the pre-generated mini-tables, in order to force upb to compute
+// them dynamically. Generally you would never want to do this, but we want to
+// simulate the cost we would pay if we were loading these types purely from
+// descriptors, with no mini-tales available.
+bool LoadDefInit_BuildLayout(upb_DefPool* s, const _upb_DefPool_Init* init,
+ size_t* bytes) {
+ _upb_DefPool_Init** deps = init->deps;
+ google_protobuf_FileDescriptorProto* file;
+ upb_Arena* arena;
+ upb_Status status;
+
+ upb_Status_Clear(&status);
+
+ if (upb_DefPool_FindFileByName(s, init->filename)) {
+ return true;
}
- state.SetBytesProcessed(state.iterations() * bytes_per_iter);
+
+ arena = upb_Arena_New();
+
+ for (; *deps; deps++) {
+ if (!LoadDefInit_BuildLayout(s, *deps, bytes)) goto err;
+ }
+
+ file = google_protobuf_FileDescriptorProto_parse_ex(
+ init->descriptor.data, init->descriptor.size, NULL,
+ kUpb_DecodeOption_AliasString, arena);
+ *bytes += init->descriptor.size;
+
+ if (!file) {
+ upb_Status_SetErrorFormat(
+ &status,
+ "Failed to parse compiled-in descriptor for file '%s'. This should "
+ "never happen.",
+ init->filename);
+ goto err;
+ }
+
+ // KEY DIFFERENCE: Here we pass in only the descriptor, and not the
+ // pre-generated minitables.
+ if (!upb_DefPool_AddFile(s, file, &status)) {
+ goto err;
+ }
+
+ upb_Arena_Free(arena);
+ return true;
+
+err:
+ fprintf(stderr,
+ "Error loading compiled-in descriptor for file '%s' (this should "
+ "never happen): %s\n",
+ init->filename, upb_Status_ErrorMessage(&status));
+ exit(1);
}
-BENCHMARK(BM_LoadDescriptor_Upb);
+template <LoadDescriptorMode Mode>
static void BM_LoadAdsDescriptor_Upb(benchmark::State& state) {
size_t bytes_per_iter = 0;
for (auto _ : state) {
upb::SymbolTable symtab;
- google_ads_googleads_v5_services_SearchGoogleAdsRequest_getmsgdef(
- symtab.ptr());
- bytes_per_iter = _upb_symtab_bytesloaded(symtab.ptr());
- }
- state.SetBytesProcessed(state.iterations() * bytes_per_iter);
-}
-BENCHMARK(BM_LoadAdsDescriptor_Upb);
-
-static void BM_LoadDescriptor_Proto2(benchmark::State& state) {
- for (auto _ : state) {
- protobuf::Arena arena;
- protobuf::StringPiece input(descriptor.data,descriptor.size);
- auto proto = protobuf::Arena::CreateMessage<protobuf::FileDescriptorProto>(
- &arena);
- protobuf::DescriptorPool pool;
- bool ok = proto->ParseFrom<protobuf::MessageLite::kMergePartial>(input) &&
- pool.BuildFile(*proto) != nullptr;
- if (!ok) {
- printf("Failed to add file.\n");
- exit(1);
+ if (Mode == NoLayout) {
+ google_ads_googleads_v7_services_SearchGoogleAdsRequest_getmsgdef(
+ symtab.ptr());
+ bytes_per_iter = _upb_DefPool_BytesLoaded(symtab.ptr());
+ } else {
+ bytes_per_iter = 0;
+ LoadDefInit_BuildLayout(
+ symtab.ptr(),
+ &google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit,
+ &bytes_per_iter);
}
}
- state.SetBytesProcessed(state.iterations() * descriptor.size);
+ state.SetBytesProcessed(state.iterations() * bytes_per_iter);
}
-BENCHMARK(BM_LoadDescriptor_Proto2);
+BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Upb, NoLayout);
+BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Upb, WithLayout);
+template <LoadDescriptorMode Mode>
static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) {
- extern upb_def_init google_ads_googleads_v5_services_google_ads_service_proto_upbdefinit;
- std::vector<upb_strview> serialized_files;
- absl::flat_hash_set<const upb_def_init*> seen_files;
+ extern _upb_DefPool_Init
+ google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit;
+ std::vector<upb_StringView> serialized_files;
+ absl::flat_hash_set<const _upb_DefPool_Init*> seen_files;
CollectFileDescriptors(
- &google_ads_googleads_v5_services_google_ads_service_proto_upbdefinit,
+ &google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit,
serialized_files, seen_files);
size_t bytes_per_iter = 0;
for (auto _ : state) {
@@ -100,8 +169,8 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) {
protobuf::DescriptorPool pool;
for (auto file : serialized_files) {
protobuf::StringPiece input(file.data, file.size);
- auto proto = protobuf::Arena::CreateMessage<protobuf::FileDescriptorProto>(
- &arena);
+ auto proto =
+ protobuf::Arena::CreateMessage<protobuf::FileDescriptorProto>(&arena);
bool ok = proto->ParseFrom<protobuf::MessageLite::kMergePartial>(input) &&
pool.BuildFile(*proto) != nullptr;
if (!ok) {
@@ -110,10 +179,22 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) {
}
bytes_per_iter += input.size();
}
+
+ if (Mode == WithLayout) {
+ protobuf::DynamicMessageFactory factory;
+ const protobuf::Descriptor* d = pool.FindMessageTypeByName(
+ "google.ads.googleads.v7.services.SearchGoogleAdsResponse");
+ if (!d) {
+ printf("Failed to find descriptor.\n");
+ exit(1);
+ }
+ factory.GetPrototype(d);
+ }
}
state.SetBytesProcessed(state.iterations() * bytes_per_iter);
}
-BENCHMARK(BM_LoadAdsDescriptor_Proto2);
+BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Proto2, NoLayout);
+BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Proto2, WithLayout);
enum CopyStrings {
Copy,
@@ -128,24 +209,22 @@ enum ArenaMode {
template <ArenaMode AMode, CopyStrings Copy>
static void BM_Parse_Upb_FileDesc(benchmark::State& state) {
- size_t bytes = 0;
for (auto _ : state) {
- upb_arena *arena;
+ upb_Arena* arena;
if (AMode == InitBlock) {
- arena = upb_arena_init(buf, sizeof(buf), NULL);
+ arena = upb_Arena_Init(buf, sizeof(buf), NULL);
} else {
- arena = upb_arena_new();
+ arena = upb_Arena_New();
}
upb_benchmark_FileDescriptorProto* set =
upb_benchmark_FileDescriptorProto_parse_ex(
- descriptor.data, descriptor.size, arena,
- Copy == Alias ? UPB_DECODE_ALIAS : 0);
+ descriptor.data, descriptor.size, NULL,
+ Copy == Alias ? kUpb_DecodeOption_AliasString : 0, arena);
if (!set) {
printf("Failed to parse.\n");
exit(1);
}
- bytes += descriptor.size;
- upb_arena_free(arena);
+ upb_Arena_Free(arena);
}
state.SetBytesProcessed(state.iterations() * descriptor.size);
}
@@ -157,7 +236,7 @@ BENCHMARK_TEMPLATE(BM_Parse_Upb_FileDesc, InitBlock, Alias);
template <ArenaMode AMode, class P>
struct Proto2Factory;
-template<class P>
+template <class P>
struct Proto2Factory<NoArena, P> {
public:
P* GetProto() { return &proto_; }
@@ -197,7 +276,6 @@ using FileDescSV = ::upb_benchmark::sv::FileDescriptorProto;
template <class P, ArenaMode AMode, CopyStrings kCopy>
void BM_Parse_Proto2(benchmark::State& state) {
- size_t bytes = 0;
constexpr protobuf::MessageLite::ParseFlags kParseFlags =
kCopy == Copy
? protobuf::MessageLite::ParseFlags::kMergePartial
@@ -205,13 +283,12 @@ void BM_Parse_Proto2(benchmark::State& state) {
for (auto _ : state) {
Proto2Factory<AMode, P> proto_factory;
auto proto = proto_factory.GetProto();
- protobuf::StringPiece input(descriptor.data,descriptor.size);
+ protobuf::StringPiece input(descriptor.data, descriptor.size);
bool ok = proto->template ParseFrom<kParseFlags>(input);
if (!ok) {
printf("Failed to parse.\n");
exit(1);
}
- bytes += descriptor.size;
}
state.SetBytesProcessed(state.iterations() * descriptor.size);
}
@@ -221,12 +298,10 @@ BENCHMARK_TEMPLATE(BM_Parse_Proto2, FileDesc, InitBlock, Copy);
BENCHMARK_TEMPLATE(BM_Parse_Proto2, FileDescSV, InitBlock, Alias);
static void BM_SerializeDescriptor_Proto2(benchmark::State& state) {
- size_t bytes = 0;
upb_benchmark::FileDescriptorProto proto;
proto.ParseFromArray(descriptor.data, descriptor.size);
for (auto _ : state) {
proto.SerializePartialToArray(buf, sizeof(buf));
- bytes += descriptor.size;
}
state.SetBytesProcessed(state.iterations() * descriptor.size);
}
@@ -234,7 +309,7 @@ BENCHMARK(BM_SerializeDescriptor_Proto2);
static void BM_SerializeDescriptor_Upb(benchmark::State& state) {
int64_t total = 0;
- upb_arena* arena = upb_arena_new();
+ upb_Arena* arena = upb_Arena_New();
upb_benchmark_FileDescriptorProto* set =
upb_benchmark_FileDescriptorProto_parse(descriptor.data, descriptor.size,
arena);
@@ -243,7 +318,7 @@ static void BM_SerializeDescriptor_Upb(benchmark::State& state) {
exit(1);
}
for (auto _ : state) {
- upb_arena* enc_arena = upb_arena_init(buf, sizeof(buf), NULL);
+ upb_Arena* enc_arena = upb_Arena_Init(buf, sizeof(buf), NULL);
size_t size;
char* data =
upb_benchmark_FileDescriptorProto_serialize(set, enc_arena, &size);
diff --git a/grpc/third_party/upb/benchmarks/build_defs.bzl b/grpc/third_party/upb/benchmarks/build_defs.bzl
index ff534fb9..3fc4dd22 100644
--- a/grpc/third_party/upb/benchmarks/build_defs.bzl
+++ b/grpc/third_party/upb/benchmarks/build_defs.bzl
@@ -1,18 +1,44 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# copybara:insert_for_google3_begin
-# load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", _cc_proto_library="cc_proto_library")
-# copybara:insert_end
+# begin:google_only
+# load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", _cc_proto_library = "cc_proto_library")
+#
+# _is_google3 = True
+# end:google_only
-# copybara:strip_for_google3_begin
+# begin:github_only
_cc_proto_library = native.cc_proto_library
-# copybara:strip_end
+_is_google3 = False
+# end:github_only
def proto_library(**kwargs):
+ if _is_google3:
+ kwargs["cc_api_version"] = 2
native.proto_library(
- # copybara:insert_for_google3_begin
- # cc_api_version = 2,
- # copybara:insert_end
- **kwargs,
+ **kwargs
)
def tmpl_cc_binary(name, gen, args, replacements = [], **kwargs):
@@ -24,14 +50,13 @@ def tmpl_cc_binary(name, gen, args, replacements = [], **kwargs):
cmd = "$(location " + gen + ") " + " ".join(args) + " > $@",
)
+ if _is_google3:
+ kwargs["malloc"] = "//base:system_malloc"
+ kwargs["features"] = ["-static_linking_mode"]
native.cc_binary(
- # copybara:insert_for_google3_begin
- # malloc="//base:system_malloc",
- # features = ["-static_linking_mode"],
- # copybara:insert_end
name = name,
srcs = srcs,
- **kwargs,
+ **kwargs
)
def cc_optimizefor_proto_library(name, srcs, outs, optimize_for):
diff --git a/grpc/third_party/upb/benchmarks/compare.py b/grpc/third_party/upb/benchmarks/compare.py
index 8d62d942..445e6155 100755
--- a/grpc/third_party/upb/benchmarks/compare.py
+++ b/grpc/third_party/upb/benchmarks/compare.py
@@ -1,4 +1,30 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
"""Benchmarks the current working directory against a given baseline.
This script benchmarks both size and speed. Sample output:
@@ -38,27 +64,30 @@ def Benchmark(outbase, bench_cpu=True, runs=12, fasttable=False):
if bench_cpu:
Run("CC=clang bazel build -c opt --copt=-march=native benchmarks:benchmark" + extra_args)
- Run("./bazel-bin/benchmarks/benchmark --benchmark_out_format=json --benchmark_out={} --benchmark_repetitions={}".format(tmpfile, runs))
+ Run("./bazel-bin/benchmarks/benchmark --benchmark_out_format=json --benchmark_out={} --benchmark_repetitions={} --benchmark_min_time=0.05 --benchmark_enable_random_interleaving=true".format(tmpfile, runs))
with open(tmpfile) as f:
bench_json = json.load(f)
# Translate into the format expected by benchstat.
- with open(outbase + ".txt", "w") as f:
+ txt_filename = outbase + ".txt"
+ with open(txt_filename, "w") as f:
for run in bench_json["benchmarks"]:
+ if run["run_type"] == "aggregate":
+ continue
name = run["name"]
name = name.replace(" ", "")
name = re.sub(r'^BM_', 'Benchmark', name)
- if name.endswith("_mean") or name.endswith("_median") or name.endswith("_stddev"):
- continue
values = (name, run["iterations"], run["cpu_time"])
print("{} {} {} ns/op".format(*values), file=f)
+ Run("sort {} -o {} ".format(txt_filename, txt_filename))
- Run("CC=clang bazel build -c opt --copt=-g tests:conformance_upb" + extra_args)
- Run("cp -f bazel-bin/tests/conformance_upb {}.bin".format(outbase))
+ Run("CC=clang bazel build -c opt --copt=-g --copt=-march=native :conformance_upb"
+ + extra_args)
+ Run("cp -f bazel-bin/conformance_upb {}.bin".format(outbase))
-baseline = "master"
-bench_cpu = False
+baseline = "main"
+bench_cpu = True
fasttable = False
if len(sys.argv) > 1:
diff --git a/grpc/third_party/upb/benchmarks/descriptor.proto b/grpc/third_party/upb/benchmarks/descriptor.proto
index b69b27f8..db16ebc5 100644
--- a/grpc/third_party/upb/benchmarks/descriptor.proto
+++ b/grpc/third_party/upb/benchmarks/descriptor.proto
@@ -36,7 +36,6 @@
// A valid .proto file can be translated directly to a FileDescriptorProto
// without any other information (e.g. without reading its imports).
-
syntax = "proto2";
package upb_benchmark;
@@ -125,7 +124,6 @@ message ExtensionRangeOptions {
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
-
// Clients can define custom options in extensions of this message. See above.
extensions 1000 to max;
}
@@ -302,7 +300,6 @@ message MethodDescriptorProto {
optional bool server_streaming = 6 [default = false];
}
-
// ===================================================================
// Options
@@ -336,14 +333,12 @@ message MethodDescriptorProto {
// to automatically assign option numbers.
message FileOptions {
-
// Sets the Java package where classes generated from this .proto will be
// placed. By default, the proto package is used, but this is often
// inappropriate because proto packages do not normally start with backwards
// domain names.
optional string java_package = 1;
-
// If set, all the classes from the .proto file are wrapped in a single
// outer class with the given name. This applies to both Proto1
// (equivalent to the old "--one_java_file" option) and Proto2 (where
@@ -360,7 +355,7 @@ message FileOptions {
optional bool java_multiple_files = 10 [default = false];
// This option does nothing.
- optional bool java_generate_equals_and_hash = 20 [deprecated=true];
+ optional bool java_generate_equals_and_hash = 20 [deprecated = true];
// If set true, then the Java2 code generator will generate code that
// throws an exception whenever an attempt is made to assign a non-UTF-8
@@ -370,7 +365,6 @@ message FileOptions {
// This option has no effect on when used with the lite runtime.
optional bool java_string_check_utf8 = 27 [default = false];
-
// Generated classes can be optimized for speed or code size.
enum OptimizeMode {
SPEED = 1; // Generate complete code for parsing, serialization,
@@ -387,9 +381,6 @@ message FileOptions {
// - Otherwise, the basename of the .proto file, without extension.
optional string go_package = 11;
-
-
-
// Should generic services be generated in each language? "Generic" services
// are not specific to any particular RPC system. They are generated by the
// main code generators in each language (without additional plugins).
@@ -415,7 +406,6 @@ message FileOptions {
// only to generated classes for C++.
optional bool cc_enable_arenas = 31 [default = true];
-
// Sets the objective c class prefix which is prepended to all objective c
// generated classes from this .proto. There is no default.
optional string objc_class_prefix = 36;
@@ -448,7 +438,6 @@ message FileOptions {
// determining the ruby package.
optional string ruby_package = 45;
-
// The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999;
@@ -518,7 +507,6 @@ message MessageOptions {
reserved 8; // javalite_serializable
reserved 9; // javanano_as_lite
-
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
@@ -609,7 +597,6 @@ message FieldOptions {
// For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
-
// The parser stores options it doesn't recognize here. See above.
repeated UninterpretedOption uninterpreted_option = 999;
@@ -628,7 +615,6 @@ message OneofOptions {
}
message EnumOptions {
-
// Set this option to true to allow mapping different tag names to the same
// value.
optional bool allow_alias = 2;
@@ -663,7 +649,6 @@ message EnumValueOptions {
}
message ServiceOptions {
-
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
// framework. We apologize for hoarding these numbers to ourselves, but
// we were already using them long before we decided to release Protocol
@@ -683,7 +668,6 @@ message ServiceOptions {
}
message MethodOptions {
-
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
// framework. We apologize for hoarding these numbers to ourselves, but
// we were already using them long before we decided to release Protocol
@@ -713,7 +697,6 @@ message MethodOptions {
extensions 1000 to max;
}
-
// A message representing a option the parser does not recognize. This only
// appears in options protos created by the compiler::Parser class.
// DescriptorPool resolves these when building Descriptor objects. Therefore,
diff --git a/grpc/third_party/upb/benchmarks/gen_protobuf_binary_cc.py b/grpc/third_party/upb/benchmarks/gen_protobuf_binary_cc.py
index 787e3915..41fb100e 100644
--- a/grpc/third_party/upb/benchmarks/gen_protobuf_binary_cc.py
+++ b/grpc/third_party/upb/benchmarks/gen_protobuf_binary_cc.py
@@ -1,3 +1,29 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
import re
diff --git a/grpc/third_party/upb/benchmarks/gen_synthetic_protos.py b/grpc/third_party/upb/benchmarks/gen_synthetic_protos.py
index a95deff0..99f83c15 100644
--- a/grpc/third_party/upb/benchmarks/gen_synthetic_protos.py
+++ b/grpc/third_party/upb/benchmarks/gen_synthetic_protos.py
@@ -1,3 +1,29 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
import random
diff --git a/grpc/third_party/upb/benchmarks/gen_upb_binary_c.py b/grpc/third_party/upb/benchmarks/gen_upb_binary_c.py
index 4df8fd73..8ef51257 100644
--- a/grpc/third_party/upb/benchmarks/gen_upb_binary_c.py
+++ b/grpc/third_party/upb/benchmarks/gen_upb_binary_c.py
@@ -1,3 +1,29 @@
+#!/usr/bin/python3
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
import re
@@ -17,7 +43,7 @@ print('''
char buf[1];
int main() {{
- upb_arena *arena = upb_arena_new();
+ upb_Arena *arena = upb_Arena_New();
size_t size;
'''.format(include=include))
diff --git a/grpc/third_party/upb/cmake/BUILD b/grpc/third_party/upb/cmake/BUILD
deleted file mode 100644
index 53fbd07a..00000000
--- a/grpc/third_party/upb/cmake/BUILD
+++ /dev/null
@@ -1,91 +0,0 @@
-load(
- ":build_defs.bzl",
- "generated_file_staleness_test",
-)
-load(
- "//bazel:build_defs.bzl",
- "make_shell_script",
-)
-
-licenses(["notice"])
-
-exports_files(["staleness_test.py"])
-
-py_library(
- name = "staleness_test_lib",
- testonly = 1,
- srcs = ["staleness_test_lib.py"],
-)
-
-py_binary(
- name = "make_cmakelists",
- srcs = ["make_cmakelists.py"],
-)
-
-genrule(
- name = "gen_cmakelists",
- srcs = [
- "//:BUILD",
- "//:WORKSPACE",
- "//:cmake_files",
- "//third_party/wyhash:cmake_files",
- ":cmake_files",
- ],
- outs = ["generated-in/CMakeLists.txt"],
- cmd = "$(location :make_cmakelists) $@",
- tools = [":make_cmakelists"],
-)
-
-genrule(
- name = "copy_json_ragel",
- srcs = ["//:upb/json/parser.c"],
- outs = ["generated-in/upb/json/parser.c"],
- cmd = "cp $< $@",
-)
-
-genrule(
- name = "copy_protos",
- srcs = ["//:descriptor_upb_proto"],
- outs = [
- "generated-in/google/protobuf/descriptor.upb.c",
- "generated-in/google/protobuf/descriptor.upb.h",
- ],
- cmd = "cp $(SRCS) $(@D)/generated-in/google/protobuf",
-)
-
-generated_file_staleness_test(
- name = "test_generated_files",
- outs = [
- "CMakeLists.txt",
- "google/protobuf/descriptor.upb.c",
- "google/protobuf/descriptor.upb.h",
- "upb/json/parser.c",
- ],
- generated_pattern = "generated-in/%s",
-)
-
-# Test the CMake build #########################################################
-
-filegroup(
- name = "cmake_files",
- srcs = glob([
- "**/*",
- ]),
-)
-
-make_shell_script(
- name = "gen_run_cmake_build",
- out = "run_cmake_build.sh",
- contents = "find . && mkdir build && cd build && cmake ../cmake && make -j8 && make test",
-)
-
-sh_test(
- name = "cmake_build",
- srcs = ["run_cmake_build.sh"],
- data = [
- ":cmake_files",
- "//:cmake_files",
- "//third_party/wyhash:cmake_files",
- ],
- deps = ["@bazel_tools//tools/bash/runfiles"],
-)
diff --git a/grpc/third_party/upb/cmake/BUILD.bazel b/grpc/third_party/upb/cmake/BUILD.bazel
new file mode 100644
index 00000000..10572f05
--- /dev/null
+++ b/grpc/third_party/upb/cmake/BUILD.bazel
@@ -0,0 +1,102 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+load(
+ ":build_defs.bzl",
+ "generated_file_staleness_test",
+)
+load(
+ "//bazel:build_defs.bzl",
+ "make_shell_script",
+)
+
+licenses(["notice"])
+
+exports_files(["staleness_test.py"])
+
+py_library(
+ name = "staleness_test_lib",
+ testonly = 1,
+ srcs = ["staleness_test_lib.py"],
+)
+
+py_binary(
+ name = "make_cmakelists",
+ srcs = ["make_cmakelists.py"],
+)
+
+genrule(
+ name = "gen_cmakelists",
+ srcs = [
+ "//:BUILD",
+ "//:WORKSPACE",
+ ],
+ outs = ["generated-in/CMakeLists.txt"],
+ cmd = "$(location :make_cmakelists) $@",
+ tools = [":make_cmakelists"],
+)
+
+genrule(
+ name = "copy_protos",
+ srcs = ["//:descriptor_upb_proto"],
+ outs = [
+ "generated-in/google/protobuf/descriptor.upb.c",
+ "generated-in/google/protobuf/descriptor.upb.h",
+ ],
+ cmd = "cp $(SRCS) $(@D)/generated-in/google/protobuf",
+)
+
+generated_file_staleness_test(
+ name = "test_generated_files",
+ outs = [
+ "CMakeLists.txt",
+ "google/protobuf/descriptor.upb.c",
+ "google/protobuf/descriptor.upb.h",
+ ],
+ generated_pattern = "generated-in/%s",
+ tags = ["manual"],
+)
+
+# Test the CMake build #########################################################
+
+make_shell_script(
+ name = "gen_run_cmake_build",
+ out = "run_cmake_build.sh",
+ contents = "set -ex\n" +
+ "(cd cmake/generated-in && rsync -avR . ..)\n" +
+ "mkdir build && cd build && cmake ../cmake && make -j8 && make test",
+)
+
+sh_test(
+ name = "cmake_build",
+ srcs = ["run_cmake_build.sh"],
+ data = [
+ ":copy_protos",
+ ":gen_cmakelists",
+ "//:cmake_files",
+ "//third_party/utf8_range:cmake_files",
+ ],
+ deps = ["@bazel_tools//tools/bash/runfiles"],
+)
diff --git a/grpc/third_party/upb/cmake/CMakeLists.txt b/grpc/third_party/upb/cmake/CMakeLists.txt
deleted file mode 100644
index d4cbcc91..00000000
--- a/grpc/third_party/upb/cmake/CMakeLists.txt
+++ /dev/null
@@ -1,165 +0,0 @@
-# This file was generated from BUILD using tools/make_cmakelists.py.
-
-cmake_minimum_required(VERSION 3.1)
-
-if(${CMAKE_VERSION} VERSION_LESS 3.12)
- cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
-else()
- cmake_policy(VERSION 3.12)
-endif()
-
-cmake_minimum_required (VERSION 3.0)
-cmake_policy(SET CMP0048 NEW)
-
-project(upb)
-set(CMAKE_C_STANDARD 99)
-
-
-# Prevent CMake from setting -rdynamic on Linux (!!).
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
-
-# Set default build type.
-if(NOT CMAKE_BUILD_TYPE)
- message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
- set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
- "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
- FORCE)
-endif()
-
-# When using Ninja, compiler output won't be colorized without this.
-include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG(-fdiagnostics-color=always SUPPORTS_COLOR_ALWAYS)
-if(SUPPORTS_COLOR_ALWAYS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
-endif()
-
-# Implement ASAN/UBSAN options
-if(UPB_ENABLE_ASAN)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
-endif()
-
-if(UPB_ENABLE_UBSAN)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
-endif()
-
-include_directories(..)
-include_directories(../cmake)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-if(APPLE)
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup -flat_namespace")
-elseif(UNIX)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id")
-endif()
-
-enable_testing()
-
-add_library(port INTERFACE)
-add_library(upb
- ../upb/decode.c
- ../upb/decode.int.h
- ../upb/encode.c
- ../upb/msg.c
- ../upb/msg.h
- ../upb/table.c
- ../upb/table.int.h
- ../upb/upb.c
- ../upb/upb.int.h
- ../upb/decode.h
- ../upb/encode.h
- ../upb/upb.h
- ../upb/upb.hpp)
-target_link_libraries(upb
- fastdecode
- port
- /third_party/wyhash)
-add_library(fastdecode
- ../upb/decode.int.h
- ../upb/decode_fast.c
- ../upb/decode_fast.h
- ../upb/msg.h
- ../upb/upb.int.h)
-target_link_libraries(fastdecode
- port
- table)
-add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
-target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
- table
- upb)
-add_library(reflection
- ../upb/def.c
- ../upb/msg.h
- ../upb/reflection.c
- ../upb/def.h
- ../upb/def.hpp
- ../upb/reflection.h)
-target_link_libraries(reflection
- descriptor_upb_proto
- port
- table
- upb)
-add_library(textformat
- ../upb/text_encode.c
- ../upb/text_encode.h)
-target_link_libraries(textformat
- port
- reflection)
-add_library(json
- ../upb/json_decode.c
- ../upb/json_encode.c
- ../upb/json_decode.h
- ../upb/json_encode.h)
-target_link_libraries(json
- port
- reflection
- upb)
-add_library(table INTERFACE)
-target_link_libraries(table INTERFACE
- port)
-add_library(handlers
- ../upb/handlers.c
- ../upb/handlers-inl.h
- ../upb/sink.c
- ../upb/handlers.h
- ../upb/sink.h)
-target_link_libraries(handlers
- port
- reflection
- table
- upb)
-add_library(upb_pb
- ../upb/pb/compile_decoder.c
- ../upb/pb/decoder.c
- ../upb/pb/decoder.int.h
- ../upb/pb/encoder.c
- ../upb/pb/textprinter.c
- ../upb/pb/varint.c
- ../upb/pb/varint.int.h
- ../upb/pb/decoder.h
- ../upb/pb/encoder.h
- ../upb/pb/textprinter.h)
-target_link_libraries(upb_pb
- descriptor_upb_proto
- handlers
- port
- reflection
- table
- upb)
-add_library(upb_json
- ../cmake/upb/json/parser.c
- ../upb/json/printer.c
- ../upb/json/parser.h
- ../upb/json/printer.h)
-target_link_libraries(upb_json
- upb
- upb_pb)
-add_library(wyhash INTERFACE)
-
-
diff --git a/grpc/third_party/upb/cmake/build_defs.bzl b/grpc/third_party/upb/cmake/build_defs.bzl
index 34b45375..9e30af95 100644
--- a/grpc/third_party/upb/cmake/build_defs.bzl
+++ b/grpc/third_party/upb/cmake/build_defs.bzl
@@ -1,4 +1,31 @@
-def generated_file_staleness_test(name, outs, generated_pattern):
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Bazel support functions related to CMake support."""
+
+def generated_file_staleness_test(name, outs, generated_pattern, **kwargs):
"""Tests that checked-in file(s) match the contents of generated file(s).
The resulting test will verify that all output files exist and have the
@@ -11,6 +38,7 @@ def generated_file_staleness_test(name, outs, generated_pattern):
generated_pattern: the pattern for transforming each "out" file into a
generated file. For example, if generated_pattern="generated/%s" then
a file foo.txt will look for generated file generated/foo.txt.
+ **kwargs: Additional keyword arguments to pass through to py_test().
"""
script_name = name + ".py"
@@ -37,7 +65,9 @@ def generated_file_staleness_test(name, outs, generated_pattern):
name = name,
srcs = [script_name],
data = existing_outs + [generated_pattern % file for file in outs],
+ python_version = "PY3",
deps = [
":staleness_test_lib",
],
+ **kwargs
)
diff --git a/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.c b/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.c
deleted file mode 100644
index 339fafac..00000000
--- a/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/protobuf/descriptor.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "google/protobuf/descriptor.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const google_protobuf_FileDescriptorSet_submsgs[1] = {
- &google_protobuf_FileDescriptorProto_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_FileDescriptorSet__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_FileDescriptorSet_msginit = {
- &google_protobuf_FileDescriptorSet_submsgs[0],
- &google_protobuf_FileDescriptorSet__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_FileOptions_msginit,
- &google_protobuf_ServiceDescriptorProto_msginit,
- &google_protobuf_SourceCodeInfo_msginit,
-};
-
-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},
- {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},
- {7, UPB_SIZE(52, 104), 0, 2, 11, 3},
- {8, UPB_SIZE(28, 56), 3, 3, 11, 1},
- {9, UPB_SIZE(32, 64), 4, 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), 5, 0, 12, 1},
-};
-
-const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
- &google_protobuf_FileDescriptorProto_submsgs[0],
- &google_protobuf_FileDescriptorProto__fields[0],
- UPB_SIZE(64, 128), 12, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[7] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_DescriptorProto_ExtensionRange_msginit,
- &google_protobuf_DescriptorProto_ReservedRange_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_MessageOptions_msginit,
- &google_protobuf_OneofDescriptorProto_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = {
- {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},
- {5, UPB_SIZE(28, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(32, 64), 0, 4, 11, 3},
- {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},
-};
-
-const upb_msglayout google_protobuf_DescriptorProto_msginit = {
- &google_protobuf_DescriptorProto_submsgs[0],
- &google_protobuf_DescriptorProto__fields[0],
- UPB_SIZE(48, 96), 10, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
- &google_protobuf_ExtensionRangeOptions_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
- {3, UPB_SIZE(12, 16), 3, 0, 11, 1},
-};
-
-const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit = {
- &google_protobuf_DescriptorProto_ExtensionRange_submsgs[0],
- &google_protobuf_DescriptorProto_ExtensionRange__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
-};
-
-static const upb_msglayout_field google_protobuf_DescriptorProto_ReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
-};
-
-const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit = {
- NULL,
- &google_protobuf_DescriptorProto_ReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_ExtensionRangeOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit = {
- &google_protobuf_ExtensionRangeOptions_submsgs[0],
- &google_protobuf_ExtensionRangeOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-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(24, 24), 1, 0, 12, 1},
- {2, UPB_SIZE(32, 40), 2, 0, 12, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 5, 1},
- {4, UPB_SIZE(4, 4), 4, 0, 14, 1},
- {5, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {6, UPB_SIZE(40, 56), 6, 0, 12, 1},
- {7, UPB_SIZE(48, 72), 7, 0, 12, 1},
- {8, UPB_SIZE(64, 104), 8, 0, 11, 1},
- {9, UPB_SIZE(16, 16), 9, 0, 5, 1},
- {10, UPB_SIZE(56, 88), 10, 0, 12, 1},
- {17, UPB_SIZE(20, 20), 11, 0, 8, 1},
-};
-
-const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
- &google_protobuf_FieldDescriptorProto_submsgs[0],
- &google_protobuf_FieldDescriptorProto__fields[0],
- UPB_SIZE(72, 112), 11, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = {
- &google_protobuf_OneofOptions_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 11, 1},
-};
-
-const upb_msglayout google_protobuf_OneofDescriptorProto_msginit = {
- &google_protobuf_OneofDescriptorProto_submsgs[0],
- &google_protobuf_OneofDescriptorProto__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3] = {
- &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
- &google_protobuf_EnumOptions_msginit,
- &google_protobuf_EnumValueDescriptorProto_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5] = {
- {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},
-};
-
-const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = {
- &google_protobuf_EnumDescriptorProto_submsgs[0],
- &google_protobuf_EnumDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
-};
-
-static const upb_msglayout_field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
-};
-
-const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = {
- NULL,
- &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
- &google_protobuf_EnumValueOptions_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = {
- {1, UPB_SIZE(8, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {3, UPB_SIZE(16, 24), 3, 0, 11, 1},
-};
-
-const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit = {
- &google_protobuf_EnumValueDescriptorProto_submsgs[0],
- &google_protobuf_EnumValueDescriptorProto__fields[0],
- UPB_SIZE(24, 32), 3, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs[2] = {
- &google_protobuf_MethodDescriptorProto_msginit,
- &google_protobuf_ServiceOptions_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3] = {
- {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},
-};
-
-const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit = {
- &google_protobuf_ServiceDescriptorProto_submsgs[0],
- &google_protobuf_ServiceDescriptorProto__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[1] = {
- &google_protobuf_MethodOptions_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {3, UPB_SIZE(20, 40), 3, 0, 12, 1},
- {4, UPB_SIZE(28, 56), 4, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 5, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 6, 0, 8, 1},
-};
-
-const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = {
- &google_protobuf_MethodDescriptorProto_submsgs[0],
- &google_protobuf_MethodDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
- {1, UPB_SIZE(20, 24), 1, 0, 12, 1},
- {8, UPB_SIZE(28, 40), 2, 0, 12, 1},
- {9, UPB_SIZE(4, 4), 3, 0, 14, 1},
- {10, UPB_SIZE(8, 8), 4, 0, 8, 1},
- {11, UPB_SIZE(36, 56), 5, 0, 12, 1},
- {16, UPB_SIZE(9, 9), 6, 0, 8, 1},
- {17, UPB_SIZE(10, 10), 7, 0, 8, 1},
- {18, UPB_SIZE(11, 11), 8, 0, 8, 1},
- {20, UPB_SIZE(12, 12), 9, 0, 8, 1},
- {23, UPB_SIZE(13, 13), 10, 0, 8, 1},
- {27, UPB_SIZE(14, 14), 11, 0, 8, 1},
- {31, UPB_SIZE(15, 15), 12, 0, 8, 1},
- {36, UPB_SIZE(44, 72), 13, 0, 12, 1},
- {37, UPB_SIZE(52, 88), 14, 0, 12, 1},
- {39, UPB_SIZE(60, 104), 15, 0, 12, 1},
- {40, UPB_SIZE(68, 120), 16, 0, 12, 1},
- {41, UPB_SIZE(76, 136), 17, 0, 12, 1},
- {42, UPB_SIZE(16, 16), 18, 0, 8, 1},
- {44, UPB_SIZE(84, 152), 19, 0, 12, 1},
- {45, UPB_SIZE(92, 168), 20, 0, 12, 1},
- {999, UPB_SIZE(100, 184), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_FileOptions_msginit = {
- &google_protobuf_FileOptions_submsgs[0],
- &google_protobuf_FileOptions__fields[0],
- UPB_SIZE(104, 192), 21, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_MessageOptions__fields[5] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {3, UPB_SIZE(3, 3), 3, 0, 8, 1},
- {7, UPB_SIZE(4, 4), 4, 0, 8, 1},
- {999, UPB_SIZE(8, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_MessageOptions_msginit = {
- &google_protobuf_MessageOptions_submsgs[0],
- &google_protobuf_MessageOptions__fields[0],
- UPB_SIZE(16, 16), 5, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 14, 1},
- {2, UPB_SIZE(12, 12), 2, 0, 8, 1},
- {3, UPB_SIZE(13, 13), 3, 0, 8, 1},
- {5, UPB_SIZE(14, 14), 4, 0, 8, 1},
- {6, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {10, UPB_SIZE(15, 15), 6, 0, 8, 1},
- {999, UPB_SIZE(16, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_FieldOptions_msginit = {
- &google_protobuf_FieldOptions_submsgs[0],
- &google_protobuf_FieldOptions__fields[0],
- UPB_SIZE(24, 24), 7, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_OneofOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_OneofOptions_msginit = {
- &google_protobuf_OneofOptions_submsgs[0],
- &google_protobuf_OneofOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_EnumOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_EnumOptions__fields[3] = {
- {2, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {3, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_EnumOptions_msginit = {
- &google_protobuf_EnumOptions_submsgs[0],
- &google_protobuf_EnumOptions__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_EnumValueOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_EnumValueOptions_msginit = {
- &google_protobuf_EnumValueOptions_submsgs[0],
- &google_protobuf_EnumValueOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_ServiceOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2] = {
- {33, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_ServiceOptions_msginit = {
- &google_protobuf_ServiceOptions_submsgs[0],
- &google_protobuf_ServiceOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = {
- {33, UPB_SIZE(8, 8), 1, 0, 8, 1},
- {34, UPB_SIZE(4, 4), 2, 0, 14, 1},
- {999, UPB_SIZE(12, 16), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_MethodOptions_msginit = {
- &google_protobuf_MethodOptions_submsgs[0],
- &google_protobuf_MethodOptions__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1] = {
- &google_protobuf_UninterpretedOption_NamePart_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = {
- {2, UPB_SIZE(56, 80), 0, 0, 11, 3},
- {3, UPB_SIZE(32, 32), 1, 0, 12, 1},
- {4, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {5, UPB_SIZE(16, 16), 3, 0, 3, 1},
- {6, UPB_SIZE(24, 24), 4, 0, 1, 1},
- {7, UPB_SIZE(40, 48), 5, 0, 12, 1},
- {8, UPB_SIZE(48, 64), 6, 0, 12, 1},
-};
-
-const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
- &google_protobuf_UninterpretedOption_submsgs[0],
- &google_protobuf_UninterpretedOption__fields[0],
- UPB_SIZE(64, 96), 7, false, 255,
-};
-
-static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 2},
- {2, UPB_SIZE(1, 1), 2, 0, 8, 2},
-};
-
-const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = {
- NULL,
- &google_protobuf_UninterpretedOption_NamePart__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_SourceCodeInfo_submsgs[1] = {
- &google_protobuf_SourceCodeInfo_Location_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_SourceCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_SourceCodeInfo_msginit = {
- &google_protobuf_SourceCodeInfo_submsgs[0],
- &google_protobuf_SourceCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-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},
-};
-
-const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = {
- NULL,
- &google_protobuf_SourceCodeInfo_Location__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
-};
-
-static const upb_msglayout *const google_protobuf_GeneratedCodeInfo_submsgs[1] = {
- &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
-};
-
-static const upb_msglayout_field google_protobuf_GeneratedCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
-};
-
-const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = {
- &google_protobuf_GeneratedCodeInfo_submsgs[0],
- &google_protobuf_GeneratedCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-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), 1, 0, 12, 1},
- {3, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {4, UPB_SIZE(8, 8), 3, 0, 5, 1},
-};
-
-const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
- NULL,
- &google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.h b/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.h
deleted file mode 100644
index a8ed71a6..00000000
--- a/grpc/third_party/upb/cmake/google/protobuf/descriptor.upb.h
+++ /dev/null
@@ -1,1885 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * google/protobuf/descriptor.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
-#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct google_protobuf_FileDescriptorSet;
-struct google_protobuf_FileDescriptorProto;
-struct google_protobuf_DescriptorProto;
-struct google_protobuf_DescriptorProto_ExtensionRange;
-struct google_protobuf_DescriptorProto_ReservedRange;
-struct google_protobuf_ExtensionRangeOptions;
-struct google_protobuf_FieldDescriptorProto;
-struct google_protobuf_OneofDescriptorProto;
-struct google_protobuf_EnumDescriptorProto;
-struct google_protobuf_EnumDescriptorProto_EnumReservedRange;
-struct google_protobuf_EnumValueDescriptorProto;
-struct google_protobuf_ServiceDescriptorProto;
-struct google_protobuf_MethodDescriptorProto;
-struct google_protobuf_FileOptions;
-struct google_protobuf_MessageOptions;
-struct google_protobuf_FieldOptions;
-struct google_protobuf_OneofOptions;
-struct google_protobuf_EnumOptions;
-struct google_protobuf_EnumValueOptions;
-struct google_protobuf_ServiceOptions;
-struct google_protobuf_MethodOptions;
-struct google_protobuf_UninterpretedOption;
-struct google_protobuf_UninterpretedOption_NamePart;
-struct google_protobuf_SourceCodeInfo;
-struct google_protobuf_SourceCodeInfo_Location;
-struct google_protobuf_GeneratedCodeInfo;
-struct google_protobuf_GeneratedCodeInfo_Annotation;
-typedef struct google_protobuf_FileDescriptorSet google_protobuf_FileDescriptorSet;
-typedef struct google_protobuf_FileDescriptorProto google_protobuf_FileDescriptorProto;
-typedef struct google_protobuf_DescriptorProto google_protobuf_DescriptorProto;
-typedef struct google_protobuf_DescriptorProto_ExtensionRange google_protobuf_DescriptorProto_ExtensionRange;
-typedef struct google_protobuf_DescriptorProto_ReservedRange google_protobuf_DescriptorProto_ReservedRange;
-typedef struct google_protobuf_ExtensionRangeOptions google_protobuf_ExtensionRangeOptions;
-typedef struct google_protobuf_FieldDescriptorProto google_protobuf_FieldDescriptorProto;
-typedef struct google_protobuf_OneofDescriptorProto google_protobuf_OneofDescriptorProto;
-typedef struct google_protobuf_EnumDescriptorProto google_protobuf_EnumDescriptorProto;
-typedef struct google_protobuf_EnumDescriptorProto_EnumReservedRange google_protobuf_EnumDescriptorProto_EnumReservedRange;
-typedef struct google_protobuf_EnumValueDescriptorProto google_protobuf_EnumValueDescriptorProto;
-typedef struct google_protobuf_ServiceDescriptorProto google_protobuf_ServiceDescriptorProto;
-typedef struct google_protobuf_MethodDescriptorProto google_protobuf_MethodDescriptorProto;
-typedef struct google_protobuf_FileOptions google_protobuf_FileOptions;
-typedef struct google_protobuf_MessageOptions google_protobuf_MessageOptions;
-typedef struct google_protobuf_FieldOptions google_protobuf_FieldOptions;
-typedef struct google_protobuf_OneofOptions google_protobuf_OneofOptions;
-typedef struct google_protobuf_EnumOptions google_protobuf_EnumOptions;
-typedef struct google_protobuf_EnumValueOptions google_protobuf_EnumValueOptions;
-typedef struct google_protobuf_ServiceOptions google_protobuf_ServiceOptions;
-typedef struct google_protobuf_MethodOptions google_protobuf_MethodOptions;
-typedef struct google_protobuf_UninterpretedOption google_protobuf_UninterpretedOption;
-typedef struct google_protobuf_UninterpretedOption_NamePart google_protobuf_UninterpretedOption_NamePart;
-typedef struct google_protobuf_SourceCodeInfo google_protobuf_SourceCodeInfo;
-typedef struct google_protobuf_SourceCodeInfo_Location google_protobuf_SourceCodeInfo_Location;
-typedef struct google_protobuf_GeneratedCodeInfo google_protobuf_GeneratedCodeInfo;
-typedef struct google_protobuf_GeneratedCodeInfo_Annotation google_protobuf_GeneratedCodeInfo_Annotation;
-extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
-extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
-extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
-extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_FileOptions_msginit;
-extern const upb_msglayout google_protobuf_MessageOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldOptions_msginit;
-extern const upb_msglayout google_protobuf_OneofOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
-extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
-extern const upb_msglayout google_protobuf_MethodOptions_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
-
-typedef enum {
- google_protobuf_FieldDescriptorProto_LABEL_OPTIONAL = 1,
- google_protobuf_FieldDescriptorProto_LABEL_REQUIRED = 2,
- google_protobuf_FieldDescriptorProto_LABEL_REPEATED = 3
-} google_protobuf_FieldDescriptorProto_Label;
-
-typedef enum {
- google_protobuf_FieldDescriptorProto_TYPE_DOUBLE = 1,
- google_protobuf_FieldDescriptorProto_TYPE_FLOAT = 2,
- google_protobuf_FieldDescriptorProto_TYPE_INT64 = 3,
- google_protobuf_FieldDescriptorProto_TYPE_UINT64 = 4,
- google_protobuf_FieldDescriptorProto_TYPE_INT32 = 5,
- google_protobuf_FieldDescriptorProto_TYPE_FIXED64 = 6,
- google_protobuf_FieldDescriptorProto_TYPE_FIXED32 = 7,
- google_protobuf_FieldDescriptorProto_TYPE_BOOL = 8,
- google_protobuf_FieldDescriptorProto_TYPE_STRING = 9,
- google_protobuf_FieldDescriptorProto_TYPE_GROUP = 10,
- google_protobuf_FieldDescriptorProto_TYPE_MESSAGE = 11,
- google_protobuf_FieldDescriptorProto_TYPE_BYTES = 12,
- google_protobuf_FieldDescriptorProto_TYPE_UINT32 = 13,
- google_protobuf_FieldDescriptorProto_TYPE_ENUM = 14,
- google_protobuf_FieldDescriptorProto_TYPE_SFIXED32 = 15,
- google_protobuf_FieldDescriptorProto_TYPE_SFIXED64 = 16,
- google_protobuf_FieldDescriptorProto_TYPE_SINT32 = 17,
- google_protobuf_FieldDescriptorProto_TYPE_SINT64 = 18
-} google_protobuf_FieldDescriptorProto_Type;
-
-typedef enum {
- google_protobuf_FieldOptions_STRING = 0,
- google_protobuf_FieldOptions_CORD = 1,
- google_protobuf_FieldOptions_STRING_PIECE = 2
-} google_protobuf_FieldOptions_CType;
-
-typedef enum {
- google_protobuf_FieldOptions_JS_NORMAL = 0,
- google_protobuf_FieldOptions_JS_STRING = 1,
- google_protobuf_FieldOptions_JS_NUMBER = 2
-} google_protobuf_FieldOptions_JSType;
-
-typedef enum {
- google_protobuf_FileOptions_SPEED = 1,
- google_protobuf_FileOptions_CODE_SIZE = 2,
- google_protobuf_FileOptions_LITE_RUNTIME = 3
-} google_protobuf_FileOptions_OptimizeMode;
-
-typedef enum {
- google_protobuf_MethodOptions_IDEMPOTENCY_UNKNOWN = 0,
- google_protobuf_MethodOptions_NO_SIDE_EFFECTS = 1,
- google_protobuf_MethodOptions_IDEMPOTENT = 2
-} google_protobuf_MethodOptions_IdempotencyLevel;
-
-
-/* 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);
-}
-UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
- 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 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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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 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 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 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, 3); }
-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, 4); }
-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, 5); }
-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_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_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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_dependency(google_protobuf_FileDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_FileDescriptorProto_mutable_enum_type(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(44, 88), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_ServiceDescriptorProto** google_protobuf_FileDescriptorProto_mutable_service(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_FileDescriptorProto_mutable_extension(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(52, 104), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(52, 104), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void google_protobuf_FileDescriptorProto_set_options(google_protobuf_FileDescriptorProto *msg, google_protobuf_FileOptions* value) {
- _upb_sethas(msg, 3);
- *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);
- if (!sub) return NULL;
- google_protobuf_FileDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_protobuf_FileDescriptorProto_set_source_code_info(google_protobuf_FileDescriptorProto *msg, google_protobuf_SourceCodeInfo* value) {
- _upb_sethas(msg, 4);
- *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);
- if (!sub) return NULL;
- google_protobuf_FileDescriptorProto_set_source_code_info(msg, sub);
- }
- return sub;
-}
-UPB_INLINE int32_t* google_protobuf_FileDescriptorProto_mutable_public_dependency(google_protobuf_FileDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(56, 112), len, 2, arena);
-}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_public_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(56, 112), 2, &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_accessor2(msg, UPB_SIZE(60, 120), len, 2, arena);
-}
-UPB_INLINE bool google_protobuf_FileDescriptorProto_add_weak_dependency(google_protobuf_FileDescriptorProto *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(60, 120), 2, &val,
- arena);
-}
-UPB_INLINE void google_protobuf_FileDescriptorProto_set_syntax(google_protobuf_FileDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 5);
- *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);
-}
-UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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 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 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 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 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 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_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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_DescriptorProto** google_protobuf_DescriptorProto_mutable_nested_type(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto** google_protobuf_DescriptorProto_mutable_enum_type(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange** google_protobuf_DescriptorProto_mutable_extension_range(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto** google_protobuf_DescriptorProto_mutable_extension(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-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_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);
- if (!sub) return NULL;
- google_protobuf_DescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE google_protobuf_OneofDescriptorProto** google_protobuf_DescriptorProto_mutable_oneof_decl(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(36, 72), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange** google_protobuf_DescriptorProto_mutable_reserved_range(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(40, 80), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* google_protobuf_DescriptorProto_mutable_reserved_name(google_protobuf_DescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(44, 88), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool google_protobuf_DescriptorProto_add_reserved_name(google_protobuf_DescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(44, 88), UPB_SIZE(3, 4), &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);
-}
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
- 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 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_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_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_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);
- if (!sub) return NULL;
- google_protobuf_DescriptorProto_ExtensionRange_set_options(msg, sub);
- }
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
- 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 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_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;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_extendee(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_extendee(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), 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(12, 12), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_label(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_label(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_type(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_type_name(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_type_name(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_default_value(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE upb_strview google_protobuf_FieldDescriptorProto_default_value(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_options(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const google_protobuf_FieldOptions* google_protobuf_FieldDescriptorProto_options(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const google_protobuf_FieldOptions*); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE int32_t google_protobuf_FieldDescriptorProto_oneof_index(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(56, 88), upb_strview); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE bool google_protobuf_FieldDescriptorProto_proto3_optional(const google_protobuf_FieldDescriptorProto *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
-
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_extendee(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 40), 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(12, 12), int32_t) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_label(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
- _upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
- _upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_type_name(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 56), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_default_value(google_protobuf_FieldDescriptorProto *msg, upb_strview value) {
- _upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 72), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_options(google_protobuf_FieldDescriptorProto *msg, google_protobuf_FieldOptions* value) {
- _upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), 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);
- if (!sub) return NULL;
- google_protobuf_FieldDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_oneof_index(google_protobuf_FieldDescriptorProto *msg, int32_t value) {
- _upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(56, 88), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FieldDescriptorProto_set_proto3_optional(google_protobuf_FieldDescriptorProto *msg, bool value) {
- _upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), 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);
-}
-UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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_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_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);
- if (!sub) return NULL;
- google_protobuf_OneofDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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_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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-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_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);
- if (!sub) return NULL;
- google_protobuf_EnumDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange** google_protobuf_EnumDescriptorProto_mutable_reserved_range(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE upb_strview* google_protobuf_EnumDescriptorProto_mutable_reserved_name(google_protobuf_EnumDescriptorProto *msg, size_t *len) {
- 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_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
-}
-UPB_INLINE bool google_protobuf_EnumDescriptorProto_add_reserved_name(google_protobuf_EnumDescriptorProto *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &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);
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
- 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 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_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;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-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, 2); }
-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, 1);
- *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, 2);
- *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_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);
- if (!sub) return NULL;
- google_protobuf_EnumValueDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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 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 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_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_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-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_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);
- if (!sub) return NULL;
- google_protobuf_ServiceDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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, 5); }
-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, 6); }
-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, 1);
- *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, 2);
- *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, 3);
- *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, 4);
- *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);
- if (!sub) return NULL;
- google_protobuf_MethodDescriptorProto_set_options(msg, sub);
- }
- return sub;
-}
-UPB_INLINE void google_protobuf_MethodDescriptorProto_set_client_streaming(google_protobuf_MethodDescriptorProto *msg, bool value) {
- _upb_sethas(msg, 5);
- *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, 6);
- *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);
-}
-UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_outer_classname(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_java_outer_classname(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_optimize_for(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE int32_t google_protobuf_FileOptions_optimize_for(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_multiple_files(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FileOptions_java_multiple_files(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_go_package(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_go_package(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_py_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE bool google_protobuf_FileOptions_py_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE bool google_protobuf_FileOptions_java_generate_equals_and_hash(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_deprecated(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE bool google_protobuf_FileOptions_deprecated(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE bool google_protobuf_FileOptions_java_string_check_utf8(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE bool google_protobuf_FileOptions_cc_enable_arenas(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool); }
-UPB_INLINE bool google_protobuf_FileOptions_has_objc_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_objc_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_csharp_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_csharp_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_swift_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_swift_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_class_prefix(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_class_prefix(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_namespace(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 17); }
-UPB_INLINE upb_strview google_protobuf_FileOptions_php_namespace(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_php_generic_services(const google_protobuf_FileOptions *msg) { return _upb_hasbit(msg, 18); }
-UPB_INLINE bool google_protobuf_FileOptions_php_generic_services(const google_protobuf_FileOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(84, 152), 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(92, 168), upb_strview); }
-UPB_INLINE bool google_protobuf_FileOptions_has_uninterpreted_option(const google_protobuf_FileOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); }
-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(100, 184), len); }
-
-UPB_INLINE void google_protobuf_FileOptions_set_java_package(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(20, 24), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_java_outer_classname(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_optimize_for(google_protobuf_FileOptions *msg, int32_t value) {
- _upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_java_multiple_files(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_go_package(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_cc_generic_services(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(9, 9), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_java_generic_services(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(10, 10), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_py_generic_services(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(11, 11), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_java_generate_equals_and_hash(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_deprecated(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_java_string_check_utf8(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_cc_enable_arenas(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(15, 15), bool) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_objc_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_csharp_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_swift_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_php_class_prefix(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_php_namespace(google_protobuf_FileOptions *msg, upb_strview value) {
- _upb_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), upb_strview) = value;
-}
-UPB_INLINE void google_protobuf_FileOptions_set_php_generic_services(google_protobuf_FileOptions *msg, bool value) {
- _upb_sethas(msg, 18);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), 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(84, 152), 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(92, 168), 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(100, 184), 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_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_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_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_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_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_accessor2(msg, UPB_SIZE(8, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 8), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
- 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(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_packed(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE bool google_protobuf_FieldOptions_packed(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_deprecated(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE bool google_protobuf_FieldOptions_deprecated(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_lazy(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE bool google_protobuf_FieldOptions_lazy(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_jstype(const google_protobuf_FieldOptions *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE int32_t google_protobuf_FieldOptions_jstype(const google_protobuf_FieldOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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(15, 15), bool); }
-UPB_INLINE bool google_protobuf_FieldOptions_has_uninterpreted_option(const google_protobuf_FieldOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 16)); }
-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(16, 16), 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(4, 4), int32_t) = value;
-}
-UPB_INLINE void google_protobuf_FieldOptions_set_packed(google_protobuf_FieldOptions *msg, bool value) {
- _upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
-}
-UPB_INLINE void google_protobuf_FieldOptions_set_deprecated(google_protobuf_FieldOptions *msg, bool value) {
- _upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
-}
-UPB_INLINE void google_protobuf_FieldOptions_set_lazy(google_protobuf_FieldOptions *msg, bool value) {
- _upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(14, 14), bool) = value;
-}
-UPB_INLINE void google_protobuf_FieldOptions_set_jstype(google_protobuf_FieldOptions *msg, int32_t value) {
- _upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), 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(15, 15), 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(16, 16), 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_accessor2(msg, UPB_SIZE(16, 16), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(16, 16), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_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_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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
- 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 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_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_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-UPB_INLINE bool google_protobuf_MethodOptions_deprecated(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_idempotency_level(const google_protobuf_MethodOptions *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE int32_t google_protobuf_MethodOptions_idempotency_level(const google_protobuf_MethodOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool google_protobuf_MethodOptions_has_uninterpreted_option(const google_protobuf_MethodOptions *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
-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(12, 16), len); }
-
-UPB_INLINE void google_protobuf_MethodOptions_set_deprecated(google_protobuf_MethodOptions *msg, bool value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
-}
-UPB_INLINE void google_protobuf_MethodOptions_set_idempotency_level(google_protobuf_MethodOptions *msg, int32_t value) {
- _upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 4), 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(12, 16), 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_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
- 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 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, 1); }
-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, 2); }
-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, 3); }
-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, 4); }
-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_accessor2(msg, UPB_SIZE(56, 80), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(56, 80), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-UPB_INLINE void google_protobuf_UninterpretedOption_set_identifier_value(google_protobuf_UninterpretedOption *msg, upb_strview value) {
- _upb_sethas(msg, 1);
- *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, 2);
- *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, 3);
- *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, 4);
- *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_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;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
- 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, 1); }
-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, 2); }
-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, 1);
- *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, 2);
- *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);
-}
-UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
- 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 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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
-}
-
-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 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_accessor2(msg, UPB_SIZE(20, 40), len, 2, 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_accessor2(msg, UPB_SIZE(20, 40), 2, &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_accessor2(msg, UPB_SIZE(24, 48), len, 2, 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_accessor2(msg, UPB_SIZE(24, 48), 2, &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_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_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_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), 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_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &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);
-}
-UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
- 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 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_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), 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);
- bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
- if (!ok) return NULL;
- return sub;
-}
-
-/* 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);
-}
-UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
- upb_arena *arena) {
- google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
-}
-
-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, 1); }
-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, 2); }
-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, 3); }
-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_accessor2(msg, UPB_SIZE(20, 32), len, 2, 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_accessor2(msg, UPB_SIZE(20, 32), 2, &val,
- arena);
-}
-UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_source_file(google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_strview value) {
- _upb_sethas(msg, 1);
- *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, 2);
- *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, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */
diff --git a/grpc/third_party/upb/cmake/make_cmakelists.py b/grpc/third_party/upb/cmake/make_cmakelists.py
index 035debb7..29c73bb8 100755
--- a/grpc/third_party/upb/cmake/make_cmakelists.py
+++ b/grpc/third_party/upb/cmake/make_cmakelists.py
@@ -1,8 +1,34 @@
-#!/usr/bin/env python
-
-"""TODO(haberman): DO NOT SUBMIT without one-line documentation for make_cmakelists.
-
-TODO(haberman): DO NOT SUBMIT without a detailed description of make_cmakelists.
+#!/usr/bin/python
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""A tool to convert {WORKSPACE, BUILD} -> CMakeLists.txt.
+
+This tool is very upb-specific at the moment, and should not be seen as a
+generic Bazel -> CMake converter.
"""
from __future__ import absolute_import
@@ -13,8 +39,8 @@ import sys
import textwrap
import os
-def StripColons(deps):
- return map(lambda x: x[1:], deps)
+def StripFirstChar(deps):
+ return [dep[1:] for dep in deps]
def IsSourceFile(name):
return name.endswith(".c") or name.endswith(".cc")
@@ -29,7 +55,7 @@ class BuildFileFunctions(object):
self.converter.toplevel += "target_link_libraries(%s%s\n %s)\n" % (
kwargs["name"],
keyword,
- "\n ".join(StripColons(kwargs["deps"]))
+ "\n ".join(StripFirstChar(kwargs["deps"]))
)
def load(self, *args):
@@ -44,13 +70,14 @@ class BuildFileFunctions(object):
return
files = kwargs.get("srcs", []) + kwargs.get("hdrs", [])
found_files = []
+ pregenerated_files = [
+ "CMakeLists.txt", "descriptor.upb.h", "descriptor.upb.c"
+ ]
for file in files:
- if os.path.isfile(file):
- found_files.append("../" + file)
- elif os.path.isfile("cmake/" + file):
- found_files.append("../cmake/" + file)
- else:
- print("Warning: no such file: " + file)
+ if os.path.basename(file) in pregenerated_files:
+ found_files.append("../cmake/" + file)
+ else:
+ found_files.append("../" + file)
if list(filter(IsSourceFile, files)):
# Has sources, make this a normal library.
@@ -96,6 +123,9 @@ class BuildFileFunctions(object):
# self._add_deps(kwargs)
pass
+ def cc_fuzz_test(self, **kwargs):
+ pass
+
def py_library(self, **kwargs):
pass
@@ -189,6 +219,21 @@ class WorkspaceFileFunctions(object):
def upb_deps(self):
pass
+ def protobuf_deps(self):
+ pass
+
+ def rules_fuzzing_dependencies(self):
+ pass
+
+ def rules_fuzzing_init(self):
+ pass
+
+ def system_python(self, **kwargs):
+ pass
+
+ def register_toolchains(self, toolchain):
+ pass
+
class Converter(object):
def __init__(self):
@@ -274,6 +319,7 @@ converter = Converter()
def GetDict(obj):
ret = {}
ret["UPB_DEFAULT_COPTS"] = [] # HACK
+ ret["UPB_DEFAULT_CPPOPTS"] = [] # HACK
for k in dir(obj):
if not k.startswith("_"):
ret[k] = getattr(obj, k);
@@ -283,7 +329,6 @@ globs = GetDict(converter)
exec(open("WORKSPACE").read(), GetDict(WorkspaceFileFunctions(converter)))
exec(open("BUILD").read(), GetDict(BuildFileFunctions(converter)))
-exec(open("third_party/wyhash/BUILD").read(), GetDict(BuildFileFunctions(converter)))
with open(sys.argv[1], "w") as f:
f.write(converter.convert())
diff --git a/grpc/third_party/upb/cmake/staleness_test.py b/grpc/third_party/upb/cmake/staleness_test.py
index 58573071..58f1833c 100644
--- a/grpc/third_party/upb/cmake/staleness_test.py
+++ b/grpc/third_party/upb/cmake/staleness_test.py
@@ -1,3 +1,30 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
"""The py_test() script for generated_file_staleness_test() rules.
Note that this file is preprocessed! The INSERT_<...> text below is replaced
diff --git a/grpc/third_party/upb/cmake/staleness_test_lib.py b/grpc/third_party/upb/cmake/staleness_test_lib.py
index cdfcc0d1..0748969c 100644
--- a/grpc/third_party/upb/cmake/staleness_test_lib.py
+++ b/grpc/third_party/upb/cmake/staleness_test_lib.py
@@ -1,3 +1,30 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
"""Shared code for validating generated_file_staleness_test() rules.
This code is used by test scripts generated from
diff --git a/grpc/third_party/upb/cmake/upb/json/parser.c b/grpc/third_party/upb/cmake/upb/json/parser.c
deleted file mode 100644
index 26996d8a..00000000
--- a/grpc/third_party/upb/cmake/upb/json/parser.c
+++ /dev/null
@@ -1,3433 +0,0 @@
-
-#line 1 "upb/json/parser.rl"
-/*
-** upb::json::Parser (upb_json_parser)
-**
-** A parser that uses the Ragel State Machine Compiler to generate
-** the finite automata.
-**
-** Ragel only natively handles regular languages, but we can manually
-** program it a bit to handle context-free languages like JSON, by using
-** the "fcall" and "fret" constructs.
-**
-** This parser can handle the basics, but needs several things to be fleshed
-** out:
-**
-** - handling of unicode escape sequences (including high surrogate pairs).
-** - properly check and report errors for unknown fields, stack overflow,
-** improper array nesting (or lack of nesting).
-** - handling of base64 sequences with padding characters.
-** - handling of push-back (non-success returns from sink functions).
-** - handling of keys/escape-sequences/etc that span input buffers.
-*/
-
-#include <ctype.h>
-#include <errno.h>
-#include <float.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <time.h>
-
-#include "upb/json/parser.h"
-#include "upb/pb/encoder.h"
-
-#include "upb/port_def.inc"
-
-#define UPB_JSON_MAX_DEPTH 64
-
-/* Type of value message */
-enum {
- VALUE_NULLVALUE = 0,
- VALUE_NUMBERVALUE = 1,
- VALUE_STRINGVALUE = 2,
- VALUE_BOOLVALUE = 3,
- VALUE_STRUCTVALUE = 4,
- VALUE_LISTVALUE = 5
-};
-
-/* Forward declare */
-static bool is_top_level(upb_json_parser *p);
-static bool is_wellknown_msg(upb_json_parser *p, upb_wellknowntype_t type);
-static bool is_wellknown_field(upb_json_parser *p, upb_wellknowntype_t type);
-
-static bool is_number_wrapper_object(upb_json_parser *p);
-static bool does_number_wrapper_start(upb_json_parser *p);
-static bool does_number_wrapper_end(upb_json_parser *p);
-
-static bool is_string_wrapper_object(upb_json_parser *p);
-static bool does_string_wrapper_start(upb_json_parser *p);
-static bool does_string_wrapper_end(upb_json_parser *p);
-
-static bool does_fieldmask_start(upb_json_parser *p);
-static bool does_fieldmask_end(upb_json_parser *p);
-static void start_fieldmask_object(upb_json_parser *p);
-static void end_fieldmask_object(upb_json_parser *p);
-
-static void start_wrapper_object(upb_json_parser *p);
-static void end_wrapper_object(upb_json_parser *p);
-
-static void start_value_object(upb_json_parser *p, int value_type);
-static void end_value_object(upb_json_parser *p);
-
-static void start_listvalue_object(upb_json_parser *p);
-static void end_listvalue_object(upb_json_parser *p);
-
-static void start_structvalue_object(upb_json_parser *p);
-static void end_structvalue_object(upb_json_parser *p);
-
-static void start_object(upb_json_parser *p);
-static void end_object(upb_json_parser *p);
-
-static void start_any_object(upb_json_parser *p, const char *ptr);
-static bool end_any_object(upb_json_parser *p, const char *ptr);
-
-static bool start_subobject(upb_json_parser *p);
-static void end_subobject(upb_json_parser *p);
-
-static void start_member(upb_json_parser *p);
-static void end_member(upb_json_parser *p);
-static bool end_membername(upb_json_parser *p);
-
-static void start_any_member(upb_json_parser *p, const char *ptr);
-static void end_any_member(upb_json_parser *p, const char *ptr);
-static bool end_any_membername(upb_json_parser *p);
-
-size_t parse(void *closure, const void *hd, const char *buf, size_t size,
- const upb_bufhandle *handle);
-static bool end(void *closure, const void *hd);
-
-static const char eof_ch = 'e';
-
-/* stringsink */
-typedef struct {
- upb_byteshandler handler;
- upb_bytessink sink;
- char *ptr;
- size_t len, size;
-} upb_stringsink;
-
-
-static void *stringsink_start(void *_sink, const void *hd, size_t size_hint) {
- upb_stringsink *sink = _sink;
- sink->len = 0;
- UPB_UNUSED(hd);
- UPB_UNUSED(size_hint);
- return sink;
-}
-
-static size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
- size_t len, const upb_bufhandle *handle) {
- upb_stringsink *sink = _sink;
- size_t new_size = sink->size;
-
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
-
- while (sink->len + len > new_size) {
- new_size *= 2;
- }
-
- if (new_size != sink->size) {
- sink->ptr = realloc(sink->ptr, new_size);
- sink->size = new_size;
- }
-
- memcpy(sink->ptr + sink->len, ptr, len);
- sink->len += len;
-
- return len;
-}
-
-void upb_stringsink_init(upb_stringsink *sink) {
- upb_byteshandler_init(&sink->handler);
- upb_byteshandler_setstartstr(&sink->handler, stringsink_start, NULL);
- upb_byteshandler_setstring(&sink->handler, stringsink_string, NULL);
-
- upb_bytessink_reset(&sink->sink, &sink->handler, sink);
-
- sink->size = 32;
- sink->ptr = malloc(sink->size);
- sink->len = 0;
-}
-
-void upb_stringsink_uninit(upb_stringsink *sink) { free(sink->ptr); }
-
-typedef struct {
- /* For encoding Any value field in binary format. */
- upb_handlercache *encoder_handlercache;
- upb_stringsink stringsink;
-
- /* For decoding Any value field in json format. */
- upb_json_codecache *parser_codecache;
- upb_sink sink;
- upb_json_parser *parser;
-
- /* Mark the range of uninterpreted values in json input before type url. */
- const char *before_type_url_start;
- const char *before_type_url_end;
-
- /* Mark the range of uninterpreted values in json input after type url. */
- const char *after_type_url_start;
-} upb_jsonparser_any_frame;
-
-typedef struct {
- upb_sink sink;
-
- /* The current message in which we're parsing, and the field whose value we're
- * expecting next. */
- const upb_msgdef *m;
- const upb_fielddef *f;
-
- /* The table mapping json name to fielddef for this message. */
- const upb_strtable *name_table;
-
- /* We are in a repeated-field context. We need this flag to decide whether to
- * handle the array as a normal repeated field or a
- * google.protobuf.ListValue/google.protobuf.Value. */
- bool is_repeated;
-
- /* We are in a repeated-field context, ready to emit mapentries as
- * submessages. This flag alters the start-of-object (open-brace) behavior to
- * begin a sequence of mapentry messages rather than a single submessage. */
- bool is_map;
-
- /* We are in a map-entry message context. This flag is set when parsing the
- * value field of a single map entry and indicates to all value-field parsers
- * (subobjects, strings, numbers, and bools) that the map-entry submessage
- * should end as soon as the value is parsed. */
- bool is_mapentry;
-
- /* If |is_map| or |is_mapentry| is true, |mapfield| refers to the parent
- * message's map field that we're currently parsing. This differs from |f|
- * because |f| is the field in the *current* message (i.e., the map-entry
- * message itself), not the parent's field that leads to this map. */
- const upb_fielddef *mapfield;
-
- /* We are in an Any message context. This flag is set when parsing the Any
- * message and indicates to all field parsers (subobjects, strings, numbers,
- * and bools) that the parsed field should be serialized as binary data or
- * cached (type url not found yet). */
- bool is_any;
-
- /* The type of packed message in Any. */
- upb_jsonparser_any_frame *any_frame;
-
- /* True if the field to be parsed is unknown. */
- bool is_unknown_field;
-} upb_jsonparser_frame;
-
-static void init_frame(upb_jsonparser_frame* frame) {
- frame->m = NULL;
- frame->f = NULL;
- frame->name_table = NULL;
- frame->is_repeated = false;
- frame->is_map = false;
- frame->is_mapentry = false;
- frame->mapfield = NULL;
- frame->is_any = false;
- frame->any_frame = NULL;
- frame->is_unknown_field = false;
-}
-
-struct upb_json_parser {
- upb_arena *arena;
- const upb_json_parsermethod *method;
- upb_bytessink input_;
-
- /* Stack to track the JSON scopes we are in. */
- upb_jsonparser_frame stack[UPB_JSON_MAX_DEPTH];
- upb_jsonparser_frame *top;
- upb_jsonparser_frame *limit;
-
- upb_status *status;
-
- /* Ragel's internal parsing stack for the parsing state machine. */
- int current_state;
- int parser_stack[UPB_JSON_MAX_DEPTH];
- int parser_top;
-
- /* The handle for the current buffer. */
- const upb_bufhandle *handle;
-
- /* Accumulate buffer. See details in parser.rl. */
- const char *accumulated;
- size_t accumulated_len;
- char *accumulate_buf;
- size_t accumulate_buf_size;
-
- /* Multi-part text data. See details in parser.rl. */
- int multipart_state;
- upb_selector_t string_selector;
-
- /* Input capture. See details in parser.rl. */
- const char *capture;
-
- /* Intermediate result of parsing a unicode escape sequence. */
- uint32_t digit;
-
- /* For resolve type url in Any. */
- const upb_symtab *symtab;
-
- /* Whether to proceed if unknown field is met. */
- bool ignore_json_unknown;
-
- /* Cache for parsing timestamp due to base and zone are handled in different
- * handlers. */
- struct tm tm;
-};
-
-static upb_jsonparser_frame* start_jsonparser_frame(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- inner = p->top + 1;
- init_frame(inner);
- return inner;
-}
-
-struct upb_json_codecache {
- upb_arena *arena;
- upb_inttable methods; /* upb_msgdef* -> upb_json_parsermethod* */
-};
-
-struct upb_json_parsermethod {
- const upb_json_codecache *cache;
- upb_byteshandler input_handler_;
-
- /* Maps json_name -> fielddef */
- upb_strtable name_table;
-};
-
-#define PARSER_CHECK_RETURN(x) if (!(x)) return false
-
-static upb_jsonparser_any_frame *json_parser_any_frame_new(
- upb_json_parser *p) {
- upb_jsonparser_any_frame *frame;
-
- frame = upb_arena_malloc(p->arena, sizeof(upb_jsonparser_any_frame));
-
- frame->encoder_handlercache = upb_pb_encoder_newcache();
- frame->parser_codecache = upb_json_codecache_new();
- frame->parser = NULL;
- frame->before_type_url_start = NULL;
- frame->before_type_url_end = NULL;
- frame->after_type_url_start = NULL;
-
- upb_stringsink_init(&frame->stringsink);
-
- return frame;
-}
-
-static void json_parser_any_frame_set_payload_type(
- upb_json_parser *p,
- upb_jsonparser_any_frame *frame,
- const upb_msgdef *payload_type) {
- const upb_handlers *h;
- const upb_json_parsermethod *parser_method;
- upb_pb_encoder *encoder;
-
- /* Initialize encoder. */
- h = upb_handlercache_get(frame->encoder_handlercache, payload_type);
- encoder = upb_pb_encoder_create(p->arena, h, frame->stringsink.sink);
-
- /* Initialize parser. */
- parser_method = upb_json_codecache_get(frame->parser_codecache, payload_type);
- upb_sink_reset(&frame->sink, h, encoder);
- frame->parser =
- upb_json_parser_create(p->arena, parser_method, p->symtab, frame->sink,
- p->status, p->ignore_json_unknown);
-}
-
-static void json_parser_any_frame_free(upb_jsonparser_any_frame *frame) {
- upb_handlercache_free(frame->encoder_handlercache);
- upb_json_codecache_free(frame->parser_codecache);
- upb_stringsink_uninit(&frame->stringsink);
-}
-
-static bool json_parser_any_frame_has_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->parser != NULL;
-}
-
-static bool json_parser_any_frame_has_value_before_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->before_type_url_start != frame->before_type_url_end;
-}
-
-static bool json_parser_any_frame_has_value_after_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->after_type_url_start != NULL;
-}
-
-static bool json_parser_any_frame_has_value(
- upb_jsonparser_any_frame *frame) {
- return json_parser_any_frame_has_value_before_type_url(frame) ||
- json_parser_any_frame_has_value_after_type_url(frame);
-}
-
-static void json_parser_any_frame_set_before_type_url_end(
- upb_jsonparser_any_frame *frame,
- const char *ptr) {
- if (frame->parser == NULL) {
- frame->before_type_url_end = ptr;
- }
-}
-
-static void json_parser_any_frame_set_after_type_url_start_once(
- upb_jsonparser_any_frame *frame,
- const char *ptr) {
- if (json_parser_any_frame_has_type_url(frame) &&
- frame->after_type_url_start == NULL) {
- frame->after_type_url_start = ptr;
- }
-}
-
-/* Used to signal that a capture has been suspended. */
-static char suspend_capture;
-
-static upb_selector_t getsel_for_handlertype(upb_json_parser *p,
- upb_handlertype_t type) {
- upb_selector_t sel;
- bool ok = upb_handlers_getselector(p->top->f, type, &sel);
- UPB_ASSUME(ok);
- return sel;
-}
-
-static upb_selector_t parser_getsel(upb_json_parser *p) {
- return getsel_for_handlertype(
- p, upb_handlers_getprimitivehandlertype(p->top->f));
-}
-
-static bool check_stack(upb_json_parser *p) {
- if ((p->top + 1) == p->limit) {
- upb_status_seterrmsg(p->status, "Nesting too deep");
- return false;
- }
-
- return true;
-}
-
-static void set_name_table(upb_json_parser *p, upb_jsonparser_frame *frame) {
- upb_value v;
- const upb_json_codecache *cache = p->method->cache;
- bool ok;
- const upb_json_parsermethod *method;
-
- ok = upb_inttable_lookupptr(&cache->methods, frame->m, &v);
- UPB_ASSUME(ok);
- method = upb_value_getconstptr(v);
-
- frame->name_table = &method->name_table;
-}
-
-/* There are GCC/Clang built-ins for overflow checking which we could start
- * using if there was any performance benefit to it. */
-
-static bool checked_add(size_t a, size_t b, size_t *c) {
- if (SIZE_MAX - a < b) return false;
- *c = a + b;
- return true;
-}
-
-static size_t saturating_multiply(size_t a, size_t b) {
- /* size_t is unsigned, so this is defined behavior even on overflow. */
- size_t ret = a * b;
- if (b != 0 && ret / b != a) {
- ret = SIZE_MAX;
- }
- return ret;
-}
-
-
-/* Base64 decoding ************************************************************/
-
-/* TODO(haberman): make this streaming. */
-
-static const signed char b64table[] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 62/*+*/, -1, -1, -1, 63/*/ */,
- 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
- 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1,
- -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/,
- 07/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
- 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
- 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, -1,
- -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
- 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
- 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
- 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1
-};
-
-/* Returns the table value sign-extended to 32 bits. Knowing that the upper
- * bits will be 1 for unrecognized characters makes it easier to check for
- * this error condition later (see below). */
-int32_t b64lookup(unsigned char ch) { return b64table[ch]; }
-
-/* Returns true if the given character is not a valid base64 character or
- * padding. */
-bool nonbase64(unsigned char ch) { return b64lookup(ch) == -1 && ch != '='; }
-
-static bool base64_push(upb_json_parser *p, upb_selector_t sel, const char *ptr,
- size_t len) {
- const char *limit = ptr + len;
- for (; ptr < limit; ptr += 4) {
- uint32_t val;
- char output[3];
-
- if (limit - ptr < 4) {
- upb_status_seterrf(p->status,
- "Base64 input for bytes field not a multiple of 4: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12 |
- b64lookup(ptr[2]) << 6 |
- b64lookup(ptr[3]);
-
- /* Test the upper bit; returns true if any of the characters returned -1. */
- if (val & 0x80000000) {
- goto otherchar;
- }
-
- output[0] = val >> 16;
- output[1] = (val >> 8) & 0xff;
- output[2] = val & 0xff;
- upb_sink_putstring(p->top->sink, sel, output, 3, NULL);
- }
- return true;
-
-otherchar:
- if (nonbase64(ptr[0]) || nonbase64(ptr[1]) || nonbase64(ptr[2]) ||
- nonbase64(ptr[3]) ) {
- upb_status_seterrf(p->status,
- "Non-base64 characters in bytes field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- } if (ptr[2] == '=') {
- uint32_t val;
- char output;
-
- /* Last group contains only two input bytes, one output byte. */
- if (ptr[0] == '=' || ptr[1] == '=' || ptr[3] != '=') {
- goto badpadding;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12;
-
- UPB_ASSERT(!(val & 0x80000000));
- output = val >> 16;
- upb_sink_putstring(p->top->sink, sel, &output, 1, NULL);
- return true;
- } else {
- uint32_t val;
- char output[2];
-
- /* Last group contains only three input bytes, two output bytes. */
- if (ptr[0] == '=' || ptr[1] == '=' || ptr[2] == '=') {
- goto badpadding;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12 |
- b64lookup(ptr[2]) << 6;
-
- output[0] = val >> 16;
- output[1] = (val >> 8) & 0xff;
- upb_sink_putstring(p->top->sink, sel, output, 2, NULL);
- return true;
- }
-
-badpadding:
- upb_status_seterrf(p->status,
- "Incorrect base64 padding for field: %s (%.*s)",
- upb_fielddef_name(p->top->f),
- 4, ptr);
- return false;
-}
-
-
-/* Accumulate buffer **********************************************************/
-
-/* Functionality for accumulating a buffer.
- *
- * Some parts of the parser need an entire value as a contiguous string. For
- * example, to look up a member name in a hash table, or to turn a string into
- * a number, the relevant library routines need the input string to be in
- * contiguous memory, even if the value spanned two or more buffers in the
- * input. These routines handle that.
- *
- * In the common case we can just point to the input buffer to get this
- * contiguous string and avoid any actual copy. So we optimistically begin
- * this way. But there are a few cases where we must instead copy into a
- * separate buffer:
- *
- * 1. The string was not contiguous in the input (it spanned buffers).
- *
- * 2. The string included escape sequences that need to be interpreted to get
- * the true value in a contiguous buffer. */
-
-static void assert_accumulate_empty(upb_json_parser *p) {
- UPB_ASSERT(p->accumulated == NULL);
- UPB_ASSERT(p->accumulated_len == 0);
-}
-
-static void accumulate_clear(upb_json_parser *p) {
- p->accumulated = NULL;
- p->accumulated_len = 0;
-}
-
-/* Used internally by accumulate_append(). */
-static bool accumulate_realloc(upb_json_parser *p, size_t need) {
- void *mem;
- size_t old_size = p->accumulate_buf_size;
- size_t new_size = UPB_MAX(old_size, 128);
- while (new_size < need) {
- new_size = saturating_multiply(new_size, 2);
- }
-
- mem = upb_arena_realloc(p->arena, p->accumulate_buf, old_size, new_size);
- if (!mem) {
- upb_status_seterrmsg(p->status, "Out of memory allocating buffer.");
- return false;
- }
-
- p->accumulate_buf = mem;
- p->accumulate_buf_size = new_size;
- return true;
-}
-
-/* Logically appends the given data to the append buffer.
- * If "can_alias" is true, we will try to avoid actually copying, but the buffer
- * must be valid until the next accumulate_append() call (if any). */
-static bool accumulate_append(upb_json_parser *p, const char *buf, size_t len,
- bool can_alias) {
- size_t need;
-
- if (!p->accumulated && can_alias) {
- p->accumulated = buf;
- p->accumulated_len = len;
- return true;
- }
-
- if (!checked_add(p->accumulated_len, len, &need)) {
- upb_status_seterrmsg(p->status, "Integer overflow.");
- return false;
- }
-
- if (need > p->accumulate_buf_size && !accumulate_realloc(p, need)) {
- return false;
- }
-
- if (p->accumulated != p->accumulate_buf) {
- if (p->accumulated_len) {
- memcpy(p->accumulate_buf, p->accumulated, p->accumulated_len);
- }
- p->accumulated = p->accumulate_buf;
- }
-
- memcpy(p->accumulate_buf + p->accumulated_len, buf, len);
- p->accumulated_len += len;
- return true;
-}
-
-/* Returns a pointer to the data accumulated since the last accumulate_clear()
- * call, and writes the length to *len. This with point either to the input
- * buffer or a temporary accumulate buffer. */
-static const char *accumulate_getptr(upb_json_parser *p, size_t *len) {
- UPB_ASSERT(p->accumulated);
- *len = p->accumulated_len;
- return p->accumulated;
-}
-
-
-/* Mult-part text data ********************************************************/
-
-/* When we have text data in the input, it can often come in multiple segments.
- * For example, there may be some raw string data followed by an escape
- * sequence. The two segments are processed with different logic. Also buffer
- * seams in the input can cause multiple segments.
- *
- * As we see segments, there are two main cases for how we want to process them:
- *
- * 1. we want to push the captured input directly to string handlers.
- *
- * 2. we need to accumulate all the parts into a contiguous buffer for further
- * processing (field name lookup, string->number conversion, etc). */
-
-/* This is the set of states for p->multipart_state. */
-enum {
- /* We are not currently processing multipart data. */
- MULTIPART_INACTIVE = 0,
-
- /* We are processing multipart data by accumulating it into a contiguous
- * buffer. */
- MULTIPART_ACCUMULATE = 1,
-
- /* We are processing multipart data by pushing each part directly to the
- * current string handlers. */
- MULTIPART_PUSHEAGERLY = 2
-};
-
-/* Start a multi-part text value where we accumulate the data for processing at
- * the end. */
-static void multipart_startaccum(upb_json_parser *p) {
- assert_accumulate_empty(p);
- UPB_ASSERT(p->multipart_state == MULTIPART_INACTIVE);
- p->multipart_state = MULTIPART_ACCUMULATE;
-}
-
-/* Start a multi-part text value where we immediately push text data to a string
- * value with the given selector. */
-static void multipart_start(upb_json_parser *p, upb_selector_t sel) {
- assert_accumulate_empty(p);
- UPB_ASSERT(p->multipart_state == MULTIPART_INACTIVE);
- p->multipart_state = MULTIPART_PUSHEAGERLY;
- p->string_selector = sel;
-}
-
-static bool multipart_text(upb_json_parser *p, const char *buf, size_t len,
- bool can_alias) {
- switch (p->multipart_state) {
- case MULTIPART_INACTIVE:
- upb_status_seterrmsg(
- p->status, "Internal error: unexpected state MULTIPART_INACTIVE");
- return false;
-
- case MULTIPART_ACCUMULATE:
- if (!accumulate_append(p, buf, len, can_alias)) {
- return false;
- }
- break;
-
- case MULTIPART_PUSHEAGERLY: {
- const upb_bufhandle *handle = can_alias ? p->handle : NULL;
- upb_sink_putstring(p->top->sink, p->string_selector, buf, len, handle);
- break;
- }
- }
-
- return true;
-}
-
-/* Note: this invalidates the accumulate buffer! Call only after reading its
- * contents. */
-static void multipart_end(upb_json_parser *p) {
- /* This is false sometimes. Probably a bug of some sort, but this code is
- * intended for deletion soon. */
- /* UPB_ASSERT(p->multipart_state != MULTIPART_INACTIVE); */
- p->multipart_state = MULTIPART_INACTIVE;
- accumulate_clear(p);
-}
-
-
-/* Input capture **************************************************************/
-
-/* Functionality for capturing a region of the input as text. Gracefully
- * handles the case where a buffer seam occurs in the middle of the captured
- * region. */
-
-static void capture_begin(upb_json_parser *p, const char *ptr) {
- UPB_ASSERT(p->multipart_state != MULTIPART_INACTIVE);
- UPB_ASSERT(p->capture == NULL);
- p->capture = ptr;
-}
-
-static bool capture_end(upb_json_parser *p, const char *ptr) {
- UPB_ASSERT(p->capture);
- if (multipart_text(p, p->capture, ptr - p->capture, true)) {
- p->capture = NULL;
- return true;
- } else {
- return false;
- }
-}
-
-/* This is called at the end of each input buffer (ie. when we have hit a
- * buffer seam). If we are in the middle of capturing the input, this
- * processes the unprocessed capture region. */
-static void capture_suspend(upb_json_parser *p, const char **ptr) {
- if (!p->capture) return;
-
- if (multipart_text(p, p->capture, *ptr - p->capture, false)) {
- /* We use this as a signal that we were in the middle of capturing, and
- * that capturing should resume at the beginning of the next buffer.
- *
- * We can't use *ptr here, because we have no guarantee that this pointer
- * will be valid when we resume (if the underlying memory is freed, then
- * using the pointer at all, even to compare to NULL, is likely undefined
- * behavior). */
- p->capture = &suspend_capture;
- } else {
- /* Need to back up the pointer to the beginning of the capture, since
- * we were not able to actually preserve it. */
- *ptr = p->capture;
- }
-}
-
-static void capture_resume(upb_json_parser *p, const char *ptr) {
- if (p->capture) {
- UPB_ASSERT(p->capture == &suspend_capture);
- p->capture = ptr;
- }
-}
-
-
-/* Callbacks from the parser **************************************************/
-
-/* These are the functions called directly from the parser itself.
- * We define these in the same order as their declarations in the parser. */
-
-static char escape_char(char in) {
- switch (in) {
- case 'r': return '\r';
- case 't': return '\t';
- case 'n': return '\n';
- case 'f': return '\f';
- case 'b': return '\b';
- case '/': return '/';
- case '"': return '"';
- case '\\': return '\\';
- default:
- UPB_ASSERT(0);
- return 'x';
- }
-}
-
-static bool escape(upb_json_parser *p, const char *ptr) {
- char ch = escape_char(*ptr);
- return multipart_text(p, &ch, 1, false);
-}
-
-static void start_hex(upb_json_parser *p) {
- p->digit = 0;
-}
-
-static void hexdigit(upb_json_parser *p, const char *ptr) {
- char ch = *ptr;
-
- p->digit <<= 4;
-
- if (ch >= '0' && ch <= '9') {
- p->digit += (ch - '0');
- } else if (ch >= 'a' && ch <= 'f') {
- p->digit += ((ch - 'a') + 10);
- } else {
- UPB_ASSERT(ch >= 'A' && ch <= 'F');
- p->digit += ((ch - 'A') + 10);
- }
-}
-
-static bool end_hex(upb_json_parser *p) {
- uint32_t codepoint = p->digit;
-
- /* emit the codepoint as UTF-8. */
- char utf8[3]; /* support \u0000 -- \uFFFF -- need only three bytes. */
- int length = 0;
- if (codepoint <= 0x7F) {
- utf8[0] = codepoint;
- length = 1;
- } else if (codepoint <= 0x07FF) {
- utf8[1] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[0] = (codepoint & 0x1F) | 0xC0;
- length = 2;
- } else /* codepoint <= 0xFFFF */ {
- utf8[2] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[1] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[0] = (codepoint & 0x0F) | 0xE0;
- length = 3;
- }
- /* TODO(haberman): Handle high surrogates: if codepoint is a high surrogate
- * we have to wait for the next escape to get the full code point). */
-
- return multipart_text(p, utf8, length, false);
-}
-
-static void start_text(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_text(upb_json_parser *p, const char *ptr) {
- return capture_end(p, ptr);
-}
-
-static bool start_number(upb_json_parser *p, const char *ptr) {
- if (is_top_level(p)) {
- if (is_number_wrapper_object(p)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_NUMBERVALUE);
- } else {
- return false;
- }
- } else if (does_number_wrapper_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_NUMBERVALUE);
- }
-
- multipart_startaccum(p);
- capture_begin(p, ptr);
- return true;
-}
-
-static bool parse_number(upb_json_parser *p, bool is_quoted);
-
-static bool end_number_nontop(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- if (p->top->f == NULL) {
- multipart_end(p);
- return true;
- }
-
- return parse_number(p, false);
-}
-
-static bool end_number(upb_json_parser *p, const char *ptr) {
- if (!end_number_nontop(p, ptr)) {
- return false;
- }
-
- if (does_number_wrapper_end(p)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-/* |buf| is NULL-terminated. |buf| itself will never include quotes;
- * |is_quoted| tells us whether this text originally appeared inside quotes. */
-static bool parse_number_from_buffer(upb_json_parser *p, const char *buf,
- bool is_quoted) {
- size_t len = strlen(buf);
- const char *bufend = buf + len;
- char *end;
- upb_fieldtype_t type = upb_fielddef_type(p->top->f);
- double val;
- double dummy;
- double inf = INFINITY;
-
- errno = 0;
-
- if (len == 0 || buf[0] == ' ') {
- return false;
- }
-
- /* For integer types, first try parsing with integer-specific routines.
- * If these succeed, they will be more accurate for int64/uint64 than
- * strtod().
- */
- switch (type) {
- case UPB_TYPE_ENUM:
- case UPB_TYPE_INT32: {
- long val = strtol(buf, &end, 0);
- if (errno == ERANGE || end != bufend) {
- break;
- } else if (val > INT32_MAX || val < INT32_MIN) {
- return false;
- } else {
- upb_sink_putint32(p->top->sink, parser_getsel(p), (int32_t)val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- case UPB_TYPE_UINT32: {
- unsigned long val = strtoul(buf, &end, 0);
- if (end != bufend) {
- break;
- } else if (val > UINT32_MAX || errno == ERANGE) {
- return false;
- } else {
- upb_sink_putuint32(p->top->sink, parser_getsel(p), (uint32_t)val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- /* XXX: We can't handle [u]int64 properly on 32-bit machines because
- * strto[u]ll isn't in C89. */
- case UPB_TYPE_INT64: {
- long val = strtol(buf, &end, 0);
- if (errno == ERANGE || end != bufend) {
- break;
- } else {
- upb_sink_putint64(p->top->sink, parser_getsel(p), val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- case UPB_TYPE_UINT64: {
- unsigned long val = strtoul(p->accumulated, &end, 0);
- if (end != bufend) {
- break;
- } else if (errno == ERANGE) {
- return false;
- } else {
- upb_sink_putuint64(p->top->sink, parser_getsel(p), val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- default:
- break;
- }
-
- if (type != UPB_TYPE_DOUBLE && type != UPB_TYPE_FLOAT && is_quoted) {
- /* Quoted numbers for integer types are not allowed to be in double form. */
- return false;
- }
-
- if (len == strlen("Infinity") && strcmp(buf, "Infinity") == 0) {
- /* C89 does not have an INFINITY macro. */
- val = inf;
- } else if (len == strlen("-Infinity") && strcmp(buf, "-Infinity") == 0) {
- val = -inf;
- } else {
- val = strtod(buf, &end);
- if (errno == ERANGE || end != bufend) {
- return false;
- }
- }
-
- switch (type) {
-#define CASE(capitaltype, smalltype, ctype, min, max) \
- case UPB_TYPE_ ## capitaltype: { \
- if (modf(val, &dummy) != 0 || val > max || val < min) { \
- return false; \
- } else { \
- upb_sink_put ## smalltype(p->top->sink, parser_getsel(p), \
- (ctype)val); \
- return true; \
- } \
- break; \
- }
- case UPB_TYPE_ENUM:
- CASE(INT32, int32, int32_t, INT32_MIN, INT32_MAX);
- CASE(INT64, int64, int64_t, INT64_MIN, INT64_MAX);
- CASE(UINT32, uint32, uint32_t, 0, UINT32_MAX);
- CASE(UINT64, uint64, uint64_t, 0, UINT64_MAX);
-#undef CASE
-
- case UPB_TYPE_DOUBLE:
- upb_sink_putdouble(p->top->sink, parser_getsel(p), val);
- return true;
- case UPB_TYPE_FLOAT:
- if ((val > FLT_MAX || val < -FLT_MAX) && val != inf && val != -inf) {
- return false;
- } else {
- upb_sink_putfloat(p->top->sink, parser_getsel(p), val);
- return true;
- }
- default:
- return false;
- }
-}
-
-static bool parse_number(upb_json_parser *p, bool is_quoted) {
- size_t len;
- const char *buf;
-
- /* strtol() and friends unfortunately do not support specifying the length of
- * the input string, so we need to force a copy into a NULL-terminated buffer. */
- if (!multipart_text(p, "\0", 1, false)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (parse_number_from_buffer(p, buf, is_quoted)) {
- multipart_end(p);
- return true;
- } else {
- upb_status_seterrf(p->status, "error parsing number: %s", buf);
- multipart_end(p);
- return false;
- }
-}
-
-static bool parser_putbool(upb_json_parser *p, bool val) {
- bool ok;
-
- if (p->top->f == NULL) {
- return true;
- }
-
- if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL) {
- upb_status_seterrf(p->status,
- "Boolean value specified for non-bool field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- ok = upb_sink_putbool(p->top->sink, parser_getsel(p), val);
- UPB_ASSERT(ok);
-
- return true;
-}
-
-static bool end_bool(upb_json_parser *p, bool val) {
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_BOOLVALUE)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_BOOLVALUE);
- } else {
- return false;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_BOOLVALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_BOOLVALUE);
- }
-
- if (p->top->is_unknown_field) {
- return true;
- }
-
- if (!parser_putbool(p, val)) {
- return false;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_BOOLVALUE)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-static bool end_null(upb_json_parser *p) {
- const char *zero_ptr = "0";
-
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_NULLVALUE);
- } else {
- return true;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_NULLVALUE);
- } else {
- return true;
- }
-
- /* Fill null_value field. */
- multipart_startaccum(p);
- capture_begin(p, zero_ptr);
- capture_end(p, zero_ptr + 1);
- parse_number(p, false);
-
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
-
- return true;
-}
-
-static bool start_any_stringval(upb_json_parser *p) {
- multipart_startaccum(p);
- return true;
-}
-
-static bool start_stringval(upb_json_parser *p) {
- if (is_top_level(p)) {
- if (is_string_wrapper_object(p) ||
- is_number_wrapper_object(p)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) {
- start_fieldmask_object(p);
- return true;
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION)) {
- start_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_STRINGVALUE);
- } else {
- return false;
- }
- } else if (does_string_wrapper_start(p) ||
- does_number_wrapper_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (does_fieldmask_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_fieldmask_object(p);
- return true;
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_field(p, UPB_WELLKNOWN_DURATION)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_STRINGVALUE);
- }
-
- if (p->top->f == NULL) {
- multipart_startaccum(p);
- return true;
- }
-
- if (p->top->is_any) {
- return start_any_stringval(p);
- }
-
- if (upb_fielddef_isstring(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (!check_stack(p)) return false;
-
- /* Start a new parser frame: parser frames correspond one-to-one with
- * handler frames, and string events occur in a sub-frame. */
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- p->top = inner;
-
- if (upb_fielddef_type(p->top->f) == UPB_TYPE_STRING) {
- /* For STRING fields we push data directly to the handlers as it is
- * parsed. We don't do this yet for BYTES fields, because our base64
- * decoder is not streaming.
- *
- * TODO(haberman): make base64 decoding streaming also. */
- multipart_start(p, getsel_for_handlertype(p, UPB_HANDLER_STRING));
- return true;
- } else {
- multipart_startaccum(p);
- return true;
- }
- } else if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL &&
- upb_fielddef_type(p->top->f) != UPB_TYPE_MESSAGE) {
- /* No need to push a frame -- numeric values in quotes remain in the
- * current parser frame. These values must accmulate so we can convert
- * them all at once at the end. */
- multipart_startaccum(p);
- return true;
- } else {
- upb_status_seterrf(p->status,
- "String specified for bool or submessage field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-}
-
-static bool end_any_stringval(upb_json_parser *p) {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- /* Set type_url */
- upb_selector_t sel;
- upb_jsonparser_frame *inner;
- if (!check_stack(p)) return false;
- inner = p->top + 1;
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(inner->sink, sel, buf, len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(inner->sink, sel);
-
- multipart_end(p);
-
- /* Resolve type url */
- if (strncmp(buf, "type.googleapis.com/", 20) == 0 && len > 20) {
- const upb_msgdef *payload_type = NULL;
- buf += 20;
- len -= 20;
-
- payload_type = upb_symtab_lookupmsg2(p->symtab, buf, len);
- if (payload_type == NULL) {
- upb_status_seterrf(
- p->status, "Cannot find packed type: %.*s\n", (int)len, buf);
- return false;
- }
-
- json_parser_any_frame_set_payload_type(p, p->top->any_frame, payload_type);
-
- return true;
- } else {
- upb_status_seterrf(
- p->status, "Invalid type url: %.*s\n", (int)len, buf);
- return false;
- }
-}
-
-static bool end_stringval_nontop(upb_json_parser *p) {
- bool ok = true;
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION)) {
- multipart_end(p);
- return true;
- }
-
- if (p->top->f == NULL) {
- multipart_end(p);
- return true;
- }
-
- if (p->top->is_any) {
- return end_any_stringval(p);
- }
-
- switch (upb_fielddef_type(p->top->f)) {
- case UPB_TYPE_BYTES:
- if (!base64_push(p, getsel_for_handlertype(p, UPB_HANDLER_STRING),
- p->accumulated, p->accumulated_len)) {
- return false;
- }
- /* Fall through. */
-
- case UPB_TYPE_STRING: {
- upb_selector_t sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(p->top->sink, sel);
- p->top--;
- break;
- }
-
- case UPB_TYPE_ENUM: {
- /* Resolve enum symbolic name to integer value. */
- const upb_enumdef *enumdef = upb_fielddef_enumsubdef(p->top->f);
-
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- int32_t int_val = 0;
- ok = upb_enumdef_ntoi(enumdef, buf, len, &int_val);
-
- if (ok) {
- upb_selector_t sel = parser_getsel(p);
- upb_sink_putint32(p->top->sink, sel, int_val);
- } else {
- if (p->ignore_json_unknown) {
- ok = true;
- /* TODO(teboring): Should also clean this field. */
- } else {
- upb_status_seterrf(p->status, "Enum value unknown: '%.*s'", len, buf);
- }
- }
-
- break;
- }
-
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_FLOAT:
- ok = parse_number(p, true);
- break;
-
- default:
- UPB_ASSERT(false);
- upb_status_seterrmsg(p->status, "Internal error in JSON decoder");
- ok = false;
- break;
- }
-
- multipart_end(p);
-
- return ok;
-}
-
-static bool end_stringval(upb_json_parser *p) {
- /* FieldMask's stringvals have been ended when handling them. Only need to
- * close FieldMask here.*/
- if (does_fieldmask_end(p)) {
- end_fieldmask_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (!end_stringval_nontop(p)) {
- return false;
- }
-
- if (does_string_wrapper_end(p) ||
- does_number_wrapper_end(p)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) {
- end_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-static void start_duration_base(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_duration_base(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- char seconds_buf[14];
- char nanos_buf[12];
- char *end;
- int64_t seconds = 0;
- int32_t nanos = 0;
- double val = 0.0;
- const char *seconds_membername = "seconds";
- const char *nanos_membername = "nanos";
- size_t fraction_start;
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- memset(seconds_buf, 0, 14);
- memset(nanos_buf, 0, 12);
-
- /* Find out base end. The maximus duration is 315576000000, which cannot be
- * represented by double without losing precision. Thus, we need to handle
- * fraction and base separately. */
- for (fraction_start = 0; fraction_start < len && buf[fraction_start] != '.';
- fraction_start++);
-
- /* Parse base */
- memcpy(seconds_buf, buf, fraction_start);
- seconds = strtol(seconds_buf, &end, 10);
- if (errno == ERANGE || end != seconds_buf + fraction_start) {
- upb_status_seterrf(p->status, "error parsing duration: %s",
- seconds_buf);
- return false;
- }
-
- if (seconds > 315576000000) {
- upb_status_seterrf(p->status, "error parsing duration: "
- "maximum acceptable value is "
- "315576000000");
- return false;
- }
-
- if (seconds < -315576000000) {
- upb_status_seterrf(p->status, "error parsing duration: "
- "minimum acceptable value is "
- "-315576000000");
- return false;
- }
-
- /* Parse fraction */
- nanos_buf[0] = '0';
- memcpy(nanos_buf + 1, buf + fraction_start, len - fraction_start);
- val = strtod(nanos_buf, &end);
- if (errno == ERANGE || end != nanos_buf + len - fraction_start + 1) {
- upb_status_seterrf(p->status, "error parsing duration: %s",
- nanos_buf);
- return false;
- }
-
- nanos = val * 1000000000;
- if (seconds < 0) nanos = -nanos;
-
- /* Clean up buffer */
- multipart_end(p);
-
- /* Set seconds */
- start_member(p);
- capture_begin(p, seconds_membername);
- capture_end(p, seconds_membername + 7);
- end_membername(p);
- upb_sink_putint64(p->top->sink, parser_getsel(p), seconds);
- end_member(p);
-
- /* Set nanos */
- start_member(p);
- capture_begin(p, nanos_membername);
- capture_end(p, nanos_membername + 5);
- end_membername(p);
- upb_sink_putint32(p->top->sink, parser_getsel(p), nanos);
- end_member(p);
-
- /* Continue previous arena */
- multipart_startaccum(p);
-
- return true;
-}
-
-static int parse_timestamp_number(upb_json_parser *p) {
- size_t len;
- const char *buf;
- int val;
-
- /* atoi() and friends unfortunately do not support specifying the length of
- * the input string, so we need to force a copy into a NULL-terminated buffer. */
- multipart_text(p, "\0", 1, false);
-
- buf = accumulate_getptr(p, &len);
- val = atoi(buf);
- multipart_end(p);
- multipart_startaccum(p);
-
- return val;
-}
-
-static void start_year(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_year(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_year = parse_timestamp_number(p) - 1900;
- return true;
-}
-
-static void start_month(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_month(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_mon = parse_timestamp_number(p) - 1;
- return true;
-}
-
-static void start_day(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_day(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_mday = parse_timestamp_number(p);
- return true;
-}
-
-static void start_hour(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_hour(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_hour = parse_timestamp_number(p);
- return true;
-}
-
-static void start_minute(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_minute(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_min = parse_timestamp_number(p);
- return true;
-}
-
-static void start_second(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_second(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_sec = parse_timestamp_number(p);
- return true;
-}
-
-static void start_timestamp_base(upb_json_parser *p) {
- memset(&p->tm, 0, sizeof(struct tm));
-}
-
-static void start_timestamp_fraction(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_timestamp_fraction(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- char nanos_buf[12];
- char *end;
- double val = 0.0;
- int32_t nanos;
- const char *nanos_membername = "nanos";
-
- memset(nanos_buf, 0, 12);
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (len > 10) {
- upb_status_seterrf(p->status,
- "error parsing timestamp: at most 9-digit fraction.");
- return false;
- }
-
- /* Parse nanos */
- nanos_buf[0] = '0';
- memcpy(nanos_buf + 1, buf, len);
- val = strtod(nanos_buf, &end);
-
- if (errno == ERANGE || end != nanos_buf + len + 1) {
- upb_status_seterrf(p->status, "error parsing timestamp nanos: %s",
- nanos_buf);
- return false;
- }
-
- nanos = val * 1000000000;
-
- /* Clean up previous environment */
- multipart_end(p);
-
- /* Set nanos */
- start_member(p);
- capture_begin(p, nanos_membername);
- capture_end(p, nanos_membername + 5);
- end_membername(p);
- upb_sink_putint32(p->top->sink, parser_getsel(p), nanos);
- end_member(p);
-
- /* Continue previous environment */
- multipart_startaccum(p);
-
- return true;
-}
-
-static void start_timestamp_zone(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-/* epoch_days(1970, 1, 1) == 1970-01-01 == 0. */
-static int epoch_days(int year, int month, int day) {
- static const uint16_t month_yday[12] = {0, 31, 59, 90, 120, 151,
- 181, 212, 243, 273, 304, 334};
- uint32_t year_adj = year + 4800; /* Ensure positive year, multiple of 400. */
- uint32_t febs = year_adj - (month <= 2 ? 1 : 0); /* Februaries since base. */
- uint32_t leap_days = 1 + (febs / 4) - (febs / 100) + (febs / 400);
- uint32_t days = 365 * year_adj + leap_days + month_yday[month - 1] + day - 1;
- return days - 2472692; /* Adjust to Unix epoch. */
-}
-
-static int64_t upb_timegm(const struct tm *tp) {
- int64_t ret = epoch_days(tp->tm_year + 1900, tp->tm_mon + 1, tp->tm_mday);
- ret = (ret * 24) + tp->tm_hour;
- ret = (ret * 60) + tp->tm_min;
- ret = (ret * 60) + tp->tm_sec;
- return ret;
-}
-
-static bool end_timestamp_zone(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- int hours;
- int64_t seconds;
- const char *seconds_membername = "seconds";
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (buf[0] != 'Z') {
- if (sscanf(buf + 1, "%2d:00", &hours) != 1) {
- upb_status_seterrf(p->status, "error parsing timestamp offset");
- return false;
- }
-
- if (buf[0] == '+') {
- hours = -hours;
- }
-
- p->tm.tm_hour += hours;
- }
-
- /* Normalize tm */
- seconds = upb_timegm(&p->tm);
-
- /* Check timestamp boundary */
- if (seconds < -62135596800) {
- upb_status_seterrf(p->status, "error parsing timestamp: "
- "minimum acceptable value is "
- "0001-01-01T00:00:00Z");
- return false;
- }
-
- /* Clean up previous environment */
- multipart_end(p);
-
- /* Set seconds */
- start_member(p);
- capture_begin(p, seconds_membername);
- capture_end(p, seconds_membername + 7);
- end_membername(p);
- upb_sink_putint64(p->top->sink, parser_getsel(p), seconds);
- end_member(p);
-
- /* Continue previous environment */
- multipart_startaccum(p);
-
- return true;
-}
-
-static void start_fieldmask_path_text(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_fieldmask_path_text(upb_json_parser *p, const char *ptr) {
- return capture_end(p, ptr);
-}
-
-static bool start_fieldmask_path(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (!check_stack(p)) return false;
-
- /* Start a new parser frame: parser frames correspond one-to-one with
- * handler frames, and string events occur in a sub-frame. */
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- p->top = inner;
-
- multipart_startaccum(p);
- return true;
-}
-
-static bool lower_camel_push(
- upb_json_parser *p, upb_selector_t sel, const char *ptr, size_t len) {
- const char *limit = ptr + len;
- bool first = true;
- for (;ptr < limit; ptr++) {
- if (*ptr >= 'A' && *ptr <= 'Z' && !first) {
- char lower = tolower(*ptr);
- upb_sink_putstring(p->top->sink, sel, "_", 1, NULL);
- upb_sink_putstring(p->top->sink, sel, &lower, 1, NULL);
- } else {
- upb_sink_putstring(p->top->sink, sel, ptr, 1, NULL);
- }
- first = false;
- }
- return true;
-}
-
-static bool end_fieldmask_path(upb_json_parser *p) {
- upb_selector_t sel;
-
- if (!lower_camel_push(
- p, getsel_for_handlertype(p, UPB_HANDLER_STRING),
- p->accumulated, p->accumulated_len)) {
- return false;
- }
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(p->top->sink, sel);
- p->top--;
-
- multipart_end(p);
- return true;
-}
-
-static void start_member(upb_json_parser *p) {
- UPB_ASSERT(!p->top->f);
- multipart_startaccum(p);
-}
-
-/* Helper: invoked during parse_mapentry() to emit the mapentry message's key
- * field based on the current contents of the accumulate buffer. */
-static bool parse_mapentry_key(upb_json_parser *p) {
-
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- /* Emit the key field. We do a bit of ad-hoc parsing here because the
- * parser state machine has already decided that this is a string field
- * name, and we are reinterpreting it as some arbitrary key type. In
- * particular, integer and bool keys are quoted, so we need to parse the
- * quoted string contents here. */
-
- p->top->f = upb_msgdef_itof(p->top->m, UPB_MAPENTRY_KEY);
- if (p->top->f == NULL) {
- upb_status_seterrmsg(p->status, "mapentry message has no key");
- return false;
- }
- switch (upb_fielddef_type(p->top->f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
- /* Invoke end_number. The accum buffer has the number's text already. */
- if (!parse_number(p, true)) {
- return false;
- }
- break;
- case UPB_TYPE_BOOL:
- if (len == 4 && !strncmp(buf, "true", 4)) {
- if (!parser_putbool(p, true)) {
- return false;
- }
- } else if (len == 5 && !strncmp(buf, "false", 5)) {
- if (!parser_putbool(p, false)) {
- return false;
- }
- } else {
- upb_status_seterrmsg(p->status,
- "Map bool key not 'true' or 'false'");
- return false;
- }
- multipart_end(p);
- break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES: {
- upb_sink subsink;
- upb_selector_t sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, len, &subsink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(subsink, sel, buf, len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(subsink, sel);
- multipart_end(p);
- break;
- }
- default:
- upb_status_seterrmsg(p->status, "Invalid field type for map key");
- return false;
- }
-
- return true;
-}
-
-/* Helper: emit one map entry (as a submessage in the map field sequence). This
- * is invoked from end_membername(), at the end of the map entry's key string,
- * with the map key in the accumulate buffer. It parses the key from that
- * buffer, emits the handler calls to start the mapentry submessage (setting up
- * its subframe in the process), and sets up state in the subframe so that the
- * value parser (invoked next) will emit the mapentry's value field and then
- * end the mapentry message. */
-
-static bool handle_mapentry(upb_json_parser *p) {
- const upb_fielddef *mapfield;
- const upb_msgdef *mapentrymsg;
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Map entry: p->top->sink is the seq frame, so we need to start a frame
- * for the mapentry itself, and then set |f| in that frame so that the map
- * value field is parsed, and also set a flag to end the frame after the
- * map-entry value is parsed. */
- if (!check_stack(p)) return false;
-
- mapfield = p->top->mapfield;
- mapentrymsg = upb_fielddef_msgsubdef(mapfield);
-
- inner = start_jsonparser_frame(p);
- p->top->f = mapfield;
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
- upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
- inner->m = mapentrymsg;
- inner->mapfield = mapfield;
-
- /* Don't set this to true *yet* -- we reuse parsing handlers below to push
- * the key field value to the sink, and these handlers will pop the frame
- * if they see is_mapentry (when invoked by the parser state machine, they
- * would have just seen the map-entry value, not key). */
- inner->is_mapentry = false;
- p->top = inner;
-
- /* send STARTMSG in submsg frame. */
- upb_sink_startmsg(p->top->sink);
-
- parse_mapentry_key(p);
-
- /* Set up the value field to receive the map-entry value. */
- p->top->f = upb_msgdef_itof(p->top->m, UPB_MAPENTRY_VALUE);
- p->top->is_mapentry = true; /* set up to pop frame after value is parsed. */
- p->top->mapfield = mapfield;
- if (p->top->f == NULL) {
- upb_status_seterrmsg(p->status, "mapentry message has no value");
- return false;
- }
-
- return true;
-}
-
-static bool end_membername(upb_json_parser *p) {
- UPB_ASSERT(!p->top->f);
-
- if (!p->top->m) {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- }
-
- if (p->top->is_any) {
- return end_any_membername(p);
- } else if (p->top->is_map) {
- return handle_mapentry(p);
- } else {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
- upb_value v;
-
- if (upb_strtable_lookup2(p->top->name_table, buf, len, &v)) {
- p->top->f = upb_value_getconstptr(v);
- multipart_end(p);
-
- return true;
- } else if (p->ignore_json_unknown) {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- } else {
- upb_status_seterrf(p->status, "No such field: %.*s\n", (int)len, buf);
- return false;
- }
- }
-}
-
-static bool end_any_membername(upb_json_parser *p) {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
- upb_value v;
-
- if (len == 5 && strncmp(buf, "@type", len) == 0) {
- upb_strtable_lookup2(p->top->name_table, "type_url", 8, &v);
- p->top->f = upb_value_getconstptr(v);
- multipart_end(p);
- return true;
- } else {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- }
-}
-
-static void end_member(upb_json_parser *p) {
- /* If we just parsed a map-entry value, end that frame too. */
- if (p->top->is_mapentry) {
- upb_selector_t sel;
- bool ok;
- const upb_fielddef *mapfield;
-
- UPB_ASSERT(p->top > p->stack);
- /* send ENDMSG on submsg. */
- upb_sink_endmsg(p->top->sink, p->status);
- mapfield = p->top->mapfield;
-
- /* send ENDSUBMSG in repeated-field-of-mapentries frame. */
- p->top--;
- ok = upb_handlers_getselector(mapfield, UPB_HANDLER_ENDSUBMSG, &sel);
- UPB_ASSUME(ok);
- upb_sink_endsubmsg(p->top->sink, (p->top + 1)->sink, sel);
- }
-
- p->top->f = NULL;
- p->top->is_unknown_field = false;
-}
-
-static void start_any_member(upb_json_parser *p, const char *ptr) {
- start_member(p);
- json_parser_any_frame_set_after_type_url_start_once(p->top->any_frame, ptr);
-}
-
-static void end_any_member(upb_json_parser *p, const char *ptr) {
- json_parser_any_frame_set_before_type_url_end(p->top->any_frame, ptr);
- end_member(p);
-}
-
-static bool start_subobject(upb_json_parser *p) {
- if (p->top->is_unknown_field) {
- if (!check_stack(p)) return false;
-
- p->top = start_jsonparser_frame(p);
- return true;
- }
-
- if (upb_fielddef_ismap(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Beginning of a map. Start a new parser frame in a repeated-field
- * context. */
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
- upb_sink_startseq(p->top->sink, sel, &inner->sink);
- inner->m = upb_fielddef_msgsubdef(p->top->f);
- inner->mapfield = p->top->f;
- inner->is_map = true;
- p->top = inner;
-
- return true;
- } else if (upb_fielddef_issubmsg(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Beginning of a subobject. Start a new parser frame in the submsg
- * context. */
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
- upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
- inner->m = upb_fielddef_msgsubdef(p->top->f);
- set_name_table(p, inner);
- p->top = inner;
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
- p->top->is_any = true;
- p->top->any_frame = json_parser_any_frame_new(p);
- } else {
- p->top->is_any = false;
- p->top->any_frame = NULL;
- }
-
- return true;
- } else {
- upb_status_seterrf(p->status,
- "Object specified for non-message/group field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-}
-
-static bool start_subobject_full(upb_json_parser *p) {
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_STRUCTVALUE);
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_STRUCT)) {
- start_structvalue_object(p);
- } else {
- return true;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_STRUCT)) {
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) return false;
- start_value_object(p, VALUE_STRUCTVALUE);
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- }
-
- return start_subobject(p);
-}
-
-static void end_subobject(upb_json_parser *p) {
- if (is_top_level(p)) {
- return;
- }
-
- if (p->top->is_map) {
- upb_selector_t sel;
- p->top--;
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSEQ);
- upb_sink_endseq(p->top->sink, sel);
- } else {
- upb_selector_t sel;
- bool is_unknown = p->top->m == NULL;
- p->top--;
- if (!is_unknown) {
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSUBMSG);
- upb_sink_endsubmsg(p->top->sink, (p->top + 1)->sink, sel);
- }
- }
-}
-
-static void end_subobject_full(upb_json_parser *p) {
- end_subobject(p);
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_STRUCT)) {
- end_structvalue_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-}
-
-static bool start_array(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_LISTVALUE);
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_LISTVALUE)) {
- start_listvalue_object(p);
- } else {
- return false;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_LISTVALUE) &&
- (!upb_fielddef_isseq(p->top->f) ||
- p->top->is_repeated)) {
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE) &&
- (!upb_fielddef_isseq(p->top->f) ||
- p->top->is_repeated)) {
- if (!start_subobject(p)) return false;
- start_value_object(p, VALUE_LISTVALUE);
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- }
-
- if (p->top->is_unknown_field) {
- inner = start_jsonparser_frame(p);
- inner->is_unknown_field = true;
- p->top = inner;
-
- return true;
- }
-
- if (!upb_fielddef_isseq(p->top->f)) {
- upb_status_seterrf(p->status,
- "Array specified for non-repeated field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
- upb_sink_startseq(p->top->sink, sel, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- inner->is_repeated = true;
- p->top = inner;
-
- return true;
-}
-
-static void end_array(upb_json_parser *p) {
- upb_selector_t sel;
-
- UPB_ASSERT(p->top > p->stack);
-
- p->top--;
-
- if (p->top->is_unknown_field) {
- return;
- }
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSEQ);
- upb_sink_endseq(p->top->sink, sel);
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_LISTVALUE)) {
- end_listvalue_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-}
-
-static void start_object(upb_json_parser *p) {
- if (!p->top->is_map && p->top->m != NULL) {
- upb_sink_startmsg(p->top->sink);
- }
-}
-
-static void end_object(upb_json_parser *p) {
- if (!p->top->is_map && p->top->m != NULL) {
- upb_sink_endmsg(p->top->sink, p->status);
- }
-}
-
-static void start_any_object(upb_json_parser *p, const char *ptr) {
- start_object(p);
- p->top->any_frame->before_type_url_start = ptr;
- p->top->any_frame->before_type_url_end = ptr;
-}
-
-static bool end_any_object(upb_json_parser *p, const char *ptr) {
- const char *value_membername = "value";
- bool is_well_known_packed = false;
- const char *packed_end = ptr + 1;
- upb_selector_t sel;
- upb_jsonparser_frame *inner;
-
- if (json_parser_any_frame_has_value(p->top->any_frame) &&
- !json_parser_any_frame_has_type_url(p->top->any_frame)) {
- upb_status_seterrmsg(p->status, "No valid type url");
- return false;
- }
-
- /* Well known types data is represented as value field. */
- if (upb_msgdef_wellknowntype(p->top->any_frame->parser->top->m) !=
- UPB_WELLKNOWN_UNSPECIFIED) {
- is_well_known_packed = true;
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame)) {
- p->top->any_frame->before_type_url_start =
- memchr(p->top->any_frame->before_type_url_start, ':',
- p->top->any_frame->before_type_url_end -
- p->top->any_frame->before_type_url_start);
- if (p->top->any_frame->before_type_url_start == NULL) {
- upb_status_seterrmsg(p->status, "invalid data for well known type.");
- return false;
- }
- p->top->any_frame->before_type_url_start++;
- }
-
- if (json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- p->top->any_frame->after_type_url_start =
- memchr(p->top->any_frame->after_type_url_start, ':',
- (ptr + 1) -
- p->top->any_frame->after_type_url_start);
- if (p->top->any_frame->after_type_url_start == NULL) {
- upb_status_seterrmsg(p->status, "Invalid data for well known type.");
- return false;
- }
- p->top->any_frame->after_type_url_start++;
- packed_end = ptr;
- }
- }
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL,
- p->top->any_frame->before_type_url_start,
- p->top->any_frame->before_type_url_end -
- p->top->any_frame->before_type_url_start, NULL)) {
- return false;
- }
- } else {
- if (!is_well_known_packed) {
- if (!parse(p->top->any_frame->parser, NULL, "{", 1, NULL)) {
- return false;
- }
- }
- }
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame) &&
- json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL, ",", 1, NULL)) {
- return false;
- }
- }
-
- if (json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL,
- p->top->any_frame->after_type_url_start,
- packed_end - p->top->any_frame->after_type_url_start, NULL)) {
- return false;
- }
- } else {
- if (!is_well_known_packed) {
- if (!parse(p->top->any_frame->parser, NULL, "}", 1, NULL)) {
- return false;
- }
- }
- }
-
- if (!end(p->top->any_frame->parser, NULL)) {
- return false;
- }
-
- p->top->is_any = false;
-
- /* Set value */
- start_member(p);
- capture_begin(p, value_membername);
- capture_end(p, value_membername + 5);
- end_membername(p);
-
- if (!check_stack(p)) return false;
- inner = p->top + 1;
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(inner->sink, sel, p->top->any_frame->stringsink.ptr,
- p->top->any_frame->stringsink.len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(inner->sink, sel);
-
- end_member(p);
-
- end_object(p);
-
- /* Deallocate any parse frame. */
- json_parser_any_frame_free(p->top->any_frame);
-
- return true;
-}
-
-static bool is_string_wrapper(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type == UPB_WELLKNOWN_STRINGVALUE ||
- type == UPB_WELLKNOWN_BYTESVALUE;
-}
-
-static bool is_fieldmask(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type == UPB_WELLKNOWN_FIELDMASK;
-}
-
-static void start_fieldmask_object(upb_json_parser *p) {
- const char *membername = "paths";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + 5);
- end_membername(p);
-
- start_array(p);
-}
-
-static void end_fieldmask_object(upb_json_parser *p) {
- end_array(p);
- end_member(p);
- end_object(p);
-}
-
-static void start_wrapper_object(upb_json_parser *p) {
- const char *membername = "value";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + 5);
- end_membername(p);
-}
-
-static void end_wrapper_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_value_object(upb_json_parser *p, int value_type) {
- const char *nullmember = "null_value";
- const char *numbermember = "number_value";
- const char *stringmember = "string_value";
- const char *boolmember = "bool_value";
- const char *structmember = "struct_value";
- const char *listmember = "list_value";
- const char *membername = "";
-
- switch (value_type) {
- case VALUE_NULLVALUE:
- membername = nullmember;
- break;
- case VALUE_NUMBERVALUE:
- membername = numbermember;
- break;
- case VALUE_STRINGVALUE:
- membername = stringmember;
- break;
- case VALUE_BOOLVALUE:
- membername = boolmember;
- break;
- case VALUE_STRUCTVALUE:
- membername = structmember;
- break;
- case VALUE_LISTVALUE:
- membername = listmember;
- break;
- }
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_value_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_listvalue_object(upb_json_parser *p) {
- const char *membername = "values";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_listvalue_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_structvalue_object(upb_json_parser *p) {
- const char *membername = "fields";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_structvalue_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static bool is_top_level(upb_json_parser *p) {
- return p->top == p->stack && p->top->f == NULL && !p->top->is_unknown_field;
-}
-
-static bool is_wellknown_msg(upb_json_parser *p, upb_wellknowntype_t type) {
- return p->top->m != NULL && upb_msgdef_wellknowntype(p->top->m) == type;
-}
-
-static bool is_wellknown_field(upb_json_parser *p, upb_wellknowntype_t type) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- (upb_msgdef_wellknowntype(upb_fielddef_msgsubdef(p->top->f))
- == type);
-}
-
-static bool does_number_wrapper_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- upb_msgdef_isnumberwrapper(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_number_wrapper_end(upb_json_parser *p) {
- return p->top->m != NULL && upb_msgdef_isnumberwrapper(p->top->m);
-}
-
-static bool is_number_wrapper_object(upb_json_parser *p) {
- return p->top->m != NULL && upb_msgdef_isnumberwrapper(p->top->m);
-}
-
-static bool does_string_wrapper_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- is_string_wrapper(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_string_wrapper_end(upb_json_parser *p) {
- return p->top->m != NULL && is_string_wrapper(p->top->m);
-}
-
-static bool is_string_wrapper_object(upb_json_parser *p) {
- return p->top->m != NULL && is_string_wrapper(p->top->m);
-}
-
-static bool does_fieldmask_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- is_fieldmask(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_fieldmask_end(upb_json_parser *p) {
- return p->top->m != NULL && is_fieldmask(p->top->m);
-}
-
-#define CHECK_RETURN_TOP(x) if (!(x)) goto error
-
-
-/* The actual parser **********************************************************/
-
-/* What follows is the Ragel parser itself. The language is specified in Ragel
- * and the actions call our C functions above.
- *
- * Ragel has an extensive set of functionality, and we use only a small part of
- * it. There are many action types but we only use a few:
- *
- * ">" -- transition into a machine
- * "%" -- transition out of a machine
- * "@" -- transition into a final state of a machine.
- *
- * "@" transitions are tricky because a machine can transition into a final
- * state repeatedly. But in some cases we know this can't happen, for example
- * a string which is delimited by a final '"' can only transition into its
- * final state once, when the closing '"' is seen. */
-
-
-#line 2784 "upb/json/parser.rl"
-
-
-
-#line 2587 "upb/json/parser.c"
-static const char _json_actions[] = {
- 0, 1, 0, 1, 1, 1, 3, 1,
- 4, 1, 6, 1, 7, 1, 8, 1,
- 9, 1, 11, 1, 12, 1, 13, 1,
- 14, 1, 15, 1, 16, 1, 17, 1,
- 18, 1, 19, 1, 20, 1, 22, 1,
- 23, 1, 24, 1, 35, 1, 37, 1,
- 39, 1, 40, 1, 42, 1, 43, 1,
- 44, 1, 46, 1, 48, 1, 49, 1,
- 50, 1, 51, 1, 53, 1, 54, 2,
- 4, 9, 2, 5, 6, 2, 7, 3,
- 2, 7, 9, 2, 21, 26, 2, 25,
- 10, 2, 27, 28, 2, 29, 30, 2,
- 32, 34, 2, 33, 31, 2, 38, 36,
- 2, 40, 42, 2, 45, 2, 2, 46,
- 54, 2, 47, 36, 2, 49, 54, 2,
- 50, 54, 2, 51, 54, 2, 52, 41,
- 2, 53, 54, 3, 32, 34, 35, 4,
- 21, 26, 27, 28
-};
-
-static const short _json_key_offsets[] = {
- 0, 0, 12, 13, 18, 23, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 43, 44, 48, 53, 58, 63, 67,
- 71, 74, 77, 79, 83, 87, 89, 91,
- 96, 98, 100, 109, 115, 121, 127, 133,
- 135, 139, 142, 144, 146, 149, 150, 154,
- 156, 158, 160, 162, 163, 165, 167, 168,
- 170, 172, 173, 175, 177, 178, 180, 182,
- 183, 185, 187, 191, 193, 195, 196, 197,
- 198, 199, 201, 206, 208, 210, 212, 221,
- 222, 222, 222, 227, 232, 237, 238, 239,
- 240, 241, 241, 242, 243, 244, 244, 245,
- 246, 247, 247, 252, 253, 257, 262, 267,
- 272, 276, 276, 279, 282, 285, 288, 291,
- 294, 294, 294, 294, 294, 294
-};
-
-static const char _json_trans_keys[] = {
- 32, 34, 45, 91, 102, 110, 116, 123,
- 9, 13, 48, 57, 34, 32, 93, 125,
- 9, 13, 32, 44, 93, 9, 13, 32,
- 93, 125, 9, 13, 97, 108, 115, 101,
- 117, 108, 108, 114, 117, 101, 32, 34,
- 125, 9, 13, 34, 32, 58, 9, 13,
- 32, 93, 125, 9, 13, 32, 44, 125,
- 9, 13, 32, 44, 125, 9, 13, 32,
- 34, 9, 13, 45, 48, 49, 57, 48,
- 49, 57, 46, 69, 101, 48, 57, 69,
- 101, 48, 57, 43, 45, 48, 57, 48,
- 57, 48, 57, 46, 69, 101, 48, 57,
- 34, 92, 34, 92, 34, 47, 92, 98,
- 102, 110, 114, 116, 117, 48, 57, 65,
- 70, 97, 102, 48, 57, 65, 70, 97,
- 102, 48, 57, 65, 70, 97, 102, 48,
- 57, 65, 70, 97, 102, 34, 92, 45,
- 48, 49, 57, 48, 49, 57, 46, 115,
- 48, 57, 115, 48, 57, 34, 46, 115,
- 48, 57, 48, 57, 48, 57, 48, 57,
- 48, 57, 45, 48, 57, 48, 57, 45,
- 48, 57, 48, 57, 84, 48, 57, 48,
- 57, 58, 48, 57, 48, 57, 58, 48,
- 57, 48, 57, 43, 45, 46, 90, 48,
- 57, 48, 57, 58, 48, 48, 34, 48,
- 57, 43, 45, 90, 48, 57, 34, 44,
- 34, 44, 34, 44, 34, 45, 91, 102,
- 110, 116, 123, 48, 57, 34, 32, 93,
- 125, 9, 13, 32, 44, 93, 9, 13,
- 32, 93, 125, 9, 13, 97, 108, 115,
- 101, 117, 108, 108, 114, 117, 101, 32,
- 34, 125, 9, 13, 34, 32, 58, 9,
- 13, 32, 93, 125, 9, 13, 32, 44,
- 125, 9, 13, 32, 44, 125, 9, 13,
- 32, 34, 9, 13, 32, 9, 13, 32,
- 9, 13, 32, 9, 13, 32, 9, 13,
- 32, 9, 13, 32, 9, 13, 0
-};
-
-static const char _json_single_lengths[] = {
- 0, 8, 1, 3, 3, 3, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 3, 1, 2, 3, 3, 3, 2, 2,
- 1, 3, 0, 2, 2, 0, 0, 3,
- 2, 2, 9, 0, 0, 0, 0, 2,
- 2, 1, 2, 0, 1, 1, 2, 0,
- 0, 0, 0, 1, 0, 0, 1, 0,
- 0, 1, 0, 0, 1, 0, 0, 1,
- 0, 0, 4, 0, 0, 1, 1, 1,
- 1, 0, 3, 2, 2, 2, 7, 1,
- 0, 0, 3, 3, 3, 1, 1, 1,
- 1, 0, 1, 1, 1, 0, 1, 1,
- 1, 0, 3, 1, 2, 3, 3, 3,
- 2, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0
-};
-
-static const char _json_range_lengths[] = {
- 0, 2, 0, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 3, 3, 3, 3, 0,
- 1, 1, 0, 1, 1, 0, 1, 1,
- 1, 1, 1, 0, 1, 1, 0, 1,
- 1, 0, 1, 1, 0, 1, 1, 0,
- 1, 1, 0, 1, 1, 0, 0, 0,
- 0, 1, 1, 0, 0, 0, 1, 0,
- 0, 0, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 1, 1, 1, 1,
- 1, 0, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0
-};
-
-static const short _json_index_offsets[] = {
- 0, 0, 11, 13, 18, 23, 28, 30,
- 32, 34, 36, 38, 40, 42, 44, 46,
- 48, 53, 55, 59, 64, 69, 74, 78,
- 82, 85, 89, 91, 95, 99, 101, 103,
- 108, 111, 114, 124, 128, 132, 136, 140,
- 143, 147, 150, 153, 155, 158, 160, 164,
- 166, 168, 170, 172, 174, 176, 178, 180,
- 182, 184, 186, 188, 190, 192, 194, 196,
- 198, 200, 202, 207, 209, 211, 213, 215,
- 217, 219, 221, 226, 229, 232, 235, 244,
- 246, 247, 248, 253, 258, 263, 265, 267,
- 269, 271, 272, 274, 276, 278, 279, 281,
- 283, 285, 286, 291, 293, 297, 302, 307,
- 312, 316, 317, 320, 323, 326, 329, 332,
- 335, 336, 337, 338, 339, 340
-};
-
-static const unsigned char _json_indicies[] = {
- 0, 2, 3, 4, 5, 6, 7, 8,
- 0, 3, 1, 9, 1, 11, 12, 1,
- 11, 10, 13, 14, 12, 13, 1, 14,
- 1, 1, 14, 10, 15, 1, 16, 1,
- 17, 1, 18, 1, 19, 1, 20, 1,
- 21, 1, 22, 1, 23, 1, 24, 1,
- 25, 26, 27, 25, 1, 28, 1, 29,
- 30, 29, 1, 30, 1, 1, 30, 31,
- 32, 33, 34, 32, 1, 35, 36, 27,
- 35, 1, 36, 26, 36, 1, 37, 38,
- 39, 1, 38, 39, 1, 41, 42, 42,
- 40, 43, 1, 42, 42, 43, 40, 44,
- 44, 45, 1, 45, 1, 45, 40, 41,
- 42, 42, 39, 40, 47, 48, 46, 50,
- 51, 49, 52, 52, 52, 52, 52, 52,
- 52, 52, 53, 1, 54, 54, 54, 1,
- 55, 55, 55, 1, 56, 56, 56, 1,
- 57, 57, 57, 1, 59, 60, 58, 61,
- 62, 63, 1, 64, 65, 1, 66, 67,
- 1, 68, 1, 67, 68, 1, 69, 1,
- 66, 67, 65, 1, 70, 1, 71, 1,
- 72, 1, 73, 1, 74, 1, 75, 1,
- 76, 1, 77, 1, 78, 1, 79, 1,
- 80, 1, 81, 1, 82, 1, 83, 1,
- 84, 1, 85, 1, 86, 1, 87, 1,
- 88, 1, 89, 89, 90, 91, 1, 92,
- 1, 93, 1, 94, 1, 95, 1, 96,
- 1, 97, 1, 98, 1, 99, 99, 100,
- 98, 1, 102, 1, 101, 104, 105, 103,
- 1, 1, 101, 106, 107, 108, 109, 110,
- 111, 112, 107, 1, 113, 1, 114, 115,
- 117, 118, 1, 117, 116, 119, 120, 118,
- 119, 1, 120, 1, 1, 120, 116, 121,
- 1, 122, 1, 123, 1, 124, 1, 125,
- 126, 1, 127, 1, 128, 1, 129, 130,
- 1, 131, 1, 132, 1, 133, 134, 135,
- 136, 134, 1, 137, 1, 138, 139, 138,
- 1, 139, 1, 1, 139, 140, 141, 142,
- 143, 141, 1, 144, 145, 136, 144, 1,
- 145, 135, 145, 1, 146, 147, 147, 1,
- 148, 148, 1, 149, 149, 1, 150, 150,
- 1, 151, 151, 1, 152, 152, 1, 1,
- 1, 1, 1, 1, 1, 0
-};
-
-static const char _json_trans_targs[] = {
- 1, 0, 2, 107, 3, 6, 10, 13,
- 16, 106, 4, 3, 106, 4, 5, 7,
- 8, 9, 108, 11, 12, 109, 14, 15,
- 110, 16, 17, 111, 18, 18, 19, 20,
- 21, 22, 111, 21, 22, 24, 25, 31,
- 112, 26, 28, 27, 29, 30, 33, 113,
- 34, 33, 113, 34, 32, 35, 36, 37,
- 38, 39, 33, 113, 34, 41, 42, 46,
- 42, 46, 43, 45, 44, 114, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65,
- 66, 67, 73, 72, 68, 69, 70, 71,
- 72, 115, 74, 67, 72, 76, 116, 76,
- 116, 77, 79, 81, 82, 85, 90, 94,
- 98, 80, 117, 117, 83, 82, 80, 83,
- 84, 86, 87, 88, 89, 117, 91, 92,
- 93, 117, 95, 96, 97, 117, 98, 99,
- 105, 100, 100, 101, 102, 103, 104, 105,
- 103, 104, 117, 106, 106, 106, 106, 106,
- 106
-};
-
-static const unsigned char _json_trans_actions[] = {
- 0, 0, 113, 107, 53, 0, 0, 0,
- 125, 59, 45, 0, 55, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 101, 51, 47, 0, 0, 45,
- 49, 49, 104, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 0, 0, 5, 15,
- 0, 0, 71, 7, 13, 0, 74, 9,
- 9, 9, 77, 80, 11, 37, 37, 37,
- 0, 0, 0, 39, 0, 41, 86, 0,
- 0, 0, 17, 19, 0, 21, 23, 0,
- 25, 27, 0, 29, 31, 0, 33, 35,
- 0, 135, 83, 135, 0, 0, 0, 0,
- 0, 92, 0, 89, 89, 98, 43, 0,
- 131, 95, 113, 107, 53, 0, 0, 0,
- 125, 59, 69, 110, 45, 0, 55, 0,
- 0, 0, 0, 0, 0, 119, 0, 0,
- 0, 122, 0, 0, 0, 116, 0, 101,
- 51, 47, 0, 0, 45, 49, 49, 104,
- 0, 0, 128, 0, 57, 63, 65, 61,
- 67
-};
-
-static const unsigned char _json_eof_actions[] = {
- 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, 1, 0, 1, 0, 0, 1, 1,
- 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, 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, 0, 0,
- 0, 0, 0, 57, 63, 65, 61, 67,
- 0, 0, 0, 0, 0, 0
-};
-
-static const int json_start = 1;
-
-static const int json_en_number_machine = 23;
-static const int json_en_string_machine = 32;
-static const int json_en_duration_machine = 40;
-static const int json_en_timestamp_machine = 47;
-static const int json_en_fieldmask_machine = 75;
-static const int json_en_value_machine = 78;
-static const int json_en_main = 1;
-
-
-#line 2787 "upb/json/parser.rl"
-
-size_t parse(void *closure, const void *hd, const char *buf, size_t size,
- const upb_bufhandle *handle) {
- upb_json_parser *parser = closure;
-
- /* Variables used by Ragel's generated code. */
- int cs = parser->current_state;
- int *stack = parser->parser_stack;
- int top = parser->parser_top;
-
- const char *p = buf;
- const char *pe = buf + size;
- const char *eof = &eof_ch;
-
- parser->handle = handle;
-
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
-
- capture_resume(parser, buf);
-
-
-#line 2865 "upb/json/parser.c"
- {
- int _klen;
- unsigned int _trans;
- const char *_acts;
- unsigned int _nacts;
- const char *_keys;
-
- if ( p == pe )
- goto _test_eof;
- if ( cs == 0 )
- goto _out;
-_resume:
- _keys = _json_trans_keys + _json_key_offsets[cs];
- _trans = _json_index_offsets[cs];
-
- _klen = _json_single_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + _klen - 1;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + ((_upper-_lower) >> 1);
- if ( (*p) < *_mid )
- _upper = _mid - 1;
- else if ( (*p) > *_mid )
- _lower = _mid + 1;
- else {
- _trans += (unsigned int)(_mid - _keys);
- goto _match;
- }
- }
- _keys += _klen;
- _trans += _klen;
- }
-
- _klen = _json_range_lengths[cs];
- if ( _klen > 0 ) {
- const char *_lower = _keys;
- const char *_mid;
- const char *_upper = _keys + (_klen<<1) - 2;
- while (1) {
- if ( _upper < _lower )
- break;
-
- _mid = _lower + (((_upper-_lower) >> 1) & ~1);
- if ( (*p) < _mid[0] )
- _upper = _mid - 2;
- else if ( (*p) > _mid[1] )
- _lower = _mid + 2;
- else {
- _trans += (unsigned int)((_mid - _keys)>>1);
- goto _match;
- }
- }
- _trans += _klen;
- }
-
-_match:
- _trans = _json_indicies[_trans];
- cs = _json_trans_targs[_trans];
-
- if ( _json_trans_actions[_trans] == 0 )
- goto _again;
-
- _acts = _json_actions + _json_trans_actions[_trans];
- _nacts = (unsigned int) *_acts++;
- while ( _nacts-- > 0 )
- {
- switch ( *_acts++ )
- {
- case 1:
-#line 2592 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
- case 2:
-#line 2594 "upb/json/parser.rl"
- { p--; {stack[top++] = cs; cs = 23;goto _again;} }
- break;
- case 3:
-#line 2598 "upb/json/parser.rl"
- { start_text(parser, p); }
- break;
- case 4:
-#line 2599 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_text(parser, p)); }
- break;
- case 5:
-#line 2605 "upb/json/parser.rl"
- { start_hex(parser); }
- break;
- case 6:
-#line 2606 "upb/json/parser.rl"
- { hexdigit(parser, p); }
- break;
- case 7:
-#line 2607 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_hex(parser)); }
- break;
- case 8:
-#line 2613 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(escape(parser, p)); }
- break;
- case 9:
-#line 2619 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
- case 10:
-#line 2624 "upb/json/parser.rl"
- { start_year(parser, p); }
- break;
- case 11:
-#line 2625 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_year(parser, p)); }
- break;
- case 12:
-#line 2629 "upb/json/parser.rl"
- { start_month(parser, p); }
- break;
- case 13:
-#line 2630 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_month(parser, p)); }
- break;
- case 14:
-#line 2634 "upb/json/parser.rl"
- { start_day(parser, p); }
- break;
- case 15:
-#line 2635 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_day(parser, p)); }
- break;
- case 16:
-#line 2639 "upb/json/parser.rl"
- { start_hour(parser, p); }
- break;
- case 17:
-#line 2640 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_hour(parser, p)); }
- break;
- case 18:
-#line 2644 "upb/json/parser.rl"
- { start_minute(parser, p); }
- break;
- case 19:
-#line 2645 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_minute(parser, p)); }
- break;
- case 20:
-#line 2649 "upb/json/parser.rl"
- { start_second(parser, p); }
- break;
- case 21:
-#line 2650 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_second(parser, p)); }
- break;
- case 22:
-#line 2655 "upb/json/parser.rl"
- { start_duration_base(parser, p); }
- break;
- case 23:
-#line 2656 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_duration_base(parser, p)); }
- break;
- case 24:
-#line 2658 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
- case 25:
-#line 2663 "upb/json/parser.rl"
- { start_timestamp_base(parser); }
- break;
- case 26:
-#line 2665 "upb/json/parser.rl"
- { start_timestamp_fraction(parser, p); }
- break;
- case 27:
-#line 2666 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
- break;
- case 28:
-#line 2668 "upb/json/parser.rl"
- { start_timestamp_zone(parser, p); }
- break;
- case 29:
-#line 2669 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
- break;
- case 30:
-#line 2671 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
- case 31:
-#line 2676 "upb/json/parser.rl"
- { start_fieldmask_path_text(parser, p); }
- break;
- case 32:
-#line 2677 "upb/json/parser.rl"
- { end_fieldmask_path_text(parser, p); }
- break;
- case 33:
-#line 2682 "upb/json/parser.rl"
- { start_fieldmask_path(parser); }
- break;
- case 34:
-#line 2683 "upb/json/parser.rl"
- { end_fieldmask_path(parser); }
- break;
- case 35:
-#line 2689 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
- case 36:
-#line 2694 "upb/json/parser.rl"
- {
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
- {stack[top++] = cs; cs = 47;goto _again;}
- } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_DURATION)) {
- {stack[top++] = cs; cs = 40;goto _again;}
- } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_FIELDMASK)) {
- {stack[top++] = cs; cs = 75;goto _again;}
- } else {
- {stack[top++] = cs; cs = 32;goto _again;}
- }
- }
- break;
- case 37:
-#line 2707 "upb/json/parser.rl"
- { p--; {stack[top++] = cs; cs = 78;goto _again;} }
- break;
- case 38:
-#line 2712 "upb/json/parser.rl"
- {
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- start_any_member(parser, p);
- } else {
- start_member(parser);
- }
- }
- break;
- case 39:
-#line 2719 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_membername(parser)); }
- break;
- case 40:
-#line 2722 "upb/json/parser.rl"
- {
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- end_any_member(parser, p);
- } else {
- end_member(parser);
- }
- }
- break;
- case 41:
-#line 2733 "upb/json/parser.rl"
- {
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- start_any_object(parser, p);
- } else {
- start_object(parser);
- }
- }
- break;
- case 42:
-#line 2742 "upb/json/parser.rl"
- {
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- CHECK_RETURN_TOP(end_any_object(parser, p));
- } else {
- end_object(parser);
- }
- }
- break;
- case 43:
-#line 2754 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(start_array(parser)); }
- break;
- case 44:
-#line 2758 "upb/json/parser.rl"
- { end_array(parser); }
- break;
- case 45:
-#line 2763 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(start_number(parser, p)); }
- break;
- case 46:
-#line 2764 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_number(parser, p)); }
- break;
- case 47:
-#line 2766 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(start_stringval(parser)); }
- break;
- case 48:
-#line 2767 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_stringval(parser)); }
- break;
- case 49:
-#line 2769 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_bool(parser, true)); }
- break;
- case 50:
-#line 2771 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_bool(parser, false)); }
- break;
- case 51:
-#line 2773 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_null(parser)); }
- break;
- case 52:
-#line 2775 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(start_subobject_full(parser)); }
- break;
- case 53:
-#line 2776 "upb/json/parser.rl"
- { end_subobject_full(parser); }
- break;
- case 54:
-#line 2781 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; goto _again;} }
- break;
-#line 3189 "upb/json/parser.c"
- }
- }
-
-_again:
- if ( cs == 0 )
- goto _out;
- if ( ++p != pe )
- goto _resume;
- _test_eof: {}
- if ( p == eof )
- {
- const char *__acts = _json_actions + _json_eof_actions[cs];
- unsigned int __nacts = (unsigned int) *__acts++;
- while ( __nacts-- > 0 ) {
- switch ( *__acts++ ) {
- case 0:
-#line 2590 "upb/json/parser.rl"
- { p--; {cs = stack[--top]; if ( p == pe )
- goto _test_eof;
-goto _again;} }
- break;
- case 46:
-#line 2764 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_number(parser, p)); }
- break;
- case 49:
-#line 2769 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_bool(parser, true)); }
- break;
- case 50:
-#line 2771 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_bool(parser, false)); }
- break;
- case 51:
-#line 2773 "upb/json/parser.rl"
- { CHECK_RETURN_TOP(end_null(parser)); }
- break;
- case 53:
-#line 2776 "upb/json/parser.rl"
- { end_subobject_full(parser); }
- break;
-#line 3231 "upb/json/parser.c"
- }
- }
- }
-
- _out: {}
- }
-
-#line 2809 "upb/json/parser.rl"
-
- if (p != pe) {
- upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
- } else {
- capture_suspend(parser, &p);
- }
-
-error:
- /* Save parsing state back to parser. */
- parser->current_state = cs;
- parser->parser_top = top;
-
- return p - buf;
-}
-
-static bool end(void *closure, const void *hd) {
- upb_json_parser *parser = closure;
-
- /* Prevent compile warning on unused static constants. */
- UPB_UNUSED(json_start);
- UPB_UNUSED(json_en_duration_machine);
- UPB_UNUSED(json_en_fieldmask_machine);
- UPB_UNUSED(json_en_number_machine);
- UPB_UNUSED(json_en_string_machine);
- UPB_UNUSED(json_en_timestamp_machine);
- UPB_UNUSED(json_en_value_machine);
- UPB_UNUSED(json_en_main);
-
- parse(parser, hd, &eof_ch, 0, NULL);
-
- return parser->current_state >= 106;
-}
-
-static void json_parser_reset(upb_json_parser *p) {
- int cs;
- int top;
-
- p->top = p->stack;
- init_frame(p->top);
-
- /* Emit Ragel initialization of the parser. */
-
-#line 3282 "upb/json/parser.c"
- {
- cs = json_start;
- top = 0;
- }
-
-#line 2851 "upb/json/parser.rl"
- p->current_state = cs;
- p->parser_top = top;
- accumulate_clear(p);
- p->multipart_state = MULTIPART_INACTIVE;
- p->capture = NULL;
- p->accumulated = NULL;
-}
-
-static upb_json_parsermethod *parsermethod_new(upb_json_codecache *c,
- const upb_msgdef *md) {
- int i, n;
- upb_alloc *alloc = upb_arena_alloc(c->arena);
-
- upb_json_parsermethod *m = upb_malloc(alloc, sizeof(*m));
-
- m->cache = c;
-
- upb_byteshandler_init(&m->input_handler_);
- upb_byteshandler_setstring(&m->input_handler_, parse, m);
- upb_byteshandler_setendstr(&m->input_handler_, end, m);
-
- upb_strtable_init2(&m->name_table, UPB_CTYPE_CONSTPTR, 4, alloc);
-
- /* Build name_table */
-
- n = upb_msgdef_fieldcount(md);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
- upb_value v = upb_value_constptr(f);
- const char *name;
-
- /* Add an entry for the JSON name. */
- name = upb_fielddef_jsonname(f);
- upb_strtable_insert3(&m->name_table, name, strlen(name), v, alloc);
-
- if (strcmp(name, upb_fielddef_name(f)) != 0) {
- /* Since the JSON name is different from the regular field name, add an
- * entry for the raw name (compliant proto3 JSON parsers must accept
- * both). */
- const char *name = upb_fielddef_name(f);
- upb_strtable_insert3(&m->name_table, name, strlen(name), v, alloc);
- }
- }
-
- return m;
-}
-
-/* Public API *****************************************************************/
-
-upb_json_parser *upb_json_parser_create(upb_arena *arena,
- const upb_json_parsermethod *method,
- const upb_symtab* symtab,
- upb_sink output,
- upb_status *status,
- bool ignore_json_unknown) {
- upb_json_parser *p = upb_arena_malloc(arena, sizeof(upb_json_parser));
- if (!p) return false;
-
- p->arena = arena;
- p->method = method;
- p->status = status;
- p->limit = p->stack + UPB_JSON_MAX_DEPTH;
- p->accumulate_buf = NULL;
- p->accumulate_buf_size = 0;
- upb_bytessink_reset(&p->input_, &method->input_handler_, p);
-
- json_parser_reset(p);
- p->top->sink = output;
- p->top->m = upb_handlers_msgdef(output.handlers);
- if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
- p->top->is_any = true;
- p->top->any_frame = json_parser_any_frame_new(p);
- } else {
- p->top->is_any = false;
- p->top->any_frame = NULL;
- }
- set_name_table(p, p->top);
- p->symtab = symtab;
-
- p->ignore_json_unknown = ignore_json_unknown;
-
- return p;
-}
-
-upb_bytessink upb_json_parser_input(upb_json_parser *p) {
- return p->input_;
-}
-
-const upb_byteshandler *upb_json_parsermethod_inputhandler(
- const upb_json_parsermethod *m) {
- return &m->input_handler_;
-}
-
-upb_json_codecache *upb_json_codecache_new(void) {
- upb_alloc *alloc;
- upb_json_codecache *c;
-
- c = upb_gmalloc(sizeof(*c));
-
- c->arena = upb_arena_new();
- alloc = upb_arena_alloc(c->arena);
-
- upb_inttable_init2(&c->methods, UPB_CTYPE_CONSTPTR, alloc);
-
- return c;
-}
-
-void upb_json_codecache_free(upb_json_codecache *c) {
- upb_arena_free(c->arena);
- upb_gfree(c);
-}
-
-const upb_json_parsermethod *upb_json_codecache_get(upb_json_codecache *c,
- const upb_msgdef *md) {
- upb_json_parsermethod *m;
- upb_value v;
- int i, n;
- upb_alloc *alloc = upb_arena_alloc(c->arena);
-
- if (upb_inttable_lookupptr(&c->methods, md, &v)) {
- return upb_value_getconstptr(v);
- }
-
- m = parsermethod_new(c, md);
- v = upb_value_constptr(m);
-
- if (!m) return NULL;
- if (!upb_inttable_insertptr2(&c->methods, md, v, alloc)) return NULL;
-
- /* Populate parser methods for all submessages, so the name tables will
- * be available during parsing. */
- n = upb_msgdef_fieldcount(md);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
-
- if (upb_fielddef_issubmsg(f)) {
- const upb_msgdef *subdef = upb_fielddef_msgsubdef(f);
- const upb_json_parsermethod *sub_method =
- upb_json_codecache_get(c, subdef);
-
- if (!sub_method) return NULL;
- }
- }
-
- return m;
-}
diff --git a/grpc/third_party/upb/docs/render.py b/grpc/third_party/upb/docs/render.py
new file mode 100755
index 00000000..017978c8
--- /dev/null
+++ b/grpc/third_party/upb/docs/render.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+
+import subprocess
+import sys
+import shutil
+import os
+
+if len(sys.argv) < 2:
+ print("Must pass a filename argument")
+ sys.exit(1)
+
+in_filename = sys.argv[1]
+out_filename = in_filename.replace(".in.md", ".md")
+out_dir = in_filename.replace(".in.md", "")
+
+if in_filename == out_filename:
+ print("File must end in .in.md")
+ sys.exit(1)
+
+if os.path.isdir(out_dir):
+ shutil.rmtree(out_dir)
+
+os.mkdir(out_dir)
+file_num = 1
+
+with open(out_filename, "wb") as out_file, open(in_filename, "rb") as in_file:
+ for line in in_file:
+ if line.startswith(b"```dot"):
+ dot_lines = []
+ while True:
+ dot_line = next(in_file)
+ if dot_line == b"```\n":
+ break
+ dot_lines.append(dot_line)
+ dot_input = b"".join(dot_lines)
+ svg_filename = out_dir + "/" + str(file_num) + ".svg"
+ svg = subprocess.check_output(['dot', '-Tsvg', '-o', svg_filename], input=dot_input)
+ out_file.write(b"<div align=center>\n")
+ out_file.write(b"<img src='%s'/>\n" % (svg_filename.encode('utf-8')))
+ out_file.write(b"</div>\n")
+ file_num += 1
+ else:
+ out_file.write(line)
diff --git a/grpc/third_party/upb/docs/vs-cpp-protos.md b/grpc/third_party/upb/docs/vs-cpp-protos.md
new file mode 100644
index 00000000..5d30c54a
--- /dev/null
+++ b/grpc/third_party/upb/docs/vs-cpp-protos.md
@@ -0,0 +1,254 @@
+
+# upb vs. C++ Protobuf Design
+
+[upb](https://github.com/protocolbuffers/upb) is a small C protobuf library.
+While some of the design follows in the footsteps of the C++ Protobuf Library,
+upb departs from C++'s design in several key ways. This document compares
+and contrasts the two libraries on several design points.
+
+## Design Goals
+
+Before we begin, it is worth calling out that upb and C++ have different design
+goals, and this motivates some of the differences we will see.
+
+C++ protobuf is a user-level library: it is designed to be used directly by C++
+applications. These applications will expect a full-featured C++ API surface
+that uses C++ idioms. The C++ library is also willing to add features to
+increase server performance, even if these features would add size or complexity
+to the library. Because C++ protobuf is a user-level library, API stability is
+of utmost importance: breaking API changes are rare and carefully managed when
+they do occur. The focus on C++ also means that ABI compatibility with C is not
+a priority.
+
+upb, on the other hand, is designed primarily to be wrapped by other languages.
+It is a C protobuf kernel that forms the basis on which a user-level protobuf
+library can be built. This means we prefer to keep the API surface as small and
+orthogonal as possible. While upb supports all protobuf features required for
+full conformance, upb prioritizes simplicity and small code size, and avoids
+adding features like lazy fields that can accelerate some use cases but at great
+cost in terms of complexity. As upb is not aimed directly at users, there is
+much more freedom to make API-breaking changes when necessary, which helps the
+core to stay small and simple. We want to be compatible with all FFI
+interfaces, so C ABI compatibility is a must.
+
+Despite these differences, C++ protos and upb offer [roughly the same core set
+of features](https://github.com/protocolbuffers/upb#features).
+
+## Arenas
+
+upb and C++ protos both offer arena allocation, but there are some key
+differences.
+
+### C++
+
+As a matter of history, when C++ protos were open-sourced in 2008, they did not
+support arenas. Originally there was only unique ownership, whereby each
+message uniquely owns all child messages and will free them when the parent is
+freed.
+
+Arena allocation was added as a feature in 2014 as a way of dramatically
+reducing allocation and (especially) deallocation costs. But the library was
+not at liberty to remove the unique ownership model, because it would break far
+too many users. As a result, C++ has supported a **hybrid allocation model**
+ever since, allowing users to allocate messages either directly from the
+stack/heap or from an arena. The library attempts to ensure that there are
+no dangling pointers by performing automatic copies in some cases (for example
+`a->set_allocated_b(b)`, where `a` and `b` are on different arenas).
+
+C++'s arena object itself `google::protobuf::Arena` is **thread-safe** by
+design, which allows users to allocate from multiple threads simultaneously
+without external synchronization. The user can supply an initial block of
+memory to the arena, and can choose some parameters to control the arena block
+size. The user can also supply block alloc/dealloc functions, but the alloc
+function is expected to always return some memory. The C++ library in general
+does not attempt to handle out of memory conditions.
+
+### upb
+
+upb uses **arena allocation exclusively**. All messages must be allocated from
+an arena, and can only be freed by freeing the arena. It is entirely the user's
+responsibility to ensure that there are no dangling pointers: when a user sets a
+message field, this will always trivially overwrite the pointer and will never
+perform an implicit copy.
+
+upb's `upb::Arena` is **thread-compatible**, which means it cannot be used
+concurrently without synchronization. The arena can be seeded with an initial
+block of memory, but it does not explicitly support any parameters for choosing
+block size. It support a custom alloc/dealloc function, and this function is
+allowed to return `NULL` if no dynamic memory is available. This allows upb
+arenas to have a max/fixed size, and makes it possible in theory to write code
+that is tolerant to out-of-memory errors.
+
+upb's arena also supports a novel operation known as **fuse**, which joins two
+arenas together into a single lifetime. Though both arenas must still be freed
+separately, none of the memory will actually be freed until *both* arenas have
+been freed. This is useful for avoiding dangling pointers when reparenting a
+message with one that may be on a different arena.
+
+### Comparison
+
+**hybrid allocation vs. arena-only**:
+* The C++ hybrid allocation model introduces a great deal of complexity and
+ unpredictability into the library. upb benefits from having a much simpler
+ and more predictable design.
+* Some of the complexity in C++'s hybrid model arises from the fact that arenas
+ were added after the fact. Designing for a hybrid model from the outset
+ would likely yield a simpler result.
+* Unique ownership does support some usage patterns that arenas cannot directly
+ accommodate. For example, you can reparent a message and the child will precisely
+ follow the lifetime of its new parent. An arena would require you to either
+ perform a deep copy or extend the lifetime.
+
+**thread-compatible vs. thread-safe arena**
+* A thread-safe arena (as in C++) is safer and easier to use. A thread-compatible
+ arena requires that the user prove that the arena cannot be used concurrently.
+* [Thread Sanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual)
+ is far more accessible than it was in 2014 (when C++ introduced a thread-safe
+ arena). We now have more tools at our disposal to ensure that we do not trigger
+ data races in a thread-compatible arena like upb.
+* Thread-compatible arenas are more performant.
+* Thread-compatible arenas have a far simpler implementation. The C++ thread-safe
+ arena relies on thread-local variables, which introduce complications on some
+ platforms. It also requires far more subtle reasoning for correctness and
+ performance.
+
+**fuse vs. no fuse**
+* The `upb_Arena_Fuse()` operation is a key part of how upb supports reparenting
+ of messages when the parent may be on a different arena. Without this, upb has
+ no way of supporting `foo.bar = bar` in dynamic languages without performing a
+ deep copy.
+* A downside of `upb_Arena_Fuse()` is that passing an arena to a function can allow
+ that function to extend the lifetime of the arena in potentially
+ unpredictable ways. This can be prevented if necessary, as fuse can fail, eg. if
+ one arena has an initial block. But this adds some complexity by requiring callers
+ to handle the case where fuse fails.
+
+## Code Generation vs. Tables
+
+The C++ protobuf library has always been built around code generation, while upb
+generates only tables. In other words, `foo.pb.cc` files contain functions,
+whereas `foo.upb.c` files emit only data structures.
+
+### C++
+
+C++ generated code emits a large number of functions into `foo.pb.cc` files.
+An incomplete list:
+
+* `FooMsg::FooMsg()` (constructor): initializes all fields to their default value.
+* `FooMsg::~FooMsg()` (destructor): frees any present child messages.
+* `FooMsg::Clear()`: clears all fields back to their default/empty value.
+* `FooMsg::_InternalParse()`: generated code for parsing a message.
+* `FooMsg::_InternalSerialize()`: generated code for serializing a message.
+* `FooMsg::ByteSizeLong()`: calculates serialized size, as a first pass before serializing.
+* `FooMsg::MergeFrom()`: copies/appends present fields from another message.
+* `FooMsg::IsInitialized()`: checks whether required fields are set.
+
+This code lives in the `.text` section and contains function calls to the generated
+classes for child messages.
+
+### upb
+
+upb does not generate any code into `foo.upb.c` files, only data structures. upb uses a
+compact data table known as a *mini table* to represent the schema and all fields.
+
+upb uses mini tables to perform all of the operations that would traditionally be done
+with generated code. Revisiting the list from the previous section:
+
+* `FooMsg::FooMsg()` (constructor): upb instead initializes all messages with `memset(msg, 0, size)`.
+ Non-zero defaults are injected in the accessors.
+* `FooMsg::~FooMsg()` (destructor): upb messages are freed by freeing the arena.
+* `FooMsg::Clear()`: can be performed with `memset(msg, 0, size)`.
+* `FooMsg::_InternalParse()`: upb's parser uses mini tables as data, instead of generating code.
+* `FooMsg::_InternalSerialize()`: upb's serializer also uses mini-tables instead of generated code.
+* `FooMsg::ByteSizeLong()`: upb performs serialization in reverse so that an initial pass is not required.
+* `FooMsg::MergeFrom()`: upb supports this via serialize+parse from the other message.
+* `FooMsg::IsInitialized()`: upb's encoder and decoder have special flags to check for required fields.
+ A util library `upb/util/required_fields.h` handles the corner cases.
+
+### Comparison
+
+If we compare compiled code size, upb is far smaller. Here is a comparison of the code
+size of a trivial binary that does nothing but a parse and serialize of `descriptor.proto`.
+This means we are seeing both the overhead of the core library itself as well as the
+generated code (or table) for `descriptor.proto`. (For extra clarity we should break this
+down by generated code vs core library in the future).
+
+
+| Library | `.text` | `.data` | `.bss` |
+|------------ |---------|---------|--------|
+| upb | 26Ki | 0.6Ki | 0.01Ki |
+| C++ (lite) | 187Ki | 2.8Ki | 1.25Ki |
+| C++ (code size) | 904Ki | 6.1Ki | 1.88Ki |
+| C++ (full) | 983Ki | 6.1Ki | 1.88Ki |
+
+"C++ (code size)" refers to protos compiled with `optimize_for = CODE_SIZE`, a mode
+in which generated code contains reflection only, in an attempt to make the
+generated code size smaller (however it requires the full runtime instead
+of the lite runtime).
+
+## Bifurcated vs. Optional Reflection
+
+upb and C++ protos both offer reflection without making it mandatory. However
+the models for enabling/disabling reflection are very different.
+
+### C++
+
+C++ messages offer full reflection by default. Messages in C++ generally
+derive from `Message`, and the base class provides a member function
+`Reflection* Message::GetReflection()` which returns the reflection object.
+
+It follows that any message deriving from `Message` will always have reflection
+linked into the binary, whether or not the reflection object is ever used.
+Because `GetReflection()` is a function on the base class, it is not possible
+to statically determine if a given message's reflection is used:
+
+```c++
+Reflection* GetReflection(const Message& message) {
+ // Can refer to any message in the whole binary.
+ return message.GetReflection();
+}
+```
+
+The C++ library does provide a way of omitting reflection: `MessageLite`. We can
+cause a message to be lite in two different ways:
+
+* `optimize_for = LITE_RUNTIME` in a `.proto` file will cause all messages in that
+ file to be lite.
+* `lite` as a codegen param: this will force all messages to lite, even if the
+ `.proto` file does not have `optimize_for = LITE_RUNTIME`.
+
+A lite message will derive from `MessageLite` instead of `Message`. Since
+`MessageLite` has no `GetReflection()` function, this means no reflection is
+available, so we can avoid taking the code size hit.
+
+### upb
+
+upb does not have the `Message` vs. `MessageLite` bifurcation. There is only one
+kind of message type `upb_Message`, which means there is no need to configure in
+a `.proto` file which messages will need reflection and which will not.
+Every message has the *option* to link in reflection from a separate `foo.upbdefs.o`
+file, without needing to change the message itself in any way.
+
+upb does not provide the equivalent of `Message::GetReflection()`: there is no
+facility for retrieving the reflection of a message whose type is not known statically.
+It would be possible to layer such a facility on top of the upb core, though this
+would probably require some kind of code generation.
+
+### Comparison
+
+* Most messages in C++ will not bother to declare themselves as "lite". This means
+ that many C++ messages will link in reflection even when it is never used, bloating
+ binaries unnecessarily.
+* `optimize_for = LITE_RUNTIME` is difficult to use in practice, because it prevents
+ any non-lite protos from `import`ing that file.
+* Forcing all protos to lite via a codegen parameter (for example, when building for
+ mobile) is more practical than `optimize_for = LITE_RUNTIME`. But this will break
+ the compile for any code that tries to upcast to `Message`, or tries to use a
+ non-lite method.
+* The one major advantage of the C++ model is that it can support `msg.DebugString()`
+ on a type-erased proto. For upb you have to explicitly pass the `upb_MessageDef*`
+ separately if you want to perform an operation like printing a proto to text format.
+
+## Explicit Registration vs. Globals
+
+TODO
diff --git a/grpc/third_party/upb/docs/wrapping-upb.in.md b/grpc/third_party/upb/docs/wrapping-upb.in.md
new file mode 100644
index 00000000..850fefe2
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb.in.md
@@ -0,0 +1,372 @@
+
+<!---
+This document contains embedded graphviz diagrams inside ```dot blocks.
+
+To convert it to rendered form using render.py:
+ $ ./render.py wrapping-upb.in.md
+
+You can also live-preview this document with all diagrams using Markdown Preview Enhanced
+in Visual Studio Code:
+ https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced
+--->
+
+# Wrapping upb in other languages
+
+upb is a C kernel that is designed to be wrapped in other languages. This is a
+guide for creating a new protobuf implementation based on upb.
+
+## What you will need
+
+There are certain things that the language runtime must provide in order to be
+wrapped by upb.
+
+1. **Finalizers, Destructors, or Cleaners**: This is one unavoidable
+ requirement: the language *must* provide finalizers or destructors of some sort.
+ There must be a way of calling a C function when the language GCs or otherwise
+ destroys an object. We don't care much whether it is a finalizer, a destructor,
+ or a cleaner, as long as it gets called eventually when the object is destroyed.
+ Without finalizers, we would have no way of cleaning up upb data and everything
+ would leak.
+2. **HashMap with weak values**: This is not an absolute requirement, but in
+ languages with automatic memory management, we generally end up wanting a
+ hash map with weak values to act as a `upb_msg* -> wrapper` object cache.
+ We want the values to be weak (not the keys).
+
+## Reflection vs. Direct Access
+
+Each language wrapping upb gets to decide whether it will access messages
+through *reflection* or through *direct access*. This decision has some deep
+implications that will affect the design, features, and performance of your
+library.
+
+### Reflection
+
+The simplest option is to load full reflection data into the upb library at
+runtime. You can load reflection data using serialized descriptors, which are a
+stable and widely supported format across all protobuf tooling.
+
+```c
+ // A upb_symtab is a dynamic container that we can load reflection data into.
+ upb_symtab* symtab = upb_symtab_new();
+
+ // We load reflection data via a serialized descriptor. The code generator
+ // for your language should embed serialized descriptors into your generated
+ // files. For each generated file loaded by your library, you can add the
+ // serialized descriptor to the symtab as shown.
+ upb_arena *tmp = upb_arena_new();
+ google_protobuf_FileDescriptorProto* file =
+ google_protobuf_FileDescriptorProto_parse(desc_data, desc_size, tmp);
+ if (!file || !upb_symtab_addfile(symtab, file, NULL)) {
+ // Handle error.
+ }
+ upb_arena_free(tmp);
+
+ // At application exit, we free the symtab.
+ upb_symtab_free(symtab);
+```
+
+The `upb_symtab` will give you full access to all data from the `.proto` file,
+including convenient APIs like looking up a field by name. It will allow you to
+use JSON and text format. The APIs for accessing a message through reflection
+are simple and well-supported. These APIs cleanly encapsulate upb's internal
+implementation details.
+
+```c
+ upb_symtab* symtab = BuildSymtab();
+
+ // Look up a message type in the symtab.
+ const upb_msgdef* m = upb_symtab_lookupmsg(symtab, "FooMessage");
+
+ // Construct a new message of this type, via reflection.
+ upb_arena *arena = upb_arena_new();
+ upb_msg *msg = upb_msg_new(m, arena);
+
+ // Set a message field using reflection.
+ const upb_fielddef* f = upb_msgdef_ntof("bar_field");
+ upb_msgval val = {.int32_val = 123};
+ upb_msg_set(m, f, val, arena);
+
+ // Free the message and symtab.
+ upb_arena_free(arena);
+ upb_symtab_free(symtab);
+```
+
+Using reflection is a natural choice in heavily reflective, dynamic runtimes
+like Python, Ruby, PHP, or Lua. These languages generally perform method
+dispatch through a dictionary/hash table anyway, so we are not adding any extra
+overhead by using upb's hash table to lookup fields by name at field access
+time.
+
+### Direct Access
+
+Using reflection has some downsides. Reflection data is relatively large, both
+in your binary (at rest) and in RAM (at runtime). It contains names of
+everything, and these names will be exposed in your binary. Reflection APIs for
+accessing a message will have more overhead than you might want, especially if
+crossing the FFI boundary for your language runtime imposes significant
+overhead.
+
+We can reduce these overheads by using *direct access*. upb's parser and
+serializer do not actually require full reflection data, they use a more compact
+data structure known as **mini tables**. Mini tables will take up less space
+than reflection, both in the binary and in RAM, and they will not leak field
+names. Mini tables will let us parse and serialize binary wire format data
+without reflection.
+
+```c
+ // TODO: demonstrate upb API for loading mini table data at runtime.
+ // This API does not exist yet.
+```
+
+To access messages themselves without the reflection API, we will be using
+different, lower-level APIs that will require you to supply precise data such as
+the offset of a given field. This is information that will come from the upb
+compiler framework, and the correctness (and even memory safety!) of the program
+will rely on you passing these values through from the upb compiler libraries to
+the upb runtime correctly.
+
+```c
+ // TODO: demonstrate using low-level APIs for direct field access.
+ // These APIs do not exist yet.
+```
+
+It can even be possible in certain circumstances to bypass the upb API completely
+and access raw field data directly at a given offset, using unsafe APIs like
+`sun.misc.unsafe`. This can theoretically allow for field access that is no
+more expensive than referencing a struct/class field.
+
+```java
+import sun.misc.Unsafe;
+
+class FooProto {
+ private final long addr;
+ private final Arena arena;
+
+ // Accessor that a Java library built on upb could conceivably generate.
+ long getFoo() {
+ // The offset 1234 came from the upb compiler library, and was injected by the
+ // Java+upb code generator.
+ return Unsafe.getLong(self.addr + 1234);
+ }
+}
+```
+
+It is always possible to load reflection data as desired, even if your library
+is designed primarily around direct access. Users who want to use JSON, text
+format, or reflection could potentially load reflection data from separate
+generated modules, for cases where they do not mind the size overhead or the
+leaking of field names. You do not give up any of these possibilities by using
+direct access.
+
+However, using direct access does have some noticeable downsides. It requires
+tighter coupling with upb's implementation details, as the mini table format is
+upb-specific and requires building your code generator against upb's compiler
+libraries. Any direct access of memory is especially tightly coupled, and would
+need to be changed if upb's in-memory format ever changes. It also is more
+prone to hard-to-debug memory errors if you make any mistakes.
+
+## Memory Management
+
+One of the core design challenges when wrapping upb is memory management. Every
+language runtime will have some memory management system, whether it is
+garbage collection, reference counting, manual memory management, or some hybrid
+of these. upb is written in C and uses arenas for memory management, but upb is
+designed to integrate with a wide variety of memory management schemes, and it
+provides a number of tools for making this integration as smooth as possible.
+
+### Arenas
+
+upb defines data structures in C to represent messages, arrays (repeated
+fields), and maps. A protobuf message is a hierarchical tree of these objects.
+For example, a relatively simple protobuf tree might look something like this:
+
+```dot {align="center"}
+digraph G {
+ rankdir=LR;
+ newrank=true;
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=1, ordering=out]
+ upb_msg -> upb_msg2;
+ upb_msg -> upb_array;
+ upb_msg [label="upb Message" fillcolor=1]
+ upb_msg2 [label="upb Message"];
+ upb_array [label="upb Array"]
+}
+```
+
+All upb objects are allocated from an arena. An arena lets you allocate objects
+individually, but you cannot free individual objects; you can only free the arena
+as a whole. When the arena is freed, all of the individual objects allocated
+from that arena are freed together.
+
+```dot {align="center"}
+digraph G {
+ rankdir=LR;
+ newrank=true;
+ subgraph cluster_0 {
+ label = "upb Arena"
+ graph[style="rounded,filled" fillcolor=gray]
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=1, ordering=out]
+ upb_msg -> upb_array;
+ upb_msg -> upb_msg2;
+ upb_msg [label="upb Message" fillcolor=1]
+ upb_msg2 [label="upb Message"];
+ upb_array [label="upb Array"];
+ }
+}
+```
+
+In simple cases, the entire tree of objects will all live in a single arena.
+This has the nice property that there cannot be any dangling pointers between
+objects, since all objects are freed at the same time.
+
+However upb allows you to create links between any two objects, whether or
+not they are in the same arena. The library does not know or care what arenas
+the objects are in when you create links between them.
+
+```dot {align="center"}
+digraph G {
+ rankdir=LR;
+ newrank=true;
+ subgraph cluster_0 {
+ label = "upb Arena 1"
+ graph[style="rounded,filled" fillcolor=gray]
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=1, ordering=out]
+ upb_msg -> upb_array;
+ upb_msg -> upb_msg2;
+ upb_msg [label="upb Message 1" fillcolor=1]
+ upb_msg2 [label="upb Message 2"];
+ upb_array [label="upb Array"];
+ }
+ subgraph cluster_1 {
+ label = "upb Arena 2"
+ graph[style="rounded,filled" fillcolor=gray]
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=1]
+ upb_msg3;
+ }
+ upb_msg2 -> upb_msg3;
+ upb_msg3 [label="upb Message 3"];
+}
+```
+
+When objects are on separate arenas, it is the user's responsibility to ensure
+that there are no dangling pointers. In the example above, this means Arena 2
+must outlive Message 1 and Message 2.
+
+### Integrating GC with upb
+
+In languages with automatic memory management, the goal is to handle all of the
+arenas behind the scenes, so that the user does not have to manage them manually
+or even know that they exist.
+
+We can achieve this goal if we set up the object graph in a particular way. The
+general strategy is to create wrapper objects around all of the C objects,
+including the arena. Our key goal is to make sure the arena wrapper is not
+GC'd until all of the C objects in that arena have become unreachable.
+
+For this example, we will assume we are wrapping upb in Python:
+
+```dot {align="center"}
+digraph G {
+ rankdir=LR;
+ newrank=true;
+ compound=true;
+
+ subgraph cluster_1 {
+ label = "upb Arena"
+ graph[style="rounded,filled" fillcolor=gray]
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=1, ordering=out]
+ upb_msg -> upb_array [style=dashed];
+ upb_msg -> upb_msg2 [style=dashed];
+ upb_msg [label="upb Message" fillcolor=1]
+ upb_msg2 [label="upb Message"];
+ upb_array [label="upb Array"]
+ dummy [style=invis]
+ }
+ subgraph cluster_python {
+ node [style="rounded,filled" shape=box colorscheme=accent8 fillcolor=2]
+ peripheries=0
+ py_upb_msg [label="Python Message"];
+ py_upb_msg2 [label="Python Message"];
+ py_upb_arena [label="Python Arena"];
+ }
+ py_upb_msg -> upb_msg [style=dashed];
+ py_upb_msg2->upb_msg2 [style=dashed];
+ py_upb_msg2 -> py_upb_arena [color=springgreen4];
+ py_upb_msg -> py_upb_arena [color=springgreen4];
+ py_upb_arena -> dummy [lhead=cluster_1, color=red];
+ {
+ rank=same;
+ upb_msg;
+ py_upb_msg;
+ }
+ {
+ rank=same;
+ upb_array;
+ upb_msg2;
+ py_upb_msg2;
+ }
+ { rank=same;
+ dummy;
+ py_upb_arena;
+ }
+ dummy->upb_array [style=invis];
+ dummy->upb_msg2 [style=invis];
+
+ subgraph cluster_01 {
+ node [shape=plaintext]
+ peripheries=0
+ key [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
+ <tr><td align="right" port="i1">raw ptr</td></tr>
+ <tr><td align="right" port="i2">unique ptr</td></tr>
+ <tr><td align="right" port="i3">shared (GC) ptr</td></tr>
+ </table>>]
+ key2 [label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
+ <tr><td port="i1">&nbsp;</td></tr>
+ <tr><td port="i2">&nbsp;</td></tr>
+ <tr><td port="i3">&nbsp;</td></tr>
+ </table>>]
+ key:i1:e -> key2:i1:w [style=dashed]
+ key:i2:e -> key2:i2:w [color=red]
+ key:i3:e -> key2:i3:w [color=springgreen4]
+ }
+ key2:i1:w -> upb_msg [style=invis];
+ {
+ rank=same;
+ key;
+ upb_msg;
+ }
+}
+```
+
+In this example we have three different kinds of pointers:
+
+* **raw ptr**: This is a pointer that carries no ownership.
+* **unique ptr**: This is a pointer has *unique ownership* of the target. The owner
+ will free the target in its destructor (or finalizer, or cleaner). There can
+ only be a single unique pointer to a given object.
+* **shared (GC) ptr**: This is a pointer that has *shared ownership* of the
+ target. Many objects can point to the target, and the target will be deleted
+ only when all such references are gone. In a runtime with automatic memory
+ management (GC), this is a reference that participates in GC. In Python such
+ references use reference counting, but in other VMs they may use mark and
+ sweep or some other form of GC instead.
+
+The Python Message wrappers have only raw pointers to the underlying message,
+but they contain a shared pointer to the arena that will ensure that the raw
+pointer remains valid. Only when all message wrapper objects are destroyed
+will the Python Arena become unreachable, and the upb arena ultimately freed.
+
+### Links between arenas with "Fuse"
+
+The design given above works well for objects that live in a single arena. But
+what if a user wants to create a link between two objects in different arenas?
+
+TODO
+
+## UTF-8 vs. UTF-16
+
+TODO
+
+## Object Cache
+
+TODO
diff --git a/grpc/third_party/upb/docs/wrapping-upb.md b/grpc/third_party/upb/docs/wrapping-upb.md
new file mode 100644
index 00000000..ad35428d
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb.md
@@ -0,0 +1,260 @@
+
+<!---
+This document contains embedded graphviz diagrams inside ```dot blocks.
+
+To convert it to rendered form using render.py:
+ $ ./render.py wrapping-upb.in.md
+
+You can also live-preview this document with all diagrams using Markdown Preview Enhanced
+in Visual Studio Code:
+ https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced
+--->
+
+# Wrapping upb in other languages
+
+upb is a C kernel that is designed to be wrapped in other languages. This is a
+guide for creating a new protobuf implementation based on upb.
+
+## What you will need
+
+There are certain things that the language runtime must provide in order to be
+wrapped by upb.
+
+1. **Finalizers, Destructors, or Cleaners**: This is one unavoidable
+ requirement: the language *must* provide finalizers or destructors of some sort.
+ There must be a way of calling a C function when the language GCs or otherwise
+ destroys an object. We don't care much whether it is a finalizer, a destructor,
+ or a cleaner, as long as it gets called eventually when the object is destroyed.
+ Without finalizers, we would have no way of cleaning up upb data and everything
+ would leak.
+2. **HashMap with weak values**: This is not an absolute requirement, but in
+ languages with automatic memory management, we generally end up wanting a
+ hash map with weak values to act as a `upb_msg* -> wrapper` object cache.
+ We want the values to be weak (not the keys).
+
+## Reflection vs. Direct Access
+
+Each language wrapping upb gets to decide whether it will access messages
+through *reflection* or through *direct access*. This decision has some deep
+implications that will affect the design, features, and performance of your
+library.
+
+### Reflection
+
+The simplest option is to load full reflection data into the upb library at
+runtime. You can load reflection data using serialized descriptors, which are a
+stable and widely supported format across all protobuf tooling.
+
+```c
+ // A upb_symtab is a dynamic container that we can load reflection data into.
+ upb_symtab* symtab = upb_symtab_new();
+
+ // We load reflection data via a serialized descriptor. The code generator
+ // for your language should embed serialized descriptors into your generated
+ // files. For each generated file loaded by your library, you can add the
+ // serialized descriptor to the symtab as shown.
+ upb_arena *tmp = upb_arena_new();
+ google_protobuf_FileDescriptorProto* file =
+ google_protobuf_FileDescriptorProto_parse(desc_data, desc_size, tmp);
+ if (!file || !upb_symtab_addfile(symtab, file, NULL)) {
+ // Handle error.
+ }
+ upb_arena_free(tmp);
+
+ // At application exit, we free the symtab.
+ upb_symtab_free(symtab);
+```
+
+The `upb_symtab` will give you full access to all data from the `.proto` file,
+including convenient APIs like looking up a field by name. It will allow you to
+use JSON and text format. The APIs for accessing a message through reflection
+are simple and well-supported. These APIs cleanly encapsulate upb's internal
+implementation details.
+
+```c
+ upb_symtab* symtab = BuildSymtab();
+
+ // Look up a message type in the symtab.
+ const upb_msgdef* m = upb_symtab_lookupmsg(symtab, "FooMessage");
+
+ // Construct a new message of this type, via reflection.
+ upb_arena *arena = upb_arena_new();
+ upb_msg *msg = upb_msg_new(m, arena);
+
+ // Set a message field using reflection.
+ const upb_fielddef* f = upb_msgdef_ntof("bar_field");
+ upb_msgval val = {.int32_val = 123};
+ upb_msg_set(m, f, val, arena);
+
+ // Free the message and symtab.
+ upb_arena_free(arena);
+ upb_symtab_free(symtab);
+```
+
+Using reflection is a natural choice in heavily reflective, dynamic runtimes
+like Python, Ruby, PHP, or Lua. These languages generally perform method
+dispatch through a dictionary/hash table anyway, so we are not adding any extra
+overhead by using upb's hash table to lookup fields by name at field access
+time.
+
+### Direct Access
+
+Using reflection has some downsides. Reflection data is relatively large, both
+in your binary (at rest) and in RAM (at runtime). It contains names of
+everything, and these names will be exposed in your binary. Reflection APIs for
+accessing a message will have more overhead than you might want, especially if
+crossing the FFI boundary for your language runtime imposes significant
+overhead.
+
+We can reduce these overheads by using *direct access*. upb's parser and
+serializer do not actually require full reflection data, they use a more compact
+data structure known as **mini tables**. Mini tables will take up less space
+than reflection, both in the binary and in RAM, and they will not leak field
+names. Mini tables will let us parse and serialize binary wire format data
+without reflection.
+
+```c
+ // TODO: demonstrate upb API for loading mini table data at runtime.
+ // This API does not exist yet.
+```
+
+To access messages themselves without the reflection API, we will be using
+different, lower-level APIs that will require you to supply precise data such as
+the offset of a given field. This is information that will come from the upb
+compiler framework, and the correctness (and even memory safety!) of the program
+will rely on you passing these values through from the upb compiler libraries to
+the upb runtime correctly.
+
+```c
+ // TODO: demonstrate using low-level APIs for direct field access.
+ // These APIs do not exist yet.
+```
+
+It can even be possible in certain circumstances to bypass the upb API completely
+and access raw field data directly at a given offset, using unsafe APIs like
+`sun.misc.unsafe`. This can theoretically allow for field access that is no
+more expensive than referencing a struct/class field.
+
+```java
+import sun.misc.Unsafe;
+
+class FooProto {
+ private final long addr;
+ private final Arena arena;
+
+ // Accessor that a Java library built on upb could conceivably generate.
+ long getFoo() {
+ // The offset 1234 came from the upb compiler library, and was injected by the
+ // Java+upb code generator.
+ return Unsafe.getLong(self.addr + 1234);
+ }
+}
+```
+
+It is always possible to load reflection data as desired, even if your library
+is designed primarily around direct access. Users who want to use JSON, text
+format, or reflection could potentially load reflection data from separate
+generated modules, for cases where they do not mind the size overhead or the
+leaking of field names. You do not give up any of these possibilities by using
+direct access.
+
+However, using direct access does have some noticeable downsides. It requires
+tighter coupling with upb's implementation details, as the mini table format is
+upb-specific and requires building your code generator against upb's compiler
+libraries. Any direct access of memory is especially tightly coupled, and would
+need to be changed if upb's in-memory format ever changes. It also is more
+prone to hard-to-debug memory errors if you make any mistakes.
+
+## Memory Management
+
+One of the core design challenges when wrapping upb is memory management. Every
+language runtime will have some memory management system, whether it is
+garbage collection, reference counting, manual memory management, or some hybrid
+of these. upb is written in C and uses arenas for memory management, but upb is
+designed to integrate with a wide variety of memory management schemes, and it
+provides a number of tools for making this integration as smooth as possible.
+
+### Arenas
+
+upb defines data structures in C to represent messages, arrays (repeated
+fields), and maps. A protobuf message is a hierarchical tree of these objects.
+For example, a relatively simple protobuf tree might look something like this:
+
+<div align=center>
+<img src='wrapping-upb/1.svg'/>
+</div>
+
+All upb objects are allocated from an arena. An arena lets you allocate objects
+individually, but you cannot free individual objects; you can only free the arena
+as a whole. When the arena is freed, all of the individual objects allocated
+from that arena are freed together.
+
+<div align=center>
+<img src='wrapping-upb/2.svg'/>
+</div>
+
+In simple cases, the entire tree of objects will all live in a single arena.
+This has the nice property that there cannot be any dangling pointers between
+objects, since all objects are freed at the same time.
+
+However upb allows you to create links between any two objects, whether or
+not they are in the same arena. The library does not know or care what arenas
+the objects are in when you create links between them.
+
+<div align=center>
+<img src='wrapping-upb/3.svg'/>
+</div>
+
+When objects are on separate arenas, it is the user's responsibility to ensure
+that there are no dangling pointers. In the example above, this means Arena 2
+must outlive Message 1 and Message 2.
+
+### Integrating GC with upb
+
+In languages with automatic memory management, the goal is to handle all of the
+arenas behind the scenes, so that the user does not have to manage them manually
+or even know that they exist.
+
+We can achieve this goal if we set up the object graph in a particular way. The
+general strategy is to create wrapper objects around all of the C objects,
+including the arena. Our key goal is to make sure the arena wrapper is not
+GC'd until all of the C objects in that arena have become unreachable.
+
+For this example, we will assume we are wrapping upb in Python:
+
+<div align=center>
+<img src='wrapping-upb/4.svg'/>
+</div>
+
+In this example we have three different kinds of pointers:
+
+* **raw ptr**: This is a pointer that carries no ownership.
+* **unique ptr**: This is a pointer has *unique ownership* of the target. The owner
+ will free the target in its destructor (or finalizer, or cleaner). There can
+ only be a single unique pointer to a given object.
+* **shared (GC) ptr**: This is a pointer that has *shared ownership* of the
+ target. Many objects can point to the target, and the target will be deleted
+ only when all such references are gone. In a runtime with automatic memory
+ management (GC), this is a reference that participates in GC. In Python such
+ references use reference counting, but in other VMs they may use mark and
+ sweep or some other form of GC instead.
+
+The Python Message wrappers have only raw pointers to the underlying message,
+but they contain a shared pointer to the arena that will ensure that the raw
+pointer remains valid. Only when all message wrapper objects are destroyed
+will the Python Arena become unreachable, and the upb arena ultimately freed.
+
+### Links between arenas with "Fuse"
+
+The design given above works well for objects that live in a single arena. But
+what if a user wants to create a link between two objects in different arenas?
+
+TODO
+
+## UTF-8 vs. UTF-16
+
+TODO
+
+## Object Cache
+
+TODO
diff --git a/grpc/third_party/upb/docs/wrapping-upb/1.svg b/grpc/third_party/upb/docs/wrapping-upb/1.svg
new file mode 100644
index 00000000..bb918324
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb/1.svg
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.43.0 (0)
+ -->
+<!-- Title: G Pages: 1 -->
+<svg width="222pt" height="98pt"
+ viewBox="0.00 0.00 222.00 98.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 94)">
+<title>G</title>
+<polygon fill="white" stroke="transparent" points="-4,4 -4,-94 218,-94 218,4 -4,4"/>
+<!-- upb_msg -->
+<g id="node1" class="node">
+<title>upb_msg</title>
+<path fill="#7fc97f" stroke="black" d="M77,-63C77,-63 12,-63 12,-63 6,-63 0,-57 0,-51 0,-51 0,-39 0,-39 0,-33 6,-27 12,-27 12,-27 77,-27 77,-27 83,-27 89,-33 89,-39 89,-39 89,-51 89,-51 89,-57 83,-63 77,-63"/>
+<text text-anchor="middle" x="44.5" y="-41.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_msg2 -->
+<g id="node2" class="node">
+<title>upb_msg2</title>
+<path fill="#7fc97f" stroke="black" d="M202,-90C202,-90 137,-90 137,-90 131,-90 125,-84 125,-78 125,-78 125,-66 125,-66 125,-60 131,-54 137,-54 137,-54 202,-54 202,-54 208,-54 214,-60 214,-66 214,-66 214,-78 214,-78 214,-84 208,-90 202,-90"/>
+<text text-anchor="middle" x="169.5" y="-68.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_msg2 -->
+<g id="edge1" class="edge">
+<title>upb_msg&#45;&gt;upb_msg2</title>
+<path fill="none" stroke="black" d="M89.21,-54.6C97.55,-56.43 106.36,-58.36 114.97,-60.25"/>
+<polygon fill="black" stroke="black" points="114.41,-63.71 124.93,-62.44 115.91,-56.87 114.41,-63.71"/>
+</g>
+<!-- upb_array -->
+<g id="node3" class="node">
+<title>upb_array</title>
+<path fill="#7fc97f" stroke="black" d="M193,-36C193,-36 146,-36 146,-36 140,-36 134,-30 134,-24 134,-24 134,-12 134,-12 134,-6 140,0 146,0 146,0 193,0 193,0 199,0 205,-6 205,-12 205,-12 205,-24 205,-24 205,-30 199,-36 193,-36"/>
+<text text-anchor="middle" x="169.5" y="-14.3" font-family="Times,serif" font-size="14.00">upb Array</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_array -->
+<g id="edge2" class="edge">
+<title>upb_msg&#45;&gt;upb_array</title>
+<path fill="none" stroke="black" d="M89.21,-35.4C100.42,-32.94 112.49,-30.3 123.75,-27.82"/>
+<polygon fill="black" stroke="black" points="124.8,-31.18 133.81,-25.61 123.3,-24.34 124.8,-31.18"/>
+</g>
+</g>
+</svg>
diff --git a/grpc/third_party/upb/docs/wrapping-upb/2.svg b/grpc/third_party/upb/docs/wrapping-upb/2.svg
new file mode 100644
index 00000000..7752f820
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb/2.svg
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.43.0 (0)
+ -->
+<!-- Title: G Pages: 1 -->
+<svg width="254pt" height="153pt"
+ viewBox="0.00 0.00 254.00 153.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 149)">
+<title>G</title>
+<polygon fill="white" stroke="transparent" points="-4,4 -4,-149 250,-149 250,4 -4,4"/>
+<g id="clust1" class="cluster">
+<title>cluster_0</title>
+<path fill="gray" stroke="black" d="M20,-8C20,-8 226,-8 226,-8 232,-8 238,-14 238,-20 238,-20 238,-125 238,-125 238,-131 232,-137 226,-137 226,-137 20,-137 20,-137 14,-137 8,-131 8,-125 8,-125 8,-20 8,-20 8,-14 14,-8 20,-8"/>
+<text text-anchor="middle" x="123" y="-121.8" font-family="Times,serif" font-size="14.00">upb Arena</text>
+</g>
+<!-- upb_msg -->
+<g id="node1" class="node">
+<title>upb_msg</title>
+<path fill="#7fc97f" stroke="black" d="M93,-79C93,-79 28,-79 28,-79 22,-79 16,-73 16,-67 16,-67 16,-55 16,-55 16,-49 22,-43 28,-43 28,-43 93,-43 93,-43 99,-43 105,-49 105,-55 105,-55 105,-67 105,-67 105,-73 99,-79 93,-79"/>
+<text text-anchor="middle" x="60.5" y="-57.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_array -->
+<g id="node2" class="node">
+<title>upb_array</title>
+<path fill="#7fc97f" stroke="black" d="M209,-52C209,-52 162,-52 162,-52 156,-52 150,-46 150,-40 150,-40 150,-28 150,-28 150,-22 156,-16 162,-16 162,-16 209,-16 209,-16 215,-16 221,-22 221,-28 221,-28 221,-40 221,-40 221,-46 215,-52 209,-52"/>
+<text text-anchor="middle" x="185.5" y="-30.3" font-family="Times,serif" font-size="14.00">upb Array</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_array -->
+<g id="edge1" class="edge">
+<title>upb_msg&#45;&gt;upb_array</title>
+<path fill="none" stroke="black" d="M105.21,-51.4C116.42,-48.94 128.49,-46.3 139.75,-43.82"/>
+<polygon fill="black" stroke="black" points="140.8,-47.18 149.81,-41.61 139.3,-40.34 140.8,-47.18"/>
+</g>
+<!-- upb_msg2 -->
+<g id="node3" class="node">
+<title>upb_msg2</title>
+<path fill="#7fc97f" stroke="black" d="M218,-106C218,-106 153,-106 153,-106 147,-106 141,-100 141,-94 141,-94 141,-82 141,-82 141,-76 147,-70 153,-70 153,-70 218,-70 218,-70 224,-70 230,-76 230,-82 230,-82 230,-94 230,-94 230,-100 224,-106 218,-106"/>
+<text text-anchor="middle" x="185.5" y="-84.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_msg2 -->
+<g id="edge2" class="edge">
+<title>upb_msg&#45;&gt;upb_msg2</title>
+<path fill="none" stroke="black" d="M105.21,-70.6C113.55,-72.43 122.36,-74.36 130.97,-76.25"/>
+<polygon fill="black" stroke="black" points="130.41,-79.71 140.93,-78.44 131.91,-72.87 130.41,-79.71"/>
+</g>
+</g>
+</svg>
diff --git a/grpc/third_party/upb/docs/wrapping-upb/3.svg b/grpc/third_party/upb/docs/wrapping-upb/3.svg
new file mode 100644
index 00000000..495504f6
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb/3.svg
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.43.0 (0)
+ -->
+<!-- Title: G Pages: 1 -->
+<svg width="409pt" height="153pt"
+ viewBox="0.00 0.00 409.00 153.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 149)">
+<title>G</title>
+<polygon fill="white" stroke="transparent" points="-4,4 -4,-149 405,-149 405,4 -4,4"/>
+<g id="clust1" class="cluster">
+<title>cluster_0</title>
+<path fill="gray" stroke="black" d="M20,-8C20,-8 246,-8 246,-8 252,-8 258,-14 258,-20 258,-20 258,-125 258,-125 258,-131 252,-137 246,-137 246,-137 20,-137 20,-137 14,-137 8,-131 8,-125 8,-125 8,-20 8,-20 8,-14 14,-8 20,-8"/>
+<text text-anchor="middle" x="133" y="-121.8" font-family="Times,serif" font-size="14.00">upb Arena 1</text>
+</g>
+<g id="clust2" class="cluster">
+<title>cluster_1</title>
+<path fill="gray" stroke="black" d="M290,-62C290,-62 381,-62 381,-62 387,-62 393,-68 393,-74 393,-74 393,-125 393,-125 393,-131 387,-137 381,-137 381,-137 290,-137 290,-137 284,-137 278,-131 278,-125 278,-125 278,-74 278,-74 278,-68 284,-62 290,-62"/>
+<text text-anchor="middle" x="335.5" y="-121.8" font-family="Times,serif" font-size="14.00">upb Arena 2</text>
+</g>
+<!-- upb_msg -->
+<g id="node1" class="node">
+<title>upb_msg</title>
+<path fill="#7fc97f" stroke="black" d="M103,-79C103,-79 28,-79 28,-79 22,-79 16,-73 16,-67 16,-67 16,-55 16,-55 16,-49 22,-43 28,-43 28,-43 103,-43 103,-43 109,-43 115,-49 115,-55 115,-55 115,-67 115,-67 115,-73 109,-79 103,-79"/>
+<text text-anchor="middle" x="65.5" y="-57.3" font-family="Times,serif" font-size="14.00">upb Message 1</text>
+</g>
+<!-- upb_array -->
+<g id="node2" class="node">
+<title>upb_array</title>
+<path fill="#7fc97f" stroke="black" d="M224,-52C224,-52 177,-52 177,-52 171,-52 165,-46 165,-40 165,-40 165,-28 165,-28 165,-22 171,-16 177,-16 177,-16 224,-16 224,-16 230,-16 236,-22 236,-28 236,-28 236,-40 236,-40 236,-46 230,-52 224,-52"/>
+<text text-anchor="middle" x="200.5" y="-30.3" font-family="Times,serif" font-size="14.00">upb Array</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_array -->
+<g id="edge1" class="edge">
+<title>upb_msg&#45;&gt;upb_array</title>
+<path fill="none" stroke="black" d="M115.27,-51.1C128.26,-48.46 142.22,-45.63 154.96,-43.04"/>
+<polygon fill="black" stroke="black" points="155.78,-46.45 164.88,-41.03 154.39,-39.59 155.78,-46.45"/>
+</g>
+<!-- upb_msg2 -->
+<g id="node3" class="node">
+<title>upb_msg2</title>
+<path fill="#7fc97f" stroke="black" d="M238,-106C238,-106 163,-106 163,-106 157,-106 151,-100 151,-94 151,-94 151,-82 151,-82 151,-76 157,-70 163,-70 163,-70 238,-70 238,-70 244,-70 250,-76 250,-82 250,-82 250,-94 250,-94 250,-100 244,-106 238,-106"/>
+<text text-anchor="middle" x="200.5" y="-84.3" font-family="Times,serif" font-size="14.00">upb Message 2</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_msg2 -->
+<g id="edge2" class="edge">
+<title>upb_msg&#45;&gt;upb_msg2</title>
+<path fill="none" stroke="black" d="M115.27,-70.9C123.58,-72.59 132.29,-74.36 140.83,-76.09"/>
+<polygon fill="black" stroke="black" points="140.24,-79.54 150.74,-78.1 141.63,-72.68 140.24,-79.54"/>
+</g>
+<!-- upb_msg3 -->
+<g id="node4" class="node">
+<title>upb_msg3</title>
+<path fill="#7fc97f" stroke="black" d="M373,-106C373,-106 298,-106 298,-106 292,-106 286,-100 286,-94 286,-94 286,-82 286,-82 286,-76 292,-70 298,-70 298,-70 373,-70 373,-70 379,-70 385,-76 385,-82 385,-82 385,-94 385,-94 385,-100 379,-106 373,-106"/>
+<text text-anchor="middle" x="335.5" y="-84.3" font-family="Times,serif" font-size="14.00">upb Message 3</text>
+</g>
+<!-- upb_msg2&#45;&gt;upb_msg3 -->
+<g id="edge3" class="edge">
+<title>upb_msg2&#45;&gt;upb_msg3</title>
+<path fill="none" stroke="black" d="M250.27,-88C258.49,-88 267.1,-88 275.55,-88"/>
+<polygon fill="black" stroke="black" points="275.74,-91.5 285.74,-88 275.74,-84.5 275.74,-91.5"/>
+</g>
+</g>
+</svg>
diff --git a/grpc/third_party/upb/docs/wrapping-upb/4.svg b/grpc/third_party/upb/docs/wrapping-upb/4.svg
new file mode 100644
index 00000000..2b5d2dfa
--- /dev/null
+++ b/grpc/third_party/upb/docs/wrapping-upb/4.svg
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.43.0 (0)
+ -->
+<!-- Title: G Pages: 1 -->
+<svg width="417pt" height="303pt"
+ viewBox="0.00 0.00 417.00 303.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 299)">
+<title>G</title>
+<polygon fill="white" stroke="transparent" points="-4,4 -4,-299 413,-299 413,4 -4,4"/>
+<g id="clust1" class="cluster">
+<title>cluster_1</title>
+<path fill="gray" stroke="black" d="M29,-98C29,-98 380,-98 380,-98 386,-98 392,-104 392,-110 392,-110 392,-215 392,-215 392,-221 386,-227 380,-227 380,-227 29,-227 29,-227 23,-227 17,-221 17,-215 17,-215 17,-110 17,-110 17,-104 23,-98 29,-98"/>
+<text text-anchor="middle" x="204.5" y="-211.8" font-family="Times,serif" font-size="14.00">upb Arena</text>
+</g>
+<g id="clust2" class="cluster">
+<title>cluster_python</title>
+</g>
+<g id="clust6" class="cluster">
+<title>cluster_01</title>
+</g>
+<!-- upb_msg -->
+<g id="node1" class="node">
+<title>upb_msg</title>
+<path fill="#7fc97f" stroke="black" d="M102,-169C102,-169 37,-169 37,-169 31,-169 25,-163 25,-157 25,-157 25,-145 25,-145 25,-139 31,-133 37,-133 37,-133 102,-133 102,-133 108,-133 114,-139 114,-145 114,-145 114,-157 114,-157 114,-163 108,-169 102,-169"/>
+<text text-anchor="middle" x="69.5" y="-147.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_array -->
+<g id="node2" class="node">
+<title>upb_array</title>
+<path fill="#7fc97f" stroke="black" d="M363,-142C363,-142 316,-142 316,-142 310,-142 304,-136 304,-130 304,-130 304,-118 304,-118 304,-112 310,-106 316,-106 316,-106 363,-106 363,-106 369,-106 375,-112 375,-118 375,-118 375,-130 375,-130 375,-136 369,-142 363,-142"/>
+<text text-anchor="middle" x="339.5" y="-120.3" font-family="Times,serif" font-size="14.00">upb Array</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_array -->
+<g id="edge1" class="edge">
+<title>upb_msg&#45;&gt;upb_array</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M114.33,-139.43C128.49,-136.14 144.32,-132.93 159,-131 204.59,-125.01 257.21,-123.6 293.64,-123.48"/>
+<polygon fill="black" stroke="black" points="293.93,-126.98 303.93,-123.48 293.93,-119.98 293.93,-126.98"/>
+</g>
+<!-- upb_msg2 -->
+<g id="node3" class="node">
+<title>upb_msg2</title>
+<path fill="#7fc97f" stroke="black" d="M372,-196C372,-196 307,-196 307,-196 301,-196 295,-190 295,-184 295,-184 295,-172 295,-172 295,-166 301,-160 307,-160 307,-160 372,-160 372,-160 378,-160 384,-166 384,-172 384,-172 384,-184 384,-184 384,-190 378,-196 372,-196"/>
+<text text-anchor="middle" x="339.5" y="-174.3" font-family="Times,serif" font-size="14.00">upb Message</text>
+</g>
+<!-- upb_msg&#45;&gt;upb_msg2 -->
+<g id="edge2" class="edge">
+<title>upb_msg&#45;&gt;upb_msg2</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M108.38,-169.06C123.72,-175.44 141.85,-181.82 159,-185 200.72,-192.74 248.8,-190.27 284.7,-186.27"/>
+<polygon fill="black" stroke="black" points="285.44,-189.7 294.95,-185.04 284.61,-182.75 285.44,-189.7"/>
+</g>
+<!-- dummy -->
+<!-- dummy&#45;&gt;upb_array -->
+<!-- dummy&#45;&gt;upb_msg2 -->
+<!-- py_upb_msg -->
+<g id="node5" class="node">
+<title>py_upb_msg</title>
+<path fill="#beaed4" stroke="black" d="M111,-279C111,-279 28,-279 28,-279 22,-279 16,-273 16,-267 16,-267 16,-255 16,-255 16,-249 22,-243 28,-243 28,-243 111,-243 111,-243 117,-243 123,-249 123,-255 123,-255 123,-267 123,-267 123,-273 117,-279 111,-279"/>
+<text text-anchor="middle" x="69.5" y="-257.3" font-family="Times,serif" font-size="14.00">Python Message</text>
+</g>
+<!-- py_upb_msg&#45;&gt;upb_msg -->
+<g id="edge3" class="edge">
+<title>py_upb_msg&#45;&gt;upb_msg</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M69.5,-242.68C69.5,-221.49 69.5,-200.3 69.5,-179.11"/>
+<polygon fill="black" stroke="black" points="73,-179.05 69.5,-169.05 66,-179.05 73,-179.05"/>
+</g>
+<!-- py_upb_arena -->
+<g id="node7" class="node">
+<title>py_upb_arena</title>
+<path fill="#beaed4" stroke="black" d="M238,-279C238,-279 171,-279 171,-279 165,-279 159,-273 159,-267 159,-267 159,-255 159,-255 159,-249 165,-243 171,-243 171,-243 238,-243 238,-243 244,-243 250,-249 250,-255 250,-255 250,-267 250,-267 250,-273 244,-279 238,-279"/>
+<text text-anchor="middle" x="204.5" y="-257.3" font-family="Times,serif" font-size="14.00">Python Arena</text>
+</g>
+<!-- py_upb_msg&#45;&gt;py_upb_arena -->
+<g id="edge6" class="edge">
+<title>py_upb_msg&#45;&gt;py_upb_arena</title>
+<path fill="none" stroke="#008b45" d="M123.07,-261C131.43,-261 140.1,-261 148.51,-261"/>
+<polygon fill="#008b45" stroke="#008b45" points="148.62,-264.5 158.62,-261 148.62,-257.5 148.62,-264.5"/>
+</g>
+<!-- py_upb_msg2 -->
+<g id="node6" class="node">
+<title>py_upb_msg2</title>
+<path fill="#beaed4" stroke="black" d="M381,-279C381,-279 298,-279 298,-279 292,-279 286,-273 286,-267 286,-267 286,-255 286,-255 286,-249 292,-243 298,-243 298,-243 381,-243 381,-243 387,-243 393,-249 393,-255 393,-255 393,-267 393,-267 393,-273 387,-279 381,-279"/>
+<text text-anchor="middle" x="339.5" y="-257.3" font-family="Times,serif" font-size="14.00">Python Message</text>
+</g>
+<!-- py_upb_msg2&#45;&gt;upb_msg2 -->
+<g id="edge4" class="edge">
+<title>py_upb_msg2&#45;&gt;upb_msg2</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M339.5,-242.76C339.5,-230.63 339.5,-218.49 339.5,-206.35"/>
+<polygon fill="black" stroke="black" points="343,-206.16 339.5,-196.16 336,-206.16 343,-206.16"/>
+</g>
+<!-- py_upb_msg2&#45;&gt;py_upb_arena -->
+<g id="edge5" class="edge">
+<title>py_upb_msg2&#45;&gt;py_upb_arena</title>
+<path fill="none" stroke="#008b45" d="M285.91,-261C277.49,-261 268.77,-261 260.31,-261"/>
+<polygon fill="#008b45" stroke="#008b45" points="260.16,-257.5 250.16,-261 260.16,-264.5 260.16,-257.5"/>
+</g>
+<!-- py_upb_arena&#45;&gt;dummy -->
+<g id="edge7" class="edge">
+<title>py_upb_arena&#45;&gt;dummy</title>
+<path fill="none" stroke="red" d="M204.5,-242.76C204.5,-240.95 204.5,-239.15 204.5,-237.34"/>
+<polygon fill="red" stroke="red" points="208,-237 204.5,-227 201,-237 208,-237"/>
+</g>
+<!-- key -->
+<g id="node8" class="node">
+<title>key</title>
+<text text-anchor="start" x="72.5" y="-63.8" font-family="Times,serif" font-size="14.00">raw ptr</text>
+<text text-anchor="start" x="56.5" y="-44.8" font-family="Times,serif" font-size="14.00">unique ptr</text>
+<text text-anchor="start" x="26.5" y="-25.8" font-family="Times,serif" font-size="14.00">shared (GC) ptr</text>
+</g>
+<!-- key2 -->
+<g id="node9" class="node">
+<title>key2</title>
+<text text-anchor="start" x="202.5" y="-63.8" font-family="Times,serif" font-size="14.00"> </text>
+<text text-anchor="start" x="202.5" y="-44.8" font-family="Times,serif" font-size="14.00"> </text>
+<text text-anchor="start" x="202.5" y="-25.8" font-family="Times,serif" font-size="14.00"> </text>
+</g>
+<!-- key&#45;&gt;key2 -->
+<g id="edge10" class="edge">
+<title>key:e&#45;&gt;key2:w</title>
+<path fill="none" stroke="black" stroke-dasharray="5,2" d="M115.5,-68C149.19,-68 160.08,-68 189.31,-68"/>
+<polygon fill="black" stroke="black" points="189.5,-71.5 199.5,-68 189.5,-64.5 189.5,-71.5"/>
+</g>
+<!-- key&#45;&gt;key2 -->
+<g id="edge11" class="edge">
+<title>key:e&#45;&gt;key2:w</title>
+<path fill="none" stroke="red" d="M115.5,-48C149.19,-48 160.08,-48 189.31,-48"/>
+<polygon fill="red" stroke="red" points="189.5,-51.5 199.5,-48 189.5,-44.5 189.5,-51.5"/>
+</g>
+<!-- key&#45;&gt;key2 -->
+<g id="edge12" class="edge">
+<title>key:e&#45;&gt;key2:w</title>
+<path fill="none" stroke="#008b45" d="M115.5,-29C149.19,-29 160.08,-29 189.31,-29"/>
+<polygon fill="#008b45" stroke="#008b45" points="189.5,-32.5 199.5,-29 189.5,-25.5 189.5,-32.5"/>
+</g>
+<!-- key2&#45;&gt;upb_msg -->
+</g>
+</svg>
diff --git a/grpc/third_party/upb/examples/bazel/BUILD b/grpc/third_party/upb/examples/bazel/BUILD
deleted file mode 100644
index 97119252..00000000
--- a/grpc/third_party/upb/examples/bazel/BUILD
+++ /dev/null
@@ -1,21 +0,0 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
-load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
-
-licenses(["notice"])
-
-proto_library(
- name = "foo_proto",
- srcs = ["foo.proto"],
-)
-
-upb_proto_library(
- name = "foo_upbproto",
- deps = [":foo_proto"],
-)
-
-cc_binary(
- name = "test_binary",
- srcs = ["test_binary.c"],
- copts = ["-std=c99"],
- deps = [":foo_upbproto"],
-)
diff --git a/grpc/third_party/upb/examples/bazel/WORKSPACE b/grpc/third_party/upb/examples/bazel/WORKSPACE
deleted file mode 100644
index 1be5cb84..00000000
--- a/grpc/third_party/upb/examples/bazel/WORKSPACE
+++ /dev/null
@@ -1,13 +0,0 @@
-workspace(name = "upb_example")
-
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
-
-git_repository(
- name = "upb",
- commit = "d16bf99ac4658793748cda3251226059892b3b7b",
- remote = "https://github.com/protocolbuffers/upb.git",
-)
-
-load("@upb//bazel:workspace_deps.bzl", "upb_deps")
-
-upb_deps()
diff --git a/grpc/third_party/upb/examples/bazel/foo.proto b/grpc/third_party/upb/examples/bazel/foo.proto
deleted file mode 100644
index f68b9944..00000000
--- a/grpc/third_party/upb/examples/bazel/foo.proto
+++ /dev/null
@@ -1,7 +0,0 @@
-
-syntax = "proto2";
-
-message Foo {
- optional int64 time = 1;
- optional string greeting = 2;
-}
diff --git a/grpc/third_party/upb/examples/bazel/test_binary.c b/grpc/third_party/upb/examples/bazel/test_binary.c
deleted file mode 100644
index 98617cf0..00000000
--- a/grpc/third_party/upb/examples/bazel/test_binary.c
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#include <time.h>
-
-#include "examples/bazel/foo.upb.h"
-
-int main() {
- upb_arena *arena = upb_arena_new();
- Foo* foo = Foo_new(arena);
- const char greeting[] = "Hello, World!\n";
-
- Foo_set_time(foo, time(NULL));
- /* Warning: the proto will not copy this, the string data must outlive
- * the proto. */
- Foo_set_greeting(foo, upb_strview_makez(greeting));
-
- upb_arena_free(arena);
-}
diff --git a/grpc/third_party/upb/kokoro/ubuntu/build.sh b/grpc/third_party/upb/kokoro/ubuntu/build.sh
deleted file mode 100644
index c95ee88d..00000000
--- a/grpc/third_party/upb/kokoro/ubuntu/build.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-# Install the latest version of Bazel.
-if [ -x "$(command -v use_bazel.sh)" ]; then
- use_bazel.sh latest
-fi
-
-# Verify/query CMake
-echo PATH=$PATH
-ls -l `which cmake`
-cmake --version
-
-# Log the bazel path and version.
-which bazel
-bazel version
-
-cd $(dirname $0)/../..
-
-if which gcc; then
- gcc --version
- CC=gcc bazel test -c opt --test_output=errors ... -- -benchmarks:benchmark
- if [[ $(uname) = "Linux" ]]; then
- CC=gcc bazel test --test_output=errors ...
- CC=gcc bazel test --test_output=errors ... --//:fasttable_enabled=true -- -cmake:test_generated_files -benchmarks:benchmark
- fi
- # TODO: work through these errors and enable this.
- # if gcc -fanalyzer -x c /dev/null -c -o /dev/null; then
- # CC=gcc bazel test --copt=-fanalyzer --test_output=errors ...
- # fi
-fi
-
-if which clang; then
- if [[ $(uname) = "Linux" ]]; then
- CC=clang bazel test --test_output=errors ...
- CC=clang bazel test --test_output=errors -c opt ... -- -benchmarks:benchmark
- CC=clang bazel test --test_output=errors ... --//:fasttable_enabled=true -- -cmake:test_generated_files
-
- CC=clang bazel test --test_output=errors --config=m32 ... -- -benchmarks:benchmark
- CC=clang bazel test --test_output=errors --config=asan ... -- -benchmarks:benchmark
-
- # TODO: update to a newer Lua that hopefully does not trigger UBSAN.
- CC=clang bazel test --test_output=errors --config=ubsan ... -- -tests/bindings/lua:test_lua
- fi
-fi
-
-if which valgrind; then
- bazel test --config=valgrind ... -- -tests:test_conformance_upb -cmake:cmake_build
-fi
diff --git a/grpc/third_party/upb/kokoro/ubuntu/continuous.cfg b/grpc/third_party/upb/kokoro/ubuntu/continuous.cfg
deleted file mode 100644
index fa97583b..00000000
--- a/grpc/third_party/upb/kokoro/ubuntu/continuous.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-build_file: "upb/kokoro/ubuntu/build.sh"
-timeout_mins: 15
diff --git a/grpc/third_party/upb/kokoro/ubuntu/presubmit.cfg b/grpc/third_party/upb/kokoro/ubuntu/presubmit.cfg
deleted file mode 100644
index 0a7f20c6..00000000
--- a/grpc/third_party/upb/kokoro/ubuntu/presubmit.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-build_file: "upb/kokoro/ubuntu/build.sh"
-timeout_mins: 30
diff --git a/grpc/third_party/upb/python/BUILD b/grpc/third_party/upb/python/BUILD
new file mode 100644
index 00000000..ac971132
--- /dev/null
+++ b/grpc/third_party/upb/python/BUILD
@@ -0,0 +1,164 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# begin:github_only
+load("//bazel:py_proto_library.bzl", "py_proto_library")
+load("//bazel:py_extension.bzl", "py_extension")
+load("@rules_python//python:packaging.bzl", "py_wheel")
+# end:github_only
+
+licenses(["notice"])
+
+py_extension(
+ name = "_message",
+ srcs = [
+ "convert.c",
+ "convert.h",
+ "descriptor.c",
+ "descriptor.h",
+ "descriptor_containers.c",
+ "descriptor_containers.h",
+ "descriptor_pool.c",
+ "descriptor_pool.h",
+ "extension_dict.c",
+ "extension_dict.h",
+ "map.c",
+ "map.h",
+ "message.c",
+ "message.h",
+ "protobuf.c",
+ "protobuf.h",
+ "python.h",
+ "repeated.c",
+ "repeated.h",
+ ],
+ deps = [
+ "//:descriptor_upb_proto_reflection",
+ "//:reflection",
+ "//:table",
+ "//:textformat",
+ "//:upb",
+ "//upb/util:compare",
+ "//upb/util:def_to_proto",
+ "//upb/util:required_fields",
+ ],
+)
+
+py_extension(
+ name = "_api_implementation",
+ srcs = ["api_implementation.c"],
+)
+
+# begin:github_only
+
+py_test(
+ name = "minimal_test",
+ srcs = [
+ "minimal_test.py",
+ ],
+ imports = ["."],
+ legacy_create_init = False,
+ deps = [
+ "//python:message_ext",
+ "@com_google_protobuf//:python_common_test_protos",
+ "@com_google_protobuf//:python_specific_test_protos",
+ "@com_google_protobuf//:python_srcs",
+ ],
+)
+
+# Copy the extensions into the location recognized by Python.
+# .abi3.so indicates use of the limited API, and cross-version ABI compatibility.
+EXT_SUFFIX = ".abi3.so"
+
+genrule(
+ name = "copy_message",
+ srcs = [":_message"],
+ outs = ["google/protobuf/pyext/_message" + EXT_SUFFIX],
+ cmd = "cp $< $@",
+)
+
+genrule(
+ name = "copy_api_implementation",
+ srcs = [":_api_implementation"],
+ outs = ["google/protobuf/internal/_api_implementation" + EXT_SUFFIX],
+ cmd = "cp $< $@",
+ visibility = ["//python:__subpackages__"],
+)
+
+filegroup(
+ name = "extension_files",
+ srcs = [
+ "google/protobuf/pyext/_message" + EXT_SUFFIX,
+ "google/protobuf/internal/_api_implementation" + EXT_SUFFIX,
+ ],
+)
+
+py_library(
+ name = "message_ext",
+ data = [":extension_files"],
+ imports = ["."],
+ visibility = ["//python:__subpackages__"],
+)
+
+py_proto_library(
+ name = "well_known_proto_pb2",
+ deps = [
+ "@com_google_protobuf//:any_proto",
+ "@com_google_protobuf//:api_proto",
+ "@com_google_protobuf//:compiler_plugin_proto",
+ "@com_google_protobuf//:descriptor_proto",
+ "@com_google_protobuf//:duration_proto",
+ "@com_google_protobuf//:empty_proto",
+ "@com_google_protobuf//:field_mask_proto",
+ "@com_google_protobuf//:source_context_proto",
+ "@com_google_protobuf//:struct_proto",
+ "@com_google_protobuf//:timestamp_proto",
+ "@com_google_protobuf//:type_proto",
+ "@com_google_protobuf//:wrappers_proto",
+ ],
+)
+
+py_wheel(
+ name = "binary_wheel",
+ abi = "abi3",
+ distribution = "protobuf",
+ # TODO(https://github.com/protocolbuffers/upb/issues/502): we need to make
+ # this a select() that is calculated from the platform we are actually
+ # building on.
+ platform = "manylinux2014_x86_64",
+ python_tag = "cp36",
+ strip_path_prefixes = ["python/"],
+ version = "4.20.0",
+ deps = [
+ ":extension_files",
+ ":well_known_proto_pb2",
+ # TODO(https://github.com/protocolbuffers/upb/issues/503): currently
+ # this includes the unit tests. We should filter these out so we are
+ # only distributing true source files.
+ "@com_google_protobuf//:python_srcs",
+ ],
+)
+
+# end:github_only
diff --git a/grpc/third_party/upb/python/api_implementation.c b/grpc/third_party/upb/python/api_implementation.c
new file mode 100644
index 00000000..9f96b936
--- /dev/null
+++ b/grpc/third_party/upb/python/api_implementation.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Python.h>
+
+static struct PyModuleDef module_def = {
+ PyModuleDef_HEAD_INIT,
+ "google.protobuf.internal._api_implementation",
+ "Protobuf Module",
+ -1,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL};
+
+PyMODINIT_FUNC PyInit__api_implementation(void) {
+ PyObject* module = PyModule_Create(&module_def);
+
+ if (PyModule_AddIntConstant(module, "api_version", 2)) {
+ Py_DECREF(module);
+ return NULL;
+ }
+
+ return module;
+}
diff --git a/grpc/third_party/upb/python/convert.c b/grpc/third_party/upb/python/convert.c
new file mode 100644
index 00000000..3117759c
--- /dev/null
+++ b/grpc/third_party/upb/python/convert.c
@@ -0,0 +1,394 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/convert.h"
+
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/reflection.h"
+#include "upb/util/compare.h"
+
+PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f,
+ PyObject* arena) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Enum:
+ case kUpb_CType_Int32:
+ return PyLong_FromLong(val.int32_val);
+ case kUpb_CType_Int64:
+ return PyLong_FromLongLong(val.int64_val);
+ case kUpb_CType_UInt32:
+ return PyLong_FromSize_t(val.uint32_val);
+ case kUpb_CType_UInt64:
+ return PyLong_FromUnsignedLongLong(val.uint64_val);
+ case kUpb_CType_Float:
+ return PyFloat_FromDouble(val.float_val);
+ case kUpb_CType_Double:
+ return PyFloat_FromDouble(val.double_val);
+ case kUpb_CType_Bool:
+ return PyBool_FromLong(val.bool_val);
+ case kUpb_CType_Bytes:
+ return PyBytes_FromStringAndSize(val.str_val.data, val.str_val.size);
+ case kUpb_CType_String: {
+ PyObject* ret =
+ PyUnicode_DecodeUTF8(val.str_val.data, val.str_val.size, NULL);
+ // If the string can't be decoded in UTF-8, just return a bytes object
+ // that contains the raw bytes. This can't happen if the value was
+ // assigned using the members of the Python message object, but can happen
+ // if the values were parsed from the wire (binary).
+ if (ret == NULL) {
+ PyErr_Clear();
+ ret = PyBytes_FromStringAndSize(val.str_val.data, val.str_val.size);
+ }
+ return ret;
+ }
+ case kUpb_CType_Message:
+ return PyUpb_CMessage_Get((upb_Message*)val.msg_val,
+ upb_FieldDef_MessageSubDef(f), arena);
+ default:
+ PyErr_Format(PyExc_SystemError,
+ "Getting a value from a field of unknown type %d",
+ upb_FieldDef_CType(f));
+ return NULL;
+ }
+}
+
+static bool PyUpb_GetInt64(PyObject* obj, int64_t* val) {
+ // We require that the value is either an integer or has an __index__
+ // conversion.
+ obj = PyNumber_Index(obj);
+ if (!obj) return false;
+ // If the value is already a Python long, PyLong_AsLongLong() retrieves it.
+ // Otherwise is converts to integer using __int__.
+ *val = PyLong_AsLongLong(obj);
+ bool ok = true;
+ if (PyErr_Occurred()) {
+ assert(PyErr_ExceptionMatches(PyExc_OverflowError));
+ PyErr_Clear();
+ PyErr_Format(PyExc_ValueError, "Value out of range: %S", obj);
+ ok = false;
+ }
+ Py_DECREF(obj);
+ return ok;
+}
+
+static bool PyUpb_GetUint64(PyObject* obj, uint64_t* val) {
+ // We require that the value is either an integer or has an __index__
+ // conversion.
+ obj = PyNumber_Index(obj);
+ if (!obj) return false;
+ *val = PyLong_AsUnsignedLongLong(obj);
+ bool ok = true;
+ if (PyErr_Occurred()) {
+ assert(PyErr_ExceptionMatches(PyExc_OverflowError));
+ PyErr_Clear();
+ PyErr_Format(PyExc_ValueError, "Value out of range: %S", obj);
+ ok = false;
+ }
+ Py_DECREF(obj);
+ return ok;
+}
+
+static bool PyUpb_GetInt32(PyObject* obj, int32_t* val) {
+ int64_t i64;
+ if (!PyUpb_GetInt64(obj, &i64)) return false;
+ if (i64 < INT32_MIN || i64 > INT32_MAX) {
+ PyErr_Format(PyExc_ValueError, "Value out of range: %S", obj);
+ return false;
+ }
+ *val = i64;
+ return true;
+}
+
+static bool PyUpb_GetUint32(PyObject* obj, uint32_t* val) {
+ uint64_t u64;
+ if (!PyUpb_GetUint64(obj, &u64)) return false;
+ if (u64 > UINT32_MAX) {
+ PyErr_Format(PyExc_ValueError, "Value out of range: %S", obj);
+ return false;
+ }
+ *val = u64;
+ return true;
+}
+
+// If `arena` is specified, copies the string data into the given arena.
+// Otherwise aliases the given data.
+static upb_MessageValue PyUpb_MaybeCopyString(const char* ptr, size_t size,
+ upb_Arena* arena) {
+ upb_MessageValue ret;
+ ret.str_val.size = size;
+ if (arena) {
+ char* buf = upb_Arena_Malloc(arena, size);
+ memcpy(buf, ptr, size);
+ ret.str_val.data = buf;
+ } else {
+ ret.str_val.data = ptr;
+ }
+ return ret;
+}
+
+static bool PyUpb_PyToUpbEnum(PyObject* obj, const upb_EnumDef* e,
+ upb_MessageValue* val) {
+ if (PyUnicode_Check(obj)) {
+ Py_ssize_t size;
+ const char* name = PyUnicode_AsUTF8AndSize(obj, &size);
+ const upb_EnumValueDef* ev =
+ upb_EnumDef_FindValueByNameWithSize(e, name, size);
+ if (!ev) {
+ PyErr_Format(PyExc_ValueError, "unknown enum label \"%s\"", name);
+ return false;
+ }
+ val->int32_val = upb_EnumValueDef_Number(ev);
+ return true;
+ } else {
+ int32_t i32;
+ if (!PyUpb_GetInt32(obj, &i32)) return false;
+ if (upb_FileDef_Syntax(upb_EnumDef_File(e)) == kUpb_Syntax_Proto2 &&
+ !upb_EnumDef_CheckNumber(e, i32)) {
+ PyErr_Format(PyExc_ValueError, "invalid enumerator %d", (int)i32);
+ return false;
+ }
+ val->int32_val = i32;
+ return true;
+ }
+}
+
+bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val,
+ upb_Arena* arena) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Enum:
+ return PyUpb_PyToUpbEnum(obj, upb_FieldDef_EnumSubDef(f), val);
+ case kUpb_CType_Int32:
+ return PyUpb_GetInt32(obj, &val->int32_val);
+ case kUpb_CType_Int64:
+ return PyUpb_GetInt64(obj, &val->int64_val);
+ case kUpb_CType_UInt32:
+ return PyUpb_GetUint32(obj, &val->uint32_val);
+ case kUpb_CType_UInt64:
+ return PyUpb_GetUint64(obj, &val->uint64_val);
+ case kUpb_CType_Float:
+ val->float_val = PyFloat_AsDouble(obj);
+ return !PyErr_Occurred();
+ case kUpb_CType_Double:
+ val->double_val = PyFloat_AsDouble(obj);
+ return !PyErr_Occurred();
+ case kUpb_CType_Bool:
+ val->bool_val = PyLong_AsLong(obj);
+ return !PyErr_Occurred();
+ case kUpb_CType_Bytes: {
+ char* ptr;
+ Py_ssize_t size;
+ if (PyBytes_AsStringAndSize(obj, &ptr, &size) < 0) return false;
+ *val = PyUpb_MaybeCopyString(ptr, size, arena);
+ return true;
+ }
+ case kUpb_CType_String: {
+ Py_ssize_t size;
+ const char* ptr;
+ PyObject* unicode = NULL;
+ if (PyBytes_Check(obj)) {
+ unicode = obj = PyUnicode_FromEncodedObject(obj, "utf-8", NULL);
+ if (!obj) return false;
+ }
+ ptr = PyUnicode_AsUTF8AndSize(obj, &size);
+ if (PyErr_Occurred()) {
+ Py_XDECREF(unicode);
+ return false;
+ }
+ *val = PyUpb_MaybeCopyString(ptr, size, arena);
+ Py_XDECREF(unicode);
+ return true;
+ }
+ case kUpb_CType_Message:
+ PyErr_Format(PyExc_ValueError, "Message objects may not be assigned",
+ upb_FieldDef_CType(f));
+ return false;
+ default:
+ PyErr_Format(PyExc_SystemError,
+ "Getting a value from a field of unknown type %d",
+ upb_FieldDef_CType(f));
+ return false;
+ }
+}
+
+bool PyUpb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2,
+ const upb_MessageDef* m);
+
+// -----------------------------------------------------------------------------
+// Equal
+// -----------------------------------------------------------------------------
+
+bool PyUpb_ValueEq(upb_MessageValue val1, upb_MessageValue val2,
+ const upb_FieldDef* f) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
+ return val1.bool_val == val2.bool_val;
+ case kUpb_CType_Int32:
+ case kUpb_CType_UInt32:
+ case kUpb_CType_Enum:
+ return val1.int32_val == val2.int32_val;
+ case kUpb_CType_Int64:
+ case kUpb_CType_UInt64:
+ return val1.int64_val == val2.int64_val;
+ case kUpb_CType_Float:
+ return val1.float_val == val2.float_val;
+ case kUpb_CType_Double:
+ return val1.double_val == val2.double_val;
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes:
+ return val1.str_val.size == val2.str_val.size &&
+ memcmp(val1.str_val.data, val2.str_val.data, val1.str_val.size) ==
+ 0;
+ case kUpb_CType_Message:
+ return PyUpb_Message_IsEqual(val1.msg_val, val2.msg_val,
+ upb_FieldDef_MessageSubDef(f));
+ default:
+ return false;
+ }
+}
+
+bool PyUpb_Map_IsEqual(const upb_Map* map1, const upb_Map* map2,
+ const upb_FieldDef* f) {
+ assert(upb_FieldDef_IsMap(f));
+ if (map1 == map2) return true;
+
+ size_t size1 = map1 ? upb_Map_Size(map1) : 0;
+ size_t size2 = map2 ? upb_Map_Size(map2) : 0;
+ if (size1 != size2) return false;
+ if (size1 == 0) return true;
+
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ size_t iter = kUpb_Map_Begin;
+
+ while (upb_MapIterator_Next(map1, &iter)) {
+ upb_MessageValue key = upb_MapIterator_Key(map1, iter);
+ upb_MessageValue val1 = upb_MapIterator_Value(map1, iter);
+ upb_MessageValue val2;
+ if (!upb_Map_Get(map2, key, &val2)) return false;
+ if (!PyUpb_ValueEq(val1, val2, val_f)) return false;
+ }
+
+ return true;
+}
+
+static bool PyUpb_ArrayElem_IsEqual(const upb_Array* arr1,
+ const upb_Array* arr2, size_t i,
+ const upb_FieldDef* f) {
+ assert(i < upb_Array_Size(arr1));
+ assert(i < upb_Array_Size(arr2));
+ upb_MessageValue val1 = upb_Array_Get(arr1, i);
+ upb_MessageValue val2 = upb_Array_Get(arr2, i);
+ return PyUpb_ValueEq(val1, val2, f);
+}
+
+bool PyUpb_Array_IsEqual(const upb_Array* arr1, const upb_Array* arr2,
+ const upb_FieldDef* f) {
+ assert(upb_FieldDef_IsRepeated(f) && !upb_FieldDef_IsMap(f));
+ if (arr1 == arr2) return true;
+
+ size_t n1 = arr1 ? upb_Array_Size(arr1) : 0;
+ size_t n2 = arr2 ? upb_Array_Size(arr2) : 0;
+ if (n1 != n2) return false;
+
+ // Half the length rounded down. Important: the empty list rounds to 0.
+ size_t half = n1 / 2;
+
+ // Search from the ends-in. We expect differences to more quickly manifest
+ // at the ends than in the middle. If the length is odd we will miss the
+ // middle element.
+ for (size_t i = 0; i < half; i++) {
+ if (!PyUpb_ArrayElem_IsEqual(arr1, arr2, i, f)) return false;
+ if (!PyUpb_ArrayElem_IsEqual(arr1, arr2, n1 - 1 - i, f)) return false;
+ }
+
+ // For an odd-lengthed list, pick up the middle element.
+ if (n1 & 1) {
+ if (!PyUpb_ArrayElem_IsEqual(arr1, arr2, half, f)) return false;
+ }
+
+ return true;
+}
+
+bool PyUpb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2,
+ const upb_MessageDef* m) {
+ if (msg1 == msg2) return true;
+ if (upb_Message_ExtensionCount(msg1) != upb_Message_ExtensionCount(msg2))
+ return false;
+
+ // Compare messages field-by-field. This is slightly tricky, because while
+ // we can iterate over normal fields in a predictable order, the extension
+ // order is unpredictable and may be different between msg1 and msg2.
+ // So we use the following strategy:
+ // 1. Iterate over all msg1 fields (including extensions).
+ // 2. For non-extension fields, we find the corresponding field by simply
+ // using upb_Message_Next(msg2). If the two messages have the same set
+ // of fields, this will yield the same field.
+ // 3. For extension fields, we have to actually search for the corresponding
+ // field, which we do with upb_Message_Get(msg2, ext_f1).
+ // 4. Once iteration over msg1 is complete, we call upb_Message_Next(msg2)
+ // one
+ // final time to verify that we have visited all of msg2's regular fields
+ // (we pass NULL for ext_dict so that iteration will *not* return
+ // extensions).
+ //
+ // We don't need to visit all of msg2's extensions, because we verified up
+ // front that both messages have the same number of extensions.
+ const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m));
+ const upb_FieldDef *f1, *f2;
+ upb_MessageValue val1, val2;
+ size_t iter1 = kUpb_Message_Begin;
+ size_t iter2 = kUpb_Message_Begin;
+ while (upb_Message_Next(msg1, m, symtab, &f1, &val1, &iter1)) {
+ if (upb_FieldDef_IsExtension(f1)) {
+ val2 = upb_Message_Get(msg2, f1);
+ } else {
+ if (!upb_Message_Next(msg2, m, NULL, &f2, &val2, &iter2) || f1 != f2) {
+ return false;
+ }
+ }
+
+ if (upb_FieldDef_IsMap(f1)) {
+ if (!PyUpb_Map_IsEqual(val1.map_val, val2.map_val, f1)) return false;
+ } else if (upb_FieldDef_IsRepeated(f1)) {
+ if (!PyUpb_Array_IsEqual(val1.array_val, val2.array_val, f1)) {
+ return false;
+ }
+ } else {
+ if (!PyUpb_ValueEq(val1, val2, f1)) return false;
+ }
+ }
+
+ if (upb_Message_Next(msg2, m, NULL, &f2, &val2, &iter2)) return false;
+
+ size_t usize1, usize2;
+ const char* uf1 = upb_Message_GetUnknown(msg1, &usize1);
+ const char* uf2 = upb_Message_GetUnknown(msg2, &usize2);
+ // 100 is arbitrary, we're trying to prevent stack overflow but it's not
+ // obvious how deep we should allow here.
+ return upb_Message_UnknownFieldsAreEqual(uf1, usize1, uf2, usize2, 100) ==
+ kUpb_UnknownCompareResult_Equal;
+}
diff --git a/grpc/third_party/upb/python/convert.h b/grpc/third_party/upb/python/convert.h
new file mode 100644
index 00000000..cc66606a
--- /dev/null
+++ b/grpc/third_party/upb/python/convert.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_CONVERT_H__
+#define PYUPB_CONVERT_H__
+
+#include "protobuf.h"
+#include "upb/def.h"
+#include "upb/reflection.h"
+
+// Converts `val` to a Python object according to the type information in `f`.
+// Any newly-created Python objects that reference non-primitive data from `val`
+// will take a reference on `arena`; the caller must ensure that `val` belongs
+// to `arena`. If the conversion cannot be performed, returns NULL and sets a
+// Python error.
+PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f,
+ PyObject* arena);
+
+// Converts `obj` to a upb_MessageValue `*val` according to the type information
+// in `f`. If `arena` is provided, any string data will be copied into `arena`,
+// otherwise the returned value will alias the Python-owned data (this can be
+// useful for an ephemeral upb_MessageValue). If the conversion cannot be
+// performed, returns false.
+bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val,
+ upb_Arena* arena);
+
+// Returns true if the given values (of type `f`) are equal.
+bool PyUpb_ValueEq(upb_MessageValue val1, upb_MessageValue val2,
+ const upb_FieldDef* f);
+
+// Returns true if the given messages (of type `m`) are equal.
+bool PyUpb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2,
+ const upb_MessageDef* m);
+
+// Returns true if the two arrays (with element type `f`) are equal.
+bool PyUpb_Array_IsEqual(const upb_Array* arr1, const upb_Array* arr2,
+ const upb_FieldDef* f);
+
+#endif // PYUPB_CONVERT_H__
diff --git a/grpc/third_party/upb/python/descriptor.c b/grpc/third_party/upb/python/descriptor.c
new file mode 100644
index 00000000..543c9d7a
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor.c
@@ -0,0 +1,1686 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/descriptor.h"
+
+#include "python/convert.h"
+#include "python/descriptor_containers.h"
+#include "python/descriptor_pool.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/def.h"
+#include "upb/util/def_to_proto.h"
+
+// -----------------------------------------------------------------------------
+// DescriptorBase
+// -----------------------------------------------------------------------------
+
+// This representation is used by all concrete descriptors.
+
+typedef struct {
+ PyObject_HEAD;
+ PyObject* pool; // We own a ref.
+ const void* def; // Type depends on the class. Kept alive by "pool".
+ PyObject* options; // NULL if not present or not cached.
+} PyUpb_DescriptorBase;
+
+PyObject* PyUpb_AnyDescriptor_GetPool(PyObject* desc) {
+ PyUpb_DescriptorBase* base = (void*)desc;
+ return base->pool;
+}
+
+const void* PyUpb_AnyDescriptor_GetDef(PyObject* desc) {
+ PyUpb_DescriptorBase* base = (void*)desc;
+ return base->def;
+}
+
+static PyUpb_DescriptorBase* PyUpb_DescriptorBase_DoCreate(
+ PyUpb_DescriptorType type, const void* def, const upb_FileDef* file) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyTypeObject* type_obj = state->descriptor_types[type];
+ assert(def);
+
+ PyUpb_DescriptorBase* base = (void*)PyType_GenericAlloc(type_obj, 0);
+ base->pool = PyUpb_DescriptorPool_Get(upb_FileDef_Pool(file));
+ base->def = def;
+ base->options = NULL;
+
+ PyUpb_ObjCache_Add(def, &base->ob_base);
+ return base;
+}
+
+// Returns a Python object wrapping |def|, of descriptor type |type|. If a
+// wrapper was previously created for this def, returns it, otherwise creates a
+// new wrapper.
+static PyObject* PyUpb_DescriptorBase_Get(PyUpb_DescriptorType type,
+ const void* def,
+ const upb_FileDef* file) {
+ PyUpb_DescriptorBase* base = (PyUpb_DescriptorBase*)PyUpb_ObjCache_Get(def);
+
+ if (!base) {
+ base = PyUpb_DescriptorBase_DoCreate(type, def, file);
+ }
+
+ return &base->ob_base;
+}
+
+static PyUpb_DescriptorBase* PyUpb_DescriptorBase_Check(
+ PyObject* obj, PyUpb_DescriptorType type) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyTypeObject* type_obj = state->descriptor_types[type];
+ if (!PyObject_TypeCheck(obj, type_obj)) {
+ PyErr_Format(PyExc_TypeError, "Expected object of type %S, but got %R",
+ type_obj, obj);
+ return NULL;
+ }
+ return (PyUpb_DescriptorBase*)obj;
+}
+
+static PyObject* PyUpb_DescriptorBase_GetOptions(PyUpb_DescriptorBase* self,
+ const upb_Message* opts,
+ const upb_MiniTable* layout,
+ const char* msg_name) {
+ if (!self->options) {
+ // Load descriptors protos if they are not loaded already. We have to do
+ // this lazily, otherwise, it would lead to circular imports.
+ PyObject* mod = PyImport_ImportModule(PYUPB_DESCRIPTOR_MODULE);
+ Py_DECREF(mod);
+
+ // Find the correct options message.
+ PyObject* default_pool = PyUpb_DescriptorPool_GetDefaultPool();
+ const upb_DefPool* symtab = PyUpb_DescriptorPool_GetSymtab(default_pool);
+ const upb_MessageDef* m = upb_DefPool_FindMessageByName(symtab, msg_name);
+ assert(m);
+
+ // Copy the options message from C to Python using serialize+parse.
+ // We don't wrap the C object directly because there is no guarantee that
+ // the descriptor_pb2 that was loaded at runtime has the same members or
+ // layout as the C types that were compiled in.
+ size_t size;
+ PyObject* py_arena = PyUpb_Arena_New();
+ upb_Arena* arena = PyUpb_Arena_Get(py_arena);
+ char* pb = upb_Encode(opts, layout, 0, arena, &size);
+ upb_Message* opts2 = upb_Message_New(m, arena);
+ assert(opts2);
+ bool ok = upb_Decode(pb, size, opts2, upb_MessageDef_MiniTable(m),
+ upb_DefPool_ExtensionRegistry(symtab), 0,
+ arena) == kUpb_DecodeStatus_Ok;
+ (void)ok;
+ assert(ok);
+
+ self->options = PyUpb_CMessage_Get(opts2, m, py_arena);
+ Py_DECREF(py_arena);
+ }
+
+ Py_INCREF(self->options);
+ return self->options;
+}
+
+typedef void* PyUpb_ToProto_Func(const void* def, upb_Arena* arena);
+
+static PyObject* PyUpb_DescriptorBase_GetSerializedProto(
+ PyObject* _self, PyUpb_ToProto_Func* func, const upb_MiniTable* layout) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ upb_Arena* arena = upb_Arena_New();
+ if (!arena) PYUPB_RETURN_OOM;
+ upb_Message* proto = func(self->def, arena);
+ if (!proto) goto oom;
+ size_t size;
+ char* pb = upb_Encode(proto, layout, 0, arena, &size);
+ if (!pb) goto oom;
+ PyObject* str = PyBytes_FromStringAndSize(pb, size);
+ upb_Arena_Free(arena);
+ return str;
+
+oom:
+ upb_Arena_Free(arena);
+ PyErr_SetNone(PyExc_MemoryError);
+ return NULL;
+}
+
+static PyObject* PyUpb_DescriptorBase_CopyToProto(PyObject* _self,
+ PyUpb_ToProto_Func* func,
+ const upb_MiniTable* layout,
+ const char* expected_type,
+ PyObject* py_proto) {
+ if (!PyUpb_CMessage_Verify(py_proto)) return NULL;
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(py_proto);
+ const char* type = upb_MessageDef_FullName(m);
+ if (strcmp(type, expected_type) != 0) {
+ PyErr_Format(
+ PyExc_TypeError,
+ "CopyToProto: message is of incorrect type '%s' (expected '%s'", type,
+ expected_type);
+ return NULL;
+ }
+ PyObject* serialized =
+ PyUpb_DescriptorBase_GetSerializedProto(_self, func, layout);
+ if (!serialized) return NULL;
+ PyObject* ret = PyUpb_CMessage_MergeFromString(py_proto, serialized);
+ Py_DECREF(serialized);
+ return ret;
+}
+
+static void PyUpb_DescriptorBase_Dealloc(PyUpb_DescriptorBase* base) {
+ PyUpb_ObjCache_Delete(base->def);
+ Py_DECREF(base->pool);
+ Py_XDECREF(base->options);
+ PyUpb_Dealloc(base);
+}
+
+#define DESCRIPTOR_BASE_SLOTS \
+ {Py_tp_new, (void*)&PyUpb_Forbidden_New}, { \
+ Py_tp_dealloc, (void*)&PyUpb_DescriptorBase_Dealloc \
+ }
+
+// -----------------------------------------------------------------------------
+// Descriptor
+// -----------------------------------------------------------------------------
+
+PyObject* PyUpb_Descriptor_Get(const upb_MessageDef* m) {
+ assert(m);
+ const upb_FileDef* file = upb_MessageDef_File(m);
+ return PyUpb_DescriptorBase_Get(kPyUpb_Descriptor, m, file);
+}
+
+PyObject* PyUpb_Descriptor_GetClass(const upb_MessageDef* m) {
+ PyObject* ret = PyUpb_ObjCache_Get(upb_MessageDef_MiniTable(m));
+ assert(ret);
+ return ret;
+}
+
+// The LookupNested*() functions provide name lookup for entities nested inside
+// a message. This uses the symtab's table, which requires that the symtab is
+// not being mutated concurrently. We can guarantee this for Python-owned
+// symtabs, but upb cannot guarantee it in general for an arbitrary
+// `const upb_MessageDef*`.
+
+static const void* PyUpb_Descriptor_LookupNestedMessage(const upb_MessageDef* m,
+ const char* name) {
+ const upb_FileDef* filedef = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(filedef);
+ PyObject* qname =
+ PyUnicode_FromFormat("%s.%s", upb_MessageDef_FullName(m), name);
+ const upb_MessageDef* ret = upb_DefPool_FindMessageByName(
+ symtab, PyUnicode_AsUTF8AndSize(qname, NULL));
+ Py_DECREF(qname);
+ return ret;
+}
+
+static const void* PyUpb_Descriptor_LookupNestedEnum(const upb_MessageDef* m,
+ const char* name) {
+ const upb_FileDef* filedef = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(filedef);
+ PyObject* qname =
+ PyUnicode_FromFormat("%s.%s", upb_MessageDef_FullName(m), name);
+ const upb_EnumDef* ret =
+ upb_DefPool_FindEnumByName(symtab, PyUnicode_AsUTF8AndSize(qname, NULL));
+ Py_DECREF(qname);
+ return ret;
+}
+
+static const void* PyUpb_Descriptor_LookupNestedExtension(
+ const upb_MessageDef* m, const char* name) {
+ const upb_FileDef* filedef = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(filedef);
+ PyObject* qname =
+ PyUnicode_FromFormat("%s.%s", upb_MessageDef_FullName(m), name);
+ const upb_FieldDef* ret = upb_DefPool_FindExtensionByName(
+ symtab, PyUnicode_AsUTF8AndSize(qname, NULL));
+ Py_DECREF(qname);
+ return ret;
+}
+
+static PyObject* PyUpb_Descriptor_GetExtensionRanges(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (PyUpb_DescriptorBase*)_self;
+ int n = upb_MessageDef_ExtensionRangeCount(self->def);
+ PyObject* range_list = PyList_New(n);
+
+ for (int i = 0; i < n; i++) {
+ const upb_ExtensionRange* range =
+ upb_MessageDef_ExtensionRange(self->def, i);
+ PyObject* start = PyLong_FromLong(upb_ExtensionRange_Start(range));
+ PyObject* end = PyLong_FromLong(upb_ExtensionRange_End(range));
+ PyList_SetItem(range_list, i, PyTuple_Pack(2, start, end));
+ }
+
+ return range_list;
+}
+
+static PyObject* PyUpb_Descriptor_GetExtensions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_MessageDef_NestedExtensionCount,
+ (void*)&upb_MessageDef_NestedExtension,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetExtensionsByName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_NestedExtensionCount,
+ (void*)&upb_MessageDef_NestedExtension,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ },
+ (void*)&PyUpb_Descriptor_LookupNestedExtension,
+ (void*)&upb_FieldDef_Name,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetEnumTypes(PyObject* _self, void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_MessageDef_NestedEnumCount,
+ (void*)&upb_MessageDef_NestedEnum,
+ (void*)&PyUpb_EnumDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetOneofs(PyObject* _self, void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_MessageDef_OneofCount,
+ (void*)&upb_MessageDef_Oneof,
+ (void*)&PyUpb_OneofDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetOptions(PyObject* _self, PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(
+ self, upb_MessageDef_Options(self->def),
+ &google_protobuf_MessageOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".MessageOptions");
+}
+
+static PyObject* PyUpb_Descriptor_CopyToProto(PyObject* _self,
+ PyObject* py_proto) {
+ return PyUpb_DescriptorBase_CopyToProto(
+ _self, (PyUpb_ToProto_Func*)&upb_MessageDef_ToProto,
+ &google_protobuf_DescriptorProto_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".DescriptorProto", py_proto);
+}
+
+static PyObject* PyUpb_Descriptor_EnumValueName(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ const char* enum_name;
+ int number;
+ if (!PyArg_ParseTuple(args, "si", &enum_name, &number)) return NULL;
+ const upb_EnumDef* e =
+ PyUpb_Descriptor_LookupNestedEnum(self->def, enum_name);
+ if (!e) {
+ PyErr_SetString(PyExc_KeyError, enum_name);
+ return NULL;
+ }
+ const upb_EnumValueDef* ev = upb_EnumDef_FindValueByNumber(e, number);
+ if (!ev) {
+ PyErr_Format(PyExc_KeyError, "%d", number);
+ return NULL;
+ }
+ return PyUnicode_FromString(upb_EnumValueDef_Name(ev));
+}
+
+static PyObject* PyUpb_Descriptor_GetFieldsByName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_FieldCount,
+ (void*)&upb_MessageDef_Field,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ },
+ (void*)&upb_MessageDef_FindFieldByName,
+ (void*)&upb_FieldDef_Name,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetFieldsByCamelCaseName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_FieldCount,
+ (void*)&upb_MessageDef_Field,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ },
+ (void*)&upb_MessageDef_FindByJsonName,
+ (void*)&upb_FieldDef_JsonName,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetFieldsByNumber(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNumberMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_FieldCount,
+ (void*)&upb_MessageDef_Field,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ },
+ (void*)&upb_MessageDef_FindFieldByNumber,
+ (void*)&upb_FieldDef_Number,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNumberMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetNestedTypes(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_MessageDef_NestedMessageCount,
+ (void*)&upb_MessageDef_NestedMessage,
+ (void*)&PyUpb_Descriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetNestedTypesByName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_NestedMessageCount,
+ (void*)&upb_MessageDef_NestedMessage,
+ (void*)&PyUpb_Descriptor_Get,
+ },
+ (void*)&PyUpb_Descriptor_LookupNestedMessage,
+ (void*)&upb_MessageDef_Name,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetContainingType(PyObject* _self,
+ void* closure) {
+ // upb does not natively store the lexical parent of a message type, but we
+ // can derive it with some string manipulation and a lookup.
+ PyUpb_DescriptorBase* self = (void*)_self;
+ const upb_MessageDef* m = self->def;
+ const upb_FileDef* file = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(file);
+ const char* full_name = upb_MessageDef_FullName(m);
+ const char* last_dot = strrchr(full_name, '.');
+ if (!last_dot) Py_RETURN_NONE;
+ const upb_MessageDef* parent = upb_DefPool_FindMessageByNameWithSize(
+ symtab, full_name, last_dot - full_name);
+ if (!parent) Py_RETURN_NONE;
+ return PyUpb_Descriptor_Get(parent);
+}
+
+static PyObject* PyUpb_Descriptor_GetEnumTypesByName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_NestedEnumCount,
+ (void*)&upb_MessageDef_NestedEnum,
+ (void*)&PyUpb_EnumDescriptor_Get,
+ },
+ (void*)&PyUpb_Descriptor_LookupNestedEnum,
+ (void*)&upb_EnumDef_Name,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetIsExtendable(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ if (upb_MessageDef_ExtensionRangeCount(self->def) > 0) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+static PyObject* PyUpb_Descriptor_GetFullName(PyObject* self, void* closure) {
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(self);
+ return PyUnicode_FromString(upb_MessageDef_FullName(msgdef));
+}
+
+static PyObject* PyUpb_Descriptor_GetConcreteClass(PyObject* self,
+ void* closure) {
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(self);
+ return PyUpb_Descriptor_GetClass(msgdef);
+}
+
+static PyObject* PyUpb_Descriptor_GetFile(PyObject* self, void* closure) {
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(self);
+ return PyUpb_FileDescriptor_Get(upb_MessageDef_File(msgdef));
+}
+
+static PyObject* PyUpb_Descriptor_GetFields(PyObject* _self, void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_MessageDef_FieldCount,
+ (void*)&upb_MessageDef_Field,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetHasOptions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_MessageDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_Descriptor_GetName(PyObject* self, void* closure) {
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(self);
+ return PyUnicode_FromString(upb_MessageDef_Name(msgdef));
+}
+
+static PyObject* PyUpb_Descriptor_GetEnumValuesByName(PyObject* _self,
+ void* closure) {
+ // upb does not natively store any table containing all nested values.
+ // Consider:
+ // message M {
+ // enum E1 {
+ // A = 0;
+ // B = 1;
+ // }
+ // enum E2 {
+ // C = 0;
+ // D = 1;
+ // }
+ // }
+ //
+ // In this case, upb stores tables for E1 and E2, but it does not store a
+ // table for M that combines them (it is rarely needed and costs precious
+ // space and time to build).
+ //
+ // To work around this, we build an actual Python dict whenever a user
+ // actually asks for this.
+ PyUpb_DescriptorBase* self = (void*)_self;
+ PyObject* ret = PyDict_New();
+ if (!ret) return NULL;
+ int enum_count = upb_MessageDef_NestedEnumCount(self->def);
+ for (int i = 0; i < enum_count; i++) {
+ const upb_EnumDef* e = upb_MessageDef_NestedEnum(self->def, i);
+ int value_count = upb_EnumDef_ValueCount(e);
+ for (int j = 0; j < value_count; j++) {
+ // Collisions should be impossible here, as uniqueness is checked by
+ // protoc (this is an invariant of the protobuf language). However this
+ // uniqueness constraint is not currently checked by upb/def.c at load
+ // time, so if the user supplies a manually-constructed descriptor that
+ // does not respect this constraint, a collision could be possible and the
+ // last-defined enumerator would win. This could be seen as an argument
+ // for having upb actually build the table at load time, thus checking the
+ // constraint proactively, but upb is always checking a subset of the full
+ // validation performed by C++, and we have to pick and choose the biggest
+ // bang for the buck.
+ const upb_EnumValueDef* ev = upb_EnumDef_Value(e, j);
+ const char* name = upb_EnumValueDef_Name(ev);
+ PyObject* val = PyUpb_EnumValueDescriptor_Get(ev);
+ if (!val || PyDict_SetItemString(ret, name, val) < 0) {
+ Py_XDECREF(val);
+ Py_DECREF(ret);
+ return NULL;
+ }
+ Py_DECREF(val);
+ }
+ }
+ return ret;
+}
+
+static PyObject* PyUpb_Descriptor_GetOneofsByName(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_MessageDef_OneofCount,
+ (void*)&upb_MessageDef_Oneof,
+ (void*)&PyUpb_OneofDescriptor_Get,
+ },
+ (void*)&upb_MessageDef_FindOneofByName,
+ (void*)&upb_OneofDef_Name,
+ };
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_Descriptor_GetSyntax(PyObject* self, void* closure) {
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(self);
+ const char* syntax =
+ upb_MessageDef_Syntax(msgdef) == kUpb_Syntax_Proto2 ? "proto2" : "proto3";
+ return PyUnicode_InternFromString(syntax);
+}
+
+static PyGetSetDef PyUpb_Descriptor_Getters[] = {
+ {"name", PyUpb_Descriptor_GetName, NULL, "Last name"},
+ {"full_name", PyUpb_Descriptor_GetFullName, NULL, "Full name"},
+ {"_concrete_class", PyUpb_Descriptor_GetConcreteClass, NULL,
+ "concrete class"},
+ {"file", PyUpb_Descriptor_GetFile, NULL, "File descriptor"},
+ {"fields", PyUpb_Descriptor_GetFields, NULL, "Fields sequence"},
+ {"fields_by_name", PyUpb_Descriptor_GetFieldsByName, NULL,
+ "Fields by name"},
+ {"fields_by_camelcase_name", PyUpb_Descriptor_GetFieldsByCamelCaseName,
+ NULL, "Fields by camelCase name"},
+ {"fields_by_number", PyUpb_Descriptor_GetFieldsByNumber, NULL,
+ "Fields by number"},
+ {"nested_types", PyUpb_Descriptor_GetNestedTypes, NULL,
+ "Nested types sequence"},
+ {"nested_types_by_name", PyUpb_Descriptor_GetNestedTypesByName, NULL,
+ "Nested types by name"},
+ {"extensions", PyUpb_Descriptor_GetExtensions, NULL, "Extensions Sequence"},
+ {"extensions_by_name", PyUpb_Descriptor_GetExtensionsByName, NULL,
+ "Extensions by name"},
+ {"extension_ranges", PyUpb_Descriptor_GetExtensionRanges, NULL,
+ "Extension ranges"},
+ {"enum_types", PyUpb_Descriptor_GetEnumTypes, NULL, "Enum sequence"},
+ {"enum_types_by_name", PyUpb_Descriptor_GetEnumTypesByName, NULL,
+ "Enum types by name"},
+ {"enum_values_by_name", PyUpb_Descriptor_GetEnumValuesByName, NULL,
+ "Enum values by name"},
+ {"oneofs_by_name", PyUpb_Descriptor_GetOneofsByName, NULL,
+ "Oneofs by name"},
+ {"oneofs", PyUpb_Descriptor_GetOneofs, NULL, "Oneofs Sequence"},
+ {"containing_type", PyUpb_Descriptor_GetContainingType, NULL,
+ "Containing type"},
+ {"is_extendable", PyUpb_Descriptor_GetIsExtendable, NULL},
+ {"has_options", PyUpb_Descriptor_GetHasOptions, NULL, "Has Options"},
+ {"syntax", &PyUpb_Descriptor_GetSyntax, NULL, "Syntax"},
+ {NULL}};
+
+static PyMethodDef PyUpb_Descriptor_Methods[] = {
+ {"GetOptions", PyUpb_Descriptor_GetOptions, METH_NOARGS},
+ {"CopyToProto", PyUpb_Descriptor_CopyToProto, METH_O},
+ {"EnumValueName", PyUpb_Descriptor_EnumValueName, METH_VARARGS},
+ {NULL}};
+
+static PyType_Slot PyUpb_Descriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_Descriptor_Methods},
+ {Py_tp_getset, PyUpb_Descriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_Descriptor_Spec = {
+ PYUPB_MODULE_NAME ".Descriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_Descriptor_Slots,
+};
+
+const upb_MessageDef* PyUpb_Descriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_Descriptor);
+ return self ? self->def : NULL;
+}
+
+// -----------------------------------------------------------------------------
+// EnumDescriptor
+// -----------------------------------------------------------------------------
+
+PyObject* PyUpb_EnumDescriptor_Get(const upb_EnumDef* enumdef) {
+ const upb_FileDef* file = upb_EnumDef_File(enumdef);
+ return PyUpb_DescriptorBase_Get(kPyUpb_EnumDescriptor, enumdef, file);
+}
+
+const upb_EnumDef* PyUpb_EnumDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_EnumDescriptor);
+ return self ? self->def : NULL;
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetFullName(PyObject* self,
+ void* closure) {
+ const upb_EnumDef* enumdef = PyUpb_EnumDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_EnumDef_FullName(enumdef));
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetName(PyObject* self, void* closure) {
+ const upb_EnumDef* enumdef = PyUpb_EnumDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_EnumDef_Name(enumdef));
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetFile(PyObject* self, void* closure) {
+ const upb_EnumDef* enumdef = PyUpb_EnumDescriptor_GetDef(self);
+ return PyUpb_FileDescriptor_Get(upb_EnumDef_File(enumdef));
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetValues(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_EnumDef_ValueCount,
+ (void*)&upb_EnumDef_Value,
+ (void*)&PyUpb_EnumValueDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetValuesByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_EnumDef_ValueCount,
+ (void*)&upb_EnumDef_Value,
+ (void*)&PyUpb_EnumValueDescriptor_Get,
+ },
+ (void*)&upb_EnumDef_FindValueByName,
+ (void*)&upb_EnumValueDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetValuesByNumber(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNumberMap_Funcs funcs = {
+ {
+ (void*)&upb_EnumDef_ValueCount,
+ (void*)&upb_EnumDef_Value,
+ (void*)&PyUpb_EnumValueDescriptor_Get,
+ },
+ (void*)&upb_EnumDef_FindValueByNumber,
+ (void*)&upb_EnumValueDef_Number,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNumberMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetContainingType(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ const upb_MessageDef* m = upb_EnumDef_ContainingType(self->def);
+ if (!m) Py_RETURN_NONE;
+ return PyUpb_Descriptor_Get(m);
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetHasOptions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_EnumDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_EnumDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(self, upb_EnumDef_Options(self->def),
+ &google_protobuf_EnumOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE
+ ".EnumOptions");
+}
+
+static PyObject* PyUpb_EnumDescriptor_CopyToProto(PyObject* _self,
+ PyObject* py_proto) {
+ return PyUpb_DescriptorBase_CopyToProto(
+ _self, (PyUpb_ToProto_Func*)&upb_EnumDef_ToProto,
+ &google_protobuf_EnumDescriptorProto_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".EnumDescriptorProto", py_proto);
+}
+
+static PyGetSetDef PyUpb_EnumDescriptor_Getters[] = {
+ {"full_name", PyUpb_EnumDescriptor_GetFullName, NULL, "Full name"},
+ {"name", PyUpb_EnumDescriptor_GetName, NULL, "last name"},
+ {"file", PyUpb_EnumDescriptor_GetFile, NULL, "File descriptor"},
+ {"values", PyUpb_EnumDescriptor_GetValues, NULL, "values"},
+ {"values_by_name", PyUpb_EnumDescriptor_GetValuesByName, NULL,
+ "Enum values by name"},
+ {"values_by_number", PyUpb_EnumDescriptor_GetValuesByNumber, NULL,
+ "Enum values by number"},
+ {"containing_type", PyUpb_EnumDescriptor_GetContainingType, NULL,
+ "Containing type"},
+ {"has_options", PyUpb_EnumDescriptor_GetHasOptions, NULL, "Has Options"},
+ {NULL}};
+
+static PyMethodDef PyUpb_EnumDescriptor_Methods[] = {
+ {"GetOptions", PyUpb_EnumDescriptor_GetOptions, METH_NOARGS},
+ {"CopyToProto", PyUpb_EnumDescriptor_CopyToProto, METH_O},
+ {NULL}};
+
+static PyType_Slot PyUpb_EnumDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_EnumDescriptor_Methods},
+ {Py_tp_getset, PyUpb_EnumDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_EnumDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".EnumDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_EnumDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// EnumValueDescriptor
+// -----------------------------------------------------------------------------
+
+PyObject* PyUpb_EnumValueDescriptor_Get(const upb_EnumValueDef* ev) {
+ const upb_FileDef* file = upb_EnumDef_File(upb_EnumValueDef_Enum(ev));
+ return PyUpb_DescriptorBase_Get(kPyUpb_EnumValueDescriptor, ev, file);
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetName(PyObject* self,
+ void* closure) {
+ PyUpb_DescriptorBase* base = (PyUpb_DescriptorBase*)self;
+ return PyUnicode_FromString(upb_EnumValueDef_Name(base->def));
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetNumber(PyObject* self,
+ void* closure) {
+ PyUpb_DescriptorBase* base = (PyUpb_DescriptorBase*)self;
+ return PyLong_FromLong(upb_EnumValueDef_Number(base->def));
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetIndex(PyObject* self,
+ void* closure) {
+ PyUpb_DescriptorBase* base = (PyUpb_DescriptorBase*)self;
+ return PyLong_FromLong(upb_EnumValueDef_Index(base->def));
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetType(PyObject* self,
+ void* closure) {
+ PyUpb_DescriptorBase* base = (PyUpb_DescriptorBase*)self;
+ return PyUpb_EnumDescriptor_Get(upb_EnumValueDef_Enum(base->def));
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetHasOptions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_EnumValueDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_EnumValueDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(
+ self, upb_EnumValueDef_Options(self->def),
+ &google_protobuf_EnumValueOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".EnumValueOptions");
+}
+
+static PyGetSetDef PyUpb_EnumValueDescriptor_Getters[] = {
+ {"name", PyUpb_EnumValueDescriptor_GetName, NULL, "name"},
+ {"number", PyUpb_EnumValueDescriptor_GetNumber, NULL, "number"},
+ {"index", PyUpb_EnumValueDescriptor_GetIndex, NULL, "index"},
+ {"type", PyUpb_EnumValueDescriptor_GetType, NULL, "index"},
+ {"has_options", PyUpb_EnumValueDescriptor_GetHasOptions, NULL,
+ "Has Options"},
+ {NULL}};
+
+static PyMethodDef PyUpb_EnumValueDescriptor_Methods[] = {
+ {
+ "GetOptions",
+ PyUpb_EnumValueDescriptor_GetOptions,
+ METH_NOARGS,
+ },
+ {NULL}};
+
+static PyType_Slot PyUpb_EnumValueDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_EnumValueDescriptor_Methods},
+ {Py_tp_getset, PyUpb_EnumValueDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_EnumValueDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".EnumValueDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_EnumValueDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// FieldDescriptor
+// -----------------------------------------------------------------------------
+
+const upb_FieldDef* PyUpb_FieldDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_FieldDescriptor);
+ return self ? self->def : NULL;
+}
+
+PyObject* PyUpb_FieldDescriptor_Get(const upb_FieldDef* field) {
+ const upb_FileDef* file = upb_FieldDef_File(field);
+ return PyUpb_DescriptorBase_Get(kPyUpb_FieldDescriptor, field, file);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetFullName(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyUnicode_FromString(upb_FieldDef_FullName(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetName(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyUnicode_FromString(upb_FieldDef_Name(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetCamelCaseName(
+ PyUpb_DescriptorBase* self, void* closure) {
+ // TODO: Ok to use jsonname here?
+ return PyUnicode_FromString(upb_FieldDef_JsonName(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetJsonName(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyUnicode_FromString(upb_FieldDef_JsonName(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetFile(PyUpb_DescriptorBase* self,
+ void* closure) {
+ const upb_FileDef* file = upb_FieldDef_File(self->def);
+ if (!file) Py_RETURN_NONE;
+ return PyUpb_FileDescriptor_Get(file);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetType(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyLong_FromLong(upb_FieldDef_Type(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetCppType(PyUpb_DescriptorBase* self,
+ void* closure) {
+ // Enum values copied from descriptor.h in C++.
+ enum CppType {
+ CPPTYPE_INT32 = 1, // TYPE_INT32, TYPE_SINT32, TYPE_SFIXED32
+ CPPTYPE_INT64 = 2, // TYPE_INT64, TYPE_SINT64, TYPE_SFIXED64
+ CPPTYPE_UINT32 = 3, // TYPE_UINT32, TYPE_FIXED32
+ CPPTYPE_UINT64 = 4, // TYPE_UINT64, TYPE_FIXED64
+ CPPTYPE_DOUBLE = 5, // TYPE_DOUBLE
+ CPPTYPE_FLOAT = 6, // TYPE_FLOAT
+ CPPTYPE_BOOL = 7, // TYPE_BOOL
+ CPPTYPE_ENUM = 8, // TYPE_ENUM
+ CPPTYPE_STRING = 9, // TYPE_STRING, TYPE_BYTES
+ CPPTYPE_MESSAGE = 10, // TYPE_MESSAGE, TYPE_GROUP
+ };
+ static const uint8_t cpp_types[] = {
+ -1,
+ [kUpb_CType_Int32] = CPPTYPE_INT32,
+ [kUpb_CType_Int64] = CPPTYPE_INT64,
+ [kUpb_CType_UInt32] = CPPTYPE_UINT32,
+ [kUpb_CType_UInt64] = CPPTYPE_UINT64,
+ [kUpb_CType_Double] = CPPTYPE_DOUBLE,
+ [kUpb_CType_Float] = CPPTYPE_FLOAT,
+ [kUpb_CType_Bool] = CPPTYPE_BOOL,
+ [kUpb_CType_Enum] = CPPTYPE_ENUM,
+ [kUpb_CType_String] = CPPTYPE_STRING,
+ [kUpb_CType_Bytes] = CPPTYPE_STRING,
+ [kUpb_CType_Message] = CPPTYPE_MESSAGE,
+ };
+ return PyLong_FromLong(cpp_types[upb_FieldDef_CType(self->def)]);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetLabel(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyLong_FromLong(upb_FieldDef_Label(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetIsExtension(
+ PyUpb_DescriptorBase* self, void* closure) {
+ return PyBool_FromLong(upb_FieldDef_IsExtension(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetNumber(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyLong_FromLong(upb_FieldDef_Number(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetIndex(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyLong_FromLong(upb_FieldDef_Index(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetMessageType(
+ PyUpb_DescriptorBase* self, void* closure) {
+ const upb_MessageDef* subdef = upb_FieldDef_MessageSubDef(self->def);
+ if (!subdef) Py_RETURN_NONE;
+ return PyUpb_Descriptor_Get(subdef);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetEnumType(PyUpb_DescriptorBase* self,
+ void* closure) {
+ const upb_EnumDef* enumdef = upb_FieldDef_EnumSubDef(self->def);
+ if (!enumdef) Py_RETURN_NONE;
+ return PyUpb_EnumDescriptor_Get(enumdef);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetContainingType(
+ PyUpb_DescriptorBase* self, void* closure) {
+ const upb_MessageDef* m = upb_FieldDef_ContainingType(self->def);
+ if (!m) Py_RETURN_NONE;
+ return PyUpb_Descriptor_Get(m);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetExtensionScope(
+ PyUpb_DescriptorBase* self, void* closure) {
+ const upb_MessageDef* m = upb_FieldDef_ExtensionScope(self->def);
+ if (!m) Py_RETURN_NONE;
+ return PyUpb_Descriptor_Get(m);
+}
+
+static PyObject* PyUpb_FieldDescriptor_HasDefaultValue(
+ PyUpb_DescriptorBase* self, void* closure) {
+ return PyBool_FromLong(upb_FieldDef_HasDefault(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetDefaultValue(
+ PyUpb_DescriptorBase* self, void* closure) {
+ const upb_FieldDef* f = self->def;
+ if (upb_FieldDef_IsRepeated(f)) return PyList_New(0);
+ if (upb_FieldDef_IsSubMessage(f)) Py_RETURN_NONE;
+ return PyUpb_UpbToPy(upb_FieldDef_Default(self->def), self->def, NULL);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetContainingOneof(
+ PyUpb_DescriptorBase* self, void* closure) {
+ const upb_OneofDef* oneof = upb_FieldDef_ContainingOneof(self->def);
+ if (!oneof) Py_RETURN_NONE;
+ return PyUpb_OneofDescriptor_Get(oneof);
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetHasOptions(
+ PyUpb_DescriptorBase* _self, void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_FieldDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_FieldDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(self, upb_FieldDef_Options(self->def),
+ &google_protobuf_FieldOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE
+ ".FieldOptions");
+}
+
+static PyGetSetDef PyUpb_FieldDescriptor_Getters[] = {
+ {"full_name", (getter)PyUpb_FieldDescriptor_GetFullName, NULL, "Full name"},
+ {"name", (getter)PyUpb_FieldDescriptor_GetName, NULL, "Unqualified name"},
+ {"camelcase_name", (getter)PyUpb_FieldDescriptor_GetCamelCaseName, NULL,
+ "CamelCase name"},
+ {"json_name", (getter)PyUpb_FieldDescriptor_GetJsonName, NULL, "Json name"},
+ {"file", (getter)PyUpb_FieldDescriptor_GetFile, NULL, "File Descriptor"},
+ {"type", (getter)PyUpb_FieldDescriptor_GetType, NULL, "Type"},
+ {"cpp_type", (getter)PyUpb_FieldDescriptor_GetCppType, NULL, "C++ Type"},
+ {"label", (getter)PyUpb_FieldDescriptor_GetLabel, NULL, "Label"},
+ {"number", (getter)PyUpb_FieldDescriptor_GetNumber, NULL, "Number"},
+ {"index", (getter)PyUpb_FieldDescriptor_GetIndex, NULL, "Index"},
+ {"default_value", (getter)PyUpb_FieldDescriptor_GetDefaultValue, NULL,
+ "Default Value"},
+ {"has_default_value", (getter)PyUpb_FieldDescriptor_HasDefaultValue},
+ {"is_extension", (getter)PyUpb_FieldDescriptor_GetIsExtension, NULL, "ID"},
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ //{ "id", (getter)GetID, NULL, "ID"},
+ {"message_type", (getter)PyUpb_FieldDescriptor_GetMessageType, NULL,
+ "Message type"},
+ {"enum_type", (getter)PyUpb_FieldDescriptor_GetEnumType, NULL, "Enum type"},
+ {"containing_type", (getter)PyUpb_FieldDescriptor_GetContainingType, NULL,
+ "Containing type"},
+ {"extension_scope", (getter)PyUpb_FieldDescriptor_GetExtensionScope, NULL,
+ "Extension scope"},
+ {"containing_oneof", (getter)PyUpb_FieldDescriptor_GetContainingOneof, NULL,
+ "Containing oneof"},
+ {"has_options", (getter)PyUpb_FieldDescriptor_GetHasOptions, NULL,
+ "Has Options"},
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ //{ "_options",
+ //(getter)NULL, (setter)SetOptions, "Options"}, { "_serialized_options",
+ //(getter)NULL, (setter)SetSerializedOptions, "Serialized Options"},
+ {NULL}};
+
+static PyMethodDef PyUpb_FieldDescriptor_Methods[] = {
+ {
+ "GetOptions",
+ PyUpb_FieldDescriptor_GetOptions,
+ METH_NOARGS,
+ },
+ {NULL}};
+
+static PyType_Slot PyUpb_FieldDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_FieldDescriptor_Methods},
+ {Py_tp_getset, PyUpb_FieldDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_FieldDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".FieldDescriptor",
+ sizeof(PyUpb_DescriptorBase),
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT,
+ PyUpb_FieldDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// FileDescriptor
+// -----------------------------------------------------------------------------
+
+PyObject* PyUpb_FileDescriptor_Get(const upb_FileDef* file) {
+ return PyUpb_DescriptorBase_Get(kPyUpb_FileDescriptor, file, file);
+}
+
+// These are not provided on upb_FileDef because they use the underlying
+// symtab's hash table. This works for Python because everything happens under
+// the GIL, but in general the caller has to guarantee that the symtab is not
+// being mutated concurrently.
+typedef const void* PyUpb_FileDescriptor_LookupFunc(const upb_DefPool*,
+ const char*);
+
+static const void* PyUpb_FileDescriptor_NestedLookup(
+ const upb_FileDef* filedef, const char* name,
+ PyUpb_FileDescriptor_LookupFunc* func) {
+ const upb_DefPool* symtab = upb_FileDef_Pool(filedef);
+ const char* package = upb_FileDef_Package(filedef);
+ if (package) {
+ PyObject* qname = PyUnicode_FromFormat("%s.%s", package, name);
+ const void* ret = func(symtab, PyUnicode_AsUTF8AndSize(qname, NULL));
+ Py_DECREF(qname);
+ return ret;
+ } else {
+ return func(symtab, name);
+ }
+}
+
+static const void* PyUpb_FileDescriptor_LookupMessage(
+ const upb_FileDef* filedef, const char* name) {
+ return PyUpb_FileDescriptor_NestedLookup(
+ filedef, name, (void*)&upb_DefPool_FindMessageByName);
+}
+
+static const void* PyUpb_FileDescriptor_LookupEnum(const upb_FileDef* filedef,
+ const char* name) {
+ return PyUpb_FileDescriptor_NestedLookup(filedef, name,
+ (void*)&upb_DefPool_FindEnumByName);
+}
+
+static const void* PyUpb_FileDescriptor_LookupExtension(
+ const upb_FileDef* filedef, const char* name) {
+ return PyUpb_FileDescriptor_NestedLookup(
+ filedef, name, (void*)&upb_DefPool_FindExtensionByName);
+}
+
+static const void* PyUpb_FileDescriptor_LookupService(
+ const upb_FileDef* filedef, const char* name) {
+ return PyUpb_FileDescriptor_NestedLookup(
+ filedef, name, (void*)&upb_DefPool_FindServiceByName);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetName(PyUpb_DescriptorBase* self,
+ void* closure) {
+ return PyUnicode_FromString(upb_FileDef_Name(self->def));
+}
+
+static PyObject* PyUpb_FileDescriptor_GetPool(PyObject* _self, void* closure) {
+ PyUpb_DescriptorBase* self = (PyUpb_DescriptorBase*)_self;
+ Py_INCREF(self->pool);
+ return self->pool;
+}
+
+static PyObject* PyUpb_FileDescriptor_GetPackage(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (PyUpb_DescriptorBase*)_self;
+ return PyUnicode_FromString(upb_FileDef_Package(self->def));
+}
+
+static PyObject* PyUpb_FileDescriptor_GetSerializedPb(PyObject* self,
+ void* closure) {
+ return PyUpb_DescriptorBase_GetSerializedProto(
+ self, (PyUpb_ToProto_Func*)&upb_FileDef_ToProto,
+ &google_protobuf_FileDescriptorProto_msginit);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetMessageTypesByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_FileDef_TopLevelMessageCount,
+ (void*)&upb_FileDef_TopLevelMessage,
+ (void*)&PyUpb_Descriptor_Get,
+ },
+ (void*)&PyUpb_FileDescriptor_LookupMessage,
+ (void*)&upb_MessageDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetEnumTypesByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_FileDef_TopLevelEnumCount,
+ (void*)&upb_FileDef_TopLevelEnum,
+ (void*)&PyUpb_EnumDescriptor_Get,
+ },
+ (void*)&PyUpb_FileDescriptor_LookupEnum,
+ (void*)&upb_EnumDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetExtensionsByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_FileDef_TopLevelExtensionCount,
+ (void*)&upb_FileDef_TopLevelExtension,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ },
+ (void*)&PyUpb_FileDescriptor_LookupExtension,
+ (void*)&upb_FieldDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetServicesByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_FileDef_ServiceCount,
+ (void*)&upb_FileDef_Service,
+ (void*)&PyUpb_ServiceDescriptor_Get,
+ },
+ (void*)&PyUpb_FileDescriptor_LookupService,
+ (void*)&upb_ServiceDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetDependencies(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_FileDef_DependencyCount,
+ (void*)&upb_FileDef_Dependency,
+ (void*)&PyUpb_FileDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetPublicDependencies(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_FileDef_PublicDependencyCount,
+ (void*)&upb_FileDef_PublicDependency,
+ (void*)&PyUpb_FileDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetSyntax(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ const char* syntax =
+ upb_FileDef_Syntax(self->def) == kUpb_Syntax_Proto2 ? "proto2" : "proto3";
+ return PyUnicode_FromString(syntax);
+}
+
+static PyObject* PyUpb_FileDescriptor_GetHasOptions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_FileDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_FileDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(self, upb_FileDef_Options(self->def),
+ &google_protobuf_FileOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE
+ ".FileOptions");
+}
+
+static PyObject* PyUpb_FileDescriptor_CopyToProto(PyObject* _self,
+ PyObject* py_proto) {
+ return PyUpb_DescriptorBase_CopyToProto(
+ _self, (PyUpb_ToProto_Func*)&upb_FileDef_ToProto,
+ &google_protobuf_FileDescriptorProto_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileDescriptorProto", py_proto);
+}
+
+static PyGetSetDef PyUpb_FileDescriptor_Getters[] = {
+ {"pool", PyUpb_FileDescriptor_GetPool, NULL, "pool"},
+ {"name", (getter)PyUpb_FileDescriptor_GetName, NULL, "name"},
+ {"package", PyUpb_FileDescriptor_GetPackage, NULL, "package"},
+ {"serialized_pb", PyUpb_FileDescriptor_GetSerializedPb},
+ {"message_types_by_name", PyUpb_FileDescriptor_GetMessageTypesByName, NULL,
+ "Messages by name"},
+ {"enum_types_by_name", PyUpb_FileDescriptor_GetEnumTypesByName, NULL,
+ "Enums by name"},
+ {"extensions_by_name", PyUpb_FileDescriptor_GetExtensionsByName, NULL,
+ "Extensions by name"},
+ {"services_by_name", PyUpb_FileDescriptor_GetServicesByName, NULL,
+ "Services by name"},
+ {"dependencies", PyUpb_FileDescriptor_GetDependencies, NULL,
+ "Dependencies"},
+ {"public_dependencies", PyUpb_FileDescriptor_GetPublicDependencies, NULL,
+ "Dependencies"},
+ {"has_options", PyUpb_FileDescriptor_GetHasOptions, NULL, "Has Options"},
+ {"syntax", PyUpb_FileDescriptor_GetSyntax, (setter)NULL, "Syntax"},
+ {NULL},
+};
+
+static PyMethodDef PyUpb_FileDescriptor_Methods[] = {
+ {"GetOptions", PyUpb_FileDescriptor_GetOptions, METH_NOARGS},
+ {"CopyToProto", PyUpb_FileDescriptor_CopyToProto, METH_O},
+ {NULL}};
+
+static PyType_Slot PyUpb_FileDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_FileDescriptor_Methods},
+ {Py_tp_getset, PyUpb_FileDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_FileDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".FileDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_FileDescriptor_Slots,
+};
+
+const upb_FileDef* PyUpb_FileDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_FileDescriptor);
+ return self ? self->def : NULL;
+}
+
+// -----------------------------------------------------------------------------
+// MethodDescriptor
+// -----------------------------------------------------------------------------
+
+const upb_MethodDef* PyUpb_MethodDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_MethodDescriptor);
+ return self ? self->def : NULL;
+}
+
+PyObject* PyUpb_MethodDescriptor_Get(const upb_MethodDef* m) {
+ const upb_FileDef* file = upb_ServiceDef_File(upb_MethodDef_Service(m));
+ return PyUpb_DescriptorBase_Get(kPyUpb_MethodDescriptor, m, file);
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetName(PyObject* self, void* closure) {
+ const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_MethodDef_Name(m));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetFullName(PyObject* self,
+ void* closure) {
+ const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_MethodDef_FullName(m));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetIndex(PyObject* self,
+ void* closure) {
+ const upb_MethodDef* oneof = PyUpb_MethodDescriptor_GetDef(self);
+ return PyLong_FromLong(upb_MethodDef_Index(oneof));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetContainingService(PyObject* self,
+ void* closure) {
+ const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self);
+ return PyUpb_ServiceDescriptor_Get(upb_MethodDef_Service(m));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetInputType(PyObject* self,
+ void* closure) {
+ const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self);
+ return PyUpb_Descriptor_Get(upb_MethodDef_InputType(m));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetOutputType(PyObject* self,
+ void* closure) {
+ const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self);
+ return PyUpb_Descriptor_Get(upb_MethodDef_OutputType(m));
+}
+
+static PyObject* PyUpb_MethodDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(self, upb_MethodDef_Options(self->def),
+ &google_protobuf_MethodOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE
+ ".MethodOptions");
+}
+
+static PyObject* PyUpb_MethodDescriptor_CopyToProto(PyObject* _self,
+ PyObject* py_proto) {
+ return PyUpb_DescriptorBase_CopyToProto(
+ _self, (PyUpb_ToProto_Func*)&upb_MethodDef_ToProto,
+ &google_protobuf_MethodDescriptorProto_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".MethodDescriptorProto", py_proto);
+}
+
+static PyGetSetDef PyUpb_MethodDescriptor_Getters[] = {
+ {"name", PyUpb_MethodDescriptor_GetName, NULL, "Name", NULL},
+ {"full_name", PyUpb_MethodDescriptor_GetFullName, NULL, "Full name", NULL},
+ {"index", PyUpb_MethodDescriptor_GetIndex, NULL, "Index", NULL},
+ {"containing_service", PyUpb_MethodDescriptor_GetContainingService, NULL,
+ "Containing service", NULL},
+ {"input_type", PyUpb_MethodDescriptor_GetInputType, NULL, "Input type",
+ NULL},
+ {"output_type", PyUpb_MethodDescriptor_GetOutputType, NULL, "Output type",
+ NULL},
+ {NULL}};
+
+static PyMethodDef PyUpb_MethodDescriptor_Methods[] = {
+ {"GetOptions", PyUpb_MethodDescriptor_GetOptions, METH_NOARGS},
+ {"CopyToProto", PyUpb_MethodDescriptor_CopyToProto, METH_O},
+ {NULL}};
+
+static PyType_Slot PyUpb_MethodDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_MethodDescriptor_Methods},
+ {Py_tp_getset, PyUpb_MethodDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_MethodDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".MethodDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_MethodDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// OneofDescriptor
+// -----------------------------------------------------------------------------
+
+const upb_OneofDef* PyUpb_OneofDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_OneofDescriptor);
+ return self ? self->def : NULL;
+}
+
+PyObject* PyUpb_OneofDescriptor_Get(const upb_OneofDef* oneof) {
+ const upb_FileDef* file =
+ upb_MessageDef_File(upb_OneofDef_ContainingType(oneof));
+ return PyUpb_DescriptorBase_Get(kPyUpb_OneofDescriptor, oneof, file);
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetName(PyObject* self, void* closure) {
+ const upb_OneofDef* oneof = PyUpb_OneofDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_OneofDef_Name(oneof));
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetFullName(PyObject* self,
+ void* closure) {
+ const upb_OneofDef* oneof = PyUpb_OneofDescriptor_GetDef(self);
+ return PyUnicode_FromFormat(
+ "%s.%s", upb_MessageDef_FullName(upb_OneofDef_ContainingType(oneof)),
+ upb_OneofDef_Name(oneof));
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetIndex(PyObject* self, void* closure) {
+ const upb_OneofDef* oneof = PyUpb_OneofDescriptor_GetDef(self);
+ return PyLong_FromLong(upb_OneofDef_Index(oneof));
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetContainingType(PyObject* self,
+ void* closure) {
+ const upb_OneofDef* oneof = PyUpb_OneofDescriptor_GetDef(self);
+ return PyUpb_Descriptor_Get(upb_OneofDef_ContainingType(oneof));
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetHasOptions(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyBool_FromLong(upb_OneofDef_HasOptions(self->def));
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetFields(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_OneofDef_FieldCount,
+ (void*)&upb_OneofDef_Field,
+ (void*)&PyUpb_FieldDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_OneofDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(self, upb_OneofDef_Options(self->def),
+ &google_protobuf_OneofOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE
+ ".OneofOptions");
+}
+
+static PyGetSetDef PyUpb_OneofDescriptor_Getters[] = {
+ {"name", PyUpb_OneofDescriptor_GetName, NULL, "Name"},
+ {"full_name", PyUpb_OneofDescriptor_GetFullName, NULL, "Full name"},
+ {"index", PyUpb_OneofDescriptor_GetIndex, NULL, "Index"},
+ {"containing_type", PyUpb_OneofDescriptor_GetContainingType, NULL,
+ "Containing type"},
+ {"has_options", PyUpb_OneofDescriptor_GetHasOptions, NULL, "Has Options"},
+ {"fields", PyUpb_OneofDescriptor_GetFields, NULL, "Fields"},
+ {NULL}};
+
+static PyMethodDef PyUpb_OneofDescriptor_Methods[] = {
+ {"GetOptions", PyUpb_OneofDescriptor_GetOptions, METH_NOARGS}, {NULL}};
+
+static PyType_Slot PyUpb_OneofDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_OneofDescriptor_Methods},
+ {Py_tp_getset, PyUpb_OneofDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_OneofDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".OneofDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_OneofDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// ServiceDescriptor
+// -----------------------------------------------------------------------------
+
+const upb_ServiceDef* PyUpb_ServiceDescriptor_GetDef(PyObject* _self) {
+ PyUpb_DescriptorBase* self =
+ PyUpb_DescriptorBase_Check(_self, kPyUpb_ServiceDescriptor);
+ return self ? self->def : NULL;
+}
+
+PyObject* PyUpb_ServiceDescriptor_Get(const upb_ServiceDef* s) {
+ const upb_FileDef* file = upb_ServiceDef_File(s);
+ return PyUpb_DescriptorBase_Get(kPyUpb_ServiceDescriptor, s, file);
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetFullName(PyObject* self,
+ void* closure) {
+ const upb_ServiceDef* s = PyUpb_ServiceDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_ServiceDef_FullName(s));
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetName(PyObject* self,
+ void* closure) {
+ const upb_ServiceDef* s = PyUpb_ServiceDescriptor_GetDef(self);
+ return PyUnicode_FromString(upb_ServiceDef_Name(s));
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetFile(PyObject* self,
+ void* closure) {
+ const upb_ServiceDef* s = PyUpb_ServiceDescriptor_GetDef(self);
+ return PyUpb_FileDescriptor_Get(upb_ServiceDef_File(s));
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetIndex(PyObject* self,
+ void* closure) {
+ const upb_ServiceDef* s = PyUpb_ServiceDescriptor_GetDef(self);
+ return PyLong_FromLong(upb_ServiceDef_Index(s));
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetMethods(PyObject* _self,
+ void* closure) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ static PyUpb_GenericSequence_Funcs funcs = {
+ (void*)&upb_ServiceDef_MethodCount,
+ (void*)&upb_ServiceDef_Method,
+ (void*)&PyUpb_MethodDescriptor_Get,
+ };
+ return PyUpb_GenericSequence_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetMethodsByName(PyObject* _self,
+ void* closure) {
+ static PyUpb_ByNameMap_Funcs funcs = {
+ {
+ (void*)&upb_ServiceDef_MethodCount,
+ (void*)&upb_ServiceDef_Method,
+ (void*)&PyUpb_MethodDescriptor_Get,
+ },
+ (void*)&upb_ServiceDef_FindMethodByName,
+ (void*)&upb_MethodDef_Name,
+ };
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_ByNameMap_New(&funcs, self->def, self->pool);
+}
+
+static PyObject* PyUpb_ServiceDescriptor_GetOptions(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ return PyUpb_DescriptorBase_GetOptions(
+ self, upb_ServiceDef_Options(self->def),
+ &google_protobuf_ServiceOptions_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".ServiceOptions");
+}
+
+static PyObject* PyUpb_ServiceDescriptor_CopyToProto(PyObject* _self,
+ PyObject* py_proto) {
+ return PyUpb_DescriptorBase_CopyToProto(
+ _self, (PyUpb_ToProto_Func*)&upb_ServiceDef_ToProto,
+ &google_protobuf_ServiceDescriptorProto_msginit,
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".ServiceDescriptorProto", py_proto);
+}
+
+static PyObject* PyUpb_ServiceDescriptor_FindMethodByName(PyObject* _self,
+ PyObject* py_name) {
+ PyUpb_DescriptorBase* self = (void*)_self;
+ const char* name = PyUnicode_AsUTF8AndSize(py_name, NULL);
+ if (!name) return NULL;
+ const upb_MethodDef* method =
+ upb_ServiceDef_FindMethodByName(self->def, name);
+ if (method == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find method %.200s", name);
+ }
+ return PyUpb_MethodDescriptor_Get(method);
+}
+
+static PyGetSetDef PyUpb_ServiceDescriptor_Getters[] = {
+ {"name", PyUpb_ServiceDescriptor_GetName, NULL, "Name", NULL},
+ {"full_name", PyUpb_ServiceDescriptor_GetFullName, NULL, "Full name", NULL},
+ {"file", PyUpb_ServiceDescriptor_GetFile, NULL, "File descriptor"},
+ {"index", PyUpb_ServiceDescriptor_GetIndex, NULL, "Index", NULL},
+ {"methods", PyUpb_ServiceDescriptor_GetMethods, NULL, "Methods", NULL},
+ {"methods_by_name", PyUpb_ServiceDescriptor_GetMethodsByName, NULL,
+ "Methods by name", NULL},
+ {NULL}};
+
+static PyMethodDef PyUpb_ServiceDescriptor_Methods[] = {
+ {"GetOptions", PyUpb_ServiceDescriptor_GetOptions, METH_NOARGS},
+ {"CopyToProto", PyUpb_ServiceDescriptor_CopyToProto, METH_O},
+ {"FindMethodByName", PyUpb_ServiceDescriptor_FindMethodByName, METH_O},
+ {NULL}};
+
+static PyType_Slot PyUpb_ServiceDescriptor_Slots[] = {
+ DESCRIPTOR_BASE_SLOTS,
+ {Py_tp_methods, PyUpb_ServiceDescriptor_Methods},
+ {Py_tp_getset, PyUpb_ServiceDescriptor_Getters},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_ServiceDescriptor_Spec = {
+ PYUPB_MODULE_NAME ".ServiceDescriptor", // tp_name
+ sizeof(PyUpb_DescriptorBase), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_ServiceDescriptor_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+static bool PyUpb_SetIntAttr(PyObject* obj, const char* name, int val) {
+ PyObject* num = PyLong_FromLong(val);
+ if (!num) return false;
+ int status = PyObject_SetAttrString(obj, name, num);
+ Py_DECREF(num);
+ return status >= 0;
+}
+
+// These must be in the same order as PyUpb_DescriptorType in the header.
+static PyType_Spec* desc_specs[] = {
+ &PyUpb_Descriptor_Spec, &PyUpb_EnumDescriptor_Spec,
+ &PyUpb_EnumValueDescriptor_Spec, &PyUpb_FieldDescriptor_Spec,
+ &PyUpb_FileDescriptor_Spec, &PyUpb_MethodDescriptor_Spec,
+ &PyUpb_OneofDescriptor_Spec, &PyUpb_ServiceDescriptor_Spec,
+};
+
+bool PyUpb_InitDescriptor(PyObject* m) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_GetFromModule(m);
+
+ for (size_t i = 0; i < kPyUpb_Descriptor_Count; i++) {
+ s->descriptor_types[i] = PyUpb_AddClass(m, desc_specs[i]);
+ if (!s->descriptor_types[i]) {
+ return false;
+ }
+ }
+
+ PyObject* fd = (PyObject*)s->descriptor_types[kPyUpb_FieldDescriptor];
+ return PyUpb_SetIntAttr(fd, "LABEL_OPTIONAL", kUpb_Label_Optional) &&
+ PyUpb_SetIntAttr(fd, "LABEL_REPEATED", kUpb_Label_Repeated) &&
+ PyUpb_SetIntAttr(fd, "LABEL_REQUIRED", kUpb_Label_Required) &&
+ PyUpb_SetIntAttr(fd, "TYPE_BOOL", kUpb_FieldType_Bool) &&
+ PyUpb_SetIntAttr(fd, "TYPE_BYTES", kUpb_FieldType_Bytes) &&
+ PyUpb_SetIntAttr(fd, "TYPE_DOUBLE", kUpb_FieldType_Double) &&
+ PyUpb_SetIntAttr(fd, "TYPE_ENUM", kUpb_FieldType_Enum) &&
+ PyUpb_SetIntAttr(fd, "TYPE_FIXED32", kUpb_FieldType_Fixed32) &&
+ PyUpb_SetIntAttr(fd, "TYPE_FIXED64", kUpb_FieldType_Fixed64) &&
+ PyUpb_SetIntAttr(fd, "TYPE_FLOAT", kUpb_FieldType_Float) &&
+ PyUpb_SetIntAttr(fd, "TYPE_GROUP", kUpb_FieldType_Group) &&
+ PyUpb_SetIntAttr(fd, "TYPE_INT32", kUpb_FieldType_Int32) &&
+ PyUpb_SetIntAttr(fd, "TYPE_INT64", kUpb_FieldType_Int64) &&
+ PyUpb_SetIntAttr(fd, "TYPE_MESSAGE", kUpb_FieldType_Message) &&
+ PyUpb_SetIntAttr(fd, "TYPE_SFIXED32", kUpb_FieldType_SFixed32) &&
+ PyUpb_SetIntAttr(fd, "TYPE_SFIXED64", kUpb_FieldType_SFixed64) &&
+ PyUpb_SetIntAttr(fd, "TYPE_SINT32", kUpb_FieldType_SInt32) &&
+ PyUpb_SetIntAttr(fd, "TYPE_SINT64", kUpb_FieldType_SInt64) &&
+ PyUpb_SetIntAttr(fd, "TYPE_STRING", kUpb_FieldType_String) &&
+ PyUpb_SetIntAttr(fd, "TYPE_UINT32", kUpb_FieldType_UInt32) &&
+ PyUpb_SetIntAttr(fd, "TYPE_UINT64", kUpb_FieldType_UInt64);
+}
diff --git a/grpc/third_party/upb/python/descriptor.h b/grpc/third_party/upb/python/descriptor.h
new file mode 100644
index 00000000..6cb6c1c2
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_DESCRIPTOR_H__
+#define PYUPB_DESCRIPTOR_H__
+
+#include <stdbool.h>
+
+#include "python/python.h"
+#include "upb/def.h"
+
+typedef enum {
+ kPyUpb_Descriptor = 0,
+ kPyUpb_EnumDescriptor = 1,
+ kPyUpb_EnumValueDescriptor = 2,
+ kPyUpb_FieldDescriptor = 3,
+ kPyUpb_FileDescriptor = 4,
+ kPyUpb_MethodDescriptor = 5,
+ kPyUpb_OneofDescriptor = 6,
+ kPyUpb_ServiceDescriptor = 7,
+ kPyUpb_Descriptor_Count = 8,
+} PyUpb_DescriptorType;
+
+// Given a descriptor object |desc|, returns a Python message class object for
+// the msgdef |m|, which must be from the same pool.
+PyObject* PyUpb_Descriptor_GetClass(const upb_MessageDef* m);
+
+// Returns a Python wrapper object for the given def. This will return an
+// existing object if one already exists, otherwise a new object will be
+// created. The caller always owns a ref on the returned object.
+PyObject* PyUpb_Descriptor_Get(const upb_MessageDef* msgdef);
+PyObject* PyUpb_EnumDescriptor_Get(const upb_EnumDef* enumdef);
+PyObject* PyUpb_FieldDescriptor_Get(const upb_FieldDef* field);
+PyObject* PyUpb_FileDescriptor_Get(const upb_FileDef* file);
+PyObject* PyUpb_OneofDescriptor_Get(const upb_OneofDef* oneof);
+PyObject* PyUpb_EnumValueDescriptor_Get(const upb_EnumValueDef* enumval);
+PyObject* PyUpb_Descriptor_GetOrCreateWrapper(const upb_MessageDef* msg);
+PyObject* PyUpb_ServiceDescriptor_Get(const upb_ServiceDef* s);
+PyObject* PyUpb_MethodDescriptor_Get(const upb_MethodDef* s);
+
+// Returns the underlying |def| for a given wrapper object. The caller must
+// have already verified that the given Python object is of the expected type.
+const upb_FileDef* PyUpb_FileDescriptor_GetDef(PyObject* file);
+const upb_FieldDef* PyUpb_FieldDescriptor_GetDef(PyObject* file);
+const upb_MessageDef* PyUpb_Descriptor_GetDef(PyObject* _self);
+const void* PyUpb_AnyDescriptor_GetDef(PyObject* _self);
+
+// Returns the underlying |def| for a given wrapper object. The caller must
+// have already verified that the given Python object is of the expected type.
+const upb_FileDef* PyUpb_FileDescriptor_GetDef(PyObject* file);
+const void* PyUpb_AnyDescriptor_GetDef(PyObject* _self);
+
+// Module-level init.
+bool PyUpb_InitDescriptor(PyObject* m);
+
+#endif // PYUPB_DESCRIPTOR_H__
diff --git a/grpc/third_party/upb/python/descriptor_containers.c b/grpc/third_party/upb/python/descriptor_containers.c
new file mode 100644
index 00000000..ac715852
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor_containers.c
@@ -0,0 +1,704 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "descriptor_containers.h"
+
+#include "descriptor.h"
+#include "protobuf.h"
+#include "upb/def.h"
+
+// -----------------------------------------------------------------------------
+// DescriptorIterator
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ const PyUpb_GenericSequence_Funcs* funcs;
+ const void* parent; // upb_MessageDef*, upb_DefPool*, etc.
+ PyObject* parent_obj; // Python object that keeps parent alive, we own a ref.
+ int index; // Current iterator index.
+} PyUpb_DescriptorIterator;
+
+PyUpb_DescriptorIterator* PyUpb_DescriptorIterator_Self(PyObject* obj) {
+ assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->descriptor_iterator_type);
+ return (PyUpb_DescriptorIterator*)obj;
+}
+
+static void PyUpb_DescriptorIterator_Dealloc(PyObject* _self) {
+ PyUpb_DescriptorIterator* self = PyUpb_DescriptorIterator_Self(_self);
+ Py_DECREF(self->parent_obj);
+ PyUpb_Dealloc(self);
+}
+
+PyObject* PyUpb_DescriptorIterator_New(const PyUpb_GenericSequence_Funcs* funcs,
+ const void* parent,
+ PyObject* parent_obj) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ PyUpb_DescriptorIterator* iter =
+ (void*)PyType_GenericAlloc(s->descriptor_iterator_type, 0);
+ iter->funcs = funcs;
+ iter->parent = parent;
+ iter->parent_obj = parent_obj;
+ iter->index = 0;
+ Py_INCREF(iter->parent_obj);
+ return &iter->ob_base;
+}
+
+PyObject* PyUpb_DescriptorIterator_IterNext(PyObject* _self) {
+ PyUpb_DescriptorIterator* self = PyUpb_DescriptorIterator_Self(_self);
+ int size = self->funcs->get_elem_count(self->parent);
+ if (self->index >= size) return NULL;
+ const void* elem = self->funcs->index(self->parent, self->index);
+ self->index++;
+ return self->funcs->get_elem_wrapper(elem);
+}
+
+static PyType_Slot PyUpb_DescriptorIterator_Slots[] = {
+ {Py_tp_dealloc, PyUpb_DescriptorIterator_Dealloc},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, PyUpb_DescriptorIterator_IterNext},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_DescriptorIterator_Spec = {
+ PYUPB_MODULE_NAME ".DescriptorIterator", // tp_name
+ sizeof(PyUpb_DescriptorIterator), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_DescriptorIterator_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// GenericSequence
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ const PyUpb_GenericSequence_Funcs* funcs;
+ const void* parent; // upb_MessageDef*, upb_DefPool*, etc.
+ PyObject* parent_obj; // Python object that keeps parent alive, we own a ref.
+} PyUpb_GenericSequence;
+
+PyUpb_GenericSequence* PyUpb_GenericSequence_Self(PyObject* obj) {
+ assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->generic_sequence_type);
+ return (PyUpb_GenericSequence*)obj;
+}
+
+static void PyUpb_GenericSequence_Dealloc(PyObject* _self) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ Py_CLEAR(self->parent_obj);
+ PyUpb_Dealloc(self);
+}
+
+PyObject* PyUpb_GenericSequence_New(const PyUpb_GenericSequence_Funcs* funcs,
+ const void* parent, PyObject* parent_obj) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ PyUpb_GenericSequence* seq =
+ (PyUpb_GenericSequence*)PyType_GenericAlloc(s->generic_sequence_type, 0);
+ seq->funcs = funcs;
+ seq->parent = parent;
+ seq->parent_obj = parent_obj;
+ Py_INCREF(parent_obj);
+ return &seq->ob_base;
+}
+
+static Py_ssize_t PyUpb_GenericSequence_Length(PyObject* _self) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ return self->funcs->get_elem_count(self->parent);
+}
+
+static PyObject* PyUpb_GenericSequence_GetItem(PyObject* _self,
+ Py_ssize_t index) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ Py_ssize_t size = self->funcs->get_elem_count(self->parent);
+ if (index < 0 || index >= size) {
+ PyErr_Format(PyExc_IndexError, "list index (%zd) out of range", index);
+ return NULL;
+ }
+ const void* elem = self->funcs->index(self->parent, index);
+ return self->funcs->get_elem_wrapper(elem);
+}
+
+// A sequence container can only be equal to another sequence container, or (for
+// backward compatibility) to a list containing the same items.
+// Returns 1 if equal, 0 if unequal, -1 on error.
+static int PyUpb_GenericSequence_IsEqual(PyUpb_GenericSequence* self,
+ PyObject* other) {
+ // Check the identity of C++ pointers.
+ if (PyObject_TypeCheck(other, Py_TYPE(self))) {
+ PyUpb_GenericSequence* other_seq = (void*)other;
+ return self->parent == other_seq->parent && self->funcs == other_seq->funcs;
+ }
+
+ if (!PyList_Check(other)) return 0;
+
+ // return list(self) == other
+ // We can clamp `i` to int because GenericSequence uses int for size (this
+ // is useful when we do int iteration below).
+ int n = PyUpb_GenericSequence_Length((PyObject*)self);
+ if ((Py_ssize_t)n != PyList_Size(other)) {
+ return false;
+ }
+
+ PyObject* item1;
+ for (int i = 0; i < n; i++) {
+ item1 = PyUpb_GenericSequence_GetItem((PyObject*)self, i);
+ PyObject* item2 = PyList_GetItem(other, i);
+ if (!item1 || !item2) goto error;
+ int cmp = PyObject_RichCompareBool(item1, item2, Py_EQ);
+ Py_DECREF(item1);
+ if (cmp != 1) return cmp;
+ }
+ // All items were found and equal
+ return 1;
+
+error:
+ Py_XDECREF(item1);
+ return -1;
+}
+
+static PyObject* PyUpb_GenericSequence_RichCompare(PyObject* _self,
+ PyObject* other, int opid) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ bool ret = PyUpb_GenericSequence_IsEqual(self, other);
+ if (opid == Py_NE) ret = !ret;
+ return PyBool_FromLong(ret);
+}
+
+// Linear search. Could optimize this in some cases (defs that have index),
+// but not all (FileDescriptor.dependencies).
+static int PyUpb_GenericSequence_Find(PyObject* _self, PyObject* item) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ const void* item_ptr = PyUpb_AnyDescriptor_GetDef(item);
+ int count = self->funcs->get_elem_count(self->parent);
+ for (int i = 0; i < count; i++) {
+ if (self->funcs->index(self->parent, i) == item_ptr) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+static PyObject* PyUpb_GenericSequence_Index(PyObject* self, PyObject* item) {
+ int position = PyUpb_GenericSequence_Find(self, item);
+ if (position < 0) {
+ PyErr_SetNone(PyExc_ValueError);
+ return NULL;
+ } else {
+ return PyLong_FromLong(position);
+ }
+}
+
+static PyObject* PyUpb_GenericSequence_Count(PyObject* _self, PyObject* item) {
+ PyUpb_GenericSequence* self = PyUpb_GenericSequence_Self(_self);
+ const void* item_ptr = PyUpb_AnyDescriptor_GetDef(item);
+ int n = self->funcs->get_elem_count(self->parent);
+ int count = 0;
+ for (int i = 0; i < n; i++) {
+ if (self->funcs->index(self->parent, i) == item_ptr) {
+ count++;
+ }
+ }
+ return PyLong_FromLong(count);
+}
+
+static PyObject* PyUpb_GenericSequence_Append(PyObject* self, PyObject* args) {
+ PyErr_Format(PyExc_TypeError, "'%R' is not a mutable sequence", self);
+ return NULL;
+}
+
+static PyMethodDef PyUpb_GenericSequence_Methods[] = {
+ {"index", PyUpb_GenericSequence_Index, METH_O},
+ {"count", PyUpb_GenericSequence_Count, METH_O},
+ {"append", PyUpb_GenericSequence_Append, METH_O},
+ // This was implemented for Python/C++ but so far has not been required.
+ //{ "__reversed__", (PyCFunction)Reversed, METH_NOARGS, },
+ {NULL}};
+
+static PyType_Slot PyUpb_GenericSequence_Slots[] = {
+ {Py_tp_dealloc, &PyUpb_GenericSequence_Dealloc},
+ {Py_tp_methods, &PyUpb_GenericSequence_Methods},
+ {Py_sq_length, PyUpb_GenericSequence_Length},
+ {Py_sq_item, PyUpb_GenericSequence_GetItem},
+ {Py_tp_richcompare, &PyUpb_GenericSequence_RichCompare},
+ // These were implemented for Python/C++ but so far have not been required.
+ // {Py_tp_repr, &PyUpb_GenericSequence_Repr},
+ // {Py_sq_contains, PyUpb_GenericSequence_Contains},
+ // {Py_mp_subscript, PyUpb_GenericSequence_Subscript},
+ // {Py_mp_ass_subscript, PyUpb_GenericSequence_AssignSubscript},
+ {0, NULL},
+};
+
+static PyType_Spec PyUpb_GenericSequence_Spec = {
+ PYUPB_MODULE_NAME "._GenericSequence", // tp_name
+ sizeof(PyUpb_GenericSequence), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_GenericSequence_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// ByNameMap
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ const PyUpb_ByNameMap_Funcs* funcs;
+ const void* parent; // upb_MessageDef*, upb_DefPool*, etc.
+ PyObject* parent_obj; // Python object that keeps parent alive, we own a ref.
+} PyUpb_ByNameMap;
+
+PyUpb_ByNameMap* PyUpb_ByNameMap_Self(PyObject* obj) {
+ assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_name_map_type);
+ return (PyUpb_ByNameMap*)obj;
+}
+
+static void PyUpb_ByNameMap_Dealloc(PyObject* _self) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ Py_DECREF(self->parent_obj);
+ PyUpb_Dealloc(self);
+}
+
+PyObject* PyUpb_ByNameMap_New(const PyUpb_ByNameMap_Funcs* funcs,
+ const void* parent, PyObject* parent_obj) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ PyUpb_ByNameMap* map = (void*)PyType_GenericAlloc(s->by_name_map_type, 0);
+ map->funcs = funcs;
+ map->parent = parent;
+ map->parent_obj = parent_obj;
+ Py_INCREF(parent_obj);
+ return &map->ob_base;
+}
+
+static Py_ssize_t PyUpb_ByNameMap_Length(PyObject* _self) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ return self->funcs->base.get_elem_count(self->parent);
+}
+
+static PyObject* PyUpb_ByNameMap_Subscript(PyObject* _self, PyObject* key) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ const char* name = PyUpb_GetStrData(key);
+ const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL;
+
+ if (elem) {
+ return self->funcs->base.get_elem_wrapper(elem);
+ } else {
+ PyErr_SetObject(PyExc_KeyError, key);
+ return NULL;
+ }
+}
+
+static int PyUpb_ByNameMap_AssignSubscript(PyObject* self, PyObject* key,
+ PyObject* value) {
+ PyErr_Format(PyExc_TypeError, PYUPB_MODULE_NAME
+ ".ByNameMap' object does not support item assignment");
+ return -1;
+}
+
+static int PyUpb_ByNameMap_Contains(PyObject* _self, PyObject* key) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ const char* name = PyUpb_GetStrData(key);
+ const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL;
+ return elem ? 1 : 0;
+}
+
+static PyObject* PyUpb_ByNameMap_Get(PyObject* _self, PyObject* args) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ PyObject* key;
+ PyObject* default_value = Py_None;
+ if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &default_value)) {
+ return NULL;
+ }
+
+ const char* name = PyUpb_GetStrData(key);
+ const void* elem = name ? self->funcs->lookup(self->parent, name) : NULL;
+
+ if (elem) {
+ return self->funcs->base.get_elem_wrapper(elem);
+ } else {
+ Py_INCREF(default_value);
+ return default_value;
+ }
+}
+
+static PyObject* PyUpb_ByNameMap_GetIter(PyObject* _self) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ return PyUpb_DescriptorIterator_New(&self->funcs->base, self->parent,
+ self->parent_obj);
+}
+
+static PyObject* PyUpb_ByNameMap_Keys(PyObject* _self, PyObject* args) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ PyObject* key = PyUnicode_FromString(self->funcs->get_elem_name(elem));
+ if (!key) goto error;
+ PyList_SetItem(ret, i, key);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+static PyObject* PyUpb_ByNameMap_Values(PyObject* _self, PyObject* args) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ PyObject* py_elem = self->funcs->base.get_elem_wrapper(elem);
+ if (!py_elem) goto error;
+ PyList_SetItem(ret, i, py_elem);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+static PyObject* PyUpb_ByNameMap_Items(PyObject* _self, PyObject* args) {
+ PyUpb_ByNameMap* self = (PyUpb_ByNameMap*)_self;
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ PyObject* item;
+ PyObject* py_elem;
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ item = PyTuple_New(2);
+ py_elem = self->funcs->base.get_elem_wrapper(elem);
+ if (!item || !py_elem) goto error;
+ PyTuple_SetItem(item, 0,
+ PyUnicode_FromString(self->funcs->get_elem_name(elem)));
+ PyTuple_SetItem(item, 1, py_elem);
+ PyList_SetItem(ret, i, item);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(py_elem);
+ Py_XDECREF(item);
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+// A mapping container can only be equal to another mapping container, or (for
+// backward compatibility) to a dict containing the same items.
+// Returns 1 if equal, 0 if unequal, -1 on error.
+static int PyUpb_ByNameMap_IsEqual(PyUpb_ByNameMap* self, PyObject* other) {
+ // Check the identity of C++ pointers.
+ if (PyObject_TypeCheck(other, Py_TYPE(self))) {
+ PyUpb_ByNameMap* other_map = (void*)other;
+ return self->parent == other_map->parent && self->funcs == other_map->funcs;
+ }
+
+ if (!PyDict_Check(other)) return 0;
+
+ PyObject* self_dict = PyDict_New();
+ PyDict_Merge(self_dict, (PyObject*)self, 0);
+ int eq = PyObject_RichCompareBool(self_dict, other, Py_EQ);
+ Py_DECREF(self_dict);
+ return eq;
+}
+
+static PyObject* PyUpb_ByNameMap_RichCompare(PyObject* _self, PyObject* other,
+ int opid) {
+ PyUpb_ByNameMap* self = PyUpb_ByNameMap_Self(_self);
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ bool ret = PyUpb_ByNameMap_IsEqual(self, other);
+ if (opid == Py_NE) ret = !ret;
+ return PyBool_FromLong(ret);
+}
+
+static PyMethodDef PyUpb_ByNameMap_Methods[] = {
+ {"get", (PyCFunction)&PyUpb_ByNameMap_Get, METH_VARARGS},
+ {"keys", PyUpb_ByNameMap_Keys, METH_NOARGS},
+ {"values", PyUpb_ByNameMap_Values, METH_NOARGS},
+ {"items", PyUpb_ByNameMap_Items, METH_NOARGS},
+ {NULL}};
+
+static PyType_Slot PyUpb_ByNameMap_Slots[] = {
+ {Py_mp_ass_subscript, PyUpb_ByNameMap_AssignSubscript},
+ {Py_mp_length, PyUpb_ByNameMap_Length},
+ {Py_mp_subscript, PyUpb_ByNameMap_Subscript},
+ {Py_sq_contains, &PyUpb_ByNameMap_Contains},
+ {Py_tp_dealloc, &PyUpb_ByNameMap_Dealloc},
+ {Py_tp_iter, PyUpb_ByNameMap_GetIter},
+ {Py_tp_methods, &PyUpb_ByNameMap_Methods},
+ {Py_tp_richcompare, &PyUpb_ByNameMap_RichCompare},
+ {0, NULL},
+};
+
+static PyType_Spec PyUpb_ByNameMap_Spec = {
+ PYUPB_MODULE_NAME "._ByNameMap", // tp_name
+ sizeof(PyUpb_ByNameMap), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_ByNameMap_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// ByNumberMap
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ const PyUpb_ByNumberMap_Funcs* funcs;
+ const void* parent; // upb_MessageDef*, upb_DefPool*, etc.
+ PyObject* parent_obj; // Python object that keeps parent alive, we own a ref.
+} PyUpb_ByNumberMap;
+
+PyUpb_ByNumberMap* PyUpb_ByNumberMap_Self(PyObject* obj) {
+ assert(Py_TYPE(obj) == PyUpb_ModuleState_Get()->by_number_map_type);
+ return (PyUpb_ByNumberMap*)obj;
+}
+
+PyObject* PyUpb_ByNumberMap_New(const PyUpb_ByNumberMap_Funcs* funcs,
+ const void* parent, PyObject* parent_obj) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ PyUpb_ByNumberMap* map = (void*)PyType_GenericAlloc(s->by_number_map_type, 0);
+ map->funcs = funcs;
+ map->parent = parent;
+ map->parent_obj = parent_obj;
+ Py_INCREF(parent_obj);
+ return &map->ob_base;
+}
+
+static void PyUpb_ByNumberMap_Dealloc(PyObject* _self) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ Py_DECREF(self->parent_obj);
+ PyUpb_Dealloc(self);
+}
+
+static Py_ssize_t PyUpb_ByNumberMap_Length(PyObject* _self) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ return self->funcs->base.get_elem_count(self->parent);
+}
+
+static const void* PyUpb_ByNumberMap_LookupHelper(PyUpb_ByNumberMap* self,
+ PyObject* key) {
+ long num = PyLong_AsLong(key);
+ if (num == -1 && PyErr_Occurred()) {
+ PyErr_Clear();
+ return NULL;
+ } else {
+ return self->funcs->lookup(self->parent, num);
+ }
+}
+
+static PyObject* PyUpb_ByNumberMap_Subscript(PyObject* _self, PyObject* key) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ const void* elem = PyUpb_ByNumberMap_LookupHelper(self, key);
+ if (elem) {
+ return self->funcs->base.get_elem_wrapper(elem);
+ } else {
+ PyErr_SetObject(PyExc_KeyError, key);
+ return NULL;
+ }
+}
+
+static int PyUpb_ByNumberMap_AssignSubscript(PyObject* self, PyObject* key,
+ PyObject* value) {
+ PyErr_Format(PyExc_TypeError, PYUPB_MODULE_NAME
+ ".ByNumberMap' object does not support item assignment");
+ return -1;
+}
+
+static PyObject* PyUpb_ByNumberMap_Get(PyObject* _self, PyObject* args) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ PyObject* key;
+ PyObject* default_value = Py_None;
+ if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &default_value)) {
+ return NULL;
+ }
+
+ const void* elem = PyUpb_ByNumberMap_LookupHelper(self, key);
+ if (elem) {
+ return self->funcs->base.get_elem_wrapper(elem);
+ } else {
+ return PyUpb_NewRef(default_value);
+ }
+}
+
+static PyObject* PyUpb_ByNumberMap_GetIter(PyObject* _self) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ return PyUpb_DescriptorIterator_New(&self->funcs->base, self->parent,
+ self->parent_obj);
+}
+
+static PyObject* PyUpb_ByNumberMap_Keys(PyObject* _self, PyObject* args) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ PyObject* key = PyLong_FromLong(self->funcs->get_elem_num(elem));
+ if (!key) goto error;
+ PyList_SetItem(ret, i, key);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+static PyObject* PyUpb_ByNumberMap_Values(PyObject* _self, PyObject* args) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ PyObject* py_elem = self->funcs->base.get_elem_wrapper(elem);
+ if (!py_elem) goto error;
+ PyList_SetItem(ret, i, py_elem);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+static PyObject* PyUpb_ByNumberMap_Items(PyObject* _self, PyObject* args) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ int n = self->funcs->base.get_elem_count(self->parent);
+ PyObject* ret = PyList_New(n);
+ PyObject* item;
+ PyObject* py_elem;
+ if (!ret) return NULL;
+ for (int i = 0; i < n; i++) {
+ const void* elem = self->funcs->base.index(self->parent, i);
+ int number = self->funcs->get_elem_num(elem);
+ item = PyTuple_New(2);
+ py_elem = self->funcs->base.get_elem_wrapper(elem);
+ if (!item || !py_elem) goto error;
+ PyTuple_SetItem(item, 0, PyLong_FromLong(number));
+ PyTuple_SetItem(item, 1, py_elem);
+ PyList_SetItem(ret, i, item);
+ }
+ return ret;
+
+error:
+ Py_XDECREF(py_elem);
+ Py_XDECREF(item);
+ Py_XDECREF(ret);
+ return NULL;
+}
+
+static int PyUpb_ByNumberMap_Contains(PyObject* _self, PyObject* key) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ const void* elem = PyUpb_ByNumberMap_LookupHelper(self, key);
+ return elem ? 1 : 0;
+}
+
+// A mapping container can only be equal to another mapping container, or (for
+// backward compatibility) to a dict containing the same items.
+// Returns 1 if equal, 0 if unequal, -1 on error.
+static int PyUpb_ByNumberMap_IsEqual(PyUpb_ByNumberMap* self, PyObject* other) {
+ // Check the identity of C++ pointers.
+ if (PyObject_TypeCheck(other, Py_TYPE(self))) {
+ PyUpb_ByNumberMap* other_map = (void*)other;
+ return self->parent == other_map->parent && self->funcs == other_map->funcs;
+ }
+
+ if (!PyDict_Check(other)) return 0;
+
+ PyObject* self_dict = PyDict_New();
+ PyDict_Merge(self_dict, (PyObject*)self, 0);
+ int eq = PyObject_RichCompareBool(self_dict, other, Py_EQ);
+ Py_DECREF(self_dict);
+ return eq;
+}
+
+static PyObject* PyUpb_ByNumberMap_RichCompare(PyObject* _self, PyObject* other,
+ int opid) {
+ PyUpb_ByNumberMap* self = PyUpb_ByNumberMap_Self(_self);
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_RETURN_NOTIMPLEMENTED;
+ }
+ bool ret = PyUpb_ByNumberMap_IsEqual(self, other);
+ if (opid == Py_NE) ret = !ret;
+ return PyBool_FromLong(ret);
+}
+
+static PyMethodDef PyUpb_ByNumberMap_Methods[] = {
+ {"get", (PyCFunction)&PyUpb_ByNumberMap_Get, METH_VARARGS},
+ {"keys", PyUpb_ByNumberMap_Keys, METH_NOARGS},
+ {"values", PyUpb_ByNumberMap_Values, METH_NOARGS},
+ {"items", PyUpb_ByNumberMap_Items, METH_NOARGS},
+ {NULL}};
+
+static PyType_Slot PyUpb_ByNumberMap_Slots[] = {
+ {Py_mp_ass_subscript, PyUpb_ByNumberMap_AssignSubscript},
+ {Py_mp_length, PyUpb_ByNumberMap_Length},
+ {Py_mp_subscript, PyUpb_ByNumberMap_Subscript},
+ {Py_sq_contains, &PyUpb_ByNumberMap_Contains},
+ {Py_tp_dealloc, &PyUpb_ByNumberMap_Dealloc},
+ {Py_tp_iter, PyUpb_ByNumberMap_GetIter},
+ {Py_tp_methods, &PyUpb_ByNumberMap_Methods},
+ {Py_tp_richcompare, &PyUpb_ByNumberMap_RichCompare},
+ {0, NULL},
+};
+
+static PyType_Spec PyUpb_ByNumberMap_Spec = {
+ PYUPB_MODULE_NAME "._ByNumberMap", // tp_name
+ sizeof(PyUpb_ByNumberMap), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_ByNumberMap_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+bool PyUpb_InitDescriptorContainers(PyObject* m) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_GetFromModule(m);
+
+ s->by_name_map_type = PyUpb_AddClass(m, &PyUpb_ByNameMap_Spec);
+ s->by_number_map_type = PyUpb_AddClass(m, &PyUpb_ByNumberMap_Spec);
+ s->descriptor_iterator_type =
+ PyUpb_AddClass(m, &PyUpb_DescriptorIterator_Spec);
+ s->generic_sequence_type = PyUpb_AddClass(m, &PyUpb_GenericSequence_Spec);
+
+ return s->by_name_map_type && s->by_number_map_type &&
+ s->descriptor_iterator_type && s->generic_sequence_type;
+}
diff --git a/grpc/third_party/upb/python/descriptor_containers.h b/grpc/third_party/upb/python/descriptor_containers.h
new file mode 100644
index 00000000..8c6b0d9b
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor_containers.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_DESCRIPTOR_CONTAINERS_H__
+#define PYUPB_DESCRIPTOR_CONTAINERS_H__
+
+// This file defines immutable Python containiner types whose data comes from
+// an underlying descriptor (def).
+//
+// Because there are many instances of these types that vend different kinds of
+// data (fields, oneofs, enums, etc) these types accept a "vtable" of function
+// pointers. This saves us from having to define numerous distinct Python types
+// for each kind of data we want to vend.
+//
+// The underlying upb APIs follow a consistent pattern that allows us to use
+// those functions directly inside these vtables, greatly reducing the amount of
+// "adaptor" code we need to write.
+
+#include <stdbool.h>
+
+#include "protobuf.h"
+#include "upb/def.h"
+
+// -----------------------------------------------------------------------------
+// PyUpb_GenericSequence
+// -----------------------------------------------------------------------------
+
+// A Python object that vends a sequence of descriptors.
+
+typedef struct {
+ // Returns the number of elements in the map.
+ int (*get_elem_count)(const void* parent);
+ // Returns an element by index.
+ const void* (*index)(const void* parent, int idx);
+ // Returns a Python object wrapping this element, caller owns a ref.
+ PyObject* (*get_elem_wrapper)(const void* elem);
+} PyUpb_GenericSequence_Funcs;
+
+// Returns a new GenericSequence. The vtable `funcs` must outlive this object
+// (generally it should be static). The GenericSequence will take a ref on
+// `parent_obj`, which must be sufficient to keep `parent` alive. The object
+// `parent` will be passed as an argument to the functions in `funcs`.
+PyObject* PyUpb_GenericSequence_New(const PyUpb_GenericSequence_Funcs* funcs,
+ const void* parent, PyObject* parent_obj);
+
+// -----------------------------------------------------------------------------
+// PyUpb_ByNameMap
+// -----------------------------------------------------------------------------
+
+// A Python object that vends a name->descriptor map.
+
+typedef struct {
+ PyUpb_GenericSequence_Funcs base;
+ // Looks up by name and returns either a pointer to the element or NULL.
+ const void* (*lookup)(const void* parent, const char* key);
+ // Returns the name associated with this element.
+ const char* (*get_elem_name)(const void* elem);
+} PyUpb_ByNameMap_Funcs;
+
+// Returns a new ByNameMap. The vtable `funcs` must outlive this object
+// (generally it should be static). The ByNameMap will take a ref on
+// `parent_obj`, which must be sufficient to keep `parent` alive. The object
+// `parent` will be passed as an argument to the functions in `funcs`.
+PyObject* PyUpb_ByNameMap_New(const PyUpb_ByNameMap_Funcs* funcs,
+ const void* parent, PyObject* parent_obj);
+
+// -----------------------------------------------------------------------------
+// PyUpb_ByNumberMap
+// -----------------------------------------------------------------------------
+
+// A Python object that vends a number->descriptor map.
+
+typedef struct {
+ PyUpb_GenericSequence_Funcs base;
+ // Looks up by name and returns either a pointer to the element or NULL.
+ const void* (*lookup)(const void* parent, int num);
+ // Returns the name associated with this element.
+ int (*get_elem_num)(const void* elem);
+} PyUpb_ByNumberMap_Funcs;
+
+// Returns a new ByNumberMap. The vtable `funcs` must outlive this object
+// (generally it should be static). The ByNumberMap will take a ref on
+// `parent_obj`, which must be sufficient to keep `parent` alive. The object
+// `parent` will be passed as an argument to the functions in `funcs`.
+PyObject* PyUpb_ByNumberMap_New(const PyUpb_ByNumberMap_Funcs* funcs,
+ const void* parent, PyObject* parent_obj);
+
+bool PyUpb_InitDescriptorContainers(PyObject* m);
+
+#endif // PYUPB_DESCRIPTOR_CONTAINERS_H__
diff --git a/grpc/third_party/upb/python/descriptor_pool.c b/grpc/third_party/upb/python/descriptor_pool.c
new file mode 100644
index 00000000..5a61b4e6
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor_pool.c
@@ -0,0 +1,643 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/descriptor_pool.h"
+
+#include "google/protobuf/descriptor.upbdefs.h"
+#include "python/convert.h"
+#include "python/descriptor.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+#include "upb/def.h"
+#include "upb/util/def_to_proto.h"
+
+// -----------------------------------------------------------------------------
+// DescriptorPool
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ upb_DefPool* symtab;
+ PyObject* db; // The DescriptorDatabase underlying this pool. May be NULL.
+} PyUpb_DescriptorPool;
+
+PyObject* PyUpb_DescriptorPool_GetDefaultPool() {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ return s->default_pool;
+}
+
+const upb_MessageDef* PyUpb_DescriptorPool_GetFileProtoDef(void) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_Get();
+ if (!s->c_descriptor_symtab) {
+ s->c_descriptor_symtab = upb_DefPool_New();
+ }
+ return google_protobuf_FileDescriptorProto_getmsgdef(s->c_descriptor_symtab);
+}
+
+static PyObject* PyUpb_DescriptorPool_DoCreateWithCache(
+ PyTypeObject* type, PyObject* db, PyUpb_WeakMap* obj_cache) {
+ PyUpb_DescriptorPool* pool = (void*)PyType_GenericAlloc(type, 0);
+ pool->symtab = upb_DefPool_New();
+ pool->db = db;
+ Py_XINCREF(pool->db);
+ PyUpb_WeakMap_Add(obj_cache, pool->symtab, &pool->ob_base);
+ return &pool->ob_base;
+}
+
+static PyObject* PyUpb_DescriptorPool_DoCreate(PyTypeObject* type,
+ PyObject* db) {
+ return PyUpb_DescriptorPool_DoCreateWithCache(type, db,
+ PyUpb_ObjCache_Instance());
+}
+
+upb_DefPool* PyUpb_DescriptorPool_GetSymtab(PyObject* pool) {
+ return ((PyUpb_DescriptorPool*)pool)->symtab;
+}
+
+static int PyUpb_DescriptorPool_Traverse(PyUpb_DescriptorPool* self,
+ visitproc visit, void* arg) {
+ Py_VISIT(self->db);
+ return 0;
+}
+
+static int PyUpb_DescriptorPool_Clear(PyUpb_DescriptorPool* self) {
+ Py_CLEAR(self->db);
+ return 0;
+}
+
+PyObject* PyUpb_DescriptorPool_Get(const upb_DefPool* symtab) {
+ PyObject* pool = PyUpb_ObjCache_Get(symtab);
+ assert(pool);
+ return pool;
+}
+
+static void PyUpb_DescriptorPool_Dealloc(PyUpb_DescriptorPool* self) {
+ PyUpb_DescriptorPool_Clear(self);
+ upb_DefPool_Free(self->symtab);
+ PyUpb_ObjCache_Delete(self->symtab);
+ PyUpb_Dealloc(self);
+}
+
+/*
+ * DescriptorPool.__new__()
+ *
+ * Implements:
+ * DescriptorPool(descriptor_db=None)
+ */
+static PyObject* PyUpb_DescriptorPool_New(PyTypeObject* type, PyObject* args,
+ PyObject* kwargs) {
+ char* kwlist[] = {"descriptor_db", 0};
+ PyObject* db = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", kwlist, &db)) {
+ return NULL;
+ }
+
+ if (db == Py_None) db = NULL;
+ return PyUpb_DescriptorPool_DoCreate(type, db);
+}
+
+static PyObject* PyUpb_DescriptorPool_DoAdd(PyObject* _self,
+ PyObject* file_desc);
+
+static bool PyUpb_DescriptorPool_TryLoadFileProto(PyUpb_DescriptorPool* self,
+ PyObject* proto) {
+ if (proto == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_KeyError)) {
+ // Expected error: item was simply not found.
+ PyErr_Clear();
+ return true; // We didn't accomplish our goal, but we didn't error out.
+ }
+ return false;
+ }
+ if (proto == Py_None) return true;
+ PyObject* ret = PyUpb_DescriptorPool_DoAdd((PyObject*)self, proto);
+ bool ok = ret != NULL;
+ Py_XDECREF(ret);
+ return ok;
+}
+
+static bool PyUpb_DescriptorPool_TryLoadSymbol(PyUpb_DescriptorPool* self,
+ PyObject* sym) {
+ if (!self->db) return false;
+ PyObject* file_proto =
+ PyObject_CallMethod(self->db, "FindFileContainingSymbol", "O", sym);
+ bool ret = PyUpb_DescriptorPool_TryLoadFileProto(self, file_proto);
+ Py_XDECREF(file_proto);
+ return ret;
+}
+
+static bool PyUpb_DescriptorPool_TryLoadFilename(PyUpb_DescriptorPool* self,
+ PyObject* filename) {
+ if (!self->db) return false;
+ PyObject* file_proto =
+ PyObject_CallMethod(self->db, "FindFileByName", "O", filename);
+ bool ret = PyUpb_DescriptorPool_TryLoadFileProto(self, file_proto);
+ Py_XDECREF(file_proto);
+ return ret;
+}
+
+bool PyUpb_DescriptorPool_CheckNoDatabase(PyObject* _self) { return true; }
+
+static bool PyUpb_DescriptorPool_LoadDependentFiles(
+ PyUpb_DescriptorPool* self, google_protobuf_FileDescriptorProto* proto) {
+ size_t n;
+ const upb_StringView* deps =
+ google_protobuf_FileDescriptorProto_dependency(proto, &n);
+ for (size_t i = 0; i < n; i++) {
+ const upb_FileDef* dep = upb_DefPool_FindFileByNameWithSize(
+ self->symtab, deps[i].data, deps[i].size);
+ if (!dep) {
+ PyObject* filename =
+ PyUnicode_FromStringAndSize(deps[i].data, deps[i].size);
+ if (!filename) return false;
+ bool ok = PyUpb_DescriptorPool_TryLoadFilename(self, filename);
+ Py_DECREF(filename);
+ if (!ok) return false;
+ }
+ }
+ return true;
+}
+
+static PyObject* PyUpb_DescriptorPool_DoAddSerializedFile(
+ PyObject* _self, PyObject* serialized_pb) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+ upb_Arena* arena = upb_Arena_New();
+ if (!arena) PYUPB_RETURN_OOM;
+ PyObject* result = NULL;
+
+ char* buf;
+ Py_ssize_t size;
+ if (PyBytes_AsStringAndSize(serialized_pb, &buf, &size) < 0) {
+ goto done;
+ }
+
+ google_protobuf_FileDescriptorProto* proto =
+ google_protobuf_FileDescriptorProto_parse(buf, size, arena);
+ if (!proto) {
+ PyErr_SetString(PyExc_TypeError, "Couldn't parse file content!");
+ goto done;
+ }
+
+ upb_StringView name = google_protobuf_FileDescriptorProto_name(proto);
+ const upb_FileDef* file =
+ upb_DefPool_FindFileByNameWithSize(self->symtab, name.data, name.size);
+
+ if (file) {
+ // If the existing file is equal to the new file, then silently ignore the
+ // duplicate add.
+ google_protobuf_FileDescriptorProto* existing =
+ upb_FileDef_ToProto(file, arena);
+ if (!existing) {
+ PyErr_SetNone(PyExc_MemoryError);
+ goto done;
+ }
+ const upb_MessageDef* m = PyUpb_DescriptorPool_GetFileProtoDef();
+ if (PyUpb_Message_IsEqual(proto, existing, m)) {
+ Py_INCREF(Py_None);
+ result = Py_None;
+ goto done;
+ }
+ }
+
+ if (self->db) {
+ if (!PyUpb_DescriptorPool_LoadDependentFiles(self, proto)) goto done;
+ }
+
+ upb_Status status;
+ upb_Status_Clear(&status);
+
+ const upb_FileDef* filedef =
+ upb_DefPool_AddFile(self->symtab, proto, &status);
+ if (!filedef) {
+ PyErr_Format(PyExc_TypeError,
+ "Couldn't build proto file into descriptor pool: %s",
+ upb_Status_ErrorMessage(&status));
+ goto done;
+ }
+
+ result = PyUpb_FileDescriptor_Get(filedef);
+
+done:
+ upb_Arena_Free(arena);
+ return result;
+}
+
+static PyObject* PyUpb_DescriptorPool_DoAdd(PyObject* _self,
+ PyObject* file_desc) {
+ if (!PyUpb_CMessage_Verify(file_desc)) return NULL;
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(file_desc);
+ const char* file_proto_name =
+ PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileDescriptorProto";
+ if (strcmp(upb_MessageDef_FullName(m), file_proto_name) != 0) {
+ return PyErr_Format(PyExc_TypeError, "Can only add FileDescriptorProto");
+ }
+ PyObject* subargs = PyTuple_New(0);
+ if (!subargs) return NULL;
+ PyObject* serialized =
+ PyUpb_CMessage_SerializeToString(file_desc, subargs, NULL);
+ Py_DECREF(subargs);
+ if (!serialized) return NULL;
+ PyObject* ret = PyUpb_DescriptorPool_DoAddSerializedFile(_self, serialized);
+ Py_DECREF(serialized);
+ return ret;
+}
+
+/*
+ * PyUpb_DescriptorPool_AddSerializedFile()
+ *
+ * Implements:
+ * DescriptorPool.AddSerializedFile(self, serialized_file_descriptor)
+ *
+ * Adds the given serialized FileDescriptorProto to the pool.
+ */
+static PyObject* PyUpb_DescriptorPool_AddSerializedFile(
+ PyObject* _self, PyObject* serialized_pb) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+ if (self->db) {
+ PyErr_SetString(
+ PyExc_ValueError,
+ "Cannot call AddSerializedFile on a DescriptorPool that uses a "
+ "DescriptorDatabase. Add your file to the underlying database.");
+ return false;
+ }
+ return PyUpb_DescriptorPool_DoAddSerializedFile(_self, serialized_pb);
+}
+
+static PyObject* PyUpb_DescriptorPool_Add(PyObject* _self,
+ PyObject* file_desc) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+ if (self->db) {
+ PyErr_SetString(
+ PyExc_ValueError,
+ "Cannot call Add on a DescriptorPool that uses a DescriptorDatabase. "
+ "Add your file to the underlying database.");
+ return false;
+ }
+ return PyUpb_DescriptorPool_DoAdd(_self, file_desc);
+}
+
+/*
+ * PyUpb_DescriptorPool_FindFileByName()
+ *
+ * Implements:
+ * DescriptorPool.FindFileByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindFileByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_FileDef* file = upb_DefPool_FindFileByName(self->symtab, name);
+ if (file == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadFilename(self, arg)) return NULL;
+ file = upb_DefPool_FindFileByName(self->symtab, name);
+ }
+ if (file == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find file %.200s", name);
+ }
+
+ return PyUpb_FileDescriptor_Get(file);
+}
+
+/*
+ * PyUpb_DescriptorPool_FindExtensionByName()
+ *
+ * Implements:
+ * DescriptorPool.FindExtensionByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindExtensionByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_FieldDef* field =
+ upb_DefPool_FindExtensionByName(self->symtab, name);
+ if (field == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ field = upb_DefPool_FindExtensionByName(self->symtab, name);
+ }
+ if (field == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find extension %.200s", name);
+ }
+
+ return PyUpb_FieldDescriptor_Get(field);
+}
+
+/*
+ * PyUpb_DescriptorPool_FindMessageTypeByName()
+ *
+ * Implements:
+ * DescriptorPool.FindMessageTypeByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindMessageTypeByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_MessageDef* m = upb_DefPool_FindMessageByName(self->symtab, name);
+ if (m == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ m = upb_DefPool_FindMessageByName(self->symtab, name);
+ }
+ if (m == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find message %.200s", name);
+ }
+
+ return PyUpb_Descriptor_Get(m);
+}
+
+// Splits a dotted symbol like foo.bar.baz on the last dot. Returns the portion
+// after the last dot (baz) and updates `*parent_size` to the length of the
+// parent (foo.bar). Returns NULL if no dots were present.
+static const char* PyUpb_DescriptorPool_SplitSymbolName(const char* sym,
+ size_t* parent_size) {
+ const char* last_dot = strrchr(sym, '.');
+ if (!last_dot) return NULL;
+ *parent_size = last_dot - sym;
+ return last_dot + 1;
+}
+
+/*
+ * PyUpb_DescriptorPool_FindFieldByName()
+ *
+ * Implements:
+ * DescriptorPool.FindFieldByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindFieldByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ size_t parent_size;
+ const char* child = PyUpb_DescriptorPool_SplitSymbolName(name, &parent_size);
+ const upb_FieldDef* f = NULL;
+ if (child) {
+ const upb_MessageDef* parent =
+ upb_DefPool_FindMessageByNameWithSize(self->symtab, name, parent_size);
+ if (parent == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ parent = upb_DefPool_FindMessageByNameWithSize(self->symtab, name,
+ parent_size);
+ }
+ if (parent) {
+ f = upb_MessageDef_FindFieldByName(parent, child);
+ }
+ }
+
+ if (!f) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find message %.200s", name);
+ }
+
+ return PyUpb_FieldDescriptor_Get(f);
+}
+
+/*
+ * PyUpb_DescriptorPool_FindEnumTypeByName()
+ *
+ * Implements:
+ * DescriptorPool.FindEnumTypeByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindEnumTypeByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_EnumDef* e = upb_DefPool_FindEnumByName(self->symtab, name);
+ if (e == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ e = upb_DefPool_FindEnumByName(self->symtab, name);
+ }
+ if (e == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find enum %.200s", name);
+ }
+
+ return PyUpb_EnumDescriptor_Get(e);
+}
+
+/*
+ * PyUpb_DescriptorPool_FindOneofByName()
+ *
+ * Implements:
+ * DescriptorPool.FindOneofByName(self, name)
+ */
+static PyObject* PyUpb_DescriptorPool_FindOneofByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ size_t parent_size;
+ const char* child = PyUpb_DescriptorPool_SplitSymbolName(name, &parent_size);
+
+ if (child) {
+ const upb_MessageDef* parent =
+ upb_DefPool_FindMessageByNameWithSize(self->symtab, name, parent_size);
+ if (parent == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ parent = upb_DefPool_FindMessageByNameWithSize(self->symtab, name,
+ parent_size);
+ }
+ if (parent) {
+ const upb_OneofDef* o = upb_MessageDef_FindOneofByName(parent, child);
+ return PyUpb_OneofDescriptor_Get(o);
+ }
+ }
+
+ return PyErr_Format(PyExc_KeyError, "Couldn't find oneof %.200s", name);
+}
+
+static PyObject* PyUpb_DescriptorPool_FindServiceByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_ServiceDef* s = upb_DefPool_FindServiceByName(self->symtab, name);
+ if (s == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ s = upb_DefPool_FindServiceByName(self->symtab, name);
+ }
+ if (s == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find service %.200s", name);
+ }
+
+ return PyUpb_ServiceDescriptor_Get(s);
+}
+
+static PyObject* PyUpb_DescriptorPool_FindMethodByName(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+ size_t parent_size;
+ const char* child = PyUpb_DescriptorPool_SplitSymbolName(name, &parent_size);
+
+ if (!child) goto err;
+ const upb_ServiceDef* parent =
+ upb_DefPool_FindServiceByNameWithSize(self->symtab, name, parent_size);
+ if (parent == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ parent =
+ upb_DefPool_FindServiceByNameWithSize(self->symtab, name, parent_size);
+ }
+ if (!parent) goto err;
+ const upb_MethodDef* m = upb_ServiceDef_FindMethodByName(parent, child);
+ if (!m) goto err;
+ return PyUpb_MethodDescriptor_Get(m);
+
+err:
+ return PyErr_Format(PyExc_KeyError, "Couldn't find method %.200s", name);
+}
+
+static PyObject* PyUpb_DescriptorPool_FindFileContainingSymbol(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+
+ const char* name = PyUpb_VerifyStrData(arg);
+ if (!name) return NULL;
+
+ const upb_FileDef* f =
+ upb_DefPool_FindFileContainingSymbol(self->symtab, name);
+ if (f == NULL && self->db) {
+ if (!PyUpb_DescriptorPool_TryLoadSymbol(self, arg)) return NULL;
+ f = upb_DefPool_FindFileContainingSymbol(self->symtab, name);
+ }
+ if (f == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find symbol %.200s", name);
+ }
+
+ return PyUpb_FileDescriptor_Get(f);
+}
+
+static PyObject* PyUpb_DescriptorPool_FindExtensionByNumber(PyObject* _self,
+ PyObject* args) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+ PyObject* message_descriptor;
+ int number;
+ if (!PyArg_ParseTuple(args, "Oi", &message_descriptor, &number)) {
+ return NULL;
+ }
+
+ const upb_FieldDef* f = upb_DefPool_FindExtensionByNumber(
+ self->symtab, PyUpb_Descriptor_GetDef(message_descriptor), number);
+ if (f == NULL) {
+ return PyErr_Format(PyExc_KeyError, "Couldn't find Extension %d", number);
+ }
+
+ return PyUpb_FieldDescriptor_Get(f);
+}
+
+static PyObject* PyUpb_DescriptorPool_FindAllExtensions(PyObject* _self,
+ PyObject* msg_desc) {
+ PyUpb_DescriptorPool* self = (PyUpb_DescriptorPool*)_self;
+ const upb_MessageDef* m = PyUpb_Descriptor_GetDef(msg_desc);
+ size_t n;
+ const upb_FieldDef** ext = upb_DefPool_GetAllExtensions(self->symtab, m, &n);
+ PyObject* ret = PyList_New(n);
+ for (size_t i = 0; i < n; i++) {
+ PyObject* field = PyUpb_FieldDescriptor_Get(ext[i]);
+ if (!field) return NULL;
+ PyList_SetItem(ret, i, field);
+ }
+ return ret;
+}
+
+static PyMethodDef PyUpb_DescriptorPool_Methods[] = {
+ {"Add", PyUpb_DescriptorPool_Add, METH_O,
+ "Adds the FileDescriptorProto and its types to this pool."},
+ {"AddSerializedFile", PyUpb_DescriptorPool_AddSerializedFile, METH_O,
+ "Adds a serialized FileDescriptorProto to this pool."},
+ {"FindFileByName", PyUpb_DescriptorPool_FindFileByName, METH_O,
+ "Searches for a file descriptor by its .proto name."},
+ {"FindMessageTypeByName", PyUpb_DescriptorPool_FindMessageTypeByName,
+ METH_O, "Searches for a message descriptor by full name."},
+ {"FindFieldByName", PyUpb_DescriptorPool_FindFieldByName, METH_O,
+ "Searches for a field descriptor by full name."},
+ {"FindExtensionByName", PyUpb_DescriptorPool_FindExtensionByName, METH_O,
+ "Searches for extension descriptor by full name."},
+ {"FindEnumTypeByName", PyUpb_DescriptorPool_FindEnumTypeByName, METH_O,
+ "Searches for enum type descriptor by full name."},
+ {"FindOneofByName", PyUpb_DescriptorPool_FindOneofByName, METH_O,
+ "Searches for oneof descriptor by full name."},
+ {"FindServiceByName", PyUpb_DescriptorPool_FindServiceByName, METH_O,
+ "Searches for service descriptor by full name."},
+ {"FindMethodByName", PyUpb_DescriptorPool_FindMethodByName, METH_O,
+ "Searches for method descriptor by full name."},
+ {"FindFileContainingSymbol", PyUpb_DescriptorPool_FindFileContainingSymbol,
+ METH_O, "Gets the FileDescriptor containing the specified symbol."},
+ {"FindExtensionByNumber", PyUpb_DescriptorPool_FindExtensionByNumber,
+ METH_VARARGS, "Gets the extension descriptor for the given number."},
+ {"FindAllExtensions", PyUpb_DescriptorPool_FindAllExtensions, METH_O,
+ "Gets all known extensions of the given message descriptor."},
+ {NULL}};
+
+static PyType_Slot PyUpb_DescriptorPool_Slots[] = {
+ {Py_tp_clear, PyUpb_DescriptorPool_Clear},
+ {Py_tp_dealloc, PyUpb_DescriptorPool_Dealloc},
+ {Py_tp_methods, PyUpb_DescriptorPool_Methods},
+ {Py_tp_new, PyUpb_DescriptorPool_New},
+ {Py_tp_traverse, PyUpb_DescriptorPool_Traverse},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_DescriptorPool_Spec = {
+ PYUPB_MODULE_NAME ".DescriptorPool",
+ sizeof(PyUpb_DescriptorPool),
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
+ PyUpb_DescriptorPool_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+bool PyUpb_InitDescriptorPool(PyObject* m) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+ PyTypeObject* descriptor_pool_type =
+ PyUpb_AddClass(m, &PyUpb_DescriptorPool_Spec);
+
+ if (!descriptor_pool_type) return false;
+
+ state->default_pool = PyUpb_DescriptorPool_DoCreateWithCache(
+ descriptor_pool_type, NULL, state->obj_cache);
+ return state->default_pool &&
+ PyModule_AddObject(m, "default_pool", state->default_pool) == 0;
+}
diff --git a/grpc/third_party/upb/python/descriptor_pool.h b/grpc/third_party/upb/python/descriptor_pool.h
new file mode 100644
index 00000000..41b7c3e5
--- /dev/null
+++ b/grpc/third_party/upb/python/descriptor_pool.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_DESCRIPTOR_POOL_H__
+#define PYUPB_DESCRIPTOR_POOL_H__
+
+#include <stdbool.h>
+
+#include "protobuf.h"
+
+// Returns a Python wrapper object for the given symtab. The symtab must have
+// been created from a Python DescriptorPool originally.
+PyObject* PyUpb_DescriptorPool_Get(const upb_DefPool* symtab);
+
+// Given a Python DescriptorPool, returns the underlying symtab.
+upb_DefPool* PyUpb_DescriptorPool_GetSymtab(PyObject* pool);
+
+// Returns the default DescriptorPool (a global singleton).
+PyObject* PyUpb_DescriptorPool_GetDefaultPool(void);
+
+// Module-level init.
+bool PyUpb_InitDescriptorPool(PyObject* m);
+
+#endif // PYUPB_DESCRIPTOR_POOL_H__
diff --git a/grpc/third_party/upb/python/extension_dict.c b/grpc/third_party/upb/python/extension_dict.c
new file mode 100644
index 00000000..9fefcb06
--- /dev/null
+++ b/grpc/third_party/upb/python/extension_dict.c
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/extension_dict.h"
+
+#include "python/message.h"
+#include "python/protobuf.h"
+
+// -----------------------------------------------------------------------------
+// ExtensionDict
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ PyObject* msg; // Owning ref to our parent pessage.
+} PyUpb_ExtensionDict;
+
+PyObject* PyUpb_ExtensionDict_New(PyObject* msg) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyUpb_ExtensionDict* ext_dict =
+ (void*)PyType_GenericAlloc(state->extension_dict_type, 0);
+ ext_dict->msg = msg;
+ Py_INCREF(ext_dict->msg);
+ return &ext_dict->ob_base;
+}
+
+static PyObject* PyUpb_ExtensionDict_FindExtensionByName(PyObject* _self,
+ PyObject* key) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ const char* name = PyUpb_GetStrData(key);
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(self->msg);
+ const upb_FileDef* file = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(file);
+ const upb_FieldDef* ext = upb_DefPool_FindExtensionByName(symtab, name);
+ if (ext) {
+ return PyUpb_FieldDescriptor_Get(ext);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static PyObject* PyUpb_ExtensionDict_FindExtensionByNumber(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(self->msg);
+ const upb_MiniTable* l = upb_MessageDef_MiniTable(m);
+ const upb_FileDef* file = upb_MessageDef_File(m);
+ const upb_DefPool* symtab = upb_FileDef_Pool(file);
+ const upb_ExtensionRegistry* reg = upb_DefPool_ExtensionRegistry(symtab);
+ int64_t number = PyLong_AsLong(arg);
+ const upb_MiniTable_Extension* ext =
+ (upb_MiniTable_Extension*)_upb_extreg_get(reg, l, number);
+ if (ext) {
+ const upb_FieldDef* f = _upb_DefPool_FindExtensionByMiniTable(symtab, ext);
+ return PyUpb_FieldDescriptor_Get(f);
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static void PyUpb_ExtensionDict_Dealloc(PyUpb_ExtensionDict* self) {
+ PyUpb_CMessage_ClearExtensionDict(self->msg);
+ Py_DECREF(self->msg);
+ PyUpb_Dealloc(self);
+}
+
+static PyObject* PyUpb_ExtensionDict_RichCompare(PyObject* _self,
+ PyObject* _other, int opid) {
+ // Only equality comparisons are implemented.
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ bool equals = false;
+ if (PyObject_TypeCheck(_other, Py_TYPE(_self))) {
+ PyUpb_ExtensionDict* other = (PyUpb_ExtensionDict*)_other;
+ equals = self->msg == other->msg;
+ }
+ bool ret = opid == Py_EQ ? equals : !equals;
+ return PyBool_FromLong(ret);
+}
+
+static int PyUpb_ExtensionDict_Contains(PyObject* _self, PyObject* key) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(self->msg, key);
+ if (!f) return -1;
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg);
+ if (!msg) return 0;
+ if (upb_FieldDef_IsRepeated(f)) {
+ upb_MessageValue val = upb_Message_Get(msg, f);
+ return upb_Array_Size(val.array_val) > 0;
+ } else {
+ return upb_Message_Has(msg, f);
+ }
+}
+
+static Py_ssize_t PyUpb_ExtensionDict_Length(PyObject* _self) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg);
+ return msg ? upb_Message_ExtensionCount(msg) : 0;
+}
+
+static PyObject* PyUpb_ExtensionDict_Subscript(PyObject* _self, PyObject* key) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(self->msg, key);
+ if (!f) return NULL;
+ return PyUpb_CMessage_GetFieldValue(self->msg, f);
+}
+
+static int PyUpb_ExtensionDict_AssignSubscript(PyObject* _self, PyObject* key,
+ PyObject* val) {
+ PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self;
+ const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(self->msg, key);
+ if (!f) return -1;
+ if (val) {
+ return PyUpb_CMessage_SetFieldValue(self->msg, f, val, PyExc_TypeError);
+ } else {
+ PyUpb_CMessage_DoClearField(self->msg, f);
+ return 0;
+ }
+}
+
+static PyObject* PyUpb_ExtensionIterator_New(PyObject* _ext_dict);
+
+static PyMethodDef PyUpb_ExtensionDict_Methods[] = {
+ {"_FindExtensionByName", PyUpb_ExtensionDict_FindExtensionByName, METH_O,
+ "Finds an extension by name."},
+ {"_FindExtensionByNumber", PyUpb_ExtensionDict_FindExtensionByNumber,
+ METH_O, "Finds an extension by number."},
+ {NULL, NULL},
+};
+
+static PyType_Slot PyUpb_ExtensionDict_Slots[] = {
+ {Py_tp_dealloc, PyUpb_ExtensionDict_Dealloc},
+ {Py_tp_methods, PyUpb_ExtensionDict_Methods},
+ //{Py_tp_getset, PyUpb_ExtensionDict_Getters},
+ //{Py_tp_hash, PyObject_HashNotImplemented},
+ {Py_tp_richcompare, PyUpb_ExtensionDict_RichCompare},
+ {Py_tp_iter, PyUpb_ExtensionIterator_New},
+ {Py_sq_contains, PyUpb_ExtensionDict_Contains},
+ {Py_sq_length, PyUpb_ExtensionDict_Length},
+ {Py_mp_length, PyUpb_ExtensionDict_Length},
+ {Py_mp_subscript, PyUpb_ExtensionDict_Subscript},
+ {Py_mp_ass_subscript, PyUpb_ExtensionDict_AssignSubscript},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_ExtensionDict_Spec = {
+ PYUPB_MODULE_NAME ".ExtensionDict", // tp_name
+ sizeof(PyUpb_ExtensionDict), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_ExtensionDict_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// ExtensionIterator
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ PyObject* msg;
+ size_t iter;
+} PyUpb_ExtensionIterator;
+
+static PyObject* PyUpb_ExtensionIterator_New(PyObject* _ext_dict) {
+ PyUpb_ExtensionDict* ext_dict = (PyUpb_ExtensionDict*)_ext_dict;
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyUpb_ExtensionIterator* iter =
+ (void*)PyType_GenericAlloc(state->extension_iterator_type, 0);
+ if (!iter) return NULL;
+ iter->msg = ext_dict->msg;
+ iter->iter = kUpb_Message_Begin;
+ Py_INCREF(iter->msg);
+ return &iter->ob_base;
+}
+
+static void PyUpb_ExtensionIterator_Dealloc(void* _self) {
+ PyUpb_ExtensionIterator* self = (PyUpb_ExtensionIterator*)_self;
+ Py_DECREF(self->msg);
+ PyUpb_Dealloc(_self);
+}
+
+PyObject* PyUpb_ExtensionIterator_IterNext(PyObject* _self) {
+ PyUpb_ExtensionIterator* self = (PyUpb_ExtensionIterator*)_self;
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg);
+ if (!msg) return NULL;
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(self->msg);
+ const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m));
+ while (true) {
+ const upb_FieldDef* f;
+ upb_MessageValue val;
+ if (!upb_Message_Next(msg, m, symtab, &f, &val, &self->iter)) return NULL;
+ if (upb_FieldDef_IsExtension(f)) return PyUpb_FieldDescriptor_Get(f);
+ }
+}
+
+static PyType_Slot PyUpb_ExtensionIterator_Slots[] = {
+ {Py_tp_dealloc, PyUpb_ExtensionIterator_Dealloc},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, PyUpb_ExtensionIterator_IterNext},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_ExtensionIterator_Spec = {
+ PYUPB_MODULE_NAME ".ExtensionIterator", // tp_name
+ sizeof(PyUpb_ExtensionIterator), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ PyUpb_ExtensionIterator_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+bool PyUpb_InitExtensionDict(PyObject* m) {
+ PyUpb_ModuleState* s = PyUpb_ModuleState_GetFromModule(m);
+
+ s->extension_dict_type = PyUpb_AddClass(m, &PyUpb_ExtensionDict_Spec);
+ s->extension_iterator_type = PyUpb_AddClass(m, &PyUpb_ExtensionIterator_Spec);
+
+ return s->extension_dict_type && s->extension_iterator_type;
+}
diff --git a/grpc/third_party/upb/python/extension_dict.h b/grpc/third_party/upb/python/extension_dict.h
new file mode 100644
index 00000000..f8a8fc43
--- /dev/null
+++ b/grpc/third_party/upb/python/extension_dict.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_EXTENSION_DICT_H__
+#define PYUPB_EXTENSION_DICT_H__
+
+#include <stdbool.h>
+
+#include "python/python.h"
+
+PyObject* PyUpb_ExtensionDict_New(PyObject* msg);
+
+bool PyUpb_InitExtensionDict(PyObject* m);
+
+#endif // PYUPB_EXTENSION_DICT_H__
diff --git a/grpc/third_party/upb/python/map.c b/grpc/third_party/upb/python/map.c
new file mode 100644
index 00000000..35d3d325
--- /dev/null
+++ b/grpc/third_party/upb/python/map.c
@@ -0,0 +1,506 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/map.h"
+
+#include "python/convert.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+
+// -----------------------------------------------------------------------------
+// MapContainer
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ PyObject* arena;
+ // The field descriptor (upb_FieldDef*).
+ // The low bit indicates whether the container is reified (see ptr below).
+ // - low bit set: repeated field is a stub (empty map, no underlying data).
+ // - low bit clear: repeated field is reified (points to upb_Array).
+ uintptr_t field;
+ union {
+ PyObject* parent; // stub: owning pointer to parent message.
+ upb_Map* map; // reified: the data for this array.
+ } ptr;
+ int version;
+} PyUpb_MapContainer;
+
+static PyObject* PyUpb_MapIterator_New(PyUpb_MapContainer* map);
+
+static bool PyUpb_MapContainer_IsStub(PyUpb_MapContainer* self) {
+ return self->field & 1;
+}
+
+// If the map is reified, returns it. Otherwise, returns NULL.
+// If NULL is returned, the object is empty and has no underlying data.
+static upb_Map* PyUpb_MapContainer_GetIfReified(PyUpb_MapContainer* self) {
+ return PyUpb_MapContainer_IsStub(self) ? NULL : self->ptr.map;
+}
+
+static const upb_FieldDef* PyUpb_MapContainer_GetField(
+ PyUpb_MapContainer* self) {
+ return (const upb_FieldDef*)(self->field & ~(uintptr_t)1);
+}
+
+static void PyUpb_MapContainer_Dealloc(void* _self) {
+ PyUpb_MapContainer* self = _self;
+ Py_DECREF(self->arena);
+ if (PyUpb_MapContainer_IsStub(self)) {
+ PyUpb_CMessage_CacheDelete(self->ptr.parent,
+ PyUpb_MapContainer_GetField(self));
+ Py_DECREF(self->ptr.parent);
+ } else {
+ PyUpb_ObjCache_Delete(self->ptr.map);
+ }
+ PyUpb_Dealloc(_self);
+}
+
+PyTypeObject* PyUpb_MapContainer_GetClass(const upb_FieldDef* f) {
+ assert(upb_FieldDef_IsMap(f));
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ return upb_FieldDef_IsSubMessage(f) ? state->message_map_container_type
+ : state->scalar_map_container_type;
+}
+
+PyObject* PyUpb_MapContainer_NewStub(PyObject* parent, const upb_FieldDef* f,
+ PyObject* arena) {
+ // We only create stubs when the parent is reified, by convention. However
+ // this is not an invariant: the parent could become reified at any time.
+ assert(PyUpb_CMessage_GetIfReified(parent) == NULL);
+ PyTypeObject* cls = PyUpb_MapContainer_GetClass(f);
+ PyUpb_MapContainer* map = (void*)PyType_GenericAlloc(cls, 0);
+ map->arena = arena;
+ map->field = (uintptr_t)f | 1;
+ map->ptr.parent = parent;
+ map->version = 0;
+ Py_INCREF(arena);
+ Py_INCREF(parent);
+ return &map->ob_base;
+}
+
+void PyUpb_MapContainer_Reify(PyObject* _self, upb_Map* map) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ if (!map) {
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ map = upb_Map_New(arena, upb_FieldDef_CType(key_f),
+ upb_FieldDef_CType(val_f));
+ }
+ PyUpb_ObjCache_Add(map, &self->ob_base);
+ Py_DECREF(self->ptr.parent);
+ self->ptr.map = map; // Overwrites self->ptr.parent.
+ self->field &= ~(uintptr_t)1;
+ assert(!PyUpb_MapContainer_IsStub(self));
+}
+
+void PyUpb_MapContainer_Invalidate(PyObject* obj) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)obj;
+ self->version++;
+}
+
+upb_Map* PyUpb_MapContainer_EnsureReified(PyObject* _self) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ self->version++;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ if (map) return map; // Already writable.
+
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ map =
+ upb_Map_New(arena, upb_FieldDef_CType(key_f), upb_FieldDef_CType(val_f));
+ upb_MessageValue msgval = {.map_val = map};
+ PyUpb_CMessage_SetConcreteSubobj(self->ptr.parent, f, msgval);
+ PyUpb_MapContainer_Reify((PyObject*)self, map);
+ return map;
+}
+
+int PyUpb_MapContainer_AssignSubscript(PyObject* _self, PyObject* key,
+ PyObject* val) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ upb_Map* map = PyUpb_MapContainer_EnsureReified(_self);
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ upb_MessageValue u_key, u_val;
+ if (!PyUpb_PyToUpb(key, key_f, &u_key, arena)) return -1;
+
+ if (val) {
+ if (!PyUpb_PyToUpb(val, val_f, &u_val, arena)) return -1;
+ upb_Map_Set(map, u_key, u_val, arena);
+ } else {
+ if (!upb_Map_Delete(map, u_key)) {
+ PyErr_Format(PyExc_KeyError, "Key not present in map");
+ return -1;
+ }
+ }
+ return 0;
+}
+
+PyObject* PyUpb_MapContainer_Subscript(PyObject* _self, PyObject* key) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ upb_MessageValue u_key, u_val;
+ if (!PyUpb_PyToUpb(key, key_f, &u_key, arena)) return NULL;
+ if (!map || !upb_Map_Get(map, u_key, &u_val)) {
+ map = PyUpb_MapContainer_EnsureReified(_self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ if (upb_FieldDef_IsSubMessage(val_f)) {
+ u_val.msg_val = upb_Message_New(upb_FieldDef_MessageSubDef(val_f), arena);
+ } else {
+ memset(&u_val, 0, sizeof(u_val));
+ }
+ upb_Map_Set(map, u_key, u_val, arena);
+ }
+ return PyUpb_UpbToPy(u_val, val_f, self->arena);
+}
+
+PyObject* PyUpb_MapContainer_Contains(PyObject* _self, PyObject* key) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ if (!map) Py_RETURN_FALSE;
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ upb_MessageValue u_key;
+ if (!PyUpb_PyToUpb(key, key_f, &u_key, NULL)) return NULL;
+ if (upb_Map_Get(map, u_key, NULL)) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+}
+
+PyObject* PyUpb_MapContainer_Clear(PyObject* _self, PyObject* key) {
+ upb_Map* map = PyUpb_MapContainer_EnsureReified(_self);
+ upb_Map_Clear(map);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_MapContainer_Get(PyObject* _self, PyObject* args,
+ PyObject* kwargs) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ static const char* kwlist[] = {"key", "default", NULL};
+ PyObject* key;
+ PyObject* default_value = NULL;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", (char**)kwlist, &key,
+ &default_value)) {
+ return NULL;
+ }
+
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ upb_MessageValue u_key, u_val;
+ if (!PyUpb_PyToUpb(key, key_f, &u_key, arena)) return NULL;
+ if (map && upb_Map_Get(map, u_key, &u_val)) {
+ return PyUpb_UpbToPy(u_val, val_f, self->arena);
+ }
+ if (default_value) {
+ Py_INCREF(default_value);
+ return default_value;
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_MapContainer_GetEntryClass(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ return PyUpb_Descriptor_GetClass(entry_m);
+}
+
+Py_ssize_t PyUpb_MapContainer_Length(PyObject* _self) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ return map ? upb_Map_Size(map) : 0;
+}
+
+PyUpb_MapContainer* PyUpb_MapContainer_Check(PyObject* _self) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ if (!PyObject_TypeCheck(_self, state->message_map_container_type) &&
+ !PyObject_TypeCheck(_self, state->scalar_map_container_type)) {
+ PyErr_Format(PyExc_TypeError, "Expected protobuf map, but got %R", _self);
+ return NULL;
+ }
+ return (PyUpb_MapContainer*)_self;
+}
+
+int PyUpb_CMessage_InitMapAttributes(PyObject* map, PyObject* value,
+ const upb_FieldDef* f);
+
+static PyObject* PyUpb_MapContainer_MergeFrom(PyObject* _self, PyObject* _arg) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+
+ if (PyDict_Check(_arg)) {
+ return PyErr_Format(PyExc_AttributeError, "Merging of dict is not allowed");
+ }
+
+ if (PyUpb_CMessage_InitMapAttributes(_self, _arg, f) < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_MapContainer_Repr(PyObject* _self) {
+ PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self;
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self);
+ PyObject* dict = PyDict_New();
+ if (map) {
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ size_t iter = kUpb_Map_Begin;
+ while (upb_MapIterator_Next(map, &iter)) {
+ PyObject* key =
+ PyUpb_UpbToPy(upb_MapIterator_Key(map, iter), key_f, self->arena);
+ PyObject* val =
+ PyUpb_UpbToPy(upb_MapIterator_Value(map, iter), val_f, self->arena);
+ if (!key || !val) {
+ Py_XDECREF(key);
+ Py_XDECREF(val);
+ Py_DECREF(dict);
+ return NULL;
+ }
+ PyDict_SetItem(dict, key, val);
+ Py_DECREF(key);
+ Py_DECREF(val);
+ }
+ }
+ PyObject* repr = PyObject_Repr(dict);
+ Py_DECREF(dict);
+ return repr;
+}
+
+PyObject* PyUpb_MapContainer_GetOrCreateWrapper(upb_Map* map,
+ const upb_FieldDef* f,
+ PyObject* arena) {
+ PyUpb_MapContainer* ret = (void*)PyUpb_ObjCache_Get(map);
+ if (ret) return &ret->ob_base;
+
+ PyTypeObject* cls = PyUpb_MapContainer_GetClass(f);
+ ret = (void*)PyType_GenericAlloc(cls, 0);
+ ret->arena = arena;
+ ret->field = (uintptr_t)f;
+ ret->ptr.map = map;
+ ret->version = 0;
+ Py_INCREF(arena);
+ PyUpb_ObjCache_Add(map, &ret->ob_base);
+ return &ret->ob_base;
+}
+
+// -----------------------------------------------------------------------------
+// ScalarMapContainer
+// -----------------------------------------------------------------------------
+
+static PyMethodDef PyUpb_ScalarMapContainer_Methods[] = {
+ {"__contains__", PyUpb_MapContainer_Contains, METH_O,
+ "Tests whether a key is a member of the map."},
+ {"clear", PyUpb_MapContainer_Clear, METH_NOARGS,
+ "Removes all elements from the map."},
+ {"get", (PyCFunction)PyUpb_MapContainer_Get, METH_VARARGS | METH_KEYWORDS,
+ "Gets the value for the given key if present, or otherwise a default"},
+ {"GetEntryClass", PyUpb_MapContainer_GetEntryClass, METH_NOARGS,
+ "Return the class used to build Entries of (key, value) pairs."},
+ {"MergeFrom", PyUpb_MapContainer_MergeFrom, METH_O,
+ "Merges a map into the current map."},
+ /*
+ { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class." },
+ { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
+ "Outputs picklable representation of the repeated field." },
+ */
+ {NULL, NULL},
+};
+
+static PyType_Slot PyUpb_ScalarMapContainer_Slots[] = {
+ {Py_tp_dealloc, PyUpb_MapContainer_Dealloc},
+ {Py_mp_length, PyUpb_MapContainer_Length},
+ {Py_mp_subscript, PyUpb_MapContainer_Subscript},
+ {Py_mp_ass_subscript, PyUpb_MapContainer_AssignSubscript},
+ {Py_tp_methods, PyUpb_ScalarMapContainer_Methods},
+ {Py_tp_iter, PyUpb_MapIterator_New},
+ {Py_tp_repr, PyUpb_MapContainer_Repr},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL},
+};
+
+static PyType_Spec PyUpb_ScalarMapContainer_Spec = {
+ PYUPB_MODULE_NAME ".ScalarMapContainer",
+ sizeof(PyUpb_MapContainer),
+ 0,
+ Py_TPFLAGS_DEFAULT,
+ PyUpb_ScalarMapContainer_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// MessageMapContainer
+// -----------------------------------------------------------------------------
+
+static PyMethodDef PyUpb_MessageMapContainer_Methods[] = {
+ {"__contains__", PyUpb_MapContainer_Contains, METH_O,
+ "Tests whether the map contains this element."},
+ {"clear", PyUpb_MapContainer_Clear, METH_NOARGS,
+ "Removes all elements from the map."},
+ {"get", (PyCFunction)PyUpb_MapContainer_Get, METH_VARARGS | METH_KEYWORDS,
+ "Gets the value for the given key if present, or otherwise a default"},
+ {"get_or_create", PyUpb_MapContainer_Subscript, METH_O,
+ "Alias for getitem, useful to make explicit that the map is mutated."},
+ {"GetEntryClass", PyUpb_MapContainer_GetEntryClass, METH_NOARGS,
+ "Return the class used to build Entries of (key, value) pairs."},
+ {"MergeFrom", PyUpb_MapContainer_MergeFrom, METH_O,
+ "Merges a map into the current map."},
+ /*
+ { "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class." },
+ { "__reduce__", (PyCFunction)Reduce, METH_NOARGS,
+ "Outputs picklable representation of the repeated field." },
+ */
+ {NULL, NULL},
+};
+
+static PyType_Slot PyUpb_MessageMapContainer_Slots[] = {
+ {Py_tp_dealloc, PyUpb_MapContainer_Dealloc},
+ {Py_mp_length, PyUpb_MapContainer_Length},
+ {Py_mp_subscript, PyUpb_MapContainer_Subscript},
+ {Py_mp_ass_subscript, PyUpb_MapContainer_AssignSubscript},
+ {Py_tp_methods, PyUpb_MessageMapContainer_Methods},
+ {Py_tp_iter, PyUpb_MapIterator_New},
+ {Py_tp_repr, PyUpb_MapContainer_Repr},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_MessageMapContainer_Spec = {
+ PYUPB_MODULE_NAME ".MessageMapContainer", sizeof(PyUpb_MapContainer), 0,
+ Py_TPFLAGS_DEFAULT, PyUpb_MessageMapContainer_Slots};
+
+// -----------------------------------------------------------------------------
+// MapIterator
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ PyUpb_MapContainer* map; // We own a reference.
+ size_t iter;
+ int version;
+} PyUpb_MapIterator;
+
+static PyObject* PyUpb_MapIterator_New(PyUpb_MapContainer* map) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyUpb_MapIterator* iter =
+ (void*)PyType_GenericAlloc(state->map_iterator_type, 0);
+ iter->map = map;
+ iter->iter = kUpb_Map_Begin;
+ iter->version = map->version;
+ Py_INCREF(map);
+ return &iter->ob_base;
+}
+
+static void PyUpb_MapIterator_Dealloc(void* _self) {
+ PyUpb_MapIterator* self = (PyUpb_MapIterator*)_self;
+ Py_DECREF(&self->map->ob_base);
+ PyUpb_Dealloc(_self);
+}
+
+PyObject* PyUpb_MapIterator_IterNext(PyObject* _self) {
+ PyUpb_MapIterator* self = (PyUpb_MapIterator*)_self;
+ if (self->version != self->map->version) {
+ return PyErr_Format(PyExc_RuntimeError, "Map modified during iteration.");
+ }
+ upb_Map* map = PyUpb_MapContainer_GetIfReified(self->map);
+ if (!map) return NULL;
+ if (!upb_MapIterator_Next(map, &self->iter)) return NULL;
+ upb_MessageValue key = upb_MapIterator_Key(map, self->iter);
+ const upb_FieldDef* f = PyUpb_MapContainer_GetField(self->map);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry_m, 0);
+ return PyUpb_UpbToPy(key, key_f, self->map->arena);
+}
+
+static PyType_Slot PyUpb_MapIterator_Slots[] = {
+ {Py_tp_dealloc, PyUpb_MapIterator_Dealloc},
+ {Py_tp_iter, PyObject_SelfIter},
+ {Py_tp_iternext, PyUpb_MapIterator_IterNext},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_MapIterator_Spec = {
+ PYUPB_MODULE_NAME ".MapIterator", sizeof(PyUpb_MapIterator), 0,
+ Py_TPFLAGS_DEFAULT, PyUpb_MapIterator_Slots};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+static PyObject* GetMutableMappingBase(void) {
+ PyObject* collections = NULL;
+ PyObject* mapping = NULL;
+ PyObject* bases = NULL;
+ if ((collections = PyImport_ImportModule("collections.abc")) &&
+ (mapping = PyObject_GetAttrString(collections, "MutableMapping"))) {
+ bases = Py_BuildValue("(O)", mapping);
+ }
+ Py_XDECREF(collections);
+ Py_XDECREF(mapping);
+ return bases;
+}
+
+bool PyUpb_Map_Init(PyObject* m) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+ PyObject* bases = GetMutableMappingBase();
+ if (!bases) return false;
+
+ state->message_map_container_type =
+ PyUpb_AddClassWithBases(m, &PyUpb_MessageMapContainer_Spec, bases);
+ state->scalar_map_container_type =
+ PyUpb_AddClassWithBases(m, &PyUpb_ScalarMapContainer_Spec, bases);
+ state->map_iterator_type = PyUpb_AddClass(m, &PyUpb_MapIterator_Spec);
+
+ Py_DECREF(bases);
+
+ return state->message_map_container_type &&
+ state->scalar_map_container_type && state->map_iterator_type;
+}
diff --git a/grpc/third_party/upb/python/map.h b/grpc/third_party/upb/python/map.h
new file mode 100644
index 00000000..0c03ed06
--- /dev/null
+++ b/grpc/third_party/upb/python/map.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_MAP_H__
+#define PYUPB_MAP_H__
+
+#include <stdbool.h>
+
+#include "python/python.h"
+#include "upb/def.h"
+
+// Creates a new repeated field stub for field `f` of message object `parent`.
+// Precondition: `parent` must be a stub.
+PyObject* PyUpb_MapContainer_NewStub(PyObject* parent, const upb_FieldDef* f,
+ PyObject* arena);
+
+// Returns a map object wrapping `map`, of field type `f`, which must be on
+// `arena`. If an existing wrapper object exists, it will be returned,
+// otherwise a new object will be created. The caller always owns a ref on the
+// returned value.
+PyObject* PyUpb_MapContainer_GetOrCreateWrapper(upb_Map* map,
+ const upb_FieldDef* f,
+ PyObject* arena);
+
+// Reifies a map stub to point to the concrete data in `map`.
+// If `map` is NULL, an appropriate empty map will be constructed.
+void PyUpb_MapContainer_Reify(PyObject* self, upb_Map* map);
+
+// Reifies this map object if it is not already reified.
+upb_Map* PyUpb_MapContainer_EnsureReified(PyObject* self);
+
+// Assigns `self[key] = val` for the map `self`.
+int PyUpb_MapContainer_AssignSubscript(PyObject* self, PyObject* key,
+ PyObject* val);
+
+// Invalidates any existing iterators for the map `obj`.
+void PyUpb_MapContainer_Invalidate(PyObject* obj);
+
+// Module-level init.
+bool PyUpb_Map_Init(PyObject* m);
+
+#endif // PYUPB_MAP_H__
diff --git a/grpc/third_party/upb/python/message.c b/grpc/third_party/upb/python/message.c
new file mode 100644
index 00000000..384c5b31
--- /dev/null
+++ b/grpc/third_party/upb/python/message.c
@@ -0,0 +1,1860 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/message.h"
+
+#include "python/convert.h"
+#include "python/descriptor.h"
+#include "python/extension_dict.h"
+#include "python/map.h"
+#include "python/repeated.h"
+#include "upb/def.h"
+#include "upb/reflection.h"
+#include "upb/text_encode.h"
+#include "upb/util/required_fields.h"
+
+static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls);
+static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name);
+
+// -----------------------------------------------------------------------------
+// CPythonBits
+// -----------------------------------------------------------------------------
+
+// This struct contains a few things that are not exposed directly through the
+// limited API, but that we can get at in somewhat more roundabout ways. The
+// roundabout ways are slower, so we cache the values here.
+//
+// These values are valid to cache in a global, even across sub-interpreters,
+// because they are not pointers to interpreter state. They are process
+// globals that will be the same for any interpreter in this process.
+typedef struct {
+ // For each member, we note the equivalent expression that we could use in the
+ // full (non-limited) API.
+ newfunc type_new; // PyTypeObject.tp_new
+ destructor type_dealloc; // PyTypeObject.tp_dealloc
+ getattrofunc type_getattro; // PyTypeObject.tp_getattro
+ setattrofunc type_setattro; // PyTypeObject.tp_setattro
+ size_t type_basicsize; // sizeof(PyHeapTypeObject)
+
+ // While we can refer to PY_VERSION_HEX in the limited API, this will give us
+ // the version of Python we were compiled against, which may be different
+ // than the version we are dynamically linked against. Here we want the
+ // version that is actually running in this process.
+ long python_version_hex; // PY_VERSION_HEX
+} PyUpb_CPythonBits;
+
+// A global containing the values for this process.
+PyUpb_CPythonBits cpython_bits;
+
+destructor upb_Pre310_PyType_GetDeallocSlot(PyTypeObject* type_subclass) {
+ // This is a bit desperate. We need type_dealloc(), but PyType_GetSlot(type,
+ // Py_tp_dealloc) will return subtype_dealloc(). There appears to be no way
+ // whatsoever to fetch type_dealloc() through the limited API until Python
+ // 3.10.
+ //
+ // To work around this so we attempt to find it by looking for the offset of
+ // tp_dealloc in PyTypeObject, then memcpy() it directly. This should always
+ // work in practice.
+ //
+ // Starting with Python 3.10 on you can call PyType_GetSlot() on non-heap
+ // types. We will be able to replace all this hack with just:
+ //
+ // PyType_GetSlot(&PyType_Type, Py_tp_dealloc)
+ //
+ destructor subtype_dealloc = PyType_GetSlot(type_subclass, Py_tp_dealloc);
+ for (size_t i = 0; i < 2000; i += sizeof(uintptr_t)) {
+ destructor maybe_subtype_dealloc;
+ memcpy(&maybe_subtype_dealloc, (char*)type_subclass + i,
+ sizeof(destructor));
+ if (maybe_subtype_dealloc == subtype_dealloc) {
+ destructor type_dealloc;
+ memcpy(&type_dealloc, (char*)&PyType_Type + i, sizeof(destructor));
+ return type_dealloc;
+ }
+ }
+ assert(false);
+ return NULL;
+}
+
+static bool PyUpb_CPythonBits_Init(PyUpb_CPythonBits* bits) {
+ PyObject* bases = NULL;
+ PyTypeObject* type = NULL;
+ PyObject* size = NULL;
+ PyObject* sys = NULL;
+ PyObject* hex_version = NULL;
+ bool ret = false;
+
+ // PyType_GetSlot() only works on heap types, so we cannot use it on
+ // &PyType_Type directly. Instead we create our own (temporary) type derived
+ // from PyType_Type: this will inherit all of the slots from PyType_Type, but
+ // as a heap type it can be queried with PyType_GetSlot().
+ static PyType_Slot dummy_slots[] = {{0, NULL}};
+
+ static PyType_Spec dummy_spec = {
+ "module.DummyClass", // tp_name
+ 0, // To be filled in by size of base // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT, // tp_flags
+ dummy_slots,
+ };
+
+ bases = Py_BuildValue("(O)", &PyType_Type);
+ if (!bases) goto err;
+ type = (PyTypeObject*)PyType_FromSpecWithBases(&dummy_spec, bases);
+ if (!type) goto err;
+
+ bits->type_new = PyType_GetSlot(type, Py_tp_new);
+ bits->type_dealloc = upb_Pre310_PyType_GetDeallocSlot(type);
+ bits->type_getattro = PyType_GetSlot(type, Py_tp_getattro);
+ bits->type_setattro = PyType_GetSlot(type, Py_tp_setattro);
+
+ size = PyObject_GetAttrString((PyObject*)&PyType_Type, "__basicsize__");
+ if (!size) goto err;
+ bits->type_basicsize = PyLong_AsLong(size);
+ if (bits->type_basicsize == -1) goto err;
+
+ assert(bits->type_new);
+ assert(bits->type_dealloc);
+ assert(bits->type_getattro);
+ assert(bits->type_setattro);
+
+#ifndef Py_LIMITED_API
+ assert(bits->type_new == PyType_Type.tp_new);
+ assert(bits->type_dealloc == PyType_Type.tp_dealloc);
+ assert(bits->type_getattro == PyType_Type.tp_getattro);
+ assert(bits->type_setattro == PyType_Type.tp_setattro);
+ assert(bits->type_basicsize == sizeof(PyHeapTypeObject));
+#endif
+
+ sys = PyImport_ImportModule("sys");
+ hex_version = PyObject_GetAttrString(sys, "hexversion");
+ bits->python_version_hex = PyLong_AsLong(hex_version);
+ ret = true;
+
+err:
+ Py_XDECREF(bases);
+ Py_XDECREF(type);
+ Py_XDECREF(size);
+ Py_XDECREF(sys);
+ Py_XDECREF(hex_version);
+ return ret;
+}
+
+// -----------------------------------------------------------------------------
+// CMessage
+// -----------------------------------------------------------------------------
+
+// The main message object. The type of the object (PyUpb_CMessage.ob_type)
+// will be an instance of the PyUpb_MessageMeta type (defined below). So the
+// chain is:
+// FooMessage = MessageMeta(...)
+// foo = FooMessage()
+//
+// Which becomes:
+// Object C Struct Type Python type (ob_type)
+// ----------------- ----------------- ---------------------
+// foo PyUpb_CMessage FooMessage
+// FooMessage PyUpb_MessageMeta message_meta_type
+// message_meta_type PyTypeObject 'type' in Python
+//
+// A message object can be in one of two states: present or non-present. When
+// a message is non-present, it stores a reference to its parent, and a write
+// to any attribute will trigger the message to become present in its parent.
+// The parent may also be non-present, in which case a mutation will trigger a
+// chain reaction.
+typedef struct PyUpb_CMessage {
+ PyObject_HEAD;
+ PyObject* arena;
+ uintptr_t def; // Tagged, low bit 1 == upb_FieldDef*, else upb_MessageDef*
+ union {
+ // when def is msgdef, the data for this msg.
+ upb_Message* msg;
+ // when def is fielddef, owning pointer to parent
+ struct PyUpb_CMessage* parent;
+ } ptr;
+ PyObject* ext_dict; // Weak pointer to extension dict, if any.
+ // name->obj dict for non-present msg/map/repeated, NULL if none.
+ PyUpb_WeakMap* unset_subobj_map;
+ int version;
+} PyUpb_CMessage;
+
+static PyObject* PyUpb_CMessage_GetAttr(PyObject* _self, PyObject* attr);
+
+bool PyUpb_CMessage_IsStub(PyUpb_CMessage* msg) { return msg->def & 1; }
+
+const upb_FieldDef* PyUpb_CMessage_GetFieldDef(PyUpb_CMessage* msg) {
+ assert(PyUpb_CMessage_IsStub(msg));
+ return (void*)(msg->def & ~(uintptr_t)1);
+}
+
+static const upb_MessageDef* _PyUpb_CMessage_GetMsgdef(PyUpb_CMessage* msg) {
+ return PyUpb_CMessage_IsStub(msg)
+ ? upb_FieldDef_MessageSubDef(PyUpb_CMessage_GetFieldDef(msg))
+ : (void*)msg->def;
+}
+
+const upb_MessageDef* PyUpb_CMessage_GetMsgdef(PyObject* self) {
+ return _PyUpb_CMessage_GetMsgdef((PyUpb_CMessage*)self);
+}
+
+static upb_Message* PyUpb_CMessage_GetMsg(PyUpb_CMessage* self) {
+ assert(!PyUpb_CMessage_IsStub(self));
+ return self->ptr.msg;
+}
+
+bool PyUpb_CMessage_TryCheck(PyObject* self) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyObject* type = (PyObject*)Py_TYPE(self);
+ return Py_TYPE(type) == state->message_meta_type;
+}
+
+bool PyUpb_CMessage_Verify(PyObject* self) {
+ if (!PyUpb_CMessage_TryCheck(self)) {
+ PyErr_Format(PyExc_TypeError, "Expected a message object, but got %R.",
+ self);
+ return false;
+ }
+ return true;
+}
+
+// If the message is reified, returns it. Otherwise, returns NULL.
+// If NULL is returned, the object is empty and has no underlying data.
+upb_Message* PyUpb_CMessage_GetIfReified(PyObject* _self) {
+ PyUpb_CMessage* self = (void*)_self;
+ return PyUpb_CMessage_IsStub(self) ? NULL : self->ptr.msg;
+}
+
+static PyObject* PyUpb_CMessage_New(PyObject* cls, PyObject* unused_args,
+ PyObject* unused_kwargs) {
+ const upb_MessageDef* msgdef = PyUpb_MessageMeta_GetMsgdef(cls);
+ PyUpb_CMessage* msg = (void*)PyType_GenericAlloc((PyTypeObject*)cls, 0);
+ msg->def = (uintptr_t)msgdef;
+ msg->arena = PyUpb_Arena_New();
+ msg->ptr.msg = upb_Message_New(msgdef, PyUpb_Arena_Get(msg->arena));
+ msg->unset_subobj_map = NULL;
+ msg->ext_dict = NULL;
+ msg->version = 0;
+
+ PyObject* ret = &msg->ob_base;
+ PyUpb_ObjCache_Add(msg->ptr.msg, ret);
+ return ret;
+}
+
+/*
+ * PyUpb_CMessage_LookupName()
+ *
+ * Tries to find a field or oneof named `py_name` in the message object `self`.
+ * The user must pass `f` and/or `o` to indicate whether a field or a oneof name
+ * is expected. If the name is found and it has an expected type, the function
+ * sets `*f` or `*o` respectively and returns true. Otherwise returns false
+ * and sets an exception of type `exc_type` if provided.
+ */
+static bool PyUpb_CMessage_LookupName(PyUpb_CMessage* self, PyObject* py_name,
+ const upb_FieldDef** f,
+ const upb_OneofDef** o,
+ PyObject* exc_type) {
+ assert(f || o);
+ Py_ssize_t size;
+ const char* name = NULL;
+ if (PyUnicode_Check(py_name)) {
+ name = PyUnicode_AsUTF8AndSize(py_name, &size);
+ } else if (PyBytes_Check(py_name)) {
+ PyBytes_AsStringAndSize(py_name, (char**)&name, &size);
+ }
+ if (!name) {
+ PyErr_Format(exc_type,
+ "Expected a field name, but got non-string argument %S.",
+ py_name);
+ return false;
+ }
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+
+ if (!upb_MessageDef_FindByNameWithSize(msgdef, name, size, f, o)) {
+ if (exc_type) {
+ PyErr_Format(exc_type, "Protocol message %s has no \"%s\" field.",
+ upb_MessageDef_Name(msgdef), name);
+ }
+ return false;
+ }
+
+ if (!o && !*f) {
+ if (exc_type) {
+ PyErr_Format(exc_type, "Expected a field name, but got oneof name %s.",
+ name);
+ }
+ return false;
+ }
+
+ if (!f && !*o) {
+ if (exc_type) {
+ PyErr_Format(exc_type, "Expected a oneof name, but got field name %s.",
+ name);
+ }
+ return false;
+ }
+
+ return true;
+}
+
+static bool PyUpb_CMessage_InitMessageMapEntry(PyObject* dst, PyObject* src) {
+ if (!src || !dst) return false;
+
+ // TODO(haberman): Currently we are doing Clear()+MergeFrom(). Replace with
+ // CopyFrom() once that is implemented.
+ PyObject* ok = PyObject_CallMethod(dst, "Clear", NULL);
+ if (!ok) return false;
+ Py_DECREF(ok);
+ ok = PyObject_CallMethod(dst, "MergeFrom", "O", src);
+ if (!ok) return false;
+ Py_DECREF(ok);
+
+ return true;
+}
+
+int PyUpb_CMessage_InitMapAttributes(PyObject* map, PyObject* value,
+ const upb_FieldDef* f) {
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry_m, 1);
+ PyObject* it = NULL;
+ PyObject* tmp = NULL;
+ int ret = -1;
+ if (upb_FieldDef_IsSubMessage(val_f)) {
+ it = PyObject_GetIter(value);
+ if (it == NULL) {
+ PyErr_Format(PyExc_TypeError, "Argument for field %s is not iterable",
+ upb_FieldDef_FullName(f));
+ goto err;
+ }
+ PyObject* e;
+ while ((e = PyIter_Next(it)) != NULL) {
+ PyObject* src = PyObject_GetItem(value, e);
+ PyObject* dst = PyObject_GetItem(map, e);
+ Py_DECREF(e);
+ bool ok = PyUpb_CMessage_InitMessageMapEntry(dst, src);
+ Py_XDECREF(src);
+ Py_XDECREF(dst);
+ if (!ok) goto err;
+ }
+ } else {
+ tmp = PyObject_CallMethod(map, "update", "O", value);
+ if (!tmp) goto err;
+ }
+ ret = 0;
+
+err:
+ Py_XDECREF(it);
+ Py_XDECREF(tmp);
+ return ret;
+}
+
+void PyUpb_CMessage_EnsureReified(PyUpb_CMessage* self);
+
+static bool PyUpb_CMessage_InitMapAttribute(PyObject* _self, PyObject* name,
+ const upb_FieldDef* f,
+ PyObject* value) {
+ PyObject* map = PyUpb_CMessage_GetAttr(_self, name);
+ int ok = PyUpb_CMessage_InitMapAttributes(map, value, f);
+ Py_DECREF(map);
+ return ok >= 0;
+}
+
+static bool PyUpb_CMessage_InitRepeatedAttribute(PyObject* _self,
+ PyObject* name,
+ PyObject* value) {
+ bool ok = false;
+ PyObject* tmp = NULL;
+ PyObject* repeated = PyUpb_CMessage_GetAttr(_self, name);
+ if (!repeated) goto err;
+ tmp = PyUpb_RepeatedContainer_Extend(repeated, value);
+ if (!tmp) goto err;
+ ok = true;
+
+err:
+ Py_XDECREF(repeated);
+ Py_XDECREF(tmp);
+ return ok;
+}
+
+static bool PyUpb_CMessage_InitMessageAttribute(PyObject* _self, PyObject* name,
+ PyObject* value) {
+ PyObject* submsg = PyUpb_CMessage_GetAttr(_self, name);
+ if (!submsg) return -1;
+ assert(!PyErr_Occurred());
+ bool ok;
+ if (PyUpb_CMessage_TryCheck(value)) {
+ PyObject* tmp = PyUpb_CMessage_MergeFrom(submsg, value);
+ ok = tmp != NULL;
+ Py_DECREF(tmp);
+ } else if (PyDict_Check(value)) {
+ assert(!PyErr_Occurred());
+ ok = PyUpb_CMessage_InitAttributes(submsg, NULL, value) >= 0;
+ } else {
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self);
+ PyErr_Format(PyExc_TypeError, "Message must be initialized with a dict: %s",
+ upb_MessageDef_FullName(m));
+ ok = false;
+ }
+ Py_DECREF(submsg);
+ return ok;
+}
+
+static bool PyUpb_CMessage_InitScalarAttribute(upb_Message* msg,
+ const upb_FieldDef* f,
+ PyObject* value,
+ upb_Arena* arena) {
+ upb_MessageValue msgval;
+ assert(!PyErr_Occurred());
+ if (!PyUpb_PyToUpb(value, f, &msgval, arena)) return false;
+ upb_Message_Set(msg, f, msgval, arena);
+ return true;
+}
+
+int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args,
+ PyObject* kwargs) {
+ assert(!PyErr_Occurred());
+
+ if (args != NULL && PyTuple_Size(args) != 0) {
+ PyErr_SetString(PyExc_TypeError, "No positional arguments allowed");
+ return -1;
+ }
+
+ if (kwargs == NULL) return 0;
+
+ PyUpb_CMessage* self = (void*)_self;
+ Py_ssize_t pos = 0;
+ PyObject* name;
+ PyObject* value;
+ PyUpb_CMessage_EnsureReified(self);
+ upb_Message* msg = PyUpb_CMessage_GetMsg(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+
+ while (PyDict_Next(kwargs, &pos, &name, &value)) {
+ assert(!PyErr_Occurred());
+ const upb_FieldDef* f;
+ assert(!PyErr_Occurred());
+ if (!PyUpb_CMessage_LookupName(self, name, &f, NULL, PyExc_ValueError)) {
+ return -1;
+ }
+
+ if (value == Py_None) continue; // Ignored.
+
+ assert(!PyErr_Occurred());
+
+ if (upb_FieldDef_IsMap(f)) {
+ if (!PyUpb_CMessage_InitMapAttribute(_self, name, f, value)) return -1;
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ if (!PyUpb_CMessage_InitRepeatedAttribute(_self, name, value)) return -1;
+ } else if (upb_FieldDef_IsSubMessage(f)) {
+ if (!PyUpb_CMessage_InitMessageAttribute(_self, name, value)) return -1;
+ } else {
+ if (!PyUpb_CMessage_InitScalarAttribute(msg, f, value, arena)) return -1;
+ }
+ if (PyErr_Occurred()) return -1;
+ }
+
+ if (PyErr_Occurred()) return -1;
+ return 0;
+}
+
+static int PyUpb_CMessage_Init(PyObject* _self, PyObject* args,
+ PyObject* kwargs) {
+ if (args != NULL && PyTuple_Size(args) != 0) {
+ PyErr_SetString(PyExc_TypeError, "No positional arguments allowed");
+ return -1;
+ }
+
+ return PyUpb_CMessage_InitAttributes(_self, args, kwargs);
+}
+
+static PyObject* PyUpb_CMessage_NewStub(PyObject* parent, const upb_FieldDef* f,
+ PyObject* arena) {
+ const upb_MessageDef* sub_m = upb_FieldDef_MessageSubDef(f);
+ PyObject* cls = PyUpb_Descriptor_GetClass(sub_m);
+
+ PyUpb_CMessage* msg = (void*)PyType_GenericAlloc((PyTypeObject*)cls, 0);
+ msg->def = (uintptr_t)f | 1;
+ msg->arena = arena;
+ msg->ptr.parent = (PyUpb_CMessage*)parent;
+ msg->unset_subobj_map = NULL;
+ msg->ext_dict = NULL;
+ msg->version = 0;
+
+ Py_DECREF(cls);
+ Py_INCREF(parent);
+ Py_INCREF(arena);
+ return &msg->ob_base;
+}
+
+static bool PyUpb_CMessage_IsEqual(PyUpb_CMessage* m1, PyObject* _m2) {
+ PyUpb_CMessage* m2 = (void*)_m2;
+ if (m1 == m2) return true;
+ if (!PyObject_TypeCheck(_m2, m1->ob_base.ob_type)) {
+ return false;
+ }
+ const upb_MessageDef* m1_msgdef = _PyUpb_CMessage_GetMsgdef(m1);
+#ifndef NDEBUG
+ const upb_MessageDef* m2_msgdef = _PyUpb_CMessage_GetMsgdef(m2);
+ assert(m1_msgdef == m2_msgdef);
+#endif
+ const upb_Message* m1_msg = PyUpb_CMessage_GetIfReified((PyObject*)m1);
+ const upb_Message* m2_msg = PyUpb_CMessage_GetIfReified(_m2);
+ return PyUpb_Message_IsEqual(m1_msg, m2_msg, m1_msgdef);
+}
+
+static const upb_FieldDef* PyUpb_CMessage_InitAsMsg(PyUpb_CMessage* m,
+ upb_Arena* arena) {
+ const upb_FieldDef* f = PyUpb_CMessage_GetFieldDef(m);
+ m->ptr.msg = upb_Message_New(upb_FieldDef_MessageSubDef(f), arena);
+ m->def = (uintptr_t)upb_FieldDef_MessageSubDef(f);
+ PyUpb_ObjCache_Add(m->ptr.msg, &m->ob_base);
+ return f;
+}
+
+static void PyUpb_CMessage_SetField(PyUpb_CMessage* parent,
+ const upb_FieldDef* f,
+ PyUpb_CMessage* child, upb_Arena* arena) {
+ upb_MessageValue msgval = {.msg_val = PyUpb_CMessage_GetMsg(child)};
+ upb_Message_Set(PyUpb_CMessage_GetMsg(parent), f, msgval, arena);
+ PyUpb_WeakMap_Delete(parent->unset_subobj_map, f);
+ // Releases a ref previously owned by child->ptr.parent of our child.
+ Py_DECREF(child);
+}
+
+/*
+ * PyUpb_CMessage_EnsureReified()
+ *
+ * This implements the "expando" behavior of Python protos:
+ * foo = FooProto()
+ *
+ * # The intermediate messages don't really exist, and won't be serialized.
+ * x = foo.bar.bar.bar.bar.bar.baz
+ *
+ * # Now all the intermediate objects are created.
+ * foo.bar.bar.bar.bar.bar.baz = 5
+ *
+ * This function should be called before performing any mutation of a protobuf
+ * object.
+ *
+ * Post-condition:
+ * PyUpb_CMessage_IsStub(self) is false
+ */
+void PyUpb_CMessage_EnsureReified(PyUpb_CMessage* self) {
+ if (!PyUpb_CMessage_IsStub(self)) return;
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+
+ // This is a non-present message. We need to create a real upb_Message for
+ // this object and every parent until we reach a present message.
+ PyUpb_CMessage* child = self;
+ PyUpb_CMessage* parent = self->ptr.parent;
+ const upb_FieldDef* child_f = PyUpb_CMessage_InitAsMsg(child, arena);
+ Py_INCREF(child); // To avoid a special-case in PyUpb_CMessage_SetField().
+
+ do {
+ PyUpb_CMessage* next_parent = parent->ptr.parent;
+ const upb_FieldDef* parent_f = NULL;
+ if (PyUpb_CMessage_IsStub(parent)) {
+ parent_f = PyUpb_CMessage_InitAsMsg(parent, arena);
+ }
+ PyUpb_CMessage_SetField(parent, child_f, child, arena);
+ child = parent;
+ child_f = parent_f;
+ parent = next_parent;
+ } while (child_f);
+
+ // Releases ref previously owned by child->ptr.parent of our child.
+ Py_DECREF(child);
+ self->version++;
+}
+
+static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage* self);
+
+/*
+ * PyUpb_CMessage_Reify()
+ *
+ * The message equivalent of PyUpb_*Container_Reify(), this transitions
+ * the wrapper from the unset state (owning a reference on self->ptr.parent) to
+ * the set state (having a non-owning pointer to self->ptr.msg).
+ */
+static void PyUpb_CMessage_Reify(PyUpb_CMessage* self, const upb_FieldDef* f,
+ upb_Message* msg) {
+ assert(f == PyUpb_CMessage_GetFieldDef(self));
+ if (!msg) {
+ const upb_MessageDef* msgdef = PyUpb_CMessage_GetMsgdef((PyObject*)self);
+ msg = upb_Message_New(msgdef, PyUpb_Arena_Get(self->arena));
+ }
+ PyUpb_ObjCache_Add(msg, &self->ob_base);
+ Py_DECREF(&self->ptr.parent->ob_base);
+ self->ptr.msg = msg; // Overwrites self->ptr.parent
+ self->def = (uintptr_t)upb_FieldDef_MessageSubDef(f);
+ PyUpb_CMessage_SyncSubobjs(self);
+}
+
+/*
+ * PyUpb_CMessage_SyncSubobjs()
+ *
+ * This operation must be invoked whenever the underlying upb_Message has been
+ * mutated directly in C. This will attach any newly-present field data
+ * to previously returned stub wrapper objects.
+ *
+ * For example:
+ * foo = FooMessage()
+ * sub = foo.submsg # Empty, unset sub-message
+ *
+ * # SyncSubobjs() is required to connect our existing 'sub' wrapper to the
+ * # newly created foo.submsg data in C.
+ * foo.MergeFrom(FooMessage(submsg={}))
+ *
+ * This requires that all of the new sub-objects that have appeared are owned
+ * by `self`'s arena.
+ */
+static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage* self) {
+ PyUpb_WeakMap* subobj_map = self->unset_subobj_map;
+ if (!subobj_map) return;
+
+ upb_Message* msg = PyUpb_CMessage_GetMsg(self);
+ intptr_t iter = PYUPB_WEAKMAP_BEGIN;
+ const void* key;
+ PyObject* obj;
+
+ // The last ref to this message could disappear during iteration.
+ // When we call PyUpb_*Container_Reify() below, the container will drop
+ // its ref on `self`. If that was the last ref on self, the object will be
+ // deleted, and `subobj_map` along with it. We need it to live until we are
+ // done iterating.
+ Py_INCREF(&self->ob_base);
+
+ while (PyUpb_WeakMap_Next(subobj_map, &key, &obj, &iter)) {
+ const upb_FieldDef* f = key;
+ if (upb_FieldDef_HasPresence(f) && !upb_Message_Has(msg, f)) continue;
+ upb_MessageValue msgval = upb_Message_Get(msg, f);
+ PyUpb_WeakMap_DeleteIter(subobj_map, &iter);
+ if (upb_FieldDef_IsMap(f)) {
+ if (!msgval.map_val) continue;
+ PyUpb_MapContainer_Reify(obj, (upb_Map*)msgval.map_val);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ if (!msgval.array_val) continue;
+ PyUpb_RepeatedContainer_Reify(obj, (upb_Array*)msgval.array_val);
+ } else {
+ PyUpb_CMessage* sub = (void*)obj;
+ assert(self == sub->ptr.parent);
+ PyUpb_CMessage_Reify(sub, f, (upb_Message*)msgval.msg_val);
+ }
+ }
+
+ Py_DECREF(&self->ob_base);
+
+ // TODO(haberman): present fields need to be iterated too if they can reach
+ // a WeakMap.
+}
+
+static PyObject* PyUpb_CMessage_ToString(PyUpb_CMessage* self) {
+ if (PyUpb_CMessage_IsStub(self)) {
+ return PyUnicode_FromStringAndSize(NULL, 0);
+ }
+ upb_Message* msg = PyUpb_CMessage_GetMsg(self);
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(msgdef));
+ char buf[1024];
+ int options = UPB_TXTENC_SKIPUNKNOWN;
+ size_t size = upb_TextEncode(msg, msgdef, symtab, options, buf, sizeof(buf));
+ if (size < sizeof(buf)) {
+ return PyUnicode_FromStringAndSize(buf, size);
+ } else {
+ char* buf2 = malloc(size + 1);
+ size_t size2 = upb_TextEncode(msg, msgdef, symtab, options, buf2, size + 1);
+ assert(size == size2);
+ PyObject* ret = PyUnicode_FromStringAndSize(buf2, size2);
+ free(buf2);
+ return ret;
+ }
+}
+
+static PyObject* PyUpb_CMessage_RichCompare(PyObject* _self, PyObject* other,
+ int opid) {
+ PyUpb_CMessage* self = (void*)_self;
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+ bool ret = PyUpb_CMessage_IsEqual(self, other);
+ if (opid == Py_NE) ret = !ret;
+ return PyBool_FromLong(ret);
+}
+
+void PyUpb_CMessage_CacheDelete(PyObject* _self, const upb_FieldDef* f) {
+ PyUpb_CMessage* self = (void*)_self;
+ PyUpb_WeakMap_Delete(self->unset_subobj_map, f);
+}
+
+void PyUpb_CMessage_SetConcreteSubobj(PyObject* _self, const upb_FieldDef* f,
+ upb_MessageValue subobj) {
+ PyUpb_CMessage* self = (void*)_self;
+ PyUpb_CMessage_EnsureReified(self);
+ PyUpb_CMessage_CacheDelete(_self, f);
+ upb_Message_Set(self->ptr.msg, f, subobj, PyUpb_Arena_Get(self->arena));
+}
+
+static void PyUpb_CMessage_Dealloc(PyObject* _self) {
+ PyUpb_CMessage* self = (void*)_self;
+
+ if (PyUpb_CMessage_IsStub(self)) {
+ PyUpb_CMessage_CacheDelete((PyObject*)self->ptr.parent,
+ PyUpb_CMessage_GetFieldDef(self));
+ Py_DECREF(self->ptr.parent);
+ } else {
+ PyUpb_ObjCache_Delete(self->ptr.msg);
+ }
+
+ if (self->unset_subobj_map) {
+ PyUpb_WeakMap_Free(self->unset_subobj_map);
+ }
+
+ Py_DECREF(self->arena);
+
+ // We do not use PyUpb_Dealloc() here because CMessage is a base type and for
+ // base types there is a bug we have to work around in this case (see below).
+ PyTypeObject* tp = Py_TYPE(self);
+ freefunc tp_free = PyType_GetSlot(tp, Py_tp_free);
+ tp_free(self);
+
+ if (cpython_bits.python_version_hex >= 0x03080000) {
+ // Prior to Python 3.8 there is a bug where deallocating the type here would
+ // lead to a double-decref: https://bugs.python.org/issue37879
+ Py_DECREF(tp);
+ }
+}
+
+PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m,
+ PyObject* arena) {
+ PyObject* ret = PyUpb_ObjCache_Get(u_msg);
+ if (ret) return ret;
+
+ PyObject* cls = PyUpb_Descriptor_GetClass(m);
+ // It is not safe to use PyObject_{,GC}_New() due to:
+ // https://bugs.python.org/issue35810
+ PyUpb_CMessage* py_msg = (void*)PyType_GenericAlloc((PyTypeObject*)cls, 0);
+ py_msg->arena = arena;
+ py_msg->def = (uintptr_t)m;
+ py_msg->ptr.msg = u_msg;
+ py_msg->unset_subobj_map = NULL;
+ py_msg->ext_dict = NULL;
+ py_msg->version = 0;
+ ret = &py_msg->ob_base;
+ Py_DECREF(cls);
+ Py_INCREF(arena);
+ PyUpb_ObjCache_Add(u_msg, ret);
+ return ret;
+}
+
+/* PyUpb_CMessage_GetStub()
+ *
+ * Non-present messages return "stub" objects that point to their parent, but
+ * will materialize into real upb objects if they are mutated.
+ *
+ * Note: we do *not* create stubs for repeated/map fields unless the parent
+ * is a stub:
+ *
+ * msg = TestMessage()
+ * msg.submessage # (A) Creates a stub
+ * msg.repeated_foo # (B) Does *not* create a stub
+ * msg.submessage.repeated_bar # (C) Creates a stub
+ *
+ * In case (B) we have some freedom: we could either create a stub, or create
+ * a reified object with underlying data. It appears that either could work
+ * equally well, with no observable change to users. There isn't a clear
+ * advantage to either choice. We choose to follow the behavior of the
+ * pre-existing C++ behavior for consistency, but if it becomes apparent that
+ * there would be some benefit to reversing this decision, it should be totally
+ * within the realm of possibility.
+ */
+PyObject* PyUpb_CMessage_GetStub(PyUpb_CMessage* self,
+ const upb_FieldDef* field) {
+ PyObject* _self = (void*)self;
+ if (!self->unset_subobj_map) {
+ self->unset_subobj_map = PyUpb_WeakMap_New();
+ }
+ PyObject* subobj = PyUpb_WeakMap_Get(self->unset_subobj_map, field);
+
+ if (subobj) return subobj;
+
+ if (upb_FieldDef_IsMap(field)) {
+ subobj = PyUpb_MapContainer_NewStub(_self, field, self->arena);
+ } else if (upb_FieldDef_IsRepeated(field)) {
+ subobj = PyUpb_RepeatedContainer_NewStub(_self, field, self->arena);
+ } else {
+ subobj = PyUpb_CMessage_NewStub(&self->ob_base, field, self->arena);
+ }
+ PyUpb_WeakMap_Add(self->unset_subobj_map, field, subobj);
+
+ assert(!PyErr_Occurred());
+ return subobj;
+}
+
+PyObject* PyUpb_CMessage_GetPresentWrapper(PyUpb_CMessage* self,
+ const upb_FieldDef* field) {
+ assert(!PyUpb_CMessage_IsStub(self));
+ upb_MutableMessageValue mutval =
+ upb_Message_Mutable(self->ptr.msg, field, PyUpb_Arena_Get(self->arena));
+ if (upb_FieldDef_IsMap(field)) {
+ return PyUpb_MapContainer_GetOrCreateWrapper(mutval.map, field,
+ self->arena);
+ } else {
+ return PyUpb_RepeatedContainer_GetOrCreateWrapper(mutval.array, field,
+ self->arena);
+ }
+}
+
+PyObject* PyUpb_CMessage_GetScalarValue(PyUpb_CMessage* self,
+ const upb_FieldDef* field) {
+ upb_MessageValue val;
+ if (PyUpb_CMessage_IsStub(self)) {
+ // Unset message always returns default values.
+ val = upb_FieldDef_Default(field);
+ } else {
+ val = upb_Message_Get(self->ptr.msg, field);
+ }
+ return PyUpb_UpbToPy(val, field, self->arena);
+}
+
+/*
+ * PyUpb_CMessage_GetFieldValue()
+ *
+ * Implements the equivalent of getattr(msg, field), once `field` has
+ * already been resolved to a `upb_FieldDef*`.
+ *
+ * This may involve constructing a wrapper object for the given field, or
+ * returning one that was previously constructed. If the field is not actually
+ * set, the wrapper object will be an "unset" object that is not actually
+ * connected to any C data.
+ */
+PyObject* PyUpb_CMessage_GetFieldValue(PyObject* _self,
+ const upb_FieldDef* field) {
+ PyUpb_CMessage* self = (void*)_self;
+ assert(upb_FieldDef_ContainingType(field) == PyUpb_CMessage_GetMsgdef(_self));
+ bool submsg = upb_FieldDef_IsSubMessage(field);
+ bool seq = upb_FieldDef_IsRepeated(field);
+
+ if ((PyUpb_CMessage_IsStub(self) && (submsg || seq)) ||
+ (submsg && !seq && !upb_Message_Has(self->ptr.msg, field))) {
+ return PyUpb_CMessage_GetStub(self, field);
+ } else if (seq) {
+ return PyUpb_CMessage_GetPresentWrapper(self, field);
+ } else {
+ return PyUpb_CMessage_GetScalarValue(self, field);
+ }
+}
+
+int PyUpb_CMessage_SetFieldValue(PyObject* _self, const upb_FieldDef* field,
+ PyObject* value, PyObject* exc) {
+ PyUpb_CMessage* self = (void*)_self;
+ assert(value);
+
+ if (upb_FieldDef_IsSubMessage(field) || upb_FieldDef_IsRepeated(field)) {
+ PyErr_Format(exc,
+ "Assignment not allowed to message, map, or repeated "
+ "field \"%s\" in protocol message object.",
+ upb_FieldDef_Name(field));
+ return -1;
+ }
+
+ PyUpb_CMessage_EnsureReified(self);
+
+ upb_MessageValue val;
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ if (!PyUpb_PyToUpb(value, field, &val, arena)) {
+ return -1;
+ }
+
+ upb_Message_Set(self->ptr.msg, field, val, arena);
+ return 0;
+}
+
+int PyUpb_CMessage_GetVersion(PyObject* _self) {
+ PyUpb_CMessage* self = (void*)_self;
+ return self->version;
+}
+
+/*
+ * PyUpb_CMessage_GetAttr()
+ *
+ * Implements:
+ * foo = msg.foo
+ *
+ * Attribute lookup must find both message fields and base class methods like
+ * msg.SerializeToString().
+ */
+__attribute__((flatten)) static PyObject* PyUpb_CMessage_GetAttr(
+ PyObject* _self, PyObject* attr) {
+ PyUpb_CMessage* self = (void*)_self;
+
+ // Lookup field by name.
+ const upb_FieldDef* field;
+ if (PyUpb_CMessage_LookupName(self, attr, &field, NULL, NULL)) {
+ return PyUpb_CMessage_GetFieldValue(_self, field);
+ }
+
+ // Check base class attributes.
+ assert(!PyErr_Occurred());
+ PyObject* ret = PyObject_GenericGetAttr(_self, attr);
+ if (ret) return ret;
+
+ // Swallow AttributeError if it occurred and try again on the metaclass
+ // to pick up class attributes. But we have to special-case "Extensions"
+ // which affirmatively returns AttributeError when a message is not
+ // extendable.
+ const char* name;
+ if (PyErr_ExceptionMatches(PyExc_AttributeError) &&
+ (name = PyUpb_GetStrData(attr)) && strcmp(name, "Extensions") != 0) {
+ PyErr_Clear();
+ return PyUpb_MessageMeta_GetAttr((PyObject*)Py_TYPE(_self), attr);
+ }
+
+ return NULL;
+}
+
+/*
+ * PyUpb_CMessage_SetAttr()
+ *
+ * Implements:
+ * msg.foo = foo
+ */
+static int PyUpb_CMessage_SetAttr(PyObject* _self, PyObject* attr,
+ PyObject* value) {
+ PyUpb_CMessage* self = (void*)_self;
+ const upb_FieldDef* field;
+ if (!PyUpb_CMessage_LookupName(self, attr, &field, NULL,
+ PyExc_AttributeError)) {
+ return -1;
+ }
+
+ return PyUpb_CMessage_SetFieldValue(_self, field, value,
+ PyExc_AttributeError);
+}
+
+static PyObject* PyUpb_CMessage_HasField(PyObject* _self, PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+ const upb_FieldDef* field;
+ const upb_OneofDef* oneof;
+
+ if (!PyUpb_CMessage_LookupName(self, arg, &field, &oneof, PyExc_ValueError)) {
+ return NULL;
+ }
+
+ if (field && !upb_FieldDef_HasPresence(field)) {
+ PyErr_Format(PyExc_ValueError, "Field %s does not have presence.",
+ upb_FieldDef_FullName(field));
+ return NULL;
+ }
+
+ if (PyUpb_CMessage_IsStub(self)) Py_RETURN_FALSE;
+
+ return PyBool_FromLong(field ? upb_Message_Has(self->ptr.msg, field)
+ : upb_Message_WhichOneof(self->ptr.msg, oneof) !=
+ NULL);
+}
+
+static PyObject* PyUpb_CMessage_FindInitializationErrors(PyObject* _self,
+ PyObject* arg);
+
+static PyObject* PyUpb_CMessage_IsInitializedAppendErrors(PyObject* _self,
+ PyObject* errors) {
+ PyObject* list = PyUpb_CMessage_FindInitializationErrors(_self, NULL);
+ if (!list) return NULL;
+ bool ok = PyList_Size(list) == 0;
+ PyObject* ret = NULL;
+ PyObject* extend_result = NULL;
+ if (!ok) {
+ extend_result = PyObject_CallMethod(errors, "extend", "O", list);
+ if (!extend_result) goto done;
+ }
+ ret = PyBool_FromLong(ok);
+
+done:
+ Py_XDECREF(list);
+ Py_XDECREF(extend_result);
+ return ret;
+}
+
+static PyObject* PyUpb_CMessage_IsInitialized(PyObject* _self, PyObject* args) {
+ PyObject* errors = NULL;
+ if (!PyArg_ParseTuple(args, "|O", &errors)) {
+ return NULL;
+ }
+ if (errors) {
+ // We need to collect a list of unset required fields and append it to
+ // `errors`.
+ return PyUpb_CMessage_IsInitializedAppendErrors(_self, errors);
+ } else {
+ // We just need to return a boolean "true" or "false" for whether all
+ // required fields are set.
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(_self);
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self);
+ const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m));
+ bool initialized = !upb_util_HasUnsetRequired(msg, m, symtab, NULL);
+ return PyBool_FromLong(initialized);
+ }
+}
+
+static PyObject* PyUpb_CMessage_ListFieldsItemKey(PyObject* self,
+ PyObject* val) {
+ assert(PyTuple_Check(val));
+ PyObject* field = PyTuple_GetItem(val, 0);
+ const upb_FieldDef* f = PyUpb_FieldDescriptor_GetDef(field);
+ return PyLong_FromLong(upb_FieldDef_Number(f));
+}
+
+static bool PyUpb_CMessage_SortFieldList(PyObject* list) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ bool ok = false;
+ PyObject* args = PyTuple_New(0);
+ PyObject* kwargs = PyDict_New();
+ PyObject* method = PyObject_GetAttrString(list, "sort");
+ PyObject* call_result = NULL;
+ if (!args || !kwargs || !method) goto err;
+ if (PyDict_SetItemString(kwargs, "key", state->listfields_item_key) < 0) {
+ goto err;
+ }
+ call_result = PyObject_Call(method, args, kwargs);
+ if (!call_result) goto err;
+ ok = true;
+
+err:
+ Py_XDECREF(method);
+ Py_XDECREF(args);
+ Py_XDECREF(kwargs);
+ Py_XDECREF(call_result);
+ return ok;
+}
+
+static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) {
+ PyObject* list = PyList_New(0);
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(_self);
+ if (!msg) return list;
+
+ size_t iter1 = kUpb_Message_Begin;
+ const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self);
+ const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m));
+ const upb_FieldDef* f;
+ PyObject* field_desc = NULL;
+ PyObject* py_val = NULL;
+ PyObject* tuple = NULL;
+ upb_MessageValue val;
+ uint32_t last_field = 0;
+ bool in_order = true;
+ while (upb_Message_Next(msg, m, symtab, &f, &val, &iter1)) {
+ const uint32_t field_number = upb_FieldDef_Number(f);
+ if (field_number < last_field) in_order = false;
+ last_field = field_number;
+ PyObject* field_desc = PyUpb_FieldDescriptor_Get(f);
+ PyObject* py_val = PyUpb_CMessage_GetFieldValue(_self, f);
+ if (!field_desc || !py_val) goto err;
+ PyObject* tuple = Py_BuildValue("(NN)", field_desc, py_val);
+ field_desc = NULL;
+ py_val = NULL;
+ if (!tuple) goto err;
+ if (PyList_Append(list, tuple)) goto err;
+ Py_DECREF(tuple);
+ tuple = NULL;
+ }
+
+ // Users rely on fields being returned in field number order.
+ if (!in_order && !PyUpb_CMessage_SortFieldList(list)) goto err;
+
+ return list;
+
+err:
+ Py_XDECREF(field_desc);
+ Py_XDECREF(py_val);
+ Py_XDECREF(tuple);
+ Py_DECREF(list);
+ return NULL;
+}
+
+PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg) {
+ if (self->ob_type != arg->ob_type) {
+ PyErr_Format(PyExc_TypeError,
+ "Parameter to MergeFrom() must be instance of same class: "
+ "expected %S got %S.",
+ Py_TYPE(self), Py_TYPE(arg));
+ return NULL;
+ }
+ // OPT: exit if src is empty.
+ PyObject* subargs = PyTuple_New(0);
+ PyObject* serialized = PyUpb_CMessage_SerializeToString(arg, subargs, NULL);
+ Py_DECREF(subargs);
+ if (!serialized) return NULL;
+ PyObject* ret = PyUpb_CMessage_MergeFromString(self, serialized);
+ Py_DECREF(serialized);
+ Py_DECREF(ret);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_CMessage_SetInParent(PyObject* _self, PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+ PyUpb_CMessage_EnsureReified(self);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_CMessage_UnknownFields(PyObject* _self, PyObject* arg) {
+ // TODO(haberman): re-enable when unknown fields are added.
+ // return PyUpb_UnknownFields_New(_self);
+ PyErr_SetString(PyExc_NotImplementedError, "unknown field accessor");
+ return NULL;
+}
+
+PyObject* PyUpb_CMessage_MergeFromString(PyObject* _self, PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+ char* buf;
+ Py_ssize_t size;
+ PyObject* bytes = NULL;
+
+ if (PyMemoryView_Check(arg)) {
+ bytes = PyBytes_FromObject(arg);
+ // Cannot fail when passed something of the correct type.
+ int err = PyBytes_AsStringAndSize(bytes, &buf, &size);
+ (void)err;
+ assert(err >= 0);
+ } else if (PyBytes_AsStringAndSize(arg, &buf, &size) < 0) {
+ return NULL;
+ }
+
+ PyUpb_CMessage_EnsureReified(self);
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ const upb_FileDef* file = upb_MessageDef_File(msgdef);
+ const upb_ExtensionRegistry* extreg =
+ upb_DefPool_ExtensionRegistry(upb_FileDef_Pool(file));
+ const upb_MiniTable* layout = upb_MessageDef_MiniTable(msgdef);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ int options =
+ UPB_DECODE_MAXDEPTH(state->allow_oversize_protos ? UINT32_MAX : 100);
+ upb_DecodeStatus status =
+ upb_Decode(buf, size, self->ptr.msg, layout, extreg, options, arena);
+ Py_XDECREF(bytes);
+ if (status != kUpb_DecodeStatus_Ok) {
+ PyErr_Format(state->decode_error_class, "Error parsing message");
+ return NULL;
+ }
+ PyUpb_CMessage_SyncSubobjs(self);
+ return PyLong_FromSsize_t(size);
+}
+
+static PyObject* PyUpb_CMessage_Clear(PyUpb_CMessage* self, PyObject* args);
+
+static PyObject* PyUpb_CMessage_ParseFromString(PyObject* self, PyObject* arg) {
+ PyObject* tmp = PyUpb_CMessage_Clear((PyUpb_CMessage*)self, NULL);
+ Py_DECREF(tmp);
+ return PyUpb_CMessage_MergeFromString(self, arg);
+}
+
+static PyObject* PyUpb_CMessage_ByteSize(PyObject* self, PyObject* args) {
+ // TODO(https://github.com/protocolbuffers/upb/issues/462): At the moment upb
+ // does not have a "byte size" function, so we just serialize to string and
+ // get the size of the string.
+ PyObject* subargs = PyTuple_New(0);
+ PyObject* serialized = PyUpb_CMessage_SerializeToString(self, subargs, NULL);
+ Py_DECREF(subargs);
+ if (!serialized) return NULL;
+ size_t size = PyBytes_Size(serialized);
+ Py_DECREF(serialized);
+ return PyLong_FromSize_t(size);
+}
+
+static PyObject* PyUpb_CMessage_Clear(PyUpb_CMessage* self, PyObject* args) {
+ PyUpb_CMessage_EnsureReified(self);
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ PyUpb_WeakMap* subobj_map = self->unset_subobj_map;
+
+ if (subobj_map) {
+ upb_Message* msg = PyUpb_CMessage_GetMsg(self);
+ intptr_t iter = PYUPB_WEAKMAP_BEGIN;
+ const void* key;
+ PyObject* obj;
+
+ while (PyUpb_WeakMap_Next(subobj_map, &key, &obj, &iter)) {
+ const upb_FieldDef* f = key;
+ PyUpb_WeakMap_DeleteIter(subobj_map, &iter);
+ if (upb_FieldDef_IsMap(f)) {
+ assert(upb_Message_Get(msg, f).map_val == NULL);
+ PyUpb_MapContainer_Reify(obj, NULL);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ assert(upb_Message_Get(msg, f).array_val == NULL);
+ PyUpb_RepeatedContainer_Reify(obj, NULL);
+ } else {
+ assert(!upb_Message_Has(msg, f));
+ PyUpb_CMessage* sub = (void*)obj;
+ assert(self == sub->ptr.parent);
+ PyUpb_CMessage_Reify(sub, f, NULL);
+ }
+ }
+ }
+
+ upb_Message_Clear(self->ptr.msg, msgdef);
+ Py_RETURN_NONE;
+}
+
+void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f) {
+ PyUpb_CMessage* self = (void*)_self;
+ PyUpb_CMessage_EnsureReified((PyUpb_CMessage*)self);
+
+ // We must ensure that any stub object is reified so its parent no longer
+ // points to us.
+ PyObject* sub = self->unset_subobj_map
+ ? PyUpb_WeakMap_Get(self->unset_subobj_map, f)
+ : NULL;
+
+ if (upb_FieldDef_IsMap(f)) {
+ // For maps we additionally have to invalidate any iterators. So we need
+ // to get an object even if it's reified.
+ if (!sub) {
+ sub = PyUpb_CMessage_GetFieldValue(_self, f);
+ }
+ PyUpb_MapContainer_EnsureReified(sub);
+ PyUpb_MapContainer_Invalidate(sub);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ if (sub) {
+ PyUpb_RepeatedContainer_EnsureReified(sub);
+ }
+ } else if (upb_FieldDef_IsSubMessage(f)) {
+ if (sub) {
+ PyUpb_CMessage_EnsureReified((PyUpb_CMessage*)sub);
+ }
+ }
+
+ Py_XDECREF(sub);
+ upb_Message_ClearField(self->ptr.msg, f);
+}
+
+static PyObject* PyUpb_CMessage_ClearExtension(PyObject* _self, PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+ PyUpb_CMessage_EnsureReified(self);
+ const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(_self, arg);
+ if (!f) return NULL;
+ PyUpb_CMessage_DoClearField(_self, f);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_CMessage_ClearField(PyObject* _self, PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+
+ // We always need EnsureReified() here (even for an unset message) to
+ // preserve behavior like:
+ // msg = FooMessage()
+ // msg.foo.Clear()
+ // assert msg.HasField("foo")
+ PyUpb_CMessage_EnsureReified(self);
+
+ const upb_FieldDef* f;
+ const upb_OneofDef* o;
+ if (!PyUpb_CMessage_LookupName(self, arg, &f, &o, PyExc_ValueError)) {
+ return NULL;
+ }
+
+ if (o) f = upb_Message_WhichOneof(self->ptr.msg, o);
+ PyUpb_CMessage_DoClearField(_self, f);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_CMessage_DiscardUnknownFields(PyUpb_CMessage* self,
+ PyObject* arg) {
+ PyUpb_CMessage_EnsureReified(self);
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ upb_Message_DiscardUnknown(self->ptr.msg, msgdef, 64);
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_CMessage_FindInitializationErrors(PyObject* _self,
+ PyObject* arg) {
+ PyUpb_CMessage* self = (void*)_self;
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(_self);
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ const upb_DefPool* ext_pool = upb_FileDef_Pool(upb_MessageDef_File(msgdef));
+ upb_FieldPathEntry* fields;
+ PyObject* ret = PyList_New(0);
+ if (upb_util_HasUnsetRequired(msg, msgdef, ext_pool, &fields)) {
+ char* buf = NULL;
+ size_t size = 0;
+ assert(fields->field);
+ while (fields->field) {
+ upb_FieldPathEntry* field = fields;
+ size_t need = upb_FieldPath_ToText(&fields, buf, size);
+ if (need >= size) {
+ fields = field;
+ size = size ? size * 2 : 16;
+ while (size <= need) size *= 2;
+ buf = realloc(buf, size);
+ need = upb_FieldPath_ToText(&fields, buf, size);
+ assert(size > need);
+ }
+ PyObject* str = PyUnicode_FromString(buf);
+ PyList_Append(ret, str);
+ Py_DECREF(str);
+ }
+ free(buf);
+ }
+ return ret;
+}
+
+static PyObject* PyUpb_CMessage_FromString(PyObject* cls,
+ PyObject* serialized) {
+ PyObject* ret = NULL;
+ PyObject* length = NULL;
+
+ ret = PyObject_CallObject(cls, NULL);
+ if (ret == NULL) goto err;
+ length = PyUpb_CMessage_MergeFromString(ret, serialized);
+ if (length == NULL) goto err;
+
+done:
+ Py_XDECREF(length);
+ return ret;
+
+err:
+ Py_XDECREF(ret);
+ ret = NULL;
+ goto done;
+}
+
+const upb_FieldDef* PyUpb_CMessage_GetExtensionDef(PyObject* _self,
+ PyObject* key) {
+ const upb_FieldDef* f = PyUpb_FieldDescriptor_GetDef(key);
+ if (!f) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_KeyError, "Object %R is not a field descriptor\n", key);
+ return NULL;
+ }
+ if (!upb_FieldDef_IsExtension(f)) {
+ PyErr_Format(PyExc_KeyError, "Field %s is not an extension\n",
+ upb_FieldDef_FullName(f));
+ return NULL;
+ }
+ const upb_MessageDef* msgdef = PyUpb_CMessage_GetMsgdef(_self);
+ if (upb_FieldDef_ContainingType(f) != msgdef) {
+ PyErr_Format(PyExc_KeyError, "Extension doesn't match (%s vs %s)",
+ upb_MessageDef_FullName(msgdef), upb_FieldDef_FullName(f));
+ return NULL;
+ }
+ return f;
+}
+
+static PyObject* PyUpb_CMessage_HasExtension(PyObject* _self,
+ PyObject* ext_desc) {
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(_self);
+ const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(_self, ext_desc);
+ if (!f) return NULL;
+ if (upb_FieldDef_IsRepeated(f)) {
+ PyErr_SetString(PyExc_KeyError,
+ "Field is repeated. A singular method is required.");
+ return NULL;
+ }
+ if (!msg) Py_RETURN_FALSE;
+ return PyBool_FromLong(upb_Message_Has(msg, f));
+}
+
+void PyUpb_CMessage_ReportInitializationErrors(const upb_MessageDef* msgdef,
+ PyObject* errors,
+ PyObject* exc) {
+ PyObject* comma = PyUnicode_FromString(",");
+ PyObject* missing_fields = NULL;
+ if (!comma) goto done;
+ missing_fields = PyUnicode_Join(comma, errors);
+ if (!missing_fields) goto done;
+ PyErr_Format(exc, "Message %s is missing required fields: %U",
+ upb_MessageDef_FullName(msgdef), missing_fields);
+done:
+ Py_XDECREF(comma);
+ Py_XDECREF(missing_fields);
+ Py_DECREF(errors);
+}
+
+PyObject* PyUpb_CMessage_SerializeInternal(PyObject* _self, PyObject* args,
+ PyObject* kwargs,
+ bool check_required) {
+ PyUpb_CMessage* self = (void*)_self;
+ if (!PyUpb_CMessage_Verify((PyObject*)self)) return NULL;
+ static const char* kwlist[] = {"deterministic", NULL};
+ int deterministic = 0;
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|p", (char**)(kwlist),
+ &deterministic)) {
+ return NULL;
+ }
+
+ const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self);
+ if (PyUpb_CMessage_IsStub(self)) {
+ // Nothing to serialize, but we do have to check whether the message is
+ // initialized.
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyObject* errors = PyUpb_CMessage_FindInitializationErrors(_self, NULL);
+ if (!errors) return NULL;
+ if (PyList_Size(errors) == 0) {
+ Py_DECREF(errors);
+ return PyBytes_FromStringAndSize(NULL, 0);
+ }
+ PyUpb_CMessage_ReportInitializationErrors(msgdef, errors,
+ state->encode_error_class);
+ return NULL;
+ }
+
+ upb_Arena* arena = upb_Arena_New();
+ const upb_MiniTable* layout = upb_MessageDef_MiniTable(msgdef);
+ size_t size = 0;
+ // Python does not currently have any effective limit on serialization depth.
+ int options = UPB_ENCODE_MAXDEPTH(UINT32_MAX);
+ if (check_required) options |= kUpb_Encode_CheckRequired;
+ if (deterministic) options |= kUpb_Encode_Deterministic;
+ char* pb = upb_Encode(self->ptr.msg, layout, options, arena, &size);
+ PyObject* ret = NULL;
+
+ if (!pb) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyObject* errors = PyUpb_CMessage_FindInitializationErrors(_self, NULL);
+ if (PyList_Size(errors) != 0) {
+ PyUpb_CMessage_ReportInitializationErrors(msgdef, errors,
+ state->encode_error_class);
+ } else {
+ PyErr_Format(state->encode_error_class, "Failed to serialize proto");
+ }
+ goto done;
+ }
+
+ ret = PyBytes_FromStringAndSize(pb, size);
+
+done:
+ upb_Arena_Free(arena);
+ return ret;
+}
+
+PyObject* PyUpb_CMessage_SerializeToString(PyObject* _self, PyObject* args,
+ PyObject* kwargs) {
+ return PyUpb_CMessage_SerializeInternal(_self, args, kwargs, true);
+}
+
+PyObject* PyUpb_CMessage_SerializePartialToString(PyObject* _self,
+ PyObject* args,
+ PyObject* kwargs) {
+ return PyUpb_CMessage_SerializeInternal(_self, args, kwargs, false);
+}
+
+static PyObject* PyUpb_CMessage_WhichOneof(PyObject* _self, PyObject* name) {
+ PyUpb_CMessage* self = (void*)_self;
+ const upb_OneofDef* o;
+ if (!PyUpb_CMessage_LookupName(self, name, NULL, &o, PyExc_ValueError)) {
+ return NULL;
+ }
+ upb_Message* msg = PyUpb_CMessage_GetIfReified(_self);
+ if (!msg) Py_RETURN_NONE;
+ const upb_FieldDef* f = upb_Message_WhichOneof(msg, o);
+ if (!f) Py_RETURN_NONE;
+ return PyUnicode_FromString(upb_FieldDef_Name(f));
+}
+
+void PyUpb_CMessage_ClearExtensionDict(PyObject* _self) {
+ PyUpb_CMessage* self = (void*)_self;
+ assert(self->ext_dict);
+ self->ext_dict = NULL;
+}
+
+static PyObject* PyUpb_CMessage_GetExtensionDict(PyObject* _self,
+ void* closure) {
+ PyUpb_CMessage* self = (void*)_self;
+ if (self->ext_dict) {
+ Py_INCREF(self->ext_dict);
+ return self->ext_dict;
+ }
+
+ const upb_MessageDef* m = _PyUpb_CMessage_GetMsgdef(self);
+ if (upb_MessageDef_ExtensionRangeCount(m) == 0) {
+ PyErr_SetNone(PyExc_AttributeError);
+ return NULL;
+ }
+
+ self->ext_dict = PyUpb_ExtensionDict_New(_self);
+ return self->ext_dict;
+}
+
+static PyGetSetDef PyUpb_CMessage_Getters[] = {
+ {"Extensions", PyUpb_CMessage_GetExtensionDict, NULL, "Extension dict"},
+ {NULL}};
+
+static PyMethodDef PyUpb_CMessage_Methods[] = {
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ //{ "__deepcopy__", (PyCFunction)DeepCopy, METH_VARARGS,
+ // "Makes a deep copy of the class." },
+ //{ "__unicode__", (PyCFunction)ToUnicode, METH_NOARGS,
+ // "Outputs a unicode representation of the message." },
+ {"ByteSize", (PyCFunction)PyUpb_CMessage_ByteSize, METH_NOARGS,
+ "Returns the size of the message in bytes."},
+ {"Clear", (PyCFunction)PyUpb_CMessage_Clear, METH_NOARGS,
+ "Clears the message."},
+ {"ClearExtension", PyUpb_CMessage_ClearExtension, METH_O,
+ "Clears a message field."},
+ {"ClearField", PyUpb_CMessage_ClearField, METH_O,
+ "Clears a message field."},
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ //{ "CopyFrom", (PyCFunction)CopyFrom, METH_O,
+ // "Copies a protocol message into the current message." },
+ {"DiscardUnknownFields", (PyCFunction)PyUpb_CMessage_DiscardUnknownFields,
+ METH_NOARGS, "Discards the unknown fields."},
+ {"FindInitializationErrors", PyUpb_CMessage_FindInitializationErrors,
+ METH_NOARGS, "Finds unset required fields."},
+ {"FromString", PyUpb_CMessage_FromString, METH_O | METH_CLASS,
+ "Creates new method instance from given serialized data."},
+ {"HasExtension", PyUpb_CMessage_HasExtension, METH_O,
+ "Checks if a message field is set."},
+ {"HasField", PyUpb_CMessage_HasField, METH_O,
+ "Checks if a message field is set."},
+ {"IsInitialized", PyUpb_CMessage_IsInitialized, METH_VARARGS,
+ "Checks if all required fields of a protocol message are set."},
+ {"ListFields", PyUpb_CMessage_ListFields, METH_NOARGS,
+ "Lists all set fields of a message."},
+ {"MergeFrom", PyUpb_CMessage_MergeFrom, METH_O,
+ "Merges a protocol message into the current message."},
+ {"MergeFromString", PyUpb_CMessage_MergeFromString, METH_O,
+ "Merges a serialized message into the current message."},
+ {"ParseFromString", PyUpb_CMessage_ParseFromString, METH_O,
+ "Parses a serialized message into the current message."},
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ //{ "RegisterExtension", (PyCFunction)RegisterExtension, METH_O |
+ // METH_CLASS,
+ // "Registers an extension with the current message." },
+ {"SerializePartialToString",
+ (PyCFunction)PyUpb_CMessage_SerializePartialToString,
+ METH_VARARGS | METH_KEYWORDS,
+ "Serializes the message to a string, even if it isn't initialized."},
+ {"SerializeToString", (PyCFunction)PyUpb_CMessage_SerializeToString,
+ METH_VARARGS | METH_KEYWORDS,
+ "Serializes the message to a string, only for initialized messages."},
+ {"SetInParent", (PyCFunction)PyUpb_CMessage_SetInParent, METH_NOARGS,
+ "Sets the has bit of the given field in its parent message."},
+ {"UnknownFields", (PyCFunction)PyUpb_CMessage_UnknownFields, METH_NOARGS,
+ "Parse unknown field set"},
+ {"WhichOneof", PyUpb_CMessage_WhichOneof, METH_O,
+ "Returns the name of the field set inside a oneof, "
+ "or None if no field is set."},
+ {"_ListFieldsItemKey", PyUpb_CMessage_ListFieldsItemKey,
+ METH_O | METH_STATIC,
+ "Compares ListFields() list entries by field number"},
+ {NULL, NULL}};
+
+static PyType_Slot PyUpb_CMessage_Slots[] = {
+ {Py_tp_dealloc, PyUpb_CMessage_Dealloc},
+ {Py_tp_doc, "A ProtocolMessage"},
+ {Py_tp_getattro, PyUpb_CMessage_GetAttr},
+ {Py_tp_getset, PyUpb_CMessage_Getters},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {Py_tp_methods, PyUpb_CMessage_Methods},
+ {Py_tp_new, PyUpb_CMessage_New},
+ {Py_tp_str, PyUpb_CMessage_ToString},
+ {Py_tp_repr, PyUpb_CMessage_ToString},
+ {Py_tp_richcompare, PyUpb_CMessage_RichCompare},
+ {Py_tp_setattro, PyUpb_CMessage_SetAttr},
+ {Py_tp_init, PyUpb_CMessage_Init},
+ {0, NULL}};
+
+PyType_Spec PyUpb_CMessage_Spec = {
+ PYUPB_MODULE_NAME ".CMessage", // tp_name
+ sizeof(PyUpb_CMessage), // tp_basicsize
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags
+ PyUpb_CMessage_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// MessageMeta
+// -----------------------------------------------------------------------------
+
+// MessageMeta is the metaclass for message objects. The generated code uses it
+// to construct message classes, ie.
+//
+// FooMessage = _message.MessageMeta('FooMessage', (_message.Message), {...})
+//
+// (This is not quite true: at the moment the Python library subclasses
+// MessageMeta, and uses that subclass as the metaclass. There is a TODO below
+// to simplify this, so that the illustration above is indeed accurate).
+
+typedef struct {
+ const upb_MiniTable* layout;
+ PyObject* py_message_descriptor;
+} PyUpb_MessageMeta;
+
+// The PyUpb_MessageMeta struct is trailing data tacked onto the end of
+// MessageMeta instances. This means that we get our instances of this struct
+// by adding the appropriate number of bytes.
+static PyUpb_MessageMeta* PyUpb_GetMessageMeta(PyObject* cls) {
+#ifndef NDEBUG
+ PyUpb_ModuleState* state = PyUpb_ModuleState_MaybeGet();
+ assert(!state || cls->ob_type == state->message_meta_type);
+#endif
+ return (PyUpb_MessageMeta*)((char*)cls + cpython_bits.type_basicsize);
+}
+
+static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls) {
+ PyUpb_MessageMeta* self = PyUpb_GetMessageMeta(cls);
+ return PyUpb_Descriptor_GetDef(self->py_message_descriptor);
+}
+
+PyObject* PyUpb_MessageMeta_DoCreateClass(PyObject* py_descriptor,
+ const char* name, PyObject* dict) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyTypeObject* descriptor_type = state->descriptor_types[kPyUpb_Descriptor];
+ if (!PyObject_TypeCheck(py_descriptor, descriptor_type)) {
+ return PyErr_Format(PyExc_TypeError, "Expected a message Descriptor");
+ }
+
+ const upb_MessageDef* msgdef = PyUpb_Descriptor_GetDef(py_descriptor);
+ assert(msgdef);
+ assert(!PyUpb_ObjCache_Get(upb_MessageDef_MiniTable(msgdef)));
+
+ PyObject* slots = PyTuple_New(0);
+ if (!slots) return NULL;
+ int status = PyDict_SetItemString(dict, "__slots__", slots);
+ Py_DECREF(slots);
+ if (status < 0) return NULL;
+
+ // Bases are either:
+ // (CMessage, Message) # for regular messages
+ // (CMessage, Message, WktBase) # For well-known types
+ PyObject* wkt_bases = PyUpb_GetWktBases(state);
+ PyObject* wkt_base =
+ PyDict_GetItemString(wkt_bases, upb_MessageDef_FullName(msgdef));
+ PyObject* args;
+ if (wkt_base == NULL) {
+ args = Py_BuildValue("s(OO)O", name, state->cmessage_type,
+ state->message_class, dict);
+ } else {
+ args = Py_BuildValue("s(OOO)O", name, state->cmessage_type,
+ state->message_class, wkt_base, dict);
+ }
+
+ PyObject* ret = cpython_bits.type_new(state->message_meta_type, args, NULL);
+ Py_DECREF(args);
+ if (!ret) return NULL;
+
+ PyUpb_MessageMeta* meta = PyUpb_GetMessageMeta(ret);
+ meta->py_message_descriptor = py_descriptor;
+ meta->layout = upb_MessageDef_MiniTable(msgdef);
+ Py_INCREF(meta->py_message_descriptor);
+
+ PyUpb_ObjCache_Add(meta->layout, ret);
+
+ return ret;
+}
+
+static PyObject* PyUpb_MessageMeta_New(PyTypeObject* type, PyObject* args,
+ PyObject* kwargs) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ static const char* kwlist[] = {"name", "bases", "dict", 0};
+ PyObject *bases, *dict;
+ const char* name;
+
+ // Check arguments: (name, bases, dict)
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO!O!:type", (char**)kwlist,
+ &name, &PyTuple_Type, &bases, &PyDict_Type,
+ &dict)) {
+ return NULL;
+ }
+
+ // Check bases: only (), or (message.Message,) are allowed
+ Py_ssize_t size = PyTuple_Size(bases);
+ if (!(size == 0 ||
+ (size == 1 && PyTuple_GetItem(bases, 0) == state->message_class))) {
+ PyErr_Format(PyExc_TypeError,
+ "A Message class can only inherit from Message, not %S",
+ bases);
+ return NULL;
+ }
+
+ // Check dict['DESCRIPTOR']
+ PyObject* py_descriptor = PyDict_GetItemString(dict, "DESCRIPTOR");
+ if (py_descriptor == NULL) {
+ PyErr_SetString(PyExc_TypeError, "Message class has no DESCRIPTOR");
+ return NULL;
+ }
+
+ const upb_MessageDef* m = PyUpb_Descriptor_GetDef(py_descriptor);
+ PyObject* ret = PyUpb_ObjCache_Get(upb_MessageDef_MiniTable(m));
+ if (ret) return ret;
+ return PyUpb_MessageMeta_DoCreateClass(py_descriptor, name, dict);
+}
+
+static void PyUpb_MessageMeta_Dealloc(PyObject* self) {
+ PyUpb_MessageMeta* meta = PyUpb_GetMessageMeta(self);
+ PyUpb_ObjCache_Delete(meta->layout);
+ Py_DECREF(meta->py_message_descriptor);
+ PyTypeObject* tp = Py_TYPE(self);
+ cpython_bits.type_dealloc(self);
+ Py_DECREF(tp);
+}
+
+void PyUpb_MessageMeta_AddFieldNumber(PyObject* self, const upb_FieldDef* f) {
+ PyObject* name =
+ PyUnicode_FromFormat("%s_FIELD_NUMBER", upb_FieldDef_Name(f));
+ PyObject* upper = PyObject_CallMethod(name, "upper", "");
+ PyObject_SetAttr(self, upper, PyLong_FromLong(upb_FieldDef_Number(f)));
+ Py_DECREF(name);
+ Py_DECREF(upper);
+}
+
+static PyObject* PyUpb_MessageMeta_GetDynamicAttr(PyObject* self,
+ PyObject* name) {
+ const char* name_buf = PyUpb_GetStrData(name);
+ if (!name_buf) return NULL;
+ const upb_MessageDef* msgdef = PyUpb_MessageMeta_GetMsgdef(self);
+ const upb_FileDef* filedef = upb_MessageDef_File(msgdef);
+ const upb_DefPool* symtab = upb_FileDef_Pool(filedef);
+
+ PyObject* py_key =
+ PyBytes_FromFormat("%s.%s", upb_MessageDef_FullName(msgdef), name_buf);
+ const char* key = PyUpb_GetStrData(py_key);
+ PyObject* ret = NULL;
+ const upb_MessageDef* nested = upb_DefPool_FindMessageByName(symtab, key);
+ const upb_EnumDef* enumdef;
+ const upb_EnumValueDef* enumval;
+ const upb_FieldDef* ext;
+
+ if (nested) {
+ ret = PyUpb_Descriptor_GetClass(nested);
+ } else if ((enumdef = upb_DefPool_FindEnumByName(symtab, key))) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyObject* klass = state->enum_type_wrapper_class;
+ ret = PyUpb_EnumDescriptor_Get(enumdef);
+ ret = PyObject_CallFunctionObjArgs(klass, ret, NULL);
+ } else if ((enumval = upb_DefPool_FindEnumByNameval(symtab, key))) {
+ ret = PyLong_FromLong(upb_EnumValueDef_Number(enumval));
+ } else if ((ext = upb_DefPool_FindExtensionByName(symtab, key))) {
+ ret = PyUpb_FieldDescriptor_Get(ext);
+ }
+
+ Py_DECREF(py_key);
+
+ const char* suffix = "_FIELD_NUMBER";
+ size_t n = strlen(name_buf);
+ size_t suffix_n = strlen(suffix);
+ if (n > suffix_n && memcmp(suffix, name_buf + n - suffix_n, suffix_n) == 0) {
+ // We can't look up field names dynamically, because the <NAME>_FIELD_NUMBER
+ // naming scheme upper-cases the field name and is therefore non-reversible.
+ // So we just add all field numbers.
+ int n = upb_MessageDef_FieldCount(msgdef);
+ for (int i = 0; i < n; i++) {
+ PyUpb_MessageMeta_AddFieldNumber(self, upb_MessageDef_Field(msgdef, i));
+ }
+ n = upb_MessageDef_NestedExtensionCount(msgdef);
+ for (int i = 0; i < n; i++) {
+ PyUpb_MessageMeta_AddFieldNumber(
+ self, upb_MessageDef_NestedExtension(msgdef, i));
+ }
+ ret = PyObject_GenericGetAttr(self, name);
+ }
+
+ return ret;
+}
+
+static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name) {
+ // We want to first delegate to the type's tp_dict to retrieve any attributes
+ // that were previously calculated and cached in the type's dict.
+ PyObject* ret = cpython_bits.type_getattro(self, name);
+ if (ret) return ret;
+
+ // We did not find a cached attribute. Try to calculate the attribute
+ // dynamically, using the descriptor as an argument.
+ PyErr_Clear();
+ ret = PyUpb_MessageMeta_GetDynamicAttr(self, name);
+
+ if (ret) {
+ PyObject_SetAttr(self, name, ret);
+ PyErr_Clear();
+ return ret;
+ }
+
+ PyErr_SetObject(PyExc_AttributeError, name);
+ return NULL;
+}
+
+static PyType_Slot PyUpb_MessageMeta_Slots[] = {
+ {Py_tp_new, PyUpb_MessageMeta_New},
+ {Py_tp_dealloc, PyUpb_MessageMeta_Dealloc},
+ {Py_tp_getattro, PyUpb_MessageMeta_GetAttr},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_MessageMeta_Spec = {
+ PYUPB_MODULE_NAME ".MessageMeta", // tp_name
+ 0, // To be filled in by size of base // tp_basicsize
+ 0, // tp_itemsize
+ // TODO(haberman): remove BASETYPE, Python should just use MessageMeta
+ // directly instead of subclassing it.
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags
+ PyUpb_MessageMeta_Slots,
+};
+
+static PyObject* PyUpb_MessageMeta_CreateType(void) {
+ PyObject* bases = Py_BuildValue("(O)", &PyType_Type);
+ if (!bases) return NULL;
+ PyUpb_MessageMeta_Spec.basicsize =
+ cpython_bits.type_basicsize + sizeof(PyUpb_MessageMeta);
+ PyObject* type = PyType_FromSpecWithBases(&PyUpb_MessageMeta_Spec, bases);
+ Py_DECREF(bases);
+ return type;
+}
+
+bool PyUpb_InitMessage(PyObject* m) {
+ if (!PyUpb_CPythonBits_Init(&cpython_bits)) return false;
+ PyObject* message_meta_type = PyUpb_MessageMeta_CreateType();
+
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+ state->cmessage_type = PyUpb_AddClass(m, &PyUpb_CMessage_Spec);
+ state->message_meta_type = (PyTypeObject*)message_meta_type;
+
+ if (!state->cmessage_type || !state->message_meta_type) return false;
+ if (PyModule_AddObject(m, "MessageMeta", message_meta_type)) return false;
+ state->listfields_item_key = PyObject_GetAttrString(
+ (PyObject*)state->cmessage_type, "_ListFieldsItemKey");
+
+ PyObject* mod =
+ PyImport_ImportModule(PYUPB_PROTOBUF_PUBLIC_PACKAGE ".message");
+ if (mod == NULL) return false;
+
+ state->encode_error_class = PyObject_GetAttrString(mod, "EncodeError");
+ state->decode_error_class = PyObject_GetAttrString(mod, "DecodeError");
+ state->message_class = PyObject_GetAttrString(mod, "Message");
+ Py_DECREF(mod);
+
+ PyObject* enum_type_wrapper = PyImport_ImportModule(
+ PYUPB_PROTOBUF_INTERNAL_PACKAGE ".enum_type_wrapper");
+ if (enum_type_wrapper == NULL) return false;
+
+ state->enum_type_wrapper_class =
+ PyObject_GetAttrString(enum_type_wrapper, "EnumTypeWrapper");
+ Py_DECREF(enum_type_wrapper);
+
+ if (!state->encode_error_class || !state->decode_error_class ||
+ !state->message_class || !state->listfields_item_key ||
+ !state->enum_type_wrapper_class) {
+ return false;
+ }
+
+ return true;
+}
diff --git a/grpc/third_party/upb/python/message.h b/grpc/third_party/upb/python/message.h
new file mode 100644
index 00000000..46155ac8
--- /dev/null
+++ b/grpc/third_party/upb/python/message.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYPB_MESSAGE_H__
+#define PYPB_MESSAGE_H__
+
+#include <stdbool.h>
+
+#include "python/protobuf.h"
+#include "upb/reflection.h"
+
+// Removes the wrapper object for this field from the unset subobject cache.
+void PyUpb_CMessage_CacheDelete(PyObject* _self, const upb_FieldDef* f);
+
+// Sets the field value for `f` to `subobj`, evicting the wrapper object from
+// the "unset subobject" cache now that real data exists for it. The caller
+// must also update the wrapper associated with `f` to point to `subobj` also.
+void PyUpb_CMessage_SetConcreteSubobj(PyObject* _self, const upb_FieldDef* f,
+ upb_MessageValue subobj);
+
+// Gets a Python wrapper object for message `u_msg` of type `m`, returning a
+// cached wrapper if one was previously created. If a new object is created,
+// it will reference `arena`, which must own `u_msg`.
+PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m,
+ PyObject* arena);
+
+// Verifies that a Python object is a message. Sets a TypeError exception and
+// returns false on failure.
+bool PyUpb_CMessage_Verify(PyObject* self);
+
+// Gets the upb_Message* for this message object if the message is reified.
+// Otherwise returns NULL.
+upb_Message* PyUpb_CMessage_GetIfReified(PyObject* _self);
+
+// Returns the `upb_MessageDef` for a given CMessage.
+const upb_MessageDef* PyUpb_CMessage_GetMsgdef(PyObject* self);
+
+// Functions that match the corresponding methods on the message object.
+PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg);
+PyObject* PyUpb_CMessage_MergeFromString(PyObject* self, PyObject* arg);
+PyObject* PyUpb_CMessage_SerializeToString(PyObject* self, PyObject* args,
+ PyObject* kwargs);
+
+// Sets fields of the message according to the attribuges in `kwargs`.
+int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args,
+ PyObject* kwargs);
+
+// Checks that `key` is a field descriptor for an extension type, and that the
+// extendee is this message. Otherwise returns NULL and sets a KeyError.
+const upb_FieldDef* PyUpb_CMessage_GetExtensionDef(PyObject* _self,
+ PyObject* key);
+
+// Clears the given field in this message.
+void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f);
+
+// Clears the ExtensionDict from the message. The message must have an
+// ExtensionDict set.
+void PyUpb_CMessage_ClearExtensionDict(PyObject* _self);
+
+// Implements the equivalent of getattr(msg, field), once `field` has
+// already been resolved to a `upb_FieldDef*`.
+PyObject* PyUpb_CMessage_GetFieldValue(PyObject* _self,
+ const upb_FieldDef* field);
+
+// Implements the equivalent of setattr(msg, field, value), once `field` has
+// already been resolved to a `upb_FieldDef*`.
+int PyUpb_CMessage_SetFieldValue(PyObject* _self, const upb_FieldDef* field,
+ PyObject* value, PyObject* exc);
+
+// Returns the version associated with this message. The version will be
+// incremented when the message changes.
+int PyUpb_CMessage_GetVersion(PyObject* _self);
+
+// Module-level init.
+bool PyUpb_InitMessage(PyObject* m);
+
+#endif // PYPB_MESSAGE_H__
diff --git a/grpc/third_party/upb/python/minimal_test.py b/grpc/third_party/upb/python/minimal_test.py
new file mode 100644
index 00000000..6924ace6
--- /dev/null
+++ b/grpc/third_party/upb/python/minimal_test.py
@@ -0,0 +1,183 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+"""A bare-bones unit test that doesn't load any generated code."""
+
+
+import unittest
+from google.protobuf.pyext import _message
+from google.protobuf.internal import api_implementation
+from google.protobuf import unittest_pb2
+from google.protobuf import map_unittest_pb2
+from google.protobuf import descriptor_pool
+from google.protobuf import text_format
+from google.protobuf import message_factory
+from google.protobuf import message
+from google.protobuf.internal import factory_test1_pb2
+from google.protobuf.internal import factory_test2_pb2
+from google.protobuf.internal import more_extensions_pb2
+from google.protobuf import descriptor_pb2
+
+class TestMessageExtension(unittest.TestCase):
+
+ def test_descriptor_pool(self):
+ serialized_desc = b'\n\ntest.proto\"\x0e\n\x02M1*\x08\x08\x01\x10\x80\x80\x80\x80\x02:\x15\n\x08test_ext\x12\x03.M1\x18\x01 \x01(\x05'
+ pool = _message.DescriptorPool()
+ file_desc = pool.AddSerializedFile(serialized_desc)
+ self.assertEqual("test.proto", file_desc.name)
+ ext_desc = pool.FindExtensionByName("test_ext")
+ self.assertEqual(1, ext_desc.number)
+
+ # Test object cache: repeatedly retrieving the same descriptor
+ # should result in the same object
+ self.assertIs(ext_desc, pool.FindExtensionByName("test_ext"))
+
+
+ def test_lib_is_upb(self):
+ # Ensure we are not pulling in a different protobuf library on the
+ # system.
+ print(_message._IS_UPB)
+ self.assertTrue(_message._IS_UPB)
+ self.assertEqual(api_implementation.Type(), "cpp")
+
+ def test_repeated_field_slice_delete(self):
+ def test_slice(start, end, step):
+ vals = list(range(20))
+ message = unittest_pb2.TestAllTypes(repeated_int32=vals)
+ del vals[start:end:step]
+ del message.repeated_int32[start:end:step]
+ self.assertEqual(vals, list(message.repeated_int32))
+ test_slice(3, 11, 1)
+ test_slice(3, 11, 2)
+ test_slice(3, 11, 3)
+ test_slice(11, 3, -1)
+ test_slice(11, 3, -2)
+ test_slice(11, 3, -3)
+ test_slice(10, 25, 4)
+
+ def testExtensionsErrors(self):
+ msg = unittest_pb2.TestAllTypes()
+ self.assertRaises(AttributeError, getattr, msg, 'Extensions')
+
+ def testClearStubMapField(self):
+ msg = map_unittest_pb2.TestMapSubmessage()
+ int32_map = msg.test_map.map_int32_int32
+ msg.test_map.ClearField("map_int32_int32")
+ int32_map[123] = 456
+ self.assertEqual(0, msg.test_map.ByteSize())
+
+ def testClearReifiedMapField(self):
+ msg = map_unittest_pb2.TestMap()
+ int32_map = msg.map_int32_int32
+ int32_map[123] = 456
+ msg.ClearField("map_int32_int32")
+ int32_map[111] = 222
+ self.assertEqual(0, msg.ByteSize())
+
+ def testClearStubRepeatedField(self):
+ msg = unittest_pb2.NestedTestAllTypes()
+ int32_array = msg.payload.repeated_int32
+ msg.payload.ClearField("repeated_int32")
+ int32_array.append(123)
+ self.assertEqual(0, msg.payload.ByteSize())
+
+ def testClearReifiedRepeatdField(self):
+ msg = unittest_pb2.TestAllTypes()
+ int32_array = msg.repeated_int32
+ int32_array.append(123)
+ self.assertNotEqual(0, msg.ByteSize())
+ msg.ClearField("repeated_int32")
+ int32_array.append(123)
+ self.assertEqual(0, msg.ByteSize())
+
+ def testFloatPrinting(self):
+ message = unittest_pb2.TestAllTypes()
+ message.optional_float = -0.0
+ self.assertEqual(str(message), 'optional_float: -0\n')
+
+class OversizeProtosTest(unittest.TestCase):
+ def setUp(self):
+ msg = unittest_pb2.NestedTestAllTypes()
+ m = msg
+ for i in range(101):
+ m = m.child
+ m.Clear()
+ self.p_serialized = msg.SerializeToString()
+
+ def testAssertOversizeProto(self):
+ from google.protobuf.pyext._message import SetAllowOversizeProtos
+ SetAllowOversizeProtos(False)
+ q = unittest_pb2.NestedTestAllTypes()
+ with self.assertRaises(message.DecodeError):
+ q.ParseFromString(self.p_serialized)
+ print(q)
+
+ def testSucceedOversizeProto(self):
+ from google.protobuf.pyext._message import SetAllowOversizeProtos
+ SetAllowOversizeProtos(True)
+ q = unittest_pb2.NestedTestAllTypes()
+ q.ParseFromString(self.p_serialized)
+
+ def testExtensionIter(self):
+ extendee_proto = more_extensions_pb2.ExtendedMessage()
+
+ extension_int32 = more_extensions_pb2.optional_int_extension
+ extendee_proto.Extensions[extension_int32] = 23
+
+ extension_repeated = more_extensions_pb2.repeated_int_extension
+ extendee_proto.Extensions[extension_repeated].append(11)
+
+ extension_msg = more_extensions_pb2.optional_message_extension
+ extendee_proto.Extensions[extension_msg].foreign_message_int = 56
+
+ # Set some normal fields.
+ extendee_proto.optional_int32 = 1
+ extendee_proto.repeated_string.append('hi')
+
+ expected = {
+ extension_int32: True,
+ extension_msg: True,
+ extension_repeated: True
+ }
+ count = 0
+ for item in extendee_proto.Extensions:
+ del expected[item]
+ self.assertIn(item, extendee_proto.Extensions)
+ count += 1
+ self.assertEqual(count, 3)
+ self.assertEqual(len(expected), 0)
+
+ def testIsInitializedStub(self):
+ proto = unittest_pb2.TestRequiredForeign()
+ self.assertTrue(proto.IsInitialized())
+ self.assertFalse(proto.optional_message.IsInitialized())
+ errors = []
+ self.assertFalse(proto.optional_message.IsInitialized(errors))
+ self.assertEqual(['a', 'b', 'c'], errors)
+ self.assertRaises(message.EncodeError, proto.optional_message.SerializeToString)
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/BUILD b/grpc/third_party/upb/python/pb_unit_tests/BUILD
new file mode 100644
index 00000000..1a788fe4
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/BUILD
@@ -0,0 +1,64 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+load("//bazel:pyproto_test_wrapper.bzl", "pyproto_test_wrapper")
+
+licenses(["notice"])
+
+pyproto_test_wrapper(name = "descriptor_database_test")
+
+pyproto_test_wrapper(name = "descriptor_pool_test")
+
+pyproto_test_wrapper(name = "descriptor_test")
+
+# begin:github_only
+pyproto_test_wrapper(name = "generator_test")
+# end:github_only
+
+pyproto_test_wrapper(name = "json_format_test")
+
+pyproto_test_wrapper(name = "keywords_test")
+
+pyproto_test_wrapper(name = "message_factory_test")
+
+pyproto_test_wrapper(name = "message_test")
+
+pyproto_test_wrapper(name = "proto_builder_test")
+
+pyproto_test_wrapper(name = "reflection_test")
+
+pyproto_test_wrapper(name = "service_reflection_test")
+
+pyproto_test_wrapper(name = "symbol_database_test")
+
+pyproto_test_wrapper(name = "text_encoding_test")
+
+pyproto_test_wrapper(name = "text_format_test")
+
+pyproto_test_wrapper(name = "unknown_fields_test")
+
+pyproto_test_wrapper(name = "well_known_types_test")
+
+pyproto_test_wrapper(name = "wire_format_test")
diff --git a/grpc/third_party/upb/python/pb_unit_tests/README.md b/grpc/third_party/upb/python/pb_unit_tests/README.md
new file mode 100644
index 00000000..669f0674
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/README.md
@@ -0,0 +1,11 @@
+
+# Protobuf Unit Tests
+
+This directory contains wrappers around the Python unit tests defined in
+the protobuf repo. Python+upb is intended to be a drop-in replacement for
+protobuf Python, so we should be able to pass the same set of unit tests.
+
+Our wrappers contain exclusion lists for tests we know we are not currently
+passing. Ideally these exclusion lists will become empty once Python+upb is
+fully implemented. However there may be a few edge cases that we decide
+are not worth matching with perfect parity.
diff --git a/grpc/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py
new file mode 100644
index 00000000..125533ea
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import descriptor_database_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=descriptor_database_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py
new file mode 100644
index 00000000..69b573c6
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py
@@ -0,0 +1,48 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import descriptor_pool_test
+import unittest
+import copy
+
+# begin:google_only
+# from google3.testing.pybase import googletest
+# end:google_only
+
+# This is testing that certain methods unconditionally throw TypeError.
+# In the new extension we simply don't define them at all.
+descriptor_pool_test.AddDescriptorTest.testAddTypeError.__unittest_expecting_failure__ = True
+
+descriptor_pool_test.SecondaryDescriptorFromDescriptorDB.testErrorCollector.__unittest_expecting_failure__ = True
+
+# begin:github_only
+if __name__ == '__main__':
+ unittest.main(module=descriptor_pool_test, verbosity=2)
+# end:github_only
+
+# begin:google_only
+# if __name__ == '__main__':
+# googletest.main()
+# end:google_only
diff --git a/grpc/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py
new file mode 100644
index 00000000..0dcaa767
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py
@@ -0,0 +1,46 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import descriptor_test
+import unittest
+
+# Our behavior here matches pure-Python, which does not allow
+# foo.enum_values_by_name.get([]). We reject it because we return a true
+# dict (like pure Python), which does not allow hashing by a list.
+descriptor_test.GeneratedDescriptorTest.testDescriptor.__unittest_expecting_failure__ = True
+
+# These fail because they attempt to add fields with conflicting JSON names.
+# We don't want to support this going forward.
+descriptor_test.MakeDescriptorTest.testCamelcaseName.__unittest_expecting_failure__ = True
+descriptor_test.MakeDescriptorTest.testJsonName.__unittest_expecting_failure__ = True
+
+# We pass this test, but the error message is slightly different.
+# Our error message is better.
+descriptor_test.NewDescriptorTest.testImmutableCppDescriptor.__unittest_expecting_failure__ = True
+
+descriptor_test.DescriptorTest.testGetDebugString.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=descriptor_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py
new file mode 100644
index 00000000..c0fb964f
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import generator_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=generator_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py
new file mode 100644
index 00000000..5e9e69db
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import json_format_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=json_format_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py
new file mode 100644
index 00000000..1863b882
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import keywords_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=keywords_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py
new file mode 100644
index 00000000..ad000a5c
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py
@@ -0,0 +1,37 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import message_factory_test
+import unittest
+
+message_factory_test.MessageFactoryTest.testCreatePrototypeOverride.__unittest_expecting_failure__ = True
+message_factory_test.MessageFactoryTest.testDuplicateExtensionNumber.__unittest_expecting_failure__ = True
+message_factory_test.MessageFactoryTest.testGetMessages.__unittest_expecting_failure__ = True
+message_factory_test.MessageFactoryTest.testGetPrototype.__unittest_expecting_failure__ = True
+if hasattr(message_factory_test.MessageFactoryTest, 'testExtensionValueInDifferentFile'):
+ message_factory_test.MessageFactoryTest.testExtensionValueInDifferentFile.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=message_factory_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/message_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/message_test_wrapper.py
new file mode 100644
index 00000000..e7a37498
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/message_test_wrapper.py
@@ -0,0 +1,57 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import message_test
+import unittest
+
+# We don't want to support extending repeated fields with nothing; this behavior
+# is marked for deprecation in the existing library.
+message_test.MessageTest.testExtendFloatWithNothing_proto2.__unittest_expecting_failure__ = True
+message_test.MessageTest.testExtendFloatWithNothing_proto3.__unittest_expecting_failure__ = True
+message_test.MessageTest.testExtendInt32WithNothing_proto2.__unittest_expecting_failure__ = True
+message_test.MessageTest.testExtendInt32WithNothing_proto3.__unittest_expecting_failure__ = True
+message_test.MessageTest.testExtendStringWithNothing_proto2.__unittest_expecting_failure__ = True
+message_test.MessageTest.testExtendStringWithNothing_proto3.__unittest_expecting_failure__ = True
+
+# Python/C++ customizes the C++ TextFormat to always print trailing ".0" for
+# floats. upb doesn't do this, it matches C++ TextFormat.
+message_test.MessageTest.testFloatPrinting_proto2.__unittest_expecting_failure__ = True
+message_test.MessageTest.testFloatPrinting_proto3.__unittest_expecting_failure__ = True
+
+# For these tests we are throwing the correct error, only the text of the error
+# message is a mismatch. For technical reasons around the limited API, matching
+# the existing error message exactly is not feasible.
+message_test.Proto3Test.testCopyFromBadType.__unittest_expecting_failure__ = True
+message_test.Proto3Test.testMergeFromBadType.__unittest_expecting_failure__ = True
+
+message_test.MessageTest.testPickleRepeatedScalarContainer_proto2.__unittest_expecting_failure__ = True
+message_test.MessageTest.testPickleRepeatedScalarContainer_proto3.__unittest_expecting_failure__ = True
+message_test.Proto2Test.testPythonicInit.__unittest_expecting_failure__ = True
+message_test.Proto2Test.test_documentation.__unittest_expecting_failure__ = True
+message_test.Proto3Test.testModifyMapEntryWhileIterating.__unittest_expecting_failure__ = True
+message_test.Proto3Test.testProto3Optional.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=message_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py
new file mode 100644
index 00000000..d189f495
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import proto_builder_test
+import unittest
+
+proto_builder_test.ProtoBuilderTest.testMakeLargeProtoClass.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=proto_builder_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py
new file mode 100644
index 00000000..35cc8ec2
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py
@@ -0,0 +1,47 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import reflection_test
+import unittest
+
+# These tests depend on a specific iteration order for extensions, which is not
+# reasonable to guarantee.
+reflection_test.Proto2ReflectionTest.testExtensionIter.__unittest_expecting_failure__ = True
+
+# These tests depend on a specific serialization order for extensions, which is
+# not reasonable to guarantee.
+reflection_test.SerializationTest.testCanonicalSerializationOrder.__unittest_expecting_failure__ = True
+reflection_test.SerializationTest.testCanonicalSerializationOrderSameAsCpp.__unittest_expecting_failure__ = True
+
+# This test relies on the internal implementation using Python descriptors.
+# This is an implementation detail that users should not depend on.
+reflection_test.SerializationTest.testFieldDataDescriptor.__unittest_expecting_failure__ = True
+
+reflection_test.ReflectionTest.testDeepCopy_proto2.__unittest_expecting_failure__ = True
+reflection_test.ReflectionTest.testDeepCopy_proto3.__unittest_expecting_failure__ = True
+reflection_test.SerializationTest.testFieldProperties.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=reflection_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py
new file mode 100644
index 00000000..089779a3
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import service_reflection_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=service_reflection_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py
new file mode 100644
index 00000000..3a5bfb16
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import symbol_database_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=symbol_database_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py
new file mode 100644
index 00000000..3c567bcb
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import text_encoding_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=text_encoding_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py
new file mode 100644
index 00000000..e108e098
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py
@@ -0,0 +1,40 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import text_format_test
+import unittest
+
+# These rely on the UnknownFields accessor, which we are trying to deprecate.
+text_format_test.OnlyWorksWithProto2RightNowTests.testPrintUnknownFields.__unittest_expecting_failure__ = True
+
+# begin:github_only
+from google.protobuf.internal import _parameterized # copybara:strip_for_google3
+sep = _parameterized._SEPARATOR
+getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "0").__unittest_expecting_failure__ = True
+getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "1").__unittest_expecting_failure__ = True
+# end:github_only
+
+if __name__ == '__main__':
+ unittest.main(module=text_format_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py
new file mode 100644
index 00000000..9c352e12
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py
@@ -0,0 +1,40 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import unknown_fields_test
+import unittest
+
+unknown_fields_test.UnknownEnumValuesTest.testCheckUnknownFieldValueForEnum.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testCheckUnknownFieldValue.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testClear.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testMergeFrom.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testSubUnknownFields.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownExtensions.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownField.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownFieldsNoMemoryLeak.__unittest_expecting_failure__ = True
+unknown_fields_test.UnknownFieldsTest.testSerializeMessageSetWireFormatUnknownExtension.__unittest_expecting_failure__ = True
+
+if __name__ == '__main__':
+ unittest.main(module=unknown_fields_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py
new file mode 100644
index 00000000..6ded8d45
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import well_known_types_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=well_known_types_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py b/grpc/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py
new file mode 100644
index 00000000..c2f6c0ac
--- /dev/null
+++ b/grpc/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.protobuf.internal import wire_format_test
+import unittest
+
+if __name__ == '__main__':
+ unittest.main(module=wire_format_test, verbosity=2)
diff --git a/grpc/third_party/upb/python/protobuf.c b/grpc/third_party/upb/python/protobuf.c
new file mode 100644
index 00000000..ae6b6d5c
--- /dev/null
+++ b/grpc/third_party/upb/python/protobuf.c
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/protobuf.h"
+
+#include "python/descriptor.h"
+#include "python/descriptor_containers.h"
+#include "python/descriptor_pool.h"
+#include "python/extension_dict.h"
+#include "python/map.h"
+#include "python/message.h"
+#include "python/repeated.h"
+
+static void PyUpb_ModuleDealloc(void* module) {
+ PyUpb_ModuleState* s = PyModule_GetState(module);
+ PyUpb_WeakMap_Free(s->obj_cache);
+ if (s->c_descriptor_symtab) {
+ upb_DefPool_Free(s->c_descriptor_symtab);
+ }
+}
+
+PyObject* PyUpb_SetAllowOversizeProtos(PyObject* m, PyObject* arg) {
+ if (!arg || !PyBool_Check(arg)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Argument to SetAllowOversizeProtos must be boolean");
+ return NULL;
+ }
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ state->allow_oversize_protos = PyObject_IsTrue(arg);
+ Py_INCREF(arg);
+ return arg;
+}
+
+static PyMethodDef PyUpb_ModuleMethods[] = {
+ {"SetAllowOversizeProtos", PyUpb_SetAllowOversizeProtos, METH_O,
+ "Enable/disable oversize proto parsing."},
+ {NULL, NULL}};
+
+static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT,
+ PYUPB_MODULE_NAME,
+ "Protobuf Module",
+ sizeof(PyUpb_ModuleState),
+ PyUpb_ModuleMethods, // m_methods
+ NULL, // m_slots
+ NULL, // m_traverse
+ NULL, // m_clear
+ PyUpb_ModuleDealloc};
+
+// -----------------------------------------------------------------------------
+// ModuleState
+// -----------------------------------------------------------------------------
+
+PyUpb_ModuleState* PyUpb_ModuleState_MaybeGet(void) {
+ PyObject* module = PyState_FindModule(&module_def);
+ return module ? PyModule_GetState(module) : NULL;
+}
+
+PyUpb_ModuleState* PyUpb_ModuleState_GetFromModule(PyObject* module) {
+ PyUpb_ModuleState* state = PyModule_GetState(module);
+ assert(state);
+ assert(PyModule_GetDef(module) == &module_def);
+ return state;
+}
+
+PyUpb_ModuleState* PyUpb_ModuleState_Get(void) {
+ PyObject* module = PyState_FindModule(&module_def);
+ assert(module);
+ return PyUpb_ModuleState_GetFromModule(module);
+}
+
+PyObject* PyUpb_GetWktBases(PyUpb_ModuleState* state) {
+ if (!state->wkt_bases) {
+ PyObject* wkt_module = PyImport_ImportModule(PYUPB_PROTOBUF_INTERNAL_PACKAGE
+ ".well_known_types");
+
+ if (wkt_module == NULL) {
+ return false;
+ }
+
+ state->wkt_bases = PyObject_GetAttrString(wkt_module, "WKTBASES");
+ PyObject* m = PyState_FindModule(&module_def);
+ // Reparent ownership to m.
+ PyModule_AddObject(m, "__internal_wktbases", state->wkt_bases);
+ Py_DECREF(wkt_module);
+ }
+
+ return state->wkt_bases;
+}
+
+// -----------------------------------------------------------------------------
+// WeakMap
+// -----------------------------------------------------------------------------
+
+struct PyUpb_WeakMap {
+ upb_inttable table;
+ upb_Arena* arena;
+};
+
+PyUpb_WeakMap* PyUpb_WeakMap_New(void) {
+ upb_Arena* arena = upb_Arena_New();
+ PyUpb_WeakMap* map = upb_Arena_Malloc(arena, sizeof(*map));
+ map->arena = arena;
+ upb_inttable_init(&map->table, map->arena);
+ return map;
+}
+
+void PyUpb_WeakMap_Free(PyUpb_WeakMap* map) { upb_Arena_Free(map->arena); }
+
+uintptr_t PyUpb_WeakMap_GetKey(const void* key) {
+ uintptr_t n = (uintptr_t)key;
+ assert((n & 7) == 0);
+ return n >> 3;
+}
+
+void PyUpb_WeakMap_Add(PyUpb_WeakMap* map, const void* key, PyObject* py_obj) {
+ upb_inttable_insert(&map->table, PyUpb_WeakMap_GetKey(key),
+ upb_value_ptr(py_obj), map->arena);
+}
+
+void PyUpb_WeakMap_Delete(PyUpb_WeakMap* map, const void* key) {
+ upb_value val;
+ bool removed =
+ upb_inttable_remove(&map->table, PyUpb_WeakMap_GetKey(key), &val);
+ (void)removed;
+ assert(removed);
+}
+
+void PyUpb_WeakMap_TryDelete(PyUpb_WeakMap* map, const void* key) {
+ upb_inttable_remove(&map->table, PyUpb_WeakMap_GetKey(key), NULL);
+}
+
+PyObject* PyUpb_WeakMap_Get(PyUpb_WeakMap* map, const void* key) {
+ upb_value val;
+ if (upb_inttable_lookup(&map->table, PyUpb_WeakMap_GetKey(key), &val)) {
+ PyObject* ret = upb_value_getptr(val);
+ Py_INCREF(ret);
+ return ret;
+ } else {
+ return NULL;
+ }
+}
+
+bool PyUpb_WeakMap_Next(PyUpb_WeakMap* map, const void** key, PyObject** obj,
+ intptr_t* iter) {
+ uintptr_t u_key;
+ upb_value val;
+ if (!upb_inttable_next2(&map->table, &u_key, &val, iter)) return false;
+ *key = (void*)(u_key << 3);
+ *obj = upb_value_getptr(val);
+ return true;
+}
+
+void PyUpb_WeakMap_DeleteIter(PyUpb_WeakMap* map, intptr_t* iter) {
+ upb_inttable_removeiter(&map->table, iter);
+}
+
+// -----------------------------------------------------------------------------
+// ObjCache
+// -----------------------------------------------------------------------------
+
+PyUpb_WeakMap* PyUpb_ObjCache_Instance(void) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ return state->obj_cache;
+}
+
+void PyUpb_ObjCache_Add(const void* key, PyObject* py_obj) {
+ PyUpb_WeakMap_Add(PyUpb_ObjCache_Instance(), key, py_obj);
+}
+
+void PyUpb_ObjCache_Delete(const void* key) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_MaybeGet();
+ if (!state) {
+ // During the shutdown sequence, our object's Dealloc() methods can be
+ // called *after* our module Dealloc() method has been called. At that
+ // point our state will be NULL and there is nothing to delete out of the
+ // map.
+ return;
+ }
+ PyUpb_WeakMap_Delete(state->obj_cache, key);
+}
+
+PyObject* PyUpb_ObjCache_Get(const void* key) {
+ return PyUpb_WeakMap_Get(PyUpb_ObjCache_Instance(), key);
+}
+
+// -----------------------------------------------------------------------------
+// Arena
+// -----------------------------------------------------------------------------
+
+typedef struct {
+ PyObject_HEAD;
+ upb_Arena* arena;
+} PyUpb_Arena;
+
+PyObject* PyUpb_Arena_New(void) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ PyUpb_Arena* arena = (void*)PyType_GenericAlloc(state->arena_type, 0);
+ arena->arena = upb_Arena_New();
+ return &arena->ob_base;
+}
+
+static void PyUpb_Arena_Dealloc(PyObject* self) {
+ upb_Arena_Free(PyUpb_Arena_Get(self));
+ PyUpb_Dealloc(self);
+}
+
+upb_Arena* PyUpb_Arena_Get(PyObject* arena) {
+ return ((PyUpb_Arena*)arena)->arena;
+}
+
+static PyType_Slot PyUpb_Arena_Slots[] = {
+ {Py_tp_dealloc, PyUpb_Arena_Dealloc},
+ {0, NULL},
+};
+
+static PyType_Spec PyUpb_Arena_Spec = {
+ PYUPB_MODULE_NAME ".Arena",
+ sizeof(PyUpb_Arena),
+ 0, // itemsize
+ Py_TPFLAGS_DEFAULT,
+ PyUpb_Arena_Slots,
+};
+
+static bool PyUpb_InitArena(PyObject* m) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+ state->arena_type = PyUpb_AddClass(m, &PyUpb_Arena_Spec);
+ return state->arena_type;
+}
+
+// -----------------------------------------------------------------------------
+// Utilities
+// -----------------------------------------------------------------------------
+
+PyTypeObject* AddObject(PyObject* m, const char* name, PyType_Spec* spec) {
+ PyObject* type = PyType_FromSpec(spec);
+ return type && PyModule_AddObject(m, name, type) == 0 ? (PyTypeObject*)type
+ : NULL;
+}
+
+static const char* PyUpb_GetClassName(PyType_Spec* spec) {
+ // spec->name contains a fully-qualified name, like:
+ // google.protobuf.pyext._message.FooBar
+ //
+ // Find the rightmost '.' to get "FooBar".
+ const char* name = strrchr(spec->name, '.');
+ assert(name);
+ return name + 1;
+}
+
+PyTypeObject* PyUpb_AddClass(PyObject* m, PyType_Spec* spec) {
+ PyObject* type = PyType_FromSpec(spec);
+ const char* name = PyUpb_GetClassName(spec);
+ if (PyModule_AddObject(m, name, type) < 0) {
+ Py_XDECREF(type);
+ return NULL;
+ }
+ return (PyTypeObject*)type;
+}
+
+PyTypeObject* PyUpb_AddClassWithBases(PyObject* m, PyType_Spec* spec,
+ PyObject* bases) {
+ PyObject* type = PyType_FromSpecWithBases(spec, bases);
+ const char* name = PyUpb_GetClassName(spec);
+ if (PyModule_AddObject(m, name, type) < 0) {
+ Py_XDECREF(type);
+ return NULL;
+ }
+ return (PyTypeObject*)type;
+}
+
+const char* PyUpb_GetStrData(PyObject* obj) {
+ if (PyUnicode_Check(obj)) {
+ return PyUnicode_AsUTF8AndSize(obj, NULL);
+ } else if (PyBytes_Check(obj)) {
+ return PyBytes_AsString(obj);
+ } else {
+ return NULL;
+ }
+}
+
+const char* PyUpb_VerifyStrData(PyObject* obj) {
+ const char* ret = PyUpb_GetStrData(obj);
+ if (ret) return ret;
+ PyErr_Format(PyExc_TypeError, "Expected string: %S", obj);
+ return NULL;
+}
+
+PyObject* PyUpb_Forbidden_New(PyObject* cls, PyObject* args, PyObject* kwds) {
+ PyObject* name = PyObject_GetAttrString(cls, "__name__");
+ PyErr_Format(PyExc_RuntimeError,
+ "Objects of type %U may not be created directly.", name);
+ Py_XDECREF(name);
+ return NULL;
+}
+
+// -----------------------------------------------------------------------------
+// Module Entry Point
+// -----------------------------------------------------------------------------
+
+PyMODINIT_FUNC PyInit__message(void) {
+ PyObject* m = PyModule_Create(&module_def);
+ if (!m) return NULL;
+
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+
+ state->allow_oversize_protos = false;
+ state->wkt_bases = NULL;
+ state->obj_cache = PyUpb_WeakMap_New();
+ state->c_descriptor_symtab = NULL;
+
+ if (!PyUpb_InitDescriptorContainers(m) || !PyUpb_InitDescriptorPool(m) ||
+ !PyUpb_InitDescriptor(m) || !PyUpb_InitArena(m) ||
+ !PyUpb_InitExtensionDict(m) || !PyUpb_Map_Init(m) ||
+ !PyUpb_InitMessage(m) || !PyUpb_Repeated_Init(m)) {
+ Py_DECREF(m);
+ return NULL;
+ }
+
+ // Temporary: an cookie we can use in the tests to ensure we are testing upb
+ // and not another protobuf library on the system.
+ PyModule_AddIntConstant(m, "_IS_UPB", 1);
+
+ return m;
+}
diff --git a/grpc/third_party/upb/python/protobuf.h b/grpc/third_party/upb/python/protobuf.h
new file mode 100644
index 00000000..0b876468
--- /dev/null
+++ b/grpc/third_party/upb/python/protobuf.h
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_PROTOBUF_H__
+#define PYUPB_PROTOBUF_H__
+
+#include <stdbool.h>
+
+#include "python/descriptor.h"
+#include "python/python.h"
+#include "upb/table_internal.h"
+
+
+// begin:github_only
+#define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf"
+#define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google.protobuf.internal"
+#define PYUPB_DESCRIPTOR_PROTO_PACKAGE "google.protobuf"
+#define PYUPB_DESCRIPTOR_MODULE "google.protobuf.descriptor_pb2"
+#define PYUPB_MODULE_NAME "google.protobuf.pyext._message"
+// end:github_only
+
+// begin:google_only
+// #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google3.net.proto2.python.public"
+// #define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google3.net.proto2.python.internal"
+// #define PYUPB_DESCRIPTOR_PROTO_PACKAGE "proto2"
+// #define PYUPB_DESCRIPTOR_MODULE "google3.net.proto2.proto.descriptor_pb2"
+// #define PYUPB_MODULE_NAME "google3.third_party.upb.python._message"
+// end:google_only
+
+#define PYUPB_RETURN_OOM return PyErr_SetNone(PyExc_MemoryError), NULL
+
+struct PyUpb_WeakMap;
+typedef struct PyUpb_WeakMap PyUpb_WeakMap;
+
+// -----------------------------------------------------------------------------
+// ModuleState
+// -----------------------------------------------------------------------------
+
+// We store all "global" state in this struct instead of using (C) global
+// variables. This makes this extension compatible with sub-interpreters.
+
+typedef struct {
+ // From descriptor.c
+ PyTypeObject* descriptor_types[kPyUpb_Descriptor_Count];
+
+ // From descriptor_containers.c
+ PyTypeObject* by_name_map_type;
+ PyTypeObject* by_number_map_type;
+ PyTypeObject* descriptor_iterator_type;
+ PyTypeObject* generic_sequence_type;
+
+ // From descriptor_pool.c
+ PyObject* default_pool;
+
+ // From descriptor_pool.c
+ PyTypeObject* descriptor_pool_type;
+ upb_DefPool* c_descriptor_symtab;
+
+ // From extension_dict.c
+ PyTypeObject* extension_dict_type;
+ PyTypeObject* extension_iterator_type;
+
+ // From map.c
+ PyTypeObject* map_iterator_type;
+ PyTypeObject* message_map_container_type;
+ PyTypeObject* scalar_map_container_type;
+
+ // From message.c
+ PyObject* decode_error_class;
+ PyObject* descriptor_string;
+ PyObject* encode_error_class;
+ PyObject* enum_type_wrapper_class;
+ PyObject* message_class;
+ PyTypeObject* cmessage_type;
+ PyTypeObject* message_meta_type;
+ PyObject* listfields_item_key;
+
+ // From protobuf.c
+ bool allow_oversize_protos;
+ PyObject* wkt_bases;
+ PyTypeObject* arena_type;
+ PyUpb_WeakMap* obj_cache;
+
+ // From repeated.c
+ PyTypeObject* repeated_composite_container_type;
+ PyTypeObject* repeated_scalar_container_type;
+} PyUpb_ModuleState;
+
+// Returns the global state object from the current interpreter. The current
+// interpreter is looked up from thread-local state.
+PyUpb_ModuleState* PyUpb_ModuleState_Get(void);
+PyUpb_ModuleState* PyUpb_ModuleState_GetFromModule(PyObject* module);
+
+// Returns NULL if module state is not yet available (during startup).
+// Any use of the module state during startup needs to be passed explicitly.
+PyUpb_ModuleState* PyUpb_ModuleState_MaybeGet(void);
+
+// Returns:
+// from google.protobuf.internal.well_known_types import WKTBASES
+//
+// This has to be imported lazily rather than at module load time, because
+// otherwise it would cause a circular import.
+PyObject* PyUpb_GetWktBases(PyUpb_ModuleState* state);
+
+// -----------------------------------------------------------------------------
+// WeakMap
+// -----------------------------------------------------------------------------
+
+// A WeakMap maps C pointers to the corresponding Python wrapper object. We
+// want a consistent Python wrapper object for each C object, both to save
+// memory and to provide object stability (ie. x is x).
+//
+// Each wrapped object should add itself to the map when it is constructed and
+// remove itself from the map when it is destroyed. The map is weak so it does
+// not take references to the cached objects.
+
+PyUpb_WeakMap* PyUpb_WeakMap_New(void);
+void PyUpb_WeakMap_Free(PyUpb_WeakMap* map);
+
+// Adds the given object to the map, indexed by the given key.
+void PyUpb_WeakMap_Add(PyUpb_WeakMap* map, const void* key, PyObject* py_obj);
+
+// Removes the given key from the cache. It must exist in the cache currently.
+void PyUpb_WeakMap_Delete(PyUpb_WeakMap* map, const void* key);
+void PyUpb_WeakMap_TryDelete(PyUpb_WeakMap* map, const void* key);
+
+// Returns a new reference to an object if it exists, otherwise returns NULL.
+PyObject* PyUpb_WeakMap_Get(PyUpb_WeakMap* map, const void* key);
+
+#define PYUPB_WEAKMAP_BEGIN UPB_INTTABLE_BEGIN
+
+// Iteration over the weak map, eg.
+//
+// intptr_t it = PYUPB_WEAKMAP_BEGIN;
+// while (PyUpb_WeakMap_Next(map, &key, &obj, &it)) {
+// // ...
+// }
+//
+// Note that the callee does not own a ref on the returned `obj`.
+bool PyUpb_WeakMap_Next(PyUpb_WeakMap* map, const void** key, PyObject** obj,
+ intptr_t* iter);
+void PyUpb_WeakMap_DeleteIter(PyUpb_WeakMap* map, intptr_t* iter);
+
+// -----------------------------------------------------------------------------
+// ObjCache
+// -----------------------------------------------------------------------------
+
+// The object cache is a global WeakMap for mapping upb objects to the
+// corresponding wrapper.
+void PyUpb_ObjCache_Add(const void* key, PyObject* py_obj);
+void PyUpb_ObjCache_Delete(const void* key);
+PyObject* PyUpb_ObjCache_Get(const void* key); // returns NULL if not present.
+PyUpb_WeakMap* PyUpb_ObjCache_Instance(void);
+
+// -----------------------------------------------------------------------------
+// Arena
+// -----------------------------------------------------------------------------
+
+PyObject* PyUpb_Arena_New(void);
+upb_Arena* PyUpb_Arena_Get(PyObject* arena);
+
+// -----------------------------------------------------------------------------
+// Utilities
+// -----------------------------------------------------------------------------
+
+PyTypeObject* AddObject(PyObject* m, const char* name, PyType_Spec* spec);
+
+// Creates a Python type from `spec` and adds it to the given module `m`.
+PyTypeObject* PyUpb_AddClass(PyObject* m, PyType_Spec* spec);
+
+// Like PyUpb_AddClass(), but allows you to specify a tuple of base classes
+// in `bases`.
+PyTypeObject* PyUpb_AddClassWithBases(PyObject* m, PyType_Spec* spec,
+ PyObject* bases);
+
+// A function that implements the tp_new slot for types that we do not allow
+// users to create directly. This will immediately fail with an error message.
+PyObject* PyUpb_Forbidden_New(PyObject* cls, PyObject* args, PyObject* kwds);
+
+// Our standard dealloc func. It follows the guidance defined in:
+// https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_dealloc
+// However it tests Py_TPFLAGS_HEAPTYPE dynamically so that a single dealloc
+// function can work for any type.
+static inline void PyUpb_Dealloc(void* self) {
+ PyTypeObject* tp = Py_TYPE(self);
+ assert(PyType_GetFlags(tp) & Py_TPFLAGS_HEAPTYPE);
+ freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
+ tp_free(self);
+ Py_DECREF(tp);
+}
+
+// Equivalent to the Py_NewRef() function introduced in Python 3.10. If/when we
+// drop support for Python <3.10, we can remove this function and replace all
+// callers with Py_NewRef().
+static inline PyObject* PyUpb_NewRef(PyObject* obj) {
+ Py_INCREF(obj);
+ return obj;
+}
+
+const char* PyUpb_GetStrData(PyObject* obj);
+const char* PyUpb_VerifyStrData(PyObject* obj);
+
+#endif // PYUPB_PROTOBUF_H__
diff --git a/grpc/third_party/upb/python/python.h b/grpc/third_party/upb/python/python.h
new file mode 100644
index 00000000..7eef3e5f
--- /dev/null
+++ b/grpc/third_party/upb/python/python.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_PYTHON_H__
+#define PYUPB_PYTHON_H__
+
+// We restrict ourselves to the limited API, so that we will be ABI-compatible
+// with any version of Python >= 3.6.1 (3.6.1 introduce PySlice_Unpack())
+#define Py_LIMITED_API 0x03060100
+#include <Python.h>
+
+// This function was not officially added to the limited API until Python 3.10.
+// But in practice it has been stable since Python 3.1. See:
+// https://bugs.python.org/issue41784
+PyAPI_FUNC(const char*)
+ PyUnicode_AsUTF8AndSize(PyObject* unicode, Py_ssize_t* size);
+
+#endif // PYUPB_PYTHON_H__
diff --git a/grpc/third_party/upb/python/repeated.c b/grpc/third_party/upb/python/repeated.c
new file mode 100644
index 00000000..16407a50
--- /dev/null
+++ b/grpc/third_party/upb/python/repeated.c
@@ -0,0 +1,816 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "python/repeated.h"
+
+#include "python/convert.h"
+#include "python/message.h"
+#include "python/protobuf.h"
+
+static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self,
+ PyObject* value);
+static PyObject* PyUpb_RepeatedScalarContainer_Append(PyObject* _self,
+ PyObject* value);
+
+// For an expression like:
+// foo[index]
+//
+// Converts `index` to an effective i/count/step, for a repeated field
+// field of size `size`.
+static bool IndexToRange(PyObject* index, Py_ssize_t size, Py_ssize_t* i,
+ Py_ssize_t* count, Py_ssize_t* step) {
+ assert(i && count && step);
+ if (PySlice_Check(index)) {
+ Py_ssize_t start, stop;
+ if (PySlice_Unpack(index, &start, &stop, step) < 0) return false;
+ *count = PySlice_AdjustIndices(size, &start, &stop, *step);
+ *i = start;
+ } else {
+ *i = PyNumber_AsSsize_t(index, PyExc_IndexError);
+
+ if (*i == -1 && PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, "list indices must be integers");
+ return false;
+ }
+
+ if (*i < 0) *i += size;
+ *step = 0;
+ *count = 1;
+
+ if (*i < 0 || size <= *i) {
+ PyErr_Format(PyExc_IndexError, "list index out of range");
+ return false;
+ }
+ }
+ return true;
+}
+
+// Wrapper for a repeated field.
+typedef struct {
+ PyObject_HEAD;
+ PyObject* arena;
+ // The field descriptor (PyObject*).
+ // The low bit indicates whether the container is reified (see ptr below).
+ // - low bit set: repeated field is a stub (no underlying data).
+ // - low bit clear: repeated field is reified (points to upb_Array).
+ uintptr_t field;
+ union {
+ PyObject* parent; // stub: owning pointer to parent message.
+ upb_Array* arr; // reified: the data for this array.
+ } ptr;
+} PyUpb_RepeatedContainer;
+
+static bool PyUpb_RepeatedContainer_IsStub(PyUpb_RepeatedContainer* self) {
+ return self->field & 1;
+}
+
+static PyObject* PyUpb_RepeatedContainer_GetFieldDescriptor(
+ PyUpb_RepeatedContainer* self) {
+ return (PyObject*)(self->field & ~(uintptr_t)1);
+}
+
+static const upb_FieldDef* PyUpb_RepeatedContainer_GetField(
+ PyUpb_RepeatedContainer* self) {
+ return PyUpb_FieldDescriptor_GetDef(
+ PyUpb_RepeatedContainer_GetFieldDescriptor(self));
+}
+
+// If the repeated field is reified, returns it. Otherwise, returns NULL.
+// If NULL is returned, the object is empty and has no underlying data.
+static upb_Array* PyUpb_RepeatedContainer_GetIfReified(
+ PyUpb_RepeatedContainer* self) {
+ return PyUpb_RepeatedContainer_IsStub(self) ? NULL : self->ptr.arr;
+}
+
+void PyUpb_RepeatedContainer_Reify(PyObject* _self, upb_Array* arr) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ assert(PyUpb_RepeatedContainer_IsStub(self));
+ if (!arr) {
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ arr = upb_Array_New(arena, upb_FieldDef_CType(f));
+ }
+ PyUpb_ObjCache_Add(arr, &self->ob_base);
+ Py_DECREF(self->ptr.parent);
+ self->ptr.arr = arr; // Overwrites self->ptr.parent.
+ self->field &= ~(uintptr_t)1;
+ assert(!PyUpb_RepeatedContainer_IsStub(self));
+}
+
+upb_Array* PyUpb_RepeatedContainer_EnsureReified(PyObject* _self) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ if (arr) return arr; // Already writable.
+
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ arr = upb_Array_New(arena, upb_FieldDef_CType(f));
+ PyUpb_CMessage_SetConcreteSubobj(self->ptr.parent, f,
+ (upb_MessageValue){.array_val = arr});
+ PyUpb_RepeatedContainer_Reify((PyObject*)self, arr);
+ return arr;
+}
+
+static void PyUpb_RepeatedContainer_Dealloc(PyObject* _self) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ Py_DECREF(self->arena);
+ if (PyUpb_RepeatedContainer_IsStub(self)) {
+ PyUpb_CMessage_CacheDelete(self->ptr.parent,
+ PyUpb_RepeatedContainer_GetField(self));
+ Py_DECREF(self->ptr.parent);
+ } else {
+ PyUpb_ObjCache_Delete(self->ptr.arr);
+ }
+ Py_DECREF(PyUpb_RepeatedContainer_GetFieldDescriptor(self));
+ PyUpb_Dealloc(self);
+}
+
+static PyTypeObject* PyUpb_RepeatedContainer_GetClass(const upb_FieldDef* f) {
+ assert(upb_FieldDef_IsRepeated(f) && !upb_FieldDef_IsMap(f));
+ PyUpb_ModuleState* state = PyUpb_ModuleState_Get();
+ return upb_FieldDef_IsSubMessage(f) ? state->repeated_composite_container_type
+ : state->repeated_scalar_container_type;
+}
+
+static Py_ssize_t PyUpb_RepeatedContainer_Length(PyObject* self) {
+ upb_Array* arr =
+ PyUpb_RepeatedContainer_GetIfReified((PyUpb_RepeatedContainer*)self);
+ return arr ? upb_Array_Size(arr) : 0;
+}
+
+PyObject* PyUpb_RepeatedContainer_NewStub(PyObject* parent,
+ const upb_FieldDef* f,
+ PyObject* arena) {
+ // We only create stubs when the parent is reified, by convention. However
+ // this is not an invariant: the parent could become reified at any time.
+ assert(PyUpb_CMessage_GetIfReified(parent) == NULL);
+ PyTypeObject* cls = PyUpb_RepeatedContainer_GetClass(f);
+ PyUpb_RepeatedContainer* repeated = (void*)PyType_GenericAlloc(cls, 0);
+ repeated->arena = arena;
+ repeated->field = (uintptr_t)PyUpb_FieldDescriptor_Get(f) | 1;
+ repeated->ptr.parent = parent;
+ Py_INCREF(arena);
+ Py_INCREF(parent);
+ return &repeated->ob_base;
+}
+
+PyObject* PyUpb_RepeatedContainer_GetOrCreateWrapper(upb_Array* arr,
+ const upb_FieldDef* f,
+ PyObject* arena) {
+ PyObject* ret = PyUpb_ObjCache_Get(arr);
+ if (ret) return ret;
+
+ PyTypeObject* cls = PyUpb_RepeatedContainer_GetClass(f);
+ PyUpb_RepeatedContainer* repeated = (void*)PyType_GenericAlloc(cls, 0);
+ repeated->arena = arena;
+ repeated->field = (uintptr_t)PyUpb_FieldDescriptor_Get(f);
+ repeated->ptr.arr = arr;
+ ret = &repeated->ob_base;
+ Py_INCREF(arena);
+ PyUpb_ObjCache_Add(arr, ret);
+ return ret;
+}
+
+static PyObject* PyUpb_RepeatedContainer_MergeFrom(PyObject* _self,
+ PyObject* args);
+
+PyObject* PyUpb_RepeatedContainer_DeepCopy(PyObject* _self, PyObject* value) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ PyUpb_RepeatedContainer* clone =
+ (void*)PyType_GenericAlloc(Py_TYPE(_self), 0);
+ if (clone == NULL) return NULL;
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ clone->arena = PyUpb_Arena_New();
+ clone->field = (uintptr_t)PyUpb_FieldDescriptor_Get(f);
+ clone->ptr.arr =
+ upb_Array_New(PyUpb_Arena_Get(clone->arena), upb_FieldDef_CType(f));
+ PyUpb_ObjCache_Add(clone->ptr.arr, (PyObject*)clone);
+ PyObject* result = PyUpb_RepeatedContainer_MergeFrom((PyObject*)clone, _self);
+ if (!result) {
+ Py_DECREF(clone);
+ return NULL;
+ }
+ Py_DECREF(result);
+ return (PyObject*)clone;
+}
+
+PyObject* PyUpb_RepeatedContainer_Extend(PyObject* _self, PyObject* value) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ size_t start_size = upb_Array_Size(arr);
+ PyObject* it = PyObject_GetIter(value);
+ if (!it) {
+ PyErr_SetString(PyExc_TypeError, "Value must be iterable");
+ return NULL;
+ }
+
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ bool submsg = upb_FieldDef_IsSubMessage(f);
+ PyObject* e;
+
+ while ((e = PyIter_Next(it))) {
+ PyObject* ret;
+ if (submsg) {
+ ret = PyUpb_RepeatedCompositeContainer_Append(_self, e);
+ } else {
+ ret = PyUpb_RepeatedScalarContainer_Append(_self, e);
+ }
+ Py_XDECREF(ret);
+ Py_DECREF(e);
+ }
+
+ Py_DECREF(it);
+
+ if (PyErr_Occurred()) {
+ upb_Array_Resize(arr, start_size, NULL);
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Item(PyObject* _self,
+ Py_ssize_t index) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ Py_ssize_t size = arr ? upb_Array_Size(arr) : 0;
+ if (index < 0 || index >= size) {
+ PyErr_Format(PyExc_IndexError, "list index (%zd) out of range", index);
+ return NULL;
+ }
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ return PyUpb_UpbToPy(upb_Array_Get(arr, index), f, self->arena);
+}
+
+PyObject* PyUpb_RepeatedContainer_ToList(PyObject* _self) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ if (!arr) return PyList_New(0);
+
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ size_t n = upb_Array_Size(arr);
+ PyObject* list = PyList_New(n);
+ for (size_t i = 0; i < n; i++) {
+ PyObject* val = PyUpb_UpbToPy(upb_Array_Get(arr, i), f, self->arena);
+ if (!val) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ PyList_SetItem(list, i, val);
+ }
+ return list;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Repr(PyObject* _self) {
+ PyObject* list = PyUpb_RepeatedContainer_ToList(_self);
+ if (!list) return NULL;
+ assert(!PyErr_Occurred());
+ PyObject* repr = PyObject_Repr(list);
+ Py_DECREF(list);
+ return repr;
+}
+
+static PyObject* PyUpb_RepeatedContainer_RichCompare(PyObject* _self,
+ PyObject* _other,
+ int opid) {
+ if (opid != Py_EQ && opid != Py_NE) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+ PyObject* list1 = PyUpb_RepeatedContainer_ToList(_self);
+ PyObject* list2 = _other;
+ PyObject* del = NULL;
+ if (PyObject_TypeCheck(_other, _self->ob_type)) {
+ del = list2 = PyUpb_RepeatedContainer_ToList(_other);
+ }
+ PyObject* ret = PyObject_RichCompare(list1, list2, opid);
+ Py_DECREF(list1);
+ Py_XDECREF(del);
+ return ret;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Subscript(PyObject* _self,
+ PyObject* key) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ Py_ssize_t size = arr ? upb_Array_Size(arr) : 0;
+ Py_ssize_t idx, count, step;
+ if (!IndexToRange(key, size, &idx, &count, &step)) return NULL;
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ if (step == 0) {
+ return PyUpb_UpbToPy(upb_Array_Get(arr, idx), f, self->arena);
+ } else {
+ PyObject* list = PyList_New(count);
+ for (Py_ssize_t i = 0; i < count; i++, idx += step) {
+ upb_MessageValue msgval = upb_Array_Get(self->ptr.arr, idx);
+ PyObject* item = PyUpb_UpbToPy(msgval, f, self->arena);
+ if (!item) {
+ Py_DECREF(list);
+ return NULL;
+ }
+ PyList_SetItem(list, i, item);
+ }
+ return list;
+ }
+}
+
+static int PyUpb_RepeatedContainer_SetSubscript(
+ PyUpb_RepeatedContainer* self, upb_Array* arr, const upb_FieldDef* f,
+ Py_ssize_t idx, Py_ssize_t count, Py_ssize_t step, PyObject* value) {
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ if (upb_FieldDef_IsSubMessage(f)) {
+ PyErr_SetString(PyExc_TypeError, "does not support assignment");
+ return -1;
+ }
+
+ if (step == 0) {
+ // Set single value.
+ upb_MessageValue msgval;
+ if (!PyUpb_PyToUpb(value, f, &msgval, arena)) return -1;
+ upb_Array_Set(arr, idx, msgval);
+ return 0;
+ }
+
+ // Set range.
+ PyObject* seq =
+ PySequence_Fast(value, "must assign iterable to extended slice");
+ PyObject* item = NULL;
+ int ret = -1;
+ if (!seq) goto err;
+ Py_ssize_t seq_size = PySequence_Size(seq);
+ if (seq_size != count) {
+ if (step == 1) {
+ // We must shift the tail elements (either right or left).
+ size_t tail = upb_Array_Size(arr) - (idx + count);
+ upb_Array_Resize(arr, idx + seq_size + tail, arena);
+ upb_Array_Move(arr, idx + seq_size, idx + count, tail);
+ count = seq_size;
+ } else {
+ PyErr_Format(PyExc_ValueError,
+ "attempt to assign sequence of %zd to extended slice "
+ "of size %zd",
+ seq_size, count);
+ goto err;
+ }
+ }
+ for (Py_ssize_t i = 0; i < count; i++, idx += step) {
+ upb_MessageValue msgval;
+ item = PySequence_GetItem(seq, i);
+ if (!item) goto err;
+ // XXX: if this fails we can leave the list partially mutated.
+ if (!PyUpb_PyToUpb(item, f, &msgval, arena)) goto err;
+ Py_DECREF(item);
+ item = NULL;
+ upb_Array_Set(arr, idx, msgval);
+ }
+ ret = 0;
+
+err:
+ Py_XDECREF(seq);
+ Py_XDECREF(item);
+ return ret;
+}
+
+static int PyUpb_RepeatedContainer_DeleteSubscript(upb_Array* arr,
+ Py_ssize_t idx,
+ Py_ssize_t count,
+ Py_ssize_t step) {
+ // Normalize direction: deletion is order-independent.
+ Py_ssize_t start = idx;
+ if (step < 0) {
+ Py_ssize_t end = start + step * (count - 1);
+ start = end;
+ step = -step;
+ }
+
+ size_t dst = start;
+ size_t src;
+ if (step > 1) {
+ // Move elements between steps:
+ //
+ // src
+ // |
+ // |------X---X---X---X------------------------------|
+ // |
+ // dst <-------- tail -------------->
+ src = start + 1;
+ for (Py_ssize_t i = 1; i < count; i++, dst += step - 1, src += step) {
+ upb_Array_Move(arr, dst, src, step);
+ }
+ } else {
+ src = start + count;
+ }
+
+ // Move tail.
+ size_t tail = upb_Array_Size(arr) - src;
+ size_t new_size = dst + tail;
+ assert(new_size == upb_Array_Size(arr) - count);
+ upb_Array_Move(arr, dst, src, tail);
+ upb_Array_Resize(arr, new_size, NULL);
+ return 0;
+}
+
+static int PyUpb_RepeatedContainer_AssignSubscript(PyObject* _self,
+ PyObject* key,
+ PyObject* value) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ Py_ssize_t size = arr ? upb_Array_Size(arr) : 0;
+ Py_ssize_t idx, count, step;
+ if (!IndexToRange(key, size, &idx, &count, &step)) return -1;
+ if (value) {
+ return PyUpb_RepeatedContainer_SetSubscript(self, arr, f, idx, count, step,
+ value);
+ } else {
+ return PyUpb_RepeatedContainer_DeleteSubscript(arr, idx, count, step);
+ }
+}
+
+static PyObject* PyUpb_RepeatedContainer_Pop(PyObject* _self, PyObject* args) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ Py_ssize_t index = -1;
+ if (!PyArg_ParseTuple(args, "|n", &index)) return NULL;
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ size_t size = upb_Array_Size(arr);
+ if (index < 0) index += size;
+ if (index >= size) index = size - 1;
+ PyObject* ret = PyUpb_RepeatedContainer_Item(_self, index);
+ if (!ret) return NULL;
+ upb_Array_Delete(self->ptr.arr, index, 1);
+ return ret;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Remove(PyObject* _self,
+ PyObject* value) {
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ Py_ssize_t match_index = -1;
+ Py_ssize_t n = PyUpb_RepeatedContainer_Length(_self);
+ for (Py_ssize_t i = 0; i < n; ++i) {
+ PyObject* elem = PyUpb_RepeatedContainer_Item(_self, i);
+ if (!elem) return NULL;
+ int eq = PyObject_RichCompareBool(elem, value, Py_EQ);
+ Py_DECREF(elem);
+ if (eq) {
+ match_index = i;
+ break;
+ }
+ }
+ if (match_index == -1) {
+ PyErr_SetString(PyExc_ValueError, "remove(x): x not in container");
+ return NULL;
+ }
+ if (PyUpb_RepeatedContainer_DeleteSubscript(arr, match_index, 1, 1) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
+// A helper function used only for Sort().
+static bool PyUpb_RepeatedContainer_Assign(PyObject* _self, PyObject* list) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ Py_ssize_t size = PyList_Size(list);
+ bool submsg = upb_FieldDef_IsSubMessage(f);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ for (Py_ssize_t i = 0; i < size; ++i) {
+ PyObject* obj = PyList_GetItem(list, i);
+ upb_MessageValue msgval;
+ if (submsg) {
+ msgval.msg_val = PyUpb_CMessage_GetIfReified(obj);
+ assert(msgval.msg_val);
+ } else {
+ if (!PyUpb_PyToUpb(obj, f, &msgval, arena)) return false;
+ }
+ upb_Array_Set(arr, i, msgval);
+ }
+ return true;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Sort(PyObject* pself, PyObject* args,
+ PyObject* kwds) {
+ // Support the old sort_function argument for backwards
+ // compatibility.
+ if (kwds != NULL) {
+ PyObject* sort_func = PyDict_GetItemString(kwds, "sort_function");
+ if (sort_func != NULL) {
+ // Must set before deleting as sort_func is a borrowed reference
+ // and kwds might be the only thing keeping it alive.
+ if (PyDict_SetItemString(kwds, "cmp", sort_func) == -1) return NULL;
+ if (PyDict_DelItemString(kwds, "sort_function") == -1) return NULL;
+ }
+ }
+
+ PyObject* ret = NULL;
+ PyObject* full_slice = NULL;
+ PyObject* list = NULL;
+ PyObject* m = NULL;
+ PyObject* res = NULL;
+ if ((full_slice = PySlice_New(NULL, NULL, NULL)) &&
+ (list = PyUpb_RepeatedContainer_Subscript(pself, full_slice)) &&
+ (m = PyObject_GetAttrString(list, "sort")) &&
+ (res = PyObject_Call(m, args, kwds)) &&
+ PyUpb_RepeatedContainer_Assign(pself, list)) {
+ Py_INCREF(Py_None);
+ ret = Py_None;
+ }
+
+ Py_XDECREF(full_slice);
+ Py_XDECREF(list);
+ Py_XDECREF(m);
+ Py_XDECREF(res);
+ return ret;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Reverse(PyObject* _self) {
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ size_t n = upb_Array_Size(arr);
+ size_t half = n / 2; // Rounds down.
+ for (size_t i = 0; i < half; i++) {
+ size_t i2 = n - i - 1;
+ upb_MessageValue val1 = upb_Array_Get(arr, i);
+ upb_MessageValue val2 = upb_Array_Get(arr, i2);
+ upb_Array_Set(arr, i, val2);
+ upb_Array_Set(arr, i2, val1);
+ }
+ Py_RETURN_NONE;
+}
+
+static PyObject* PyUpb_RepeatedContainer_MergeFrom(PyObject* _self,
+ PyObject* args) {
+ return PyUpb_RepeatedContainer_Extend(_self, args);
+}
+
+// -----------------------------------------------------------------------------
+// RepeatedCompositeContainer
+// -----------------------------------------------------------------------------
+
+static PyObject* PyUpb_RepeatedCompositeContainer_AppendNew(PyObject* _self) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ if (!arr) return NULL;
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f);
+ upb_Message* msg = upb_Message_New(m, arena);
+ upb_MessageValue msgval = {.msg_val = msg};
+ upb_Array_Append(arr, msgval, arena);
+ return PyUpb_CMessage_Get(msg, m, self->arena);
+}
+
+PyObject* PyUpb_RepeatedCompositeContainer_Add(PyObject* _self, PyObject* args,
+ PyObject* kwargs) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ PyObject* py_msg = PyUpb_RepeatedCompositeContainer_AppendNew(_self);
+ if (!py_msg) return NULL;
+ if (PyUpb_CMessage_InitAttributes(py_msg, args, kwargs) < 0) {
+ Py_DECREF(py_msg);
+ upb_Array_Delete(self->ptr.arr, upb_Array_Size(self->ptr.arr) - 1, 1);
+ return NULL;
+ }
+ return py_msg;
+}
+
+static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self,
+ PyObject* value) {
+ if (!PyUpb_CMessage_Verify(value)) return NULL;
+ PyObject* py_msg = PyUpb_RepeatedCompositeContainer_AppendNew(_self);
+ if (!py_msg) return NULL;
+ PyObject* none = PyUpb_CMessage_MergeFrom(py_msg, value);
+ if (!none) {
+ Py_DECREF(py_msg);
+ return NULL;
+ }
+ Py_DECREF(none);
+ return py_msg;
+}
+
+static PyObject* PyUpb_RepeatedContainer_Insert(PyObject* _self,
+ PyObject* args) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ Py_ssize_t index;
+ PyObject* value;
+ if (!PyArg_ParseTuple(args, "nO", &index, &value)) return NULL;
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ if (!arr) return NULL;
+
+ // Normalize index.
+ Py_ssize_t size = upb_Array_Size(arr);
+ if (index < 0) index += size;
+ if (index < 0) index = 0;
+ if (index > size) index = size;
+
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_MessageValue msgval;
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ if (upb_FieldDef_IsSubMessage(f)) {
+ // Create message.
+ const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f);
+ upb_Message* msg = upb_Message_New(m, arena);
+ PyObject* py_msg = PyUpb_CMessage_Get(msg, m, self->arena);
+ PyObject* ret = PyUpb_CMessage_MergeFrom(py_msg, value);
+ Py_DECREF(py_msg);
+ if (!ret) return NULL;
+ Py_DECREF(ret);
+ msgval.msg_val = msg;
+ } else {
+ if (!PyUpb_PyToUpb(value, f, &msgval, arena)) return NULL;
+ }
+
+ upb_Array_Insert(arr, index, 1, arena);
+ upb_Array_Set(arr, index, msgval);
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef PyUpb_RepeatedCompositeContainer_Methods[] = {
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ {"__deepcopy__", PyUpb_RepeatedContainer_DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class."},
+ {"add", (PyCFunction)PyUpb_RepeatedCompositeContainer_Add,
+ METH_VARARGS | METH_KEYWORDS, "Adds an object to the repeated container."},
+ {"append", PyUpb_RepeatedCompositeContainer_Append, METH_O,
+ "Appends a message to the end of the repeated container."},
+ {"insert", PyUpb_RepeatedContainer_Insert, METH_VARARGS,
+ "Inserts a message before the specified index."},
+ {"extend", PyUpb_RepeatedContainer_Extend, METH_O,
+ "Adds objects to the repeated container."},
+ {"pop", PyUpb_RepeatedContainer_Pop, METH_VARARGS,
+ "Removes an object from the repeated container and returns it."},
+ {"remove", PyUpb_RepeatedContainer_Remove, METH_O,
+ "Removes an object from the repeated container."},
+ {"sort", (PyCFunction)PyUpb_RepeatedContainer_Sort,
+ METH_VARARGS | METH_KEYWORDS, "Sorts the repeated container."},
+ {"reverse", (PyCFunction)PyUpb_RepeatedContainer_Reverse, METH_NOARGS,
+ "Reverses elements order of the repeated container."},
+ {"MergeFrom", PyUpb_RepeatedContainer_MergeFrom, METH_O,
+ "Adds objects to the repeated container."},
+ {NULL, NULL}};
+
+static PyType_Slot PyUpb_RepeatedCompositeContainer_Slots[] = {
+ {Py_tp_dealloc, PyUpb_RepeatedContainer_Dealloc},
+ {Py_tp_methods, PyUpb_RepeatedCompositeContainer_Methods},
+ {Py_sq_length, PyUpb_RepeatedContainer_Length},
+ {Py_sq_item, PyUpb_RepeatedContainer_Item},
+ {Py_mp_length, PyUpb_RepeatedContainer_Length},
+ {Py_tp_repr, PyUpb_RepeatedContainer_Repr},
+ {Py_mp_subscript, PyUpb_RepeatedContainer_Subscript},
+ {Py_mp_ass_subscript, PyUpb_RepeatedContainer_AssignSubscript},
+ {Py_tp_new, PyUpb_Forbidden_New},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_RepeatedCompositeContainer_Spec = {
+ PYUPB_MODULE_NAME ".RepeatedCompositeContainer",
+ sizeof(PyUpb_RepeatedContainer),
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT,
+ PyUpb_RepeatedCompositeContainer_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// RepeatedScalarContainer
+// -----------------------------------------------------------------------------
+
+static PyObject* PyUpb_RepeatedScalarContainer_Append(PyObject* _self,
+ PyObject* value) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_self);
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_MessageValue msgval;
+ if (!PyUpb_PyToUpb(value, f, &msgval, arena)) {
+ return NULL;
+ }
+ upb_Array_Append(arr, msgval, arena);
+ Py_RETURN_NONE;
+}
+
+static int PyUpb_RepeatedScalarContainer_AssignItem(PyObject* _self,
+ Py_ssize_t index,
+ PyObject* item) {
+ PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self;
+ upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self);
+ Py_ssize_t size = arr ? upb_Array_Size(arr) : 0;
+ if (index < 0 || index >= size) {
+ PyErr_Format(PyExc_IndexError, "list index (%zd) out of range", index);
+ return -1;
+ }
+ const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self);
+ upb_MessageValue msgval;
+ upb_Arena* arena = PyUpb_Arena_Get(self->arena);
+ if (!PyUpb_PyToUpb(item, f, &msgval, arena)) {
+ return -1;
+ }
+ upb_Array_Set(self->ptr.arr, index, msgval);
+ return 0;
+}
+
+static PyMethodDef PyUpb_RepeatedScalarContainer_Methods[] = {
+ // TODO(https://github.com/protocolbuffers/upb/issues/459)
+ {"__deepcopy__", PyUpb_RepeatedContainer_DeepCopy, METH_VARARGS,
+ "Makes a deep copy of the class."},
+ // {"__reduce__", Reduce, METH_NOARGS,
+ // "Outputs picklable representation of the repeated field."},
+ {"append", PyUpb_RepeatedScalarContainer_Append, METH_O,
+ "Appends an object to the repeated container."},
+ {"extend", PyUpb_RepeatedContainer_Extend, METH_O,
+ "Appends objects to the repeated container."},
+ {"insert", PyUpb_RepeatedContainer_Insert, METH_VARARGS,
+ "Inserts an object at the specified position in the container."},
+ {"pop", PyUpb_RepeatedContainer_Pop, METH_VARARGS,
+ "Removes an object from the repeated container and returns it."},
+ {"remove", PyUpb_RepeatedContainer_Remove, METH_O,
+ "Removes an object from the repeated container."},
+ {"sort", (PyCFunction)PyUpb_RepeatedContainer_Sort,
+ METH_VARARGS | METH_KEYWORDS, "Sorts the repeated container."},
+ {"reverse", (PyCFunction)PyUpb_RepeatedContainer_Reverse, METH_NOARGS,
+ "Reverses elements order of the repeated container."},
+ {"MergeFrom", PyUpb_RepeatedContainer_MergeFrom, METH_O,
+ "Merges a repeated container into the current container."},
+ {NULL, NULL}};
+
+static PyType_Slot PyUpb_RepeatedScalarContainer_Slots[] = {
+ {Py_tp_dealloc, PyUpb_RepeatedContainer_Dealloc},
+ {Py_tp_methods, PyUpb_RepeatedScalarContainer_Methods},
+ {Py_tp_new, PyUpb_Forbidden_New},
+ {Py_tp_repr, PyUpb_RepeatedContainer_Repr},
+ {Py_sq_length, PyUpb_RepeatedContainer_Length},
+ {Py_sq_item, PyUpb_RepeatedContainer_Item},
+ {Py_sq_ass_item, PyUpb_RepeatedScalarContainer_AssignItem},
+ {Py_mp_length, PyUpb_RepeatedContainer_Length},
+ {Py_mp_subscript, PyUpb_RepeatedContainer_Subscript},
+ {Py_mp_ass_subscript, PyUpb_RepeatedContainer_AssignSubscript},
+ {Py_tp_richcompare, PyUpb_RepeatedContainer_RichCompare},
+ {Py_tp_hash, PyObject_HashNotImplemented},
+ {0, NULL}};
+
+static PyType_Spec PyUpb_RepeatedScalarContainer_Spec = {
+ PYUPB_MODULE_NAME ".RepeatedScalarContainer",
+ sizeof(PyUpb_RepeatedContainer),
+ 0, // tp_itemsize
+ Py_TPFLAGS_DEFAULT,
+ PyUpb_RepeatedScalarContainer_Slots,
+};
+
+// -----------------------------------------------------------------------------
+// Top Level
+// -----------------------------------------------------------------------------
+
+static bool PyUpb_Repeated_RegisterAsSequence(PyUpb_ModuleState* state) {
+ PyObject* collections = NULL;
+ PyObject* seq = NULL;
+ PyObject* ret1 = NULL;
+ PyObject* ret2 = NULL;
+ PyTypeObject* type1 = state->repeated_scalar_container_type;
+ PyTypeObject* type2 = state->repeated_composite_container_type;
+
+ bool ok = (collections = PyImport_ImportModule("collections.abc")) &&
+ (seq = PyObject_GetAttrString(collections, "MutableSequence")) &&
+ (ret1 = PyObject_CallMethod(seq, "register", "O", type1)) &&
+ (ret2 = PyObject_CallMethod(seq, "register", "O", type2));
+
+ Py_XDECREF(collections);
+ Py_XDECREF(seq);
+ Py_XDECREF(ret1);
+ Py_XDECREF(ret2);
+ return ok;
+}
+
+bool PyUpb_Repeated_Init(PyObject* m) {
+ PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m);
+
+ state->repeated_composite_container_type =
+ PyUpb_AddClass(m, &PyUpb_RepeatedCompositeContainer_Spec);
+ state->repeated_scalar_container_type =
+ PyUpb_AddClass(m, &PyUpb_RepeatedScalarContainer_Spec);
+
+ return state->repeated_composite_container_type &&
+ state->repeated_scalar_container_type &&
+ PyUpb_Repeated_RegisterAsSequence(state);
+}
diff --git a/grpc/third_party/upb/python/repeated.h b/grpc/third_party/upb/python/repeated.h
new file mode 100644
index 00000000..9cde3eae
--- /dev/null
+++ b/grpc/third_party/upb/python/repeated.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PYUPB_REPEATED_H__
+#define PYUPB_REPEATED_H__
+
+#include <stdbool.h>
+
+#include "python/python.h"
+#include "upb/def.h"
+
+// Creates a new repeated field stub for field `f` of message object `parent`.
+// Precondition: `parent` must be a stub.
+PyObject* PyUpb_RepeatedContainer_NewStub(PyObject* parent,
+ const upb_FieldDef* f,
+ PyObject* arena);
+
+// Returns a repeated field object wrapping `arr`, of field type `f`, which
+// must be on `arena`. If an existing wrapper object exists, it will be
+// returned, otherwise a new object will be created. The caller always owns a
+// ref on the returned value.
+PyObject* PyUpb_RepeatedContainer_GetOrCreateWrapper(upb_Array* arr,
+ const upb_FieldDef* f,
+ PyObject* arena);
+
+// Reifies a repeated field stub to point to the concrete data in `arr`.
+// If `arr` is NULL, an appropriate empty array will be constructed.
+void PyUpb_RepeatedContainer_Reify(PyObject* self, upb_Array* arr);
+
+// Reifies this repeated object if it is not already reified.
+upb_Array* PyUpb_RepeatedContainer_EnsureReified(PyObject* self);
+
+// Implements repeated_field.extend(iterable). `_self` must be a repeated
+// field (either repeated composite or repeated scalar).
+PyObject* PyUpb_RepeatedContainer_Extend(PyObject* _self, PyObject* value);
+
+// Implements repeated_field.add(initial_values). `_self` must be a repeated
+// composite field.
+PyObject* PyUpb_RepeatedCompositeContainer_Add(PyObject* _self, PyObject* args,
+ PyObject* kwargs);
+
+// Module-level init.
+bool PyUpb_Repeated_Init(PyObject* m);
+
+#endif // PYUPB_REPEATED_H__
diff --git a/grpc/third_party/upb/python/version_script.lds b/grpc/third_party/upb/python/version_script.lds
new file mode 100644
index 00000000..7cb83000
--- /dev/null
+++ b/grpc/third_party/upb/python/version_script.lds
@@ -0,0 +1,6 @@
+message {
+ global:
+ PyInit__message;
+ local:
+ *;
+};
diff --git a/grpc/third_party/upb/tests/BUILD b/grpc/third_party/upb/tests/BUILD
deleted file mode 100644
index ad12fce1..00000000
--- a/grpc/third_party/upb/tests/BUILD
+++ /dev/null
@@ -1,283 +0,0 @@
-load(
- "//bazel:build_defs.bzl",
- "UPB_DEFAULT_COPTS",
- "UPB_DEFAULT_CPPOPTS",
- "make_shell_script",
-)
-load(
- "//bazel:upb_proto_library.bzl",
- "upb_proto_library",
- "upb_proto_reflection_library",
-)
-
-licenses(["notice"])
-
-config_setting(
- name = "fuzz",
- values = {"define": "fuzz=true"},
-)
-
-cc_library(
- name = "upb_test",
- testonly = 1,
- srcs = [
- "testmain.cc",
- ],
- hdrs = [
- "test_util.h",
- "upb_test.h",
- ],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- "//:handlers",
- "//:port",
- "//:upb",
- ],
-)
-
-proto_library(
- name = "test_proto",
- testonly = 1,
- srcs = ["test.proto"],
-)
-
-upb_proto_library(
- name = "test_upb_proto",
- testonly = 1,
- deps = [":test_proto"],
-)
-
-cc_test(
- name = "test_generated_code",
- srcs = ["test_generated_code.c"],
- copts = UPB_DEFAULT_COPTS,
- deps = [
- ":empty_upbdefs_proto",
- ":test_messages_proto3_proto_upb",
- ":test_upb_proto",
- ":upb_test",
- ],
-)
-
-proto_library(
- name = "empty_proto",
- srcs = ["empty.proto"],
-)
-
-upb_proto_reflection_library(
- name = "empty_upbdefs_proto",
- testonly = 1,
- deps = [":empty_proto"],
-)
-
-upb_proto_library(
- name = "test_messages_proto3_proto_upb",
- testonly = 1,
- deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
-)
-
-proto_library(
- name = "test_decoder_proto",
- srcs = [
- "pb/test_decoder.proto",
- ],
-)
-
-upb_proto_reflection_library(
- name = "test_decoder_upb_proto",
- deps = [":test_decoder_proto"],
-)
-
-cc_test(
- name = "test_decoder",
- srcs = ["pb/test_decoder.cc"],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- ":test_decoder_upb_proto",
- ":upb_test",
- "//:handlers",
- "//:port",
- "//:upb",
- "//:upb_pb",
- ],
-)
-
-proto_library(
- name = "test_cpp_proto",
- srcs = [
- "test_cpp.proto",
- ],
-)
-
-upb_proto_reflection_library(
- name = "test_cpp_upb_proto",
- deps = ["test_cpp_proto"],
-)
-
-cc_test(
- name = "test_cpp",
- srcs = ["test_cpp.cc"],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- ":test_cpp_upb_proto",
- ":upb_test",
- "//:handlers",
- "//:port",
- "//:reflection",
- "//:upb",
- "//:upb_pb",
- ],
-)
-
-cc_test(
- name = "test_table",
- srcs = ["test_table.cc"],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- ":upb_test",
- "//:port",
- "//:table",
- "//:upb",
- ],
-)
-
-# OSS-Fuzz test
-cc_binary(
- name = "file_descriptor_parsenew_fuzzer",
- testonly = 1,
- srcs = ["file_descriptor_parsenew_fuzzer.cc"],
- copts = UPB_DEFAULT_CPPOPTS + select({
- "//conditions:default": [],
- ":fuzz": ["-fsanitize=fuzzer,address"],
- }),
- defines = select({
- "//conditions:default": [],
- ":fuzz": ["HAVE_FUZZER"],
- }),
- deps = [
- "//:descriptor_upb_proto",
- "//:upb",
- ],
-)
-
-# copybara:strip_for_google3_begin
-cc_test(
- name = "test_encoder",
- srcs = ["pb/test_encoder.cc"],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- ":upb_test",
- "//:descriptor_upb_proto",
- "//:descriptor_upb_proto_reflection",
- "//:upb",
- "//:upb_pb",
- ],
-)
-
-proto_library(
- name = "test_json_enum_from_separate",
- srcs = ["json/enum_from_separate_file.proto"],
- deps = [":test_json_proto"],
-)
-
-proto_library(
- name = "test_json_proto",
- srcs = ["json/test.proto"],
-)
-
-upb_proto_reflection_library(
- name = "test_json_upb_proto_reflection",
- deps = ["test_json_proto"],
-)
-
-upb_proto_library(
- name = "test_json_enum_from_separate_upb_proto",
- deps = [":test_json_enum_from_separate"],
-)
-
-upb_proto_library(
- name = "test_json_upb_proto",
- deps = [":test_json_proto"],
-)
-
-cc_test(
- name = "test_json",
- srcs = [
- "json/test_json.cc",
- ],
- copts = UPB_DEFAULT_CPPOPTS,
- deps = [
- ":test_json_upb_proto",
- ":test_json_upb_proto_reflection",
- ":upb_test",
- "//:upb_json",
- ],
-)
-# copybara:strip_end
-
-upb_proto_library(
- name = "conformance_proto_upb",
- testonly = 1,
- deps = ["@com_google_protobuf//:conformance_proto"],
-)
-
-upb_proto_reflection_library(
- name = "conformance_proto_upbdefs",
- testonly = 1,
- deps = ["@com_google_protobuf//:conformance_proto"],
-)
-
-upb_proto_reflection_library(
- name = "test_messages_proto2_upbdefs",
- testonly = 1,
- deps = ["@com_google_protobuf//:test_messages_proto2_proto"],
-)
-
-upb_proto_reflection_library(
- name = "test_messages_proto3_upbdefs",
- testonly = 1,
- deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
-)
-
-cc_binary(
- name = "conformance_upb",
- testonly = 1,
- srcs = [
- "conformance_upb.c",
- ],
- copts = UPB_DEFAULT_COPTS,
- data = [
- "conformance_upb_failures.txt",
- ],
- deps = [
- ":conformance_proto_upb",
- ":conformance_proto_upbdefs",
- ":test_messages_proto2_upbdefs",
- ":test_messages_proto3_upbdefs",
- "//:json",
- "//:port",
- "//:reflection",
- "//:textformat",
- "//:upb",
- ],
-)
-
-make_shell_script(
- name = "gen_test_conformance_upb",
- out = "test_conformance_upb.sh",
- contents = "external/com_google_protobuf/conformance_test_runner " +
- " --enforce_recommended " +
- " --failure_list ./tests/conformance_upb_failures.txt" +
- " ./tests/conformance_upb",
-)
-
-sh_test(
- name = "test_conformance_upb",
- srcs = ["test_conformance_upb.sh"],
- data = [
- "conformance_upb_failures.txt",
- ":conformance_upb",
- "@com_google_protobuf//:conformance_test_runner",
- ],
- deps = ["@bazel_tools//tools/bash/runfiles"],
-)
diff --git a/grpc/third_party/upb/tests/bindings/lua/BUILD b/grpc/third_party/upb/tests/bindings/lua/BUILD
deleted file mode 100644
index a065b1df..00000000
--- a/grpc/third_party/upb/tests/bindings/lua/BUILD
+++ /dev/null
@@ -1,68 +0,0 @@
-load(
- "//upb/bindings/lua:lua_proto_library.bzl",
- "lua_proto_library",
-)
-load(
- "//bazel:build_defs.bzl",
- "UPB_DEFAULT_COPTS",
-)
-
-licenses(["notice"])
-
-cc_test(
- name = "test_lua",
- srcs = ["main.c"],
- copts = UPB_DEFAULT_COPTS,
- data = [
- "test_upb.lua",
- ":descriptor_proto_lua",
- ":empty_proto_lua",
- ":test_messages_proto2_proto_lua",
- ":test_messages_proto3_proto_lua",
- ":test_proto_lua",
- "//:third_party/lunit/console.lua",
- "//:third_party/lunit/lunit.lua",
- "//upb/bindings/lua:upb.lua",
- "@com_google_protobuf//:conformance_proto",
- "@com_google_protobuf//:descriptor_proto",
- ],
- linkstatic = 1,
- deps = [
- "//upb/bindings/lua:lupb",
- "@lua//:liblua",
- ],
-)
-
-proto_library(
- name = "test_proto",
- testonly = 1,
- srcs = ["test.proto"],
-)
-
-lua_proto_library(
- name = "test_proto_lua",
- testonly = 1,
- deps = [":test_proto"],
-)
-
-lua_proto_library(
- name = "descriptor_proto_lua",
- deps = ["@com_google_protobuf//:descriptor_proto"],
-)
-
-lua_proto_library(
- name = "empty_proto_lua",
- deps = ["@com_google_protobuf//:empty_proto"],
-)
-
-lua_proto_library(
- name = "test_messages_proto3_proto_lua",
- testonly = 1,
- deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
-)
-
-lua_proto_library(
- name = "test_messages_proto2_proto_lua",
- testonly = 1,
- deps = ["@com_google_protobuf//:test_messages_proto2_proto"],
-)
diff --git a/grpc/third_party/upb/tests/bindings/lua/main.c b/grpc/third_party/upb/tests/bindings/lua/main.c
deleted file mode 100644
index 6e48ccaf..00000000
--- a/grpc/third_party/upb/tests/bindings/lua/main.c
+++ /dev/null
@@ -1,58 +0,0 @@
-
-#include <lauxlib.h>
-#include <lua.h>
-#include <lualib.h>
-#include <signal.h>
-
-#include "upb/bindings/lua/upb.h"
-
-lua_State *L;
-
-static void interrupt(lua_State *L, lua_Debug *ar) {
- (void)ar;
- lua_sethook(L, NULL, 0, 0);
- luaL_error(L, "SIGINT");
-}
-
-static void sighandler(int i) {
- fprintf(stderr, "Signal!\n");
- signal(i, SIG_DFL);
- lua_sethook(L, interrupt, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
-}
-
-const char *init =
- "package.preload['lupb'] = ... "
- "package.path = '"
- "./?.lua;"
- "./third_party/lunit/?.lua;"
- "external/com_google_protobuf/?.lua;"
- "external/com_google_protobuf/src/?.lua;"
- "bazel-bin/?.lua;"
- "bazel-bin/external/com_google_protobuf/src/?.lua;"
- "bazel-bin/external/com_google_protobuf/?.lua;"
- "bazel-bin/external/com_google_protobuf/?.lua;"
- "upb/bindings/lua/?.lua"
- "'";
-
-int main(int argc, char **argv) {
- int ret = 0;
- L = luaL_newstate();
- luaL_openlibs(L);
- lua_pushcfunction(L, luaopen_lupb);
- ret = luaL_loadstring(L, init);
- lua_pushcfunction(L, luaopen_lupb);
-
- signal(SIGINT, sighandler);
- ret = ret ||
- lua_pcall(L, 1, LUA_MULTRET, 0) ||
- luaL_dofile(L, "tests/bindings/lua/test_upb.lua");
- signal(SIGINT, SIG_DFL);
-
- if (ret) {
- fprintf(stderr, "error testing Lua: %s\n", lua_tostring(L, -1));
- ret = 1;
- }
-
- lua_close(L);
- return ret;
-}
diff --git a/grpc/third_party/upb/tests/bindings/lua/test.proto b/grpc/third_party/upb/tests/bindings/lua/test.proto
deleted file mode 100644
index 6b453502..00000000
--- a/grpc/third_party/upb/tests/bindings/lua/test.proto
+++ /dev/null
@@ -1,28 +0,0 @@
-
-syntax = "proto2";
-
-package upb_test;
-
-message MapTest {
- map<string, double> map_string_double = 1;
-}
-
-message PackedTest {
- repeated bool bool_packed = 1 [packed = true];
- repeated int32 i32_packed = 2 [packed = true];
- repeated int64 i64_packed = 3 [packed = true];
- repeated fixed32 f32_packed = 4 [packed = true];
- repeated fixed64 f64_packed = 5 [packed = true];
-}
-
-message UnpackedTest {
- repeated bool bool_packed = 1 [packed = false];
- repeated int32 i32_packed = 2 [packed = false];
- repeated int64 i64_packed = 3 [packed = false];
- repeated fixed32 f32_packed = 4 [packed = false];
- repeated fixed64 f64_packed = 5 [packed = false];
-}
-
-message TestLargeFieldNumber {
- optional int32 i32 = 456214797;
-}
diff --git a/grpc/third_party/upb/tests/bindings/lua/test_upb.lua b/grpc/third_party/upb/tests/bindings/lua/test_upb.lua
deleted file mode 100644
index e2d53450..00000000
--- a/grpc/third_party/upb/tests/bindings/lua/test_upb.lua
+++ /dev/null
@@ -1,751 +0,0 @@
-
-local upb = require "lupb"
-local lunit = require "lunit"
-local upb_test = require "tests.bindings.lua.test_pb"
-local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
-local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
-local descriptor = require "google.protobuf.descriptor_pb"
-local empty = require "google.protobuf.empty_pb"
-
-if _VERSION >= 'Lua 5.2' then
- _ENV = lunit.module("testupb", "seeall")
-else
- module("testupb", lunit.testcase, package.seeall)
-end
-
-function iter_to_array(iter)
- local arr = {}
- for v in iter do
- arr[#arr + 1] = v
- end
- return arr
-end
-
-function test_def_readers()
- local m = test_messages_proto3.TestAllTypesProto3
- assert_equal("TestAllTypesProto3", m:name())
- assert_equal("protobuf_test_messages.proto3.TestAllTypesProto3", m:full_name())
-
- -- field
- local f = m:field("optional_int32")
- local f2 = m:field(1)
- assert_equal(f, f2)
- assert_equal(1, f:number())
- assert_equal("optional_int32", f:name())
- assert_equal(upb.LABEL_OPTIONAL, f:label())
- assert_equal(upb.DESCRIPTOR_TYPE_INT32, f:descriptor_type())
- assert_equal(upb.TYPE_INT32, f:type())
- assert_nil(f:containing_oneof())
- assert_equal(m, f:containing_type())
- assert_equal(0, f:default())
- local message_field_count = 0
- for field in m:fields() do
- message_field_count = message_field_count + 1
- end
- assert_equal(message_field_count, #m)
-
- local message_oneof_count = 0
- for oneof in m:oneofs() do
- message_oneof_count = message_oneof_count + 1
- end
- assert_equal(message_oneof_count, m:oneof_count())
-
- -- oneof
- local o = m:lookup_name("oneof_field")
- assert_equal("oneof_field", o:name())
- assert_equal(m, o:containing_type())
- local oneof_field_count = 0
- for field in o:fields() do
- oneof_field_count = oneof_field_count + 1
- end
- assert_equal(oneof_field_count, #o)
-
- -- enum
- local e = test_messages_proto3['TestAllTypesProto3.NestedEnum']
- assert_true(#e > 3 and #e < 10)
- assert_equal(2, e:value("BAZ"))
-end
-
-function test_msg_map()
- msg = test_messages_proto3.TestAllTypesProto3()
- msg.map_int32_int32[5] = 10
- msg.map_int32_int32[6] = 12
- assert_equal(10, msg.map_int32_int32[5])
- assert_equal(12, msg.map_int32_int32[6])
-
- -- Test overwrite.
- msg.map_int32_int32[5] = 20
- assert_equal(20, msg.map_int32_int32[5])
- assert_equal(12, msg.map_int32_int32[6])
- msg.map_int32_int32[5] = 10
-
- -- Test delete.
- msg.map_int32_int32[5] = nil
- assert_nil(msg.map_int32_int32[5])
- assert_equal(12, msg.map_int32_int32[6])
- msg.map_int32_int32[5] = 10
-
- local serialized = upb.encode(msg)
- assert_true(#serialized > 0)
- local msg2 = upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
- assert_equal(10, msg2.map_int32_int32[5])
- assert_equal(12, msg2.map_int32_int32[6])
-end
-
-function test_map_sorting()
- function msg_with_int32_entries(start, expand)
- local msg = test_messages_proto3.TestAllTypesProto3()
- for i=start,start + 8 do
- msg.map_int32_int32[i] = i * 2
- end
-
- if expand then
- for i=start+20,200 do
- msg.map_int32_int32[i] = i
- end
- for i=start+20,200 do
- msg.map_int32_int32[i] = nil
- end
- end
- return msg
- end
-
- function msg_with_msg_entries(expand)
- local msg = test_messages_proto3.TestAllTypesProto3()
- -- 8! = 40320 possible orderings makes it overwhelmingly likely that two
- -- random orderings will be different.
- for i=1,8 do
- local submsg = test_messages_proto3.TestAllTypesProto3.NestedMessage()
- submsg.corecursive = msg_with_int32_entries(i, expand)
- msg.map_string_nested_message[tostring(i)] = submsg
- end
-
- expand = false
- if expand then
- for i=21,2000 do
- local submsg = test_messages_proto3.TestAllTypesProto3.NestedMessage()
- submsg.corecursive = msg_with_int32_entries(i, expand)
- msg.map_string_nested_message[tostring(i)] = submsg
- end
- for i=21,2000 do
- msg.map_string_nested_message[tostring(i)] = nil
- end
- end
- return msg
- end
-
- -- Create two messages with the same contents but (hopefully) different
- -- map table orderings.
- local msg = msg_with_msg_entries(false)
- local msg2 = msg_with_msg_entries(true)
-
- local text1 = upb.text_encode(msg)
- local text2 = upb.text_encode(msg2)
- assert_equal(text1, text2)
-
- local binary1 = upb.encode(msg, {upb.ENCODE_DETERMINISTIC})
- local binary2 = upb.encode(msg2, {upb.ENCODE_DETERMINISTIC})
- assert_equal(binary1, binary2)
-
- -- Non-sorted map should compare different.
- local text3 = upb.text_encode(msg, {upb.TXTENC_NOSORT})
- assert_not_equal(text1, text3)
-
- local binary3 = upb.encode(msg)
- assert_not_equal(binary1, binary3)
-end
-
-function test_utf8()
- local proto2_msg = test_messages_proto2.TestAllTypesProto2()
- proto2_msg.optional_string = "\xff"
- local serialized = upb.encode(proto2_msg)
-
- -- Decoding invalid UTF-8 succeeds in proto2.
- upb.decode(test_messages_proto2.TestAllTypesProto2, serialized)
-
- -- Decoding invalid UTF-8 fails in proto2.
- assert_error_match("Error decoding protobuf", function()
- upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
- end)
-
- -- TODO(haberman): should proto3 accessors also check UTF-8 at set time?
-end
-
-function test_string_double_map()
- msg = upb_test.MapTest()
- msg.map_string_double["one"] = 1.0
- msg.map_string_double["two point five"] = 2.5
- assert_equal(1, msg.map_string_double["one"])
- assert_equal(2.5, msg.map_string_double["two point five"])
-
- -- Test overwrite.
- msg.map_string_double["one"] = 2
- assert_equal(2, msg.map_string_double["one"])
- assert_equal(2.5, msg.map_string_double["two point five"])
- msg.map_string_double["one"] = 1.0
-
- -- Test delete.
- msg.map_string_double["one"] = nil
- assert_nil(msg.map_string_double["one"])
- assert_equal(2.5, msg.map_string_double["two point five"])
- msg.map_string_double["one"] = 1
-
- local serialized = upb.encode(msg)
- assert_true(#serialized > 0)
- local msg2 = upb.decode(upb_test.MapTest, serialized)
- assert_equal(1, msg2.map_string_double["one"])
- assert_equal(2.5, msg2.map_string_double["two point five"])
-end
-
-function test_string_double_map()
- local function fill_msg(msg)
- msg.i32_packed[1] = 100
- msg.i32_packed[2] = 200
- msg.i32_packed[3] = 50000
-
- msg.i64_packed[1] = 101
- msg.i64_packed[2] = 201
- msg.i64_packed[3] = 50001
-
- msg.f32_packed[1] = 102
- msg.f32_packed[2] = 202
- msg.f32_packed[3] = 50002
-
- msg.f64_packed[1] = 103
- msg.f64_packed[2] = 203
- msg.f64_packed[3] = 50003
- end
-
- local function check_msg(msg)
- assert_equal(100, msg.i32_packed[1])
- assert_equal(200, msg.i32_packed[2])
- assert_equal(50000, msg.i32_packed[3])
- assert_equal(3, #msg.i32_packed)
-
- assert_equal(101, msg.i64_packed[1])
- assert_equal(201, msg.i64_packed[2])
- assert_equal(50001, msg.i64_packed[3])
- assert_equal(3, #msg.i64_packed)
-
- assert_equal(102, msg.f32_packed[1])
- assert_equal(202, msg.f32_packed[2])
- assert_equal(50002, msg.f32_packed[3])
- assert_equal(3, #msg.f32_packed)
-
- assert_equal(103, msg.f64_packed[1])
- assert_equal(203, msg.f64_packed[2])
- assert_equal(50003, msg.f64_packed[3])
- assert_equal(3, #msg.f64_packed)
- end
-
- local msg = upb_test.PackedTest()
- fill_msg(msg)
- check_msg(msg)
-
- local serialized_packed = upb.encode(msg)
- local msg2 = upb.decode(upb_test.PackedTest, serialized_packed)
- local msg3 = upb.decode(upb_test.UnpackedTest, serialized_packed)
- check_msg(msg2)
- check_msg(msg3)
-
- serialized_unpacked = upb.encode(msg3)
- local msg4 = upb.decode(upb_test.PackedTest, serialized_unpacked)
- local msg5 = upb.decode(upb_test.PackedTest, serialized_unpacked)
- check_msg(msg4)
- check_msg(msg5)
-
-end
-
-function test_msg_string_map()
- msg = test_messages_proto3.TestAllTypesProto3()
- msg.map_string_string["foo"] = "bar"
- msg.map_string_string["baz"] = "quux"
- assert_nil(msg.map_string_string["abc"])
- assert_equal("bar", msg.map_string_string["foo"])
- assert_equal("quux", msg.map_string_string["baz"])
-
- -- Test overwrite.
- msg.map_string_string["foo"] = "123"
- assert_equal("123", msg.map_string_string["foo"])
- assert_equal("quux", msg.map_string_string["baz"])
- msg.map_string_string["foo"] = "bar"
-
- -- Test delete
- msg.map_string_string["foo"] = nil
- assert_nil(msg.map_string_string["foo"])
- assert_equal("quux", msg.map_string_string["baz"])
- msg.map_string_string["foo"] = "bar"
-
- local serialized = upb.encode(msg)
- assert_true(#serialized > 0)
- local msg2 = upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
- assert_equal("bar", msg2.map_string_string["foo"])
- assert_equal("quux", msg2.map_string_string["baz"])
-end
-
-function test_msg_array()
- msg = test_messages_proto3.TestAllTypesProto3()
-
- assert_not_nil(msg.repeated_int32)
- assert_equal(msg.repeated_int32, msg.repeated_int32)
- assert_equal(0, #msg.repeated_int32)
-
- msg.repeated_int32[1] = 2
- assert_equal(1, #msg.repeated_int32);
- assert_equal(2, msg.repeated_int32[1]);
-
- -- Can't assign a scalar; array is expected.
- assert_error_match("lupb.array expected", function() msg.repeated_int32 = 5 end)
-
- -- Can't assign array of the wrong type.
- local function assign_int64()
- msg.repeated_int32 = upb.Array(upb.TYPE_INT64)
- end
- assert_error_match("array type mismatch", assign_int64)
-
- local arr = upb.Array(upb.TYPE_INT32)
- arr[1] = 6
- assert_equal(1, #arr)
- msg.repeated_int32 = arr
- assert_equal(msg.repeated_int32, msg.repeated_int32)
- assert_equal(arr, msg.repeated_int32)
- assert_equal(1, #msg.repeated_int32)
- assert_equal(6, msg.repeated_int32[1])
-
- -- Can't assign other Lua types.
- assert_error_match("array expected", function() msg.repeated_int32 = "abc" end)
- assert_error_match("array expected", function() msg.repeated_int32 = true end)
- assert_error_match("array expected", function() msg.repeated_int32 = false end)
- assert_error_match("array expected", function() msg.repeated_int32 = nil end)
- assert_error_match("array expected", function() msg.repeated_int32 = {} end)
- assert_error_match("array expected", function() msg.repeated_int32 = print end)
-end
-
-function test_msg_submsg()
- --msg = test_messages_proto3.TestAllTypesProto3()
- msg = test_messages_proto3['TestAllTypesProto3']()
-
- assert_nil(msg.optional_nested_message)
-
- -- Can't assign message of the wrong type.
- local function assign_int64()
- msg.optional_nested_message = test_messages_proto3.TestAllTypesProto3()
- end
- assert_error_match("message type mismatch", assign_int64)
-
- local nested = test_messages_proto3['TestAllTypesProto3.NestedMessage']()
- msg.optional_nested_message = nested
- assert_equal(nested, msg.optional_nested_message)
-
- -- Can't assign other Lua types.
- assert_error_match("msg expected", function() msg.optional_nested_message = "abc" end)
- assert_error_match("msg expected", function() msg.optional_nested_message = true end)
- assert_error_match("msg expected", function() msg.optional_nested_message = false end)
- assert_error_match("msg expected", function() msg.optional_nested_message = nil end)
- assert_error_match("msg expected", function() msg.optional_nested_message = {} end)
- assert_error_match("msg expected", function() msg.optional_nested_message = print end)
-end
-
--- Lua 5.1 and 5.2 have slightly different semantics for how a finalizer
--- can be defined in Lua.
-if _VERSION >= 'Lua 5.2' then
- function defer(fn)
- setmetatable({}, { __gc = fn })
- end
-else
- function defer(fn)
- getmetatable(newproxy(true)).__gc = fn
- end
-end
-
-function test_finalizer()
- -- Tests that we correctly handle a call into an already-finalized object.
- -- Collectible objects are finalized in the opposite order of creation.
- do
- local t = {}
- defer(function()
- assert_error_match("called into dead object", function()
- -- Generic def call.
- t[1]:lookup_msg("abc")
- end)
- end)
- t = {
- upb.SymbolTable(),
- }
- end
- collectgarbage()
-end
-
--- in-range of 64-bit types but not exactly representable as double
-local bad64 = 2^68 - 1
-
-local numeric_types = {
- [upb.TYPE_UINT32] = {
- valid_val = 2^32 - 1,
- too_big = 2^32,
- too_small = -1,
- other_bad = 5.1
- },
- [upb.TYPE_UINT64] = {
- valid_val = 2^63,
- too_big = 2^64,
- too_small = -1,
- other_bad = bad64
- },
- [upb.TYPE_INT32] = {
- valid_val = 2^31 - 1,
- too_big = 2^31,
- too_small = -2^31 - 1,
- other_bad = 5.1
- },
- -- Enums don't exist at a language level in Lua, so we just represent enum
- -- values as int32s.
- [upb.TYPE_ENUM] = {
- valid_val = 2^31 - 1,
- too_big = 2^31,
- too_small = -2^31 - 1,
- other_bad = 5.1
- },
- [upb.TYPE_INT64] = {
- valid_val = 2^62,
- too_big = 2^63,
- too_small = -2^64,
- other_bad = bad64
- },
- [upb.TYPE_FLOAT] = {
- valid_val = 340282306073709652508363335590014353408
- },
- [upb.TYPE_DOUBLE] = {
- valid_val = 10^101
- },
-}
-
-function test_utf8()
- local invalid_utf8 = "\xff"
- local proto2_msg = test_messages_proto2.TestAllTypesProto2{
- optional_string = invalid_utf8,
- }
-
- -- As proto2, invalid UTF-8 parses and serializes fine.
- local serialized = upb.encode(proto2_msg)
- local proto2_msg2 = upb.decode(test_messages_proto2.TestAllTypesProto2, serialized)
-
- -- Decoding as proto3 fails.
- assert_error(function()
- upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
- end)
-end
-
-function test_msg_primitives()
- local msg = test_messages_proto3.TestAllTypesProto3{
- optional_int32 = 10,
- optional_uint32 = 20,
- optional_int64 = 30,
- optional_uint64 = 40,
- optional_double = 50,
- optional_float = 60,
- optional_sint32 = 70,
- optional_sint64 = 80,
- optional_fixed32 = 90,
- optional_fixed64 = 100,
- optional_sfixed32 = 110,
- optional_sfixed64 = 120,
- optional_bool = true,
- optional_string = "abc",
- optional_nested_message = test_messages_proto3['TestAllTypesProto3.NestedMessage']{a = 123},
- }
-
- -- Attempts to access non-existent fields fail.
- assert_error_match("no such field", function() msg.no_such = 1 end)
-
- assert_equal(10, msg.optional_int32)
- assert_equal(20, msg.optional_uint32)
- assert_equal(30, msg.optional_int64)
- assert_equal(40, msg.optional_uint64)
- assert_equal(50, msg.optional_double)
- assert_equal(60, msg.optional_float)
- assert_equal(70, msg.optional_sint32)
- assert_equal(80, msg.optional_sint64)
- assert_equal(90, msg.optional_fixed32)
- assert_equal(100, msg.optional_fixed64)
- assert_equal(110, msg.optional_sfixed32)
- assert_equal(120, msg.optional_sfixed64)
- assert_equal(true, msg.optional_bool)
- assert_equal("abc", msg.optional_string)
- assert_equal(123, msg.optional_nested_message.a)
-end
-
-
-function test_string_array()
- local function test_for_string_type(upb_type)
- local array = upb.Array(upb_type)
- assert_equal(0, #array)
-
- -- 0 is never a valid index in Lua.
- assert_error_match("array index", function() return array[0] end)
- -- Past the end of the array.
- assert_error_match("array index", function() return array[1] end)
-
- array[1] = "foo"
- assert_equal("foo", array[1])
- assert_equal(1, #array)
- -- Past the end of the array.
- assert_error_match("array index", function() return array[2] end)
-
- local array2 = upb.Array(upb_type)
- assert_equal(0, #array2)
-
- array[2] = "bar"
- assert_equal("foo", array[1])
- assert_equal("bar", array[2])
- assert_equal(2, #array)
- -- Past the end of the array.
- assert_error_match("array index", function() return array[3] end)
-
- -- Can't assign other Lua types.
- assert_error_match("Expected string", function() array[3] = 123 end)
- assert_error_match("Expected string", function() array[3] = true end)
- assert_error_match("Expected string", function() array[3] = false end)
- assert_error_match("Expected string", function() array[3] = nil end)
- assert_error_match("Expected string", function() array[3] = {} end)
- assert_error_match("Expected string", function() array[3] = print end)
- assert_error_match("Expected string", function() array[3] = array end)
- end
-
- test_for_string_type(upb.TYPE_STRING)
- test_for_string_type(upb.TYPE_BYTES)
-end
-
-function test_numeric_array()
- local function test_for_numeric_type(upb_type)
- local array = upb.Array(upb_type)
- local vals = numeric_types[upb_type]
- assert_equal(0, #array)
-
- -- 0 is never a valid index in Lua.
- assert_error_match("array index", function() return array[0] end)
- -- Past the end of the array.
- assert_error_match("array index", function() return array[1] end)
-
- array[1] = vals.valid_val
- assert_equal(vals.valid_val, array[1])
- assert_equal(1, #array)
- assert_equal(vals.valid_val, array[1])
- -- Past the end of the array.
- assert_error_match("array index", function() return array[2] end)
-
- array[2] = 10
- assert_equal(vals.valid_val, array[1])
- assert_equal(10, array[2])
- assert_equal(2, #array)
- -- Past the end of the array.
- assert_error_match("array index", function() return array[3] end)
-
- -- Values that are out of range.
- local errmsg = "not an integer or out of range"
- if vals.too_small then
- assert_error_match(errmsg, function() array[3] = vals.too_small end)
- end
- if vals.too_big then
- assert_error_match(errmsg, function() array[3] = vals.too_big end)
- end
- if vals.other_bad then
- assert_error_match(errmsg, function() array[3] = vals.other_bad end)
- end
-
- -- Can't assign other Lua types.
- errmsg = "bad argument #3"
- assert_error_match(errmsg, function() array[3] = "abc" end)
- assert_error_match(errmsg, function() array[3] = true end)
- assert_error_match(errmsg, function() array[3] = false end)
- assert_error_match(errmsg, function() array[3] = nil end)
- assert_error_match(errmsg, function() array[3] = {} end)
- assert_error_match(errmsg, function() array[3] = print end)
- assert_error_match(errmsg, function() array[3] = array end)
- end
-
- for k in pairs(numeric_types) do
- test_for_numeric_type(k)
- end
-end
-
-function test_numeric_map()
- local function test_for_numeric_types(key_type, val_type)
- local map = upb.Map(key_type, val_type)
- local key_vals = numeric_types[key_type]
- local val_vals = numeric_types[val_type]
-
- assert_equal(0, #map)
-
- -- Unset keys return nil
- assert_nil(map[key_vals.valid_val])
-
- map[key_vals.valid_val] = val_vals.valid_val
- assert_equal(1, #map)
- assert_equal(val_vals.valid_val, map[key_vals.valid_val])
-
- i = 0
- for k, v in pairs(map) do
- assert_equal(key_vals.valid_val, k)
- assert_equal(val_vals.valid_val, v)
- end
-
- -- Out of range key/val
- local errmsg = "not an integer or out of range"
- if key_vals.too_small then
- assert_error_match(errmsg, function() map[key_vals.too_small] = 1 end)
- end
- if key_vals.too_big then
- assert_error_match(errmsg, function() map[key_vals.too_big] = 1 end)
- end
- if key_vals.other_bad then
- assert_error_match(errmsg, function() map[key_vals.other_bad] = 1 end)
- end
-
- if val_vals.too_small then
- assert_error_match(errmsg, function() map[1] = val_vals.too_small end)
- end
- if val_vals.too_big then
- assert_error_match(errmsg, function() map[1] = val_vals.too_big end)
- end
- if val_vals.other_bad then
- assert_error_match(errmsg, function() map[1] = val_vals.other_bad end)
- end
- end
-
- for k in pairs(numeric_types) do
- for v in pairs(numeric_types) do
- test_for_numeric_types(k, v)
- end
- end
-end
-
-function test_unknown()
- local bytes = string.rep("\x38\x00", 1000)
- for i=1,1000 do
- local msg = upb.decode(test_messages_proto3.TestAllTypesProto3, bytes)
- end
-end
-
-function test_foo()
- local symtab = upb.SymbolTable()
- local filename = "external/com_google_protobuf/descriptor_proto-descriptor-set.proto.bin"
- local file = io.open(filename, "rb") or io.open("bazel-bin/" .. filename, "rb")
- assert_not_nil(file)
- local descriptor = file:read("*a")
- assert_true(#descriptor > 0)
- symtab:add_set(descriptor)
- local FileDescriptorSet = symtab:lookup_msg("google.protobuf.FileDescriptorSet")
- assert_not_nil(FileDescriptorSet)
- set = FileDescriptorSet()
- assert_equal(#set.file, 0)
- assert_error_match("lupb.array expected", function () set.file = 1 end)
-
- set = upb.decode(FileDescriptorSet, descriptor)
-
- -- Test that we can at least call this without crashing.
- set_textformat = tostring(set)
-
- -- print(set_textformat)
- assert_equal(#set.file, 1)
- assert_equal(set.file[1].name, "google/protobuf/descriptor.proto")
-end
-
-function test_descriptor()
- local symtab = upb.SymbolTable()
- local file_proto = descriptor.FileDescriptorProto {
- name = "test.proto",
- message_type = upb.Array(descriptor.DescriptorProto, {
- descriptor.DescriptorProto{
- name = "ABC",
- },
- })
- }
- local file = symtab:add_file(upb.encode(file_proto))
- assert_equal(file:symtab(), symtab)
-end
-
-function test_descriptor_error()
- local symtab = upb.SymbolTable()
- local file = descriptor.FileDescriptorProto()
- file.name = "test.proto"
- file.message_type[1] = descriptor.DescriptorProto{
- name = "ABC"
- }
- file.message_type[2] = descriptor.DescriptorProto{
- name = "BC."
- }
- assert_error(function () symtab:add_file(upb.encode(file)) end)
- assert_nil(symtab:lookup_msg("ABC"))
-end
-
-function test_encode_skipunknown()
- -- Test that upb.ENCODE_SKIPUNKNOWN does not encode unknown fields.
- local msg = test_messages_proto3.TestAllTypesProto3{
- optional_int32 = 10,
- optional_uint32 = 20,
- optional_int64 = 30,
- }
- -- SKIPUNKNOWN here tests that it does *not* affect regular fields.
- local serialized = upb.encode(msg, {upb.ENCODE_SKIPUNKNOWN})
- assert_true(#serialized > 0)
- local empty_with_unknown = upb.decode(empty.Empty, serialized)
- assert_true(#upb.encode(empty_with_unknown) > 0)
- -- Verify that unknown fields are not serialized.
- assert_true(#upb.encode(empty_with_unknown, {upb.ENCODE_SKIPUNKNOWN}) == 0)
-end
-
-function test_json_emit_defaults()
- local msg = test_messages_proto3.TestAllTypesProto3()
- local json = upb.json_encode(msg, {upb.JSONENC_EMITDEFAULTS})
-end
-
-function test_encode_depth_limit()
- local msg = test_messages_proto3.TestAllTypesProto3()
- msg.recursive_message = msg
- assert_error(function() upb.encode(msg) end)
-end
-
-function test_large_field_number()
- local msg = upb_test.TestLargeFieldNumber()
- msg.i32 = 5
- local serialized = upb.encode(msg)
- local msg2 = upb.decode(upb_test.TestLargeFieldNumber, serialized)
- assert_equal(msg.i32, msg2.i32)
-end
-
-function test_gc()
- local top = test_messages_proto3.TestAllTypesProto3()
- local n = 100
- local m
-
- for i=1,n do
- local inner = test_messages_proto3.TestAllTypesProto3()
- m = inner
- for j=1,n do
- local tmp = m
- m = test_messages_proto3.TestAllTypesProto3()
- -- This will cause the arenas to fuse. But we stop referring to the child,
- -- so the Lua object is eligible for collection (and therefore its original
- -- arena can be collected too). Only the fusing will keep the C mem alivd.
- m.recursive_message = tmp
-
- end
- top.recursive_message = m
- end
-
- collectgarbage()
-
- for i=1,n do
- -- Verify we can touch all the messages again and without accessing freed
- -- memory.
- m = m.recursive_message
- assert_not_nil(m)
- end
-end
-
-local stats = lunit.main()
-
-if stats.failed > 0 or stats.errors > 0 then
- error("One or more errors in test suite")
-end
diff --git a/grpc/third_party/upb/tests/conformance_upb.c b/grpc/third_party/upb/tests/conformance_upb.c
deleted file mode 100644
index f444180b..00000000
--- a/grpc/third_party/upb/tests/conformance_upb.c
+++ /dev/null
@@ -1,303 +0,0 @@
-/* This is a upb implementation of the upb conformance tests, see:
- * https://github.com/google/protobuf/tree/master/conformance
- */
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "conformance/conformance.upb.h"
-#include "conformance/conformance.upbdefs.h"
-#include "src/google/protobuf/test_messages_proto2.upbdefs.h"
-#include "src/google/protobuf/test_messages_proto3.upbdefs.h"
-#include "upb/decode.h"
-#include "upb/encode.h"
-#include "upb/reflection.h"
-#include "upb/json_decode.h"
-#include "upb/json_encode.h"
-#include "upb/text_encode.h"
-
-#include "upb/port_def.inc"
-
-int test_count = 0;
-bool verbose = false; /* Set to true to get req/resp printed on stderr. */
-
-bool CheckedRead(int fd, void *buf, size_t len) {
- size_t ofs = 0;
- while (len > 0) {
- ssize_t bytes_read = read(fd, (char*)buf + ofs, len);
-
- if (bytes_read == 0) return false;
-
- if (bytes_read < 0) {
- perror("reading from test runner");
- exit(1);
- }
-
- len -= bytes_read;
- ofs += bytes_read;
- }
-
- return true;
-}
-
-void CheckedWrite(int fd, const void *buf, size_t len) {
- if ((size_t)write(fd, buf, len) != len) {
- perror("writing to test runner");
- exit(1);
- }
-}
-
-typedef struct {
- const conformance_ConformanceRequest *request;
- conformance_ConformanceResponse *response;
- upb_arena *arena;
- const upb_symtab *symtab;
-} ctx;
-
-bool parse_proto(upb_msg *msg, const upb_msgdef *m, const ctx* c) {
- upb_strview proto =
- conformance_ConformanceRequest_protobuf_payload(c->request);
- if (upb_decode(proto.data, proto.size, msg, upb_msgdef_layout(m), c->arena)) {
- return true;
- } else {
- static const char msg[] = "Parse error";
- conformance_ConformanceResponse_set_parse_error(
- c->response, upb_strview_make(msg, strlen(msg)));
- return false;
- }
-}
-
-void serialize_proto(const upb_msg *msg, const upb_msgdef *m, const ctx *c) {
- size_t len;
- char *data = upb_encode(msg, upb_msgdef_layout(m), c->arena, &len);
- if (data) {
- conformance_ConformanceResponse_set_protobuf_payload(
- c->response, upb_strview_make(data, len));
- } else {
- static const char msg[] = "Error serializing.";
- conformance_ConformanceResponse_set_serialize_error(
- c->response, upb_strview_make(msg, strlen(msg)));
- }
-}
-
-void serialize_text(const upb_msg *msg, const upb_msgdef *m, const ctx *c) {
- size_t len;
- size_t len2;
- int opts = 0;
- char *data;
-
- if (!conformance_ConformanceRequest_print_unknown_fields(c->request)) {
- opts |= UPB_TXTENC_SKIPUNKNOWN;
- }
-
- len = upb_text_encode(msg, m, c->symtab, opts, NULL, 0);
- data = upb_arena_malloc(c->arena, len + 1);
- len2 = upb_text_encode(msg, m, c->symtab, opts, data, len + 1);
- UPB_ASSERT(len == len2);
- conformance_ConformanceResponse_set_text_payload(
- c->response, upb_strview_make(data, len));
-}
-
-bool parse_json(upb_msg *msg, const upb_msgdef *m, const ctx* c) {
- upb_strview json =
- conformance_ConformanceRequest_json_payload(c->request);
- upb_status status;
- int opts = 0;
-
- if (conformance_ConformanceRequest_test_category(c->request) ==
- conformance_JSON_IGNORE_UNKNOWN_PARSING_TEST) {
- opts |= UPB_JSONDEC_IGNOREUNKNOWN;
- }
-
- upb_status_clear(&status);
- if (upb_json_decode(json.data, json.size, msg, m, c->symtab, opts, c->arena,
- &status)) {
- return true;
- } else {
- const char *inerr = upb_status_errmsg(&status);
- size_t len = strlen(inerr);
- char *err = upb_arena_malloc(c->arena, len + 1);
- memcpy(err, inerr, strlen(inerr));
- err[len] = '\0';
- conformance_ConformanceResponse_set_parse_error(c->response,
- upb_strview_makez(err));
- return false;
- }
-}
-
-void serialize_json(const upb_msg *msg, const upb_msgdef *m, const ctx *c) {
- size_t len;
- size_t len2;
- int opts = 0;
- char *data;
- upb_status status;
-
- upb_status_clear(&status);
- len = upb_json_encode(msg, m, c->symtab, opts, NULL, 0, &status);
-
- if (len == (size_t)-1) {
- const char *inerr = upb_status_errmsg(&status);
- size_t len = strlen(inerr);
- char *err = upb_arena_malloc(c->arena, len + 1);
- memcpy(err, inerr, strlen(inerr));
- err[len] = '\0';
- conformance_ConformanceResponse_set_serialize_error(c->response,
- upb_strview_makez(err));
- return;
- }
-
- data = upb_arena_malloc(c->arena, len + 1);
- len2 = upb_json_encode(msg, m, c->symtab, opts, data, len + 1, &status);
- UPB_ASSERT(len == len2);
- conformance_ConformanceResponse_set_json_payload(
- c->response, upb_strview_make(data, len));
-}
-
-bool parse_input(upb_msg *msg, const upb_msgdef *m, const ctx* c) {
- switch (conformance_ConformanceRequest_payload_case(c->request)) {
- case conformance_ConformanceRequest_payload_protobuf_payload:
- return parse_proto(msg, m, c);
- case conformance_ConformanceRequest_payload_json_payload:
- return parse_json(msg, m, c);
- case conformance_ConformanceRequest_payload_NOT_SET:
- fprintf(stderr, "conformance_upb: Request didn't have payload.\n");
- return false;
- default: {
- static const char msg[] = "Unsupported input format.";
- conformance_ConformanceResponse_set_skipped(
- c->response, upb_strview_make(msg, strlen(msg)));
- return false;
- }
- }
-}
-
-void write_output(const upb_msg *msg, const upb_msgdef *m, const ctx* c) {
- switch (conformance_ConformanceRequest_requested_output_format(c->request)) {
- case conformance_UNSPECIFIED:
- fprintf(stderr, "conformance_upb: Unspecified output format.\n");
- exit(1);
- case conformance_PROTOBUF:
- serialize_proto(msg, m, c);
- break;
- case conformance_TEXT_FORMAT:
- serialize_text(msg, m, c);
- break;
- case conformance_JSON:
- serialize_json(msg, m, c);
- break;
- default: {
- static const char msg[] = "Unsupported output format.";
- conformance_ConformanceResponse_set_skipped(
- c->response, upb_strview_make(msg, strlen(msg)));
- break;
- }
- }
-}
-
-void DoTest(const ctx* c) {
- upb_msg *msg;
- upb_strview name = conformance_ConformanceRequest_message_type(c->request);
- const upb_msgdef *m = upb_symtab_lookupmsg2(c->symtab, name.data, name.size);
-#if 0
- // Handy code for limiting conformance tests to a single input payload.
- // This is a hack since the conformance runner doesn't give an easy way to
- // specify what test should be run.
- const char skip[] = "\343>\010\301\002\344>\230?\001\230?\002\230?\003";
- upb_strview skip_str = upb_strview_make(skip, sizeof(skip) - 1);
- upb_strview pb_payload =
- conformance_ConformanceRequest_protobuf_payload(c->request);
- if (!upb_strview_eql(pb_payload, skip_str)) m = NULL;
-#endif
-
- if (!m) {
- static const char msg[] = "Unknown message type.";
- conformance_ConformanceResponse_set_skipped(
- c->response, upb_strview_make(msg, strlen(msg)));
- return;
- }
-
- msg = upb_msg_new(m, c->arena);
-
- if (parse_input(msg, m, c)) {
- write_output(msg, m, c);
- }
-}
-
-void debug_print(const char *label, const upb_msg *msg, const upb_msgdef *m,
- const ctx *c) {
- char buf[512];
- upb_text_encode(msg, m, c->symtab, UPB_TXTENC_SINGLELINE, buf, sizeof(buf));
- fprintf(stderr, "%s: %s\n", label, buf);
-}
-
-bool DoTestIo(upb_symtab *symtab) {
- upb_status status;
- char *input;
- char *output;
- uint32_t input_size;
- size_t output_size;
- ctx c;
-
- if (!CheckedRead(STDIN_FILENO, &input_size, sizeof(uint32_t))) {
- /* EOF. */
- return false;
- }
-
- c.symtab = symtab;
- c.arena = upb_arena_new();
- input = upb_arena_malloc(c.arena, input_size);
-
- if (!CheckedRead(STDIN_FILENO, input, input_size)) {
- fprintf(stderr, "conformance_upb: unexpected EOF on stdin.\n");
- exit(1);
- }
-
- c.request = conformance_ConformanceRequest_parse(input, input_size, c.arena);
- c.response = conformance_ConformanceResponse_new(c.arena);
-
- if (c.request) {
- DoTest(&c);
- } else {
- fprintf(stderr, "conformance_upb: parse of ConformanceRequest failed: %s\n",
- upb_status_errmsg(&status));
- }
-
- output = conformance_ConformanceResponse_serialize(c.response, c.arena,
- &output_size);
-
- CheckedWrite(STDOUT_FILENO, &output_size, sizeof(uint32_t));
- CheckedWrite(STDOUT_FILENO, output, output_size);
-
- test_count++;
-
- if (verbose) {
- debug_print("Request", c.request,
- conformance_ConformanceRequest_getmsgdef(symtab), &c);
- debug_print("Response", c.response,
- conformance_ConformanceResponse_getmsgdef(symtab), &c);
- fprintf(stderr, "\n");
- }
-
- upb_arena_free(c.arena);
-
- return true;
-}
-
-int main(void) {
- upb_symtab *symtab = upb_symtab_new();
-
- protobuf_test_messages_proto2_TestAllTypesProto2_getmsgdef(symtab);
- protobuf_test_messages_proto3_TestAllTypesProto3_getmsgdef(symtab);
-
- while (1) {
- if (!DoTestIo(symtab)) {
- fprintf(stderr, "conformance_upb: received EOF from test runner "
- "after %d tests, exiting\n", test_count);
- upb_symtab_free(symtab);
- return 0;
- }
- }
-}
diff --git a/grpc/third_party/upb/tests/conformance_upb_failures.txt b/grpc/third_party/upb/tests/conformance_upb_failures.txt
deleted file mode 100644
index d9290df9..00000000
--- a/grpc/third_party/upb/tests/conformance_upb_failures.txt
+++ /dev/null
@@ -1 +0,0 @@
-Recommended.Proto2.JsonInput.FieldNameExtension.Validator
diff --git a/grpc/third_party/upb/tests/corpus/README b/grpc/third_party/upb/tests/corpus/README
deleted file mode 100644
index 9bd8f1e9..00000000
--- a/grpc/third_party/upb/tests/corpus/README
+++ /dev/null
@@ -1 +0,0 @@
-Corpus folder for fuzzing
diff --git a/grpc/third_party/upb/tests/corpus/temp.cc b/grpc/third_party/upb/tests/corpus/temp.cc
deleted file mode 100644
index 2bf1160c..00000000
--- a/grpc/third_party/upb/tests/corpus/temp.cc
+++ /dev/null
@@ -1 +0,0 @@
-// Hello World
diff --git a/grpc/third_party/upb/tests/empty.proto b/grpc/third_party/upb/tests/empty.proto
deleted file mode 100644
index fb457966..00000000
--- a/grpc/third_party/upb/tests/empty.proto
+++ /dev/null
@@ -1,2 +0,0 @@
-syntax = "proto2";
-
diff --git a/grpc/third_party/upb/tests/file_descriptor_parsenew_fuzzer.cc b/grpc/third_party/upb/tests/file_descriptor_parsenew_fuzzer.cc
deleted file mode 100644
index 966a4680..00000000
--- a/grpc/third_party/upb/tests/file_descriptor_parsenew_fuzzer.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <cstdint>
-
-#include "google/protobuf/descriptor.upb.h"
-#include "upb/upb.hpp"
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- upb::Arena arena;
- google_protobuf_FileDescriptorProto_parse(reinterpret_cast<const char*>(data),
- size, arena.ptr());
- return 0;
-}
-
-#ifndef HAVE_FUZZER
-int main() {}
-#endif
diff --git a/grpc/third_party/upb/tests/json/enum_from_separate_file.proto b/grpc/third_party/upb/tests/json/enum_from_separate_file.proto
deleted file mode 100644
index ceb9b42a..00000000
--- a/grpc/third_party/upb/tests/json/enum_from_separate_file.proto
+++ /dev/null
@@ -1,9 +0,0 @@
-syntax = "proto2";
-
-import "tests/json/test.proto";
-
-package upb.test.json;
-
-message ImportEnum {
- optional MyEnum e = 1;
-}
diff --git a/grpc/third_party/upb/tests/json/test.proto b/grpc/third_party/upb/tests/json/test.proto
deleted file mode 100644
index 2db0388d..00000000
--- a/grpc/third_party/upb/tests/json/test.proto
+++ /dev/null
@@ -1,47 +0,0 @@
-syntax = "proto3";
-
-package upb.test.json;
-
-message TestMessage {
- int32 optional_int32 = 1;
- int64 optional_int64 = 2;
- int32 optional_uint32 = 3;
- int64 optional_uint64 = 4;
- string optional_string = 5;
- bytes optional_bytes = 6;
- bool optional_bool = 7;
- SubMessage optional_msg = 8;
- MyEnum optional_enum = 9;
-
- repeated int32 repeated_int32 = 11;
- repeated int64 repeated_int64 = 12;
- repeated uint32 repeated_uint32 = 13;
- repeated uint64 repeated_uint64 = 14;
- repeated string repeated_string = 15;
- repeated bytes repeated_bytes = 16;
- repeated bool repeated_bool = 17;
- repeated SubMessage repeated_msg = 18;
- repeated MyEnum repeated_enum = 19;
-
- map<string, string> map_string_string = 20;
- map<int32, string> map_int32_string = 21;
- map<bool, string> map_bool_string = 22;
- map<string, int32> map_string_int32 = 23;
- map<string, bool> map_string_bool = 24;
- map<string, SubMessage> map_string_msg = 25;
-
- oneof o {
- int32 oneof_int32 = 26;
- int64 oneof_int64 = 27;
- }
-}
-
-message SubMessage {
- int32 foo = 1;
-}
-
-enum MyEnum {
- A = 0;
- B = 1;
- C = 2;
-}
diff --git a/grpc/third_party/upb/tests/json/test.proto.pb b/grpc/third_party/upb/tests/json/test.proto.pb
deleted file mode 100644
index 94b8b92e..00000000
--- a/grpc/third_party/upb/tests/json/test.proto.pb
+++ /dev/null
Binary files differ
diff --git a/grpc/third_party/upb/tests/json/test_json.cc b/grpc/third_party/upb/tests/json/test_json.cc
deleted file mode 100644
index 18ab07fe..00000000
--- a/grpc/third_party/upb/tests/json/test_json.cc
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- *
- * A set of tests for JSON parsing and serialization.
- */
-
-#include <string>
-
-#include "tests/json/test.upb.h" // Test that it compiles for C++.
-#include "tests/json/test.upbdefs.h"
-#include "tests/test_util.h"
-#include "tests/upb_test.h"
-#include "upb/def.hpp"
-#include "upb/handlers.h"
-#include "upb/json/parser.h"
-#include "upb/json/printer.h"
-#include "upb/port_def.inc"
-#include "upb/upb.h"
-
-// Macros for readability in test case list: allows us to give TEST("...") /
-// EXPECT("...") pairs.
-#define TEST(x) x
-#define EXPECT_SAME NULL
-#define EXPECT(x) x
-#define TEST_SENTINEL { NULL, NULL }
-
-struct TestCase {
- const char* input;
- const char* expected;
-};
-
-bool verbose = false;
-
-static TestCase kTestRoundtripMessages[] = {
- // Test most fields here.
- {
- TEST("{\"optionalInt32\":-42,\"optionalString\":\"Test\\u0001Message\","
- "\"optionalMsg\":{\"foo\":42},"
- "\"optionalBool\":true,\"repeatedMsg\":[{\"foo\":1},"
- "{\"foo\":2}]}"),
- EXPECT_SAME
- },
- // We must also recognize raw proto names.
- {
- TEST("{\"optional_int32\":-42,\"optional_string\":\"Test\\u0001Message\","
- "\"optional_msg\":{\"foo\":42},"
- "\"optional_bool\":true,\"repeated_msg\":[{\"foo\":1},"
- "{\"foo\":2}]}"),
- EXPECT("{\"optionalInt32\":-42,\"optionalString\":\"Test\\u0001Message\","
- "\"optionalMsg\":{\"foo\":42},"
- "\"optionalBool\":true,\"repeatedMsg\":[{\"foo\":1},"
- "{\"foo\":2}]}")
- },
- // Test special escapes in strings.
- {
- TEST("{\"repeatedString\":[\"\\b\",\"\\r\",\"\\n\",\"\\f\",\"\\t\","
- "\"\uFFFF\"]}"),
- EXPECT_SAME
- },
- // Test enum symbolic names.
- {
- // The common case: parse and print the symbolic name.
- TEST("{\"optionalEnum\":\"A\"}"),
- EXPECT_SAME
- },
- {
- // Unknown enum value: will be printed as an integer.
- TEST("{\"optionalEnum\":42}"),
- EXPECT_SAME
- },
- {
- // Known enum value: we're happy to parse an integer but we will re-emit the
- // symbolic name.
- TEST("{\"optionalEnum\":1}"),
- EXPECT("{\"optionalEnum\":\"B\"}")
- },
- // UTF-8 tests: escapes -> literal UTF8 in output.
- {
- // Note double escape on \uXXXX: we want the escape to be processed by the
- // JSON parser, not by the C++ compiler!
- TEST("{\"optionalString\":\"\\u007F\"}"),
- EXPECT("{\"optionalString\":\"\x7F\"}")
- },
- {
- TEST("{\"optionalString\":\"\\u0080\"}"),
- EXPECT("{\"optionalString\":\"\xC2\x80\"}")
- },
- {
- TEST("{\"optionalString\":\"\\u07FF\"}"),
- EXPECT("{\"optionalString\":\"\xDF\xBF\"}")
- },
- {
- TEST("{\"optionalString\":\"\\u0800\"}"),
- EXPECT("{\"optionalString\":\"\xE0\xA0\x80\"}")
- },
- {
- TEST("{\"optionalString\":\"\\uFFFF\"}"),
- EXPECT("{\"optionalString\":\"\xEF\xBF\xBF\"}")
- },
- // map-field tests
- {
- TEST("{\"mapStringString\":{\"a\":\"value1\",\"b\":\"value2\","
- "\"c\":\"value3\"}}"),
- EXPECT_SAME
- },
- {
- TEST("{\"mapInt32String\":{\"1\":\"value1\",\"-1\":\"value2\","
- "\"1234\":\"value3\"}}"),
- EXPECT_SAME
- },
- {
- TEST("{\"mapBoolString\":{\"false\":\"value1\",\"true\":\"value2\"}}"),
- EXPECT_SAME
- },
- {
- TEST("{\"mapStringInt32\":{\"asdf\":1234,\"jkl;\":-1}}"),
- EXPECT_SAME
- },
- {
- TEST("{\"mapStringBool\":{\"asdf\":true,\"jkl;\":false}}"),
- EXPECT_SAME
- },
- {
- TEST("{\"mapStringMsg\":{\"asdf\":{\"foo\":42},\"jkl;\":{\"foo\":84}}}"),
- EXPECT_SAME
- },
- TEST_SENTINEL
-};
-
-static TestCase kTestRoundtripMessagesPreserve[] = {
- // Test most fields here.
- {
- TEST("{\"optional_int32\":-42,\"optional_string\":\"Test\\u0001Message\","
- "\"optional_msg\":{\"foo\":42},"
- "\"optional_bool\":true,\"repeated_msg\":[{\"foo\":1},"
- "{\"foo\":2}]}"),
- EXPECT_SAME
- },
- TEST_SENTINEL
-};
-
-static TestCase kTestSkipUnknown[] = {
- {
- TEST("{\"optionalEnum\":\"UNKNOWN_ENUM_VALUE\"}"),
- EXPECT("{}"),
- },
- TEST_SENTINEL
-};
-
-static TestCase kTestFailure[] = {
- {
- TEST("{\"optionalEnum\":\"UNKNOWN_ENUM_VALUE\"}"),
- EXPECT("{}"), /* Actually we expect error, this is checked later. */
- },
- TEST_SENTINEL
-};
-
-class StringSink {
- public:
- StringSink() {
- upb_byteshandler_init(&byteshandler_);
- upb_byteshandler_setstring(&byteshandler_, &str_handler, NULL);
- upb_bytessink_reset(&bytessink_, &byteshandler_, &s_);
- }
- ~StringSink() { }
-
- upb_bytessink Sink() { return bytessink_; }
-
- const std::string& Data() { return s_; }
-
- private:
-
- static size_t str_handler(void* _closure, const void* hd,
- const char* data, size_t len,
- const upb_bufhandle* handle) {
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
- std::string* s = static_cast<std::string*>(_closure);
- std::string appended(data, len);
- s->append(data, len);
- return len;
- }
-
- upb_byteshandler byteshandler_;
- upb_bytessink bytessink_;
- std::string s_;
-};
-
-void test_json_roundtrip_message(const char* json_src,
- const char* json_expected,
- const upb::Handlers* serialize_handlers,
- const upb::json::ParserMethodPtr parser_method,
- int seam,
- bool ignore_unknown) {
- VerboseParserEnvironment env(verbose);
- StringSink data_sink;
- upb::json::PrinterPtr printer = upb::json::PrinterPtr::Create(
- env.arena(), serialize_handlers, data_sink.Sink());
- upb::json::ParserPtr parser = upb::json::ParserPtr::Create(
- env.arena(), parser_method, NULL, printer.input(),
- env.status(), ignore_unknown);
- env.ResetBytesSink(parser.input());
- env.Reset(json_src, strlen(json_src), false, false);
-
- bool ok = env.Start() &&
- env.ParseBuffer(seam) &&
- env.ParseBuffer(-1) &&
- env.End();
-
- ASSERT(ok);
- ASSERT(env.CheckConsistency());
-
- if (memcmp(json_expected,
- data_sink.Data().data(),
- data_sink.Data().size())) {
- fprintf(stderr,
- "JSON parse/serialize roundtrip result differs:\n"
- "Expected:\n%s\nParsed/Serialized:\n%s\n",
- json_expected, data_sink.Data().c_str());
- abort();
- }
-}
-
-// Starts with a message in JSON format, parses and directly serializes again,
-// and compares the result.
-void test_json_roundtrip() {
- upb::SymbolTable symtab;
- upb::HandlerCache serialize_handlercache(
- upb::json::PrinterPtr::NewCache(false));
- upb::json::CodeCache parse_codecache;
-
- upb::MessageDefPtr md(upb_test_json_TestMessage_getmsgdef(symtab.ptr()));
- ASSERT(md);
- const upb::Handlers* serialize_handlers = serialize_handlercache.Get(md);
- const upb::json::ParserMethodPtr parser_method = parse_codecache.Get(md);
- ASSERT(serialize_handlers);
-
- for (const TestCase* test_case = kTestRoundtripMessages;
- test_case->input != NULL; test_case++) {
- const char *expected =
- (test_case->expected == EXPECT_SAME) ?
- test_case->input :
- test_case->expected;
-
- for (size_t i = 0; i < strlen(test_case->input); i++) {
- test_json_roundtrip_message(test_case->input, expected,
- serialize_handlers, parser_method, (int)i,
- false);
- }
- }
-
- // Tests ignore unknown.
- for (const TestCase* test_case = kTestSkipUnknown;
- test_case->input != NULL; test_case++) {
- const char *expected =
- (test_case->expected == EXPECT_SAME) ?
- test_case->input :
- test_case->expected;
-
- for (size_t i = 0; i < strlen(test_case->input); i++) {
- test_json_roundtrip_message(test_case->input, expected,
- serialize_handlers, parser_method, (int)i,
- true);
- }
- }
-
- serialize_handlercache = upb::json::PrinterPtr::NewCache(true);
- serialize_handlers = serialize_handlercache.Get(md);
-
- for (const TestCase* test_case = kTestRoundtripMessagesPreserve;
- test_case->input != NULL; test_case++) {
- const char *expected =
- (test_case->expected == EXPECT_SAME) ?
- test_case->input :
- test_case->expected;
-
- for (size_t i = 0; i < strlen(test_case->input); i++) {
- test_json_roundtrip_message(test_case->input, expected,
- serialize_handlers, parser_method, (int)i,
- false);
- }
- }
-}
-
-void test_json_parse_failure(const char* json_src,
- const upb::Handlers* serialize_handlers,
- const upb::json::ParserMethodPtr parser_method,
- int seam) {
- VerboseParserEnvironment env(verbose);
- StringSink data_sink;
- upb::json::PrinterPtr printer = upb::json::PrinterPtr::Create(
- env.arena(), serialize_handlers, data_sink.Sink());
- upb::json::ParserPtr parser = upb::json::ParserPtr::Create(
- env.arena(), parser_method, NULL, printer.input(), env.status(), false);
- env.ResetBytesSink(parser.input());
- env.Reset(json_src, strlen(json_src), false, true);
-
- bool ok = env.Start() &&
- env.ParseBuffer(seam) &&
- env.ParseBuffer(-1) &&
- env.End();
-
- ASSERT(!ok);
- ASSERT(env.CheckConsistency());
-}
-
-// Starts with a proto message in JSON format, parses and expects failre.
-void test_json_failure() {
- upb::SymbolTable symtab;
- upb::HandlerCache serialize_handlercache(
- upb::json::PrinterPtr::NewCache(false));
- upb::json::CodeCache parse_codecache;
-
- upb::MessageDefPtr md(upb_test_json_TestMessage_getmsgdef(symtab.ptr()));
- ASSERT(md);
- const upb::Handlers* serialize_handlers = serialize_handlercache.Get(md);
- const upb::json::ParserMethodPtr parser_method = parse_codecache.Get(md);
- ASSERT(serialize_handlers);
-
- for (const TestCase* test_case = kTestFailure;
- test_case->input != NULL; test_case++) {
- for (size_t i = 0; i < strlen(test_case->input); i++) {
- test_json_parse_failure(test_case->input, serialize_handlers,
- parser_method, (int)i);
- }
- }
-}
-
-extern "C" {
-int run_tests(int argc, char *argv[]) {
- UPB_UNUSED(argc);
- UPB_UNUSED(argv);
- test_json_roundtrip();
- test_json_failure();
- return 0;
-}
-}
diff --git a/grpc/third_party/upb/tests/pb/test_decoder.cc b/grpc/third_party/upb/tests/pb/test_decoder.cc
deleted file mode 100644
index 110dd2f9..00000000
--- a/grpc/third_party/upb/tests/pb/test_decoder.cc
+++ /dev/null
@@ -1,1194 +0,0 @@
-/*
- *
- * An exhaustive set of tests for parsing both valid and invalid protobuf
- * input, with buffer breaks in arbitrary places.
- *
- * Tests to add:
- * - string/bytes
- * - unknown field handler called appropriately
- * - unknown fields can be inserted in random places
- * - fuzzing of valid input
- * - resource limits (max stack depth, max string len)
- * - testing of groups
- * - more throrough testing of sequences
- * - test skipping of submessages
- * - test suspending the decoder
- * - buffers that are close enough to the end of the address space that
- * pointers overflow (this might be difficult).
- * - a few "kitchen sink" examples (one proto that uses all types, lots
- * of submsg/sequences, etc.
- * - test different handlers at every level and whether handlers fire at
- * the correct field path.
- * - test skips that extend past the end of current buffer (where decoder
- * returns value greater than the size param).
- */
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS // For PRIuS, etc.
-#endif
-
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sstream>
-
-#include "tests/test_util.h"
-#include "tests/upb_test.h"
-#include "tests/pb/test_decoder.upbdefs.h"
-
-#ifdef AMALGAMATED
-#include "upb.h"
-#else // AMALGAMATED
-#include "upb/handlers.h"
-#include "upb/pb/decoder.h"
-#include "upb/upb.h"
-#endif // !AMALGAMATED
-
-#include "upb/port_def.inc"
-
-#undef PRINT_FAILURE
-#define PRINT_FAILURE(expr) \
- fprintf(stderr, "Assertion failed: %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, "expr: %s\n", #expr); \
-
-#define MAX_NESTING 64
-
-#define LINE(x) x "\n"
-
-uint32_t filter_hash = 0;
-double completed;
-double total;
-double *count;
-
-enum TestMode {
- COUNT_ONLY = 1,
- NO_HANDLERS = 2,
- ALL_HANDLERS = 3
-} test_mode;
-
-// Copied from decoder.c, since this is not a public interface.
-typedef struct {
- uint8_t native_wire_type;
- bool is_numeric;
-} upb_decoder_typeinfo;
-
-static const upb_decoder_typeinfo upb_decoder_types[] = {
- {UPB_WIRE_TYPE_END_GROUP, false}, // ENDGROUP
- {UPB_WIRE_TYPE_64BIT, true}, // DOUBLE
- {UPB_WIRE_TYPE_32BIT, true}, // FLOAT
- {UPB_WIRE_TYPE_VARINT, true}, // INT64
- {UPB_WIRE_TYPE_VARINT, true}, // UINT64
- {UPB_WIRE_TYPE_VARINT, true}, // INT32
- {UPB_WIRE_TYPE_64BIT, true}, // FIXED64
- {UPB_WIRE_TYPE_32BIT, true}, // FIXED32
- {UPB_WIRE_TYPE_VARINT, true}, // BOOL
- {UPB_WIRE_TYPE_DELIMITED, false}, // STRING
- {UPB_WIRE_TYPE_START_GROUP, false}, // GROUP
- {UPB_WIRE_TYPE_DELIMITED, false}, // MESSAGE
- {UPB_WIRE_TYPE_DELIMITED, false}, // BYTES
- {UPB_WIRE_TYPE_VARINT, true}, // UINT32
- {UPB_WIRE_TYPE_VARINT, true}, // ENUM
- {UPB_WIRE_TYPE_32BIT, true}, // SFIXED32
- {UPB_WIRE_TYPE_64BIT, true}, // SFIXED64
- {UPB_WIRE_TYPE_VARINT, true}, // SINT32
- {UPB_WIRE_TYPE_VARINT, true}, // SINT64
-};
-
-#ifndef USE_GOOGLE
-using std::string;
-#endif
-
-void vappendf(string* str, const char *format, va_list args) {
- va_list copy;
- va_copy(copy, args);
-
- int count = vsnprintf(NULL, 0, format, args);
- if (count >= 0)
- {
- UPB_ASSERT(count < 32768);
- char *buffer = new char[count + 1];
- UPB_ASSERT(buffer);
- count = vsnprintf(buffer, count + 1, format, copy);
- UPB_ASSERT(count >= 0);
- str->append(buffer, count);
- delete [] buffer;
- }
- va_end(copy);
-}
-
-void appendf(string* str, const char *fmt, ...) {
- va_list args;
- va_start(args, fmt);
- vappendf(str, fmt, args);
- va_end(args);
-}
-
-void PrintBinary(const string& str) {
- for (size_t i = 0; i < str.size(); i++) {
- if (isprint(str[i])) {
- fprintf(stderr, "%c", str[i]);
- } else {
- fprintf(stderr, "\\x%02x", (int)(uint8_t)str[i]);
- }
- }
-}
-
-#define UPB_PB_VARINT_MAX_LEN 10
-
-static size_t upb_vencode64(uint64_t val, char *buf) {
- size_t i;
- if (val == 0) { buf[0] = 0; return 1; }
- i = 0;
- while (val) {
- uint8_t byte = val & 0x7fU;
- val >>= 7;
- if (val) byte |= 0x80U;
- buf[i++] = byte;
- }
- return i;
-}
-
-static uint32_t upb_zzenc_32(int32_t n) {
- return ((uint32_t)n << 1) ^ (n >> 31);
-}
-
-static uint64_t upb_zzenc_64(int64_t n) {
- return ((uint64_t)n << 1) ^ (n >> 63);
-}
-
-/* Routines for building arbitrary protos *************************************/
-
-const string empty;
-
-string cat(const string& a, const string& b,
- const string& c = empty,
- const string& d = empty,
- const string& e = empty,
- const string& f = empty,
- const string& g = empty,
- const string& h = empty,
- const string& i = empty,
- const string& j = empty,
- const string& k = empty,
- const string& l = empty) {
- string ret;
- ret.reserve(a.size() + b.size() + c.size() + d.size() + e.size() + f.size() +
- g.size() + h.size() + i.size() + j.size() + k.size() + l.size());
- ret.append(a);
- ret.append(b);
- ret.append(c);
- ret.append(d);
- ret.append(e);
- ret.append(f);
- ret.append(g);
- ret.append(h);
- ret.append(i);
- ret.append(j);
- ret.append(k);
- ret.append(l);
- return ret;
-}
-
-template <typename T>
-string num2string(T num) {
- std::ostringstream ss;
- ss << num;
- return ss.str();
-}
-
-string varint(uint64_t x) {
- char buf[UPB_PB_VARINT_MAX_LEN];
- size_t len = upb_vencode64(x, buf);
- return string(buf, len);
-}
-
-// TODO: proper byte-swapping for big-endian machines.
-string fixed32(void *data) { return string(static_cast<char*>(data), 4); }
-string fixed64(void *data) { return string(static_cast<char*>(data), 8); }
-
-string delim(const string& buf) { return cat(varint(buf.size()), buf); }
-string uint32(uint32_t u32) { return fixed32(&u32); }
-string uint64(uint64_t u64) { return fixed64(&u64); }
-string flt(float f) { return fixed32(&f); }
-string dbl(double d) { return fixed64(&d); }
-string zz32(int32_t x) { return varint(upb_zzenc_32(x)); }
-string zz64(int64_t x) { return varint(upb_zzenc_64(x)); }
-
-string tag(uint32_t fieldnum, char wire_type) {
- return varint((fieldnum << 3) | wire_type);
-}
-
-string submsg(uint32_t fn, const string& buf) {
- return cat( tag(fn, UPB_WIRE_TYPE_DELIMITED), delim(buf) );
-}
-
-string group(uint32_t fn, const string& buf) {
- return cat(tag(fn, UPB_WIRE_TYPE_START_GROUP), buf,
- tag(fn, UPB_WIRE_TYPE_END_GROUP));
-}
-
-// Like delim()/submsg(), but intentionally encodes an incorrect length.
-// These help test when a delimited boundary doesn't land in the right place.
-string badlen_delim(int err, const string& buf) {
- return cat(varint(buf.size() + err), buf);
-}
-
-string badlen_submsg(int err, uint32_t fn, const string& buf) {
- return cat( tag(fn, UPB_WIRE_TYPE_DELIMITED), badlen_delim(err, buf) );
-}
-
-
-/* A set of handlers that covers all .proto types *****************************/
-
-// The handlers simply append to a string indicating what handlers were called.
-// This string is similar to protobuf text format but fields are referred to by
-// number instead of name and sequences are explicitly delimited. We indent
-// using the closure depth to test that the stack of closures is properly
-// handled.
-
-int closures[MAX_NESTING];
-string output;
-
-void indentbuf(string *buf, int depth) {
- buf->append(2 * depth, ' ');
-}
-
-#define NUMERIC_VALUE_HANDLER(member, ctype, fmt) \
- bool value_##member(int* depth, const uint32_t* num, ctype val) { \
- indentbuf(&output, *depth); \
- appendf(&output, "%" PRIu32 ":%" fmt "\n", *num, val); \
- return true; \
- }
-
-NUMERIC_VALUE_HANDLER(uint32, uint32_t, PRIu32)
-NUMERIC_VALUE_HANDLER(uint64, uint64_t, PRIu64)
-NUMERIC_VALUE_HANDLER(int32, int32_t, PRId32)
-NUMERIC_VALUE_HANDLER(int64, int64_t, PRId64)
-NUMERIC_VALUE_HANDLER(float, float, "g")
-NUMERIC_VALUE_HANDLER(double, double, "g")
-
-bool value_bool(int* depth, const uint32_t* num, bool val) {
- indentbuf(&output, *depth);
- appendf(&output, "%" PRIu32 ":%s\n", *num, val ? "true" : "false");
- return true;
-}
-
-int* startstr(int* depth, const uint32_t* num, size_t size_hint) {
- indentbuf(&output, *depth);
- appendf(&output, "%" PRIu32 ":(%zu)\"", *num, size_hint);
- return depth + 1;
-}
-
-size_t value_string(int* depth, const uint32_t* num, const char* buf,
- size_t n, const upb_bufhandle* handle) {
- UPB_UNUSED(num);
- UPB_UNUSED(depth);
- output.append(buf, n);
- ASSERT(handle == &global_handle);
- return n;
-}
-
-bool endstr(int* depth, const uint32_t* num) {
- UPB_UNUSED(num);
- output.append("\n");
- indentbuf(&output, *depth);
- appendf(&output, "%" PRIu32 ":\"\n", *num);
- return true;
-}
-
-int* startsubmsg(int* depth, const uint32_t* num) {
- indentbuf(&output, *depth);
- appendf(&output, "%" PRIu32 ":{\n", *num);
- return depth + 1;
-}
-
-bool endsubmsg(int* depth, const uint32_t* num) {
- UPB_UNUSED(num);
- indentbuf(&output, *depth);
- output.append("}\n");
- return true;
-}
-
-int* startseq(int* depth, const uint32_t* num) {
- indentbuf(&output, *depth);
- appendf(&output, "%" PRIu32 ":[\n", *num);
- return depth + 1;
-}
-
-bool endseq(int* depth, const uint32_t* num) {
- UPB_UNUSED(num);
- indentbuf(&output, *depth);
- output.append("]\n");
- return true;
-}
-
-bool startmsg(int* depth) {
- indentbuf(&output, *depth);
- output.append("<\n");
- return true;
-}
-
-bool endmsg(int* depth, upb_status* status) {
- UPB_UNUSED(status);
- indentbuf(&output, *depth);
- output.append(">\n");
- return true;
-}
-
-void free_uint32(void *val) {
- uint32_t *u32 = static_cast<uint32_t*>(val);
- delete u32;
-}
-
-template<class T, bool F(int*, const uint32_t*, T)>
-void doreg(upb::HandlersPtr h, uint32_t num) {
- upb::FieldDefPtr f = h.message_def().FindFieldByNumber(num);
- ASSERT(f);
- ASSERT(h.SetValueHandler<T>(f, UpbBind(F, new uint32_t(num))));
- if (f.IsSequence()) {
- ASSERT(h.SetStartSequenceHandler(f, UpbBind(startseq, new uint32_t(num))));
- ASSERT(h.SetEndSequenceHandler(f, UpbBind(endseq, new uint32_t(num))));
- }
-}
-
-// The repeated field number to correspond to the given non-repeated field
-// number.
-uint32_t rep_fn(uint32_t fn) {
- return (UPB_MAX_FIELDNUMBER - 1000) + fn;
-}
-
-#define NOP_FIELD 40
-#define UNKNOWN_FIELD 666
-
-template <class T, bool F(int*, const uint32_t*, T)>
-void reg(upb::HandlersPtr h, upb_descriptortype_t type) {
- // We register both a repeated and a non-repeated field for every type.
- // For the non-repeated field we make the field number the same as the
- // type. For the repeated field we make it a function of the type.
- doreg<T, F>(h, type);
- doreg<T, F>(h, rep_fn(type));
-}
-
-void regseq(upb::HandlersPtr h, upb::FieldDefPtr f, uint32_t num) {
- ASSERT(h.SetStartSequenceHandler(f, UpbBind(startseq, new uint32_t(num))));
- ASSERT(h.SetEndSequenceHandler(f, UpbBind(endseq, new uint32_t(num))));
-}
-
-void reg_subm(upb::HandlersPtr h, uint32_t num) {
- upb::FieldDefPtr f = h.message_def().FindFieldByNumber(num);
- ASSERT(f);
- if (f.IsSequence()) regseq(h, f, num);
- ASSERT(
- h.SetStartSubMessageHandler(f, UpbBind(startsubmsg, new uint32_t(num))));
- ASSERT(h.SetEndSubMessageHandler(f, UpbBind(endsubmsg, new uint32_t(num))));
-}
-
-void reg_str(upb::HandlersPtr h, uint32_t num) {
- upb::FieldDefPtr f = h.message_def().FindFieldByNumber(num);
- ASSERT(f);
- if (f.IsSequence()) regseq(h, f, num);
- ASSERT(h.SetStartStringHandler(f, UpbBind(startstr, new uint32_t(num))));
- ASSERT(h.SetEndStringHandler(f, UpbBind(endstr, new uint32_t(num))));
- ASSERT(h.SetStringHandler(f, UpbBind(value_string, new uint32_t(num))));
-}
-
-struct HandlerRegisterData {
- TestMode mode;
-};
-
-void callback(const void *closure, upb::Handlers* h_ptr) {
- upb::HandlersPtr h(h_ptr);
- const HandlerRegisterData* data =
- static_cast<const HandlerRegisterData*>(closure);
- if (data->mode == ALL_HANDLERS) {
- h.SetStartMessageHandler(UpbMakeHandler(startmsg));
- h.SetEndMessageHandler(UpbMakeHandler(endmsg));
-
- // Register handlers for each type.
- reg<double, value_double>(h, UPB_DESCRIPTOR_TYPE_DOUBLE);
- reg<float, value_float> (h, UPB_DESCRIPTOR_TYPE_FLOAT);
- reg<int64_t, value_int64> (h, UPB_DESCRIPTOR_TYPE_INT64);
- reg<uint64_t, value_uint64>(h, UPB_DESCRIPTOR_TYPE_UINT64);
- reg<int32_t, value_int32> (h, UPB_DESCRIPTOR_TYPE_INT32);
- reg<uint64_t, value_uint64>(h, UPB_DESCRIPTOR_TYPE_FIXED64);
- reg<uint32_t, value_uint32>(h, UPB_DESCRIPTOR_TYPE_FIXED32);
- reg<bool, value_bool> (h, UPB_DESCRIPTOR_TYPE_BOOL);
- reg<uint32_t, value_uint32>(h, UPB_DESCRIPTOR_TYPE_UINT32);
- reg<int32_t, value_int32> (h, UPB_DESCRIPTOR_TYPE_ENUM);
- reg<int32_t, value_int32> (h, UPB_DESCRIPTOR_TYPE_SFIXED32);
- reg<int64_t, value_int64> (h, UPB_DESCRIPTOR_TYPE_SFIXED64);
- reg<int32_t, value_int32> (h, UPB_DESCRIPTOR_TYPE_SINT32);
- reg<int64_t, value_int64> (h, UPB_DESCRIPTOR_TYPE_SINT64);
-
- reg_str(h, UPB_DESCRIPTOR_TYPE_STRING);
- reg_str(h, UPB_DESCRIPTOR_TYPE_BYTES);
- reg_str(h, rep_fn(UPB_DESCRIPTOR_TYPE_STRING));
- reg_str(h, rep_fn(UPB_DESCRIPTOR_TYPE_BYTES));
-
- // Register submessage/group handlers that are self-recursive
- // to this type, eg: message M { optional M m = 1; }
- reg_subm(h, UPB_DESCRIPTOR_TYPE_MESSAGE);
- reg_subm(h, rep_fn(UPB_DESCRIPTOR_TYPE_MESSAGE));
-
- if (h.message_def().full_name() == std::string("DecoderTest")) {
- reg_subm(h, UPB_DESCRIPTOR_TYPE_GROUP);
- reg_subm(h, rep_fn(UPB_DESCRIPTOR_TYPE_GROUP));
- }
-
- // For NOP_FIELD we register no handlers, so we can pad a proto freely without
- // changing the output.
- }
-}
-
-/* Running of test cases ******************************************************/
-
-const upb::Handlers *global_handlers;
-upb::pb::DecoderMethodPtr global_method;
-
-upb::pb::DecoderPtr CreateDecoder(upb::Arena* arena,
- upb::pb::DecoderMethodPtr method,
- upb::Sink sink, upb::Status* status) {
- upb::pb::DecoderPtr ret =
- upb::pb::DecoderPtr::Create(arena, method, sink, status);
- ret.set_max_nesting(MAX_NESTING);
- return ret;
-}
-
-void CheckBytesParsed(upb::pb::DecoderPtr decoder, size_t ofs) {
- // We can't have parsed more data than the decoder callback is telling us it
- // parsed.
- ASSERT(decoder.BytesParsed() <= ofs);
-
- // The difference between what we've decoded and what the decoder has accepted
- // represents the internally buffered amount. This amount should not exceed
- // this value which comes from decoder.int.h.
- ASSERT(ofs <= (decoder.BytesParsed() + UPB_DECODER_MAX_RESIDUAL_BYTES));
-}
-
-static bool parse(VerboseParserEnvironment* env,
- upb::pb::DecoderPtr decoder, int bytes) {
- CheckBytesParsed(decoder, env->ofs());
- bool ret = env->ParseBuffer(bytes);
- if (ret) {
- CheckBytesParsed(decoder, env->ofs());
- }
-
- return ret;
-}
-
-void do_run_decoder(VerboseParserEnvironment* env, upb::pb::DecoderPtr decoder,
- const string& proto, const string* expected_output,
- size_t i, size_t j, bool may_skip) {
- env->Reset(proto.c_str(), proto.size(), may_skip, expected_output == NULL);
- decoder.Reset();
-
- if (test_mode != COUNT_ONLY) {
- output.clear();
-
- if (filter_hash) {
- fprintf(stderr, "RUNNING TEST CASE\n");
- fprintf(stderr, "Input (len=%u): ", (unsigned)proto.size());
- PrintBinary(proto);
- fprintf(stderr, "\n");
- if (expected_output) {
- if (test_mode == ALL_HANDLERS) {
- fprintf(stderr, "Expected output: %s\n", expected_output->c_str());
- } else if (test_mode == NO_HANDLERS) {
- fprintf(stderr,
- "No handlers are registered, BUT if they were "
- "the expected output would be: %s\n",
- expected_output->c_str());
- }
- } else {
- fprintf(stderr, "Expected to FAIL\n");
- }
- }
-
- bool ok = env->Start() &&
- parse(env, decoder, (int)i) &&
- parse(env, decoder, (int)(j - i)) &&
- parse(env, decoder, -1) &&
- env->End();
-
- ASSERT(env->CheckConsistency());
-
- if (test_mode == ALL_HANDLERS) {
- if (expected_output) {
- if (output != *expected_output) {
- fprintf(stderr, "Text mismatch: '%s' vs '%s'\n",
- output.c_str(), expected_output->c_str());
- }
- ASSERT(ok);
- ASSERT(output == *expected_output);
- } else {
- if (ok) {
- fprintf(stderr, "Didn't expect ok result, but got output: '%s'\n",
- output.c_str());
- }
- ASSERT(!ok);
- }
- }
- }
- (*count)++;
-}
-
-void run_decoder(const string& proto, const string* expected_output) {
- VerboseParserEnvironment env(filter_hash != 0);
- upb::Sink sink(global_handlers, &closures[0]);
- upb::pb::DecoderPtr decoder = CreateDecoder(env.arena(), global_method, sink, env.status());
- env.ResetBytesSink(decoder.input());
- for (size_t i = 0; i < proto.size(); i++) {
- for (size_t j = i; j < UPB_MIN(proto.size(), i + 5); j++) {
- do_run_decoder(&env, decoder, proto, expected_output, i, j, true);
- if (env.SkippedWithNull()) {
- do_run_decoder(&env, decoder, proto, expected_output, i, j, false);
- }
- }
- }
-}
-
-const static string thirty_byte_nop = cat(
- tag(NOP_FIELD, UPB_WIRE_TYPE_DELIMITED), delim(string(30, 'X')) );
-
-// Indents and wraps text as if it were a submessage with this field number
-string wrap_text(int32_t fn, const string& text) {
- string wrapped_text = text;
- size_t pos = 0;
- string replace_with = "\n ";
- while ((pos = wrapped_text.find("\n", pos)) != string::npos &&
- pos != wrapped_text.size() - 1) {
- wrapped_text.replace(pos, 1, replace_with);
- pos += replace_with.size();
- }
- wrapped_text = cat(
- LINE("<"),
- num2string(fn), LINE(":{")
- " ", wrapped_text,
- LINE(" }")
- LINE(">"));
- return wrapped_text;
-}
-
-void assert_successful_parse(const string& proto,
- const char *expected_fmt, ...) {
- string expected_text;
- va_list args;
- va_start(args, expected_fmt);
- vappendf(&expected_text, expected_fmt, args);
- va_end(args);
- // To test both middle-of-buffer and end-of-buffer code paths,
- // repeat once with no-op padding data at the end of buffer.
- run_decoder(proto, &expected_text);
- run_decoder(cat( proto, thirty_byte_nop ), &expected_text);
-
- // Test that this also works when wrapped in a submessage or group.
- // Indent the expected text one level and wrap it.
- string wrapped_text1 = wrap_text(UPB_DESCRIPTOR_TYPE_MESSAGE, expected_text);
- string wrapped_text2 = wrap_text(UPB_DESCRIPTOR_TYPE_GROUP, expected_text);
-
- run_decoder(submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, proto), &wrapped_text1);
- run_decoder(group(UPB_DESCRIPTOR_TYPE_GROUP, proto), &wrapped_text2);
-}
-
-void assert_does_not_parse_at_eof(const string& proto) {
- run_decoder(proto, NULL);
-
- // Also test that we fail to parse at end-of-submessage, not just
- // end-of-message. But skip this if we have no handlers, because in that
- // case we won't descend into the submessage.
- if (test_mode != NO_HANDLERS) {
- run_decoder(submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, proto), NULL);
- run_decoder(cat(submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, proto),
- thirty_byte_nop), NULL);
- }
-}
-
-void assert_does_not_parse(const string& proto) {
- // Test that the error is caught both at end-of-buffer and middle-of-buffer.
- assert_does_not_parse_at_eof(proto);
- assert_does_not_parse_at_eof(cat( proto, thirty_byte_nop ));
-}
-
-
-/* The actual tests ***********************************************************/
-
-void test_premature_eof_for_type(upb_descriptortype_t type) {
- // Incomplete values for each wire type.
- static const string incompletes[6] = {
- string("\x80"), // UPB_WIRE_TYPE_VARINT
- string("abcdefg"), // UPB_WIRE_TYPE_64BIT
- string("\x80"), // UPB_WIRE_TYPE_DELIMITED (partial length)
- string(), // UPB_WIRE_TYPE_START_GROUP (no value required)
- string(), // UPB_WIRE_TYPE_END_GROUP (no value required)
- string("abc") // UPB_WIRE_TYPE_32BIT
- };
-
- uint32_t fieldnum = type;
- uint32_t rep_fieldnum = rep_fn(type);
- int wire_type = upb_decoder_types[type].native_wire_type;
- const string& incomplete = incompletes[wire_type];
-
- // EOF before a known non-repeated value.
- assert_does_not_parse_at_eof(tag(fieldnum, wire_type));
-
- // EOF before a known repeated value.
- assert_does_not_parse_at_eof(tag(rep_fieldnum, wire_type));
-
- // EOF before an unknown value.
- assert_does_not_parse_at_eof(tag(UNKNOWN_FIELD, wire_type));
-
- // EOF inside a known non-repeated value.
- assert_does_not_parse_at_eof(
- cat( tag(fieldnum, wire_type), incomplete ));
-
- // EOF inside a known repeated value.
- assert_does_not_parse_at_eof(
- cat( tag(rep_fieldnum, wire_type), incomplete ));
-
- // EOF inside an unknown value.
- assert_does_not_parse_at_eof(
- cat( tag(UNKNOWN_FIELD, wire_type), incomplete ));
-
- if (wire_type == UPB_WIRE_TYPE_DELIMITED) {
- // EOF in the middle of delimited data for known non-repeated value.
- assert_does_not_parse_at_eof(
- cat( tag(fieldnum, wire_type), varint(1) ));
-
- // EOF in the middle of delimited data for known repeated value.
- assert_does_not_parse_at_eof(
- cat( tag(rep_fieldnum, wire_type), varint(1) ));
-
- // EOF in the middle of delimited data for unknown value.
- assert_does_not_parse_at_eof(
- cat( tag(UNKNOWN_FIELD, wire_type), varint(1) ));
-
- if (type == UPB_DESCRIPTOR_TYPE_MESSAGE) {
- // Submessage ends in the middle of a value.
- string incomplete_submsg =
- cat ( tag(UPB_DESCRIPTOR_TYPE_INT32, UPB_WIRE_TYPE_VARINT),
- incompletes[UPB_WIRE_TYPE_VARINT] );
- assert_does_not_parse(
- cat( tag(fieldnum, UPB_WIRE_TYPE_DELIMITED),
- varint(incomplete_submsg.size()),
- incomplete_submsg ));
- }
- } else {
- // Packed region ends in the middle of a value.
- assert_does_not_parse(
- cat( tag(rep_fieldnum, UPB_WIRE_TYPE_DELIMITED),
- varint(incomplete.size()),
- incomplete ));
-
- // EOF in the middle of packed region.
- assert_does_not_parse_at_eof(
- cat( tag(rep_fieldnum, UPB_WIRE_TYPE_DELIMITED), varint(1) ));
- }
-}
-
-// "33" and "66" are just two random values that all numeric types can
-// represent.
-void test_valid_data_for_type(upb_descriptortype_t type,
- const string& enc33, const string& enc66) {
- uint32_t fieldnum = type;
- uint32_t rep_fieldnum = rep_fn(type);
- int wire_type = upb_decoder_types[type].native_wire_type;
-
- // Non-repeated
- assert_successful_parse(
- cat( tag(fieldnum, wire_type), enc33,
- tag(fieldnum, wire_type), enc66 ),
- LINE("<")
- LINE("%u:33")
- LINE("%u:66")
- LINE(">"), fieldnum, fieldnum);
-
- // Non-packed repeated.
- assert_successful_parse(
- cat( tag(rep_fieldnum, wire_type), enc33,
- tag(rep_fieldnum, wire_type), enc66 ),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:33")
- LINE(" %u:66")
- LINE("]")
- LINE(">"), rep_fieldnum, rep_fieldnum, rep_fieldnum);
-
- // Packed repeated.
- assert_successful_parse(
- cat( tag(rep_fieldnum, UPB_WIRE_TYPE_DELIMITED),
- delim(cat( enc33, enc66 )) ),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:33")
- LINE(" %u:66")
- LINE("]")
- LINE(">"), rep_fieldnum, rep_fieldnum, rep_fieldnum);
-}
-
-void test_valid_data_for_signed_type(upb_descriptortype_t type,
- const string& enc33, const string& enc66) {
- uint32_t fieldnum = type;
- uint32_t rep_fieldnum = rep_fn(type);
- int wire_type = upb_decoder_types[type].native_wire_type;
-
- // Non-repeated
- assert_successful_parse(
- cat( tag(fieldnum, wire_type), enc33,
- tag(fieldnum, wire_type), enc66 ),
- LINE("<")
- LINE("%u:33")
- LINE("%u:-66")
- LINE(">"), fieldnum, fieldnum);
-
- // Non-packed repeated.
- assert_successful_parse(
- cat( tag(rep_fieldnum, wire_type), enc33,
- tag(rep_fieldnum, wire_type), enc66 ),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:33")
- LINE(" %u:-66")
- LINE("]")
- LINE(">"), rep_fieldnum, rep_fieldnum, rep_fieldnum);
-
- // Packed repeated.
- assert_successful_parse(
- cat( tag(rep_fieldnum, UPB_WIRE_TYPE_DELIMITED),
- delim(cat( enc33, enc66 )) ),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:33")
- LINE(" %u:-66")
- LINE("]")
- LINE(">"), rep_fieldnum, rep_fieldnum, rep_fieldnum);
-}
-
-// Test that invalid protobufs are properly detected (without crashing) and
-// have an error reported. Field numbers match registered handlers above.
-void test_invalid() {
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_DOUBLE);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_FLOAT);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_INT64);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_UINT64);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_INT32);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_FIXED64);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_FIXED32);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_BOOL);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_STRING);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_BYTES);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_UINT32);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_ENUM);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_SFIXED32);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_SFIXED64);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_SINT32);
- test_premature_eof_for_type(UPB_DESCRIPTOR_TYPE_SINT64);
-
- // EOF inside a tag's varint.
- assert_does_not_parse_at_eof( string("\x80") );
-
- // EOF inside a known group.
- // TODO(haberman): add group to decoder test schema.
- //assert_does_not_parse_at_eof( tag(4, UPB_WIRE_TYPE_START_GROUP) );
-
- // EOF inside an unknown group.
- assert_does_not_parse_at_eof( tag(UNKNOWN_FIELD, UPB_WIRE_TYPE_START_GROUP) );
-
- // End group that we are not currently in.
- assert_does_not_parse( tag(4, UPB_WIRE_TYPE_END_GROUP) );
-
- // Field number is 0.
- assert_does_not_parse(
- cat( tag(0, UPB_WIRE_TYPE_DELIMITED), varint(0) ));
- // The previous test alone did not catch this particular pattern which could
- // corrupt the internal state.
- assert_does_not_parse(
- cat( tag(0, UPB_WIRE_TYPE_64BIT), uint64(0) ));
-
- // Field number is too large.
- assert_does_not_parse(
- cat( tag(UPB_MAX_FIELDNUMBER + 1, UPB_WIRE_TYPE_DELIMITED),
- varint(0) ));
-
- // Known group inside a submessage has ENDGROUP tag AFTER submessage end.
- assert_does_not_parse(
- cat ( submsg(UPB_DESCRIPTOR_TYPE_MESSAGE,
- tag(UPB_DESCRIPTOR_TYPE_GROUP, UPB_WIRE_TYPE_START_GROUP)),
- tag(UPB_DESCRIPTOR_TYPE_GROUP, UPB_WIRE_TYPE_END_GROUP)));
-
- // Unknown string extends past enclosing submessage.
- assert_does_not_parse(
- cat (badlen_submsg(-1, UPB_DESCRIPTOR_TYPE_MESSAGE,
- submsg(12345, string(" "))),
- submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, string(" "))));
-
- // Unknown fixed-length field extends past enclosing submessage.
- assert_does_not_parse(
- cat (badlen_submsg(-1, UPB_DESCRIPTOR_TYPE_MESSAGE,
- cat( tag(12345, UPB_WIRE_TYPE_64BIT), uint64(0))),
- submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, string(" "))));
-
- // Test exceeding the resource limit of stack depth.
- if (test_mode != NO_HANDLERS) {
- string buf;
- for (int i = 0; i <= MAX_NESTING; i++) {
- buf.assign(submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, buf));
- }
- assert_does_not_parse(buf);
- }
-}
-
-void test_valid() {
- // Empty protobuf.
- assert_successful_parse(string(""), "<\n>\n");
-
- // Empty protobuf where we never call PutString between
- // StartString/EndString.
-
- upb::Status status;
- upb::Arena arena;
- upb::Sink sink(global_handlers, &closures[0]);
- upb::pb::DecoderPtr decoder =
- CreateDecoder(&arena, global_method, sink, &status);
- output.clear();
- bool ok = upb::PutBuffer(std::string(), decoder.input());
- ASSERT(ok);
- ASSERT(status.ok());
- if (test_mode == ALL_HANDLERS) {
- ASSERT(output == string("<\n>\n"));
- }
-
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_DOUBLE,
- dbl(33),
- dbl(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_FLOAT, flt(33), flt(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_INT64,
- varint(33),
- varint(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_INT32,
- varint(33),
- varint(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_ENUM,
- varint(33),
- varint(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_SFIXED32,
- uint32(33),
- uint32(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_SFIXED64,
- uint64(33),
- uint64(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_SINT32,
- zz32(33),
- zz32(-66));
- test_valid_data_for_signed_type(UPB_DESCRIPTOR_TYPE_SINT64,
- zz64(33),
- zz64(-66));
-
- test_valid_data_for_type(UPB_DESCRIPTOR_TYPE_UINT64, varint(33), varint(66));
- test_valid_data_for_type(UPB_DESCRIPTOR_TYPE_UINT32, varint(33), varint(66));
- test_valid_data_for_type(UPB_DESCRIPTOR_TYPE_FIXED64, uint64(33), uint64(66));
- test_valid_data_for_type(UPB_DESCRIPTOR_TYPE_FIXED32, uint32(33), uint32(66));
-
- // Unknown fields.
- int int32_type = UPB_DESCRIPTOR_TYPE_INT32;
- int msg_type = UPB_DESCRIPTOR_TYPE_MESSAGE;
- assert_successful_parse(
- cat( tag(12345, UPB_WIRE_TYPE_VARINT), varint(2345678) ),
- "<\n>\n");
- assert_successful_parse(
- cat( tag(12345, UPB_WIRE_TYPE_32BIT), uint32(2345678) ),
- "<\n>\n");
- assert_successful_parse(
- cat( tag(12345, UPB_WIRE_TYPE_64BIT), uint64(2345678) ),
- "<\n>\n");
- assert_successful_parse(
- submsg(12345, string(" ")),
- "<\n>\n");
-
- // Unknown field inside a known submessage.
- assert_successful_parse(
- submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, submsg(12345, string(" "))),
- LINE("<")
- LINE("%u:{")
- LINE(" <")
- LINE(" >")
- LINE(" }")
- LINE(">"), UPB_DESCRIPTOR_TYPE_MESSAGE);
-
- assert_successful_parse(
- cat (submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, submsg(12345, string(" "))),
- tag(UPB_DESCRIPTOR_TYPE_INT32, UPB_WIRE_TYPE_VARINT),
- varint(5)),
- LINE("<")
- LINE("%u:{")
- LINE(" <")
- LINE(" >")
- LINE(" }")
- LINE("%u:5")
- LINE(">"), UPB_DESCRIPTOR_TYPE_MESSAGE, UPB_DESCRIPTOR_TYPE_INT32);
-
- // This triggered a previous bug in the decoder.
- assert_successful_parse(
- cat( tag(UPB_DESCRIPTOR_TYPE_SFIXED32, UPB_WIRE_TYPE_VARINT),
- varint(0) ),
- "<\n>\n");
-
- assert_successful_parse(
- cat(
- submsg(UPB_DESCRIPTOR_TYPE_MESSAGE,
- submsg(UPB_DESCRIPTOR_TYPE_MESSAGE,
- cat( tag(int32_type, UPB_WIRE_TYPE_VARINT), varint(2345678),
- tag(12345, UPB_WIRE_TYPE_VARINT), varint(2345678) ))),
- tag(int32_type, UPB_WIRE_TYPE_VARINT), varint(22222)),
- LINE("<")
- LINE("%u:{")
- LINE(" <")
- LINE(" %u:{")
- LINE(" <")
- LINE(" %u:2345678")
- LINE(" >")
- LINE(" }")
- LINE(" >")
- LINE(" }")
- LINE("%u:22222")
- LINE(">"), msg_type, msg_type, int32_type, int32_type);
-
- assert_successful_parse(
- cat( tag(UPB_DESCRIPTOR_TYPE_INT32, UPB_WIRE_TYPE_VARINT), varint(1),
- tag(12345, UPB_WIRE_TYPE_VARINT), varint(2345678) ),
- LINE("<")
- LINE("%u:1")
- LINE(">"), UPB_DESCRIPTOR_TYPE_INT32);
-
- // String inside submsg.
- uint32_t msg_fn = UPB_DESCRIPTOR_TYPE_MESSAGE;
- assert_successful_parse(
- submsg(msg_fn,
- cat ( tag(UPB_DESCRIPTOR_TYPE_STRING, UPB_WIRE_TYPE_DELIMITED),
- delim(string("abcde"))
- )
- ),
- LINE("<")
- LINE("%u:{")
- LINE(" <")
- LINE(" %u:(5)\"abcde")
- LINE(" %u:\"")
- LINE(" >")
- LINE(" }")
- LINE(">"), msg_fn, UPB_DESCRIPTOR_TYPE_STRING,
- UPB_DESCRIPTOR_TYPE_STRING);
-
- // Test implicit startseq/endseq.
- uint32_t repfl_fn = rep_fn(UPB_DESCRIPTOR_TYPE_FLOAT);
- uint32_t repdb_fn = rep_fn(UPB_DESCRIPTOR_TYPE_DOUBLE);
- assert_successful_parse(
- cat( tag(repfl_fn, UPB_WIRE_TYPE_32BIT), flt(33),
- tag(repdb_fn, UPB_WIRE_TYPE_64BIT), dbl(66) ),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:33")
- LINE("]")
- LINE("%u:[")
- LINE(" %u:66")
- LINE("]")
- LINE(">"), repfl_fn, repfl_fn, repdb_fn, repdb_fn);
-
- // Submessage tests.
- assert_successful_parse(
- submsg(msg_fn, submsg(msg_fn, submsg(msg_fn, string()))),
- LINE("<")
- LINE("%u:{")
- LINE(" <")
- LINE(" %u:{")
- LINE(" <")
- LINE(" %u:{")
- LINE(" <")
- LINE(" >")
- LINE(" }")
- LINE(" >")
- LINE(" }")
- LINE(" >")
- LINE(" }")
- LINE(">"), msg_fn, msg_fn, msg_fn);
-
- uint32_t repm_fn = rep_fn(UPB_DESCRIPTOR_TYPE_MESSAGE);
- assert_successful_parse(
- submsg(repm_fn, submsg(repm_fn, string())),
- LINE("<")
- LINE("%u:[")
- LINE(" %u:{")
- LINE(" <")
- LINE(" %u:[")
- LINE(" %u:{")
- LINE(" <")
- LINE(" >")
- LINE(" }")
- LINE(" ]")
- LINE(" >")
- LINE(" }")
- LINE("]")
- LINE(">"), repm_fn, repm_fn, repm_fn, repm_fn);
-
- // Test unknown group.
- uint32_t unknown_group_fn = 12321;
- assert_successful_parse(
- cat( tag(unknown_group_fn, UPB_WIRE_TYPE_START_GROUP),
- tag(unknown_group_fn, UPB_WIRE_TYPE_END_GROUP) ),
- LINE("<")
- LINE(">")
- );
-
- // Test some unknown fields inside an unknown group.
- const string unknown_group_with_data =
- cat(
- tag(unknown_group_fn, UPB_WIRE_TYPE_START_GROUP),
- tag(12345, UPB_WIRE_TYPE_VARINT), varint(2345678),
- tag(123456789, UPB_WIRE_TYPE_32BIT), uint32(2345678),
- tag(123477, UPB_WIRE_TYPE_64BIT), uint64(2345678),
- tag(123, UPB_WIRE_TYPE_DELIMITED), varint(0),
- tag(unknown_group_fn, UPB_WIRE_TYPE_END_GROUP)
- );
-
- // Nested unknown group with data.
- assert_successful_parse(
- cat(
- tag(unknown_group_fn, UPB_WIRE_TYPE_START_GROUP),
- unknown_group_with_data,
- tag(unknown_group_fn, UPB_WIRE_TYPE_END_GROUP),
- tag(UPB_DESCRIPTOR_TYPE_INT32, UPB_WIRE_TYPE_VARINT), varint(1)
- ),
- LINE("<")
- LINE("%u:1")
- LINE(">"),
- UPB_DESCRIPTOR_TYPE_INT32
- );
-
- assert_successful_parse(
- cat( tag(unknown_group_fn, UPB_WIRE_TYPE_START_GROUP),
- tag(unknown_group_fn + 1, UPB_WIRE_TYPE_START_GROUP),
- tag(unknown_group_fn + 1, UPB_WIRE_TYPE_END_GROUP),
- tag(unknown_group_fn, UPB_WIRE_TYPE_END_GROUP) ),
- LINE("<")
- LINE(">")
- );
-
- // Staying within the stack limit should work properly.
- string buf;
- string textbuf;
- int total = MAX_NESTING - 1;
- for (int i = 0; i < total; i++) {
- buf.assign(submsg(UPB_DESCRIPTOR_TYPE_MESSAGE, buf));
- indentbuf(&textbuf, i);
- textbuf.append("<\n");
- indentbuf(&textbuf, i);
- appendf(&textbuf, "%u:{\n", UPB_DESCRIPTOR_TYPE_MESSAGE);
- }
- indentbuf(&textbuf, total);
- textbuf.append("<\n");
- indentbuf(&textbuf, total);
- textbuf.append(">\n");
- for (int i = 0; i < total; i++) {
- indentbuf(&textbuf, total - i - 1);
- textbuf.append(" }\n");
- indentbuf(&textbuf, total - i - 1);
- textbuf.append(">\n");
- }
- // Have to use run_decoder directly, because we are at max nesting and can't
- // afford the extra nesting that assert_successful_parse() will do.
- run_decoder(buf, &textbuf);
-}
-
-void empty_callback(const void* /* closure */, upb::Handlers* /* h_ptr */) {}
-
-void test_emptyhandlers(upb::SymbolTable* symtab) {
- // Create an empty handlers to make sure that the decoder can handle empty
- // messages.
- HandlerRegisterData handlerdata;
- handlerdata.mode = test_mode;
-
- upb::HandlerCache handler_cache(empty_callback, &handlerdata);
- upb::pb::CodeCache pb_code_cache(&handler_cache);
-
- upb::MessageDefPtr md = upb::MessageDefPtr(Empty_getmsgdef(symtab->ptr()));
- global_handlers = handler_cache.Get(md);
- global_method = pb_code_cache.Get(md);
-
- // TODO: also test the case where a message has fields, but the fields are
- // submessage fields and have no handlers. This also results in a decoder
- // method with no field-handling code.
-
- // Ensure that the method can run with empty and non-empty input.
- string test_unknown_field_msg =
- cat(tag(1, UPB_WIRE_TYPE_VARINT), varint(42),
- tag(2, UPB_WIRE_TYPE_DELIMITED), delim("My test data"));
- const struct {
- const char* data;
- size_t length;
- } testdata[] = {
- { "", 0 },
- { test_unknown_field_msg.data(), test_unknown_field_msg.size() },
- { NULL, 0 },
- };
- for (int i = 0; testdata[i].data; i++) {
- VerboseParserEnvironment env(filter_hash != 0);
- upb::Sink sink(global_method.dest_handlers(), &closures[0]);
- upb::pb::DecoderPtr decoder =
- CreateDecoder(env.arena(), global_method, sink, env.status());
- env.ResetBytesSink(decoder.input());
- env.Reset(testdata[i].data, testdata[i].length, true, false);
- ASSERT(env.Start());
- ASSERT(env.ParseBuffer(-1));
- ASSERT(env.End());
- ASSERT(env.CheckConsistency());
- }
-}
-
-void run_tests() {
- HandlerRegisterData handlerdata;
- handlerdata.mode = test_mode;
-
- upb::SymbolTable symtab;
- upb::HandlerCache handler_cache(callback, &handlerdata);
- upb::pb::CodeCache pb_code_cache(&handler_cache);
-
- upb::MessageDefPtr md(DecoderTest_getmsgdef(symtab.ptr()));
- global_handlers = handler_cache.Get(md);
- global_method = pb_code_cache.Get(md);
- completed = 0;
-
- test_invalid();
- test_valid();
-
- test_emptyhandlers(&symtab);
-}
-
-extern "C" {
-
-int run_tests(int argc, char *argv[]) {
- if (argc > 1)
- filter_hash = (uint32_t)strtol(argv[1], NULL, 16);
- for (int i = 0; i < MAX_NESTING; i++) {
- closures[i] = i;
- }
-
- // Count tests.
- count = &total;
- total = 0;
- test_mode = COUNT_ONLY;
- run_tests();
- count = &completed;
-
- total *= 2; // NO_HANDLERS, ALL_HANDLERS.
-
- test_mode = NO_HANDLERS;
- run_tests();
-
- test_mode = ALL_HANDLERS;
- run_tests();
-
- printf("All tests passed, %d assertions.\n", num_assertions);
- return 0;
-}
-
-}
diff --git a/grpc/third_party/upb/tests/pb/test_decoder.proto b/grpc/third_party/upb/tests/pb/test_decoder.proto
deleted file mode 100644
index e9fa6ad3..00000000
--- a/grpc/third_party/upb/tests/pb/test_decoder.proto
+++ /dev/null
@@ -1,128 +0,0 @@
-
-syntax = "proto2";
-
-enum TestEnum {
- FOO = 1;
-}
-
-message Empty {}
-
-message DecoderTest {
- optional double f_double = 1;
- optional float f_float = 2;
- optional int64 f_int64 = 3;
- optional uint64 f_uint64 = 4;
- optional int32 f_int32 = 5;
- optional fixed64 f_fixed64 = 6;
- optional fixed32 f_fixed32 = 7;
- optional bool f_bool = 8;
- optional string f_string = 9;
- optional DecoderTest f_message = 11;
- optional bytes f_bytes = 12;
- optional uint32 f_uint32 = 13;
- optional TestEnum f_enum = 14;
- optional sfixed32 f_sfixed32 = 15;
- optional sfixed64 f_sfixed64 = 16;
- optional sint32 f_sint32 = 17;
- optional sint64 f_sint64 = 18;
-
- optional string nop_field = 40;
-
- repeated double r_double = 536869912;
- repeated float r_float = 536869913;
- repeated int64 r_int64 = 536869914;
- repeated uint64 r_uint64 = 536869915;
- repeated int32 r_int32 = 536869916;
- repeated fixed64 r_fixed64 = 536869917;
- repeated fixed32 r_fixed32 = 536869918;
- repeated bool r_bool = 536869919;
- repeated string r_string = 536869920;
- repeated DecoderTest r_message = 536869922;
- repeated bytes r_bytes = 536869923;
- repeated uint32 r_uint32 = 536869924;
- repeated TestEnum r_enum = 536869925;
- repeated sfixed32 r_sfixed32 = 536869926;
- repeated sfixed64 r_sfixed64 = 536869927;
- repeated sint32 r_sint32 = 536869928;
- repeated sint64 r_sint64 = 536869929;
-
- optional group F_group = 10 {
- optional double f_double = 1;
- optional float f_float = 2;
- optional int64 f_int64 = 3;
- optional uint64 f_uint64 = 4;
- optional int32 f_int32 = 5;
- optional fixed64 f_fixed64 = 6;
- optional fixed32 f_fixed32 = 7;
- optional bool f_bool = 8;
- optional string f_string = 9;
- optional DecoderTest f_message = 11;
- optional bytes f_bytes = 12;
- optional uint32 f_uint32 = 13;
- optional TestEnum f_enum = 14;
- optional sfixed32 f_sfixed32 = 15;
- optional sfixed64 f_sfixed64 = 16;
- optional sint32 f_sint32 = 17;
- optional sint64 f_sint64 = 18;
-
- optional string nop_field = 40;
-
- repeated double r_double = 536869912;
- repeated float r_float = 536869913;
- repeated int64 r_int64 = 536869914;
- repeated uint64 r_uint64 = 536869915;
- repeated int32 r_int32 = 536869916;
- repeated fixed64 r_fixed64 = 536869917;
- repeated fixed32 r_fixed32 = 536869918;
- repeated bool r_bool = 536869919;
- repeated string r_string = 536869920;
- repeated DecoderTest r_message = 536869922;
- repeated bytes r_bytes = 536869923;
- repeated uint32 r_uint32 = 536869924;
- repeated TestEnum r_enum = 536869925;
- repeated sfixed32 r_sfixed32 = 536869926;
- repeated sfixed64 r_sfixed64 = 536869927;
- repeated sint32 r_sint32 = 536869928;
- repeated sint64 r_sint64 = 536869929;
- }
-
- optional group R_group = 536869921 {
- optional double f_double = 1;
- optional float f_float = 2;
- optional int64 f_int64 = 3;
- optional uint64 f_uint64 = 4;
- optional int32 f_int32 = 5;
- optional fixed64 f_fixed64 = 6;
- optional fixed32 f_fixed32 = 7;
- optional bool f_bool = 8;
- optional string f_string = 9;
- optional DecoderTest f_message = 11;
- optional bytes f_bytes = 12;
- optional uint32 f_uint32 = 13;
- optional TestEnum f_enum = 14;
- optional sfixed32 f_sfixed32 = 15;
- optional sfixed64 f_sfixed64 = 16;
- optional sint32 f_sint32 = 17;
- optional sint64 f_sint64 = 18;
-
- optional string nop_field = 40;
-
- repeated double r_double = 536869912;
- repeated float r_float = 536869913;
- repeated int64 r_int64 = 536869914;
- repeated uint64 r_uint64 = 536869915;
- repeated int32 r_int32 = 536869916;
- repeated fixed64 r_fixed64 = 536869917;
- repeated fixed32 r_fixed32 = 536869918;
- repeated bool r_bool = 536869919;
- repeated string r_string = 536869920;
- repeated DecoderTest r_message = 536869922;
- repeated bytes r_bytes = 536869923;
- repeated uint32 r_uint32 = 536869924;
- repeated TestEnum r_enum = 536869925;
- repeated sfixed32 r_sfixed32 = 536869926;
- repeated sfixed64 r_sfixed64 = 536869927;
- repeated sint32 r_sint32 = 536869928;
- repeated sint64 r_sint64 = 536869929;
- }
-}
diff --git a/grpc/third_party/upb/tests/pb/test_encoder.cc b/grpc/third_party/upb/tests/pb/test_encoder.cc
deleted file mode 100644
index b358ef59..00000000
--- a/grpc/third_party/upb/tests/pb/test_encoder.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-
-#include <iostream>
-
-#include "google/protobuf/descriptor.upb.h"
-#include "google/protobuf/descriptor.upbdefs.h"
-#include "tests/test_util.h"
-#include "tests/upb_test.h"
-#include "upb/pb/decoder.h"
-#include "upb/pb/encoder.h"
-#include "upb/port_def.inc"
-#include "upb/upb.hpp"
-
-template <class T>
-class FillStringHandler {
- public:
- static void SetHandler(upb_byteshandler* handler) {
- upb_byteshandler_setstartstr(handler, &FillStringHandler::StartString,
- NULL);
- upb_byteshandler_setstring(handler, &FillStringHandler::StringBuf, NULL);
- }
-
- private:
- // TODO(haberman): add UpbBind/UpbMakeHandler support to BytesHandler so these
- // can be prettier callbacks.
- static void* StartString(void *c, const void *hd, size_t size) {
- UPB_UNUSED(hd);
- UPB_UNUSED(size);
-
- T* str = static_cast<T*>(c);
- str->clear();
- return c;
- }
-
- static size_t StringBuf(void* c, const void* hd, const char* buf, size_t n,
- const upb_bufhandle* h) {
- UPB_UNUSED(hd);
- UPB_UNUSED(h);
-
- T* str = static_cast<T*>(c);
- try {
- str->append(buf, n);
- return n;
- } catch (const std::exception&) {
- return 0;
- }
- }
-};
-
-class StringSink {
- public:
- template <class T>
- explicit StringSink(T* target) {
- // TODO(haberman): we need to avoid rebuilding a new handler every time,
- // but with class globals disallowed for google3 C++ this is tricky.
- upb_byteshandler_init(&handler_);
- FillStringHandler<T>::SetHandler(&handler_);
- input_.Reset(&handler_, target);
- }
-
- upb::BytesSink input() { return input_; }
-
- private:
- upb_byteshandler handler_;
- upb::BytesSink input_;
-};
-
-void test_pb_roundtrip() {
- std::string input(
- google_protobuf_descriptor_proto_upbdefinit.descriptor.data,
- google_protobuf_descriptor_proto_upbdefinit.descriptor.size);
- std::cout << input.size() << "\n";
- upb::SymbolTable symtab;
- upb::HandlerCache encoder_cache(upb::pb::EncoderPtr::NewCache());
- upb::pb::CodeCache decoder_cache(&encoder_cache);
- upb::Arena arena;
- upb::Status status;
- upb::MessageDefPtr md(
- google_protobuf_FileDescriptorProto_getmsgdef(symtab.ptr()));
- ASSERT(md);
- const upb::Handlers *encoder_handlers = encoder_cache.Get(md);
- ASSERT(encoder_handlers);
- const upb::pb::DecoderMethodPtr method = decoder_cache.Get(md);
-
- std::string output;
- StringSink string_sink(&output);
- upb::pb::EncoderPtr encoder =
- upb::pb::EncoderPtr::Create(&arena, encoder_handlers, string_sink.input());
- upb::pb::DecoderPtr decoder =
- upb::pb::DecoderPtr::Create(&arena, method, encoder.input(), &status);
- bool ok = upb::PutBuffer(input, decoder.input());
- ASSERT(ok);
- ASSERT(input == output);
-}
-
-extern "C" {
-int run_tests(int argc, char *argv[]) {
- UPB_UNUSED(argc);
- UPB_UNUSED(argv);
- test_pb_roundtrip();
- return 0;
-}
-}
diff --git a/grpc/third_party/upb/tests/test.proto b/grpc/third_party/upb/tests/test.proto
deleted file mode 100644
index c4b7e9c3..00000000
--- a/grpc/third_party/upb/tests/test.proto
+++ /dev/null
@@ -1,8 +0,0 @@
-
-syntax = "proto2";
-
-package upb_test;
-
-message MapTest {
- map<string, double> map_string_double = 1;
-}
diff --git a/grpc/third_party/upb/tests/test_cpp.cc b/grpc/third_party/upb/tests/test_cpp.cc
deleted file mode 100644
index 9d3f64ac..00000000
--- a/grpc/third_party/upb/tests/test_cpp.cc
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*
- *
- * Tests for C++ wrappers.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <fstream>
-#include <iostream>
-#include <set>
-#include <sstream>
-
-#include "tests/test_cpp.upbdefs.h"
-#include "tests/upb_test.h"
-#include "upb/def.h"
-#include "upb/handlers.h"
-#include "upb/pb/decoder.h"
-#include "upb/pb/textprinter.h"
-#include "upb/port_def.inc"
-#include "upb/upb.h"
-
-template <class T>
-void AssertInsert(T* const container, const typename T::value_type& val) {
- bool inserted = container->insert(val).second;
- ASSERT(inserted);
-}
-
-//
-// Tests for registering and calling handlers in all their variants.
-// This test code is very repetitive because we have to declare each
-// handler function variant separately, and they all have different
-// signatures so it does not lend itself well to templates.
-//
-// We test three handler types:
-// StartMessage (no data params)
-// Int32 (1 data param (int32_t))
-// String Buf (2 data params (const char*, size_t))
-//
-// For each handler type we test all 8 handler variants:
-// (handler data?) x (function/method) x (returns {void, success})
-//
-// The one notable thing we don't test at the moment is
-// StartSequence/StartString handlers: these are different from StartMessage()
-// in that they return void* for the sub-closure. But this is exercised in
-// other tests.
-//
-
-static const int kExpectedHandlerData = 1232323;
-
-class StringBufTesterBase {
- public:
- static constexpr int kFieldNumber = 3;
-
- StringBufTesterBase() : seen_(false), handler_data_val_(0) {}
-
- void CallAndVerify(upb::Sink sink, upb::FieldDefPtr f) {
- upb_selector_t start;
- ASSERT(upb_handlers_getselector(f.ptr(), UPB_HANDLER_STARTSTR, &start));
- upb_selector_t str;
- ASSERT(upb_handlers_getselector(f.ptr(), UPB_HANDLER_STRING, &str));
-
- ASSERT(!seen_);
- upb::Sink sub;
- sink.StartMessage();
- sink.StartString(start, 0, &sub);
- size_t ret = sub.PutStringBuffer(str, &buf_, 5, &handle_);
- ASSERT(seen_);
- ASSERT(len_ == 5);
- ASSERT(ret == 5);
- ASSERT(handler_data_val_ == kExpectedHandlerData);
- }
-
- protected:
- bool seen_;
- int handler_data_val_;
- size_t len_;
- char buf_;
- upb_bufhandle handle_;
-};
-
-// Test 8 combinations of:
-// (handler data?) x (buffer handle?) x (function/method)
-//
-// Then we add one test each for this variation: to prevent combinatorial
-// explosion of these tests we don't test the full 16 combinations, but
-// rely on our knowledge that the implementation processes the return wrapping
-// in a second separate and independent stage:
-//
-// (function/method)
-
-class StringBufTesterVoidMethodNoHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidMethodNoHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- void Handler(const char *buf, size_t len) {
- ASSERT(buf == &buf_);
- seen_ = true;
- len_ = len;
- }
-};
-
-class StringBufTesterVoidMethodNoHandlerDataWithHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidMethodNoHandlerDataWithHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- void Handler(const char *buf, size_t len, const upb_bufhandle* handle) {
- ASSERT(buf == &buf_);
- ASSERT(handle == &handle_);
- seen_ = true;
- len_ = len;
- }
-};
-
-class StringBufTesterVoidMethodWithHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidMethodWithHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- void Handler(const int* hd, const char *buf, size_t len) {
- ASSERT(buf == &buf_);
- handler_data_val_ = *hd;
- seen_ = true;
- len_ = len;
- }
-};
-
-class StringBufTesterVoidMethodWithHandlerDataWithHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidMethodWithHandlerDataWithHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- void Handler(const int* hd, const char* buf, size_t len,
- const upb_bufhandle* handle) {
- ASSERT(buf == &buf_);
- ASSERT(handle == &handle_);
- handler_data_val_ = *hd;
- seen_ = true;
- len_ = len;
- }
-};
-
-class StringBufTesterVoidFunctionNoHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidFunctionNoHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- static void Handler(ME* t, const char *buf, size_t len) {
- ASSERT(buf == &t->buf_);
- t->seen_ = true;
- t->len_ = len;
- }
-};
-
-class StringBufTesterVoidFunctionNoHandlerDataWithHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidFunctionNoHandlerDataWithHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- static void Handler(ME* t, const char* buf, size_t len,
- const upb_bufhandle* handle) {
- ASSERT(buf == &t->buf_);
- ASSERT(handle == &t->handle_);
- t->seen_ = true;
- t->len_ = len;
- }
-};
-
-class StringBufTesterVoidFunctionWithHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidFunctionWithHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static void Handler(ME* t, const int* hd, const char *buf, size_t len) {
- ASSERT(buf == &t->buf_);
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- t->len_ = len;
- }
-};
-
-class StringBufTesterVoidFunctionWithHandlerDataWithHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterVoidFunctionWithHandlerDataWithHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static void Handler(ME* t, const int* hd, const char* buf, size_t len,
- const upb_bufhandle* handle) {
- ASSERT(buf == &t->buf_);
- ASSERT(handle == &t->handle_);
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- t->len_ = len;
- }
-};
-
-class StringBufTesterSizeTMethodNoHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterSizeTMethodNoHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- size_t Handler(const char *buf, size_t len) {
- ASSERT(buf == &buf_);
- seen_ = true;
- len_ = len;
- return len;
- }
-};
-
-class StringBufTesterBoolMethodNoHandlerDataNoHandle
- : public StringBufTesterBase {
- public:
- typedef StringBufTesterBoolMethodNoHandlerDataNoHandle ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStringHandler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- bool Handler(const char *buf, size_t len) {
- ASSERT(buf == &buf_);
- seen_ = true;
- len_ = len;
- return true;
- }
-};
-
-class StartMsgTesterBase {
- public:
- // We don't need the FieldDef it will create, but the test harness still
- // requires that we provide one.
- static constexpr int kFieldNumber = 3;
-
- StartMsgTesterBase() : seen_(false), handler_data_val_(0) {}
-
- void CallAndVerify(upb::Sink sink, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(!seen_);
- sink.StartMessage();
- ASSERT(seen_);
- ASSERT(handler_data_val_ == kExpectedHandlerData);
- }
-
- protected:
- bool seen_;
- int handler_data_val_;
-};
-
-// Test all 8 combinations of:
-// (handler data?) x (function/method) x (returns {void, bool})
-
-class StartMsgTesterVoidFunctionNoHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterVoidFunctionNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(UpbMakeHandler(&Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- //static void Handler(ME* t) {
- static void Handler(ME* t) {
- t->seen_ = true;
- }
-};
-
-class StartMsgTesterBoolFunctionNoHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterBoolFunctionNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(UpbMakeHandler(&Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- static bool Handler(ME* t) {
- t->seen_ = true;
- return true;
- }
-};
-
-class StartMsgTesterVoidMethodNoHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterVoidMethodNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- void Handler() {
- seen_ = true;
- }
-};
-
-class StartMsgTesterBoolMethodNoHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterBoolMethodNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- bool Handler() {
- seen_ = true;
- return true;
- }
-};
-
-class StartMsgTesterVoidFunctionWithHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterVoidFunctionWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(
- UpbBind(&Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static void Handler(ME* t, const int* hd) {
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- }
-};
-
-class StartMsgTesterBoolFunctionWithHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterBoolFunctionWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(
- UpbBind(&Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static bool Handler(ME* t, const int* hd) {
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- return true;
- }
-};
-
-class StartMsgTesterVoidMethodWithHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterVoidMethodWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(
- UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- void Handler(const int* hd) {
- handler_data_val_ = *hd;
- seen_ = true;
- }
-};
-
-class StartMsgTesterBoolMethodWithHandlerData : public StartMsgTesterBase {
- public:
- typedef StartMsgTesterBoolMethodWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- UPB_UNUSED(f);
- ASSERT(h.SetStartMessageHandler(
- UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- bool Handler(const int* hd) {
- handler_data_val_ = *hd;
- seen_ = true;
- return true;
- }
-};
-
-class Int32ValueTesterBase {
- public:
- static constexpr int kFieldNumber = 1;
-
- Int32ValueTesterBase() : seen_(false), val_(0), handler_data_val_(0) {}
-
- void CallAndVerify(upb::Sink sink, upb::FieldDefPtr f) {
- upb_selector_t s;
- ASSERT(upb_handlers_getselector(f.ptr(), UPB_HANDLER_INT32, &s));
-
- ASSERT(!seen_);
- sink.PutInt32(s, 5);
- ASSERT(seen_);
- ASSERT(handler_data_val_ == kExpectedHandlerData);
- ASSERT(val_ == 5);
- }
-
- protected:
- bool seen_;
- int32_t val_;
- int handler_data_val_;
-};
-
-// Test all 8 combinations of:
-// (handler data?) x (function/method) x (returns {void, bool})
-
-class ValueTesterInt32VoidFunctionNoHandlerData
- : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32VoidFunctionNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(f, UpbMakeHandler(&Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- static void Handler(ME* t, int32_t val) {
- t->val_ = val;
- t->seen_ = true;
- }
-};
-
-class ValueTesterInt32BoolFunctionNoHandlerData
- : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32BoolFunctionNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(f, UpbMakeHandler(&Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- static bool Handler(ME* t, int32_t val) {
- t->val_ = val;
- t->seen_ = true;
- return true;
- }
-};
-
-class ValueTesterInt32VoidMethodNoHandlerData : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32VoidMethodNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- void Handler(int32_t val) {
- val_ = val;
- seen_ = true;
- }
-};
-
-class ValueTesterInt32BoolMethodNoHandlerData : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32BoolMethodNoHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(f, UpbMakeHandler(&ME::Handler)));
- handler_data_val_ = kExpectedHandlerData;
- }
-
- private:
- bool Handler(int32_t val) {
- val_ = val;
- seen_ = true;
- return true;
- }
-};
-
-class ValueTesterInt32VoidFunctionWithHandlerData
- : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32VoidFunctionWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(
- f, UpbBind(&Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static void Handler(ME* t, const int* hd, int32_t val) {
- t->val_ = val;
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- }
-};
-
-class ValueTesterInt32BoolFunctionWithHandlerData
- : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32BoolFunctionWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(
- f, UpbBind(&Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- static bool Handler(ME* t, const int* hd, int32_t val) {
- t->val_ = val;
- t->handler_data_val_ = *hd;
- t->seen_ = true;
- return true;
- }
-};
-
-class ValueTesterInt32VoidMethodWithHandlerData : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32VoidMethodWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- void Handler(const int* hd, int32_t val) {
- val_ = val;
- handler_data_val_ = *hd;
- seen_ = true;
- }
-};
-
-class ValueTesterInt32BoolMethodWithHandlerData : public Int32ValueTesterBase {
- public:
- typedef ValueTesterInt32BoolMethodWithHandlerData ME;
- void Register(upb::HandlersPtr h, upb::FieldDefPtr f) {
- ASSERT(h.SetInt32Handler(
- f, UpbBind(&ME::Handler, new int(kExpectedHandlerData))));
- }
-
- private:
- bool Handler(const int* hd, int32_t val) {
- val_ = val;
- handler_data_val_ = *hd;
- seen_ = true;
- return true;
- }
-};
-
-template <class T>
-void RegisterHandlers(const void* closure, upb::Handlers* h_ptr) {
- T* tester = const_cast<T*>(static_cast<const T*>(closure));
- upb::HandlersPtr h(h_ptr);
- upb::FieldDefPtr f = h.message_def().FindFieldByNumber(T::kFieldNumber);
- ASSERT(f);
- tester->Register(h, f);
-}
-
-template <class T>
-void TestHandler() {
- T tester;
- upb::SymbolTable symtab;
- upb::HandlerCache cache(&RegisterHandlers<T>, &tester);
- upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
- ASSERT(md);
- upb::FieldDefPtr f = md.FindFieldByNumber(T::kFieldNumber);
- ASSERT(f);
-
- const upb::Handlers* h = cache.Get(md);
-
- upb::Sink sink(h, &tester);
- tester.CallAndVerify(sink, f);
-}
-
-class T1 {};
-class T2 {};
-
-template <class C>
-void DoNothingHandler(C* closure) {
- UPB_UNUSED(closure);
-}
-
-template <class C>
-void DoNothingInt32Handler(C* closure, int32_t val) {
- UPB_UNUSED(closure);
- UPB_UNUSED(val);
-}
-
-template <class R>
-class DoNothingStartHandler {
- public:
- // We wrap these functions inside of a class for a somewhat annoying reason.
- // UpbMakeHandler() is a macro, so we can't say
- // UpbMakeHandler(DoNothingStartHandler<T1, T2>)
- //
- // because otherwise the preprocessor gets confused at the comma and tries to
- // make it two macro arguments. The usual solution doesn't work either:
- // UpbMakeHandler((DoNothingStartHandler<T1, T2>))
- //
- // If we do that the macro expands correctly, but then it tries to pass that
- // parenthesized expression as a template parameter, ie. Type<(F)>, which
- // isn't legal C++ (Clang will compile it but complains with
- // warning: address non-type template argument cannot be surrounded by
- // parentheses
- //
- // This two-level thing allows us to effectively pass two template parameters,
- // but without any commas:
- // UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)
- template <class C>
- static R* Handler(C* closure) {
- UPB_UNUSED(closure);
- return NULL;
- }
-
- template <class C>
- static R* String(C* closure, size_t size_len) {
- UPB_UNUSED(closure);
- UPB_UNUSED(size_len);
- return NULL;
- }
-};
-
-template <class C>
-void DoNothingStringBufHandler(C* closure, const char *buf, size_t len) {
- UPB_UNUSED(closure);
- UPB_UNUSED(buf);
- UPB_UNUSED(len);
-}
-
-template <class C>
-void DoNothingEndMessageHandler(C* closure, upb_status *status) {
- UPB_UNUSED(closure);
- UPB_UNUSED(status);
-}
-
-void RegisterMismatchedTypes(const void* closure, upb::Handlers* h_ptr) {
- upb::HandlersPtr h(h_ptr);
- UPB_UNUSED(closure);
-
- upb::MessageDefPtr md(h.message_def());
- ASSERT(md);
- upb::FieldDefPtr i32 = md.FindFieldByName("i32");
- upb::FieldDefPtr r_i32 = md.FindFieldByName("r_i32");
- upb::FieldDefPtr str = md.FindFieldByName("str");
- upb::FieldDefPtr r_str = md.FindFieldByName("r_str");
- upb::FieldDefPtr msg = md.FindFieldByName("msg");
- upb::FieldDefPtr r_msg = md.FindFieldByName("r_msg");
- ASSERT(i32);
- ASSERT(r_i32);
- ASSERT(str);
- ASSERT(r_str);
- ASSERT(msg);
- ASSERT(r_msg);
-
- // Establish T1 as the top-level closure type.
- ASSERT(h.SetInt32Handler(i32, UpbMakeHandler(DoNothingInt32Handler<T1>)));
-
- // Now any other attempt to set another handler with T2 as the top-level
- // closure should fail. But setting these same handlers with T1 as the
- // top-level closure will succeed.
- ASSERT(!h.SetStartMessageHandler(UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetStartMessageHandler(UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(
- !h.SetEndMessageHandler(UpbMakeHandler(DoNothingEndMessageHandler<T2>)));
- ASSERT(
- h.SetEndMessageHandler(UpbMakeHandler(DoNothingEndMessageHandler<T1>)));
-
- ASSERT(!h.SetStartStringHandler(
- str, UpbMakeHandler(DoNothingStartHandler<T1>::String<T2>)));
- ASSERT(h.SetStartStringHandler(
- str, UpbMakeHandler(DoNothingStartHandler<T1>::String<T1>)));
-
- ASSERT(!h.SetEndStringHandler(str, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndStringHandler(str, UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStartSubMessageHandler(
- msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)));
- ASSERT(h.SetStartSubMessageHandler(
- msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- ASSERT(
- !h.SetEndSubMessageHandler(msg, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(
- h.SetEndSubMessageHandler(msg, UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStartSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)));
- ASSERT(h.SetStartSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- ASSERT(!h.SetEndSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStartSequenceHandler(
- r_msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)));
- ASSERT(h.SetStartSequenceHandler(
- r_msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- ASSERT(!h.SetEndSequenceHandler(
- r_msg, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndSequenceHandler(
- r_msg, UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStartSequenceHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)));
- ASSERT(h.SetStartSequenceHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- ASSERT(!h.SetEndSequenceHandler(
- r_str, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndSequenceHandler(
- r_str, UpbMakeHandler(DoNothingHandler<T1>)));
-
- // By setting T1 as the return type for the Start* handlers we have
- // established T1 as the type of the sequence and string frames.
- // Setting callbacks that use T2 should fail, but T1 should succeed.
- ASSERT(
- !h.SetStringHandler(str, UpbMakeHandler(DoNothingStringBufHandler<T2>)));
- ASSERT(
- h.SetStringHandler(str, UpbMakeHandler(DoNothingStringBufHandler<T1>)));
-
- ASSERT(!h.SetInt32Handler(r_i32, UpbMakeHandler(DoNothingInt32Handler<T2>)));
- ASSERT(h.SetInt32Handler(r_i32, UpbMakeHandler(DoNothingInt32Handler<T1>)));
-
- ASSERT(!h.SetStartSubMessageHandler(
- r_msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T2>)));
- ASSERT(h.SetStartSubMessageHandler(
- r_msg, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- ASSERT(!h.SetEndSubMessageHandler(r_msg,
- UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndSubMessageHandler(r_msg,
- UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStartStringHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::String<T2>)));
- ASSERT(h.SetStartStringHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::String<T1>)));
-
- ASSERT(
- !h.SetEndStringHandler(r_str, UpbMakeHandler(DoNothingHandler<T2>)));
- ASSERT(h.SetEndStringHandler(r_str, UpbMakeHandler(DoNothingHandler<T1>)));
-
- ASSERT(!h.SetStringHandler(r_str,
- UpbMakeHandler(DoNothingStringBufHandler<T2>)));
- ASSERT(h.SetStringHandler(r_str,
- UpbMakeHandler(DoNothingStringBufHandler<T1>)));
-}
-
-void RegisterMismatchedTypes2(const void* closure, upb::Handlers* h_ptr) {
- upb::HandlersPtr h(h_ptr);
- UPB_UNUSED(closure);
-
- upb::MessageDefPtr md(h.message_def());
- ASSERT(md);
- upb::FieldDefPtr i32 = md.FindFieldByName("i32");
- upb::FieldDefPtr r_i32 = md.FindFieldByName("r_i32");
- upb::FieldDefPtr str = md.FindFieldByName("str");
- upb::FieldDefPtr r_str = md.FindFieldByName("r_str");
- upb::FieldDefPtr msg = md.FindFieldByName("msg");
- upb::FieldDefPtr r_msg = md.FindFieldByName("r_msg");
- ASSERT(i32);
- ASSERT(r_i32);
- ASSERT(str);
- ASSERT(r_str);
- ASSERT(msg);
- ASSERT(r_msg);
-
- // For our second test we do the same in reverse. We directly set the type of
- // the frame and then observe failures at registering a Start* handler that
- // returns a different type.
-
- // First establish the type of a sequence frame directly.
- ASSERT(h.SetInt32Handler(r_i32, UpbMakeHandler(DoNothingInt32Handler<T1>)));
-
- // Now setting a StartSequence callback that returns a different type should
- // fail.
- ASSERT(!h.SetStartSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingStartHandler<T2>::Handler<T1>)));
- ASSERT(h.SetStartSequenceHandler(
- r_i32, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-
- // Establish a string frame directly.
- ASSERT(h.SetStringHandler(r_str,
- UpbMakeHandler(DoNothingStringBufHandler<T1>)));
-
- // Fail setting a StartString callback that returns a different type.
- ASSERT(!h.SetStartStringHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T2>::String<T1>)));
- ASSERT(h.SetStartStringHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::String<T1>)));
-
- // The previous established T1 as the frame for the r_str sequence.
- ASSERT(!h.SetStartSequenceHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T2>::Handler<T1>)));
- ASSERT(h.SetStartSequenceHandler(
- r_str, UpbMakeHandler(DoNothingStartHandler<T1>::Handler<T1>)));
-}
-
-void TestMismatchedTypes() {
- // First create a schema for our test.
- upb::SymbolTable symtab;
- upb::HandlerCache handler_cache(&RegisterMismatchedTypes, nullptr);
- upb::HandlerCache handler_cache2(&RegisterMismatchedTypes2, nullptr);
- const upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
-
- // Now test the type-checking in handler registration.
- handler_cache.Get(md);
- handler_cache2.Get(md);
-}
-
-class IntIncrementer {
- public:
- explicit IntIncrementer(int* x) : x_(x) { (*x_)++; }
- ~IntIncrementer() { (*x_)--; }
-
- static void Handler(void* closure, const IntIncrementer* incrementer,
- int32_t x) {
- UPB_UNUSED(closure);
- UPB_UNUSED(incrementer);
- UPB_UNUSED(x);
- }
-
- private:
- int* x_;
-};
-
-void RegisterIncrementor(const void* closure, upb::Handlers* h_ptr) {
- const int* x = static_cast<const int*>(closure);
- upb::HandlersPtr h(h_ptr);
- upb::FieldDefPtr f = h.message_def().FindFieldByName("i32");
- h.SetInt32Handler(f, UpbBind(&IntIncrementer::Handler,
- new IntIncrementer(const_cast<int*>(x))));
-}
-
-void TestHandlerDataDestruction() {
- int x = 0;
-
- {
- upb::SymbolTable symtab;
- upb::HandlerCache cache(&RegisterIncrementor, &x);
- upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
- cache.Get(md);
- ASSERT(x == 1);
- }
-
- ASSERT(x == 0);
-}
-
-void TestIteration() {
- upb::SymbolTable symtab;
- upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
-
- // Test range-based for on both fields and oneofs (with the iterator adaptor).
- int field_count = 0;
- for (auto field : md.fields()) {
- UPB_UNUSED(field);
- field_count++;
- }
- ASSERT(field_count == md.field_count());
-
- int oneof_count = 0;
- for (auto oneof : md.oneofs()) {
- UPB_UNUSED(oneof);
- oneof_count++;
- }
- ASSERT(oneof_count == md.oneof_count());
-}
-
-void TestArena() {
- int n = 100000;
-
- struct Decrementer {
- Decrementer(int* _p) : p(_p) {}
- ~Decrementer() { (*p)--; }
- int* p;
- };
-
- {
- upb::Arena arena;
- for (int i = 0; i < n; i++) {
- arena.Own(new Decrementer(&n));
-
- // Intersperse allocation and ensure we can write to it.
- int* val = static_cast<int*>(upb_arena_malloc(arena.ptr(), sizeof(int)));
- *val = i;
- }
-
- // Test a large allocation.
- upb_arena_malloc(arena.ptr(), 1000000);
- }
- ASSERT(n == 0);
-
- {
- // Test fuse.
- upb::Arena arena1;
- upb::Arena arena2;
-
- arena1.Fuse(arena2);
-
- upb_arena_malloc(arena1.ptr(), 10000);
- upb_arena_malloc(arena2.ptr(), 10000);
- }
-}
-
-void TestInlinedArena() {
- int n = 100000;
-
- struct Decrementer {
- Decrementer(int* _p) : p(_p) {}
- ~Decrementer() { (*p)--; }
- int* p;
- };
-
- {
- upb::InlinedArena<1024> arena;
- for (int i = 0; i < n; i++) {
- arena.Own(new Decrementer(&n));
-
- // Intersperse allocation and ensure we can write to it.
- int* val = static_cast<int*>(upb_arena_malloc(arena.ptr(), sizeof(int)));
- *val = i;
- }
-
- // Test a large allocation.
- upb_arena_malloc(arena.ptr(), 1000000);
- }
- ASSERT(n == 0);
-}
-
-extern "C" {
-
-int run_tests() {
- TestHandler<ValueTesterInt32VoidFunctionNoHandlerData>();
- TestHandler<ValueTesterInt32BoolFunctionNoHandlerData>();
- TestHandler<ValueTesterInt32VoidMethodNoHandlerData>();
- TestHandler<ValueTesterInt32BoolMethodNoHandlerData>();
- TestHandler<ValueTesterInt32VoidFunctionWithHandlerData>();
- TestHandler<ValueTesterInt32BoolFunctionWithHandlerData>();
- TestHandler<ValueTesterInt32VoidMethodWithHandlerData>();
- TestHandler<ValueTesterInt32BoolMethodWithHandlerData>();
-
- TestHandler<StartMsgTesterVoidFunctionNoHandlerData>();
- TestHandler<StartMsgTesterBoolFunctionNoHandlerData>();
- TestHandler<StartMsgTesterVoidMethodNoHandlerData>();
- TestHandler<StartMsgTesterBoolMethodNoHandlerData>();
- TestHandler<StartMsgTesterVoidFunctionWithHandlerData>();
- TestHandler<StartMsgTesterBoolFunctionWithHandlerData>();
- TestHandler<StartMsgTesterVoidMethodWithHandlerData>();
- TestHandler<StartMsgTesterBoolMethodWithHandlerData>();
-
- TestHandler<StringBufTesterVoidMethodNoHandlerDataNoHandle>();
- TestHandler<StringBufTesterVoidMethodNoHandlerDataWithHandle>();
- TestHandler<StringBufTesterVoidMethodWithHandlerDataNoHandle>();
- TestHandler<StringBufTesterVoidMethodWithHandlerDataWithHandle>();
- TestHandler<StringBufTesterVoidFunctionNoHandlerDataNoHandle>();
- TestHandler<StringBufTesterVoidFunctionNoHandlerDataWithHandle>();
- TestHandler<StringBufTesterVoidFunctionWithHandlerDataNoHandle>();
- TestHandler<StringBufTesterVoidFunctionWithHandlerDataWithHandle>();
- TestHandler<StringBufTesterSizeTMethodNoHandlerDataNoHandle>();
- TestHandler<StringBufTesterBoolMethodNoHandlerDataNoHandle>();
-
- TestMismatchedTypes();
-
- TestHandlerDataDestruction();
- TestIteration();
- TestArena();
-
- return 0;
-}
-
-}
diff --git a/grpc/third_party/upb/tests/test_cpp.proto b/grpc/third_party/upb/tests/test_cpp.proto
deleted file mode 100644
index f890350e..00000000
--- a/grpc/third_party/upb/tests/test_cpp.proto
+++ /dev/null
@@ -1,12 +0,0 @@
-syntax = "proto2";
-
-package upb.test;
-
-message TestMessage {
- optional int32 i32 = 1;
- repeated int32 r_i32 = 2;
- optional string str = 3;
- repeated string r_str = 4;
- optional TestMessage msg = 5;
- repeated TestMessage r_msg = 6;
-}
diff --git a/grpc/third_party/upb/tests/test_generated_code.c b/grpc/third_party/upb/tests/test_generated_code.c
deleted file mode 100644
index bd1066b2..00000000
--- a/grpc/third_party/upb/tests/test_generated_code.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* Test of generated code, with a special focus on features that are not used in
- * descriptor.proto or conformance.proto (since these get some testing from
- * upb/def.c and tests/conformance_upb.c, respectively).
- */
-
-#include "src/google/protobuf/test_messages_proto3.upb.h"
-#include "tests/upb_test.h"
-#include "tests/test.upb.h"
-
-#define MIN(x, y) ((x) < (y) ? (x) : (y))
-
-const char test_str[] = "abcdefg";
-const char test_str2[] = "12345678910";
-const char test_str3[] = "rstlnezxcvbnm";
-const char test_str4[] = "just another test string";
-
-const upb_strview test_str_view = {test_str, sizeof(test_str) - 1};
-const upb_strview test_str_view2 = {test_str2, sizeof(test_str2) - 1};
-const upb_strview test_str_view3 = {test_str3, sizeof(test_str3) - 1};
-const upb_strview test_str_view4 = {test_str4, sizeof(test_str4) - 1};
-
-const int32_t test_int32 = 10;
-const int32_t test_int32_2 = -20;
-const int32_t test_int32_3 = 30;
-const int32_t test_int32_4 = -40;
-
-static void test_scalars(void) {
- upb_arena *arena = upb_arena_new();
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg2;
- upb_strview serialized;
- upb_strview val;
-
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int32(msg, 10);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int64(msg, 20);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_uint32(msg, 30);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_uint64(msg, 40);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_float(msg, 50.5);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_double(msg, 60.6);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_bool(msg, 1);
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_string(
- msg, test_str_view);
-
- serialized.data = protobuf_test_messages_proto3_TestAllTypesProto3_serialize(
- msg, arena, &serialized.size);
-
- msg2 = protobuf_test_messages_proto3_TestAllTypesProto3_parse(
- serialized.data, serialized.size, arena);
-
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_int32(
- msg2) == 10);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(
- msg2) == 20);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint32(
- msg2) == 30);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(
- msg2) == 40);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_float(
- msg2) - 50.5 < 0.01);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_double(
- msg2) - 60.6 < 0.01);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_optional_bool(
- msg2) == 1);
- val = protobuf_test_messages_proto3_TestAllTypesProto3_optional_string(msg2);
- ASSERT(upb_strview_eql(val, test_str_view));
-
- upb_arena_free(arena);
-}
-
-static void test_utf8(void) {
- const char invalid_utf8[] = "\xff";
- const upb_strview invalid_utf8_view = upb_strview_make(invalid_utf8, 1);
- upb_arena *arena = upb_arena_new();
- upb_strview serialized;
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg2;
-
- protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_string(
- msg, invalid_utf8_view);
-
- serialized.data = protobuf_test_messages_proto3_TestAllTypesProto3_serialize(
- msg, arena, &serialized.size);
-
- msg2 = protobuf_test_messages_proto3_TestAllTypesProto3_parse(
- serialized.data, serialized.size, arena);
- ASSERT(msg2 == NULL);
-
- upb_arena_free(arena);
-}
-
-static void check_string_map_empty(
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg) {
- size_t iter = UPB_MAP_BEGIN;
-
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_size(
- msg) == 0);
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
- msg, &iter));
-}
-
-static void check_string_map_one_entry(
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg) {
- const protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry
- *const_ent;
- size_t iter;
- upb_strview str;
-
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_size(
- msg) == 1);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_get(
- msg, test_str_view, &str));
- ASSERT(upb_strview_eql(str, test_str_view2));
-
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_get(
- msg, test_str_view3, &str));
-
- /* Test that iteration reveals a single k/v pair in the map. */
- iter = UPB_MAP_BEGIN;
- const_ent = protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
- msg, &iter);
- ASSERT(const_ent);
- ASSERT(upb_strview_eql(
- test_str_view,
- protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_key(
- const_ent)));
- ASSERT(upb_strview_eql(
- test_str_view2,
- protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_value(
- const_ent)));
-
- const_ent = protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
- msg, &iter);
- ASSERT(!const_ent);
-}
-
-static void test_string_double_map(void) {
- upb_arena *arena = upb_arena_new();
- upb_strview serialized;
- upb_test_MapTest *msg = upb_test_MapTest_new(arena);
- upb_test_MapTest *msg2;
- double val;
-
- upb_test_MapTest_map_string_double_set(msg, test_str_view, 1.5, arena);
- ASSERT(msg);
- ASSERT(upb_test_MapTest_map_string_double_get(msg, test_str_view, &val));
- ASSERT(val == 1.5);
- val = 0;
-
- serialized.data = upb_test_MapTest_serialize(msg, arena, &serialized.size);
- ASSERT(serialized.data);
-
- msg2 = upb_test_MapTest_parse(serialized.data, serialized.size, arena);
- ASSERT(msg2);
- ASSERT(upb_test_MapTest_map_string_double_get(msg2, test_str_view, &val));
- ASSERT(val == 1.5);
-
- upb_arena_free(arena);
-}
-
-static void test_string_map(void) {
- upb_arena *arena = upb_arena_new();
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
- const protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry
- *const_ent;
- size_t iter, count;
-
- check_string_map_empty(msg);
-
- /* Set map[test_str_view] = test_str_view2 */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
- msg, test_str_view, test_str_view2, arena);
- check_string_map_one_entry(msg);
-
- /* Deleting a non-existent key does nothing. */
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_delete(
- msg, test_str_view3));
- check_string_map_one_entry(msg);
-
- /* Deleting the key sets the map back to empty. */
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_delete(
- msg, test_str_view));
- check_string_map_empty(msg);
-
- /* Set two keys this time:
- * map[test_str_view] = test_str_view2
- * map[test_str_view3] = test_str_view4
- */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
- msg, test_str_view, test_str_view2, arena);
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
- msg, test_str_view3, test_str_view4, arena);
-
- /* Test iteration */
- iter = UPB_MAP_BEGIN;
- count = 0;
-
- while (
- (const_ent =
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
- msg, &iter)) != NULL) {
- upb_strview key =
- protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_key(
- const_ent);
- upb_strview val =
- protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_value(
- const_ent);
-
- count++;
- if (upb_strview_eql(key, test_str_view)) {
- ASSERT(upb_strview_eql(val, test_str_view2));
- } else {
- ASSERT(upb_strview_eql(key, test_str_view3));
- ASSERT(upb_strview_eql(val, test_str_view4));
- }
- }
-
- ASSERT(count == 2);
-
- /* Clearing the map goes back to empty. */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_clear(msg);
- check_string_map_empty(msg);
-
- upb_arena_free(arena);
-}
-
-static void check_int32_map_empty(
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg) {
- size_t iter = UPB_MAP_BEGIN;
-
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_size(
- msg) == 0);
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
- msg, &iter));
-}
-
-static void check_int32_map_one_entry(
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg) {
- const protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry
- *const_ent;
- size_t iter;
- int32_t val;
-
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_size(
- msg) == 1);
- ASSERT(protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_get(
- msg, test_int32, &val));
- ASSERT(val == test_int32_2);
-
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_get(
- msg, test_int32_3, &val));
-
- /* Test that iteration reveals a single k/v pair in the map. */
- iter = UPB_MAP_BEGIN;
- const_ent = protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
- msg, &iter);
- ASSERT(const_ent);
- ASSERT(
- test_int32 ==
- protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_key(
- const_ent));
- ASSERT(
- test_int32_2 ==
- protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_value(
- const_ent));
-
- const_ent = protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
- msg, &iter);
- ASSERT(!const_ent);
-}
-
-static void test_int32_map(void) {
- upb_arena *arena = upb_arena_new();
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
- const protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry
- *const_ent;
- size_t iter, count;
-
- check_int32_map_empty(msg);
-
- /* Set map[test_int32] = test_int32_2 */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
- msg, test_int32, test_int32_2, arena);
- check_int32_map_one_entry(msg);
-
- /* Deleting a non-existent key does nothing. */
- ASSERT(
- !protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_delete(
- msg, test_int32_3));
- check_int32_map_one_entry(msg);
-
- /* Deleting the key sets the map back to empty. */
- ASSERT(
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_delete(
- msg, test_int32));
- check_int32_map_empty(msg);
-
- /* Set two keys this time:
- * map[test_int32] = test_int32_2
- * map[test_int32_3] = test_int32_4
- */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
- msg, test_int32, test_int32_2, arena);
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
- msg, test_int32_3, test_int32_4, arena);
-
- /* Test iteration */
- iter = UPB_MAP_BEGIN;
- count = 0;
-
- while (
- (const_ent =
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
- msg, &iter)) != NULL) {
- int32_t key =
- protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_key(
- const_ent);
- int32_t val =
- protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_value(
- const_ent);
-
- count++;
- if (key == test_int32) {
- ASSERT(val == test_int32_2);
- } else {
- ASSERT(key == test_int32_3);
- ASSERT(val == test_int32_4);
- }
- }
-
- ASSERT(count == 2);
-
- /* Clearing the map goes back to empty. */
- protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_clear(msg);
- check_int32_map_empty(msg);
-
- upb_arena_free(arena);
-}
-
-void test_repeated(void) {
- upb_arena *arena = upb_arena_new();
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
- size_t size;
- const int *elems;
-
- protobuf_test_messages_proto3_TestAllTypesProto3_add_repeated_int32(
- msg, 5, arena);
-
- elems = protobuf_test_messages_proto3_TestAllTypesProto3_repeated_int32(
- msg, &size);
-
- ASSERT(size == 1);
- ASSERT(elems[0] == 5);
-
- upb_arena_free(arena);
-}
-
-void test_null_decode_buf(void) {
- upb_arena *arena = upb_arena_new();
- protobuf_test_messages_proto3_TestAllTypesProto3 *msg =
- protobuf_test_messages_proto3_TestAllTypesProto3_parse(NULL, 0, arena);
- size_t size;
-
- ASSERT(msg);
- protobuf_test_messages_proto3_TestAllTypesProto3_serialize(msg, arena, &size);
- ASSERT(size == 0);
- upb_arena_free(arena);
-}
-
-void test_status_truncation(void) {
- int i, j;
- upb_status status;
- upb_status status2;
- for (i = 0; i < UPB_STATUS_MAX_MESSAGE + 20; i++) {
- char *msg = malloc(i + 1);
- int end;
- char ch = (i % 96) + 33; /* Cycle through printable chars. */
-
- for (j = 0; j < i; j++) {
- msg[j] = ch;
- }
- msg[i] = '\0';
-
- upb_status_seterrmsg(&status, msg);
- upb_status_seterrf(&status2, "%s", msg);
- end = MIN(i, UPB_STATUS_MAX_MESSAGE - 1);
- ASSERT(strlen(status.msg) == end);
- ASSERT(strlen(status2.msg) == end);
-
- for (j = 0; j < end; j++) {
- ASSERT(status.msg[j] == ch);
- ASSERT(status2.msg[j] == ch);
- }
-
- free(msg);
- }
-}
-
-int run_tests(int argc, char *argv[]) {
- test_scalars();
- test_utf8();
- test_string_map();
- test_string_double_map();
- test_int32_map();
- test_repeated();
- test_null_decode_buf();
- test_status_truncation();
- return 0;
-}
diff --git a/grpc/third_party/upb/tests/test_table.cc b/grpc/third_party/upb/tests/test_table.cc
deleted file mode 100644
index 83b49f5c..00000000
--- a/grpc/third_party/upb/tests/test_table.cc
+++ /dev/null
@@ -1,690 +0,0 @@
-/*
- *
- * Tests for upb_table.
- */
-
-#include <limits.h>
-#include <string.h>
-#include <sys/resource.h>
-#include <iostream>
-#include <map>
-#include <set>
-#include <string>
-#include <unordered_map>
-#include <vector>
-
-#include "tests/upb_test.h"
-#include "upb/table.int.h"
-
-#include "upb/port_def.inc"
-
-// Convenience interface for C++. We don't put this in upb itself because
-// the table is not exposed to users.
-
-namespace upb {
-
-template <class T> upb_value MakeUpbValue(T val);
-template <class T> T GetUpbValue(upb_value val);
-template <class T> upb_ctype_t GetUpbValueType();
-
-#define FUNCS(name, type_t, enumval) \
- template<> upb_value MakeUpbValue<type_t>(type_t val) { return upb_value_ ## name(val); } \
- template<> type_t GetUpbValue<type_t>(upb_value val) { return upb_value_get ## name(val); } \
- template<> upb_ctype_t GetUpbValueType<type_t>() { return enumval; }
-
-FUNCS(int32, int32_t, UPB_CTYPE_INT32)
-FUNCS(int64, int64_t, UPB_CTYPE_INT64)
-FUNCS(uint32, uint32_t, UPB_CTYPE_UINT32)
-FUNCS(uint64, uint64_t, UPB_CTYPE_UINT64)
-FUNCS(bool, bool, UPB_CTYPE_BOOL)
-FUNCS(cstr, char*, UPB_CTYPE_CSTR)
-FUNCS(ptr, void*, UPB_CTYPE_PTR)
-FUNCS(constptr, const void*, UPB_CTYPE_CONSTPTR)
-FUNCS(fptr, upb_func*, UPB_CTYPE_FPTR)
-
-#undef FUNCS
-
-class IntTable {
- public:
- IntTable(upb_ctype_t value_type) { upb_inttable_init(&table_, value_type); }
- ~IntTable() { upb_inttable_uninit(&table_); }
-
- size_t count() { return upb_inttable_count(&table_); }
-
- bool Insert(uintptr_t key, upb_value val) {
- return upb_inttable_insert(&table_, key, val);
- }
-
- bool Replace(uintptr_t key, upb_value val) {
- return upb_inttable_replace(&table_, key, val);
- }
-
- std::pair<bool, upb_value> Remove(uintptr_t key) {
- std::pair<bool, upb_value> ret;
- ret.first = upb_inttable_remove(&table_, key, &ret.second);
- return ret;
- }
-
- std::pair<bool, upb_value> Lookup(uintptr_t key) const {
- std::pair<bool, upb_value> ret;
- ret.first = upb_inttable_lookup(&table_, key, &ret.second);
- return ret;
- }
-
- std::pair<bool, upb_value> Lookup32(uint32_t key) const {
- std::pair<bool, upb_value> ret;
- ret.first = upb_inttable_lookup32(&table_, key, &ret.second);
- return ret;
- }
-
- void Compact() { upb_inttable_compact(&table_); }
-
- class iterator : public std::iterator<std::forward_iterator_tag,
- std::pair<uintptr_t, upb_value> > {
- public:
- explicit iterator(IntTable* table) {
- upb_inttable_begin(&iter_, &table->table_);
- }
-
- static iterator end(IntTable* table) {
- iterator iter(table);
- upb_inttable_iter_setdone(&iter.iter_);
- return iter;
- }
-
- void operator++() {
- return upb_inttable_next(&iter_);
- }
-
- std::pair<uintptr_t, upb_value> operator*() const {
- std::pair<uintptr_t, upb_value> ret;
- ret.first = upb_inttable_iter_key(&iter_);
- ret.second = upb_inttable_iter_value(&iter_);
- return ret;
- }
-
- bool operator==(const iterator& other) const {
- return upb_inttable_iter_isequal(&iter_, &other.iter_);
- }
-
- bool operator!=(const iterator& other) const {
- return !(*this == other);
- }
-
- private:
- upb_inttable_iter iter_;
- };
-
- upb_inttable table_;
-};
-
-class StrTable {
- public:
- StrTable(upb_ctype_t value_type) { upb_strtable_init(&table_, value_type); }
- ~StrTable() { upb_strtable_uninit(&table_); }
-
- size_t count() { return upb_strtable_count(&table_); }
-
- bool Insert(const std::string& key, upb_value val) {
- return upb_strtable_insert2(&table_, key.c_str(), key.size(), val);
- }
-
- std::pair<bool, upb_value> Remove(const std::string& key) {
- std::pair<bool, upb_value> ret;
- ret.first =
- upb_strtable_remove2(&table_, key.c_str(), key.size(), &ret.second);
- return ret;
- }
-
- std::pair<bool, upb_value> Lookup(const std::string& key) const {
- std::pair<bool, upb_value> ret;
- ret.first =
- upb_strtable_lookup2(&table_, key.c_str(), key.size(), &ret.second);
- return ret;
- }
-
- void Resize(size_t size_lg2) {
- upb_strtable_resize(&table_, size_lg2, &upb_alloc_global);
- }
-
- class iterator : public std::iterator<std::forward_iterator_tag,
- std::pair<std::string, upb_value> > {
- public:
- explicit iterator(StrTable* table) {
- upb_strtable_begin(&iter_, &table->table_);
- }
-
- static iterator end(StrTable* table) {
- iterator iter(table);
- upb_strtable_iter_setdone(&iter.iter_);
- return iter;
- }
-
- void operator++() {
- return upb_strtable_next(&iter_);
- }
-
- std::pair<std::string, upb_value> operator*() const {
- std::pair<std::string, upb_value> ret;
- upb_strview view = upb_strtable_iter_key(&iter_);
- ret.first.assign(view.data, view.size);
- ret.second = upb_strtable_iter_value(&iter_);
- return ret;
- }
-
- bool operator==(const iterator& other) const {
- return upb_strtable_iter_isequal(&iter_, &other.iter_);
- }
-
- bool operator!=(const iterator& other) const {
- return !(*this == other);
- }
-
- private:
- upb_strtable_iter iter_;
- };
-
- upb_strtable table_;
-};
-
-template <class T> class TypedStrTable {
- public:
- TypedStrTable() : table_(GetUpbValueType<T>()) {}
-
- size_t count() { return table_.count(); }
-
- bool Insert(const std::string &key, T val) {
- return table_.Insert(key, MakeUpbValue<T>(val));
- }
-
- std::pair<bool, T> Remove(const std::string& key) {
- std::pair<bool, upb_value> found = table_.Remove(key);
- std::pair<bool, T> ret;
- ret.first = found.first;
- if (ret.first) {
- ret.second = GetUpbValue<T>(found.second);
- }
- return ret;
- }
-
- std::pair<bool, T> Lookup(const std::string& key) const {
- std::pair<bool, upb_value> found = table_.Lookup(key);
- std::pair<bool, T> ret;
- ret.first = found.first;
- if (ret.first) {
- ret.second = GetUpbValue<T>(found.second);
- }
- return ret;
- }
-
- void Resize(size_t size_lg2) {
- table_.Resize(size_lg2);
- }
-
- class iterator : public std::iterator<std::forward_iterator_tag, std::pair<std::string, T> > {
- public:
- explicit iterator(TypedStrTable* table) : iter_(&table->table_) {}
- static iterator end(TypedStrTable* table) {
- iterator iter(table);
- iter.iter_ = StrTable::iterator::end(&table->table_);
- return iter;
- }
-
- void operator++() { ++iter_; }
-
- std::pair<std::string, T> operator*() const {
- std::pair<std::string, upb_value> val = *iter_;
- std::pair<std::string, T> ret;
- ret.first = val.first;
- ret.second = GetUpbValue<T>(val.second);
- return ret;
- }
-
- bool operator==(const iterator& other) const {
- return iter_ == other.iter_;
- }
-
- bool operator!=(const iterator& other) const {
- return iter_ != other.iter_;
- }
-
- private:
- StrTable::iterator iter_;
- };
-
- iterator begin() { return iterator(this); }
- iterator end() { return iterator::end(this); }
-
- StrTable table_;
-};
-
-template <class T> class TypedIntTable {
- public:
- TypedIntTable() : table_(GetUpbValueType<T>()) {}
-
- size_t count() { return table_.count(); }
-
- bool Insert(uintptr_t key, T val) {
- return table_.Insert(key, MakeUpbValue<T>(val));
- }
-
- bool Replace(uintptr_t key, T val) {
- return table_.Replace(key, MakeUpbValue<T>(val));
- }
-
- std::pair<bool, T> Remove(uintptr_t key) {
- std::pair<bool, upb_value> found = table_.Remove(key);
- std::pair<bool, T> ret;
- ret.first = found.first;
- if (ret.first) {
- ret.second = GetUpbValue<T>(found.second);
- }
- return ret;
- }
-
- std::pair<bool, T> Lookup(uintptr_t key) const {
- std::pair<bool, upb_value> found = table_.Lookup(key);
- std::pair<bool, T> ret;
- ret.first = found.first;
- if (ret.first) {
- ret.second = GetUpbValue<T>(found.second);
- }
- return ret;
- }
-
- void Compact() { table_.Compact(); }
-
- class iterator : public std::iterator<std::forward_iterator_tag, std::pair<uintptr_t, T> > {
- public:
- explicit iterator(TypedIntTable* table) : iter_(&table->table_) {}
- static iterator end(TypedIntTable* table) {
- return IntTable::iterator::end(&table->table_);
- }
-
- void operator++() { ++iter_; }
-
- std::pair<uintptr_t, T> operator*() const {
- std::pair<uintptr_t, upb_value> val = *iter_;
- std::pair<uintptr_t, T> ret;
- ret.first = val.first;
- ret.second = GetUpbValue<T>(val.second);
- return ret;
- }
-
- bool operator==(const iterator& other) const {
- return iter_ == other.iter_;
- }
-
- bool operator!=(const iterator& other) const {
- return iter_ != other.iter_;
- }
-
- private:
- IntTable::iterator iter_;
- };
-
- iterator begin() { return iterator(this); }
- iterator end() { return iterator::end(this); }
-
- IntTable table_;
-};
-
-}
-
-bool benchmark = false;
-#define CPU_TIME_PER_TEST 0.5
-
-using std::vector;
-
-double get_usertime() {
- struct rusage usage;
- getrusage(RUSAGE_SELF, &usage);
- return usage.ru_utime.tv_sec + (usage.ru_utime.tv_usec/1000000.0);
-}
-
-/* num_entries must be a power of 2. */
-void test_strtable(const vector<std::string>& keys, uint32_t num_to_insert) {
- /* Initialize structures. */
- std::map<std::string, int32_t> m;
- typedef upb::TypedStrTable<int32_t> Table;
- Table table;
- std::set<std::string> all;
- for(size_t i = 0; i < num_to_insert; i++) {
- const std::string& key = keys[i];
- all.insert(key);
- table.Insert(key, key[0]);
- m[key] = key[0];
- }
-
- /* Test correctness. */
- for(uint32_t i = 0; i < keys.size(); i++) {
- const std::string& key = keys[i];
- std::pair<bool, int32_t> found = table.Lookup(key);
- if(m.find(key) != m.end()) { /* Assume map implementation is correct. */
- ASSERT(found.first);
- ASSERT(found.second == key[0]);
- ASSERT(m[key] == key[0]);
- } else {
- ASSERT(!found.first);
- }
- }
-
- for (Table::iterator it = table.begin(); it != table.end(); ++it) {
- std::set<std::string>::iterator i = all.find((*it).first);
- ASSERT(i != all.end());
- all.erase(i);
- }
- ASSERT(all.empty());
-
- // Test iteration with resizes.
-
- for (int i = 0; i < 10; i++) {
- for (Table::iterator it = table.begin(); it != table.end(); ++it) {
- // Even if we invalidate the iterator it should only return real elements.
- ASSERT((*it).second == m[(*it).first]);
-
- // Force a resize even though the size isn't changing.
- // Also forces the table size to grow so some new buckets end up empty.
- int new_lg2 = table.table_.table_.t.size_lg2 + 1;
- // Don't use more than 64k tables, to avoid exhausting memory.
- new_lg2 = UPB_MIN(new_lg2, 16);
- table.Resize(new_lg2);
- }
- }
-
-}
-
-/* num_entries must be a power of 2. */
-void test_inttable(int32_t *keys, uint16_t num_entries, const char *desc) {
- /* Initialize structures. */
- typedef upb::TypedIntTable<uint32_t> Table;
- Table table;
- uint32_t largest_key = 0;
- std::map<uint32_t, uint32_t> m;
- std::unordered_map<uint32_t, uint32_t> hm;
- for(size_t i = 0; i < num_entries; i++) {
- int32_t key = keys[i];
- largest_key = UPB_MAX((int32_t)largest_key, key);
- table.Insert(key, key * 2);
- m[key] = key*2;
- hm[key] = key*2;
- }
-
- /* Test correctness. */
- for(uint32_t i = 0; i <= largest_key; i++) {
- std::pair<bool, uint32_t> found = table.Lookup(i);
- if(m.find(i) != m.end()) { /* Assume map implementation is correct. */
- ASSERT(found.first);
- ASSERT(found.second == i*2);
- ASSERT(m[i] == i*2);
- ASSERT(hm[i] == i*2);
- } else {
- ASSERT(!found.first);
- }
- }
-
- for(uint16_t i = 0; i < num_entries; i += 2) {
- std::pair<bool, uint32_t> found = table.Remove(keys[i]);
- ASSERT(found.first == (m.erase(keys[i]) == 1));
- if (found.first) ASSERT(found.second == (uint32_t)keys[i] * 2);
- hm.erase(keys[i]);
- m.erase(keys[i]);
- }
-
- ASSERT(table.count() == hm.size());
-
- /* Test correctness. */
- for(uint32_t i = 0; i <= largest_key; i++) {
- std::pair<bool, uint32_t> found = table.Lookup(i);
- if(m.find(i) != m.end()) { /* Assume map implementation is correct. */
- ASSERT(found.first);
- ASSERT(found.second == i*2);
- ASSERT(m[i] == i*2);
- ASSERT(hm[i] == i*2);
- } else {
- ASSERT(!found.first);
- }
- }
-
- // Test replace.
- for(uint32_t i = 0; i <= largest_key; i++) {
- bool replaced = table.Replace(i, i*3);
- if(m.find(i) != m.end()) { /* Assume map implementation is correct. */
- ASSERT(replaced);
- m[i] = i * 3;
- hm[i] = i * 3;
- } else {
- ASSERT(!replaced);
- }
- }
-
- // Compact and test correctness again.
- table.Compact();
- for(uint32_t i = 0; i <= largest_key; i++) {
- std::pair<bool, uint32_t> found = table.Lookup(i);
- if(m.find(i) != m.end()) { /* Assume map implementation is correct. */
- ASSERT(found.first);
- ASSERT(found.second == i*3);
- ASSERT(m[i] == i*3);
- ASSERT(hm[i] == i*3);
- } else {
- ASSERT(!found.first);
- }
- }
-
- if(!benchmark) {
- return;
- }
-
- printf("%s\n", desc);
-
- /* Test performance. We only test lookups for keys that are known to exist. */
- uint16_t *rand_order = new uint16_t[num_entries];
- for(uint16_t i = 0; i < num_entries; i++) {
- rand_order[i] = i;
- }
- for(uint16_t i = num_entries - 1; i >= 1; i--) {
- uint16_t rand_i = (random() / (double)RAND_MAX) * i;
- ASSERT(rand_i <= i);
- uint16_t tmp = rand_order[rand_i];
- rand_order[rand_i] = rand_order[i];
- rand_order[i] = tmp;
- }
-
- uintptr_t x = 0;
- const int mask = num_entries - 1;
- int time_mask = 0xffff;
-
- printf("upb_inttable(seq): ");
- fflush(stdout);
- double before = get_usertime();
- unsigned int i;
-
-#define MAYBE_BREAK \
- if ((i & time_mask) == 0 && (get_usertime() - before) > CPU_TIME_PER_TEST) \
- break;
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[i & mask];
- upb_value v;
- bool ok = upb_inttable_lookup32(&table.table_.table_, key, &v);
- x += (uintptr_t)ok;
- }
- double total = get_usertime() - before;
- printf("%ld/s\n", (long)(i/total));
- double upb_seq_i = i / 100; // For later percentage calcuation.
-
- printf("upb_inttable(rand): ");
- fflush(stdout);
- before = get_usertime();
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[rand_order[i & mask]];
- upb_value v;
- bool ok = upb_inttable_lookup32(&table.table_.table_, key, &v);
- x += (uintptr_t)ok;
- }
- total = get_usertime() - before;
- printf("%ld/s\n", (long)(i/total));
- double upb_rand_i = i / 100; // For later percentage calculation.
-
- printf("std::map<int32_t, int32_t>(seq): ");
- fflush(stdout);
- before = get_usertime();
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[i & mask];
- x += m[key];
- }
- total = get_usertime() - before;
- printf("%ld/s (%0.1f%% of upb)\n", (long)(i/total), i / upb_seq_i);
-
- printf("std::map<int32_t, int32_t>(rand): ");
- fflush(stdout);
- before = get_usertime();
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[rand_order[i & mask]];
- x += m[key];
- }
- total = get_usertime() - before;
- printf("%ld/s (%0.1f%% of upb)\n", (long)(i/total), i / upb_rand_i);
-
- printf("std::unordered_map<uint32_t, uint32_t>(seq): ");
- fflush(stdout);
- before = get_usertime();
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[rand_order[i & mask]];
- x += hm[key];
- }
- total = get_usertime() - before;
- printf("%ld/s (%0.1f%% of upb)\n", (long)(i/total), i / upb_seq_i);
-
- printf("std::unordered_map<uint32_t, uint32_t>(rand): ");
- fflush(stdout);
- before = get_usertime();
- for(i = 0; true; i++) {
- MAYBE_BREAK;
- int32_t key = keys[rand_order[i & mask]];
- x += hm[key];
- }
- total = get_usertime() - before;
- if (x == INT_MAX) abort();
- printf("%ld/s (%0.1f%% of upb)\n\n", (long)(i/total), i / upb_rand_i);
- delete[] rand_order;
-}
-
-/*
- * This test can't pass right now because the table can't store a value of
- * (uint64_t)-1.
- */
-void test_int64_max_value() {
-/*
- typedef upb::TypedIntTable<uint64_t> Table;
- Table table;
- uintptr_t uint64_max = (uint64_t)-1;
- table.Insert(1, uint64_max);
- std::pair<bool, uint64_t> found = table.Lookup(1);
- ASSERT(found.first);
- ASSERT(found.second == uint64_max);
-*/
-}
-
-int32_t *get_contiguous_keys(int32_t num) {
- int32_t *buf = new int32_t[num];
- for(int32_t i = 0; i < num; i++)
- buf[i] = i;
- return buf;
-}
-
-void test_delete() {
- upb_inttable t;
- upb_inttable_init(&t, UPB_CTYPE_BOOL);
- upb_inttable_insert(&t, 0, upb_value_bool(true));
- upb_inttable_insert(&t, 2, upb_value_bool(true));
- upb_inttable_insert(&t, 4, upb_value_bool(true));
- upb_inttable_compact(&t);
- upb_inttable_remove(&t, 0, NULL);
- upb_inttable_remove(&t, 2, NULL);
- upb_inttable_remove(&t, 4, NULL);
-
- upb_inttable_iter iter;
- for (upb_inttable_begin(&iter, &t); !upb_inttable_done(&iter);
- upb_inttable_next(&iter)) {
- ASSERT(false);
- }
-
- upb_inttable_uninit(&t);
-}
-
-void test_init() {
- for (int i = 0; i < 2048; i++) {
- /* Tests that the size calculations in init() (lg2 size for target load)
- * work for all expected sizes. */
- upb_strtable t;
- upb_strtable_init2(&t, UPB_CTYPE_BOOL, i, &upb_alloc_global);
- upb_strtable_uninit(&t);
- }
-}
-
-extern "C" {
-
-int run_tests(int argc, char *argv[]) {
- for (int i = 1; i < argc; i++) {
- if (strcmp(argv[i], "benchmark") == 0) benchmark = true;
- }
-
- vector<std::string> keys;
- keys.push_back("google.protobuf.FileDescriptorSet");
- keys.push_back("google.protobuf.FileDescriptorProto");
- keys.push_back("google.protobuf.DescriptorProto");
- keys.push_back("google.protobuf.DescriptorProto.ExtensionRange");
- keys.push_back("google.protobuf.FieldDescriptorProto");
- keys.push_back("google.protobuf.EnumDescriptorProto");
- keys.push_back("google.protobuf.EnumValueDescriptorProto");
- keys.push_back("google.protobuf.ServiceDescriptorProto");
- keys.push_back("google.protobuf.MethodDescriptorProto");
- keys.push_back("google.protobuf.FileOptions");
- keys.push_back("google.protobuf.MessageOptions");
- keys.push_back("google.protobuf.FieldOptions");
- keys.push_back("google.protobuf.EnumOptions");
- keys.push_back("google.protobuf.EnumValueOptions");
- keys.push_back("google.protobuf.ServiceOptions");
- keys.push_back("google.protobuf.MethodOptions");
- keys.push_back("google.protobuf.UninterpretedOption");
- keys.push_back("google.protobuf.UninterpretedOption.NamePart");
-
- for (int i = 0; i < 10; i++) {
- test_strtable(keys, 18);
- }
-
- int32_t *keys1 = get_contiguous_keys(8);
- test_inttable(keys1, 8, "Table size: 8, keys: 1-8 ====");
- delete[] keys1;
-
- int32_t *keys2 = get_contiguous_keys(64);
- test_inttable(keys2, 64, "Table size: 64, keys: 1-64 ====\n");
- delete[] keys2;
-
- int32_t *keys3 = get_contiguous_keys(512);
- test_inttable(keys3, 512, "Table size: 512, keys: 1-512 ====\n");
- delete[] keys3;
-
- int32_t *keys4 = new int32_t[64];
- for(int32_t i = 0; i < 64; i++) {
- if(i < 32)
- keys4[i] = i+1;
- else
- keys4[i] = 10101+i;
- }
- test_inttable(keys4, 64, "Table size: 64, keys: 1-32 and 10133-10164 ====\n");
- delete[] keys4;
-
- test_delete();
- test_int64_max_value();
-
- return 0;
-}
-
-}
diff --git a/grpc/third_party/upb/tests/test_util.h b/grpc/third_party/upb/tests/test_util.h
deleted file mode 100644
index 418a9d88..00000000
--- a/grpc/third_party/upb/tests/test_util.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-** Common functionality for tests.
-**/
-
-#ifndef UPB_TEST_UTIL_H_
-#define UPB_TEST_UTIL_H_
-
-#include <stdio.h>
-#include <math.h>
-#include "tests/upb_test.h"
-#include "upb/sink.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-
-upb_bufhandle global_handle;
-
-/* A convenience class for parser tests. Provides some useful features:
- *
- * - can support multiple calls to parse, to test the parser's handling
- * of buffer seams.
- *
- * - can output verbose output about each parse call when requested, for
- * ease of debugging.
- *
- * - can pass NULL for skipped regions of the input if requested.
- *
- * - allocates and passes a separate buffer for each parsed region, to
- * ensure that the parser is not erroneously overreading its buffer.
- */
-class VerboseParserEnvironment {
- public:
- /* Pass verbose=true to print detailed diagnostics to stderr. */
- VerboseParserEnvironment(bool verbose) : verbose_(verbose) {}
-
- void Reset(const char *buf, size_t len, bool may_skip, bool expect_error) {
- buf_ = buf;
- len_ = len;
- ofs_ = 0;
- expect_error_ = expect_error;
- end_ok_set_ = false;
- skip_until_ = may_skip ? 0 : -1;
- skipped_with_null_ = false;
- }
-
- /* The user should call a series of:
- *
- * Reset(buf, len, may_skip);
- * Start()
- * ParseBuffer(X);
- * ParseBuffer(Y);
- * // Repeat ParseBuffer as desired, but last call should pass -1.
- * ParseBuffer(-1);
- * End();
- */
-
-
- bool Start() {
- if (verbose_) {
- fprintf(stderr, "Calling start()\n");
- }
- return sink_.Start(len_, &subc_);
- }
-
- bool End() {
- if (verbose_) {
- fprintf(stderr, "Calling end()\n");
- }
- end_ok_ = sink_.End();
- end_ok_set_ = true;
-
- return end_ok_;
- }
-
- bool CheckConsistency() {
- /* If we called end (which we should only do when previous bytes are fully
- * accepted), then end() should return true iff there were no errors. */
- if (end_ok_set_ && end_ok_ != status_.ok()) {
- fprintf(stderr, "End() status and saw_error didn't match.\n");
- return false;
- }
-
- if (expect_error_ && status_.ok()) {
- fprintf(stderr, "Expected error but saw none.\n");
- return false;
- }
-
- if (!status_.ok()) {
- if (expect_error_ && verbose_) {
- fprintf(stderr, "Encountered error, as expected: %s",
- status_.error_message());
- } else if (!expect_error_) {
- fprintf(stderr, "Encountered unexpected error: %s",
- status_.error_message());
- return false;
- }
- }
-
- return true;
- }
-
- bool ParseBuffer(int bytes) {
- if (bytes < 0) {
- bytes = (int)(len_ - ofs_);
- }
-
- ASSERT((size_t)bytes <= (len_ - ofs_));
-
- /* Copy buffer into a separate, temporary buffer.
- * This is necessary to verify that the parser is not erroneously
- * reading outside the specified bounds. */
- char *buf2 = NULL;
-
- if ((int)(ofs_ + bytes) <= skip_until_) {
- skipped_with_null_ = true;
- } else {
- buf2 = (char*)malloc(bytes);
- UPB_ASSERT(buf2);
- memcpy(buf2, buf_ + ofs_, bytes);
- }
-
- if (buf2 == NULL && bytes == 0) {
- /* Decoders dont' support buf=NULL, bytes=0. */
- return true;
- }
-
- if (verbose_) {
- fprintf(stderr, "Calling parse(%u) for bytes %u-%u of the input\n",
- (unsigned)bytes, (unsigned)ofs_, (unsigned)(ofs_ + bytes));
- }
-
- int parsed = (int)sink_.PutBuffer(subc_, buf2, bytes, &global_handle);
- free(buf2);
-
- if (verbose_) {
- if (parsed == bytes) {
- fprintf(stderr,
- "parse(%u) = %u, complete byte count indicates success\n",
- (unsigned)bytes, (unsigned)bytes);
- } else if (parsed > bytes) {
- fprintf(stderr,
- "parse(%u) = %u, long byte count indicates success and skip "
- "of the next %u bytes\n",
- (unsigned)bytes, (unsigned)parsed, (unsigned)(parsed - bytes));
- } else {
- fprintf(stderr,
- "parse(%u) = %u, short byte count indicates failure; "
- "last %u bytes were not consumed\n",
- (unsigned)bytes, (unsigned)parsed, (unsigned)(bytes - parsed));
- }
- }
-
- if (!status_.ok()) {
- return false;
- }
-
- if (parsed > bytes && skip_until_ >= 0) {
- skip_until_ = (int)(ofs_ + parsed);
- }
-
- ofs_ += UPB_MIN(parsed, bytes);
-
- return true;
- }
-
- void ResetBytesSink(upb::BytesSink sink) {
- sink_ = sink;
- }
-
- size_t ofs() { return ofs_; }
-
- bool SkippedWithNull() { return skipped_with_null_; }
-
- upb::Arena* arena() { return &arena_; }
- upb::Status* status() { return &status_; }
-
- private:
- upb::Arena arena_;
- upb::Status status_;
- upb::BytesSink sink_;
- const char* buf_;
- size_t len_;
- bool verbose_;
- size_t ofs_;
- void *subc_;
- bool expect_error_;
- bool end_ok_;
- bool end_ok_set_;
-
- /* When our parse call returns a value greater than the number of bytes
- * we passed in, the decoder is indicating to us that the next N bytes
- * in the stream are not needed and can be skipped. The user is allowed
- * to pass a NULL buffer for those N bytes.
- *
- * skip_until_ is initially set to 0 if we should do this NULL-buffer
- * skipping or -1 if we should not. If we are open to doing NULL-buffer
- * skipping and we get an opportunity to do it, we set skip_until to the
- * stream offset where we can skip until. The user can then test whether
- * this happened by testing SkippedWithNull(). */
- int skip_until_;
- bool skipped_with_null_;
-};
-
-#endif /* __cplusplus */
-
-UPB_INLINE char *upb_readfile(const char *filename, size_t *len) {
- long size;
- char *buf;
- FILE *f = fopen(filename, "rb");
- if(!f) return NULL;
- if(fseek(f, 0, SEEK_END) != 0) goto error;
- size = ftell(f);
- if(size < 0) goto error;
- if(fseek(f, 0, SEEK_SET) != 0) goto error;
- buf = (char*)malloc(size + 1);
- if(size && fread(buf, size, 1, f) != 1) goto error;
- fclose(f);
- if (len) *len = size;
- buf[size] = '\0';
- return buf;
-
-error:
- fclose(f);
- return NULL;
-}
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_TEST_UTIL_H_ */
diff --git a/grpc/third_party/upb/tests/testmain.cc b/grpc/third_party/upb/tests/testmain.cc
deleted file mode 100644
index 97dd7169..00000000
--- a/grpc/third_party/upb/tests/testmain.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#include <stdlib.h>
-#ifdef USE_GOOGLE
-#include "base/init_google.h"
-#endif
-
-extern "C" {
-int run_tests(int argc, char *argv[]);
-}
-
-int main(int argc, char *argv[]) {
-#ifdef USE_GOOGLE
- InitGoogle(NULL, &argc, &argv, true);
-#endif
- run_tests(argc, argv);
-}
diff --git a/grpc/third_party/upb/tests/upb_test.h b/grpc/third_party/upb/tests/upb_test.h
deleted file mode 100644
index d4b06883..00000000
--- a/grpc/third_party/upb/tests/upb_test.h
+++ /dev/null
@@ -1,53 +0,0 @@
-
-#ifndef UPB_TEST_H_
-#define UPB_TEST_H_
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int num_assertions = 0;
-uint32_t testhash = 0;
-
-#define PRINT_FAILURE(expr) \
- fprintf(stderr, "Assertion failed: %s:%d\n", __FILE__, __LINE__); \
- fprintf(stderr, "expr: %s\n", #expr); \
- if (testhash) { \
- fprintf(stderr, "assertion failed running test %x. " \
- "Run with the arg %x to run only this test.\n", \
- testhash, testhash); \
- }
-
-#define ASSERT(expr) do { \
- ++num_assertions; \
- if (!(expr)) { \
- PRINT_FAILURE(expr) \
- abort(); \
- } \
-} while (0)
-
-#define ASSERT_NOCOUNT(expr) do { \
- if (!(expr)) { \
- PRINT_FAILURE(expr) \
- abort(); \
- } \
-} while (0)
-
-#define ASSERT_STATUS(expr, status) do { \
- ++num_assertions; \
- if (!(expr)) { \
- PRINT_FAILURE(expr) \
- fprintf(stderr, "failed status: %s\n", upb_status_errmsg(status)); \
- abort(); \
- } \
-} while (0)
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* UPB_DECODER_H_ */
diff --git a/grpc/third_party/upb/third_party/utf8_range/BUILD b/grpc/third_party/upb/third_party/utf8_range/BUILD
new file mode 100644
index 00000000..4a8a82b5
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/BUILD
@@ -0,0 +1,19 @@
+
+# Pulled from: https://github.com/cyb70289/utf8
+
+cc_library(
+ name = "utf8_range",
+ hdrs = ["utf8_range.h"],
+ srcs = [
+ "naive.c",
+ "range2-neon.c",
+ "range2-sse.c",
+ ],
+ visibility = ["//:__pkg__"],
+)
+
+filegroup(
+ name = "cmake_files",
+ srcs = glob(["*"]),
+ visibility = ["//cmake:__pkg__"],
+)
diff --git a/grpc/third_party/upb/third_party/utf8_range/LICENSE b/grpc/third_party/upb/third_party/utf8_range/LICENSE
new file mode 100644
index 00000000..c1f087ec
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Yibo Cai
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/grpc/third_party/upb/third_party/utf8_range/naive.c b/grpc/third_party/upb/third_party/utf8_range/naive.c
new file mode 100644
index 00000000..9b7e5bb4
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/naive.c
@@ -0,0 +1,92 @@
+#include <stdio.h>
+
+/*
+ * http://www.unicode.org/versions/Unicode6.0.0/ch03.pdf - page 94
+ *
+ * Table 3-7. Well-Formed UTF-8 Byte Sequences
+ *
+ * +--------------------+------------+-------------+------------+-------------+
+ * | Code Points | First Byte | Second Byte | Third Byte | Fourth Byte |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+0000..U+007F | 00..7F | | | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+0080..U+07FF | C2..DF | 80..BF | | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+0800..U+0FFF | E0 | A0..BF | 80..BF | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+1000..U+CFFF | E1..EC | 80..BF | 80..BF | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+D000..U+D7FF | ED | 80..9F | 80..BF | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+E000..U+FFFF | EE..EF | 80..BF | 80..BF | |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+10000..U+3FFFF | F0 | 90..BF | 80..BF | 80..BF |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+40000..U+FFFFF | F1..F3 | 80..BF | 80..BF | 80..BF |
+ * +--------------------+------------+-------------+------------+-------------+
+ * | U+100000..U+10FFFF | F4 | 80..8F | 80..BF | 80..BF |
+ * +--------------------+------------+-------------+------------+-------------+
+ */
+
+/* Return 0 - success, >0 - index(1 based) of first error char */
+int utf8_naive(const unsigned char *data, int len)
+{
+ int err_pos = 1;
+
+ while (len) {
+ int bytes;
+ const unsigned char byte1 = data[0];
+
+ /* 00..7F */
+ if (byte1 <= 0x7F) {
+ bytes = 1;
+ /* C2..DF, 80..BF */
+ } else if (len >= 2 && byte1 >= 0xC2 && byte1 <= 0xDF &&
+ (signed char)data[1] <= (signed char)0xBF) {
+ bytes = 2;
+ } else if (len >= 3) {
+ const unsigned char byte2 = data[1];
+
+ /* Is byte2, byte3 between 0x80 ~ 0xBF */
+ const int byte2_ok = (signed char)byte2 <= (signed char)0xBF;
+ const int byte3_ok = (signed char)data[2] <= (signed char)0xBF;
+
+ if (byte2_ok && byte3_ok &&
+ /* E0, A0..BF, 80..BF */
+ ((byte1 == 0xE0 && byte2 >= 0xA0) ||
+ /* E1..EC, 80..BF, 80..BF */
+ (byte1 >= 0xE1 && byte1 <= 0xEC) ||
+ /* ED, 80..9F, 80..BF */
+ (byte1 == 0xED && byte2 <= 0x9F) ||
+ /* EE..EF, 80..BF, 80..BF */
+ (byte1 >= 0xEE && byte1 <= 0xEF))) {
+ bytes = 3;
+ } else if (len >= 4) {
+ /* Is byte4 between 0x80 ~ 0xBF */
+ const int byte4_ok = (signed char)data[3] <= (signed char)0xBF;
+
+ if (byte2_ok && byte3_ok && byte4_ok &&
+ /* F0, 90..BF, 80..BF, 80..BF */
+ ((byte1 == 0xF0 && byte2 >= 0x90) ||
+ /* F1..F3, 80..BF, 80..BF, 80..BF */
+ (byte1 >= 0xF1 && byte1 <= 0xF3) ||
+ /* F4, 80..8F, 80..BF, 80..BF */
+ (byte1 == 0xF4 && byte2 <= 0x8F))) {
+ bytes = 4;
+ } else {
+ return err_pos;
+ }
+ } else {
+ return err_pos;
+ }
+ } else {
+ return err_pos;
+ }
+
+ len -= bytes;
+ err_pos += bytes;
+ data += bytes;
+ }
+
+ return 0;
+}
diff --git a/grpc/third_party/upb/third_party/utf8_range/range2-neon.c b/grpc/third_party/upb/third_party/utf8_range/range2-neon.c
new file mode 100644
index 00000000..68339654
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/range2-neon.c
@@ -0,0 +1,157 @@
+/*
+ * Process 2x16 bytes in each iteration.
+ * Comments removed for brevity. See range-neon.c for details.
+ */
+#if defined(__aarch64__) && defined(__ARM_NEON)
+
+#include <stdio.h>
+#include <stdint.h>
+#include <arm_neon.h>
+
+int utf8_naive(const unsigned char *data, int len);
+
+static const uint8_t _first_len_tbl[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3,
+};
+
+static const uint8_t _first_range_tbl[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8,
+};
+
+static const uint8_t _range_min_tbl[] = {
+ 0x00, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x90, 0x80,
+ 0xC2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+};
+static const uint8_t _range_max_tbl[] = {
+ 0x7F, 0xBF, 0xBF, 0xBF, 0xBF, 0x9F, 0xBF, 0x8F,
+ 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+static const uint8_t _range_adjust_tbl[] = {
+ 2, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+};
+
+/* Return 0 on success, -1 on error */
+int utf8_range2(const unsigned char *data, int len)
+{
+ if (len >= 32) {
+ uint8x16_t prev_input = vdupq_n_u8(0);
+ uint8x16_t prev_first_len = vdupq_n_u8(0);
+
+ const uint8x16_t first_len_tbl = vld1q_u8(_first_len_tbl);
+ const uint8x16_t first_range_tbl = vld1q_u8(_first_range_tbl);
+ const uint8x16_t range_min_tbl = vld1q_u8(_range_min_tbl);
+ const uint8x16_t range_max_tbl = vld1q_u8(_range_max_tbl);
+ const uint8x16x2_t range_adjust_tbl = vld2q_u8(_range_adjust_tbl);
+
+ const uint8x16_t const_1 = vdupq_n_u8(1);
+ const uint8x16_t const_2 = vdupq_n_u8(2);
+ const uint8x16_t const_e0 = vdupq_n_u8(0xE0);
+
+ uint8x16_t error1 = vdupq_n_u8(0);
+ uint8x16_t error2 = vdupq_n_u8(0);
+ uint8x16_t error3 = vdupq_n_u8(0);
+ uint8x16_t error4 = vdupq_n_u8(0);
+
+ while (len >= 32) {
+ /******************* two blocks interleaved **********************/
+
+#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 8)
+ /* gcc doesn't support vldq1_u8_x2 until version 8 */
+ const uint8x16_t input_a = vld1q_u8(data);
+ const uint8x16_t input_b = vld1q_u8(data + 16);
+#else
+ /* Forces a double load on Clang */
+ const uint8x16x2_t input_pair = vld1q_u8_x2(data);
+ const uint8x16_t input_a = input_pair.val[0];
+ const uint8x16_t input_b = input_pair.val[1];
+#endif
+
+ const uint8x16_t high_nibbles_a = vshrq_n_u8(input_a, 4);
+ const uint8x16_t high_nibbles_b = vshrq_n_u8(input_b, 4);
+
+ const uint8x16_t first_len_a =
+ vqtbl1q_u8(first_len_tbl, high_nibbles_a);
+ const uint8x16_t first_len_b =
+ vqtbl1q_u8(first_len_tbl, high_nibbles_b);
+
+ uint8x16_t range_a = vqtbl1q_u8(first_range_tbl, high_nibbles_a);
+ uint8x16_t range_b = vqtbl1q_u8(first_range_tbl, high_nibbles_b);
+
+ range_a =
+ vorrq_u8(range_a, vextq_u8(prev_first_len, first_len_a, 15));
+ range_b =
+ vorrq_u8(range_b, vextq_u8(first_len_a, first_len_b, 15));
+
+ uint8x16_t tmp1_a, tmp2_a, tmp1_b, tmp2_b;
+ tmp1_a = vextq_u8(prev_first_len, first_len_a, 14);
+ tmp1_a = vqsubq_u8(tmp1_a, const_1);
+ range_a = vorrq_u8(range_a, tmp1_a);
+
+ tmp1_b = vextq_u8(first_len_a, first_len_b, 14);
+ tmp1_b = vqsubq_u8(tmp1_b, const_1);
+ range_b = vorrq_u8(range_b, tmp1_b);
+
+ tmp2_a = vextq_u8(prev_first_len, first_len_a, 13);
+ tmp2_a = vqsubq_u8(tmp2_a, const_2);
+ range_a = vorrq_u8(range_a, tmp2_a);
+
+ tmp2_b = vextq_u8(first_len_a, first_len_b, 13);
+ tmp2_b = vqsubq_u8(tmp2_b, const_2);
+ range_b = vorrq_u8(range_b, tmp2_b);
+
+ uint8x16_t shift1_a = vextq_u8(prev_input, input_a, 15);
+ uint8x16_t pos_a = vsubq_u8(shift1_a, const_e0);
+ range_a = vaddq_u8(range_a, vqtbl2q_u8(range_adjust_tbl, pos_a));
+
+ uint8x16_t shift1_b = vextq_u8(input_a, input_b, 15);
+ uint8x16_t pos_b = vsubq_u8(shift1_b, const_e0);
+ range_b = vaddq_u8(range_b, vqtbl2q_u8(range_adjust_tbl, pos_b));
+
+ uint8x16_t minv_a = vqtbl1q_u8(range_min_tbl, range_a);
+ uint8x16_t maxv_a = vqtbl1q_u8(range_max_tbl, range_a);
+
+ uint8x16_t minv_b = vqtbl1q_u8(range_min_tbl, range_b);
+ uint8x16_t maxv_b = vqtbl1q_u8(range_max_tbl, range_b);
+
+ error1 = vorrq_u8(error1, vcltq_u8(input_a, minv_a));
+ error2 = vorrq_u8(error2, vcgtq_u8(input_a, maxv_a));
+
+ error3 = vorrq_u8(error3, vcltq_u8(input_b, minv_b));
+ error4 = vorrq_u8(error4, vcgtq_u8(input_b, maxv_b));
+
+ /************************ next iteration *************************/
+ prev_input = input_b;
+ prev_first_len = first_len_b;
+
+ data += 32;
+ len -= 32;
+ }
+ error1 = vorrq_u8(error1, error2);
+ error1 = vorrq_u8(error1, error3);
+ error1 = vorrq_u8(error1, error4);
+
+ if (vmaxvq_u8(error1))
+ return -1;
+
+ uint32_t token4;
+ vst1q_lane_u32(&token4, vreinterpretq_u32_u8(prev_input), 3);
+
+ const int8_t *token = (const int8_t *)&token4;
+ int lookahead = 0;
+ if (token[3] > (int8_t)0xBF)
+ lookahead = 1;
+ else if (token[2] > (int8_t)0xBF)
+ lookahead = 2;
+ else if (token[1] > (int8_t)0xBF)
+ lookahead = 3;
+
+ data -= lookahead;
+ len += lookahead;
+ }
+
+ return utf8_naive(data, len);
+}
+
+#endif
diff --git a/grpc/third_party/upb/third_party/utf8_range/range2-sse.c b/grpc/third_party/upb/third_party/utf8_range/range2-sse.c
new file mode 100644
index 00000000..f3deb860
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/range2-sse.c
@@ -0,0 +1,170 @@
+/*
+ * Process 2x16 bytes in each iteration.
+ * Comments removed for brevity. See range-sse.c for details.
+ */
+#ifdef __SSE4_1__
+
+#include <stdio.h>
+#include <stdint.h>
+#include <x86intrin.h>
+
+int utf8_naive(const unsigned char *data, int len);
+
+static const int8_t _first_len_tbl[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3,
+};
+
+static const int8_t _first_range_tbl[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8,
+};
+
+static const int8_t _range_min_tbl[] = {
+ 0x00, 0x80, 0x80, 0x80, 0xA0, 0x80, 0x90, 0x80,
+ 0xC2, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
+};
+static const int8_t _range_max_tbl[] = {
+ 0x7F, 0xBF, 0xBF, 0xBF, 0xBF, 0x9F, 0xBF, 0x8F,
+ 0xF4, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+};
+
+static const int8_t _df_ee_tbl[] = {
+ 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+};
+static const int8_t _ef_fe_tbl[] = {
+ 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/* Return 0 on success, -1 on error */
+int utf8_range2(const unsigned char *data, int len)
+{
+ if (len >= 32) {
+ __m128i prev_input = _mm_set1_epi8(0);
+ __m128i prev_first_len = _mm_set1_epi8(0);
+
+ const __m128i first_len_tbl =
+ _mm_loadu_si128((const __m128i *)_first_len_tbl);
+ const __m128i first_range_tbl =
+ _mm_loadu_si128((const __m128i *)_first_range_tbl);
+ const __m128i range_min_tbl =
+ _mm_loadu_si128((const __m128i *)_range_min_tbl);
+ const __m128i range_max_tbl =
+ _mm_loadu_si128((const __m128i *)_range_max_tbl);
+ const __m128i df_ee_tbl =
+ _mm_loadu_si128((const __m128i *)_df_ee_tbl);
+ const __m128i ef_fe_tbl =
+ _mm_loadu_si128((const __m128i *)_ef_fe_tbl);
+
+ __m128i error = _mm_set1_epi8(0);
+
+ while (len >= 32) {
+ /***************************** block 1 ****************************/
+ const __m128i input_a = _mm_loadu_si128((const __m128i *)data);
+
+ __m128i high_nibbles =
+ _mm_and_si128(_mm_srli_epi16(input_a, 4), _mm_set1_epi8(0x0F));
+
+ __m128i first_len_a = _mm_shuffle_epi8(first_len_tbl, high_nibbles);
+
+ __m128i range_a = _mm_shuffle_epi8(first_range_tbl, high_nibbles);
+
+ range_a = _mm_or_si128(
+ range_a, _mm_alignr_epi8(first_len_a, prev_first_len, 15));
+
+ __m128i tmp;
+ tmp = _mm_alignr_epi8(first_len_a, prev_first_len, 14);
+ tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(1));
+ range_a = _mm_or_si128(range_a, tmp);
+
+ tmp = _mm_alignr_epi8(first_len_a, prev_first_len, 13);
+ tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(2));
+ range_a = _mm_or_si128(range_a, tmp);
+
+ __m128i shift1, pos, range2;
+ shift1 = _mm_alignr_epi8(input_a, prev_input, 15);
+ pos = _mm_sub_epi8(shift1, _mm_set1_epi8(0xEF));
+ tmp = _mm_subs_epu8(pos, _mm_set1_epi8(0xF0));
+ range2 = _mm_shuffle_epi8(df_ee_tbl, tmp);
+ tmp = _mm_adds_epu8(pos, _mm_set1_epi8(0x70));
+ range2 = _mm_add_epi8(range2, _mm_shuffle_epi8(ef_fe_tbl, tmp));
+
+ range_a = _mm_add_epi8(range_a, range2);
+
+ __m128i minv = _mm_shuffle_epi8(range_min_tbl, range_a);
+ __m128i maxv = _mm_shuffle_epi8(range_max_tbl, range_a);
+
+ tmp = _mm_or_si128(
+ _mm_cmplt_epi8(input_a, minv),
+ _mm_cmpgt_epi8(input_a, maxv)
+ );
+ error = _mm_or_si128(error, tmp);
+
+ /***************************** block 2 ****************************/
+ const __m128i input_b = _mm_loadu_si128((const __m128i *)(data+16));
+
+ high_nibbles =
+ _mm_and_si128(_mm_srli_epi16(input_b, 4), _mm_set1_epi8(0x0F));
+
+ __m128i first_len_b = _mm_shuffle_epi8(first_len_tbl, high_nibbles);
+
+ __m128i range_b = _mm_shuffle_epi8(first_range_tbl, high_nibbles);
+
+ range_b = _mm_or_si128(
+ range_b, _mm_alignr_epi8(first_len_b, first_len_a, 15));
+
+
+ tmp = _mm_alignr_epi8(first_len_b, first_len_a, 14);
+ tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(1));
+ range_b = _mm_or_si128(range_b, tmp);
+
+ tmp = _mm_alignr_epi8(first_len_b, first_len_a, 13);
+ tmp = _mm_subs_epu8(tmp, _mm_set1_epi8(2));
+ range_b = _mm_or_si128(range_b, tmp);
+
+ shift1 = _mm_alignr_epi8(input_b, input_a, 15);
+ pos = _mm_sub_epi8(shift1, _mm_set1_epi8(0xEF));
+ tmp = _mm_subs_epu8(pos, _mm_set1_epi8(0xF0));
+ range2 = _mm_shuffle_epi8(df_ee_tbl, tmp);
+ tmp = _mm_adds_epu8(pos, _mm_set1_epi8(0x70));
+ range2 = _mm_add_epi8(range2, _mm_shuffle_epi8(ef_fe_tbl, tmp));
+
+ range_b = _mm_add_epi8(range_b, range2);
+
+ minv = _mm_shuffle_epi8(range_min_tbl, range_b);
+ maxv = _mm_shuffle_epi8(range_max_tbl, range_b);
+
+
+ tmp = _mm_or_si128(
+ _mm_cmplt_epi8(input_b, minv),
+ _mm_cmpgt_epi8(input_b, maxv)
+ );
+ error = _mm_or_si128(error, tmp);
+
+ /************************ next iteration **************************/
+ prev_input = input_b;
+ prev_first_len = first_len_b;
+
+ data += 32;
+ len -= 32;
+ }
+
+ if (!_mm_testz_si128(error, error))
+ return -1;
+
+ int32_t token4 = _mm_extract_epi32(prev_input, 3);
+ const int8_t *token = (const int8_t *)&token4;
+ int lookahead = 0;
+ if (token[3] > (int8_t)0xBF)
+ lookahead = 1;
+ else if (token[2] > (int8_t)0xBF)
+ lookahead = 2;
+ else if (token[1] > (int8_t)0xBF)
+ lookahead = 3;
+
+ data -= lookahead;
+ len += lookahead;
+ }
+
+ return utf8_naive(data, len);
+}
+
+#endif
diff --git a/grpc/third_party/upb/third_party/utf8_range/utf8_range.h b/grpc/third_party/upb/third_party/utf8_range/utf8_range.h
new file mode 100644
index 00000000..d426608c
--- /dev/null
+++ b/grpc/third_party/upb/third_party/utf8_range/utf8_range.h
@@ -0,0 +1,9 @@
+
+#if 0
+int utf8_range2(const unsigned char* data, int len);
+#else
+int utf8_naive(const unsigned char* data, int len);
+static inline int utf8_range2(const unsigned char* data, int len) {
+ return utf8_naive(data, len);
+}
+#endif
diff --git a/grpc/third_party/upb/third_party/wyhash/BUILD b/grpc/third_party/upb/third_party/wyhash/BUILD
deleted file mode 100644
index f3f3a6fb..00000000
--- a/grpc/third_party/upb/third_party/wyhash/BUILD
+++ /dev/null
@@ -1,17 +0,0 @@
-licenses(["unencumbered"])
-
-exports_files(["LICENSE"])
-
-cc_library(
- name = "wyhash",
- hdrs = ["wyhash.h"],
- visibility = ["//:__pkg__"],
-)
-
-filegroup(
- name = "cmake_files",
- srcs = glob([
- "**/*",
- ]),
- visibility = ["//cmake:__pkg__"],
-)
diff --git a/grpc/third_party/upb/third_party/wyhash/LICENSE b/grpc/third_party/upb/third_party/wyhash/LICENSE
deleted file mode 100644
index 471f09f4..00000000
--- a/grpc/third_party/upb/third_party/wyhash/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
-
diff --git a/grpc/third_party/upb/third_party/wyhash/wyhash.h b/grpc/third_party/upb/third_party/wyhash/wyhash.h
deleted file mode 100644
index 5658f02d..00000000
--- a/grpc/third_party/upb/third_party/wyhash/wyhash.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Copyright 2020 王侀 Wang Yi <godspeed_china@yeah.net>
- This is free and unencumbered software released into the public domain. http://unlicense.org/
- See github.com/wangyi-fudan/wyhash/ LICENSE
- */
-#ifndef wyhash_final_version
-#define wyhash_final_version
-//defines that change behavior
-#ifndef WYHASH_CONDOM
-#define WYHASH_CONDOM 1 //0: read 8 bytes before and after boundaries, dangerous but fastest. 1: normal valid behavior 2: extra protection against entropy loss (probability=2^-63), aka. "blind multiplication"
-#endif
-#define WYHASH_32BIT_MUM 0 //faster on 32 bit system
-//includes
-#include <stdint.h>
-#include <string.h>
-#if defined(_MSC_VER) && defined(_M_X64)
- #include <intrin.h>
- #pragma intrinsic(_umul128)
-#endif
-#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
- #define _likely_(x) __builtin_expect(x,1)
- #define _unlikely_(x) __builtin_expect(x,0)
-#else
- #define _likely_(x) (x)
- #define _unlikely_(x) (x)
-#endif
-//mum function
-static inline uint64_t _wyrot(uint64_t x) { return (x>>32)|(x<<32); }
-static inline void _wymum(uint64_t *A, uint64_t *B){
-#if(WYHASH_32BIT_MUM)
- uint64_t hh=(*A>>32)*(*B>>32), hl=(*A>>32)*(unsigned)*B, lh=(unsigned)*A*(*B>>32), ll=(uint64_t)(unsigned)*A*(unsigned)*B;
- #if(WYHASH_CONDOM>1)
- *A^=_wyrot(hl)^hh; *B^=_wyrot(lh)^ll;
- #else
- *A=_wyrot(hl)^hh; *B=_wyrot(lh)^ll;
- #endif
-#elif defined(__SIZEOF_INT128__)
- __uint128_t r=*A; r*=*B;
- #if(WYHASH_CONDOM>1)
- *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
- #else
- *A=(uint64_t)r; *B=(uint64_t)(r>>64);
- #endif
-#elif defined(_MSC_VER) && defined(_M_X64)
- #if(WYHASH_CONDOM>1)
- uint64_t a, b;
- a=_umul128(*A,*B,&b);
- *A^=a; *B^=b;
- #else
- *A=_umul128(*A,*B,B);
- #endif
-#else
- uint64_t ha=*A>>32, hb=*B>>32, la=(uint32_t)*A, lb=(uint32_t)*B, hi, lo;
- uint64_t rh=ha*hb, rm0=ha*lb, rm1=hb*la, rl=la*lb, t=rl+(rm0<<32), c=t<rl;
- lo=t+(rm1<<32); c+=lo<t; hi=rh+(rm0>>32)+(rm1>>32)+c;
- #if(WYHASH_CONDOM>1)
- *A^=lo; *B^=hi;
- #else
- *A=lo; *B=hi;
- #endif
-#endif
-}
-static inline uint64_t _wymix(uint64_t A, uint64_t B){ _wymum(&A,&B); return A^B; }
-//read functions
-#ifndef WYHASH_LITTLE_ENDIAN
- #if defined(_WIN32) || defined(__LITTLE_ENDIAN__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #define WYHASH_LITTLE_ENDIAN 1
- #elif defined(__BIG_ENDIAN__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
- #define WYHASH_LITTLE_ENDIAN 0
- #endif
-#endif
-#if (WYHASH_LITTLE_ENDIAN)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return v;}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return v;}
-#elif defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return __builtin_bswap64(v);}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return __builtin_bswap32(v);}
-#elif defined(_MSC_VER)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return _byteswap_uint64(v);}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return _byteswap_ulong(v);}
-#endif
-static inline uint64_t _wyr3(const uint8_t *p, unsigned k) { return (((uint64_t)p[0])<<16)|(((uint64_t)p[k>>1])<<8)|p[k-1];}
-//wyhash function
-static inline uint64_t _wyfinish16(const uint8_t *p, uint64_t len, uint64_t seed, const uint64_t *secret, uint64_t i){
-#if(WYHASH_CONDOM>0)
- uint64_t a, b;
- if(_likely_(i<=8)){
- if(_likely_(i>=4)){ a=_wyr4(p); b=_wyr4(p+i-4); }
- else if (_likely_(i)){ a=_wyr3(p,i); b=0; }
- else a=b=0;
- }
- else{ a=_wyr8(p); b=_wyr8(p+i-8); }
- return _wymix(secret[1]^len,_wymix(a^secret[1], b^seed));
-#else
- #define oneshot_shift ((i<8)*((8-i)<<3))
- return _wymix(secret[1]^len,_wymix((_wyr8(p)<<oneshot_shift)^secret[1],(_wyr8(p+i-8)>>oneshot_shift)^seed));
-#endif
-}
-
-static inline uint64_t _wyfinish(const uint8_t *p, uint64_t len, uint64_t seed, const uint64_t *secret, uint64_t i){
- if(_likely_(i<=16)) return _wyfinish16(p,len,seed,secret,i);
- return _wyfinish(p+16,len,_wymix(_wyr8(p)^secret[1],_wyr8(p+8)^seed),secret,i-16);
-}
-
-static inline uint64_t wyhash(const void *key, uint64_t len, uint64_t seed, const uint64_t *secret){
- const uint8_t *p=(const uint8_t *)key;
- uint64_t i=len; seed^=*secret;
- if(_unlikely_(i>64)){
- uint64_t see1=seed;
- do{
- seed=_wymix(_wyr8(p)^secret[1],_wyr8(p+8)^seed)^_wymix(_wyr8(p+16)^secret[2],_wyr8(p+24)^seed);
- see1=_wymix(_wyr8(p+32)^secret[3],_wyr8(p+40)^see1)^_wymix(_wyr8(p+48)^secret[4],_wyr8(p+56)^see1);
- p+=64; i-=64;
- }while(i>64);
- seed^=see1;
- }
- return _wyfinish(p,len,seed,secret,i);
-}
-//utility functions
-const uint64_t _wyp[5] = {0xa0761d6478bd642full, 0xe7037ed1a0b428dbull, 0x8ebc6af09c88c6e3ull, 0x589965cc75374cc3ull, 0x1d8e4e27c47d124full};
-static inline uint64_t wyhash64(uint64_t A, uint64_t B){ A^=_wyp[0]; B^=_wyp[1]; _wymum(&A,&B); return _wymix(A^_wyp[0],B^_wyp[1]);}
-static inline uint64_t wyrand(uint64_t *seed){ *seed+=_wyp[0]; return _wymix(*seed,*seed^_wyp[1]);}
-static inline double wy2u01(uint64_t r){ const double _wynorm=1.0/(1ull<<52); return (r>>12)*_wynorm;}
-static inline double wy2gau(uint64_t r){ const double _wynorm=1.0/(1ull<<20); return ((r&0x1fffff)+((r>>21)&0x1fffff)+((r>>42)&0x1fffff))*_wynorm-3.0;}
-static inline uint64_t wy2u0k(uint64_t r, uint64_t k){ _wymum(&r,&k); return k; }
-
-static inline void make_secret(uint64_t seed, uint64_t *secret){
- uint8_t c[] = {15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178, 180, 184, 195, 197, 198, 201, 202, 204, 209, 210, 212, 216, 225, 226, 228, 232, 240 };
- for(size_t i=0;i<5;i++){
- uint8_t ok;
- do{
- ok=1; secret[i]=0;
- for(size_t j=0;j<64;j+=8) secret[i]|=((uint64_t)c[wyrand(&seed)%sizeof(c)])<<j;
- if(secret[i]%2==0){ ok=0; continue; }
- for(size_t j=0;j<i;j++)
-#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
- if(__builtin_popcountll(secret[j]^secret[i])!=32){ ok=0; break; }
-#elif defined(_MSC_VER) && defined(_M_X64)
- if(_mm_popcnt_u64(secret[j]^secret[i])!=32){ ok=0; break; }
-#endif
- if(!ok)continue;
- for(uint64_t j=3;j<0x100000000ull;j+=2) if(secret[i]%j==0){ ok=0; break; }
- }while(!ok);
- }
-}
-#endif
diff --git a/grpc/third_party/upb/tools/amalgamate.py b/grpc/third_party/upb/tools/amalgamate.py
deleted file mode 100755
index b244eff8..00000000
--- a/grpc/third_party/upb/tools/amalgamate.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import re
-import os
-
-INCLUDE_RE = re.compile('^#include "([^"]*)"$')
-
-def parse_include(line):
- match = INCLUDE_RE.match(line)
- return match.groups()[0] if match else None
-
-class Amalgamator:
- def __init__(self, output_path, prefix):
- self.include_paths = ["."]
- self.included = set(["upb/port_def.inc", "upb/port_undef.inc"])
- self.output_h = open(output_path + prefix + "upb.h", "w")
- self.output_c = open(output_path + prefix + "upb.c", "w")
-
- self.output_c.write("/* Amalgamated source file */\n")
- self.output_c.write('#include "%supb.h"\n' % (prefix))
- self.output_c.write(open("upb/port_def.inc").read())
-
- self.output_h.write("/* Amalgamated source file */\n")
- self.output_h.write('#include <stdint.h>')
- self.output_h.write(open("upb/port_def.inc").read())
-
- def add_include_path(self, path):
- self.include_paths.append(path)
-
- def finish(self):
- self.output_c.write(open("upb/port_undef.inc").read())
- self.output_h.write(open("upb/port_undef.inc").read())
-
- def _process_file(self, infile_name, outfile):
- file = None
- for path in self.include_paths:
- try:
- full_path = os.path.join(path, infile_name)
- file = open(full_path)
- break
- except IOError:
- pass
- if not file:
- raise RuntimeError("Couldn't open file " + infile_name)
-
- for line in file:
- if not self._process_include(line, outfile):
- outfile.write(line)
-
- def _process_include(self, line, outfile):
- include = parse_include(line)
- if not include:
- return False
- if not (include.startswith("upb") or include.startswith("google")):
- return False
- if include.endswith("hpp"):
- # Skip, we don't support the amalgamation from C++.
- return True
- else:
- # Include this upb header inline.
- if include not in self.included:
- self.included.add(include)
- self._add_header(include)
- return True
-
- def _add_header(self, filename):
- self._process_file(filename, self.output_h)
-
- def add_src(self, filename):
- self._process_file(filename, self.output_c)
-
-# ---- main ----
-
-output_path = sys.argv[1]
-prefix = sys.argv[2]
-amalgamator = Amalgamator(output_path, prefix)
-files = []
-
-for arg in sys.argv[3:]:
- arg = arg.strip()
- if arg.startswith("-I"):
- amalgamator.add_include_path(arg[2:])
- elif arg.endswith(".h") or arg.endswith(".inc"):
- pass
- else:
- files.append(arg)
-
-for filename in files:
- amalgamator.add_src(filename)
-
-amalgamator.finish()
diff --git a/grpc/third_party/upb/upb/bindings/README b/grpc/third_party/upb/upb/bindings/README
deleted file mode 100644
index 3e176c94..00000000
--- a/grpc/third_party/upb/upb/bindings/README
+++ /dev/null
@@ -1,5 +0,0 @@
-This directory contains code that interfaces upb with external C/C++
-libraries. Right now this is:
-
- * upb/bindings/lua:
- a Lua extension that exposes upb to Lua programs via the Lua C API.
diff --git a/grpc/third_party/upb/upb/bindings/lua/BUILD b/grpc/third_party/upb/upb/bindings/lua/BUILD
index 3b794a85..9bb14f5a 100644
--- a/grpc/third_party/upb/upb/bindings/lua/BUILD
+++ b/grpc/third_party/upb/upb/bindings/lua/BUILD
@@ -1,8 +1,37 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
"UPB_DEFAULT_CPPOPTS",
)
+load(
+ "//upb/bindings/lua:lua_proto_library.bzl",
+ "lua_proto_library",
+)
licenses(["notice"])
@@ -39,3 +68,62 @@ cc_binary(
)
exports_files(["upb.lua"])
+
+cc_test(
+ name = "test_lua",
+ srcs = ["main.c"],
+ copts = UPB_DEFAULT_COPTS,
+ data = [
+ "test_upb.lua",
+ ":descriptor_proto_lua",
+ ":empty_proto_lua",
+ ":test_messages_proto2_proto_lua",
+ ":test_messages_proto3_proto_lua",
+ ":test_proto_lua",
+ "//:third_party/lunit/console.lua",
+ "//:third_party/lunit/lunit.lua",
+ "//upb/bindings/lua:upb.lua",
+ "@com_google_protobuf//:conformance_proto",
+ "@com_google_protobuf//:descriptor_proto",
+ ],
+ linkstatic = 1,
+ deps = [
+ "//upb/bindings/lua:lupb",
+ "@lua//:liblua",
+ ],
+)
+
+proto_library(
+ name = "test_proto",
+ testonly = 1,
+ srcs = ["test.proto"],
+ deps = ["@com_google_protobuf//:timestamp_proto"],
+)
+
+lua_proto_library(
+ name = "test_proto_lua",
+ testonly = 1,
+ deps = [":test_proto"],
+)
+
+lua_proto_library(
+ name = "descriptor_proto_lua",
+ deps = ["@com_google_protobuf//:descriptor_proto"],
+)
+
+lua_proto_library(
+ name = "empty_proto_lua",
+ deps = ["@com_google_protobuf//:empty_proto"],
+)
+
+lua_proto_library(
+ name = "test_messages_proto3_proto_lua",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
+)
+
+lua_proto_library(
+ name = "test_messages_proto2_proto_lua",
+ testonly = 1,
+ deps = ["@com_google_protobuf//:test_messages_proto2_proto"],
+)
diff --git a/grpc/third_party/upb/upb/bindings/lua/README.md b/grpc/third_party/upb/upb/bindings/lua/README.md
new file mode 100644
index 00000000..9d50e4fe
--- /dev/null
+++ b/grpc/third_party/upb/upb/bindings/lua/README.md
@@ -0,0 +1,8 @@
+
+# upb Lua bindings
+
+These are some bare-bones upb bindings for Lua.
+
+These bindings exist primarily for experimentation and testing. They are
+incomplete and are not really intended for use in any application. This is by
+no means a complete or supported protobuf library.
diff --git a/grpc/third_party/upb/upb/bindings/lua/def.c b/grpc/third_party/upb/upb/bindings/lua/def.c
index a1e87205..13211671 100644
--- a/grpc/third_party/upb/upb/bindings/lua/def.c
+++ b/grpc/third_party/upb/upb/bindings/lua/def.c
@@ -1,13 +1,43 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/def.h"
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
+
#include "lauxlib.h"
#include "upb/bindings/lua/upb.h"
-#include "upb/def.h"
+#include "upb/reflection.h"
#define LUPB_ENUMDEF "lupb.enumdef"
+#define LUPB_ENUMVALDEF "lupb.enumvaldef"
#define LUPB_FIELDDEF "lupb.fielddef"
#define LUPB_FILEDEF "lupb.filedef"
#define LUPB_MSGDEF "lupb.msgdef"
@@ -15,8 +45,8 @@
#define LUPB_SYMTAB "lupb.symtab"
#define LUPB_OBJCACHE "lupb.objcache"
-static void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
- const char *type);
+static void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def,
+ const char* type);
/* lupb_wrapper ***************************************************************/
@@ -26,16 +56,16 @@ static void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
#define LUPB_SYMTAB_INDEX 1
typedef struct {
- const void* def; /* upb_msgdef, upb_enumdef, upb_oneofdef, etc. */
+ const void* def; /* upb_MessageDef, upb_EnumDef, upb_OneofDef, etc. */
} lupb_wrapper;
-static const void *lupb_wrapper_check(lua_State *L, int narg,
- const char *type) {
- lupb_wrapper *w = luaL_checkudata(L, narg, type);
+static const void* lupb_wrapper_check(lua_State* L, int narg,
+ const char* type) {
+ lupb_wrapper* w = luaL_checkudata(L, narg, type);
return w->def;
}
-static void lupb_wrapper_pushsymtab(lua_State *L, int narg) {
+static void lupb_wrapper_pushsymtab(lua_State* L, int narg) {
lua_getiuservalue(L, narg, LUPB_SYMTAB_INDEX);
}
@@ -43,122 +73,95 @@ static void lupb_wrapper_pushsymtab(lua_State *L, int narg) {
*
* For a given def wrapper at index |narg|, pushes a wrapper for the given |def|
* and the given |type|. The new wrapper will be part of the same symtab. */
-static void lupb_wrapper_pushwrapper(lua_State *L, int narg, const void *def,
- const char *type) {
+static void lupb_wrapper_pushwrapper(lua_State* L, int narg, const void* def,
+ const char* type) {
lupb_wrapper_pushsymtab(L, narg);
- lupb_symtab_pushwrapper(L, -1, def, type);
- lua_replace(L, -2); /* Remove symtab from stack. */
+ lupb_DefPool_pushwrapper(L, -1, def, type);
+ lua_replace(L, -2); /* Remove symtab from stack. */
}
-/* lupb_msgdef_pushsubmsgdef()
+/* lupb_MessageDef_pushsubmsgdef()
*
* Pops the msgdef wrapper at the top of the stack and replaces it with a msgdef
- * wrapper for field |f| of this msgdef (submsg may not be direct, for example it
- * may be the submessage of the map value).
+ * wrapper for field |f| of this msgdef (submsg may not be direct, for example
+ * it may be the submessage of the map value).
*/
-void lupb_msgdef_pushsubmsgdef(lua_State *L, const upb_fielddef *f) {
- const upb_msgdef *m = upb_fielddef_msgsubdef(f);
+void lupb_MessageDef_pushsubmsgdef(lua_State* L, const upb_FieldDef* f) {
+ const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f);
assert(m);
lupb_wrapper_pushwrapper(L, -1, m, LUPB_MSGDEF);
- lua_replace(L, -2); /* Replace msgdef with submsgdef. */
+ lua_replace(L, -2); /* Replace msgdef with submsgdef. */
}
-/* lupb_fielddef **************************************************************/
+/* lupb_FieldDef **************************************************************/
-const upb_fielddef *lupb_fielddef_check(lua_State *L, int narg) {
+const upb_FieldDef* lupb_FieldDef_check(lua_State* L, int narg) {
return lupb_wrapper_check(L, narg, LUPB_FIELDDEF);
}
-static int lupb_fielddef_containingoneof(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- const upb_oneofdef *o = upb_fielddef_containingoneof(f);
+static int lupb_FieldDef_ContainingOneof(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ const upb_OneofDef* o = upb_FieldDef_ContainingOneof(f);
lupb_wrapper_pushwrapper(L, 1, o, LUPB_ONEOFDEF);
return 1;
}
-static int lupb_fielddef_containingtype(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- const upb_msgdef *m = upb_fielddef_containingtype(f);
+static int lupb_FieldDef_ContainingType(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ const upb_MessageDef* m = upb_FieldDef_ContainingType(f);
lupb_wrapper_pushwrapper(L, 1, m, LUPB_MSGDEF);
return 1;
}
-static int lupb_fielddef_default(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM:
- lupb_pushint32(L, upb_fielddef_defaultint32(f)); break;
- case UPB_TYPE_INT64:
- lupb_pushint64(L, upb_fielddef_defaultint64(f)); break;
- case UPB_TYPE_UINT32:
- lupb_pushuint32(L, upb_fielddef_defaultuint32(f)); break;
- case UPB_TYPE_UINT64:
- lupb_pushuint64(L, upb_fielddef_defaultuint64(f)); break;
- case UPB_TYPE_DOUBLE:
- lua_pushnumber(L, upb_fielddef_defaultdouble(f)); break;
- case UPB_TYPE_FLOAT:
- lua_pushnumber(L, upb_fielddef_defaultfloat(f)); break;
- case UPB_TYPE_BOOL:
- lua_pushboolean(L, upb_fielddef_defaultbool(f)); break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES: {
- size_t len;
- const char *data = upb_fielddef_defaultstr(f, &len);
- lua_pushlstring(L, data, len);
- break;
- }
- case UPB_TYPE_MESSAGE:
- return luaL_error(L, "Message fields do not have explicit defaults.");
+static int lupb_FieldDef_Default(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ upb_CType type = upb_FieldDef_CType(f);
+ if (type == kUpb_CType_Message) {
+ return luaL_error(L, "Message fields do not have explicit defaults.");
}
+ lupb_pushmsgval(L, 0, type, upb_FieldDef_Default(f));
return 1;
}
-static int lupb_fielddef_descriptortype(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushnumber(L, upb_fielddef_descriptortype(f));
+static int lupb_FieldDef_Type(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushnumber(L, upb_FieldDef_Type(f));
return 1;
}
-static int lupb_fielddef_hassubdef(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushboolean(L, upb_fielddef_hassubdef(f));
+static int lupb_FieldDef_HasSubDef(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushboolean(L, upb_FieldDef_HasSubDef(f));
return 1;
}
-static int lupb_fielddef_index(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushinteger(L, upb_fielddef_index(f));
+static int lupb_FieldDef_Index(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushinteger(L, upb_FieldDef_Index(f));
return 1;
}
-static int lupb_fielddef_isextension(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushboolean(L, upb_fielddef_isextension(f));
+static int lupb_FieldDef_IsExtension(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushboolean(L, upb_FieldDef_IsExtension(f));
return 1;
}
-static int lupb_fielddef_label(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushinteger(L, upb_fielddef_label(f));
+static int lupb_FieldDef_Label(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushinteger(L, upb_FieldDef_Label(f));
return 1;
}
-static int lupb_fielddef_lazy(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushboolean(L, upb_fielddef_lazy(f));
+static int lupb_FieldDef_Name(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushstring(L, upb_FieldDef_Name(f));
return 1;
}
-static int lupb_fielddef_name(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushstring(L, upb_fielddef_name(f));
- return 1;
-}
-
-static int lupb_fielddef_number(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- int32_t num = upb_fielddef_number(f);
+static int lupb_FieldDef_Number(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ int32_t num = upb_FieldDef_Number(f);
if (num) {
lua_pushinteger(L, num);
} else {
@@ -167,92 +170,90 @@ static int lupb_fielddef_number(lua_State *L) {
return 1;
}
-static int lupb_fielddef_packed(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushboolean(L, upb_fielddef_packed(f));
+static int lupb_FieldDef_IsPacked(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushboolean(L, upb_FieldDef_IsPacked(f));
return 1;
}
-static int lupb_fielddef_msgsubdef(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- const upb_msgdef *m = upb_fielddef_msgsubdef(f);
+static int lupb_FieldDef_MessageSubDef(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f);
lupb_wrapper_pushwrapper(L, 1, m, LUPB_MSGDEF);
return 1;
}
-static int lupb_fielddef_enumsubdef(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- const upb_enumdef *e = upb_fielddef_enumsubdef(f);
+static int lupb_FieldDef_EnumSubDef(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ const upb_EnumDef* e = upb_FieldDef_EnumSubDef(f);
lupb_wrapper_pushwrapper(L, 1, e, LUPB_ENUMDEF);
return 1;
}
-static int lupb_fielddef_type(lua_State *L) {
- const upb_fielddef *f = lupb_fielddef_check(L, 1);
- lua_pushinteger(L, upb_fielddef_type(f));
+static int lupb_FieldDef_CType(lua_State* L) {
+ const upb_FieldDef* f = lupb_FieldDef_check(L, 1);
+ lua_pushinteger(L, upb_FieldDef_CType(f));
return 1;
}
-static const struct luaL_Reg lupb_fielddef_m[] = {
- {"containing_oneof", lupb_fielddef_containingoneof},
- {"containing_type", lupb_fielddef_containingtype},
- {"default", lupb_fielddef_default},
- {"descriptor_type", lupb_fielddef_descriptortype},
- {"has_subdef", lupb_fielddef_hassubdef},
- {"index", lupb_fielddef_index},
- {"is_extension", lupb_fielddef_isextension},
- {"label", lupb_fielddef_label},
- {"lazy", lupb_fielddef_lazy},
- {"name", lupb_fielddef_name},
- {"number", lupb_fielddef_number},
- {"packed", lupb_fielddef_packed},
- {"msgsubdef", lupb_fielddef_msgsubdef},
- {"enumsubdef", lupb_fielddef_enumsubdef},
- {"type", lupb_fielddef_type},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_FieldDef_m[] = {
+ {"containing_oneof", lupb_FieldDef_ContainingOneof},
+ {"containing_type", lupb_FieldDef_ContainingType},
+ {"default", lupb_FieldDef_Default},
+ {"descriptor_type", lupb_FieldDef_Type},
+ {"has_subdef", lupb_FieldDef_HasSubDef},
+ {"index", lupb_FieldDef_Index},
+ {"is_extension", lupb_FieldDef_IsExtension},
+ {"label", lupb_FieldDef_Label},
+ {"name", lupb_FieldDef_Name},
+ {"number", lupb_FieldDef_Number},
+ {"packed", lupb_FieldDef_IsPacked},
+ {"msgsubdef", lupb_FieldDef_MessageSubDef},
+ {"enumsubdef", lupb_FieldDef_EnumSubDef},
+ {"type", lupb_FieldDef_CType},
+ {NULL, NULL}};
-/* lupb_oneofdef **************************************************************/
+/* lupb_OneofDef **************************************************************/
-const upb_oneofdef *lupb_oneofdef_check(lua_State *L, int narg) {
+const upb_OneofDef* lupb_OneofDef_check(lua_State* L, int narg) {
return lupb_wrapper_check(L, narg, LUPB_ONEOFDEF);
}
-static int lupb_oneofdef_containingtype(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, 1);
- const upb_msgdef *m = upb_oneofdef_containingtype(o);
+static int lupb_OneofDef_ContainingType(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, 1);
+ const upb_MessageDef* m = upb_OneofDef_ContainingType(o);
lupb_wrapper_pushwrapper(L, 1, m, LUPB_MSGDEF);
return 1;
}
-static int lupb_oneofdef_field(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, 1);
+static int lupb_OneofDef_Field(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, 1);
int32_t idx = lupb_checkint32(L, 2);
- int count = upb_oneofdef_fieldcount(o);
+ int count = upb_OneofDef_FieldCount(o);
if (idx < 0 || idx >= count) {
- const char *msg = lua_pushfstring(L, "index %d exceeds field count %d",
- idx, count);
+ const char* msg =
+ lua_pushfstring(L, "index %d exceeds field count %d", idx, count);
return luaL_argerror(L, 2, msg);
}
- lupb_wrapper_pushwrapper(L, 1, upb_oneofdef_field(o, idx), LUPB_FIELDDEF);
+ lupb_wrapper_pushwrapper(L, 1, upb_OneofDef_Field(o, idx), LUPB_FIELDDEF);
return 1;
}
-static int lupb_oneofiter_next(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, lua_upvalueindex(1));
- int *index = lua_touserdata(L, lua_upvalueindex(2));
- const upb_fielddef *f;
- if (*index == upb_oneofdef_fieldcount(o)) return 0;
- f = upb_oneofdef_field(o, (*index)++);
+static int lupb_oneofiter_next(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, lua_upvalueindex(1));
+ int* index = lua_touserdata(L, lua_upvalueindex(2));
+ const upb_FieldDef* f;
+ if (*index == upb_OneofDef_FieldCount(o)) return 0;
+ f = upb_OneofDef_Field(o, (*index)++);
lupb_wrapper_pushwrapper(L, lua_upvalueindex(1), f, LUPB_FIELDDEF);
return 1;
}
-static int lupb_oneofdef_fields(lua_State *L) {
- int *index = lua_newuserdata(L, sizeof(int));
- lupb_oneofdef_check(L, 1);
+static int lupb_OneofDef_Fields(lua_State* L) {
+ int* index = lua_newuserdata(L, sizeof(int));
+ lupb_OneofDef_check(L, 1);
*index = 0;
/* Closure upvalues are: oneofdef, index. */
@@ -260,31 +261,31 @@ static int lupb_oneofdef_fields(lua_State *L) {
return 1;
}
-static int lupb_oneofdef_len(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, 1);
- lua_pushinteger(L, upb_oneofdef_fieldcount(o));
+static int lupb_OneofDef_len(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, 1);
+ lua_pushinteger(L, upb_OneofDef_FieldCount(o));
return 1;
}
-/* lupb_oneofdef_lookupfield()
+/* lupb_OneofDef_lookupfield()
*
* Handles:
* oneof.lookup_field(field_number)
* oneof.lookup_field(field_name)
*/
-static int lupb_oneofdef_lookupfield(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, 1);
- const upb_fielddef *f;
+static int lupb_OneofDef_lookupfield(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, 1);
+ const upb_FieldDef* f;
switch (lua_type(L, 2)) {
case LUA_TNUMBER:
- f = upb_oneofdef_itof(o, lua_tointeger(L, 2));
+ f = upb_OneofDef_LookupNumber(o, lua_tointeger(L, 2));
break;
case LUA_TSTRING:
- f = upb_oneofdef_ntofz(o, lua_tostring(L, 2));
+ f = upb_OneofDef_LookupName(o, lua_tostring(L, 2));
break;
default: {
- const char *msg = lua_pushfstring(L, "number or string expected, got %s",
+ const char* msg = lua_pushfstring(L, "number or string expected, got %s",
luaL_typename(L, 2));
return luaL_argerror(L, 2, msg);
}
@@ -294,88 +295,86 @@ static int lupb_oneofdef_lookupfield(lua_State *L) {
return 1;
}
-static int lupb_oneofdef_name(lua_State *L) {
- const upb_oneofdef *o = lupb_oneofdef_check(L, 1);
- lua_pushstring(L, upb_oneofdef_name(o));
+static int lupb_OneofDef_Name(lua_State* L) {
+ const upb_OneofDef* o = lupb_OneofDef_check(L, 1);
+ lua_pushstring(L, upb_OneofDef_Name(o));
return 1;
}
-static const struct luaL_Reg lupb_oneofdef_m[] = {
- {"containing_type", lupb_oneofdef_containingtype},
- {"field", lupb_oneofdef_field},
- {"fields", lupb_oneofdef_fields},
- {"lookup_field", lupb_oneofdef_lookupfield},
- {"name", lupb_oneofdef_name},
- {NULL, NULL}
-};
-
-static const struct luaL_Reg lupb_oneofdef_mm[] = {
- {"__len", lupb_oneofdef_len},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_OneofDef_m[] = {
+ {"containing_type", lupb_OneofDef_ContainingType},
+ {"field", lupb_OneofDef_Field},
+ {"fields", lupb_OneofDef_Fields},
+ {"lookup_field", lupb_OneofDef_lookupfield},
+ {"name", lupb_OneofDef_Name},
+ {NULL, NULL}};
+static const struct luaL_Reg lupb_OneofDef_mm[] = {{"__len", lupb_OneofDef_len},
+ {NULL, NULL}};
-/* lupb_msgdef ****************************************************************/
+/* lupb_MessageDef
+ * ****************************************************************/
typedef struct {
- const upb_msgdef *md;
-} lupb_msgdef;
+ const upb_MessageDef* md;
+} lupb_MessageDef;
-const upb_msgdef *lupb_msgdef_check(lua_State *L, int narg) {
+const upb_MessageDef* lupb_MessageDef_check(lua_State* L, int narg) {
return lupb_wrapper_check(L, narg, LUPB_MSGDEF);
}
-static int lupb_msgdef_fieldcount(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushinteger(L, upb_msgdef_fieldcount(m));
+static int lupb_MessageDef_FieldCount(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushinteger(L, upb_MessageDef_FieldCount(m));
return 1;
}
-static int lupb_msgdef_oneofcount(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushinteger(L, upb_msgdef_oneofcount(m));
+static int lupb_MessageDef_OneofCount(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushinteger(L, upb_MessageDef_OneofCount(m));
return 1;
}
-static bool lupb_msgdef_pushnested(lua_State *L, int msgdef, int name) {
- const upb_msgdef *m = lupb_msgdef_check(L, msgdef);
+static bool lupb_MessageDef_pushnested(lua_State* L, int msgdef, int name) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, msgdef);
lupb_wrapper_pushsymtab(L, msgdef);
- upb_symtab *symtab = lupb_symtab_check(L, -1);
+ upb_DefPool* symtab = lupb_DefPool_check(L, -1);
lua_pop(L, 1);
/* Construct full package.Message.SubMessage name. */
- lua_pushstring(L, upb_msgdef_fullname(m));
+ lua_pushstring(L, upb_MessageDef_FullName(m));
lua_pushstring(L, ".");
lua_pushvalue(L, name);
lua_concat(L, 3);
- const char *nested_name = lua_tostring(L, -1);
+ const char* nested_name = lua_tostring(L, -1);
/* Try lookup. */
- const upb_msgdef *nested = upb_symtab_lookupmsg(symtab, nested_name);
+ const upb_MessageDef* nested =
+ upb_DefPool_FindMessageByName(symtab, nested_name);
if (!nested) return false;
lupb_wrapper_pushwrapper(L, msgdef, nested, LUPB_MSGDEF);
return true;
}
-/* lupb_msgdef_field()
+/* lupb_MessageDef_Field()
*
* Handles:
* msg.field(field_number) -> fielddef
* msg.field(field_name) -> fielddef
*/
-static int lupb_msgdef_field(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- const upb_fielddef *f;
+static int lupb_MessageDef_Field(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ const upb_FieldDef* f;
switch (lua_type(L, 2)) {
case LUA_TNUMBER:
- f = upb_msgdef_itof(m, lua_tointeger(L, 2));
+ f = upb_MessageDef_FindFieldByNumber(m, lua_tointeger(L, 2));
break;
case LUA_TSTRING:
- f = upb_msgdef_ntofz(m, lua_tostring(L, 2));
+ f = upb_MessageDef_FindFieldByName(m, lua_tostring(L, 2));
break;
default: {
- const char *msg = lua_pushfstring(L, "number or string expected, got %s",
+ const char* msg = lua_pushfstring(L, "number or string expected, got %s",
luaL_typename(L, 2));
return luaL_argerror(L, 2, msg);
}
@@ -385,17 +384,17 @@ static int lupb_msgdef_field(lua_State *L) {
return 1;
}
-/* lupb_msgdef_lookupname()
+/* lupb_MessageDef_FindByNameWithSize()
*
* Handles:
* msg.lookup_name(name) -> fielddef or oneofdef
*/
-static int lupb_msgdef_lookupname(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- const upb_fielddef *f;
- const upb_oneofdef *o;
+static int lupb_MessageDef_FindByNameWithSize(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ const upb_FieldDef* f;
+ const upb_OneofDef* o;
- if (!upb_msgdef_lookupnamez(m, lua_tostring(L, 2), &f, &o)) {
+ if (!upb_MessageDef_FindByName(m, lua_tostring(L, 2), &f, &o)) {
lua_pushnil(L);
} else if (o) {
lupb_wrapper_pushwrapper(L, 1, o, LUPB_ONEOFDEF);
@@ -406,30 +405,30 @@ static int lupb_msgdef_lookupname(lua_State *L) {
return 1;
}
-/* lupb_msgdef_name()
+/* lupb_MessageDef_Name()
*
* Handles:
* msg.name() -> string
*/
-static int lupb_msgdef_name(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushstring(L, upb_msgdef_name(m));
+static int lupb_MessageDef_Name(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushstring(L, upb_MessageDef_Name(m));
return 1;
}
-static int lupb_msgfielditer_next(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, lua_upvalueindex(1));
- int *index = lua_touserdata(L, lua_upvalueindex(2));
- const upb_fielddef *f;
- if (*index == upb_msgdef_fieldcount(m)) return 0;
- f = upb_msgdef_field(m, (*index)++);
+static int lupb_msgfielditer_next(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, lua_upvalueindex(1));
+ int* index = lua_touserdata(L, lua_upvalueindex(2));
+ const upb_FieldDef* f;
+ if (*index == upb_MessageDef_FieldCount(m)) return 0;
+ f = upb_MessageDef_Field(m, (*index)++);
lupb_wrapper_pushwrapper(L, lua_upvalueindex(1), f, LUPB_FIELDDEF);
return 1;
}
-static int lupb_msgdef_fields(lua_State *L) {
- int *index = lua_newuserdata(L, sizeof(int));
- lupb_msgdef_check(L, 1);
+static int lupb_MessageDef_Fields(lua_State* L) {
+ int* index = lua_newuserdata(L, sizeof(int));
+ lupb_MessageDef_check(L, 1);
*index = 0;
/* Closure upvalues are: msgdef, index. */
@@ -437,39 +436,39 @@ static int lupb_msgdef_fields(lua_State *L) {
return 1;
}
-static int lupb_msgdef_file(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- const upb_filedef *file = upb_msgdef_file(m);
+static int lupb_MessageDef_File(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ const upb_FileDef* file = upb_MessageDef_File(m);
lupb_wrapper_pushwrapper(L, 1, file, LUPB_FILEDEF);
return 1;
}
-static int lupb_msgdef_fullname(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushstring(L, upb_msgdef_fullname(m));
+static int lupb_MessageDef_FullName(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushstring(L, upb_MessageDef_FullName(m));
return 1;
}
-static int lupb_msgdef_index(lua_State *L) {
- if (!lupb_msgdef_pushnested(L, 1, 2)) {
+static int lupb_MessageDef_index(lua_State* L) {
+ if (!lupb_MessageDef_pushnested(L, 1, 2)) {
luaL_error(L, "No such nested message");
}
return 1;
}
-static int lupb_msgoneofiter_next(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, lua_upvalueindex(1));
- int *index = lua_touserdata(L, lua_upvalueindex(2));
- const upb_oneofdef *o;
- if (*index == upb_msgdef_oneofcount(m)) return 0;
- o = upb_msgdef_oneof(m, (*index)++);
+static int lupb_msgoneofiter_next(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, lua_upvalueindex(1));
+ int* index = lua_touserdata(L, lua_upvalueindex(2));
+ const upb_OneofDef* o;
+ if (*index == upb_MessageDef_OneofCount(m)) return 0;
+ o = upb_MessageDef_Oneof(m, (*index)++);
lupb_wrapper_pushwrapper(L, lua_upvalueindex(1), o, LUPB_ONEOFDEF);
return 1;
}
-static int lupb_msgdef_oneofs(lua_State *L) {
- int *index = lua_newuserdata(L, sizeof(int));
- lupb_msgdef_check(L, 1);
+static int lupb_MessageDef_Oneofs(lua_State* L) {
+ int* index = lua_newuserdata(L, sizeof(int));
+ lupb_MessageDef_check(L, 1);
*index = 0;
/* Closure upvalues are: msgdef, index. */
@@ -477,226 +476,227 @@ static int lupb_msgdef_oneofs(lua_State *L) {
return 1;
}
-static int lupb_msgdef_mapentry(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushboolean(L, upb_msgdef_mapentry(m));
+static int lupb_MessageDef_IsMapEntry(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushboolean(L, upb_MessageDef_IsMapEntry(m));
return 1;
}
-static int lupb_msgdef_syntax(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- lua_pushinteger(L, upb_msgdef_syntax(m));
+static int lupb_MessageDef_Syntax(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ lua_pushinteger(L, upb_MessageDef_Syntax(m));
return 1;
}
-static int lupb_msgdef_tostring(lua_State *L) {
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
+static int lupb_MessageDef_tostring(lua_State* L) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
lua_pushfstring(L, "<upb.MessageDef name=%s, field_count=%d>",
- upb_msgdef_fullname(m), (int)upb_msgdef_numfields(m));
- return 1;
-}
-
-static const struct luaL_Reg lupb_msgdef_mm[] = {
- {"__call", lupb_msgdef_call},
- {"__index", lupb_msgdef_index},
- {"__len", lupb_msgdef_fieldcount},
- {"__tostring", lupb_msgdef_tostring},
- {NULL, NULL}
-};
-
-static const struct luaL_Reg lupb_msgdef_m[] = {
- {"field", lupb_msgdef_field},
- {"fields", lupb_msgdef_fields},
- {"field_count", lupb_msgdef_fieldcount},
- {"file", lupb_msgdef_file},
- {"full_name", lupb_msgdef_fullname},
- {"lookup_name", lupb_msgdef_lookupname},
- {"name", lupb_msgdef_name},
- {"oneof_count", lupb_msgdef_oneofcount},
- {"oneofs", lupb_msgdef_oneofs},
- {"syntax", lupb_msgdef_syntax},
- {"_map_entry", lupb_msgdef_mapentry},
- {NULL, NULL}
-};
-
-
-/* lupb_enumdef ***************************************************************/
-
-const upb_enumdef *lupb_enumdef_check(lua_State *L, int narg) {
+ upb_MessageDef_FullName(m),
+ (int)upb_MessageDef_FieldCount(m));
+ return 1;
+}
+
+static const struct luaL_Reg lupb_MessageDef_mm[] = {
+ {"__call", lupb_MessageDef_call},
+ {"__index", lupb_MessageDef_index},
+ {"__len", lupb_MessageDef_FieldCount},
+ {"__tostring", lupb_MessageDef_tostring},
+ {NULL, NULL}};
+
+static const struct luaL_Reg lupb_MessageDef_m[] = {
+ {"field", lupb_MessageDef_Field},
+ {"fields", lupb_MessageDef_Fields},
+ {"field_count", lupb_MessageDef_FieldCount},
+ {"file", lupb_MessageDef_File},
+ {"full_name", lupb_MessageDef_FullName},
+ {"lookup_name", lupb_MessageDef_FindByNameWithSize},
+ {"name", lupb_MessageDef_Name},
+ {"oneof_count", lupb_MessageDef_OneofCount},
+ {"oneofs", lupb_MessageDef_Oneofs},
+ {"syntax", lupb_MessageDef_Syntax},
+ {"_map_entry", lupb_MessageDef_IsMapEntry},
+ {NULL, NULL}};
+
+/* lupb_EnumDef ***************************************************************/
+
+const upb_EnumDef* lupb_EnumDef_check(lua_State* L, int narg) {
return lupb_wrapper_check(L, narg, LUPB_ENUMDEF);
}
-static int lupb_enumdef_len(lua_State *L) {
- const upb_enumdef *e = lupb_enumdef_check(L, 1);
- lua_pushinteger(L, upb_enumdef_numvals(e));
+static int lupb_EnumDef_len(lua_State* L) {
+ const upb_EnumDef* e = lupb_EnumDef_check(L, 1);
+ lua_pushinteger(L, upb_EnumDef_ValueCount(e));
return 1;
}
-static int lupb_enumdef_file(lua_State *L) {
- const upb_enumdef *e = lupb_enumdef_check(L, 1);
- const upb_filedef *file = upb_enumdef_file(e);
+static int lupb_EnumDef_File(lua_State* L) {
+ const upb_EnumDef* e = lupb_EnumDef_check(L, 1);
+ const upb_FileDef* file = upb_EnumDef_File(e);
lupb_wrapper_pushwrapper(L, 1, file, LUPB_FILEDEF);
return 1;
}
-/* lupb_enumdef_value()
+/* lupb_EnumDef_Value()
*
* Handles:
- * enum.value(number) -> name
- * enum.value(name) -> number
+ * enum.value(number) -> enumval
+ * enum.value(name) -> enumval
*/
-static int lupb_enumdef_value(lua_State *L) {
- const upb_enumdef *e = lupb_enumdef_check(L, 1);
+static int lupb_EnumDef_Value(lua_State* L) {
+ const upb_EnumDef* e = lupb_EnumDef_check(L, 1);
+ const upb_EnumValueDef* ev;
switch (lua_type(L, 2)) {
- case LUA_TNUMBER: {
- int32_t key = lupb_checkint32(L, 2);
- /* Pushes "nil" for a NULL pointer. */
- lua_pushstring(L, upb_enumdef_iton(e, key));
+ case LUA_TNUMBER:
+ ev = upb_EnumDef_FindValueByNumber(e, lupb_checkint32(L, 2));
break;
- }
- case LUA_TSTRING: {
- const char *key = lua_tostring(L, 2);
- int32_t num;
- if (upb_enumdef_ntoiz(e, key, &num)) {
- lua_pushinteger(L, num);
- } else {
- lua_pushnil(L);
- }
+ case LUA_TSTRING:
+ ev = upb_EnumDef_FindValueByName(e, lua_tostring(L, 2));
break;
- }
default: {
- const char *msg = lua_pushfstring(L, "number or string expected, got %s",
+ const char* msg = lua_pushfstring(L, "number or string expected, got %s",
luaL_typename(L, 2));
return luaL_argerror(L, 2, msg);
}
}
+ lupb_wrapper_pushwrapper(L, 1, ev, LUPB_ENUMVALDEF);
return 1;
}
-static int lupb_enumiter_next(lua_State *L) {
- upb_enum_iter *i = lua_touserdata(L, lua_upvalueindex(1));
- if (upb_enum_done(i)) return 0;
- lua_pushstring(L, upb_enum_iter_name(i));
- lua_pushinteger(L, upb_enum_iter_number(i));
- upb_enum_next(i);
- return 2;
+static const struct luaL_Reg lupb_EnumDef_mm[] = {{"__len", lupb_EnumDef_len},
+ {NULL, NULL}};
+
+static const struct luaL_Reg lupb_EnumDef_m[] = {
+ {"file", lupb_EnumDef_File}, {"value", lupb_EnumDef_Value}, {NULL, NULL}};
+
+/* lupb_EnumValueDef
+ * ************************************************************/
+
+const upb_EnumValueDef* lupb_enumvaldef_check(lua_State* L, int narg) {
+ return lupb_wrapper_check(L, narg, LUPB_ENUMVALDEF);
}
-static int lupb_enumdef_values(lua_State *L) {
- const upb_enumdef *e = lupb_enumdef_check(L, 1);
- upb_enum_iter *i = lua_newuserdata(L, sizeof(upb_enum_iter));
- lupb_wrapper_pushsymtab(L, 1);
- upb_enum_begin(i, e);
+static int lupb_EnumValueDef_Enum(lua_State* L) {
+ const upb_EnumValueDef* ev = lupb_enumvaldef_check(L, 1);
+ const upb_EnumDef* e = upb_EnumValueDef_Enum(ev);
+ lupb_wrapper_pushwrapper(L, 1, e, LUPB_ENUMDEF);
+ return 1;
+}
- /* Closure upvalues are: iter, symtab. */
- lua_pushcclosure(L, &lupb_enumiter_next, 2);
+static int lupb_EnumValueDef_FullName(lua_State* L) {
+ const upb_EnumValueDef* ev = lupb_enumvaldef_check(L, 1);
+ lua_pushstring(L, upb_EnumValueDef_FullName(ev));
return 1;
}
-static const struct luaL_Reg lupb_enumdef_mm[] = {
- {"__len", lupb_enumdef_len},
- {NULL, NULL}
-};
+static int lupb_EnumValueDef_Name(lua_State* L) {
+ const upb_EnumValueDef* ev = lupb_enumvaldef_check(L, 1);
+ lua_pushstring(L, upb_EnumValueDef_Name(ev));
+ return 1;
+}
-static const struct luaL_Reg lupb_enumdef_m[] = {
- {"file", lupb_enumdef_file},
- {"value", lupb_enumdef_value},
- {"values", lupb_enumdef_values},
- {NULL, NULL}
-};
+static int lupb_EnumValueDef_Number(lua_State* L) {
+ const upb_EnumValueDef* ev = lupb_enumvaldef_check(L, 1);
+ lupb_pushint32(L, upb_EnumValueDef_Number(ev));
+ return 1;
+}
+static const struct luaL_Reg lupb_enumvaldef_m[] = {
+ {"enum", lupb_EnumValueDef_Enum},
+ {"full_name", lupb_EnumValueDef_FullName},
+ {"name", lupb_EnumValueDef_Name},
+ {"number", lupb_EnumValueDef_Number},
+ {NULL, NULL}};
-/* lupb_filedef ***************************************************************/
+/* lupb_FileDef ***************************************************************/
-const upb_filedef *lupb_filedef_check(lua_State *L, int narg) {
+const upb_FileDef* lupb_FileDef_check(lua_State* L, int narg) {
return lupb_wrapper_check(L, narg, LUPB_FILEDEF);
}
-static int lupb_filedef_dep(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
+static int lupb_FileDef_Dependency(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
int index = luaL_checkint(L, 2);
- const upb_filedef *dep = upb_filedef_dep(f, index);
+ const upb_FileDef* dep = upb_FileDef_Dependency(f, index);
lupb_wrapper_pushwrapper(L, 1, dep, LUPB_FILEDEF);
return 1;
}
-static int lupb_filedef_depcount(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushnumber(L, upb_filedef_depcount(f));
+static int lupb_FileDef_DependencyCount(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushnumber(L, upb_FileDef_DependencyCount(f));
return 1;
}
-static int lupb_filedef_enum(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
+static int lupb_FileDef_enum(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
int index = luaL_checkint(L, 2);
- const upb_enumdef *e = upb_filedef_enum(f, index);
+ const upb_EnumDef* e = upb_FileDef_TopLevelEnum(f, index);
lupb_wrapper_pushwrapper(L, 1, e, LUPB_ENUMDEF);
return 1;
}
-static int lupb_filedef_enumcount(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushnumber(L, upb_filedef_enumcount(f));
+static int lupb_FileDef_enumcount(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushnumber(L, upb_FileDef_TopLevelEnumCount(f));
return 1;
}
-static int lupb_filedef_msg(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
+static int lupb_FileDef_msg(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
int index = luaL_checkint(L, 2);
- const upb_msgdef *m = upb_filedef_msg(f, index);
+ const upb_MessageDef* m = upb_FileDef_TopLevelMessage(f, index);
lupb_wrapper_pushwrapper(L, 1, m, LUPB_MSGDEF);
return 1;
}
-static int lupb_filedef_msgcount(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushnumber(L, upb_filedef_msgcount(f));
+static int lupb_FileDef_msgcount(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushnumber(L, upb_FileDef_TopLevelMessageCount(f));
return 1;
}
-static int lupb_filedef_name(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushstring(L, upb_filedef_name(f));
+static int lupb_FileDef_Name(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushstring(L, upb_FileDef_Name(f));
return 1;
}
-static int lupb_filedef_package(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushstring(L, upb_filedef_package(f));
+static int lupb_FileDef_Package(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushstring(L, upb_FileDef_Package(f));
return 1;
}
-static int lupb_filedef_symtab(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- const upb_symtab *symtab = upb_filedef_symtab(f);
+static int lupb_FileDef_Pool(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ const upb_DefPool* symtab = upb_FileDef_Pool(f);
lupb_wrapper_pushwrapper(L, 1, symtab, LUPB_SYMTAB);
return 1;
}
-static int lupb_filedef_syntax(lua_State *L) {
- const upb_filedef *f = lupb_filedef_check(L, 1);
- lua_pushnumber(L, upb_filedef_syntax(f));
+static int lupb_FileDef_Syntax(lua_State* L) {
+ const upb_FileDef* f = lupb_FileDef_check(L, 1);
+ lua_pushnumber(L, upb_FileDef_Syntax(f));
return 1;
}
-static const struct luaL_Reg lupb_filedef_m[] = {
- {"dep", lupb_filedef_dep},
- {"depcount", lupb_filedef_depcount},
- {"enum", lupb_filedef_enum},
- {"enumcount", lupb_filedef_enumcount},
- {"msg", lupb_filedef_msg},
- {"msgcount", lupb_filedef_msgcount},
- {"name", lupb_filedef_name},
- {"package", lupb_filedef_package},
- {"symtab", lupb_filedef_symtab},
- {"syntax", lupb_filedef_syntax},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_FileDef_m[] = {
+ {"dep", lupb_FileDef_Dependency},
+ {"depcount", lupb_FileDef_DependencyCount},
+ {"enum", lupb_FileDef_enum},
+ {"enumcount", lupb_FileDef_enumcount},
+ {"msg", lupb_FileDef_msg},
+ {"msgcount", lupb_FileDef_msgcount},
+ {"name", lupb_FileDef_Name},
+ {"package", lupb_FileDef_Package},
+ {"symtab", lupb_FileDef_Pool},
+ {"syntax", lupb_FileDef_Syntax},
+ {NULL, NULL}};
-
-/* lupb_symtab ****************************************************************/
+/* lupb_DefPool
+ * ****************************************************************/
/* The symtab owns all defs. Thus GC-rooting the symtab ensures that all
* underlying defs stay alive.
@@ -706,19 +706,19 @@ static const struct luaL_Reg lupb_filedef_m[] = {
#define LUPB_CACHE_INDEX 1
typedef struct {
- upb_symtab *symtab;
-} lupb_symtab;
+ upb_DefPool* symtab;
+} lupb_DefPool;
-upb_symtab *lupb_symtab_check(lua_State *L, int narg) {
- lupb_symtab *lsymtab = luaL_checkudata(L, narg, LUPB_SYMTAB);
+upb_DefPool* lupb_DefPool_check(lua_State* L, int narg) {
+ lupb_DefPool* lsymtab = luaL_checkudata(L, narg, LUPB_SYMTAB);
if (!lsymtab->symtab) {
luaL_error(L, "called into dead object");
}
return lsymtab->symtab;
}
-void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
- const char *type) {
+void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def,
+ const char* type) {
narg = lua_absindex(L, narg);
assert(luaL_testudata(L, narg, LUPB_SYMTAB));
@@ -727,7 +727,7 @@ void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
return;
}
- lua_getiuservalue(L, narg, LUPB_CACHE_INDEX); /* Get cache. */
+ lua_getiuservalue(L, narg, LUPB_CACHE_INDEX); /* Get cache. */
/* Index by "def" pointer. */
lua_rawgetp(L, -1, def);
@@ -735,9 +735,9 @@ void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
/* Stack is now: cache, cached value. */
if (lua_isnil(L, -1)) {
/* Create new wrapper. */
- lupb_wrapper *w = lupb_newuserdata(L, sizeof(*w), 1, type);
+ lupb_wrapper* w = lupb_newuserdata(L, sizeof(*w), 1, type);
w->def = def;
- lua_replace(L, -2); /* Replace nil */
+ lua_replace(L, -2); /* Replace nil */
/* Set symtab as userval. */
lua_pushvalue(L, narg);
@@ -748,17 +748,17 @@ void lupb_symtab_pushwrapper(lua_State *L, int narg, const void *def,
lua_rawsetp(L, -3, def);
}
- lua_replace(L, -2); /* Remove cache, leaving only the wrapper. */
+ lua_replace(L, -2); /* Remove cache, leaving only the wrapper. */
}
-/* upb_symtab_new()
+/* upb_DefPool_New()
*
* Handles:
* upb.SymbolTable() -> <new instance>
*/
-static int lupb_symtab_new(lua_State *L) {
- lupb_symtab *lsymtab = lupb_newuserdata(L, sizeof(*lsymtab), 1, LUPB_SYMTAB);
- lsymtab->symtab = upb_symtab_new();
+static int lupb_DefPool_New(lua_State* L) {
+ lupb_DefPool* lsymtab = lupb_newuserdata(L, sizeof(*lsymtab), 1, LUPB_SYMTAB);
+ lsymtab->symtab = upb_DefPool_New();
/* Create our object cache. */
lua_newtable(L);
@@ -779,47 +779,47 @@ static int lupb_symtab_new(lua_State *L) {
return 1;
}
-static int lupb_symtab_gc(lua_State *L) {
- lupb_symtab *lsymtab = luaL_checkudata(L, 1, LUPB_SYMTAB);
- upb_symtab_free(lsymtab->symtab);
+static int lupb_DefPool_gc(lua_State* L) {
+ lupb_DefPool* lsymtab = luaL_checkudata(L, 1, LUPB_SYMTAB);
+ upb_DefPool_Free(lsymtab->symtab);
lsymtab->symtab = NULL;
return 0;
}
-static int lupb_symtab_addfile(lua_State *L) {
+static int lupb_DefPool_AddFile(lua_State* L) {
size_t len;
- upb_symtab *s = lupb_symtab_check(L, 1);
- const char *str = luaL_checklstring(L, 2, &len);
- upb_arena *arena = lupb_arena_pushnew(L);
- const google_protobuf_FileDescriptorProto *file;
- const upb_filedef *file_def;
- upb_status status;
-
- upb_status_clear(&status);
+ upb_DefPool* s = lupb_DefPool_check(L, 1);
+ const char* str = luaL_checklstring(L, 2, &len);
+ upb_Arena* arena = lupb_Arena_pushnew(L);
+ const google_protobuf_FileDescriptorProto* file;
+ const upb_FileDef* file_def;
+ upb_Status status;
+
+ upb_Status_Clear(&status);
file = google_protobuf_FileDescriptorProto_parse(str, len, arena);
if (!file) {
luaL_argerror(L, 2, "failed to parse descriptor");
}
- file_def = upb_symtab_addfile(s, file, &status);
+ file_def = upb_DefPool_AddFile(s, file, &status);
lupb_checkstatus(L, &status);
- lupb_symtab_pushwrapper(L, 1, file_def, LUPB_FILEDEF);
+ lupb_DefPool_pushwrapper(L, 1, file_def, LUPB_FILEDEF);
return 1;
}
-static int lupb_symtab_addset(lua_State *L) {
+static int lupb_DefPool_addset(lua_State* L) {
size_t i, n, len;
- const google_protobuf_FileDescriptorProto *const *files;
- google_protobuf_FileDescriptorSet *set;
- upb_symtab *s = lupb_symtab_check(L, 1);
- const char *str = luaL_checklstring(L, 2, &len);
- upb_arena *arena = lupb_arena_pushnew(L);
- upb_status status;
-
- upb_status_clear(&status);
+ const google_protobuf_FileDescriptorProto* const* files;
+ google_protobuf_FileDescriptorSet* set;
+ upb_DefPool* s = lupb_DefPool_check(L, 1);
+ const char* str = luaL_checklstring(L, 2, &len);
+ upb_Arena* arena = lupb_Arena_pushnew(L);
+ upb_Status status;
+
+ upb_Status_Clear(&status);
set = google_protobuf_FileDescriptorSet_parse(str, len, arena);
if (!set) {
@@ -828,107 +828,112 @@ static int lupb_symtab_addset(lua_State *L) {
files = google_protobuf_FileDescriptorSet_file(set, &n);
for (i = 0; i < n; i++) {
- upb_symtab_addfile(s, files[i], &status);
+ upb_DefPool_AddFile(s, files[i], &status);
lupb_checkstatus(L, &status);
}
return 0;
}
-static int lupb_symtab_lookupmsg(lua_State *L) {
- const upb_symtab *s = lupb_symtab_check(L, 1);
- const upb_msgdef *m = upb_symtab_lookupmsg(s, luaL_checkstring(L, 2));
- lupb_symtab_pushwrapper(L, 1, m, LUPB_MSGDEF);
+static int lupb_DefPool_FindMessageByName(lua_State* L) {
+ const upb_DefPool* s = lupb_DefPool_check(L, 1);
+ const upb_MessageDef* m =
+ upb_DefPool_FindMessageByName(s, luaL_checkstring(L, 2));
+ lupb_DefPool_pushwrapper(L, 1, m, LUPB_MSGDEF);
+ return 1;
+}
+
+static int lupb_DefPool_FindEnumByName(lua_State* L) {
+ const upb_DefPool* s = lupb_DefPool_check(L, 1);
+ const upb_EnumDef* e = upb_DefPool_FindEnumByName(s, luaL_checkstring(L, 2));
+ lupb_DefPool_pushwrapper(L, 1, e, LUPB_ENUMDEF);
return 1;
}
-static int lupb_symtab_lookupenum(lua_State *L) {
- const upb_symtab *s = lupb_symtab_check(L, 1);
- const upb_enumdef *e = upb_symtab_lookupenum(s, luaL_checkstring(L, 2));
- lupb_symtab_pushwrapper(L, 1, e, LUPB_ENUMDEF);
+static int lupb_DefPool_FindEnumByNameval(lua_State* L) {
+ const upb_DefPool* s = lupb_DefPool_check(L, 1);
+ const upb_EnumValueDef* e =
+ upb_DefPool_FindEnumByNameval(s, luaL_checkstring(L, 2));
+ lupb_DefPool_pushwrapper(L, 1, e, LUPB_ENUMVALDEF);
return 1;
}
-static int lupb_symtab_tostring(lua_State *L) {
- const upb_symtab *s = lupb_symtab_check(L, 1);
- lua_pushfstring(L, "<upb.SymbolTable file_count=%d>",
- (int)upb_symtab_filecount(s));
+static int lupb_DefPool_tostring(lua_State* L) {
+ lua_pushfstring(L, "<upb.SymbolTable>");
return 1;
}
-static const struct luaL_Reg lupb_symtab_m[] = {
- {"add_file", lupb_symtab_addfile},
- {"add_set", lupb_symtab_addset},
- {"lookup_msg", lupb_symtab_lookupmsg},
- {"lookup_enum", lupb_symtab_lookupenum},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_DefPool_m[] = {
+ {"add_file", lupb_DefPool_AddFile},
+ {"add_set", lupb_DefPool_addset},
+ {"lookup_msg", lupb_DefPool_FindMessageByName},
+ {"lookup_enum", lupb_DefPool_FindEnumByName},
+ {"lookup_enumval", lupb_DefPool_FindEnumByNameval},
+ {NULL, NULL}};
-static const struct luaL_Reg lupb_symtab_mm[] = {
- {"__gc", lupb_symtab_gc},
- {"__tostring", lupb_symtab_tostring},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_DefPool_mm[] = {
+ {"__gc", lupb_DefPool_gc},
+ {"__tostring", lupb_DefPool_tostring},
+ {NULL, NULL}};
/* lupb toplevel **************************************************************/
-static void lupb_setfieldi(lua_State *L, const char *field, int i) {
+static void lupb_setfieldi(lua_State* L, const char* field, int i) {
lua_pushinteger(L, i);
lua_setfield(L, -2, field);
}
static const struct luaL_Reg lupbdef_toplevel_m[] = {
- {"SymbolTable", lupb_symtab_new},
- {NULL, NULL}
-};
+ {"SymbolTable", lupb_DefPool_New}, {NULL, NULL}};
-void lupb_def_registertypes(lua_State *L) {
+void lupb_def_registertypes(lua_State* L) {
lupb_setfuncs(L, lupbdef_toplevel_m);
/* Register types. */
- lupb_register_type(L, LUPB_ENUMDEF, lupb_enumdef_m, lupb_enumdef_mm);
- lupb_register_type(L, LUPB_FIELDDEF, lupb_fielddef_m, NULL);
- lupb_register_type(L, LUPB_FILEDEF, lupb_filedef_m, NULL);
- lupb_register_type(L, LUPB_MSGDEF, lupb_msgdef_m, lupb_msgdef_mm);
- lupb_register_type(L, LUPB_ONEOFDEF, lupb_oneofdef_m, lupb_oneofdef_mm);
- lupb_register_type(L, LUPB_SYMTAB, lupb_symtab_m, lupb_symtab_mm);
+ lupb_register_type(L, LUPB_ENUMDEF, lupb_EnumDef_m, lupb_EnumDef_mm);
+ lupb_register_type(L, LUPB_ENUMVALDEF, lupb_enumvaldef_m, NULL);
+ lupb_register_type(L, LUPB_FIELDDEF, lupb_FieldDef_m, NULL);
+ lupb_register_type(L, LUPB_FILEDEF, lupb_FileDef_m, NULL);
+ lupb_register_type(L, LUPB_MSGDEF, lupb_MessageDef_m, lupb_MessageDef_mm);
+ lupb_register_type(L, LUPB_ONEOFDEF, lupb_OneofDef_m, lupb_OneofDef_mm);
+ lupb_register_type(L, LUPB_SYMTAB, lupb_DefPool_m, lupb_DefPool_mm);
/* Register constants. */
- lupb_setfieldi(L, "LABEL_OPTIONAL", UPB_LABEL_OPTIONAL);
- lupb_setfieldi(L, "LABEL_REQUIRED", UPB_LABEL_REQUIRED);
- lupb_setfieldi(L, "LABEL_REPEATED", UPB_LABEL_REPEATED);
-
- lupb_setfieldi(L, "TYPE_DOUBLE", UPB_TYPE_DOUBLE);
- lupb_setfieldi(L, "TYPE_FLOAT", UPB_TYPE_FLOAT);
- lupb_setfieldi(L, "TYPE_INT64", UPB_TYPE_INT64);
- lupb_setfieldi(L, "TYPE_UINT64", UPB_TYPE_UINT64);
- lupb_setfieldi(L, "TYPE_INT32", UPB_TYPE_INT32);
- lupb_setfieldi(L, "TYPE_BOOL", UPB_TYPE_BOOL);
- lupb_setfieldi(L, "TYPE_STRING", UPB_TYPE_STRING);
- lupb_setfieldi(L, "TYPE_MESSAGE", UPB_TYPE_MESSAGE);
- lupb_setfieldi(L, "TYPE_BYTES", UPB_TYPE_BYTES);
- lupb_setfieldi(L, "TYPE_UINT32", UPB_TYPE_UINT32);
- lupb_setfieldi(L, "TYPE_ENUM", UPB_TYPE_ENUM);
-
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_DOUBLE", UPB_DESCRIPTOR_TYPE_DOUBLE);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_FLOAT", UPB_DESCRIPTOR_TYPE_FLOAT);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_INT64", UPB_DESCRIPTOR_TYPE_INT64);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_UINT64", UPB_DESCRIPTOR_TYPE_UINT64);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_INT32", UPB_DESCRIPTOR_TYPE_INT32);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_FIXED64", UPB_DESCRIPTOR_TYPE_FIXED64);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_FIXED32", UPB_DESCRIPTOR_TYPE_FIXED32);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_BOOL", UPB_DESCRIPTOR_TYPE_BOOL);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_STRING", UPB_DESCRIPTOR_TYPE_STRING);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_GROUP", UPB_DESCRIPTOR_TYPE_GROUP);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_MESSAGE", UPB_DESCRIPTOR_TYPE_MESSAGE);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_BYTES", UPB_DESCRIPTOR_TYPE_BYTES);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_UINT32", UPB_DESCRIPTOR_TYPE_UINT32);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_ENUM", UPB_DESCRIPTOR_TYPE_ENUM);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_SFIXED32", UPB_DESCRIPTOR_TYPE_SFIXED32);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_SFIXED64", UPB_DESCRIPTOR_TYPE_SFIXED64);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_SINT32", UPB_DESCRIPTOR_TYPE_SINT32);
- lupb_setfieldi(L, "DESCRIPTOR_TYPE_SINT64", UPB_DESCRIPTOR_TYPE_SINT64);
-
- lupb_setfieldi(L, "SYNTAX_PROTO2", UPB_SYNTAX_PROTO2);
- lupb_setfieldi(L, "SYNTAX_PROTO3", UPB_SYNTAX_PROTO3);
+ lupb_setfieldi(L, "LABEL_OPTIONAL", kUpb_Label_Optional);
+ lupb_setfieldi(L, "LABEL_REQUIRED", kUpb_Label_Required);
+ lupb_setfieldi(L, "LABEL_REPEATED", kUpb_Label_Repeated);
+
+ lupb_setfieldi(L, "TYPE_DOUBLE", kUpb_CType_Double);
+ lupb_setfieldi(L, "TYPE_FLOAT", kUpb_CType_Float);
+ lupb_setfieldi(L, "TYPE_INT64", kUpb_CType_Int64);
+ lupb_setfieldi(L, "TYPE_UINT64", kUpb_CType_UInt64);
+ lupb_setfieldi(L, "TYPE_INT32", kUpb_CType_Int32);
+ lupb_setfieldi(L, "TYPE_BOOL", kUpb_CType_Bool);
+ lupb_setfieldi(L, "TYPE_STRING", kUpb_CType_String);
+ lupb_setfieldi(L, "TYPE_MESSAGE", kUpb_CType_Message);
+ lupb_setfieldi(L, "TYPE_BYTES", kUpb_CType_Bytes);
+ lupb_setfieldi(L, "TYPE_UINT32", kUpb_CType_UInt32);
+ lupb_setfieldi(L, "TYPE_ENUM", kUpb_CType_Enum);
+
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_DOUBLE", kUpb_FieldType_Double);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_FLOAT", kUpb_FieldType_Float);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_INT64", kUpb_FieldType_Int64);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_UINT64", kUpb_FieldType_UInt64);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_INT32", kUpb_FieldType_Int32);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_FIXED64", kUpb_FieldType_Fixed64);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_FIXED32", kUpb_FieldType_Fixed32);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_BOOL", kUpb_FieldType_Bool);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_STRING", kUpb_FieldType_String);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_GROUP", kUpb_FieldType_Group);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_MESSAGE", kUpb_FieldType_Message);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_BYTES", kUpb_FieldType_Bytes);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_UINT32", kUpb_FieldType_UInt32);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_ENUM", kUpb_FieldType_Enum);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_SFIXED32", kUpb_FieldType_SFixed32);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_SFIXED64", kUpb_FieldType_SFixed64);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_SINT32", kUpb_FieldType_SInt32);
+ lupb_setfieldi(L, "DESCRIPTOR_TYPE_SINT64", kUpb_FieldType_SInt64);
+
+ lupb_setfieldi(L, "SYNTAX_PROTO2", kUpb_Syntax_Proto2);
+ lupb_setfieldi(L, "SYNTAX_PROTO3", kUpb_Syntax_Proto3);
}
diff --git a/grpc/third_party/upb/upb/bindings/lua/lua_proto_library.bzl b/grpc/third_party/upb/upb/bindings/lua/lua_proto_library.bzl
index d6ac301a..3f34fc18 100644
--- a/grpc/third_party/upb/upb/bindings/lua/lua_proto_library.bzl
+++ b/grpc/third_party/upb/upb/bindings/lua/lua_proto_library.bzl
@@ -1,3 +1,28 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
load("@bazel_skylib//lib:paths.bzl", "paths")
# Generic support code #########################################################
@@ -82,12 +107,12 @@ _lua_proto_library_aspect = aspect(
attrs = {
"_upbc": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "//upb/bindings/lua:protoc-gen-lua",
),
"_protoc": attr.label(
executable = True,
- cfg = "host",
+ cfg = "exec",
default = "@com_google_protobuf//:protoc",
),
},
diff --git a/grpc/third_party/upb/upb/bindings/lua/main.c b/grpc/third_party/upb/upb/bindings/lua/main.c
new file mode 100644
index 00000000..4245c4d8
--- /dev/null
+++ b/grpc/third_party/upb/upb/bindings/lua/main.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <lauxlib.h>
+#include <lua.h>
+#include <lualib.h>
+#include <signal.h>
+
+#include "upb/bindings/lua/upb.h"
+
+lua_State* L;
+
+static void interrupt(lua_State* L, lua_Debug* ar) {
+ (void)ar;
+ lua_sethook(L, NULL, 0, 0);
+ luaL_error(L, "SIGINT");
+}
+
+static void sighandler(int i) {
+ fprintf(stderr, "Signal!\n");
+ signal(i, SIG_DFL);
+ lua_sethook(L, interrupt, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
+}
+
+const char* init =
+ "package.preload['lupb'] = ... "
+ "package.path = '"
+ "./?.lua;"
+ "./third_party/lunit/?.lua;"
+ "external/com_google_protobuf/?.lua;"
+ "external/com_google_protobuf/src/?.lua;"
+ "bazel-bin/?.lua;"
+ "bazel-bin/external/com_google_protobuf/src/?.lua;"
+ "bazel-bin/external/com_google_protobuf/?.lua;"
+ "bazel-bin/external/com_google_protobuf/?.lua;"
+ "upb/bindings/lua/?.lua"
+ "'";
+
+int main(int argc, char** argv) {
+ int ret = 0;
+ L = luaL_newstate();
+ luaL_openlibs(L);
+ lua_pushcfunction(L, luaopen_lupb);
+ ret = luaL_loadstring(L, init);
+ lua_pushcfunction(L, luaopen_lupb);
+
+ signal(SIGINT, sighandler);
+ ret = ret || lua_pcall(L, 1, LUA_MULTRET, 0) ||
+ luaL_dofile(L, "upb/bindings/lua/test_upb.lua");
+ signal(SIGINT, SIG_DFL);
+
+ if (ret) {
+ fprintf(stderr, "error testing Lua: %s\n", lua_tostring(L, -1));
+ ret = 1;
+ }
+
+ lua_close(L);
+ return ret;
+}
diff --git a/grpc/third_party/upb/upb/bindings/lua/msg.c b/grpc/third_party/upb/upb/bindings/lua/msg.c
index c0c5bb99..a314f4db 100644
--- a/grpc/third_party/upb/upb/bindings/lua/msg.c
+++ b/grpc/third_party/upb/upb/bindings/lua/msg.c
@@ -1,6 +1,33 @@
/*
-** lupb_msg -- Message/Array/Map objects in Lua/C that wrap upb/msg.h
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * lupb_Message -- Message/Array/Map objects in Lua/C that wrap upb/msg.h
+ */
#include "upb/msg.h"
@@ -25,7 +52,7 @@
* a cyclic graph cannot be serialized. So it's better to think of this as a
* tree of objects.
*
- * The actual data exists at the upb level (upb_msg, upb_map, upb_array),
+ * The actual data exists at the upb level (upb_Message, upb_Map, upb_Array),
* independently of Lua. The upb objects contain all the canonical data and
* edges between objects. Lua wrapper objects expose the upb objects to Lua,
* but ultimately they are just wrappers. They pass through all reads and
@@ -38,21 +65,21 @@
* that arena. All wrapper objects strongly reference the arena to which they
* belong.
*
- * A global object cache stores a mapping of C pointer (upb_msg*, upb_array*,
- * upb_map*) to a corresponding Lua wrapper. These references are weak so that
- * the wrappers can be collected if they are no longer needed. A new wrapper
- * object can always be recreated later.
+ * A global object cache stores a mapping of C pointer (upb_Message*,
+ * upb_Array*, upb_Map*) to a corresponding Lua wrapper. These references are
+ * weak so that the wrappers can be collected if they are no longer needed. A
+ * new wrapper object can always be recreated later.
*
* +-----+
- * lupb_arena |cache|-weak-+
+ * lupb_Arena |cache|-weak-+
* | ^ +-----+ |
* | | V
- * Lua level | +------------lupb_msg
+ * Lua level | +------------lupb_Message
* ----------------|-----------------|------------------------------------------
* upb level | |
- * | +----V------------------------------+
- * +->upb_arena | upb_msg ...(empty arena storage) |
- * +-----------------------------------+
+ * | +----V----------------------------------+
+ * +->upb_Arena | upb_Message ...(empty arena storage) |
+ * +---------------------------------------+
*
* If the user creates a reference between two objects that have different
* arenas, we need to fuse the two arenas together, so that the blocks will
@@ -61,16 +88,16 @@
* +-------------------------->(fused)<----------------+
* | |
* V +-----+ V
- * lupb_arena +-weak-|cache|-weak-+ lupb_arena
- * | ^ | +-----+ | ^ |
- * | | V V | |
- * Lua level | +------------lupb_msg lupb_msg----+ |
- * ----------------|-----------------|-------------------------|---------|------
- * upb level | | | |
- * | +----V----+ +----V----+ V
- * +->upb_arena | upb_msg | | upb_msg | upb_arena
- * +------|--+ +--^------+
- * +---------------------+
+ * lupb_Arena +-weak-|cache|-weak-+ lupb_Arena
+ * | ^ | +-----+ | ^ |
+ * | | V V | |
+ * Lua level | +------------lupb_Message lupb_Message--+ |
+ * ----------------|-----------------|----------------------|-----------|------
+ * upb level | | | |
+ * | +----V--------+ +----V--------+ V
+ * +->upb_Arena | upb_Message | | upb_Message | upb_Arena
+ * +------|------+ +--^----------+
+ * +------------------+
* Key invariants:
* 1. every wrapper references the arena that contains it.
* 2. every fused arena includes all arenas that own upb objects reachable
@@ -89,14 +116,15 @@
#define LUPB_MSG "lupb.msg"
#define LUPB_ARENA_INDEX 1
-#define LUPB_MSGDEF_INDEX 2 /* For msg, and map/array that store msg */
+#define LUPB_MSGDEF_INDEX 2 /* For msg, and map/array that store msg */
-static void lupb_msg_newmsgwrapper(lua_State *L, int narg, upb_msgval val);
-static upb_msg *lupb_msg_check(lua_State *L, int narg);
+static void lupb_Message_Newmsgwrapper(lua_State* L, int narg,
+ upb_MessageValue val);
+static upb_Message* lupb_msg_check(lua_State* L, int narg);
-static upb_fieldtype_t lupb_checkfieldtype(lua_State *L, int narg) {
+static upb_CType lupb_checkfieldtype(lua_State* L, int narg) {
uint32_t n = lupb_checkuint32(L, narg);
- bool ok = n >= UPB_TYPE_BOOL && n <= UPB_TYPE_BYTES;
+ bool ok = n >= kUpb_CType_Bool && n <= kUpb_CType_Bytes;
luaL_argcheck(L, ok, narg, "invalid field type");
return n;
}
@@ -107,7 +135,7 @@ char cache_key;
*
* Creates the global cache used by lupb_cacheget() and lupb_cacheset().
*/
-static void lupb_cacheinit(lua_State *L) {
+static void lupb_cacheinit(lua_State* L) {
/* Create our object cache. */
lua_newtable(L);
@@ -126,7 +154,7 @@ static void lupb_cacheinit(lua_State *L) {
* Pushes cache[key] and returns true if this key is present in the cache.
* Otherwise returns false and leaves nothing on the stack.
*/
-static bool lupb_cacheget(lua_State *L, const void *key) {
+static bool lupb_cacheget(lua_State* L, const void* key) {
if (key == NULL) {
lua_pushnil(L);
return true;
@@ -135,10 +163,10 @@ static bool lupb_cacheget(lua_State *L, const void *key) {
lua_rawgetp(L, LUA_REGISTRYINDEX, &cache_key);
lua_rawgetp(L, -1, key);
if (lua_isnil(L, -1)) {
- lua_pop(L, 2); /* Pop table, nil. */
+ lua_pop(L, 2); /* Pop table, nil. */
return false;
} else {
- lua_replace(L, -2); /* Replace cache table. */
+ lua_replace(L, -2); /* Replace cache table. */
return true;
}
}
@@ -148,72 +176,70 @@ static bool lupb_cacheget(lua_State *L, const void *key) {
* Sets cache[key] = val, where "val" is the value at the top of the stack.
* Does not pop the value.
*/
-static void lupb_cacheset(lua_State *L, const void *key) {
+static void lupb_cacheset(lua_State* L, const void* key) {
lua_rawgetp(L, LUA_REGISTRYINDEX, &cache_key);
lua_pushvalue(L, -2);
lua_rawsetp(L, -2, key);
- lua_pop(L, 1); /* Pop table. */
+ lua_pop(L, 1); /* Pop table. */
}
-/* lupb_arena *****************************************************************/
+/* lupb_Arena *****************************************************************/
-/* lupb_arena only exists to wrap a upb_arena. It is never exposed to users; it
+/* lupb_Arena only exists to wrap a upb_Arena. It is never exposed to users; it
* is an internal memory management detail. Other wrapper objects refer to this
* object from their userdata to keep the arena-owned data alive.
*/
typedef struct {
- upb_arena *arena;
-} lupb_arena;
+ upb_Arena* arena;
+} lupb_Arena;
-static upb_arena *lupb_arena_check(lua_State *L, int narg) {
- lupb_arena *a = luaL_checkudata(L, narg, LUPB_ARENA);
+static upb_Arena* lupb_Arena_check(lua_State* L, int narg) {
+ lupb_Arena* a = luaL_checkudata(L, narg, LUPB_ARENA);
return a->arena;
}
-upb_arena *lupb_arena_pushnew(lua_State *L) {
- lupb_arena *a = lupb_newuserdata(L, sizeof(lupb_arena), 1, LUPB_ARENA);
- a->arena = upb_arena_new();
+upb_Arena* lupb_Arena_pushnew(lua_State* L) {
+ lupb_Arena* a = lupb_newuserdata(L, sizeof(lupb_Arena), 1, LUPB_ARENA);
+ a->arena = upb_Arena_New();
return a->arena;
}
/**
- * lupb_arena_fuse()
+ * lupb_Arena_Fuse()
*
* Merges |from| into |to| so that there is a single arena group that contains
* both, and both arenas will point at this new table. */
-static void lupb_arena_fuse(lua_State *L, int to, int from) {
- upb_arena *to_arena = lupb_arena_check(L, to);
- upb_arena *from_arena = lupb_arena_check(L, from);
- upb_arena_fuse(to_arena, from_arena);
+static void lupb_Arena_Fuse(lua_State* L, int to, int from) {
+ upb_Arena* to_arena = lupb_Arena_check(L, to);
+ upb_Arena* from_arena = lupb_Arena_check(L, from);
+ upb_Arena_Fuse(to_arena, from_arena);
}
-static void lupb_arena_fuseobjs(lua_State *L, int to, int from) {
+static void lupb_Arena_Fuseobjs(lua_State* L, int to, int from) {
lua_getiuservalue(L, to, LUPB_ARENA_INDEX);
lua_getiuservalue(L, from, LUPB_ARENA_INDEX);
- lupb_arena_fuse(L, lua_absindex(L, -2), lua_absindex(L, -1));
+ lupb_Arena_Fuse(L, lua_absindex(L, -2), lua_absindex(L, -1));
lua_pop(L, 2);
}
-static int lupb_arena_gc(lua_State *L) {
- upb_arena *a = lupb_arena_check(L, 1);
- upb_arena_free(a);
+static int lupb_Arena_gc(lua_State* L) {
+ upb_Arena* a = lupb_Arena_check(L, 1);
+ upb_Arena_Free(a);
return 0;
}
-static const struct luaL_Reg lupb_arena_mm[] = {
- {"__gc", lupb_arena_gc},
- {NULL, NULL}
-};
+static const struct luaL_Reg lupb_Arena_mm[] = {{"__gc", lupb_Arena_gc},
+ {NULL, NULL}};
-/* lupb_arenaget()
+/* lupb_Arenaget()
*
* Returns the arena from the given message, array, or map object.
*/
-static upb_arena *lupb_arenaget(lua_State *L, int narg) {
- upb_arena *arena;
+static upb_Arena* lupb_Arenaget(lua_State* L, int narg) {
+ upb_Arena* arena;
lua_getiuservalue(L, narg, LUPB_ARENA_INDEX);
- arena = lupb_arena_check(L, -1);
+ arena = lupb_Arena_check(L, -1);
lua_pop(L, 1);
return arena;
}
@@ -225,60 +251,60 @@ static upb_arena *lupb_arenaget(lua_State *L, int narg) {
* lookup).
*/
typedef enum {
- LUPB_COPY, /* Copy string data into the arena. */
- LUPB_REF /* Reference the Lua copy of the string data. */
+ LUPB_COPY, /* Copy string data into the arena. */
+ LUPB_REF /* Reference the Lua copy of the string data. */
} lupb_copy_t;
/**
* lupb_tomsgval()
*
- * Converts the given Lua value |narg| to a upb_msgval.
+ * Converts the given Lua value |narg| to a upb_MessageValue.
*/
-static upb_msgval lupb_tomsgval(lua_State *L, upb_fieldtype_t type, int narg,
- int container, lupb_copy_t copy) {
- upb_msgval ret;
+static upb_MessageValue lupb_tomsgval(lua_State* L, upb_CType type, int narg,
+ int container, lupb_copy_t copy) {
+ upb_MessageValue ret;
switch (type) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM:
+ case kUpb_CType_Int32:
+ case kUpb_CType_Enum:
ret.int32_val = lupb_checkint32(L, narg);
break;
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int64:
ret.int64_val = lupb_checkint64(L, narg);
break;
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt32:
ret.uint32_val = lupb_checkuint32(L, narg);
break;
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt64:
ret.uint64_val = lupb_checkuint64(L, narg);
break;
- case UPB_TYPE_DOUBLE:
+ case kUpb_CType_Double:
ret.double_val = lupb_checkdouble(L, narg);
break;
- case UPB_TYPE_FLOAT:
+ case kUpb_CType_Float:
ret.float_val = lupb_checkfloat(L, narg);
break;
- case UPB_TYPE_BOOL:
+ case kUpb_CType_Bool:
ret.bool_val = lupb_checkbool(L, narg);
break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES: {
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes: {
size_t len;
- const char *ptr = lupb_checkstring(L, narg, &len);
+ const char* ptr = lupb_checkstring(L, narg, &len);
switch (copy) {
case LUPB_COPY: {
- upb_arena *arena = lupb_arenaget(L, container);
- char *data = upb_arena_malloc(arena, len);
+ upb_Arena* arena = lupb_Arenaget(L, container);
+ char* data = upb_Arena_Malloc(arena, len);
memcpy(data, ptr, len);
- ret.str_val = upb_strview_make(data, len);
+ ret.str_val = upb_StringView_FromDataAndSize(data, len);
break;
}
case LUPB_REF:
- ret.str_val = upb_strview_make(ptr, len);
+ ret.str_val = upb_StringView_FromDataAndSize(ptr, len);
break;
}
break;
}
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Message:
ret.msg_val = lupb_msg_check(L, narg);
/* Typecheck message. */
lua_getiuservalue(L, container, LUPB_MSGDEF_INDEX);
@@ -290,54 +316,53 @@ static upb_msgval lupb_tomsgval(lua_State *L, upb_fieldtype_t type, int narg,
return ret;
}
-static void lupb_pushmsgval(lua_State *L, int container, upb_fieldtype_t type,
- upb_msgval val) {
+void lupb_pushmsgval(lua_State* L, int container, upb_CType type,
+ upb_MessageValue val) {
switch (type) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM:
+ case kUpb_CType_Int32:
+ case kUpb_CType_Enum:
lupb_pushint32(L, val.int32_val);
return;
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int64:
lupb_pushint64(L, val.int64_val);
return;
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt32:
lupb_pushuint32(L, val.uint32_val);
return;
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt64:
lupb_pushuint64(L, val.uint64_val);
return;
- case UPB_TYPE_DOUBLE:
+ case kUpb_CType_Double:
lua_pushnumber(L, val.double_val);
return;
- case UPB_TYPE_FLOAT:
+ case kUpb_CType_Float:
lua_pushnumber(L, val.float_val);
return;
- case UPB_TYPE_BOOL:
+ case kUpb_CType_Bool:
lua_pushboolean(L, val.bool_val);
return;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes:
lua_pushlstring(L, val.str_val.data, val.str_val.size);
return;
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Message:
assert(container);
if (!lupb_cacheget(L, val.msg_val)) {
- lupb_msg_newmsgwrapper(L, container, val);
+ lupb_Message_Newmsgwrapper(L, container, val);
}
return;
}
LUPB_UNREACHABLE();
}
-
/* lupb_array *****************************************************************/
typedef struct {
- upb_array *arr;
- upb_fieldtype_t type;
+ upb_Array* arr;
+ upb_CType type;
} lupb_array;
-static lupb_array *lupb_array_check(lua_State *L, int narg) {
+static lupb_array* lupb_array_check(lua_State* L, int narg) {
return luaL_checkudata(L, narg, LUPB_ARRAY);
}
@@ -348,69 +373,81 @@ static lupb_array *lupb_array_check(lua_State *L, int narg) {
* integer between 1 and |max|, inclusively. Also corrects it to be zero-based
* for C.
*/
-static int lupb_array_checkindex(lua_State *L, int narg, uint32_t max) {
+static int lupb_array_checkindex(lua_State* L, int narg, uint32_t max) {
uint32_t n = lupb_checkuint32(L, narg);
luaL_argcheck(L, n != 0 && n <= max, narg, "invalid array index");
- return n - 1; /* Lua uses 1-based indexing. */
+ return n - 1; /* Lua uses 1-based indexing. */
}
/* lupb_array Public API */
-/* lupb_array_new():
+/* lupb_Array_New():
*
* Handles:
* Array(upb.TYPE_INT32)
* Array(message_type)
*/
-static int lupb_array_new(lua_State *L) {
- lupb_array *larray;
- upb_arena *arena;
+static int lupb_Array_New(lua_State* L) {
+ int arg_count = lua_gettop(L);
+ lupb_array* larray;
+ upb_Arena* arena;
if (lua_type(L, 1) == LUA_TNUMBER) {
- upb_fieldtype_t type = lupb_checkfieldtype(L, 1);
+ upb_CType type = lupb_checkfieldtype(L, 1);
larray = lupb_newuserdata(L, sizeof(*larray), 1, LUPB_ARRAY);
larray->type = type;
} else {
- lupb_msgdef_check(L, 1);
+ lupb_MessageDef_check(L, 1);
larray = lupb_newuserdata(L, sizeof(*larray), 2, LUPB_ARRAY);
- larray->type = UPB_TYPE_MESSAGE;
+ larray->type = kUpb_CType_Message;
lua_pushvalue(L, 1);
lua_setiuservalue(L, -2, LUPB_MSGDEF_INDEX);
}
- arena = lupb_arena_pushnew(L);
+ arena = lupb_Arena_pushnew(L);
lua_setiuservalue(L, -2, LUPB_ARENA_INDEX);
- larray->arr = upb_array_new(arena, larray->type);
+ larray->arr = upb_Array_New(arena, larray->type);
lupb_cacheset(L, larray->arr);
+ if (arg_count > 1) {
+ /* Set initial fields from table. */
+ int msg = arg_count + 1;
+ lua_pushnil(L);
+ while (lua_next(L, 2) != 0) {
+ lua_pushvalue(L, -2); /* now stack is key, val, key */
+ lua_insert(L, -3); /* now stack is key, key, val */
+ lua_settable(L, msg);
+ }
+ }
+
return 1;
}
-/* lupb_array_newindex():
+/* lupb_Array_Newindex():
*
* Handles:
* array[idx] = val
*
* idx can be within the array or one past the end to extend.
*/
-static int lupb_array_newindex(lua_State *L) {
- lupb_array *larray = lupb_array_check(L, 1);
- size_t size = upb_array_size(larray->arr);
+static int lupb_Array_Newindex(lua_State* L) {
+ lupb_array* larray = lupb_array_check(L, 1);
+ size_t size = upb_Array_Size(larray->arr);
uint32_t n = lupb_array_checkindex(L, 2, size + 1);
- upb_msgval msgval = lupb_tomsgval(L, larray->type, 3, 1, LUPB_COPY);
+ upb_MessageValue msgval = lupb_tomsgval(L, larray->type, 3, 1, LUPB_COPY);
if (n == size) {
- upb_array_append(larray->arr, msgval, lupb_arenaget(L, 1));
+ upb_Array_Append(larray->arr, msgval, lupb_Arenaget(L, 1));
} else {
- upb_array_set(larray->arr, n, msgval);
+ upb_Array_Set(larray->arr, n, msgval);
}
- if (larray->type == UPB_TYPE_MESSAGE) {
- lupb_arena_fuseobjs(L, 1, 3);
+ if (larray->type == kUpb_CType_Message) {
+ lupb_Arena_Fuseobjs(L, 1, 3);
}
- return 0; /* 1 for chained assignments? */
+ return 0; /* 1 for chained assignments? */
}
/* lupb_array_index():
@@ -420,11 +457,11 @@ static int lupb_array_newindex(lua_State *L) {
*
* idx must be within the array.
*/
-static int lupb_array_index(lua_State *L) {
- lupb_array *larray = lupb_array_check(L, 1);
- size_t size = upb_array_size(larray->arr);
+static int lupb_array_index(lua_State* L) {
+ lupb_array* larray = lupb_array_check(L, 1);
+ size_t size = upb_Array_Size(larray->arr);
uint32_t n = lupb_array_checkindex(L, 2, size);
- upb_msgval val = upb_array_get(larray->arr, n);
+ upb_MessageValue val = upb_Array_Get(larray->arr, n);
lupb_pushmsgval(L, 1, larray->type, val);
@@ -436,63 +473,61 @@ static int lupb_array_index(lua_State *L) {
* Handles:
* #array -> len
*/
-static int lupb_array_len(lua_State *L) {
- lupb_array *larray = lupb_array_check(L, 1);
- lua_pushnumber(L, upb_array_size(larray->arr));
+static int lupb_array_len(lua_State* L) {
+ lupb_array* larray = lupb_array_check(L, 1);
+ lua_pushnumber(L, upb_Array_Size(larray->arr));
return 1;
}
static const struct luaL_Reg lupb_array_mm[] = {
- {"__index", lupb_array_index},
- {"__len", lupb_array_len},
- {"__newindex", lupb_array_newindex},
- {NULL, NULL}
-};
-
+ {"__index", lupb_array_index},
+ {"__len", lupb_array_len},
+ {"__newindex", lupb_Array_Newindex},
+ {NULL, NULL}};
/* lupb_map *******************************************************************/
typedef struct {
- upb_map *map;
- upb_fieldtype_t key_type;
- upb_fieldtype_t value_type;
+ upb_Map* map;
+ upb_CType key_type;
+ upb_CType value_type;
} lupb_map;
#define MAP_MSGDEF_INDEX 1
-static lupb_map *lupb_map_check(lua_State *L, int narg) {
+static lupb_map* lupb_map_check(lua_State* L, int narg) {
return luaL_checkudata(L, narg, LUPB_MAP);
}
/* lupb_map Public API */
/**
- * lupb_map_new
+ * lupb_Map_New
*
* Handles:
* new_map = upb.Map(key_type, value_type)
* new_map = upb.Map(key_type, value_msgdef)
*/
-static int lupb_map_new(lua_State *L) {
- upb_arena *arena;
- lupb_map *lmap;
+static int lupb_Map_New(lua_State* L) {
+ upb_Arena* arena;
+ lupb_map* lmap;
if (lua_type(L, 2) == LUA_TNUMBER) {
lmap = lupb_newuserdata(L, sizeof(*lmap), 1, LUPB_MAP);
lmap->value_type = lupb_checkfieldtype(L, 2);
} else {
- lupb_msgdef_check(L, 2);
+ lupb_MessageDef_check(L, 2);
lmap = lupb_newuserdata(L, sizeof(*lmap), 2, LUPB_MAP);
- lmap->value_type = UPB_TYPE_MESSAGE;
+ lmap->value_type = kUpb_CType_Message;
lua_pushvalue(L, 2);
lua_setiuservalue(L, -2, MAP_MSGDEF_INDEX);
}
- arena = lupb_arena_pushnew(L);
+ arena = lupb_Arena_pushnew(L);
lua_setiuservalue(L, -2, LUPB_ARENA_INDEX);
lmap->key_type = lupb_checkfieldtype(L, 1);
- lmap->map = upb_map_new(arena, lmap->key_type, lmap->value_type);
+ lmap->map = upb_Map_New(arena, lmap->key_type, lmap->value_type);
lupb_cacheset(L, lmap->map);
return 1;
@@ -504,12 +539,12 @@ static int lupb_map_new(lua_State *L) {
* Handles:
* map[key]
*/
-static int lupb_map_index(lua_State *L) {
- lupb_map *lmap = lupb_map_check(L, 1);
- upb_msgval key = lupb_tomsgval(L, lmap->key_type, 2, 1, LUPB_REF);
- upb_msgval val;
+static int lupb_map_index(lua_State* L) {
+ lupb_map* lmap = lupb_map_check(L, 1);
+ upb_MessageValue key = lupb_tomsgval(L, lmap->key_type, 2, 1, LUPB_REF);
+ upb_MessageValue val;
- if (upb_map_get(lmap->map, key, &val)) {
+ if (upb_Map_Get(lmap->map, key, &val)) {
lupb_pushmsgval(L, 1, lmap->value_type, val);
} else {
lua_pushnil(L);
@@ -524,52 +559,51 @@ static int lupb_map_index(lua_State *L) {
* Handles:
* map_len = #map
*/
-static int lupb_map_len(lua_State *L) {
- lupb_map *lmap = lupb_map_check(L, 1);
- lua_pushnumber(L, upb_map_size(lmap->map));
+static int lupb_map_len(lua_State* L) {
+ lupb_map* lmap = lupb_map_check(L, 1);
+ lua_pushnumber(L, upb_Map_Size(lmap->map));
return 1;
}
/**
- * lupb_map_newindex
+ * lupb_Map_Newindex
*
* Handles:
* map[key] = val
* map[key] = nil # to remove from map
*/
-static int lupb_map_newindex(lua_State *L) {
- lupb_map *lmap = lupb_map_check(L, 1);
- upb_map *map = lmap->map;
- upb_msgval key = lupb_tomsgval(L, lmap->key_type, 2, 1, LUPB_REF);
+static int lupb_Map_Newindex(lua_State* L) {
+ lupb_map* lmap = lupb_map_check(L, 1);
+ upb_Map* map = lmap->map;
+ upb_MessageValue key = lupb_tomsgval(L, lmap->key_type, 2, 1, LUPB_REF);
if (lua_isnil(L, 3)) {
- upb_map_delete(map, key);
+ upb_Map_Delete(map, key);
} else {
- upb_msgval val = lupb_tomsgval(L, lmap->value_type, 3, 1, LUPB_COPY);
- upb_map_set(map, key, val, lupb_arenaget(L, 1));
- if (lmap->value_type == UPB_TYPE_MESSAGE) {
- lupb_arena_fuseobjs(L, 1, 3);
+ upb_MessageValue val = lupb_tomsgval(L, lmap->value_type, 3, 1, LUPB_COPY);
+ upb_Map_Set(map, key, val, lupb_Arenaget(L, 1));
+ if (lmap->value_type == kUpb_CType_Message) {
+ lupb_Arena_Fuseobjs(L, 1, 3);
}
}
return 0;
}
-static int lupb_mapiter_next(lua_State *L) {
+static int lupb_MapIterator_Next(lua_State* L) {
int map = lua_upvalueindex(2);
- size_t *iter = lua_touserdata(L, lua_upvalueindex(1));
- lupb_map *lmap = lupb_map_check(L, map);
+ size_t* iter = lua_touserdata(L, lua_upvalueindex(1));
+ lupb_map* lmap = lupb_map_check(L, map);
- if (upb_mapiter_next(lmap->map, iter)) {
- upb_msgval key = upb_mapiter_key(lmap->map, *iter);
- upb_msgval val = upb_mapiter_value(lmap->map, *iter);
+ if (upb_MapIterator_Next(lmap->map, iter)) {
+ upb_MessageValue key = upb_MapIterator_Key(lmap->map, *iter);
+ upb_MessageValue val = upb_MapIterator_Value(lmap->map, *iter);
lupb_pushmsgval(L, map, lmap->key_type, key);
lupb_pushmsgval(L, map, lmap->value_type, val);
return 2;
} else {
return 0;
}
-
}
/**
@@ -578,89 +612,88 @@ static int lupb_mapiter_next(lua_State *L) {
* Handles:
* pairs(map)
*/
-static int lupb_map_pairs(lua_State *L) {
- size_t *iter = lua_newuserdata(L, sizeof(*iter));
+static int lupb_map_pairs(lua_State* L) {
+ size_t* iter = lua_newuserdata(L, sizeof(*iter));
lupb_map_check(L, 1);
- *iter = UPB_MAP_BEGIN;
+ *iter = kUpb_Map_Begin;
lua_pushvalue(L, 1);
/* Upvalues are [iter, lupb_map]. */
- lua_pushcclosure(L, &lupb_mapiter_next, 2);
+ lua_pushcclosure(L, &lupb_MapIterator_Next, 2);
return 1;
}
/* upb_mapiter ]]] */
-static const struct luaL_Reg lupb_map_mm[] = {
- {"__index", lupb_map_index},
- {"__len", lupb_map_len},
- {"__newindex", lupb_map_newindex},
- {"__pairs", lupb_map_pairs},
- {NULL, NULL}
-};
-
+static const struct luaL_Reg lupb_map_mm[] = {{"__index", lupb_map_index},
+ {"__len", lupb_map_len},
+ {"__newindex", lupb_Map_Newindex},
+ {"__pairs", lupb_map_pairs},
+ {NULL, NULL}};
-/* lupb_msg *******************************************************************/
+/* lupb_Message
+ * *******************************************************************/
typedef struct {
- upb_msg *msg;
-} lupb_msg;
+ upb_Message* msg;
+} lupb_Message;
-/* lupb_msg helpers */
+/* lupb_Message helpers */
-static upb_msg *lupb_msg_check(lua_State *L, int narg) {
- lupb_msg *msg = luaL_checkudata(L, narg, LUPB_MSG);
+static upb_Message* lupb_msg_check(lua_State* L, int narg) {
+ lupb_Message* msg = luaL_checkudata(L, narg, LUPB_MSG);
return msg->msg;
}
-static const upb_msgdef *lupb_msg_getmsgdef(lua_State *L, int msg) {
+static const upb_MessageDef* lupb_Message_Getmsgdef(lua_State* L, int msg) {
lua_getiuservalue(L, msg, LUPB_MSGDEF_INDEX);
- const upb_msgdef *m = lupb_msgdef_check(L, -1);
+ const upb_MessageDef* m = lupb_MessageDef_check(L, -1);
lua_pop(L, 1);
return m;
}
-static const upb_fielddef *lupb_msg_tofield(lua_State *L, int msg, int field) {
+static const upb_FieldDef* lupb_msg_tofield(lua_State* L, int msg, int field) {
size_t len;
- const char *fieldname = luaL_checklstring(L, field, &len);
- const upb_msgdef *m = lupb_msg_getmsgdef(L, msg);
- return upb_msgdef_ntof(m, fieldname, len);
+ const char* fieldname = luaL_checklstring(L, field, &len);
+ const upb_MessageDef* m = lupb_Message_Getmsgdef(L, msg);
+ return upb_MessageDef_FindFieldByNameWithSize(m, fieldname, len);
}
-static const upb_fielddef *lupb_msg_checkfield(lua_State *L, int msg,
+static const upb_FieldDef* lupb_msg_checkfield(lua_State* L, int msg,
int field) {
- const upb_fielddef *f = lupb_msg_tofield(L, msg, field);
+ const upb_FieldDef* f = lupb_msg_tofield(L, msg, field);
if (f == NULL) {
luaL_error(L, "no such field '%s'", lua_tostring(L, field));
}
return f;
}
-upb_msg *lupb_msg_pushnew(lua_State *L, int narg) {
- const upb_msgdef *m = lupb_msgdef_check(L, narg);
- lupb_msg *lmsg = lupb_newuserdata(L, sizeof(lupb_msg), 2, LUPB_MSG);
- upb_arena *arena = lupb_arena_pushnew(L);
+upb_Message* lupb_msg_pushnew(lua_State* L, int narg) {
+ const upb_MessageDef* m = lupb_MessageDef_check(L, narg);
+ lupb_Message* lmsg = lupb_newuserdata(L, sizeof(lupb_Message), 2, LUPB_MSG);
+ upb_Arena* arena = lupb_Arena_pushnew(L);
lua_setiuservalue(L, -2, LUPB_ARENA_INDEX);
lua_pushvalue(L, 1);
lua_setiuservalue(L, -2, LUPB_MSGDEF_INDEX);
- lmsg->msg = upb_msg_new(m, arena);
+ lmsg->msg = upb_Message_New(m, arena);
lupb_cacheset(L, lmsg->msg);
return lmsg->msg;
}
/**
- * lupb_msg_newmsgwrapper()
+ * lupb_Message_Newmsgwrapper()
*
* Creates a new wrapper for a message, copying the arena and msgdef references
* from |narg| (which should be an array or map).
*/
-static void lupb_msg_newmsgwrapper(lua_State *L, int narg, upb_msgval val) {
- lupb_msg *lmsg = lupb_newuserdata(L, sizeof(*lmsg), 2, LUPB_MSG);
- lmsg->msg = (upb_msg*)val.msg_val; /* XXX: cast isn't great. */
+static void lupb_Message_Newmsgwrapper(lua_State* L, int narg,
+ upb_MessageValue val) {
+ lupb_Message* lmsg = lupb_newuserdata(L, sizeof(*lmsg), 2, LUPB_MSG);
+ lmsg->msg = (upb_Message*)val.msg_val; /* XXX: cast isn't great. */
lupb_cacheset(L, lmsg->msg);
/* Copy both arena and msgdef into the wrapper. */
@@ -671,18 +704,18 @@ static void lupb_msg_newmsgwrapper(lua_State *L, int narg, upb_msgval val) {
}
/**
- * lupb_msg_newud()
+ * lupb_Message_Newud()
*
* Creates the Lua userdata for a new wrapper object, adding a reference to
* the msgdef if necessary.
*/
-static void *lupb_msg_newud(lua_State *L, int narg, size_t size,
- const char *type, const upb_fielddef *f) {
- if (upb_fielddef_type(f) == UPB_TYPE_MESSAGE) {
+static void* lupb_Message_Newud(lua_State* L, int narg, size_t size,
+ const char* type, const upb_FieldDef* f) {
+ if (upb_FieldDef_CType(f) == kUpb_CType_Message) {
/* Wrapper needs a reference to the msgdef. */
void* ud = lupb_newuserdata(L, size, 2, type);
lua_getiuservalue(L, narg, LUPB_MSGDEF_INDEX);
- lupb_msgdef_pushsubmsgdef(L, f);
+ lupb_MessageDef_pushsubmsgdef(L, f);
lua_setiuservalue(L, -2, LUPB_MSGDEF_INDEX);
return ud;
} else {
@@ -691,26 +724,32 @@ static void *lupb_msg_newud(lua_State *L, int narg, size_t size,
}
/**
- * lupb_msg_newwrapper()
+ * lupb_Message_Newwrapper()
*
* Creates a new Lua wrapper object to wrap the given array, map, or message.
*/
-static void lupb_msg_newwrapper(lua_State *L, int narg, const upb_fielddef *f,
- upb_mutmsgval val) {
- if (upb_fielddef_ismap(f)) {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_itof(entry, UPB_MAPENTRY_KEY);
- const upb_fielddef *val_f = upb_msgdef_itof(entry, UPB_MAPENTRY_VALUE);
- lupb_map *lmap = lupb_msg_newud(L, narg, sizeof(*lmap), LUPB_MAP, val_f);
- lmap->key_type = upb_fielddef_type(key_f);
- lmap->value_type = upb_fielddef_type(val_f);
+static void lupb_Message_Newwrapper(lua_State* L, int narg,
+ const upb_FieldDef* f,
+ upb_MutableMessageValue val) {
+ if (upb_FieldDef_IsMap(f)) {
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_KeyFieldNumber);
+ const upb_FieldDef* val_f =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_ValueFieldNumber);
+ lupb_map* lmap =
+ lupb_Message_Newud(L, narg, sizeof(*lmap), LUPB_MAP, val_f);
+ lmap->key_type = upb_FieldDef_CType(key_f);
+ lmap->value_type = upb_FieldDef_CType(val_f);
lmap->map = val.map;
- } else if (upb_fielddef_isseq(f)) {
- lupb_array *larr = lupb_msg_newud(L, narg, sizeof(*larr), LUPB_ARRAY, f);
- larr->type = upb_fielddef_type(f);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ lupb_array* larr =
+ lupb_Message_Newud(L, narg, sizeof(*larr), LUPB_ARRAY, f);
+ larr->type = upb_FieldDef_CType(f);
larr->arr = val.array;
} else {
- lupb_msg *lmsg = lupb_msg_newud(L, narg, sizeof(*lmsg), LUPB_MSG, f);
+ lupb_Message* lmsg =
+ lupb_Message_Newud(L, narg, sizeof(*lmsg), LUPB_MSG, f);
lmsg->msg = val.msg;
}
@@ -726,28 +765,28 @@ static void lupb_msg_newwrapper(lua_State *L, int narg, const upb_fielddef *f,
/**
* lupb_msg_typechecksubmsg()
*
- * Typechecks the given array, map, or msg against this upb_fielddef.
+ * Typechecks the given array, map, or msg against this upb_FieldDef.
*/
-static void lupb_msg_typechecksubmsg(lua_State *L, int narg, int msgarg,
- const upb_fielddef *f) {
+static void lupb_msg_typechecksubmsg(lua_State* L, int narg, int msgarg,
+ const upb_FieldDef* f) {
/* Typecheck this map's msgdef against this message field. */
lua_getiuservalue(L, narg, LUPB_MSGDEF_INDEX);
lua_getiuservalue(L, msgarg, LUPB_MSGDEF_INDEX);
- lupb_msgdef_pushsubmsgdef(L, f);
+ lupb_MessageDef_pushsubmsgdef(L, f);
luaL_argcheck(L, lua_rawequal(L, -1, -2), narg, "message type mismatch");
lua_pop(L, 2);
}
-/* lupb_msg Public API */
+/* lupb_Message Public API */
/**
- * lupb_msgdef_call
+ * lupb_MessageDef_call
*
* Handles:
* new_msg = MessageClass()
* new_msg = MessageClass{foo = "bar", baz = 3, quux = {foo = 3}}
*/
-int lupb_msgdef_call(lua_State *L) {
+int lupb_MessageDef_call(lua_State* L) {
int arg_count = lua_gettop(L);
lupb_msg_pushnew(L, 1);
@@ -756,8 +795,8 @@ int lupb_msgdef_call(lua_State *L) {
int msg = arg_count + 1;
lua_pushnil(L);
while (lua_next(L, 2) != 0) {
- lua_pushvalue(L, -2); /* now stack is key, val, key */
- lua_insert(L, -3); /* now stack is key, key, val */
+ lua_pushvalue(L, -2); /* now stack is key, val, key */
+ lua_insert(L, -3); /* now stack is key, key, val */
lua_settable(L, msg);
}
}
@@ -773,75 +812,77 @@ int lupb_msgdef_call(lua_State *L) {
* msg["foo"]
* msg[field_descriptor] # (for extensions) (TODO)
*/
-static int lupb_msg_index(lua_State *L) {
- upb_msg *msg = lupb_msg_check(L, 1);
- const upb_fielddef *f = lupb_msg_checkfield(L, 1, 2);
+static int lupb_msg_index(lua_State* L) {
+ upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_FieldDef* f = lupb_msg_checkfield(L, 1, 2);
- if (upb_fielddef_isseq(f) || upb_fielddef_issubmsg(f)) {
+ if (upb_FieldDef_IsRepeated(f) || upb_FieldDef_IsSubMessage(f)) {
/* Wrapped type; get or create wrapper. */
- upb_arena *arena = upb_fielddef_isseq(f) ? lupb_arenaget(L, 1) : NULL;
- upb_mutmsgval val = upb_msg_mutable(msg, f, arena);
+ upb_Arena* arena = upb_FieldDef_IsRepeated(f) ? lupb_Arenaget(L, 1) : NULL;
+ upb_MutableMessageValue val = upb_Message_Mutable(msg, f, arena);
if (!lupb_cacheget(L, val.msg)) {
- lupb_msg_newwrapper(L, 1, f, val);
+ lupb_Message_Newwrapper(L, 1, f, val);
}
} else {
/* Value type, just push value and return .*/
- upb_msgval val = upb_msg_get(msg, f);
- lupb_pushmsgval(L, 0, upb_fielddef_type(f), val);
+ upb_MessageValue val = upb_Message_Get(msg, f);
+ lupb_pushmsgval(L, 0, upb_FieldDef_CType(f), val);
}
return 1;
}
/**
- * lupb_msg_newindex()
+ * lupb_Message_Newindex()
*
* Handles:
* msg.foo = bar
* msg["foo"] = bar
* msg[field_descriptor] = bar # (for extensions) (TODO)
*/
-static int lupb_msg_newindex(lua_State *L) {
- upb_msg *msg = lupb_msg_check(L, 1);
- const upb_fielddef *f = lupb_msg_checkfield(L, 1, 2);
- upb_msgval msgval;
+static int lupb_Message_Newindex(lua_State* L) {
+ upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_FieldDef* f = lupb_msg_checkfield(L, 1, 2);
+ upb_MessageValue msgval;
bool merge_arenas = true;
- if (upb_fielddef_ismap(f)) {
- lupb_map *lmap = lupb_map_check(L, 3);
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_itof(entry, UPB_MAPENTRY_KEY);
- const upb_fielddef *val_f = upb_msgdef_itof(entry, UPB_MAPENTRY_VALUE);
- upb_fieldtype_t key_type = upb_fielddef_type(key_f);
- upb_fieldtype_t value_type = upb_fielddef_type(val_f);
+ if (upb_FieldDef_IsMap(f)) {
+ lupb_map* lmap = lupb_map_check(L, 3);
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_KeyFieldNumber);
+ const upb_FieldDef* val_f =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_ValueFieldNumber);
+ upb_CType key_type = upb_FieldDef_CType(key_f);
+ upb_CType value_type = upb_FieldDef_CType(val_f);
luaL_argcheck(L, lmap->key_type == key_type, 3, "key type mismatch");
luaL_argcheck(L, lmap->value_type == value_type, 3, "value type mismatch");
- if (value_type == UPB_TYPE_MESSAGE) {
+ if (value_type == kUpb_CType_Message) {
lupb_msg_typechecksubmsg(L, 3, 1, val_f);
}
msgval.map_val = lmap->map;
- } else if (upb_fielddef_isseq(f)) {
- lupb_array *larr = lupb_array_check(L, 3);
- upb_fieldtype_t type = upb_fielddef_type(f);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ lupb_array* larr = lupb_array_check(L, 3);
+ upb_CType type = upb_FieldDef_CType(f);
luaL_argcheck(L, larr->type == type, 3, "array type mismatch");
- if (type == UPB_TYPE_MESSAGE) {
+ if (type == kUpb_CType_Message) {
lupb_msg_typechecksubmsg(L, 3, 1, f);
}
msgval.array_val = larr->arr;
- } else if (upb_fielddef_issubmsg(f)) {
- upb_msg *msg = lupb_msg_check(L, 3);
+ } else if (upb_FieldDef_IsSubMessage(f)) {
+ upb_Message* msg = lupb_msg_check(L, 3);
lupb_msg_typechecksubmsg(L, 3, 1, f);
msgval.msg_val = msg;
} else {
- msgval = lupb_tomsgval(L, upb_fielddef_type(f), 3, 1, LUPB_COPY);
+ msgval = lupb_tomsgval(L, upb_FieldDef_CType(f), 3, 1, LUPB_COPY);
merge_arenas = false;
}
if (merge_arenas) {
- lupb_arena_fuseobjs(L, 1, 3);
+ lupb_Arena_Fuseobjs(L, 1, 3);
}
- upb_msg_set(msg, f, msgval, lupb_arenaget(L, 1));
+ upb_Message_Set(msg, f, msgval, lupb_Arenaget(L, 1));
/* Return the new value for chained assignments. */
lua_pushvalue(L, 3);
@@ -856,22 +897,22 @@ static int lupb_msg_newindex(lua_State *L) {
* print(msg)
* etc.
*/
-static int lupb_msg_tostring(lua_State *L) {
- upb_msg *msg = lupb_msg_check(L, 1);
- const upb_msgdef *m;
+static int lupb_msg_tostring(lua_State* L) {
+ upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_MessageDef* m;
char buf[1024];
size_t size;
lua_getiuservalue(L, 1, LUPB_MSGDEF_INDEX);
- m = lupb_msgdef_check(L, -1);
+ m = lupb_MessageDef_check(L, -1);
- size = upb_text_encode(msg, m, NULL, 0, buf, sizeof(buf));
+ size = upb_TextEncode(msg, m, NULL, 0, buf, sizeof(buf));
if (size < sizeof(buf)) {
lua_pushlstring(L, buf, size);
} else {
- char *ptr = malloc(size + 1);
- upb_text_encode(msg, m, NULL, 0, ptr, size + 1);
+ char* ptr = malloc(size + 1);
+ upb_TextEncode(msg, m, NULL, 0, ptr, size + 1);
lua_pushlstring(L, ptr, size);
free(ptr);
}
@@ -880,16 +921,15 @@ static int lupb_msg_tostring(lua_State *L) {
}
static const struct luaL_Reg lupb_msg_mm[] = {
- {"__index", lupb_msg_index},
- {"__newindex", lupb_msg_newindex},
- {"__tostring", lupb_msg_tostring},
- {NULL, NULL}
-};
+ {"__index", lupb_msg_index},
+ {"__newindex", lupb_Message_Newindex},
+ {"__tostring", lupb_msg_tostring},
+ {NULL, NULL}};
+/* lupb_Message toplevel
+ * **********************************************************/
-/* lupb_msg toplevel **********************************************************/
-
-static int lupb_getoptions(lua_State *L, int narg) {
+static int lupb_getoptions(lua_State* L, int narg) {
int options = 0;
if (lua_gettop(L) >= narg) {
size_t len = lua_rawlen(L, narg);
@@ -908,23 +948,23 @@ static int lupb_getoptions(lua_State *L, int narg) {
* Handles:
* msg = upb.decode(MessageClass, bin_string)
*/
-static int lupb_decode(lua_State *L) {
+static int lupb_decode(lua_State* L) {
size_t len;
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- const char *pb = lua_tolstring(L, 2, &len);
- const upb_msglayout *layout = upb_msgdef_layout(m);
- upb_msg *msg = lupb_msg_pushnew(L, 1);
- upb_arena *arena = lupb_arenaget(L, -1);
- char *buf;
- bool ok;
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ const char* pb = lua_tolstring(L, 2, &len);
+ const upb_MiniTable* layout = upb_MessageDef_MiniTable(m);
+ upb_Message* msg = lupb_msg_pushnew(L, 1);
+ upb_Arena* arena = lupb_Arenaget(L, -1);
+ char* buf;
/* Copy input data to arena, message will reference it. */
- buf = upb_arena_malloc(arena, len);
+ buf = upb_Arena_Malloc(arena, len);
memcpy(buf, pb, len);
- ok = _upb_decode(buf, len, msg, layout, arena, UPB_DECODE_ALIAS);
+ upb_DecodeStatus status = upb_Decode(buf, len, msg, layout, NULL,
+ kUpb_DecodeOption_AliasString, arena);
- if (!ok) {
+ if (status != kUpb_DecodeStatus_Ok) {
lua_pushstring(L, "Error decoding protobuf.");
return lua_error(L);
}
@@ -933,22 +973,22 @@ static int lupb_decode(lua_State *L) {
}
/**
- * lupb_encode()
+ * lupb_Encode()
*
* Handles:
* bin_string = upb.encode(msg)
*/
-static int lupb_encode(lua_State *L) {
- const upb_msg *msg = lupb_msg_check(L, 1);
- const upb_msgdef *m = lupb_msg_getmsgdef(L, 1);
- const upb_msglayout *layout = upb_msgdef_layout(m);
+static int lupb_Encode(lua_State* L) {
+ const upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_MessageDef* m = lupb_Message_Getmsgdef(L, 1);
+ const upb_MiniTable* layout = upb_MessageDef_MiniTable(m);
int options = lupb_getoptions(L, 2);
- upb_arena *arena;
+ upb_Arena* arena;
size_t size;
- char *result;
+ char* result;
- arena = lupb_arena_pushnew(L);
- result = upb_encode_ex(msg, (const void*)layout, options, arena, &size);
+ arena = lupb_Arena_pushnew(L);
+ result = upb_Encode(msg, (const void*)layout, options, arena, &size);
if (!result) {
lua_pushstring(L, "Error encoding protobuf.");
@@ -964,21 +1004,22 @@ static int lupb_encode(lua_State *L) {
* lupb_jsondecode()
*
* Handles:
- * text_string = upb.json_decode(MessageClass, json_str, {upb.JSONDEC_IGNOREUNKNOWN})
+ * text_string = upb.json_decode(MessageClass, json_str,
+ * {upb.JSONDEC_IGNOREUNKNOWN})
*/
-static int lupb_jsondecode(lua_State *L) {
+static int lupb_jsondecode(lua_State* L) {
size_t len;
- const upb_msgdef *m = lupb_msgdef_check(L, 1);
- const char *json = lua_tolstring(L, 2, &len);
+ const upb_MessageDef* m = lupb_MessageDef_check(L, 1);
+ const char* json = lua_tolstring(L, 2, &len);
int options = lupb_getoptions(L, 3);
- upb_msg *msg;
- upb_arena *arena;
- upb_status status;
+ upb_Message* msg;
+ upb_Arena* arena;
+ upb_Status status;
msg = lupb_msg_pushnew(L, 1);
- arena = lupb_arenaget(L, -1);
- upb_status_clear(&status);
- upb_json_decode(json, len, msg, m, NULL, options, arena, &status);
+ arena = lupb_Arenaget(L, -1);
+ upb_Status_Clear(&status);
+ upb_JsonDecode(json, len, msg, m, NULL, options, arena, &status);
lupb_checkstatus(L, &status);
return 1;
@@ -990,23 +1031,23 @@ static int lupb_jsondecode(lua_State *L) {
* Handles:
* text_string = upb.json_encode(msg, {upb.JSONENC_EMITDEFAULTS})
*/
-static int lupb_jsonencode(lua_State *L) {
- upb_msg *msg = lupb_msg_check(L, 1);
- const upb_msgdef *m = lupb_msg_getmsgdef(L, 1);
+static int lupb_jsonencode(lua_State* L) {
+ upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_MessageDef* m = lupb_Message_Getmsgdef(L, 1);
int options = lupb_getoptions(L, 2);
char buf[1024];
size_t size;
- upb_status status;
+ upb_Status status;
- upb_status_clear(&status);
- size = upb_json_encode(msg, m, NULL, options, buf, sizeof(buf), &status);
+ upb_Status_Clear(&status);
+ size = upb_JsonEncode(msg, m, NULL, options, buf, sizeof(buf), &status);
lupb_checkstatus(L, &status);
if (size < sizeof(buf)) {
lua_pushlstring(L, buf, size);
} else {
- char *ptr = malloc(size + 1);
- upb_json_encode(msg, m, NULL, options, ptr, size + 1, &status);
+ char* ptr = malloc(size + 1);
+ upb_JsonEncode(msg, m, NULL, options, ptr, size + 1, &status);
lupb_checkstatus(L, &status);
lua_pushlstring(L, ptr, size);
free(ptr);
@@ -1021,20 +1062,20 @@ static int lupb_jsonencode(lua_State *L) {
* Handles:
* text_string = upb.text_encode(msg, {upb.TXTENC_SINGLELINE})
*/
-static int lupb_textencode(lua_State *L) {
- upb_msg *msg = lupb_msg_check(L, 1);
- const upb_msgdef *m = lupb_msg_getmsgdef(L, 1);
+static int lupb_textencode(lua_State* L) {
+ upb_Message* msg = lupb_msg_check(L, 1);
+ const upb_MessageDef* m = lupb_Message_Getmsgdef(L, 1);
int options = lupb_getoptions(L, 2);
char buf[1024];
size_t size;
- size = upb_text_encode(msg, m, NULL, options, buf, sizeof(buf));
+ size = upb_TextEncode(msg, m, NULL, options, buf, sizeof(buf));
if (size < sizeof(buf)) {
lua_pushlstring(L, buf, size);
} else {
- char *ptr = malloc(size + 1);
- upb_text_encode(msg, m, NULL, options, ptr, size + 1);
+ char* ptr = malloc(size + 1);
+ upb_TextEncode(msg, m, NULL, options, ptr, size + 1);
lua_pushlstring(L, ptr, size);
free(ptr);
}
@@ -1042,41 +1083,36 @@ static int lupb_textencode(lua_State *L) {
return 1;
}
-static void lupb_setfieldi(lua_State *L, const char *field, int i) {
+static void lupb_setfieldi(lua_State* L, const char* field, int i) {
lua_pushinteger(L, i);
lua_setfield(L, -2, field);
}
static const struct luaL_Reg lupb_msg_toplevel_m[] = {
- {"Array", lupb_array_new},
- {"Map", lupb_map_new},
- {"decode", lupb_decode},
- {"encode", lupb_encode},
- {"json_decode", lupb_jsondecode},
- {"json_encode", lupb_jsonencode},
- {"text_encode", lupb_textencode},
- {NULL, NULL}
-};
-
-void lupb_msg_registertypes(lua_State *L) {
+ {"Array", lupb_Array_New}, {"Map", lupb_Map_New},
+ {"decode", lupb_decode}, {"encode", lupb_Encode},
+ {"json_decode", lupb_jsondecode}, {"json_encode", lupb_jsonencode},
+ {"text_encode", lupb_textencode}, {NULL, NULL}};
+
+void lupb_msg_registertypes(lua_State* L) {
lupb_setfuncs(L, lupb_msg_toplevel_m);
- lupb_register_type(L, LUPB_ARENA, NULL, lupb_arena_mm);
+ lupb_register_type(L, LUPB_ARENA, NULL, lupb_Arena_mm);
lupb_register_type(L, LUPB_ARRAY, NULL, lupb_array_mm);
- lupb_register_type(L, LUPB_MAP, NULL, lupb_map_mm);
- lupb_register_type(L, LUPB_MSG, NULL, lupb_msg_mm);
+ lupb_register_type(L, LUPB_MAP, NULL, lupb_map_mm);
+ lupb_register_type(L, LUPB_MSG, NULL, lupb_msg_mm);
lupb_setfieldi(L, "TXTENC_SINGLELINE", UPB_TXTENC_SINGLELINE);
lupb_setfieldi(L, "TXTENC_SKIPUNKNOWN", UPB_TXTENC_SKIPUNKNOWN);
lupb_setfieldi(L, "TXTENC_NOSORT", UPB_TXTENC_NOSORT);
- lupb_setfieldi(L, "ENCODE_DETERMINISTIC", UPB_ENCODE_DETERMINISTIC);
- lupb_setfieldi(L, "ENCODE_SKIPUNKNOWN", UPB_ENCODE_SKIPUNKNOWN);
+ lupb_setfieldi(L, "ENCODE_DETERMINISTIC", kUpb_Encode_Deterministic);
+ lupb_setfieldi(L, "ENCODE_SKIPUNKNOWN", kUpb_Encode_SkipUnknown);
- lupb_setfieldi(L, "JSONENC_EMITDEFAULTS", UPB_JSONENC_EMITDEFAULTS);
- lupb_setfieldi(L, "JSONENC_PROTONAMES", UPB_JSONENC_PROTONAMES);
+ lupb_setfieldi(L, "JSONENC_EMITDEFAULTS", upb_JsonEncode_EmitDefaults);
+ lupb_setfieldi(L, "JSONENC_PROTONAMES", upb_JsonEncode_UseProtoNames);
- lupb_setfieldi(L, "JSONDEC_IGNOREUNKNOWN", UPB_JSONDEC_IGNOREUNKNOWN);
+ lupb_setfieldi(L, "JSONDEC_IGNOREUNKNOWN", upb_JsonDecode_IgnoreUnknown);
lupb_cacheinit(L);
}
diff --git a/grpc/third_party/upb/upb/bindings/lua/test.proto b/grpc/third_party/upb/upb/bindings/lua/test.proto
new file mode 100644
index 00000000..c7514360
--- /dev/null
+++ b/grpc/third_party/upb/upb/bindings/lua/test.proto
@@ -0,0 +1,69 @@
+
+syntax = "proto2";
+
+import "google/protobuf/timestamp.proto";
+
+package upb_test;
+
+message MapTest {
+ map<string, double> map_string_double = 1;
+}
+
+message PackedTest {
+ repeated bool bool_packed = 1 [packed = true];
+ repeated int32 i32_packed = 2 [packed = true];
+ repeated int64 i64_packed = 3 [packed = true];
+ repeated fixed32 f32_packed = 4 [packed = true];
+ repeated fixed64 f64_packed = 5 [packed = true];
+}
+
+message UnpackedTest {
+ repeated bool bool_packed = 1 [packed = false];
+ repeated int32 i32_packed = 2 [packed = false];
+ repeated int64 i64_packed = 3 [packed = false];
+ repeated fixed32 f32_packed = 4 [packed = false];
+ repeated fixed64 f64_packed = 5 [packed = false];
+}
+
+message TestLargeFieldNumber {
+ optional int32 i32 = 456214797;
+}
+
+message TestTimestamp {
+ optional google.protobuf.Timestamp ts = 1;
+}
+
+message HelloRequest {
+ optional uint32 id = 1;
+ optional uint32 random_name_a0 = 2;
+ optional uint32 random_name_a1 = 3;
+ optional uint32 random_name_a2 = 4;
+ optional uint32 random_name_a3 = 5;
+ optional uint32 random_name_a4 = 6;
+ optional uint32 random_name_a5 = 7;
+ optional uint32 random_name_a6 = 8;
+ optional uint32 random_name_a7 = 9;
+ optional uint32 random_name_a8 = 10;
+ optional uint32 random_name_a9 = 11;
+ optional uint32 random_name_b0 = 12;
+ optional uint32 random_name_b1 = 13;
+ optional uint32 random_name_b2 = 14;
+ optional uint32 random_name_b3 = 15;
+ optional uint32 random_name_b4 = 16;
+ optional uint32 random_name_b5 = 17;
+ optional uint32 random_name_b6 = 18;
+ optional uint32 random_name_b7 = 19;
+ optional uint32 random_name_b8 = 20;
+ optional uint32 random_name_b9 = 21;
+ optional uint32 random_name_c0 = 22;
+ optional uint32 random_name_c1 = 23;
+ optional uint32 random_name_c2 = 24;
+ optional uint32 random_name_c3 = 25;
+ optional uint32 random_name_c4 = 26;
+ optional uint32 random_name_c5 = 27;
+ optional uint32 random_name_c6 = 28;
+ optional uint32 random_name_c7 = 29;
+ optional uint32 random_name_c8 = 30;
+ optional uint32 random_name_c9 = 31;
+ optional string version = 32;
+}
diff --git a/grpc/third_party/upb/upb/bindings/lua/test_upb.lua b/grpc/third_party/upb/upb/bindings/lua/test_upb.lua
new file mode 100644
index 00000000..277a7efc
--- /dev/null
+++ b/grpc/third_party/upb/upb/bindings/lua/test_upb.lua
@@ -0,0 +1,846 @@
+--[[--------------------------------------------------------------------------
+
+ Copyright (c) 2009-2021, Google LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Google LLC nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--]]--------------------------------------------------------------------------
+
+local upb = require "lupb"
+local lunit = require "lunit"
+local upb_test = require "upb.bindings.lua.test_pb"
+local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
+local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
+local descriptor = require "google.protobuf.descriptor_pb"
+local empty = require "google.protobuf.empty_pb"
+
+if _VERSION >= 'Lua 5.2' then
+ _ENV = lunit.module("testupb", "seeall")
+else
+ module("testupb", lunit.testcase, package.seeall)
+end
+
+function iter_to_array(iter)
+ local arr = {}
+ for v in iter do
+ arr[#arr + 1] = v
+ end
+ return arr
+end
+
+function test_def_readers()
+ local m = test_messages_proto3.TestAllTypesProto3
+ assert_equal("TestAllTypesProto3", m:name())
+ assert_equal("protobuf_test_messages.proto3.TestAllTypesProto3", m:full_name())
+
+ -- field
+ local f = m:field("optional_int32")
+ local f2 = m:field(1)
+ assert_equal(f, f2)
+ assert_equal(1, f:number())
+ assert_equal("optional_int32", f:name())
+ assert_equal(upb.LABEL_OPTIONAL, f:label())
+ assert_equal(upb.DESCRIPTOR_TYPE_INT32, f:descriptor_type())
+ assert_equal(upb.TYPE_INT32, f:type())
+ assert_nil(f:containing_oneof())
+ assert_equal(m, f:containing_type())
+ assert_equal(0, f:default())
+ local message_field_count = 0
+ for field in m:fields() do
+ message_field_count = message_field_count + 1
+ end
+ assert_equal(message_field_count, #m)
+
+ local message_oneof_count = 0
+ for oneof in m:oneofs() do
+ message_oneof_count = message_oneof_count + 1
+ end
+ assert_equal(message_oneof_count, m:oneof_count())
+
+ -- oneof
+ local o = m:lookup_name("oneof_field")
+ assert_equal("oneof_field", o:name())
+ assert_equal(m, o:containing_type())
+ local oneof_field_count = 0
+ for field in o:fields() do
+ oneof_field_count = oneof_field_count + 1
+ end
+ assert_equal(oneof_field_count, #o)
+
+ -- enum
+ local e = test_messages_proto3['TestAllTypesProto3.NestedEnum']
+ assert_true(#e > 3 and #e < 10)
+ assert_equal(2, e:value("BAZ"):number())
+end
+
+function test_msg_map()
+ msg = test_messages_proto3.TestAllTypesProto3()
+ msg.map_int32_int32[5] = 10
+ msg.map_int32_int32[6] = 12
+ assert_equal(10, msg.map_int32_int32[5])
+ assert_equal(12, msg.map_int32_int32[6])
+
+ -- Test overwrite.
+ msg.map_int32_int32[5] = 20
+ assert_equal(20, msg.map_int32_int32[5])
+ assert_equal(12, msg.map_int32_int32[6])
+ msg.map_int32_int32[5] = 10
+
+ -- Test delete.
+ msg.map_int32_int32[5] = nil
+ assert_nil(msg.map_int32_int32[5])
+ assert_equal(12, msg.map_int32_int32[6])
+ msg.map_int32_int32[5] = 10
+
+ local serialized = upb.encode(msg)
+ assert_true(#serialized > 0)
+ local msg2 = upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
+ assert_equal(10, msg2.map_int32_int32[5])
+ assert_equal(12, msg2.map_int32_int32[6])
+end
+
+function test_map_sorting()
+ function msg_with_int32_entries(start, expand)
+ local msg = test_messages_proto3.TestAllTypesProto3()
+ for i=start,start + 8 do
+ msg.map_int32_int32[i] = i * 2
+ end
+
+ if expand then
+ for i=start+20,200 do
+ msg.map_int32_int32[i] = i
+ end
+ for i=start+20,200 do
+ msg.map_int32_int32[i] = nil
+ end
+ end
+ return msg
+ end
+
+ function msg_with_msg_entries(expand)
+ local msg = test_messages_proto3.TestAllTypesProto3()
+ -- 8! = 40320 possible orderings makes it overwhelmingly likely that two
+ -- random orderings will be different.
+ for i=1,8 do
+ local submsg = test_messages_proto3.TestAllTypesProto3.NestedMessage()
+ submsg.corecursive = msg_with_int32_entries(i, expand)
+ msg.map_string_nested_message[tostring(i)] = submsg
+ end
+
+ expand = false
+ if expand then
+ for i=21,2000 do
+ local submsg = test_messages_proto3.TestAllTypesProto3.NestedMessage()
+ submsg.corecursive = msg_with_int32_entries(i, expand)
+ msg.map_string_nested_message[tostring(i)] = submsg
+ end
+ for i=21,2000 do
+ msg.map_string_nested_message[tostring(i)] = nil
+ end
+ end
+ return msg
+ end
+
+ -- Create two messages with the same contents but (hopefully) different
+ -- map table orderings.
+ local msg = msg_with_msg_entries(false)
+ local msg2 = msg_with_msg_entries(true)
+
+ local text1 = upb.text_encode(msg)
+ local text2 = upb.text_encode(msg2)
+ assert_equal(text1, text2)
+
+ local binary1 = upb.encode(msg, {upb.ENCODE_DETERMINISTIC})
+ local binary2 = upb.encode(msg2, {upb.ENCODE_DETERMINISTIC})
+ assert_equal(binary1, binary2)
+
+ -- Non-sorted map should compare different.
+ local text3 = upb.text_encode(msg, {upb.TXTENC_NOSORT})
+ assert_not_equal(text1, text3)
+
+ local binary3 = upb.encode(msg)
+ assert_not_equal(binary1, binary3)
+end
+
+function test_utf8()
+ local proto2_msg = test_messages_proto2.TestAllTypesProto2()
+ proto2_msg.optional_string = "\xff"
+ local serialized = upb.encode(proto2_msg)
+
+ -- Decoding invalid UTF-8 succeeds in proto2.
+ upb.decode(test_messages_proto2.TestAllTypesProto2, serialized)
+
+ -- Decoding invalid UTF-8 fails in proto2.
+ assert_error_match("Error decoding protobuf", function()
+ upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
+ end)
+
+ -- TODO(haberman): should proto3 accessors also check UTF-8 at set time?
+end
+
+function test_string_double_map()
+ msg = upb_test.MapTest()
+ msg.map_string_double["one"] = 1.0
+ msg.map_string_double["two point five"] = 2.5
+ assert_equal(1, msg.map_string_double["one"])
+ assert_equal(2.5, msg.map_string_double["two point five"])
+
+ -- Test overwrite.
+ msg.map_string_double["one"] = 2
+ assert_equal(2, msg.map_string_double["one"])
+ assert_equal(2.5, msg.map_string_double["two point five"])
+ msg.map_string_double["one"] = 1.0
+
+ -- Test delete.
+ msg.map_string_double["one"] = nil
+ assert_nil(msg.map_string_double["one"])
+ assert_equal(2.5, msg.map_string_double["two point five"])
+ msg.map_string_double["one"] = 1
+
+ local serialized = upb.encode(msg)
+ assert_true(#serialized > 0)
+ local msg2 = upb.decode(upb_test.MapTest, serialized)
+ assert_equal(1, msg2.map_string_double["one"])
+ assert_equal(2.5, msg2.map_string_double["two point five"])
+end
+
+function test_string_double_map()
+ local function fill_msg(msg)
+ msg.i32_packed[1] = 100
+ msg.i32_packed[2] = 200
+ msg.i32_packed[3] = 50000
+
+ msg.i64_packed[1] = 101
+ msg.i64_packed[2] = 201
+ msg.i64_packed[3] = 50001
+
+ msg.f32_packed[1] = 102
+ msg.f32_packed[2] = 202
+ msg.f32_packed[3] = 50002
+
+ msg.f64_packed[1] = 103
+ msg.f64_packed[2] = 203
+ msg.f64_packed[3] = 50003
+ end
+
+ local function check_msg(msg)
+ assert_equal(100, msg.i32_packed[1])
+ assert_equal(200, msg.i32_packed[2])
+ assert_equal(50000, msg.i32_packed[3])
+ assert_equal(3, #msg.i32_packed)
+
+ assert_equal(101, msg.i64_packed[1])
+ assert_equal(201, msg.i64_packed[2])
+ assert_equal(50001, msg.i64_packed[3])
+ assert_equal(3, #msg.i64_packed)
+
+ assert_equal(102, msg.f32_packed[1])
+ assert_equal(202, msg.f32_packed[2])
+ assert_equal(50002, msg.f32_packed[3])
+ assert_equal(3, #msg.f32_packed)
+
+ assert_equal(103, msg.f64_packed[1])
+ assert_equal(203, msg.f64_packed[2])
+ assert_equal(50003, msg.f64_packed[3])
+ assert_equal(3, #msg.f64_packed)
+ end
+
+ local msg = upb_test.PackedTest()
+ fill_msg(msg)
+ check_msg(msg)
+
+ local serialized_packed = upb.encode(msg)
+ local msg2 = upb.decode(upb_test.PackedTest, serialized_packed)
+ local msg3 = upb.decode(upb_test.UnpackedTest, serialized_packed)
+ check_msg(msg2)
+ check_msg(msg3)
+
+ serialized_unpacked = upb.encode(msg3)
+ local msg4 = upb.decode(upb_test.PackedTest, serialized_unpacked)
+ local msg5 = upb.decode(upb_test.PackedTest, serialized_unpacked)
+ check_msg(msg4)
+ check_msg(msg5)
+
+end
+
+function test_msg_string_map()
+ msg = test_messages_proto3.TestAllTypesProto3()
+ msg.map_string_string["foo"] = "bar"
+ msg.map_string_string["baz"] = "quux"
+ assert_nil(msg.map_string_string["abc"])
+ assert_equal("bar", msg.map_string_string["foo"])
+ assert_equal("quux", msg.map_string_string["baz"])
+
+ -- Test overwrite.
+ msg.map_string_string["foo"] = "123"
+ assert_equal("123", msg.map_string_string["foo"])
+ assert_equal("quux", msg.map_string_string["baz"])
+ msg.map_string_string["foo"] = "bar"
+
+ -- Test delete
+ msg.map_string_string["foo"] = nil
+ assert_nil(msg.map_string_string["foo"])
+ assert_equal("quux", msg.map_string_string["baz"])
+ msg.map_string_string["foo"] = "bar"
+
+ local serialized = upb.encode(msg)
+ assert_true(#serialized > 0)
+ local msg2 = upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
+ assert_equal("bar", msg2.map_string_string["foo"])
+ assert_equal("quux", msg2.map_string_string["baz"])
+end
+
+function test_msg_array()
+ msg = test_messages_proto3.TestAllTypesProto3()
+
+ assert_not_nil(msg.repeated_int32)
+ assert_equal(msg.repeated_int32, msg.repeated_int32)
+ assert_equal(0, #msg.repeated_int32)
+
+ msg.repeated_int32[1] = 2
+ assert_equal(1, #msg.repeated_int32);
+ assert_equal(2, msg.repeated_int32[1]);
+
+ -- Can't assign a scalar; array is expected.
+ assert_error_match("lupb.array expected", function() msg.repeated_int32 = 5 end)
+
+ -- Can't assign array of the wrong type.
+ local function assign_int64()
+ msg.repeated_int32 = upb.Array(upb.TYPE_INT64)
+ end
+ assert_error_match("array type mismatch", assign_int64)
+
+ local arr = upb.Array(upb.TYPE_INT32)
+ arr[1] = 6
+ assert_equal(1, #arr)
+ msg.repeated_int32 = arr
+ assert_equal(msg.repeated_int32, msg.repeated_int32)
+ assert_equal(arr, msg.repeated_int32)
+ assert_equal(1, #msg.repeated_int32)
+ assert_equal(6, msg.repeated_int32[1])
+
+ -- Can't assign other Lua types.
+ assert_error_match("array expected", function() msg.repeated_int32 = "abc" end)
+ assert_error_match("array expected", function() msg.repeated_int32 = true end)
+ assert_error_match("array expected", function() msg.repeated_int32 = false end)
+ assert_error_match("array expected", function() msg.repeated_int32 = nil end)
+ assert_error_match("array expected", function() msg.repeated_int32 = {} end)
+ assert_error_match("array expected", function() msg.repeated_int32 = print end)
+end
+
+function test_array_append()
+ local arr = upb.Array(upb.TYPE_INT32)
+ for i=1,200000 do
+ arr[i] = i
+ end
+ for i=1,200000 do
+ assert_equal(i, arr[i])
+ end
+end
+
+function test_msg_submsg()
+ --msg = test_messages_proto3.TestAllTypesProto3()
+ msg = test_messages_proto3['TestAllTypesProto3']()
+
+ assert_nil(msg.optional_nested_message)
+
+ -- Can't assign message of the wrong type.
+ local function assign_int64()
+ msg.optional_nested_message = test_messages_proto3.TestAllTypesProto3()
+ end
+ assert_error_match("message type mismatch", assign_int64)
+
+ local nested = test_messages_proto3['TestAllTypesProto3.NestedMessage']()
+ msg.optional_nested_message = nested
+ assert_equal(nested, msg.optional_nested_message)
+
+ -- Can't assign other Lua types.
+ assert_error_match("msg expected", function() msg.optional_nested_message = "abc" end)
+ assert_error_match("msg expected", function() msg.optional_nested_message = true end)
+ assert_error_match("msg expected", function() msg.optional_nested_message = false end)
+ assert_error_match("msg expected", function() msg.optional_nested_message = nil end)
+ assert_error_match("msg expected", function() msg.optional_nested_message = {} end)
+ assert_error_match("msg expected", function() msg.optional_nested_message = print end)
+end
+
+-- Lua 5.1 and 5.2 have slightly different semantics for how a finalizer
+-- can be defined in Lua.
+if _VERSION >= 'Lua 5.2' then
+ function defer(fn)
+ setmetatable({}, { __gc = fn })
+ end
+else
+ function defer(fn)
+ getmetatable(newproxy(true)).__gc = fn
+ end
+end
+
+function test_finalizer()
+ -- Tests that we correctly handle a call into an already-finalized object.
+ -- Collectible objects are finalized in the opposite order of creation.
+ do
+ local t = {}
+ defer(function()
+ assert_error_match("called into dead object", function()
+ -- Generic def call.
+ t[1]:lookup_msg("abc")
+ end)
+ end)
+ t = {
+ upb.SymbolTable(),
+ }
+ end
+ collectgarbage()
+end
+
+-- in-range of 64-bit types but not exactly representable as double
+local bad64 = 2^68 - 1
+
+local numeric_types = {
+ [upb.TYPE_UINT32] = {
+ valid_val = 2^32 - 1,
+ too_big = 2^32,
+ too_small = -1,
+ other_bad = 5.1
+ },
+ [upb.TYPE_UINT64] = {
+ valid_val = 2^63,
+ too_big = 2^64,
+ too_small = -1,
+ other_bad = bad64
+ },
+ [upb.TYPE_INT32] = {
+ valid_val = 2^31 - 1,
+ too_big = 2^31,
+ too_small = -2^31 - 1,
+ other_bad = 5.1
+ },
+ -- Enums don't exist at a language level in Lua, so we just represent enum
+ -- values as int32s.
+ [upb.TYPE_ENUM] = {
+ valid_val = 2^31 - 1,
+ too_big = 2^31,
+ too_small = -2^31 - 1,
+ other_bad = 5.1
+ },
+ [upb.TYPE_INT64] = {
+ valid_val = 2^62,
+ too_big = 2^63,
+ too_small = -2^64,
+ other_bad = bad64
+ },
+ [upb.TYPE_FLOAT] = {
+ valid_val = 340282306073709652508363335590014353408
+ },
+ [upb.TYPE_DOUBLE] = {
+ valid_val = 10^101
+ },
+}
+
+function test_utf8()
+ local invalid_utf8 = "\xff"
+ local proto2_msg = test_messages_proto2.TestAllTypesProto2{
+ optional_string = invalid_utf8,
+ }
+
+ -- As proto2, invalid UTF-8 parses and serializes fine.
+ local serialized = upb.encode(proto2_msg)
+ local proto2_msg2 = upb.decode(test_messages_proto2.TestAllTypesProto2, serialized)
+
+ -- Decoding as proto3 fails.
+ assert_error(function()
+ upb.decode(test_messages_proto3.TestAllTypesProto3, serialized)
+ end)
+end
+
+function test_msg_primitives()
+ local msg = test_messages_proto3.TestAllTypesProto3{
+ optional_int32 = 10,
+ optional_uint32 = 20,
+ optional_int64 = 30,
+ optional_uint64 = 40,
+ optional_double = 50,
+ optional_float = 60,
+ optional_sint32 = 70,
+ optional_sint64 = 80,
+ optional_fixed32 = 90,
+ optional_fixed64 = 100,
+ optional_sfixed32 = 110,
+ optional_sfixed64 = 120,
+ optional_bool = true,
+ optional_string = "abc",
+ optional_nested_message = test_messages_proto3['TestAllTypesProto3.NestedMessage']{a = 123},
+ }
+
+ -- Attempts to access non-existent fields fail.
+ assert_error_match("no such field", function() msg.no_such = 1 end)
+
+ assert_equal(10, msg.optional_int32)
+ assert_equal(20, msg.optional_uint32)
+ assert_equal(30, msg.optional_int64)
+ assert_equal(40, msg.optional_uint64)
+ assert_equal(50, msg.optional_double)
+ assert_equal(60, msg.optional_float)
+ assert_equal(70, msg.optional_sint32)
+ assert_equal(80, msg.optional_sint64)
+ assert_equal(90, msg.optional_fixed32)
+ assert_equal(100, msg.optional_fixed64)
+ assert_equal(110, msg.optional_sfixed32)
+ assert_equal(120, msg.optional_sfixed64)
+ assert_equal(true, msg.optional_bool)
+ assert_equal("abc", msg.optional_string)
+ assert_equal(123, msg.optional_nested_message.a)
+end
+
+
+function test_string_array()
+ local function test_for_string_type(upb_type)
+ local array = upb.Array(upb_type)
+ assert_equal(0, #array)
+
+ -- 0 is never a valid index in Lua.
+ assert_error_match("array index", function() return array[0] end)
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[1] end)
+
+ array[1] = "foo"
+ assert_equal("foo", array[1])
+ assert_equal(1, #array)
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[2] end)
+
+ local array2 = upb.Array(upb_type)
+ assert_equal(0, #array2)
+
+ array[2] = "bar"
+ assert_equal("foo", array[1])
+ assert_equal("bar", array[2])
+ assert_equal(2, #array)
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[3] end)
+
+ -- Can't assign other Lua types.
+ assert_error_match("Expected string", function() array[3] = 123 end)
+ assert_error_match("Expected string", function() array[3] = true end)
+ assert_error_match("Expected string", function() array[3] = false end)
+ assert_error_match("Expected string", function() array[3] = nil end)
+ assert_error_match("Expected string", function() array[3] = {} end)
+ assert_error_match("Expected string", function() array[3] = print end)
+ assert_error_match("Expected string", function() array[3] = array end)
+ end
+
+ test_for_string_type(upb.TYPE_STRING)
+ test_for_string_type(upb.TYPE_BYTES)
+end
+
+function test_numeric_array()
+ local function test_for_numeric_type(upb_type)
+ local array = upb.Array(upb_type)
+ local vals = numeric_types[upb_type]
+ assert_equal(0, #array)
+
+ -- 0 is never a valid index in Lua.
+ assert_error_match("array index", function() return array[0] end)
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[1] end)
+
+ array[1] = vals.valid_val
+ assert_equal(vals.valid_val, array[1])
+ assert_equal(1, #array)
+ assert_equal(vals.valid_val, array[1])
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[2] end)
+
+ array[2] = 10
+ assert_equal(vals.valid_val, array[1])
+ assert_equal(10, array[2])
+ assert_equal(2, #array)
+ -- Past the end of the array.
+ assert_error_match("array index", function() return array[3] end)
+
+ -- Values that are out of range.
+ local errmsg = "not an integer or out of range"
+ if vals.too_small then
+ assert_error_match(errmsg, function() array[3] = vals.too_small end)
+ end
+ if vals.too_big then
+ assert_error_match(errmsg, function() array[3] = vals.too_big end)
+ end
+ if vals.other_bad then
+ assert_error_match(errmsg, function() array[3] = vals.other_bad end)
+ end
+
+ -- Can't assign other Lua types.
+ errmsg = "bad argument #3"
+ assert_error_match(errmsg, function() array[3] = "abc" end)
+ assert_error_match(errmsg, function() array[3] = true end)
+ assert_error_match(errmsg, function() array[3] = false end)
+ assert_error_match(errmsg, function() array[3] = nil end)
+ assert_error_match(errmsg, function() array[3] = {} end)
+ assert_error_match(errmsg, function() array[3] = print end)
+ assert_error_match(errmsg, function() array[3] = array end)
+ end
+
+ for k in pairs(numeric_types) do
+ test_for_numeric_type(k)
+ end
+end
+
+function test_numeric_map()
+ local function test_for_numeric_types(key_type, val_type)
+ local map = upb.Map(key_type, val_type)
+ local key_vals = numeric_types[key_type]
+ local val_vals = numeric_types[val_type]
+
+ assert_equal(0, #map)
+
+ -- Unset keys return nil
+ assert_nil(map[key_vals.valid_val])
+
+ map[key_vals.valid_val] = val_vals.valid_val
+ assert_equal(1, #map)
+ assert_equal(val_vals.valid_val, map[key_vals.valid_val])
+
+ i = 0
+ for k, v in pairs(map) do
+ assert_equal(key_vals.valid_val, k)
+ assert_equal(val_vals.valid_val, v)
+ end
+
+ -- Out of range key/val
+ local errmsg = "not an integer or out of range"
+ if key_vals.too_small then
+ assert_error_match(errmsg, function() map[key_vals.too_small] = 1 end)
+ end
+ if key_vals.too_big then
+ assert_error_match(errmsg, function() map[key_vals.too_big] = 1 end)
+ end
+ if key_vals.other_bad then
+ assert_error_match(errmsg, function() map[key_vals.other_bad] = 1 end)
+ end
+
+ if val_vals.too_small then
+ assert_error_match(errmsg, function() map[1] = val_vals.too_small end)
+ end
+ if val_vals.too_big then
+ assert_error_match(errmsg, function() map[1] = val_vals.too_big end)
+ end
+ if val_vals.other_bad then
+ assert_error_match(errmsg, function() map[1] = val_vals.other_bad end)
+ end
+ end
+
+ for k in pairs(numeric_types) do
+ for v in pairs(numeric_types) do
+ test_for_numeric_types(k, v)
+ end
+ end
+end
+
+function test_unknown()
+ local bytes = string.rep("\x38\x00", 1000)
+ for i=1,1000 do
+ local msg = upb.decode(test_messages_proto3.TestAllTypesProto3, bytes)
+ end
+end
+
+function test_foo()
+ local symtab = upb.SymbolTable()
+ local filename = "external/com_google_protobuf/descriptor_proto-descriptor-set.proto.bin"
+ local file = io.open(filename, "rb") or io.open("bazel-bin/" .. filename, "rb")
+ assert_not_nil(file)
+ local descriptor = file:read("*a")
+ assert_true(#descriptor > 0)
+ symtab:add_set(descriptor)
+ local FileDescriptorSet = symtab:lookup_msg("google.protobuf.FileDescriptorSet")
+ assert_not_nil(FileDescriptorSet)
+ set = FileDescriptorSet()
+ assert_equal(#set.file, 0)
+ assert_error_match("lupb.array expected", function () set.file = 1 end)
+
+ set = upb.decode(FileDescriptorSet, descriptor)
+
+ -- Test that we can at least call this without crashing.
+ set_textformat = tostring(set)
+
+ -- print(set_textformat)
+ assert_equal(#set.file, 1)
+ assert_equal(set.file[1].name, "google/protobuf/descriptor.proto")
+end
+
+function test_descriptor()
+ local symtab = upb.SymbolTable()
+ local file_proto = descriptor.FileDescriptorProto {
+ name = "test.proto",
+ message_type = upb.Array(descriptor.DescriptorProto, {
+ descriptor.DescriptorProto{
+ name = "ABC",
+ },
+ })
+ }
+ local file = symtab:add_file(upb.encode(file_proto))
+ assert_equal(file:symtab(), symtab)
+end
+
+function test_descriptor_error()
+ local symtab = upb.SymbolTable()
+ local file = descriptor.FileDescriptorProto()
+ file.name = "test.proto"
+ file.message_type[1] = descriptor.DescriptorProto{
+ name = "ABC"
+ }
+ file.message_type[2] = descriptor.DescriptorProto{
+ name = "BC."
+ }
+ assert_error(function () symtab:add_file(upb.encode(file)) end)
+ assert_nil(symtab:lookup_msg("ABC"))
+end
+
+function test_duplicate_enumval()
+ local symtab = upb.SymbolTable()
+ local file_proto = descriptor.FileDescriptorProto {
+ name = "test.proto",
+ message_type = upb.Array(descriptor.DescriptorProto, {
+ descriptor.DescriptorProto{
+ name = "ABC",
+ },
+ }),
+ enum_type = upb.Array(descriptor.EnumDescriptorProto, {
+ descriptor.EnumDescriptorProto{
+ name = "MyEnum",
+ value = upb.Array(descriptor.EnumValueDescriptorProto, {
+ descriptor.EnumValueDescriptorProto{
+ name = "ABC",
+ number = 1,
+ }
+ }),
+ },
+ })
+ }
+ assert_error(function () symtab:add_file(upb.encode(file_proto)) end)
+end
+
+function test_duplicate_filename_error()
+ local symtab = upb.SymbolTable()
+ local file = descriptor.FileDescriptorProto()
+ file.name = "test.proto"
+ symtab:add_file(upb.encode(file))
+ -- Second add with the same filename fails.
+ assert_error(function () symtab:add_file(upb.encode(file)) end)
+end
+
+function test_encode_skipunknown()
+ -- Test that upb.ENCODE_SKIPUNKNOWN does not encode unknown fields.
+ local msg = test_messages_proto3.TestAllTypesProto3{
+ optional_int32 = 10,
+ optional_uint32 = 20,
+ optional_int64 = 30,
+ }
+ -- SKIPUNKNOWN here tests that it does *not* affect regular fields.
+ local serialized = upb.encode(msg, {upb.ENCODE_SKIPUNKNOWN})
+ assert_true(#serialized > 0)
+ local empty_with_unknown = upb.decode(empty.Empty, serialized)
+ assert_true(#upb.encode(empty_with_unknown) > 0)
+ -- Verify that unknown fields are not serialized.
+ assert_true(#upb.encode(empty_with_unknown, {upb.ENCODE_SKIPUNKNOWN}) == 0)
+end
+
+function test_json_emit_defaults()
+ local msg = test_messages_proto3.TestAllTypesProto3()
+ local json = upb.json_encode(msg, {upb.JSONENC_EMITDEFAULTS})
+end
+
+function test_json_locale()
+ local msg = test_messages_proto3.TestAllTypesProto3()
+ msg.optional_double = 1.1
+ local original_locale = os.setlocale(nil)
+ os.setlocale("C")
+ local json = upb.json_encode(msg)
+ os.setlocale("de_DE.utf8")
+ assert_equal(json, upb.json_encode(msg))
+ os.setlocale(original_locale) -- Restore.
+end
+
+function test_encode_depth_limit()
+ local msg = test_messages_proto3.TestAllTypesProto3()
+ msg.recursive_message = msg
+ assert_error(function() upb.encode(msg) end)
+end
+
+function test_large_field_number()
+ local msg = upb_test.TestLargeFieldNumber()
+ msg.i32 = 5
+ local serialized = upb.encode(msg)
+ local msg2 = upb.decode(upb_test.TestLargeFieldNumber, serialized)
+ assert_equal(msg.i32, msg2.i32)
+end
+
+function test_timestamp_minutes()
+ local msg = upb.json_decode(upb_test.TestTimestamp, '{"ts": "2000-01-01T00:00:00-06:59"}')
+ assert_equal(msg.ts.seconds, 946684800 + ((6 * 60) + 59) * 60)
+end
+
+function test_gc()
+ local top = test_messages_proto3.TestAllTypesProto3()
+ local n = 100
+ local m
+
+ for i=1,n do
+ local inner = test_messages_proto3.TestAllTypesProto3()
+ m = inner
+ for j=1,n do
+ local tmp = m
+ m = test_messages_proto3.TestAllTypesProto3()
+ -- This will cause the arenas to fuse. But we stop referring to the child,
+ -- so the Lua object is eligible for collection (and therefore its original
+ -- arena can be collected too). Only the fusing will keep the C mem alivd.
+ m.recursive_message = tmp
+
+ end
+ top.recursive_message = m
+ end
+
+ collectgarbage()
+
+ for i=1,n do
+ -- Verify we can touch all the messages again and without accessing freed
+ -- memory.
+ m = m.recursive_message
+ assert_not_nil(m)
+ end
+end
+
+function test_b9440()
+ local m = upb_test.HelloRequest()
+ m.id = 8
+ assert_equal(8, m.id)
+ m.version = "1"
+ assert_equal(8, m.id)
+end
+
+local stats = lunit.main()
+
+if stats.failed > 0 or stats.errors > 0 then
+ error("One or more errors in test suite")
+end
diff --git a/grpc/third_party/upb/upb/bindings/lua/upb.c b/grpc/third_party/upb/upb/bindings/lua/upb.c
index c247c037..3d59cddf 100644
--- a/grpc/third_party/upb/upb/bindings/lua/upb.c
+++ b/grpc/third_party/upb/upb/bindings/lua/upb.c
@@ -1,29 +1,57 @@
/*
-** require("lua") -- A Lua extension for upb.
-**
-** Exposes only the core library
-** (sub-libraries are exposed in other extensions).
-**
-** 64-bit woes: Lua can only represent numbers of type lua_Number (which is
-** double unless the user specifically overrides this). Doubles can represent
-** the entire range of 64-bit integers, but lose precision once the integers are
-** greater than 2^53.
-**
-** Lua 5.3 is adding support for integers, which will allow for 64-bit
-** integers (which can be interpreted as signed or unsigned).
-**
-** LuaJIT supports 64-bit signed and unsigned boxed representations
-** through its "cdata" mechanism, but this is not portable to regular Lua.
-**
-** Hopefully Lua 5.3 will come soon enough that we can either use Lua 5.3
-** integer support or LuaJIT 64-bit cdata for users that need the entire
-** domain of [u]int64 values.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * require("lua") -- A Lua extension for upb.
+ *
+ * Exposes only the core library
+ * (sub-libraries are exposed in other extensions).
+ *
+ * 64-bit woes: Lua can only represent numbers of type lua_Number (which is
+ * double unless the user specifically overrides this). Doubles can represent
+ * the entire range of 64-bit integers, but lose precision once the integers are
+ * greater than 2^53.
+ *
+ * Lua 5.3 is adding support for integers, which will allow for 64-bit
+ * integers (which can be interpreted as signed or unsigned).
+ *
+ * LuaJIT supports 64-bit signed and unsigned boxed representations
+ * through its "cdata" mechanism, but this is not portable to regular Lua.
+ *
+ * Hopefully Lua 5.3 will come soon enough that we can either use Lua 5.3
+ * integer support or LuaJIT 64-bit cdata for users that need the entire
+ * domain of [u]int64 values.
+ */
#include "upb/bindings/lua/upb.h"
#include <float.h>
#include <math.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -33,42 +61,41 @@
/* Lua compatibility code *****************************************************/
/* Shims for upcoming Lua 5.3 functionality. */
-static bool lua_isinteger(lua_State *L, int argn) {
+static bool lua_isinteger(lua_State* L, int argn) {
LUPB_UNUSED(L);
LUPB_UNUSED(argn);
return false;
}
-
/* Utility functions **********************************************************/
-void lupb_checkstatus(lua_State *L, upb_status *s) {
- if (!upb_ok(s)) {
- lua_pushstring(L, upb_status_errmsg(s));
+void lupb_checkstatus(lua_State* L, upb_Status* s) {
+ if (!upb_Status_IsOk(s)) {
+ lua_pushstring(L, upb_Status_ErrorMessage(s));
lua_error(L);
}
}
/* Pushes a new userdata with the given metatable. */
-void *lupb_newuserdata(lua_State *L, size_t size, int n, const char *type) {
+void* lupb_newuserdata(lua_State* L, size_t size, int n, const char* type) {
#if LUA_VERSION_NUM >= 504
- void *ret = lua_newuserdatauv(L, size, n);
+ void* ret = lua_newuserdatauv(L, size, n);
#else
- void *ret = lua_newuserdata(L, size);
+ void* ret = lua_newuserdata(L, size);
lua_createtable(L, 0, n);
lua_setuservalue(L, -2);
#endif
/* Set metatable. */
luaL_getmetatable(L, type);
- assert(!lua_isnil(L, -1)); /* Should have been created by luaopen_upb. */
+ assert(!lua_isnil(L, -1)); /* Should have been created by luaopen_upb. */
lua_setmetatable(L, -2);
return ret;
}
#if LUA_VERSION_NUM < 504
-int lua_setiuservalue(lua_State *L, int index, int n) {
+int lua_setiuservalue(lua_State* L, int index, int n) {
lua_getuservalue(L, index);
lua_insert(L, -2);
lua_rawseti(L, -2, n);
@@ -76,7 +103,7 @@ int lua_setiuservalue(lua_State *L, int index, int n) {
return 1;
}
-int lua_getiuservalue(lua_State *L, int index, int n) {
+int lua_getiuservalue(lua_State* L, int index, int n) {
lua_getuservalue(L, index);
lua_rawgeti(L, -1, n);
lua_replace(L, -2);
@@ -86,7 +113,7 @@ int lua_getiuservalue(lua_State *L, int index, int n) {
/* We use this function as the __index metamethod when a type has both methods
* and an __index metamethod. */
-int lupb_indexmm(lua_State *L) {
+int lupb_indexmm(lua_State* L) {
/* Look up in __index table (which is a closure param). */
lua_pushvalue(L, 2);
lua_rawget(L, lua_upvalueindex(1));
@@ -102,8 +129,8 @@ int lupb_indexmm(lua_State *L) {
return 1;
}
-void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m,
- const luaL_Reg *mm) {
+void lupb_register_type(lua_State* L, const char* name, const luaL_Reg* m,
+ const luaL_Reg* mm) {
luaL_newmetatable(L, name);
if (mm) {
@@ -111,7 +138,7 @@ void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m,
}
if (m) {
- lua_createtable(L, 0, 0); /* __index table */
+ lua_createtable(L, 0, 0); /* __index table */
lupb_setfuncs(L, m);
/* Methods go in the mt's __index slot. If the user also specified an
@@ -125,7 +152,7 @@ void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m,
lua_setfield(L, -2, "__index");
}
- lua_pop(L, 1); /* The mt. */
+ lua_pop(L, 1); /* The mt. */
}
/* Scalar type mapping ********************************************************/
@@ -133,7 +160,7 @@ void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m,
/* Functions that convert scalar/primitive values (numbers, strings, bool)
* between Lua and C/upb. Handles type/range checking. */
-bool lupb_checkbool(lua_State *L, int narg) {
+bool lupb_checkbool(lua_State* L, int narg) {
if (!lua_isboolean(L, narg)) {
luaL_error(L, "must be true or false");
}
@@ -142,7 +169,7 @@ bool lupb_checkbool(lua_State *L, int narg) {
/* Unlike luaL_checkstring(), this does not allow implicit conversion to
* string. */
-const char *lupb_checkstring(lua_State *L, int narg, size_t *len) {
+const char* lupb_checkstring(lua_State* L, int narg, size_t* len) {
if (lua_type(L, narg) != LUA_TSTRING) {
luaL_error(L, "Expected string");
}
@@ -153,10 +180,9 @@ const char *lupb_checkstring(lua_State *L, int narg, size_t *len) {
/* Unlike luaL_checkinteger, these do not implicitly convert from string or
* round an existing double value. We allow floating-point input, but only if
* the actual value is integral. */
-#define INTCHECK(type, ctype) \
- ctype lupb_check##type(lua_State *L, int narg) { \
+#define INTCHECK(type, ctype, min, max) \
+ ctype lupb_check##type(lua_State* L, int narg) { \
double n; \
- ctype i; \
if (lua_isinteger(L, narg)) { \
return lua_tointeger(L, narg); \
} \
@@ -165,27 +191,35 @@ const char *lupb_checkstring(lua_State *L, int narg, size_t *len) {
luaL_checktype(L, narg, LUA_TNUMBER); \
n = lua_tonumber(L, narg); \
\
- i = (ctype)n; \
- if ((double)i != n) { \
- /* double -> ctype truncated or rounded. */ \
+ /* Check this double has no fractional part and remains in bounds. \
+ * Consider INT64_MIN and INT64_MAX: \
+ * 1. INT64_MIN -(2^63) is a power of 2, so this converts to a double. \
+ * 2. INT64_MAX (2^63 - 1) is not a power of 2, and conversion of \
+ * out-of-range integer values to a double can lead to undefined behavior. \
+ * On some compilers, this conversion can return 0, but it also can return \
+ * the max value. To deal with this, we can first divide by 2 to prevent \
+ * the overflow, multiply it back, and add 1 to find the true limit. */ \
+ double i; \
+ double max_value = (((double)max / 2) * 2) + 1; \
+ if ((modf(n, &i) != 0.0) || n < min || n >= max_value) { \
luaL_error(L, "number %f was not an integer or out of range for " #type, \
n); \
} \
- return i; \
+ return (ctype)n; \
} \
- void lupb_push##type(lua_State *L, ctype val) { \
+ void lupb_push##type(lua_State* L, ctype val) { \
/* TODO: push integer for Lua >= 5.3, 64-bit cdata for LuaJIT. */ \
/* This is lossy for some [u]int64 values, which isn't great, but */ \
/* crashing when we encounter these values seems worse. */ \
lua_pushnumber(L, val); \
}
-INTCHECK(int64, int64_t)
-INTCHECK(int32, int32_t)
-INTCHECK(uint64, uint64_t)
-INTCHECK(uint32, uint32_t)
+INTCHECK(int64, int64_t, INT64_MIN, INT64_MAX)
+INTCHECK(int32, int32_t, INT32_MIN, INT32_MAX)
+INTCHECK(uint64, uint64_t, 0, UINT64_MAX)
+INTCHECK(uint32, uint32_t, 0, UINT32_MAX)
-double lupb_checkdouble(lua_State *L, int narg) {
+double lupb_checkdouble(lua_State* L, int narg) {
/* If we were being really hard-nosed here, we'd check whether the input was
* an integer that has no precise double representation. But doubles aren't
* generally expected to be exact like integers are, and worse this could
@@ -193,29 +227,25 @@ double lupb_checkdouble(lua_State *L, int narg) {
* because the integer calculations happened to be exactly representable in
* double, while the next could crash because of subtly different input. */
- luaL_checktype(L, narg, LUA_TNUMBER); /* lua_tonumber() auto-converts. */
+ luaL_checktype(L, narg, LUA_TNUMBER); /* lua_tonumber() auto-converts. */
return lua_tonumber(L, narg);
}
-float lupb_checkfloat(lua_State *L, int narg) {
+float lupb_checkfloat(lua_State* L, int narg) {
/* We don't worry about checking whether the input can be exactly converted to
* float -- see above. */
- luaL_checktype(L, narg, LUA_TNUMBER); /* lua_tonumber() auto-converts. */
+ luaL_checktype(L, narg, LUA_TNUMBER); /* lua_tonumber() auto-converts. */
return lua_tonumber(L, narg);
}
-void lupb_pushdouble(lua_State *L, double d) {
- lua_pushnumber(L, d);
-}
+void lupb_pushdouble(lua_State* L, double d) { lua_pushnumber(L, d); }
-void lupb_pushfloat(lua_State *L, float d) {
- lua_pushnumber(L, d);
-}
+void lupb_pushfloat(lua_State* L, float d) { lua_pushnumber(L, d); }
/* Library entry point ********************************************************/
-int luaopen_lupb(lua_State *L) {
+int luaopen_lupb(lua_State* L) {
#if LUA_VERSION_NUM == 501
const struct luaL_Reg funcs[] = {{NULL, NULL}};
luaL_register(L, "upb_c", funcs);
@@ -224,5 +254,5 @@ int luaopen_lupb(lua_State *L) {
#endif
lupb_def_registertypes(L);
lupb_msg_registertypes(L);
- return 1; /* Return package table. */
+ return 1; /* Return package table. */
}
diff --git a/grpc/third_party/upb/upb/bindings/lua/upb.h b/grpc/third_party/upb/upb/bindings/lua/upb.h
index 455752fd..e0dc79eb 100644
--- a/grpc/third_party/upb/upb/bindings/lua/upb.h
+++ b/grpc/third_party/upb/upb/bindings/lua/upb.h
@@ -1,6 +1,33 @@
/*
-** Shared definitions for upb Lua modules.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Shared definitions for upb Lua modules.
+ */
#ifndef UPB_LUA_UPB_H_
#define UPB_LUA_UPB_H_
@@ -8,6 +35,7 @@
#include "lauxlib.h"
#include "upb/def.h"
#include "upb/msg.h"
+#include "upb/reflection.h"
/* Lua changes its API in incompatible ways in every minor release.
* This is some shim code to paper over the differences. */
@@ -25,60 +53,62 @@
/* Create a new userdata with the given type and |n| uservals, which are popped
* from the stack to initialize the userdata. */
-void *lupb_newuserdata(lua_State *L, size_t size, int n, const char *type);
+void* lupb_newuserdata(lua_State* L, size_t size, int n, const char* type);
#if LUA_VERSION_NUM < 504
/* Polyfills for this Lua 5.4 function. Pushes userval |n| for the userdata at
* |index|. */
-int lua_setiuservalue(lua_State *L, int index, int n);
-int lua_getiuservalue(lua_State *L, int index, int n);
+int lua_setiuservalue(lua_State* L, int index, int n);
+int lua_getiuservalue(lua_State* L, int index, int n);
#endif
/* Registers a type with the given name, methods, and metamethods. */
-void lupb_register_type(lua_State *L, const char *name, const luaL_Reg *m,
- const luaL_Reg *mm);
+void lupb_register_type(lua_State* L, const char* name, const luaL_Reg* m,
+ const luaL_Reg* mm);
-/* Checks the given upb_status and throws a Lua error if it is not ok. */
-void lupb_checkstatus(lua_State *L, upb_status *s);
+/* Checks the given upb_Status and throws a Lua error if it is not ok. */
+void lupb_checkstatus(lua_State* L, upb_Status* s);
-int luaopen_lupb(lua_State *L);
+int luaopen_lupb(lua_State* L);
/* C <-> Lua value conversions. ***********************************************/
/* Custom check/push functions. Unlike the Lua equivalents, they are pinned to
* specific C types (instead of lua_Number, etc), and do not allow any implicit
* conversion or data loss. */
-int64_t lupb_checkint64(lua_State *L, int narg);
-int32_t lupb_checkint32(lua_State *L, int narg);
-uint64_t lupb_checkuint64(lua_State *L, int narg);
-uint32_t lupb_checkuint32(lua_State *L, int narg);
-double lupb_checkdouble(lua_State *L, int narg);
-float lupb_checkfloat(lua_State *L, int narg);
-bool lupb_checkbool(lua_State *L, int narg);
-const char *lupb_checkstring(lua_State *L, int narg, size_t *len);
-const char *lupb_checkname(lua_State *L, int narg);
-
-void lupb_pushint64(lua_State *L, int64_t val);
-void lupb_pushint32(lua_State *L, int32_t val);
-void lupb_pushuint64(lua_State *L, uint64_t val);
-void lupb_pushuint32(lua_State *L, uint32_t val);
+int64_t lupb_checkint64(lua_State* L, int narg);
+int32_t lupb_checkint32(lua_State* L, int narg);
+uint64_t lupb_checkuint64(lua_State* L, int narg);
+uint32_t lupb_checkuint32(lua_State* L, int narg);
+double lupb_checkdouble(lua_State* L, int narg);
+float lupb_checkfloat(lua_State* L, int narg);
+bool lupb_checkbool(lua_State* L, int narg);
+const char* lupb_checkstring(lua_State* L, int narg, size_t* len);
+const char* lupb_checkname(lua_State* L, int narg);
+
+void lupb_pushint64(lua_State* L, int64_t val);
+void lupb_pushint32(lua_State* L, int32_t val);
+void lupb_pushuint64(lua_State* L, uint64_t val);
+void lupb_pushuint32(lua_State* L, uint32_t val);
/** From def.c. ***************************************************************/
-const upb_msgdef *lupb_msgdef_check(lua_State *L, int narg);
-const upb_enumdef *lupb_enumdef_check(lua_State *L, int narg);
-const upb_fielddef *lupb_fielddef_check(lua_State *L, int narg);
-upb_symtab *lupb_symtab_check(lua_State *L, int narg);
-void lupb_msgdef_pushsubmsgdef(lua_State *L, const upb_fielddef *f);
+const upb_MessageDef* lupb_MessageDef_check(lua_State* L, int narg);
+const upb_EnumDef* lupb_EnumDef_check(lua_State* L, int narg);
+const upb_FieldDef* lupb_FieldDef_check(lua_State* L, int narg);
+upb_DefPool* lupb_DefPool_check(lua_State* L, int narg);
+void lupb_MessageDef_pushsubmsgdef(lua_State* L, const upb_FieldDef* f);
-void lupb_def_registertypes(lua_State *L);
+void lupb_def_registertypes(lua_State* L);
/** From msg.c. ***************************************************************/
-int lupb_msgdef_call(lua_State *L);
-upb_arena *lupb_arena_pushnew(lua_State *L);
+void lupb_pushmsgval(lua_State* L, int container, upb_CType type,
+ upb_MessageValue val);
+int lupb_MessageDef_call(lua_State* L);
+upb_Arena* lupb_Arena_pushnew(lua_State* L);
-void lupb_msg_registertypes(lua_State *L);
+void lupb_msg_registertypes(lua_State* L);
#define lupb_assert(L, predicate) \
if (!(predicate)) \
@@ -87,10 +117,16 @@ void lupb_msg_registertypes(lua_State *L);
#define LUPB_UNUSED(var) (void)var
#if defined(__GNUC__) || defined(__clang__)
-#define LUPB_UNREACHABLE() do { assert(0); __builtin_unreachable(); } while(0)
+#define LUPB_UNREACHABLE() \
+ do { \
+ assert(0); \
+ __builtin_unreachable(); \
+ } while (0)
#else
-#define LUPB_UNREACHABLE() do { assert(0); } while(0)
+#define LUPB_UNREACHABLE() \
+ do { \
+ assert(0); \
+ } while (0)
#endif
-
-#endif /* UPB_LUA_UPB_H_ */
+#endif /* UPB_LUA_UPB_H_ */
diff --git a/grpc/third_party/upb/upb/bindings/lua/upb.lua b/grpc/third_party/upb/upb/bindings/lua/upb.lua
index ad6184a3..e2d4cd1b 100644
--- a/grpc/third_party/upb/upb/bindings/lua/upb.lua
+++ b/grpc/third_party/upb/upb/bindings/lua/upb.lua
@@ -1,3 +1,31 @@
+--[[--------------------------------------------------------------------------
+
+ Copyright (c) 2009-2021, Google LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Google LLC nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--]]--------------------------------------------------------------------------
local upb = require("lupb")
diff --git a/grpc/third_party/upb/upb/bindings/lua/upbc.cc b/grpc/third_party/upb/upb/bindings/lua/upbc.cc
index c3988f65..07939228 100644
--- a/grpc/third_party/upb/upb/bindings/lua/upbc.cc
+++ b/grpc/third_party/upb/upb/bindings/lua/upbc.cc
@@ -1,12 +1,37 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <google/protobuf/compiler/plugin.h>
+#include <google/protobuf/io/printer.h>
+
+#include "absl/strings/str_replace.h"
#include "absl/strings/string_view.h"
#include "absl/strings/substitute.h"
-#include "absl/strings/str_replace.h"
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
-#include <google/protobuf/compiler/plugin.h>
-#include <google/protobuf/io/printer.h>
namespace protoc = ::google::protobuf::compiler;
namespace protobuf = ::google::protobuf;
@@ -15,11 +40,10 @@ class LuaGenerator : public protoc::CodeGenerator {
bool Generate(const protobuf::FileDescriptor* file,
const std::string& parameter, protoc::GeneratorContext* context,
std::string* error) const override;
-
};
static std::string StripExtension(absl::string_view fname) {
- size_t lastdot = fname.find_last_of(".");
+ size_t lastdot = fname.find_last_of('.');
if (lastdot == std::string::npos) {
return std::string(fname);
}
@@ -71,11 +95,10 @@ static void PrintString(int max_cols, absl::string_view* str,
printer->Print("\'");
}
-bool LuaGenerator::Generate(
- const protobuf::FileDescriptor* file,
- const std::string& /* parameter */,
- protoc::GeneratorContext* context,
- std::string* /* error */) const {
+bool LuaGenerator::Generate(const protobuf::FileDescriptor* file,
+ const std::string& /* parameter */,
+ protoc::GeneratorContext* context,
+ std::string* /* error */) const {
std::string filename = Filename(file);
protobuf::io::ZeroCopyOutputStream* out = context->Open(filename);
protobuf::io::Printer printer(out, '$');
diff --git a/grpc/third_party/upb/upb/conformance_upb.c b/grpc/third_party/upb/upb/conformance_upb.c
new file mode 100644
index 00000000..b64c112c
--- /dev/null
+++ b/grpc/third_party/upb/upb/conformance_upb.c
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* This is a upb implementation of the upb conformance tests, see:
+ * https://github.com/google/protobuf/tree/master/conformance
+ */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "conformance/conformance.upb.h"
+#include "conformance/conformance.upbdefs.h"
+#include "src/google/protobuf/test_messages_proto2.upbdefs.h"
+#include "src/google/protobuf/test_messages_proto3.upbdefs.h"
+#include "upb/decode.h"
+#include "upb/encode.h"
+#include "upb/json_decode.h"
+#include "upb/json_encode.h"
+#include "upb/reflection.h"
+#include "upb/text_encode.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+int test_count = 0;
+bool verbose = false; /* Set to true to get req/resp printed on stderr. */
+
+bool CheckedRead(int fd, void* buf, size_t len) {
+ size_t ofs = 0;
+ while (len > 0) {
+ ssize_t bytes_read = read(fd, (char*)buf + ofs, len);
+
+ if (bytes_read == 0) return false;
+
+ if (bytes_read < 0) {
+ perror("reading from test runner");
+ exit(1);
+ }
+
+ len -= bytes_read;
+ ofs += bytes_read;
+ }
+
+ return true;
+}
+
+void CheckedWrite(int fd, const void* buf, size_t len) {
+ if ((size_t)write(fd, buf, len) != len) {
+ perror("writing to test runner");
+ exit(1);
+ }
+}
+
+typedef struct {
+ const conformance_ConformanceRequest* request;
+ conformance_ConformanceResponse* response;
+ upb_Arena* arena;
+ const upb_DefPool* symtab;
+} ctx;
+
+bool parse_proto(upb_Message* msg, const upb_MessageDef* m, const ctx* c) {
+ upb_StringView proto =
+ conformance_ConformanceRequest_protobuf_payload(c->request);
+ if (upb_Decode(proto.data, proto.size, msg, upb_MessageDef_MiniTable(m), NULL,
+ 0, c->arena) == kUpb_DecodeStatus_Ok) {
+ return true;
+ } else {
+ static const char msg[] = "Parse error";
+ conformance_ConformanceResponse_set_parse_error(
+ c->response, upb_StringView_FromString(msg));
+ return false;
+ }
+}
+
+void serialize_proto(const upb_Message* msg, const upb_MessageDef* m,
+ const ctx* c) {
+ size_t len;
+ char* data = upb_Encode(msg, upb_MessageDef_MiniTable(m), 0, c->arena, &len);
+ if (data) {
+ conformance_ConformanceResponse_set_protobuf_payload(
+ c->response, upb_StringView_FromDataAndSize(data, len));
+ } else {
+ static const char msg[] = "Error serializing.";
+ conformance_ConformanceResponse_set_serialize_error(
+ c->response, upb_StringView_FromString(msg));
+ }
+}
+
+void serialize_text(const upb_Message* msg, const upb_MessageDef* m,
+ const ctx* c) {
+ size_t len;
+ size_t len2;
+ int opts = 0;
+ char* data;
+
+ if (!conformance_ConformanceRequest_print_unknown_fields(c->request)) {
+ opts |= UPB_TXTENC_SKIPUNKNOWN;
+ }
+
+ len = upb_TextEncode(msg, m, c->symtab, opts, NULL, 0);
+ data = upb_Arena_Malloc(c->arena, len + 1);
+ len2 = upb_TextEncode(msg, m, c->symtab, opts, data, len + 1);
+ UPB_ASSERT(len == len2);
+ conformance_ConformanceResponse_set_text_payload(
+ c->response, upb_StringView_FromDataAndSize(data, len));
+}
+
+bool parse_json(upb_Message* msg, const upb_MessageDef* m, const ctx* c) {
+ upb_StringView json = conformance_ConformanceRequest_json_payload(c->request);
+ upb_Status status;
+ int opts = 0;
+
+ if (conformance_ConformanceRequest_test_category(c->request) ==
+ conformance_JSON_IGNORE_UNKNOWN_PARSING_TEST) {
+ opts |= upb_JsonDecode_IgnoreUnknown;
+ }
+
+ upb_Status_Clear(&status);
+ if (upb_JsonDecode(json.data, json.size, msg, m, c->symtab, opts, c->arena,
+ &status)) {
+ return true;
+ } else {
+ const char* inerr = upb_Status_ErrorMessage(&status);
+ size_t len = strlen(inerr);
+ char* err = upb_Arena_Malloc(c->arena, len + 1);
+ memcpy(err, inerr, strlen(inerr));
+ err[len] = '\0';
+ conformance_ConformanceResponse_set_parse_error(
+ c->response, upb_StringView_FromString(err));
+ return false;
+ }
+}
+
+void serialize_json(const upb_Message* msg, const upb_MessageDef* m,
+ const ctx* c) {
+ size_t len;
+ size_t len2;
+ int opts = 0;
+ char* data;
+ upb_Status status;
+
+ upb_Status_Clear(&status);
+ len = upb_JsonEncode(msg, m, c->symtab, opts, NULL, 0, &status);
+
+ if (len == (size_t)-1) {
+ const char* inerr = upb_Status_ErrorMessage(&status);
+ size_t len = strlen(inerr);
+ char* err = upb_Arena_Malloc(c->arena, len + 1);
+ memcpy(err, inerr, strlen(inerr));
+ err[len] = '\0';
+ conformance_ConformanceResponse_set_serialize_error(
+ c->response, upb_StringView_FromString(err));
+ return;
+ }
+
+ data = upb_Arena_Malloc(c->arena, len + 1);
+ len2 = upb_JsonEncode(msg, m, c->symtab, opts, data, len + 1, &status);
+ UPB_ASSERT(len == len2);
+ conformance_ConformanceResponse_set_json_payload(
+ c->response, upb_StringView_FromDataAndSize(data, len));
+}
+
+bool parse_input(upb_Message* msg, const upb_MessageDef* m, const ctx* c) {
+ switch (conformance_ConformanceRequest_payload_case(c->request)) {
+ case conformance_ConformanceRequest_payload_protobuf_payload:
+ return parse_proto(msg, m, c);
+ case conformance_ConformanceRequest_payload_json_payload:
+ return parse_json(msg, m, c);
+ case conformance_ConformanceRequest_payload_NOT_SET:
+ fprintf(stderr, "conformance_upb: Request didn't have payload.\n");
+ return false;
+ default: {
+ static const char msg[] = "Unsupported input format.";
+ conformance_ConformanceResponse_set_skipped(
+ c->response, upb_StringView_FromString(msg));
+ return false;
+ }
+ }
+}
+
+void write_output(const upb_Message* msg, const upb_MessageDef* m,
+ const ctx* c) {
+ switch (conformance_ConformanceRequest_requested_output_format(c->request)) {
+ case conformance_UNSPECIFIED:
+ fprintf(stderr, "conformance_upb: Unspecified output format.\n");
+ exit(1);
+ case conformance_PROTOBUF:
+ serialize_proto(msg, m, c);
+ break;
+ case conformance_TEXT_FORMAT:
+ serialize_text(msg, m, c);
+ break;
+ case conformance_JSON:
+ serialize_json(msg, m, c);
+ break;
+ default: {
+ static const char msg[] = "Unsupported output format.";
+ conformance_ConformanceResponse_set_skipped(
+ c->response, upb_StringView_FromString(msg));
+ break;
+ }
+ }
+}
+
+void DoTest(const ctx* c) {
+ upb_Message* msg;
+ upb_StringView name = conformance_ConformanceRequest_message_type(c->request);
+ const upb_MessageDef* m =
+ upb_DefPool_FindMessageByNameWithSize(c->symtab, name.data, name.size);
+#if 0
+ // Handy code for limiting conformance tests to a single input payload.
+ // This is a hack since the conformance runner doesn't give an easy way to
+ // specify what test should be run.
+ const char skip[] = "\343>\010\301\002\344>\230?\001\230?\002\230?\003";
+ upb_StringView skip_str = upb_StringView_FromDataAndSize(skip, sizeof(skip) - 1);
+ upb_StringView pb_payload =
+ conformance_ConformanceRequest_protobuf_payload(c->request);
+ if (!upb_StringView_IsEqual(pb_payload, skip_str)) m = NULL;
+#endif
+
+ if (!m) {
+ static const char msg[] = "Unknown message type.";
+ conformance_ConformanceResponse_set_skipped(c->response,
+ upb_StringView_FromString(msg));
+ return;
+ }
+
+ msg = upb_Message_New(m, c->arena);
+
+ if (parse_input(msg, m, c)) {
+ write_output(msg, m, c);
+ }
+}
+
+void debug_print(const char* label, const upb_Message* msg,
+ const upb_MessageDef* m, const ctx* c) {
+ char buf[512];
+ upb_TextEncode(msg, m, c->symtab, UPB_TXTENC_SINGLELINE, buf, sizeof(buf));
+ fprintf(stderr, "%s: %s\n", label, buf);
+}
+
+bool DoTestIo(upb_DefPool* symtab) {
+ upb_Status status;
+ char* input;
+ char* output;
+ uint32_t input_size;
+ size_t output_size;
+ ctx c;
+
+ if (!CheckedRead(STDIN_FILENO, &input_size, sizeof(uint32_t))) {
+ /* EOF. */
+ return false;
+ }
+
+ c.symtab = symtab;
+ c.arena = upb_Arena_New();
+ input = upb_Arena_Malloc(c.arena, input_size);
+
+ if (!CheckedRead(STDIN_FILENO, input, input_size)) {
+ fprintf(stderr, "conformance_upb: unexpected EOF on stdin.\n");
+ exit(1);
+ }
+
+ c.request = conformance_ConformanceRequest_parse(input, input_size, c.arena);
+ c.response = conformance_ConformanceResponse_new(c.arena);
+
+ if (c.request) {
+ DoTest(&c);
+ } else {
+ fprintf(stderr, "conformance_upb: parse of ConformanceRequest failed: %s\n",
+ upb_Status_ErrorMessage(&status));
+ }
+
+ output = conformance_ConformanceResponse_serialize(c.response, c.arena,
+ &output_size);
+
+ uint32_t network_out = (uint32_t)output_size;
+ CheckedWrite(STDOUT_FILENO, &network_out, sizeof(uint32_t));
+ CheckedWrite(STDOUT_FILENO, output, output_size);
+
+ test_count++;
+
+ if (verbose) {
+ debug_print("Request", c.request,
+ conformance_ConformanceRequest_getmsgdef(symtab), &c);
+ debug_print("Response", c.response,
+ conformance_ConformanceResponse_getmsgdef(symtab), &c);
+ fprintf(stderr, "\n");
+ }
+
+ upb_Arena_Free(c.arena);
+
+ return true;
+}
+
+int main(void) {
+ upb_DefPool* symtab = upb_DefPool_New();
+
+#ifdef REBUILD_MINITABLES
+ _upb_DefPool_LoadDefInitEx(
+ symtab, &src_google_protobuf_test_messages_proto2_proto_upbdefinit, true);
+ _upb_DefPool_LoadDefInitEx(
+ symtab, &src_google_protobuf_test_messages_proto3_proto_upbdefinit, true);
+#else
+ protobuf_test_messages_proto2_TestAllTypesProto2_getmsgdef(symtab);
+ protobuf_test_messages_proto3_TestAllTypesProto3_getmsgdef(symtab);
+#endif
+
+ while (1) {
+ if (!DoTestIo(symtab)) {
+ fprintf(stderr,
+ "conformance_upb: received EOF from test runner "
+ "after %d tests, exiting\n",
+ test_count);
+ upb_DefPool_Free(symtab);
+ return 0;
+ }
+ }
+}
diff --git a/grpc/third_party/upb/upb/conformance_upb_failures.txt b/grpc/third_party/upb/upb/conformance_upb_failures.txt
new file mode 100644
index 00000000..ee965b22
--- /dev/null
+++ b/grpc/third_party/upb/upb/conformance_upb_failures.txt
@@ -0,0 +1 @@
+# No conformance tests are failing, thus the failure list is empty.
diff --git a/grpc/third_party/upb/upb/decode.c b/grpc/third_party/upb/upb/decode.c
index a5f0666f..2d5bb495 100644
--- a/grpc/third_party/upb/upb/decode.c
+++ b/grpc/third_party/upb/upb/decode.c
@@ -1,37 +1,63 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/decode.h"
#include <setjmp.h>
#include <string.h>
-#include "upb/decode.int.h"
+#include "upb/decode_internal.h"
#include "upb/upb.h"
-#include "upb/upb.int.h"
+#include "upb/upb_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
/* Maps descriptor type -> elem_size_lg2. */
static const uint8_t desctype_to_elem_size_lg2[] = {
- -1, /* invalid descriptor type */
- 3, /* DOUBLE */
- 2, /* FLOAT */
- 3, /* INT64 */
- 3, /* UINT64 */
- 2, /* INT32 */
- 3, /* FIXED64 */
- 2, /* FIXED32 */
- 0, /* BOOL */
- UPB_SIZE(3, 4), /* STRING */
- UPB_SIZE(2, 3), /* GROUP */
- UPB_SIZE(2, 3), /* MESSAGE */
- UPB_SIZE(3, 4), /* BYTES */
- 2, /* UINT32 */
- 2, /* ENUM */
- 2, /* SFIXED32 */
- 3, /* SFIXED64 */
- 2, /* SINT32 */
- 3, /* SINT64 */
+ -1, /* invalid descriptor type */
+ 3, /* DOUBLE */
+ 2, /* FLOAT */
+ 3, /* INT64 */
+ 3, /* UINT64 */
+ 2, /* INT32 */
+ 3, /* FIXED64 */
+ 2, /* FIXED32 */
+ 0, /* BOOL */
+ UPB_SIZE(3, 4), /* STRING */
+ UPB_SIZE(2, 3), /* GROUP */
+ UPB_SIZE(2, 3), /* MESSAGE */
+ UPB_SIZE(3, 4), /* BYTES */
+ 2, /* UINT32 */
+ 2, /* ENUM */
+ 2, /* SFIXED32 */
+ 3, /* SFIXED64 */
+ 2, /* SINT32 */
+ 3, /* SINT64 */
};
/* Maps descriptor type -> upb map size. */
@@ -46,8 +72,8 @@ static const uint8_t desctype_to_mapsize[] = {
4, /* FIXED32 */
1, /* BOOL */
UPB_MAPTYPE_STRING, /* STRING */
- sizeof(void *), /* GROUP */
- sizeof(void *), /* MESSAGE */
+ sizeof(void*), /* GROUP */
+ sizeof(void*), /* MESSAGE */
UPB_MAPTYPE_STRING, /* BYTES */
4, /* UINT32 */
4, /* ENUM */
@@ -57,66 +83,80 @@ static const uint8_t desctype_to_mapsize[] = {
8, /* SINT64 */
};
-static const unsigned fixed32_ok = (1 << UPB_DTYPE_FLOAT) |
- (1 << UPB_DTYPE_FIXED32) |
- (1 << UPB_DTYPE_SFIXED32);
+static const unsigned FIXED32_OK_MASK = (1 << kUpb_FieldType_Float) |
+ (1 << kUpb_FieldType_Fixed32) |
+ (1 << kUpb_FieldType_SFixed32);
-static const unsigned fixed64_ok = (1 << UPB_DTYPE_DOUBLE) |
- (1 << UPB_DTYPE_FIXED64) |
- (1 << UPB_DTYPE_SFIXED64);
+static const unsigned FIXED64_OK_MASK = (1 << kUpb_FieldType_Double) |
+ (1 << kUpb_FieldType_Fixed64) |
+ (1 << kUpb_FieldType_SFixed64);
+
+/* Three fake field types for MessageSet. */
+#define TYPE_MSGSET_ITEM 19
+#define TYPE_MSGSET_TYPE_ID 20
+#define TYPE_COUNT 20
/* Op: an action to be performed for a wire-type/field-type combination. */
-#define OP_SCALAR_LG2(n) (n) /* n in [0, 2, 3] => op in [0, 2, 3] */
+#define OP_UNKNOWN -1 /* Unknown field. */
+#define OP_MSGSET_ITEM -2
+#define OP_MSGSET_TYPEID -3
+#define OP_SCALAR_LG2(n) (n) /* n in [0, 2, 3] => op in [0, 2, 3] */
+#define OP_ENUM 1
#define OP_STRING 4
#define OP_BYTES 5
#define OP_SUBMSG 6
-/* Ops above are scalar-only. Repeated fields can use any op. */
-#define OP_FIXPCK_LG2(n) (n + 5) /* n in [2, 3] => op in [7, 8] */
-#define OP_VARPCK_LG2(n) (n + 9) /* n in [0, 2, 3] => op in [9, 11, 12] */
-
-static const int8_t varint_ops[19] = {
- -1, /* field not found */
- -1, /* DOUBLE */
- -1, /* FLOAT */
+/* Scalar fields use only ops above. Repeated fields can use any op. */
+#define OP_FIXPCK_LG2(n) (n + 5) /* n in [2, 3] => op in [7, 8] */
+#define OP_VARPCK_LG2(n) (n + 9) /* n in [0, 2, 3] => op in [9, 11, 12] */
+#define OP_PACKED_ENUM 13
+
+static const int8_t varint_ops[] = {
+ OP_UNKNOWN, /* field not found */
+ OP_UNKNOWN, /* DOUBLE */
+ OP_UNKNOWN, /* FLOAT */
OP_SCALAR_LG2(3), /* INT64 */
OP_SCALAR_LG2(3), /* UINT64 */
OP_SCALAR_LG2(2), /* INT32 */
- -1, /* FIXED64 */
- -1, /* FIXED32 */
+ OP_UNKNOWN, /* FIXED64 */
+ OP_UNKNOWN, /* FIXED32 */
OP_SCALAR_LG2(0), /* BOOL */
- -1, /* STRING */
- -1, /* GROUP */
- -1, /* MESSAGE */
- -1, /* BYTES */
+ OP_UNKNOWN, /* STRING */
+ OP_UNKNOWN, /* GROUP */
+ OP_UNKNOWN, /* MESSAGE */
+ OP_UNKNOWN, /* BYTES */
OP_SCALAR_LG2(2), /* UINT32 */
- OP_SCALAR_LG2(2), /* ENUM */
- -1, /* SFIXED32 */
- -1, /* SFIXED64 */
+ OP_ENUM, /* ENUM */
+ OP_UNKNOWN, /* SFIXED32 */
+ OP_UNKNOWN, /* SFIXED64 */
OP_SCALAR_LG2(2), /* SINT32 */
OP_SCALAR_LG2(3), /* SINT64 */
+ OP_UNKNOWN, /* MSGSET_ITEM */
+ OP_MSGSET_TYPEID, /* MSGSET TYPEID */
};
-static const int8_t delim_ops[37] = {
+static const int8_t delim_ops[] = {
/* For non-repeated field type. */
- -1, /* field not found */
- -1, /* DOUBLE */
- -1, /* FLOAT */
- -1, /* INT64 */
- -1, /* UINT64 */
- -1, /* INT32 */
- -1, /* FIXED64 */
- -1, /* FIXED32 */
- -1, /* BOOL */
- OP_STRING, /* STRING */
- -1, /* GROUP */
- OP_SUBMSG, /* MESSAGE */
- OP_BYTES, /* BYTES */
- -1, /* UINT32 */
- -1, /* ENUM */
- -1, /* SFIXED32 */
- -1, /* SFIXED64 */
- -1, /* SINT32 */
- -1, /* SINT64 */
+ OP_UNKNOWN, /* field not found */
+ OP_UNKNOWN, /* DOUBLE */
+ OP_UNKNOWN, /* FLOAT */
+ OP_UNKNOWN, /* INT64 */
+ OP_UNKNOWN, /* UINT64 */
+ OP_UNKNOWN, /* INT32 */
+ OP_UNKNOWN, /* FIXED64 */
+ OP_UNKNOWN, /* FIXED32 */
+ OP_UNKNOWN, /* BOOL */
+ OP_STRING, /* STRING */
+ OP_UNKNOWN, /* GROUP */
+ OP_SUBMSG, /* MESSAGE */
+ OP_BYTES, /* BYTES */
+ OP_UNKNOWN, /* UINT32 */
+ OP_UNKNOWN, /* ENUM */
+ OP_UNKNOWN, /* SFIXED32 */
+ OP_UNKNOWN, /* SFIXED64 */
+ OP_UNKNOWN, /* SINT32 */
+ OP_UNKNOWN, /* SINT64 */
+ OP_UNKNOWN, /* MSGSET_ITEM */
+ OP_UNKNOWN, /* MSGSET TYPEID */
/* For repeated field type. */
OP_FIXPCK_LG2(3), /* REPEATED DOUBLE */
OP_FIXPCK_LG2(2), /* REPEATED FLOAT */
@@ -131,11 +171,12 @@ static const int8_t delim_ops[37] = {
OP_SUBMSG, /* REPEATED MESSAGE */
OP_BYTES, /* REPEATED BYTES */
OP_VARPCK_LG2(2), /* REPEATED UINT32 */
- OP_VARPCK_LG2(2), /* REPEATED ENUM */
+ OP_PACKED_ENUM, /* REPEATED ENUM */
OP_FIXPCK_LG2(2), /* REPEATED SFIXED32 */
OP_FIXPCK_LG2(3), /* REPEATED SFIXED64 */
OP_VARPCK_LG2(2), /* REPEATED SINT32 */
OP_VARPCK_LG2(3), /* REPEATED SINT64 */
+ /* Omitting MSGSET_*, because we never emit a repeated msgset type */
};
typedef union {
@@ -145,49 +186,39 @@ typedef union {
uint32_t size;
} wireval;
-static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout);
+static const char* decode_msg(upb_Decoder* d, const char* ptr, upb_Message* msg,
+ const upb_MiniTable* layout);
-UPB_NORETURN static void decode_err(upb_decstate *d) { UPB_LONGJMP(d->err, 1); }
+UPB_NORETURN static void* decode_err(upb_Decoder* d, upb_DecodeStatus status) {
+ assert(status != kUpb_DecodeStatus_Ok);
+ UPB_LONGJMP(d->err, status);
+}
-const char *fastdecode_err(upb_decstate *d) {
- longjmp(d->err, 1);
+const char* fastdecode_err(upb_Decoder* d, int status) {
+ assert(status != kUpb_DecodeStatus_Ok);
+ UPB_LONGJMP(d->err, status);
return NULL;
}
-
-const uint8_t upb_utf8_offsets[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 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, 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,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static void decode_verifyutf8(upb_decstate *d, const char *buf, int len) {
- if (!decode_verifyutf8_inl(buf, len)) decode_err(d);
+static void decode_verifyutf8(upb_Decoder* d, const char* buf, int len) {
+ if (!decode_verifyutf8_inl(buf, len))
+ decode_err(d, kUpb_DecodeStatus_BadUtf8);
}
-static bool decode_reserve(upb_decstate *d, upb_array *arr, size_t elem) {
+static bool decode_reserve(upb_Decoder* d, upb_Array* arr, size_t elem) {
bool need_realloc = arr->size - arr->len < elem;
if (need_realloc && !_upb_array_realloc(arr, arr->len + elem, &d->arena)) {
- decode_err(d);
+ decode_err(d, kUpb_DecodeStatus_OutOfMemory);
}
return need_realloc;
}
typedef struct {
- const char *ptr;
+ const char* ptr;
uint64_t val;
} decode_vret;
UPB_NOINLINE
-static decode_vret decode_longvarint64(const char *ptr, uint64_t val) {
+static decode_vret decode_longvarint64(const char* ptr, uint64_t val) {
decode_vret ret = {NULL, 0};
uint64_t byte;
int i;
@@ -204,101 +235,92 @@ static decode_vret decode_longvarint64(const char *ptr, uint64_t val) {
}
UPB_FORCEINLINE
-static const char *decode_varint64(upb_decstate *d, const char *ptr,
- uint64_t *val) {
+static const char* decode_varint64(upb_Decoder* d, const char* ptr,
+ uint64_t* val) {
uint64_t byte = (uint8_t)*ptr;
if (UPB_LIKELY((byte & 0x80) == 0)) {
*val = byte;
return ptr + 1;
} else {
decode_vret res = decode_longvarint64(ptr, byte);
- if (!res.ptr) decode_err(d);
+ if (!res.ptr) return decode_err(d, kUpb_DecodeStatus_Malformed);
*val = res.val;
return res.ptr;
}
}
UPB_FORCEINLINE
-static const char *decode_tag(upb_decstate *d, const char *ptr,
- uint32_t *val) {
+static const char* decode_tag(upb_Decoder* d, const char* ptr, uint32_t* val) {
uint64_t byte = (uint8_t)*ptr;
if (UPB_LIKELY((byte & 0x80) == 0)) {
*val = byte;
return ptr + 1;
} else {
- const char *start = ptr;
+ const char* start = ptr;
decode_vret res = decode_longvarint64(ptr, byte);
- ptr = res.ptr;
+ if (!res.ptr || res.ptr - start > 5 || res.val > UINT32_MAX) {
+ return decode_err(d, kUpb_DecodeStatus_Malformed);
+ }
*val = res.val;
- if (!ptr || *val > UINT32_MAX || ptr - start > 5) decode_err(d);
- return ptr;
+ return res.ptr;
+ }
+}
+
+static void decode_munge_int32(wireval* val) {
+ if (!_upb_IsLittleEndian()) {
+ /* The next stage will memcpy(dst, &val, 4) */
+ val->uint32_val = val->uint64_val;
}
}
-static void decode_munge(int type, wireval *val) {
+static void decode_munge(int type, wireval* val) {
switch (type) {
- case UPB_DESCRIPTOR_TYPE_BOOL:
+ case kUpb_FieldType_Bool:
val->bool_val = val->uint64_val != 0;
break;
- case UPB_DESCRIPTOR_TYPE_SINT32: {
- uint32_t n = val->uint32_val;
+ case kUpb_FieldType_SInt32: {
+ uint32_t n = val->uint64_val;
val->uint32_val = (n >> 1) ^ -(int32_t)(n & 1);
break;
}
- case UPB_DESCRIPTOR_TYPE_SINT64: {
+ case kUpb_FieldType_SInt64: {
uint64_t n = val->uint64_val;
val->uint64_val = (n >> 1) ^ -(int64_t)(n & 1);
break;
}
- case UPB_DESCRIPTOR_TYPE_INT32:
- case UPB_DESCRIPTOR_TYPE_UINT32:
- if (!_upb_isle()) {
- /* The next stage will memcpy(dst, &val, 4) */
- val->uint32_val = val->uint64_val;
- }
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_UInt32:
+ case kUpb_FieldType_Enum:
+ decode_munge_int32(val);
break;
}
}
-static const upb_msglayout_field *upb_find_field(const upb_msglayout *l,
- uint32_t field_number) {
- static upb_msglayout_field none = {0, 0, 0, 0, 0, 0};
-
- /* Lots of optimization opportunities here. */
- int i;
- if (l == NULL) return &none;
- for (i = 0; i < l->field_count; i++) {
- if (l->fields[i].number == field_number) {
- return &l->fields[i];
- }
- }
-
- return &none; /* Unknown field. */
-}
-
-static upb_msg *decode_newsubmsg(upb_decstate *d, const upb_msglayout *layout,
- const upb_msglayout_field *field) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
- return _upb_msg_new_inl(subl, &d->arena);
+static upb_Message* decode_newsubmsg(upb_Decoder* d,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field) {
+ const upb_MiniTable* subl = subs[field->submsg_index].submsg;
+ return _upb_Message_New_inl(subl, &d->arena);
}
UPB_NOINLINE
-const char *decode_isdonefallback(upb_decstate *d, const char *ptr,
+const char* decode_isdonefallback(upb_Decoder* d, const char* ptr,
int overrun) {
- ptr = decode_isdonefallback_inl(d, ptr, overrun);
+ int status;
+ ptr = decode_isdonefallback_inl(d, ptr, overrun, &status);
if (ptr == NULL) {
- decode_err(d);
+ return decode_err(d, status);
}
return ptr;
}
-static const char *decode_readstr(upb_decstate *d, const char *ptr, int size,
- upb_strview *str) {
- if (d->alias) {
+static const char* decode_readstr(upb_Decoder* d, const char* ptr, int size,
+ upb_StringView* str) {
+ if (d->options & kUpb_DecodeOption_AliasString) {
str->data = ptr;
} else {
- char *data = upb_arena_malloc(&d->arena, size);
- if (!data) decode_err(d);
+ char* data = upb_Arena_Malloc(&d->arena, size);
+ if (!data) return decode_err(d, kUpb_DecodeStatus_OutOfMemory);
memcpy(data, ptr, size);
str->data = data;
}
@@ -307,58 +329,226 @@ static const char *decode_readstr(upb_decstate *d, const char *ptr, int size,
}
UPB_FORCEINLINE
-static const char *decode_tosubmsg(upb_decstate *d, const char *ptr,
- upb_msg *submsg, const upb_msglayout *layout,
- const upb_msglayout_field *field, int size) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
+static const char* decode_tosubmsg2(upb_Decoder* d, const char* ptr,
+ upb_Message* submsg,
+ const upb_MiniTable* subl, int size) {
int saved_delta = decode_pushlimit(d, ptr, size);
- if (--d->depth < 0) decode_err(d);
- if (!decode_isdone(d, &ptr)) {
- ptr = decode_msg(d, ptr, submsg, subl);
- }
- if (d->end_group != DECODE_NOGROUP) decode_err(d);
+ if (--d->depth < 0) return decode_err(d, kUpb_DecodeStatus_MaxDepthExceeded);
+ ptr = decode_msg(d, ptr, submsg, subl);
+ if (d->end_group != DECODE_NOGROUP)
+ return decode_err(d, kUpb_DecodeStatus_Malformed);
decode_poplimit(d, ptr, saved_delta);
d->depth++;
return ptr;
}
UPB_FORCEINLINE
-static const char *decode_group(upb_decstate *d, const char *ptr,
- upb_msg *submsg, const upb_msglayout *subl,
+static const char* decode_tosubmsg(upb_Decoder* d, const char* ptr,
+ upb_Message* submsg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field, int size) {
+ return decode_tosubmsg2(d, ptr, submsg, subs[field->submsg_index].submsg,
+ size);
+}
+
+UPB_FORCEINLINE
+static const char* decode_group(upb_Decoder* d, const char* ptr,
+ upb_Message* submsg, const upb_MiniTable* subl,
uint32_t number) {
- if (--d->depth < 0) decode_err(d);
+ if (--d->depth < 0) return decode_err(d, kUpb_DecodeStatus_MaxDepthExceeded);
if (decode_isdone(d, &ptr)) {
- decode_err(d);
+ return decode_err(d, kUpb_DecodeStatus_Malformed);
}
ptr = decode_msg(d, ptr, submsg, subl);
- if (d->end_group != number) decode_err(d);
+ if (d->end_group != number) return decode_err(d, kUpb_DecodeStatus_Malformed);
d->end_group = DECODE_NOGROUP;
d->depth++;
return ptr;
}
UPB_FORCEINLINE
-static const char *decode_togroup(upb_decstate *d, const char *ptr,
- upb_msg *submsg, const upb_msglayout *layout,
- const upb_msglayout_field *field) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
+static const char* decode_togroup(upb_Decoder* d, const char* ptr,
+ upb_Message* submsg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field) {
+ const upb_MiniTable* subl = subs[field->submsg_index].submsg;
return decode_group(d, ptr, submsg, subl, field->number);
}
-static const char *decode_toarray(upb_decstate *d, const char *ptr,
- upb_msg *msg, const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val,
- int op) {
- upb_array **arrp = UPB_PTR_AT(msg, field->offset, void);
- upb_array *arr = *arrp;
- void *mem;
+static char* encode_varint32(uint32_t val, char* ptr) {
+ do {
+ uint8_t byte = val & 0x7fU;
+ val >>= 7;
+ if (val) byte |= 0x80U;
+ *(ptr++) = byte;
+ } while (val);
+ return ptr;
+}
+
+static void upb_Decode_AddUnknownVarints(upb_Decoder* d, upb_Message* msg,
+ uint32_t val1, uint32_t val2) {
+ char buf[20];
+ char* end = buf;
+ end = encode_varint32(val1, end);
+ end = encode_varint32(val2, end);
+
+ if (!_upb_Message_AddUnknown(msg, buf, end - buf, &d->arena)) {
+ decode_err(d, kUpb_DecodeStatus_OutOfMemory);
+ }
+}
+
+UPB_NOINLINE
+static bool decode_checkenum_slow(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, const upb_MiniTable_Enum* e,
+ const upb_MiniTable_Field* field,
+ uint32_t v) {
+ // OPT: binary search long lists?
+ int n = e->value_count;
+ for (int i = 0; i < n; i++) {
+ if ((uint32_t)e->values[i] == v) return true;
+ }
+
+ // Unrecognized enum goes into unknown fields.
+ // For packed fields the tag could be arbitrarily far in the past, so we
+ // just re-encode the tag and value here.
+ uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Varint;
+ upb_Decode_AddUnknownVarints(d, msg, tag, v);
+ return false;
+}
+
+UPB_FORCEINLINE
+static bool decode_checkenum(upb_Decoder* d, const char* ptr, upb_Message* msg,
+ const upb_MiniTable_Enum* e,
+ const upb_MiniTable_Field* field, wireval* val) {
+ uint32_t v = val->uint32_val;
+
+ if (UPB_LIKELY(v < 64) && UPB_LIKELY(((1ULL << v) & e->mask))) return true;
+
+ return decode_checkenum_slow(d, ptr, msg, e, field, v);
+}
+
+UPB_NOINLINE
+static const char* decode_enum_toarray(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, upb_Array* arr,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field,
+ wireval* val) {
+ const upb_MiniTable_Enum* e = subs[field->submsg_index].subenum;
+ if (!decode_checkenum(d, ptr, msg, e, field, val)) return ptr;
+ void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void);
+ arr->len++;
+ memcpy(mem, val, 4);
+ return ptr;
+}
+
+UPB_FORCEINLINE
+static const char* decode_fixed_packed(upb_Decoder* d, const char* ptr,
+ upb_Array* arr, wireval* val,
+ const upb_MiniTable_Field* field,
+ int lg2) {
+ int mask = (1 << lg2) - 1;
+ size_t count = val->size >> lg2;
+ if ((val->size & mask) != 0) {
+ // Length isn't a round multiple of elem size.
+ return decode_err(d, kUpb_DecodeStatus_Malformed);
+ }
+ decode_reserve(d, arr, count);
+ void* mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
+ arr->len += count;
+ // Note: if/when the decoder supports multi-buffer input, we will need to
+ // handle buffer seams here.
+ if (_upb_IsLittleEndian()) {
+ memcpy(mem, ptr, val->size);
+ ptr += val->size;
+ } else {
+ const char* end = ptr + val->size;
+ char* dst = mem;
+ while (ptr < end) {
+ if (lg2 == 2) {
+ uint32_t val;
+ memcpy(&val, ptr, sizeof(val));
+ val = _upb_BigEndian_Swap32(val);
+ memcpy(dst, &val, sizeof(val));
+ } else {
+ UPB_ASSERT(lg2 == 3);
+ uint64_t val;
+ memcpy(&val, ptr, sizeof(val));
+ val = _upb_BigEndian_Swap64(val);
+ memcpy(dst, &val, sizeof(val));
+ }
+ ptr += 1 << lg2;
+ dst += 1 << lg2;
+ }
+ }
+
+ return ptr;
+}
+
+UPB_FORCEINLINE
+static const char* decode_varint_packed(upb_Decoder* d, const char* ptr,
+ upb_Array* arr, wireval* val,
+ const upb_MiniTable_Field* field,
+ int lg2) {
+ int scale = 1 << lg2;
+ int saved_limit = decode_pushlimit(d, ptr, val->size);
+ char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
+ while (!decode_isdone(d, &ptr)) {
+ wireval elem;
+ ptr = decode_varint64(d, ptr, &elem.uint64_val);
+ decode_munge(field->descriptortype, &elem);
+ if (decode_reserve(d, arr, 1)) {
+ out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
+ }
+ arr->len++;
+ memcpy(out, &elem, scale);
+ out += scale;
+ }
+ decode_poplimit(d, ptr, saved_limit);
+ return ptr;
+}
+
+UPB_NOINLINE
+static const char* decode_enum_packed(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, upb_Array* arr,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field,
+ wireval* val) {
+ const upb_MiniTable_Enum* e = subs[field->submsg_index].subenum;
+ int saved_limit = decode_pushlimit(d, ptr, val->size);
+ char* out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void);
+ while (!decode_isdone(d, &ptr)) {
+ wireval elem;
+ ptr = decode_varint64(d, ptr, &elem.uint64_val);
+ decode_munge_int32(&elem);
+ if (!decode_checkenum(d, ptr, msg, e, field, &elem)) {
+ continue;
+ }
+ if (decode_reserve(d, arr, 1)) {
+ out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len * 4, void);
+ }
+ arr->len++;
+ memcpy(out, &elem, 4);
+ out += 4;
+ }
+ decode_poplimit(d, ptr, saved_limit);
+ return ptr;
+}
+
+static const char* decode_toarray(upb_Decoder* d, const char* ptr,
+ upb_Message* msg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field,
+ wireval* val, int op) {
+ upb_Array** arrp = UPB_PTR_AT(msg, field->offset, void);
+ upb_Array* arr = *arrp;
+ void* mem;
if (arr) {
decode_reserve(d, arr, 1);
} else {
size_t lg2 = desctype_to_elem_size_lg2[field->descriptortype];
- arr = _upb_array_new(&d->arena, 4, lg2);
- if (!arr) decode_err(d);
+ arr = _upb_Array_New(&d->arena, 4, lg2);
+ if (!arr) return decode_err(d, kUpb_DecodeStatus_OutOfMemory);
*arrp = arr;
}
@@ -369,154 +559,150 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
/* Append scalar value. */
mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << op, void);
arr->len++;
- memcpy(mem, &val, 1 << op);
+ memcpy(mem, val, 1 << op);
return ptr;
case OP_STRING:
- decode_verifyutf8(d, ptr, val.size);
+ decode_verifyutf8(d, ptr, val->size);
/* Fallthrough. */
case OP_BYTES: {
/* Append bytes. */
- upb_strview *str = (upb_strview*)_upb_array_ptr(arr) + arr->len;
+ upb_StringView* str = (upb_StringView*)_upb_array_ptr(arr) + arr->len;
arr->len++;
- return decode_readstr(d, ptr, val.size, str);
+ return decode_readstr(d, ptr, val->size, str);
}
case OP_SUBMSG: {
/* Append submessage / group. */
- upb_msg *submsg = decode_newsubmsg(d, layout, field);
- *UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(void *), upb_msg *) =
+ upb_Message* submsg = decode_newsubmsg(d, subs, field);
+ *UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(void*), upb_Message*) =
submsg;
arr->len++;
- if (UPB_UNLIKELY(field->descriptortype == UPB_DTYPE_GROUP)) {
- return decode_togroup(d, ptr, submsg, layout, field);
+ if (UPB_UNLIKELY(field->descriptortype == kUpb_FieldType_Group)) {
+ return decode_togroup(d, ptr, submsg, subs, field);
} else {
- return decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
+ return decode_tosubmsg(d, ptr, submsg, subs, field, val->size);
}
}
case OP_FIXPCK_LG2(2):
- case OP_FIXPCK_LG2(3): {
- /* Fixed packed. */
- int lg2 = op - OP_FIXPCK_LG2(0);
- int mask = (1 << lg2) - 1;
- size_t count = val.size >> lg2;
- if ((val.size & mask) != 0) {
- decode_err(d); /* Length isn't a round multiple of elem size. */
- }
- decode_reserve(d, arr, count);
- mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
- arr->len += count;
- memcpy(mem, ptr, val.size); /* XXX: ptr boundary. */
- return ptr + val.size;
- }
+ case OP_FIXPCK_LG2(3):
+ return decode_fixed_packed(d, ptr, arr, val, field,
+ op - OP_FIXPCK_LG2(0));
case OP_VARPCK_LG2(0):
case OP_VARPCK_LG2(2):
- case OP_VARPCK_LG2(3): {
- /* Varint packed. */
- int lg2 = op - OP_VARPCK_LG2(0);
- int scale = 1 << lg2;
- int saved_limit = decode_pushlimit(d, ptr, val.size);
- char *out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
- while (!decode_isdone(d, &ptr)) {
- wireval elem;
- ptr = decode_varint64(d, ptr, &elem.uint64_val);
- decode_munge(field->descriptortype, &elem);
- if (decode_reserve(d, arr, 1)) {
- out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
- }
- arr->len++;
- memcpy(out, &elem, scale);
- out += scale;
- }
- decode_poplimit(d, ptr, saved_limit);
- return ptr;
- }
+ case OP_VARPCK_LG2(3):
+ return decode_varint_packed(d, ptr, arr, val, field,
+ op - OP_VARPCK_LG2(0));
+ case OP_ENUM:
+ return decode_enum_toarray(d, ptr, msg, arr, subs, field, val);
+ case OP_PACKED_ENUM:
+ return decode_enum_packed(d, ptr, msg, arr, subs, field, val);
default:
UPB_UNREACHABLE();
}
}
-static const char *decode_tomap(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val) {
- upb_map **map_p = UPB_PTR_AT(msg, field->offset, upb_map *);
- upb_map *map = *map_p;
- upb_map_entry ent;
- const upb_msglayout *entry = layout->submsgs[field->submsg_index];
+static const char* decode_tomap(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field,
+ wireval* val) {
+ upb_Map** map_p = UPB_PTR_AT(msg, field->offset, upb_Map*);
+ upb_Map* map = *map_p;
+ upb_MapEntry ent;
+ const upb_MiniTable* entry = subs[field->submsg_index].submsg;
if (!map) {
/* Lazily create map. */
- const upb_msglayout *entry = layout->submsgs[field->submsg_index];
- const upb_msglayout_field *key_field = &entry->fields[0];
- const upb_msglayout_field *val_field = &entry->fields[1];
+ const upb_MiniTable_Field* key_field = &entry->fields[0];
+ const upb_MiniTable_Field* val_field = &entry->fields[1];
char key_size = desctype_to_mapsize[key_field->descriptortype];
char val_size = desctype_to_mapsize[val_field->descriptortype];
UPB_ASSERT(key_field->offset == 0);
- UPB_ASSERT(val_field->offset == sizeof(upb_strview));
- map = _upb_map_new(&d->arena, key_size, val_size);
+ UPB_ASSERT(val_field->offset == sizeof(upb_StringView));
+ map = _upb_Map_New(&d->arena, key_size, val_size);
*map_p = map;
}
/* Parse map entry. */
memset(&ent, 0, sizeof(ent));
- if (entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
- entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_GROUP) {
+ if (entry->fields[1].descriptortype == kUpb_FieldType_Message ||
+ entry->fields[1].descriptortype == kUpb_FieldType_Group) {
/* Create proactively to handle the case where it doesn't appear. */
- ent.v.val = upb_value_ptr(_upb_msg_new(entry->submsgs[0], &d->arena));
+ ent.v.val =
+ upb_value_ptr(_upb_Message_New(entry->subs[0].submsg, &d->arena));
}
- ptr = decode_tosubmsg(d, ptr, &ent.k, layout, field, val.size);
- _upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena);
+ const char* start = ptr;
+ ptr = decode_tosubmsg(d, ptr, &ent.k, subs, field, val->size);
+ // check if ent had any unknown fields
+ size_t size;
+ upb_Message_GetUnknown(&ent.k, &size);
+ if (size != 0) {
+ uint32_t tag = ((uint32_t)field->number << 3) | kUpb_WireType_Delimited;
+ upb_Decode_AddUnknownVarints(d, msg, tag, (uint32_t)(ptr - start));
+ if (!_upb_Message_AddUnknown(msg, start, ptr - start, &d->arena)) {
+ decode_err(d, kUpb_DecodeStatus_OutOfMemory);
+ }
+ } else {
+ _upb_Map_Set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena);
+ }
return ptr;
}
-static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val,
+static const char* decode_tomsg(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field, wireval* val,
int op) {
- void *mem = UPB_PTR_AT(msg, field->offset, void);
+ void* mem = UPB_PTR_AT(msg, field->offset, void);
int type = field->descriptortype;
+ if (UPB_UNLIKELY(op == OP_ENUM) &&
+ !decode_checkenum(d, ptr, msg, subs[field->submsg_index].subenum, field,
+ val)) {
+ return ptr;
+ }
+
/* Set presence if necessary. */
- if (field->presence < 0) {
+ if (field->presence > 0) {
+ _upb_sethas_field(msg, field);
+ } else if (field->presence < 0) {
/* Oneof case */
- uint32_t *oneof_case = _upb_oneofcase_field(msg, field);
+ uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
if (op == OP_SUBMSG && *oneof_case != field->number) {
memset(mem, 0, sizeof(void*));
}
*oneof_case = field->number;
- } else if (field->presence > 0) {
- _upb_sethas_field(msg, field);
}
/* Store into message. */
switch (op) {
case OP_SUBMSG: {
- upb_msg **submsgp = mem;
- upb_msg *submsg = *submsgp;
+ upb_Message** submsgp = mem;
+ upb_Message* submsg = *submsgp;
if (!submsg) {
- submsg = decode_newsubmsg(d, layout, field);
+ submsg = decode_newsubmsg(d, subs, field);
*submsgp = submsg;
}
- if (UPB_UNLIKELY(type == UPB_DTYPE_GROUP)) {
- ptr = decode_togroup(d, ptr, submsg, layout, field);
+ if (UPB_UNLIKELY(type == kUpb_FieldType_Group)) {
+ ptr = decode_togroup(d, ptr, submsg, subs, field);
} else {
- ptr = decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
+ ptr = decode_tosubmsg(d, ptr, submsg, subs, field, val->size);
}
break;
}
case OP_STRING:
- decode_verifyutf8(d, ptr, val.size);
+ decode_verifyutf8(d, ptr, val->size);
/* Fallthrough. */
case OP_BYTES:
- return decode_readstr(d, ptr, val.size, mem);
+ return decode_readstr(d, ptr, val->size, mem);
case OP_SCALAR_LG2(3):
- memcpy(mem, &val, 8);
+ memcpy(mem, val, 8);
break;
+ case OP_ENUM:
case OP_SCALAR_LG2(2):
- memcpy(mem, &val, 4);
+ memcpy(mem, val, 4);
break;
case OP_SCALAR_LG2(0):
- memcpy(mem, &val, 1);
+ memcpy(mem, val, 1);
break;
default:
UPB_UNREACHABLE();
@@ -525,9 +711,27 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
return ptr;
}
+UPB_NOINLINE
+const char* decode_checkrequired(upb_Decoder* d, const char* ptr,
+ const upb_Message* msg,
+ const upb_MiniTable* l) {
+ assert(l->required_count);
+ if (UPB_LIKELY((d->options & kUpb_DecodeOption_CheckRequired) == 0)) {
+ return ptr;
+ }
+ uint64_t msg_head;
+ memcpy(&msg_head, msg, 8);
+ msg_head = _upb_BigEndian_Swap64(msg_head);
+ if (upb_MiniTable_requiredmask(l) & ~msg_head) {
+ d->missing_required = true;
+ }
+ return ptr;
+}
+
UPB_FORCEINLINE
-static bool decode_tryfastdispatch(upb_decstate *d, const char **ptr,
- upb_msg *msg, const upb_msglayout *layout) {
+static bool decode_tryfastdispatch(upb_Decoder* d, const char** ptr,
+ upb_Message* msg,
+ const upb_MiniTable* layout) {
#if UPB_FASTTABLE
if (layout && layout->table_mask != (unsigned char)-1) {
uint16_t tag = fastdecode_loadtag(*ptr);
@@ -539,164 +743,383 @@ static bool decode_tryfastdispatch(upb_decstate *d, const char **ptr,
return false;
}
+static const char* decode_msgset(upb_Decoder* d, const char* ptr,
+ upb_Message* msg,
+ const upb_MiniTable* layout) {
+ // We create a temporary upb_MiniTable here and abuse its fields as temporary
+ // storage, to avoid creating lots of MessageSet-specific parsing code-paths:
+ // 1. We store 'layout' in item_layout.subs. We will need this later as
+ // a key to look up extensions for this MessageSet.
+ // 2. We use item_layout.fields as temporary storage to store the extension
+ // we
+ // found when parsing the type id.
+ upb_MiniTable item_layout = {
+ .subs = (const upb_MiniTable_Sub[]){{.submsg = layout}},
+ .fields = NULL,
+ .size = 0,
+ .field_count = 0,
+ .ext = kUpb_ExtMode_IsMessageSet_ITEM,
+ .dense_below = 0,
+ .table_mask = -1};
+ return decode_group(d, ptr, msg, &item_layout, 1);
+}
+
+static const upb_MiniTable_Field* decode_findfield(upb_Decoder* d,
+ const upb_MiniTable* l,
+ uint32_t field_number,
+ int* last_field_index) {
+ static upb_MiniTable_Field none = {0, 0, 0, 0, 0, 0};
+ if (l == NULL) return &none;
+
+ size_t idx = ((size_t)field_number) - 1; // 0 wraps to SIZE_MAX
+ if (idx < l->dense_below) {
+ /* Fastest case: index into dense fields. */
+ goto found;
+ }
+
+ if (l->dense_below < l->field_count) {
+ /* Linear search non-dense fields. Resume scanning from last_field_index
+ * since fields are usually in order. */
+ int last = *last_field_index;
+ for (idx = last; idx < l->field_count; idx++) {
+ if (l->fields[idx].number == field_number) {
+ goto found;
+ }
+ }
+
+ for (idx = l->dense_below; idx < last; idx++) {
+ if (l->fields[idx].number == field_number) {
+ goto found;
+ }
+ }
+ }
+
+ if (d->extreg) {
+ switch (l->ext) {
+ case kUpb_ExtMode_Extendable: {
+ const upb_MiniTable_Extension* ext =
+ _upb_extreg_get(d->extreg, l, field_number);
+ if (ext) return &ext->field;
+ break;
+ }
+ case kUpb_ExtMode_IsMessageSet:
+ if (field_number == _UPB_MSGSET_ITEM) {
+ static upb_MiniTable_Field item = {0, 0, 0, 0, TYPE_MSGSET_ITEM, 0};
+ return &item;
+ }
+ break;
+ case kUpb_ExtMode_IsMessageSet_ITEM:
+ switch (field_number) {
+ case _UPB_MSGSET_TYPEID: {
+ static upb_MiniTable_Field type_id = {
+ 0, 0, 0, 0, TYPE_MSGSET_TYPE_ID, 0};
+ return &type_id;
+ }
+ case _UPB_MSGSET_MESSAGE:
+ if (l->fields) {
+ // We saw type_id previously and succeeded in looking up msg.
+ return l->fields;
+ } else {
+ // TODO: out of order MessageSet.
+ // This is a very rare case: all serializers will emit in-order
+ // MessageSets. To hit this case there has to be some kind of
+ // re-ordering proxy. We should eventually handle this case, but
+ // not today.
+ }
+ break;
+ }
+ }
+ }
+
+ return &none; /* Unknown field. */
+
+found:
+ UPB_ASSERT(l->fields[idx].number == field_number);
+ *last_field_index = idx;
+ return &l->fields[idx];
+}
+
+UPB_FORCEINLINE
+static const char* decode_wireval(upb_Decoder* d, const char* ptr,
+ const upb_MiniTable_Field* field,
+ int wire_type, wireval* val, int* op) {
+ switch (wire_type) {
+ case kUpb_WireType_Varint:
+ ptr = decode_varint64(d, ptr, &val->uint64_val);
+ *op = varint_ops[field->descriptortype];
+ decode_munge(field->descriptortype, val);
+ return ptr;
+ case kUpb_WireType_32Bit:
+ memcpy(&val->uint32_val, ptr, 4);
+ val->uint32_val = _upb_BigEndian_Swap32(val->uint32_val);
+ *op = OP_SCALAR_LG2(2);
+ if (((1 << field->descriptortype) & FIXED32_OK_MASK) == 0) {
+ *op = OP_UNKNOWN;
+ }
+ return ptr + 4;
+ case kUpb_WireType_64Bit:
+ memcpy(&val->uint64_val, ptr, 8);
+ val->uint64_val = _upb_BigEndian_Swap64(val->uint64_val);
+ *op = OP_SCALAR_LG2(3);
+ if (((1 << field->descriptortype) & FIXED64_OK_MASK) == 0) {
+ *op = OP_UNKNOWN;
+ }
+ return ptr + 8;
+ case kUpb_WireType_Delimited: {
+ int ndx = field->descriptortype;
+ uint64_t size;
+ if (upb_FieldMode_Get(field) == kUpb_FieldMode_Array) ndx += TYPE_COUNT;
+ ptr = decode_varint64(d, ptr, &size);
+ if (size >= INT32_MAX || ptr - d->end + (int32_t)size > d->limit) {
+ break; /* Length overflow. */
+ }
+ *op = delim_ops[ndx];
+ val->size = size;
+ return ptr;
+ }
+ case kUpb_WireType_StartGroup:
+ val->uint32_val = field->number;
+ if (field->descriptortype == kUpb_FieldType_Group) {
+ *op = OP_SUBMSG;
+ } else if (field->descriptortype == TYPE_MSGSET_ITEM) {
+ *op = OP_MSGSET_ITEM;
+ } else {
+ *op = OP_UNKNOWN;
+ }
+ return ptr;
+ default:
+ break;
+ }
+ return decode_err(d, kUpb_DecodeStatus_Malformed);
+}
+
+UPB_FORCEINLINE
+static const char* decode_known(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, const upb_MiniTable* layout,
+ const upb_MiniTable_Field* field, int op,
+ wireval* val) {
+ const upb_MiniTable_Sub* subs = layout->subs;
+ uint8_t mode = field->mode;
+
+ if (UPB_UNLIKELY(mode & kUpb_LabelFlags_IsExtension)) {
+ const upb_MiniTable_Extension* ext_layout =
+ (const upb_MiniTable_Extension*)field;
+ upb_Message_Extension* ext =
+ _upb_Message_Getorcreateext(msg, ext_layout, &d->arena);
+ if (UPB_UNLIKELY(!ext)) return decode_err(d, kUpb_DecodeStatus_OutOfMemory);
+ msg = &ext->data;
+ subs = &ext->ext->sub;
+ }
+
+ switch (mode & kUpb_FieldMode_Mask) {
+ case kUpb_FieldMode_Array:
+ return decode_toarray(d, ptr, msg, subs, field, val, op);
+ case kUpb_FieldMode_Map:
+ return decode_tomap(d, ptr, msg, subs, field, val);
+ case kUpb_FieldMode_Scalar:
+ return decode_tomsg(d, ptr, msg, subs, field, val, op);
+ default:
+ UPB_UNREACHABLE();
+ }
+}
+
+static const char* decode_reverse_skip_varint(const char* ptr, uint32_t val) {
+ uint32_t seen = 0;
+ do {
+ ptr--;
+ seen <<= 7;
+ seen |= *ptr & 0x7f;
+ } while (seen != val);
+ return ptr;
+}
+
+static const char* decode_unknown(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, int field_number,
+ int wire_type, wireval val) {
+ if (field_number == 0) return decode_err(d, kUpb_DecodeStatus_Malformed);
+
+ // Since unknown fields are the uncommon case, we do a little extra work here
+ // to walk backwards through the buffer to find the field start. This frees
+ // up a register in the fast paths (when the field is known), which leads to
+ // significant speedups in benchmarks.
+ const char* start = ptr;
+
+ if (wire_type == kUpb_WireType_Delimited) ptr += val.size;
+ if (msg) {
+ switch (wire_type) {
+ case kUpb_WireType_Varint:
+ case kUpb_WireType_Delimited:
+ start--;
+ while (start[-1] & 0x80) start--;
+ break;
+ case kUpb_WireType_32Bit:
+ start -= 4;
+ break;
+ case kUpb_WireType_64Bit:
+ start -= 8;
+ break;
+ default:
+ break;
+ }
+
+ assert(start == d->debug_valstart);
+ uint32_t tag = ((uint32_t)field_number << 3) | wire_type;
+ start = decode_reverse_skip_varint(start, tag);
+ assert(start == d->debug_tagstart);
+
+ if (wire_type == kUpb_WireType_StartGroup) {
+ d->unknown = start;
+ d->unknown_msg = msg;
+ ptr = decode_group(d, ptr, NULL, NULL, field_number);
+ start = d->unknown;
+ d->unknown_msg = NULL;
+ d->unknown = NULL;
+ }
+ if (!_upb_Message_AddUnknown(msg, start, ptr - start, &d->arena)) {
+ return decode_err(d, kUpb_DecodeStatus_OutOfMemory);
+ }
+ } else if (wire_type == kUpb_WireType_StartGroup) {
+ ptr = decode_group(d, ptr, NULL, NULL, field_number);
+ }
+ return ptr;
+}
+
UPB_NOINLINE
-static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout) {
- while (true) {
+static const char* decode_msg(upb_Decoder* d, const char* ptr, upb_Message* msg,
+ const upb_MiniTable* layout) {
+ int last_field_index = 0;
+
+#if UPB_FASTTABLE
+ // The first time we want to skip fast dispatch, because we may have just been
+ // invoked by the fast parser to handle a case that it bailed on.
+ if (!decode_isdone(d, &ptr)) goto nofast;
+#endif
+
+ while (!decode_isdone(d, &ptr)) {
uint32_t tag;
- const upb_msglayout_field *field;
+ const upb_MiniTable_Field* field;
int field_number;
int wire_type;
- const char *field_start = ptr;
wireval val;
int op;
+ if (decode_tryfastdispatch(d, &ptr, msg, layout)) break;
+
+#if UPB_FASTTABLE
+ nofast:
+#endif
+
+#ifndef NDEBUG
+ d->debug_tagstart = ptr;
+#endif
+
UPB_ASSERT(ptr < d->limit_ptr);
ptr = decode_tag(d, ptr, &tag);
field_number = tag >> 3;
wire_type = tag & 7;
- field = upb_find_field(layout, field_number);
+#ifndef NDEBUG
+ d->debug_valstart = ptr;
+#endif
- switch (wire_type) {
- case UPB_WIRE_TYPE_VARINT:
- ptr = decode_varint64(d, ptr, &val.uint64_val);
- op = varint_ops[field->descriptortype];
- decode_munge(field->descriptortype, &val);
- break;
- case UPB_WIRE_TYPE_32BIT:
- memcpy(&val.uint32_val, ptr, 4);
- val.uint32_val = _upb_be_swap32(val.uint32_val);
- ptr += 4;
- op = OP_SCALAR_LG2(2);
- if (((1 << field->descriptortype) & fixed32_ok) == 0) goto unknown;
- break;
- case UPB_WIRE_TYPE_64BIT:
- memcpy(&val.uint64_val, ptr, 8);
- val.uint64_val = _upb_be_swap64(val.uint64_val);
- ptr += 8;
- op = OP_SCALAR_LG2(3);
- if (((1 << field->descriptortype) & fixed64_ok) == 0) goto unknown;
- break;
- case UPB_WIRE_TYPE_DELIMITED: {
- int ndx = field->descriptortype;
- uint64_t size;
- if (_upb_isrepeated(field)) ndx += 18;
- ptr = decode_varint64(d, ptr, &size);
- if (size >= INT32_MAX ||
- ptr - d->end + (int32_t)size > d->limit) {
- decode_err(d); /* Length overflow. */
- }
- op = delim_ops[ndx];
- val.size = size;
- break;
- }
- case UPB_WIRE_TYPE_START_GROUP:
- val.uint32_val = field_number;
- op = OP_SUBMSG;
- if (field->descriptortype != UPB_DTYPE_GROUP) goto unknown;
- break;
- case UPB_WIRE_TYPE_END_GROUP:
- d->end_group = field_number;
- return ptr;
- default:
- decode_err(d);
+ if (wire_type == kUpb_WireType_EndGroup) {
+ d->end_group = field_number;
+ return ptr;
}
+ field = decode_findfield(d, layout, field_number, &last_field_index);
+ ptr = decode_wireval(d, ptr, field, wire_type, &val, &op);
+
if (op >= 0) {
- /* Parse, using op for dispatch. */
- switch (field->label) {
- case UPB_LABEL_REPEATED:
- case _UPB_LABEL_PACKED:
- ptr = decode_toarray(d, ptr, msg, layout, field, val, op);
+ ptr = decode_known(d, ptr, msg, layout, field, op, &val);
+ } else {
+ switch (op) {
+ case OP_UNKNOWN:
+ ptr = decode_unknown(d, ptr, msg, field_number, wire_type, val);
break;
- case _UPB_LABEL_MAP:
- ptr = decode_tomap(d, ptr, msg, layout, field, val);
+ case OP_MSGSET_ITEM:
+ ptr = decode_msgset(d, ptr, msg, layout);
break;
- default:
- ptr = decode_tomsg(d, ptr, msg, layout, field, val, op);
+ case OP_MSGSET_TYPEID: {
+ const upb_MiniTable_Extension* ext = _upb_extreg_get(
+ d->extreg, layout->subs[0].submsg, val.uint64_val);
+ if (ext) ((upb_MiniTable*)layout)->fields = &ext->field;
break;
- }
- } else {
- unknown:
- /* Skip unknown field. */
- if (field_number == 0) decode_err(d);
- if (wire_type == UPB_WIRE_TYPE_DELIMITED) ptr += val.size;
- if (msg) {
- if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
- d->unknown = field_start;
- d->unknown_msg = msg;
- ptr = decode_group(d, ptr, NULL, NULL, field_number);
- d->unknown_msg = NULL;
- field_start = d->unknown;
}
- if (!_upb_msg_addunknown(msg, field_start, ptr - field_start,
- &d->arena)) {
- decode_err(d);
- }
- } else if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
- ptr = decode_group(d, ptr, NULL, NULL, field_number);
}
}
-
- if (decode_isdone(d, &ptr)) return ptr;
- if (decode_tryfastdispatch(d, &ptr, msg, layout)) return ptr;
}
+
+ return UPB_UNLIKELY(layout && layout->required_count)
+ ? decode_checkrequired(d, ptr, msg, layout)
+ : ptr;
}
-const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table, uint64_t hasbits,
- uint64_t data) {
+const char* fastdecode_generic(struct upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data) {
(void)data;
*(uint32_t*)msg |= hasbits;
return decode_msg(d, ptr, msg, decode_totablep(table));
}
-bool _upb_decode(const char *buf, size_t size, void *msg,
- const upb_msglayout *l, upb_arena *arena, int options) {
- bool ok;
- upb_decstate state;
+static upb_DecodeStatus decode_top(struct upb_Decoder* d, const char* buf,
+ void* msg, const upb_MiniTable* l) {
+ if (!decode_tryfastdispatch(d, &buf, msg, l)) {
+ decode_msg(d, buf, msg, l);
+ }
+ if (d->end_group != DECODE_NOGROUP) return kUpb_DecodeStatus_Malformed;
+ if (d->missing_required) return kUpb_DecodeStatus_MissingRequired;
+ return kUpb_DecodeStatus_Ok;
+}
+
+upb_DecodeStatus upb_Decode(const char* buf, size_t size, void* msg,
+ const upb_MiniTable* l,
+ const upb_ExtensionRegistry* extreg, int options,
+ upb_Arena* arena) {
+ upb_Decoder state;
unsigned depth = (unsigned)options >> 16;
- if (size == 0) {
- return true;
- } else if (size <= 16) {
+ if (size <= 16) {
memset(&state.patch, 0, 32);
- memcpy(&state.patch, buf, size);
+ if (size) memcpy(&state.patch, buf, size);
buf = state.patch;
state.end = buf + size;
state.limit = 0;
- state.alias = false;
+ options &= ~kUpb_DecodeOption_AliasString; // Can't alias patch buf.
} else {
state.end = buf + size - 16;
state.limit = 16;
- state.alias = options & UPB_DECODE_ALIAS;
}
+ state.extreg = extreg;
state.limit_ptr = state.end;
state.unknown_msg = NULL;
state.depth = depth ? depth : 64;
state.end_group = DECODE_NOGROUP;
+ state.options = (uint16_t)options;
+ state.missing_required = false;
state.arena.head = arena->head;
state.arena.last_size = arena->last_size;
+ state.arena.cleanup_metadata = arena->cleanup_metadata;
state.arena.parent = arena;
- if (UPB_UNLIKELY(UPB_SETJMP(state.err))) {
- ok = false;
- } else {
- if (!decode_tryfastdispatch(&state, &buf, msg, l)) {
- decode_msg(&state, buf, msg, l);
- }
- ok = state.end_group == DECODE_NOGROUP;
+ upb_DecodeStatus status = UPB_SETJMP(state.err);
+ if (UPB_LIKELY(status == kUpb_DecodeStatus_Ok)) {
+ status = decode_top(&state, buf, msg, l);
}
arena->head.ptr = state.arena.head.ptr;
arena->head.end = state.arena.head.end;
- return ok;
+ arena->cleanup_metadata = state.arena.cleanup_metadata;
+ return status;
}
+#undef OP_UNKNOWN
+#undef OP_SKIP
#undef OP_SCALAR_LG2
#undef OP_FIXPCK_LG2
#undef OP_VARPCK_LG2
#undef OP_STRING
+#undef OP_BYTES
#undef OP_SUBMSG
diff --git a/grpc/third_party/upb/upb/decode.h b/grpc/third_party/upb/upb/decode.h
index eff4b8bd..1fa8131b 100644
--- a/grpc/third_party/upb/upb/decode.h
+++ b/grpc/third_party/upb/upb/decode.h
@@ -1,6 +1,33 @@
/*
-** upb_decode: parsing into a upb_msg using a upb_msglayout.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_decode: parsing into a upb_Message using a upb_MiniTable.
+ */
#ifndef UPB_DECODE_H_
#define UPB_DECODE_H_
@@ -17,24 +44,51 @@ extern "C" {
enum {
/* If set, strings will alias the input buffer instead of copying into the
* arena. */
- UPB_DECODE_ALIAS = 1,
+ kUpb_DecodeOption_AliasString = 1,
+
+ /* If set, the parse will return failure if any message is missing any
+ * required fields when the message data ends. The parse will still continue,
+ * and the failure will only be reported at the end.
+ *
+ * IMPORTANT CAVEATS:
+ *
+ * 1. This can throw a false positive failure if an incomplete message is seen
+ * on the wire but is later completed when the sub-message occurs again.
+ * For this reason, a second pass is required to verify a failure, to be
+ * truly robust.
+ *
+ * 2. This can return a false success if you are decoding into a message that
+ * already has some sub-message fields present. If the sub-message does
+ * not occur in the binary payload, we will never visit it and discover the
+ * incomplete sub-message. For this reason, this check is only useful for
+ * implemting ParseFromString() semantics. For MergeFromString(), a
+ * post-parse validation step will always be necessary. */
+ kUpb_DecodeOption_CheckRequired = 2,
};
#define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16)
-bool _upb_decode(const char *buf, size_t size, upb_msg *msg,
- const upb_msglayout *l, upb_arena *arena, int options);
+typedef enum {
+ kUpb_DecodeStatus_Ok = 0,
+ kUpb_DecodeStatus_Malformed = 1, // Wire format was corrupt
+ kUpb_DecodeStatus_OutOfMemory = 2, // Arena alloc failed
+ kUpb_DecodeStatus_BadUtf8 = 3, // String field had bad UTF-8
+ kUpb_DecodeStatus_MaxDepthExceeded = 4, // Exceeded UPB_DECODE_MAXDEPTH
+
+ // kUpb_DecodeOption_CheckRequired failed (see above), but the parse otherwise
+ // succeeded.
+ kUpb_DecodeStatus_MissingRequired = 5,
+} upb_DecodeStatus;
-UPB_INLINE
-bool upb_decode(const char *buf, size_t size, upb_msg *msg,
- const upb_msglayout *l, upb_arena *arena) {
- return _upb_decode(buf, size, msg, l, arena, 0);
-}
+upb_DecodeStatus upb_Decode(const char* buf, size_t size, upb_Message* msg,
+ const upb_MiniTable* l,
+ const upb_ExtensionRegistry* extreg, int options,
+ upb_Arena* arena);
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
#include "upb/port_undef.inc"
-#endif /* UPB_DECODE_H_ */
+#endif /* UPB_DECODE_H_ */
diff --git a/grpc/third_party/upb/upb/decode.int.h b/grpc/third_party/upb/upb/decode.int.h
deleted file mode 100644
index e286b9cd..00000000
--- a/grpc/third_party/upb/upb/decode.int.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-** Internal implementation details of the decoder that are shared between
-** decode.c and decode_fast.c.
-*/
-
-#ifndef UPB_DECODE_INT_H_
-#define UPB_DECODE_INT_H_
-
-#include <setjmp.h>
-
-#include "upb/msg.h"
-#include "upb/upb.int.h"
-
-/* Must be last. */
-#include "upb/port_def.inc"
-
-#define DECODE_NOGROUP -1
-
-typedef struct upb_decstate {
- const char *end; /* Can read up to 16 bytes slop beyond this. */
- const char *limit_ptr; /* = end + UPB_MIN(limit, 0) */
- upb_msg *unknown_msg; /* If non-NULL, add unknown data at buffer flip. */
- const char *unknown; /* Start of unknown data. */
- int limit; /* Submessage limit relative to end. */
- int depth;
- uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
- bool alias;
- char patch[32];
- upb_arena arena;
- jmp_buf err;
-} upb_decstate;
-
-/* Error function that will abort decoding with longjmp(). We can't declare this
- * UPB_NORETURN, even though it is appropriate, because if we do then compilers
- * will "helpfully" refuse to tailcall to it
- * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
- * of our optimizations. That is also why we must declare it in a separate file,
- * otherwise the compiler will see that it calls longjmp() and deduce that it is
- * noreturn. */
-const char *fastdecode_err(upb_decstate *d);
-
-extern const uint8_t upb_utf8_offsets[];
-
-UPB_INLINE
-bool decode_verifyutf8_inl(const char *buf, int len) {
- int i, j;
- uint8_t offset;
-
- i = 0;
- while (i < len) {
- offset = upb_utf8_offsets[(uint8_t)buf[i]];
- if (offset == 0 || i + offset > len) {
- return false;
- }
- for (j = i + 1; j < i + offset; j++) {
- if ((buf[j] & 0xc0) != 0x80) {
- return false;
- }
- }
- i += offset;
- }
- return i == len;
-}
-
-/* x86-64 pointers always have the high 16 bits matching. So we can shift
- * left 8 and right 8 without loss of information. */
-UPB_INLINE intptr_t decode_totable(const upb_msglayout *tablep) {
- return ((intptr_t)tablep << 8) | tablep->table_mask;
-}
-
-UPB_INLINE const upb_msglayout *decode_totablep(intptr_t table) {
- return (const upb_msglayout*)(table >> 8);
-}
-
-UPB_INLINE
-const char *decode_isdonefallback_inl(upb_decstate *d, const char *ptr,
- int overrun) {
- if (overrun < d->limit) {
- /* Need to copy remaining data into patch buffer. */
- UPB_ASSERT(overrun < 16);
- if (d->unknown_msg) {
- if (!_upb_msg_addunknown(d->unknown_msg, d->unknown, ptr - d->unknown,
- &d->arena)) {
- return NULL;
- }
- d->unknown = &d->patch[0] + overrun;
- }
- memset(d->patch + 16, 0, 16);
- memcpy(d->patch, d->end, 16);
- ptr = &d->patch[0] + overrun;
- d->end = &d->patch[16];
- d->limit -= 16;
- d->limit_ptr = d->end + d->limit;
- d->alias = false;
- UPB_ASSERT(ptr < d->limit_ptr);
- return ptr;
- } else {
- return NULL;
- }
-}
-
-const char *decode_isdonefallback(upb_decstate *d, const char *ptr,
- int overrun);
-
-UPB_INLINE
-bool decode_isdone(upb_decstate *d, const char **ptr) {
- int overrun = *ptr - d->end;
- if (UPB_LIKELY(*ptr < d->limit_ptr)) {
- return false;
- } else if (UPB_LIKELY(overrun == d->limit)) {
- return true;
- } else {
- *ptr = decode_isdonefallback(d, *ptr, overrun);
- return false;
- }
-}
-
-UPB_INLINE
-const char *fastdecode_tagdispatch(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, uint32_t tag) {
- const upb_msglayout *table_p = decode_totablep(table);
- uint8_t mask = table;
- uint64_t data;
- size_t idx = tag & mask;
- UPB_ASSUME((idx & 7) == 0);
- idx >>= 3;
- data = table_p->fasttable[idx].field_data ^ tag;
- return table_p->fasttable[idx].field_parser(d, ptr, msg, table, hasbits, data);
-}
-
-UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
- uint16_t tag;
- memcpy(&tag, ptr, 2);
- return tag;
-}
-
-UPB_INLINE void decode_checklimit(upb_decstate *d) {
- UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
-}
-
-UPB_INLINE int decode_pushlimit(upb_decstate *d, const char *ptr, int size) {
- int limit = size + (int)(ptr - d->end);
- int delta = d->limit - limit;
- decode_checklimit(d);
- d->limit = limit;
- d->limit_ptr = d->end + UPB_MIN(0, limit);
- decode_checklimit(d);
- return delta;
-}
-
-UPB_INLINE void decode_poplimit(upb_decstate *d, const char *ptr,
- int saved_delta) {
- UPB_ASSERT(ptr - d->end == d->limit);
- decode_checklimit(d);
- d->limit += saved_delta;
- d->limit_ptr = d->end + UPB_MIN(0, d->limit);
- decode_checklimit(d);
-}
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_DECODE_INT_H_ */
diff --git a/grpc/third_party/upb/upb/decode_fast.c b/grpc/third_party/upb/upb/decode_fast.c
index f628e6db..e05bf8e0 100644
--- a/grpc/third_party/upb/upb/decode_fast.c
+++ b/grpc/third_party/upb/upb/decode_fast.c
@@ -1,8 +1,35 @@
-// Fast decoder: ~3x the speed of decode.c, but x86-64 specific.
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Fast decoder: ~3x the speed of decode.c, but requires x86-64/ARM64.
// Also the table size grows by 2x.
//
-// Could potentially be ported to ARM64 or other 64-bit archs that pass at
-// least six arguments in registers.
+// Could potentially be ported to other 64-bit archs that pass at least six
+// arguments in registers and have 8 unused high bits in pointers.
//
// The overall design is to create specialized functions for every possible
// field type (eg. oneof boolean field with a 1 byte tag) and then dispatch
@@ -10,7 +37,7 @@
#include "upb/decode_fast.h"
-#include "upb/decode.int.h"
+#include "upb/decode_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
@@ -19,66 +46,70 @@
// The standard set of arguments passed to each parsing function.
// Thanks to x86-64 calling conventions, these will stay in registers.
-#define UPB_PARSE_PARAMS \
- upb_decstate *d, const char *ptr, upb_msg *msg, intptr_t table, \
+#define UPB_PARSE_PARAMS \
+ upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
uint64_t hasbits, uint64_t data
#define UPB_PARSE_ARGS d, ptr, msg, table, hasbits, data
-#define RETURN_GENERIC(m) \
- /* fprintf(stderr, m); */ \
+#define RETURN_GENERIC(m) \
+ /* Uncomment either of these for debugging purposes. */ \
+ /* fprintf(stderr, m); */ \
+ /*__builtin_trap(); */ \
return fastdecode_generic(d, ptr, msg, table, hasbits, 0);
typedef enum {
- CARD_s = 0, /* Singular (optional, non-repeated) */
- CARD_o = 1, /* Oneof */
- CARD_r = 2, /* Repeated */
- CARD_p = 3 /* Packed Repeated */
+ CARD_s = 0, /* Singular (optional, non-repeated) */
+ CARD_o = 1, /* Oneof */
+ CARD_r = 2, /* Repeated */
+ CARD_p = 3 /* Packed Repeated */
} upb_card;
UPB_NOINLINE
-static const char *fastdecode_isdonefallback(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, int overrun) {
- ptr = decode_isdonefallback_inl(d, ptr, overrun);
+static const char* fastdecode_isdonefallback(UPB_PARSE_PARAMS) {
+ int overrun = data;
+ int status;
+ ptr = decode_isdonefallback_inl(d, ptr, overrun, &status);
if (ptr == NULL) {
- return fastdecode_err(d);
+ return fastdecode_err(d, status);
}
- uint16_t tag = fastdecode_loadtag(ptr);
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, tag);
+ data = fastdecode_loadtag(ptr);
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS);
}
UPB_FORCEINLINE
-static const char *fastdecode_dispatch(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits) {
+static const char* fastdecode_dispatch(UPB_PARSE_PARAMS) {
if (UPB_UNLIKELY(ptr >= d->limit_ptr)) {
int overrun = ptr - d->end;
if (UPB_LIKELY(overrun == d->limit)) {
// Parse is finished.
*(uint32_t*)msg |= hasbits; // Sync hasbits.
- return ptr;
+ const upb_MiniTable* l = decode_totablep(table);
+ return UPB_UNLIKELY(l->required_count)
+ ? decode_checkrequired(d, ptr, msg, l)
+ : ptr;
} else {
- return fastdecode_isdonefallback(d, ptr, msg, table, hasbits, overrun);
+ data = overrun;
+ UPB_MUSTTAIL return fastdecode_isdonefallback(UPB_PARSE_ARGS);
}
}
// Read two bytes of tag data (for a one-byte tag, the high byte is junk).
- uint16_t tag = fastdecode_loadtag(ptr);
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, tag);
+ data = fastdecode_loadtag(ptr);
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS);
}
UPB_FORCEINLINE
-static bool fastdecode_checktag(uint64_t data, int tagbytes) {
+static bool fastdecode_checktag(uint16_t data, int tagbytes) {
if (tagbytes == 1) {
return (data & 0xff) == 0;
} else {
- return (data & 0xffff) == 0;
+ return data == 0;
}
}
UPB_FORCEINLINE
-static const char *fastdecode_longsize(const char *ptr, int *size) {
+static const char* fastdecode_longsize(const char* ptr, int* size) {
int i;
UPB_ASSERT(*size & 0x80);
*size &= 0xff;
@@ -98,8 +129,8 @@ static const char *fastdecode_longsize(const char *ptr, int *size) {
}
UPB_FORCEINLINE
-static bool fastdecode_boundscheck(const char *ptr, size_t len,
- const char *end) {
+static bool fastdecode_boundscheck(const char* ptr, size_t len,
+ const char* end) {
uintptr_t uptr = (uintptr_t)ptr;
uintptr_t uend = (uintptr_t)end + 16;
uintptr_t res = uptr + len;
@@ -107,8 +138,8 @@ static bool fastdecode_boundscheck(const char *ptr, size_t len,
}
UPB_FORCEINLINE
-static bool fastdecode_boundscheck2(const char *ptr, size_t len,
- const char *end) {
+static bool fastdecode_boundscheck2(const char* ptr, size_t len,
+ const char* end) {
// This is one extra branch compared to the more normal:
// return (size_t)(end - ptr) < size;
// However it is one less computation if we are just about to use "ptr + len":
@@ -120,12 +151,12 @@ static bool fastdecode_boundscheck2(const char *ptr, size_t len,
return res < uptr || res > uend;
}
-typedef const char *fastdecode_delimfunc(upb_decstate *d, const char *ptr,
- void *ctx);
+typedef const char* fastdecode_delimfunc(upb_Decoder* d, const char* ptr,
+ void* ctx);
UPB_FORCEINLINE
-static const char *fastdecode_delimited(upb_decstate *d, const char *ptr,
- fastdecode_delimfunc *func, void *ctx) {
+static const char* fastdecode_delimited(upb_Decoder* d, const char* ptr,
+ fastdecode_delimfunc* func, void* ctx) {
ptr++;
int len = (int8_t)ptr[-1];
if (fastdecode_boundscheck2(ptr, len, d->limit_ptr)) {
@@ -150,7 +181,7 @@ static const char *fastdecode_delimited(upb_decstate *d, const char *ptr,
} else {
// Fast case: Sub-message is <128 bytes and fits in the current buffer.
// This means we can preserve limit/limit_ptr verbatim.
- const char *saved_limit_ptr = d->limit_ptr;
+ const char* saved_limit_ptr = d->limit_ptr;
int saved_limit = d->limit;
d->limit_ptr = ptr + len;
d->limit = d->limit_ptr - d->end;
@@ -166,8 +197,8 @@ static const char *fastdecode_delimited(upb_decstate *d, const char *ptr,
/* singular, oneof, repeated field handling ***********************************/
typedef struct {
- upb_array *arr;
- void *end;
+ upb_Array* arr;
+ void* end;
} fastdecode_arr;
typedef enum {
@@ -177,21 +208,21 @@ typedef enum {
} fastdecode_next;
typedef struct {
- void *dst;
+ void* dst;
fastdecode_next next;
uint32_t tag;
} fastdecode_nextret;
UPB_FORCEINLINE
-static void *fastdecode_resizearr(upb_decstate *d, void *dst,
- fastdecode_arr *farr, int valbytes) {
+static void* fastdecode_resizearr(upb_Decoder* d, void* dst,
+ fastdecode_arr* farr, int valbytes) {
if (UPB_UNLIKELY(dst == farr->end)) {
size_t old_size = farr->arr->size;
size_t old_bytes = old_size * valbytes;
size_t new_size = old_size * 2;
size_t new_bytes = new_size * valbytes;
- char *old_ptr = _upb_array_ptr(farr->arr);
- char *new_ptr = upb_arena_realloc(&d->arena, old_ptr, old_bytes, new_bytes);
+ char* old_ptr = _upb_array_ptr(farr->arr);
+ char* new_ptr = upb_Arena_Realloc(&d->arena, old_ptr, old_bytes, new_bytes);
uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
farr->arr->size = new_size;
farr->arr->data = _upb_array_tagptr(new_ptr, elem_size_lg2);
@@ -211,20 +242,20 @@ static bool fastdecode_tagmatch(uint32_t tag, uint64_t data, int tagbytes) {
}
UPB_FORCEINLINE
-static void fastdecode_commitarr(void *dst, fastdecode_arr *farr,
+static void fastdecode_commitarr(void* dst, fastdecode_arr* farr,
int valbytes) {
farr->arr->len =
- (size_t)((char *)dst - (char *)_upb_array_ptr(farr->arr)) / valbytes;
+ (size_t)((char*)dst - (char*)_upb_array_ptr(farr->arr)) / valbytes;
}
UPB_FORCEINLINE
-static fastdecode_nextret fastdecode_nextrepeated(upb_decstate *d, void *dst,
- const char **ptr,
- fastdecode_arr *farr,
+static fastdecode_nextret fastdecode_nextrepeated(upb_Decoder* d, void* dst,
+ const char** ptr,
+ fastdecode_arr* farr,
uint64_t data, int tagbytes,
int valbytes) {
fastdecode_nextret ret;
- dst = (char *)dst + valbytes;
+ dst = (char*)dst + valbytes;
if (UPB_LIKELY(!decode_isdone(d, ptr))) {
ret.tag = fastdecode_loadtag(*ptr);
@@ -244,16 +275,16 @@ static fastdecode_nextret fastdecode_nextrepeated(upb_decstate *d, void *dst,
}
UPB_FORCEINLINE
-static void *fastdecode_fieldmem(upb_msg *msg, uint64_t data) {
+static void* fastdecode_fieldmem(upb_Message* msg, uint64_t data) {
size_t ofs = data >> 48;
- return (char *)msg + ofs;
+ return (char*)msg + ofs;
}
UPB_FORCEINLINE
-static void *fastdecode_getfield(upb_decstate *d, const char *ptr, upb_msg *msg,
- uint64_t *data, uint64_t *hasbits,
- fastdecode_arr *farr, int valbytes,
- upb_card card) {
+static void* fastdecode_getfield(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, uint64_t* data,
+ uint64_t* hasbits, fastdecode_arr* farr,
+ int valbytes, upb_card card) {
switch (card) {
case CARD_s: {
uint8_t hasbit_index = *data >> 24;
@@ -263,20 +294,20 @@ static void *fastdecode_getfield(upb_decstate *d, const char *ptr, upb_msg *msg,
}
case CARD_o: {
uint16_t case_ofs = *data >> 32;
- uint32_t *oneof_case = UPB_PTR_AT(msg, case_ofs, uint32_t);
+ uint32_t* oneof_case = UPB_PTR_AT(msg, case_ofs, uint32_t);
uint8_t field_number = *data >> 24;
*oneof_case = field_number;
return fastdecode_fieldmem(msg, *data);
}
case CARD_r: {
- // Get pointer to upb_array and allocate/expand if necessary.
+ // Get pointer to upb_Array and allocate/expand if necessary.
uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
- upb_array **arr_p = fastdecode_fieldmem(msg, *data);
- char *begin;
+ upb_Array** arr_p = fastdecode_fieldmem(msg, *data);
+ char* begin;
*(uint32_t*)msg |= *hasbits;
*hasbits = 0;
if (UPB_LIKELY(!*arr_p)) {
- farr->arr = _upb_array_new(&d->arena, 8, elem_size_lg2);
+ farr->arr = _upb_Array_New(&d->arena, 8, elem_size_lg2);
*arr_p = farr->arr;
} else {
farr->arr = *arr_p;
@@ -292,11 +323,19 @@ static void *fastdecode_getfield(upb_decstate *d, const char *ptr, upb_msg *msg,
}
UPB_FORCEINLINE
-static bool fastdecode_flippacked(uint64_t *data, int tagbytes) {
+static bool fastdecode_flippacked(uint64_t* data, int tagbytes) {
*data ^= (0x2 ^ 0x0); // Patch data to match packed wiretype.
return fastdecode_checktag(*data, tagbytes);
}
+#define FASTDECODE_CHECKPACKED(tagbytes, card, func) \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) { \
+ UPB_MUSTTAIL return func(UPB_PARSE_ARGS); \
+ } \
+ RETURN_GENERIC("packed check tag mismatch\n"); \
+ }
+
/* varint fields **************************************************************/
UPB_FORCEINLINE
@@ -316,7 +355,7 @@ static uint64_t fastdecode_munge(uint64_t val, int valbytes, bool zigzag) {
}
UPB_FORCEINLINE
-static const char *fastdecode_varint64(const char *ptr, uint64_t *val) {
+static const char* fastdecode_varint64(const char* ptr, uint64_t* val) {
ptr++;
*val = (uint8_t)ptr[-1];
if (UPB_UNLIKELY(*val & 0x80)) {
@@ -339,70 +378,62 @@ done:
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_unpackedvarint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- bool zigzag,
- _upb_field_parser *packed) {
- uint64_t val;
- void *dst;
- fastdecode_arr farr;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) {
- return packed(UPB_PARSE_ARGS);
- }
- RETURN_GENERIC("varint field tag mismatch\n");
- }
-
- dst =
- fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, card);
- if (card == CARD_r) {
- if (UPB_UNLIKELY(!dst)) {
- RETURN_GENERIC("need array resize\n");
- }
- }
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, valbytes);
- }
-
- ptr += tagbytes;
- ptr = fastdecode_varint64(ptr, &val);
- if (ptr == NULL) return fastdecode_err(d);
- val = fastdecode_munge(val, valbytes, zigzag);
- memcpy(dst, &val, valbytes);
-
- if (card == CARD_r) {
- fastdecode_nextret ret =
- fastdecode_nextrepeated(d, dst, &ptr, &farr, data, tagbytes, valbytes);
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
+#define FASTDECODE_UNPACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, packed) \
+ uint64_t val; \
+ void* dst; \
+ fastdecode_arr farr; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, card, packed); \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, \
+ card); \
+ if (card == CARD_r) { \
+ if (UPB_UNLIKELY(!dst)) { \
+ RETURN_GENERIC("need array resize\n"); \
+ } \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, valbytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_varint64(ptr, &val); \
+ if (ptr == NULL) return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ val = fastdecode_munge(val, valbytes, zigzag); \
+ memcpy(dst, &val, valbytes); \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, valbytes); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
typedef struct {
uint8_t valbytes;
bool zigzag;
- void *dst;
+ void* dst;
fastdecode_arr farr;
} fastdecode_varintdata;
UPB_FORCEINLINE
-static const char *fastdecode_topackedvarint(upb_decstate *d, const char *ptr,
- void *ctx) {
- fastdecode_varintdata *data = ctx;
- void *dst = data->dst;
+static const char* fastdecode_topackedvarint(upb_Decoder* d, const char* ptr,
+ void* ctx) {
+ fastdecode_varintdata* data = ctx;
+ void* dst = data->dst;
uint64_t val;
while (!decode_isdone(d, &ptr)) {
@@ -411,56 +442,43 @@ static const char *fastdecode_topackedvarint(upb_decstate *d, const char *ptr,
if (ptr == NULL) return NULL;
val = fastdecode_munge(val, data->valbytes, data->zigzag);
memcpy(dst, &val, data->valbytes);
- dst = (char *)dst + data->valbytes;
+ dst = (char*)dst + data->valbytes;
}
fastdecode_commitarr(dst, &data->farr, data->valbytes);
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_packedvarint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, bool zigzag,
- _upb_field_parser *unpacked) {
- fastdecode_varintdata ctx = {valbytes, zigzag};
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (fastdecode_flippacked(&data, tagbytes)) {
- return unpacked(UPB_PARSE_ARGS);
- } else {
- RETURN_GENERIC("varint field tag mismatch\n");
- }
- }
-
- ctx.dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &ctx.farr,
- valbytes, CARD_r);
- if (UPB_UNLIKELY(!ctx.dst)) {
- RETURN_GENERIC("need array resize\n");
- }
-
- ptr += tagbytes;
- ptr = fastdecode_delimited(d, ptr, &fastdecode_topackedvarint, &ctx);
-
- if (UPB_UNLIKELY(ptr == NULL)) {
- return fastdecode_err(d);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_varint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card, bool zigzag,
- _upb_field_parser *unpacked,
- _upb_field_parser *packed) {
- if (card == CARD_p) {
- return fastdecode_packedvarint(UPB_PARSE_ARGS, tagbytes, valbytes, zigzag,
- unpacked);
- } else {
- return fastdecode_unpackedvarint(UPB_PARSE_ARGS, tagbytes, valbytes, card,
- zigzag, packed);
+#define FASTDECODE_PACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, zigzag, unpacked) \
+ fastdecode_varintdata ctx = {valbytes, zigzag}; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, CARD_r, unpacked); \
+ \
+ ctx.dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &ctx.farr, \
+ valbytes, CARD_r); \
+ if (UPB_UNLIKELY(!ctx.dst)) { \
+ RETURN_GENERIC("need array resize\n"); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_delimited(d, ptr, &fastdecode_topackedvarint, &ctx); \
+ \
+ if (UPB_UNLIKELY(ptr == NULL)) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(d, ptr, msg, table, hasbits, 0);
+
+#define FASTDECODE_VARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, unpacked, packed) \
+ if (card == CARD_p) { \
+ FASTDECODE_PACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, zigzag, unpacked); \
+ } else { \
+ FASTDECODE_UNPACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, packed); \
}
-}
#define z_ZZ true
#define b_ZZ false
@@ -471,11 +489,11 @@ static const char *fastdecode_varint(UPB_PARSE_PARAMS, int tagbytes,
#define F(card, type, valbytes, tagbytes) \
UPB_NOINLINE \
- const char *upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_varint(UPB_PARSE_ARGS, tagbytes, valbytes, CARD_##card, \
- type##_ZZ, \
- &upb_pr##type##valbytes##_##tagbytes##bt, \
- &upb_pp##type##valbytes##_##tagbytes##bt); \
+ const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_VARINT(d, ptr, msg, table, hasbits, data, tagbytes, valbytes, \
+ CARD_##card, type##_ZZ, \
+ upb_pr##type##valbytes##_##tagbytes##bt, \
+ upb_pp##type##valbytes##_##tagbytes##bt); \
}
#define TYPES(card, tagbytes) \
@@ -503,126 +521,109 @@ TAGBYTES(p)
#undef F
#undef TYPES
#undef TAGBYTES
-
+#undef FASTDECODE_UNPACKEDVARINT
+#undef FASTDECODE_PACKEDVARINT
+#undef FASTDECODE_VARINT
/* fixed fields ***************************************************************/
-UPB_FORCEINLINE
-static const char *fastdecode_unpackedfixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- _upb_field_parser *packed) {
- void *dst;
- fastdecode_arr farr;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) {
- return packed(UPB_PARSE_ARGS);
- }
- RETURN_GENERIC("fixed field tag mismatch\n");
- }
-
- dst =
- fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, card);
- if (card == CARD_r) {
- if (UPB_UNLIKELY(!dst)) {
- RETURN_GENERIC("couldn't allocate array in arena\n");
- }
- }
-
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, valbytes);
- }
-
- ptr += tagbytes;
- memcpy(dst, ptr, valbytes);
- ptr += valbytes;
-
- if (card == CARD_r) {
- fastdecode_nextret ret =
- fastdecode_nextrepeated(d, dst, &ptr, &farr, data, tagbytes, valbytes);
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_packedfixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes,
- _upb_field_parser *unpacked) {
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (fastdecode_flippacked(&data, tagbytes)) {
- return unpacked(UPB_PARSE_ARGS);
- } else {
- RETURN_GENERIC("varint field tag mismatch\n");
- }
- }
-
- ptr += tagbytes;
- int size = (uint8_t)ptr[0];
- ptr++;
- if (size & 0x80) {
- ptr = fastdecode_longsize(ptr, &size);
- }
-
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr)) ||
- (size % valbytes) != 0) {
- return fastdecode_err(d);
- }
-
- upb_array **arr_p = fastdecode_fieldmem(msg, data);
- upb_array *arr = *arr_p;
- uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
- int elems = size / valbytes;
-
- if (UPB_LIKELY(!arr)) {
- *arr_p = arr = _upb_array_new(&d->arena, elems, elem_size_lg2);
- if (!arr) {
- return fastdecode_err(d);
- }
- } else {
- _upb_array_resize(arr, elems, &d->arena);
+#define FASTDECODE_UNPACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, packed) \
+ void* dst; \
+ fastdecode_arr farr; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, card, packed) \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, \
+ card); \
+ if (card == CARD_r) { \
+ if (UPB_UNLIKELY(!dst)) { \
+ RETURN_GENERIC("couldn't allocate array in arena\n"); \
+ } \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, valbytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ memcpy(dst, ptr, valbytes); \
+ ptr += valbytes; \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, valbytes); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define FASTDECODE_PACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, unpacked) \
+ FASTDECODE_CHECKPACKED(tagbytes, CARD_r, unpacked) \
+ \
+ ptr += tagbytes; \
+ int size = (uint8_t)ptr[0]; \
+ ptr++; \
+ if (size & 0x80) { \
+ ptr = fastdecode_longsize(ptr, &size); \
+ } \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr) || \
+ (size % valbytes) != 0)) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ } \
+ \
+ upb_Array** arr_p = fastdecode_fieldmem(msg, data); \
+ upb_Array* arr = *arr_p; \
+ uint8_t elem_size_lg2 = __builtin_ctz(valbytes); \
+ int elems = size / valbytes; \
+ \
+ if (UPB_LIKELY(!arr)) { \
+ *arr_p = arr = _upb_Array_New(&d->arena, elems, elem_size_lg2); \
+ if (!arr) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ } \
+ } else { \
+ _upb_Array_Resize(arr, elems, &d->arena); \
+ } \
+ \
+ char* dst = _upb_array_ptr(arr); \
+ memcpy(dst, ptr, size); \
+ arr->len = elems; \
+ \
+ ptr += size; \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define FASTDECODE_FIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, unpacked, packed) \
+ if (card == CARD_p) { \
+ FASTDECODE_PACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, unpacked); \
+ } else { \
+ FASTDECODE_UNPACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, packed); \
}
- char *dst = _upb_array_ptr(arr);
- memcpy(dst, ptr, size);
- arr->len = elems;
-
- return fastdecode_dispatch(d, ptr + size, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_fixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- _upb_field_parser *unpacked,
- _upb_field_parser *packed) {
- if (card == CARD_p) {
- return fastdecode_packedfixed(UPB_PARSE_ARGS, tagbytes, valbytes, unpacked);
- } else {
- return fastdecode_unpackedfixed(UPB_PARSE_ARGS, tagbytes, valbytes, card,
- packed);
- }
-}
-
/* Generate all combinations:
* {s,o,r,p} x {f4,f8} x {1bt,2bt} */
-#define F(card, valbytes, tagbytes) \
- UPB_NOINLINE \
- const char *upb_p##card##f##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_fixed(UPB_PARSE_ARGS, tagbytes, valbytes, CARD_##card, \
- &upb_ppf##valbytes##_##tagbytes##bt, \
- &upb_prf##valbytes##_##tagbytes##bt); \
+#define F(card, valbytes, tagbytes) \
+ UPB_NOINLINE \
+ const char* upb_p##card##f##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_FIXED(d, ptr, msg, table, hasbits, data, tagbytes, valbytes, \
+ CARD_##card, upb_ppf##valbytes##_##tagbytes##bt, \
+ upb_prf##valbytes##_##tagbytes##bt); \
}
#define TYPES(card, tagbytes) \
@@ -641,81 +642,81 @@ TAGBYTES(p)
#undef F
#undef TYPES
#undef TAGBYTES
+#undef FASTDECODE_UNPACKEDFIXED
+#undef FASTDECODE_PACKEDFIXED
/* string fields **************************************************************/
-typedef const char *fastdecode_copystr_func(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- const upb_msglayout *table,
- uint64_t hasbits, upb_strview *dst);
+typedef const char* fastdecode_copystr_func(struct upb_Decoder* d,
+ const char* ptr, upb_Message* msg,
+ const upb_MiniTable* table,
+ uint64_t hasbits,
+ upb_StringView* dst);
UPB_NOINLINE
-static const char *fastdecode_verifyutf8(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, upb_strview *dst) {
+static const char* fastdecode_verifyutf8(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data) {
+ upb_StringView* dst = (upb_StringView*)data;
if (!decode_verifyutf8_inl(dst->data, dst->size)) {
- return fastdecode_err(d);
+ return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8);
}
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
}
-UPB_FORCEINLINE
-static const char *fastdecode_longstring(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- intptr_t table, uint64_t hasbits,
- upb_strview *dst,
- bool validate_utf8) {
- int size = (uint8_t)ptr[0]; // Could plumb through hasbits.
- ptr++;
- if (size & 0x80) {
- ptr = fastdecode_longsize(ptr, &size);
- }
-
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr))) {
- dst->size = 0;
- return fastdecode_err(d);
+#define FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, validate_utf8) \
+ int size = (uint8_t)ptr[0]; /* Could plumb through hasbits. */ \
+ ptr++; \
+ if (size & 0x80) { \
+ ptr = fastdecode_longsize(ptr, &size); \
+ } \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr))) { \
+ dst->size = 0; \
+ return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ } \
+ \
+ if (d->options & kUpb_DecodeOption_AliasString) { \
+ dst->data = ptr; \
+ dst->size = size; \
+ } else { \
+ char* data = upb_Arena_Malloc(&d->arena, size); \
+ if (!data) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_OutOfMemory); \
+ } \
+ memcpy(data, ptr, size); \
+ dst->data = data; \
+ dst->size = size; \
+ } \
+ \
+ ptr += size; \
+ if (validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } else { \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \
}
- if (d->alias) {
- dst->data = ptr;
- dst->size = size;
- } else {
- char *data = upb_arena_malloc(&d->arena, size);
- if (!data) {
- return fastdecode_err(d);
- }
- memcpy(data, ptr, size);
- dst->data = data;
- dst->size = size;
- }
-
- if (validate_utf8) {
- return fastdecode_verifyutf8(d, ptr + size, msg, table, hasbits, dst);
- } else {
- return fastdecode_dispatch(d, ptr + size, msg, table, hasbits);
- }
-}
-
UPB_NOINLINE
-static const char *fastdecode_longstring_utf8(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- intptr_t table, uint64_t hasbits,
- upb_strview *dst) {
- return fastdecode_longstring(d, ptr, msg, table, hasbits, dst, true);
+static const char* fastdecode_longstring_utf8(struct upb_Decoder* d,
+ const char* ptr, upb_Message* msg,
+ intptr_t table, uint64_t hasbits,
+ uint64_t data) {
+ upb_StringView* dst = (upb_StringView*)data;
+ FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, true);
}
UPB_NOINLINE
-static const char *fastdecode_longstring_noutf8(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- intptr_t table,
- uint64_t hasbits,
- upb_strview *dst) {
- return fastdecode_longstring(d, ptr, msg, table, hasbits, dst, false);
+static const char* fastdecode_longstring_noutf8(
+ struct upb_Decoder* d, const char* ptr, upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data) {
+ upb_StringView* dst = (upb_StringView*)data;
+ FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, false);
}
UPB_FORCEINLINE
-static void fastdecode_docopy(upb_decstate *d, const char *ptr, uint32_t size,
- int copy, char *data, upb_strview *dst) {
+static void fastdecode_docopy(upb_Decoder* d, const char* ptr, uint32_t size,
+ int copy, char* data, upb_StringView* dst) {
d->arena.head.ptr += copy;
dst->data = data;
UPB_UNPOISON_MEMORY_REGION(data, copy);
@@ -723,156 +724,164 @@ static void fastdecode_docopy(upb_decstate *d, const char *ptr, uint32_t size,
UPB_POISON_MEMORY_REGION(data + size, copy - size);
}
-UPB_FORCEINLINE
-static const char *fastdecode_copystring(UPB_PARSE_PARAMS, int tagbytes,
- upb_card card, bool validate_utf8) {
- upb_strview *dst;
- fastdecode_arr farr;
- int64_t size;
- size_t arena_has;
- size_t common_has;
- char *buf;
-
- UPB_ASSERT(!d->alias);
- UPB_ASSERT(fastdecode_checktag(data, tagbytes));
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_strview), card);
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview));
- }
-
- size = (uint8_t)ptr[tagbytes];
- ptr += tagbytes + 1;
- dst->size = size;
-
- buf = d->arena.head.ptr;
- arena_has = _upb_arenahas(&d->arena);
- common_has = UPB_MIN(arena_has, (d->end - ptr) + 16);
-
- if (UPB_LIKELY(size <= 15 - tagbytes)) {
- if (arena_has < 16) goto longstr;
- d->arena.head.ptr += 16;
- memcpy(buf, ptr - tagbytes - 1, 16);
- dst->data = buf + tagbytes + 1;
- } else if (UPB_LIKELY(size <= 32)) {
- if (UPB_UNLIKELY(common_has < 32)) goto longstr;
- fastdecode_docopy(d, ptr, size, 32, buf, dst);
- } else if (UPB_LIKELY(size <= 64)) {
- if (UPB_UNLIKELY(common_has < 64)) goto longstr;
- fastdecode_docopy(d, ptr, size, 64, buf, dst);
- } else if (UPB_LIKELY(size < 128)) {
- if (UPB_UNLIKELY(common_has < 128)) goto longstr;
- fastdecode_docopy(d, ptr, size, 128, buf, dst);
- } else {
- goto longstr;
- }
-
- ptr += size;
-
- if (card == CARD_r) {
- if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) {
- return fastdecode_err(d);
- }
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- if (card != CARD_r && validate_utf8) {
- return fastdecode_verifyutf8(d, ptr, msg, table, hasbits, dst);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-
-longstr:
- ptr--;
- if (validate_utf8) {
- return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, dst);
- } else {
- return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, dst);
- }
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_string(UPB_PARSE_PARAMS, int tagbytes,
- upb_card card, _upb_field_parser *copyfunc,
- bool validate_utf8) {
- upb_strview *dst;
- fastdecode_arr farr;
- int64_t size;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- RETURN_GENERIC("string field tag mismatch\n");
- }
-
- if (UPB_UNLIKELY(!d->alias)) {
- return copyfunc(UPB_PARSE_ARGS);
- }
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_strview), card);
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview));
+#define FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ card, validate_utf8) \
+ upb_StringView* dst; \
+ fastdecode_arr farr; \
+ int64_t size; \
+ size_t arena_has; \
+ size_t common_has; \
+ char* buf; \
+ \
+ UPB_ASSERT((d->options & kUpb_DecodeOption_AliasString) == 0); \
+ UPB_ASSERT(fastdecode_checktag(data, tagbytes)); \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_StringView), card); \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \
+ } \
+ \
+ size = (uint8_t)ptr[tagbytes]; \
+ ptr += tagbytes + 1; \
+ dst->size = size; \
+ \
+ buf = d->arena.head.ptr; \
+ arena_has = _upb_ArenaHas(&d->arena); \
+ common_has = UPB_MIN(arena_has, (d->end - ptr) + 16); \
+ \
+ if (UPB_LIKELY(size <= 15 - tagbytes)) { \
+ if (arena_has < 16) goto longstr; \
+ d->arena.head.ptr += 16; \
+ memcpy(buf, ptr - tagbytes - 1, 16); \
+ dst->data = buf + tagbytes + 1; \
+ } else if (UPB_LIKELY(size <= 32)) { \
+ if (UPB_UNLIKELY(common_has < 32)) goto longstr; \
+ fastdecode_docopy(d, ptr, size, 32, buf, dst); \
+ } else if (UPB_LIKELY(size <= 64)) { \
+ if (UPB_UNLIKELY(common_has < 64)) goto longstr; \
+ fastdecode_docopy(d, ptr, size, 64, buf, dst); \
+ } else if (UPB_LIKELY(size < 128)) { \
+ if (UPB_UNLIKELY(common_has < 128)) goto longstr; \
+ fastdecode_docopy(d, ptr, size, 128, buf, dst); \
+ } else { \
+ goto longstr; \
+ } \
+ \
+ ptr += size; \
+ \
+ if (card == CARD_r) { \
+ if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8); \
+ } \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ if (card != CARD_r && validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \
+ \
+ longstr: \
+ if (card == CARD_r) { \
+ fastdecode_commitarr(dst + 1, &farr, sizeof(upb_StringView)); \
+ } \
+ ptr--; \
+ if (validate_utf8) { \
+ UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \
+ hasbits, (uint64_t)dst); \
+ } else { \
+ UPB_MUSTTAIL return fastdecode_longstring_noutf8(d, ptr, msg, table, \
+ hasbits, (uint64_t)dst); \
}
- size = (int8_t)ptr[tagbytes];
- ptr += tagbytes + 1;
- dst->data = ptr;
- dst->size = size;
-
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->end))) {
- ptr--;
- if (validate_utf8) {
- return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, dst);
- } else {
- return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, dst);
- }
- }
-
- ptr += size;
-
- if (card == CARD_r) {
- if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) {
- return fastdecode_err(d);
- }
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- if (UPB_UNLIKELY(!d->alias)) {
- // Buffer flipped and we can't alias any more. Bounce to copyfunc(),
- // but via dispatch since we need to reload table data also.
- fastdecode_commitarr(dst, &farr, sizeof(upb_strview));
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- }
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- if (card != CARD_r && validate_utf8) {
- return fastdecode_verifyutf8(d, ptr, msg, table, hasbits, dst);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
+#define FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, card, \
+ copyfunc, validate_utf8) \
+ upb_StringView* dst; \
+ fastdecode_arr farr; \
+ int64_t size; \
+ \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ RETURN_GENERIC("string field tag mismatch\n"); \
+ } \
+ \
+ if (UPB_UNLIKELY((d->options & kUpb_DecodeOption_AliasString) == 0)) { \
+ UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \
+ } \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_StringView), card); \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_StringView)); \
+ } \
+ \
+ size = (int8_t)ptr[tagbytes]; \
+ ptr += tagbytes + 1; \
+ dst->data = ptr; \
+ dst->size = size; \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->end))) { \
+ ptr--; \
+ if (validate_utf8) { \
+ return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \
+ (uint64_t)dst); \
+ } else { \
+ return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \
+ (uint64_t)dst); \
+ } \
+ } \
+ \
+ ptr += size; \
+ \
+ if (card == CARD_r) { \
+ if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_BadUtf8); \
+ } \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_StringView)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ if (UPB_UNLIKELY((d->options & kUpb_DecodeOption_AliasString) == 0)) { \
+ /* Buffer flipped and we can't alias any more. Bounce to */ \
+ /* copyfunc(), but via dispatch since we need to reload table */ \
+ /* data also. */ \
+ fastdecode_commitarr(dst, &farr, sizeof(upb_StringView)); \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ } \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ if (card != CARD_r && validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
/* Generate all combinations:
* {p,c} x {s,o,r} x {s, b} x {1bt,2bt} */
@@ -880,16 +889,16 @@ again:
#define s_VALIDATE true
#define b_VALIDATE false
-#define F(card, tagbytes, type) \
- UPB_NOINLINE \
- const char *upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_copystring(UPB_PARSE_ARGS, tagbytes, CARD_##card, \
- type##_VALIDATE); \
- } \
- const char *upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_string(UPB_PARSE_ARGS, tagbytes, CARD_##card, \
- &upb_c##card##type##_##tagbytes##bt, \
- type##_VALIDATE); \
+#define F(card, tagbytes, type) \
+ UPB_NOINLINE \
+ const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ CARD_##card, type##_VALIDATE); \
+ } \
+ const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ CARD_##card, upb_c##card##type##_##tagbytes##bt, \
+ type##_VALIDATE); \
}
#define UTF8(card, tagbytes) \
@@ -908,16 +917,19 @@ TAGBYTES(r)
#undef b_VALIDATE
#undef F
#undef TAGBYTES
+#undef FASTDECODE_LONGSTRING
+#undef FASTDECODE_COPYSTRING
+#undef FASTDECODE_STRING
/* message fields *************************************************************/
UPB_INLINE
-upb_msg *decode_newmsg_ceil(upb_decstate *d, const upb_msglayout *l,
- int msg_ceil_bytes) {
- size_t size = l->size + sizeof(upb_msg_internal);
- char *msg_data;
+upb_Message* decode_newmsg_ceil(upb_Decoder* d, const upb_MiniTable* l,
+ int msg_ceil_bytes) {
+ size_t size = l->size + sizeof(upb_Message_Internal);
+ char* msg_data;
if (UPB_LIKELY(msg_ceil_bytes > 0 &&
- _upb_arenahas(&d->arena) >= msg_ceil_bytes)) {
+ _upb_ArenaHas(&d->arena) >= msg_ceil_bytes)) {
UPB_ASSERT(size <= (size_t)msg_ceil_bytes);
msg_data = d->arena.head.ptr;
d->arena.head.ptr += size;
@@ -925,108 +937,110 @@ upb_msg *decode_newmsg_ceil(upb_decstate *d, const upb_msglayout *l,
memset(msg_data, 0, msg_ceil_bytes);
UPB_POISON_MEMORY_REGION(msg_data + size, msg_ceil_bytes - size);
} else {
- msg_data = (char*)upb_arena_malloc(&d->arena, size);
+ msg_data = (char*)upb_Arena_Malloc(&d->arena, size);
memset(msg_data, 0, size);
}
- return msg_data + sizeof(upb_msg_internal);
+ return msg_data + sizeof(upb_Message_Internal);
}
typedef struct {
intptr_t table;
- upb_msg *msg;
+ upb_Message* msg;
} fastdecode_submsgdata;
UPB_FORCEINLINE
-static const char *fastdecode_tosubmsg(upb_decstate *d, const char *ptr,
- void *ctx) {
- fastdecode_submsgdata *submsg = ctx;
- ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->table, 0);
+static const char* fastdecode_tosubmsg(upb_Decoder* d, const char* ptr,
+ void* ctx) {
+ fastdecode_submsgdata* submsg = ctx;
+ ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->table, 0, 0);
UPB_ASSUME(ptr != NULL);
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_submsg(UPB_PARSE_PARAMS, int tagbytes,
- int msg_ceil_bytes, upb_card card) {
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- RETURN_GENERIC("submessage field tag mismatch\n");
- }
-
- if (--d->depth == 0) return fastdecode_err(d);
-
- upb_msg **dst;
- uint32_t submsg_idx = (data >> 16) & 0xff;
- const upb_msglayout *tablep = decode_totablep(table);
- const upb_msglayout *subtablep = tablep->submsgs[submsg_idx];
- fastdecode_submsgdata submsg = {decode_totable(subtablep)};
- fastdecode_arr farr;
-
- if (subtablep->table_mask == (uint8_t)-1) {
- RETURN_GENERIC("submessage doesn't have fast tables.");
- }
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_msg *), card);
-
- if (card == CARD_s) {
- *(uint32_t*)msg |= hasbits;
- hasbits = 0;
- }
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_msg*));
- }
-
- submsg.msg = *dst;
-
- if (card == CARD_r || UPB_LIKELY(!submsg.msg)) {
- *dst = submsg.msg = decode_newmsg_ceil(d, subtablep, msg_ceil_bytes);
- }
-
- ptr += tagbytes;
- ptr = fastdecode_delimited(d, ptr, fastdecode_tosubmsg, &submsg);
-
- if (UPB_UNLIKELY(ptr == NULL || d->end_group != DECODE_NOGROUP)) {
- return fastdecode_err(d);
- }
-
- if (card == CARD_r) {
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_msg *));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- d->depth++;
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- d->depth++;
- return ptr;
- }
- }
-
- d->depth++;
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-#define F(card, tagbytes, size_ceil, ceil_arg) \
- const char *upb_p##card##m_##tagbytes##bt_max##size_ceil##b( \
- UPB_PARSE_PARAMS) { \
- return fastdecode_submsg(UPB_PARSE_ARGS, tagbytes, ceil_arg, CARD_##card); \
+#define FASTDECODE_SUBMSG(d, ptr, msg, table, hasbits, data, tagbytes, \
+ msg_ceil_bytes, card) \
+ \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ RETURN_GENERIC("submessage field tag mismatch\n"); \
+ } \
+ \
+ if (--d->depth == 0) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_MaxDepthExceeded); \
+ } \
+ \
+ upb_Message** dst; \
+ uint32_t submsg_idx = (data >> 16) & 0xff; \
+ const upb_MiniTable* tablep = decode_totablep(table); \
+ const upb_MiniTable* subtablep = tablep->subs[submsg_idx].submsg; \
+ fastdecode_submsgdata submsg = {decode_totable(subtablep)}; \
+ fastdecode_arr farr; \
+ \
+ if (subtablep->table_mask == (uint8_t)-1) { \
+ RETURN_GENERIC("submessage doesn't have fast tables."); \
+ } \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_Message*), card); \
+ \
+ if (card == CARD_s) { \
+ *(uint32_t*)msg |= hasbits; \
+ hasbits = 0; \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_Message*)); \
+ } \
+ \
+ submsg.msg = *dst; \
+ \
+ if (card == CARD_r || UPB_LIKELY(!submsg.msg)) { \
+ *dst = submsg.msg = decode_newmsg_ceil(d, subtablep, msg_ceil_bytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_delimited(d, ptr, fastdecode_tosubmsg, &submsg); \
+ \
+ if (UPB_UNLIKELY(ptr == NULL || d->end_group != DECODE_NOGROUP)) { \
+ return fastdecode_err(d, kUpb_DecodeStatus_Malformed); \
+ } \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_Message*)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ d->depth++; \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ d->depth++; \
+ return ptr; \
+ } \
+ } \
+ \
+ d->depth++; \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define F(card, tagbytes, size_ceil, ceil_arg) \
+ const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b( \
+ UPB_PARSE_PARAMS) { \
+ FASTDECODE_SUBMSG(d, ptr, msg, table, hasbits, data, tagbytes, ceil_arg, \
+ CARD_##card); \
}
#define SIZES(card, tagbytes) \
- F(card, tagbytes, 64, 64) \
+ F(card, tagbytes, 64, 64) \
F(card, tagbytes, 128, 128) \
F(card, tagbytes, 192, 192) \
F(card, tagbytes, 256, 256) \
F(card, tagbytes, max, -1)
#define TAGBYTES(card) \
- SIZES(card, 1) \
+ SIZES(card, 1) \
SIZES(card, 2)
TAGBYTES(s)
@@ -1036,5 +1050,6 @@ TAGBYTES(r)
#undef TAGBYTES
#undef SIZES
#undef F
+#undef FASTDECODE_SUBMSG
-#endif /* UPB_FASTTABLE */
+#endif /* UPB_FASTTABLE */
diff --git a/grpc/third_party/upb/upb/decode_fast.h b/grpc/third_party/upb/upb/decode_fast.h
index 6d56d124..b04aeedb 100644
--- a/grpc/third_party/upb/upb/decode_fast.h
+++ b/grpc/third_party/upb/upb/decode_fast.h
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
// These are the specialized field parser functions for the fast parser.
// Generated tables will refer to these by name.
//
@@ -37,22 +64,22 @@
#include "upb/msg.h"
-struct upb_decstate;
+struct upb_Decoder;
// The fallback, generic parsing function that can handle any field type.
// This just uses the regular (non-fast) parser to parse a single field.
-const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table, uint64_t hasbits,
- uint64_t data);
+const char* fastdecode_generic(struct upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data);
-#define UPB_PARSE_PARAMS \
- struct upb_decstate *d, const char *ptr, upb_msg *msg, intptr_t table, \
+#define UPB_PARSE_PARAMS \
+ struct upb_Decoder *d, const char *ptr, upb_Message *msg, intptr_t table, \
uint64_t hasbits, uint64_t data
/* primitive fields ***********************************************************/
#define F(card, type, valbytes, tagbytes) \
- const char *upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
+ const char* upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS);
#define TYPES(card, tagbytes) \
F(card, b, 1, tagbytes) \
@@ -79,8 +106,8 @@ TAGBYTES(p)
/* string fields **************************************************************/
#define F(card, tagbytes, type) \
- const char *upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
- const char *upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
+ const char* upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS); \
+ const char* upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS);
#define UTF8(card, tagbytes) \
F(card, tagbytes, s) \
@@ -100,17 +127,17 @@ TAGBYTES(r)
/* sub-message fields *********************************************************/
#define F(card, tagbytes, size_ceil, ceil_arg) \
- const char *upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
+ const char* upb_p##card##m_##tagbytes##bt_max##size_ceil##b(UPB_PARSE_PARAMS);
#define SIZES(card, tagbytes) \
- F(card, tagbytes, 64, 64) \
+ F(card, tagbytes, 64, 64) \
F(card, tagbytes, 128, 128) \
F(card, tagbytes, 192, 192) \
F(card, tagbytes, 256, 256) \
F(card, tagbytes, max, -1)
#define TAGBYTES(card) \
- SIZES(card, 1) \
+ SIZES(card, 1) \
SIZES(card, 2)
TAGBYTES(s)
@@ -123,4 +150,4 @@ TAGBYTES(r)
#undef UPB_PARSE_PARAMS
-#endif /* UPB_DECODE_FAST_H_ */
+#endif /* UPB_DECODE_FAST_H_ */
diff --git a/grpc/third_party/upb/upb/decode_internal.h b/grpc/third_party/upb/upb/decode_internal.h
new file mode 100644
index 00000000..11bb9aa0
--- /dev/null
+++ b/grpc/third_party/upb/upb/decode_internal.h
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Internal implementation details of the decoder that are shared between
+ * decode.c and decode_fast.c.
+ */
+
+#ifndef UPB_DECODE_INT_H_
+#define UPB_DECODE_INT_H_
+
+#include <setjmp.h>
+
+#include "third_party/utf8_range/utf8_range.h"
+#include "upb/decode.h"
+#include "upb/msg_internal.h"
+#include "upb/upb_internal.h"
+
+/* Must be last. */
+#include "upb/port_def.inc"
+
+#define DECODE_NOGROUP (uint32_t) - 1
+
+typedef struct upb_Decoder {
+ const char* end; /* Can read up to 16 bytes slop beyond this. */
+ const char* limit_ptr; /* = end + UPB_MIN(limit, 0) */
+ upb_Message* unknown_msg; /* If non-NULL, add unknown data at buffer flip. */
+ const char* unknown; /* Start of unknown data. */
+ const upb_ExtensionRegistry*
+ extreg; /* For looking up extensions during the parse. */
+ int limit; /* Submessage limit relative to end. */
+ int depth; /* Tracks recursion depth to bound stack usage. */
+ uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
+ uint16_t options;
+ bool missing_required;
+ char patch[32];
+ upb_Arena arena;
+ jmp_buf err;
+
+#ifndef NDEBUG
+ const char* debug_tagstart;
+ const char* debug_valstart;
+#endif
+} upb_Decoder;
+
+/* Error function that will abort decoding with longjmp(). We can't declare this
+ * UPB_NORETURN, even though it is appropriate, because if we do then compilers
+ * will "helpfully" refuse to tailcall to it
+ * (see: https://stackoverflow.com/a/55657013), which will defeat a major goal
+ * of our optimizations. That is also why we must declare it in a separate file,
+ * otherwise the compiler will see that it calls longjmp() and deduce that it is
+ * noreturn. */
+const char* fastdecode_err(upb_Decoder* d, int status);
+
+extern const uint8_t upb_utf8_offsets[];
+
+UPB_INLINE
+bool decode_verifyutf8_inl(const char* ptr, int len) {
+ const char* end = ptr + len;
+
+ // Check 8 bytes at a time for any non-ASCII char.
+ while (end - ptr >= 8) {
+ uint64_t data;
+ memcpy(&data, ptr, 8);
+ if (data & 0x8080808080808080) goto non_ascii;
+ ptr += 8;
+ }
+
+ // Check one byte at a time for non-ASCII.
+ while (ptr < end) {
+ if (*ptr & 0x80) goto non_ascii;
+ ptr++;
+ }
+
+ return true;
+
+non_ascii:
+ return utf8_range2((const unsigned char*)ptr, end - ptr) == 0;
+}
+
+const char* decode_checkrequired(upb_Decoder* d, const char* ptr,
+ const upb_Message* msg,
+ const upb_MiniTable* l);
+
+/* x86-64 pointers always have the high 16 bits matching. So we can shift
+ * left 8 and right 8 without loss of information. */
+UPB_INLINE intptr_t decode_totable(const upb_MiniTable* tablep) {
+ return ((intptr_t)tablep << 8) | tablep->table_mask;
+}
+
+UPB_INLINE const upb_MiniTable* decode_totablep(intptr_t table) {
+ return (const upb_MiniTable*)(table >> 8);
+}
+
+UPB_INLINE
+const char* decode_isdonefallback_inl(upb_Decoder* d, const char* ptr,
+ int overrun, int* status) {
+ if (overrun < d->limit) {
+ /* Need to copy remaining data into patch buffer. */
+ UPB_ASSERT(overrun < 16);
+ if (d->unknown_msg) {
+ if (!_upb_Message_AddUnknown(d->unknown_msg, d->unknown, ptr - d->unknown,
+ &d->arena)) {
+ *status = kUpb_DecodeStatus_OutOfMemory;
+ return NULL;
+ }
+ d->unknown = &d->patch[0] + overrun;
+ }
+ memset(d->patch + 16, 0, 16);
+ memcpy(d->patch, d->end, 16);
+ ptr = &d->patch[0] + overrun;
+ d->end = &d->patch[16];
+ d->limit -= 16;
+ d->limit_ptr = d->end + d->limit;
+ d->options &= ~kUpb_DecodeOption_AliasString;
+ UPB_ASSERT(ptr < d->limit_ptr);
+ return ptr;
+ } else {
+ *status = kUpb_DecodeStatus_Malformed;
+ return NULL;
+ }
+}
+
+const char* decode_isdonefallback(upb_Decoder* d, const char* ptr, int overrun);
+
+UPB_INLINE
+bool decode_isdone(upb_Decoder* d, const char** ptr) {
+ int overrun = *ptr - d->end;
+ if (UPB_LIKELY(*ptr < d->limit_ptr)) {
+ return false;
+ } else if (UPB_LIKELY(overrun == d->limit)) {
+ return true;
+ } else {
+ *ptr = decode_isdonefallback(d, *ptr, overrun);
+ return false;
+ }
+}
+
+#if UPB_FASTTABLE
+UPB_INLINE
+const char* fastdecode_tagdispatch(upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t tag) {
+ const upb_MiniTable* table_p = decode_totablep(table);
+ uint8_t mask = table;
+ uint64_t data;
+ size_t idx = tag & mask;
+ UPB_ASSUME((idx & 7) == 0);
+ idx >>= 3;
+ data = table_p->fasttable[idx].field_data ^ tag;
+ UPB_MUSTTAIL return table_p->fasttable[idx].field_parser(d, ptr, msg, table,
+ hasbits, data);
+}
+#endif
+
+UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
+ uint16_t tag;
+ memcpy(&tag, ptr, 2);
+ return tag;
+}
+
+UPB_INLINE void decode_checklimit(upb_Decoder* d) {
+ UPB_ASSERT(d->limit_ptr == d->end + UPB_MIN(0, d->limit));
+}
+
+UPB_INLINE int decode_pushlimit(upb_Decoder* d, const char* ptr, int size) {
+ int limit = size + (int)(ptr - d->end);
+ int delta = d->limit - limit;
+ decode_checklimit(d);
+ d->limit = limit;
+ d->limit_ptr = d->end + UPB_MIN(0, limit);
+ decode_checklimit(d);
+ return delta;
+}
+
+UPB_INLINE void decode_poplimit(upb_Decoder* d, const char* ptr,
+ int saved_delta) {
+ UPB_ASSERT(ptr - d->end == d->limit);
+ decode_checklimit(d);
+ d->limit += saved_delta;
+ d->limit_ptr = d->end + UPB_MIN(0, d->limit);
+ decode_checklimit(d);
+}
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_DECODE_INT_H_ */
diff --git a/grpc/third_party/upb/upb/def.c b/grpc/third_party/upb/upb/def.c
index 4ba553a6..140465aa 100644
--- a/grpc/third_party/upb/upb/def.c
+++ b/grpc/third_party/upb/upb/def.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/def.h"
@@ -8,150 +34,274 @@
#include <string.h>
#include "google/protobuf/descriptor.upb.h"
+#include "upb/reflection.h"
+
+/* Must be last. */
#include "upb/port_def.inc"
typedef struct {
size_t len;
- char str[1]; /* Null-terminated string data follows. */
+ char str[1]; /* Null-terminated string data follows. */
} str_t;
-struct upb_fielddef {
- const upb_filedef *file;
- const upb_msgdef *msgdef;
- const char *full_name;
- const char *json_name;
+/* The upb core does not generally have a concept of default instances. However
+ * for descriptor options we make an exception since the max size is known and
+ * modest (<200 bytes). All types can share a default instance since it is
+ * initialized to zeroes.
+ *
+ * We have to allocate an extra pointer for upb's internal metadata. */
+static const char opt_default_buf[_UPB_MAXOPT_SIZE + sizeof(void*)] = {0};
+static const char* opt_default = &opt_default_buf[sizeof(void*)];
+
+struct upb_FieldDef {
+ const google_protobuf_FieldOptions* opts;
+ const upb_FileDef* file;
+ const upb_MessageDef* msgdef;
+ const char* full_name;
+ const char* json_name;
union {
int64_t sint;
uint64_t uint;
double dbl;
float flt;
bool boolean;
- str_t *str;
+ str_t* str;
} defaultval;
- const upb_oneofdef *oneof;
union {
- const upb_msgdef *msgdef;
- const upb_enumdef *enumdef;
- const google_protobuf_FieldDescriptorProto *unresolved;
+ const upb_OneofDef* oneof;
+ const upb_MessageDef* extension_scope;
+ } scope;
+ union {
+ const upb_MessageDef* msgdef;
+ const upb_EnumDef* enumdef;
+ const google_protobuf_FieldDescriptorProto* unresolved;
} sub;
uint32_t number_;
uint16_t index_;
- uint16_t layout_index;
- uint32_t selector_base; /* Used to index into a upb::Handlers table. */
+ uint16_t layout_index; /* Index into msgdef->layout->fields or file->exts */
+ bool has_default;
bool is_extension_;
- bool lazy_;
bool packed_;
bool proto3_optional_;
- upb_descriptortype_t type_;
- upb_label_t label_;
+ bool has_json_name_;
+ upb_FieldType type_;
+ upb_Label label_;
+#if UINTPTR_MAX == 0xffffffff
+ uint32_t padding; // Increase size to a multiple of 8.
+#endif
+};
+
+struct upb_ExtensionRange {
+ const google_protobuf_ExtensionRangeOptions* opts;
+ int32_t start;
+ int32_t end;
};
-struct upb_msgdef {
- const upb_msglayout *layout;
- const upb_filedef *file;
- const char *full_name;
- uint32_t selector_count;
- uint32_t submsg_field_count;
+struct upb_MessageDef {
+ const google_protobuf_MessageOptions* opts;
+ const upb_MiniTable* layout;
+ const upb_FileDef* file;
+ const upb_MessageDef* containing_type;
+ const char* full_name;
/* Tables for looking up fields by number and name. */
upb_inttable itof;
upb_strtable ntof;
- const upb_fielddef *fields;
- const upb_oneofdef *oneofs;
+ /* All nested defs.
+ * MEM: We could save some space here by putting nested defs in a contiguous
+ * region and calculating counts from offsets or vice-versa. */
+ const upb_FieldDef* fields;
+ const upb_OneofDef* oneofs;
+ const upb_ExtensionRange* ext_ranges;
+ const upb_MessageDef* nested_msgs;
+ const upb_EnumDef* nested_enums;
+ const upb_FieldDef* nested_exts;
int field_count;
- int oneof_count;
int real_oneof_count;
-
- /* Is this a map-entry message? */
- bool map_entry;
- upb_wellknowntype_t well_known_type;
-
- /* TODO(haberman): proper extension ranges (there can be multiple). */
+ int oneof_count;
+ int ext_range_count;
+ int nested_msg_count;
+ int nested_enum_count;
+ int nested_ext_count;
+ bool in_message_set;
+ upb_WellKnown well_known_type;
+#if UINTPTR_MAX == 0xffffffff
+ uint32_t padding; // Increase size to a multiple of 8.
+#endif
};
-struct upb_enumdef {
- const upb_filedef *file;
- const char *full_name;
+struct upb_EnumDef {
+ const google_protobuf_EnumOptions* opts;
+ const upb_MiniTable_Enum* layout; // Only for proto2.
+ const upb_FileDef* file;
+ const upb_MessageDef* containing_type; // Could be merged with "file".
+ const char* full_name;
upb_strtable ntoi;
upb_inttable iton;
+ const upb_EnumValueDef* values;
+ int value_count;
int32_t defaultval;
+#if UINTPTR_MAX == 0xffffffff
+ uint32_t padding; // Increase size to a multiple of 8.
+#endif
};
-struct upb_oneofdef {
- const upb_msgdef *parent;
- const char *full_name;
+struct upb_EnumValueDef {
+ const google_protobuf_EnumValueOptions* opts;
+ const upb_EnumDef* parent;
+ const char* full_name;
+ int32_t number;
+};
+
+struct upb_OneofDef {
+ const google_protobuf_OneofOptions* opts;
+ const upb_MessageDef* parent;
+ const char* full_name;
int field_count;
bool synthetic;
- const upb_fielddef **fields;
+ const upb_FieldDef** fields;
upb_strtable ntof;
upb_inttable itof;
+#if UINTPTR_MAX == 0xffffffff
+ uint32_t padding; // Increase size to a multiple of 8.
+#endif
};
-struct upb_filedef {
- const char *name;
- const char *package;
- const char *phpprefix;
- const char *phpnamespace;
-
- const upb_filedef **deps;
- const upb_msgdef *msgs;
- const upb_enumdef *enums;
- const upb_fielddef *exts;
- const upb_symtab *symtab;
+struct upb_FileDef {
+ const google_protobuf_FileOptions* opts;
+ const char* name;
+ const char* package;
+
+ const upb_FileDef** deps;
+ const int32_t* public_deps;
+ const int32_t* weak_deps;
+ const upb_MessageDef* top_lvl_msgs;
+ const upb_EnumDef* top_lvl_enums;
+ const upb_FieldDef* top_lvl_exts;
+ const upb_ServiceDef* services;
+ const upb_MiniTable_Extension** ext_layouts;
+ const upb_DefPool* symtab;
int dep_count;
- int msg_count;
- int enum_count;
- int ext_count;
- upb_syntax_t syntax;
+ int public_dep_count;
+ int weak_dep_count;
+ int top_lvl_msg_count;
+ int top_lvl_enum_count;
+ int top_lvl_ext_count;
+ int service_count;
+ int ext_count; /* All exts in the file. */
+ upb_Syntax syntax;
+};
+
+struct upb_MethodDef {
+ const google_protobuf_MethodOptions* opts;
+ upb_ServiceDef* service;
+ const char* full_name;
+ const upb_MessageDef* input_type;
+ const upb_MessageDef* output_type;
+ int index;
+ bool client_streaming;
+ bool server_streaming;
+};
+
+struct upb_ServiceDef {
+ const google_protobuf_ServiceOptions* opts;
+ const upb_FileDef* file;
+ const char* full_name;
+ upb_MethodDef* methods;
+ int method_count;
+ int index;
};
-struct upb_symtab {
- upb_arena *arena;
+struct upb_DefPool {
+ upb_Arena* arena;
upb_strtable syms; /* full_name -> packed def ptr */
- upb_strtable files; /* file_name -> upb_filedef* */
+ upb_strtable files; /* file_name -> upb_FileDef* */
+ upb_inttable exts; /* upb_MiniTable_Extension* -> upb_FieldDef* */
+ upb_ExtensionRegistry* extreg;
size_t bytes_loaded;
};
/* Inside a symtab we store tagged pointers to specific def types. */
typedef enum {
- UPB_DEFTYPE_FIELD = 0,
+ UPB_DEFTYPE_MASK = 7,
/* Only inside symtab table. */
+ UPB_DEFTYPE_EXT = 0,
UPB_DEFTYPE_MSG = 1,
UPB_DEFTYPE_ENUM = 2,
+ UPB_DEFTYPE_ENUMVAL = 3,
+ UPB_DEFTYPE_SERVICE = 4,
/* Only inside message table. */
+ UPB_DEFTYPE_FIELD = 0,
UPB_DEFTYPE_ONEOF = 1,
- UPB_DEFTYPE_FIELD_JSONNAME = 2
+ UPB_DEFTYPE_FIELD_JSONNAME = 2,
+
+ /* Only inside file table. */
+ UPB_DEFTYPE_FILE = 0,
+ UPB_DEFTYPE_LAYOUT = 1
} upb_deftype_t;
-static const void *unpack_def(upb_value v, upb_deftype_t type) {
+#define FIELD_TYPE_UNSPECIFIED 0
+
+static upb_deftype_t deftype(upb_value v) {
uintptr_t num = (uintptr_t)upb_value_getconstptr(v);
- return (num & 3) == type ? (const void*)(num & ~3) : NULL;
+ return num & UPB_DEFTYPE_MASK;
}
-static upb_value pack_def(const void *ptr, upb_deftype_t type) {
- uintptr_t num = (uintptr_t)ptr | type;
+static const void* unpack_def(upb_value v, upb_deftype_t type) {
+ uintptr_t num = (uintptr_t)upb_value_getconstptr(v);
+ return (num & UPB_DEFTYPE_MASK) == type
+ ? (const void*)(num & ~UPB_DEFTYPE_MASK)
+ : NULL;
+}
+
+static upb_value pack_def(const void* ptr, upb_deftype_t type) {
+ // Our 3-bit pointer tagging requires all pointers to be multiples of 8.
+ // The arena will always yield 8-byte-aligned addresses, however we put
+ // the defs into arrays. For each element in the array to be 8-byte-aligned,
+ // the sizes of each def type must also be a multiple of 8.
+ //
+ // If any of these asserts fail, we need to add or remove padding on 32-bit
+ // machines (64-bit machines will have 8-byte alignment already due to
+ // pointers, which all of these structs have).
+ UPB_ASSERT((sizeof(upb_FieldDef) & UPB_DEFTYPE_MASK) == 0);
+ UPB_ASSERT((sizeof(upb_MessageDef) & UPB_DEFTYPE_MASK) == 0);
+ UPB_ASSERT((sizeof(upb_EnumDef) & UPB_DEFTYPE_MASK) == 0);
+ UPB_ASSERT((sizeof(upb_EnumValueDef) & UPB_DEFTYPE_MASK) == 0);
+ UPB_ASSERT((sizeof(upb_ServiceDef) & UPB_DEFTYPE_MASK) == 0);
+ UPB_ASSERT((sizeof(upb_OneofDef) & UPB_DEFTYPE_MASK) == 0);
+ uintptr_t num = (uintptr_t)ptr;
+ UPB_ASSERT((num & UPB_DEFTYPE_MASK) == 0);
+ num |= type;
return upb_value_constptr((const void*)num);
}
/* isalpha() etc. from <ctype.h> are locale-dependent, which we don't want. */
-static bool upb_isbetween(char c, char low, char high) {
+static bool upb_isbetween(uint8_t c, uint8_t low, uint8_t high) {
return c >= low && c <= high;
}
+static char upb_ascii_lower(char ch) {
+ // Per ASCII this will lower-case a letter. If the result is a letter, the
+ // input was definitely a letter. If the output is not a letter, this may
+ // have transformed the character unpredictably.
+ return ch | 0x20;
+}
+
static bool upb_isletter(char c) {
- return upb_isbetween(c, 'A', 'Z') || upb_isbetween(c, 'a', 'z') || c == '_';
+ char lower = upb_ascii_lower(c);
+ return upb_isbetween(lower, 'a', 'z') || c == '_';
}
static bool upb_isalphanum(char c) {
return upb_isletter(c) || upb_isbetween(c, '0', '9');
}
-static const char *shortdefname(const char *fullname) {
- const char *p;
+static const char* shortdefname(const char* fullname) {
+ const char* p;
if (fullname == NULL) {
return NULL;
@@ -166,391 +316,417 @@ static const char *shortdefname(const char *fullname) {
/* All submessage fields are lower than all other fields.
* Secondly, fields are increasing in order. */
-uint32_t field_rank(const upb_fielddef *f) {
- uint32_t ret = upb_fielddef_number(f);
+uint32_t field_rank(const upb_FieldDef* f) {
+ uint32_t ret = upb_FieldDef_Number(f);
const uint32_t high_bit = 1 << 30;
UPB_ASSERT(ret < high_bit);
- if (!upb_fielddef_issubmsg(f))
- ret |= high_bit;
+ if (!upb_FieldDef_IsSubMessage(f)) ret |= high_bit;
return ret;
}
-int cmp_fields(const void *p1, const void *p2) {
- const upb_fielddef *f1 = *(upb_fielddef*const*)p1;
- const upb_fielddef *f2 = *(upb_fielddef*const*)p2;
+int cmp_fields(const void* p1, const void* p2) {
+ const upb_FieldDef* f1 = *(upb_FieldDef* const*)p1;
+ const upb_FieldDef* f2 = *(upb_FieldDef* const*)p2;
return field_rank(f1) - field_rank(f2);
}
-/* A few implementation details of handlers. We put these here to avoid
- * a def -> handlers dependency. */
-
-#define UPB_STATIC_SELECTOR_COUNT 3 /* Warning: also in upb/handlers.h. */
-
-static uint32_t upb_handlers_selectorbaseoffset(const upb_fielddef *f) {
- return upb_fielddef_isseq(f) ? 2 : 0;
-}
-
-static uint32_t upb_handlers_selectorcount(const upb_fielddef *f) {
- uint32_t ret = 1;
- if (upb_fielddef_isseq(f)) ret += 2; /* STARTSEQ/ENDSEQ */
- if (upb_fielddef_isstring(f)) ret += 2; /* [STRING]/STARTSTR/ENDSTR */
- if (upb_fielddef_issubmsg(f)) {
- /* ENDSUBMSG (STARTSUBMSG is at table beginning) */
- ret += 0;
- if (upb_fielddef_lazy(f)) {
- /* STARTSTR/ENDSTR/STRING (for lazy) */
- ret += 3;
- }
- }
- return ret;
-}
-
-static void upb_status_setoom(upb_status *status) {
- upb_status_seterrmsg(status, "out of memory");
+static void upb_Status_setoom(upb_Status* status) {
+ upb_Status_SetErrorMessage(status, "out of memory");
}
-static void assign_msg_wellknowntype(upb_msgdef *m) {
- const char *name = upb_msgdef_fullname(m);
+static void assign_msg_wellknowntype(upb_MessageDef* m) {
+ const char* name = upb_MessageDef_FullName(m);
if (name == NULL) {
- m->well_known_type = UPB_WELLKNOWN_UNSPECIFIED;
+ m->well_known_type = kUpb_WellKnown_Unspecified;
return;
}
if (!strcmp(name, "google.protobuf.Any")) {
- m->well_known_type = UPB_WELLKNOWN_ANY;
+ m->well_known_type = kUpb_WellKnown_Any;
} else if (!strcmp(name, "google.protobuf.FieldMask")) {
- m->well_known_type = UPB_WELLKNOWN_FIELDMASK;
+ m->well_known_type = kUpb_WellKnown_FieldMask;
} else if (!strcmp(name, "google.protobuf.Duration")) {
- m->well_known_type = UPB_WELLKNOWN_DURATION;
+ m->well_known_type = kUpb_WellKnown_Duration;
} else if (!strcmp(name, "google.protobuf.Timestamp")) {
- m->well_known_type = UPB_WELLKNOWN_TIMESTAMP;
+ m->well_known_type = kUpb_WellKnown_Timestamp;
} else if (!strcmp(name, "google.protobuf.DoubleValue")) {
- m->well_known_type = UPB_WELLKNOWN_DOUBLEVALUE;
+ m->well_known_type = kUpb_WellKnown_DoubleValue;
} else if (!strcmp(name, "google.protobuf.FloatValue")) {
- m->well_known_type = UPB_WELLKNOWN_FLOATVALUE;
+ m->well_known_type = kUpb_WellKnown_FloatValue;
} else if (!strcmp(name, "google.protobuf.Int64Value")) {
- m->well_known_type = UPB_WELLKNOWN_INT64VALUE;
+ m->well_known_type = kUpb_WellKnown_Int64Value;
} else if (!strcmp(name, "google.protobuf.UInt64Value")) {
- m->well_known_type = UPB_WELLKNOWN_UINT64VALUE;
+ m->well_known_type = kUpb_WellKnown_UInt64Value;
} else if (!strcmp(name, "google.protobuf.Int32Value")) {
- m->well_known_type = UPB_WELLKNOWN_INT32VALUE;
+ m->well_known_type = kUpb_WellKnown_Int32Value;
} else if (!strcmp(name, "google.protobuf.UInt32Value")) {
- m->well_known_type = UPB_WELLKNOWN_UINT32VALUE;
+ m->well_known_type = kUpb_WellKnown_UInt32Value;
} else if (!strcmp(name, "google.protobuf.BoolValue")) {
- m->well_known_type = UPB_WELLKNOWN_BOOLVALUE;
+ m->well_known_type = kUpb_WellKnown_BoolValue;
} else if (!strcmp(name, "google.protobuf.StringValue")) {
- m->well_known_type = UPB_WELLKNOWN_STRINGVALUE;
+ m->well_known_type = kUpb_WellKnown_StringValue;
} else if (!strcmp(name, "google.protobuf.BytesValue")) {
- m->well_known_type = UPB_WELLKNOWN_BYTESVALUE;
+ m->well_known_type = kUpb_WellKnown_BytesValue;
} else if (!strcmp(name, "google.protobuf.Value")) {
- m->well_known_type = UPB_WELLKNOWN_VALUE;
+ m->well_known_type = kUpb_WellKnown_Value;
} else if (!strcmp(name, "google.protobuf.ListValue")) {
- m->well_known_type = UPB_WELLKNOWN_LISTVALUE;
+ m->well_known_type = kUpb_WellKnown_ListValue;
} else if (!strcmp(name, "google.protobuf.Struct")) {
- m->well_known_type = UPB_WELLKNOWN_STRUCT;
+ m->well_known_type = kUpb_WellKnown_Struct;
} else {
- m->well_known_type = UPB_WELLKNOWN_UNSPECIFIED;
+ m->well_known_type = kUpb_WellKnown_Unspecified;
}
}
+/* upb_EnumDef ****************************************************************/
-/* upb_enumdef ****************************************************************/
-
-const char *upb_enumdef_fullname(const upb_enumdef *e) {
- return e->full_name;
+const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e) {
+ return e->opts;
}
-const char *upb_enumdef_name(const upb_enumdef *e) {
- return shortdefname(e->full_name);
+bool upb_EnumDef_HasOptions(const upb_EnumDef* e) {
+ return e->opts != (void*)opt_default;
}
-const upb_filedef *upb_enumdef_file(const upb_enumdef *e) {
- return e->file;
-}
+const char* upb_EnumDef_FullName(const upb_EnumDef* e) { return e->full_name; }
-int32_t upb_enumdef_default(const upb_enumdef *e) {
- UPB_ASSERT(upb_enumdef_iton(e, e->defaultval));
- return e->defaultval;
+const char* upb_EnumDef_Name(const upb_EnumDef* e) {
+ return shortdefname(e->full_name);
}
-int upb_enumdef_numvals(const upb_enumdef *e) {
- return (int)upb_strtable_count(&e->ntoi);
+const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e) { return e->file; }
+
+const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e) {
+ return e->containing_type;
}
-void upb_enum_begin(upb_enum_iter *i, const upb_enumdef *e) {
- /* We iterate over the ntoi table, to account for duplicate numbers. */
- upb_strtable_begin(i, &e->ntoi);
+int32_t upb_EnumDef_Default(const upb_EnumDef* e) {
+ UPB_ASSERT(upb_EnumDef_FindValueByNumber(e, e->defaultval));
+ return e->defaultval;
}
-void upb_enum_next(upb_enum_iter *iter) { upb_strtable_next(iter); }
-bool upb_enum_done(upb_enum_iter *iter) { return upb_strtable_done(iter); }
+int upb_EnumDef_ValueCount(const upb_EnumDef* e) { return e->value_count; }
-bool upb_enumdef_ntoi(const upb_enumdef *def, const char *name,
- size_t len, int32_t *num) {
+const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
+ const upb_EnumDef* def, const char* name, size_t len) {
upb_value v;
- if (!upb_strtable_lookup2(&def->ntoi, name, len, &v)) {
- return false;
- }
- if (num) *num = upb_value_getint32(v);
- return true;
+ return upb_strtable_lookup2(&def->ntoi, name, len, &v)
+ ? upb_value_getconstptr(v)
+ : NULL;
}
-const char *upb_enumdef_iton(const upb_enumdef *def, int32_t num) {
+const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* def,
+ int32_t num) {
upb_value v;
- return upb_inttable_lookup32(&def->iton, num, &v) ?
- upb_value_getcstr(v) : NULL;
+ return upb_inttable_lookup(&def->iton, num, &v) ? upb_value_getconstptr(v)
+ : NULL;
}
-const char *upb_enum_iter_name(upb_enum_iter *iter) {
- return upb_strtable_iter_key(iter).data;
+bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num) {
+ // We could use upb_EnumDef_FindValueByNumber(e, num) != NULL, but we expect
+ // this to be faster (especially for small numbers).
+ return upb_MiniTable_Enum_CheckValue(e->layout, num);
}
-int32_t upb_enum_iter_number(upb_enum_iter *iter) {
- return upb_value_getint32(upb_strtable_iter_value(iter));
+const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i) {
+ UPB_ASSERT(0 <= i && i < e->value_count);
+ return &e->values[i];
}
+/* upb_EnumValueDef ***********************************************************/
-/* upb_fielddef ***************************************************************/
-
-const char *upb_fielddef_fullname(const upb_fielddef *f) {
- return f->full_name;
+const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options(
+ const upb_EnumValueDef* e) {
+ return e->opts;
}
-upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f) {
- switch (f->type_) {
- case UPB_DESCRIPTOR_TYPE_DOUBLE:
- return UPB_TYPE_DOUBLE;
- case UPB_DESCRIPTOR_TYPE_FLOAT:
- return UPB_TYPE_FLOAT;
- case UPB_DESCRIPTOR_TYPE_INT64:
- case UPB_DESCRIPTOR_TYPE_SINT64:
- case UPB_DESCRIPTOR_TYPE_SFIXED64:
- return UPB_TYPE_INT64;
- case UPB_DESCRIPTOR_TYPE_INT32:
- case UPB_DESCRIPTOR_TYPE_SFIXED32:
- case UPB_DESCRIPTOR_TYPE_SINT32:
- return UPB_TYPE_INT32;
- case UPB_DESCRIPTOR_TYPE_UINT64:
- case UPB_DESCRIPTOR_TYPE_FIXED64:
- return UPB_TYPE_UINT64;
- case UPB_DESCRIPTOR_TYPE_UINT32:
- case UPB_DESCRIPTOR_TYPE_FIXED32:
- return UPB_TYPE_UINT32;
- case UPB_DESCRIPTOR_TYPE_ENUM:
- return UPB_TYPE_ENUM;
- case UPB_DESCRIPTOR_TYPE_BOOL:
- return UPB_TYPE_BOOL;
- case UPB_DESCRIPTOR_TYPE_STRING:
- return UPB_TYPE_STRING;
- case UPB_DESCRIPTOR_TYPE_BYTES:
- return UPB_TYPE_BYTES;
- case UPB_DESCRIPTOR_TYPE_GROUP:
- case UPB_DESCRIPTOR_TYPE_MESSAGE:
- return UPB_TYPE_MESSAGE;
- }
- UPB_UNREACHABLE();
+bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* e) {
+ return e->opts != (void*)opt_default;
}
-upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f) {
- return f->type_;
+const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* ev) {
+ return ev->parent;
}
-uint32_t upb_fielddef_index(const upb_fielddef *f) {
- return f->index_;
+const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* ev) {
+ return ev->full_name;
}
-upb_label_t upb_fielddef_label(const upb_fielddef *f) {
- return f->label_;
+const char* upb_EnumValueDef_Name(const upb_EnumValueDef* ev) {
+ return shortdefname(ev->full_name);
}
-uint32_t upb_fielddef_number(const upb_fielddef *f) {
- return f->number_;
+int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* ev) {
+ return ev->number;
}
-bool upb_fielddef_isextension(const upb_fielddef *f) {
- return f->is_extension_;
+uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* ev) {
+ // Compute index in our parent's array.
+ return ev - ev->parent->values;
}
-bool upb_fielddef_lazy(const upb_fielddef *f) {
- return f->lazy_;
-}
+/* upb_ExtensionRange
+ * ***************************************************************/
-bool upb_fielddef_packed(const upb_fielddef *f) {
- return f->packed_;
+const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options(
+ const upb_ExtensionRange* r) {
+ return r->opts;
}
-const char *upb_fielddef_name(const upb_fielddef *f) {
- return shortdefname(f->full_name);
+bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r) {
+ return r->opts != (void*)opt_default;
}
-const char *upb_fielddef_jsonname(const upb_fielddef *f) {
- return f->json_name;
+int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* e) {
+ return e->start;
}
-uint32_t upb_fielddef_selectorbase(const upb_fielddef *f) {
- return f->selector_base;
-}
+int32_t upb_ExtensionRange_End(const upb_ExtensionRange* e) { return e->end; }
-const upb_filedef *upb_fielddef_file(const upb_fielddef *f) {
- return f->file;
-}
+/* upb_FieldDef ***************************************************************/
-const upb_msgdef *upb_fielddef_containingtype(const upb_fielddef *f) {
- return f->msgdef;
+const google_protobuf_FieldOptions* upb_FieldDef_Options(
+ const upb_FieldDef* f) {
+ return f->opts;
}
-const upb_oneofdef *upb_fielddef_containingoneof(const upb_fielddef *f) {
- return f->oneof;
+bool upb_FieldDef_HasOptions(const upb_FieldDef* f) {
+ return f->opts != (void*)opt_default;
}
-const upb_oneofdef *upb_fielddef_realcontainingoneof(const upb_fielddef *f) {
- if (!f->oneof || upb_oneofdef_issynthetic(f->oneof)) return NULL;
- return f->oneof;
+const char* upb_FieldDef_FullName(const upb_FieldDef* f) {
+ return f->full_name;
}
-static void chkdefaulttype(const upb_fielddef *f, int ctype) {
- UPB_UNUSED(f);
- UPB_UNUSED(ctype);
+upb_CType upb_FieldDef_CType(const upb_FieldDef* f) {
+ switch (f->type_) {
+ case kUpb_FieldType_Double:
+ return kUpb_CType_Double;
+ case kUpb_FieldType_Float:
+ return kUpb_CType_Float;
+ case kUpb_FieldType_Int64:
+ case kUpb_FieldType_SInt64:
+ case kUpb_FieldType_SFixed64:
+ return kUpb_CType_Int64;
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_SFixed32:
+ case kUpb_FieldType_SInt32:
+ return kUpb_CType_Int32;
+ case kUpb_FieldType_UInt64:
+ case kUpb_FieldType_Fixed64:
+ return kUpb_CType_UInt64;
+ case kUpb_FieldType_UInt32:
+ case kUpb_FieldType_Fixed32:
+ return kUpb_CType_UInt32;
+ case kUpb_FieldType_Enum:
+ return kUpb_CType_Enum;
+ case kUpb_FieldType_Bool:
+ return kUpb_CType_Bool;
+ case kUpb_FieldType_String:
+ return kUpb_CType_String;
+ case kUpb_FieldType_Bytes:
+ return kUpb_CType_Bytes;
+ case kUpb_FieldType_Group:
+ case kUpb_FieldType_Message:
+ return kUpb_CType_Message;
+ }
+ UPB_UNREACHABLE();
}
-int64_t upb_fielddef_defaultint64(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_INT64);
- return f->defaultval.sint;
-}
+upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f) { return f->type_; }
-int32_t upb_fielddef_defaultint32(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_INT32);
- return (int32_t)f->defaultval.sint;
-}
+uint32_t upb_FieldDef_Index(const upb_FieldDef* f) { return f->index_; }
-uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_UINT64);
- return f->defaultval.uint;
+upb_Label upb_FieldDef_Label(const upb_FieldDef* f) { return f->label_; }
+
+uint32_t upb_FieldDef_Number(const upb_FieldDef* f) { return f->number_; }
+
+bool upb_FieldDef_IsExtension(const upb_FieldDef* f) {
+ return f->is_extension_;
}
-uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_UINT32);
- return (uint32_t)f->defaultval.uint;
+bool upb_FieldDef_IsPacked(const upb_FieldDef* f) { return f->packed_; }
+
+const char* upb_FieldDef_Name(const upb_FieldDef* f) {
+ return shortdefname(f->full_name);
}
-bool upb_fielddef_defaultbool(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_BOOL);
- return f->defaultval.boolean;
+const char* upb_FieldDef_JsonName(const upb_FieldDef* f) {
+ return f->json_name;
}
-float upb_fielddef_defaultfloat(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_FLOAT);
- return f->defaultval.flt;
+bool upb_FieldDef_HasJsonName(const upb_FieldDef* f) {
+ return f->has_json_name_;
}
-double upb_fielddef_defaultdouble(const upb_fielddef *f) {
- chkdefaulttype(f, UPB_TYPE_DOUBLE);
- return f->defaultval.dbl;
+const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f) { return f->file; }
+
+const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f) {
+ return f->msgdef;
}
-const char *upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len) {
- str_t *str = f->defaultval.str;
- UPB_ASSERT(upb_fielddef_type(f) == UPB_TYPE_STRING ||
- upb_fielddef_type(f) == UPB_TYPE_BYTES ||
- upb_fielddef_type(f) == UPB_TYPE_ENUM);
- if (str) {
- if (len) *len = str->len;
- return str->str;
- } else {
- if (len) *len = 0;
- return NULL;
+const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f) {
+ return f->is_extension_ ? f->scope.extension_scope : NULL;
+}
+
+const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f) {
+ return f->is_extension_ ? NULL : f->scope.oneof;
+}
+
+const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f) {
+ const upb_OneofDef* oneof = upb_FieldDef_ContainingOneof(f);
+ if (!oneof || upb_OneofDef_IsSynthetic(oneof)) return NULL;
+ return oneof;
+}
+
+upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f) {
+ UPB_ASSERT(!upb_FieldDef_IsSubMessage(f));
+ upb_MessageValue ret;
+
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
+ return (upb_MessageValue){.bool_val = f->defaultval.boolean};
+ case kUpb_CType_Int64:
+ return (upb_MessageValue){.int64_val = f->defaultval.sint};
+ case kUpb_CType_UInt64:
+ return (upb_MessageValue){.uint64_val = f->defaultval.uint};
+ case kUpb_CType_Enum:
+ case kUpb_CType_Int32:
+ return (upb_MessageValue){.int32_val = (int32_t)f->defaultval.sint};
+ case kUpb_CType_UInt32:
+ return (upb_MessageValue){.uint32_val = (uint32_t)f->defaultval.uint};
+ case kUpb_CType_Float:
+ return (upb_MessageValue){.float_val = f->defaultval.flt};
+ case kUpb_CType_Double:
+ return (upb_MessageValue){.double_val = f->defaultval.dbl};
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes: {
+ str_t* str = f->defaultval.str;
+ if (str) {
+ return (upb_MessageValue){
+ .str_val = (upb_StringView){.data = str->str, .size = str->len}};
+ } else {
+ return (upb_MessageValue){
+ .str_val = (upb_StringView){.data = NULL, .size = 0}};
+ }
+ }
+ default:
+ UPB_UNREACHABLE();
}
+
+ return ret;
}
-const upb_msgdef *upb_fielddef_msgsubdef(const upb_fielddef *f) {
- return upb_fielddef_type(f) == UPB_TYPE_MESSAGE ? f->sub.msgdef : NULL;
+const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f) {
+ return upb_FieldDef_CType(f) == kUpb_CType_Message ? f->sub.msgdef : NULL;
}
-const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f) {
- return upb_fielddef_type(f) == UPB_TYPE_ENUM ? f->sub.enumdef : NULL;
+const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f) {
+ return upb_FieldDef_CType(f) == kUpb_CType_Enum ? f->sub.enumdef : NULL;
}
-const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f) {
+const upb_MiniTable_Field* upb_FieldDef_MiniTable(const upb_FieldDef* f) {
+ UPB_ASSERT(!upb_FieldDef_IsExtension(f));
return &f->msgdef->layout->fields[f->layout_index];
}
-bool upb_fielddef_issubmsg(const upb_fielddef *f) {
- return upb_fielddef_type(f) == UPB_TYPE_MESSAGE;
+const upb_MiniTable_Extension* _upb_FieldDef_ExtensionMiniTable(
+ const upb_FieldDef* f) {
+ UPB_ASSERT(upb_FieldDef_IsExtension(f));
+ return f->file->ext_layouts[f->layout_index];
+}
+
+bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f) {
+ return f->proto3_optional_;
+}
+
+bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f) {
+ return upb_FieldDef_CType(f) == kUpb_CType_Message;
}
-bool upb_fielddef_isstring(const upb_fielddef *f) {
- return upb_fielddef_type(f) == UPB_TYPE_STRING ||
- upb_fielddef_type(f) == UPB_TYPE_BYTES;
+bool upb_FieldDef_IsString(const upb_FieldDef* f) {
+ return upb_FieldDef_CType(f) == kUpb_CType_String ||
+ upb_FieldDef_CType(f) == kUpb_CType_Bytes;
}
-bool upb_fielddef_isseq(const upb_fielddef *f) {
- return upb_fielddef_label(f) == UPB_LABEL_REPEATED;
+bool upb_FieldDef_IsRepeated(const upb_FieldDef* f) {
+ return upb_FieldDef_Label(f) == kUpb_Label_Repeated;
}
-bool upb_fielddef_isprimitive(const upb_fielddef *f) {
- return !upb_fielddef_isstring(f) && !upb_fielddef_issubmsg(f);
+bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f) {
+ return !upb_FieldDef_IsString(f) && !upb_FieldDef_IsSubMessage(f);
}
-bool upb_fielddef_ismap(const upb_fielddef *f) {
- return upb_fielddef_isseq(f) && upb_fielddef_issubmsg(f) &&
- upb_msgdef_mapentry(upb_fielddef_msgsubdef(f));
+bool upb_FieldDef_IsMap(const upb_FieldDef* f) {
+ return upb_FieldDef_IsRepeated(f) && upb_FieldDef_IsSubMessage(f) &&
+ upb_MessageDef_IsMapEntry(upb_FieldDef_MessageSubDef(f));
}
-bool upb_fielddef_hassubdef(const upb_fielddef *f) {
- return upb_fielddef_issubmsg(f) || upb_fielddef_type(f) == UPB_TYPE_ENUM;
+bool upb_FieldDef_HasDefault(const upb_FieldDef* f) { return f->has_default; }
+
+bool upb_FieldDef_HasSubDef(const upb_FieldDef* f) {
+ return upb_FieldDef_IsSubMessage(f) ||
+ upb_FieldDef_CType(f) == kUpb_CType_Enum;
}
-bool upb_fielddef_haspresence(const upb_fielddef *f) {
- if (upb_fielddef_isseq(f)) return false;
- return upb_fielddef_issubmsg(f) || upb_fielddef_containingoneof(f) ||
- f->file->syntax == UPB_SYNTAX_PROTO2;
+bool upb_FieldDef_HasPresence(const upb_FieldDef* f) {
+ if (upb_FieldDef_IsRepeated(f)) return false;
+ return upb_FieldDef_IsSubMessage(f) || upb_FieldDef_ContainingOneof(f) ||
+ f->file->syntax == kUpb_Syntax_Proto2;
}
static bool between(int32_t x, int32_t low, int32_t high) {
return x >= low && x <= high;
}
-bool upb_fielddef_checklabel(int32_t label) { return between(label, 1, 3); }
-bool upb_fielddef_checktype(int32_t type) { return between(type, 1, 11); }
-bool upb_fielddef_checkintfmt(int32_t fmt) { return between(fmt, 1, 3); }
+bool upb_FieldDef_checklabel(int32_t label) { return between(label, 1, 3); }
+bool upb_FieldDef_checktype(int32_t type) { return between(type, 1, 11); }
+bool upb_FieldDef_checkintfmt(int32_t fmt) { return between(fmt, 1, 3); }
-bool upb_fielddef_checkdescriptortype(int32_t type) {
+bool upb_FieldDef_checkdescriptortype(int32_t type) {
return between(type, 1, 18);
}
-/* upb_msgdef *****************************************************************/
+/* upb_MessageDef
+ * *****************************************************************/
-const char *upb_msgdef_fullname(const upb_msgdef *m) {
- return m->full_name;
+const google_protobuf_MessageOptions* upb_MessageDef_Options(
+ const upb_MessageDef* m) {
+ return m->opts;
}
-const upb_filedef *upb_msgdef_file(const upb_msgdef *m) {
- return m->file;
+bool upb_MessageDef_HasOptions(const upb_MessageDef* m) {
+ return m->opts != (void*)opt_default;
}
-const char *upb_msgdef_name(const upb_msgdef *m) {
- return shortdefname(m->full_name);
+const char* upb_MessageDef_FullName(const upb_MessageDef* m) {
+ return m->full_name;
}
-upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m) {
- return m->file->syntax;
+const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m) {
+ return m->file;
+}
+
+const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m) {
+ return m->containing_type;
}
-size_t upb_msgdef_selectorcount(const upb_msgdef *m) {
- return m->selector_count;
+const char* upb_MessageDef_Name(const upb_MessageDef* m) {
+ return shortdefname(m->full_name);
}
-uint32_t upb_msgdef_submsgfieldcount(const upb_msgdef *m) {
- return m->submsg_field_count;
+upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m) {
+ return m->file->syntax;
}
-const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i) {
+const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m,
+ uint32_t i) {
upb_value val;
- return upb_inttable_lookup32(&m->itof, i, &val) ?
- upb_value_getconstptr(val) : NULL;
+ return upb_inttable_lookup(&m->itof, i, &val) ? upb_value_getconstptr(val)
+ : NULL;
}
-const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
- size_t len) {
+const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len) {
upb_value val;
if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) {
@@ -560,8 +736,8 @@ const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
return unpack_def(val, UPB_DEFTYPE_FIELD);
}
-const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name,
- size_t len) {
+const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len) {
upb_value val;
if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) {
@@ -571,23 +747,27 @@ const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name,
return unpack_def(val, UPB_DEFTYPE_ONEOF);
}
-bool upb_msgdef_lookupname(const upb_msgdef *m, const char *name, size_t len,
- const upb_fielddef **f, const upb_oneofdef **o) {
+bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
+ const char* name, size_t len,
+ const upb_FieldDef** out_f,
+ const upb_OneofDef** out_o) {
upb_value val;
if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) {
return false;
}
- *o = unpack_def(val, UPB_DEFTYPE_ONEOF);
- *f = unpack_def(val, UPB_DEFTYPE_FIELD);
- return *o || *f; /* False if this was a JSON name. */
+ const upb_FieldDef* f = unpack_def(val, UPB_DEFTYPE_FIELD);
+ const upb_OneofDef* o = unpack_def(val, UPB_DEFTYPE_ONEOF);
+ if (out_f) *out_f = f;
+ if (out_o) *out_o = o;
+ return f || o; /* False if this was a JSON name. */
}
-const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m,
- const char *name, size_t len) {
+const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len) {
upb_value val;
- const upb_fielddef* f;
+ const upb_FieldDef* f;
if (!upb_strtable_lookup2(&m->ntof, name, len, &val)) {
return NULL;
@@ -599,295 +779,465 @@ const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m,
return f;
}
-int upb_msgdef_numfields(const upb_msgdef *m) {
+int upb_MessageDef_numfields(const upb_MessageDef* m) { return m->field_count; }
+
+int upb_MessageDef_numoneofs(const upb_MessageDef* m) { return m->oneof_count; }
+
+int upb_MessageDef_numrealoneofs(const upb_MessageDef* m) {
+ return m->real_oneof_count;
+}
+
+int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m) {
+ return m->ext_range_count;
+}
+
+int upb_MessageDef_FieldCount(const upb_MessageDef* m) {
return m->field_count;
}
-int upb_msgdef_numoneofs(const upb_msgdef *m) {
+int upb_MessageDef_OneofCount(const upb_MessageDef* m) {
return m->oneof_count;
}
-int upb_msgdef_numrealoneofs(const upb_msgdef *m) {
- return m->real_oneof_count;
+int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m) {
+ return m->nested_msg_count;
}
-int upb_msgdef_fieldcount(const upb_msgdef *m) {
- return m->field_count;
+int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m) {
+ return m->nested_enum_count;
}
-int upb_msgdef_oneofcount(const upb_msgdef *m) {
- return m->oneof_count;
+int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m) {
+ return m->nested_ext_count;
}
-int upb_msgdef_realoneofcount(const upb_msgdef *m) {
+int upb_MessageDef_realoneofcount(const upb_MessageDef* m) {
return m->real_oneof_count;
}
-const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m) {
+const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m) {
return m->layout;
}
-const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i) {
- UPB_ASSERT(i >= 0 && i < m->field_count);
+const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
+ int i) {
+ UPB_ASSERT(0 <= i && i < m->ext_range_count);
+ return &m->ext_ranges[i];
+}
+
+const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i) {
+ UPB_ASSERT(0 <= i && i < m->field_count);
return &m->fields[i];
}
-const upb_oneofdef *upb_msgdef_oneof(const upb_msgdef *m, int i) {
- UPB_ASSERT(i >= 0 && i < m->oneof_count);
+const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i) {
+ UPB_ASSERT(0 <= i && i < m->oneof_count);
return &m->oneofs[i];
}
-bool upb_msgdef_mapentry(const upb_msgdef *m) {
- return m->map_entry;
+const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
+ int i) {
+ UPB_ASSERT(0 <= i && i < m->nested_msg_count);
+ return &m->nested_msgs[i];
}
-upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m) {
- return m->well_known_type;
+const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i) {
+ UPB_ASSERT(0 <= i && i < m->nested_enum_count);
+ return &m->nested_enums[i];
}
-bool upb_msgdef_isnumberwrapper(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type >= UPB_WELLKNOWN_DOUBLEVALUE &&
- type <= UPB_WELLKNOWN_UINT32VALUE;
+const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
+ int i) {
+ UPB_ASSERT(0 <= i && i < m->nested_ext_count);
+ return &m->nested_exts[i];
}
-bool upb_msgdef_iswrapper(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type >= UPB_WELLKNOWN_DOUBLEVALUE &&
- type <= UPB_WELLKNOWN_BOOLVALUE;
+upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m) {
+ return m->well_known_type;
}
-void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m) {
- upb_inttable_begin(iter, &m->itof);
+/* upb_OneofDef ***************************************************************/
+
+const google_protobuf_OneofOptions* upb_OneofDef_Options(
+ const upb_OneofDef* o) {
+ return o->opts;
}
-void upb_msg_field_next(upb_msg_field_iter *iter) { upb_inttable_next(iter); }
+bool upb_OneofDef_HasOptions(const upb_OneofDef* o) {
+ return o->opts != (void*)opt_default;
+}
-bool upb_msg_field_done(const upb_msg_field_iter *iter) {
- return upb_inttable_done(iter);
+const char* upb_OneofDef_Name(const upb_OneofDef* o) {
+ return shortdefname(o->full_name);
}
-upb_fielddef *upb_msg_iter_field(const upb_msg_field_iter *iter) {
- return (upb_fielddef *)upb_value_getconstptr(upb_inttable_iter_value(iter));
+const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o) {
+ return o->parent;
}
-void upb_msg_field_iter_setdone(upb_msg_field_iter *iter) {
- upb_inttable_iter_setdone(iter);
+int upb_OneofDef_FieldCount(const upb_OneofDef* o) { return o->field_count; }
+
+const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i) {
+ UPB_ASSERT(i < o->field_count);
+ return o->fields[i];
}
-bool upb_msg_field_iter_isequal(const upb_msg_field_iter * iter1,
- const upb_msg_field_iter * iter2) {
- return upb_inttable_iter_isequal(iter1, iter2);
+int upb_OneofDef_numfields(const upb_OneofDef* o) { return o->field_count; }
+
+uint32_t upb_OneofDef_Index(const upb_OneofDef* o) {
+ // Compute index in our parent's array.
+ return o - o->parent->oneofs;
}
-void upb_msg_oneof_begin(upb_msg_oneof_iter *iter, const upb_msgdef *m) {
- upb_strtable_begin(iter, &m->ntof);
- /* We need to skip past any initial fields. */
- while (!upb_strtable_done(iter) &&
- !unpack_def(upb_strtable_iter_value(iter), UPB_DEFTYPE_ONEOF)) {
- upb_strtable_next(iter);
- }
+bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o) { return o->synthetic; }
+
+const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
+ const char* name,
+ size_t length) {
+ upb_value val;
+ return upb_strtable_lookup2(&o->ntof, name, length, &val)
+ ? upb_value_getptr(val)
+ : NULL;
}
-void upb_msg_oneof_next(upb_msg_oneof_iter *iter) {
- /* We need to skip past fields to return only oneofs. */
- do {
- upb_strtable_next(iter);
- } while (!upb_strtable_done(iter) &&
- !unpack_def(upb_strtable_iter_value(iter), UPB_DEFTYPE_ONEOF));
+const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
+ uint32_t num) {
+ upb_value val;
+ return upb_inttable_lookup(&o->itof, num, &val) ? upb_value_getptr(val)
+ : NULL;
}
-bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter) {
- return upb_strtable_done(iter);
+/* upb_FileDef ****************************************************************/
+
+const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f) {
+ return f->opts;
}
-const upb_oneofdef *upb_msg_iter_oneof(const upb_msg_oneof_iter *iter) {
- return unpack_def(upb_strtable_iter_value(iter), UPB_DEFTYPE_ONEOF);
+bool upb_FileDef_HasOptions(const upb_FileDef* f) {
+ return f->opts != (void*)opt_default;
}
-void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter *iter) {
- upb_strtable_iter_setdone(iter);
+const char* upb_FileDef_Name(const upb_FileDef* f) { return f->name; }
+
+const char* upb_FileDef_Package(const upb_FileDef* f) { return f->package; }
+
+upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f) { return f->syntax; }
+
+int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f) {
+ return f->top_lvl_msg_count;
}
-bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1,
- const upb_msg_oneof_iter *iter2) {
- return upb_strtable_iter_isequal(iter1, iter2);
+int upb_FileDef_DependencyCount(const upb_FileDef* f) { return f->dep_count; }
+
+int upb_FileDef_PublicDependencyCount(const upb_FileDef* f) {
+ return f->public_dep_count;
}
-/* upb_oneofdef ***************************************************************/
+int upb_FileDef_WeakDependencyCount(const upb_FileDef* f) {
+ return f->weak_dep_count;
+}
-const char *upb_oneofdef_name(const upb_oneofdef *o) {
- return shortdefname(o->full_name);
+const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f) {
+ return f->public_deps;
}
-const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o) {
- return o->parent;
+const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f) {
+ return f->weak_deps;
}
-int upb_oneofdef_fieldcount(const upb_oneofdef *o) {
- return o->field_count;
+int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f) {
+ return f->top_lvl_enum_count;
}
-const upb_fielddef *upb_oneofdef_field(const upb_oneofdef *o, int i) {
- UPB_ASSERT(i < o->field_count);
- return o->fields[i];
+int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f) {
+ return f->top_lvl_ext_count;
}
-int upb_oneofdef_numfields(const upb_oneofdef *o) {
- return o->field_count;
+int upb_FileDef_ServiceCount(const upb_FileDef* f) { return f->service_count; }
+
+const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->dep_count);
+ return f->deps[i];
}
-uint32_t upb_oneofdef_index(const upb_oneofdef *o) {
- return o - o->parent->oneofs;
+const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->public_dep_count);
+ return f->deps[f->public_deps[i]];
}
-bool upb_oneofdef_issynthetic(const upb_oneofdef *o) {
- return o->synthetic;
+const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->public_dep_count);
+ return f->deps[f->weak_deps[i]];
}
-const upb_fielddef *upb_oneofdef_ntof(const upb_oneofdef *o,
- const char *name, size_t length) {
- upb_value val;
- return upb_strtable_lookup2(&o->ntof, name, length, &val) ?
- upb_value_getptr(val) : NULL;
+const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->top_lvl_msg_count);
+ return &f->top_lvl_msgs[i];
}
-const upb_fielddef *upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num) {
- upb_value val;
- return upb_inttable_lookup32(&o->itof, num, &val) ?
- upb_value_getptr(val) : NULL;
+const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->top_lvl_enum_count);
+ return &f->top_lvl_enums[i];
+}
+
+const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->top_lvl_ext_count);
+ return &f->top_lvl_exts[i];
}
-void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o) {
- upb_inttable_begin(iter, &o->itof);
+const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i) {
+ UPB_ASSERT(0 <= i && i < f->service_count);
+ return &f->services[i];
}
-void upb_oneof_next(upb_oneof_iter *iter) {
- upb_inttable_next(iter);
+const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f) { return f->symtab; }
+
+/* upb_MethodDef **************************************************************/
+
+const google_protobuf_MethodOptions* upb_MethodDef_Options(
+ const upb_MethodDef* m) {
+ return m->opts;
}
-bool upb_oneof_done(upb_oneof_iter *iter) {
- return upb_inttable_done(iter);
+bool upb_MethodDef_HasOptions(const upb_MethodDef* m) {
+ return m->opts != (void*)opt_default;
}
-upb_fielddef *upb_oneof_iter_field(const upb_oneof_iter *iter) {
- return (upb_fielddef *)upb_value_getconstptr(upb_inttable_iter_value(iter));
+const char* upb_MethodDef_FullName(const upb_MethodDef* m) {
+ return m->full_name;
}
-void upb_oneof_iter_setdone(upb_oneof_iter *iter) {
- upb_inttable_iter_setdone(iter);
+int upb_MethodDef_Index(const upb_MethodDef* m) { return m->index; }
+
+const char* upb_MethodDef_Name(const upb_MethodDef* m) {
+ return shortdefname(m->full_name);
}
-/* upb_filedef ****************************************************************/
+const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m) {
+ return m->service;
+}
-const char *upb_filedef_name(const upb_filedef *f) {
- return f->name;
+const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m) {
+ return m->input_type;
}
-const char *upb_filedef_package(const upb_filedef *f) {
- return f->package;
+const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m) {
+ return m->output_type;
}
-const char *upb_filedef_phpprefix(const upb_filedef *f) {
- return f->phpprefix;
+bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m) {
+ return m->client_streaming;
}
-const char *upb_filedef_phpnamespace(const upb_filedef *f) {
- return f->phpnamespace;
+bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m) {
+ return m->server_streaming;
}
-upb_syntax_t upb_filedef_syntax(const upb_filedef *f) {
- return f->syntax;
+/* upb_ServiceDef *************************************************************/
+
+const google_protobuf_ServiceOptions* upb_ServiceDef_Options(
+ const upb_ServiceDef* s) {
+ return s->opts;
}
-int upb_filedef_msgcount(const upb_filedef *f) {
- return f->msg_count;
+bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s) {
+ return s->opts != (void*)opt_default;
}
-int upb_filedef_depcount(const upb_filedef *f) {
- return f->dep_count;
+const char* upb_ServiceDef_FullName(const upb_ServiceDef* s) {
+ return s->full_name;
}
-int upb_filedef_enumcount(const upb_filedef *f) {
- return f->enum_count;
+const char* upb_ServiceDef_Name(const upb_ServiceDef* s) {
+ return shortdefname(s->full_name);
}
-const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i) {
- return i < 0 || i >= f->dep_count ? NULL : f->deps[i];
+int upb_ServiceDef_Index(const upb_ServiceDef* s) { return s->index; }
+
+const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s) {
+ return s->file;
}
-const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i) {
- return i < 0 || i >= f->msg_count ? NULL : &f->msgs[i];
+int upb_ServiceDef_MethodCount(const upb_ServiceDef* s) {
+ return s->method_count;
}
-const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i) {
- return i < 0 || i >= f->enum_count ? NULL : &f->enums[i];
+const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i) {
+ return i < 0 || i >= s->method_count ? NULL : &s->methods[i];
}
-const upb_symtab *upb_filedef_symtab(const upb_filedef *f) {
- return f->symtab;
+const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
+ const char* name) {
+ for (int i = 0; i < s->method_count; i++) {
+ if (strcmp(name, upb_MethodDef_Name(&s->methods[i])) == 0) {
+ return &s->methods[i];
+ }
+ }
+ return NULL;
}
-void upb_symtab_free(upb_symtab *s) {
- upb_arena_free(s->arena);
+/* upb_DefPool ****************************************************************/
+
+void upb_DefPool_Free(upb_DefPool* s) {
+ upb_Arena_Free(s->arena);
upb_gfree(s);
}
-upb_symtab *upb_symtab_new(void) {
- upb_symtab *s = upb_gmalloc(sizeof(*s));
- upb_alloc *alloc;
+upb_DefPool* upb_DefPool_New(void) {
+ upb_DefPool* s = upb_gmalloc(sizeof(*s));
if (!s) {
return NULL;
}
- s->arena = upb_arena_new();
+ s->arena = upb_Arena_New();
s->bytes_loaded = 0;
- alloc = upb_arena_alloc(s->arena);
- if (!upb_strtable_init2(&s->syms, UPB_CTYPE_CONSTPTR, 32, alloc) ||
- !upb_strtable_init2(&s->files, UPB_CTYPE_CONSTPTR, 4, alloc)) {
- upb_arena_free(s->arena);
- upb_gfree(s);
- s = NULL;
+ if (!upb_strtable_init(&s->syms, 32, s->arena) ||
+ !upb_strtable_init(&s->files, 4, s->arena) ||
+ !upb_inttable_init(&s->exts, s->arena)) {
+ goto err;
}
+
+ s->extreg = upb_ExtensionRegistry_New(s->arena);
+ if (!s->extreg) goto err;
return s;
+
+err:
+ upb_Arena_Free(s->arena);
+ upb_gfree(s);
+ return NULL;
}
-const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym) {
+static const void* symtab_lookup(const upb_DefPool* s, const char* sym,
+ upb_deftype_t type) {
upb_value v;
- return upb_strtable_lookup(&s->syms, sym, &v) ?
- unpack_def(v, UPB_DEFTYPE_MSG) : NULL;
+ return upb_strtable_lookup(&s->syms, sym, &v) ? unpack_def(v, type) : NULL;
}
-const upb_msgdef *upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym,
- size_t len) {
+static const void* symtab_lookup2(const upb_DefPool* s, const char* sym,
+ size_t size, upb_deftype_t type) {
upb_value v;
- return upb_strtable_lookup2(&s->syms, sym, len, &v) ?
- unpack_def(v, UPB_DEFTYPE_MSG) : NULL;
+ return upb_strtable_lookup2(&s->syms, sym, size, &v) ? unpack_def(v, type)
+ : NULL;
+}
+
+const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s,
+ const char* sym) {
+ return symtab_lookup(s, sym, UPB_DEFTYPE_MSG);
+}
+
+const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
+ const upb_DefPool* s, const char* sym, size_t len) {
+ return symtab_lookup2(s, sym, len, UPB_DEFTYPE_MSG);
+}
+
+const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
+ const char* sym) {
+ return symtab_lookup(s, sym, UPB_DEFTYPE_ENUM);
+}
+
+const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
+ const char* sym) {
+ return symtab_lookup(s, sym, UPB_DEFTYPE_ENUMVAL);
}
-const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym) {
+const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
+ const char* name) {
upb_value v;
- return upb_strtable_lookup(&s->syms, sym, &v) ?
- unpack_def(v, UPB_DEFTYPE_ENUM) : NULL;
+ return upb_strtable_lookup(&s->files, name, &v)
+ ? unpack_def(v, UPB_DEFTYPE_FILE)
+ : NULL;
}
-const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name) {
+const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
+ const char* name,
+ size_t len) {
upb_value v;
- return upb_strtable_lookup(&s->files, name, &v) ? upb_value_getconstptr(v)
- : NULL;
+ return upb_strtable_lookup2(&s->files, name, len, &v)
+ ? unpack_def(v, UPB_DEFTYPE_FILE)
+ : NULL;
}
-const upb_filedef *upb_symtab_lookupfile2(
- const upb_symtab *s, const char *name, size_t len) {
+const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
+ const upb_DefPool* s, const char* name, size_t size) {
upb_value v;
- return upb_strtable_lookup2(&s->files, name, len, &v) ?
- upb_value_getconstptr(v) : NULL;
+ if (!upb_strtable_lookup2(&s->syms, name, size, &v)) return NULL;
+
+ switch (deftype(v)) {
+ case UPB_DEFTYPE_FIELD:
+ return unpack_def(v, UPB_DEFTYPE_FIELD);
+ case UPB_DEFTYPE_MSG: {
+ const upb_MessageDef* m = unpack_def(v, UPB_DEFTYPE_MSG);
+ return m->in_message_set ? &m->nested_exts[0] : NULL;
+ }
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
+ const char* sym) {
+ return upb_DefPool_FindExtensionByNameWithSize(s, sym, strlen(sym));
}
-int upb_symtab_filecount(const upb_symtab *s) {
- return (int)upb_strtable_count(&s->files);
+const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s,
+ const char* name) {
+ return symtab_lookup(s, name, UPB_DEFTYPE_SERVICE);
+}
+
+const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
+ const upb_DefPool* s, const char* name, size_t size) {
+ return symtab_lookup2(s, name, size, UPB_DEFTYPE_SERVICE);
+}
+
+const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
+ const char* name) {
+ upb_value v;
+ // TODO(haberman): non-extension fields and oneofs.
+ if (upb_strtable_lookup(&s->syms, name, &v)) {
+ switch (deftype(v)) {
+ case UPB_DEFTYPE_EXT: {
+ const upb_FieldDef* f = unpack_def(v, UPB_DEFTYPE_EXT);
+ return upb_FieldDef_File(f);
+ }
+ case UPB_DEFTYPE_MSG: {
+ const upb_MessageDef* m = unpack_def(v, UPB_DEFTYPE_MSG);
+ return upb_MessageDef_File(m);
+ }
+ case UPB_DEFTYPE_ENUM: {
+ const upb_EnumDef* e = unpack_def(v, UPB_DEFTYPE_ENUM);
+ return upb_EnumDef_File(e);
+ }
+ case UPB_DEFTYPE_ENUMVAL: {
+ const upb_EnumValueDef* ev = unpack_def(v, UPB_DEFTYPE_ENUMVAL);
+ return upb_EnumDef_File(upb_EnumValueDef_Enum(ev));
+ }
+ case UPB_DEFTYPE_SERVICE: {
+ const upb_ServiceDef* service = unpack_def(v, UPB_DEFTYPE_SERVICE);
+ return upb_ServiceDef_File(service);
+ }
+ default:
+ UPB_UNREACHABLE();
+ }
+ }
+
+ const char* last_dot = strrchr(name, '.');
+ if (last_dot) {
+ const upb_MessageDef* parent =
+ upb_DefPool_FindMessageByNameWithSize(s, name, last_dot - name);
+ if (parent) {
+ const char* shortname = last_dot + 1;
+ if (upb_MessageDef_FindByNameWithSize(parent, shortname,
+ strlen(shortname), NULL, NULL)) {
+ return upb_MessageDef_File(parent);
+ }
+ }
+ }
+
+ return NULL;
}
/* Code to build defs from descriptor protos. *********************************/
@@ -897,41 +1247,61 @@ int upb_symtab_filecount(const upb_symtab *s) {
* this code is used to directly build defs from Ruby (for example) we do need
* to validate important constraints like uniqueness of names and numbers. */
-#define CHK_OOM(x) if (!(x)) { symtab_oomerr(ctx); }
+#define CHK_OOM(x) \
+ if (!(x)) { \
+ symtab_oomerr(ctx); \
+ }
typedef struct {
- upb_symtab *symtab;
- upb_filedef *file; /* File we are building. */
- upb_arena *file_arena; /* Allocate defs here. */
- upb_alloc *alloc; /* Alloc of file_arena, for tables. */
- const upb_msglayout **layouts; /* NULL if we should build layouts. */
- upb_status *status; /* Record errors here. */
- jmp_buf err; /* longjmp() on error. */
+ upb_DefPool* symtab;
+ upb_FileDef* file; /* File we are building. */
+ upb_Arena* arena; /* Allocate defs here. */
+ upb_Arena* tmp_arena; /* For temporary allocations. */
+ const upb_MiniTable_File* layout; /* NULL if we should build layouts. */
+ int enum_count; /* Count of enums built so far. */
+ int msg_count; /* Count of messages built so far. */
+ int ext_count; /* Count of extensions built so far. */
+ upb_Status* status; /* Record errors here. */
+ jmp_buf err; /* longjmp() on error. */
} symtab_addctx;
-UPB_NORETURN UPB_NOINLINE
-static void symtab_errf(symtab_addctx *ctx, const char *fmt, ...) {
+UPB_NORETURN UPB_NOINLINE UPB_PRINTF(2, 3) static void symtab_errf(
+ symtab_addctx* ctx, const char* fmt, ...) {
va_list argp;
va_start(argp, fmt);
- upb_status_vseterrf(ctx->status, fmt, argp);
+ upb_Status_VSetErrorFormat(ctx->status, fmt, argp);
va_end(argp);
UPB_LONGJMP(ctx->err, 1);
}
-UPB_NORETURN UPB_NOINLINE
-static void symtab_oomerr(symtab_addctx *ctx) {
- upb_status_setoom(ctx->status);
+UPB_NORETURN UPB_NOINLINE static void symtab_oomerr(symtab_addctx* ctx) {
+ upb_Status_setoom(ctx->status);
UPB_LONGJMP(ctx->err, 1);
}
-void *symtab_alloc(symtab_addctx *ctx, size_t bytes) {
- void *ret = upb_arena_malloc(ctx->file_arena, bytes);
+void* symtab_alloc(symtab_addctx* ctx, size_t bytes) {
+ if (bytes == 0) return NULL;
+ void* ret = upb_Arena_Malloc(ctx->arena, bytes);
if (!ret) symtab_oomerr(ctx);
return ret;
}
-static void check_ident(symtab_addctx *ctx, upb_strview name, bool full) {
- const char *str = name.data;
+// We want to copy the options verbatim into the destination options proto.
+// We use serialize+parse as our deep copy.
+#define SET_OPTIONS(target, desc_type, options_type, proto) \
+ if (google_protobuf_##desc_type##_has_options(proto)) { \
+ size_t size; \
+ char* pb = google_protobuf_##options_type##_serialize( \
+ google_protobuf_##desc_type##_options(proto), ctx->tmp_arena, &size); \
+ CHK_OOM(pb); \
+ target = google_protobuf_##options_type##_parse(pb, size, ctx->arena); \
+ CHK_OOM(target); \
+ } else { \
+ target = (const google_protobuf_##options_type*)opt_default; \
+ }
+
+static void check_ident(symtab_addctx* ctx, upb_StringView name, bool full) {
+ const char* str = name.data;
size_t len = name.size;
bool start = true;
size_t i;
@@ -962,119 +1332,223 @@ static void check_ident(symtab_addctx *ctx, upb_strview name, bool full) {
}
}
-static size_t div_round_up(size_t n, size_t d) {
- return (n + d - 1) / d;
-}
+static size_t div_round_up(size_t n, size_t d) { return (n + d - 1) / d; }
-static size_t upb_msgval_sizeof(upb_fieldtype_t type) {
+static size_t upb_MessageValue_sizeof(upb_CType type) {
switch (type) {
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT64:
+ case kUpb_CType_Double:
+ case kUpb_CType_Int64:
+ case kUpb_CType_UInt64:
return 8;
- case UPB_TYPE_ENUM:
- case UPB_TYPE_INT32:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_FLOAT:
+ case kUpb_CType_Enum:
+ case kUpb_CType_Int32:
+ case kUpb_CType_UInt32:
+ case kUpb_CType_Float:
return 4;
- case UPB_TYPE_BOOL:
+ case kUpb_CType_Bool:
return 1;
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Message:
return sizeof(void*);
- case UPB_TYPE_BYTES:
- case UPB_TYPE_STRING:
- return sizeof(upb_strview);
+ case kUpb_CType_Bytes:
+ case kUpb_CType_String:
+ return sizeof(upb_StringView);
}
UPB_UNREACHABLE();
}
-static uint8_t upb_msg_fielddefsize(const upb_fielddef *f) {
- if (upb_msgdef_mapentry(upb_fielddef_containingtype(f))) {
- upb_map_entry ent;
+static uint8_t upb_msg_fielddefsize(const upb_FieldDef* f) {
+ if (upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f))) {
+ upb_MapEntry ent;
UPB_ASSERT(sizeof(ent.k) == sizeof(ent.v));
return sizeof(ent.k);
- } else if (upb_fielddef_isseq(f)) {
+ } else if (upb_FieldDef_IsRepeated(f)) {
return sizeof(void*);
} else {
- return upb_msgval_sizeof(upb_fielddef_type(f));
+ return upb_MessageValue_sizeof(upb_FieldDef_CType(f));
}
}
-static uint32_t upb_msglayout_place(upb_msglayout *l, size_t size) {
- uint32_t ret;
+static uint32_t upb_MiniTable_place(symtab_addctx* ctx, upb_MiniTable* l,
+ size_t size, const upb_MessageDef* m) {
+ size_t ofs = UPB_ALIGN_UP(l->size, size);
+ size_t next = ofs + size;
- l->size = UPB_ALIGN_UP(l->size, size);
- ret = l->size;
- l->size += size;
- return ret;
+ if (next > UINT16_MAX) {
+ symtab_errf(ctx, "size of message %s exceeded max size of %zu bytes",
+ upb_MessageDef_FullName(m), (size_t)UINT16_MAX);
+ }
+
+ l->size = next;
+ return ofs;
}
-static int field_number_cmp(const void *p1, const void *p2) {
- const upb_msglayout_field *f1 = p1;
- const upb_msglayout_field *f2 = p2;
+static int field_number_cmp(const void* p1, const void* p2) {
+ const upb_MiniTable_Field* f1 = p1;
+ const upb_MiniTable_Field* f2 = p2;
return f1->number - f2->number;
}
-static void assign_layout_indices(const upb_msgdef *m, upb_msglayout_field *fields) {
+static void assign_layout_indices(const upb_MessageDef* m, upb_MiniTable* l,
+ upb_MiniTable_Field* fields) {
int i;
- int n = upb_msgdef_numfields(m);
+ int n = upb_MessageDef_numfields(m);
+ int dense_below = 0;
for (i = 0; i < n; i++) {
- upb_fielddef *f = (upb_fielddef*)upb_msgdef_itof(m, fields[i].number);
+ upb_FieldDef* f =
+ (upb_FieldDef*)upb_MessageDef_FindFieldByNumber(m, fields[i].number);
UPB_ASSERT(f);
f->layout_index = i;
+ if (i < UINT8_MAX && fields[i].number == i + 1 &&
+ (i == 0 || fields[i - 1].number == i)) {
+ dense_below = i + 1;
+ }
+ }
+ l->dense_below = dense_below;
+}
+
+static uint8_t map_descriptortype(const upb_FieldDef* f) {
+ uint8_t type = upb_FieldDef_Type(f);
+ /* See TableDescriptorType() in upbc/generator.cc for details and
+ * rationale of these exceptions. */
+ if (type == kUpb_FieldType_String && f->file->syntax == kUpb_Syntax_Proto2) {
+ return kUpb_FieldType_Bytes;
+ } else if (type == kUpb_FieldType_Enum &&
+ (f->sub.enumdef->file->syntax == kUpb_Syntax_Proto3 ||
+ UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 ||
+ // TODO(https://github.com/protocolbuffers/upb/issues/541):
+ // fix map enum values to check for unknown enum values and put
+ // them in the unknown field set.
+ upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f)))) {
+ return kUpb_FieldType_Int32;
+ }
+ return type;
+}
+
+static void fill_fieldlayout(upb_MiniTable_Field* field,
+ const upb_FieldDef* f) {
+ field->number = upb_FieldDef_Number(f);
+ field->descriptortype = map_descriptortype(f);
+
+ if (upb_FieldDef_IsMap(f)) {
+ field->mode =
+ kUpb_FieldMode_Map | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ field->mode =
+ kUpb_FieldMode_Array | (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift);
+ } else {
+ /* Maps descriptor type -> elem_size_lg2. */
+ static const uint8_t sizes[] = {
+ -1, /* invalid descriptor type */
+ kUpb_FieldRep_8Byte, /* DOUBLE */
+ kUpb_FieldRep_4Byte, /* FLOAT */
+ kUpb_FieldRep_8Byte, /* INT64 */
+ kUpb_FieldRep_8Byte, /* UINT64 */
+ kUpb_FieldRep_4Byte, /* INT32 */
+ kUpb_FieldRep_8Byte, /* FIXED64 */
+ kUpb_FieldRep_4Byte, /* FIXED32 */
+ kUpb_FieldRep_1Byte, /* BOOL */
+ kUpb_FieldRep_StringView, /* STRING */
+ kUpb_FieldRep_Pointer, /* GROUP */
+ kUpb_FieldRep_Pointer, /* MESSAGE */
+ kUpb_FieldRep_StringView, /* BYTES */
+ kUpb_FieldRep_4Byte, /* UINT32 */
+ kUpb_FieldRep_4Byte, /* ENUM */
+ kUpb_FieldRep_4Byte, /* SFIXED32 */
+ kUpb_FieldRep_8Byte, /* SFIXED64 */
+ kUpb_FieldRep_4Byte, /* SINT32 */
+ kUpb_FieldRep_8Byte, /* SINT64 */
+ };
+ field->mode = kUpb_FieldMode_Scalar |
+ (sizes[field->descriptortype] << kUpb_FieldRep_Shift);
+ }
+
+ if (upb_FieldDef_IsPacked(f)) {
+ field->mode |= kUpb_LabelFlags_IsPacked;
+ }
+
+ if (upb_FieldDef_IsExtension(f)) {
+ field->mode |= kUpb_LabelFlags_IsExtension;
}
}
/* This function is the dynamic equivalent of message_layout.{cc,h} in upbc.
* It computes a dynamic layout for all of the fields in |m|. */
-static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
- upb_msglayout *l = (upb_msglayout*)m->layout;
- upb_msg_field_iter it;
- upb_msg_oneof_iter oit;
- size_t hasbit;
- size_t submsg_count = m->submsg_field_count;
- const upb_msglayout **submsgs;
- upb_msglayout_field *fields;
-
- memset(l, 0, sizeof(*l) + sizeof(_upb_fasttable_entry));
+static void make_layout(symtab_addctx* ctx, const upb_MessageDef* m) {
+ upb_MiniTable* l = (upb_MiniTable*)m->layout;
+ size_t field_count = upb_MessageDef_numfields(m);
+ size_t sublayout_count = 0;
+ upb_MiniTable_Sub* subs;
+ upb_MiniTable_Field* fields;
+
+ memset(l, 0, sizeof(*l) + sizeof(_upb_FastTable_Entry));
+
+ /* Count sub-messages. */
+ for (size_t i = 0; i < field_count; i++) {
+ const upb_FieldDef* f = &m->fields[i];
+ if (upb_FieldDef_IsSubMessage(f)) {
+ sublayout_count++;
+ }
+ if (upb_FieldDef_CType(f) == kUpb_CType_Enum &&
+ f->sub.enumdef->file->syntax == kUpb_Syntax_Proto2) {
+ sublayout_count++;
+ }
+ }
- fields = symtab_alloc(ctx, upb_msgdef_numfields(m) * sizeof(*fields));
- submsgs = symtab_alloc(ctx, submsg_count * sizeof(*submsgs));
+ fields = symtab_alloc(ctx, field_count * sizeof(*fields));
+ subs = symtab_alloc(ctx, sublayout_count * sizeof(*subs));
- l->field_count = upb_msgdef_numfields(m);
+ l->field_count = upb_MessageDef_numfields(m);
l->fields = fields;
- l->submsgs = submsgs;
+ l->subs = subs;
l->table_mask = 0;
+ l->required_count = 0;
+
+ if (upb_MessageDef_ExtensionRangeCount(m) > 0) {
+ if (google_protobuf_MessageOptions_message_set_wire_format(m->opts)) {
+ l->ext = kUpb_ExtMode_IsMessageSet;
+ } else {
+ l->ext = kUpb_ExtMode_Extendable;
+ }
+ } else {
+ l->ext = kUpb_ExtMode_NonExtendable;
+ }
/* TODO(haberman): initialize fast tables so that reflection-based parsing
* can get the same speeds as linked-in types. */
l->fasttable[0].field_parser = &fastdecode_generic;
l->fasttable[0].field_data = 0;
- if (upb_msgdef_mapentry(m)) {
+ if (upb_MessageDef_IsMapEntry(m)) {
/* TODO(haberman): refactor this method so this special case is more
* elegant. */
- const upb_fielddef *key = upb_msgdef_itof(m, 1);
- const upb_fielddef *val = upb_msgdef_itof(m, 2);
+ const upb_FieldDef* key = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_FieldDef* val = upb_MessageDef_FindFieldByNumber(m, 2);
fields[0].number = 1;
fields[1].number = 2;
- fields[0].label = UPB_LABEL_OPTIONAL;
- fields[1].label = UPB_LABEL_OPTIONAL;
+ fields[0].mode = kUpb_FieldMode_Scalar;
+ fields[1].mode = kUpb_FieldMode_Scalar;
fields[0].presence = 0;
fields[1].presence = 0;
- fields[0].descriptortype = upb_fielddef_descriptortype(key);
- fields[1].descriptortype = upb_fielddef_descriptortype(val);
+ fields[0].descriptortype = map_descriptortype(key);
+ fields[1].descriptortype = map_descriptortype(val);
fields[0].offset = 0;
- fields[1].offset = sizeof(upb_strview);
+ fields[1].offset = sizeof(upb_StringView);
fields[1].submsg_index = 0;
- if (upb_fielddef_type(val) == UPB_TYPE_MESSAGE) {
- submsgs[0] = upb_fielddef_msgsubdef(val)->layout;
+ if (upb_FieldDef_CType(val) == kUpb_CType_Message) {
+ subs[0].submsg = upb_FieldDef_MessageSubDef(val)->layout;
}
+ upb_FieldDef* fielddefs = (upb_FieldDef*)&m->fields[0];
+ UPB_ASSERT(fielddefs[0].number_ == 1);
+ UPB_ASSERT(fielddefs[1].number_ == 2);
+ fielddefs[0].layout_index = 0;
+ fielddefs[1].layout_index = 1;
+
l->field_count = 2;
- l->size = 2 * sizeof(upb_strview);
+ l->size = 2 * sizeof(upb_StringView);
l->size = UPB_ALIGN_UP(l->size, 8);
+ l->dense_below = 2;
return;
}
@@ -1087,38 +1561,44 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
* OPT: There is a lot of room for optimization here to minimize the size.
*/
- /* Allocate hasbits and set basic field attributes. */
- submsg_count = 0;
- for (upb_msg_field_begin(&it, m), hasbit = 0;
- !upb_msg_field_done(&it);
- upb_msg_field_next(&it)) {
- upb_fielddef* f = upb_msg_iter_field(&it);
- upb_msglayout_field *field = &fields[upb_fielddef_index(f)];
-
- field->number = upb_fielddef_number(f);
- field->descriptortype = upb_fielddef_descriptortype(f);
- field->label = upb_fielddef_label(f);
-
- if (field->descriptortype == UPB_DTYPE_STRING &&
- f->file->syntax == UPB_SYNTAX_PROTO2) {
- /* See TableDescriptorType() in upbc/generator.cc for details and
- * rationale. */
- field->descriptortype = UPB_DTYPE_BYTES;
- }
+ /* Assign hasbits for required fields first. */
+ size_t hasbit = 0;
- if (upb_fielddef_ismap(f)) {
- field->label = _UPB_LABEL_MAP;
- } else if (upb_fielddef_packed(f)) {
- field->label = _UPB_LABEL_PACKED;
+ for (int i = 0; i < m->field_count; i++) {
+ const upb_FieldDef* f = &m->fields[i];
+ upb_MiniTable_Field* field = &fields[upb_FieldDef_Index(f)];
+ if (upb_FieldDef_Label(f) == kUpb_Label_Required) {
+ field->presence = ++hasbit;
+ if (hasbit >= 63) {
+ symtab_errf(ctx, "Message with >=63 required fields: %s",
+ upb_MessageDef_FullName(m));
+ }
+ l->required_count++;
}
+ }
- if (upb_fielddef_issubmsg(f)) {
- const upb_msgdef *subm = upb_fielddef_msgsubdef(f);
- field->submsg_index = submsg_count++;
- submsgs[field->submsg_index] = subm->layout;
+ /* Allocate hasbits and set basic field attributes. */
+ sublayout_count = 0;
+ for (int i = 0; i < m->field_count; i++) {
+ const upb_FieldDef* f = &m->fields[i];
+ upb_MiniTable_Field* field = &fields[upb_FieldDef_Index(f)];
+
+ fill_fieldlayout(field, f);
+
+ if (field->descriptortype == kUpb_FieldType_Message ||
+ field->descriptortype == kUpb_FieldType_Group) {
+ field->submsg_index = sublayout_count++;
+ subs[field->submsg_index].submsg = upb_FieldDef_MessageSubDef(f)->layout;
+ } else if (field->descriptortype == kUpb_FieldType_Enum) {
+ field->submsg_index = sublayout_count++;
+ subs[field->submsg_index].subenum = upb_FieldDef_EnumSubDef(f)->layout;
+ UPB_ASSERT(subs[field->submsg_index].subenum);
}
- if (upb_fielddef_haspresence(f) && !upb_fielddef_realcontainingoneof(f)) {
+ if (upb_FieldDef_Label(f) == kUpb_Label_Required) {
+ /* Hasbit was already assigned. */
+ } else if (upb_FieldDef_HasPresence(f) &&
+ !upb_FieldDef_RealContainingOneof(f)) {
/* We don't use hasbit 0, so that 0 can indicate "no presence" in the
* table. This wastes one hasbit, but we don't worry about it for now. */
field->presence = ++hasbit;
@@ -1128,55 +1608,51 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
}
/* Account for space used by hasbits. */
- l->size = div_round_up(hasbit, 8);
+ l->size = hasbit ? div_round_up(hasbit + 1, 8) : 0;
/* Allocate non-oneof fields. */
- for (upb_msg_field_begin(&it, m); !upb_msg_field_done(&it);
- upb_msg_field_next(&it)) {
- const upb_fielddef* f = upb_msg_iter_field(&it);
+ for (int i = 0; i < m->field_count; i++) {
+ const upb_FieldDef* f = &m->fields[i];
size_t field_size = upb_msg_fielddefsize(f);
- size_t index = upb_fielddef_index(f);
+ size_t index = upb_FieldDef_Index(f);
- if (upb_fielddef_realcontainingoneof(f)) {
+ if (upb_FieldDef_RealContainingOneof(f)) {
/* Oneofs are handled separately below. */
continue;
}
- fields[index].offset = upb_msglayout_place(l, field_size);
+ fields[index].offset = upb_MiniTable_place(ctx, l, field_size, m);
}
/* Allocate oneof fields. Each oneof field consists of a uint32 for the case
* and space for the actual data. */
- for (upb_msg_oneof_begin(&oit, m); !upb_msg_oneof_done(&oit);
- upb_msg_oneof_next(&oit)) {
- const upb_oneofdef* o = upb_msg_iter_oneof(&oit);
- upb_oneof_iter fit;
-
- size_t case_size = sizeof(uint32_t); /* Could potentially optimize this. */
+ for (int i = 0; i < m->oneof_count; i++) {
+ const upb_OneofDef* o = &m->oneofs[i];
+ size_t case_size = sizeof(uint32_t); /* Could potentially optimize this. */
size_t field_size = 0;
uint32_t case_offset;
uint32_t data_offset;
- if (upb_oneofdef_issynthetic(o)) continue;
+ if (upb_OneofDef_IsSynthetic(o)) continue;
+
+ if (o->field_count == 0) {
+ symtab_errf(ctx, "Oneof must have at least one field (%s)", o->full_name);
+ }
/* Calculate field size: the max of all field sizes. */
- for (upb_oneof_begin(&fit, o);
- !upb_oneof_done(&fit);
- upb_oneof_next(&fit)) {
- const upb_fielddef* f = upb_oneof_iter_field(&fit);
+ for (int j = 0; j < o->field_count; j++) {
+ const upb_FieldDef* f = o->fields[j];
field_size = UPB_MAX(field_size, upb_msg_fielddefsize(f));
}
/* Align and allocate case offset. */
- case_offset = upb_msglayout_place(l, case_size);
- data_offset = upb_msglayout_place(l, field_size);
+ case_offset = upb_MiniTable_place(ctx, l, case_size, m);
+ data_offset = upb_MiniTable_place(ctx, l, field_size, m);
- for (upb_oneof_begin(&fit, o);
- !upb_oneof_done(&fit);
- upb_oneof_next(&fit)) {
- const upb_fielddef* f = upb_oneof_iter_field(&fit);
- fields[upb_fielddef_index(f)].offset = data_offset;
- fields[upb_fielddef_index(f)].presence = ~case_offset;
+ for (int i = 0; i < o->field_count; i++) {
+ const upb_FieldDef* f = o->fields[i];
+ fields[upb_FieldDef_Index(f)].offset = data_offset;
+ fields[upb_FieldDef_Index(f)].presence = ~case_offset;
}
}
@@ -1185,71 +1661,33 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
l->size = UPB_ALIGN_UP(l->size, 8);
/* Sort fields by number. */
- qsort(fields, upb_msgdef_numfields(m), sizeof(*fields), field_number_cmp);
- assign_layout_indices(m, fields);
-}
-
-static void assign_msg_indices(symtab_addctx *ctx, upb_msgdef *m) {
- /* Sort fields. upb internally relies on UPB_TYPE_MESSAGE fields having the
- * lowest indexes, but we do not publicly guarantee this. */
- upb_msg_field_iter j;
- int i;
- uint32_t selector;
- int n = upb_msgdef_numfields(m);
- upb_fielddef **fields;
-
- if (n == 0) {
- m->selector_count = UPB_STATIC_SELECTOR_COUNT;
- m->submsg_field_count = 0;
- return;
+ if (fields) {
+ qsort(fields, upb_MessageDef_numfields(m), sizeof(*fields),
+ field_number_cmp);
}
-
- fields = upb_gmalloc(n * sizeof(*fields));
-
- m->submsg_field_count = 0;
- for(i = 0, upb_msg_field_begin(&j, m);
- !upb_msg_field_done(&j);
- upb_msg_field_next(&j), i++) {
- upb_fielddef *f = upb_msg_iter_field(&j);
- UPB_ASSERT(f->msgdef == m);
- if (upb_fielddef_issubmsg(f)) {
- m->submsg_field_count++;
- }
- fields[i] = f;
- }
-
- qsort(fields, n, sizeof(*fields), cmp_fields);
-
- selector = UPB_STATIC_SELECTOR_COUNT + m->submsg_field_count;
- for (i = 0; i < n; i++) {
- upb_fielddef *f = fields[i];
- f->index_ = i;
- f->selector_base = selector + upb_handlers_selectorbaseoffset(f);
- selector += upb_handlers_selectorcount(f);
- }
- m->selector_count = selector;
-
- upb_gfree(fields);
+ assign_layout_indices(m, l, fields);
}
-static char *strviewdup(symtab_addctx *ctx, upb_strview view) {
- return upb_strdup2(view.data, view.size, ctx->alloc);
+static char* strviewdup(symtab_addctx* ctx, upb_StringView view) {
+ char* ret = upb_strdup2(view.data, view.size, ctx->arena);
+ CHK_OOM(ret);
+ return ret;
}
-static bool streql2(const char *a, size_t n, const char *b) {
+static bool streql2(const char* a, size_t n, const char* b) {
return n == strlen(b) && memcmp(a, b, n) == 0;
}
-static bool streql_view(upb_strview view, const char *b) {
+static bool streql_view(upb_StringView view, const char* b) {
return streql2(view.data, view.size, b);
}
-static const char *makefullname(symtab_addctx *ctx, const char *prefix,
- upb_strview name) {
+static const char* makefullname(symtab_addctx* ctx, const char* prefix,
+ upb_StringView name) {
if (prefix) {
/* ret = prefix + '.' + name; */
size_t n = strlen(prefix);
- char *ret = symtab_alloc(ctx, n + name.size + 2);
+ char* ret = symtab_alloc(ctx, n + name.size + 2);
strcpy(ret, prefix);
ret[n] = '.';
memcpy(&ret[n + 1], name.data, name.size);
@@ -1260,33 +1698,33 @@ static const char *makefullname(symtab_addctx *ctx, const char *prefix,
}
}
-static void finalize_oneofs(symtab_addctx *ctx, upb_msgdef *m) {
+static void finalize_oneofs(symtab_addctx* ctx, upb_MessageDef* m) {
int i;
int synthetic_count = 0;
- upb_oneofdef *mutable_oneofs = (upb_oneofdef*)m->oneofs;
+ upb_OneofDef* mutable_oneofs = (upb_OneofDef*)m->oneofs;
for (i = 0; i < m->oneof_count; i++) {
- upb_oneofdef *o = &mutable_oneofs[i];
+ upb_OneofDef* o = &mutable_oneofs[i];
if (o->synthetic && o->field_count != 1) {
symtab_errf(ctx, "Synthetic oneofs must have one field, not %d: %s",
- o->field_count, upb_oneofdef_name(o));
+ o->field_count, upb_OneofDef_Name(o));
}
if (o->synthetic) {
synthetic_count++;
} else if (synthetic_count != 0) {
symtab_errf(ctx, "Synthetic oneofs must be after all other oneofs: %s",
- upb_oneofdef_name(o));
+ upb_OneofDef_Name(o));
}
- o->fields = symtab_alloc(ctx, sizeof(upb_fielddef *) * o->field_count);
+ o->fields = symtab_alloc(ctx, sizeof(upb_FieldDef*) * o->field_count);
o->field_count = 0;
}
for (i = 0; i < m->field_count; i++) {
- const upb_fielddef *f = &m->fields[i];
- upb_oneofdef *o = (upb_oneofdef*)f->oneof;
+ const upb_FieldDef* f = &m->fields[i];
+ upb_OneofDef* o = (upb_OneofDef*)upb_FieldDef_ContainingOneof(f);
if (o) {
o->fields[o->field_count++] = f;
}
@@ -1295,14 +1733,16 @@ static void finalize_oneofs(symtab_addctx *ctx, upb_msgdef *m) {
m->real_oneof_count = m->oneof_count - synthetic_count;
}
-size_t getjsonname(const char *name, char *buf, size_t len) {
+size_t getjsonname(const char* name, char* buf, size_t len) {
size_t src, dst = 0;
bool ucase_next = false;
-#define WRITE(byte) \
- ++dst; \
- if (dst < len) buf[dst - 1] = byte; \
- else if (dst == len) buf[dst - 1] = '\0'
+#define WRITE(byte) \
+ ++dst; \
+ if (dst < len) \
+ buf[dst - 1] = byte; \
+ else if (dst == len) \
+ buf[dst - 1] = '\0'
if (!name) {
WRITE('\0');
@@ -1333,98 +1773,290 @@ size_t getjsonname(const char *name, char *buf, size_t len) {
#undef WRITE
}
-static char* makejsonname(symtab_addctx *ctx, const char* name) {
+static char* makejsonname(symtab_addctx* ctx, const char* name) {
size_t size = getjsonname(name, NULL, 0);
char* json_name = symtab_alloc(ctx, size);
getjsonname(name, json_name, size);
return json_name;
}
-static void symtab_add(symtab_addctx *ctx, const char *name, upb_value v) {
+/* Adds a symbol |v| to the symtab, which must be a def pointer previously
+ * packed with pack_def(). The def's pointer to upb_FileDef* must be set before
+ * adding, so we know which entries to remove if building this file fails. */
+static void symtab_add(symtab_addctx* ctx, const char* name, upb_value v) {
+ // TODO: table should support an operation "tryinsert" to avoid the double
+ // lookup.
if (upb_strtable_lookup(&ctx->symtab->syms, name, NULL)) {
symtab_errf(ctx, "duplicate symbol '%s'", name);
}
- upb_alloc *alloc = upb_arena_alloc(ctx->symtab->arena);
size_t len = strlen(name);
- CHK_OOM(upb_strtable_insert3(&ctx->symtab->syms, name, len, v, alloc));
+ CHK_OOM(upb_strtable_insert(&ctx->symtab->syms, name, len, v,
+ ctx->symtab->arena));
+}
+
+static bool remove_component(char* base, size_t* len) {
+ if (*len == 0) return false;
+
+ for (size_t i = *len - 1; i > 0; i--) {
+ if (base[i] == '.') {
+ *len = i;
+ return true;
+ }
+ }
+
+ *len = 0;
+ return true;
}
/* Given a symbol and the base symbol inside which it is defined, find the
* symbol's definition in t. */
-static const void *symtab_resolve(symtab_addctx *ctx, const upb_fielddef *f,
- const char *base, upb_strview sym,
- upb_deftype_t type) {
- const upb_strtable *t = &ctx->symtab->syms;
- if(sym.size == 0) goto notfound;
- if(sym.data[0] == '.') {
+static const void* symtab_resolveany(symtab_addctx* ctx,
+ const char* from_name_dbg,
+ const char* base, upb_StringView sym,
+ upb_deftype_t* type) {
+ const upb_strtable* t = &ctx->symtab->syms;
+ if (sym.size == 0) goto notfound;
+ upb_value v;
+ if (sym.data[0] == '.') {
/* Symbols starting with '.' are absolute, so we do a single lookup.
* Slice to omit the leading '.' */
- upb_value v;
if (!upb_strtable_lookup2(t, sym.data + 1, sym.size - 1, &v)) {
goto notfound;
}
-
- const void *ret = unpack_def(v, type);
- if (!ret) {
- symtab_errf(ctx, "type mismatch when resolving field %s, name %s",
- f->full_name, sym.data);
- }
- return ret;
} else {
- /* Remove components from base until we find an entry or run out.
- * TODO: This branch is totally broken, but currently not used. */
- (void)base;
- UPB_ASSERT(false);
- goto notfound;
+ /* Remove components from base until we find an entry or run out. */
+ size_t baselen = base ? strlen(base) : 0;
+ char* tmp = malloc(sym.size + baselen + 1);
+ while (1) {
+ char* p = tmp;
+ if (baselen) {
+ memcpy(p, base, baselen);
+ p[baselen] = '.';
+ p += baselen + 1;
+ }
+ memcpy(p, sym.data, sym.size);
+ p += sym.size;
+ if (upb_strtable_lookup2(t, tmp, p - tmp, &v)) {
+ break;
+ }
+ if (!remove_component(tmp, &baselen)) {
+ free(tmp);
+ goto notfound;
+ }
+ }
+ free(tmp);
}
+ *type = deftype(v);
+ return unpack_def(v, *type);
+
notfound:
- symtab_errf(ctx, "couldn't resolve name '%s'", sym.data);
+ symtab_errf(ctx, "couldn't resolve name '" UPB_STRINGVIEW_FORMAT "'",
+ UPB_STRINGVIEW_ARGS(sym));
+}
+
+static const void* symtab_resolve(symtab_addctx* ctx, const char* from_name_dbg,
+ const char* base, upb_StringView sym,
+ upb_deftype_t type) {
+ upb_deftype_t found_type;
+ const void* ret =
+ symtab_resolveany(ctx, from_name_dbg, base, sym, &found_type);
+ if (ret && found_type != type) {
+ symtab_errf(ctx,
+ "type mismatch when resolving %s: couldn't find "
+ "name " UPB_STRINGVIEW_FORMAT " with type=%d",
+ from_name_dbg, UPB_STRINGVIEW_ARGS(sym), (int)type);
+ }
+ return ret;
}
static void create_oneofdef(
- symtab_addctx *ctx, upb_msgdef *m,
- const google_protobuf_OneofDescriptorProto *oneof_proto) {
- upb_oneofdef *o;
- upb_strview name = google_protobuf_OneofDescriptorProto_name(oneof_proto);
+ symtab_addctx* ctx, upb_MessageDef* m,
+ const google_protobuf_OneofDescriptorProto* oneof_proto,
+ const upb_OneofDef* _o) {
+ upb_OneofDef* o = (upb_OneofDef*)_o;
+ upb_StringView name = google_protobuf_OneofDescriptorProto_name(oneof_proto);
upb_value v;
- o = (upb_oneofdef*)&m->oneofs[m->oneof_count++];
o->parent = m;
o->full_name = makefullname(ctx, m->full_name, name);
o->field_count = 0;
o->synthetic = false;
+ SET_OPTIONS(o->opts, OneofDescriptorProto, OneofOptions, oneof_proto);
+
+ upb_value existing_v;
+ if (upb_strtable_lookup2(&m->ntof, name.data, name.size, &existing_v)) {
+ symtab_errf(ctx, "duplicate oneof name (%s)", o->full_name);
+ }
+
v = pack_def(o, UPB_DEFTYPE_ONEOF);
- symtab_add(ctx, o->full_name, v);
- CHK_OOM(upb_strtable_insert3(&m->ntof, name.data, name.size, v, ctx->alloc));
+ CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, v, ctx->arena));
- CHK_OOM(upb_inttable_init2(&o->itof, UPB_CTYPE_CONSTPTR, ctx->alloc));
- CHK_OOM(upb_strtable_init2(&o->ntof, UPB_CTYPE_CONSTPTR, 4, ctx->alloc));
+ CHK_OOM(upb_inttable_init(&o->itof, ctx->arena));
+ CHK_OOM(upb_strtable_init(&o->ntof, 4, ctx->arena));
}
-static str_t *newstr(symtab_addctx *ctx, const char *data, size_t len) {
- str_t *ret = symtab_alloc(ctx, sizeof(*ret) + len);
- if (!ret) return NULL;
+static str_t* newstr(symtab_addctx* ctx, const char* data, size_t len) {
+ str_t* ret = symtab_alloc(ctx, sizeof(*ret) + len);
+ CHK_OOM(ret);
ret->len = len;
if (len) memcpy(ret->str, data, len);
ret->str[len] = '\0';
return ret;
}
-static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
- upb_fielddef *f) {
- char *end;
+static bool upb_DefPool_TryGetChar(const char** src, const char* end,
+ char* ch) {
+ if (*src == end) return false;
+ *ch = **src;
+ *src += 1;
+ return true;
+}
+
+static char upb_DefPool_TryGetHexDigit(symtab_addctx* ctx,
+ const upb_FieldDef* f, const char** src,
+ const char* end) {
+ char ch;
+ if (!upb_DefPool_TryGetChar(src, end, &ch)) return -1;
+ if ('0' <= ch && ch <= '9') {
+ return ch - '0';
+ }
+ ch = upb_ascii_lower(ch);
+ if ('a' <= ch && ch <= 'f') {
+ return ch - 'a' + 0xa;
+ }
+ *src -= 1; // Char wasn't actually a hex digit.
+ return -1;
+}
+
+static char upb_DefPool_ParseHexEscape(symtab_addctx* ctx,
+ const upb_FieldDef* f, const char** src,
+ const char* end) {
+ char hex_digit = upb_DefPool_TryGetHexDigit(ctx, f, src, end);
+ if (hex_digit < 0) {
+ symtab_errf(ctx,
+ "\\x cannot be followed by non-hex digit in field '%s' default",
+ upb_FieldDef_FullName(f));
+ return 0;
+ }
+ unsigned int ret = hex_digit;
+ while ((hex_digit = upb_DefPool_TryGetHexDigit(ctx, f, src, end)) >= 0) {
+ ret = (ret << 4) | hex_digit;
+ }
+ if (ret > 0xff) {
+ symtab_errf(ctx, "Value of hex escape in field %s exceeds 8 bits",
+ upb_FieldDef_FullName(f));
+ return 0;
+ }
+ return ret;
+}
+
+char upb_DefPool_TryGetOctalDigit(const char** src, const char* end) {
+ char ch;
+ if (!upb_DefPool_TryGetChar(src, end, &ch)) return -1;
+ if ('0' <= ch && ch <= '7') {
+ return ch - '0';
+ }
+ *src -= 1; // Char wasn't actually an octal digit.
+ return -1;
+}
+
+static char upb_DefPool_ParseOctalEscape(symtab_addctx* ctx,
+ const upb_FieldDef* f,
+ const char** src, const char* end) {
+ char ch = 0;
+ for (int i = 0; i < 3; i++) {
+ char digit;
+ if ((digit = upb_DefPool_TryGetOctalDigit(src, end)) >= 0) {
+ ch = (ch << 3) | digit;
+ }
+ }
+ return ch;
+}
+
+static char upb_DefPool_ParseEscape(symtab_addctx* ctx, const upb_FieldDef* f,
+ const char** src, const char* end) {
+ char ch;
+ if (!upb_DefPool_TryGetChar(src, end, &ch)) {
+ symtab_errf(ctx, "unterminated escape sequence in field %s",
+ upb_FieldDef_FullName(f));
+ return 0;
+ }
+ switch (ch) {
+ case 'a':
+ return '\a';
+ case 'b':
+ return '\b';
+ case 'f':
+ return '\f';
+ case 'n':
+ return '\n';
+ case 'r':
+ return '\r';
+ case 't':
+ return '\t';
+ case 'v':
+ return '\v';
+ case '\\':
+ return '\\';
+ case '\'':
+ return '\'';
+ case '\"':
+ return '\"';
+ case '?':
+ return '\?';
+ case 'x':
+ case 'X':
+ return upb_DefPool_ParseHexEscape(ctx, f, src, end);
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ *src -= 1;
+ return upb_DefPool_ParseOctalEscape(ctx, f, src, end);
+ }
+ symtab_errf(ctx, "Unknown escape sequence: \\%c", ch);
+}
+
+static str_t* unescape(symtab_addctx* ctx, const upb_FieldDef* f,
+ const char* data, size_t len) {
+ // Size here is an upper bound; escape sequences could ultimately shrink it.
+ str_t* ret = symtab_alloc(ctx, sizeof(*ret) + len);
+ char* dst = &ret->str[0];
+ const char* src = data;
+ const char* end = data + len;
+
+ while (src < end) {
+ if (*src == '\\') {
+ src++;
+ *dst++ = upb_DefPool_ParseEscape(ctx, f, &src, end);
+ } else {
+ *dst++ = *src++;
+ }
+ }
+
+ ret->len = dst - &ret->str[0];
+ return ret;
+}
+
+static void parse_default(symtab_addctx* ctx, const char* str, size_t len,
+ upb_FieldDef* f) {
+ char* end;
char nullz[64];
errno = 0;
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_FLOAT:
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Int32:
+ case kUpb_CType_Int64:
+ case kUpb_CType_UInt32:
+ case kUpb_CType_UInt64:
+ case kUpb_CType_Double:
+ case kUpb_CType_Float:
/* Standard C number parsing functions expect null-terminated strings. */
if (len >= sizeof(nullz) - 1) {
symtab_errf(ctx, "Default too long: %.*s", (int)len, str);
@@ -1437,8 +2069,8 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
break;
}
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32: {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Int32: {
long val = strtol(str, &end, 0);
if (val > INT32_MAX || val < INT32_MIN || errno == ERANGE || *end) {
goto invalid;
@@ -1446,25 +2078,25 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
f->defaultval.sint = val;
break;
}
- case UPB_TYPE_ENUM: {
- const upb_enumdef *e = f->sub.enumdef;
- int32_t val;
- if (!upb_enumdef_ntoi(e, str, len, &val)) {
+ case kUpb_CType_Enum: {
+ const upb_EnumDef* e = f->sub.enumdef;
+ const upb_EnumValueDef* ev =
+ upb_EnumDef_FindValueByNameWithSize(e, str, len);
+ if (!ev) {
goto invalid;
}
- f->defaultval.sint = val;
+ f->defaultval.sint = ev->number;
break;
}
- case UPB_TYPE_INT64: {
- /* XXX: Need to write our own strtoll, since it's not available in c89. */
- int64_t val = strtol(str, &end, 0);
+ case kUpb_CType_Int64: {
+ long long val = strtoll(str, &end, 0);
if (val > INT64_MAX || val < INT64_MIN || errno == ERANGE || *end) {
goto invalid;
}
f->defaultval.sint = val;
break;
}
- case UPB_TYPE_UINT32: {
+ case kUpb_CType_UInt32: {
unsigned long val = strtoul(str, &end, 0);
if (val > UINT32_MAX || errno == ERANGE || *end) {
goto invalid;
@@ -1472,16 +2104,15 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
f->defaultval.uint = val;
break;
}
- case UPB_TYPE_UINT64: {
- /* XXX: Need to write our own strtoull, since it's not available in c89. */
- uint64_t val = strtoul(str, &end, 0);
+ case kUpb_CType_UInt64: {
+ unsigned long long val = strtoull(str, &end, 0);
if (val > UINT64_MAX || errno == ERANGE || *end) {
goto invalid;
}
f->defaultval.uint = val;
break;
}
- case UPB_TYPE_DOUBLE: {
+ case kUpb_CType_Double: {
double val = strtod(str, &end);
if (errno == ERANGE || *end) {
goto invalid;
@@ -1489,85 +2120,86 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
f->defaultval.dbl = val;
break;
}
- case UPB_TYPE_FLOAT: {
- /* XXX: Need to write our own strtof, since it's not available in c89. */
- float val = strtod(str, &end);
+ case kUpb_CType_Float: {
+ float val = strtof(str, &end);
if (errno == ERANGE || *end) {
goto invalid;
}
f->defaultval.flt = val;
break;
}
- case UPB_TYPE_BOOL: {
+ case kUpb_CType_Bool: {
if (streql2(str, len, "false")) {
f->defaultval.boolean = false;
} else if (streql2(str, len, "true")) {
f->defaultval.boolean = true;
} else {
+ goto invalid;
}
break;
}
- case UPB_TYPE_STRING:
+ case kUpb_CType_String:
f->defaultval.str = newstr(ctx, str, len);
break;
- case UPB_TYPE_BYTES:
- /* XXX: need to interpret the C-escaped value. */
- f->defaultval.str = newstr(ctx, str, len);
+ case kUpb_CType_Bytes:
+ f->defaultval.str = unescape(ctx, f, str, len);
break;
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Message:
/* Should not have a default value. */
symtab_errf(ctx, "Message should not have a default (%s)",
- upb_fielddef_fullname(f));
+ upb_FieldDef_FullName(f));
}
return;
invalid:
- symtab_errf(ctx, "Invalid default '%.*s' for field %f", (int)len, str,
- upb_fielddef_fullname(f));
+ symtab_errf(ctx, "Invalid default '%.*s' for field %s of type %d", (int)len,
+ str, upb_FieldDef_FullName(f), (int)upb_FieldDef_Type(f));
}
-static void set_default_default(symtab_addctx *ctx, upb_fielddef *f) {
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_ENUM:
+static void set_default_default(symtab_addctx* ctx, upb_FieldDef* f) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Int32:
+ case kUpb_CType_Int64:
f->defaultval.sint = 0;
break;
- case UPB_TYPE_UINT64:
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt64:
+ case kUpb_CType_UInt32:
f->defaultval.uint = 0;
break;
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_FLOAT:
+ case kUpb_CType_Double:
+ case kUpb_CType_Float:
f->defaultval.dbl = 0;
break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes:
f->defaultval.str = newstr(ctx, NULL, 0);
break;
- case UPB_TYPE_BOOL:
+ case kUpb_CType_Bool:
f->defaultval.boolean = false;
break;
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Enum:
+ f->defaultval.sint = f->sub.enumdef->values[0].number;
+ case kUpb_CType_Message:
break;
}
}
static void create_fielddef(
- symtab_addctx *ctx, const char *prefix, upb_msgdef *m,
- const google_protobuf_FieldDescriptorProto *field_proto) {
- upb_alloc *alloc = ctx->alloc;
- upb_fielddef *f;
- const google_protobuf_FieldOptions *options;
- upb_strview name;
- const char *full_name;
- const char *json_name;
- const char *shortname;
- uint32_t field_number;
+ symtab_addctx* ctx, const char* prefix, upb_MessageDef* m,
+ const google_protobuf_FieldDescriptorProto* field_proto,
+ const upb_FieldDef* _f, bool is_extension) {
+ upb_FieldDef* f = (upb_FieldDef*)_f;
+ upb_StringView name;
+ const char* full_name;
+ const char* json_name;
+ const char* shortname;
+ int32_t field_number;
+
+ f->file = ctx->file; /* Must happen prior to symtab_add(). */
if (!google_protobuf_FieldDescriptorProto_has_name(field_proto)) {
- symtab_errf(ctx, "field has no name (%s)", upb_msgdef_fullname(m));
+ symtab_errf(ctx, "field has no name");
}
name = google_protobuf_FieldDescriptorProto_name(field_proto);
@@ -1578,56 +2210,94 @@ static void create_fielddef(
if (google_protobuf_FieldDescriptorProto_has_json_name(field_proto)) {
json_name = strviewdup(
ctx, google_protobuf_FieldDescriptorProto_json_name(field_proto));
+ f->has_json_name_ = true;
} else {
json_name = makejsonname(ctx, shortname);
+ f->has_json_name_ = false;
}
field_number = google_protobuf_FieldDescriptorProto_number(field_proto);
- if (field_number == 0 || field_number > UPB_MAX_FIELDNUMBER) {
- symtab_errf(ctx, "invalid field number (%u)", field_number);
+ f->full_name = full_name;
+ f->json_name = json_name;
+ f->label_ = (int)google_protobuf_FieldDescriptorProto_label(field_proto);
+ f->number_ = field_number;
+ f->scope.oneof = NULL;
+ f->proto3_optional_ =
+ google_protobuf_FieldDescriptorProto_proto3_optional(field_proto);
+
+ bool has_type = google_protobuf_FieldDescriptorProto_has_type(field_proto);
+ bool has_type_name =
+ google_protobuf_FieldDescriptorProto_has_type_name(field_proto);
+
+ f->type_ = (int)google_protobuf_FieldDescriptorProto_type(field_proto);
+
+ if (has_type) {
+ switch (f->type_) {
+ case kUpb_FieldType_Message:
+ case kUpb_FieldType_Group:
+ case kUpb_FieldType_Enum:
+ if (!has_type_name) {
+ symtab_errf(ctx, "field of type %d requires type name (%s)",
+ (int)f->type_, full_name);
+ }
+ break;
+ default:
+ if (has_type_name) {
+ symtab_errf(ctx, "invalid type for field with type_name set (%s, %d)",
+ full_name, (int)f->type_);
+ }
+ }
+ } else if (has_type_name) {
+ f->type_ =
+ FIELD_TYPE_UNSPECIFIED; // We'll fill this in in resolve_fielddef().
}
- if (m) {
+ if (!is_extension) {
/* direct message field. */
- upb_value v, field_v, json_v;
+ upb_value v, field_v, json_v, existing_v;
size_t json_size;
- f = (upb_fielddef*)&m->fields[m->field_count++];
+ if (field_number <= 0 || field_number > kUpb_MaxFieldNumber) {
+ symtab_errf(ctx, "invalid field number (%u)", field_number);
+ }
+
+ f->index_ = f - m->fields;
f->msgdef = m;
f->is_extension_ = false;
- if (upb_strtable_lookup(&m->ntof, shortname, NULL)) {
+ field_v = pack_def(f, UPB_DEFTYPE_FIELD);
+ json_v = pack_def(f, UPB_DEFTYPE_FIELD_JSONNAME);
+ v = upb_value_constptr(f);
+ json_size = strlen(json_name);
+
+ if (upb_strtable_lookup(&m->ntof, shortname, &existing_v)) {
symtab_errf(ctx, "duplicate field name (%s)", shortname);
}
- if (upb_strtable_lookup(&m->ntof, json_name, NULL)) {
- symtab_errf(ctx, "duplicate json_name (%s)", json_name);
+ CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, field_v,
+ ctx->arena));
+
+ if (strcmp(shortname, json_name) != 0) {
+ if (upb_strtable_lookup(&m->ntof, json_name, &v)) {
+ symtab_errf(ctx, "duplicate json_name (%s)", json_name);
+ } else {
+ CHK_OOM(upb_strtable_insert(&m->ntof, json_name, json_size, json_v,
+ ctx->arena));
+ }
}
if (upb_inttable_lookup(&m->itof, field_number, NULL)) {
symtab_errf(ctx, "duplicate field number (%u)", field_number);
}
- field_v = pack_def(f, UPB_DEFTYPE_FIELD);
- json_v = pack_def(f, UPB_DEFTYPE_FIELD_JSONNAME);
- v = upb_value_constptr(f);
- json_size = strlen(json_name);
+ CHK_OOM(upb_inttable_insert(&m->itof, field_number, v, ctx->arena));
- CHK_OOM(
- upb_strtable_insert3(&m->ntof, name.data, name.size, field_v, alloc));
- CHK_OOM(upb_inttable_insert2(&m->itof, field_number, v, alloc));
-
- if (strcmp(shortname, json_name) != 0) {
- upb_strtable_insert3(&m->ntof, json_name, json_size, json_v, alloc);
- }
-
- if (ctx->layouts) {
- const upb_msglayout_field *fields = m->layout->fields;
+ if (ctx->layout) {
+ const upb_MiniTable_Field* fields = m->layout->fields;
int count = m->layout->field_count;
bool found = false;
- int i;
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
if (fields[i].number == field_number) {
f->layout_index = i;
found = true;
@@ -1638,37 +2308,42 @@ static void create_fielddef(
}
} else {
/* extension field. */
- f = (upb_fielddef*)&ctx->file->exts[ctx->file->ext_count++];
f->is_extension_ = true;
- symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_FIELD));
+ f->scope.extension_scope = m;
+ symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_EXT));
+ f->layout_index = ctx->ext_count++;
+ if (ctx->layout) {
+ UPB_ASSERT(ctx->file->ext_layouts[f->layout_index]->field.number ==
+ field_number);
+ }
}
- f->full_name = full_name;
- f->json_name = json_name;
- f->file = ctx->file;
- f->type_ = (int)google_protobuf_FieldDescriptorProto_type(field_proto);
- f->label_ = (int)google_protobuf_FieldDescriptorProto_label(field_proto);
- f->number_ = field_number;
- f->oneof = NULL;
- f->proto3_optional_ =
- google_protobuf_FieldDescriptorProto_proto3_optional(field_proto);
+ if (f->type_ < kUpb_FieldType_Double || f->type_ > kUpb_FieldType_SInt64) {
+ symtab_errf(ctx, "invalid type for field %s (%d)", f->full_name, f->type_);
+ }
+
+ if (f->label_ < kUpb_Label_Optional || f->label_ > kUpb_Label_Repeated) {
+ symtab_errf(ctx, "invalid label for field %s (%d)", f->full_name,
+ f->label_);
+ }
/* We can't resolve the subdef or (in the case of extensions) the containing
* message yet, because it may not have been defined yet. We stash a pointer
* to the field_proto until later when we can properly resolve it. */
f->sub.unresolved = field_proto;
- if (f->label_ == UPB_LABEL_REQUIRED && f->file->syntax == UPB_SYNTAX_PROTO3) {
+ if (f->label_ == kUpb_Label_Required &&
+ f->file->syntax == kUpb_Syntax_Proto3) {
symtab_errf(ctx, "proto3 fields cannot be required (%s)", f->full_name);
}
if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) {
int oneof_index =
google_protobuf_FieldDescriptorProto_oneof_index(field_proto);
- upb_oneofdef *oneof;
+ upb_OneofDef* oneof;
upb_value v = upb_value_constptr(f);
- if (upb_fielddef_label(f) != UPB_LABEL_OPTIONAL) {
+ if (upb_FieldDef_Label(f) != kUpb_Label_Optional) {
symtab_errf(ctx, "fields in oneof must have OPTIONAL label (%s)",
f->full_name);
}
@@ -1682,277 +2357,567 @@ static void create_fielddef(
symtab_errf(ctx, "oneof_index out of range (%s)", f->full_name);
}
- oneof = (upb_oneofdef*)&m->oneofs[oneof_index];
- f->oneof = oneof;
+ oneof = (upb_OneofDef*)&m->oneofs[oneof_index];
+ f->scope.oneof = oneof;
oneof->field_count++;
if (f->proto3_optional_) {
oneof->synthetic = true;
}
- CHK_OOM(upb_inttable_insert2(&oneof->itof, f->number_, v, alloc));
- CHK_OOM(upb_strtable_insert3(&oneof->ntof, name.data, name.size, v, alloc));
+ CHK_OOM(upb_inttable_insert(&oneof->itof, f->number_, v, ctx->arena));
+ CHK_OOM(
+ upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else {
- f->oneof = NULL;
if (f->proto3_optional_) {
symtab_errf(ctx, "field with proto3_optional was not in a oneof (%s)",
f->full_name);
}
}
- options = google_protobuf_FieldDescriptorProto_has_options(field_proto) ?
- google_protobuf_FieldDescriptorProto_options(field_proto) : NULL;
+ SET_OPTIONS(f->opts, FieldDescriptorProto, FieldOptions, field_proto);
- if (options && google_protobuf_FieldOptions_has_packed(options)) {
- f->packed_ = google_protobuf_FieldOptions_packed(options);
+ if (google_protobuf_FieldOptions_has_packed(f->opts)) {
+ f->packed_ = google_protobuf_FieldOptions_packed(f->opts);
} else {
/* Repeated fields default to packed for proto3 only. */
- f->packed_ = upb_fielddef_isprimitive(f) &&
- f->label_ == UPB_LABEL_REPEATED && f->file->syntax == UPB_SYNTAX_PROTO3;
+ f->packed_ = upb_FieldDef_IsPrimitive(f) &&
+ f->label_ == kUpb_Label_Repeated &&
+ f->file->syntax == kUpb_Syntax_Proto3;
}
+}
- if (options) {
- f->lazy_ = google_protobuf_FieldOptions_lazy(options);
- } else {
- f->lazy_ = false;
+static void create_service(
+ symtab_addctx* ctx, const google_protobuf_ServiceDescriptorProto* svc_proto,
+ const upb_ServiceDef* _s) {
+ upb_ServiceDef* s = (upb_ServiceDef*)_s;
+ upb_StringView name;
+ const google_protobuf_MethodDescriptorProto* const* methods;
+ size_t i, n;
+
+ s->file = ctx->file; /* Must happen prior to symtab_add. */
+
+ name = google_protobuf_ServiceDescriptorProto_name(svc_proto);
+ check_ident(ctx, name, false);
+ s->full_name = makefullname(ctx, ctx->file->package, name);
+ symtab_add(ctx, s->full_name, pack_def(s, UPB_DEFTYPE_SERVICE));
+
+ methods = google_protobuf_ServiceDescriptorProto_method(svc_proto, &n);
+
+ s->method_count = n;
+ s->methods = symtab_alloc(ctx, sizeof(*s->methods) * n);
+
+ SET_OPTIONS(s->opts, ServiceDescriptorProto, ServiceOptions, svc_proto);
+
+ for (i = 0; i < n; i++) {
+ const google_protobuf_MethodDescriptorProto* method_proto = methods[i];
+ upb_MethodDef* m = (upb_MethodDef*)&s->methods[i];
+ upb_StringView name =
+ google_protobuf_MethodDescriptorProto_name(method_proto);
+
+ m->service = s;
+ m->full_name = makefullname(ctx, s->full_name, name);
+ m->index = i;
+ m->client_streaming =
+ google_protobuf_MethodDescriptorProto_client_streaming(method_proto);
+ m->server_streaming =
+ google_protobuf_MethodDescriptorProto_server_streaming(method_proto);
+ m->input_type = symtab_resolve(
+ ctx, m->full_name, m->full_name,
+ google_protobuf_MethodDescriptorProto_input_type(method_proto),
+ UPB_DEFTYPE_MSG);
+ m->output_type = symtab_resolve(
+ ctx, m->full_name, m->full_name,
+ google_protobuf_MethodDescriptorProto_output_type(method_proto),
+ UPB_DEFTYPE_MSG);
+
+ SET_OPTIONS(m->opts, MethodDescriptorProto, MethodOptions, method_proto);
+ }
+}
+
+static int count_bits_debug(uint64_t x) {
+ // For assertions only, speed does not matter.
+ int n = 0;
+ while (x) {
+ if (x & 1) n++;
+ x >>= 1;
+ }
+ return n;
+}
+
+static int compare_int32(const void* a_ptr, const void* b_ptr) {
+ int32_t a = *(int32_t*)a_ptr;
+ int32_t b = *(int32_t*)b_ptr;
+ return a < b ? -1 : (a == b ? 0 : 1);
+}
+
+upb_MiniTable_Enum* create_enumlayout(symtab_addctx* ctx,
+ const upb_EnumDef* e) {
+ int n = 0;
+ uint64_t mask = 0;
+
+ for (int i = 0; i < e->value_count; i++) {
+ uint32_t val = (uint32_t)e->values[i].number;
+ if (val < 64) {
+ mask |= 1ULL << val;
+ } else {
+ n++;
+ }
+ }
+
+ int32_t* values = symtab_alloc(ctx, sizeof(*values) * n);
+
+ if (n) {
+ int32_t* p = values;
+
+ // Add values outside the bitmask range to the list, as described in the
+ // comments for upb_MiniTable_Enum.
+ for (int i = 0; i < e->value_count; i++) {
+ int32_t val = e->values[i].number;
+ if ((uint32_t)val >= 64) {
+ *p++ = val;
+ }
+ }
+ UPB_ASSERT(p == values + n);
+ }
+
+ // Enums can have duplicate values; we must sort+uniq them.
+ if (values) qsort(values, n, sizeof(*values), &compare_int32);
+
+ int dst = 0;
+ for (int i = 0; i < n; dst++) {
+ int32_t val = values[i];
+ while (i < n && values[i] == val) i++; // Skip duplicates.
+ values[dst] = val;
+ }
+ n = dst;
+
+ UPB_ASSERT(upb_inttable_count(&e->iton) == n + count_bits_debug(mask));
+
+ upb_MiniTable_Enum* layout = symtab_alloc(ctx, sizeof(*layout));
+ layout->value_count = n;
+ layout->mask = mask;
+ layout->values = values;
+
+ return layout;
+}
+
+static void create_enumvaldef(
+ symtab_addctx* ctx, const char* prefix,
+ const google_protobuf_EnumValueDescriptorProto* val_proto, upb_EnumDef* e,
+ int i) {
+ upb_EnumValueDef* val = (upb_EnumValueDef*)&e->values[i];
+ upb_StringView name =
+ google_protobuf_EnumValueDescriptorProto_name(val_proto);
+ upb_value v = upb_value_constptr(val);
+
+ val->parent = e; /* Must happen prior to symtab_add(). */
+ val->full_name = makefullname(ctx, prefix, name);
+ val->number = google_protobuf_EnumValueDescriptorProto_number(val_proto);
+ symtab_add(ctx, val->full_name, pack_def(val, UPB_DEFTYPE_ENUMVAL));
+
+ SET_OPTIONS(val->opts, EnumValueDescriptorProto, EnumValueOptions, val_proto);
+
+ if (i == 0 && e->file->syntax == kUpb_Syntax_Proto3 && val->number != 0) {
+ symtab_errf(ctx, "for proto3, the first enum value must be zero (%s)",
+ e->full_name);
+ }
+
+ CHK_OOM(upb_strtable_insert(&e->ntoi, name.data, name.size, v, ctx->arena));
+
+ // Multiple enumerators can have the same number, first one wins.
+ if (!upb_inttable_lookup(&e->iton, val->number, NULL)) {
+ CHK_OOM(upb_inttable_insert(&e->iton, val->number, v, ctx->arena));
}
}
static void create_enumdef(
- symtab_addctx *ctx, const char *prefix,
- const google_protobuf_EnumDescriptorProto *enum_proto) {
- upb_enumdef *e;
- const google_protobuf_EnumValueDescriptorProto *const *values;
- upb_strview name;
+ symtab_addctx* ctx, const char* prefix,
+ const google_protobuf_EnumDescriptorProto* enum_proto,
+ const upb_MessageDef* containing_type, const upb_EnumDef* _e) {
+ upb_EnumDef* e = (upb_EnumDef*)_e;
+ ;
+ const google_protobuf_EnumValueDescriptorProto* const* values;
+ upb_StringView name;
size_t i, n;
+ e->file = ctx->file; /* Must happen prior to symtab_add() */
+ e->containing_type = containing_type;
+
name = google_protobuf_EnumDescriptorProto_name(enum_proto);
check_ident(ctx, name, false);
- e = (upb_enumdef*)&ctx->file->enums[ctx->file->enum_count++];
e->full_name = makefullname(ctx, prefix, name);
symtab_add(ctx, e->full_name, pack_def(e, UPB_DEFTYPE_ENUM));
values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n);
- CHK_OOM(upb_strtable_init2(&e->ntoi, UPB_CTYPE_INT32, n, ctx->alloc));
- CHK_OOM(upb_inttable_init2(&e->iton, UPB_CTYPE_CSTR, ctx->alloc));
+ CHK_OOM(upb_strtable_init(&e->ntoi, n, ctx->arena));
+ CHK_OOM(upb_inttable_init(&e->iton, ctx->arena));
- e->file = ctx->file;
e->defaultval = 0;
+ e->value_count = n;
+ e->values = symtab_alloc(ctx, sizeof(*e->values) * n);
if (n == 0) {
symtab_errf(ctx, "enums must contain at least one value (%s)",
e->full_name);
}
- for (i = 0; i < n; i++) {
- const google_protobuf_EnumValueDescriptorProto *value = values[i];
- upb_strview name = google_protobuf_EnumValueDescriptorProto_name(value);
- char *name2 = strviewdup(ctx, name);
- int32_t num = google_protobuf_EnumValueDescriptorProto_number(value);
- upb_value v = upb_value_int32(num);
-
- if (i == 0 && e->file->syntax == UPB_SYNTAX_PROTO3 && num != 0) {
- symtab_errf(ctx, "for proto3, the first enum value must be zero (%s)",
- e->full_name);
- }
+ SET_OPTIONS(e->opts, EnumDescriptorProto, EnumOptions, enum_proto);
- if (upb_strtable_lookup(&e->ntoi, name2, NULL)) {
- symtab_errf(ctx, "duplicate enum label '%s'", name2);
- }
+ for (i = 0; i < n; i++) {
+ create_enumvaldef(ctx, prefix, values[i], e, i);
+ }
- CHK_OOM(name2)
- CHK_OOM(
- upb_strtable_insert3(&e->ntoi, name2, strlen(name2), v, ctx->alloc));
+ upb_inttable_compact(&e->iton, ctx->arena);
- if (!upb_inttable_lookup(&e->iton, num, NULL)) {
- upb_value v = upb_value_cstr(name2);
- CHK_OOM(upb_inttable_insert2(&e->iton, num, v, ctx->alloc));
+ if (e->file->syntax == kUpb_Syntax_Proto2) {
+ if (ctx->layout) {
+ UPB_ASSERT(ctx->enum_count < ctx->layout->enum_count);
+ e->layout = ctx->layout->enums[ctx->enum_count++];
+ UPB_ASSERT(upb_inttable_count(&e->iton) ==
+ e->layout->value_count + count_bits_debug(e->layout->mask));
+ } else {
+ e->layout = create_enumlayout(ctx, e);
}
+ } else {
+ e->layout = NULL;
}
-
- upb_inttable_compact2(&e->iton, ctx->alloc);
}
-static void create_msgdef(symtab_addctx *ctx, const char *prefix,
- const google_protobuf_DescriptorProto *msg_proto) {
- upb_msgdef *m;
- const google_protobuf_MessageOptions *options;
- const google_protobuf_OneofDescriptorProto *const *oneofs;
- const google_protobuf_FieldDescriptorProto *const *fields;
- const google_protobuf_EnumDescriptorProto *const *enums;
- const google_protobuf_DescriptorProto *const *msgs;
- size_t i, n_oneof, n_field, n;
- upb_strview name;
+static void msgdef_create_nested(
+ symtab_addctx* ctx, const google_protobuf_DescriptorProto* msg_proto,
+ upb_MessageDef* m);
+
+static void create_msgdef(symtab_addctx* ctx, const char* prefix,
+ const google_protobuf_DescriptorProto* msg_proto,
+ const upb_MessageDef* containing_type,
+ const upb_MessageDef* _m) {
+ upb_MessageDef* m = (upb_MessageDef*)_m;
+ const google_protobuf_OneofDescriptorProto* const* oneofs;
+ const google_protobuf_FieldDescriptorProto* const* fields;
+ const google_protobuf_DescriptorProto_ExtensionRange* const* ext_ranges;
+ size_t i, n_oneof, n_field, n_ext_range;
+ upb_StringView name;
+
+ m->file = ctx->file; /* Must happen prior to symtab_add(). */
+ m->containing_type = containing_type;
name = google_protobuf_DescriptorProto_name(msg_proto);
check_ident(ctx, name, false);
- m = (upb_msgdef*)&ctx->file->msgs[ctx->file->msg_count++];
m->full_name = makefullname(ctx, prefix, name);
symtab_add(ctx, m->full_name, pack_def(m, UPB_DEFTYPE_MSG));
oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof);
fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field);
+ ext_ranges =
+ google_protobuf_DescriptorProto_extension_range(msg_proto, &n_ext_range);
- CHK_OOM(upb_inttable_init2(&m->itof, UPB_CTYPE_CONSTPTR, ctx->alloc));
- CHK_OOM(upb_strtable_init2(&m->ntof, UPB_CTYPE_CONSTPTR, n_oneof + n_field,
- ctx->alloc));
-
- m->file = ctx->file;
- m->map_entry = false;
-
- options = google_protobuf_DescriptorProto_options(msg_proto);
+ CHK_OOM(upb_inttable_init(&m->itof, ctx->arena));
+ CHK_OOM(upb_strtable_init(&m->ntof, n_oneof + n_field, ctx->arena));
- if (options) {
- m->map_entry = google_protobuf_MessageOptions_map_entry(options);
- }
-
- if (ctx->layouts) {
- m->layout = *ctx->layouts;
- ctx->layouts++;
+ if (ctx->layout) {
+ /* create_fielddef() below depends on this being set. */
+ UPB_ASSERT(ctx->msg_count < ctx->layout->msg_count);
+ m->layout = ctx->layout->msgs[ctx->msg_count++];
+ UPB_ASSERT(n_field == m->layout->field_count);
} else {
/* Allocate now (to allow cross-linking), populate later. */
- m->layout = symtab_alloc(
- ctx, sizeof(*m->layout) + sizeof(_upb_fasttable_entry));
+ m->layout =
+ symtab_alloc(ctx, sizeof(*m->layout) + sizeof(_upb_FastTable_Entry));
}
- m->oneof_count = 0;
+ SET_OPTIONS(m->opts, DescriptorProto, MessageOptions, msg_proto);
+
+ m->oneof_count = n_oneof;
m->oneofs = symtab_alloc(ctx, sizeof(*m->oneofs) * n_oneof);
for (i = 0; i < n_oneof; i++) {
- create_oneofdef(ctx, m, oneofs[i]);
+ create_oneofdef(ctx, m, oneofs[i], &m->oneofs[i]);
}
- m->field_count = 0;
+ m->field_count = n_field;
m->fields = symtab_alloc(ctx, sizeof(*m->fields) * n_field);
for (i = 0; i < n_field; i++) {
- create_fielddef(ctx, m->full_name, m, fields[i]);
+ create_fielddef(ctx, m->full_name, m, fields[i], &m->fields[i],
+ /* is_extension= */ false);
+ }
+
+ m->ext_range_count = n_ext_range;
+ m->ext_ranges = symtab_alloc(ctx, sizeof(*m->ext_ranges) * n_ext_range);
+ for (i = 0; i < n_ext_range; i++) {
+ const google_protobuf_DescriptorProto_ExtensionRange* r = ext_ranges[i];
+ upb_ExtensionRange* r_def = (upb_ExtensionRange*)&m->ext_ranges[i];
+ int32_t start = google_protobuf_DescriptorProto_ExtensionRange_start(r);
+ int32_t end = google_protobuf_DescriptorProto_ExtensionRange_end(r);
+ int32_t max =
+ google_protobuf_MessageOptions_message_set_wire_format(m->opts)
+ ? INT32_MAX
+ : kUpb_MaxFieldNumber + 1;
+
+ // A full validation would also check that each range is disjoint, and that
+ // none of the fields overlap with the extension ranges, but we are just
+ // sanity checking here.
+ if (start < 1 || end <= start || end > max) {
+ symtab_errf(ctx, "Extension range (%d, %d) is invalid, message=%s\n",
+ (int)start, (int)end, m->full_name);
+ }
+
+ r_def->start = start;
+ r_def->end = end;
+ SET_OPTIONS(r_def->opts, DescriptorProto_ExtensionRange,
+ ExtensionRangeOptions, r);
}
- assign_msg_indices(ctx, m);
finalize_oneofs(ctx, m);
assign_msg_wellknowntype(m);
- upb_inttable_compact2(&m->itof, ctx->alloc);
-
- /* This message is built. Now build nested messages and enums. */
-
- enums = google_protobuf_DescriptorProto_enum_type(msg_proto, &n);
- for (i = 0; i < n; i++) {
- create_enumdef(ctx, m->full_name, enums[i]);
- }
-
- msgs = google_protobuf_DescriptorProto_nested_type(msg_proto, &n);
- for (i = 0; i < n; i++) {
- create_msgdef(ctx, m->full_name, msgs[i]);
+ upb_inttable_compact(&m->itof, ctx->arena);
+ msgdef_create_nested(ctx, msg_proto, m);
+}
+
+static void msgdef_create_nested(
+ symtab_addctx* ctx, const google_protobuf_DescriptorProto* msg_proto,
+ upb_MessageDef* m) {
+ size_t n;
+
+ const google_protobuf_EnumDescriptorProto* const* enums =
+ google_protobuf_DescriptorProto_enum_type(msg_proto, &n);
+ m->nested_enum_count = n;
+ m->nested_enums = symtab_alloc(ctx, sizeof(*m->nested_enums) * n);
+ for (size_t i = 0; i < n; i++) {
+ m->nested_enum_count = i + 1;
+ create_enumdef(ctx, m->full_name, enums[i], m, &m->nested_enums[i]);
+ }
+
+ const google_protobuf_FieldDescriptorProto* const* exts =
+ google_protobuf_DescriptorProto_extension(msg_proto, &n);
+ m->nested_ext_count = n;
+ m->nested_exts = symtab_alloc(ctx, sizeof(*m->nested_exts) * n);
+ for (size_t i = 0; i < n; i++) {
+ create_fielddef(ctx, m->full_name, m, exts[i], &m->nested_exts[i],
+ /* is_extension= */ true);
+ ((upb_FieldDef*)&m->nested_exts[i])->index_ = i;
+ }
+
+ const google_protobuf_DescriptorProto* const* msgs =
+ google_protobuf_DescriptorProto_nested_type(msg_proto, &n);
+ m->nested_msg_count = n;
+ m->nested_msgs = symtab_alloc(ctx, sizeof(*m->nested_msgs) * n);
+ for (size_t i = 0; i < n; i++) {
+ create_msgdef(ctx, m->full_name, msgs[i], m, &m->nested_msgs[i]);
+ }
+}
+
+static void resolve_subdef(symtab_addctx* ctx, const char* prefix,
+ upb_FieldDef* f) {
+ const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved;
+ upb_StringView name =
+ google_protobuf_FieldDescriptorProto_type_name(field_proto);
+ bool has_name =
+ google_protobuf_FieldDescriptorProto_has_type_name(field_proto);
+ switch ((int)f->type_) {
+ case FIELD_TYPE_UNSPECIFIED: {
+ // Type was not specified and must be inferred.
+ UPB_ASSERT(has_name);
+ upb_deftype_t type;
+ const void* def =
+ symtab_resolveany(ctx, f->full_name, prefix, name, &type);
+ switch (type) {
+ case UPB_DEFTYPE_ENUM:
+ f->sub.enumdef = def;
+ f->type_ = kUpb_FieldType_Enum;
+ break;
+ case UPB_DEFTYPE_MSG:
+ f->sub.msgdef = def;
+ f->type_ = kUpb_FieldType_Message; // It appears there is no way of
+ // this being a group.
+ break;
+ default:
+ symtab_errf(ctx, "Couldn't resolve type name for field %s",
+ f->full_name);
+ }
+ }
+ case kUpb_FieldType_Message:
+ case kUpb_FieldType_Group:
+ UPB_ASSERT(has_name);
+ f->sub.msgdef =
+ symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG);
+ break;
+ case kUpb_FieldType_Enum:
+ UPB_ASSERT(has_name);
+ f->sub.enumdef =
+ symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_ENUM);
+ break;
+ default:
+ // No resolution necessary.
+ break;
}
}
-static void count_types_in_msg(const google_protobuf_DescriptorProto *msg_proto,
- upb_filedef *file) {
- const google_protobuf_DescriptorProto *const *msgs;
- size_t i, n;
-
- file->msg_count++;
-
- msgs = google_protobuf_DescriptorProto_nested_type(msg_proto, &n);
- for (i = 0; i < n; i++) {
- count_types_in_msg(msgs[i], file);
+static void resolve_extension(
+ symtab_addctx* ctx, const char* prefix, upb_FieldDef* f,
+ const google_protobuf_FieldDescriptorProto* field_proto) {
+ if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) {
+ symtab_errf(ctx, "extension for field '%s' had no extendee", f->full_name);
}
- google_protobuf_DescriptorProto_enum_type(msg_proto, &n);
- file->enum_count += n;
-
- google_protobuf_DescriptorProto_extension(msg_proto, &n);
- file->ext_count += n;
-}
+ upb_StringView name =
+ google_protobuf_FieldDescriptorProto_extendee(field_proto);
+ const upb_MessageDef* m =
+ symtab_resolve(ctx, f->full_name, prefix, name, UPB_DEFTYPE_MSG);
+ f->msgdef = m;
-static void count_types_in_file(
- const google_protobuf_FileDescriptorProto *file_proto,
- upb_filedef *file) {
- const google_protobuf_DescriptorProto *const *msgs;
- size_t i, n;
+ bool found = false;
- msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n);
- for (i = 0; i < n; i++) {
- count_types_in_msg(msgs[i], file);
- }
-
- google_protobuf_FileDescriptorProto_enum_type(file_proto, &n);
- file->enum_count += n;
-
- google_protobuf_FileDescriptorProto_extension(file_proto, &n);
- file->ext_count += n;
-}
-
-static void resolve_fielddef(symtab_addctx *ctx, const char *prefix,
- upb_fielddef *f) {
- upb_strview name;
- const google_protobuf_FieldDescriptorProto *field_proto = f->sub.unresolved;
-
- if (f->is_extension_) {
- if (!google_protobuf_FieldDescriptorProto_has_extendee(field_proto)) {
- symtab_errf(ctx, "extension for field '%s' had no extendee",
- f->full_name);
+ for (int i = 0, n = m->ext_range_count; i < n; i++) {
+ const upb_ExtensionRange* r = &m->ext_ranges[i];
+ if (r->start <= f->number_ && f->number_ < r->end) {
+ found = true;
+ break;
}
-
- name = google_protobuf_FieldDescriptorProto_extendee(field_proto);
- f->msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG);
}
- if ((upb_fielddef_issubmsg(f) || f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) &&
- !google_protobuf_FieldDescriptorProto_has_type_name(field_proto)) {
- symtab_errf(ctx, "field '%s' is missing type name", f->full_name);
+ if (!found) {
+ symtab_errf(ctx,
+ "field number %u in extension %s has no extension range in "
+ "message %s",
+ (unsigned)f->number_, f->full_name, f->msgdef->full_name);
}
- name = google_protobuf_FieldDescriptorProto_type_name(field_proto);
-
- if (upb_fielddef_issubmsg(f)) {
- f->sub.msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG);
- } else if (f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) {
- f->sub.enumdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_ENUM);
+ const upb_MiniTable_Extension* ext = ctx->file->ext_layouts[f->layout_index];
+ if (ctx->layout) {
+ UPB_ASSERT(upb_FieldDef_Number(f) == ext->field.number);
+ } else {
+ upb_MiniTable_Extension* mut_ext = (upb_MiniTable_Extension*)ext;
+ fill_fieldlayout(&mut_ext->field, f);
+ mut_ext->field.presence = 0;
+ mut_ext->field.offset = 0;
+ mut_ext->field.submsg_index = 0;
+ mut_ext->extendee = f->msgdef->layout;
+ mut_ext->sub.submsg = f->sub.msgdef->layout;
}
- /* Have to delay resolving of the default value until now because of the enum
- * case, since enum defaults are specified with a label. */
+ CHK_OOM(upb_inttable_insert(&ctx->symtab->exts, (uintptr_t)ext,
+ upb_value_constptr(f), ctx->arena));
+}
+
+static void resolve_default(
+ symtab_addctx* ctx, upb_FieldDef* f,
+ const google_protobuf_FieldDescriptorProto* field_proto) {
+ // Have to delay resolving of the default value until now because of the enum
+ // case, since enum defaults are specified with a label.
if (google_protobuf_FieldDescriptorProto_has_default_value(field_proto)) {
- upb_strview defaultval =
+ upb_StringView defaultval =
google_protobuf_FieldDescriptorProto_default_value(field_proto);
- if (f->file->syntax == UPB_SYNTAX_PROTO3) {
+ if (f->file->syntax == kUpb_Syntax_Proto3) {
symtab_errf(ctx, "proto3 fields cannot have explicit defaults (%s)",
f->full_name);
}
- if (upb_fielddef_issubmsg(f)) {
+ if (upb_FieldDef_IsSubMessage(f)) {
symtab_errf(ctx, "message fields cannot have explicit defaults (%s)",
f->full_name);
}
parse_default(ctx, defaultval.data, defaultval.size, f);
+ f->has_default = true;
} else {
set_default_default(ctx, f);
+ f->has_default = false;
+ }
+}
+
+static void resolve_fielddef(symtab_addctx* ctx, const char* prefix,
+ upb_FieldDef* f) {
+ // We have to stash this away since resolve_subdef() may overwrite it.
+ const google_protobuf_FieldDescriptorProto* field_proto = f->sub.unresolved;
+
+ resolve_subdef(ctx, prefix, f);
+ resolve_default(ctx, f, field_proto);
+
+ if (f->is_extension_) {
+ resolve_extension(ctx, prefix, f, field_proto);
+ }
+}
+
+static void resolve_msgdef(symtab_addctx* ctx, upb_MessageDef* m) {
+ for (int i = 0; i < m->field_count; i++) {
+ resolve_fielddef(ctx, m->full_name, (upb_FieldDef*)&m->fields[i]);
+ }
+
+ m->in_message_set = false;
+ for (int i = 0; i < m->nested_ext_count; i++) {
+ upb_FieldDef* ext = (upb_FieldDef*)&m->nested_exts[i];
+ resolve_fielddef(ctx, m->full_name, ext);
+ if (ext->type_ == kUpb_FieldType_Message &&
+ ext->label_ == kUpb_Label_Optional && ext->sub.msgdef == m &&
+ google_protobuf_MessageOptions_message_set_wire_format(
+ ext->msgdef->opts)) {
+ m->in_message_set = true;
+ }
+ }
+
+ if (!ctx->layout) make_layout(ctx, m);
+
+ for (int i = 0; i < m->nested_msg_count; i++) {
+ resolve_msgdef(ctx, (upb_MessageDef*)&m->nested_msgs[i]);
}
}
+static int count_exts_in_msg(const google_protobuf_DescriptorProto* msg_proto) {
+ size_t n;
+ google_protobuf_DescriptorProto_extension(msg_proto, &n);
+ int ext_count = n;
+
+ const google_protobuf_DescriptorProto* const* nested_msgs =
+ google_protobuf_DescriptorProto_nested_type(msg_proto, &n);
+ for (size_t i = 0; i < n; i++) {
+ ext_count += count_exts_in_msg(nested_msgs[i]);
+ }
+
+ return ext_count;
+}
+
static void build_filedef(
- symtab_addctx *ctx, upb_filedef *file,
- const google_protobuf_FileDescriptorProto *file_proto) {
- const google_protobuf_FileOptions *file_options_proto;
- const google_protobuf_DescriptorProto *const *msgs;
- const google_protobuf_EnumDescriptorProto *const *enums;
- const google_protobuf_FieldDescriptorProto *const *exts;
- const upb_strview* strs;
+ symtab_addctx* ctx, upb_FileDef* file,
+ const google_protobuf_FileDescriptorProto* file_proto) {
+ const google_protobuf_DescriptorProto* const* msgs;
+ const google_protobuf_EnumDescriptorProto* const* enums;
+ const google_protobuf_FieldDescriptorProto* const* exts;
+ const google_protobuf_ServiceDescriptorProto* const* services;
+ const upb_StringView* strs;
+ const int32_t* public_deps;
+ const int32_t* weak_deps;
size_t i, n;
- count_types_in_file(file_proto, file);
+ file->symtab = ctx->symtab;
- file->msgs = symtab_alloc(ctx, sizeof(*file->msgs) * file->msg_count);
- file->enums = symtab_alloc(ctx, sizeof(*file->enums) * file->enum_count);
- file->exts = symtab_alloc(ctx, sizeof(*file->exts) * file->ext_count);
+ /* Count all extensions in the file, to build a flat array of layouts. */
+ google_protobuf_FileDescriptorProto_extension(file_proto, &n);
+ int ext_count = n;
+ msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n);
+ for (int i = 0; i < n; i++) {
+ ext_count += count_exts_in_msg(msgs[i]);
+ }
+ file->ext_count = ext_count;
- /* We increment these as defs are added. */
- file->msg_count = 0;
- file->enum_count = 0;
- file->ext_count = 0;
+ if (ctx->layout) {
+ /* We are using the ext layouts that were passed in. */
+ file->ext_layouts = ctx->layout->exts;
+ if (ctx->layout->ext_count != file->ext_count) {
+ symtab_errf(ctx, "Extension count did not match layout (%d vs %d)",
+ ctx->layout->ext_count, file->ext_count);
+ }
+ } else {
+ /* We are building ext layouts from scratch. */
+ file->ext_layouts =
+ symtab_alloc(ctx, sizeof(*file->ext_layouts) * file->ext_count);
+ upb_MiniTable_Extension* ext =
+ symtab_alloc(ctx, sizeof(*ext) * file->ext_count);
+ for (int i = 0; i < file->ext_count; i++) {
+ file->ext_layouts[i] = &ext[i];
+ }
+ }
if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) {
symtab_errf(ctx, "File has no name");
@@ -1960,11 +2925,9 @@ static void build_filedef(
file->name =
strviewdup(ctx, google_protobuf_FileDescriptorProto_name(file_proto));
- file->phpprefix = NULL;
- file->phpnamespace = NULL;
if (google_protobuf_FileDescriptorProto_has_package(file_proto)) {
- upb_strview package =
+ upb_StringView package =
google_protobuf_FileDescriptorProto_package(file_proto);
check_ident(ctx, package, true);
file->package = strviewdup(ctx, package);
@@ -1973,185 +2936,244 @@ static void build_filedef(
}
if (google_protobuf_FileDescriptorProto_has_syntax(file_proto)) {
- upb_strview syntax =
+ upb_StringView syntax =
google_protobuf_FileDescriptorProto_syntax(file_proto);
if (streql_view(syntax, "proto2")) {
- file->syntax = UPB_SYNTAX_PROTO2;
+ file->syntax = kUpb_Syntax_Proto2;
} else if (streql_view(syntax, "proto3")) {
- file->syntax = UPB_SYNTAX_PROTO3;
+ file->syntax = kUpb_Syntax_Proto3;
} else {
- symtab_errf(ctx, "Invalid syntax '" UPB_STRVIEW_FORMAT "'",
- UPB_STRVIEW_ARGS(syntax));
+ symtab_errf(ctx, "Invalid syntax '" UPB_STRINGVIEW_FORMAT "'",
+ UPB_STRINGVIEW_ARGS(syntax));
}
} else {
- file->syntax = UPB_SYNTAX_PROTO2;
+ file->syntax = kUpb_Syntax_Proto2;
}
/* Read options. */
- file_options_proto = google_protobuf_FileDescriptorProto_options(file_proto);
- if (file_options_proto) {
- if (google_protobuf_FileOptions_has_php_class_prefix(file_options_proto)) {
- file->phpprefix = strviewdup(
- ctx,
- google_protobuf_FileOptions_php_class_prefix(file_options_proto));
- }
- if (google_protobuf_FileOptions_has_php_namespace(file_options_proto)) {
- file->phpnamespace = strviewdup(
- ctx, google_protobuf_FileOptions_php_namespace(file_options_proto));
- }
- }
+ SET_OPTIONS(file->opts, FileDescriptorProto, FileOptions, file_proto);
/* Verify dependencies. */
strs = google_protobuf_FileDescriptorProto_dependency(file_proto, &n);
+ file->dep_count = n;
file->deps = symtab_alloc(ctx, sizeof(*file->deps) * n);
for (i = 0; i < n; i++) {
- upb_strview dep_name = strs[i];
- upb_value v;
- if (!upb_strtable_lookup2(&ctx->symtab->files, dep_name.data,
- dep_name.size, &v)) {
+ upb_StringView str = strs[i];
+ file->deps[i] =
+ upb_DefPool_FindFileByNameWithSize(ctx->symtab, str.data, str.size);
+ if (!file->deps[i]) {
symtab_errf(ctx,
- "Depends on file '" UPB_STRVIEW_FORMAT
+ "Depends on file '" UPB_STRINGVIEW_FORMAT
"', but it has not been loaded",
- UPB_STRVIEW_ARGS(dep_name));
+ UPB_STRINGVIEW_ARGS(str));
}
- file->deps[i] = upb_value_getconstptr(v);
}
- /* Create messages. */
- msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n);
+ public_deps =
+ google_protobuf_FileDescriptorProto_public_dependency(file_proto, &n);
+ file->public_dep_count = n;
+ file->public_deps = symtab_alloc(ctx, sizeof(*file->public_deps) * n);
+ int32_t* mutable_public_deps = (int32_t*)file->public_deps;
+ for (i = 0; i < n; i++) {
+ if (public_deps[i] >= file->dep_count) {
+ symtab_errf(ctx, "public_dep %d is out of range", (int)public_deps[i]);
+ }
+ mutable_public_deps[i] = public_deps[i];
+ }
+
+ weak_deps =
+ google_protobuf_FileDescriptorProto_weak_dependency(file_proto, &n);
+ file->weak_dep_count = n;
+ file->weak_deps = symtab_alloc(ctx, sizeof(*file->weak_deps) * n);
+ int32_t* mutable_weak_deps = (int32_t*)file->weak_deps;
for (i = 0; i < n; i++) {
- create_msgdef(ctx, file->package, msgs[i]);
+ if (weak_deps[i] >= file->dep_count) {
+ symtab_errf(ctx, "weak_dep %d is out of range", (int)weak_deps[i]);
+ }
+ mutable_weak_deps[i] = weak_deps[i];
}
/* Create enums. */
enums = google_protobuf_FileDescriptorProto_enum_type(file_proto, &n);
+ file->top_lvl_enum_count = n;
+ file->top_lvl_enums = symtab_alloc(ctx, sizeof(*file->top_lvl_enums) * n);
for (i = 0; i < n; i++) {
- create_enumdef(ctx, file->package, enums[i]);
+ create_enumdef(ctx, file->package, enums[i], NULL, &file->top_lvl_enums[i]);
}
/* Create extensions. */
exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n);
- file->exts = symtab_alloc(ctx, sizeof(*file->exts) * n);
+ file->top_lvl_ext_count = n;
+ file->top_lvl_exts = symtab_alloc(ctx, sizeof(*file->top_lvl_exts) * n);
for (i = 0; i < n; i++) {
- create_fielddef(ctx, file->package, NULL, exts[i]);
+ create_fielddef(ctx, file->package, NULL, exts[i], &file->top_lvl_exts[i],
+ /* is_extension= */ true);
+ ((upb_FieldDef*)&file->top_lvl_exts[i])->index_ = i;
}
- /* Now that all names are in the table, build layouts and resolve refs. */
- for (i = 0; i < (size_t)file->ext_count; i++) {
- resolve_fielddef(ctx, file->package, (upb_fielddef*)&file->exts[i]);
+ /* Create messages. */
+ msgs = google_protobuf_FileDescriptorProto_message_type(file_proto, &n);
+ file->top_lvl_msg_count = n;
+ file->top_lvl_msgs = symtab_alloc(ctx, sizeof(*file->top_lvl_msgs) * n);
+ for (i = 0; i < n; i++) {
+ create_msgdef(ctx, file->package, msgs[i], NULL, &file->top_lvl_msgs[i]);
}
- for (i = 0; i < (size_t)file->msg_count; i++) {
- const upb_msgdef *m = &file->msgs[i];
- int j;
- for (j = 0; j < m->field_count; j++) {
- resolve_fielddef(ctx, m->full_name, (upb_fielddef*)&m->fields[j]);
- }
+ /* Create services. */
+ services = google_protobuf_FileDescriptorProto_service(file_proto, &n);
+ file->service_count = n;
+ file->services = symtab_alloc(ctx, sizeof(*file->services) * n);
+ for (i = 0; i < n; i++) {
+ create_service(ctx, services[i], &file->services[i]);
+ ((upb_ServiceDef*)&file->services[i])->index = i;
}
- if (!ctx->layouts) {
- for (i = 0; i < (size_t)file->msg_count; i++) {
- const upb_msgdef *m = &file->msgs[i];
- make_layout(ctx, m);
- }
+ /* Now that all names are in the table, build layouts and resolve refs. */
+ for (i = 0; i < (size_t)file->top_lvl_ext_count; i++) {
+ resolve_fielddef(ctx, file->package, (upb_FieldDef*)&file->top_lvl_exts[i]);
}
-}
-static void remove_filedef(upb_symtab *s, upb_filedef *file) {
- upb_alloc *alloc = upb_arena_alloc(s->arena);
- int i;
- for (i = 0; i < file->msg_count; i++) {
- const char *name = file->msgs[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+ for (i = 0; i < (size_t)file->top_lvl_msg_count; i++) {
+ resolve_msgdef(ctx, (upb_MessageDef*)&file->top_lvl_msgs[i]);
}
- for (i = 0; i < file->enum_count; i++) {
- const char *name = file->enums[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+
+ if (file->ext_count) {
+ CHK_OOM(_upb_extreg_add(ctx->symtab->extreg, file->ext_layouts,
+ file->ext_count));
}
- for (i = 0; i < file->ext_count; i++) {
- const char *name = file->exts[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+}
+
+static void remove_filedef(upb_DefPool* s, upb_FileDef* file) {
+ intptr_t iter = UPB_INTTABLE_BEGIN;
+ upb_StringView key;
+ upb_value val;
+ while (upb_strtable_next2(&s->syms, &key, &val, &iter)) {
+ const upb_FileDef* f;
+ switch (deftype(val)) {
+ case UPB_DEFTYPE_EXT:
+ f = upb_FieldDef_File(unpack_def(val, UPB_DEFTYPE_EXT));
+ break;
+ case UPB_DEFTYPE_MSG:
+ f = upb_MessageDef_File(unpack_def(val, UPB_DEFTYPE_MSG));
+ break;
+ case UPB_DEFTYPE_ENUM:
+ f = upb_EnumDef_File(unpack_def(val, UPB_DEFTYPE_ENUM));
+ break;
+ case UPB_DEFTYPE_ENUMVAL:
+ f = upb_EnumDef_File(
+ upb_EnumValueDef_Enum(unpack_def(val, UPB_DEFTYPE_ENUMVAL)));
+ break;
+ case UPB_DEFTYPE_SERVICE:
+ f = upb_ServiceDef_File(unpack_def(val, UPB_DEFTYPE_SERVICE));
+ break;
+ default:
+ UPB_UNREACHABLE();
+ }
+
+ if (f == file) upb_strtable_removeiter(&s->syms, &iter);
}
}
-static const upb_filedef *_upb_symtab_addfile(
- upb_symtab *s, const google_protobuf_FileDescriptorProto *file_proto,
- const upb_msglayout **layouts, upb_status *status) {
- upb_arena *file_arena = upb_arena_new();
- upb_filedef *file;
+static const upb_FileDef* _upb_DefPool_AddFile(
+ upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto,
+ const upb_MiniTable_File* layout, upb_Status* status) {
symtab_addctx ctx;
+ upb_StringView name = google_protobuf_FileDescriptorProto_name(file_proto);
+ upb_value v;
- if (!file_arena) return NULL;
-
- file = upb_arena_malloc(file_arena, sizeof(*file));
- if (!file) goto done;
+ if (upb_strtable_lookup2(&s->files, name.data, name.size, &v)) {
+ if (unpack_def(v, UPB_DEFTYPE_FILE)) {
+ upb_Status_SetErrorFormat(status, "duplicate file name (%.*s)",
+ UPB_STRINGVIEW_ARGS(name));
+ return NULL;
+ }
+ const upb_MiniTable_File* registered = unpack_def(v, UPB_DEFTYPE_LAYOUT);
+ UPB_ASSERT(registered);
+ if (layout && layout != registered) {
+ upb_Status_SetErrorFormat(
+ status, "tried to build with a different layout (filename=%.*s)",
+ UPB_STRINGVIEW_ARGS(name));
+ return NULL;
+ }
+ layout = registered;
+ }
- ctx.file = file;
ctx.symtab = s;
- ctx.file_arena = file_arena;
- ctx.alloc = upb_arena_alloc(file_arena);
- ctx.layouts = layouts;
+ ctx.layout = layout;
+ ctx.msg_count = 0;
+ ctx.enum_count = 0;
+ ctx.ext_count = 0;
ctx.status = status;
-
- file->msg_count = 0;
- file->enum_count = 0;
- file->ext_count = 0;
- file->symtab = s;
+ ctx.file = NULL;
+ ctx.arena = upb_Arena_New();
+ ctx.tmp_arena = upb_Arena_New();
+
+ if (!ctx.arena || !ctx.tmp_arena) {
+ if (ctx.arena) upb_Arena_Free(ctx.arena);
+ if (ctx.tmp_arena) upb_Arena_Free(ctx.tmp_arena);
+ upb_Status_setoom(status);
+ return NULL;
+ }
if (UPB_UNLIKELY(UPB_SETJMP(ctx.err))) {
- UPB_ASSERT(!upb_ok(status));
- remove_filedef(s, file);
- file = NULL;
+ UPB_ASSERT(!upb_Status_IsOk(status));
+ if (ctx.file) {
+ remove_filedef(s, ctx.file);
+ ctx.file = NULL;
+ }
} else {
- build_filedef(&ctx, file, file_proto);
- upb_strtable_insert3(&s->files, file->name, strlen(file->name),
- upb_value_constptr(file), ctx.alloc);
- UPB_ASSERT(upb_ok(status));
- upb_arena_fuse(s->arena, file_arena);
+ ctx.file = symtab_alloc(&ctx, sizeof(*ctx.file));
+ build_filedef(&ctx, ctx.file, file_proto);
+ upb_strtable_insert(&s->files, name.data, name.size,
+ pack_def(ctx.file, UPB_DEFTYPE_FILE), ctx.arena);
+ UPB_ASSERT(upb_Status_IsOk(status));
+ upb_Arena_Fuse(s->arena, ctx.arena);
}
-done:
- upb_arena_free(file_arena);
- return file;
+ upb_Arena_Free(ctx.arena);
+ upb_Arena_Free(ctx.tmp_arena);
+ return ctx.file;
}
-const upb_filedef *upb_symtab_addfile(
- upb_symtab *s, const google_protobuf_FileDescriptorProto *file_proto,
- upb_status *status) {
- return _upb_symtab_addfile(s, file_proto, NULL, status);
+const upb_FileDef* upb_DefPool_AddFile(
+ upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto,
+ upb_Status* status) {
+ return _upb_DefPool_AddFile(s, file_proto, NULL, status);
}
/* Include here since we want most of this file to be stdio-free. */
#include <stdio.h>
-bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) {
+bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
+ bool rebuild_minitable) {
/* Since this function should never fail (it would indicate a bug in upb) we
* print errors to stderr instead of returning error status to the user. */
- upb_def_init **deps = init->deps;
- google_protobuf_FileDescriptorProto *file;
- upb_arena *arena;
- upb_status status;
+ _upb_DefPool_Init** deps = init->deps;
+ google_protobuf_FileDescriptorProto* file;
+ upb_Arena* arena;
+ upb_Status status;
- upb_status_clear(&status);
+ upb_Status_Clear(&status);
- if (upb_strtable_lookup(&s->files, init->filename, NULL)) {
+ if (upb_DefPool_FindFileByName(s, init->filename)) {
return true;
}
- arena = upb_arena_new();
+ arena = upb_Arena_New();
for (; *deps; deps++) {
- if (!_upb_symtab_loaddefinit(s, *deps)) goto err;
+ if (!_upb_DefPool_LoadDefInitEx(s, *deps, rebuild_minitable)) goto err;
}
file = google_protobuf_FileDescriptorProto_parse_ex(
- init->descriptor.data, init->descriptor.size, arena, UPB_DECODE_ALIAS);
+ init->descriptor.data, init->descriptor.size, NULL,
+ kUpb_DecodeOption_AliasString, arena);
s->bytes_loaded += init->descriptor.size;
if (!file) {
- upb_status_seterrf(
+ upb_Status_SetErrorFormat(
&status,
"Failed to parse compiled-in descriptor for file '%s'. This should "
"never happen.",
@@ -2159,20 +3181,81 @@ bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) {
goto err;
}
- if (!_upb_symtab_addfile(s, file, init->layouts, &status)) goto err;
+ const upb_MiniTable_File* mt = rebuild_minitable ? NULL : init->layout;
+ if (!_upb_DefPool_AddFile(s, file, mt, &status)) {
+ goto err;
+ }
- upb_arena_free(arena);
+ upb_Arena_Free(arena);
return true;
err:
- fprintf(stderr, "Error loading compiled-in descriptor: %s\n",
- upb_status_errmsg(&status));
- upb_arena_free(arena);
+ fprintf(stderr,
+ "Error loading compiled-in descriptor for file '%s' (this should "
+ "never happen): %s\n",
+ init->filename, upb_Status_ErrorMessage(&status));
+ upb_Arena_Free(arena);
return false;
}
-size_t _upb_symtab_bytesloaded(const upb_symtab *s) {
+size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s) {
return s->bytes_loaded;
}
+upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s) { return s->arena; }
+
+const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable(
+ const upb_DefPool* s, const upb_MiniTable_Extension* ext) {
+ upb_value v;
+ bool ok = upb_inttable_lookup(&s->exts, (uintptr_t)ext, &v);
+ UPB_ASSERT(ok);
+ return upb_value_getconstptr(v);
+}
+
+const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
+ const upb_MessageDef* m,
+ int32_t fieldnum) {
+ const upb_MiniTable* l = upb_MessageDef_MiniTable(m);
+ const upb_MiniTable_Extension* ext = _upb_extreg_get(s->extreg, l, fieldnum);
+ return ext ? _upb_DefPool_FindExtensionByMiniTable(s, ext) : NULL;
+}
+
+bool _upb_DefPool_registerlayout(upb_DefPool* s, const char* filename,
+ const upb_MiniTable_File* file) {
+ if (upb_DefPool_FindFileByName(s, filename)) return false;
+ upb_value v = pack_def(file, UPB_DEFTYPE_LAYOUT);
+ return upb_strtable_insert(&s->files, filename, strlen(filename), v,
+ s->arena);
+}
+
+const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
+ const upb_DefPool* s) {
+ return s->extreg;
+}
+
+const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
+ const upb_MessageDef* m,
+ size_t* count) {
+ size_t n = 0;
+ intptr_t iter = UPB_INTTABLE_BEGIN;
+ uintptr_t key;
+ upb_value val;
+ // This is O(all exts) instead of O(exts for m). If we need this to be
+ // efficient we may need to make extreg into a two-level table, or have a
+ // second per-message index.
+ while (upb_inttable_next2(&s->exts, &key, &val, &iter)) {
+ const upb_FieldDef* f = upb_value_getconstptr(val);
+ if (upb_FieldDef_ContainingType(f) == m) n++;
+ }
+ const upb_FieldDef** exts = malloc(n * sizeof(*exts));
+ iter = UPB_INTTABLE_BEGIN;
+ size_t i = 0;
+ while (upb_inttable_next2(&s->exts, &key, &val, &iter)) {
+ const upb_FieldDef* f = upb_value_getconstptr(val);
+ if (upb_FieldDef_ContainingType(f) == m) exts[i++] = f;
+ }
+ *count = n;
+ return exts;
+}
+
#undef CHK_OOM
diff --git a/grpc/third_party/upb/upb/def.h b/grpc/third_party/upb/upb/def.h
index 7206ec0d..a81b0070 100644
--- a/grpc/third_party/upb/upb/def.h
+++ b/grpc/third_party/upb/upb/def.h
@@ -1,315 +1,409 @@
/*
-** Defs are upb's internal representation of the constructs that can appear
-** in a .proto file:
-**
-** - upb_msgdef: describes a "message" construct.
-** - upb_fielddef: describes a message field.
-** - upb_filedef: describes a .proto file and its defs.
-** - upb_enumdef: describes an enum.
-** - upb_oneofdef: describes a oneof.
-**
-** TODO: definitions of services.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_DEF_H_
#define UPB_DEF_H_
-#include "upb/upb.h"
-#include "upb/table.int.h"
#include "google/protobuf/descriptor.upb.h"
+#include "upb/table_internal.h"
+#include "upb/upb.h"
+/* Must be last. */
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
-
-struct upb_enumdef;
-typedef struct upb_enumdef upb_enumdef;
-struct upb_fielddef;
-typedef struct upb_fielddef upb_fielddef;
-struct upb_filedef;
-typedef struct upb_filedef upb_filedef;
-struct upb_msgdef;
-typedef struct upb_msgdef upb_msgdef;
-struct upb_oneofdef;
-typedef struct upb_oneofdef upb_oneofdef;
-struct upb_symtab;
-typedef struct upb_symtab upb_symtab;
-
-typedef enum {
- UPB_SYNTAX_PROTO2 = 2,
- UPB_SYNTAX_PROTO3 = 3
-} upb_syntax_t;
+#endif /* __cplusplus */
+
+struct upb_EnumDef;
+typedef struct upb_EnumDef upb_EnumDef;
+struct upb_EnumValueDef;
+typedef struct upb_EnumValueDef upb_EnumValueDef;
+struct upb_ExtensionRange;
+typedef struct upb_ExtensionRange upb_ExtensionRange;
+struct upb_FieldDef;
+typedef struct upb_FieldDef upb_FieldDef;
+struct upb_FileDef;
+typedef struct upb_FileDef upb_FileDef;
+struct upb_MethodDef;
+typedef struct upb_MethodDef upb_MethodDef;
+struct upb_MessageDef;
+typedef struct upb_MessageDef upb_MessageDef;
+struct upb_OneofDef;
+typedef struct upb_OneofDef upb_OneofDef;
+struct upb_ServiceDef;
+typedef struct upb_ServiceDef upb_ServiceDef;
+struct upb_streamdef;
+typedef struct upb_streamdef upb_streamdef;
+struct upb_DefPool;
+typedef struct upb_DefPool upb_DefPool;
+
+typedef enum { kUpb_Syntax_Proto2 = 2, kUpb_Syntax_Proto3 = 3 } upb_Syntax;
/* All the different kind of well known type messages. For simplicity of check,
* number wrappers and string wrappers are grouped together. Make sure the
* order and merber of these groups are not changed.
*/
typedef enum {
- UPB_WELLKNOWN_UNSPECIFIED,
- UPB_WELLKNOWN_ANY,
- UPB_WELLKNOWN_FIELDMASK,
- UPB_WELLKNOWN_DURATION,
- UPB_WELLKNOWN_TIMESTAMP,
+ kUpb_WellKnown_Unspecified,
+ kUpb_WellKnown_Any,
+ kUpb_WellKnown_FieldMask,
+ kUpb_WellKnown_Duration,
+ kUpb_WellKnown_Timestamp,
/* number wrappers */
- UPB_WELLKNOWN_DOUBLEVALUE,
- UPB_WELLKNOWN_FLOATVALUE,
- UPB_WELLKNOWN_INT64VALUE,
- UPB_WELLKNOWN_UINT64VALUE,
- UPB_WELLKNOWN_INT32VALUE,
- UPB_WELLKNOWN_UINT32VALUE,
+ kUpb_WellKnown_DoubleValue,
+ kUpb_WellKnown_FloatValue,
+ kUpb_WellKnown_Int64Value,
+ kUpb_WellKnown_UInt64Value,
+ kUpb_WellKnown_Int32Value,
+ kUpb_WellKnown_UInt32Value,
/* string wrappers */
- UPB_WELLKNOWN_STRINGVALUE,
- UPB_WELLKNOWN_BYTESVALUE,
- UPB_WELLKNOWN_BOOLVALUE,
- UPB_WELLKNOWN_VALUE,
- UPB_WELLKNOWN_LISTVALUE,
- UPB_WELLKNOWN_STRUCT
-} upb_wellknowntype_t;
+ kUpb_WellKnown_StringValue,
+ kUpb_WellKnown_BytesValue,
+ kUpb_WellKnown_BoolValue,
+ kUpb_WellKnown_Value,
+ kUpb_WellKnown_ListValue,
+ kUpb_WellKnown_Struct
+} upb_WellKnown;
-/* upb_fielddef ***************************************************************/
+/* upb_FieldDef ***************************************************************/
/* Maximum field number allowed for FieldDefs. This is an inherent limit of the
* protobuf wire format. */
-#define UPB_MAX_FIELDNUMBER ((1 << 29) - 1)
-
-const char *upb_fielddef_fullname(const upb_fielddef *f);
-upb_fieldtype_t upb_fielddef_type(const upb_fielddef *f);
-upb_descriptortype_t upb_fielddef_descriptortype(const upb_fielddef *f);
-upb_label_t upb_fielddef_label(const upb_fielddef *f);
-uint32_t upb_fielddef_number(const upb_fielddef *f);
-const char *upb_fielddef_name(const upb_fielddef *f);
-const char *upb_fielddef_jsonname(const upb_fielddef *f);
-bool upb_fielddef_isextension(const upb_fielddef *f);
-bool upb_fielddef_lazy(const upb_fielddef *f);
-bool upb_fielddef_packed(const upb_fielddef *f);
-const upb_filedef *upb_fielddef_file(const upb_fielddef *f);
-const upb_msgdef *upb_fielddef_containingtype(const upb_fielddef *f);
-const upb_oneofdef *upb_fielddef_containingoneof(const upb_fielddef *f);
-const upb_oneofdef *upb_fielddef_realcontainingoneof(const upb_fielddef *f);
-uint32_t upb_fielddef_index(const upb_fielddef *f);
-bool upb_fielddef_issubmsg(const upb_fielddef *f);
-bool upb_fielddef_isstring(const upb_fielddef *f);
-bool upb_fielddef_isseq(const upb_fielddef *f);
-bool upb_fielddef_isprimitive(const upb_fielddef *f);
-bool upb_fielddef_ismap(const upb_fielddef *f);
-int64_t upb_fielddef_defaultint64(const upb_fielddef *f);
-int32_t upb_fielddef_defaultint32(const upb_fielddef *f);
-uint64_t upb_fielddef_defaultuint64(const upb_fielddef *f);
-uint32_t upb_fielddef_defaultuint32(const upb_fielddef *f);
-bool upb_fielddef_defaultbool(const upb_fielddef *f);
-float upb_fielddef_defaultfloat(const upb_fielddef *f);
-double upb_fielddef_defaultdouble(const upb_fielddef *f);
-const char *upb_fielddef_defaultstr(const upb_fielddef *f, size_t *len);
-bool upb_fielddef_hassubdef(const upb_fielddef *f);
-bool upb_fielddef_haspresence(const upb_fielddef *f);
-const upb_msgdef *upb_fielddef_msgsubdef(const upb_fielddef *f);
-const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f);
-const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f);
-
-/* Internal only. */
-uint32_t upb_fielddef_selectorbase(const upb_fielddef *f);
-
-/* upb_oneofdef ***************************************************************/
-
-typedef upb_inttable_iter upb_oneof_iter;
-
-const char *upb_oneofdef_name(const upb_oneofdef *o);
-const upb_msgdef *upb_oneofdef_containingtype(const upb_oneofdef *o);
-uint32_t upb_oneofdef_index(const upb_oneofdef *o);
-bool upb_oneofdef_issynthetic(const upb_oneofdef *o);
-int upb_oneofdef_fieldcount(const upb_oneofdef *o);
-const upb_fielddef *upb_oneofdef_field(const upb_oneofdef *o, int i);
+#define kUpb_MaxFieldNumber ((1 << 29) - 1)
+
+const google_protobuf_FieldOptions* upb_FieldDef_Options(const upb_FieldDef* f);
+bool upb_FieldDef_HasOptions(const upb_FieldDef* f);
+const char* upb_FieldDef_FullName(const upb_FieldDef* f);
+upb_CType upb_FieldDef_CType(const upb_FieldDef* f);
+upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f);
+upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
+uint32_t upb_FieldDef_Number(const upb_FieldDef* f);
+const char* upb_FieldDef_Name(const upb_FieldDef* f);
+const char* upb_FieldDef_JsonName(const upb_FieldDef* f);
+bool upb_FieldDef_HasJsonName(const upb_FieldDef* f);
+bool upb_FieldDef_IsExtension(const upb_FieldDef* f);
+bool upb_FieldDef_IsPacked(const upb_FieldDef* f);
+const upb_FileDef* upb_FieldDef_File(const upb_FieldDef* f);
+const upb_MessageDef* upb_FieldDef_ContainingType(const upb_FieldDef* f);
+const upb_MessageDef* upb_FieldDef_ExtensionScope(const upb_FieldDef* f);
+const upb_OneofDef* upb_FieldDef_ContainingOneof(const upb_FieldDef* f);
+const upb_OneofDef* upb_FieldDef_RealContainingOneof(const upb_FieldDef* f);
+uint32_t upb_FieldDef_Index(const upb_FieldDef* f);
+bool upb_FieldDef_IsSubMessage(const upb_FieldDef* f);
+bool upb_FieldDef_IsString(const upb_FieldDef* f);
+bool upb_FieldDef_IsRepeated(const upb_FieldDef* f);
+bool upb_FieldDef_IsPrimitive(const upb_FieldDef* f);
+bool upb_FieldDef_IsMap(const upb_FieldDef* f);
+bool upb_FieldDef_HasDefault(const upb_FieldDef* f);
+bool upb_FieldDef_HasSubDef(const upb_FieldDef* f);
+bool upb_FieldDef_HasPresence(const upb_FieldDef* f);
+const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
+const upb_EnumDef* upb_FieldDef_EnumSubDef(const upb_FieldDef* f);
+const upb_MiniTable_Field* upb_FieldDef_MiniTable(const upb_FieldDef* f);
+const upb_MiniTable_Extension* _upb_FieldDef_ExtensionMiniTable(
+ const upb_FieldDef* f);
+bool _upb_FieldDef_IsProto3Optional(const upb_FieldDef* f);
+
+/* upb_OneofDef ***************************************************************/
+
+const google_protobuf_OneofOptions* upb_OneofDef_Options(const upb_OneofDef* o);
+bool upb_OneofDef_HasOptions(const upb_OneofDef* o);
+const char* upb_OneofDef_Name(const upb_OneofDef* o);
+const upb_MessageDef* upb_OneofDef_ContainingType(const upb_OneofDef* o);
+uint32_t upb_OneofDef_Index(const upb_OneofDef* o);
+bool upb_OneofDef_IsSynthetic(const upb_OneofDef* o);
+int upb_OneofDef_FieldCount(const upb_OneofDef* o);
+const upb_FieldDef* upb_OneofDef_Field(const upb_OneofDef* o, int i);
/* Oneof lookups:
* - ntof: look up a field by name.
* - ntofz: look up a field by name (as a null-terminated string).
* - itof: look up a field by number. */
-const upb_fielddef *upb_oneofdef_ntof(const upb_oneofdef *o,
- const char *name, size_t length);
-UPB_INLINE const upb_fielddef *upb_oneofdef_ntofz(const upb_oneofdef *o,
- const char *name) {
- return upb_oneofdef_ntof(o, name, strlen(name));
+const upb_FieldDef* upb_OneofDef_LookupNameWithSize(const upb_OneofDef* o,
+ const char* name,
+ size_t length);
+UPB_INLINE const upb_FieldDef* upb_OneofDef_LookupName(const upb_OneofDef* o,
+ const char* name) {
+ return upb_OneofDef_LookupNameWithSize(o, name, strlen(name));
}
-const upb_fielddef *upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num);
+const upb_FieldDef* upb_OneofDef_LookupNumber(const upb_OneofDef* o,
+ uint32_t num);
-/* DEPRECATED, slated for removal. */
-int upb_oneofdef_numfields(const upb_oneofdef *o);
-void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o);
-void upb_oneof_next(upb_oneof_iter *iter);
-bool upb_oneof_done(upb_oneof_iter *iter);
-upb_fielddef *upb_oneof_iter_field(const upb_oneof_iter *iter);
-void upb_oneof_iter_setdone(upb_oneof_iter *iter);
-bool upb_oneof_iter_isequal(const upb_oneof_iter *iter1,
- const upb_oneof_iter *iter2);
-/* END DEPRECATED */
-
-/* upb_msgdef *****************************************************************/
-
-typedef upb_inttable_iter upb_msg_field_iter;
-typedef upb_strtable_iter upb_msg_oneof_iter;
+/* upb_MessageDef *************************************************************/
/* Well-known field tag numbers for map-entry messages. */
-#define UPB_MAPENTRY_KEY 1
-#define UPB_MAPENTRY_VALUE 2
+#define kUpb_MapEntry_KeyFieldNumber 1
+#define kUpb_MapEntry_ValueFieldNumber 2
/* Well-known field tag numbers for Any messages. */
-#define UPB_ANY_TYPE 1
-#define UPB_ANY_VALUE 2
+#define kUpb_Any_TypeFieldNumber 1
+#define kUpb_Any_ValueFieldNumber 2
+
+/* Well-known field tag numbers for duration messages. */
+#define kUpb_Duration_SecondsFieldNumber 1
+#define kUpb_Duration_NanosFieldNumber 2
/* Well-known field tag numbers for timestamp messages. */
-#define UPB_DURATION_SECONDS 1
-#define UPB_DURATION_NANOS 2
+#define kUpb_Timestamp_SecondsFieldNumber 1
+#define kUpb_Timestamp_NanosFieldNumber 2
+
+const google_protobuf_MessageOptions* upb_MessageDef_Options(
+ const upb_MessageDef* m);
+bool upb_MessageDef_HasOptions(const upb_MessageDef* m);
+const char* upb_MessageDef_FullName(const upb_MessageDef* m);
+const upb_FileDef* upb_MessageDef_File(const upb_MessageDef* m);
+const upb_MessageDef* upb_MessageDef_ContainingType(const upb_MessageDef* m);
+const char* upb_MessageDef_Name(const upb_MessageDef* m);
+upb_Syntax upb_MessageDef_Syntax(const upb_MessageDef* m);
+upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m);
+int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef* m);
+int upb_MessageDef_FieldCount(const upb_MessageDef* m);
+int upb_MessageDef_OneofCount(const upb_MessageDef* m);
+const upb_ExtensionRange* upb_MessageDef_ExtensionRange(const upb_MessageDef* m,
+ int i);
+const upb_FieldDef* upb_MessageDef_Field(const upb_MessageDef* m, int i);
+const upb_OneofDef* upb_MessageDef_Oneof(const upb_MessageDef* m, int i);
+const upb_FieldDef* upb_MessageDef_FindFieldByNumber(const upb_MessageDef* m,
+ uint32_t i);
+const upb_FieldDef* upb_MessageDef_FindFieldByNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len);
+const upb_OneofDef* upb_MessageDef_FindOneofByNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len);
+const upb_MiniTable* upb_MessageDef_MiniTable(const upb_MessageDef* m);
+
+UPB_INLINE const upb_OneofDef* upb_MessageDef_FindOneofByName(
+ const upb_MessageDef* m, const char* name) {
+ return upb_MessageDef_FindOneofByNameWithSize(m, name, strlen(name));
+}
-/* Well-known field tag numbers for duration messages. */
-#define UPB_TIMESTAMP_SECONDS 1
-#define UPB_TIMESTAMP_NANOS 2
-
-const char *upb_msgdef_fullname(const upb_msgdef *m);
-const upb_filedef *upb_msgdef_file(const upb_msgdef *m);
-const char *upb_msgdef_name(const upb_msgdef *m);
-upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m);
-bool upb_msgdef_mapentry(const upb_msgdef *m);
-upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m);
-bool upb_msgdef_iswrapper(const upb_msgdef *m);
-bool upb_msgdef_isnumberwrapper(const upb_msgdef *m);
-int upb_msgdef_fieldcount(const upb_msgdef *m);
-int upb_msgdef_oneofcount(const upb_msgdef *m);
-const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i);
-const upb_oneofdef *upb_msgdef_oneof(const upb_msgdef *m, int i);
-const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i);
-const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
- size_t len);
-const upb_oneofdef *upb_msgdef_ntoo(const upb_msgdef *m, const char *name,
- size_t len);
-const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m);
-
-UPB_INLINE const upb_oneofdef *upb_msgdef_ntooz(const upb_msgdef *m,
- const char *name) {
- return upb_msgdef_ntoo(m, name, strlen(name));
+UPB_INLINE const upb_FieldDef* upb_MessageDef_FindFieldByName(
+ const upb_MessageDef* m, const char* name) {
+ return upb_MessageDef_FindFieldByNameWithSize(m, name, strlen(name));
}
-UPB_INLINE const upb_fielddef *upb_msgdef_ntofz(const upb_msgdef *m,
- const char *name) {
- return upb_msgdef_ntof(m, name, strlen(name));
+UPB_INLINE bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) {
+ return google_protobuf_MessageOptions_map_entry(upb_MessageDef_Options(m));
}
-/* Internal-only. */
-size_t upb_msgdef_selectorcount(const upb_msgdef *m);
-uint32_t upb_msgdef_submsgfieldcount(const upb_msgdef *m);
+/* Nested entities. */
+int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m);
+int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m);
+int upb_MessageDef_NestedExtensionCount(const upb_MessageDef* m);
+const upb_MessageDef* upb_MessageDef_NestedMessage(const upb_MessageDef* m,
+ int i);
+const upb_EnumDef* upb_MessageDef_NestedEnum(const upb_MessageDef* m, int i);
+const upb_FieldDef* upb_MessageDef_NestedExtension(const upb_MessageDef* m,
+ int i);
/* Lookup of either field or oneof by name. Returns whether either was found.
* If the return is true, then the found def will be set, and the non-found
* one set to NULL. */
-bool upb_msgdef_lookupname(const upb_msgdef *m, const char *name, size_t len,
- const upb_fielddef **f, const upb_oneofdef **o);
-
-UPB_INLINE bool upb_msgdef_lookupnamez(const upb_msgdef *m, const char *name,
- const upb_fielddef **f,
- const upb_oneofdef **o) {
- return upb_msgdef_lookupname(m, name, strlen(name), f, o);
+bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef* m,
+ const char* name, size_t len,
+ const upb_FieldDef** f,
+ const upb_OneofDef** o);
+
+UPB_INLINE bool upb_MessageDef_FindByName(const upb_MessageDef* m,
+ const char* name,
+ const upb_FieldDef** f,
+ const upb_OneofDef** o) {
+ return upb_MessageDef_FindByNameWithSize(m, name, strlen(name), f, o);
}
/* Returns a field by either JSON name or regular proto name. */
-const upb_fielddef *upb_msgdef_lookupjsonname(const upb_msgdef *m,
- const char *name, size_t len);
-
-/* DEPRECATED, slated for removal */
-int upb_msgdef_numfields(const upb_msgdef *m);
-int upb_msgdef_numoneofs(const upb_msgdef *m);
-int upb_msgdef_numrealoneofs(const upb_msgdef *m);
-void upb_msg_field_begin(upb_msg_field_iter *iter, const upb_msgdef *m);
-void upb_msg_field_next(upb_msg_field_iter *iter);
-bool upb_msg_field_done(const upb_msg_field_iter *iter);
-upb_fielddef *upb_msg_iter_field(const upb_msg_field_iter *iter);
-void upb_msg_field_iter_setdone(upb_msg_field_iter *iter);
-bool upb_msg_field_iter_isequal(const upb_msg_field_iter * iter1,
- const upb_msg_field_iter * iter2);
-void upb_msg_oneof_begin(upb_msg_oneof_iter * iter, const upb_msgdef *m);
-void upb_msg_oneof_next(upb_msg_oneof_iter * iter);
-bool upb_msg_oneof_done(const upb_msg_oneof_iter *iter);
-const upb_oneofdef *upb_msg_iter_oneof(const upb_msg_oneof_iter *iter);
-void upb_msg_oneof_iter_setdone(upb_msg_oneof_iter * iter);
-bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1,
- const upb_msg_oneof_iter *iter2);
-/* END DEPRECATED */
-
-/* upb_enumdef ****************************************************************/
-
-typedef upb_strtable_iter upb_enum_iter;
-
-const char *upb_enumdef_fullname(const upb_enumdef *e);
-const char *upb_enumdef_name(const upb_enumdef *e);
-const upb_filedef *upb_enumdef_file(const upb_enumdef *e);
-int32_t upb_enumdef_default(const upb_enumdef *e);
-int upb_enumdef_numvals(const upb_enumdef *e);
-
-/* Enum lookups:
- * - ntoi: look up a name with specified length.
- * - ntoiz: look up a name provided as a null-terminated string.
- * - iton: look up an integer, returning the name as a null-terminated
- * string. */
-bool upb_enumdef_ntoi(const upb_enumdef *e, const char *name, size_t len,
- int32_t *num);
-UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e,
- const char *name, int32_t *num) {
- return upb_enumdef_ntoi(e, name, strlen(name), num);
+const upb_FieldDef* upb_MessageDef_FindByJsonNameWithSize(
+ const upb_MessageDef* m, const char* name, size_t len);
+UPB_INLINE const upb_FieldDef* upb_MessageDef_FindByJsonName(
+ const upb_MessageDef* m, const char* name) {
+ return upb_MessageDef_FindByJsonNameWithSize(m, name, strlen(name));
}
-const char *upb_enumdef_iton(const upb_enumdef *e, int32_t num);
-
-void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e);
-void upb_enum_next(upb_enum_iter *iter);
-bool upb_enum_done(upb_enum_iter *iter);
-const char *upb_enum_iter_name(upb_enum_iter *iter);
-int32_t upb_enum_iter_number(upb_enum_iter *iter);
-
-/* upb_filedef ****************************************************************/
-
-const char *upb_filedef_name(const upb_filedef *f);
-const char *upb_filedef_package(const upb_filedef *f);
-const char *upb_filedef_phpprefix(const upb_filedef *f);
-const char *upb_filedef_phpnamespace(const upb_filedef *f);
-upb_syntax_t upb_filedef_syntax(const upb_filedef *f);
-int upb_filedef_depcount(const upb_filedef *f);
-int upb_filedef_msgcount(const upb_filedef *f);
-int upb_filedef_enumcount(const upb_filedef *f);
-const upb_filedef *upb_filedef_dep(const upb_filedef *f, int i);
-const upb_msgdef *upb_filedef_msg(const upb_filedef *f, int i);
-const upb_enumdef *upb_filedef_enum(const upb_filedef *f, int i);
-const upb_symtab *upb_filedef_symtab(const upb_filedef *f);
-
-/* upb_symtab *****************************************************************/
-
-upb_symtab *upb_symtab_new(void);
-void upb_symtab_free(upb_symtab* s);
-const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym);
-const upb_msgdef *upb_symtab_lookupmsg2(
- const upb_symtab *s, const char *sym, size_t len);
-const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym);
-const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name);
-const upb_filedef *upb_symtab_lookupfile2(
- const upb_symtab *s, const char *name, size_t len);
-int upb_symtab_filecount(const upb_symtab *s);
-const upb_filedef *upb_symtab_addfile(
- upb_symtab *s, const google_protobuf_FileDescriptorProto *file,
- upb_status *status);
-size_t _upb_symtab_bytesloaded(const upb_symtab *s);
-/* For generated code only: loads a generated descriptor. */
-typedef struct upb_def_init {
- struct upb_def_init **deps; /* Dependencies of this file. */
- const upb_msglayout **layouts; /* Pre-order layouts of all messages. */
- const char *filename;
- upb_strview descriptor; /* Serialized descriptor. */
-} upb_def_init;
+/* upb_ExtensionRange *********************************************************/
+
+const google_protobuf_ExtensionRangeOptions* upb_ExtensionRange_Options(
+ const upb_ExtensionRange* r);
+bool upb_ExtensionRange_HasOptions(const upb_ExtensionRange* r);
+int32_t upb_ExtensionRange_Start(const upb_ExtensionRange* r);
+int32_t upb_ExtensionRange_End(const upb_ExtensionRange* r);
+
+/* upb_EnumDef ****************************************************************/
+
+const google_protobuf_EnumOptions* upb_EnumDef_Options(const upb_EnumDef* e);
+bool upb_EnumDef_HasOptions(const upb_EnumDef* e);
+const char* upb_EnumDef_FullName(const upb_EnumDef* e);
+const char* upb_EnumDef_Name(const upb_EnumDef* e);
+const upb_FileDef* upb_EnumDef_File(const upb_EnumDef* e);
+const upb_MessageDef* upb_EnumDef_ContainingType(const upb_EnumDef* e);
+int32_t upb_EnumDef_Default(const upb_EnumDef* e);
+int upb_EnumDef_ValueCount(const upb_EnumDef* e);
+const upb_EnumValueDef* upb_EnumDef_Value(const upb_EnumDef* e, int i);
+
+const upb_EnumValueDef* upb_EnumDef_FindValueByNameWithSize(
+ const upb_EnumDef* e, const char* name, size_t len);
+const upb_EnumValueDef* upb_EnumDef_FindValueByNumber(const upb_EnumDef* e,
+ int32_t num);
+bool upb_EnumDef_CheckNumber(const upb_EnumDef* e, int32_t num);
+
+// Convenience wrapper.
+UPB_INLINE const upb_EnumValueDef* upb_EnumDef_FindValueByName(
+ const upb_EnumDef* e, const char* name) {
+ return upb_EnumDef_FindValueByNameWithSize(e, name, strlen(name));
+}
+
+/* upb_EnumValueDef ***********************************************************/
+
+const google_protobuf_EnumValueOptions* upb_EnumValueDef_Options(
+ const upb_EnumValueDef* e);
+bool upb_EnumValueDef_HasOptions(const upb_EnumValueDef* e);
+const char* upb_EnumValueDef_FullName(const upb_EnumValueDef* e);
+const char* upb_EnumValueDef_Name(const upb_EnumValueDef* e);
+int32_t upb_EnumValueDef_Number(const upb_EnumValueDef* e);
+uint32_t upb_EnumValueDef_Index(const upb_EnumValueDef* e);
+const upb_EnumDef* upb_EnumValueDef_Enum(const upb_EnumValueDef* e);
+
+/* upb_FileDef ****************************************************************/
+
+const google_protobuf_FileOptions* upb_FileDef_Options(const upb_FileDef* f);
+bool upb_FileDef_HasOptions(const upb_FileDef* f);
+const char* upb_FileDef_Name(const upb_FileDef* f);
+const char* upb_FileDef_Package(const upb_FileDef* f);
+upb_Syntax upb_FileDef_Syntax(const upb_FileDef* f);
+int upb_FileDef_DependencyCount(const upb_FileDef* f);
+int upb_FileDef_PublicDependencyCount(const upb_FileDef* f);
+int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);
+int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
+int upb_FileDef_TopLevelEnumCount(const upb_FileDef* f);
+int upb_FileDef_TopLevelExtensionCount(const upb_FileDef* f);
+int upb_FileDef_ServiceCount(const upb_FileDef* f);
+const upb_FileDef* upb_FileDef_Dependency(const upb_FileDef* f, int i);
+const upb_FileDef* upb_FileDef_PublicDependency(const upb_FileDef* f, int i);
+const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
+const upb_MessageDef* upb_FileDef_TopLevelMessage(const upb_FileDef* f, int i);
+const upb_EnumDef* upb_FileDef_TopLevelEnum(const upb_FileDef* f, int i);
+const upb_FieldDef* upb_FileDef_TopLevelExtension(const upb_FileDef* f, int i);
+const upb_ServiceDef* upb_FileDef_Service(const upb_FileDef* f, int i);
+const upb_DefPool* upb_FileDef_Pool(const upb_FileDef* f);
+const int32_t* _upb_FileDef_PublicDependencyIndexes(const upb_FileDef* f);
+const int32_t* _upb_FileDef_WeakDependencyIndexes(const upb_FileDef* f);
+
+/* upb_MethodDef **************************************************************/
+
+const google_protobuf_MethodOptions* upb_MethodDef_Options(
+ const upb_MethodDef* m);
+bool upb_MethodDef_HasOptions(const upb_MethodDef* m);
+const char* upb_MethodDef_FullName(const upb_MethodDef* m);
+int upb_MethodDef_Index(const upb_MethodDef* m);
+const char* upb_MethodDef_Name(const upb_MethodDef* m);
+const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m);
+const upb_MessageDef* upb_MethodDef_InputType(const upb_MethodDef* m);
+const upb_MessageDef* upb_MethodDef_OutputType(const upb_MethodDef* m);
+bool upb_MethodDef_ClientStreaming(const upb_MethodDef* m);
+bool upb_MethodDef_ServerStreaming(const upb_MethodDef* m);
+
+/* upb_ServiceDef *************************************************************/
+
+const google_protobuf_ServiceOptions* upb_ServiceDef_Options(
+ const upb_ServiceDef* s);
+bool upb_ServiceDef_HasOptions(const upb_ServiceDef* s);
+const char* upb_ServiceDef_FullName(const upb_ServiceDef* s);
+const char* upb_ServiceDef_Name(const upb_ServiceDef* s);
+int upb_ServiceDef_Index(const upb_ServiceDef* s);
+const upb_FileDef* upb_ServiceDef_File(const upb_ServiceDef* s);
+int upb_ServiceDef_MethodCount(const upb_ServiceDef* s);
+const upb_MethodDef* upb_ServiceDef_Method(const upb_ServiceDef* s, int i);
+const upb_MethodDef* upb_ServiceDef_FindMethodByName(const upb_ServiceDef* s,
+ const char* name);
+
+/* upb_DefPool ****************************************************************/
+
+upb_DefPool* upb_DefPool_New(void);
+void upb_DefPool_Free(upb_DefPool* s);
+const upb_MessageDef* upb_DefPool_FindMessageByName(const upb_DefPool* s,
+ const char* sym);
+const upb_MessageDef* upb_DefPool_FindMessageByNameWithSize(
+ const upb_DefPool* s, const char* sym, size_t len);
+const upb_EnumDef* upb_DefPool_FindEnumByName(const upb_DefPool* s,
+ const char* sym);
+const upb_EnumValueDef* upb_DefPool_FindEnumByNameval(const upb_DefPool* s,
+ const char* sym);
+const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s,
+ const char* sym);
+const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize(
+ const upb_DefPool* s, const char* sym, size_t len);
+const upb_FileDef* upb_DefPool_FindFileByName(const upb_DefPool* s,
+ const char* name);
+const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s,
+ const char* name);
+const upb_ServiceDef* upb_DefPool_FindServiceByNameWithSize(
+ const upb_DefPool* s, const char* name, size_t size);
+const upb_FileDef* upb_DefPool_FindFileContainingSymbol(const upb_DefPool* s,
+ const char* name);
+const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s,
+ const char* name,
+ size_t len);
+const upb_FileDef* upb_DefPool_AddFile(
+ upb_DefPool* s, const google_protobuf_FileDescriptorProto* file,
+ upb_Status* status);
+size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s);
+upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s);
+const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable(
+ const upb_DefPool* s, const upb_MiniTable_Extension* ext);
+const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s,
+ const upb_MessageDef* m,
+ int32_t fieldnum);
+const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry(
+ const upb_DefPool* s);
+const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s,
+ const upb_MessageDef* m,
+ size_t* count);
-bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init);
+/* For generated code only: loads a generated descriptor. */
+typedef struct _upb_DefPool_Init {
+ struct _upb_DefPool_Init** deps; /* Dependencies of this file. */
+ const upb_MiniTable_File* layout;
+ const char* filename;
+ upb_StringView descriptor; /* Serialized descriptor. */
+} _upb_DefPool_Init;
+
+// Should only be directly called by tests. This variant lets us suppress
+// the use of compiled-in tables, forcing a rebuild of the tables at runtime.
+bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init,
+ bool rebuild_minitable);
+
+UPB_INLINE bool _upb_DefPool_LoadDefInit(upb_DefPool* s,
+ const _upb_DefPool_Init* init) {
+ return _upb_DefPool_LoadDefInitEx(s, init, false);
+}
#include "upb/port_undef.inc"
#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
+} /* extern "C" */
+#endif /* __cplusplus */
#endif /* UPB_DEF_H_ */
diff --git a/grpc/third_party/upb/upb/def.hpp b/grpc/third_party/upb/upb/def.hpp
index e32da2a1..aaf94962 100644
--- a/grpc/third_party/upb/upb/def.hpp
+++ b/grpc/third_party/upb/upb/def.hpp
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef UPB_DEF_HPP_
#define UPB_DEF_HPP_
@@ -8,59 +32,54 @@
#include <vector>
#include "upb/def.h"
+#include "upb/reflection.h"
#include "upb/upb.hpp"
namespace upb {
+typedef upb_MessageValue MessageValue;
+
class EnumDefPtr;
+class FileDefPtr;
class MessageDefPtr;
class OneofDefPtr;
// A upb::FieldDefPtr describes a single field in a message. It is most often
-// found as a part of a upb_msgdef, but can also stand alone to represent
+// found as a part of a upb_MessageDef, but can also stand alone to represent
// an extension.
class FieldDefPtr {
public:
FieldDefPtr() : ptr_(nullptr) {}
- explicit FieldDefPtr(const upb_fielddef* ptr) : ptr_(ptr) {}
+ explicit FieldDefPtr(const upb_FieldDef* ptr) : ptr_(ptr) {}
- const upb_fielddef* ptr() const { return ptr_; }
+ const upb_FieldDef* ptr() const { return ptr_; }
explicit operator bool() const { return ptr_ != nullptr; }
- typedef upb_fieldtype_t Type;
- typedef upb_label_t Label;
- typedef upb_descriptortype_t DescriptorType;
-
- const char* full_name() const { return upb_fielddef_fullname(ptr_); }
+ typedef upb_CType Type;
+ typedef upb_Label Label;
+ typedef upb_FieldType DescriptorType;
- Type type() const { return upb_fielddef_type(ptr_); }
- Label label() const { return upb_fielddef_label(ptr_); }
- const char* name() const { return upb_fielddef_name(ptr_); }
- const char* json_name() const { return upb_fielddef_jsonname(ptr_); }
- uint32_t number() const { return upb_fielddef_number(ptr_); }
- bool is_extension() const { return upb_fielddef_isextension(ptr_); }
+ const char* full_name() const { return upb_FieldDef_FullName(ptr_); }
- // For UPB_TYPE_MESSAGE fields only where is_tag_delimited() == false,
- // indicates whether this field should have lazy parsing handlers that yield
- // the unparsed string for the submessage.
- //
- // TODO(haberman): I think we want to move this into a FieldOptions container
- // when we add support for custom options (the FieldOptions struct will
- // contain both regular FieldOptions like "lazy" *and* custom options).
- bool lazy() const { return upb_fielddef_lazy(ptr_); }
+ Type type() const { return upb_FieldDef_CType(ptr_); }
+ Label label() const { return upb_FieldDef_Label(ptr_); }
+ const char* name() const { return upb_FieldDef_Name(ptr_); }
+ const char* json_name() const { return upb_FieldDef_JsonName(ptr_); }
+ uint32_t number() const { return upb_FieldDef_Number(ptr_); }
+ bool is_extension() const { return upb_FieldDef_IsExtension(ptr_); }
// For non-string, non-submessage fields, this indicates whether binary
// protobufs are encoded in packed or non-packed format.
//
- // TODO(haberman): see note above about putting options like this into a
- // FieldOptions container.
- bool packed() const { return upb_fielddef_packed(ptr_); }
+ // Note: this accessor reflects the fact that "packed" has different defaults
+ // depending on whether the proto is proto2 or proto3.
+ bool packed() const { return upb_FieldDef_IsPacked(ptr_); }
// An integer that can be used as an index into an array of fields for
// whatever message this field belongs to. Guaranteed to be less than
// f->containing_type()->field_count(). May only be accessed once the def has
// been finalized.
- uint32_t index() const { return upb_fielddef_index(ptr_); }
+ uint32_t index() const { return upb_FieldDef_Index(ptr_); }
// The MessageDef to which this field belongs.
//
@@ -81,72 +100,54 @@ class FieldDefPtr {
// INT32 and SINT32, whereas our "type" enum does not. This return of
// descriptor_type() is a function of type(), integer_format(), and
// is_tag_delimited().
- DescriptorType descriptor_type() const {
- return upb_fielddef_descriptortype(ptr_);
- }
+ DescriptorType descriptor_type() const { return upb_FieldDef_Type(ptr_); }
// Convenient field type tests.
- bool IsSubMessage() const { return upb_fielddef_issubmsg(ptr_); }
- bool IsString() const { return upb_fielddef_isstring(ptr_); }
- bool IsSequence() const { return upb_fielddef_isseq(ptr_); }
- bool IsPrimitive() const { return upb_fielddef_isprimitive(ptr_); }
- bool IsMap() const { return upb_fielddef_ismap(ptr_); }
-
- // Returns the non-string default value for this fielddef, which may either
- // be something the client set explicitly or the "default default" (0 for
- // numbers, empty for strings). The field's type indicates the type of the
- // returned value, except for enum fields that are still mutable.
- //
- // Requires that the given function matches the field's current type.
- int64_t default_int64() const { return upb_fielddef_defaultint64(ptr_); }
- int32_t default_int32() const { return upb_fielddef_defaultint32(ptr_); }
- uint64_t default_uint64() const { return upb_fielddef_defaultuint64(ptr_); }
- uint32_t default_uint32() const { return upb_fielddef_defaultuint32(ptr_); }
- bool default_bool() const { return upb_fielddef_defaultbool(ptr_); }
- float default_float() const { return upb_fielddef_defaultfloat(ptr_); }
- double default_double() const { return upb_fielddef_defaultdouble(ptr_); }
-
- // The resulting string is always NULL-terminated. If non-NULL, the length
- // will be stored in *len.
- const char* default_string(size_t* len) const {
- return upb_fielddef_defaultstr(ptr_, len);
- }
+ bool IsSubMessage() const { return upb_FieldDef_IsSubMessage(ptr_); }
+ bool IsString() const { return upb_FieldDef_IsString(ptr_); }
+ bool IsSequence() const { return upb_FieldDef_IsRepeated(ptr_); }
+ bool IsPrimitive() const { return upb_FieldDef_IsPrimitive(ptr_); }
+ bool IsMap() const { return upb_FieldDef_IsMap(ptr_); }
+
+ MessageValue default_value() const { return upb_FieldDef_Default(ptr_); }
// Returns the enum or submessage def for this field, if any. The field's
// type must match (ie. you may only call enum_subdef() for fields where
- // type() == UPB_TYPE_ENUM).
+ // type() == kUpb_CType_Enum).
EnumDefPtr enum_subdef() const;
MessageDefPtr message_subdef() const;
private:
- const upb_fielddef* ptr_;
+ const upb_FieldDef* ptr_;
};
// Class that represents a oneof.
class OneofDefPtr {
public:
OneofDefPtr() : ptr_(nullptr) {}
- explicit OneofDefPtr(const upb_oneofdef* ptr) : ptr_(ptr) {}
+ explicit OneofDefPtr(const upb_OneofDef* ptr) : ptr_(ptr) {}
- const upb_oneofdef* ptr() const { return ptr_; }
+ const upb_OneofDef* ptr() const { return ptr_; }
explicit operator bool() const { return ptr_ != nullptr; }
// Returns the MessageDef that contains this OneofDef.
MessageDefPtr containing_type() const;
// Returns the name of this oneof.
- const char* name() const { return upb_oneofdef_name(ptr_); }
+ const char* name() const { return upb_OneofDef_Name(ptr_); }
// Returns the number of fields in the oneof.
- int field_count() const { return upb_oneofdef_numfields(ptr_); }
- FieldDefPtr field(int i) const { return FieldDefPtr(upb_oneofdef_field(ptr_, i)); }
+ int field_count() const { return upb_OneofDef_FieldCount(ptr_); }
+ FieldDefPtr field(int i) const {
+ return FieldDefPtr(upb_OneofDef_Field(ptr_, i));
+ }
// Looks up by name.
FieldDefPtr FindFieldByName(const char* name, size_t len) const {
- return FieldDefPtr(upb_oneofdef_ntof(ptr_, name, len));
+ return FieldDefPtr(upb_OneofDef_LookupNameWithSize(ptr_, name, len));
}
FieldDefPtr FindFieldByName(const char* name) const {
- return FieldDefPtr(upb_oneofdef_ntofz(ptr_, name));
+ return FieldDefPtr(upb_OneofDef_LookupName(ptr_, name));
}
template <class T>
@@ -156,44 +157,50 @@ class OneofDefPtr {
// Looks up by tag number.
FieldDefPtr FindFieldByNumber(uint32_t num) const {
- return FieldDefPtr(upb_oneofdef_itof(ptr_, num));
+ return FieldDefPtr(upb_OneofDef_LookupNumber(ptr_, num));
}
private:
- const upb_oneofdef* ptr_;
+ const upb_OneofDef* ptr_;
};
// Structure that describes a single .proto message type.
class MessageDefPtr {
public:
MessageDefPtr() : ptr_(nullptr) {}
- explicit MessageDefPtr(const upb_msgdef* ptr) : ptr_(ptr) {}
+ explicit MessageDefPtr(const upb_MessageDef* ptr) : ptr_(ptr) {}
- const upb_msgdef* ptr() const { return ptr_; }
+ const upb_MessageDef* ptr() const { return ptr_; }
explicit operator bool() const { return ptr_ != nullptr; }
- const char* full_name() const { return upb_msgdef_fullname(ptr_); }
- const char* name() const { return upb_msgdef_name(ptr_); }
+ FileDefPtr file() const;
+
+ const char* full_name() const { return upb_MessageDef_FullName(ptr_); }
+ const char* name() const { return upb_MessageDef_Name(ptr_); }
// The number of fields that belong to the MessageDef.
- int field_count() const { return upb_msgdef_numfields(ptr_); }
- FieldDefPtr field(int i) const { return FieldDefPtr(upb_msgdef_field(ptr_, i)); }
+ int field_count() const { return upb_MessageDef_FieldCount(ptr_); }
+ FieldDefPtr field(int i) const {
+ return FieldDefPtr(upb_MessageDef_Field(ptr_, i));
+ }
// The number of oneofs that belong to the MessageDef.
- int oneof_count() const { return upb_msgdef_numoneofs(ptr_); }
- OneofDefPtr oneof(int i) const { return OneofDefPtr(upb_msgdef_oneof(ptr_, i)); }
+ int oneof_count() const { return upb_MessageDef_OneofCount(ptr_); }
+ OneofDefPtr oneof(int i) const {
+ return OneofDefPtr(upb_MessageDef_Oneof(ptr_, i));
+ }
- upb_syntax_t syntax() const { return upb_msgdef_syntax(ptr_); }
+ upb_Syntax syntax() const { return upb_MessageDef_Syntax(ptr_); }
// These return null pointers if the field is not found.
FieldDefPtr FindFieldByNumber(uint32_t number) const {
- return FieldDefPtr(upb_msgdef_itof(ptr_, number));
+ return FieldDefPtr(upb_MessageDef_FindFieldByNumber(ptr_, number));
}
FieldDefPtr FindFieldByName(const char* name, size_t len) const {
- return FieldDefPtr(upb_msgdef_ntof(ptr_, name, len));
+ return FieldDefPtr(upb_MessageDef_FindFieldByNameWithSize(ptr_, name, len));
}
FieldDefPtr FindFieldByName(const char* name) const {
- return FieldDefPtr(upb_msgdef_ntofz(ptr_, name));
+ return FieldDefPtr(upb_MessageDef_FindFieldByName(ptr_, name));
}
template <class T>
@@ -202,11 +209,11 @@ class MessageDefPtr {
}
OneofDefPtr FindOneofByName(const char* name, size_t len) const {
- return OneofDefPtr(upb_msgdef_ntoo(ptr_, name, len));
+ return OneofDefPtr(upb_MessageDef_FindOneofByNameWithSize(ptr_, name, len));
}
OneofDefPtr FindOneofByName(const char* name) const {
- return OneofDefPtr(upb_msgdef_ntooz(ptr_, name));
+ return OneofDefPtr(upb_MessageDef_FindOneofByName(ptr_, name));
}
template <class T>
@@ -215,64 +222,65 @@ class MessageDefPtr {
}
// Is this message a map entry?
- bool mapentry() const { return upb_msgdef_mapentry(ptr_); }
+ bool mapentry() const { return upb_MessageDef_IsMapEntry(ptr_); }
- // Return the type of well known type message. UPB_WELLKNOWN_UNSPECIFIED for
+ // Return the type of well known type message. kUpb_WellKnown_Unspecified for
// non-well-known message.
- upb_wellknowntype_t wellknowntype() const {
- return upb_msgdef_wellknowntype(ptr_);
+ upb_WellKnown wellknowntype() const {
+ return upb_MessageDef_WellKnownType(ptr_);
}
- // Whether is a number wrapper.
- bool isnumberwrapper() const { return upb_msgdef_isnumberwrapper(ptr_); }
-
private:
class FieldIter {
public:
- explicit FieldIter(const upb_msgdef *m, int i) : m_(m), i_(i) {}
+ explicit FieldIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {}
void operator++() { i_++; }
- FieldDefPtr operator*() { return FieldDefPtr(upb_msgdef_field(m_, i_)); }
+ FieldDefPtr operator*() {
+ return FieldDefPtr(upb_MessageDef_Field(m_, i_));
+ }
bool operator!=(const FieldIter& other) { return i_ != other.i_; }
bool operator==(const FieldIter& other) { return i_ == other.i_; }
private:
- const upb_msgdef *m_;
+ const upb_MessageDef* m_;
int i_;
};
class FieldAccessor {
public:
- explicit FieldAccessor(const upb_msgdef* md) : md_(md) {}
+ explicit FieldAccessor(const upb_MessageDef* md) : md_(md) {}
FieldIter begin() { return FieldIter(md_, 0); }
- FieldIter end() { return FieldIter(md_, upb_msgdef_fieldcount(md_)); }
+ FieldIter end() { return FieldIter(md_, upb_MessageDef_FieldCount(md_)); }
private:
- const upb_msgdef* md_;
+ const upb_MessageDef* md_;
};
class OneofIter {
public:
- explicit OneofIter(const upb_msgdef *m, int i) : m_(m), i_(i) {}
+ explicit OneofIter(const upb_MessageDef* m, int i) : m_(m), i_(i) {}
void operator++() { i_++; }
- OneofDefPtr operator*() { return OneofDefPtr(upb_msgdef_oneof(m_, i_)); }
+ OneofDefPtr operator*() {
+ return OneofDefPtr(upb_MessageDef_Oneof(m_, i_));
+ }
bool operator!=(const OneofIter& other) { return i_ != other.i_; }
bool operator==(const OneofIter& other) { return i_ == other.i_; }
private:
- const upb_msgdef *m_;
+ const upb_MessageDef* m_;
int i_;
};
class OneofAccessor {
public:
- explicit OneofAccessor(const upb_msgdef* md) : md_(md) {}
+ explicit OneofAccessor(const upb_MessageDef* md) : md_(md) {}
OneofIter begin() { return OneofIter(md_, 0); }
- OneofIter end() { return OneofIter(md_, upb_msgdef_oneofcount(md_)); }
+ OneofIter end() { return OneofIter(md_, upb_MessageDef_OneofCount(md_)); }
private:
- const upb_msgdef* md_;
+ const upb_MessageDef* md_;
};
public:
@@ -280,62 +288,58 @@ class MessageDefPtr {
OneofAccessor oneofs() const { return OneofAccessor(ptr()); }
private:
- const upb_msgdef* ptr_;
+ const upb_MessageDef* ptr_;
+};
+
+class EnumValDefPtr {
+ public:
+ EnumValDefPtr() : ptr_(nullptr) {}
+ explicit EnumValDefPtr(const upb_EnumValueDef* ptr) : ptr_(ptr) {}
+
+ int32_t number() const { return upb_EnumValueDef_Number(ptr_); }
+ const char* full_name() const { return upb_EnumValueDef_FullName(ptr_); }
+ const char* name() const { return upb_EnumValueDef_Name(ptr_); }
+
+ private:
+ const upb_EnumValueDef* ptr_;
};
class EnumDefPtr {
public:
EnumDefPtr() : ptr_(nullptr) {}
- explicit EnumDefPtr(const upb_enumdef* ptr) : ptr_(ptr) {}
+ explicit EnumDefPtr(const upb_EnumDef* ptr) : ptr_(ptr) {}
- const upb_enumdef* ptr() const { return ptr_; }
+ const upb_EnumDef* ptr() const { return ptr_; }
explicit operator bool() const { return ptr_ != nullptr; }
- const char* full_name() const { return upb_enumdef_fullname(ptr_); }
- const char* name() const { return upb_enumdef_name(ptr_); }
+ const char* full_name() const { return upb_EnumDef_FullName(ptr_); }
+ const char* name() const { return upb_EnumDef_Name(ptr_); }
// The value that is used as the default when no field default is specified.
// If not set explicitly, the first value that was added will be used.
// The default value must be a member of the enum.
// Requires that value_count() > 0.
- int32_t default_value() const { return upb_enumdef_default(ptr_); }
+ int32_t default_value() const { return upb_EnumDef_Default(ptr_); }
// Returns the number of values currently defined in the enum. Note that
// multiple names can refer to the same number, so this may be greater than
// the total number of unique numbers.
- int value_count() const { return upb_enumdef_numvals(ptr_); }
+ int value_count() const { return upb_EnumDef_ValueCount(ptr_); }
// Lookups from name to integer, returning true if found.
- bool FindValueByName(const char* name, int32_t* num) const {
- return upb_enumdef_ntoiz(ptr_, name, num);
+ EnumValDefPtr FindValueByName(const char* name) const {
+ return EnumValDefPtr(upb_EnumDef_FindValueByName(ptr_, name));
}
// Finds the name corresponding to the given number, or NULL if none was
// found. If more than one name corresponds to this number, returns the
// first one that was added.
- const char* FindValueByNumber(int32_t num) const {
- return upb_enumdef_iton(ptr_, num);
+ EnumValDefPtr FindValueByNumber(int32_t num) const {
+ return EnumValDefPtr(upb_EnumDef_FindValueByNumber(ptr_, num));
}
- // Iteration over name/value pairs. The order is undefined.
- // Adding an enum val invalidates any iterators.
- //
- // TODO: make compatible with range-for, with elements as pairs?
- class Iterator {
- public:
- explicit Iterator(EnumDefPtr e) { upb_enum_begin(&iter_, e.ptr()); }
-
- int32_t number() { return upb_enum_iter_number(&iter_); }
- const char* name() { return upb_enum_iter_name(&iter_); }
- bool Done() { return upb_enum_done(&iter_); }
- void Next() { return upb_enum_next(&iter_); }
-
- private:
- upb_enum_iter iter_;
- };
-
private:
- const upb_enumdef* ptr_;
+ const upb_EnumDef* ptr_;
};
// Class that represents a .proto file with some things defined in it.
@@ -344,61 +348,52 @@ class EnumDefPtr {
// read the values of file-level options.
class FileDefPtr {
public:
- explicit FileDefPtr(const upb_filedef* ptr) : ptr_(ptr) {}
+ explicit FileDefPtr(const upb_FileDef* ptr) : ptr_(ptr) {}
- const upb_filedef* ptr() const { return ptr_; }
+ const upb_FileDef* ptr() const { return ptr_; }
explicit operator bool() const { return ptr_ != nullptr; }
// Get/set name of the file (eg. "foo/bar.proto").
- const char* name() const { return upb_filedef_name(ptr_); }
+ const char* name() const { return upb_FileDef_Name(ptr_); }
// Package name for definitions inside the file (eg. "foo.bar").
- const char* package() const { return upb_filedef_package(ptr_); }
-
- // Sets the php class prefix which is prepended to all php generated classes
- // from this .proto. Default is empty.
- const char* phpprefix() const { return upb_filedef_phpprefix(ptr_); }
-
- // Use this option to change the namespace of php generated classes. Default
- // is empty. When this option is empty, the package name will be used for
- // determining the namespace.
- const char* phpnamespace() const { return upb_filedef_phpnamespace(ptr_); }
+ const char* package() const { return upb_FileDef_Package(ptr_); }
// Syntax for the file. Defaults to proto2.
- upb_syntax_t syntax() const { return upb_filedef_syntax(ptr_); }
+ upb_Syntax syntax() const { return upb_FileDef_Syntax(ptr_); }
// Get the list of dependencies from the file. These are returned in the
// order that they were added to the FileDefPtr.
- int dependency_count() const { return upb_filedef_depcount(ptr_); }
+ int dependency_count() const { return upb_FileDef_DependencyCount(ptr_); }
const FileDefPtr dependency(int index) const {
- return FileDefPtr(upb_filedef_dep(ptr_, index));
+ return FileDefPtr(upb_FileDef_Dependency(ptr_, index));
}
private:
- const upb_filedef* ptr_;
+ const upb_FileDef* ptr_;
};
// Non-const methods in upb::SymbolTable are NOT thread-safe.
class SymbolTable {
public:
- SymbolTable() : ptr_(upb_symtab_new(), upb_symtab_free) {}
- explicit SymbolTable(upb_symtab* s) : ptr_(s, upb_symtab_free) {}
+ SymbolTable() : ptr_(upb_DefPool_New(), upb_DefPool_Free) {}
+ explicit SymbolTable(upb_DefPool* s) : ptr_(s, upb_DefPool_Free) {}
- const upb_symtab* ptr() const { return ptr_.get(); }
- upb_symtab* ptr() { return ptr_.get(); }
+ const upb_DefPool* ptr() const { return ptr_.get(); }
+ upb_DefPool* ptr() { return ptr_.get(); }
// Finds an entry in the symbol table with this exact name. If not found,
// returns NULL.
- MessageDefPtr LookupMessage(const char* sym) const {
- return MessageDefPtr(upb_symtab_lookupmsg(ptr_.get(), sym));
+ MessageDefPtr FindMessageByName(const char* sym) const {
+ return MessageDefPtr(upb_DefPool_FindMessageByName(ptr_.get(), sym));
}
- EnumDefPtr LookupEnum(const char* sym) const {
- return EnumDefPtr(upb_symtab_lookupenum(ptr_.get(), sym));
+ EnumDefPtr FindEnumByName(const char* sym) const {
+ return EnumDefPtr(upb_DefPool_FindEnumByName(ptr_.get(), sym));
}
- FileDefPtr LookupFile(const char* name) const {
- return FileDefPtr(upb_symtab_lookupfile(ptr_.get(), name));
+ FileDefPtr FindFileByName(const char* name) const {
+ return FileDefPtr(upb_DefPool_FindFileByName(ptr_.get(), name));
}
// TODO: iteration?
@@ -407,31 +402,35 @@ class SymbolTable {
FileDefPtr AddFile(const google_protobuf_FileDescriptorProto* file_proto,
Status* status) {
return FileDefPtr(
- upb_symtab_addfile(ptr_.get(), file_proto, status->ptr()));
+ upb_DefPool_AddFile(ptr_.get(), file_proto, status->ptr()));
}
private:
- std::unique_ptr<upb_symtab, decltype(&upb_symtab_free)> ptr_;
+ std::unique_ptr<upb_DefPool, decltype(&upb_DefPool_Free)> ptr_;
};
+inline FileDefPtr MessageDefPtr::file() const {
+ return FileDefPtr(upb_MessageDef_File(ptr_));
+}
+
inline MessageDefPtr FieldDefPtr::message_subdef() const {
- return MessageDefPtr(upb_fielddef_msgsubdef(ptr_));
+ return MessageDefPtr(upb_FieldDef_MessageSubDef(ptr_));
}
inline MessageDefPtr FieldDefPtr::containing_type() const {
- return MessageDefPtr(upb_fielddef_containingtype(ptr_));
+ return MessageDefPtr(upb_FieldDef_ContainingType(ptr_));
}
inline MessageDefPtr OneofDefPtr::containing_type() const {
- return MessageDefPtr(upb_oneofdef_containingtype(ptr_));
+ return MessageDefPtr(upb_OneofDef_ContainingType(ptr_));
}
inline OneofDefPtr FieldDefPtr::containing_oneof() const {
- return OneofDefPtr(upb_fielddef_containingoneof(ptr_));
+ return OneofDefPtr(upb_FieldDef_ContainingOneof(ptr_));
}
inline EnumDefPtr FieldDefPtr::enum_subdef() const {
- return EnumDefPtr(upb_fielddef_enumsubdef(ptr_));
+ return EnumDefPtr(upb_FieldDef_EnumSubDef(ptr_));
}
} // namespace upb
diff --git a/grpc/third_party/upb/upb/empty.proto b/grpc/third_party/upb/upb/empty.proto
new file mode 100644
index 00000000..fddb20b3
--- /dev/null
+++ b/grpc/third_party/upb/upb/empty.proto
@@ -0,0 +1 @@
+syntax = "proto2";
diff --git a/grpc/third_party/upb/upb/encode.c b/grpc/third_party/upb/upb/encode.c
index f73ff09f..ff84275f 100644
--- a/grpc/third_party/upb/upb/encode.c
+++ b/grpc/third_party/upb/upb/encode.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
/* We encode backwards, to avoid pre-computing lengths (one-pass encode). */
#include "upb/encode.h"
@@ -5,7 +32,7 @@
#include <setjmp.h>
#include <string.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/upb.h"
/* Must be last. */
@@ -14,7 +41,7 @@
#define UPB_PB_VARINT_MAX_LEN 10
UPB_NOINLINE
-static size_t encode_varint64(uint64_t val, char *buf) {
+static size_t encode_varint64(uint64_t val, char* buf) {
size_t i = 0;
do {
uint8_t byte = val & 0x7fU;
@@ -25,12 +52,16 @@ static size_t encode_varint64(uint64_t val, char *buf) {
return i;
}
-static uint32_t encode_zz32(int32_t n) { return ((uint32_t)n << 1) ^ (n >> 31); }
-static uint64_t encode_zz64(int64_t n) { return ((uint64_t)n << 1) ^ (n >> 63); }
+static uint32_t encode_zz32(int32_t n) {
+ return ((uint32_t)n << 1) ^ (n >> 31);
+}
+static uint64_t encode_zz64(int64_t n) {
+ return ((uint64_t)n << 1) ^ (n >> 63);
+}
typedef struct {
jmp_buf err;
- upb_alloc *alloc;
+ upb_alloc* alloc;
char *buf, *ptr, *limit;
int options;
int depth;
@@ -45,15 +76,13 @@ static size_t upb_roundup_pow2(size_t bytes) {
return ret;
}
-UPB_NORETURN static void encode_err(upb_encstate *e) {
- UPB_LONGJMP(e->err, 1);
-}
+UPB_NORETURN static void encode_err(upb_encstate* e) { UPB_LONGJMP(e->err, 1); }
UPB_NOINLINE
-static void encode_growbuffer(upb_encstate *e, size_t bytes) {
+static void encode_growbuffer(upb_encstate* e, size_t bytes) {
size_t old_size = e->limit - e->buf;
size_t new_size = upb_roundup_pow2(bytes + (e->limit - e->ptr));
- char *new_buf = upb_realloc(e->alloc, e->buf, old_size, new_size);
+ char* new_buf = upb_realloc(e->alloc, e->buf, old_size, new_size);
if (!new_buf) encode_err(e);
@@ -72,7 +101,7 @@ static void encode_growbuffer(upb_encstate *e, size_t bytes) {
/* Call to ensure that at least "bytes" bytes are available for writing at
* e->ptr. Returns false if the bytes could not be allocated. */
UPB_FORCEINLINE
-static void encode_reserve(upb_encstate *e, size_t bytes) {
+static void encode_reserve(upb_encstate* e, size_t bytes) {
if ((size_t)(e->ptr - e->buf) < bytes) {
encode_growbuffer(e, bytes);
return;
@@ -82,26 +111,26 @@ static void encode_reserve(upb_encstate *e, size_t bytes) {
}
/* Writes the given bytes to the buffer, handling reserve/advance. */
-static void encode_bytes(upb_encstate *e, const void *data, size_t len) {
- if (len == 0) return; /* memcpy() with zero size is UB */
+static void encode_bytes(upb_encstate* e, const void* data, size_t len) {
+ if (len == 0) return; /* memcpy() with zero size is UB */
encode_reserve(e, len);
memcpy(e->ptr, data, len);
}
-static void encode_fixed64(upb_encstate *e, uint64_t val) {
- val = _upb_be_swap64(val);
+static void encode_fixed64(upb_encstate* e, uint64_t val) {
+ val = _upb_BigEndian_Swap64(val);
encode_bytes(e, &val, sizeof(uint64_t));
}
-static void encode_fixed32(upb_encstate *e, uint32_t val) {
- val = _upb_be_swap32(val);
+static void encode_fixed32(upb_encstate* e, uint32_t val) {
+ val = _upb_BigEndian_Swap32(val);
encode_bytes(e, &val, sizeof(uint32_t));
}
UPB_NOINLINE
-static void encode_longvarint(upb_encstate *e, uint64_t val) {
+static void encode_longvarint(upb_encstate* e, uint64_t val) {
size_t len;
- char *start;
+ char* start;
encode_reserve(e, UPB_PB_VARINT_MAX_LEN);
len = encode_varint64(val, e->ptr);
@@ -111,7 +140,7 @@ static void encode_longvarint(upb_encstate *e, uint64_t val) {
}
UPB_FORCEINLINE
-static void encode_varint(upb_encstate *e, uint64_t val) {
+static void encode_varint(upb_encstate* e, uint64_t val) {
if (val < 128 && e->ptr != e->buf) {
--e->ptr;
*e->ptr = val;
@@ -120,34 +149,47 @@ static void encode_varint(upb_encstate *e, uint64_t val) {
}
}
-static void encode_double(upb_encstate *e, double d) {
+static void encode_double(upb_encstate* e, double d) {
uint64_t u64;
UPB_ASSERT(sizeof(double) == sizeof(uint64_t));
memcpy(&u64, &d, sizeof(uint64_t));
encode_fixed64(e, u64);
}
-static void encode_float(upb_encstate *e, float d) {
+static void encode_float(upb_encstate* e, float d) {
uint32_t u32;
UPB_ASSERT(sizeof(float) == sizeof(uint32_t));
memcpy(&u32, &d, sizeof(uint32_t));
encode_fixed32(e, u32);
}
-static void encode_tag(upb_encstate *e, uint32_t field_number,
+static void encode_tag(upb_encstate* e, uint32_t field_number,
uint8_t wire_type) {
encode_varint(e, (field_number << 3) | wire_type);
}
-static void encode_fixedarray(upb_encstate *e, const upb_array *arr,
- size_t elem_size, uint32_t tag) {
+static void encode_fixedarray(upb_encstate* e, const upb_Array* arr,
+ size_t elem_size, uint32_t tag) {
size_t bytes = arr->len * elem_size;
const char* data = _upb_array_constptr(arr);
const char* ptr = data + bytes - elem_size;
- if (tag) {
+
+ if (tag || !_upb_IsLittleEndian()) {
while (true) {
- encode_bytes(e, ptr, elem_size);
- encode_varint(e, tag);
+ if (elem_size == 4) {
+ uint32_t val;
+ memcpy(&val, ptr, sizeof(val));
+ val = _upb_BigEndian_Swap32(val);
+ encode_bytes(e, &val, elem_size);
+ } else {
+ UPB_ASSERT(elem_size == 8);
+ uint64_t val;
+ memcpy(&val, ptr, sizeof(val));
+ val = _upb_BigEndian_Swap64(val);
+ encode_bytes(e, &val, elem_size);
+ }
+
+ if (tag) encode_varint(e, tag);
if (ptr == data) break;
ptr -= elem_size;
}
@@ -156,87 +198,81 @@ static void encode_fixedarray(upb_encstate *e, const upb_array *arr,
}
}
-static void encode_message(upb_encstate *e, const char *msg,
- const upb_msglayout *m, size_t *size);
+static void encode_message(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable* m, size_t* size);
-static void encode_scalar(upb_encstate *e, const void *_field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f,
- bool skip_zero_value) {
- const char *field_mem = _field_mem;
+static void encode_scalar(upb_encstate* e, const void* _field_mem,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* f) {
+ const char* field_mem = _field_mem;
int wire_type;
#define CASE(ctype, type, wtype, encodeval) \
{ \
- ctype val = *(ctype *)field_mem; \
- if (skip_zero_value && val == 0) { \
- return; \
- } \
+ ctype val = *(ctype*)field_mem; \
encode_##type(e, encodeval); \
wire_type = wtype; \
break; \
}
switch (f->descriptortype) {
- case UPB_DESCRIPTOR_TYPE_DOUBLE:
- CASE(double, double, UPB_WIRE_TYPE_64BIT, val);
- case UPB_DESCRIPTOR_TYPE_FLOAT:
- CASE(float, float, UPB_WIRE_TYPE_32BIT, val);
- case UPB_DESCRIPTOR_TYPE_INT64:
- case UPB_DESCRIPTOR_TYPE_UINT64:
- CASE(uint64_t, varint, UPB_WIRE_TYPE_VARINT, val);
- case UPB_DESCRIPTOR_TYPE_UINT32:
- CASE(uint32_t, varint, UPB_WIRE_TYPE_VARINT, val);
- case UPB_DESCRIPTOR_TYPE_INT32:
- case UPB_DESCRIPTOR_TYPE_ENUM:
- CASE(int32_t, varint, UPB_WIRE_TYPE_VARINT, (int64_t)val);
- case UPB_DESCRIPTOR_TYPE_SFIXED64:
- case UPB_DESCRIPTOR_TYPE_FIXED64:
- CASE(uint64_t, fixed64, UPB_WIRE_TYPE_64BIT, val);
- case UPB_DESCRIPTOR_TYPE_FIXED32:
- case UPB_DESCRIPTOR_TYPE_SFIXED32:
- CASE(uint32_t, fixed32, UPB_WIRE_TYPE_32BIT, val);
- case UPB_DESCRIPTOR_TYPE_BOOL:
- CASE(bool, varint, UPB_WIRE_TYPE_VARINT, val);
- case UPB_DESCRIPTOR_TYPE_SINT32:
- CASE(int32_t, varint, UPB_WIRE_TYPE_VARINT, encode_zz32(val));
- case UPB_DESCRIPTOR_TYPE_SINT64:
- CASE(int64_t, varint, UPB_WIRE_TYPE_VARINT, encode_zz64(val));
- case UPB_DESCRIPTOR_TYPE_STRING:
- case UPB_DESCRIPTOR_TYPE_BYTES: {
- upb_strview view = *(upb_strview*)field_mem;
- if (skip_zero_value && view.size == 0) {
- return;
- }
+ case kUpb_FieldType_Double:
+ CASE(double, double, kUpb_WireType_64Bit, val);
+ case kUpb_FieldType_Float:
+ CASE(float, float, kUpb_WireType_32Bit, val);
+ case kUpb_FieldType_Int64:
+ case kUpb_FieldType_UInt64:
+ CASE(uint64_t, varint, kUpb_WireType_Varint, val);
+ case kUpb_FieldType_UInt32:
+ CASE(uint32_t, varint, kUpb_WireType_Varint, val);
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_Enum:
+ CASE(int32_t, varint, kUpb_WireType_Varint, (int64_t)val);
+ case kUpb_FieldType_SFixed64:
+ case kUpb_FieldType_Fixed64:
+ CASE(uint64_t, fixed64, kUpb_WireType_64Bit, val);
+ case kUpb_FieldType_Fixed32:
+ case kUpb_FieldType_SFixed32:
+ CASE(uint32_t, fixed32, kUpb_WireType_32Bit, val);
+ case kUpb_FieldType_Bool:
+ CASE(bool, varint, kUpb_WireType_Varint, val);
+ case kUpb_FieldType_SInt32:
+ CASE(int32_t, varint, kUpb_WireType_Varint, encode_zz32(val));
+ case kUpb_FieldType_SInt64:
+ CASE(int64_t, varint, kUpb_WireType_Varint, encode_zz64(val));
+ case kUpb_FieldType_String:
+ case kUpb_FieldType_Bytes: {
+ upb_StringView view = *(upb_StringView*)field_mem;
encode_bytes(e, view.data, view.size);
encode_varint(e, view.size);
- wire_type = UPB_WIRE_TYPE_DELIMITED;
+ wire_type = kUpb_WireType_Delimited;
break;
}
- case UPB_DESCRIPTOR_TYPE_GROUP: {
+ case kUpb_FieldType_Group: {
size_t size;
- void *submsg = *(void **)field_mem;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ void* submsg = *(void**)field_mem;
+ const upb_MiniTable* subm = subs[f->submsg_index].submsg;
if (submsg == NULL) {
return;
}
if (--e->depth == 0) encode_err(e);
- encode_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP);
+ encode_tag(e, f->number, kUpb_WireType_EndGroup);
encode_message(e, submsg, subm, &size);
- wire_type = UPB_WIRE_TYPE_START_GROUP;
+ wire_type = kUpb_WireType_StartGroup;
e->depth++;
break;
}
- case UPB_DESCRIPTOR_TYPE_MESSAGE: {
+ case kUpb_FieldType_Message: {
size_t size;
- void *submsg = *(void **)field_mem;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ void* submsg = *(void**)field_mem;
+ const upb_MiniTable* subm = subs[f->submsg_index].submsg;
if (submsg == NULL) {
return;
}
if (--e->depth == 0) encode_err(e);
encode_message(e, submsg, subm, &size);
encode_varint(e, size);
- wire_type = UPB_WIRE_TYPE_DELIMITED;
+ wire_type = kUpb_WireType_Delimited;
e->depth++;
break;
}
@@ -248,10 +284,11 @@ static void encode_scalar(upb_encstate *e, const void *_field_mem,
encode_tag(e, f->number, wire_type);
}
-static void encode_array(upb_encstate *e, const char *field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f) {
- const upb_array *arr = *(const upb_array**)field_mem;
- bool packed = f->label == _UPB_LABEL_PACKED;
+static void encode_array(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* f) {
+ const upb_Array* arr = *UPB_PTR_AT(msg, f->offset, upb_Array*);
+ bool packed = f->mode & kUpb_LabelFlags_IsPacked;
size_t pre_len = e->limit - e->ptr;
if (arr == NULL || arr->len == 0) {
@@ -260,9 +297,9 @@ static void encode_array(upb_encstate *e, const char *field_mem,
#define VARINT_CASE(ctype, encode) \
{ \
- const ctype *start = _upb_array_constptr(arr); \
- const ctype *ptr = start + arr->len; \
- uint32_t tag = packed ? 0 : (f->number << 3) | UPB_WIRE_TYPE_VARINT; \
+ const ctype* start = _upb_array_constptr(arr); \
+ const ctype* ptr = start + arr->len; \
+ uint32_t tag = packed ? 0 : (f->number << 3) | kUpb_WireType_Varint; \
do { \
ptr--; \
encode_varint(e, encode); \
@@ -274,72 +311,72 @@ static void encode_array(upb_encstate *e, const char *field_mem,
#define TAG(wire_type) (packed ? 0 : (f->number << 3 | wire_type))
switch (f->descriptortype) {
- case UPB_DESCRIPTOR_TYPE_DOUBLE:
- encode_fixedarray(e, arr, sizeof(double), TAG(UPB_WIRE_TYPE_64BIT));
+ case kUpb_FieldType_Double:
+ encode_fixedarray(e, arr, sizeof(double), TAG(kUpb_WireType_64Bit));
break;
- case UPB_DESCRIPTOR_TYPE_FLOAT:
- encode_fixedarray(e, arr, sizeof(float), TAG(UPB_WIRE_TYPE_32BIT));
+ case kUpb_FieldType_Float:
+ encode_fixedarray(e, arr, sizeof(float), TAG(kUpb_WireType_32Bit));
break;
- case UPB_DESCRIPTOR_TYPE_SFIXED64:
- case UPB_DESCRIPTOR_TYPE_FIXED64:
- encode_fixedarray(e, arr, sizeof(uint64_t), TAG(UPB_WIRE_TYPE_64BIT));
+ case kUpb_FieldType_SFixed64:
+ case kUpb_FieldType_Fixed64:
+ encode_fixedarray(e, arr, sizeof(uint64_t), TAG(kUpb_WireType_64Bit));
break;
- case UPB_DESCRIPTOR_TYPE_FIXED32:
- case UPB_DESCRIPTOR_TYPE_SFIXED32:
- encode_fixedarray(e, arr, sizeof(uint32_t), TAG(UPB_WIRE_TYPE_32BIT));
+ case kUpb_FieldType_Fixed32:
+ case kUpb_FieldType_SFixed32:
+ encode_fixedarray(e, arr, sizeof(uint32_t), TAG(kUpb_WireType_32Bit));
break;
- case UPB_DESCRIPTOR_TYPE_INT64:
- case UPB_DESCRIPTOR_TYPE_UINT64:
+ case kUpb_FieldType_Int64:
+ case kUpb_FieldType_UInt64:
VARINT_CASE(uint64_t, *ptr);
- case UPB_DESCRIPTOR_TYPE_UINT32:
+ case kUpb_FieldType_UInt32:
VARINT_CASE(uint32_t, *ptr);
- case UPB_DESCRIPTOR_TYPE_INT32:
- case UPB_DESCRIPTOR_TYPE_ENUM:
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_Enum:
VARINT_CASE(int32_t, (int64_t)*ptr);
- case UPB_DESCRIPTOR_TYPE_BOOL:
+ case kUpb_FieldType_Bool:
VARINT_CASE(bool, *ptr);
- case UPB_DESCRIPTOR_TYPE_SINT32:
+ case kUpb_FieldType_SInt32:
VARINT_CASE(int32_t, encode_zz32(*ptr));
- case UPB_DESCRIPTOR_TYPE_SINT64:
+ case kUpb_FieldType_SInt64:
VARINT_CASE(int64_t, encode_zz64(*ptr));
- case UPB_DESCRIPTOR_TYPE_STRING:
- case UPB_DESCRIPTOR_TYPE_BYTES: {
- const upb_strview *start = _upb_array_constptr(arr);
- const upb_strview *ptr = start + arr->len;
+ case kUpb_FieldType_String:
+ case kUpb_FieldType_Bytes: {
+ const upb_StringView* start = _upb_array_constptr(arr);
+ const upb_StringView* ptr = start + arr->len;
do {
ptr--;
encode_bytes(e, ptr->data, ptr->size);
encode_varint(e, ptr->size);
- encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED);
+ encode_tag(e, f->number, kUpb_WireType_Delimited);
} while (ptr != start);
return;
}
- case UPB_DESCRIPTOR_TYPE_GROUP: {
- const void *const*start = _upb_array_constptr(arr);
- const void *const*ptr = start + arr->len;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ case kUpb_FieldType_Group: {
+ const void* const* start = _upb_array_constptr(arr);
+ const void* const* ptr = start + arr->len;
+ const upb_MiniTable* subm = subs[f->submsg_index].submsg;
if (--e->depth == 0) encode_err(e);
do {
size_t size;
ptr--;
- encode_tag(e, f->number, UPB_WIRE_TYPE_END_GROUP);
+ encode_tag(e, f->number, kUpb_WireType_EndGroup);
encode_message(e, *ptr, subm, &size);
- encode_tag(e, f->number, UPB_WIRE_TYPE_START_GROUP);
+ encode_tag(e, f->number, kUpb_WireType_StartGroup);
} while (ptr != start);
e->depth++;
return;
}
- case UPB_DESCRIPTOR_TYPE_MESSAGE: {
- const void *const*start = _upb_array_constptr(arr);
- const void *const*ptr = start + arr->len;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ case kUpb_FieldType_Message: {
+ const void* const* start = _upb_array_constptr(arr);
+ const void* const* ptr = start + arr->len;
+ const upb_MiniTable* subm = subs[f->submsg_index].submsg;
if (--e->depth == 0) encode_err(e);
do {
size_t size;
ptr--;
encode_message(e, *ptr, subm, &size);
encode_varint(e, size);
- encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED);
+ encode_tag(e, f->number, kUpb_WireType_Delimited);
} while (ptr != start);
e->depth++;
return;
@@ -349,37 +386,38 @@ static void encode_array(upb_encstate *e, const char *field_mem,
if (packed) {
encode_varint(e, e->limit - e->ptr - pre_len);
- encode_tag(e, f->number, UPB_WIRE_TYPE_DELIMITED);
+ encode_tag(e, f->number, kUpb_WireType_Delimited);
}
}
-static void encode_mapentry(upb_encstate *e, uint32_t number,
- const upb_msglayout *layout,
- const upb_map_entry *ent) {
- const upb_msglayout_field *key_field = &layout->fields[0];
- const upb_msglayout_field *val_field = &layout->fields[1];
+static void encode_mapentry(upb_encstate* e, uint32_t number,
+ const upb_MiniTable* layout,
+ const upb_MapEntry* ent) {
+ const upb_MiniTable_Field* key_field = &layout->fields[0];
+ const upb_MiniTable_Field* val_field = &layout->fields[1];
size_t pre_len = e->limit - e->ptr;
size_t size;
- encode_scalar(e, &ent->v, layout, val_field, false);
- encode_scalar(e, &ent->k, layout, key_field, false);
+ encode_scalar(e, &ent->v, layout->subs, val_field);
+ encode_scalar(e, &ent->k, layout->subs, key_field);
size = (e->limit - e->ptr) - pre_len;
encode_varint(e, size);
- encode_tag(e, number, UPB_WIRE_TYPE_DELIMITED);
+ encode_tag(e, number, kUpb_WireType_Delimited);
}
-static void encode_map(upb_encstate *e, const char *field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f) {
- const upb_map *map = *(const upb_map**)field_mem;
- const upb_msglayout *layout = m->submsgs[f->submsg_index];
+static void encode_map(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* f) {
+ const upb_Map* map = *UPB_PTR_AT(msg, f->offset, const upb_Map*);
+ const upb_MiniTable* layout = subs[f->submsg_index].submsg;
UPB_ASSERT(layout->field_count == 2);
if (map == NULL) return;
- if (e->options & UPB_ENCODE_DETERMINISTIC) {
+ if (e->options & kUpb_Encode_Deterministic) {
_upb_sortedmap sorted;
_upb_mapsorter_pushmap(&e->sorter, layout->fields[0].descriptortype, map,
&sorted);
- upb_map_entry ent;
+ upb_MapEntry ent;
while (_upb_sortedmap_next(&e->sorter, map, &sorted, &ent)) {
encode_mapentry(e, f->number, layout, &ent);
}
@@ -387,10 +425,10 @@ static void encode_map(upb_encstate *e, const char *field_mem,
} else {
upb_strtable_iter i;
upb_strtable_begin(&i, &map->table);
- for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
- upb_strview key = upb_strtable_iter_key(&i);
+ for (; !upb_strtable_done(&i); upb_strtable_next(&i)) {
+ upb_StringView key = upb_strtable_iter_key(&i);
const upb_value val = upb_strtable_iter_value(&i);
- upb_map_entry ent;
+ upb_MapEntry ent;
_upb_map_fromkey(key, &ent.k, map->key_size);
_upb_map_fromvalue(val, &ent.v, map->val_size);
encode_mapentry(e, f->number, layout, &ent);
@@ -398,71 +436,159 @@ static void encode_map(upb_encstate *e, const char *field_mem,
}
}
-static void encode_scalarfield(upb_encstate *e, const char *msg,
- const upb_msglayout *m,
- const upb_msglayout_field *f) {
- bool skip_empty = false;
+static bool encode_shouldencode(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* f) {
if (f->presence == 0) {
- /* Proto3 presence. */
- skip_empty = true;
+ /* Proto3 presence or map/array. */
+ const void* mem = UPB_PTR_AT(msg, f->offset, void);
+ switch (f->mode >> kUpb_FieldRep_Shift) {
+ case kUpb_FieldRep_1Byte: {
+ char ch;
+ memcpy(&ch, mem, 1);
+ return ch != 0;
+ }
+#if UINTPTR_MAX == 0xffffffff
+ case kUpb_FieldRep_Pointer:
+#endif
+ case kUpb_FieldRep_4Byte: {
+ uint32_t u32;
+ memcpy(&u32, mem, 4);
+ return u32 != 0;
+ }
+#if UINTPTR_MAX != 0xffffffff
+ case kUpb_FieldRep_Pointer:
+#endif
+ case kUpb_FieldRep_8Byte: {
+ uint64_t u64;
+ memcpy(&u64, mem, 8);
+ return u64 != 0;
+ }
+ case kUpb_FieldRep_StringView: {
+ const upb_StringView* str = (const upb_StringView*)mem;
+ return str->size != 0;
+ }
+ default:
+ UPB_UNREACHABLE();
+ }
} else if (f->presence > 0) {
/* Proto2 presence: hasbit. */
- if (!_upb_hasbit_field(msg, f)) return;
+ return _upb_hasbit_field(msg, f);
} else {
/* Field is in a oneof. */
- if (_upb_getoneofcase_field(msg, f) != f->number) return;
+ return _upb_getoneofcase_field(msg, f) == f->number;
}
- encode_scalar(e, msg + f->offset, m, f, skip_empty);
}
-static void encode_message(upb_encstate *e, const char *msg,
- const upb_msglayout *m, size_t *size) {
+static void encode_field(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable_Sub* subs,
+ const upb_MiniTable_Field* field) {
+ switch (upb_FieldMode_Get(field)) {
+ case kUpb_FieldMode_Array:
+ encode_array(e, msg, subs, field);
+ break;
+ case kUpb_FieldMode_Map:
+ encode_map(e, msg, subs, field);
+ break;
+ case kUpb_FieldMode_Scalar:
+ encode_scalar(e, UPB_PTR_AT(msg, field->offset, void), subs, field);
+ break;
+ default:
+ UPB_UNREACHABLE();
+ }
+}
+
+/* message MessageSet {
+ * repeated group Item = 1 {
+ * required int32 type_id = 2;
+ * required string message = 3;
+ * }
+ * } */
+static void encode_msgset_item(upb_encstate* e,
+ const upb_Message_Extension* ext) {
+ size_t size;
+ encode_tag(e, 1, kUpb_WireType_EndGroup);
+ encode_message(e, ext->data.ptr, ext->ext->sub.submsg, &size);
+ encode_varint(e, size);
+ encode_tag(e, 3, kUpb_WireType_Delimited);
+ encode_varint(e, ext->ext->field.number);
+ encode_tag(e, 2, kUpb_WireType_Varint);
+ encode_tag(e, 1, kUpb_WireType_StartGroup);
+}
+
+static void encode_message(upb_encstate* e, const upb_Message* msg,
+ const upb_MiniTable* m, size_t* size) {
size_t pre_len = e->limit - e->ptr;
- const upb_msglayout_field *f = &m->fields[m->field_count];
- const upb_msglayout_field *first = &m->fields[0];
- if ((e->options & UPB_ENCODE_SKIPUNKNOWN) == 0) {
+ if ((e->options & kUpb_Encode_CheckRequired) && m->required_count) {
+ uint64_t msg_head;
+ memcpy(&msg_head, msg, 8);
+ msg_head = _upb_BigEndian_Swap64(msg_head);
+ if (upb_MiniTable_requiredmask(m) & ~msg_head) {
+ encode_err(e);
+ }
+ }
+
+ if ((e->options & kUpb_Encode_SkipUnknown) == 0) {
size_t unknown_size;
- const char *unknown = upb_msg_getunknown(msg, &unknown_size);
+ const char* unknown = upb_Message_GetUnknown(msg, &unknown_size);
if (unknown) {
encode_bytes(e, unknown, unknown_size);
}
}
- while (f != first) {
- f--;
- if (_upb_isrepeated(f)) {
- encode_array(e, msg + f->offset, m, f);
- } else if (f->label == _UPB_LABEL_MAP) {
- encode_map(e, msg + f->offset, m, f);
- } else {
- encode_scalarfield(e, msg, m, f);
+ if (m->ext != kUpb_ExtMode_NonExtendable) {
+ /* Encode all extensions together. Unlike C++, we do not attempt to keep
+ * these in field number order relative to normal fields or even to each
+ * other. */
+ size_t ext_count;
+ const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &ext_count);
+ if (ext_count) {
+ const upb_Message_Extension* end = ext + ext_count;
+ for (; ext != end; ext++) {
+ if (UPB_UNLIKELY(m->ext == kUpb_ExtMode_IsMessageSet)) {
+ encode_msgset_item(e, ext);
+ } else {
+ encode_field(e, &ext->data, &ext->ext->sub, &ext->ext->field);
+ }
+ }
+ }
+ }
+
+ if (m->field_count) {
+ const upb_MiniTable_Field* f = &m->fields[m->field_count];
+ const upb_MiniTable_Field* first = &m->fields[0];
+ while (f != first) {
+ f--;
+ if (encode_shouldencode(e, msg, m->subs, f)) {
+ encode_field(e, msg, m->subs, f);
+ }
}
}
*size = (e->limit - e->ptr) - pre_len;
}
-char *upb_encode_ex(const void *msg, const upb_msglayout *m, int options,
- upb_arena *arena, size_t *size) {
+char* upb_Encode(const void* msg, const upb_MiniTable* l, int options,
+ upb_Arena* arena, size_t* size) {
upb_encstate e;
unsigned depth = (unsigned)options >> 16;
- e.alloc = upb_arena_alloc(arena);
+ e.alloc = upb_Arena_Alloc(arena);
e.buf = NULL;
e.limit = NULL;
e.ptr = NULL;
e.depth = depth ? depth : 64;
e.options = options;
_upb_mapsorter_init(&e.sorter);
- char *ret = NULL;
+ char* ret = NULL;
if (UPB_SETJMP(e.err)) {
*size = 0;
ret = NULL;
} else {
- encode_message(&e, msg, m, size);
+ encode_message(&e, msg, l, size);
*size = e.limit - e.ptr;
if (*size == 0) {
static char ch;
diff --git a/grpc/third_party/upb/upb/encode.h b/grpc/third_party/upb/upb/encode.h
index d3c1dc96..906b6f0c 100644
--- a/grpc/third_party/upb/upb/encode.h
+++ b/grpc/third_party/upb/upb/encode.h
@@ -1,6 +1,33 @@
/*
-** upb_encode: parsing into a upb_msg using a upb_msglayout.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_Encode: parsing into a upb_Message using a upb_MiniTable.
+ */
#ifndef UPB_ENCODE_H_
#define UPB_ENCODE_H_
@@ -21,26 +48,24 @@ enum {
*
* If your proto contains maps, the encoder will need to malloc()/free()
* memory during encode. */
- UPB_ENCODE_DETERMINISTIC = 1,
+ kUpb_Encode_Deterministic = 1,
/* When set, unknown fields are not printed. */
- UPB_ENCODE_SKIPUNKNOWN = 2,
+ kUpb_Encode_SkipUnknown = 2,
+
+ /* When set, the encode will fail if any required fields are missing. */
+ kUpb_Encode_CheckRequired = 4,
};
#define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16)
-char *upb_encode_ex(const void *msg, const upb_msglayout *l, int options,
- upb_arena *arena, size_t *size);
-
-UPB_INLINE char *upb_encode(const void *msg, const upb_msglayout *l,
- upb_arena *arena, size_t *size) {
- return upb_encode_ex(msg, l, 0, arena, size);
-}
+char* upb_Encode(const void* msg, const upb_MiniTable* l, int options,
+ upb_Arena* arena, size_t* size);
#include "upb/port_undef.inc"
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* UPB_ENCODE_H_ */
+#endif /* UPB_ENCODE_H_ */
diff --git a/grpc/third_party/upb/upb/fuzz/BUILD b/grpc/third_party/upb/upb/fuzz/BUILD
new file mode 100644
index 00000000..fa0767e3
--- /dev/null
+++ b/grpc/third_party/upb/upb/fuzz/BUILD
@@ -0,0 +1,13 @@
+load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
+
+licenses(["notice"])
+
+cc_fuzz_test(
+ name = "file_descriptor_parsenew_fuzzer",
+ srcs = ["file_descriptor_parsenew_fuzzer.cc"],
+ deps = [
+ "//:descriptor_upb_proto",
+ "//:reflection",
+ "//:upb",
+ ],
+)
diff --git a/grpc/third_party/upb/upb/fuzz/file_descriptor_parsenew_fuzzer.cc b/grpc/third_party/upb/upb/fuzz/file_descriptor_parsenew_fuzzer.cc
new file mode 100644
index 00000000..3d9c4c6f
--- /dev/null
+++ b/grpc/third_party/upb/upb/fuzz/file_descriptor_parsenew_fuzzer.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <cstdint>
+
+#include "google/protobuf/descriptor.upb.h"
+#include "upb/def.hpp"
+#include "upb/upb.hpp"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ upb::Arena arena;
+ google_protobuf_FileDescriptorProto* proto =
+ google_protobuf_FileDescriptorProto_parse(
+ reinterpret_cast<const char*>(data), size, arena.ptr());
+ if (proto) {
+ upb::SymbolTable symtab;
+ upb::Status status;
+ symtab.AddFile(proto, &status);
+ }
+ return 0;
+}
diff --git a/grpc/third_party/upb/upb/handlers-inl.h b/grpc/third_party/upb/upb/handlers-inl.h
deleted file mode 100644
index 8f8634bf..00000000
--- a/grpc/third_party/upb/upb/handlers-inl.h
+++ /dev/null
@@ -1,923 +0,0 @@
-/*
-** Inline definitions for handlers.h, which are particularly long and a bit
-** tricky.
-*/
-
-#ifndef UPB_HANDLERS_INL_H_
-#define UPB_HANDLERS_INL_H_
-
-#include <limits.h>
-#include <stddef.h>
-#include "upb/handlers.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-
-/* Type detection and typedefs for integer types.
- * For platforms where there are multiple 32-bit or 64-bit types, we need to be
- * able to enumerate them so we can properly create overloads for all variants.
- *
- * If any platform existed where there were three integer types with the same
- * size, this would have to become more complicated. For example, short, int,
- * and long could all be 32-bits. Even more diabolically, short, int, long,
- * and long long could all be 64 bits and still be standard-compliant.
- * However, few platforms are this strange, and it's unlikely that upb will be
- * used on the strangest ones. */
-
-/* Can't count on stdint.h limits like INT32_MAX, because in C++ these are
- * only defined when __STDC_LIMIT_MACROS are defined before the *first* include
- * of stdint.h. We can't guarantee that someone else didn't include these first
- * without defining __STDC_LIMIT_MACROS. */
-#define UPB_INT32_MAX 0x7fffffffLL
-#define UPB_INT32_MIN (-UPB_INT32_MAX - 1)
-#define UPB_INT64_MAX 0x7fffffffffffffffLL
-#define UPB_INT64_MIN (-UPB_INT64_MAX - 1)
-
-#if INT_MAX == UPB_INT32_MAX && INT_MIN == UPB_INT32_MIN
-#define UPB_INT_IS_32BITS 1
-#endif
-
-#if LONG_MAX == UPB_INT32_MAX && LONG_MIN == UPB_INT32_MIN
-#define UPB_LONG_IS_32BITS 1
-#endif
-
-#if LONG_MAX == UPB_INT64_MAX && LONG_MIN == UPB_INT64_MIN
-#define UPB_LONG_IS_64BITS 1
-#endif
-
-#if LLONG_MAX == UPB_INT64_MAX && LLONG_MIN == UPB_INT64_MIN
-#define UPB_LLONG_IS_64BITS 1
-#endif
-
-/* We use macros instead of typedefs so we can undefine them later and avoid
- * leaking them outside this header file. */
-#if UPB_INT_IS_32BITS
-#define UPB_INT32_T int
-#define UPB_UINT32_T unsigned int
-
-#if UPB_LONG_IS_32BITS
-#define UPB_TWO_32BIT_TYPES 1
-#define UPB_INT32ALT_T long
-#define UPB_UINT32ALT_T unsigned long
-#endif /* UPB_LONG_IS_32BITS */
-
-#elif UPB_LONG_IS_32BITS /* && !UPB_INT_IS_32BITS */
-#define UPB_INT32_T long
-#define UPB_UINT32_T unsigned long
-#endif /* UPB_INT_IS_32BITS */
-
-
-#if UPB_LONG_IS_64BITS
-#define UPB_INT64_T long
-#define UPB_UINT64_T unsigned long
-
-#if UPB_LLONG_IS_64BITS
-#define UPB_TWO_64BIT_TYPES 1
-#define UPB_INT64ALT_T long long
-#define UPB_UINT64ALT_T unsigned long long
-#endif /* UPB_LLONG_IS_64BITS */
-
-#elif UPB_LLONG_IS_64BITS /* && !UPB_LONG_IS_64BITS */
-#define UPB_INT64_T long long
-#define UPB_UINT64_T unsigned long long
-#endif /* UPB_LONG_IS_64BITS */
-
-#undef UPB_INT32_MAX
-#undef UPB_INT32_MIN
-#undef UPB_INT64_MAX
-#undef UPB_INT64_MIN
-#undef UPB_INT_IS_32BITS
-#undef UPB_LONG_IS_32BITS
-#undef UPB_LONG_IS_64BITS
-#undef UPB_LLONG_IS_64BITS
-
-
-namespace upb {
-
-typedef void CleanupFunc(void *ptr);
-
-/* Template to remove "const" from "const T*" and just return "T*".
- *
- * We define a nonsense default because otherwise it will fail to instantiate as
- * a function parameter type even in cases where we don't expect any caller to
- * actually match the overload. */
-class CouldntRemoveConst {};
-template <class T> struct remove_constptr { typedef CouldntRemoveConst type; };
-template <class T> struct remove_constptr<const T *> { typedef T *type; };
-
-/* Template that we use below to remove a template specialization from
- * consideration if it matches a specific type. */
-template <class T, class U> struct disable_if_same { typedef void Type; };
-template <class T> struct disable_if_same<T, T> {};
-
-template <class T> void DeletePointer(void *p) { delete static_cast<T>(p); }
-
-template <class T1, class T2>
-struct FirstUnlessVoidOrBool {
- typedef T1 value;
-};
-
-template <class T2>
-struct FirstUnlessVoidOrBool<void, T2> {
- typedef T2 value;
-};
-
-template <class T2>
-struct FirstUnlessVoidOrBool<bool, T2> {
- typedef T2 value;
-};
-
-template<class T, class U>
-struct is_same {
- static bool value;
-};
-
-template<class T>
-struct is_same<T, T> {
- static bool value;
-};
-
-template<class T, class U>
-bool is_same<T, U>::value = false;
-
-template<class T>
-bool is_same<T, T>::value = true;
-
-/* FuncInfo *******************************************************************/
-
-/* Info about the user's original, pre-wrapped function. */
-template <class C, class R = void>
-struct FuncInfo {
- /* The type of the closure that the function takes (its first param). */
- typedef C Closure;
-
- /* The return type. */
- typedef R Return;
-};
-
-/* Func ***********************************************************************/
-
-/* Func1, Func2, Func3: Template classes representing a function and its
- * signature.
- *
- * Since the function is a template parameter, calling the function can be
- * inlined at compile-time and does not require a function pointer at runtime.
- * These functions are not bound to a handler data so have no data or cleanup
- * handler. */
-struct UnboundFunc {
- CleanupFunc *GetCleanup() { return nullptr; }
- void *GetData() { return nullptr; }
-};
-
-template <class R, class P1, R F(P1), class I>
-struct Func1 : public UnboundFunc {
- typedef R Return;
- typedef I FuncInfo;
- static R Call(P1 p1) { return F(p1); }
-};
-
-template <class R, class P1, class P2, R F(P1, P2), class I>
-struct Func2 : public UnboundFunc {
- typedef R Return;
- typedef I FuncInfo;
- static R Call(P1 p1, P2 p2) { return F(p1, p2); }
-};
-
-template <class R, class P1, class P2, class P3, R F(P1, P2, P3), class I>
-struct Func3 : public UnboundFunc {
- typedef R Return;
- typedef I FuncInfo;
- static R Call(P1 p1, P2 p2, P3 p3) { return F(p1, p2, p3); }
-};
-
-template <class R, class P1, class P2, class P3, class P4, R F(P1, P2, P3, P4),
- class I>
-struct Func4 : public UnboundFunc {
- typedef R Return;
- typedef I FuncInfo;
- static R Call(P1 p1, P2 p2, P3 p3, P4 p4) { return F(p1, p2, p3, p4); }
-};
-
-template <class R, class P1, class P2, class P3, class P4, class P5,
- R F(P1, P2, P3, P4, P5), class I>
-struct Func5 : public UnboundFunc {
- typedef R Return;
- typedef I FuncInfo;
- static R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {
- return F(p1, p2, p3, p4, p5);
- }
-};
-
-/* BoundFunc ******************************************************************/
-
-/* BoundFunc2, BoundFunc3: Like Func2/Func3 except also contains a value that
- * shall be bound to the function's second parameter.
- *
- * Note that the second parameter is a const pointer, but our stored bound value
- * is non-const so we can free it when the handlers are destroyed. */
-template <class T>
-struct BoundFunc {
- typedef typename remove_constptr<T>::type MutableP2;
- explicit BoundFunc(MutableP2 data_) : data(data_) {}
- CleanupFunc *GetCleanup() { return &DeletePointer<MutableP2>; }
- MutableP2 GetData() { return data; }
- MutableP2 data;
-};
-
-template <class R, class P1, class P2, R F(P1, P2), class I>
-struct BoundFunc2 : public BoundFunc<P2> {
- typedef BoundFunc<P2> Base;
- typedef I FuncInfo;
- explicit BoundFunc2(typename Base::MutableP2 arg) : Base(arg) {}
-};
-
-template <class R, class P1, class P2, class P3, R F(P1, P2, P3), class I>
-struct BoundFunc3 : public BoundFunc<P2> {
- typedef BoundFunc<P2> Base;
- typedef I FuncInfo;
- explicit BoundFunc3(typename Base::MutableP2 arg) : Base(arg) {}
-};
-
-template <class R, class P1, class P2, class P3, class P4, R F(P1, P2, P3, P4),
- class I>
-struct BoundFunc4 : public BoundFunc<P2> {
- typedef BoundFunc<P2> Base;
- typedef I FuncInfo;
- explicit BoundFunc4(typename Base::MutableP2 arg) : Base(arg) {}
-};
-
-template <class R, class P1, class P2, class P3, class P4, class P5,
- R F(P1, P2, P3, P4, P5), class I>
-struct BoundFunc5 : public BoundFunc<P2> {
- typedef BoundFunc<P2> Base;
- typedef I FuncInfo;
- explicit BoundFunc5(typename Base::MutableP2 arg) : Base(arg) {}
-};
-
-/* FuncSig ********************************************************************/
-
-/* FuncSig1, FuncSig2, FuncSig3: template classes reflecting a function
- * *signature*, but without a specific function attached.
- *
- * These classes contain member functions that can be invoked with a
- * specific function to return a Func/BoundFunc class. */
-template <class R, class P1>
-struct FuncSig1 {
- template <R F(P1)>
- Func1<R, P1, F, FuncInfo<P1, R> > GetFunc() {
- return Func1<R, P1, F, FuncInfo<P1, R> >();
- }
-};
-
-template <class R, class P1, class P2>
-struct FuncSig2 {
- template <R F(P1, P2)>
- Func2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc() {
- return Func2<R, P1, P2, F, FuncInfo<P1, R> >();
- }
-
- template <R F(P1, P2)>
- BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> > GetFunc(
- typename remove_constptr<P2>::type param2) {
- return BoundFunc2<R, P1, P2, F, FuncInfo<P1, R> >(param2);
- }
-};
-
-template <class R, class P1, class P2, class P3>
-struct FuncSig3 {
- template <R F(P1, P2, P3)>
- Func3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc() {
- return Func3<R, P1, P2, P3, F, FuncInfo<P1, R> >();
- }
-
- template <R F(P1, P2, P3)>
- BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> > GetFunc(
- typename remove_constptr<P2>::type param2) {
- return BoundFunc3<R, P1, P2, P3, F, FuncInfo<P1, R> >(param2);
- }
-};
-
-template <class R, class P1, class P2, class P3, class P4>
-struct FuncSig4 {
- template <R F(P1, P2, P3, P4)>
- Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc() {
- return Func4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >();
- }
-
- template <R F(P1, P2, P3, P4)>
- BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> > GetFunc(
- typename remove_constptr<P2>::type param2) {
- return BoundFunc4<R, P1, P2, P3, P4, F, FuncInfo<P1, R> >(param2);
- }
-};
-
-template <class R, class P1, class P2, class P3, class P4, class P5>
-struct FuncSig5 {
- template <R F(P1, P2, P3, P4, P5)>
- Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc() {
- return Func5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >();
- }
-
- template <R F(P1, P2, P3, P4, P5)>
- BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> > GetFunc(
- typename remove_constptr<P2>::type param2) {
- return BoundFunc5<R, P1, P2, P3, P4, P5, F, FuncInfo<P1, R> >(param2);
- }
-};
-
-/* Overloaded template function that can construct the appropriate FuncSig*
- * class given a function pointer by deducing the template parameters. */
-template <class R, class P1>
-inline FuncSig1<R, P1> MatchFunc(R (*f)(P1)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return FuncSig1<R, P1>();
-}
-
-template <class R, class P1, class P2>
-inline FuncSig2<R, P1, P2> MatchFunc(R (*f)(P1, P2)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return FuncSig2<R, P1, P2>();
-}
-
-template <class R, class P1, class P2, class P3>
-inline FuncSig3<R, P1, P2, P3> MatchFunc(R (*f)(P1, P2, P3)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return FuncSig3<R, P1, P2, P3>();
-}
-
-template <class R, class P1, class P2, class P3, class P4>
-inline FuncSig4<R, P1, P2, P3, P4> MatchFunc(R (*f)(P1, P2, P3, P4)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return FuncSig4<R, P1, P2, P3, P4>();
-}
-
-template <class R, class P1, class P2, class P3, class P4, class P5>
-inline FuncSig5<R, P1, P2, P3, P4, P5> MatchFunc(R (*f)(P1, P2, P3, P4, P5)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return FuncSig5<R, P1, P2, P3, P4, P5>();
-}
-
-/* MethodSig ******************************************************************/
-
-/* CallMethod*: a function template that calls a given method. */
-template <class R, class C, R (C::*F)()>
-R CallMethod0(C *obj) {
- return ((*obj).*F)();
-}
-
-template <class R, class C, class P1, R (C::*F)(P1)>
-R CallMethod1(C *obj, P1 arg1) {
- return ((*obj).*F)(arg1);
-}
-
-template <class R, class C, class P1, class P2, R (C::*F)(P1, P2)>
-R CallMethod2(C *obj, P1 arg1, P2 arg2) {
- return ((*obj).*F)(arg1, arg2);
-}
-
-template <class R, class C, class P1, class P2, class P3, R (C::*F)(P1, P2, P3)>
-R CallMethod3(C *obj, P1 arg1, P2 arg2, P3 arg3) {
- return ((*obj).*F)(arg1, arg2, arg3);
-}
-
-template <class R, class C, class P1, class P2, class P3, class P4,
- R (C::*F)(P1, P2, P3, P4)>
-R CallMethod4(C *obj, P1 arg1, P2 arg2, P3 arg3, P4 arg4) {
- return ((*obj).*F)(arg1, arg2, arg3, arg4);
-}
-
-/* MethodSig: like FuncSig, but for member functions.
- *
- * GetFunc() returns a normal FuncN object, so after calling GetFunc() no
- * more logic is required to special-case methods. */
-template <class R, class C>
-struct MethodSig0 {
- template <R (C::*F)()>
- Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> > GetFunc() {
- return Func1<R, C *, CallMethod0<R, C, F>, FuncInfo<C *, R> >();
- }
-};
-
-template <class R, class C, class P1>
-struct MethodSig1 {
- template <R (C::*F)(P1)>
- Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc() {
- return Func2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >();
- }
-
- template <R (C::*F)(P1)>
- BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> > GetFunc(
- typename remove_constptr<P1>::type param1) {
- return BoundFunc2<R, C *, P1, CallMethod1<R, C, P1, F>, FuncInfo<C *, R> >(
- param1);
- }
-};
-
-template <class R, class C, class P1, class P2>
-struct MethodSig2 {
- template <R (C::*F)(P1, P2)>
- Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
- GetFunc() {
- return Func3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
- FuncInfo<C *, R> >();
- }
-
- template <R (C::*F)(P1, P2)>
- BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>, FuncInfo<C *, R> >
- GetFunc(typename remove_constptr<P1>::type param1) {
- return BoundFunc3<R, C *, P1, P2, CallMethod2<R, C, P1, P2, F>,
- FuncInfo<C *, R> >(param1);
- }
-};
-
-template <class R, class C, class P1, class P2, class P3>
-struct MethodSig3 {
- template <R (C::*F)(P1, P2, P3)>
- Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>, FuncInfo<C *, R> >
- GetFunc() {
- return Func4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
- FuncInfo<C *, R> >();
- }
-
- template <R (C::*F)(P1, P2, P3)>
- BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
- FuncInfo<C *, R> >
- GetFunc(typename remove_constptr<P1>::type param1) {
- return BoundFunc4<R, C *, P1, P2, P3, CallMethod3<R, C, P1, P2, P3, F>,
- FuncInfo<C *, R> >(param1);
- }
-};
-
-template <class R, class C, class P1, class P2, class P3, class P4>
-struct MethodSig4 {
- template <R (C::*F)(P1, P2, P3, P4)>
- Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
- FuncInfo<C *, R> >
- GetFunc() {
- return Func5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
- FuncInfo<C *, R> >();
- }
-
- template <R (C::*F)(P1, P2, P3, P4)>
- BoundFunc5<R, C *, P1, P2, P3, P4, CallMethod4<R, C, P1, P2, P3, P4, F>,
- FuncInfo<C *, R> >
- GetFunc(typename remove_constptr<P1>::type param1) {
- return BoundFunc5<R, C *, P1, P2, P3, P4,
- CallMethod4<R, C, P1, P2, P3, P4, F>, FuncInfo<C *, R> >(
- param1);
- }
-};
-
-template <class R, class C>
-inline MethodSig0<R, C> MatchFunc(R (C::*f)()) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return MethodSig0<R, C>();
-}
-
-template <class R, class C, class P1>
-inline MethodSig1<R, C, P1> MatchFunc(R (C::*f)(P1)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return MethodSig1<R, C, P1>();
-}
-
-template <class R, class C, class P1, class P2>
-inline MethodSig2<R, C, P1, P2> MatchFunc(R (C::*f)(P1, P2)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return MethodSig2<R, C, P1, P2>();
-}
-
-template <class R, class C, class P1, class P2, class P3>
-inline MethodSig3<R, C, P1, P2, P3> MatchFunc(R (C::*f)(P1, P2, P3)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return MethodSig3<R, C, P1, P2, P3>();
-}
-
-template <class R, class C, class P1, class P2, class P3, class P4>
-inline MethodSig4<R, C, P1, P2, P3, P4> MatchFunc(R (C::*f)(P1, P2, P3, P4)) {
- UPB_UNUSED(f); /* Only used for template parameter deduction. */
- return MethodSig4<R, C, P1, P2, P3, P4>();
-}
-
-/* MaybeWrapReturn ************************************************************/
-
-/* Template class that attempts to wrap the return value of the function so it
- * matches the expected type. There are two main adjustments it may make:
- *
- * 1. If the function returns void, make it return the expected type and with
- * a value that always indicates success.
- * 2. If the function returns bool, make it return the expected type with a
- * value that indicates success or failure.
- *
- * The "expected type" for return is:
- * 1. void* for start handlers. If the closure parameter has a different type
- * we will cast it to void* for the return in the success case.
- * 2. size_t for string buffer handlers.
- * 3. bool for everything else. */
-
-/* Template parameters are FuncN type and desired return type. */
-template <class F, class R, class Enable = void>
-struct MaybeWrapReturn;
-
-/* If the return type matches, return the given function unwrapped. */
-template <class F>
-struct MaybeWrapReturn<F, typename F::Return> {
- typedef F Func;
-};
-
-/* Function wrapper that munges the return value from void to (bool)true. */
-template <class P1, class P2, void F(P1, P2)>
-bool ReturnTrue2(P1 p1, P2 p2) {
- F(p1, p2);
- return true;
-}
-
-template <class P1, class P2, class P3, void F(P1, P2, P3)>
-bool ReturnTrue3(P1 p1, P2 p2, P3 p3) {
- F(p1, p2, p3);
- return true;
-}
-
-/* Function wrapper that munges the return value from void to (void*)arg1 */
-template <class P1, class P2, void F(P1, P2)>
-void *ReturnClosure2(P1 p1, P2 p2) {
- F(p1, p2);
- return p1;
-}
-
-template <class P1, class P2, class P3, void F(P1, P2, P3)>
-void *ReturnClosure3(P1 p1, P2 p2, P3 p3) {
- F(p1, p2, p3);
- return p1;
-}
-
-/* Function wrapper that munges the return value from R to void*. */
-template <class R, class P1, class P2, R F(P1, P2)>
-void *CastReturnToVoidPtr2(P1 p1, P2 p2) {
- return F(p1, p2);
-}
-
-template <class R, class P1, class P2, class P3, R F(P1, P2, P3)>
-void *CastReturnToVoidPtr3(P1 p1, P2 p2, P3 p3) {
- return F(p1, p2, p3);
-}
-
-/* Function wrapper that munges the return value from bool to void*. */
-template <class P1, class P2, bool F(P1, P2)>
-void *ReturnClosureOrBreak2(P1 p1, P2 p2) {
- return F(p1, p2) ? p1 : UPB_BREAK;
-}
-
-template <class P1, class P2, class P3, bool F(P1, P2, P3)>
-void *ReturnClosureOrBreak3(P1 p1, P2 p2, P3 p3) {
- return F(p1, p2, p3) ? p1 : UPB_BREAK;
-}
-
-/* For the string callback, which takes five params, returns the size param. */
-template <class P1, class P2,
- void F(P1, P2, const char *, size_t, const upb_bufhandle *)>
-size_t ReturnStringLen(P1 p1, P2 p2, const char *p3, size_t p4,
- const upb_bufhandle *p5) {
- F(p1, p2, p3, p4, p5);
- return p4;
-}
-
-/* For the string callback, which takes five params, returns the size param or
- * zero. */
-template <class P1, class P2,
- bool F(P1, P2, const char *, size_t, const upb_bufhandle *)>
-size_t ReturnNOr0(P1 p1, P2 p2, const char *p3, size_t p4,
- const upb_bufhandle *p5) {
- return F(p1, p2, p3, p4, p5) ? p4 : 0;
-}
-
-/* If we have a function returning void but want a function returning bool, wrap
- * it in a function that returns true. */
-template <class P1, class P2, void F(P1, P2), class I>
-struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, bool> {
- typedef Func2<bool, P1, P2, ReturnTrue2<P1, P2, F>, I> Func;
-};
-
-template <class P1, class P2, class P3, void F(P1, P2, P3), class I>
-struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, bool> {
- typedef Func3<bool, P1, P2, P3, ReturnTrue3<P1, P2, P3, F>, I> Func;
-};
-
-/* If our function returns void but we want one returning void*, wrap it in a
- * function that returns the first argument. */
-template <class P1, class P2, void F(P1, P2), class I>
-struct MaybeWrapReturn<Func2<void, P1, P2, F, I>, void *> {
- typedef Func2<void *, P1, P2, ReturnClosure2<P1, P2, F>, I> Func;
-};
-
-template <class P1, class P2, class P3, void F(P1, P2, P3), class I>
-struct MaybeWrapReturn<Func3<void, P1, P2, P3, F, I>, void *> {
- typedef Func3<void *, P1, P2, P3, ReturnClosure3<P1, P2, P3, F>, I> Func;
-};
-
-/* If our function returns R* but we want one returning void*, wrap it in a
- * function that casts to void*. */
-template <class R, class P1, class P2, R *F(P1, P2), class I>
-struct MaybeWrapReturn<Func2<R *, P1, P2, F, I>, void *,
- typename disable_if_same<R *, void *>::Type> {
- typedef Func2<void *, P1, P2, CastReturnToVoidPtr2<R *, P1, P2, F>, I> Func;
-};
-
-template <class R, class P1, class P2, class P3, R *F(P1, P2, P3), class I>
-struct MaybeWrapReturn<Func3<R *, P1, P2, P3, F, I>, void *,
- typename disable_if_same<R *, void *>::Type> {
- typedef Func3<void *, P1, P2, P3, CastReturnToVoidPtr3<R *, P1, P2, P3, F>, I>
- Func;
-};
-
-/* If our function returns bool but we want one returning void*, wrap it in a
- * function that returns either the first param or UPB_BREAK. */
-template <class P1, class P2, bool F(P1, P2), class I>
-struct MaybeWrapReturn<Func2<bool, P1, P2, F, I>, void *> {
- typedef Func2<void *, P1, P2, ReturnClosureOrBreak2<P1, P2, F>, I> Func;
-};
-
-template <class P1, class P2, class P3, bool F(P1, P2, P3), class I>
-struct MaybeWrapReturn<Func3<bool, P1, P2, P3, F, I>, void *> {
- typedef Func3<void *, P1, P2, P3, ReturnClosureOrBreak3<P1, P2, P3, F>, I>
- Func;
-};
-
-/* If our function returns void but we want one returning size_t, wrap it in a
- * function that returns the size argument. */
-template <class P1, class P2,
- void F(P1, P2, const char *, size_t, const upb_bufhandle *), class I>
-struct MaybeWrapReturn<
- Func5<void, P1, P2, const char *, size_t, const upb_bufhandle *, F, I>,
- size_t> {
- typedef Func5<size_t, P1, P2, const char *, size_t, const upb_bufhandle *,
- ReturnStringLen<P1, P2, F>, I> Func;
-};
-
-/* If our function returns bool but we want one returning size_t, wrap it in a
- * function that returns either 0 or the buf size. */
-template <class P1, class P2,
- bool F(P1, P2, const char *, size_t, const upb_bufhandle *), class I>
-struct MaybeWrapReturn<
- Func5<bool, P1, P2, const char *, size_t, const upb_bufhandle *, F, I>,
- size_t> {
- typedef Func5<size_t, P1, P2, const char *, size_t, const upb_bufhandle *,
- ReturnNOr0<P1, P2, F>, I> Func;
-};
-
-/* ConvertParams **************************************************************/
-
-/* Template class that converts the function parameters if necessary, and
- * ignores the HandlerData parameter if appropriate.
- *
- * Template parameter is the are FuncN function type. */
-template <class F, class T>
-struct ConvertParams;
-
-/* Function that discards the handler data parameter. */
-template <class R, class P1, R F(P1)>
-R IgnoreHandlerData2(void *p1, const void *hd) {
- UPB_UNUSED(hd);
- return F(static_cast<P1>(p1));
-}
-
-template <class R, class P1, class P2Wrapper, class P2Wrapped,
- R F(P1, P2Wrapped)>
-R IgnoreHandlerData3(void *p1, const void *hd, P2Wrapper p2) {
- UPB_UNUSED(hd);
- return F(static_cast<P1>(p1), p2);
-}
-
-template <class R, class P1, class P2, class P3, R F(P1, P2, P3)>
-R IgnoreHandlerData4(void *p1, const void *hd, P2 p2, P3 p3) {
- UPB_UNUSED(hd);
- return F(static_cast<P1>(p1), p2, p3);
-}
-
-template <class R, class P1, class P2, class P3, class P4, R F(P1, P2, P3, P4)>
-R IgnoreHandlerData5(void *p1, const void *hd, P2 p2, P3 p3, P4 p4) {
- UPB_UNUSED(hd);
- return F(static_cast<P1>(p1), p2, p3, p4);
-}
-
-template <class R, class P1, R F(P1, const char*, size_t)>
-R IgnoreHandlerDataIgnoreHandle(void *p1, const void *hd, const char *p2,
- size_t p3, const upb_bufhandle *handle) {
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
- return F(static_cast<P1>(p1), p2, p3);
-}
-
-/* Function that casts the handler data parameter. */
-template <class R, class P1, class P2, R F(P1, P2)>
-R CastHandlerData2(void *c, const void *hd) {
- return F(static_cast<P1>(c), static_cast<P2>(hd));
-}
-
-template <class R, class P1, class P2, class P3Wrapper, class P3Wrapped,
- R F(P1, P2, P3Wrapped)>
-R CastHandlerData3(void *c, const void *hd, P3Wrapper p3) {
- return F(static_cast<P1>(c), static_cast<P2>(hd), p3);
-}
-
-template <class R, class P1, class P2, class P3, class P4, class P5,
- R F(P1, P2, P3, P4, P5)>
-R CastHandlerData5(void *c, const void *hd, P3 p3, P4 p4, P5 p5) {
- return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4, p5);
-}
-
-template <class R, class P1, class P2, R F(P1, P2, const char *, size_t)>
-R CastHandlerDataIgnoreHandle(void *c, const void *hd, const char *p3,
- size_t p4, const upb_bufhandle *handle) {
- UPB_UNUSED(handle);
- return F(static_cast<P1>(c), static_cast<P2>(hd), p3, p4);
-}
-
-/* For unbound functions, ignore the handler data. */
-template <class R, class P1, R F(P1), class I, class T>
-struct ConvertParams<Func1<R, P1, F, I>, T> {
- typedef Func2<R, void *, const void *, IgnoreHandlerData2<R, P1, F>, I> Func;
-};
-
-template <class R, class P1, class P2, R F(P1, P2), class I,
- class R2, class P1_2, class P2_2, class P3_2>
-struct ConvertParams<Func2<R, P1, P2, F, I>,
- R2 (*)(P1_2, P2_2, P3_2)> {
- typedef Func3<R, void *, const void *, P3_2,
- IgnoreHandlerData3<R, P1, P3_2, P2, F>, I> Func;
-};
-
-/* For StringBuffer only; this ignores both the handler data and the
- * upb_bufhandle. */
-template <class R, class P1, R F(P1, const char *, size_t), class I, class T>
-struct ConvertParams<Func3<R, P1, const char *, size_t, F, I>, T> {
- typedef Func5<R, void *, const void *, const char *, size_t,
- const upb_bufhandle *, IgnoreHandlerDataIgnoreHandle<R, P1, F>,
- I> Func;
-};
-
-template <class R, class P1, class P2, class P3, class P4, R F(P1, P2, P3, P4),
- class I, class T>
-struct ConvertParams<Func4<R, P1, P2, P3, P4, F, I>, T> {
- typedef Func5<R, void *, const void *, P2, P3, P4,
- IgnoreHandlerData5<R, P1, P2, P3, P4, F>, I> Func;
-};
-
-/* For bound functions, cast the handler data. */
-template <class R, class P1, class P2, R F(P1, P2), class I, class T>
-struct ConvertParams<BoundFunc2<R, P1, P2, F, I>, T> {
- typedef Func2<R, void *, const void *, CastHandlerData2<R, P1, P2, F>, I>
- Func;
-};
-
-template <class R, class P1, class P2, class P3, R F(P1, P2, P3), class I,
- class R2, class P1_2, class P2_2, class P3_2>
-struct ConvertParams<BoundFunc3<R, P1, P2, P3, F, I>,
- R2 (*)(P1_2, P2_2, P3_2)> {
- typedef Func3<R, void *, const void *, P3_2,
- CastHandlerData3<R, P1, P2, P3_2, P3, F>, I> Func;
-};
-
-/* For StringBuffer only; this ignores the upb_bufhandle. */
-template <class R, class P1, class P2, R F(P1, P2, const char *, size_t),
- class I, class T>
-struct ConvertParams<BoundFunc4<R, P1, P2, const char *, size_t, F, I>, T> {
- typedef Func5<R, void *, const void *, const char *, size_t,
- const upb_bufhandle *,
- CastHandlerDataIgnoreHandle<R, P1, P2, F>, I>
- Func;
-};
-
-template <class R, class P1, class P2, class P3, class P4, class P5,
- R F(P1, P2, P3, P4, P5), class I, class T>
-struct ConvertParams<BoundFunc5<R, P1, P2, P3, P4, P5, F, I>, T> {
- typedef Func5<R, void *, const void *, P3, P4, P5,
- CastHandlerData5<R, P1, P2, P3, P4, P5, F>, I> Func;
-};
-
-/* utype/ltype are upper/lower-case, ctype is canonical C type, vtype is
- * variant C type. */
-#define TYPE_METHODS(utype, ltype, ctype, vtype) \
- template <> \
- struct CanonicalType<vtype> { \
- typedef ctype Type; \
- }; \
- template <> \
- inline bool HandlersPtr::SetValueHandler<vtype>( \
- FieldDefPtr f, const HandlersPtr::utype##Handler &handler) { \
- handler.AddCleanup(ptr()); \
- return upb_handlers_set##ltype(ptr(), f.ptr(), handler.handler(), \
- &handler.attr()); \
- }
-
-TYPE_METHODS(Double, double, double, double)
-TYPE_METHODS(Float, float, float, float)
-TYPE_METHODS(UInt64, uint64, uint64_t, UPB_UINT64_T)
-TYPE_METHODS(UInt32, uint32, uint32_t, UPB_UINT32_T)
-TYPE_METHODS(Int64, int64, int64_t, UPB_INT64_T)
-TYPE_METHODS(Int32, int32, int32_t, UPB_INT32_T)
-TYPE_METHODS(Bool, bool, bool, bool)
-
-#ifdef UPB_TWO_32BIT_TYPES
-TYPE_METHODS(Int32, int32, int32_t, UPB_INT32ALT_T)
-TYPE_METHODS(UInt32, uint32, uint32_t, UPB_UINT32ALT_T)
-#endif
-
-#ifdef UPB_TWO_64BIT_TYPES
-TYPE_METHODS(Int64, int64, int64_t, UPB_INT64ALT_T)
-TYPE_METHODS(UInt64, uint64, uint64_t, UPB_UINT64ALT_T)
-#endif
-#undef TYPE_METHODS
-
-template <> struct CanonicalType<Status*> {
- typedef Status* Type;
-};
-
-template <class F> struct ReturnOf;
-
-template <class R, class P1, class P2>
-struct ReturnOf<R (*)(P1, P2)> {
- typedef R Return;
-};
-
-template <class R, class P1, class P2, class P3>
-struct ReturnOf<R (*)(P1, P2, P3)> {
- typedef R Return;
-};
-
-template <class R, class P1, class P2, class P3, class P4>
-struct ReturnOf<R (*)(P1, P2, P3, P4)> {
- typedef R Return;
-};
-
-template <class R, class P1, class P2, class P3, class P4, class P5>
-struct ReturnOf<R (*)(P1, P2, P3, P4, P5)> {
- typedef R Return;
-};
-
-
-template <class T>
-template <class F>
-inline Handler<T>::Handler(F func)
- : registered_(false),
- cleanup_data_(func.GetData()),
- cleanup_func_(func.GetCleanup()) {
- attr_.handler_data = func.GetData();
- typedef typename ReturnOf<T>::Return Return;
- typedef typename ConvertParams<F, T>::Func ConvertedParamsFunc;
- typedef typename MaybeWrapReturn<ConvertedParamsFunc, Return>::Func
- ReturnWrappedFunc;
- handler_ = ReturnWrappedFunc().Call;
-
- /* Set attributes based on what templates can statically tell us about the
- * user's function. */
-
- /* If the original function returns void, then we know that we wrapped it to
- * always return ok. */
- bool always_ok = is_same<typename F::FuncInfo::Return, void>::value;
- attr_.alwaysok = always_ok;
-
- /* Closure parameter and return type. */
- attr_.closure_type = UniquePtrForType<typename F::FuncInfo::Closure>();
-
- /* We use the closure type (from the first parameter) if the return type is
- * void or bool, since these are the two cases we wrap to return the closure's
- * type anyway.
- *
- * This is all nonsense for non START* handlers, but it doesn't matter because
- * in that case the value will be ignored. */
- typedef typename FirstUnlessVoidOrBool<typename F::FuncInfo::Return,
- typename F::FuncInfo::Closure>::value
- EffectiveReturn;
- attr_.return_closure_type = UniquePtrForType<EffectiveReturn>();
-}
-
-template <class T>
-inline void Handler<T>::AddCleanup(upb_handlers* h) const {
- UPB_ASSERT(!registered_);
- registered_ = true;
- if (cleanup_func_) {
- bool ok = upb_handlers_addcleanup(h, cleanup_data_, cleanup_func_);
- UPB_ASSERT(ok);
- }
-}
-
-} /* namespace upb */
-
-#endif /* __cplusplus */
-
-
-#undef UPB_TWO_32BIT_TYPES
-#undef UPB_TWO_64BIT_TYPES
-#undef UPB_INT32_T
-#undef UPB_UINT32_T
-#undef UPB_INT32ALT_T
-#undef UPB_UINT32ALT_T
-#undef UPB_INT64_T
-#undef UPB_UINT64_T
-#undef UPB_INT64ALT_T
-#undef UPB_UINT64ALT_T
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_HANDLERS_INL_H_ */
diff --git a/grpc/third_party/upb/upb/handlers.c b/grpc/third_party/upb/upb/handlers.c
deleted file mode 100644
index 4168a4fb..00000000
--- a/grpc/third_party/upb/upb/handlers.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
-** TODO(haberman): it's unclear whether a lot of the consistency checks should
-** UPB_ASSERT() or return false.
-*/
-
-#include "upb/handlers.h"
-
-#include <string.h>
-
-#include "upb/sink.h"
-
-#include "upb/port_def.inc"
-
-struct upb_handlers {
- upb_handlercache *cache;
- const upb_msgdef *msg;
- const upb_handlers **sub;
- const void *top_closure_type;
- upb_handlers_tabent table[1]; /* Dynamically-sized field handler array. */
-};
-
-static void *upb_calloc(upb_arena *arena, size_t size) {
- void *mem = upb_malloc(upb_arena_alloc(arena), size);
- if (mem) {
- memset(mem, 0, size);
- }
- return mem;
-}
-
-/* Defined for the sole purpose of having a unique pointer value for
- * UPB_NO_CLOSURE. */
-char _upb_noclosure;
-
-/* Given a selector for a STARTSUBMSG handler, resolves to a pointer to the
- * subhandlers for this submessage field. */
-#define SUBH(h, selector) (h->sub[selector])
-
-/* The selector for a submessage field is the field index. */
-#define SUBH_F(h, f) SUBH(h, upb_fielddef_index(f))
-
-static int32_t trygetsel(upb_handlers *h, const upb_fielddef *f,
- upb_handlertype_t type) {
- upb_selector_t sel;
- bool ok;
-
- ok = upb_handlers_getselector(f, type, &sel);
-
- UPB_ASSERT(upb_handlers_msgdef(h) == upb_fielddef_containingtype(f));
- UPB_ASSERT(ok);
-
- return sel;
-}
-
-static upb_selector_t handlers_getsel(upb_handlers *h, const upb_fielddef *f,
- upb_handlertype_t type) {
- int32_t sel = trygetsel(h, f, type);
- UPB_ASSERT(sel >= 0);
- return sel;
-}
-
-static const void **returntype(upb_handlers *h, const upb_fielddef *f,
- upb_handlertype_t type) {
- return &h->table[handlers_getsel(h, f, type)].attr.return_closure_type;
-}
-
-static bool doset(upb_handlers *h, int32_t sel, const upb_fielddef *f,
- upb_handlertype_t type, upb_func *func,
- const upb_handlerattr *attr) {
- upb_handlerattr set_attr = UPB_HANDLERATTR_INIT;
- const void *closure_type;
- const void **context_closure_type;
-
- UPB_ASSERT(!h->table[sel].func);
-
- if (attr) {
- set_attr = *attr;
- }
-
- /* Check that the given closure type matches the closure type that has been
- * established for this context (if any). */
- closure_type = set_attr.closure_type;
-
- if (type == UPB_HANDLER_STRING) {
- context_closure_type = returntype(h, f, UPB_HANDLER_STARTSTR);
- } else if (f && upb_fielddef_isseq(f) &&
- type != UPB_HANDLER_STARTSEQ &&
- type != UPB_HANDLER_ENDSEQ) {
- context_closure_type = returntype(h, f, UPB_HANDLER_STARTSEQ);
- } else {
- context_closure_type = &h->top_closure_type;
- }
-
- if (closure_type && *context_closure_type &&
- closure_type != *context_closure_type) {
- return false;
- }
-
- if (closure_type)
- *context_closure_type = closure_type;
-
- /* If this is a STARTSEQ or STARTSTR handler, check that the returned pointer
- * matches any pre-existing expectations about what type is expected. */
- if (type == UPB_HANDLER_STARTSEQ || type == UPB_HANDLER_STARTSTR) {
- const void *return_type = set_attr.return_closure_type;
- const void *table_return_type = h->table[sel].attr.return_closure_type;
- if (return_type && table_return_type && return_type != table_return_type) {
- return false;
- }
-
- if (table_return_type && !return_type) {
- set_attr.return_closure_type = table_return_type;
- }
- }
-
- h->table[sel].func = (upb_func*)func;
- h->table[sel].attr = set_attr;
- return true;
-}
-
-/* Returns the effective closure type for this handler (which will propagate
- * from outer frames if this frame has no START* handler). Not implemented for
- * UPB_HANDLER_STRING at the moment since this is not needed. Returns NULL is
- * the effective closure type is unspecified (either no handler was registered
- * to specify it or the handler that was registered did not specify the closure
- * type). */
-const void *effective_closure_type(upb_handlers *h, const upb_fielddef *f,
- upb_handlertype_t type) {
- const void *ret;
- upb_selector_t sel;
-
- UPB_ASSERT(type != UPB_HANDLER_STRING);
- ret = h->top_closure_type;
-
- if (upb_fielddef_isseq(f) &&
- type != UPB_HANDLER_STARTSEQ &&
- type != UPB_HANDLER_ENDSEQ &&
- h->table[sel = handlers_getsel(h, f, UPB_HANDLER_STARTSEQ)].func) {
- ret = h->table[sel].attr.return_closure_type;
- }
-
- if (type == UPB_HANDLER_STRING &&
- h->table[sel = handlers_getsel(h, f, UPB_HANDLER_STARTSTR)].func) {
- ret = h->table[sel].attr.return_closure_type;
- }
-
- /* The effective type of the submessage; not used yet.
- * if (type == SUBMESSAGE &&
- * h->table[sel = handlers_getsel(h, f, UPB_HANDLER_STARTSUBMSG)].func) {
- * ret = h->table[sel].attr.return_closure_type;
- * } */
-
- return ret;
-}
-
-static upb_handlers *upb_handlers_new(const upb_msgdef *md,
- upb_handlercache *cache,
- upb_arena *arena) {
- int extra;
- upb_handlers *h;
-
- extra =
- (int)(sizeof(upb_handlers_tabent) * (upb_msgdef_selectorcount(md) - 1));
- h = upb_calloc(arena, sizeof(*h) + extra);
- if (!h) return NULL;
-
- h->cache = cache;
- h->msg = md;
-
- if (upb_msgdef_submsgfieldcount(md) > 0) {
- size_t bytes = upb_msgdef_submsgfieldcount(md) * sizeof(*h->sub);
- h->sub = upb_calloc(arena, bytes);
- if (!h->sub) return NULL;
- } else {
- h->sub = 0;
- }
-
- /* calloc() above initialized all handlers to NULL. */
- return h;
-}
-
-/* Public interface ***********************************************************/
-
-#define SETTER(name, handlerctype, handlertype) \
- bool upb_handlers_set##name(upb_handlers *h, const upb_fielddef *f, \
- handlerctype func, \
- const upb_handlerattr *attr) { \
- int32_t sel = trygetsel(h, f, handlertype); \
- return doset(h, sel, f, handlertype, (upb_func *)func, attr); \
- }
-
-SETTER(int32, upb_int32_handlerfunc*, UPB_HANDLER_INT32)
-SETTER(int64, upb_int64_handlerfunc*, UPB_HANDLER_INT64)
-SETTER(uint32, upb_uint32_handlerfunc*, UPB_HANDLER_UINT32)
-SETTER(uint64, upb_uint64_handlerfunc*, UPB_HANDLER_UINT64)
-SETTER(float, upb_float_handlerfunc*, UPB_HANDLER_FLOAT)
-SETTER(double, upb_double_handlerfunc*, UPB_HANDLER_DOUBLE)
-SETTER(bool, upb_bool_handlerfunc*, UPB_HANDLER_BOOL)
-SETTER(startstr, upb_startstr_handlerfunc*, UPB_HANDLER_STARTSTR)
-SETTER(string, upb_string_handlerfunc*, UPB_HANDLER_STRING)
-SETTER(endstr, upb_endfield_handlerfunc*, UPB_HANDLER_ENDSTR)
-SETTER(startseq, upb_startfield_handlerfunc*, UPB_HANDLER_STARTSEQ)
-SETTER(startsubmsg, upb_startfield_handlerfunc*, UPB_HANDLER_STARTSUBMSG)
-SETTER(endsubmsg, upb_endfield_handlerfunc*, UPB_HANDLER_ENDSUBMSG)
-SETTER(endseq, upb_endfield_handlerfunc*, UPB_HANDLER_ENDSEQ)
-
-#undef SETTER
-
-bool upb_handlers_setunknown(upb_handlers *h, upb_unknown_handlerfunc *func,
- const upb_handlerattr *attr) {
- return doset(h, UPB_UNKNOWN_SELECTOR, NULL, UPB_HANDLER_INT32,
- (upb_func *)func, attr);
-}
-
-bool upb_handlers_setstartmsg(upb_handlers *h, upb_startmsg_handlerfunc *func,
- const upb_handlerattr *attr) {
- return doset(h, UPB_STARTMSG_SELECTOR, NULL, UPB_HANDLER_INT32,
- (upb_func *)func, attr);
-}
-
-bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func,
- const upb_handlerattr *attr) {
- return doset(h, UPB_ENDMSG_SELECTOR, NULL, UPB_HANDLER_INT32,
- (upb_func *)func, attr);
-}
-
-bool upb_handlers_setsubhandlers(upb_handlers *h, const upb_fielddef *f,
- const upb_handlers *sub) {
- UPB_ASSERT(sub);
- UPB_ASSERT(upb_fielddef_issubmsg(f));
- if (SUBH_F(h, f)) return false; /* Can't reset. */
- if (upb_handlers_msgdef(sub) != upb_fielddef_msgsubdef(f)) {
- return false;
- }
- SUBH_F(h, f) = sub;
- return true;
-}
-
-const upb_handlers *upb_handlers_getsubhandlers(const upb_handlers *h,
- const upb_fielddef *f) {
- UPB_ASSERT(upb_fielddef_issubmsg(f));
- return SUBH_F(h, f);
-}
-
-upb_func *upb_handlers_gethandler(const upb_handlers *h, upb_selector_t s,
- const void **handler_data) {
- upb_func *ret = (upb_func *)h->table[s].func;
- if (ret && handler_data) {
- *handler_data = h->table[s].attr.handler_data;
- }
- return ret;
-}
-
-bool upb_handlers_getattr(const upb_handlers *h, upb_selector_t sel,
- upb_handlerattr *attr) {
- if (!upb_handlers_gethandler(h, sel, NULL))
- return false;
- *attr = h->table[sel].attr;
- return true;
-}
-
-const upb_handlers *upb_handlers_getsubhandlers_sel(const upb_handlers *h,
- upb_selector_t sel) {
- /* STARTSUBMSG selector in sel is the field's selector base. */
- return SUBH(h, sel - UPB_STATIC_SELECTOR_COUNT);
-}
-
-const upb_msgdef *upb_handlers_msgdef(const upb_handlers *h) { return h->msg; }
-
-bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *func) {
- return upb_handlercache_addcleanup(h->cache, p, func);
-}
-
-upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f) {
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM: return UPB_HANDLER_INT32;
- case UPB_TYPE_INT64: return UPB_HANDLER_INT64;
- case UPB_TYPE_UINT32: return UPB_HANDLER_UINT32;
- case UPB_TYPE_UINT64: return UPB_HANDLER_UINT64;
- case UPB_TYPE_FLOAT: return UPB_HANDLER_FLOAT;
- case UPB_TYPE_DOUBLE: return UPB_HANDLER_DOUBLE;
- case UPB_TYPE_BOOL: return UPB_HANDLER_BOOL;
- default: UPB_ASSERT(false); return -1; /* Invalid input. */
- }
-}
-
-bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type,
- upb_selector_t *s) {
- uint32_t selector_base = upb_fielddef_selectorbase(f);
- switch (type) {
- case UPB_HANDLER_INT32:
- case UPB_HANDLER_INT64:
- case UPB_HANDLER_UINT32:
- case UPB_HANDLER_UINT64:
- case UPB_HANDLER_FLOAT:
- case UPB_HANDLER_DOUBLE:
- case UPB_HANDLER_BOOL:
- if (!upb_fielddef_isprimitive(f) ||
- upb_handlers_getprimitivehandlertype(f) != type)
- return false;
- *s = selector_base;
- break;
- case UPB_HANDLER_STRING:
- if (upb_fielddef_isstring(f)) {
- *s = selector_base;
- } else if (upb_fielddef_lazy(f)) {
- *s = selector_base + 3;
- } else {
- return false;
- }
- break;
- case UPB_HANDLER_STARTSTR:
- if (upb_fielddef_isstring(f) || upb_fielddef_lazy(f)) {
- *s = selector_base + 1;
- } else {
- return false;
- }
- break;
- case UPB_HANDLER_ENDSTR:
- if (upb_fielddef_isstring(f) || upb_fielddef_lazy(f)) {
- *s = selector_base + 2;
- } else {
- return false;
- }
- break;
- case UPB_HANDLER_STARTSEQ:
- if (!upb_fielddef_isseq(f)) return false;
- *s = selector_base - 2;
- break;
- case UPB_HANDLER_ENDSEQ:
- if (!upb_fielddef_isseq(f)) return false;
- *s = selector_base - 1;
- break;
- case UPB_HANDLER_STARTSUBMSG:
- if (!upb_fielddef_issubmsg(f)) return false;
- /* Selectors for STARTSUBMSG are at the beginning of the table so that the
- * selector can also be used as an index into the "sub" array of
- * subhandlers. The indexes for the two into these two tables are the
- * same, except that in the handler table the static selectors come first. */
- *s = upb_fielddef_index(f) + UPB_STATIC_SELECTOR_COUNT;
- break;
- case UPB_HANDLER_ENDSUBMSG:
- if (!upb_fielddef_issubmsg(f)) return false;
- *s = selector_base;
- break;
- }
- UPB_ASSERT((size_t)*s < upb_msgdef_selectorcount(upb_fielddef_containingtype(f)));
- return true;
-}
-
-/* upb_handlercache ***********************************************************/
-
-struct upb_handlercache {
- upb_arena *arena;
- upb_inttable tab; /* maps upb_msgdef* -> upb_handlers*. */
- upb_handlers_callback *callback;
- const void *closure;
-};
-
-const upb_handlers *upb_handlercache_get(upb_handlercache *c,
- const upb_msgdef *md) {
- int i, n;
- upb_value v;
- upb_handlers *h;
-
- if (upb_inttable_lookupptr(&c->tab, md, &v)) {
- return upb_value_getptr(v);
- }
-
- h = upb_handlers_new(md, c, c->arena);
- v = upb_value_ptr(h);
-
- if (!h) return NULL;
- if (!upb_inttable_insertptr(&c->tab, md, v)) return NULL;
-
- c->callback(c->closure, h);
-
- /* For each submessage field, get or create a handlers object and set it as
- * the subhandlers. */
- n = upb_msgdef_fieldcount(md);
- for (i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
-
- if (upb_fielddef_issubmsg(f)) {
- const upb_msgdef *subdef = upb_fielddef_msgsubdef(f);
- const upb_handlers *sub_mh = upb_handlercache_get(c, subdef);
-
- if (!sub_mh) return NULL;
-
- upb_handlers_setsubhandlers(h, f, sub_mh);
- }
- }
-
- return h;
-}
-
-
-upb_handlercache *upb_handlercache_new(upb_handlers_callback *callback,
- const void *closure) {
- upb_handlercache *cache = upb_gmalloc(sizeof(*cache));
-
- if (!cache) return NULL;
-
- cache->arena = upb_arena_new();
-
- cache->callback = callback;
- cache->closure = closure;
-
- if (!upb_inttable_init(&cache->tab, UPB_CTYPE_PTR)) goto oom;
-
- return cache;
-
-oom:
- upb_gfree(cache);
- return NULL;
-}
-
-void upb_handlercache_free(upb_handlercache *cache) {
- upb_inttable_uninit(&cache->tab);
- upb_arena_free(cache->arena);
- upb_gfree(cache);
-}
-
-bool upb_handlercache_addcleanup(upb_handlercache *c, void *p,
- upb_handlerfree *func) {
- return upb_arena_addcleanup(c->arena, p, func);
-}
-
-/* upb_byteshandler ***********************************************************/
-
-bool upb_byteshandler_setstartstr(upb_byteshandler *h,
- upb_startstr_handlerfunc *func, void *d) {
- h->table[UPB_STARTSTR_SELECTOR].func = (upb_func*)func;
- h->table[UPB_STARTSTR_SELECTOR].attr.handler_data = d;
- return true;
-}
-
-bool upb_byteshandler_setstring(upb_byteshandler *h,
- upb_string_handlerfunc *func, void *d) {
- h->table[UPB_STRING_SELECTOR].func = (upb_func*)func;
- h->table[UPB_STRING_SELECTOR].attr.handler_data = d;
- return true;
-}
-
-bool upb_byteshandler_setendstr(upb_byteshandler *h,
- upb_endfield_handlerfunc *func, void *d) {
- h->table[UPB_ENDSTR_SELECTOR].func = (upb_func*)func;
- h->table[UPB_ENDSTR_SELECTOR].attr.handler_data = d;
- return true;
-}
-
-/** Handlers for upb_msg ******************************************************/
-
-typedef struct {
- size_t offset;
- int32_t hasbit;
-} upb_msg_handlerdata;
-
-/* Fallback implementation if the handler is not specialized by the producer. */
-#define MSG_WRITER(type, ctype) \
- bool upb_msg_set ## type (void *c, const void *hd, ctype val) { \
- uint8_t *m = c; \
- const upb_msg_handlerdata *d = hd; \
- if (d->hasbit > 0) \
- *(uint8_t*)&m[d->hasbit / 8] |= 1 << (d->hasbit % 8); \
- *(ctype*)&m[d->offset] = val; \
- return true; \
- } \
-
-MSG_WRITER(double, double)
-MSG_WRITER(float, float)
-MSG_WRITER(int32, int32_t)
-MSG_WRITER(int64, int64_t)
-MSG_WRITER(uint32, uint32_t)
-MSG_WRITER(uint64, uint64_t)
-MSG_WRITER(bool, bool)
-
-bool upb_msg_setscalarhandler(upb_handlers *h, const upb_fielddef *f,
- size_t offset, int32_t hasbit) {
- upb_handlerattr attr = UPB_HANDLERATTR_INIT;
- bool ok;
-
- upb_msg_handlerdata *d = upb_gmalloc(sizeof(*d));
- if (!d) return false;
- d->offset = offset;
- d->hasbit = hasbit;
-
- attr.handler_data = d;
- attr.alwaysok = true;
- upb_handlers_addcleanup(h, d, upb_gfree);
-
-#define TYPE(u, l) \
- case UPB_TYPE_##u: \
- ok = upb_handlers_set##l(h, f, upb_msg_set##l, &attr); break;
-
- ok = false;
-
- switch (upb_fielddef_type(f)) {
- TYPE(INT64, int64);
- TYPE(INT32, int32);
- TYPE(ENUM, int32);
- TYPE(UINT64, uint64);
- TYPE(UINT32, uint32);
- TYPE(DOUBLE, double);
- TYPE(FLOAT, float);
- TYPE(BOOL, bool);
- default: UPB_ASSERT(false); break;
- }
-#undef TYPE
-
- return ok;
-}
-
-bool upb_msg_getscalarhandlerdata(const upb_handlers *h,
- upb_selector_t s,
- upb_fieldtype_t *type,
- size_t *offset,
- int32_t *hasbit) {
- const upb_msg_handlerdata *d;
- const void *p;
- upb_func *f = upb_handlers_gethandler(h, s, &p);
-
- if ((upb_int64_handlerfunc*)f == upb_msg_setint64) {
- *type = UPB_TYPE_INT64;
- } else if ((upb_int32_handlerfunc*)f == upb_msg_setint32) {
- *type = UPB_TYPE_INT32;
- } else if ((upb_uint64_handlerfunc*)f == upb_msg_setuint64) {
- *type = UPB_TYPE_UINT64;
- } else if ((upb_uint32_handlerfunc*)f == upb_msg_setuint32) {
- *type = UPB_TYPE_UINT32;
- } else if ((upb_double_handlerfunc*)f == upb_msg_setdouble) {
- *type = UPB_TYPE_DOUBLE;
- } else if ((upb_float_handlerfunc*)f == upb_msg_setfloat) {
- *type = UPB_TYPE_FLOAT;
- } else if ((upb_bool_handlerfunc*)f == upb_msg_setbool) {
- *type = UPB_TYPE_BOOL;
- } else {
- return false;
- }
-
- d = p;
- *offset = d->offset;
- *hasbit = d->hasbit;
- return true;
-}
diff --git a/grpc/third_party/upb/upb/handlers.h b/grpc/third_party/upb/upb/handlers.h
deleted file mode 100644
index 53904b60..00000000
--- a/grpc/third_party/upb/upb/handlers.h
+++ /dev/null
@@ -1,735 +0,0 @@
-/*
-** upb::Handlers (upb_handlers)
-**
-** A upb_handlers is like a virtual table for a upb_msgdef. Each field of the
-** message can have associated functions that will be called when we are
-** parsing or visiting a stream of data. This is similar to how handlers work
-** in SAX (the Simple API for XML).
-**
-** The handlers have no idea where the data is coming from, so a single set of
-** handlers could be used with two completely different data sources (for
-** example, a parser and a visitor over in-memory objects). This decoupling is
-** the most important feature of upb, because it allows parsers and serializers
-** to be highly reusable.
-**
-** This is a mixed C/C++ interface that offers a full API to both languages.
-** See the top-level README for more information.
-*/
-
-#ifndef UPB_HANDLERS_H
-#define UPB_HANDLERS_H
-
-#include "upb/def.h"
-#include "upb/table.int.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-#include "upb/def.hpp"
-namespace upb {
-class HandlersPtr;
-class HandlerCache;
-template <class T> class Handler;
-template <class T> struct CanonicalType;
-} /* namespace upb */
-#endif
-
-
-/* The maximum depth that the handler graph can have. This is a resource limit
- * for the C stack since we sometimes need to recursively traverse the graph.
- * Cycles are ok; the traversal will stop when it detects a cycle, but we must
- * hit the cycle before the maximum depth is reached.
- *
- * If having a single static limit is too inflexible, we can add another variant
- * of Handlers::Freeze that allows specifying this as a parameter. */
-#define UPB_MAX_HANDLER_DEPTH 64
-
-/* All the different types of handlers that can be registered.
- * Only needed for the advanced functions in upb::Handlers. */
-typedef enum {
- UPB_HANDLER_INT32,
- UPB_HANDLER_INT64,
- UPB_HANDLER_UINT32,
- UPB_HANDLER_UINT64,
- UPB_HANDLER_FLOAT,
- UPB_HANDLER_DOUBLE,
- UPB_HANDLER_BOOL,
- UPB_HANDLER_STARTSTR,
- UPB_HANDLER_STRING,
- UPB_HANDLER_ENDSTR,
- UPB_HANDLER_STARTSUBMSG,
- UPB_HANDLER_ENDSUBMSG,
- UPB_HANDLER_STARTSEQ,
- UPB_HANDLER_ENDSEQ
-} upb_handlertype_t;
-
-#define UPB_HANDLER_MAX (UPB_HANDLER_ENDSEQ+1)
-
-#define UPB_BREAK NULL
-
-/* A convenient definition for when no closure is needed. */
-extern char _upb_noclosure;
-#define UPB_NO_CLOSURE &_upb_noclosure
-
-/* A selector refers to a specific field handler in the Handlers object
- * (for example: the STARTSUBMSG handler for field "field15"). */
-typedef int32_t upb_selector_t;
-
-/* Static selectors for upb::Handlers. */
-#define UPB_STARTMSG_SELECTOR 0
-#define UPB_ENDMSG_SELECTOR 1
-#define UPB_UNKNOWN_SELECTOR 2
-#define UPB_STATIC_SELECTOR_COUNT 3 /* Warning: also in upb/def.c. */
-
-/* Static selectors for upb::BytesHandler. */
-#define UPB_STARTSTR_SELECTOR 0
-#define UPB_STRING_SELECTOR 1
-#define UPB_ENDSTR_SELECTOR 2
-
-#ifdef __cplusplus
-template<class T> const void *UniquePtrForType() {
- static const char ch = 0;
- return &ch;
-}
-#endif
-
-/* upb_handlers ************************************************************/
-
-/* Handler attributes, to be registered with the handler itself. */
-typedef struct {
- const void *handler_data;
- const void *closure_type;
- const void *return_closure_type;
- bool alwaysok;
-} upb_handlerattr;
-
-#define UPB_HANDLERATTR_INIT {NULL, NULL, NULL, false}
-
-/* Bufhandle, data passed along with a buffer to indicate its provenance. */
-struct upb_bufhandle {
- /* The beginning of the buffer. This may be different than the pointer
- * passed to a StringBuf handler because the handler may receive data
- * that is from the middle or end of a larger buffer. */
- const char *buf;
-
- /* The offset within the attached object where this buffer begins. Only
- * meaningful if there is an attached object. */
- size_t objofs;
-
- /* The attached object (if any) and a pointer representing its type. */
- const void *obj;
- const void *objtype;
-
-#ifdef __cplusplus
- template <class T>
- void SetAttachedObject(const T* _obj) {
- obj = _obj;
- objtype = UniquePtrForType<T>();
- }
-
- template <class T>
- const T *GetAttachedObject() const {
- return objtype == UniquePtrForType<T>() ? static_cast<const T *>(obj)
- : NULL;
- }
-#endif
-};
-
-typedef struct upb_bufhandle upb_bufhandle;
-
-#define UPB_BUFHANDLE_INIT {NULL, 0, NULL, NULL}
-
-/* Handler function typedefs. */
-typedef void upb_handlerfree(void *d);
-typedef bool upb_unknown_handlerfunc(void *c, const void *hd, const char *buf,
- size_t n);
-typedef bool upb_startmsg_handlerfunc(void *c, const void*);
-typedef bool upb_endmsg_handlerfunc(void *c, const void *, upb_status *status);
-typedef void* upb_startfield_handlerfunc(void *c, const void *hd);
-typedef bool upb_endfield_handlerfunc(void *c, const void *hd);
-typedef bool upb_int32_handlerfunc(void *c, const void *hd, int32_t val);
-typedef bool upb_int64_handlerfunc(void *c, const void *hd, int64_t val);
-typedef bool upb_uint32_handlerfunc(void *c, const void *hd, uint32_t val);
-typedef bool upb_uint64_handlerfunc(void *c, const void *hd, uint64_t val);
-typedef bool upb_float_handlerfunc(void *c, const void *hd, float val);
-typedef bool upb_double_handlerfunc(void *c, const void *hd, double val);
-typedef bool upb_bool_handlerfunc(void *c, const void *hd, bool val);
-typedef void *upb_startstr_handlerfunc(void *c, const void *hd,
- size_t size_hint);
-typedef size_t upb_string_handlerfunc(void *c, const void *hd, const char *buf,
- size_t n, const upb_bufhandle* handle);
-
-struct upb_handlers;
-typedef struct upb_handlers upb_handlers;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Mutating accessors. */
-const upb_status *upb_handlers_status(upb_handlers *h);
-void upb_handlers_clearerr(upb_handlers *h);
-const upb_msgdef *upb_handlers_msgdef(const upb_handlers *h);
-bool upb_handlers_addcleanup(upb_handlers *h, void *p, upb_handlerfree *hfree);
-bool upb_handlers_setunknown(upb_handlers *h, upb_unknown_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setstartmsg(upb_handlers *h, upb_startmsg_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setendmsg(upb_handlers *h, upb_endmsg_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setint32(upb_handlers *h, const upb_fielddef *f,
- upb_int32_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setint64(upb_handlers *h, const upb_fielddef *f,
- upb_int64_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setuint32(upb_handlers *h, const upb_fielddef *f,
- upb_uint32_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setuint64(upb_handlers *h, const upb_fielddef *f,
- upb_uint64_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setfloat(upb_handlers *h, const upb_fielddef *f,
- upb_float_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setdouble(upb_handlers *h, const upb_fielddef *f,
- upb_double_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setbool(upb_handlers *h, const upb_fielddef *f,
- upb_bool_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setstartstr(upb_handlers *h, const upb_fielddef *f,
- upb_startstr_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setstring(upb_handlers *h, const upb_fielddef *f,
- upb_string_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setendstr(upb_handlers *h, const upb_fielddef *f,
- upb_endfield_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setstartseq(upb_handlers *h, const upb_fielddef *f,
- upb_startfield_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setstartsubmsg(upb_handlers *h, const upb_fielddef *f,
- upb_startfield_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setendsubmsg(upb_handlers *h, const upb_fielddef *f,
- upb_endfield_handlerfunc *func,
- const upb_handlerattr *attr);
-bool upb_handlers_setendseq(upb_handlers *h, const upb_fielddef *f,
- upb_endfield_handlerfunc *func,
- const upb_handlerattr *attr);
-
-/* Read-only accessors. */
-const upb_handlers *upb_handlers_getsubhandlers(const upb_handlers *h,
- const upb_fielddef *f);
-const upb_handlers *upb_handlers_getsubhandlers_sel(const upb_handlers *h,
- upb_selector_t sel);
-upb_func *upb_handlers_gethandler(const upb_handlers *h, upb_selector_t s,
- const void **handler_data);
-bool upb_handlers_getattr(const upb_handlers *h, upb_selector_t s,
- upb_handlerattr *attr);
-
-/* "Static" methods */
-upb_handlertype_t upb_handlers_getprimitivehandlertype(const upb_fielddef *f);
-bool upb_handlers_getselector(const upb_fielddef *f, upb_handlertype_t type,
- upb_selector_t *s);
-UPB_INLINE upb_selector_t upb_handlers_getendselector(upb_selector_t start) {
- return start + 1;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-namespace upb {
-typedef upb_handlers Handlers;
-}
-
-/* Convenience macros for creating a Handler object that is wrapped with a
- * type-safe wrapper function that converts the "void*" parameters/returns
- * of the underlying C API into nice C++ function.
- *
- * Sample usage:
- * void OnValue1(MyClosure* c, const MyHandlerData* d, int32_t val) {
- * // do stuff ...
- * }
- *
- * // Handler that doesn't need any data bound to it.
- * void OnValue2(MyClosure* c, int32_t val) {
- * // do stuff ...
- * }
- *
- * // Handler that returns bool so it can return failure if necessary.
- * bool OnValue3(MyClosure* c, int32_t val) {
- * // do stuff ...
- * return ok;
- * }
- *
- * // Member function handler.
- * class MyClosure {
- * public:
- * void OnValue(int32_t val) {
- * // do stuff ...
- * }
- * };
- *
- * // Takes ownership of the MyHandlerData.
- * handlers->SetInt32Handler(f1, UpbBind(OnValue1, new MyHandlerData(...)));
- * handlers->SetInt32Handler(f2, UpbMakeHandler(OnValue2));
- * handlers->SetInt32Handler(f1, UpbMakeHandler(OnValue3));
- * handlers->SetInt32Handler(f2, UpbMakeHandler(&MyClosure::OnValue));
- */
-
-/* In C++11, the "template" disambiguator can appear even outside templates,
- * so all calls can safely use this pair of macros. */
-
-#define UpbMakeHandler(f) upb::MatchFunc(f).template GetFunc<f>()
-
-/* We have to be careful to only evaluate "d" once. */
-#define UpbBind(f, d) upb::MatchFunc(f).template GetFunc<f>((d))
-
-/* Handler: a struct that contains the (handler, data, deleter) tuple that is
- * used to register all handlers. Users can Make() these directly but it's
- * more convenient to use the UpbMakeHandler/UpbBind macros above. */
-template <class T> class upb::Handler {
- public:
- /* The underlying, handler function signature that upb uses internally. */
- typedef T FuncPtr;
-
- /* Intentionally implicit. */
- template <class F> Handler(F func);
- ~Handler() { UPB_ASSERT(registered_); }
-
- void AddCleanup(upb_handlers* h) const;
- FuncPtr handler() const { return handler_; }
- const upb_handlerattr& attr() const { return attr_; }
-
- private:
- Handler(const Handler&) = delete;
- Handler& operator=(const Handler&) = delete;
-
- FuncPtr handler_;
- mutable upb_handlerattr attr_;
- mutable bool registered_;
- void *cleanup_data_;
- upb_handlerfree *cleanup_func_;
-};
-
-/* A upb::Handlers object represents the set of handlers associated with a
- * message in the graph of messages. You can think of it as a big virtual
- * table with functions corresponding to all the events that can fire while
- * parsing or visiting a message of a specific type.
- *
- * Any handlers that are not set behave as if they had successfully consumed
- * the value. Any unset Start* handlers will propagate their closure to the
- * inner frame.
- *
- * The easiest way to create the *Handler objects needed by the Set* methods is
- * with the UpbBind() and UpbMakeHandler() macros; see below. */
-class upb::HandlersPtr {
- public:
- HandlersPtr(upb_handlers* ptr) : ptr_(ptr) {}
-
- upb_handlers* ptr() const { return ptr_; }
-
- typedef upb_selector_t Selector;
- typedef upb_handlertype_t Type;
-
- typedef Handler<void *(*)(void *, const void *)> StartFieldHandler;
- typedef Handler<bool (*)(void *, const void *)> EndFieldHandler;
- typedef Handler<bool (*)(void *, const void *)> StartMessageHandler;
- typedef Handler<bool (*)(void *, const void *, upb_status *)>
- EndMessageHandler;
- typedef Handler<void *(*)(void *, const void *, size_t)> StartStringHandler;
- typedef Handler<size_t (*)(void *, const void *, const char *, size_t,
- const upb_bufhandle *)>
- StringHandler;
-
- template <class T> struct ValueHandler {
- typedef Handler<bool(*)(void *, const void *, T)> H;
- };
-
- typedef ValueHandler<int32_t>::H Int32Handler;
- typedef ValueHandler<int64_t>::H Int64Handler;
- typedef ValueHandler<uint32_t>::H UInt32Handler;
- typedef ValueHandler<uint64_t>::H UInt64Handler;
- typedef ValueHandler<float>::H FloatHandler;
- typedef ValueHandler<double>::H DoubleHandler;
- typedef ValueHandler<bool>::H BoolHandler;
-
- /* Any function pointer can be converted to this and converted back to its
- * correct type. */
- typedef void GenericFunction();
-
- typedef void HandlersCallback(const void *closure, upb_handlers *h);
-
- /* Returns the msgdef associated with this handlers object. */
- MessageDefPtr message_def() const {
- return MessageDefPtr(upb_handlers_msgdef(ptr()));
- }
-
- /* Adds the given pointer and function to the list of cleanup functions that
- * will be run when these handlers are freed. If this pointer has previously
- * been registered, the function returns false and does nothing. */
- bool AddCleanup(void *ptr, upb_handlerfree *cleanup) {
- return upb_handlers_addcleanup(ptr_, ptr, cleanup);
- }
-
- /* Sets the startmsg handler for the message, which is defined as follows:
- *
- * bool startmsg(MyType* closure) {
- * // Called when the message begins. Returns true if processing should
- * // continue.
- * return true;
- * }
- */
- bool SetStartMessageHandler(const StartMessageHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setstartmsg(ptr(), h.handler(), &h.attr());
- }
-
- /* Sets the endmsg handler for the message, which is defined as follows:
- *
- * bool endmsg(MyType* closure, upb_status *status) {
- * // Called when processing of this message ends, whether in success or
- * // failure. "status" indicates the final status of processing, and
- * // can also be modified in-place to update the final status.
- * }
- */
- bool SetEndMessageHandler(const EndMessageHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setendmsg(ptr(), h.handler(), &h.attr());
- }
-
- /* Sets the value handler for the given field, which is defined as follows
- * (this is for an int32 field; other field types will pass their native
- * C/C++ type for "val"):
- *
- * bool OnValue(MyClosure* c, const MyHandlerData* d, int32_t val) {
- * // Called when the field's value is encountered. "d" contains
- * // whatever data was bound to this field when it was registered.
- * // Returns true if processing should continue.
- * return true;
- * }
- *
- * handers->SetInt32Handler(f, UpbBind(OnValue, new MyHandlerData(...)));
- *
- * The value type must exactly match f->type().
- * For example, a handler that takes an int32_t parameter may only be used for
- * fields of type UPB_TYPE_INT32 and UPB_TYPE_ENUM.
- *
- * Returns false if the handler failed to register; in this case the cleanup
- * handler (if any) will be called immediately.
- */
- bool SetInt32Handler(FieldDefPtr f, const Int32Handler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setint32(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetInt64Handler (FieldDefPtr f, const Int64Handler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setint64(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetUInt32Handler(FieldDefPtr f, const UInt32Handler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setuint32(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetUInt64Handler(FieldDefPtr f, const UInt64Handler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setuint64(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetFloatHandler (FieldDefPtr f, const FloatHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setfloat(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetDoubleHandler(FieldDefPtr f, const DoubleHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setdouble(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetBoolHandler(FieldDefPtr f, const BoolHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setbool(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- /* Like the previous, but templated on the type on the value (ie. int32).
- * This is mostly useful to call from other templates. To call this you must
- * specify the template parameter explicitly, ie:
- * h->SetValueHandler<T>(f, UpbBind(MyHandler<T>, MyData)); */
- template <class T>
- bool SetValueHandler(
- FieldDefPtr f,
- const typename ValueHandler<typename CanonicalType<T>::Type>::H &handler);
-
- /* Sets handlers for a string field, which are defined as follows:
- *
- * MySubClosure* startstr(MyClosure* c, const MyHandlerData* d,
- * size_t size_hint) {
- * // Called when a string value begins. The return value indicates the
- * // closure for the string. "size_hint" indicates the size of the
- * // string if it is known, however if the string is length-delimited
- * // and the end-of-string is not available size_hint will be zero.
- * // This case is indistinguishable from the case where the size is
- * // known to be zero.
- * //
- * // TODO(haberman): is it important to distinguish these cases?
- * // If we had ssize_t as a type we could make -1 "unknown", but
- * // ssize_t is POSIX (not ANSI) and therefore less portable.
- * // In practice I suspect it won't be important to distinguish.
- * return closure;
- * }
- *
- * size_t str(MyClosure* closure, const MyHandlerData* d,
- * const char *str, size_t len) {
- * // Called for each buffer of string data; the multiple physical buffers
- * // are all part of the same logical string. The return value indicates
- * // how many bytes were consumed. If this number is less than "len",
- * // this will also indicate that processing should be halted for now,
- * // like returning false or UPB_BREAK from any other callback. If
- * // number is greater than "len", the excess bytes will be skipped over
- * // and not passed to the callback.
- * return len;
- * }
- *
- * bool endstr(MyClosure* c, const MyHandlerData* d) {
- * // Called when a string value ends. Return value indicates whether
- * // processing should continue.
- * return true;
- * }
- */
- bool SetStartStringHandler(FieldDefPtr f, const StartStringHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setstartstr(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetStringHandler(FieldDefPtr f, const StringHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setstring(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- bool SetEndStringHandler(FieldDefPtr f, const EndFieldHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setendstr(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- /* Sets the startseq handler, which is defined as follows:
- *
- * MySubClosure *startseq(MyClosure* c, const MyHandlerData* d) {
- * // Called when a sequence (repeated field) begins. The returned
- * // pointer indicates the closure for the sequence (or UPB_BREAK
- * // to interrupt processing).
- * return closure;
- * }
- *
- * h->SetStartSequenceHandler(f, UpbBind(startseq, new MyHandlerData(...)));
- *
- * Returns "false" if "f" does not belong to this message or is not a
- * repeated field.
- */
- bool SetStartSequenceHandler(FieldDefPtr f, const StartFieldHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setstartseq(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- /* Sets the startsubmsg handler for the given field, which is defined as
- * follows:
- *
- * MySubClosure* startsubmsg(MyClosure* c, const MyHandlerData* d) {
- * // Called when a submessage begins. The returned pointer indicates the
- * // closure for the sequence (or UPB_BREAK to interrupt processing).
- * return closure;
- * }
- *
- * h->SetStartSubMessageHandler(f, UpbBind(startsubmsg,
- * new MyHandlerData(...)));
- *
- * Returns "false" if "f" does not belong to this message or is not a
- * submessage/group field.
- */
- bool SetStartSubMessageHandler(FieldDefPtr f, const StartFieldHandler& h) {
- h.AddCleanup(ptr());
- return upb_handlers_setstartsubmsg(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- /* Sets the endsubmsg handler for the given field, which is defined as
- * follows:
- *
- * bool endsubmsg(MyClosure* c, const MyHandlerData* d) {
- * // Called when a submessage ends. Returns true to continue processing.
- * return true;
- * }
- *
- * Returns "false" if "f" does not belong to this message or is not a
- * submessage/group field.
- */
- bool SetEndSubMessageHandler(FieldDefPtr f, const EndFieldHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setendsubmsg(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- /* Starts the endsubseq handler for the given field, which is defined as
- * follows:
- *
- * bool endseq(MyClosure* c, const MyHandlerData* d) {
- * // Called when a sequence ends. Returns true continue processing.
- * return true;
- * }
- *
- * Returns "false" if "f" does not belong to this message or is not a
- * repeated field.
- */
- bool SetEndSequenceHandler(FieldDefPtr f, const EndFieldHandler &h) {
- h.AddCleanup(ptr());
- return upb_handlers_setendseq(ptr(), f.ptr(), h.handler(), &h.attr());
- }
-
- private:
- upb_handlers* ptr_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_handlercache ***********************************************************/
-
-/* A upb_handlercache lazily builds and caches upb_handlers. You pass it a
- * function (with optional closure) that can build handlers for a given
- * message on-demand, and the cache maintains a map of msgdef->handlers. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct upb_handlercache;
-typedef struct upb_handlercache upb_handlercache;
-
-typedef void upb_handlers_callback(const void *closure, upb_handlers *h);
-
-upb_handlercache *upb_handlercache_new(upb_handlers_callback *callback,
- const void *closure);
-void upb_handlercache_free(upb_handlercache *cache);
-const upb_handlers *upb_handlercache_get(upb_handlercache *cache,
- const upb_msgdef *md);
-bool upb_handlercache_addcleanup(upb_handlercache *h, void *p,
- upb_handlerfree *hfree);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-class upb::HandlerCache {
- public:
- HandlerCache(upb_handlers_callback *callback, const void *closure)
- : ptr_(upb_handlercache_new(callback, closure), upb_handlercache_free) {}
- HandlerCache(HandlerCache&&) = default;
- HandlerCache& operator=(HandlerCache&&) = default;
- HandlerCache(upb_handlercache* c) : ptr_(c, upb_handlercache_free) {}
-
- upb_handlercache* ptr() { return ptr_.get(); }
-
- const upb_handlers *Get(MessageDefPtr md) {
- return upb_handlercache_get(ptr_.get(), md.ptr());
- }
-
- private:
- std::unique_ptr<upb_handlercache, decltype(&upb_handlercache_free)> ptr_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_byteshandler ***********************************************************/
-
-typedef struct {
- upb_func *func;
-
- /* It is wasteful to include the entire attributes here:
- *
- * * Some of the information is redundant (like storing the closure type
- * separately for each handler that must match).
- * * Some of the info is only needed prior to freeze() (like closure types).
- * * alignment padding wastes a lot of space for alwaysok_.
- *
- * If/when the size and locality of handlers is an issue, we can optimize this
- * not to store the entire attr like this. We do not expose the table's
- * layout to allow this optimization in the future. */
- upb_handlerattr attr;
-} upb_handlers_tabent;
-
-#define UPB_TABENT_INIT {NULL, UPB_HANDLERATTR_INIT}
-
-typedef struct {
- upb_handlers_tabent table[3];
-} upb_byteshandler;
-
-#define UPB_BYTESHANDLER_INIT \
- { \
- { UPB_TABENT_INIT, UPB_TABENT_INIT, UPB_TABENT_INIT } \
- }
-
-UPB_INLINE void upb_byteshandler_init(upb_byteshandler *handler) {
- upb_byteshandler init = UPB_BYTESHANDLER_INIT;
- *handler = init;
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Caller must ensure that "d" outlives the handlers. */
-bool upb_byteshandler_setstartstr(upb_byteshandler *h,
- upb_startstr_handlerfunc *func, void *d);
-bool upb_byteshandler_setstring(upb_byteshandler *h,
- upb_string_handlerfunc *func, void *d);
-bool upb_byteshandler_setendstr(upb_byteshandler *h,
- upb_endfield_handlerfunc *func, void *d);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-namespace upb {
-typedef upb_byteshandler BytesHandler;
-}
-#endif
-
-/** Message handlers ******************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* These are the handlers used internally by upb_msgfactory_getmergehandlers().
- * They write scalar data to a known offset from the message pointer.
- *
- * These would be trivial for anyone to implement themselves, but it's better
- * to use these because some JITs will recognize and specialize these instead
- * of actually calling the function. */
-
-/* Sets a handler for the given primitive field that will write the data at the
- * given offset. If hasbit > 0, also sets a hasbit at the given bit offset
- * (addressing each byte low to high). */
-bool upb_msg_setscalarhandler(upb_handlers *h,
- const upb_fielddef *f,
- size_t offset,
- int32_t hasbit);
-
-/* If the given handler is a msghandlers_primitive field, returns true and sets
- * *type, *offset and *hasbit. Otherwise returns false. */
-bool upb_msg_getscalarhandlerdata(const upb_handlers *h,
- upb_selector_t s,
- upb_fieldtype_t *type,
- size_t *offset,
- int32_t *hasbit);
-
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#include "upb/handlers-inl.h"
-
-#endif /* UPB_HANDLERS_H */
diff --git a/grpc/third_party/upb/upb/json/parser.h b/grpc/third_party/upb/upb/json/parser.h
deleted file mode 100644
index d323c52e..00000000
--- a/grpc/third_party/upb/upb/json/parser.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-** upb::json::Parser (upb_json_parser)
-**
-** Parses JSON according to a specific schema.
-** Support for parsing arbitrary JSON (schema-less) will be added later.
-*/
-
-#ifndef UPB_JSON_PARSER_H_
-#define UPB_JSON_PARSER_H_
-
-#include "upb/sink.h"
-
-#ifdef __cplusplus
-namespace upb {
-namespace json {
-class CodeCache;
-class ParserPtr;
-class ParserMethodPtr;
-} /* namespace json */
-} /* namespace upb */
-#endif
-
-/* upb_json_parsermethod ******************************************************/
-
-struct upb_json_parsermethod;
-typedef struct upb_json_parsermethod upb_json_parsermethod;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const upb_byteshandler* upb_json_parsermethod_inputhandler(
- const upb_json_parsermethod* m);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-class upb::json::ParserMethodPtr {
- public:
- ParserMethodPtr() : ptr_(nullptr) {}
- ParserMethodPtr(const upb_json_parsermethod* ptr) : ptr_(ptr) {}
-
- const upb_json_parsermethod* ptr() const { return ptr_; }
-
- const BytesHandler* input_handler() const {
- return upb_json_parsermethod_inputhandler(ptr());
- }
-
- private:
- const upb_json_parsermethod* ptr_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_json_parser ************************************************************/
-
-/* Preallocation hint: parser won't allocate more bytes than this when first
- * constructed. This hint may be an overestimate for some build configurations.
- * But if the parser library is upgraded without recompiling the application,
- * it may be an underestimate. */
-#define UPB_JSON_PARSER_SIZE 5712
-
-struct upb_json_parser;
-typedef struct upb_json_parser upb_json_parser;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-upb_json_parser* upb_json_parser_create(upb_arena* a,
- const upb_json_parsermethod* m,
- const upb_symtab* symtab,
- upb_sink output,
- upb_status *status,
- bool ignore_json_unknown);
-upb_bytessink upb_json_parser_input(upb_json_parser* p);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* Parses an incoming BytesStream, pushing the results to the destination
- * sink. */
-class upb::json::ParserPtr {
- public:
- ParserPtr(upb_json_parser* ptr) : ptr_(ptr) {}
-
- static ParserPtr Create(Arena* arena, ParserMethodPtr method,
- SymbolTable* symtab, Sink output, Status* status,
- bool ignore_json_unknown) {
- upb_symtab* symtab_ptr = symtab ? symtab->ptr() : nullptr;
- return ParserPtr(upb_json_parser_create(
- arena->ptr(), method.ptr(), symtab_ptr, output.sink(), status->ptr(),
- ignore_json_unknown));
- }
-
- BytesSink input() { return upb_json_parser_input(ptr_); }
-
- private:
- upb_json_parser* ptr_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_json_codecache *********************************************************/
-
-/* Lazily builds and caches decoder methods that will push data to the given
- * handlers. The upb_symtab object(s) must outlive this object. */
-
-struct upb_json_codecache;
-typedef struct upb_json_codecache upb_json_codecache;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-upb_json_codecache *upb_json_codecache_new(void);
-void upb_json_codecache_free(upb_json_codecache *cache);
-const upb_json_parsermethod* upb_json_codecache_get(upb_json_codecache* cache,
- const upb_msgdef* md);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-class upb::json::CodeCache {
- public:
- CodeCache() : ptr_(upb_json_codecache_new(), upb_json_codecache_free) {}
-
- /* Returns a DecoderMethod that can push data to the given handlers.
- * If a suitable method already exists, it will be returned from the cache. */
- ParserMethodPtr Get(MessageDefPtr md) {
- return upb_json_codecache_get(ptr_.get(), md.ptr());
- }
-
- private:
- std::unique_ptr<upb_json_codecache, decltype(&upb_json_codecache_free)> ptr_;
-};
-
-#endif
-
-#endif /* UPB_JSON_PARSER_H_ */
diff --git a/grpc/third_party/upb/upb/json/parser.rl b/grpc/third_party/upb/upb/json/parser.rl
deleted file mode 100644
index a7d75ff1..00000000
--- a/grpc/third_party/upb/upb/json/parser.rl
+++ /dev/null
@@ -1,2996 +0,0 @@
-/*
-** upb::json::Parser (upb_json_parser)
-**
-** A parser that uses the Ragel State Machine Compiler to generate
-** the finite automata.
-**
-** Ragel only natively handles regular languages, but we can manually
-** program it a bit to handle context-free languages like JSON, by using
-** the "fcall" and "fret" constructs.
-**
-** This parser can handle the basics, but needs several things to be fleshed
-** out:
-**
-** - handling of unicode escape sequences (including high surrogate pairs).
-** - properly check and report errors for unknown fields, stack overflow,
-** improper array nesting (or lack of nesting).
-** - handling of base64 sequences with padding characters.
-** - handling of push-back (non-success returns from sink functions).
-** - handling of keys/escape-sequences/etc that span input buffers.
-*/
-
-#include <ctype.h>
-#include <errno.h>
-#include <float.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <time.h>
-
-#include "upb/json/parser.h"
-#include "upb/pb/encoder.h"
-
-#include "upb/port_def.inc"
-
-#define UPB_JSON_MAX_DEPTH 64
-
-/* Type of value message */
-enum {
- VALUE_NULLVALUE = 0,
- VALUE_NUMBERVALUE = 1,
- VALUE_STRINGVALUE = 2,
- VALUE_BOOLVALUE = 3,
- VALUE_STRUCTVALUE = 4,
- VALUE_LISTVALUE = 5
-};
-
-/* Forward declare */
-static bool is_top_level(upb_json_parser *p);
-static bool is_wellknown_msg(upb_json_parser *p, upb_wellknowntype_t type);
-static bool is_wellknown_field(upb_json_parser *p, upb_wellknowntype_t type);
-
-static bool is_number_wrapper_object(upb_json_parser *p);
-static bool does_number_wrapper_start(upb_json_parser *p);
-static bool does_number_wrapper_end(upb_json_parser *p);
-
-static bool is_string_wrapper_object(upb_json_parser *p);
-static bool does_string_wrapper_start(upb_json_parser *p);
-static bool does_string_wrapper_end(upb_json_parser *p);
-
-static bool does_fieldmask_start(upb_json_parser *p);
-static bool does_fieldmask_end(upb_json_parser *p);
-static void start_fieldmask_object(upb_json_parser *p);
-static void end_fieldmask_object(upb_json_parser *p);
-
-static void start_wrapper_object(upb_json_parser *p);
-static void end_wrapper_object(upb_json_parser *p);
-
-static void start_value_object(upb_json_parser *p, int value_type);
-static void end_value_object(upb_json_parser *p);
-
-static void start_listvalue_object(upb_json_parser *p);
-static void end_listvalue_object(upb_json_parser *p);
-
-static void start_structvalue_object(upb_json_parser *p);
-static void end_structvalue_object(upb_json_parser *p);
-
-static void start_object(upb_json_parser *p);
-static void end_object(upb_json_parser *p);
-
-static void start_any_object(upb_json_parser *p, const char *ptr);
-static bool end_any_object(upb_json_parser *p, const char *ptr);
-
-static bool start_subobject(upb_json_parser *p);
-static void end_subobject(upb_json_parser *p);
-
-static void start_member(upb_json_parser *p);
-static void end_member(upb_json_parser *p);
-static bool end_membername(upb_json_parser *p);
-
-static void start_any_member(upb_json_parser *p, const char *ptr);
-static void end_any_member(upb_json_parser *p, const char *ptr);
-static bool end_any_membername(upb_json_parser *p);
-
-size_t parse(void *closure, const void *hd, const char *buf, size_t size,
- const upb_bufhandle *handle);
-static bool end(void *closure, const void *hd);
-
-static const char eof_ch = 'e';
-
-/* stringsink */
-typedef struct {
- upb_byteshandler handler;
- upb_bytessink sink;
- char *ptr;
- size_t len, size;
-} upb_stringsink;
-
-
-static void *stringsink_start(void *_sink, const void *hd, size_t size_hint) {
- upb_stringsink *sink = _sink;
- sink->len = 0;
- UPB_UNUSED(hd);
- UPB_UNUSED(size_hint);
- return sink;
-}
-
-static size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
- size_t len, const upb_bufhandle *handle) {
- upb_stringsink *sink = _sink;
- size_t new_size = sink->size;
-
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
-
- while (sink->len + len > new_size) {
- new_size *= 2;
- }
-
- if (new_size != sink->size) {
- sink->ptr = realloc(sink->ptr, new_size);
- sink->size = new_size;
- }
-
- memcpy(sink->ptr + sink->len, ptr, len);
- sink->len += len;
-
- return len;
-}
-
-void upb_stringsink_init(upb_stringsink *sink) {
- upb_byteshandler_init(&sink->handler);
- upb_byteshandler_setstartstr(&sink->handler, stringsink_start, NULL);
- upb_byteshandler_setstring(&sink->handler, stringsink_string, NULL);
-
- upb_bytessink_reset(&sink->sink, &sink->handler, sink);
-
- sink->size = 32;
- sink->ptr = malloc(sink->size);
- sink->len = 0;
-}
-
-void upb_stringsink_uninit(upb_stringsink *sink) { free(sink->ptr); }
-
-typedef struct {
- /* For encoding Any value field in binary format. */
- upb_handlercache *encoder_handlercache;
- upb_stringsink stringsink;
-
- /* For decoding Any value field in json format. */
- upb_json_codecache *parser_codecache;
- upb_sink sink;
- upb_json_parser *parser;
-
- /* Mark the range of uninterpreted values in json input before type url. */
- const char *before_type_url_start;
- const char *before_type_url_end;
-
- /* Mark the range of uninterpreted values in json input after type url. */
- const char *after_type_url_start;
-} upb_jsonparser_any_frame;
-
-typedef struct {
- upb_sink sink;
-
- /* The current message in which we're parsing, and the field whose value we're
- * expecting next. */
- const upb_msgdef *m;
- const upb_fielddef *f;
-
- /* The table mapping json name to fielddef for this message. */
- const upb_strtable *name_table;
-
- /* We are in a repeated-field context. We need this flag to decide whether to
- * handle the array as a normal repeated field or a
- * google.protobuf.ListValue/google.protobuf.Value. */
- bool is_repeated;
-
- /* We are in a repeated-field context, ready to emit mapentries as
- * submessages. This flag alters the start-of-object (open-brace) behavior to
- * begin a sequence of mapentry messages rather than a single submessage. */
- bool is_map;
-
- /* We are in a map-entry message context. This flag is set when parsing the
- * value field of a single map entry and indicates to all value-field parsers
- * (subobjects, strings, numbers, and bools) that the map-entry submessage
- * should end as soon as the value is parsed. */
- bool is_mapentry;
-
- /* If |is_map| or |is_mapentry| is true, |mapfield| refers to the parent
- * message's map field that we're currently parsing. This differs from |f|
- * because |f| is the field in the *current* message (i.e., the map-entry
- * message itself), not the parent's field that leads to this map. */
- const upb_fielddef *mapfield;
-
- /* We are in an Any message context. This flag is set when parsing the Any
- * message and indicates to all field parsers (subobjects, strings, numbers,
- * and bools) that the parsed field should be serialized as binary data or
- * cached (type url not found yet). */
- bool is_any;
-
- /* The type of packed message in Any. */
- upb_jsonparser_any_frame *any_frame;
-
- /* True if the field to be parsed is unknown. */
- bool is_unknown_field;
-} upb_jsonparser_frame;
-
-static void init_frame(upb_jsonparser_frame* frame) {
- frame->m = NULL;
- frame->f = NULL;
- frame->name_table = NULL;
- frame->is_repeated = false;
- frame->is_map = false;
- frame->is_mapentry = false;
- frame->mapfield = NULL;
- frame->is_any = false;
- frame->any_frame = NULL;
- frame->is_unknown_field = false;
-}
-
-struct upb_json_parser {
- upb_arena *arena;
- const upb_json_parsermethod *method;
- upb_bytessink input_;
-
- /* Stack to track the JSON scopes we are in. */
- upb_jsonparser_frame stack[UPB_JSON_MAX_DEPTH];
- upb_jsonparser_frame *top;
- upb_jsonparser_frame *limit;
-
- upb_status *status;
-
- /* Ragel's internal parsing stack for the parsing state machine. */
- int current_state;
- int parser_stack[UPB_JSON_MAX_DEPTH];
- int parser_top;
-
- /* The handle for the current buffer. */
- const upb_bufhandle *handle;
-
- /* Accumulate buffer. See details in parser.rl. */
- const char *accumulated;
- size_t accumulated_len;
- char *accumulate_buf;
- size_t accumulate_buf_size;
-
- /* Multi-part text data. See details in parser.rl. */
- int multipart_state;
- upb_selector_t string_selector;
-
- /* Input capture. See details in parser.rl. */
- const char *capture;
-
- /* Intermediate result of parsing a unicode escape sequence. */
- uint32_t digit;
-
- /* For resolve type url in Any. */
- const upb_symtab *symtab;
-
- /* Whether to proceed if unknown field is met. */
- bool ignore_json_unknown;
-
- /* Cache for parsing timestamp due to base and zone are handled in different
- * handlers. */
- struct tm tm;
-};
-
-static upb_jsonparser_frame* start_jsonparser_frame(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- inner = p->top + 1;
- init_frame(inner);
- return inner;
-}
-
-struct upb_json_codecache {
- upb_arena *arena;
- upb_inttable methods; /* upb_msgdef* -> upb_json_parsermethod* */
-};
-
-struct upb_json_parsermethod {
- const upb_json_codecache *cache;
- upb_byteshandler input_handler_;
-
- /* Maps json_name -> fielddef */
- upb_strtable name_table;
-};
-
-#define PARSER_CHECK_RETURN(x) if (!(x)) return false
-
-static upb_jsonparser_any_frame *json_parser_any_frame_new(
- upb_json_parser *p) {
- upb_jsonparser_any_frame *frame;
-
- frame = upb_arena_malloc(p->arena, sizeof(upb_jsonparser_any_frame));
-
- frame->encoder_handlercache = upb_pb_encoder_newcache();
- frame->parser_codecache = upb_json_codecache_new();
- frame->parser = NULL;
- frame->before_type_url_start = NULL;
- frame->before_type_url_end = NULL;
- frame->after_type_url_start = NULL;
-
- upb_stringsink_init(&frame->stringsink);
-
- return frame;
-}
-
-static void json_parser_any_frame_set_payload_type(
- upb_json_parser *p,
- upb_jsonparser_any_frame *frame,
- const upb_msgdef *payload_type) {
- const upb_handlers *h;
- const upb_json_parsermethod *parser_method;
- upb_pb_encoder *encoder;
-
- /* Initialize encoder. */
- h = upb_handlercache_get(frame->encoder_handlercache, payload_type);
- encoder = upb_pb_encoder_create(p->arena, h, frame->stringsink.sink);
-
- /* Initialize parser. */
- parser_method = upb_json_codecache_get(frame->parser_codecache, payload_type);
- upb_sink_reset(&frame->sink, h, encoder);
- frame->parser =
- upb_json_parser_create(p->arena, parser_method, p->symtab, frame->sink,
- p->status, p->ignore_json_unknown);
-}
-
-static void json_parser_any_frame_free(upb_jsonparser_any_frame *frame) {
- upb_handlercache_free(frame->encoder_handlercache);
- upb_json_codecache_free(frame->parser_codecache);
- upb_stringsink_uninit(&frame->stringsink);
-}
-
-static bool json_parser_any_frame_has_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->parser != NULL;
-}
-
-static bool json_parser_any_frame_has_value_before_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->before_type_url_start != frame->before_type_url_end;
-}
-
-static bool json_parser_any_frame_has_value_after_type_url(
- upb_jsonparser_any_frame *frame) {
- return frame->after_type_url_start != NULL;
-}
-
-static bool json_parser_any_frame_has_value(
- upb_jsonparser_any_frame *frame) {
- return json_parser_any_frame_has_value_before_type_url(frame) ||
- json_parser_any_frame_has_value_after_type_url(frame);
-}
-
-static void json_parser_any_frame_set_before_type_url_end(
- upb_jsonparser_any_frame *frame,
- const char *ptr) {
- if (frame->parser == NULL) {
- frame->before_type_url_end = ptr;
- }
-}
-
-static void json_parser_any_frame_set_after_type_url_start_once(
- upb_jsonparser_any_frame *frame,
- const char *ptr) {
- if (json_parser_any_frame_has_type_url(frame) &&
- frame->after_type_url_start == NULL) {
- frame->after_type_url_start = ptr;
- }
-}
-
-/* Used to signal that a capture has been suspended. */
-static char suspend_capture;
-
-static upb_selector_t getsel_for_handlertype(upb_json_parser *p,
- upb_handlertype_t type) {
- upb_selector_t sel;
- bool ok = upb_handlers_getselector(p->top->f, type, &sel);
- UPB_ASSUME(ok);
- return sel;
-}
-
-static upb_selector_t parser_getsel(upb_json_parser *p) {
- return getsel_for_handlertype(
- p, upb_handlers_getprimitivehandlertype(p->top->f));
-}
-
-static bool check_stack(upb_json_parser *p) {
- if ((p->top + 1) == p->limit) {
- upb_status_seterrmsg(p->status, "Nesting too deep");
- return false;
- }
-
- return true;
-}
-
-static void set_name_table(upb_json_parser *p, upb_jsonparser_frame *frame) {
- upb_value v;
- const upb_json_codecache *cache = p->method->cache;
- bool ok;
- const upb_json_parsermethod *method;
-
- ok = upb_inttable_lookupptr(&cache->methods, frame->m, &v);
- UPB_ASSUME(ok);
- method = upb_value_getconstptr(v);
-
- frame->name_table = &method->name_table;
-}
-
-/* There are GCC/Clang built-ins for overflow checking which we could start
- * using if there was any performance benefit to it. */
-
-static bool checked_add(size_t a, size_t b, size_t *c) {
- if (SIZE_MAX - a < b) return false;
- *c = a + b;
- return true;
-}
-
-static size_t saturating_multiply(size_t a, size_t b) {
- /* size_t is unsigned, so this is defined behavior even on overflow. */
- size_t ret = a * b;
- if (b != 0 && ret / b != a) {
- ret = SIZE_MAX;
- }
- return ret;
-}
-
-
-/* Base64 decoding ************************************************************/
-
-/* TODO(haberman): make this streaming. */
-
-static const signed char b64table[] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 62/*+*/, -1, -1, -1, 63/*/ */,
- 52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
- 60/*8*/, 61/*9*/, -1, -1, -1, -1, -1, -1,
- -1, 0/*A*/, 1/*B*/, 2/*C*/, 3/*D*/, 4/*E*/, 5/*F*/, 6/*G*/,
- 07/*H*/, 8/*I*/, 9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
- 15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
- 23/*X*/, 24/*Y*/, 25/*Z*/, -1, -1, -1, -1, -1,
- -1, 26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
- 33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
- 41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
- 49/*x*/, 50/*y*/, 51/*z*/, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1
-};
-
-/* Returns the table value sign-extended to 32 bits. Knowing that the upper
- * bits will be 1 for unrecognized characters makes it easier to check for
- * this error condition later (see below). */
-int32_t b64lookup(unsigned char ch) { return b64table[ch]; }
-
-/* Returns true if the given character is not a valid base64 character or
- * padding. */
-bool nonbase64(unsigned char ch) { return b64lookup(ch) == -1 && ch != '='; }
-
-static bool base64_push(upb_json_parser *p, upb_selector_t sel, const char *ptr,
- size_t len) {
- const char *limit = ptr + len;
- for (; ptr < limit; ptr += 4) {
- uint32_t val;
- char output[3];
-
- if (limit - ptr < 4) {
- upb_status_seterrf(p->status,
- "Base64 input for bytes field not a multiple of 4: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12 |
- b64lookup(ptr[2]) << 6 |
- b64lookup(ptr[3]);
-
- /* Test the upper bit; returns true if any of the characters returned -1. */
- if (val & 0x80000000) {
- goto otherchar;
- }
-
- output[0] = val >> 16;
- output[1] = (val >> 8) & 0xff;
- output[2] = val & 0xff;
- upb_sink_putstring(p->top->sink, sel, output, 3, NULL);
- }
- return true;
-
-otherchar:
- if (nonbase64(ptr[0]) || nonbase64(ptr[1]) || nonbase64(ptr[2]) ||
- nonbase64(ptr[3]) ) {
- upb_status_seterrf(p->status,
- "Non-base64 characters in bytes field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- } if (ptr[2] == '=') {
- uint32_t val;
- char output;
-
- /* Last group contains only two input bytes, one output byte. */
- if (ptr[0] == '=' || ptr[1] == '=' || ptr[3] != '=') {
- goto badpadding;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12;
-
- UPB_ASSERT(!(val & 0x80000000));
- output = val >> 16;
- upb_sink_putstring(p->top->sink, sel, &output, 1, NULL);
- return true;
- } else {
- uint32_t val;
- char output[2];
-
- /* Last group contains only three input bytes, two output bytes. */
- if (ptr[0] == '=' || ptr[1] == '=' || ptr[2] == '=') {
- goto badpadding;
- }
-
- val = b64lookup(ptr[0]) << 18 |
- b64lookup(ptr[1]) << 12 |
- b64lookup(ptr[2]) << 6;
-
- output[0] = val >> 16;
- output[1] = (val >> 8) & 0xff;
- upb_sink_putstring(p->top->sink, sel, output, 2, NULL);
- return true;
- }
-
-badpadding:
- upb_status_seterrf(p->status,
- "Incorrect base64 padding for field: %s (%.*s)",
- upb_fielddef_name(p->top->f),
- 4, ptr);
- return false;
-}
-
-
-/* Accumulate buffer **********************************************************/
-
-/* Functionality for accumulating a buffer.
- *
- * Some parts of the parser need an entire value as a contiguous string. For
- * example, to look up a member name in a hash table, or to turn a string into
- * a number, the relevant library routines need the input string to be in
- * contiguous memory, even if the value spanned two or more buffers in the
- * input. These routines handle that.
- *
- * In the common case we can just point to the input buffer to get this
- * contiguous string and avoid any actual copy. So we optimistically begin
- * this way. But there are a few cases where we must instead copy into a
- * separate buffer:
- *
- * 1. The string was not contiguous in the input (it spanned buffers).
- *
- * 2. The string included escape sequences that need to be interpreted to get
- * the true value in a contiguous buffer. */
-
-static void assert_accumulate_empty(upb_json_parser *p) {
- UPB_ASSERT(p->accumulated == NULL);
- UPB_ASSERT(p->accumulated_len == 0);
-}
-
-static void accumulate_clear(upb_json_parser *p) {
- p->accumulated = NULL;
- p->accumulated_len = 0;
-}
-
-/* Used internally by accumulate_append(). */
-static bool accumulate_realloc(upb_json_parser *p, size_t need) {
- void *mem;
- size_t old_size = p->accumulate_buf_size;
- size_t new_size = UPB_MAX(old_size, 128);
- while (new_size < need) {
- new_size = saturating_multiply(new_size, 2);
- }
-
- mem = upb_arena_realloc(p->arena, p->accumulate_buf, old_size, new_size);
- if (!mem) {
- upb_status_seterrmsg(p->status, "Out of memory allocating buffer.");
- return false;
- }
-
- p->accumulate_buf = mem;
- p->accumulate_buf_size = new_size;
- return true;
-}
-
-/* Logically appends the given data to the append buffer.
- * If "can_alias" is true, we will try to avoid actually copying, but the buffer
- * must be valid until the next accumulate_append() call (if any). */
-static bool accumulate_append(upb_json_parser *p, const char *buf, size_t len,
- bool can_alias) {
- size_t need;
-
- if (!p->accumulated && can_alias) {
- p->accumulated = buf;
- p->accumulated_len = len;
- return true;
- }
-
- if (!checked_add(p->accumulated_len, len, &need)) {
- upb_status_seterrmsg(p->status, "Integer overflow.");
- return false;
- }
-
- if (need > p->accumulate_buf_size && !accumulate_realloc(p, need)) {
- return false;
- }
-
- if (p->accumulated != p->accumulate_buf) {
- if (p->accumulated_len) {
- memcpy(p->accumulate_buf, p->accumulated, p->accumulated_len);
- }
- p->accumulated = p->accumulate_buf;
- }
-
- memcpy(p->accumulate_buf + p->accumulated_len, buf, len);
- p->accumulated_len += len;
- return true;
-}
-
-/* Returns a pointer to the data accumulated since the last accumulate_clear()
- * call, and writes the length to *len. This with point either to the input
- * buffer or a temporary accumulate buffer. */
-static const char *accumulate_getptr(upb_json_parser *p, size_t *len) {
- UPB_ASSERT(p->accumulated);
- *len = p->accumulated_len;
- return p->accumulated;
-}
-
-
-/* Mult-part text data ********************************************************/
-
-/* When we have text data in the input, it can often come in multiple segments.
- * For example, there may be some raw string data followed by an escape
- * sequence. The two segments are processed with different logic. Also buffer
- * seams in the input can cause multiple segments.
- *
- * As we see segments, there are two main cases for how we want to process them:
- *
- * 1. we want to push the captured input directly to string handlers.
- *
- * 2. we need to accumulate all the parts into a contiguous buffer for further
- * processing (field name lookup, string->number conversion, etc). */
-
-/* This is the set of states for p->multipart_state. */
-enum {
- /* We are not currently processing multipart data. */
- MULTIPART_INACTIVE = 0,
-
- /* We are processing multipart data by accumulating it into a contiguous
- * buffer. */
- MULTIPART_ACCUMULATE = 1,
-
- /* We are processing multipart data by pushing each part directly to the
- * current string handlers. */
- MULTIPART_PUSHEAGERLY = 2
-};
-
-/* Start a multi-part text value where we accumulate the data for processing at
- * the end. */
-static void multipart_startaccum(upb_json_parser *p) {
- assert_accumulate_empty(p);
- UPB_ASSERT(p->multipart_state == MULTIPART_INACTIVE);
- p->multipart_state = MULTIPART_ACCUMULATE;
-}
-
-/* Start a multi-part text value where we immediately push text data to a string
- * value with the given selector. */
-static void multipart_start(upb_json_parser *p, upb_selector_t sel) {
- assert_accumulate_empty(p);
- UPB_ASSERT(p->multipart_state == MULTIPART_INACTIVE);
- p->multipart_state = MULTIPART_PUSHEAGERLY;
- p->string_selector = sel;
-}
-
-static bool multipart_text(upb_json_parser *p, const char *buf, size_t len,
- bool can_alias) {
- switch (p->multipart_state) {
- case MULTIPART_INACTIVE:
- upb_status_seterrmsg(
- p->status, "Internal error: unexpected state MULTIPART_INACTIVE");
- return false;
-
- case MULTIPART_ACCUMULATE:
- if (!accumulate_append(p, buf, len, can_alias)) {
- return false;
- }
- break;
-
- case MULTIPART_PUSHEAGERLY: {
- const upb_bufhandle *handle = can_alias ? p->handle : NULL;
- upb_sink_putstring(p->top->sink, p->string_selector, buf, len, handle);
- break;
- }
- }
-
- return true;
-}
-
-/* Note: this invalidates the accumulate buffer! Call only after reading its
- * contents. */
-static void multipart_end(upb_json_parser *p) {
- /* This is false sometimes. Probably a bug of some sort, but this code is
- * intended for deletion soon. */
- /* UPB_ASSERT(p->multipart_state != MULTIPART_INACTIVE); */
- p->multipart_state = MULTIPART_INACTIVE;
- accumulate_clear(p);
-}
-
-
-/* Input capture **************************************************************/
-
-/* Functionality for capturing a region of the input as text. Gracefully
- * handles the case where a buffer seam occurs in the middle of the captured
- * region. */
-
-static void capture_begin(upb_json_parser *p, const char *ptr) {
- UPB_ASSERT(p->multipart_state != MULTIPART_INACTIVE);
- UPB_ASSERT(p->capture == NULL);
- p->capture = ptr;
-}
-
-static bool capture_end(upb_json_parser *p, const char *ptr) {
- UPB_ASSERT(p->capture);
- if (multipart_text(p, p->capture, ptr - p->capture, true)) {
- p->capture = NULL;
- return true;
- } else {
- return false;
- }
-}
-
-/* This is called at the end of each input buffer (ie. when we have hit a
- * buffer seam). If we are in the middle of capturing the input, this
- * processes the unprocessed capture region. */
-static void capture_suspend(upb_json_parser *p, const char **ptr) {
- if (!p->capture) return;
-
- if (multipart_text(p, p->capture, *ptr - p->capture, false)) {
- /* We use this as a signal that we were in the middle of capturing, and
- * that capturing should resume at the beginning of the next buffer.
- *
- * We can't use *ptr here, because we have no guarantee that this pointer
- * will be valid when we resume (if the underlying memory is freed, then
- * using the pointer at all, even to compare to NULL, is likely undefined
- * behavior). */
- p->capture = &suspend_capture;
- } else {
- /* Need to back up the pointer to the beginning of the capture, since
- * we were not able to actually preserve it. */
- *ptr = p->capture;
- }
-}
-
-static void capture_resume(upb_json_parser *p, const char *ptr) {
- if (p->capture) {
- UPB_ASSERT(p->capture == &suspend_capture);
- p->capture = ptr;
- }
-}
-
-
-/* Callbacks from the parser **************************************************/
-
-/* These are the functions called directly from the parser itself.
- * We define these in the same order as their declarations in the parser. */
-
-static char escape_char(char in) {
- switch (in) {
- case 'r': return '\r';
- case 't': return '\t';
- case 'n': return '\n';
- case 'f': return '\f';
- case 'b': return '\b';
- case '/': return '/';
- case '"': return '"';
- case '\\': return '\\';
- default:
- UPB_ASSERT(0);
- return 'x';
- }
-}
-
-static bool escape(upb_json_parser *p, const char *ptr) {
- char ch = escape_char(*ptr);
- return multipart_text(p, &ch, 1, false);
-}
-
-static void start_hex(upb_json_parser *p) {
- p->digit = 0;
-}
-
-static void hexdigit(upb_json_parser *p, const char *ptr) {
- char ch = *ptr;
-
- p->digit <<= 4;
-
- if (ch >= '0' && ch <= '9') {
- p->digit += (ch - '0');
- } else if (ch >= 'a' && ch <= 'f') {
- p->digit += ((ch - 'a') + 10);
- } else {
- UPB_ASSERT(ch >= 'A' && ch <= 'F');
- p->digit += ((ch - 'A') + 10);
- }
-}
-
-static bool end_hex(upb_json_parser *p) {
- uint32_t codepoint = p->digit;
-
- /* emit the codepoint as UTF-8. */
- char utf8[3]; /* support \u0000 -- \uFFFF -- need only three bytes. */
- int length = 0;
- if (codepoint <= 0x7F) {
- utf8[0] = codepoint;
- length = 1;
- } else if (codepoint <= 0x07FF) {
- utf8[1] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[0] = (codepoint & 0x1F) | 0xC0;
- length = 2;
- } else /* codepoint <= 0xFFFF */ {
- utf8[2] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[1] = (codepoint & 0x3F) | 0x80;
- codepoint >>= 6;
- utf8[0] = (codepoint & 0x0F) | 0xE0;
- length = 3;
- }
- /* TODO(haberman): Handle high surrogates: if codepoint is a high surrogate
- * we have to wait for the next escape to get the full code point). */
-
- return multipart_text(p, utf8, length, false);
-}
-
-static void start_text(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_text(upb_json_parser *p, const char *ptr) {
- return capture_end(p, ptr);
-}
-
-static bool start_number(upb_json_parser *p, const char *ptr) {
- if (is_top_level(p)) {
- if (is_number_wrapper_object(p)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_NUMBERVALUE);
- } else {
- return false;
- }
- } else if (does_number_wrapper_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_NUMBERVALUE);
- }
-
- multipart_startaccum(p);
- capture_begin(p, ptr);
- return true;
-}
-
-static bool parse_number(upb_json_parser *p, bool is_quoted);
-
-static bool end_number_nontop(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- if (p->top->f == NULL) {
- multipart_end(p);
- return true;
- }
-
- return parse_number(p, false);
-}
-
-static bool end_number(upb_json_parser *p, const char *ptr) {
- if (!end_number_nontop(p, ptr)) {
- return false;
- }
-
- if (does_number_wrapper_end(p)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-/* |buf| is NULL-terminated. |buf| itself will never include quotes;
- * |is_quoted| tells us whether this text originally appeared inside quotes. */
-static bool parse_number_from_buffer(upb_json_parser *p, const char *buf,
- bool is_quoted) {
- size_t len = strlen(buf);
- const char *bufend = buf + len;
- char *end;
- upb_fieldtype_t type = upb_fielddef_type(p->top->f);
- double val;
- double dummy;
- double inf = INFINITY;
-
- errno = 0;
-
- if (len == 0 || buf[0] == ' ') {
- return false;
- }
-
- /* For integer types, first try parsing with integer-specific routines.
- * If these succeed, they will be more accurate for int64/uint64 than
- * strtod().
- */
- switch (type) {
- case UPB_TYPE_ENUM:
- case UPB_TYPE_INT32: {
- long val = strtol(buf, &end, 0);
- if (errno == ERANGE || end != bufend) {
- break;
- } else if (val > INT32_MAX || val < INT32_MIN) {
- return false;
- } else {
- upb_sink_putint32(p->top->sink, parser_getsel(p), (int32_t)val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- case UPB_TYPE_UINT32: {
- unsigned long val = strtoul(buf, &end, 0);
- if (end != bufend) {
- break;
- } else if (val > UINT32_MAX || errno == ERANGE) {
- return false;
- } else {
- upb_sink_putuint32(p->top->sink, parser_getsel(p), (uint32_t)val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- /* XXX: We can't handle [u]int64 properly on 32-bit machines because
- * strto[u]ll isn't in C89. */
- case UPB_TYPE_INT64: {
- long val = strtol(buf, &end, 0);
- if (errno == ERANGE || end != bufend) {
- break;
- } else {
- upb_sink_putint64(p->top->sink, parser_getsel(p), val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- case UPB_TYPE_UINT64: {
- unsigned long val = strtoul(p->accumulated, &end, 0);
- if (end != bufend) {
- break;
- } else if (errno == ERANGE) {
- return false;
- } else {
- upb_sink_putuint64(p->top->sink, parser_getsel(p), val);
- return true;
- }
- UPB_UNREACHABLE();
- }
- default:
- break;
- }
-
- if (type != UPB_TYPE_DOUBLE && type != UPB_TYPE_FLOAT && is_quoted) {
- /* Quoted numbers for integer types are not allowed to be in double form. */
- return false;
- }
-
- if (len == strlen("Infinity") && strcmp(buf, "Infinity") == 0) {
- /* C89 does not have an INFINITY macro. */
- val = inf;
- } else if (len == strlen("-Infinity") && strcmp(buf, "-Infinity") == 0) {
- val = -inf;
- } else {
- val = strtod(buf, &end);
- if (errno == ERANGE || end != bufend) {
- return false;
- }
- }
-
- switch (type) {
-#define CASE(capitaltype, smalltype, ctype, min, max) \
- case UPB_TYPE_ ## capitaltype: { \
- if (modf(val, &dummy) != 0 || val > max || val < min) { \
- return false; \
- } else { \
- upb_sink_put ## smalltype(p->top->sink, parser_getsel(p), \
- (ctype)val); \
- return true; \
- } \
- break; \
- }
- case UPB_TYPE_ENUM:
- CASE(INT32, int32, int32_t, INT32_MIN, INT32_MAX);
- CASE(INT64, int64, int64_t, INT64_MIN, INT64_MAX);
- CASE(UINT32, uint32, uint32_t, 0, UINT32_MAX);
- CASE(UINT64, uint64, uint64_t, 0, UINT64_MAX);
-#undef CASE
-
- case UPB_TYPE_DOUBLE:
- upb_sink_putdouble(p->top->sink, parser_getsel(p), val);
- return true;
- case UPB_TYPE_FLOAT:
- if ((val > FLT_MAX || val < -FLT_MAX) && val != inf && val != -inf) {
- return false;
- } else {
- upb_sink_putfloat(p->top->sink, parser_getsel(p), val);
- return true;
- }
- default:
- return false;
- }
-}
-
-static bool parse_number(upb_json_parser *p, bool is_quoted) {
- size_t len;
- const char *buf;
-
- /* strtol() and friends unfortunately do not support specifying the length of
- * the input string, so we need to force a copy into a NULL-terminated buffer. */
- if (!multipart_text(p, "\0", 1, false)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (parse_number_from_buffer(p, buf, is_quoted)) {
- multipart_end(p);
- return true;
- } else {
- upb_status_seterrf(p->status, "error parsing number: %s", buf);
- multipart_end(p);
- return false;
- }
-}
-
-static bool parser_putbool(upb_json_parser *p, bool val) {
- bool ok;
-
- if (p->top->f == NULL) {
- return true;
- }
-
- if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL) {
- upb_status_seterrf(p->status,
- "Boolean value specified for non-bool field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- ok = upb_sink_putbool(p->top->sink, parser_getsel(p), val);
- UPB_ASSERT(ok);
-
- return true;
-}
-
-static bool end_bool(upb_json_parser *p, bool val) {
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_BOOLVALUE)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_BOOLVALUE);
- } else {
- return false;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_BOOLVALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_BOOLVALUE);
- }
-
- if (p->top->is_unknown_field) {
- return true;
- }
-
- if (!parser_putbool(p, val)) {
- return false;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_BOOLVALUE)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-static bool end_null(upb_json_parser *p) {
- const char *zero_ptr = "0";
-
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_NULLVALUE);
- } else {
- return true;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_NULLVALUE);
- } else {
- return true;
- }
-
- /* Fill null_value field. */
- multipart_startaccum(p);
- capture_begin(p, zero_ptr);
- capture_end(p, zero_ptr + 1);
- parse_number(p, false);
-
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
-
- return true;
-}
-
-static bool start_any_stringval(upb_json_parser *p) {
- multipart_startaccum(p);
- return true;
-}
-
-static bool start_stringval(upb_json_parser *p) {
- if (is_top_level(p)) {
- if (is_string_wrapper_object(p) ||
- is_number_wrapper_object(p)) {
- start_wrapper_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) {
- start_fieldmask_object(p);
- return true;
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION)) {
- start_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_STRINGVALUE);
- } else {
- return false;
- }
- } else if (does_string_wrapper_start(p) ||
- does_number_wrapper_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_wrapper_object(p);
- } else if (does_fieldmask_start(p)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_fieldmask_object(p);
- return true;
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_field(p, UPB_WELLKNOWN_DURATION)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) {
- return false;
- }
- start_value_object(p, VALUE_STRINGVALUE);
- }
-
- if (p->top->f == NULL) {
- multipart_startaccum(p);
- return true;
- }
-
- if (p->top->is_any) {
- return start_any_stringval(p);
- }
-
- if (upb_fielddef_isstring(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (!check_stack(p)) return false;
-
- /* Start a new parser frame: parser frames correspond one-to-one with
- * handler frames, and string events occur in a sub-frame. */
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- p->top = inner;
-
- if (upb_fielddef_type(p->top->f) == UPB_TYPE_STRING) {
- /* For STRING fields we push data directly to the handlers as it is
- * parsed. We don't do this yet for BYTES fields, because our base64
- * decoder is not streaming.
- *
- * TODO(haberman): make base64 decoding streaming also. */
- multipart_start(p, getsel_for_handlertype(p, UPB_HANDLER_STRING));
- return true;
- } else {
- multipart_startaccum(p);
- return true;
- }
- } else if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL &&
- upb_fielddef_type(p->top->f) != UPB_TYPE_MESSAGE) {
- /* No need to push a frame -- numeric values in quotes remain in the
- * current parser frame. These values must accmulate so we can convert
- * them all at once at the end. */
- multipart_startaccum(p);
- return true;
- } else {
- upb_status_seterrf(p->status,
- "String specified for bool or submessage field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-}
-
-static bool end_any_stringval(upb_json_parser *p) {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- /* Set type_url */
- upb_selector_t sel;
- upb_jsonparser_frame *inner;
- if (!check_stack(p)) return false;
- inner = p->top + 1;
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(inner->sink, sel, buf, len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(inner->sink, sel);
-
- multipart_end(p);
-
- /* Resolve type url */
- if (strncmp(buf, "type.googleapis.com/", 20) == 0 && len > 20) {
- const upb_msgdef *payload_type = NULL;
- buf += 20;
- len -= 20;
-
- payload_type = upb_symtab_lookupmsg2(p->symtab, buf, len);
- if (payload_type == NULL) {
- upb_status_seterrf(
- p->status, "Cannot find packed type: %.*s\n", (int)len, buf);
- return false;
- }
-
- json_parser_any_frame_set_payload_type(p, p->top->any_frame, payload_type);
-
- return true;
- } else {
- upb_status_seterrf(
- p->status, "Invalid type url: %.*s\n", (int)len, buf);
- return false;
- }
-}
-
-static bool end_stringval_nontop(upb_json_parser *p) {
- bool ok = true;
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION)) {
- multipart_end(p);
- return true;
- }
-
- if (p->top->f == NULL) {
- multipart_end(p);
- return true;
- }
-
- if (p->top->is_any) {
- return end_any_stringval(p);
- }
-
- switch (upb_fielddef_type(p->top->f)) {
- case UPB_TYPE_BYTES:
- if (!base64_push(p, getsel_for_handlertype(p, UPB_HANDLER_STRING),
- p->accumulated, p->accumulated_len)) {
- return false;
- }
- /* Fall through. */
-
- case UPB_TYPE_STRING: {
- upb_selector_t sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(p->top->sink, sel);
- p->top--;
- break;
- }
-
- case UPB_TYPE_ENUM: {
- /* Resolve enum symbolic name to integer value. */
- const upb_enumdef *enumdef = upb_fielddef_enumsubdef(p->top->f);
-
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- int32_t int_val = 0;
- ok = upb_enumdef_ntoi(enumdef, buf, len, &int_val);
-
- if (ok) {
- upb_selector_t sel = parser_getsel(p);
- upb_sink_putint32(p->top->sink, sel, int_val);
- } else {
- if (p->ignore_json_unknown) {
- ok = true;
- /* TODO(teboring): Should also clean this field. */
- } else {
- upb_status_seterrf(p->status, "Enum value unknown: '%.*s'", len, buf);
- }
- }
-
- break;
- }
-
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_FLOAT:
- ok = parse_number(p, true);
- break;
-
- default:
- UPB_ASSERT(false);
- upb_status_seterrmsg(p->status, "Internal error in JSON decoder");
- ok = false;
- break;
- }
-
- multipart_end(p);
-
- return ok;
-}
-
-static bool end_stringval(upb_json_parser *p) {
- /* FieldMask's stringvals have been ended when handling them. Only need to
- * close FieldMask here.*/
- if (does_fieldmask_end(p)) {
- end_fieldmask_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (!end_stringval_nontop(p)) {
- return false;
- }
-
- if (does_string_wrapper_end(p) ||
- does_number_wrapper_end(p)) {
- end_wrapper_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_TIMESTAMP) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_DURATION) ||
- is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) {
- end_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- return true;
- }
-
- return true;
-}
-
-static void start_duration_base(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_duration_base(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- char seconds_buf[14];
- char nanos_buf[12];
- char *end;
- int64_t seconds = 0;
- int32_t nanos = 0;
- double val = 0.0;
- const char *seconds_membername = "seconds";
- const char *nanos_membername = "nanos";
- size_t fraction_start;
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- memset(seconds_buf, 0, 14);
- memset(nanos_buf, 0, 12);
-
- /* Find out base end. The maximus duration is 315576000000, which cannot be
- * represented by double without losing precision. Thus, we need to handle
- * fraction and base separately. */
- for (fraction_start = 0; fraction_start < len && buf[fraction_start] != '.';
- fraction_start++);
-
- /* Parse base */
- memcpy(seconds_buf, buf, fraction_start);
- seconds = strtol(seconds_buf, &end, 10);
- if (errno == ERANGE || end != seconds_buf + fraction_start) {
- upb_status_seterrf(p->status, "error parsing duration: %s",
- seconds_buf);
- return false;
- }
-
- if (seconds > 315576000000) {
- upb_status_seterrf(p->status, "error parsing duration: "
- "maximum acceptable value is "
- "315576000000");
- return false;
- }
-
- if (seconds < -315576000000) {
- upb_status_seterrf(p->status, "error parsing duration: "
- "minimum acceptable value is "
- "-315576000000");
- return false;
- }
-
- /* Parse fraction */
- nanos_buf[0] = '0';
- memcpy(nanos_buf + 1, buf + fraction_start, len - fraction_start);
- val = strtod(nanos_buf, &end);
- if (errno == ERANGE || end != nanos_buf + len - fraction_start + 1) {
- upb_status_seterrf(p->status, "error parsing duration: %s",
- nanos_buf);
- return false;
- }
-
- nanos = val * 1000000000;
- if (seconds < 0) nanos = -nanos;
-
- /* Clean up buffer */
- multipart_end(p);
-
- /* Set seconds */
- start_member(p);
- capture_begin(p, seconds_membername);
- capture_end(p, seconds_membername + 7);
- end_membername(p);
- upb_sink_putint64(p->top->sink, parser_getsel(p), seconds);
- end_member(p);
-
- /* Set nanos */
- start_member(p);
- capture_begin(p, nanos_membername);
- capture_end(p, nanos_membername + 5);
- end_membername(p);
- upb_sink_putint32(p->top->sink, parser_getsel(p), nanos);
- end_member(p);
-
- /* Continue previous arena */
- multipart_startaccum(p);
-
- return true;
-}
-
-static int parse_timestamp_number(upb_json_parser *p) {
- size_t len;
- const char *buf;
- int val;
-
- /* atoi() and friends unfortunately do not support specifying the length of
- * the input string, so we need to force a copy into a NULL-terminated buffer. */
- multipart_text(p, "\0", 1, false);
-
- buf = accumulate_getptr(p, &len);
- val = atoi(buf);
- multipart_end(p);
- multipart_startaccum(p);
-
- return val;
-}
-
-static void start_year(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_year(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_year = parse_timestamp_number(p) - 1900;
- return true;
-}
-
-static void start_month(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_month(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_mon = parse_timestamp_number(p) - 1;
- return true;
-}
-
-static void start_day(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_day(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_mday = parse_timestamp_number(p);
- return true;
-}
-
-static void start_hour(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_hour(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_hour = parse_timestamp_number(p);
- return true;
-}
-
-static void start_minute(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_minute(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_min = parse_timestamp_number(p);
- return true;
-}
-
-static void start_second(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_second(upb_json_parser *p, const char *ptr) {
- if (!capture_end(p, ptr)) {
- return false;
- }
- p->tm.tm_sec = parse_timestamp_number(p);
- return true;
-}
-
-static void start_timestamp_base(upb_json_parser *p) {
- memset(&p->tm, 0, sizeof(struct tm));
-}
-
-static void start_timestamp_fraction(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_timestamp_fraction(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- char nanos_buf[12];
- char *end;
- double val = 0.0;
- int32_t nanos;
- const char *nanos_membername = "nanos";
-
- memset(nanos_buf, 0, 12);
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (len > 10) {
- upb_status_seterrf(p->status,
- "error parsing timestamp: at most 9-digit fraction.");
- return false;
- }
-
- /* Parse nanos */
- nanos_buf[0] = '0';
- memcpy(nanos_buf + 1, buf, len);
- val = strtod(nanos_buf, &end);
-
- if (errno == ERANGE || end != nanos_buf + len + 1) {
- upb_status_seterrf(p->status, "error parsing timestamp nanos: %s",
- nanos_buf);
- return false;
- }
-
- nanos = val * 1000000000;
-
- /* Clean up previous environment */
- multipart_end(p);
-
- /* Set nanos */
- start_member(p);
- capture_begin(p, nanos_membername);
- capture_end(p, nanos_membername + 5);
- end_membername(p);
- upb_sink_putint32(p->top->sink, parser_getsel(p), nanos);
- end_member(p);
-
- /* Continue previous environment */
- multipart_startaccum(p);
-
- return true;
-}
-
-static void start_timestamp_zone(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-/* epoch_days(1970, 1, 1) == 1970-01-01 == 0. */
-static int epoch_days(int year, int month, int day) {
- static const uint16_t month_yday[12] = {0, 31, 59, 90, 120, 151,
- 181, 212, 243, 273, 304, 334};
- uint32_t year_adj = year + 4800; /* Ensure positive year, multiple of 400. */
- uint32_t febs = year_adj - (month <= 2 ? 1 : 0); /* Februaries since base. */
- uint32_t leap_days = 1 + (febs / 4) - (febs / 100) + (febs / 400);
- uint32_t days = 365 * year_adj + leap_days + month_yday[month - 1] + day - 1;
- return days - 2472692; /* Adjust to Unix epoch. */
-}
-
-static int64_t upb_timegm(const struct tm *tp) {
- int64_t ret = epoch_days(tp->tm_year + 1900, tp->tm_mon + 1, tp->tm_mday);
- ret = (ret * 24) + tp->tm_hour;
- ret = (ret * 60) + tp->tm_min;
- ret = (ret * 60) + tp->tm_sec;
- return ret;
-}
-
-static bool end_timestamp_zone(upb_json_parser *p, const char *ptr) {
- size_t len;
- const char *buf;
- int hours;
- int64_t seconds;
- const char *seconds_membername = "seconds";
-
- if (!capture_end(p, ptr)) {
- return false;
- }
-
- buf = accumulate_getptr(p, &len);
-
- if (buf[0] != 'Z') {
- if (sscanf(buf + 1, "%2d:00", &hours) != 1) {
- upb_status_seterrf(p->status, "error parsing timestamp offset");
- return false;
- }
-
- if (buf[0] == '+') {
- hours = -hours;
- }
-
- p->tm.tm_hour += hours;
- }
-
- /* Normalize tm */
- seconds = upb_timegm(&p->tm);
-
- /* Check timestamp boundary */
- if (seconds < -62135596800) {
- upb_status_seterrf(p->status, "error parsing timestamp: "
- "minimum acceptable value is "
- "0001-01-01T00:00:00Z");
- return false;
- }
-
- /* Clean up previous environment */
- multipart_end(p);
-
- /* Set seconds */
- start_member(p);
- capture_begin(p, seconds_membername);
- capture_end(p, seconds_membername + 7);
- end_membername(p);
- upb_sink_putint64(p->top->sink, parser_getsel(p), seconds);
- end_member(p);
-
- /* Continue previous environment */
- multipart_startaccum(p);
-
- return true;
-}
-
-static void start_fieldmask_path_text(upb_json_parser *p, const char *ptr) {
- capture_begin(p, ptr);
-}
-
-static bool end_fieldmask_path_text(upb_json_parser *p, const char *ptr) {
- return capture_end(p, ptr);
-}
-
-static bool start_fieldmask_path(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (!check_stack(p)) return false;
-
- /* Start a new parser frame: parser frames correspond one-to-one with
- * handler frames, and string events occur in a sub-frame. */
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- p->top = inner;
-
- multipart_startaccum(p);
- return true;
-}
-
-static bool lower_camel_push(
- upb_json_parser *p, upb_selector_t sel, const char *ptr, size_t len) {
- const char *limit = ptr + len;
- bool first = true;
- for (;ptr < limit; ptr++) {
- if (*ptr >= 'A' && *ptr <= 'Z' && !first) {
- char lower = tolower(*ptr);
- upb_sink_putstring(p->top->sink, sel, "_", 1, NULL);
- upb_sink_putstring(p->top->sink, sel, &lower, 1, NULL);
- } else {
- upb_sink_putstring(p->top->sink, sel, ptr, 1, NULL);
- }
- first = false;
- }
- return true;
-}
-
-static bool end_fieldmask_path(upb_json_parser *p) {
- upb_selector_t sel;
-
- if (!lower_camel_push(
- p, getsel_for_handlertype(p, UPB_HANDLER_STRING),
- p->accumulated, p->accumulated_len)) {
- return false;
- }
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(p->top->sink, sel);
- p->top--;
-
- multipart_end(p);
- return true;
-}
-
-static void start_member(upb_json_parser *p) {
- UPB_ASSERT(!p->top->f);
- multipart_startaccum(p);
-}
-
-/* Helper: invoked during parse_mapentry() to emit the mapentry message's key
- * field based on the current contents of the accumulate buffer. */
-static bool parse_mapentry_key(upb_json_parser *p) {
-
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
-
- /* Emit the key field. We do a bit of ad-hoc parsing here because the
- * parser state machine has already decided that this is a string field
- * name, and we are reinterpreting it as some arbitrary key type. In
- * particular, integer and bool keys are quoted, so we need to parse the
- * quoted string contents here. */
-
- p->top->f = upb_msgdef_itof(p->top->m, UPB_MAPENTRY_KEY);
- if (p->top->f == NULL) {
- upb_status_seterrmsg(p->status, "mapentry message has no key");
- return false;
- }
- switch (upb_fielddef_type(p->top->f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
- /* Invoke end_number. The accum buffer has the number's text already. */
- if (!parse_number(p, true)) {
- return false;
- }
- break;
- case UPB_TYPE_BOOL:
- if (len == 4 && !strncmp(buf, "true", 4)) {
- if (!parser_putbool(p, true)) {
- return false;
- }
- } else if (len == 5 && !strncmp(buf, "false", 5)) {
- if (!parser_putbool(p, false)) {
- return false;
- }
- } else {
- upb_status_seterrmsg(p->status,
- "Map bool key not 'true' or 'false'");
- return false;
- }
- multipart_end(p);
- break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES: {
- upb_sink subsink;
- upb_selector_t sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, len, &subsink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(subsink, sel, buf, len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(subsink, sel);
- multipart_end(p);
- break;
- }
- default:
- upb_status_seterrmsg(p->status, "Invalid field type for map key");
- return false;
- }
-
- return true;
-}
-
-/* Helper: emit one map entry (as a submessage in the map field sequence). This
- * is invoked from end_membername(), at the end of the map entry's key string,
- * with the map key in the accumulate buffer. It parses the key from that
- * buffer, emits the handler calls to start the mapentry submessage (setting up
- * its subframe in the process), and sets up state in the subframe so that the
- * value parser (invoked next) will emit the mapentry's value field and then
- * end the mapentry message. */
-
-static bool handle_mapentry(upb_json_parser *p) {
- const upb_fielddef *mapfield;
- const upb_msgdef *mapentrymsg;
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Map entry: p->top->sink is the seq frame, so we need to start a frame
- * for the mapentry itself, and then set |f| in that frame so that the map
- * value field is parsed, and also set a flag to end the frame after the
- * map-entry value is parsed. */
- if (!check_stack(p)) return false;
-
- mapfield = p->top->mapfield;
- mapentrymsg = upb_fielddef_msgsubdef(mapfield);
-
- inner = start_jsonparser_frame(p);
- p->top->f = mapfield;
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
- upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
- inner->m = mapentrymsg;
- inner->mapfield = mapfield;
-
- /* Don't set this to true *yet* -- we reuse parsing handlers below to push
- * the key field value to the sink, and these handlers will pop the frame
- * if they see is_mapentry (when invoked by the parser state machine, they
- * would have just seen the map-entry value, not key). */
- inner->is_mapentry = false;
- p->top = inner;
-
- /* send STARTMSG in submsg frame. */
- upb_sink_startmsg(p->top->sink);
-
- parse_mapentry_key(p);
-
- /* Set up the value field to receive the map-entry value. */
- p->top->f = upb_msgdef_itof(p->top->m, UPB_MAPENTRY_VALUE);
- p->top->is_mapentry = true; /* set up to pop frame after value is parsed. */
- p->top->mapfield = mapfield;
- if (p->top->f == NULL) {
- upb_status_seterrmsg(p->status, "mapentry message has no value");
- return false;
- }
-
- return true;
-}
-
-static bool end_membername(upb_json_parser *p) {
- UPB_ASSERT(!p->top->f);
-
- if (!p->top->m) {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- }
-
- if (p->top->is_any) {
- return end_any_membername(p);
- } else if (p->top->is_map) {
- return handle_mapentry(p);
- } else {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
- upb_value v;
-
- if (upb_strtable_lookup2(p->top->name_table, buf, len, &v)) {
- p->top->f = upb_value_getconstptr(v);
- multipart_end(p);
-
- return true;
- } else if (p->ignore_json_unknown) {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- } else {
- upb_status_seterrf(p->status, "No such field: %.*s\n", (int)len, buf);
- return false;
- }
- }
-}
-
-static bool end_any_membername(upb_json_parser *p) {
- size_t len;
- const char *buf = accumulate_getptr(p, &len);
- upb_value v;
-
- if (len == 5 && strncmp(buf, "@type", len) == 0) {
- upb_strtable_lookup2(p->top->name_table, "type_url", 8, &v);
- p->top->f = upb_value_getconstptr(v);
- multipart_end(p);
- return true;
- } else {
- p->top->is_unknown_field = true;
- multipart_end(p);
- return true;
- }
-}
-
-static void end_member(upb_json_parser *p) {
- /* If we just parsed a map-entry value, end that frame too. */
- if (p->top->is_mapentry) {
- upb_selector_t sel;
- bool ok;
- const upb_fielddef *mapfield;
-
- UPB_ASSERT(p->top > p->stack);
- /* send ENDMSG on submsg. */
- upb_sink_endmsg(p->top->sink, p->status);
- mapfield = p->top->mapfield;
-
- /* send ENDSUBMSG in repeated-field-of-mapentries frame. */
- p->top--;
- ok = upb_handlers_getselector(mapfield, UPB_HANDLER_ENDSUBMSG, &sel);
- UPB_ASSUME(ok);
- upb_sink_endsubmsg(p->top->sink, (p->top + 1)->sink, sel);
- }
-
- p->top->f = NULL;
- p->top->is_unknown_field = false;
-}
-
-static void start_any_member(upb_json_parser *p, const char *ptr) {
- start_member(p);
- json_parser_any_frame_set_after_type_url_start_once(p->top->any_frame, ptr);
-}
-
-static void end_any_member(upb_json_parser *p, const char *ptr) {
- json_parser_any_frame_set_before_type_url_end(p->top->any_frame, ptr);
- end_member(p);
-}
-
-static bool start_subobject(upb_json_parser *p) {
- if (p->top->is_unknown_field) {
- if (!check_stack(p)) return false;
-
- p->top = start_jsonparser_frame(p);
- return true;
- }
-
- if (upb_fielddef_ismap(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Beginning of a map. Start a new parser frame in a repeated-field
- * context. */
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
- upb_sink_startseq(p->top->sink, sel, &inner->sink);
- inner->m = upb_fielddef_msgsubdef(p->top->f);
- inner->mapfield = p->top->f;
- inner->is_map = true;
- p->top = inner;
-
- return true;
- } else if (upb_fielddef_issubmsg(p->top->f)) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- /* Beginning of a subobject. Start a new parser frame in the submsg
- * context. */
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSUBMSG);
- upb_sink_startsubmsg(p->top->sink, sel, &inner->sink);
- inner->m = upb_fielddef_msgsubdef(p->top->f);
- set_name_table(p, inner);
- p->top = inner;
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
- p->top->is_any = true;
- p->top->any_frame = json_parser_any_frame_new(p);
- } else {
- p->top->is_any = false;
- p->top->any_frame = NULL;
- }
-
- return true;
- } else {
- upb_status_seterrf(p->status,
- "Object specified for non-message/group field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-}
-
-static bool start_subobject_full(upb_json_parser *p) {
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_STRUCTVALUE);
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_STRUCT)) {
- start_structvalue_object(p);
- } else {
- return true;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_STRUCT)) {
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE)) {
- if (!start_subobject(p)) return false;
- start_value_object(p, VALUE_STRUCTVALUE);
- if (!start_subobject(p)) return false;
- start_structvalue_object(p);
- }
-
- return start_subobject(p);
-}
-
-static void end_subobject(upb_json_parser *p) {
- if (is_top_level(p)) {
- return;
- }
-
- if (p->top->is_map) {
- upb_selector_t sel;
- p->top--;
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSEQ);
- upb_sink_endseq(p->top->sink, sel);
- } else {
- upb_selector_t sel;
- bool is_unknown = p->top->m == NULL;
- p->top--;
- if (!is_unknown) {
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSUBMSG);
- upb_sink_endsubmsg(p->top->sink, (p->top + 1)->sink, sel);
- }
- }
-}
-
-static void end_subobject_full(upb_json_parser *p) {
- end_subobject(p);
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_STRUCT)) {
- end_structvalue_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-}
-
-static bool start_array(upb_json_parser *p) {
- upb_jsonparser_frame *inner;
- upb_selector_t sel;
-
- if (is_top_level(p)) {
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- start_value_object(p, VALUE_LISTVALUE);
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- } else if (is_wellknown_msg(p, UPB_WELLKNOWN_LISTVALUE)) {
- start_listvalue_object(p);
- } else {
- return false;
- }
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_LISTVALUE) &&
- (!upb_fielddef_isseq(p->top->f) ||
- p->top->is_repeated)) {
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- } else if (is_wellknown_field(p, UPB_WELLKNOWN_VALUE) &&
- (!upb_fielddef_isseq(p->top->f) ||
- p->top->is_repeated)) {
- if (!start_subobject(p)) return false;
- start_value_object(p, VALUE_LISTVALUE);
- if (!start_subobject(p)) return false;
- start_listvalue_object(p);
- }
-
- if (p->top->is_unknown_field) {
- inner = start_jsonparser_frame(p);
- inner->is_unknown_field = true;
- p->top = inner;
-
- return true;
- }
-
- if (!upb_fielddef_isseq(p->top->f)) {
- upb_status_seterrf(p->status,
- "Array specified for non-repeated field: %s",
- upb_fielddef_name(p->top->f));
- return false;
- }
-
- if (!check_stack(p)) return false;
-
- inner = start_jsonparser_frame(p);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSEQ);
- upb_sink_startseq(p->top->sink, sel, &inner->sink);
- inner->m = p->top->m;
- inner->f = p->top->f;
- inner->is_repeated = true;
- p->top = inner;
-
- return true;
-}
-
-static void end_array(upb_json_parser *p) {
- upb_selector_t sel;
-
- UPB_ASSERT(p->top > p->stack);
-
- p->top--;
-
- if (p->top->is_unknown_field) {
- return;
- }
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSEQ);
- upb_sink_endseq(p->top->sink, sel);
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_LISTVALUE)) {
- end_listvalue_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-
- if (is_wellknown_msg(p, UPB_WELLKNOWN_VALUE)) {
- end_value_object(p);
- if (!is_top_level(p)) {
- end_subobject(p);
- }
- }
-}
-
-static void start_object(upb_json_parser *p) {
- if (!p->top->is_map && p->top->m != NULL) {
- upb_sink_startmsg(p->top->sink);
- }
-}
-
-static void end_object(upb_json_parser *p) {
- if (!p->top->is_map && p->top->m != NULL) {
- upb_sink_endmsg(p->top->sink, p->status);
- }
-}
-
-static void start_any_object(upb_json_parser *p, const char *ptr) {
- start_object(p);
- p->top->any_frame->before_type_url_start = ptr;
- p->top->any_frame->before_type_url_end = ptr;
-}
-
-static bool end_any_object(upb_json_parser *p, const char *ptr) {
- const char *value_membername = "value";
- bool is_well_known_packed = false;
- const char *packed_end = ptr + 1;
- upb_selector_t sel;
- upb_jsonparser_frame *inner;
-
- if (json_parser_any_frame_has_value(p->top->any_frame) &&
- !json_parser_any_frame_has_type_url(p->top->any_frame)) {
- upb_status_seterrmsg(p->status, "No valid type url");
- return false;
- }
-
- /* Well known types data is represented as value field. */
- if (upb_msgdef_wellknowntype(p->top->any_frame->parser->top->m) !=
- UPB_WELLKNOWN_UNSPECIFIED) {
- is_well_known_packed = true;
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame)) {
- p->top->any_frame->before_type_url_start =
- memchr(p->top->any_frame->before_type_url_start, ':',
- p->top->any_frame->before_type_url_end -
- p->top->any_frame->before_type_url_start);
- if (p->top->any_frame->before_type_url_start == NULL) {
- upb_status_seterrmsg(p->status, "invalid data for well known type.");
- return false;
- }
- p->top->any_frame->before_type_url_start++;
- }
-
- if (json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- p->top->any_frame->after_type_url_start =
- memchr(p->top->any_frame->after_type_url_start, ':',
- (ptr + 1) -
- p->top->any_frame->after_type_url_start);
- if (p->top->any_frame->after_type_url_start == NULL) {
- upb_status_seterrmsg(p->status, "Invalid data for well known type.");
- return false;
- }
- p->top->any_frame->after_type_url_start++;
- packed_end = ptr;
- }
- }
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL,
- p->top->any_frame->before_type_url_start,
- p->top->any_frame->before_type_url_end -
- p->top->any_frame->before_type_url_start, NULL)) {
- return false;
- }
- } else {
- if (!is_well_known_packed) {
- if (!parse(p->top->any_frame->parser, NULL, "{", 1, NULL)) {
- return false;
- }
- }
- }
-
- if (json_parser_any_frame_has_value_before_type_url(p->top->any_frame) &&
- json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL, ",", 1, NULL)) {
- return false;
- }
- }
-
- if (json_parser_any_frame_has_value_after_type_url(p->top->any_frame)) {
- if (!parse(p->top->any_frame->parser, NULL,
- p->top->any_frame->after_type_url_start,
- packed_end - p->top->any_frame->after_type_url_start, NULL)) {
- return false;
- }
- } else {
- if (!is_well_known_packed) {
- if (!parse(p->top->any_frame->parser, NULL, "}", 1, NULL)) {
- return false;
- }
- }
- }
-
- if (!end(p->top->any_frame->parser, NULL)) {
- return false;
- }
-
- p->top->is_any = false;
-
- /* Set value */
- start_member(p);
- capture_begin(p, value_membername);
- capture_end(p, value_membername + 5);
- end_membername(p);
-
- if (!check_stack(p)) return false;
- inner = p->top + 1;
-
- sel = getsel_for_handlertype(p, UPB_HANDLER_STARTSTR);
- upb_sink_startstr(p->top->sink, sel, 0, &inner->sink);
- sel = getsel_for_handlertype(p, UPB_HANDLER_STRING);
- upb_sink_putstring(inner->sink, sel, p->top->any_frame->stringsink.ptr,
- p->top->any_frame->stringsink.len, NULL);
- sel = getsel_for_handlertype(p, UPB_HANDLER_ENDSTR);
- upb_sink_endstr(inner->sink, sel);
-
- end_member(p);
-
- end_object(p);
-
- /* Deallocate any parse frame. */
- json_parser_any_frame_free(p->top->any_frame);
-
- return true;
-}
-
-static bool is_string_wrapper(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type == UPB_WELLKNOWN_STRINGVALUE ||
- type == UPB_WELLKNOWN_BYTESVALUE;
-}
-
-static bool is_fieldmask(const upb_msgdef *m) {
- upb_wellknowntype_t type = upb_msgdef_wellknowntype(m);
- return type == UPB_WELLKNOWN_FIELDMASK;
-}
-
-static void start_fieldmask_object(upb_json_parser *p) {
- const char *membername = "paths";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + 5);
- end_membername(p);
-
- start_array(p);
-}
-
-static void end_fieldmask_object(upb_json_parser *p) {
- end_array(p);
- end_member(p);
- end_object(p);
-}
-
-static void start_wrapper_object(upb_json_parser *p) {
- const char *membername = "value";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + 5);
- end_membername(p);
-}
-
-static void end_wrapper_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_value_object(upb_json_parser *p, int value_type) {
- const char *nullmember = "null_value";
- const char *numbermember = "number_value";
- const char *stringmember = "string_value";
- const char *boolmember = "bool_value";
- const char *structmember = "struct_value";
- const char *listmember = "list_value";
- const char *membername = "";
-
- switch (value_type) {
- case VALUE_NULLVALUE:
- membername = nullmember;
- break;
- case VALUE_NUMBERVALUE:
- membername = numbermember;
- break;
- case VALUE_STRINGVALUE:
- membername = stringmember;
- break;
- case VALUE_BOOLVALUE:
- membername = boolmember;
- break;
- case VALUE_STRUCTVALUE:
- membername = structmember;
- break;
- case VALUE_LISTVALUE:
- membername = listmember;
- break;
- }
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_value_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_listvalue_object(upb_json_parser *p) {
- const char *membername = "values";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_listvalue_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static void start_structvalue_object(upb_json_parser *p) {
- const char *membername = "fields";
-
- start_object(p);
-
- /* Set up context for parsing value */
- start_member(p);
- capture_begin(p, membername);
- capture_end(p, membername + strlen(membername));
- end_membername(p);
-}
-
-static void end_structvalue_object(upb_json_parser *p) {
- end_member(p);
- end_object(p);
-}
-
-static bool is_top_level(upb_json_parser *p) {
- return p->top == p->stack && p->top->f == NULL && !p->top->is_unknown_field;
-}
-
-static bool is_wellknown_msg(upb_json_parser *p, upb_wellknowntype_t type) {
- return p->top->m != NULL && upb_msgdef_wellknowntype(p->top->m) == type;
-}
-
-static bool is_wellknown_field(upb_json_parser *p, upb_wellknowntype_t type) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- (upb_msgdef_wellknowntype(upb_fielddef_msgsubdef(p->top->f))
- == type);
-}
-
-static bool does_number_wrapper_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- upb_msgdef_isnumberwrapper(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_number_wrapper_end(upb_json_parser *p) {
- return p->top->m != NULL && upb_msgdef_isnumberwrapper(p->top->m);
-}
-
-static bool is_number_wrapper_object(upb_json_parser *p) {
- return p->top->m != NULL && upb_msgdef_isnumberwrapper(p->top->m);
-}
-
-static bool does_string_wrapper_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- is_string_wrapper(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_string_wrapper_end(upb_json_parser *p) {
- return p->top->m != NULL && is_string_wrapper(p->top->m);
-}
-
-static bool is_string_wrapper_object(upb_json_parser *p) {
- return p->top->m != NULL && is_string_wrapper(p->top->m);
-}
-
-static bool does_fieldmask_start(upb_json_parser *p) {
- return p->top->f != NULL &&
- upb_fielddef_issubmsg(p->top->f) &&
- is_fieldmask(upb_fielddef_msgsubdef(p->top->f));
-}
-
-static bool does_fieldmask_end(upb_json_parser *p) {
- return p->top->m != NULL && is_fieldmask(p->top->m);
-}
-
-#define CHECK_RETURN_TOP(x) if (!(x)) goto error
-
-
-/* The actual parser **********************************************************/
-
-/* What follows is the Ragel parser itself. The language is specified in Ragel
- * and the actions call our C functions above.
- *
- * Ragel has an extensive set of functionality, and we use only a small part of
- * it. There are many action types but we only use a few:
- *
- * ">" -- transition into a machine
- * "%" -- transition out of a machine
- * "@" -- transition into a final state of a machine.
- *
- * "@" transitions are tricky because a machine can transition into a final
- * state repeatedly. But in some cases we know this can't happen, for example
- * a string which is delimited by a final '"' can only transition into its
- * final state once, when the closing '"' is seen. */
-
-%%{
- machine json;
-
- ws = space*;
-
- integer = "0" | /[1-9]/ /[0-9]/*;
- decimal = "." /[0-9]/+;
- exponent = /[eE]/ /[+\-]/? /[0-9]/+;
-
- number_machine :=
- ("-"? integer decimal? exponent?)
- %/{ fhold; fret; }
- <: any
- >{ fhold; fret; }
- ;
- number = /[0-9\-]/ >{ fhold; fcall number_machine; };
-
- text =
- /[^\\"]/+
- >{ start_text(parser, p); }
- %{ CHECK_RETURN_TOP(end_text(parser, p)); }
- ;
-
- unicode_char =
- "\\u"
- /[0-9A-Fa-f]/{4}
- >{ start_hex(parser); }
- ${ hexdigit(parser, p); }
- %{ CHECK_RETURN_TOP(end_hex(parser)); }
- ;
-
- escape_char =
- "\\"
- /[rtbfn"\/\\]/
- >{ CHECK_RETURN_TOP(escape(parser, p)); }
- ;
-
- string_machine :=
- (text | unicode_char | escape_char)**
- '"'
- @{ fhold; fret; }
- ;
-
- year =
- (digit digit digit digit)
- >{ start_year(parser, p); }
- %{ CHECK_RETURN_TOP(end_year(parser, p)); }
- ;
- month =
- (digit digit)
- >{ start_month(parser, p); }
- %{ CHECK_RETURN_TOP(end_month(parser, p)); }
- ;
- day =
- (digit digit)
- >{ start_day(parser, p); }
- %{ CHECK_RETURN_TOP(end_day(parser, p)); }
- ;
- hour =
- (digit digit)
- >{ start_hour(parser, p); }
- %{ CHECK_RETURN_TOP(end_hour(parser, p)); }
- ;
- minute =
- (digit digit)
- >{ start_minute(parser, p); }
- %{ CHECK_RETURN_TOP(end_minute(parser, p)); }
- ;
- second =
- (digit digit)
- >{ start_second(parser, p); }
- %{ CHECK_RETURN_TOP(end_second(parser, p)); }
- ;
-
- duration_machine :=
- ("-"? integer decimal?)
- >{ start_duration_base(parser, p); }
- %{ CHECK_RETURN_TOP(end_duration_base(parser, p)); }
- 's"'
- @{ fhold; fret; }
- ;
-
- timestamp_machine :=
- (year "-" month "-" day "T" hour ":" minute ":" second)
- >{ start_timestamp_base(parser); }
- ("." digit+)?
- >{ start_timestamp_fraction(parser, p); }
- %{ CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
- ([+\-] digit digit ":00" | "Z")
- >{ start_timestamp_zone(parser, p); }
- %{ CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
- '"'
- @{ fhold; fret; }
- ;
-
- fieldmask_path_text =
- /[^",]/+
- >{ start_fieldmask_path_text(parser, p); }
- %{ end_fieldmask_path_text(parser, p); }
- ;
-
- fieldmask_path =
- fieldmask_path_text
- >{ start_fieldmask_path(parser); }
- %{ end_fieldmask_path(parser); }
- ;
-
- fieldmask_machine :=
- (fieldmask_path ("," fieldmask_path)*)?
- '"'
- @{ fhold; fret; }
- ;
-
- string =
- '"'
- @{
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
- fcall timestamp_machine;
- } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_DURATION)) {
- fcall duration_machine;
- } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_FIELDMASK)) {
- fcall fieldmask_machine;
- } else {
- fcall string_machine;
- }
- }
- '"';
-
- value2 = ^(space | "]" | "}") >{ fhold; fcall value_machine; } ;
-
- member =
- ws
- string
- >{
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- start_any_member(parser, p);
- } else {
- start_member(parser);
- }
- }
- @{ CHECK_RETURN_TOP(end_membername(parser)); }
- ws ":" ws
- value2
- %{
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- end_any_member(parser, p);
- } else {
- end_member(parser);
- }
- }
- ws;
-
- object =
- ("{" ws)
- >{
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- start_any_object(parser, p);
- } else {
- start_object(parser);
- }
- }
- (member ("," member)*)?
- "}"
- >{
- if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
- CHECK_RETURN_TOP(end_any_object(parser, p));
- } else {
- end_object(parser);
- }
- }
- ;
-
- element = ws value2 ws;
- array =
- "["
- >{ CHECK_RETURN_TOP(start_array(parser)); }
- ws
- (element ("," element)*)?
- "]"
- >{ end_array(parser); }
- ;
-
- value =
- number
- >{ CHECK_RETURN_TOP(start_number(parser, p)); }
- %{ CHECK_RETURN_TOP(end_number(parser, p)); }
- | string
- >{ CHECK_RETURN_TOP(start_stringval(parser)); }
- @{ CHECK_RETURN_TOP(end_stringval(parser)); }
- | "true"
- %{ CHECK_RETURN_TOP(end_bool(parser, true)); }
- | "false"
- %{ CHECK_RETURN_TOP(end_bool(parser, false)); }
- | "null"
- %{ CHECK_RETURN_TOP(end_null(parser)); }
- | object
- >{ CHECK_RETURN_TOP(start_subobject_full(parser)); }
- %{ end_subobject_full(parser); }
- | array;
-
- value_machine :=
- value
- <: any >{ fhold; fret; } ;
-
- main := ws value ws;
-}%%
-
-%% write data noerror nofinal;
-
-size_t parse(void *closure, const void *hd, const char *buf, size_t size,
- const upb_bufhandle *handle) {
- upb_json_parser *parser = closure;
-
- /* Variables used by Ragel's generated code. */
- int cs = parser->current_state;
- int *stack = parser->parser_stack;
- int top = parser->parser_top;
-
- const char *p = buf;
- const char *pe = buf + size;
- const char *eof = &eof_ch;
-
- parser->handle = handle;
-
- UPB_UNUSED(hd);
- UPB_UNUSED(handle);
-
- capture_resume(parser, buf);
-
- %% write exec;
-
- if (p != pe) {
- upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
- } else {
- capture_suspend(parser, &p);
- }
-
-error:
- /* Save parsing state back to parser. */
- parser->current_state = cs;
- parser->parser_top = top;
-
- return p - buf;
-}
-
-static bool end(void *closure, const void *hd) {
- upb_json_parser *parser = closure;
-
- /* Prevent compile warning on unused static constants. */
- UPB_UNUSED(json_start);
- UPB_UNUSED(json_en_duration_machine);
- UPB_UNUSED(json_en_fieldmask_machine);
- UPB_UNUSED(json_en_number_machine);
- UPB_UNUSED(json_en_string_machine);
- UPB_UNUSED(json_en_timestamp_machine);
- UPB_UNUSED(json_en_value_machine);
- UPB_UNUSED(json_en_main);
-
- parse(parser, hd, &eof_ch, 0, NULL);
-
- return parser->current_state >= %%{ write first_final; }%%;
-}
-
-static void json_parser_reset(upb_json_parser *p) {
- int cs;
- int top;
-
- p->top = p->stack;
- init_frame(p->top);
-
- /* Emit Ragel initialization of the parser. */
- %% write init;
- p->current_state = cs;
- p->parser_top = top;
- accumulate_clear(p);
- p->multipart_state = MULTIPART_INACTIVE;
- p->capture = NULL;
- p->accumulated = NULL;
-}
-
-static upb_json_parsermethod *parsermethod_new(upb_json_codecache *c,
- const upb_msgdef *md) {
- int i, n;
- upb_alloc *alloc = upb_arena_alloc(c->arena);
-
- upb_json_parsermethod *m = upb_malloc(alloc, sizeof(*m));
-
- m->cache = c;
-
- upb_byteshandler_init(&m->input_handler_);
- upb_byteshandler_setstring(&m->input_handler_, parse, m);
- upb_byteshandler_setendstr(&m->input_handler_, end, m);
-
- upb_strtable_init2(&m->name_table, UPB_CTYPE_CONSTPTR, 4, alloc);
-
- /* Build name_table */
-
- n = upb_msgdef_fieldcount(md);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
- upb_value v = upb_value_constptr(f);
- const char *name;
-
- /* Add an entry for the JSON name. */
- name = upb_fielddef_jsonname(f);
- upb_strtable_insert3(&m->name_table, name, strlen(name), v, alloc);
-
- if (strcmp(name, upb_fielddef_name(f)) != 0) {
- /* Since the JSON name is different from the regular field name, add an
- * entry for the raw name (compliant proto3 JSON parsers must accept
- * both). */
- const char *name = upb_fielddef_name(f);
- upb_strtable_insert3(&m->name_table, name, strlen(name), v, alloc);
- }
- }
-
- return m;
-}
-
-/* Public API *****************************************************************/
-
-upb_json_parser *upb_json_parser_create(upb_arena *arena,
- const upb_json_parsermethod *method,
- const upb_symtab* symtab,
- upb_sink output,
- upb_status *status,
- bool ignore_json_unknown) {
- upb_json_parser *p = upb_arena_malloc(arena, sizeof(upb_json_parser));
- if (!p) return false;
-
- p->arena = arena;
- p->method = method;
- p->status = status;
- p->limit = p->stack + UPB_JSON_MAX_DEPTH;
- p->accumulate_buf = NULL;
- p->accumulate_buf_size = 0;
- upb_bytessink_reset(&p->input_, &method->input_handler_, p);
-
- json_parser_reset(p);
- p->top->sink = output;
- p->top->m = upb_handlers_msgdef(output.handlers);
- if (is_wellknown_msg(p, UPB_WELLKNOWN_ANY)) {
- p->top->is_any = true;
- p->top->any_frame = json_parser_any_frame_new(p);
- } else {
- p->top->is_any = false;
- p->top->any_frame = NULL;
- }
- set_name_table(p, p->top);
- p->symtab = symtab;
-
- p->ignore_json_unknown = ignore_json_unknown;
-
- return p;
-}
-
-upb_bytessink upb_json_parser_input(upb_json_parser *p) {
- return p->input_;
-}
-
-const upb_byteshandler *upb_json_parsermethod_inputhandler(
- const upb_json_parsermethod *m) {
- return &m->input_handler_;
-}
-
-upb_json_codecache *upb_json_codecache_new(void) {
- upb_alloc *alloc;
- upb_json_codecache *c;
-
- c = upb_gmalloc(sizeof(*c));
-
- c->arena = upb_arena_new();
- alloc = upb_arena_alloc(c->arena);
-
- upb_inttable_init2(&c->methods, UPB_CTYPE_CONSTPTR, alloc);
-
- return c;
-}
-
-void upb_json_codecache_free(upb_json_codecache *c) {
- upb_arena_free(c->arena);
- upb_gfree(c);
-}
-
-const upb_json_parsermethod *upb_json_codecache_get(upb_json_codecache *c,
- const upb_msgdef *md) {
- upb_json_parsermethod *m;
- upb_value v;
- int i, n;
- upb_alloc *alloc = upb_arena_alloc(c->arena);
-
- if (upb_inttable_lookupptr(&c->methods, md, &v)) {
- return upb_value_getconstptr(v);
- }
-
- m = parsermethod_new(c, md);
- v = upb_value_constptr(m);
-
- if (!m) return NULL;
- if (!upb_inttable_insertptr2(&c->methods, md, v, alloc)) return NULL;
-
- /* Populate parser methods for all submessages, so the name tables will
- * be available during parsing. */
- n = upb_msgdef_fieldcount(md);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
-
- if (upb_fielddef_issubmsg(f)) {
- const upb_msgdef *subdef = upb_fielddef_msgsubdef(f);
- const upb_json_parsermethod *sub_method =
- upb_json_codecache_get(c, subdef);
-
- if (!sub_method) return NULL;
- }
- }
-
- return m;
-}
diff --git a/grpc/third_party/upb/upb/json/printer.c b/grpc/third_party/upb/upb/json/printer.c
deleted file mode 100644
index 2f0c8fb6..00000000
--- a/grpc/third_party/upb/upb/json/printer.c
+++ /dev/null
@@ -1,1396 +0,0 @@
-/*
-** This currently uses snprintf() to format primitives, and could be optimized
-** further.
-*/
-
-#include "upb/json/printer.h"
-
-#include <ctype.h>
-#include <inttypes.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-#include "upb/port_def.inc"
-
-struct upb_json_printer {
- upb_sink input_;
- /* BytesSink closure. */
- void *subc_;
- upb_bytessink output_;
-
- /* We track the depth so that we know when to emit startstr/endstr on the
- * output. */
- int depth_;
-
- /* Have we emitted the first element? This state is necessary to emit commas
- * without leaving a trailing comma in arrays/maps. We keep this state per
- * frame depth.
- *
- * Why max_depth * 2? UPB_MAX_HANDLER_DEPTH counts depth as nested messages.
- * We count frames (contexts in which we separate elements by commas) as both
- * repeated fields and messages (maps), and the worst case is a
- * message->repeated field->submessage->repeated field->... nesting. */
- bool first_elem_[UPB_MAX_HANDLER_DEPTH * 2];
-
- /* To print timestamp, printer needs to cache its seconds and nanos values
- * and convert them when ending timestamp message. See comments of
- * printer_sethandlers_timestamp for more detail. */
- int64_t seconds;
- int32_t nanos;
-};
-
-/* StringPiece; a pointer plus a length. */
-typedef struct {
- char *ptr;
- size_t len;
-} strpc;
-
-void freestrpc(void *ptr) {
- strpc *pc = ptr;
- upb_gfree(pc->ptr);
- upb_gfree(pc);
-}
-
-typedef struct {
- bool preserve_fieldnames;
-} upb_json_printercache;
-
-/* Convert fielddef name to JSON name and return as a string piece. */
-strpc *newstrpc(upb_handlers *h, const upb_fielddef *f,
- bool preserve_fieldnames) {
- /* TODO(haberman): handle malloc failure. */
- strpc *ret = upb_gmalloc(sizeof(*ret));
- if (preserve_fieldnames) {
- ret->ptr = upb_gstrdup(upb_fielddef_name(f));
- ret->len = strlen(ret->ptr);
- } else {
- ret->ptr = upb_gstrdup(upb_fielddef_jsonname(f));
- ret->len = strlen(ret->ptr);
- }
-
- upb_handlers_addcleanup(h, ret, freestrpc);
- return ret;
-}
-
-/* Convert a null-terminated const char* to a string piece. */
-strpc *newstrpc_str(upb_handlers *h, const char * str) {
- strpc * ret = upb_gmalloc(sizeof(*ret));
- ret->ptr = upb_gstrdup(str);
- ret->len = strlen(str);
- upb_handlers_addcleanup(h, ret, freestrpc);
- return ret;
-}
-
-/* ------------ JSON string printing: values, maps, arrays ------------------ */
-
-static void print_data(
- upb_json_printer *p, const char *buf, size_t len) {
- /* TODO: Will need to change if we support pushback from the sink. */
- size_t n = upb_bytessink_putbuf(p->output_, p->subc_, buf, len, NULL);
- UPB_ASSERT(n == len);
-}
-
-static void print_comma(upb_json_printer *p) {
- if (!p->first_elem_[p->depth_]) {
- print_data(p, ",", 1);
- }
- p->first_elem_[p->depth_] = false;
-}
-
-/* Helpers that print properly formatted elements to the JSON output stream. */
-
-/* Used for escaping control chars in strings. */
-static const char kControlCharLimit = 0x20;
-
-UPB_INLINE bool is_json_escaped(char c) {
- /* See RFC 4627. */
- unsigned char uc = (unsigned char)c;
- return uc < kControlCharLimit || uc == '"' || uc == '\\';
-}
-
-UPB_INLINE const char* json_nice_escape(char c) {
- switch (c) {
- case '"': return "\\\"";
- case '\\': return "\\\\";
- case '\b': return "\\b";
- case '\f': return "\\f";
- case '\n': return "\\n";
- case '\r': return "\\r";
- case '\t': return "\\t";
- default: return NULL;
- }
-}
-
-/* Write a properly escaped string chunk. The surrounding quotes are *not*
- * printed; this is so that the caller has the option of emitting the string
- * content in chunks. */
-static void putstring(upb_json_printer *p, const char *buf, size_t len) {
- const char* unescaped_run = NULL;
- unsigned int i;
- for (i = 0; i < len; i++) {
- char c = buf[i];
- /* Handle escaping. */
- if (is_json_escaped(c)) {
- /* Use a "nice" escape, like \n, if one exists for this character. */
- const char* escape = json_nice_escape(c);
- /* If we don't have a specific 'nice' escape code, use a \uXXXX-style
- * escape. */
- char escape_buf[8];
- if (!escape) {
- unsigned char byte = (unsigned char)c;
- snprintf(escape_buf, sizeof(escape_buf), "\\u%04x", (int)byte);
- escape = escape_buf;
- }
-
- /* N.B. that we assume that the input encoding is equal to the output
- * encoding (both UTF-8 for now), so for chars >= 0x20 and != \, ", we
- * can simply pass the bytes through. */
-
- /* If there's a current run of unescaped chars, print that run first. */
- if (unescaped_run) {
- print_data(p, unescaped_run, &buf[i] - unescaped_run);
- unescaped_run = NULL;
- }
- /* Then print the escape code. */
- print_data(p, escape, strlen(escape));
- } else {
- /* Add to the current unescaped run of characters. */
- if (unescaped_run == NULL) {
- unescaped_run = &buf[i];
- }
- }
- }
-
- /* If the string ended in a run of unescaped characters, print that last run. */
- if (unescaped_run) {
- print_data(p, unescaped_run, &buf[len] - unescaped_run);
- }
-}
-
-#define CHKLENGTH(x) if (!(x)) return -1;
-
-/* Helpers that format floating point values according to our custom formats.
- * Right now we use %.8g and %.17g for float/double, respectively, to match
- * proto2::util::JsonFormat's defaults. May want to change this later. */
-
-const char neginf[] = "\"-Infinity\"";
-const char inf[] = "\"Infinity\"";
-
-static size_t fmt_double(double val, char* buf, size_t length) {
- if (val == INFINITY) {
- CHKLENGTH(length >= strlen(inf));
- strcpy(buf, inf);
- return strlen(inf);
- } else if (val == -INFINITY) {
- CHKLENGTH(length >= strlen(neginf));
- strcpy(buf, neginf);
- return strlen(neginf);
- } else {
- size_t n = snprintf(buf, length, "%.17g", val);
- CHKLENGTH(n > 0 && n < length);
- return n;
- }
-}
-
-static size_t fmt_float(float val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "%.8g", val);
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-static size_t fmt_bool(bool val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "%s", (val ? "true" : "false"));
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-static size_t fmt_int64_as_number(int64_t val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "%" PRId64, val);
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-static size_t fmt_uint64_as_number(uint64_t val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "%" PRIu64, val);
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-static size_t fmt_int64_as_string(int64_t val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "\"%" PRId64 "\"", val);
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-static size_t fmt_uint64_as_string(uint64_t val, char* buf, size_t length) {
- size_t n = snprintf(buf, length, "\"%" PRIu64 "\"", val);
- CHKLENGTH(n > 0 && n < length);
- return n;
-}
-
-/* Print a map key given a field name. Called by scalar field handlers and by
- * startseq for repeated fields. */
-static bool putkey(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- const strpc *key = handler_data;
- print_comma(p);
- print_data(p, "\"", 1);
- putstring(p, key->ptr, key->len);
- print_data(p, "\":", 2);
- return true;
-}
-
-#define CHKFMT(val) if ((val) == (size_t)-1) return false;
-#define CHK(val) if (!(val)) return false;
-
-#define TYPE_HANDLERS(type, fmt_func) \
- static bool put##type(void *closure, const void *handler_data, type val) { \
- upb_json_printer *p = closure; \
- char data[64]; \
- size_t length = fmt_func(val, data, sizeof(data)); \
- UPB_UNUSED(handler_data); \
- CHKFMT(length); \
- print_data(p, data, length); \
- return true; \
- } \
- static bool scalar_##type(void *closure, const void *handler_data, \
- type val) { \
- CHK(putkey(closure, handler_data)); \
- CHK(put##type(closure, handler_data, val)); \
- return true; \
- } \
- static bool repeated_##type(void *closure, const void *handler_data, \
- type val) { \
- upb_json_printer *p = closure; \
- print_comma(p); \
- CHK(put##type(closure, handler_data, val)); \
- return true; \
- }
-
-#define TYPE_HANDLERS_MAPKEY(type, fmt_func) \
- static bool putmapkey_##type(void *closure, const void *handler_data, \
- type val) { \
- upb_json_printer *p = closure; \
- char data[64]; \
- size_t length = fmt_func(val, data, sizeof(data)); \
- UPB_UNUSED(handler_data); \
- print_data(p, "\"", 1); \
- print_data(p, data, length); \
- print_data(p, "\":", 2); \
- return true; \
- }
-
-TYPE_HANDLERS(double, fmt_double)
-TYPE_HANDLERS(float, fmt_float)
-TYPE_HANDLERS(bool, fmt_bool)
-TYPE_HANDLERS(int32_t, fmt_int64_as_number)
-TYPE_HANDLERS(uint32_t, fmt_int64_as_number)
-TYPE_HANDLERS(int64_t, fmt_int64_as_string)
-TYPE_HANDLERS(uint64_t, fmt_uint64_as_string)
-
-/* double and float are not allowed to be map keys. */
-TYPE_HANDLERS_MAPKEY(bool, fmt_bool)
-TYPE_HANDLERS_MAPKEY(int32_t, fmt_int64_as_number)
-TYPE_HANDLERS_MAPKEY(uint32_t, fmt_int64_as_number)
-TYPE_HANDLERS_MAPKEY(int64_t, fmt_int64_as_number)
-TYPE_HANDLERS_MAPKEY(uint64_t, fmt_uint64_as_number)
-
-#undef TYPE_HANDLERS
-#undef TYPE_HANDLERS_MAPKEY
-
-typedef struct {
- void *keyname;
- const upb_enumdef *enumdef;
-} EnumHandlerData;
-
-static bool scalar_enum(void *closure, const void *handler_data,
- int32_t val) {
- const EnumHandlerData *hd = handler_data;
- upb_json_printer *p = closure;
- const char *symbolic_name;
-
- CHK(putkey(closure, hd->keyname));
-
- symbolic_name = upb_enumdef_iton(hd->enumdef, val);
- if (symbolic_name) {
- print_data(p, "\"", 1);
- putstring(p, symbolic_name, strlen(symbolic_name));
- print_data(p, "\"", 1);
- } else {
- putint32_t(closure, NULL, val);
- }
-
- return true;
-}
-
-static void print_enum_symbolic_name(upb_json_printer *p,
- const upb_enumdef *def,
- int32_t val) {
- const char *symbolic_name = upb_enumdef_iton(def, val);
- if (symbolic_name) {
- print_data(p, "\"", 1);
- putstring(p, symbolic_name, strlen(symbolic_name));
- print_data(p, "\"", 1);
- } else {
- putint32_t(p, NULL, val);
- }
-}
-
-static bool repeated_enum(void *closure, const void *handler_data,
- int32_t val) {
- const EnumHandlerData *hd = handler_data;
- upb_json_printer *p = closure;
- print_comma(p);
-
- print_enum_symbolic_name(p, hd->enumdef, val);
-
- return true;
-}
-
-static bool mapvalue_enum(void *closure, const void *handler_data,
- int32_t val) {
- const EnumHandlerData *hd = handler_data;
- upb_json_printer *p = closure;
-
- print_enum_symbolic_name(p, hd->enumdef, val);
-
- return true;
-}
-
-static void *scalar_startsubmsg(void *closure, const void *handler_data) {
- return putkey(closure, handler_data) ? closure : UPB_BREAK;
-}
-
-static void *repeated_startsubmsg(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_comma(p);
- return closure;
-}
-
-static void start_frame(upb_json_printer *p) {
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- print_data(p, "{", 1);
-}
-
-static void end_frame(upb_json_printer *p) {
- print_data(p, "}", 1);
- p->depth_--;
-}
-
-static bool printer_startmsg(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- if (p->depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc_);
- }
- start_frame(p);
- return true;
-}
-
-static bool printer_endmsg(void *closure, const void *handler_data, upb_status *s) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(s);
- end_frame(p);
- if (p->depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
- return true;
-}
-
-static void *startseq(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- CHK(putkey(closure, handler_data));
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- print_data(p, "[", 1);
- return closure;
-}
-
-static bool endseq(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "]", 1);
- p->depth_--;
- return true;
-}
-
-static void *startmap(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- CHK(putkey(closure, handler_data));
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- print_data(p, "{", 1);
- return closure;
-}
-
-static bool endmap(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "}", 1);
- p->depth_--;
- return true;
-}
-
-static size_t putstr(void *closure, const void *handler_data, const char *str,
- size_t len, const upb_bufhandle *handle) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(handle);
- putstring(p, str, len);
- return len;
-}
-
-/* This has to Base64 encode the bytes, because JSON has no "bytes" type. */
-static size_t putbytes(void *closure, const void *handler_data, const char *str,
- size_t len, const upb_bufhandle *handle) {
- upb_json_printer *p = closure;
-
- /* This is the regular base64, not the "web-safe" version. */
- static const char base64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- /* Base64-encode. */
- char data[16000];
- const char *limit = data + sizeof(data);
- const unsigned char *from = (const unsigned char*)str;
- char *to = data;
- size_t remaining = len;
- size_t bytes;
-
- UPB_UNUSED(handler_data);
- UPB_UNUSED(handle);
-
- print_data(p, "\"", 1);
-
- while (remaining > 2) {
- if (limit - to < 4) {
- bytes = to - data;
- putstring(p, data, bytes);
- to = data;
- }
-
- to[0] = base64[from[0] >> 2];
- to[1] = base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
- to[2] = base64[((from[1] & 0xf) << 2) | (from[2] >> 6)];
- to[3] = base64[from[2] & 0x3f];
-
- remaining -= 3;
- to += 4;
- from += 3;
- }
-
- switch (remaining) {
- case 2:
- to[0] = base64[from[0] >> 2];
- to[1] = base64[((from[0] & 0x3) << 4) | (from[1] >> 4)];
- to[2] = base64[(from[1] & 0xf) << 2];
- to[3] = '=';
- to += 4;
- from += 2;
- break;
- case 1:
- to[0] = base64[from[0] >> 2];
- to[1] = base64[((from[0] & 0x3) << 4)];
- to[2] = '=';
- to[3] = '=';
- to += 4;
- from += 1;
- break;
- }
-
- bytes = to - data;
- putstring(p, data, bytes);
- print_data(p, "\"", 1);
- return len;
-}
-
-static void *scalar_startstr(void *closure, const void *handler_data,
- size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(size_hint);
- CHK(putkey(closure, handler_data));
- print_data(p, "\"", 1);
- return p;
-}
-
-static size_t scalar_str(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- CHK(putstr(closure, handler_data, str, len, handle));
- return len;
-}
-
-static bool scalar_endstr(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "\"", 1);
- return true;
-}
-
-static void *repeated_startstr(void *closure, const void *handler_data,
- size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(size_hint);
- print_comma(p);
- print_data(p, "\"", 1);
- return p;
-}
-
-static size_t repeated_str(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- CHK(putstr(closure, handler_data, str, len, handle));
- return len;
-}
-
-static bool repeated_endstr(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "\"", 1);
- return true;
-}
-
-static void *mapkeyval_startstr(void *closure, const void *handler_data,
- size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(size_hint);
- print_data(p, "\"", 1);
- return p;
-}
-
-static size_t mapkey_str(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- CHK(putstr(closure, handler_data, str, len, handle));
- return len;
-}
-
-static bool mapkey_endstr(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "\":", 2);
- return true;
-}
-
-static bool mapvalue_endstr(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- print_data(p, "\"", 1);
- return true;
-}
-
-static size_t scalar_bytes(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- CHK(putkey(closure, handler_data));
- CHK(putbytes(closure, handler_data, str, len, handle));
- return len;
-}
-
-static size_t repeated_bytes(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- upb_json_printer *p = closure;
- print_comma(p);
- CHK(putbytes(closure, handler_data, str, len, handle));
- return len;
-}
-
-static size_t mapkey_bytes(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- upb_json_printer *p = closure;
- CHK(putbytes(closure, handler_data, str, len, handle));
- print_data(p, ":", 1);
- return len;
-}
-
-static void set_enum_hd(upb_handlers *h,
- const upb_fielddef *f,
- bool preserve_fieldnames,
- upb_handlerattr *attr) {
- EnumHandlerData *hd = upb_gmalloc(sizeof(EnumHandlerData));
- hd->enumdef = upb_fielddef_enumsubdef(f);
- hd->keyname = newstrpc(h, f, preserve_fieldnames);
- upb_handlers_addcleanup(h, hd, upb_gfree);
- attr->handler_data = hd;
-}
-
-/* Set up handlers for a mapentry submessage (i.e., an individual key/value pair
- * in a map).
- *
- * TODO: Handle missing key, missing value, out-of-order key/value, or repeated
- * key or value cases properly. The right way to do this is to allocate a
- * temporary structure at the start of a mapentry submessage, store key and
- * value data in it as key and value handlers are called, and then print the
- * key/value pair once at the end of the submessage. If we don't do this, we
- * should at least detect the case and throw an error. However, so far all of
- * our sources that emit mapentry messages do so canonically (with one key
- * field, and then one value field), so this is not a pressing concern at the
- * moment. */
-void printer_sethandlers_mapentry(const void *closure, bool preserve_fieldnames,
- upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
-
- /* A mapentry message is printed simply as '"key": value'. Rather than
- * special-case key and value for every type below, we just handle both
- * fields explicitly here. */
- const upb_fielddef* key_field = upb_msgdef_itof(md, UPB_MAPENTRY_KEY);
- const upb_fielddef* value_field = upb_msgdef_itof(md, UPB_MAPENTRY_VALUE);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- UPB_UNUSED(closure);
-
- switch (upb_fielddef_type(key_field)) {
- case UPB_TYPE_INT32:
- upb_handlers_setint32(h, key_field, putmapkey_int32_t, &empty_attr);
- break;
- case UPB_TYPE_INT64:
- upb_handlers_setint64(h, key_field, putmapkey_int64_t, &empty_attr);
- break;
- case UPB_TYPE_UINT32:
- upb_handlers_setuint32(h, key_field, putmapkey_uint32_t, &empty_attr);
- break;
- case UPB_TYPE_UINT64:
- upb_handlers_setuint64(h, key_field, putmapkey_uint64_t, &empty_attr);
- break;
- case UPB_TYPE_BOOL:
- upb_handlers_setbool(h, key_field, putmapkey_bool, &empty_attr);
- break;
- case UPB_TYPE_STRING:
- upb_handlers_setstartstr(h, key_field, mapkeyval_startstr, &empty_attr);
- upb_handlers_setstring(h, key_field, mapkey_str, &empty_attr);
- upb_handlers_setendstr(h, key_field, mapkey_endstr, &empty_attr);
- break;
- case UPB_TYPE_BYTES:
- upb_handlers_setstring(h, key_field, mapkey_bytes, &empty_attr);
- break;
- default:
- UPB_ASSERT(false);
- break;
- }
-
- switch (upb_fielddef_type(value_field)) {
- case UPB_TYPE_INT32:
- upb_handlers_setint32(h, value_field, putint32_t, &empty_attr);
- break;
- case UPB_TYPE_INT64:
- upb_handlers_setint64(h, value_field, putint64_t, &empty_attr);
- break;
- case UPB_TYPE_UINT32:
- upb_handlers_setuint32(h, value_field, putuint32_t, &empty_attr);
- break;
- case UPB_TYPE_UINT64:
- upb_handlers_setuint64(h, value_field, putuint64_t, &empty_attr);
- break;
- case UPB_TYPE_BOOL:
- upb_handlers_setbool(h, value_field, putbool, &empty_attr);
- break;
- case UPB_TYPE_FLOAT:
- upb_handlers_setfloat(h, value_field, putfloat, &empty_attr);
- break;
- case UPB_TYPE_DOUBLE:
- upb_handlers_setdouble(h, value_field, putdouble, &empty_attr);
- break;
- case UPB_TYPE_STRING:
- upb_handlers_setstartstr(h, value_field, mapkeyval_startstr, &empty_attr);
- upb_handlers_setstring(h, value_field, putstr, &empty_attr);
- upb_handlers_setendstr(h, value_field, mapvalue_endstr, &empty_attr);
- break;
- case UPB_TYPE_BYTES:
- upb_handlers_setstring(h, value_field, putbytes, &empty_attr);
- break;
- case UPB_TYPE_ENUM: {
- upb_handlerattr enum_attr = UPB_HANDLERATTR_INIT;
- set_enum_hd(h, value_field, preserve_fieldnames, &enum_attr);
- upb_handlers_setint32(h, value_field, mapvalue_enum, &enum_attr);
- break;
- }
- case UPB_TYPE_MESSAGE:
- /* No handler necessary -- the submsg handlers will print the message
- * as appropriate. */
- break;
- }
-}
-
-static bool putseconds(void *closure, const void *handler_data,
- int64_t seconds) {
- upb_json_printer *p = closure;
- p->seconds = seconds;
- UPB_UNUSED(handler_data);
- return true;
-}
-
-static bool putnanos(void *closure, const void *handler_data,
- int32_t nanos) {
- upb_json_printer *p = closure;
- p->nanos = nanos;
- UPB_UNUSED(handler_data);
- return true;
-}
-
-static void *scalar_startstr_nokey(void *closure, const void *handler_data,
- size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(size_hint);
- print_data(p, "\"", 1);
- return p;
-}
-
-static size_t putstr_nokey(void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(handle);
- print_data(p, "\"", 1);
- putstring(p, str, len);
- print_data(p, "\"", 1);
- return len + 2;
-}
-
-static void *startseq_nokey(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- print_data(p, "[", 1);
- return closure;
-}
-
-static void *startseq_fieldmask(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- return closure;
-}
-
-static bool endseq_fieldmask(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- p->depth_--;
- return true;
-}
-
-static void *repeated_startstr_fieldmask(
- void *closure, const void *handler_data,
- size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(size_hint);
- print_comma(p);
- return p;
-}
-
-static size_t repeated_str_fieldmask(
- void *closure, const void *handler_data,
- const char *str, size_t len,
- const upb_bufhandle *handle) {
- const char* limit = str + len;
- bool upper = false;
- size_t result_len = 0;
- for (; str < limit; str++) {
- if (*str == '_') {
- upper = true;
- continue;
- }
- if (upper && *str >= 'a' && *str <= 'z') {
- char upper_char = toupper(*str);
- CHK(putstr(closure, handler_data, &upper_char, 1, handle));
- } else {
- CHK(putstr(closure, handler_data, str, 1, handle));
- }
- upper = false;
- result_len++;
- }
- return result_len;
-}
-
-static void *startmap_nokey(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- p->depth_++;
- p->first_elem_[p->depth_] = true;
- print_data(p, "{", 1);
- return closure;
-}
-
-static bool putnull(void *closure, const void *handler_data,
- int32_t null) {
- upb_json_printer *p = closure;
- print_data(p, "null", 4);
- UPB_UNUSED(handler_data);
- UPB_UNUSED(null);
- return true;
-}
-
-static bool printer_startdurationmsg(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- if (p->depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc_);
- }
- return true;
-}
-
-#define UPB_DURATION_MAX_JSON_LEN 23
-#define UPB_DURATION_MAX_NANO_LEN 9
-
-static bool printer_enddurationmsg(void *closure, const void *handler_data,
- upb_status *s) {
- upb_json_printer *p = closure;
- char buffer[UPB_DURATION_MAX_JSON_LEN];
- size_t base_len;
- size_t curr;
- size_t i;
-
- memset(buffer, 0, UPB_DURATION_MAX_JSON_LEN);
-
- if (p->seconds < -315576000000) {
- upb_status_seterrf(s, "error parsing duration: "
- "minimum acceptable value is "
- "-315576000000");
- return false;
- }
-
- if (p->seconds > 315576000000) {
- upb_status_seterrf(s, "error serializing duration: "
- "maximum acceptable value is "
- "315576000000");
- return false;
- }
-
- snprintf(buffer, sizeof(buffer), "%ld", (long)p->seconds);
- base_len = strlen(buffer);
-
- if (p->nanos != 0) {
- char nanos_buffer[UPB_DURATION_MAX_NANO_LEN + 3];
- snprintf(nanos_buffer, sizeof(nanos_buffer), "%.9f",
- p->nanos / 1000000000.0);
- /* Remove trailing 0. */
- for (i = UPB_DURATION_MAX_NANO_LEN + 2;
- nanos_buffer[i] == '0'; i--) {
- nanos_buffer[i] = 0;
- }
- strcpy(buffer + base_len, nanos_buffer + 1);
- }
-
- curr = strlen(buffer);
- strcpy(buffer + curr, "s");
-
- p->seconds = 0;
- p->nanos = 0;
-
- print_data(p, "\"", 1);
- print_data(p, buffer, strlen(buffer));
- print_data(p, "\"", 1);
-
- if (p->depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
-
- UPB_UNUSED(handler_data);
- return true;
-}
-
-static bool printer_starttimestampmsg(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- if (p->depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc_);
- }
- return true;
-}
-
-#define UPB_TIMESTAMP_MAX_JSON_LEN 31
-#define UPB_TIMESTAMP_BEFORE_NANO_LEN 19
-#define UPB_TIMESTAMP_MAX_NANO_LEN 9
-
-static bool printer_endtimestampmsg(void *closure, const void *handler_data,
- upb_status *s) {
- upb_json_printer *p = closure;
- char buffer[UPB_TIMESTAMP_MAX_JSON_LEN];
- time_t time = p->seconds;
- size_t curr;
- size_t i;
- size_t year_length =
- strftime(buffer, UPB_TIMESTAMP_MAX_JSON_LEN, "%Y", gmtime(&time));
-
- if (p->seconds < -62135596800) {
- upb_status_seterrf(s, "error parsing timestamp: "
- "minimum acceptable value is "
- "0001-01-01T00:00:00Z");
- return false;
- }
-
- if (p->seconds > 253402300799) {
- upb_status_seterrf(s, "error parsing timestamp: "
- "maximum acceptable value is "
- "9999-12-31T23:59:59Z");
- return false;
- }
-
- /* strftime doesn't guarantee 4 digits for year. Prepend 0 by ourselves. */
- for (i = 0; i < 4 - year_length; i++) {
- buffer[i] = '0';
- }
-
- strftime(buffer + (4 - year_length), UPB_TIMESTAMP_MAX_JSON_LEN,
- "%Y-%m-%dT%H:%M:%S", gmtime(&time));
- if (p->nanos != 0) {
- char nanos_buffer[UPB_TIMESTAMP_MAX_NANO_LEN + 3];
- snprintf(nanos_buffer, sizeof(nanos_buffer), "%.9f",
- p->nanos / 1000000000.0);
- /* Remove trailing 0. */
- for (i = UPB_TIMESTAMP_MAX_NANO_LEN + 2;
- nanos_buffer[i] == '0'; i--) {
- nanos_buffer[i] = 0;
- }
- strcpy(buffer + UPB_TIMESTAMP_BEFORE_NANO_LEN, nanos_buffer + 1);
- }
-
- curr = strlen(buffer);
- strcpy(buffer + curr, "Z");
-
- p->seconds = 0;
- p->nanos = 0;
-
- print_data(p, "\"", 1);
- print_data(p, buffer, strlen(buffer));
- print_data(p, "\"", 1);
-
- if (p->depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
-
- UPB_UNUSED(handler_data);
- UPB_UNUSED(s);
- return true;
-}
-
-static bool printer_startmsg_noframe(void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- if (p->depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc_);
- }
- return true;
-}
-
-static bool printer_endmsg_noframe(
- void *closure, const void *handler_data, upb_status *s) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(s);
- if (p->depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
- return true;
-}
-
-static bool printer_startmsg_fieldmask(
- void *closure, const void *handler_data) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- if (p->depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc_);
- }
- print_data(p, "\"", 1);
- return true;
-}
-
-static bool printer_endmsg_fieldmask(
- void *closure, const void *handler_data, upb_status *s) {
- upb_json_printer *p = closure;
- UPB_UNUSED(handler_data);
- UPB_UNUSED(s);
- print_data(p, "\"", 1);
- if (p->depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
- return true;
-}
-
-static void *scalar_startstr_onlykey(
- void *closure, const void *handler_data, size_t size_hint) {
- upb_json_printer *p = closure;
- UPB_UNUSED(size_hint);
- CHK(putkey(closure, handler_data));
- return p;
-}
-
-/* Set up handlers for an Any submessage. */
-void printer_sethandlers_any(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
-
- const upb_fielddef* type_field = upb_msgdef_itof(md, UPB_ANY_TYPE);
- const upb_fielddef* value_field = upb_msgdef_itof(md, UPB_ANY_VALUE);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- /* type_url's json name is "@type" */
- upb_handlerattr type_name_attr = UPB_HANDLERATTR_INIT;
- upb_handlerattr value_name_attr = UPB_HANDLERATTR_INIT;
- strpc *type_url_json_name = newstrpc_str(h, "@type");
- strpc *value_json_name = newstrpc_str(h, "value");
-
- type_name_attr.handler_data = type_url_json_name;
- value_name_attr.handler_data = value_json_name;
-
- /* Set up handlers. */
- upb_handlers_setstartmsg(h, printer_startmsg, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg, &empty_attr);
-
- upb_handlers_setstartstr(h, type_field, scalar_startstr, &type_name_attr);
- upb_handlers_setstring(h, type_field, scalar_str, &empty_attr);
- upb_handlers_setendstr(h, type_field, scalar_endstr, &empty_attr);
-
- /* This is not the full and correct JSON encoding for the Any value field. It
- * requires further processing by the wrapper code based on the type URL.
- */
- upb_handlers_setstartstr(h, value_field, scalar_startstr_onlykey,
- &value_name_attr);
-
- UPB_UNUSED(closure);
-}
-
-/* Set up handlers for a fieldmask submessage. */
-void printer_sethandlers_fieldmask(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
- const upb_fielddef* f = upb_msgdef_itof(md, 1);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartseq(h, f, startseq_fieldmask, &empty_attr);
- upb_handlers_setendseq(h, f, endseq_fieldmask, &empty_attr);
-
- upb_handlers_setstartmsg(h, printer_startmsg_fieldmask, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg_fieldmask, &empty_attr);
-
- upb_handlers_setstartstr(h, f, repeated_startstr_fieldmask, &empty_attr);
- upb_handlers_setstring(h, f, repeated_str_fieldmask, &empty_attr);
-
- UPB_UNUSED(closure);
-}
-
-/* Set up handlers for a duration submessage. */
-void printer_sethandlers_duration(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
-
- const upb_fielddef* seconds_field =
- upb_msgdef_itof(md, UPB_DURATION_SECONDS);
- const upb_fielddef* nanos_field =
- upb_msgdef_itof(md, UPB_DURATION_NANOS);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartmsg(h, printer_startdurationmsg, &empty_attr);
- upb_handlers_setint64(h, seconds_field, putseconds, &empty_attr);
- upb_handlers_setint32(h, nanos_field, putnanos, &empty_attr);
- upb_handlers_setendmsg(h, printer_enddurationmsg, &empty_attr);
-
- UPB_UNUSED(closure);
-}
-
-/* Set up handlers for a timestamp submessage. Instead of printing fields
- * separately, the json representation of timestamp follows RFC 3339 */
-void printer_sethandlers_timestamp(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
-
- const upb_fielddef* seconds_field =
- upb_msgdef_itof(md, UPB_TIMESTAMP_SECONDS);
- const upb_fielddef* nanos_field =
- upb_msgdef_itof(md, UPB_TIMESTAMP_NANOS);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartmsg(h, printer_starttimestampmsg, &empty_attr);
- upb_handlers_setint64(h, seconds_field, putseconds, &empty_attr);
- upb_handlers_setint32(h, nanos_field, putnanos, &empty_attr);
- upb_handlers_setendmsg(h, printer_endtimestampmsg, &empty_attr);
-
- UPB_UNUSED(closure);
-}
-
-void printer_sethandlers_value(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
- int i, n;
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartmsg(h, printer_startmsg_noframe, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg_noframe, &empty_attr);
-
- n = upb_msgdef_fieldcount(md);
- for (i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
-
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_ENUM:
- upb_handlers_setint32(h, f, putnull, &empty_attr);
- break;
- case UPB_TYPE_DOUBLE:
- upb_handlers_setdouble(h, f, putdouble, &empty_attr);
- break;
- case UPB_TYPE_STRING:
- upb_handlers_setstartstr(h, f, scalar_startstr_nokey, &empty_attr);
- upb_handlers_setstring(h, f, scalar_str, &empty_attr);
- upb_handlers_setendstr(h, f, scalar_endstr, &empty_attr);
- break;
- case UPB_TYPE_BOOL:
- upb_handlers_setbool(h, f, putbool, &empty_attr);
- break;
- case UPB_TYPE_MESSAGE:
- break;
- default:
- UPB_ASSERT(false);
- break;
- }
- }
-
- UPB_UNUSED(closure);
-}
-
-#define WRAPPER_SETHANDLERS(wrapper, type, putmethod) \
-void printer_sethandlers_##wrapper(const void *closure, upb_handlers *h) { \
- const upb_msgdef *md = upb_handlers_msgdef(h); \
- const upb_fielddef* f = upb_msgdef_itof(md, 1); \
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT; \
- upb_handlers_setstartmsg(h, printer_startmsg_noframe, &empty_attr); \
- upb_handlers_setendmsg(h, printer_endmsg_noframe, &empty_attr); \
- upb_handlers_set##type(h, f, putmethod, &empty_attr); \
- UPB_UNUSED(closure); \
-}
-
-WRAPPER_SETHANDLERS(doublevalue, double, putdouble)
-WRAPPER_SETHANDLERS(floatvalue, float, putfloat)
-WRAPPER_SETHANDLERS(int64value, int64, putint64_t)
-WRAPPER_SETHANDLERS(uint64value, uint64, putuint64_t)
-WRAPPER_SETHANDLERS(int32value, int32, putint32_t)
-WRAPPER_SETHANDLERS(uint32value, uint32, putuint32_t)
-WRAPPER_SETHANDLERS(boolvalue, bool, putbool)
-WRAPPER_SETHANDLERS(stringvalue, string, putstr_nokey)
-WRAPPER_SETHANDLERS(bytesvalue, string, putbytes)
-
-#undef WRAPPER_SETHANDLERS
-
-void printer_sethandlers_listvalue(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
- const upb_fielddef* f = upb_msgdef_itof(md, 1);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartseq(h, f, startseq_nokey, &empty_attr);
- upb_handlers_setendseq(h, f, endseq, &empty_attr);
-
- upb_handlers_setstartmsg(h, printer_startmsg_noframe, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg_noframe, &empty_attr);
-
- upb_handlers_setstartsubmsg(h, f, repeated_startsubmsg, &empty_attr);
-
- UPB_UNUSED(closure);
-}
-
-void printer_sethandlers_structvalue(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
- const upb_fielddef* f = upb_msgdef_itof(md, 1);
-
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
-
- upb_handlers_setstartseq(h, f, startmap_nokey, &empty_attr);
- upb_handlers_setendseq(h, f, endmap, &empty_attr);
-
- upb_handlers_setstartmsg(h, printer_startmsg_noframe, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg_noframe, &empty_attr);
-
- upb_handlers_setstartsubmsg(h, f, repeated_startsubmsg, &empty_attr);
-
- UPB_UNUSED(closure);
-}
-
-void printer_sethandlers(const void *closure, upb_handlers *h) {
- const upb_msgdef *md = upb_handlers_msgdef(h);
- bool is_mapentry = upb_msgdef_mapentry(md);
- upb_handlerattr empty_attr = UPB_HANDLERATTR_INIT;
- int i, n;
- const upb_json_printercache *cache = closure;
- const bool preserve_fieldnames = cache->preserve_fieldnames;
-
- if (is_mapentry) {
- /* mapentry messages are sufficiently different that we handle them
- * separately. */
- printer_sethandlers_mapentry(closure, preserve_fieldnames, h);
- return;
- }
-
- switch (upb_msgdef_wellknowntype(md)) {
- case UPB_WELLKNOWN_UNSPECIFIED:
- break;
- case UPB_WELLKNOWN_ANY:
- printer_sethandlers_any(closure, h);
- return;
- case UPB_WELLKNOWN_FIELDMASK:
- printer_sethandlers_fieldmask(closure, h);
- return;
- case UPB_WELLKNOWN_DURATION:
- printer_sethandlers_duration(closure, h);
- return;
- case UPB_WELLKNOWN_TIMESTAMP:
- printer_sethandlers_timestamp(closure, h);
- return;
- case UPB_WELLKNOWN_VALUE:
- printer_sethandlers_value(closure, h);
- return;
- case UPB_WELLKNOWN_LISTVALUE:
- printer_sethandlers_listvalue(closure, h);
- return;
- case UPB_WELLKNOWN_STRUCT:
- printer_sethandlers_structvalue(closure, h);
- return;
-#define WRAPPER(wellknowntype, name) \
- case wellknowntype: \
- printer_sethandlers_##name(closure, h); \
- return; \
-
- WRAPPER(UPB_WELLKNOWN_DOUBLEVALUE, doublevalue);
- WRAPPER(UPB_WELLKNOWN_FLOATVALUE, floatvalue);
- WRAPPER(UPB_WELLKNOWN_INT64VALUE, int64value);
- WRAPPER(UPB_WELLKNOWN_UINT64VALUE, uint64value);
- WRAPPER(UPB_WELLKNOWN_INT32VALUE, int32value);
- WRAPPER(UPB_WELLKNOWN_UINT32VALUE, uint32value);
- WRAPPER(UPB_WELLKNOWN_BOOLVALUE, boolvalue);
- WRAPPER(UPB_WELLKNOWN_STRINGVALUE, stringvalue);
- WRAPPER(UPB_WELLKNOWN_BYTESVALUE, bytesvalue);
-
-#undef WRAPPER
- }
-
- upb_handlers_setstartmsg(h, printer_startmsg, &empty_attr);
- upb_handlers_setendmsg(h, printer_endmsg, &empty_attr);
-
-#define TYPE(type, name, ctype) \
- case type: \
- if (upb_fielddef_isseq(f)) { \
- upb_handlers_set##name(h, f, repeated_##ctype, &empty_attr); \
- } else { \
- upb_handlers_set##name(h, f, scalar_##ctype, &name_attr); \
- } \
- break;
-
- n = upb_msgdef_fieldcount(md);
- for (i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
-
- upb_handlerattr name_attr = UPB_HANDLERATTR_INIT;
- name_attr.handler_data = newstrpc(h, f, preserve_fieldnames);
-
- if (upb_fielddef_ismap(f)) {
- upb_handlers_setstartseq(h, f, startmap, &name_attr);
- upb_handlers_setendseq(h, f, endmap, &name_attr);
- } else if (upb_fielddef_isseq(f)) {
- upb_handlers_setstartseq(h, f, startseq, &name_attr);
- upb_handlers_setendseq(h, f, endseq, &empty_attr);
- }
-
- switch (upb_fielddef_type(f)) {
- TYPE(UPB_TYPE_FLOAT, float, float);
- TYPE(UPB_TYPE_DOUBLE, double, double);
- TYPE(UPB_TYPE_BOOL, bool, bool);
- TYPE(UPB_TYPE_INT32, int32, int32_t);
- TYPE(UPB_TYPE_UINT32, uint32, uint32_t);
- TYPE(UPB_TYPE_INT64, int64, int64_t);
- TYPE(UPB_TYPE_UINT64, uint64, uint64_t);
- case UPB_TYPE_ENUM: {
- /* For now, we always emit symbolic names for enums. We may want an
- * option later to control this behavior, but we will wait for a real
- * need first. */
- upb_handlerattr enum_attr = UPB_HANDLERATTR_INIT;
- set_enum_hd(h, f, preserve_fieldnames, &enum_attr);
-
- if (upb_fielddef_isseq(f)) {
- upb_handlers_setint32(h, f, repeated_enum, &enum_attr);
- } else {
- upb_handlers_setint32(h, f, scalar_enum, &enum_attr);
- }
-
- break;
- }
- case UPB_TYPE_STRING:
- if (upb_fielddef_isseq(f)) {
- upb_handlers_setstartstr(h, f, repeated_startstr, &empty_attr);
- upb_handlers_setstring(h, f, repeated_str, &empty_attr);
- upb_handlers_setendstr(h, f, repeated_endstr, &empty_attr);
- } else {
- upb_handlers_setstartstr(h, f, scalar_startstr, &name_attr);
- upb_handlers_setstring(h, f, scalar_str, &empty_attr);
- upb_handlers_setendstr(h, f, scalar_endstr, &empty_attr);
- }
- break;
- case UPB_TYPE_BYTES:
- /* XXX: this doesn't support strings that span buffers yet. The base64
- * encoder will need to be made resumable for this to work properly. */
- if (upb_fielddef_isseq(f)) {
- upb_handlers_setstring(h, f, repeated_bytes, &empty_attr);
- } else {
- upb_handlers_setstring(h, f, scalar_bytes, &name_attr);
- }
- break;
- case UPB_TYPE_MESSAGE:
- if (upb_fielddef_isseq(f)) {
- upb_handlers_setstartsubmsg(h, f, repeated_startsubmsg, &name_attr);
- } else {
- upb_handlers_setstartsubmsg(h, f, scalar_startsubmsg, &name_attr);
- }
- break;
- }
- }
-
-#undef TYPE
-}
-
-static void json_printer_reset(upb_json_printer *p) {
- p->depth_ = 0;
-}
-
-
-/* Public API *****************************************************************/
-
-upb_json_printer *upb_json_printer_create(upb_arena *a, const upb_handlers *h,
- upb_bytessink output) {
- upb_json_printer *p = upb_arena_malloc(a, sizeof(upb_json_printer));
- if (!p) return NULL;
-
- p->output_ = output;
- json_printer_reset(p);
- upb_sink_reset(&p->input_, h, p);
- p->seconds = 0;
- p->nanos = 0;
-
- return p;
-}
-
-upb_sink upb_json_printer_input(upb_json_printer *p) {
- return p->input_;
-}
-
-upb_handlercache *upb_json_printer_newcache(bool preserve_proto_fieldnames) {
- upb_json_printercache *cache = upb_gmalloc(sizeof(*cache));
- upb_handlercache *ret = upb_handlercache_new(printer_sethandlers, cache);
-
- cache->preserve_fieldnames = preserve_proto_fieldnames;
- upb_handlercache_addcleanup(ret, cache, upb_gfree);
-
- return ret;
-}
diff --git a/grpc/third_party/upb/upb/json/printer.h b/grpc/third_party/upb/upb/json/printer.h
deleted file mode 100644
index 85b9b128..00000000
--- a/grpc/third_party/upb/upb/json/printer.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-** upb::json::Printer
-**
-** Handlers that emit JSON according to a specific protobuf schema.
-*/
-
-#ifndef UPB_JSON_TYPED_PRINTER_H_
-#define UPB_JSON_TYPED_PRINTER_H_
-
-#include "upb/sink.h"
-
-#ifdef __cplusplus
-namespace upb {
-namespace json {
-class PrinterPtr;
-} /* namespace json */
-} /* namespace upb */
-#endif
-
-/* upb_json_printer ***********************************************************/
-
-#define UPB_JSON_PRINTER_SIZE 192
-
-struct upb_json_printer;
-typedef struct upb_json_printer upb_json_printer;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Native C API. */
-upb_json_printer *upb_json_printer_create(upb_arena *a, const upb_handlers *h,
- upb_bytessink output);
-upb_sink upb_json_printer_input(upb_json_printer *p);
-const upb_handlers *upb_json_printer_newhandlers(const upb_msgdef *md,
- bool preserve_fieldnames,
- const void *owner);
-
-/* Lazily builds and caches handlers that will push encoded data to a bytessink.
- * Any msgdef objects used with this object must outlive it. */
-upb_handlercache *upb_json_printer_newcache(bool preserve_proto_fieldnames);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* Prints an incoming stream of data to a BytesSink in JSON format. */
-class upb::json::PrinterPtr {
- public:
- PrinterPtr(upb_json_printer* ptr) : ptr_(ptr) {}
-
- static PrinterPtr Create(Arena *arena, const upb::Handlers *handlers,
- BytesSink output) {
- return PrinterPtr(
- upb_json_printer_create(arena->ptr(), handlers, output.sink()));
- }
-
- /* The input to the printer. */
- Sink input() { return upb_json_printer_input(ptr_); }
-
- static const size_t kSize = UPB_JSON_PRINTER_SIZE;
-
- static HandlerCache NewCache(bool preserve_proto_fieldnames) {
- return upb_json_printer_newcache(preserve_proto_fieldnames);
- }
-
- private:
- upb_json_printer* ptr_;
-};
-
-#endif /* __cplusplus */
-
-#endif /* UPB_JSON_TYPED_PRINTER_H_ */
diff --git a/grpc/third_party/upb/upb/json_decode.c b/grpc/third_party/upb/upb/json_decode.c
index bb337443..c4698f03 100644
--- a/grpc/third_party/upb/upb/json_decode.c
+++ b/grpc/third_party/upb/upb/json_decode.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/json_decode.h"
@@ -18,61 +44,64 @@
typedef struct {
const char *ptr, *end;
- upb_arena *arena; /* TODO: should we have a tmp arena for tmp data? */
- const upb_symtab *any_pool;
+ upb_Arena* arena; /* TODO: should we have a tmp arena for tmp data? */
+ const upb_DefPool* symtab;
int depth;
- upb_status *status;
+ upb_Status* status;
jmp_buf err;
int line;
- const char *line_begin;
+ const char* line_begin;
bool is_first;
int options;
- const upb_fielddef *debug_field;
+ const upb_FieldDef* debug_field;
} jsondec;
enum { JD_OBJECT, JD_ARRAY, JD_STRING, JD_NUMBER, JD_TRUE, JD_FALSE, JD_NULL };
/* Forward declarations of mutually-recursive functions. */
-static void jsondec_wellknown(jsondec *d, upb_msg *msg, const upb_msgdef *m);
-static upb_msgval jsondec_value(jsondec *d, const upb_fielddef *f);
-static void jsondec_wellknownvalue(jsondec *d, upb_msg *msg,
- const upb_msgdef *m);
-static void jsondec_object(jsondec *d, upb_msg *msg, const upb_msgdef *m);
-
-static bool jsondec_streql(upb_strview str, const char *lit) {
+static void jsondec_wellknown(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m);
+static upb_MessageValue jsondec_value(jsondec* d, const upb_FieldDef* f);
+static void jsondec_wellknownvalue(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m);
+static void jsondec_object(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m);
+
+static bool jsondec_streql(upb_StringView str, const char* lit) {
return str.size == strlen(lit) && memcmp(str.data, lit, str.size) == 0;
}
-static bool jsondec_isnullvalue(const upb_fielddef *f) {
- return upb_fielddef_type(f) == UPB_TYPE_ENUM &&
- strcmp(upb_enumdef_fullname(upb_fielddef_enumsubdef(f)),
+static bool jsondec_isnullvalue(const upb_FieldDef* f) {
+ return upb_FieldDef_CType(f) == kUpb_CType_Enum &&
+ strcmp(upb_EnumDef_FullName(upb_FieldDef_EnumSubDef(f)),
"google.protobuf.NullValue") == 0;
}
-static bool jsondec_isvalue(const upb_fielddef *f) {
- return (upb_fielddef_type(f) == UPB_TYPE_MESSAGE &&
- upb_msgdef_wellknowntype(upb_fielddef_msgsubdef(f)) ==
- UPB_WELLKNOWN_VALUE) ||
+static bool jsondec_isvalue(const upb_FieldDef* f) {
+ return (upb_FieldDef_CType(f) == kUpb_CType_Message &&
+ upb_MessageDef_WellKnownType(upb_FieldDef_MessageSubDef(f)) ==
+ kUpb_WellKnown_Value) ||
jsondec_isnullvalue(f);
}
-UPB_NORETURN static void jsondec_err(jsondec *d, const char *msg) {
- upb_status_seterrf(d->status, "Error parsing JSON @%d:%d: %s", d->line,
- (int)(d->ptr - d->line_begin), msg);
+UPB_NORETURN static void jsondec_err(jsondec* d, const char* msg) {
+ upb_Status_SetErrorFormat(d->status, "Error parsing JSON @%d:%d: %s", d->line,
+ (int)(d->ptr - d->line_begin), msg);
UPB_LONGJMP(d->err, 1);
}
-UPB_NORETURN static void jsondec_errf(jsondec *d, const char *fmt, ...) {
+UPB_PRINTF(2, 3)
+UPB_NORETURN static void jsondec_errf(jsondec* d, const char* fmt, ...) {
va_list argp;
- upb_status_seterrf(d->status, "Error parsing JSON @%d:%d: ", d->line,
- (int)(d->ptr - d->line_begin));
+ upb_Status_SetErrorFormat(d->status, "Error parsing JSON @%d:%d: ", d->line,
+ (int)(d->ptr - d->line_begin));
va_start(argp, fmt);
- upb_status_vappenderrf(d->status, fmt, argp);
+ upb_Status_VAppendErrorFormat(d->status, fmt, argp);
va_end(argp);
UPB_LONGJMP(d->err, 1);
}
-static void jsondec_skipws(jsondec *d) {
+static void jsondec_skipws(jsondec* d) {
while (d->ptr != d->end) {
switch (*d->ptr) {
case '\n':
@@ -91,13 +120,13 @@ static void jsondec_skipws(jsondec *d) {
jsondec_err(d, "Unexpected EOF");
}
-static bool jsondec_tryparsech(jsondec *d, char ch) {
+static bool jsondec_tryparsech(jsondec* d, char ch) {
if (d->ptr == d->end || *d->ptr != ch) return false;
d->ptr++;
return true;
}
-static void jsondec_parselit(jsondec *d, const char *lit) {
+static void jsondec_parselit(jsondec* d, const char* lit) {
size_t avail = d->end - d->ptr;
size_t len = strlen(lit);
if (avail < len || memcmp(d->ptr, lit, len) != 0) {
@@ -106,23 +135,23 @@ static void jsondec_parselit(jsondec *d, const char *lit) {
d->ptr += len;
}
-static void jsondec_wsch(jsondec *d, char ch) {
+static void jsondec_wsch(jsondec* d, char ch) {
jsondec_skipws(d);
if (!jsondec_tryparsech(d, ch)) {
jsondec_errf(d, "Expected: '%c'", ch);
}
}
-static void jsondec_true(jsondec *d) { jsondec_parselit(d, "true"); }
-static void jsondec_false(jsondec *d) { jsondec_parselit(d, "false"); }
-static void jsondec_null(jsondec *d) { jsondec_parselit(d, "null"); }
+static void jsondec_true(jsondec* d) { jsondec_parselit(d, "true"); }
+static void jsondec_false(jsondec* d) { jsondec_parselit(d, "false"); }
+static void jsondec_null(jsondec* d) { jsondec_parselit(d, "null"); }
-static void jsondec_entrysep(jsondec *d) {
+static void jsondec_entrysep(jsondec* d) {
jsondec_skipws(d);
jsondec_parselit(d, ":");
}
-static int jsondec_rawpeek(jsondec *d) {
+static int jsondec_rawpeek(jsondec* d) {
switch (*d->ptr) {
case '{':
return JD_OBJECT;
@@ -163,19 +192,19 @@ static int jsondec_rawpeek(jsondec *d) {
* }
* jsondec_objend(d) */
-static int jsondec_peek(jsondec *d) {
+static int jsondec_peek(jsondec* d) {
jsondec_skipws(d);
return jsondec_rawpeek(d);
}
-static void jsondec_push(jsondec *d) {
+static void jsondec_push(jsondec* d) {
if (--d->depth < 0) {
jsondec_err(d, "Recursion limit exceeded");
}
d->is_first = true;
}
-static bool jsondec_seqnext(jsondec *d, char end_ch) {
+static bool jsondec_seqnext(jsondec* d, char end_ch) {
bool is_first = d->is_first;
d->is_first = false;
jsondec_skipws(d);
@@ -184,31 +213,29 @@ static bool jsondec_seqnext(jsondec *d, char end_ch) {
return true;
}
-static void jsondec_arrstart(jsondec *d) {
+static void jsondec_arrstart(jsondec* d) {
jsondec_push(d);
jsondec_wsch(d, '[');
}
-static void jsondec_arrend(jsondec *d) {
+static void jsondec_arrend(jsondec* d) {
d->depth++;
jsondec_wsch(d, ']');
}
-static bool jsondec_arrnext(jsondec *d) {
- return jsondec_seqnext(d, ']');
-}
+static bool jsondec_arrnext(jsondec* d) { return jsondec_seqnext(d, ']'); }
-static void jsondec_objstart(jsondec *d) {
+static void jsondec_objstart(jsondec* d) {
jsondec_push(d);
jsondec_wsch(d, '{');
}
-static void jsondec_objend(jsondec *d) {
+static void jsondec_objend(jsondec* d) {
d->depth++;
jsondec_wsch(d, '}');
}
-static bool jsondec_objnext(jsondec *d) {
+static bool jsondec_objnext(jsondec* d) {
if (!jsondec_seqnext(d, '}')) return false;
if (jsondec_peek(d) != JD_STRING) {
jsondec_err(d, "Object must start with string");
@@ -218,8 +245,8 @@ static bool jsondec_objnext(jsondec *d) {
/* JSON number ****************************************************************/
-static bool jsondec_tryskipdigits(jsondec *d) {
- const char *start = d->ptr;
+static bool jsondec_tryskipdigits(jsondec* d) {
+ const char* start = d->ptr;
while (d->ptr < d->end) {
if (*d->ptr < '0' || *d->ptr > '9') {
@@ -231,14 +258,14 @@ static bool jsondec_tryskipdigits(jsondec *d) {
return d->ptr != start;
}
-static void jsondec_skipdigits(jsondec *d) {
+static void jsondec_skipdigits(jsondec* d) {
if (!jsondec_tryskipdigits(d)) {
jsondec_err(d, "Expected one or more digits");
}
}
-static double jsondec_number(jsondec *d) {
- const char *start = d->ptr;
+static double jsondec_number(jsondec* d) {
+ const char* start = d->ptr;
assert(jsondec_rawpeek(d) == JD_NUMBER);
@@ -298,7 +325,7 @@ parse:
/* JSON string ****************************************************************/
-static char jsondec_escape(jsondec *d) {
+static char jsondec_escape(jsondec* d) {
switch (*d->ptr++) {
case '"':
return '\"';
@@ -321,9 +348,9 @@ static char jsondec_escape(jsondec *d) {
}
}
-static uint32_t jsondec_codepoint(jsondec *d) {
+static uint32_t jsondec_codepoint(jsondec* d) {
uint32_t cp = 0;
- const char *end;
+ const char* end;
if (d->end - d->ptr < 4) {
jsondec_err(d, "EOF inside string");
@@ -348,7 +375,7 @@ static uint32_t jsondec_codepoint(jsondec *d) {
}
/* Parses a \uXXXX unicode escape (possibly a surrogate pair). */
-static size_t jsondec_unicode(jsondec *d, char* out) {
+static size_t jsondec_unicode(jsondec* d, char* out) {
uint32_t cp = jsondec_codepoint(d);
if (cp >= 0xd800 && cp <= 0xdbff) {
/* Surrogate pair: two 16-bit codepoints become a 32-bit codepoint. */
@@ -390,22 +417,22 @@ static size_t jsondec_unicode(jsondec *d, char* out) {
}
}
-static void jsondec_resize(jsondec *d, char **buf, char **end, char **buf_end) {
+static void jsondec_resize(jsondec* d, char** buf, char** end, char** buf_end) {
size_t oldsize = *buf_end - *buf;
size_t len = *end - *buf;
size_t size = UPB_MAX(8, 2 * oldsize);
- *buf = upb_arena_realloc(d->arena, *buf, len, size);
+ *buf = upb_Arena_Realloc(d->arena, *buf, len, size);
if (!*buf) jsondec_err(d, "Out of memory");
*end = *buf + len;
*buf_end = *buf + size;
}
-static upb_strview jsondec_string(jsondec *d) {
- char *buf = NULL;
- char *end = NULL;
- char *buf_end = NULL;
+static upb_StringView jsondec_string(jsondec* d) {
+ char* buf = NULL;
+ char* end = NULL;
+ char* buf_end = NULL;
jsondec_skipws(d);
@@ -422,10 +449,10 @@ static upb_strview jsondec_string(jsondec *d) {
switch (ch) {
case '"': {
- upb_strview ret;
+ upb_StringView ret;
ret.data = buf;
ret.size = end - buf;
- *end = '\0'; /* Needed for possible strtod(). */
+ *end = '\0'; /* Needed for possible strtod(). */
return ret;
}
case '\\':
@@ -454,7 +481,7 @@ eof:
jsondec_err(d, "EOF inside string");
}
-static void jsondec_skipval(jsondec *d) {
+static void jsondec_skipval(jsondec* d) {
switch (jsondec_peek(d)) {
case JD_OBJECT:
jsondec_objstart(d);
@@ -537,8 +564,8 @@ static unsigned int jsondec_base64_tablelookup(const char ch) {
return table[(unsigned)ch];
}
-static char *jsondec_partialbase64(jsondec *d, const char *ptr, const char *end,
- char *out) {
+static char* jsondec_partialbase64(jsondec* d, const char* ptr, const char* end,
+ char* out) {
int32_t val = -1;
switch (end - ptr) {
@@ -565,13 +592,13 @@ static char *jsondec_partialbase64(jsondec *d, const char *ptr, const char *end,
return out;
}
-static size_t jsondec_base64(jsondec *d, upb_strview str) {
+static size_t jsondec_base64(jsondec* d, upb_StringView str) {
/* We decode in place. This is safe because this is a new buffer (not
* aliasing the input) and because base64 decoding shrinks 4 bytes into 3. */
- char *out = (char*)str.data;
- const char *ptr = str.data;
- const char *end = ptr + str.size;
- const char *end4 = ptr + (str.size & -4); /* Round down to multiple of 4. */
+ char* out = (char*)str.data;
+ const char* ptr = str.data;
+ const char* end = ptr + str.size;
+ const char* end4 = ptr + (str.size & -4); /* Round down to multiple of 4. */
for (; ptr < end4; ptr += 4, out += 3) {
int val = jsondec_base64_tablelookup(ptr[0]) << 18 |
@@ -609,8 +636,8 @@ static size_t jsondec_base64(jsondec *d, upb_strview str) {
/* We use these hand-written routines instead of strto[u]l() because the "long
* long" variants aren't in c89. Also our version allows setting a ptr limit. */
-static const char *jsondec_buftouint64(jsondec *d, const char *ptr,
- const char *end, uint64_t *val) {
+static const char* jsondec_buftouint64(jsondec* d, const char* ptr,
+ const char* end, uint64_t* val) {
uint64_t u64 = 0;
while (ptr < end) {
unsigned ch = *ptr - '0';
@@ -627,8 +654,8 @@ static const char *jsondec_buftouint64(jsondec *d, const char *ptr,
return ptr;
}
-static const char *jsondec_buftoint64(jsondec *d, const char *ptr,
- const char *end, int64_t *val) {
+static const char* jsondec_buftoint64(jsondec* d, const char* ptr,
+ const char* end, int64_t* val) {
bool neg = false;
uint64_t u64;
@@ -646,8 +673,8 @@ static const char *jsondec_buftoint64(jsondec *d, const char *ptr,
return ptr;
}
-static uint64_t jsondec_strtouint64(jsondec *d, upb_strview str) {
- const char *end = str.data + str.size;
+static uint64_t jsondec_strtouint64(jsondec* d, upb_StringView str) {
+ const char* end = str.data + str.size;
uint64_t ret;
if (jsondec_buftouint64(d, str.data, end, &ret) != end) {
jsondec_err(d, "Non-number characters in quoted integer");
@@ -655,8 +682,8 @@ static uint64_t jsondec_strtouint64(jsondec *d, upb_strview str) {
return ret;
}
-static int64_t jsondec_strtoint64(jsondec *d, upb_strview str) {
- const char *end = str.data + str.size;
+static int64_t jsondec_strtoint64(jsondec* d, upb_StringView str) {
+ const char* end = str.data + str.size;
int64_t ret;
if (jsondec_buftoint64(d, str.data, end, &ret) != end) {
jsondec_err(d, "Non-number characters in quoted integer");
@@ -667,8 +694,8 @@ static int64_t jsondec_strtoint64(jsondec *d, upb_strview str) {
/* Primitive value types ******************************************************/
/* Parse INT32 or INT64 value. */
-static upb_msgval jsondec_int(jsondec *d, const upb_fielddef *f) {
- upb_msgval val;
+static upb_MessageValue jsondec_int(jsondec* d, const upb_FieldDef* f) {
+ upb_MessageValue val;
switch (jsondec_peek(d)) {
case JD_NUMBER: {
@@ -676,15 +703,15 @@ static upb_msgval jsondec_int(jsondec *d, const upb_fielddef *f) {
if (dbl > 9223372036854774784.0 || dbl < -9223372036854775808.0) {
jsondec_err(d, "JSON number is out of range.");
}
- val.int64_val = dbl; /* must be guarded, overflow here is UB */
+ val.int64_val = dbl; /* must be guarded, overflow here is UB */
if (val.int64_val != dbl) {
- jsondec_errf(d, "JSON number was not integral (%d != %" PRId64 ")", dbl,
+ jsondec_errf(d, "JSON number was not integral (%f != %" PRId64 ")", dbl,
val.int64_val);
}
break;
}
case JD_STRING: {
- upb_strview str = jsondec_string(d);
+ upb_StringView str = jsondec_string(d);
val.int64_val = jsondec_strtoint64(d, str);
break;
}
@@ -692,7 +719,8 @@ static upb_msgval jsondec_int(jsondec *d, const upb_fielddef *f) {
jsondec_err(d, "Expected number or string");
}
- if (upb_fielddef_type(f) == UPB_TYPE_INT32) {
+ if (upb_FieldDef_CType(f) == kUpb_CType_Int32 ||
+ upb_FieldDef_CType(f) == kUpb_CType_Enum) {
if (val.int64_val > INT32_MAX || val.int64_val < INT32_MIN) {
jsondec_err(d, "Integer out of range.");
}
@@ -703,8 +731,8 @@ static upb_msgval jsondec_int(jsondec *d, const upb_fielddef *f) {
}
/* Parse UINT32 or UINT64 value. */
-static upb_msgval jsondec_uint(jsondec *d, const upb_fielddef *f) {
- upb_msgval val;
+static upb_MessageValue jsondec_uint(jsondec* d, const upb_FieldDef* f) {
+ upb_MessageValue val = {0};
switch (jsondec_peek(d)) {
case JD_NUMBER: {
@@ -712,15 +740,15 @@ static upb_msgval jsondec_uint(jsondec *d, const upb_fielddef *f) {
if (dbl > 18446744073709549568.0 || dbl < 0) {
jsondec_err(d, "JSON number is out of range.");
}
- val.uint64_val = dbl; /* must be guarded, overflow here is UB */
+ val.uint64_val = dbl; /* must be guarded, overflow here is UB */
if (val.uint64_val != dbl) {
- jsondec_errf(d, "JSON number was not integral (%d != %" PRIu64 ")", dbl,
+ jsondec_errf(d, "JSON number was not integral (%f != %" PRIu64 ")", dbl,
val.uint64_val);
}
break;
}
case JD_STRING: {
- upb_strview str = jsondec_string(d);
+ upb_StringView str = jsondec_string(d);
val.uint64_val = jsondec_strtouint64(d, str);
break;
}
@@ -728,7 +756,7 @@ static upb_msgval jsondec_uint(jsondec *d, const upb_fielddef *f) {
jsondec_err(d, "Expected number or string");
}
- if (upb_fielddef_type(f) == UPB_TYPE_UINT32) {
+ if (upb_FieldDef_CType(f) == kUpb_CType_UInt32) {
if (val.uint64_val > UINT32_MAX) {
jsondec_err(d, "Integer out of range.");
}
@@ -739,9 +767,9 @@ static upb_msgval jsondec_uint(jsondec *d, const upb_fielddef *f) {
}
/* Parse DOUBLE or FLOAT value. */
-static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) {
- upb_strview str;
- upb_msgval val;
+static upb_MessageValue jsondec_double(jsondec* d, const upb_FieldDef* f) {
+ upb_StringView str;
+ upb_MessageValue val = {0};
switch (jsondec_peek(d)) {
case JD_NUMBER:
@@ -763,7 +791,7 @@ static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) {
jsondec_err(d, "Expected number or string");
}
- if (upb_fielddef_type(f) == UPB_TYPE_FLOAT) {
+ if (upb_FieldDef_CType(f) == kUpb_CType_Float) {
if (val.double_val != INFINITY && val.double_val != -INFINITY &&
(val.double_val > FLT_MAX || val.double_val < -FLT_MAX)) {
jsondec_err(d, "Float out of range");
@@ -775,34 +803,38 @@ static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) {
}
/* Parse STRING or BYTES value. */
-static upb_msgval jsondec_strfield(jsondec *d, const upb_fielddef *f) {
- upb_msgval val;
+static upb_MessageValue jsondec_strfield(jsondec* d, const upb_FieldDef* f) {
+ upb_MessageValue val;
val.str_val = jsondec_string(d);
- if (upb_fielddef_type(f) == UPB_TYPE_BYTES) {
+ if (upb_FieldDef_CType(f) == kUpb_CType_Bytes) {
val.str_val.size = jsondec_base64(d, val.str_val);
}
return val;
}
-static upb_msgval jsondec_enum(jsondec *d, const upb_fielddef *f) {
+static upb_MessageValue jsondec_enum(jsondec* d, const upb_FieldDef* f) {
switch (jsondec_peek(d)) {
case JD_STRING: {
- const upb_enumdef *e = upb_fielddef_enumsubdef(f);
- upb_strview str = jsondec_string(d);
- upb_msgval val;
- if (!upb_enumdef_ntoi(e, str.data, str.size, &val.int32_val)) {
- if (d->options & UPB_JSONDEC_IGNOREUNKNOWN) {
+ upb_StringView str = jsondec_string(d);
+ const upb_EnumDef* e = upb_FieldDef_EnumSubDef(f);
+ const upb_EnumValueDef* ev =
+ upb_EnumDef_FindValueByNameWithSize(e, str.data, str.size);
+ upb_MessageValue val;
+ if (ev) {
+ val.int32_val = upb_EnumValueDef_Number(ev);
+ } else {
+ if (d->options & upb_JsonDecode_IgnoreUnknown) {
val.int32_val = 0;
} else {
- jsondec_errf(d, "Unknown enumerator: '" UPB_STRVIEW_FORMAT "'",
- UPB_STRVIEW_ARGS(str));
+ jsondec_errf(d, "Unknown enumerator: '" UPB_STRINGVIEW_FORMAT "'",
+ UPB_STRINGVIEW_ARGS(str));
}
}
return val;
}
case JD_NULL: {
if (jsondec_isnullvalue(f)) {
- upb_msgval val;
+ upb_MessageValue val;
jsondec_null(d);
val.int32_val = 0;
return val;
@@ -814,13 +846,13 @@ static upb_msgval jsondec_enum(jsondec *d, const upb_fielddef *f) {
}
}
-static upb_msgval jsondec_bool(jsondec *d, const upb_fielddef *f) {
- bool is_map_key = upb_fielddef_number(f) == 1 &&
- upb_msgdef_mapentry(upb_fielddef_containingtype(f));
- upb_msgval val;
+static upb_MessageValue jsondec_bool(jsondec* d, const upb_FieldDef* f) {
+ bool is_map_key = upb_FieldDef_Number(f) == 1 &&
+ upb_MessageDef_IsMapEntry(upb_FieldDef_ContainingType(f));
+ upb_MessageValue val;
if (is_map_key) {
- upb_strview str = jsondec_string(d);
+ upb_StringView str = jsondec_string(d);
if (jsondec_streql(str, "true")) {
val.bool_val = true;
} else if (jsondec_streql(str, "false")) {
@@ -848,101 +880,118 @@ static upb_msgval jsondec_bool(jsondec *d, const upb_fielddef *f) {
/* Composite types (array/message/map) ****************************************/
-static void jsondec_array(jsondec *d, upb_msg *msg, const upb_fielddef *f) {
- upb_array *arr = upb_msg_mutable(msg, f, d->arena).array;
+static void jsondec_array(jsondec* d, upb_Message* msg, const upb_FieldDef* f) {
+ upb_Array* arr = upb_Message_Mutable(msg, f, d->arena).array;
jsondec_arrstart(d);
while (jsondec_arrnext(d)) {
- upb_msgval elem = jsondec_value(d, f);
- upb_array_append(arr, elem, d->arena);
+ upb_MessageValue elem = jsondec_value(d, f);
+ upb_Array_Append(arr, elem, d->arena);
}
jsondec_arrend(d);
}
-static void jsondec_map(jsondec *d, upb_msg *msg, const upb_fielddef *f) {
- upb_map *map = upb_msg_mutable(msg, f, d->arena).map;
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_itof(entry, 1);
- const upb_fielddef *val_f = upb_msgdef_itof(entry, 2);
+static void jsondec_map(jsondec* d, upb_Message* msg, const upb_FieldDef* f) {
+ upb_Map* map = upb_Message_Mutable(msg, f, d->arena).map;
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_FindFieldByNumber(entry, 1);
+ const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(entry, 2);
jsondec_objstart(d);
while (jsondec_objnext(d)) {
- upb_msgval key, val;
+ upb_MessageValue key, val;
key = jsondec_value(d, key_f);
jsondec_entrysep(d);
val = jsondec_value(d, val_f);
- upb_map_set(map, key, val, d->arena);
+ upb_Map_Set(map, key, val, d->arena);
}
jsondec_objend(d);
}
-static void jsondec_tomsg(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- if (upb_msgdef_wellknowntype(m) == UPB_WELLKNOWN_UNSPECIFIED) {
+static void jsondec_tomsg(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ if (upb_MessageDef_WellKnownType(m) == kUpb_WellKnown_Unspecified) {
jsondec_object(d, msg, m);
} else {
jsondec_wellknown(d, msg, m);
}
}
-static upb_msgval jsondec_msg(jsondec *d, const upb_fielddef *f) {
- const upb_msgdef *m = upb_fielddef_msgsubdef(f);
- upb_msg *msg = upb_msg_new(m, d->arena);
- upb_msgval val;
+static upb_MessageValue jsondec_msg(jsondec* d, const upb_FieldDef* f) {
+ const upb_MessageDef* m = upb_FieldDef_MessageSubDef(f);
+ upb_Message* msg = upb_Message_New(m, d->arena);
+ upb_MessageValue val;
jsondec_tomsg(d, msg, m);
val.msg_val = msg;
return val;
}
-static void jsondec_field(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- upb_strview name;
- const upb_fielddef *f;
- const upb_fielddef *preserved;
+static void jsondec_field(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ upb_StringView name;
+ const upb_FieldDef* f;
+ const upb_FieldDef* preserved;
name = jsondec_string(d);
jsondec_entrysep(d);
- f = upb_msgdef_lookupjsonname(m, name.data, name.size);
+
+ if (name.size >= 2 && name.data[0] == '[' &&
+ name.data[name.size - 1] == ']') {
+ f = upb_DefPool_FindExtensionByNameWithSize(d->symtab, name.data + 1,
+ name.size - 2);
+ if (f && upb_FieldDef_ContainingType(f) != m) {
+ jsondec_errf(
+ d, "Extension %s extends message %s, but was seen in message %s",
+ upb_FieldDef_FullName(f),
+ upb_MessageDef_FullName(upb_FieldDef_ContainingType(f)),
+ upb_MessageDef_FullName(m));
+ }
+ } else {
+ f = upb_MessageDef_FindByJsonNameWithSize(m, name.data, name.size);
+ }
if (!f) {
- if ((d->options & UPB_JSONDEC_IGNOREUNKNOWN) == 0) {
- jsondec_errf(d, "Unknown field: '" UPB_STRVIEW_FORMAT "'",
- UPB_STRVIEW_ARGS(name));
+ if ((d->options & upb_JsonDecode_IgnoreUnknown) == 0) {
+ jsondec_errf(d, "No such field: " UPB_STRINGVIEW_FORMAT,
+ UPB_STRINGVIEW_ARGS(name));
}
jsondec_skipval(d);
return;
}
- if (upb_fielddef_realcontainingoneof(f) &&
- upb_msg_whichoneof(msg, upb_fielddef_containingoneof(f))) {
- jsondec_err(d, "More than one field for this oneof.");
- }
-
if (jsondec_peek(d) == JD_NULL && !jsondec_isvalue(f)) {
/* JSON "null" indicates a default value, so no need to set anything. */
jsondec_null(d);
return;
}
+ if (upb_FieldDef_RealContainingOneof(f) &&
+ upb_Message_WhichOneof(msg, upb_FieldDef_ContainingOneof(f))) {
+ jsondec_err(d, "More than one field for this oneof.");
+ }
+
preserved = d->debug_field;
d->debug_field = f;
- if (upb_fielddef_ismap(f)) {
+ if (upb_FieldDef_IsMap(f)) {
jsondec_map(d, msg, f);
- } else if (upb_fielddef_isseq(f)) {
+ } else if (upb_FieldDef_IsRepeated(f)) {
jsondec_array(d, msg, f);
- } else if (upb_fielddef_issubmsg(f)) {
- upb_msg *submsg = upb_msg_mutable(msg, f, d->arena).msg;
- const upb_msgdef *subm = upb_fielddef_msgsubdef(f);
+ } else if (upb_FieldDef_IsSubMessage(f)) {
+ upb_Message* submsg = upb_Message_Mutable(msg, f, d->arena).msg;
+ const upb_MessageDef* subm = upb_FieldDef_MessageSubDef(f);
jsondec_tomsg(d, submsg, subm);
} else {
- upb_msgval val = jsondec_value(d, f);
- upb_msg_set(msg, f, val, d->arena);
+ upb_MessageValue val = jsondec_value(d, f);
+ upb_Message_Set(msg, f, val, d->arena);
}
d->debug_field = preserved;
}
-static void jsondec_object(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
+static void jsondec_object(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
jsondec_objstart(d);
while (jsondec_objnext(d)) {
jsondec_field(d, msg, m);
@@ -950,25 +999,25 @@ static void jsondec_object(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
jsondec_objend(d);
}
-static upb_msgval jsondec_value(jsondec *d, const upb_fielddef *f) {
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_BOOL:
+static upb_MessageValue jsondec_value(jsondec* d, const upb_FieldDef* f) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
return jsondec_bool(d, f);
- case UPB_TYPE_FLOAT:
- case UPB_TYPE_DOUBLE:
+ case kUpb_CType_Float:
+ case kUpb_CType_Double:
return jsondec_double(d, f);
- case UPB_TYPE_UINT32:
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt32:
+ case kUpb_CType_UInt64:
return jsondec_uint(d, f);
- case UPB_TYPE_INT32:
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int32:
+ case kUpb_CType_Int64:
return jsondec_int(d, f);
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes:
return jsondec_strfield(d, f);
- case UPB_TYPE_ENUM:
+ case kUpb_CType_Enum:
return jsondec_enum(d, f);
- case UPB_TYPE_MESSAGE:
+ case kUpb_CType_Message:
return jsondec_msg(d, f);
default:
UPB_UNREACHABLE();
@@ -977,14 +1026,14 @@ static upb_msgval jsondec_value(jsondec *d, const upb_fielddef *f) {
/* Well-known types ***********************************************************/
-static int jsondec_tsdigits(jsondec *d, const char **ptr, size_t digits,
- const char *after) {
+static int jsondec_tsdigits(jsondec* d, const char** ptr, size_t digits,
+ const char* after) {
uint64_t val;
- const char *p = *ptr;
- const char *end = p + digits;
+ const char* p = *ptr;
+ const char* end = p + digits;
size_t after_len = after ? strlen(after) : 0;
- UPB_ASSERT(digits <= 9); /* int can't overflow. */
+ UPB_ASSERT(digits <= 9); /* int can't overflow. */
if (jsondec_buftouint64(d, p, end, &val) != end ||
(after_len && memcmp(end, after, after_len) != 0)) {
@@ -997,12 +1046,12 @@ static int jsondec_tsdigits(jsondec *d, const char **ptr, size_t digits,
return (int)val;
}
-static int jsondec_nanos(jsondec *d, const char **ptr, const char *end) {
+static int jsondec_nanos(jsondec* d, const char** ptr, const char* end) {
uint64_t nanos = 0;
- const char *p = *ptr;
+ const char* p = *ptr;
if (p != end && *p == '.') {
- const char *nano_end = jsondec_buftouint64(d, p + 1, end, &nanos);
+ const char* nano_end = jsondec_buftouint64(d, p + 1, end, &nanos);
int digits = (int)(nano_end - p - 1);
int exp_lg10 = 9 - digits;
if (digits > 9) {
@@ -1019,8 +1068,8 @@ static int jsondec_nanos(jsondec *d, const char **ptr, const char *end) {
/* jsondec_epochdays(1970, 1, 1) == 1970-01-01 == 0. */
int jsondec_epochdays(int y, int m, int d) {
- const uint32_t year_base = 4800; /* Before min year, multiple of 400. */
- const uint32_t m_adj = m - 3; /* March-based month. */
+ const uint32_t year_base = 4800; /* Before min year, multiple of 400. */
+ const uint32_t m_adj = m - 3; /* March-based month. */
const uint32_t carry = m_adj > (uint32_t)m ? 1 : 0;
const uint32_t adjust = carry ? 12 : 0;
const uint32_t y_adj = y + year_base - carry;
@@ -1033,12 +1082,13 @@ static int64_t jsondec_unixtime(int y, int m, int d, int h, int min, int s) {
return (int64_t)jsondec_epochdays(y, m, d) * 86400 + h * 3600 + min * 60 + s;
}
-static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- upb_msgval seconds;
- upb_msgval nanos;
- upb_strview str = jsondec_string(d);
- const char *ptr = str.data;
- const char *end = ptr + str.size;
+static void jsondec_timestamp(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ upb_MessageValue seconds;
+ upb_MessageValue nanos;
+ upb_StringView str = jsondec_string(d);
+ const char* ptr = str.data;
+ const char* end = ptr + str.size;
if (str.size < 20) goto malformed;
@@ -1058,7 +1108,8 @@ static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
{
/* [+-]08:00 or Z */
- int ofs = 0;
+ int ofs_hour = 0;
+ int ofs_min = 0;
bool neg = false;
if (ptr == end) goto malformed;
@@ -1069,9 +1120,10 @@ static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
/* fallthrough */
case '+':
if ((end - ptr) != 5) goto malformed;
- ofs = jsondec_tsdigits(d, &ptr, 2, ":00");
- ofs *= 60 * 60;
- seconds.int64_val += (neg ? ofs : -ofs);
+ ofs_hour = jsondec_tsdigits(d, &ptr, 2, ":");
+ ofs_min = jsondec_tsdigits(d, &ptr, 2, NULL);
+ ofs_min = ((ofs_hour * 60) + ofs_min) * 60;
+ seconds.int64_val += (neg ? ofs_min : -ofs_min);
break;
case 'Z':
if (ptr != end) goto malformed;
@@ -1085,20 +1137,22 @@ static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
jsondec_err(d, "Timestamp out of range");
}
- upb_msg_set(msg, upb_msgdef_itof(m, 1), seconds, d->arena);
- upb_msg_set(msg, upb_msgdef_itof(m, 2), nanos, d->arena);
+ upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 1), seconds,
+ d->arena);
+ upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, d->arena);
return;
malformed:
jsondec_err(d, "Malformed timestamp");
}
-static void jsondec_duration(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- upb_msgval seconds;
- upb_msgval nanos;
- upb_strview str = jsondec_string(d);
- const char *ptr = str.data;
- const char *end = ptr + str.size;
+static void jsondec_duration(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ upb_MessageValue seconds;
+ upb_MessageValue nanos;
+ upb_StringView str = jsondec_string(d);
+ const char* ptr = str.data;
+ const char* end = ptr + str.size;
const int64_t max = (uint64_t)3652500 * 86400;
/* "3.000000001s", "3s", etc. */
@@ -1114,110 +1168,114 @@ static void jsondec_duration(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
}
if (seconds.int64_val < 0) {
- nanos.int32_val = - nanos.int32_val;
+ nanos.int32_val = -nanos.int32_val;
}
- upb_msg_set(msg, upb_msgdef_itof(m, 1), seconds, d->arena);
- upb_msg_set(msg, upb_msgdef_itof(m, 2), nanos, d->arena);
+ upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 1), seconds,
+ d->arena);
+ upb_Message_Set(msg, upb_MessageDef_FindFieldByNumber(m, 2), nanos, d->arena);
}
-static void jsondec_listvalue(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- const upb_fielddef *values_f = upb_msgdef_itof(m, 1);
- const upb_msgdef *value_m = upb_fielddef_msgsubdef(values_f);
- upb_array *values = upb_msg_mutable(msg, values_f, d->arena).array;
+static void jsondec_listvalue(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* values_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_MessageDef* value_m = upb_FieldDef_MessageSubDef(values_f);
+ upb_Array* values = upb_Message_Mutable(msg, values_f, d->arena).array;
jsondec_arrstart(d);
while (jsondec_arrnext(d)) {
- upb_msg *value_msg = upb_msg_new(value_m, d->arena);
- upb_msgval value;
+ upb_Message* value_msg = upb_Message_New(value_m, d->arena);
+ upb_MessageValue value;
value.msg_val = value_msg;
- upb_array_append(values, value, d->arena);
+ upb_Array_Append(values, value, d->arena);
jsondec_wellknownvalue(d, value_msg, value_m);
}
jsondec_arrend(d);
}
-static void jsondec_struct(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- const upb_fielddef *fields_f = upb_msgdef_itof(m, 1);
- const upb_msgdef *entry_m = upb_fielddef_msgsubdef(fields_f);
- const upb_fielddef *value_f = upb_msgdef_itof(entry_m, 2);
- const upb_msgdef *value_m = upb_fielddef_msgsubdef(value_f);
- upb_map *fields = upb_msg_mutable(msg, fields_f, d->arena).map;
+static void jsondec_struct(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* fields_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(fields_f);
+ const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(entry_m, 2);
+ const upb_MessageDef* value_m = upb_FieldDef_MessageSubDef(value_f);
+ upb_Map* fields = upb_Message_Mutable(msg, fields_f, d->arena).map;
jsondec_objstart(d);
while (jsondec_objnext(d)) {
- upb_msgval key, value;
- upb_msg *value_msg = upb_msg_new(value_m, d->arena);
+ upb_MessageValue key, value;
+ upb_Message* value_msg = upb_Message_New(value_m, d->arena);
key.str_val = jsondec_string(d);
value.msg_val = value_msg;
- upb_map_set(fields, key, value, d->arena);
+ upb_Map_Set(fields, key, value, d->arena);
jsondec_entrysep(d);
jsondec_wellknownvalue(d, value_msg, value_m);
}
jsondec_objend(d);
}
-static void jsondec_wellknownvalue(jsondec *d, upb_msg *msg,
- const upb_msgdef *m) {
- upb_msgval val;
- const upb_fielddef *f;
- upb_msg *submsg;
+static void jsondec_wellknownvalue(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ upb_MessageValue val;
+ const upb_FieldDef* f;
+ upb_Message* submsg;
switch (jsondec_peek(d)) {
case JD_NUMBER:
/* double number_value = 2; */
- f = upb_msgdef_itof(m, 2);
+ f = upb_MessageDef_FindFieldByNumber(m, 2);
val.double_val = jsondec_number(d);
break;
case JD_STRING:
/* string string_value = 3; */
- f = upb_msgdef_itof(m, 3);
+ f = upb_MessageDef_FindFieldByNumber(m, 3);
val.str_val = jsondec_string(d);
break;
case JD_FALSE:
/* bool bool_value = 4; */
- f = upb_msgdef_itof(m, 4);
+ f = upb_MessageDef_FindFieldByNumber(m, 4);
val.bool_val = false;
jsondec_false(d);
break;
case JD_TRUE:
/* bool bool_value = 4; */
- f = upb_msgdef_itof(m, 4);
+ f = upb_MessageDef_FindFieldByNumber(m, 4);
val.bool_val = true;
jsondec_true(d);
break;
case JD_NULL:
/* NullValue null_value = 1; */
- f = upb_msgdef_itof(m, 1);
+ f = upb_MessageDef_FindFieldByNumber(m, 1);
val.int32_val = 0;
jsondec_null(d);
break;
- /* Note: these cases return, because upb_msg_mutable() is enough. */
+ /* Note: these cases return, because upb_Message_Mutable() is enough. */
case JD_OBJECT:
/* Struct struct_value = 5; */
- f = upb_msgdef_itof(m, 5);
- submsg = upb_msg_mutable(msg, f, d->arena).msg;
- jsondec_struct(d, submsg, upb_fielddef_msgsubdef(f));
+ f = upb_MessageDef_FindFieldByNumber(m, 5);
+ submsg = upb_Message_Mutable(msg, f, d->arena).msg;
+ jsondec_struct(d, submsg, upb_FieldDef_MessageSubDef(f));
return;
case JD_ARRAY:
/* ListValue list_value = 6; */
- f = upb_msgdef_itof(m, 6);
- submsg = upb_msg_mutable(msg, f, d->arena).msg;
- jsondec_listvalue(d, submsg, upb_fielddef_msgsubdef(f));
+ f = upb_MessageDef_FindFieldByNumber(m, 6);
+ submsg = upb_Message_Mutable(msg, f, d->arena).msg;
+ jsondec_listvalue(d, submsg, upb_FieldDef_MessageSubDef(f));
return;
default:
UPB_UNREACHABLE();
}
- upb_msg_set(msg, f, val, d->arena);
+ upb_Message_Set(msg, f, val, d->arena);
}
-static upb_strview jsondec_mask(jsondec *d, const char *buf, const char *end) {
+static upb_StringView jsondec_mask(jsondec* d, const char* buf,
+ const char* end) {
/* FieldMask fields grow due to inserted '_' characters, so we can't do the
* transform in place. */
- const char *ptr = buf;
- upb_strview ret;
- char *out;
+ const char* ptr = buf;
+ upb_StringView ret;
+ char* out;
ret.size = end - ptr;
while (ptr < end) {
@@ -1225,7 +1283,7 @@ static upb_strview jsondec_mask(jsondec *d, const char *buf, const char *end) {
ptr++;
}
- out = upb_arena_malloc(d->arena, ret.size);
+ out = upb_Arena_Malloc(d->arena, ret.size);
ptr = buf;
ret.data = out;
@@ -1244,17 +1302,18 @@ static upb_strview jsondec_mask(jsondec *d, const char *buf, const char *end) {
return ret;
}
-static void jsondec_fieldmask(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
+static void jsondec_fieldmask(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
/* repeated string paths = 1; */
- const upb_fielddef *paths_f = upb_msgdef_itof(m, 1);
- upb_array *arr = upb_msg_mutable(msg, paths_f, d->arena).array;
- upb_strview str = jsondec_string(d);
- const char *ptr = str.data;
- const char *end = ptr + str.size;
- upb_msgval val;
+ const upb_FieldDef* paths_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ upb_Array* arr = upb_Message_Mutable(msg, paths_f, d->arena).array;
+ upb_StringView str = jsondec_string(d);
+ const char* ptr = str.data;
+ const char* end = ptr + str.size;
+ upb_MessageValue val;
while (ptr < end) {
- const char *elem_end = memchr(ptr, ',', end - ptr);
+ const char* elem_end = memchr(ptr, ',', end - ptr);
if (elem_end) {
val.str_val = jsondec_mask(d, ptr, elem_end);
ptr = elem_end + 1;
@@ -1262,19 +1321,20 @@ static void jsondec_fieldmask(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
val.str_val = jsondec_mask(d, ptr, end);
ptr = end;
}
- upb_array_append(arr, val, d->arena);
+ upb_Array_Append(arr, val, d->arena);
}
}
-static void jsondec_anyfield(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- if (upb_msgdef_wellknowntype(m) == UPB_WELLKNOWN_UNSPECIFIED) {
+static void jsondec_anyfield(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ if (upb_MessageDef_WellKnownType(m) == kUpb_WellKnown_Unspecified) {
/* For regular types: {"@type": "[user type]", "f1": <V1>, "f2": <V2>}
* where f1, f2, etc. are the normal fields of this type. */
jsondec_field(d, msg, m);
} else {
/* For well-known types: {"@type": "[well-known type]", "value": <X>}
* where <X> is whatever encoding the WKT normally uses. */
- upb_strview str = jsondec_string(d);
+ upb_StringView str = jsondec_string(d);
jsondec_entrysep(d);
if (!jsondec_streql(str, "value")) {
jsondec_err(d, "Key for well-known type must be 'value'");
@@ -1283,27 +1343,28 @@ static void jsondec_anyfield(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
}
}
-static const upb_msgdef *jsondec_typeurl(jsondec *d, upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *type_url_f = upb_msgdef_itof(m, 1);
- const upb_msgdef *type_m;
- upb_strview type_url = jsondec_string(d);
- const char *end = type_url.data + type_url.size;
- const char *ptr = end;
- upb_msgval val;
+static const upb_MessageDef* jsondec_typeurl(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* type_url_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_MessageDef* type_m;
+ upb_StringView type_url = jsondec_string(d);
+ const char* end = type_url.data + type_url.size;
+ const char* ptr = end;
+ upb_MessageValue val;
val.str_val = type_url;
- upb_msg_set(msg, type_url_f, val, d->arena);
+ upb_Message_Set(msg, type_url_f, val, d->arena);
/* Find message name after the last '/' */
- while (ptr > type_url.data && *--ptr != '/') {}
+ while (ptr > type_url.data && *--ptr != '/') {
+ }
if (ptr == type_url.data || ptr == end) {
jsondec_err(d, "Type url must have at least one '/' and non-empty host");
}
ptr++;
- type_m = upb_symtab_lookupmsg2(d->any_pool, ptr, end - ptr);
+ type_m = upb_DefPool_FindMessageByNameWithSize(d->symtab, ptr, end - ptr);
if (!type_m) {
jsondec_err(d, "Type was not found");
@@ -1312,22 +1373,22 @@ static const upb_msgdef *jsondec_typeurl(jsondec *d, upb_msg *msg,
return type_m;
}
-static void jsondec_any(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
+static void jsondec_any(jsondec* d, upb_Message* msg, const upb_MessageDef* m) {
/* string type_url = 1;
* bytes value = 2; */
- const upb_fielddef *value_f = upb_msgdef_itof(m, 2);
- upb_msg *any_msg;
- const upb_msgdef *any_m = NULL;
- const char *pre_type_data = NULL;
- const char *pre_type_end = NULL;
- upb_msgval encoded;
+ const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(m, 2);
+ upb_Message* any_msg;
+ const upb_MessageDef* any_m = NULL;
+ const char* pre_type_data = NULL;
+ const char* pre_type_end = NULL;
+ upb_MessageValue encoded;
jsondec_objstart(d);
/* Scan looking for "@type", which is not necessarily first. */
while (!any_m && jsondec_objnext(d)) {
- const char *start = d->ptr;
- upb_strview name = jsondec_string(d);
+ const char* start = d->ptr;
+ upb_StringView name = jsondec_string(d);
jsondec_entrysep(d);
if (jsondec_streql(name, "@type")) {
any_m = jsondec_typeurl(d, msg, m);
@@ -1345,13 +1406,13 @@ static void jsondec_any(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
jsondec_err(d, "Any object didn't contain a '@type' field");
}
- any_msg = upb_msg_new(any_m, d->arena);
+ any_msg = upb_Message_New(any_m, d->arena);
if (pre_type_data) {
size_t len = pre_type_end - pre_type_data + 1;
- char *tmp = upb_arena_malloc(d->arena, len);
- const char *saved_ptr = d->ptr;
- const char *saved_end = d->end;
+ char* tmp = upb_Arena_Malloc(d->arena, len);
+ const char* saved_ptr = d->ptr;
+ const char* saved_end = d->end;
memcpy(tmp, pre_type_data, len - 1);
tmp[len - 1] = '}';
d->ptr = tmp;
@@ -1370,49 +1431,51 @@ static void jsondec_any(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
jsondec_objend(d);
- encoded.str_val.data = upb_encode(any_msg, upb_msgdef_layout(any_m), d->arena,
- &encoded.str_val.size);
- upb_msg_set(msg, value_f, encoded, d->arena);
+ encoded.str_val.data = upb_Encode(any_msg, upb_MessageDef_MiniTable(any_m), 0,
+ d->arena, &encoded.str_val.size);
+ upb_Message_Set(msg, value_f, encoded, d->arena);
}
-static void jsondec_wrapper(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- const upb_fielddef *value_f = upb_msgdef_itof(m, 1);
- upb_msgval val = jsondec_value(d, value_f);
- upb_msg_set(msg, value_f, val, d->arena);
+static void jsondec_wrapper(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ upb_MessageValue val = jsondec_value(d, value_f);
+ upb_Message_Set(msg, value_f, val, d->arena);
}
-static void jsondec_wellknown(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
- switch (upb_msgdef_wellknowntype(m)) {
- case UPB_WELLKNOWN_ANY:
+static void jsondec_wellknown(jsondec* d, upb_Message* msg,
+ const upb_MessageDef* m) {
+ switch (upb_MessageDef_WellKnownType(m)) {
+ case kUpb_WellKnown_Any:
jsondec_any(d, msg, m);
break;
- case UPB_WELLKNOWN_FIELDMASK:
+ case kUpb_WellKnown_FieldMask:
jsondec_fieldmask(d, msg, m);
break;
- case UPB_WELLKNOWN_DURATION:
+ case kUpb_WellKnown_Duration:
jsondec_duration(d, msg, m);
break;
- case UPB_WELLKNOWN_TIMESTAMP:
+ case kUpb_WellKnown_Timestamp:
jsondec_timestamp(d, msg, m);
break;
- case UPB_WELLKNOWN_VALUE:
+ case kUpb_WellKnown_Value:
jsondec_wellknownvalue(d, msg, m);
break;
- case UPB_WELLKNOWN_LISTVALUE:
+ case kUpb_WellKnown_ListValue:
jsondec_listvalue(d, msg, m);
break;
- case UPB_WELLKNOWN_STRUCT:
+ case kUpb_WellKnown_Struct:
jsondec_struct(d, msg, m);
break;
- case UPB_WELLKNOWN_DOUBLEVALUE:
- case UPB_WELLKNOWN_FLOATVALUE:
- case UPB_WELLKNOWN_INT64VALUE:
- case UPB_WELLKNOWN_UINT64VALUE:
- case UPB_WELLKNOWN_INT32VALUE:
- case UPB_WELLKNOWN_UINT32VALUE:
- case UPB_WELLKNOWN_STRINGVALUE:
- case UPB_WELLKNOWN_BYTESVALUE:
- case UPB_WELLKNOWN_BOOLVALUE:
+ case kUpb_WellKnown_DoubleValue:
+ case kUpb_WellKnown_FloatValue:
+ case kUpb_WellKnown_Int64Value:
+ case kUpb_WellKnown_UInt64Value:
+ case kUpb_WellKnown_Int32Value:
+ case kUpb_WellKnown_UInt32Value:
+ case kUpb_WellKnown_StringValue:
+ case kUpb_WellKnown_BytesValue:
+ case kUpb_WellKnown_BoolValue:
jsondec_wrapper(d, msg, m);
break;
default:
@@ -1420,14 +1483,17 @@ static void jsondec_wellknown(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
}
}
-bool upb_json_decode(const char *buf, size_t size, upb_msg *msg,
- const upb_msgdef *m, const upb_symtab *any_pool,
- int options, upb_arena *arena, upb_status *status) {
+bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
+ const upb_MessageDef* m, const upb_DefPool* symtab,
+ int options, upb_Arena* arena, upb_Status* status) {
jsondec d;
+
+ if (size == 0) return true;
+
d.ptr = buf;
d.end = buf + size;
d.arena = arena;
- d.any_pool = any_pool;
+ d.symtab = symtab;
d.status = status;
d.options = options;
d.depth = 64;
diff --git a/grpc/third_party/upb/upb/json_decode.h b/grpc/third_party/upb/upb/json_decode.h
index a0ba1ee5..848f4df3 100644
--- a/grpc/third_party/upb/upb/json_decode.h
+++ b/grpc/third_party/upb/upb/json_decode.h
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_JSONDECODE_H_
#define UPB_JSONDECODE_H_
@@ -8,16 +34,14 @@
extern "C" {
#endif
-enum {
- UPB_JSONDEC_IGNOREUNKNOWN = 1
-};
+enum { upb_JsonDecode_IgnoreUnknown = 1 };
-bool upb_json_decode(const char *buf, size_t size, upb_msg *msg,
- const upb_msgdef *m, const upb_symtab *any_pool,
- int options, upb_arena *arena, upb_status *status);
+bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg,
+ const upb_MessageDef* m, const upb_DefPool* symtab,
+ int options, upb_Arena* arena, upb_Status* status);
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* UPB_JSONDECODE_H_ */
+#endif /* UPB_JSONDECODE_H_ */
diff --git a/grpc/third_party/upb/upb/json_encode.c b/grpc/third_party/upb/upb/json_encode.c
index 9217c65b..9668a426 100644
--- a/grpc/third_party/upb/upb/json_encode.c
+++ b/grpc/third_party/upb/upb/json_encode.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/json_encode.h"
@@ -12,6 +38,7 @@
#include "upb/decode.h"
#include "upb/reflection.h"
+#include "upb/upb_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
@@ -21,58 +48,65 @@ typedef struct {
size_t overflow;
int indent_depth;
int options;
- const upb_symtab *ext_pool;
+ const upb_DefPool* ext_pool;
jmp_buf err;
- upb_status *status;
- upb_arena *arena;
+ upb_Status* status;
+ upb_Arena* arena;
} jsonenc;
-static void jsonenc_msg(jsonenc *e, const upb_msg *msg, const upb_msgdef *m);
-static void jsonenc_scalar(jsonenc *e, upb_msgval val, const upb_fielddef *f);
-static void jsonenc_msgfield(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m);
-static void jsonenc_msgfields(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m);
-static void jsonenc_value(jsonenc *e, const upb_msg *msg, const upb_msgdef *m);
-
-UPB_NORETURN static void jsonenc_err(jsonenc *e, const char *msg) {
- upb_status_seterrmsg(e->status, msg);
+static void jsonenc_msg(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m);
+static void jsonenc_scalar(jsonenc* e, upb_MessageValue val,
+ const upb_FieldDef* f);
+static void jsonenc_msgfield(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m);
+static void jsonenc_msgfields(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m, bool first);
+static void jsonenc_value(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m);
+
+UPB_NORETURN static void jsonenc_err(jsonenc* e, const char* msg) {
+ upb_Status_SetErrorMessage(e->status, msg);
longjmp(e->err, 1);
}
-UPB_NORETURN static void jsonenc_errf(jsonenc *e, const char *fmt, ...) {
+UPB_PRINTF(2, 3)
+UPB_NORETURN static void jsonenc_errf(jsonenc* e, const char* fmt, ...) {
va_list argp;
va_start(argp, fmt);
- upb_status_vseterrf(e->status, fmt, argp);
+ upb_Status_VSetErrorFormat(e->status, fmt, argp);
va_end(argp);
longjmp(e->err, 1);
}
-static upb_arena *jsonenc_arena(jsonenc *e) {
+static upb_Arena* jsonenc_arena(jsonenc* e) {
/* Create lazily, since it's only needed for Any */
if (!e->arena) {
- e->arena = upb_arena_new();
+ e->arena = upb_Arena_New();
}
return e->arena;
}
-static void jsonenc_putbytes(jsonenc *e, const void *data, size_t len) {
+static void jsonenc_putbytes(jsonenc* e, const void* data, size_t len) {
size_t have = e->end - e->ptr;
if (UPB_LIKELY(have >= len)) {
memcpy(e->ptr, data, len);
e->ptr += len;
} else {
- if (have) memcpy(e->ptr, data, have);
- e->ptr += have;
+ if (have) {
+ memcpy(e->ptr, data, have);
+ e->ptr += have;
+ }
e->overflow += (len - have);
}
}
-static void jsonenc_putstr(jsonenc *e, const char *str) {
+static void jsonenc_putstr(jsonenc* e, const char* str) {
jsonenc_putbytes(e, str, strlen(str));
}
-static void jsonenc_printf(jsonenc *e, const char *fmt, ...) {
+UPB_PRINTF(2, 3)
+static void jsonenc_printf(jsonenc* e, const char* fmt, ...) {
size_t n;
size_t have = e->end - e->ptr;
va_list args;
@@ -84,12 +118,12 @@ static void jsonenc_printf(jsonenc *e, const char *fmt, ...) {
if (UPB_LIKELY(have > n)) {
e->ptr += n;
} else {
- e->ptr += have;
+ e->ptr = UPB_PTRADD(e->ptr, have);
e->overflow += (n - have);
}
}
-static void jsonenc_nanos(jsonenc *e, int32_t nanos) {
+static void jsonenc_nanos(jsonenc* e, int32_t nanos) {
int digits = 9;
if (nanos == 0) return;
@@ -102,15 +136,15 @@ static void jsonenc_nanos(jsonenc *e, int32_t nanos) {
digits -= 3;
}
- jsonenc_printf(e, ".%0.*" PRId32, digits, nanos);
+ jsonenc_printf(e, ".%.*" PRId32, digits, nanos);
}
-static void jsonenc_timestamp(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *seconds_f = upb_msgdef_itof(m, 1);
- const upb_fielddef *nanos_f = upb_msgdef_itof(m, 2);
- int64_t seconds = upb_msg_get(msg, seconds_f).int64_val;
- int32_t nanos = upb_msg_get(msg, nanos_f).int32_val;
+static void jsonenc_timestamp(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* seconds_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_FieldDef* nanos_f = upb_MessageDef_FindFieldByNumber(m, 2);
+ int64_t seconds = upb_Message_Get(msg, seconds_f).int64_val;
+ int32_t nanos = upb_Message_Get(msg, nanos_f).int32_val;
int L, N, I, J, K, hour, min, sec;
if (seconds < -62135596800) {
@@ -127,7 +161,8 @@ static void jsonenc_timestamp(jsonenc *e, const upb_msg *msg,
* Fliegel, H. F., and Van Flandern, T. C., "A Machine Algorithm for
* Processing Calendar Dates," Communications of the Association of
* Computing Machines, vol. 11 (1968), p. 657. */
- L = (int)(seconds / 86400) + 68569 + 2440588;
+ seconds += 62135596800; // Ensure seconds is positive.
+ L = (int)(seconds / 86400) - 719162 + 68569 + 2440588;
N = 4 * L / 146097;
L = L - (146097 * N + 3) / 4;
I = 4000 * (L + 1) / 1461001;
@@ -147,11 +182,12 @@ static void jsonenc_timestamp(jsonenc *e, const upb_msg *msg,
jsonenc_putstr(e, "Z\"");
}
-static void jsonenc_duration(jsonenc *e, const upb_msg *msg, const upb_msgdef *m) {
- const upb_fielddef *seconds_f = upb_msgdef_itof(m, 1);
- const upb_fielddef *nanos_f = upb_msgdef_itof(m, 2);
- int64_t seconds = upb_msg_get(msg, seconds_f).int64_val;
- int32_t nanos = upb_msg_get(msg, nanos_f).int32_val;
+static void jsonenc_duration(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* seconds_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_FieldDef* nanos_f = upb_MessageDef_FindFieldByNumber(m, 2);
+ int64_t seconds = upb_Message_Get(msg, seconds_f).int64_val;
+ int32_t nanos = upb_Message_Get(msg, nanos_f).int32_val;
if (seconds > 315576000000 || seconds < -315576000000 ||
(seconds < 0) != (nanos < 0)) {
@@ -167,28 +203,28 @@ static void jsonenc_duration(jsonenc *e, const upb_msg *msg, const upb_msgdef *m
jsonenc_putstr(e, "s\"");
}
-static void jsonenc_enum(int32_t val, const upb_fielddef *f, jsonenc *e) {
- const upb_enumdef *e_def = upb_fielddef_enumsubdef(f);
+static void jsonenc_enum(int32_t val, const upb_FieldDef* f, jsonenc* e) {
+ const upb_EnumDef* e_def = upb_FieldDef_EnumSubDef(f);
- if (strcmp(upb_enumdef_fullname(e_def), "google.protobuf.NullValue") == 0) {
+ if (strcmp(upb_EnumDef_FullName(e_def), "google.protobuf.NullValue") == 0) {
jsonenc_putstr(e, "null");
} else {
- const char *name = upb_enumdef_iton(e_def, val);
+ const upb_EnumValueDef* ev = upb_EnumDef_FindValueByNumber(e_def, val);
- if (name) {
- jsonenc_printf(e, "\"%s\"", name);
+ if (ev) {
+ jsonenc_printf(e, "\"%s\"", upb_EnumValueDef_Name(ev));
} else {
jsonenc_printf(e, "%" PRId32, val);
}
}
}
-static void jsonenc_bytes(jsonenc *e, upb_strview str) {
+static void jsonenc_bytes(jsonenc* e, upb_StringView str) {
/* This is the regular base64, not the "web-safe" version. */
static const char base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- const unsigned char *ptr = (unsigned char*)str.data;
- const unsigned char *end = ptr + str.size;
+ const unsigned char* ptr = (unsigned char*)str.data;
+ const unsigned char* end = UPB_PTRADD(ptr, str.size);
char buf[4];
jsonenc_putstr(e, "\"");
@@ -222,9 +258,9 @@ static void jsonenc_bytes(jsonenc *e, upb_strview str) {
jsonenc_putstr(e, "\"");
}
-static void jsonenc_stringbody(jsonenc *e, upb_strview str) {
- const char *ptr = str.data;
- const char *end = ptr + str.size;
+static void jsonenc_stringbody(jsonenc* e, upb_StringView str) {
+ const char* ptr = str.data;
+ const char* end = UPB_PTRADD(ptr, str.size);
while (ptr < end) {
switch (*ptr) {
@@ -263,13 +299,13 @@ static void jsonenc_stringbody(jsonenc *e, upb_strview str) {
}
}
-static void jsonenc_string(jsonenc *e, upb_strview str) {
+static void jsonenc_string(jsonenc* e, upb_StringView str) {
jsonenc_putstr(e, "\"");
jsonenc_stringbody(e, str);
jsonenc_putstr(e, "\"");
}
-static void jsonenc_double(jsonenc *e, const char *fmt, double val) {
+static bool upb_JsonEncode_HandleSpecialDoubles(jsonenc* e, double val) {
if (val == INFINITY) {
jsonenc_putstr(e, "\"Infinity\"");
} else if (val == -INFINITY) {
@@ -277,22 +313,38 @@ static void jsonenc_double(jsonenc *e, const char *fmt, double val) {
} else if (val != val) {
jsonenc_putstr(e, "\"NaN\"");
} else {
- jsonenc_printf(e, fmt, val);
+ return false;
}
+ return true;
+}
+
+static void upb_JsonEncode_Double(jsonenc* e, double val) {
+ if (upb_JsonEncode_HandleSpecialDoubles(e, val)) return;
+ char buf[32];
+ _upb_EncodeRoundTripDouble(val, buf, sizeof(buf));
+ jsonenc_putstr(e, buf);
}
-static void jsonenc_wrapper(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *val_f = upb_msgdef_itof(m, 1);
- upb_msgval val = upb_msg_get(msg, val_f);
+static void upb_JsonEncode_Float(jsonenc* e, float val) {
+ if (upb_JsonEncode_HandleSpecialDoubles(e, val)) return;
+ char buf[32];
+ _upb_EncodeRoundTripFloat(val, buf, sizeof(buf));
+ jsonenc_putstr(e, buf);
+}
+
+static void jsonenc_wrapper(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ upb_MessageValue val = upb_Message_Get(msg, val_f);
jsonenc_scalar(e, val, val_f);
}
-static const upb_msgdef *jsonenc_getanymsg(jsonenc *e, upb_strview type_url) {
+static const upb_MessageDef* jsonenc_getanymsg(jsonenc* e,
+ upb_StringView type_url) {
/* Find last '/', if any. */
- const char *end = type_url.data + type_url.size;
- const char *ptr = end;
- const upb_msgdef *ret;
+ const char* end = type_url.data + type_url.size;
+ const char* ptr = end;
+ const upb_MessageDef* ret;
if (!e->ext_pool) {
jsonenc_err(e, "Tried to encode Any, but no symtab was provided");
@@ -311,7 +363,7 @@ static const upb_msgdef *jsonenc_getanymsg(jsonenc *e, upb_strview type_url) {
}
}
- ret = upb_symtab_lookupmsg2(e->ext_pool, ptr, end - ptr);
+ ret = upb_DefPool_FindMessageByNameWithSize(e->ext_pool, ptr, end - ptr);
if (!ret) {
jsonenc_errf(e, "Couldn't find Any type: %.*s", (int)(end - ptr), ptr);
@@ -320,41 +372,42 @@ static const upb_msgdef *jsonenc_getanymsg(jsonenc *e, upb_strview type_url) {
return ret;
badurl:
- jsonenc_errf(
- e, "Bad type URL: " UPB_STRVIEW_FORMAT, UPB_STRVIEW_ARGS(type_url));
-}
-
-static void jsonenc_any(jsonenc *e, const upb_msg *msg, const upb_msgdef *m) {
- const upb_fielddef *type_url_f = upb_msgdef_itof(m, 1);
- const upb_fielddef *value_f = upb_msgdef_itof(m, 2);
- upb_strview type_url = upb_msg_get(msg, type_url_f).str_val;
- upb_strview value = upb_msg_get(msg, value_f).str_val;
- const upb_msgdef *any_m = jsonenc_getanymsg(e, type_url);
- const upb_msglayout *any_layout = upb_msgdef_layout(any_m);
- upb_arena *arena = jsonenc_arena(e);
- upb_msg *any = upb_msg_new(any_m, arena);
-
- if (!upb_decode(value.data, value.size, any, any_layout, arena)) {
+ jsonenc_errf(e, "Bad type URL: " UPB_STRINGVIEW_FORMAT,
+ UPB_STRINGVIEW_ARGS(type_url));
+}
+
+static void jsonenc_any(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* type_url_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(m, 2);
+ upb_StringView type_url = upb_Message_Get(msg, type_url_f).str_val;
+ upb_StringView value = upb_Message_Get(msg, value_f).str_val;
+ const upb_MessageDef* any_m = jsonenc_getanymsg(e, type_url);
+ const upb_MiniTable* any_layout = upb_MessageDef_MiniTable(any_m);
+ upb_Arena* arena = jsonenc_arena(e);
+ upb_Message* any = upb_Message_New(any_m, arena);
+
+ if (upb_Decode(value.data, value.size, any, any_layout, NULL, 0, arena) !=
+ kUpb_DecodeStatus_Ok) {
jsonenc_err(e, "Error decoding message in Any");
}
jsonenc_putstr(e, "{\"@type\":");
jsonenc_string(e, type_url);
- jsonenc_putstr(e, ",");
- if (upb_msgdef_wellknowntype(any_m) == UPB_WELLKNOWN_UNSPECIFIED) {
+ if (upb_MessageDef_WellKnownType(any_m) == kUpb_WellKnown_Unspecified) {
/* Regular messages: {"@type": "...","foo": 1, "bar": 2} */
- jsonenc_msgfields(e, any, any_m);
+ jsonenc_msgfields(e, any, any_m, false);
} else {
/* Well-known type: {"@type": "...","value": <well-known encoding>} */
- jsonenc_putstr(e, "\"value\":");
+ jsonenc_putstr(e, ",\"value\":");
jsonenc_msgfield(e, any, any_m);
}
jsonenc_putstr(e, "}");
}
-static void jsonenc_putsep(jsonenc *e, const char *str, bool *first) {
+static void jsonenc_putsep(jsonenc* e, const char* str, bool* first) {
if (*first) {
*first = false;
} else {
@@ -362,9 +415,9 @@ static void jsonenc_putsep(jsonenc *e, const char *str, bool *first) {
}
}
-static void jsonenc_fieldpath(jsonenc *e, upb_strview path) {
- const char *ptr = path.data;
- const char *end = ptr + path.size;
+static void jsonenc_fieldpath(jsonenc* e, upb_StringView path) {
+ const char* ptr = path.data;
+ const char* end = ptr + path.size;
while (ptr < end) {
char ch = *ptr;
@@ -383,65 +436,65 @@ static void jsonenc_fieldpath(jsonenc *e, upb_strview path) {
}
}
-static void jsonenc_fieldmask(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *paths_f = upb_msgdef_itof(m, 1);
- const upb_array *paths = upb_msg_get(msg, paths_f).array_val;
+static void jsonenc_fieldmask(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* paths_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_Array* paths = upb_Message_Get(msg, paths_f).array_val;
bool first = true;
size_t i, n = 0;
- if (paths) n = upb_array_size(paths);
+ if (paths) n = upb_Array_Size(paths);
jsonenc_putstr(e, "\"");
for (i = 0; i < n; i++) {
jsonenc_putsep(e, ",", &first);
- jsonenc_fieldpath(e, upb_array_get(paths, i).str_val);
+ jsonenc_fieldpath(e, upb_Array_Get(paths, i).str_val);
}
jsonenc_putstr(e, "\"");
}
-static void jsonenc_struct(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *fields_f = upb_msgdef_itof(m, 1);
- const upb_map *fields = upb_msg_get(msg, fields_f).map_val;
- const upb_msgdef *entry_m = upb_fielddef_msgsubdef(fields_f);
- const upb_fielddef *value_f = upb_msgdef_itof(entry_m, 2);
- size_t iter = UPB_MAP_BEGIN;
+static void jsonenc_struct(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* fields_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_Map* fields = upb_Message_Get(msg, fields_f).map_val;
+ const upb_MessageDef* entry_m = upb_FieldDef_MessageSubDef(fields_f);
+ const upb_FieldDef* value_f = upb_MessageDef_FindFieldByNumber(entry_m, 2);
+ size_t iter = kUpb_Map_Begin;
bool first = true;
jsonenc_putstr(e, "{");
if (fields) {
- while (upb_mapiter_next(fields, &iter)) {
- upb_msgval key = upb_mapiter_key(fields, iter);
- upb_msgval val = upb_mapiter_value(fields, iter);
+ while (upb_MapIterator_Next(fields, &iter)) {
+ upb_MessageValue key = upb_MapIterator_Key(fields, iter);
+ upb_MessageValue val = upb_MapIterator_Value(fields, iter);
jsonenc_putsep(e, ",", &first);
jsonenc_string(e, key.str_val);
jsonenc_putstr(e, ":");
- jsonenc_value(e, val.msg_val, upb_fielddef_msgsubdef(value_f));
+ jsonenc_value(e, val.msg_val, upb_FieldDef_MessageSubDef(value_f));
}
}
jsonenc_putstr(e, "}");
}
-static void jsonenc_listvalue(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- const upb_fielddef *values_f = upb_msgdef_itof(m, 1);
- const upb_msgdef *values_m = upb_fielddef_msgsubdef(values_f);
- const upb_array *values = upb_msg_get(msg, values_f).array_val;
+static void jsonenc_listvalue(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ const upb_FieldDef* values_f = upb_MessageDef_FindFieldByNumber(m, 1);
+ const upb_MessageDef* values_m = upb_FieldDef_MessageSubDef(values_f);
+ const upb_Array* values = upb_Message_Get(msg, values_f).array_val;
size_t i;
bool first = true;
jsonenc_putstr(e, "[");
if (values) {
- const size_t size = upb_array_size(values);
+ const size_t size = upb_Array_Size(values);
for (i = 0; i < size; i++) {
- upb_msgval elem = upb_array_get(values, i);
+ upb_MessageValue elem = upb_Array_Get(values, i);
jsonenc_putsep(e, ",", &first);
jsonenc_value(e, elem.msg_val, values_m);
@@ -451,22 +504,23 @@ static void jsonenc_listvalue(jsonenc *e, const upb_msg *msg,
jsonenc_putstr(e, "]");
}
-static void jsonenc_value(jsonenc *e, const upb_msg *msg, const upb_msgdef *m) {
+static void jsonenc_value(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
/* TODO(haberman): do we want a reflection method to get oneof case? */
- size_t iter = UPB_MSG_BEGIN;
- const upb_fielddef *f;
- upb_msgval val;
+ size_t iter = kUpb_Message_Begin;
+ const upb_FieldDef* f;
+ upb_MessageValue val;
- if (!upb_msg_next(msg, m, NULL, &f, &val, &iter)) {
+ if (!upb_Message_Next(msg, m, NULL, &f, &val, &iter)) {
jsonenc_err(e, "No value set in Value proto");
}
- switch (upb_fielddef_number(f)) {
+ switch (upb_FieldDef_Number(f)) {
case 1:
jsonenc_putstr(e, "null");
break;
case 2:
- jsonenc_double(e, "%.17g", val.double_val);
+ upb_JsonEncode_Double(e, val.double_val);
break;
case 3:
jsonenc_string(e, val.str_val);
@@ -475,113 +529,115 @@ static void jsonenc_value(jsonenc *e, const upb_msg *msg, const upb_msgdef *m) {
jsonenc_putstr(e, val.bool_val ? "true" : "false");
break;
case 5:
- jsonenc_struct(e, val.msg_val, upb_fielddef_msgsubdef(f));
+ jsonenc_struct(e, val.msg_val, upb_FieldDef_MessageSubDef(f));
break;
case 6:
- jsonenc_listvalue(e, val.msg_val, upb_fielddef_msgsubdef(f));
+ jsonenc_listvalue(e, val.msg_val, upb_FieldDef_MessageSubDef(f));
break;
}
}
-static void jsonenc_msgfield(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- switch (upb_msgdef_wellknowntype(m)) {
- case UPB_WELLKNOWN_UNSPECIFIED:
+static void jsonenc_msgfield(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ switch (upb_MessageDef_WellKnownType(m)) {
+ case kUpb_WellKnown_Unspecified:
jsonenc_msg(e, msg, m);
break;
- case UPB_WELLKNOWN_ANY:
+ case kUpb_WellKnown_Any:
jsonenc_any(e, msg, m);
break;
- case UPB_WELLKNOWN_FIELDMASK:
+ case kUpb_WellKnown_FieldMask:
jsonenc_fieldmask(e, msg, m);
break;
- case UPB_WELLKNOWN_DURATION:
+ case kUpb_WellKnown_Duration:
jsonenc_duration(e, msg, m);
break;
- case UPB_WELLKNOWN_TIMESTAMP:
+ case kUpb_WellKnown_Timestamp:
jsonenc_timestamp(e, msg, m);
break;
- case UPB_WELLKNOWN_DOUBLEVALUE:
- case UPB_WELLKNOWN_FLOATVALUE:
- case UPB_WELLKNOWN_INT64VALUE:
- case UPB_WELLKNOWN_UINT64VALUE:
- case UPB_WELLKNOWN_INT32VALUE:
- case UPB_WELLKNOWN_UINT32VALUE:
- case UPB_WELLKNOWN_STRINGVALUE:
- case UPB_WELLKNOWN_BYTESVALUE:
- case UPB_WELLKNOWN_BOOLVALUE:
+ case kUpb_WellKnown_DoubleValue:
+ case kUpb_WellKnown_FloatValue:
+ case kUpb_WellKnown_Int64Value:
+ case kUpb_WellKnown_UInt64Value:
+ case kUpb_WellKnown_Int32Value:
+ case kUpb_WellKnown_UInt32Value:
+ case kUpb_WellKnown_StringValue:
+ case kUpb_WellKnown_BytesValue:
+ case kUpb_WellKnown_BoolValue:
jsonenc_wrapper(e, msg, m);
break;
- case UPB_WELLKNOWN_VALUE:
+ case kUpb_WellKnown_Value:
jsonenc_value(e, msg, m);
break;
- case UPB_WELLKNOWN_LISTVALUE:
+ case kUpb_WellKnown_ListValue:
jsonenc_listvalue(e, msg, m);
break;
- case UPB_WELLKNOWN_STRUCT:
+ case kUpb_WellKnown_Struct:
jsonenc_struct(e, msg, m);
break;
}
}
-static void jsonenc_scalar(jsonenc *e, upb_msgval val, const upb_fielddef *f) {
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_BOOL:
+static void jsonenc_scalar(jsonenc* e, upb_MessageValue val,
+ const upb_FieldDef* f) {
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
jsonenc_putstr(e, val.bool_val ? "true" : "false");
break;
- case UPB_TYPE_FLOAT:
- jsonenc_double(e, "%.9g", val.float_val);
+ case kUpb_CType_Float:
+ upb_JsonEncode_Float(e, val.float_val);
break;
- case UPB_TYPE_DOUBLE:
- jsonenc_double(e, "%.17g", val.double_val);
+ case kUpb_CType_Double:
+ upb_JsonEncode_Double(e, val.double_val);
break;
- case UPB_TYPE_INT32:
+ case kUpb_CType_Int32:
jsonenc_printf(e, "%" PRId32, val.int32_val);
break;
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt32:
jsonenc_printf(e, "%" PRIu32, val.uint32_val);
break;
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int64:
jsonenc_printf(e, "\"%" PRId64 "\"", val.int64_val);
break;
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt64:
jsonenc_printf(e, "\"%" PRIu64 "\"", val.uint64_val);
break;
- case UPB_TYPE_STRING:
+ case kUpb_CType_String:
jsonenc_string(e, val.str_val);
break;
- case UPB_TYPE_BYTES:
+ case kUpb_CType_Bytes:
jsonenc_bytes(e, val.str_val);
break;
- case UPB_TYPE_ENUM:
+ case kUpb_CType_Enum:
jsonenc_enum(val.int32_val, f, e);
break;
- case UPB_TYPE_MESSAGE:
- jsonenc_msgfield(e, val.msg_val, upb_fielddef_msgsubdef(f));
+ case kUpb_CType_Message:
+ jsonenc_msgfield(e, val.msg_val, upb_FieldDef_MessageSubDef(f));
break;
}
}
-static void jsonenc_mapkey(jsonenc *e, upb_msgval val, const upb_fielddef *f) {
+static void jsonenc_mapkey(jsonenc* e, upb_MessageValue val,
+ const upb_FieldDef* f) {
jsonenc_putstr(e, "\"");
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_BOOL:
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
jsonenc_putstr(e, val.bool_val ? "true" : "false");
break;
- case UPB_TYPE_INT32:
+ case kUpb_CType_Int32:
jsonenc_printf(e, "%" PRId32, val.int32_val);
break;
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt32:
jsonenc_printf(e, "%" PRIu32, val.uint32_val);
break;
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int64:
jsonenc_printf(e, "%" PRId64, val.int64_val);
break;
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt64:
jsonenc_printf(e, "%" PRIu64, val.uint64_val);
break;
- case UPB_TYPE_STRING:
+ case kUpb_CType_String:
jsonenc_stringbody(e, val.str_val);
break;
default:
@@ -591,96 +647,103 @@ static void jsonenc_mapkey(jsonenc *e, upb_msgval val, const upb_fielddef *f) {
jsonenc_putstr(e, "\":");
}
-static void jsonenc_array(jsonenc *e, const upb_array *arr,
- const upb_fielddef *f) {
+static void jsonenc_array(jsonenc* e, const upb_Array* arr,
+ const upb_FieldDef* f) {
size_t i;
- size_t size = arr ? upb_array_size(arr) : 0;
+ size_t size = arr ? upb_Array_Size(arr) : 0;
bool first = true;
jsonenc_putstr(e, "[");
for (i = 0; i < size; i++) {
jsonenc_putsep(e, ",", &first);
- jsonenc_scalar(e, upb_array_get(arr, i), f);
+ jsonenc_scalar(e, upb_Array_Get(arr, i), f);
}
jsonenc_putstr(e, "]");
}
-static void jsonenc_map(jsonenc *e, const upb_map *map, const upb_fielddef *f) {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_itof(entry, 1);
- const upb_fielddef *val_f = upb_msgdef_itof(entry, 2);
- size_t iter = UPB_MAP_BEGIN;
+static void jsonenc_map(jsonenc* e, const upb_Map* map, const upb_FieldDef* f) {
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_FindFieldByNumber(entry, 1);
+ const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(entry, 2);
+ size_t iter = kUpb_Map_Begin;
bool first = true;
jsonenc_putstr(e, "{");
if (map) {
- while (upb_mapiter_next(map, &iter)) {
+ while (upb_MapIterator_Next(map, &iter)) {
jsonenc_putsep(e, ",", &first);
- jsonenc_mapkey(e, upb_mapiter_key(map, iter), key_f);
- jsonenc_scalar(e, upb_mapiter_value(map, iter), val_f);
+ jsonenc_mapkey(e, upb_MapIterator_Key(map, iter), key_f);
+ jsonenc_scalar(e, upb_MapIterator_Value(map, iter), val_f);
}
}
jsonenc_putstr(e, "}");
}
-static void jsonenc_fieldval(jsonenc *e, const upb_fielddef *f,
- upb_msgval val, bool *first) {
- const char *name;
+static void jsonenc_fieldval(jsonenc* e, const upb_FieldDef* f,
+ upb_MessageValue val, bool* first) {
+ const char* name;
+
+ jsonenc_putsep(e, ",", first);
- if (e->options & UPB_JSONENC_PROTONAMES) {
- name = upb_fielddef_name(f);
+ if (upb_FieldDef_IsExtension(f)) {
+ // TODO: For MessageSet, I would have expected this to print the message
+ // name here, but Python doesn't appear to do this. We should do more
+ // research here about what various implementations do.
+ jsonenc_printf(e, "\"[%s]\":", upb_FieldDef_FullName(f));
} else {
- name = upb_fielddef_jsonname(f);
+ if (e->options & upb_JsonEncode_UseProtoNames) {
+ name = upb_FieldDef_Name(f);
+ } else {
+ name = upb_FieldDef_JsonName(f);
+ }
+ jsonenc_printf(e, "\"%s\":", name);
}
- jsonenc_putsep(e, ",", first);
- jsonenc_printf(e, "\"%s\":", name);
-
- if (upb_fielddef_ismap(f)) {
+ if (upb_FieldDef_IsMap(f)) {
jsonenc_map(e, val.map_val, f);
- } else if (upb_fielddef_isseq(f)) {
+ } else if (upb_FieldDef_IsRepeated(f)) {
jsonenc_array(e, val.array_val, f);
} else {
jsonenc_scalar(e, val, f);
}
}
-static void jsonenc_msgfields(jsonenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- upb_msgval val;
- const upb_fielddef *f;
- bool first = true;
+static void jsonenc_msgfields(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m, bool first) {
+ upb_MessageValue val;
+ const upb_FieldDef* f;
- if (e->options & UPB_JSONENC_EMITDEFAULTS) {
+ if (e->options & upb_JsonEncode_EmitDefaults) {
/* Iterate over all fields. */
int i = 0;
- int n = upb_msgdef_fieldcount(m);
+ int n = upb_MessageDef_FieldCount(m);
for (i = 0; i < n; i++) {
- f = upb_msgdef_field(m, i);
- if (!upb_fielddef_haspresence(f) || upb_msg_has(msg, f)) {
- jsonenc_fieldval(e, f, upb_msg_get(msg, f), &first);
+ f = upb_MessageDef_Field(m, i);
+ if (!upb_FieldDef_HasPresence(f) || upb_Message_Has(msg, f)) {
+ jsonenc_fieldval(e, f, upb_Message_Get(msg, f), &first);
}
}
} else {
/* Iterate over non-empty fields. */
- size_t iter = UPB_MSG_BEGIN;
- while (upb_msg_next(msg, m, e->ext_pool, &f, &val, &iter)) {
+ size_t iter = kUpb_Message_Begin;
+ while (upb_Message_Next(msg, m, e->ext_pool, &f, &val, &iter)) {
jsonenc_fieldval(e, f, val, &first);
}
}
}
-static void jsonenc_msg(jsonenc *e, const upb_msg *msg, const upb_msgdef *m) {
+static void jsonenc_msg(jsonenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
jsonenc_putstr(e, "{");
- jsonenc_msgfields(e, msg, m);
+ jsonenc_msgfields(e, msg, m, true);
jsonenc_putstr(e, "}");
}
-static size_t jsonenc_nullz(jsonenc *e, size_t size) {
+static size_t jsonenc_nullz(jsonenc* e, size_t size) {
size_t ret = e->ptr - e->buf + e->overflow;
if (size > 0) {
@@ -691,14 +754,14 @@ static size_t jsonenc_nullz(jsonenc *e, size_t size) {
return ret;
}
-size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, int options, char *buf,
- size_t size, upb_status *status) {
+size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, int options, char* buf,
+ size_t size, upb_Status* status) {
jsonenc e;
e.buf = buf;
e.ptr = buf;
- e.end = buf + size;
+ e.end = UPB_PTRADD(buf, size);
e.overflow = 0;
e.options = options;
e.ext_pool = ext_pool;
@@ -708,6 +771,6 @@ size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m,
if (setjmp(e.err)) return -1;
jsonenc_msgfield(&e, msg, m);
- if (e.arena) upb_arena_free(e.arena);
+ if (e.arena) upb_Arena_Free(e.arena);
return jsonenc_nullz(&e, size);
}
diff --git a/grpc/third_party/upb/upb/json_encode.h b/grpc/third_party/upb/upb/json_encode.h
index 0ad4163c..1ba0b649 100644
--- a/grpc/third_party/upb/upb/json_encode.h
+++ b/grpc/third_party/upb/upb/json_encode.h
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_JSONENCODE_H_
#define UPB_JSONENCODE_H_
@@ -10,11 +36,11 @@ extern "C" {
enum {
/* When set, emits 0/default values. TODO(haberman): proto3 only? */
- UPB_JSONENC_EMITDEFAULTS = 1,
+ upb_JsonEncode_EmitDefaults = 1,
/* When set, use normal (snake_caes) field names instead of JSON (camelCase)
names. */
- UPB_JSONENC_PROTONAMES = 2
+ upb_JsonEncode_UseProtoNames = 2
};
/* Encodes the given |msg| to JSON format. The message's reflection is given in
@@ -25,12 +51,12 @@ enum {
* size (excluding NULL) is returned. This means that a return value >= |size|
* implies that the output was truncated. (These are the same semantics as
* snprintf()). */
-size_t upb_json_encode(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, int options, char *buf,
- size_t size, upb_status *status);
+size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, int options, char* buf,
+ size_t size, upb_Status* status);
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* UPB_JSONENCODE_H_ */
+#endif /* UPB_JSONENCODE_H_ */
diff --git a/grpc/third_party/upb/upb/mini_table.c b/grpc/third_party/upb/upb/mini_table.c
new file mode 100644
index 00000000..d09299e9
--- /dev/null
+++ b/grpc/third_party/upb/upb/mini_table.c
@@ -0,0 +1,1070 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/mini_table.h"
+
+#include <inttypes.h>
+#include <setjmp.h>
+
+#include "upb/msg_internal.h"
+#include "upb/upb.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+typedef enum {
+ kUpb_EncodedType_Double = 0,
+ kUpb_EncodedType_Float = 1,
+ kUpb_EncodedType_Fixed32 = 2,
+ kUpb_EncodedType_Fixed64 = 3,
+ kUpb_EncodedType_SFixed32 = 4,
+ kUpb_EncodedType_SFixed64 = 5,
+ kUpb_EncodedType_Int32 = 6,
+ kUpb_EncodedType_UInt32 = 7,
+ kUpb_EncodedType_SInt32 = 8,
+ kUpb_EncodedType_Int64 = 9,
+ kUpb_EncodedType_UInt64 = 10,
+ kUpb_EncodedType_SInt64 = 11,
+ kUpb_EncodedType_Enum = 12,
+ kUpb_EncodedType_Bool = 13,
+ kUpb_EncodedType_Bytes = 14,
+ kUpb_EncodedType_String = 15,
+ kUpb_EncodedType_Group = 16,
+ kUpb_EncodedType_Message = 17,
+
+ kUpb_EncodedType_RepeatedBase = 20,
+} upb_EncodedType;
+
+typedef enum {
+ kUpb_EncodedFieldModifier_FlipPacked = 1 << 0,
+ kUpb_EncodedFieldModifier_IsClosedEnum = 1 << 1,
+ // upb only.
+ kUpb_EncodedFieldModifier_IsProto3Singular = 1 << 2,
+ kUpb_EncodedFieldModifier_IsRequired = 1 << 3,
+} upb_EncodedFieldModifier;
+
+enum {
+ kUpb_EncodedValue_MinField = ' ',
+ kUpb_EncodedValue_MaxField = 'K',
+ kUpb_EncodedValue_MinModifier = 'L',
+ kUpb_EncodedValue_MaxModifier = '[',
+ kUpb_EncodedValue_End = '^',
+ kUpb_EncodedValue_MinSkip = '_',
+ kUpb_EncodedValue_MaxSkip = '~',
+ kUpb_EncodedValue_OneofSeparator = '~',
+ kUpb_EncodedValue_FieldSeparator = '|',
+ kUpb_EncodedValue_MinOneofField = ' ',
+ kUpb_EncodedValue_MaxOneofField = 'b',
+};
+
+char upb_ToBase92(int8_t ch) {
+ static const char kUpb_ToBase92[] = {
+ ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
+ '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+ 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
+ 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+ 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '{', '|', '}', '~',
+ };
+
+ UPB_ASSERT(0 <= ch && ch < 92);
+ return kUpb_ToBase92[ch];
+}
+
+char upb_FromBase92(uint8_t ch) {
+ static const int8_t kUpb_FromBase92[] = {
+ 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ };
+
+ if (' ' > ch || ch > '~') return -1;
+ return kUpb_FromBase92[ch - ' '];
+}
+
+bool upb_IsTypePackable(upb_FieldType type) {
+ // clang-format off
+ static const unsigned kUnpackableTypes =
+ (1 << kUpb_FieldType_String) |
+ (1 << kUpb_FieldType_Bytes) |
+ (1 << kUpb_FieldType_Message) |
+ (1 << kUpb_FieldType_Group);
+ // clang-format on
+ return (1 << type) & ~kUnpackableTypes;
+}
+
+/** upb_MtDataEncoder *********************************************************/
+
+typedef struct {
+ char* buf_start; // Only for checking kUpb_MtDataEncoder_MinSize.
+ uint64_t msg_mod;
+ uint32_t last_field_num;
+ enum {
+ kUpb_OneofState_NotStarted,
+ kUpb_OneofState_StartedOneof,
+ kUpb_OneofState_EmittedOneofField,
+ } oneof_state;
+} upb_MtDataEncoderInternal;
+
+static upb_MtDataEncoderInternal* upb_MtDataEncoder_GetInternal(
+ upb_MtDataEncoder* e, char* buf_start) {
+ upb_MtDataEncoderInternal* ret = (upb_MtDataEncoderInternal*)e->internal;
+ ret->buf_start = buf_start;
+ return ret;
+}
+
+static char* upb_MtDataEncoder_Put(upb_MtDataEncoder* e, char* ptr, char ch) {
+ upb_MtDataEncoderInternal* in = (upb_MtDataEncoderInternal*)e->internal;
+ UPB_ASSERT(ptr - in->buf_start < kUpb_MtDataEncoder_MinSize);
+ if (ptr == e->end) return NULL;
+ *ptr++ = upb_ToBase92(ch);
+ return ptr;
+}
+
+static char* upb_MtDataEncoder_PutBase92Varint(upb_MtDataEncoder* e, char* ptr,
+ uint32_t val, int min, int max) {
+ int shift = _upb_Log2Ceiling(upb_FromBase92(max) - upb_FromBase92(min) + 1);
+ UPB_ASSERT(shift <= 6);
+ uint32_t mask = (1 << shift) - 1;
+ do {
+ uint32_t bits = val & mask;
+ ptr = upb_MtDataEncoder_Put(e, ptr, bits + upb_FromBase92(min));
+ if (!ptr) return NULL;
+ val >>= shift;
+ } while (val);
+ return ptr;
+}
+
+char* upb_MtDataEncoder_PutModifier(upb_MtDataEncoder* e, char* ptr,
+ uint64_t mod) {
+ if (mod) {
+ ptr = upb_MtDataEncoder_PutBase92Varint(e, ptr, mod,
+ kUpb_EncodedValue_MinModifier,
+ kUpb_EncodedValue_MaxModifier);
+ }
+ return ptr;
+}
+
+char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
+ uint64_t msg_mod) {
+ upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
+ in->msg_mod = msg_mod;
+ in->last_field_num = 0;
+ in->oneof_state = kUpb_OneofState_NotStarted;
+ return upb_MtDataEncoder_PutModifier(e, ptr, msg_mod);
+}
+
+char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
+ upb_FieldType type, uint32_t field_num,
+ uint64_t field_mod) {
+ static const char kUpb_TypeToEncoded[] = {
+ [kUpb_FieldType_Double] = kUpb_EncodedType_Double,
+ [kUpb_FieldType_Float] = kUpb_EncodedType_Float,
+ [kUpb_FieldType_Int64] = kUpb_EncodedType_Int64,
+ [kUpb_FieldType_UInt64] = kUpb_EncodedType_UInt64,
+ [kUpb_FieldType_Int32] = kUpb_EncodedType_Int32,
+ [kUpb_FieldType_Fixed64] = kUpb_EncodedType_Fixed64,
+ [kUpb_FieldType_Fixed32] = kUpb_EncodedType_Fixed32,
+ [kUpb_FieldType_Bool] = kUpb_EncodedType_Bool,
+ [kUpb_FieldType_String] = kUpb_EncodedType_String,
+ [kUpb_FieldType_Group] = kUpb_EncodedType_Group,
+ [kUpb_FieldType_Message] = kUpb_EncodedType_Message,
+ [kUpb_FieldType_Bytes] = kUpb_EncodedType_Bytes,
+ [kUpb_FieldType_UInt32] = kUpb_EncodedType_UInt32,
+ [kUpb_FieldType_Enum] = kUpb_EncodedType_Enum,
+ [kUpb_FieldType_SFixed32] = kUpb_EncodedType_SFixed32,
+ [kUpb_FieldType_SFixed64] = kUpb_EncodedType_SFixed64,
+ [kUpb_FieldType_SInt32] = kUpb_EncodedType_SInt32,
+ [kUpb_FieldType_SInt64] = kUpb_EncodedType_SInt64,
+ };
+
+ upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
+ if (field_num <= in->last_field_num) return NULL;
+ if (in->last_field_num + 1 != field_num) {
+ // Put skip.
+ UPB_ASSERT(field_num > in->last_field_num);
+ uint32_t skip = field_num - in->last_field_num;
+ ptr = upb_MtDataEncoder_PutBase92Varint(
+ e, ptr, skip, kUpb_EncodedValue_MinSkip, kUpb_EncodedValue_MaxSkip);
+ if (!ptr) return NULL;
+ }
+ in->last_field_num = field_num;
+
+ uint32_t encoded_modifiers = 0;
+
+ // Put field type.
+ if (type == kUpb_FieldType_Enum &&
+ !(field_mod & kUpb_FieldModifier_IsClosedEnum)) {
+ type = kUpb_FieldType_Int32;
+ }
+
+ int encoded_type = kUpb_TypeToEncoded[type];
+ if (field_mod & kUpb_FieldModifier_IsRepeated) {
+ // Repeated fields shift the type number up (unlike other modifiers which
+ // are bit flags).
+ encoded_type += kUpb_EncodedType_RepeatedBase;
+
+ if (upb_IsTypePackable(type)) {
+ bool field_is_packed = field_mod & kUpb_FieldModifier_IsPacked;
+ bool default_is_packed =
+ in->msg_mod & kUpb_MessageModifier_DefaultIsPacked;
+ if (field_is_packed != default_is_packed) {
+ encoded_modifiers |= kUpb_EncodedFieldModifier_FlipPacked;
+ }
+ }
+ }
+ ptr = upb_MtDataEncoder_Put(e, ptr, encoded_type);
+ if (!ptr) return NULL;
+
+ if (field_mod & kUpb_FieldModifier_IsProto3Singular) {
+ encoded_modifiers |= kUpb_EncodedFieldModifier_IsProto3Singular;
+ }
+ if (field_mod & kUpb_FieldModifier_IsRequired) {
+ encoded_modifiers |= kUpb_EncodedFieldModifier_IsRequired;
+ }
+ return upb_MtDataEncoder_PutModifier(e, ptr, encoded_modifiers);
+}
+
+char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr) {
+ upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
+ if (in->oneof_state == kUpb_OneofState_NotStarted) {
+ ptr = upb_MtDataEncoder_Put(e, ptr, upb_FromBase92(kUpb_EncodedValue_End));
+ } else {
+ ptr = upb_MtDataEncoder_Put(
+ e, ptr, upb_FromBase92(kUpb_EncodedValue_OneofSeparator));
+ }
+ in->oneof_state = kUpb_OneofState_StartedOneof;
+ return ptr;
+}
+
+char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
+ uint32_t field_num) {
+ upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr);
+ if (in->oneof_state == kUpb_OneofState_EmittedOneofField) {
+ ptr = upb_MtDataEncoder_Put(
+ e, ptr, upb_FromBase92(kUpb_EncodedValue_FieldSeparator));
+ if (!ptr) return NULL;
+ }
+ ptr = upb_MtDataEncoder_PutBase92Varint(e, ptr, field_num, upb_ToBase92(0),
+ upb_ToBase92(63));
+ in->oneof_state = kUpb_OneofState_EmittedOneofField;
+ return ptr;
+}
+
+const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber(
+ const upb_MiniTable* table, uint32_t number) {
+ int n = table->field_count;
+ for (int i = 0; i < n; i++) {
+ if (table->fields[i].number == number) {
+ return &table->fields[i];
+ }
+ }
+ return NULL;
+}
+
+/** Data decoder **************************************************************/
+
+// Note: we sort by this number when calculating layout order.
+typedef enum {
+ kUpb_LayoutItemType_OneofCase, // Oneof case.
+ kUpb_LayoutItemType_OneofField, // Oneof field data.
+ kUpb_LayoutItemType_Field, // Non-oneof field data.
+
+ kUpb_LayoutItemType_Max = kUpb_LayoutItemType_Field,
+} upb_LayoutItemType;
+
+#define kUpb_LayoutItem_IndexSentinel ((uint16_t)-1)
+
+typedef struct {
+ // Index of the corresponding field. When this is a oneof field, the field's
+ // offset will be the index of the next field in a linked list.
+ uint16_t field_index;
+ uint16_t offset;
+ upb_FieldRep rep;
+ upb_LayoutItemType type;
+} upb_LayoutItem;
+
+typedef struct {
+ upb_LayoutItem* data;
+ size_t size;
+ size_t capacity;
+} upb_LayoutItemVector;
+
+typedef struct {
+ const char* end;
+ upb_MiniTable* table;
+ upb_MiniTable_Field* fields;
+ upb_MiniTablePlatform platform;
+ upb_LayoutItemVector vec;
+ upb_Arena* arena;
+ upb_Status* status;
+ jmp_buf err;
+} upb_MtDecoder;
+
+UPB_PRINTF(2, 3)
+UPB_NORETURN static void upb_MtDecoder_ErrorFormat(upb_MtDecoder* d,
+ const char* fmt, ...) {
+ va_list argp;
+ upb_Status_SetErrorMessage(d->status, "Error building mini table: ");
+ va_start(argp, fmt);
+ upb_Status_VAppendErrorFormat(d->status, fmt, argp);
+ va_end(argp);
+ UPB_LONGJMP(d->err, 1);
+}
+
+static void upb_MtDecoder_CheckOutOfMemory(upb_MtDecoder* d, const void* ptr) {
+ if (!ptr) upb_MtDecoder_ErrorFormat(d, "Out of memory");
+}
+
+// In each field's offset, we temporarily store a presence classifier:
+enum PresenceClass {
+ kNoPresence = 0,
+ kHasbitPresence = 1,
+ kRequiredPresence = 2,
+ kOneofBase = 3,
+ // Negative values refer to a specific oneof with that number. Positive
+ // values >= kOneofBase indicate that this field is in a oneof, and specify
+ // the next field in this oneof's linked list.
+};
+
+static const char* upb_MiniTable_DecodeBase92Varint(upb_MtDecoder* d,
+ const char* ptr,
+ char first_ch, uint8_t min,
+ uint8_t max,
+ uint32_t* out_val) {
+ uint32_t val = 0;
+ uint32_t shift = 0;
+ const int bits_per_char =
+ _upb_Log2Ceiling(upb_FromBase92(max) - upb_FromBase92(min));
+ char ch = first_ch;
+ while (1) {
+ uint32_t bits = upb_FromBase92(ch) - upb_FromBase92(min);
+ UPB_ASSERT(shift < 32 - bits_per_char);
+ val |= bits << shift;
+ if (ptr == d->end || *ptr < min || max < *ptr) {
+ *out_val = val;
+ return ptr;
+ }
+ ch = *ptr++;
+ shift += bits_per_char;
+ }
+}
+
+static bool upb_MiniTable_HasSub(upb_MiniTable_Field* field,
+ uint64_t msg_modifiers) {
+ switch (field->descriptortype) {
+ case kUpb_FieldType_Message:
+ case kUpb_FieldType_Group:
+ case kUpb_FieldType_Enum:
+ return true;
+ case kUpb_FieldType_String:
+ if (!(msg_modifiers & kUpb_MessageModifier_ValidateUtf8)) {
+ field->descriptortype = kUpb_FieldType_Bytes;
+ }
+ return false;
+ default:
+ return false;
+ }
+}
+
+static bool upb_MtDecoder_FieldIsPackable(upb_MiniTable_Field* field) {
+ return (field->mode & kUpb_FieldMode_Array) &&
+ upb_IsTypePackable(field->descriptortype);
+}
+
+static void upb_MiniTable_SetTypeAndSub(upb_MiniTable_Field* field,
+ upb_FieldType type, uint32_t* sub_count,
+ uint64_t msg_modifiers) {
+ field->descriptortype = type;
+ if (upb_MiniTable_HasSub(field, msg_modifiers)) {
+ field->submsg_index = sub_count ? (*sub_count)++ : 0;
+ } else {
+ field->submsg_index = kUpb_NoSub;
+ }
+
+ if (upb_MtDecoder_FieldIsPackable(field) &&
+ (msg_modifiers & kUpb_MessageModifier_DefaultIsPacked)) {
+ field->mode |= kUpb_LabelFlags_IsPacked;
+ }
+}
+
+static void upb_MiniTable_SetField(upb_MtDecoder* d, uint8_t ch,
+ upb_MiniTable_Field* field,
+ uint64_t msg_modifiers,
+ uint32_t* sub_count) {
+ static const char kUpb_EncodedToFieldRep[] = {
+ [kUpb_EncodedType_Double] = kUpb_FieldRep_8Byte,
+ [kUpb_EncodedType_Float] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_Int64] = kUpb_FieldRep_8Byte,
+ [kUpb_EncodedType_UInt64] = kUpb_FieldRep_8Byte,
+ [kUpb_EncodedType_Int32] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_Fixed64] = kUpb_FieldRep_8Byte,
+ [kUpb_EncodedType_Fixed32] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_Bool] = kUpb_FieldRep_1Byte,
+ [kUpb_EncodedType_String] = kUpb_FieldRep_StringView,
+ [kUpb_EncodedType_Group] = kUpb_FieldRep_Pointer,
+ [kUpb_EncodedType_Message] = kUpb_FieldRep_Pointer,
+ [kUpb_EncodedType_Bytes] = kUpb_FieldRep_StringView,
+ [kUpb_EncodedType_UInt32] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_Enum] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_SFixed32] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_SFixed64] = kUpb_FieldRep_8Byte,
+ [kUpb_EncodedType_SInt32] = kUpb_FieldRep_4Byte,
+ [kUpb_EncodedType_SInt64] = kUpb_FieldRep_8Byte,
+ };
+
+ static const char kUpb_EncodedToType[] = {
+ [kUpb_EncodedType_Double] = kUpb_FieldType_Double,
+ [kUpb_EncodedType_Float] = kUpb_FieldType_Float,
+ [kUpb_EncodedType_Int64] = kUpb_FieldType_Int64,
+ [kUpb_EncodedType_UInt64] = kUpb_FieldType_UInt64,
+ [kUpb_EncodedType_Int32] = kUpb_FieldType_Int32,
+ [kUpb_EncodedType_Fixed64] = kUpb_FieldType_Fixed64,
+ [kUpb_EncodedType_Fixed32] = kUpb_FieldType_Fixed32,
+ [kUpb_EncodedType_Bool] = kUpb_FieldType_Bool,
+ [kUpb_EncodedType_String] = kUpb_FieldType_String,
+ [kUpb_EncodedType_Group] = kUpb_FieldType_Group,
+ [kUpb_EncodedType_Message] = kUpb_FieldType_Message,
+ [kUpb_EncodedType_Bytes] = kUpb_FieldType_Bytes,
+ [kUpb_EncodedType_UInt32] = kUpb_FieldType_UInt32,
+ [kUpb_EncodedType_Enum] = kUpb_FieldType_Enum,
+ [kUpb_EncodedType_SFixed32] = kUpb_FieldType_SFixed32,
+ [kUpb_EncodedType_SFixed64] = kUpb_FieldType_SFixed64,
+ [kUpb_EncodedType_SInt32] = kUpb_FieldType_SInt32,
+ [kUpb_EncodedType_SInt64] = kUpb_FieldType_SInt64,
+ };
+
+ int8_t type = upb_FromBase92(ch);
+ if (ch >= upb_ToBase92(kUpb_EncodedType_RepeatedBase)) {
+ type -= kUpb_EncodedType_RepeatedBase;
+ field->mode = kUpb_FieldMode_Array;
+ field->mode |= kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift;
+ field->offset = kNoPresence;
+ } else {
+ field->mode = kUpb_FieldMode_Scalar;
+ field->mode |= kUpb_EncodedToFieldRep[type] << kUpb_FieldRep_Shift;
+ field->offset = kHasbitPresence;
+ }
+ if (type >= 18) {
+ upb_MtDecoder_ErrorFormat(d, "Invalid field type: %d", (int)type);
+ UPB_UNREACHABLE();
+ }
+ upb_MiniTable_SetTypeAndSub(field, kUpb_EncodedToType[type], sub_count,
+ msg_modifiers);
+}
+
+static void upb_MtDecoder_ModifyField(upb_MtDecoder* d,
+ uint32_t message_modifiers,
+ uint32_t field_modifiers,
+ upb_MiniTable_Field* field) {
+ if (field_modifiers & kUpb_EncodedFieldModifier_FlipPacked) {
+ if (!upb_MtDecoder_FieldIsPackable(field)) {
+ upb_MtDecoder_ErrorFormat(
+ d, "Cannot flip packed on unpackable field %" PRIu32, field->number);
+ UPB_UNREACHABLE();
+ }
+ field->mode ^= kUpb_LabelFlags_IsPacked;
+ }
+
+ bool singular = field_modifiers & kUpb_EncodedFieldModifier_IsProto3Singular;
+ bool required = field_modifiers & kUpb_EncodedFieldModifier_IsRequired;
+
+ // Validate.
+ if ((singular || required) && field->offset != kHasbitPresence) {
+ upb_MtDecoder_ErrorFormat(
+ d, "Invalid modifier(s) for repeated field %" PRIu32, field->number);
+ UPB_UNREACHABLE();
+ }
+ if (singular && required) {
+ upb_MtDecoder_ErrorFormat(
+ d, "Field %" PRIu32 " cannot be both singular and required",
+ field->number);
+ UPB_UNREACHABLE();
+ }
+
+ if (singular) field->offset = kNoPresence;
+ if (required) {
+ field->offset = kRequiredPresence;
+ }
+}
+
+static void upb_MtDecoder_PushItem(upb_MtDecoder* d, upb_LayoutItem item) {
+ if (d->vec.size == d->vec.capacity) {
+ size_t new_cap = UPB_MAX(8, d->vec.size * 2);
+ d->vec.data = realloc(d->vec.data, new_cap * sizeof(*d->vec.data));
+ upb_MtDecoder_CheckOutOfMemory(d, d->vec.data);
+ d->vec.capacity = new_cap;
+ }
+ d->vec.data[d->vec.size++] = item;
+}
+
+static void upb_MtDecoder_PushOneof(upb_MtDecoder* d, upb_LayoutItem item) {
+ if (item.field_index == kUpb_LayoutItem_IndexSentinel) {
+ upb_MtDecoder_ErrorFormat(d, "Empty oneof");
+ UPB_UNREACHABLE();
+ }
+ item.field_index -= kOneofBase;
+
+ // Push oneof data.
+ item.type = kUpb_LayoutItemType_OneofField;
+ upb_MtDecoder_PushItem(d, item);
+
+ // Push oneof case.
+ item.rep = kUpb_FieldRep_4Byte; // Field Number.
+ item.type = kUpb_LayoutItemType_OneofCase;
+ upb_MtDecoder_PushItem(d, item);
+}
+
+size_t upb_MtDecoder_SizeOfRep(upb_FieldRep rep,
+ upb_MiniTablePlatform platform) {
+ static const uint8_t kRepToSize32[] = {
+ [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4,
+ [kUpb_FieldRep_Pointer] = 4, [kUpb_FieldRep_StringView] = 8,
+ [kUpb_FieldRep_8Byte] = 8,
+ };
+ static const uint8_t kRepToSize64[] = {
+ [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4,
+ [kUpb_FieldRep_Pointer] = 8, [kUpb_FieldRep_StringView] = 16,
+ [kUpb_FieldRep_8Byte] = 8,
+ };
+ UPB_ASSERT(sizeof(upb_StringView) ==
+ UPB_SIZE(kRepToSize32, kRepToSize64)[kUpb_FieldRep_StringView]);
+ return platform == kUpb_MiniTablePlatform_32Bit ? kRepToSize32[rep]
+ : kRepToSize64[rep];
+}
+
+size_t upb_MtDecoder_AlignOfRep(upb_FieldRep rep,
+ upb_MiniTablePlatform platform) {
+ static const uint8_t kRepToAlign32[] = {
+ [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4,
+ [kUpb_FieldRep_Pointer] = 4, [kUpb_FieldRep_StringView] = 4,
+ [kUpb_FieldRep_8Byte] = 8,
+ };
+ static const uint8_t kRepToAlign64[] = {
+ [kUpb_FieldRep_1Byte] = 1, [kUpb_FieldRep_4Byte] = 4,
+ [kUpb_FieldRep_Pointer] = 8, [kUpb_FieldRep_StringView] = 8,
+ [kUpb_FieldRep_8Byte] = 8,
+ };
+ UPB_ASSERT(UPB_ALIGN_OF(upb_StringView) ==
+ UPB_SIZE(kRepToAlign32, kRepToAlign64)[kUpb_FieldRep_StringView]);
+ return platform == kUpb_MiniTablePlatform_32Bit ? kRepToAlign32[rep]
+ : kRepToAlign64[rep];
+}
+
+static const char* upb_MtDecoder_DecodeOneofField(upb_MtDecoder* d,
+ const char* ptr,
+ char first_ch,
+ upb_LayoutItem* item) {
+ uint32_t field_num;
+ ptr = upb_MiniTable_DecodeBase92Varint(
+ d, ptr, first_ch, kUpb_EncodedValue_MinOneofField,
+ kUpb_EncodedValue_MaxOneofField, &field_num);
+ upb_MiniTable_Field* f =
+ (void*)upb_MiniTable_FindFieldByNumber(d->table, field_num);
+
+ if (!f) {
+ upb_MtDecoder_ErrorFormat(d,
+ "Couldn't add field number %" PRIu32
+ " to oneof, no such field number.",
+ field_num);
+ UPB_UNREACHABLE();
+ }
+ if (f->offset != kHasbitPresence) {
+ upb_MtDecoder_ErrorFormat(
+ d,
+ "Cannot add repeated, required, or singular field %" PRIu32
+ " to oneof.",
+ field_num);
+ UPB_UNREACHABLE();
+ }
+
+ // Oneof storage must be large enough to accommodate the largest member.
+ int rep = f->mode >> kUpb_FieldRep_Shift;
+ if (upb_MtDecoder_SizeOfRep(rep, d->platform) >
+ upb_MtDecoder_SizeOfRep(item->rep, d->platform)) {
+ item->rep = rep;
+ }
+ // Prepend this field to the linked list.
+ f->offset = item->field_index;
+ item->field_index = (f - d->fields) + kOneofBase;
+ return ptr;
+}
+
+static const char* upb_MtDecoder_DecodeOneofs(upb_MtDecoder* d,
+ const char* ptr) {
+ upb_LayoutItem item = {.rep = 0,
+ .field_index = kUpb_LayoutItem_IndexSentinel};
+ while (ptr < d->end) {
+ char ch = *ptr++;
+ if (ch == kUpb_EncodedValue_FieldSeparator) {
+ // Field separator, no action needed.
+ } else if (ch == kUpb_EncodedValue_OneofSeparator) {
+ // End of oneof.
+ upb_MtDecoder_PushOneof(d, item);
+ item.field_index = kUpb_LayoutItem_IndexSentinel; // Move to next oneof.
+ } else {
+ ptr = upb_MtDecoder_DecodeOneofField(d, ptr, ch, &item);
+ }
+ }
+
+ // Push final oneof.
+ upb_MtDecoder_PushOneof(d, item);
+ return ptr;
+}
+
+static const char* upb_MtDecoder_ParseModifier(upb_MtDecoder* d,
+ const char* ptr, char first_ch,
+ upb_MiniTable_Field* last_field,
+ uint64_t* msg_modifiers) {
+ uint32_t mod;
+ ptr = upb_MiniTable_DecodeBase92Varint(d, ptr, first_ch,
+ kUpb_EncodedValue_MinModifier,
+ kUpb_EncodedValue_MaxModifier, &mod);
+ if (last_field) {
+ upb_MtDecoder_ModifyField(d, *msg_modifiers, mod, last_field);
+ } else {
+ if (!d->table) {
+ upb_MtDecoder_ErrorFormat(d, "Extensions cannot have message modifiers");
+ UPB_UNREACHABLE();
+ }
+ *msg_modifiers = mod;
+ }
+
+ return ptr;
+}
+
+static void upb_MtDecoder_AllocateSubs(upb_MtDecoder* d, uint32_t sub_count) {
+ size_t subs_bytes = sizeof(*d->table->subs) * sub_count;
+ d->table->subs = upb_Arena_Malloc(d->arena, subs_bytes);
+ upb_MtDecoder_CheckOutOfMemory(d, d->table->subs);
+}
+
+static void upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, size_t len,
+ void* fields, size_t field_size,
+ uint16_t* field_count, uint32_t* sub_count) {
+ uint64_t msg_modifiers = 0;
+ uint32_t last_field_number = 0;
+ upb_MiniTable_Field* last_field = NULL;
+ bool need_dense_below = d->table != NULL;
+
+ d->end = UPB_PTRADD(ptr, len);
+
+ while (ptr < d->end) {
+ char ch = *ptr++;
+ if (ch <= kUpb_EncodedValue_MaxField) {
+ upb_MiniTable_Field* field = fields;
+ *field_count += 1;
+ fields = (char*)fields + field_size;
+ field->number = ++last_field_number;
+ last_field = field;
+ upb_MiniTable_SetField(d, ch, field, msg_modifiers, sub_count);
+ } else if (kUpb_EncodedValue_MinModifier <= ch &&
+ ch <= kUpb_EncodedValue_MaxModifier) {
+ ptr = upb_MtDecoder_ParseModifier(d, ptr, ch, last_field, &msg_modifiers);
+ } else if (ch == kUpb_EncodedValue_End) {
+ if (!d->table) {
+ upb_MtDecoder_ErrorFormat(d, "Extensions cannot have oneofs.");
+ UPB_UNREACHABLE();
+ }
+ ptr = upb_MtDecoder_DecodeOneofs(d, ptr);
+ } else if (kUpb_EncodedValue_MinSkip <= ch &&
+ ch <= kUpb_EncodedValue_MaxSkip) {
+ if (need_dense_below) {
+ d->table->dense_below = d->table->field_count;
+ need_dense_below = false;
+ }
+ uint32_t skip;
+ ptr = upb_MiniTable_DecodeBase92Varint(d, ptr, ch,
+ kUpb_EncodedValue_MinSkip,
+ kUpb_EncodedValue_MaxSkip, &skip);
+ last_field_number += skip;
+ last_field_number--; // Next field seen will increment.
+ }
+ }
+
+ if (need_dense_below) {
+ d->table->dense_below = d->table->field_count;
+ }
+}
+
+static void upb_MtDecoder_ParseMessage(upb_MtDecoder* d, const char* data,
+ size_t len) {
+ // Buffer length is an upper bound on the number of fields. We will return
+ // what we don't use.
+ d->fields = upb_Arena_Malloc(d->arena, sizeof(*d->fields) * len);
+ upb_MtDecoder_CheckOutOfMemory(d, d->fields);
+
+ uint32_t sub_count = 0;
+ d->table->field_count = 0;
+ d->table->fields = d->fields;
+ upb_MtDecoder_Parse(d, data, len, d->fields, sizeof(*d->fields),
+ &d->table->field_count, &sub_count);
+
+ upb_Arena_ShrinkLast(d->arena, d->fields, sizeof(*d->fields) * len,
+ sizeof(*d->fields) * d->table->field_count);
+ d->table->fields = d->fields;
+ upb_MtDecoder_AllocateSubs(d, sub_count);
+}
+
+int upb_MtDecoder_CompareFields(const void* _a, const void* _b) {
+ const upb_LayoutItem* a = _a;
+ const upb_LayoutItem* b = _b;
+ // Currently we just sort by:
+ // 1. rep (smallest fields first)
+ // 2. type (oneof cases first)
+ // 2. field_index (smallest numbers first)
+ // The main goal of this is to reduce space lost to padding.
+ // Later we may have more subtle reasons to prefer a different ordering.
+ const int rep_bits = _upb_Log2Ceiling(kUpb_FieldRep_Max);
+ const int type_bits = _upb_Log2Ceiling(kUpb_LayoutItemType_Max);
+ const int idx_bits = (sizeof(a->field_index) * 8);
+ UPB_ASSERT(idx_bits + rep_bits + type_bits < 32);
+#define UPB_COMBINE(rep, ty, idx) (((rep << type_bits) | ty) << idx_bits) | idx
+ uint32_t a_packed = UPB_COMBINE(a->rep, a->type, a->field_index);
+ uint32_t b_packed = UPB_COMBINE(b->rep, b->type, b->field_index);
+ assert(a_packed != b_packed);
+#undef UPB_COMBINE
+ return a_packed < b_packed ? -1 : 1;
+}
+
+static bool upb_MtDecoder_SortLayoutItems(upb_MtDecoder* d) {
+ // Add items for all non-oneof fields (oneofs were already added).
+ int n = d->table->field_count;
+ for (int i = 0; i < n; i++) {
+ upb_MiniTable_Field* f = &d->fields[i];
+ if (f->offset >= kOneofBase) continue;
+ upb_LayoutItem item = {.field_index = i,
+ .rep = f->mode >> kUpb_FieldRep_Shift,
+ .type = kUpb_LayoutItemType_Field};
+ upb_MtDecoder_PushItem(d, item);
+ }
+
+ if (d->vec.size) {
+ qsort(d->vec.data, d->vec.size, sizeof(*d->vec.data),
+ upb_MtDecoder_CompareFields);
+ }
+
+ return true;
+}
+
+static size_t upb_MiniTable_DivideRoundUp(size_t n, size_t d) {
+ return (n + d - 1) / d;
+}
+
+static void upb_MtDecoder_AssignHasbits(upb_MiniTable* ret) {
+ int n = ret->field_count;
+ int last_hasbit = 0; // 0 cannot be used.
+
+ // First assign required fields, which must have the lowest hasbits.
+ for (int i = 0; i < n; i++) {
+ upb_MiniTable_Field* field = (upb_MiniTable_Field*)&ret->fields[i];
+ if (field->offset == kRequiredPresence) {
+ field->presence = ++last_hasbit;
+ } else if (field->offset == kNoPresence) {
+ field->presence = 0;
+ }
+ }
+ ret->required_count = last_hasbit;
+
+ // Next assign non-required hasbit fields.
+ for (int i = 0; i < n; i++) {
+ upb_MiniTable_Field* field = (upb_MiniTable_Field*)&ret->fields[i];
+ if (field->offset == kHasbitPresence) {
+ field->presence = ++last_hasbit;
+ }
+ }
+
+ ret->size = last_hasbit ? upb_MiniTable_DivideRoundUp(last_hasbit + 1, 8) : 0;
+}
+
+size_t upb_MtDecoder_Place(upb_MtDecoder* d, upb_FieldRep rep) {
+ size_t size = upb_MtDecoder_SizeOfRep(rep, d->platform);
+ size_t align = upb_MtDecoder_AlignOfRep(rep, d->platform);
+ size_t ret = UPB_ALIGN_UP(d->table->size, align);
+ d->table->size = ret + size;
+ return ret;
+}
+
+static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) {
+ upb_LayoutItem* end = UPB_PTRADD(d->vec.data, d->vec.size);
+
+ // Compute offsets.
+ for (upb_LayoutItem* item = d->vec.data; item < end; item++) {
+ item->offset = upb_MtDecoder_Place(d, item->rep);
+ }
+
+ // Assign oneof case offsets. We must do these first, since assigning
+ // actual offsets will overwrite the links of the linked list.
+ for (upb_LayoutItem* item = d->vec.data; item < end; item++) {
+ if (item->type != kUpb_LayoutItemType_OneofCase) continue;
+ upb_MiniTable_Field* f = &d->fields[item->field_index];
+ while (true) {
+ f->presence = ~item->offset;
+ if (f->offset == kUpb_LayoutItem_IndexSentinel) break;
+ UPB_ASSERT(f->offset - kOneofBase < d->table->field_count);
+ f = &d->fields[f->offset - kOneofBase];
+ }
+ }
+
+ // Assign offsets.
+ for (upb_LayoutItem* item = d->vec.data; item < end; item++) {
+ upb_MiniTable_Field* f = &d->fields[item->field_index];
+ switch (item->type) {
+ case kUpb_LayoutItemType_OneofField:
+ while (true) {
+ uint16_t next_offset = f->offset;
+ f->offset = item->offset;
+ if (next_offset == kUpb_LayoutItem_IndexSentinel) break;
+ f = &d->fields[next_offset - kOneofBase];
+ }
+ break;
+ case kUpb_LayoutItemType_Field:
+ f->offset = item->offset;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (d->platform == kUpb_MiniTablePlatform_64Bit) {
+ // For compatibility with fast table parsing, we have to align this up to a
+ // multiple of 16 + 8. This is because arena alloc size must be a multiple
+ // of 16, but we will add sizeof(upb_Message_Internal) at runtime, as the
+ // table size does not include this value.
+ //
+ // This is a bit convoluted and should probably be simplified.
+ d->table->size = UPB_ALIGN_UP(d->table->size, 8);
+ if (UPB_ALIGN_UP(d->table->size, 16) == d->table->size) {
+ d->table->size += 8;
+ }
+ }
+}
+
+upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, void** buf,
+ size_t* buf_size,
+ upb_Status* status) {
+ upb_MtDecoder decoder = {
+ .platform = platform,
+ .vec =
+ {
+ .data = *buf,
+ .capacity = *buf_size / sizeof(*decoder.vec.data),
+ .size = 0,
+ },
+ .arena = arena,
+ .status = status,
+ .table = upb_Arena_Malloc(arena, sizeof(*decoder.table)),
+ };
+
+ if (UPB_SETJMP(decoder.err)) {
+ decoder.table = NULL;
+ goto done;
+ }
+
+ upb_MtDecoder_CheckOutOfMemory(&decoder, decoder.table);
+
+ decoder.table->size = 0;
+ decoder.table->field_count = 0;
+ decoder.table->ext = kUpb_ExtMode_NonExtendable;
+ decoder.table->dense_below = 0;
+ decoder.table->table_mask = 0;
+ decoder.table->required_count = 0;
+
+ upb_MtDecoder_ParseMessage(&decoder, data, len);
+ upb_MtDecoder_AssignHasbits(decoder.table);
+ upb_MtDecoder_SortLayoutItems(&decoder);
+ upb_MtDecoder_AssignOffsets(&decoder);
+
+done:
+ *buf = decoder.vec.data;
+ *buf_size = decoder.vec.capacity / sizeof(*decoder.vec.data);
+ return decoder.table;
+}
+
+upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform,
+ upb_Arena* arena) {
+ upb_MiniTable* ret = upb_Arena_Malloc(arena, sizeof(*ret));
+ if (!ret) return NULL;
+
+ ret->size = 0;
+ ret->field_count = 0;
+ ret->ext = kUpb_ExtMode_IsMessageSet;
+ ret->dense_below = 0;
+ ret->table_mask = 0;
+ ret->required_count = 0;
+ return ret;
+}
+
+upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
+ upb_FieldType value_type,
+ bool value_is_proto3_enum,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena) {
+ upb_MiniTable* ret = upb_Arena_Malloc(arena, sizeof(*ret));
+ upb_MiniTable_Field* fields = upb_Arena_Malloc(arena, sizeof(*fields) * 2);
+ if (!ret || !fields) return NULL;
+
+ upb_MiniTable_Sub* subs = NULL;
+ if (value_is_proto3_enum) value_type = kUpb_FieldType_Int32;
+ if (value_type == kUpb_FieldType_Message ||
+ value_type == kUpb_FieldType_Group || value_type == kUpb_FieldType_Enum) {
+ subs = upb_Arena_Malloc(arena, sizeof(*subs));
+ if (!subs) return NULL;
+ }
+
+ size_t field_size =
+ upb_MtDecoder_SizeOfRep(kUpb_FieldRep_StringView, platform);
+
+ fields[0].number = 1;
+ fields[1].number = 2;
+ fields[0].mode = kUpb_FieldMode_Scalar;
+ fields[1].mode = kUpb_FieldMode_Scalar;
+ fields[0].presence = 0;
+ fields[1].presence = 0;
+ fields[0].offset = 0;
+ fields[1].offset = field_size;
+
+ upb_MiniTable_SetTypeAndSub(&fields[0], key_type, NULL, 0);
+ upb_MiniTable_SetTypeAndSub(&fields[1], value_type, NULL, 0);
+
+ ret->size = UPB_ALIGN_UP(2 * field_size, 8);
+ ret->field_count = 2;
+ ret->ext = kUpb_ExtMode_NonExtendable | kUpb_ExtMode_IsMapEntry;
+ ret->dense_below = 2;
+ ret->table_mask = 0;
+ ret->required_count = 0;
+ ret->subs = subs;
+ ret->fields = fields;
+ return ret;
+}
+
+upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+ upb_Arena* arena,
+ upb_Status* status) {
+ upb_MtDecoder decoder = {
+ .status = status,
+ };
+
+ if (UPB_SETJMP(decoder.err)) {
+ return NULL;
+ }
+
+ upb_MiniTable_Enum* table = upb_Arena_Malloc(arena, sizeof(*table));
+ upb_MtDecoder_CheckOutOfMemory(&decoder, table);
+
+ table->mask = 0;
+ table->value_count = 0;
+ table->values = NULL;
+
+ const char* ptr = data;
+ const char* end = UPB_PTRADD(data, len);
+
+ // Currently we do minimal validation of invariants (eg. that values are in
+ // order). We may want to add these, but more likely, we will want the format
+ // to be a more compact variation where these errors are not possible.
+ while (end - ptr >= 4) {
+ uint32_t val;
+ memcpy(&val, ptr, 4);
+ if (val >= 64) break;
+ table->mask |= 1ULL << val;
+ ptr += 4;
+ }
+
+ if (ptr != end) {
+ size_t bytes = end - ptr;
+ if (bytes % 4 != 0) {
+ upb_MtDecoder_ErrorFormat(&decoder, "Bytes should be a multiple of 4");
+ UPB_UNREACHABLE();
+ }
+ table->values = upb_Arena_Malloc(arena, end - ptr);
+ upb_MtDecoder_CheckOutOfMemory(&decoder, table);
+ memcpy((void*)table->values, ptr, end - ptr);
+ table->value_count = bytes / 4;
+ }
+
+ return table;
+}
+
+bool upb_MiniTable_BuildExtension(const char* data, size_t len,
+ upb_MiniTable_Extension* ext,
+ upb_MiniTable_Sub sub, upb_Status* status) {
+ upb_MtDecoder decoder = {
+ .arena = NULL,
+ .status = status,
+ .table = NULL,
+ };
+
+ if (UPB_SETJMP(decoder.err)) {
+ return false;
+ }
+
+ uint16_t count = 0;
+ upb_MtDecoder_Parse(&decoder, data, len, ext, sizeof(*ext), &count, NULL);
+ ext->field.mode |= kUpb_LabelFlags_IsExtension;
+ ext->field.offset = 0;
+ return true;
+}
+
+upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status) {
+ void* buf = NULL;
+ size_t size = 0;
+ upb_MiniTable* ret = upb_MiniTable_BuildWithBuf(data, len, platform, arena,
+ &buf, &size, status);
+ free(buf);
+ return ret;
+}
+
+void upb_MiniTable_SetSubMessage(upb_MiniTable* table,
+ upb_MiniTable_Field* field,
+ const upb_MiniTable* sub) {
+ UPB_ASSERT((uintptr_t)table->fields <= (uintptr_t)field &&
+ (uintptr_t)field <
+ (uintptr_t)(table->fields + table->field_count));
+ if (sub->ext & kUpb_ExtMode_IsMapEntry) {
+ field->mode =
+ (kUpb_FieldRep_Pointer << kUpb_FieldRep_Shift) | kUpb_FieldMode_Map;
+ }
+ upb_MiniTable_Sub* table_sub = (void*)&table->subs[field->submsg_index];
+ table_sub->submsg = sub;
+}
+
+void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field,
+ const upb_MiniTable_Enum* sub) {
+ UPB_ASSERT((uintptr_t)table->fields <= (uintptr_t)field &&
+ (uintptr_t)field <
+ (uintptr_t)(table->fields + table->field_count));
+ upb_MiniTable_Sub* table_sub = (void*)&table->subs[field->submsg_index];
+ table_sub->subenum = sub;
+}
diff --git a/grpc/third_party/upb/upb/mini_table.h b/grpc/third_party/upb/upb/mini_table.h
new file mode 100644
index 00000000..2bc71a9a
--- /dev/null
+++ b/grpc/third_party/upb/upb/mini_table.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2009-2022, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_MINI_TABLE_H_
+#define UPB_MINI_TABLE_H_
+
+#include "upb/msg_internal.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber(
+ const upb_MiniTable* table, uint32_t number);
+
+typedef enum {
+ kUpb_MessageModifier_ValidateUtf8 = 1 << 0,
+ kUpb_MessageModifier_DefaultIsPacked = 1 << 1,
+ kUpb_MessageModifier_IsExtendable = 1 << 2,
+} kUpb_MessageModifier;
+
+typedef enum {
+ kUpb_FieldModifier_IsRepeated = 1 << 0,
+ kUpb_FieldModifier_IsPacked = 1 << 1,
+ kUpb_FieldModifier_IsClosedEnum = 1 << 2,
+ kUpb_FieldModifier_IsProto3Singular = 1 << 3,
+ kUpb_FieldModifier_IsRequired = 1 << 4,
+} kUpb_FieldModifier;
+
+/** upb_MtDataEncoder *********************************************************/
+
+// Functions to encode a string in a format that can be loaded by
+// upb_MiniTable_Build().
+
+typedef struct {
+ char* end; // Limit of the buffer passed as a parameter.
+ // Aliased to internal-only members in .cc.
+ char internal[32];
+} upb_MtDataEncoder;
+
+// If the input buffer has at least this many bytes available, the encoder call
+// is guaranteed to succeed (as long as field number order is maintained).
+#define kUpb_MtDataEncoder_MinSize 16
+
+// Encodes field/oneof information for a given message. The sequence of calls
+// should look like:
+//
+// upb_MtDataEncoder e;
+// char buf[256];
+// char* ptr = buf;
+// e.end = ptr + sizeof(buf);
+// ptr = upb_MtDataEncoder_StartMessage(&e, ptr);
+// // Fields *must* be in field number order.
+// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
+// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
+// ptr = upb_MtDataEncoder_PutField(&e, ptr, ...);
+//
+// // If oneofs are present. Oneofs must be encoded after regular fields.
+// ptr = upb_MiniTable_StartOneof(&e, ptr)
+// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
+// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
+//
+// ptr = upb_MiniTable_StartOneof(&e, ptr);
+// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
+// ptr = upb_MiniTable_PutOneofField(&e, ptr, ...);
+//
+// Oneofs must be encoded after all regular fields.
+char* upb_MtDataEncoder_StartMessage(upb_MtDataEncoder* e, char* ptr,
+ uint64_t msg_mod);
+char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr,
+ upb_FieldType type, uint32_t field_num,
+ uint64_t field_mod);
+char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr);
+char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr,
+ uint32_t field_num);
+
+// Encodes the set of values for a given enum. The values must be given in
+// order (after casting to uint32_t), and repeats are not allowed.
+char* upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e, char* ptr);
+char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr,
+ uint32_t val);
+char* upb_MtDataEncoder_FinishEnum(upb_MtDataEncoder* e, char* ptr);
+
+/** upb_MiniTable *************************************************************/
+
+typedef enum {
+ kUpb_MiniTablePlatform_32Bit,
+ kUpb_MiniTablePlatform_64Bit,
+ kUpb_MiniTablePlatform_Native =
+ UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
+} upb_MiniTablePlatform;
+
+// Builds a mini table from the data encoded in the buffer [data, len]. If any
+// errors occur, returns NULL and sets a status message. In the success case,
+// the caller must call upb_MiniTable_SetSub*() for all message or proto2 enum
+// fields to link the table to the appropriate sub-tables.
+upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, upb_Status* status);
+void upb_MiniTable_SetSubMessage(upb_MiniTable* table,
+ upb_MiniTable_Field* field,
+ const upb_MiniTable* sub);
+void upb_MiniTable_SetSubEnum(upb_MiniTable* table, upb_MiniTable_Field* field,
+ const upb_MiniTable_Enum* sub);
+
+bool upb_MiniTable_BuildExtension(const char* data, size_t len,
+ upb_MiniTable_Extension* ext,
+ upb_MiniTable_Sub sub, upb_Status* status);
+
+// Special-case functions for MessageSet layout and map entries.
+upb_MiniTable* upb_MiniTable_BuildMessageSet(upb_MiniTablePlatform platform,
+ upb_Arena* arena);
+upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type,
+ upb_FieldType value_type,
+ bool value_is_proto3_enum,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena);
+
+upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len,
+ upb_Arena* arena,
+ upb_Status* status);
+
+// Like upb_MiniTable_Build(), but the user provides a buffer of layout data so
+// it can be reused from call to call, avoiding repeated realloc()/free().
+//
+// The caller owns `*buf` both before and after the call, and must free() it
+// when it is no longer in use. The function will realloc() `*buf` as
+// necessary, updating `*size` accordingly.
+upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
+ upb_MiniTablePlatform platform,
+ upb_Arena* arena, void** buf,
+ size_t* buf_size, upb_Status* status);
+
+// For testing only.
+char upb_ToBase92(int8_t ch);
+char upb_FromBase92(uint8_t ch);
+bool upb_IsTypePackable(upb_FieldType type);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_MINI_TABLE_H_ */
diff --git a/grpc/third_party/upb/upb/mini_table.hpp b/grpc/third_party/upb/upb/mini_table.hpp
new file mode 100644
index 00000000..06405f9d
--- /dev/null
+++ b/grpc/third_party/upb/upb/mini_table.hpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_MINI_TABLE_HPP_
+#define UPB_MINI_TABLE_HPP_
+
+#include <assert.h>
+
+#include <string>
+
+#include "upb/mini_table.h"
+
+namespace upb {
+
+class MtDataEncoder {
+ public:
+ MtDataEncoder() : appender_(&encoder_) {}
+
+ bool StartMessage(uint64_t msg_mod) {
+ return appender_([=](char* buf) {
+ return upb_MtDataEncoder_StartMessage(&encoder_, buf, msg_mod);
+ });
+ }
+
+ bool PutField(upb_FieldType type, uint32_t field_num, uint64_t field_mod) {
+ return appender_([=](char* buf) {
+ return upb_MtDataEncoder_PutField(&encoder_, buf, type, field_num,
+ field_mod);
+ });
+ }
+
+ bool StartOneof() {
+ return appender_([=](char* buf) {
+ return upb_MtDataEncoder_StartOneof(&encoder_, buf);
+ });
+ }
+
+ bool PutOneofField(uint32_t field_num) {
+ return appender_([=](char* buf) {
+ return upb_MtDataEncoder_PutOneofField(&encoder_, buf, field_num);
+ });
+ }
+
+ const std::string& data() const { return appender_.data(); }
+
+ private:
+ class StringAppender {
+ public:
+ StringAppender(upb_MtDataEncoder* e) { e->end = buf_ + sizeof(buf_); }
+
+ template <class T>
+ bool operator()(T&& func) {
+ char* end = func(buf_);
+ if (!end) return false;
+ // C++ does not guarantee that string has doubling growth behavior, but
+ // we need it to avoid O(n^2).
+ str_.reserve(_upb_Log2CeilingSize(str_.size() + (end - buf_)));
+ str_.append(buf_, end - buf_);
+ return true;
+ }
+
+ const std::string& data() const { return str_; }
+
+ private:
+ char buf_[kUpb_MtDataEncoder_MinSize];
+ std::string str_;
+ };
+
+ upb_MtDataEncoder encoder_;
+ StringAppender appender_;
+};
+
+} // namespace upb
+
+#endif /* UPB_MINI_TABLE_HPP_ */
diff --git a/grpc/third_party/upb/upb/mini_table_test.cc b/grpc/third_party/upb/upb/mini_table_test.cc
new file mode 100644
index 00000000..624bb790
--- /dev/null
+++ b/grpc/third_party/upb/upb/mini_table_test.cc
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/mini_table.hpp"
+
+#include "absl/container/flat_hash_set.h"
+#include "gmock/gmock.h"
+#include "google/protobuf/descriptor.h"
+#include "gtest/gtest.h"
+#include "upb/msg_internal.h"
+#include "upb/upb.hpp"
+
+namespace protobuf = ::google::protobuf;
+
+class MiniTableTest : public testing::TestWithParam<upb_MiniTablePlatform> {};
+
+TEST_P(MiniTableTest, Empty) {
+ upb::Arena arena;
+ upb::Status status;
+ upb_MiniTable* table =
+ upb_MiniTable_Build(NULL, 0, GetParam(), arena.ptr(), status.ptr());
+ ASSERT_NE(nullptr, table);
+ EXPECT_EQ(0, table->field_count);
+ EXPECT_EQ(0, table->required_count);
+}
+
+TEST_P(MiniTableTest, AllScalarTypes) {
+ upb::Arena arena;
+ upb::MtDataEncoder e;
+ ASSERT_TRUE(e.StartMessage(0));
+ int count = 0;
+ for (int i = kUpb_FieldType_Double; i < kUpb_FieldType_SInt64; i++) {
+ ASSERT_TRUE(e.PutField(static_cast<upb_FieldType>(i), i, 0));
+ count++;
+ }
+ upb::Status status;
+ upb_MiniTable* table = upb_MiniTable_Build(
+ e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr());
+ ASSERT_NE(nullptr, table);
+ EXPECT_EQ(count, table->field_count);
+ absl::flat_hash_set<size_t> offsets;
+ for (int i = 0; i < 16; i++) {
+ const upb_MiniTable_Field* f = &table->fields[i];
+ EXPECT_EQ(i + 1, f->number);
+ EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask);
+ EXPECT_TRUE(offsets.insert(f->offset).second);
+ EXPECT_TRUE(f->offset < table->size);
+ }
+ EXPECT_EQ(0, table->required_count);
+}
+
+TEST_P(MiniTableTest, AllRepeatedTypes) {
+ upb::Arena arena;
+ upb::MtDataEncoder e;
+ ASSERT_TRUE(e.StartMessage(0));
+ int count = 0;
+ for (int i = kUpb_FieldType_Double; i < kUpb_FieldType_SInt64; i++) {
+ ASSERT_TRUE(e.PutField(static_cast<upb_FieldType>(i), i,
+ kUpb_FieldModifier_IsRepeated));
+ count++;
+ }
+ upb::Status status;
+ upb_MiniTable* table = upb_MiniTable_Build(
+ e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr());
+ ASSERT_NE(nullptr, table);
+ EXPECT_EQ(count, table->field_count);
+ absl::flat_hash_set<size_t> offsets;
+ for (int i = 0; i < 16; i++) {
+ const upb_MiniTable_Field* f = &table->fields[i];
+ EXPECT_EQ(i + 1, f->number);
+ EXPECT_EQ(kUpb_FieldMode_Array, f->mode & kUpb_FieldMode_Mask);
+ EXPECT_TRUE(offsets.insert(f->offset).second);
+ EXPECT_TRUE(f->offset < table->size);
+ }
+ EXPECT_EQ(0, table->required_count);
+}
+
+TEST_P(MiniTableTest, Skips) {
+ upb::Arena arena;
+ upb::MtDataEncoder e;
+ ASSERT_TRUE(e.StartMessage(0));
+ int count = 0;
+ std::vector<int> field_numbers;
+ for (int i = 0; i < 25; i++) {
+ int field_number = 1 << i;
+ field_numbers.push_back(field_number);
+ ASSERT_TRUE(e.PutField(kUpb_FieldType_Float, field_number, 0));
+ count++;
+ }
+ upb::Status status;
+ upb_MiniTable* table = upb_MiniTable_Build(
+ e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr());
+ ASSERT_NE(nullptr, table);
+ EXPECT_EQ(count, table->field_count);
+ absl::flat_hash_set<size_t> offsets;
+ for (size_t i = 0; i < field_numbers.size(); i++) {
+ const upb_MiniTable_Field* f = &table->fields[i];
+ EXPECT_EQ(field_numbers[i], f->number);
+ EXPECT_EQ(kUpb_FieldType_Float, f->descriptortype);
+ EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask);
+ EXPECT_TRUE(offsets.insert(f->offset).second);
+ EXPECT_TRUE(f->offset < table->size);
+ }
+ EXPECT_EQ(0, table->required_count);
+}
+
+TEST_P(MiniTableTest, AllScalarTypesOneof) {
+ upb::Arena arena;
+ upb::MtDataEncoder e;
+ ASSERT_TRUE(e.StartMessage(0));
+ int count = 0;
+ for (int i = kUpb_FieldType_Double; i < kUpb_FieldType_SInt64; i++) {
+ ASSERT_TRUE(e.PutField(static_cast<upb_FieldType>(i), i, 0));
+ count++;
+ }
+ ASSERT_TRUE(e.StartOneof());
+ for (int i = kUpb_FieldType_Double; i < kUpb_FieldType_SInt64; i++) {
+ ASSERT_TRUE(e.PutOneofField(i));
+ }
+ upb::Status status;
+ upb_MiniTable* table = upb_MiniTable_Build(
+ e.data().data(), e.data().size(), GetParam(), arena.ptr(), status.ptr());
+ ASSERT_NE(nullptr, table) << status.error_message();
+ EXPECT_EQ(count, table->field_count);
+ absl::flat_hash_set<size_t> offsets;
+ for (int i = 0; i < 16; i++) {
+ const upb_MiniTable_Field* f = &table->fields[i];
+ EXPECT_EQ(i + 1, f->number);
+ EXPECT_EQ(kUpb_FieldMode_Scalar, f->mode & kUpb_FieldMode_Mask);
+ // For a oneof all fields have the same offset.
+ EXPECT_EQ(table->fields[0].offset, f->offset);
+ // All presence fields should point to the same oneof case offset.
+ size_t case_ofs = _upb_oneofcase_ofs(f);
+ EXPECT_EQ(table->fields[0].presence, f->presence);
+ EXPECT_TRUE(f->offset < table->size);
+ EXPECT_TRUE(case_ofs < table->size);
+ EXPECT_TRUE(case_ofs != f->offset);
+ }
+ EXPECT_EQ(0, table->required_count);
+}
+
+INSTANTIATE_TEST_SUITE_P(Platforms, MiniTableTest,
+ testing::Values(kUpb_MiniTablePlatform_32Bit,
+ kUpb_MiniTablePlatform_64Bit));
+
+TEST(MiniTablePlatformIndependentTest, Base92Roundtrip) {
+ for (char i = 0; i < 92; i++) {
+ EXPECT_EQ(i, upb_FromBase92(upb_ToBase92(i)));
+ }
+}
+
+TEST(MiniTablePlatformIndependentTest, IsTypePackable) {
+ for (int i = 1; i <= protobuf::FieldDescriptor::MAX_TYPE; i++) {
+ EXPECT_EQ(upb_IsTypePackable(static_cast<upb_FieldType>(i)),
+ protobuf::FieldDescriptor::IsTypePackable(
+ static_cast<protobuf::FieldDescriptor::Type>(i)));
+ }
+}
diff --git a/grpc/third_party/upb/upb/msg.c b/grpc/third_party/upb/upb/msg.c
index 876a06d6..b8a62946 100644
--- a/grpc/third_party/upb/upb/msg.c
+++ b/grpc/third_party/upb/upb/msg.c
@@ -1,74 +1,181 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/msg.h"
-#include "upb/table.int.h"
-
+#include "upb/msg_internal.h"
#include "upb/port_def.inc"
+#include "upb/table_internal.h"
-/** upb_msg *******************************************************************/
+/** upb_Message ***************************************************************/
-static const size_t overhead = sizeof(upb_msg_internal);
+static const size_t overhead = sizeof(upb_Message_InternalData);
-static const upb_msg_internal *upb_msg_getinternal_const(const upb_msg *msg) {
- ptrdiff_t size = sizeof(upb_msg_internal);
- return (upb_msg_internal*)((char*)msg - size);
+static const upb_Message_Internal* upb_Message_Getinternal_const(
+ const upb_Message* msg) {
+ ptrdiff_t size = sizeof(upb_Message_Internal);
+ return (upb_Message_Internal*)((char*)msg - size);
}
-upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a) {
- return _upb_msg_new_inl(l, a);
+upb_Message* _upb_Message_New(const upb_MiniTable* l, upb_Arena* a) {
+ return _upb_Message_New_inl(l, a);
}
-void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l) {
- void *mem = UPB_PTR_AT(msg, -sizeof(upb_msg_internal), char);
+void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l) {
+ void* mem = UPB_PTR_AT(msg, -sizeof(upb_Message_Internal), char);
memset(mem, 0, upb_msg_sizeof(l));
}
-bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
- upb_arena *arena) {
-
- upb_msg_internal *in = upb_msg_getinternal(msg);
- if (!in->unknown) {
- size_t size = 128;
- while (size < len) size *= 2;
- in->unknown = upb_arena_malloc(arena, size + overhead);
- if (!in->unknown) return false;
- in->unknown->size = size;
- in->unknown->len = 0;
- } else if (in->unknown->size - in->unknown->len < len) {
- size_t need = in->unknown->len + len;
- size_t size = in->unknown->size;
- while (size < need) size *= 2;
- in->unknown = upb_arena_realloc(
- arena, in->unknown, in->unknown->size + overhead, size + overhead);
- if (!in->unknown) return false;
- in->unknown->size = size;
+static bool realloc_internal(upb_Message* msg, size_t need, upb_Arena* arena) {
+ upb_Message_Internal* in = upb_Message_Getinternal(msg);
+ if (!in->internal) {
+ /* No internal data, allocate from scratch. */
+ size_t size = UPB_MAX(128, _upb_Log2CeilingSize(need + overhead));
+ upb_Message_InternalData* internal = upb_Arena_Malloc(arena, size);
+ if (!internal) return false;
+ internal->size = size;
+ internal->unknown_end = overhead;
+ internal->ext_begin = size;
+ in->internal = internal;
+ } else if (in->internal->ext_begin - in->internal->unknown_end < need) {
+ /* Internal data is too small, reallocate. */
+ size_t new_size = _upb_Log2CeilingSize(in->internal->size + need);
+ size_t ext_bytes = in->internal->size - in->internal->ext_begin;
+ size_t new_ext_begin = new_size - ext_bytes;
+ upb_Message_InternalData* internal =
+ upb_Arena_Realloc(arena, in->internal, in->internal->size, new_size);
+ if (!internal) return false;
+ if (ext_bytes) {
+ /* Need to move extension data to the end. */
+ char* ptr = (char*)internal;
+ memmove(ptr + new_ext_begin, ptr + internal->ext_begin, ext_bytes);
+ }
+ internal->ext_begin = new_ext_begin;
+ internal->size = new_size;
+ in->internal = internal;
}
- memcpy(UPB_PTR_AT(in->unknown + 1, in->unknown->len, char), data, len);
- in->unknown->len += len;
+ UPB_ASSERT(in->internal->ext_begin - in->internal->unknown_end >= need);
+ return true;
+}
+
+bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
+ upb_Arena* arena) {
+ if (!realloc_internal(msg, len, arena)) return false;
+ upb_Message_Internal* in = upb_Message_Getinternal(msg);
+ memcpy(UPB_PTR_AT(in->internal, in->internal->unknown_end, char), data, len);
+ in->internal->unknown_end += len;
return true;
}
-void _upb_msg_discardunknown_shallow(upb_msg *msg) {
- upb_msg_internal *in = upb_msg_getinternal(msg);
- if (in->unknown) {
- in->unknown->len = 0;
+void _upb_Message_DiscardUnknown_shallow(upb_Message* msg) {
+ upb_Message_Internal* in = upb_Message_Getinternal(msg);
+ if (in->internal) {
+ in->internal->unknown_end = overhead;
}
}
-const char *upb_msg_getunknown(const upb_msg *msg, size_t *len) {
- const upb_msg_internal *in = upb_msg_getinternal_const(msg);
- if (in->unknown) {
- *len = in->unknown->len;
- return (char*)(in->unknown + 1);
+const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len) {
+ const upb_Message_Internal* in = upb_Message_Getinternal_const(msg);
+ if (in->internal) {
+ *len = in->internal->unknown_end - overhead;
+ return (char*)(in->internal + 1);
} else {
*len = 0;
return NULL;
}
}
-/** upb_array *****************************************************************/
+const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg,
+ size_t* count) {
+ const upb_Message_Internal* in = upb_Message_Getinternal_const(msg);
+ if (in->internal) {
+ *count = (in->internal->size - in->internal->ext_begin) /
+ sizeof(upb_Message_Extension);
+ return UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ } else {
+ *count = 0;
+ return NULL;
+ }
+}
+
+const upb_Message_Extension* _upb_Message_Getext(
+ const upb_Message* msg, const upb_MiniTable_Extension* e) {
+ size_t n;
+ const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &n);
+
+ /* For now we use linear search exclusively to find extensions. If this
+ * becomes an issue due to messages with lots of extensions, we can introduce
+ * a table of some sort. */
+ for (size_t i = 0; i < n; i++) {
+ if (ext[i].ext == e) {
+ return &ext[i];
+ }
+ }
+
+ return NULL;
+}
+
+void _upb_Message_Clearext(upb_Message* msg,
+ const upb_MiniTable_Extension* ext_l) {
+ upb_Message_Internal* in = upb_Message_Getinternal(msg);
+ if (!in->internal) return;
+ const upb_Message_Extension* base =
+ UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ upb_Message_Extension* ext =
+ (upb_Message_Extension*)_upb_Message_Getext(msg, ext_l);
+ if (ext) {
+ *ext = *base;
+ in->internal->ext_begin += sizeof(upb_Message_Extension);
+ }
+}
+
+upb_Message_Extension* _upb_Message_Getorcreateext(
+ upb_Message* msg, const upb_MiniTable_Extension* e, upb_Arena* arena) {
+ upb_Message_Extension* ext =
+ (upb_Message_Extension*)_upb_Message_Getext(msg, e);
+ if (ext) return ext;
+ if (!realloc_internal(msg, sizeof(upb_Message_Extension), arena)) return NULL;
+ upb_Message_Internal* in = upb_Message_Getinternal(msg);
+ in->internal->ext_begin -= sizeof(upb_Message_Extension);
+ ext = UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ memset(ext, 0, sizeof(upb_Message_Extension));
+ ext->ext = e;
+ return ext;
+}
+
+size_t upb_Message_ExtensionCount(const upb_Message* msg) {
+ size_t count;
+ _upb_Message_Getexts(msg, &count);
+ return count;
+}
+
+/** upb_Array *****************************************************************/
-bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) {
+bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena) {
size_t new_size = UPB_MAX(arr->size, 4);
int elem_size_lg2 = arr->data & 7;
size_t old_bytes = arr->size << elem_size_lg2;
@@ -79,7 +186,7 @@ bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) {
while (new_size < min_size) new_size *= 2;
new_bytes = new_size << elem_size_lg2;
- ptr = upb_arena_realloc(arena, ptr, old_bytes, new_bytes);
+ ptr = upb_Arena_Realloc(arena, ptr, old_bytes, new_bytes);
if (!ptr) {
return false;
@@ -90,115 +197,119 @@ bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) {
return true;
}
-static upb_array *getorcreate_array(upb_array **arr_ptr, int elem_size_lg2,
- upb_arena *arena) {
- upb_array *arr = *arr_ptr;
+static upb_Array* getorcreate_array(upb_Array** arr_ptr, int elem_size_lg2,
+ upb_Arena* arena) {
+ upb_Array* arr = *arr_ptr;
if (!arr) {
- arr = _upb_array_new(arena, 4, elem_size_lg2);
+ arr = _upb_Array_New(arena, 4, elem_size_lg2);
if (!arr) return NULL;
*arr_ptr = arr;
}
return arr;
}
-void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
- int elem_size_lg2, upb_arena *arena) {
- upb_array *arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
- return arr && _upb_array_resize(arr, size, arena) ? _upb_array_ptr(arr)
+void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size,
+ int elem_size_lg2, upb_Arena* arena) {
+ upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
+ return arr && _upb_Array_Resize(arr, size, arena) ? _upb_array_ptr(arr)
: NULL;
}
-bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
- int elem_size_lg2, upb_arena *arena) {
- upb_array *arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
+bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value,
+ int elem_size_lg2, upb_Arena* arena) {
+ upb_Array* arr = getorcreate_array(arr_ptr, elem_size_lg2, arena);
if (!arr) return false;
size_t elems = arr->len;
- if (!_upb_array_resize(arr, elems + 1, arena)) {
+ if (!_upb_Array_Resize(arr, elems + 1, arena)) {
return false;
}
- char *data = _upb_array_ptr(arr);
+ char* data = _upb_array_ptr(arr);
memcpy(data + (elems << elem_size_lg2), value, 1 << elem_size_lg2);
return true;
}
-/** upb_map *******************************************************************/
+/** upb_Map *******************************************************************/
-upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size) {
- upb_map *map = upb_arena_malloc(a, sizeof(upb_map));
+upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size) {
+ upb_Map* map = upb_Arena_Malloc(a, sizeof(upb_Map));
if (!map) {
return NULL;
}
- upb_strtable_init2(&map->table, UPB_CTYPE_INT32, 4, upb_arena_alloc(a));
+ upb_strtable_init(&map->table, 4, a);
map->key_size = key_size;
map->val_size = value_size;
return map;
}
-static void _upb_mapsorter_getkeys(const void *_a, const void *_b, void *a_key,
- void *b_key, size_t size) {
- const upb_tabent *const*a = _a;
- const upb_tabent *const*b = _b;
- upb_strview a_tabkey = upb_tabstrview((*a)->key);
- upb_strview b_tabkey = upb_tabstrview((*b)->key);
+static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key,
+ void* b_key, size_t size) {
+ const upb_tabent* const* a = _a;
+ const upb_tabent* const* b = _b;
+ upb_StringView a_tabkey = upb_tabstrview((*a)->key);
+ upb_StringView b_tabkey = upb_tabstrview((*b)->key);
_upb_map_fromkey(a_tabkey, a_key, size);
_upb_map_fromkey(b_tabkey, b_key, size);
}
-static int _upb_mapsorter_cmpi64(const void *_a, const void *_b) {
+#define UPB_COMPARE_INTEGERS(a, b) ((a) < (b) ? -1 : ((a) == (b) ? 0 : 1))
+
+static int _upb_mapsorter_cmpi64(const void* _a, const void* _b) {
int64_t a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, 8);
- return a - b;
+ return UPB_COMPARE_INTEGERS(a, b);
}
-static int _upb_mapsorter_cmpu64(const void *_a, const void *_b) {
+static int _upb_mapsorter_cmpu64(const void* _a, const void* _b) {
uint64_t a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, 8);
- return a - b;
+ return UPB_COMPARE_INTEGERS(a, b);
}
-static int _upb_mapsorter_cmpi32(const void *_a, const void *_b) {
+static int _upb_mapsorter_cmpi32(const void* _a, const void* _b) {
int32_t a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, 4);
- return a - b;
+ return UPB_COMPARE_INTEGERS(a, b);
}
-static int _upb_mapsorter_cmpu32(const void *_a, const void *_b) {
+static int _upb_mapsorter_cmpu32(const void* _a, const void* _b) {
uint32_t a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, 4);
- return a - b;
+ return UPB_COMPARE_INTEGERS(a, b);
}
-static int _upb_mapsorter_cmpbool(const void *_a, const void *_b) {
+static int _upb_mapsorter_cmpbool(const void* _a, const void* _b) {
bool a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, 1);
- return a - b;
+ return UPB_COMPARE_INTEGERS(a, b);
}
-static int _upb_mapsorter_cmpstr(const void *_a, const void *_b) {
- upb_strview a, b;
+static int _upb_mapsorter_cmpstr(const void* _a, const void* _b) {
+ upb_StringView a, b;
_upb_mapsorter_getkeys(_a, _b, &a, &b, UPB_MAPTYPE_STRING);
size_t common_size = UPB_MIN(a.size, b.size);
int cmp = memcmp(a.data, b.data, common_size);
- if (cmp) return cmp;
- return a.size - b.size;
+ if (cmp) return -cmp;
+ return UPB_COMPARE_INTEGERS(a.size, b.size);
}
-bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
- const upb_map *map, _upb_sortedmap *sorted) {
- int map_size = _upb_map_size(map);
+#undef UPB_COMPARE_INTEGERS
+
+bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
+ const upb_Map* map, _upb_sortedmap* sorted) {
+ int map_size = _upb_Map_Size(map);
sorted->start = s->size;
sorted->pos = sorted->start;
sorted->end = sorted->start + map_size;
/* Grow s->entries if necessary. */
if (sorted->end > s->cap) {
- s->cap = _upb_lg2ceilsize(sorted->end);
+ s->cap = _upb_Log2CeilingSize(sorted->end);
s->entries = realloc(s->entries, s->cap * sizeof(*s->entries));
if (!s->entries) return false;
}
@@ -206,9 +317,9 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
s->size = sorted->end;
/* Copy non-empty entries from the table to s->entries. */
- upb_tabent const**dst = &s->entries[sorted->start];
- const upb_tabent *src = map->table.t.entries;
- const upb_tabent *end = src + upb_table_size(&map->table.t);
+ upb_tabent const** dst = &s->entries[sorted->start];
+ const upb_tabent* src = map->table.t.entries;
+ const upb_tabent* end = src + upb_table_size(&map->table.t);
for (; src < end; src++) {
if (!upb_tabent_isempty(src)) {
*dst = src;
@@ -219,32 +330,33 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
/* Sort entries according to the key type. */
- int (*compar)(const void *, const void *);
+ int (*compar)(const void*, const void*);
switch (key_type) {
- case UPB_DESCRIPTOR_TYPE_INT64:
- case UPB_DESCRIPTOR_TYPE_SFIXED64:
- case UPB_DESCRIPTOR_TYPE_SINT64:
+ case kUpb_FieldType_Int64:
+ case kUpb_FieldType_SFixed64:
+ case kUpb_FieldType_SInt64:
compar = _upb_mapsorter_cmpi64;
break;
- case UPB_DESCRIPTOR_TYPE_UINT64:
- case UPB_DESCRIPTOR_TYPE_FIXED64:
+ case kUpb_FieldType_UInt64:
+ case kUpb_FieldType_Fixed64:
compar = _upb_mapsorter_cmpu64;
break;
- case UPB_DESCRIPTOR_TYPE_INT32:
- case UPB_DESCRIPTOR_TYPE_SINT32:
- case UPB_DESCRIPTOR_TYPE_SFIXED32:
- case UPB_DESCRIPTOR_TYPE_ENUM:
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_SInt32:
+ case kUpb_FieldType_SFixed32:
+ case kUpb_FieldType_Enum:
compar = _upb_mapsorter_cmpi32;
break;
- case UPB_DESCRIPTOR_TYPE_UINT32:
- case UPB_DESCRIPTOR_TYPE_FIXED32:
+ case kUpb_FieldType_UInt32:
+ case kUpb_FieldType_Fixed32:
compar = _upb_mapsorter_cmpu32;
break;
- case UPB_DESCRIPTOR_TYPE_BOOL:
+ case kUpb_FieldType_Bool:
compar = _upb_mapsorter_cmpbool;
break;
- case UPB_DESCRIPTOR_TYPE_STRING:
+ case kUpb_FieldType_String:
+ case kUpb_FieldType_Bytes:
compar = _upb_mapsorter_cmpstr;
break;
default:
@@ -254,3 +366,63 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
qsort(&s->entries[sorted->start], map_size, sizeof(*s->entries), compar);
return true;
}
+
+/** upb_ExtensionRegistry *****************************************************/
+
+struct upb_ExtensionRegistry {
+ upb_Arena* arena;
+ upb_strtable exts; /* Key is upb_MiniTable* concatenated with fieldnum. */
+};
+
+#define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t))
+
+static void extreg_key(char* buf, const upb_MiniTable* l, uint32_t fieldnum) {
+ memcpy(buf, &l, sizeof(l));
+ memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
+}
+
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena) {
+ upb_ExtensionRegistry* r = upb_Arena_Malloc(arena, sizeof(*r));
+ if (!r) return NULL;
+ r->arena = arena;
+ if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
+ return r;
+}
+
+bool _upb_extreg_add(upb_ExtensionRegistry* r,
+ const upb_MiniTable_Extension** e, size_t count) {
+ char buf[EXTREG_KEY_SIZE];
+ const upb_MiniTable_Extension** start = e;
+ const upb_MiniTable_Extension** end = UPB_PTRADD(e, count);
+ for (; e < end; e++) {
+ const upb_MiniTable_Extension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
+ upb_value_constptr(ext), r->arena)) {
+ goto failure;
+ }
+ }
+ return true;
+
+failure:
+ /* Back out the entries previously added. */
+ for (end = e, e = start; e < end; e++) {
+ const upb_MiniTable_Extension* ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_strtable_remove2(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
+ }
+ return false;
+}
+
+const upb_MiniTable_Extension* _upb_extreg_get(const upb_ExtensionRegistry* r,
+ const upb_MiniTable* l,
+ uint32_t num) {
+ char buf[EXTREG_KEY_SIZE];
+ upb_value v;
+ extreg_key(buf, l, num);
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ return upb_value_getconstptr(v);
+ } else {
+ return NULL;
+ }
+}
diff --git a/grpc/third_party/upb/upb/msg.h b/grpc/third_party/upb/upb/msg.h
index 9b4557ac..c984b137 100644
--- a/grpc/third_party/upb/upb/msg.h
+++ b/grpc/third_party/upb/upb/msg.h
@@ -1,613 +1,114 @@
/*
-** Our memory representation for parsing tables and messages themselves.
-** Functions in this file are used by generated code and possibly reflection.
-**
-** The definitions in this file are internal to upb.
-**/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Public APIs for message operations that do not require descriptors.
+ * These functions can be used even in build that does not want to depend on
+ * reflection or descriptors.
+ *
+ * Descriptor-based reflection functionality lives in reflection.h.
+ */
#ifndef UPB_MSG_H_
#define UPB_MSG_H_
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stddef.h>
-#include "upb/table.int.h"
#include "upb/upb.h"
-/* Must be last. */
-#include "upb/port_def.inc"
-
#ifdef __cplusplus
extern "C" {
#endif
-#define PTR_AT(msg, ofs, type) (type*)((const char*)msg + ofs)
-
-typedef void upb_msg;
-
-/** upb_msglayout *************************************************************/
-
-/* upb_msglayout represents the memory layout of a given upb_msgdef. The
- * members are public so generated code can initialize them, but users MUST NOT
- * read or write any of its members. */
-
-/* These aren't real labels according to descriptor.proto, but in the table we
- * use these for map/packed fields instead of UPB_LABEL_REPEATED. */
-enum {
- _UPB_LABEL_MAP = 4,
- _UPB_LABEL_PACKED = 7 /* Low 3 bits are common with UPB_LABEL_REPEATED. */
-};
-
-typedef struct {
- uint32_t number;
- uint16_t offset;
- int16_t presence; /* If >0, hasbit_index. If <0, ~oneof_index. */
- uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
- uint8_t descriptortype;
- uint8_t label; /* google.protobuf.Label or _UPB_LABEL_* above. */
-} upb_msglayout_field;
-
-struct upb_decstate;
-struct upb_msglayout;
-
-typedef const char *_upb_field_parser(struct upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, uint64_t data);
-
-typedef struct {
- uint64_t field_data;
- _upb_field_parser *field_parser;
-} _upb_fasttable_entry;
-
-typedef struct upb_msglayout {
- const struct upb_msglayout *const* submsgs;
- const upb_msglayout_field *fields;
- /* Must be aligned to sizeof(void*). Doesn't include internal members like
- * unknown fields, extension dict, pointer to msglayout, etc. */
- uint16_t size;
- uint16_t field_count;
- bool extendable;
- uint8_t table_mask;
- /* To constant-initialize the tables of variable length, we need a flexible
- * array member, and we need to compile in C99 mode. */
- _upb_fasttable_entry fasttable[];
-} upb_msglayout;
-
-/** upb_msg *******************************************************************/
-
-/* Internal members of a upb_msg. We can change this without breaking binary
- * compatibility. We put these before the user's data. The user's upb_msg*
- * points after the upb_msg_internal. */
-
-typedef struct {
- uint32_t len;
- uint32_t size;
- /* Data follows. */
-} upb_msg_unknowndata;
-
-/* Used when a message is not extendable. */
-typedef struct {
- upb_msg_unknowndata *unknown;
-} upb_msg_internal;
-
-/* Maps upb_fieldtype_t -> memory size. */
-extern char _upb_fieldtype_to_size[12];
-
-UPB_INLINE size_t upb_msg_sizeof(const upb_msglayout *l) {
- return l->size + sizeof(upb_msg_internal);
-}
-
-UPB_INLINE upb_msg *_upb_msg_new_inl(const upb_msglayout *l, upb_arena *a) {
- size_t size = upb_msg_sizeof(l);
- void *mem = upb_arena_malloc(a, size);
- upb_msg *msg;
- if (UPB_UNLIKELY(!mem)) return NULL;
- msg = UPB_PTR_AT(mem, sizeof(upb_msg_internal), upb_msg);
- memset(mem, 0, size);
- return msg;
-}
-
-/* Creates a new messages with the given layout on the given arena. */
-upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a);
+/** upb_Message ***************************************************************/
-UPB_INLINE upb_msg_internal *upb_msg_getinternal(upb_msg *msg) {
- ptrdiff_t size = sizeof(upb_msg_internal);
- return (upb_msg_internal*)((char*)msg - size);
-}
+typedef void upb_Message;
-/* Clears the given message. */
-void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l);
-
-/* Discards the unknown fields for this message only. */
-void _upb_msg_discardunknown_shallow(upb_msg *msg);
+/* For users these are opaque. They can be obtained from
+ * upb_MessageDef_MiniTable() but users cannot access any of the members. */
+struct upb_MiniTable;
+typedef struct upb_MiniTable upb_MiniTable;
/* Adds unknown data (serialized protobuf data) to the given message. The data
* is copied into the message instance. */
-bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
- upb_arena *arena);
+void upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
+ upb_Arena* arena);
/* Returns a reference to the message's unknown data. */
-const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
-
-/** Hasbit access *************************************************************/
-
-UPB_INLINE bool _upb_hasbit(const upb_msg *msg, size_t idx) {
- return (*PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
-}
-
-UPB_INLINE void _upb_sethas(const upb_msg *msg, size_t idx) {
- (*PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
-}
-
-UPB_INLINE void _upb_clearhas(const upb_msg *msg, size_t idx) {
- (*PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
-}
-
-UPB_INLINE size_t _upb_msg_hasidx(const upb_msglayout_field *f) {
- UPB_ASSERT(f->presence > 0);
- return f->presence;
-}
-
-UPB_INLINE bool _upb_hasbit_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_hasbit(msg, _upb_msg_hasidx(f));
-}
-
-UPB_INLINE void _upb_sethas_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- _upb_sethas(msg, _upb_msg_hasidx(f));
-}
-
-UPB_INLINE void _upb_clearhas_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- _upb_clearhas(msg, _upb_msg_hasidx(f));
-}
-
-/** Oneof case access *********************************************************/
-
-UPB_INLINE uint32_t *_upb_oneofcase(upb_msg *msg, size_t case_ofs) {
- return PTR_AT(msg, case_ofs, uint32_t);
-}
-
-UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs) {
- return *PTR_AT(msg, case_ofs, uint32_t);
-}
-
-UPB_INLINE size_t _upb_oneofcase_ofs(const upb_msglayout_field *f) {
- UPB_ASSERT(f->presence < 0);
- return ~(ptrdiff_t)f->presence;
-}
-
-UPB_INLINE uint32_t *_upb_oneofcase_field(upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
-}
-
-UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
-}
-
-UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_msg *msg, size_t ofs) {
- return *PTR_AT(msg, ofs, const upb_msg*) != NULL;
-}
-
-UPB_INLINE bool _upb_isrepeated(const upb_msglayout_field *field) {
- return (field->label & 3) == UPB_LABEL_REPEATED;
-}
-
-UPB_INLINE bool _upb_repeated_or_map(const upb_msglayout_field *field) {
- return field->label >= UPB_LABEL_REPEATED;
-}
-
-/** upb_array *****************************************************************/
-
-/* Our internal representation for repeated fields. */
-typedef struct {
- uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
- size_t len; /* Measured in elements. */
- size_t size; /* Measured in elements. */
- uint64_t junk;
-} upb_array;
-
-UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) {
- UPB_ASSERT((arr->data & 7) <= 4);
- return (void*)(arr->data & ~(uintptr_t)7);
-}
-
-UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
- UPB_ASSERT(elem_size_lg2 <= 4);
- return (uintptr_t)ptr | elem_size_lg2;
-}
-
-UPB_INLINE void *_upb_array_ptr(upb_array *arr) {
- return (void*)_upb_array_constptr(arr);
-}
-
-UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
- UPB_ASSERT(elem_size_lg2 <= 4);
- UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
- return (uintptr_t)ptr | (unsigned)elem_size_lg2;
-}
+const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
-UPB_INLINE upb_array *_upb_array_new(upb_arena *a, size_t init_size,
- int elem_size_lg2) {
- const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_array), 8);
- const size_t bytes = sizeof(upb_array) + (init_size << elem_size_lg2);
- upb_array *arr = (upb_array*)upb_arena_malloc(a, bytes);
- if (!arr) return NULL;
- arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
- arr->len = 0;
- arr->size = init_size;
- return arr;
-}
+/* Returns the number of extensions present in this message. */
+size_t upb_Message_ExtensionCount(const upb_Message* msg);
-/* Resizes the capacity of the array to be at least min_size. */
-bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena);
+/** upb_ExtensionRegistry *****************************************************/
-/* Fallback functions for when the accessors require a resize. */
-void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
- int elem_size_lg2, upb_arena *arena);
-bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
- int elem_size_lg2, upb_arena *arena);
-
-UPB_INLINE bool _upb_array_reserve(upb_array *arr, size_t size,
- upb_arena *arena) {
- if (arr->size < size) return _upb_array_realloc(arr, size, arena);
- return true;
-}
-
-UPB_INLINE bool _upb_array_resize(upb_array *arr, size_t size,
- upb_arena *arena) {
- if (!_upb_array_reserve(arr, size, arena)) return false;
- arr->len = size;
- return true;
-}
-
-UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
- size_t *size) {
- const upb_array *arr = *PTR_AT(msg, ofs, const upb_array*);
- if (arr) {
- if (size) *size = arr->len;
- return _upb_array_constptr(arr);
- } else {
- if (size) *size = 0;
- return NULL;
- }
-}
-
-UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
- size_t *size) {
- upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
- if (arr) {
- if (size) *size = arr->len;
- return _upb_array_ptr(arr);
- } else {
- if (size) *size = 0;
- return NULL;
- }
-}
-
-UPB_INLINE void *_upb_array_resize_accessor2(void *msg, size_t ofs, size_t size,
- int elem_size_lg2,
- upb_arena *arena) {
- upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *);
- upb_array *arr = *arr_ptr;
- if (!arr || arr->size < size) {
- return _upb_array_resize_fallback(arr_ptr, size, elem_size_lg2, arena);
- }
- arr->len = size;
- return _upb_array_ptr(arr);
-}
-
-UPB_INLINE bool _upb_array_append_accessor2(void *msg, size_t ofs,
- int elem_size_lg2,
- const void *value,
- upb_arena *arena) {
- upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *);
- size_t elem_size = 1 << elem_size_lg2;
- upb_array *arr = *arr_ptr;
- void *ptr;
- if (!arr || arr->len == arr->size) {
- return _upb_array_append_fallback(arr_ptr, value, elem_size_lg2, arena);
- }
- ptr = _upb_array_ptr(arr);
- memcpy(PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
- arr->len++;
- return true;
-}
-
-/* Used by old generated code, remove once all code has been regenerated. */
-UPB_INLINE int _upb_sizelg2(upb_fieldtype_t type) {
- switch (type) {
- case UPB_TYPE_BOOL:
- return 0;
- case UPB_TYPE_FLOAT:
- case UPB_TYPE_INT32:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_ENUM:
- return 2;
- case UPB_TYPE_MESSAGE:
- return UPB_SIZE(2, 3);
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT64:
- return 3;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
- return UPB_SIZE(3, 4);
- }
- UPB_UNREACHABLE();
-}
-UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
- upb_fieldtype_t type,
- upb_arena *arena) {
- return _upb_array_resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena);
-}
-UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
- size_t elem_size, upb_fieldtype_t type,
- const void *value,
- upb_arena *arena) {
- (void)elem_size;
- return _upb_array_append_accessor2(msg, ofs, _upb_sizelg2(type), value,
- arena);
-}
-
-/** upb_map *******************************************************************/
-
-/* Right now we use strmaps for everything. We'll likely want to use
- * integer-specific maps for integer-keyed maps.*/
-typedef struct {
- /* Size of key and val, based on the map type. Strings are represented as '0'
- * because they must be handled specially. */
- char key_size;
- char val_size;
-
- upb_strtable table;
-} upb_map;
-
-/* Map entries aren't actually stored, they are only used during parsing. For
- * parsing, it helps a lot if all map entry messages have the same layout.
- * The compiler and def.c must ensure that all map entries have this layout. */
-typedef struct {
- upb_msg_internal internal;
- union {
- upb_strview str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } k;
- union {
- upb_strview str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } v;
-} upb_map_entry;
-
-/* Creates a new map on the given arena with this key/value type. */
-upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size);
-
-/* Converting between internal table representation and user values.
+/* Extension registry: a dynamic data structure that stores a map of:
+ * (upb_MiniTable, number) -> extension info
+ *
+ * upb_decode() uses upb_ExtensionRegistry to look up extensions while parsing
+ * binary format.
+ *
+ * upb_ExtensionRegistry is part of the mini-table (msglayout) family of
+ * objects. Like all mini-table objects, it is suitable for reflection-less
+ * builds that do not want to expose names into the binary.
*
- * _upb_map_tokey() and _upb_map_fromkey() are inverses.
- * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
+ * Unlike most mini-table types, upb_ExtensionRegistry requires dynamic memory
+ * allocation and dynamic initialization:
+ * * If reflection is being used, then upb_DefPool will construct an appropriate
+ * upb_ExtensionRegistry automatically.
+ * * For a mini-table only build, the user must manually construct the
+ * upb_ExtensionRegistry and populate it with all of the extensions the user
+ * cares about.
+ * * A third alternative is to manually unpack relevant extensions after the
+ * main parse is complete, similar to how Any works. This is perhaps the
+ * nicest solution from the perspective of reducing dependencies, avoiding
+ * dynamic memory allocation, and avoiding the need to parse uninteresting
+ * extensions. The downsides are:
+ * (1) parse errors are not caught during the main parse
+ * (2) the CPU hit of parsing comes during access, which could cause an
+ * undesirable stutter in application performance.
*
- * These functions account for the fact that strings are treated differently
- * from other types when stored in a map.
+ * Users cannot directly get or put into this map. Users can only add the
+ * extensions from a generated module and pass the extension registry to the
+ * binary decoder.
+ *
+ * A upb_DefPool provides a upb_ExtensionRegistry, so any users who use
+ * reflection do not need to populate a upb_ExtensionRegistry directly.
*/
-UPB_INLINE upb_strview _upb_map_tokey(const void *key, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- return *(upb_strview*)key;
- } else {
- return upb_strview_make((const char*)key, size);
- }
-}
-
-UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- memcpy(out, &key, sizeof(key));
- } else {
- memcpy(out, key.data, size);
- }
-}
-
-UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval,
- upb_arena *a) {
- if (size == UPB_MAPTYPE_STRING) {
- upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp));
- if (!strp) return false;
- *strp = *(upb_strview*)val;
- *msgval = upb_value_ptr(strp);
- } else {
- memcpy(msgval, val, size);
- }
- return true;
-}
-
-UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
- memcpy(out, strp, sizeof(upb_strview));
- } else {
- memcpy(out, &val, size);
- }
-}
-
-/* Map operations, shared by reflection and generated code. */
-
-UPB_INLINE size_t _upb_map_size(const upb_map *map) {
- return map->table.t.count;
-}
-
-UPB_INLINE bool _upb_map_get(const upb_map *map, const void *key,
- size_t key_size, void *val, size_t val_size) {
- upb_value tabval;
- upb_strview k = _upb_map_tokey(key, key_size);
- bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
- if (ret && val) {
- _upb_map_fromvalue(tabval, val, val_size);
- }
- return ret;
-}
-
-UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) {
- upb_strtable_iter it;
- it.t = &map->table;
- it.index = *iter;
- upb_strtable_next(&it);
- *iter = it.index;
- if (upb_strtable_done(&it)) return NULL;
- return (void*)str_tabent(&it);
-}
-
-UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size,
- void *val, size_t val_size, upb_arena *arena) {
- upb_strview strkey = _upb_map_tokey(key, key_size);
- upb_value tabval = {0};
- if (!_upb_map_tovalue(val, val_size, &tabval, arena)) return false;
- upb_alloc *a = upb_arena_alloc(arena);
+struct upb_ExtensionRegistry;
+typedef struct upb_ExtensionRegistry upb_ExtensionRegistry;
- /* TODO(haberman): add overwrite operation to minimize number of lookups. */
- upb_strtable_remove3(&map->table, strkey.data, strkey.size, NULL, a);
- return upb_strtable_insert3(&map->table, strkey.data, strkey.size, tabval, a);
-}
-
-UPB_INLINE bool _upb_map_delete(upb_map *map, const void *key, size_t key_size) {
- upb_strview k = _upb_map_tokey(key, key_size);
- return upb_strtable_remove3(&map->table, k.data, k.size, NULL, NULL);
-}
-
-UPB_INLINE void _upb_map_clear(upb_map *map) {
- upb_strtable_clear(&map->table);
-}
-
-/* Message map operations, these get the map from the message first. */
-
-UPB_INLINE size_t _upb_msg_map_size(const upb_msg *msg, size_t ofs) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- return map ? _upb_map_size(map) : 0;
-}
-
-UPB_INLINE bool _upb_msg_map_get(const upb_msg *msg, size_t ofs,
- const void *key, size_t key_size, void *val,
- size_t val_size) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return false;
- return _upb_map_get(map, key, key_size, val, val_size);
-}
-
-UPB_INLINE void *_upb_msg_map_next(const upb_msg *msg, size_t ofs,
- size_t *iter) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return NULL;
- return _upb_map_next(map, iter);
-}
-
-UPB_INLINE bool _upb_msg_map_set(upb_msg *msg, size_t ofs, const void *key,
- size_t key_size, void *val, size_t val_size,
- upb_arena *arena) {
- upb_map **map = PTR_AT(msg, ofs, upb_map *);
- if (!*map) {
- *map = _upb_map_new(arena, key_size, val_size);
- }
- return _upb_map_set(*map, key, key_size, val, val_size, arena);
-}
-
-UPB_INLINE bool _upb_msg_map_delete(upb_msg *msg, size_t ofs, const void *key,
- size_t key_size) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return false;
- return _upb_map_delete(map, key, key_size);
-}
-
-UPB_INLINE void _upb_msg_map_clear(upb_msg *msg, size_t ofs) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return;
- _upb_map_clear(map);
-}
-
-/* Accessing map key/value from a pointer, used by generated code only. */
-
-UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
- const upb_tabent *ent = (const upb_tabent*)msg;
- uint32_t u32len;
- upb_strview k;
- k.data = upb_tabstr(ent->key, &u32len);
- k.size = u32len;
- _upb_map_fromkey(k, key, size);
-}
-
-UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
- const upb_tabent *ent = (const upb_tabent*)msg;
- upb_value v;
- _upb_value_setval(&v, ent->val.val);
- _upb_map_fromvalue(v, val, size);
-}
-
-UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
- upb_tabent *ent = (upb_tabent*)msg;
- /* This is like _upb_map_tovalue() except the entry already exists so we can
- * reuse the allocated upb_strview for string fields. */
- if (size == UPB_MAPTYPE_STRING) {
- upb_strview *strp = (upb_strview*)(uintptr_t)ent->val.val;
- memcpy(strp, val, sizeof(*strp));
- } else {
- memcpy(&ent->val.val, val, size);
- }
-}
-
-/** _upb_mapsorter *************************************************************/
-
-/* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
- * Since maps can be recursive (map values can be messages which contain other maps).
- * _upb_mapsorter can contain a stack of maps. */
-
-typedef struct {
- upb_tabent const**entries;
- int size;
- int cap;
-} _upb_mapsorter;
-
-typedef struct {
- int start;
- int pos;
- int end;
-} _upb_sortedmap;
-
-UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter *s) {
- s->entries = NULL;
- s->size = 0;
- s->cap = 0;
-}
-
-UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter *s) {
- if (s->entries) free(s->entries);
-}
-
-bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
- const upb_map *map, _upb_sortedmap *sorted);
-
-UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter *s, _upb_sortedmap *sorted) {
- s->size = sorted->start;
-}
-
-UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter *s, const upb_map *map,
- _upb_sortedmap *sorted,
- upb_map_entry *ent) {
- if (sorted->pos == sorted->end) return false;
- const upb_tabent *tabent = s->entries[sorted->pos++];
- upb_strview key = upb_tabstrview(tabent->key);
- _upb_map_fromkey(key, &ent->k, map->key_size);
- upb_value val = {tabent->val.val};
- _upb_map_fromvalue(val, &ent->v, map->val_size);
- return true;
-}
-
-#undef PTR_AT
+/* Creates a upb_ExtensionRegistry in the given arena. The arena must outlive
+ * any use of the extreg. */
+upb_ExtensionRegistry* upb_ExtensionRegistry_New(upb_Arena* arena);
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#include "upb/port_undef.inc"
-
-#endif /* UPB_MSG_H_ */
+#endif /* UPB_MSG_INT_H_ */
diff --git a/grpc/third_party/upb/upb/msg_internal.h b/grpc/third_party/upb/upb/msg_internal.h
new file mode 100644
index 00000000..39adfdb9
--- /dev/null
+++ b/grpc/third_party/upb/upb/msg_internal.h
@@ -0,0 +1,831 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+** Our memory representation for parsing tables and messages themselves.
+** Functions in this file are used by generated code and possibly reflection.
+**
+** The definitions in this file are internal to upb.
+**/
+
+#ifndef UPB_MSG_INT_H_
+#define UPB_MSG_INT_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "upb/msg.h"
+#include "upb/table_internal.h"
+#include "upb/upb.h"
+
+/* Must be last. */
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** upb_*Int* conversion routines ********************************************/
+
+UPB_INLINE int32_t _upb_Int32_FromI(int v) { return (int32_t)v; }
+
+UPB_INLINE int64_t _upb_Int64_FromLL(long long v) { return (int64_t)v; }
+
+UPB_INLINE uint32_t _upb_UInt32_FromU(unsigned v) { return (uint32_t)v; }
+
+UPB_INLINE uint64_t _upb_UInt64_FromULL(unsigned long long v) {
+ return (uint64_t)v;
+}
+
+/** upb_MiniTable *************************************************************/
+
+/* upb_MiniTable represents the memory layout of a given upb_MessageDef. The
+ * members are public so generated code can initialize them, but users MUST NOT
+ * read or write any of its members. */
+
+typedef struct {
+ uint32_t number;
+ uint16_t offset;
+ int16_t presence; // If >0, hasbit_index. If <0, ~oneof_index
+ uint16_t submsg_index; // kUpb_NoSub if descriptortype != MESSAGE/GROUP/ENUM
+ uint8_t descriptortype;
+ uint8_t mode; /* upb_FieldMode | upb_LabelFlags |
+ (upb_FieldRep << kUpb_FieldRep_Shift) */
+} upb_MiniTable_Field;
+
+#define kUpb_NoSub ((uint16_t)-1)
+
+typedef enum {
+ kUpb_FieldMode_Map = 0,
+ kUpb_FieldMode_Array = 1,
+ kUpb_FieldMode_Scalar = 2,
+} upb_FieldMode;
+
+// Mask to isolate the upb_FieldMode from field.mode.
+#define kUpb_FieldMode_Mask 3
+
+/* Extra flags on the mode field. */
+typedef enum {
+ kUpb_LabelFlags_IsPacked = 4,
+ kUpb_LabelFlags_IsExtension = 8,
+} upb_LabelFlags;
+
+// Note: we sort by this number when calculating layout order.
+typedef enum {
+ kUpb_FieldRep_1Byte = 0,
+ kUpb_FieldRep_4Byte = 1,
+ kUpb_FieldRep_StringView = 2,
+ kUpb_FieldRep_Pointer = 3,
+ kUpb_FieldRep_8Byte = 4,
+
+ kUpb_FieldRep_Shift = 5, // Bit offset of the rep in upb_MiniTable_Field.mode
+ kUpb_FieldRep_Max = kUpb_FieldRep_8Byte,
+} upb_FieldRep;
+
+UPB_INLINE upb_FieldMode upb_FieldMode_Get(const upb_MiniTable_Field* field) {
+ return (upb_FieldMode)(field->mode & 3);
+}
+
+UPB_INLINE bool upb_IsRepeatedOrMap(const upb_MiniTable_Field* field) {
+ /* This works because upb_FieldMode has no value 3. */
+ return !(field->mode & kUpb_FieldMode_Scalar);
+}
+
+UPB_INLINE bool upb_IsSubMessage(const upb_MiniTable_Field* field) {
+ return field->descriptortype == kUpb_FieldType_Message ||
+ field->descriptortype == kUpb_FieldType_Group;
+}
+
+struct upb_Decoder;
+struct upb_MiniTable;
+
+typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr,
+ upb_Message* msg, intptr_t table,
+ uint64_t hasbits, uint64_t data);
+
+typedef struct {
+ uint64_t field_data;
+ _upb_FieldParser* field_parser;
+} _upb_FastTable_Entry;
+
+typedef struct {
+ const int32_t* values; // List of values <0 or >63
+ uint64_t mask; // Bits are set for acceptable value 0 <= x < 64
+ int value_count;
+} upb_MiniTable_Enum;
+
+UPB_INLINE bool upb_MiniTable_Enum_CheckValue(const upb_MiniTable_Enum* e,
+ int32_t val) {
+ uint32_t uval = (uint32_t)val;
+ if (uval < 64) return e->mask & (1 << uval);
+ // OPT: binary search long lists?
+ int n = e->value_count;
+ for (int i = 0; i < n; i++) {
+ if (e->values[i] == val) return true;
+ }
+ return false;
+}
+
+typedef union {
+ const struct upb_MiniTable* submsg;
+ const upb_MiniTable_Enum* subenum;
+} upb_MiniTable_Sub;
+
+typedef enum {
+ kUpb_ExtMode_NonExtendable = 0, // Non-extendable message.
+ kUpb_ExtMode_Extendable = 1, // Normal extendable message.
+ kUpb_ExtMode_IsMessageSet = 2, // MessageSet message.
+ kUpb_ExtMode_IsMessageSet_ITEM =
+ 3, // MessageSet item (temporary only, see decode.c)
+
+ // During table building we steal a bit to indicate that the message is a map
+ // entry. *Only* used during table building!
+ kUpb_ExtMode_IsMapEntry = 4,
+} upb_ExtMode;
+
+/* MessageSet wire format is:
+ * message MessageSet {
+ * repeated group Item = 1 {
+ * required int32 type_id = 2;
+ * required string message = 3;
+ * }
+ * }
+ */
+typedef enum {
+ _UPB_MSGSET_ITEM = 1,
+ _UPB_MSGSET_TYPEID = 2,
+ _UPB_MSGSET_MESSAGE = 3,
+} upb_msgext_fieldnum;
+
+struct upb_MiniTable {
+ const upb_MiniTable_Sub* subs;
+ const upb_MiniTable_Field* fields;
+ /* Must be aligned to sizeof(void*). Doesn't include internal members like
+ * unknown fields, extension dict, pointer to msglayout, etc. */
+ uint16_t size;
+ uint16_t field_count;
+ uint8_t ext; // upb_ExtMode, declared as uint8_t so sizeof(ext) == 1
+ uint8_t dense_below;
+ uint8_t table_mask;
+ uint8_t required_count; // Required fields have the lowest hasbits.
+ /* To statically initialize the tables of variable length, we need a flexible
+ * array member, and we need to compile in gnu99 mode (constant initialization
+ * of flexible array members is a GNU extension, not in C99 unfortunately. */
+ _upb_FastTable_Entry fasttable[];
+};
+
+typedef struct {
+ upb_MiniTable_Field field;
+ const upb_MiniTable* extendee;
+ upb_MiniTable_Sub sub; /* NULL unless submessage or proto2 enum */
+} upb_MiniTable_Extension;
+
+typedef struct {
+ const upb_MiniTable** msgs;
+ const upb_MiniTable_Enum** enums;
+ const upb_MiniTable_Extension** exts;
+ int msg_count;
+ int enum_count;
+ int ext_count;
+} upb_MiniTable_File;
+
+// Computes a bitmask in which the |l->required_count| lowest bits are set,
+// except that we skip the lowest bit (because upb never uses hasbit 0).
+//
+// Sample output:
+// requiredmask(1) => 0b10 (0x2)
+// requiredmask(5) => 0b111110 (0x3e)
+UPB_INLINE uint64_t upb_MiniTable_requiredmask(const upb_MiniTable* l) {
+ int n = l->required_count;
+ assert(0 < n && n <= 63);
+ return ((1ULL << n) - 1) << 1;
+}
+
+/** upb_ExtensionRegistry *****************************************************/
+
+/* Adds the given extension info for message type |l| and field number |num|
+ * into the registry. Returns false if this message type and field number were
+ * already in the map, or if memory allocation fails. */
+bool _upb_extreg_add(upb_ExtensionRegistry* r,
+ const upb_MiniTable_Extension** e, size_t count);
+
+/* Looks up the extension (if any) defined for message type |l| and field
+ * number |num|. If an extension was found, copies the field info into |*ext|
+ * and returns true. Otherwise returns false. */
+const upb_MiniTable_Extension* _upb_extreg_get(const upb_ExtensionRegistry* r,
+ const upb_MiniTable* l,
+ uint32_t num);
+
+/** upb_Message ***************************************************************/
+
+/* Internal members of a upb_Message that track unknown fields and/or
+ * extensions. We can change this without breaking binary compatibility. We put
+ * these before the user's data. The user's upb_Message* points after the
+ * upb_Message_Internal. */
+
+typedef struct {
+ /* Total size of this structure, including the data that follows.
+ * Must be aligned to 8, which is alignof(upb_Message_Extension) */
+ uint32_t size;
+
+ /* Offsets relative to the beginning of this structure.
+ *
+ * Unknown data grows forward from the beginning to unknown_end.
+ * Extension data grows backward from size to ext_begin.
+ * When the two meet, we're out of data and have to realloc.
+ *
+ * If we imagine that the final member of this struct is:
+ * char data[size - overhead]; // overhead =
+ * sizeof(upb_Message_InternalData)
+ *
+ * Then we have:
+ * unknown data: data[0 .. (unknown_end - overhead)]
+ * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
+ uint32_t unknown_end;
+ uint32_t ext_begin;
+ /* Data follows, as if there were an array:
+ * char data[size - sizeof(upb_Message_InternalData)]; */
+} upb_Message_InternalData;
+
+typedef struct {
+ upb_Message_InternalData* internal;
+ /* Message data follows. */
+} upb_Message_Internal;
+
+/* Maps upb_CType -> memory size. */
+extern char _upb_CTypeo_size[12];
+
+UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* l) {
+ return l->size + sizeof(upb_Message_Internal);
+}
+
+UPB_INLINE upb_Message* _upb_Message_New_inl(const upb_MiniTable* l,
+ upb_Arena* a) {
+ size_t size = upb_msg_sizeof(l);
+ void* mem = upb_Arena_Malloc(a, size);
+ upb_Message* msg;
+ if (UPB_UNLIKELY(!mem)) return NULL;
+ msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message);
+ memset(mem, 0, size);
+ return msg;
+}
+
+/* Creates a new messages with the given layout on the given arena. */
+upb_Message* _upb_Message_New(const upb_MiniTable* l, upb_Arena* a);
+
+UPB_INLINE upb_Message_Internal* upb_Message_Getinternal(upb_Message* msg) {
+ ptrdiff_t size = sizeof(upb_Message_Internal);
+ return (upb_Message_Internal*)((char*)msg - size);
+}
+
+/* Clears the given message. */
+void _upb_Message_Clear(upb_Message* msg, const upb_MiniTable* l);
+
+/* Discards the unknown fields for this message only. */
+void _upb_Message_DiscardUnknown_shallow(upb_Message* msg);
+
+/* Adds unknown data (serialized protobuf data) to the given message. The data
+ * is copied into the message instance. */
+bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len,
+ upb_Arena* arena);
+
+/** upb_Message_Extension *****************************************************/
+
+/* The internal representation of an extension is self-describing: it contains
+ * enough information that we can serialize it to binary format without needing
+ * to look it up in a upb_ExtensionRegistry.
+ *
+ * This representation allocates 16 bytes to data on 64-bit platforms. This is
+ * rather wasteful for scalars (in the extreme case of bool, it wastes 15
+ * bytes). We accept this because we expect messages to be the most common
+ * extension type. */
+typedef struct {
+ const upb_MiniTable_Extension* ext;
+ union {
+ upb_StringView str;
+ void* ptr;
+ char scalar_data[8];
+ } data;
+} upb_Message_Extension;
+
+/* Adds the given extension data to the given message. |ext| is copied into the
+ * message instance. This logically replaces any previously-added extension with
+ * this number */
+upb_Message_Extension* _upb_Message_Getorcreateext(
+ upb_Message* msg, const upb_MiniTable_Extension* ext, upb_Arena* arena);
+
+/* Returns an array of extensions for this message. Note: the array is
+ * ordered in reverse relative to the order of creation. */
+const upb_Message_Extension* _upb_Message_Getexts(const upb_Message* msg,
+ size_t* count);
+
+/* Returns an extension for the given field number, or NULL if no extension
+ * exists for this field number. */
+const upb_Message_Extension* _upb_Message_Getext(
+ const upb_Message* msg, const upb_MiniTable_Extension* ext);
+
+void _upb_Message_Clearext(upb_Message* msg,
+ const upb_MiniTable_Extension* ext);
+
+void _upb_Message_Clearext(upb_Message* msg,
+ const upb_MiniTable_Extension* ext);
+
+/** Hasbit access *************************************************************/
+
+UPB_INLINE bool _upb_hasbit(const upb_Message* msg, size_t idx) {
+ return (*UPB_PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
+}
+
+UPB_INLINE void _upb_sethas(const upb_Message* msg, size_t idx) {
+ (*UPB_PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
+}
+
+UPB_INLINE void _upb_clearhas(const upb_Message* msg, size_t idx) {
+ (*UPB_PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
+}
+
+UPB_INLINE size_t _upb_Message_Hasidx(const upb_MiniTable_Field* f) {
+ UPB_ASSERT(f->presence > 0);
+ return f->presence;
+}
+
+UPB_INLINE bool _upb_hasbit_field(const upb_Message* msg,
+ const upb_MiniTable_Field* f) {
+ return _upb_hasbit(msg, _upb_Message_Hasidx(f));
+}
+
+UPB_INLINE void _upb_sethas_field(const upb_Message* msg,
+ const upb_MiniTable_Field* f) {
+ _upb_sethas(msg, _upb_Message_Hasidx(f));
+}
+
+UPB_INLINE void _upb_clearhas_field(const upb_Message* msg,
+ const upb_MiniTable_Field* f) {
+ _upb_clearhas(msg, _upb_Message_Hasidx(f));
+}
+
+/** Oneof case access *********************************************************/
+
+UPB_INLINE uint32_t* _upb_oneofcase(upb_Message* msg, size_t case_ofs) {
+ return UPB_PTR_AT(msg, case_ofs, uint32_t);
+}
+
+UPB_INLINE uint32_t _upb_getoneofcase(const void* msg, size_t case_ofs) {
+ return *UPB_PTR_AT(msg, case_ofs, uint32_t);
+}
+
+UPB_INLINE size_t _upb_oneofcase_ofs(const upb_MiniTable_Field* f) {
+ UPB_ASSERT(f->presence < 0);
+ return ~(ptrdiff_t)f->presence;
+}
+
+UPB_INLINE uint32_t* _upb_oneofcase_field(upb_Message* msg,
+ const upb_MiniTable_Field* f) {
+ return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
+}
+
+UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_Message* msg,
+ const upb_MiniTable_Field* f) {
+ return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
+}
+
+UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_Message* msg, size_t ofs) {
+ return *UPB_PTR_AT(msg, ofs, const upb_Message*) != NULL;
+}
+
+/** upb_Array *****************************************************************/
+
+/* Our internal representation for repeated fields. */
+typedef struct {
+ uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
+ size_t len; /* Measured in elements. */
+ size_t size; /* Measured in elements. */
+ uint64_t junk;
+} upb_Array;
+
+UPB_INLINE const void* _upb_array_constptr(const upb_Array* arr) {
+ UPB_ASSERT((arr->data & 7) <= 4);
+ return (void*)(arr->data & ~(uintptr_t)7);
+}
+
+UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
+ UPB_ASSERT(elem_size_lg2 <= 4);
+ return (uintptr_t)ptr | elem_size_lg2;
+}
+
+UPB_INLINE void* _upb_array_ptr(upb_Array* arr) {
+ return (void*)_upb_array_constptr(arr);
+}
+
+UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
+ UPB_ASSERT(elem_size_lg2 <= 4);
+ UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
+ return (uintptr_t)ptr | (unsigned)elem_size_lg2;
+}
+
+UPB_INLINE upb_Array* _upb_Array_New(upb_Arena* a, size_t init_size,
+ int elem_size_lg2) {
+ const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_Array), 8);
+ const size_t bytes = sizeof(upb_Array) + (init_size << elem_size_lg2);
+ upb_Array* arr = (upb_Array*)upb_Arena_Malloc(a, bytes);
+ if (!arr) return NULL;
+ arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
+ arr->len = 0;
+ arr->size = init_size;
+ return arr;
+}
+
+/* Resizes the capacity of the array to be at least min_size. */
+bool _upb_array_realloc(upb_Array* arr, size_t min_size, upb_Arena* arena);
+
+/* Fallback functions for when the accessors require a resize. */
+void* _upb_Array_Resize_fallback(upb_Array** arr_ptr, size_t size,
+ int elem_size_lg2, upb_Arena* arena);
+bool _upb_Array_Append_fallback(upb_Array** arr_ptr, const void* value,
+ int elem_size_lg2, upb_Arena* arena);
+
+UPB_INLINE bool _upb_array_reserve(upb_Array* arr, size_t size,
+ upb_Arena* arena) {
+ if (arr->size < size) return _upb_array_realloc(arr, size, arena);
+ return true;
+}
+
+UPB_INLINE bool _upb_Array_Resize(upb_Array* arr, size_t size,
+ upb_Arena* arena) {
+ if (!_upb_array_reserve(arr, size, arena)) return false;
+ arr->len = size;
+ return true;
+}
+
+UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) {
+ *UPB_PTR_AT(msg, ofs, upb_Array*) = NULL;
+}
+
+UPB_INLINE const void* _upb_array_accessor(const void* msg, size_t ofs,
+ size_t* size) {
+ const upb_Array* arr = *UPB_PTR_AT(msg, ofs, const upb_Array*);
+ if (arr) {
+ if (size) *size = arr->len;
+ return _upb_array_constptr(arr);
+ } else {
+ if (size) *size = 0;
+ return NULL;
+ }
+}
+
+UPB_INLINE void* _upb_array_mutable_accessor(void* msg, size_t ofs,
+ size_t* size) {
+ upb_Array* arr = *UPB_PTR_AT(msg, ofs, upb_Array*);
+ if (arr) {
+ if (size) *size = arr->len;
+ return _upb_array_ptr(arr);
+ } else {
+ if (size) *size = 0;
+ return NULL;
+ }
+}
+
+UPB_INLINE void* _upb_Array_Resize_accessor2(void* msg, size_t ofs, size_t size,
+ int elem_size_lg2,
+ upb_Arena* arena) {
+ upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
+ upb_Array* arr = *arr_ptr;
+ if (!arr || arr->size < size) {
+ return _upb_Array_Resize_fallback(arr_ptr, size, elem_size_lg2, arena);
+ }
+ arr->len = size;
+ return _upb_array_ptr(arr);
+}
+
+UPB_INLINE bool _upb_Array_Append_accessor2(void* msg, size_t ofs,
+ int elem_size_lg2,
+ const void* value,
+ upb_Arena* arena) {
+ upb_Array** arr_ptr = UPB_PTR_AT(msg, ofs, upb_Array*);
+ size_t elem_size = 1 << elem_size_lg2;
+ upb_Array* arr = *arr_ptr;
+ void* ptr;
+ if (!arr || arr->len == arr->size) {
+ return _upb_Array_Append_fallback(arr_ptr, value, elem_size_lg2, arena);
+ }
+ ptr = _upb_array_ptr(arr);
+ memcpy(UPB_PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
+ arr->len++;
+ return true;
+}
+
+/* Used by old generated code, remove once all code has been regenerated. */
+UPB_INLINE int _upb_sizelg2(upb_CType type) {
+ switch (type) {
+ case kUpb_CType_Bool:
+ return 0;
+ case kUpb_CType_Float:
+ case kUpb_CType_Int32:
+ case kUpb_CType_UInt32:
+ case kUpb_CType_Enum:
+ return 2;
+ case kUpb_CType_Message:
+ return UPB_SIZE(2, 3);
+ case kUpb_CType_Double:
+ case kUpb_CType_Int64:
+ case kUpb_CType_UInt64:
+ return 3;
+ case kUpb_CType_String:
+ case kUpb_CType_Bytes:
+ return UPB_SIZE(3, 4);
+ }
+ UPB_UNREACHABLE();
+}
+UPB_INLINE void* _upb_Array_Resize_accessor(void* msg, size_t ofs, size_t size,
+ upb_CType type, upb_Arena* arena) {
+ return _upb_Array_Resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena);
+}
+UPB_INLINE bool _upb_Array_Append_accessor(void* msg, size_t ofs,
+ size_t elem_size, upb_CType type,
+ const void* value,
+ upb_Arena* arena) {
+ (void)elem_size;
+ return _upb_Array_Append_accessor2(msg, ofs, _upb_sizelg2(type), value,
+ arena);
+}
+
+/** upb_Map *******************************************************************/
+
+/* Right now we use strmaps for everything. We'll likely want to use
+ * integer-specific maps for integer-keyed maps.*/
+typedef struct {
+ /* Size of key and val, based on the map type. Strings are represented as '0'
+ * because they must be handled specially. */
+ char key_size;
+ char val_size;
+
+ upb_strtable table;
+} upb_Map;
+
+/* Map entries aren't actually stored, they are only used during parsing. For
+ * parsing, it helps a lot if all map entry messages have the same layout.
+ * The compiler and def.c must ensure that all map entries have this layout. */
+typedef struct {
+ upb_Message_Internal internal;
+ union {
+ upb_StringView str; /* For str/bytes. */
+ upb_value val; /* For all other types. */
+ } k;
+ union {
+ upb_StringView str; /* For str/bytes. */
+ upb_value val; /* For all other types. */
+ } v;
+} upb_MapEntry;
+
+/* Creates a new map on the given arena with this key/value type. */
+upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size);
+
+/* Converting between internal table representation and user values.
+ *
+ * _upb_map_tokey() and _upb_map_fromkey() are inverses.
+ * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
+ *
+ * These functions account for the fact that strings are treated differently
+ * from other types when stored in a map.
+ */
+
+UPB_INLINE upb_StringView _upb_map_tokey(const void* key, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ return *(upb_StringView*)key;
+ } else {
+ return upb_StringView_FromDataAndSize((const char*)key, size);
+ }
+}
+
+UPB_INLINE void _upb_map_fromkey(upb_StringView key, void* out, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ memcpy(out, &key, sizeof(key));
+ } else {
+ memcpy(out, key.data, size);
+ }
+}
+
+UPB_INLINE bool _upb_map_tovalue(const void* val, size_t size,
+ upb_value* msgval, upb_Arena* a) {
+ if (size == UPB_MAPTYPE_STRING) {
+ upb_StringView* strp = (upb_StringView*)upb_Arena_Malloc(a, sizeof(*strp));
+ if (!strp) return false;
+ *strp = *(upb_StringView*)val;
+ *msgval = upb_value_ptr(strp);
+ } else {
+ memcpy(msgval, val, size);
+ }
+ return true;
+}
+
+UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ const upb_StringView* strp = (const upb_StringView*)upb_value_getptr(val);
+ memcpy(out, strp, sizeof(upb_StringView));
+ } else {
+ memcpy(out, &val, size);
+ }
+}
+
+/* Map operations, shared by reflection and generated code. */
+
+UPB_INLINE size_t _upb_Map_Size(const upb_Map* map) {
+ return map->table.t.count;
+}
+
+UPB_INLINE bool _upb_Map_Get(const upb_Map* map, const void* key,
+ size_t key_size, void* val, size_t val_size) {
+ upb_value tabval;
+ upb_StringView k = _upb_map_tokey(key, key_size);
+ bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
+ if (ret && val) {
+ _upb_map_fromvalue(tabval, val, val_size);
+ }
+ return ret;
+}
+
+UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) {
+ upb_strtable_iter it;
+ it.t = &map->table;
+ it.index = *iter;
+ upb_strtable_next(&it);
+ *iter = it.index;
+ if (upb_strtable_done(&it)) return NULL;
+ return (void*)str_tabent(&it);
+}
+
+UPB_INLINE bool _upb_Map_Set(upb_Map* map, const void* key, size_t key_size,
+ void* val, size_t val_size, upb_Arena* a) {
+ upb_StringView strkey = _upb_map_tokey(key, key_size);
+ upb_value tabval = {0};
+ if (!_upb_map_tovalue(val, val_size, &tabval, a)) return false;
+
+ /* TODO(haberman): add overwrite operation to minimize number of lookups. */
+ upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL);
+ return upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a);
+}
+
+UPB_INLINE bool _upb_Map_Delete(upb_Map* map, const void* key,
+ size_t key_size) {
+ upb_StringView k = _upb_map_tokey(key, key_size);
+ return upb_strtable_remove2(&map->table, k.data, k.size, NULL);
+}
+
+UPB_INLINE void _upb_Map_Clear(upb_Map* map) {
+ upb_strtable_clear(&map->table);
+}
+
+/* Message map operations, these get the map from the message first. */
+
+UPB_INLINE size_t _upb_msg_map_size(const upb_Message* msg, size_t ofs) {
+ upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
+ return map ? _upb_Map_Size(map) : 0;
+}
+
+UPB_INLINE bool _upb_msg_map_get(const upb_Message* msg, size_t ofs,
+ const void* key, size_t key_size, void* val,
+ size_t val_size) {
+ upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
+ if (!map) return false;
+ return _upb_Map_Get(map, key, key_size, val, val_size);
+}
+
+UPB_INLINE void* _upb_msg_map_next(const upb_Message* msg, size_t ofs,
+ size_t* iter) {
+ upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
+ if (!map) return NULL;
+ return _upb_map_next(map, iter);
+}
+
+UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key,
+ size_t key_size, void* val, size_t val_size,
+ upb_Arena* arena) {
+ upb_Map** map = UPB_PTR_AT(msg, ofs, upb_Map*);
+ if (!*map) {
+ *map = _upb_Map_New(arena, key_size, val_size);
+ }
+ return _upb_Map_Set(*map, key, key_size, val, val_size, arena);
+}
+
+UPB_INLINE bool _upb_msg_map_delete(upb_Message* msg, size_t ofs,
+ const void* key, size_t key_size) {
+ upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
+ if (!map) return false;
+ return _upb_Map_Delete(map, key, key_size);
+}
+
+UPB_INLINE void _upb_msg_map_clear(upb_Message* msg, size_t ofs) {
+ upb_Map* map = *UPB_PTR_AT(msg, ofs, upb_Map*);
+ if (!map) return;
+ _upb_Map_Clear(map);
+}
+
+/* Accessing map key/value from a pointer, used by generated code only. */
+
+UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
+ const upb_tabent* ent = (const upb_tabent*)msg;
+ uint32_t u32len;
+ upb_StringView k;
+ k.data = upb_tabstr(ent->key, &u32len);
+ k.size = u32len;
+ _upb_map_fromkey(k, key, size);
+}
+
+UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
+ const upb_tabent* ent = (const upb_tabent*)msg;
+ upb_value v = {ent->val.val};
+ _upb_map_fromvalue(v, val, size);
+}
+
+UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val,
+ size_t size) {
+ upb_tabent* ent = (upb_tabent*)msg;
+ /* This is like _upb_map_tovalue() except the entry already exists so we can
+ * reuse the allocated upb_StringView for string fields. */
+ if (size == UPB_MAPTYPE_STRING) {
+ upb_StringView* strp = (upb_StringView*)(uintptr_t)ent->val.val;
+ memcpy(strp, val, sizeof(*strp));
+ } else {
+ memcpy(&ent->val.val, val, size);
+ }
+}
+
+/** _upb_mapsorter ************************************************************/
+
+/* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
+ * Since maps can be recursive (map values can be messages which contain other
+ * maps). _upb_mapsorter can contain a stack of maps. */
+
+typedef struct {
+ upb_tabent const** entries;
+ int size;
+ int cap;
+} _upb_mapsorter;
+
+typedef struct {
+ int start;
+ int pos;
+ int end;
+} _upb_sortedmap;
+
+UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter* s) {
+ s->entries = NULL;
+ s->size = 0;
+ s->cap = 0;
+}
+
+UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter* s) {
+ if (s->entries) free(s->entries);
+}
+
+bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType key_type,
+ const upb_Map* map, _upb_sortedmap* sorted);
+
+UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter* s,
+ _upb_sortedmap* sorted) {
+ s->size = sorted->start;
+}
+
+UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter* s, const upb_Map* map,
+ _upb_sortedmap* sorted, upb_MapEntry* ent) {
+ if (sorted->pos == sorted->end) return false;
+ const upb_tabent* tabent = s->entries[sorted->pos++];
+ upb_StringView key = upb_tabstrview(tabent->key);
+ _upb_map_fromkey(key, &ent->k, map->key_size);
+ upb_value val = {tabent->val.val};
+ _upb_map_fromvalue(val, &ent->v, map->val_size);
+ return true;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_MSG_INT_H_ */
diff --git a/grpc/third_party/upb/upb/msg_test.cc b/grpc/third_party/upb/upb/msg_test.cc
new file mode 100644
index 00000000..2d1f8e99
--- /dev/null
+++ b/grpc/third_party/upb/upb/msg_test.cc
@@ -0,0 +1,429 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "src/google/protobuf/test_messages_proto3.upb.h"
+#include "upb/def.hpp"
+#include "upb/json_decode.h"
+#include "upb/json_encode.h"
+#include "upb/msg_test.upb.h"
+#include "upb/msg_test.upbdefs.h"
+#include "upb/upb.hpp"
+
+void VerifyMessage(const upb_test_TestExtensions* ext_msg) {
+ EXPECT_TRUE(upb_test_TestExtensions_has_optional_int32_ext(ext_msg));
+ // EXPECT_FALSE(upb_test_TestExtensions_Nested_has_optional_int32_ext(ext_msg));
+ EXPECT_TRUE(upb_test_has_optional_msg_ext(ext_msg));
+
+ EXPECT_EQ(123, upb_test_TestExtensions_optional_int32_ext(ext_msg));
+ const protobuf_test_messages_proto3_TestAllTypesProto3* ext_submsg =
+ upb_test_optional_msg_ext(ext_msg);
+ EXPECT_TRUE(ext_submsg != nullptr);
+ EXPECT_EQ(456,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_int32(
+ ext_submsg));
+}
+
+TEST(MessageTest, Extensions) {
+ upb::Arena arena;
+ upb_test_TestExtensions* ext_msg = upb_test_TestExtensions_new(arena.ptr());
+
+ EXPECT_FALSE(upb_test_TestExtensions_has_optional_int32_ext(ext_msg));
+ // EXPECT_FALSE(upb_test_TestExtensions_Nested_has_optional_int32_ext(ext_msg));
+ EXPECT_FALSE(upb_test_has_optional_msg_ext(ext_msg));
+
+ upb::SymbolTable symtab;
+ upb::MessageDefPtr m(upb_test_TestExtensions_getmsgdef(symtab.ptr()));
+ EXPECT_TRUE(m.ptr() != nullptr);
+
+ std::string json = R"json(
+ {
+ "[upb_test.TestExtensions.optional_int32_ext]": 123,
+ "[upb_test.TestExtensions.Nested.repeated_int32_ext]": [2, 4, 6],
+ "[upb_test.optional_msg_ext]": {"optional_int32": 456}
+ }
+ )json";
+ upb::Status status;
+ EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), ext_msg, m.ptr(),
+ symtab.ptr(), 0, arena.ptr(), status.ptr()))
+ << status.error_message();
+
+ VerifyMessage(ext_msg);
+
+ // Test round-trip through binary format.
+ size_t size;
+ char* serialized =
+ upb_test_TestExtensions_serialize(ext_msg, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+ ASSERT_GE(size, 0);
+
+ upb_test_TestExtensions* ext_msg2 = upb_test_TestExtensions_parse_ex(
+ serialized, size, upb_DefPool_ExtensionRegistry(symtab.ptr()), 0,
+ arena.ptr());
+ VerifyMessage(ext_msg2);
+
+ // Test round-trip through JSON format.
+ size_t json_size =
+ upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, NULL, 0, status.ptr());
+ char* json_buf =
+ static_cast<char*>(upb_Arena_Malloc(arena.ptr(), json_size + 1));
+ upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, json_buf, json_size + 1,
+ status.ptr());
+ upb_test_TestExtensions* ext_msg3 = upb_test_TestExtensions_new(arena.ptr());
+ EXPECT_TRUE(upb_JsonDecode(json_buf, json_size, ext_msg3, m.ptr(),
+ symtab.ptr(), 0, arena.ptr(), status.ptr()))
+ << status.error_message();
+ VerifyMessage(ext_msg3);
+}
+
+void VerifyMessageSet(const upb_test_TestMessageSet* mset_msg) {
+ bool has = upb_test_MessageSetMember_has_message_set_extension(mset_msg);
+ EXPECT_TRUE(has);
+ if (!has) return;
+ const upb_test_MessageSetMember* member =
+ upb_test_MessageSetMember_message_set_extension(mset_msg);
+ EXPECT_TRUE(member != nullptr);
+ EXPECT_TRUE(upb_test_MessageSetMember_has_optional_int32(member));
+ EXPECT_EQ(234, upb_test_MessageSetMember_optional_int32(member));
+}
+
+TEST(MessageTest, MessageSet) {
+ upb::Arena arena;
+ upb_test_TestMessageSet* ext_msg = upb_test_TestMessageSet_new(arena.ptr());
+
+ EXPECT_FALSE(upb_test_MessageSetMember_has_message_set_extension(ext_msg));
+
+ upb::SymbolTable symtab;
+ upb::MessageDefPtr m(upb_test_TestMessageSet_getmsgdef(symtab.ptr()));
+ EXPECT_TRUE(m.ptr() != nullptr);
+
+ std::string json = R"json(
+ {
+ "[upb_test.MessageSetMember]": {"optional_int32": 234}
+ }
+ )json";
+ upb::Status status;
+ EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), ext_msg, m.ptr(),
+ symtab.ptr(), 0, arena.ptr(), status.ptr()))
+ << status.error_message();
+
+ VerifyMessageSet(ext_msg);
+
+ // Test round-trip through binary format.
+ size_t size;
+ char* serialized =
+ upb_test_TestMessageSet_serialize(ext_msg, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+ ASSERT_GE(size, 0);
+
+ upb_test_TestMessageSet* ext_msg2 = upb_test_TestMessageSet_parse_ex(
+ serialized, size, upb_DefPool_ExtensionRegistry(symtab.ptr()), 0,
+ arena.ptr());
+ VerifyMessageSet(ext_msg2);
+
+ // Test round-trip through JSON format.
+ size_t json_size =
+ upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, NULL, 0, status.ptr());
+ char* json_buf =
+ static_cast<char*>(upb_Arena_Malloc(arena.ptr(), json_size + 1));
+ upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, json_buf, json_size + 1,
+ status.ptr());
+ upb_test_TestMessageSet* ext_msg3 = upb_test_TestMessageSet_new(arena.ptr());
+ EXPECT_TRUE(upb_JsonDecode(json_buf, json_size, ext_msg3, m.ptr(),
+ symtab.ptr(), 0, arena.ptr(), status.ptr()))
+ << status.error_message();
+ VerifyMessageSet(ext_msg3);
+}
+
+TEST(MessageTest, Proto2Enum) {
+ upb::Arena arena;
+ upb_test_Proto2FakeEnumMessage* fake_msg =
+ upb_test_Proto2FakeEnumMessage_new(arena.ptr());
+
+ upb_test_Proto2FakeEnumMessage_set_optional_enum(fake_msg, 999);
+
+ int32_t* vals = upb_test_Proto2FakeEnumMessage_resize_repeated_enum(
+ fake_msg, 6, arena.ptr());
+ vals[0] = upb_test_Proto2EnumMessage_ZERO;
+ vals[1] = 7; // Unknown small.
+ vals[2] = upb_test_Proto2EnumMessage_SMALL;
+ vals[3] = 888; // Unknown large.
+ vals[4] = upb_test_Proto2EnumMessage_LARGE;
+ vals[5] = upb_test_Proto2EnumMessage_NEGATIVE;
+
+ vals = upb_test_Proto2FakeEnumMessage_resize_packed_enum(fake_msg, 6,
+ arena.ptr());
+ vals[0] = upb_test_Proto2EnumMessage_ZERO;
+ vals[1] = 7; // Unknown small.
+ vals[2] = upb_test_Proto2EnumMessage_SMALL;
+ vals[3] = 888; // Unknown large.
+ vals[4] = upb_test_Proto2EnumMessage_LARGE;
+ vals[5] = upb_test_Proto2EnumMessage_NEGATIVE;
+
+ size_t size;
+ char* pb =
+ upb_test_Proto2FakeEnumMessage_serialize(fake_msg, arena.ptr(), &size);
+
+ // Parsing as enums puts unknown values into unknown fields.
+ upb_test_Proto2EnumMessage* enum_msg =
+ upb_test_Proto2EnumMessage_parse(pb, size, arena.ptr());
+ ASSERT_TRUE(enum_msg != nullptr);
+
+ EXPECT_EQ(false, upb_test_Proto2EnumMessage_has_optional_enum(enum_msg));
+ const int32_t* vals_const =
+ upb_test_Proto2EnumMessage_repeated_enum(enum_msg, &size);
+ EXPECT_EQ(4, size); // Two unknown values moved to the unknown field set.
+
+ // Parsing back into the fake message shows the original data, except the
+ // repeated enum is rearranged.
+ pb = upb_test_Proto2EnumMessage_serialize(enum_msg, arena.ptr(), &size);
+ upb_test_Proto2FakeEnumMessage* fake_msg2 =
+ upb_test_Proto2FakeEnumMessage_parse(pb, size, arena.ptr());
+
+ EXPECT_EQ(true, upb_test_Proto2FakeEnumMessage_has_optional_enum(fake_msg2));
+ EXPECT_EQ(999, upb_test_Proto2FakeEnumMessage_optional_enum(fake_msg2));
+
+ int32_t expected[] = {
+ upb_test_Proto2EnumMessage_ZERO,
+ upb_test_Proto2EnumMessage_SMALL,
+ upb_test_Proto2EnumMessage_LARGE,
+ upb_test_Proto2EnumMessage_NEGATIVE,
+ 7,
+ 888,
+ };
+
+ vals_const = upb_test_Proto2FakeEnumMessage_repeated_enum(fake_msg2, &size);
+ EXPECT_EQ(6, size);
+ EXPECT_THAT(std::vector<int32_t>(vals_const, vals_const + size),
+ ::testing::ElementsAreArray(expected));
+
+ vals_const = upb_test_Proto2FakeEnumMessage_packed_enum(fake_msg2, &size);
+ EXPECT_EQ(6, size);
+ EXPECT_THAT(std::vector<int32_t>(vals_const, vals_const + size),
+ ::testing::ElementsAreArray(expected));
+}
+
+TEST(MessageTest, TestBadUTF8) {
+ upb::Arena arena;
+ std::string serialized("r\x03\xed\xa0\x81");
+ EXPECT_EQ(nullptr, protobuf_test_messages_proto3_TestAllTypesProto3_parse(
+ serialized.data(), serialized.size(), arena.ptr()));
+}
+
+TEST(MessageTest, DecodeRequiredFieldsTopLevelMessage) {
+ upb::Arena arena;
+ upb_test_TestRequiredFields* test_msg;
+ upb_test_EmptyMessage* empty_msg;
+
+ // Succeeds, because we did not request required field checks.
+ test_msg = upb_test_TestRequiredFields_parse(NULL, 0, arena.ptr());
+ EXPECT_NE(nullptr, test_msg);
+
+ // Fails, because required fields are missing.
+ EXPECT_EQ(kUpb_DecodeStatus_MissingRequired,
+ upb_Decode(NULL, 0, test_msg, &upb_test_TestRequiredFields_msginit,
+ NULL, kUpb_DecodeOption_CheckRequired, arena.ptr()));
+
+ upb_test_TestRequiredFields_set_required_int32(test_msg, 1);
+ size_t size;
+ char* serialized =
+ upb_test_TestRequiredFields_serialize(test_msg, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+ EXPECT_NE(0, size);
+
+ // Fails, but the code path is slightly different because the serialized
+ // payload is not empty.
+ EXPECT_EQ(kUpb_DecodeStatus_MissingRequired,
+ upb_Decode(serialized, size, test_msg,
+ &upb_test_TestRequiredFields_msginit, NULL,
+ kUpb_DecodeOption_CheckRequired, arena.ptr()));
+
+ empty_msg = upb_test_EmptyMessage_new(arena.ptr());
+ upb_test_TestRequiredFields_set_required_int32(test_msg, 1);
+ upb_test_TestRequiredFields_set_required_int64(test_msg, 2);
+ upb_test_TestRequiredFields_set_required_message(test_msg, empty_msg);
+
+ // Succeeds, because required fields are present (though not in the input).
+ EXPECT_EQ(kUpb_DecodeStatus_Ok,
+ upb_Decode(NULL, 0, test_msg, &upb_test_TestRequiredFields_msginit,
+ NULL, kUpb_DecodeOption_CheckRequired, arena.ptr()));
+
+ // Serialize a complete payload.
+ serialized =
+ upb_test_TestRequiredFields_serialize(test_msg, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+ EXPECT_NE(0, size);
+
+ upb_test_TestRequiredFields* test_msg2 = upb_test_TestRequiredFields_parse_ex(
+ serialized, size, NULL, kUpb_DecodeOption_CheckRequired, arena.ptr());
+ EXPECT_NE(nullptr, test_msg2);
+
+ // When we add an incomplete sub-message, this is not flagged by the parser.
+ // This makes parser checking unsuitable for MergeFrom().
+ upb_test_TestRequiredFields_set_optional_message(
+ test_msg2, upb_test_TestRequiredFields_new(arena.ptr()));
+ EXPECT_EQ(kUpb_DecodeStatus_Ok,
+ upb_Decode(serialized, size, test_msg2,
+ &upb_test_TestRequiredFields_msginit, NULL,
+ kUpb_DecodeOption_CheckRequired, arena.ptr()));
+}
+
+TEST(MessageTest, DecodeRequiredFieldsSubMessage) {
+ upb::Arena arena;
+ upb_test_TestRequiredFields* test_msg =
+ upb_test_TestRequiredFields_new(arena.ptr());
+ upb_test_SubMessageHasRequired* sub_msg =
+ upb_test_SubMessageHasRequired_new(arena.ptr());
+ upb_test_EmptyMessage* empty_msg = upb_test_EmptyMessage_new(arena.ptr());
+
+ upb_test_SubMessageHasRequired_set_optional_message(sub_msg, test_msg);
+ size_t size;
+ char* serialized =
+ upb_test_SubMessageHasRequired_serialize(sub_msg, arena.ptr(), &size);
+ EXPECT_NE(0, size);
+
+ // No parse error when parsing normally.
+ EXPECT_NE(nullptr, upb_test_SubMessageHasRequired_parse(serialized, size,
+ arena.ptr()));
+
+ // Parse error when verifying required fields, due to incomplete sub-message.
+ EXPECT_EQ(nullptr, upb_test_SubMessageHasRequired_parse_ex(
+ serialized, size, NULL,
+ kUpb_DecodeOption_CheckRequired, arena.ptr()));
+
+ upb_test_TestRequiredFields_set_required_int32(test_msg, 1);
+ upb_test_TestRequiredFields_set_required_int64(test_msg, 2);
+ upb_test_TestRequiredFields_set_required_message(test_msg, empty_msg);
+
+ serialized =
+ upb_test_SubMessageHasRequired_serialize(sub_msg, arena.ptr(), &size);
+ EXPECT_NE(0, size);
+
+ // No parse error; sub-message now is complete.
+ EXPECT_NE(nullptr, upb_test_SubMessageHasRequired_parse_ex(
+ serialized, size, NULL,
+ kUpb_DecodeOption_CheckRequired, arena.ptr()));
+}
+
+TEST(MessageTest, EncodeRequiredFields) {
+ upb::Arena arena;
+ upb_test_TestRequiredFields* test_msg =
+ upb_test_TestRequiredFields_new(arena.ptr());
+
+ // Succeeds, we didn't ask for required field checking.
+ size_t size;
+ char* serialized =
+ upb_test_TestRequiredFields_serialize_ex(test_msg, 0, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+ EXPECT_EQ(size, 0);
+
+ // Fails, we asked for required field checking but the required field is
+ // missing.
+ serialized = upb_test_TestRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized == nullptr);
+
+ // Fails, some required fields are present but not others.
+ upb_test_TestRequiredFields_set_required_int32(test_msg, 1);
+ serialized = upb_test_TestRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized == nullptr);
+
+ // Succeeds, all required fields are set.
+ upb_test_EmptyMessage* empty_msg = upb_test_EmptyMessage_new(arena.ptr());
+ upb_test_TestRequiredFields_set_required_int64(test_msg, 2);
+ upb_test_TestRequiredFields_set_required_message(test_msg, empty_msg);
+ serialized = upb_test_TestRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+}
+
+TEST(MessageTest, MaxRequiredFields) {
+ upb::Arena arena;
+ upb_test_TestMaxRequiredFields* test_msg =
+ upb_test_TestMaxRequiredFields_new(arena.ptr());
+
+ // Fails, we asked for required field checking but the required field is
+ // missing.
+ size_t size;
+ char* serialized = upb_test_TestMaxRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized == nullptr);
+
+ upb::SymbolTable symtab;
+ upb::MessageDefPtr m(upb_test_TestMaxRequiredFields_getmsgdef(symtab.ptr()));
+ upb_MessageValue val;
+ val.int32_val = 1;
+ for (int i = 1; i <= 61; i++) {
+ upb::FieldDefPtr f = m.FindFieldByNumber(i);
+ ASSERT_TRUE(f);
+ upb_Message_Set(test_msg, f.ptr(), val, arena.ptr());
+ }
+
+ // Fails, field 63 still isn't set.
+ serialized = upb_test_TestMaxRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized == nullptr);
+
+ // Succeeds, all required fields are set.
+ upb::FieldDefPtr f = m.FindFieldByNumber(62);
+ ASSERT_TRUE(f);
+ upb_Message_Set(test_msg, f.ptr(), val, arena.ptr());
+ serialized = upb_test_TestMaxRequiredFields_serialize_ex(
+ test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size);
+ ASSERT_TRUE(serialized != nullptr);
+}
+
+TEST(MessageTest, MapField) {
+ upb::Arena arena;
+ upb_test_TestMapFieldExtra* test_msg_extra =
+ upb_test_TestMapFieldExtra_new(arena.ptr());
+
+ ASSERT_TRUE(upb_test_TestMapFieldExtra_map_field_set(
+ test_msg_extra, 0, upb_test_TestMapFieldExtra_THREE, arena.ptr()));
+
+ size_t size;
+ char* serialized = upb_test_TestMapFieldExtra_serialize_ex(
+ test_msg_extra, 0, arena.ptr(), &size);
+ ASSERT_NE(nullptr, serialized);
+ ASSERT_NE(0, size);
+
+ upb_test_TestMapField* test_msg =
+ upb_test_TestMapField_parse(serialized, size, arena.ptr());
+ ASSERT_NE(nullptr, test_msg);
+
+ ASSERT_FALSE(upb_test_TestMapField_map_field_get(test_msg, 0, nullptr));
+ serialized =
+ upb_test_TestMapField_serialize_ex(test_msg, 0, arena.ptr(), &size);
+ ASSERT_NE(0, size);
+ // parse into second instance
+ upb_test_TestMapFieldExtra* test_msg_extra2 =
+ upb_test_TestMapFieldExtra_parse(serialized, size, arena.ptr());
+ ASSERT_TRUE(
+ upb_test_TestMapFieldExtra_map_field_get(test_msg_extra2, 0, nullptr));
+}
diff --git a/grpc/third_party/upb/upb/msg_test.proto b/grpc/third_party/upb/upb/msg_test.proto
new file mode 100644
index 00000000..1cdd84a3
--- /dev/null
+++ b/grpc/third_party/upb/upb/msg_test.proto
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto2";
+
+package upb_test;
+
+import "src/google/protobuf/test_messages_proto3.proto";
+
+message TestExtensions {
+ extensions 1000 to max;
+ extend TestExtensions {
+ optional int32 optional_int32_ext = 1000;
+ }
+ message Nested {
+ extend TestExtensions {
+ repeated int32 repeated_int32_ext = 1001;
+ }
+ }
+}
+
+extend TestExtensions {
+ optional protobuf_test_messages.proto3.TestAllTypesProto3 optional_msg_ext =
+ 1002;
+}
+
+message TestMessageSet {
+ option message_set_wire_format = true;
+
+ extensions 4 to max;
+}
+
+message MessageSetMember {
+ optional int32 optional_int32 = 1;
+ extend TestMessageSet {
+ optional MessageSetMember message_set_extension = 4;
+ }
+}
+
+message Proto2EnumMessage {
+ enum Proto2TestEnum {
+ ZERO = 0;
+ NEGATIVE = -1;
+ SMALL = 15;
+ LARGE = 12345;
+ }
+
+ optional Proto2TestEnum optional_enum = 1;
+ repeated Proto2TestEnum repeated_enum = 2;
+ repeated Proto2TestEnum packed_enum = 3 [packed = true];
+}
+
+// The same fields as Proto2EnumMessage, but with int32 fields so we can fake
+// wire format.
+message Proto2FakeEnumMessage {
+ optional int32 optional_enum = 1;
+ repeated int32 repeated_enum = 2;
+ repeated int32 packed_enum = 3 [packed = true];
+}
+
+message EmptyMessage {}
+
+message TestRequiredFields {
+ required int32 required_int32 = 1;
+ optional int32 optional_int32 = 2;
+ required int64 required_int64 = 3;
+ optional TestRequiredFields optional_message = 4;
+ required EmptyMessage required_message = 5;
+}
+
+message SubMessageHasRequired {
+ optional TestRequiredFields optional_message = 1;
+}
+
+message TestMaxRequiredFields {
+ required int32 required_int32_1 = 1;
+ required int32 required_int32_2 = 2;
+ required int32 required_int32_3 = 3;
+ required int32 required_int32_4 = 4;
+ required int32 required_int32_5 = 5;
+ required int32 required_int32_6 = 6;
+ required int32 required_int32_7 = 7;
+ required int32 required_int32_8 = 8;
+ required int32 required_int32_9 = 9;
+ required int32 required_int32_10 = 10;
+ required int32 required_int32_11 = 11;
+ required int32 required_int32_12 = 12;
+ required int32 required_int32_13 = 13;
+ required int32 required_int32_14 = 14;
+ required int32 required_int32_15 = 15;
+ required int32 required_int32_16 = 16;
+ required int32 required_int32_17 = 17;
+ required int32 required_int32_18 = 18;
+ required int32 required_int32_19 = 19;
+ required int32 required_int32_20 = 20;
+ required int32 required_int32_21 = 21;
+ required int32 required_int32_22 = 22;
+ required int32 required_int32_23 = 23;
+ required int32 required_int32_24 = 24;
+ required int32 required_int32_25 = 25;
+ required int32 required_int32_26 = 26;
+ required int32 required_int32_27 = 27;
+ required int32 required_int32_28 = 28;
+ required int32 required_int32_29 = 29;
+ required int32 required_int32_30 = 30;
+ required int32 required_int32_31 = 31;
+ required int32 required_int32_32 = 32;
+ required int32 required_int32_33 = 33;
+ required int32 required_int32_34 = 34;
+ required int32 required_int32_35 = 35;
+ required int32 required_int32_36 = 36;
+ required int32 required_int32_37 = 37;
+ required int32 required_int32_38 = 38;
+ required int32 required_int32_39 = 39;
+ required int32 required_int32_40 = 40;
+ required int32 required_int32_41 = 41;
+ required int32 required_int32_42 = 42;
+ required int32 required_int32_43 = 43;
+ required int32 required_int32_44 = 44;
+ required int32 required_int32_45 = 45;
+ required int32 required_int32_46 = 46;
+ required int32 required_int32_47 = 47;
+ required int32 required_int32_48 = 48;
+ required int32 required_int32_49 = 49;
+ required int32 required_int32_50 = 50;
+ required int32 required_int32_51 = 51;
+ required int32 required_int32_52 = 52;
+ required int32 required_int32_53 = 53;
+ required int32 required_int32_54 = 54;
+ required int32 required_int32_55 = 55;
+ required int32 required_int32_56 = 56;
+ required int32 required_int32_57 = 57;
+ required int32 required_int32_58 = 58;
+ required int32 required_int32_59 = 59;
+ required int32 required_int32_60 = 60;
+ required int32 required_int32_61 = 61;
+ required int32 required_int32_62 = 62;
+}
+
+message TestMapField {
+ enum EnumMap {
+ ZERO = 0;
+ ONE = 1;
+ TWO = 2;
+ }
+ map<int32, EnumMap> map_field = 1;
+}
+
+message TestMapFieldExtra {
+ enum EnumMap {
+ ZERO = 0;
+ ONE = 1;
+ TWO = 2;
+ THREE = 3;
+ }
+ map<int32, EnumMap> map_field = 1;
+}
diff --git a/grpc/third_party/upb/upb/pb/compile_decoder.c b/grpc/third_party/upb/upb/pb/compile_decoder.c
deleted file mode 100644
index 3c73f1a9..00000000
--- a/grpc/third_party/upb/upb/pb/compile_decoder.c
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
-** protobuf decoder bytecode compiler
-**
-** Code to compile a upb::Handlers into bytecode for decoding a protobuf
-** according to that specific schema and destination handlers.
-**
-** Bytecode definition is in decoder.int.h.
-*/
-
-#include <stdarg.h>
-#include "upb/pb/decoder.int.h"
-#include "upb/pb/varint.int.h"
-
-#ifdef UPB_DUMP_BYTECODE
-#include <stdio.h>
-#endif
-
-#include "upb/port_def.inc"
-
-#define MAXLABEL 5
-#define EMPTYLABEL -1
-
-/* upb_pbdecodermethod ********************************************************/
-
-static void freemethod(upb_pbdecodermethod *method) {
- upb_inttable_uninit(&method->dispatch);
- upb_gfree(method);
-}
-
-static upb_pbdecodermethod *newmethod(const upb_handlers *dest_handlers,
- mgroup *group) {
- upb_pbdecodermethod *ret = upb_gmalloc(sizeof(*ret));
- upb_byteshandler_init(&ret->input_handler_);
-
- ret->group = group;
- ret->dest_handlers_ = dest_handlers;
- upb_inttable_init(&ret->dispatch, UPB_CTYPE_UINT64);
-
- return ret;
-}
-
-const upb_handlers *upb_pbdecodermethod_desthandlers(
- const upb_pbdecodermethod *m) {
- return m->dest_handlers_;
-}
-
-const upb_byteshandler *upb_pbdecodermethod_inputhandler(
- const upb_pbdecodermethod *m) {
- return &m->input_handler_;
-}
-
-bool upb_pbdecodermethod_isnative(const upb_pbdecodermethod *m) {
- return m->is_native_;
-}
-
-
-/* mgroup *********************************************************************/
-
-static void freegroup(mgroup *g) {
- upb_inttable_iter i;
-
- upb_inttable_begin(&i, &g->methods);
- for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
- freemethod(upb_value_getptr(upb_inttable_iter_value(&i)));
- }
-
- upb_inttable_uninit(&g->methods);
- upb_gfree(g->bytecode);
- upb_gfree(g);
-}
-
-mgroup *newgroup(void) {
- mgroup *g = upb_gmalloc(sizeof(*g));
- upb_inttable_init(&g->methods, UPB_CTYPE_PTR);
- g->bytecode = NULL;
- g->bytecode_end = NULL;
- return g;
-}
-
-
-/* bytecode compiler **********************************************************/
-
-/* Data used only at compilation time. */
-typedef struct {
- mgroup *group;
-
- uint32_t *pc;
- int fwd_labels[MAXLABEL];
- int back_labels[MAXLABEL];
-
- /* For fields marked "lazy", parse them lazily or eagerly? */
- bool lazy;
-} compiler;
-
-static compiler *newcompiler(mgroup *group, bool lazy) {
- compiler *ret = upb_gmalloc(sizeof(*ret));
- int i;
-
- ret->group = group;
- ret->lazy = lazy;
- for (i = 0; i < MAXLABEL; i++) {
- ret->fwd_labels[i] = EMPTYLABEL;
- ret->back_labels[i] = EMPTYLABEL;
- }
- return ret;
-}
-
-static void freecompiler(compiler *c) {
- upb_gfree(c);
-}
-
-const size_t ptr_words = sizeof(void*) / sizeof(uint32_t);
-
-/* How many words an instruction is. */
-static int instruction_len(uint32_t instr) {
- switch (getop(instr)) {
- case OP_SETDISPATCH: return 1 + ptr_words;
- case OP_TAGN: return 3;
- case OP_SETBIGGROUPNUM: return 2;
- default: return 1;
- }
-}
-
-bool op_has_longofs(int32_t instruction) {
- switch (getop(instruction)) {
- case OP_CALL:
- case OP_BRANCH:
- case OP_CHECKDELIM:
- return true;
- /* The "tag" instructions only have 8 bytes available for the jump target,
- * but that is ok because these opcodes only require short jumps. */
- case OP_TAG1:
- case OP_TAG2:
- case OP_TAGN:
- return false;
- default:
- UPB_ASSERT(false);
- return false;
- }
-}
-
-static int32_t getofs(uint32_t instruction) {
- if (op_has_longofs(instruction)) {
- return (int32_t)instruction >> 8;
- } else {
- return (int8_t)(instruction >> 8);
- }
-}
-
-static void setofs(uint32_t *instruction, int32_t ofs) {
- if (op_has_longofs(*instruction)) {
- *instruction = getop(*instruction) | (uint32_t)ofs << 8;
- } else {
- *instruction = (*instruction & ~0xff00) | ((ofs & 0xff) << 8);
- }
- UPB_ASSERT(getofs(*instruction) == ofs); /* Would fail in cases of overflow. */
-}
-
-static uint32_t pcofs(compiler *c) {
- return (uint32_t)(c->pc - c->group->bytecode);
-}
-
-/* Defines a local label at the current PC location. All previous forward
- * references are updated to point to this location. The location is noted
- * for any future backward references. */
-static void label(compiler *c, unsigned int label) {
- int val;
- uint32_t *codep;
-
- UPB_ASSERT(label < MAXLABEL);
- val = c->fwd_labels[label];
- codep = (val == EMPTYLABEL) ? NULL : c->group->bytecode + val;
- while (codep) {
- int ofs = getofs(*codep);
- setofs(codep, (int32_t)(c->pc - codep - instruction_len(*codep)));
- codep = ofs ? codep + ofs : NULL;
- }
- c->fwd_labels[label] = EMPTYLABEL;
- c->back_labels[label] = pcofs(c);
-}
-
-/* Creates a reference to a numbered label; either a forward reference
- * (positive arg) or backward reference (negative arg). For forward references
- * the value returned now is actually a "next" pointer into a linked list of all
- * instructions that use this label and will be patched later when the label is
- * defined with label().
- *
- * The returned value is the offset that should be written into the instruction.
- */
-static int32_t labelref(compiler *c, int label) {
- UPB_ASSERT(label < MAXLABEL);
- if (label == LABEL_DISPATCH) {
- /* No resolving required. */
- return 0;
- } else if (label < 0) {
- /* Backward local label. Relative to the next instruction. */
- uint32_t from = (uint32_t)((c->pc + 1) - c->group->bytecode);
- return c->back_labels[-label] - from;
- } else {
- /* Forward local label: prepend to (possibly-empty) linked list. */
- int *lptr = &c->fwd_labels[label];
- int32_t ret = (*lptr == EMPTYLABEL) ? 0 : *lptr - pcofs(c);
- *lptr = pcofs(c);
- return ret;
- }
-}
-
-static void put32(compiler *c, uint32_t v) {
- mgroup *g = c->group;
- if (c->pc == g->bytecode_end) {
- int ofs = pcofs(c);
- size_t oldsize = g->bytecode_end - g->bytecode;
- size_t newsize = UPB_MAX(oldsize * 2, 64);
- /* TODO(haberman): handle OOM. */
- g->bytecode = upb_grealloc(g->bytecode, oldsize * sizeof(uint32_t),
- newsize * sizeof(uint32_t));
- g->bytecode_end = g->bytecode + newsize;
- c->pc = g->bytecode + ofs;
- }
- *c->pc++ = v;
-}
-
-static void putop(compiler *c, int op, ...) {
- va_list ap;
- va_start(ap, op);
-
- switch (op) {
- case OP_SETDISPATCH: {
- uintptr_t ptr = (uintptr_t)va_arg(ap, void*);
- put32(c, OP_SETDISPATCH);
- put32(c, (uint32_t)ptr);
- if (sizeof(uintptr_t) > sizeof(uint32_t))
- put32(c, (uint64_t)ptr >> 32);
- break;
- }
- case OP_STARTMSG:
- case OP_ENDMSG:
- case OP_PUSHLENDELIM:
- case OP_POP:
- case OP_SETDELIM:
- case OP_HALT:
- case OP_RET:
- case OP_DISPATCH:
- put32(c, op);
- break;
- case OP_PARSE_DOUBLE:
- case OP_PARSE_FLOAT:
- case OP_PARSE_INT64:
- case OP_PARSE_UINT64:
- case OP_PARSE_INT32:
- case OP_PARSE_FIXED64:
- case OP_PARSE_FIXED32:
- case OP_PARSE_BOOL:
- case OP_PARSE_UINT32:
- case OP_PARSE_SFIXED32:
- case OP_PARSE_SFIXED64:
- case OP_PARSE_SINT32:
- case OP_PARSE_SINT64:
- case OP_STARTSEQ:
- case OP_ENDSEQ:
- case OP_STARTSUBMSG:
- case OP_ENDSUBMSG:
- case OP_STARTSTR:
- case OP_STRING:
- case OP_ENDSTR:
- case OP_PUSHTAGDELIM:
- put32(c, op | va_arg(ap, upb_selector_t) << 8);
- break;
- case OP_SETBIGGROUPNUM:
- put32(c, op);
- put32(c, va_arg(ap, int));
- break;
- case OP_CALL: {
- const upb_pbdecodermethod *method = va_arg(ap, upb_pbdecodermethod *);
- put32(c, op | (method->code_base.ofs - (pcofs(c) + 1)) << 8);
- break;
- }
- case OP_CHECKDELIM:
- case OP_BRANCH: {
- uint32_t instruction = op;
- int label = va_arg(ap, int);
- setofs(&instruction, labelref(c, label));
- put32(c, instruction);
- break;
- }
- case OP_TAG1:
- case OP_TAG2: {
- int label = va_arg(ap, int);
- uint64_t tag = va_arg(ap, uint64_t);
- uint32_t instruction = (uint32_t)(op | (tag << 16));
- UPB_ASSERT(tag <= 0xffff);
- setofs(&instruction, labelref(c, label));
- put32(c, instruction);
- break;
- }
- case OP_TAGN: {
- int label = va_arg(ap, int);
- uint64_t tag = va_arg(ap, uint64_t);
- uint32_t instruction = op | (upb_value_size(tag) << 16);
- setofs(&instruction, labelref(c, label));
- put32(c, instruction);
- put32(c, (uint32_t)tag);
- put32(c, tag >> 32);
- break;
- }
- }
-
- va_end(ap);
-}
-
-#if defined(UPB_DUMP_BYTECODE)
-
-const char *upb_pbdecoder_getopname(unsigned int op) {
-#define QUOTE(x) #x
-#define EXPAND_AND_QUOTE(x) QUOTE(x)
-#define OPNAME(x) OP_##x
-#define OP(x) case OPNAME(x): return EXPAND_AND_QUOTE(OPNAME(x));
-#define T(x) OP(PARSE_##x)
- /* Keep in sync with list in decoder.int.h. */
- switch ((opcode)op) {
- T(DOUBLE) T(FLOAT) T(INT64) T(UINT64) T(INT32) T(FIXED64) T(FIXED32)
- T(BOOL) T(UINT32) T(SFIXED32) T(SFIXED64) T(SINT32) T(SINT64)
- OP(STARTMSG) OP(ENDMSG) OP(STARTSEQ) OP(ENDSEQ) OP(STARTSUBMSG)
- OP(ENDSUBMSG) OP(STARTSTR) OP(STRING) OP(ENDSTR) OP(CALL) OP(RET)
- OP(PUSHLENDELIM) OP(PUSHTAGDELIM) OP(SETDELIM) OP(CHECKDELIM)
- OP(BRANCH) OP(TAG1) OP(TAG2) OP(TAGN) OP(SETDISPATCH) OP(POP)
- OP(SETBIGGROUPNUM) OP(DISPATCH) OP(HALT)
- }
- return "<unknown op>";
-#undef OP
-#undef T
-}
-
-#endif
-
-#ifdef UPB_DUMP_BYTECODE
-
-static void dumpbc(uint32_t *p, uint32_t *end, FILE *f) {
-
- uint32_t *begin = p;
-
- while (p < end) {
- fprintf(f, "%p %8tx", p, p - begin);
- uint32_t instr = *p++;
- uint8_t op = getop(instr);
- fprintf(f, " %s", upb_pbdecoder_getopname(op));
- switch ((opcode)op) {
- case OP_SETDISPATCH: {
- const upb_inttable *dispatch;
- memcpy(&dispatch, p, sizeof(void*));
- p += ptr_words;
- const upb_pbdecodermethod *method =
- (void *)((char *)dispatch -
- offsetof(upb_pbdecodermethod, dispatch));
- fprintf(f, " %s", upb_msgdef_fullname(
- upb_handlers_msgdef(method->dest_handlers_)));
- break;
- }
- case OP_DISPATCH:
- case OP_STARTMSG:
- case OP_ENDMSG:
- case OP_PUSHLENDELIM:
- case OP_POP:
- case OP_SETDELIM:
- case OP_HALT:
- case OP_RET:
- break;
- case OP_PARSE_DOUBLE:
- case OP_PARSE_FLOAT:
- case OP_PARSE_INT64:
- case OP_PARSE_UINT64:
- case OP_PARSE_INT32:
- case OP_PARSE_FIXED64:
- case OP_PARSE_FIXED32:
- case OP_PARSE_BOOL:
- case OP_PARSE_UINT32:
- case OP_PARSE_SFIXED32:
- case OP_PARSE_SFIXED64:
- case OP_PARSE_SINT32:
- case OP_PARSE_SINT64:
- case OP_STARTSEQ:
- case OP_ENDSEQ:
- case OP_STARTSUBMSG:
- case OP_ENDSUBMSG:
- case OP_STARTSTR:
- case OP_STRING:
- case OP_ENDSTR:
- case OP_PUSHTAGDELIM:
- fprintf(f, " %d", instr >> 8);
- break;
- case OP_SETBIGGROUPNUM:
- fprintf(f, " %d", *p++);
- break;
- case OP_CHECKDELIM:
- case OP_CALL:
- case OP_BRANCH:
- fprintf(f, " =>0x%tx", p + getofs(instr) - begin);
- break;
- case OP_TAG1:
- case OP_TAG2: {
- fprintf(f, " tag:0x%x", instr >> 16);
- if (getofs(instr)) {
- fprintf(f, " =>0x%tx", p + getofs(instr) - begin);
- }
- break;
- }
- case OP_TAGN: {
- uint64_t tag = *p++;
- tag |= (uint64_t)*p++ << 32;
- fprintf(f, " tag:0x%llx", (long long)tag);
- fprintf(f, " n:%d", instr >> 16);
- if (getofs(instr)) {
- fprintf(f, " =>0x%tx", p + getofs(instr) - begin);
- }
- break;
- }
- }
- fputs("\n", f);
- }
-}
-
-#endif
-
-static uint64_t get_encoded_tag(const upb_fielddef *f, int wire_type) {
- uint32_t tag = (upb_fielddef_number(f) << 3) | wire_type;
- uint64_t encoded_tag = upb_vencode32(tag);
- /* No tag should be greater than 5 bytes. */
- UPB_ASSERT(encoded_tag <= 0xffffffffff);
- return encoded_tag;
-}
-
-static void putchecktag(compiler *c, const upb_fielddef *f,
- int wire_type, int dest) {
- uint64_t tag = get_encoded_tag(f, wire_type);
- switch (upb_value_size(tag)) {
- case 1:
- putop(c, OP_TAG1, dest, tag);
- break;
- case 2:
- putop(c, OP_TAG2, dest, tag);
- break;
- default:
- putop(c, OP_TAGN, dest, tag);
- break;
- }
-}
-
-static upb_selector_t getsel(const upb_fielddef *f, upb_handlertype_t type) {
- upb_selector_t selector;
- bool ok = upb_handlers_getselector(f, type, &selector);
- UPB_ASSERT(ok);
- return selector;
-}
-
-/* Takes an existing, primary dispatch table entry and repacks it with a
- * different alternate wire type. Called when we are inserting a secondary
- * dispatch table entry for an alternate wire type. */
-static uint64_t repack(uint64_t dispatch, int new_wt2) {
- uint64_t ofs;
- uint8_t wt1;
- uint8_t old_wt2;
- upb_pbdecoder_unpackdispatch(dispatch, &ofs, &wt1, &old_wt2);
- UPB_ASSERT(old_wt2 == NO_WIRE_TYPE); /* wt2 should not be set yet. */
- return upb_pbdecoder_packdispatch(ofs, wt1, new_wt2);
-}
-
-/* Marks the current bytecode position as the dispatch target for this message,
- * field, and wire type. */
-static void dispatchtarget(compiler *c, upb_pbdecodermethod *method,
- const upb_fielddef *f, int wire_type) {
- /* Offset is relative to msg base. */
- uint64_t ofs = pcofs(c) - method->code_base.ofs;
- uint32_t fn = upb_fielddef_number(f);
- upb_inttable *d = &method->dispatch;
- upb_value v;
- if (upb_inttable_remove(d, fn, &v)) {
- /* TODO: prioritize based on packed setting in .proto file. */
- uint64_t repacked = repack(upb_value_getuint64(v), wire_type);
- upb_inttable_insert(d, fn, upb_value_uint64(repacked));
- upb_inttable_insert(d, fn + UPB_MAX_FIELDNUMBER, upb_value_uint64(ofs));
- } else {
- uint64_t val = upb_pbdecoder_packdispatch(ofs, wire_type, NO_WIRE_TYPE);
- upb_inttable_insert(d, fn, upb_value_uint64(val));
- }
-}
-
-static void putpush(compiler *c, const upb_fielddef *f) {
- if (upb_fielddef_descriptortype(f) == UPB_DESCRIPTOR_TYPE_MESSAGE) {
- putop(c, OP_PUSHLENDELIM);
- } else {
- uint32_t fn = upb_fielddef_number(f);
- if (fn >= 1 << 24) {
- putop(c, OP_PUSHTAGDELIM, 0);
- putop(c, OP_SETBIGGROUPNUM, fn);
- } else {
- putop(c, OP_PUSHTAGDELIM, fn);
- }
- }
-}
-
-static upb_pbdecodermethod *find_submethod(const compiler *c,
- const upb_pbdecodermethod *method,
- const upb_fielddef *f) {
- const upb_handlers *sub =
- upb_handlers_getsubhandlers(method->dest_handlers_, f);
- upb_value v;
- return upb_inttable_lookupptr(&c->group->methods, sub, &v)
- ? upb_value_getptr(v)
- : NULL;
-}
-
-static void putsel(compiler *c, opcode op, upb_selector_t sel,
- const upb_handlers *h) {
- if (upb_handlers_gethandler(h, sel, NULL)) {
- putop(c, op, sel);
- }
-}
-
-/* Puts an opcode to call a callback, but only if a callback actually exists for
- * this field and handler type. */
-static void maybeput(compiler *c, opcode op, const upb_handlers *h,
- const upb_fielddef *f, upb_handlertype_t type) {
- putsel(c, op, getsel(f, type), h);
-}
-
-static bool haslazyhandlers(const upb_handlers *h, const upb_fielddef *f) {
- if (!upb_fielddef_lazy(f))
- return false;
-
- return upb_handlers_gethandler(h, getsel(f, UPB_HANDLER_STARTSTR), NULL) ||
- upb_handlers_gethandler(h, getsel(f, UPB_HANDLER_STRING), NULL) ||
- upb_handlers_gethandler(h, getsel(f, UPB_HANDLER_ENDSTR), NULL);
-}
-
-
-/* bytecode compiler code generation ******************************************/
-
-/* Symbolic names for our local labels. */
-#define LABEL_LOOPSTART 1 /* Top of a repeated field loop. */
-#define LABEL_LOOPBREAK 2 /* To jump out of a repeated loop */
-#define LABEL_FIELD 3 /* Jump backward to find the most recent field. */
-#define LABEL_ENDMSG 4 /* To reach the OP_ENDMSG instr for this msg. */
-
-/* Generates bytecode to parse a single non-lazy message field. */
-static void generate_msgfield(compiler *c, const upb_fielddef *f,
- upb_pbdecodermethod *method) {
- const upb_handlers *h = upb_pbdecodermethod_desthandlers(method);
- const upb_pbdecodermethod *sub_m = find_submethod(c, method, f);
- int wire_type;
-
- if (!sub_m) {
- /* Don't emit any code for this field at all; it will be parsed as an
- * unknown field.
- *
- * TODO(haberman): we should change this to parse it as a string field
- * instead. It will probably be faster, but more importantly, once we
- * start vending unknown fields, a field shouldn't be treated as unknown
- * just because it doesn't have subhandlers registered. */
- return;
- }
-
- label(c, LABEL_FIELD);
-
- wire_type =
- (upb_fielddef_descriptortype(f) == UPB_DESCRIPTOR_TYPE_MESSAGE)
- ? UPB_WIRE_TYPE_DELIMITED
- : UPB_WIRE_TYPE_START_GROUP;
-
- if (upb_fielddef_isseq(f)) {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, wire_type, LABEL_DISPATCH);
- dispatchtarget(c, method, f, wire_type);
- putop(c, OP_PUSHTAGDELIM, 0);
- putop(c, OP_STARTSEQ, getsel(f, UPB_HANDLER_STARTSEQ));
- label(c, LABEL_LOOPSTART);
- putpush(c, f);
- putop(c, OP_STARTSUBMSG, getsel(f, UPB_HANDLER_STARTSUBMSG));
- putop(c, OP_CALL, sub_m);
- putop(c, OP_POP);
- maybeput(c, OP_ENDSUBMSG, h, f, UPB_HANDLER_ENDSUBMSG);
- if (wire_type == UPB_WIRE_TYPE_DELIMITED) {
- putop(c, OP_SETDELIM);
- }
- putop(c, OP_CHECKDELIM, LABEL_LOOPBREAK);
- putchecktag(c, f, wire_type, LABEL_LOOPBREAK);
- putop(c, OP_BRANCH, -LABEL_LOOPSTART);
- label(c, LABEL_LOOPBREAK);
- putop(c, OP_POP);
- maybeput(c, OP_ENDSEQ, h, f, UPB_HANDLER_ENDSEQ);
- } else {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, wire_type, LABEL_DISPATCH);
- dispatchtarget(c, method, f, wire_type);
- putpush(c, f);
- putop(c, OP_STARTSUBMSG, getsel(f, UPB_HANDLER_STARTSUBMSG));
- putop(c, OP_CALL, sub_m);
- putop(c, OP_POP);
- maybeput(c, OP_ENDSUBMSG, h, f, UPB_HANDLER_ENDSUBMSG);
- if (wire_type == UPB_WIRE_TYPE_DELIMITED) {
- putop(c, OP_SETDELIM);
- }
- }
-}
-
-/* Generates bytecode to parse a single string or lazy submessage field. */
-static void generate_delimfield(compiler *c, const upb_fielddef *f,
- upb_pbdecodermethod *method) {
- const upb_handlers *h = upb_pbdecodermethod_desthandlers(method);
-
- label(c, LABEL_FIELD);
- if (upb_fielddef_isseq(f)) {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, UPB_WIRE_TYPE_DELIMITED, LABEL_DISPATCH);
- dispatchtarget(c, method, f, UPB_WIRE_TYPE_DELIMITED);
- putop(c, OP_PUSHTAGDELIM, 0);
- putop(c, OP_STARTSEQ, getsel(f, UPB_HANDLER_STARTSEQ));
- label(c, LABEL_LOOPSTART);
- putop(c, OP_PUSHLENDELIM);
- putop(c, OP_STARTSTR, getsel(f, UPB_HANDLER_STARTSTR));
- /* Need to emit even if no handler to skip past the string. */
- putop(c, OP_STRING, getsel(f, UPB_HANDLER_STRING));
- maybeput(c, OP_ENDSTR, h, f, UPB_HANDLER_ENDSTR);
- putop(c, OP_POP);
- putop(c, OP_SETDELIM);
- putop(c, OP_CHECKDELIM, LABEL_LOOPBREAK);
- putchecktag(c, f, UPB_WIRE_TYPE_DELIMITED, LABEL_LOOPBREAK);
- putop(c, OP_BRANCH, -LABEL_LOOPSTART);
- label(c, LABEL_LOOPBREAK);
- putop(c, OP_POP);
- maybeput(c, OP_ENDSEQ, h, f, UPB_HANDLER_ENDSEQ);
- } else {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, UPB_WIRE_TYPE_DELIMITED, LABEL_DISPATCH);
- dispatchtarget(c, method, f, UPB_WIRE_TYPE_DELIMITED);
- putop(c, OP_PUSHLENDELIM);
- putop(c, OP_STARTSTR, getsel(f, UPB_HANDLER_STARTSTR));
- putop(c, OP_STRING, getsel(f, UPB_HANDLER_STRING));
- maybeput(c, OP_ENDSTR, h, f, UPB_HANDLER_ENDSTR);
- putop(c, OP_POP);
- putop(c, OP_SETDELIM);
- }
-}
-
-/* Generates bytecode to parse a single primitive field. */
-static void generate_primitivefield(compiler *c, const upb_fielddef *f,
- upb_pbdecodermethod *method) {
- const upb_handlers *h = upb_pbdecodermethod_desthandlers(method);
- upb_descriptortype_t descriptor_type = upb_fielddef_descriptortype(f);
- opcode parse_type;
- upb_selector_t sel;
- int wire_type;
-
- label(c, LABEL_FIELD);
-
- /* From a decoding perspective, ENUM is the same as INT32. */
- if (descriptor_type == UPB_DESCRIPTOR_TYPE_ENUM)
- descriptor_type = UPB_DESCRIPTOR_TYPE_INT32;
-
- parse_type = (opcode)descriptor_type;
-
- /* TODO(haberman): generate packed or non-packed first depending on "packed"
- * setting in the fielddef. This will favor (in speed) whichever was
- * specified. */
-
- UPB_ASSERT((int)parse_type >= 0 && parse_type <= OP_MAX);
- sel = getsel(f, upb_handlers_getprimitivehandlertype(f));
- wire_type = upb_pb_native_wire_types[upb_fielddef_descriptortype(f)];
- if (upb_fielddef_isseq(f)) {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, UPB_WIRE_TYPE_DELIMITED, LABEL_DISPATCH);
- dispatchtarget(c, method, f, UPB_WIRE_TYPE_DELIMITED);
- putop(c, OP_PUSHLENDELIM);
- putop(c, OP_STARTSEQ, getsel(f, UPB_HANDLER_STARTSEQ)); /* Packed */
- label(c, LABEL_LOOPSTART);
- putop(c, parse_type, sel);
- putop(c, OP_CHECKDELIM, LABEL_LOOPBREAK);
- putop(c, OP_BRANCH, -LABEL_LOOPSTART);
- dispatchtarget(c, method, f, wire_type);
- putop(c, OP_PUSHTAGDELIM, 0);
- putop(c, OP_STARTSEQ, getsel(f, UPB_HANDLER_STARTSEQ)); /* Non-packed */
- label(c, LABEL_LOOPSTART);
- putop(c, parse_type, sel);
- putop(c, OP_CHECKDELIM, LABEL_LOOPBREAK);
- putchecktag(c, f, wire_type, LABEL_LOOPBREAK);
- putop(c, OP_BRANCH, -LABEL_LOOPSTART);
- label(c, LABEL_LOOPBREAK);
- putop(c, OP_POP); /* Packed and non-packed join. */
- maybeput(c, OP_ENDSEQ, h, f, UPB_HANDLER_ENDSEQ);
- putop(c, OP_SETDELIM); /* Could remove for non-packed by dup ENDSEQ. */
- } else {
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- putchecktag(c, f, wire_type, LABEL_DISPATCH);
- dispatchtarget(c, method, f, wire_type);
- putop(c, parse_type, sel);
- }
-}
-
-/* Adds bytecode for parsing the given message to the given decoderplan,
- * while adding all dispatch targets to this message's dispatch table. */
-static void compile_method(compiler *c, upb_pbdecodermethod *method) {
- const upb_handlers *h;
- const upb_msgdef *md;
- uint32_t* start_pc;
- int i, n;
- upb_value val;
-
- UPB_ASSERT(method);
-
- /* Clear all entries in the dispatch table. */
- upb_inttable_uninit(&method->dispatch);
- upb_inttable_init(&method->dispatch, UPB_CTYPE_UINT64);
-
- h = upb_pbdecodermethod_desthandlers(method);
- md = upb_handlers_msgdef(h);
-
- method->code_base.ofs = pcofs(c);
- putop(c, OP_SETDISPATCH, &method->dispatch);
- putsel(c, OP_STARTMSG, UPB_STARTMSG_SELECTOR, h);
- label(c, LABEL_FIELD);
- start_pc = c->pc;
- n = upb_msgdef_fieldcount(md);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
- upb_fieldtype_t type = upb_fielddef_type(f);
-
- if (type == UPB_TYPE_MESSAGE && !(haslazyhandlers(h, f) && c->lazy)) {
- generate_msgfield(c, f, method);
- } else if (type == UPB_TYPE_STRING || type == UPB_TYPE_BYTES ||
- type == UPB_TYPE_MESSAGE) {
- generate_delimfield(c, f, method);
- } else {
- generate_primitivefield(c, f, method);
- }
- }
-
- /* If there were no fields, or if no handlers were defined, we need to
- * generate a non-empty loop body so that we can at least dispatch for unknown
- * fields and check for the end of the message. */
- if (c->pc == start_pc) {
- /* Check for end-of-message. */
- putop(c, OP_CHECKDELIM, LABEL_ENDMSG);
- /* Unconditionally dispatch. */
- putop(c, OP_DISPATCH, 0);
- }
-
- /* For now we just loop back to the last field of the message (or if none,
- * the DISPATCH opcode for the message). */
- putop(c, OP_BRANCH, -LABEL_FIELD);
-
- /* Insert both a label and a dispatch table entry for this end-of-msg. */
- label(c, LABEL_ENDMSG);
- val = upb_value_uint64(pcofs(c) - method->code_base.ofs);
- upb_inttable_insert(&method->dispatch, DISPATCH_ENDMSG, val);
-
- putsel(c, OP_ENDMSG, UPB_ENDMSG_SELECTOR, h);
- putop(c, OP_RET);
-
- upb_inttable_compact(&method->dispatch);
-}
-
-/* Populate "methods" with new upb_pbdecodermethod objects reachable from "h".
- * Returns the method for these handlers.
- *
- * Generates a new method for every destination handlers reachable from "h". */
-static void find_methods(compiler *c, const upb_handlers *h) {
- upb_value v;
- int i, n;
- const upb_msgdef *md;
- upb_pbdecodermethod *method;
-
- if (upb_inttable_lookupptr(&c->group->methods, h, &v))
- return;
-
- method = newmethod(h, c->group);
- upb_inttable_insertptr(&c->group->methods, h, upb_value_ptr(method));
-
- /* Find submethods. */
- md = upb_handlers_msgdef(h);
- n = upb_msgdef_fieldcount(md);
- for (i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(md, i);
- const upb_handlers *sub_h;
- if (upb_fielddef_type(f) == UPB_TYPE_MESSAGE &&
- (sub_h = upb_handlers_getsubhandlers(h, f)) != NULL) {
- /* We only generate a decoder method for submessages with handlers.
- * Others will be parsed as unknown fields. */
- find_methods(c, sub_h);
- }
- }
-}
-
-/* (Re-)compile bytecode for all messages in "msgs."
- * Overwrites any existing bytecode in "c". */
-static void compile_methods(compiler *c) {
- upb_inttable_iter i;
-
- /* Start over at the beginning of the bytecode. */
- c->pc = c->group->bytecode;
-
- upb_inttable_begin(&i, &c->group->methods);
- for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
- upb_pbdecodermethod *method = upb_value_getptr(upb_inttable_iter_value(&i));
- compile_method(c, method);
- }
-}
-
-static void set_bytecode_handlers(mgroup *g) {
- upb_inttable_iter i;
- upb_inttable_begin(&i, &g->methods);
- for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
- upb_pbdecodermethod *m = upb_value_getptr(upb_inttable_iter_value(&i));
- upb_byteshandler *h = &m->input_handler_;
-
- m->code_base.ptr = g->bytecode + m->code_base.ofs;
-
- upb_byteshandler_setstartstr(h, upb_pbdecoder_startbc, m->code_base.ptr);
- upb_byteshandler_setstring(h, upb_pbdecoder_decode, g);
- upb_byteshandler_setendstr(h, upb_pbdecoder_end, m);
- }
-}
-
-
-/* TODO(haberman): allow this to be constructed for an arbitrary set of dest
- * handlers and other mgroups (but verify we have a transitive closure). */
-const mgroup *mgroup_new(const upb_handlers *dest, bool lazy) {
- mgroup *g;
- compiler *c;
-
- g = newgroup();
- c = newcompiler(g, lazy);
- find_methods(c, dest);
-
- /* We compile in two passes:
- * 1. all messages are assigned relative offsets from the beginning of the
- * bytecode (saved in method->code_base).
- * 2. forwards OP_CALL instructions can be correctly linked since message
- * offsets have been previously assigned.
- *
- * Could avoid the second pass by linking OP_CALL instructions somehow. */
- compile_methods(c);
- compile_methods(c);
- g->bytecode_end = c->pc;
- freecompiler(c);
-
-#ifdef UPB_DUMP_BYTECODE
- {
- FILE *f = fopen("/tmp/upb-bytecode", "w");
- UPB_ASSERT(f);
- dumpbc(g->bytecode, g->bytecode_end, stderr);
- dumpbc(g->bytecode, g->bytecode_end, f);
- fclose(f);
-
- f = fopen("/tmp/upb-bytecode.bin", "wb");
- UPB_ASSERT(f);
- fwrite(g->bytecode, 1, g->bytecode_end - g->bytecode, f);
- fclose(f);
- }
-#endif
-
- set_bytecode_handlers(g);
- return g;
-}
-
-
-/* upb_pbcodecache ************************************************************/
-
-upb_pbcodecache *upb_pbcodecache_new(upb_handlercache *dest) {
- upb_pbcodecache *c = upb_gmalloc(sizeof(*c));
-
- if (!c) return NULL;
-
- c->dest = dest;
- c->lazy = false;
-
- c->arena = upb_arena_new();
- if (!upb_inttable_init(&c->groups, UPB_CTYPE_CONSTPTR)) return NULL;
-
- return c;
-}
-
-void upb_pbcodecache_free(upb_pbcodecache *c) {
- upb_inttable_iter i;
-
- upb_inttable_begin(&i, &c->groups);
- for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
- upb_value val = upb_inttable_iter_value(&i);
- freegroup((void*)upb_value_getconstptr(val));
- }
-
- upb_inttable_uninit(&c->groups);
- upb_arena_free(c->arena);
- upb_gfree(c);
-}
-
-void upb_pbdecodermethodopts_setlazy(upb_pbcodecache *c, bool lazy) {
- UPB_ASSERT(upb_inttable_count(&c->groups) == 0);
- c->lazy = lazy;
-}
-
-const upb_pbdecodermethod *upb_pbcodecache_get(upb_pbcodecache *c,
- const upb_msgdef *md) {
- upb_value v;
- bool ok;
- const upb_handlers *h;
- const mgroup *g;
-
- h = upb_handlercache_get(c->dest, md);
- if (upb_inttable_lookupptr(&c->groups, md, &v)) {
- g = upb_value_getconstptr(v);
- } else {
- g = mgroup_new(h, c->lazy);
- ok = upb_inttable_insertptr(&c->groups, md, upb_value_constptr(g));
- UPB_ASSUME(ok);
- }
-
- ok = upb_inttable_lookupptr(&g->methods, h, &v);
- UPB_ASSUME(ok);
- return upb_value_getptr(v);
-}
diff --git a/grpc/third_party/upb/upb/pb/decoder.c b/grpc/third_party/upb/upb/pb/decoder.c
deleted file mode 100644
index 4f40eed4..00000000
--- a/grpc/third_party/upb/upb/pb/decoder.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*
-** upb::Decoder (Bytecode Decoder VM)
-**
-** Bytecode must previously have been generated using the bytecode compiler in
-** compile_decoder.c. This decoder then walks through the bytecode op-by-op to
-** parse the input.
-**
-** Decoding is fully resumable; we just keep a pointer to the current bytecode
-** instruction and resume from there. A fair amount of the logic here is to
-** handle the fact that values can span buffer seams and we have to be able to
-** be capable of suspending/resuming from any byte in the stream. This
-** sometimes requires keeping a few trailing bytes from the last buffer around
-** in the "residual" buffer.
-*/
-
-#include <inttypes.h>
-#include <stddef.h>
-#include "upb/pb/decoder.int.h"
-#include "upb/pb/varint.int.h"
-
-#ifdef UPB_DUMP_BYTECODE
-#include <stdio.h>
-#endif
-
-#include "upb/port_def.inc"
-
-#define CHECK_SUSPEND(x) if (!(x)) return upb_pbdecoder_suspend(d);
-
-/* Error messages that are shared between the bytecode and JIT decoders. */
-const char *kPbDecoderStackOverflow = "Nesting too deep.";
-const char *kPbDecoderSubmessageTooLong =
- "Submessage end extends past enclosing submessage.";
-
-/* Error messages shared within this file. */
-static const char *kUnterminatedVarint = "Unterminated varint.";
-
-/* upb_pbdecoder **************************************************************/
-
-static opcode halt = OP_HALT;
-
-/* A dummy character we can point to when the user passes us a NULL buffer.
- * We need this because in C (NULL + 0) and (NULL - NULL) are undefined
- * behavior, which would invalidate functions like curbufleft(). */
-static const char dummy_char;
-
-/* Whether an op consumes any of the input buffer. */
-static bool consumes_input(opcode op) {
- switch (op) {
- case OP_SETDISPATCH:
- case OP_STARTMSG:
- case OP_ENDMSG:
- case OP_STARTSEQ:
- case OP_ENDSEQ:
- case OP_STARTSUBMSG:
- case OP_ENDSUBMSG:
- case OP_STARTSTR:
- case OP_ENDSTR:
- case OP_PUSHTAGDELIM:
- case OP_POP:
- case OP_SETDELIM:
- case OP_SETBIGGROUPNUM:
- case OP_CHECKDELIM:
- case OP_CALL:
- case OP_RET:
- case OP_BRANCH:
- return false;
- default:
- return true;
- }
-}
-
-static size_t stacksize(upb_pbdecoder *d, size_t entries) {
- UPB_UNUSED(d);
- return entries * sizeof(upb_pbdecoder_frame);
-}
-
-static size_t callstacksize(upb_pbdecoder *d, size_t entries) {
- UPB_UNUSED(d);
-
- return entries * sizeof(uint32_t*);
-}
-
-
-static bool in_residual_buf(const upb_pbdecoder *d, const char *p);
-
-/* It's unfortunate that we have to micro-manage the compiler with
- * UPB_FORCEINLINE and UPB_NOINLINE, especially since this tuning is necessarily
- * specific to one hardware configuration. But empirically on a Core i7,
- * performance increases 30-50% with these annotations. Every instance where
- * these appear, gcc 4.2.1 made the wrong decision and degraded performance in
- * benchmarks. */
-
-static void seterr(upb_pbdecoder *d, const char *msg) {
- upb_status_seterrmsg(d->status, msg);
-}
-
-void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg) {
- seterr(d, msg);
-}
-
-
-/* Buffering ******************************************************************/
-
-/* We operate on one buffer at a time, which is either the user's buffer passed
- * to our "decode" callback or some residual bytes from the previous buffer. */
-
-/* How many bytes can be safely read from d->ptr without reading past end-of-buf
- * or past the current delimited end. */
-static size_t curbufleft(const upb_pbdecoder *d) {
- UPB_ASSERT(d->data_end >= d->ptr);
- return d->data_end - d->ptr;
-}
-
-/* How many bytes are available before end-of-buffer. */
-static size_t bufleft(const upb_pbdecoder *d) {
- return d->end - d->ptr;
-}
-
-/* Overall stream offset of d->ptr. */
-uint64_t offset(const upb_pbdecoder *d) {
- return d->bufstart_ofs + (d->ptr - d->buf);
-}
-
-/* How many bytes are available before the end of this delimited region. */
-size_t delim_remaining(const upb_pbdecoder *d) {
- return d->top->end_ofs - offset(d);
-}
-
-/* Advances d->ptr. */
-static void advance(upb_pbdecoder *d, size_t len) {
- UPB_ASSERT(curbufleft(d) >= len);
- d->ptr += len;
-}
-
-static bool in_buf(const char *p, const char *buf, const char *end) {
- return p >= buf && p <= end;
-}
-
-static bool in_residual_buf(const upb_pbdecoder *d, const char *p) {
- return in_buf(p, d->residual, d->residual_end);
-}
-
-/* Calculates the delim_end value, which is affected by both the current buffer
- * and the parsing stack, so must be called whenever either is updated. */
-static void set_delim_end(upb_pbdecoder *d) {
- size_t delim_ofs = d->top->end_ofs - d->bufstart_ofs;
- if (delim_ofs <= (size_t)(d->end - d->buf)) {
- d->delim_end = d->buf + delim_ofs;
- d->data_end = d->delim_end;
- } else {
- d->data_end = d->end;
- d->delim_end = NULL;
- }
-}
-
-static void switchtobuf(upb_pbdecoder *d, const char *buf, const char *end) {
- d->ptr = buf;
- d->buf = buf;
- d->end = end;
- set_delim_end(d);
-}
-
-static void advancetobuf(upb_pbdecoder *d, const char *buf, size_t len) {
- UPB_ASSERT(curbufleft(d) == 0);
- d->bufstart_ofs += (d->end - d->buf);
- switchtobuf(d, buf, buf + len);
-}
-
-static void checkpoint(upb_pbdecoder *d) {
- /* The assertion here is in the interests of efficiency, not correctness.
- * We are trying to ensure that we don't checkpoint() more often than
- * necessary. */
- UPB_ASSERT(d->checkpoint != d->ptr);
- d->checkpoint = d->ptr;
-}
-
-/* Skips "bytes" bytes in the stream, which may be more than available. If we
- * skip more bytes than are available, we return a long read count to the caller
- * indicating how many bytes can be skipped over before passing actual data
- * again. Skipped bytes can pass a NULL buffer and the decoder guarantees they
- * won't actually be read.
- */
-static int32_t skip(upb_pbdecoder *d, size_t bytes) {
- UPB_ASSERT(!in_residual_buf(d, d->ptr) || d->size_param == 0);
- UPB_ASSERT(d->skip == 0);
- if (bytes > delim_remaining(d)) {
- seterr(d, "Skipped value extended beyond enclosing submessage.");
- return (int32_t)upb_pbdecoder_suspend(d);
- } else if (bufleft(d) >= bytes) {
- /* Skipped data is all in current buffer, and more is still available. */
- advance(d, bytes);
- d->skip = 0;
- return DECODE_OK;
- } else {
- /* Skipped data extends beyond currently available buffers. */
- d->pc = d->last;
- d->skip = bytes - curbufleft(d);
- d->bufstart_ofs += (d->end - d->buf);
- d->residual_end = d->residual;
- switchtobuf(d, d->residual, d->residual_end);
- return (int32_t)(d->size_param + d->skip);
- }
-}
-
-
-/* Resumes the decoder from an initial state or from a previous suspend. */
-int32_t upb_pbdecoder_resume(upb_pbdecoder *d, void *p, const char *buf,
- size_t size, const upb_bufhandle *handle) {
- UPB_UNUSED(p); /* Useless; just for the benefit of the JIT. */
-
- /* d->skip and d->residual_end could probably elegantly be represented
- * as a single variable, to more easily represent this invariant. */
- UPB_ASSERT(!(d->skip && d->residual_end > d->residual));
-
- /* We need to remember the original size_param, so that the value we return
- * is relative to it, even if we do some skipping first. */
- d->size_param = size;
- d->handle = handle;
-
- /* Have to handle this case specially (ie. not with skip()) because the user
- * is allowed to pass a NULL buffer here, which won't allow us to safely
- * calculate a d->end or use our normal functions like curbufleft(). */
- if (d->skip && d->skip >= size) {
- d->skip -= size;
- d->bufstart_ofs += size;
- buf = &dummy_char;
- size = 0;
-
- /* We can't just return now, because we might need to execute some ops
- * like CHECKDELIM, which could call some callbacks and pop the stack. */
- }
-
- /* We need to pretend that this was the actual buffer param, since some of the
- * calculations assume that d->ptr/d->buf is relative to this. */
- d->buf_param = buf;
-
- if (!buf) {
- /* NULL buf is ok if its entire span is covered by the "skip" above, but
- * by this point we know that "skip" doesn't cover the buffer. */
- seterr(d, "Passed NULL buffer over non-skippable region.");
- return (int32_t)upb_pbdecoder_suspend(d);
- }
-
- if (d->residual_end > d->residual) {
- /* We have residual bytes from the last buffer. */
- UPB_ASSERT(d->ptr == d->residual);
- } else {
- switchtobuf(d, buf, buf + size);
- }
-
- d->checkpoint = d->ptr;
-
- /* Handle skips that don't cover the whole buffer (as above). */
- if (d->skip) {
- size_t skip_bytes = d->skip;
- d->skip = 0;
- CHECK_RETURN(skip(d, skip_bytes));
- checkpoint(d);
- }
-
- /* If we're inside an unknown group, continue to parse unknown values. */
- if (d->top->groupnum < 0) {
- CHECK_RETURN(upb_pbdecoder_skipunknown(d, -1, 0));
- checkpoint(d);
- }
-
- return DECODE_OK;
-}
-
-/* Suspends the decoder at the last checkpoint, without saving any residual
- * bytes. If there are any unconsumed bytes, returns a short byte count. */
-size_t upb_pbdecoder_suspend(upb_pbdecoder *d) {
- d->pc = d->last;
- if (d->checkpoint == d->residual) {
- /* Checkpoint was in residual buf; no user bytes were consumed. */
- d->ptr = d->residual;
- return 0;
- } else {
- size_t ret = d->size_param - (d->end - d->checkpoint);
- UPB_ASSERT(!in_residual_buf(d, d->checkpoint));
- UPB_ASSERT(d->buf == d->buf_param || d->buf == &dummy_char);
-
- d->bufstart_ofs += (d->checkpoint - d->buf);
- d->residual_end = d->residual;
- switchtobuf(d, d->residual, d->residual_end);
- return ret;
- }
-}
-
-/* Suspends the decoder at the last checkpoint, and saves any unconsumed
- * bytes in our residual buffer. This is necessary if we need more user
- * bytes to form a complete value, which might not be contiguous in the
- * user's buffers. Always consumes all user bytes. */
-static size_t suspend_save(upb_pbdecoder *d) {
- /* We hit end-of-buffer before we could parse a full value.
- * Save any unconsumed bytes (if any) to the residual buffer. */
- d->pc = d->last;
-
- if (d->checkpoint == d->residual) {
- /* Checkpoint was in residual buf; append user byte(s) to residual buf. */
- UPB_ASSERT((d->residual_end - d->residual) + d->size_param <=
- sizeof(d->residual));
- if (!in_residual_buf(d, d->ptr)) {
- d->bufstart_ofs -= (d->residual_end - d->residual);
- }
- memcpy(d->residual_end, d->buf_param, d->size_param);
- d->residual_end += d->size_param;
- } else {
- /* Checkpoint was in user buf; old residual bytes not needed. */
- size_t save;
- UPB_ASSERT(!in_residual_buf(d, d->checkpoint));
-
- d->ptr = d->checkpoint;
- save = curbufleft(d);
- UPB_ASSERT(save <= sizeof(d->residual));
- memcpy(d->residual, d->ptr, save);
- d->residual_end = d->residual + save;
- d->bufstart_ofs = offset(d);
- }
-
- switchtobuf(d, d->residual, d->residual_end);
- return d->size_param;
-}
-
-/* Copies the next "bytes" bytes into "buf" and advances the stream.
- * Requires that this many bytes are available in the current buffer. */
-UPB_FORCEINLINE static void consumebytes(upb_pbdecoder *d, void *buf,
- size_t bytes) {
- UPB_ASSERT(bytes <= curbufleft(d));
- memcpy(buf, d->ptr, bytes);
- advance(d, bytes);
-}
-
-/* Slow path for getting the next "bytes" bytes, regardless of whether they are
- * available in the current buffer or not. Returns a status code as described
- * in decoder.int.h. */
-UPB_NOINLINE static int32_t getbytes_slow(upb_pbdecoder *d, void *buf,
- size_t bytes) {
- const size_t avail = curbufleft(d);
- consumebytes(d, buf, avail);
- bytes -= avail;
- UPB_ASSERT(bytes > 0);
- if (in_residual_buf(d, d->ptr)) {
- advancetobuf(d, d->buf_param, d->size_param);
- }
- if (curbufleft(d) >= bytes) {
- consumebytes(d, (char *)buf + avail, bytes);
- return DECODE_OK;
- } else if (d->data_end == d->delim_end) {
- seterr(d, "Submessage ended in the middle of a value or group");
- return (int32_t)upb_pbdecoder_suspend(d);
- } else {
- return (int32_t)suspend_save(d);
- }
-}
-
-/* Gets the next "bytes" bytes, regardless of whether they are available in the
- * current buffer or not. Returns a status code as described in decoder.int.h.
- */
-UPB_FORCEINLINE static int32_t getbytes(upb_pbdecoder *d, void *buf,
- size_t bytes) {
- if (curbufleft(d) >= bytes) {
- /* Buffer has enough data to satisfy. */
- consumebytes(d, buf, bytes);
- return DECODE_OK;
- } else {
- return getbytes_slow(d, buf, bytes);
- }
-}
-
-UPB_NOINLINE static size_t peekbytes_slow(upb_pbdecoder *d, void *buf,
- size_t bytes) {
- size_t ret = curbufleft(d);
- memcpy(buf, d->ptr, ret);
- if (in_residual_buf(d, d->ptr)) {
- size_t copy = UPB_MIN(bytes - ret, d->size_param);
- memcpy((char *)buf + ret, d->buf_param, copy);
- ret += copy;
- }
- return ret;
-}
-
-UPB_FORCEINLINE static size_t peekbytes(upb_pbdecoder *d, void *buf,
- size_t bytes) {
- if (curbufleft(d) >= bytes) {
- memcpy(buf, d->ptr, bytes);
- return bytes;
- } else {
- return peekbytes_slow(d, buf, bytes);
- }
-}
-
-
-/* Decoding of wire types *****************************************************/
-
-/* Slow path for decoding a varint from the current buffer position.
- * Returns a status code as described in decoder.int.h. */
-UPB_NOINLINE int32_t upb_pbdecoder_decode_varint_slow(upb_pbdecoder *d,
- uint64_t *u64) {
- uint8_t byte = 0x80;
- int bitpos;
- *u64 = 0;
- for(bitpos = 0; bitpos < 70 && (byte & 0x80); bitpos += 7) {
- CHECK_RETURN(getbytes(d, &byte, 1));
- *u64 |= (uint64_t)(byte & 0x7F) << bitpos;
- }
- if(bitpos == 70 && (byte & 0x80)) {
- seterr(d, kUnterminatedVarint);
- return (int32_t)upb_pbdecoder_suspend(d);
- }
- return DECODE_OK;
-}
-
-/* Decodes a varint from the current buffer position.
- * Returns a status code as described in decoder.int.h. */
-UPB_FORCEINLINE static int32_t decode_varint(upb_pbdecoder *d, uint64_t *u64) {
- if (curbufleft(d) > 0 && !(*d->ptr & 0x80)) {
- *u64 = *d->ptr;
- advance(d, 1);
- return DECODE_OK;
- } else if (curbufleft(d) >= 10) {
- /* Fast case. */
- upb_decoderet r = upb_vdecode_fast(d->ptr);
- if (r.p == NULL) {
- seterr(d, kUnterminatedVarint);
- return (int32_t)upb_pbdecoder_suspend(d);
- }
- advance(d, r.p - d->ptr);
- *u64 = r.val;
- return DECODE_OK;
- } else {
- /* Slow case -- varint spans buffer seam. */
- return upb_pbdecoder_decode_varint_slow(d, u64);
- }
-}
-
-/* Decodes a 32-bit varint from the current buffer position.
- * Returns a status code as described in decoder.int.h. */
-UPB_FORCEINLINE static int32_t decode_v32(upb_pbdecoder *d, uint32_t *u32) {
- uint64_t u64;
- int32_t ret = decode_varint(d, &u64);
- if (ret >= 0) return ret;
- if (u64 > UINT32_MAX) {
- seterr(d, "Unterminated 32-bit varint");
- /* TODO(haberman) guarantee that this function return is >= 0 somehow,
- * so we know this path will always be treated as error by our caller.
- * Right now the size_t -> int32_t can overflow and produce negative values.
- */
- *u32 = 0;
- return (int32_t)upb_pbdecoder_suspend(d);
- }
- *u32 = (uint32_t)u64;
- return DECODE_OK;
-}
-
-/* Decodes a fixed32 from the current buffer position.
- * Returns a status code as described in decoder.int.h.
- * TODO: proper byte swapping for big-endian machines. */
-UPB_FORCEINLINE static int32_t decode_fixed32(upb_pbdecoder *d, uint32_t *u32) {
- return getbytes(d, u32, 4);
-}
-
-/* Decodes a fixed64 from the current buffer position.
- * Returns a status code as described in decoder.int.h.
- * TODO: proper byte swapping for big-endian machines. */
-UPB_FORCEINLINE static int32_t decode_fixed64(upb_pbdecoder *d, uint64_t *u64) {
- return getbytes(d, u64, 8);
-}
-
-/* Non-static versions of the above functions.
- * These are called by the JIT for fallback paths. */
-int32_t upb_pbdecoder_decode_f32(upb_pbdecoder *d, uint32_t *u32) {
- return decode_fixed32(d, u32);
-}
-
-int32_t upb_pbdecoder_decode_f64(upb_pbdecoder *d, uint64_t *u64) {
- return decode_fixed64(d, u64);
-}
-
-static double as_double(uint64_t n) { double d; memcpy(&d, &n, 8); return d; }
-static float as_float(uint32_t n) { float f; memcpy(&f, &n, 4); return f; }
-
-/* Pushes a frame onto the decoder stack. */
-static bool decoder_push(upb_pbdecoder *d, uint64_t end) {
- upb_pbdecoder_frame *fr = d->top;
-
- if (end > fr->end_ofs) {
- seterr(d, kPbDecoderSubmessageTooLong);
- return false;
- } else if (fr == d->limit) {
- seterr(d, kPbDecoderStackOverflow);
- return false;
- }
-
- fr++;
- fr->end_ofs = end;
- fr->dispatch = NULL;
- fr->groupnum = 0;
- d->top = fr;
- return true;
-}
-
-static bool pushtagdelim(upb_pbdecoder *d, uint32_t arg) {
- /* While we expect to see an "end" tag (either ENDGROUP or a non-sequence
- * field number) prior to hitting any enclosing submessage end, pushing our
- * existing delim end prevents us from continuing to parse values from a
- * corrupt proto that doesn't give us an END tag in time. */
- if (!decoder_push(d, d->top->end_ofs))
- return false;
- d->top->groupnum = arg;
- return true;
-}
-
-/* Pops a frame from the decoder stack. */
-static void decoder_pop(upb_pbdecoder *d) { d->top--; }
-
-UPB_NOINLINE int32_t upb_pbdecoder_checktag_slow(upb_pbdecoder *d,
- uint64_t expected) {
- uint64_t data = 0;
- size_t bytes = upb_value_size(expected);
- size_t read = peekbytes(d, &data, bytes);
- if (read == bytes && data == expected) {
- /* Advance past matched bytes. */
- int32_t ok = getbytes(d, &data, read);
- UPB_ASSERT(ok < 0);
- return DECODE_OK;
- } else if (read < bytes && memcmp(&data, &expected, read) == 0) {
- return (int32_t)suspend_save(d);
- } else {
- return DECODE_MISMATCH;
- }
-}
-
-int32_t upb_pbdecoder_skipunknown(upb_pbdecoder *d, int32_t fieldnum,
- uint8_t wire_type) {
- if (fieldnum >= 0)
- goto have_tag;
-
- while (true) {
- uint32_t tag;
- CHECK_RETURN(decode_v32(d, &tag));
- wire_type = tag & 0x7;
- fieldnum = tag >> 3;
-
-have_tag:
- if (fieldnum == 0) {
- seterr(d, "Saw invalid field number (0)");
- return (int32_t)upb_pbdecoder_suspend(d);
- }
-
- switch (wire_type) {
- case UPB_WIRE_TYPE_32BIT:
- CHECK_RETURN(skip(d, 4));
- break;
- case UPB_WIRE_TYPE_64BIT:
- CHECK_RETURN(skip(d, 8));
- break;
- case UPB_WIRE_TYPE_VARINT: {
- uint64_t u64;
- CHECK_RETURN(decode_varint(d, &u64));
- break;
- }
- case UPB_WIRE_TYPE_DELIMITED: {
- uint32_t len;
- CHECK_RETURN(decode_v32(d, &len));
- CHECK_RETURN(skip(d, len));
- break;
- }
- case UPB_WIRE_TYPE_START_GROUP:
- if (!pushtagdelim(d, -fieldnum)) {
- return (int32_t)upb_pbdecoder_suspend(d);
- }
- break;
- case UPB_WIRE_TYPE_END_GROUP:
- if (fieldnum == -d->top->groupnum) {
- decoder_pop(d);
- } else if (fieldnum == d->top->groupnum) {
- return DECODE_ENDGROUP;
- } else {
- seterr(d, "Unmatched ENDGROUP tag.");
- return (int32_t)upb_pbdecoder_suspend(d);
- }
- break;
- default:
- seterr(d, "Invalid wire type");
- return (int32_t)upb_pbdecoder_suspend(d);
- }
-
- if (d->top->groupnum >= 0) {
- /* TODO: More code needed for handling unknown groups. */
- upb_sink_putunknown(d->top->sink, d->checkpoint, d->ptr - d->checkpoint);
- return DECODE_OK;
- }
-
- /* Unknown group -- continue looping over unknown fields. */
- checkpoint(d);
- }
-}
-
-static void goto_endmsg(upb_pbdecoder *d) {
- upb_value v;
- bool found = upb_inttable_lookup32(d->top->dispatch, DISPATCH_ENDMSG, &v);
- UPB_ASSERT(found);
- d->pc = d->top->base + upb_value_getuint64(v);
-}
-
-/* Parses a tag and jumps to the corresponding bytecode instruction for this
- * field.
- *
- * If the tag is unknown (or the wire type doesn't match), parses the field as
- * unknown. If the tag is a valid ENDGROUP tag, jumps to the bytecode
- * instruction for the end of message. */
-static int32_t dispatch(upb_pbdecoder *d) {
- upb_inttable *dispatch = d->top->dispatch;
- uint32_t tag;
- uint8_t wire_type;
- uint32_t fieldnum;
- upb_value val;
- int32_t retval;
-
- /* Decode tag. */
- CHECK_RETURN(decode_v32(d, &tag));
- wire_type = tag & 0x7;
- fieldnum = tag >> 3;
-
- /* Lookup tag. Because of packed/non-packed compatibility, we have to
- * check the wire type against two possibilities. */
- if (fieldnum != DISPATCH_ENDMSG &&
- upb_inttable_lookup32(dispatch, fieldnum, &val)) {
- uint64_t v = upb_value_getuint64(val);
- if (wire_type == (v & 0xff)) {
- d->pc = d->top->base + (v >> 16);
- return DECODE_OK;
- } else if (wire_type == ((v >> 8) & 0xff)) {
- bool found =
- upb_inttable_lookup(dispatch, fieldnum + UPB_MAX_FIELDNUMBER, &val);
- UPB_ASSERT(found);
- d->pc = d->top->base + upb_value_getuint64(val);
- return DECODE_OK;
- }
- }
-
- /* We have some unknown fields (or ENDGROUP) to parse. The DISPATCH or TAG
- * bytecode that triggered this is preceded by a CHECKDELIM bytecode which
- * we need to back up to, so that when we're done skipping unknown data we
- * can re-check the delimited end. */
- d->last--; /* Necessary if we get suspended */
- d->pc = d->last;
- UPB_ASSERT(getop(*d->last) == OP_CHECKDELIM);
-
- /* Unknown field or ENDGROUP. */
- retval = upb_pbdecoder_skipunknown(d, fieldnum, wire_type);
-
- CHECK_RETURN(retval);
-
- if (retval == DECODE_ENDGROUP) {
- goto_endmsg(d);
- return DECODE_OK;
- }
-
- return DECODE_OK;
-}
-
-/* Callers know that the stack is more than one deep because the opcodes that
- * call this only occur after PUSH operations. */
-upb_pbdecoder_frame *outer_frame(upb_pbdecoder *d) {
- UPB_ASSERT(d->top != d->stack);
- return d->top - 1;
-}
-
-
-/* The main decoding loop *****************************************************/
-
-/* The main decoder VM function. Uses traditional bytecode dispatch loop with a
- * switch() statement. */
-size_t run_decoder_vm(upb_pbdecoder *d, const mgroup *group,
- const upb_bufhandle* handle) {
-
-#define VMCASE(op, code) \
- case op: { code; if (consumes_input(op)) checkpoint(d); break; }
-#define PRIMITIVE_OP(type, wt, name, convfunc, ctype) \
- VMCASE(OP_PARSE_ ## type, { \
- ctype val; \
- CHECK_RETURN(decode_ ## wt(d, &val)); \
- upb_sink_put ## name(d->top->sink, arg, (convfunc)(val)); \
- })
-
- while(1) {
- int32_t instruction;
- opcode op;
- uint32_t arg;
- int32_t longofs;
-
- d->last = d->pc;
- instruction = *d->pc++;
- op = getop(instruction);
- arg = instruction >> 8;
- longofs = arg;
- UPB_ASSERT(d->ptr != d->residual_end);
- UPB_UNUSED(group);
-#ifdef UPB_DUMP_BYTECODE
- fprintf(stderr, "s_ofs=%d buf_ofs=%d data_rem=%d buf_rem=%d delim_rem=%d "
- "%x %s (%d)\n",
- (int)offset(d),
- (int)(d->ptr - d->buf),
- (int)(d->data_end - d->ptr),
- (int)(d->end - d->ptr),
- (int)((d->top->end_ofs - d->bufstart_ofs) - (d->ptr - d->buf)),
- (int)(d->pc - 1 - group->bytecode),
- upb_pbdecoder_getopname(op),
- arg);
-#endif
- switch (op) {
- /* Technically, we are losing data if we see a 32-bit varint that is not
- * properly sign-extended. We could detect this and error about the data
- * loss, but proto2 does not do this, so we pass. */
- PRIMITIVE_OP(INT32, varint, int32, int32_t, uint64_t)
- PRIMITIVE_OP(INT64, varint, int64, int64_t, uint64_t)
- PRIMITIVE_OP(UINT32, varint, uint32, uint32_t, uint64_t)
- PRIMITIVE_OP(UINT64, varint, uint64, uint64_t, uint64_t)
- PRIMITIVE_OP(FIXED32, fixed32, uint32, uint32_t, uint32_t)
- PRIMITIVE_OP(FIXED64, fixed64, uint64, uint64_t, uint64_t)
- PRIMITIVE_OP(SFIXED32, fixed32, int32, int32_t, uint32_t)
- PRIMITIVE_OP(SFIXED64, fixed64, int64, int64_t, uint64_t)
- PRIMITIVE_OP(BOOL, varint, bool, bool, uint64_t)
- PRIMITIVE_OP(DOUBLE, fixed64, double, as_double, uint64_t)
- PRIMITIVE_OP(FLOAT, fixed32, float, as_float, uint32_t)
- PRIMITIVE_OP(SINT32, varint, int32, upb_zzdec_32, uint64_t)
- PRIMITIVE_OP(SINT64, varint, int64, upb_zzdec_64, uint64_t)
-
- VMCASE(OP_SETDISPATCH,
- d->top->base = d->pc - 1;
- memcpy(&d->top->dispatch, d->pc, sizeof(void*));
- d->pc += sizeof(void*) / sizeof(uint32_t);
- )
- VMCASE(OP_STARTMSG,
- CHECK_SUSPEND(upb_sink_startmsg(d->top->sink));
- )
- VMCASE(OP_ENDMSG,
- CHECK_SUSPEND(upb_sink_endmsg(d->top->sink, d->status));
- )
- VMCASE(OP_STARTSEQ,
- upb_pbdecoder_frame *outer = outer_frame(d);
- CHECK_SUSPEND(upb_sink_startseq(outer->sink, arg, &d->top->sink));
- )
- VMCASE(OP_ENDSEQ,
- CHECK_SUSPEND(upb_sink_endseq(d->top->sink, arg));
- )
- VMCASE(OP_STARTSUBMSG,
- upb_pbdecoder_frame *outer = outer_frame(d);
- CHECK_SUSPEND(upb_sink_startsubmsg(outer->sink, arg, &d->top->sink));
- )
- VMCASE(OP_ENDSUBMSG,
- upb_sink subsink = (d->top + 1)->sink;
- CHECK_SUSPEND(upb_sink_endsubmsg(d->top->sink, subsink, arg));
- )
- VMCASE(OP_STARTSTR,
- uint32_t len = (uint32_t)delim_remaining(d);
- upb_pbdecoder_frame *outer = outer_frame(d);
- CHECK_SUSPEND(upb_sink_startstr(outer->sink, arg, len, &d->top->sink));
- if (len == 0) {
- d->pc++; /* Skip OP_STRING. */
- }
- )
- VMCASE(OP_STRING,
- uint32_t len = (uint32_t)curbufleft(d);
- size_t n = upb_sink_putstring(d->top->sink, arg, d->ptr, len, handle);
- if (n > len) {
- if (n > delim_remaining(d)) {
- seterr(d, "Tried to skip past end of string.");
- return upb_pbdecoder_suspend(d);
- } else {
- int32_t ret = skip(d, n);
- /* This shouldn't return DECODE_OK, because n > len. */
- UPB_ASSERT(ret >= 0);
- return ret;
- }
- }
- advance(d, n);
- if (n < len || d->delim_end == NULL) {
- /* We aren't finished with this string yet. */
- d->pc--; /* Repeat OP_STRING. */
- if (n > 0) checkpoint(d);
- return upb_pbdecoder_suspend(d);
- }
- )
- VMCASE(OP_ENDSTR,
- CHECK_SUSPEND(upb_sink_endstr(d->top->sink, arg));
- )
- VMCASE(OP_PUSHTAGDELIM,
- CHECK_SUSPEND(pushtagdelim(d, arg));
- )
- VMCASE(OP_SETBIGGROUPNUM,
- d->top->groupnum = *d->pc++;
- )
- VMCASE(OP_POP,
- UPB_ASSERT(d->top > d->stack);
- decoder_pop(d);
- )
- VMCASE(OP_PUSHLENDELIM,
- uint32_t len;
- CHECK_RETURN(decode_v32(d, &len));
- CHECK_SUSPEND(decoder_push(d, offset(d) + len));
- set_delim_end(d);
- )
- VMCASE(OP_SETDELIM,
- set_delim_end(d);
- )
- VMCASE(OP_CHECKDELIM,
- /* We are guaranteed of this assert because we never allow ourselves to
- * consume bytes beyond data_end, which covers delim_end when non-NULL.
- */
- UPB_ASSERT(!(d->delim_end && d->ptr > d->delim_end));
- if (d->ptr == d->delim_end)
- d->pc += longofs;
- )
- VMCASE(OP_CALL,
- d->callstack[d->call_len++] = d->pc;
- d->pc += longofs;
- )
- VMCASE(OP_RET,
- UPB_ASSERT(d->call_len > 0);
- d->pc = d->callstack[--d->call_len];
- )
- VMCASE(OP_BRANCH,
- d->pc += longofs;
- )
- VMCASE(OP_TAG1,
- uint8_t expected;
- CHECK_SUSPEND(curbufleft(d) > 0);
- expected = (arg >> 8) & 0xff;
- if (*d->ptr == expected) {
- advance(d, 1);
- } else {
- int8_t shortofs;
- badtag:
- shortofs = arg;
- if (shortofs == LABEL_DISPATCH) {
- CHECK_RETURN(dispatch(d));
- } else {
- d->pc += shortofs;
- break; /* Avoid checkpoint(). */
- }
- }
- )
- VMCASE(OP_TAG2,
- uint16_t expected;
- CHECK_SUSPEND(curbufleft(d) > 0);
- expected = (arg >> 8) & 0xffff;
- if (curbufleft(d) >= 2) {
- uint16_t actual;
- memcpy(&actual, d->ptr, 2);
- if (expected == actual) {
- advance(d, 2);
- } else {
- goto badtag;
- }
- } else {
- int32_t result = upb_pbdecoder_checktag_slow(d, expected);
- if (result == DECODE_MISMATCH) goto badtag;
- if (result >= 0) return result;
- }
- )
- VMCASE(OP_TAGN, {
- uint64_t expected;
- int32_t result;
- memcpy(&expected, d->pc, 8);
- d->pc += 2;
- result = upb_pbdecoder_checktag_slow(d, expected);
- if (result == DECODE_MISMATCH) goto badtag;
- if (result >= 0) return result;
- })
- VMCASE(OP_DISPATCH, {
- CHECK_RETURN(dispatch(d));
- })
- VMCASE(OP_HALT, {
- return d->size_param;
- })
- }
- }
-}
-
-
-/* BytesHandler handlers ******************************************************/
-
-void *upb_pbdecoder_startbc(void *closure, const void *pc, size_t size_hint) {
- upb_pbdecoder *d = closure;
- UPB_UNUSED(size_hint);
- d->top->end_ofs = UINT64_MAX;
- d->bufstart_ofs = 0;
- d->call_len = 1;
- d->callstack[0] = &halt;
- d->pc = pc;
- d->skip = 0;
- return d;
-}
-
-bool upb_pbdecoder_end(void *closure, const void *handler_data) {
- upb_pbdecoder *d = closure;
- const upb_pbdecodermethod *method = handler_data;
- uint64_t end;
- char dummy;
-
- if (d->residual_end > d->residual) {
- seterr(d, "Unexpected EOF: decoder still has buffered unparsed data");
- return false;
- }
-
- if (d->skip) {
- seterr(d, "Unexpected EOF inside skipped data");
- return false;
- }
-
- if (d->top->end_ofs != UINT64_MAX) {
- seterr(d, "Unexpected EOF inside delimited string");
- return false;
- }
-
- /* The user's end() call indicates that the message ends here. */
- end = offset(d);
- d->top->end_ofs = end;
-
- {
- const uint32_t *p = d->pc;
- d->stack->end_ofs = end;
- /* Check the previous bytecode, but guard against beginning. */
- if (p != method->code_base.ptr) p--;
- if (getop(*p) == OP_CHECKDELIM) {
- /* Rewind from OP_TAG* to OP_CHECKDELIM. */
- UPB_ASSERT(getop(*d->pc) == OP_TAG1 ||
- getop(*d->pc) == OP_TAG2 ||
- getop(*d->pc) == OP_TAGN ||
- getop(*d->pc) == OP_DISPATCH);
- d->pc = p;
- }
- upb_pbdecoder_decode(closure, handler_data, &dummy, 0, NULL);
- }
-
- if (d->call_len != 0) {
- seterr(d, "Unexpected EOF inside submessage or group");
- return false;
- }
-
- return true;
-}
-
-size_t upb_pbdecoder_decode(void *decoder, const void *group, const char *buf,
- size_t size, const upb_bufhandle *handle) {
- int32_t result = upb_pbdecoder_resume(decoder, NULL, buf, size, handle);
-
- if (result == DECODE_ENDGROUP) goto_endmsg(decoder);
- CHECK_RETURN(result);
-
- return run_decoder_vm(decoder, group, handle);
-}
-
-
-/* Public API *****************************************************************/
-
-void upb_pbdecoder_reset(upb_pbdecoder *d) {
- d->top = d->stack;
- d->top->groupnum = 0;
- d->ptr = d->residual;
- d->buf = d->residual;
- d->end = d->residual;
- d->residual_end = d->residual;
-}
-
-upb_pbdecoder *upb_pbdecoder_create(upb_arena *a, const upb_pbdecodermethod *m,
- upb_sink sink, upb_status *status) {
- const size_t default_max_nesting = 64;
-
- upb_pbdecoder *d = upb_arena_malloc(a, sizeof(upb_pbdecoder));
- if (!d) return NULL;
-
- d->method_ = m;
- d->callstack = upb_arena_malloc(a, callstacksize(d, default_max_nesting));
- d->stack = upb_arena_malloc(a, stacksize(d, default_max_nesting));
- if (!d->stack || !d->callstack) {
- return NULL;
- }
-
- d->arena = a;
- d->limit = d->stack + default_max_nesting - 1;
- d->stack_size = default_max_nesting;
- d->status = status;
-
- upb_pbdecoder_reset(d);
- upb_bytessink_reset(&d->input_, &m->input_handler_, d);
-
- if (d->method_->dest_handlers_) {
- if (sink.handlers != d->method_->dest_handlers_)
- return NULL;
- }
- d->top->sink = sink;
-
- return d;
-}
-
-uint64_t upb_pbdecoder_bytesparsed(const upb_pbdecoder *d) {
- return offset(d);
-}
-
-const upb_pbdecodermethod *upb_pbdecoder_method(const upb_pbdecoder *d) {
- return d->method_;
-}
-
-upb_bytessink upb_pbdecoder_input(upb_pbdecoder *d) {
- return d->input_;
-}
-
-size_t upb_pbdecoder_maxnesting(const upb_pbdecoder *d) {
- return d->stack_size;
-}
-
-bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max) {
- UPB_ASSERT(d->top >= d->stack);
-
- if (max < (size_t)(d->top - d->stack)) {
- /* Can't set a limit smaller than what we are currently at. */
- return false;
- }
-
- if (max > d->stack_size) {
- /* Need to reallocate stack and callstack to accommodate. */
- size_t old_size = stacksize(d, d->stack_size);
- size_t new_size = stacksize(d, max);
- void *p = upb_arena_realloc(d->arena, d->stack, old_size, new_size);
- if (!p) {
- return false;
- }
- d->stack = p;
-
- old_size = callstacksize(d, d->stack_size);
- new_size = callstacksize(d, max);
- p = upb_arena_realloc(d->arena, d->callstack, old_size, new_size);
- if (!p) {
- return false;
- }
- d->callstack = p;
-
- d->stack_size = max;
- }
-
- d->limit = d->stack + max - 1;
- return true;
-}
diff --git a/grpc/third_party/upb/upb/pb/decoder.h b/grpc/third_party/upb/upb/pb/decoder.h
deleted file mode 100644
index 8c4d8bf5..00000000
--- a/grpc/third_party/upb/upb/pb/decoder.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-** upb::pb::Decoder
-**
-** A high performance, streaming, resumable decoder for the binary protobuf
-** format.
-**
-** This interface works the same regardless of what decoder backend is being
-** used. A client of this class does not need to know whether decoding is using
-** a JITted decoder (DynASM, LLVM, etc) or an interpreted decoder. By default,
-** it will always use the fastest available decoder. However, you can call
-** set_allow_jit(false) to disable any JIT decoder that might be available.
-** This is primarily useful for testing purposes.
-*/
-
-#ifndef UPB_DECODER_H_
-#define UPB_DECODER_H_
-
-#include "upb/sink.h"
-
-#ifdef __cplusplus
-namespace upb {
-namespace pb {
-class CodeCache;
-class DecoderPtr;
-class DecoderMethodPtr;
-class DecoderMethodOptions;
-} /* namespace pb */
-} /* namespace upb */
-#endif
-
-/* The maximum number of bytes we are required to buffer internally between
- * calls to the decoder. The value is 14: a 5 byte unknown tag plus ten-byte
- * varint, less one because we are buffering an incomplete value.
- *
- * Should only be used by unit tests. */
-#define UPB_DECODER_MAX_RESIDUAL_BYTES 14
-
-/* upb_pbdecodermethod ********************************************************/
-
-struct upb_pbdecodermethod;
-typedef struct upb_pbdecodermethod upb_pbdecodermethod;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-const upb_handlers *upb_pbdecodermethod_desthandlers(
- const upb_pbdecodermethod *m);
-const upb_byteshandler *upb_pbdecodermethod_inputhandler(
- const upb_pbdecodermethod *m);
-bool upb_pbdecodermethod_isnative(const upb_pbdecodermethod *m);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* Represents the code to parse a protobuf according to a destination
- * Handlers. */
-class upb::pb::DecoderMethodPtr {
- public:
- DecoderMethodPtr() : ptr_(nullptr) {}
- DecoderMethodPtr(const upb_pbdecodermethod* ptr) : ptr_(ptr) {}
-
- const upb_pbdecodermethod* ptr() { return ptr_; }
-
- /* The destination handlers that are statically bound to this method.
- * This method is only capable of outputting to a sink that uses these
- * handlers. */
- const Handlers *dest_handlers() const {
- return upb_pbdecodermethod_desthandlers(ptr_);
- }
-
- /* The input handlers for this decoder method. */
- const BytesHandler* input_handler() const {
- return upb_pbdecodermethod_inputhandler(ptr_);
- }
-
- /* Whether this method is native. */
- bool is_native() const {
- return upb_pbdecodermethod_isnative(ptr_);
- }
-
- private:
- const upb_pbdecodermethod* ptr_;
-};
-
-#endif
-
-/* upb_pbdecoder **************************************************************/
-
-/* Preallocation hint: decoder won't allocate more bytes than this when first
- * constructed. This hint may be an overestimate for some build configurations.
- * But if the decoder library is upgraded without recompiling the application,
- * it may be an underestimate. */
-#define UPB_PB_DECODER_SIZE 4416
-
-struct upb_pbdecoder;
-typedef struct upb_pbdecoder upb_pbdecoder;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-upb_pbdecoder *upb_pbdecoder_create(upb_arena *arena,
- const upb_pbdecodermethod *method,
- upb_sink output, upb_status *status);
-const upb_pbdecodermethod *upb_pbdecoder_method(const upb_pbdecoder *d);
-upb_bytessink upb_pbdecoder_input(upb_pbdecoder *d);
-uint64_t upb_pbdecoder_bytesparsed(const upb_pbdecoder *d);
-size_t upb_pbdecoder_maxnesting(const upb_pbdecoder *d);
-bool upb_pbdecoder_setmaxnesting(upb_pbdecoder *d, size_t max);
-void upb_pbdecoder_reset(upb_pbdecoder *d);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* A Decoder receives binary protobuf data on its input sink and pushes the
- * decoded data to its output sink. */
-class upb::pb::DecoderPtr {
- public:
- DecoderPtr() : ptr_(nullptr) {}
- DecoderPtr(upb_pbdecoder* ptr) : ptr_(ptr) {}
-
- upb_pbdecoder* ptr() { return ptr_; }
-
- /* Constructs a decoder instance for the given method, which must outlive this
- * decoder. Any errors during parsing will be set on the given status, which
- * must also outlive this decoder.
- *
- * The sink must match the given method. */
- static DecoderPtr Create(Arena *arena, DecoderMethodPtr method,
- upb::Sink output, Status *status) {
- return DecoderPtr(upb_pbdecoder_create(arena->ptr(), method.ptr(),
- output.sink(), status->ptr()));
- }
-
- /* Returns the DecoderMethod this decoder is parsing from. */
- const DecoderMethodPtr method() const {
- return DecoderMethodPtr(upb_pbdecoder_method(ptr_));
- }
-
- /* The sink on which this decoder receives input. */
- BytesSink input() { return BytesSink(upb_pbdecoder_input(ptr())); }
-
- /* Returns number of bytes successfully parsed.
- *
- * This can be useful for determining the stream position where an error
- * occurred.
- *
- * This value may not be up-to-date when called from inside a parsing
- * callback. */
- uint64_t BytesParsed() { return upb_pbdecoder_bytesparsed(ptr()); }
-
- /* Gets/sets the parsing nexting limit. If the total number of nested
- * submessages and repeated fields hits this limit, parsing will fail. This
- * is a resource limit that controls the amount of memory used by the parsing
- * stack.
- *
- * Setting the limit will fail if the parser is currently suspended at a depth
- * greater than this, or if memory allocation of the stack fails. */
- size_t max_nesting() { return upb_pbdecoder_maxnesting(ptr()); }
- bool set_max_nesting(size_t max) {
- return upb_pbdecoder_setmaxnesting(ptr(), max);
- }
-
- void Reset() { upb_pbdecoder_reset(ptr()); }
-
- static const size_t kSize = UPB_PB_DECODER_SIZE;
-
- private:
- upb_pbdecoder *ptr_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_pbcodecache ************************************************************/
-
-/* Lazily builds and caches decoder methods that will push data to the given
- * handlers. The destination handlercache must outlive this object. */
-
-struct upb_pbcodecache;
-typedef struct upb_pbcodecache upb_pbcodecache;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-upb_pbcodecache *upb_pbcodecache_new(upb_handlercache *dest);
-void upb_pbcodecache_free(upb_pbcodecache *c);
-bool upb_pbcodecache_allowjit(const upb_pbcodecache *c);
-void upb_pbcodecache_setallowjit(upb_pbcodecache *c, bool allow);
-void upb_pbcodecache_setlazy(upb_pbcodecache *c, bool lazy);
-const upb_pbdecodermethod *upb_pbcodecache_get(upb_pbcodecache *c,
- const upb_msgdef *md);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* A class for caching protobuf processing code, whether bytecode for the
- * interpreted decoder or machine code for the JIT.
- *
- * This class is not thread-safe. */
-class upb::pb::CodeCache {
- public:
- CodeCache(upb::HandlerCache *dest)
- : ptr_(upb_pbcodecache_new(dest->ptr()), upb_pbcodecache_free) {}
- CodeCache(CodeCache&&) = default;
- CodeCache& operator=(CodeCache&&) = default;
-
- upb_pbcodecache* ptr() { return ptr_.get(); }
- const upb_pbcodecache* ptr() const { return ptr_.get(); }
-
- /* Whether the cache is allowed to generate machine code. Defaults to true.
- * There is no real reason to turn it off except for testing or if you are
- * having a specific problem with the JIT.
- *
- * Note that allow_jit = true does not *guarantee* that the code will be JIT
- * compiled. If this platform is not supported or the JIT was not compiled
- * in, the code may still be interpreted. */
- bool allow_jit() const { return upb_pbcodecache_allowjit(ptr()); }
-
- /* This may only be called when the object is first constructed, and prior to
- * any code generation. */
- void set_allow_jit(bool allow) { upb_pbcodecache_setallowjit(ptr(), allow); }
-
- /* Should the decoder push submessages to lazy handlers for fields that have
- * them? The caller should set this iff the lazy handlers expect data that is
- * in protobuf binary format and the caller wishes to lazy parse it. */
- void set_lazy(bool lazy) { upb_pbcodecache_setlazy(ptr(), lazy); }
-
- /* Returns a DecoderMethod that can push data to the given handlers.
- * If a suitable method already exists, it will be returned from the cache. */
- const DecoderMethodPtr Get(MessageDefPtr md) {
- return DecoderMethodPtr(upb_pbcodecache_get(ptr(), md.ptr()));
- }
-
- private:
- std::unique_ptr<upb_pbcodecache, decltype(&upb_pbcodecache_free)> ptr_;
-};
-
-#endif /* __cplusplus */
-
-#endif /* UPB_DECODER_H_ */
diff --git a/grpc/third_party/upb/upb/pb/decoder.int.h b/grpc/third_party/upb/upb/pb/decoder.int.h
deleted file mode 100644
index 9d5f5839..00000000
--- a/grpc/third_party/upb/upb/pb/decoder.int.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-** Internal-only definitions for the decoder.
-*/
-
-#ifndef UPB_DECODER_INT_H_
-#define UPB_DECODER_INT_H_
-
-#include "upb/def.h"
-#include "upb/handlers.h"
-#include "upb/pb/decoder.h"
-#include "upb/sink.h"
-#include "upb/table.int.h"
-
-#include "upb/port_def.inc"
-
-/* Opcode definitions. The canonical meaning of each opcode is its
- * implementation in the interpreter (the JIT is written to match this).
- *
- * All instructions have the opcode in the low byte.
- * Instruction format for most instructions is:
- *
- * +-------------------+--------+
- * | arg (24) | op (8) |
- * +-------------------+--------+
- *
- * Exceptions are indicated below. A few opcodes are multi-word. */
-typedef enum {
- /* Opcodes 1-8, 13, 15-18 parse their respective descriptor types.
- * Arg for all of these is the upb selector for this field. */
-#define T(type) OP_PARSE_ ## type = UPB_DESCRIPTOR_TYPE_ ## type
- T(DOUBLE), T(FLOAT), T(INT64), T(UINT64), T(INT32), T(FIXED64), T(FIXED32),
- T(BOOL), T(UINT32), T(SFIXED32), T(SFIXED64), T(SINT32), T(SINT64),
-#undef T
- OP_STARTMSG = 9, /* No arg. */
- OP_ENDMSG = 10, /* No arg. */
- OP_STARTSEQ = 11,
- OP_ENDSEQ = 12,
- OP_STARTSUBMSG = 14,
- OP_ENDSUBMSG = 19,
- OP_STARTSTR = 20,
- OP_STRING = 21,
- OP_ENDSTR = 22,
-
- OP_PUSHTAGDELIM = 23, /* No arg. */
- OP_PUSHLENDELIM = 24, /* No arg. */
- OP_POP = 25, /* No arg. */
- OP_SETDELIM = 26, /* No arg. */
- OP_SETBIGGROUPNUM = 27, /* two words:
- * | unused (24) | opc (8) |
- * | groupnum (32) | */
- OP_CHECKDELIM = 28,
- OP_CALL = 29,
- OP_RET = 30,
- OP_BRANCH = 31,
-
- /* Different opcodes depending on how many bytes expected. */
- OP_TAG1 = 32, /* | match tag (16) | jump target (8) | opc (8) | */
- OP_TAG2 = 33, /* | match tag (16) | jump target (8) | opc (8) | */
- OP_TAGN = 34, /* three words: */
- /* | unused (16) | jump target(8) | opc (8) | */
- /* | match tag 1 (32) | */
- /* | match tag 2 (32) | */
-
- OP_SETDISPATCH = 35, /* N words: */
- /* | unused (24) | opc | */
- /* | upb_inttable* (32 or 64) | */
-
- OP_DISPATCH = 36, /* No arg. */
-
- OP_HALT = 37 /* No arg. */
-} opcode;
-
-#define OP_MAX OP_HALT
-
-UPB_INLINE opcode getop(uint32_t instr) { return (opcode)(instr & 0xff); }
-
-struct upb_pbcodecache {
- upb_arena *arena;
- upb_handlercache *dest;
- bool allow_jit;
- bool lazy;
-
- /* Map of upb_msgdef -> mgroup. */
- upb_inttable groups;
-};
-
-/* Method group; represents a set of decoder methods that had their code
- * emitted together. Immutable once created. */
-typedef struct {
- /* Maps upb_msgdef/upb_handlers -> upb_pbdecodermethod. Owned by us.
- *
- * Ideally this would be on pbcodecache (if we were actually caching code).
- * Right now we don't actually cache anything, which is wasteful. */
- upb_inttable methods;
-
- /* The bytecode for our methods, if any exists. Owned by us. */
- uint32_t *bytecode;
- uint32_t *bytecode_end;
-} mgroup;
-
-/* The maximum that any submessages can be nested. Matches proto2's limit.
- * This specifies the size of the decoder's statically-sized array and therefore
- * setting it high will cause the upb::pb::Decoder object to be larger.
- *
- * If necessary we can add a runtime-settable property to Decoder that allow
- * this to be larger than the compile-time setting, but this would add
- * complexity, particularly since we would have to decide how/if to give users
- * the ability to set a custom memory allocation function. */
-#define UPB_DECODER_MAX_NESTING 64
-
-/* Internal-only struct used by the decoder. */
-typedef struct {
- /* Space optimization note: we store two pointers here that the JIT
- * doesn't need at all; the upb_handlers* inside the sink and
- * the dispatch table pointer. We can optimze so that the JIT uses
- * smaller stack frames than the interpreter. The only thing we need
- * to guarantee is that the fallback routines can find end_ofs. */
- upb_sink sink;
-
- /* The absolute stream offset of the end-of-frame delimiter.
- * Non-delimited frames (groups and non-packed repeated fields) reuse the
- * delimiter of their parent, even though the frame may not end there.
- *
- * NOTE: the JIT stores a slightly different value here for non-top frames.
- * It stores the value relative to the end of the enclosed message. But the
- * top frame is still stored the same way, which is important for ensuring
- * that calls from the JIT into C work correctly. */
- uint64_t end_ofs;
- const uint32_t *base;
-
- /* 0 indicates a length-delimited field.
- * A positive number indicates a known group.
- * A negative number indicates an unknown group. */
- int32_t groupnum;
- upb_inttable *dispatch; /* Not used by the JIT. */
-} upb_pbdecoder_frame;
-
-struct upb_pbdecodermethod {
- /* While compiling, the base is relative in "ofs", after compiling it is
- * absolute in "ptr". */
- union {
- uint32_t ofs; /* PC offset of method. */
- void *ptr; /* Pointer to bytecode or machine code for this method. */
- } code_base;
-
- /* The decoder method group to which this method belongs. */
- const mgroup *group;
-
- /* Whether this method is native code or bytecode. */
- bool is_native_;
-
- /* The handler one calls to invoke this method. */
- upb_byteshandler input_handler_;
-
- /* The destination handlers this method is bound to. We own a ref. */
- const upb_handlers *dest_handlers_;
-
- /* Dispatch table -- used by both bytecode decoder and JIT when encountering a
- * field number that wasn't the one we were expecting to see. See
- * decoder.int.h for the layout of this table. */
- upb_inttable dispatch;
-};
-
-struct upb_pbdecoder {
- upb_arena *arena;
-
- /* Our input sink. */
- upb_bytessink input_;
-
- /* The decoder method we are parsing with (owned). */
- const upb_pbdecodermethod *method_;
-
- size_t call_len;
- const uint32_t *pc, *last;
-
- /* Current input buffer and its stream offset. */
- const char *buf, *ptr, *end, *checkpoint;
-
- /* End of the delimited region, relative to ptr, NULL if not in this buf. */
- const char *delim_end;
-
- /* End of the delimited region, relative to ptr, end if not in this buf. */
- const char *data_end;
-
- /* Overall stream offset of "buf." */
- uint64_t bufstart_ofs;
-
- /* Buffer for residual bytes not parsed from the previous buffer. */
- char residual[UPB_DECODER_MAX_RESIDUAL_BYTES];
- char *residual_end;
-
- /* Bytes of data that should be discarded from the input beore we start
- * parsing again. We set this when we internally determine that we can
- * safely skip the next N bytes, but this region extends past the current
- * user buffer. */
- size_t skip;
-
- /* Stores the user buffer passed to our decode function. */
- const char *buf_param;
- size_t size_param;
- const upb_bufhandle *handle;
-
- /* Our internal stack. */
- upb_pbdecoder_frame *stack, *top, *limit;
- const uint32_t **callstack;
- size_t stack_size;
-
- upb_status *status;
-};
-
-/* Decoder entry points; used as handlers. */
-void *upb_pbdecoder_startbc(void *closure, const void *pc, size_t size_hint);
-size_t upb_pbdecoder_decode(void *closure, const void *hd, const char *buf,
- size_t size, const upb_bufhandle *handle);
-bool upb_pbdecoder_end(void *closure, const void *handler_data);
-
-/* Decoder-internal functions that the JIT calls to handle fallback paths. */
-int32_t upb_pbdecoder_resume(upb_pbdecoder *d, void *p, const char *buf,
- size_t size, const upb_bufhandle *handle);
-size_t upb_pbdecoder_suspend(upb_pbdecoder *d);
-int32_t upb_pbdecoder_skipunknown(upb_pbdecoder *d, int32_t fieldnum,
- uint8_t wire_type);
-int32_t upb_pbdecoder_checktag_slow(upb_pbdecoder *d, uint64_t expected);
-int32_t upb_pbdecoder_decode_varint_slow(upb_pbdecoder *d, uint64_t *u64);
-int32_t upb_pbdecoder_decode_f32(upb_pbdecoder *d, uint32_t *u32);
-int32_t upb_pbdecoder_decode_f64(upb_pbdecoder *d, uint64_t *u64);
-void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg);
-
-/* Error messages that are shared between the bytecode and JIT decoders. */
-extern const char *kPbDecoderStackOverflow;
-extern const char *kPbDecoderSubmessageTooLong;
-
-/* Access to decoderplan members needed by the decoder. */
-const char *upb_pbdecoder_getopname(unsigned int op);
-
-/* A special label that means "do field dispatch for this message and branch to
- * wherever that takes you." */
-#define LABEL_DISPATCH 0
-
-/* A special slot in the dispatch table that stores the epilogue (ENDMSG and/or
- * RET) for branching to when we find an appropriate ENDGROUP tag. */
-#define DISPATCH_ENDMSG 0
-
-/* It's important to use this invalid wire type instead of 0 (which is a valid
- * wire type). */
-#define NO_WIRE_TYPE 0xff
-
-/* The dispatch table layout is:
- * [field number] -> [ 48-bit offset ][ 8-bit wt2 ][ 8-bit wt1 ]
- *
- * If wt1 matches, jump to the 48-bit offset. If wt2 matches, lookup
- * (UPB_MAX_FIELDNUMBER + fieldnum) and jump there.
- *
- * We need two wire types because of packed/non-packed compatibility. A
- * primitive repeated field can use either wire type and be valid. While we
- * could key the table on fieldnum+wiretype, the table would be 8x sparser.
- *
- * Storing two wire types in the primary value allows us to quickly rule out
- * the second wire type without needing to do a separate lookup (this case is
- * less common than an unknown field). */
-UPB_INLINE uint64_t upb_pbdecoder_packdispatch(uint64_t ofs, uint8_t wt1,
- uint8_t wt2) {
- return (ofs << 16) | (wt2 << 8) | wt1;
-}
-
-UPB_INLINE void upb_pbdecoder_unpackdispatch(uint64_t dispatch, uint64_t *ofs,
- uint8_t *wt1, uint8_t *wt2) {
- *wt1 = (uint8_t)dispatch;
- *wt2 = (uint8_t)(dispatch >> 8);
- *ofs = dispatch >> 16;
-}
-
-/* All of the functions in decoder.c that return int32_t return values according
- * to the following scheme:
- * 1. negative values indicate a return code from the following list.
- * 2. positive values indicate that error or end of buffer was hit, and
- * that the decode function should immediately return the given value
- * (the decoder state has already been suspended and is ready to be
- * resumed). */
-#define DECODE_OK -1
-#define DECODE_MISMATCH -2 /* Used only from checktag_slow(). */
-#define DECODE_ENDGROUP -3 /* Used only from checkunknown(). */
-
-#define CHECK_RETURN(x) { int32_t ret = x; if (ret >= 0) return ret; }
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_DECODER_INT_H_ */
diff --git a/grpc/third_party/upb/upb/pb/encoder.c b/grpc/third_party/upb/upb/pb/encoder.c
deleted file mode 100644
index 0c47b0de..00000000
--- a/grpc/third_party/upb/upb/pb/encoder.c
+++ /dev/null
@@ -1,563 +0,0 @@
-/*
-** upb::Encoder
-**
-** Since we are implementing pure handlers (ie. without any out-of-band access
-** to pre-computed lengths), we have to buffer all submessages before we can
-** emit even their first byte.
-**
-** Not knowing the size of submessages also means we can't write a perfect
-** zero-copy implementation, even with buffering. Lengths are stored as
-** varints, which means that we don't know how many bytes to reserve for the
-** length until we know what the length is.
-**
-** This leaves us with three main choices:
-**
-** 1. buffer all submessage data in a temporary buffer, then copy it exactly
-** once into the output buffer.
-**
-** 2. attempt to buffer data directly into the output buffer, estimating how
-** many bytes each length will take. When our guesses are wrong, use
-** memmove() to grow or shrink the allotted space.
-**
-** 3. buffer directly into the output buffer, allocating a max length
-** ahead-of-time for each submessage length. If we overallocated, we waste
-** space, but no memcpy() or memmove() is required. This approach requires
-** defining a maximum size for submessages and rejecting submessages that
-** exceed that size.
-**
-** (2) and (3) have the potential to have better performance, but they are more
-** complicated and subtle to implement:
-**
-** (3) requires making an arbitrary choice of the maximum message size; it
-** wastes space when submessages are shorter than this and fails
-** completely when they are longer. This makes it more finicky and
-** requires configuration based on the input. It also makes it impossible
-** to perfectly match the output of reference encoders that always use the
-** optimal amount of space for each length.
-**
-** (2) requires guessing the the size upfront, and if multiple lengths are
-** guessed wrong the minimum required number of memmove() operations may
-** be complicated to compute correctly. Implemented properly, it may have
-** a useful amortized or average cost, but more investigation is required
-** to determine this and what the optimal algorithm is to achieve it.
-**
-** (1) makes you always pay for exactly one copy, but its implementation is
-** the simplest and its performance is predictable.
-**
-** So for now, we implement (1) only. If we wish to optimize later, we should
-** be able to do it without affecting users.
-**
-** The strategy is to buffer the segments of data that do *not* depend on
-** unknown lengths in one buffer, and keep a separate buffer of segment pointers
-** and lengths. When the top-level submessage ends, we can go beginning to end,
-** alternating the writing of lengths with memcpy() of the rest of the data.
-** At the top level though, no buffering is required.
-*/
-
-#include "upb/pb/encoder.h"
-#include "upb/pb/varint.int.h"
-
-#include "upb/port_def.inc"
-
-/* The output buffer is divided into segments; a segment is a string of data
- * that is "ready to go" -- it does not need any varint lengths inserted into
- * the middle. The seams between segments are where varints will be inserted
- * once they are known.
- *
- * We also use the concept of a "run", which is a range of encoded bytes that
- * occur at a single submessage level. Every segment contains one or more runs.
- *
- * A segment can span messages. Consider:
- *
- * .--Submessage lengths---------.
- * | | |
- * | V V
- * V | |--------------- | |-----------------
- * Submessages: | |-----------------------------------------------
- * Top-level msg: ------------------------------------------------------------
- *
- * Segments: ----- ------------------- -----------------
- * Runs: *---- *--------------*--- *----------------
- * (* marks the start)
- *
- * Note that the top-level menssage is not in any segment because it does not
- * have any length preceding it.
- *
- * A segment is only interrupted when another length needs to be inserted. So
- * observe how the second segment spans both the inner submessage and part of
- * the next enclosing message. */
-typedef struct {
- uint32_t msglen; /* The length to varint-encode before this segment. */
- uint32_t seglen; /* Length of the segment. */
-} upb_pb_encoder_segment;
-
-struct upb_pb_encoder {
- upb_arena *arena;
-
- /* Our input and output. */
- upb_sink input_;
- upb_bytessink output_;
-
- /* The "subclosure" -- used as the inner closure as part of the bytessink
- * protocol. */
- void *subc;
-
- /* The output buffer and limit, and our current write position. "buf"
- * initially points to "initbuf", but is dynamically allocated if we need to
- * grow beyond the initial size. */
- char *buf, *ptr, *limit;
-
- /* The beginning of the current run, or undefined if we are at the top
- * level. */
- char *runbegin;
-
- /* The list of segments we are accumulating. */
- upb_pb_encoder_segment *segbuf, *segptr, *seglimit;
-
- /* The stack of enclosing submessages. Each entry in the stack points to the
- * segment where this submessage's length is being accumulated. */
- int *stack, *top, *stacklimit;
-
- /* Depth of startmsg/endmsg calls. */
- int depth;
-};
-
-/* low-level buffering ********************************************************/
-
-/* Low-level functions for interacting with the output buffer. */
-
-/* TODO(haberman): handle pushback */
-static void putbuf(upb_pb_encoder *e, const char *buf, size_t len) {
- size_t n = upb_bytessink_putbuf(e->output_, e->subc, buf, len, NULL);
- UPB_ASSERT(n == len);
-}
-
-static upb_pb_encoder_segment *top(upb_pb_encoder *e) {
- return &e->segbuf[*e->top];
-}
-
-/* Call to ensure that at least "bytes" bytes are available for writing at
- * e->ptr. Returns false if the bytes could not be allocated. */
-static bool reserve(upb_pb_encoder *e, size_t bytes) {
- if ((size_t)(e->limit - e->ptr) < bytes) {
- /* Grow buffer. */
- char *new_buf;
- size_t needed = bytes + (e->ptr - e->buf);
- size_t old_size = e->limit - e->buf;
-
- size_t new_size = old_size;
-
- while (new_size < needed) {
- new_size *= 2;
- }
-
- new_buf = upb_arena_realloc(e->arena, e->buf, old_size, new_size);
-
- if (new_buf == NULL) {
- return false;
- }
-
- e->ptr = new_buf + (e->ptr - e->buf);
- e->runbegin = new_buf + (e->runbegin - e->buf);
- e->limit = new_buf + new_size;
- e->buf = new_buf;
- }
-
- return true;
-}
-
-/* Call when "bytes" bytes have been writte at e->ptr. The caller *must* have
- * previously called reserve() with at least this many bytes. */
-static void encoder_advance(upb_pb_encoder *e, size_t bytes) {
- UPB_ASSERT((size_t)(e->limit - e->ptr) >= bytes);
- e->ptr += bytes;
-}
-
-/* Call when all of the bytes for a handler have been written. Flushes the
- * bytes if possible and necessary, returning false if this failed. */
-static bool commit(upb_pb_encoder *e) {
- if (!e->top) {
- /* We aren't inside a delimited region. Flush our accumulated bytes to
- * the output.
- *
- * TODO(haberman): in the future we may want to delay flushing for
- * efficiency reasons. */
- putbuf(e, e->buf, e->ptr - e->buf);
- e->ptr = e->buf;
- }
-
- return true;
-}
-
-/* Writes the given bytes to the buffer, handling reserve/advance. */
-static bool encode_bytesval(upb_pb_encoder *e, const void *data, size_t len) {
- if (!reserve(e, len)) {
- return false;
- }
-
- memcpy(e->ptr, data, len);
- encoder_advance(e, len);
- return true;
-}
-
-/* Finish the current run by adding the run totals to the segment and message
- * length. */
-static void accumulate(upb_pb_encoder *e) {
- size_t run_len;
- UPB_ASSERT(e->ptr >= e->runbegin);
- run_len = e->ptr - e->runbegin;
- e->segptr->seglen += run_len;
- top(e)->msglen += run_len;
- e->runbegin = e->ptr;
-}
-
-/* Call to indicate the start of delimited region for which the full length is
- * not yet known. All data will be buffered until the length is known.
- * Delimited regions may be nested; their lengths will all be tracked properly. */
-static bool start_delim(upb_pb_encoder *e) {
- if (e->top) {
- /* We are already buffering, advance to the next segment and push it on the
- * stack. */
- accumulate(e);
-
- if (++e->top == e->stacklimit) {
- /* TODO(haberman): grow stack? */
- return false;
- }
-
- if (++e->segptr == e->seglimit) {
- /* Grow segment buffer. */
- size_t old_size =
- (e->seglimit - e->segbuf) * sizeof(upb_pb_encoder_segment);
- size_t new_size = old_size * 2;
- upb_pb_encoder_segment *new_buf =
- upb_arena_realloc(e->arena, e->segbuf, old_size, new_size);
-
- if (new_buf == NULL) {
- return false;
- }
-
- e->segptr = new_buf + (e->segptr - e->segbuf);
- e->seglimit = new_buf + (new_size / sizeof(upb_pb_encoder_segment));
- e->segbuf = new_buf;
- }
- } else {
- /* We were previously at the top level, start buffering. */
- e->segptr = e->segbuf;
- e->top = e->stack;
- e->runbegin = e->ptr;
- }
-
- *e->top = (int)(e->segptr - e->segbuf);
- e->segptr->seglen = 0;
- e->segptr->msglen = 0;
-
- return true;
-}
-
-/* Call to indicate the end of a delimited region. We now know the length of
- * the delimited region. If we are not nested inside any other delimited
- * regions, we can now emit all of the buffered data we accumulated. */
-static bool end_delim(upb_pb_encoder *e) {
- size_t msglen;
- accumulate(e);
- msglen = top(e)->msglen;
-
- if (e->top == e->stack) {
- /* All lengths are now available, emit all buffered data. */
- char buf[UPB_PB_VARINT_MAX_LEN];
- upb_pb_encoder_segment *s;
- const char *ptr = e->buf;
- for (s = e->segbuf; s <= e->segptr; s++) {
- size_t lenbytes = upb_vencode64(s->msglen, buf);
- putbuf(e, buf, lenbytes);
- putbuf(e, ptr, s->seglen);
- ptr += s->seglen;
- }
-
- e->ptr = e->buf;
- e->top = NULL;
- } else {
- /* Need to keep buffering; propagate length info into enclosing
- * submessages. */
- --e->top;
- top(e)->msglen += msglen + upb_varint_size(msglen);
- }
-
- return true;
-}
-
-
-/* tag_t **********************************************************************/
-
-/* A precomputed (pre-encoded) tag and length. */
-
-typedef struct {
- uint8_t bytes;
- char tag[7];
-} tag_t;
-
-/* Allocates a new tag for this field, and sets it in these handlerattr. */
-static void new_tag(upb_handlers *h, const upb_fielddef *f, upb_wiretype_t wt,
- upb_handlerattr *attr) {
- uint32_t n = upb_fielddef_number(f);
-
- tag_t *tag = upb_gmalloc(sizeof(tag_t));
- tag->bytes = upb_vencode64((n << 3) | wt, tag->tag);
-
- attr->handler_data = tag;
- upb_handlers_addcleanup(h, tag, upb_gfree);
-}
-
-static bool encode_tagval(upb_pb_encoder *e, const tag_t *tag) {
- return encode_bytesval(e, tag->tag, tag->bytes);
-}
-
-
-/* encoding of wire types *****************************************************/
-
-static bool doencode_fixed64(upb_pb_encoder *e, uint64_t val) {
- /* TODO(haberman): byte-swap for big endian. */
- return encode_bytesval(e, &val, sizeof(uint64_t));
-}
-
-static bool doencode_fixed32(upb_pb_encoder *e, uint32_t val) {
- /* TODO(haberman): byte-swap for big endian. */
- return encode_bytesval(e, &val, sizeof(uint32_t));
-}
-
-static bool doencode_varint(upb_pb_encoder *e, uint64_t val) {
- if (!reserve(e, UPB_PB_VARINT_MAX_LEN)) {
- return false;
- }
-
- encoder_advance(e, upb_vencode64(val, e->ptr));
- return true;
-}
-
-static uint64_t dbl2uint64(double d) {
- uint64_t ret;
- memcpy(&ret, &d, sizeof(uint64_t));
- return ret;
-}
-
-static uint32_t flt2uint32(float d) {
- uint32_t ret;
- memcpy(&ret, &d, sizeof(uint32_t));
- return ret;
-}
-
-
-/* encoding of proto types ****************************************************/
-
-static bool startmsg(void *c, const void *hd) {
- upb_pb_encoder *e = c;
- UPB_UNUSED(hd);
- if (e->depth++ == 0) {
- upb_bytessink_start(e->output_, 0, &e->subc);
- }
- return true;
-}
-
-static bool endmsg(void *c, const void *hd, upb_status *status) {
- upb_pb_encoder *e = c;
- UPB_UNUSED(hd);
- UPB_UNUSED(status);
- if (--e->depth == 0) {
- upb_bytessink_end(e->output_);
- }
- return true;
-}
-
-static void *encode_startdelimfield(void *c, const void *hd) {
- bool ok = encode_tagval(c, hd) && commit(c) && start_delim(c);
- return ok ? c : UPB_BREAK;
-}
-
-static bool encode_unknown(void *c, const void *hd, const char *buf,
- size_t len) {
- UPB_UNUSED(hd);
- return encode_bytesval(c, buf, len) && commit(c);
-}
-
-static bool encode_enddelimfield(void *c, const void *hd) {
- UPB_UNUSED(hd);
- return end_delim(c);
-}
-
-static void *encode_startgroup(void *c, const void *hd) {
- return (encode_tagval(c, hd) && commit(c)) ? c : UPB_BREAK;
-}
-
-static bool encode_endgroup(void *c, const void *hd) {
- return encode_tagval(c, hd) && commit(c);
-}
-
-static void *encode_startstr(void *c, const void *hd, size_t size_hint) {
- UPB_UNUSED(size_hint);
- return encode_startdelimfield(c, hd);
-}
-
-static size_t encode_strbuf(void *c, const void *hd, const char *buf,
- size_t len, const upb_bufhandle *h) {
- UPB_UNUSED(hd);
- UPB_UNUSED(h);
- return encode_bytesval(c, buf, len) ? len : 0;
-}
-
-#define T(type, ctype, convert, encode) \
- static bool encode_scalar_##type(void *e, const void *hd, ctype val) { \
- return encode_tagval(e, hd) && encode(e, (convert)(val)) && commit(e); \
- } \
- static bool encode_packed_##type(void *e, const void *hd, ctype val) { \
- UPB_UNUSED(hd); \
- return encode(e, (convert)(val)); \
- }
-
-T(double, double, dbl2uint64, doencode_fixed64)
-T(float, float, flt2uint32, doencode_fixed32)
-T(int64, int64_t, uint64_t, doencode_varint)
-T(int32, int32_t, int64_t, doencode_varint)
-T(fixed64, uint64_t, uint64_t, doencode_fixed64)
-T(fixed32, uint32_t, uint32_t, doencode_fixed32)
-T(bool, bool, bool, doencode_varint)
-T(uint32, uint32_t, uint32_t, doencode_varint)
-T(uint64, uint64_t, uint64_t, doencode_varint)
-T(enum, int32_t, uint32_t, doencode_varint)
-T(sfixed32, int32_t, uint32_t, doencode_fixed32)
-T(sfixed64, int64_t, uint64_t, doencode_fixed64)
-T(sint32, int32_t, upb_zzenc_32, doencode_varint)
-T(sint64, int64_t, upb_zzenc_64, doencode_varint)
-
-#undef T
-
-
-/* code to build the handlers *************************************************/
-
-#include <stdio.h>
-static void newhandlers_callback(const void *closure, upb_handlers *h) {
- const upb_msgdef *m;
- int i, n;
-
- UPB_UNUSED(closure);
-
- upb_handlers_setstartmsg(h, startmsg, NULL);
- upb_handlers_setendmsg(h, endmsg, NULL);
- upb_handlers_setunknown(h, encode_unknown, NULL);
-
- m = upb_handlers_msgdef(h);
- n = upb_msgdef_fieldcount(m);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(m, i);
- bool packed = upb_fielddef_isseq(f) && upb_fielddef_isprimitive(f) &&
- upb_fielddef_packed(f);
- upb_handlerattr attr = UPB_HANDLERATTR_INIT;
- upb_wiretype_t wt =
- packed ? UPB_WIRE_TYPE_DELIMITED
- : upb_pb_native_wire_types[upb_fielddef_descriptortype(f)];
-
- /* Pre-encode the tag for this field. */
- new_tag(h, f, wt, &attr);
-
- if (packed) {
- upb_handlers_setstartseq(h, f, encode_startdelimfield, &attr);
- upb_handlers_setendseq(h, f, encode_enddelimfield, &attr);
- }
-
-#define T(upper, lower, upbtype) \
- case UPB_DESCRIPTOR_TYPE_##upper: \
- if (packed) { \
- upb_handlers_set##upbtype(h, f, encode_packed_##lower, &attr); \
- } else { \
- upb_handlers_set##upbtype(h, f, encode_scalar_##lower, &attr); \
- } \
- break;
-
- switch (upb_fielddef_descriptortype(f)) {
- T(DOUBLE, double, double);
- T(FLOAT, float, float);
- T(INT64, int64, int64);
- T(INT32, int32, int32);
- T(FIXED64, fixed64, uint64);
- T(FIXED32, fixed32, uint32);
- T(BOOL, bool, bool);
- T(UINT32, uint32, uint32);
- T(UINT64, uint64, uint64);
- T(ENUM, enum, int32);
- T(SFIXED32, sfixed32, int32);
- T(SFIXED64, sfixed64, int64);
- T(SINT32, sint32, int32);
- T(SINT64, sint64, int64);
- case UPB_DESCRIPTOR_TYPE_STRING:
- case UPB_DESCRIPTOR_TYPE_BYTES:
- upb_handlers_setstartstr(h, f, encode_startstr, &attr);
- upb_handlers_setendstr(h, f, encode_enddelimfield, &attr);
- upb_handlers_setstring(h, f, encode_strbuf, &attr);
- break;
- case UPB_DESCRIPTOR_TYPE_MESSAGE:
- upb_handlers_setstartsubmsg(h, f, encode_startdelimfield, &attr);
- upb_handlers_setendsubmsg(h, f, encode_enddelimfield, &attr);
- break;
- case UPB_DESCRIPTOR_TYPE_GROUP: {
- /* Endgroup takes a different tag (wire_type = END_GROUP). */
- upb_handlerattr attr2 = UPB_HANDLERATTR_INIT;
- new_tag(h, f, UPB_WIRE_TYPE_END_GROUP, &attr2);
-
- upb_handlers_setstartsubmsg(h, f, encode_startgroup, &attr);
- upb_handlers_setendsubmsg(h, f, encode_endgroup, &attr2);
-
- break;
- }
- }
-
-#undef T
- }
-}
-
-void upb_pb_encoder_reset(upb_pb_encoder *e) {
- e->segptr = NULL;
- e->top = NULL;
- e->depth = 0;
-}
-
-
-/* public API *****************************************************************/
-
-upb_handlercache *upb_pb_encoder_newcache(void) {
- return upb_handlercache_new(newhandlers_callback, NULL);
-}
-
-upb_pb_encoder *upb_pb_encoder_create(upb_arena *arena, const upb_handlers *h,
- upb_bytessink output) {
- const size_t initial_bufsize = 256;
- const size_t initial_segbufsize = 16;
- /* TODO(haberman): make this configurable. */
- const size_t stack_size = 64;
-
- upb_pb_encoder *e = upb_arena_malloc(arena, sizeof(upb_pb_encoder));
- if (!e) return NULL;
-
- e->buf = upb_arena_malloc(arena, initial_bufsize);
- e->segbuf = upb_arena_malloc(arena, initial_segbufsize * sizeof(*e->segbuf));
- e->stack = upb_arena_malloc(arena, stack_size * sizeof(*e->stack));
-
- if (!e->buf || !e->segbuf || !e->stack) {
- return NULL;
- }
-
- e->limit = e->buf + initial_bufsize;
- e->seglimit = e->segbuf + initial_segbufsize;
- e->stacklimit = e->stack + stack_size;
-
- upb_pb_encoder_reset(e);
- upb_sink_reset(&e->input_, h, e);
-
- e->arena = arena;
- e->output_ = output;
- e->subc = output.closure;
- e->ptr = e->buf;
-
- return e;
-}
-
-upb_sink upb_pb_encoder_input(upb_pb_encoder *e) { return e->input_; }
diff --git a/grpc/third_party/upb/upb/pb/encoder.h b/grpc/third_party/upb/upb/pb/encoder.h
deleted file mode 100644
index f125b372..00000000
--- a/grpc/third_party/upb/upb/pb/encoder.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-** upb::pb::Encoder (upb_pb_encoder)
-**
-** Implements a set of upb_handlers that write protobuf data to the binary wire
-** format.
-**
-** This encoder implementation does not have any access to any out-of-band or
-** precomputed lengths for submessages, so it must buffer submessages internally
-** before it can emit the first byte.
-*/
-
-#ifndef UPB_ENCODER_H_
-#define UPB_ENCODER_H_
-
-#include "upb/sink.h"
-
-#ifdef __cplusplus
-namespace upb {
-namespace pb {
-class EncoderPtr;
-} /* namespace pb */
-} /* namespace upb */
-#endif
-
-#define UPB_PBENCODER_MAX_NESTING 100
-
-/* upb_pb_encoder *************************************************************/
-
-/* Preallocation hint: decoder won't allocate more bytes than this when first
- * constructed. This hint may be an overestimate for some build configurations.
- * But if the decoder library is upgraded without recompiling the application,
- * it may be an underestimate. */
-#define UPB_PB_ENCODER_SIZE 784
-
-struct upb_pb_encoder;
-typedef struct upb_pb_encoder upb_pb_encoder;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-upb_sink upb_pb_encoder_input(upb_pb_encoder *p);
-upb_pb_encoder* upb_pb_encoder_create(upb_arena* a, const upb_handlers* h,
- upb_bytessink output);
-
-/* Lazily builds and caches handlers that will push encoded data to a bytessink.
- * Any msgdef objects used with this object must outlive it. */
-upb_handlercache *upb_pb_encoder_newcache(void);
-
-#ifdef __cplusplus
-} /* extern "C" { */
-
-class upb::pb::EncoderPtr {
- public:
- EncoderPtr(upb_pb_encoder* ptr) : ptr_(ptr) {}
-
- upb_pb_encoder* ptr() { return ptr_; }
-
- /* Creates a new encoder in the given environment. The Handlers must have
- * come from NewHandlers() below. */
- static EncoderPtr Create(Arena* arena, const Handlers* handlers,
- BytesSink output) {
- return EncoderPtr(
- upb_pb_encoder_create(arena->ptr(), handlers, output.sink()));
- }
-
- /* The input to the encoder. */
- upb::Sink input() { return upb_pb_encoder_input(ptr()); }
-
- /* Creates a new set of handlers for this MessageDef. */
- static HandlerCache NewCache() {
- return HandlerCache(upb_pb_encoder_newcache());
- }
-
- static const size_t kSize = UPB_PB_ENCODER_SIZE;
-
- private:
- upb_pb_encoder* ptr_;
-};
-
-#endif /* __cplusplus */
-
-#endif /* UPB_ENCODER_H_ */
diff --git a/grpc/third_party/upb/upb/pb/make-gdb-script.rb b/grpc/third_party/upb/upb/pb/make-gdb-script.rb
deleted file mode 100755
index 38955978..00000000
--- a/grpc/third_party/upb/upb/pb/make-gdb-script.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/ruby
-
-puts "set width 0
-set height 0
-set verbose off\n\n"
-
-IO.popen("nm -S /tmp/upb-jit-code.so").each_line { |line|
- # Input lines look like this:
- # 000000000000575a T X.0x10.OP_CHECKDELIM
- #
- # For each one we want to emit a command that looks like:
- # b X.0x10.OP_CHECKDELIM
- # commands
- # silent
- # printf "buf_ofs=%d data_rem=%d delim_rem=%d X.0x10.OP_CHECKDELIM\n", $rbx - (long)((upb_pbdecoder*)($r15))->buf, $r12 - $rbx, $rbp - $rbx
- # continue
- # end
-
- parts = line.split
- next if parts[1] != "T"
- sym = parts[2]
- next if sym !~ /X\./;
- if sym =~ /OP_/ then
- printcmd = "printf \"buf_ofs=%d data_rem=%d delim_rem=%d #{sym}\\n\", $rbx - (long)((upb_pbdecoder*)($r15))->buf, $r12 - $rbx, $rbp - $rbx"
- elsif sym =~ /enterjit/ then
- printcmd = "printf \"#{sym} bytes=%d\\n\", $rcx"
- else
- printcmd = "printf \"#{sym}\\n\""
- end
- puts "b #{sym}
-commands
- silent
- #{printcmd}
- continue
-end\n\n"
-}
diff --git a/grpc/third_party/upb/upb/pb/textprinter.c b/grpc/third_party/upb/upb/pb/textprinter.c
deleted file mode 100644
index 1331268a..00000000
--- a/grpc/third_party/upb/upb/pb/textprinter.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * upb::pb::TextPrinter
- *
- * OPT: This is not optimized at all. It uses printf() which parses the format
- * string every time, and it allocates memory for every put.
- */
-
-#include "upb/pb/textprinter.h"
-
-#include <ctype.h>
-#include <float.h>
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "upb/sink.h"
-
-#include "upb/port_def.inc"
-
-struct upb_textprinter {
- upb_sink input_;
- upb_bytessink output_;
- int indent_depth_;
- bool single_line_;
- void *subc;
-};
-
-#define CHECK(x) if ((x) < 0) goto err;
-
-static const char *shortname(const char *longname) {
- const char *last = strrchr(longname, '.');
- return last ? last + 1 : longname;
-}
-
-static int indent(upb_textprinter *p) {
- int i;
- if (!p->single_line_)
- for (i = 0; i < p->indent_depth_; i++)
- upb_bytessink_putbuf(p->output_, p->subc, " ", 2, NULL);
- return 0;
-}
-
-static int endfield(upb_textprinter *p) {
- const char ch = (p->single_line_ ? ' ' : '\n');
- upb_bytessink_putbuf(p->output_, p->subc, &ch, 1, NULL);
- return 0;
-}
-
-static int putescaped(upb_textprinter *p, const char *buf, size_t len,
- bool preserve_utf8) {
- /* Based on CEscapeInternal() from Google's protobuf release. */
- char dstbuf[4096], *dst = dstbuf, *dstend = dstbuf + sizeof(dstbuf);
- const char *end = buf + len;
-
- /* I think hex is prettier and more useful, but proto2 uses octal; should
- * investigate whether it can parse hex also. */
- const bool use_hex = false;
- bool last_hex_escape = false; /* true if last output char was \xNN */
-
- for (; buf < end; buf++) {
- bool is_hex_escape;
-
- if (dstend - dst < 4) {
- upb_bytessink_putbuf(p->output_, p->subc, dstbuf, dst - dstbuf, NULL);
- dst = dstbuf;
- }
-
- is_hex_escape = false;
- switch (*buf) {
- case '\n': *(dst++) = '\\'; *(dst++) = 'n'; break;
- case '\r': *(dst++) = '\\'; *(dst++) = 'r'; break;
- case '\t': *(dst++) = '\\'; *(dst++) = 't'; break;
- case '\"': *(dst++) = '\\'; *(dst++) = '\"'; break;
- case '\'': *(dst++) = '\\'; *(dst++) = '\''; break;
- case '\\': *(dst++) = '\\'; *(dst++) = '\\'; break;
- default:
- /* Note that if we emit \xNN and the buf character after that is a hex
- * digit then that digit must be escaped too to prevent it being
- * interpreted as part of the character code by C. */
- if ((!preserve_utf8 || (uint8_t)*buf < 0x80) &&
- (!isprint(*buf) || (last_hex_escape && isxdigit(*buf)))) {
- sprintf(dst, (use_hex ? "\\x%02x" : "\\%03o"), (uint8_t)*buf);
- is_hex_escape = use_hex;
- dst += 4;
- } else {
- *(dst++) = *buf; break;
- }
- }
- last_hex_escape = is_hex_escape;
- }
- /* Flush remaining data. */
- upb_bytessink_putbuf(p->output_, p->subc, dstbuf, dst - dstbuf, NULL);
- return 0;
-}
-
-bool putf(upb_textprinter *p, const char *fmt, ...) {
- va_list args;
- va_list args_copy;
- char *str;
- int written;
- int len;
- bool ok;
-
- va_start(args, fmt);
-
- /* Run once to get the length of the string. */
- va_copy(args_copy, args);
- len = vsnprintf(NULL, 0, fmt, args_copy);
- va_end(args_copy);
-
- /* + 1 for NULL terminator (vsprintf() requires it even if we don't). */
- str = upb_gmalloc(len + 1);
- if (!str) return false;
- written = vsprintf(str, fmt, args);
- va_end(args);
- UPB_ASSERT(written == len);
-
- ok = upb_bytessink_putbuf(p->output_, p->subc, str, len, NULL);
- upb_gfree(str);
- return ok;
-}
-
-
-/* handlers *******************************************************************/
-
-static bool textprinter_startmsg(void *c, const void *hd) {
- upb_textprinter *p = c;
- UPB_UNUSED(hd);
- if (p->indent_depth_ == 0) {
- upb_bytessink_start(p->output_, 0, &p->subc);
- }
- return true;
-}
-
-static bool textprinter_endmsg(void *c, const void *hd, upb_status *s) {
- upb_textprinter *p = c;
- UPB_UNUSED(hd);
- UPB_UNUSED(s);
- if (p->indent_depth_ == 0) {
- upb_bytessink_end(p->output_);
- }
- return true;
-}
-
-#define TYPE(name, ctype, fmt) \
- static bool textprinter_put ## name(void *closure, const void *handler_data, \
- ctype val) { \
- upb_textprinter *p = closure; \
- const upb_fielddef *f = handler_data; \
- CHECK(indent(p)); \
- putf(p, "%s: " fmt, upb_fielddef_name(f), val); \
- CHECK(endfield(p)); \
- return true; \
- err: \
- return false; \
-}
-
-static bool textprinter_putbool(void *closure, const void *handler_data,
- bool val) {
- upb_textprinter *p = closure;
- const upb_fielddef *f = handler_data;
- CHECK(indent(p));
- putf(p, "%s: %s", upb_fielddef_name(f), val ? "true" : "false");
- CHECK(endfield(p));
- return true;
-err:
- return false;
-}
-
-#define STRINGIFY_HELPER(x) #x
-#define STRINGIFY_MACROVAL(x) STRINGIFY_HELPER(x)
-
-TYPE(int32, int32_t, "%" PRId32)
-TYPE(int64, int64_t, "%" PRId64)
-TYPE(uint32, uint32_t, "%" PRIu32)
-TYPE(uint64, uint64_t, "%" PRIu64)
-TYPE(float, float, "%." STRINGIFY_MACROVAL(FLT_DIG) "g")
-TYPE(double, double, "%." STRINGIFY_MACROVAL(DBL_DIG) "g")
-
-#undef TYPE
-
-/* Output a symbolic value from the enum if found, else just print as int32. */
-static bool textprinter_putenum(void *closure, const void *handler_data,
- int32_t val) {
- upb_textprinter *p = closure;
- const upb_fielddef *f = handler_data;
- const upb_enumdef *enum_def = upb_fielddef_enumsubdef(f);
- const char *label = upb_enumdef_iton(enum_def, val);
- if (label) {
- indent(p);
- putf(p, "%s: %s", upb_fielddef_name(f), label);
- endfield(p);
- } else {
- if (!textprinter_putint32(closure, handler_data, val))
- return false;
- }
- return true;
-}
-
-static void *textprinter_startstr(void *closure, const void *handler_data,
- size_t size_hint) {
- upb_textprinter *p = closure;
- const upb_fielddef *f = handler_data;
- UPB_UNUSED(size_hint);
- indent(p);
- putf(p, "%s: \"", upb_fielddef_name(f));
- return p;
-}
-
-static bool textprinter_endstr(void *closure, const void *handler_data) {
- upb_textprinter *p = closure;
- UPB_UNUSED(handler_data);
- putf(p, "\"");
- endfield(p);
- return true;
-}
-
-static size_t textprinter_putstr(void *closure, const void *hd, const char *buf,
- size_t len, const upb_bufhandle *handle) {
- upb_textprinter *p = closure;
- const upb_fielddef *f = hd;
- UPB_UNUSED(handle);
- CHECK(putescaped(p, buf, len, upb_fielddef_type(f) == UPB_TYPE_STRING));
- return len;
-err:
- return 0;
-}
-
-static void *textprinter_startsubmsg(void *closure, const void *handler_data) {
- upb_textprinter *p = closure;
- const char *name = handler_data;
- CHECK(indent(p));
- putf(p, "%s {%c", name, p->single_line_ ? ' ' : '\n');
- p->indent_depth_++;
- return p;
-err:
- return UPB_BREAK;
-}
-
-static bool textprinter_endsubmsg(void *closure, const void *handler_data) {
- upb_textprinter *p = closure;
- UPB_UNUSED(handler_data);
- p->indent_depth_--;
- CHECK(indent(p));
- upb_bytessink_putbuf(p->output_, p->subc, "}", 1, NULL);
- CHECK(endfield(p));
- return true;
-err:
- return false;
-}
-
-static void onmreg(const void *c, upb_handlers *h) {
- const upb_msgdef *m = upb_handlers_msgdef(h);
- int i, n;
- UPB_UNUSED(c);
-
- upb_handlers_setstartmsg(h, textprinter_startmsg, NULL);
- upb_handlers_setendmsg(h, textprinter_endmsg, NULL);
-
- n = upb_msgdef_fieldcount(m);
- for(i = 0; i < n; i++) {
- const upb_fielddef *f = upb_msgdef_field(m, i);
- upb_handlerattr attr = UPB_HANDLERATTR_INIT;
- attr.handler_data = f;
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- upb_handlers_setint32(h, f, textprinter_putint32, &attr);
- break;
- case UPB_TYPE_INT64:
- upb_handlers_setint64(h, f, textprinter_putint64, &attr);
- break;
- case UPB_TYPE_UINT32:
- upb_handlers_setuint32(h, f, textprinter_putuint32, &attr);
- break;
- case UPB_TYPE_UINT64:
- upb_handlers_setuint64(h, f, textprinter_putuint64, &attr);
- break;
- case UPB_TYPE_FLOAT:
- upb_handlers_setfloat(h, f, textprinter_putfloat, &attr);
- break;
- case UPB_TYPE_DOUBLE:
- upb_handlers_setdouble(h, f, textprinter_putdouble, &attr);
- break;
- case UPB_TYPE_BOOL:
- upb_handlers_setbool(h, f, textprinter_putbool, &attr);
- break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
- upb_handlers_setstartstr(h, f, textprinter_startstr, &attr);
- upb_handlers_setstring(h, f, textprinter_putstr, &attr);
- upb_handlers_setendstr(h, f, textprinter_endstr, &attr);
- break;
- case UPB_TYPE_MESSAGE: {
- const char *name =
- upb_fielddef_descriptortype(f) == UPB_DESCRIPTOR_TYPE_GROUP
- ? shortname(upb_msgdef_fullname(upb_fielddef_msgsubdef(f)))
- : upb_fielddef_name(f);
- attr.handler_data = name;
- upb_handlers_setstartsubmsg(h, f, textprinter_startsubmsg, &attr);
- upb_handlers_setendsubmsg(h, f, textprinter_endsubmsg, &attr);
- break;
- }
- case UPB_TYPE_ENUM:
- upb_handlers_setint32(h, f, textprinter_putenum, &attr);
- break;
- }
- }
-}
-
-static void textprinter_reset(upb_textprinter *p, bool single_line) {
- p->single_line_ = single_line;
- p->indent_depth_ = 0;
-}
-
-
-/* Public API *****************************************************************/
-
-upb_textprinter *upb_textprinter_create(upb_arena *arena, const upb_handlers *h,
- upb_bytessink output) {
- upb_textprinter *p = upb_arena_malloc(arena, sizeof(upb_textprinter));
- if (!p) return NULL;
-
- p->output_ = output;
- upb_sink_reset(&p->input_, h, p);
- textprinter_reset(p, false);
-
- return p;
-}
-
-upb_handlercache *upb_textprinter_newcache(void) {
- return upb_handlercache_new(&onmreg, NULL);
-}
-
-upb_sink upb_textprinter_input(upb_textprinter *p) { return p->input_; }
-
-void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line) {
- p->single_line_ = single_line;
-}
diff --git a/grpc/third_party/upb/upb/pb/textprinter.h b/grpc/third_party/upb/upb/pb/textprinter.h
deleted file mode 100644
index 7e20d752..00000000
--- a/grpc/third_party/upb/upb/pb/textprinter.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-** upb::pb::TextPrinter (upb_textprinter)
-**
-** Handlers for writing to protobuf text format.
-*/
-
-#ifndef UPB_TEXT_H_
-#define UPB_TEXT_H_
-
-#include "upb/sink.h"
-
-#ifdef __cplusplus
-namespace upb {
-namespace pb {
-class TextPrinterPtr;
-} /* namespace pb */
-} /* namespace upb */
-#endif
-
-/* upb_textprinter ************************************************************/
-
-struct upb_textprinter;
-typedef struct upb_textprinter upb_textprinter;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* C API. */
-upb_textprinter *upb_textprinter_create(upb_arena *arena, const upb_handlers *h,
- upb_bytessink output);
-void upb_textprinter_setsingleline(upb_textprinter *p, bool single_line);
-upb_sink upb_textprinter_input(upb_textprinter *p);
-upb_handlercache *upb_textprinter_newcache(void);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-class upb::pb::TextPrinterPtr {
- public:
- TextPrinterPtr(upb_textprinter* ptr) : ptr_(ptr) {}
-
- /* The given handlers must have come from NewHandlers(). It must outlive the
- * TextPrinter. */
- static TextPrinterPtr Create(Arena *arena, upb::HandlersPtr *handlers,
- BytesSink output) {
- return TextPrinterPtr(
- upb_textprinter_create(arena->ptr(), handlers->ptr(), output.sink()));
- }
-
- void SetSingleLineMode(bool single_line) {
- upb_textprinter_setsingleline(ptr_, single_line);
- }
-
- Sink input() { return upb_textprinter_input(ptr_); }
-
- /* If handler caching becomes a requirement we can add a code cache as in
- * decoder.h */
- static HandlerCache NewCache() {
- return HandlerCache(upb_textprinter_newcache());
- }
-
- private:
- upb_textprinter* ptr_;
-};
-
-#endif
-
-#endif /* UPB_TEXT_H_ */
diff --git a/grpc/third_party/upb/upb/pb/varint.c b/grpc/third_party/upb/upb/pb/varint.c
deleted file mode 100644
index 90f58a13..00000000
--- a/grpc/third_party/upb/upb/pb/varint.c
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#include "upb/pb/varint.int.h"
-
-/* Index is descriptor type. */
-const uint8_t upb_pb_native_wire_types[] = {
- UPB_WIRE_TYPE_END_GROUP, /* ENDGROUP */
- UPB_WIRE_TYPE_64BIT, /* DOUBLE */
- UPB_WIRE_TYPE_32BIT, /* FLOAT */
- UPB_WIRE_TYPE_VARINT, /* INT64 */
- UPB_WIRE_TYPE_VARINT, /* UINT64 */
- UPB_WIRE_TYPE_VARINT, /* INT32 */
- UPB_WIRE_TYPE_64BIT, /* FIXED64 */
- UPB_WIRE_TYPE_32BIT, /* FIXED32 */
- UPB_WIRE_TYPE_VARINT, /* BOOL */
- UPB_WIRE_TYPE_DELIMITED, /* STRING */
- UPB_WIRE_TYPE_START_GROUP, /* GROUP */
- UPB_WIRE_TYPE_DELIMITED, /* MESSAGE */
- UPB_WIRE_TYPE_DELIMITED, /* BYTES */
- UPB_WIRE_TYPE_VARINT, /* UINT32 */
- UPB_WIRE_TYPE_VARINT, /* ENUM */
- UPB_WIRE_TYPE_32BIT, /* SFIXED32 */
- UPB_WIRE_TYPE_64BIT, /* SFIXED64 */
- UPB_WIRE_TYPE_VARINT, /* SINT32 */
- UPB_WIRE_TYPE_VARINT, /* SINT64 */
-};
-
-/* A basic branch-based decoder, uses 32-bit values to get good performance
- * on 32-bit architectures (but performs well on 64-bits also).
- * This scheme comes from the original Google Protobuf implementation
- * (proto2). */
-upb_decoderet upb_vdecode_max8_branch32(upb_decoderet r) {
- upb_decoderet err = {NULL, 0};
- const char *p = r.p;
- uint32_t low = (uint32_t)r.val;
- uint32_t high = 0;
- uint32_t b;
- b = *(p++); low |= (b & 0x7fU) << 14; if (!(b & 0x80)) goto done;
- b = *(p++); low |= (b & 0x7fU) << 21; if (!(b & 0x80)) goto done;
- b = *(p++); low |= (b & 0x7fU) << 28;
- high = (b & 0x7fU) >> 4; if (!(b & 0x80)) goto done;
- b = *(p++); high |= (b & 0x7fU) << 3; if (!(b & 0x80)) goto done;
- b = *(p++); high |= (b & 0x7fU) << 10; if (!(b & 0x80)) goto done;
- b = *(p++); high |= (b & 0x7fU) << 17; if (!(b & 0x80)) goto done;
- b = *(p++); high |= (b & 0x7fU) << 24; if (!(b & 0x80)) goto done;
- b = *(p++); high |= (b & 0x7fU) << 31; if (!(b & 0x80)) goto done;
- return err;
-
-done:
- r.val = ((uint64_t)high << 32) | low;
- r.p = p;
- return r;
-}
-
-/* Like the previous, but uses 64-bit values. */
-upb_decoderet upb_vdecode_max8_branch64(upb_decoderet r) {
- const char *p = r.p;
- uint64_t val = r.val;
- uint64_t b;
- upb_decoderet err = {NULL, 0};
- b = *(p++); val |= (b & 0x7fU) << 14; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 21; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 28; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 35; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 42; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 49; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 56; if (!(b & 0x80)) goto done;
- b = *(p++); val |= (b & 0x7fU) << 63; if (!(b & 0x80)) goto done;
- return err;
-
-done:
- r.val = val;
- r.p = p;
- return r;
-}
diff --git a/grpc/third_party/upb/upb/pb/varint.int.h b/grpc/third_party/upb/upb/pb/varint.int.h
deleted file mode 100644
index 9b98a81c..00000000
--- a/grpc/third_party/upb/upb/pb/varint.int.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-** A number of routines for varint manipulation (we keep them all around to
-** have multiple approaches available for benchmarking).
-*/
-
-#ifndef UPB_VARINT_DECODER_H_
-#define UPB_VARINT_DECODER_H_
-
-#include <assert.h>
-#include <stdint.h>
-#include <string.h>
-#include "upb/upb.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UPB_MAX_WIRE_TYPE 5
-
-/* The maximum number of bytes that it takes to encode a 64-bit varint. */
-#define UPB_PB_VARINT_MAX_LEN 10
-
-/* Array of the "native" (ie. non-packed-repeated) wire type for the given a
- * descriptor type (upb_descriptortype_t). */
-extern const uint8_t upb_pb_native_wire_types[];
-
-UPB_INLINE uint64_t byteswap64(uint64_t val) {
- uint64_t byte = 0xff;
- return (val & (byte << 56) >> 56)
- | (val & (byte << 48) >> 40)
- | (val & (byte << 40) >> 24)
- | (val & (byte << 32) >> 8)
- | (val & (byte << 24) << 8)
- | (val & (byte << 16) << 24)
- | (val & (byte << 8) << 40)
- | (val & (byte << 0) << 56);
-}
-
-/* Zig-zag encoding/decoding **************************************************/
-
-UPB_INLINE int32_t upb_zzdec_32(uint64_t _n) {
- uint32_t n = (uint32_t)_n;
- return (n >> 1) ^ -(int32_t)(n & 1);
-}
-UPB_INLINE int64_t upb_zzdec_64(uint64_t n) {
- return (n >> 1) ^ -(int64_t)(n & 1);
-}
-UPB_INLINE uint32_t upb_zzenc_32(int32_t n) {
- return ((uint32_t)n << 1) ^ (n >> 31);
-}
-UPB_INLINE uint64_t upb_zzenc_64(int64_t n) {
- return ((uint64_t)n << 1) ^ (n >> 63);
-}
-
-/* Decoding *******************************************************************/
-
-/* All decoding functions return this struct by value. */
-typedef struct {
- const char *p; /* NULL if the varint was unterminated. */
- uint64_t val;
-} upb_decoderet;
-
-UPB_INLINE upb_decoderet upb_decoderet_make(const char *p, uint64_t val) {
- upb_decoderet ret;
- ret.p = p;
- ret.val = val;
- return ret;
-}
-
-upb_decoderet upb_vdecode_max8_branch32(upb_decoderet r);
-upb_decoderet upb_vdecode_max8_branch64(upb_decoderet r);
-
-/* Template for a function that checks the first two bytes with branching
- * and dispatches 2-10 bytes with a separate function. Note that this may read
- * up to 10 bytes, so it must not be used unless there are at least ten bytes
- * left in the buffer! */
-#define UPB_VARINT_DECODER_CHECK2(name, decode_max8_function) \
-UPB_INLINE upb_decoderet upb_vdecode_check2_ ## name(const char *_p) { \
- uint8_t *p = (uint8_t*)_p; \
- upb_decoderet r; \
- if ((*p & 0x80) == 0) { \
- /* Common case: one-byte varint. */ \
- return upb_decoderet_make(_p + 1, *p & 0x7fU); \
- } \
- r = upb_decoderet_make(_p + 2, (*p & 0x7fU) | ((*(p + 1) & 0x7fU) << 7)); \
- if ((*(p + 1) & 0x80) == 0) { \
- /* Two-byte varint. */ \
- return r; \
- } \
- /* Longer varint, fallback to out-of-line function. */ \
- return decode_max8_function(r); \
-}
-
-UPB_VARINT_DECODER_CHECK2(branch32, upb_vdecode_max8_branch32)
-UPB_VARINT_DECODER_CHECK2(branch64, upb_vdecode_max8_branch64)
-#undef UPB_VARINT_DECODER_CHECK2
-
-/* Our canonical functions for decoding varints, based on the currently
- * favored best-performing implementations. */
-UPB_INLINE upb_decoderet upb_vdecode_fast(const char *p) {
- if (sizeof(long) == 8)
- return upb_vdecode_check2_branch64(p);
- else
- return upb_vdecode_check2_branch32(p);
-}
-
-
-/* Encoding *******************************************************************/
-
-UPB_INLINE int upb_value_size(uint64_t val) {
-#ifdef __GNUC__
- /* 0-based, undef if val == 0. */
- int high_bit = val ? 63 - __builtin_clzll(val) : 0;
-#else
- int high_bit = 0;
- uint64_t tmp = val;
- while(tmp >>= 1) high_bit++;
-#endif
- return val == 0 ? 1 : high_bit / 8 + 1;
-}
-
-/* Encodes a 64-bit varint into buf (which must be >=UPB_PB_VARINT_MAX_LEN
- * bytes long), returning how many bytes were used.
- *
- * TODO: benchmark and optimize if necessary. */
-UPB_INLINE size_t upb_vencode64(uint64_t val, char *buf) {
- size_t i;
- if (val == 0) { buf[0] = 0; return 1; }
- i = 0;
- while (val) {
- uint8_t byte = val & 0x7fU;
- val >>= 7;
- if (val) byte |= 0x80U;
- buf[i++] = byte;
- }
- return i;
-}
-
-UPB_INLINE size_t upb_varint_size(uint64_t val) {
- char buf[UPB_PB_VARINT_MAX_LEN];
- return upb_vencode64(val, buf);
-}
-
-/* Encodes a 32-bit varint, *not* sign-extended. */
-UPB_INLINE uint64_t upb_vencode32(uint32_t val) {
- char buf[UPB_PB_VARINT_MAX_LEN];
- size_t bytes = upb_vencode64(val, buf);
- uint64_t ret = 0;
- UPB_ASSERT(bytes <= 5);
- memcpy(&ret, buf, bytes);
- ret = _upb_be_swap64(ret);
- UPB_ASSERT(ret <= 0xffffffffffU);
- return ret;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_VARINT_DECODER_H_ */
diff --git a/grpc/third_party/upb/upb/port_def.inc b/grpc/third_party/upb/upb/port_def.inc
index 2cd1bb69..2b240ff6 100644
--- a/grpc/third_party/upb/upb/port_def.inc
+++ b/grpc/third_party/upb/upb/port_def.inc
@@ -1,25 +1,52 @@
/*
-* This is where we define macros used across upb.
-*
-* All of these macros are undef'd in port_undef.inc to avoid leaking them to
-* users.
-*
-* The correct usage is:
-*
-* #include "upb/foobar.h"
-* #include "upb/baz.h"
-*
-* // MUST be last included header.
-* #include "upb/port_def.inc"
-*
-* // Code for this file.
-* // <...>
-*
-* // Can be omitted for .c files, required for .h.
-* #include "upb/port_undef.inc"
-*
-* This file is private and must not be included by users!
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This is where we define macros used across upb.
+ *
+ * All of these macros are undef'd in port_undef.inc to avoid leaking them to
+ * users.
+ *
+ * The correct usage is:
+ *
+ * #include "upb/foobar.h"
+ * #include "upb/baz.h"
+ *
+ * // MUST be last included header.
+ * #include "upb/port_def.inc"
+ *
+ * // Code for this file.
+ * // <...>
+ *
+ * // Can be omitted for .c files, required for .h.
+ * #include "upb/port_undef.inc"
+ *
+ * This file is private and must not be included by users!
+ */
#if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
@@ -80,14 +107,17 @@
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
+#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE
#define UPB_NORETURN __declspec(noreturn)
+#define UPB_PRINTF(str, first_vararg)
#else /* !defined(__GNUC__) */
#define UPB_FORCEINLINE
#define UPB_NOINLINE
#define UPB_NORETURN
+#define UPB_PRINTF(str, first_vararg)
#endif
#define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
@@ -132,9 +162,40 @@
#define UPB_LONGJMP(buf, val) longjmp(buf, val)
#endif
+/* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
+#define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
+
/* Configure whether fasttable is switched on or not. *************************/
-#if defined(__x86_64__) && defined(__GNUC__)
+#ifdef __has_attribute
+#define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#define UPB_HAS_ATTRIBUTE(x) 0
+#endif
+
+#if UPB_HAS_ATTRIBUTE(musttail)
+#define UPB_MUSTTAIL __attribute__((musttail))
+#else
+#define UPB_MUSTTAIL
+#endif
+
+#undef UPB_HAS_ATTRIBUTE
+
+/* This check is not fully robust: it does not require that we have "musttail"
+ * support available. We need tail calls to avoid consuming arbitrary amounts
+ * of stack space.
+ *
+ * GCC/Clang can mostly be trusted to generate tail calls as long as
+ * optimization is enabled, but, debug builds will not generate tail calls
+ * unless "musttail" is available.
+ *
+ * We should probably either:
+ * 1. require that the compiler supports musttail.
+ * 2. add some fallback code for when musttail isn't available (ie. return
+ * instead of tail calling). This is safe and portable, but this comes at
+ * a CPU cost.
+ */
+#if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
#define UPB_FASTTABLE_SUPPORTED 1
#else
#define UPB_FASTTABLE_SUPPORTED 0
@@ -145,7 +206,7 @@
* for example for testing or benchmarking. */
#if defined(UPB_ENABLE_FASTTABLE)
#if !UPB_FASTTABLE_SUPPORTED
-#error fasttable is x86-64 + Clang/GCC only
+#error fasttable is x86-64/ARM64 only and requires GCC or Clang.
#endif
#define UPB_FASTTABLE 1
/* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
@@ -189,4 +250,12 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
-#endif
+#endif
+
+/* Disable proto2 arena behavior (TEMPORARY) **********************************/
+
+#ifdef UPB_DISABLE_PROTO2_ENUM_CHECKING
+#define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 1
+#else
+#define UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3 0
+#endif
diff --git a/grpc/third_party/upb/upb/port_undef.inc b/grpc/third_party/upb/upb/port_undef.inc
index b7be52cc..3ef2d0db 100644
--- a/grpc/third_party/upb/upb/port_undef.inc
+++ b/grpc/third_party/upb/upb/port_undef.inc
@@ -1,24 +1,62 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
/* See port_def.inc. This should #undef all macros #defined there. */
-#undef UPB_MAPTYPE_STRING
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_READ_ONEOF
#undef UPB_WRITE_ONEOF
+#undef UPB_MAPTYPE_STRING
#undef UPB_INLINE
#undef UPB_ALIGN_UP
#undef UPB_ALIGN_DOWN
#undef UPB_ALIGN_MALLOC
#undef UPB_ALIGN_OF
+#undef UPB_LIKELY
+#undef UPB_UNLIKELY
#undef UPB_FORCEINLINE
#undef UPB_NOINLINE
#undef UPB_NORETURN
+#undef UPB_PRINTF
#undef UPB_MAX
#undef UPB_MIN
#undef UPB_UNUSED
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
+#undef UPB_SETJMP
+#undef UPB_LONGJMP
+#undef UPB_PTRADD
+#undef UPB_MUSTTAIL
+#undef UPB_FASTTABLE_SUPPORTED
+#undef UPB_FASTTABLE
+#undef UPB_FASTTABLE_INIT
#undef UPB_POISON_MEMORY_REGION
#undef UPB_UNPOISON_MEMORY_REGION
#undef UPB_ASAN
+#undef UPB_TREAT_PROTO2_ENUMS_LIKE_PROTO3
diff --git a/grpc/third_party/upb/upb/reflection.c b/grpc/third_party/upb/upb/reflection.c
index a233d964..a3a64d27 100644
--- a/grpc/third_party/upb/upb/reflection.c
+++ b/grpc/third_party/upb/upb/reflection.c
@@ -1,238 +1,266 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/reflection.h"
#include <string.h>
-#include "upb/table.int.h"
-#include "upb/msg.h"
+#include "upb/msg.h"
#include "upb/port_def.inc"
+#include "upb/table_internal.h"
-static size_t get_field_size(const upb_msglayout_field *f) {
+static size_t get_field_size(const upb_MiniTable_Field* f) {
static unsigned char sizes[] = {
- 0,/* 0 */
- 8, /* UPB_DESCRIPTOR_TYPE_DOUBLE */
- 4, /* UPB_DESCRIPTOR_TYPE_FLOAT */
- 8, /* UPB_DESCRIPTOR_TYPE_INT64 */
- 8, /* UPB_DESCRIPTOR_TYPE_UINT64 */
- 4, /* UPB_DESCRIPTOR_TYPE_INT32 */
- 8, /* UPB_DESCRIPTOR_TYPE_FIXED64 */
- 4, /* UPB_DESCRIPTOR_TYPE_FIXED32 */
- 1, /* UPB_DESCRIPTOR_TYPE_BOOL */
- sizeof(upb_strview), /* UPB_DESCRIPTOR_TYPE_STRING */
- sizeof(void*), /* UPB_DESCRIPTOR_TYPE_GROUP */
- sizeof(void*), /* UPB_DESCRIPTOR_TYPE_MESSAGE */
- sizeof(upb_strview), /* UPB_DESCRIPTOR_TYPE_BYTES */
- 4, /* UPB_DESCRIPTOR_TYPE_UINT32 */
- 4, /* UPB_DESCRIPTOR_TYPE_ENUM */
- 4, /* UPB_DESCRIPTOR_TYPE_SFIXED32 */
- 8, /* UPB_DESCRIPTOR_TYPE_SFIXED64 */
- 4, /* UPB_DESCRIPTOR_TYPE_SINT32 */
- 8, /* UPB_DESCRIPTOR_TYPE_SINT64 */
+ 0, /* 0 */
+ 8, /* kUpb_FieldType_Double */
+ 4, /* kUpb_FieldType_Float */
+ 8, /* kUpb_FieldType_Int64 */
+ 8, /* kUpb_FieldType_UInt64 */
+ 4, /* kUpb_FieldType_Int32 */
+ 8, /* kUpb_FieldType_Fixed64 */
+ 4, /* kUpb_FieldType_Fixed32 */
+ 1, /* kUpb_FieldType_Bool */
+ sizeof(upb_StringView), /* kUpb_FieldType_String */
+ sizeof(void*), /* kUpb_FieldType_Group */
+ sizeof(void*), /* kUpb_FieldType_Message */
+ sizeof(upb_StringView), /* kUpb_FieldType_Bytes */
+ 4, /* kUpb_FieldType_UInt32 */
+ 4, /* kUpb_FieldType_Enum */
+ 4, /* kUpb_FieldType_SFixed32 */
+ 8, /* kUpb_FieldType_SFixed64 */
+ 4, /* kUpb_FieldType_SInt32 */
+ 8, /* kUpb_FieldType_SInt64 */
};
- return _upb_repeated_or_map(f) ? sizeof(void *) : sizes[f->descriptortype];
+ return upb_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype];
}
/* Strings/bytes are special-cased in maps. */
-static char _upb_fieldtype_to_mapsize[12] = {
- 0,
- 1, /* UPB_TYPE_BOOL */
- 4, /* UPB_TYPE_FLOAT */
- 4, /* UPB_TYPE_INT32 */
- 4, /* UPB_TYPE_UINT32 */
- 4, /* UPB_TYPE_ENUM */
- sizeof(void*), /* UPB_TYPE_MESSAGE */
- 8, /* UPB_TYPE_DOUBLE */
- 8, /* UPB_TYPE_INT64 */
- 8, /* UPB_TYPE_UINT64 */
- 0, /* UPB_TYPE_STRING */
- 0, /* UPB_TYPE_BYTES */
+static char _upb_CTypeo_mapsize[12] = {
+ 0,
+ 1, /* kUpb_CType_Bool */
+ 4, /* kUpb_CType_Float */
+ 4, /* kUpb_CType_Int32 */
+ 4, /* kUpb_CType_UInt32 */
+ 4, /* kUpb_CType_Enum */
+ sizeof(void*), /* kUpb_CType_Message */
+ 8, /* kUpb_CType_Double */
+ 8, /* kUpb_CType_Int64 */
+ 8, /* kUpb_CType_UInt64 */
+ 0, /* kUpb_CType_String */
+ 0, /* kUpb_CType_Bytes */
};
-static const char _upb_fieldtype_to_sizelg2[12] = {
- 0,
- 0, /* UPB_TYPE_BOOL */
- 2, /* UPB_TYPE_FLOAT */
- 2, /* UPB_TYPE_INT32 */
- 2, /* UPB_TYPE_UINT32 */
- 2, /* UPB_TYPE_ENUM */
- UPB_SIZE(2, 3), /* UPB_TYPE_MESSAGE */
- 3, /* UPB_TYPE_DOUBLE */
- 3, /* UPB_TYPE_INT64 */
- 3, /* UPB_TYPE_UINT64 */
- UPB_SIZE(3, 4), /* UPB_TYPE_STRING */
- UPB_SIZE(3, 4), /* UPB_TYPE_BYTES */
+static const char _upb_CTypeo_sizelg2[12] = {
+ 0,
+ 0, /* kUpb_CType_Bool */
+ 2, /* kUpb_CType_Float */
+ 2, /* kUpb_CType_Int32 */
+ 2, /* kUpb_CType_UInt32 */
+ 2, /* kUpb_CType_Enum */
+ UPB_SIZE(2, 3), /* kUpb_CType_Message */
+ 3, /* kUpb_CType_Double */
+ 3, /* kUpb_CType_Int64 */
+ 3, /* kUpb_CType_UInt64 */
+ UPB_SIZE(3, 4), /* kUpb_CType_String */
+ UPB_SIZE(3, 4), /* kUpb_CType_Bytes */
};
-/** upb_msg *******************************************************************/
+/** upb_Message
+ * *******************************************************************/
-upb_msg *upb_msg_new(const upb_msgdef *m, upb_arena *a) {
- return _upb_msg_new(upb_msgdef_layout(m), a);
+upb_Message* upb_Message_New(const upb_MessageDef* m, upb_Arena* a) {
+ return _upb_Message_New(upb_MessageDef_MiniTable(m), a);
}
-static bool in_oneof(const upb_msglayout_field *field) {
+static bool in_oneof(const upb_MiniTable_Field* field) {
return field->presence < 0;
}
-static upb_msgval _upb_msg_getraw(const upb_msg *msg, const upb_fielddef *f) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- const char *mem = UPB_PTR_AT(msg, field->offset, char);
- upb_msgval val = {0};
+static upb_MessageValue _upb_Message_Getraw(const upb_Message* msg,
+ const upb_FieldDef* f) {
+ const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f);
+ const char* mem = UPB_PTR_AT(msg, field->offset, char);
+ upb_MessageValue val = {0};
memcpy(&val, mem, get_field_size(field));
return val;
}
-bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- if (in_oneof(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- } else if (field->presence > 0) {
- return _upb_hasbit_field(msg, field);
+bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f) {
+ assert(upb_FieldDef_HasPresence(f));
+ if (upb_FieldDef_IsExtension(f)) {
+ const upb_MiniTable_Extension* ext = _upb_FieldDef_ExtensionMiniTable(f);
+ return _upb_Message_Getext(msg, ext) != NULL;
} else {
- UPB_ASSERT(field->descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
- field->descriptortype == UPB_DESCRIPTOR_TYPE_GROUP);
- return _upb_msg_getraw(msg, f).msg_val != NULL;
+ const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f);
+ if (in_oneof(field)) {
+ return _upb_getoneofcase_field(msg, field) == field->number;
+ } else if (field->presence > 0) {
+ return _upb_hasbit_field(msg, field);
+ } else {
+ UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message ||
+ field->descriptortype == kUpb_FieldType_Group);
+ return _upb_Message_Getraw(msg, f).msg_val != NULL;
+ }
}
}
-const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg,
- const upb_oneofdef *o) {
- const upb_fielddef *f = upb_oneofdef_field(o, 0);
- if (upb_oneofdef_issynthetic(o)) {
- UPB_ASSERT(upb_oneofdef_fieldcount(o) == 1);
- return upb_msg_has(msg, f) ? f : NULL;
+const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg,
+ const upb_OneofDef* o) {
+ const upb_FieldDef* f = upb_OneofDef_Field(o, 0);
+ if (upb_OneofDef_IsSynthetic(o)) {
+ UPB_ASSERT(upb_OneofDef_FieldCount(o) == 1);
+ return upb_Message_Has(msg, f) ? f : NULL;
} else {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
+ const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f);
uint32_t oneof_case = _upb_getoneofcase_field(msg, field);
- f = oneof_case ? upb_oneofdef_itof(o, oneof_case) : NULL;
+ f = oneof_case ? upb_OneofDef_LookupNumber(o, oneof_case) : NULL;
UPB_ASSERT((f != NULL) == (oneof_case != 0));
return f;
}
}
-upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f) {
- if (!upb_fielddef_haspresence(f) || upb_msg_has(msg, f)) {
- return _upb_msg_getraw(msg, f);
- } else {
- /* TODO(haberman): change upb_fielddef to not require this switch(). */
- upb_msgval val = {0};
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM:
- val.int32_val = upb_fielddef_defaultint32(f);
- break;
- case UPB_TYPE_INT64:
- val.int64_val = upb_fielddef_defaultint64(f);
- break;
- case UPB_TYPE_UINT32:
- val.uint32_val = upb_fielddef_defaultuint32(f);
- break;
- case UPB_TYPE_UINT64:
- val.uint64_val = upb_fielddef_defaultuint64(f);
- break;
- case UPB_TYPE_FLOAT:
- val.float_val = upb_fielddef_defaultfloat(f);
- break;
- case UPB_TYPE_DOUBLE:
- val.double_val = upb_fielddef_defaultdouble(f);
- break;
- case UPB_TYPE_BOOL:
- val.bool_val = upb_fielddef_defaultbool(f);
- break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
- val.str_val.data = upb_fielddef_defaultstr(f, &val.str_val.size);
- break;
- case UPB_TYPE_MESSAGE:
- val.msg_val = NULL;
- break;
+upb_MessageValue upb_Message_Get(const upb_Message* msg,
+ const upb_FieldDef* f) {
+ if (upb_FieldDef_IsExtension(f)) {
+ const upb_Message_Extension* ext =
+ _upb_Message_Getext(msg, _upb_FieldDef_ExtensionMiniTable(f));
+ if (ext) {
+ upb_MessageValue val;
+ memcpy(&val, &ext->data, sizeof(val));
+ return val;
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ return (upb_MessageValue){.array_val = NULL};
}
- return val;
+ } else if (!upb_FieldDef_HasPresence(f) || upb_Message_Has(msg, f)) {
+ return _upb_Message_Getraw(msg, f);
}
+ return upb_FieldDef_Default(f);
}
-upb_mutmsgval upb_msg_mutable(upb_msg *msg, const upb_fielddef *f,
- upb_arena *a) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- upb_mutmsgval ret;
- char *mem = UPB_PTR_AT(msg, field->offset, char);
- bool wrong_oneof =
- in_oneof(field) && _upb_getoneofcase_field(msg, field) != field->number;
-
- memcpy(&ret, mem, sizeof(void*));
-
- if (a && (!ret.msg || wrong_oneof)) {
- if (upb_fielddef_ismap(f)) {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key = upb_msgdef_itof(entry, UPB_MAPENTRY_KEY);
- const upb_fielddef *value = upb_msgdef_itof(entry, UPB_MAPENTRY_VALUE);
- ret.map = upb_map_new(a, upb_fielddef_type(key), upb_fielddef_type(value));
- } else if (upb_fielddef_isseq(f)) {
- ret.array = upb_array_new(a, upb_fielddef_type(f));
- } else {
- UPB_ASSERT(upb_fielddef_issubmsg(f));
- ret.msg = upb_msg_new(upb_fielddef_msgsubdef(f), a);
- }
+upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
+ const upb_FieldDef* f,
+ upb_Arena* a) {
+ UPB_ASSERT(upb_FieldDef_IsSubMessage(f) || upb_FieldDef_IsRepeated(f));
+ if (upb_FieldDef_HasPresence(f) && !upb_Message_Has(msg, f)) {
+ // We need to skip the upb_Message_Get() call in this case.
+ goto make;
+ }
- memcpy(mem, &ret, sizeof(void*));
+ upb_MessageValue val = upb_Message_Get(msg, f);
+ if (val.array_val) {
+ return (upb_MutableMessageValue){.array = (upb_Array*)val.array_val};
+ }
- if (wrong_oneof) {
- *_upb_oneofcase_field(msg, field) = field->number;
- } else if (field->presence > 0) {
- _upb_sethas_field(msg, field);
- }
+ upb_MutableMessageValue ret;
+make:
+ if (!a) return (upb_MutableMessageValue){.array = NULL};
+ if (upb_FieldDef_IsMap(f)) {
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_KeyFieldNumber);
+ const upb_FieldDef* value =
+ upb_MessageDef_FindFieldByNumber(entry, kUpb_MapEntry_ValueFieldNumber);
+ ret.map =
+ upb_Map_New(a, upb_FieldDef_CType(key), upb_FieldDef_CType(value));
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ ret.array = upb_Array_New(a, upb_FieldDef_CType(f));
+ } else {
+ UPB_ASSERT(upb_FieldDef_IsSubMessage(f));
+ ret.msg = upb_Message_New(upb_FieldDef_MessageSubDef(f), a);
}
+
+ val.array_val = ret.array;
+ upb_Message_Set(msg, f, val, a);
+
return ret;
}
-void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
- upb_arena *a) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- char *mem = UPB_PTR_AT(msg, field->offset, char);
- UPB_UNUSED(a); /* We reserve the right to make set insert into a map. */
- memcpy(mem, &val, get_field_size(field));
- if (field->presence > 0) {
- _upb_sethas_field(msg, field);
- } else if (in_oneof(field)) {
- *_upb_oneofcase_field(msg, field) = field->number;
+bool upb_Message_Set(upb_Message* msg, const upb_FieldDef* f,
+ upb_MessageValue val, upb_Arena* a) {
+ if (upb_FieldDef_IsExtension(f)) {
+ upb_Message_Extension* ext = _upb_Message_Getorcreateext(
+ msg, _upb_FieldDef_ExtensionMiniTable(f), a);
+ if (!ext) return false;
+ memcpy(&ext->data, &val, sizeof(val));
+ } else {
+ const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f);
+ char* mem = UPB_PTR_AT(msg, field->offset, char);
+ memcpy(mem, &val, get_field_size(field));
+ if (field->presence > 0) {
+ _upb_sethas_field(msg, field);
+ } else if (in_oneof(field)) {
+ *_upb_oneofcase_field(msg, field) = field->number;
+ }
}
+ return true;
}
-void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- char *mem = UPB_PTR_AT(msg, field->offset, char);
+void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f) {
+ if (upb_FieldDef_IsExtension(f)) {
+ _upb_Message_Clearext(msg, _upb_FieldDef_ExtensionMiniTable(f));
+ } else {
+ const upb_MiniTable_Field* field = upb_FieldDef_MiniTable(f);
+ char* mem = UPB_PTR_AT(msg, field->offset, char);
+
+ if (field->presence > 0) {
+ _upb_clearhas_field(msg, field);
+ } else if (in_oneof(field)) {
+ uint32_t* oneof_case = _upb_oneofcase_field(msg, field);
+ if (*oneof_case != field->number) return;
+ *oneof_case = 0;
+ }
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (in_oneof(field)) {
- uint32_t *oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
+ memset(mem, 0, get_field_size(field));
}
-
- memset(mem, 0, get_field_size(field));
}
-void upb_msg_clear(upb_msg *msg, const upb_msgdef *m) {
- _upb_msg_clear(msg, upb_msgdef_layout(m));
+void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m) {
+ _upb_Message_Clear(msg, upb_MessageDef_MiniTable(m));
}
-bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, const upb_fielddef **out_f,
- upb_msgval *out_val, size_t *iter) {
- int i = *iter;
- int n = upb_msgdef_fieldcount(m);
- const upb_msgval zero = {0};
+bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, const upb_FieldDef** out_f,
+ upb_MessageValue* out_val, size_t* iter) {
+ size_t i = *iter;
+ size_t n = upb_MessageDef_FieldCount(m);
+ const upb_MessageValue zero = {0};
UPB_UNUSED(ext_pool);
+
+ /* Iterate over normal fields, returning the first one that is set. */
while (++i < n) {
- const upb_fielddef *f = upb_msgdef_field(m, i);
- upb_msgval val = _upb_msg_getraw(msg, f);
+ const upb_FieldDef* f = upb_MessageDef_Field(m, i);
+ upb_MessageValue val = _upb_Message_Getraw(msg, f);
/* Skip field if unset or empty. */
- if (upb_fielddef_haspresence(f)) {
- if (!upb_msg_has(msg, f)) continue;
+ if (upb_FieldDef_HasPresence(f)) {
+ if (!upb_Message_Has(msg, f)) continue;
} else {
- upb_msgval test = val;
- if (upb_fielddef_isstring(f) && !upb_fielddef_isseq(f)) {
+ upb_MessageValue test = val;
+ if (upb_FieldDef_IsString(f) && !upb_FieldDef_IsRepeated(f)) {
/* Clear string pointer, only size matters (ptr could be non-NULL). */
test.str_val.data = NULL;
}
@@ -240,10 +268,10 @@ bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
if (memcmp(&test, &zero, sizeof(test)) == 0) continue;
/* Continue on empty array or map. */
- if (upb_fielddef_ismap(f)) {
- if (upb_map_size(test.map_val) == 0) continue;
- } else if (upb_fielddef_isseq(f)) {
- if (upb_array_size(test.array_val) == 0) continue;
+ if (upb_FieldDef_IsMap(f)) {
+ if (upb_Map_Size(test.map_val) == 0) continue;
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ if (upb_Array_Size(test.array_val) == 0) continue;
}
}
@@ -252,48 +280,66 @@ bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
*iter = i;
return true;
}
+
+ if (ext_pool) {
+ /* Return any extensions that are set. */
+ size_t count;
+ const upb_Message_Extension* ext = _upb_Message_Getexts(msg, &count);
+ if (i - n < count) {
+ ext += count - 1 - (i - n);
+ memcpy(out_val, &ext->data, sizeof(*out_val));
+ *out_f = _upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext);
+ *iter = i;
+ return true;
+ }
+ }
+
*iter = i;
return false;
}
-bool _upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int depth) {
- size_t iter = UPB_MSG_BEGIN;
- const upb_fielddef *f;
- upb_msgval val;
+bool _upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m,
+ int depth) {
+ size_t iter = kUpb_Message_Begin;
+ const upb_FieldDef* f;
+ upb_MessageValue val;
bool ret = true;
if (--depth == 0) return false;
- _upb_msg_discardunknown_shallow(msg);
+ _upb_Message_DiscardUnknown_shallow(msg);
- while (upb_msg_next(msg, m, NULL /*ext_pool*/, &f, &val, &iter)) {
- const upb_msgdef *subm = upb_fielddef_msgsubdef(f);
+ while (upb_Message_Next(msg, m, NULL /*ext_pool*/, &f, &val, &iter)) {
+ const upb_MessageDef* subm = upb_FieldDef_MessageSubDef(f);
if (!subm) continue;
- if (upb_fielddef_ismap(f)) {
- const upb_fielddef *val_f = upb_msgdef_itof(subm, 2);
- const upb_msgdef *val_m = upb_fielddef_msgsubdef(val_f);
- upb_map *map = (upb_map*)val.map_val;
- size_t iter = UPB_MAP_BEGIN;
+ if (upb_FieldDef_IsMap(f)) {
+ const upb_FieldDef* val_f = upb_MessageDef_FindFieldByNumber(subm, 2);
+ const upb_MessageDef* val_m = upb_FieldDef_MessageSubDef(val_f);
+ upb_Map* map = (upb_Map*)val.map_val;
+ size_t iter = kUpb_Map_Begin;
if (!val_m) continue;
- while (upb_mapiter_next(map, &iter)) {
- upb_msgval map_val = upb_mapiter_value(map, iter);
- if (!_upb_msg_discardunknown((upb_msg*)map_val.msg_val, val_m, depth)) {
+ while (upb_MapIterator_Next(map, &iter)) {
+ upb_MessageValue map_val = upb_MapIterator_Value(map, iter);
+ if (!_upb_Message_DiscardUnknown((upb_Message*)map_val.msg_val, val_m,
+ depth)) {
ret = false;
}
}
- } else if (upb_fielddef_isseq(f)) {
- const upb_array *arr = val.array_val;
- size_t i, n = upb_array_size(arr);
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ const upb_Array* arr = val.array_val;
+ size_t i, n = upb_Array_Size(arr);
for (i = 0; i < n; i++) {
- upb_msgval elem = upb_array_get(arr, i);
- if (!_upb_msg_discardunknown((upb_msg*)elem.msg_val, subm, depth)) {
+ upb_MessageValue elem = upb_Array_Get(arr, i);
+ if (!_upb_Message_DiscardUnknown((upb_Message*)elem.msg_val, subm,
+ depth)) {
ret = false;
}
}
} else {
- if (!_upb_msg_discardunknown((upb_msg*)val.msg_val, subm, depth)) {
+ if (!_upb_Message_DiscardUnknown((upb_Message*)val.msg_val, subm,
+ depth)) {
ret = false;
}
}
@@ -302,22 +348,21 @@ bool _upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int depth) {
return ret;
}
-bool upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int maxdepth) {
- return _upb_msg_discardunknown(msg, m, maxdepth);
+bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m,
+ int maxdepth) {
+ return _upb_Message_DiscardUnknown(msg, m, maxdepth);
}
-/** upb_array *****************************************************************/
+/** upb_Array *****************************************************************/
-upb_array *upb_array_new(upb_arena *a, upb_fieldtype_t type) {
- return _upb_array_new(a, 4, _upb_fieldtype_to_sizelg2[type]);
+upb_Array* upb_Array_New(upb_Arena* a, upb_CType type) {
+ return _upb_Array_New(a, 4, _upb_CTypeo_sizelg2[type]);
}
-size_t upb_array_size(const upb_array *arr) {
- return arr->len;
-}
+size_t upb_Array_Size(const upb_Array* arr) { return arr->len; }
-upb_msgval upb_array_get(const upb_array *arr, size_t i) {
- upb_msgval ret;
+upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i) {
+ upb_MessageValue ret;
const char* data = _upb_array_constptr(arr);
int lg2 = arr->data & 7;
UPB_ASSERT(i < arr->len);
@@ -325,84 +370,111 @@ upb_msgval upb_array_get(const upb_array *arr, size_t i) {
return ret;
}
-void upb_array_set(upb_array *arr, size_t i, upb_msgval val) {
+void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val) {
char* data = _upb_array_ptr(arr);
int lg2 = arr->data & 7;
UPB_ASSERT(i < arr->len);
memcpy(data + (i << lg2), &val, 1 << lg2);
}
-bool upb_array_append(upb_array *arr, upb_msgval val, upb_arena *arena) {
- if (!_upb_array_realloc(arr, arr->len + 1, arena)) {
+bool upb_Array_Append(upb_Array* arr, upb_MessageValue val, upb_Arena* arena) {
+ if (!upb_Array_Resize(arr, arr->len + 1, arena)) {
return false;
}
- arr->len++;
- upb_array_set(arr, arr->len - 1, val);
+ upb_Array_Set(arr, arr->len - 1, val);
return true;
}
-bool upb_array_resize(upb_array *arr, size_t size, upb_arena *arena) {
- return _upb_array_resize(arr, size, arena);
+void upb_Array_Move(upb_Array* arr, size_t dst_idx, size_t src_idx,
+ size_t count) {
+ char* data = _upb_array_ptr(arr);
+ int lg2 = arr->data & 7;
+ memmove(&data[dst_idx << lg2], &data[src_idx << lg2], count << lg2);
}
-/** upb_map *******************************************************************/
+bool upb_Array_Insert(upb_Array* arr, size_t i, size_t count,
+ upb_Arena* arena) {
+ UPB_ASSERT(i <= arr->len);
+ UPB_ASSERT(count + arr->len >= count);
+ size_t oldsize = arr->len;
+ if (!upb_Array_Resize(arr, arr->len + count, arena)) {
+ return false;
+ }
+ upb_Array_Move(arr, i + count, i, oldsize - i);
+ return true;
+}
-upb_map *upb_map_new(upb_arena *a, upb_fieldtype_t key_type,
- upb_fieldtype_t value_type) {
- return _upb_map_new(a, _upb_fieldtype_to_mapsize[key_type],
- _upb_fieldtype_to_mapsize[value_type]);
+/*
+ * i end arr->len
+ * |------------|XXXXXXXX|--------|
+ */
+void upb_Array_Delete(upb_Array* arr, size_t i, size_t count) {
+ size_t end = i + count;
+ UPB_ASSERT(i <= end);
+ UPB_ASSERT(end <= arr->len);
+ upb_Array_Move(arr, i, end, arr->len - end);
+ arr->len -= count;
}
-size_t upb_map_size(const upb_map *map) {
- return _upb_map_size(map);
+bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) {
+ return _upb_Array_Resize(arr, size, arena);
}
-bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val) {
- return _upb_map_get(map, &key, map->key_size, val, map->val_size);
+/** upb_Map *******************************************************************/
+
+upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, upb_CType value_type) {
+ return _upb_Map_New(a, _upb_CTypeo_mapsize[key_type],
+ _upb_CTypeo_mapsize[value_type]);
}
-void upb_map_clear(upb_map *map) {
- _upb_map_clear(map);
+size_t upb_Map_Size(const upb_Map* map) { return _upb_Map_Size(map); }
+
+bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
+ upb_MessageValue* val) {
+ return _upb_Map_Get(map, &key, map->key_size, val, map->val_size);
}
-bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
- upb_arena *arena) {
- return _upb_map_set(map, &key, map->key_size, &val, map->val_size, arena);
+void upb_Map_Clear(upb_Map* map) { _upb_Map_Clear(map); }
+
+bool upb_Map_Set(upb_Map* map, upb_MessageValue key, upb_MessageValue val,
+ upb_Arena* arena) {
+ return _upb_Map_Set(map, &key, map->key_size, &val, map->val_size, arena);
}
-bool upb_map_delete(upb_map *map, upb_msgval key) {
- return _upb_map_delete(map, &key, map->key_size);
+bool upb_Map_Delete(upb_Map* map, upb_MessageValue key) {
+ return _upb_Map_Delete(map, &key, map->key_size);
}
-bool upb_mapiter_next(const upb_map *map, size_t *iter) {
+bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) {
return _upb_map_next(map, iter);
}
-bool upb_mapiter_done(const upb_map *map, size_t iter) {
+bool upb_MapIterator_Done(const upb_Map* map, size_t iter) {
upb_strtable_iter i;
- UPB_ASSERT(iter != UPB_MAP_BEGIN);
+ UPB_ASSERT(iter != kUpb_Map_Begin);
i.t = &map->table;
i.index = iter;
return upb_strtable_done(&i);
}
/* Returns the key and value for this entry of the map. */
-upb_msgval upb_mapiter_key(const upb_map *map, size_t iter) {
+upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter) {
upb_strtable_iter i;
- upb_msgval ret;
+ upb_MessageValue ret;
i.t = &map->table;
i.index = iter;
_upb_map_fromkey(upb_strtable_iter_key(&i), &ret, map->key_size);
return ret;
}
-upb_msgval upb_mapiter_value(const upb_map *map, size_t iter) {
+upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter) {
upb_strtable_iter i;
- upb_msgval ret;
+ upb_MessageValue ret;
i.t = &map->table;
i.index = iter;
_upb_map_fromvalue(upb_strtable_iter_value(&i), &ret, map->val_size);
return ret;
}
-/* void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value); */
+/* void upb_MapIterator_SetValue(upb_Map *map, size_t iter, upb_MessageValue
+ * value); */
diff --git a/grpc/third_party/upb/upb/reflection.h b/grpc/third_party/upb/upb/reflection.h
index 0133630c..b892f66b 100644
--- a/grpc/third_party/upb/upb/reflection.h
+++ b/grpc/third_party/upb/upb/reflection.h
@@ -1,12 +1,41 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_REFLECTION_H_
#define UPB_REFLECTION_H_
#include "upb/def.h"
#include "upb/msg.h"
+#include "upb/port_def.inc"
#include "upb/upb.h"
-#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef union {
bool bool_val;
@@ -16,55 +45,63 @@ typedef union {
int64_t int64_val;
uint32_t uint32_val;
uint64_t uint64_val;
- const upb_map* map_val;
- const upb_msg* msg_val;
- const upb_array* array_val;
- upb_strview str_val;
-} upb_msgval;
+ const upb_Map* map_val;
+ const upb_Message* msg_val;
+ const upb_Array* array_val;
+ upb_StringView str_val;
+} upb_MessageValue;
typedef union {
- upb_map* map;
- upb_msg* msg;
- upb_array* array;
-} upb_mutmsgval;
+ upb_Map* map;
+ upb_Message* msg;
+ upb_Array* array;
+} upb_MutableMessageValue;
+
+upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f);
-/** upb_msg *******************************************************************/
+/** upb_Message
+ * *******************************************************************/
/* Creates a new message of the given type in the given arena. */
-upb_msg *upb_msg_new(const upb_msgdef *m, upb_arena *a);
+upb_Message* upb_Message_New(const upb_MessageDef* m, upb_Arena* a);
/* Returns the value associated with this field. */
-upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f);
+upb_MessageValue upb_Message_Get(const upb_Message* msg, const upb_FieldDef* f);
/* Returns a mutable pointer to a map, array, or submessage value. If the given
* arena is non-NULL this will construct a new object if it was not previously
* present. May not be called for primitive fields. */
-upb_mutmsgval upb_msg_mutable(upb_msg *msg, const upb_fielddef *f, upb_arena *a);
+upb_MutableMessageValue upb_Message_Mutable(upb_Message* msg,
+ const upb_FieldDef* f,
+ upb_Arena* a);
-/* May only be called for fields where upb_fielddef_haspresence(f) == true. */
-bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f);
+/* May only be called for fields where upb_FieldDef_HasPresence(f) == true. */
+bool upb_Message_Has(const upb_Message* msg, const upb_FieldDef* f);
/* Returns the field that is set in the oneof, or NULL if none are set. */
-const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg,
- const upb_oneofdef *o);
+const upb_FieldDef* upb_Message_WhichOneof(const upb_Message* msg,
+ const upb_OneofDef* o);
/* Sets the given field to the given value. For a msg/array/map/string, the
- * value must be in the same arena. */
-void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
- upb_arena *a);
+ * caller must ensure that the target data outlives |msg| (by living either in
+ * the same arena or a different arena that outlives it).
+ *
+ * Returns false if allocation fails. */
+bool upb_Message_Set(upb_Message* msg, const upb_FieldDef* f,
+ upb_MessageValue val, upb_Arena* a);
/* Clears any field presence and sets the value back to its default. */
-void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f);
+void upb_Message_ClearField(upb_Message* msg, const upb_FieldDef* f);
/* Clear all data and unknown fields. */
-void upb_msg_clear(upb_msg *msg, const upb_msgdef *m);
+void upb_Message_Clear(upb_Message* msg, const upb_MessageDef* m);
/* Iterate over present fields.
*
- * size_t iter = UPB_MSG_BEGIN;
- * const upb_fielddef *f;
- * upb_msgval val;
- * while (upb_msg_next(msg, m, ext_pool, &f, &val, &iter)) {
+ * size_t iter = kUpb_Message_Begin;
+ * const upb_FieldDef *f;
+ * upb_MessageValue val;
+ * while (upb_Message_Next(msg, m, ext_pool, &f, &val, &iter)) {
* process_field(f, val);
* }
*
@@ -73,95 +110,110 @@ void upb_msg_clear(upb_msg *msg, const upb_msgdef *m);
* will be skipped.
*/
-#define UPB_MSG_BEGIN -1
-bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, const upb_fielddef **f,
- upb_msgval *val, size_t *iter);
-
-/* Adds unknown data (serialized protobuf data) to the given message. The data
- * is copied into the message instance. */
-void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
- upb_arena *arena);
+#define kUpb_Message_Begin -1
+bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, const upb_FieldDef** f,
+ upb_MessageValue* val, size_t* iter);
/* Clears all unknown field data from this message and all submessages. */
-bool upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int maxdepth);
-
-/* Returns a reference to the message's unknown data. */
-const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
+bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m,
+ int maxdepth);
-/** upb_array *****************************************************************/
+/** upb_Array *****************************************************************/
/* Creates a new array on the given arena that holds elements of this type. */
-upb_array *upb_array_new(upb_arena *a, upb_fieldtype_t type);
+upb_Array* upb_Array_New(upb_Arena* a, upb_CType type);
/* Returns the size of the array. */
-size_t upb_array_size(const upb_array *arr);
+size_t upb_Array_Size(const upb_Array* arr);
/* Returns the given element, which must be within the array's current size. */
-upb_msgval upb_array_get(const upb_array *arr, size_t i);
+upb_MessageValue upb_Array_Get(const upb_Array* arr, size_t i);
/* Sets the given element, which must be within the array's current size. */
-void upb_array_set(upb_array *arr, size_t i, upb_msgval val);
+void upb_Array_Set(upb_Array* arr, size_t i, upb_MessageValue val);
/* Appends an element to the array. Returns false on allocation failure. */
-bool upb_array_append(upb_array *array, upb_msgval val, upb_arena *arena);
+bool upb_Array_Append(upb_Array* array, upb_MessageValue val, upb_Arena* arena);
+
+/* Moves elements within the array using memmove(). Like memmove(), the source
+ * and destination elements may be overlapping. */
+void upb_Array_Move(upb_Array* array, size_t dst_idx, size_t src_idx,
+ size_t count);
+
+/* Inserts one or more empty elements into the array. Existing elements are
+ * shifted right. The new elements have undefined state and must be set with
+ * `upb_Array_Set()`.
+ * REQUIRES: `i <= upb_Array_Size(arr)` */
+bool upb_Array_Insert(upb_Array* array, size_t i, size_t count,
+ upb_Arena* arena);
+
+/* Deletes one or more elements from the array. Existing elements are shifted
+ * left.
+ * REQUIRES: `i + count <= upb_Array_Size(arr)` */
+void upb_Array_Delete(upb_Array* array, size_t i, size_t count);
/* Changes the size of a vector. New elements are initialized to empty/0.
* Returns false on allocation failure. */
-bool upb_array_resize(upb_array *array, size_t size, upb_arena *arena);
+bool upb_Array_Resize(upb_Array* array, size_t size, upb_Arena* arena);
-/** upb_map *******************************************************************/
+/** upb_Map *******************************************************************/
/* Creates a new map on the given arena with the given key/value size. */
-upb_map *upb_map_new(upb_arena *a, upb_fieldtype_t key_type,
- upb_fieldtype_t value_type);
+upb_Map* upb_Map_New(upb_Arena* a, upb_CType key_type, upb_CType value_type);
/* Returns the number of entries in the map. */
-size_t upb_map_size(const upb_map *map);
+size_t upb_Map_Size(const upb_Map* map);
/* Stores a value for the given key into |*val| (or the zero value if the key is
* not present). Returns whether the key was present. The |val| pointer may be
* NULL, in which case the function tests whether the given key is present. */
-bool upb_map_get(const upb_map *map, upb_msgval key, upb_msgval *val);
+bool upb_Map_Get(const upb_Map* map, upb_MessageValue key,
+ upb_MessageValue* val);
/* Removes all entries in the map. */
-void upb_map_clear(upb_map *map);
+void upb_Map_Clear(upb_Map* map);
/* Sets the given key to the given value. Returns true if this was a new key in
* the map, or false if an existing key was replaced. */
-bool upb_map_set(upb_map *map, upb_msgval key, upb_msgval val,
- upb_arena *arena);
+bool upb_Map_Set(upb_Map* map, upb_MessageValue key, upb_MessageValue val,
+ upb_Arena* arena);
/* Deletes this key from the table. Returns true if the key was present. */
-bool upb_map_delete(upb_map *map, upb_msgval key);
+bool upb_Map_Delete(upb_Map* map, upb_MessageValue key);
/* Map iteration:
*
- * size_t iter = UPB_MAP_BEGIN;
- * while (upb_mapiter_next(map, &iter)) {
- * upb_msgval key = upb_mapiter_key(map, iter);
- * upb_msgval val = upb_mapiter_value(map, iter);
+ * size_t iter = kUpb_Map_Begin;
+ * while (upb_MapIterator_Next(map, &iter)) {
+ * upb_MessageValue key = upb_MapIterator_Key(map, iter);
+ * upb_MessageValue val = upb_MapIterator_Value(map, iter);
*
* // If mutating is desired.
- * upb_mapiter_setvalue(map, iter, value2);
+ * upb_MapIterator_SetValue(map, iter, value2);
* }
*/
/* Advances to the next entry. Returns false if no more entries are present. */
-bool upb_mapiter_next(const upb_map *map, size_t *iter);
+bool upb_MapIterator_Next(const upb_Map* map, size_t* iter);
/* Returns true if the iterator still points to a valid entry, or false if the
* iterator is past the last element. It is an error to call this function with
- * UPB_MAP_BEGIN (you must call next() at least once first). */
-bool upb_mapiter_done(const upb_map *map, size_t iter);
+ * kUpb_Map_Begin (you must call next() at least once first). */
+bool upb_MapIterator_Done(const upb_Map* map, size_t iter);
/* Returns the key and value for this entry of the map. */
-upb_msgval upb_mapiter_key(const upb_map *map, size_t iter);
-upb_msgval upb_mapiter_value(const upb_map *map, size_t iter);
+upb_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter);
+upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter);
/* Sets the value for this entry. The iterator must not be done, and the
* iterator must not have been initialized const. */
-void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value);
+void upb_MapIterator_SetValue(upb_Map* map, size_t iter,
+ upb_MessageValue value);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#include "upb/port_undef.inc"
diff --git a/grpc/third_party/upb/upb/reflection.hpp b/grpc/third_party/upb/upb/reflection.hpp
new file mode 100644
index 00000000..b653893c
--- /dev/null
+++ b/grpc/third_party/upb/upb/reflection.hpp
@@ -0,0 +1,37 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef UPB_REFLECTION_HPP_
+#define UPB_REFLECTION_HPP_
+
+#include "upb/reflection.h"
+
+namespace upb {
+
+typedef upb_MessageValue MessageValue;
+
+} // namespace upb
+
+#endif // UPB_REFLECTION_HPP_
diff --git a/grpc/third_party/upb/upb/sink.c b/grpc/third_party/upb/upb/sink.c
deleted file mode 100644
index d55d258b..00000000
--- a/grpc/third_party/upb/upb/sink.c
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#include "upb/sink.h"
-
-bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink sink) {
- void *subc;
- bool ret;
- upb_bufhandle handle = UPB_BUFHANDLE_INIT;
- handle.buf = buf;
- ret = upb_bytessink_start(sink, len, &subc);
- if (ret && len != 0) {
- ret = (upb_bytessink_putbuf(sink, subc, buf, len, &handle) >= len);
- }
- if (ret) {
- ret = upb_bytessink_end(sink);
- }
- return ret;
-}
diff --git a/grpc/third_party/upb/upb/sink.h b/grpc/third_party/upb/upb/sink.h
deleted file mode 100644
index 871a8f57..00000000
--- a/grpc/third_party/upb/upb/sink.h
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
-** upb::Sink (upb_sink)
-** upb::BytesSink (upb_bytessink)
-**
-** A upb_sink is an object that binds a upb_handlers object to some runtime
-** state. It is the object that can actually receive data via the upb_handlers
-** interface.
-**
-** Unlike upb_def and upb_handlers, upb_sink is never frozen, immutable, or
-** thread-safe. You can create as many of them as you want, but each one may
-** only be used in a single thread at a time.
-**
-** If we compare with class-based OOP, a you can think of a upb_def as an
-** abstract base class, a upb_handlers as a concrete derived class, and a
-** upb_sink as an object (class instance).
-*/
-
-#ifndef UPB_SINK_H
-#define UPB_SINK_H
-
-#include "upb/handlers.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-namespace upb {
-class BytesSink;
-class Sink;
-}
-#endif
-
-/* upb_sink *******************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
- const upb_handlers *handlers;
- void *closure;
-} upb_sink;
-
-#define PUTVAL(type, ctype) \
- UPB_INLINE bool upb_sink_put##type(upb_sink s, upb_selector_t sel, \
- ctype val) { \
- typedef upb_##type##_handlerfunc functype; \
- functype *func; \
- const void *hd; \
- if (!s.handlers) return true; \
- func = (functype *)upb_handlers_gethandler(s.handlers, sel, &hd); \
- if (!func) return true; \
- return func(s.closure, hd, val); \
- }
-
-PUTVAL(int32, int32_t)
-PUTVAL(int64, int64_t)
-PUTVAL(uint32, uint32_t)
-PUTVAL(uint64, uint64_t)
-PUTVAL(float, float)
-PUTVAL(double, double)
-PUTVAL(bool, bool)
-#undef PUTVAL
-
-UPB_INLINE void upb_sink_reset(upb_sink *s, const upb_handlers *h, void *c) {
- s->handlers = h;
- s->closure = c;
-}
-
-UPB_INLINE size_t upb_sink_putstring(upb_sink s, upb_selector_t sel,
- const char *buf, size_t n,
- const upb_bufhandle *handle) {
- typedef upb_string_handlerfunc func;
- func *handler;
- const void *hd;
- if (!s.handlers) return n;
- handler = (func *)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!handler) return n;
- return handler(s.closure, hd, buf, n, handle);
-}
-
-UPB_INLINE bool upb_sink_putunknown(upb_sink s, const char *buf, size_t n) {
- typedef upb_unknown_handlerfunc func;
- func *handler;
- const void *hd;
- if (!s.handlers) return true;
- handler =
- (func *)upb_handlers_gethandler(s.handlers, UPB_UNKNOWN_SELECTOR, &hd);
-
- if (!handler) return n;
- return handler(s.closure, hd, buf, n);
-}
-
-UPB_INLINE bool upb_sink_startmsg(upb_sink s) {
- typedef upb_startmsg_handlerfunc func;
- func *startmsg;
- const void *hd;
- if (!s.handlers) return true;
- startmsg =
- (func *)upb_handlers_gethandler(s.handlers, UPB_STARTMSG_SELECTOR, &hd);
-
- if (!startmsg) return true;
- return startmsg(s.closure, hd);
-}
-
-UPB_INLINE bool upb_sink_endmsg(upb_sink s, upb_status *status) {
- typedef upb_endmsg_handlerfunc func;
- func *endmsg;
- const void *hd;
- if (!s.handlers) return true;
- endmsg =
- (func *)upb_handlers_gethandler(s.handlers, UPB_ENDMSG_SELECTOR, &hd);
-
- if (!endmsg) return true;
- return endmsg(s.closure, hd, status);
-}
-
-UPB_INLINE bool upb_sink_startseq(upb_sink s, upb_selector_t sel,
- upb_sink *sub) {
- typedef upb_startfield_handlerfunc func;
- func *startseq;
- const void *hd;
- sub->closure = s.closure;
- sub->handlers = s.handlers;
- if (!s.handlers) return true;
- startseq = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!startseq) return true;
- sub->closure = startseq(s.closure, hd);
- return sub->closure ? true : false;
-}
-
-UPB_INLINE bool upb_sink_endseq(upb_sink s, upb_selector_t sel) {
- typedef upb_endfield_handlerfunc func;
- func *endseq;
- const void *hd;
- if (!s.handlers) return true;
- endseq = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!endseq) return true;
- return endseq(s.closure, hd);
-}
-
-UPB_INLINE bool upb_sink_startstr(upb_sink s, upb_selector_t sel,
- size_t size_hint, upb_sink *sub) {
- typedef upb_startstr_handlerfunc func;
- func *startstr;
- const void *hd;
- sub->closure = s.closure;
- sub->handlers = s.handlers;
- if (!s.handlers) return true;
- startstr = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!startstr) return true;
- sub->closure = startstr(s.closure, hd, size_hint);
- return sub->closure ? true : false;
-}
-
-UPB_INLINE bool upb_sink_endstr(upb_sink s, upb_selector_t sel) {
- typedef upb_endfield_handlerfunc func;
- func *endstr;
- const void *hd;
- if (!s.handlers) return true;
- endstr = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!endstr) return true;
- return endstr(s.closure, hd);
-}
-
-UPB_INLINE bool upb_sink_startsubmsg(upb_sink s, upb_selector_t sel,
- upb_sink *sub) {
- typedef upb_startfield_handlerfunc func;
- func *startsubmsg;
- const void *hd;
- sub->closure = s.closure;
- if (!s.handlers) {
- sub->handlers = NULL;
- return true;
- }
- sub->handlers = upb_handlers_getsubhandlers_sel(s.handlers, sel);
- startsubmsg = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!startsubmsg) return true;
- sub->closure = startsubmsg(s.closure, hd);
- return sub->closure ? true : false;
-}
-
-UPB_INLINE bool upb_sink_endsubmsg(upb_sink s, upb_sink sub,
- upb_selector_t sel) {
- typedef upb_endfield_handlerfunc func;
- func *endsubmsg;
- const void *hd;
- if (!s.handlers) return true;
- endsubmsg = (func*)upb_handlers_gethandler(s.handlers, sel, &hd);
-
- if (!endsubmsg) return true;
- return endsubmsg(sub.closure, hd);
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-/* A upb::Sink is an object that binds a upb::Handlers object to some runtime
- * state. It represents an endpoint to which data can be sent.
- *
- * TODO(haberman): right now all of these functions take selectors. Should they
- * take selectorbase instead?
- *
- * ie. instead of calling:
- * sink->StartString(FOO_FIELD_START_STRING, ...)
- * a selector base would let you say:
- * sink->StartString(FOO_FIELD, ...)
- *
- * This would make call sites a little nicer and require emitting fewer selector
- * definitions in .h files.
- *
- * But the current scheme has the benefit that you can retrieve a function
- * pointer for any handler with handlers->GetHandler(selector), without having
- * to have a separate GetHandler() function for each handler type. The JIT
- * compiler uses this. To accommodate we'd have to expose a separate
- * GetHandler() for every handler type.
- *
- * Also to ponder: selectors right now are independent of a specific Handlers
- * instance. In other words, they allocate a number to every possible handler
- * that *could* be registered, without knowing anything about what handlers
- * *are* registered. That means that using selectors as table offsets prohibits
- * us from compacting the handler table at Freeze() time. If the table is very
- * sparse, this could be wasteful.
- *
- * Having another selector-like thing that is specific to a Handlers instance
- * would allow this compacting, but then it would be impossible to write code
- * ahead-of-time that can be bound to any Handlers instance at runtime. For
- * example, a .proto file parser written as straight C will not know what
- * Handlers it will be bound to, so when it calls sink->StartString() what
- * selector will it pass? It needs a selector like we have today, that is
- * independent of any particular upb::Handlers.
- *
- * Is there a way then to allow Handlers table compaction? */
-class upb::Sink {
- public:
- /* Constructor with no initialization; must be Reset() before use. */
- Sink() {}
-
- Sink(const Sink&) = default;
- Sink& operator=(const Sink&) = default;
-
- Sink(const upb_sink& sink) : sink_(sink) {}
- Sink &operator=(const upb_sink &sink) {
- sink_ = sink;
- return *this;
- }
-
- upb_sink sink() { return sink_; }
-
- /* Constructs a new sink for the given frozen handlers and closure.
- *
- * TODO: once the Handlers know the expected closure type, verify that T
- * matches it. */
- template <class T> Sink(const upb_handlers* handlers, T* closure) {
- Reset(handlers, closure);
- }
-
- upb_sink* ptr() { return &sink_; }
-
- /* Resets the value of the sink. */
- template <class T> void Reset(const upb_handlers* handlers, T* closure) {
- upb_sink_reset(&sink_, handlers, closure);
- }
-
- /* Returns the top-level object that is bound to this sink.
- *
- * TODO: once the Handlers know the expected closure type, verify that T
- * matches it. */
- template <class T> T* GetObject() const {
- return static_cast<T*>(sink_.closure);
- }
-
- /* Functions for pushing data into the sink.
- *
- * These return false if processing should stop (either due to error or just
- * to suspend).
- *
- * These may not be called from within one of the same sink's handlers (in
- * other words, handlers are not re-entrant). */
-
- /* Should be called at the start and end of every message; both the top-level
- * message and submessages. This means that submessages should use the
- * following sequence:
- * sink->StartSubMessage(startsubmsg_selector);
- * sink->StartMessage();
- * // ...
- * sink->EndMessage(&status);
- * sink->EndSubMessage(endsubmsg_selector); */
- bool StartMessage() { return upb_sink_startmsg(sink_); }
- bool EndMessage(upb_status *status) {
- return upb_sink_endmsg(sink_, status);
- }
-
- /* Putting of individual values. These work for both repeated and
- * non-repeated fields, but for repeated fields you must wrap them in
- * calls to StartSequence()/EndSequence(). */
- bool PutInt32(HandlersPtr::Selector s, int32_t val) {
- return upb_sink_putint32(sink_, s, val);
- }
-
- bool PutInt64(HandlersPtr::Selector s, int64_t val) {
- return upb_sink_putint64(sink_, s, val);
- }
-
- bool PutUInt32(HandlersPtr::Selector s, uint32_t val) {
- return upb_sink_putuint32(sink_, s, val);
- }
-
- bool PutUInt64(HandlersPtr::Selector s, uint64_t val) {
- return upb_sink_putuint64(sink_, s, val);
- }
-
- bool PutFloat(HandlersPtr::Selector s, float val) {
- return upb_sink_putfloat(sink_, s, val);
- }
-
- bool PutDouble(HandlersPtr::Selector s, double val) {
- return upb_sink_putdouble(sink_, s, val);
- }
-
- bool PutBool(HandlersPtr::Selector s, bool val) {
- return upb_sink_putbool(sink_, s, val);
- }
-
- /* Putting of string/bytes values. Each string can consist of zero or more
- * non-contiguous buffers of data.
- *
- * For StartString(), the function will write a sink for the string to "sub."
- * The sub-sink must be used for any/all PutStringBuffer() calls. */
- bool StartString(HandlersPtr::Selector s, size_t size_hint, Sink* sub) {
- upb_sink sub_c;
- bool ret = upb_sink_startstr(sink_, s, size_hint, &sub_c);
- *sub = sub_c;
- return ret;
- }
-
- size_t PutStringBuffer(HandlersPtr::Selector s, const char *buf, size_t len,
- const upb_bufhandle *handle) {
- return upb_sink_putstring(sink_, s, buf, len, handle);
- }
-
- bool EndString(HandlersPtr::Selector s) {
- return upb_sink_endstr(sink_, s);
- }
-
- /* For submessage fields.
- *
- * For StartSubMessage(), the function will write a sink for the string to
- * "sub." The sub-sink must be used for any/all handlers called within the
- * submessage. */
- bool StartSubMessage(HandlersPtr::Selector s, Sink* sub) {
- upb_sink sub_c;
- bool ret = upb_sink_startsubmsg(sink_, s, &sub_c);
- *sub = sub_c;
- return ret;
- }
-
- bool EndSubMessage(HandlersPtr::Selector s, Sink sub) {
- return upb_sink_endsubmsg(sink_, sub.sink_, s);
- }
-
- /* For repeated fields of any type, the sequence of values must be wrapped in
- * these calls.
- *
- * For StartSequence(), the function will write a sink for the string to
- * "sub." The sub-sink must be used for any/all handlers called within the
- * sequence. */
- bool StartSequence(HandlersPtr::Selector s, Sink* sub) {
- upb_sink sub_c;
- bool ret = upb_sink_startseq(sink_, s, &sub_c);
- *sub = sub_c;
- return ret;
- }
-
- bool EndSequence(HandlersPtr::Selector s) {
- return upb_sink_endseq(sink_, s);
- }
-
- /* Copy and assign specifically allowed.
- * We don't even bother making these members private because so many
- * functions need them and this is mainly just a dumb data container anyway.
- */
-
- private:
- upb_sink sink_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_bytessink **************************************************************/
-
-typedef struct {
- const upb_byteshandler *handler;
- void *closure;
-} upb_bytessink ;
-
-UPB_INLINE void upb_bytessink_reset(upb_bytessink* s, const upb_byteshandler *h,
- void *closure) {
- s->handler = h;
- s->closure = closure;
-}
-
-UPB_INLINE bool upb_bytessink_start(upb_bytessink s, size_t size_hint,
- void **subc) {
- typedef upb_startstr_handlerfunc func;
- func *start;
- *subc = s.closure;
- if (!s.handler) return true;
- start = (func *)s.handler->table[UPB_STARTSTR_SELECTOR].func;
-
- if (!start) return true;
- *subc = start(s.closure,
- s.handler->table[UPB_STARTSTR_SELECTOR].attr.handler_data,
- size_hint);
- return *subc != NULL;
-}
-
-UPB_INLINE size_t upb_bytessink_putbuf(upb_bytessink s, void *subc,
- const char *buf, size_t size,
- const upb_bufhandle* handle) {
- typedef upb_string_handlerfunc func;
- func *putbuf;
- if (!s.handler) return true;
- putbuf = (func *)s.handler->table[UPB_STRING_SELECTOR].func;
-
- if (!putbuf) return true;
- return putbuf(subc, s.handler->table[UPB_STRING_SELECTOR].attr.handler_data,
- buf, size, handle);
-}
-
-UPB_INLINE bool upb_bytessink_end(upb_bytessink s) {
- typedef upb_endfield_handlerfunc func;
- func *end;
- if (!s.handler) return true;
- end = (func *)s.handler->table[UPB_ENDSTR_SELECTOR].func;
-
- if (!end) return true;
- return end(s.closure,
- s.handler->table[UPB_ENDSTR_SELECTOR].attr.handler_data);
-}
-
-#ifdef __cplusplus
-
-class upb::BytesSink {
- public:
- BytesSink() {}
-
- BytesSink(const BytesSink&) = default;
- BytesSink& operator=(const BytesSink&) = default;
-
- BytesSink(const upb_bytessink& sink) : sink_(sink) {}
- BytesSink &operator=(const upb_bytessink &sink) {
- sink_ = sink;
- return *this;
- }
-
- upb_bytessink sink() { return sink_; }
-
- /* Constructs a new sink for the given frozen handlers and closure.
- *
- * TODO(haberman): once the Handlers know the expected closure type, verify
- * that T matches it. */
- template <class T> BytesSink(const upb_byteshandler* handler, T* closure) {
- upb_bytessink_reset(sink_, handler, closure);
- }
-
- /* Resets the value of the sink. */
- template <class T> void Reset(const upb_byteshandler* handler, T* closure) {
- upb_bytessink_reset(&sink_, handler, closure);
- }
-
- bool Start(size_t size_hint, void **subc) {
- return upb_bytessink_start(sink_, size_hint, subc);
- }
-
- size_t PutBuffer(void *subc, const char *buf, size_t len,
- const upb_bufhandle *handle) {
- return upb_bytessink_putbuf(sink_, subc, buf, len, handle);
- }
-
- bool End() {
- return upb_bytessink_end(sink_);
- }
-
- private:
- upb_bytessink sink_;
-};
-
-#endif /* __cplusplus */
-
-/* upb_bufsrc *****************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-bool upb_bufsrc_putbuf(const char *buf, size_t len, upb_bytessink sink);
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-namespace upb {
-template <class T> bool PutBuffer(const T& str, BytesSink sink) {
- return upb_bufsrc_putbuf(str.data(), str.size(), sink.sink());
-}
-}
-
-#endif /* __cplusplus */
-
-#include "upb/port_undef.inc"
-
-#endif
diff --git a/grpc/third_party/upb/upb/table.c b/grpc/third_party/upb/upb/table.c
index 88370476..941f2584 100644
--- a/grpc/third_party/upb/upb/table.c
+++ b/grpc/third_party/upb/upb/table.c
@@ -1,22 +1,48 @@
/*
-** upb_table Implementation
-**
-** Implementation is heavily inspired by Lua's ltable.c.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_table Implementation
+ *
+ * Implementation is heavily inspired by Lua's ltable.c.
+ */
#include <string.h>
-#include "third_party/wyhash/wyhash.h"
-#include "upb/table.int.h"
+#include "upb/table_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
-#define UPB_MAXARRSIZE 16 /* 64k. */
+#define UPB_MAXARRSIZE 16 /* 64k. */
/* From Chromium. */
#define ARRAY_SIZE(x) \
- ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
+ ((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x])))))
static const double MAX_LOAD = 0.85;
@@ -25,30 +51,32 @@ static const double MAX_LOAD = 0.85;
* cache effects). The lower this is, the more memory we'll use. */
static const double MIN_DENSITY = 0.1;
-bool is_pow2(uint64_t v) { return v == 0 || (v & (v - 1)) == 0; }
+static bool is_pow2(uint64_t v) { return v == 0 || (v & (v - 1)) == 0; }
+
+static upb_value _upb_value_val(uint64_t val) {
+ upb_value ret;
+ _upb_value_setval(&ret, val);
+ return ret;
+}
-int log2ceil(uint64_t v) {
+static int log2ceil(uint64_t v) {
int ret = 0;
bool pow2 = is_pow2(v);
while (v >>= 1) ret++;
- ret = pow2 ? ret : ret + 1; /* Ceiling. */
+ ret = pow2 ? ret : ret + 1; /* Ceiling. */
return UPB_MIN(UPB_MAXARRSIZE, ret);
}
-char *upb_strdup(const char *s, upb_alloc *a) {
- return upb_strdup2(s, strlen(s), a);
-}
-
-char *upb_strdup2(const char *s, size_t len, upb_alloc *a) {
+char* upb_strdup2(const char* s, size_t len, upb_Arena* a) {
size_t n;
- char *p;
+ char* p;
/* Prevent overflow errors. */
if (len == SIZE_MAX) return NULL;
/* Always null-terminate, even if binary data; but don't rely on the input to
* have a null-terminating byte since it may be a raw binary buffer. */
n = len + 1;
- p = upb_malloc(a, n);
+ p = upb_Arena_Malloc(a, n);
if (p) {
memcpy(p, s, len);
p[len] = 0;
@@ -60,12 +88,12 @@ char *upb_strdup2(const char *s, size_t len, upb_alloc *a) {
typedef union {
uintptr_t num;
struct {
- const char *str;
+ const char* str;
size_t len;
} str;
} lookupkey_t;
-static lookupkey_t strkey2(const char *str, size_t len) {
+static lookupkey_t strkey2(const char* str, size_t len) {
lookupkey_t k;
k.str.str = str;
k.str.len = len;
@@ -83,16 +111,17 @@ typedef bool eqlfunc_t(upb_tabkey k1, lookupkey_t k2);
/* Base table (shared code) ***************************************************/
-/* For when we need to cast away const. */
-static upb_tabent *mutable_entries(upb_table *t) {
- return (upb_tabent*)t->entries;
-}
+static uint32_t upb_inthash(uintptr_t key) { return (uint32_t)key; }
-static bool isfull(upb_table *t) {
- return t->count == t->max_count;
+static const upb_tabent* upb_getentry(const upb_table* t, uint32_t hash) {
+ return t->entries + (hash & t->mask);
}
-static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) {
+static bool upb_arrhas(upb_tabval key) { return key.val != (uint64_t)-1; }
+
+static bool isfull(upb_table* t) { return t->count == t->max_count; }
+
+static bool init(upb_table* t, uint8_t size_lg2, upb_Arena* a) {
size_t bytes;
t->count = 0;
@@ -101,22 +130,18 @@ static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) {
t->max_count = upb_table_size(t) * MAX_LOAD;
bytes = upb_table_size(t) * sizeof(upb_tabent);
if (bytes > 0) {
- t->entries = upb_malloc(a, bytes);
+ t->entries = upb_Arena_Malloc(a, bytes);
if (!t->entries) return false;
- memset(mutable_entries(t), 0, bytes);
+ memset(t->entries, 0, bytes);
} else {
t->entries = NULL;
}
return true;
}
-static void uninit(upb_table *t, upb_alloc *a) {
- upb_free(a, mutable_entries(t));
-}
-
-static upb_tabent *emptyent(upb_table *t, upb_tabent *e) {
- upb_tabent *begin = mutable_entries(t);
- upb_tabent *end = begin + upb_table_size(t);
+static upb_tabent* emptyent(upb_table* t, upb_tabent* e) {
+ upb_tabent* begin = t->entries;
+ upb_tabent* end = begin + upb_table_size(t);
for (e = e + 1; e < end; e++) {
if (upb_tabent_isempty(e)) return e;
}
@@ -127,13 +152,13 @@ static upb_tabent *emptyent(upb_table *t, upb_tabent *e) {
return NULL;
}
-static upb_tabent *getentry_mutable(upb_table *t, uint32_t hash) {
+static upb_tabent* getentry_mutable(upb_table* t, uint32_t hash) {
return (upb_tabent*)upb_getentry(t, hash);
}
-static const upb_tabent *findentry(const upb_table *t, lookupkey_t key,
- uint32_t hash, eqlfunc_t *eql) {
- const upb_tabent *e;
+static const upb_tabent* findentry(const upb_table* t, lookupkey_t key,
+ uint32_t hash, eqlfunc_t* eql) {
+ const upb_tabent* e;
if (t->size_lg2 == 0) return NULL;
e = upb_getentry(t, hash);
@@ -144,14 +169,14 @@ static const upb_tabent *findentry(const upb_table *t, lookupkey_t key,
}
}
-static upb_tabent *findentry_mutable(upb_table *t, lookupkey_t key,
- uint32_t hash, eqlfunc_t *eql) {
+static upb_tabent* findentry_mutable(upb_table* t, lookupkey_t key,
+ uint32_t hash, eqlfunc_t* eql) {
return (upb_tabent*)findentry(t, key, hash, eql);
}
-static bool lookup(const upb_table *t, lookupkey_t key, upb_value *v,
- uint32_t hash, eqlfunc_t *eql) {
- const upb_tabent *e = findentry(t, key, hash, eql);
+static bool lookup(const upb_table* t, lookupkey_t key, upb_value* v,
+ uint32_t hash, eqlfunc_t* eql) {
+ const upb_tabent* e = findentry(t, key, hash, eql);
if (e) {
if (v) {
_upb_value_setval(v, e->val.val);
@@ -163,11 +188,11 @@ static bool lookup(const upb_table *t, lookupkey_t key, upb_value *v,
}
/* The given key must not already exist in the table. */
-static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey,
- upb_value val, uint32_t hash,
- hashfunc_t *hashfunc, eqlfunc_t *eql) {
- upb_tabent *mainpos_e;
- upb_tabent *our_e;
+static void insert(upb_table* t, lookupkey_t key, upb_tabkey tabkey,
+ upb_value val, uint32_t hash, hashfunc_t* hashfunc,
+ eqlfunc_t* eql) {
+ upb_tabent* mainpos_e;
+ upb_tabent* our_e;
UPB_ASSERT(findentry(t, key, hash, eql) == NULL);
@@ -180,12 +205,13 @@ static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey,
our_e->next = NULL;
} else {
/* Collision. */
- upb_tabent *new_e = emptyent(t, mainpos_e);
+ upb_tabent* new_e = emptyent(t, mainpos_e);
/* Head of collider's chain. */
- upb_tabent *chain = getentry_mutable(t, hashfunc(mainpos_e->key));
+ upb_tabent* chain = getentry_mutable(t, hashfunc(mainpos_e->key));
if (chain == mainpos_e) {
/* Existing ent is in its main position (it has the same hash as us, and
- * is the head of our chain). Insert to new ent and append to this chain. */
+ * is the head of our chain). Insert to new ent and append to this chain.
+ */
new_e->next = mainpos_e->next;
mainpos_e->next = new_e;
our_e = new_e;
@@ -193,7 +219,7 @@ static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey,
/* Existing ent is not in its main position (it is a node in some other
* chain). This implies that no existing ent in the table has our hash.
* Evict it (updating its chain) and use its ent for head of our chain. */
- *new_e = *mainpos_e; /* copies next. */
+ *new_e = *mainpos_e; /* copies next. */
while (chain->next != mainpos_e) {
chain = (upb_tabent*)chain->next;
UPB_ASSERT(chain);
@@ -208,9 +234,9 @@ static void insert(upb_table *t, lookupkey_t key, upb_tabkey tabkey,
UPB_ASSERT(findentry(t, key, hash, eql) == our_e);
}
-static bool rm(upb_table *t, lookupkey_t key, upb_value *val,
- upb_tabkey *removed, uint32_t hash, eqlfunc_t *eql) {
- upb_tabent *chain = getentry_mutable(t, hash);
+static bool rm(upb_table* t, lookupkey_t key, upb_value* val,
+ upb_tabkey* removed, uint32_t hash, eqlfunc_t* eql) {
+ upb_tabent* chain = getentry_mutable(t, hash);
if (upb_tabent_isempty(chain)) return false;
if (eql(chain->key, key)) {
/* Element to remove is at the head of its chain. */
@@ -218,11 +244,11 @@ static bool rm(upb_table *t, lookupkey_t key, upb_value *val,
if (val) _upb_value_setval(val, chain->val.val);
if (removed) *removed = chain->key;
if (chain->next) {
- upb_tabent *move = (upb_tabent*)chain->next;
+ upb_tabent* move = (upb_tabent*)chain->next;
*chain = *move;
- move->key = 0; /* Make the slot empty. */
+ move->key = 0; /* Make the slot empty. */
} else {
- chain->key = 0; /* Make the slot empty. */
+ chain->key = 0; /* Make the slot empty. */
}
return true;
} else {
@@ -233,11 +259,11 @@ static bool rm(upb_table *t, lookupkey_t key, upb_value *val,
}
if (chain->next) {
/* Found element to remove. */
- upb_tabent *rm = (upb_tabent*)chain->next;
+ upb_tabent* rm = (upb_tabent*)chain->next;
t->count--;
if (val) _upb_value_setval(val, chain->next->val.val);
if (removed) *removed = rm->key;
- rm->key = 0; /* Make the slot empty. */
+ rm->key = 0; /* Make the slot empty. */
chain->next = rm->next;
return true;
} else {
@@ -247,27 +273,24 @@ static bool rm(upb_table *t, lookupkey_t key, upb_value *val,
}
}
-static size_t next(const upb_table *t, size_t i) {
+static size_t next(const upb_table* t, size_t i) {
do {
- if (++i >= upb_table_size(t))
- return SIZE_MAX - 1; /* Distinct from -1. */
- } while(upb_tabent_isempty(&t->entries[i]));
+ if (++i >= upb_table_size(t)) return SIZE_MAX - 1; /* Distinct from -1. */
+ } while (upb_tabent_isempty(&t->entries[i]));
return i;
}
-static size_t begin(const upb_table *t) {
- return next(t, -1);
-}
-
+static size_t begin(const upb_table* t) { return next(t, -1); }
/* upb_strtable ***************************************************************/
-/* A simple "subclass" of upb_table that only adds a hash function for strings. */
+/* A simple "subclass" of upb_table that only adds a hash function for strings.
+ */
-static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a) {
- uint32_t len = (uint32_t) k2.str.len;
- char *str = upb_malloc(a, k2.str.len + sizeof(uint32_t) + 1);
+static upb_tabkey strcopy(lookupkey_t k2, upb_Arena* a) {
+ uint32_t len = (uint32_t)k2.str.len;
+ char* str = upb_Arena_Malloc(a, k2.str.len + sizeof(uint32_t) + 1);
if (str == NULL) return 0;
memcpy(str, &len, sizeof(uint32_t));
if (k2.str.len) memcpy(str + sizeof(uint32_t), k2.str.str, k2.str.len);
@@ -275,65 +298,193 @@ static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a) {
return (uintptr_t)str;
}
-static uint32_t table_hash(const char *p, size_t n) {
- return wyhash(p, n, 0, _wyp);
+/* Adapted from ABSL's wyhash. */
+
+static uint64_t UnalignedLoad64(const void* p) {
+ uint64_t val;
+ memcpy(&val, p, 8);
+ return val;
+}
+
+static uint32_t UnalignedLoad32(const void* p) {
+ uint32_t val;
+ memcpy(&val, p, 4);
+ return val;
+}
+
+#if defined(_MSC_VER) && defined(_M_X64)
+#include <intrin.h>
+#endif
+
+/* Computes a * b, returning the low 64 bits of the result and storing the high
+ * 64 bits in |*high|. */
+static uint64_t upb_umul128(uint64_t v0, uint64_t v1, uint64_t* out_high) {
+#ifdef __SIZEOF_INT128__
+ __uint128_t p = v0;
+ p *= v1;
+ *out_high = (uint64_t)(p >> 64);
+ return (uint64_t)p;
+#elif defined(_MSC_VER) && defined(_M_X64)
+ return _umul128(v0, v1, out_high);
+#else
+ uint64_t a32 = v0 >> 32;
+ uint64_t a00 = v0 & 0xffffffff;
+ uint64_t b32 = v1 >> 32;
+ uint64_t b00 = v1 & 0xffffffff;
+ uint64_t high = a32 * b32;
+ uint64_t low = a00 * b00;
+ uint64_t mid1 = a32 * b00;
+ uint64_t mid2 = a00 * b32;
+ low += (mid1 << 32) + (mid2 << 32);
+ // Omit carry bit, for mixing we do not care about exact numerical precision.
+ high += (mid1 >> 32) + (mid2 >> 32);
+ *out_high = high;
+ return low;
+#endif
+}
+
+static uint64_t WyhashMix(uint64_t v0, uint64_t v1) {
+ uint64_t high;
+ uint64_t low = upb_umul128(v0, v1, &high);
+ return low ^ high;
+}
+
+static uint64_t Wyhash(const void* data, size_t len, uint64_t seed,
+ const uint64_t salt[]) {
+ const uint8_t* ptr = (const uint8_t*)data;
+ uint64_t starting_length = (uint64_t)len;
+ uint64_t current_state = seed ^ salt[0];
+
+ if (len > 64) {
+ // If we have more than 64 bytes, we're going to handle chunks of 64
+ // bytes at a time. We're going to build up two separate hash states
+ // which we will then hash together.
+ uint64_t duplicated_state = current_state;
+
+ do {
+ uint64_t a = UnalignedLoad64(ptr);
+ uint64_t b = UnalignedLoad64(ptr + 8);
+ uint64_t c = UnalignedLoad64(ptr + 16);
+ uint64_t d = UnalignedLoad64(ptr + 24);
+ uint64_t e = UnalignedLoad64(ptr + 32);
+ uint64_t f = UnalignedLoad64(ptr + 40);
+ uint64_t g = UnalignedLoad64(ptr + 48);
+ uint64_t h = UnalignedLoad64(ptr + 56);
+
+ uint64_t cs0 = WyhashMix(a ^ salt[1], b ^ current_state);
+ uint64_t cs1 = WyhashMix(c ^ salt[2], d ^ current_state);
+ current_state = (cs0 ^ cs1);
+
+ uint64_t ds0 = WyhashMix(e ^ salt[3], f ^ duplicated_state);
+ uint64_t ds1 = WyhashMix(g ^ salt[4], h ^ duplicated_state);
+ duplicated_state = (ds0 ^ ds1);
+
+ ptr += 64;
+ len -= 64;
+ } while (len > 64);
+
+ current_state = current_state ^ duplicated_state;
+ }
+
+ // We now have a data `ptr` with at most 64 bytes and the current state
+ // of the hashing state machine stored in current_state.
+ while (len > 16) {
+ uint64_t a = UnalignedLoad64(ptr);
+ uint64_t b = UnalignedLoad64(ptr + 8);
+
+ current_state = WyhashMix(a ^ salt[1], b ^ current_state);
+
+ ptr += 16;
+ len -= 16;
+ }
+
+ // We now have a data `ptr` with at most 16 bytes.
+ uint64_t a = 0;
+ uint64_t b = 0;
+ if (len > 8) {
+ // When we have at least 9 and at most 16 bytes, set A to the first 64
+ // bits of the input and B to the last 64 bits of the input. Yes, they will
+ // overlap in the middle if we are working with less than the full 16
+ // bytes.
+ a = UnalignedLoad64(ptr);
+ b = UnalignedLoad64(ptr + len - 8);
+ } else if (len > 3) {
+ // If we have at least 4 and at most 8 bytes, set A to the first 32
+ // bits and B to the last 32 bits.
+ a = UnalignedLoad32(ptr);
+ b = UnalignedLoad32(ptr + len - 4);
+ } else if (len > 0) {
+ // If we have at least 1 and at most 3 bytes, read all of the provided
+ // bits into A, with some adjustments.
+ a = ((ptr[0] << 16) | (ptr[len >> 1] << 8) | ptr[len - 1]);
+ b = 0;
+ } else {
+ a = 0;
+ b = 0;
+ }
+
+ uint64_t w = WyhashMix(a ^ salt[1], b ^ current_state);
+ uint64_t z = salt[1] ^ starting_length;
+ return WyhashMix(w, z);
+}
+
+const uint64_t kWyhashSalt[5] = {
+ 0x243F6A8885A308D3ULL, 0x13198A2E03707344ULL, 0xA4093822299F31D0ULL,
+ 0x082EFA98EC4E6C89ULL, 0x452821E638D01377ULL,
+};
+
+uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed) {
+ return Wyhash(p, n, seed, kWyhashSalt);
+}
+
+static uint32_t _upb_Hash_NoSeed(const char* p, size_t n) {
+ return _upb_Hash(p, n, 0);
}
static uint32_t strhash(upb_tabkey key) {
uint32_t len;
- char *str = upb_tabstr(key, &len);
- return table_hash(str, len);
+ char* str = upb_tabstr(key, &len);
+ return _upb_Hash_NoSeed(str, len);
}
static bool streql(upb_tabkey k1, lookupkey_t k2) {
uint32_t len;
- char *str = upb_tabstr(k1, &len);
+ char* str = upb_tabstr(k1, &len);
return len == k2.str.len && (len == 0 || memcmp(str, k2.str.str, len) == 0);
}
-bool upb_strtable_init2(upb_strtable *t, upb_ctype_t ctype,
- size_t expected_size, upb_alloc *a) {
- UPB_UNUSED(ctype); /* TODO(haberman): rm */
- // Multiply by approximate reciprocal of MAX_LOAD (0.85), with pow2 denominator.
+bool upb_strtable_init(upb_strtable* t, size_t expected_size, upb_Arena* a) {
+ // Multiply by approximate reciprocal of MAX_LOAD (0.85), with pow2
+ // denominator.
size_t need_entries = (expected_size + 1) * 1204 / 1024;
UPB_ASSERT(need_entries >= expected_size * 0.85);
- int size_lg2 = _upb_lg2ceil(need_entries);
+ int size_lg2 = _upb_Log2Ceiling(need_entries);
return init(&t->t, size_lg2, a);
}
-void upb_strtable_clear(upb_strtable *t) {
+void upb_strtable_clear(upb_strtable* t) {
size_t bytes = upb_table_size(&t->t) * sizeof(upb_tabent);
t->t.count = 0;
memset((char*)t->t.entries, 0, bytes);
}
-void upb_strtable_uninit2(upb_strtable *t, upb_alloc *a) {
- size_t i;
- for (i = 0; i < upb_table_size(&t->t); i++)
- upb_free(a, (void*)t->t.entries[i].key);
- uninit(&t->t, a);
-}
-
-bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a) {
+bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a) {
upb_strtable new_table;
upb_strtable_iter i;
- if (!init(&new_table.t, size_lg2, a))
- return false;
+ if (!init(&new_table.t, size_lg2, a)) return false;
upb_strtable_begin(&i, t);
- for ( ; !upb_strtable_done(&i); upb_strtable_next(&i)) {
- upb_strview key = upb_strtable_iter_key(&i);
- upb_strtable_insert3(
- &new_table, key.data, key.size,
- upb_strtable_iter_value(&i), a);
+ for (; !upb_strtable_done(&i); upb_strtable_next(&i)) {
+ upb_StringView key = upb_strtable_iter_key(&i);
+ upb_strtable_insert(&new_table, key.data, key.size,
+ upb_strtable_iter_value(&i), a);
}
- upb_strtable_uninit2(t, a);
*t = new_table;
return true;
}
-bool upb_strtable_insert3(upb_strtable *t, const char *k, size_t len,
- upb_value v, upb_alloc *a) {
+bool upb_strtable_insert(upb_strtable* t, const char* k, size_t len,
+ upb_value v, upb_Arena* a) {
lookupkey_t key;
upb_tabkey tabkey;
uint32_t hash;
@@ -349,51 +500,43 @@ bool upb_strtable_insert3(upb_strtable *t, const char *k, size_t len,
tabkey = strcopy(key, a);
if (tabkey == 0) return false;
- hash = table_hash(key.str.str, key.str.len);
+ hash = _upb_Hash_NoSeed(key.str.str, key.str.len);
insert(&t->t, key, tabkey, v, hash, &strhash, &streql);
return true;
}
-bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len,
- upb_value *v) {
- uint32_t hash = table_hash(key, len);
+bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
+ upb_value* v) {
+ uint32_t hash = _upb_Hash_NoSeed(key, len);
return lookup(&t->t, strkey2(key, len), v, hash, &streql);
}
-bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len,
- upb_value *val, upb_alloc *alloc) {
- uint32_t hash = table_hash(key, len);
+bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
+ upb_value* val) {
+ uint32_t hash = _upb_Hash_NoSeed(key, len);
upb_tabkey tabkey;
- if (rm(&t->t, strkey2(key, len), val, &tabkey, hash, &streql)) {
- if (alloc) {
- /* Arena-based allocs don't need to free and won't pass this. */
- upb_free(alloc, (void*)tabkey);
- }
- return true;
- } else {
- return false;
- }
+ return rm(&t->t, strkey2(key, len), val, &tabkey, hash, &streql);
}
/* Iteration */
-void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t) {
+void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t) {
i->t = t;
i->index = begin(&t->t);
}
-void upb_strtable_next(upb_strtable_iter *i) {
+void upb_strtable_next(upb_strtable_iter* i) {
i->index = next(&i->t->t, i->index);
}
-bool upb_strtable_done(const upb_strtable_iter *i) {
+bool upb_strtable_done(const upb_strtable_iter* i) {
if (!i->t) return true;
return i->index >= upb_table_size(&i->t->t) ||
upb_tabent_isempty(str_tabent(i));
}
-upb_strview upb_strtable_iter_key(const upb_strtable_iter *i) {
- upb_strview key;
+upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i) {
+ upb_StringView key;
uint32_t len;
UPB_ASSERT(!upb_strtable_done(i));
key.data = upb_tabstr(str_tabent(i)->key, &len);
@@ -401,24 +544,22 @@ upb_strview upb_strtable_iter_key(const upb_strtable_iter *i) {
return key;
}
-upb_value upb_strtable_iter_value(const upb_strtable_iter *i) {
+upb_value upb_strtable_iter_value(const upb_strtable_iter* i) {
UPB_ASSERT(!upb_strtable_done(i));
return _upb_value_val(str_tabent(i)->val.val);
}
-void upb_strtable_iter_setdone(upb_strtable_iter *i) {
+void upb_strtable_iter_setdone(upb_strtable_iter* i) {
i->t = NULL;
i->index = SIZE_MAX;
}
-bool upb_strtable_iter_isequal(const upb_strtable_iter *i1,
- const upb_strtable_iter *i2) {
- if (upb_strtable_done(i1) && upb_strtable_done(i2))
- return true;
+bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
+ const upb_strtable_iter* i2) {
+ if (upb_strtable_done(i1) && upb_strtable_done(i2)) return true;
return i1->t == i2->t && i1->index == i2->index;
}
-
/* upb_inttable ***************************************************************/
/* For inttables we use a hybrid structure where small keys are kept in an
@@ -426,34 +567,32 @@ bool upb_strtable_iter_isequal(const upb_strtable_iter *i1,
static uint32_t inthash(upb_tabkey key) { return upb_inthash(key); }
-static bool inteql(upb_tabkey k1, lookupkey_t k2) {
- return k1 == k2.num;
-}
+static bool inteql(upb_tabkey k1, lookupkey_t k2) { return k1 == k2.num; }
-static upb_tabval *mutable_array(upb_inttable *t) {
+static upb_tabval* mutable_array(upb_inttable* t) {
return (upb_tabval*)t->array;
}
-static upb_tabval *inttable_val(upb_inttable *t, uintptr_t key) {
+static upb_tabval* inttable_val(upb_inttable* t, uintptr_t key) {
if (key < t->array_size) {
return upb_arrhas(t->array[key]) ? &(mutable_array(t)[key]) : NULL;
} else {
- upb_tabent *e =
+ upb_tabent* e =
findentry_mutable(&t->t, intkey(key), upb_inthash(key), &inteql);
return e ? &e->val : NULL;
}
}
-static const upb_tabval *inttable_val_const(const upb_inttable *t,
+static const upb_tabval* inttable_val_const(const upb_inttable* t,
uintptr_t key) {
return inttable_val((upb_inttable*)t, key);
}
-size_t upb_inttable_count(const upb_inttable *t) {
+size_t upb_inttable_count(const upb_inttable* t) {
return t->t.count + t->array_count;
}
-static void check(upb_inttable *t) {
+static void check(upb_inttable* t) {
UPB_UNUSED(t);
#if defined(UPB_DEBUG_TABLE) && !defined(NDEBUG)
{
@@ -461,7 +600,7 @@ static void check(upb_inttable *t) {
size_t count = 0;
upb_inttable_iter i;
upb_inttable_begin(&i, t);
- for(; !upb_inttable_done(&i); upb_inttable_next(&i), count++) {
+ for (; !upb_inttable_done(&i); upb_inttable_next(&i), count++) {
UPB_ASSERT(upb_inttable_lookup(t, upb_inttable_iter_key(&i), NULL));
}
UPB_ASSERT(count == upb_inttable_count(t));
@@ -469,8 +608,8 @@ static void check(upb_inttable *t) {
#endif
}
-bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
- upb_alloc *a) {
+bool upb_inttable_sizedinit(upb_inttable* t, size_t asize, int hsize_lg2,
+ upb_Arena* a) {
size_t array_bytes;
if (!init(&t->t, hsize_lg2, a)) return false;
@@ -479,9 +618,8 @@ bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
t->array_size = UPB_MAX(1, asize);
t->array_count = 0;
array_bytes = t->array_size * sizeof(upb_value);
- t->array = upb_malloc(a, array_bytes);
+ t->array = upb_Arena_Malloc(a, array_bytes);
if (!t->array) {
- uninit(&t->t, a);
return false;
}
memset(mutable_array(t), 0xff, array_bytes);
@@ -489,21 +627,16 @@ bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
return true;
}
-bool upb_inttable_init2(upb_inttable *t, upb_ctype_t ctype, upb_alloc *a) {
- UPB_UNUSED(ctype); /* TODO(haberman): rm */
+bool upb_inttable_init(upb_inttable* t, upb_Arena* a) {
return upb_inttable_sizedinit(t, 0, 4, a);
}
-void upb_inttable_uninit2(upb_inttable *t, upb_alloc *a) {
- uninit(&t->t, a);
- upb_free(a, mutable_array(t));
-}
-
-bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
- upb_alloc *a) {
+bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
+ upb_Arena* a) {
upb_tabval tabval;
tabval.val = val.val;
- UPB_ASSERT(upb_arrhas(tabval)); /* This will reject (uint64_t)-1. Fix this. */
+ UPB_ASSERT(
+ upb_arrhas(tabval)); /* This will reject (uint64_t)-1. Fix this. */
if (key < t->array_size) {
UPB_ASSERT(!upb_arrhas(t->array[key]));
@@ -520,7 +653,7 @@ bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
}
for (i = begin(&t->t); i < upb_table_size(&t->t); i = next(&t->t, i)) {
- const upb_tabent *e = &t->t.entries[i];
+ const upb_tabent* e = &t->t.entries[i];
uint32_t hash;
upb_value v;
@@ -531,7 +664,6 @@ bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
UPB_ASSERT(t->t.count == new_table.count);
- uninit(&t->t, a);
t->t = new_table;
}
insert(&t->t, intkey(key), key, val, upb_inthash(key), &inthash, &inteql);
@@ -540,21 +672,21 @@ bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
return true;
}
-bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v) {
- const upb_tabval *table_v = inttable_val_const(t, key);
+bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v) {
+ const upb_tabval* table_v = inttable_val_const(t, key);
if (!table_v) return false;
if (v) _upb_value_setval(v, table_v->val);
return true;
}
-bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val) {
- upb_tabval *table_v = inttable_val(t, key);
+bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val) {
+ upb_tabval* table_v = inttable_val(t, key);
if (!table_v) return false;
table_v->val = val.val;
return true;
}
-bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val) {
+bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val) {
bool success;
if (key < t->array_size) {
if (upb_arrhas(t->array[key])) {
@@ -575,21 +707,7 @@ bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val) {
return success;
}
-bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
- upb_alloc *a) {
- return upb_inttable_insert2(t, (uintptr_t)key, val, a);
-}
-
-bool upb_inttable_lookupptr(const upb_inttable *t, const void *key,
- upb_value *v) {
- return upb_inttable_lookup(t, (uintptr_t)key, v);
-}
-
-bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val) {
- return upb_inttable_remove(t, (uintptr_t)key, val);
-}
-
-void upb_inttable_compact2(upb_inttable *t, upb_alloc *a) {
+void upb_inttable_compact(upb_inttable* t, upb_Arena* a) {
/* A power-of-two histogram of the table keys. */
size_t counts[UPB_MAXARRSIZE + 1] = {0};
@@ -628,7 +746,7 @@ void upb_inttable_compact2(upb_inttable *t, upb_alloc *a) {
{
/* Insert all elements into new, perfectly-sized table. */
- size_t arr_size = max[size_lg2] + 1; /* +1 so arr[max] will fit. */
+ size_t arr_size = max[size_lg2] + 1; /* +1 so arr[max] will fit. */
size_t hash_count = upb_inttable_count(t) - arr_count;
size_t hash_size = hash_count ? (hash_count / MAX_LOAD) + 1 : 0;
int hashsize_lg2 = log2ceil(hash_size);
@@ -637,36 +755,35 @@ void upb_inttable_compact2(upb_inttable *t, upb_alloc *a) {
upb_inttable_begin(&i, t);
for (; !upb_inttable_done(&i); upb_inttable_next(&i)) {
uintptr_t k = upb_inttable_iter_key(&i);
- upb_inttable_insert2(&new_t, k, upb_inttable_iter_value(&i), a);
+ upb_inttable_insert(&new_t, k, upb_inttable_iter_value(&i), a);
}
UPB_ASSERT(new_t.array_size == arr_size);
UPB_ASSERT(new_t.t.size_lg2 == hashsize_lg2);
}
- upb_inttable_uninit2(t, a);
*t = new_t;
}
/* Iteration. */
-static const upb_tabent *int_tabent(const upb_inttable_iter *i) {
+static const upb_tabent* int_tabent(const upb_inttable_iter* i) {
UPB_ASSERT(!i->array_part);
return &i->t->t.entries[i->index];
}
-static upb_tabval int_arrent(const upb_inttable_iter *i) {
+static upb_tabval int_arrent(const upb_inttable_iter* i) {
UPB_ASSERT(i->array_part);
return i->t->array[i->index];
}
-void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t) {
+void upb_inttable_begin(upb_inttable_iter* i, const upb_inttable* t) {
i->t = t;
i->index = -1;
i->array_part = true;
upb_inttable_next(i);
}
-void upb_inttable_next(upb_inttable_iter *iter) {
- const upb_inttable *t = iter->t;
+void upb_inttable_next(upb_inttable_iter* iter) {
+ const upb_inttable* t = iter->t;
if (iter->array_part) {
while (++iter->index < t->array_size) {
if (upb_arrhas(int_arrent(iter))) {
@@ -680,38 +797,130 @@ void upb_inttable_next(upb_inttable_iter *iter) {
}
}
-bool upb_inttable_done(const upb_inttable_iter *i) {
+bool upb_inttable_next2(const upb_inttable* t, uintptr_t* key, upb_value* val,
+ intptr_t* iter) {
+ intptr_t i = *iter;
+ if (i < t->array_size) {
+ while (++i < t->array_size) {
+ upb_tabval ent = t->array[i];
+ if (upb_arrhas(ent)) {
+ *key = i;
+ *val = _upb_value_val(ent.val);
+ *iter = i;
+ return true;
+ }
+ }
+ }
+
+ size_t tab_idx = next(&t->t, i == -1 ? -1 : i - t->array_size);
+ if (tab_idx < upb_table_size(&t->t)) {
+ upb_tabent* ent = &t->t.entries[tab_idx];
+ *key = ent->key;
+ *val = _upb_value_val(ent->val.val);
+ *iter = tab_idx + t->array_size;
+ return true;
+ }
+
+ return false;
+}
+
+void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter) {
+ intptr_t i = *iter;
+ if (i < t->array_size) {
+ t->array_count--;
+ mutable_array(t)[i].val = -1;
+ } else {
+ upb_tabent* ent = &t->t.entries[i - t->array_size];
+ upb_tabent* prev = NULL;
+
+ // Linear search, not great.
+ upb_tabent* end = &t->t.entries[upb_table_size(&t->t)];
+ for (upb_tabent* e = t->t.entries; e != end; e++) {
+ if (e->next == ent) {
+ prev = e;
+ break;
+ }
+ }
+
+ if (prev) {
+ prev->next = ent->next;
+ }
+
+ t->t.count--;
+ ent->key = 0;
+ ent->next = NULL;
+ }
+}
+
+bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
+ upb_value* val, intptr_t* iter) {
+ size_t tab_idx = next(&t->t, *iter);
+ if (tab_idx < upb_table_size(&t->t)) {
+ upb_tabent* ent = &t->t.entries[tab_idx];
+ uint32_t len;
+ key->data = upb_tabstr(ent->key, &len);
+ key->size = len;
+ *val = _upb_value_val(ent->val.val);
+ *iter = tab_idx;
+ return true;
+ }
+
+ return false;
+}
+
+void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter) {
+ intptr_t i = *iter;
+ upb_tabent* ent = &t->t.entries[i];
+ upb_tabent* prev = NULL;
+
+ // Linear search, not great.
+ upb_tabent* end = &t->t.entries[upb_table_size(&t->t)];
+ for (upb_tabent* e = t->t.entries; e != end; e++) {
+ if (e->next == ent) {
+ prev = e;
+ break;
+ }
+ }
+
+ if (prev) {
+ prev->next = ent->next;
+ }
+
+ t->t.count--;
+ ent->key = 0;
+ ent->next = NULL;
+}
+
+bool upb_inttable_done(const upb_inttable_iter* i) {
if (!i->t) return true;
if (i->array_part) {
- return i->index >= i->t->array_size ||
- !upb_arrhas(int_arrent(i));
+ return i->index >= i->t->array_size || !upb_arrhas(int_arrent(i));
} else {
return i->index >= upb_table_size(&i->t->t) ||
upb_tabent_isempty(int_tabent(i));
}
}
-uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i) {
+uintptr_t upb_inttable_iter_key(const upb_inttable_iter* i) {
UPB_ASSERT(!upb_inttable_done(i));
return i->array_part ? i->index : int_tabent(i)->key;
}
-upb_value upb_inttable_iter_value(const upb_inttable_iter *i) {
+upb_value upb_inttable_iter_value(const upb_inttable_iter* i) {
UPB_ASSERT(!upb_inttable_done(i));
- return _upb_value_val(
- i->array_part ? i->t->array[i->index].val : int_tabent(i)->val.val);
+ return _upb_value_val(i->array_part ? i->t->array[i->index].val
+ : int_tabent(i)->val.val);
}
-void upb_inttable_iter_setdone(upb_inttable_iter *i) {
+void upb_inttable_iter_setdone(upb_inttable_iter* i) {
i->t = NULL;
i->index = SIZE_MAX;
i->array_part = false;
}
-bool upb_inttable_iter_isequal(const upb_inttable_iter *i1,
- const upb_inttable_iter *i2) {
- if (upb_inttable_done(i1) && upb_inttable_done(i2))
- return true;
+bool upb_inttable_iter_isequal(const upb_inttable_iter* i1,
+ const upb_inttable_iter* i2) {
+ if (upb_inttable_done(i1) && upb_inttable_done(i2)) return true;
return i1->t == i2->t && i1->index == i2->index &&
i1->array_part == i2->array_part;
}
diff --git a/grpc/third_party/upb/upb/table.int.h b/grpc/third_party/upb/upb/table.int.h
deleted file mode 100644
index 49caac46..00000000
--- a/grpc/third_party/upb/upb/table.int.h
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
-** upb_table
-**
-** This header is INTERNAL-ONLY! Its interfaces are not public or stable!
-** This file defines very fast int->upb_value (inttable) and string->upb_value
-** (strtable) hash tables.
-**
-** The table uses chained scatter with Brent's variation (inspired by the Lua
-** implementation of hash tables). The hash function for strings is Austin
-** Appleby's "MurmurHash."
-**
-** The inttable uses uintptr_t as its key, which guarantees it can be used to
-** store pointers or integers of at least 32 bits (upb isn't really useful on
-** systems where sizeof(void*) < 4).
-**
-** The table must be homogeneous (all values of the same type). In debug
-** mode, we check this on insert and lookup.
-*/
-
-#ifndef UPB_TABLE_H_
-#define UPB_TABLE_H_
-
-#include <stdint.h>
-#include <string.h>
-#include "upb/upb.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* upb_value ******************************************************************/
-
-/* A tagged union (stored untagged inside the table) so that we can check that
- * clients calling table accessors are correctly typed without having to have
- * an explosion of accessors. */
-typedef enum {
- UPB_CTYPE_INT32 = 1,
- UPB_CTYPE_INT64 = 2,
- UPB_CTYPE_UINT32 = 3,
- UPB_CTYPE_UINT64 = 4,
- UPB_CTYPE_BOOL = 5,
- UPB_CTYPE_CSTR = 6,
- UPB_CTYPE_PTR = 7,
- UPB_CTYPE_CONSTPTR = 8,
- UPB_CTYPE_FPTR = 9,
- UPB_CTYPE_FLOAT = 10,
- UPB_CTYPE_DOUBLE = 11
-} upb_ctype_t;
-
-typedef struct {
- uint64_t val;
-} upb_value;
-
-/* Like strdup(), which isn't always available since it's not ANSI C. */
-char *upb_strdup(const char *s, upb_alloc *a);
-/* Variant that works with a length-delimited rather than NULL-delimited string,
- * as supported by strtable. */
-char *upb_strdup2(const char *s, size_t len, upb_alloc *a);
-
-UPB_INLINE char *upb_gstrdup(const char *s) {
- return upb_strdup(s, &upb_alloc_global);
-}
-
-UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val) {
- v->val = val;
-}
-
-UPB_INLINE upb_value _upb_value_val(uint64_t val) {
- upb_value ret;
- _upb_value_setval(&ret, val);
- return ret;
-}
-
-/* For each value ctype, define the following set of functions:
- *
- * // Get/set an int32 from a upb_value.
- * int32_t upb_value_getint32(upb_value val);
- * void upb_value_setint32(upb_value *val, int32_t cval);
- *
- * // Construct a new upb_value from an int32.
- * upb_value upb_value_int32(int32_t val); */
-#define FUNCS(name, membername, type_t, converter, proto_type) \
- UPB_INLINE void upb_value_set ## name(upb_value *val, type_t cval) { \
- val->val = (converter)cval; \
- } \
- UPB_INLINE upb_value upb_value_ ## name(type_t val) { \
- upb_value ret; \
- upb_value_set ## name(&ret, val); \
- return ret; \
- } \
- UPB_INLINE type_t upb_value_get ## name(upb_value val) { \
- return (type_t)(converter)val.val; \
- }
-
-FUNCS(int32, int32, int32_t, int32_t, UPB_CTYPE_INT32)
-FUNCS(int64, int64, int64_t, int64_t, UPB_CTYPE_INT64)
-FUNCS(uint32, uint32, uint32_t, uint32_t, UPB_CTYPE_UINT32)
-FUNCS(uint64, uint64, uint64_t, uint64_t, UPB_CTYPE_UINT64)
-FUNCS(bool, _bool, bool, bool, UPB_CTYPE_BOOL)
-FUNCS(cstr, cstr, char*, uintptr_t, UPB_CTYPE_CSTR)
-FUNCS(ptr, ptr, void*, uintptr_t, UPB_CTYPE_PTR)
-FUNCS(constptr, constptr, const void*, uintptr_t, UPB_CTYPE_CONSTPTR)
-FUNCS(fptr, fptr, upb_func*, uintptr_t, UPB_CTYPE_FPTR)
-
-#undef FUNCS
-
-UPB_INLINE void upb_value_setfloat(upb_value *val, float cval) {
- memcpy(&val->val, &cval, sizeof(cval));
-}
-
-UPB_INLINE void upb_value_setdouble(upb_value *val, double cval) {
- memcpy(&val->val, &cval, sizeof(cval));
-}
-
-UPB_INLINE upb_value upb_value_float(float cval) {
- upb_value ret;
- upb_value_setfloat(&ret, cval);
- return ret;
-}
-
-UPB_INLINE upb_value upb_value_double(double cval) {
- upb_value ret;
- upb_value_setdouble(&ret, cval);
- return ret;
-}
-
-#undef SET_TYPE
-
-
-/* upb_tabkey *****************************************************************/
-
-/* Either:
- * 1. an actual integer key, or
- * 2. a pointer to a string prefixed by its uint32_t length, owned by us.
- *
- * ...depending on whether this is a string table or an int table. We would
- * make this a union of those two types, but C89 doesn't support statically
- * initializing a non-first union member. */
-typedef uintptr_t upb_tabkey;
-
-UPB_INLINE char *upb_tabstr(upb_tabkey key, uint32_t *len) {
- char* mem = (char*)key;
- if (len) memcpy(len, mem, sizeof(*len));
- return mem + sizeof(*len);
-}
-
-UPB_INLINE upb_strview upb_tabstrview(upb_tabkey key) {
- upb_strview ret;
- uint32_t len;
- ret.data = upb_tabstr(key, &len);
- ret.size = len;
- return ret;
-}
-
-/* upb_tabval *****************************************************************/
-
-typedef struct upb_tabval {
- uint64_t val;
-} upb_tabval;
-
-#define UPB_TABVALUE_EMPTY_INIT {-1}
-
-/* upb_table ******************************************************************/
-
-typedef struct _upb_tabent {
- upb_tabkey key;
- upb_tabval val;
-
- /* Internal chaining. This is const so we can create static initializers for
- * tables. We cast away const sometimes, but *only* when the containing
- * upb_table is known to be non-const. This requires a bit of care, but
- * the subtlety is confined to table.c. */
- const struct _upb_tabent *next;
-} upb_tabent;
-
-typedef struct {
- size_t count; /* Number of entries in the hash part. */
- uint32_t mask; /* Mask to turn hash value -> bucket. */
- uint32_t max_count; /* Max count before we hit our load limit. */
- uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */
-
- /* Hash table entries.
- * Making this const isn't entirely accurate; what we really want is for it to
- * have the same const-ness as the table it's inside. But there's no way to
- * declare that in C. So we have to make it const so that we can statically
- * initialize const hash tables. Then we cast away const when we have to.
- */
- const upb_tabent *entries;
-} upb_table;
-
-typedef struct {
- upb_table t;
-} upb_strtable;
-
-typedef struct {
- upb_table t; /* For entries that don't fit in the array part. */
- const upb_tabval *array; /* Array part of the table. See const note above. */
- size_t array_size; /* Array part size. */
- size_t array_count; /* Array part number of elements. */
-} upb_inttable;
-
-#define UPB_ARRAY_EMPTYENT -1
-
-UPB_INLINE size_t upb_table_size(const upb_table *t) {
- if (t->size_lg2 == 0)
- return 0;
- else
- return 1 << t->size_lg2;
-}
-
-/* Internal-only functions, in .h file only out of necessity. */
-UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e) {
- return e->key == 0;
-}
-
-/* Used by some of the unit tests for generic hashing functionality. */
-uint32_t upb_murmur_hash2(const void * key, size_t len, uint32_t seed);
-
-UPB_INLINE uintptr_t upb_intkey(uintptr_t key) {
- return key;
-}
-
-UPB_INLINE uint32_t upb_inthash(uintptr_t key) {
- return (uint32_t)key;
-}
-
-static const upb_tabent *upb_getentry(const upb_table *t, uint32_t hash) {
- return t->entries + (hash & t->mask);
-}
-
-UPB_INLINE bool upb_arrhas(upb_tabval key) {
- return key.val != (uint64_t)-1;
-}
-
-/* Initialize and uninitialize a table, respectively. If memory allocation
- * failed, false is returned that the table is uninitialized. */
-bool upb_inttable_init2(upb_inttable *table, upb_ctype_t ctype, upb_alloc *a);
-bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype,
- size_t expected_size, upb_alloc *a);
-void upb_inttable_uninit2(upb_inttable *table, upb_alloc *a);
-void upb_strtable_uninit2(upb_strtable *table, upb_alloc *a);
-
-UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype) {
- return upb_inttable_init2(table, ctype, &upb_alloc_global);
-}
-
-UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype) {
- return upb_strtable_init2(table, ctype, 4, &upb_alloc_global);
-}
-
-UPB_INLINE void upb_inttable_uninit(upb_inttable *table) {
- upb_inttable_uninit2(table, &upb_alloc_global);
-}
-
-UPB_INLINE void upb_strtable_uninit(upb_strtable *table) {
- upb_strtable_uninit2(table, &upb_alloc_global);
-}
-
-/* Returns the number of values in the table. */
-size_t upb_inttable_count(const upb_inttable *t);
-UPB_INLINE size_t upb_strtable_count(const upb_strtable *t) {
- return t->t.count;
-}
-
-void upb_inttable_packedsize(const upb_inttable *t, size_t *size);
-void upb_strtable_packedsize(const upb_strtable *t, size_t *size);
-upb_inttable *upb_inttable_pack(const upb_inttable *t, void *p, size_t *ofs,
- size_t size);
-upb_strtable *upb_strtable_pack(const upb_strtable *t, void *p, size_t *ofs,
- size_t size);
-void upb_strtable_clear(upb_strtable *t);
-
-/* Inserts the given key into the hashtable with the given value. The key must
- * not already exist in the hash table. For string tables, the key must be
- * NULL-terminated, and the table will make an internal copy of the key.
- * Inttables must not insert a value of UINTPTR_MAX.
- *
- * If a table resize was required but memory allocation failed, false is
- * returned and the table is unchanged. */
-bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
- upb_alloc *a);
-bool upb_strtable_insert3(upb_strtable *t, const char *key, size_t len,
- upb_value val, upb_alloc *a);
-
-UPB_INLINE bool upb_inttable_insert(upb_inttable *t, uintptr_t key,
- upb_value val) {
- return upb_inttable_insert2(t, key, val, &upb_alloc_global);
-}
-
-UPB_INLINE bool upb_strtable_insert2(upb_strtable *t, const char *key,
- size_t len, upb_value val) {
- return upb_strtable_insert3(t, key, len, val, &upb_alloc_global);
-}
-
-/* For NULL-terminated strings. */
-UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key,
- upb_value val) {
- return upb_strtable_insert2(t, key, strlen(key), val);
-}
-
-/* Looks up key in this table, returning "true" if the key was found.
- * If v is non-NULL, copies the value for this key into *v. */
-bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v);
-bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len,
- upb_value *v);
-
-/* For NULL-terminated strings. */
-UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key,
- upb_value *v) {
- return upb_strtable_lookup2(t, key, strlen(key), v);
-}
-
-/* Removes an item from the table. Returns true if the remove was successful,
- * and stores the removed item in *val if non-NULL. */
-bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val);
-bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len,
- upb_value *val, upb_alloc *alloc);
-
-UPB_INLINE bool upb_strtable_remove2(upb_strtable *t, const char *key,
- size_t len, upb_value *val) {
- return upb_strtable_remove3(t, key, len, val, &upb_alloc_global);
-}
-
-/* For NULL-terminated strings. */
-UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key,
- upb_value *v) {
- return upb_strtable_remove2(t, key, strlen(key), v);
-}
-
-/* Updates an existing entry in an inttable. If the entry does not exist,
- * returns false and does nothing. Unlike insert/remove, this does not
- * invalidate iterators. */
-bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val);
-
-/* Convenience routines for inttables with pointer keys. */
-bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
- upb_alloc *a);
-bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val);
-bool upb_inttable_lookupptr(
- const upb_inttable *t, const void *key, upb_value *val);
-
-UPB_INLINE bool upb_inttable_insertptr(upb_inttable *t, const void *key,
- upb_value val) {
- return upb_inttable_insertptr2(t, key, val, &upb_alloc_global);
-}
-
-/* Optimizes the table for the current set of entries, for both memory use and
- * lookup time. Client should call this after all entries have been inserted;
- * inserting more entries is legal, but will likely require a table resize. */
-void upb_inttable_compact2(upb_inttable *t, upb_alloc *a);
-
-UPB_INLINE void upb_inttable_compact(upb_inttable *t) {
- upb_inttable_compact2(t, &upb_alloc_global);
-}
-
-/* A special-case inlinable version of the lookup routine for 32-bit
- * integers. */
-UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key,
- upb_value *v) {
- *v = upb_value_int32(0); /* Silence compiler warnings. */
- if (key < t->array_size) {
- upb_tabval arrval = t->array[key];
- if (upb_arrhas(arrval)) {
- _upb_value_setval(v, arrval.val);
- return true;
- } else {
- return false;
- }
- } else {
- const upb_tabent *e;
- if (t->t.entries == NULL) return false;
- for (e = upb_getentry(&t->t, upb_inthash(key)); true; e = e->next) {
- if ((uint32_t)e->key == key) {
- _upb_value_setval(v, e->val.val);
- return true;
- }
- if (e->next == NULL) return false;
- }
- }
-}
-
-/* Exposed for testing only. */
-bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a);
-
-/* Iterators ******************************************************************/
-
-/* Iterators for int and string tables. We are subject to some kind of unusual
- * design constraints:
- *
- * For high-level languages:
- * - we must be able to guarantee that we don't crash or corrupt memory even if
- * the program accesses an invalidated iterator.
- *
- * For C++11 range-based for:
- * - iterators must be copyable
- * - iterators must be comparable
- * - it must be possible to construct an "end" value.
- *
- * Iteration order is undefined.
- *
- * Modifying the table invalidates iterators. upb_{str,int}table_done() is
- * guaranteed to work even on an invalidated iterator, as long as the table it
- * is iterating over has not been freed. Calling next() or accessing data from
- * an invalidated iterator yields unspecified elements from the table, but it is
- * guaranteed not to crash and to return real table elements (except when done()
- * is true). */
-
-
-/* upb_strtable_iter **********************************************************/
-
-/* upb_strtable_iter i;
- * upb_strtable_begin(&i, t);
- * for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
- * const char *key = upb_strtable_iter_key(&i);
- * const upb_value val = upb_strtable_iter_value(&i);
- * // ...
- * }
- */
-
-typedef struct {
- const upb_strtable *t;
- size_t index;
-} upb_strtable_iter;
-
-void upb_strtable_begin(upb_strtable_iter *i, const upb_strtable *t);
-void upb_strtable_next(upb_strtable_iter *i);
-bool upb_strtable_done(const upb_strtable_iter *i);
-upb_strview upb_strtable_iter_key(const upb_strtable_iter *i);
-upb_value upb_strtable_iter_value(const upb_strtable_iter *i);
-void upb_strtable_iter_setdone(upb_strtable_iter *i);
-bool upb_strtable_iter_isequal(const upb_strtable_iter *i1,
- const upb_strtable_iter *i2);
-
-
-/* upb_inttable_iter **********************************************************/
-
-/* upb_inttable_iter i;
- * upb_inttable_begin(&i, t);
- * for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
- * uintptr_t key = upb_inttable_iter_key(&i);
- * upb_value val = upb_inttable_iter_value(&i);
- * // ...
- * }
- */
-
-typedef struct {
- const upb_inttable *t;
- size_t index;
- bool array_part;
-} upb_inttable_iter;
-
-UPB_INLINE const upb_tabent *str_tabent(const upb_strtable_iter *i) {
- return &i->t->t.entries[i->index];
-}
-
-void upb_inttable_begin(upb_inttable_iter *i, const upb_inttable *t);
-void upb_inttable_next(upb_inttable_iter *i);
-bool upb_inttable_done(const upb_inttable_iter *i);
-uintptr_t upb_inttable_iter_key(const upb_inttable_iter *i);
-upb_value upb_inttable_iter_value(const upb_inttable_iter *i);
-void upb_inttable_iter_setdone(upb_inttable_iter *i);
-bool upb_inttable_iter_isequal(const upb_inttable_iter *i1,
- const upb_inttable_iter *i2);
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UPB_TABLE_H_ */
diff --git a/grpc/third_party/upb/upb/table_internal.h b/grpc/third_party/upb/upb/table_internal.h
new file mode 100644
index 00000000..418f470c
--- /dev/null
+++ b/grpc/third_party/upb/upb/table_internal.h
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_table
+ *
+ * This header is INTERNAL-ONLY! Its interfaces are not public or stable!
+ * This file defines very fast int->upb_value (inttable) and string->upb_value
+ * (strtable) hash tables.
+ *
+ * The table uses chained scatter with Brent's variation (inspired by the Lua
+ * implementation of hash tables). The hash function for strings is Austin
+ * Appleby's "MurmurHash."
+ *
+ * The inttable uses uintptr_t as its key, which guarantees it can be used to
+ * store pointers or integers of at least 32 bits (upb isn't really useful on
+ * systems where sizeof(void*) < 4).
+ *
+ * The table must be homogeneous (all values of the same type). In debug
+ * mode, we check this on insert and lookup.
+ */
+
+#ifndef UPB_TABLE_H_
+#define UPB_TABLE_H_
+
+#include <stdint.h>
+#include <string.h>
+
+#include "upb/upb.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* upb_value ******************************************************************/
+
+typedef struct {
+ uint64_t val;
+} upb_value;
+
+/* Variant that works with a length-delimited rather than NULL-delimited string,
+ * as supported by strtable. */
+char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
+
+UPB_INLINE void _upb_value_setval(upb_value* v, uint64_t val) { v->val = val; }
+
+/* For each value ctype, define the following set of functions:
+ *
+ * // Get/set an int32 from a upb_value.
+ * int32_t upb_value_getint32(upb_value val);
+ * void upb_value_setint32(upb_value *val, int32_t cval);
+ *
+ * // Construct a new upb_value from an int32.
+ * upb_value upb_value_int32(int32_t val); */
+#define FUNCS(name, membername, type_t, converter, proto_type) \
+ UPB_INLINE void upb_value_set##name(upb_value* val, type_t cval) { \
+ val->val = (converter)cval; \
+ } \
+ UPB_INLINE upb_value upb_value_##name(type_t val) { \
+ upb_value ret; \
+ upb_value_set##name(&ret, val); \
+ return ret; \
+ } \
+ UPB_INLINE type_t upb_value_get##name(upb_value val) { \
+ return (type_t)(converter)val.val; \
+ }
+
+FUNCS(int32, int32, int32_t, int32_t, UPB_CTYPE_INT32)
+FUNCS(int64, int64, int64_t, int64_t, UPB_CTYPE_INT64)
+FUNCS(uint32, uint32, uint32_t, uint32_t, UPB_CTYPE_UINT32)
+FUNCS(uint64, uint64, uint64_t, uint64_t, UPB_CTYPE_UINT64)
+FUNCS(bool, _bool, bool, bool, UPB_CTYPE_BOOL)
+FUNCS(cstr, cstr, char*, uintptr_t, UPB_CTYPE_CSTR)
+FUNCS(ptr, ptr, void*, uintptr_t, UPB_CTYPE_PTR)
+FUNCS(constptr, constptr, const void*, uintptr_t, UPB_CTYPE_CONSTPTR)
+
+#undef FUNCS
+
+UPB_INLINE void upb_value_setfloat(upb_value* val, float cval) {
+ memcpy(&val->val, &cval, sizeof(cval));
+}
+
+UPB_INLINE void upb_value_setdouble(upb_value* val, double cval) {
+ memcpy(&val->val, &cval, sizeof(cval));
+}
+
+UPB_INLINE upb_value upb_value_float(float cval) {
+ upb_value ret;
+ upb_value_setfloat(&ret, cval);
+ return ret;
+}
+
+UPB_INLINE upb_value upb_value_double(double cval) {
+ upb_value ret;
+ upb_value_setdouble(&ret, cval);
+ return ret;
+}
+
+#undef SET_TYPE
+
+/* upb_tabkey *****************************************************************/
+
+/* Either:
+ * 1. an actual integer key, or
+ * 2. a pointer to a string prefixed by its uint32_t length, owned by us.
+ *
+ * ...depending on whether this is a string table or an int table. We would
+ * make this a union of those two types, but C89 doesn't support statically
+ * initializing a non-first union member. */
+typedef uintptr_t upb_tabkey;
+
+UPB_INLINE char* upb_tabstr(upb_tabkey key, uint32_t* len) {
+ char* mem = (char*)key;
+ if (len) memcpy(len, mem, sizeof(*len));
+ return mem + sizeof(*len);
+}
+
+UPB_INLINE upb_StringView upb_tabstrview(upb_tabkey key) {
+ upb_StringView ret;
+ uint32_t len;
+ ret.data = upb_tabstr(key, &len);
+ ret.size = len;
+ return ret;
+}
+
+/* upb_tabval *****************************************************************/
+
+typedef struct upb_tabval {
+ uint64_t val;
+} upb_tabval;
+
+#define UPB_TABVALUE_EMPTY_INIT \
+ { -1 }
+
+/* upb_table ******************************************************************/
+
+typedef struct _upb_tabent {
+ upb_tabkey key;
+ upb_tabval val;
+
+ /* Internal chaining. This is const so we can create static initializers for
+ * tables. We cast away const sometimes, but *only* when the containing
+ * upb_table is known to be non-const. This requires a bit of care, but
+ * the subtlety is confined to table.c. */
+ const struct _upb_tabent* next;
+} upb_tabent;
+
+typedef struct {
+ size_t count; /* Number of entries in the hash part. */
+ uint32_t mask; /* Mask to turn hash value -> bucket. */
+ uint32_t max_count; /* Max count before we hit our load limit. */
+ uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */
+ upb_tabent* entries;
+} upb_table;
+
+typedef struct {
+ upb_table t;
+} upb_strtable;
+
+typedef struct {
+ upb_table t; /* For entries that don't fit in the array part. */
+ const upb_tabval* array; /* Array part of the table. See const note above. */
+ size_t array_size; /* Array part size. */
+ size_t array_count; /* Array part number of elements. */
+} upb_inttable;
+
+UPB_INLINE size_t upb_table_size(const upb_table* t) {
+ if (t->size_lg2 == 0)
+ return 0;
+ else
+ return 1 << t->size_lg2;
+}
+
+/* Internal-only functions, in .h file only out of necessity. */
+UPB_INLINE bool upb_tabent_isempty(const upb_tabent* e) { return e->key == 0; }
+
+/* Initialize and uninitialize a table, respectively. If memory allocation
+ * failed, false is returned that the table is uninitialized. */
+bool upb_inttable_init(upb_inttable* table, upb_Arena* a);
+bool upb_strtable_init(upb_strtable* table, size_t expected_size, upb_Arena* a);
+
+/* Returns the number of values in the table. */
+size_t upb_inttable_count(const upb_inttable* t);
+UPB_INLINE size_t upb_strtable_count(const upb_strtable* t) {
+ return t->t.count;
+}
+
+void upb_strtable_clear(upb_strtable* t);
+
+/* Inserts the given key into the hashtable with the given value. The key must
+ * not already exist in the hash table. For string tables, the key must be
+ * NULL-terminated, and the table will make an internal copy of the key.
+ * Inttables must not insert a value of UINTPTR_MAX.
+ *
+ * If a table resize was required but memory allocation failed, false is
+ * returned and the table is unchanged. */
+bool upb_inttable_insert(upb_inttable* t, uintptr_t key, upb_value val,
+ upb_Arena* a);
+bool upb_strtable_insert(upb_strtable* t, const char* key, size_t len,
+ upb_value val, upb_Arena* a);
+
+/* Looks up key in this table, returning "true" if the key was found.
+ * If v is non-NULL, copies the value for this key into *v. */
+bool upb_inttable_lookup(const upb_inttable* t, uintptr_t key, upb_value* v);
+bool upb_strtable_lookup2(const upb_strtable* t, const char* key, size_t len,
+ upb_value* v);
+
+/* For NULL-terminated strings. */
+UPB_INLINE bool upb_strtable_lookup(const upb_strtable* t, const char* key,
+ upb_value* v) {
+ return upb_strtable_lookup2(t, key, strlen(key), v);
+}
+
+/* Removes an item from the table. Returns true if the remove was successful,
+ * and stores the removed item in *val if non-NULL. */
+bool upb_inttable_remove(upb_inttable* t, uintptr_t key, upb_value* val);
+bool upb_strtable_remove2(upb_strtable* t, const char* key, size_t len,
+ upb_value* val);
+
+UPB_INLINE bool upb_strtable_remove(upb_strtable* t, const char* key,
+ upb_value* v) {
+ return upb_strtable_remove2(t, key, strlen(key), v);
+}
+
+/* Updates an existing entry in an inttable. If the entry does not exist,
+ * returns false and does nothing. Unlike insert/remove, this does not
+ * invalidate iterators. */
+bool upb_inttable_replace(upb_inttable* t, uintptr_t key, upb_value val);
+
+/* Optimizes the table for the current set of entries, for both memory use and
+ * lookup time. Client should call this after all entries have been inserted;
+ * inserting more entries is legal, but will likely require a table resize. */
+void upb_inttable_compact(upb_inttable* t, upb_Arena* a);
+
+/* Exposed for testing only. */
+bool upb_strtable_resize(upb_strtable* t, size_t size_lg2, upb_Arena* a);
+
+/* Iterators ******************************************************************/
+
+/* Iteration over inttable.
+ *
+ * intptr_t iter = UPB_INTTABLE_BEGIN;
+ * uintptr_t key;
+ * upb_value val;
+ * while (upb_inttable_next2(t, &key, &val, &iter)) {
+ * // ...
+ * }
+ */
+
+#define UPB_INTTABLE_BEGIN -1
+
+bool upb_inttable_next2(const upb_inttable* t, uintptr_t* key, upb_value* val,
+ intptr_t* iter);
+void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter);
+
+/* Iteration over strtable.
+ *
+ * intptr_t iter = UPB_INTTABLE_BEGIN;
+ * upb_StringView key;
+ * upb_value val;
+ * while (upb_strtable_next2(t, &key, &val, &iter)) {
+ * // ...
+ * }
+ */
+
+#define UPB_STRTABLE_BEGIN -1
+
+bool upb_strtable_next2(const upb_strtable* t, upb_StringView* key,
+ upb_value* val, intptr_t* iter);
+void upb_strtable_removeiter(upb_strtable* t, intptr_t* iter);
+
+/* DEPRECATED iterators, slated for removal.
+ *
+ * Iterators for int and string tables. We are subject to some kind of unusual
+ * design constraints:
+ *
+ * For high-level languages:
+ * - we must be able to guarantee that we don't crash or corrupt memory even if
+ * the program accesses an invalidated iterator.
+ *
+ * For C++11 range-based for:
+ * - iterators must be copyable
+ * - iterators must be comparable
+ * - it must be possible to construct an "end" value.
+ *
+ * Iteration order is undefined.
+ *
+ * Modifying the table invalidates iterators. upb_{str,int}table_done() is
+ * guaranteed to work even on an invalidated iterator, as long as the table it
+ * is iterating over has not been freed. Calling next() or accessing data from
+ * an invalidated iterator yields unspecified elements from the table, but it is
+ * guaranteed not to crash and to return real table elements (except when done()
+ * is true). */
+
+/* upb_strtable_iter **********************************************************/
+
+/* upb_strtable_iter i;
+ * upb_strtable_begin(&i, t);
+ * for(; !upb_strtable_done(&i); upb_strtable_next(&i)) {
+ * const char *key = upb_strtable_iter_key(&i);
+ * const upb_value val = upb_strtable_iter_value(&i);
+ * // ...
+ * }
+ */
+
+typedef struct {
+ const upb_strtable* t;
+ size_t index;
+} upb_strtable_iter;
+
+void upb_strtable_begin(upb_strtable_iter* i, const upb_strtable* t);
+void upb_strtable_next(upb_strtable_iter* i);
+bool upb_strtable_done(const upb_strtable_iter* i);
+upb_StringView upb_strtable_iter_key(const upb_strtable_iter* i);
+upb_value upb_strtable_iter_value(const upb_strtable_iter* i);
+void upb_strtable_iter_setdone(upb_strtable_iter* i);
+bool upb_strtable_iter_isequal(const upb_strtable_iter* i1,
+ const upb_strtable_iter* i2);
+
+/* upb_inttable_iter **********************************************************/
+
+/* upb_inttable_iter i;
+ * upb_inttable_begin(&i, t);
+ * for(; !upb_inttable_done(&i); upb_inttable_next(&i)) {
+ * uintptr_t key = upb_inttable_iter_key(&i);
+ * upb_value val = upb_inttable_iter_value(&i);
+ * // ...
+ * }
+ */
+
+typedef struct {
+ const upb_inttable* t;
+ size_t index;
+ bool array_part;
+} upb_inttable_iter;
+
+UPB_INLINE const upb_tabent* str_tabent(const upb_strtable_iter* i) {
+ return &i->t->t.entries[i->index];
+}
+
+void upb_inttable_begin(upb_inttable_iter* i, const upb_inttable* t);
+void upb_inttable_next(upb_inttable_iter* i);
+bool upb_inttable_done(const upb_inttable_iter* i);
+uintptr_t upb_inttable_iter_key(const upb_inttable_iter* i);
+upb_value upb_inttable_iter_value(const upb_inttable_iter* i);
+void upb_inttable_iter_setdone(upb_inttable_iter* i);
+bool upb_inttable_iter_isequal(const upb_inttable_iter* i1,
+ const upb_inttable_iter* i2);
+
+uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_TABLE_H_ */
diff --git a/grpc/third_party/upb/upb/test.proto b/grpc/third_party/upb/upb/test.proto
new file mode 100644
index 00000000..f4b94b40
--- /dev/null
+++ b/grpc/third_party/upb/upb/test.proto
@@ -0,0 +1,48 @@
+
+syntax = "proto2";
+
+package upb_test;
+
+message MapTest {
+ map<string, double> map_string_double = 1;
+}
+
+message MessageName {
+ optional int32 field1 = 1;
+ optional int32 field2 = 2;
+}
+
+message HelloRequest {
+ optional uint32 id = 1;
+ optional uint32 random_name_a0 = 2;
+ optional uint32 random_name_a1 = 3;
+ optional uint32 random_name_a2 = 4;
+ optional uint32 random_name_a3 = 5;
+ optional uint32 random_name_a4 = 6;
+ optional uint32 random_name_a5 = 7;
+ optional uint32 random_name_a6 = 8;
+ optional uint32 random_name_a7 = 9;
+ optional uint32 random_name_a8 = 10;
+ optional uint32 random_name_a9 = 11;
+ optional uint32 random_name_b0 = 12;
+ optional uint32 random_name_b1 = 13;
+ optional uint32 random_name_b2 = 14;
+ optional uint32 random_name_b3 = 15;
+ optional uint32 random_name_b4 = 16;
+ optional uint32 random_name_b5 = 17;
+ optional uint32 random_name_b6 = 18;
+ optional uint32 random_name_b7 = 19;
+ optional uint32 random_name_b8 = 20;
+ optional uint32 random_name_b9 = 21;
+ optional uint32 random_name_c0 = 22;
+ optional uint32 random_name_c1 = 23;
+ optional uint32 random_name_c2 = 24;
+ optional uint32 random_name_c3 = 25;
+ optional uint32 random_name_c4 = 26;
+ optional uint32 random_name_c5 = 27;
+ optional uint32 random_name_c6 = 28;
+ optional uint32 random_name_c7 = 29;
+ optional uint32 random_name_c8 = 30;
+ optional uint32 random_name_c9 = 31;
+ optional string version = 32;
+}
diff --git a/grpc/third_party/upb/upb/test_cpp.cc b/grpc/third_party/upb/upb/test_cpp.cc
new file mode 100644
index 00000000..29021cbc
--- /dev/null
+++ b/grpc/third_party/upb/upb/test_cpp.cc
@@ -0,0 +1,186 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+ * Tests for C++ wrappers.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <fstream>
+#include <iostream>
+#include <set>
+#include <sstream>
+
+#include "google/protobuf/timestamp.upb.h"
+#include "google/protobuf/timestamp.upbdefs.h"
+#include "gtest/gtest.h"
+#include "upb/def.h"
+#include "upb/def.hpp"
+#include "upb/json_decode.h"
+#include "upb/json_encode.h"
+#include "upb/test_cpp.upb.h"
+#include "upb/test_cpp.upbdefs.h"
+#include "upb/upb.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+TEST(Cpp, Iteration) {
+ upb::SymbolTable symtab;
+ upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
+
+ // Test range-based for on both fields and oneofs (with the iterator adaptor).
+ int field_count = 0;
+ for (auto field : md.fields()) {
+ UPB_UNUSED(field);
+ field_count++;
+ }
+ EXPECT_EQ(field_count, md.field_count());
+
+ int oneof_count = 0;
+ for (auto oneof : md.oneofs()) {
+ UPB_UNUSED(oneof);
+ oneof_count++;
+ }
+ EXPECT_EQ(oneof_count, md.oneof_count());
+}
+
+TEST(Cpp, Arena) {
+ int n = 100000;
+
+ struct Decrementer {
+ Decrementer(int* _p) : p(_p) {}
+ ~Decrementer() { (*p)--; }
+ int* p;
+ };
+
+ {
+ upb::Arena arena;
+ for (int i = 0; i < n; i++) {
+ arena.Own(new Decrementer(&n));
+
+ // Intersperse allocation and ensure we can write to it.
+ int* val = static_cast<int*>(upb_Arena_Malloc(arena.ptr(), sizeof(int)));
+ *val = i;
+ }
+
+ // Test a large allocation.
+ upb_Arena_Malloc(arena.ptr(), 1000000);
+ }
+ EXPECT_EQ(0, n);
+
+ {
+ // Test fuse.
+ upb::Arena arena1;
+ upb::Arena arena2;
+
+ arena1.Fuse(arena2);
+
+ upb_Arena_Malloc(arena1.ptr(), 10000);
+ upb_Arena_Malloc(arena2.ptr(), 10000);
+ }
+}
+
+TEST(Cpp, InlinedArena) {
+ int n = 100000;
+
+ struct Decrementer {
+ Decrementer(int* _p) : p(_p) {}
+ ~Decrementer() { (*p)--; }
+ int* p;
+ };
+
+ {
+ upb::InlinedArena<1024> arena;
+ for (int i = 0; i < n; i++) {
+ arena.Own(new Decrementer(&n));
+
+ // Intersperse allocation and ensure we can write to it.
+ int* val = static_cast<int*>(upb_Arena_Malloc(arena.ptr(), sizeof(int)));
+ *val = i;
+ }
+
+ // Test a large allocation.
+ upb_Arena_Malloc(arena.ptr(), 1000000);
+ }
+ EXPECT_EQ(0, n);
+}
+
+TEST(Cpp, Default) {
+ upb::SymbolTable symtab;
+ upb::Arena arena;
+ upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
+ upb_test_TestMessage* msg = upb_test_TestMessage_new(arena.ptr());
+ size_t size = upb_JsonEncode(msg, md.ptr(), NULL, 0, NULL, 0, NULL);
+ EXPECT_EQ(2, size); // "{}"
+}
+
+TEST(Cpp, JsonNull) {
+ upb::SymbolTable symtab;
+ upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr()));
+ upb::FieldDefPtr i32_f = md.FindFieldByName("i32");
+ upb::FieldDefPtr str_f = md.FindFieldByName("str");
+ ASSERT_TRUE(i32_f);
+ ASSERT_TRUE(str_f);
+ EXPECT_EQ(5, i32_f.default_value().int32_val);
+ EXPECT_EQ(0, strcmp(str_f.default_value().str_val.data, "abc"));
+ EXPECT_EQ(3, str_f.default_value().str_val.size);
+}
+
+TEST(Cpp, TimestampEncoder) {
+ upb::SymbolTable symtab;
+ upb::Arena arena;
+ upb::MessageDefPtr md(google_protobuf_Timestamp_getmsgdef(symtab.ptr()));
+ google_protobuf_Timestamp* timestamp_upb =
+ google_protobuf_Timestamp_new(arena.ptr());
+ google_protobuf_Timestamp* timestamp_upb_decoded =
+ google_protobuf_Timestamp_new(arena.ptr());
+
+ long timestamps[] = {
+ 253402300799, // 9999-12-31T23:59:59Z
+ 1641006000, // 2022-01-01T03:00:00Z
+ 0, // 1970-01-01T00:00:00Z
+ -31525200, // 1969-01-01T03:00:00Z
+ -2208988800, // 1900-01-01T00:00:00Z
+ -62135596800, // 0000-01-01T00:00:00Z
+ };
+
+ for (long timestamp : timestamps) {
+ google_protobuf_Timestamp_set_seconds(timestamp_upb, timestamp);
+
+ char json[128];
+ size_t size = upb_JsonEncode(timestamp_upb, md.ptr(), NULL, 0, json,
+ sizeof(json), NULL);
+ bool result = upb_JsonDecode(json, size, timestamp_upb_decoded, md.ptr(),
+ NULL, 0, arena.ptr(), NULL);
+ const long timestamp_decoded =
+ google_protobuf_Timestamp_seconds(timestamp_upb_decoded);
+
+ ASSERT_TRUE(result);
+ EXPECT_EQ(timestamp, timestamp_decoded);
+ }
+}
diff --git a/grpc/third_party/upb/upb/test_cpp.proto b/grpc/third_party/upb/upb/test_cpp.proto
new file mode 100644
index 00000000..4992b8c5
--- /dev/null
+++ b/grpc/third_party/upb/upb/test_cpp.proto
@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package upb.test;
+
+message TestMessage {
+ optional int32 i32 = 1 [default = 5];
+ repeated int32 r_i32 = 2;
+ optional string str = 3 [default = "abc"];
+ repeated string r_str = 4;
+ optional TestMessage msg = 5;
+ repeated TestMessage r_msg = 6;
+}
diff --git a/grpc/third_party/upb/upb/test_generated_code.cc b/grpc/third_party/upb/upb/test_generated_code.cc
new file mode 100644
index 00000000..7e36729d
--- /dev/null
+++ b/grpc/third_party/upb/upb/test_generated_code.cc
@@ -0,0 +1,977 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Test of generated code, with a special focus on features that are not used in
+ * descriptor.proto or conformance.proto (since these get some testing from
+ * upb/def.c and tests/conformance_upb.c, respectively).
+ */
+
+#include "gtest/gtest.h"
+#include "src/google/protobuf/test_messages_proto2.upb.h"
+#include "src/google/protobuf/test_messages_proto3.upb.h"
+#include "upb/test.upb.h"
+#include "upb/upb.hpp"
+
+#if !defined(MIN)
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#endif
+
+const char test_str[] = "abcdefg";
+const char test_str2[] = "12345678910";
+const char test_str3[] = "rstlnezxcvbnm";
+const char test_str4[] = "just another test string";
+
+const upb_StringView test_str_view = {test_str, sizeof(test_str) - 1};
+const upb_StringView test_str_view2 = {test_str2, sizeof(test_str2) - 1};
+const upb_StringView test_str_view3 = {test_str3, sizeof(test_str3) - 1};
+const upb_StringView test_str_view4 = {test_str4, sizeof(test_str4) - 1};
+
+const int32_t test_int32 = 10;
+const int32_t test_int32_2 = -20;
+const int32_t test_int32_3 = 30;
+const int32_t test_int32_4 = -40;
+
+TEST(GeneratedCode, ScalarsProto3) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg2;
+ upb_StringView serialized;
+ upb_StringView val;
+
+ // Test serialization.
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int32(msg, 10);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_int64(msg, 20);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_uint32(msg, 30);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_uint64(msg, 40);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_float(msg,
+ 50.5);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_double(msg,
+ 60.6);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_bool(msg, 1);
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_string(
+ msg, test_str_view);
+
+ serialized.data = protobuf_test_messages_proto3_TestAllTypesProto3_serialize(
+ msg, arena, &serialized.size);
+
+ msg2 = protobuf_test_messages_proto3_TestAllTypesProto3_parse(
+ serialized.data, serialized.size, arena);
+
+ EXPECT_EQ(10, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int32(
+ msg2));
+ EXPECT_EQ(20, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(
+ msg2));
+ EXPECT_EQ(
+ 30,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint32(msg2));
+ EXPECT_EQ(
+ 40,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg2));
+ EXPECT_EQ(
+ 50.5,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_float(msg2));
+ EXPECT_EQ(
+ 60.6,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_double(msg2));
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_bool(msg2));
+ val = protobuf_test_messages_proto3_TestAllTypesProto3_optional_string(msg2);
+ EXPECT_TRUE(upb_StringView_IsEqual(val, test_str_view));
+
+ // Test clear.
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_int32(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int32(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_int64(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_uint32(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint32(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_uint64(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_float(msg);
+ EXPECT_EQ(
+ 0.0f,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_float(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_double(msg);
+ EXPECT_EQ(
+ 0.0,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_double(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_bool(msg);
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto3_TestAllTypesProto3_optional_bool(msg));
+ protobuf_test_messages_proto3_TestAllTypesProto3_clear_optional_string(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_string(msg)
+ .size);
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, ScalarsProto2) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto2_TestAllTypesProto2* msg =
+ protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2* msg2;
+ upb_StringView serialized;
+
+ // Test hazzer and serialization.
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int32(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_int32(msg, 10);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int32(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int64(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_int64(msg, 20);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int64(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint32(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_uint32(msg, 30);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint32(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint64(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_uint64(msg, 40);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint64(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sint32(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_sint32(msg, 50);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sint32(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sint64(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_sint64(msg, 60);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sint64(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_fixed32(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_fixed32(msg,
+ 70);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_fixed32(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_fixed64(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_fixed64(msg,
+ 80);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_fixed64(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sfixed32(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_sfixed32(msg,
+ 90);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sfixed32(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sfixed64(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_sfixed64(msg,
+ 100);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_sfixed64(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_float(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_float(msg,
+ 50.5);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_float(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_double(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_double(msg,
+ 60.6);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_double(
+ msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bool(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_bool(msg, 1);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bool(msg));
+
+ serialized.data = protobuf_test_messages_proto2_TestAllTypesProto2_serialize(
+ msg, arena, &serialized.size);
+
+ msg2 = protobuf_test_messages_proto2_TestAllTypesProto2_parse(
+ serialized.data, serialized.size, arena);
+
+ EXPECT_EQ(10, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(
+ msg2));
+ EXPECT_EQ(20, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int64(
+ msg2));
+ EXPECT_EQ(
+ 30,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg2));
+ EXPECT_EQ(
+ 40,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint64(msg2));
+ EXPECT_EQ(
+ 50,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_sint32(msg2));
+ EXPECT_EQ(
+ 60,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_sint64(msg2));
+ EXPECT_EQ(
+ 70,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_fixed32(msg2));
+ EXPECT_EQ(
+ 80,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_fixed64(msg2));
+ EXPECT_EQ(
+ 90,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_sfixed32(msg2));
+ EXPECT_EQ(
+ 100,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_sfixed64(msg2));
+ EXPECT_EQ(
+ 50.5,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_float(msg2));
+ EXPECT_EQ(
+ 60.6,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_double(msg2));
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg2));
+
+ // Test clear.
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_int32(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int32(msg));
+
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_int64(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int64(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_int64(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_uint32(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint32(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_uint64(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint64(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_uint64(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_float(msg);
+ EXPECT_EQ(
+ 0.0f,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_float(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_float(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_double(msg);
+ EXPECT_EQ(
+ 0.0,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_double(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_double(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_bool(msg);
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg));
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bool(msg));
+
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, Bytes) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto2_TestAllTypesProto2* msg =
+ protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2* msg2;
+ upb_StringView serialized;
+ const char data[] = "ABCDEF";
+ upb_StringView bytes = upb_StringView_FromString(data);
+ upb_StringView val;
+
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bytes(msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_bytes(msg,
+ bytes);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bytes(msg));
+
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string(
+ msg));
+ protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string(
+ msg, test_str_view);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string(
+ msg));
+
+ serialized.data = protobuf_test_messages_proto2_TestAllTypesProto2_serialize(
+ msg, arena, &serialized.size);
+
+ msg2 = protobuf_test_messages_proto2_TestAllTypesProto2_parse(
+ serialized.data, serialized.size, arena);
+
+ EXPECT_EQ(bytes.size,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_bytes(msg)
+ .size);
+ EXPECT_EQ(
+ 0, memcmp(bytes.data,
+ protobuf_test_messages_proto2_TestAllTypesProto2_optional_bytes(
+ msg)
+ .data,
+ bytes.size));
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_bytes(msg);
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_bytes(msg));
+
+ val = protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg2);
+ EXPECT_TRUE(upb_StringView_IsEqual(val, test_str_view));
+
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_optional_string(msg);
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg)
+ .size);
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string(
+ msg));
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, Extension) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect* msg =
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_new(
+ arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect* msg2;
+ upb_StringView serialized;
+
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension(
+ msg));
+
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2* ext =
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_new(
+ arena);
+ EXPECT_EQ(
+ 0,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i(
+ ext));
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_set_i(
+ ext, 5);
+ EXPECT_EQ(
+ 5,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i(
+ ext));
+ // Test setter/hazzer.
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_set_message_set_extension(
+ msg, ext, arena);
+ EXPECT_EQ(
+ true,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension(
+ msg));
+ // Test serialize.
+ serialized.data =
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_serialize(
+ msg, arena, &serialized.size);
+ msg2 =
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrect_parse(
+ serialized.data, serialized.size, arena);
+ const protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2*
+ ext2 =
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_message_set_extension(
+ msg);
+ EXPECT_EQ(
+ 5,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_i(
+ ext2));
+
+ // Test Clear.
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_clear_message_set_extension(
+ msg);
+ EXPECT_EQ(
+ false,
+ protobuf_test_messages_proto2_TestAllTypesProto2_MessageSetCorrectExtension2_has_message_set_extension(
+ msg));
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, RepeatedClear) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto2_TestAllTypesProto2* msg =
+ protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);
+ size_t len = 0;
+ protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len);
+ EXPECT_EQ(0, len);
+ protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 2,
+ arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 3,
+ arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2_add_repeated_int32(msg, 4,
+ arena);
+ protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len);
+ EXPECT_EQ(3, len);
+ protobuf_test_messages_proto2_TestAllTypesProto2_clear_repeated_int32(msg);
+ protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, &len);
+ EXPECT_EQ(0, len);
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, UTF8) {
+ const char invalid_utf8[] = "\xff";
+ const upb_StringView invalid_utf8_view =
+ upb_StringView_FromDataAndSize(invalid_utf8, 1);
+ upb_Arena* arena = upb_Arena_New();
+ upb_StringView serialized;
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg2;
+
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_string(
+ msg, invalid_utf8_view);
+
+ serialized.data = protobuf_test_messages_proto3_TestAllTypesProto3_serialize(
+ msg, arena, &serialized.size);
+
+ msg2 = protobuf_test_messages_proto3_TestAllTypesProto3_parse(
+ serialized.data, serialized.size, arena);
+ EXPECT_EQ(nullptr, msg2);
+
+ upb_Arena_Free(arena);
+}
+
+static void check_string_map_empty(
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg) {
+ size_t iter = kUpb_Map_Begin;
+
+ EXPECT_EQ(
+ 0,
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_size(
+ msg));
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
+ msg, &iter));
+}
+
+static void check_string_map_one_entry(
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg) {
+ const protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry*
+ const_ent;
+ size_t iter;
+ upb_StringView str;
+
+ EXPECT_EQ(
+ 1,
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_size(
+ msg));
+ EXPECT_TRUE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_get(
+ msg, test_str_view, &str));
+ EXPECT_TRUE(upb_StringView_IsEqual(str, test_str_view2));
+
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_get(
+ msg, test_str_view3, &str));
+
+ /* Test that iteration reveals a single k/v pair in the map. */
+ iter = kUpb_Map_Begin;
+ const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
+ msg, &iter);
+ ASSERT_NE(nullptr, const_ent);
+ EXPECT_TRUE(upb_StringView_IsEqual(
+ test_str_view,
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_key(
+ const_ent)));
+ EXPECT_TRUE(upb_StringView_IsEqual(
+ test_str_view2,
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_value(
+ const_ent)));
+
+ const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
+ msg, &iter);
+ EXPECT_EQ(nullptr, const_ent);
+}
+
+TEST(GeneratedCode, StringDoubleMap) {
+ upb_Arena* arena = upb_Arena_New();
+ upb_StringView serialized;
+ upb_test_MapTest* msg = upb_test_MapTest_new(arena);
+ upb_test_MapTest* msg2;
+ double val;
+
+ upb_test_MapTest_map_string_double_set(msg, test_str_view, 1.5, arena);
+ ASSERT_NE(nullptr, msg);
+ EXPECT_TRUE(upb_test_MapTest_map_string_double_get(msg, test_str_view, &val));
+ EXPECT_EQ(1.5, val);
+ val = 0;
+
+ serialized.data = upb_test_MapTest_serialize(msg, arena, &serialized.size);
+ EXPECT_NE(nullptr, serialized.data);
+
+ msg2 = upb_test_MapTest_parse(serialized.data, serialized.size, arena);
+ ASSERT_NE(nullptr, msg2);
+ EXPECT_TRUE(
+ upb_test_MapTest_map_string_double_get(msg2, test_str_view, &val));
+ EXPECT_EQ(1.5, val);
+
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, StringMap) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
+ const protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry*
+ const_ent;
+ size_t iter, count;
+
+ check_string_map_empty(msg);
+
+ /* Set map[test_str_view] = test_str_view2 */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
+ msg, test_str_view, test_str_view2, arena);
+ check_string_map_one_entry(msg);
+
+ /* Deleting a non-existent key does nothing. */
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_delete(
+ msg, test_str_view3));
+ check_string_map_one_entry(msg);
+
+ /* Deleting the key sets the map back to empty. */
+ EXPECT_TRUE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_delete(
+ msg, test_str_view));
+ check_string_map_empty(msg);
+
+ /* Set two keys this time:
+ * map[test_str_view] = test_str_view2
+ * map[test_str_view3] = test_str_view4
+ */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
+ msg, test_str_view, test_str_view2, arena);
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_set(
+ msg, test_str_view3, test_str_view4, arena);
+
+ /* Test iteration */
+ iter = kUpb_Map_Begin;
+ count = 0;
+
+ while (
+ (const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_next(
+ msg, &iter)) != NULL) {
+ upb_StringView key =
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_key(
+ const_ent);
+ upb_StringView val =
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapStringStringEntry_value(
+ const_ent);
+
+ count++;
+ if (upb_StringView_IsEqual(key, test_str_view)) {
+ EXPECT_TRUE(upb_StringView_IsEqual(val, test_str_view2));
+ } else {
+ EXPECT_TRUE(upb_StringView_IsEqual(key, test_str_view3));
+ EXPECT_TRUE(upb_StringView_IsEqual(val, test_str_view4));
+ }
+ }
+
+ EXPECT_EQ(2, count);
+
+ /* Clearing the map goes back to empty. */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_string_string_clear(msg);
+ check_string_map_empty(msg);
+
+ upb_Arena_Free(arena);
+}
+
+static void check_int32_map_empty(
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg) {
+ size_t iter = kUpb_Map_Begin;
+
+ EXPECT_EQ(
+ 0, protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_size(
+ msg));
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
+ msg, &iter));
+}
+
+static void check_int32_map_one_entry(
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg) {
+ const protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry*
+ const_ent;
+ size_t iter;
+ int32_t val;
+
+ EXPECT_EQ(
+ 1, protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_size(
+ msg));
+ EXPECT_TRUE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_get(
+ msg, test_int32, &val));
+ EXPECT_EQ(val, test_int32_2);
+
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_get(
+ msg, test_int32_3, &val));
+
+ /* Test that iteration reveals a single k/v pair in the map. */
+ iter = kUpb_Map_Begin;
+ const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
+ msg, &iter);
+ ASSERT_NE(nullptr, const_ent);
+ EXPECT_EQ(
+ test_int32,
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_key(
+ const_ent));
+ EXPECT_EQ(
+ test_int32_2,
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_value(
+ const_ent));
+
+ const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
+ msg, &iter);
+ EXPECT_EQ(nullptr, const_ent);
+}
+
+TEST(GeneratedCode, Int32Map) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
+ const protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry*
+ const_ent;
+ size_t iter, count;
+
+ check_int32_map_empty(msg);
+
+ /* Set map[test_int32] = test_int32_2 */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
+ msg, test_int32, test_int32_2, arena);
+ check_int32_map_one_entry(msg);
+
+ /* Deleting a non-existent key does nothing. */
+ EXPECT_FALSE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_delete(
+ msg, test_int32_3));
+ check_int32_map_one_entry(msg);
+
+ /* Deleting the key sets the map back to empty. */
+ EXPECT_TRUE(
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_delete(
+ msg, test_int32));
+ check_int32_map_empty(msg);
+
+ /* Set two keys this time:
+ * map[test_int32] = test_int32_2
+ * map[test_int32_3] = test_int32_4
+ */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
+ msg, test_int32, test_int32_2, arena);
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_set(
+ msg, test_int32_3, test_int32_4, arena);
+
+ /* Test iteration */
+ iter = kUpb_Map_Begin;
+ count = 0;
+
+ while (
+ (const_ent =
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_next(
+ msg, &iter)) != NULL) {
+ int32_t key =
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_key(
+ const_ent);
+ int32_t val =
+ protobuf_test_messages_proto3_TestAllTypesProto3_MapInt32Int32Entry_value(
+ const_ent);
+
+ count++;
+ if (key == test_int32) {
+ EXPECT_EQ(val, test_int32_2);
+ } else {
+ EXPECT_EQ(key, test_int32_3);
+ EXPECT_EQ(val, test_int32_4);
+ }
+ }
+
+ EXPECT_EQ(2, count);
+
+ /* Clearing the map goes back to empty. */
+ protobuf_test_messages_proto3_TestAllTypesProto3_map_int32_int32_clear(msg);
+ check_int32_map_empty(msg);
+
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, TestRepeated) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);
+ size_t size;
+ const int* elems;
+
+ protobuf_test_messages_proto3_TestAllTypesProto3_add_repeated_int32(msg, 5,
+ arena);
+
+ elems = protobuf_test_messages_proto3_TestAllTypesProto3_repeated_int32(
+ msg, &size);
+
+ EXPECT_EQ(1, size);
+ EXPECT_EQ(5, elems[0]);
+
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, Issue9440) {
+ upb::Arena arena;
+ upb_test_HelloRequest* msg = upb_test_HelloRequest_new(arena.ptr());
+ upb_test_HelloRequest_set_id(msg, 8);
+ EXPECT_EQ(8, upb_test_HelloRequest_id(msg));
+ char str[] = "1";
+ upb_test_HelloRequest_set_version(msg, upb_StringView{str, strlen(str)});
+ EXPECT_EQ(8, upb_test_HelloRequest_id(msg));
+}
+
+TEST(GeneratedCode, NullDecodeBuffer) {
+ upb_Arena* arena = upb_Arena_New();
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_parse(NULL, 0, arena);
+ size_t size;
+
+ ASSERT_NE(nullptr, msg);
+ protobuf_test_messages_proto3_TestAllTypesProto3_serialize(msg, arena, &size);
+ EXPECT_EQ(0, size);
+ upb_Arena_Free(arena);
+}
+
+TEST(GeneratedCode, StatusTruncation) {
+ int i, j;
+ upb_Status status;
+ upb_Status status2;
+ for (i = 0; i < _kUpb_Status_MaxMessage + 20; i++) {
+ char* msg = static_cast<char*>(malloc(i + 1));
+ int end;
+ char ch = (i % 96) + 33; /* Cycle through printable chars. */
+
+ for (j = 0; j < i; j++) {
+ msg[j] = ch;
+ }
+ msg[i] = '\0';
+
+ upb_Status_SetErrorMessage(&status, msg);
+ upb_Status_SetErrorFormat(&status2, "%s", msg);
+ end = MIN(i, _kUpb_Status_MaxMessage - 1);
+ EXPECT_EQ(end, strlen(status.msg));
+ EXPECT_EQ(end, strlen(status2.msg));
+
+ for (j = 0; j < end; j++) {
+ EXPECT_EQ(ch, status.msg[j]);
+ EXPECT_EQ(ch, status2.msg[j]);
+ }
+
+ free(msg);
+ }
+}
+
+static void decrement_int(void* ptr) {
+ int* iptr = static_cast<int*>(ptr);
+ (*iptr)--;
+}
+
+TEST(GeneratedCode, ArenaFuse) {
+ int i1 = 5;
+ int i2 = 5;
+ int i3 = 5;
+ int i4 = 5;
+
+ upb_Arena* arena1 = upb_Arena_New();
+ upb_Arena* arena2 = upb_Arena_New();
+
+ upb_Arena_AddCleanup(arena1, &i1, decrement_int);
+ upb_Arena_AddCleanup(arena2, &i2, decrement_int);
+
+ EXPECT_TRUE(upb_Arena_Fuse(arena1, arena2));
+
+ upb_Arena_AddCleanup(arena1, &i3, decrement_int);
+ upb_Arena_AddCleanup(arena2, &i4, decrement_int);
+
+ upb_Arena_Free(arena1);
+ EXPECT_EQ(5, i1);
+ EXPECT_EQ(5, i2);
+ EXPECT_EQ(5, i3);
+ EXPECT_EQ(5, i4);
+ upb_Arena_Free(arena2);
+ EXPECT_EQ(4, i1);
+ EXPECT_EQ(4, i2);
+ EXPECT_EQ(4, i3);
+ EXPECT_EQ(4, i4);
+}
+
+/* Do nothing allocator for testing */
+static void* test_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize,
+ size_t size) {
+ return upb_alloc_global.func(alloc, ptr, oldsize, size);
+}
+upb_alloc test_alloc = {&test_allocfunc};
+
+TEST(GeneratedCode, FuseWithInitialBlock) {
+ char buf1[1024];
+ char buf2[1024];
+ upb_Arena* arenas[] = {upb_Arena_Init(buf1, 1024, &upb_alloc_global),
+ upb_Arena_Init(buf2, 1024, &upb_alloc_global),
+ upb_Arena_Init(NULL, 0, &test_alloc),
+ upb_Arena_Init(NULL, 0, &upb_alloc_global)};
+ int size = sizeof(arenas) / sizeof(arenas[0]);
+ for (int i = 0; i < size; ++i) {
+ for (int j = 0; j < size; ++j) {
+ if (i == j) {
+ EXPECT_TRUE(upb_Arena_Fuse(arenas[i], arenas[j]));
+ } else {
+ EXPECT_FALSE(upb_Arena_Fuse(arenas[i], arenas[j]));
+ }
+ }
+ }
+
+ for (int i = 0; i < size; ++i) upb_Arena_Free(arenas[i]);
+}
+
+TEST(GeneratedCode, ArenaDecode) {
+ // Tests against a bug that previously existed when passing an arena to
+ // upb_decode().
+ char large_string[1024] = {0};
+ upb_StringView large_string_view = {large_string, sizeof(large_string)};
+ upb_Arena* tmp = upb_Arena_New();
+
+ protobuf_test_messages_proto3_TestAllTypesProto3* msg =
+ protobuf_test_messages_proto3_TestAllTypesProto3_new(tmp);
+
+ protobuf_test_messages_proto3_TestAllTypesProto3_set_optional_bytes(
+ msg, large_string_view);
+
+ upb_StringView serialized;
+ serialized.data = protobuf_test_messages_proto3_TestAllTypesProto3_serialize(
+ msg, tmp, &serialized.size);
+
+ upb_Arena* arena = upb_Arena_New();
+ // Parse the large payload, forcing an arena block to be allocated. This used
+ // to corrupt the cleanup list, preventing subsequent upb_Arena_AddCleanup()
+ // calls from working properly.
+ protobuf_test_messages_proto3_TestAllTypesProto3_parse(
+ serialized.data, serialized.size, arena);
+
+ int i1 = 5;
+ upb_Arena_AddCleanup(arena, &i1, decrement_int);
+ EXPECT_EQ(5, i1);
+ upb_Arena_Free(arena);
+ EXPECT_EQ(4, i1);
+
+ upb_Arena_Free(tmp);
+}
+
+TEST(GeneratedCode, ArenaUnaligned) {
+ char buf1[1024];
+ // Force the pointer to be unaligned.
+ char* unaligned_buf_ptr = (char*)((uintptr_t)buf1 | 7);
+ upb_Arena* arena = upb_Arena_Init(
+ unaligned_buf_ptr, &buf1[sizeof(buf1)] - unaligned_buf_ptr, NULL);
+ char* mem = static_cast<char*>(upb_Arena_Malloc(arena, 5));
+ EXPECT_EQ(0, reinterpret_cast<uintptr_t>(mem) & 15);
+ upb_Arena_Free(arena);
+
+ // Try the same, but with a size so small that aligning up will overflow.
+ arena = upb_Arena_Init(unaligned_buf_ptr, 5, &upb_alloc_global);
+ mem = static_cast<char*>(upb_Arena_Malloc(arena, 5));
+ EXPECT_EQ(0, reinterpret_cast<uintptr_t>(mem) & 15);
+ upb_Arena_Free(arena);
+}
diff --git a/grpc/third_party/upb/upb/test_table.cc b/grpc/third_party/upb/upb/test_table.cc
new file mode 100644
index 00000000..2c368f83
--- /dev/null
+++ b/grpc/third_party/upb/upb/test_table.cc
@@ -0,0 +1,580 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*
+ * Tests for upb_table.
+ */
+
+#include <limits.h>
+#include <string.h>
+#include <sys/resource.h>
+
+#include <iostream>
+#include <map>
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "upb/table_internal.h"
+#include "upb/upb.hpp"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+// Convenience interface for C++. We don't put this in upb itself because
+// the table is not exposed to users.
+
+namespace upb {
+
+template <class T>
+upb_value MakeUpbValue(T val);
+template <class T>
+T GetUpbValue(upb_value val);
+
+#define FUNCS(name, type_t, enumval) \
+ template <> \
+ upb_value MakeUpbValue<type_t>(type_t val) { \
+ return upb_value_##name(val); \
+ } \
+ template <> \
+ type_t GetUpbValue<type_t>(upb_value val) { \
+ return upb_value_get##name(val); \
+ }
+
+FUNCS(int32, int32_t, UPB_CTYPE_INT32)
+FUNCS(int64, int64_t, UPB_CTYPE_INT64)
+FUNCS(uint32, uint32_t, UPB_CTYPE_UINT32)
+FUNCS(uint64, uint64_t, UPB_CTYPE_UINT64)
+FUNCS(bool, bool, UPB_CTYPE_BOOL)
+FUNCS(cstr, char*, UPB_CTYPE_CSTR)
+FUNCS(ptr, void*, UPB_CTYPE_PTR)
+FUNCS(constptr, const void*, UPB_CTYPE_CONSTPTR)
+
+#undef FUNCS
+
+class IntTable {
+ public:
+ IntTable() { upb_inttable_init(&table_, arena_.ptr()); }
+
+ size_t count() { return upb_inttable_count(&table_); }
+
+ bool Insert(uintptr_t key, upb_value val) {
+ return upb_inttable_insert(&table_, key, val, arena_.ptr());
+ }
+
+ bool Replace(uintptr_t key, upb_value val) {
+ return upb_inttable_replace(&table_, key, val);
+ }
+
+ std::pair<bool, upb_value> Remove(uintptr_t key) {
+ std::pair<bool, upb_value> ret;
+ ret.first = upb_inttable_remove(&table_, key, &ret.second);
+ return ret;
+ }
+
+ std::pair<bool, upb_value> Lookup(uintptr_t key) const {
+ std::pair<bool, upb_value> ret;
+ ret.first = upb_inttable_lookup(&table_, key, &ret.second);
+ return ret;
+ }
+
+ std::pair<bool, upb_value> Lookup32(uint32_t key) const {
+ std::pair<bool, upb_value> ret;
+ ret.first = upb_inttable_lookup(&table_, key, &ret.second);
+ return ret;
+ }
+
+ void Compact() { upb_inttable_compact(&table_, arena_.ptr()); }
+
+ class iterator : public std::iterator<std::forward_iterator_tag,
+ std::pair<uintptr_t, upb_value> > {
+ public:
+ explicit iterator(IntTable* table) {
+ upb_inttable_begin(&iter_, &table->table_);
+ }
+
+ static iterator end(IntTable* table) {
+ iterator iter(table);
+ upb_inttable_iter_setdone(&iter.iter_);
+ return iter;
+ }
+
+ void operator++() { return upb_inttable_next(&iter_); }
+
+ std::pair<uintptr_t, upb_value> operator*() const {
+ std::pair<uintptr_t, upb_value> ret;
+ ret.first = upb_inttable_iter_key(&iter_);
+ ret.second = upb_inttable_iter_value(&iter_);
+ return ret;
+ }
+
+ bool operator==(const iterator& other) const {
+ return upb_inttable_iter_isequal(&iter_, &other.iter_);
+ }
+
+ bool operator!=(const iterator& other) const { return !(*this == other); }
+
+ private:
+ upb_inttable_iter iter_;
+ };
+
+ upb::Arena arena_;
+ upb_inttable table_;
+};
+
+class StrTable {
+ public:
+ StrTable() { upb_strtable_init(&table_, 4, arena_.ptr()); }
+
+ size_t count() { return upb_strtable_count(&table_); }
+
+ bool Insert(const std::string& key, upb_value val) {
+ return upb_strtable_insert(&table_, key.c_str(), key.size(), val,
+ arena_.ptr());
+ }
+
+ std::pair<bool, upb_value> Remove(const std::string& key) {
+ std::pair<bool, upb_value> ret;
+ ret.first =
+ upb_strtable_remove2(&table_, key.c_str(), key.size(), &ret.second);
+ return ret;
+ }
+
+ std::pair<bool, upb_value> Lookup(const std::string& key) const {
+ std::pair<bool, upb_value> ret;
+ ret.first =
+ upb_strtable_lookup2(&table_, key.c_str(), key.size(), &ret.second);
+ return ret;
+ }
+
+ void Resize(size_t size_lg2) {
+ upb_strtable_resize(&table_, size_lg2, arena_.ptr());
+ }
+
+ class iterator : public std::iterator<std::forward_iterator_tag,
+ std::pair<std::string, upb_value> > {
+ public:
+ explicit iterator(StrTable* table) {
+ upb_strtable_begin(&iter_, &table->table_);
+ }
+
+ static iterator end(StrTable* table) {
+ iterator iter(table);
+ upb_strtable_iter_setdone(&iter.iter_);
+ return iter;
+ }
+
+ void operator++() { return upb_strtable_next(&iter_); }
+
+ std::pair<std::string, upb_value> operator*() const {
+ std::pair<std::string, upb_value> ret;
+ upb_StringView view = upb_strtable_iter_key(&iter_);
+ ret.first.assign(view.data, view.size);
+ ret.second = upb_strtable_iter_value(&iter_);
+ return ret;
+ }
+
+ bool operator==(const iterator& other) const {
+ return upb_strtable_iter_isequal(&iter_, &other.iter_);
+ }
+
+ bool operator!=(const iterator& other) const { return !(*this == other); }
+
+ private:
+ upb_strtable_iter iter_;
+ };
+
+ upb::Arena arena_;
+ upb_strtable table_;
+};
+
+template <class T>
+class TypedStrTable {
+ public:
+ size_t count() { return table_.count(); }
+
+ bool Insert(const std::string& key, T val) {
+ return table_.Insert(key, MakeUpbValue<T>(val));
+ }
+
+ std::pair<bool, T> Remove(const std::string& key) {
+ std::pair<bool, upb_value> found = table_.Remove(key);
+ std::pair<bool, T> ret;
+ ret.first = found.first;
+ if (ret.first) {
+ ret.second = GetUpbValue<T>(found.second);
+ }
+ return ret;
+ }
+
+ std::pair<bool, T> Lookup(const std::string& key) const {
+ std::pair<bool, upb_value> found = table_.Lookup(key);
+ std::pair<bool, T> ret;
+ ret.first = found.first;
+ if (ret.first) {
+ ret.second = GetUpbValue<T>(found.second);
+ }
+ return ret;
+ }
+
+ void Resize(size_t size_lg2) { table_.Resize(size_lg2); }
+
+ class iterator : public std::iterator<std::forward_iterator_tag,
+ std::pair<std::string, T> > {
+ public:
+ explicit iterator(TypedStrTable* table) : iter_(&table->table_) {}
+ static iterator end(TypedStrTable* table) {
+ iterator iter(table);
+ iter.iter_ = StrTable::iterator::end(&table->table_);
+ return iter;
+ }
+
+ void operator++() { ++iter_; }
+
+ std::pair<std::string, T> operator*() const {
+ std::pair<std::string, upb_value> val = *iter_;
+ std::pair<std::string, T> ret;
+ ret.first = val.first;
+ ret.second = GetUpbValue<T>(val.second);
+ return ret;
+ }
+
+ bool operator==(const iterator& other) const {
+ return iter_ == other.iter_;
+ }
+
+ bool operator!=(const iterator& other) const {
+ return iter_ != other.iter_;
+ }
+
+ private:
+ StrTable::iterator iter_;
+ };
+
+ iterator begin() { return iterator(this); }
+ iterator end() { return iterator::end(this); }
+
+ StrTable table_;
+};
+
+template <class T>
+class TypedIntTable {
+ public:
+ size_t count() { return table_.count(); }
+
+ bool Insert(uintptr_t key, T val) {
+ return table_.Insert(key, MakeUpbValue<T>(val));
+ }
+
+ bool Replace(uintptr_t key, T val) {
+ return table_.Replace(key, MakeUpbValue<T>(val));
+ }
+
+ std::pair<bool, T> Remove(uintptr_t key) {
+ std::pair<bool, upb_value> found = table_.Remove(key);
+ std::pair<bool, T> ret;
+ ret.first = found.first;
+ if (ret.first) {
+ ret.second = GetUpbValue<T>(found.second);
+ }
+ return ret;
+ }
+
+ std::pair<bool, T> Lookup(uintptr_t key) const {
+ std::pair<bool, upb_value> found = table_.Lookup(key);
+ std::pair<bool, T> ret;
+ ret.first = found.first;
+ if (ret.first) {
+ ret.second = GetUpbValue<T>(found.second);
+ }
+ return ret;
+ }
+
+ void Compact() { table_.Compact(); }
+
+ class iterator : public std::iterator<std::forward_iterator_tag,
+ std::pair<uintptr_t, T> > {
+ public:
+ explicit iterator(TypedIntTable* table) : iter_(&table->table_) {}
+ static iterator end(TypedIntTable* table) {
+ return IntTable::iterator::end(&table->table_);
+ }
+
+ void operator++() { ++iter_; }
+
+ std::pair<uintptr_t, T> operator*() const {
+ std::pair<uintptr_t, upb_value> val = *iter_;
+ std::pair<uintptr_t, T> ret;
+ ret.first = val.first;
+ ret.second = GetUpbValue<T>(val.second);
+ return ret;
+ }
+
+ bool operator==(const iterator& other) const {
+ return iter_ == other.iter_;
+ }
+
+ bool operator!=(const iterator& other) const {
+ return iter_ != other.iter_;
+ }
+
+ private:
+ IntTable::iterator iter_;
+ };
+
+ iterator begin() { return iterator(this); }
+ iterator end() { return iterator::end(this); }
+
+ IntTable table_;
+};
+
+} // namespace upb
+
+#define CPU_TIME_PER_TEST 0.5
+
+using std::vector;
+
+double get_usertime() {
+ struct rusage usage;
+ getrusage(RUSAGE_SELF, &usage);
+ return usage.ru_utime.tv_sec + (usage.ru_utime.tv_usec / 1000000.0);
+}
+
+TEST(Table, StringTable) {
+ vector<std::string> keys;
+ keys.push_back("google.protobuf.FileDescriptorSet");
+ keys.push_back("google.protobuf.FileDescriptorProto");
+ keys.push_back("google.protobuf.DescriptorProto");
+ keys.push_back("google.protobuf.DescriptorProto.ExtensionRange");
+ keys.push_back("google.protobuf.FieldDescriptorProto");
+ keys.push_back("google.protobuf.EnumDescriptorProto");
+ keys.push_back("google.protobuf.EnumValueDescriptorProto");
+ keys.push_back("google.protobuf.ServiceDescriptorProto");
+ keys.push_back("google.protobuf.MethodDescriptorProto");
+ keys.push_back("google.protobuf.FileOptions");
+ keys.push_back("google.protobuf.MessageOptions");
+ keys.push_back("google.protobuf.FieldOptions");
+ keys.push_back("google.protobuf.EnumOptions");
+ keys.push_back("google.protobuf.EnumValueOptions");
+ keys.push_back("google.protobuf.ServiceOptions");
+ keys.push_back("google.protobuf.MethodOptions");
+ keys.push_back("google.protobuf.UninterpretedOption");
+ keys.push_back("google.protobuf.UninterpretedOption.NamePart");
+
+ /* Initialize structures. */
+ std::map<std::string, int32_t> m;
+ typedef upb::TypedStrTable<int32_t> Table;
+ Table table;
+ std::set<std::string> all;
+ for (const auto& key : keys) {
+ all.insert(key);
+ table.Insert(key, key[0]);
+ m[key] = key[0];
+ }
+
+ /* Test correctness. */
+ for (const auto& key : keys) {
+ std::pair<bool, int32_t> found = table.Lookup(key);
+ if (m.find(key) != m.end()) { /* Assume map implementation is correct. */
+ EXPECT_TRUE(found.first);
+ EXPECT_EQ(found.second, key[0]);
+ EXPECT_EQ(m[key], key[0]);
+ } else {
+ EXPECT_FALSE(found.first);
+ }
+ }
+
+ for (Table::iterator it = table.begin(); it != table.end(); ++it) {
+ std::set<std::string>::iterator i = all.find((*it).first);
+ EXPECT_NE(i, all.end());
+ all.erase(i);
+ }
+ EXPECT_TRUE(all.empty());
+
+ // Test iteration with resizes.
+
+ for (int i = 0; i < 10; i++) {
+ for (Table::iterator it = table.begin(); it != table.end(); ++it) {
+ // Even if we invalidate the iterator it should only return real elements.
+ EXPECT_EQ((*it).second, m[(*it).first]);
+
+ // Force a resize even though the size isn't changing.
+ // Also forces the table size to grow so some new buckets end up empty.
+ int new_lg2 = table.table_.table_.t.size_lg2 + 1;
+ // Don't use more than 64k tables, to avoid exhausting memory.
+ new_lg2 = UPB_MIN(new_lg2, 16);
+ table.Resize(new_lg2);
+ }
+ }
+}
+
+class IntTableTest : public testing::TestWithParam<int> {
+ void SetUp() override {
+ if (GetParam() > 0) {
+ for (int i = 0; i < GetParam(); i++) {
+ keys_.push_back(i + 1);
+ }
+ } else {
+ for (int32_t i = 0; i < 64; i++) {
+ if (i < 32)
+ keys_.push_back(i + 1);
+ else
+ keys_.push_back(10101 + i);
+ }
+ }
+ }
+
+ protected:
+ std::vector<int32_t> keys_;
+};
+
+TEST_P(IntTableTest, TestIntTable) {
+ /* Initialize structures. */
+ typedef upb::TypedIntTable<uint32_t> Table;
+ Table table;
+ uint32_t largest_key = 0;
+ std::map<uint32_t, uint32_t> m;
+ std::unordered_map<uint32_t, uint32_t> hm;
+ for (const auto& key : keys_) {
+ largest_key = UPB_MAX((int32_t)largest_key, key);
+ table.Insert(key, key * 2);
+ m[key] = key * 2;
+ hm[key] = key * 2;
+ }
+
+ /* Test correctness. */
+ for (uint32_t i = 0; i <= largest_key; i++) {
+ std::pair<bool, uint32_t> found = table.Lookup(i);
+ if (m.find(i) != m.end()) { /* Assume map implementation is correct. */
+ EXPECT_TRUE(found.first);
+ EXPECT_EQ(found.second, i * 2);
+ EXPECT_EQ(m[i], i * 2);
+ EXPECT_EQ(hm[i], i * 2);
+ } else {
+ EXPECT_FALSE(found.first);
+ }
+ }
+
+ for (size_t i = 0; i < keys_.size(); i += 2) {
+ std::pair<bool, uint32_t> found = table.Remove(keys_[i]);
+ EXPECT_EQ(found.first, m.erase(keys_[i]) == 1);
+ if (found.first) {
+ EXPECT_EQ(found.second, (uint32_t)keys_[i] * 2);
+ }
+ hm.erase(keys_[i]);
+ m.erase(keys_[i]);
+ }
+
+ EXPECT_EQ(table.count(), hm.size());
+
+ /* Test correctness. */
+ for (uint32_t i = 0; i <= largest_key; i++) {
+ std::pair<bool, uint32_t> found = table.Lookup(i);
+ if (m.find(i) != m.end()) { /* Assume map implementation is correct. */
+ EXPECT_TRUE(found.first);
+ EXPECT_EQ(found.second, i * 2);
+ EXPECT_EQ(m[i], i * 2);
+ EXPECT_EQ(hm[i], i * 2);
+ } else {
+ EXPECT_FALSE(found.first);
+ }
+ }
+
+ // Test replace.
+ for (uint32_t i = 0; i <= largest_key; i++) {
+ bool replaced = table.Replace(i, i * 3);
+ if (m.find(i) != m.end()) { /* Assume map implementation is correct. */
+ EXPECT_TRUE(replaced);
+ m[i] = i * 3;
+ hm[i] = i * 3;
+ } else {
+ EXPECT_FALSE(replaced);
+ }
+ }
+
+ // Compact and test correctness again.
+ table.Compact();
+ for (uint32_t i = 0; i <= largest_key; i++) {
+ std::pair<bool, uint32_t> found = table.Lookup(i);
+ if (m.find(i) != m.end()) { /* Assume map implementation is correct. */
+ EXPECT_TRUE(found.first);
+ EXPECT_EQ(found.second, i * 3);
+ EXPECT_EQ(m[i], i * 3);
+ EXPECT_EQ(hm[i], i * 3);
+ } else {
+ EXPECT_FALSE(found.first);
+ }
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(IntTableParams, IntTableTest,
+ testing::Values(8, 64, 512, -32));
+
+/*
+ * This test can't pass right now because the table can't store a value of
+ * (uint64_t)-1.
+ */
+TEST(Table, MaxValue) {
+ /*
+ typedef upb::TypedIntTable<uint64_t> Table;
+ Table table;
+ uintptr_t uint64_max = (uint64_t)-1;
+ table.Insert(1, uint64_max);
+ std::pair<bool, uint64_t> found = table.Lookup(1);
+ ASSERT(found.first);
+ ASSERT(found.second == uint64_max);
+ */
+}
+
+TEST(Table, Delete) {
+ upb::Arena arena;
+ upb_inttable t;
+ upb_inttable_init(&t, arena.ptr());
+ upb_inttable_insert(&t, 0, upb_value_bool(true), arena.ptr());
+ upb_inttable_insert(&t, 2, upb_value_bool(true), arena.ptr());
+ upb_inttable_insert(&t, 4, upb_value_bool(true), arena.ptr());
+ upb_inttable_compact(&t, arena.ptr());
+ upb_inttable_remove(&t, 0, NULL);
+ upb_inttable_remove(&t, 2, NULL);
+ upb_inttable_remove(&t, 4, NULL);
+
+ upb_inttable_iter iter;
+ for (upb_inttable_begin(&iter, &t); !upb_inttable_done(&iter);
+ upb_inttable_next(&iter)) {
+ ASSERT_TRUE(false);
+ }
+}
+
+TEST(Table, Init) {
+ for (int i = 0; i < 2048; i++) {
+ /* Tests that the size calculations in init() (lg2 size for target load)
+ * work for all expected sizes. */
+ upb::Arena arena;
+ upb_strtable t;
+ upb_strtable_init(&t, i, arena.ptr());
+ }
+}
diff --git a/grpc/third_party/upb/upb/text_encode.c b/grpc/third_party/upb/upb/text_encode.c
index 028cc29e..9612375d 100644
--- a/grpc/third_party/upb/upb/text_encode.c
+++ b/grpc/third_party/upb/upb/text_encode.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/text_encode.h"
@@ -9,6 +35,9 @@
#include <string.h>
#include "upb/reflection.h"
+#include "upb/upb_internal.h"
+
+// Must be last.
#include "upb/port_def.inc"
typedef struct {
@@ -16,29 +45,32 @@ typedef struct {
size_t overflow;
int indent_depth;
int options;
- const upb_symtab *ext_pool;
+ const upb_DefPool* ext_pool;
_upb_mapsorter sorter;
} txtenc;
-static void txtenc_msg(txtenc *e, const upb_msg *msg, const upb_msgdef *m);
+static void txtenc_msg(txtenc* e, const upb_Message* msg,
+ const upb_MessageDef* m);
-static void txtenc_putbytes(txtenc *e, const void *data, size_t len) {
+static void txtenc_putbytes(txtenc* e, const void* data, size_t len) {
size_t have = e->end - e->ptr;
if (UPB_LIKELY(have >= len)) {
memcpy(e->ptr, data, len);
e->ptr += len;
} else {
- if (have) memcpy(e->ptr, data, have);
- e->ptr += have;
+ if (have) {
+ memcpy(e->ptr, data, have);
+ e->ptr += have;
+ }
e->overflow += (len - have);
}
}
-static void txtenc_putstr(txtenc *e, const char *str) {
+static void txtenc_putstr(txtenc* e, const char* str) {
txtenc_putbytes(e, str, strlen(str));
}
-static void txtenc_printf(txtenc *e, const char *fmt, ...) {
+static void txtenc_printf(txtenc* e, const char* fmt, ...) {
size_t n;
size_t have = e->end - e->ptr;
va_list args;
@@ -50,12 +82,12 @@ static void txtenc_printf(txtenc *e, const char *fmt, ...) {
if (UPB_LIKELY(have > n)) {
e->ptr += n;
} else {
- e->ptr += have;
+ e->ptr = UPB_PTRADD(e->ptr, have);
e->overflow += (n - have);
}
}
-static void txtenc_indent(txtenc *e) {
+static void txtenc_indent(txtenc* e) {
if ((e->options & UPB_TXTENC_SINGLELINE) == 0) {
int i = e->indent_depth;
while (i-- > 0) {
@@ -64,7 +96,7 @@ static void txtenc_indent(txtenc *e) {
}
}
-static void txtenc_endfield(txtenc *e) {
+static void txtenc_endfield(txtenc* e) {
if (e->options & UPB_TXTENC_SINGLELINE) {
txtenc_putstr(e, " ");
} else {
@@ -72,20 +104,20 @@ static void txtenc_endfield(txtenc *e) {
}
}
-static void txtenc_enum(int32_t val, const upb_fielddef *f, txtenc *e) {
- const upb_enumdef *e_def = upb_fielddef_enumsubdef(f);
- const char *name = upb_enumdef_iton(e_def, val);
+static void txtenc_enum(int32_t val, const upb_FieldDef* f, txtenc* e) {
+ const upb_EnumDef* e_def = upb_FieldDef_EnumSubDef(f);
+ const upb_EnumValueDef* ev = upb_EnumDef_FindValueByNumber(e_def, val);
- if (name) {
- txtenc_printf(e, "%s", name);
+ if (ev) {
+ txtenc_printf(e, "%s", upb_EnumValueDef_Name(ev));
} else {
txtenc_printf(e, "%" PRId32, val);
}
}
-static void txtenc_string(txtenc *e, upb_strview str, bool bytes) {
- const char *ptr = str.data;
- const char *end = ptr + str.size;
+static void txtenc_string(txtenc* e, upb_StringView str, bool bytes) {
+ const char* ptr = str.data;
+ const char* end = ptr + str.size;
txtenc_putstr(e, "\"");
while (ptr < end) {
@@ -122,50 +154,65 @@ static void txtenc_string(txtenc *e, upb_strview str, bool bytes) {
txtenc_putstr(e, "\"");
}
-static void txtenc_field(txtenc *e, upb_msgval val, const upb_fielddef *f) {
+static void txtenc_field(txtenc* e, upb_MessageValue val,
+ const upb_FieldDef* f) {
txtenc_indent(e);
- txtenc_printf(e, "%s: ", upb_fielddef_name(f));
+ upb_CType type = upb_FieldDef_CType(f);
+ const char* name = upb_FieldDef_Name(f);
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_BOOL:
+ if (type == kUpb_CType_Message) {
+ txtenc_printf(e, "%s {", name);
+ txtenc_endfield(e);
+ e->indent_depth++;
+ txtenc_msg(e, val.msg_val, upb_FieldDef_MessageSubDef(f));
+ e->indent_depth--;
+ txtenc_indent(e);
+ txtenc_putstr(e, "}");
+ txtenc_endfield(e);
+ return;
+ }
+
+ txtenc_printf(e, "%s: ", name);
+
+ switch (type) {
+ case kUpb_CType_Bool:
txtenc_putstr(e, val.bool_val ? "true" : "false");
break;
- case UPB_TYPE_FLOAT:
- txtenc_printf(e, "%f", val.float_val);
+ case kUpb_CType_Float: {
+ char buf[32];
+ _upb_EncodeRoundTripFloat(val.float_val, buf, sizeof(buf));
+ txtenc_putstr(e, buf);
break;
- case UPB_TYPE_DOUBLE:
- txtenc_printf(e, "%f", val.double_val);
+ }
+ case kUpb_CType_Double: {
+ char buf[32];
+ _upb_EncodeRoundTripDouble(val.double_val, buf, sizeof(buf));
+ txtenc_putstr(e, buf);
break;
- case UPB_TYPE_INT32:
+ }
+ case kUpb_CType_Int32:
txtenc_printf(e, "%" PRId32, val.int32_val);
break;
- case UPB_TYPE_UINT32:
+ case kUpb_CType_UInt32:
txtenc_printf(e, "%" PRIu32, val.uint32_val);
break;
- case UPB_TYPE_INT64:
+ case kUpb_CType_Int64:
txtenc_printf(e, "%" PRId64, val.int64_val);
break;
- case UPB_TYPE_UINT64:
+ case kUpb_CType_UInt64:
txtenc_printf(e, "%" PRIu64, val.uint64_val);
break;
- case UPB_TYPE_STRING:
+ case kUpb_CType_String:
txtenc_string(e, val.str_val, false);
break;
- case UPB_TYPE_BYTES:
+ case kUpb_CType_Bytes:
txtenc_string(e, val.str_val, true);
break;
- case UPB_TYPE_ENUM:
+ case kUpb_CType_Enum:
txtenc_enum(val.int32_val, f, e);
break;
- case UPB_TYPE_MESSAGE:
- txtenc_putstr(e, "{");
- txtenc_endfield(e);
- e->indent_depth++;
- txtenc_msg(e, val.msg_val, upb_fielddef_msgsubdef(f));
- e->indent_depth--;
- txtenc_indent(e);
- txtenc_putstr(e, "}");
- break;
+ default:
+ UPB_UNREACHABLE();
}
txtenc_endfield(e);
@@ -178,23 +225,23 @@ static void txtenc_field(txtenc *e, upb_msgval val, const upb_fielddef *f) {
* foo_field: 2
* foo_field: 3
*/
-static void txtenc_array(txtenc *e, const upb_array *arr,
- const upb_fielddef *f) {
+static void txtenc_array(txtenc* e, const upb_Array* arr,
+ const upb_FieldDef* f) {
size_t i;
- size_t size = upb_array_size(arr);
+ size_t size = upb_Array_Size(arr);
for (i = 0; i < size; i++) {
- txtenc_field(e, upb_array_get(arr, i), f);
+ txtenc_field(e, upb_Array_Get(arr, i), f);
}
}
-static void txtenc_mapentry(txtenc *e, upb_msgval key, upb_msgval val,
- const upb_fielddef *f) {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_field(entry, 0);
- const upb_fielddef *val_f = upb_msgdef_field(entry, 1);
+static void txtenc_mapentry(txtenc* e, upb_MessageValue key,
+ upb_MessageValue val, const upb_FieldDef* f) {
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry, 0);
+ const upb_FieldDef* val_f = upb_MessageDef_Field(entry, 1);
txtenc_indent(e);
- txtenc_printf(e, "%s: {", upb_fielddef_name(f));
+ txtenc_printf(e, "%s {", upb_FieldDef_Name(f));
txtenc_endfield(e);
e->indent_depth++;
@@ -219,24 +266,23 @@ static void txtenc_mapentry(txtenc *e, upb_msgval key, upb_msgval val,
* value: 456
* }
*/
-static void txtenc_map(txtenc *e, const upb_map *map, const upb_fielddef *f) {
+static void txtenc_map(txtenc* e, const upb_Map* map, const upb_FieldDef* f) {
if (e->options & UPB_TXTENC_NOSORT) {
- size_t iter = UPB_MAP_BEGIN;
- while (upb_mapiter_next(map, &iter)) {
- upb_msgval key = upb_mapiter_key(map, iter);
- upb_msgval val = upb_mapiter_value(map, iter);
+ size_t iter = kUpb_Map_Begin;
+ while (upb_MapIterator_Next(map, &iter)) {
+ upb_MessageValue key = upb_MapIterator_Key(map, iter);
+ upb_MessageValue val = upb_MapIterator_Value(map, iter);
txtenc_mapentry(e, key, val, f);
}
} else {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key_f = upb_msgdef_field(entry, 0);
+ const upb_MessageDef* entry = upb_FieldDef_MessageSubDef(f);
+ const upb_FieldDef* key_f = upb_MessageDef_Field(entry, 0);
_upb_sortedmap sorted;
- upb_map_entry ent;
+ upb_MapEntry ent;
- _upb_mapsorter_pushmap(&e->sorter, upb_fielddef_descriptortype(key_f), map,
- &sorted);
+ _upb_mapsorter_pushmap(&e->sorter, upb_FieldDef_Type(key_f), map, &sorted);
while (_upb_sortedmap_next(&e->sorter, map, &sorted, &ent)) {
- upb_msgval key, val;
+ upb_MessageValue key, val;
memcpy(&key, &ent.k, sizeof(key));
memcpy(&val, &ent.v, sizeof(val));
txtenc_mapentry(e, key, val, f);
@@ -245,10 +291,15 @@ static void txtenc_map(txtenc *e, const upb_map *map, const upb_fielddef *f) {
}
}
-#define CHK(x) do { if (!(x)) { return false; } } while(0)
+#define CHK(x) \
+ do { \
+ if (!(x)) { \
+ return false; \
+ } \
+ } while (0)
-static const char *txtenc_parsevarint(const char *ptr, const char *limit,
- uint64_t *val) {
+static const char* txtenc_parsevarint(const char* ptr, const char* limit,
+ uint64_t* val) {
uint8_t byte;
int bitpos = 0;
*val = 0;
@@ -274,7 +325,7 @@ static const char *txtenc_parsevarint(const char *ptr, const char *limit,
* 1: 111
* }
*/
-static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
+static const char* txtenc_unknown(txtenc* e, const char* ptr, const char* end,
int groupnum) {
while (ptr < end) {
uint64_t tag_64;
@@ -283,7 +334,7 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
CHK(tag_64 < UINT32_MAX);
tag = (uint32_t)tag_64;
- if ((tag & 7) == UPB_WIRE_TYPE_END_GROUP) {
+ if ((tag & 7) == kUpb_WireType_EndGroup) {
CHK((tag >> 3) == (uint32_t)groupnum);
return ptr;
}
@@ -292,13 +343,13 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
txtenc_printf(e, "%d: ", (int)(tag >> 3));
switch (tag & 7) {
- case UPB_WIRE_TYPE_VARINT: {
+ case kUpb_WireType_Varint: {
uint64_t val;
CHK(ptr = txtenc_parsevarint(ptr, end, &val));
txtenc_printf(e, "%" PRIu64, val);
break;
}
- case UPB_WIRE_TYPE_32BIT: {
+ case kUpb_WireType_32Bit: {
uint32_t val;
CHK(end - ptr >= 4);
memcpy(&val, ptr, 4);
@@ -306,7 +357,7 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
txtenc_printf(e, "0x%08" PRIu32, val);
break;
}
- case UPB_WIRE_TYPE_64BIT: {
+ case kUpb_WireType_64Bit: {
uint64_t val;
CHK(end - ptr >= 8);
memcpy(&val, ptr, 8);
@@ -314,10 +365,10 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
txtenc_printf(e, "0x%016" PRIu64, val);
break;
}
- case UPB_WIRE_TYPE_DELIMITED: {
+ case kUpb_WireType_Delimited: {
uint64_t len;
size_t avail = end - ptr;
- char *start = e->ptr;
+ char* start = e->ptr;
size_t start_overflow = e->overflow;
CHK(ptr = txtenc_parsevarint(ptr, end, &len));
CHK(avail >= len);
@@ -332,7 +383,7 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
txtenc_putstr(e, "}");
} else {
/* Didn't work out, print as raw bytes. */
- upb_strview str;
+ upb_StringView str;
e->indent_depth--;
e->ptr = start;
e->overflow = start_overflow;
@@ -343,7 +394,7 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
ptr += len;
break;
}
- case UPB_WIRE_TYPE_START_GROUP:
+ case kUpb_WireType_StartGroup:
txtenc_putstr(e, "{");
txtenc_endfield(e);
e->indent_depth++;
@@ -361,16 +412,16 @@ static const char *txtenc_unknown(txtenc *e, const char *ptr, const char *end,
#undef CHK
-static void txtenc_msg(txtenc *e, const upb_msg *msg,
- const upb_msgdef *m) {
- size_t iter = UPB_MSG_BEGIN;
- const upb_fielddef *f;
- upb_msgval val;
+static void txtenc_msg(txtenc* e, const upb_Message* msg,
+ const upb_MessageDef* m) {
+ size_t iter = kUpb_Message_Begin;
+ const upb_FieldDef* f;
+ upb_MessageValue val;
- while (upb_msg_next(msg, m, e->ext_pool, &f, &val, &iter)) {
- if (upb_fielddef_ismap(f)) {
+ while (upb_Message_Next(msg, m, e->ext_pool, &f, &val, &iter)) {
+ if (upb_FieldDef_IsMap(f)) {
txtenc_map(e, val.map_val, f);
- } else if (upb_fielddef_isseq(f)) {
+ } else if (upb_FieldDef_IsRepeated(f)) {
txtenc_array(e, val.array_val, f);
} else {
txtenc_field(e, val, f);
@@ -379,8 +430,8 @@ static void txtenc_msg(txtenc *e, const upb_msg *msg,
if ((e->options & UPB_TXTENC_SKIPUNKNOWN) == 0) {
size_t len;
- const char *ptr = upb_msg_getunknown(msg, &len);
- char *start = e->ptr;
+ const char* ptr = upb_Message_GetUnknown(msg, &len);
+ char* start = e->ptr;
if (ptr) {
if (!txtenc_unknown(e, ptr, ptr + len, -1)) {
/* Unknown failed to parse, back up and don't print it at all. */
@@ -390,7 +441,7 @@ static void txtenc_msg(txtenc *e, const upb_msg *msg,
}
}
-size_t txtenc_nullz(txtenc *e, size_t size) {
+size_t txtenc_nullz(txtenc* e, size_t size) {
size_t ret = e->ptr - e->buf + e->overflow;
if (size > 0) {
@@ -401,14 +452,14 @@ size_t txtenc_nullz(txtenc *e, size_t size) {
return ret;
}
-size_t upb_text_encode(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, int options, char *buf,
- size_t size) {
+size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, int options, char* buf,
+ size_t size) {
txtenc e;
e.buf = buf;
e.ptr = buf;
- e.end = buf + size;
+ e.end = UPB_PTRADD(buf, size);
e.overflow = 0;
e.indent_depth = 0;
e.options = options;
diff --git a/grpc/third_party/upb/upb/text_encode.h b/grpc/third_party/upb/upb/text_encode.h
index 4ad3d1c4..2e817a3e 100644
--- a/grpc/third_party/upb/upb/text_encode.h
+++ b/grpc/third_party/upb/upb/text_encode.h
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_TEXTENCODE_H_
#define UPB_TEXTENCODE_H_
@@ -27,12 +53,12 @@ enum {
* size (excluding NULL) is returned. This means that a return value >= |size|
* implies that the output was truncated. (These are the same semantics as
* snprintf()). */
-size_t upb_text_encode(const upb_msg *msg, const upb_msgdef *m,
- const upb_symtab *ext_pool, int options, char *buf,
- size_t size);
+size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool, int options, char* buf,
+ size_t size);
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* UPB_TEXTENCODE_H_ */
+#endif /* UPB_TEXTENCODE_H_ */
diff --git a/grpc/third_party/upb/upb/upb.c b/grpc/third_party/upb/upb/upb.c
index a1265697..55730bbe 100644
--- a/grpc/third_party/upb/upb/upb.c
+++ b/grpc/third_party/upb/upb/upb.c
@@ -1,7 +1,32 @@
-
-#include "upb/upb.int.h"
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include <errno.h>
+#include <float.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
@@ -9,53 +34,60 @@
#include <stdlib.h>
#include <string.h>
+#include "upb/upb_internal.h"
+
+// Must be last.
#include "upb/port_def.inc"
-/* upb_status *****************************************************************/
+/* upb_Status *****************************************************************/
-void upb_status_clear(upb_status *status) {
+void upb_Status_Clear(upb_Status* status) {
if (!status) return;
status->ok = true;
status->msg[0] = '\0';
}
-bool upb_ok(const upb_status *status) { return status->ok; }
+bool upb_Status_IsOk(const upb_Status* status) { return status->ok; }
-const char *upb_status_errmsg(const upb_status *status) { return status->msg; }
+const char* upb_Status_ErrorMessage(const upb_Status* status) {
+ return status->msg;
+}
-void upb_status_seterrmsg(upb_status *status, const char *msg) {
+void upb_Status_SetErrorMessage(upb_Status* status, const char* msg) {
if (!status) return;
status->ok = false;
- strncpy(status->msg, msg, UPB_STATUS_MAX_MESSAGE - 1);
- status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0';
+ strncpy(status->msg, msg, _kUpb_Status_MaxMessage - 1);
+ status->msg[_kUpb_Status_MaxMessage - 1] = '\0';
}
-void upb_status_seterrf(upb_status *status, const char *fmt, ...) {
+void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
- upb_status_vseterrf(status, fmt, args);
+ upb_Status_VSetErrorFormat(status, fmt, args);
va_end(args);
}
-void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args) {
+void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
+ va_list args) {
if (!status) return;
status->ok = false;
vsnprintf(status->msg, sizeof(status->msg), fmt, args);
- status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0';
+ status->msg[_kUpb_Status_MaxMessage - 1] = '\0';
}
-void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args) {
+void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
+ va_list args) {
size_t len;
if (!status) return;
status->ok = false;
len = strlen(status->msg);
vsnprintf(status->msg + len, sizeof(status->msg) - len, fmt, args);
- status->msg[UPB_STATUS_MAX_MESSAGE - 1] = '\0';
+ status->msg[_kUpb_Status_MaxMessage - 1] = '\0';
}
/* upb_alloc ******************************************************************/
-static void *upb_global_allocfunc(upb_alloc *alloc, void *ptr, size_t oldsize,
+static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize,
size_t size) {
UPB_UNUSED(alloc);
UPB_UNUSED(oldsize);
@@ -67,40 +99,53 @@ static void *upb_global_allocfunc(upb_alloc *alloc, void *ptr, size_t oldsize,
}
}
+static uint32_t* upb_cleanup_pointer(uintptr_t cleanup_metadata) {
+ return (uint32_t*)(cleanup_metadata & ~0x1);
+}
+
+static bool upb_cleanup_has_initial_block(uintptr_t cleanup_metadata) {
+ return cleanup_metadata & 0x1;
+}
+
+static uintptr_t upb_cleanup_metadata(uint32_t* cleanup,
+ bool has_initial_block) {
+ return (uintptr_t)cleanup | has_initial_block;
+}
+
upb_alloc upb_alloc_global = {&upb_global_allocfunc};
-/* upb_arena ******************************************************************/
+/* upb_Arena ******************************************************************/
/* Be conservative and choose 16 in case anyone is using SSE. */
struct mem_block {
- struct mem_block *next;
+ struct mem_block* next;
uint32_t size;
uint32_t cleanups;
/* Data follows. */
};
typedef struct cleanup_ent {
- upb_cleanup_func *cleanup;
- void *ud;
+ upb_CleanupFunc* cleanup;
+ void* ud;
} cleanup_ent;
static const size_t memblock_reserve = UPB_ALIGN_UP(sizeof(mem_block), 16);
-static upb_arena *arena_findroot(upb_arena *a) {
+static upb_Arena* arena_findroot(upb_Arena* a) {
/* Path splitting keeps time complexity down, see:
* https://en.wikipedia.org/wiki/Disjoint-set_data_structure */
while (a->parent != a) {
- upb_arena *next = a->parent;
+ upb_Arena* next = a->parent;
a->parent = next->parent;
a = next;
}
return a;
}
-static void upb_arena_addblock(upb_arena *a, upb_arena *root, void *ptr,
+static void upb_Arena_addblock(upb_Arena* a, upb_Arena* root, void* ptr,
size_t size) {
- mem_block *block = ptr;
+ mem_block* block = ptr;
/* The block is for arena |a|, but should appear in the freelist of |root|. */
block->next = root->freelist;
@@ -112,38 +157,39 @@ static void upb_arena_addblock(upb_arena *a, upb_arena *root, void *ptr,
a->head.ptr = UPB_PTR_AT(block, memblock_reserve, char);
a->head.end = UPB_PTR_AT(block, size, char);
- a->cleanups = &block->cleanups;
+ a->cleanup_metadata = upb_cleanup_metadata(
+ &block->cleanups, upb_cleanup_has_initial_block(a->cleanup_metadata));
UPB_POISON_MEMORY_REGION(a->head.ptr, a->head.end - a->head.ptr);
}
-static bool upb_arena_allocblock(upb_arena *a, size_t size) {
- upb_arena *root = arena_findroot(a);
+static bool upb_Arena_Allocblock(upb_Arena* a, size_t size) {
+ upb_Arena* root = arena_findroot(a);
size_t block_size = UPB_MAX(size, a->last_size * 2) + memblock_reserve;
- mem_block *block = upb_malloc(root->block_alloc, block_size);
+ mem_block* block = upb_malloc(root->block_alloc, block_size);
if (!block) return false;
- upb_arena_addblock(a, root, block, block_size);
+ upb_Arena_addblock(a, root, block, block_size);
return true;
}
-void *_upb_arena_slowmalloc(upb_arena *a, size_t size) {
- if (!upb_arena_allocblock(a, size)) return NULL; /* Out of memory. */
- UPB_ASSERT(_upb_arenahas(a) >= size);
- return upb_arena_malloc(a, size);
+void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t size) {
+ if (!upb_Arena_Allocblock(a, size)) return NULL; /* Out of memory. */
+ UPB_ASSERT(_upb_ArenaHas(a) >= size);
+ return upb_Arena_Malloc(a, size);
}
-static void *upb_arena_doalloc(upb_alloc *alloc, void *ptr, size_t oldsize,
+static void* upb_Arena_doalloc(upb_alloc* alloc, void* ptr, size_t oldsize,
size_t size) {
- upb_arena *a = (upb_arena*)alloc; /* upb_alloc is initial member. */
- return upb_arena_realloc(a, ptr, oldsize, size);
+ upb_Arena* a = (upb_Arena*)alloc; /* upb_alloc is initial member. */
+ return upb_Arena_Realloc(a, ptr, oldsize, size);
}
/* Public Arena API ***********************************************************/
-upb_arena *arena_initslow(void *mem, size_t n, upb_alloc *alloc) {
- const size_t first_block_overhead = sizeof(upb_arena) + memblock_reserve;
- upb_arena *a;
+upb_Arena* arena_initslow(void* mem, size_t n, upb_alloc* alloc) {
+ const size_t first_block_overhead = sizeof(upb_Arena) + memblock_reserve;
+ upb_Arena* a;
/* We need to malloc the initial block. */
n = first_block_overhead + 256;
@@ -151,35 +197,44 @@ upb_arena *arena_initslow(void *mem, size_t n, upb_alloc *alloc) {
return NULL;
}
- a = UPB_PTR_AT(mem, n - sizeof(*a), upb_arena);
+ a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
n -= sizeof(*a);
- a->head.alloc.func = &upb_arena_doalloc;
+ a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
a->freelist = NULL;
a->freelist_tail = NULL;
+ a->cleanup_metadata = upb_cleanup_metadata(NULL, false);
- upb_arena_addblock(a, a, mem, n);
+ upb_Arena_addblock(a, a, mem, n);
return a;
}
-upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc) {
- upb_arena *a;
+upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc) {
+ upb_Arena* a;
+
+ if (n) {
+ /* Align initial pointer up so that we return properly-aligned pointers. */
+ void* aligned = (void*)UPB_ALIGN_UP((uintptr_t)mem, 16);
+ size_t delta = (uintptr_t)aligned - (uintptr_t)mem;
+ n = delta <= n ? n - delta : 0;
+ mem = aligned;
+ }
/* Round block size down to alignof(*a) since we will allocate the arena
* itself at the end. */
- n = UPB_ALIGN_DOWN(n, UPB_ALIGN_OF(upb_arena));
+ n = UPB_ALIGN_DOWN(n, UPB_ALIGN_OF(upb_Arena));
- if (UPB_UNLIKELY(n < sizeof(upb_arena))) {
+ if (UPB_UNLIKELY(n < sizeof(upb_Arena))) {
return arena_initslow(mem, n, alloc);
}
- a = UPB_PTR_AT(mem, n - sizeof(*a), upb_arena);
+ a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena);
- a->head.alloc.func = &upb_arena_doalloc;
+ a->head.alloc.func = &upb_Arena_doalloc;
a->block_alloc = alloc;
a->parent = a;
a->refcount = 1;
@@ -187,23 +242,23 @@ upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc) {
a->head.ptr = mem;
a->head.end = UPB_PTR_AT(mem, n - sizeof(*a), char);
a->freelist = NULL;
- a->cleanups = NULL;
+ a->cleanup_metadata = upb_cleanup_metadata(NULL, true);
return a;
}
-static void arena_dofree(upb_arena *a) {
- mem_block *block = a->freelist;
+static void arena_dofree(upb_Arena* a) {
+ mem_block* block = a->freelist;
UPB_ASSERT(a->parent == a);
UPB_ASSERT(a->refcount == 0);
while (block) {
/* Load first since we are deleting block. */
- mem_block *next = block->next;
+ mem_block* next = block->next;
if (block->cleanups > 0) {
- cleanup_ent *end = UPB_PTR_AT(block, block->size, void);
- cleanup_ent *ptr = end - block->cleanups;
+ cleanup_ent* end = UPB_PTR_AT(block, block->size, void);
+ cleanup_ent* ptr = end - block->cleanups;
for (; ptr < end; ptr++) {
ptr->cleanup(ptr->ud);
@@ -215,22 +270,24 @@ static void arena_dofree(upb_arena *a) {
}
}
-void upb_arena_free(upb_arena *a) {
+void upb_Arena_Free(upb_Arena* a) {
a = arena_findroot(a);
if (--a->refcount == 0) arena_dofree(a);
}
-bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) {
- cleanup_ent *ent;
+bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func) {
+ cleanup_ent* ent;
+ uint32_t* cleanups = upb_cleanup_pointer(a->cleanup_metadata);
- if (!a->cleanups || _upb_arenahas(a) < sizeof(cleanup_ent)) {
- if (!upb_arena_allocblock(a, 128)) return false; /* Out of memory. */
- UPB_ASSERT(_upb_arenahas(a) >= sizeof(cleanup_ent));
+ if (!cleanups || _upb_ArenaHas(a) < sizeof(cleanup_ent)) {
+ if (!upb_Arena_Allocblock(a, 128)) return false; /* Out of memory. */
+ UPB_ASSERT(_upb_ArenaHas(a) >= sizeof(cleanup_ent));
+ cleanups = upb_cleanup_pointer(a->cleanup_metadata);
}
a->head.end -= sizeof(cleanup_ent);
ent = (cleanup_ent*)a->head.end;
- (*a->cleanups)++;
+ (*cleanups)++;
UPB_UNPOISON_MEMORY_REGION(ent, sizeof(cleanup_ent));
ent->cleanup = func;
@@ -239,16 +296,23 @@ bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) {
return true;
}
-void upb_arena_fuse(upb_arena *a1, upb_arena *a2) {
- upb_arena *r1 = arena_findroot(a1);
- upb_arena *r2 = arena_findroot(a2);
+bool upb_Arena_Fuse(upb_Arena* a1, upb_Arena* a2) {
+ upb_Arena* r1 = arena_findroot(a1);
+ upb_Arena* r2 = arena_findroot(a2);
+
+ if (r1 == r2) return true; /* Already fused. */
- if (r1 == r2) return; /* Already fused. */
+ /* Do not fuse initial blocks since we cannot lifetime extend them. */
+ if (upb_cleanup_has_initial_block(r1->cleanup_metadata)) return false;
+ if (upb_cleanup_has_initial_block(r2->cleanup_metadata)) return false;
+
+ /* Only allow fuse with a common allocator */
+ if (r1->block_alloc != r2->block_alloc) return false;
/* We want to join the smaller tree to the larger tree.
* So swap first if they are backwards. */
if (r1->refcount < r2->refcount) {
- upb_arena *tmp = r1;
+ upb_Arena* tmp = r1;
r1 = r2;
r2 = tmp;
}
@@ -261,4 +325,38 @@ void upb_arena_fuse(upb_arena *a1, upb_arena *a2) {
r1->freelist = r2->freelist;
}
r2->parent = r1;
+ return true;
+}
+
+/* Miscellaneous utilities ****************************************************/
+
+static void upb_FixLocale(char* p) {
+ /* printf() is dependent on locales; sadly there is no easy and portable way
+ * to avoid this. This little post-processing step will translate 1,2 -> 1.2
+ * since JSON needs the latter. Arguably a hack, but it is simple and the
+ * alternatives are far more complicated, platform-dependent, and/or larger
+ * in code size. */
+ for (; *p; p++) {
+ if (*p == ',') *p = '.';
+ }
+}
+
+void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size) {
+ assert(size >= kUpb_RoundTripBufferSize);
+ snprintf(buf, size, "%.*g", DBL_DIG, val);
+ if (strtod(buf, NULL) != val) {
+ snprintf(buf, size, "%.*g", DBL_DIG + 2, val);
+ assert(strtod(buf, NULL) == val);
+ }
+ upb_FixLocale(buf);
+}
+
+void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size) {
+ assert(size >= kUpb_RoundTripBufferSize);
+ snprintf(buf, size, "%.*g", FLT_DIG, val);
+ if (strtof(buf, NULL) != val) {
+ snprintf(buf, size, "%.*g", FLT_DIG + 3, val);
+ assert(strtof(buf, NULL) == val);
+ }
+ upb_FixLocale(buf);
}
diff --git a/grpc/third_party/upb/upb/upb.h b/grpc/third_party/upb/upb/upb.h
index 11c0e4dc..e074911e 100644
--- a/grpc/third_party/upb/upb/upb.h
+++ b/grpc/third_party/upb/upb/upb.h
@@ -1,6 +1,33 @@
/*
-** This file contains shared definitions that are widely used across upb.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file contains shared definitions that are widely used across upb.
+ */
#ifndef UPB_H_
#define UPB_H_
@@ -18,51 +45,56 @@
extern "C" {
#endif
-/* upb_status *****************************************************************/
+/* upb_Status *****************************************************************/
-#define UPB_STATUS_MAX_MESSAGE 127
+#define _kUpb_Status_MaxMessage 127
typedef struct {
bool ok;
- char msg[UPB_STATUS_MAX_MESSAGE]; /* Error message; NULL-terminated. */
-} upb_status;
+ char msg[_kUpb_Status_MaxMessage]; /* Error message; NULL-terminated. */
+} upb_Status;
-const char *upb_status_errmsg(const upb_status *status);
-bool upb_ok(const upb_status *status);
+const char* upb_Status_ErrorMessage(const upb_Status* status);
+bool upb_Status_IsOk(const upb_Status* status);
/* These are no-op if |status| is NULL. */
-void upb_status_clear(upb_status *status);
-void upb_status_seterrmsg(upb_status *status, const char *msg);
-void upb_status_seterrf(upb_status *status, const char *fmt, ...);
-void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args);
-void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args);
+void upb_Status_Clear(upb_Status* status);
+void upb_Status_SetErrorMessage(upb_Status* status, const char* msg);
+void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...)
+ UPB_PRINTF(2, 3);
+void upb_Status_VSetErrorFormat(upb_Status* status, const char* fmt,
+ va_list args) UPB_PRINTF(2, 0);
+void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt,
+ va_list args) UPB_PRINTF(2, 0);
-/** upb_strview ************************************************************/
+/** upb_StringView ************************************************************/
typedef struct {
- const char *data;
+ const char* data;
size_t size;
-} upb_strview;
+} upb_StringView;
-UPB_INLINE upb_strview upb_strview_make(const char *data, size_t size) {
- upb_strview ret;
+UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char* data,
+ size_t size) {
+ upb_StringView ret;
ret.data = data;
ret.size = size;
return ret;
}
-UPB_INLINE upb_strview upb_strview_makez(const char *data) {
- return upb_strview_make(data, strlen(data));
+UPB_INLINE upb_StringView upb_StringView_FromString(const char* data) {
+ return upb_StringView_FromDataAndSize(data, strlen(data));
}
-UPB_INLINE bool upb_strview_eql(upb_strview a, upb_strview b) {
+UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) {
return a.size == b.size && memcmp(a.data, b.data, a.size) == 0;
}
-#define UPB_STRVIEW_INIT(ptr, len) {ptr, len}
+#define UPB_STRINGVIEW_INIT(ptr, len) \
+ { ptr, len }
-#define UPB_STRVIEW_FORMAT "%.*s"
-#define UPB_STRVIEW_ARGS(view) (int)(view).size, (view).data
+#define UPB_STRINGVIEW_FORMAT "%.*s"
+#define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data
/** upb_alloc *****************************************************************/
@@ -78,25 +110,25 @@ typedef struct upb_alloc upb_alloc;
/* A malloc()/free() function.
* If "size" is 0 then the function acts like free(), otherwise it acts like
* realloc(). Only "oldsize" bytes from a previous allocation are preserved. */
-typedef void *upb_alloc_func(upb_alloc *alloc, void *ptr, size_t oldsize,
+typedef void* upb_alloc_func(upb_alloc* alloc, void* ptr, size_t oldsize,
size_t size);
struct upb_alloc {
- upb_alloc_func *func;
+ upb_alloc_func* func;
};
-UPB_INLINE void *upb_malloc(upb_alloc *alloc, size_t size) {
+UPB_INLINE void* upb_malloc(upb_alloc* alloc, size_t size) {
UPB_ASSERT(alloc);
return alloc->func(alloc, NULL, 0, size);
}
-UPB_INLINE void *upb_realloc(upb_alloc *alloc, void *ptr, size_t oldsize,
+UPB_INLINE void* upb_realloc(upb_alloc* alloc, void* ptr, size_t oldsize,
size_t size) {
UPB_ASSERT(alloc);
return alloc->func(alloc, ptr, oldsize, size);
}
-UPB_INLINE void upb_free(upb_alloc *alloc, void *ptr) {
+UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) {
assert(alloc);
alloc->func(alloc, ptr, 0, 0);
}
@@ -110,79 +142,73 @@ extern upb_alloc upb_alloc_global;
* We still get benefit because we can put custom logic into our global
* allocator, like injecting out-of-memory faults in debug/testing builds. */
-UPB_INLINE void *upb_gmalloc(size_t size) {
+UPB_INLINE void* upb_gmalloc(size_t size) {
return upb_malloc(&upb_alloc_global, size);
}
-UPB_INLINE void *upb_grealloc(void *ptr, size_t oldsize, size_t size) {
+UPB_INLINE void* upb_grealloc(void* ptr, size_t oldsize, size_t size) {
return upb_realloc(&upb_alloc_global, ptr, oldsize, size);
}
-UPB_INLINE void upb_gfree(void *ptr) {
- upb_free(&upb_alloc_global, ptr);
-}
+UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); }
-/* upb_arena ******************************************************************/
+/* upb_Arena ******************************************************************/
-/* upb_arena is a specific allocator implementation that uses arena allocation.
+/* upb_Arena is a specific allocator implementation that uses arena allocation.
* The user provides an allocator that will be used to allocate the underlying
* arena blocks. Arenas by nature do not require the individual allocations
* to be freed. However the Arena does allow users to register cleanup
* functions that will run when the arena is destroyed.
*
- * A upb_arena is *not* thread-safe.
+ * A upb_Arena is *not* thread-safe.
*
* You could write a thread-safe arena allocator that satisfies the
* upb_alloc interface, but it would not be as efficient for the
* single-threaded case. */
-typedef void upb_cleanup_func(void *ud);
+typedef void upb_CleanupFunc(void* ud);
-struct upb_arena;
-typedef struct upb_arena upb_arena;
+struct upb_Arena;
+typedef struct upb_Arena upb_Arena;
typedef struct {
/* We implement the allocator interface.
- * This must be the first member of upb_arena!
+ * This must be the first member of upb_Arena!
* TODO(haberman): remove once handlers are gone. */
upb_alloc alloc;
char *ptr, *end;
-} _upb_arena_head;
+} _upb_ArenaHead;
/* Creates an arena from the given initial block (if any -- n may be 0).
* Additional blocks will be allocated from |alloc|. If |alloc| is NULL, this
* is a fixed-size arena and cannot grow. */
-upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc);
-void upb_arena_free(upb_arena *a);
-bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func);
-void upb_arena_fuse(upb_arena *a, upb_arena *b);
-void *_upb_arena_slowmalloc(upb_arena *a, size_t size);
+upb_Arena* upb_Arena_Init(void* mem, size_t n, upb_alloc* alloc);
+void upb_Arena_Free(upb_Arena* a);
+bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func);
+bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b);
+void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t size);
-UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
+UPB_INLINE upb_alloc* upb_Arena_Alloc(upb_Arena* a) { return (upb_alloc*)a; }
-UPB_INLINE size_t _upb_arenahas(upb_arena *a) {
- _upb_arena_head *h = (_upb_arena_head*)a;
+UPB_INLINE size_t _upb_ArenaHas(upb_Arena* a) {
+ _upb_ArenaHead* h = (_upb_ArenaHead*)a;
return (size_t)(h->end - h->ptr);
}
-UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
- _upb_arena_head *h = (_upb_arena_head*)a;
- void* ret;
- size = UPB_ALIGN_MALLOC(size);
-
- if (UPB_UNLIKELY(_upb_arenahas(a) < size)) {
- return _upb_arena_slowmalloc(a, size);
- }
+UPB_INLINE void* _upb_Arena_FastMalloc(upb_Arena* a, size_t size) {
+ _upb_ArenaHead* h = (_upb_ArenaHead*)a;
+ void* ret = h->ptr;
+ //UPB_ASSERT(UPB_ALIGN_MALLOC((uintptr_t)ret) == (uintptr_t)ret);
+ UPB_ASSERT(UPB_ALIGN_MALLOC(size) == size);
+ UPB_UNPOISON_MEMORY_REGION(ret, size);
- ret = h->ptr;
h->ptr += size;
- UPB_UNPOISON_MEMORY_REGION(ret, size);
#if UPB_ASAN
{
size_t guard_size = 32;
- if (_upb_arenahas(a) >= guard_size) {
+ if (_upb_ArenaHas(a) >= guard_size) {
h->ptr += guard_size;
} else {
h->ptr = h->end;
@@ -193,111 +219,122 @@ UPB_INLINE void *upb_arena_malloc(upb_arena *a, size_t size) {
return ret;
}
-UPB_INLINE void *upb_arena_realloc(upb_arena *a, void *ptr, size_t oldsize,
+UPB_INLINE void* upb_Arena_Malloc(upb_Arena* a, size_t size) {
+ size = UPB_ALIGN_MALLOC(size);
+
+ if (UPB_UNLIKELY(_upb_ArenaHas(a) < size)) {
+ return _upb_Arena_SlowMalloc(a, size);
+ }
+
+ return _upb_Arena_FastMalloc(a, size);
+}
+
+// Shrinks the last alloc from arena.
+// REQUIRES: (ptr, oldsize) was the last malloc/realloc from this arena.
+// We could also add a upb_Arena_TryShrinkLast() which is simply a no-op if
+// this was not the last alloc.
+UPB_INLINE void upb_Arena_ShrinkLast(upb_Arena* a, void* ptr, size_t oldsize,
+ size_t size) {
+ _upb_ArenaHead* h = (_upb_ArenaHead*)a;
+ oldsize = UPB_ALIGN_MALLOC(oldsize);
+ size = UPB_ALIGN_MALLOC(size);
+ UPB_ASSERT((char*)ptr + oldsize == h->ptr); // Must be the last alloc.
+ UPB_ASSERT(size <= oldsize);
+ h->ptr = (char*)ptr + size;
+}
+
+UPB_INLINE void* upb_Arena_Realloc(upb_Arena* a, void* ptr, size_t oldsize,
size_t size) {
- void *ret = upb_arena_malloc(a, size);
+ _upb_ArenaHead* h = (_upb_ArenaHead*)a;
+ oldsize = UPB_ALIGN_MALLOC(oldsize);
+ size = UPB_ALIGN_MALLOC(size);
+ if (size <= oldsize) {
+ if ((char*)ptr + oldsize == h->ptr) {
+ upb_Arena_ShrinkLast(a, ptr, oldsize, size);
+ }
+ return ptr;
+ }
+
+ void* ret = upb_Arena_Malloc(a, size);
if (ret && oldsize > 0) {
- memcpy(ret, ptr, oldsize);
+ memcpy(ret, ptr, UPB_MIN(oldsize, size));
}
return ret;
}
-UPB_INLINE upb_arena *upb_arena_new(void) {
- return upb_arena_init(NULL, 0, &upb_alloc_global);
+UPB_INLINE upb_Arena* upb_Arena_New(void) {
+ return upb_Arena_Init(NULL, 0, &upb_alloc_global);
}
/* Constants ******************************************************************/
-/* Generic function type. */
-typedef void upb_func(void);
-
/* A list of types as they are encoded on-the-wire. */
typedef enum {
- UPB_WIRE_TYPE_VARINT = 0,
- UPB_WIRE_TYPE_64BIT = 1,
- UPB_WIRE_TYPE_DELIMITED = 2,
- UPB_WIRE_TYPE_START_GROUP = 3,
- UPB_WIRE_TYPE_END_GROUP = 4,
- UPB_WIRE_TYPE_32BIT = 5
-} upb_wiretype_t;
+ kUpb_WireType_Varint = 0,
+ kUpb_WireType_64Bit = 1,
+ kUpb_WireType_Delimited = 2,
+ kUpb_WireType_StartGroup = 3,
+ kUpb_WireType_EndGroup = 4,
+ kUpb_WireType_32Bit = 5
+} upb_WireType;
/* The types a field can have. Note that this list is not identical to the
* types defined in descriptor.proto, which gives INT32 and SINT32 separate
* types (we distinguish the two with the "integer encoding" enum below). */
typedef enum {
- UPB_TYPE_BOOL = 1,
- UPB_TYPE_FLOAT = 2,
- UPB_TYPE_INT32 = 3,
- UPB_TYPE_UINT32 = 4,
- UPB_TYPE_ENUM = 5, /* Enum values are int32. */
- UPB_TYPE_MESSAGE = 6,
- UPB_TYPE_DOUBLE = 7,
- UPB_TYPE_INT64 = 8,
- UPB_TYPE_UINT64 = 9,
- UPB_TYPE_STRING = 10,
- UPB_TYPE_BYTES = 11
-} upb_fieldtype_t;
+ kUpb_CType_Bool = 1,
+ kUpb_CType_Float = 2,
+ kUpb_CType_Int32 = 3,
+ kUpb_CType_UInt32 = 4,
+ kUpb_CType_Enum = 5, /* Enum values are int32. */
+ kUpb_CType_Message = 6,
+ kUpb_CType_Double = 7,
+ kUpb_CType_Int64 = 8,
+ kUpb_CType_UInt64 = 9,
+ kUpb_CType_String = 10,
+ kUpb_CType_Bytes = 11
+} upb_CType;
/* The repeated-ness of each field; this matches descriptor.proto. */
typedef enum {
- UPB_LABEL_OPTIONAL = 1,
- UPB_LABEL_REQUIRED = 2,
- UPB_LABEL_REPEATED = 3
-} upb_label_t;
+ kUpb_Label_Optional = 1,
+ kUpb_Label_Required = 2,
+ kUpb_Label_Repeated = 3
+} upb_Label;
/* Descriptor types, as defined in descriptor.proto. */
typedef enum {
- /* Old (long) names. TODO(haberman): remove */
- UPB_DESCRIPTOR_TYPE_DOUBLE = 1,
- UPB_DESCRIPTOR_TYPE_FLOAT = 2,
- UPB_DESCRIPTOR_TYPE_INT64 = 3,
- UPB_DESCRIPTOR_TYPE_UINT64 = 4,
- UPB_DESCRIPTOR_TYPE_INT32 = 5,
- UPB_DESCRIPTOR_TYPE_FIXED64 = 6,
- UPB_DESCRIPTOR_TYPE_FIXED32 = 7,
- UPB_DESCRIPTOR_TYPE_BOOL = 8,
- UPB_DESCRIPTOR_TYPE_STRING = 9,
- UPB_DESCRIPTOR_TYPE_GROUP = 10,
- UPB_DESCRIPTOR_TYPE_MESSAGE = 11,
- UPB_DESCRIPTOR_TYPE_BYTES = 12,
- UPB_DESCRIPTOR_TYPE_UINT32 = 13,
- UPB_DESCRIPTOR_TYPE_ENUM = 14,
- UPB_DESCRIPTOR_TYPE_SFIXED32 = 15,
- UPB_DESCRIPTOR_TYPE_SFIXED64 = 16,
- UPB_DESCRIPTOR_TYPE_SINT32 = 17,
- UPB_DESCRIPTOR_TYPE_SINT64 = 18,
-
- UPB_DTYPE_DOUBLE = 1,
- UPB_DTYPE_FLOAT = 2,
- UPB_DTYPE_INT64 = 3,
- UPB_DTYPE_UINT64 = 4,
- UPB_DTYPE_INT32 = 5,
- UPB_DTYPE_FIXED64 = 6,
- UPB_DTYPE_FIXED32 = 7,
- UPB_DTYPE_BOOL = 8,
- UPB_DTYPE_STRING = 9,
- UPB_DTYPE_GROUP = 10,
- UPB_DTYPE_MESSAGE = 11,
- UPB_DTYPE_BYTES = 12,
- UPB_DTYPE_UINT32 = 13,
- UPB_DTYPE_ENUM = 14,
- UPB_DTYPE_SFIXED32 = 15,
- UPB_DTYPE_SFIXED64 = 16,
- UPB_DTYPE_SINT32 = 17,
- UPB_DTYPE_SINT64 = 18
-} upb_descriptortype_t;
-
-#define UPB_MAP_BEGIN ((size_t)-1)
-
-UPB_INLINE bool _upb_isle(void) {
+ kUpb_FieldType_Double = 1,
+ kUpb_FieldType_Float = 2,
+ kUpb_FieldType_Int64 = 3,
+ kUpb_FieldType_UInt64 = 4,
+ kUpb_FieldType_Int32 = 5,
+ kUpb_FieldType_Fixed64 = 6,
+ kUpb_FieldType_Fixed32 = 7,
+ kUpb_FieldType_Bool = 8,
+ kUpb_FieldType_String = 9,
+ kUpb_FieldType_Group = 10,
+ kUpb_FieldType_Message = 11,
+ kUpb_FieldType_Bytes = 12,
+ kUpb_FieldType_UInt32 = 13,
+ kUpb_FieldType_Enum = 14,
+ kUpb_FieldType_SFixed32 = 15,
+ kUpb_FieldType_SFixed64 = 16,
+ kUpb_FieldType_SInt32 = 17,
+ kUpb_FieldType_SInt64 = 18
+} upb_FieldType;
+
+#define kUpb_Map_Begin ((size_t)-1)
+
+UPB_INLINE bool _upb_IsLittleEndian(void) {
int x = 1;
return *(char*)&x == 1;
}
-UPB_INLINE uint32_t _upb_be_swap32(uint32_t val) {
- if (_upb_isle()) {
+UPB_INLINE uint32_t _upb_BigEndian_Swap32(uint32_t val) {
+ if (_upb_IsLittleEndian()) {
return val;
} else {
return ((val & 0xff) << 24) | ((val & 0xff00) << 8) |
@@ -305,15 +342,16 @@ UPB_INLINE uint32_t _upb_be_swap32(uint32_t val) {
}
}
-UPB_INLINE uint64_t _upb_be_swap64(uint64_t val) {
- if (_upb_isle()) {
+UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) {
+ if (_upb_IsLittleEndian()) {
return val;
} else {
- return ((uint64_t)_upb_be_swap32(val) << 32) | _upb_be_swap32(val >> 32);
+ return ((uint64_t)_upb_BigEndian_Swap32(val) << 32) |
+ _upb_BigEndian_Swap32(val >> 32);
}
}
-UPB_INLINE int _upb_lg2ceil(int x) {
+UPB_INLINE int _upb_Log2Ceiling(int x) {
if (x <= 1) return 0;
#ifdef __GNUC__
return 32 - __builtin_clz(x - 1);
@@ -324,14 +362,12 @@ UPB_INLINE int _upb_lg2ceil(int x) {
#endif
}
-UPB_INLINE int _upb_lg2ceilsize(int x) {
- return 1 << _upb_lg2ceil(x);
-}
+UPB_INLINE int _upb_Log2CeilingSize(int x) { return 1 << _upb_Log2Ceiling(x); }
#include "upb/port_undef.inc"
#ifdef __cplusplus
-} /* extern "C" */
+} /* extern "C" */
#endif
-#endif /* UPB_H_ */
+#endif /* UPB_H_ */
diff --git a/grpc/third_party/upb/upb/upb.hpp b/grpc/third_party/upb/upb/upb.hpp
index b7b99761..2e4a21be 100644
--- a/grpc/third_party/upb/upb/upb.hpp
+++ b/grpc/third_party/upb/upb/upb.hpp
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef UPB_HPP_
#define UPB_HPP_
@@ -10,63 +34,66 @@ namespace upb {
class Status {
public:
- Status() { upb_status_clear(&status_); }
+ Status() { upb_Status_Clear(&status_); }
- upb_status* ptr() { return &status_; }
+ upb_Status* ptr() { return &status_; }
// Returns true if there is no error.
- bool ok() const { return upb_ok(&status_); }
+ bool ok() const { return upb_Status_IsOk(&status_); }
// Guaranteed to be NULL-terminated.
- const char *error_message() const { return upb_status_errmsg(&status_); }
+ const char* error_message() const {
+ return upb_Status_ErrorMessage(&status_);
+ }
// The error message will be truncated if it is longer than
- // UPB_STATUS_MAX_MESSAGE-4.
- void SetErrorMessage(const char *msg) { upb_status_seterrmsg(&status_, msg); }
- void SetFormattedErrorMessage(const char *fmt, ...) {
+ // _kUpb_Status_MaxMessage-4.
+ void SetErrorMessage(const char* msg) {
+ upb_Status_SetErrorMessage(&status_, msg);
+ }
+ void SetFormattedErrorMessage(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
- upb_status_vseterrf(&status_, fmt, args);
+ upb_Status_VSetErrorFormat(&status_, fmt, args);
va_end(args);
}
// Resets the status to a successful state with no message.
- void Clear() { upb_status_clear(&status_); }
+ void Clear() { upb_Status_Clear(&status_); }
private:
- upb_status status_;
+ upb_Status status_;
};
class Arena {
public:
// A simple arena with no initial memory block and the default allocator.
- Arena() : ptr_(upb_arena_new(), upb_arena_free) {}
- Arena(char *initial_block, size_t size)
- : ptr_(upb_arena_init(initial_block, size, &upb_alloc_global),
- upb_arena_free) {}
+ Arena() : ptr_(upb_Arena_New(), upb_Arena_Free) {}
+ Arena(char* initial_block, size_t size)
+ : ptr_(upb_Arena_Init(initial_block, size, &upb_alloc_global),
+ upb_Arena_Free) {}
- upb_arena* ptr() { return ptr_.get(); }
+ upb_Arena* ptr() { return ptr_.get(); }
// Allows this arena to be used as a generic allocator.
//
// The arena does not need free() calls so when using Arena as an allocator
// it is safe to skip them. However they are no-ops so there is no harm in
// calling free() either.
- upb_alloc *allocator() { return upb_arena_alloc(ptr_.get()); }
+ upb_alloc* allocator() { return upb_Arena_Alloc(ptr_.get()); }
// Add a cleanup function to run when the arena is destroyed.
// Returns false on out-of-memory.
template <class T>
- bool Own(T *obj) {
- return upb_arena_addcleanup(ptr_.get(), obj, [](void* obj) {
- delete static_cast<T*>(obj);
- });
+ bool Own(T* obj) {
+ return upb_Arena_AddCleanup(ptr_.get(), obj,
+ [](void* obj) { delete static_cast<T*>(obj); });
}
- void Fuse(Arena& other) { upb_arena_fuse(ptr(), other.ptr()); }
+ void Fuse(Arena& other) { upb_Arena_Fuse(ptr(), other.ptr()); }
private:
- std::unique_ptr<upb_arena, decltype(&upb_arena_free)> ptr_;
+ std::unique_ptr<upb_Arena, decltype(&upb_Arena_Free)> ptr_;
};
// InlinedArena seeds the arenas with a predefined amount of memory. No
@@ -85,4 +112,4 @@ class InlinedArena : public Arena {
} // namespace upb
-#endif // UPB_HPP_
+#endif // UPB_HPP_
diff --git a/grpc/third_party/upb/upb/upb.int.h b/grpc/third_party/upb/upb/upb.int.h
deleted file mode 100644
index b857560e..00000000
--- a/grpc/third_party/upb/upb/upb.int.h
+++ /dev/null
@@ -1,29 +0,0 @@
-
-#ifndef UPB_INT_H_
-#define UPB_INT_H_
-
-#include "upb/upb.h"
-
-struct mem_block;
-typedef struct mem_block mem_block;
-
-struct upb_arena {
- _upb_arena_head head;
- uint32_t *cleanups;
-
- /* Allocator to allocate arena blocks. We are responsible for freeing these
- * when we are destroyed. */
- upb_alloc *block_alloc;
- uint32_t last_size;
-
- /* When multiple arenas are fused together, each arena points to a parent
- * arena (root points to itself). The root tracks how many live arenas
- * reference it. */
- uint32_t refcount; /* Only used when a->parent == a */
- struct upb_arena *parent;
-
- /* Linked list of blocks to free/cleanup. */
- mem_block *freelist, *freelist_tail;
-};
-
-#endif /* UPB_INT_H_ */
diff --git a/grpc/third_party/upb/upb/upb_internal.h b/grpc/third_party/upb/upb/upb_internal.h
new file mode 100644
index 00000000..1eb166f7
--- /dev/null
+++ b/grpc/third_party/upb/upb/upb_internal.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_INT_H_
+#define UPB_INT_H_
+
+#include "upb/upb.h"
+
+struct mem_block;
+typedef struct mem_block mem_block;
+
+struct upb_Arena {
+ _upb_ArenaHead head;
+ /* Stores cleanup metadata for this arena.
+ * - a pointer to the current cleanup counter.
+ * - a boolean indicating if there is an unowned initial block. */
+ uintptr_t cleanup_metadata;
+
+ /* Allocator to allocate arena blocks. We are responsible for freeing these
+ * when we are destroyed. */
+ upb_alloc* block_alloc;
+ uint32_t last_size;
+
+ /* When multiple arenas are fused together, each arena points to a parent
+ * arena (root points to itself). The root tracks how many live arenas
+ * reference it. */
+ uint32_t refcount; /* Only used when a->parent == a */
+ struct upb_Arena* parent;
+
+ /* Linked list of blocks to free/cleanup. */
+ mem_block *freelist, *freelist_tail;
+};
+
+// Encodes a float or double that is round-trippable, but as short as possible.
+// These routines are not fully optimal (not guaranteed to be shortest), but are
+// short-ish and match the implementation that has been used in protobuf since
+// the beginning.
+//
+// The given buffer size must be at least kUpb_RoundTripBufferSize.
+enum { kUpb_RoundTripBufferSize = 32 };
+void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
+void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
+
+#endif /* UPB_INT_H_ */
diff --git a/grpc/third_party/upb/upb/util/BUILD b/grpc/third_party/upb/upb/util/BUILD
new file mode 100644
index 00000000..9c348229
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/BUILD
@@ -0,0 +1,121 @@
+load(
+ "//bazel:upb_proto_library.bzl",
+ "upb_proto_library",
+ "upb_proto_reflection_library",
+)
+
+licenses(["notice"])
+
+# Def to Proto
+
+cc_library(
+ name = "def_to_proto",
+ srcs = ["def_to_proto.c"],
+ hdrs = ["def_to_proto.h"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//:port",
+ "//:reflection",
+ ],
+)
+
+proto_library(
+ name = "def_to_proto_test_proto",
+ srcs = [
+ "def_to_proto_public_import_test.proto",
+ "def_to_proto_regular_import_test.proto",
+ "def_to_proto_test.proto",
+ ],
+)
+
+upb_proto_library(
+ name = "def_to_proto_test_upb_proto",
+ deps = ["def_to_proto_test_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "def_to_proto_test_upb_proto_reflection",
+ deps = ["def_to_proto_test_proto"],
+)
+
+cc_test(
+ name = "def_to_proto_test",
+ srcs = ["def_to_proto_test.cc"],
+ deps = [
+ ":def_to_proto",
+ ":def_to_proto_test_upb_proto",
+ ":def_to_proto_test_upb_proto_reflection",
+ "//:descriptor_upb_proto_reflection",
+ "//:reflection",
+ "//:upb",
+ "@com_google_absl//absl/strings",
+ "@com_google_googletest//:gtest_main",
+ "@com_google_protobuf//:protobuf",
+ ],
+)
+
+# Required fields
+
+cc_library(
+ name = "required_fields",
+ srcs = ["required_fields.c"],
+ hdrs = ["required_fields.h"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//:port",
+ "//:reflection",
+ ],
+)
+
+proto_library(
+ name = "required_fields_test_proto",
+ srcs = ["required_fields_test.proto"],
+)
+
+upb_proto_library(
+ name = "required_fields_test_upb_proto",
+ deps = ["required_fields_test_proto"],
+)
+
+upb_proto_reflection_library(
+ name = "required_fields_test_upb_proto_reflection",
+ deps = ["required_fields_test_proto"],
+)
+
+cc_test(
+ name = "required_fields_test",
+ srcs = ["required_fields_test.cc"],
+ deps = [
+ ":required_fields",
+ ":required_fields_test_upb_proto",
+ ":required_fields_test_upb_proto_reflection",
+ "//:json",
+ "//:reflection",
+ "//:upb",
+ "@com_google_absl//absl/strings",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+# Compare
+
+cc_library(
+ name = "compare",
+ srcs = ["compare.c"],
+ hdrs = ["compare.h"],
+ visibility = ["//visibility:public"],
+ deps = [
+ "//:port",
+ "//:reflection",
+ ],
+)
+
+cc_test(
+ name = "compare_test",
+ srcs = ["compare_test.cc"],
+ deps = [
+ ":compare",
+ "@com_google_absl//absl/strings",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
diff --git a/grpc/third_party/upb/upb/util/README.md b/grpc/third_party/upb/upb/util/README.md
new file mode 100644
index 00000000..efcdacbf
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/README.md
@@ -0,0 +1,7 @@
+
+# upb util library
+
+The libraries in this directory contain useful functionality that is layered
+on top of the main upb APIs. In other words, the APIs in this directory have
+no special access to upb internals; you could easily implement the same things
+yourself.
diff --git a/grpc/third_party/upb/upb/util/compare.c b/grpc/third_party/upb/upb/util/compare.c
new file mode 100644
index 00000000..b4dcfb54
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/compare.c
@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/compare.h"
+
+#include <setjmp.h>
+#include <stdbool.h>
+
+#include "upb/port_def.inc"
+
+struct upb_UnknownFields;
+typedef struct upb_UnknownFields upb_UnknownFields;
+
+typedef struct {
+ uint32_t tag;
+ union {
+ uint64_t varint;
+ uint64_t uint64;
+ uint32_t uint32;
+ upb_StringView delimited;
+ upb_UnknownFields* group;
+ } data;
+} upb_UnknownField;
+
+struct upb_UnknownFields {
+ size_t size;
+ size_t capacity;
+ upb_UnknownField* fields;
+};
+
+typedef struct {
+ const char* end;
+ upb_Arena* arena;
+ upb_UnknownField* tmp;
+ size_t tmp_size;
+ int depth;
+ jmp_buf err;
+} upb_UnknownField_Context;
+
+static void upb_UnknownFields_Grow(upb_UnknownField_Context* ctx,
+ upb_UnknownField** base,
+ upb_UnknownField** ptr,
+ upb_UnknownField** end) {
+ size_t old = (*ptr - *base);
+ size_t new = UPB_MAX(4, old * 2);
+
+ *base = upb_Arena_Realloc(ctx->arena, *base, old * sizeof(**base),
+ new * sizeof(**base));
+ if (!*base) UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_OutOfMemory);
+
+ *ptr = *base + old;
+ *end = *base + new;
+}
+
+static const char* upb_UnknownFields_ParseVarint(const char* ptr,
+ const char* limit,
+ uint64_t* val) {
+ uint8_t byte;
+ int bitpos = 0;
+ *val = 0;
+
+ do {
+ // Unknown field data must be valid.
+ UPB_ASSERT(bitpos < 70 && ptr < limit);
+ byte = *ptr;
+ *val |= (uint64_t)(byte & 0x7F) << bitpos;
+ ptr++;
+ bitpos += 7;
+ } while (byte & 0x80);
+
+ return ptr;
+}
+
+// We have to implement our own sort here, since qsort() is not an in-order
+// sort. Here we use merge sort, the simplest in-order sort.
+static void upb_UnknownFields_Merge(upb_UnknownField* arr, size_t start,
+ size_t mid, size_t end,
+ upb_UnknownField* tmp) {
+ memcpy(tmp, &arr[start], (end - start) * sizeof(*tmp));
+
+ upb_UnknownField* ptr1 = tmp;
+ upb_UnknownField* end1 = &tmp[mid - start];
+ upb_UnknownField* ptr2 = &tmp[mid - start];
+ upb_UnknownField* end2 = &tmp[end - start];
+ upb_UnknownField* out = &arr[start];
+
+ while (ptr1 < end1 && ptr2 < end2) {
+ if (ptr1->tag <= ptr2->tag) {
+ *out++ = *ptr1++;
+ } else {
+ *out++ = *ptr2++;
+ }
+ }
+
+ if (ptr1 < end1) {
+ memcpy(out, ptr1, (end1 - ptr1) * sizeof(*out));
+ } else if (ptr2 < end2) {
+ memcpy(out, ptr1, (end2 - ptr2) * sizeof(*out));
+ }
+}
+
+static void upb_UnknownFields_SortRecursive(upb_UnknownField* arr, size_t start,
+ size_t end, upb_UnknownField* tmp) {
+ if (end - start > 1) {
+ size_t mid = start + ((end - start) / 2);
+ upb_UnknownFields_SortRecursive(arr, start, mid, tmp);
+ upb_UnknownFields_SortRecursive(arr, mid, end, tmp);
+ upb_UnknownFields_Merge(arr, start, mid, end, tmp);
+ }
+}
+
+static void upb_UnknownFields_Sort(upb_UnknownField_Context* ctx,
+ upb_UnknownFields* fields) {
+ if (ctx->tmp_size < fields->size) {
+ ctx->tmp_size = UPB_MAX(8, ctx->tmp_size);
+ while (ctx->tmp_size < fields->size) ctx->tmp_size *= 2;
+ ctx->tmp = realloc(ctx->tmp, ctx->tmp_size * sizeof(*ctx->tmp));
+ }
+ upb_UnknownFields_SortRecursive(fields->fields, 0, fields->size, ctx->tmp);
+}
+
+static upb_UnknownFields* upb_UnknownFields_DoBuild(
+ upb_UnknownField_Context* ctx, const char** buf) {
+ upb_UnknownField* arr_base = NULL;
+ upb_UnknownField* arr_ptr = NULL;
+ upb_UnknownField* arr_end = NULL;
+ const char* ptr = *buf;
+ uint32_t last_tag = 0;
+ bool sorted = true;
+ while (ptr < ctx->end) {
+ uint64_t tag;
+ ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &tag);
+ UPB_ASSERT(tag <= UINT32_MAX);
+ int wire_type = tag & 7;
+ if (wire_type == kUpb_WireType_EndGroup) break;
+ if (tag < last_tag) sorted = false;
+ last_tag = tag;
+
+ if (arr_ptr == arr_end) {
+ upb_UnknownFields_Grow(ctx, &arr_base, &arr_ptr, &arr_end);
+ }
+ upb_UnknownField* field = arr_ptr;
+ field->tag = tag;
+ arr_ptr++;
+
+ switch (wire_type) {
+ case kUpb_WireType_Varint:
+ ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &field->data.varint);
+ break;
+ case kUpb_WireType_64Bit:
+ UPB_ASSERT(ctx->end - ptr >= 8);
+ memcpy(&field->data.uint64, ptr, 8);
+ ptr += 8;
+ break;
+ case kUpb_WireType_32Bit:
+ UPB_ASSERT(ctx->end - ptr >= 4);
+ memcpy(&field->data.uint32, ptr, 4);
+ ptr += 4;
+ break;
+ case kUpb_WireType_Delimited: {
+ uint64_t size;
+ ptr = upb_UnknownFields_ParseVarint(ptr, ctx->end, &size);
+ UPB_ASSERT(ctx->end - ptr >= size);
+ field->data.delimited.data = ptr;
+ field->data.delimited.size = size;
+ ptr += size;
+ break;
+ }
+ case kUpb_WireType_StartGroup:
+ if (--ctx->depth == 0) {
+ UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_MaxDepthExceeded);
+ }
+ field->data.group = upb_UnknownFields_DoBuild(ctx, &ptr);
+ ctx->depth++;
+ break;
+ default:
+ UPB_UNREACHABLE();
+ }
+ }
+
+ *buf = ptr;
+ upb_UnknownFields* ret = upb_Arena_Malloc(ctx->arena, sizeof(*ret));
+ if (!ret) UPB_LONGJMP(ctx->err, kUpb_UnknownCompareResult_OutOfMemory);
+ ret->fields = arr_base;
+ ret->size = arr_ptr - arr_base;
+ ret->capacity = arr_end - arr_base;
+ if (!sorted) {
+ upb_UnknownFields_Sort(ctx, ret);
+ }
+ return ret;
+}
+
+// Builds a upb_UnknownFields data structure from the binary data in buf.
+static upb_UnknownFields* upb_UnknownFields_Build(upb_UnknownField_Context* ctx,
+ const char* buf,
+ size_t size) {
+ ctx->end = buf + size;
+ upb_UnknownFields* fields = upb_UnknownFields_DoBuild(ctx, &buf);
+ UPB_ASSERT(buf == ctx->end);
+ return fields;
+}
+
+// Compares two sorted upb_UnknwonFields structures for equality.
+static bool upb_UnknownFields_IsEqual(const upb_UnknownFields* uf1,
+ const upb_UnknownFields* uf2) {
+ if (uf1->size != uf2->size) return false;
+ for (size_t i = 0, n = uf1->size; i < n; i++) {
+ upb_UnknownField* f1 = &uf1->fields[i];
+ upb_UnknownField* f2 = &uf2->fields[i];
+ if (f1->tag != f2->tag) return false;
+ int wire_type = f1->tag & 7;
+ switch (wire_type) {
+ case kUpb_WireType_Varint:
+ if (f1->data.varint != f2->data.varint) return false;
+ break;
+ case kUpb_WireType_64Bit:
+ if (f1->data.uint64 != f2->data.uint64) return false;
+ break;
+ case kUpb_WireType_32Bit:
+ if (f1->data.uint32 != f2->data.uint32) return false;
+ break;
+ case kUpb_WireType_Delimited:
+ if (!upb_StringView_IsEqual(f1->data.delimited, f2->data.delimited)) {
+ return false;
+ }
+ break;
+ case kUpb_WireType_StartGroup:
+ if (!upb_UnknownFields_IsEqual(f1->data.group, f2->data.group)) {
+ return false;
+ }
+ break;
+ default:
+ UPB_UNREACHABLE();
+ }
+ }
+ return true;
+}
+
+upb_UnknownCompareResult upb_Message_UnknownFieldsAreEqual(const char* buf1,
+ size_t size1,
+ const char* buf2,
+ size_t size2,
+ int max_depth) {
+ if (size1 == 0 && size2 == 0) return kUpb_UnknownCompareResult_Equal;
+ if (size1 == 0 || size2 == 0) return kUpb_UnknownCompareResult_NotEqual;
+ if (memcmp(buf1, buf2, size1) == 0) return kUpb_UnknownCompareResult_Equal;
+
+ upb_UnknownField_Context ctx = {
+ .arena = upb_Arena_New(),
+ .depth = max_depth,
+ .tmp = NULL,
+ .tmp_size = 0,
+ };
+
+ if (!ctx.arena) return kUpb_UnknownCompareResult_OutOfMemory;
+
+ int ret = UPB_SETJMP(ctx.err);
+
+ if (UPB_LIKELY(ret == 0)) {
+ // First build both unknown fields into a sorted data structure (similar
+ // to the UnknownFieldSet in C++).
+ upb_UnknownFields* uf1 = upb_UnknownFields_Build(&ctx, buf1, size1);
+ upb_UnknownFields* uf2 = upb_UnknownFields_Build(&ctx, buf2, size2);
+
+ // Now perform the equality check on the sorted structures.
+ if (upb_UnknownFields_IsEqual(uf1, uf2)) {
+ ret = kUpb_UnknownCompareResult_Equal;
+ } else {
+ ret = kUpb_UnknownCompareResult_NotEqual;
+ }
+ }
+
+ upb_Arena_Free(ctx.arena);
+ free(ctx.tmp);
+ return ret;
+}
diff --git a/grpc/third_party/upb/upb/util/compare.h b/grpc/third_party/upb/upb/util/compare.h
new file mode 100644
index 00000000..92f6d83a
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/compare.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_UTIL_COMPARE_H_
+#define UPB_UTIL_COMPARE_H_
+
+#include "upb/def.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Returns true if unknown fields from the two messages are equal when sorted
+// and varints are made canonical.
+//
+// This function is discouraged, as the comparison is inherently lossy without
+// schema data:
+//
+// 1. We don't know whether delimited fields are sub-messages. Unknown
+// sub-messages will therefore not have their fields sorted and varints
+// canonicalized.
+// 2. We don't know about oneof/non-repeated fields, which should semantically
+// discard every value except the last.
+
+typedef enum {
+ kUpb_UnknownCompareResult_Equal = 0,
+ kUpb_UnknownCompareResult_NotEqual = 1,
+ kUpb_UnknownCompareResult_OutOfMemory = 2,
+ kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
+} upb_UnknownCompareResult;
+
+upb_UnknownCompareResult upb_Message_UnknownFieldsAreEqual(const char* buf1,
+ size_t size1,
+ const char* buf2,
+ size_t size2,
+ int max_depth);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* UPB_UTIL_COMPARE_H_ */
diff --git a/grpc/third_party/upb/upb/util/compare_test.cc b/grpc/third_party/upb/upb/util/compare_test.cc
new file mode 100644
index 00000000..a35c6b3e
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/compare_test.cc
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/compare.h"
+
+#include <stdint.h>
+
+#include <string_view>
+#include <vector>
+
+#include "absl/strings/string_view.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+struct UnknownField;
+
+using UnknownFields = std::vector<UnknownField>;
+
+enum class UnknownFieldType {
+ kVarint,
+ kLongVarint, // Over-encoded to have distinct wire format.
+ kDelimited,
+ kFixed64,
+ kFixed32,
+ kGroup,
+};
+
+union UnknownFieldValue {
+ uint64_t varint;
+ uint64_t fixed64;
+ uint32_t fixed32;
+ // NULL-terminated (strings must not have embedded NULL).
+ const char* delimited;
+ UnknownFields* group;
+};
+
+struct TypeAndValue {
+ UnknownFieldType type;
+ UnknownFieldValue value;
+};
+
+struct UnknownField {
+ uint32_t field_number;
+ TypeAndValue value;
+};
+
+TypeAndValue Varint(uint64_t val) {
+ TypeAndValue ret{UnknownFieldType::kVarint};
+ ret.value.varint = val;
+ return ret;
+}
+
+TypeAndValue LongVarint(uint64_t val) {
+ TypeAndValue ret{UnknownFieldType::kLongVarint};
+ ret.value.varint = val;
+ return ret;
+}
+
+TypeAndValue Fixed64(uint64_t val) {
+ TypeAndValue ret{UnknownFieldType::kFixed64};
+ ret.value.fixed64 = val;
+ return ret;
+}
+
+TypeAndValue Fixed32(uint32_t val) {
+ TypeAndValue ret{UnknownFieldType::kFixed32};
+ ret.value.fixed32 = val;
+ return ret;
+}
+
+TypeAndValue Delimited(const char* val) {
+ TypeAndValue ret{UnknownFieldType::kDelimited};
+ ret.value.delimited = val;
+ return ret;
+}
+
+TypeAndValue Group(UnknownFields nested) {
+ TypeAndValue ret{UnknownFieldType::kGroup};
+ ret.value.group = &nested;
+ return ret;
+}
+
+void EncodeVarint(uint64_t val, std::string* str) {
+ do {
+ char byte = val & 0x7fU;
+ val >>= 7;
+ if (val) byte |= 0x80U;
+ str->push_back(byte);
+ } while (val);
+}
+
+std::string ToBinaryPayload(const UnknownFields& fields) {
+ static const upb_WireType wire_types[] = {
+ kUpb_WireType_Varint, kUpb_WireType_Varint, kUpb_WireType_Delimited,
+ kUpb_WireType_64Bit, kUpb_WireType_32Bit, kUpb_WireType_StartGroup,
+ };
+ std::string ret;
+
+ for (const auto& field : fields) {
+ uint32_t tag = field.field_number << 3 |
+ (wire_types[static_cast<int>(field.value.type)]);
+ EncodeVarint(tag, &ret);
+ switch (field.value.type) {
+ case UnknownFieldType::kVarint:
+ EncodeVarint(field.value.value.varint, &ret);
+ break;
+ case UnknownFieldType::kLongVarint:
+ EncodeVarint(field.value.value.varint, &ret);
+ ret.back() |= 0x80;
+ ret.push_back(0);
+ break;
+ case UnknownFieldType::kDelimited:
+ EncodeVarint(strlen(field.value.value.delimited), &ret);
+ ret.append(field.value.value.delimited);
+ break;
+ case UnknownFieldType::kFixed64: {
+ uint64_t val = _upb_BigEndian_Swap64(field.value.value.fixed64);
+ ret.append(reinterpret_cast<const char*>(&val), sizeof(val));
+ break;
+ }
+ case UnknownFieldType::kFixed32: {
+ uint32_t val = _upb_BigEndian_Swap32(field.value.value.fixed32);
+ ret.append(reinterpret_cast<const char*>(&val), sizeof(val));
+ break;
+ }
+ case UnknownFieldType::kGroup: {
+ uint32_t end_tag = field.field_number << 3 | kUpb_WireType_EndGroup;
+ ret.append(ToBinaryPayload(*field.value.value.group));
+ EncodeVarint(end_tag, &ret);
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
+upb_UnknownCompareResult CompareUnknownWithMaxDepth(UnknownFields uf1,
+ UnknownFields uf2,
+ int max_depth) {
+ std::string buf1 = ToBinaryPayload(uf1);
+ std::string buf2 = ToBinaryPayload(uf2);
+ return upb_Message_UnknownFieldsAreEqual(buf1.data(), buf1.size(),
+ buf2.data(), buf2.size(), max_depth);
+}
+
+upb_UnknownCompareResult CompareUnknown(UnknownFields uf1, UnknownFields uf2) {
+ return CompareUnknownWithMaxDepth(uf1, uf2, 64);
+}
+
+TEST(CompareTest, UnknownFieldsReflexive) {
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal, CompareUnknown({}, {}));
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal,
+ CompareUnknown({{1, Varint(123)}, {2, Fixed32(456)}},
+ {{1, Varint(123)}, {2, Fixed32(456)}}));
+ EXPECT_EQ(
+ kUpb_UnknownCompareResult_Equal,
+ CompareUnknown(
+ {{1, Group({{2, Group({{3, Fixed32(456)}, {4, Fixed64(123)}})}})}},
+ {{1, Group({{2, Group({{3, Fixed32(456)}, {4, Fixed64(123)}})}})}}));
+}
+
+TEST(CompareTest, UnknownFieldsOrdering) {
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal,
+ CompareUnknown({{1, Varint(111)},
+ {2, Delimited("ABC")},
+ {3, Fixed32(456)},
+ {4, Fixed64(123)},
+ {5, Group({})}},
+ {{5, Group({})},
+ {4, Fixed64(123)},
+ {3, Fixed32(456)},
+ {2, Delimited("ABC")},
+ {1, Varint(111)}}));
+ EXPECT_EQ(kUpb_UnknownCompareResult_NotEqual,
+ CompareUnknown({{1, Varint(111)},
+ {2, Delimited("ABC")},
+ {3, Fixed32(456)},
+ {4, Fixed64(123)},
+ {5, Group({})}},
+ {{5, Group({})},
+ {4, Fixed64(123)},
+ {3, Fixed32(455)}, // Small difference.
+ {2, Delimited("ABC")},
+ {1, Varint(111)}}));
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal,
+ CompareUnknown({{3, Fixed32(456)}, {4, Fixed64(123)}},
+ {{4, Fixed64(123)}, {3, Fixed32(456)}}));
+ EXPECT_EQ(
+ kUpb_UnknownCompareResult_Equal,
+ CompareUnknown(
+ {{1, Group({{2, Group({{3, Fixed32(456)}, {4, Fixed64(123)}})}})}},
+ {{1, Group({{2, Group({{4, Fixed64(123)}, {3, Fixed32(456)}})}})}}));
+}
+
+TEST(CompareTest, LongVarint) {
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal,
+ CompareUnknown({{1, LongVarint(123)}, {2, LongVarint(456)}},
+ {{1, Varint(123)}, {2, Varint(456)}}));
+ EXPECT_EQ(kUpb_UnknownCompareResult_Equal,
+ CompareUnknown({{2, LongVarint(456)}, {1, LongVarint(123)}},
+ {{1, Varint(123)}, {2, Varint(456)}}));
+}
+
+TEST(CompareTest, MaxDepth) {
+ EXPECT_EQ(
+ kUpb_UnknownCompareResult_MaxDepthExceeded,
+ CompareUnknownWithMaxDepth(
+ {{1, Group({{2, Group({{3, Fixed32(456)}, {4, Fixed64(123)}})}})}},
+ {{1, Group({{2, Group({{4, Fixed64(123)}, {3, Fixed32(456)}})}})}},
+ 2));
+}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto.c b/grpc/third_party/upb/upb/util/def_to_proto.c
new file mode 100644
index 00000000..6195336a
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto.c
@@ -0,0 +1,558 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/def_to_proto.h"
+
+#include <inttypes.h>
+#include <setjmp.h>
+#include <stdio.h>
+
+#include "upb/reflection.h"
+
+/* Must be last. */
+#include "upb/port_def.inc"
+
+typedef struct {
+ upb_Arena* arena;
+ jmp_buf err;
+} upb_ToProto_Context;
+
+#define CHK_OOM(val) \
+ if (!(val)) UPB_LONGJMP(ctx->err, 1);
+
+// We want to copy the options verbatim into the destination options proto.
+// We use serialize+parse as our deep copy.
+#define SET_OPTIONS(proto, desc_type, options_type, src) \
+ { \
+ size_t size; \
+ /* MEM: could use a temporary arena here instead. */ \
+ char* pb = \
+ google_protobuf_##options_type##_serialize(src, ctx->arena, &size); \
+ CHK_OOM(pb); \
+ google_protobuf_##options_type* dst = \
+ google_protobuf_##options_type##_parse(pb, size, ctx->arena); \
+ CHK_OOM(dst); \
+ google_protobuf_##desc_type##_set_options(proto, dst); \
+ }
+
+static upb_StringView strviewdup2(upb_ToProto_Context* ctx,
+ upb_StringView str) {
+ char* p = upb_Arena_Malloc(ctx->arena, str.size);
+ CHK_OOM(p);
+ memcpy(p, str.data, str.size);
+ return (upb_StringView){.data = p, .size = str.size};
+}
+
+static upb_StringView strviewdup(upb_ToProto_Context* ctx, const char* s) {
+ return strviewdup2(ctx, (upb_StringView){.data = s, .size = strlen(s)});
+}
+
+static upb_StringView qual_dup(upb_ToProto_Context* ctx, const char* s) {
+ size_t n = strlen(s);
+ char* p = upb_Arena_Malloc(ctx->arena, n + 1);
+ CHK_OOM(p);
+ p[0] = '.';
+ memcpy(p + 1, s, n);
+ return (upb_StringView){.data = p, .size = n + 1};
+}
+
+UPB_PRINTF(2, 3)
+static upb_StringView printf_dup(upb_ToProto_Context* ctx, const char* fmt,
+ ...) {
+ const size_t max = 32;
+ char* p = upb_Arena_Malloc(ctx->arena, max);
+ CHK_OOM(p);
+ va_list args;
+ va_start(args, fmt);
+ size_t n = vsnprintf(p, max, fmt, args);
+ va_end(args);
+ UPB_ASSERT(n < max);
+ return (upb_StringView){.data = p, .size = n};
+}
+
+static bool upb_isprint(char ch) { return ch >= 0x20 && ch <= 0x7f; }
+
+static upb_StringView default_bytes(upb_ToProto_Context* ctx,
+ upb_StringView val) {
+ size_t n = 0;
+ for (size_t i = 0; i < val.size; i++) {
+ n += upb_isprint(val.data[i]) ? 1 : 4; // '\123'
+ }
+ char* p = upb_Arena_Malloc(ctx->arena, n);
+ CHK_OOM(p);
+ char* dst = p;
+ const char* src = val.data;
+ const char* end = src + val.size;
+ while (src < end) {
+ unsigned char ch = *src++;
+ if (upb_isprint(ch)) {
+ *dst++ = ch;
+ } else {
+ *dst++ = '\\';
+ *dst++ = '0' + (ch >> 6);
+ *dst++ = '0' + ((ch >> 3) & 0x7);
+ *dst++ = '0' + (ch & 0x7);
+ }
+ }
+ return (upb_StringView){.data = p, .size = n};
+}
+
+static upb_StringView default_string(upb_ToProto_Context* ctx,
+ const upb_FieldDef* f) {
+ upb_MessageValue d = upb_FieldDef_Default(f);
+ switch (upb_FieldDef_CType(f)) {
+ case kUpb_CType_Bool:
+ return strviewdup(ctx, d.bool_val ? "true" : "false");
+ case kUpb_CType_Enum: {
+ const upb_EnumDef* e = upb_FieldDef_EnumSubDef(f);
+ const upb_EnumValueDef* ev =
+ upb_EnumDef_FindValueByNumber(e, d.int32_val);
+ return strviewdup(ctx, upb_EnumValueDef_Name(ev));
+ }
+ case kUpb_CType_Int64:
+ return printf_dup(ctx, "%" PRId64, d.int64_val);
+ case kUpb_CType_UInt64:
+ return printf_dup(ctx, "%" PRIu64, d.uint64_val);
+ case kUpb_CType_Int32:
+ return printf_dup(ctx, "%" PRId32, d.int32_val);
+ case kUpb_CType_UInt32:
+ return printf_dup(ctx, "%" PRIu32, d.uint32_val);
+ case kUpb_CType_Float:
+ return printf_dup(ctx, "%.9g", d.float_val);
+ case kUpb_CType_Double:
+ return printf_dup(ctx, "%.17g", d.double_val);
+ case kUpb_CType_String:
+ return strviewdup2(ctx, d.str_val);
+ case kUpb_CType_Bytes:
+ return default_bytes(ctx, d.str_val);
+ default:
+ UPB_UNREACHABLE();
+ }
+}
+
+static google_protobuf_FieldDescriptorProto* fielddef_toproto(
+ upb_ToProto_Context* ctx, const upb_FieldDef* f) {
+ google_protobuf_FieldDescriptorProto* proto =
+ google_protobuf_FieldDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_FieldDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_FieldDef_Name(f)));
+ google_protobuf_FieldDescriptorProto_set_number(proto,
+ upb_FieldDef_Number(f));
+ google_protobuf_FieldDescriptorProto_set_label(proto, upb_FieldDef_Label(f));
+ google_protobuf_FieldDescriptorProto_set_type(proto, upb_FieldDef_Type(f));
+
+ if (upb_FieldDef_HasJsonName(f)) {
+ google_protobuf_FieldDescriptorProto_set_json_name(
+ proto, strviewdup(ctx, upb_FieldDef_JsonName(f)));
+ }
+
+ if (upb_FieldDef_IsSubMessage(f)) {
+ google_protobuf_FieldDescriptorProto_set_type_name(
+ proto,
+ qual_dup(ctx, upb_MessageDef_FullName(upb_FieldDef_MessageSubDef(f))));
+ } else if (upb_FieldDef_CType(f) == kUpb_CType_Enum) {
+ google_protobuf_FieldDescriptorProto_set_type_name(
+ proto, qual_dup(ctx, upb_EnumDef_FullName(upb_FieldDef_EnumSubDef(f))));
+ }
+
+ if (upb_FieldDef_IsExtension(f)) {
+ google_protobuf_FieldDescriptorProto_set_extendee(
+ proto,
+ qual_dup(ctx, upb_MessageDef_FullName(upb_FieldDef_ContainingType(f))));
+ }
+
+ if (upb_FieldDef_HasDefault(f)) {
+ google_protobuf_FieldDescriptorProto_set_default_value(
+ proto, default_string(ctx, f));
+ }
+
+ const upb_OneofDef* o = upb_FieldDef_ContainingOneof(f);
+ if (o) {
+ google_protobuf_FieldDescriptorProto_set_oneof_index(proto,
+ upb_OneofDef_Index(o));
+ }
+
+ if (_upb_FieldDef_IsProto3Optional(f)) {
+ google_protobuf_FieldDescriptorProto_set_proto3_optional(proto, true);
+ }
+
+ if (upb_FieldDef_HasOptions(f)) {
+ SET_OPTIONS(proto, FieldDescriptorProto, FieldOptions,
+ upb_FieldDef_Options(f));
+ }
+
+ return proto;
+}
+
+static google_protobuf_OneofDescriptorProto* oneofdef_toproto(
+ upb_ToProto_Context* ctx, const upb_OneofDef* o) {
+ google_protobuf_OneofDescriptorProto* proto =
+ google_protobuf_OneofDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_OneofDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_OneofDef_Name(o)));
+
+ if (upb_OneofDef_HasOptions(o)) {
+ SET_OPTIONS(proto, OneofDescriptorProto, OneofOptions,
+ upb_OneofDef_Options(o));
+ }
+
+ return proto;
+}
+
+static google_protobuf_EnumValueDescriptorProto* enumvaldef_toproto(
+ upb_ToProto_Context* ctx, const upb_EnumValueDef* e) {
+ google_protobuf_EnumValueDescriptorProto* proto =
+ google_protobuf_EnumValueDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_EnumValueDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_EnumValueDef_Name(e)));
+ google_protobuf_EnumValueDescriptorProto_set_number(
+ proto, upb_EnumValueDef_Number(e));
+
+ if (upb_EnumValueDef_HasOptions(e)) {
+ SET_OPTIONS(proto, EnumValueDescriptorProto, EnumValueOptions,
+ upb_EnumValueDef_Options(e));
+ }
+
+ return proto;
+}
+
+static google_protobuf_EnumDescriptorProto* enumdef_toproto(
+ upb_ToProto_Context* ctx, const upb_EnumDef* e) {
+ google_protobuf_EnumDescriptorProto* proto =
+ google_protobuf_EnumDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_EnumDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_EnumDef_Name(e)));
+
+ int n;
+
+ n = upb_EnumDef_ValueCount(e);
+ google_protobuf_EnumValueDescriptorProto** vals =
+ google_protobuf_EnumDescriptorProto_resize_value(proto, n, ctx->arena);
+ CHK_OOM(vals);
+ for (int i = 0; i < n; i++) {
+ vals[i] = enumvaldef_toproto(ctx, upb_EnumDef_Value(e, i));
+ }
+
+ // TODO: reserved range, reserved name
+
+ if (upb_EnumDef_HasOptions(e)) {
+ SET_OPTIONS(proto, EnumDescriptorProto, EnumOptions,
+ upb_EnumDef_Options(e));
+ }
+
+ return proto;
+}
+
+static google_protobuf_DescriptorProto_ExtensionRange* extrange_toproto(
+ upb_ToProto_Context* ctx, const upb_ExtensionRange* e) {
+ google_protobuf_DescriptorProto_ExtensionRange* proto =
+ google_protobuf_DescriptorProto_ExtensionRange_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_DescriptorProto_ExtensionRange_set_start(
+ proto, upb_ExtensionRange_Start(e));
+ google_protobuf_DescriptorProto_ExtensionRange_set_end(
+ proto, upb_ExtensionRange_End(e));
+
+ if (upb_ExtensionRange_HasOptions(e)) {
+ SET_OPTIONS(proto, DescriptorProto_ExtensionRange, ExtensionRangeOptions,
+ upb_ExtensionRange_Options(e));
+ }
+
+ return proto;
+}
+
+static google_protobuf_DescriptorProto* msgdef_toproto(
+ upb_ToProto_Context* ctx, const upb_MessageDef* m) {
+ google_protobuf_DescriptorProto* proto =
+ google_protobuf_DescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_DescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_MessageDef_Name(m)));
+
+ int n;
+
+ n = upb_MessageDef_FieldCount(m);
+ google_protobuf_FieldDescriptorProto** fields =
+ google_protobuf_DescriptorProto_resize_field(proto, n, ctx->arena);
+ CHK_OOM(fields);
+ for (int i = 0; i < n; i++) {
+ fields[i] = fielddef_toproto(ctx, upb_MessageDef_Field(m, i));
+ }
+
+ n = upb_MessageDef_OneofCount(m);
+ google_protobuf_OneofDescriptorProto** oneofs =
+ google_protobuf_DescriptorProto_resize_oneof_decl(proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ oneofs[i] = oneofdef_toproto(ctx, upb_MessageDef_Oneof(m, i));
+ }
+
+ n = upb_MessageDef_NestedMessageCount(m);
+ google_protobuf_DescriptorProto** nested_msgs =
+ google_protobuf_DescriptorProto_resize_nested_type(proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ nested_msgs[i] = msgdef_toproto(ctx, upb_MessageDef_NestedMessage(m, i));
+ }
+
+ n = upb_MessageDef_NestedEnumCount(m);
+ google_protobuf_EnumDescriptorProto** nested_enums =
+ google_protobuf_DescriptorProto_resize_enum_type(proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ nested_enums[i] = enumdef_toproto(ctx, upb_MessageDef_NestedEnum(m, i));
+ }
+
+ n = upb_MessageDef_NestedExtensionCount(m);
+ google_protobuf_FieldDescriptorProto** nested_exts =
+ google_protobuf_DescriptorProto_resize_extension(proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ nested_exts[i] =
+ fielddef_toproto(ctx, upb_MessageDef_NestedExtension(m, i));
+ }
+
+ n = upb_MessageDef_ExtensionRangeCount(m);
+ google_protobuf_DescriptorProto_ExtensionRange** ext_ranges =
+ google_protobuf_DescriptorProto_resize_extension_range(proto, n,
+ ctx->arena);
+ for (int i = 0; i < n; i++) {
+ ext_ranges[i] = extrange_toproto(ctx, upb_MessageDef_ExtensionRange(m, i));
+ }
+
+ // TODO: reserved ranges and reserved names
+
+ if (upb_MessageDef_HasOptions(m)) {
+ SET_OPTIONS(proto, DescriptorProto, MessageOptions,
+ upb_MessageDef_Options(m));
+ }
+
+ return proto;
+}
+
+static google_protobuf_MethodDescriptorProto* methoddef_toproto(
+ upb_ToProto_Context* ctx, const upb_MethodDef* m) {
+ google_protobuf_MethodDescriptorProto* proto =
+ google_protobuf_MethodDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_MethodDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_MethodDef_Name(m)));
+
+ google_protobuf_MethodDescriptorProto_set_input_type(
+ proto,
+ qual_dup(ctx, upb_MessageDef_FullName(upb_MethodDef_InputType(m))));
+ google_protobuf_MethodDescriptorProto_set_output_type(
+ proto,
+ qual_dup(ctx, upb_MessageDef_FullName(upb_MethodDef_OutputType(m))));
+
+ if (upb_MethodDef_ClientStreaming(m)) {
+ google_protobuf_MethodDescriptorProto_set_client_streaming(proto, true);
+ }
+
+ if (upb_MethodDef_ServerStreaming(m)) {
+ google_protobuf_MethodDescriptorProto_set_server_streaming(proto, true);
+ }
+
+ if (upb_MethodDef_HasOptions(m)) {
+ SET_OPTIONS(proto, MethodDescriptorProto, MethodOptions,
+ upb_MethodDef_Options(m));
+ }
+
+ return proto;
+}
+
+static google_protobuf_ServiceDescriptorProto* servicedef_toproto(
+ upb_ToProto_Context* ctx, const upb_ServiceDef* s) {
+ google_protobuf_ServiceDescriptorProto* proto =
+ google_protobuf_ServiceDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_ServiceDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_ServiceDef_Name(s)));
+
+ size_t n = upb_ServiceDef_MethodCount(s);
+ google_protobuf_MethodDescriptorProto** methods =
+ google_protobuf_ServiceDescriptorProto_resize_method(proto, n,
+ ctx->arena);
+ for (int i = 0; i < n; i++) {
+ methods[i] = methoddef_toproto(ctx, upb_ServiceDef_Method(s, i));
+ }
+
+ if (upb_ServiceDef_HasOptions(s)) {
+ SET_OPTIONS(proto, ServiceDescriptorProto, ServiceOptions,
+ upb_ServiceDef_Options(s));
+ }
+
+ return proto;
+}
+
+static google_protobuf_FileDescriptorProto* filedef_toproto(
+ upb_ToProto_Context* ctx, const upb_FileDef* f) {
+ google_protobuf_FileDescriptorProto* proto =
+ google_protobuf_FileDescriptorProto_new(ctx->arena);
+ CHK_OOM(proto);
+
+ google_protobuf_FileDescriptorProto_set_name(
+ proto, strviewdup(ctx, upb_FileDef_Name(f)));
+
+ const char* package = upb_FileDef_Package(f);
+ if (package) {
+ size_t n = strlen(package);
+ if (n) {
+ google_protobuf_FileDescriptorProto_set_package(
+ proto, strviewdup(ctx, upb_FileDef_Package(f)));
+ }
+ }
+
+ if (upb_FileDef_Syntax(f) == kUpb_Syntax_Proto3) {
+ google_protobuf_FileDescriptorProto_set_syntax(proto,
+ strviewdup(ctx, "proto3"));
+ }
+
+ size_t n;
+ n = upb_FileDef_DependencyCount(f);
+ upb_StringView* deps = google_protobuf_FileDescriptorProto_resize_dependency(
+ proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ deps[i] = strviewdup(ctx, upb_FileDef_Name(upb_FileDef_Dependency(f, i)));
+ }
+
+ n = upb_FileDef_PublicDependencyCount(f);
+ int32_t* public_deps =
+ google_protobuf_FileDescriptorProto_resize_public_dependency(proto, n,
+ ctx->arena);
+ const int32_t* public_dep_nums = _upb_FileDef_PublicDependencyIndexes(f);
+ if (n) memcpy(public_deps, public_dep_nums, n * sizeof(int32_t));
+
+ n = upb_FileDef_WeakDependencyCount(f);
+ int32_t* weak_deps =
+ google_protobuf_FileDescriptorProto_resize_weak_dependency(proto, n,
+ ctx->arena);
+ const int32_t* weak_dep_nums = _upb_FileDef_WeakDependencyIndexes(f);
+ if (n) memcpy(weak_deps, weak_dep_nums, n * sizeof(int32_t));
+
+ n = upb_FileDef_TopLevelMessageCount(f);
+ google_protobuf_DescriptorProto** msgs =
+ google_protobuf_FileDescriptorProto_resize_message_type(proto, n,
+ ctx->arena);
+ for (int i = 0; i < n; i++) {
+ msgs[i] = msgdef_toproto(ctx, upb_FileDef_TopLevelMessage(f, i));
+ }
+
+ n = upb_FileDef_TopLevelEnumCount(f);
+ google_protobuf_EnumDescriptorProto** enums =
+ google_protobuf_FileDescriptorProto_resize_enum_type(proto, n,
+ ctx->arena);
+ for (int i = 0; i < n; i++) {
+ enums[i] = enumdef_toproto(ctx, upb_FileDef_TopLevelEnum(f, i));
+ }
+
+ n = upb_FileDef_ServiceCount(f);
+ google_protobuf_ServiceDescriptorProto** services =
+ google_protobuf_FileDescriptorProto_resize_service(proto, n, ctx->arena);
+ for (int i = 0; i < n; i++) {
+ services[i] = servicedef_toproto(ctx, upb_FileDef_Service(f, i));
+ }
+
+ n = upb_FileDef_TopLevelExtensionCount(f);
+ google_protobuf_FieldDescriptorProto** exts =
+ google_protobuf_FileDescriptorProto_resize_extension(proto, n,
+ ctx->arena);
+ for (int i = 0; i < n; i++) {
+ exts[i] = fielddef_toproto(ctx, upb_FileDef_TopLevelExtension(f, i));
+ }
+
+ if (upb_FileDef_HasOptions(f)) {
+ SET_OPTIONS(proto, FileDescriptorProto, FileOptions,
+ upb_FileDef_Options(f));
+ }
+
+ return proto;
+}
+
+google_protobuf_DescriptorProto* upb_MessageDef_ToProto(const upb_MessageDef* m,
+ upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return msgdef_toproto(&ctx, m);
+}
+
+google_protobuf_EnumDescriptorProto* upb_EnumDef_ToProto(const upb_EnumDef* e,
+ upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return enumdef_toproto(&ctx, e);
+}
+
+google_protobuf_EnumValueDescriptorProto* upb_EnumValueDef_ToProto(
+ const upb_EnumValueDef* e, upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return enumvaldef_toproto(&ctx, e);
+}
+
+google_protobuf_FieldDescriptorProto* upb_FieldDef_ToProto(
+ const upb_FieldDef* f, upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return fielddef_toproto(&ctx, f);
+}
+
+google_protobuf_OneofDescriptorProto* upb_OneofDef_ToProto(
+ const upb_OneofDef* o, upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return oneofdef_toproto(&ctx, o);
+}
+
+google_protobuf_FileDescriptorProto* upb_FileDef_ToProto(const upb_FileDef* f,
+ upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return filedef_toproto(&ctx, f);
+}
+
+google_protobuf_MethodDescriptorProto* upb_MethodDef_ToProto(
+ const upb_MethodDef* m, upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return methoddef_toproto(&ctx, m);
+}
+
+google_protobuf_ServiceDescriptorProto* upb_ServiceDef_ToProto(
+ const upb_ServiceDef* s, upb_Arena* a) {
+ upb_ToProto_Context ctx = {a};
+ if (UPB_SETJMP(ctx.err)) return NULL;
+ return servicedef_toproto(&ctx, s);
+}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto.h b/grpc/third_party/upb/upb/util/def_to_proto.h
new file mode 100644
index 00000000..24f65b9b
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_UTIL_DEF_TO_PROTO_H_
+#define UPB_UTIL_DEF_TO_PROTO_H_
+
+#include "upb/def.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Functions for converting defs back to the equivalent descriptor proto.
+// Ultimately the goal is that a round-trip proto->def->proto is lossless. Each
+// function returns a new proto created in arena `a`, or NULL if memory
+// allocation failed.
+google_protobuf_DescriptorProto* upb_MessageDef_ToProto(const upb_MessageDef* m,
+ upb_Arena* a);
+google_protobuf_EnumDescriptorProto* upb_EnumDef_ToProto(const upb_EnumDef* e,
+ upb_Arena* a);
+google_protobuf_EnumValueDescriptorProto* upb_EnumValueDef_ToProto(
+ const upb_EnumValueDef* e, upb_Arena* a);
+google_protobuf_FieldDescriptorProto* upb_FieldDef_ToProto(
+ const upb_FieldDef* f, upb_Arena* a);
+google_protobuf_OneofDescriptorProto* upb_OneofDef_ToProto(
+ const upb_OneofDef* o, upb_Arena* a);
+google_protobuf_FileDescriptorProto* upb_FileDef_ToProto(const upb_FileDef* f,
+ upb_Arena* a);
+google_protobuf_MethodDescriptorProto* upb_MethodDef_ToProto(
+ const upb_MethodDef* m, upb_Arena* a);
+google_protobuf_ServiceDescriptorProto* upb_ServiceDef_ToProto(
+ const upb_ServiceDef* s, upb_Arena* a);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* UPB_UTIL_DEF_TO_PROTO_H_ */
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_public_import_test.proto b/grpc/third_party/upb/upb/util/def_to_proto_public_import_test.proto
new file mode 100644
index 00000000..0c3eddba
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_public_import_test.proto
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto3";
+
+package pkg;
+
+message PublicImportMessage {}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_regular_import_test.proto b/grpc/third_party/upb/upb/util/def_to_proto_regular_import_test.proto
new file mode 100644
index 00000000..341f771e
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_regular_import_test.proto
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto3";
+
+package pkg;
+
+message RegularImportMessage {}
+
+enum Proto3Enum {
+ PROTO3_ENUM_ZERO = 0;
+}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_test.cc b/grpc/third_party/upb/upb/util/def_to_proto_test.cc
new file mode 100644
index 00000000..decc51f8
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_test.cc
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/def_to_proto.h"
+
+#include "gmock/gmock.h"
+#include "google/protobuf/descriptor.pb.h"
+#include "google/protobuf/descriptor.upbdefs.h"
+#include "google/protobuf/dynamic_message.h"
+#include "google/protobuf/util/message_differencer.h"
+#include "gtest/gtest.h"
+#include "upb/def.hpp"
+#include "upb/upb.hpp"
+#include "upb/util/def_to_proto_test.upbdefs.h"
+
+// Loads and retrieves a descriptor for `msgdef` into the given `pool`.
+const google::protobuf::Descriptor* AddMessageDescriptor(
+ upb::MessageDefPtr msgdef, google::protobuf::DescriptorPool* pool) {
+ upb::Arena tmp_arena;
+ upb::FileDefPtr file = msgdef.file();
+ google_protobuf_FileDescriptorProto* upb_proto =
+ upb_FileDef_ToProto(file.ptr(), tmp_arena.ptr());
+ size_t size;
+ const char* buf = google_protobuf_FileDescriptorProto_serialize(
+ upb_proto, tmp_arena.ptr(), &size);
+ google::protobuf::FileDescriptorProto google_proto;
+ google_proto.ParseFromArray(buf, size);
+ const google::protobuf::FileDescriptor* file_desc =
+ pool->BuildFile(google_proto);
+ EXPECT_TRUE(file_desc != nullptr);
+ return pool->FindMessageTypeByName(msgdef.full_name());
+}
+
+// Converts a upb `msg` (with type `msgdef`) into a protobuf Message object from
+// the given factory and descriptor.
+std::unique_ptr<google::protobuf::Message> ToProto(
+ const upb_Message* msg, const upb_MessageDef* msgdef,
+ const google::protobuf::Descriptor* desc,
+ google::protobuf::MessageFactory* factory) {
+ upb::Arena arena;
+ EXPECT_TRUE(desc != nullptr);
+ std::unique_ptr<google::protobuf::Message> google_msg(
+ factory->GetPrototype(desc)->New());
+ size_t size;
+ const char* buf =
+ upb_Encode(msg, upb_MessageDef_MiniTable(msgdef), 0, arena.ptr(), &size);
+ google_msg->ParseFromArray(buf, size);
+ return google_msg;
+}
+
+// A gtest matcher that verifies that a proto is equal to `proto`. Both `proto`
+// and `arg` must be messages of type `msgdef_func` (a .upbdefs.h function that
+// loads a known msgdef into the given symtab).
+MATCHER_P2(EqualsUpbProto, proto, msgdef_func,
+ negation ? "are not equal" : "are equal") {
+ upb::SymbolTable symtab;
+ google::protobuf::DescriptorPool pool;
+ google::protobuf::DynamicMessageFactory factory;
+ upb::MessageDefPtr msgdef(msgdef_func(symtab.ptr()));
+ EXPECT_TRUE(msgdef.ptr() != nullptr);
+ const google::protobuf::Descriptor* desc =
+ AddMessageDescriptor(msgdef, &pool);
+ EXPECT_TRUE(desc != nullptr);
+ std::unique_ptr<google::protobuf::Message> m1(
+ ToProto(proto, msgdef.ptr(), desc, &factory));
+ std::unique_ptr<google::protobuf::Message> m2(
+ ToProto(arg, msgdef.ptr(), desc, &factory));
+ std::string differences;
+ google::protobuf::util::MessageDifferencer differencer;
+ differencer.ReportDifferencesToString(&differences);
+ bool eq = differencer.Compare(*m2, *m1);
+ if (!eq) {
+ *result_listener << differences;
+ }
+ return eq;
+}
+
+// Verifies that the given upb FileDef can be converted to a proto that matches
+// `proto`.
+void CheckFile(const upb::FileDefPtr file,
+ const google_protobuf_FileDescriptorProto* proto) {
+ upb::Arena arena;
+ google_protobuf_FileDescriptorProto* proto2 =
+ upb_FileDef_ToProto(file.ptr(), arena.ptr());
+ ASSERT_THAT(
+ proto,
+ EqualsUpbProto(proto2, google_protobuf_FileDescriptorProto_getmsgdef));
+}
+
+// Verifies that upb/util/def_to_proto_test.proto can round-trip:
+// serialized descriptor -> upb def -> serialized descriptor
+TEST(DefToProto, Test) {
+ upb::Arena arena;
+ upb::SymbolTable symtab;
+ upb_StringView test_file_desc =
+ upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
+ const auto* file_desc = google_protobuf_FileDescriptorProto_parse(
+ test_file_desc.data, test_file_desc.size, arena.ptr());
+
+ upb::MessageDefPtr msgdef(pkg_Message_getmsgdef(symtab.ptr()));
+ upb::FileDefPtr file = msgdef.file();
+ CheckFile(file, file_desc);
+}
+
+// Like the previous test, but uses a message layout built at runtime.
+TEST(DefToProto, TestRuntimeReflection) {
+ upb::Arena arena;
+ upb::SymbolTable symtab;
+ upb_StringView test_file_desc =
+ upb_util_def_to_proto_test_proto_upbdefinit.descriptor;
+ const auto* file_desc = google_protobuf_FileDescriptorProto_parse(
+ test_file_desc.data, test_file_desc.size, arena.ptr());
+
+ _upb_DefPool_LoadDefInitEx(
+ symtab.ptr(), &upb_util_def_to_proto_test_proto_upbdefinit, true);
+ upb::FileDefPtr file = symtab.FindFileByName(
+ upb_util_def_to_proto_test_proto_upbdefinit.filename);
+ CheckFile(file, file_desc);
+}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_test.proto b/grpc/third_party/upb/upb/util/def_to_proto_test.proto
new file mode 100644
index 00000000..5d154106
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_test.proto
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto2";
+
+package pkg;
+
+import public "upb/util/def_to_proto_public_import_test.proto";
+
+import "upb/util/def_to_proto_regular_import_test.proto";
+
+option optimize_for = CODE_SIZE;
+option go_package = "foo_go_package";
+option java_package = "bar_java_package";
+option java_outer_classname = "baz_java_outer_classname";
+option csharp_namespace = "quux_csharp_namespace";
+option objc_class_prefix = "the_objc_prefix";
+option cc_enable_arenas = true;
+
+message Message {
+ optional int32 a = 1 [default = 3];
+ oneof foo {
+ string oneof_string = 2 [default = "abc\n"];
+ string oneof_bool = 3 [default = "true"];
+ bytes oneof_bytes = 4 [default = "abc\xef\xfe"];
+ }
+ optional pkg.RegularImportMessage regular_import_message = 6;
+ optional pkg.PublicImportMessage public_import_message = 7;
+ optional pkg.Proto3Enum proto3_enum = 8;
+ extensions 1000 to max;
+ extend Message {
+ optional int32 ext = 1000;
+ }
+
+ message NestedMessage {}
+ message NestedEnum {}
+
+ // TODO: support reserved ranges in defs.
+ // (At the moment they are ignored and will not round-trip through defs).
+ // reserved 4, 6 to 8;
+}
+
+enum Enum {
+ ZERO = 0;
+ ONE = 1;
+ NEGATIVE_ONE = -1;
+}
+
+enum EnumUpper32Value {
+ UPPER32_VALUE = 40;
+}
+
+enum HasDuplicateValues {
+ option allow_alias = true;
+
+ A = 0;
+ B = 1;
+ C = 120;
+ D = 130;
+
+ G = 120;
+ F = 1;
+ E = 0;
+ H = 121;
+ I = 121;
+ J = 121;
+ K = 121;
+}
+
+service Service {
+ rpc Bar(Message) returns (Message);
+}
+
+extend Message {
+ optional int32 ext = 1001;
+}
+
+enum Has31 {
+ VALUE_31 = 31;
+}
+
+message PretendMessageSet {
+ option message_set_wire_format = true;
+
+ // Since this is message_set_wire_format, "max" here means INT32_MAX.
+ // (For normal messages "max" would mean 2**29 - 1).
+ extensions 4 to max;
+}
+
+message MessageSetItem {
+ extend PretendMessageSet {
+ // Since max is exclusive, this is INT32_MAX-1, not INT32_MAX.
+ optional MessageSetItem message_set_extension = 2147483646;
+ }
+}
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_weak_import_test.proto b/grpc/third_party/upb/upb/util/def_to_proto_weak_import_test.proto
new file mode 100644
index 00000000..36cb66b2
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_weak_import_test.proto
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto3";
diff --git a/grpc/third_party/upb/upb/util/def_to_proto_wweak_import_test.proto b/grpc/third_party/upb/upb/util/def_to_proto_wweak_import_test.proto
new file mode 100644
index 00000000..36cb66b2
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/def_to_proto_wweak_import_test.proto
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto3";
diff --git a/grpc/third_party/upb/upb/util/required_fields.c b/grpc/third_party/upb/upb/util/required_fields.c
new file mode 100644
index 00000000..0e97949e
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/required_fields.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/required_fields.h"
+
+#include <inttypes.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "upb/reflection.h"
+
+// Must be last.
+#include "upb/port_def.inc"
+
+////////////////////////////////////////////////////////////////////////////////
+// upb_FieldPath_ToText()
+////////////////////////////////////////////////////////////////////////////////
+
+typedef struct {
+ char* buf;
+ char* ptr;
+ char* end;
+ size_t overflow;
+} upb_PrintfAppender;
+
+UPB_PRINTF(2, 3)
+static void upb_FieldPath_Printf(upb_PrintfAppender* a, const char* fmt, ...) {
+ size_t n;
+ size_t have = a->end - a->ptr;
+ va_list args;
+
+ va_start(args, fmt);
+ n = vsnprintf(a->ptr, have, fmt, args);
+ va_end(args);
+
+ if (UPB_LIKELY(have > n)) {
+ // We can't end up here if the user passed (NULL, 0), therefore ptr is known
+ // to be non-NULL, and UPB_PTRADD() is not necessary.
+ assert(a->ptr);
+ a->ptr += n;
+ } else {
+ a->ptr = UPB_PTRADD(a->ptr, have);
+ a->overflow += (n - have);
+ }
+}
+
+static size_t upb_FieldPath_NullTerminate(upb_PrintfAppender* d, size_t size) {
+ size_t ret = d->ptr - d->buf + d->overflow;
+
+ if (size > 0) {
+ if (d->ptr == d->end) d->ptr--;
+ *d->ptr = '\0';
+ }
+
+ return ret;
+}
+
+static void upb_FieldPath_PutMapKey(upb_PrintfAppender* a,
+ upb_MessageValue map_key,
+ const upb_FieldDef* key_f) {
+ switch (upb_FieldDef_CType(key_f)) {
+ case kUpb_CType_Int32:
+ upb_FieldPath_Printf(a, "[%" PRId32 "]", map_key.int32_val);
+ break;
+ case kUpb_CType_Int64:
+ upb_FieldPath_Printf(a, "[%" PRId64 "]", map_key.int64_val);
+ break;
+ case kUpb_CType_UInt32:
+ upb_FieldPath_Printf(a, "[%" PRIu32 "]", map_key.uint32_val);
+ break;
+ case kUpb_CType_UInt64:
+ upb_FieldPath_Printf(a, "[%" PRIu64 "]", map_key.uint64_val);
+ break;
+ case kUpb_CType_Bool:
+ upb_FieldPath_Printf(a, "[%s]", map_key.bool_val ? "true" : "false");
+ break;
+ case kUpb_CType_String:
+ upb_FieldPath_Printf(a, "[\"");
+ for (size_t i = 0; i < map_key.str_val.size; i++) {
+ char ch = map_key.str_val.data[i];
+ if (ch == '"') {
+ upb_FieldPath_Printf(a, "\\\"");
+ } else {
+ upb_FieldPath_Printf(a, "%c", ch);
+ }
+ }
+ upb_FieldPath_Printf(a, "\"]");
+ break;
+ default:
+ UPB_UNREACHABLE(); // Other types can't be map keys.
+ }
+}
+
+size_t upb_FieldPath_ToText(upb_FieldPathEntry** path, char* buf, size_t size) {
+ upb_FieldPathEntry* ptr = *path;
+ upb_PrintfAppender appender;
+ appender.buf = buf;
+ appender.ptr = buf;
+ appender.end = UPB_PTRADD(buf, size);
+ appender.overflow = 0;
+ bool first = true;
+
+ while (ptr->field) {
+ const upb_FieldDef* f = ptr->field;
+
+ upb_FieldPath_Printf(&appender, first ? "%s" : ".%s", upb_FieldDef_Name(f));
+ first = false;
+ ptr++;
+
+ if (upb_FieldDef_IsMap(f)) {
+ const upb_FieldDef* key_f =
+ upb_MessageDef_Field(upb_FieldDef_MessageSubDef(f), 0);
+ upb_FieldPath_PutMapKey(&appender, ptr->map_key, key_f);
+ ptr++;
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ upb_FieldPath_Printf(&appender, "[%zu]", ptr->array_index);
+ ptr++;
+ }
+ }
+
+ // Advance beyond terminating NULL.
+ ptr++;
+ *path = ptr;
+ return upb_FieldPath_NullTerminate(&appender, size);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// upb_util_HasUnsetRequired()
+////////////////////////////////////////////////////////////////////////////////
+
+typedef struct {
+ upb_FieldPathEntry* path;
+ size_t size;
+ size_t cap;
+} upb_FieldPathVector;
+
+typedef struct {
+ upb_FieldPathVector stack;
+ upb_FieldPathVector out_fields;
+ const upb_DefPool* ext_pool;
+ jmp_buf err;
+ bool has_unset_required;
+ bool save_paths;
+} upb_FindContext;
+
+static void upb_FieldPathVector_Init(upb_FieldPathVector* vec) {
+ vec->path = NULL;
+ vec->size = 0;
+ vec->cap = 0;
+}
+
+static void upb_FieldPathVector_Reserve(upb_FindContext* ctx,
+ upb_FieldPathVector* vec,
+ size_t elems) {
+ if (vec->cap - vec->size < elems) {
+ size_t need = vec->size + elems;
+ vec->cap = UPB_MAX(4, vec->cap);
+ while (vec->cap < need) vec->cap *= 2;
+ vec->path = realloc(vec->path, vec->cap * sizeof(*vec->path));
+ if (!vec->path) {
+ UPB_LONGJMP(ctx->err, 1);
+ }
+ }
+}
+
+static void upb_FindContext_Push(upb_FindContext* ctx, upb_FieldPathEntry ent) {
+ if (!ctx->save_paths) return;
+ upb_FieldPathVector_Reserve(ctx, &ctx->stack, 1);
+ ctx->stack.path[ctx->stack.size++] = ent;
+}
+
+static void upb_FindContext_Pop(upb_FindContext* ctx) {
+ if (!ctx->save_paths) return;
+ assert(ctx->stack.size != 0);
+ ctx->stack.size--;
+}
+
+static void upb_util_FindUnsetInMessage(upb_FindContext* ctx,
+ const upb_Message* msg,
+ const upb_MessageDef* m) {
+ // Iterate over all fields to see if any required fields are missing.
+ for (int i = 0, n = upb_MessageDef_FieldCount(m); i < n; i++) {
+ const upb_FieldDef* f = upb_MessageDef_Field(m, i);
+ if (upb_FieldDef_Label(f) != kUpb_Label_Required) continue;
+
+ if (!msg || !upb_Message_Has(msg, f)) {
+ // A required field is missing.
+ ctx->has_unset_required = true;
+
+ if (ctx->save_paths) {
+ // Append the contents of the stack to the out array, then
+ // NULL-terminate.
+ upb_FieldPathVector_Reserve(ctx, &ctx->out_fields, ctx->stack.size + 2);
+ if (ctx->stack.size) {
+ memcpy(&ctx->out_fields.path[ctx->out_fields.size], ctx->stack.path,
+ ctx->stack.size * sizeof(*ctx->stack.path));
+ }
+ ctx->out_fields.size += ctx->stack.size;
+ ctx->out_fields.path[ctx->out_fields.size++] =
+ (upb_FieldPathEntry){.field = f};
+ ctx->out_fields.path[ctx->out_fields.size++] =
+ (upb_FieldPathEntry){.field = NULL};
+ }
+ }
+ }
+}
+
+static void upb_util_FindUnsetRequiredInternal(upb_FindContext* ctx,
+ const upb_Message* msg,
+ const upb_MessageDef* m) {
+ // OPT: add markers in the schema for where we can avoid iterating:
+ // 1. messages with no required fields.
+ // 2. messages that cannot possibly reach any required fields.
+
+ upb_util_FindUnsetInMessage(ctx, msg, m);
+ if (!msg) return;
+
+ // Iterate over all present fields to find sub-messages that might be missing
+ // required fields. This may revisit some of the fields already inspected
+ // in the previous loop. We do this separately because this loop will also
+ // find present extensions, which the previous loop will not.
+ //
+ // TODO(haberman): consider changing upb_Message_Next() to be capable of
+ // visiting extensions only, for example with a kUpb_Message_BeginEXT
+ // constant.
+ size_t iter = kUpb_Message_Begin;
+ const upb_FieldDef* f;
+ upb_MessageValue val;
+ while (upb_Message_Next(msg, m, ctx->ext_pool, &f, &val, &iter)) {
+ // Skip non-submessage fields.
+ if (!upb_FieldDef_IsSubMessage(f)) continue;
+
+ upb_FindContext_Push(ctx, (upb_FieldPathEntry){.field = f});
+ const upb_MessageDef* sub_m = upb_FieldDef_MessageSubDef(f);
+
+ if (upb_FieldDef_IsMap(f)) {
+ // Map field.
+ const upb_FieldDef* val_f = upb_MessageDef_Field(sub_m, 1);
+ const upb_MessageDef* val_m = upb_FieldDef_MessageSubDef(val_f);
+ if (!val_m) continue;
+ const upb_Map* map = val.map_val;
+ size_t iter = kUpb_Map_Begin;
+ while (upb_MapIterator_Next(map, &iter)) {
+ upb_MessageValue key = upb_MapIterator_Key(map, iter);
+ upb_MessageValue map_val = upb_MapIterator_Value(map, iter);
+ upb_FindContext_Push(ctx, (upb_FieldPathEntry){.map_key = key});
+ upb_util_FindUnsetRequiredInternal(ctx, map_val.msg_val, val_m);
+ upb_FindContext_Pop(ctx);
+ }
+ } else if (upb_FieldDef_IsRepeated(f)) {
+ // Repeated field.
+ const upb_Array* arr = val.array_val;
+ for (size_t i = 0, n = upb_Array_Size(arr); i < n; i++) {
+ upb_MessageValue elem = upb_Array_Get(arr, i);
+ upb_FindContext_Push(ctx, (upb_FieldPathEntry){.array_index = i});
+ upb_util_FindUnsetRequiredInternal(ctx, elem.msg_val, sub_m);
+ upb_FindContext_Pop(ctx);
+ }
+ } else {
+ // Scalar sub-message field.
+ upb_util_FindUnsetRequiredInternal(ctx, val.msg_val, sub_m);
+ }
+
+ upb_FindContext_Pop(ctx);
+ }
+}
+
+bool upb_util_HasUnsetRequired(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool,
+ upb_FieldPathEntry** fields) {
+ upb_FindContext ctx;
+ ctx.has_unset_required = false;
+ ctx.save_paths = fields != NULL;
+ ctx.ext_pool = ext_pool;
+ upb_FieldPathVector_Init(&ctx.stack);
+ upb_FieldPathVector_Init(&ctx.out_fields);
+ upb_util_FindUnsetRequiredInternal(&ctx, msg, m);
+ free(ctx.stack.path);
+ if (fields) {
+ upb_FieldPathVector_Reserve(&ctx, &ctx.out_fields, 1);
+ ctx.out_fields.path[ctx.out_fields.size] =
+ (upb_FieldPathEntry){.field = NULL};
+ *fields = ctx.out_fields.path;
+ }
+ return ctx.has_unset_required;
+}
diff --git a/grpc/third_party/upb/upb/util/required_fields.h b/grpc/third_party/upb/upb/util/required_fields.h
new file mode 100644
index 00000000..874914bd
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/required_fields.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_UTIL_REQUIRED_FIELDS_H_
+#define UPB_UTIL_REQUIRED_FIELDS_H_
+
+#include "upb/def.h"
+#include "upb/reflection.h"
+
+/* Must be last. */
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// A FieldPath can be encoded as an array of upb_FieldPathEntry, in the
+// following format:
+// { {.field = f1}, {.field = f2} } # f1.f2
+// { {.field = f1}, {.index = 5}, {.field = f2} } # f1[5].f2
+// { {.field = f1}, {.key = "abc"}, {.field = f2} } # f1["abc"].f2
+//
+// Users must look at the type of `field` to know if an index or map key
+// follows.
+//
+// A field path may be NULL-terminated, in which case a NULL field indicates
+// the end of the field path.
+typedef union {
+ const upb_FieldDef* field;
+ size_t array_index;
+ upb_MessageValue map_key;
+} upb_FieldPathEntry;
+
+// Writes a string representing `*path` to `buf` in the following textual
+// format:
+// foo.bar # Regular fields
+// repeated_baz[2].bar # Repeated field
+// int32_msg_map[5].bar # Integer-keyed map
+// string_msg_map["abc"] # String-keyed map
+// bool_msg_map[true] # Bool-keyed map
+//
+// The input array `*path` must be NULL-terminated. The pointer `*path` will be
+// updated to point to one past the terminating NULL pointer of the input array.
+//
+// The output buffer `buf` will always be NULL-terminated. If the output data
+// (including NULL terminator) exceeds `size`, the result will be truncated.
+// Returns the string length of the data we attempted to write, excluding the
+// terminating NULL.
+size_t upb_FieldPath_ToText(upb_FieldPathEntry** path, char* buf, size_t size);
+
+// Checks whether `msg` or any of its children has unset required fields,
+// returning `true` if any are found. `msg` may be NULL, in which case the
+// message will be treated as empty.
+//
+// When this function returns true, `fields` is updated (if non-NULL) to point
+// to a heap-allocated array encoding the field paths of the required fields
+// that are missing. Each path is terminated with {.field = NULL}, and a final
+// {.field = NULL} terminates the list of paths. The caller is responsible for
+// freeing this array.
+bool upb_util_HasUnsetRequired(const upb_Message* msg, const upb_MessageDef* m,
+ const upb_DefPool* ext_pool,
+ upb_FieldPathEntry** fields);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_UTIL_REQUIRED_FIELDS_H_ */
diff --git a/grpc/third_party/upb/upb/util/required_fields_test.cc b/grpc/third_party/upb/upb/util/required_fields_test.cc
new file mode 100644
index 00000000..860363f4
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/required_fields_test.cc
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/util/required_fields.h"
+
+#include "absl/strings/string_view.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "upb/def.hpp"
+#include "upb/json_decode.h"
+#include "upb/upb.hpp"
+#include "upb/util/required_fields_test.upb.h"
+#include "upb/util/required_fields_test.upbdefs.h"
+
+std::vector<std::string> PathsToText(upb_FieldPathEntry* entry) {
+ std::vector<std::string> ret;
+ char buf[1024]; // Larger than anything we'll use in this test.
+ while (entry->field) {
+ upb_FieldPathEntry* before = entry;
+ size_t len = upb_FieldPath_ToText(&entry, buf, sizeof(buf));
+ EXPECT_LT(len, sizeof(buf));
+ assert(len <= sizeof(buf));
+ ret.push_back(buf);
+
+ // Ensure that we can have a short buffer and that it will be
+ // NULL-terminated.
+ char shortbuf[4];
+ size_t len2 = upb_FieldPath_ToText(&before, shortbuf, sizeof(shortbuf));
+ EXPECT_EQ(len, len2);
+ EXPECT_EQ(ret.back().substr(0, sizeof(shortbuf) - 1),
+ std::string(shortbuf));
+ }
+ return ret;
+}
+
+void CheckRequired(absl::string_view json,
+ const std::vector<std::string>& missing) {
+ upb::Arena arena;
+ upb::SymbolTable symtab;
+ upb_util_test_TestRequiredFields* test_msg =
+ upb_util_test_TestRequiredFields_new(arena.ptr());
+ upb::MessageDefPtr m(
+ upb_util_test_TestRequiredFields_getmsgdef(symtab.ptr()));
+ upb::Status status;
+ EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), test_msg, m.ptr(),
+ symtab.ptr(), 0, arena.ptr(), status.ptr()))
+ << status.error_message();
+ upb_FieldPathEntry* entries;
+ EXPECT_EQ(!missing.empty(), upb_util_HasUnsetRequired(
+ test_msg, m.ptr(), symtab.ptr(), &entries));
+ EXPECT_EQ(missing, PathsToText(entries));
+ free(entries);
+
+ // Verify that we can pass a NULL pointer to entries when we don't care about
+ // them.
+ EXPECT_EQ(!missing.empty(),
+ upb_util_HasUnsetRequired(test_msg, m.ptr(), symtab.ptr(), NULL));
+}
+
+// message HasRequiredField {
+// required int32 required_int32 = 1;
+// }
+//
+// message TestRequiredFields {
+// required EmptyMessage required_message = 1;
+// optional TestRequiredFields optional_message = 2;
+// repeated HasRequiredField repeated_message = 3;
+// map<int32, HasRequiredField> map_int32_message = 4;
+// }
+TEST(RequiredFieldsTest, TestRequired) {
+ CheckRequired(R"json({})json", {"required_message"});
+ CheckRequired(R"json({"required_message": {}}")json", {});
+ CheckRequired(
+ R"json(
+ {
+ "optional_message": {}
+ }
+ )json",
+ {"required_message", "optional_message.required_message"});
+
+ // Repeated field.
+ CheckRequired(
+ R"json(
+ {
+ "optional_message": {
+ "repeated_message": [
+ {"required_int32": 1},
+ {},
+ {"required_int32": 2}
+ ]
+ }
+ }
+ )json",
+ {"required_message", "optional_message.required_message",
+ "optional_message.repeated_message[1].required_int32"});
+
+ // Int32 map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_int32_message": {
+ "1": {"required_int32": 1},
+ "5": {},
+ "9": {"required_int32": 1}
+ }
+ }
+ )json",
+ {"map_int32_message[5].required_int32"});
+
+ // Int64 map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_int64_message": {
+ "1": {"required_int32": 1},
+ "5": {},
+ "9": {"required_int32": 1}
+ }
+ }
+ )json",
+ {"map_int64_message[5].required_int32"});
+
+ // Uint32 map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_uint32_message": {
+ "1": {"required_int32": 1},
+ "5": {},
+ "9": {"required_int32": 1}
+ }
+ }
+ )json",
+ {"map_uint32_message[5].required_int32"});
+
+ // Uint64 map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_uint64_message": {
+ "1": {"required_int32": 1},
+ "5": {},
+ "9": {"required_int32": 1}
+ }
+ }
+ )json",
+ {"map_uint64_message[5].required_int32"});
+
+ // Bool map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_bool_message": {
+ "false": {"required_int32": 1},
+ "true": {}
+ }
+ }
+ )json",
+ {"map_bool_message[true].required_int32"});
+
+ // String map key.
+ CheckRequired(
+ R"json(
+ {
+ "required_message": {},
+ "map_string_message": {
+ "abc": {"required_int32": 1},
+ "d\"ef": {}
+ }
+ }
+ )json",
+ {R"(map_string_message["d\"ef"].required_int32)"});
+}
diff --git a/grpc/third_party/upb/upb/util/required_fields_test.proto b/grpc/third_party/upb/upb/util/required_fields_test.proto
new file mode 100644
index 00000000..a1fc3f3d
--- /dev/null
+++ b/grpc/third_party/upb/upb/util/required_fields_test.proto
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+syntax = "proto2";
+
+package upb_util_test;
+
+message EmptyMessage {}
+
+message HasRequiredField {
+ required int32 required_int32 = 1;
+}
+
+message TestRequiredFields {
+ required EmptyMessage required_message = 1;
+ optional TestRequiredFields optional_message = 2;
+ repeated HasRequiredField repeated_message = 3;
+ map<int32, HasRequiredField> map_int32_message = 4;
+ map<int64, HasRequiredField> map_int64_message = 5;
+ map<uint32, HasRequiredField> map_uint32_message = 6;
+ map<uint64, HasRequiredField> map_uint64_message = 7;
+ map<bool, HasRequiredField> map_bool_message = 8;
+ map<string, HasRequiredField> map_string_message = 9;
+}
diff --git a/grpc/third_party/upb/upbc/BUILD b/grpc/third_party/upb/upbc/BUILD
index 3b7d69bd..0b98f290 100644
--- a/grpc/third_party/upb/upbc/BUILD
+++ b/grpc/third_party/upb/upbc/BUILD
@@ -1,3 +1,28 @@
+# Copyright (c) 2009-2021, Google LLC
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Google LLC nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_CPPOPTS",
@@ -7,28 +32,28 @@ licenses(["notice"])
cc_library(
name = "common",
- hdrs = ["common.h"],
srcs = ["common.cc"],
+ hdrs = ["common.h"],
copts = UPB_DEFAULT_CPPOPTS,
deps = [
- "@com_google_protobuf//:protobuf",
"@com_google_absl//absl/strings",
+ "@com_google_protobuf//:protobuf",
],
)
cc_binary(
name = "protoc-gen-upb",
- srcs = [
- "protoc-gen-upb.cc",
- "message_layout.cc",
- "message_layout.h",
- ],
+ srcs = ["protoc-gen-upb.cc"],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//visibility:public"],
deps = [
":common",
+ "//:mini_table",
+ "//:port",
+ "//:upb",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
+ "@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings",
"@com_google_protobuf//:protobuf",
"@com_google_protobuf//:protoc_lib",
diff --git a/grpc/third_party/upb/upbc/common.cc b/grpc/third_party/upb/upbc/common.cc
index c1b30a34..a4e162d8 100644
--- a/grpc/third_party/upb/upbc/common.cc
+++ b/grpc/third_party/upb/upbc/common.cc
@@ -1,24 +1,41 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "absl/strings/str_replace.h"
#include "upbc/common.h"
+#include "absl/strings/str_replace.h"
+
namespace upbc {
namespace {
namespace protobuf = ::google::protobuf;
-void AddMessages(const protobuf::Descriptor* message,
- std::vector<const protobuf::Descriptor*>* messages) {
- messages->push_back(message);
- for (int i = 0; i < message->nested_type_count(); i++) {
- AddMessages(message->nested_type(i), messages);
- }
-}
-
} // namespace
std::string StripExtension(absl::string_view fname) {
- size_t lastdot = fname.find_last_of(".");
+ size_t lastdot = fname.find_last_of('.');
if (lastdot == std::string::npos) {
return std::string(fname);
}
@@ -45,21 +62,16 @@ void EmitFileWarning(const protobuf::FileDescriptor* file, Output& output) {
file->name());
}
-std::vector<const protobuf::Descriptor*> SortedMessages(
- const protobuf::FileDescriptor* file) {
- std::vector<const protobuf::Descriptor*> messages;
- for (int i = 0; i < file->message_type_count(); i++) {
- AddMessages(file->message_type(i), &messages);
- }
- return messages;
-}
-
std::string MessageName(const protobuf::Descriptor* descriptor) {
return ToCIdent(descriptor->full_name());
}
-std::string MessageInit(const protobuf::Descriptor* descriptor) {
- return MessageName(descriptor) + "_msginit";
+std::string FileLayoutName(const google::protobuf::FileDescriptor* file) {
+ return ToCIdent(file->name()) + "_upb_file_layout";
+}
+
+std::string HeaderFilename(const google::protobuf::FileDescriptor* file) {
+ return StripExtension(file->name()) + ".upb.h";
}
} // namespace upbc
diff --git a/grpc/third_party/upb/upbc/common.h b/grpc/third_party/upb/upbc/common.h
index 5825786f..08de2343 100644
--- a/grpc/third_party/upb/upbc/common.h
+++ b/grpc/third_party/upb/upbc/common.h
@@ -1,9 +1,36 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPBC_COMMON_H
#define UPBC_COMMON_H
#include <vector>
+#include "absl/strings/str_replace.h"
#include "absl/strings/substitute.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/io/zero_copy_stream.h"
@@ -23,6 +50,26 @@ class Output {
private:
void Write(absl::string_view data) {
+ std::string stripped;
+ if (absl::StartsWith(data, "\n ")) {
+ size_t indent = data.substr(1).find_first_not_of(' ');
+ if (indent != absl::string_view::npos) {
+ // Remove indentation from all lines.
+ auto line_prefix = data.substr(0, indent + 1);
+ // The final line has an extra newline and is indented two less, eg.
+ // R"cc(
+ // UPB_INLINE $0 $1_$2(const $1 *msg) {
+ // return $1_has_$2(msg) ? *UPB_PTR_AT(msg, $3, $0) : $4;
+ // }
+ // )cc",
+ std::string last_line_prefix = std::string(line_prefix);
+ last_line_prefix.resize(last_line_prefix.size() - 2);
+ data.remove_prefix(line_prefix.size());
+ stripped = absl::StrReplaceAll(
+ data, {{line_prefix, "\n"}, {last_line_prefix, "\n"}});
+ data = stripped;
+ }
+ }
while (!data.empty()) {
RefreshOutput();
size_t to_write = std::min(data.size(), size_);
@@ -35,7 +82,7 @@ class Output {
void RefreshOutput() {
while (size_ == 0) {
- void *ptr;
+ void* ptr;
int size;
if (!stream_->Next(&ptr, &size)) {
fprintf(stderr, "upbc: Failed to write to to output\n");
@@ -47,7 +94,7 @@ class Output {
}
google::protobuf::io::ZeroCopyOutputStream* stream_;
- char *ptr_ = nullptr;
+ char* ptr_ = nullptr;
size_t size_ = 0;
};
@@ -56,11 +103,10 @@ std::string ToCIdent(absl::string_view str);
std::string ToPreproc(absl::string_view str);
void EmitFileWarning(const google::protobuf::FileDescriptor* file,
Output& output);
-std::vector<const google::protobuf::Descriptor*> SortedMessages(
- const google::protobuf::FileDescriptor* file);
-std::string MessageInit(const google::protobuf::Descriptor* descriptor);
std::string MessageName(const google::protobuf::Descriptor* descriptor);
+std::string FileLayoutName(const google::protobuf::FileDescriptor* file);
+std::string HeaderFilename(const google::protobuf::FileDescriptor* file);
} // namespace upbc
-# endif // UPBC_COMMON_H
+#endif // UPBC_COMMON_H
diff --git a/grpc/third_party/upb/upbc/message_layout.cc b/grpc/third_party/upb/upbc/message_layout.cc
deleted file mode 100644
index 3d35448b..00000000
--- a/grpc/third_party/upb/upbc/message_layout.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-
-#include "upbc/message_layout.h"
-#include "google/protobuf/descriptor.pb.h"
-
-namespace upbc {
-
-namespace protobuf = ::google::protobuf;
-
-static int64_t DivRoundUp(int64_t a, int64_t b) {
- ABSL_ASSERT(a >= 0);
- ABSL_ASSERT(b > 0);
- return (a + b - 1) / b;
-}
-
-MessageLayout::Size MessageLayout::Place(
- MessageLayout::SizeAndAlign size_and_align) {
- Size offset = size_;
- offset.AlignUp(size_and_align.align);
- size_ = offset;
- size_.Add(size_and_align.size);
- //maxalign_.MaxFrom(size_and_align.align);
- maxalign_.MaxFrom(size_and_align.size);
- return offset;
-}
-
-bool MessageLayout::HasHasbit(const protobuf::FieldDescriptor* field) {
- return field->has_presence() && !field->real_containing_oneof() &&
- !field->containing_type()->options().map_entry();
-}
-
-MessageLayout::SizeAndAlign MessageLayout::SizeOf(
- const protobuf::FieldDescriptor* field) {
- if (field->is_repeated()) {
- return {{4, 8}, {4, 8}}; // Pointer to array object.
- } else {
- return SizeOfUnwrapped(field);
- }
-}
-
-MessageLayout::SizeAndAlign MessageLayout::SizeOfUnwrapped(
- const protobuf::FieldDescriptor* field) {
- switch (field->cpp_type()) {
- case protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
- return {{4, 8}, {4, 8}}; // Pointer to message.
- case protobuf::FieldDescriptor::CPPTYPE_STRING:
- return {{8, 16}, {4, 8}}; // upb_strview
- case protobuf::FieldDescriptor::CPPTYPE_BOOL:
- return {{1, 1}, {1, 1}};
- case protobuf::FieldDescriptor::CPPTYPE_FLOAT:
- case protobuf::FieldDescriptor::CPPTYPE_INT32:
- case protobuf::FieldDescriptor::CPPTYPE_UINT32:
- case protobuf::FieldDescriptor::CPPTYPE_ENUM:
- return {{4, 4}, {4, 4}};
- case protobuf::FieldDescriptor::CPPTYPE_INT64:
- case protobuf::FieldDescriptor::CPPTYPE_UINT64:
- case protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
- return {{8, 8}, {8, 8}};
- }
- assert(false);
- return {{-1, -1}, {-1, -1}};
-}
-
-int64_t MessageLayout::FieldLayoutRank(const protobuf::FieldDescriptor* field) {
- // Order:
- // 1, 2, 3. primitive fields (8, 4, 1 byte)
- // 4. string fields
- // 5. submessage fields
- // 6. repeated fields
- //
- // This has the following nice properties:
- //
- // 1. padding alignment is (nearly) minimized.
- // 2. fields that might have defaults (1-4) are segregated
- // from fields that are always zero-initialized (5-7).
- //
- // We skip oneof fields, because they are emitted in a separate pass.
- int64_t rank;
- if (field->containing_oneof()) {
- fprintf(stderr, "shouldn't have oneofs here.\n");
- abort();
- } else if (field->label() == protobuf::FieldDescriptor::LABEL_REPEATED) {
- rank = 6;
- } else {
- switch (field->cpp_type()) {
- case protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
- rank = 5;
- break;
- case protobuf::FieldDescriptor::CPPTYPE_STRING:
- rank = 4;
- break;
- case protobuf::FieldDescriptor::CPPTYPE_BOOL:
- rank = 3;
- break;
- case protobuf::FieldDescriptor::CPPTYPE_FLOAT:
- case protobuf::FieldDescriptor::CPPTYPE_INT32:
- case protobuf::FieldDescriptor::CPPTYPE_UINT32:
- rank = 2;
- break;
- default:
- rank = 1;
- break;
- }
- }
-
- // Break ties with field number.
- return (rank << 29) | field->number();
-}
-
-void MessageLayout::ComputeLayout(const protobuf::Descriptor* descriptor) {
- size_ = Size{0, 0};
- maxalign_ = Size{8, 8};
-
- if (descriptor->options().map_entry()) {
- // Map entries aren't actually stored, they are only used during parsing.
- // For parsing, it helps a lot if all map entry messages have the same
- // layout.
- SizeAndAlign size{{8, 16}, {4, 8}}; // upb_strview
- field_offsets_[descriptor->FindFieldByNumber(1)] = Place(size);
- field_offsets_[descriptor->FindFieldByNumber(2)] = Place(size);
- } else {
- PlaceNonOneofFields(descriptor);
- PlaceOneofFields(descriptor);
- }
-
- // Align overall size up to max size.
- size_.AlignUp(maxalign_);
-}
-
-void MessageLayout::PlaceNonOneofFields(
- const protobuf::Descriptor* descriptor) {
- std::vector<const protobuf::FieldDescriptor*> field_order;
- for (int i = 0; i < descriptor->field_count(); i++) {
- const protobuf::FieldDescriptor* field = descriptor->field(i);
- if (!field->containing_oneof()) {
- field_order.push_back(descriptor->field(i));
- }
- }
- std::sort(field_order.begin(), field_order.end(),
- [](const protobuf::FieldDescriptor* a,
- const protobuf::FieldDescriptor* b) {
- return FieldLayoutRank(a) < FieldLayoutRank(b);
- });
-
- // Place/count hasbits.
- int hasbit_count = 0;
- for (auto field : FieldHotnessOrder(descriptor)) {
- if (HasHasbit(field)) {
- // We don't use hasbit 0, so that 0 can indicate "no presence" in the
- // table. This wastes one hasbit, but we don't worry about it for now.
- hasbit_indexes_[field] = ++hasbit_count;
- }
- }
-
- // Place hasbits at the beginning.
- int64_t hasbit_bytes = DivRoundUp(hasbit_count, 8);
- Place(SizeAndAlign{{hasbit_bytes, hasbit_bytes}, {1, 1}});
-
- // Place non-oneof fields.
- for (auto field : field_order) {
- field_offsets_[field] = Place(SizeOf(field));
- }
-}
-
-void MessageLayout::PlaceOneofFields(const protobuf::Descriptor* descriptor) {
- std::vector<const protobuf::OneofDescriptor*> oneof_order;
- for (int i = 0; i < descriptor->oneof_decl_count(); i++) {
- oneof_order.push_back(descriptor->oneof_decl(i));
- }
- std::sort(oneof_order.begin(), oneof_order.end(),
- [](const protobuf::OneofDescriptor* a,
- const protobuf::OneofDescriptor* b) {
- return a->full_name() < b->full_name();
- });
-
- for (auto oneof : oneof_order) {
- SizeAndAlign oneof_maxsize{{0, 0}, {0, 0}};
- // Calculate max size.
- for (int i = 0; i < oneof->field_count(); i++) {
- oneof_maxsize.MaxFrom(SizeOf(oneof->field(i)));
- }
-
- // Place discriminator enum and data.
- Size data = Place(oneof_maxsize);
- Size discriminator = Place(SizeAndAlign{{4, 4}, {4, 4}});
-
- oneof_case_offsets_[oneof] = discriminator;
-
- for (int i = 0; i < oneof->field_count(); i++) {
- field_offsets_[oneof->field(i)] = data;
- }
- }
-}
-
-} // namespace upbc
diff --git a/grpc/third_party/upb/upbc/message_layout.h b/grpc/third_party/upb/upbc/message_layout.h
deleted file mode 100644
index f257a963..00000000
--- a/grpc/third_party/upb/upbc/message_layout.h
+++ /dev/null
@@ -1,124 +0,0 @@
-
-#ifndef UPBC_MESSAGE_LAYOUT_H
-#define UPBC_MESSAGE_LAYOUT_H
-
-#include "absl/base/macros.h"
-#include "absl/container/flat_hash_map.h"
-#include "google/protobuf/descriptor.h"
-
-namespace upbc {
-
-class MessageLayout {
- public:
- struct Size {
- void Add(const Size& other) {
- size32 += other.size32;
- size64 += other.size64;
- }
-
- void MaxFrom(const Size& other) {
- size32 = std::max(size32, other.size32);
- size64 = std::max(size64, other.size64);
- }
-
- void AlignUp(const Size& align) {
- size32 = Align(size32, align.size32);
- size64 = Align(size64, align.size64);
- }
-
- int64_t size32;
- int64_t size64;
- };
-
- struct SizeAndAlign {
- Size size;
- Size align;
-
- void MaxFrom(const SizeAndAlign& other) {
- size.MaxFrom(other.size);
- align.MaxFrom(other.align);
- }
- };
-
- MessageLayout(const google::protobuf::Descriptor* descriptor) {
- ComputeLayout(descriptor);
- }
-
- Size GetFieldOffset(const google::protobuf::FieldDescriptor* field) const {
- return GetMapValue(field_offsets_, field);
- }
-
- Size GetOneofCaseOffset(
- const google::protobuf::OneofDescriptor* oneof) const {
- return GetMapValue(oneof_case_offsets_, oneof);
- }
-
- int GetHasbitIndex(const google::protobuf::FieldDescriptor* field) const {
- return GetMapValue(hasbit_indexes_, field);
- }
-
- Size message_size() const { return size_; }
-
- static bool HasHasbit(const google::protobuf::FieldDescriptor* field);
- static SizeAndAlign SizeOfUnwrapped(
- const google::protobuf::FieldDescriptor* field);
-
- private:
- void ComputeLayout(const google::protobuf::Descriptor* descriptor);
- void PlaceNonOneofFields(const google::protobuf::Descriptor* descriptor);
- void PlaceOneofFields(const google::protobuf::Descriptor* descriptor);
- Size Place(SizeAndAlign size_and_align);
-
- template <class K, class V>
- static V GetMapValue(const absl::flat_hash_map<K, V>& map, K key) {
- auto iter = map.find(key);
- if (iter == map.end()) {
- fprintf(stderr, "No value for field.\n");
- abort();
- }
- return iter->second;
- }
-
- static bool IsPowerOfTwo(size_t val) {
- return (val & (val - 1)) == 0;
- }
-
- static size_t Align(size_t val, size_t align) {
- ABSL_ASSERT(IsPowerOfTwo(align));
- return (val + align - 1) & ~(align - 1);
- }
-
- static SizeAndAlign SizeOf(const google::protobuf::FieldDescriptor* field);
- static int64_t FieldLayoutRank(
- const google::protobuf::FieldDescriptor* field);
-
- absl::flat_hash_map<const google::protobuf::FieldDescriptor*, Size>
- field_offsets_;
- absl::flat_hash_map<const google::protobuf::FieldDescriptor*, int>
- hasbit_indexes_;
- absl::flat_hash_map<const google::protobuf::OneofDescriptor*, Size>
- oneof_case_offsets_;
- Size maxalign_;
- Size size_;
-};
-
-// Returns fields in order of "hotness", eg. how frequently they appear in
-// serialized payloads. Ideally this will use a profile. When we don't have
-// that, we assume that fields with smaller numbers are used more frequently.
-inline std::vector<const google::protobuf::FieldDescriptor*> FieldHotnessOrder(
- const google::protobuf::Descriptor* message) {
- std::vector<const google::protobuf::FieldDescriptor*> fields;
- for (int i = 0; i < message->field_count(); i++) {
- fields.push_back(message->field(i));
- }
- std::sort(fields.begin(), fields.end(),
- [](const google::protobuf::FieldDescriptor* a,
- const google::protobuf::FieldDescriptor* b) {
- return a->number() < b->number();
- });
- return fields;
-}
-
-} // namespace upbc
-
-#endif // UPBC_MESSAGE_LAYOUT_H
diff --git a/grpc/third_party/upb/upbc/protoc-gen-upb.cc b/grpc/third_party/upb/upbc/protoc-gen-upb.cc
index e099ad46..bd6196c7 100644
--- a/grpc/third_party/upb/upbc/protoc-gen-upb.cc
+++ b/grpc/third_party/upb/upbc/protoc-gen-upb.cc
@@ -1,7 +1,32 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory>
#include "absl/container/flat_hash_map.h"
+#include "absl/container/flat_hash_set.h"
#include "absl/strings/ascii.h"
#include "absl/strings/substitute.h"
#include "google/protobuf/compiler/code_generator.h"
@@ -9,8 +34,12 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/wire_format.h"
+#include "upb/mini_table.hpp"
+#include "upb/upb.hpp"
#include "upbc/common.h"
-#include "upbc/message_layout.h"
+
+// Must be last.
+#include "upb/port_def.inc"
namespace upbc {
namespace {
@@ -18,16 +47,57 @@ namespace {
namespace protoc = ::google::protobuf::compiler;
namespace protobuf = ::google::protobuf;
-std::string HeaderFilename(std::string proto_filename) {
- return StripExtension(proto_filename) + ".upb.h";
+// Returns fields in order of "hotness", eg. how frequently they appear in
+// serialized payloads. Ideally this will use a profile. When we don't have
+// that, we assume that fields with smaller numbers are used more frequently.
+inline std::vector<const google::protobuf::FieldDescriptor*> FieldHotnessOrder(
+ const google::protobuf::Descriptor* message) {
+ std::vector<const google::protobuf::FieldDescriptor*> fields;
+ for (int i = 0; i < message->field_count(); i++) {
+ fields.push_back(message->field(i));
+ }
+ std::sort(fields.begin(), fields.end(),
+ [](const google::protobuf::FieldDescriptor* a,
+ const google::protobuf::FieldDescriptor* b) {
+ return std::make_pair(!a->is_required(), a->number()) <
+ std::make_pair(!b->is_required(), b->number());
+ });
+ return fields;
+}
+
+std::string SourceFilename(const google::protobuf::FileDescriptor* file) {
+ return StripExtension(file->name()) + ".upb.c";
+}
+
+std::string MessageInit(const protobuf::Descriptor* descriptor) {
+ return MessageName(descriptor) + "_msginit";
+}
+
+std::string EnumInit(const protobuf::EnumDescriptor* descriptor) {
+ return ToCIdent(descriptor->full_name()) + "_enuminit";
}
-std::string SourceFilename(std::string proto_filename) {
- return StripExtension(proto_filename) + ".upb.c";
+std::string ExtensionIdentBase(const protobuf::FieldDescriptor* ext) {
+ assert(ext->is_extension());
+ std::string ext_scope;
+ if (ext->extension_scope()) {
+ return MessageName(ext->extension_scope());
+ } else {
+ return ToCIdent(ext->file()->package());
+ }
}
+std::string ExtensionLayout(const google::protobuf::FieldDescriptor* ext) {
+ return absl::StrCat(ExtensionIdentBase(ext), "_", ext->name(), "_ext");
+}
+
+const char* kEnumsInit = "enums_layout";
+const char* kExtensionsInit = "extensions_layout";
+const char* kMessagesInit = "messages_layout";
+
void AddEnums(const protobuf::Descriptor* message,
std::vector<const protobuf::EnumDescriptor*>* enums) {
+ enums->reserve(enums->size() + message->enum_type_count());
for (int i = 0; i < message->enum_type_count(); i++) {
enums->push_back(message->enum_type(i));
}
@@ -36,25 +106,82 @@ void AddEnums(const protobuf::Descriptor* message,
}
}
-template <class T>
-void SortDefs(std::vector<T>* defs) {
- std::sort(defs->begin(), defs->end(),
- [](T a, T b) { return a->full_name() < b->full_name(); });
-}
-
std::vector<const protobuf::EnumDescriptor*> SortedEnums(
const protobuf::FileDescriptor* file) {
std::vector<const protobuf::EnumDescriptor*> enums;
+ enums.reserve(file->enum_type_count());
for (int i = 0; i < file->enum_type_count(); i++) {
enums.push_back(file->enum_type(i));
}
for (int i = 0; i < file->message_type_count(); i++) {
AddEnums(file->message_type(i), &enums);
}
- SortDefs(&enums);
return enums;
}
+std::vector<int32_t> SortedUniqueEnumNumbers(
+ const protobuf::EnumDescriptor* e) {
+ std::vector<int32_t> values;
+ values.reserve(e->value_count());
+ for (int i = 0; i < e->value_count(); i++) {
+ values.push_back(e->value(i)->number());
+ }
+ std::sort(values.begin(), values.end());
+ auto last = std::unique(values.begin(), values.end());
+ values.erase(last, values.end());
+ return values;
+}
+
+void AddMessages(const protobuf::Descriptor* message,
+ std::vector<const protobuf::Descriptor*>* messages) {
+ messages->push_back(message);
+ for (int i = 0; i < message->nested_type_count(); i++) {
+ AddMessages(message->nested_type(i), messages);
+ }
+}
+
+// Ordering must match upb/def.c!
+//
+// The ordering is significant because each upb_MessageDef* will point at the
+// corresponding upb_MiniTable and we just iterate through the list without
+// any search or lookup.
+std::vector<const protobuf::Descriptor*> SortedMessages(
+ const protobuf::FileDescriptor* file) {
+ std::vector<const protobuf::Descriptor*> messages;
+ for (int i = 0; i < file->message_type_count(); i++) {
+ AddMessages(file->message_type(i), &messages);
+ }
+ return messages;
+}
+
+void AddExtensionsFromMessage(
+ const protobuf::Descriptor* message,
+ std::vector<const protobuf::FieldDescriptor*>* exts) {
+ for (int i = 0; i < message->extension_count(); i++) {
+ exts->push_back(message->extension(i));
+ }
+ for (int i = 0; i < message->nested_type_count(); i++) {
+ AddExtensionsFromMessage(message->nested_type(i), exts);
+ }
+}
+
+// Ordering must match upb/def.c!
+//
+// The ordering is significant because each upb_FieldDef* will point at the
+// corresponding upb_MiniTable_Extension and we just iterate through the list
+// without any search or lookup.
+std::vector<const protobuf::FieldDescriptor*> SortedExtensions(
+ const protobuf::FileDescriptor* file) {
+ std::vector<const protobuf::FieldDescriptor*> ret;
+ for (int i = 0; i < file->extension_count(); i++) {
+ ret.push_back(file->extension(i));
+ }
+ for (int i = 0; i < file->message_type_count(); i++) {
+ AddExtensionsFromMessage(file->message_type(i), &ret);
+ }
+ return ret;
+}
+
std::vector<const protobuf::FieldDescriptor*> FieldNumberOrder(
const protobuf::Descriptor* message) {
std::vector<const protobuf::FieldDescriptor*> fields;
@@ -69,32 +196,10 @@ std::vector<const protobuf::FieldDescriptor*> FieldNumberOrder(
return fields;
}
-std::vector<const protobuf::FieldDescriptor*> SortedSubmessages(
- const protobuf::Descriptor* message) {
- std::vector<const protobuf::FieldDescriptor*> ret;
- for (int i = 0; i < message->field_count(); i++) {
- if (message->field(i)->cpp_type() ==
- protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
- ret.push_back(message->field(i));
- }
- }
- std::sort(ret.begin(), ret.end(),
- [](const protobuf::FieldDescriptor* a,
- const protobuf::FieldDescriptor* b) {
- return a->message_type()->full_name() <
- b->message_type()->full_name();
- });
- return ret;
-}
-
std::string EnumValueSymbol(const protobuf::EnumValueDescriptor* value) {
return ToCIdent(value->full_name());
}
-std::string GetSizeInit(const MessageLayout::Size& size) {
- return absl::Substitute("UPB_SIZE($0, $1)", size.size32, size.size64);
-}
-
std::string CTypeInternal(const protobuf::FieldDescriptor* field,
bool is_const) {
std::string maybe_const = is_const ? "const " : "";
@@ -121,7 +226,7 @@ std::string CTypeInternal(const protobuf::FieldDescriptor* field,
case protobuf::FieldDescriptor::CPPTYPE_UINT64:
return "uint64_t";
case protobuf::FieldDescriptor::CPPTYPE_STRING:
- return "upb_strview";
+ return "upb_StringView";
default:
fprintf(stderr, "Unexpected type");
abort();
@@ -156,21 +261,54 @@ std::string SizeLg2(const protobuf::FieldDescriptor* field) {
}
}
+bool HasNonZeroDefault(const protobuf::FieldDescriptor* field) {
+ switch (field->cpp_type()) {
+ case protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
+ return false;
+ case protobuf::FieldDescriptor::CPPTYPE_STRING:
+ return !field->default_value_string().empty();
+ case protobuf::FieldDescriptor::CPPTYPE_INT32:
+ return field->default_value_int32() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_INT64:
+ return field->default_value_int64() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_UINT32:
+ return field->default_value_uint32() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_UINT64:
+ return field->default_value_uint64() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_FLOAT:
+ return field->default_value_float() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
+ return field->default_value_double() != 0;
+ case protobuf::FieldDescriptor::CPPTYPE_BOOL:
+ return field->default_value_bool() != false;
+ case protobuf::FieldDescriptor::CPPTYPE_ENUM:
+ // Use a number instead of a symbolic name so that we don't require
+ // this enum's header to be included.
+ return field->default_value_enum()->number() != 0;
+ }
+ ABSL_ASSERT(false);
+ return false;
+}
+
std::string FieldDefault(const protobuf::FieldDescriptor* field) {
switch (field->cpp_type()) {
case protobuf::FieldDescriptor::CPPTYPE_MESSAGE:
return "NULL";
case protobuf::FieldDescriptor::CPPTYPE_STRING:
- return absl::Substitute("upb_strview_make(\"$0\", strlen(\"$0\"))",
+ return absl::Substitute("upb_StringView_FromString(\"$0\")",
absl::CEscape(field->default_value_string()));
case protobuf::FieldDescriptor::CPPTYPE_INT32:
- return absl::StrCat(field->default_value_int32());
+ return absl::Substitute("_upb_Int32_FromI($0)",
+ field->default_value_int32());
case protobuf::FieldDescriptor::CPPTYPE_INT64:
- return absl::StrCat(field->default_value_int64());
+ return absl::Substitute("_upb_Int64_FromLL($0ll)",
+ field->default_value_int64());
case protobuf::FieldDescriptor::CPPTYPE_UINT32:
- return absl::StrCat(field->default_value_uint32());
+ return absl::Substitute("_upb_UInt32_FromU($0u)",
+ field->default_value_uint32());
case protobuf::FieldDescriptor::CPPTYPE_UINT64:
- return absl::StrCat(field->default_value_uint64());
+ return absl::Substitute("_upb_UInt64_FromULL($0ull)",
+ field->default_value_uint64());
case protobuf::FieldDescriptor::CPPTYPE_FLOAT:
return absl::StrCat(field->default_value_float());
case protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
@@ -194,6 +332,350 @@ std::string CTypeConst(const protobuf::FieldDescriptor* field) {
return CTypeInternal(field, true);
}
+////////////////////////////////////////////////////////////////////////////////
+// FilePlatformLayout
+////////////////////////////////////////////////////////////////////////////////
+
+// FilePlatformLayout builds and vends upb MiniTables for a given platform (32
+// or 64 bit).
+class FilePlatformLayout {
+ public:
+ FilePlatformLayout(const protobuf::FileDescriptor* fd,
+ upb_MiniTablePlatform platform)
+ : platform_(platform) {
+ BuildMiniTables(fd);
+ BuildExtensions(fd);
+ }
+
+ // Retrieves a upb MiniTable or Extension given a protobuf descriptor. The
+ // descriptor must be from this layout's file.
+ upb_MiniTable* GetMiniTable(const protobuf::Descriptor* m) const;
+ const upb_MiniTable_Extension* GetExtension(
+ const protobuf::FieldDescriptor* fd) const;
+
+ // Get the initializer for the given sub-message/sub-enum link.
+ static std::string GetSub(upb_MiniTable_Sub sub);
+
+ private:
+ // Functions to build mini-tables for this file's messages and extensions.
+ void BuildMiniTables(const protobuf::FileDescriptor* fd);
+ void BuildExtensions(const protobuf::FileDescriptor* fd);
+ upb_MiniTable* MakeMiniTable(const protobuf::Descriptor* m);
+ upb_MiniTable* MakeRegularMiniTable(const protobuf::Descriptor* m);
+ uint64_t GetMessageModifiers(const protobuf::Descriptor* m);
+ uint64_t GetFieldModifiers(const protobuf::FieldDescriptor* f);
+ void ResolveIntraFileReferences();
+
+ // When we are generating code, tables are linked to sub-tables via name (ie.
+ // a string) rather than by pointer. We need to emit an initializer like
+ // `&foo_sub_table`. To do this, we store `const char*` strings in all the
+ // links that would normally be pointers:
+ // field -> sub-message
+ // field -> enum table (proto2 only)
+ // extension -> extendee
+ //
+ // This requires a bit of reinterpret_cast<>(), but it's confined to a few
+ // functions. We tag the pointer so we know which member of the union to
+ // initialize.
+ enum SubTag {
+ kNull = 0,
+ kMessage = 1,
+ kEnum = 2,
+ kMask = 3,
+ };
+
+ static upb_MiniTable_Sub PackSub(const char* data, SubTag tag);
+ static bool IsNull(upb_MiniTable_Sub sub);
+ void SetSubTableStrings();
+ upb_MiniTable_Sub PackSubForField(const protobuf::FieldDescriptor* f,
+ const upb_MiniTable_Field* mt_f);
+ const char* AllocStr(absl::string_view str);
+
+ private:
+ using TableMap =
+ absl::flat_hash_map<const protobuf::Descriptor*, upb_MiniTable*>;
+ using ExtensionMap = absl::flat_hash_map<const protobuf::FieldDescriptor*,
+ upb_MiniTable_Extension>;
+ upb::Arena arena_;
+ TableMap table_map_;
+ ExtensionMap extension_map_;
+ upb_MiniTablePlatform platform_;
+};
+
+upb_MiniTable* FilePlatformLayout::GetMiniTable(
+ const protobuf::Descriptor* m) const {
+ auto it = table_map_.find(m);
+ assert(it != table_map_.end());
+ return it->second;
+}
+
+const upb_MiniTable_Extension* FilePlatformLayout::GetExtension(
+ const protobuf::FieldDescriptor* fd) const {
+ auto it = extension_map_.find(fd);
+ assert(it != extension_map_.end());
+ return &it->second;
+}
+
+void FilePlatformLayout::ResolveIntraFileReferences() {
+ // This properly resolves references within a file, in order to set any
+ // necessary flags (eg. is a map).
+ for (const auto& pair : table_map_) {
+ upb_MiniTable* mt = pair.second;
+ // First we properly resolve for defs within the file.
+ for (const auto* f : FieldNumberOrder(pair.first)) {
+ if (f->message_type() && f->message_type()->file() == f->file()) {
+ // const_cast is safe because the mini-table is owned exclusively
+ // by us, and was allocated from an arena (known-writable memory).
+ upb_MiniTable_Field* mt_f = const_cast<upb_MiniTable_Field*>(
+ upb_MiniTable_FindFieldByNumber(mt, f->number()));
+ upb_MiniTable* sub_mt = GetMiniTable(f->message_type());
+ upb_MiniTable_SetSubMessage(mt, mt_f, sub_mt);
+ }
+ // We don't worry about enums here, because resolving an enum will
+ // never alter the mini-table.
+ }
+ }
+}
+
+upb_MiniTable_Sub FilePlatformLayout::PackSub(const char* data, SubTag tag) {
+ uintptr_t val = reinterpret_cast<uintptr_t>(data);
+ assert((val & kMask) == 0);
+ upb_MiniTable_Sub sub;
+ sub.submsg = reinterpret_cast<upb_MiniTable*>(val | tag);
+ return sub;
+}
+
+bool FilePlatformLayout::IsNull(upb_MiniTable_Sub sub) {
+ return reinterpret_cast<uintptr_t>(sub.subenum) == 0;
+}
+
+std::string FilePlatformLayout::GetSub(upb_MiniTable_Sub sub) {
+ uintptr_t as_int = reinterpret_cast<uintptr_t>(sub.submsg);
+ const char* str = reinterpret_cast<const char*>(as_int & ~SubTag::kMask);
+ switch (as_int & SubTag::kMask) {
+ case SubTag::kMessage:
+ return absl::Substitute("{.submsg = &$0}", str);
+ case SubTag::kEnum:
+ return absl::Substitute("{.subenum = &$0}", str);
+ default:
+ return std::string("{.submsg = NULL}");
+ }
+ return std::string("ERROR in GetSub");
+}
+
+void FilePlatformLayout::SetSubTableStrings() {
+ for (const auto& pair : table_map_) {
+ upb_MiniTable* mt = pair.second;
+ for (const auto* f : FieldNumberOrder(pair.first)) {
+ upb_MiniTable_Field* mt_f = const_cast<upb_MiniTable_Field*>(
+ upb_MiniTable_FindFieldByNumber(mt, f->number()));
+ assert(mt_f);
+ upb_MiniTable_Sub sub = PackSubForField(f, mt_f);
+ if (IsNull(sub)) continue;
+ // const_cast is safe because the mini-table is owned exclusively
+ // by us, and was allocated from an arena (known-writable memory).
+ *const_cast<upb_MiniTable_Sub*>(&mt->subs[mt_f->submsg_index]) = sub;
+ }
+ }
+}
+
+upb_MiniTable_Sub FilePlatformLayout::PackSubForField(
+ const protobuf::FieldDescriptor* f, const upb_MiniTable_Field* mt_f) {
+ if (mt_f->submsg_index == kUpb_NoSub) {
+ return PackSub(nullptr, SubTag::kNull);
+ } else if (f->message_type()) {
+ return PackSub(AllocStr(MessageInit(f->message_type())), SubTag::kMessage);
+ } else {
+ ABSL_ASSERT(f->enum_type());
+ return PackSub(AllocStr(EnumInit(f->enum_type())), SubTag::kEnum);
+ }
+}
+
+const char* FilePlatformLayout::AllocStr(absl::string_view str) {
+ char* ret =
+ static_cast<char*>(upb_Arena_Malloc(arena_.ptr(), str.size() + 1));
+ memcpy(ret, str.data(), str.size());
+ ret[str.size()] = '\0';
+ return ret;
+}
+
+void FilePlatformLayout::BuildMiniTables(const protobuf::FileDescriptor* fd) {
+ for (const auto& m : SortedMessages(fd)) {
+ table_map_[m] = MakeMiniTable(m);
+ }
+ ResolveIntraFileReferences();
+ SetSubTableStrings();
+}
+
+void FilePlatformLayout::BuildExtensions(const protobuf::FileDescriptor* fd) {
+ std::vector<const protobuf::FieldDescriptor*> sorted = SortedExtensions(fd);
+ upb::Status status;
+ for (const auto* f : sorted) {
+ upb::MtDataEncoder e;
+ e.StartMessage(0);
+ e.PutField(static_cast<upb_FieldType>(f->type()), f->number(),
+ GetFieldModifiers(f));
+ upb_MiniTable_Extension& ext = extension_map_[f];
+ upb_MiniTable_Sub sub;
+ bool ok = upb_MiniTable_BuildExtension(e.data().data(), e.data().size(),
+ &ext, sub, status.ptr());
+ if (!ok) {
+ // TODO(haberman): Use ABSL CHECK() when it is available.
+ fprintf(stderr, "Error building mini-table: %s\n",
+ status.error_message());
+ }
+ ABSL_ASSERT(ok);
+ ext.extendee = reinterpret_cast<const upb_MiniTable*>(
+ AllocStr(MessageInit(f->containing_type())));
+ ext.sub = PackSubForField(f, &ext.field);
+ }
+}
+
+upb_MiniTable* FilePlatformLayout::MakeMiniTable(
+ const protobuf::Descriptor* m) {
+ if (m->options().message_set_wire_format()) {
+ return upb_MiniTable_BuildMessageSet(platform_, arena_.ptr());
+ } else if (m->options().map_entry()) {
+ return upb_MiniTable_BuildMapEntry(
+ static_cast<upb_FieldType>(m->map_key()->type()),
+ static_cast<upb_FieldType>(m->map_value()->type()),
+ m->map_value()->enum_type() &&
+ m->map_value()->enum_type()->file()->syntax() ==
+ protobuf::FileDescriptor::SYNTAX_PROTO3,
+ platform_, arena_.ptr());
+ } else {
+ return MakeRegularMiniTable(m);
+ }
+}
+
+upb_MiniTable* FilePlatformLayout::MakeRegularMiniTable(
+ const protobuf::Descriptor* m) {
+ upb::MtDataEncoder e;
+ e.StartMessage(GetMessageModifiers(m));
+ for (const auto* f : FieldNumberOrder(m)) {
+ e.PutField(static_cast<upb_FieldType>(f->type()), f->number(),
+ GetFieldModifiers(f));
+ }
+ for (int i = 0; i < m->real_oneof_decl_count(); i++) {
+ const protobuf::OneofDescriptor* oneof = m->oneof_decl(i);
+ e.StartOneof();
+ for (int j = 0; j < oneof->field_count(); j++) {
+ const protobuf::FieldDescriptor* f = oneof->field(j);
+ e.PutOneofField(f->number());
+ }
+ }
+ const std::string& str = e.data();
+ upb::Status status;
+ upb_MiniTable* ret = upb_MiniTable_Build(str.data(), str.size(), platform_,
+ arena_.ptr(), status.ptr());
+ if (!ret) {
+ fprintf(stderr, "Error building mini-table: %s\n", status.error_message());
+ }
+ assert(ret);
+ return ret;
+}
+
+uint64_t FilePlatformLayout::GetMessageModifiers(
+ const protobuf::Descriptor* m) {
+ uint64_t ret = 0;
+
+ if (m->file()->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO3) {
+ ret |= kUpb_MessageModifier_ValidateUtf8;
+ ret |= kUpb_MessageModifier_DefaultIsPacked;
+ }
+
+ if (m->extension_range_count() > 0) {
+ ret |= kUpb_MessageModifier_IsExtendable;
+ }
+
+ assert(!m->options().map_entry());
+ return ret;
+}
+
+uint64_t FilePlatformLayout::GetFieldModifiers(
+ const protobuf::FieldDescriptor* f) {
+ uint64_t ret = 0;
+
+ if (f->is_repeated()) ret |= kUpb_FieldModifier_IsRepeated;
+ if (f->is_required()) ret |= kUpb_FieldModifier_IsRequired;
+ if (f->is_packed()) ret |= kUpb_FieldModifier_IsPacked;
+ if (f->enum_type() && f->enum_type()->file()->syntax() ==
+ protobuf::FileDescriptor::SYNTAX_PROTO2) {
+ ret |= kUpb_FieldModifier_IsClosedEnum;
+ }
+ if (f->is_optional() && !f->has_presence()) {
+ ret |= kUpb_FieldModifier_IsProto3Singular;
+ }
+
+ return ret;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// FileLayout
+////////////////////////////////////////////////////////////////////////////////
+
+// FileLayout is a pair of platform layouts: one for 32-bit and one for 64-bit.
+class FileLayout {
+ public:
+ FileLayout(const protobuf::FileDescriptor* fd)
+ : descriptor_(fd),
+ layout32_(fd, kUpb_MiniTablePlatform_32Bit),
+ layout64_(fd, kUpb_MiniTablePlatform_64Bit) {}
+
+ const protobuf::FileDescriptor* descriptor() const { return descriptor_; }
+
+ const upb_MiniTable* GetMiniTable32(const protobuf::Descriptor* m) const {
+ return layout32_.GetMiniTable(m);
+ }
+
+ const upb_MiniTable* GetMiniTable64(const protobuf::Descriptor* m) const {
+ return layout64_.GetMiniTable(m);
+ }
+
+ std::string GetFieldOffset(const protobuf::FieldDescriptor* f) const {
+ const upb_MiniTable_Field* f_32 = upb_MiniTable_FindFieldByNumber(
+ GetMiniTable32(f->containing_type()), f->number());
+ const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber(
+ GetMiniTable64(f->containing_type()), f->number());
+ return absl::Substitute("UPB_SIZE($0, $1)", f_32->offset, f_64->offset);
+ }
+
+ std::string GetOneofCaseOffset(const protobuf::OneofDescriptor* o) const {
+ const protobuf::FieldDescriptor* f = o->field(0);
+ const upb_MiniTable_Field* f_32 = upb_MiniTable_FindFieldByNumber(
+ GetMiniTable32(f->containing_type()), f->number());
+ const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber(
+ GetMiniTable64(f->containing_type()), f->number());
+ return absl::Substitute("UPB_SIZE($0, $1)", ~f_32->presence,
+ ~f_64->presence);
+ }
+
+ std::string GetMessageSize(const protobuf::Descriptor* d) const {
+ return absl::Substitute("UPB_SIZE($0, $1)", GetMiniTable32(d)->size,
+ GetMiniTable64(d)->size);
+ }
+
+ int GetHasbitIndex(const protobuf::FieldDescriptor* f) const {
+ const upb_MiniTable_Field* f_64 = upb_MiniTable_FindFieldByNumber(
+ GetMiniTable64(f->containing_type()), f->number());
+ return f_64->presence;
+ }
+
+ bool HasHasbit(const protobuf::FieldDescriptor* f) const {
+ return GetHasbitIndex(f) > 0;
+ }
+
+ const upb_MiniTable_Extension* GetExtension(
+ const protobuf::FieldDescriptor* f) const {
+ return layout64_.GetExtension(f);
+ }
+
+ private:
+ const protobuf::FileDescriptor* descriptor_;
+ FilePlatformLayout layout32_;
+ FilePlatformLayout layout64_;
+};
+
void DumpEnumValues(const protobuf::EnumDescriptor* desc, Output& output) {
std::vector<const protobuf::EnumValueDescriptor*> values;
for (int i = 0; i < desc->value_count(); i++) {
@@ -215,290 +697,573 @@ void DumpEnumValues(const protobuf::EnumDescriptor* desc, Output& output) {
}
}
-void GenerateMessageInHeader(const protobuf::Descriptor* message, Output& output) {
- MessageLayout layout(message);
+void GenerateExtensionInHeader(const protobuf::FieldDescriptor* ext,
+ Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE bool $0_has_$1(const struct $2* msg) {
+ return _upb_Message_Getext(msg, &$3) != NULL;
+ }
+ )cc",
+ ExtensionIdentBase(ext), ext->name(), MessageName(ext->containing_type()),
+ ExtensionLayout(ext));
- output("/* $0 */\n\n", message->full_name());
- std::string msgname = ToCIdent(message->full_name());
+ output(
+ R"cc(
+ UPB_INLINE void $0_clear_$1(struct $2* msg) {
+ _upb_Message_Clearext(msg, &$3);
+ }
+ )cc",
+ ExtensionIdentBase(ext), ext->name(), MessageName(ext->containing_type()),
+ ExtensionLayout(ext));
- if (!message->options().map_entry()) {
+ if (ext->is_repeated()) {
+ } else if (ext->message_type()) {
output(
- "UPB_INLINE $0 *$0_new(upb_arena *arena) {\n"
- " return ($0 *)_upb_msg_new(&$1, arena);\n"
- "}\n"
- "UPB_INLINE $0 *$0_parse(const char *buf, size_t size,\n"
- " upb_arena *arena) {\n"
- " $0 *ret = $0_new(arena);\n"
- " return (ret && upb_decode(buf, size, ret, &$1, arena)) ? ret : NULL;\n"
- "}\n"
- "UPB_INLINE $0 *$0_parse_ex(const char *buf, size_t size,\n"
- " upb_arena *arena, int options) {\n"
- " $0 *ret = $0_new(arena);\n"
- " return (ret && _upb_decode(buf, size, ret, &$1, arena, options))\n"
- " ? ret : NULL;\n"
- "}\n"
- "UPB_INLINE char *$0_serialize(const $0 *msg, upb_arena *arena, size_t "
- "*len) {\n"
- " return upb_encode(msg, &$1, arena, len);\n"
- "}\n"
- "\n",
- MessageName(message), MessageInit(message));
- }
-
- for (int i = 0; i < message->real_oneof_decl_count(); i++) {
- const protobuf::OneofDescriptor* oneof = message->oneof_decl(i);
- std::string fullname = ToCIdent(oneof->full_name());
- output("typedef enum {\n");
- for (int j = 0; j < oneof->field_count(); j++) {
- const protobuf::FieldDescriptor* field = oneof->field(j);
- output(" $0_$1 = $2,\n", fullname, field->name(), field->number());
- }
+ R"cc(
+ UPB_INLINE $0 $1_$2(const struct $3* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &$4);
+ UPB_ASSERT(ext);
+ return *UPB_PTR_AT(&ext->data, 0, $0);
+ }
+ )cc",
+ CTypeConst(ext), ExtensionIdentBase(ext), ext->name(),
+ MessageName(ext->containing_type()), ExtensionLayout(ext),
+ FieldDefault(ext));
output(
- " $0_NOT_SET = 0\n"
- "} $0_oneofcases;\n",
- fullname);
+ R"cc(
+ UPB_INLINE void $1_set_$2(struct $3* msg, $0 ext, upb_Arena* arena) {
+ const upb_Message_Extension* msg_ext =
+ _upb_Message_Getorcreateext(msg, &$4, arena);
+ UPB_ASSERT(msg_ext);
+ *UPB_PTR_AT(&msg_ext->data, 0, $0) = ext;
+ }
+ )cc",
+ CTypeConst(ext), ExtensionIdentBase(ext), ext->name(),
+ MessageName(ext->containing_type()), ExtensionLayout(ext),
+ FieldDefault(ext));
+ } else {
+ // Returns default if extension field is not a message.
output(
- "UPB_INLINE $0_oneofcases $1_$2_case(const $1* msg) { "
- "return ($0_oneofcases)*UPB_PTR_AT(msg, $3, int32_t); }\n"
- "\n",
- fullname, msgname, oneof->name(),
- GetSizeInit(layout.GetOneofCaseOffset(oneof)));
+ R"cc(
+ UPB_INLINE $0 $1_$2(const struct $3* msg) {
+ const upb_Message_Extension* ext = _upb_Message_Getext(msg, &$4);
+ return ext ? *UPB_PTR_AT(&ext->data, 0, $0) : $5;
+ }
+ )cc",
+ CTypeConst(ext), ExtensionIdentBase(ext), ext->name(),
+ MessageName(ext->containing_type()), ExtensionLayout(ext),
+ FieldDefault(ext));
}
+}
- // Generate const methods.
-
- for (auto field : FieldNumberOrder(message)) {
- // Generate hazzer (if any).
- if (layout.HasHasbit(field)) {
- output(
- "UPB_INLINE bool $0_has_$1(const $0 *msg) { "
- "return _upb_hasbit(msg, $2); }\n",
- msgname, field->name(), layout.GetHasbitIndex(field));
- } else if (field->real_containing_oneof()) {
- output(
- "UPB_INLINE bool $0_has_$1(const $0 *msg) { "
- "return _upb_getoneofcase(msg, $2) == $3; }\n",
- msgname, field->name(),
- GetSizeInit(
- layout.GetOneofCaseOffset(field->real_containing_oneof())),
- field->number());
- } else if (field->message_type()) {
- output(
- "UPB_INLINE bool $0_has_$1(const $0 *msg) { "
- "return _upb_has_submsg_nohasbit(msg, $2); }\n",
- msgname, field->name(), GetSizeInit(layout.GetFieldOffset(field)));
- }
+void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message,
+ Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE $0* $0_new(upb_Arena* arena) {
+ return ($0*)_upb_Message_New(&$1, arena);
+ }
+ UPB_INLINE $0* $0_parse(const char* buf, size_t size, upb_Arena* arena) {
+ $0* ret = $0_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &$1, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+ }
+ UPB_INLINE $0* $0_parse_ex(const char* buf, size_t size,
+ const upb_ExtensionRegistry* extreg,
+ int options, upb_Arena* arena) {
+ $0* ret = $0_new(arena);
+ if (!ret) return NULL;
+ if (upb_Decode(buf, size, ret, &$1, extreg, options, arena) !=
+ kUpb_DecodeStatus_Ok) {
+ return NULL;
+ }
+ return ret;
+ }
+ UPB_INLINE char* $0_serialize(const $0* msg, upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &$1, 0, arena, len);
+ }
+ UPB_INLINE char* $0_serialize_ex(const $0* msg, int options,
+ upb_Arena* arena, size_t* len) {
+ return upb_Encode(msg, &$1, options, arena, len);
+ }
+ )cc",
+ MessageName(message), MessageInit(message));
+}
- // Generate getter.
- if (field->is_map()) {
- const protobuf::Descriptor* entry = field->message_type();
- const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1);
- const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2);
- output(
- "UPB_INLINE size_t $0_$1_size(const $0 *msg) {"
- "return _upb_msg_map_size(msg, $2); }\n",
- msgname, field->name(), GetSizeInit(layout.GetFieldOffset(field)));
- output(
- "UPB_INLINE bool $0_$1_get(const $0 *msg, $2 key, $3 *val) { "
- "return _upb_msg_map_get(msg, $4, &key, $5, val, $6); }\n",
- msgname, field->name(), CType(key), CType(val),
- GetSizeInit(layout.GetFieldOffset(field)),
- key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(key)",
- val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(*val)");
- output(
- "UPB_INLINE $0 $1_$2_next(const $1 *msg, size_t* iter) { "
- "return ($0)_upb_msg_map_next(msg, $3, iter); }\n",
- CTypeConst(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
- } else if (message->options().map_entry()) {
- output(
- "UPB_INLINE $0 $1_$2(const $1 *msg) {\n"
- " $3 ret;\n"
- " _upb_msg_map_$2(msg, &ret, $4);\n"
- " return ret;\n"
- "}\n",
- CTypeConst(field), msgname, field->name(), CType(field),
- field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(ret)");
- } else if (field->is_repeated()) {
- output(
- "UPB_INLINE $0 const* $1_$2(const $1 *msg, size_t *len) { "
- "return ($0 const*)_upb_array_accessor(msg, $3, len); }\n",
- CTypeConst(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
- } else if (field->real_containing_oneof()) {
- output(
- "UPB_INLINE $0 $1_$2(const $1 *msg) { "
- "return UPB_READ_ONEOF(msg, $0, $3, $4, $5, $6); }\n",
- CTypeConst(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)),
- GetSizeInit(layout.GetOneofCaseOffset(field->real_containing_oneof())),
- field->number(), FieldDefault(field));
- } else {
- output(
- "UPB_INLINE $0 $1_$2(const $1 *msg) { "
- "return *UPB_PTR_AT(msg, $3, $0); }\n",
- CTypeConst(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
- }
+void GenerateOneofInHeader(const protobuf::OneofDescriptor* oneof,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ std::string fullname = ToCIdent(oneof->full_name());
+ output("typedef enum {\n");
+ for (int j = 0; j < oneof->field_count(); j++) {
+ const protobuf::FieldDescriptor* field = oneof->field(j);
+ output(" $0_$1 = $2,\n", fullname, field->name(), field->number());
}
+ output(
+ " $0_NOT_SET = 0\n"
+ "} $0_oneofcases;\n",
+ fullname);
+ output(
+ R"cc(
+ UPB_INLINE $0_oneofcases $1_$2_case(const $1* msg) {
+ return ($0_oneofcases)*UPB_PTR_AT(msg, $3, int32_t);
+ }
+ )cc",
+ fullname, msg_name, oneof->name(), layout.GetOneofCaseOffset(oneof));
+}
- output("\n");
+void GenerateHazzer(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ if (layout.HasHasbit(field)) {
+ output(
+ R"cc(
+ UPB_INLINE bool $0_has_$1(const $0* msg) {
+ return _upb_hasbit(msg, $2);
+ }
+ )cc",
+ msg_name, field->name(), layout.GetHasbitIndex(field));
+ } else if (field->real_containing_oneof()) {
+ output(
+ R"cc(
+ UPB_INLINE bool $0_has_$1(const $0* msg) {
+ return _upb_getoneofcase(msg, $2) == $3;
+ }
+ )cc",
+ msg_name, field->name(),
+ layout.GetOneofCaseOffset(field->real_containing_oneof()),
+ field->number());
+ } else if (field->message_type()) {
+ output(
+ R"cc(
+ UPB_INLINE bool $0_has_$1(const $0* msg) {
+ return _upb_has_submsg_nohasbit(msg, $2);
+ }
+ )cc",
+ msg_name, field->name(), layout.GetFieldOffset(field));
+ }
+}
- // Generate mutable methods.
+void GenerateClear(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ if (field == field->containing_type()->map_key() ||
+ field == field->containing_type()->map_value()) {
+ // Cannot be cleared.
+ return;
+ }
- for (auto field : FieldNumberOrder(message)) {
- if (field->is_map()) {
- // TODO(haberman): add map-based mutators.
- const protobuf::Descriptor* entry = field->message_type();
- const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1);
- const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2);
- output(
- "UPB_INLINE void $0_$1_clear($0 *msg) { _upb_msg_map_clear(msg, $2); }\n",
- msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
- output(
- "UPB_INLINE bool $0_$1_set($0 *msg, $2 key, $3 val, upb_arena *a) { "
- "return _upb_msg_map_set(msg, $4, &key, $5, &val, $6, a); }\n",
- msgname, field->name(), CType(key), CType(val),
- GetSizeInit(layout.GetFieldOffset(field)),
- key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(key)",
- val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(val)");
- output(
- "UPB_INLINE bool $0_$1_delete($0 *msg, $2 key) { "
- "return _upb_msg_map_delete(msg, $3, &key, $4); }\n",
- msgname, field->name(), CType(key),
- GetSizeInit(layout.GetFieldOffset(field)),
- key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(key)");
- output(
- "UPB_INLINE $0 $1_$2_nextmutable($1 *msg, size_t* iter) { "
- "return ($0)_upb_msg_map_next(msg, $3, iter); }\n",
- CType(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
- } else if (field->is_repeated()) {
- output(
- "UPB_INLINE $0* $1_mutable_$2($1 *msg, size_t *len) {\n"
- " return ($0*)_upb_array_mutable_accessor(msg, $3, len);\n"
- "}\n",
- CType(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)));
+ if (field->real_containing_oneof()) {
+ const protobuf::OneofDescriptor* oneof = field->real_containing_oneof();
+ std::string oneof_fullname = ToCIdent(oneof->full_name());
+ std::string default_value =
+ field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "upb_StringView_FromDataAndSize(NULL, 0)"
+ : "0";
+ output(
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ UPB_WRITE_ONEOF(msg, $2, $3, $7, $4, $6_NOT_SET);
+ }
+ )cc",
+ msg_name, field->name(), CType(field), layout.GetFieldOffset(field),
+ layout.GetOneofCaseOffset(field->real_containing_oneof()),
+ field->number(), oneof_fullname, default_value);
+ } else {
+ if (field->message_type()) {
output(
- "UPB_INLINE $0* $1_resize_$2($1 *msg, size_t len, "
- "upb_arena *arena) {\n"
- " return ($0*)_upb_array_resize_accessor2(msg, $3, len, $4, arena);\n"
- "}\n",
- CType(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)),
- SizeLg2(field));
- if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ *UPB_PTR_AT(msg, $2, const upb_Message*) = NULL;
+ }
+ )cc",
+ msg_name, field->name(), layout.GetFieldOffset(field));
+ } else if (layout.HasHasbit(field)) {
+ if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) {
output(
- "UPB_INLINE struct $0* $1_add_$2($1 *msg, upb_arena *arena) {\n"
- " struct $0* sub = (struct $0*)_upb_msg_new(&$3, arena);\n"
- " bool ok = _upb_array_append_accessor2(\n"
- " msg, $4, $5, &sub, arena);\n"
- " if (!ok) return NULL;\n"
- " return sub;\n"
- "}\n",
- MessageName(field->message_type()), msgname, field->name(),
- MessageInit(field->message_type()),
- GetSizeInit(layout.GetFieldOffset(field)),
- SizeLg2(field));
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ *UPB_PTR_AT(msg, $3, $2) = upb_StringView_FromDataAndSize(NULL, 0);
+ _upb_clearhas(msg, $4);
+ }
+ )cc",
+ msg_name, field->name(), CType(field), layout.GetFieldOffset(field),
+ layout.GetHasbitIndex(field));
} else {
output(
- "UPB_INLINE bool $1_add_$2($1 *msg, $0 val, upb_arena *arena) {\n"
- " return _upb_array_append_accessor2(msg, $3, $4, &val,\n"
- " arena);\n"
- "}\n",
- CType(field), msgname, field->name(),
- GetSizeInit(layout.GetFieldOffset(field)),
- SizeLg2(field));
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ *UPB_PTR_AT(msg, $3, $2) = 0;
+ _upb_clearhas(msg, $4);
+ }
+ )cc",
+ msg_name, field->name(), CType(field), layout.GetFieldOffset(field),
+ layout.GetHasbitIndex(field));
}
} else {
- // Non-repeated field.
- if (message->options().map_entry() && field->name() == "key") {
- // Key cannot be mutated.
- continue;
- }
-
- // The common function signature for all setters. Varying implementations
- // follow.
- output("UPB_INLINE void $0_set_$1($0 *msg, $2 value) {\n", msgname,
- field->name(), CType(field));
-
- if (message->options().map_entry()) {
+ if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING) {
output(
- " _upb_msg_map_set_value(msg, &value, $0);\n"
- "}\n",
- field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
- ? "0"
- : "sizeof(" + CType(field) + ")");
- } else if (field->real_containing_oneof()) {
- output(
- " UPB_WRITE_ONEOF(msg, $0, $1, value, $2, $3);\n"
- "}\n",
- CType(field), GetSizeInit(layout.GetFieldOffset(field)),
- GetSizeInit(
- layout.GetOneofCaseOffset(field->real_containing_oneof())),
- field->number());
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ *UPB_PTR_AT(msg, $3, $2) = upb_StringView_FromDataAndSize(NULL, 0);
+ }
+ )cc",
+ msg_name, field->name(), CType(field),
+ layout.GetFieldOffset(field));
} else {
- if (MessageLayout::HasHasbit(field)) {
- output(" _upb_sethas(msg, $0);\n", layout.GetHasbitIndex(field));
- }
output(
- " *UPB_PTR_AT(msg, $1, $0) = value;\n"
- "}\n",
- CType(field), GetSizeInit(layout.GetFieldOffset(field)));
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ *UPB_PTR_AT(msg, $3, $2) = 0;
+ }
+ )cc",
+ msg_name, field->name(), CType(field), layout.GetFieldOffset(field),
+ layout.GetHasbitIndex(field));
}
+ }
+ }
+}
- if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE &&
- !message->options().map_entry()) {
- output(
- "UPB_INLINE struct $0* $1_mutable_$2($1 *msg, upb_arena *arena) {\n"
- " struct $0* sub = (struct $0*)$1_$2(msg);\n"
- " if (sub == NULL) {\n"
- " sub = (struct $0*)_upb_msg_new(&$3, arena);\n"
- " if (!sub) return NULL;\n"
- " $1_set_$2(msg, sub);\n"
- " }\n"
- " return sub;\n"
- "}\n",
- MessageName(field->message_type()), msgname, field->name(),
- MessageInit(field->message_type()));
- }
+void GenerateRepeatedClear(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE void $0_clear_$1(const $0* msg) {
+ _upb_array_detach(msg, $2);
+ }
+ )cc",
+ msg_name, field->name(), layout.GetFieldOffset(field));
+}
+
+void GenerateMapGetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ const protobuf::Descriptor* entry = field->message_type();
+ const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1);
+ const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2);
+ output(
+ R"cc(
+ UPB_INLINE size_t $0_$1_size(const $0* msg) {
+ return _upb_msg_map_size(msg, $2);
+ }
+ )cc",
+ msg_name, field->name(), layout.GetFieldOffset(field));
+ output(
+ R"cc(
+ UPB_INLINE bool $0_$1_get(const $0* msg, $2 key, $3* val) {
+ return _upb_msg_map_get(msg, $4, &key, $5, val, $6);
+ }
+ )cc",
+ msg_name, field->name(), CType(key), CType(val),
+ layout.GetFieldOffset(field),
+ key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(key)",
+ val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(*val)");
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2_next(const $1* msg, size_t* iter) {
+ return ($0)_upb_msg_map_next(msg, $3, iter);
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field));
+}
+
+void GenerateMapEntryGetters(const protobuf::FieldDescriptor* field,
+ absl::string_view msg_name, Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2(const $1* msg) {
+ $3 ret;
+ _upb_msg_map_$2(msg, &ret, $4);
+ return ret;
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(), CType(field),
+ field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(ret)");
+}
+
+void GenerateRepeatedGetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout,
+ absl::string_view msg_name, Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE $0 const* $1_$2(const $1* msg, size_t* len) {
+ return ($0 const*)_upb_array_accessor(msg, $3, len);
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field));
+}
+
+void GenerateOneofGetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2(const $1* msg) {
+ return UPB_READ_ONEOF(msg, $0, $3, $4, $5, $6);
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(), layout.GetFieldOffset(field),
+ layout.GetOneofCaseOffset(field->real_containing_oneof()),
+ field->number(), FieldDefault(field));
+}
+
+void GenerateScalarGetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ if (HasNonZeroDefault(field)) {
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2(const $1* msg) {
+ return $1_has_$2(msg) ? *UPB_PTR_AT(msg, $3, $0) : $4;
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(),
+ layout.GetFieldOffset(field), FieldDefault(field));
+ } else {
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2(const $1* msg) {
+ return *UPB_PTR_AT(msg, $3, $0);
+ }
+ )cc",
+ CTypeConst(field), msg_name, field->name(),
+ layout.GetFieldOffset(field));
+ }
+}
+
+void GenerateGetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ if (field->is_map()) {
+ GenerateMapGetters(field, layout, msg_name, output);
+ } else if (field->containing_type()->options().map_entry()) {
+ GenerateMapEntryGetters(field, msg_name, output);
+ } else if (field->is_repeated()) {
+ GenerateRepeatedGetters(field, layout, msg_name, output);
+ } else if (field->real_containing_oneof()) {
+ GenerateOneofGetters(field, layout, msg_name, output);
+ } else {
+ GenerateScalarGetters(field, layout, msg_name, output);
+ }
+}
+
+void GenerateMapSetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ const protobuf::Descriptor* entry = field->message_type();
+ const protobuf::FieldDescriptor* key = entry->FindFieldByNumber(1);
+ const protobuf::FieldDescriptor* val = entry->FindFieldByNumber(2);
+ output(
+ R"cc(
+ UPB_INLINE void $0_$1_clear($0* msg) { _upb_msg_map_clear(msg, $2); }
+ )cc",
+ msg_name, field->name(), layout.GetFieldOffset(field));
+ output(
+ R"cc(
+ UPB_INLINE bool $0_$1_set($0* msg, $2 key, $3 val, upb_Arena* a) {
+ return _upb_msg_map_set(msg, $4, &key, $5, &val, $6, a);
+ }
+ )cc",
+ msg_name, field->name(), CType(key), CType(val),
+ layout.GetFieldOffset(field),
+ key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(key)",
+ val->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(val)");
+ output(
+ R"cc(
+ UPB_INLINE bool $0_$1_delete($0* msg, $2 key) {
+ return _upb_msg_map_delete(msg, $3, &key, $4);
+ }
+ )cc",
+ msg_name, field->name(), CType(key), layout.GetFieldOffset(field),
+ key->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(key)");
+ output(
+ R"cc(
+ UPB_INLINE $0 $1_$2_nextmutable($1* msg, size_t* iter) {
+ return ($0)_upb_msg_map_next(msg, $3, iter);
+ }
+ )cc",
+ CType(field), msg_name, field->name(), layout.GetFieldOffset(field));
+}
+
+void GenerateRepeatedSetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout,
+ absl::string_view msg_name, Output& output) {
+ output(
+ R"cc(
+ UPB_INLINE $0* $1_mutable_$2($1* msg, size_t* len) {
+ return ($0*)_upb_array_mutable_accessor(msg, $3, len);
+ }
+ )cc",
+ CType(field), msg_name, field->name(), layout.GetFieldOffset(field));
+ output(
+ R"cc(
+ UPB_INLINE $0* $1_resize_$2($1* msg, size_t len, upb_Arena* arena) {
+ return ($0*)_upb_Array_Resize_accessor2(msg, $3, len, $4, arena);
+ }
+ )cc",
+ CType(field), msg_name, field->name(), layout.GetFieldOffset(field),
+ SizeLg2(field));
+ if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
+ output(
+ R"cc(
+ UPB_INLINE struct $0* $1_add_$2($1* msg, upb_Arena* arena) {
+ struct $0* sub = (struct $0*)_upb_Message_New(&$3, arena);
+ bool ok = _upb_Array_Append_accessor2(msg, $4, $5, &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+ }
+ )cc",
+ MessageName(field->message_type()), msg_name, field->name(),
+ MessageInit(field->message_type()), layout.GetFieldOffset(field),
+ SizeLg2(field));
+ } else {
+ output(
+ R"cc(
+ UPB_INLINE bool $1_add_$2($1* msg, $0 val, upb_Arena* arena) {
+ return _upb_Array_Append_accessor2(msg, $3, $4, &val, arena);
+ }
+ )cc",
+ CType(field), msg_name, field->name(), layout.GetFieldOffset(field),
+ SizeLg2(field));
+ }
+}
+
+void GenerateNonRepeatedSetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout,
+ absl::string_view msg_name, Output& output) {
+ if (field == field->containing_type()->map_key()) {
+ // Key cannot be mutated.
+ return;
+ }
+
+ // The common function signature for all setters. Varying
+ // implementations follow.
+ output("UPB_INLINE void $0_set_$1($0 *msg, $2 value) {\n", msg_name,
+ field->name(), CType(field));
+
+ if (field == field->containing_type()->map_value()) {
+ output(
+ " _upb_msg_map_set_value(msg, &value, $0);\n"
+ "}\n",
+ field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_STRING
+ ? "0"
+ : "sizeof(" + CType(field) + ")");
+ } else if (field->real_containing_oneof()) {
+ output(
+ " UPB_WRITE_ONEOF(msg, $0, $1, value, $2, $3);\n"
+ "}\n",
+ CType(field), layout.GetFieldOffset(field),
+ layout.GetOneofCaseOffset(field->real_containing_oneof()),
+ field->number());
+ } else {
+ if (layout.HasHasbit(field)) {
+ output(" _upb_sethas(msg, $0);\n", layout.GetHasbitIndex(field));
+ }
+ output(
+ " *UPB_PTR_AT(msg, $1, $0) = value;\n"
+ "}\n",
+ CType(field), layout.GetFieldOffset(field));
+ }
+
+ // Message fields also have a Msg_mutable_foo() accessor that will create
+ // the sub-message if it doesn't already exist.
+ if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE &&
+ !field->containing_type()->options().map_entry()) {
+ output(
+ R"cc(
+ UPB_INLINE struct $0* $1_mutable_$2($1* msg, upb_Arena* arena) {
+ struct $0* sub = (struct $0*)$1_$2(msg);
+ if (sub == NULL) {
+ sub = (struct $0*)_upb_Message_New(&$3, arena);
+ if (!sub) return NULL;
+ $1_set_$2(msg, sub);
+ }
+ return sub;
+ }
+ )cc",
+ MessageName(field->message_type()), msg_name, field->name(),
+ MessageInit(field->message_type()));
+ }
+}
+
+void GenerateSetters(const protobuf::FieldDescriptor* field,
+ const FileLayout& layout, absl::string_view msg_name,
+ Output& output) {
+ if (field->is_map()) {
+ GenerateMapSetters(field, layout, msg_name, output);
+ } else if (field->is_repeated()) {
+ GenerateRepeatedSetters(field, layout, msg_name, output);
+ } else {
+ GenerateNonRepeatedSetters(field, layout, msg_name, output);
+ }
+}
+
+void GenerateMessageInHeader(const protobuf::Descriptor* message,
+ const FileLayout& layout, Output& output) {
+ output("/* $0 */\n\n", message->full_name());
+ std::string msg_name = ToCIdent(message->full_name());
+
+ if (!message->options().map_entry()) {
+ GenerateMessageFunctionsInHeader(message, output);
+ }
+
+ for (int i = 0; i < message->real_oneof_decl_count(); i++) {
+ GenerateOneofInHeader(message->oneof_decl(i), layout, msg_name, output);
+ }
+
+ for (auto field : FieldNumberOrder(message)) {
+ GenerateHazzer(field, layout, msg_name, output);
+ if (field->is_repeated()) {
+ GenerateRepeatedClear(field, layout, msg_name, output);
+ } else {
+ GenerateClear(field, layout, msg_name, output);
}
+ GenerateGetters(field, layout, msg_name, output);
+ }
+
+ output("\n");
+
+ for (auto field : FieldNumberOrder(message)) {
+ GenerateSetters(field, layout, msg_name, output);
}
output("\n");
}
-void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
+void WriteHeader(const FileLayout& layout, Output& output) {
+ const protobuf::FileDescriptor* file = layout.descriptor();
EmitFileWarning(file, output);
output(
"#ifndef $0_UPB_H_\n"
"#define $0_UPB_H_\n\n"
- "#include \"upb/msg.h\"\n"
+ "#include \"upb/msg_internal.h\"\n"
"#include \"upb/decode.h\"\n"
"#include \"upb/decode_fast.h\"\n"
"#include \"upb/encode.h\"\n\n",
ToPreproc(file->name()));
for (int i = 0; i < file->public_dependency_count(); i++) {
- const auto& name = file->public_dependency(i)->name();
if (i == 0) {
output("/* Public Imports. */\n");
}
- output("#include \"$0\"\n", HeaderFilename(name));
+ output("#include \"$0\"\n", HeaderFilename(file));
if (i == file->public_dependency_count() - 1) {
output("\n");
}
@@ -512,8 +1277,10 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
"#endif\n"
"\n");
- std::vector<const protobuf::Descriptor*> this_file_messages =
+ const std::vector<const protobuf::Descriptor*> this_file_messages =
SortedMessages(file);
+ const std::vector<const protobuf::FieldDescriptor*> this_file_exts =
+ SortedExtensions(file);
// Forward-declare types defined in this file.
for (auto message : this_file_messages) {
@@ -523,14 +1290,17 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
output("typedef struct $0 $0;\n", ToCIdent(message->full_name()));
}
for (auto message : this_file_messages) {
- output("extern const upb_msglayout $0;\n", MessageInit(message));
+ output("extern const upb_MiniTable $0;\n", MessageInit(message));
+ }
+ for (auto ext : this_file_exts) {
+ output("extern const upb_MiniTable_Extension $0;\n", ExtensionLayout(ext));
}
// Forward-declare types not in this file, but used as submessages.
// Order by full name for consistent ordering.
std::map<std::string, const protobuf::Descriptor*> forward_messages;
- for (auto message : SortedMessages(file)) {
+ for (auto* message : this_file_messages) {
for (int i = 0; i < message->field_count(); i++) {
const protobuf::FieldDescriptor* field = message->field(i);
if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE &&
@@ -540,11 +1310,17 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
}
}
}
+ for (auto ext : this_file_exts) {
+ if (ext->file() != ext->containing_type()->file()) {
+ forward_messages[ext->containing_type()->full_name()] =
+ ext->containing_type();
+ }
+ }
for (const auto& pair : forward_messages) {
output("struct $0;\n", MessageName(pair.second));
}
for (const auto& pair : forward_messages) {
- output("extern const upb_msglayout $0;\n", MessageInit(pair.second));
+ output("extern const upb_MiniTable $0;\n", MessageInit(pair.second));
}
if (!this_file_messages.empty()) {
@@ -553,6 +1329,11 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
std::vector<const protobuf::EnumDescriptor*> this_file_enums =
SortedEnums(file);
+ std::sort(
+ this_file_enums.begin(), this_file_enums.end(),
+ [](const protobuf::EnumDescriptor* a, const protobuf::EnumDescriptor* b) {
+ return a->full_name() < b->full_name();
+ });
for (auto enumdesc : this_file_enums) {
output("typedef enum {\n");
@@ -562,8 +1343,51 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
output("\n");
+ if (file->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO2) {
+ for (const auto* enumdesc : this_file_enums) {
+ output("extern const upb_MiniTable_Enum $0;\n", EnumInit(enumdesc));
+ }
+ }
+
+ output("\n");
+
for (auto message : this_file_messages) {
- GenerateMessageInHeader(message, output);
+ GenerateMessageInHeader(message, layout, output);
+ }
+
+ for (auto ext : this_file_exts) {
+ GenerateExtensionInHeader(ext, output);
+ }
+
+ output("extern const upb_MiniTable_File $0;\n\n", FileLayoutName(file));
+
+ if (file->name() ==
+ protobuf::FileDescriptorProto::descriptor()->file()->name()) {
+ // This is gratuitously inefficient with how many times it rebuilds
+ // MessageLayout objects for the same message. But we only do this for one
+ // proto (descriptor.proto) so we don't worry about it.
+ const protobuf::Descriptor* max32_message = nullptr;
+ const protobuf::Descriptor* max64_message = nullptr;
+ size_t max32 = 0;
+ size_t max64 = 0;
+ for (const auto* message : this_file_messages) {
+ if (absl::EndsWith(message->name(), "Options")) {
+ size_t size32 = layout.GetMiniTable32(message)->size;
+ size_t size64 = layout.GetMiniTable64(message)->size;
+ if (size32 > max32) {
+ max32 = size32;
+ max32_message = message;
+ }
+ if (size64 > max64) {
+ max64 = size64;
+ max64_message = message;
+ }
+ }
+ }
+
+ output("/* Max size 32 is $0 */\n", max32_message->full_name());
+ output("/* Max size 64 is $0 */\n", max64_message->full_name());
+ output("#define _UPB_MAXOPT_SIZE UPB_SIZE($0, $1)\n\n", max32, max64);
}
output(
@@ -577,56 +1401,6 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
ToPreproc(file->name()));
}
-int TableDescriptorType(const protobuf::FieldDescriptor* field) {
- if (field->file()->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO2 &&
- field->type() == protobuf::FieldDescriptor::TYPE_STRING) {
- // From the perspective of the binary encoder/decoder, proto2 string fields
- // are identical to bytes fields. Only in proto3 do we check UTF-8 for
- // string fields at parse time.
- //
- // If we ever use these tables for JSON encoding/decoding (for example by
- // embedding field names on the side) we will have to revisit this, because
- // string vs. bytes behavior is not affected by proto2 vs proto3.
- return protobuf::FieldDescriptor::TYPE_BYTES;
- } else {
- return field->type();
- }
-}
-
-struct SubmsgArray {
- public:
- SubmsgArray(const protobuf::Descriptor* message) : message_(message) {
- MessageLayout layout(message);
- std::vector<const protobuf::FieldDescriptor*> sorted_submsgs =
- SortedSubmessages(message);
- int i = 0;
- for (auto submsg : sorted_submsgs) {
- if (indexes_.find(submsg->message_type()) != indexes_.end()) {
- continue;
- }
- submsgs_.push_back(submsg->message_type());
- indexes_[submsg->message_type()] = i++;
- }
- }
-
- const std::vector<const protobuf::Descriptor*>& submsgs() const {
- return submsgs_;
- }
-
- int GetIndex(const protobuf::FieldDescriptor* field) {
- (void)message_;
- assert(field->containing_type() == message_);
- auto it = indexes_.find(field->message_type());
- assert(it != indexes_.end());
- return it->second;
- }
-
- private:
- const protobuf::Descriptor* message_;
- std::vector<const protobuf::Descriptor*> submsgs_;
- absl::flat_hash_map<const protobuf::Descriptor*, int> indexes_;
-};
-
typedef std::pair<std::string, uint64_t> TableEntry;
uint64_t GetEncodedTag(const protobuf::FieldDescriptor* field) {
@@ -652,72 +1426,70 @@ int GetTableSlot(const protobuf::FieldDescriptor* field) {
return (tag & 0xf8) >> 3;
}
-bool TryFillTableEntry(const protobuf::Descriptor* message,
- const MessageLayout& layout,
+bool TryFillTableEntry(const FileLayout& layout,
const protobuf::FieldDescriptor* field,
TableEntry& ent) {
+ const upb_MiniTable* mt = layout.GetMiniTable64(field->containing_type());
+ const upb_MiniTable_Field* mt_f =
+ upb_MiniTable_FindFieldByNumber(mt, field->number());
std::string type = "";
std::string cardinality = "";
- switch (field->type()) {
- case protobuf::FieldDescriptor::TYPE_BOOL:
+ switch (mt_f->descriptortype) {
+ case kUpb_FieldType_Bool:
type = "b1";
break;
- case protobuf::FieldDescriptor::TYPE_INT32:
- case protobuf::FieldDescriptor::TYPE_ENUM:
- case protobuf::FieldDescriptor::TYPE_UINT32:
+ case kUpb_FieldType_Enum:
+ // We don't have the means to test proto2 enum fields for valid values.
+ return false;
+ case kUpb_FieldType_Int32:
+ case kUpb_FieldType_UInt32:
type = "v4";
break;
- case protobuf::FieldDescriptor::TYPE_INT64:
- case protobuf::FieldDescriptor::TYPE_UINT64:
+ case kUpb_FieldType_Int64:
+ case kUpb_FieldType_UInt64:
type = "v8";
break;
- case protobuf::FieldDescriptor::TYPE_FIXED32:
- case protobuf::FieldDescriptor::TYPE_SFIXED32:
- case protobuf::FieldDescriptor::TYPE_FLOAT:
+ case kUpb_FieldType_Fixed32:
+ case kUpb_FieldType_SFixed32:
+ case kUpb_FieldType_Float:
type = "f4";
break;
- case protobuf::FieldDescriptor::TYPE_FIXED64:
- case protobuf::FieldDescriptor::TYPE_SFIXED64:
- case protobuf::FieldDescriptor::TYPE_DOUBLE:
+ case kUpb_FieldType_Fixed64:
+ case kUpb_FieldType_SFixed64:
+ case kUpb_FieldType_Double:
type = "f8";
break;
- case protobuf::FieldDescriptor::TYPE_SINT32:
+ case kUpb_FieldType_SInt32:
type = "z4";
break;
- case protobuf::FieldDescriptor::TYPE_SINT64:
+ case kUpb_FieldType_SInt64:
type = "z8";
break;
- case protobuf::FieldDescriptor::TYPE_STRING:
- if (field->file()->syntax() == protobuf::FileDescriptor::SYNTAX_PROTO3) {
- // Only proto3 validates UTF-8.
- type = "s";
- break;
- }
- ABSL_FALLTHROUGH_INTENDED;
- case protobuf::FieldDescriptor::TYPE_BYTES:
+ case kUpb_FieldType_String:
+ type = "s";
+ break;
+ case kUpb_FieldType_Bytes:
type = "b";
break;
- case protobuf::FieldDescriptor::TYPE_MESSAGE:
- if (field->is_map()) {
- return false; // Not supported yet (ever?).
- }
+ case kUpb_FieldType_Message:
type = "m";
break;
default:
return false; // Not supported yet.
}
- switch (field->label()) {
- case protobuf::FieldDescriptor::LABEL_REPEATED:
- if (field->is_packed()) {
+ switch (upb_FieldMode_Get(mt_f)) {
+ case kUpb_FieldMode_Map:
+ return false; // Not supported yet (ever?).
+ case kUpb_FieldMode_Array:
+ if (mt_f->mode & kUpb_LabelFlags_IsPacked) {
cardinality = "p";
} else {
cardinality = "r";
}
break;
- case protobuf::FieldDescriptor::LABEL_OPTIONAL:
- case protobuf::FieldDescriptor::LABEL_REQUIRED:
- if (field->real_containing_oneof()) {
+ case kUpb_FieldMode_Scalar:
+ if (mt_f->presence < 0) {
cardinality = "o";
} else {
cardinality = "s";
@@ -726,7 +1498,6 @@ bool TryFillTableEntry(const protobuf::Descriptor* message,
}
uint64_t expected_tag = GetEncodedTag(field);
- MessageLayout::Size offset = layout.GetFieldOffset(field);
// Data is:
//
@@ -737,29 +1508,28 @@ bool TryFillTableEntry(const protobuf::Descriptor* message,
//
// - |presence| is either hasbit index or field number for oneofs.
- uint64_t data = offset.size64 << 48 | expected_tag;
+ uint64_t data = static_cast<uint64_t>(mt_f->offset) << 48 | expected_tag;
if (field->is_repeated()) {
// No hasbit/oneof-related fields.
- } if (field->real_containing_oneof()) {
- MessageLayout::Size case_offset =
- layout.GetOneofCaseOffset(field->real_containing_oneof());
- if (case_offset.size64 > 0xffff) return false;
+ }
+ if (field->real_containing_oneof()) {
+ size_t case_offset = ~mt_f->presence;
+ if (case_offset > 0xffff) return false;
assert(field->number() < 256);
data |= field->number() << 24;
- data |= case_offset.size64 << 32;
+ data |= case_offset << 32;
} else {
uint64_t hasbit_index = 63; // No hasbit (set a high, unused bit).
- if (layout.HasHasbit(field)) {
- hasbit_index = layout.GetHasbitIndex(field);
+ if (mt_f->presence) {
+ hasbit_index = mt_f->presence;
if (hasbit_index > 31) return false;
}
data |= hasbit_index << 24;
}
if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
- SubmsgArray submsg_array(message);
- uint64_t idx = submsg_array.GetIndex(field);
+ uint64_t idx = mt_f->submsg_index;
if (idx > 255) return false;
data |= idx << 16;
@@ -770,8 +1540,9 @@ bool TryFillTableEntry(const protobuf::Descriptor* message,
// same file as us. We could relax this to increase the speed of
// cross-file sub-message parsing if we are comfortable requiring that
// users compile all messages at the same time.
- MessageLayout sub_layout(field->message_type());
- size = sub_layout.message_size().size64 + 8;
+ const upb_MiniTable* sub_mt =
+ layout.GetMiniTable64(field->message_type());
+ size = sub_mt->size + 8;
}
std::vector<size_t> breaks = {64, 128, 192, 256};
for (auto brk : breaks) {
@@ -792,7 +1563,7 @@ bool TryFillTableEntry(const protobuf::Descriptor* message,
}
std::vector<TableEntry> FastDecodeTable(const protobuf::Descriptor* message,
- const MessageLayout& layout) {
+ const FileLayout& layout) {
std::vector<TableEntry> table;
for (const auto field : FieldHotnessOrder(message)) {
TableEntry ent;
@@ -802,7 +1573,7 @@ std::vector<TableEntry> FastDecodeTable(const protobuf::Descriptor* message,
// Tag can't fit in the table.
continue;
}
- if (!TryFillTableEntry(message, layout, field, ent)) {
+ if (!TryFillTableEntry(layout, field, ent)) {
// Unsupported field type or offset, hasbit index, etc. doesn't fit.
continue;
}
@@ -819,130 +1590,313 @@ std::vector<TableEntry> FastDecodeTable(const protobuf::Descriptor* message,
return table;
}
-void WriteSource(const protobuf::FileDescriptor* file, Output& output,
- bool fasttable_enabled) {
- EmitFileWarning(file, output);
+// Returns the field mode as a string initializer.
+//
+// We could just emit this as a number (and we may yet go in that direction) but
+// for now emitting symbolic constants gives this better readability and
+// debuggability.
+std::string GetModeInit(uint8_t mode) {
+ std::string ret;
+ switch (mode & kUpb_FieldMode_Mask) {
+ case kUpb_FieldMode_Map:
+ ret = "kUpb_FieldMode_Map";
+ break;
+ case kUpb_FieldMode_Array:
+ ret = "kUpb_FieldMode_Array";
+ break;
+ case kUpb_FieldMode_Scalar:
+ ret = "kUpb_FieldMode_Scalar";
+ break;
+ default:
+ break;
+ }
- output(
- "#include <stddef.h>\n"
- "#include \"upb/msg.h\"\n"
- "#include \"$0\"\n",
- HeaderFilename(file->name()));
+ if (mode & kUpb_LabelFlags_IsPacked) {
+ absl::StrAppend(&ret, " | kUpb_LabelFlags_IsPacked");
+ }
- for (int i = 0; i < file->dependency_count(); i++) {
- output("#include \"$0\"\n", HeaderFilename(file->dependency(i)->name()));
+ if (mode & kUpb_LabelFlags_IsExtension) {
+ absl::StrAppend(&ret, " | kUpb_LabelFlags_IsExtension");
}
- output(
- "\n"
- "#include \"upb/port_def.inc\"\n"
- "\n");
+ std::string rep;
+ switch (mode >> kUpb_FieldRep_Shift) {
+ case kUpb_FieldRep_1Byte:
+ rep = "kUpb_FieldRep_1Byte";
+ break;
+ case kUpb_FieldRep_4Byte:
+ rep = "kUpb_FieldRep_4Byte";
+ break;
+ case kUpb_FieldRep_Pointer:
+ rep = "kUpb_FieldRep_Pointer";
+ break;
+ case kUpb_FieldRep_StringView:
+ rep = "kUpb_FieldRep_StringView";
+ break;
+ case kUpb_FieldRep_8Byte:
+ rep = "kUpb_FieldRep_8Byte";
+ break;
+ }
+ absl::StrAppend(&ret, " | (", rep, " << kUpb_FieldRep_Shift)");
+ return ret;
+}
- for (auto message : SortedMessages(file)) {
- std::string msgname = ToCIdent(message->full_name());
- std::string fields_array_ref = "NULL";
- std::string submsgs_array_ref = "NULL";
- MessageLayout layout(message);
- SubmsgArray submsg_array(message);
+void WriteField(const upb_MiniTable_Field* field64,
+ const upb_MiniTable_Field* field32, Output& output) {
+ output("{$0, UPB_SIZE($1, $2), UPB_SIZE($3, $4), $5, $6, $7}",
+ field64->number, field32->offset, field64->offset, field32->presence,
+ field64->presence,
+ field64->submsg_index == kUpb_NoSub
+ ? "kUpb_NoSub"
+ : absl::StrCat(field64->submsg_index).c_str(),
+ field64->descriptortype, GetModeInit(field64->mode));
+}
- if (!submsg_array.submsgs().empty()) {
- // TODO(haberman): could save a little bit of space by only generating a
- // "submsgs" array for every strongly-connected component.
- std::string submsgs_array_name = msgname + "_submsgs";
- submsgs_array_ref = "&" + submsgs_array_name + "[0]";
- output("static const upb_msglayout *const $0[$1] = {\n",
- submsgs_array_name, submsg_array.submsgs().size());
+// Writes a single field into a .upb.c source file.
+void WriteMessageField(const upb_MiniTable_Field* field64,
+ const upb_MiniTable_Field* field32, Output& output) {
+ output(" ");
+ WriteField(field64, field32, output);
+ output(",\n");
+}
- for (auto submsg : submsg_array.submsgs()) {
- output(" &$0,\n", MessageInit(submsg));
- }
+// Writes a single message into a .upb.c source file.
+void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout,
+ Output& output, bool fasttable_enabled) {
+ std::string msg_name = ToCIdent(message->full_name());
+ std::string fields_array_ref = "NULL";
+ std::string submsgs_array_ref = "NULL";
+ std::string subenums_array_ref = "NULL";
+ const upb_MiniTable* mt_32 = layout.GetMiniTable32(message);
+ const upb_MiniTable* mt_64 = layout.GetMiniTable64(message);
+ std::vector<std::string> subs;
+
+ for (int i = 0; i < mt_64->field_count; i++) {
+ const upb_MiniTable_Field* f = &mt_64->fields[i];
+ if (f->submsg_index != kUpb_NoSub) {
+ subs.push_back(FilePlatformLayout::GetSub(mt_64->subs[f->submsg_index]));
+ }
+ }
- output("};\n\n");
+ if (!subs.empty()) {
+ std::string submsgs_array_name = msg_name + "_submsgs";
+ submsgs_array_ref = "&" + submsgs_array_name + "[0]";
+ output("static const upb_MiniTable_Sub $0[$1] = {\n", submsgs_array_name,
+ subs.size());
+
+ for (const auto& sub : subs) {
+ output(" $0,\n", sub);
}
- std::vector<const protobuf::FieldDescriptor*> field_number_order =
- FieldNumberOrder(message);
- if (!field_number_order.empty()) {
- std::string fields_array_name = msgname + "__fields";
- fields_array_ref = "&" + fields_array_name + "[0]";
- output("static const upb_msglayout_field $0[$1] = {\n",
- fields_array_name, field_number_order.size());
- for (auto field : field_number_order) {
- int submsg_index = 0;
- std::string presence = "0";
+ output("};\n\n");
+ }
- if (field->cpp_type() == protobuf::FieldDescriptor::CPPTYPE_MESSAGE) {
- submsg_index = submsg_array.GetIndex(field);
- }
+ if (mt_64->field_count > 0) {
+ std::string fields_array_name = msg_name + "__fields";
+ fields_array_ref = "&" + fields_array_name + "[0]";
+ output("static const upb_MiniTable_Field $0[$1] = {\n", fields_array_name,
+ mt_64->field_count);
+ for (int i = 0; i < mt_64->field_count; i++) {
+ WriteMessageField(&mt_64->fields[i], &mt_32->fields[i], output);
+ }
+ output("};\n\n");
+ }
- if (MessageLayout::HasHasbit(field)) {
- int index = layout.GetHasbitIndex(field);
- assert(index != 0);
- presence = absl::StrCat(index);
- } else if (field->real_containing_oneof()) {
- MessageLayout::Size case_offset =
- layout.GetOneofCaseOffset(field->real_containing_oneof());
-
- // We encode as negative to distinguish from hasbits.
- case_offset.size32 = ~case_offset.size32;
- case_offset.size64 = ~case_offset.size64;
- assert(case_offset.size32 < 0);
- assert(case_offset.size64 < 0);
- presence = GetSizeInit(case_offset);
- }
+ std::vector<TableEntry> table;
+ uint8_t table_mask = -1;
- std::string label;
- if (field->is_map()) {
- label = "_UPB_LABEL_MAP";
- } else if (field->is_packed()) {
- label = "_UPB_LABEL_PACKED";
- } else {
- label = absl::StrCat(field->label());
- }
+ if (fasttable_enabled) {
+ table = FastDecodeTable(message, layout);
+ }
- output(" {$0, $1, $2, $3, $4, $5},\n",
- field->number(),
- GetSizeInit(layout.GetFieldOffset(field)),
- presence,
- submsg_index,
- TableDescriptorType(field),
- label);
- }
- output("};\n\n");
- }
+ if (table.size() > 1) {
+ assert((table.size() & (table.size() - 1)) == 0);
+ table_mask = (table.size() - 1) << 3;
+ }
- std::vector<TableEntry> table;
- uint8_t table_mask = -1;
+ std::string msgext = "kUpb_ExtMode_NonExtendable";
- if (fasttable_enabled) {
- table = FastDecodeTable(message, layout);
+ if (message->extension_range_count()) {
+ if (message->options().message_set_wire_format()) {
+ msgext = "kUpb_ExtMode_IsMessageSet";
+ } else {
+ msgext = "kUpb_ExtMode_Extendable";
}
+ }
- if (table.size() > 1) {
- assert((table.size() & (table.size() - 1)) == 0);
- table_mask = (table.size() - 1) << 3;
+ output("const upb_MiniTable $0 = {\n", MessageInit(message));
+ output(" $0,\n", submsgs_array_ref);
+ output(" $0,\n", fields_array_ref);
+ output(" $0, $1, $2, $3, $4, $5,\n", layout.GetMessageSize(message),
+ mt_64->field_count, msgext, mt_64->dense_below, table_mask,
+ mt_64->required_count);
+ if (!table.empty()) {
+ output(" UPB_FASTTABLE_INIT({\n");
+ for (const auto& ent : table) {
+ output(" {0x$1, &$0},\n", ent.first,
+ absl::StrCat(absl::Hex(ent.second, absl::kZeroPad16)));
}
+ output(" }),\n");
+ }
+ output("};\n\n");
+}
- output("const upb_msglayout $0 = {\n", MessageInit(message));
- output(" $0,\n", submsgs_array_ref);
- output(" $0,\n", fields_array_ref);
- output(" $0, $1, $2, $3,\n", GetSizeInit(layout.message_size()),
- field_number_order.size(),
- "false", // TODO: extendable
- table_mask
- );
- if (!table.empty()) {
- output(" UPB_FASTTABLE_INIT({\n");
- for (const auto& ent : table) {
- output(" {0x$1, &$0},\n", ent.first,
- absl::StrCat(absl::Hex(ent.second, absl::kZeroPad16)));
+int WriteEnums(const protobuf::FileDescriptor* file, Output& output) {
+ if (file->syntax() != protobuf::FileDescriptor::SYNTAX_PROTO2) {
+ return 0;
+ }
+
+ std::vector<const protobuf::EnumDescriptor*> this_file_enums =
+ SortedEnums(file);
+
+ std::string values_init = "NULL";
+
+ for (const auto* e : this_file_enums) {
+ uint64_t mask = 0;
+ std::vector<int32_t> values;
+ for (auto number : SortedUniqueEnumNumbers(e)) {
+ if (static_cast<uint32_t>(number) < 64) {
+ mask |= 1ULL << number;
+ } else {
+ values.push_back(number);
}
- output(" }),\n");
}
+
+ if (!values.empty()) {
+ values_init = EnumInit(e) + "_values";
+ output("static const int32_t $0[$1] = {\n", values_init, values.size());
+ for (int32_t value : values) {
+ output(" $0,\n", value);
+ }
+ output("};\n\n");
+ }
+
+ output("const upb_MiniTable_Enum $0 = {\n", EnumInit(e));
+ output(" $0,\n", values_init);
+ output(" 0x$0ULL,\n", absl::Hex(mask));
+ output(" $0,\n", values.size());
+
output("};\n\n");
}
+ if (!this_file_enums.empty()) {
+ output("static const upb_MiniTable_Enum *$0[$1] = {\n", kEnumsInit,
+ this_file_enums.size());
+ for (const auto* e : this_file_enums) {
+ output(" &$0,\n", EnumInit(e));
+ }
+ output("};\n");
+ output("\n");
+ }
+
+ return this_file_enums.size();
+}
+
+int WriteMessages(const FileLayout& layout, Output& output,
+ bool fasttable_enabled) {
+ const protobuf::FileDescriptor* file = layout.descriptor();
+ std::vector<const protobuf::Descriptor*> file_messages = SortedMessages(file);
+
+ if (file_messages.empty()) return 0;
+
+ for (auto message : file_messages) {
+ WriteMessage(message, layout, output, fasttable_enabled);
+ }
+
+ output("static const upb_MiniTable *$0[$1] = {\n", kMessagesInit,
+ file_messages.size());
+ for (auto message : file_messages) {
+ output(" &$0,\n", MessageInit(message));
+ }
+ output("};\n");
+ output("\n");
+ return file_messages.size();
+}
+
+void WriteExtension(const upb_MiniTable_Extension* ext, Output& output) {
+ WriteField(&ext->field, &ext->field, output);
+ output(",\n");
+ output(" &$0,\n", reinterpret_cast<const char*>(ext->extendee));
+ output(" $0,\n", FilePlatformLayout::GetSub(ext->sub));
+}
+
+int WriteExtensions(const FileLayout& layout, Output& output) {
+ auto exts = SortedExtensions(layout.descriptor());
+ absl::flat_hash_set<const protobuf::Descriptor*> forward_decls;
+
+ if (exts.empty()) return 0;
+
+ // Order by full name for consistent ordering.
+ std::map<std::string, const protobuf::Descriptor*> forward_messages;
+
+ for (auto ext : exts) {
+ forward_messages[ext->containing_type()->full_name()] =
+ ext->containing_type();
+ if (ext->message_type()) {
+ forward_messages[ext->message_type()->full_name()] = ext->message_type();
+ }
+ }
+
+ for (const auto& decl : forward_messages) {
+ output("extern const upb_MiniTable $0;\n", MessageInit(decl.second));
+ }
+
+ for (auto ext : exts) {
+ output("const upb_MiniTable_Extension $0 = {\n ", ExtensionLayout(ext));
+ WriteExtension(layout.GetExtension(ext), output);
+ output("\n};\n");
+ }
+
+ output(
+ "\n"
+ "static const upb_MiniTable_Extension *$0[$1] = {\n",
+ kExtensionsInit, exts.size());
+
+ for (auto ext : exts) {
+ output(" &$0,\n", ExtensionLayout(ext));
+ }
+
+ output(
+ "};\n"
+ "\n");
+ return exts.size();
+}
+
+// Writes a .upb.c source file.
+void WriteSource(const FileLayout& layout, Output& output,
+ bool fasttable_enabled) {
+ const protobuf::FileDescriptor* file = layout.descriptor();
+ EmitFileWarning(file, output);
+
+ output(
+ "#include <stddef.h>\n"
+ "#include \"upb/msg_internal.h\"\n"
+ "#include \"$0\"\n",
+ HeaderFilename(file));
+
+ for (int i = 0; i < file->dependency_count(); i++) {
+ output("#include \"$0\"\n", HeaderFilename(file->dependency(i)));
+ }
+
+ output(
+ "\n"
+ "#include \"upb/port_def.inc\"\n"
+ "\n");
+
+ int msg_count = WriteMessages(file, output, fasttable_enabled);
+ int ext_count = WriteExtensions(layout, output);
+ int enum_count = WriteEnums(file, output);
+
+ output("const upb_MiniTable_File $0 = {\n", FileLayoutName(file));
+ output(" $0,\n", msg_count ? kMessagesInit : "NULL");
+ output(" $0,\n", enum_count ? kEnumsInit : "NULL");
+ output(" $0,\n", ext_count ? kExtensionsInit : "NULL");
+ output(" $0,\n", msg_count);
+ output(" $0,\n", enum_count);
+ output(" $0,\n", ext_count);
+ output("};\n\n");
+
output("#include \"upb/port_undef.inc\"\n");
output("\n");
}
@@ -974,11 +1928,17 @@ bool Generator::Generate(const protobuf::FileDescriptor* file,
}
}
- Output h_output(context->Open(HeaderFilename(file->name())));
- WriteHeader(file, h_output);
+ FileLayout layout(file);
+
+ std::unique_ptr<protobuf::io::ZeroCopyOutputStream> h_output_stream(
+ context->Open(HeaderFilename(file)));
+ Output h_output(h_output_stream.get());
+ WriteHeader(layout, h_output);
- Output c_output(context->Open(SourceFilename(file->name())));
- WriteSource(file, c_output, fasttable_enabled);
+ std::unique_ptr<protobuf::io::ZeroCopyOutputStream> c_output_stream(
+ context->Open(SourceFilename(file)));
+ Output c_output(c_output_stream.get());
+ WriteSource(layout, c_output, fasttable_enabled);
return true;
}
diff --git a/grpc/third_party/upb/upbc/protoc-gen-upbdefs.cc b/grpc/third_party/upb/upbc/protoc-gen-upbdefs.cc
index f51ae079..51b3b959 100644
--- a/grpc/third_party/upb/upbc/protoc-gen-upbdefs.cc
+++ b/grpc/third_party/upb/upbc/protoc-gen-upbdefs.cc
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <memory>
@@ -13,7 +37,7 @@ namespace {
namespace protoc = ::google::protobuf::compiler;
namespace protobuf = ::google::protobuf;
-std::string DefInitSymbol(const protobuf::FileDescriptor *file) {
+std::string DefInitSymbol(const protobuf::FileDescriptor* file) {
return ToCIdent(file->name()) + "_upbdefinit";
}
@@ -26,10 +50,11 @@ static std::string DefSourceFilename(std::string proto_filename) {
}
void GenerateMessageDefAccessor(const protobuf::Descriptor* d, Output& output) {
- output("UPB_INLINE const upb_msgdef *$0_getmsgdef(upb_symtab *s) {\n",
+ output("UPB_INLINE const upb_MessageDef *$0_getmsgdef(upb_DefPool *s) {\n",
ToCIdent(d->full_name()));
- output(" _upb_symtab_loaddefinit(s, &$0);\n", DefInitSymbol(d->file()));
- output(" return upb_symtab_lookupmsg(s, \"$0\");\n", d->full_name());
+ output(" _upb_DefPool_LoadDefInit(s, &$0);\n", DefInitSymbol(d->file()));
+ output(" return upb_DefPool_FindMessageByName(s, \"$0\");\n",
+ d->full_name());
output("}\n");
output("\n");
@@ -56,7 +81,7 @@ void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) {
output("#include \"upb/port_def.inc\"\n");
output("\n");
- output("extern upb_def_init $0;\n", DefInitSymbol(file));
+ output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file));
output("\n");
for (int i = 0; i < file->message_type_count(); i++) {
@@ -74,33 +99,17 @@ void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) {
ToPreproc(file->name()));
}
-
void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) {
EmitFileWarning(file, output);
output("#include \"upb/def.h\"\n");
output("#include \"$0\"\n", DefHeaderFilename(file->name()));
+ output("#include \"$0\"\n", HeaderFilename(file));
output("\n");
for (int i = 0; i < file->dependency_count(); i++) {
- output("extern upb_def_init $0;\n", DefInitSymbol(file->dependency(i)));
- }
-
- std::vector<const protobuf::Descriptor*> file_messages =
- SortedMessages(file);
-
- for (auto message : file_messages) {
- output("extern const upb_msglayout $0;\n", MessageInit(message));
- }
- output("\n");
-
- if (!file_messages.empty()) {
- output("static const upb_msglayout *layouts[$0] = {\n", file_messages.size());
- for (auto message : file_messages) {
- output(" &$0,\n", MessageInit(message));
- }
- output("};\n");
- output("\n");
+ output("extern _upb_DefPool_Init $0;\n",
+ DefInitSymbol(file->dependency(i)));
}
protobuf::FileDescriptorProto file_proto;
@@ -122,7 +131,8 @@ void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) {
}
output("};\n\n");
- output("static upb_def_init *deps[$0] = {\n", file->dependency_count() + 1);
+ output("static _upb_DefPool_Init *deps[$0] = {\n",
+ file->dependency_count() + 1);
for (int i = 0; i < file->dependency_count(); i++) {
output(" &$0,\n", DefInitSymbol(file->dependency(i)));
}
@@ -130,15 +140,11 @@ void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) {
output("};\n");
output("\n");
- output("upb_def_init $0 = {\n", DefInitSymbol(file));
+ output("_upb_DefPool_Init $0 = {\n", DefInitSymbol(file));
output(" deps,\n");
- if (file_messages.empty()) {
- output(" NULL,\n");
- } else {
- output(" layouts,\n");
- }
+ output(" &$0,\n", FileLayoutName(file));
output(" \"$0\",\n", file->name());
- output(" UPB_STRVIEW_INIT(descriptor, $0)\n", file_data.size());
+ output(" UPB_STRINGVIEW_INIT(descriptor, $0)\n", file_data.size());
output("};\n");
}
@@ -164,10 +170,14 @@ bool Generator::Generate(const protobuf::FileDescriptor* file,
return false;
}
- Output h_def_output(context->Open(DefHeaderFilename(file->name())));
+ std::unique_ptr<protobuf::io::ZeroCopyOutputStream> h_output_stream(
+ context->Open(DefHeaderFilename(file->name())));
+ Output h_def_output(h_output_stream.get());
WriteDefHeader(file, h_def_output);
- Output c_def_output(context->Open(DefSourceFilename(file->name())));
+ std::unique_ptr<protobuf::io::ZeroCopyOutputStream> c_output_stream(
+ context->Open(DefSourceFilename(file->name())));
+ Output c_def_output(c_output_stream.get());
WriteDefSource(file, c_def_output);
return true;
diff --git a/grpc/third_party/xxhash/.gitattributes b/grpc/third_party/xxhash/.gitattributes
deleted file mode 100644
index fbcf75b5..00000000
--- a/grpc/third_party/xxhash/.gitattributes
+++ /dev/null
@@ -1,10 +0,0 @@
-# Set the default behavior
-* text eol=lf
-
-# Explicitly declare source files
-*.c text eol=lf
-*.h text eol=lf
-
-# Denote files that should not be modified.
-*.odt binary
-
diff --git a/grpc/third_party/xxhash/.gitignore b/grpc/third_party/xxhash/.gitignore
deleted file mode 100644
index d0ce9aac..00000000
--- a/grpc/third_party/xxhash/.gitignore
+++ /dev/null
@@ -1,47 +0,0 @@
-# objects
-*.o
-*.obj
-*.s
-
-# libraries
-libxxhash.*
-!libxxhash.pc.in
-
-# Executables
-*.exe
-xxh32sum
-xxh64sum
-xxh128sum
-xxhsum
-xxhsum32
-xxhsum_privateXXH
-xxhsum_inlinedXXH
-dispatch
-tests/generate_unicode_test
-
-# compilation chain
-.clang_complete
-
-# Mac OS-X artefacts
-*.dSYM
-.DS_Store
-
-# Wasm / emcc / emscripten artefacts
-*.html
-*.wasm
-*.js
-
-# CMake build directories
-build*/
-
-# project managers artifacts
-.projectile
-
-# analyzer artifacts
-infer-out
-
-# test artifacts
-.test*
-tmp*
-tests/*.unicode
-tests/unicode_test*
diff --git a/grpc/third_party/xxhash/.travis.yml b/grpc/third_party/xxhash/.travis.yml
deleted file mode 100644
index 83476869..00000000
--- a/grpc/third_party/xxhash/.travis.yml
+++ /dev/null
@@ -1,138 +0,0 @@
-language: c
-
-# Dump CPU info before start
-before_install:
- - cat /proc/cpuinfo || echo /proc/cpuinfo is not present
-
-matrix:
- fast_finish: true
- include:
-
- - name: General linux x64 tests
- arch: amd64
- addons:
- apt:
- packages:
- - g++-multilib
- - gcc-multilib
- - cppcheck
- script:
- - make -B test-all
- - make clean
- - CFLAGS="-Werror" MOREFLAGS="-Wno-sign-conversion" make dispatch # removing sign conversion warnings due to a bug in gcc-5's definition of some AVX512 intrinsics
- - make clean
- - CC=g++ CFLAGS="-O1 -mavx512f -Werror" make
- - make clean
- - CC=g++ CFLAGS="-Wall -Wextra -Werror" make DISPATCH=1
-
-
- - name: Check results consistency on x64
- arch: amd64
- script:
- - CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR make check # Scalar code path
- - make clean
- - CPPFLAGS=-DXXH_VECTOR=XXH_SSE2 make check # SSE2 code path
- - make clean
- - CPPFLAGS="-mavx2 -DXXH_VECTOR=XXH_AVX2" make check # AVX2 code path
- - make clean
- - CPPFLAGS="-mavx512f -DXXH_VECTOR=XXH_AVX512" make check # AVX512 code path
- - make clean
- - CPPFLAGS=-DXXH_REROLL=1 make check # reroll code path (#240)
- - make -C tests/bench
-
- - name: macOS General Test
- os: osx
- compiler: clang
- script:
- - CFLAGS="-Werror" make # test library build
- - make clean
- - make test MOREFLAGS='-Werror' | tee # test scenario where `stdout` is not the console
-
- - name: ARM compilation and consistency checks (Qemu)
- dist: xenial
- arch: amd64
- addons:
- apt:
- packages:
- - qemu-system-arm
- - qemu-user-static
- - gcc-arm-linux-gnueabi
- - libc6-dev-armel-cross
- script:
- # arm (32-bit)
- - CC=arm-linux-gnueabi-gcc CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR LDFLAGS=-static RUN_ENV=qemu-arm-static make check # Scalar code path
- - make clean
- # NEON (32-bit)
- - CC=arm-linux-gnueabi-gcc CPPFLAGS=-DXXH_VECTOR=XXH_NEON CFLAGS="-O3 -march=armv7-a -fPIC -mfloat-abi=softfp -mfpu=neon-vfpv4" LDFLAGS=-static RUN_ENV=qemu-arm-static make check # NEON code path
-
- - name: aarch64 compilation and consistency checks
- dist: xenial
- arch: arm64
- script:
- # aarch64
- - CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR make check # Scalar code path
- # NEON (64-bit)
- - make clean
- - CPPFLAGS=-DXXH_VECTOR=XXH_NEON make check # NEON code path
- # clang
- - make clean
- - CC=clang CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR make check # Scalar code path
- # clang + NEON
- - make clean
- - CC=clang CPPFLAGS=-DXXH_VECTOR=XXH_NEON make check # NEON code path
-
- # We need Bionic here because the QEMU versions shipped in the older repos
- # do not support POWER8 emulation, and compiling QEMU from source is a pain.
- - name: PowerPC + PPC64 compilation and consistency checks (Qemu on Bionic)
- dist: bionic
- arch: amd64
- addons:
- apt:
- packages:
- - qemu-system-ppc
- - qemu-user-static
- - gcc-powerpc-linux-gnu
- - gcc-powerpc64-linux-gnu
- - libc6-dev-powerpc-cross
- - libc6-dev-ppc64-cross
- script:
- - CC=powerpc-linux-gnu-gcc RUN_ENV=qemu-ppc-static LDFLAGS=-static make check # Scalar code path
- - make clean
- - CC=powerpc64-linux-gnu-gcc RUN_ENV=qemu-ppc64-static CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR CFLAGS="-O3" LDFLAGS="-static -m64" make check # Scalar code path
- # VSX code
- - make clean
- - CC=powerpc64-linux-gnu-gcc RUN_ENV="qemu-ppc64-static -cpu power8" CPPFLAGS=-DXXH_VECTOR=XXH_VSX CFLAGS="-O3 -maltivec -mvsx -mcpu=power8 -mpower8-vector" LDFLAGS="-static -m64" make check # VSX code path
- # altivec.h redefinition issue #426
- - make clean
- - CC=powerpc64-linux-gnu-gcc CPPFLAGS=-DXXH_VECTOR=XXH_VSX CFLAGS="-maltivec -mvsx -mcpu=power8 -mpower8-vector" make -C tests test_ppc_redefine
-
- - name: PPC64LE compilation and consistency checks
- dist: xenial
- arch: ppc64le
- script:
- # Scalar (universal) code path
- - CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR LDFLAGS=-static make check
- # VSX code path (64-bit)
- - make clean
- - CPPFLAGS=-DXXH_VECTOR=XXH_VSX CFLAGS="-O3 -maltivec -mvsx -mpower8-vector -mcpu=power8" LDFLAGS="-static" make check
- # altivec.h redefinition issue #426
- - make clean
- - CPPFLAGS=-DXXH_VECTOR=XXH_VSX CFLAGS="-maltivec -mvsx -mcpu=power8 -mpower8-vector" make -C tests test_ppc_redefine
-
- - name: IBM s390x compilation and consistency checks
- dist: bionic
- arch: s390x
- script:
- # Scalar (universal) code path
- - CPPFLAGS=-DXXH_VECTOR=XXH_SCALAR LDFLAGS=-static make check
- # s390x code path (64-bit)
- - make clean
- - CPPFLAGS=-DXXH_VECTOR=XXH_VSX CFLAGS="-O3 -march=arch11 -mzvector" LDFLAGS="-static" make check
-
- - name: cmake build test
- script:
- - cd cmake_unofficial
- - mkdir build
- - cd build
- - cmake ..
- - CFLAGS=-Werror make
diff --git a/grpc/third_party/xxhash/CHANGELOG b/grpc/third_party/xxhash/CHANGELOG
deleted file mode 100644
index 23870756..00000000
--- a/grpc/third_party/xxhash/CHANGELOG
+++ /dev/null
@@ -1,52 +0,0 @@
-v0.8.0
-- api : stabilize XXH3
-- cli : xxhsum can parse BSD-style --check lines, by @WayneD
-- cli : `xxhsum -` accepts console input, requested by @jaki
-- cli : xxhsum accepts -- separator, by @jaki
-- cli : fix : print correct default algo for symlinked helpers, by @martinetd
-- install: improved pkgconfig script, allowing custom install locations, requested by @ellert
-
-v0.7.4
-- perf: automatic vector detection and selection at runtime (`xxh_x86dispatch.h`), initiated by @easyaspi314
-- perf: added AVX512 support, by @gzm55
-- api : new: secret generator `XXH_generateSecret()`, suggested by @koraa
-- api : fix: XXH3_state_t is movable, identified by @koraa
-- api : fix: state is correctly aligned in AVX mode (unlike `malloc()`), by @easyaspi314
-- api : fix: streaming generated wrong values in some combination of random ingestion lengths, reported by @WayneD
-- cli : fix unicode print on Windows, by @easyaspi314
-- cli : can `-c` check file generated by sfv
-- build: `make DISPATCH=1` generates `xxhsum` and `libxxhash` with runtime vector detection (x86/x64 only)
-- install: cygwin installation support
-- doc : Cryptol specification of XXH32 and XXH64, by @weaversa
-
-v0.7.3
-- perf: improved speed for large inputs (~+20%)
-- perf: improved latency for small inputs (~10%)
-- perf: s390x Vectorial code, by @easyaspi314
-- cli: improved support for Unicode filenames on Windows, thanks to @easyaspi314 and @t-mat
-- api: `xxhash.h` can now be included in any order, with and without `XXH_STATIC_LINKING_ONLY` and `XXH_INLINE_ALL`
-- build: xxHash's implementation transferred into `xxhash.h`. No more need to have `xxhash.c` in the `/include` directory for `XXH_INLINE_ALL` to work
-- install: created pkg-config file, by @bket
-- install: VCpkg installation instructions, by @LilyWangL
-- doc: Highly improved code documentation, by @easyaspi314
-- misc: New test tool in `/tests/collisions`: brute force collision tester for 64-bit hashes
-
-v0.7.2
-- Fixed collision ratio of `XXH128` for some specific input lengths, reported by @svpv
-- Improved `VSX` and `NEON` variants, by @easyaspi314
-- Improved performance of scalar code path (`XXH_VECTOR=0`), by @easyaspi314
-- `xxhsum`: can generate 128-bit hashes with the `-H2` option (note: for experimental purposes only! `XXH128` is not yet frozen)
-- `xxhsum`: option `-q` removes status notifications
-
-v0.7.1
-- Secret first: the algorithm computation can be altered by providing a "secret", which is any blob of bytes, of size >= `XXH3_SECRET_SIZE_MIN`.
-- `seed` is still available, and acts as a secret generator
-- updated `ARM NEON` variant by @easyaspi314
-- Streaming implementation is available
-- Improve compatibility and performance with Visual Studio, with help from @aras-p
-- Better integration when using `XXH_INLINE_ALL`: do not pollute host namespace, use its own macros, such as `XXH_ASSERT()`, `XXH_ALIGN`, etc.
-- 128-bit variant provides helper functions for comparison of hashes.
-- Better `clang` generation of `rotl` instruction, thanks to @easyaspi314
-- `XXH_REROLL` build macro to reduce binary size, by @easyaspi314
-- Improved `cmake` script, by @Mezozoysky
-- Full benchmark program provided in `/tests/bench`
diff --git a/grpc/third_party/xxhash/Doxyfile b/grpc/third_party/xxhash/Doxyfile
deleted file mode 100644
index 634e1e1a..00000000
--- a/grpc/third_party/xxhash/Doxyfile
+++ /dev/null
@@ -1,58 +0,0 @@
-# Doxygen config for xxHash
-DOXYFILE_ENCODING = UTF-8
-
-PROJECT_NAME = "xxHash"
-PROJECT_NUMBER = "0.8.0"
-PROJECT_BRIEF = "Extremely fast non-cryptographic hash function"
-OUTPUT_DIRECTORY = doxygen
-OUTPUT_LANGUAGE = English
-
-# We already separate the internal docs.
-INTERNAL_DOCS = YES
-# Consistency
-SORT_MEMBER_DOCS = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-
-# Warnings
-QUIET = YES
-# Until we document everything
-WARN_IF_UNDOCUMENTED = NO
-
-# TODO: Add the other files. It is just xxhash.h for now.
-FILE_PATTERNS = xxhash.h xxh_x86dispatch.c
-# Note: xxHash's source files are technically ASCII only.
-INPUT_ENCODING = UTF-8
-TAB_SIZE = 4
-MARKDOWN_SUPPORT = YES
-
-# xxHash is a C library
-OPTIMIZE_OUTPUT_FOR_C = YES
-# So we can document the internals
-EXTRACT_STATIC = YES
-# Document the macros
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-# Predefine some macros to clean up the output.
-PREDEFINED = "XXH_DOXYGEN=" \
- "XXH_PUBLIC_API=" \
- "XXH_FORCE_INLINE=static inline" \
- "XXH_NO_INLINE=static" \
- "XXH_RESTRICT=restrict" \
- "XSUM_API=" \
- "XXH_STATIC_LINKING_ONLY" \
- "XXH_IMPLEMENTATION" \
- "XXH_ALIGN(N)=alignas(N)" \
- "XXH_ALIGN_MEMBER(align,type)=alignas(align) type"
-
-# We want HTML docs
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-# Tweak the colors a bit
-HTML_COLORSTYLE_HUE = 220
-HTML_COLORSTYLE_GAMMA = 100
-HTML_COLORSTYLE_SAT = 100
-
-# We don't want LaTeX.
-GENERATE_LATEX = NO
diff --git a/grpc/third_party/xxhash/LICENSE b/grpc/third_party/xxhash/LICENSE
index fa20595d..6bc30a1b 100644
--- a/grpc/third_party/xxhash/LICENSE
+++ b/grpc/third_party/xxhash/LICENSE
@@ -24,25 +24,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-----------------------------------------------------
-
-xxhsum command line interface
-Copyright (c) 2013-2020 Yann Collet
-All rights reserved.
-
-GPL v2 License
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
diff --git a/grpc/third_party/xxhash/Makefile b/grpc/third_party/xxhash/Makefile
deleted file mode 100644
index 23cf4a8c..00000000
--- a/grpc/third_party/xxhash/Makefile
+++ /dev/null
@@ -1,506 +0,0 @@
-# ################################################################
-# xxHash Makefile
-# Copyright (C) 2012-2020 Yann Collet
-#
-# GPL v2 License
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# You can contact the author at:
-# - xxHash homepage: https://www.xxhash.com
-# - xxHash source repository: https://github.com/Cyan4973/xxHash
-# ################################################################
-# xxhsum: provides 32/64 bits hash of one or multiple files, or stdin
-# ################################################################
-Q = $(if $(filter 1,$(V) $(VERBOSE)),,@)
-
-# Version numbers
-SED ?= sed
-SED_ERE_OPT ?= -E
-LIBVER_MAJOR_SCRIPT:=`$(SED) -n '/define XXH_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
-LIBVER_MINOR_SCRIPT:=`$(SED) -n '/define XXH_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
-LIBVER_PATCH_SCRIPT:=`$(SED) -n '/define XXH_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
-LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
-LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
-LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
-LIBVER := $(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
-
-CFLAGS ?= -O3
-DEBUGFLAGS+=-Wall -Wextra -Wconversion -Wcast-qual -Wcast-align -Wshadow \
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement \
- -Wstrict-prototypes -Wundef -Wpointer-arith -Wformat-security \
- -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings \
- -Wredundant-decls -Wstrict-overflow=2
-CFLAGS += $(DEBUGFLAGS) $(MOREFLAGS)
-FLAGS = $(CFLAGS) $(CPPFLAGS)
-XXHSUM_VERSION = $(LIBVER)
-UNAME := $(shell uname)
-
-# Define *.exe as extension for Windows systems
-ifneq (,$(filter Windows%,$(OS)))
-EXT =.exe
-else
-EXT =
-endif
-
-# OS X linker doesn't support -soname, and use different extension
-# see: https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
-ifeq ($(UNAME), Darwin)
- SHARED_EXT = dylib
- SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT)
- SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
- SONAME_FLAGS = -install_name $(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER)
-else
- SONAME_FLAGS = -Wl,-soname=libxxhash.$(SHARED_EXT).$(LIBVER_MAJOR)
- SHARED_EXT = so
- SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
- SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
-endif
-
-LIBXXH = libxxhash.$(SHARED_EXT_VER)
-
-XXHSUM_SRC_DIR = cli
-XXHSUM_SPLIT_SRCS = $(XXHSUM_SRC_DIR)/xsum_os_specific.c \
- $(XXHSUM_SRC_DIR)/xsum_output.c \
- $(XXHSUM_SRC_DIR)/xsum_sanity_check.c
-XXHSUM_SPLIT_OBJS = $(XXHSUM_SPLIT_SRCS:.c=.o)
-XXHSUM_HEADERS = $(XXHSUM_SRC_DIR)/xsum_config.h \
- $(XXHSUM_SRC_DIR)/xsum_arch.h \
- $(XXHSUM_SRC_DIR)/xsum_os_specific.h \
- $(XXHSUM_SRC_DIR)/xsum_output.h \
- $(XXHSUM_SRC_DIR)/xsum_sanity_check.h
-
-## generate CLI and libraries in release mode (default for `make`)
-.PHONY: default
-default: DEBUGFLAGS=
-default: lib xxhsum_and_links
-
-.PHONY: all
-all: lib xxhsum xxhsum_inlinedXXH
-
-## xxhsum is the command line interface (CLI)
-ifeq ($(DISPATCH),1)
-xxhsum: CPPFLAGS += -DXXHSUM_DISPATCH=1
-xxhsum: xxh_x86dispatch.o
-endif
-xxhsum: xxhash.o xxhsum.o $(XXHSUM_SPLIT_OBJS)
- $(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)
-
-xxhsum32: CFLAGS += -m32 ## generate CLI in 32-bits mode
-xxhsum32: xxhash.c xxhsum.c $(XXHSUM_SPLIT_SRCS) ## do not generate object (avoid mixing different ABI)
- $(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)
-
-## dispatch only works for x86/x64 systems
-dispatch: CPPFLAGS += -DXXHSUM_DISPATCH=1
-dispatch: xxhash.o xxh_x86dispatch.o xxhsum.c $(XXHSUM_SPLIT_SRCS)
- $(CC) $(FLAGS) $^ $(LDFLAGS) -o $@$(EXT)
-
-xxhash.o: xxhash.c xxhash.h
-xxhsum.o: xxhsum.c $(XXHSUM_HEADERS) \
- xxhash.h xxh_x86dispatch.h
-xxh_x86dispatch.o: xxh_x86dispatch.c xxh_x86dispatch.h xxhash.h
-
-.PHONY: xxhsum_and_links
-xxhsum_and_links: xxhsum xxh32sum xxh64sum xxh128sum
-
-xxh32sum xxh64sum xxh128sum: xxhsum
- ln -sf $<$(EXT) $@$(EXT)
-
-xxhsum_inlinedXXH: CPPFLAGS += -DXXH_INLINE_ALL
-xxhsum_inlinedXXH: xxhsum.c $(XXHSUM_SPLIT_SRCS)
- $(CC) $(FLAGS) $< -o $@$(EXT)
-
-
-# library
-
-libxxhash.a: ARFLAGS = rcs
-libxxhash.a: xxhash.o
- $(AR) $(ARFLAGS) $@ $^
-
-$(LIBXXH): LDFLAGS += -shared
-ifeq (,$(filter Windows%,$(OS)))
-$(LIBXXH): CFLAGS += -fPIC
-endif
-ifeq ($(DISPATCH),1)
-$(LIBXXH): xxh_x86dispatch.c
-endif
-$(LIBXXH): xxhash.c
- $(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
- ln -sf $@ libxxhash.$(SHARED_EXT_MAJOR)
- ln -sf $@ libxxhash.$(SHARED_EXT)
-
-.PHONY: libxxhash
-libxxhash: ## generate dynamic xxhash library
-libxxhash: $(LIBXXH)
-
-.PHONY: lib
-lib: ## generate static and dynamic xxhash libraries
-lib: libxxhash.a libxxhash
-
-# helper targets
-
-AWK = awk
-GREP = grep
-SORT = sort
-
-.PHONY: list
-list: ## list all Makefile targets
- $(Q)$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | $(AWK) -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | $(SORT) | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
-
-.PHONY: help
-help: ## list documented targets
- $(Q)$(GREP) -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
- $(SORT) | \
- $(AWK) 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-
-.PHONY: clean
-clean: ## remove all build artifacts
- $(Q)$(RM) -r *.dSYM # Mac OS-X specific
- $(Q)$(RM) core *.o *.obj *.$(SHARED_EXT) *.$(SHARED_EXT).* *.a libxxhash.pc
- $(Q)$(RM) xxhsum$(EXT) xxhsum32$(EXT) xxhsum_inlinedXXH$(EXT) dispatch$(EXT)
- $(Q)$(RM) xxh32sum$(EXT) xxh64sum$(EXT) xxh128sum$(EXT)
- $(Q)$(RM) $(XXHSUM_SRC_DIR)/*.o $(XXHSUM_SRC_DIR)/*.obj
- @echo cleaning completed
-
-
-# =================================================
-# tests
-# =================================================
-
-# make check can be run with cross-compiled binaries on emulated environments (qemu user mode)
-# by setting $(RUN_ENV) to the target emulation environment
-.PHONY: check
-check: xxhsum ## basic tests for xxhsum CLI, set RUN_ENV for emulated environments
- # stdin
- $(RUN_ENV) ./xxhsum$(EXT) < xxhash.c
- # multiple files
- $(RUN_ENV) ./xxhsum$(EXT) xxhash.* xxhsum.*
- # internal bench
- $(RUN_ENV) ./xxhsum$(EXT) -bi0
- # long bench command
- $(RUN_ENV) ./xxhsum$(EXT) --benchmark-all -i0
- # bench multiple variants
- $(RUN_ENV) ./xxhsum$(EXT) -b1,2,3 -i0
- # file bench
- $(RUN_ENV) ./xxhsum$(EXT) -bi0 xxhash.c
- # 32-bit
- $(RUN_ENV) ./xxhsum$(EXT) -H0 xxhash.c
- # 128-bit
- $(RUN_ENV) ./xxhsum$(EXT) -H2 xxhash.c
- # request incorrect variant
- $(RUN_ENV) ./xxhsum$(EXT) -H9 xxhash.c ; test $$? -eq 1
- @printf "\n ....... checks completed successfully ....... \n"
-
-.PHONY: test-unicode
-test-unicode:
- $(MAKE) -C tests test_unicode
-
-.PHONY: test-mem
-VALGRIND = valgrind --leak-check=yes --error-exitcode=1
-test-mem: RUN_ENV = $(VALGRIND)
-test-mem: xxhsum check
-
-.PHONY: test32
-test32: clean xxhsum32
- @echo ---- test 32-bit ----
- ./xxhsum32 -bi1 xxhash.c
-
-.PHONY: test-xxhsum-c
-test-xxhsum-c: xxhsum
- # xxhsum to/from pipe
- ./xxhsum xxh* | ./xxhsum -c -
- ./xxhsum -H0 xxh* | ./xxhsum -c -
- # xxhsum -q does not display "Loading" message into stderr (#251)
- ! ./xxhsum -q xxh* 2>&1 | grep Loading
- # xxhsum does not display "Loading" message into stderr either
- ! ./xxhsum xxh* 2>&1 | grep Loading
- # Check that xxhsum do display filename that it failed to open.
- LC_ALL=C ./xxhsum nonexistent 2>&1 | grep "Error: Could not open 'nonexistent'"
- # xxhsum to/from file, shell redirection
- ./xxhsum xxh* > .test.xxh64
- ./xxhsum --tag xxh* > .test.xxh64_tag
- ./xxhsum --little-endian xxh* > .test.le_xxh64
- ./xxhsum --tag --little-endian xxh* > .test.le_xxh64_tag
- ./xxhsum -H0 xxh* > .test.xxh32
- ./xxhsum -H0 --tag xxh* > .test.xxh32_tag
- ./xxhsum -H0 --little-endian xxh* > .test.le_xxh32
- ./xxhsum -H0 --tag --little-endian xxh* > .test.le_xxh32_tag
- ./xxhsum -H2 xxh* > .test.xxh128
- ./xxhsum -H2 --tag xxh* > .test.xxh128_tag
- ./xxhsum -H2 --little-endian xxh* > .test.le_xxh128
- ./xxhsum -H2 --tag --little-endian xxh* > .test.le_xxh128_tag
- ./xxhsum -c .test.xxh*
- ./xxhsum -c --little-endian .test.le_xxh*
- ./xxhsum -c .test.*_tag
- # read list of files from stdin
- ./xxhsum -c < .test.xxh64
- ./xxhsum -c < .test.xxh32
- cat .test.xxh* | ./xxhsum -c -
- # check variant with '*' marker as second separator
- $(SED) 's/ / \*/' .test.xxh32 | ./xxhsum -c
- # bsd-style output
- ./xxhsum --tag xxhsum* | $(GREP) XXH64
- ./xxhsum --tag -H0 xxhsum* | $(GREP) XXH32
- ./xxhsum --tag -H1 xxhsum* | $(GREP) XXH64
- ./xxhsum --tag -H2 xxhsum* | $(GREP) XXH128
- ./xxhsum --tag -H32 xxhsum* | $(GREP) XXH32
- ./xxhsum --tag -H64 xxhsum* | $(GREP) XXH64
- ./xxhsum --tag -H128 xxhsum* | $(GREP) XXH128
- ./xxhsum --tag -H0 --little-endian xxhsum* | $(GREP) XXH32_LE
- ./xxhsum --tag -H1 --little-endian xxhsum* | $(GREP) XXH64_LE
- ./xxhsum --tag -H2 --little-endian xxhsum* | $(GREP) XXH128_LE
- ./xxhsum --tag -H32 --little-endian xxhsum* | $(GREP) XXH32_LE
- ./xxhsum --tag -H64 --little-endian xxhsum* | $(GREP) XXH64_LE
- ./xxhsum --tag -H128 --little-endian xxhsum* | $(GREP) XXH128_LE
- # check bsd-style
- ./xxhsum --tag xxhsum* | ./xxhsum -c
- ./xxhsum --tag -H32 --little-endian xxhsum* | ./xxhsum -c
- # xxhsum -c warns improperly format lines.
- echo '12345678 ' >>.test.xxh32
- ./xxhsum -c .test.xxh32 | $(GREP) improperly
- echo '123456789 file' >>.test.xxh64
- ./xxhsum -c .test.xxh64 | $(GREP) improperly
- # Expects "FAILED"
- echo "0000000000000000 LICENSE" | ./xxhsum -c -; test $$? -eq 1
- echo "00000000 LICENSE" | ./xxhsum -c -; test $$? -eq 1
- # Expects "FAILED open or read"
- echo "0000000000000000 test-expects-file-not-found" | ./xxhsum -c -; test $$? -eq 1
- echo "00000000 test-expects-file-not-found" | ./xxhsum -c -; test $$? -eq 1
- @$(RM) .test.*
-
-.PHONY: armtest
-armtest: clean
- @echo ---- test ARM compilation ----
- CC=arm-linux-gnueabi-gcc MOREFLAGS="-Werror -static" $(MAKE) xxhsum
-
-.PHONY: clangtest
-clangtest: clean
- @echo ---- test clang compilation ----
- CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion" $(MAKE) all
-
-.PHONY: cxxtest
-cxxtest: clean
- @echo ---- test C++ compilation ----
- CC="$(CXX) -Wno-deprecated" $(MAKE) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror -fPIC"
-
-.PHONY: c90test
-ifeq ($(NO_C90_TEST),true)
-c90test:
- @echo no c90 compatibility test
-else
-c90test: CPPFLAGS += -DXXH_NO_LONG_LONG
-c90test: CFLAGS += -std=c90 -Werror -pedantic
-c90test: xxhash.c
- @echo ---- test strict C90 compilation [xxh32 only] ----
- $(RM) xxhash.o
- $(CC) $(FLAGS) $^ $(LDFLAGS) -c
- $(RM) xxhash.o
-endif
-
-.PHONY: usan
-usan: CC=clang
-usan: CXX=clang++
-usan: ## check CLI runtime for undefined behavior, using clang's sanitizer
- @echo ---- check undefined behavior - sanitize ----
- $(MAKE) clean
- $(MAKE) test CC=$(CC) CXX=$(CXX) MOREFLAGS="-g -fsanitize=undefined -fno-sanitize-recover=all"
-
-.PHONY: staticAnalyze
-SCANBUILD ?= scan-build
-staticAnalyze: clean ## check C source files using $(SCANBUILD) static analyzer
- @echo ---- static analyzer - $(SCANBUILD) ----
- CFLAGS="-g -Werror" $(SCANBUILD) --status-bugs -v $(MAKE) all
-
-CPPCHECK ?= cppcheck
-.PHONY: cppcheck
-cppcheck: ## check C source files using $(CPPCHECK) static analyzer
- @echo ---- static analyzer - $(CPPCHECK) ----
- $(CPPCHECK) . --force --enable=warning,portability,performance,style --error-exitcode=1 > /dev/null
-
-.PHONY: namespaceTest
-namespaceTest: ## ensure XXH_NAMESPACE redefines all public symbols
- $(CC) -c xxhash.c
- $(CC) -DXXH_NAMESPACE=TEST_ -c xxhash.c -o xxhash2.o
- $(CC) xxhash.o xxhash2.o xxhsum.c $(XXHSUM_SPLIT_SRCS) -o xxhsum2 # will fail if one namespace missing (symbol collision)
- $(RM) *.o xxhsum2 # clean
-
-MD2ROFF ?= ronn
-MD2ROFF_FLAGS ?= --roff --warnings --manual="User Commands" --organization="xxhsum $(XXHSUM_VERSION)"
-xxhsum.1: xxhsum.1.md xxhash.h
- cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | $(SED) -n '/^\.\\\".*/!p' > $@
-
-.PHONY: man
-man: xxhsum.1 ## generate man page from markdown source
-
-.PHONY: clean-man
-clean-man:
- $(RM) xxhsum.1
-
-.PHONY: preview-man
-preview-man: man
- man ./xxhsum.1
-
-.PHONY: test
-test: DEBUGFLAGS += -DXXH_DEBUGLEVEL=1
-test: all namespaceTest check test-xxhsum-c c90test test-tools
-
-.PHONY: test-inline
-test-inline:
- $(MAKE) -C tests test_multiInclude
-
-.PHONY: test-all
-test-all: CFLAGS += -Werror
-test-all: test test32 clangtest cxxtest usan test-inline listL120 trailingWhitespace test-unicode
-
-.PHONY: test-tools
-test-tools:
- CFLAGS=-Werror $(MAKE) -C tests/bench
- CFLAGS=-Werror $(MAKE) -C tests/collisions
-
-.PHONY: listL120
-listL120: # extract lines >= 120 characters in *.{c,h}, by Takayuki Matsuoka (note: $$, for Makefile compatibility)
- find . -type f -name '*.c' -o -name '*.h' | while read -r filename; do awk 'length > 120 {print FILENAME "(" FNR "): " $$0}' $$filename; done
-
-.PHONY: trailingWhitespace
-trailingWhitespace:
- ! $(GREP) -E "`printf '[ \\t]$$'`" xxhsum.1 *.c *.h LICENSE Makefile cmake_unofficial/CMakeLists.txt
-
-
-# =========================================================
-# make install is validated only for the following targets
-# =========================================================
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU Haiku OpenBSD FreeBSD NetBSD DragonFly SunOS CYGWIN% , $(UNAME)))
-
-DESTDIR ?=
-# directory variables: GNU conventions prefer lowercase
-# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
-# support both lower and uppercase (BSD), use uppercase in script
-prefix ?= /usr/local
-PREFIX ?= $(prefix)
-exec_prefix ?= $(PREFIX)
-EXEC_PREFIX ?= $(exec_prefix)
-libdir ?= $(EXEC_PREFIX)/lib
-LIBDIR ?= $(libdir)
-includedir ?= $(PREFIX)/include
-INCLUDEDIR ?= $(includedir)
-bindir ?= $(EXEC_PREFIX)/bin
-BINDIR ?= $(bindir)
-datarootdir ?= $(PREFIX)/share
-mandir ?= $(datarootdir)/man
-man1dir ?= $(mandir)/man1
-
-ifneq (,$(filter $(UNAME),FreeBSD NetBSD DragonFly))
-PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
-else
-PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
-endif
-
-ifneq (,$(filter $(UNAME),OpenBSD FreeBSD NetBSD DragonFly SunOS))
-MANDIR ?= $(PREFIX)/man/man1
-else
-MANDIR ?= $(man1dir)
-endif
-
-ifneq (,$(filter $(UNAME),SunOS))
-INSTALL ?= ginstall
-else
-INSTALL ?= install
-endif
-
-INSTALL_PROGRAM ?= $(INSTALL)
-INSTALL_DATA ?= $(INSTALL) -m 644
-
-
-PCLIBDIR ?= $(shell echo "$(LIBDIR)" | $(SED) -n $(SED_ERE_OPT) -e "s@^$(EXEC_PREFIX)(/|$$)@@p")
-PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | $(SED) -n $(SED_ERE_OPT) -e "s@^$(PREFIX)(/|$$)@@p")
-PCEXECDIR?= $(if $(filter $(PREFIX),$(EXEC_PREFIX)),$$\{prefix\},$(EXEC_PREFIX))
-
-ifeq (,$(PCLIBDIR))
-# Additional prefix check is required, since the empty string is technically a
-# valid PCLIBDIR
-ifeq (,$(shell echo "$(LIBDIR)" | $(SED) -n $(SED_ERE_OPT) -e "\\@^$(EXEC_PREFIX)(/|$$)@ p"))
-$(error configured libdir ($(LIBDIR)) is outside of exec_prefix ($(EXEC_PREFIX)), can't generate pkg-config file)
-endif
-endif
-
-ifeq (,$(PCINCDIR))
-# Additional prefix check is required, since the empty string is technically a
-# valid PCINCDIR
-ifeq (,$(shell echo "$(INCLUDEDIR)" | $(SED) -n $(SED_ERE_OPT) -e "\\@^$(PREFIX)(/|$$)@ p"))
-$(error configured includedir ($(INCLUDEDIR)) is outside of prefix ($(PREFIX)), can't generate pkg-config file)
-endif
-endif
-
-libxxhash.pc: libxxhash.pc.in
- @echo creating pkgconfig
- $(Q)$(SED) $(SED_ERE_OPT) -e 's|@PREFIX@|$(PREFIX)|' \
- -e 's|@EXECPREFIX@|$(PCEXECDIR)|' \
- -e 's|@LIBDIR@|$(PCLIBDIR)|' \
- -e 's|@INCLUDEDIR@|$(PCINCDIR)|' \
- -e 's|@VERSION@|$(LIBVER)|' \
- $< > $@
-
-
-.PHONY: install
-install: lib libxxhash.pc xxhsum ## install libraries, CLI, links and man page
- @echo Installing libxxhash
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
- $(Q)$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
- $(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
- $(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
- $(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR) # includes
- $(Q)$(INSTALL_DATA) xxhash.h $(DESTDIR)$(INCLUDEDIR)
- $(Q)$(INSTALL_DATA) xxh3.h $(DESTDIR)$(INCLUDEDIR) # for compatibility, will be removed in v0.9.0
-ifeq ($(DISPATCH),1)
- $(Q)$(INSTALL_DATA) xxh_x86dispatch.h $(DESTDIR)$(INCLUDEDIR)
-endif
- @echo Installing pkgconfig
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
- $(Q)$(INSTALL_DATA) libxxhash.pc $(DESTDIR)$(PKGCONFIGDIR)/
- @echo Installing xxhsum
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
- $(Q)$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
- $(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
- $(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh64sum
- $(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh128sum
- @echo Installing man pages
- $(Q)$(INSTALL_DATA) xxhsum.1 $(DESTDIR)$(MANDIR)/xxhsum.1
- $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
- $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
- $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
- @echo xxhash installation completed
-
-.PHONY: uninstall
-uninstall: ## uninstall libraries, CLI, links and man page
- $(Q)$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.a
- $(Q)$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
- $(Q)$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
- $(Q)$(RM) $(DESTDIR)$(LIBDIR)/$(LIBXXH)
- $(Q)$(RM) $(DESTDIR)$(INCLUDEDIR)/xxhash.h
- $(Q)$(RM) $(DESTDIR)$(INCLUDEDIR)/xxh3.h
- $(Q)$(RM) $(DESTDIR)$(INCLUDEDIR)/xxh_x86dispatch.h
- $(Q)$(RM) $(DESTDIR)$(PKGCONFIGDIR)/libxxhash.pc
- $(Q)$(RM) $(DESTDIR)$(BINDIR)/xxh32sum
- $(Q)$(RM) $(DESTDIR)$(BINDIR)/xxh64sum
- $(Q)$(RM) $(DESTDIR)$(BINDIR)/xxh128sum
- $(Q)$(RM) $(DESTDIR)$(BINDIR)/xxhsum
- $(Q)$(RM) $(DESTDIR)$(MANDIR)/xxh32sum.1
- $(Q)$(RM) $(DESTDIR)$(MANDIR)/xxh64sum.1
- $(Q)$(RM) $(DESTDIR)$(MANDIR)/xxh128sum.1
- $(Q)$(RM) $(DESTDIR)$(MANDIR)/xxhsum.1
- @echo xxhsum successfully uninstalled
-
-endif
diff --git a/grpc/third_party/xxhash/README.md b/grpc/third_party/xxhash/README.md
deleted file mode 100644
index 7d9ae9dd..00000000
--- a/grpc/third_party/xxhash/README.md
+++ /dev/null
@@ -1,235 +0,0 @@
-
-xxHash - Extremely fast hash algorithm
-======================================
-
-xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
-It successfully completes the [SMHasher](https://code.google.com/p/smhasher/wiki/SMHasher) test suite
-which evaluates collision, dispersion and randomness qualities of hash functions.
-Code is highly portable, and hashes are identical across all platforms (little / big endian).
-
-|Branch |Status |
-|------------|---------|
-|dev | [![Build Status](https://travis-ci.org/Cyan4973/xxHash.svg?branch=dev)](https://travis-ci.org/Cyan4973/xxHash?branch=dev) |
-
-
-Benchmarks
--------------------------
-
-The reference system uses an Intel i7-9700K cpu, and runs Ubuntu x64 20.04.
-The [open source benchmark program] is compiled with `clang` v10.0 using `-O3` flag.
-
-| Hash Name | Width | Bandwidth (GB/s) | Small Data Velocity | Quality | Comment |
-| --------- | ----- | ---------------- | ----- | --- | --- |
-| __XXH3__ (SSE2) | 64 | 31.5 GB/s | 133.1 | 10
-| __XXH128__ (SSE2) | 128 | 29.6 GB/s | 118.1 | 10
-| _RAM sequential read_ | N/A | 28.0 GB/s | N/A | N/A | _for reference_
-| City64 | 64 | 22.0 GB/s | 76.6 | 10
-| T1ha2 | 64 | 22.0 GB/s | 99.0 | 9 | Slightly worse [collisions]
-| City128 | 128 | 21.7 GB/s | 57.7 | 10
-| __XXH64__ | 64 | 19.4 GB/s | 71.0 | 10
-| SpookyHash | 64 | 19.3 GB/s | 53.2 | 10
-| Mum | 64 | 18.0 GB/s | 67.0 | 9 | Slightly worse [collisions]
-| __XXH32__ | 32 | 9.7 GB/s | 71.9 | 10
-| City32 | 32 | 9.1 GB/s | 66.0 | 10
-| Murmur3 | 32 | 3.9 GB/s | 56.1 | 10
-| SipHash | 64 | 3.0 GB/s | 43.2 | 10
-| FNV64 | 64 | 1.2 GB/s | 62.7 | 5 | Poor avalanche properties
-| Blake2 | 256 | 1.1 GB/s | 5.1 | 10 | Cryptographic
-| SHA1 | 160 | 0.8 GB/s | 5.6 | 10 | Cryptographic but broken
-| MD5 | 128 | 0.6 GB/s | 7.8 | 10 | Cryptographic but broken
-
-[open source benchmark program]: https://github.com/Cyan4973/xxHash/tree/release/tests/bench
-[collisions]: https://github.com/Cyan4973/xxHash/wiki/Collision-ratio-comparison#collision-study
-
-note 1: Small data velocity is a _rough_ evaluation of algorithm's efficiency on small data. For more detailed analysis, please refer to next paragraph.
-
-note 2: some algorithms feature _faster than RAM_ speed. In which case, they can only reach their full speed when input data is already in CPU cache (L3 or better). Otherwise, they max out on RAM speed limit.
-
-### Small data
-
-Performance on large data is only one part of the picture.
-Hashing is also very useful in constructions like hash tables and bloom filters.
-In these use cases, it's frequent to hash a lot of small data (starting at a few bytes).
-Algorithm's performance can be very different for such scenarios, since parts of the algorithm,
-such as initialization or finalization, become fixed cost.
-The impact of branch mis-prediction also becomes much more present.
-
-XXH3 has been designed for excellent performance on both long and small inputs,
-which can be observed in the following graph:
-
-![XXH3, latency, random size](https://user-images.githubusercontent.com/750081/61976089-aedeab00-af9f-11e9-9239-e5375d6c080f.png)
-
-For a more detailed analysis, visit the wiki :
-https://github.com/Cyan4973/xxHash/wiki/Performance-comparison#benchmarks-concentrating-on-small-data-
-
-Quality
--------------------------
-
-Speed is not the only property that matters.
-Produced hash values must respect excellent dispersion and randomness properties,
-so that any sub-section of it can be used to maximally spread out a table or index,
-as well as reduce the amount of collisions to the minimal theoretical level, following the [birthday paradox].
-
-`xxHash` has been tested with Austin Appleby's excellent SMHasher test suite,
-and passes all tests, ensuring reasonable quality levels.
-It also passes extended tests from [newer forks of SMHasher], featuring additional scenarios and conditions.
-
-Finally, xxHash provides its own [massive collision tester](https://github.com/Cyan4973/xxHash/tree/dev/tests/collisions),
-able to generate and compare billions of hash to test the limits of 64-bit hash algorithms.
-On this front too, xxHash features good results, in line with the [birthday paradox].
-A more detailed analysis is documented [in the wiki](https://github.com/Cyan4973/xxHash/wiki/Collision-ratio-comparison).
-
-[birthday paradox]: https://en.wikipedia.org/wiki/Birthday_problem
-[newer forks of SMHasher]: https://github.com/rurban/smhasher
-
-
-### Build modifiers
-
-The following macros can be set at compilation time to modify libxxhash's behavior. They are generally disabled by default.
-
-- `XXH_INLINE_ALL`: Make all functions `inline`, with implementations being directly included within `xxhash.h`.
- Inlining functions is beneficial for speed on small keys.
- It's _extremely effective_ when key length is expressed as _a compile time constant_,
- with performance improvements observed in the +200% range .
- See [this article](https://fastcompression.blogspot.com/2018/03/xxhash-for-small-keys-impressive-power.html) for details.
-- `XXH_PRIVATE_API`: same outcome as `XXH_INLINE_ALL`. Still available for legacy support.
- The name underlines that `XXH_*` symbols will not be exported.
-- `XXH_NAMESPACE`: Prefixes all symbols with the value of `XXH_NAMESPACE`.
- This macro can only use compilable character set.
- Useful to evade symbol naming collisions,
- in case of multiple inclusions of xxHash's source code.
- Client applications still use the regular function names,
- as symbols are automatically translated through `xxhash.h`.
-- `XXH_FORCE_MEMORY_ACCESS`: The default method `0` uses a portable `memcpy()` notation.
- Method `1` uses a gcc-specific `packed` attribute, which can provide better performance for some targets.
- Method `2` forces unaligned reads, which is not standards compliant, but might sometimes be the only way to extract better read performance.
- Method `3` uses a byteshift operation, which is best for old compilers which don't inline `memcpy()` or big-endian systems without a byteswap instruction
-- `XXH_FORCE_ALIGN_CHECK`: Use a faster direct read path when input is aligned.
- This option can result in dramatic performance improvement when input to hash is aligned on 32 or 64-bit boundaries,
- when running on architectures unable to load memory from unaligned addresses, or suffering a performance penalty from it.
- It is (slightly) detrimental on platform with good unaligned memory access performance (same instruction for both aligned and unaligned accesses).
- This option is automatically disabled on `x86`, `x64` and `aarch64`, and enabled on all other platforms.
-- `XXH_VECTOR` : manually select a vector instruction set (default: auto-selected at compilation time). Available instruction sets are `XXH_SCALAR`, `XXH_SSE2`, `XXH_AVX2`, `XXH_AVX512`, `XXH_NEON` and `XXH_VSX`. Compiler may require additional flags to ensure proper support (for example, `gcc` on linux will require `-mavx2` for AVX2, and `-mavx512f` for AVX512).
-- `XXH_NO_PREFETCH` : disable prefetching. XXH3 only.
-- `XXH_PREFETCH_DIST` : select prefecting distance. XXH3 only.
-- `XXH_NO_INLINE_HINTS`: By default, xxHash uses `__attribute__((always_inline))` and `__forceinline` to improve performance at the cost of code size.
- Defining this macro to 1 will mark all internal functions as `static`, allowing the compiler to decide whether to inline a function or not.
- This is very useful when optimizing for smallest binary size,
- and is automatically defined when compiling with `-O0`, `-Os`, `-Oz`, or `-fno-inline` on GCC and Clang.
- This may also increase performance depending on compiler and architecture.
-- `XXH_REROLL`: Reduces the size of the generated code by not unrolling some loops.
- Impact on performance may vary, depending on platform and algorithm.
-- `XXH_ACCEPT_NULL_INPUT_POINTER`: if set to `1`, when input is a `NULL` pointer,
- xxHash'd result is the same as a zero-length input
- (instead of a dereference segfault).
- Adds one branch at the beginning of each hash.
-- `XXH_STATIC_LINKING_ONLY`: gives access to the state declaration for static allocation.
- Incompatible with dynamic linking, due to risks of ABI changes.
-- `XXH_NO_LONG_LONG`: removes compilation of algorithms relying on 64-bit types (XXH3 and XXH64). Only XXH32 will be compiled.
- Useful for targets (architectures and compilers) without 64-bit support.
-- `XXH_IMPORT`: MSVC specific: should only be defined for dynamic linking, as it prevents linkage errors.
-- `XXH_CPU_LITTLE_ENDIAN`: By default, endianess is determined by a runtime test resolved at compile time.
- If, for some reason, the compiler cannot simplify the runtime test, it can cost performance.
- It's possible to skip auto-detection and simply state that the architecture is little-endian by setting this macro to 1.
- Setting it to 0 states big-endian.
-
-For the Command Line Interface `xxhsum`, the following environment variables can also be set :
-- `DISPATCH=1` : use `xxh_x86dispatch.c`, to automatically select between `scalar`, `sse2`, `avx2` or `avx512` instruction set at runtime, depending on local host. This option is only valid for `x86`/`x64` systems.
-
-
-### Building xxHash - Using vcpkg
-
-You can download and install xxHash using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
-
- git clone https://github.com/Microsoft/vcpkg.git
- cd vcpkg
- ./bootstrap-vcpkg.sh
- ./vcpkg integrate install
- ./vcpkg install xxhash
-
-The xxHash port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
-
-
-### Example
-
-The simplest example calls xxhash 64-bit variant as a one-shot function
-generating a hash value from a single buffer, and invoked from a C/C++ program:
-
-```C
-#include "xxhash.h"
-
- (...)
- XXH64_hash_t hash = XXH64(buffer, size, seed);
-}
-```
-
-Streaming variant is more involved, but makes it possible to provide data incrementally:
-
-```C
-#include "stdlib.h" /* abort() */
-#include "xxhash.h"
-
-
-XXH64_hash_t calcul_hash_streaming(FileHandler fh)
-{
- /* create a hash state */
- XXH64_state_t* const state = XXH64_createState();
- if (state==NULL) abort();
-
- size_t const bufferSize = SOME_SIZE;
- void* const buffer = malloc(bufferSize);
- if (buffer==NULL) abort();
-
- /* Initialize state with selected seed */
- XXH64_hash_t const seed = 0; /* or any other value */
- if (XXH64_reset(state, seed) == XXH_ERROR) abort();
-
- /* Feed the state with input data, any size, any number of times */
- (...)
- while ( /* some data left */ ) {
- size_t const length = get_more_data(buffer, bufferSize, fh);
- if (XXH64_update(state, buffer, length) == XXH_ERROR) abort();
- (...)
- }
- (...)
-
- /* Produce the final hash value */
- XXH64_hash_t const hash = XXH64_digest(state);
-
- /* State could be re-used; but in this example, it is simply freed */
- free(buffer);
- XXH64_freeState(state);
-
- return hash;
-}
-```
-
-
-### License
-
-The library files `xxhash.c` and `xxhash.h` are BSD licensed.
-The utility `xxhsum` is GPL licensed.
-
-
-### Other programming languages
-
-Beyond the C reference version,
-xxHash is also available from many different programming languages,
-thanks to great contributors.
-They are [listed here](http://www.xxhash.com/#other-languages).
-
-
-### Packaging status
-
-Many distributions bundle a package manager
-which allows easy xxhash installation as both a `libxxhash` library
-and `xxhsum` command line interface.
-
-[![Packaging status](https://repology.org/badge/vertical-allrepos/xxhash.svg)](https://repology.org/project/xxhash/versions)
-
-
-### Special Thanks
-
-- Takayuki Matsuoka, aka @t-mat, for creating `xxhsum -c` and great support during early xxh releases
-- Mathias Westerdahl, aka @JCash, for introducing the first version of `XXH64`
-- Devin Hussey, aka @easyaspi314, for incredible low-level optimizations on `XXH3` and `XXH128`
diff --git a/grpc/third_party/xxhash/appveyor.yml b/grpc/third_party/xxhash/appveyor.yml
deleted file mode 100644
index 850f48b1..00000000
--- a/grpc/third_party/xxhash/appveyor.yml
+++ /dev/null
@@ -1,111 +0,0 @@
-#---------------------------------#
-# general configuration #
-#---------------------------------#
-version: 1.0.{build}
-max_jobs: 2
-
-#---------------------------------#
-# environment configuration #
-#---------------------------------#
-clone_depth: 2
-environment:
- matrix:
- - COMPILER: "visual"
- ARCH: "x64"
- TEST_XXHSUM: "true"
- - COMPILER: "visual"
- ARCH: "x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TEST_XXHSUM: "true"
- - COMPILER: "visual"
- ARCH: "Win32"
- TEST_XXHSUM: "true"
- - COMPILER: "visual"
- ARCH: "Win32"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- TEST_XXHSUM: "true"
- - COMPILER: "visual"
- ARCH: "ARM"
- - COMPILER: "visual"
- ARCH: "ARM64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- # note: ARM64 is not available with Visual Studio 14 2015, which is default for Appveyor
- - COMPILER: "gcc"
- PLATFORM: "mingw64"
- - COMPILER: "gcc"
- PLATFORM: "mingw32"
- - COMPILER: "gcc"
- PLATFORM: "clang"
-
-install:
- - ECHO Installing %COMPILER% %PLATFORM% %ARCH%
- - MKDIR bin
- - if [%COMPILER%]==[gcc] SET PATH_ORIGINAL=%PATH%
- - if [%COMPILER%]==[gcc] (
- SET "PATH_MINGW32=c:\MinGW\bin;c:\MinGW\usr\bin" &&
- SET "PATH_MINGW64=c:\msys64\mingw64\bin;c:\msys64\usr\bin" &&
- COPY C:\MinGW\bin\mingw32-make.exe C:\MinGW\bin\make.exe &&
- COPY C:\MinGW\bin\gcc.exe C:\MinGW\bin\cc.exe
- )
-
-#---------------------------------#
-# build configuration #
-#---------------------------------#
-build_script:
- - if [%PLATFORM%]==[mingw32] SET PATH=%PATH_MINGW32%;%PATH_ORIGINAL%
- - if [%PLATFORM%]==[mingw64] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
- - if [%PLATFORM%]==[clang] SET PATH=%PATH_MINGW64%;%PATH_ORIGINAL%
- - ECHO ***
- - ECHO Building %COMPILER% %PLATFORM% %ARCH%
- - ECHO ***
-
- - if [%COMPILER%]==[gcc] (
- if [%PLATFORM%]==[clang] (
- clang -v
- ) ELSE (
- gcc -v
- )
- )
- - if [%COMPILER%]==[gcc] (
- echo ----- &&
- make -v &&
- echo ----- &&
- if not [%PLATFORM%]==[clang] (
- if [%PLATFORM%]==[mingw32] ( SET CPPFLAGS=-DPOOL_MT=0 ) &&
- make -B clean test MOREFLAGS=-Werror
- ) ELSE (
- SET CXXFLAGS=--std=c++14 &&
- make -B clean test CC=clang CXX=clang++ MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wno-pass-failed" NO_C90_TEST=true
- ) &&
- make -C tests/bench
- )
- # note 1: strict c90 tests with clang fail, due to (erroneous) presence on `inline` keyword in some included system file
- # note 2: multi-threading code doesn't work with mingw32, disabled through POOL_MT=0
- # note 3: clang requires C++14 to compile sort because its own code contains c++14-only code
-
- - if [%COMPILER%]==[visual] (
- cd cmake_unofficial &&
- cmake . -DCMAKE_BUILD_TYPE=Release -A %ARCH% -DXXHASH_C_FLAGS="/WX" &&
- cmake --build . --config Release
- )
-
-#---------------------------------#
-# tests configuration #
-#---------------------------------#
-test_script:
- # note: can only run x86 and x64 binaries on Appveyor
- # note: if %COMPILER%==gcc, xxhsum was already tested within `make test`
- - if [%TEST_XXHSUM%]==[true] (
- ECHO *** &&
- ECHO Testing %COMPILER% %PLATFORM% %ARCH% &&
- ECHO *** &&
- cd Release &&
- xxhsum.exe -bi1 &&
- ECHO ------- xxhsum tested -------
- )
-
-
-#---------------------------------#
-# artifacts configuration #
-#---------------------------------#
-# none yet
diff --git a/grpc/third_party/xxhash/cli/xsum_arch.h b/grpc/third_party/xxhash/cli/xsum_arch.h
deleted file mode 100644
index cc392979..00000000
--- a/grpc/third_party/xxhash/cli/xsum_arch.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * Checks for predefined macros by the compiler to try and get both the arch
- * and the compiler version.
- */
-#ifndef XSUM_ARCH_H
-#define XSUM_ARCH_H
-
-#include "xsum_config.h"
-
-#define XSUM_LIB_VERSION XXH_VERSION_MAJOR.XXH_VERSION_MINOR.XXH_VERSION_RELEASE
-#define XSUM_QUOTE(str) #str
-#define XSUM_EXPAND_AND_QUOTE(str) XSUM_QUOTE(str)
-#define XSUM_PROGRAM_VERSION XSUM_EXPAND_AND_QUOTE(XSUM_LIB_VERSION)
-
-
-/* Show compiler versions in WELCOME_MESSAGE. XSUM_CC_VERSION_FMT will return the printf specifiers,
- * and VERSION will contain the comma separated list of arguments to the XSUM_CC_VERSION_FMT string. */
-#if defined(__clang_version__)
-/* Clang does its own thing. */
-# ifdef __apple_build_version__
-# define XSUM_CC_VERSION_FMT "Apple Clang %s"
-# else
-# define XSUM_CC_VERSION_FMT "Clang %s"
-# endif
-# define XSUM_CC_VERSION __clang_version__
-#elif defined(__VERSION__)
-/* GCC and ICC */
-# define XSUM_CC_VERSION_FMT "%s"
-# ifdef __INTEL_COMPILER /* icc adds its prefix */
-# define XSUM_CC_VERSION __VERSION__
-# else /* assume GCC */
-# define XSUM_CC_VERSION "GCC " __VERSION__
-# endif
-#elif defined(_MSC_FULL_VER) && defined(_MSC_BUILD)
-/*
- * MSVC
- * "For example, if the version number of the Visual C++ compiler is
- * 15.00.20706.01, the _MSC_FULL_VER macro evaluates to 150020706."
- *
- * https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2017
- */
-# define XSUM_CC_VERSION_FMT "MSVC %02i.%02i.%05i.%02i"
-# define XSUM_CC_VERSION _MSC_FULL_VER / 10000000 % 100, _MSC_FULL_VER / 100000 % 100, _MSC_FULL_VER % 100000, _MSC_BUILD
-#elif defined(_MSC_VER) /* old MSVC */
-# define XSUM_CC_VERSION_FMT "MSVC %02i.%02i"
-# define XSUM_CC_VERSION _MSC_VER / 100, _MSC_VER % 100
-#elif defined(__TINYC__)
-/* tcc stores its version in the __TINYC__ macro. */
-# define XSUM_CC_VERSION_FMT "tcc %i.%i.%i"
-# define XSUM_CC_VERSION __TINYC__ / 10000 % 100, __TINYC__ / 100 % 100, __TINYC__ % 100
-#else
-# define XSUM_CC_VERSION_FMT "%s"
-# define XSUM_CC_VERSION "unknown compiler"
-#endif
-
-/* makes the next part easier */
-#if defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
-# define XSUM_ARCH_X64 1
-# define XSUM_ARCH_X86 "x86_64"
-#elif defined(__i386__) || defined(_M_IX86) || defined(_M_IX86_FP)
-# define XSUM_ARCH_X86 "i386"
-#endif
-
-/* Try to detect the architecture. */
-#if defined(XSUM_ARCH_X86)
-# if defined(XXHSUM_DISPATCH)
-# define XSUM_ARCH XSUM_ARCH_X86 " autoVec"
-# elif defined(__AVX512F__)
-# define XSUM_ARCH XSUM_ARCH_X86 " + AVX512"
-# elif defined(__AVX2__)
-# define XSUM_ARCH XSUM_ARCH_X86 " + AVX2"
-# elif defined(__AVX__)
-# define XSUM_ARCH XSUM_ARCH_X86 " + AVX"
-# elif defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) \
- || defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP == 2)
-# define XSUM_ARCH XSUM_ARCH_X86 " + SSE2"
-# else
-# define XSUM_ARCH XSUM_ARCH_X86
-# endif
-#elif defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)
-# define XSUM_ARCH "aarch64 + NEON"
-#elif defined(__arm__) || defined(__thumb__) || defined(__thumb2__) || defined(_M_ARM)
-/* ARM has a lot of different features that can change xxHash significantly. */
-# if defined(__thumb2__) || (defined(__thumb__) && (__thumb__ == 2 || __ARM_ARCH >= 7))
-# define XSUM_ARCH_THUMB " Thumb-2"
-# elif defined(__thumb__)
-# define XSUM_ARCH_THUMB " Thumb-1"
-# else
-# define XSUM_ARCH_THUMB ""
-# endif
-/* ARMv7 has unaligned by default */
-# if defined(__ARM_FEATURE_UNALIGNED) || __ARM_ARCH >= 7 || defined(_M_ARMV7VE)
-# define XSUM_ARCH_UNALIGNED " + unaligned"
-# else
-# define XSUM_ARCH_UNALIGNED ""
-# endif
-# if defined(__ARM_NEON) || defined(__ARM_NEON__)
-# define XSUM_ARCH_NEON " + NEON"
-# else
-# define XSUM_ARCH_NEON ""
-# endif
-# define XSUM_ARCH "ARMv" XSUM_EXPAND_AND_QUOTE(__ARM_ARCH) XSUM_ARCH_THUMB XSUM_ARCH_NEON XSUM_ARCH_UNALIGNED
-#elif defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__)
-# if defined(__GNUC__) && defined(__POWER9_VECTOR__)
-# define XSUM_ARCH "ppc64 + POWER9 vector"
-# elif defined(__GNUC__) && defined(__POWER8_VECTOR__)
-# define XSUM_ARCH "ppc64 + POWER8 vector"
-# else
-# define XSUM_ARCH "ppc64"
-# endif
-#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
-# define XSUM_ARCH "ppc"
-#elif defined(__AVR)
-# define XSUM_ARCH "AVR"
-#elif defined(__mips64)
-# define XSUM_ARCH "mips64"
-#elif defined(__mips)
-# define XSUM_ARCH "mips"
-#elif defined(__s390x__)
-# define XSUM_ARCH "s390x"
-#elif defined(__s390__)
-# define XSUM_ARCH "s390"
-#else
-# define XSUM_ARCH "unknown"
-#endif
-
-
-#endif /* XSUM_ARCH_H */
diff --git a/grpc/third_party/xxhash/cli/xsum_config.h b/grpc/third_party/xxhash/cli/xsum_config.h
deleted file mode 100644
index 9222144d..00000000
--- a/grpc/third_party/xxhash/cli/xsum_config.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * This contains various configuration parameters and feature detection for
- * xxhsum.
- *
- * Similar to config.h in Autotools, this should be the first header included.
- */
-
-#ifndef XSUM_CONFIG_H
-#define XSUM_CONFIG_H
-
-
-/* ************************************
- * Compiler Options
- **************************************/
-/*
- * Disable Visual C's warnings when using the "insecure" CRT functions instead
- * of the "secure" _s functions.
- *
- * These functions are not portable, and aren't necessary if you are using the
- * original functions properly.
- */
-#if defined(_MSC_VER) || defined(_WIN32)
-# ifndef _CRT_SECURE_NO_WARNINGS
-# define _CRT_SECURE_NO_WARNINGS
-# endif
-#endif
-
-/* Under Linux at least, pull in the *64 commands */
-#ifndef _LARGEFILE64_SOURCE
-# define _LARGEFILE64_SOURCE
-#endif
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-/*
- * So we can use __attribute__((__format__))
- */
-#ifdef __GNUC__
-# define XSUM_ATTRIBUTE(x) __attribute__(x)
-#else
-# define XSUM_ATTRIBUTE(x)
-#endif
-
-#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) /* UNIX-like OS */ \
- || defined(__midipix__) || defined(__VMS))
-# if (defined(__APPLE__) && defined(__MACH__)) || defined(__SVR4) || defined(_AIX) || defined(__hpux) /* POSIX.1-2001 (SUSv3) conformant */ \
- || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) /* BSD distros */
-# define XSUM_PLATFORM_POSIX_VERSION 200112L
-# else
-# if defined(__linux__) || defined(__linux)
-# ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200112L /* use feature test macro */
-# endif
-# endif
-# include <unistd.h> /* declares _POSIX_VERSION */
-# if defined(_POSIX_VERSION) /* POSIX compliant */
-# define XSUM_PLATFORM_POSIX_VERSION _POSIX_VERSION
-# else
-# define XSUM_PLATFORM_POSIX_VERSION 0
-# endif
-# endif
-#endif
-#if !defined(XSUM_PLATFORM_POSIX_VERSION)
-# define XSUM_PLATFORM_POSIX_VERSION -1
-#endif
-
-#if !defined(S_ISREG)
-# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
-#endif
-
-
-/* ************************************
- * Windows helpers
- **************************************/
-
-/*
- * Whether to use the Windows UTF-16 APIs instead of the portable libc 8-bit
- * ("ANSI") APIs.
- *
- * Windows is not UTF-8 clean by default, and the only way to access every file
- * on the OS is to use UTF-16.
- *
- * Do note that xxhsum uses UTF-8 internally and only uses UTF-16 for command
- * line arguments, console I/O, and opening files.
- *
- * Additionally, this guarantees all piped output is UTF-8.
- */
-#if defined(XSUM_WIN32_USE_WCHAR) && !defined(_WIN32)
-/* We use Windows APIs, only use this on Windows. */
-# undef XSUM_WIN32_USE_WCHAR
-#endif
-
-#ifndef XSUM_WIN32_USE_WCHAR
-# if defined(_WIN32)
-# include <wchar.h>
-# if WCHAR_MAX == 0xFFFFU /* UTF-16 wchar_t */
-# define XSUM_WIN32_USE_WCHAR 1
-# else
-# define XSUM_WIN32_USE_WCHAR 0
-# endif
-# else
-# define XSUM_WIN32_USE_WCHAR 0
-# endif
-#endif
-
-#if !XSUM_WIN32_USE_WCHAR
-/*
- * It doesn't make sense to have one without the other.
- * Due to XSUM_WIN32_USE_WCHAR being undef'd, this also handles
- * non-WIN32 platforms.
- */
-# undef XSUM_WIN32_USE_WMAIN
-# define XSUM_WIN32_USE_WMAIN 0
-#else
-/*
- * Whether to use wmain() or main().
- *
- * wmain() is preferred because we don't have to mess with internal hidden
- * APIs.
- *
- * It always works on MSVC, but in MinGW, it only works on MinGW-w64 with the
- * -municode flag.
- *
- * Therefore we have to use main() -- there is no better option.
- */
-# ifndef XSUM_WIN32_USE_WMAIN
-# if defined(_UNICODE) || defined(UNICODE) /* MinGW -municode */ \
- || defined(_MSC_VER) /* MSVC */
-# define XSUM_WIN32_USE_WMAIN 1
-# else
-# define XSUM_WIN32_USE_WMAIN 0
-# endif
-# endif
-/*
- * It is always good practice to define these to prevent accidental use of the
- * ANSI APIs, even if the program primarily uses UTF-8.
- */
-# ifndef _UNICODE
-# define _UNICODE
-# endif
-# ifndef UNICODE
-# define UNICODE
-# endif
-#endif /* XSUM_WIN32_USE_WCHAR */
-
-#ifndef XSUM_API
-# ifdef XXH_INLINE_ALL
-# define XSUM_API static
-# else
-# define XSUM_API
-# endif
-#endif
-
-#ifndef XSUM_NO_TESTS
-# define XSUM_NO_TESTS 0
-#endif
-
-/* ***************************
- * Basic types
- * ***************************/
-
-#if defined(__cplusplus) /* C++ */ \
- || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) /* C99 */
-# include <stdint.h>
- typedef uint8_t XSUM_U8;
- typedef uint32_t XSUM_U32;
- typedef uint64_t XSUM_U64;
-# else
-# include <limits.h>
- typedef unsigned char XSUM_U8;
-# if UINT_MAX == 0xFFFFFFFFUL
- typedef unsigned int XSUM_U32;
-# else
- typedef unsigned long XSUM_U32;
-# endif
- typedef unsigned long long XSUM_U64;
-#endif /* not C++/C99 */
-
-#endif /* XSUM_CONFIG_H */
diff --git a/grpc/third_party/xxhash/cli/xsum_os_specific.c b/grpc/third_party/xxhash/cli/xsum_os_specific.c
deleted file mode 100644
index 8f48ce07..00000000
--- a/grpc/third_party/xxhash/cli/xsum_os_specific.c
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#include "xsum_config.h"
-#include "xsum_os_specific.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <sys/types.h> /* struct stat / __wstat64 */
-#include <sys/stat.h> /* stat() / _stat64() */
-
-/*
- * This file contains all of the ugly boilerplate to make xxhsum work across
- * platforms.
- */
-#if defined(_MSC_VER) || XSUM_WIN32_USE_WCHAR
- typedef struct __stat64 XSUM_stat_t;
-# if defined(_MSC_VER)
- typedef int mode_t;
-# endif
-#else
- typedef struct stat XSUM_stat_t;
-#endif
-
-#if (defined(__linux__) && (XSUM_PLATFORM_POSIX_VERSION >= 1)) \
- || (XSUM_PLATFORM_POSIX_VERSION >= 200112L) \
- || defined(__DJGPP__) \
- || defined(__MSYS__)
-# include <unistd.h> /* isatty */
-# define XSUM_IS_CONSOLE(stdStream) isatty(fileno(stdStream))
-#elif defined(MSDOS) || defined(OS2)
-# include <io.h> /* _isatty */
-# define XSUM_IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
-#elif defined(WIN32) || defined(_WIN32)
-# include <io.h> /* _isatty */
-# include <windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */
-# include <stdio.h> /* FILE */
-static __inline int XSUM_IS_CONSOLE(FILE* stdStream)
-{
- DWORD dummy;
- return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &dummy);
-}
-#else
-# define XSUM_IS_CONSOLE(stdStream) 0
-#endif
-
-#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32)
-# include <fcntl.h> /* _O_BINARY */
-# include <io.h> /* _setmode, _fileno, _get_osfhandle */
-# if !defined(__DJGPP__)
-# include <windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */
-# include <winioctl.h> /* FSCTL_SET_SPARSE */
-# define XSUM_SET_BINARY_MODE(file) { int const unused=_setmode(_fileno(file), _O_BINARY); (void)unused; }
-# else
-# define XSUM_SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
-# endif
-#else
-# define XSUM_SET_BINARY_MODE(file) ((void)file)
-#endif
-
-XSUM_API int XSUM_isConsole(FILE* stream)
-{
- return XSUM_IS_CONSOLE(stream);
-}
-
-XSUM_API void XSUM_setBinaryMode(FILE* stream)
-{
- XSUM_SET_BINARY_MODE(stream);
-}
-
-#if !XSUM_WIN32_USE_WCHAR
-
-XSUM_API FILE* XSUM_fopen(const char* filename, const char* mode)
-{
- return fopen(filename, mode);
-}
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 0)))
-XSUM_API int XSUM_vfprintf(FILE* stream, const char* format, va_list ap)
-{
- return vfprintf(stream, format, ap);
-}
-
-static int XSUM_stat(const char* infilename, XSUM_stat_t* statbuf)
-{
-#if defined(_MSC_VER)
- return _stat64(infilename, statbuf);
-#else
- return stat(infilename, statbuf);
-#endif
-}
-
-#ifndef XSUM_NO_MAIN
-int main(int argc, char* argv[])
-{
- return XSUM_main(argc, argv);
-}
-#endif
-
-/* Unicode helpers for Windows to make UTF-8 act as it should. */
-#else
-# include <windows.h>
-# include <wchar.h>
-
-/*****************************************************************************
- * Unicode conversion tools
- *****************************************************************************/
-
-/*
- * Converts a UTF-8 string to UTF-16. Acts like strdup. The string must be freed afterwards.
- * This version allows keeping the output length.
- */
-static wchar_t* XSUM_widenString(const char* str, int* lenOut)
-{
- int const len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
- if (lenOut != NULL) *lenOut = len;
- if (len == 0) return NULL;
- { wchar_t* buf = (wchar_t*)malloc((size_t)len * sizeof(wchar_t));
- if (buf != NULL) {
- if (MultiByteToWideChar(CP_UTF8, 0, str, -1, buf, len) == 0) {
- free(buf);
- return NULL;
- } }
- return buf;
- }
-}
-
-/*
- * Converts a UTF-16 string to UTF-8. Acts like strdup. The string must be freed afterwards.
- * This version allows keeping the output length.
- */
-static char* XSUM_narrowString(const wchar_t *str, int *lenOut)
-{
- int len = WideCharToMultiByte(CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
- if (lenOut != NULL) *lenOut = len;
- if (len == 0) return NULL;
- { char* const buf = (char*)malloc((size_t)len * sizeof(char));
- if (buf != NULL) {
- if (WideCharToMultiByte(CP_UTF8, 0, str, -1, buf, len, NULL, NULL) == 0) {
- free(buf);
- return NULL;
- } }
- return buf;
- }
-}
-
-
-
-/*****************************************************************************
- * File helpers
- *****************************************************************************/
-/*
- * fopen wrapper that supports UTF-8
- *
- * fopen will only accept ANSI filenames, which means that we can't open Unicode filenames.
- *
- * In order to open a Unicode filename, we need to convert filenames to UTF-16 and use _wfopen.
- */
-XSUM_API FILE* XSUM_fopen(const char* filename, const char* mode)
-{
- FILE* f = NULL;
- wchar_t* const wide_filename = XSUM_widenString(filename, NULL);
- if (wide_filename != NULL) {
- wchar_t* const wide_mode = XSUM_widenString(mode, NULL);
- if (wide_mode != NULL) {
- f = _wfopen(wide_filename, wide_mode);
- free(wide_mode);
- }
- free(wide_filename);
- }
- return f;
-}
-
-/*
- * stat() wrapper which supports UTF-8 filenames.
- */
-static int XSUM_stat(const char* infilename, XSUM_stat_t* statbuf)
-{
- int r = -1;
- wchar_t* const wide_filename = XSUM_widenString(infilename, NULL);
- if (wide_filename != NULL) {
- r = _wstat64(wide_filename, statbuf);
- free(wide_filename);
- }
- return r;
-}
-
-/*
- * In case it isn't available, this is what MSVC 2019 defines in stdarg.h.
- */
-#if defined(_MSC_VER) && !defined(__clang__) && !defined(va_copy)
-# define XSUM_va_copy(destination, source) ((destination) = (source))
-#else
-# define XSUM_va_copy(destination, source) va_copy(destination, source)
-#endif
-
-/*
- * vasprintf for Windows.
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 0)))
-static int XSUM_vasprintf(char** strp, const char* format, va_list ap)
-{
- int ret;
- int size;
- va_list copy;
- /*
- * To be safe, make a va_copy.
- *
- * Note that Microsoft doesn't use va_copy in its sample code:
- * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsprintf-vsprintf-l-vswprintf-vswprintf-l-vswprintf-l?view=vs-2019
- */
- XSUM_va_copy(copy, ap);
- /* Calculate how many characters we need */
- size = _vscprintf(format, ap);
- va_end(copy);
-
- if (size < 0) {
- *strp = NULL;
- return size;
- } else {
- *strp = (char*) malloc((size_t)size + 1);
- if (*strp == NULL) {
- return -1;
- }
- /* vsprintf into the new buffer */
- ret = vsprintf(*strp, format, ap);
- if (ret < 0) {
- free(*strp);
- *strp = NULL;
- }
- return ret;
- }
-}
-
-/*
- * fprintf wrapper that supports UTF-8.
- *
- * fprintf doesn't properly handle Unicode on Windows.
- *
- * Additionally, it is codepage sensitive on console and may crash the program.
- *
- * Instead, we use vsnprintf, and either print with fwrite or convert to UTF-16
- * for console output and use the codepage-independent WriteConsoleW.
- *
- * Credit to t-mat: https://github.com/t-mat/xxHash/commit/5691423
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 0)))
-XSUM_API int XSUM_vfprintf(FILE *stream, const char *format, va_list ap)
-{
- int result;
- char* u8_str = NULL;
-
- /*
- * Generate the UTF-8 output string with vasprintf.
- */
- result = XSUM_vasprintf(&u8_str, format, ap);
-
- if (result >= 0) {
- const size_t nchar = (size_t)result + 1;
-
- /*
- * Check if we are outputting to a console. Don't use XSUM_isConsole
- * directly -- we don't need to call _get_osfhandle twice.
- */
- int fileNb = _fileno(stream);
- intptr_t handle_raw = _get_osfhandle(fileNb);
- HANDLE handle = (HANDLE)handle_raw;
- DWORD dwTemp;
-
- if (handle_raw < 0) {
- result = -1;
- } else if (_isatty(fileNb) && GetConsoleMode(handle, &dwTemp)) {
- /*
- * Convert to UTF-16 and output with WriteConsoleW.
- *
- * This is codepage independent and works on Windows XP's default
- * msvcrt.dll.
- */
- int len;
- wchar_t* const u16_buf = XSUM_widenString(u8_str, &len);
- if (u16_buf == NULL) {
- result = -1;
- } else {
- if (WriteConsoleW(handle, u16_buf, (DWORD)len - 1, &dwTemp, NULL)) {
- result = (int)dwTemp;
- } else {
- result = -1;
- }
- free(u16_buf);
- }
- } else {
- /* fwrite the UTF-8 string if we are printing to a file */
- result = (int)fwrite(u8_str, 1, nchar - 1, stream);
- if (result == 0) {
- result = -1;
- }
- }
- free(u8_str);
- }
- return result;
-}
-
-#ifndef XSUM_NO_MAIN
-/*****************************************************************************
- * Command Line argument parsing
- *****************************************************************************/
-
-/* Converts a UTF-16 argv to UTF-8. */
-static char** XSUM_convertArgv(int argc, wchar_t* utf16_argv[])
-{
- char** const utf8_argv = (char**)malloc((size_t)(argc + 1) * sizeof(char*));
- if (utf8_argv != NULL) {
- int i;
- for (i = 0; i < argc; i++) {
- utf8_argv[i] = XSUM_narrowString(utf16_argv[i], NULL);
- if (utf8_argv[i] == NULL) {
- /* Out of memory, whoops. */
- while (i-- > 0) {
- free(utf8_argv[i]);
- }
- free(utf8_argv);
- return NULL;
- }
- }
- utf8_argv[argc] = NULL;
- }
- return utf8_argv;
-}
-/* Frees arguments returned by XSUM_convertArgv */
-static void XSUM_freeArgv(int argc, char** argv)
-{
- int i;
- if (argv == NULL) {
- return;
- }
- for (i = 0; i < argc; i++) {
- free(argv[i]);
- }
- free(argv);
-}
-
-static int XSUM_wmain(int argc, wchar_t* utf16_argv[])
-{
- /* Convert the UTF-16 arguments to UTF-8. */
- char** utf8_argv = XSUM_convertArgv(argc, utf16_argv);
-
- if (utf8_argv == NULL) {
- /* An unfortunate but incredibly unlikely error. */
- fprintf(stderr, "xxhsum: error converting command line arguments!\n");
- abort();
- } else {
- int ret;
-
- /*
- * MinGW's terminal uses full block buffering for stderr.
- *
- * This is nonstandard behavior and causes text to not display until
- * the buffer fills.
- *
- * `setvbuf()` can easily correct this to make text display instantly.
- */
- setvbuf(stderr, NULL, _IONBF, 0);
-
- /* Call our real main function */
- ret = XSUM_main(argc, utf8_argv);
-
- /* Cleanup */
- XSUM_freeArgv(argc, utf8_argv);
- return ret;
- }
-}
-
-#if XSUM_WIN32_USE_WMAIN
-
-/*
- * The preferred method of obtaining the real UTF-16 arguments. Always works
- * on MSVC, sometimes works on MinGW-w64 depending on the compiler flags.
- */
-#ifdef __cplusplus
-extern "C"
-#endif
-int __cdecl wmain(int argc, wchar_t* utf16_argv[])
-{
- return XSUM_wmain(argc, utf16_argv);
-}
-#else /* !XSUM_WIN32_USE_WMAIN */
-
-/*
- * Wrap `XSUM_wmain()` using `main()` and `__wgetmainargs()` on MinGW without
- * Unicode support.
- *
- * `__wgetmainargs()` is used in the CRT startup to retrieve the arguments for
- * `wmain()`, so we use it on MinGW to emulate `wmain()`.
- *
- * It is an internal function and not declared in any public headers, so we
- * have to declare it manually.
- *
- * An alternative that doesn't mess with internal APIs is `GetCommandLineW()`
- * with `CommandLineToArgvW()`, but the former doesn't expand wildcards and the
- * latter requires linking to Shell32.dll and its numerous dependencies.
- *
- * This method keeps our dependencies to kernel32.dll and the CRT.
- *
- * https://docs.microsoft.com/en-us/cpp/c-runtime-library/getmainargs-wgetmainargs?view=vs-2019
- */
-typedef struct {
- int newmode;
-} _startupinfo;
-
-#ifdef __cplusplus
-extern "C"
-#endif
-int __cdecl __wgetmainargs(
- int* Argc,
- wchar_t*** Argv,
- wchar_t*** Env,
- int DoWildCard,
- _startupinfo* StartInfo
-);
-
-int main(int ansi_argc, char* ansi_argv[])
-{
- int utf16_argc;
- wchar_t** utf16_argv;
- wchar_t** utf16_envp; /* Unused but required */
- _startupinfo startinfo = {0}; /* 0 == don't change new mode */
-
- /* Get wmain's UTF-16 arguments. Make sure we expand wildcards. */
- if (__wgetmainargs(&utf16_argc, &utf16_argv, &utf16_envp, 1, &startinfo) < 0)
- /* In the very unlikely case of an error, use the ANSI arguments. */
- return XSUM_main(ansi_argc, ansi_argv);
-
- /* Call XSUM_wmain with our UTF-16 arguments */
- return XSUM_wmain(utf16_argc, utf16_argv);
-}
-
-#endif /* !XSUM_WIN32_USE_WMAIN */
-#endif /* !XSUM_NO_MAIN */
-#endif /* XSUM_WIN32_USE_WCHAR */
-
-
-/*
- * Determines whether the file at filename is a directory.
- */
-XSUM_API int XSUM_isDirectory(const char* filename)
-{
- XSUM_stat_t statbuf;
- int r = XSUM_stat(filename, &statbuf);
-#ifdef _MSC_VER
- if (!r && (statbuf.st_mode & _S_IFDIR)) return 1;
-#else
- if (!r && S_ISDIR(statbuf.st_mode)) return 1;
-#endif
- return 0;
-}
-
-/*
- * Returns the filesize of the file at filename.
- */
-XSUM_API XSUM_U64 XSUM_getFileSize(const char* filename)
-{
- XSUM_stat_t statbuf;
- int r = XSUM_stat(filename, &statbuf);
- if (r || !S_ISREG(statbuf.st_mode)) return 0; /* No good... */
- return (XSUM_U64)statbuf.st_size;
-}
diff --git a/grpc/third_party/xxhash/cli/xsum_os_specific.h b/grpc/third_party/xxhash/cli/xsum_os_specific.h
deleted file mode 100644
index b3562b26..00000000
--- a/grpc/third_party/xxhash/cli/xsum_os_specific.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef XSUM_OS_SPECIFIC_H
-#define XSUM_OS_SPECIFIC_H
-
-#include "xsum_config.h"
-#include <stdio.h>
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Declared here to be implemented in user code.
- *
- * Functions like main(), but is passed UTF-8 arguments even on Windows.
- */
-XSUM_API int XSUM_main(int argc, char* argv[]);
-
-/*
- * Returns whether stream is a console.
- *
- * Functionally equivalent to isatty(fileno(stream)).
- */
-XSUM_API int XSUM_isConsole(FILE* stream);
-
-/*
- * Sets stream to pure binary mode (a.k.a. no CRLF conversions).
- */
-XSUM_API void XSUM_setBinaryMode(FILE* stream);
-
-/*
- * Returns whether the file at filename is a directory.
- */
-XSUM_API int XSUM_isDirectory(const char* filename);
-
-/*
- * Returns the file size of the file at filename.
- */
-XSUM_API XSUM_U64 XSUM_getFileSize(const char* filename);
-
-/*
- * UTF-8 stdio wrappers primarily for Windows
- */
-
-/*
- * fopen() wrapper. Accepts UTF-8 filenames on Windows.
- *
- * Specifically, on Windows, the arguments will be converted to UTF-16
- * and passed to _wfopen().
- */
-XSUM_API FILE* XSUM_fopen(const char* filename, const char* mode);
-
-/*
- * vfprintf() wrapper which prints UTF-8 strings to Windows consoles
- * if applicable.
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 0)))
-XSUM_API int XSUM_vfprintf(FILE* stream, const char* format, va_list ap);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* XSUM_OS_SPECIFIC_H */
diff --git a/grpc/third_party/xxhash/cli/xsum_output.c b/grpc/third_party/xxhash/cli/xsum_output.c
deleted file mode 100644
index a4d74115..00000000
--- a/grpc/third_party/xxhash/cli/xsum_output.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#include "xsum_output.h"
-#include "xsum_os_specific.h"
-#include <stdio.h>
-
-int XSUM_logLevel = 2;
-
-XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
-XSUM_API int XSUM_log(const char* format, ...)
-{
- int ret;
- va_list ap;
- va_start(ap, format);
- ret = XSUM_vfprintf(stderr, format, ap);
- va_end(ap);
- return ret;
-}
-
-
-XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
-XSUM_API int XSUM_output(const char* format, ...)
-{
- int ret;
- va_list ap;
- va_start(ap, format);
- ret = XSUM_vfprintf(stdout, format, ap);
- va_end(ap);
- return ret;
-}
-
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 3)))
-XSUM_API int XSUM_logVerbose(int minLevel, const char* format, ...)
-{
- if (XSUM_logLevel >= minLevel) {
- int ret;
- va_list ap;
- va_start(ap, format);
- ret = XSUM_vfprintf(stderr, format, ap);
- va_end(ap);
- return ret;
- }
- return 0;
-}
diff --git a/grpc/third_party/xxhash/cli/xsum_output.h b/grpc/third_party/xxhash/cli/xsum_output.h
deleted file mode 100644
index 8a02c1b7..00000000
--- a/grpc/third_party/xxhash/cli/xsum_output.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef XSUM_OUTPUT_H
-#define XSUM_OUTPUT_H
-
-#include "xsum_config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * How verbose the output is.
- */
-extern int XSUM_logLevel;
-
-/*
- * Same as fprintf(stderr, format, ...)
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
-XSUM_API int XSUM_log(const char *format, ...);
-
-/*
- * Like XSUM_log, but only outputs if XSUM_logLevel >= minLevel.
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 2, 3)))
-XSUM_API int XSUM_logVerbose(int minLevel, const char *format, ...);
-
-/*
- * Same as printf(format, ...)
- */
-XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
-XSUM_API int XSUM_output(const char *format, ...);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* XSUM_OUTPUT_H */
diff --git a/grpc/third_party/xxhash/cli/xsum_sanity_check.c b/grpc/third_party/xxhash/cli/xsum_sanity_check.c
deleted file mode 100644
index 347d1db5..00000000
--- a/grpc/third_party/xxhash/cli/xsum_sanity_check.c
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#include "xsum_config.h"
-#include "xsum_sanity_check.h"
-#include "xsum_output.h"
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#ifndef XXH_STATIC_LINKING_ONLY
-# define XXH_STATIC_LINKING_ONLY
-#endif
-#include "../xxhash.h"
-
-/* use #define to make them constant, required for initialization */
-#define PRIME32 2654435761U
-#define PRIME64 11400714785074694797ULL
-
-/*
- * Fills a test buffer with pseudorandom data.
- *
- * This is used in the sanity check - its values must not be changed.
- */
-XSUM_API void XSUM_fillTestBuffer(XSUM_U8* buffer, size_t len)
-{
- XSUM_U64 byteGen = PRIME32;
- size_t i;
-
- assert(buffer != NULL);
-
- for (i=0; i<len; i++) {
- buffer[i] = (XSUM_U8)(byteGen>>56);
- byteGen *= PRIME64;
- }
-}
-
-
-
-/* ************************************************
- * Self-test:
- * ensure results consistency accross platforms
- *********************************************** */
-#if XSUM_NO_TESTS
-XSUM_API void XSUM_sanityCheck(void)
-{
- XSUM_log("This version of xxhsum is not verified.\n");
-}
-#else
-
-/*
- * Test data vectors
- */
-typedef struct {
- XSUM_U32 len;
- XSUM_U32 seed;
- XSUM_U32 Nresult;
-} XSUM_testdata32_t;
-
-typedef struct {
- XSUM_U32 len;
- XSUM_U64 seed;
- XSUM_U64 Nresult;
-} XSUM_testdata64_t;
-
-typedef struct {
- XSUM_U32 len;
- XSUM_U64 seed;
- XXH128_hash_t Nresult;
-} XSUM_testdata128_t;
-
-#define SECRET_SAMPLE_NBBYTES 4
-typedef struct {
- XSUM_U32 len;
- XSUM_U8 byte[SECRET_SAMPLE_NBBYTES];
-} XSUM_testdata_sample_t;
-
-/* XXH32 */
-static const XSUM_testdata32_t XSUM_XXH32_testdata[] = {
- { 0, 0, 0x02CC5D05U },
- { 0, PRIME32, 0x36B78AE7U },
- { 1, 0, 0xCF65B03EU },
- { 1, PRIME32, 0xB4545AA4U },
- { 14, 0, 0x1208E7E2U },
- { 14, PRIME32, 0x6AF1D1FEU },
- { 222, 0, 0x5BD11DBDU },
- { 222, PRIME32, 0x58803C5FU }
-};
-
-/* XXH64 */
-static const XSUM_testdata64_t XSUM_XXH64_testdata[] = {
- { 0, 0, 0xEF46DB3751D8E999ULL },
- { 0, PRIME32, 0xAC75FDA2929B17EFULL },
- { 1, 0, 0xE934A84ADB052768ULL },
- { 1, PRIME32, 0x5014607643A9B4C3ULL },
- { 4, 0, 0x9136A0DCA57457EEULL },
- { 14, 0, 0x8282DCC4994E35C8ULL },
- { 14, PRIME32, 0xC3BD6BF63DEB6DF0ULL },
- { 222, 0, 0xB641AE8CB691C174ULL },
- { 222, PRIME32, 0x20CB8AB7AE10C14AULL }
-};
-/*
- * XXH3:
- * Due to being a more complex hash function with specializations for certain
- * lengths, a more extensive test is used for XXH3.
- */
-
-/* XXH3_64bits, seeded */
-static const XSUM_testdata64_t XSUM_XXH3_testdata[] = {
- { 0, 0, 0x2D06800538D394C2ULL }, /* empty string */
- { 0, PRIME64, 0xA8A6B918B2F0364AULL }, /* empty string */
- { 1, 0, 0xC44BDFF4074EECDBULL }, /* 1 - 3 */
- { 1, PRIME64, 0x032BE332DD766EF8ULL }, /* 1 - 3 */
- { 6, 0, 0x27B56A84CD2D7325ULL }, /* 4 - 8 */
- { 6, PRIME64, 0x84589C116AB59AB9ULL }, /* 4 - 8 */
- { 12, 0, 0xA713DAF0DFBB77E7ULL }, /* 9 - 16 */
- { 12, PRIME64, 0xE7303E1B2336DE0EULL }, /* 9 - 16 */
- { 24, 0, 0xA3FE70BF9D3510EBULL }, /* 17 - 32 */
- { 24, PRIME64, 0x850E80FC35BDD690ULL }, /* 17 - 32 */
- { 48, 0, 0x397DA259ECBA1F11ULL }, /* 33 - 64 */
- { 48, PRIME64, 0xADC2CBAA44ACC616ULL }, /* 33 - 64 */
- { 80, 0, 0xBCDEFBBB2C47C90AULL }, /* 65 - 96 */
- { 80, PRIME64, 0xC6DD0CB699532E73ULL }, /* 65 - 96 */
- { 195, 0, 0xCD94217EE362EC3AULL }, /* 129-240 */
- { 195, PRIME64, 0xBA68003D370CB3D9ULL }, /* 129-240 */
-
- { 403, 0, 0xCDEB804D65C6DEA4ULL }, /* one block, last stripe is overlapping */
- { 403, PRIME64, 0x6259F6ECFD6443FDULL }, /* one block, last stripe is overlapping */
- { 512, 0, 0x617E49599013CB6BULL }, /* one block, finishing at stripe boundary */
- { 512, PRIME64, 0x3CE457DE14C27708ULL }, /* one block, finishing at stripe boundary */
- { 2048, 0, 0xDD59E2C3A5F038E0ULL }, /* 2 blocks, finishing at block boundary */
- { 2048, PRIME64, 0x66F81670669ABABCULL }, /* 2 blocks, finishing at block boundary */
- { 2240, 0, 0x6E73A90539CF2948ULL }, /* 3 blocks, finishing at stripe boundary */
- { 2240, PRIME64, 0x757BA8487D1B5247ULL }, /* 3 blocks, finishing at stripe boundary */
- { 2367, 0, 0xCB37AEB9E5D361EDULL }, /* 3 blocks, last stripe is overlapping */
- { 2367, PRIME64, 0xD2DB3415B942B42AULL } /* 3 blocks, last stripe is overlapping */
-};
-/* XXH3_64bits, custom secret */
-static const XSUM_testdata64_t XSUM_XXH3_withSecret_testdata[] = {
- { 0, 0, 0x3559D64878C5C66CULL }, /* empty string */
- { 1, 0, 0x8A52451418B2DA4DULL }, /* 1 - 3 */
- { 6, 0, 0x82C90AB0519369ADULL }, /* 4 - 8 */
- { 12, 0, 0x14631E773B78EC57ULL }, /* 9 - 16 */
- { 24, 0, 0xCDD5542E4A9D9FE8ULL }, /* 17 - 32 */
- { 48, 0, 0x33ABD54D094B2534ULL }, /* 33 - 64 */
- { 80, 0, 0xE687BA1684965297ULL }, /* 65 - 96 */
- { 195, 0, 0xA057273F5EECFB20ULL }, /* 129-240 */
-
- { 403, 0, 0x14546019124D43B8ULL }, /* one block, last stripe is overlapping */
- { 512, 0, 0x7564693DD526E28DULL }, /* one block, finishing at stripe boundary */
- { 2048, 0, 0xD32E975821D6519FULL }, /* >= 2 blodcks, at least one scrambling */
- { 2367, 0, 0x293FA8E5173BB5E7ULL }, /* >= 2 blocks, at least one scrambling, last stripe unaligned */
-
- { 64*10*3, 0, 0x751D2EC54BC6038BULL } /* exactly 3 full blocks, not a multiple of 256 */
-};
-/* XXH3_128bits, seeded */
-static const XSUM_testdata128_t XSUM_XXH128_testdata[] = {
- { 0, 0, { 0x6001C324468D497FULL, 0x99AA06D3014798D8ULL } }, /* empty string */
- { 0, PRIME32, { 0x5444F7869C671AB0ULL, 0x92220AE55E14AB50ULL } }, /* empty string */
- { 1, 0, { 0xC44BDFF4074EECDBULL, 0xA6CD5E9392000F6AULL } }, /* 1 - 3 */
- { 1, PRIME32, { 0xB53D5557E7F76F8DULL, 0x89B99554BA22467CULL } }, /* 1 - 3 */
- { 6, 0, { 0x3E7039BDDA43CFC6ULL, 0x082AFE0B8162D12AULL } }, /* 4 - 8 */
- { 6, PRIME32, { 0x269D8F70BE98856EULL, 0x5A865B5389ABD2B1ULL } }, /* 4 - 8 */
- { 12, 0, { 0x061A192713F69AD9ULL, 0x6E3EFD8FC7802B18ULL } }, /* 9 - 16 */
- { 12, PRIME32, { 0x9BE9F9A67F3C7DFBULL, 0xD7E09D518A3405D3ULL } }, /* 9 - 16 */
- { 24, 0, { 0x1E7044D28B1B901DULL, 0x0CE966E4678D3761ULL } }, /* 17 - 32 */
- { 24, PRIME32, { 0xD7304C54EBAD40A9ULL, 0x3162026714A6A243ULL } }, /* 17 - 32 */
- { 48, 0, { 0xF942219AED80F67BULL, 0xA002AC4E5478227EULL } }, /* 33 - 64 */
- { 48, PRIME32, { 0x7BA3C3E453A1934EULL, 0x163ADDE36C072295ULL } }, /* 33 - 64 */
- { 81, 0, { 0x5E8BAFB9F95FB803ULL, 0x4952F58181AB0042ULL } }, /* 65 - 96 */
- { 81, PRIME32, { 0x703FBB3D7A5F755CULL, 0x2724EC7ADC750FB6ULL } }, /* 65 - 96 */
- { 222, 0, { 0xF1AEBD597CEC6B3AULL, 0x337E09641B948717ULL } }, /* 129-240 */
- { 222, PRIME32, { 0xAE995BB8AF917A8DULL, 0x91820016621E97F1ULL } }, /* 129-240 */
-
- { 403, 0, { 0xCDEB804D65C6DEA4ULL, 0x1B6DE21E332DD73DULL } }, /* one block, last stripe is overlapping */
- { 403, PRIME64, { 0x6259F6ECFD6443FDULL, 0xBED311971E0BE8F2ULL } }, /* one block, last stripe is overlapping */
- { 512, 0, { 0x617E49599013CB6BULL, 0x18D2D110DCC9BCA1ULL } }, /* one block, finishing at stripe boundary */
- { 512, PRIME64, { 0x3CE457DE14C27708ULL, 0x925D06B8EC5B8040ULL } }, /* one block, finishing at stripe boundary */
- { 2048, 0, { 0xDD59E2C3A5F038E0ULL, 0xF736557FD47073A5ULL } }, /* 2 blocks, finishing at block boundary */
- { 2048, PRIME32, { 0x230D43F30206260BULL, 0x7FB03F7E7186C3EAULL } }, /* 2 blocks, finishing at block boundary */
- { 2240, 0, { 0x6E73A90539CF2948ULL, 0xCCB134FBFA7CE49DULL } }, /* 3 blocks, finishing at stripe boundary */
- { 2240, PRIME32, { 0xED385111126FBA6FULL, 0x50A1FE17B338995FULL } }, /* 3 blocks, finishing at stripe boundary */
- { 2367, 0, { 0xCB37AEB9E5D361EDULL, 0xE89C0F6FF369B427ULL } }, /* 3 blocks, last stripe is overlapping */
- { 2367, PRIME32, { 0x6F5360AE69C2F406ULL, 0xD23AAE4B76C31ECBULL } } /* 3 blocks, last stripe is overlapping */
-};
-
-/* XXH128, custom secret */
-static const XSUM_testdata128_t XSUM_XXH128_withSecret_testdata[] = {
- { 0, 0, { 0x005923CCEECBE8AEULL, 0x5F70F4EA232F1D38ULL } }, /* empty string */
- { 1, 0, { 0x8A52451418B2DA4DULL, 0x3A66AF5A9819198EULL } }, /* 1 - 3 */
- { 6, 0, { 0x0B61C8ACA7D4778FULL, 0x376BD91B6432F36DULL } }, /* 4 - 8 */
- { 12, 0, { 0xAF82F6EBA263D7D8ULL, 0x90A3C2D839F57D0FULL } } /* 9 - 16 */
-};
-
-static const XSUM_testdata_sample_t XSUM_XXH3_generateSecret_testdata[] = {
- { 0, { 0xB8, 0x26, 0x83, 0x7E } },
- { 1, { 0xA6, 0x16, 0x06, 0x7B } },
- { XXH3_SECRET_SIZE_MIN - 1, { 0xDA, 0x2A, 0x12, 0x11 } },
- { XXH3_SECRET_DEFAULT_SIZE + 500, { 0x7E, 0x48, 0x0C, 0xA7 } }
-};
-
-static void XSUM_checkResult32(XXH32_hash_t r1, XXH32_hash_t r2)
-{
- static int nbTests = 1;
- if (r1!=r2) {
- XSUM_log("\rError: 32-bit hash test %i: Internal sanity check failed!\n", nbTests);
- XSUM_log("\rGot 0x%08X, expected 0x%08X.\n", (unsigned)r1, (unsigned)r2);
- XSUM_log("\rNote: If you modified the hash functions, make sure to either update the values\n"
- "or temporarily recompile with XSUM_NO_TESTS=1.\n");
- exit(1);
- }
- nbTests++;
-}
-
-static void XSUM_checkResult64(XXH64_hash_t r1, XXH64_hash_t r2)
-{
- static int nbTests = 1;
- if (r1!=r2) {
- XSUM_log("\rError: 64-bit hash test %i: Internal sanity check failed!\n", nbTests);
- XSUM_log("\rGot 0x%08X%08XULL, expected 0x%08X%08XULL.\n",
- (unsigned)(r1>>32), (unsigned)r1, (unsigned)(r2>>32), (unsigned)r2);
- XSUM_log("\rNote: If you modified the hash functions, make sure to either update the values\n"
- "or temporarily recompile with XSUM_NO_TESTS=1.\n");
- exit(1);
- }
- nbTests++;
-}
-
-static void XSUM_checkResult128(XXH128_hash_t r1, XXH128_hash_t r2)
-{
- static int nbTests = 1;
- if ((r1.low64 != r2.low64) || (r1.high64 != r2.high64)) {
- XSUM_log("\rError: 128-bit hash test %i: Internal sanity check failed.\n", nbTests);
- XSUM_log("\rGot { 0x%08X%08XULL, 0x%08X%08XULL }, expected { 0x%08X%08XULL, 0x%08X%08XULL } \n",
- (unsigned)(r1.low64>>32), (unsigned)r1.low64, (unsigned)(r1.high64>>32), (unsigned)r1.high64,
- (unsigned)(r2.low64>>32), (unsigned)r2.low64, (unsigned)(r2.high64>>32), (unsigned)r2.high64 );
- XSUM_log("\rNote: If you modified the hash functions, make sure to either update the values\n"
- "or temporarily recompile with XSUM_NO_TESTS=1.\n");
- exit(1);
- }
- nbTests++;
-}
-
-
-static void XSUM_testXXH32(const void* data, const XSUM_testdata32_t* testData)
-{
- XXH32_state_t *state = XXH32_createState();
- size_t pos;
-
- size_t len = testData->len;
- XSUM_U32 seed = testData->seed;
- XSUM_U32 Nresult = testData->Nresult;
-
- if (len == 0) {
- data = NULL;
- } else {
- assert(data != NULL);
- }
-
- assert(state != NULL);
-
- XSUM_checkResult32(XXH32(data, len, seed), Nresult);
-
- (void)XXH32_reset(state, seed);
- (void)XXH32_update(state, data, len);
- XSUM_checkResult32(XXH32_digest(state), Nresult);
-
- (void)XXH32_reset(state, seed);
- for (pos=0; pos<len; pos++)
- (void)XXH32_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult32(XXH32_digest(state), Nresult);
- XXH32_freeState(state);
-}
-
-static void XSUM_testXXH64(const void* data, const XSUM_testdata64_t* testData)
-{
- XXH64_state_t *state = XXH64_createState();
- size_t pos;
-
- size_t len = (size_t)testData->len;
- XSUM_U64 seed = testData->seed;
- XSUM_U64 Nresult = testData->Nresult;
-
- if (len == 0) {
- data = NULL;
- } else {
- assert(data != NULL);
- }
-
- assert(state != NULL);
-
- XSUM_checkResult64(XXH64(data, len, seed), Nresult);
-
- (void)XXH64_reset(state, seed);
- (void)XXH64_update(state, data, len);
- XSUM_checkResult64(XXH64_digest(state), Nresult);
-
- (void)XXH64_reset(state, seed);
- for (pos=0; pos<len; pos++)
- (void)XXH64_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult64(XXH64_digest(state), Nresult);
- XXH64_freeState(state);
-}
-
-/*
- * Used to get "random" (but actually 100% reproducible) lengths for
- * XSUM_XXH3_randomUpdate.
- */
-static XSUM_U32 XSUM_rand(void)
-{
- static XSUM_U64 seed = PRIME32;
- seed *= PRIME64;
- return (XSUM_U32)(seed >> 40);
-}
-
-/*
- * Technically, XXH3_64bits_update is identical to XXH3_128bits_update as of
- * v0.8.0, but we treat them as separate.
- */
-typedef XXH_errorcode (*XSUM_XXH3_update_t)(XXH3_state_t* state, const void* input, size_t length);
-
-/*
- * Runs the passed XXH3_update variant on random lengths. This is to test the
- * more complex logic of the update function, catching bugs like this one:
- * https://github.com/Cyan4973/xxHash/issues/378
- */
-static void XSUM_XXH3_randomUpdate(XXH3_state_t* state, const void* data,
- size_t len, XSUM_XXH3_update_t update_fn)
-{
- size_t p = 0;
- while (p < len) {
- size_t const modulo = len > 2 ? len : 2;
- size_t l = (size_t)(XSUM_rand()) % modulo;
- if (p + l > len) l = len - p;
- (void)update_fn(state, (const char*)data+p, l);
- p += l;
- }
-}
-
-static void XSUM_testXXH3(const void* data, const XSUM_testdata64_t* testData)
-{
- size_t len = testData->len;
- XSUM_U64 seed = testData->seed;
- XSUM_U64 Nresult = testData->Nresult;
- if (len == 0) {
- data = NULL;
- } else {
- assert(data != NULL);
- }
- { XSUM_U64 const Dresult = XXH3_64bits_withSeed(data, len, seed);
- XSUM_checkResult64(Dresult, Nresult);
- }
-
- /* check that the no-seed variant produces same result as seed==0 */
- if (seed == 0) {
- XSUM_U64 const Dresult = XXH3_64bits(data, len);
- XSUM_checkResult64(Dresult, Nresult);
- }
-
- /* streaming API test */
- { XXH3_state_t* const state = XXH3_createState();
- assert(state != NULL);
- /* single ingestion */
- (void)XXH3_64bits_reset_withSeed(state, seed);
- (void)XXH3_64bits_update(state, data, len);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
-
- /* random ingestion */
- (void)XXH3_64bits_reset_withSeed(state, seed);
- XSUM_XXH3_randomUpdate(state, data, len, &XXH3_64bits_update);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
-
- /* byte by byte ingestion */
- { size_t pos;
- (void)XXH3_64bits_reset_withSeed(state, seed);
- for (pos=0; pos<len; pos++)
- (void)XXH3_64bits_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
- }
- XXH3_freeState(state);
- }
-}
-
-static void XSUM_testXXH3_withSecret(const void* data, const void* secret,
- size_t secretSize, const XSUM_testdata64_t* testData)
-{
- size_t len = (size_t)testData->len;
- XSUM_U64 Nresult = testData->Nresult;
-
- if (len == 0) {
- data = NULL;
- } else {
- assert(data != NULL);
- }
- { XSUM_U64 const Dresult = XXH3_64bits_withSecret(data, len, secret, secretSize);
- XSUM_checkResult64(Dresult, Nresult);
- }
-
- /* streaming API test */
- { XXH3_state_t *state = XXH3_createState();
- assert(state != NULL);
- (void)XXH3_64bits_reset_withSecret(state, secret, secretSize);
- (void)XXH3_64bits_update(state, data, len);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
-
- /* random ingestion */
- (void)XXH3_64bits_reset_withSecret(state, secret, secretSize);
- XSUM_XXH3_randomUpdate(state, data, len, &XXH3_64bits_update);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
-
- /* byte by byte ingestion */
- { size_t pos;
- (void)XXH3_64bits_reset_withSecret(state, secret, secretSize);
- for (pos=0; pos<len; pos++)
- (void)XXH3_64bits_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult64(XXH3_64bits_digest(state), Nresult);
- }
- XXH3_freeState(state);
- }
-}
-
-static void XSUM_testXXH128(const void* data, const XSUM_testdata128_t* testData)
-{
- size_t len = (size_t)testData->len;
- XSUM_U64 seed = testData->seed;
- XXH128_hash_t const Nresult = testData->Nresult;
- if (len == 0) {
- data = NULL;
- } else {
- assert(data != NULL);
- }
-
- { XXH128_hash_t const Dresult = XXH3_128bits_withSeed(data, len, seed);
- XSUM_checkResult128(Dresult, Nresult);
- }
-
- /* check that XXH128() is identical to XXH3_128bits_withSeed() */
- { XXH128_hash_t const Dresult2 = XXH128(data, len, seed);
- XSUM_checkResult128(Dresult2, Nresult);
- }
-
- /* check that the no-seed variant produces same result as seed==0 */
- if (seed == 0) {
- XXH128_hash_t const Dresult = XXH3_128bits(data, len);
- XSUM_checkResult128(Dresult, Nresult);
- }
-
- /* streaming API test */
- { XXH3_state_t *state = XXH3_createState();
- assert(state != NULL);
-
- /* single ingestion */
- (void)XXH3_128bits_reset_withSeed(state, seed);
- (void)XXH3_128bits_update(state, data, len);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
-
- /* random ingestion */
- (void)XXH3_128bits_reset_withSeed(state, seed);
- XSUM_XXH3_randomUpdate(state, data, len, &XXH3_128bits_update);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
-
- /* byte by byte ingestion */
- { size_t pos;
- (void)XXH3_128bits_reset_withSeed(state, seed);
- for (pos=0; pos<len; pos++)
- (void)XXH3_128bits_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
- }
- XXH3_freeState(state);
- }
-}
-
-static void XSUM_testXXH128_withSecret(const void* data, const void* secret, size_t secretSize, const XSUM_testdata128_t* testData)
-{
- size_t len = testData->len;
- XXH128_hash_t Nresult = testData->Nresult;
- if (len == 0) {
- data = NULL;
- } else if (len>0) {
- assert(data != NULL);
- }
- { XXH128_hash_t const Dresult = XXH3_128bits_withSecret(data, len, secret, secretSize);
- XSUM_checkResult128(Dresult, Nresult);
- }
-
- /* streaming API test */
- { XXH3_state_t* const state = XXH3_createState();
- assert(state != NULL);
- (void)XXH3_128bits_reset_withSecret(state, secret, secretSize);
- (void)XXH3_128bits_update(state, data, len);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
-
- /* random ingestion */
- (void)XXH3_128bits_reset_withSecret(state, secret, secretSize);
- XSUM_XXH3_randomUpdate(state, data, len, &XXH3_128bits_update);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
-
- /* byte by byte ingestion */
- { size_t pos;
- (void)XXH3_128bits_reset_withSecret(state, secret, secretSize);
- for (pos=0; pos<len; pos++)
- (void)XXH3_128bits_update(state, ((const char*)data)+pos, 1);
- XSUM_checkResult128(XXH3_128bits_digest(state), Nresult);
- }
- XXH3_freeState(state);
- }
-}
-
-static void XSUM_testSecretGenerator(const void* customSeed, const XSUM_testdata_sample_t* testData)
-{
- static int nbTests = 1;
- const int sampleIndex[SECRET_SAMPLE_NBBYTES] = { 0, 62, 131, 191};
- XSUM_U8 secretBuffer[XXH3_SECRET_DEFAULT_SIZE] = {0};
- XSUM_U8 samples[SECRET_SAMPLE_NBBYTES];
- int i;
-
- XXH3_generateSecret(secretBuffer, customSeed, testData->len);
- for (i=0; i<SECRET_SAMPLE_NBBYTES; i++) {
- samples[i] = secretBuffer[sampleIndex[i]];
- }
- if (memcmp(samples, testData->byte, sizeof(testData->byte))) {
- XSUM_log("\rError: Secret generation test %i: Internal sanity check failed. \n", nbTests);
- XSUM_log("\rGot { 0x%02X, 0x%02X, 0x%02X, 0x%02X }, expected { 0x%02X, 0x%02X, 0x%02X, 0x%02X } \n",
- samples[0], samples[1], samples[2], samples[3],
- testData->byte[0], testData->byte[1], testData->byte[2], testData->byte[3] );
- exit(1);
- }
- nbTests++;
-}
-
-/*!
- * XSUM_sanityCheck():
- * Runs a sanity check before the benchmark.
- *
- * Exits on an incorrect output.
- */
-XSUM_API void XSUM_sanityCheck(void)
-{
- size_t i;
-#define SANITY_BUFFER_SIZE 2367
- XSUM_U8 sanityBuffer[SANITY_BUFFER_SIZE];
- const void* const secret = sanityBuffer + 7;
- const size_t secretSize = XXH3_SECRET_SIZE_MIN + 11;
- assert(sizeof(sanityBuffer) >= 7 + secretSize);
-
- XSUM_fillTestBuffer(sanityBuffer, sizeof(sanityBuffer));
-
- /* XXH32 */
- for (i = 0; i < (sizeof(XSUM_XXH32_testdata)/sizeof(XSUM_XXH32_testdata[0])); i++) {
- XSUM_testXXH32(sanityBuffer, &XSUM_XXH32_testdata[i]);
- }
- /* XXH64 */
- for (i = 0; i < (sizeof(XSUM_XXH64_testdata)/sizeof(XSUM_XXH64_testdata[0])); i++) {
- XSUM_testXXH64(sanityBuffer, &XSUM_XXH64_testdata[i]);
- }
- /* XXH3_64bits, seeded */
- for (i = 0; i < (sizeof(XSUM_XXH3_testdata)/sizeof(XSUM_XXH3_testdata[0])); i++) {
- XSUM_testXXH3(sanityBuffer, &XSUM_XXH3_testdata[i]);
- }
- /* XXH3_64bits, custom secret */
- for (i = 0; i < (sizeof(XSUM_XXH3_withSecret_testdata)/sizeof(XSUM_XXH3_withSecret_testdata[0])); i++) {
- XSUM_testXXH3_withSecret(sanityBuffer, secret, secretSize, &XSUM_XXH3_withSecret_testdata[i]);
- }
- /* XXH128 */
- for (i = 0; i < (sizeof(XSUM_XXH128_testdata)/sizeof(XSUM_XXH128_testdata[0])); i++) {
- XSUM_testXXH128(sanityBuffer, &XSUM_XXH128_testdata[i]);
- }
- /* XXH128 with custom Secret */
- for (i = 0; i < (sizeof(XSUM_XXH128_withSecret_testdata)/sizeof(XSUM_XXH128_withSecret_testdata[0])); i++) {
- XSUM_testXXH128_withSecret(sanityBuffer, secret, secretSize, &XSUM_XXH128_withSecret_testdata[i]);
- }
- /* secret generator */
- for (i = 0; i < (sizeof(XSUM_XXH3_generateSecret_testdata)/sizeof(XSUM_XXH3_generateSecret_testdata[0])); i++) {
- XSUM_testSecretGenerator(sanityBuffer, &XSUM_XXH3_generateSecret_testdata[i]);
- }
-
- XSUM_logVerbose(3, "\r%70s\r", ""); /* Clean display line */
- XSUM_logVerbose(3, "Sanity check -- all tests ok\n");
-}
-
-#endif /* !XSUM_NO_TESTS */
diff --git a/grpc/third_party/xxhash/cli/xsum_sanity_check.h b/grpc/third_party/xxhash/cli/xsum_sanity_check.h
deleted file mode 100644
index 9f3f2b85..00000000
--- a/grpc/third_party/xxhash/cli/xsum_sanity_check.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef XSUM_SANITY_CHECK_H
-#define XSUM_SANITY_CHECK_H
-
-#include "xsum_config.h" /* XSUM_API, XSUM_U8 */
-
-#include <stddef.h> /* size_t */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Runs a series of self-tests.
- *
- * Exits if any of these tests fail, printing a message to stderr.
- *
- * If XSUM_NO_TESTS is defined to non-zero, this will instead print a warning
- * if this is called (e.g. via xxhsum -b).
- */
-XSUM_API void XSUM_sanityCheck(void);
-
-/*
- * Fills a test buffer with pseudorandom data.
- *
- * This is used in the sanity check and the benchmarks - its values must not be
- * changed.
- */
-XSUM_API void XSUM_fillTestBuffer(XSUM_U8* buffer, size_t len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* XSUM_SANITY_CHECK_H */
diff --git a/grpc/third_party/xxhash/cmake_unofficial/.gitignore b/grpc/third_party/xxhash/cmake_unofficial/.gitignore
deleted file mode 100644
index 93d9fe4f..00000000
--- a/grpc/third_party/xxhash/cmake_unofficial/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-# cmake artifacts
-
-CMakeCache.txt
-CMakeFiles
-Makefile
-cmake_install.cmake
-
-
-# make compilation results
-
-*.dylib
-*.a
diff --git a/grpc/third_party/xxhash/cmake_unofficial/CMakeLists.txt b/grpc/third_party/xxhash/cmake_unofficial/CMakeLists.txt
deleted file mode 100644
index 41c71121..00000000
--- a/grpc/third_party/xxhash/cmake_unofficial/CMakeLists.txt
+++ /dev/null
@@ -1,173 +0,0 @@
-# To the extent possible under law, the author(s) have dedicated all
-# copyright and related and neighboring rights to this software to
-# the public domain worldwide. This software is distributed without
-# any warranty.
-#
-# For details, see <https://creativecommons.org/publicdomain/zero/1.0/>.
-
-cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
-
-set(XXHASH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
-
-file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_MAJOR REGEX "^#define XXH_VERSION_MAJOR +([0-9]+) *$")
-string(REGEX REPLACE "^#define XXH_VERSION_MAJOR +([0-9]+) *$" "\\1" XXHASH_VERSION_MAJOR "${XXHASH_VERSION_MAJOR}")
-file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_MINOR REGEX "^#define XXH_VERSION_MINOR +([0-9]+) *$")
-string(REGEX REPLACE "^#define XXH_VERSION_MINOR +([0-9]+) *$" "\\1" XXHASH_VERSION_MINOR "${XXHASH_VERSION_MINOR}")
-file(STRINGS "${XXHASH_DIR}/xxhash.h" XXHASH_VERSION_RELEASE REGEX "^#define XXH_VERSION_RELEASE +([0-9]+) *$")
-string(REGEX REPLACE "^#define XXH_VERSION_RELEASE +([0-9]+) *$" "\\1" XXHASH_VERSION_RELEASE "${XXHASH_VERSION_RELEASE}")
-set(XXHASH_VERSION_STRING "${XXHASH_VERSION_MAJOR}.${XXHASH_VERSION_MINOR}.${XXHASH_VERSION_RELEASE}")
-set(XXHASH_LIB_VERSION ${XXHASH_VERSION_STRING})
-set(XXHASH_LIB_SOVERSION "${XXHASH_VERSION_MAJOR}")
-mark_as_advanced(XXHASH_VERSION_MAJOR XXHASH_VERSION_MINOR XXHASH_VERSION_RELEASE XXHASH_VERSION_STRING XXHASH_LIB_VERSION XXHASH_LIB_SOVERSION)
-
-if("${CMAKE_VERSION}" VERSION_LESS "3.13")
- #message(WARNING "CMake ${CMAKE_VERSION} has no CMP0077 policy: options will erase uncached/untyped normal vars!")
-else()
- cmake_policy (SET CMP0077 NEW)
-endif()
-if("${CMAKE_VERSION}" VERSION_LESS "3.0")
- project(xxHash C)
-else()
- cmake_policy (SET CMP0048 NEW)
- project(xxHash
- VERSION ${XXHASH_VERSION_STRING}
- LANGUAGES C)
-endif()
-
-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
- set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Project build type" FORCE)
- set_property(CACHE CMAKE_BUILD_TYPE
- PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
-endif()
-if(NOT CMAKE_CONFIGURATION_TYPES)
- message(STATUS "xxHash build type: ${CMAKE_BUILD_TYPE}")
-endif()
-
-option(BUILD_SHARED_LIBS "Build shared library" ON)
-option(XXHASH_BUILD_XXHSUM "Build the xxhsum binary" ON)
-
-# If XXHASH is being bundled in another project, we don't want to
-# install anything. However, we want to let people override this, so
-# we'll use the XXHASH_BUNDLED_MODE variable to let them do that; just
-# set it to OFF in your project before you add_subdirectory(xxhash/cmake_unofficial).
-if(NOT DEFINED XXHASH_BUNDLED_MODE)
- if("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
- set(XXHASH_BUNDLED_MODE OFF)
- else()
- set(XXHASH_BUNDLED_MODE ON)
- endif()
-endif()
-set(XXHASH_BUNDLED_MODE ${XXHASH_BUNDLED_MODE} CACHE BOOL "" FORCE)
-mark_as_advanced(XXHASH_BUNDLED_MODE)
-
-# Allow people to choose whether to build shared or static libraries
-# via the BUILD_SHARED_LIBS option unless we are in bundled mode, in
-# which case we always use static libraries.
-include(CMakeDependentOption)
-CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT XXHASH_BUNDLED_MODE" OFF)
-
-# libxxhash
-add_library(xxhash "${XXHASH_DIR}/xxhash.c")
-add_library(${PROJECT_NAME}::xxhash ALIAS xxhash)
-
-target_include_directories(xxhash
- PUBLIC
- $<BUILD_INTERFACE:${XXHASH_DIR}>
- $<INSTALL_INTERFACE:include/>)
-if (BUILD_SHARED_LIBS)
- target_compile_definitions(xxhash PUBLIC XXH_EXPORT)
-endif ()
-set_target_properties(xxhash PROPERTIES
- SOVERSION "${XXHASH_VERSION_STRING}"
- VERSION "${XXHASH_VERSION_STRING}")
-
-if(XXHASH_BUILD_XXHSUM)
- set(XXHSUM_DIR "${XXHASH_DIR}/cli")
- # xxhsum
- add_executable(xxhsum "${XXHASH_DIR}/xxhsum.c"
- "${XXHSUM_DIR}/xsum_os_specific.c"
- "${XXHSUM_DIR}/xsum_output.c"
- "${XXHSUM_DIR}/xsum_sanity_check.c"
- )
- add_executable(${PROJECT_NAME}::xxhsum ALIAS xxhsum)
-
- target_link_libraries(xxhsum PRIVATE xxhash)
- target_include_directories(xxhsum PRIVATE "${XXHASH_DIR}")
-endif(XXHASH_BUILD_XXHSUM)
-
-# Extra warning flags
-include (CheckCCompilerFlag)
-if (XXHASH_C_FLAGS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XXHASH_C_FLAGS}")
-endif()
-foreach (flag
- -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow
- -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement
- -Wstrict-prototypes -Wundef)
- # Because https://gcc.gnu.org/wiki/FAQ#wnowarning
- string(REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}")
- string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" test_name "CFLAG_${flag_to_test}")
-
- check_c_compiler_flag("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${test_name})
-
- if(${test_name})
- set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
- endif()
-
- unset(test_name)
- unset(flag_to_test)
-endforeach (flag)
-
-if(NOT XXHASH_BUNDLED_MODE)
- include(GNUInstallDirs)
-
- install(TARGETS xxhash
- EXPORT xxHashTargets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
- install(FILES "${XXHASH_DIR}/xxhash.h"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
- install(FILES "${XXHASH_DIR}/xxh3.h"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
- if(XXHASH_BUILD_XXHSUM)
- install(TARGETS xxhsum
- EXPORT xxHashTargets
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
- install(FILES "${XXHASH_DIR}/xxhsum.1"
- DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
- endif(XXHASH_BUILD_XXHSUM)
-
- include(CMakePackageConfigHelpers)
-
- set(xxHash_VERSION_CONFIG "${PROJECT_BINARY_DIR}/xxHashConfigVersion.cmake")
- set(xxHash_PROJECT_CONFIG "${PROJECT_BINARY_DIR}/xxHashConfig.cmake")
- set(xxHash_TARGETS_CONFIG "${PROJECT_BINARY_DIR}/xxHashTargets.cmake")
- set(xxHash_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/xxHash/")
- write_basic_package_version_file(${xxHash_VERSION_CONFIG}
- VERSION ${XXHASH_VERSION_STRING}
- COMPATIBILITY AnyNewerVersion)
- configure_package_config_file(
- ${PROJECT_SOURCE_DIR}/xxHashConfig.cmake.in
- ${xxHash_PROJECT_CONFIG}
- INSTALL_DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
- if("${CMAKE_VERSION}" VERSION_LESS "3.0")
- set(XXHASH_EXPORT_SET xxhash)
- if(XXHASH_BUILD_XXHSUM)
- set(XXHASH_EXPORT_SET ${XXHASH_EXPORT_SET} xxhsum)
- endif()
- export(TARGETS ${XXHASH_EXPORT_SET}
- FILE ${xxHash_TARGETS_CONFIG}
- NAMESPACE ${PROJECT_NAME}::)
- else()
- export(EXPORT xxHashTargets
- FILE ${xxHash_TARGETS_CONFIG}
- NAMESPACE ${PROJECT_NAME}::)
- endif()
-
- install(FILES ${xxHash_PROJECT_CONFIG} ${xxHash_VERSION_CONFIG}
- DESTINATION ${xxHash_CONFIG_INSTALL_DIR})
- install(EXPORT xxHashTargets
- DESTINATION ${xxHash_CONFIG_INSTALL_DIR}
- NAMESPACE ${PROJECT_NAME}::)
-endif(NOT XXHASH_BUNDLED_MODE)
diff --git a/grpc/third_party/xxhash/cmake_unofficial/README.md b/grpc/third_party/xxhash/cmake_unofficial/README.md
deleted file mode 100644
index 66df7909..00000000
--- a/grpc/third_party/xxhash/cmake_unofficial/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-
-## Usage
-
-### Way 1: import targets
-Build xxHash targets:
-
- cd </path/to/xxHash/>
- mkdir build
- cd build
- cmake ../cmake_unofficial [options]
- cmake --build .
- cmake --build . --target install #optional
-
-Where possible options are:
-- `-DXXHASH_BUILD_ENABLE_INLINE_API=<ON|OFF>`: adds xxhash.c for the `-DXXH_INLINE_ALL` api. ON by default.
-- `-DXXHASH_BUILD_XXHSUM=<ON|OFF>`: build the command line binary. ON by default
-- `-DBUILD_SHARED_LIBS=<ON|OFF>`: build dynamic library. ON by default.
-- `-DCMAKE_INSTALL_PREFIX=<path>`: use custom install prefix path.
-
-Add lines into downstream CMakeLists.txt:
-
- find_package(xxHash 0.7 CONFIG REQUIRED)
- ...
- target_link_libraries(MyTarget PRIVATE xxHash::xxhash)
-
-### Way 2: Add subdirectory
-Add lines into downstream CMakeLists.txt:
-
- option(BUILD_SHARED_LIBS "Build shared libs" OFF) #optional
- ...
- set(XXHASH_BUILD_ENABLE_INLINE_API OFF) #optional
- set(XXHASH_BUILD_XXHSUM OFF) #optional
- add_subdirectory(</path/to/xxHash/cmake_unofficial/> </path/to/xxHash/build/> EXCLUDE_FROM_ALL)
- ...
- target_link_libraries(MyTarget PRIVATE xxHash::xxhash)
-
diff --git a/grpc/third_party/xxhash/cmake_unofficial/xxHashConfig.cmake.in b/grpc/third_party/xxhash/cmake_unofficial/xxHashConfig.cmake.in
deleted file mode 100644
index fd282bee..00000000
--- a/grpc/third_party/xxhash/cmake_unofficial/xxHashConfig.cmake.in
+++ /dev/null
@@ -1,4 +0,0 @@
-@PACKAGE_INIT@
-
-include(${CMAKE_CURRENT_LIST_DIR}/xxHashTargets.cmake)
-
diff --git a/grpc/third_party/xxhash/doc/README.md b/grpc/third_party/xxhash/doc/README.md
deleted file mode 100644
index a73ad729..00000000
--- a/grpc/third_party/xxhash/doc/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-xxHash Specification
-=======================
-
-This directory contains material defining the xxHash algorithm.
-It's described in [this specification document](xxhash_spec.md).
-
-The algorithm is also be illustrated by a [simple educational library](https://github.com/easyaspi314/xxhash-clean),
-written by @easyaspi314 and designed for readability
-(as opposed to the reference library which is designed for speed).
diff --git a/grpc/third_party/xxhash/doc/xxhash.cry b/grpc/third_party/xxhash/doc/xxhash.cry
deleted file mode 100644
index 984e1c8b..00000000
--- a/grpc/third_party/xxhash/doc/xxhash.cry
+++ /dev/null
@@ -1,206 +0,0 @@
-module xxhash where
-
-/**
- * The 32-bit variant of xxHash. The first argument is the sequence
- * of L bytes to hash. The second argument is a seed value.
- */
-XXH32 : {L} (fin L) => [L][8] -> [32] -> [32]
-XXH32 input seed = XXH32_avalanche acc1
- where (stripes16 # stripes4 # stripes1) = input
- accR = foldl XXH32_rounds (XXH32_init seed) (split stripes16 : [L/16][16][8])
- accL = `(L % 2^^32) + if (`L:Integer) < 16
- then seed + PRIME32_5
- else XXH32_converge accR
- acc4 = foldl XXH32_digest4 accL (split stripes4 : [(L%16)/4][4][8])
- acc1 = foldl XXH32_digest1 acc4 (stripes1 : [L%4][8])
-
-/**
- * The 64-bit variant of xxHash. The first argument is the sequence
- * of L bytes to hash. The second argument is a seed value.
- */
-XXH64 : {L} (fin L) => [L][8] -> [64] -> [64]
-XXH64 input seed = XXH64_avalanche acc1
- where (stripes32 # stripes8 # stripes4 # stripes1) = input
- accR = foldl XXH64_rounds (XXH64_init seed) (split stripes32 : [L/32][32][8])
- accL = `(L % 2^^64) + if (`L:Integer) < 32
- then seed + PRIME64_5
- else XXH64_converge accR
- acc8 = foldl XXH64_digest8 accL (split stripes8 : [(L%32)/8][8][8])
- acc4 = foldl XXH64_digest4 acc8 (split stripes4 : [(L%8)/4][4][8])
- acc1 = foldl XXH64_digest1 acc4 (stripes1 : [L%4][8])
-
-private
-
- //Utility functions
-
- /**
- * Combines a sequence of bytes into a word using the little-endian
- * convention.
- */
- toLE bytes = join (reverse bytes)
-
- //32-bit xxHash helper functions
-
- //32-bit prime number constants
- PRIME32_1 = 0x9E3779B1 : [32]
- PRIME32_2 = 0x85EBCA77 : [32]
- PRIME32_3 = 0xC2B2AE3D : [32]
- PRIME32_4 = 0x27D4EB2F : [32]
- PRIME32_5 = 0x165667B1 : [32]
-
- /**
- * The property shows that the hexadecimal representation of the
- * PRIME32 constants is the same as the binary representation.
- */
- property PRIME32s_as_bits_correct =
- (PRIME32_1 == 0b10011110001101110111100110110001) /\
- (PRIME32_2 == 0b10000101111010111100101001110111) /\
- (PRIME32_3 == 0b11000010101100101010111000111101) /\
- (PRIME32_4 == 0b00100111110101001110101100101111) /\
- (PRIME32_5 == 0b00010110010101100110011110110001)
-
- /**
- * This function initializes the four internal accumulators of XXH32.
- */
- XXH32_init : [32] -> [4][32]
- XXH32_init seed = [acc1, acc2, acc3, acc4]
- where acc1 = seed + PRIME32_1 + PRIME32_2
- acc2 = seed + PRIME32_2
- acc3 = seed + 0
- acc4 = seed - PRIME32_1
-
- /**
- * This processes a single lane of the main round function of XXH32.
- */
- XXH32_round : [32] -> [32] -> [32]
- XXH32_round accN laneN = ((accN + laneN * PRIME32_2) <<< 13) * PRIME32_1
-
- /**
- * This is the main round function of XXH32 and processes a stripe,
- * i.e. 4 lanes with 4 bytes each.
- */
- XXH32_rounds : [4][32] -> [16][8] -> [4][32]
- XXH32_rounds accs stripe =
- [ XXH32_round accN (toLE laneN) | accN <- accs | laneN <- split stripe ]
-
- /**
- * This function combines the four lane accumulators into a single
- * 32-bit value.
- */
- XXH32_converge : [4][32] -> [32]
- XXH32_converge [acc1, acc2, acc3, acc4] =
- (acc1 <<< 1) + (acc2 <<< 7) + (acc3 <<< 12) + (acc4 <<< 18)
-
- /**
- * This function digests a four byte lane
- */
- XXH32_digest4 : [32] -> [4][8] -> [32]
- XXH32_digest4 acc lane = ((acc + toLE lane * PRIME32_3) <<< 17) * PRIME32_4
-
- /**
- * This function digests a single byte lane
- */
- XXH32_digest1 : [32] -> [8] -> [32]
- XXH32_digest1 acc lane = ((acc + (0 # lane) * PRIME32_5) <<< 11) * PRIME32_1
-
- /**
- * This function ensures that all input bits have a chance to impact
- * any bit in the output digest, resulting in an unbiased
- * distribution.
- */
- XXH32_avalanche : [32] -> [32]
- XXH32_avalanche acc0 = acc5
- where acc1 = acc0 ^ (acc0 >> 15)
- acc2 = acc1 * PRIME32_2
- acc3 = acc2 ^ (acc2 >> 13)
- acc4 = acc3 * PRIME32_3
- acc5 = acc4 ^ (acc4 >> 16)
-
- //64-bit xxHash helper functions
-
- //64-bit prime number constants
- PRIME64_1 = 0x9E3779B185EBCA87 : [64]
- PRIME64_2 = 0xC2B2AE3D27D4EB4F : [64]
- PRIME64_3 = 0x165667B19E3779F9 : [64]
- PRIME64_4 = 0x85EBCA77C2B2AE63 : [64]
- PRIME64_5 = 0x27D4EB2F165667C5 : [64]
-
- /**
- * The property shows that the hexadecimal representation of the
- * PRIME64 constants is the same as the binary representation.
- */
- property PRIME64s_as_bits_correct =
- (PRIME64_1 == 0b1001111000110111011110011011000110000101111010111100101010000111) /\
- (PRIME64_2 == 0b1100001010110010101011100011110100100111110101001110101101001111) /\
- (PRIME64_3 == 0b0001011001010110011001111011000110011110001101110111100111111001) /\
- (PRIME64_4 == 0b1000010111101011110010100111011111000010101100101010111001100011) /\
- (PRIME64_5 == 0b0010011111010100111010110010111100010110010101100110011111000101)
-
- /**
- * This function initializes the four internal accumulators of XXH64.
- */
- XXH64_init : [64] -> [4][64]
- XXH64_init seed = [acc1, acc2, acc3, acc4]
- where acc1 = seed + PRIME64_1 + PRIME64_2
- acc2 = seed + PRIME64_2
- acc3 = seed + 0
- acc4 = seed - PRIME64_1
-
- /**
- * This processes a single lane of the main round function of XXH64.
- */
- XXH64_round : [64] -> [64] -> [64]
- XXH64_round accN laneN = ((accN + laneN * PRIME64_2) <<< 31) * PRIME64_1
-
- /**
- * This is the main round function of XXH64 and processes a stripe,
- * i.e. 4 lanes with 8 bytes each.
- */
- XXH64_rounds : [4][64] -> [32][8] -> [4][64]
- XXH64_rounds accs stripe =
- [ XXH64_round accN (toLE laneN) | accN <- accs | laneN <- split stripe ]
-
- /**
- * This is a helper function, used to merge the four lane accumulators.
- */
- mergeAccumulator : [64] -> [64] -> [64]
- mergeAccumulator acc accN = (acc ^ XXH64_round 0 accN) * PRIME64_1 + PRIME64_4
-
- /**
- * This function combines the four lane accumulators into a single
- * 64-bit value.
- */
- XXH64_converge : [4][64] -> [64]
- XXH64_converge [acc1, acc2, acc3, acc4] =
- foldl mergeAccumulator ((acc1 <<< 1) + (acc2 <<< 7) + (acc3 <<< 12) + (acc4 <<< 18)) [acc1, acc2, acc3, acc4]
-
- /**
- * This function digests an eight byte lane
- */
- XXH64_digest8 : [64] -> [8][8] -> [64]
- XXH64_digest8 acc lane = ((acc ^ XXH64_round 0 (toLE lane)) <<< 27) * PRIME64_1 + PRIME64_4
-
- /**
- * This function digests a four byte lane
- */
- XXH64_digest4 : [64] -> [4][8] -> [64]
- XXH64_digest4 acc lane = ((acc ^ (0 # toLE lane) * PRIME64_1) <<< 23) * PRIME64_2 + PRIME64_3
-
- /**
- * This function digests a single byte lane
- */
- XXH64_digest1 : [64] -> [8] -> [64]
- XXH64_digest1 acc lane = ((acc ^ (0 # lane) * PRIME64_5) <<< 11) * PRIME64_1
-
- /**
- * This function ensures that all input bits have a chance to impact
- * any bit in the output digest, resulting in an unbiased
- * distribution.
- */
- XXH64_avalanche : [64] -> [64]
- XXH64_avalanche acc0 = acc5
- where acc1 = acc0 ^ (acc0 >> 33)
- acc2 = acc1 * PRIME64_2
- acc3 = acc2 ^ (acc2 >> 29)
- acc4 = acc3 * PRIME64_3
- acc5 = acc4 ^ (acc4 >> 32)
diff --git a/grpc/third_party/xxhash/doc/xxhash_spec.md b/grpc/third_party/xxhash/doc/xxhash_spec.md
deleted file mode 100644
index af7ba90d..00000000
--- a/grpc/third_party/xxhash/doc/xxhash_spec.md
+++ /dev/null
@@ -1,317 +0,0 @@
-xxHash fast digest algorithm
-======================
-
-### Notices
-
-Copyright (c) Yann Collet
-
-Permission is granted to copy and distribute this document
-for any purpose and without charge,
-including translations into other languages
-and incorporation into compilations,
-provided that the copyright notice and this notice are preserved,
-and that any substantive changes or deletions from the original
-are clearly marked.
-Distribution of this document is unlimited.
-
-### Version
-
-0.1.1 (10/10/18)
-
-
-Table of Contents
----------------------
-- [Introduction](#introduction)
-- [XXH32 algorithm description](#xxh32-algorithm-description)
-- [XXH64 algorithm description](#xxh64-algorithm-description)
-- [Performance considerations](#performance-considerations)
-- [Reference Implementation](#reference-implementation)
-
-
-Introduction
-----------------
-
-This document describes the xxHash digest algorithm for both 32-bit and 64-bit variants, named `XXH32` and `XXH64`. The algorithm takes an input a message of arbitrary length and an optional seed value, then produces an output of 32 or 64-bit as "fingerprint" or "digest".
-
-xxHash is primarily designed for speed. It is labeled non-cryptographic, and is not meant to avoid intentional collisions (same digest for 2 different messages), or to prevent producing a message with a predefined digest.
-
-XXH32 is designed to be fast on 32-bit machines.
-XXH64 is designed to be fast on 64-bit machines.
-Both variants produce different output.
-However, a given variant shall produce exactly the same output, irrespective of the cpu / os used. In particular, the result remains identical whatever the endianness and width of the cpu is.
-
-### Operation notations
-
-All operations are performed modulo {32,64} bits. Arithmetic overflows are expected.
-`XXH32` uses 32-bit modular operations. `XXH64` uses 64-bit modular operations.
-
-- `+`: denotes modular addition
-- `*`: denotes modular multiplication
-- `X <<< s`: denotes the value obtained by circularly shifting (rotating) `X` left by `s` bit positions.
-- `X >> s`: denotes the value obtained by shifting `X` right by s bit positions. Upper `s` bits become `0`.
-- `X xor Y`: denotes the bit-wise XOR of `X` and `Y` (same width).
-
-
-XXH32 Algorithm Description
--------------------------------------
-
-### Overview
-
-We begin by supposing that we have a message of any length `L` as input, and that we wish to find its digest. Here `L` is an arbitrary nonnegative integer; `L` may be zero. The following steps are performed to compute the digest of the message.
-
-The algorithm collect and transform input in _stripes_ of 16 bytes. The transforms are stored inside 4 "accumulators", each one storing an unsigned 32-bit value. Each accumulator can be processed independently in parallel, speeding up processing for cpu with multiple execution units.
-
-The algorithm uses 32-bits addition, multiplication, rotate, shift and xor operations. Many operations require some 32-bits prime number constants, all defined below:
-
- static const u32 PRIME32_1 = 0x9E3779B1U; // 0b10011110001101110111100110110001
- static const u32 PRIME32_2 = 0x85EBCA77U; // 0b10000101111010111100101001110111
- static const u32 PRIME32_3 = 0xC2B2AE3DU; // 0b11000010101100101010111000111101
- static const u32 PRIME32_4 = 0x27D4EB2FU; // 0b00100111110101001110101100101111
- static const u32 PRIME32_5 = 0x165667B1U; // 0b00010110010101100110011110110001
-
-These constants are prime numbers, and feature a good mix of bits 1 and 0, neither too regular, nor too dissymmetric. These properties help dispersion capabilities.
-
-### Step 1. Initialize internal accumulators
-
-Each accumulator gets an initial value based on optional `seed` input. Since the `seed` is optional, it can be `0`.
-
- u32 acc1 = seed + PRIME32_1 + PRIME32_2;
- u32 acc2 = seed + PRIME32_2;
- u32 acc3 = seed + 0;
- u32 acc4 = seed - PRIME32_1;
-
-#### Special case: input is less than 16 bytes
-
-When the input is too small (< 16 bytes), the algorithm will not process any stripes. Consequently, it will not make use of parallel accumulators.
-
-In this case, a simplified initialization is performed, using a single accumulator:
-
- u32 acc = seed + PRIME32_5;
-
-The algorithm then proceeds directly to step 4.
-
-### Step 2. Process stripes
-
-A stripe is a contiguous segment of 16 bytes.
-It is evenly divided into 4 _lanes_, of 4 bytes each.
-The first lane is used to update accumulator 1, the second lane is used to update accumulator 2, and so on.
-
-Each lane read its associated 32-bit value using __little-endian__ convention.
-
-For each {lane, accumulator}, the update process is called a _round_, and applies the following formula:
-
- accN = accN + (laneN * PRIME32_2);
- accN = accN <<< 13;
- accN = accN * PRIME32_1;
-
-This shuffles the bits so that any bit from input _lane_ impacts several bits in output _accumulator_. All operations are performed modulo 2^32.
-
-Input is consumed one full stripe at a time. Step 2 is looped as many times as necessary to consume the whole input, except for the last remaining bytes which cannot form a stripe (< 16 bytes).
-When that happens, move to step 3.
-
-### Step 3. Accumulator convergence
-
-All 4 lane accumulators from the previous steps are merged to produce a single remaining accumulator of the same width (32-bit). The associated formula is as follows:
-
- acc = (acc1 <<< 1) + (acc2 <<< 7) + (acc3 <<< 12) + (acc4 <<< 18);
-
-### Step 4. Add input length
-
-The input total length is presumed known at this stage. This step is just about adding the length to accumulator, so that it participates to final mixing.
-
- acc = acc + (u32)inputLength;
-
-Note that, if input length is so large that it requires more than 32-bits, only the lower 32-bits are added to the accumulator.
-
-### Step 5. Consume remaining input
-
-There may be up to 15 bytes remaining to consume from the input.
-The final stage will digest them according to following pseudo-code:
-
- while (remainingLength >= 4) {
- lane = read_32bit_little_endian(input_ptr);
- acc = acc + lane * PRIME32_3;
- acc = (acc <<< 17) * PRIME32_4;
- input_ptr += 4; remainingLength -= 4;
- }
-
- while (remainingLength >= 1) {
- lane = read_byte(input_ptr);
- acc = acc + lane * PRIME32_5;
- acc = (acc <<< 11) * PRIME32_1;
- input_ptr += 1; remainingLength -= 1;
- }
-
-This process ensures that all input bytes are present in the final mix.
-
-### Step 6. Final mix (avalanche)
-
-The final mix ensures that all input bits have a chance to impact any bit in the output digest, resulting in an unbiased distribution. This is also called avalanche effect.
-
- acc = acc xor (acc >> 15);
- acc = acc * PRIME32_2;
- acc = acc xor (acc >> 13);
- acc = acc * PRIME32_3;
- acc = acc xor (acc >> 16);
-
-### Step 7. Output
-
-The `XXH32()` function produces an unsigned 32-bit value as output.
-
-For systems which require to store and/or display the result in binary or hexadecimal format, the canonical format is defined to reproduce the same value as the natural decimal format, hence follows __big-endian__ convention (most significant byte first).
-
-
-XXH64 Algorithm Description
--------------------------------------
-
-### Overview
-
-`XXH64`'s algorithm structure is very similar to `XXH32` one. The major difference is that `XXH64` uses 64-bit arithmetic, speeding up memory transfer for 64-bit compliant systems, but also relying on cpu capability to efficiently perform 64-bit operations.
-
-The algorithm collects and transforms input in _stripes_ of 32 bytes. The transforms are stored inside 4 "accumulators", each one storing an unsigned 64-bit value. Each accumulator can be processed independently in parallel, speeding up processing for cpu with multiple execution units.
-
-The algorithm uses 64-bit addition, multiplication, rotate, shift and xor operations. Many operations require some 64-bit prime number constants, all defined below:
-
- static const u64 PRIME64_1 = 0x9E3779B185EBCA87ULL; // 0b1001111000110111011110011011000110000101111010111100101010000111
- static const u64 PRIME64_2 = 0xC2B2AE3D27D4EB4FULL; // 0b1100001010110010101011100011110100100111110101001110101101001111
- static const u64 PRIME64_3 = 0x165667B19E3779F9ULL; // 0b0001011001010110011001111011000110011110001101110111100111111001
- static const u64 PRIME64_4 = 0x85EBCA77C2B2AE63ULL; // 0b1000010111101011110010100111011111000010101100101010111001100011
- static const u64 PRIME64_5 = 0x27D4EB2F165667C5ULL; // 0b0010011111010100111010110010111100010110010101100110011111000101
-
-These constants are prime numbers, and feature a good mix of bits 1 and 0, neither too regular, nor too dissymmetric. These properties help dispersion capabilities.
-
-### Step 1. Initialise internal accumulators
-
-Each accumulator gets an initial value based on optional `seed` input. Since the `seed` is optional, it can be `0`.
-
- u64 acc1 = seed + PRIME64_1 + PRIME64_2;
- u64 acc2 = seed + PRIME64_2;
- u64 acc3 = seed + 0;
- u64 acc4 = seed - PRIME64_1;
-
-#### Special case: input is less than 32 bytes
-
-When the input is too small (< 32 bytes), the algorithm will not process any stripes. Consequently, it will not make use of parallel accumulators.
-
-In this case, a simplified initialization is performed, using a single accumulator:
-
- u64 acc = seed + PRIME64_5;
-
-The algorithm then proceeds directly to step 4.
-
-### Step 2. Process stripes
-
-A stripe is a contiguous segment of 32 bytes.
-It is evenly divided into 4 _lanes_, of 8 bytes each.
-The first lane is used to update accumulator 1, the second lane is used to update accumulator 2, and so on.
-
-Each lane read its associated 64-bit value using __little-endian__ convention.
-
-For each {lane, accumulator}, the update process is called a _round_, and applies the following formula:
-
- round(accN,laneN):
- accN = accN + (laneN * PRIME64_2);
- accN = accN <<< 31;
- return accN * PRIME64_1;
-
-This shuffles the bits so that any bit from input _lane_ impacts several bits in output _accumulator_. All operations are performed modulo 2^64.
-
-Input is consumed one full stripe at a time. Step 2 is looped as many times as necessary to consume the whole input, except for the last remaining bytes which cannot form a stripe (< 32 bytes).
-When that happens, move to step 3.
-
-### Step 3. Accumulator convergence
-
-All 4 lane accumulators from previous steps are merged to produce a single remaining accumulator of same width (64-bit). The associated formula is as follows.
-
-Note that accumulator convergence is more complex than 32-bit variant, and requires to define another function called _mergeAccumulator()_:
-
- mergeAccumulator(acc,accN):
- acc = acc xor round(0, accN);
- acc = acc * PRIME64_1;
- return acc + PRIME64_4;
-
-which is then used in the convergence formula:
-
- acc = (acc1 <<< 1) + (acc2 <<< 7) + (acc3 <<< 12) + (acc4 <<< 18);
- acc = mergeAccumulator(acc, acc1);
- acc = mergeAccumulator(acc, acc2);
- acc = mergeAccumulator(acc, acc3);
- acc = mergeAccumulator(acc, acc4);
-
-### Step 4. Add input length
-
-The input total length is presumed known at this stage. This step is just about adding the length to accumulator, so that it participates to final mixing.
-
- acc = acc + inputLength;
-
-### Step 5. Consume remaining input
-
-There may be up to 31 bytes remaining to consume from the input.
-The final stage will digest them according to following pseudo-code:
-
- while (remainingLength >= 8) {
- lane = read_64bit_little_endian(input_ptr);
- acc = acc xor round(0, lane);
- acc = (acc <<< 27) * PRIME64_1;
- acc = acc + PRIME64_4;
- input_ptr += 8; remainingLength -= 8;
- }
-
- if (remainingLength >= 4) {
- lane = read_32bit_little_endian(input_ptr);
- acc = acc xor (lane * PRIME64_1);
- acc = (acc <<< 23) * PRIME64_2;
- acc = acc + PRIME64_3;
- input_ptr += 4; remainingLength -= 4;
- }
-
- while (remainingLength >= 1) {
- lane = read_byte(input_ptr);
- acc = acc xor (lane * PRIME64_5);
- acc = (acc <<< 11) * PRIME64_1;
- input_ptr += 1; remainingLength -= 1;
- }
-
-This process ensures that all input bytes are present in the final mix.
-
-### Step 6. Final mix (avalanche)
-
-The final mix ensures that all input bits have a chance to impact any bit in the output digest, resulting in an unbiased distribution. This is also called avalanche effect.
-
- acc = acc xor (acc >> 33);
- acc = acc * PRIME64_2;
- acc = acc xor (acc >> 29);
- acc = acc * PRIME64_3;
- acc = acc xor (acc >> 32);
-
-### Step 7. Output
-
-The `XXH64()` function produces an unsigned 64-bit value as output.
-
-For systems which require to store and/or display the result in binary or hexadecimal format, the canonical format is defined to reproduce the same value as the natural decimal format, hence follows __big-endian__ convention (most significant byte first).
-
-Performance considerations
-----------------------------------
-
-The xxHash algorithms are simple and compact to implement. They provide a system independent "fingerprint" or digest of a message of arbitrary length.
-
-The algorithm allows input to be streamed and processed in multiple steps. In such case, an internal buffer is needed to ensure data is presented to the algorithm in full stripes.
-
-On 64-bit systems, the 64-bit variant `XXH64` is generally faster to compute, so it is a recommended variant, even when only 32-bit are needed.
-
-On 32-bit systems though, positions are reversed: `XXH64` performance is reduced, due to its usage of 64-bit arithmetic. `XXH32` becomes a faster variant.
-
-
-Reference Implementation
-----------------------------------------
-
-A reference library written in C is available at https://www.xxhash.com.
-The web page also links to multiple other implementations written in many different languages.
-It links to the [github project page](https://github.com/Cyan4973/xxHash) where an [issue board](https://github.com/Cyan4973/xxHash/issues) can be used for further public discussions on the topic.
-
-
-Version changes
---------------------
-v0.7.3: Minor fixes
-v0.1.1: added a note on rationale for selection of constants
-v0.1.0: initial release
diff --git a/grpc/third_party/xxhash/libxxhash.pc.in b/grpc/third_party/xxhash/libxxhash.pc.in
deleted file mode 100644
index 28c16448..00000000
--- a/grpc/third_party/xxhash/libxxhash.pc.in
+++ /dev/null
@@ -1,15 +0,0 @@
-# xxHash - Extremely fast hash algorithm
-# Copyright (C) 2012-2020, Yann Collet, Facebook
-# BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
-
-prefix=@PREFIX@
-exec_prefix=@EXECPREFIX@
-includedir=${prefix}/@INCLUDEDIR@
-libdir=${exec_prefix}/@LIBDIR@
-
-Name: xxhash
-Description: extremely fast hash algorithm
-URL: http://www.xxhash.com/
-Version: @VERSION@
-Libs: -L${libdir} -lxxhash
-Cflags: -I${includedir}
diff --git a/grpc/third_party/xxhash/tests/Makefile b/grpc/third_party/xxhash/tests/Makefile
deleted file mode 100644
index 092711ad..00000000
--- a/grpc/third_party/xxhash/tests/Makefile
+++ /dev/null
@@ -1,83 +0,0 @@
-CFLAGS += -Wall -Wextra -Wundef -g
-
-NM = nm
-GREP = grep
-
-# Define *.exe as extension for Windows systems
-ifneq (,$(filter Windows%,$(OS)))
-EXT =.exe
-else
-EXT =
-endif
-
-ifneq (,$(filter %UTF-8,$(LANG)))
-ENABLE_UNICODE ?= 1
-else
-ENABLE_UNICODE ?= 0
-endif
-
-.PHONY: default
-default: all
-
-.PHONY: all
-all: test
-
-.PHONY: test
-test: test_multiInclude test_unicode
-
-.PHONY: test_multiInclude
-test_multiInclude:
- @$(MAKE) clean
- # compile without xxhash.o, ensure symbols exist within target
- # Note: built using only default rules
- $(MAKE) multiInclude
- @$(MAKE) clean
- # compile with xxhash.o, to detect duplicated symbols
- $(MAKE) multiInclude_withxxhash
- @$(MAKE) clean
- # Note: XXH_INLINE_ALL with XXH_NAMESPACE is currently disabled
- # compile with XXH_NAMESPACE
- # CPPFLAGS=-DXXH_NAMESPACE=TESTN_ $(MAKE) multiInclude_withxxhash
- # no symbol prefixed TESTN_ should exist
- # ! $(NM) multiInclude_withxxhash | $(GREP) TESTN_
- #$(MAKE) clean
- # compile with XXH_NAMESPACE and without xxhash.o
- # CPPFLAGS=-DXXH_NAMESPACE=TESTN_ $(MAKE) multiInclude
- # no symbol prefixed TESTN_ should exist
- # ! $(NM) multiInclude | $(GREP) TESTN_
- #@$(MAKE) clean
-
-.PHONY: test_ppc_redefine
-test_ppc_redefine: ppc_define.c
- @$(MAKE) clean
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $^
-
-xxhsum$(EXT): ../xxhash.c ../xxhash.h ../xxhsum.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DXXH_INLINE_ALL ../xxhsum.c -o $@
-
-# Make sure that Unicode filenames work.
-# https://github.com/Cyan4973/xxHash/issues/293
-.PHONY: test_unicode
-ifeq (0,$(ENABLE_UNICODE))
-test_unicode:
- @echo "Skipping Unicode test, your terminal doesn't appear to support UTF-8."
- @echo "Try with ENABLE_UNICODE=1"
-else
-test_unicode: xxhsum$(EXT) generate_unicode_test.c
- # Generate a Unicode filename test dynamically
- # to keep UTF-8 out of the source tree.
- $(CC) $(CFLAGS) $(LDFLAGS) generate_unicode_test.c -o generate_unicode_test$(EXT)
- ./generate_unicode_test$(EXT)
- $(SHELL) ./unicode_test.sh
-endif
-
-xxhash.o: ../xxhash.c ../xxhash.h
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $<
-
-multiInclude_withxxhash: multiInclude.o xxhash.o
- $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^
-
-clean:
- @$(RM) *.o
- @$(RM) multiInclude multiInclude_withxxhash
- @$(RM) *.unicode generate_unicode_test$(EXT) unicode_test.* xxhsum$(EXT)
diff --git a/grpc/third_party/xxhash/tests/bench/.gitignore b/grpc/third_party/xxhash/tests/bench/.gitignore
deleted file mode 100644
index ede2d588..00000000
--- a/grpc/third_party/xxhash/tests/bench/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# build artifacts
-
-*.o
-benchHash
-benchHash32
-benchHash_avx2
-benchHash_hw
-
-# test files
-
-test*
diff --git a/grpc/third_party/xxhash/tests/bench/LICENSE b/grpc/third_party/xxhash/tests/bench/LICENSE
deleted file mode 100644
index d159169d..00000000
--- a/grpc/third_party/xxhash/tests/bench/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/grpc/third_party/xxhash/tests/bench/Makefile b/grpc/third_party/xxhash/tests/bench/Makefile
deleted file mode 100644
index cdccfffd..00000000
--- a/grpc/third_party/xxhash/tests/bench/Makefile
+++ /dev/null
@@ -1,67 +0,0 @@
-# ################################################################
-# xxHash benchHash Makefile
-# Copyright (C) 2019-2020 Yann Collet
-#
-# GPL v2 License
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# You can contact the author at:
-# - xxHash homepage: https://www.xxhash.com
-# - xxHash source repository: https://github.com/Cyan4973/xxHash
-# ################################################################
-# benchHash: A generic benchmark for hash algorithms
-# measuring throughput, latency and bandwidth
-# ################################################################
-
-
-CPPFLAGS += -I../.. # directory of xxHash source files
-CFLAGS ?= -O3
-CFLAGS += -std=c99 -Wall -Wextra -Wstrict-aliasing=1
-CFLAGS += $(MOREFLAGS) # custom way to add flags
-CXXFLAGS ?= -O3
-LDFLAGS += $(MOREFLAGS)
-
-
-OBJ_LIST = main.o bhDisplay.o benchHash.o benchfn.o timefn.o
-
-
-default: benchHash
-
-all: benchHash
-
-benchHash32: CFLAGS += -m32
-benchHash32: CXXFLAGS += -m32
-
-benchHash_avx2: CFLAGS += -mavx2
-benchHash_avx2: CXXFLAGS += -mavx2
-
-benchHash_hw: CPPFLAGS += -DHARDWARE_SUPPORT
-benchHash_hw: CFLAGS += -mavx2 -maes
-benchHash_hw: CXXFLAGS += -mavx2 -mpclmul -std=c++14
-
-benchHash benchHash32 benchHash_avx2 benchHash_nosimd benchHash_hw: $(OBJ_LIST)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
-
-
-main.o: bhDisplay.h hashes.h
-
-bhDisplay.o: bhDisplay.h benchHash.h
-
-benchHash.o: benchHash.h
-
-
-clean:
- $(RM) *.o benchHash benchHash32 benchHash_avx2 benchHash_hw
diff --git a/grpc/third_party/xxhash/tests/bench/benchHash.c b/grpc/third_party/xxhash/tests/bench/benchHash.c
deleted file mode 100644
index 05739c7b..00000000
--- a/grpc/third_party/xxhash/tests/bench/benchHash.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-* Hash benchmark module
-* Part of the xxHash project
-* Copyright (C) 2019-2020 Yann Collet
-*
-* GPL v2 License
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* You can contact the author at:
-* - xxHash homepage: https://www.xxhash.com
-* - xxHash source repository: https://github.com/Cyan4973/xxHash
-*/
-
-/* benchmark hash functions */
-
-#include <stdlib.h> // malloc
-#include <assert.h>
-
-#include "benchHash.h"
-
-
-static void initBuffer(void* buffer, size_t size)
-{
- const unsigned long long k1 = 11400714785074694791ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111 */
- const unsigned long long k2 = 14029467366897019727ULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111 */
- unsigned long long acc = k2;
- unsigned char* const p = (unsigned char*)buffer;
- for (size_t s = 0; s < size; s++) {
- acc *= k1;
- p[s] = (unsigned char)(acc >> 56);
- }
-}
-
-
-#define MARGIN_FOR_LATENCY 1024
-#define START_MASK (MARGIN_FOR_LATENCY-1)
-
-typedef size_t (*sizeFunction_f)(size_t targetSize);
-
-/*
- * bench_hash_internal():
- * Benchmarks hashfn repeateadly over single input of size `size`
- * return: nb of hashes per second
- */
-static double
-bench_hash_internal(BMK_benchFn_t hashfn, void* payload,
- size_t nbBlocks, sizeFunction_f selectSize, size_t size,
- unsigned total_time_ms, unsigned iter_time_ms)
-{
- BMK_timedFnState_shell shell;
- BMK_timedFnState_t* const txf = BMK_initStatic_timedFnState(&shell, sizeof(shell), total_time_ms, iter_time_ms);
- assert(txf != NULL);
-
- size_t const srcSize = (size_t)size;
- size_t const srcBufferSize = srcSize + MARGIN_FOR_LATENCY;
- void* const srcBuffer = malloc(srcBufferSize);
- assert(srcBuffer != NULL);
- initBuffer(srcBuffer, srcBufferSize);
- #define FAKE_DSTSIZE 32
- size_t const dstSize = FAKE_DSTSIZE;
- char dstBuffer_static[FAKE_DSTSIZE] = {0};
-
- #define NB_BLOCKS_MAX 1024
- const void* srcBuffers[NB_BLOCKS_MAX];
- size_t srcSizes[NB_BLOCKS_MAX];
- void* dstBuffers[NB_BLOCKS_MAX];
- size_t dstCapacities[NB_BLOCKS_MAX];
- assert(nbBlocks < NB_BLOCKS_MAX);
-
- assert(size > 0);
- for (size_t n=0; n < nbBlocks; n++) {
- srcBuffers[n] = srcBuffer;
- srcSizes[n] = selectSize(size);
- dstBuffers[n] = dstBuffer_static;
- dstCapacities[n] = dstSize;
- }
-
-
- BMK_benchParams_t params = {
- .benchFn = hashfn,
- .benchPayload = payload,
- .initFn = NULL,
- .initPayload = NULL,
- .errorFn = NULL,
- .blockCount = nbBlocks,
- .srcBuffers = srcBuffers,
- .srcSizes = srcSizes,
- .dstBuffers = dstBuffers,
- .dstCapacities = dstCapacities,
- .blockResults = NULL
- };
- BMK_runOutcome_t result;
-
- while (!BMK_isCompleted_TimedFn(txf)) {
- result = BMK_benchTimedFn(txf, params);
- assert(BMK_isSuccessful_runOutcome(result));
- }
-
- BMK_runTime_t const runTime = BMK_extract_runTime(result);
-
- free(srcBuffer);
- assert(runTime.nanoSecPerRun != 0);
- return (1000000000U / runTime.nanoSecPerRun) * nbBlocks;
-
-}
-
-
-static size_t rand_1_N(size_t N) { return ((size_t)rand() % N) + 1; }
-
-static size_t identity(size_t s) { return s; }
-
-static size_t
-benchLatency(const void* src, size_t srcSize,
- void* dst, size_t dstCapacity,
- void* customPayload)
-{
- (void)dst; (void)dstCapacity;
- BMK_benchFn_t benchfn = (BMK_benchFn_t)customPayload;
- static size_t hash = 0;
-
- const void* const start = (const char*)src + (hash & START_MASK);
-
- return hash = benchfn(start, srcSize, dst, dstCapacity, NULL);
-}
-
-
-
-#ifndef SIZE_TO_HASH_PER_ROUND
-# define SIZE_TO_HASH_PER_ROUND 200000
-#endif
-
-#ifndef NB_HASH_ROUNDS_MAX
-# define NB_HASH_ROUNDS_MAX 1000
-#endif
-
-double bench_hash(BMK_benchFn_t hashfn,
- BMK_benchMode benchMode,
- size_t size, BMK_sizeMode sizeMode,
- unsigned total_time_ms, unsigned iter_time_ms)
-{
- sizeFunction_f const sizef = (sizeMode == BMK_fixedSize) ? identity : rand_1_N;
- BMK_benchFn_t const benchfn = (benchMode == BMK_throughput) ? hashfn : benchLatency;
- BMK_benchFn_t const payload = (benchMode == BMK_throughput) ? NULL : hashfn;
-
- size_t nbBlocks = (SIZE_TO_HASH_PER_ROUND / size) + 1;
- if (nbBlocks > NB_HASH_ROUNDS_MAX) nbBlocks = NB_HASH_ROUNDS_MAX;
-
- return bench_hash_internal(benchfn, payload,
- nbBlocks, sizef, size,
- total_time_ms, iter_time_ms);
-}
diff --git a/grpc/third_party/xxhash/tests/bench/benchHash.h b/grpc/third_party/xxhash/tests/bench/benchHash.h
deleted file mode 100644
index 6c9ba910..00000000
--- a/grpc/third_party/xxhash/tests/bench/benchHash.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-* Hash benchmark module
-* Part of the xxHash project
-* Copyright (C) 2019-2020 Yann Collet
-*
-* GPL v2 License
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* You can contact the author at:
-* - xxHash homepage: https://www.xxhash.com
-* - xxHash source repository: https://github.com/Cyan4973/xxHash
-*/
-
-
-#ifndef BENCH_HASH_H_983426678
-#define BENCH_HASH_H_983426678
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* === Dependencies === */
-
-#include "benchfn.h" /* BMK_benchFn_t */
-
-
-/* === Declarations === */
-
-typedef enum { BMK_throughput, BMK_latency } BMK_benchMode;
-
-typedef enum { BMK_fixedSize, /* hash always `size` bytes */
- BMK_randomSize, /* hash a random nb of bytes, between 1 and `size` (inclusive) */
-} BMK_sizeMode;
-
-/*
- * bench_hash():
- * Returns speed expressed as nb hashes per second.
- * total_time_ms: time spent benchmarking the hash function with given parameters
- * iter_time_ms: time spent for one round. If multiple rounds are run,
- * bench_hash() will report the speed of best round.
- */
-double bench_hash(BMK_benchFn_t hashfn,
- BMK_benchMode benchMode,
- size_t size, BMK_sizeMode sizeMode,
- unsigned total_time_ms, unsigned iter_time_ms);
-
-
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* BENCH_HASH_H_983426678 */
diff --git a/grpc/third_party/xxhash/tests/bench/benchfn.c b/grpc/third_party/xxhash/tests/bench/benchfn.c
deleted file mode 100644
index ec7e9a25..00000000
--- a/grpc/third_party/xxhash/tests/bench/benchfn.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (C) 2016-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-
-
-/* *************************************
-* Includes
-***************************************/
-#include <stdlib.h> /* malloc, free */
-#include <string.h> /* memset */
-#undef NDEBUG /* assert must not be disabled */
-#include <assert.h> /* assert */
-
-#include "timefn.h" /* UTIL_time_t, UTIL_getTime */
-#include "benchfn.h"
-
-
-/* *************************************
-* Constants
-***************************************/
-#define TIMELOOP_MICROSEC SEC_TO_MICRO /* 1 second */
-#define TIMELOOP_NANOSEC (1*1000000000ULL) /* 1 second */
-
-#define KB *(1 <<10)
-#define MB *(1 <<20)
-#define GB *(1U<<30)
-
-
-/* *************************************
-* Debug errors
-***************************************/
-#if defined(DEBUG) && (DEBUG >= 1)
-# include <stdio.h> /* fprintf */
-# define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
-# define DEBUGOUTPUT(...) { if (DEBUG) DISPLAY(__VA_ARGS__); }
-#else
-# define DEBUGOUTPUT(...)
-#endif
-
-
-/* error without displaying */
-#define RETURN_QUIET_ERROR(retValue, ...) { \
- DEBUGOUTPUT("%s: %i: \n", __FILE__, __LINE__); \
- DEBUGOUTPUT("Error : "); \
- DEBUGOUTPUT(__VA_ARGS__); \
- DEBUGOUTPUT(" \n"); \
- return retValue; \
-}
-
-
-/* *************************************
-* Benchmarking an arbitrary function
-***************************************/
-
-int BMK_isSuccessful_runOutcome(BMK_runOutcome_t outcome)
-{
- return outcome.error_tag_never_ever_use_directly == 0;
-}
-
-/* warning : this function will stop program execution if outcome is invalid !
- * check outcome validity first, using BMK_isValid_runResult() */
-BMK_runTime_t BMK_extract_runTime(BMK_runOutcome_t outcome)
-{
- assert(outcome.error_tag_never_ever_use_directly == 0);
- return outcome.internal_never_ever_use_directly;
-}
-
-size_t BMK_extract_errorResult(BMK_runOutcome_t outcome)
-{
- assert(outcome.error_tag_never_ever_use_directly != 0);
- return outcome.error_result_never_ever_use_directly;
-}
-
-static BMK_runOutcome_t BMK_runOutcome_error(size_t errorResult)
-{
- BMK_runOutcome_t b;
- memset(&b, 0, sizeof(b));
- b.error_tag_never_ever_use_directly = 1;
- b.error_result_never_ever_use_directly = errorResult;
- return b;
-}
-
-static BMK_runOutcome_t BMK_setValid_runTime(BMK_runTime_t runTime)
-{
- BMK_runOutcome_t outcome;
- outcome.error_tag_never_ever_use_directly = 0;
- outcome.internal_never_ever_use_directly = runTime;
- return outcome;
-}
-
-
-/* initFn will be measured once, benchFn will be measured `nbLoops` times */
-/* initFn is optional, provide NULL if none */
-/* benchFn must return a size_t value that errorFn can interpret */
-/* takes # of blocks and list of size & stuff for each. */
-/* can report result of benchFn for each block into blockResult. */
-/* blockResult is optional, provide NULL if this information is not required */
-/* note : time per loop can be reported as zero if run time < timer resolution */
-BMK_runOutcome_t BMK_benchFunction(BMK_benchParams_t p,
- unsigned nbLoops)
-{
- /* init */
- { size_t i;
- for (i = 0; i < p.blockCount; i++) {
- memset(p.dstBuffers[i], 0xE5, p.dstCapacities[i]); /* warm up and erase result buffer */
- } }
-
- /* benchmark */
- { UTIL_time_t const clockStart = UTIL_getTime();
- size_t dstSize = 0;
- unsigned loopNb, blockNb;
- nbLoops += !nbLoops; /* minimum nbLoops is 1 */
- if (p.initFn != NULL) p.initFn(p.initPayload);
- for (loopNb = 0; loopNb < nbLoops; loopNb++) {
- for (blockNb = 0; blockNb < p.blockCount; blockNb++) {
- size_t const res = p.benchFn(p.srcBuffers[blockNb], p.srcSizes[blockNb],
- p.dstBuffers[blockNb], p.dstCapacities[blockNb],
- p.benchPayload);
- if (loopNb == 0) {
- if (p.blockResults != NULL) p.blockResults[blockNb] = res;
- if ((p.errorFn != NULL) && (p.errorFn(res))) {
- RETURN_QUIET_ERROR(BMK_runOutcome_error(res),
- "Function benchmark failed on block %u (of size %u) with error %i",
- blockNb, (unsigned)p.srcSizes[blockNb], (int)res);
- }
- dstSize += res;
- } }
- } /* for (loopNb = 0; loopNb < nbLoops; loopNb++) */
-
- { PTime const totalTime = UTIL_clockSpanNano(clockStart);
- BMK_runTime_t rt;
- rt.nanoSecPerRun = (double)totalTime / nbLoops;
- rt.sumOfReturn = dstSize;
- return BMK_setValid_runTime(rt);
- } }
-}
-
-
-/* ==== Benchmarking any function, providing intermediate results ==== */
-
-struct BMK_timedFnState_s {
- PTime timeSpent_ns;
- PTime timeBudget_ns;
- PTime runBudget_ns;
- BMK_runTime_t fastestRun;
- unsigned nbLoops;
- UTIL_time_t coolTime;
-}; /* typedef'd to BMK_timedFnState_t within bench.h */
-
-BMK_timedFnState_t* BMK_createTimedFnState(unsigned total_ms, unsigned run_ms)
-{
- BMK_timedFnState_t* const r = (BMK_timedFnState_t*)malloc(sizeof(*r));
- if (r == NULL) return NULL; /* malloc() error */
- BMK_resetTimedFnState(r, total_ms, run_ms);
- return r;
-}
-
-void BMK_freeTimedFnState(BMK_timedFnState_t* state) { free(state); }
-
-BMK_timedFnState_t*
-BMK_initStatic_timedFnState(void* buffer, size_t size, unsigned total_ms, unsigned run_ms)
-{
- typedef char check_size[ 2 * (sizeof(BMK_timedFnState_shell) >= sizeof(struct BMK_timedFnState_s)) - 1]; /* static assert : a compilation failure indicates that BMK_timedFnState_shell is not large enough */
- typedef struct { check_size c; BMK_timedFnState_t tfs; } tfs_align; /* force tfs to be aligned at its next best position */
- size_t const tfs_alignment = offsetof(tfs_align, tfs); /* provides the minimal alignment restriction for BMK_timedFnState_t */
- BMK_timedFnState_t* const r = (BMK_timedFnState_t*)buffer;
- if (buffer == NULL) return NULL;
- if (size < sizeof(struct BMK_timedFnState_s)) return NULL;
- if ((size_t)buffer % tfs_alignment) return NULL; /* buffer must be properly aligned */
- BMK_resetTimedFnState(r, total_ms, run_ms);
- return r;
-}
-
-void BMK_resetTimedFnState(BMK_timedFnState_t* timedFnState, unsigned total_ms, unsigned run_ms)
-{
- if (!total_ms) total_ms = 1 ;
- if (!run_ms) run_ms = 1;
- if (run_ms > total_ms) run_ms = total_ms;
- timedFnState->timeSpent_ns = 0;
- timedFnState->timeBudget_ns = (PTime)total_ms * TIMELOOP_NANOSEC / 1000;
- timedFnState->runBudget_ns = (PTime)run_ms * TIMELOOP_NANOSEC / 1000;
- timedFnState->fastestRun.nanoSecPerRun = (double)TIMELOOP_NANOSEC * 2000000000; /* hopefully large enough : must be larger than any potential measurement */
- timedFnState->fastestRun.sumOfReturn = (size_t)(-1LL);
- timedFnState->nbLoops = 1;
- timedFnState->coolTime = UTIL_getTime();
-}
-
-/* Tells if nb of seconds set in timedFnState for all runs is spent.
- * note : this function will return 1 if BMK_benchFunctionTimed() has actually errored. */
-int BMK_isCompleted_TimedFn(const BMK_timedFnState_t* timedFnState)
-{
- return (timedFnState->timeSpent_ns >= timedFnState->timeBudget_ns);
-}
-
-
-#undef MIN
-#define MIN(a,b) ( (a) < (b) ? (a) : (b) )
-
-#define MINUSABLETIME (TIMELOOP_NANOSEC / 2) /* 0.5 seconds */
-
-BMK_runOutcome_t BMK_benchTimedFn(BMK_timedFnState_t* cont,
- BMK_benchParams_t p)
-{
- PTime const runBudget_ns = cont->runBudget_ns;
- PTime const runTimeMin_ns = runBudget_ns / 2;
- BMK_runTime_t bestRunTime = cont->fastestRun;
-
- for (;;) {
- BMK_runOutcome_t const runResult = BMK_benchFunction(p, cont->nbLoops);
-
- if (!BMK_isSuccessful_runOutcome(runResult)) { /* error : move out */
- return runResult;
- }
-
- { BMK_runTime_t const newRunTime = BMK_extract_runTime(runResult);
- double const loopDuration_ns = newRunTime.nanoSecPerRun * cont->nbLoops;
-
- cont->timeSpent_ns += (unsigned long long)loopDuration_ns;
-
- /* estimate nbLoops for next run to last approximately 1 second */
- if (loopDuration_ns > (runBudget_ns / 50)) {
- double const fastestRun_ns = MIN(bestRunTime.nanoSecPerRun, newRunTime.nanoSecPerRun);
- cont->nbLoops = (unsigned)(runBudget_ns / fastestRun_ns) + 1;
- } else {
- /* previous run was too short : blindly increase workload by x multiplier */
- const unsigned multiplier = 10;
- assert(cont->nbLoops < ((unsigned)-1) / multiplier); /* avoid overflow */
- cont->nbLoops *= multiplier;
- }
-
- if (loopDuration_ns < runTimeMin_ns) {
- /* When benchmark run time is too small : don't report results.
- * increased risks of rounding errors */
- continue;
- }
-
- if (newRunTime.nanoSecPerRun < bestRunTime.nanoSecPerRun) {
- bestRunTime = newRunTime;
- }
- }
- break;
- } /* while (!completed) */
-
- return BMK_setValid_runTime(bestRunTime);
-}
diff --git a/grpc/third_party/xxhash/tests/bench/benchfn.h b/grpc/third_party/xxhash/tests/bench/benchfn.h
deleted file mode 100644
index 42d10338..00000000
--- a/grpc/third_party/xxhash/tests/bench/benchfn.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2016-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-
-/* benchfn :
- * benchmark any function on a set of input
- * providing result in nanoSecPerRun
- * or detecting and returning an error
- */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-#ifndef BENCH_FN_H_23876
-#define BENCH_FN_H_23876
-
-/* === Dependencies === */
-#include <stddef.h> /* size_t */
-
-
-/* ==== Benchmark any function, iterated on a set of blocks ==== */
-
-/* BMK_runTime_t: valid result return type */
-
-typedef struct {
- double nanoSecPerRun; /* time per iteration (over all blocks) */
- size_t sumOfReturn; /* sum of return values */
-} BMK_runTime_t;
-
-
-/* BMK_runOutcome_t:
- * type expressing the outcome of a benchmark run by BMK_benchFunction(),
- * which can be either valid or invalid.
- * benchmark outcome can be invalid if errorFn is provided.
- * BMK_runOutcome_t must be considered "opaque" : never access its members directly.
- * Instead, use its assigned methods :
- * BMK_isSuccessful_runOutcome, BMK_extract_runTime, BMK_extract_errorResult.
- * The structure is only described here to allow its allocation on stack. */
-
-typedef struct {
- BMK_runTime_t internal_never_ever_use_directly;
- size_t error_result_never_ever_use_directly;
- int error_tag_never_ever_use_directly;
-} BMK_runOutcome_t;
-
-
-/* prototypes for benchmarked functions */
-typedef size_t (*BMK_benchFn_t)(const void* src, size_t srcSize, void* dst, size_t dstCapacity, void* customPayload);
-typedef size_t (*BMK_initFn_t)(void* initPayload);
-typedef unsigned (*BMK_errorFn_t)(size_t);
-
-
-/* BMK_benchFunction() parameters are provided via the following structure.
- * A structure is preferable for readability,
- * as the number of parameters required is fairly large.
- * No initializer is provided, because it doesn't make sense to provide some "default" :
- * all parameters must be specified by the caller.
- * optional parameters are labelled explicitly, and accept value NULL when not used */
-typedef struct {
- BMK_benchFn_t benchFn; /* the function to benchmark, over the set of blocks */
- void* benchPayload; /* pass custom parameters to benchFn :
- * (*benchFn)(srcBuffers[i], srcSizes[i], dstBuffers[i], dstCapacities[i], benchPayload) */
- BMK_initFn_t initFn; /* (*initFn)(initPayload) is run once per run, at the beginning. */
- void* initPayload; /* Both arguments can be NULL, in which case nothing is run. */
- BMK_errorFn_t errorFn; /* errorFn will check each return value of benchFn over each block, to determine if it failed or not.
- * errorFn can be NULL, in which case no check is performed.
- * errorFn must return 0 when benchFn was successful, and >= 1 if it detects an error.
- * Execution is stopped as soon as an error is detected.
- * the triggering return value can be retrieved using BMK_extract_errorResult(). */
- size_t blockCount; /* number of blocks to operate benchFn on.
- * It's also the size of all array parameters :
- * srcBuffers, srcSizes, dstBuffers, dstCapacities, blockResults */
- const void *const * srcBuffers; /* read-only array of buffers to be operated on by benchFn */
- const size_t* srcSizes; /* read-only array containing sizes of srcBuffers */
- void *const * dstBuffers; /* array of buffers to be written into by benchFn. This array is not optional, it must be provided even if unused by benchfn. */
- const size_t* dstCapacities; /* read-only array containing capacities of dstBuffers. This array must be present. */
- size_t* blockResults; /* Optional: store the return value of benchFn for each block. Use NULL if this result is not requested. */
-} BMK_benchParams_t;
-
-
-/* BMK_benchFunction() :
- * This function benchmarks benchFn and initFn, providing a result.
- *
- * params : see description of BMK_benchParams_t above.
- * nbLoops: defines number of times benchFn is run over the full set of blocks.
- * Minimum value is 1. A 0 is interpreted as a 1.
- *
- * @return: can express either an error or a successful result.
- * Use BMK_isSuccessful_runOutcome() to check if benchmark was successful.
- * If yes, extract the result with BMK_extract_runTime(),
- * it will contain :
- * .sumOfReturn : the sum of all return values of benchFn through all of blocks
- * .nanoSecPerRun : time per run of benchFn + (time for initFn / nbLoops)
- * .sumOfReturn is generally intended for functions which return a # of bytes written into dstBuffer,
- * in which case, this value will be the total amount of bytes written into dstBuffer.
- *
- * blockResults : when provided (!= NULL), and when benchmark is successful,
- * params.blockResults contains all return values of `benchFn` over all blocks.
- * when provided (!= NULL), and when benchmark failed,
- * params.blockResults contains return values of `benchFn` over all blocks preceding and including the failed block.
- */
-BMK_runOutcome_t BMK_benchFunction(BMK_benchParams_t params, unsigned nbLoops);
-
-
-
-/* check first if the benchmark was successful or not */
-int BMK_isSuccessful_runOutcome(BMK_runOutcome_t outcome);
-
-/* If the benchmark was successful, extract the result.
- * note : this function will abort() program execution if benchmark failed !
- * always check if benchmark was successful first !
- */
-BMK_runTime_t BMK_extract_runTime(BMK_runOutcome_t outcome);
-
-/* when benchmark failed, it means one invocation of `benchFn` failed.
- * The failure was detected by `errorFn`, operating on return values of `benchFn`.
- * Returns the faulty return value.
- * note : this function will abort() program execution if benchmark did not failed.
- * always check if benchmark failed first !
- */
-size_t BMK_extract_errorResult(BMK_runOutcome_t outcome);
-
-
-
-/* ==== Benchmark any function, returning intermediate results ==== */
-
-/* state information tracking benchmark session */
-typedef struct BMK_timedFnState_s BMK_timedFnState_t;
-
-/* BMK_benchTimedFn() :
- * Similar to BMK_benchFunction(), most arguments being identical.
- * Automatically determines `nbLoops` so that each result is regularly produced at interval of about run_ms.
- * Note : minimum `nbLoops` is 1, therefore a run may last more than run_ms, and possibly even more than total_ms.
- * Usage - initialize timedFnState, select benchmark duration (total_ms) and each measurement duration (run_ms)
- * call BMK_benchTimedFn() repetitively, each measurement is supposed to last about run_ms
- * Check if total time budget is spent or exceeded, using BMK_isCompleted_TimedFn()
- */
-BMK_runOutcome_t BMK_benchTimedFn(BMK_timedFnState_t* timedFnState,
- BMK_benchParams_t params);
-
-/* Tells if duration of all benchmark runs has exceeded total_ms
- */
-int BMK_isCompleted_TimedFn(const BMK_timedFnState_t* timedFnState);
-
-/* BMK_createTimedFnState() and BMK_resetTimedFnState() :
- * Create/Set BMK_timedFnState_t for next benchmark session,
- * which shall last a minimum of total_ms milliseconds,
- * producing intermediate results, paced at interval of (approximately) run_ms.
- */
-BMK_timedFnState_t* BMK_createTimedFnState(unsigned total_ms, unsigned run_ms);
-void BMK_resetTimedFnState(BMK_timedFnState_t* timedFnState, unsigned total_ms, unsigned run_ms);
-void BMK_freeTimedFnState(BMK_timedFnState_t* state);
-
-
-/* BMK_timedFnState_shell and BMK_initStatic_timedFnState() :
- * Makes it possible to statically allocate a BMK_timedFnState_t on stack.
- * BMK_timedFnState_shell is only there to allocate space,
- * never ever access its members.
- * BMK_timedFnState_t() actually accepts any buffer.
- * It will check if provided buffer is large enough and is correctly aligned,
- * and will return NULL if conditions are not respected.
- */
-#define BMK_TIMEDFNSTATE_SIZE 64
-typedef union {
- char never_access_space[BMK_TIMEDFNSTATE_SIZE];
- long long alignment_enforcer; /* must be aligned on 8-bytes boundaries */
-} BMK_timedFnState_shell;
-BMK_timedFnState_t* BMK_initStatic_timedFnState(void* buffer, size_t size, unsigned total_ms, unsigned run_ms);
-
-
-#endif /* BENCH_FN_H_23876 */
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/grpc/third_party/xxhash/tests/bench/bhDisplay.c b/grpc/third_party/xxhash/tests/bench/bhDisplay.c
deleted file mode 100644
index 601ca1f3..00000000
--- a/grpc/third_party/xxhash/tests/bench/bhDisplay.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-* CSV Display module for the hash benchmark program
-* Part of the xxHash project
-* Copyright (C) 2019-2020 Yann Collet
-*
-* GPL v2 License
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* You can contact the author at :
-* - xxHash homepage : https://www.xxhash.com
-* - xxHash source repository : https://github.com/Cyan4973/xxHash
-*/
-
-
-/* === Dependencies === */
-
-#include <stdlib.h> /* rand */
-#include <stdio.h> /* printf */
-#include <assert.h>
-
-#include "benchHash.h"
-#include "bhDisplay.h"
-
-
-/* === benchmark large input === */
-
-#define MB_UNIT 1000000
-#define BENCH_LARGE_ITER_MS 490
-#define BENCH_LARGE_TOTAL_MS 1010
-static void bench_oneHash_largeInput(Bench_Entry hashDesc, int minlog, int maxlog)
-{
- printf("%-7s", hashDesc.name);
- for (int sizelog=minlog; sizelog<=maxlog; sizelog++) {
- size_t const inputSize = (size_t)1 << sizelog;
- double const nbhps = bench_hash(hashDesc.hash, BMK_throughput,
- inputSize, BMK_fixedSize,
- BENCH_LARGE_TOTAL_MS, BENCH_LARGE_ITER_MS);
- printf(",%6.0f", nbhps * inputSize / MB_UNIT); fflush(NULL);
- }
- printf("\n");
-}
-
-void bench_largeInput(Bench_Entry const* hashDescTable, int nbHashes, int minlog, int maxlog)
-{
- assert(maxlog < 31);
- assert(minlog >= 0);
- printf("benchmarking large inputs : from %u bytes (log%i) to %u MB (log%i) \n",
- 1U << minlog, minlog,
- (1U << maxlog) >> 20, maxlog);
- for (int i=0; i<nbHashes; i++)
- bench_oneHash_largeInput(hashDescTable[i], minlog, maxlog);
-}
-
-
-
-/* === Benchmark small inputs === */
-
-#define BENCH_SMALL_ITER_MS 170
-#define BENCH_SMALL_TOTAL_MS 490
-static void bench_throughput_oneHash_smallInputs(Bench_Entry hashDesc, size_t sizeMin, size_t sizeMax)
-{
- printf("%-7s", hashDesc.name);
- for (size_t s=sizeMin; s<sizeMax+1; s++) {
- double const nbhps = bench_hash(hashDesc.hash, BMK_throughput,
- s, BMK_fixedSize,
- BENCH_SMALL_TOTAL_MS, BENCH_SMALL_ITER_MS);
- printf(",%10.0f", nbhps); fflush(NULL);
- }
- printf("\n");
-}
-
-void bench_throughput_smallInputs(Bench_Entry const* hashDescTable, int nbHashes, size_t sizeMin, size_t sizeMax)
-{
- printf("Throughput small inputs of fixed size (from %zu to %zu bytes): \n",
- sizeMin, sizeMax);
- for (int i=0; i<nbHashes; i++)
- bench_throughput_oneHash_smallInputs(hashDescTable[i], sizeMin, sizeMax);
-}
-
-
-
-/* === Latency measurements (small keys) === */
-
-static void bench_latency_oneHash_smallInputs(Bench_Entry hashDesc, size_t size_min, size_t size_max)
-{
- printf("%-7s", hashDesc.name);
- for (size_t s=size_min; s<size_max+1; s++) {
- double const nbhps = bench_hash(hashDesc.hash, BMK_latency,
- s, BMK_fixedSize,
- BENCH_SMALL_TOTAL_MS, BENCH_SMALL_ITER_MS);
- printf(",%10.0f", nbhps); fflush(NULL);
- }
- printf("\n");
-}
-
-void bench_latency_smallInputs(Bench_Entry const* hashDescTable, int nbHashes, size_t size_min, size_t size_max)
-{
- printf("Latency for small inputs of fixed size : \n");
- for (int i=0; i<nbHashes; i++)
- bench_latency_oneHash_smallInputs(hashDescTable[i], size_min, size_max);
-}
-
-
-/* === Random input Length === */
-
-static void bench_randomInputLength_withOneHash(Bench_Entry hashDesc, size_t size_min, size_t size_max)
-{
- printf("%-7s", hashDesc.name);
- for (size_t s=size_min; s<size_max+1; s++) {
- srand((unsigned)s); /* ensure random sequence of length will be the same for a given s */
- double const nbhps = bench_hash(hashDesc.hash, BMK_throughput,
- s, BMK_randomSize,
- BENCH_SMALL_TOTAL_MS, BENCH_SMALL_ITER_MS);
- printf(",%10.0f", nbhps); fflush(NULL);
- }
- printf("\n");
-}
-
-void bench_throughput_randomInputLength(Bench_Entry const* hashDescTable, int nbHashes, size_t size_min, size_t size_max)
-{
- printf("benchmarking random size inputs [1-N] : \n");
- for (int i=0; i<nbHashes; i++)
- bench_randomInputLength_withOneHash(hashDescTable[i], size_min, size_max);
-}
-
-
-/* === Latency with Random input Length === */
-
-static void bench_latency_oneHash_randomInputLength(Bench_Entry hashDesc, size_t size_min, size_t size_max)
-{
- printf("%-7s", hashDesc.name);
- for (size_t s=size_min; s<size_max+1; s++) {
- srand((unsigned)s); /* ensure random sequence of length will be the same for a given s */
- double const nbhps = bench_hash(hashDesc.hash, BMK_latency,
- s, BMK_randomSize,
- BENCH_SMALL_TOTAL_MS, BENCH_SMALL_ITER_MS);
- printf(",%10.0f", nbhps); fflush(NULL);
- }
- printf("\n");
-}
-
-void bench_latency_randomInputLength(Bench_Entry const* hashDescTable, int nbHashes, size_t size_min, size_t size_max)
-{
- printf("Latency for small inputs of random size [1-N] : \n");
- for (int i=0; i<nbHashes; i++)
- bench_latency_oneHash_randomInputLength(hashDescTable[i], size_min, size_max);
-}
diff --git a/grpc/third_party/xxhash/tests/bench/bhDisplay.h b/grpc/third_party/xxhash/tests/bench/bhDisplay.h
deleted file mode 100644
index 42c4bb29..00000000
--- a/grpc/third_party/xxhash/tests/bench/bhDisplay.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* CSV Display module for the hash benchmark program
-* Part of the xxHash project
-* Copyright (C) 2019-2020 Yann Collet
-*
-* GPL v2 License
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* You can contact the author at:
-* - xxHash homepage: https://www.xxhash.com
-* - xxHash source repository: https://github.com/Cyan4973/xxHash
-*/
-
-#ifndef BH_DISPLAY_H_192088098
-#define BH_DISPLAY_H_192088098
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* === Dependencies === */
-
-#include "benchfn.h" /* BMK_benchFn_t */
-
-
-/* === Declarations === */
-
-typedef struct {
- const char* name;
- BMK_benchFn_t hash;
-} Bench_Entry;
-
-void bench_largeInput(Bench_Entry const* hashDescTable, int nbHashes, int sizeLogMin, int sizeLogMax);
-
-void bench_throughput_smallInputs(Bench_Entry const* hashDescTable, int nbHashes, size_t sizeMin, size_t sizeMax);
-void bench_throughput_randomInputLength(Bench_Entry const* hashDescTable, int nbHashes, size_t sizeMin, size_t sizeMax);
-
-void bench_latency_smallInputs(Bench_Entry const* hashDescTable, int nbHashes, size_t sizeMin, size_t sizeMax);
-void bench_latency_randomInputLength(Bench_Entry const* hashDescTable, int nbHashes, size_t sizeMin, size_t sizeMax);
-
-
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* BH_DISPLAY_H_192088098 */
diff --git a/grpc/third_party/xxhash/tests/bench/hashes.h b/grpc/third_party/xxhash/tests/bench/hashes.h
deleted file mode 100644
index 2042dc58..00000000
--- a/grpc/third_party/xxhash/tests/bench/hashes.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-* List hash algorithms to benchmark
-* Part of xxHash project
-* Copyright (C) 2019-2020 Yann Collet
-*
-* GPL v2 License
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program; if not, write to the Free Software Foundation, Inc.,
-* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*
-* You can contact the author at:
-* - xxHash homepage: https://www.xxhash.com
-* - xxHash source repository: https://github.com/Cyan4973/xxHash
-*/
-
-
-/* === Dependencies === */
-
-#include <stddef.h> /* size_t */
-
-
-/* ==================================================
- * Non-portable hash algorithms
- * =============================================== */
-
-
-#ifdef HARDWARE_SUPPORT
-
-/*
- * List any hash algorithms that depend on specific hardware support,
- * including for example:
- * - Hardware crc32c
- * - Hardware AES support
- * - Carryless Multipliers (clmul)
- * - AVX2
- */
-
-#endif
-
-
-
-/* ==================================================
- * List of hashes
- * ==================================================
- * Each hash must be wrapped in a thin redirector conformant with the BMK_benchfn_t.
- * BMK_benchfn_t is generic, not specifically designed for hashes.
- * For hashes, the following parameters are expected to be useless:
- * dst, dstCapacity, customPayload.
- *
- * The result of each hash is assumed to be provided as function return value.
- * This condition is important for latency measurements.
- */
-
- /* === xxHash === */
-#define XXH_INLINE_ALL
-#include "xxhash.h"
-
-size_t XXH32_wrapper(const void* src, size_t srcSize, void* dst, size_t dstCapacity, void* customPayload)
-{
- (void)dst; (void)dstCapacity; (void)customPayload;
- return (size_t) XXH32(src, srcSize, 0);
-}
-
-
-size_t XXH64_wrapper(const void* src, size_t srcSize, void* dst, size_t dstCapacity, void* customPayload)
-{
- (void)dst; (void)dstCapacity; (void)customPayload;
- return (size_t) XXH64(src, srcSize, 0);
-}
-
-
-size_t xxh3_wrapper(const void* src, size_t srcSize, void* dst, size_t dstCapacity, void* customPayload)
-{
- (void)dst; (void)dstCapacity; (void)customPayload;
- return (size_t) XXH3_64bits(src, srcSize);
-}
-
-
-size_t XXH128_wrapper(const void* src, size_t srcSize, void* dst, size_t dstCapacity, void* customPayload)
-{
- (void)dst; (void)dstCapacity; (void)customPayload;
- return (size_t) XXH3_128bits(src, srcSize).low64;
-}
-
-
-
-/* ==================================================
- * Table of hashes
- * =============================================== */
-
-#include "bhDisplay.h" /* Bench_Entry */
-
-#ifndef HARDWARE_SUPPORT
-# define NB_HASHES 4
-#else
-# define NB_HASHES 4
-#endif
-
-Bench_Entry const hashCandidates[NB_HASHES] = {
- { "xxh3" , xxh3_wrapper },
- { "XXH32" , XXH32_wrapper },
- { "XXH64" , XXH64_wrapper },
- { "XXH128", XXH128_wrapper },
-#ifdef HARDWARE_SUPPORT
- /* list here codecs which require specific hardware support, such SSE4.1, PCLMUL, AVX2, etc. */
-#endif
-};
diff --git a/grpc/third_party/xxhash/tests/bench/main.c b/grpc/third_party/xxhash/tests/bench/main.c
deleted file mode 100644
index 1cf6e80f..00000000
--- a/grpc/third_party/xxhash/tests/bench/main.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Main program to benchmark hash functions
- * Part of the xxHash project
- * Copyright (C) 2019-2020 Yann Collet
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-
-/* === dependencies === */
-
-#include <stdio.h> /* printf */
-#include <limits.h> /* INT_MAX */
-#include "bhDisplay.h" /* bench_x */
-
-
-/* === defines list of hashes `hashCandidates` and NB_HASHES *** */
-
-#include "hashes.h"
-
-
-/* === parse command line === */
-
-#undef NDEBUG
-#include <assert.h>
-
-
-/*!
- * readIntFromChar():
- * Allows and interprets K, KB, KiB, M, MB and MiB suffix.
- * Will also modify `*stringPtr`, advancing it to position where it stopped reading.
- */
-static int readIntFromChar(const char** stringPtr)
-{
- static int const max = (INT_MAX / 10) - 1;
- int result = 0;
- while ((**stringPtr >='0') && (**stringPtr <='9')) {
- assert(result < max);
- result *= 10;
- result += (unsigned)(**stringPtr - '0');
- (*stringPtr)++ ;
- }
- if ((**stringPtr=='K') || (**stringPtr=='M')) {
- int const maxK = INT_MAX >> 10;
- assert(result < maxK);
- result <<= 10;
- if (**stringPtr=='M') {
- assert(result < maxK);
- result <<= 10;
- }
- (*stringPtr)++; /* skip `K` or `M` */
- if (**stringPtr=='i') (*stringPtr)++;
- if (**stringPtr=='B') (*stringPtr)++;
- }
- return result;
-}
-
-
-/**
- * isCommand():
- * Checks if string is the same as longCommand.
- * If yes, @return 1, otherwise @return 0
- */
-static int isCommand(const char* string, const char* longCommand)
-{
- assert(string);
- assert(longCommand);
- size_t const comSize = strlen(longCommand);
- return !strncmp(string, longCommand, comSize);
-}
-
-/*
- * longCommandWArg():
- * Checks if *stringPtr is the same as longCommand.
- * If yes, @return 1 and advances *stringPtr to the position which immediately
- * follows longCommand.
- * @return 0 and doesn't modify *stringPtr otherwise.
- */
-static int longCommandWArg(const char** stringPtr, const char* longCommand)
-{
- assert(stringPtr);
- assert(longCommand);
- size_t const comSize = strlen(longCommand);
- int const result = isCommand(*stringPtr, longCommand);
- if (result) *stringPtr += comSize;
- return result;
-}
-
-
-/* === default values - can be redefined at compilation time === */
-
-#ifndef SMALL_SIZE_MIN_DEFAULT
-# define SMALL_SIZE_MIN_DEFAULT 1
-#endif
-#ifndef SMALL_SIZE_MAX_DEFAULT
-# define SMALL_SIZE_MAX_DEFAULT 127
-#endif
-#ifndef LARGE_SIZELOG_MIN_DEFAULT
-# define LARGE_SIZELOG_MIN_DEFAULT 9
-#endif
-#ifndef LARGE_SIZELOG_MAX_DEFAULT
-# define LARGE_SIZELOG_MAX_DEFAULT 27
-#endif
-
-
-static int display_hash_names(void)
-{
- int i;
- printf("available hashes : \n");
- for (i=0; i<NB_HASHES; i++) {
- printf("%s, ", hashCandidates[i].name);
- }
- printf("\b\b \n");
- return 0;
-}
-
-/*
- * @return: hashID (necessarily between 0 and NB_HASHES) if present
- * -1 on error (hname not present)
- */
-static int hashID(const char* hname)
-{
- int id;
- assert(hname);
- for (id=0; id < NB_HASHES; id++) {
- assert(hashCandidates[id].name);
- if (strlen(hname) != strlen(hashCandidates[id].name)) continue;
- if (isCommand(hname, hashCandidates[id].name)) return id;
- }
- return -1;
-}
-
-static int help(const char* exename)
-{
- printf("Usage: %s [options]... [hash]\n", exename);
- printf("Runs various benchmarks at various lengths for the listed hash functions\n");
- printf("and outputs them in a CSV format.\n\n");
- printf("Options: \n");
- printf(" --list Name available hash algorithms and exit \n");
- printf(" --mins=LEN Starting length for small size bench (default: %i) \n", SMALL_SIZE_MIN_DEFAULT);
- printf(" --maxs=LEN End length for small size bench (default: %i) \n", SMALL_SIZE_MAX_DEFAULT);
- printf(" --minl=LEN Starting log2(length) for large size bench (default: %i) \n", LARGE_SIZELOG_MIN_DEFAULT);
- printf(" --maxl=LEN End log2(length) for large size bench (default: %i) \n", LARGE_SIZELOG_MAX_DEFAULT);
- printf(" [hash] Optional, bench all available hashes if not provided \n");
- return 0;
-}
-
-static int badusage(const char* exename)
-{
- printf("Bad command ... \n");
- help(exename);
- return 1;
-}
-
-int main(int argc, const char* argv[])
-{
- const char* const exename = argv[0];
- int hashNb = 0;
- int nb_h_test = NB_HASHES;
- int largeTest_log_min = LARGE_SIZELOG_MIN_DEFAULT;
- int largeTest_log_max = LARGE_SIZELOG_MAX_DEFAULT;
- size_t smallTest_size_min = SMALL_SIZE_MIN_DEFAULT;
- size_t smallTest_size_max = SMALL_SIZE_MAX_DEFAULT;
-
- int arg_nb;
- for (arg_nb = 1; arg_nb < argc; arg_nb++) {
- const char** arg = argv + arg_nb;
- if (isCommand(*arg, "-h")) { assert(argc >= 1); return help(exename); }
- if (isCommand(*arg, "--list")) { return display_hash_names(); }
- if (longCommandWArg(arg, "--n=")) { nb_h_test = readIntFromChar(arg); continue; } /* hidden command */
- if (longCommandWArg(arg, "--minl=")) { largeTest_log_min = readIntFromChar(arg); continue; }
- if (longCommandWArg(arg, "--maxl=")) { largeTest_log_max = readIntFromChar(arg); continue; }
- if (longCommandWArg(arg, "--mins=")) { smallTest_size_min = (size_t)readIntFromChar(arg); continue; }
- if (longCommandWArg(arg, "--maxs=")) { smallTest_size_max = (size_t)readIntFromChar(arg); continue; }
- /* not a command: must be a hash name */
- hashNb = hashID(*arg);
- if (hashNb >= 0) {
- nb_h_test = 1;
- } else {
- /* not a hash name: error */
- return badusage(exename);
- }
- }
-
- /* border case (requires (mis)using hidden command `--n=#`) */
- if (hashNb + nb_h_test > NB_HASHES) {
- printf("wrong hash selection \n");
- return 1;
- }
-
- printf(" === benchmarking %i hash functions === \n", nb_h_test);
- if (largeTest_log_max >= largeTest_log_min) {
- bench_largeInput(hashCandidates+hashNb, nb_h_test, largeTest_log_min, largeTest_log_max);
- }
- if (smallTest_size_max >= smallTest_size_min) {
- bench_throughput_smallInputs(hashCandidates+hashNb, nb_h_test, smallTest_size_min, smallTest_size_max);
- bench_throughput_randomInputLength(hashCandidates+hashNb, nb_h_test, smallTest_size_min, smallTest_size_max);
- bench_latency_smallInputs(hashCandidates+hashNb, nb_h_test, smallTest_size_min, smallTest_size_max);
- bench_latency_randomInputLength(hashCandidates+hashNb, nb_h_test, smallTest_size_min, smallTest_size_max);
- }
-
- return 0;
-}
diff --git a/grpc/third_party/xxhash/tests/bench/timefn.c b/grpc/third_party/xxhash/tests/bench/timefn.c
deleted file mode 100644
index 85681289..00000000
--- a/grpc/third_party/xxhash/tests/bench/timefn.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2019-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-
-/* === Dependencies === */
-
-#include "timefn.h"
-
-
-/*-****************************************
-* Time functions
-******************************************/
-
-#if defined(_WIN32) /* Windows */
-
-#include <stdlib.h> /* abort */
-#include <stdio.h> /* perror */
-
-UTIL_time_t UTIL_getTime(void) { UTIL_time_t x; QueryPerformanceCounter(&x); return x; }
-
-PTime UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd)
-{
- static LARGE_INTEGER ticksPerSecond;
- static int init = 0;
- if (!init) {
- if (!QueryPerformanceFrequency(&ticksPerSecond)) {
- perror("timefn::QueryPerformanceFrequency");
- abort();
- }
- init = 1;
- }
- return 1000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart;
-}
-
-PTime UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd)
-{
- static LARGE_INTEGER ticksPerSecond;
- static int init = 0;
- if (!init) {
- if (!QueryPerformanceFrequency(&ticksPerSecond)) {
- perror("timefn::QueryPerformanceFrequency");
- abort();
- }
- init = 1;
- }
- return 1000000000ULL*(clockEnd.QuadPart - clockStart.QuadPart)/ticksPerSecond.QuadPart;
-}
-
-
-
-#elif defined(__APPLE__) && defined(__MACH__)
-
-UTIL_time_t UTIL_getTime(void) { return mach_absolute_time(); }
-
-PTime UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd)
-{
- static mach_timebase_info_data_t rate;
- static int init = 0;
- if (!init) {
- mach_timebase_info(&rate);
- init = 1;
- }
- return (((clockEnd - clockStart) * (PTime)rate.numer) / ((PTime)rate.denom))/1000ULL;
-}
-
-PTime UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd)
-{
- static mach_timebase_info_data_t rate;
- static int init = 0;
- if (!init) {
- mach_timebase_info(&rate);
- init = 1;
- }
- return ((clockEnd - clockStart) * (PTime)rate.numer) / ((PTime)rate.denom);
-}
-
-
-
-#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */) \
- && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */
-
-#include <stdlib.h> /* abort */
-#include <stdio.h> /* perror */
-
-UTIL_time_t UTIL_getTime(void)
-{
- /* time must be initialized, othersize it may fail msan test.
- * No good reason, likely a limitation of timespec_get() for some target */
- UTIL_time_t time = UTIL_TIME_INITIALIZER;
- if (timespec_get(&time, TIME_UTC) != TIME_UTC) {
- perror("timefn::timespec_get");
- abort();
- }
- return time;
-}
-
-static UTIL_time_t UTIL_getSpanTime(UTIL_time_t begin, UTIL_time_t end)
-{
- UTIL_time_t diff;
- if (end.tv_nsec < begin.tv_nsec) {
- diff.tv_sec = (end.tv_sec - 1) - begin.tv_sec;
- diff.tv_nsec = (end.tv_nsec + 1000000000ULL) - begin.tv_nsec;
- } else {
- diff.tv_sec = end.tv_sec - begin.tv_sec;
- diff.tv_nsec = end.tv_nsec - begin.tv_nsec;
- }
- return diff;
-}
-
-PTime UTIL_getSpanTimeMicro(UTIL_time_t begin, UTIL_time_t end)
-{
- UTIL_time_t const diff = UTIL_getSpanTime(begin, end);
- PTime micro = 0;
- micro += 1000000ULL * diff.tv_sec;
- micro += diff.tv_nsec / 1000ULL;
- return micro;
-}
-
-PTime UTIL_getSpanTimeNano(UTIL_time_t begin, UTIL_time_t end)
-{
- UTIL_time_t const diff = UTIL_getSpanTime(begin, end);
- PTime nano = 0;
- nano += 1000000000ULL * diff.tv_sec;
- nano += diff.tv_nsec;
- return nano;
-}
-
-
-
-#else /* relies on standard C90 (note : clock_t measurements can be wrong when using multi-threading) */
-
-UTIL_time_t UTIL_getTime(void) { return clock(); }
-PTime UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
-PTime UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd) { return 1000000000ULL * (clockEnd - clockStart) / CLOCKS_PER_SEC; }
-
-#endif
-
-
-
-/* returns time span in microseconds */
-PTime UTIL_clockSpanMicro(UTIL_time_t clockStart )
-{
- UTIL_time_t const clockEnd = UTIL_getTime();
- return UTIL_getSpanTimeMicro(clockStart, clockEnd);
-}
-
-/* returns time span in microseconds */
-PTime UTIL_clockSpanNano(UTIL_time_t clockStart )
-{
- UTIL_time_t const clockEnd = UTIL_getTime();
- return UTIL_getSpanTimeNano(clockStart, clockEnd);
-}
-
-void UTIL_waitForNextTick(void)
-{
- UTIL_time_t const clockStart = UTIL_getTime();
- UTIL_time_t clockEnd;
- do {
- clockEnd = UTIL_getTime();
- } while (UTIL_getSpanTimeNano(clockStart, clockEnd) == 0);
-}
diff --git a/grpc/third_party/xxhash/tests/bench/timefn.h b/grpc/third_party/xxhash/tests/bench/timefn.h
deleted file mode 100644
index 41007f30..00000000
--- a/grpc/third_party/xxhash/tests/bench/timefn.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2016-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-#ifndef TIME_FN_H_MODULE_287987
-#define TIME_FN_H_MODULE_287987
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/*-****************************************
-* Dependencies
-******************************************/
-#include <sys/types.h> /* utime */
-#if defined(_MSC_VER)
-# include <sys/utime.h> /* utime */
-#else
-# include <utime.h> /* utime */
-#endif
-#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */
-
-
-
-/*-****************************************
-* Local Types
-******************************************/
-
-#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
-# include <stdint.h>
- typedef uint64_t PTime; /* Precise Time */
-#else
- typedef unsigned long long PTime; /* does not support compilers without long long support */
-#endif
-
-
-
-/*-****************************************
-* Time functions
-******************************************/
-#if defined(_WIN32) /* Windows */
-
- #include <Windows.h> /* LARGE_INTEGER */
- typedef LARGE_INTEGER UTIL_time_t;
- #define UTIL_TIME_INITIALIZER { { 0, 0 } }
-
-#elif defined(__APPLE__) && defined(__MACH__)
-
- #include <mach/mach_time.h>
- typedef PTime UTIL_time_t;
- #define UTIL_TIME_INITIALIZER 0
-
-#elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */) \
- && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */
-
- typedef struct timespec UTIL_time_t;
- #define UTIL_TIME_INITIALIZER { 0, 0 }
-
-#else /* relies on standard C90 (note : clock_t measurements can be wrong when using multi-threading) */
-
- typedef clock_t UTIL_time_t;
- #define UTIL_TIME_INITIALIZER 0
-
-#endif
-
-
-UTIL_time_t UTIL_getTime(void);
-PTime UTIL_getSpanTimeMicro(UTIL_time_t clockStart, UTIL_time_t clockEnd);
-PTime UTIL_getSpanTimeNano(UTIL_time_t clockStart, UTIL_time_t clockEnd);
-
-#define SEC_TO_MICRO ((PTime)1000000)
-PTime UTIL_clockSpanMicro(UTIL_time_t clockStart);
-PTime UTIL_clockSpanNano(UTIL_time_t clockStart);
-
-void UTIL_waitForNextTick(void);
-
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* TIME_FN_H_MODULE_287987 */
diff --git a/grpc/third_party/xxhash/tests/collisions/.gitignore b/grpc/third_party/xxhash/tests/collisions/.gitignore
deleted file mode 100644
index f8559263..00000000
--- a/grpc/third_party/xxhash/tests/collisions/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-#build artefacts
-collisionsTest
diff --git a/grpc/third_party/xxhash/tests/collisions/LICENSE b/grpc/third_party/xxhash/tests/collisions/LICENSE
deleted file mode 100644
index d159169d..00000000
--- a/grpc/third_party/xxhash/tests/collisions/LICENSE
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/grpc/third_party/xxhash/tests/collisions/Makefile b/grpc/third_party/xxhash/tests/collisions/Makefile
deleted file mode 100644
index bad9835b..00000000
--- a/grpc/third_party/xxhash/tests/collisions/Makefile
+++ /dev/null
@@ -1,74 +0,0 @@
-# Brute force collision tester for 64-bit hashes
-# Part of xxHash project
-# Copyright (C) 2019-2020 Yann Collet
-#
-# GPL v2 License
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# You can contact the author at:
-# - xxHash homepage: https://www.xxhash.com
-# - xxHash source repository: https://github.com/Cyan4973/xxHash
-#
-
-SRC_DIRS = ./ ../../ allcodecs/
-VPATH = $(SRC_DIRS)
-CPPFLAGS += $(addprefix -I ,$(SRC_DIRS))
-CFLAGS ?= -std=c99 \
- -Wall -Wextra -Wconversion
-CXXFLAGS ?= -Wall -Wextra -Wconversion -std=c++11
-LDFLAGS += -pthread
-TESTHASHES = 110000000
-
-HASH_SRC := $(sort $(wildcard allcodecs/*.c allcodecs/*.cc))
-HASH_OBJ := $(patsubst %.c,%.o,$(HASH_SRC))
-
-
-.PHONY: default
-default: release
-
-.PHONY: all
-all: release
-
-collisionsTest: main.o pool.o threading.o sort.o $(HASH_OBJ)
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
-
-main.o: hashes.h xxhash.h
-
-release: CXXFLAGS += -O3
-release: CFLAGS += -O3
-release: collisionsTest
-
-debug: CXXFLAGS += -g3 -O0 -DDEBUG
-debug: CFLAGS += -g3 -O0 -DDEBUG
-debug: collisionsTest
-
-.PHONY: check
-check: test
-
-.PHONY: test
-test: debug
- @echo ""
- @echo "## $(TESTHASHES) hashes with original and 0 threads"
- @time ./collisionsTest --nbh=$(TESTHASHES)
- @echo ""
- @echo "## $(TESTHASHES) hashes with original and 4 threads"
- @time ./collisionsTest --nbh=$(TESTHASHES) --threadlog=2
- @echo ""
-
-.PHONY: clean
-clean:
- $(RM) *.o allcodecs/*.o
- $(RM) collisionsTest
diff --git a/grpc/third_party/xxhash/tests/collisions/README.md b/grpc/third_party/xxhash/tests/collisions/README.md
deleted file mode 100644
index 683b1151..00000000
--- a/grpc/third_party/xxhash/tests/collisions/README.md
+++ /dev/null
@@ -1,122 +0,0 @@
-
-__collisionsTest__ is a brute force hash analyzer
-which will measure a 64-bit hash algorithm's collision rate
-by generating billions of hashes,
-and comparing the result to an "ideal" target.
-
-The test requires a very large amount of memory.
-By default, it will generate 24 billion of 64-bit hashes,
-requiring __192 GB of RAM__ for their storage.
-The number of hashes can be modified using command `--nbh=`.
-Be aware that testing the collision ratio of 64-bit hashes
-requires a very large amount of hashes (several billion) for meaningful measurements.
-
-To reduce RAM usage, an optional filter can be requested, with `--filter`.
-It reduces the nb of candidates to analyze, hence associated RAM budget.
-Note that the filter itself requires a lot of RAM
-(32 GB by default, can be modified using `--filterlog=`,
-a too small filter will not be efficient, aim at ~2 bytes per hash),
-and reading and writing into filter cost a significant CPU budget,
-so this method is slower.
-It also doesn't allow advanced analysis of partial bitfields,
-since most hashes will be discarded and not stored.
-
-When using the filter, the RAM budget consists of the filter and a list of candidates,
-which will be a fraction of the original hash list.
-Using default settings (24 billion hashes, 32 GB filter),
-the number of potential candidates should be reduced to less than 2 billion,
-requiring ~14 GB for their storage.
-Such a result also depends on hash algorithm's efficiency.
-The number of effective candidates is likely to be lower, at ~ 1 billion,
-but storage must allocate an upper bound.
-
-For the default test, the expected "optimal" collision rate for a 64-bit hash function is ~18 collisions.
-
-#### How to build
-```
-make
-```
-
-Note: the code is a mix of C99 and C++14,
-it's not compatible with a C90-only compiler.
-
-#### Build modifier
-
-- `SLAB5`: use alternative pattern generator, friendlier for weak hash algorithms
-- `POOL_MT`: if `=0`, disable multi-threading code (enabled by default)
-
-#### How to integrate any hash in the tester
-
-The build script will compile files found in `./allcodecs`.
-Put the source code here.
-This also works if the hash is a single `*.h` file.
-
-The glue happens in `hashes.h`.
-In this file, there are 2 sections:
-- Adds the required `#include "header.h"`, and creates a wrapper
-to respect the format expected by the function pointer.
-- Adds the wrapper, along with the name and an indication of the output width,
-to the table, at the end of `hashes.h`
-
-Build with `make`. Locate your new hash with `./collisionsTest -h`,
-it should be listed.
-
-
-#### Usage
-
-```
-usage: ./collisionsTest [hashName] [opt]
-
-list of hashNames: (...)
-
-Optional parameters:
- --nbh=NB Select nb of hashes to generate (25769803776 by default)
- --filter Enable the filter. Slower, but reduces memory usage for same nb of hashes.
- --threadlog=NB Use 2^NB threads
- --len=NB Select length of input (255 bytes by default)
-```
-
-#### Some advises on how to setup a collisions test
-
-Most tests are primarily driven by the amount of RAM available.
-Here's a method to decide the size of the test.
-
-Presuming that RAM budget is not plentiful, for this example 32 GB,
-the `--filter` mode is actually compulsory to measure anything meaningful.
-Let's plan 50% of memory for the filter, that's 16 GB.
-This will be good enough to filter about 10% less hashes than this size.
-Let's round down to 14 G.
-
-By requesting 14G, the expectation is that the program will automatically
-size the filter to 16 GB, and expect to store ~1G candidates,
-leaving enough room to breeze for the system.
-
-The command line becomes:
-```
-./collisionsTest --nbh=14G --filter NameOfHash
-```
-
-#### Examples:
-
-Here are a few results produced with this tester:
-
-| Algorithm | Input Len | Nb Hashes | Expected | Nb Collisions | Notes |
-| --- | --- | --- | --- | --- | --- |
-| __XXH3__ | 255 | 100 Gi | 312.5 | 326 | |
-| __XXH64__ | 255 | 100 Gi | 312.5 | 294 | |
-| __XXH128__ low64 | 512 | 100 Gi | 312.5 | 321 | |
-| __XXH128__ high64| 512 | 100 Gi | 312.5 | 325 | |
-| __XXH128__ | 255 | 100 Gi | 0.0 | 0 | a 128-bit hash is expected to generate 0 collisions |
-
-Test on small inputs:
-
-| Algorithm | Input Len | Nb Hashes | Expected | Nb Collisions | Notes |
-| --- | --- | --- | --- | --- | --- |
-| __XXH64__ | 8 | 100 Gi | 312.5 | __0__ | `XXH64` is bijective for `len==8` |
-| __XXH3__ | 8 | 100 Gi | 312.5 | __0__ | `XXH3` is also bijective for `len==8` |
-| __XXH3__ | 16 | 100 Gi | 312.5 | 332 | |
-| __XXH3__ | 32 | 14 Gi | 6.1 | 3 | |
-| __XXH128__ | 16 | 25 Gi | 0.0 | 0 | test range 9-16 |
-| __XXH128__ | 32 | 25 Gi | 0.0 | 0 | test range 17-128 |
-| __XXH128__ | 100 | 13 Gi | 0.0 | 0 | test range 17-128 |
-| __XXH128__ | 200 | 13 Gi | 0.0 | 0 | test range 129-240 |
diff --git a/grpc/third_party/xxhash/tests/collisions/allcodecs/README.md b/grpc/third_party/xxhash/tests/collisions/allcodecs/README.md
deleted file mode 100644
index d41fc2db..00000000
--- a/grpc/third_party/xxhash/tests/collisions/allcodecs/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Put in this directory all hash algorithms to test
diff --git a/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.c b/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.c
deleted file mode 100644
index 547d5c73..00000000
--- a/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * dummy.c, a fake hash algorithm, just to test integration capabilities.
- * Part of the xxHash project
- * Copyright (C) 2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-
-#include <dummy.h>
-
-unsigned badsum32(const void* input, size_t len, unsigned seed)
-{
- unsigned sum = seed;
- const unsigned char* in8 = input;
- size_t c;
- for (c=0; c<len; c++)
- sum += in8[c];
- return sum;
-}
diff --git a/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.h b/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.h
deleted file mode 100644
index 85856eff..00000000
--- a/grpc/third_party/xxhash/tests/collisions/allcodecs/dummy.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * dummy.c,
- * A fake hash algorithm, just to test integration capabilities.
- * Part of the xxHash project
- * Copyright (C) 2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef DUMMY_H_987987
-#define DUMMY_H_987987
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-#include <stddef.h> /* size_t */
-
-unsigned badsum32(const void* input, size_t len, unsigned seed);
-
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* DUMMY_H_987987 */
diff --git a/grpc/third_party/xxhash/tests/collisions/hashes.h b/grpc/third_party/xxhash/tests/collisions/hashes.h
deleted file mode 100644
index 0b7223d9..00000000
--- a/grpc/third_party/xxhash/tests/collisions/hashes.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * List of hashes for the brute force collision tester
- * Part of xxHash project
- * Copyright (C) 2019-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef HASHES_H_1235465
-#define HASHES_H_1235465
-
-#include <stddef.h> /* size_t */
-#include <stdint.h> /* uint64_t */
-#define XXH_INLINE_ALL /* XXH128_hash_t */
-#include "xxhash.h"
-
-
-/* return type */
-
-typedef union {
- uint64_t h64;
- XXH128_hash_t h128;
-} UniHash;
-
-UniHash uniHash32(uint64_t v32)
-{ UniHash unih;
- unih.h64 = v32;
- return unih;
-}
-
-UniHash uniHash64(uint64_t v64)
-{ UniHash unih;
- unih.h64 = v64;
- return unih;
-}
-
-UniHash uniHash128(XXH128_hash_t v128)
-{ UniHash unih;
- unih.h128 = v128;
- return unih;
-}
-
-
-/* === xxHash === */
-
-UniHash XXH3_wrapper (const void* data, size_t size)
-{
- return uniHash64( XXH3_64bits(data, size) );
-}
-
-UniHash XXH128_wrapper (const void* data, size_t size)
-{
- return uniHash128( XXH3_128bits(data, size) );
-}
-
-UniHash XXH128l_wrapper (const void* data, size_t size)
-{
- return uniHash64( XXH3_128bits(data, size).low64 );
-}
-
-UniHash XXH128h_wrapper (const void* data, size_t size)
-{
- return uniHash64( XXH3_128bits(data, size).high64 );
-}
-
-UniHash XXH64_wrapper (const void* data, size_t size)
-{
- return uniHash64 ( XXH64(data, size, 0) );
-}
-
-UniHash XXH32_wrapper (const void* data, size_t size)
-{
- return uniHash32( XXH32(data, size, 0) );
-}
-
-/* === Dummy integration example === */
-
-#include "dummy.h"
-
-UniHash badsum32_wrapper (const void* data, size_t size)
-{
- return uniHash32( badsum32(data, size, 0) );
-}
-
-
-
-/* === Table === */
-
-typedef UniHash (*hashfn) (const void* data, size_t size);
-
-typedef struct {
- const char* name;
- hashfn fn;
- int bits;
-} hashDescription;
-
-#define HASH_FN_TOTAL 7
-
-hashDescription hashfnTable[HASH_FN_TOTAL] = {
- { "xxh3" , XXH3_wrapper, 64 },
- { "xxh64" , XXH64_wrapper, 64 },
- { "xxh128", XXH128_wrapper, 128 },
- { "xxh128l", XXH128l_wrapper, 64 },
- { "xxh128h", XXH128h_wrapper, 64 },
- { "xxh32" , XXH32_wrapper, 32 },
- { "badsum32",badsum32_wrapper, 32 },
-};
-
-#endif /* HASHES_H_1235465 */
diff --git a/grpc/third_party/xxhash/tests/collisions/main.c b/grpc/third_party/xxhash/tests/collisions/main.c
deleted file mode 100644
index a857341b..00000000
--- a/grpc/third_party/xxhash/tests/collisions/main.c
+++ /dev/null
@@ -1,1120 +0,0 @@
-/*
- * Brute force collision tester for 64-bit hashes
- * Part of the xxHash project
- * Copyright (C) 2019-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * The collision tester will generate 24 billion hashes (by default),
- * and count how many collisions were produced by the 64-bit hash algorithm.
- * The optimal amount of collisions for 64-bit is ~18 collisions.
- * A good hash should be close to this figure.
- *
- * This program requires a lot of memory:
- * - Either store hash values directly => 192 GB
- * - Or use a filter:
- * - 32 GB (by default) for the filter itself
- * - + ~14 GB for the list of hashes (depending on the filter's outcome)
- * Due to these memory constraints, it requires a 64-bit system.
- */
-
-
- /* === Dependencies === */
-
-#include <stdint.h> /* uint64_t */
-#include <stdlib.h> /* malloc, free, qsort, exit */
-#include <string.h> /* memset */
-#include <stdio.h> /* printf, fflush */
-
-#undef NDEBUG /* ensure assert is _not_ disabled */
-#include <assert.h>
-
-#include "hashes.h" /* UniHash, hashfn, hashfnTable */
-
-#include "sort.hh" /* sort64 */
-
-
-
-typedef enum { ht32, ht64, ht128 } Htype_e;
-
-/* === Debug === */
-
-#define EXIT(...) { printf(__VA_ARGS__); printf("\n"); exit(1); }
-
-static void hexRaw(const void* buffer, size_t size)
-{
- const unsigned char* p = (const unsigned char*)buffer;
- for (size_t i=0; i<size; i++) {
- printf("%02X", p[i]);
- }
-}
-
-void printHash(const void* table, size_t n, Htype_e htype)
-{
- if ((htype == ht64) || (htype == ht32)){
- uint64_t const h64 = ((const uint64_t*)table)[n];
- hexRaw(&h64, sizeof(h64));
- } else {
- assert(htype == ht128);
- XXH128_hash_t const h128 = ((const XXH128_hash_t*)table)[n];
- hexRaw(&h128, sizeof(h128));
- }
-}
-
-/* === Generate Random unique Samples to hash === */
-
-/*
- * These functions will generate and update a sample to hash.
- * initSample() will fill a buffer with random bytes,
- * updateSample() will modify one slab in the input buffer.
- * updateSample() guarantees it will produce unique samples,
- * but it needs to know the total number of samples.
- */
-
-
-static const uint64_t prime64_1 = 11400714785074694791ULL; /* 0b1001111000110111011110011011000110000101111010111100101010000111 */
-static const uint64_t prime64_2 = 14029467366897019727ULL; /* 0b1100001010110010101011100011110100100111110101001110101101001111 */
-static const uint64_t prime64_3 = 1609587929392839161ULL; /* 0b0001011001010110011001111011000110011110001101110111100111111001 */
-
-static uint64_t avalanche64(uint64_t h64)
-{
- h64 ^= h64 >> 33;
- h64 *= prime64_2;
- h64 ^= h64 >> 29;
- h64 *= prime64_3;
- h64 ^= h64 >> 32;
- return h64;
-}
-
-static unsigned char randomByte(size_t n)
-{
- uint64_t n64 = avalanche64(n+1);
- n64 *= prime64_1;
- return (unsigned char)(n64 >> 56);
-}
-
-typedef enum { sf_slab5, sf_sparse } sf_genMode;
-
-
-#ifdef SLAB5
-
-/*
- * Slab5 sample generation.
- * This algorithm generates unique inputs flipping on average 16 bits per candidate.
- * It is generally much more friendly for most hash algorithms, especially
- * weaker ones, as it shuffles more the input.
- * The algorithm also avoids overfitting the per4 or per8 ingestion patterns.
- */
-
-#define SLAB_SIZE 5
-
-typedef struct {
- void* buffer;
- size_t size;
- sf_genMode mode;
- size_t prngSeed;
- uint64_t hnb;
-} sampleFactory;
-
-static void init_sampleFactory(sampleFactory* sf, uint64_t htotal)
-{
- uint64_t const minNbSlabs = ((htotal-1) >> 32) + 1;
- uint64_t const minSize = minNbSlabs * SLAB_SIZE;
- if (sf->size < minSize)
- EXIT("sample size must be >= %i bytes for this amount of hashes",
- (int)minSize);
-
- unsigned char* const p = (unsigned char*)sf->buffer;
- for (size_t n=0; n < sf->size; n++)
- p[n] = randomByte(n);
- sf->hnb = 0;
-}
-
-static sampleFactory*
-create_sampleFactory(size_t size, uint64_t htotal, uint64_t seed)
-{
- sampleFactory* const sf = malloc(sizeof(sampleFactory));
- if (!sf) EXIT("not enough memory");
- void* const buffer = malloc(size);
- if (!buffer) EXIT("not enough memory");
- sf->buffer = buffer;
- sf->size = size;
- sf->mode = sf_slab5;
- sf->prngSeed = seed;
- init_sampleFactory(sf, htotal);
- return sf;
-}
-
-static void free_sampleFactory(sampleFactory* sf)
-{
- if (!sf) return;
- free(sf->buffer);
- free(sf);
-}
-
-static inline void update_sampleFactory(sampleFactory* sf)
-{
- size_t const nbSlabs = sf->size / SLAB_SIZE;
- size_t const SlabNb = sf->hnb % nbSlabs;
- sf->hnb++;
-
- char* const ptr = (char*)sf->buffer;
- size_t const start = (SlabNb * SLAB_SIZE) + 1;
- uint32_t val32;
- memcpy(&val32, ptr+start, sizeof(val32));
- static const uint32_t prime32_5 = 374761393U;
- val32 += prime32_5;
- memcpy(ptr+start, &val32, sizeof(val32));
-}
-
-#else
-
-/*
- * Sparse sample generation.
- * This is the default pattern generator.
- * It only flips one bit at a time (mostly).
- * Low hamming distance scenario is more difficult for weak hash algorithms.
- * Note that CRC is immune to this scenario, since they are specifically
- * designed to detect low hamming distances.
- * Prefer the Slab5 pattern generator for collisions on CRC algorithms.
- */
-
-#define SPARSE_LEVEL_MAX 15
-
-/* Nb of combinations of m bits in a register of n bits */
-static double Cnm(int n, int m)
-{
- assert(n > 0);
- assert(m > 0);
- assert(m <= m);
- double acc = 1;
- for (int i=0; i<m; i++) {
- acc *= n - i;
- acc /= 1 + i;
- }
- return acc;
-}
-
-static int enoughCombos(size_t size, uint64_t htotal)
-{
- if (size < 2) return 0; /* ensure no multiplication by negative */
- uint64_t acc = 0;
- uint64_t const srcBits = size * 8; assert(srcBits < INT_MAX);
- int nbBitsSet = 0;
- while (acc < htotal) {
- nbBitsSet++;
- if (nbBitsSet >= SPARSE_LEVEL_MAX) return 0;
- acc += (uint64_t)Cnm((int)srcBits, nbBitsSet);
- }
- return 1;
-}
-
-typedef struct {
- void* buffer;
- size_t size;
- sf_genMode mode;
- /* sparse */
- size_t bitIdx[SPARSE_LEVEL_MAX];
- int level;
- size_t maxBitIdx;
- /* slab5 */
- size_t nbSlabs;
- size_t current;
- size_t prngSeed;
-} sampleFactory;
-
-static void init_sampleFactory(sampleFactory* sf, uint64_t htotal)
-{
- if (!enoughCombos(sf->size, htotal)) {
- EXIT("sample size must be larger for this amount of hashes");
- }
-
- memset(sf->bitIdx, 0, sizeof(sf->bitIdx));
- sf->level = 0;
-
- unsigned char* const p = (unsigned char*)sf->buffer;
- for (size_t n=0; n<sf->size; n++)
- p[n] = randomByte(sf->prngSeed + n);
-}
-
-static sampleFactory*
-create_sampleFactory(size_t size, uint64_t htotal, uint64_t seed)
-{
- sampleFactory* const sf = malloc(sizeof(sampleFactory));
- if (!sf) EXIT("not enough memory");
- void* const buffer = malloc(size);
- if (!buffer) EXIT("not enough memory");
- sf->buffer = buffer;
- sf->size = size;
- sf->mode = sf_sparse;
- sf->maxBitIdx = size * 8;
- sf->prngSeed = seed;
- init_sampleFactory(sf, htotal);
- return sf;
-}
-
-static void free_sampleFactory(sampleFactory* sf)
-{
- if (!sf) return;
- free(sf->buffer);
- free(sf);
-}
-
-static void flipbit(void* buffer, uint64_t bitID)
-{
- size_t const pos = bitID >> 3;
- unsigned char const mask = (unsigned char)(1 << (bitID & 7));
- unsigned char* const p = (unsigned char*)buffer;
- p[pos] ^= mask;
-}
-
-static int updateBit(void* buffer, size_t* bitIdx, int level, size_t max)
-{
- if (level==0) return 0; /* can't progress further */
-
- flipbit(buffer, bitIdx[level]); /* erase previous bits */
-
- if (bitIdx[level] < max-1) { /* simple case: go to next bit */
- bitIdx[level]++;
- flipbit(buffer, bitIdx[level]); /* set new bit */
- return 1;
- }
-
- /* reached last bit: need to update a bit from lower level */
- if (!updateBit(buffer, bitIdx, level-1, max-1)) return 0;
- bitIdx[level] = bitIdx[level-1] + 1;
- flipbit(buffer, bitIdx[level]); /* set new bit */
- return 1;
-}
-
-static inline void update_sampleFactory(sampleFactory* sf)
-{
- if (!updateBit(sf->buffer, sf->bitIdx, sf->level, sf->maxBitIdx)) {
- /* no more room => move to next level */
- sf->level++;
- assert(sf->level < SPARSE_LEVEL_MAX);
-
- /* set new bits */
- for (int i=1; i <= sf->level; i++) {
- sf->bitIdx[i] = (size_t)(i-1);
- flipbit(sf->buffer, sf->bitIdx[i]);
- }
- }
-}
-
-#endif /* pattern generator selection */
-
-
-/* === Candidate Filter === */
-
-typedef unsigned char Filter;
-
-Filter* create_Filter(int bflog)
-{
- assert(bflog < 64 && bflog > 1);
- size_t bfsize = (size_t)1 << bflog;
- Filter* bf = malloc(bfsize);
- assert(((void)"Filter creation failed", bf));
- memset(bf, 0, bfsize);
- return bf;
-}
-
-void free_Filter(Filter* bf)
-{
- free(bf);
-}
-
-#ifdef FILTER_1_PROBE
-
-/*
- * Attach hash to a slot
- * return: Nb of potential collision candidates detected
- * 0: position not yet occupied
- * 2: position previously occupied by a single candidate
- * 1: position already occupied by multiple candidates
- */
-inline int Filter_insert(Filter* bf, int bflog, uint64_t hash)
-{
- int const slotNb = hash & 3;
- int const shift = slotNb * 2 ;
-
- size_t const bfmask = ((size_t)1 << bflog) - 1;
- size_t const pos = (hash >> 2) & bfmask;
-
- int const existingCandidates = ((((unsigned char*)bf)[pos]) >> shift) & 3;
-
- static const int addCandidates[4] = { 0, 2, 1, 1 };
- static const int nextValue[4] = { 1, 2, 3, 3 };
-
- ((unsigned char*)bf)[pos] |= (unsigned char)(nextValue[existingCandidates] << shift);
- return addCandidates[existingCandidates];
-}
-
-/*
- * Check if provided 64-bit hash is a collision candidate
- * Requires the slot to be occupied by at least 2 candidates.
- * return >0 if hash is a collision candidate
- * 0 otherwise (slot unoccupied, or only one candidate)
- * note: unoccupied slots should not happen in this algorithm,
- * since all hashes are supposed to have been inserted at least once.
- */
-inline int Filter_check(const Filter* bf, int bflog, uint64_t hash)
-{
- int const slotNb = hash & 3;
- int const shift = slotNb * 2;
-
- size_t const bfmask = ((size_t)1 << bflog) - 1;
- size_t const pos = (hash >> 2) & bfmask;
-
- return (((const unsigned char*)bf)[pos]) >> (shift+1) & 1;
-}
-
-#else
-
-/*
- * 2-probes strategy,
- * more efficient at filtering candidates,
- * requires filter size to be > nb of hashes
- */
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
-/*
- * Attach hash to 2 slots
- * return: Nb of potential candidates detected
- * 0: position not yet occupied
- * 2: position previously occupied by a single candidate (at most)
- * 1: position already occupied by multiple candidates
- */
-static inline int Filter_insert(Filter* bf, int bflog, uint64_t hash)
- {
- hash = avalanche64(hash);
- unsigned const slot1 = hash & 255;
- hash >>= 8;
- unsigned const slot2 = hash & 255;
- hash >>= 8;
-
- size_t const fclmask = ((size_t)1 << (bflog-6)) - 1;
- size_t const cacheLineNb = hash & fclmask;
-
- size_t const pos1 = (cacheLineNb << 6) + (slot1 >> 2);
- unsigned const shift1 = (slot1 & 3) * 2;
- unsigned const ex1 = (bf[pos1] >> shift1) & 3;
-
- size_t const pos2 = (cacheLineNb << 6) + (slot2 >> 2);
- unsigned const shift2 = (slot2 & 3) * 2;
- unsigned const ex2 = (bf[pos2] >> shift2) & 3;
-
- unsigned const existing = MIN(ex1, ex2);
-
- static const int addCandidates[4] = { 0, 2, 1, 1 };
- static const unsigned nextValue[4] = { 1, 2, 3, 3 };
-
- bf[pos1] &= (Filter)(~(3 << shift1)); /* erase previous value */
- bf[pos1] |= (Filter)(MAX(ex1, nextValue[existing]) << shift1);
- bf[pos2] |= (Filter)(MAX(ex2, nextValue[existing]) << shift2);
-
- return addCandidates[existing];
- }
-
-
-/*
- * Check if provided 64-bit hash is a collision candidate
- * Requires the slot to be occupied by at least 2 candidates.
- * return >0 if hash is a collision candidate
- * 0 otherwise (slot unoccupied, or only one candidate)
- * note: unoccupied slots should not happen in this algorithm,
- * since all hashes are supposed to have been inserted at least once.
- */
-static inline int Filter_check(const Filter* bf, int bflog, uint64_t hash)
- {
- hash = avalanche64(hash);
- unsigned const slot1 = hash & 255;
- hash >>= 8;
- unsigned const slot2 = hash & 255;
- hash >>= 8;
-
- size_t const fclmask = ((size_t)1 << (bflog-6)) - 1;
- size_t const cacheLineNb = hash & fclmask;
-
- size_t const pos1 = (cacheLineNb << 6) + (slot1 >> 2);
- unsigned const shift1 = (slot1 & 3) * 2;
- unsigned const ex1 = (bf[pos1] >> shift1) & 3;
-
- size_t const pos2 = (cacheLineNb << 6) + (slot2 >> 2);
- unsigned const shift2 = (slot2 & 3) * 2;
- unsigned const ex2 = (bf[pos2] >> shift2) & 3;
-
- return (ex1 >= 2) && (ex2 >= 2);
- }
-
-#endif // FILTER_1_PROBE
-
-
-/* === Display === */
-
-#include <time.h> /* clock_t, clock, time_t, time, difftime */
-
-void update_indicator(uint64_t v, uint64_t total)
-{
- static clock_t start = 0;
- if (start==0) start = clock();
- clock_t const updateRate = CLOCKS_PER_SEC / 2;
-
- clock_t const clockSpan = (clock_t)(clock() - start);
- if (clockSpan > updateRate) {
- start = clock();
- assert(v <= total);
- assert(total > 0);
- double share = ((double)v / (double)total) * 100;
- printf("%6.2f%% (%llu) \r", share, (unsigned long long)v);
- fflush(NULL);
- }
-}
-
-/* note: not thread safe */
-const char* displayDelay(double delay_s)
-{
- static char delayString[50];
- memset(delayString, 0, sizeof(delayString));
-
- int const mn = ((int)delay_s / 60) % 60;
- int const h = (int)delay_s / 3600;
- int const sec = (int)delay_s % 60;
-
- char* p = delayString;
- if (h) sprintf(p, "%i h ", h);
- if (mn || h) {
- p = delayString + strlen(delayString);
- sprintf(p, "%i mn ", mn);
- }
- p = delayString + strlen(delayString);
- sprintf(p, "%is ", sec);
-
- return delayString;
-}
-
-
-/* === Math === */
-
-static double power(uint64_t base, int p)
-{
- double value = 1;
- assert(p>=0);
- for (int i=0; i<p; i++) {
- value *= (double)base;
- }
- return value;
-}
-
-static double estimateNbCollisions(uint64_t nbH, int nbBits)
-{
- return ((double)nbH * (double)(nbH-1)) / power(2, nbBits+1);
-}
-
-static int highestBitSet(uint64_t v)
-{
- assert(v!=0);
- int bitId = 0;
- while (v >>= 1) bitId++;
- return bitId;
-}
-
-
-/* === Filter and search collisions === */
-
-#undef NDEBUG /* ensure assert is not disabled */
-#include <assert.h>
-
-/* will recommend 24 billion samples for 64-bit hashes,
- * expecting 18 collisions for a good 64-bit hash */
-#define NB_BITS_MAX 64 /* can't store nor analyze hash wider than 64-bits for the time being */
-uint64_t select_nbh(int nbBits)
-{
- assert(nbBits > 0);
- if (nbBits > NB_BITS_MAX) nbBits = NB_BITS_MAX;
- double targetColls = (double)((128 + 17) - (nbBits * 2));
- uint64_t nbH = 24;
- while (estimateNbCollisions(nbH, nbBits) < targetColls) nbH *= 2;
- return nbH;
-}
-
-
-typedef struct {
- uint64_t nbCollisions;
-} searchCollisions_results;
-
-typedef struct {
- uint64_t nbH;
- uint64_t mask;
- uint64_t maskSelector;
- size_t sampleSize;
- uint64_t prngSeed;
- int filterLog; /* <0 = disable filter; 0 = auto-size; */
- int hashID;
- int display;
- int nbThreads;
- searchCollisions_results* resultPtr;
-} searchCollisions_parameters;
-
-#define DISPLAY(...) { if (display) printf(__VA_ARGS__); }
-
-static int isEqual(void* hTablePtr, size_t index1, size_t index2, Htype_e htype)
-{
- if ((htype == ht64) || (htype == ht32)) {
- uint64_t const h1 = ((const uint64_t*)hTablePtr)[index1];
- uint64_t const h2 = ((const uint64_t*)hTablePtr)[index2];
- return (h1 == h2);
- } else {
- assert(htype == ht128);
- XXH128_hash_t const h1 = ((const XXH128_hash_t*)hTablePtr)[index1];
- XXH128_hash_t const h2 = ((const XXH128_hash_t*)hTablePtr)[index2];
- return XXH128_isEqual(h1, h2);
- }
-}
-
-static int isHighEqual(void* hTablePtr, size_t index1, size_t index2, Htype_e htype, int rShift)
-{
- uint64_t h1, h2;
- if ((htype == ht64) || (htype == ht32)) {
- h1 = ((const uint64_t*)hTablePtr)[index1];
- h2 = ((const uint64_t*)hTablePtr)[index2];
- } else {
- assert(htype == ht128);
- h1 = ((const XXH128_hash_t*)hTablePtr)[index1].high64;
- h2 = ((const XXH128_hash_t*)hTablePtr)[index2].high64;
- assert(rShift >= 64);
- rShift -= 64;
- }
- assert(0 <= rShift && rShift < 64);
- return (h1 >> rShift) == (h2 >> rShift);
-}
-
-/* assumption: (htype*)hTablePtr[index] is valid */
-static void addHashCandidate(void* hTablePtr, UniHash h, Htype_e htype, size_t index)
-{
- if ((htype == ht64) || (htype == ht32)) {
- ((uint64_t*)hTablePtr)[index] = h.h64;
- } else {
- assert(htype == ht128);
- ((XXH128_hash_t*)hTablePtr)[index] = h.h128;
- }
-}
-
-static int getNbBits_fromHtype(Htype_e htype) {
- switch(htype) {
- case ht32: return 32;
- case ht64: return 64;
- case ht128:return 128;
- default: EXIT("hash size not supported");
- }
-}
-
-static Htype_e getHtype_fromHbits(int nbBits) {
- switch(nbBits) {
- case 32 : return ht32;
- case 64 : return ht64;
- case 128: return ht128;
- default: EXIT("hash size not supported");
- }
-}
-
-static size_t search_collisions(
- searchCollisions_parameters param)
-{
- uint64_t totalH = param.nbH;
- const uint64_t hMask = param.mask;
- const uint64_t hSelector = param.maskSelector;
- int bflog = param.filterLog;
- const int filter = (param.filterLog >= 0);
- const size_t sampleSize = param.sampleSize;
- const int hashID = param.hashID;
- const Htype_e htype = getHtype_fromHbits(hashfnTable[hashID].bits);
- const int display = param.display;
- /* init */
- sampleFactory* const sf = create_sampleFactory(sampleSize, totalH, param.prngSeed);
- if (!sf) EXIT("not enough memory");
-
- //const char* const hname = hashfnTable[hashID].name;
- hashfn const hfunction = hashfnTable[hashID].fn;
- int const hwidth = hashfnTable[hashID].bits;
- if (totalH == 0) totalH = select_nbh(hwidth);
- if (bflog == 0) bflog = highestBitSet(totalH) + 1; /* auto-size filter */
- uint64_t const bfsize = (1ULL << bflog);
-
-
- /* === filter hashes (optional) === */
-
- Filter* bf = NULL;
- uint64_t nbPresents = totalH;
-
- if (filter) {
- time_t const filterTBegin = time(NULL);
- DISPLAY(" Creating filter (%i GB) \n", (int)(bfsize >> 30));
- bf = create_Filter(bflog);
- if (!bf) EXIT("not enough memory for filter");
-
-
- DISPLAY(" Generate %llu hashes from samples of %u bytes \n",
- (unsigned long long)totalH, (unsigned)sampleSize);
- nbPresents = 0;
-
- for (uint64_t n=0; n < totalH; n++) {
- if (display && ((n&0xFFFFF) == 1) )
- update_indicator(n, totalH);
- update_sampleFactory(sf);
-
- UniHash const h = hfunction(sf->buffer, sampleSize);
- if ((h.h64 & hMask) != hSelector) continue;
-
- nbPresents += (uint64_t)Filter_insert(bf, bflog, h.h64);
- }
-
- if (nbPresents==0) {
- DISPLAY(" Analysis completed: No collision detected \n");
- if (param.resultPtr) param.resultPtr->nbCollisions = 0;
- free_Filter(bf);
- free_sampleFactory(sf);
- return 0;
- }
-
- { double const filterDelay = difftime(time(NULL), filterTBegin);
- DISPLAY(" Generation and filter completed in %s, detected up to %llu candidates \n",
- displayDelay(filterDelay), (unsigned long long) nbPresents);
- } }
-
-
- /* === store hash candidates: duplicates will be present here === */
-
- time_t const storeTBegin = time(NULL);
- size_t const hashByteSize = (htype == ht128) ? 16 : 8;
- size_t const tableSize = (nbPresents+1) * hashByteSize;
- assert(tableSize > nbPresents); /* check tableSize calculation overflow */
- DISPLAY(" Storing hash candidates (%i MB) \n", (int)(tableSize >> 20));
-
- /* Generate and store hashes */
- void* const hashCandidates = malloc(tableSize);
- if (!hashCandidates) EXIT("not enough memory to store candidates");
- init_sampleFactory(sf, totalH);
- size_t nbCandidates = 0;
- for (uint64_t n=0; n < totalH; n++) {
- if (display && ((n&0xFFFFF) == 1) ) update_indicator(n, totalH);
- update_sampleFactory(sf);
-
- UniHash const h = hfunction(sf->buffer, sampleSize);
- if ((h.h64 & hMask) != hSelector) continue;
-
- if (filter) {
- if (Filter_check(bf, bflog, h.h64)) {
- assert(nbCandidates < nbPresents);
- addHashCandidate(hashCandidates, h, htype, nbCandidates++);
- }
- } else {
- assert(nbCandidates < nbPresents);
- addHashCandidate(hashCandidates, h, htype, nbCandidates++);
- }
- }
- if (nbCandidates < nbPresents) {
- /* Try to mitigate gnuc_quicksort behavior, by reducing allocated memory,
- * since gnuc_quicksort uses a lot of additional memory for mergesort */
- void* const checkPtr = realloc(hashCandidates, nbCandidates * hashByteSize);
- assert(checkPtr != NULL);
- assert(checkPtr == hashCandidates); /* simplification: since we are reducing the size,
- * we hope to keep the same ptr position.
- * Otherwise, hashCandidates must be mutable. */
- DISPLAY(" List of hashes reduced to %u MB from %u MB (saved %u MB) \n",
- (unsigned)((nbCandidates * hashByteSize) >> 20),
- (unsigned)(tableSize >> 20),
- (unsigned)((tableSize - (nbCandidates * hashByteSize)) >> 20) );
- }
- double const storeTDelay = difftime(time(NULL), storeTBegin);
- DISPLAY(" Stored %llu hash candidates in %s \n",
- (unsigned long long) nbCandidates, displayDelay(storeTDelay));
- free_Filter(bf);
- free_sampleFactory(sf);
-
-
- /* === step 3: look for duplicates === */
- time_t const sortTBegin = time(NULL);
- DISPLAY(" Sorting candidates... ");
- fflush(NULL);
- if ((htype == ht64) || (htype == ht32)) {
- /*
- * Use C++'s std::sort, as it's faster than C stdlib's qsort, and
- * doesn't suffer from gnuc_libsort's memory expansion
- */
- sort64(hashCandidates, nbCandidates);
- } else {
- assert(htype == ht128);
- sort128(hashCandidates, nbCandidates); /* sort with custom comparator */
- }
- double const sortTDelay = difftime(time(NULL), sortTBegin);
- DISPLAY(" Completed in %s \n", displayDelay(sortTDelay));
-
- /* scan and count duplicates */
- time_t const countBegin = time(NULL);
- DISPLAY(" Looking for duplicates: ");
- fflush(NULL);
- size_t collisions = 0;
- for (size_t n=1; n<nbCandidates; n++) {
- if (isEqual(hashCandidates, n, n-1, htype)) {
-#if defined(COL_DISPLAY_DUPLICATES)
- printf("collision: ");
- printHash(hashCandidates, n, htype);
- printf(" / ");
- printHash(hashCandidates, n-1, htype);
- printf(" \n");
-#endif
- collisions++;
- } }
-
- if (!filter /* all candidates */ && display /*single thead*/ ) {
- /* check partial bitfields (high bits) */
- DISPLAY(" \n");
- int const hashBits = getNbBits_fromHtype(htype);
- double worstRatio = 0.;
- int worstNbHBits = 0;
- for (int nbHBits = 1; nbHBits < hashBits; nbHBits++) {
- uint64_t const nbSlots = (uint64_t)1 << nbHBits;
- double const expectedCollisions = estimateNbCollisions(nbCandidates, nbHBits);
- if ( (nbSlots > nbCandidates * 100) /* within range for meaningfull collision analysis results */
- && (expectedCollisions > 18.0) ) {
- int const rShift = hashBits - nbHBits;
- size_t HBits_collisions = 0;
- for (size_t n=1; n<nbCandidates; n++) {
- if (isHighEqual(hashCandidates, n, n-1, htype, rShift)) {
- HBits_collisions++;
- } }
- double const collisionRatio = (double)HBits_collisions / expectedCollisions;
- if (collisionRatio > 2.0) DISPLAY("WARNING !!! ===> ");
- DISPLAY(" high %i bits: %zu collision (%.1f expected): x%.2f \n",
- nbHBits, HBits_collisions, expectedCollisions, collisionRatio);
- if (collisionRatio > worstRatio) {
- worstNbHBits = nbHBits;
- worstRatio = collisionRatio;
- } } }
- DISPLAY("Worst collision ratio at %i high bits: x%.2f \n",
- worstNbHBits, worstRatio);
- }
- double const countDelay = difftime(time(NULL), countBegin);
- DISPLAY(" Completed in %s \n", displayDelay(countDelay));
-
- /* clean and exit */
- free (hashCandidates);
-
-#if 0 /* debug */
- for (size_t n=0; n<nbCandidates; n++)
- printf("0x%016llx \n", (unsigned long long)hashCandidates[n]);
-#endif
-
- if (param.resultPtr) param.resultPtr->nbCollisions = collisions;
- return collisions;
-}
-
-
-
-#if defined(__MACH__) || defined(__linux__)
-#include <sys/resource.h>
-static size_t getProcessMemUsage(int children)
-{
- struct rusage stats;
- if (getrusage(children ? RUSAGE_CHILDREN : RUSAGE_SELF, &stats) == 0)
- return (size_t)stats.ru_maxrss;
- return 0;
-}
-#else
-static size_t getProcessMemUsage(int ignore) { return 0; }
-#endif
-
-void time_collisions(searchCollisions_parameters param)
-{
- uint64_t totalH = param.nbH;
- int hashID = param.hashID;
- int display = param.display;
-
- /* init */
- assert(0 <= hashID && hashID < HASH_FN_TOTAL);
- //const char* const hname = hashfnTable[hashID].name;
- int const hwidth = hashfnTable[hashID].bits;
- if (totalH == 0) totalH = select_nbh(hwidth);
- double const targetColls = estimateNbCollisions(totalH, hwidth);
-
- /* Start the timer to measure start/end of hashing + collision detection. */
- time_t const programTBegin = time(NULL);
-
- /* Generate hashes, and count collisions */
- size_t const collisions = search_collisions(param);
-
- /* display results */
- double const programTDelay = difftime(time(NULL), programTBegin);
- size_t const programBytesSelf = getProcessMemUsage(0);
- size_t const programBytesChildren = getProcessMemUsage(1);
- DISPLAY("\n\n");
- DISPLAY("===> Found %llu collisions (x%.2f, %.1f expected) in %s\n",
- (unsigned long long)collisions,
- (double)collisions / targetColls,
- targetColls,
- displayDelay(programTDelay));
- if (programBytesSelf)
- DISPLAY("===> MaxRSS(self) %zuMB, MaxRSS(children) %zuMB\n",
- programBytesSelf>>20,
- programBytesChildren>>20);
- DISPLAY("------------------------------------------ \n");
-}
-
-// wrapper for pthread interface
-void MT_searchCollisions(void* payload)
-{
- search_collisions(*(searchCollisions_parameters*)payload);
-}
-
-/* === Command Line === */
-
-/*!
- * readU64FromChar():
- * Allows and interprets K, KB, KiB, M, MB and MiB suffix.
- * Will also modify `*stringPtr`, advancing it to the position where it stopped reading.
- */
-static uint64_t readU64FromChar(const char** stringPtr)
-{
- static uint64_t const max = (((uint64_t)(-1)) / 10) - 1;
- uint64_t result = 0;
- while ((**stringPtr >='0') && (**stringPtr <='9')) {
- assert(result < max);
- result *= 10;
- result += (unsigned)(**stringPtr - '0');
- (*stringPtr)++ ;
- }
- if ((**stringPtr=='K') || (**stringPtr=='M') || (**stringPtr=='G')) {
- uint64_t const maxK = ((uint64_t)(-1)) >> 10;
- assert(result < maxK);
- result <<= 10;
- if ((**stringPtr=='M') || (**stringPtr=='G')) {
- assert(result < maxK);
- result <<= 10;
- if (**stringPtr=='G') {
- assert(result < maxK);
- result <<= 10;
- }
- }
- (*stringPtr)++; /* skip `K` or `M` */
- if (**stringPtr=='i') (*stringPtr)++;
- if (**stringPtr=='B') (*stringPtr)++;
- }
- return result;
-}
-
-
-/**
- * longCommandWArg():
- * Checks if *stringPtr is the same as longCommand.
- * If yes, @return 1 and advances *stringPtr to the position which immediately follows longCommand.
- * @return 0 and doesn't modify *stringPtr otherwise.
- */
-static int longCommandWArg(const char** stringPtr, const char* longCommand)
-{
- assert(longCommand); assert(stringPtr); assert(*stringPtr);
- size_t const comSize = strlen(longCommand);
- int const result = !strncmp(*stringPtr, longCommand, comSize);
- if (result) *stringPtr += comSize;
- return result;
-}
-
-
-#include "pool.h"
-
-/*
- * As some hashes use different algorithms depending on input size,
- * it can be necessary to test multiple input sizes
- * to paint an accurate picture of collision performance
- */
-#define SAMPLE_SIZE_DEFAULT 256
-#define HASHFN_ID_DEFAULT 0
-
-void help(const char* exeName)
-{
- printf("usage: %s [hashName] [opt] \n\n", exeName);
- printf("list of hashNames:");
- printf("%s ", hashfnTable[0].name);
- for (int i=1; i < HASH_FN_TOTAL; i++) {
- printf(", %s ", hashfnTable[i].name);
- }
- printf(" \n");
- printf("Default hashName is %s\n", hashfnTable[HASHFN_ID_DEFAULT].name);
-
- printf(" \n");
- printf("Optional parameters: \n");
- printf(" --nbh=NB Select nb of hashes to generate (%llu by default) \n", (unsigned long long)select_nbh(64));
- printf(" --filter Activates the filter. Slower, but reduces memory usage for the same nb of hashes.\n");
- printf(" --threadlog=NB Use 2^NB threads.\n");
- printf(" --len=MB Set length of the input (%i bytes by default) \n", SAMPLE_SIZE_DEFAULT);
-}
-
-int bad_argument(const char* exeName)
-{
- printf("incorrect command: \n");
- help(exeName);
- return 1;
-}
-
-
-int main(int argc, const char** argv)
-{
- if (sizeof(size_t) < 8) return 1; // cannot work on systems without ability to allocate objects >= 4 GB
-
- assert(argc > 0);
- const char* const exeName = argv[0];
- uint64_t totalH = 0; /* auto, based on nbBits */
- int bflog = 0; /* auto */
- int filter = 0; /* disabled */
- size_t sampleSize = SAMPLE_SIZE_DEFAULT;
- int hashID = HASHFN_ID_DEFAULT;
- int threadlog = 0;
- uint64_t prngSeed = 0;
-
- int arg_nb;
- for (arg_nb = 1; arg_nb < argc; arg_nb++) {
- const char** arg = argv + arg_nb;
-
- if (!strcmp(*arg, "-h")) { help(exeName); return 0; }
- if (longCommandWArg(arg, "-T")) { threadlog = (int)readU64FromChar(arg); continue; }
-
- if (!strcmp(*arg, "--filter")) { filter=1; continue; }
- if (!strcmp(*arg, "--no-filter")) { filter=0; continue; }
-
- if (longCommandWArg(arg, "--seed")) { prngSeed = readU64FromChar(arg); continue; }
- if (longCommandWArg(arg, "--nbh=")) { totalH = readU64FromChar(arg); continue; }
- if (longCommandWArg(arg, "--filter=")) { filter=1; bflog = (int)readU64FromChar(arg); assert(bflog < 64); continue; }
- if (longCommandWArg(arg, "--filterlog=")) { filter=1; bflog = (int)readU64FromChar(arg); assert(bflog < 64); continue; }
- if (longCommandWArg(arg, "--size=")) { sampleSize = (size_t)readU64FromChar(arg); continue; }
- if (longCommandWArg(arg, "--len=")) { sampleSize = (size_t)readU64FromChar(arg); continue; }
- if (longCommandWArg(arg, "--threadlog=")) { threadlog = (int)readU64FromChar(arg); continue; }
-
- /* argument understood as hash name (must be correct) */
- int hnb;
- for (hnb=0; hnb < HASH_FN_TOTAL; hnb++) {
- if (!strcmp(*arg, hashfnTable[hnb].name)) { hashID = hnb; break; }
- }
- if (hnb == HASH_FN_TOTAL) return bad_argument(exeName);
- }
-
- /* init */
- const char* const hname = hashfnTable[hashID].name;
- int const hwidth = hashfnTable[hashID].bits;
- if (totalH == 0) totalH = select_nbh(hwidth);
- double const targetColls = estimateNbCollisions(totalH, hwidth);
- if (bflog == 0) bflog = highestBitSet(totalH) + 1; /* auto-size filter */
- if (!filter) bflog = -1; // disable filter
-
- if (sizeof(size_t) < 8)
- EXIT("This program has not been validated on architectures other than "
- "64bit \n");
-
- printf(" *** Collision tester for 64+ bit hashes *** \n\n");
- printf("Testing %s algorithm (%i-bit) \n", hname, hwidth);
- printf("This program will allocate a lot of memory,\n");
- printf("generate %llu %i-bit hashes from samples of %u bytes, \n",
- (unsigned long long)totalH, hwidth, (unsigned)sampleSize);
- printf("and attempt to produce %.0f collisions. \n\n", targetColls);
-
- int const nbThreads = 1 << threadlog;
- if (nbThreads <= 0) EXIT("Invalid --threadlog value.");
-
- if (nbThreads == 1) {
-
- searchCollisions_parameters params;
- params.nbH = totalH;
- params.mask = 0;
- params.maskSelector = 0;
- params.sampleSize = sampleSize;
- params.filterLog = bflog;
- params.hashID = hashID;
- params.display = 1;
- params.resultPtr = NULL;
- params.prngSeed = prngSeed;
- params.nbThreads = 1;
- time_collisions(params);
-
- } else { /* nbThreads > 1 */
-
- /* use multithreading */
- if (threadlog >= 30) EXIT("too many threads requested");
- if ((uint64_t)nbThreads > (totalH >> 16))
- EXIT("too many threads requested");
- if (bflog > 0 && threadlog > (bflog-10))
- EXIT("too many threads requested");
- printf("using %i threads ... \n", nbThreads);
-
- /* allocation */
- time_t const programTBegin = time(NULL);
- POOL_ctx* const pt = POOL_create((size_t)nbThreads, 1);
- if (!pt) EXIT("not enough memory for threads");
- searchCollisions_results* const MTresults = calloc (sizeof(searchCollisions_results), (size_t)nbThreads);
- if (!MTresults) EXIT("not enough memory");
- searchCollisions_parameters* const MTparams = calloc (sizeof(searchCollisions_parameters), (size_t)nbThreads);
- if (!MTparams) EXIT("not enough memory");
-
- /* distribute jobs */
- for (int tnb=0; tnb<nbThreads; tnb++) {
- MTparams[tnb].nbH = totalH;
- MTparams[tnb].mask = (uint64_t)nbThreads - 1;
- MTparams[tnb].sampleSize = sampleSize;
- MTparams[tnb].filterLog = bflog ? bflog - threadlog : 0;
- MTparams[tnb].hashID = hashID;
- MTparams[tnb].display = 0;
- MTparams[tnb].resultPtr = MTresults+tnb;
- MTparams[tnb].prngSeed = prngSeed;
- MTparams[tnb].maskSelector = (uint64_t)tnb;
- POOL_add(pt, MT_searchCollisions, MTparams + tnb);
- }
- POOL_free(pt); /* actually joins and free */
-
- /* Gather results */
- uint64_t nbCollisions=0;
- for (int tnb=0; tnb<nbThreads; tnb++) {
- nbCollisions += MTresults[tnb].nbCollisions;
- }
-
- double const programTDelay = difftime(time(NULL), programTBegin);
- size_t const programBytesSelf = getProcessMemUsage(0);
- size_t const programBytesChildren = getProcessMemUsage(1);
- printf("\n\n");
- printf("===> Found %llu collisions (x%.2f, %.1f expected) in %s\n",
- (unsigned long long)nbCollisions,
- (double)nbCollisions / targetColls,
- targetColls,
- displayDelay(programTDelay));
- if (programBytesSelf)
- printf("===> MaxRSS(self) %zuMB, MaxRSS(children) %zuMB\n",
- programBytesSelf>>20,
- programBytesChildren>>20);
- printf("------------------------------------------ \n");
-
- /* Clean up */
- free(MTparams);
- free(MTresults);
- }
-
- return 0;
-}
diff --git a/grpc/third_party/xxhash/tests/collisions/pool.c b/grpc/third_party/xxhash/tests/collisions/pool.c
deleted file mode 100644
index c0eaefd4..00000000
--- a/grpc/third_party/xxhash/tests/collisions/pool.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Copyright (C) 2016-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-
-/* ====== Dependencies ======= */
-#include <stddef.h> /* size_t */
-#include <stdlib.h> /* malloc, calloc, free */
-#include <string.h> /* memcpy */
-#include <assert.h>
-
-#include "pool.h"
-
-
-/* ====== Compiler specifics ====== */
-#if defined(_MSC_VER)
-# pragma warning(disable : 4204) /* disable: C4204: non-constant aggregate initializer */
-#endif
-
-
-/* === Build Macro === */
-
-#ifndef POOL_MT // can be defined on command line
-# define POOL_MT 1
-#endif
-
-
-/* === Implementation === */
-
-#if POOL_MT
-
-#include "threading.h" /* pthread adaptation */
-
-/* A job is a function and an opaque argument */
-typedef struct POOL_job_s {
- POOL_function function;
- void *opaque;
-} POOL_job;
-
-struct POOL_ctx_s {
- /* Keep track of the threads */
- ZSTD_pthread_t* threads;
- size_t threadCapacity;
- size_t threadLimit;
-
- /* The queue is a circular buffer */
- POOL_job *queue;
- size_t queueHead;
- size_t queueTail;
- size_t queueSize;
-
- /* The number of threads working on jobs */
- size_t numThreadsBusy;
- /* Indicates if the queue is empty */
- int queueEmpty;
-
- /* The mutex protects the queue */
- ZSTD_pthread_mutex_t queueMutex;
- /* Condition variable for pushers to wait on when the queue is full */
- ZSTD_pthread_cond_t queuePushCond;
- /* Condition variables for poppers to wait on when the queue is empty */
- ZSTD_pthread_cond_t queuePopCond;
- /* Indicates if the queue is shutting down */
- int shutdown;
-};
-
-/* POOL_thread() :
- * Work thread for the thread pool.
- * Waits for jobs and executes them.
- * @returns : NULL on failure else non-null.
- */
-static void* POOL_thread(void* opaque)
-{
- POOL_ctx* const ctx = (POOL_ctx*)opaque;
- if (!ctx) { return NULL; }
- for (;;) {
- /* Lock the mutex and wait for a non-empty queue or until shutdown */
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
-
- while ( ctx->queueEmpty
- || (ctx->numThreadsBusy >= ctx->threadLimit) ) {
- if (ctx->shutdown) {
- /* even if !queueEmpty, (possible if numThreadsBusy >= threadLimit),
- * a few threads will be shutdown while !queueEmpty,
- * but enough threads will remain active to finish the queue */
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
- return opaque;
- }
- ZSTD_pthread_cond_wait(&ctx->queuePopCond, &ctx->queueMutex);
- }
- /* Pop a job off the queue */
- { POOL_job const job = ctx->queue[ctx->queueHead];
- ctx->queueHead = (ctx->queueHead + 1) % ctx->queueSize;
- ctx->numThreadsBusy++;
- ctx->queueEmpty = ctx->queueHead == ctx->queueTail;
- /* Unlock the mutex, signal a pusher, and run the job */
- ZSTD_pthread_cond_signal(&ctx->queuePushCond);
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
-
- job.function(job.opaque);
-
- /* If the intended queue size was 0, signal after finishing job */
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
- ctx->numThreadsBusy--;
- if (ctx->queueSize == 1) {
- ZSTD_pthread_cond_signal(&ctx->queuePushCond);
- }
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
- }
- } /* for (;;) */
- assert(0); /* Unreachable */
-}
-
-POOL_ctx* POOL_create(size_t numThreads, size_t queueSize)
-{
- POOL_ctx* ctx;
- /* Check parameters */
- if (!numThreads) { return NULL; }
- /* Allocate the context and zero initialize */
- ctx = (POOL_ctx*)calloc(1, sizeof(POOL_ctx));
- if (!ctx) { return NULL; }
- /* Initialize the job queue.
- * It needs one extra space since one space is wasted to differentiate
- * empty and full queues.
- */
- ctx->queueSize = queueSize + 1;
- ctx->queue = (POOL_job*)malloc(ctx->queueSize * sizeof(POOL_job));
- ctx->queueHead = 0;
- ctx->queueTail = 0;
- ctx->numThreadsBusy = 0;
- ctx->queueEmpty = 1;
- (void)ZSTD_pthread_mutex_init(&ctx->queueMutex, NULL);
- (void)ZSTD_pthread_cond_init(&ctx->queuePushCond, NULL);
- (void)ZSTD_pthread_cond_init(&ctx->queuePopCond, NULL);
- ctx->shutdown = 0;
- /* Allocate space for the thread handles */
- ctx->threads = (ZSTD_pthread_t*)malloc(numThreads * sizeof(ZSTD_pthread_t));
- ctx->threadCapacity = 0;
- /* Check for errors */
- if (!ctx->threads || !ctx->queue) { POOL_free(ctx); return NULL; }
- /* Initialize the threads */
- { size_t i;
- for (i = 0; i < numThreads; ++i) {
- if (ZSTD_pthread_create(&ctx->threads[i], NULL, &POOL_thread, ctx)) {
- ctx->threadCapacity = i;
- POOL_free(ctx);
- return NULL;
- } }
- ctx->threadCapacity = numThreads;
- ctx->threadLimit = numThreads;
- }
- return ctx;
-}
-
-/*! POOL_join() :
- Shutdown the queue, wake any sleeping threads, and join all of the threads.
-*/
-static void POOL_join(POOL_ctx* ctx) {
- /* Shut down the queue */
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
- ctx->shutdown = 1;
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
-
- /* Wake up sleeping threads */
- ZSTD_pthread_cond_broadcast(&ctx->queuePushCond);
- ZSTD_pthread_cond_broadcast(&ctx->queuePopCond);
-
- /* Join all of the threads */
- { size_t i;
- for (i = 0; i < ctx->threadCapacity; ++i) {
- ZSTD_pthread_join(ctx->threads[i], NULL); /* note : could fail */
- } }
-}
-
-void POOL_free(POOL_ctx *ctx) {
- if (!ctx) { return; }
- POOL_join(ctx);
- ZSTD_pthread_mutex_destroy(&ctx->queueMutex);
- ZSTD_pthread_cond_destroy(&ctx->queuePushCond);
- ZSTD_pthread_cond_destroy(&ctx->queuePopCond);
- free(ctx->queue);
- free(ctx->threads);
- free(ctx);
-}
-
-
-
-size_t POOL_sizeof(POOL_ctx *ctx) {
- if (ctx==NULL) return 0; /* supports sizeof NULL */
- return sizeof(*ctx)
- + ctx->queueSize * sizeof(POOL_job)
- + ctx->threadCapacity * sizeof(ZSTD_pthread_t);
-}
-
-
-/* @return : 0 on success, 1 on error */
-static int POOL_resize_internal(POOL_ctx* ctx, size_t numThreads)
-{
- if (numThreads <= ctx->threadCapacity) {
- if (!numThreads) return 1;
- ctx->threadLimit = numThreads;
- return 0;
- }
- /* numThreads > threadCapacity */
- { ZSTD_pthread_t* const threadPool = (ZSTD_pthread_t*)malloc(numThreads * sizeof(ZSTD_pthread_t));
- if (!threadPool) return 1;
- /* replace existing thread pool */
- memcpy(threadPool, ctx->threads, ctx->threadCapacity * sizeof(*threadPool));
- free(ctx->threads);
- ctx->threads = threadPool;
- /* Initialize additional threads */
- { size_t threadId;
- for (threadId = ctx->threadCapacity; threadId < numThreads; ++threadId) {
- if (ZSTD_pthread_create(&threadPool[threadId], NULL, &POOL_thread, ctx)) {
- ctx->threadCapacity = threadId;
- return 1;
- } }
- } }
- /* successfully expanded */
- ctx->threadCapacity = numThreads;
- ctx->threadLimit = numThreads;
- return 0;
-}
-
-/* @return : 0 on success, 1 on error */
-int POOL_resize(POOL_ctx* ctx, size_t numThreads)
-{
- int result;
- if (ctx==NULL) return 1;
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
- result = POOL_resize_internal(ctx, numThreads);
- ZSTD_pthread_cond_broadcast(&ctx->queuePopCond);
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
- return result;
-}
-
-/**
- * Returns 1 if the queue is full and 0 otherwise.
- *
- * When queueSize is 1 (pool was created with an intended queueSize of 0),
- * then a queue is empty if there is a thread free _and_ no job is waiting.
- */
-static int isQueueFull(POOL_ctx const* ctx) {
- if (ctx->queueSize > 1) {
- return ctx->queueHead == ((ctx->queueTail + 1) % ctx->queueSize);
- } else {
- return (ctx->numThreadsBusy == ctx->threadLimit) ||
- !ctx->queueEmpty;
- }
-}
-
-
-static void POOL_add_internal(POOL_ctx* ctx, POOL_function function, void *opaque)
-{
- POOL_job const job = {function, opaque};
- assert(ctx != NULL);
- if (ctx->shutdown) return;
-
- ctx->queueEmpty = 0;
- ctx->queue[ctx->queueTail] = job;
- ctx->queueTail = (ctx->queueTail + 1) % ctx->queueSize;
- ZSTD_pthread_cond_signal(&ctx->queuePopCond);
-}
-
-void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque)
-{
- assert(ctx != NULL);
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
- /* Wait until there is space in the queue for the new job */
- while (isQueueFull(ctx) && (!ctx->shutdown)) {
- ZSTD_pthread_cond_wait(&ctx->queuePushCond, &ctx->queueMutex);
- }
- POOL_add_internal(ctx, function, opaque);
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
-}
-
-
-int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque)
-{
- assert(ctx != NULL);
- ZSTD_pthread_mutex_lock(&ctx->queueMutex);
- if (isQueueFull(ctx)) {
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
- return 0;
- }
- POOL_add_internal(ctx, function, opaque);
- ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
- return 1;
-}
-
-
-#else /* POOL_MT not defined */
-
-/* ========================== */
-/* No multi-threading support */
-/* ========================== */
-
-
-/* We don't need any data, but if it is empty, malloc() might return NULL. */
-struct POOL_ctx_s {
- int dummy;
-};
-static POOL_ctx g_ctx;
-
-POOL_ctx* POOL_create(size_t numThreads, size_t queueSize) {
- (void)numThreads;
- (void)queueSize;
- return &g_ctx;
-}
-
-void POOL_free(POOL_ctx* ctx) {
- assert(!ctx || ctx == &g_ctx);
- (void)ctx;
-}
-
-int POOL_resize(POOL_ctx* ctx, size_t numThreads) {
- (void)ctx; (void)numThreads;
- return 0;
-}
-
-void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque) {
- (void)ctx;
- function(opaque);
-}
-
-int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque) {
- (void)ctx;
- function(opaque);
- return 1;
-}
-
-size_t POOL_sizeof(POOL_ctx* ctx) {
- if (ctx==NULL) return 0; /* supports sizeof NULL */
- assert(ctx == &g_ctx);
- return sizeof(*ctx);
-}
-
-#endif /* ZSTD_MULTITHREAD */
diff --git a/grpc/third_party/xxhash/tests/collisions/pool.h b/grpc/third_party/xxhash/tests/collisions/pool.h
deleted file mode 100644
index 7c5e867d..00000000
--- a/grpc/third_party/xxhash/tests/collisions/pool.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2016-2020 Yann Collet, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- * You may select, at your option, one of the above-listed licenses.
- */
-
-#ifndef POOL_H
-#define POOL_H
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-#include <stddef.h> /* size_t */
-
-typedef struct POOL_ctx_s POOL_ctx;
-
-/*! POOL_create() :
- * Create a thread pool with at most `numThreads` threads.
- * `numThreads` must be at least 1.
- * The maximum number of queued jobs before blocking is `queueSize`.
- * @return : POOL_ctx pointer on success, else NULL.
-*/
-POOL_ctx* POOL_create(size_t numThreads, size_t queueSize);
-
-/*! POOL_free() :
- * Free a thread pool returned by POOL_create().
- */
-void POOL_free(POOL_ctx* ctx);
-
-/*! POOL_resize() :
- * Expands or shrinks pool's number of threads.
- * This is more efficient than releasing + creating a new context,
- * since it tries to preserve and re-use existing threads.
- * `numThreads` must be at least 1.
- * @return : 0 when resize was successful,
- * !0 (typically 1) if there is an error.
- * note : only numThreads can be resized, queueSize remains unchanged.
- */
-int POOL_resize(POOL_ctx* ctx, size_t numThreads);
-
-/*! POOL_sizeof() :
- * @return threadpool memory usage
- * note : compatible with NULL (returns 0 in this case)
- */
-size_t POOL_sizeof(POOL_ctx* ctx);
-
-/*! POOL_function :
- * The function type that can be added to a thread pool.
- */
-typedef void (*POOL_function)(void*);
-
-/*! POOL_add() :
- * Add the job `function(opaque)` to the thread pool. `ctx` must be valid.
- * Possibly blocks until there is room in the queue.
- * Note : The function may be executed asynchronously,
- * therefore, `opaque` must live until function has been completed.
- */
-void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque);
-
-
-/*! POOL_tryAdd() :
- * Add the job `function(opaque)` to thread pool _if_ a worker is available.
- * Returns immediately even if not (does not block).
- * @return : 1 if successful, 0 if not.
- */
-int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque);
-
-
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif
diff --git a/grpc/third_party/xxhash/tests/collisions/sort.cc b/grpc/third_party/xxhash/tests/collisions/sort.cc
deleted file mode 100644
index 237a114f..00000000
--- a/grpc/third_party/xxhash/tests/collisions/sort.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * sort.cc - C++ sort functions
- * Copyright (C) 2019-2020 Yann Collet
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * C++ sort functions tend to run faster than C ones due to templates allowing
- * inline optimizations.
- * Also, glibc's qsort() seems to inflate memory usage, resulting in OOM
- * crashes on the test server.
- */
-
-#include <algorithm> // std::sort
-#define XXH_INLINE_ALL // XXH128_cmp
-#include <xxhash.h>
-
-#include "sort.hh"
-
-void sort64(uint64_t* table, size_t size)
-{
- std::sort(table, table + size);
-}
-
-#include <stdlib.h> // qsort
-
-void sort128(XXH128_hash_t* table, size_t size)
-{
-#if 0
- // C++ sort using a custom function object
- struct {
- bool operator()(XXH128_hash_t a, XXH128_hash_t b) const
- {
- return XXH128_cmp(&a, &b);
- }
- } customLess;
- std::sort(table, table + size, customLess);
-#else
- qsort(table, size, sizeof(*table), XXH128_cmp);
-#endif
-}
diff --git a/grpc/third_party/xxhash/tests/collisions/sort.hh b/grpc/third_party/xxhash/tests/collisions/sort.hh
deleted file mode 100644
index 278ce05c..00000000
--- a/grpc/third_party/xxhash/tests/collisions/sort.hh
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * sort.hh - headers for C++ sort functions
- * Copyright (C) 2019-2020 Yann Collet
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at :
- * - xxHash homepage : https://www.xxhash.com
- * - xxHash source repository : https://github.com/Cyan4973/xxHash
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h> // size
-#include <stdint.h> // uint64_t
-#define XXH_STATIC_LINKING_ONLY // XXH128_hash_t
-#include "xxhash.h"
-
-void sort64(uint64_t* table, size_t size);
-
-void sort128(XXH128_hash_t* table, size_t size);
-
-#ifdef __cplusplus
-} // extern C
-#endif
diff --git a/grpc/third_party/xxhash/tests/collisions/threading.c b/grpc/third_party/xxhash/tests/collisions/threading.c
deleted file mode 100644
index 51646671..00000000
--- a/grpc/third_party/xxhash/tests/collisions/threading.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2016 Tino Reichardt
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- *
- * You can contact the author at:
- * - zstdmt source repository: https://github.com/mcmilk/zstdmt
- */
-
-/**
- * This file will hold wrapper for systems, which do not support pthreads
- */
-
-
- /* === Build Macro === */
-
- #ifndef POOL_MT // can be defined on command line
- # define POOL_MT 1
- #endif
-
-
-/* create fake symbol to avoid empty translation unit warning */
-int g_ZSTD_threading_useles_symbol;
-
-#if POOL_MT && defined(_WIN32)
-
-/**
- * Windows minimalist Pthread Wrapper
- */
-
-
-/* === Dependencies === */
-#include <process.h>
-#include <errno.h>
-#include "threading.h"
-
-
-/* === Implementation === */
-
-static unsigned __stdcall worker(void *arg)
-{
- ZSTD_pthread_t* const thread = (ZSTD_pthread_t*) arg;
- thread->arg = thread->start_routine(thread->arg);
- return 0;
-}
-
-int ZSTD_pthread_create(ZSTD_pthread_t* thread, const void* unused,
- void* (*start_routine) (void*), void* arg)
-{
- (void)unused;
- thread->arg = arg;
- thread->start_routine = start_routine;
- thread->handle = (HANDLE) _beginthreadex(NULL, 0, worker, thread, 0, NULL);
-
- if (!thread->handle)
- return errno;
- else
- return 0;
-}
-
-int ZSTD_pthread_join(ZSTD_pthread_t thread, void **value_ptr)
-{
- DWORD result;
-
- if (!thread.handle) return 0;
-
- result = WaitForSingleObject(thread.handle, INFINITE);
- switch (result) {
- case WAIT_OBJECT_0:
- if (value_ptr) *value_ptr = thread.arg;
- return 0;
- case WAIT_ABANDONED:
- return EINVAL;
- default:
- return (int)GetLastError();
- }
-}
-
-#endif /* POOL_MT */
diff --git a/grpc/third_party/xxhash/tests/collisions/threading.h b/grpc/third_party/xxhash/tests/collisions/threading.h
deleted file mode 100644
index 700bf442..00000000
--- a/grpc/third_party/xxhash/tests/collisions/threading.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Copyright (c) 2016 Tino Reichardt
- * All rights reserved.
- *
- * This source code is licensed under both the BSD-style license (found in the
- * LICENSE file in the root directory of this source tree) and the GPLv2 (found
- * in the COPYING file in the root directory of this source tree).
- *
- * You can contact the author at:
- * - zstdmt source repository: https://github.com/mcmilk/zstdmt
- */
-
-#ifndef THREADING_H_938743
-#define THREADING_H_938743
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-/* === Build Macro === */
-
-#ifndef POOL_MT // can be defined on command line
-# define POOL_MT 1
-#endif
-
-
-/* === Implementation === */
-
-#if POOL_MT && defined(_WIN32)
-
-/**
- * Define windows version before include
- */
-#undef WINVER
-#define WINVER 0x0600
-
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
-
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-#include <stdio.h>
-
-/* mutex */
-#define ZSTD_pthread_mutex_t CRITICAL_SECTION
-#define ZSTD_pthread_mutex_init(a, b) ((void)(b), InitializeCriticalSection((a)), 0)
-#define ZSTD_pthread_mutex_destroy(a) DeleteCriticalSection((a))
-#define ZSTD_pthread_mutex_lock(a) EnterCriticalSection((a))
-#define ZSTD_pthread_mutex_unlock(a) LeaveCriticalSection((a))
-
-/* condition variable */
-#define ZSTD_pthread_cond_t CONDITION_VARIABLE
-#define ZSTD_pthread_cond_init(a, b) ((void)(b), InitializeConditionVariable((a)), 0)
-#define ZSTD_pthread_cond_destroy(a) ((void)(a))
-#define ZSTD_pthread_cond_wait(a, b) SleepConditionVariableCS((a), (b), INFINITE)
-#define ZSTD_pthread_cond_signal(a) WakeConditionVariable((a))
-#define ZSTD_pthread_cond_broadcast(a) WakeAllConditionVariable((a))
-
-/* ZSTD_pthread_create() and ZSTD_pthread_join() */
-typedef struct {
- HANDLE handle;
- void* (*start_routine)(void*);
- void* arg;
-} ZSTD_pthread_t;
-
-int ZSTD_pthread_create(ZSTD_pthread_t* thread, const void* unused,
- void* (*start_routine) (void*), void* arg);
-
-int ZSTD_pthread_join(ZSTD_pthread_t thread, void** value_ptr);
-
-/**
- * add here more wrappers as required
- */
-
-
-#elif POOL_MT /* posix assumed ; need a better detection method */
-/* === POSIX Systems === */
-# include <pthread.h>
-
-#define ZSTD_pthread_mutex_t pthread_mutex_t
-#define ZSTD_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
-#define ZSTD_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
-#define ZSTD_pthread_mutex_lock(a) pthread_mutex_lock((a))
-#define ZSTD_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
-
-#define ZSTD_pthread_cond_t pthread_cond_t
-#define ZSTD_pthread_cond_init(a, b) pthread_cond_init((a), (b))
-#define ZSTD_pthread_cond_destroy(a) pthread_cond_destroy((a))
-#define ZSTD_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
-#define ZSTD_pthread_cond_signal(a) pthread_cond_signal((a))
-#define ZSTD_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
-
-#define ZSTD_pthread_t pthread_t
-#define ZSTD_pthread_create(a, b, c, d) pthread_create((a), (b), (c), (d))
-#define ZSTD_pthread_join(a, b) pthread_join((a),(b))
-
-#else /* POOL_MT == 0 */
-/* No multithreading support */
-
-typedef int ZSTD_pthread_mutex_t;
-#define ZSTD_pthread_mutex_init(a, b) ((void)(a), (void)(b), 0)
-#define ZSTD_pthread_mutex_destroy(a) ((void)(a))
-#define ZSTD_pthread_mutex_lock(a) ((void)(a))
-#define ZSTD_pthread_mutex_unlock(a) ((void)(a))
-
-typedef int ZSTD_pthread_cond_t;
-#define ZSTD_pthread_cond_init(a, b) ((void)(a), (void)(b), 0)
-#define ZSTD_pthread_cond_destroy(a) ((void)(a))
-#define ZSTD_pthread_cond_wait(a, b) ((void)(a), (void)(b))
-#define ZSTD_pthread_cond_signal(a) ((void)(a))
-#define ZSTD_pthread_cond_broadcast(a) ((void)(a))
-
-/* do not use ZSTD_pthread_t */
-
-#endif /* POOL_MT */
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* THREADING_H_938743 */
diff --git a/grpc/third_party/xxhash/tests/generate_unicode_test.c b/grpc/third_party/xxhash/tests/generate_unicode_test.c
deleted file mode 100644
index eed6ac01..00000000
--- a/grpc/third_party/xxhash/tests/generate_unicode_test.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Generates a Unicode test for xxhsum without using Unicode in the source files.
- *
- * Copyright (C) 2020 Devin Hussey (easyaspi314)
- *
- * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Certain terminals don't properly handle UTF-8 (i.e. rxvt and command prompt
- * in the default codepage), and that can cause issues when editing text.
- *
- * We use this C file to generate a file with a Unicode filename, a file with
- * a checksum of said file, and both a Windows batch script and a Unix shell
- * script to test the file.
- */
-
-#define _CRT_SECURE_NO_WARNINGS /* Silence warnings on MSVC */
-#include <stdio.h>
-
-/* Use a Japanese filename, something that can't be cheated with ANSI.
- * yuniko-do.unicode (literally unicode.unicode) */
-
-/* Use raw hex values to ensure that the output is well-formed UTF-8. It is also more C90 compliant. */
-static const char FILENAME[] = {
- (char)0xe3, (char)0x83, (char)0xa6, /* U+30e6: Katakana letter yu */
- (char)0xe3, (char)0x83, (char)0x8b, /* U+30cb: Katakana letter ni */
- (char)0xe3, (char)0x82, (char)0xb3, /* U+30b3: Katakana letter ko */
- (char)0xe3, (char)0x83, (char)0xbc, /* U+30fc: Katakana-Hiragana prolonged sound mark (dash) */
- (char)0xe3, (char)0x83, (char)0x89, /* U+30c9: Katakana letter do */
- '.','u','n','i','c','o','d','e','\0' /* ".unicode" (so we can glob in make clean and .gitignore) */
-};
-
-#ifdef _WIN32
-/* The same text as above, but encoded in Windows UTF-16. */
-static const wchar_t WFILENAME[] = { 0x30e6, 0x30cb, 0x30b3, 0x30fc, 0x30c9, L'.', L'u', L'n', L'i', L'c', L'o', L'd', L'e', L'\0' };
-#endif
-
-int main(void)
-{
- FILE *f, *script, *checksum;
-
- /* Create our Unicode file. Use _wfopen on Windows as fopen doesn't support Unicode filenames. */
-#ifdef _WIN32
- if (!(f = _wfopen(WFILENAME, L"wb"))) return 1;
-#else
- if (!(f = fopen(FILENAME, "wb"))) return 1;
-#endif
- fprintf(f, "test\n");
- fclose(f);
-
- /* XXH64 checksum file with the precalculated checksum for said file. */
- if (!(checksum = fopen("unicode_test.xxh64", "wb")))
- return 1;
- fprintf(checksum, "2d7f1808da1fa63c %s\n", FILENAME);
- fclose(checksum);
-
-
- /* Create two scripts for both Windows and Unix. */
-
- /* Generate a Windows batch script. Always insert CRLF manually. */
- if (!(script = fopen("unicode_test.bat", "wb")))
- return 1;
-
- /* Disable echoing the commands. We do that ourselves the naive way. */
- fprintf(script, "@echo off\r\n");
-
- /* Change to codepage 65001 to enable UTF-8 support. */
- fprintf(script, "chcp 65001 >NUL 2>&1\r\n");
-
- /* First test a Unicode filename */
- fprintf(script, "echo Testing filename provided on command line...\r\n");
- fprintf(script, "echo xxhsum.exe \"%s\"\r\n", FILENAME);
- fprintf(script, "xxhsum.exe \"%s\"\r\n", FILENAME);
-
- /* Bail on error */
- fprintf(script, "if %%ERRORLEVEL%% neq 0 (\r\n");
- fprintf(script, " exit /B %%ERRORLEVEL%%\r\n");
- fprintf(script, ")\r\n");
-
- /* Then test a checksum file. */
- fprintf(script, "echo Testing a checksum file...\r\n");
- fprintf(script, "echo xxhsum.exe -c unicode_test.xxh64\r\n");
- fprintf(script, "xxhsum.exe -c unicode_test.xxh64\r\n");
-
- fprintf(script, "exit /B %%ERRORLEVEL%%\r\n");
-
- fclose(script);
-
- /* Generate a Unix shell script */
- if (!(script = fopen("unicode_test.sh", "wb")))
- return 1;
-
- fprintf(script, "#!/bin/sh\n");
- /*
- * Some versions of MSYS, MinGW and Cygwin do not support UTF-8, and the ones that
- * don't may error with something like this:
- *
- * Error: Could not open '<mojibake>.unicode': No such file or directory.
- *
- * which is an internal error that happens when it tries to convert MinGW/Cygwin
- * paths to Windows paths.
- *
- * In that case, we bail to cmd.exe and the batch script, which supports UTF-8
- * on Windows 7 and later.
- */
- fprintf(script, "case $(uname) in\n");
- /* MinGW/MSYS converts /c to C:\ unless you have a double slash,
- * Cygwin does not. */
- fprintf(script, " *CYGWIN*)\n");
- fprintf(script, " exec cmd.exe /c unicode_test.bat\n");
- fprintf(script, " ;;\n");
- fprintf(script, " *MINGW*|*MSYS*)\n");
- fprintf(script, " exec cmd.exe //c unicode_test.bat\n");
- fprintf(script, " ;;\n");
- fprintf(script, "esac\n");
-
- /* First test a Unicode filename */
- fprintf(script, "echo Testing filename provided on command line...\n");
- fprintf(script, "echo './xxhsum \"%s\" || exit $?'\n", FILENAME);
- fprintf(script, "./xxhsum \"%s\" || exit $?\n", FILENAME);
-
- /* Then test a checksum file. */
- fprintf(script, "echo Testing a checksum file...\n");
- fprintf(script, "echo './xxhsum -c unicode_test.xxh64 || exit $?'\n");
- fprintf(script, "./xxhsum -c unicode_test.xxh64 || exit $?\n");
-
- fclose(script);
-
- return 0;
-}
diff --git a/grpc/third_party/xxhash/tests/multiInclude.c b/grpc/third_party/xxhash/tests/multiInclude.c
deleted file mode 100644
index 7d2bc8a9..00000000
--- a/grpc/third_party/xxhash/tests/multiInclude.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Multi-include test program
- * Validates that xxhash.h can be included multiple times and in any order
- *
- * Copyright (C) 2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#include <stdio.h> /* printf */
-
-/* Normal include, gives access to public symbols */
-#include "../xxhash.h"
-
-/*
- * Advanced include, gives access to experimental symbols
- * This test ensure that xxhash.h can be included multiple times and in any
- * order. This order is more difficult: Without care, the declaration of
- * experimental symbols could be skipped.
- */
-#define XXH_STATIC_LINKING_ONLY
-#include "../xxhash.h"
-
-/*
- * Inlining: Re-define all identifiers, keep them private to the unit.
- * Note: Without specific efforts, the identifier names would collide.
- *
- * To be linked with and without xxhash.o to test the symbol's presence and
- * naming collisions.
- */
-#define XXH_INLINE_ALL
-#include "../xxhash.h"
-
-
-int main(void)
-{
- XXH3_state_t state; /* part of experimental API */
-
- XXH3_64bits_reset(&state);
- const char input[] = "Hello World !";
-
- XXH3_64bits_update(&state, input, sizeof(input));
-
- XXH64_hash_t const h = XXH3_64bits_digest(&state);
- printf("hash '%s': %08x%08x \n", input, (unsigned)(h >> 32), (unsigned)h);
-
- return 0;
-}
diff --git a/grpc/third_party/xxhash/tests/ppc_define.c b/grpc/third_party/xxhash/tests/ppc_define.c
deleted file mode 100644
index d94c2c72..00000000
--- a/grpc/third_party/xxhash/tests/ppc_define.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Multi-include test program
- * ensure that pixel, bool and vector are not redefined
- *
- * Copyright (C) 2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/* gcc's altivec.h, included for the VSX code path,
- * may, in some circumstances, redefine
- * bool, vector and pixel keywords.
- *
- * This unit checks if it happens.
- * It's a compile test.
- * The test is mostly meaningful for PPC target using altivec.h
- * hence XXH_VECTOR == XXH_VSX
- */
-
-#define BOOL_VALUE 32123456
-#define bool BOOL_VALUE
-
-#define VECTOR_VALUE 374464784
-#define vector VECTOR_VALUE
-
-#define PIXEL_VALUE 5846841
-#define pixel PIXEL_VALUE
-
-#define XXH_INLINE_ALL
-#include "../xxhash.h"
-
-#if (bool != BOOL_VALUE)
-# error "bool macro was redefined !"
-#endif
-
-#if (vector != VECTOR_VALUE)
-# error "vector macro was redefined !"
-#endif
-
-#if (pixel != PIXEL_VALUE)
-# error "pixel macro was redefined !"
-#endif
-
-int g_nonEmptyUnit = 0;
diff --git a/grpc/third_party/xxhash/xxh3.h b/grpc/third_party/xxhash/xxh3.h
deleted file mode 100644
index 7e83e641..00000000
--- a/grpc/third_party/xxhash/xxh3.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * xxHash - Extremely Fast Hash algorithm
- * Development source file for `xxh3`
- * Copyright (C) 2019-2020 Yann Collet
- *
- * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * Note: This file used to host the source code of XXH3_* variants.
- * during the development period.
- * The source code is now properly integrated within xxhash.h.
- *
- * xxh3.h is no longer useful,
- * but it is still provided for compatibility with source code
- * which used to include it directly.
- *
- * Programs are now highly discourage to include xxh3.h.
- * Include `xxhash.h` instead, which is the officially supported interface.
- *
- * In the future, xxh3.h will start to generate warnings, then errors,
- * then it will be removed from source package and from include directory.
- */
-
-/* Simulate the same impact as including the old xxh3.h source file */
-
-#define XXH_INLINE_ALL
-#include "xxhash.h"
diff --git a/grpc/third_party/xxhash/xxh_x86dispatch.c b/grpc/third_party/xxhash/xxh_x86dispatch.c
deleted file mode 100644
index ab338329..00000000
--- a/grpc/third_party/xxhash/xxh_x86dispatch.c
+++ /dev/null
@@ -1,770 +0,0 @@
-/*
- * xxHash - Extremely Fast Hash algorithm
- * Copyright (C) 2020 Yann Collet
- *
- * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-
-/*!
- * @file xxh_x86dispatch.c
- *
- * Automatic dispatcher code for the @ref xxh3_family on x86-based targets.
- *
- * Optional add-on.
- *
- * **Compile this file with the default flags for your target.** Do not compile
- * with flags like `-mavx*`, `-march=native`, or `/arch:AVX*`, there will be
- * an error. See @ref XXH_X86DISPATCH_ALLOW_AVX for details.
- *
- * @defgroup dispatch x86 Dispatcher
- * @{
- */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-#if !(defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64))
-# error "Dispatching is currently only supported on x86 and x86_64."
-#endif
-
-/*!
- * @def XXH_X86DISPATCH_ALLOW_AVX
- * @brief Disables the AVX sanity check.
- *
- * Don't compile xxh_x86dispatch.c with options like `-mavx*`, `-march=native`,
- * or `/arch:AVX*`. It is intended to be compiled for the minimum target, and
- * it selectively enables SSE2, AVX2, and AVX512 when it is needed.
- *
- * Using this option _globally_ allows this feature, and therefore makes it
- * undefined behavior to execute on any CPU without said feature.
- *
- * Even if the source code isn't directly using AVX intrinsics in a function,
- * the compiler can still generate AVX code from autovectorization and by
- * "upgrading" SSE2 intrinsics to use the VEX prefixes (a.k.a. AVX128).
- *
- * Use the same flags that you use to compile the rest of the program; this
- * file will safely generate SSE2, AVX2, and AVX512 without these flags.
- *
- * Define XXH_X86DISPATCH_ALLOW_AVX to ignore this check, and feel free to open
- * an issue if there is a target in the future where AVX is a default feature.
- */
-#ifdef XXH_DOXYGEN
-# define XXH_X86DISPATCH_ALLOW_AVX
-#endif
-
-#if defined(__AVX__) && !defined(XXH_X86DISPATCH_ALLOW_AVX)
-# error "Do not compile xxh_x86dispatch.c with AVX enabled! See the comment above."
-#endif
-
-#ifdef __has_include
-# define XXH_HAS_INCLUDE(header) __has_include(header)
-#else
-# define XXH_HAS_INCLUDE(header) 0
-#endif
-
-/*!
- * @def XXH_DISPATCH_SCALAR
- * @brief Enables/dispatching the scalar code path.
- *
- * If this is defined to 0, SSE2 support is assumed. This reduces code size
- * when the scalar path is not needed.
- *
- * This is automatically defined to 0 when...
- * - SSE2 support is enabled in the compiler
- * - Targeting x86_64
- * - Targeting Android x86
- * - Targeting macOS
- */
-#ifndef XXH_DISPATCH_SCALAR
-# if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2) /* SSE2 on by default */ \
- || defined(__x86_64__) || defined(_M_X64) /* x86_64 */ \
- || defined(__ANDROID__) || defined(__APPLEv__) /* Android or macOS */
-# define XXH_DISPATCH_SCALAR 0 /* disable */
-# else
-# define XXH_DISPATCH_SCALAR 1
-# endif
-#endif
-/*!
- * @def XXH_DISPATCH_AVX2
- * @brief Enables/disables dispatching for AVX2.
- *
- * This is automatically detected if it is not defined.
- * - GCC 4.7 and later are known to support AVX2, but >4.9 is required for
- * to get the AVX2 intrinsics and typedefs without -mavx -mavx2.
- * - Visual Studio 2013 Update 2 and later are known to support AVX2.
- * - The GCC/Clang internal header `<avx2intrin.h>` is detected. While this is
- * not allowed to be included directly, it still appears in the builtin
- * include path and is detectable with `__has_include`.
- *
- * @see XXH_AVX2
- */
-#ifndef XXH_DISPATCH_AVX2
-# if (defined(__GNUC__) && (__GNUC__ > 4)) /* GCC 5.0+ */ \
- || (defined(_MSC_VER) && _MSC_VER >= 1900) /* VS 2015+ */ \
- || (defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 180030501) /* VS 2013 Update 2 */ \
- || XXH_HAS_INCLUDE(<avx2intrin.h>) /* GCC/Clang internal header */
-# define XXH_DISPATCH_AVX2 1 /* enable dispatch towards AVX2 */
-# else
-# define XXH_DISPATCH_AVX2 0
-# endif
-#endif /* XXH_DISPATCH_AVX2 */
-
-/*!
- * @def XXH_DISPATCH_AVX512
- * @brief Enables/disables dispatching for AVX512.
- *
- * Automatically detected if one of the following conditions is met:
- * - GCC 4.9 and later are known to support AVX512.
- * - Visual Studio 2017 and later are known to support AVX2.
- * - The GCC/Clang internal header `<avx512fintrin.h>` is detected. While this
- * is not allowed to be included directly, it still appears in the builtin
- * include path and is detectable with `__has_include`.
- *
- * @see XXH_AVX512
- */
-#ifndef XXH_DISPATCH_AVX512
-# if (defined(__GNUC__) \
- && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))) /* GCC 4.9+ */ \
- || (defined(_MSC_VER) && _MSC_VER >= 1910) /* VS 2017+ */ \
- || XXH_HAS_INCLUDE(<avx512fintrin.h>) /* GCC/Clang internal header */
-# define XXH_DISPATCH_AVX512 1 /* enable dispatch towards AVX512 */
-# else
-# define XXH_DISPATCH_AVX512 0
-# endif
-#endif /* XXH_DISPATCH_AVX512 */
-
-/*!
- * @def XXH_TARGET_SSE2
- * @brief Allows a function to be compiled with SSE2 intrinsics.
- *
- * Uses `__attribute__((__target__("sse2")))` on GCC to allow SSE2 to be used
- * even with `-mno-sse2`.
- *
- * @def XXH_TARGET_AVX2
- * @brief Like @ref XXH_TARGET_SSE2, but for AVX2.
- *
- * @def XXH_TARGET_AVX512
- * @brief Like @ref XXH_TARGET_SSE2, but for AVX512.
- */
-#if defined(__GNUC__)
-# include <emmintrin.h> /* SSE2 */
-# if XXH_DISPATCH_AVX2 || XXH_DISPATCH_AVX512
-# include <immintrin.h> /* AVX2, AVX512F */
-# endif
-# define XXH_TARGET_SSE2 __attribute__((__target__("sse2")))
-# define XXH_TARGET_AVX2 __attribute__((__target__("avx2")))
-# define XXH_TARGET_AVX512 __attribute__((__target__("avx512f")))
-#elif defined(_MSC_VER)
-# include <intrin.h>
-# define XXH_TARGET_SSE2
-# define XXH_TARGET_AVX2
-# define XXH_TARGET_AVX512
-#else
-# error "Dispatching is currently not supported for your compiler."
-#endif
-
-#ifdef XXH_DISPATCH_DEBUG
-/* debug logging */
-# include <stdio.h>
-# define XXH_debugPrint(str) { fprintf(stderr, "DEBUG: xxHash dispatch: %s \n", str); fflush(NULL); }
-#else
-# define XXH_debugPrint(str) ((void)0)
-# undef NDEBUG /* avoid redefinition */
-# define NDEBUG
-#endif
-#include <assert.h>
-
-#define XXH_INLINE_ALL
-#define XXH_X86DISPATCH
-#include "xxhash.h"
-
-/*
- * Support both AT&T and Intel dialects
- *
- * GCC doesn't convert AT&T syntax to Intel syntax, and will error out if
- * compiled with -masm=intel. Instead, it supports dialect switching with
- * curly braces: { AT&T syntax | Intel syntax }
- *
- * Clang's integrated assembler automatically converts AT&T syntax to Intel if
- * needed, making the dialect switching useless (it isn't even supported).
- *
- * Note: Comments are written in the inline assembly itself.
- */
-#ifdef __clang__
-# define XXH_I_ATT(intel, att) att "\n\t"
-#else
-# define XXH_I_ATT(intel, att) "{" att "|" intel "}\n\t"
-#endif
-
-/*!
- * @internal
- * @brief Runs CPUID.
- *
- * @param eax, ecx The parameters to pass to CPUID, %eax and %ecx respectively.
- * @param abcd The array to store the result in, `{ eax, ebx, ecx, edx }`
- */
-static void XXH_cpuid(xxh_u32 eax, xxh_u32 ecx, xxh_u32* abcd)
-{
-#if defined(_MSC_VER)
- __cpuidex(abcd, eax, ecx);
-#else
- xxh_u32 ebx, edx;
-# if defined(__i386__) && defined(__PIC__)
- __asm__(
- "# Call CPUID\n\t"
- "#\n\t"
- "# On 32-bit x86 with PIC enabled, we are not allowed to overwrite\n\t"
- "# EBX, so we use EDI instead.\n\t"
- XXH_I_ATT("mov edi, ebx", "movl %%ebx, %%edi")
- XXH_I_ATT("cpuid", "cpuid" )
- XXH_I_ATT("xchg edi, ebx", "xchgl %%ebx, %%edi")
- : "=D" (ebx),
-# else
- __asm__(
- "# Call CPUID\n\t"
- XXH_I_ATT("cpuid", "cpuid")
- : "=b" (ebx),
-# endif
- "+a" (eax), "+c" (ecx), "=d" (edx));
- abcd[0] = eax;
- abcd[1] = ebx;
- abcd[2] = ecx;
- abcd[3] = edx;
-#endif
-}
-
-/*
- * Modified version of Intel's guide
- * https://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family
- */
-
-#if XXH_DISPATCH_AVX2 || XXH_DISPATCH_AVX512
-/*!
- * @internal
- * @brief Runs `XGETBV`.
- *
- * While the CPU may support AVX2, the operating system might not properly save
- * the full YMM/ZMM registers.
- *
- * xgetbv is used for detecting this: Any compliant operating system will define
- * a set of flags in the xcr0 register indicating how it saves the AVX registers.
- *
- * You can manually disable this flag on Windows by running, as admin:
- *
- * bcdedit.exe /set xsavedisable 1
- *
- * and rebooting. Run the same command with 0 to re-enable it.
- */
-static xxh_u64 XXH_xgetbv(void)
-{
-#if defined(_MSC_VER)
- return _xgetbv(0); /* min VS2010 SP1 compiler is required */
-#else
- xxh_u32 xcr0_lo, xcr0_hi;
- __asm__(
- "# Call XGETBV\n\t"
- "#\n\t"
- "# Older assemblers (e.g. macOS's ancient GAS version) don't support\n\t"
- "# the XGETBV opcode, so we encode it by hand instead.\n\t"
- "# See <https://github.com/asmjit/asmjit/issues/78> for details.\n\t"
- ".byte 0x0f, 0x01, 0xd0\n\t"
- : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0));
- return xcr0_lo | ((xxh_u64)xcr0_hi << 32);
-#endif
-}
-#endif
-
-#define XXH_SSE2_CPUID_MASK (1 << 26)
-#define XXH_OSXSAVE_CPUID_MASK ((1 << 26) | (1 << 27))
-#define XXH_AVX2_CPUID_MASK (1 << 5)
-#define XXH_AVX2_XGETBV_MASK ((1 << 2) | (1 << 1))
-#define XXH_AVX512F_CPUID_MASK (1 << 16)
-#define XXH_AVX512F_XGETBV_MASK ((7 << 5) | (1 << 2) | (1 << 1))
-
-/*!
- * @internal
- * @brief Returns the best XXH3 implementation.
- *
- * Runs various CPUID/XGETBV tests to try and determine the best implementation.
- *
- * @ret The best @ref XXH_VECTOR implementation.
- * @see XXH_VECTOR_TYPES
- */
-static int XXH_featureTest(void)
-{
- xxh_u32 abcd[4];
- xxh_u32 max_leaves;
- int best = XXH_SCALAR;
-#if XXH_DISPATCH_AVX2 || XXH_DISPATCH_AVX512
- xxh_u64 xgetbv_val;
-#endif
-#if defined(__GNUC__) && defined(__i386__)
- xxh_u32 cpuid_supported;
- __asm__(
- "# For the sake of ruthless backwards compatibility, check if CPUID\n\t"
- "# is supported in the EFLAGS on i386.\n\t"
- "# This is not necessary on x86_64 - CPUID is mandatory.\n\t"
- "# The ID flag (bit 21) in the EFLAGS register indicates support\n\t"
- "# for the CPUID instruction. If a software procedure can set and\n\t"
- "# clear this flag, the processor executing the procedure supports\n\t"
- "# the CPUID instruction.\n\t"
- "# <https://c9x.me/x86/html/file_module_x86_id_45.html>\n\t"
- "#\n\t"
- "# Routine is from <https://wiki.osdev.org/CPUID>.\n\t"
-
- "# Save EFLAGS\n\t"
- XXH_I_ATT("pushfd", "pushfl" )
- "# Store EFLAGS\n\t"
- XXH_I_ATT("pushfd", "pushfl" )
- "# Invert the ID bit in stored EFLAGS\n\t"
- XXH_I_ATT("xor dword ptr[esp], 0x200000", "xorl $0x200000, (%%esp)")
- "# Load stored EFLAGS (with ID bit inverted)\n\t"
- XXH_I_ATT("popfd", "popfl" )
- "# Store EFLAGS again (ID bit may or not be inverted)\n\t"
- XXH_I_ATT("pushfd", "pushfl" )
- "# eax = modified EFLAGS (ID bit may or may not be inverted)\n\t"
- XXH_I_ATT("pop eax", "popl %%eax" )
- "# eax = whichever bits were changed\n\t"
- XXH_I_ATT("xor eax, dword ptr[esp]", "xorl (%%esp), %%eax" )
- "# Restore original EFLAGS\n\t"
- XXH_I_ATT("popfd", "popfl" )
- "# eax = zero if ID bit can't be changed, else non-zero\n\t"
- XXH_I_ATT("and eax, 0x200000", "andl $0x200000, %%eax" )
- : "=a" (cpuid_supported) :: "cc");
-
- if (XXH_unlikely(!cpuid_supported)) {
- XXH_debugPrint("CPUID support is not detected!");
- return best;
- }
-
-#endif
- /* Check how many CPUID pages we have */
- XXH_cpuid(0, 0, abcd);
- max_leaves = abcd[0];
-
- /* Shouldn't happen on hardware, but happens on some QEMU configs. */
- if (XXH_unlikely(max_leaves == 0)) {
- XXH_debugPrint("Max CPUID leaves == 0!");
- return best;
- }
-
- /* Check for SSE2, OSXSAVE and xgetbv */
- XXH_cpuid(1, 0, abcd);
-
- /*
- * Test for SSE2. The check is redundant on x86_64, but it doesn't hurt.
- */
- if (XXH_unlikely((abcd[3] & XXH_SSE2_CPUID_MASK) != XXH_SSE2_CPUID_MASK))
- return best;
-
- XXH_debugPrint("SSE2 support detected.");
-
- best = XXH_SSE2;
-#if XXH_DISPATCH_AVX2 || XXH_DISPATCH_AVX512
- /* Make sure we have enough leaves */
- if (XXH_unlikely(max_leaves < 7))
- return best;
-
- /* Test for OSXSAVE and XGETBV */
- if ((abcd[2] & XXH_OSXSAVE_CPUID_MASK) != XXH_OSXSAVE_CPUID_MASK)
- return best;
-
- /* CPUID check for AVX features */
- XXH_cpuid(7, 0, abcd);
-
- xgetbv_val = XXH_xgetbv();
-#if XXH_DISPATCH_AVX2
- /* Validate that AVX2 is supported by the CPU */
- if ((abcd[1] & XXH_AVX2_CPUID_MASK) != XXH_AVX2_CPUID_MASK)
- return best;
-
- /* Validate that the OS supports YMM registers */
- if ((xgetbv_val & XXH_AVX2_XGETBV_MASK) != XXH_AVX2_XGETBV_MASK) {
- XXH_debugPrint("AVX2 supported by the CPU, but not the OS.");
- return best;
- }
-
- /* AVX2 supported */
- XXH_debugPrint("AVX2 support detected.");
- best = XXH_AVX2;
-#endif
-#if XXH_DISPATCH_AVX512
- /* Check if AVX512F is supported by the CPU */
- if ((abcd[1] & XXH_AVX512F_CPUID_MASK) != XXH_AVX512F_CPUID_MASK) {
- XXH_debugPrint("AVX512F not supported by CPU");
- return best;
- }
-
- /* Validate that the OS supports ZMM registers */
- if ((xgetbv_val & XXH_AVX512F_XGETBV_MASK) != XXH_AVX512F_XGETBV_MASK) {
- XXH_debugPrint("AVX512F supported by the CPU, but not the OS.");
- return best;
- }
-
- /* AVX512F supported */
- XXH_debugPrint("AVX512F support detected.");
- best = XXH_AVX512;
-#endif
-#endif
- return best;
-}
-
-
-/* === Vector implementations === */
-
-/*!
- * @internal
- * @brief Defines the various dispatch functions.
- *
- * TODO: Consolidate?
- *
- * @param suffix The suffix for the functions, e.g. sse2 or scalar
- * @param target XXH_TARGET_* or empty.
- */
-#define XXH_DEFINE_DISPATCH_FUNCS(suffix, target) \
- \
-/* === XXH3, default variants === */ \
- \
-XXH_NO_INLINE target XXH64_hash_t \
-XXHL64_default_##suffix(const void* XXH_RESTRICT input, size_t len) \
-{ \
- return XXH3_hashLong_64b_internal( \
- input, len, XXH3_kSecret, sizeof(XXH3_kSecret), \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix \
- ); \
-} \
- \
-/* === XXH3, Seeded variants === */ \
- \
-XXH_NO_INLINE target XXH64_hash_t \
-XXHL64_seed_##suffix(const void* XXH_RESTRICT input, size_t len, \
- XXH64_hash_t seed) \
-{ \
- return XXH3_hashLong_64b_withSeed_internal( \
- input, len, seed, XXH3_accumulate_512_##suffix, \
- XXH3_scrambleAcc_##suffix, XXH3_initCustomSecret_##suffix \
- ); \
-} \
- \
-/* === XXH3, Secret variants === */ \
- \
-XXH_NO_INLINE target XXH64_hash_t \
-XXHL64_secret_##suffix(const void* XXH_RESTRICT input, size_t len, \
- const void* secret, size_t secretLen) \
-{ \
- return XXH3_hashLong_64b_internal( \
- input, len, secret, secretLen, \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix \
- ); \
-} \
- \
-/* === XXH3 update variants === */ \
- \
-XXH_NO_INLINE target XXH_errorcode \
-XXH3_update_##suffix(XXH3_state_t* state, const void* input, size_t len) \
-{ \
- return XXH3_update(state, (const xxh_u8*)input, len, \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix); \
-} \
- \
-/* === XXH128 default variants === */ \
- \
-XXH_NO_INLINE target XXH128_hash_t \
-XXHL128_default_##suffix(const void* XXH_RESTRICT input, size_t len) \
-{ \
- return XXH3_hashLong_128b_internal( \
- input, len, XXH3_kSecret, sizeof(XXH3_kSecret), \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix \
- ); \
-} \
- \
-/* === XXH128 Secret variants === */ \
- \
-XXH_NO_INLINE target XXH128_hash_t \
-XXHL128_secret_##suffix(const void* XXH_RESTRICT input, size_t len, \
- const void* XXH_RESTRICT secret, size_t secretLen) \
-{ \
- return XXH3_hashLong_128b_internal( \
- input, len, (const xxh_u8*)secret, secretLen, \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix); \
-} \
- \
-/* === XXH128 Seeded variants === */ \
- \
-XXH_NO_INLINE target XXH128_hash_t \
-XXHL128_seed_##suffix(const void* XXH_RESTRICT input, size_t len, \
- XXH64_hash_t seed) \
-{ \
- return XXH3_hashLong_128b_withSeed_internal(input, len, seed, \
- XXH3_accumulate_512_##suffix, XXH3_scrambleAcc_##suffix, \
- XXH3_initCustomSecret_##suffix); \
-}
-
-/* End XXH_DEFINE_DISPATCH_FUNCS */
-
-#if XXH_DISPATCH_SCALAR
-XXH_DEFINE_DISPATCH_FUNCS(scalar, /* nothing */)
-#endif
-XXH_DEFINE_DISPATCH_FUNCS(sse2, XXH_TARGET_SSE2)
-#if XXH_DISPATCH_AVX2
-XXH_DEFINE_DISPATCH_FUNCS(avx2, XXH_TARGET_AVX2)
-#endif
-#if XXH_DISPATCH_AVX512
-XXH_DEFINE_DISPATCH_FUNCS(avx512, XXH_TARGET_AVX512)
-#endif
-#undef XXH_DEFINE_DISPATCH_FUNCS
-
-/* ==== Dispatchers ==== */
-
-typedef XXH64_hash_t (*XXH3_dispatchx86_hashLong64_default)(const void* XXH_RESTRICT, size_t);
-
-typedef XXH64_hash_t (*XXH3_dispatchx86_hashLong64_withSeed)(const void* XXH_RESTRICT, size_t, XXH64_hash_t);
-
-typedef XXH64_hash_t (*XXH3_dispatchx86_hashLong64_withSecret)(const void* XXH_RESTRICT, size_t, const void* XXH_RESTRICT, size_t);
-
-typedef XXH_errorcode (*XXH3_dispatchx86_update)(XXH3_state_t*, const void*, size_t);
-
-typedef struct {
- XXH3_dispatchx86_hashLong64_default hashLong64_default;
- XXH3_dispatchx86_hashLong64_withSeed hashLong64_seed;
- XXH3_dispatchx86_hashLong64_withSecret hashLong64_secret;
- XXH3_dispatchx86_update update;
-} XXH_dispatchFunctions_s;
-
-#define XXH_NB_DISPATCHES 4
-
-/*!
- * @internal
- * @brief Table of dispatchers for @ref XXH3_64bits().
- *
- * @pre The indices must match @ref XXH_VECTOR_TYPE.
- */
-static const XXH_dispatchFunctions_s XXH_kDispatch[XXH_NB_DISPATCHES] = {
-#if XXH_DISPATCH_SCALAR
- /* Scalar */ { XXHL64_default_scalar, XXHL64_seed_scalar, XXHL64_secret_scalar, XXH3_update_scalar },
-#else
- /* Scalar */ { NULL, NULL, NULL, NULL },
-#endif
- /* SSE2 */ { XXHL64_default_sse2, XXHL64_seed_sse2, XXHL64_secret_sse2, XXH3_update_sse2 },
-#if XXH_DISPATCH_AVX2
- /* AVX2 */ { XXHL64_default_avx2, XXHL64_seed_avx2, XXHL64_secret_avx2, XXH3_update_avx2 },
-#else
- /* AVX2 */ { NULL, NULL, NULL, NULL },
-#endif
-#if XXH_DISPATCH_AVX512
- /* AVX512 */ { XXHL64_default_avx512, XXHL64_seed_avx512, XXHL64_secret_avx512, XXH3_update_avx512 }
-#else
- /* AVX512 */ { NULL, NULL, NULL, NULL }
-#endif
-};
-/*!
- * @internal
- * @brief The selected dispatch table for @ref XXH3_64bits().
- */
-static XXH_dispatchFunctions_s XXH_g_dispatch = { NULL, NULL, NULL, NULL };
-
-
-typedef XXH128_hash_t (*XXH3_dispatchx86_hashLong128_default)(const void* XXH_RESTRICT, size_t);
-
-typedef XXH128_hash_t (*XXH3_dispatchx86_hashLong128_withSeed)(const void* XXH_RESTRICT, size_t, XXH64_hash_t);
-
-typedef XXH128_hash_t (*XXH3_dispatchx86_hashLong128_withSecret)(const void* XXH_RESTRICT, size_t, const void* XXH_RESTRICT, size_t);
-
-typedef struct {
- XXH3_dispatchx86_hashLong128_default hashLong128_default;
- XXH3_dispatchx86_hashLong128_withSeed hashLong128_seed;
- XXH3_dispatchx86_hashLong128_withSecret hashLong128_secret;
- XXH3_dispatchx86_update update;
-} XXH_dispatch128Functions_s;
-
-
-/*!
- * @internal
- * @brief Table of dispatchers for @ref XXH3_128bits().
- *
- * @pre The indices must match @ref XXH_VECTOR_TYPE.
- */
-static const XXH_dispatch128Functions_s XXH_kDispatch128[XXH_NB_DISPATCHES] = {
-#if XXH_DISPATCH_SCALAR
- /* Scalar */ { XXHL128_default_scalar, XXHL128_seed_scalar, XXHL128_secret_scalar, XXH3_update_scalar },
-#else
- /* Scalar */ { NULL, NULL, NULL, NULL },
-#endif
- /* SSE2 */ { XXHL128_default_sse2, XXHL128_seed_sse2, XXHL128_secret_sse2, XXH3_update_sse2 },
-#if XXH_DISPATCH_AVX2
- /* AVX2 */ { XXHL128_default_avx2, XXHL128_seed_avx2, XXHL128_secret_avx2, XXH3_update_avx2 },
-#else
- /* AVX2 */ { NULL, NULL, NULL, NULL },
-#endif
-#if XXH_DISPATCH_AVX512
- /* AVX512 */ { XXHL128_default_avx512, XXHL128_seed_avx512, XXHL128_secret_avx512, XXH3_update_avx512 }
-#else
- /* AVX512 */ { NULL, NULL, NULL, NULL }
-#endif
-};
-
-/*!
- * @internal
- * @brief The selected dispatch table for @ref XXH3_64bits().
- */
-static XXH_dispatch128Functions_s XXH_g_dispatch128 = { NULL, NULL, NULL, NULL };
-
-/*!
- * @internal
- * @brief Runs a CPUID check and sets the correct dispatch tables.
- */
-static void XXH_setDispatch(void)
-{
- int vecID = XXH_featureTest();
- XXH_STATIC_ASSERT(XXH_AVX512 == XXH_NB_DISPATCHES-1);
- assert(XXH_SCALAR <= vecID && vecID <= XXH_AVX512);
-#if !XXH_DISPATCH_SCALAR
- assert(vecID != XXH_SCALAR);
-#endif
-#if !XXH_DISPATCH_AVX512
- assert(vecID != XXH_AVX512);
-#endif
-#if !XXH_DISPATCH_AVX2
- assert(vecID != XXH_AVX2);
-#endif
- XXH_g_dispatch = XXH_kDispatch[vecID];
- XXH_g_dispatch128 = XXH_kDispatch128[vecID];
-}
-
-
-/* ==== XXH3 public functions ==== */
-
-static XXH64_hash_t
-XXH3_hashLong_64b_defaultSecret_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
-{
- (void)seed64; (void)secret; (void)secretLen;
- if (XXH_g_dispatch.hashLong64_default == NULL) XXH_setDispatch();
- return XXH_g_dispatch.hashLong64_default(input, len);
-}
-
-XXH64_hash_t XXH3_64bits_dispatch(const void* input, size_t len)
-{
- return XXH3_64bits_internal(input, len, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_defaultSecret_selection);
-}
-
-static XXH64_hash_t
-XXH3_hashLong_64b_withSeed_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
-{
- (void)secret; (void)secretLen;
- if (XXH_g_dispatch.hashLong64_seed == NULL) XXH_setDispatch();
- return XXH_g_dispatch.hashLong64_seed(input, len, seed64);
-}
-
-XXH64_hash_t XXH3_64bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed)
-{
- return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed_selection);
-}
-
-static XXH64_hash_t
-XXH3_hashLong_64b_withSecret_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const xxh_u8* secret, size_t secretLen)
-{
- (void)seed64;
- if (XXH_g_dispatch.hashLong64_secret == NULL) XXH_setDispatch();
- return XXH_g_dispatch.hashLong64_secret(input, len, secret, secretLen);
-}
-
-XXH64_hash_t XXH3_64bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen)
-{
- return XXH3_64bits_internal(input, len, 0, secret, secretLen, XXH3_hashLong_64b_withSecret_selection);
-}
-
-XXH_errorcode
-XXH3_64bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len)
-{
- if (XXH_g_dispatch.update == NULL) XXH_setDispatch();
- return XXH_g_dispatch.update(state, (const xxh_u8*)input, len);
-}
-
-
-/* ==== XXH128 public functions ==== */
-
-static XXH128_hash_t
-XXH3_hashLong_128b_defaultSecret_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const void* secret, size_t secretLen)
-{
- (void)seed64; (void)secret; (void)secretLen;
- if (XXH_g_dispatch128.hashLong128_default == NULL) XXH_setDispatch();
- return XXH_g_dispatch128.hashLong128_default(input, len);
-}
-
-XXH128_hash_t XXH3_128bits_dispatch(const void* input, size_t len)
-{
- return XXH3_128bits_internal(input, len, 0, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_128b_defaultSecret_selection);
-}
-
-static XXH128_hash_t
-XXH3_hashLong_128b_withSeed_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const void* secret, size_t secretLen)
-{
- (void)secret; (void)secretLen;
- if (XXH_g_dispatch128.hashLong128_seed == NULL) XXH_setDispatch();
- return XXH_g_dispatch128.hashLong128_seed(input, len, seed64);
-}
-
-XXH128_hash_t XXH3_128bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed)
-{
- return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_128b_withSeed_selection);
-}
-
-static XXH128_hash_t
-XXH3_hashLong_128b_withSecret_selection(const void* input, size_t len,
- XXH64_hash_t seed64, const void* secret, size_t secretLen)
-{
- (void)seed64;
- if (XXH_g_dispatch128.hashLong128_secret == NULL) XXH_setDispatch();
- return XXH_g_dispatch128.hashLong128_secret(input, len, secret, secretLen);
-}
-
-XXH128_hash_t XXH3_128bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen)
-{
- return XXH3_128bits_internal(input, len, 0, secret, secretLen, XXH3_hashLong_128b_withSecret_selection);
-}
-
-XXH_errorcode
-XXH3_128bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len)
-{
- if (XXH_g_dispatch128.update == NULL) XXH_setDispatch();
- return XXH_g_dispatch128.update(state, (const xxh_u8*)input, len);
-}
-
-#if defined (__cplusplus)
-}
-#endif
-/*! @} */
diff --git a/grpc/third_party/xxhash/xxh_x86dispatch.h b/grpc/third_party/xxhash/xxh_x86dispatch.h
deleted file mode 100644
index 6bc17bcb..00000000
--- a/grpc/third_party/xxhash/xxh_x86dispatch.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * xxHash - XXH3 Dispatcher for x86-based targets
- * Copyright (C) 2020 Yann Collet
- *
- * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-#ifndef XXH_X86DISPATCH_H_13563687684
-#define XXH_X86DISPATCH_H_13563687684
-
-#include "xxhash.h" /* XXH64_hash_t, XXH3_state_t */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_dispatch(const void* input, size_t len);
-XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed);
-XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen);
-XXH_PUBLIC_API XXH_errorcode XXH3_64bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len);
-
-XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_dispatch(const void* input, size_t len);
-XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSeed_dispatch(const void* input, size_t len, XXH64_hash_t seed);
-XXH_PUBLIC_API XXH128_hash_t XXH3_128bits_withSecret_dispatch(const void* input, size_t len, const void* secret, size_t secretLen);
-XXH_PUBLIC_API XXH_errorcode XXH3_128bits_update_dispatch(XXH3_state_t* state, const void* input, size_t len);
-
-#if defined (__cplusplus)
-}
-#endif
-
-
-/* automatic replacement of XXH3 functions.
- * can be disabled by setting XXH_DISPATCH_DISABLE_REPLACE */
-#ifndef XXH_DISPATCH_DISABLE_REPLACE
-
-# undef XXH3_64bits
-# define XXH3_64bits XXH3_64bits_dispatch
-# undef XXH3_64bits_withSeed
-# define XXH3_64bits_withSeed XXH3_64bits_withSeed_dispatch
-# undef XXH3_64bits_withSecret
-# define XXH3_64bits_withSecret XXH3_64bits_withSecret_dispatch
-# undef XXH3_64bits_update
-# define XXH3_64bits_update XXH3_64bits_update_dispatch
-
-# undef XXH128
-# define XXH128 XXH3_128bits_withSeed_dispatch
-# define XXH3_128bits XXH3_128bits_dispatch
-# undef XXH3_128bits
-# define XXH3_128bits XXH3_128bits_dispatch
-# undef XXH3_128bits_withSeed
-# define XXH3_128bits_withSeed XXH3_128bits_withSeed_dispatch
-# undef XXH3_128bits_withSecret
-# define XXH3_128bits_withSecret XXH3_128bits_withSecret_dispatch
-# undef XXH3_128bits_update
-# define XXH3_128bits_update XXH3_128bits_update_dispatch
-
-#endif /* XXH_DISPATCH_DISABLE_REPLACE */
-
-#endif /* XXH_X86DISPATCH_H_13563687684 */
diff --git a/grpc/third_party/xxhash/xxhash.c b/grpc/third_party/xxhash/xxhash.c
deleted file mode 100644
index 0fae88c5..00000000
--- a/grpc/third_party/xxhash/xxhash.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * xxHash - Extremely Fast Hash algorithm
- * Copyright (C) 2012-2020 Yann Collet
- *
- * BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-
-/*
- * xxhash.c instantiates functions defined in xxhash.h
- */
-
-#define XXH_STATIC_LINKING_ONLY /* access advanced declarations */
-#define XXH_IMPLEMENTATION /* access definitions */
-
-#include "xxhash.h"
diff --git a/grpc/third_party/xxhash/xxhash.h b/grpc/third_party/xxhash/xxhash.h
index 29c44e45..08ab7945 100644
--- a/grpc/third_party/xxhash/xxhash.h
+++ b/grpc/third_party/xxhash/xxhash.h
@@ -121,29 +121,80 @@ extern "C" {
/*
* This part deals with the special case where a unit wants to inline xxHash,
- * but "xxhash.h" has previously been included without XXH_INLINE_ALL, such
- * as part of some previously included *.h header file.
+ * but "xxhash.h" has previously been included without XXH_INLINE_ALL,
+ * such as part of some previously included *.h header file.
* Without further action, the new include would just be ignored,
* and functions would effectively _not_ be inlined (silent failure).
* The following macros solve this situation by prefixing all inlined names,
* avoiding naming collision with previous inclusions.
*/
-# ifdef XXH_NAMESPACE
-# error "XXH_INLINE_ALL with XXH_NAMESPACE is not supported"
- /*
- * Note: Alternative: #undef all symbols (it's a pretty large list).
- * Without #error: it compiles, but functions are actually not inlined.
- */
-# endif
+ /* Before that, we unconditionally #undef all symbols,
+ * in case they were already defined with XXH_NAMESPACE.
+ * They will then be redefined for XXH_INLINE_ALL
+ */
+# undef XXH_versionNumber
+ /* XXH32 */
+# undef XXH32
+# undef XXH32_createState
+# undef XXH32_freeState
+# undef XXH32_reset
+# undef XXH32_update
+# undef XXH32_digest
+# undef XXH32_copyState
+# undef XXH32_canonicalFromHash
+# undef XXH32_hashFromCanonical
+ /* XXH64 */
+# undef XXH64
+# undef XXH64_createState
+# undef XXH64_freeState
+# undef XXH64_reset
+# undef XXH64_update
+# undef XXH64_digest
+# undef XXH64_copyState
+# undef XXH64_canonicalFromHash
+# undef XXH64_hashFromCanonical
+ /* XXH3_64bits */
+# undef XXH3_64bits
+# undef XXH3_64bits_withSecret
+# undef XXH3_64bits_withSeed
+# undef XXH3_64bits_withSecretandSeed
+# undef XXH3_createState
+# undef XXH3_freeState
+# undef XXH3_copyState
+# undef XXH3_64bits_reset
+# undef XXH3_64bits_reset_withSeed
+# undef XXH3_64bits_reset_withSecret
+# undef XXH3_64bits_update
+# undef XXH3_64bits_digest
+# undef XXH3_generateSecret
+ /* XXH3_128bits */
+# undef XXH128
+# undef XXH3_128bits
+# undef XXH3_128bits_withSeed
+# undef XXH3_128bits_withSecret
+# undef XXH3_128bits_reset
+# undef XXH3_128bits_reset_withSeed
+# undef XXH3_128bits_reset_withSecret
+# undef XXH3_128bits_reset_withSecretandSeed
+# undef XXH3_128bits_update
+# undef XXH3_128bits_digest
+# undef XXH128_isEqual
+# undef XXH128_cmp
+# undef XXH128_canonicalFromHash
+# undef XXH128_hashFromCanonical
+ /* Finally, free the namespace itself */
+# undef XXH_NAMESPACE
+
+ /* employ the namespace for XXH_INLINE_ALL */
# define XXH_NAMESPACE XXH_INLINE_
/*
- * Some identifiers (enums, type names) are not symbols, but they must
- * still be renamed to avoid redeclaration.
+ * Some identifiers (enums, type names) are not symbols,
+ * but they must nonetheless be renamed to avoid redeclaration.
* Alternative solution: do not redeclare them.
- * However, this requires some #ifdefs, and is a more dispersed action.
- * Meanwhile, renaming can be achieved in a single block
+ * However, this requires some #ifdefs, and has a more dispersed impact.
+ * Meanwhile, renaming can be achieved in a single place.
*/
-# define XXH_IPREF(Id) XXH_INLINE_ ## Id
+# define XXH_IPREF(Id) XXH_NAMESPACE ## Id
# define XXH_OK XXH_IPREF(XXH_OK)
# define XXH_ERROR XXH_IPREF(XXH_ERROR)
# define XXH_errorcode XXH_IPREF(XXH_errorcode)
@@ -235,23 +286,28 @@ extern "C" {
# define XXH3_64bits XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)
# define XXH3_64bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret)
# define XXH3_64bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)
+# define XXH3_64bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecretandSeed)
# define XXH3_createState XXH_NAME2(XXH_NAMESPACE, XXH3_createState)
# define XXH3_freeState XXH_NAME2(XXH_NAMESPACE, XXH3_freeState)
# define XXH3_copyState XXH_NAME2(XXH_NAMESPACE, XXH3_copyState)
# define XXH3_64bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset)
# define XXH3_64bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed)
# define XXH3_64bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret)
+# define XXH3_64bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecretandSeed)
# define XXH3_64bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update)
# define XXH3_64bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest)
# define XXH3_generateSecret XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret)
+# define XXH3_generateSecret_fromSeed XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret_fromSeed)
/* XXH3_128bits */
# define XXH128 XXH_NAME2(XXH_NAMESPACE, XXH128)
# define XXH3_128bits XXH_NAME2(XXH_NAMESPACE, XXH3_128bits)
# define XXH3_128bits_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed)
# define XXH3_128bits_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret)
+# define XXH3_128bits_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecretandSeed)
# define XXH3_128bits_reset XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset)
# define XXH3_128bits_reset_withSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed)
# define XXH3_128bits_reset_withSecret XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret)
+# define XXH3_128bits_reset_withSecretandSeed XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecretandSeed)
# define XXH3_128bits_update XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update)
# define XXH3_128bits_digest XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest)
# define XXH128_isEqual XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual)
@@ -266,22 +322,22 @@ extern "C" {
***************************************/
#define XXH_VERSION_MAJOR 0
#define XXH_VERSION_MINOR 8
-#define XXH_VERSION_RELEASE 0
+#define XXH_VERSION_RELEASE 1
#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
/*!
* @brief Obtains the xxHash version.
*
- * This is only useful when xxHash is compiled as a shared library, as it is
- * independent of the version defined in the header.
+ * This is mostly useful when xxHash is compiled as a shared library,
+ * since the returned value comes from the library, as opposed to header file.
*
- * @return `XXH_VERSION_NUMBER` as of when the function was compiled.
+ * @return `XXH_VERSION_NUMBER` of the invoked library.
*/
XXH_PUBLIC_API unsigned XXH_versionNumber (void);
/* ****************************
-* Definitions
+* Common basic types
******************************/
#include <stddef.h> /* size_t */
typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
@@ -297,11 +353,13 @@ typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
* Not necessarily defined to `uint32_t` but functionally equivalent.
*/
typedef uint32_t XXH32_hash_t;
+
#elif !defined (__VMS) \
&& (defined (__cplusplus) \
|| (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) )
# include <stdint.h>
typedef uint32_t XXH32_hash_t;
+
#else
# include <limits.h>
# if UINT_MAX == 0xFFFFFFFFUL
@@ -323,10 +381,9 @@ typedef uint32_t XXH32_hash_t;
* Contains functions used in the classic 32-bit xxHash algorithm.
*
* @note
- * XXH32 is considered rather weak by today's standards.
- * The @ref xxh3_family provides competitive speed for both 32-bit and 64-bit
- * systems, and offers true 64/128 bit hash results. It provides a superior
- * level of dispersion, and greatly reduces the risks of collisions.
+ * XXH32 is useful for older platforms, with no or poor 64-bit performance.
+ * Note that @ref xxh3_family provides competitive speed
+ * for both 32-bit and 64-bit systems, and offers true 64/128 bit hash results.
*
* @see @ref xxh64_family, @ref xxh3_family : Other xxHash families
* @see @ref xxh32_impl for implementation details
@@ -543,6 +600,41 @@ XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t
XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);
+#ifdef __has_attribute
+# define XXH_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+# define XXH_HAS_ATTRIBUTE(x) 0
+#endif
+
+/* C-language Attributes are added in C23. */
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201710L) && defined(__has_c_attribute)
+# define XXH_HAS_C_ATTRIBUTE(x) __has_c_attribute(x)
+#else
+# define XXH_HAS_C_ATTRIBUTE(x) 0
+#endif
+
+#if defined(__cplusplus) && defined(__has_cpp_attribute)
+# define XXH_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
+#else
+# define XXH_HAS_CPP_ATTRIBUTE(x) 0
+#endif
+
+/*
+Define XXH_FALLTHROUGH macro for annotating switch case with the 'fallthrough' attribute
+introduced in CPP17 and C23.
+CPP17 : https://en.cppreference.com/w/cpp/language/attributes/fallthrough
+C23 : https://en.cppreference.com/w/c/language/attributes/fallthrough
+*/
+#if XXH_HAS_C_ATTRIBUTE(x)
+# define XXH_FALLTHROUGH [[fallthrough]]
+#elif XXH_HAS_CPP_ATTRIBUTE(x)
+# define XXH_FALLTHROUGH [[fallthrough]]
+#elif XXH_HAS_ATTRIBUTE(__fallthrough__)
+# define XXH_FALLTHROUGH __attribute__ ((fallthrough))
+#else
+# define XXH_FALLTHROUGH
+#endif
+
/*!
* @}
* @ingroup public
@@ -586,8 +678,8 @@ typedef uint64_t XXH64_hash_t;
*
* @note
* XXH3 provides competitive speed for both 32-bit and 64-bit systems,
- * and offers true 64/128 bit hash results. It provides a superior level of
- * dispersion, and greatly reduces the risks of collisions.
+ * and offers true 64/128 bit hash results.
+ * It provides better speed for systems with vector processing capabilities.
*/
@@ -713,13 +805,17 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSeed(const void* data, size_t len, X
* It's possible to provide any blob of bytes as a "secret" to generate the hash.
* This makes it more difficult for an external actor to prepare an intentional collision.
* The main condition is that secretSize *must* be large enough (>= XXH3_SECRET_SIZE_MIN).
- * However, the quality of produced hash values depends on secret's entropy.
- * Technically, the secret must look like a bunch of random bytes.
+ * However, the quality of the secret impacts the dispersion of the hash algorithm.
+ * Therefore, the secret _must_ look like a bunch of random bytes.
* Avoid "trivial" or structured data such as repeated sequences or a text document.
- * Whenever unsure about the "randomness" of the blob of bytes,
- * consider relabelling it as a "custom seed" instead,
- * and employ "XXH3_generateSecret()" (see below)
- * to generate a high entropy secret derived from the custom seed.
+ * Whenever in doubt about the "randomness" of the blob of bytes,
+ * consider employing "XXH3_generateSecret()" instead (see below).
+ * It will generate a proper high entropy secret derived from the blob of bytes.
+ * Another advantage of using XXH3_generateSecret() is that
+ * it guarantees that all bits within the initial blob of bytes
+ * will impact every bit of the output.
+ * This is not necessarily the case when using the blob of bytes directly
+ * because, when hashing _small_ inputs, only a portion of the secret is employed.
*/
XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_withSecret(const void* data, size_t len, const void* secret, size_t secretSize);
@@ -879,10 +975,7 @@ XXH_PUBLIC_API XXH128_hash_t XXH128_hashFromCanonical(const XXH128_canonical_t*
struct XXH32_state_s {
XXH32_hash_t total_len_32; /*!< Total length hashed, modulo 2^32 */
XXH32_hash_t large_len; /*!< Whether the hash is >= 16 (handles @ref total_len_32 overflow) */
- XXH32_hash_t v1; /*!< First accumulator lane */
- XXH32_hash_t v2; /*!< Second accumulator lane */
- XXH32_hash_t v3; /*!< Third accumulator lane */
- XXH32_hash_t v4; /*!< Fourth accumulator lane */
+ XXH32_hash_t v[4]; /*!< Accumulator lanes */
XXH32_hash_t mem32[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[16]. */
XXH32_hash_t memsize; /*!< Amount of data in @ref mem32 */
XXH32_hash_t reserved; /*!< Reserved field. Do not read or write to it, it may be removed. */
@@ -905,19 +998,19 @@ struct XXH32_state_s {
*/
struct XXH64_state_s {
XXH64_hash_t total_len; /*!< Total length hashed. This is always 64-bit. */
- XXH64_hash_t v1; /*!< First accumulator lane */
- XXH64_hash_t v2; /*!< Second accumulator lane */
- XXH64_hash_t v3; /*!< Third accumulator lane */
- XXH64_hash_t v4; /*!< Fourth accumulator lane */
+ XXH64_hash_t v[4]; /*!< Accumulator lanes */
XXH64_hash_t mem64[4]; /*!< Internal buffer for partial reads. Treated as unsigned char[32]. */
XXH32_hash_t memsize; /*!< Amount of data in @ref mem64 */
XXH32_hash_t reserved32; /*!< Reserved field, needed for padding anyways*/
XXH64_hash_t reserved64; /*!< Reserved field. Do not read or write to it, it may be removed. */
}; /* typedef'd to XXH64_state_t */
-#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11+ */
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */
# include <stdalign.h>
# define XXH_ALIGN(n) alignas(n)
+#elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */
+/* In C++ alignas() is a keyword */
+# define XXH_ALIGN(n) alignas(n)
#elif defined(__GNUC__)
# define XXH_ALIGN(n) __attribute__ ((aligned(n)))
#elif defined(_MSC_VER)
@@ -928,6 +1021,7 @@ struct XXH64_state_s {
/* Old GCC versions only accept the attribute after the type in structures. */
#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) /* C11+ */ \
+ && ! (defined(__cplusplus) && (__cplusplus >= 201103L)) /* >= C++11 */ \
&& defined(__GNUC__)
# define XXH_ALIGN_MEMBER(align, type) type XXH_ALIGN(align)
#else
@@ -957,16 +1051,18 @@ struct XXH64_state_s {
* @brief Structure for XXH3 streaming API.
*
* @note This is only defined when @ref XXH_STATIC_LINKING_ONLY,
- * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined. Otherwise it is
- * an opaque type. This allows fields to safely be changed.
+ * @ref XXH_INLINE_ALL, or @ref XXH_IMPLEMENTATION is defined.
+ * Otherwise it is an opaque type.
+ * Never use this definition in combination with dynamic library.
+ * This allows fields to safely be changed in the future.
*
- * @note **This structure has a strict alignment requirement of 64 bytes.** Do
- * not allocate this with `malloc()` or `new`, it will not be sufficiently
- * aligned. Use @ref XXH3_createState() and @ref XXH3_freeState(), or stack
- * allocation.
+ * @note ** This structure has a strict alignment requirement of 64 bytes!! **
+ * Do not allocate this with `malloc()` or `new`,
+ * it will not be sufficiently aligned.
+ * Use @ref XXH3_createState() and @ref XXH3_freeState(), or stack allocation.
*
* Typedef'd to @ref XXH3_state_t.
- * Do not access the members of this struct directly.
+ * Do never access the members of this struct directly.
*
* @see XXH3_INITSTATE() for stack initialization.
* @see XXH3_createState(), XXH3_freeState().
@@ -981,7 +1077,7 @@ struct XXH3_state_s {
/*!< The internal buffer. @see XXH32_state_s::mem32 */
XXH32_hash_t bufferedSize;
/*!< The amount of memory in @ref buffer, @see XXH32_state_s::memsize */
- XXH32_hash_t reserved32;
+ XXH32_hash_t useSeed;
/*!< Reserved field. Needed for padding on 64-bit. */
size_t nbStripesSoFar;
/*!< Number or stripes processed. */
@@ -1017,6 +1113,12 @@ struct XXH3_state_s {
#define XXH3_INITSTATE(XXH3_state_ptr) { (XXH3_state_ptr)->seed = 0; }
+/* XXH128() :
+ * simple alias to pre-selected XXH3_128bits variant
+ */
+XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed);
+
+
/* === Experimental API === */
/* Symbols defined below must be considered tied to a specific library version. */
@@ -1029,31 +1131,89 @@ struct XXH3_state_s {
* as it becomes much more difficult for an external actor to guess how to impact the calculation logic.
*
* The function accepts as input a custom seed of any length and any content,
- * and derives from it a high-entropy secret of length XXH3_SECRET_DEFAULT_SIZE
- * into an already allocated buffer secretBuffer.
- * The generated secret is _always_ XXH_SECRET_DEFAULT_SIZE bytes long.
+ * and derives from it a high-entropy secret of length @secretSize
+ * into an already allocated buffer @secretBuffer.
+ * @secretSize must be >= XXH3_SECRET_SIZE_MIN
*
* The generated secret can then be used with any `*_withSecret()` variant.
* Functions `XXH3_128bits_withSecret()`, `XXH3_64bits_withSecret()`,
* `XXH3_128bits_reset_withSecret()` and `XXH3_64bits_reset_withSecret()`
* are part of this list. They all accept a `secret` parameter
- * which must be very long for implementation reasons (>= XXH3_SECRET_SIZE_MIN)
+ * which must be large enough for implementation reasons (>= XXH3_SECRET_SIZE_MIN)
* _and_ feature very high entropy (consist of random-looking bytes).
* These conditions can be a high bar to meet, so
- * this function can be used to generate a secret of proper quality.
+ * XXH3_generateSecret() can be employed to ensure proper quality.
*
* customSeed can be anything. It can have any size, even small ones,
- * and its content can be anything, even stupidly "low entropy" source such as a bunch of zeroes.
- * The resulting `secret` will nonetheless provide all expected qualities.
+ * and its content can be anything, even "poor entropy" sources such as a bunch of zeroes.
+ * The resulting `secret` will nonetheless provide all required qualities.
*
- * Supplying NULL as the customSeed copies the default secret into `secretBuffer`.
* When customSeedSize > 0, supplying NULL as customSeed is undefined behavior.
*/
-XXH_PUBLIC_API void XXH3_generateSecret(void* secretBuffer, const void* customSeed, size_t customSeedSize);
+XXH_PUBLIC_API XXH_errorcode XXH3_generateSecret(void* secretBuffer, size_t secretSize, const void* customSeed, size_t customSeedSize);
-/* simple short-cut to pre-selected XXH3_128bits variant */
-XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t seed);
+/*
+ * XXH3_generateSecret_fromSeed():
+ *
+ * Generate the same secret as the _withSeed() variants.
+ *
+ * The resulting secret has a length of XXH3_SECRET_DEFAULT_SIZE (necessarily).
+ * @secretBuffer must be already allocated, of size at least XXH3_SECRET_DEFAULT_SIZE bytes.
+ *
+ * The generated secret can be used in combination with
+ *`*_withSecret()` and `_withSecretandSeed()` variants.
+ * This generator is notably useful in combination with `_withSecretandSeed()`,
+ * as a way to emulate a faster `_withSeed()` variant.
+ */
+XXH_PUBLIC_API void XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed);
+
+/*
+ * *_withSecretandSeed() :
+ * These variants generate hash values using either
+ * @seed for "short" keys (< XXH3_MIDSIZE_MAX = 240 bytes)
+ * or @secret for "large" keys (>= XXH3_MIDSIZE_MAX).
+ *
+ * This generally benefits speed, compared to `_withSeed()` or `_withSecret()`.
+ * `_withSeed()` has to generate the secret on the fly for "large" keys.
+ * It's fast, but can be perceptible for "not so large" keys (< 1 KB).
+ * `_withSecret()` has to generate the masks on the fly for "small" keys,
+ * which requires more instructions than _withSeed() variants.
+ * Therefore, _withSecretandSeed variant combines the best of both worlds.
+ *
+ * When @secret has been generated by XXH3_generateSecret_fromSeed(),
+ * this variant produces *exactly* the same results as `_withSeed()` variant,
+ * hence offering only a pure speed benefit on "large" input,
+ * by skipping the need to regenerate the secret for every large input.
+ *
+ * Another usage scenario is to hash the secret to a 64-bit hash value,
+ * for example with XXH3_64bits(), which then becomes the seed,
+ * and then employ both the seed and the secret in _withSecretandSeed().
+ * On top of speed, an added benefit is that each bit in the secret
+ * has a 50% chance to swap each bit in the output,
+ * via its impact to the seed.
+ * This is not guaranteed when using the secret directly in "small data" scenarios,
+ * because only portions of the secret are employed for small data.
+ */
+XXH_PUBLIC_API XXH64_hash_t
+XXH3_64bits_withSecretandSeed(const void* data, size_t len,
+ const void* secret, size_t secretSize,
+ XXH64_hash_t seed);
+
+XXH_PUBLIC_API XXH128_hash_t
+XXH3_128bits_withSecretandSeed(const void* data, size_t len,
+ const void* secret, size_t secretSize,
+ XXH64_hash_t seed64);
+
+XXH_PUBLIC_API XXH_errorcode
+XXH3_64bits_reset_withSecretandSeed(XXH3_state_t* statePtr,
+ const void* secret, size_t secretSize,
+ XXH64_hash_t seed64);
+
+XXH_PUBLIC_API XXH_errorcode
+XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr,
+ const void* secret, size_t secretSize,
+ XXH64_hash_t seed64);
#endif /* XXH_NO_LONG_LONG */
@@ -1159,22 +1319,12 @@ XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t s
* care, as what works on one compiler/platform/optimization level may cause
* another to read garbage data or even crash.
*
- * See https://stackoverflow.com/a/32095106/646947 for details.
+ * See http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html for details.
*
* Prefer these methods in priority order (0 > 3 > 1 > 2)
*/
# define XXH_FORCE_MEMORY_ACCESS 0
-/*!
- * @def XXH_ACCEPT_NULL_INPUT_POINTER
- * @brief Whether to add explicit `NULL` checks.
- *
- * If the input pointer is `NULL` and the length is non-zero, xxHash's default
- * behavior is to dereference it, triggering a segfault.
- *
- * When this macro is enabled, xxHash actively checks the input for a null pointer.
- * If it is, the result for null input pointers is the same as a zero-length input.
- */
-# define XXH_ACCEPT_NULL_INPUT_POINTER 0
+
/*!
* @def XXH_FORCE_ALIGN_CHECK
* @brief If defined to non-zero, adds a special path for aligned inputs (XXH32()
@@ -1226,18 +1376,16 @@ XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t s
# define XXH_NO_INLINE_HINTS 0
/*!
- * @def XXH_REROLL
- * @brief Whether to reroll `XXH32_finalize` and `XXH64_finalize`.
- *
- * For performance, `XXH32_finalize` and `XXH64_finalize` use an unrolled loop
- * in the form of a switch statement.
+ * @def XXH32_ENDJMP
+ * @brief Whether to use a jump for `XXH32_finalize`.
*
- * This is not always desirable, as it generates larger code, and depending on
- * the architecture, may even be slower
+ * For performance, `XXH32_finalize` uses multiple branches in the finalizer.
+ * This is generally preferable for performance,
+ * but depending on exact architecture, a jmp may be preferable.
*
- * This is automatically defined with `-Os`/`-Oz` on GCC and Clang.
+ * This setting is only possibly making a difference for very small inputs.
*/
-# define XXH_REROLL 0
+# define XXH32_ENDJMP 0
/*!
* @internal
@@ -1254,18 +1402,25 @@ XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t s
*/
#ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */
- /* prefer __packed__ structures (method 1) for gcc on armv7 and armv8 */
-# if !defined(__clang__) && ( \
+ /* prefer __packed__ structures (method 1) for gcc on armv7+ and mips */
+# if !defined(__clang__) && \
+( \
(defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
- (defined(__GNUC__) && (defined(__ARM_ARCH) && __ARM_ARCH >= 7)) )
+ ( \
+ defined(__GNUC__) && ( \
+ (defined(__ARM_ARCH) && __ARM_ARCH >= 7) || \
+ ( \
+ defined(__mips__) && \
+ (__mips <= 5 || __mips_isa_rev < 6) && \
+ (!defined(__mips16) || defined(__mips_mips16e2)) \
+ ) \
+ ) \
+ ) \
+)
# define XXH_FORCE_MEMORY_ACCESS 1
# endif
#endif
-#ifndef XXH_ACCEPT_NULL_INPUT_POINTER /* can be defined externally */
-# define XXH_ACCEPT_NULL_INPUT_POINTER 0
-#endif
-
#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */
# if defined(__i386) || defined(__x86_64__) || defined(__aarch64__) \
|| defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) /* visual */
@@ -1284,12 +1439,9 @@ XXH_PUBLIC_API XXH128_hash_t XXH128(const void* data, size_t len, XXH64_hash_t s
# endif
#endif
-#ifndef XXH_REROLL
-# if defined(__OPTIMIZE_SIZE__)
-# define XXH_REROLL 1
-# else
-# define XXH_REROLL 0
-# endif
+#ifndef XXH32_ENDJMP
+/* generally preferable for performance */
+# define XXH32_ENDJMP 0
#endif
/*!
@@ -1341,19 +1493,19 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
#endif
#if XXH_NO_INLINE_HINTS /* disable inlining hints */
-# if defined(__GNUC__)
+# if defined(__GNUC__) || defined(__clang__)
# define XXH_FORCE_INLINE static __attribute__((unused))
# else
# define XXH_FORCE_INLINE static
# endif
# define XXH_NO_INLINE static
/* enable inlining hints */
+#elif defined(__GNUC__) || defined(__clang__)
+# define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused))
+# define XXH_NO_INLINE static __attribute__((noinline))
#elif defined(_MSC_VER) /* Visual Studio */
# define XXH_FORCE_INLINE static __forceinline
# define XXH_NO_INLINE static __declspec(noinline)
-#elif defined(__GNUC__)
-# define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused))
-# define XXH_NO_INLINE static __attribute__((noinline))
#elif defined (__cplusplus) \
|| (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* C99 */
# define XXH_FORCE_INLINE static inline
@@ -1392,8 +1544,39 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
#endif
/* note: use after variable declarations */
-#define XXH_STATIC_ASSERT(c) do { enum { XXH_sa = 1/(int)(!!(c)) }; } while (0)
+#ifndef XXH_STATIC_ASSERT
+# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
+# include <assert.h>
+# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
+# elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */
+# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
+# else
+# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { struct xxh_sa { char x[(c) ? 1 : -1]; }; } while(0)
+# endif
+# define XXH_STATIC_ASSERT(c) XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
+#endif
+/*!
+ * @internal
+ * @def XXH_COMPILER_GUARD(var)
+ * @brief Used to prevent unwanted optimizations for @p var.
+ *
+ * It uses an empty GCC inline assembly statement with a register constraint
+ * which forces @p var into a general purpose register (eg eax, ebx, ecx
+ * on x86) and marks it as modified.
+ *
+ * This is used in a few places to avoid unwanted autovectorization (e.g.
+ * XXH32_round()). All vectorization we want is explicit via intrinsics,
+ * and _usually_ isn't wanted elsewhere.
+ *
+ * We also use it to prevent unwanted constant folding for AArch64 in
+ * XXH3_initCustomSecret_scalar().
+ */
+#if defined(__GNUC__) || defined(__clang__)
+# define XXH_COMPILER_GUARD(var) __asm__ __volatile__("" : "+r" (var))
+#else
+# define XXH_COMPILER_GUARD(var) ((void)0)
+#endif
/* *************************************
* Basic Types
@@ -1500,12 +1683,12 @@ static xxh_u32 XXH_read32(const void* ptr)
/*
* Portable and safe solution. Generally efficient.
- * see: https://stackoverflow.com/a/32095106/646947
+ * see: http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html
*/
static xxh_u32 XXH_read32(const void* memPtr)
{
xxh_u32 val;
- memcpy(&val, memPtr, sizeof(val));
+ XXH_memcpy(&val, memPtr, sizeof(val));
return val;
}
@@ -1513,7 +1696,6 @@ static xxh_u32 XXH_read32(const void* memPtr)
/* *** Endianness *** */
-typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
/*!
* @ingroup tuning
@@ -1523,8 +1705,8 @@ typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
* Defined to 1 if the target is little endian, or 0 if it is big endian.
* It can be defined externally, for example on the compiler command line.
*
- * If it is not defined, a runtime check (which is usually constant folded)
- * is used instead.
+ * If it is not defined,
+ * a runtime check (which is usually constant folded) is used instead.
*
* @note
* This is not necessarily defined to an integer constant.
@@ -1703,11 +1885,12 @@ XXH_PUBLIC_API unsigned XXH_versionNumber (void) { return XXH_VERSION_NUMBER; }
* @ingroup impl
* @{
*/
-static const xxh_u32 XXH_PRIME32_1 = 0x9E3779B1U; /*!< 0b10011110001101110111100110110001 */
-static const xxh_u32 XXH_PRIME32_2 = 0x85EBCA77U; /*!< 0b10000101111010111100101001110111 */
-static const xxh_u32 XXH_PRIME32_3 = 0xC2B2AE3DU; /*!< 0b11000010101100101010111000111101 */
-static const xxh_u32 XXH_PRIME32_4 = 0x27D4EB2FU; /*!< 0b00100111110101001110101100101111 */
-static const xxh_u32 XXH_PRIME32_5 = 0x165667B1U; /*!< 0b00010110010101100110011110110001 */
+ /* #define instead of static const, to be used as initializers */
+#define XXH_PRIME32_1 0x9E3779B1U /*!< 0b10011110001101110111100110110001 */
+#define XXH_PRIME32_2 0x85EBCA77U /*!< 0b10000101111010111100101001110111 */
+#define XXH_PRIME32_3 0xC2B2AE3DU /*!< 0b11000010101100101010111000111101 */
+#define XXH_PRIME32_4 0x27D4EB2FU /*!< 0b00100111110101001110101100101111 */
+#define XXH_PRIME32_5 0x165667B1U /*!< 0b00010110010101100110011110110001 */
#ifdef XXH_OLD_NAMES
# define PRIME32_1 XXH_PRIME32_1
@@ -1733,13 +1916,12 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input)
acc += input * XXH_PRIME32_2;
acc = XXH_rotl32(acc, 13);
acc *= XXH_PRIME32_1;
-#if defined(__GNUC__) && defined(__SSE4_1__) && !defined(XXH_ENABLE_AUTOVECTORIZE)
+#if (defined(__SSE4_1__) || defined(__aarch64__)) && !defined(XXH_ENABLE_AUTOVECTORIZE)
/*
* UGLY HACK:
- * This inline assembly hack forces acc into a normal register. This is the
- * only thing that prevents GCC and Clang from autovectorizing the XXH32
- * loop (pragmas and attributes don't work for some reason) without globally
- * disabling SSE4.1.
+ * A compiler fence is the only thing that prevents GCC and Clang from
+ * autovectorizing the XXH32 loop (pragmas and attributes don't work for some
+ * reason) without globally disabling SSE4.1.
*
* The reason we want to avoid vectorization is because despite working on
* 4 integers at a time, there are multiple factors slowing XXH32 down on
@@ -1764,22 +1946,11 @@ static xxh_u32 XXH32_round(xxh_u32 acc, xxh_u32 input)
* can load data, while v3 can multiply. SSE forces them to operate
* together.
*
- * How this hack works:
- * __asm__("" // Declare an assembly block but don't declare any instructions
- * : // However, as an Input/Output Operand,
- * "+r" // constrain a read/write operand (+) as a general purpose register (r).
- * (acc) // and set acc as the operand
- * );
- *
- * Because of the 'r', the compiler has promised that seed will be in a
- * general purpose register and the '+' says that it will be 'read/write',
- * so it has to assume it has changed. It is like volatile without all the
- * loads and stores.
- *
- * Since the argument has to be in a normal register (not an SSE register),
- * each time XXH32_round is called, it is impossible to vectorize.
+ * This is also enabled on AArch64, as Clang autovectorizes it incorrectly
+ * and it is pointless writing a NEON implementation that is basically the
+ * same speed as scalar for XXH32.
*/
- __asm__("" : "+r" (acc));
+ XXH_COMPILER_GUARD(acc);
#endif
return acc;
}
@@ -1834,8 +2005,10 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
h32 = XXH_rotl32(h32, 17) * XXH_PRIME32_4; \
} while (0)
- /* Compact rerolled version */
- if (XXH_REROLL) {
+ if (ptr==NULL) XXH_ASSERT(len == 0);
+
+ /* Compact rerolled version; generally faster */
+ if (!XXH32_ENDJMP) {
len &= 15;
while (len >= 4) {
XXH_PROCESS4;
@@ -1849,41 +2022,41 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
} else {
switch(len&15) /* or switch(bEnd - p) */ {
case 12: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 8: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 4: XXH_PROCESS4;
return XXH32_avalanche(h32);
case 13: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 9: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 5: XXH_PROCESS4;
XXH_PROCESS1;
return XXH32_avalanche(h32);
case 14: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 10: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 6: XXH_PROCESS4;
XXH_PROCESS1;
XXH_PROCESS1;
return XXH32_avalanche(h32);
case 15: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 11: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 7: XXH_PROCESS4;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 3: XXH_PROCESS1;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 2: XXH_PROCESS1;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 1: XXH_PROCESS1;
- /* fallthrough */
+ XXH_FALLTHROUGH;
case 0: return XXH32_avalanche(h32);
}
XXH_ASSERT(0);
@@ -1903,24 +2076,19 @@ XXH32_finalize(xxh_u32 h32, const xxh_u8* ptr, size_t len, XXH_alignment align)
* @internal
* @brief The implementation for @ref XXH32().
*
- * @param input, len, seed Directly passed from @ref XXH32().
+ * @param input , len , seed Directly passed from @ref XXH32().
* @param align Whether @p input is aligned.
* @return The calculated hash.
*/
XXH_FORCE_INLINE xxh_u32
XXH32_endian_align(const xxh_u8* input, size_t len, xxh_u32 seed, XXH_alignment align)
{
- const xxh_u8* bEnd = input + len;
xxh_u32 h32;
-#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
- if (input==NULL) {
- len=0;
- bEnd=input=(const xxh_u8*)(size_t)16;
- }
-#endif
+ if (input==NULL) XXH_ASSERT(len == 0);
if (len>=16) {
+ const xxh_u8* const bEnd = input + len;
const xxh_u8* const limit = bEnd - 15;
xxh_u32 v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2;
xxh_u32 v2 = seed + XXH_PRIME32_2;
@@ -1984,7 +2152,7 @@ XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr)
/*! @ingroup xxh32_family */
XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t* srcState)
{
- memcpy(dstState, srcState, sizeof(*dstState));
+ XXH_memcpy(dstState, srcState, sizeof(*dstState));
}
/*! @ingroup xxh32_family */
@@ -1992,12 +2160,12 @@ XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t s
{
XXH32_state_t state; /* using a local state to memcpy() in order to avoid strict-aliasing warnings */
memset(&state, 0, sizeof(state));
- state.v1 = seed + XXH_PRIME32_1 + XXH_PRIME32_2;
- state.v2 = seed + XXH_PRIME32_2;
- state.v3 = seed + 0;
- state.v4 = seed - XXH_PRIME32_1;
+ state.v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2;
+ state.v[1] = seed + XXH_PRIME32_2;
+ state.v[2] = seed + 0;
+ state.v[3] = seed - XXH_PRIME32_1;
/* do not write into reserved, planned to be removed in a future version */
- memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved));
+ XXH_memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved));
return XXH_OK;
}
@@ -2006,12 +2174,10 @@ XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t s
XXH_PUBLIC_API XXH_errorcode
XXH32_update(XXH32_state_t* state, const void* input, size_t len)
{
- if (input==NULL)
-#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
+ if (input==NULL) {
+ XXH_ASSERT(len == 0);
return XXH_OK;
-#else
- return XXH_ERROR;
-#endif
+ }
{ const xxh_u8* p = (const xxh_u8*)input;
const xxh_u8* const bEnd = p + len;
@@ -2028,10 +2194,10 @@ XXH32_update(XXH32_state_t* state, const void* input, size_t len)
if (state->memsize) { /* some data left from previous update */
XXH_memcpy((xxh_u8*)(state->mem32) + state->memsize, input, 16-state->memsize);
{ const xxh_u32* p32 = state->mem32;
- state->v1 = XXH32_round(state->v1, XXH_readLE32(p32)); p32++;
- state->v2 = XXH32_round(state->v2, XXH_readLE32(p32)); p32++;
- state->v3 = XXH32_round(state->v3, XXH_readLE32(p32)); p32++;
- state->v4 = XXH32_round(state->v4, XXH_readLE32(p32));
+ state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p32)); p32++;
+ state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p32)); p32++;
+ state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p32)); p32++;
+ state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p32));
}
p += 16-state->memsize;
state->memsize = 0;
@@ -2039,22 +2205,14 @@ XXH32_update(XXH32_state_t* state, const void* input, size_t len)
if (p <= bEnd-16) {
const xxh_u8* const limit = bEnd - 16;
- xxh_u32 v1 = state->v1;
- xxh_u32 v2 = state->v2;
- xxh_u32 v3 = state->v3;
- xxh_u32 v4 = state->v4;
do {
- v1 = XXH32_round(v1, XXH_readLE32(p)); p+=4;
- v2 = XXH32_round(v2, XXH_readLE32(p)); p+=4;
- v3 = XXH32_round(v3, XXH_readLE32(p)); p+=4;
- v4 = XXH32_round(v4, XXH_readLE32(p)); p+=4;
+ state->v[0] = XXH32_round(state->v[0], XXH_readLE32(p)); p+=4;
+ state->v[1] = XXH32_round(state->v[1], XXH_readLE32(p)); p+=4;
+ state->v[2] = XXH32_round(state->v[2], XXH_readLE32(p)); p+=4;
+ state->v[3] = XXH32_round(state->v[3], XXH_readLE32(p)); p+=4;
} while (p<=limit);
- state->v1 = v1;
- state->v2 = v2;
- state->v3 = v3;
- state->v4 = v4;
}
if (p < bEnd) {
@@ -2073,12 +2231,12 @@ XXH_PUBLIC_API XXH32_hash_t XXH32_digest(const XXH32_state_t* state)
xxh_u32 h32;
if (state->large_len) {
- h32 = XXH_rotl32(state->v1, 1)
- + XXH_rotl32(state->v2, 7)
- + XXH_rotl32(state->v3, 12)
- + XXH_rotl32(state->v4, 18);
+ h32 = XXH_rotl32(state->v[0], 1)
+ + XXH_rotl32(state->v[1], 7)
+ + XXH_rotl32(state->v[2], 12)
+ + XXH_rotl32(state->v[3], 18);
} else {
- h32 = state->v3 /* == seed */ + XXH_PRIME32_5;
+ h32 = state->v[2] /* == seed */ + XXH_PRIME32_5;
}
h32 += state->total_len_32;
@@ -2107,7 +2265,7 @@ XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t
{
XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap32(hash);
- memcpy(dst, &hash, sizeof(*dst));
+ XXH_memcpy(dst, &hash, sizeof(*dst));
}
/*! @ingroup xxh32_family */
XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)
@@ -2134,35 +2292,6 @@ typedef XXH64_hash_t xxh_u64;
# define U64 xxh_u64
#endif
-/*!
- * XXH_REROLL_XXH64:
- * Whether to reroll the XXH64_finalize() loop.
- *
- * Just like XXH32, we can unroll the XXH64_finalize() loop. This can be a
- * performance gain on 64-bit hosts, as only one jump is required.
- *
- * However, on 32-bit hosts, because arithmetic needs to be done with two 32-bit
- * registers, and 64-bit arithmetic needs to be simulated, it isn't beneficial
- * to unroll. The code becomes ridiculously large (the largest function in the
- * binary on i386!), and rerolling it saves anywhere from 3kB to 20kB. It is
- * also slightly faster because it fits into cache better and is more likely
- * to be inlined by the compiler.
- *
- * If XXH_REROLL is defined, this is ignored and the loop is always rerolled.
- */
-#ifndef XXH_REROLL_XXH64
-# if (defined(__ILP32__) || defined(_ILP32)) /* ILP32 is often defined on 32-bit GCC family */ \
- || !(defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) /* x86-64 */ \
- || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm64__) /* aarch64 */ \
- || defined(__PPC64__) || defined(__PPC64LE__) || defined(__ppc64__) || defined(__powerpc64__) /* ppc64 */ \
- || defined(__mips64__) || defined(__mips64)) /* mips64 */ \
- || (!defined(SIZE_MAX) || SIZE_MAX < ULLONG_MAX) /* check limits */
-# define XXH_REROLL_XXH64 1
-# else
-# define XXH_REROLL_XXH64 0
-# endif
-#endif /* !defined(XXH_REROLL_XXH64) */
-
#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==3))
/*
* Manual byteshift. Best for old compilers which don't inline memcpy.
@@ -2197,12 +2326,12 @@ static xxh_u64 XXH_read64(const void* ptr)
/*
* Portable and safe solution. Generally efficient.
- * see: https://stackoverflow.com/a/32095106/646947
+ * see: http://fastcompression.blogspot.com/2015/08/accessing-unaligned-memory.html
*/
static xxh_u64 XXH_read64(const void* memPtr)
{
xxh_u64 val;
- memcpy(&val, memPtr, sizeof(val));
+ XXH_memcpy(&val, memPtr, sizeof(val));
return val;
}
@@ -2285,11 +2414,12 @@ XXH_readLE64_align(const void* ptr, XXH_alignment align)
* @ingroup impl
* @{
*/
-static const xxh_u64 XXH_PRIME64_1 = 0x9E3779B185EBCA87ULL; /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
-static const xxh_u64 XXH_PRIME64_2 = 0xC2B2AE3D27D4EB4FULL; /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
-static const xxh_u64 XXH_PRIME64_3 = 0x165667B19E3779F9ULL; /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
-static const xxh_u64 XXH_PRIME64_4 = 0x85EBCA77C2B2AE63ULL; /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
-static const xxh_u64 XXH_PRIME64_5 = 0x27D4EB2F165667C5ULL; /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
+/* #define rather that static const, to be used as initializers */
+#define XXH_PRIME64_1 0x9E3779B185EBCA87ULL /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
+#define XXH_PRIME64_2 0xC2B2AE3D27D4EB4FULL /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
+#define XXH_PRIME64_3 0x165667B19E3779F9ULL /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
+#define XXH_PRIME64_4 0x85EBCA77C2B2AE63ULL /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
+#define XXH_PRIME64_5 0x27D4EB2F165667C5ULL /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
#ifdef XXH_OLD_NAMES
# define PRIME64_1 XXH_PRIME64_1
@@ -2331,126 +2461,27 @@ static xxh_u64 XXH64_avalanche(xxh_u64 h64)
static xxh_u64
XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align)
{
-#define XXH_PROCESS1_64 do { \
- h64 ^= (*ptr++) * XXH_PRIME64_5; \
- h64 = XXH_rotl64(h64, 11) * XXH_PRIME64_1; \
-} while (0)
-
-#define XXH_PROCESS4_64 do { \
- h64 ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1; \
- ptr += 4; \
- h64 = XXH_rotl64(h64, 23) * XXH_PRIME64_2 + XXH_PRIME64_3; \
-} while (0)
-
-#define XXH_PROCESS8_64 do { \
- xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr)); \
- ptr += 8; \
- h64 ^= k1; \
- h64 = XXH_rotl64(h64,27) * XXH_PRIME64_1 + XXH_PRIME64_4; \
-} while (0)
-
- /* Rerolled version for 32-bit targets is faster and much smaller. */
- if (XXH_REROLL || XXH_REROLL_XXH64) {
- len &= 31;
- while (len >= 8) {
- XXH_PROCESS8_64;
- len -= 8;
- }
- if (len >= 4) {
- XXH_PROCESS4_64;
- len -= 4;
- }
- while (len > 0) {
- XXH_PROCESS1_64;
- --len;
- }
- return XXH64_avalanche(h64);
- } else {
- switch(len & 31) {
- case 24: XXH_PROCESS8_64;
- /* fallthrough */
- case 16: XXH_PROCESS8_64;
- /* fallthrough */
- case 8: XXH_PROCESS8_64;
- return XXH64_avalanche(h64);
-
- case 28: XXH_PROCESS8_64;
- /* fallthrough */
- case 20: XXH_PROCESS8_64;
- /* fallthrough */
- case 12: XXH_PROCESS8_64;
- /* fallthrough */
- case 4: XXH_PROCESS4_64;
- return XXH64_avalanche(h64);
-
- case 25: XXH_PROCESS8_64;
- /* fallthrough */
- case 17: XXH_PROCESS8_64;
- /* fallthrough */
- case 9: XXH_PROCESS8_64;
- XXH_PROCESS1_64;
- return XXH64_avalanche(h64);
-
- case 29: XXH_PROCESS8_64;
- /* fallthrough */
- case 21: XXH_PROCESS8_64;
- /* fallthrough */
- case 13: XXH_PROCESS8_64;
- /* fallthrough */
- case 5: XXH_PROCESS4_64;
- XXH_PROCESS1_64;
- return XXH64_avalanche(h64);
-
- case 26: XXH_PROCESS8_64;
- /* fallthrough */
- case 18: XXH_PROCESS8_64;
- /* fallthrough */
- case 10: XXH_PROCESS8_64;
- XXH_PROCESS1_64;
- XXH_PROCESS1_64;
- return XXH64_avalanche(h64);
-
- case 30: XXH_PROCESS8_64;
- /* fallthrough */
- case 22: XXH_PROCESS8_64;
- /* fallthrough */
- case 14: XXH_PROCESS8_64;
- /* fallthrough */
- case 6: XXH_PROCESS4_64;
- XXH_PROCESS1_64;
- XXH_PROCESS1_64;
- return XXH64_avalanche(h64);
-
- case 27: XXH_PROCESS8_64;
- /* fallthrough */
- case 19: XXH_PROCESS8_64;
- /* fallthrough */
- case 11: XXH_PROCESS8_64;
- XXH_PROCESS1_64;
- XXH_PROCESS1_64;
- XXH_PROCESS1_64;
- return XXH64_avalanche(h64);
-
- case 31: XXH_PROCESS8_64;
- /* fallthrough */
- case 23: XXH_PROCESS8_64;
- /* fallthrough */
- case 15: XXH_PROCESS8_64;
- /* fallthrough */
- case 7: XXH_PROCESS4_64;
- /* fallthrough */
- case 3: XXH_PROCESS1_64;
- /* fallthrough */
- case 2: XXH_PROCESS1_64;
- /* fallthrough */
- case 1: XXH_PROCESS1_64;
- /* fallthrough */
- case 0: return XXH64_avalanche(h64);
- }
+ if (ptr==NULL) XXH_ASSERT(len == 0);
+ len &= 31;
+ while (len >= 8) {
+ xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr));
+ ptr += 8;
+ h64 ^= k1;
+ h64 = XXH_rotl64(h64,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
+ len -= 8;
+ }
+ if (len >= 4) {
+ h64 ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
+ ptr += 4;
+ h64 = XXH_rotl64(h64, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
+ len -= 4;
}
- /* impossible to reach */
- XXH_ASSERT(0);
- return 0; /* unreachable, but some compilers complain without it */
+ while (len > 0) {
+ h64 ^= (*ptr++) * XXH_PRIME64_5;
+ h64 = XXH_rotl64(h64, 11) * XXH_PRIME64_1;
+ --len;
+ }
+ return XXH64_avalanche(h64);
}
#ifdef XXH_OLD_NAMES
@@ -2466,18 +2497,12 @@ XXH64_finalize(xxh_u64 h64, const xxh_u8* ptr, size_t len, XXH_alignment align)
XXH_FORCE_INLINE xxh_u64
XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment align)
{
- const xxh_u8* bEnd = input + len;
xxh_u64 h64;
-
-#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
- if (input==NULL) {
- len=0;
- bEnd=input=(const xxh_u8*)(size_t)32;
- }
-#endif
+ if (input==NULL) XXH_ASSERT(len == 0);
if (len>=32) {
- const xxh_u8* const limit = bEnd - 32;
+ const xxh_u8* const bEnd = input + len;
+ const xxh_u8* const limit = bEnd - 31;
xxh_u64 v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
xxh_u64 v2 = seed + XXH_PRIME64_2;
xxh_u64 v3 = seed + 0;
@@ -2488,7 +2513,7 @@ XXH64_endian_align(const xxh_u8* input, size_t len, xxh_u64 seed, XXH_alignment
v2 = XXH64_round(v2, XXH_get64bits(input)); input+=8;
v3 = XXH64_round(v3, XXH_get64bits(input)); input+=8;
v4 = XXH64_round(v4, XXH_get64bits(input)); input+=8;
- } while (input<=limit);
+ } while (input<limit);
h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
h64 = XXH64_mergeRound(h64, v1);
@@ -2543,7 +2568,7 @@ XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr)
/*! @ingroup xxh64_family */
XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dstState, const XXH64_state_t* srcState)
{
- memcpy(dstState, srcState, sizeof(*dstState));
+ XXH_memcpy(dstState, srcState, sizeof(*dstState));
}
/*! @ingroup xxh64_family */
@@ -2551,12 +2576,12 @@ XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, XXH64_hash_t s
{
XXH64_state_t state; /* use a local state to memcpy() in order to avoid strict-aliasing warnings */
memset(&state, 0, sizeof(state));
- state.v1 = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
- state.v2 = seed + XXH_PRIME64_2;
- state.v3 = seed + 0;
- state.v4 = seed - XXH_PRIME64_1;
+ state.v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
+ state.v[1] = seed + XXH_PRIME64_2;
+ state.v[2] = seed + 0;
+ state.v[3] = seed - XXH_PRIME64_1;
/* do not write into reserved64, might be removed in a future version */
- memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved64));
+ XXH_memcpy(statePtr, &state, sizeof(state) - sizeof(state.reserved64));
return XXH_OK;
}
@@ -2564,12 +2589,10 @@ XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH64_state_t* statePtr, XXH64_hash_t s
XXH_PUBLIC_API XXH_errorcode
XXH64_update (XXH64_state_t* state, const void* input, size_t len)
{
- if (input==NULL)
-#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
+ if (input==NULL) {
+ XXH_ASSERT(len == 0);
return XXH_OK;
-#else
- return XXH_ERROR;
-#endif
+ }
{ const xxh_u8* p = (const xxh_u8*)input;
const xxh_u8* const bEnd = p + len;
@@ -2584,32 +2607,24 @@ XXH64_update (XXH64_state_t* state, const void* input, size_t len)
if (state->memsize) { /* tmp buffer is full */
XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);
- state->v1 = XXH64_round(state->v1, XXH_readLE64(state->mem64+0));
- state->v2 = XXH64_round(state->v2, XXH_readLE64(state->mem64+1));
- state->v3 = XXH64_round(state->v3, XXH_readLE64(state->mem64+2));
- state->v4 = XXH64_round(state->v4, XXH_readLE64(state->mem64+3));
+ state->v[0] = XXH64_round(state->v[0], XXH_readLE64(state->mem64+0));
+ state->v[1] = XXH64_round(state->v[1], XXH_readLE64(state->mem64+1));
+ state->v[2] = XXH64_round(state->v[2], XXH_readLE64(state->mem64+2));
+ state->v[3] = XXH64_round(state->v[3], XXH_readLE64(state->mem64+3));
p += 32 - state->memsize;
state->memsize = 0;
}
if (p+32 <= bEnd) {
const xxh_u8* const limit = bEnd - 32;
- xxh_u64 v1 = state->v1;
- xxh_u64 v2 = state->v2;
- xxh_u64 v3 = state->v3;
- xxh_u64 v4 = state->v4;
do {
- v1 = XXH64_round(v1, XXH_readLE64(p)); p+=8;
- v2 = XXH64_round(v2, XXH_readLE64(p)); p+=8;
- v3 = XXH64_round(v3, XXH_readLE64(p)); p+=8;
- v4 = XXH64_round(v4, XXH_readLE64(p)); p+=8;
+ state->v[0] = XXH64_round(state->v[0], XXH_readLE64(p)); p+=8;
+ state->v[1] = XXH64_round(state->v[1], XXH_readLE64(p)); p+=8;
+ state->v[2] = XXH64_round(state->v[2], XXH_readLE64(p)); p+=8;
+ state->v[3] = XXH64_round(state->v[3], XXH_readLE64(p)); p+=8;
} while (p<=limit);
- state->v1 = v1;
- state->v2 = v2;
- state->v3 = v3;
- state->v4 = v4;
}
if (p < bEnd) {
@@ -2628,18 +2643,13 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_digest(const XXH64_state_t* state)
xxh_u64 h64;
if (state->total_len >= 32) {
- xxh_u64 const v1 = state->v1;
- xxh_u64 const v2 = state->v2;
- xxh_u64 const v3 = state->v3;
- xxh_u64 const v4 = state->v4;
-
- h64 = XXH_rotl64(v1, 1) + XXH_rotl64(v2, 7) + XXH_rotl64(v3, 12) + XXH_rotl64(v4, 18);
- h64 = XXH64_mergeRound(h64, v1);
- h64 = XXH64_mergeRound(h64, v2);
- h64 = XXH64_mergeRound(h64, v3);
- h64 = XXH64_mergeRound(h64, v4);
+ h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);
+ h64 = XXH64_mergeRound(h64, state->v[0]);
+ h64 = XXH64_mergeRound(h64, state->v[1]);
+ h64 = XXH64_mergeRound(h64, state->v[2]);
+ h64 = XXH64_mergeRound(h64, state->v[3]);
} else {
- h64 = state->v3 /*seed*/ + XXH_PRIME64_5;
+ h64 = state->v[2] /*seed*/ + XXH_PRIME64_5;
}
h64 += (xxh_u64) state->total_len;
@@ -2655,7 +2665,7 @@ XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t
{
XXH_STATIC_ASSERT(sizeof(XXH64_canonical_t) == sizeof(XXH64_hash_t));
if (XXH_CPU_LITTLE_ENDIAN) hash = XXH_swap64(hash);
- memcpy(dst, &hash, sizeof(*dst));
+ XXH_memcpy(dst, &hash, sizeof(*dst));
}
/*! @ingroup xxh64_family */
@@ -2664,7 +2674,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src
return XXH_readBE64(src);
}
-
+#ifndef XXH_NO_XXH3
/* *********************************************************************
* XXH3
@@ -2679,7 +2689,9 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src
/* === Compiler specifics === */
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */
+#if ((defined(sun) || defined(__sun)) && __cplusplus) /* Solaris includes __STDC_VERSION__ with C++. Tested with GCC 5.5 */
+# define XXH_RESTRICT /* disable */
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* >= C99 */
# define XXH_RESTRICT restrict
#else
/* Note: it might be useful to define __restrict or __restrict__ for some C++ compilers */
@@ -2850,10 +2862,13 @@ enum XXH_VECTOR_TYPE /* fake enum */ {
# define XXH_VECTOR XXH_AVX2
# elif defined(__SSE2__) || defined(_M_AMD64) || defined(_M_X64) || (defined(_M_IX86_FP) && (_M_IX86_FP == 2))
# define XXH_VECTOR XXH_SSE2
-# elif defined(__GNUC__) /* msvc support maybe later */ \
- && (defined(__ARM_NEON__) || defined(__ARM_NEON)) \
- && (defined(__LITTLE_ENDIAN__) /* We only support little endian NEON */ \
- || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+# elif ( \
+ defined(__ARM_NEON__) || defined(__ARM_NEON) /* gcc */ \
+ || defined(_M_ARM64) || defined(_M_ARM_ARMV7VE) /* msvc */ \
+ ) && ( \
+ defined(_WIN32) || defined(__LITTLE_ENDIAN__) /* little endian only */ \
+ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \
+ )
# define XXH_VECTOR XXH_NEON
# elif (defined(__PPC64__) && defined(__POWER8_VECTOR__)) \
|| (defined(__s390x__) && defined(__VEC__)) \
@@ -3005,7 +3020,7 @@ enum XXH_VECTOR_TYPE /* fake enum */ {
*/
# if !defined(XXH_NO_VZIP_HACK) /* define to disable */ \
&& defined(__GNUC__) \
- && !defined(__aarch64__) && !defined(__arm64__)
+ && !defined(__aarch64__) && !defined(__arm64__) && !defined(_M_ARM64)
# define XXH_SPLIT_IN_PLACE(in, outLo, outHi) \
do { \
/* Undocumented GCC/Clang operand modifier: %e0 = lower D half, %f0 = upper D half */ \
@@ -3088,7 +3103,7 @@ XXH_FORCE_INLINE xxh_u64x2 XXH_vec_revb(xxh_u64x2 val)
XXH_FORCE_INLINE xxh_u64x2 XXH_vec_loadu(const void *ptr)
{
xxh_u64x2 ret;
- memcpy(&ret, ptr, sizeof(xxh_u64x2));
+ XXH_memcpy(&ret, ptr, sizeof(xxh_u64x2));
# if XXH_VSX_BE
ret = XXH_vec_revb(ret);
# endif
@@ -3217,7 +3232,7 @@ XXH_mult32to64(xxh_u64 x, xxh_u64 y)
* Uses `__uint128_t` and `_umul128` if available, otherwise uses a scalar
* version.
*
- * @param lhs, rhs The 64-bit integers to be multiplied
+ * @param lhs , rhs The 64-bit integers to be multiplied
* @return The 128-bit result represented in an @ref XXH128_hash_t.
*/
static XXH128_hash_t
@@ -3267,6 +3282,21 @@ XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs)
r128.high64 = product_high;
return r128;
+ /*
+ * MSVC for ARM64's __umulh method.
+ *
+ * This compiles to the same MUL + UMULH as GCC/Clang's __uint128_t method.
+ */
+#elif defined(_M_ARM64)
+
+#ifndef _MSC_VER
+# pragma intrinsic(__umulh)
+#endif
+ XXH128_hash_t r128;
+ r128.low64 = lhs * rhs;
+ r128.high64 = __umulh(lhs, rhs);
+ return r128;
+
#else
/*
* Portable scalar method. Optimized for 32-bit and 64-bit ALUs.
@@ -3335,7 +3365,7 @@ XXH_mult64to128(xxh_u64 lhs, xxh_u64 rhs)
* The reason for the separate function is to prevent passing too many structs
* around by value. This will hopefully inline the multiply, but we don't force it.
*
- * @param lhs, rhs The 64-bit integers to multiply
+ * @param lhs , rhs The 64-bit integers to multiply
* @return The low 64 bits of the product XOR'd by the high 64 bits.
* @see XXH_mult64to128()
*/
@@ -3441,7 +3471,7 @@ XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_h
{
XXH_ASSERT(input != NULL);
XXH_ASSERT(secret != NULL);
- XXH_ASSERT(4 <= len && len < 8);
+ XXH_ASSERT(4 <= len && len <= 8);
seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32;
{ xxh_u32 const input1 = XXH_readLE32(input);
xxh_u32 const input2 = XXH_readLE32(input + len - 4);
@@ -3457,7 +3487,7 @@ XXH3_len_9to16_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_
{
XXH_ASSERT(input != NULL);
XXH_ASSERT(secret != NULL);
- XXH_ASSERT(8 <= len && len <= 16);
+ XXH_ASSERT(9 <= len && len <= 16);
{ xxh_u64 const bitflip1 = (XXH_readLE64(secret+24) ^ XXH_readLE64(secret+32)) + seed;
xxh_u64 const bitflip2 = (XXH_readLE64(secret+40) ^ XXH_readLE64(secret+48)) - seed;
xxh_u64 const input_lo = XXH_readLE64(input) ^ bitflip1;
@@ -3527,7 +3557,7 @@ XXH_FORCE_INLINE xxh_u64 XXH3_mix16B(const xxh_u8* XXH_RESTRICT input,
* GCC generates much better scalar code than Clang for the rest of XXH3,
* which is why finding a more optimal codepath is an interest.
*/
- __asm__ ("" : "+r" (seed64));
+ XXH_COMPILER_GUARD(seed64);
#endif
{ xxh_u64 const input_lo = XXH_readLE64(input);
xxh_u64 const input_hi = XXH_readLE64(input+8);
@@ -3637,7 +3667,7 @@ XXH3_len_129to240_64b(const xxh_u8* XXH_RESTRICT input, size_t len,
XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64)
{
if (!XXH_CPU_LITTLE_ENDIAN) v64 = XXH_swap64(v64);
- memcpy(dst, &v64, sizeof(v64));
+ XXH_memcpy(dst, &v64, sizeof(v64));
}
/* Several intrinsic functions below are supposed to accept __int64 as argument,
@@ -3689,7 +3719,7 @@ XXH3_accumulate_512_avx512(void* XXH_RESTRICT acc,
const void* XXH_RESTRICT input,
const void* XXH_RESTRICT secret)
{
- XXH_ALIGN(64) __m512i* const xacc = (__m512i *) acc;
+ __m512i* const xacc = (__m512i *) acc;
XXH_ASSERT((((size_t)acc) & 63) == 0);
XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i));
@@ -3738,7 +3768,7 @@ XXH3_scrambleAcc_avx512(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
{
XXH_ASSERT((((size_t)acc) & 63) == 0);
XXH_STATIC_ASSERT(XXH_STRIPE_LEN == sizeof(__m512i));
- { XXH_ALIGN(64) __m512i* const xacc = (__m512i*) acc;
+ { __m512i* const xacc = (__m512i*) acc;
const __m512i prime32 = _mm512_set1_epi32((int)XXH_PRIME32_1);
/* xacc[0] ^= (xacc[0] >> 47) */
@@ -3765,17 +3795,19 @@ XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64)
XXH_ASSERT(((size_t)customSecret & 63) == 0);
(void)(&XXH_writeLE64);
{ int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m512i);
- __m512i const seed = _mm512_mask_set1_epi64(_mm512_set1_epi64((xxh_i64)seed64), 0xAA, -(xxh_i64)seed64);
+ __m512i const seed = _mm512_mask_set1_epi64(_mm512_set1_epi64((xxh_i64)seed64), 0xAA, (xxh_i64)(0U - seed64));
- XXH_ALIGN(64) const __m512i* const src = (const __m512i*) XXH3_kSecret;
- XXH_ALIGN(64) __m512i* const dest = ( __m512i*) customSecret;
+ const __m512i* const src = (const __m512i*) ((const void*) XXH3_kSecret);
+ __m512i* const dest = ( __m512i*) customSecret;
int i;
+ XXH_ASSERT(((size_t)src & 63) == 0); /* control alignment */
+ XXH_ASSERT(((size_t)dest & 63) == 0);
for (i=0; i < nbRounds; ++i) {
/* GCC has a bug, _mm512_stream_load_si512 accepts 'void*', not 'void const*',
- * this will warn "discards ‘const’ qualifier". */
+ * this will warn "discards 'const' qualifier". */
union {
- XXH_ALIGN(64) const __m512i* cp;
- XXH_ALIGN(64) void* p;
+ const __m512i* cp;
+ void* p;
} remote_const_void;
remote_const_void.cp = src + i;
dest[i] = _mm512_add_epi64(_mm512_stream_load_si512(remote_const_void.p), seed);
@@ -3797,7 +3829,7 @@ XXH3_accumulate_512_avx2( void* XXH_RESTRICT acc,
const void* XXH_RESTRICT secret)
{
XXH_ASSERT((((size_t)acc) & 31) == 0);
- { XXH_ALIGN(32) __m256i* const xacc = (__m256i *) acc;
+ { __m256i* const xacc = (__m256i *) acc;
/* Unaligned. This is mainly for pointer arithmetic, and because
* _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */
const __m256i* const xinput = (const __m256i *) input;
@@ -3829,7 +3861,7 @@ XXH_FORCE_INLINE XXH_TARGET_AVX2 void
XXH3_scrambleAcc_avx2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
{
XXH_ASSERT((((size_t)acc) & 31) == 0);
- { XXH_ALIGN(32) __m256i* const xacc = (__m256i*) acc;
+ { __m256i* const xacc = (__m256i*) acc;
/* Unaligned. This is mainly for pointer arithmetic, and because
* _mm256_loadu_si256 requires a const __m256i * pointer for some reason. */
const __m256i* const xsecret = (const __m256i *) secret;
@@ -3861,23 +3893,21 @@ XXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_initCustomSecret_avx2(void* XXH_RESTR
XXH_STATIC_ASSERT(XXH_SEC_ALIGN <= 64);
(void)(&XXH_writeLE64);
XXH_PREFETCH(customSecret);
- { __m256i const seed = _mm256_set_epi64x(-(xxh_i64)seed64, (xxh_i64)seed64, -(xxh_i64)seed64, (xxh_i64)seed64);
+ { __m256i const seed = _mm256_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64, (xxh_i64)(0U - seed64), (xxh_i64)seed64);
- XXH_ALIGN(64) const __m256i* const src = (const __m256i*) XXH3_kSecret;
- XXH_ALIGN(64) __m256i* dest = ( __m256i*) customSecret;
+ const __m256i* const src = (const __m256i*) ((const void*) XXH3_kSecret);
+ __m256i* dest = ( __m256i*) customSecret;
# if defined(__GNUC__) || defined(__clang__)
/*
* On GCC & Clang, marking 'dest' as modified will cause the compiler:
* - do not extract the secret from sse registers in the internal loop
* - use less common registers, and avoid pushing these reg into stack
- * The asm hack causes Clang to assume that XXH3_kSecretPtr aliases with
- * customSecret, and on aarch64, this prevented LDP from merging two
- * loads together for free. Putting the loads together before the stores
- * properly generates LDP.
*/
- __asm__("" : "+r" (dest));
+ XXH_COMPILER_GUARD(dest);
# endif
+ XXH_ASSERT(((size_t)src & 31) == 0); /* control alignment */
+ XXH_ASSERT(((size_t)dest & 31) == 0);
/* GCC -O2 need unroll loop manually */
dest[0] = _mm256_add_epi64(_mm256_stream_load_si256(src+0), seed);
@@ -3905,7 +3935,7 @@ XXH3_accumulate_512_sse2( void* XXH_RESTRICT acc,
{
/* SSE2 is just a half-scale version of the AVX2 version. */
XXH_ASSERT((((size_t)acc) & 15) == 0);
- { XXH_ALIGN(16) __m128i* const xacc = (__m128i *) acc;
+ { __m128i* const xacc = (__m128i *) acc;
/* Unaligned. This is mainly for pointer arithmetic, and because
* _mm_loadu_si128 requires a const __m128i * pointer for some reason. */
const __m128i* const xinput = (const __m128i *) input;
@@ -3937,7 +3967,7 @@ XXH_FORCE_INLINE XXH_TARGET_SSE2 void
XXH3_scrambleAcc_sse2(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
{
XXH_ASSERT((((size_t)acc) & 15) == 0);
- { XXH_ALIGN(16) __m128i* const xacc = (__m128i*) acc;
+ { __m128i* const xacc = (__m128i*) acc;
/* Unaligned. This is mainly for pointer arithmetic, and because
* _mm_loadu_si128 requires a const __m128i * pointer for some reason. */
const __m128i* const xsecret = (const __m128i *) secret;
@@ -3969,27 +3999,29 @@ XXH_FORCE_INLINE XXH_TARGET_SSE2 void XXH3_initCustomSecret_sse2(void* XXH_RESTR
{ int const nbRounds = XXH_SECRET_DEFAULT_SIZE / sizeof(__m128i);
# if defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER < 1900
- // MSVC 32bit mode does not support _mm_set_epi64x before 2015
- XXH_ALIGN(16) const xxh_i64 seed64x2[2] = { (xxh_i64)seed64, -(xxh_i64)seed64 };
+ /* MSVC 32bit mode does not support _mm_set_epi64x before 2015 */
+ XXH_ALIGN(16) const xxh_i64 seed64x2[2] = { (xxh_i64)seed64, (xxh_i64)(0U - seed64) };
__m128i const seed = _mm_load_si128((__m128i const*)seed64x2);
# else
- __m128i const seed = _mm_set_epi64x(-(xxh_i64)seed64, (xxh_i64)seed64);
+ __m128i const seed = _mm_set_epi64x((xxh_i64)(0U - seed64), (xxh_i64)seed64);
# endif
int i;
- XXH_ALIGN(64) const float* const src = (float const*) XXH3_kSecret;
- XXH_ALIGN(XXH_SEC_ALIGN) __m128i* dest = (__m128i*) customSecret;
+ const void* const src16 = XXH3_kSecret;
+ __m128i* dst16 = (__m128i*) customSecret;
# if defined(__GNUC__) || defined(__clang__)
/*
* On GCC & Clang, marking 'dest' as modified will cause the compiler:
* - do not extract the secret from sse registers in the internal loop
* - use less common registers, and avoid pushing these reg into stack
*/
- __asm__("" : "+r" (dest));
+ XXH_COMPILER_GUARD(dst16);
# endif
+ XXH_ASSERT(((size_t)src16 & 15) == 0); /* control alignment */
+ XXH_ASSERT(((size_t)dst16 & 15) == 0);
for (i=0; i < nbRounds; ++i) {
- dest[i] = _mm_add_epi64(_mm_castps_si128(_mm_load_ps(src+i*4)), seed);
+ dst16[i] = _mm_add_epi64(_mm_load_si128((const __m128i *)src16+i), seed);
} }
}
@@ -4004,7 +4036,7 @@ XXH3_accumulate_512_neon( void* XXH_RESTRICT acc,
{
XXH_ASSERT((((size_t)acc) & 15) == 0);
{
- XXH_ALIGN(16) uint64x2_t* const xacc = (uint64x2_t *) acc;
+ uint64x2_t* const xacc = (uint64x2_t *) acc;
/* We don't use a uint32x4_t pointer because it causes bus errors on ARMv7. */
uint8_t const* const xinput = (const uint8_t *) input;
uint8_t const* const xsecret = (const uint8_t *) secret;
@@ -4051,8 +4083,8 @@ XXH3_scrambleAcc_neon(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
uint64x2_t data_vec = veorq_u64 (acc_vec, shifted);
/* xacc[i] ^= xsecret[i]; */
- uint8x16_t key_vec = vld1q_u8(xsecret + (i * 16));
- uint64x2_t data_key = veorq_u64(data_vec, vreinterpretq_u64_u8(key_vec));
+ uint8x16_t key_vec = vld1q_u8 (xsecret + (i * 16));
+ uint64x2_t data_key = veorq_u64 (data_vec, vreinterpretq_u64_u8(key_vec));
/* xacc[i] *= XXH_PRIME32_1 */
uint32x2_t data_key_lo, data_key_hi;
@@ -4096,7 +4128,8 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
const void* XXH_RESTRICT input,
const void* XXH_RESTRICT secret)
{
- xxh_u64x2* const xacc = (xxh_u64x2*) acc; /* presumed aligned */
+ /* presumed aligned */
+ unsigned long long* const xacc = (unsigned long long*) acc;
xxh_u64x2 const* const xinput = (xxh_u64x2 const*) input; /* no alignment restriction */
xxh_u64x2 const* const xsecret = (xxh_u64x2 const*) secret; /* no alignment restriction */
xxh_u64x2 const v32 = { 32, 32 };
@@ -4111,14 +4144,18 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
xxh_u32x4 const shuffled = (xxh_u32x4)vec_rl(data_key, v32);
/* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */
xxh_u64x2 const product = XXH_vec_mulo((xxh_u32x4)data_key, shuffled);
- xacc[i] += product;
+ /* acc_vec = xacc[i]; */
+ xxh_u64x2 acc_vec = vec_xl(0, xacc + 2 * i);
+ acc_vec += product;
/* swap high and low halves */
#ifdef __s390x__
- xacc[i] += vec_permi(data_vec, data_vec, 2);
+ acc_vec += vec_permi(data_vec, data_vec, 2);
#else
- xacc[i] += vec_xxpermdi(data_vec, data_vec, 2);
+ acc_vec += vec_xxpermdi(data_vec, data_vec, 2);
#endif
+ /* xacc[i] = acc_vec; */
+ vec_xst(acc_vec, 0, xacc + 2 * i);
}
}
@@ -4161,7 +4198,7 @@ XXH3_accumulate_512_scalar(void* XXH_RESTRICT acc,
const void* XXH_RESTRICT input,
const void* XXH_RESTRICT secret)
{
- XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */
+ xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */
const xxh_u8* const xinput = (const xxh_u8*) input; /* no alignment restriction */
const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */
size_t i;
@@ -4177,7 +4214,7 @@ XXH3_accumulate_512_scalar(void* XXH_RESTRICT acc,
XXH_FORCE_INLINE void
XXH3_scrambleAcc_scalar(void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret)
{
- XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */
+ xxh_u64* const xacc = (xxh_u64*) acc; /* presumed aligned */
const xxh_u8* const xsecret = (const xxh_u8*) secret; /* no alignment restriction */
size_t i;
XXH_ASSERT((((size_t)acc) & (XXH_ACC_ALIGN-1)) == 0);
@@ -4231,7 +4268,7 @@ XXH3_initCustomSecret_scalar(void* XXH_RESTRICT customSecret, xxh_u64 seed64)
* without hack: 2654.4 MB/s
* with hack: 3202.9 MB/s
*/
- __asm__("" : "+r" (kSecretPtr));
+ XXH_COMPILER_GUARD(kSecretPtr);
#endif
/*
* Note: in debug mode, this overrides the asm optimization
@@ -4396,7 +4433,7 @@ XXH3_mergeAccs(const xxh_u64* XXH_RESTRICT acc, const xxh_u8* XXH_RESTRICT secre
* without hack: 2063.7 MB/s
* with hack: 2560.7 MB/s
*/
- __asm__("" : "+r" (result64));
+ XXH_COMPILER_GUARD(result64);
#endif
}
@@ -4425,9 +4462,11 @@ XXH3_hashLong_64b_internal(const void* XXH_RESTRICT input, size_t len,
}
/*
- * It's important for performance that XXH3_hashLong is not inlined.
+ * It's important for performance to transmit secret's size (when it's static)
+ * so that the compiler can properly optimize the vectorized loop.
+ * This makes a big performance difference for "medium" keys (<1 KB) when using AVX instruction set.
*/
-XXH_NO_INLINE XXH64_hash_t
+XXH_FORCE_INLINE XXH64_hash_t
XXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len,
XXH64_hash_t seed64, const xxh_u8* XXH_RESTRICT secret, size_t secretLen)
{
@@ -4436,11 +4475,10 @@ XXH3_hashLong_64b_withSecret(const void* XXH_RESTRICT input, size_t len,
}
/*
- * It's important for performance that XXH3_hashLong is not inlined.
- * Since the function is not inlined, the compiler may not be able to understand that,
- * in some scenarios, its `secret` argument is actually a compile time constant.
- * This variant enforces that the compiler can detect that,
- * and uses this opportunity to streamline the generated code for better performance.
+ * It's preferable for performance that XXH3_hashLong is not inlined,
+ * as it results in a smaller function for small data, easier to the instruction cache.
+ * Note that inside this no_inline function, we do inline the internal loop,
+ * and provide a statically defined secret size to allow optimization of vector loop.
*/
XXH_NO_INLINE XXH64_hash_t
XXH3_hashLong_64b_default(const void* XXH_RESTRICT input, size_t len,
@@ -4540,6 +4578,14 @@ XXH3_64bits_withSeed(const void* input, size_t len, XXH64_hash_t seed)
return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), XXH3_hashLong_64b_withSeed);
}
+XXH_PUBLIC_API XXH64_hash_t
+XXH3_64bits_withSecretandSeed(const void* input, size_t len, const void* secret, size_t secretSize, XXH64_hash_t seed)
+{
+ if (len <= XXH3_MIDSIZE_MAX)
+ return XXH3_64bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);
+ return XXH3_hashLong_64b_withSecret(input, len, seed, (const xxh_u8*)secret, secretSize);
+}
+
/* === XXH3 streaming === */
@@ -4628,13 +4674,13 @@ XXH_PUBLIC_API XXH_errorcode XXH3_freeState(XXH3_state_t* statePtr)
XXH_PUBLIC_API void
XXH3_copyState(XXH3_state_t* dst_state, const XXH3_state_t* src_state)
{
- memcpy(dst_state, src_state, sizeof(*dst_state));
+ XXH_memcpy(dst_state, src_state, sizeof(*dst_state));
}
static void
XXH3_reset_internal(XXH3_state_t* statePtr,
- XXH64_hash_t seed,
- const void* secret, size_t secretSize)
+ XXH64_hash_t seed,
+ const void* secret, size_t secretSize)
{
size_t const initStart = offsetof(XXH3_state_t, bufferedSize);
size_t const initLength = offsetof(XXH3_state_t, nbStripesPerBlock) - initStart;
@@ -4651,6 +4697,7 @@ XXH3_reset_internal(XXH3_state_t* statePtr,
statePtr->acc[6] = XXH_PRIME64_5;
statePtr->acc[7] = XXH_PRIME32_1;
statePtr->seed = seed;
+ statePtr->useSeed = (seed != 0);
statePtr->extSecret = (const unsigned char*)secret;
XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
statePtr->secretLimit = secretSize - XXH_STRIPE_LEN;
@@ -4683,11 +4730,24 @@ XXH3_64bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed)
{
if (statePtr == NULL) return XXH_ERROR;
if (seed==0) return XXH3_64bits_reset(statePtr);
- if (seed != statePtr->seed) XXH3_initCustomSecret(statePtr->customSecret, seed);
+ if ((seed != statePtr->seed) || (statePtr->extSecret != NULL))
+ XXH3_initCustomSecret(statePtr->customSecret, seed);
XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE);
return XXH_OK;
}
+/*! @ingroup xxh3_family */
+XXH_PUBLIC_API XXH_errorcode
+XXH3_64bits_reset_withSecretandSeed(XXH3_state_t* statePtr, const void* secret, size_t secretSize, XXH64_hash_t seed64)
+{
+ if (statePtr == NULL) return XXH_ERROR;
+ if (secret == NULL) return XXH_ERROR;
+ if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;
+ XXH3_reset_internal(statePtr, seed64, secret, secretSize);
+ statePtr->useSeed = 1; /* always, even if seed64==0 */
+ return XXH_OK;
+}
+
/* Note : when XXH3_consumeStripes() is invoked,
* there must be a guarantee that at least one more byte must be consumed from input
* so that the function can blindly consume all stripes using the "normal" secret segment */
@@ -4715,35 +4775,48 @@ XXH3_consumeStripes(xxh_u64* XXH_RESTRICT acc,
}
}
+#ifndef XXH3_STREAM_USE_STACK
+# ifndef __clang__ /* clang doesn't need additional stack space */
+# define XXH3_STREAM_USE_STACK 1
+# endif
+#endif
/*
* Both XXH3_64bits_update and XXH3_128bits_update use this routine.
*/
XXH_FORCE_INLINE XXH_errorcode
-XXH3_update(XXH3_state_t* state,
- const xxh_u8* input, size_t len,
+XXH3_update(XXH3_state_t* XXH_RESTRICT const state,
+ const xxh_u8* XXH_RESTRICT input, size_t len,
XXH3_f_accumulate_512 f_acc512,
XXH3_f_scrambleAcc f_scramble)
{
- if (input==NULL)
-#if defined(XXH_ACCEPT_NULL_INPUT_POINTER) && (XXH_ACCEPT_NULL_INPUT_POINTER>=1)
+ if (input==NULL) {
+ XXH_ASSERT(len == 0);
return XXH_OK;
-#else
- return XXH_ERROR;
-#endif
+ }
+ XXH_ASSERT(state != NULL);
{ const xxh_u8* const bEnd = input + len;
const unsigned char* const secret = (state->extSecret == NULL) ? state->customSecret : state->extSecret;
-
+#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1
+ /* For some reason, gcc and MSVC seem to suffer greatly
+ * when operating accumulators directly into state.
+ * Operating into stack space seems to enable proper optimization.
+ * clang, on the other hand, doesn't seem to need this trick */
+ XXH_ALIGN(XXH_ACC_ALIGN) xxh_u64 acc[8]; memcpy(acc, state->acc, sizeof(acc));
+#else
+ xxh_u64* XXH_RESTRICT const acc = state->acc;
+#endif
state->totalLen += len;
XXH_ASSERT(state->bufferedSize <= XXH3_INTERNALBUFFER_SIZE);
- if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) { /* fill in tmp buffer */
+ /* small input : just fill in tmp buffer */
+ if (state->bufferedSize + len <= XXH3_INTERNALBUFFER_SIZE) {
XXH_memcpy(state->buffer + state->bufferedSize, input, len);
state->bufferedSize += (XXH32_hash_t)len;
return XXH_OK;
}
- /* total input is now > XXH3_INTERNALBUFFER_SIZE */
+ /* total input is now > XXH3_INTERNALBUFFER_SIZE */
#define XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN)
XXH_STATIC_ASSERT(XXH3_INTERNALBUFFER_SIZE % XXH_STRIPE_LEN == 0); /* clean multiple */
@@ -4755,7 +4828,7 @@ XXH3_update(XXH3_state_t* state,
size_t const loadSize = XXH3_INTERNALBUFFER_SIZE - state->bufferedSize;
XXH_memcpy(state->buffer + state->bufferedSize, input, loadSize);
input += loadSize;
- XXH3_consumeStripes(state->acc,
+ XXH3_consumeStripes(acc,
&state->nbStripesSoFar, state->nbStripesPerBlock,
state->buffer, XXH3_INTERNALBUFFER_STRIPES,
secret, state->secretLimit,
@@ -4764,25 +4837,62 @@ XXH3_update(XXH3_state_t* state,
}
XXH_ASSERT(input < bEnd);
- /* Consume input by a multiple of internal buffer size */
- if (input+XXH3_INTERNALBUFFER_SIZE < bEnd) {
- const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE;
- do {
- XXH3_consumeStripes(state->acc,
- &state->nbStripesSoFar, state->nbStripesPerBlock,
- input, XXH3_INTERNALBUFFER_STRIPES,
- secret, state->secretLimit,
- f_acc512, f_scramble);
- input += XXH3_INTERNALBUFFER_SIZE;
- } while (input<limit);
- /* for last partial stripe */
- memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN);
+ /* large input to consume : ingest per full block */
+ if ((size_t)(bEnd - input) > state->nbStripesPerBlock * XXH_STRIPE_LEN) {
+ size_t nbStripes = (size_t)(bEnd - 1 - input) / XXH_STRIPE_LEN;
+ XXH_ASSERT(state->nbStripesPerBlock >= state->nbStripesSoFar);
+ /* join to current block's end */
+ { size_t const nbStripesToEnd = state->nbStripesPerBlock - state->nbStripesSoFar;
+ XXH_ASSERT(nbStripes <= nbStripes);
+ XXH3_accumulate(acc, input, secret + state->nbStripesSoFar * XXH_SECRET_CONSUME_RATE, nbStripesToEnd, f_acc512);
+ f_scramble(acc, secret + state->secretLimit);
+ state->nbStripesSoFar = 0;
+ input += nbStripesToEnd * XXH_STRIPE_LEN;
+ nbStripes -= nbStripesToEnd;
+ }
+ /* consume per entire blocks */
+ while(nbStripes >= state->nbStripesPerBlock) {
+ XXH3_accumulate(acc, input, secret, state->nbStripesPerBlock, f_acc512);
+ f_scramble(acc, secret + state->secretLimit);
+ input += state->nbStripesPerBlock * XXH_STRIPE_LEN;
+ nbStripes -= state->nbStripesPerBlock;
+ }
+ /* consume last partial block */
+ XXH3_accumulate(acc, input, secret, nbStripes, f_acc512);
+ input += nbStripes * XXH_STRIPE_LEN;
+ XXH_ASSERT(input < bEnd); /* at least some bytes left */
+ state->nbStripesSoFar = nbStripes;
+ /* buffer predecessor of last partial stripe */
+ XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN);
+ XXH_ASSERT(bEnd - input <= XXH_STRIPE_LEN);
+ } else {
+ /* content to consume <= block size */
+ /* Consume input by a multiple of internal buffer size */
+ if (bEnd - input > XXH3_INTERNALBUFFER_SIZE) {
+ const xxh_u8* const limit = bEnd - XXH3_INTERNALBUFFER_SIZE;
+ do {
+ XXH3_consumeStripes(acc,
+ &state->nbStripesSoFar, state->nbStripesPerBlock,
+ input, XXH3_INTERNALBUFFER_STRIPES,
+ secret, state->secretLimit,
+ f_acc512, f_scramble);
+ input += XXH3_INTERNALBUFFER_SIZE;
+ } while (input<limit);
+ /* buffer predecessor of last partial stripe */
+ XXH_memcpy(state->buffer + sizeof(state->buffer) - XXH_STRIPE_LEN, input - XXH_STRIPE_LEN, XXH_STRIPE_LEN);
+ }
}
- XXH_ASSERT(input < bEnd);
/* Some remaining input (always) : buffer it */
+ XXH_ASSERT(input < bEnd);
+ XXH_ASSERT(bEnd - input <= XXH3_INTERNALBUFFER_SIZE);
+ XXH_ASSERT(state->bufferedSize == 0);
XXH_memcpy(state->buffer, input, (size_t)(bEnd-input));
state->bufferedSize = (XXH32_hash_t)(bEnd-input);
+#if defined(XXH3_STREAM_USE_STACK) && XXH3_STREAM_USE_STACK >= 1
+ /* save stack accumulators into state */
+ memcpy(state->acc, acc, sizeof(acc));
+#endif
}
return XXH_OK;
@@ -4806,7 +4916,7 @@ XXH3_digest_long (XXH64_hash_t* acc,
* Digest on a local copy. This way, the state remains unaltered, and it can
* continue ingesting more input afterwards.
*/
- memcpy(acc, state->acc, sizeof(state->acc));
+ XXH_memcpy(acc, state->acc, sizeof(state->acc));
if (state->bufferedSize >= XXH_STRIPE_LEN) {
size_t const nbStripes = (state->bufferedSize - 1) / XXH_STRIPE_LEN;
size_t nbStripesSoFar = state->nbStripesSoFar;
@@ -4823,8 +4933,8 @@ XXH3_digest_long (XXH64_hash_t* acc,
xxh_u8 lastStripe[XXH_STRIPE_LEN];
size_t const catchupSize = XXH_STRIPE_LEN - state->bufferedSize;
XXH_ASSERT(state->bufferedSize > 0); /* there is always some input buffered */
- memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize);
- memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize);
+ XXH_memcpy(lastStripe, state->buffer + sizeof(state->buffer) - catchupSize, catchupSize);
+ XXH_memcpy(lastStripe + catchupSize, state->buffer, state->bufferedSize);
XXH3_accumulate_512(acc,
lastStripe,
secret + state->secretLimit - XXH_SECRET_LASTACC_START);
@@ -4843,58 +4953,13 @@ XXH_PUBLIC_API XXH64_hash_t XXH3_64bits_digest (const XXH3_state_t* state)
(xxh_u64)state->totalLen * XXH_PRIME64_1);
}
/* totalLen <= XXH3_MIDSIZE_MAX: digesting a short input */
- if (state->seed)
+ if (state->useSeed)
return XXH3_64bits_withSeed(state->buffer, (size_t)state->totalLen, state->seed);
return XXH3_64bits_withSecret(state->buffer, (size_t)(state->totalLen),
secret, state->secretLimit + XXH_STRIPE_LEN);
}
-#define XXH_MIN(x, y) (((x) > (y)) ? (y) : (x))
-
-/*! @ingroup xxh3_family */
-XXH_PUBLIC_API void
-XXH3_generateSecret(void* secretBuffer, const void* customSeed, size_t customSeedSize)
-{
- XXH_ASSERT(secretBuffer != NULL);
- if (customSeedSize == 0) {
- memcpy(secretBuffer, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE);
- return;
- }
- XXH_ASSERT(customSeed != NULL);
-
- { size_t const segmentSize = sizeof(XXH128_hash_t);
- size_t const nbSegments = XXH_SECRET_DEFAULT_SIZE / segmentSize;
- XXH128_canonical_t scrambler;
- XXH64_hash_t seeds[12];
- size_t segnb;
- XXH_ASSERT(nbSegments == 12);
- XXH_ASSERT(segmentSize * nbSegments == XXH_SECRET_DEFAULT_SIZE); /* exact multiple */
- XXH128_canonicalFromHash(&scrambler, XXH128(customSeed, customSeedSize, 0));
-
- /*
- * Copy customSeed to seeds[], truncating or repeating as necessary.
- */
- { size_t toFill = XXH_MIN(customSeedSize, sizeof(seeds));
- size_t filled = toFill;
- memcpy(seeds, customSeed, toFill);
- while (filled < sizeof(seeds)) {
- toFill = XXH_MIN(filled, sizeof(seeds) - filled);
- memcpy((char*)seeds + filled, seeds, toFill);
- filled += toFill;
- } }
-
- /* generate secret */
- memcpy(secretBuffer, &scrambler, sizeof(scrambler));
- for (segnb=1; segnb < nbSegments; segnb++) {
- size_t const segmentStart = segnb * segmentSize;
- XXH128_canonical_t segment;
- XXH128_canonicalFromHash(&segment,
- XXH128(&scrambler, sizeof(scrambler), XXH_readLE64(seeds + segnb) + segnb) );
- memcpy((char*)secretBuffer + segmentStart, &segment, sizeof(segment));
- } }
-}
-
/* ==========================================
* XXH3 128 bits (a.k.a XXH128)
@@ -5196,9 +5261,10 @@ XXH3_hashLong_128b_default(const void* XXH_RESTRICT input, size_t len,
}
/*
- * It's important for performance that XXH3_hashLong is not inlined.
+ * It's important for performance to pass @secretLen (when it's static)
+ * to the compiler, so that it can properly optimize the vectorized loop.
*/
-XXH_NO_INLINE XXH128_hash_t
+XXH_FORCE_INLINE XXH128_hash_t
XXH3_hashLong_128b_withSecret(const void* XXH_RESTRICT input, size_t len,
XXH64_hash_t seed64,
const void* XXH_RESTRICT secret, size_t secretLen)
@@ -5293,6 +5359,15 @@ XXH3_128bits_withSeed(const void* input, size_t len, XXH64_hash_t seed)
/*! @ingroup xxh3_family */
XXH_PUBLIC_API XXH128_hash_t
+XXH3_128bits_withSecretandSeed(const void* input, size_t len, const void* secret, size_t secretSize, XXH64_hash_t seed)
+{
+ if (len <= XXH3_MIDSIZE_MAX)
+ return XXH3_128bits_internal(input, len, seed, XXH3_kSecret, sizeof(XXH3_kSecret), NULL);
+ return XXH3_hashLong_128b_withSecret(input, len, seed, secret, secretSize);
+}
+
+/*! @ingroup xxh3_family */
+XXH_PUBLIC_API XXH128_hash_t
XXH128(const void* input, size_t len, XXH64_hash_t seed)
{
return XXH3_128bits_withSeed(input, len, seed);
@@ -5302,7 +5377,7 @@ XXH128(const void* input, size_t len, XXH64_hash_t seed)
/* === XXH3 128-bit streaming === */
/*
- * All the functions are actually the same as for 64-bit streaming variant.
+ * All initialization and update functions are identical to 64-bit streaming variant.
* The only difference is the finalization routine.
*/
@@ -5310,31 +5385,28 @@ XXH128(const void* input, size_t len, XXH64_hash_t seed)
XXH_PUBLIC_API XXH_errorcode
XXH3_128bits_reset(XXH3_state_t* statePtr)
{
- if (statePtr == NULL) return XXH_ERROR;
- XXH3_reset_internal(statePtr, 0, XXH3_kSecret, XXH_SECRET_DEFAULT_SIZE);
- return XXH_OK;
+ return XXH3_64bits_reset(statePtr);
}
/*! @ingroup xxh3_family */
XXH_PUBLIC_API XXH_errorcode
XXH3_128bits_reset_withSecret(XXH3_state_t* statePtr, const void* secret, size_t secretSize)
{
- if (statePtr == NULL) return XXH_ERROR;
- XXH3_reset_internal(statePtr, 0, secret, secretSize);
- if (secret == NULL) return XXH_ERROR;
- if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;
- return XXH_OK;
+ return XXH3_64bits_reset_withSecret(statePtr, secret, secretSize);
}
/*! @ingroup xxh3_family */
XXH_PUBLIC_API XXH_errorcode
XXH3_128bits_reset_withSeed(XXH3_state_t* statePtr, XXH64_hash_t seed)
{
- if (statePtr == NULL) return XXH_ERROR;
- if (seed==0) return XXH3_128bits_reset(statePtr);
- if (seed != statePtr->seed) XXH3_initCustomSecret(statePtr->customSecret, seed);
- XXH3_reset_internal(statePtr, seed, NULL, XXH_SECRET_DEFAULT_SIZE);
- return XXH_OK;
+ return XXH3_64bits_reset_withSeed(statePtr, seed);
+}
+
+/*! @ingroup xxh3_family */
+XXH_PUBLIC_API XXH_errorcode
+XXH3_128bits_reset_withSecretandSeed(XXH3_state_t* statePtr, const void* secret, size_t secretSize, XXH64_hash_t seed)
+{
+ return XXH3_64bits_reset_withSecretandSeed(statePtr, secret, secretSize, seed);
}
/*! @ingroup xxh3_family */
@@ -5409,8 +5481,8 @@ XXH128_canonicalFromHash(XXH128_canonical_t* dst, XXH128_hash_t hash)
hash.high64 = XXH_swap64(hash.high64);
hash.low64 = XXH_swap64(hash.low64);
}
- memcpy(dst, &hash.high64, sizeof(hash.high64));
- memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64));
+ XXH_memcpy(dst, &hash.high64, sizeof(hash.high64));
+ XXH_memcpy((char*)dst + sizeof(hash.high64), &hash.low64, sizeof(hash.low64));
}
/*! @ingroup xxh3_family */
@@ -5423,6 +5495,69 @@ XXH128_hashFromCanonical(const XXH128_canonical_t* src)
return h;
}
+
+
+/* ==========================================
+ * Secret generators
+ * ==========================================
+ */
+#define XXH_MIN(x, y) (((x) > (y)) ? (y) : (x))
+
+static void XXH3_combine16(void* dst, XXH128_hash_t h128)
+{
+ XXH_writeLE64( dst, XXH_readLE64(dst) ^ h128.low64 );
+ XXH_writeLE64( (char*)dst+8, XXH_readLE64((char*)dst+8) ^ h128.high64 );
+}
+
+/*! @ingroup xxh3_family */
+XXH_PUBLIC_API XXH_errorcode
+XXH3_generateSecret(void* secretBuffer, size_t secretSize, const void* customSeed, size_t customSeedSize)
+{
+ XXH_ASSERT(secretBuffer != NULL);
+ if (secretBuffer == NULL) return XXH_ERROR;
+ XXH_ASSERT(secretSize >= XXH3_SECRET_SIZE_MIN);
+ if (secretSize < XXH3_SECRET_SIZE_MIN) return XXH_ERROR;
+ if (customSeedSize == 0) {
+ customSeed = XXH3_kSecret;
+ customSeedSize = XXH_SECRET_DEFAULT_SIZE;
+ }
+ XXH_ASSERT(customSeed != NULL);
+ if (customSeed == NULL) return XXH_ERROR;
+
+ /* Fill secretBuffer with a copy of customSeed - repeat as needed */
+ { size_t pos = 0;
+ while (pos < secretSize) {
+ size_t const toCopy = XXH_MIN((secretSize - pos), customSeedSize);
+ memcpy((char*)secretBuffer + pos, customSeed, toCopy);
+ pos += toCopy;
+ } }
+
+ { size_t const nbSeg16 = secretSize / 16;
+ size_t n;
+ XXH128_canonical_t scrambler;
+ XXH128_canonicalFromHash(&scrambler, XXH128(customSeed, customSeedSize, 0));
+ for (n=0; n<nbSeg16; n++) {
+ XXH128_hash_t const h128 = XXH128(&scrambler, sizeof(scrambler), n);
+ XXH3_combine16((char*)secretBuffer + n*16, h128);
+ }
+ /* last segment */
+ XXH3_combine16((char*)secretBuffer + secretSize - 16, XXH128_hashFromCanonical(&scrambler));
+ }
+ return XXH_OK;
+}
+
+/*! @ingroup xxh3_family */
+XXH_PUBLIC_API void
+XXH3_generateSecret_fromSeed(void* secretBuffer, XXH64_hash_t seed)
+{
+ XXH_ALIGN(XXH_SEC_ALIGN) xxh_u8 secret[XXH_SECRET_DEFAULT_SIZE];
+ XXH3_initCustomSecret(secret, seed);
+ XXH_ASSERT(secretBuffer != NULL);
+ memcpy(secretBuffer, secret, XXH_SECRET_DEFAULT_SIZE);
+}
+
+
+
/* Pop our optimization override from above */
#if XXH_VECTOR == XXH_AVX2 /* AVX2 */ \
&& defined(__GNUC__) && !defined(__clang__) /* GCC, not Clang */ \
@@ -5432,6 +5567,8 @@ XXH128_hashFromCanonical(const XXH128_canonical_t* src)
#endif /* XXH_NO_LONG_LONG */
+#endif /* XXH_NO_XXH3 */
+
/*!
* @}
*/
diff --git a/grpc/third_party/xxhash/xxhsum.1 b/grpc/third_party/xxhash/xxhsum.1
deleted file mode 100644
index dd17108f..00000000
--- a/grpc/third_party/xxhash/xxhsum.1
+++ /dev/null
@@ -1,165 +0,0 @@
-.
-.TH "XXHSUM" "1" "July 2020" "xxhsum 0.7.4" "User Commands"
-.
-.SH "NAME"
-\fBxxhsum\fR \- print or check xxHash non\-cryptographic checksums
-.
-.SH "SYNOPSIS"
-\fBxxhsum [<OPTION>] \.\.\. [<FILE>] \.\.\.\fR \fBxxhsum \-b [<OPTION>] \.\.\.\fR
-.
-.P
-\fBxxh32sum\fR is equivalent to \fBxxhsum \-H0\fR \fBxxh64sum\fR is equivalent to \fBxxhsum \-H1\fR \fBxxh128sum\fR is equivalent to \fBxxhsum \-H2\fR
-.
-.SH "DESCRIPTION"
-Print or check xxHash (32, 64 or 128 bits) checksums\. When no \fIFILE\fR, read standard input, except if it\'s the console\. When \fIFILE\fR is \fB\-\fR, read standard input even if it\'s the console\.
-.
-.P
-\fBxxhsum\fR supports a command line syntax similar but not identical to md5sum(1)\. Differences are: \fBxxhsum\fR doesn\'t have text/binary mode switch (\fB\-b\fR, \fB\-t\fR); \fBxxhsum\fR always treats files as binary file; \fBxxhsum\fR has a hash bit width switch (\fB\-H\fR);
-.
-.P
-As xxHash is a fast non\-cryptographic checksum algorithm, \fBxxhsum\fR should not be used for security related purposes\.
-.
-.P
-\fBxxhsum \-b\fR invokes benchmark mode\. See \fIOPTIONS\fR and \fIEXAMPLES\fR for details\.
-.
-.SH "OPTIONS"
-.
-.TP
-\fB\-V\fR, \fB\-\-version\fR
-Displays xxhsum version and exits
-.
-.TP
-\fB\-H\fR\fIHASHTYPE\fR
-Hash selection\. \fIHASHTYPE\fR means \fB0\fR=32bits, \fB1\fR=64bits, \fB2\fR=128bits\. Alternatively, \fIHASHTYPE\fR \fB32\fR=32bits, \fB64\fR=64bits, \fB128\fR=128bits\. Default value is \fB1\fR (64bits)
-.
-.TP
-\fB\-\-tag\fR
-Output in the BSD style\.
-.
-.TP
-\fB\-\-little\-endian\fR
-Set output hexadecimal checksum value as little endian convention\. By default, value is displayed as big endian\.
-.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-Displays help and exits
-.
-.P
-\fBThe following four options are useful only when verifying checksums (\fB\-c\fR)\fR
-.
-.TP
-\fB\-c\fR, \fB\-\-check\fR \fIFILE\fR
-Read xxHash sums from \fIFILE\fR and check them
-.
-.TP
-\fB\-q\fR, \fB\-\-quiet\fR
-Don\'t print OK for each successfully verified file
-.
-.TP
-\fB\-\-strict\fR
-Return an error code if any line in the file is invalid, not just if some checksums are wrong\. This policy is disabled by default, though UI will prompt an informational message if any line in the file is detected invalid\.
-.
-.TP
-\fB\-\-status\fR
-Don\'t output anything\. Status code shows success\.
-.
-.TP
-\fB\-w\fR, \fB\-\-warn\fR
-Emit a warning message about each improperly formatted checksum line\.
-.
-.P
-\fBThe following options are useful only benchmark purpose\fR
-.
-.TP
-\fB\-b\fR
-Benchmark mode\. See \fIEXAMPLES\fR for details\.
-.
-.TP
-\fB\-b#\fR
-Specify ID of variant to be tested\. Multiple variants can be selected, separated by a \',\' comma\.
-.
-.TP
-\fB\-B\fR\fIBLOCKSIZE\fR
-Only useful for benchmark mode (\fB\-b\fR)\. See \fIEXAMPLES\fR for details\. \fIBLOCKSIZE\fR specifies benchmark mode\'s test data block size in bytes\. Default value is 102400
-.
-.TP
-\fB\-i\fR\fIITERATIONS\fR
-Only useful for benchmark mode (\fB\-b\fR)\. See \fIEXAMPLES\fR for details\. \fIITERATIONS\fR specifies number of iterations in benchmark\. Single iteration lasts approximately 1000 milliseconds\. Default value is 3
-.
-.SH "EXIT STATUS"
-\fBxxhsum\fR exit \fB0\fR on success, \fB1\fR if at least one file couldn\'t be read or doesn\'t have the same checksum as the \fB\-c\fR option\.
-.
-.SH "EXAMPLES"
-Output xxHash (64bit) checksum values of specific files to standard output
-.
-.IP "" 4
-.
-.nf
-
-$ xxhsum \-H1 foo bar baz
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Output xxHash (32bit and 64bit) checksum values of specific files to standard output, and redirect it to \fBxyz\.xxh32\fR and \fBqux\.xxh64\fR
-.
-.IP "" 4
-.
-.nf
-
-$ xxhsum \-H0 foo bar baz > xyz\.xxh32
-$ xxhsum \-H1 foo bar baz > qux\.xxh64
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Read xxHash sums from specific files and check them
-.
-.IP "" 4
-.
-.nf
-
-$ xxhsum \-c xyz\.xxh32 qux\.xxh64
-.
-.fi
-.
-.IP "" 0
-.
-.P
-Benchmark xxHash algorithm\. By default, \fBxxhsum\fR benchmarks xxHash main variants on a synthetic sample of 100 KB, and print results into standard output\. The first column is the algorithm, the second column is the source data size in bytes, the third column is the number of hashes generated per second (throughput), and finally the last column translates speed in megabytes per second\.
-.
-.IP "" 4
-.
-.nf
-
-$ xxhsum \-b
-.
-.fi
-.
-.IP "" 0
-.
-.P
-In the following example, the sample to hash is set to 16384 bytes, the variants to be benched are selected by their IDs, and each benchmark test is repeated 10 times, for increased accuracy\.
-.
-.IP "" 4
-.
-.nf
-
-$ xxhsum \-b1,2,3 \-i10 \-B16384
-.
-.fi
-.
-.IP "" 0
-.
-.SH "BUGS"
-Report bugs at: https://github\.com/Cyan4973/xxHash/issues/
-.
-.SH "AUTHOR"
-Yann Collet
-.
-.SH "SEE ALSO"
-md5sum(1)
diff --git a/grpc/third_party/xxhash/xxhsum.1.md b/grpc/third_party/xxhash/xxhsum.1.md
deleted file mode 100644
index 85cd8fac..00000000
--- a/grpc/third_party/xxhash/xxhsum.1.md
+++ /dev/null
@@ -1,148 +0,0 @@
-xxhsum(1) -- print or check xxHash non-cryptographic checksums
-==============================================================
-
-SYNOPSIS
---------
-
-`xxhsum [<OPTION>] ... [<FILE>] ...`
-`xxhsum -b [<OPTION>] ...`
-
-`xxh32sum` is equivalent to `xxhsum -H0`
-`xxh64sum` is equivalent to `xxhsum -H1`
-`xxh128sum` is equivalent to `xxhsum -H2`
-
-
-DESCRIPTION
------------
-
-Print or check xxHash (32, 64 or 128 bits) checksums.
-When no <FILE>, read standard input, except if it's the console.
-When <FILE> is `-`, read standard input even if it's the console.
-
-`xxhsum` supports a command line syntax similar but not identical to md5sum(1).
-Differences are:
-`xxhsum` doesn't have text/binary mode switch (`-b`, `-t`);
-`xxhsum` always treats files as binary file;
-`xxhsum` has a hash bit width switch (`-H`);
-
-As xxHash is a fast non-cryptographic checksum algorithm,
-`xxhsum` should not be used for security related purposes.
-
-`xxhsum -b` invokes benchmark mode. See [OPTIONS](#OPTIONS) and [EXAMPLES](#EXAMPLES) for details.
-
-OPTIONS
--------
-
-* `-V`, `--version`:
- Displays xxhsum version and exits
-
-* `-H`<HASHTYPE>:
- Hash selection. <HASHTYPE> means `0`=32bits, `1`=64bits, `2`=128bits.
- Alternatively, <HASHTYPE> `32`=32bits, `64`=64bits, `128`=128bits.
- Default value is `1` (64bits)
-
-* `--tag`:
- Output in the BSD style.
-
-* `--little-endian`:
- Set output hexadecimal checksum value as little endian convention.
- By default, value is displayed as big endian.
-
-* `-h`, `--help`:
- Displays help and exits
-
-**The following four options are useful only when verifying checksums (`-c`)**
-
-* `-c`, `--check` <FILE>:
- Read xxHash sums from <FILE> and check them
-
-* `-q`, `--quiet`:
- Don't print OK for each successfully verified file
-
-* `--strict`:
- Return an error code if any line in the file is invalid,
- not just if some checksums are wrong.
- This policy is disabled by default,
- though UI will prompt an informational message
- if any line in the file is detected invalid.
-
-* `--status`:
- Don't output anything. Status code shows success.
-
-* `-w`, `--warn`:
- Emit a warning message about each improperly formatted checksum line.
-
-**The following options are useful only benchmark purpose**
-
-* `-b`:
- Benchmark mode. See [EXAMPLES](#EXAMPLES) for details.
-
-* `-b#`:
- Specify ID of variant to be tested.
- Multiple variants can be selected, separated by a ',' comma.
-
-* `-B`<BLOCKSIZE>:
- Only useful for benchmark mode (`-b`). See [EXAMPLES](#EXAMPLES) for details.
- <BLOCKSIZE> specifies benchmark mode's test data block size in bytes.
- Default value is 102400
-
-* `-i`<ITERATIONS>:
- Only useful for benchmark mode (`-b`). See [EXAMPLES](#EXAMPLES) for details.
- <ITERATIONS> specifies number of iterations in benchmark. Single iteration
- lasts approximately 1000 milliseconds. Default value is 3
-
-EXIT STATUS
------------
-
-`xxhsum` exit `0` on success, `1` if at least one file couldn't be read or
-doesn't have the same checksum as the `-c` option.
-
-EXAMPLES
---------
-
-Output xxHash (64bit) checksum values of specific files to standard output
-
- $ xxhsum -H1 foo bar baz
-
-Output xxHash (32bit and 64bit) checksum values of specific files to standard
-output, and redirect it to `xyz.xxh32` and `qux.xxh64`
-
- $ xxhsum -H0 foo bar baz > xyz.xxh32
- $ xxhsum -H1 foo bar baz > qux.xxh64
-
-Read xxHash sums from specific files and check them
-
- $ xxhsum -c xyz.xxh32 qux.xxh64
-
-Benchmark xxHash algorithm.
-By default, `xxhsum` benchmarks xxHash main variants
-on a synthetic sample of 100 KB,
-and print results into standard output.
-The first column is the algorithm,
-the second column is the source data size in bytes,
-the third column is the number of hashes generated per second (throughput),
-and finally the last column translates speed in megabytes per second.
-
- $ xxhsum -b
-
-In the following example,
-the sample to hash is set to 16384 bytes,
-the variants to be benched are selected by their IDs,
-and each benchmark test is repeated 10 times, for increased accuracy.
-
- $ xxhsum -b1,2,3 -i10 -B16384
-
-BUGS
-----
-
-Report bugs at: https://github.com/Cyan4973/xxHash/issues/
-
-AUTHOR
-------
-
-Yann Collet
-
-SEE ALSO
---------
-
-md5sum(1)
diff --git a/grpc/third_party/xxhash/xxhsum.c b/grpc/third_party/xxhash/xxhsum.c
deleted file mode 100644
index 82324091..00000000
--- a/grpc/third_party/xxhash/xxhsum.c
+++ /dev/null
@@ -1,1503 +0,0 @@
-/*
- * xxhsum - Command line interface for xxhash algorithms
- * Copyright (C) 2013-2020 Yann Collet
- *
- * GPL v2 License
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * You can contact the author at:
- * - xxHash homepage: https://www.xxhash.com
- * - xxHash source repository: https://github.com/Cyan4973/xxHash
- */
-
-/*
- * xxhsum:
- * Provides hash value of a file content, or a list of files, or stdin
- * Display convention is Big Endian, for both 32 and 64 bits algorithms
- */
-
-/* Transitional headers */
-#include "cli/xsum_config.h"
-#include "cli/xsum_arch.h"
-#include "cli/xsum_os_specific.h"
-#include "cli/xsum_output.h"
-#include "cli/xsum_sanity_check.h"
-#ifdef XXH_INLINE_ALL
-# include "cli/xsum_os_specific.c"
-# include "cli/xsum_output.c"
-# include "cli/xsum_sanity_check.c"
-#endif
-
-/* ************************************
- * Includes
- **************************************/
-#include <limits.h>
-#include <stdlib.h> /* malloc, calloc, free, exit */
-#include <string.h> /* strcmp, memcpy */
-#include <stdio.h> /* fprintf, fopen, ftello64, fread, stdin, stdout, _fileno (when present) */
-#include <sys/types.h> /* stat, stat64, _stat64 */
-#include <sys/stat.h> /* stat, stat64, _stat64 */
-#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */
-#include <assert.h> /* assert */
-#include <errno.h> /* errno */
-
-#define XXH_STATIC_LINKING_ONLY /* *_state_t */
-#include "xxhash.h"
-
-#ifdef XXHSUM_DISPATCH
-# include "xxh_x86dispatch.h"
-#endif
-
-static unsigned XSUM_isLittleEndian(void)
-{
- const union { XSUM_U32 u; XSUM_U8 c[4]; } one = { 1 }; /* don't use static: performance detrimental */
- return one.c[0];
-}
-
-static const int g_nbBits = (int)(sizeof(void*)*8);
-static const char g_lename[] = "little endian";
-static const char g_bename[] = "big endian";
-#define ENDIAN_NAME (XSUM_isLittleEndian() ? g_lename : g_bename)
-static const char author[] = "Yann Collet";
-#define WELCOME_MESSAGE(exename) "%s %s by %s \n", exename, XSUM_PROGRAM_VERSION, author
-#define FULL_WELCOME_MESSAGE(exename) "%s %s by %s \n" \
- "compiled as %i-bit %s %s with " XSUM_CC_VERSION_FMT " \n", \
- exename, XSUM_PROGRAM_VERSION, author, \
- g_nbBits, XSUM_ARCH, ENDIAN_NAME, XSUM_CC_VERSION
-
-#define KB *( 1<<10)
-#define MB *( 1<<20)
-#define GB *(1U<<30)
-
-static size_t XSUM_DEFAULT_SAMPLE_SIZE = 100 KB;
-#define NBLOOPS 3 /* Default number of benchmark iterations */
-#define TIMELOOP_S 1
-#define TIMELOOP (TIMELOOP_S * CLOCKS_PER_SEC) /* target timing per iteration */
-#define TIMELOOP_MIN (TIMELOOP / 2) /* minimum timing to validate a result */
-#define XXHSUM32_DEFAULT_SEED 0 /* Default seed for algo_xxh32 */
-#define XXHSUM64_DEFAULT_SEED 0 /* Default seed for algo_xxh64 */
-
-#define MAX_MEM (2 GB - 64 MB)
-
-static const char stdinName[] = "-";
-typedef enum { algo_xxh32=0, algo_xxh64=1, algo_xxh128=2 } AlgoSelected;
-static AlgoSelected g_defaultAlgo = algo_xxh64; /* required within main() & XSUM_usage() */
-
-/* <16 hex char> <SPC> <SPC> <filename> <'\0'>
- * '4096' is typical Linux PATH_MAX configuration. */
-#define DEFAULT_LINE_LENGTH (sizeof(XXH64_hash_t) * 2 + 2 + 4096 + 1)
-
-/* Maximum acceptable line length. */
-#define MAX_LINE_LENGTH (32 KB)
-
-
-/* ************************************
- * Display macros
- **************************************/
-
-
-/* ************************************
- * Local variables
- **************************************/
-static XSUM_U32 g_nbIterations = NBLOOPS;
-
-
-/* ************************************
- * Benchmark Functions
- **************************************/
-static clock_t XSUM_clockSpan( clock_t start )
-{
- return clock() - start; /* works even if overflow; Typical max span ~ 30 mn */
-}
-
-static size_t XSUM_findMaxMem(XSUM_U64 requiredMem)
-{
- size_t const step = 64 MB;
- void* testmem = NULL;
-
- requiredMem = (((requiredMem >> 26) + 1) << 26);
- requiredMem += 2*step;
- if (requiredMem > MAX_MEM) requiredMem = MAX_MEM;
-
- while (!testmem) {
- if (requiredMem > step) requiredMem -= step;
- else requiredMem >>= 1;
- testmem = malloc ((size_t)requiredMem);
- }
- free (testmem);
-
- /* keep some space available */
- if (requiredMem > step) requiredMem -= step;
- else requiredMem >>= 1;
-
- return (size_t)requiredMem;
-}
-
-/*
- * Allocates a string containing s1 and s2 concatenated. Acts like strdup.
- * The result must be freed.
- */
-static char* XSUM_strcatDup(const char* s1, const char* s2)
-{
- assert(s1 != NULL);
- assert(s2 != NULL);
- { size_t len1 = strlen(s1);
- size_t len2 = strlen(s2);
- char* buf = (char*)malloc(len1 + len2 + 1);
- if (buf != NULL) {
- /* strcpy(buf, s1) */
- memcpy(buf, s1, len1);
- /* strcat(buf, s2) */
- memcpy(buf + len1, s2, len2 + 1);
- }
- return buf;
- }
-}
-
-
-/*
- * A secret buffer used for benchmarking XXH3's withSecret variants.
- *
- * In order for the bench to be realistic, the secret buffer would need to be
- * pre-generated.
- *
- * Adding a pointer to the parameter list would be messy.
- */
-static XSUM_U8 g_benchSecretBuf[XXH3_SECRET_SIZE_MIN];
-
-/*
- * Wrappers for the benchmark.
- *
- * If you would like to add other hashes to the bench, create a wrapper and add
- * it to the g_hashesToBench table. It will automatically be added.
- */
-typedef XSUM_U32 (*hashFunction)(const void* buffer, size_t bufferSize, XSUM_U32 seed);
-
-static XSUM_U32 localXXH32(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- return XXH32(buffer, bufferSize, seed);
-}
-static XSUM_U32 localXXH64(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- return (XSUM_U32)XXH64(buffer, bufferSize, seed);
-}
-static XSUM_U32 localXXH3_64b(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- (void)seed;
- return (XSUM_U32)XXH3_64bits(buffer, bufferSize);
-}
-static XSUM_U32 localXXH3_64b_seeded(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- return (XSUM_U32)XXH3_64bits_withSeed(buffer, bufferSize, seed);
-}
-static XSUM_U32 localXXH3_64b_secret(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- (void)seed;
- return (XSUM_U32)XXH3_64bits_withSecret(buffer, bufferSize, g_benchSecretBuf, sizeof(g_benchSecretBuf));
-}
-static XSUM_U32 localXXH3_128b(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- (void)seed;
- return (XSUM_U32)(XXH3_128bits(buffer, bufferSize).low64);
-}
-static XSUM_U32 localXXH3_128b_seeded(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- return (XSUM_U32)(XXH3_128bits_withSeed(buffer, bufferSize, seed).low64);
-}
-static XSUM_U32 localXXH3_128b_secret(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- (void)seed;
- return (XSUM_U32)(XXH3_128bits_withSecret(buffer, bufferSize, g_benchSecretBuf, sizeof(g_benchSecretBuf)).low64);
-}
-static XSUM_U32 localXXH3_stream(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- XXH3_state_t state;
- (void)seed;
- XXH3_64bits_reset(&state);
- XXH3_64bits_update(&state, buffer, bufferSize);
- return (XSUM_U32)XXH3_64bits_digest(&state);
-}
-static XSUM_U32 localXXH3_stream_seeded(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- XXH3_state_t state;
- XXH3_INITSTATE(&state);
- XXH3_64bits_reset_withSeed(&state, (XXH64_hash_t)seed);
- XXH3_64bits_update(&state, buffer, bufferSize);
- return (XSUM_U32)XXH3_64bits_digest(&state);
-}
-static XSUM_U32 localXXH128_stream(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- XXH3_state_t state;
- (void)seed;
- XXH3_128bits_reset(&state);
- XXH3_128bits_update(&state, buffer, bufferSize);
- return (XSUM_U32)(XXH3_128bits_digest(&state).low64);
-}
-static XSUM_U32 localXXH128_stream_seeded(const void* buffer, size_t bufferSize, XSUM_U32 seed)
-{
- XXH3_state_t state;
- XXH3_INITSTATE(&state);
- XXH3_128bits_reset_withSeed(&state, (XXH64_hash_t)seed);
- XXH3_128bits_update(&state, buffer, bufferSize);
- return (XSUM_U32)(XXH3_128bits_digest(&state).low64);
-}
-
-
-typedef struct {
- const char* name;
- hashFunction func;
-} hashInfo;
-
-#define NB_HASHFUNC 12
-static const hashInfo g_hashesToBench[NB_HASHFUNC] = {
- { "XXH32", &localXXH32 },
- { "XXH64", &localXXH64 },
- { "XXH3_64b", &localXXH3_64b },
- { "XXH3_64b w/seed", &localXXH3_64b_seeded },
- { "XXH3_64b w/secret", &localXXH3_64b_secret },
- { "XXH128", &localXXH3_128b },
- { "XXH128 w/seed", &localXXH3_128b_seeded },
- { "XXH128 w/secret", &localXXH3_128b_secret },
- { "XXH3_stream", &localXXH3_stream },
- { "XXH3_stream w/seed",&localXXH3_stream_seeded },
- { "XXH128_stream", &localXXH128_stream },
- { "XXH128_stream w/seed",&localXXH128_stream_seeded },
-};
-
-#define NB_TESTFUNC (1 + 2 * NB_HASHFUNC)
-static char g_testIDs[NB_TESTFUNC] = { 0 };
-static const char k_testIDs_default[NB_TESTFUNC] = { 0,
- 1 /*XXH32*/, 0,
- 1 /*XXH64*/, 0,
- 1 /*XXH3*/, 0, 0, 0, 0, 0,
- 1 /*XXH128*/ };
-
-#define HASHNAME_MAX 29
-static void XSUM_benchHash(hashFunction h, const char* hName, int testID,
- const void* buffer, size_t bufferSize)
-{
- XSUM_U32 nbh_perIteration = (XSUM_U32)((300 MB) / (bufferSize+1)) + 1; /* first iteration conservatively aims for 300 MB/s */
- unsigned iterationNb, nbIterations = g_nbIterations + !g_nbIterations /* min 1 */;
- double fastestH = 100000000.;
- assert(HASHNAME_MAX > 2);
- XSUM_logVerbose(2, "\r%80s\r", ""); /* Clean display line */
-
- for (iterationNb = 1; iterationNb <= nbIterations; iterationNb++) {
- XSUM_U32 r=0;
- clock_t cStart;
-
- XSUM_logVerbose(2, "%2u-%-*.*s : %10u ->\r",
- iterationNb,
- HASHNAME_MAX, HASHNAME_MAX, hName,
- (unsigned)bufferSize);
- cStart = clock();
- while (clock() == cStart); /* starts clock() at its exact beginning */
- cStart = clock();
-
- { XSUM_U32 u;
- for (u=0; u<nbh_perIteration; u++)
- r += h(buffer, bufferSize, u);
- }
- if (r==0) XSUM_logVerbose(3,".\r"); /* do something with r to defeat compiler "optimizing" hash away */
-
- { clock_t const nbTicks = XSUM_clockSpan(cStart);
- double const ticksPerHash = ((double)nbTicks / TIMELOOP) / nbh_perIteration;
- /*
- * clock() is the only decent portable timer, but it isn't very
- * precise.
- *
- * Sometimes, this lack of precision is enough that the benchmark
- * finishes before there are enough ticks to get a meaningful result.
- *
- * For example, on a Core 2 Duo (without any sort of Turbo Boost),
- * the imprecise timer caused peculiar results like so:
- *
- * XXH3_64b 4800.0 MB/s // conveniently even
- * XXH3_64b unaligned 4800.0 MB/s
- * XXH3_64b seeded 9600.0 MB/s // magical 2x speedup?!
- * XXH3_64b seeded unaligned 4800.0 MB/s
- *
- * If we sense a suspiciously low number of ticks, we increase the
- * iterations until we can get something meaningful.
- */
- if (nbTicks < TIMELOOP_MIN) {
- /* Not enough time spent in benchmarking, risk of rounding bias */
- if (nbTicks == 0) { /* faster than resolution timer */
- nbh_perIteration *= 100;
- } else {
- /*
- * update nbh_perIteration so that the next round lasts
- * approximately 1 second.
- */
- double nbh_perSecond = (1 / ticksPerHash) + 1;
- if (nbh_perSecond > (double)(4000U<<20)) nbh_perSecond = (double)(4000U<<20); /* avoid overflow */
- nbh_perIteration = (XSUM_U32)nbh_perSecond;
- }
- /* g_nbIterations==0 => quick evaluation, no claim of accuracy */
- if (g_nbIterations>0) {
- iterationNb--; /* new round for a more accurate speed evaluation */
- continue;
- }
- }
- if (ticksPerHash < fastestH) fastestH = ticksPerHash;
- if (fastestH>0.) { /* avoid div by zero */
- XSUM_logVerbose(2, "%2u-%-*.*s : %10u -> %8.0f it/s (%7.1f MB/s) \r",
- iterationNb,
- HASHNAME_MAX, HASHNAME_MAX, hName,
- (unsigned)bufferSize,
- (double)1 / fastestH,
- ((double)bufferSize / (1 MB)) / fastestH);
- } }
- { double nbh_perSecond = (1 / fastestH) + 1;
- if (nbh_perSecond > (double)(4000U<<20)) nbh_perSecond = (double)(4000U<<20); /* avoid overflow */
- nbh_perIteration = (XSUM_U32)nbh_perSecond;
- }
- }
- XSUM_logVerbose(1, "%2i#%-*.*s : %10u -> %8.0f it/s (%7.1f MB/s) \n",
- testID,
- HASHNAME_MAX, HASHNAME_MAX, hName,
- (unsigned)bufferSize,
- (double)1 / fastestH,
- ((double)bufferSize / (1 MB)) / fastestH);
- if (XSUM_logLevel<1)
- XSUM_logVerbose(0, "%u, ", (unsigned)((double)1 / fastestH));
-}
-
-
-/*!
- * XSUM_benchMem():
- * buffer: Must be 16-byte aligned.
- * The real allocated size of buffer is supposed to be >= (bufferSize+3).
- * returns: 0 on success, 1 if error (invalid mode selected)
- */
-static void XSUM_benchMem(const void* buffer, size_t bufferSize)
-{
- assert((((size_t)buffer) & 15) == 0); /* ensure alignment */
- XSUM_fillTestBuffer(g_benchSecretBuf, sizeof(g_benchSecretBuf));
- { int i;
- for (i = 1; i < NB_TESTFUNC; i++) {
- int const hashFuncID = (i-1) / 2;
- assert(g_hashesToBench[hashFuncID].name != NULL);
- if (g_testIDs[i] == 0) continue;
- /* aligned */
- if ((i % 2) == 1) {
- XSUM_benchHash(g_hashesToBench[hashFuncID].func, g_hashesToBench[hashFuncID].name, i, buffer, bufferSize);
- }
- /* unaligned */
- if ((i % 2) == 0) {
- /* Append "unaligned". */
- char* const hashNameBuf = XSUM_strcatDup(g_hashesToBench[hashFuncID].name, " unaligned");
- assert(hashNameBuf != NULL);
- XSUM_benchHash(g_hashesToBench[hashFuncID].func, hashNameBuf, i, ((const char*)buffer)+3, bufferSize);
- free(hashNameBuf);
- }
- } }
-}
-
-static size_t XSUM_selectBenchedSize(const char* fileName)
-{
- XSUM_U64 const inFileSize = XSUM_getFileSize(fileName);
- size_t benchedSize = (size_t) XSUM_findMaxMem(inFileSize);
- if ((XSUM_U64)benchedSize > inFileSize) benchedSize = (size_t)inFileSize;
- if (benchedSize < inFileSize) {
- XSUM_log("Not enough memory for '%s' full size; testing %i MB only...\n", fileName, (int)(benchedSize>>20));
- }
- return benchedSize;
-}
-
-
-static int XSUM_benchFiles(char*const* fileNamesTable, int nbFiles)
-{
- int fileIdx;
- for (fileIdx=0; fileIdx<nbFiles; fileIdx++) {
- const char* const inFileName = fileNamesTable[fileIdx];
- assert(inFileName != NULL);
-
- { FILE* const inFile = XSUM_fopen( inFileName, "rb" );
- size_t const benchedSize = XSUM_selectBenchedSize(inFileName);
- char* const buffer = (char*)calloc(benchedSize+16+3, 1);
- void* const alignedBuffer = (buffer+15) - (((size_t)(buffer+15)) & 0xF); /* align on next 16 bytes */
-
- /* Checks */
- if (inFile==NULL){
- XSUM_log("Error: Could not open '%s': %s.\n", inFileName, strerror(errno));
- free(buffer);
- exit(11);
- }
- if(!buffer) {
- XSUM_log("\nError: Out of memory.\n");
- fclose(inFile);
- exit(12);
- }
-
- /* Fill input buffer */
- { size_t const readSize = fread(alignedBuffer, 1, benchedSize, inFile);
- fclose(inFile);
- if(readSize != benchedSize) {
- XSUM_log("\nError: Could not read '%s': %s.\n", inFileName, strerror(errno));
- free(buffer);
- exit(13);
- } }
-
- /* bench */
- XSUM_benchMem(alignedBuffer, benchedSize);
-
- free(buffer);
- } }
- return 0;
-}
-
-
-static int XSUM_benchInternal(size_t keySize)
-{
- void* const buffer = calloc(keySize+16+3, 1);
- if (buffer == NULL) {
- XSUM_log("\nError: Out of memory.\n");
- exit(12);
- }
-
- { const void* const alignedBuffer = ((char*)buffer+15) - (((size_t)((char*)buffer+15)) & 0xF); /* align on next 16 bytes */
-
- /* bench */
- XSUM_logVerbose(1, "Sample of ");
- if (keySize > 10 KB) {
- XSUM_logVerbose(1, "%u KB", (unsigned)(keySize >> 10));
- } else {
- XSUM_logVerbose(1, "%u bytes", (unsigned)keySize);
- }
- XSUM_logVerbose(1, "... \n");
-
- XSUM_benchMem(alignedBuffer, keySize);
- free(buffer);
- }
- return 0;
-}
-
-/* ********************************************************
-* File Hashing
-**********************************************************/
-
-/* for support of --little-endian display mode */
-static void XSUM_display_LittleEndian(const void* ptr, size_t length)
-{
- const XSUM_U8* const p = (const XSUM_U8*)ptr;
- size_t idx;
- for (idx=length-1; idx<length; idx--) /* intentional underflow to negative to detect end */
- XSUM_output("%02x", p[idx]);
-}
-
-static void XSUM_display_BigEndian(const void* ptr, size_t length)
-{
- const XSUM_U8* const p = (const XSUM_U8*)ptr;
- size_t idx;
- for (idx=0; idx<length; idx++)
- XSUM_output("%02x", p[idx]);
-}
-
-typedef union {
- XXH32_hash_t xxh32;
- XXH64_hash_t xxh64;
- XXH128_hash_t xxh128;
-} Multihash;
-
-/*
- * XSUM_hashStream:
- * Reads data from `inFile`, generating an incremental hash of type hashType,
- * using `buffer` of size `blockSize` for temporary storage.
- */
-static Multihash
-XSUM_hashStream(FILE* inFile,
- AlgoSelected hashType,
- void* buffer, size_t blockSize)
-{
- XXH32_state_t state32;
- XXH64_state_t state64;
- XXH3_state_t state128;
-
- /* Init */
- (void)XXH32_reset(&state32, XXHSUM32_DEFAULT_SEED);
- (void)XXH64_reset(&state64, XXHSUM64_DEFAULT_SEED);
- (void)XXH3_128bits_reset(&state128);
-
- /* Load file & update hash */
- { size_t readSize;
- while ((readSize = fread(buffer, 1, blockSize, inFile)) > 0) {
- switch(hashType)
- {
- case algo_xxh32:
- (void)XXH32_update(&state32, buffer, readSize);
- break;
- case algo_xxh64:
- (void)XXH64_update(&state64, buffer, readSize);
- break;
- case algo_xxh128:
- (void)XXH3_128bits_update(&state128, buffer, readSize);
- break;
- default:
- assert(0);
- }
- }
- if (ferror(inFile)) {
- XSUM_log("Error: a failure occurred reading the input file.\n");
- exit(1);
- } }
-
- { Multihash finalHash = {0};
- switch(hashType)
- {
- case algo_xxh32:
- finalHash.xxh32 = XXH32_digest(&state32);
- break;
- case algo_xxh64:
- finalHash.xxh64 = XXH64_digest(&state64);
- break;
- case algo_xxh128:
- finalHash.xxh128 = XXH3_128bits_digest(&state128);
- break;
- default:
- assert(0);
- }
- return finalHash;
- }
-}
-
- /* algo_xxh32, algo_xxh64, algo_xxh128 */
-static const char* XSUM_algoName[] = { "XXH32", "XXH64", "XXH128" };
-static const char* XSUM_algoLE_name[] = { "XXH32_LE", "XXH64_LE", "XXH128_LE" };
-static const size_t XSUM_algoLength[] = { 4, 8, 16 };
-
-#define XSUM_TABLE_ELT_SIZE(table) (sizeof(table) / sizeof(*table))
-
-typedef void (*XSUM_displayHash_f)(const void*, size_t); /* display function signature */
-
-static void XSUM_printLine_BSD_internal(const char* filename,
- const void* canonicalHash, const AlgoSelected hashType,
- const char* algoString[],
- XSUM_displayHash_f f_displayHash)
-{
- assert(0 <= hashType && hashType <= XSUM_TABLE_ELT_SIZE(XSUM_algoName));
- { const char* const typeString = algoString[hashType];
- const size_t hashLength = XSUM_algoLength[hashType];
- XSUM_output("%s (%s) = ", typeString, filename);
- f_displayHash(canonicalHash, hashLength);
- XSUM_output("\n");
-} }
-
-static void XSUM_printLine_BSD_LE(const char* filename, const void* canonicalHash, const AlgoSelected hashType)
-{
- XSUM_printLine_BSD_internal(filename, canonicalHash, hashType, XSUM_algoLE_name, XSUM_display_LittleEndian);
-}
-
-static void XSUM_printLine_BSD(const char* filename, const void* canonicalHash, const AlgoSelected hashType)
-{
- XSUM_printLine_BSD_internal(filename, canonicalHash, hashType, XSUM_algoName, XSUM_display_BigEndian);
-}
-
-static void XSUM_printLine_GNU_internal(const char* filename,
- const void* canonicalHash, const AlgoSelected hashType,
- XSUM_displayHash_f f_displayHash)
-{
- assert(0 <= hashType && hashType <= XSUM_TABLE_ELT_SIZE(XSUM_algoName));
- { const size_t hashLength = XSUM_algoLength[hashType];
- f_displayHash(canonicalHash, hashLength);
- XSUM_output(" %s\n", filename);
-} }
-
-static void XSUM_printLine_GNU(const char* filename,
- const void* canonicalHash, const AlgoSelected hashType)
-{
- XSUM_printLine_GNU_internal(filename, canonicalHash, hashType, XSUM_display_BigEndian);
-}
-
-static void XSUM_printLine_GNU_LE(const char* filename,
- const void* canonicalHash, const AlgoSelected hashType)
-{
- XSUM_printLine_GNU_internal(filename, canonicalHash, hashType, XSUM_display_LittleEndian);
-}
-
-typedef enum { big_endian, little_endian} Display_endianess;
-
-typedef enum { display_gnu, display_bsd } Display_convention;
-
-typedef void (*XSUM_displayLine_f)(const char*, const void*, AlgoSelected); /* line display signature */
-
-static XSUM_displayLine_f XSUM_kDisplayLine_fTable[2][2] = {
- { XSUM_printLine_GNU, XSUM_printLine_GNU_LE },
- { XSUM_printLine_BSD, XSUM_printLine_BSD_LE }
-};
-
-static int XSUM_hashFile(const char* fileName,
- const AlgoSelected hashType,
- const Display_endianess displayEndianess,
- const Display_convention convention)
-{
- size_t const blockSize = 64 KB;
- XSUM_displayLine_f const f_displayLine = XSUM_kDisplayLine_fTable[convention][displayEndianess];
- FILE* inFile;
- Multihash hashValue;
- assert(displayEndianess==big_endian || displayEndianess==little_endian);
- assert(convention==display_gnu || convention==display_bsd);
-
- /* Check file existence */
- if (fileName == stdinName) {
- inFile = stdin;
- fileName = "stdin";
- XSUM_setBinaryMode(stdin);
- } else {
- if (XSUM_isDirectory(fileName)) {
- XSUM_log("xxhsum: %s: Is a directory \n", fileName);
- return 1;
- }
- inFile = XSUM_fopen( fileName, "rb" );
- if (inFile==NULL) {
- XSUM_log("Error: Could not open '%s': %s. \n", fileName, strerror(errno));
- return 1;
- } }
-
- /* Memory allocation & streaming */
- { void* const buffer = malloc(blockSize);
- if (buffer == NULL) {
- XSUM_log("\nError: Out of memory.\n");
- fclose(inFile);
- return 1;
- }
-
- /* Stream file & update hash */
- hashValue = XSUM_hashStream(inFile, hashType, buffer, blockSize);
-
- fclose(inFile);
- free(buffer);
- }
-
- /* display Hash value in selected format */
- switch(hashType)
- {
- case algo_xxh32:
- { XXH32_canonical_t hcbe32;
- (void)XXH32_canonicalFromHash(&hcbe32, hashValue.xxh32);
- f_displayLine(fileName, &hcbe32, hashType);
- break;
- }
- case algo_xxh64:
- { XXH64_canonical_t hcbe64;
- (void)XXH64_canonicalFromHash(&hcbe64, hashValue.xxh64);
- f_displayLine(fileName, &hcbe64, hashType);
- break;
- }
- case algo_xxh128:
- { XXH128_canonical_t hcbe128;
- (void)XXH128_canonicalFromHash(&hcbe128, hashValue.xxh128);
- f_displayLine(fileName, &hcbe128, hashType);
- break;
- }
- default:
- assert(0); /* not possible */
- }
-
- return 0;
-}
-
-
-/*
- * XSUM_hashFiles:
- * If fnTotal==0, read from stdin instead.
- */
-static int XSUM_hashFiles(char*const * fnList, int fnTotal,
- AlgoSelected hashType,
- Display_endianess displayEndianess,
- Display_convention convention)
-{
- int fnNb;
- int result = 0;
-
- if (fnTotal==0)
- return XSUM_hashFile(stdinName, hashType, displayEndianess, convention);
-
- for (fnNb=0; fnNb<fnTotal; fnNb++)
- result |= XSUM_hashFile(fnList[fnNb], hashType, displayEndianess, convention);
- XSUM_logVerbose(2, "\r%70s\r", "");
- return result;
-}
-
-
-typedef enum {
- GetLine_ok,
- GetLine_eof,
- GetLine_exceedMaxLineLength,
- GetLine_outOfMemory
-} GetLineResult;
-
-typedef enum {
- CanonicalFromString_ok,
- CanonicalFromString_invalidFormat
-} CanonicalFromStringResult;
-
-typedef enum {
- ParseLine_ok,
- ParseLine_invalidFormat
-} ParseLineResult;
-
-typedef enum {
- LineStatus_hashOk,
- LineStatus_hashFailed,
- LineStatus_failedToOpen
-} LineStatus;
-
-typedef union {
- XXH32_canonical_t xxh32;
- XXH64_canonical_t xxh64;
- XXH128_canonical_t xxh128;
-} Canonical;
-
-typedef struct {
- Canonical canonical;
- const char* filename;
- int xxhBits; /* canonical type: 32:xxh32, 64:xxh64, 128:xxh128 */
-} ParsedLine;
-
-typedef struct {
- unsigned long nProperlyFormattedLines;
- unsigned long nImproperlyFormattedLines;
- unsigned long nMismatchedChecksums;
- unsigned long nOpenOrReadFailures;
- unsigned long nMixedFormatLines;
- int quit;
-} ParseFileReport;
-
-typedef struct {
- const char* inFileName;
- FILE* inFile;
- int lineMax;
- char* lineBuf;
- size_t blockSize;
- char* blockBuf;
- XSUM_U32 strictMode;
- XSUM_U32 statusOnly;
- XSUM_U32 warn;
- XSUM_U32 quiet;
- ParseFileReport report;
-} ParseFileArg;
-
-
-/*
- * Reads a line from stream `inFile`.
- * Returns GetLine_ok, if it reads line successfully.
- * Returns GetLine_eof, if stream reaches EOF.
- * Returns GetLine_exceedMaxLineLength, if line length is longer than MAX_LINE_LENGTH.
- * Returns GetLine_outOfMemory, if line buffer memory allocation failed.
- */
-static GetLineResult XSUM_getLine(char** lineBuf, int* lineMax, FILE* inFile)
-{
- GetLineResult result = GetLine_ok;
- size_t len = 0;
-
- if ((*lineBuf == NULL) || (*lineMax<1)) {
- free(*lineBuf); /* in case it's != NULL */
- *lineMax = 0;
- *lineBuf = (char*)malloc(DEFAULT_LINE_LENGTH);
- if(*lineBuf == NULL) return GetLine_outOfMemory;
- *lineMax = DEFAULT_LINE_LENGTH;
- }
-
- for (;;) {
- const int c = fgetc(inFile);
- if (c == EOF) {
- /*
- * If we meet EOF before first character, returns GetLine_eof,
- * otherwise GetLine_ok.
- */
- if (len == 0) result = GetLine_eof;
- break;
- }
-
- /* Make enough space for len+1 (for final NUL) bytes. */
- if (len+1 >= (size_t)*lineMax) {
- char* newLineBuf = NULL;
- size_t newBufSize = (size_t)*lineMax;
-
- newBufSize += (newBufSize/2) + 1; /* x 1.5 */
- if (newBufSize > MAX_LINE_LENGTH) newBufSize = MAX_LINE_LENGTH;
- if (len+1 >= newBufSize) return GetLine_exceedMaxLineLength;
-
- newLineBuf = (char*) realloc(*lineBuf, newBufSize);
- if (newLineBuf == NULL) return GetLine_outOfMemory;
-
- *lineBuf = newLineBuf;
- *lineMax = (int)newBufSize;
- }
-
- if (c == '\n') break;
- (*lineBuf)[len++] = (char) c;
- }
-
- (*lineBuf)[len] = '\0';
- return result;
-}
-
-
-/*
- * Converts one hexadecimal character to integer.
- * Returns -1 if the given character is not hexadecimal.
- */
-static int charToHex(char c)
-{
- int result = -1;
- if (c >= '0' && c <= '9') {
- result = (int) (c - '0');
- } else if (c >= 'A' && c <= 'F') {
- result = (int) (c - 'A') + 0x0a;
- } else if (c >= 'a' && c <= 'f') {
- result = (int) (c - 'a') + 0x0a;
- }
- return result;
-}
-
-
-/*
- * Converts canonical ASCII hexadecimal string `hashStr`
- * to the big endian binary representation in unsigned char array `dst`.
- *
- * Returns CanonicalFromString_invalidFormat if hashStr is not well formatted.
- * Returns CanonicalFromString_ok if hashStr is parsed successfully.
- */
-static CanonicalFromStringResult XSUM_canonicalFromString(unsigned char* dst,
- size_t dstSize,
- const char* hashStr,
- int reverseBytes)
-{
- size_t i;
- for (i = 0; i < dstSize; ++i) {
- int h0, h1;
- size_t j = reverseBytes ? dstSize - i - 1 : i;
-
- h0 = charToHex(hashStr[j*2 + 0]);
- if (h0 < 0) return CanonicalFromString_invalidFormat;
-
- h1 = charToHex(hashStr[j*2 + 1]);
- if (h1 < 0) return CanonicalFromString_invalidFormat;
-
- dst[i] = (unsigned char) ((h0 << 4) | h1);
- }
- return CanonicalFromString_ok;
-}
-
-
-/*
- * Parse single line of xxHash checksum file.
- * Returns ParseLine_invalidFormat if the line is not well formatted.
- * Returns ParseLine_ok if the line is parsed successfully.
- * And members of XSUM_parseLine will be filled by parsed values.
- *
- * - line must be terminated with '\0' without a trailing newline.
- * - Since parsedLine.filename will point within given argument `line`,
- * users must keep `line`s content when they are using parsedLine.
- * - The line may be modified to carve up the information it contains.
- *
- * xxHash checksum lines should have the following format:
- *
- * <8, 16, or 32 hexadecimal char> <space> <space> <filename...> <'\0'>
- *
- * or:
- *
- * <algorithm> <' ('> <filename> <') = '> <hexstring> <'\0'>
- */
-static ParseLineResult XSUM_parseLine(ParsedLine* parsedLine, char* line, int rev)
-{
- char* const firstSpace = strchr(line, ' ');
- const char* hash_ptr;
- size_t hash_len;
-
- parsedLine->filename = NULL;
- parsedLine->xxhBits = 0;
-
- if (firstSpace == NULL || !firstSpace[1]) return ParseLine_invalidFormat;
-
- if (firstSpace[1] == '(') {
- char* lastSpace = strrchr(line, ' ');
- if (lastSpace - firstSpace < 5) return ParseLine_invalidFormat;
- if (lastSpace[-1] != '=' || lastSpace[-2] != ' ' || lastSpace[-3] != ')') return ParseLine_invalidFormat;
- lastSpace[-3] = '\0'; /* Terminate the filename */
- *firstSpace = '\0';
- rev = strstr(line, "_LE") != NULL; /* was output little-endian */
- hash_ptr = lastSpace + 1;
- hash_len = strlen(hash_ptr);
- /* NOTE: This currently ignores the hash description at the start of the string.
- * In the future we should parse it and verify that it matches the hash length.
- * It could also be used to allow both XXH64 & XXH3_64bits to be differentiated. */
- } else {
- hash_ptr = line;
- hash_len = (size_t)(firstSpace - line);
- }
-
- switch (hash_len)
- {
- case 8:
- { XXH32_canonical_t* xxh32c = &parsedLine->canonical.xxh32;
- if (XSUM_canonicalFromString(xxh32c->digest, sizeof(xxh32c->digest), hash_ptr, rev)
- != CanonicalFromString_ok) {
- return ParseLine_invalidFormat;
- }
- parsedLine->xxhBits = 32;
- break;
- }
-
- case 16:
- { XXH64_canonical_t* xxh64c = &parsedLine->canonical.xxh64;
- if (XSUM_canonicalFromString(xxh64c->digest, sizeof(xxh64c->digest), hash_ptr, rev)
- != CanonicalFromString_ok) {
- return ParseLine_invalidFormat;
- }
- parsedLine->xxhBits = 64;
- break;
- }
-
- case 32:
- { XXH128_canonical_t* xxh128c = &parsedLine->canonical.xxh128;
- if (XSUM_canonicalFromString(xxh128c->digest, sizeof(xxh128c->digest), hash_ptr, rev)
- != CanonicalFromString_ok) {
- return ParseLine_invalidFormat;
- }
- parsedLine->xxhBits = 128;
- break;
- }
-
- default:
- return ParseLine_invalidFormat;
- break;
- }
-
- /* note : skipping second separation character, which can be anything,
- * allowing insertion of custom markers such as '*' */
- parsedLine->filename = firstSpace + 2;
- return ParseLine_ok;
-}
-
-
-/*!
- * Parse xxHash checksum file.
- */
-static void XSUM_parseFile1(ParseFileArg* XSUM_parseFileArg, int rev)
-{
- const char* const inFileName = XSUM_parseFileArg->inFileName;
- ParseFileReport* const report = &XSUM_parseFileArg->report;
-
- unsigned long lineNumber = 0;
- memset(report, 0, sizeof(*report));
-
- while (!report->quit) {
- LineStatus lineStatus = LineStatus_hashFailed;
- ParsedLine parsedLine;
- memset(&parsedLine, 0, sizeof(parsedLine));
-
- lineNumber++;
- if (lineNumber == 0) {
- /* This is unlikely happen, but md5sum.c has this error check. */
- XSUM_log("%s: Error: Too many checksum lines\n", inFileName);
- report->quit = 1;
- break;
- }
-
- { GetLineResult const XSUM_getLineResult = XSUM_getLine(&XSUM_parseFileArg->lineBuf,
- &XSUM_parseFileArg->lineMax,
- XSUM_parseFileArg->inFile);
- if (XSUM_getLineResult != GetLine_ok) {
- if (XSUM_getLineResult == GetLine_eof) break;
-
- switch (XSUM_getLineResult)
- {
- case GetLine_ok:
- case GetLine_eof:
- /* These cases never happen. See above XSUM_getLineResult related "if"s.
- They exist just for make gcc's -Wswitch-enum happy. */
- assert(0);
- break;
-
- default:
- XSUM_log("%s:%lu: Error: Unknown error.\n", inFileName, lineNumber);
- break;
-
- case GetLine_exceedMaxLineLength:
- XSUM_log("%s:%lu: Error: Line too long.\n", inFileName, lineNumber);
- break;
-
- case GetLine_outOfMemory:
- XSUM_log("%s:%lu: Error: Out of memory.\n", inFileName, lineNumber);
- break;
- }
- report->quit = 1;
- break;
- } }
-
- if (XSUM_parseLine(&parsedLine, XSUM_parseFileArg->lineBuf, rev) != ParseLine_ok) {
- report->nImproperlyFormattedLines++;
- if (XSUM_parseFileArg->warn) {
- XSUM_log("%s:%lu: Error: Improperly formatted checksum line.\n",
- inFileName, lineNumber);
- }
- continue;
- }
-
- report->nProperlyFormattedLines++;
-
- do {
- FILE* const fp = XSUM_fopen(parsedLine.filename, "rb");
- if (fp == NULL) {
- lineStatus = LineStatus_failedToOpen;
- break;
- }
- lineStatus = LineStatus_hashFailed;
- switch (parsedLine.xxhBits)
- {
- case 32:
- { Multihash const xxh = XSUM_hashStream(fp, algo_xxh32, XSUM_parseFileArg->blockBuf, XSUM_parseFileArg->blockSize);
- if (xxh.xxh32 == XXH32_hashFromCanonical(&parsedLine.canonical.xxh32)) {
- lineStatus = LineStatus_hashOk;
- } }
- break;
-
- case 64:
- { Multihash const xxh = XSUM_hashStream(fp, algo_xxh64, XSUM_parseFileArg->blockBuf, XSUM_parseFileArg->blockSize);
- if (xxh.xxh64 == XXH64_hashFromCanonical(&parsedLine.canonical.xxh64)) {
- lineStatus = LineStatus_hashOk;
- } }
- break;
-
- case 128:
- { Multihash const xxh = XSUM_hashStream(fp, algo_xxh128, XSUM_parseFileArg->blockBuf, XSUM_parseFileArg->blockSize);
- if (XXH128_isEqual(xxh.xxh128, XXH128_hashFromCanonical(&parsedLine.canonical.xxh128))) {
- lineStatus = LineStatus_hashOk;
- } }
- break;
-
- default:
- break;
- }
- fclose(fp);
- } while (0);
-
- switch (lineStatus)
- {
- default:
- XSUM_log("%s: Error: Unknown error.\n", inFileName);
- report->quit = 1;
- break;
-
- case LineStatus_failedToOpen:
- report->nOpenOrReadFailures++;
- if (!XSUM_parseFileArg->statusOnly) {
- XSUM_output("%s:%lu: Could not open or read '%s': %s.\n",
- inFileName, lineNumber, parsedLine.filename, strerror(errno));
- }
- break;
-
- case LineStatus_hashOk:
- case LineStatus_hashFailed:
- { int b = 1;
- if (lineStatus == LineStatus_hashOk) {
- /* If --quiet is specified, don't display "OK" */
- if (XSUM_parseFileArg->quiet) b = 0;
- } else {
- report->nMismatchedChecksums++;
- }
-
- if (b && !XSUM_parseFileArg->statusOnly) {
- XSUM_output("%s: %s\n", parsedLine.filename
- , lineStatus == LineStatus_hashOk ? "OK" : "FAILED");
- } }
- break;
- }
- } /* while (!report->quit) */
-}
-
-
-/* Parse xxHash checksum file.
- * Returns 1, if all procedures were succeeded.
- * Returns 0, if any procedures was failed.
- *
- * If strictMode != 0, return error code if any line is invalid.
- * If statusOnly != 0, don't generate any output.
- * If warn != 0, print a warning message to stderr.
- * If quiet != 0, suppress "OK" line.
- *
- * "All procedures are succeeded" means:
- * - Checksum file contains at least one line and less than SIZE_T_MAX lines.
- * - All files are properly opened and read.
- * - All hash values match with its content.
- * - (strict mode) All lines in checksum file are consistent and well formatted.
- */
-static int XSUM_checkFile(const char* inFileName,
- const Display_endianess displayEndianess,
- XSUM_U32 strictMode,
- XSUM_U32 statusOnly,
- XSUM_U32 warn,
- XSUM_U32 quiet)
-{
- int result = 0;
- FILE* inFile = NULL;
- ParseFileArg XSUM_parseFileArgBody;
- ParseFileArg* const XSUM_parseFileArg = &XSUM_parseFileArgBody;
- ParseFileReport* const report = &XSUM_parseFileArg->report;
-
- /* note: stdinName is special constant pointer. It is not a string. */
- if (inFileName == stdinName) {
- /*
- * Note: Since we expect text input for xxhash -c mode,
- * we don't set binary mode for stdin.
- */
- inFileName = "stdin";
- inFile = stdin;
- } else {
- inFile = XSUM_fopen( inFileName, "rt" );
- }
-
- if (inFile == NULL) {
- XSUM_log("Error: Could not open '%s': %s\n", inFileName, strerror(errno));
- return 0;
- }
-
- XSUM_parseFileArg->inFileName = inFileName;
- XSUM_parseFileArg->inFile = inFile;
- XSUM_parseFileArg->lineMax = DEFAULT_LINE_LENGTH;
- XSUM_parseFileArg->lineBuf = (char*) malloc((size_t)XSUM_parseFileArg->lineMax);
- XSUM_parseFileArg->blockSize = 64 * 1024;
- XSUM_parseFileArg->blockBuf = (char*) malloc(XSUM_parseFileArg->blockSize);
- XSUM_parseFileArg->strictMode = strictMode;
- XSUM_parseFileArg->statusOnly = statusOnly;
- XSUM_parseFileArg->warn = warn;
- XSUM_parseFileArg->quiet = quiet;
-
- if ( (XSUM_parseFileArg->lineBuf == NULL)
- || (XSUM_parseFileArg->blockBuf == NULL) ) {
- XSUM_log("Error: : memory allocation failed \n");
- exit(1);
- }
- XSUM_parseFile1(XSUM_parseFileArg, displayEndianess != big_endian);
-
- free(XSUM_parseFileArg->blockBuf);
- free(XSUM_parseFileArg->lineBuf);
-
- if (inFile != stdin) fclose(inFile);
-
- /* Show error/warning messages. All messages are copied from md5sum.c
- */
- if (report->nProperlyFormattedLines == 0) {
- XSUM_log("%s: no properly formatted xxHash checksum lines found\n", inFileName);
- } else if (!statusOnly) {
- if (report->nImproperlyFormattedLines) {
- XSUM_output("%lu %s improperly formatted\n"
- , report->nImproperlyFormattedLines
- , report->nImproperlyFormattedLines == 1 ? "line is" : "lines are");
- }
- if (report->nOpenOrReadFailures) {
- XSUM_output("%lu listed %s could not be read\n"
- , report->nOpenOrReadFailures
- , report->nOpenOrReadFailures == 1 ? "file" : "files");
- }
- if (report->nMismatchedChecksums) {
- XSUM_output("%lu computed %s did NOT match\n"
- , report->nMismatchedChecksums
- , report->nMismatchedChecksums == 1 ? "checksum" : "checksums");
- } }
-
- /* Result (exit) code logic is copied from
- * gnu coreutils/src/md5sum.c digest_check() */
- result = report->nProperlyFormattedLines != 0
- && report->nMismatchedChecksums == 0
- && report->nOpenOrReadFailures == 0
- && (!strictMode || report->nImproperlyFormattedLines == 0)
- && report->quit == 0;
- return result;
-}
-
-
-static int XSUM_checkFiles(char*const* fnList, int fnTotal,
- const Display_endianess displayEndianess,
- XSUM_U32 strictMode,
- XSUM_U32 statusOnly,
- XSUM_U32 warn,
- XSUM_U32 quiet)
-{
- int ok = 1;
-
- /* Special case for stdinName "-",
- * note: stdinName is not a string. It's special pointer. */
- if (fnTotal==0) {
- ok &= XSUM_checkFile(stdinName, displayEndianess, strictMode, statusOnly, warn, quiet);
- } else {
- int fnNb;
- for (fnNb=0; fnNb<fnTotal; fnNb++)
- ok &= XSUM_checkFile(fnList[fnNb], displayEndianess, strictMode, statusOnly, warn, quiet);
- }
- return ok ? 0 : 1;
-}
-
-
-/* ********************************************************
-* Main
-**********************************************************/
-
-static int XSUM_usage(const char* exename)
-{
- XSUM_log( WELCOME_MESSAGE(exename) );
- XSUM_log( "Print or verify checksums using fast non-cryptographic algorithm xxHash \n\n" );
- XSUM_log( "Usage: %s [options] [files] \n\n", exename);
- XSUM_log( "When no filename provided or when '-' is provided, uses stdin as input. \n");
- XSUM_log( "Options: \n");
- XSUM_log( " -H# algorithm selection: 0,1,2 or 32,64,128 (default: %i) \n", (int)g_defaultAlgo);
- XSUM_log( " -c, --check read xxHash checksum from [files] and check them \n");
- XSUM_log( " -h, --help display a long help page about advanced options \n");
- return 0;
-}
-
-
-static int XSUM_usage_advanced(const char* exename)
-{
- XSUM_usage(exename);
- XSUM_log( "Advanced :\n");
- XSUM_log( " -V, --version Display version information \n");
- XSUM_log( " --tag Produce BSD-style checksum lines \n");
- XSUM_log( " --little-endian Checksum values use little endian convention (default: big endian) \n");
- XSUM_log( " -b Run benchmark \n");
- XSUM_log( " -b# Bench only algorithm variant # \n");
- XSUM_log( " -i# Number of times to run the benchmark (default: %u) \n", (unsigned)g_nbIterations);
- XSUM_log( " -q, --quiet Don't display version header in benchmark mode \n");
- XSUM_log( "\n");
- XSUM_log( "The following four options are useful only when verifying checksums (-c): \n");
- XSUM_log( " -q, --quiet Don't print OK for each successfully verified file \n");
- XSUM_log( " --status Don't output anything, status code shows success \n");
- XSUM_log( " --strict Exit non-zero for improperly formatted checksum lines \n");
- XSUM_log( " --warn Warn about improperly formatted checksum lines \n");
- return 0;
-}
-
-static int XSUM_badusage(const char* exename)
-{
- XSUM_log("Wrong parameters\n\n");
- XSUM_usage(exename);
- return 1;
-}
-
-static void errorOut(const char* msg)
-{
- XSUM_log("%s \n", msg);
- exit(1);
-}
-
-static const char* XSUM_lastNameFromPath(const char* path)
-{
- const char* name = path;
- if (strrchr(name, '/')) name = strrchr(name, '/') + 1;
- if (strrchr(name, '\\')) name = strrchr(name, '\\') + 1; /* windows */
- return name;
-}
-
-/*!
- * XSUM_readU32FromCharChecked():
- * @return 0 if success, and store the result in *value.
- * Allows and interprets K, KB, KiB, M, MB and MiB suffix.
- * Will also modify `*stringPtr`, advancing it to position where it stopped reading.
- * @return 1 if an overflow error occurs
- */
-static int XSUM_readU32FromCharChecked(const char** stringPtr, XSUM_U32* value)
-{
- static const XSUM_U32 max = (((XSUM_U32)(-1)) / 10) - 1;
- XSUM_U32 result = 0;
- while ((**stringPtr >='0') && (**stringPtr <='9')) {
- if (result > max) return 1; /* overflow error */
- result *= 10;
- result += (XSUM_U32)(**stringPtr - '0');
- (*stringPtr)++ ;
- }
- if ((**stringPtr=='K') || (**stringPtr=='M')) {
- XSUM_U32 const maxK = ((XSUM_U32)(-1)) >> 10;
- if (result > maxK) return 1; /* overflow error */
- result <<= 10;
- if (**stringPtr=='M') {
- if (result > maxK) return 1; /* overflow error */
- result <<= 10;
- }
- (*stringPtr)++; /* skip `K` or `M` */
- if (**stringPtr=='i') (*stringPtr)++;
- if (**stringPtr=='B') (*stringPtr)++;
- }
- *value = result;
- return 0;
-}
-
-/*!
- * XSUM_readU32FromChar():
- * @return: unsigned integer value read from input in `char` format.
- * allows and interprets K, KB, KiB, M, MB and MiB suffix.
- * Will also modify `*stringPtr`, advancing it to position where it stopped reading.
- * Note: function will exit() program if digit sequence overflows
- */
-static XSUM_U32 XSUM_readU32FromChar(const char** stringPtr) {
- XSUM_U32 result;
- if (XSUM_readU32FromCharChecked(stringPtr, &result)) {
- static const char errorMsg[] = "Error: numeric value too large";
- errorOut(errorMsg);
- }
- return result;
-}
-
-XSUM_API int XSUM_main(int argc, char* argv[])
-{
- int i, filenamesStart = 0;
- const char* const exename = XSUM_lastNameFromPath(argv[0]);
- XSUM_U32 benchmarkMode = 0;
- XSUM_U32 fileCheckMode = 0;
- XSUM_U32 strictMode = 0;
- XSUM_U32 statusOnly = 0;
- XSUM_U32 warn = 0;
- int explicitStdin = 0;
- XSUM_U32 selectBenchIDs= 0; /* 0 == use default k_testIDs_default, kBenchAll == bench all */
- static const XSUM_U32 kBenchAll = 99;
- size_t keySize = XSUM_DEFAULT_SAMPLE_SIZE;
- AlgoSelected algo = g_defaultAlgo;
- Display_endianess displayEndianess = big_endian;
- Display_convention convention = display_gnu;
-
- /* special case: xxhNNsum default to NN bits checksum */
- if (strstr(exename, "xxh32sum") != NULL) algo = g_defaultAlgo = algo_xxh32;
- if (strstr(exename, "xxh64sum") != NULL) algo = g_defaultAlgo = algo_xxh64;
- if (strstr(exename, "xxh128sum") != NULL) algo = g_defaultAlgo = algo_xxh128;
-
- for (i=1; i<argc; i++) {
- const char* argument = argv[i];
- assert(argument != NULL);
-
- if (!strcmp(argument, "--check")) { fileCheckMode = 1; continue; }
- if (!strcmp(argument, "--benchmark-all")) { benchmarkMode = 1; selectBenchIDs = kBenchAll; continue; }
- if (!strcmp(argument, "--bench-all")) { benchmarkMode = 1; selectBenchIDs = kBenchAll; continue; }
- if (!strcmp(argument, "--quiet")) { XSUM_logLevel--; continue; }
- if (!strcmp(argument, "--little-endian")) { displayEndianess = little_endian; continue; }
- if (!strcmp(argument, "--strict")) { strictMode = 1; continue; }
- if (!strcmp(argument, "--status")) { statusOnly = 1; continue; }
- if (!strcmp(argument, "--warn")) { warn = 1; continue; }
- if (!strcmp(argument, "--help")) { return XSUM_usage_advanced(exename); }
- if (!strcmp(argument, "--version")) { XSUM_log(FULL_WELCOME_MESSAGE(exename)); XSUM_sanityCheck(); return 0; }
- if (!strcmp(argument, "--tag")) { convention = display_bsd; continue; }
-
- if (!strcmp(argument, "--")) {
- if (filenamesStart==0 && i!=argc-1) filenamesStart=i+1; /* only supports a continuous list of filenames */
- break; /* treat rest of arguments as strictly file names */
- }
- if (*argument != '-') {
- if (filenamesStart==0) filenamesStart=i; /* only supports a continuous list of filenames */
- break; /* treat rest of arguments as strictly file names */
- }
-
- /* command selection */
- argument++; /* note: *argument=='-' */
- if (*argument == 0) explicitStdin = 1;
-
- while (*argument != 0) {
- switch(*argument)
- {
- /* Display version */
- case 'V':
- XSUM_log(FULL_WELCOME_MESSAGE(exename)); return 0;
-
- /* Display help on XSUM_usage */
- case 'h':
- return XSUM_usage_advanced(exename);
-
- /* select hash algorithm */
- case 'H': argument++;
- switch(XSUM_readU32FromChar(&argument)) {
- case 0 :
- case 32: algo = algo_xxh32; break;
- case 1 :
- case 64: algo = algo_xxh64; break;
- case 2 :
- case 128: algo = algo_xxh128; break;
- default:
- return XSUM_badusage(exename);
- }
- break;
-
- /* File check mode */
- case 'c':
- fileCheckMode=1;
- argument++;
- break;
-
- /* Warning mode (file check mode only, alias of "--warning") */
- case 'w':
- warn=1;
- argument++;
- break;
-
- /* Trigger benchmark mode */
- case 'b':
- argument++;
- benchmarkMode = 1;
- do {
- if (*argument == ',') argument++;
- selectBenchIDs = XSUM_readU32FromChar(&argument); /* select one specific test */
- if (selectBenchIDs < NB_TESTFUNC) {
- g_testIDs[selectBenchIDs] = 1;
- } else
- selectBenchIDs = kBenchAll;
- } while (*argument == ',');
- break;
-
- /* Modify Nb Iterations (benchmark only) */
- case 'i':
- argument++;
- g_nbIterations = XSUM_readU32FromChar(&argument);
- break;
-
- /* Modify Block size (benchmark only) */
- case 'B':
- argument++;
- keySize = XSUM_readU32FromChar(&argument);
- break;
-
- /* Modify verbosity of benchmark output (hidden option) */
- case 'q':
- argument++;
- XSUM_logLevel--;
- break;
-
- default:
- return XSUM_badusage(exename);
- }
- }
- } /* for(i=1; i<argc; i++) */
-
- /* Check benchmark mode */
- if (benchmarkMode) {
- XSUM_logVerbose(2, FULL_WELCOME_MESSAGE(exename) );
- XSUM_sanityCheck();
- if (selectBenchIDs == 0) memcpy(g_testIDs, k_testIDs_default, sizeof(g_testIDs));
- if (selectBenchIDs == kBenchAll) memset(g_testIDs, 1, sizeof(g_testIDs));
- if (filenamesStart==0) return XSUM_benchInternal(keySize);
- return XSUM_benchFiles(argv+filenamesStart, argc-filenamesStart);
- }
-
- /* Check if input is defined as console; trigger an error in this case */
- if ( (filenamesStart==0) && XSUM_isConsole(stdin) && !explicitStdin)
- return XSUM_badusage(exename);
-
- if (filenamesStart==0) filenamesStart = argc;
- if (fileCheckMode) {
- return XSUM_checkFiles(argv+filenamesStart, argc-filenamesStart,
- displayEndianess, strictMode, statusOnly, warn, (XSUM_logLevel < 2) /*quiet*/);
- } else {
- return XSUM_hashFiles(argv+filenamesStart, argc-filenamesStart, algo, displayEndianess, convention);
- }
-}
diff --git a/grpc/tools/bazel b/grpc/tools/bazel
index aaa549a3..b2645c8a 100755
--- a/grpc/tools/bazel
+++ b/grpc/tools/bazel
@@ -25,7 +25,7 @@
set -e
# DISABLE_BAZEL_WRAPPER can be set to eliminate the wrapper logic
-if [ "${DISABLE_BAZEL_WRAPPER}" != "" ]
+if [ "${DISABLE_BAZEL_WRAPPER}" != "" ] && [ "${OVERRIDE_BAZEL_VERSION}" == "" ]
then
if [ "${BAZEL_REAL}" != "" ]
then
@@ -41,15 +41,16 @@ then
fi
# IMPORTANT: if you update the version here, other parts of infrastructure might needs updating as well
-# (e.g. win RBE builds, sanity checks, bazel toolchains etc.)
-VERSION=3.7.1
+# (e.g. sanity checks, bazel toolchains etc.)
+VERSION=${OVERRIDE_BAZEL_VERSION:-4.2.1}
echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." >&2
# update tools/update_mirror.sh to populate the mirror with new bazel archives
BASEURL_MIRROR="https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/bazel/releases/download"
BASEURL="https://github.com/bazelbuild/bazel/releases/download"
pushd "$(dirname "$0")" >/dev/null
-TOOLDIR=$(pwd)
+# bazel binary will be downloaded to GRPC_REPO_ROOT/tools directory by default
+DOWNLOAD_DIR=${OVERRIDE_BAZEL_WRAPPER_DOWNLOAD_DIR:-$(pwd)}
case $(uname -sm) in
"Linux x86_64")
@@ -61,6 +62,9 @@ case $(uname -sm) in
"Darwin x86_64")
suffix=darwin-x86_64
;;
+ "MINGW"* | "MSYS_NT"*)
+ suffix=windows-x86_64.exe
+ ;;
*)
echo "Unsupported architecture: $(uname -sm)" >&2
exit 1
@@ -68,13 +72,14 @@ case $(uname -sm) in
esac
filename="bazel-$VERSION-$suffix"
+filename_abs="${DOWNLOAD_DIR}/${filename}"
-if [ ! -x "$filename" ] ; then
+if [ ! -x "${filename_abs}" ] ; then
# first try to download using mirror, fallback to download from github
echo "Downloading bazel, will try URLs: ${BASEURL_MIRROR}/${VERSION}/${filename} ${BASEURL}/${VERSION}/${filename}" >&2
- curl --fail -L --output "${filename}" "${BASEURL_MIRROR}/${VERSION}/${filename}" || curl --fail -L --output "${filename}" "${BASEURL}/${VERSION}/${filename}"
- chmod a+x "$filename"
+ curl --fail -L --output "${filename_abs}" "${BASEURL_MIRROR}/${VERSION}/${filename}" || curl --fail -L --output "${filename_abs}" "${BASEURL}/${VERSION}/${filename}"
+ chmod a+x "${filename_abs}"
fi
popd >/dev/null
-exec "$TOOLDIR/$filename" "$@"
+exec "${filename_abs}" "$@"
diff --git a/grpc/tools/bazel.rc b/grpc/tools/bazel.rc
index baf3c3df..5312865a 100644
--- a/grpc/tools/bazel.rc
+++ b/grpc/tools/bazel.rc
@@ -11,6 +11,10 @@ build:opt --copt=-Wframe-larger-than=16384
build:dbg --compilation_mode=dbg
build:dbg --copt=-Werror=return-stack-address
+# Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768`
+# https://github.com/bazelbuild/bazel/issues/9190
+build:macos --dynamic_mode=off
+
build:windows_opt --compilation_mode=opt
build:windows_dbg --compilation_mode=dbg
@@ -25,6 +29,20 @@ build:asan --linkopt=-fsanitize=address
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
build:asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
+build:fuzzer_asan --strip=never
+build:fuzzer_asan --define=grpc_build_fuzzers=true
+build:fuzzer_asan --copt=-fsanitize=fuzzer,address
+build:fuzzer_asan --copt=-fsanitize-coverage=edge
+build:fuzzer_asan --copt=-fsanitize-coverage=trace-cmp
+build:fuzzer_asan --copt=-O0
+build:fuzzer_asan --copt=-fno-omit-frame-pointer
+build:fuzzer_asan --copt=-DGPR_NO_DIRECT_SYSCALLS
+build:fuzzer_asan --copt=-DGRPC_ASAN
+build:fuzzer_asan --copt=-DADDRESS_SANITIZER # used by absl
+build:fuzzer_asan --linkopt=-fsanitize=fuzzer,address
+build:fuzzer_asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
+build:fuzzer_asan --action_env=LSAN_OPTIONS=suppressions=test/core/util/lsan_suppressions.txt:report_objects=1
+
# We have a separate ASAN config for Mac OS to workaround a couple of bugs:
# 1. https://github.com/bazelbuild/bazel/issues/6932
# _FORTIFY_SOURCE=1 is enabled by default on Mac OS, which breaks ASAN.
@@ -43,6 +61,7 @@ build:asan_macos --copt=-fno-omit-frame-pointer
build:asan_macos --copt=-DGPR_NO_DIRECT_SYSCALLS
build:asan_macos --linkopt=-fsanitize=address
build:asan_macos --action_env=ASAN_OPTIONS=detect_leaks=0
+build:asan_macos --dynamic_mode=off
build:msan --strip=never
build:msan --copt=-fsanitize=memory
@@ -65,17 +84,35 @@ build:tsan --linkopt=-fsanitize=thread
build:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0
build:tsan --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
+build:tsan_macos --strip=never
+build:tsan_macos --copt=-fsanitize=thread
+build:tsan_macos --copt=-fno-omit-frame-pointer
+build:tsan_macos --copt=-DGPR_NO_DIRECT_SYSCALLS
+build:tsan_macos --copt=-DGRPC_TSAN
+build:tsan_macos --linkopt=-fsanitize=thread
+build:tsan_macos --test_env=TSAN_OPTIONS=report_atomic_races=0
+build:tsan_macos --action_env=TSAN_OPTIONS=suppressions=test/core/util/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
+build:tsan_macos --dynamic_mode=off
+
build:ubsan --strip=never
+build:ubsan --copt=-fsanitize=undefined
build:ubsan --copt=-fsanitize-link-c++-runtime
build:ubsan --copt=-fno-omit-frame-pointer
build:ubsan --copt=-DGRPC_UBSAN
build:ubsan --copt=-DNDEBUG
build:ubsan --copt=-fno-sanitize=function,vptr
+build:ubsan --linkopt=-fsanitize=undefined
+# avoid ubsan build error with int128 by linking against libc++
+# see b/200667821
build:ubsan --linkopt=-fsanitize-link-c++-runtime
+build:ubsan --linkopt=-lc++
+build:ubsan --linkopt=-lc++abi
+build:ubsan --linkopt=-lm
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
-# For some reasons, these two stopped being propagated, so, redeclaring them here.
-# That's a hack that needs to be removed once we understand what's going on.
-build:ubsan --copt=-DGRPC_PORT_ISOLATED_RUNTIME=1
+# if you want to run ubsan locally, uncomment following three lines
+# build:ubsan --linkopt=-lgcc_s
+# build:ubsan --linkopt=-lubsan
+# build:ubsan --linkopt=--rtlib=compiler-rt
build:basicprof --strip=never
build:basicprof --copt=-DNDEBUG
@@ -103,4 +140,4 @@ build:mutrace --copt=-DNDEBUG
build:mutrace --linkopt=-rdynamic
# Compile database generation config
-build:compdb --build_tag_filters=-nocompdb
+build:compdb --build_tag_filters=-nocompdb --features=-layering_check
diff --git a/grpc/tools/buildgen/_mako_renderer.py b/grpc/tools/buildgen/_mako_renderer.py
index 77c3c49f..568e6728 100755
--- a/grpc/tools/buildgen/_mako_renderer.py
+++ b/grpc/tools/buildgen/_mako_renderer.py
@@ -26,11 +26,11 @@ import shutil
import sys
from typing import List
-import yaml
from mako import exceptions
from mako.lookup import TemplateLookup
from mako.runtime import Context
from mako.template import Template
+import yaml
PROJECT_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..",
"..")
diff --git a/grpc/tools/buildgen/_utils.py b/grpc/tools/buildgen/_utils.py
index 875d3716..c3dfb8d5 100644
--- a/grpc/tools/buildgen/_utils.py
+++ b/grpc/tools/buildgen/_utils.py
@@ -14,11 +14,11 @@
# limitations under the License.
"""Utility functions for build file generation scripts."""
+import importlib.util
import os
import sys
import types
-import importlib.util
-from typing import Any, Union, Mapping, List
+from typing import Any, List, Mapping, Union
def import_python_module(path: str) -> types.ModuleType:
@@ -45,7 +45,7 @@ def to_bunch(var: Any) -> Any:
return [to_bunch(i) for i in var]
if isinstance(var, dict):
ret = {}
- for k, v in var.items():
+ for k, v in list(var.items()):
if isinstance(v, (list, dict)):
v = to_bunch(v)
ret[k] = v
@@ -57,7 +57,7 @@ def to_bunch(var: Any) -> Any:
def merge_json(dst: Union[Mapping, List], add: Union[Mapping, List]) -> None:
"""Merges JSON objects recursively."""
if isinstance(dst, dict) and isinstance(add, dict):
- for k, v in add.items():
+ for k, v in list(add.items()):
if k in dst:
if k.startswith('#'):
continue
diff --git a/grpc/tools/buildgen/build_cleaner.py b/grpc/tools/buildgen/build_cleaner.py
index 19bcee63..bb1fa6e2 100755
--- a/grpc/tools/buildgen/build_cleaner.py
+++ b/grpc/tools/buildgen/build_cleaner.py
@@ -18,6 +18,7 @@
import collections
import os
import sys
+
import yaml
TEST = (os.environ.get('TEST', 'false') == 'true')
diff --git a/grpc/tools/buildgen/extract_metadata_from_bazel_xml.py b/grpc/tools/buildgen/extract_metadata_from_bazel_xml.py
index 55b8dd12..396f635f 100755
--- a/grpc/tools/buildgen/extract_metadata_from_bazel_xml.py
+++ b/grpc/tools/buildgen/extract_metadata_from_bazel_xml.py
@@ -30,15 +30,16 @@
# format entirely or simplify it to a point where it becomes self-explanatory
# and doesn't need any detailed documentation.
-import subprocess
-import yaml
-import xml.etree.ElementTree as ET
-import os
import collections
-import sys
+import os
import re
-from typing import List, Any, Dict, Optional, Iterable
+import subprocess
+import sys
+from typing import Any, Dict, Iterable, List, Optional
+import xml.etree.ElementTree as ET
+
import build_cleaner
+import yaml
BuildMetadata = Dict[str, Any]
BuildDict = Dict[str, BuildMetadata]
@@ -93,8 +94,13 @@ def _extract_rules_from_bazel_xml(xml_tree):
rule_clazz = rule_dict['class']
rule_name = rule_dict['name']
if rule_clazz in [
- 'cc_library', 'cc_binary', 'cc_test', 'cc_proto_library',
- 'proto_library'
+ 'cc_library',
+ 'cc_binary',
+ 'cc_test',
+ 'cc_proto_library',
+ 'proto_library',
+ 'upb_proto_library',
+ 'upb_proto_reflection_library',
]:
if rule_name in result:
raise Exception('Rule %s already present' % rule_name)
@@ -223,7 +229,7 @@ def _compute_transitive_metadata(
* _COLLAPSED_PUBLIC_HEADERS: the merged public headers;
* _COLLAPSED_HEADERS: the merged non-public headers;
* _EXCLUDE_DEPS: intermediate targets to exclude when performing collapsing
- of sources and dependencies.
+ of sources and dependencies.
For the collapsed_deps, the algorithm improved cases like:
@@ -231,7 +237,7 @@ def _compute_transitive_metadata(
end2end_tests -> [grpc_test_util, grpc, gpr, address_sorting, upb]
grpc_test_util -> [grpc, gpr, address_sorting, upb, ...]
grpc -> [gpr, address_sorting, upb, ...]
-
+
The result of the algorithm:
end2end_tests -> [grpc_test_util]
grpc_test_util -> [grpc]
@@ -285,12 +291,11 @@ def _compute_transitive_metadata(
# Calculate transitive public deps (needed for collapsing sources)
transitive_public_deps = set(
- filter(lambda x: x in bazel_label_to_dep_name, transitive_deps))
+ [x for x in transitive_deps if x in bazel_label_to_dep_name])
# Remove intermediate targets that our public dependencies already depend
# on. This is the step that further shorten the deps list.
- collapsed_deps = set(filter(lambda x: x not in exclude_deps,
- collapsed_deps))
+ collapsed_deps = set([x for x in collapsed_deps if x not in exclude_deps])
# Compute the final source files and headers for this build target whose
# name is `rule_name` (input argument of this function).
@@ -319,7 +324,6 @@ def _compute_transitive_metadata(
_extract_public_headers(bazel_rules[dep]))
collapsed_headers.update(
_extract_nonpublic_headers(bazel_rules[dep]))
-
# This item is a "visited" flag
bazel_rule['_PROCESSING_DONE'] = True
# Following items are described in the docstinrg.
@@ -360,7 +364,7 @@ def _populate_transitive_metadata(bazel_rules: Any,
def update_test_metadata_with_transitive_metadata(
all_extra_metadata: BuildDict, bazel_rules: BuildDict) -> None:
"""Patches test build metadata with transitive metadata."""
- for lib_name, lib_dict in all_extra_metadata.items():
+ for lib_name, lib_dict in list(all_extra_metadata.items()):
# Skip if it isn't not an test
if lib_dict.get('build') != 'test' or lib_dict.get('_TYPE') != 'target':
continue
@@ -376,6 +380,78 @@ def update_test_metadata_with_transitive_metadata(
lib_dict['language'] = 'c++'
+def _get_transitive_protos(bazel_rules, t):
+ que = [
+ t,
+ ]
+ visited = set()
+ ret = []
+ while que:
+ name = que.pop(0)
+ rule = bazel_rules.get(name, None)
+ if rule:
+ for dep in rule['deps']:
+ if dep not in visited:
+ visited.add(dep)
+ que.append(dep)
+ for src in rule['srcs']:
+ if src.endswith('.proto'):
+ ret.append(src)
+ return list(set(ret))
+
+
+def _expand_upb_proto_library_rules(bazel_rules):
+ # Expand the .proto files from UPB proto library rules into the pre-generated
+ # upb.h and upb.c files.
+ GEN_UPB_ROOT = '//:src/core/ext/upb-generated/'
+ GEN_UPBDEFS_ROOT = '//:src/core/ext/upbdefs-generated/'
+ EXTERNAL_LINKS = [('@com_google_protobuf//', ':src/'),
+ ('@com_google_googleapis//', ''),
+ ('@com_github_cncf_udpa//', ''),
+ ('@com_envoyproxy_protoc_gen_validate//', ''),
+ ('@envoy_api//', ''), ('@opencensus_proto//', '')]
+ for name, bazel_rule in bazel_rules.items():
+ gen_func = bazel_rule.get('generator_function', None)
+ if gen_func in ('grpc_upb_proto_library',
+ 'grpc_upb_proto_reflection_library'):
+ # get proto dependency
+ deps = bazel_rule['deps']
+ if len(deps) != 1:
+ raise Exception(
+ 'upb rule "{0}" should have 1 proto dependency but has "{1}"'
+ .format(name, deps))
+ # deps is not properly fetched from bazel query for upb_proto_library target
+ # so add the upb dependency manually
+ bazel_rule['deps'] = [
+ '//external:upb_lib', '//external:upb_lib_descriptor',
+ '//external:upb_generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me'
+ ]
+ # populate the upb_proto_library rule with pre-generated upb headers
+ # and sources using proto_rule
+ protos = _get_transitive_protos(bazel_rules, deps[0])
+ if len(protos) == 0:
+ raise Exception(
+ 'upb rule "{0}" should have at least one proto file.'.
+ format(name))
+ srcs = []
+ hdrs = []
+ for proto_src in protos:
+ for external_link in EXTERNAL_LINKS:
+ if proto_src.startswith(external_link[0]):
+ proto_src = proto_src[len(external_link[0]) +
+ len(external_link[1]):]
+ break
+ if proto_src.startswith('@'):
+ raise Exception('"{0}" is unknown workspace.'.format(name))
+ proto_src = _extract_source_file_path(proto_src)
+ ext = '.upb' if gen_func == 'grpc_upb_proto_library' else '.upbdefs'
+ root = GEN_UPB_ROOT if gen_func == 'grpc_upb_proto_library' else GEN_UPBDEFS_ROOT
+ srcs.append(root + proto_src.replace('.proto', ext + '.c'))
+ hdrs.append(root + proto_src.replace('.proto', ext + '.h'))
+ bazel_rule['srcs'] = srcs
+ bazel_rule['hdrs'] = hdrs
+
+
def _generate_build_metadata(build_extra_metadata: BuildDict,
bazel_rules: BuildDict) -> BuildDict:
"""Generate build metadata in build.yaml-like format bazel build metadata and build.yaml-specific "extra metadata"."""
@@ -408,7 +484,7 @@ def _generate_build_metadata(build_extra_metadata: BuildDict,
result[to_name] = lib_dict
# dep names need to be updated as well
- for lib_dict_to_update in result.values():
+ for lib_dict_to_update in list(result.values()):
lib_dict_to_update['deps'] = list([
to_name if dep == lib_name else dep
for dep in lib_dict_to_update['deps']
@@ -438,15 +514,21 @@ def _convert_to_build_yaml_like(lib_dict: BuildMetadata) -> BuildYaml:
# get rid of temporary private fields prefixed with "_" and some other useless fields
for lib in lib_list:
- for field_to_remove in [k for k in lib.keys() if k.startswith('_')]:
+ for field_to_remove in [
+ k for k in list(lib.keys()) if k.startswith('_')
+ ]:
lib.pop(field_to_remove, None)
for target in target_list:
- for field_to_remove in [k for k in target.keys() if k.startswith('_')]:
+ for field_to_remove in [
+ k for k in list(target.keys()) if k.startswith('_')
+ ]:
target.pop(field_to_remove, None)
target.pop('public_headers',
None) # public headers make no sense for targets
for test in test_list:
- for field_to_remove in [k for k in test.keys() if k.startswith('_')]:
+ for field_to_remove in [
+ k for k in list(test.keys()) if k.startswith('_')
+ ]:
test.pop(field_to_remove, None)
test.pop('public_headers',
None) # public headers make no sense for tests
@@ -463,7 +545,7 @@ def _convert_to_build_yaml_like(lib_dict: BuildMetadata) -> BuildYaml:
def _extract_cc_tests(bazel_rules: BuildDict) -> List[str]:
"""Gets list of cc_test tests from bazel rules"""
result = []
- for bazel_rule in bazel_rules.values():
+ for bazel_rule in list(bazel_rules.values()):
if bazel_rule['class'] == 'cc_test':
test_name = bazel_rule['name']
if test_name.startswith('//'):
@@ -477,15 +559,21 @@ def _exclude_unwanted_cc_tests(tests: List[str]) -> List[str]:
# most qps tests are autogenerated, we are fine without them
tests = [test for test in tests if not test.startswith('test/cpp/qps:')]
-
- # we have trouble with census dependency outside of bazel
+ # microbenchmarks aren't needed for checking correctness
tests = [
test for test in tests
- if not test.startswith('test/cpp/ext/filters/census:')
+ if not test.startswith('test/cpp/microbenchmarks:')
]
tests = [
test for test in tests
- if not test.startswith('test/cpp/microbenchmarks:bm_opencensus_plugin')
+ if not test.startswith('test/core/promise/benchmark:')
+ ]
+
+ # we have trouble with census dependency outside of bazel
+ tests = [
+ test for test in tests
+ if not test.startswith('test/cpp/ext/filters/census:') and
+ not test.startswith('test/core/xds:xds_channel_stack_modifier_test')
]
# missing opencensus/stats/stats.h
@@ -535,6 +623,9 @@ def _exclude_unwanted_cc_tests(tests: List[str]) -> List[str]:
if not test.startswith('test/cpp/util:channelz_sampler_test')
]
+ # we don't need to generate fuzzers outside of bazel
+ tests = [test for test in tests if not test.endswith('_fuzzer')]
+
return tests
@@ -565,7 +656,10 @@ def _generate_build_extra_metadata_for_tests(
if 'grpc_fuzzer' == bazel_rule['generator_function']:
# currently we hand-list fuzzers instead of generating them automatically
# because there's no way to obtain maxlen property from bazel BUILD file.
- print('skipping fuzzer ' + test)
+ print(('skipping fuzzer ' + test))
+ continue
+
+ if 'bazel_only' in bazel_tags:
continue
# if any tags that restrict platform compatibility are present,
@@ -609,20 +703,20 @@ def _generate_build_extra_metadata_for_tests(
# detect duplicate test names
tests_by_simple_name = {}
- for test_name, test_dict in test_metadata.items():
+ for test_name, test_dict in list(test_metadata.items()):
simple_test_name = test_dict['_RENAME']
if not simple_test_name in tests_by_simple_name:
tests_by_simple_name[simple_test_name] = []
tests_by_simple_name[simple_test_name].append(test_name)
# choose alternative names for tests with a name collision
- for collision_list in tests_by_simple_name.values():
+ for collision_list in list(tests_by_simple_name.values()):
if len(collision_list) > 1:
for test_name in collision_list:
long_name = test_name.replace('/', '_').replace(':', '_')
- print(
+ print((
'short name of "%s" collides with another test, renaming to %s'
- % (test_name, long_name))
+ % (test_name, long_name)))
test_metadata[test_name]['_RENAME'] = long_name
return test_metadata
@@ -634,8 +728,8 @@ def _detect_and_print_issues(build_yaml_like: BuildYaml) -> None:
if tgt['build'] == 'test':
for src in tgt['src']:
if src.startswith('src/') and not src.endswith('.proto'):
- print('source file from under "src/" tree used in test ' +
- tgt['name'] + ': ' + src)
+ print(('source file from under "src/" tree used in test ' +
+ tgt['name'] + ': ' + src))
# extra metadata that will be used to construct build.yaml
@@ -779,11 +873,6 @@ _BUILD_EXTRA_METADATA = {
'build': 'private',
'_RENAME': 'end2end_tests'
},
- 'test/core/end2end:end2end_nosec_tests': {
- 'language': 'c',
- 'build': 'private',
- '_RENAME': 'end2end_nosec_tests'
- },
# benchmark support libraries
'test/cpp/microbenchmarks:helpers': {
@@ -856,115 +945,6 @@ _BUILD_EXTRA_METADATA = {
# TODO(jtattermusch): add remaining tools such as grpc_print_google_default_creds_token (they are not used by bazel build)
- # Fuzzers
- 'test/core/security:alts_credentials_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/security/corpus/alts_credentials_corpus'],
- 'maxlen': 2048,
- '_TYPE': 'target',
- '_RENAME': 'alts_credentials_fuzzer'
- },
- 'test/core/end2end/fuzzers:client_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/end2end/fuzzers/client_fuzzer_corpus'],
- 'maxlen': 2048,
- 'dict': 'test/core/end2end/fuzzers/hpack.dictionary',
- '_TYPE': 'target',
- '_RENAME': 'client_fuzzer'
- },
- 'test/core/transport/chttp2:hpack_parser_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/transport/chttp2/hpack_parser_corpus'],
- 'maxlen': 512,
- 'dict': 'test/core/end2end/fuzzers/hpack.dictionary',
- '_TYPE': 'target',
- '_RENAME': 'hpack_parser_fuzzer_test'
- },
- 'test/core/http:request_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/http/request_corpus'],
- 'maxlen': 2048,
- '_TYPE': 'target',
- '_RENAME': 'http_request_fuzzer_test'
- },
- 'test/core/http:response_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/http/response_corpus'],
- 'maxlen': 2048,
- '_TYPE': 'target',
- '_RENAME': 'http_response_fuzzer_test'
- },
- 'test/core/json:json_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/json/corpus'],
- 'maxlen': 512,
- '_TYPE': 'target',
- '_RENAME': 'json_fuzzer_test'
- },
- 'test/core/nanopb:fuzzer_response': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/nanopb/corpus_response'],
- 'maxlen': 128,
- '_TYPE': 'target',
- '_RENAME': 'nanopb_fuzzer_response_test'
- },
- 'test/core/nanopb:fuzzer_serverlist': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/nanopb/corpus_serverlist'],
- 'maxlen': 128,
- '_TYPE': 'target',
- '_RENAME': 'nanopb_fuzzer_serverlist_test'
- },
- 'test/core/slice:percent_decode_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/slice/percent_decode_corpus'],
- 'maxlen': 32,
- '_TYPE': 'target',
- '_RENAME': 'percent_decode_fuzzer'
- },
- 'test/core/slice:percent_encode_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/slice/percent_encode_corpus'],
- 'maxlen': 32,
- '_TYPE': 'target',
- '_RENAME': 'percent_encode_fuzzer'
- },
- 'test/core/end2end/fuzzers:server_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/end2end/fuzzers/server_fuzzer_corpus'],
- 'maxlen': 2048,
- 'dict': 'test/core/end2end/fuzzers/hpack.dictionary',
- '_TYPE': 'target',
- '_RENAME': 'server_fuzzer'
- },
- 'test/core/security:ssl_server_fuzzer': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/security/corpus/ssl_server_corpus'],
- 'maxlen': 2048,
- '_TYPE': 'target',
- '_RENAME': 'ssl_server_fuzzer'
- },
- 'test/core/uri:uri_fuzzer_test': {
- 'language': 'c++',
- 'build': 'fuzzer',
- 'corpus_dirs': ['test/core/uri/uri_corpus'],
- 'maxlen': 128,
- '_TYPE': 'target',
- '_RENAME': 'uri_fuzzer_test'
- },
-
# TODO(jtattermusch): these fuzzers had no build.yaml equivalent
# test/core/compression:message_compress_fuzzer
# test/core/compression:message_decompress_fuzzer
@@ -1002,6 +982,11 @@ for query in _BAZEL_DEPS_QUERIES:
bazel_rules.update(
_extract_rules_from_bazel_xml(_bazel_query_xml_tree(query)))
+# Step 1.5: The sources for UPB protos are pre-generated, so we want
+# to expand the UPB proto library bazel rules into the generated
+# .upb.h and .upb.c files.
+_expand_upb_proto_library_rules(bazel_rules)
+
# Step 2: Extract the known bazel cc_test tests. While most tests
# will be buildable with other build systems just fine, some of these tests
# would be too difficult to build and run with other build systems,
@@ -1067,7 +1052,7 @@ all_extra_metadata.update(
# '_COLLAPSED_PUBLIC_HEADERS': [...],
# '_COLLAPSED_HEADERS': [...]
# }
-_populate_transitive_metadata(bazel_rules, all_extra_metadata.keys())
+_populate_transitive_metadata(bazel_rules, list(all_extra_metadata.keys()))
# Step 4a: Update the existing test metadata with the updated build metadata.
# Certain build metadata of certain test targets depend on the transitive
diff --git a/grpc/tools/buildgen/generate_projects.py b/grpc/tools/buildgen/generate_projects.py
index 2e64484f..8e5c6e6b 100755
--- a/grpc/tools/buildgen/generate_projects.py
+++ b/grpc/tools/buildgen/generate_projects.py
@@ -14,16 +14,16 @@
import argparse
import glob
-import yaml
-import pickle
+import multiprocessing
import os
+import pickle
import shutil
import sys
import tempfile
-import multiprocessing
-from typing import Union, Dict, List
+from typing import Dict, List, Union
import _utils
+import yaml
PROJECT_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..",
"..")
diff --git a/grpc/tools/buildgen/plugins/check_attrs.py b/grpc/tools/buildgen/plugins/check_attrs.py
index a9acd1ea..34729ed1 100644
--- a/grpc/tools/buildgen/plugins/check_attrs.py
+++ b/grpc/tools/buildgen/plugins/check_attrs.py
@@ -95,7 +95,7 @@ VALID_ATTRIBUTE_KEYS_MAP = {
def check_attributes(entity, kind, errors):
attributes = VALID_ATTRIBUTE_KEYS_MAP[kind]
name = entity.get('name', anything())
- for key, value in entity.items():
+ for key, value in list(entity.items()):
if key == 'name':
continue
validator = attributes.get(key)
diff --git a/grpc/tools/buildgen/plugins/list_api.py b/grpc/tools/buildgen/plugins/list_api.py
index 87a592d8..da5ae561 100755
--- a/grpc/tools/buildgen/plugins/list_api.py
+++ b/grpc/tools/buildgen/plugins/list_api.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
@@ -19,6 +19,7 @@ import fnmatch
import os
import re
import sys
+
import yaml
_RE_API = r'(?:GPRAPI|GRPCAPI|CENSUSAPI)([^;]*);'
@@ -64,5 +65,6 @@ def mako_plugin(dictionary):
if __name__ == '__main__':
- print(yaml.dump([api for api in list_c_apis(headers_under('include/grpc'))
- ]))
+ print(
+ (yaml.dump([api for api in list_c_apis(headers_under('include/grpc'))
+ ])))
diff --git a/grpc/tools/buildgen/plugins/make_fuzzer_tests.py b/grpc/tools/buildgen/plugins/make_fuzzer_tests.py
deleted file mode 100644
index f691a22b..00000000
--- a/grpc/tools/buildgen/plugins/make_fuzzer_tests.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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.
-"""Create tests for each fuzzer"""
-
-import copy
-import glob
-
-
-def mako_plugin(dictionary):
- targets = dictionary['targets']
- tests = dictionary['tests']
- for tgt in targets:
- if tgt['build'] == 'fuzzer':
- new_target = copy.deepcopy(tgt)
- new_target['build'] = 'test'
- new_target['name'] += '_one_entry'
- new_target['run'] = False
- new_target['src'].append(
- 'test/core/util/one_corpus_entry_fuzzer.cc')
-
- # avoid having two main() methods
- to_remove = 'test/core/util/fuzzer_corpus_test.cc'
- if to_remove in new_target['src']:
- new_target['src'].remove(to_remove)
-
- targets.append(new_target)
- for corpus in new_target['corpus_dirs']:
- for fn in sorted(glob.glob('%s/*' % corpus)):
- tests.append({
- 'name': new_target['name'],
- 'args': [fn],
- 'exclude_iomgrs': ['uv'],
- 'exclude_configs': ['tsan'],
- 'uses_polling': False,
- 'platforms': ['mac', 'linux'],
- 'ci_platforms': ['linux'],
- 'flaky': False,
- 'language': 'c++',
- 'cpu_cost': 0.1,
- })
diff --git a/grpc/tools/buildgen/plugins/supported_bazel_versions.py b/grpc/tools/buildgen/plugins/supported_bazel_versions.py
new file mode 100644
index 00000000..8d2d980c
--- /dev/null
+++ b/grpc/tools/buildgen/plugins/supported_bazel_versions.py
@@ -0,0 +1,28 @@
+# Copyright 2022 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.
+"""Retrieves supported bazel versions from plaintext file."""
+
+_SUPPORTED_VERSIONS_FILE = "bazel/supported_versions.txt"
+
+
+def _get_supported_bazel_versions():
+ versions = []
+ with open(_SUPPORTED_VERSIONS_FILE, "r") as f:
+ for line in f:
+ versions.append(line.strip())
+ return versions
+
+
+def mako_plugin(dictionary):
+ dictionary["supported_bazel_versions"] = _get_supported_bazel_versions()
diff --git a/grpc/tools/buildgen/plugins/transitive_dependencies.py b/grpc/tools/buildgen/plugins/transitive_dependencies.py
index 0ca4f408..97c726b7 100644
--- a/grpc/tools/buildgen/plugins/transitive_dependencies.py
+++ b/grpc/tools/buildgen/plugins/transitive_dependencies.py
@@ -53,7 +53,7 @@ def mako_plugin(dictionary):
"""
lib_map = {lib['name']: lib for lib in dictionary.get('libs')}
- for target_name, target_list in dictionary.items():
+ for target_name, target_list in list(dictionary.items()):
for target in target_list:
if isinstance(target, dict):
if 'deps' in target or target_name == 'libs':
diff --git a/grpc/tools/codegen/core/gen_grpc_tls_credentials_options.py b/grpc/tools/codegen/core/gen_grpc_tls_credentials_options.py
new file mode 100755
index 00000000..6076cfe8
--- /dev/null
+++ b/grpc/tools/codegen/core/gen_grpc_tls_credentials_options.py
@@ -0,0 +1,394 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Generator script for src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h and test/core/security/grpc_tls_credentials_options_comparator_test.cc
+# Should be executed from grpc's root directory.
+
+from __future__ import print_function
+
+import collections
+from dataclasses import dataclass
+import difflib
+import filecmp
+import os
+import sys
+import tempfile
+
+
+@dataclass
+class DataMember:
+ name: str # name of the data member without the trailing '_'
+ type: str # Type (eg. std::string, bool)
+ test_name: str # The name to use for the associated test
+ test_value_1: str # Test-specific value to use for comparison
+ test_value_2: str # Test-specific value (different from test_value_1)
+ default_initializer: str = '' # If non-empty, this will be used as the default initialization of this field
+ getter_comment: str = '' # Comment to add before the getter for this field
+ special_getter_return_type: str = '' # Override for the return type of getter (eg. const std::string&)
+ override_getter: str = '' # Override for the entire getter method. Relevant for certificate_verifier and certificate_provider
+ setter_comment: str = '' # Commend to add before the setter for this field
+ setter_move_semantics: bool = False # Should the setter use move-semantics
+ special_comparator: str = '' # If non-empty, this will be used in `operator==`
+
+
+_DATA_MEMBERS = [
+ DataMember(name='cert_request_type',
+ type='grpc_ssl_client_certificate_request_type',
+ default_initializer='GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE',
+ test_name="DifferentCertRequestType",
+ test_value_1="GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE",
+ test_value_2="GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY"),
+ DataMember(name='verify_server_cert',
+ type='bool',
+ default_initializer='true',
+ test_name="DifferentVerifyServerCert",
+ test_value_1="false",
+ test_value_2="true"),
+ DataMember(name='min_tls_version',
+ type='grpc_tls_version',
+ default_initializer='grpc_tls_version::TLS1_2',
+ test_name="DifferentMinTlsVersion",
+ test_value_1="grpc_tls_version::TLS1_2",
+ test_value_2="grpc_tls_version::TLS1_3"),
+ DataMember(name='max_tls_version',
+ type='grpc_tls_version',
+ default_initializer='grpc_tls_version::TLS1_3',
+ test_name="DifferentMaxTlsVersion",
+ test_value_1="grpc_tls_version::TLS1_2",
+ test_value_2="grpc_tls_version::TLS1_3"),
+ DataMember(
+ name='certificate_verifier',
+ type='grpc_core::RefCountedPtr<grpc_tls_certificate_verifier>',
+ override_getter="""grpc_tls_certificate_verifier* certificate_verifier() {
+ return certificate_verifier_.get();
+ }""",
+ setter_move_semantics=True,
+ special_comparator=
+ '(certificate_verifier_ == other.certificate_verifier_ || (certificate_verifier_ != nullptr && other.certificate_verifier_ != nullptr && certificate_verifier_->Compare(other.certificate_verifier_.get()) == 0))',
+ test_name="DifferentCertificateVerifier",
+ test_value_1="MakeRefCounted<HostNameCertificateVerifier>()",
+ test_value_2="MakeRefCounted<XdsCertificateVerifier>(nullptr, \"\")"),
+ DataMember(name='check_call_host',
+ type='bool',
+ default_initializer='true',
+ test_name="DifferentCheckCallHost",
+ test_value_1="false",
+ test_value_2="true"),
+ DataMember(
+ name='certificate_provider',
+ type='grpc_core::RefCountedPtr<grpc_tls_certificate_provider>',
+ getter_comment=
+ 'Returns the distributor from certificate_provider_ if it is set, nullptr otherwise.',
+ override_getter=
+ """grpc_tls_certificate_distributor* certificate_distributor() {
+ if (certificate_provider_ != nullptr) { return certificate_provider_->distributor().get(); }
+ return nullptr;
+ }""",
+ setter_move_semantics=True,
+ special_comparator=
+ '(certificate_provider_ == other.certificate_provider_ || (certificate_provider_ != nullptr && other.certificate_provider_ != nullptr && certificate_provider_->Compare(other.certificate_provider_.get()) == 0))',
+ test_name="DifferentCertificateProvider",
+ test_value_1=
+ "MakeRefCounted<StaticDataCertificateProvider>(\"root_cert_1\", PemKeyCertPairList())",
+ test_value_2=
+ "MakeRefCounted<StaticDataCertificateProvider>(\"root_cert_2\", PemKeyCertPairList())"
+ ),
+ DataMember(
+ name='watch_root_cert',
+ type='bool',
+ default_initializer='false',
+ setter_comment=
+ 'If need to watch the updates of root certificates with name |root_cert_name|. The default value is false. If used in tls_credentials, it should always be set to true unless the root certificates are not needed.',
+ test_name="DifferentWatchRootCert",
+ test_value_1="false",
+ test_value_2="true"),
+ DataMember(
+ name='root_cert_name',
+ type='std::string',
+ special_getter_return_type='const std::string&',
+ setter_comment=
+ 'Sets the name of root certificates being watched, if |set_watch_root_cert| is called. If not set, an empty string will be used as the name.',
+ setter_move_semantics=True,
+ test_name="DifferentRootCertName",
+ test_value_1="\"root_cert_name_1\"",
+ test_value_2="\"root_cert_name_2\""),
+ DataMember(
+ name='watch_identity_pair',
+ type='bool',
+ default_initializer='false',
+ setter_comment=
+ 'If need to watch the updates of identity certificates with name |identity_cert_name|. The default value is false. If used in tls_credentials, it should always be set to true unless the identity key-cert pairs are not needed.',
+ test_name="DifferentWatchIdentityPair",
+ test_value_1="false",
+ test_value_2="true"),
+ DataMember(
+ name='identity_cert_name',
+ type='std::string',
+ special_getter_return_type='const std::string&',
+ setter_comment=
+ 'Sets the name of identity key-cert pairs being watched, if |set_watch_identity_pair| is called. If not set, an empty string will be used as the name.',
+ setter_move_semantics=True,
+ test_name="DifferentIdentityCertName",
+ test_value_1="\"identity_cert_name_1\"",
+ test_value_2="\"identity_cert_name_2\""),
+ DataMember(name='tls_session_key_log_file_path',
+ type='std::string',
+ special_getter_return_type='const std::string&',
+ setter_move_semantics=True,
+ test_name="DifferentTlsSessionKeyLogFilePath",
+ test_value_1="\"file_path_1\"",
+ test_value_2="\"file_path_2\""),
+ DataMember(
+ name='crl_directory',
+ type='std::string',
+ special_getter_return_type='const std::string&',
+ setter_comment=
+ ' gRPC will enforce CRLs on all handshakes from all hashed CRL files inside of the crl_directory. If not set, an empty string will be used, which will not enable CRL checking. Only supported for OpenSSL version > 1.1.',
+ setter_move_semantics=True,
+ test_name="DifferentCrlDirectory",
+ test_value_1="\"crl_directory_1\"",
+ test_value_2="\"crl_directory_2\"")
+]
+
+
+# print copyright notice from this file
+def put_copyright(f, year):
+ print("""//
+//
+// Copyright %s gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+""" % (year),
+ file=f)
+
+
+# Prints differences between two files
+def get_file_differences(file1, file2):
+ with open(file1) as f1:
+ file1_text = f1.readlines()
+ with open(file2) as f2:
+ file2_text = f2.readlines()
+ return difflib.unified_diff(file1_text,
+ file2_text,
+ fromfile=file1,
+ tofile=file2)
+
+
+# Is this script executed in test mode?
+test_mode = False
+if len(sys.argv) > 1 and sys.argv[1] == "--test":
+ test_mode = True
+
+HEADER_FILE_NAME = 'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h'
+# Generate src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
+header_file_name = HEADER_FILE_NAME
+if (test_mode):
+ header_file_name = tempfile.NamedTemporaryFile(delete=False).name
+H = open(header_file_name, 'w')
+
+put_copyright(H, '2018')
+print(
+ '// Generated by tools/codegen/core/gen_grpc_tls_credentials_options.py\n',
+ file=H)
+print(
+ """#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "absl/container/inlined_vector.h"
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
+
+// Contains configurable options specified by callers to configure their certain
+// security features supported in TLS.
+// TODO(ZhenLian): consider making this not ref-counted.
+struct grpc_tls_credentials_options
+ : public grpc_core::RefCounted<grpc_tls_credentials_options> {
+ public:
+ ~grpc_tls_credentials_options() override = default;
+""",
+ file=H)
+
+# Print out getters for all data members
+print(" // Getters for member fields.", file=H)
+for data_member in _DATA_MEMBERS:
+ if data_member.getter_comment != '':
+ print(" // " + data_member.getter_comment, file=H)
+ if data_member.override_getter:
+ print(" " + data_member.override_getter, file=H)
+ else:
+ print(
+ " %s %s() const { return %s; }" %
+ (data_member.special_getter_return_type if
+ data_member.special_getter_return_type != '' else data_member.type,
+ data_member.name, data_member.name + '_'),
+ file=H)
+
+# Print out setters for all data members
+print("", file=H)
+print(" // Setters for member fields.", file=H)
+for data_member in _DATA_MEMBERS:
+ if data_member.setter_comment != '':
+ print(" // " + data_member.setter_comment, file=H)
+ if (data_member.setter_move_semantics):
+ print(" void set_%s(%s %s) { %s_ = std::move(%s); }" %
+ (data_member.name, data_member.type, data_member.name,
+ data_member.name, data_member.name),
+ file=H)
+ else:
+ print(" void set_%s(%s %s) { %s_ = %s; }" %
+ (data_member.name, data_member.type, data_member.name,
+ data_member.name, data_member.name),
+ file=H)
+
+# Write out operator==
+print("\n bool operator==(const grpc_tls_credentials_options& other) const {",
+ file=H)
+operator_equal_content = " return "
+for i in range(len(_DATA_MEMBERS)):
+ if (i != 0):
+ operator_equal_content += " "
+ if (_DATA_MEMBERS[i].special_comparator != ''):
+ operator_equal_content += _DATA_MEMBERS[i].special_comparator
+ else:
+ operator_equal_content += _DATA_MEMBERS[
+ i].name + "_ == other." + _DATA_MEMBERS[i].name + "_"
+ if (i != len(_DATA_MEMBERS) - 1):
+ operator_equal_content += ' &&\n'
+print(operator_equal_content + ";\n }", file=H)
+
+#Print out data member declarations
+print("\n private:", file=H)
+for data_member in _DATA_MEMBERS:
+ if data_member.default_initializer == '':
+ print(" %s %s_;" % (
+ data_member.type,
+ data_member.name,
+ ), file=H)
+ else:
+ print(" %s %s_ = %s;" % (data_member.type, data_member.name,
+ data_member.default_initializer),
+ file=H)
+
+# Print out file ending
+print("""};
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CREDENTIALS_OPTIONS_H""",
+ file=H)
+
+H.close()
+
+# Generate test/core/security/grpc_tls_credentials_options_comparator_test.cc
+TEST_FILE_NAME = 'test/core/security/grpc_tls_credentials_options_comparator_test.cc'
+test_file_name = TEST_FILE_NAME
+if (test_mode):
+ test_file_name = tempfile.NamedTemporaryFile(delete=False).name
+T = open(test_file_name, 'w')
+
+put_copyright(T, '2022')
+print('// Generated by tools/codegen/core/gen_grpc_tls_credentials_options.py',
+ file=T)
+print("""
+#include <grpc/support/port_platform.h>
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "src/core/lib/security/credentials/xds/xds_credentials.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
+#include "test/core/util/test_config.h"
+
+namespace grpc_core {
+namespace {
+""",
+ file=T)
+
+# Generate negative test for each negative member
+for data_member in _DATA_MEMBERS:
+ print("""TEST(TlsCredentialsOptionsComparatorTest, %s) {
+ auto* options_1 = grpc_tls_credentials_options_create();
+ auto* options_2 = grpc_tls_credentials_options_create();
+ options_1->set_%s(%s);
+ options_2->set_%s(%s);
+ EXPECT_FALSE(*options_1 == *options_2);
+ EXPECT_FALSE(*options_2 == *options_1);
+ delete options_1;
+ delete options_2;
+}""" % (data_member.test_name, data_member.name, data_member.test_value_1,
+ data_member.name, data_member.test_value_2),
+ file=T)
+
+# Print out file ending
+print("""
+} // namespace
+} // namespace grpc_core
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(&argc, argv);
+ grpc_init();
+ auto result = RUN_ALL_TESTS();
+ grpc_shutdown();
+ return result;
+}""",
+ file=T)
+T.close()
+
+if (test_mode):
+ header_diff = get_file_differences(header_file_name, HEADER_FILE_NAME)
+ test_diff = get_file_differences(test_file_name, TEST_FILE_NAME)
+ os.unlink(header_file_name)
+ os.unlink(test_file_name)
+ header_error = False
+ for line in header_diff:
+ print(line)
+ header_error = True
+ if header_error:
+ print(
+ HEADER_FILE_NAME +
+ ' should not be manually modified. Please make changes to tools/distrib/gen_grpc_tls_credentials_options.py instead.'
+ )
+ test_error = False
+ for line in test_diff:
+ print(line)
+ test_error = True
+ if test_error:
+ print(
+ TEST_FILE_NAME +
+ ' should not be manually modified. Please make changes to tools/distrib/gen_grpc_tls_credentials_options.py instead.'
+ )
+ if (header_error or test_error):
+ sys.exit(1)
diff --git a/grpc/tools/codegen/core/gen_header_frame.py b/grpc/tools/codegen/core/gen_header_frame.py
index 635b0b5a..4545f3e5 100755
--- a/grpc/tools/codegen/core/gen_header_frame.py
+++ b/grpc/tools/codegen/core/gen_header_frame.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
@@ -19,9 +19,9 @@
Write a set of strings containing a hpack encoded http2 frame that
represents said headers."""
+import argparse
import json
import sys
-import argparse
def append_never_indexed(payload_line, n, count, key, value):
@@ -141,7 +141,7 @@ if args.hex:
all_bytes = []
for line in payload_bytes:
all_bytes.extend(line)
- print '{%s}' % ', '.join('0x%02x' % c for c in all_bytes)
+ print(('{%s}' % ', '.join('0x%02x' % c for c in all_bytes)))
else:
for line in payload_bytes:
- print esc_c(line)
+ print((esc_c(line)))
diff --git a/grpc/tools/codegen/core/gen_hpack_tables.cc b/grpc/tools/codegen/core/gen_hpack_tables.cc
index 0e7a7b80..d01a90eb 100644
--- a/grpc/tools/codegen/core/gen_hpack_tables.cc
+++ b/grpc/tools/codegen/core/gen_hpack_tables.cc
@@ -27,92 +27,6 @@
#include "src/core/ext/transport/chttp2/transport/huffsyms.h"
/*
- * first byte LUT generation
- */
-
-typedef struct {
- const char *call;
- /* bit prefix for the field type */
- unsigned char prefix;
- /* length of the bit prefix for the field type */
- unsigned char prefix_length;
- /* index value: 0 = all zeros, 2 = all ones, 1 otherwise */
- unsigned char index;
-} spec;
-
-static const spec fields[] = {
- {"INDEXED_FIELD", 0X80, 1, 1}, {"INDEXED_FIELD_X", 0X80, 1, 2},
- {"LITHDR_INCIDX", 0X40, 2, 1}, {"LITHDR_INCIDX_X", 0X40, 2, 2},
- {"LITHDR_INCIDX_V", 0X40, 2, 0}, {"LITHDR_NOTIDX", 0X00, 4, 1},
- {"LITHDR_NOTIDX_X", 0X00, 4, 2}, {"LITHDR_NOTIDX_V", 0X00, 4, 0},
- {"LITHDR_NVRIDX", 0X10, 4, 1}, {"LITHDR_NVRIDX_X", 0X10, 4, 2},
- {"LITHDR_NVRIDX_V", 0X10, 4, 0}, {"MAX_TBL_SIZE", 0X20, 3, 1},
- {"MAX_TBL_SIZE_X", 0X20, 3, 2},
-};
-
-static const int num_fields = sizeof(fields) / sizeof(*fields);
-
-static unsigned char prefix_mask(unsigned char prefix_len) {
- unsigned char i;
- unsigned char out = 0;
- for (i = 0; i < prefix_len; i++) {
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- out = (unsigned char)(out | (unsigned char)(1 << (7 - i)));
- }
- return out;
-}
-
-static unsigned char suffix_mask(unsigned char prefix_len) {
- return (unsigned char)~prefix_mask(prefix_len);
-}
-
-static void generate_first_byte_lut(void) {
- int i, j, n;
- const spec *chrspec;
- unsigned char suffix;
-
- n = printf("static CALLTYPE first_byte[256] = {");
- /* for each potential first byte of a header */
- for (i = 0; i < 256; i++) {
- /* find the field type that matches it */
- chrspec = NULL;
- for (j = 0; j < num_fields; j++) {
- if ((prefix_mask(fields[j].prefix_length) & i) == fields[j].prefix) {
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container
- * type is then required to avoid the compiler warning */
- suffix = (unsigned char)(suffix_mask(fields[j].prefix_length) &
- (unsigned char)i);
- if (suffix == suffix_mask(fields[j].prefix_length)) {
- if (fields[j].index != 2) continue;
- } else if (suffix == 0) {
- if (fields[j].index != 0) continue;
- } else {
- if (fields[j].index != 1) continue;
- }
- GPR_ASSERT(chrspec == NULL);
- chrspec = &fields[j];
- }
- }
- if (chrspec) {
- n += printf("%s, ", chrspec->call);
- } else {
- n += printf("ILLEGAL, ");
- }
- /* make some small effort towards readable output */
- if (n > 70) {
- printf("\n ");
- n = 2;
- }
- }
- printf("};\n");
-}
-
-/*
* Huffman decoder table generation
*/
@@ -325,29 +239,9 @@ static void generate_base64_huff_encoder_table(void) {
printf("};\n");
}
-static void generate_base64_inverse_table(void) {
- static const char alphabet[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- unsigned char inverse[256];
- unsigned i;
-
- memset(inverse, 255, sizeof(inverse));
- for (i = 0; i < strlen(alphabet); i++) {
- inverse[(unsigned char)alphabet[i]] = (unsigned char)i;
- }
-
- printf("static const gpr_uint8 inverse_base64[256] = {");
- for (i = 0; i < 256; i++) {
- printf("%d,", inverse[i]);
- }
- printf("};\n");
-}
-
int main(void) {
generate_huff_tables();
- generate_first_byte_lut();
generate_base64_huff_encoder_table();
- generate_base64_inverse_table();
return 0;
}
diff --git a/grpc/tools/codegen/core/gen_legal_metadata_characters.cc b/grpc/tools/codegen/core/gen_legal_metadata_characters.cc
deleted file mode 100644
index fbabd246..00000000
--- a/grpc/tools/codegen/core/gen_legal_metadata_characters.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-/* generates constant table for metadata.cc */
-
-#include <stdio.h>
-#include <string.h>
-
-static unsigned char legal_bits[256 / 8];
-
-static void legal(int x) {
- int byte = x / 8;
- int bit = x % 8;
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- legal_bits[byte] =
- (unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
-}
-
-static void dump(void) {
- int i;
-
- printf("static const uint8_t legal_header_bits[256/8] = ");
- for (i = 0; i < 256 / 8; i++)
- printf("%c 0x%02x", i ? ',' : '{', legal_bits[i]);
- printf(" };\n");
-}
-
-static void clear(void) { memset(legal_bits, 0, sizeof(legal_bits)); }
-
-int main(void) {
- int i;
-
- clear();
- for (i = 'a'; i <= 'z'; i++) legal(i);
- for (i = '0'; i <= '9'; i++) legal(i);
- legal('-');
- legal('_');
- legal('.');
- dump();
-
- clear();
- for (i = 32; i <= 126; i++) {
- legal(i);
- }
- dump();
-
- return 0;
-}
diff --git a/grpc/tools/codegen/core/gen_percent_encoding_tables.cc b/grpc/tools/codegen/core/gen_percent_encoding_tables.cc
deleted file mode 100644
index a99024e5..00000000
--- a/grpc/tools/codegen/core/gen_percent_encoding_tables.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-/* generates constant table for metadata.cc */
-
-#include <stdio.h>
-#include <string.h>
-
-static unsigned char legal_bits[256 / 8];
-
-static void legal(int x) {
- int byte = x / 8;
- int bit = x % 8;
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- legal_bits[byte] =
- (unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
-}
-
-static void dump(const char *name) {
- int i;
-
- printf("const uint8_t %s[256/8] = ", name);
- for (i = 0; i < 256 / 8; i++)
- printf("%c 0x%02x", i ? ',' : '{', legal_bits[i]);
- printf(" };\n");
-}
-
-static void clear(void) { memset(legal_bits, 0, sizeof(legal_bits)); }
-
-int main(void) {
- int i;
-
- clear();
- for (i = 'a'; i <= 'z'; i++) legal(i);
- for (i = 'A'; i <= 'Z'; i++) legal(i);
- for (i = '0'; i <= '9'; i++) legal(i);
- legal('-');
- legal('_');
- legal('.');
- legal('~');
- dump("grpc_url_percent_encoding_unreserved_bytes");
-
- clear();
- for (i = 32; i <= 126; i++) {
- if (i == '%') continue;
- legal(i);
- }
- dump("grpc_compatible_percent_encoding_unreserved_bytes");
-
- return 0;
-}
diff --git a/grpc/tools/codegen/core/gen_server_registered_method_bad_client_test_body.py b/grpc/tools/codegen/core/gen_server_registered_method_bad_client_test_body.py
index 14fbb9ca..f4f25a69 100755
--- a/grpc/tools/codegen/core/gen_server_registered_method_bad_client_test_body.py
+++ b/grpc/tools/codegen/core/gen_server_registered_method_bad_client_test_body.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
@@ -49,7 +49,8 @@ for message_length in range(0, 3):
] + payload[0:frame_length]
text = esc_c(frame)
if text not in done:
- print 'GRPC_RUN_BAD_CLIENT_TEST(verifier_%s, PFX_STR %s, %s);' % (
- 'succeeds' if is_end else 'fails', text,
- '0' if is_end else 'GRPC_BAD_CLIENT_DISCONNECT')
+ print(
+ ('GRPC_RUN_BAD_CLIENT_TEST(verifier_%s, PFX_STR %s, %s);' %
+ ('succeeds' if is_end else 'fails', text,
+ '0' if is_end else 'GRPC_BAD_CLIENT_DISCONNECT')))
done.add(text)
diff --git a/grpc/tools/codegen/core/gen_settings_ids.py b/grpc/tools/codegen/core/gen_settings_ids.py
index fb035add..b860d463 100755
--- a/grpc/tools/codegen/core/gen_settings_ids.py
+++ b/grpc/tools/codegen/core/gen_settings_ids.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
@@ -14,10 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import print_function
+
import collections
-import perfection
import sys
+import perfection
+
_MAX_HEADER_LIST_SIZE = 16 * 1024 * 1024
Setting = collections.namedtuple('Setting', 'id default min max on_error')
@@ -56,11 +59,11 @@ C = open('src/core/ext/transport/chttp2/transport/http2_settings.c', 'w')
# utility: print a big comment block into a set of files
def put_banner(files, banner):
for f in files:
- print >> f, '/*'
+ print('/*', file=f)
for line in banner:
- print >> f, ' * %s' % line
- print >> f, ' */'
- print >> f
+ print(' * %s' % line, file=f)
+ print(' */', file=f)
+ print(file=f)
# copy-paste copyright notice from this file
@@ -83,79 +86,89 @@ put_banner(
[H, C],
["Automatically generated by tools/codegen/core/gen_settings_ids.py"])
-print >> H, "#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H"
-print >> H, "#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H"
-print >> H
-print >> H, "#include <stdint.h>"
-print >> H, "#include <stdbool.h>"
-print >> H
+print("#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H",
+ file=H)
+print("#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H",
+ file=H)
+print(file=H)
+print("#include <stdint.h>", file=H)
+print("#include <stdbool.h>", file=H)
+print(file=H)
-print >> C, "#include \"src/core/ext/transport/chttp2/transport/http2_settings.h\""
-print >> C
-print >> C, "#include <grpc/support/useful.h>"
-print >> C, "#include \"src/core/lib/transport/http2_errors.h\""
-print >> C
+print("#include \"src/core/ext/transport/chttp2/transport/http2_settings.h\"",
+ file=C)
+print(file=C)
+print("#include <grpc/support/useful.h>", file=C)
+print("#include \"src/core/lib/transport/http2_errors.h\"", file=C)
+print(file=C)
-p = perfection.hash_parameters(sorted(x.id for x in _SETTINGS.values()))
-print p
+p = perfection.hash_parameters(sorted(x.id for x in list(_SETTINGS.values())))
+print(p)
def hash(i):
i += p.offset
x = i % p.t
- y = i / p.t
+ y = i // p.t
return x + p.r[y]
decorated_settings = [
DecoratedSetting(hash(setting.id), name, setting)
- for name, setting in _SETTINGS.iteritems()
+ for name, setting in _SETTINGS.items()
]
-print >> H, 'typedef enum {'
+print('typedef enum {', file=H)
for decorated_setting in sorted(decorated_settings):
- print >> H, ' GRPC_CHTTP2_SETTINGS_%s = %d, /* wire id %d */' % (
- decorated_setting.name, decorated_setting.enum,
- decorated_setting.setting.id)
-print >> H, '} grpc_chttp2_setting_id;'
-print >> H
-print >> H, '#define GRPC_CHTTP2_NUM_SETTINGS %d' % (
- max(x.enum for x in decorated_settings) + 1)
-
-print >> H, 'extern const uint16_t grpc_setting_id_to_wire_id[];'
-print >> C, 'const uint16_t grpc_setting_id_to_wire_id[] = {%s};' % ','.join(
- '%d' % s for s in p.slots)
-print >> H
-print >> H, "bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);"
+ print(' GRPC_CHTTP2_SETTINGS_%s = %d, /* wire id %d */' %
+ (decorated_setting.name, decorated_setting.enum,
+ decorated_setting.setting.id),
+ file=H)
+print('} grpc_chttp2_setting_id;', file=H)
+print(file=H)
+print('#define GRPC_CHTTP2_NUM_SETTINGS %d' %
+ (max(x.enum for x in decorated_settings) + 1),
+ file=H)
+
+print('extern const uint16_t grpc_setting_id_to_wire_id[];', file=H)
+print('const uint16_t grpc_setting_id_to_wire_id[] = {%s};' %
+ ','.join('%d' % s for s in p.slots),
+ file=C)
+print(file=H)
+print(
+ "bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);",
+ file=H)
cgargs = {
'r': ','.join('%d' % (r if r is not None else 0) for r in p.r),
't': p.t,
'offset': abs(p.offset),
'offset_sign': '+' if p.offset > 0 else '-'
}
-print >> C, """
+print("""
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out) {
uint32_t i = wire_id %(offset_sign)s %(offset)d;
uint32_t x = i %% %(t)d;
uint32_t y = i / %(t)d;
uint32_t h = x;
switch (y) {
-""" % cgargs
+""" % cgargs,
+ file=C)
for i, r in enumerate(p.r):
if not r:
continue
if r < 0:
- print >> C, 'case %d: h -= %d; break;' % (i, -r)
+ print('case %d: h -= %d; break;' % (i, -r), file=C)
else:
- print >> C, 'case %d: h += %d; break;' % (i, r)
-print >> C, """
+ print('case %d: h += %d; break;' % (i, r), file=C)
+print("""
}
*out = (grpc_chttp2_setting_id)h;
return h < GPR_ARRAY_SIZE(grpc_setting_id_to_wire_id) && grpc_setting_id_to_wire_id[h] == wire_id;
}
-""" % cgargs
+""" % cgargs,
+ file=C)
-print >> H, """
+print("""
typedef enum {
GRPC_CHTTP2_CLAMP_INVALID_VALUE,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
@@ -171,26 +184,33 @@ typedef struct {
} grpc_chttp2_setting_parameters;
extern const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
-"""
-print >> C, "const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {"
+""",
+ file=H)
+print(
+ "const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {",
+ file=C)
i = 0
for decorated_setting in sorted(decorated_settings):
while i < decorated_setting.enum:
- print >> C, "{NULL, 0, 0, 0, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},"
+ print(
+ "{NULL, 0, 0, 0, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},",
+ file=C)
i += 1
- print >> C, "{\"%s\", %du, %du, %du, GRPC_CHTTP2_%s, GRPC_HTTP2_%s}," % (
+ print("{\"%s\", %du, %du, %du, GRPC_CHTTP2_%s, GRPC_HTTP2_%s}," % (
decorated_setting.name,
decorated_setting.setting.default,
decorated_setting.setting.min,
decorated_setting.setting.max,
decorated_setting.setting.on_error.behavior,
decorated_setting.setting.on_error.code,
- )
+ ),
+ file=C)
i += 1
-print >> C, "};"
+print("};", file=C)
-print >> H
-print >> H, "#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */"
+print(file=H)
+print("#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */",
+ file=H)
H.close()
C.close()
diff --git a/grpc/tools/codegen/core/gen_static_metadata.py b/grpc/tools/codegen/core/gen_static_metadata.py
deleted file mode 100755
index 08cc1390..00000000
--- a/grpc/tools/codegen/core/gen_static_metadata.py
+++ /dev/null
@@ -1,743 +0,0 @@
-#!/usr/bin/env python2.7
-
-# 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.
-
-import hashlib
-import itertools
-import collections
-import os
-import sys
-import subprocess
-import re
-import perfection
-
-# Configuration: a list of either strings or 2-tuples of strings.
-# A single string represents a static grpc_mdstr.
-# A 2-tuple represents a static grpc_mdelem (and appropriate grpc_mdstrs will
-# also be created).
-# The list of 2-tuples must begin with the static hpack table elements as
-# defined by RFC 7541 and be in the same order because of an hpack encoding
-# performance optimization that relies on this. If you want to change this, then
-# you must change the implementation of the encoding optimization as well.
-
-CONFIG = [
- # metadata strings
- 'host',
- 'grpc-timeout',
- 'grpc-internal-encoding-request',
- 'grpc-internal-stream-encoding-request',
- 'grpc-payload-bin',
- ':path',
- 'grpc-encoding',
- 'grpc-accept-encoding',
- 'user-agent',
- ':authority',
- 'grpc-message',
- 'grpc-status',
- 'grpc-server-stats-bin',
- 'grpc-tags-bin',
- 'grpc-trace-bin',
- 'grpc-previous-rpc-attempts',
- 'grpc-retry-pushback-ms',
- '1',
- '2',
- '3',
- '4',
- '',
- 'x-endpoint-load-metrics-bin',
- # channel arg keys
- 'grpc.wait_for_ready',
- 'grpc.timeout',
- 'grpc.max_request_message_bytes',
- 'grpc.max_response_message_bytes',
- # well known method names
- '/grpc.lb.v1.LoadBalancer/BalanceLoad',
- '/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats',
- '/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats',
- '/grpc.health.v1.Health/Watch',
- '/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources',
- '/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources',
- # compression algorithm names
- 'deflate',
- 'gzip',
- 'stream/gzip',
- # metadata elements
- # begin hpack static elements
- (':authority', ''),
- (':method', 'GET'),
- (':method', 'POST'),
- (':path', '/'),
- (':path', '/index.html'),
- (':scheme', 'http'),
- (':scheme', 'https'),
- (':status', '200'),
- (':status', '204'),
- (':status', '206'),
- (':status', '304'),
- (':status', '400'),
- (':status', '404'),
- (':status', '500'),
- ('accept-charset', ''),
- ('accept-encoding', 'gzip, deflate'),
- ('accept-language', ''),
- ('accept-ranges', ''),
- ('accept', ''),
- ('access-control-allow-origin', ''),
- ('age', ''),
- ('allow', ''),
- ('authorization', ''),
- ('cache-control', ''),
- ('content-disposition', ''),
- ('content-encoding', ''),
- ('content-language', ''),
- ('content-length', ''),
- ('content-location', ''),
- ('content-range', ''),
- ('content-type', ''),
- ('cookie', ''),
- ('date', ''),
- ('etag', ''),
- ('expect', ''),
- ('expires', ''),
- ('from', ''),
- ('host', ''),
- ('if-match', ''),
- ('if-modified-since', ''),
- ('if-none-match', ''),
- ('if-range', ''),
- ('if-unmodified-since', ''),
- ('last-modified', ''),
- ('link', ''),
- ('location', ''),
- ('max-forwards', ''),
- ('proxy-authenticate', ''),
- ('proxy-authorization', ''),
- ('range', ''),
- ('referer', ''),
- ('refresh', ''),
- ('retry-after', ''),
- ('server', ''),
- ('set-cookie', ''),
- ('strict-transport-security', ''),
- ('transfer-encoding', ''),
- ('user-agent', ''),
- ('vary', ''),
- ('via', ''),
- ('www-authenticate', ''),
- # end hpack static elements
- ('grpc-status', '0'),
- ('grpc-status', '1'),
- ('grpc-status', '2'),
- ('grpc-encoding', 'identity'),
- ('grpc-encoding', 'gzip'),
- ('grpc-encoding', 'deflate'),
- ('te', 'trailers'),
- ('content-type', 'application/grpc'),
- (':scheme', 'grpc'),
- (':method', 'PUT'),
- ('accept-encoding', ''),
- ('content-encoding', 'identity'),
- ('content-encoding', 'gzip'),
- ('lb-cost-bin', ''),
-]
-
-# All entries here are ignored when counting non-default initial metadata that
-# prevents the chttp2 server from sending a Trailers-Only response.
-METADATA_BATCH_CALLOUTS = [
- ':path',
- ':method',
- ':status',
- ':authority',
- ':scheme',
- 'te',
- 'grpc-message',
- 'grpc-status',
- 'grpc-payload-bin',
- 'grpc-encoding',
- 'grpc-accept-encoding',
- 'grpc-server-stats-bin',
- 'grpc-tags-bin',
- 'grpc-trace-bin',
- 'content-type',
- 'content-encoding',
- 'accept-encoding',
- 'grpc-internal-encoding-request',
- 'grpc-internal-stream-encoding-request',
- 'user-agent',
- 'host',
- 'grpc-previous-rpc-attempts',
- 'grpc-retry-pushback-ms',
- 'x-endpoint-load-metrics-bin',
-]
-
-COMPRESSION_ALGORITHMS = [
- 'identity',
- 'deflate',
- 'gzip',
-]
-
-STREAM_COMPRESSION_ALGORITHMS = [
- 'identity',
- 'gzip',
-]
-
-
-# utility: mangle the name of a config
-def mangle(elem, name=None):
- xl = {
- '-': '_',
- ':': '',
- '/': 'slash',
- '.': 'dot',
- ',': 'comma',
- ' ': '_',
- }
-
- def m0(x):
- if not x:
- return 'empty'
- r = ''
- for c in x:
- put = xl.get(c, c.lower())
- if not put:
- continue
- last_is_underscore = r[-1] == '_' if r else True
- if last_is_underscore and put == '_':
- continue
- elif len(put) > 1:
- if not last_is_underscore:
- r += '_'
- r += put
- r += '_'
- else:
- r += put
- if r[-1] == '_':
- r = r[:-1]
- return r
-
- def n(default, name=name):
- if name is None:
- return 'grpc_%s_' % default
- if name == '':
- return ''
- return 'grpc_%s_' % name
-
- if isinstance(elem, tuple):
- return '%s%s_%s' % (n('mdelem'), m0(elem[0]), m0(elem[1]))
- else:
- return '%s%s' % (n('mdstr'), m0(elem))
-
-
-# utility: generate some hash value for a string
-def fake_hash(elem):
- return hashlib.md5(elem).hexdigest()[0:8]
-
-
-# utility: print a big comment block into a set of files
-def put_banner(files, banner):
- for f in files:
- print >> f, '/*'
- for line in banner:
- print >> f, ' * %s' % line
- print >> f, ' */'
- print >> f
-
-
-# build a list of all the strings we need
-all_strs = list()
-all_elems = list()
-static_userdata = {}
-# put metadata batch callouts first, to make the check of if a static metadata
-# string is a callout trivial
-for elem in METADATA_BATCH_CALLOUTS:
- if elem not in all_strs:
- all_strs.append(elem)
-for elem in CONFIG:
- if isinstance(elem, tuple):
- if elem[0] not in all_strs:
- all_strs.append(elem[0])
- if elem[1] not in all_strs:
- all_strs.append(elem[1])
- if elem not in all_elems:
- all_elems.append(elem)
- else:
- if elem not in all_strs:
- all_strs.append(elem)
-compression_elems = []
-for mask in range(1, 1 << len(COMPRESSION_ALGORITHMS)):
- val = ','.join(COMPRESSION_ALGORITHMS[alg]
- for alg in range(0, len(COMPRESSION_ALGORITHMS))
- if (1 << alg) & mask)
- elem = ('grpc-accept-encoding', val)
- if val not in all_strs:
- all_strs.append(val)
- if elem not in all_elems:
- all_elems.append(elem)
- compression_elems.append(elem)
- static_userdata[elem] = 1 + (mask | 1)
-stream_compression_elems = []
-for mask in range(1, 1 << len(STREAM_COMPRESSION_ALGORITHMS)):
- val = ','.join(STREAM_COMPRESSION_ALGORITHMS[alg]
- for alg in range(0, len(STREAM_COMPRESSION_ALGORITHMS))
- if (1 << alg) & mask)
- elem = ('accept-encoding', val)
- if val not in all_strs:
- all_strs.append(val)
- if elem not in all_elems:
- all_elems.append(elem)
- stream_compression_elems.append(elem)
- static_userdata[elem] = 1 + (mask | 1)
-
-# output configuration
-args = sys.argv[1:]
-H = None
-C = None
-D = None
-if args:
- if 'header' in args:
- H = sys.stdout
- else:
- H = open('/dev/null', 'w')
- if 'source' in args:
- C = sys.stdout
- else:
- C = open('/dev/null', 'w')
- if 'dictionary' in args:
- D = sys.stdout
- else:
- D = open('/dev/null', 'w')
-else:
- H = open(
- os.path.join(os.path.dirname(sys.argv[0]),
- '../../../src/core/lib/transport/static_metadata.h'), 'w')
- C = open(
- os.path.join(os.path.dirname(sys.argv[0]),
- '../../../src/core/lib/transport/static_metadata.cc'), 'w')
- D = open(
- os.path.join(os.path.dirname(sys.argv[0]),
- '../../../test/core/end2end/fuzzers/hpack.dictionary'),
- 'w')
-
-# copy-paste copyright notice from this file
-with open(sys.argv[0]) as my_source:
- copyright = []
- for line in my_source:
- if line[0] != '#':
- break
- for line in my_source:
- if line[0] == '#':
- copyright.append(line)
- break
- for line in my_source:
- if line[0] != '#':
- break
- copyright.append(line)
- put_banner([H, C], [line[2:].rstrip() for line in copyright])
-
-hex_bytes = [ord(c) for c in 'abcdefABCDEF0123456789']
-
-
-def esc_dict(line):
- out = "\""
- for c in line:
- if 32 <= c < 127:
- if c != ord('"'):
- out += chr(c)
- else:
- out += "\\\""
- else:
- out += '\\x%02X' % c
- return out + "\""
-
-
-put_banner([H, C], """WARNING: Auto-generated code.
-
-To make changes to this file, change
-tools/codegen/core/gen_static_metadata.py, and then re-run it.
-
-See metadata.h for an explanation of the interface here, and metadata.cc for
-an explanation of what's going on.
-""".splitlines())
-
-print >> H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
-print >> H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
-print >> H
-print >> H, '#include <grpc/support/port_platform.h>'
-print >> H
-print >> H, '#include <cstdint>'
-print >> H
-print >> H, '#include "src/core/lib/transport/metadata.h"'
-print >> H
-print >> C, '#include <grpc/support/port_platform.h>'
-print >> C
-print >> C, '#include "src/core/lib/transport/static_metadata.h"'
-print >> C
-print >> C, '#include "src/core/lib/slice/slice_internal.h"'
-print >> C
-
-str_ofs = 0
-id2strofs = {}
-for i, elem in enumerate(all_strs):
- id2strofs[i] = str_ofs
- str_ofs += len(elem)
-
-
-def slice_def_for_ctx(i):
- return (
- 'grpc_core::StaticMetadataSlice(&refcounts[%d].base, %d, g_bytes+%d)'
- ) % (i, len(all_strs[i]), id2strofs[i])
-
-
-def slice_def(i):
- return (
- 'grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts()[%d].base, %d, g_bytes+%d)'
- ) % (i, len(all_strs[i]), id2strofs[i])
-
-
-def str_idx(s):
- for i, s2 in enumerate(all_strs):
- if s == s2:
- return i
-
-
-# validate configuration
-for elem in METADATA_BATCH_CALLOUTS:
- assert elem in all_strs
-static_slice_dest_assert = (
- 'static_assert(std::is_trivially_destructible' +
- '<grpc_core::StaticMetadataSlice>::value, '
- '"grpc_core::StaticMetadataSlice must be trivially destructible.");')
-print >> H, static_slice_dest_assert
-print >> H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs)
-print >> H, '''
-void grpc_init_static_metadata_ctx(void);
-void grpc_destroy_static_metadata_ctx(void);
-namespace grpc_core {
-#ifndef NDEBUG
-constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
-uint64_t StaticMetadataInitCanary();
-#endif
-extern const StaticMetadataSlice* g_static_metadata_slice_table;
-}
-inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary()
- == grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_table != nullptr);
- return grpc_core::g_static_metadata_slice_table;
-}
-'''
-for i, elem in enumerate(all_strs):
- print >> H, '/* "%s" */' % elem
- print >> H, '#define %s (grpc_static_slice_table()[%d])' % (
- mangle(elem).upper(), i)
-print >> H
-print >> C, 'static constexpr uint8_t g_bytes[] = {%s};' % (','.join(
- '%d' % ord(c) for c in ''.join(all_strs)))
-print >> C
-print >> H, '''
-namespace grpc_core {
-struct StaticSliceRefcount;
-extern StaticSliceRefcount* g_static_metadata_slice_refcounts;
-}
-inline grpc_core::StaticSliceRefcount* grpc_static_metadata_refcounts() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary()
- == grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_refcounts != nullptr);
- return grpc_core::g_static_metadata_slice_refcounts;
-}
-'''
-print >> C, 'grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount;'
-print >> C, '''
-namespace grpc_core {
-struct StaticMetadataCtx {
-#ifndef NDEBUG
- const uint64_t init_canary = kGrpcStaticMetadataInitCanary;
-#endif
- StaticSliceRefcount
- refcounts[GRPC_STATIC_MDSTR_COUNT] = {
-'''
-for i, elem in enumerate(all_strs):
- print >> C, ' StaticSliceRefcount(%d), ' % i
-print >> C, '};' # static slice refcounts
-print >> C
-print >> C, '''
- const StaticMetadataSlice
- slices[GRPC_STATIC_MDSTR_COUNT] = {
-'''
-for i, elem in enumerate(all_strs):
- print >> C, slice_def_for_ctx(i) + ','
-print >> C, '};' # static slices
-print >> C, 'StaticMetadata static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {'
-for idx, (a, b) in enumerate(all_elems):
- print >> C, 'StaticMetadata(%s,%s, %d),' % (slice_def_for_ctx(
- str_idx(a)), slice_def_for_ctx(str_idx(b)), idx)
-print >> C, '};' # static_mdelem_table
-print >> C, ('''
-/* Warning: the core static metadata currently operates under the soft constraint
-that the first GRPC_CHTTP2_LAST_STATIC_ENTRY (61) entries must contain
-metadata specified by the http2 hpack standard. The CHTTP2 transport reads the
-core metadata with this assumption in mind. If the order of the core static
-metadata is to be changed, then the CHTTP2 transport must be changed as well to
-stop relying on the core metadata. */
-''')
-print >> C, ('grpc_mdelem '
- 'static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT] = {')
-print >> C, '// clang-format off'
-static_mds = []
-for i, elem in enumerate(all_elems):
- md_name = mangle(elem).upper()
- md_human_readable = '"%s": "%s"' % elem
- md_spec = ' /* %s: \n %s */\n' % (md_name, md_human_readable)
- md_spec += ' GRPC_MAKE_MDELEM(\n'
- md_spec += ((' &static_mdelem_table[%d].data(),\n' % i) +
- ' GRPC_MDELEM_STORAGE_STATIC)')
- static_mds.append(md_spec)
-print >> C, ',\n'.join(static_mds)
-print >> C, '// clang-format on'
-print >> C, ('};') # static_mdelem_manifested
-print >> C, '};' # struct StaticMetadataCtx
-print >> C, '}' # namespace grpc_core
-print >> C, '''
-namespace grpc_core {
-static StaticMetadataCtx* g_static_metadata_slice_ctx = nullptr;
-const StaticMetadataSlice* g_static_metadata_slice_table = nullptr;
-StaticSliceRefcount* g_static_metadata_slice_refcounts = nullptr;
-StaticMetadata* g_static_mdelem_table = nullptr;
-grpc_mdelem* g_static_mdelem_manifested = nullptr;
-#ifndef NDEBUG
-uint64_t StaticMetadataInitCanary() {
- return g_static_metadata_slice_ctx->init_canary;
-}
-#endif
-}
-
-void grpc_init_static_metadata_ctx(void) {
- grpc_core::g_static_metadata_slice_ctx
- = new grpc_core::StaticMetadataCtx();
- grpc_core::g_static_metadata_slice_table
- = grpc_core::g_static_metadata_slice_ctx->slices;
- grpc_core::g_static_metadata_slice_refcounts
- = grpc_core::g_static_metadata_slice_ctx->refcounts;
- grpc_core::g_static_mdelem_table
- = grpc_core::g_static_metadata_slice_ctx->static_mdelem_table;
- grpc_core::g_static_mdelem_manifested =
- grpc_core::g_static_metadata_slice_ctx->static_mdelem_manifested;
-}
-
-void grpc_destroy_static_metadata_ctx(void) {
- delete grpc_core::g_static_metadata_slice_ctx;
- grpc_core::g_static_metadata_slice_ctx = nullptr;
- grpc_core::g_static_metadata_slice_table = nullptr;
- grpc_core::g_static_metadata_slice_refcounts = nullptr;
- grpc_core::g_static_mdelem_table = nullptr;
- grpc_core::g_static_mdelem_manifested = nullptr;
-}
-
-'''
-
-print >> C
-print >> H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\'
-print >> H, (' ((slice).refcount != NULL && (slice).refcount->GetType() == '
- 'grpc_slice_refcount::Type::STATIC)')
-print >> H
-print >> C
-print >> H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\'
-print >> H, '(reinterpret_cast<grpc_core::StaticSliceRefcount*>((static_slice).refcount)->index)'
-print >> H
-
-print >> D, '# hpack fuzzing dictionary'
-for i, elem in enumerate(all_strs):
- print >> D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem]))
-for i, elem in enumerate(all_elems):
- print >> D, '%s' % (esc_dict([0, len(elem[0])] + [ord(c) for c in elem[0]] +
- [len(elem[1])] + [ord(c) for c in elem[1]]))
-
-print >> H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems)
-print >> H, '''
-namespace grpc_core {
-extern StaticMetadata* g_static_mdelem_table;
-extern grpc_mdelem* g_static_mdelem_manifested;
-}
-inline grpc_core::StaticMetadata* grpc_static_mdelem_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary()
- == grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_table != nullptr);
- return grpc_core::g_static_mdelem_table;
-}
-inline grpc_mdelem* grpc_static_mdelem_manifested() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary()
- == grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_manifested != nullptr);
- return grpc_core::g_static_mdelem_manifested;
-}
-'''
-print >> H, ('extern uintptr_t '
- 'grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];')
-
-for i, elem in enumerate(all_elems):
- md_name = mangle(elem).upper()
- print >> H, '/* "%s": "%s" */' % elem
- print >> H, ('#define %s (grpc_static_mdelem_manifested()[%d])' %
- (md_name, i))
-print >> H
-
-print >> C, ('uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] '
- '= {')
-print >> C, ' %s' % ','.join(
- '%d' % static_userdata.get(elem, 0) for elem in all_elems)
-print >> C, '};'
-print >> C
-
-
-def md_idx(m):
- for i, m2 in enumerate(all_elems):
- if m == m2:
- return i
-
-
-def offset_trials(mink):
- yield 0
- for i in range(1, 100):
- for mul in [-1, 1]:
- yield mul * i
-
-
-def perfect_hash(keys, name):
- p = perfection.hash_parameters(keys)
-
- def f(i, p=p):
- i += p.offset
- x = i % p.t
- y = i / p.t
- return x + p.r[y]
-
- return {
- 'PHASHNKEYS':
- len(p.slots),
- 'pyfunc':
- f,
- 'code':
- """
-static const int8_t %(name)s_r[] = {%(r)s};
-static uint32_t %(name)s_phash(uint32_t i) {
- i %(offset_sign)s= %(offset)d;
- uint32_t x = i %% %(t)d;
- uint32_t y = i / %(t)d;
- uint32_t h = x;
- if (y < GPR_ARRAY_SIZE(%(name)s_r)) {
- uint32_t delta = static_cast<uint32_t>(%(name)s_r[y]);
- h += delta;
- }
- return h;
-}
- """ % {
- 'name': name,
- 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r),
- 't': p.t,
- 'offset': abs(p.offset),
- 'offset_sign': '+' if p.offset > 0 else '-'
- }
- }
-
-
-elem_keys = [
- str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems
-]
-elem_hash = perfect_hash(elem_keys, 'elems')
-print >> C, elem_hash['code']
-
-keys = [0] * int(elem_hash['PHASHNKEYS'])
-idxs = [255] * int(elem_hash['PHASHNKEYS'])
-for i, k in enumerate(elem_keys):
- h = elem_hash['pyfunc'](k)
- assert keys[h] == 0
- keys[h] = k
- idxs[h] = i
-print >> C, 'static const uint16_t elem_keys[] = {%s};' % ','.join(
- '%d' % k for k in keys)
-print >> C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join(
- '%d' % i for i in idxs)
-print >> C
-
-print >> H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b);'
-print >> C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) {'
-print >> C, ' if (a == -1 || b == -1) return GRPC_MDNULL;'
-print >> C, ' uint32_t k = static_cast<uint32_t>(a * %d + b);' % len(all_strs)
-print >> C, ' uint32_t h = elems_phash(k);'
-print >> C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k && elem_idxs[h] != 255 ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table()[elem_idxs[h]].data(), GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;'
-print >> C, '}'
-print >> C
-
-print >> H, 'typedef enum {'
-for elem in METADATA_BATCH_CALLOUTS:
- print >> H, ' %s,' % mangle(elem, 'batch').upper()
-print >> H, ' GRPC_BATCH_CALLOUTS_COUNT'
-print >> H, '} grpc_metadata_batch_callouts_index;'
-print >> H
-print >> H, 'typedef union {'
-print >> H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];'
-print >> H, ' struct {'
-for elem in METADATA_BATCH_CALLOUTS:
- print >> H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower()
-print >> H, ' } named;'
-print >> H, '} grpc_metadata_batch_callouts;'
-print >> H
-
-batch_idx_of_hdr = '#define GRPC_BATCH_INDEX_OF(slice) \\'
-static_slice = 'GRPC_IS_STATIC_METADATA_STRING((slice))'
-slice_to_slice_ref = '(slice).refcount'
-static_slice_ref_type = 'grpc_core::StaticSliceRefcount*'
-slice_ref_as_static = ('reinterpret_cast<' + static_slice_ref_type + '>(' +
- slice_to_slice_ref + ')')
-slice_ref_idx = slice_ref_as_static + '->index'
-batch_idx_type = 'grpc_metadata_batch_callouts_index'
-slice_ref_idx_to_batch_idx = ('static_cast<' + batch_idx_type + '>(' +
- slice_ref_idx + ')')
-batch_invalid_idx = 'GRPC_BATCH_CALLOUTS_COUNT'
-batch_invalid_u32 = 'static_cast<uint32_t>(' + batch_invalid_idx + ')'
-# Assemble GRPC_BATCH_INDEX_OF(slice) macro as a join for ease of reading.
-batch_idx_of_pieces = [
- batch_idx_of_hdr, '\n', '(', static_slice, '&&', slice_ref_idx, '<=',
- batch_invalid_u32, '?', slice_ref_idx_to_batch_idx, ':', batch_invalid_idx,
- ')'
-]
-print >> H, ''.join(batch_idx_of_pieces)
-print >> H
-
-print >> H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % (
- 1 << len(COMPRESSION_ALGORITHMS))
-print >> C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % (
- 1 << len(COMPRESSION_ALGORITHMS))
-print >> C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems)
-print >> C, '};'
-print >> C
-
-print >> H, '#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table()[grpc_static_accept_encoding_metadata[(algs)]].data(), GRPC_MDELEM_STORAGE_STATIC))'
-print >> H
-
-print >> H, 'extern const uint8_t grpc_static_accept_stream_encoding_metadata[%d];' % (
- 1 << len(STREAM_COMPRESSION_ALGORITHMS))
-print >> C, 'const uint8_t grpc_static_accept_stream_encoding_metadata[%d] = {' % (
- 1 << len(STREAM_COMPRESSION_ALGORITHMS))
-print >> C, '0,%s' % ','.join(
- '%d' % md_idx(elem) for elem in stream_compression_elems)
-print >> C, '};'
-
-print >> H, '#define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table()[grpc_static_accept_stream_encoding_metadata[(algs)]].data(), GRPC_MDELEM_STORAGE_STATIC))'
-
-print >> H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */'
-
-H.close()
-C.close()
diff --git a/grpc/tools/codegen/core/gen_stats_data.py b/grpc/tools/codegen/core/gen_stats_data.py
index f1bea067..9b7ff938 100755
--- a/grpc/tools/codegen/core/gen_stats_data.py
+++ b/grpc/tools/codegen/core/gen_stats_data.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
@@ -14,12 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from __future__ import print_function
+
import collections
import ctypes
+import json
import math
import sys
+
import yaml
-import json
with open('src/core/lib/debug/stats_data.yaml') as f:
attrs = yaml.load(f.read())
@@ -33,10 +36,11 @@ def make_type(name, fields):
def c_str(s, encoding='ascii'):
- if isinstance(s, unicode):
+ if isinstance(s, str):
s = s.encode(encoding)
result = ''
for c in s:
+ c = chr(c) if isinstance(c, int) else c
if not (32 <= ord(c) < 127) or c in ('\\', '"'):
result += '\\%03o' % ord(c)
else:
@@ -80,7 +84,7 @@ def shift_works_until(mapped_bounds, shift_bits):
def find_ideal_shift(mapped_bounds, max_size):
best = None
- for shift_bits in reversed(range(0, 64)):
+ for shift_bits in reversed(list(range(0, 64))):
n = shift_works_until(mapped_bounds, shift_bits)
if n == 0:
continue
@@ -93,16 +97,16 @@ def find_ideal_shift(mapped_bounds, max_size):
best = (shift_bits, n, table_size)
elif best[1] < n:
best = (shift_bits, n, table_size)
- print best
+ print(best)
return best
def gen_map_table(mapped_bounds, shift_data):
tbl = []
cur = 0
- print mapped_bounds
+ print(mapped_bounds)
mapped_bounds = [x >> shift_data[0] for x in mapped_bounds]
- print mapped_bounds
+ print(mapped_bounds)
for i in range(0, mapped_bounds[shift_data[1] - 1]):
while i > mapped_bounds[cur]:
cur += 1
@@ -119,7 +123,7 @@ def decl_static_table(values, type):
for i, vp in enumerate(static_tables):
if v == vp:
return i
- print "ADD TABLE: %s %r" % (type, values)
+ print("ADD TABLE: %s %r" % (type, values))
r = len(static_tables)
static_tables.append(v)
return r
@@ -165,7 +169,7 @@ def gen_bucket_code(histogram):
256 * histogram.buckets)
#print first_nontrivial, shift_data, bounds
#if shift_data is not None: print [hex(x >> shift_data[0]) for x in code_bounds[first_nontrivial:]]
- code = 'value = GPR_CLAMP(value, 0, %d);\n' % histogram.max
+ code = 'value = grpc_core::Clamp(value, 0, %d);\n' % histogram.max
map_table = gen_map_table(code_bounds[first_nontrivial:], shift_data)
if first_nontrivial is None:
code += ('GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_%s, value);\n' %
@@ -204,11 +208,11 @@ def gen_bucket_code(histogram):
# utility: print a big comment block into a set of files
def put_banner(files, banner):
for f in files:
- print >> f, '/*'
+ print('/*', file=f)
for line in banner:
- print >> f, ' * %s' % line
- print >> f, ' */'
- print >> f
+ print(' * %s' % line, file=f)
+ print(' */', file=f)
+ print(file=f)
with open('src/core/lib/debug/stats_data.h', 'w') as H:
@@ -232,77 +236,90 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H:
[H],
["Automatically generated by tools/codegen/core/gen_stats_data.py"])
- print >> H, "#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
- print >> H, "#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
- print >> H
- print >> H, "#include <grpc/support/port_platform.h>"
- print >> H
- print >> H, "#include <inttypes.h>"
- print >> H, "#include \"src/core/lib/iomgr/exec_ctx.h\""
- print >> H
+ print("#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H", file=H)
+ print("#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H", file=H)
+ print(file=H)
+ print("#include <grpc/support/port_platform.h>", file=H)
+ print(file=H)
+ print("#include <inttypes.h>", file=H)
+ print("#include \"src/core/lib/iomgr/exec_ctx.h\"", file=H)
+ print(file=H)
for typename, instances in sorted(inst_map.items()):
- print >> H, "typedef enum {"
+ print("typedef enum {", file=H)
for inst in instances:
- print >> H, " GRPC_STATS_%s_%s," % (typename.upper(),
- inst.name.upper())
- print >> H, " GRPC_STATS_%s_COUNT" % (typename.upper())
- print >> H, "} grpc_stats_%ss;" % (typename.lower())
- print >> H, "extern const char *grpc_stats_%s_name[GRPC_STATS_%s_COUNT];" % (
- typename.lower(), typename.upper())
- print >> H, "extern const char *grpc_stats_%s_doc[GRPC_STATS_%s_COUNT];" % (
- typename.lower(), typename.upper())
+ print(" GRPC_STATS_%s_%s," % (typename.upper(), inst.name.upper()),
+ file=H)
+ print(" GRPC_STATS_%s_COUNT" % (typename.upper()), file=H)
+ print("} grpc_stats_%ss;" % (typename.lower()), file=H)
+ print("extern const char *grpc_stats_%s_name[GRPC_STATS_%s_COUNT];" %
+ (typename.lower(), typename.upper()),
+ file=H)
+ print("extern const char *grpc_stats_%s_doc[GRPC_STATS_%s_COUNT];" %
+ (typename.lower(), typename.upper()),
+ file=H)
histo_start = []
histo_buckets = []
histo_bucket_boundaries = []
- print >> H, "typedef enum {"
+ print("typedef enum {", file=H)
first_slot = 0
for histogram in inst_map['Histogram']:
histo_start.append(first_slot)
histo_buckets.append(histogram.buckets)
- print >> H, " GRPC_STATS_HISTOGRAM_%s_FIRST_SLOT = %d," % (
- histogram.name.upper(), first_slot)
- print >> H, " GRPC_STATS_HISTOGRAM_%s_BUCKETS = %d," % (
- histogram.name.upper(), histogram.buckets)
+ print(" GRPC_STATS_HISTOGRAM_%s_FIRST_SLOT = %d," %
+ (histogram.name.upper(), first_slot),
+ file=H)
+ print(" GRPC_STATS_HISTOGRAM_%s_BUCKETS = %d," %
+ (histogram.name.upper(), histogram.buckets),
+ file=H)
first_slot += histogram.buckets
- print >> H, " GRPC_STATS_HISTOGRAM_BUCKETS = %d" % first_slot
- print >> H, "} grpc_stats_histogram_constants;"
+ print(" GRPC_STATS_HISTOGRAM_BUCKETS = %d" % first_slot, file=H)
+ print("} grpc_stats_histogram_constants;", file=H)
- print >> H, "#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG)"
+ print("#if defined(GRPC_COLLECT_STATS) || !defined(NDEBUG)", file=H)
for ctr in inst_map['Counter']:
- print >> H, ("#define GRPC_STATS_INC_%s() " +
- "GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_%s)") % (
- ctr.name.upper(), ctr.name.upper())
+ print(("#define GRPC_STATS_INC_%s() " +
+ "GRPC_STATS_INC_COUNTER(GRPC_STATS_COUNTER_%s)") %
+ (ctr.name.upper(), ctr.name.upper()),
+ file=H)
for histogram in inst_map['Histogram']:
- print >> H, "#define GRPC_STATS_INC_%s(value) grpc_stats_inc_%s( (int)(value))" % (
- histogram.name.upper(), histogram.name.lower())
- print >> H, "void grpc_stats_inc_%s(int x);" % histogram.name.lower()
+ print(
+ "#define GRPC_STATS_INC_%s(value) grpc_stats_inc_%s( (int)(value))"
+ % (histogram.name.upper(), histogram.name.lower()),
+ file=H)
+ print("void grpc_stats_inc_%s(int x);" % histogram.name.lower(), file=H)
- print >> H, "#else"
+ print("#else", file=H)
for ctr in inst_map['Counter']:
- print >> H, ("#define GRPC_STATS_INC_%s() ") % (ctr.name.upper())
+ print(("#define GRPC_STATS_INC_%s() ") % (ctr.name.upper()), file=H)
for histogram in inst_map['Histogram']:
- print >> H, "#define GRPC_STATS_INC_%s(value)" % (
- histogram.name.upper())
- print >> H, "#endif /* defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) */"
+ print("#define GRPC_STATS_INC_%s(value)" % (histogram.name.upper()),
+ file=H)
+ print("#endif /* defined(GRPC_COLLECT_STATS) || !defined(NDEBUG) */",
+ file=H)
for i, tbl in enumerate(static_tables):
- print >> H, "extern const %s grpc_stats_table_%d[%d];" % (tbl[0], i,
- len(tbl[1]))
-
- print >> H, "extern const int grpc_stats_histo_buckets[%d];" % len(
- inst_map['Histogram'])
- print >> H, "extern const int grpc_stats_histo_start[%d];" % len(
- inst_map['Histogram'])
- print >> H, "extern const int *const grpc_stats_histo_bucket_boundaries[%d];" % len(
- inst_map['Histogram'])
- print >> H, "extern void (*const grpc_stats_inc_histogram[%d])(int x);" % len(
- inst_map['Histogram'])
-
- print >> H
- print >> H, "#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */"
+ print("extern const %s grpc_stats_table_%d[%d];" %
+ (tbl[0], i, len(tbl[1])),
+ file=H)
+
+ print("extern const int grpc_stats_histo_buckets[%d];" %
+ len(inst_map['Histogram']),
+ file=H)
+ print("extern const int grpc_stats_histo_start[%d];" %
+ len(inst_map['Histogram']),
+ file=H)
+ print("extern const int *const grpc_stats_histo_bucket_boundaries[%d];" %
+ len(inst_map['Histogram']),
+ file=H)
+ print("extern void (*const grpc_stats_inc_histogram[%d])(int x);" %
+ len(inst_map['Histogram']),
+ file=H)
+
+ print(file=H)
+ print("#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */", file=H)
with open('src/core/lib/debug/stats_data.cc', 'w') as C:
# copy-paste copyright notice from this file
@@ -325,13 +342,13 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C:
[C],
["Automatically generated by tools/codegen/core/gen_stats_data.py"])
- print >> C, "#include <grpc/support/port_platform.h>"
- print >> C
- print >> C, "#include \"src/core/lib/debug/stats.h\""
- print >> C, "#include \"src/core/lib/debug/stats_data.h\""
- print >> C, "#include \"src/core/lib/gpr/useful.h\""
- print >> C, "#include \"src/core/lib/iomgr/exec_ctx.h\""
- print >> C
+ print("#include <grpc/support/port_platform.h>", file=C)
+ print(file=C)
+ print("#include \"src/core/lib/debug/stats.h\"", file=C)
+ print("#include \"src/core/lib/debug/stats_data.h\"", file=C)
+ print("#include \"src/core/lib/gpr/useful.h\"", file=C)
+ print("#include \"src/core/lib/iomgr/exec_ctx.h\"", file=C)
+ print(file=C)
histo_code = []
for histogram in inst_map['Histogram']:
@@ -340,36 +357,45 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C:
histo_code.append(code)
for typename, instances in sorted(inst_map.items()):
- print >> C, "const char *grpc_stats_%s_name[GRPC_STATS_%s_COUNT] = {" % (
- typename.lower(), typename.upper())
+ print("const char *grpc_stats_%s_name[GRPC_STATS_%s_COUNT] = {" %
+ (typename.lower(), typename.upper()),
+ file=C)
for inst in instances:
- print >> C, " %s," % c_str(inst.name)
- print >> C, "};"
- print >> C, "const char *grpc_stats_%s_doc[GRPC_STATS_%s_COUNT] = {" % (
- typename.lower(), typename.upper())
+ print(" %s," % c_str(inst.name), file=C)
+ print("};", file=C)
+ print("const char *grpc_stats_%s_doc[GRPC_STATS_%s_COUNT] = {" %
+ (typename.lower(), typename.upper()),
+ file=C)
for inst in instances:
- print >> C, " %s," % c_str(inst.doc)
- print >> C, "};"
+ print(" %s," % c_str(inst.doc), file=C)
+ print("};", file=C)
for i, tbl in enumerate(static_tables):
- print >> C, "const %s grpc_stats_table_%d[%d] = {%s};" % (
- tbl[0], i, len(tbl[1]), ','.join('%s' % x for x in tbl[1]))
+ print("const %s grpc_stats_table_%d[%d] = {%s};" %
+ (tbl[0], i, len(tbl[1]), ','.join('%s' % x for x in tbl[1])),
+ file=C)
for histogram, code in zip(inst_map['Histogram'], histo_code):
- print >> C, ("void grpc_stats_inc_%s(int value) {%s}") % (
- histogram.name.lower(), code)
-
- print >> C, "const int grpc_stats_histo_buckets[%d] = {%s};" % (len(
- inst_map['Histogram']), ','.join('%s' % x for x in histo_buckets))
- print >> C, "const int grpc_stats_histo_start[%d] = {%s};" % (len(
- inst_map['Histogram']), ','.join('%s' % x for x in histo_start))
- print >> C, "const int *const grpc_stats_histo_bucket_boundaries[%d] = {%s};" % (
- len(inst_map['Histogram']), ','.join(
- 'grpc_stats_table_%d' % x for x in histo_bucket_boundaries))
- print >> C, "void (*const grpc_stats_inc_histogram[%d])(int x) = {%s};" % (
- len(inst_map['Histogram']), ','.join(
- 'grpc_stats_inc_%s' % histogram.name.lower()
- for histogram in inst_map['Histogram']))
+ print(("void grpc_stats_inc_%s(int value) {%s}") %
+ (histogram.name.lower(), code),
+ file=C)
+
+ print(
+ "const int grpc_stats_histo_buckets[%d] = {%s};" %
+ (len(inst_map['Histogram']), ','.join('%s' % x for x in histo_buckets)),
+ file=C)
+ print("const int grpc_stats_histo_start[%d] = {%s};" %
+ (len(inst_map['Histogram']), ','.join('%s' % x for x in histo_start)),
+ file=C)
+ print("const int *const grpc_stats_histo_bucket_boundaries[%d] = {%s};" %
+ (len(inst_map['Histogram']), ','.join(
+ 'grpc_stats_table_%d' % x for x in histo_bucket_boundaries)),
+ file=C)
+ print("void (*const grpc_stats_inc_histogram[%d])(int x) = {%s};" %
+ (len(inst_map['Histogram']), ','.join(
+ 'grpc_stats_inc_%s' % histogram.name.lower()
+ for histogram in inst_map['Histogram'])),
+ file=C)
# patch qps_test bigquery schema
RECORD_EXPLICIT_PERCENTILES = [50, 95, 99]
@@ -437,39 +463,56 @@ with open('tools/run_tests/performance/massage_qps_stats.py', 'w') as P:
break
for line in my_source:
if line[0] == '#':
- print >> P, line.rstrip()
+ print(line.rstrip(), file=P)
break
for line in my_source:
if line[0] != '#':
break
- print >> P, line.rstrip()
-
- print >> P
- print >> P, '# Autogenerated by tools/codegen/core/gen_stats_data.py'
- print >> P
-
- print >> P, 'import massage_qps_stats_helpers'
-
- print >> P, 'def massage_qps_stats(scenario_result):'
- print >> P, ' for stats in scenario_result["serverStats"] + scenario_result["clientStats"]:'
- print >> P, ' if "coreStats" in stats:'
- print >> P, ' # Get rid of the "coreStats" element and replace it by statistics'
- print >> P, ' # that correspond to columns in the bigquery schema.'
- print >> P, ' core_stats = stats["coreStats"]'
- print >> P, ' del stats["coreStats"]'
+ print(line.rstrip(), file=P)
+
+ print(file=P)
+ print('# Autogenerated by tools/codegen/core/gen_stats_data.py', file=P)
+ print(file=P)
+
+ print('import massage_qps_stats_helpers', file=P)
+
+ print('def massage_qps_stats(scenario_result):', file=P)
+ print(
+ ' for stats in scenario_result["serverStats"] + scenario_result["clientStats"]:',
+ file=P)
+ print(' if "coreStats" in stats:', file=P)
+ print(
+ ' # Get rid of the "coreStats" element and replace it by statistics',
+ file=P)
+ print(' # that correspond to columns in the bigquery schema.', file=P)
+ print(' core_stats = stats["coreStats"]', file=P)
+ print(' del stats["coreStats"]', file=P)
for counter in inst_map['Counter']:
- print >> P, ' stats["core_%s"] = massage_qps_stats_helpers.counter(core_stats, "%s")' % (
- counter.name, counter.name)
+ print(
+ ' stats["core_%s"] = massage_qps_stats_helpers.counter(core_stats, "%s")'
+ % (counter.name, counter.name),
+ file=P)
for i, histogram in enumerate(inst_map['Histogram']):
- print >> P, ' h = massage_qps_stats_helpers.histogram(core_stats, "%s")' % histogram.name
- print >> P, ' stats["core_%s"] = ",".join("%%f" %% x for x in h.buckets)' % histogram.name
- print >> P, ' stats["core_%s_bkts"] = ",".join("%%f" %% x for x in h.boundaries)' % histogram.name
+ print(
+ ' h = massage_qps_stats_helpers.histogram(core_stats, "%s")' %
+ histogram.name,
+ file=P)
+ print(
+ ' stats["core_%s"] = ",".join("%%f" %% x for x in h.buckets)' %
+ histogram.name,
+ file=P)
+ print(
+ ' stats["core_%s_bkts"] = ",".join("%%f" %% x for x in h.boundaries)'
+ % histogram.name,
+ file=P)
for pctl in RECORD_EXPLICIT_PERCENTILES:
- print >> P, ' stats["core_%s_%dp"] = massage_qps_stats_helpers.percentile(h.buckets, %d, h.boundaries)' % (
- histogram.name, pctl, pctl)
+ print(
+ ' stats["core_%s_%dp"] = massage_qps_stats_helpers.percentile(h.buckets, %d, h.boundaries)'
+ % (histogram.name, pctl, pctl),
+ file=P)
with open('src/core/lib/debug/stats_data_bq_schema.sql', 'w') as S:
columns = []
for counter in inst_map['Counter']:
columns.append(('%s_per_iteration' % counter.name, 'FLOAT'))
- print >> S, ',\n'.join('%s:%s' % x for x in columns)
+ print(',\n'.join('%s:%s' % x for x in columns), file=S)
diff --git a/grpc/tools/codegen/core/gen_switch.py b/grpc/tools/codegen/core/gen_switch.py
new file mode 100755
index 00000000..6667959a
--- /dev/null
+++ b/grpc/tools/codegen/core/gen_switch.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+
+
+# utility: print a big comment block into a set of files
+def put_banner(files, banner):
+ for f in files:
+ print('/*', file=f)
+ for line in banner:
+ print(' * %s' % line, file=f)
+ print(' */', file=f)
+ print('', file=f)
+
+
+with open('src/core/lib/promise/detail/switch.h', 'w') as H:
+ # copy-paste copyright notice from this file
+ with open(sys.argv[0]) as my_source:
+ copyright = []
+ for line in my_source:
+ if line[0] != '#':
+ break
+ for line in my_source:
+ if line[0] == '#':
+ copyright.append(line)
+ break
+ for line in my_source:
+ if line[0] != '#':
+ break
+ copyright.append(line)
+ put_banner([H], [line[2:].rstrip() for line in copyright])
+
+ put_banner([H], ["Automatically generated by %s" % sys.argv[0]])
+
+ print("#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H", file=H)
+ print("#define GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H", file=H)
+ print('', file=H)
+ print('#include <grpc/impl/codegen/port_platform.h>', file=H)
+ print('', file=H)
+ print("#include <stdlib.h>", file=H)
+ print('', file=H)
+ print("namespace grpc_core {", file=H)
+
+ for n in range(1, 33):
+ print('', file=H)
+ print("template <typename R, %s> R Switch(char idx, %s) {" % (
+ ", ".join("typename F%d" % i for i in range(0, n)),
+ ", ".join("F%d f%d" % (i, i) for i in range(0, n)),
+ ),
+ file=H)
+ print(" switch (idx) {", file=H)
+ for i in range(0, n):
+ print(" case %d: return f%d();" % (i, i), file=H)
+ print(" }", file=H)
+ print(" abort();", file=H)
+ print("}", file=H)
+
+ print('', file=H)
+ print("}", file=H)
+ print('', file=H)
+ print("#endif // GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H", file=H)
diff --git a/grpc/tools/codegen/core/gen_upb_api.sh b/grpc/tools/codegen/core/gen_upb_api.sh
index 63ed717e..d62fb9b9 100755
--- a/grpc/tools/codegen/core/gen_upb_api.sh
+++ b/grpc/tools/codegen/core/gen_upb_api.sh
@@ -33,139 +33,8 @@ else
mkdir $UPBDEFS_OUTPUT_DIR
fi
-$bazel build @com_google_protobuf//:protoc
-PROTOC=$PWD/bazel-bin/external/com_google_protobuf/protoc
-
-$bazel build @upb//upbc:protoc-gen-upb
-UPB_PLUGIN=$PWD/bazel-bin/external/upb/upbc/protoc-gen-upb
-
-$bazel build @upb//upbc:protoc-gen-upbdefs
-UPBDEFS_PLUGIN=$PWD/bazel-bin/external/upb/upbc/protoc-gen-upbdefs
-
-proto_files=( \
- "envoy/admin/v3/config_dump.proto" \
- "envoy/annotations/deprecation.proto" \
- "envoy/annotations/resource.proto" \
- "envoy/config/accesslog/v3/accesslog.proto" \
- "envoy/config/bootstrap/v3/bootstrap.proto" \
- "envoy/config/cluster/v3/circuit_breaker.proto" \
- "envoy/config/cluster/v3/cluster.proto" \
- "envoy/config/cluster/v3/filter.proto" \
- "envoy/config/cluster/v3/outlier_detection.proto" \
- "envoy/config/core/v3/address.proto" \
- "envoy/config/core/v3/backoff.proto" \
- "envoy/config/core/v3/base.proto" \
- "envoy/config/core/v3/config_source.proto" \
- "envoy/config/core/v3/event_service_config.proto" \
- "envoy/config/core/v3/extension.proto" \
- "envoy/config/core/v3/grpc_service.proto" \
- "envoy/config/core/v3/health_check.proto" \
- "envoy/config/core/v3/http_uri.proto" \
- "envoy/config/core/v3/protocol.proto" \
- "envoy/config/core/v3/proxy_protocol.proto" \
- "envoy/config/core/v3/socket_option.proto" \
- "envoy/config/core/v3/substitution_format_string.proto" \
- "envoy/config/endpoint/v3/endpoint.proto" \
- "envoy/config/endpoint/v3/endpoint_components.proto" \
- "envoy/config/endpoint/v3/load_report.proto" \
- "envoy/config/listener/v3/api_listener.proto" \
- "envoy/config/listener/v3/listener.proto" \
- "envoy/config/listener/v3/listener_components.proto" \
- "envoy/config/listener/v3/udp_listener_config.proto" \
- "envoy/config/metrics/v3/stats.proto" \
- "envoy/config/overload/v3/overload.proto" \
- "envoy/config/rbac/v3/rbac.proto" \
- "envoy/config/route/v3/route.proto" \
- "envoy/config/route/v3/route_components.proto" \
- "envoy/config/route/v3/scoped_route.proto" \
- "envoy/config/trace/v3/http_tracer.proto" \
- "envoy/extensions/clusters/aggregate/v3/cluster.proto" \
- "envoy/extensions/filters/http/router/v3/router.proto" \
- "envoy/extensions/filters/common/fault/v3/fault.proto" \
- "envoy/extensions/filters/http/fault/v3/fault.proto" \
- "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto" \
- "envoy/extensions/transport_sockets/tls/v3/cert.proto" \
- "envoy/extensions/transport_sockets/tls/v3/common.proto" \
- "envoy/extensions/transport_sockets/tls/v3/secret.proto" \
- "envoy/extensions/transport_sockets/tls/v3/tls.proto" \
- "envoy/service/cluster/v3/cds.proto" \
- "envoy/service/discovery/v3/ads.proto" \
- "envoy/service/discovery/v3/discovery.proto" \
- "envoy/service/endpoint/v3/eds.proto" \
- "envoy/service/listener/v3/lds.proto" \
- "envoy/service/load_stats/v3/lrs.proto" \
- "envoy/service/route/v3/rds.proto" \
- "envoy/service/route/v3/srds.proto" \
- "envoy/service/status/v3/csds.proto" \
- "envoy/type/matcher/v3/metadata.proto" \
- "envoy/type/matcher/v3/node.proto" \
- "envoy/type/matcher/v3/number.proto" \
- "envoy/type/matcher/v3/path.proto" \
- "envoy/type/matcher/v3/regex.proto" \
- "envoy/type/matcher/v3/string.proto" \
- "envoy/type/matcher/v3/struct.proto" \
- "envoy/type/matcher/v3/value.proto" \
- "envoy/type/metadata/v3/metadata.proto" \
- "envoy/type/tracing/v3/custom_tag.proto" \
- "envoy/type/v3/http.proto" \
- "envoy/type/v3/percent.proto" \
- "envoy/type/v3/range.proto" \
- "envoy/type/v3/semantic_version.proto" \
- "google/api/annotations.proto" \
- "google/api/expr/v1alpha1/checked.proto" \
- "google/api/expr/v1alpha1/syntax.proto" \
- "google/api/http.proto" \
- "google/protobuf/any.proto" \
- "google/protobuf/descriptor.proto" \
- "google/protobuf/duration.proto" \
- "google/protobuf/empty.proto" \
- "google/protobuf/struct.proto" \
- "google/protobuf/timestamp.proto" \
- "google/protobuf/wrappers.proto" \
- "google/rpc/status.proto" \
- "src/proto/grpc/auth/v1/authz_policy.proto" \
- "src/proto/grpc/gcp/altscontext.proto" \
- "src/proto/grpc/gcp/handshaker.proto" \
- "src/proto/grpc/gcp/transport_security_common.proto" \
- "src/proto/grpc/health/v1/health.proto" \
- "src/proto/grpc/lb/v1/load_balancer.proto" \
- "third_party/istio/security/proto/providers/google/meshca.proto" \
- "udpa/data/orca/v1/orca_load_report.proto" \
- "udpa/annotations/migrate.proto" \
- "udpa/annotations/security.proto" \
- "udpa/annotations/sensitive.proto" \
- "udpa/annotations/status.proto" \
- "udpa/annotations/versioning.proto" \
- "udpa/type/v1/typed_struct.proto" \
- "xds/core/v3/authority.proto" \
- "xds/core/v3/collection_entry.proto" \
- "xds/core/v3/context_params.proto" \
- "xds/core/v3/resource_locator.proto" \
- "xds/core/v3/resource_name.proto" \
- "xds/core/v3/resource.proto" \
- "validate/validate.proto")
-
-INCLUDE_OPTIONS="-I=$PWD/third_party/udpa \
- -I=$PWD/third_party/envoy-api \
- -I=$PWD/third_party/googleapis \
- -I=$PWD/third_party/protobuf/src \
- -I=$PWD/third_party/protoc-gen-validate \
- -I=$PWD"
-
-for i in "${proto_files[@]}"
-do
- echo "Compiling: ${i}"
- $PROTOC \
- $INCLUDE_OPTIONS \
- $i \
- --upb_out=$UPB_OUTPUT_DIR \
- --plugin=protoc-gen-upb=$UPB_PLUGIN
- # In PHP build Makefile, the files with .upb.c suffix collide .upbdefs.c suffix due to a PHP buildsystem bug.
- # Work around this by placing the generated files with ".upbdefs.h" and ".upbdefs.c" suffix under a different directory.
- # See https://github.com/grpc/grpc/issues/23307
- $PROTOC \
- $INCLUDE_OPTIONS \
- $i \
- --upb_out=$UPBDEFS_OUTPUT_DIR \
- --plugin=protoc-gen-upb=$UPBDEFS_PLUGIN
-done
+# generate upb files from bazel rules
+python3 tools/codegen/core/gen_upb_api_from_bazel_xml.py \
+ --upb_out=$UPB_OUTPUT_DIR \
+ --upbdefs_out=$UPBDEFS_OUTPUT_DIR \
+ --verbose
diff --git a/grpc/tools/codegen/core/gen_upb_api_from_bazel_xml.py b/grpc/tools/codegen/core/gen_upb_api_from_bazel_xml.py
new file mode 100755
index 00000000..54d62c89
--- /dev/null
+++ b/grpc/tools/codegen/core/gen_upb_api_from_bazel_xml.py
@@ -0,0 +1,200 @@
+#!/usr/bin/env python3
+
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 script generates upb source files (e.g. *.upb.c) from all upb targets
+# in Bazel BUILD file. These generate upb files are for non-Bazel build such
+# as makefile and python build which cannot generate them at the build time.
+#
+# As an example, for the following upb target
+#
+# grpc_upb_proto_library(
+# name = "grpc_health_upb",
+# deps = ["//src/proto/grpc/health/v1:health_proto_descriptor"],
+# )
+#
+# this will generate these upb source files at src/core/ext/upb-generated.
+#
+# src/proto/grpc/health/v1/health.upb.c
+# src/proto/grpc/health/v1/health.upb.h
+
+import argparse
+import collections
+import os
+import shutil
+import subprocess
+import xml.etree.ElementTree
+
+# Rule object representing the UPB rule of Bazel BUILD.
+Rule = collections.namedtuple('Rule', 'name type srcs deps proto_files')
+
+BAZEL_BIN = 'tools/bazel'
+
+
+def parse_bazel_rule(elem):
+ '''Returns a rule from bazel XML rule.'''
+ srcs = []
+ deps = []
+ for child in elem:
+ if child.tag == 'list' and child.attrib['name'] == 'srcs':
+ for tag in child:
+ if tag.tag == 'label':
+ srcs.append(tag.attrib['value'])
+ if child.tag == 'list' and child.attrib['name'] == 'deps':
+ for tag in child:
+ if tag.tag == 'label':
+ deps.append(tag.attrib['value'])
+ return Rule(elem.attrib['name'], elem.attrib['class'], srcs, deps, [])
+
+
+def get_transitive_protos(rules, t):
+ que = [
+ t,
+ ]
+ visited = set()
+ ret = []
+ while que:
+ name = que.pop(0)
+ rule = rules.get(name, None)
+ if rule:
+ for dep in rule.deps:
+ if dep not in visited:
+ visited.add(dep)
+ que.append(dep)
+ for src in rule.srcs:
+ if src.endswith('.proto'):
+ ret.append(src)
+ return list(set(ret))
+
+
+def read_upb_bazel_rules():
+ '''Runs bazel query on given package file and returns all upb rules.'''
+ # Use a wrapper version of bazel in gRPC not to use system-wide bazel
+ # to avoid bazel conflict when running on Kokoro.
+ result = subprocess.check_output(
+ [BAZEL_BIN, 'query', '--output', 'xml', '--noimplicit_deps', '//:all'])
+ root = xml.etree.ElementTree.fromstring(result)
+ rules = [
+ parse_bazel_rule(elem)
+ for elem in root
+ if elem.tag == 'rule' and elem.attrib['class'] in [
+ 'upb_proto_library',
+ 'upb_proto_reflection_library',
+ ]
+ ]
+ # query all dependencies of upb rules to get a list of proto files
+ all_deps = [dep for rule in rules for dep in rule.deps]
+ result = subprocess.check_output([
+ BAZEL_BIN, 'query', '--output', 'xml', '--noimplicit_deps',
+ ' union '.join('deps({0})'.format(d) for d in all_deps)
+ ])
+ root = xml.etree.ElementTree.fromstring(result)
+ dep_rules = {}
+ for dep_rule in (
+ parse_bazel_rule(elem) for elem in root if elem.tag == 'rule'):
+ dep_rules[dep_rule.name] = dep_rule
+ # add proto files to upb rules transitively
+ for rule in rules:
+ if not rule.type.startswith('upb_proto_'):
+ continue
+ if len(rule.deps) == 1:
+ rule.proto_files.extend(
+ get_transitive_protos(dep_rules, rule.deps[0]))
+ return rules
+
+
+def build_upb_bazel_rules(rules):
+ result = subprocess.check_output([BAZEL_BIN, 'build'] +
+ [rule.name for rule in rules])
+
+
+def get_upb_path(proto_path, ext):
+ return proto_path.replace(':', '/').replace('.proto', ext)
+
+
+def get_bazel_bin_root_path(elink):
+ BAZEL_BIN_ROOT = 'bazel-bin/'
+ if elink[0].startswith('@'):
+ # external
+ return os.path.join(BAZEL_BIN_ROOT, 'external',
+ elink[0].replace('@', '').replace('//', ''))
+ else:
+ # internal
+ return BAZEL_BIN_ROOT
+
+
+def get_external_link(file):
+ EXTERNAL_LINKS = [('@com_google_protobuf//', ':src/'),
+ ('@com_google_googleapis//', ''),
+ ('@com_github_cncf_udpa//', ''),
+ ('@com_envoyproxy_protoc_gen_validate//', ''),
+ ('@envoy_api//', ''), ('@opencensus_proto//', '')]
+ for external_link in EXTERNAL_LINKS:
+ if file.startswith(external_link[0]):
+ return external_link
+ return ('//', '')
+
+
+def copy_upb_generated_files(rules, args):
+ files = {}
+ for rule in rules:
+ if rule.type == 'upb_proto_library':
+ frag = '.upb'
+ output_dir = args.upb_out
+ else:
+ frag = '.upbdefs'
+ output_dir = args.upbdefs_out
+ for proto_file in rule.proto_files:
+ elink = get_external_link(proto_file)
+ proto_file = proto_file[len(elink[0]) + len(elink[1]):]
+ for ext in ('.h', '.c'):
+ file = get_upb_path(proto_file, frag + ext)
+ src = os.path.join(get_bazel_bin_root_path(elink), file)
+ dst = os.path.join(output_dir, file)
+ files[src] = dst
+ for src, dst in files.items():
+ if args.verbose:
+ print('Copy:')
+ print(' {0}'.format(src))
+ print(' -> {0}'.format(dst))
+ os.makedirs(os.path.split(dst)[0], exist_ok=True)
+ shutil.copyfile(src, dst)
+
+
+parser = argparse.ArgumentParser(description='UPB code-gen from bazel')
+parser.add_argument('--verbose', default=False, action='store_true')
+parser.add_argument('--upb_out',
+ default='src/core/ext/upb-generated',
+ help='Output directory for upb targets')
+parser.add_argument('--upbdefs_out',
+ default='src/core/ext/upbdefs-generated',
+ help='Output directory for upbdefs targets')
+
+
+def main():
+ args = parser.parse_args()
+ rules = read_upb_bazel_rules()
+ if args.verbose:
+ print('Rules:')
+ for rule in rules:
+ print(' name={0} type={1} proto_files={2}'.format(
+ rule.name, rule.type, rule.proto_files))
+ if rules:
+ build_upb_bazel_rules(rules)
+ copy_upb_generated_files(rules, args)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/grpc/tools/debug/core/chttp2_ref_leak.py b/grpc/tools/debug/core/chttp2_ref_leak.py
index a6a54487..9403853a 100755
--- a/grpc/tools/debug/core/chttp2_ref_leak.py
+++ b/grpc/tools/debug/core/chttp2_ref_leak.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,8 +17,8 @@
# to stdout
import collections
-import sys
import re
+import sys
def new_obj():
@@ -39,6 +39,6 @@ for line in sys.stdin:
else:
outstanding[m.group(2)].remove(m.group(3))
-for obj, remaining in outstanding.items():
+for obj, remaining in list(outstanding.items()):
if remaining:
- print 'LEAKED: %s %r' % (obj, remaining)
+ print(('LEAKED: %s %r' % (obj, remaining)))
diff --git a/grpc/tools/debug/core/error_ref_leak.py b/grpc/tools/debug/core/error_ref_leak.py
index 125ec90a..d65ecabf 100644
--- a/grpc/tools/debug/core/error_ref_leak.py
+++ b/grpc/tools/debug/core/error_ref_leak.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
#
# Copyright 2017 gRPC authors.
#
@@ -19,8 +19,8 @@
# usage: python error_ref_leak < logfile.txt
-import sys
import re
+import sys
data = sys.stdin.readlines()
@@ -44,4 +44,4 @@ for line in data:
assert (err in errs)
errs.remove(err)
-print "leaked:", errs
+print(("leaked:", errs))
diff --git a/grpc/tools/distrib/add-iwyu.py b/grpc/tools/distrib/add-iwyu.py
new file mode 100755
index 00000000..e6d800cb
--- /dev/null
+++ b/grpc/tools/distrib/add-iwyu.py
@@ -0,0 +1,118 @@
+#!/usr/bin/env python3
+
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 collections
+import os
+
+
+def to_inc(filename):
+ """Given filename, synthesize what should go in an include statement to get that file"""
+ if filename.startswith("include/"):
+ return '<%s>' % filename[len("include/"):]
+ return '"%s"' % filename
+
+
+def set_pragma(filename, pragma):
+ """Set the file-level IWYU pragma in filename"""
+ lines = []
+ saw_first_define = False
+ for line in open(filename).read().splitlines():
+ if line.startswith('// IWYU pragma: '):
+ continue
+ lines.append(line)
+ if not saw_first_define and line.startswith('#define '):
+ saw_first_define = True
+ lines.append('')
+ lines.append('// IWYU pragma: %s' % pragma)
+ lines.append('')
+ open(filename, 'w').write('\n'.join(lines) + '\n')
+
+
+def set_exports(pub, cg):
+ """In file pub, mark the include for cg with IWYU pragma: export"""
+ lines = []
+ for line in open(pub).read().splitlines():
+ if line.startswith('#include %s' % to_inc(cg)):
+ lines.append('#include %s // IWYU pragma: export' % to_inc(cg))
+ else:
+ lines.append(line)
+ open(pub, 'w').write('\n'.join(lines) + '\n')
+
+
+CG_ROOTS_GRPC = (
+ (r'sync', 'grpc/support/sync.h'),
+ (r'atm', 'grpc/support/atm.h'),
+)
+
+CG_ROOTS_GRPCPP = []
+
+
+def fix_tree(tree, cg_roots):
+ """Fix one include tree"""
+ # Map of filename --> paths including that filename
+ reverse_map = collections.defaultdict(list)
+ # The same, but for things with '/impl/codegen' in their names
+ cg_reverse_map = collections.defaultdict(list)
+ for root, dirs, files in os.walk(tree):
+ root_map = cg_reverse_map if '/impl/codegen' in root else reverse_map
+ for filename in files:
+ root_map[filename].append(root)
+ # For each thing in '/impl/codegen' figure out what exports it
+ for filename, paths in cg_reverse_map.items():
+ # Exclude non-headers
+ if not filename.endswith('.h'):
+ continue
+ pragma = None
+ # Check for our 'special' headers: if we see one of these, we just
+ # hardcode where they go to because there's some complicated rules.
+ for root, target in cg_roots:
+ if filename.startswith(root):
+ pragma = 'private, include <%s>' % target
+ if len(paths) == 1:
+ path = paths[0]
+ if filename.startswith(root + '.'):
+ set_exports('include/' + target, path + '/' + filename)
+ if filename.startswith(root + '_'):
+ set_exports(path + '/' + root + '.h',
+ path + '/' + filename)
+ # If the path for a file in /impl/codegen is ambiguous, just don't bother
+ if not pragma and len(paths) == 1:
+ path = paths[0]
+ # Check if we have an exporting candidate
+ if filename in reverse_map:
+ proper = reverse_map[filename]
+ # And that it too is unambiguous
+ if len(proper) == 1:
+ # Build the two relevant pathnames
+ cg = path + '/' + filename
+ pub = proper[0] + '/' + filename
+ # And see if the public file actually includes the /impl/codegen file
+ if ('#include %s' % to_inc(cg)) in open(pub).read():
+ # Finally, if it does, we'll set that pragma
+ pragma = 'private, include %s' % to_inc(pub)
+ # And mark the export
+ set_exports(pub, cg)
+ # If we can't find a good alternative include to point people to,
+ # mark things private anyway... we don't want to recommend people include
+ # from impl/codegen
+ if not pragma:
+ pragma = 'private'
+ for path in paths:
+ set_pragma(path + '/' + filename, pragma)
+
+
+fix_tree('include/grpc', CG_ROOTS_GRPC)
+fix_tree('include/grpcpp', CG_ROOTS_GRPCPP)
diff --git a/grpc/tools/distrib/build_ruby_environment_macos.sh b/grpc/tools/distrib/build_ruby_environment_macos.sh
deleted file mode 100644
index 5495799b..00000000
--- a/grpc/tools/distrib/build_ruby_environment_macos.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-# 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.
-
-set -ex
-
-rm -rf ~/.rake-compiler
-
-CROSS_RUBY="$(pwd)/$(mktemp tmpfile.XXXXXXXX)"
-
-curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.1.1/tasks/bin/cross-ruby.rake > "$CROSS_RUBY"
-
-# See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details
-patch "$CROSS_RUBY" << EOF
---- cross-ruby.rake 2021-03-05 12:04:09.898286632 -0800
-+++ patched 2021-03-05 12:05:35.594318962 -0800
-@@ -111,10 +111,11 @@
- "--host=#{MINGW_HOST}",
- "--target=#{MINGW_TARGET}",
- "--build=#{RUBY_BUILD}",
-- '--enable-shared',
-+ '--enable-static',
-+ '--disable-shared',
- '--disable-install-doc',
-+ '--without-gmp',
- '--with-ext=',
-- 'LDFLAGS=-pipe -s',
- ]
-
- # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
-@@ -130,6 +131,7 @@
- # make
- file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
- chdir File.dirname(t.prerequisites.first) do
-+ sh "test -s verconf.h || rm -f verconf.h" # if verconf.h has size 0, make sure it gets re-built by make
- sh MAKE
- end
- end
-EOF
-
-MAKE="make -j8"
-
-# Install ruby 3.0.0 for rake-compiler
-# Download ruby 3.0.0 sources outside of the cross-ruby.rake file, since the
-# latest rake-compiler/v1.1.1 cross-ruby.rake file requires tar.bz2 source
-# files.
-# TODO(apolcyn): remove this hack when tar.bz2 sources are available for ruby
-# 3.0.0 in https://ftp.ruby-lang.org/pub/ruby/3.0/. Also see
-# https://stackoverflow.com/questions/65477613/rvm-where-is-ruby-3-0-0.
-set +x # rvm commands are very verbose
-source ~/.rvm/scripts/rvm
-echo "rvm use 3.0.0"
-rvm use 3.0.0
-set -x
-RUBY_3_0_0_TAR="${HOME}/.rake-compiler/sources/ruby-3.0.0.tar.gz"
-mkdir -p "$(dirname $RUBY_3_0_0_TAR)"
-curl -L "https://ftp.ruby-lang.org/pub/ruby/3.0/$(basename $RUBY_3_0_0_TAR)" -o "$RUBY_3_0_0_TAR"
-ccache -c
-ruby --version | grep 'ruby 3.0.0'
-rake -f "$CROSS_RUBY" cross-ruby VERSION=3.0.0 HOST=x86_64-darwin11 MAKE="$MAKE" SOURCE="$RUBY_3_0_0_TAR"
-echo "installed ruby 3.0.0 build targets"
-# Install ruby 2.7.0 for rake-compiler
-set +x
-echo "rvm use 2.7.0"
-rvm use 2.7.0
-set -x
-ruby --version | grep 'ruby 2.7.0'
-ccache -c
-rake -f "$CROSS_RUBY" cross-ruby VERSION=2.7.0 HOST=x86_64-darwin11 MAKE="$MAKE"
-echo "installed ruby 2.7.0 build targets"
-# Install ruby 2.4-2.6 for rake-compiler
-set +x
-echo "rvm use 2.5.0"
-rvm use 2.5.0
-set -x
-ruby --version | grep 'ruby 2.5.0'
-for v in 2.6.0 2.5.0 2.4.0 ; do
- ccache -c
- rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE"
- echo "installed ruby $v build targets"
-done
-
-sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY"
-mv "$CROSS_RUBY" ~/.rake-compiler/config.yml
diff --git a/grpc/tools/distrib/buildifier_format_code.sh b/grpc/tools/distrib/buildifier_format_code.sh
index 8245cd4a..8d023e2f 100755
--- a/grpc/tools/distrib/buildifier_format_code.sh
+++ b/grpc/tools/distrib/buildifier_format_code.sh
@@ -15,9 +15,9 @@
set -e
-BUILDIFIER_VERSION="0.29.0"
+BUILDIFIER_VERSION="4.2.2"
TEMP_BUILDIFIER_PATH="/tmp/buildifier"
-EXTRA_BUILDIFIER_FLAGS=$*
+EXTRA_BUILDIFIER_FLAGS="$*"
function error_handling() {
error=$1
diff --git a/grpc/tools/distrib/buildifier_format_code_strict.sh b/grpc/tools/distrib/buildifier_format_code_strict.sh
index e8a98418..c50e6ea6 100755
--- a/grpc/tools/distrib/buildifier_format_code_strict.sh
+++ b/grpc/tools/distrib/buildifier_format_code_strict.sh
@@ -17,4 +17,4 @@
dir=$(dirname "${0}")
buildifier_format_script="${dir}/buildifier_format_code.sh"
-${buildifier_format_script} -lint warn
+${buildifier_format_script} -lint fix
diff --git a/grpc/tools/distrib/c-ish/check_documentation.py b/grpc/tools/distrib/c-ish/check_documentation.py
index d17d7ebc..eb4bbc1d 100755
--- a/grpc/tools/distrib/c-ish/check_documentation.py
+++ b/grpc/tools/distrib/c-ish/check_documentation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
@@ -41,13 +41,13 @@ for target_dir in _TARGET_DIRS:
for root, dirs, filenames in os.walk(target_dir):
if 'README.md' not in filenames:
if not printed_banner:
- print 'Missing README.md'
- print '================='
+ print('Missing README.md')
+ print('=================')
printed_banner = True
- print root
+ print(root)
errors += 1
if printed_banner:
- print
+ print()
printed_banner = False
for target_dir in _TARGET_DIRS:
for root, dirs, filenames in os.walk(target_dir):
@@ -59,10 +59,10 @@ for target_dir in _TARGET_DIRS:
contents = f.read()
if '\\file' not in contents:
if not printed_banner:
- print 'Missing \\file comment'
- print '======================'
+ print('Missing \\file comment')
+ print('======================')
printed_banner = True
- print path
+ print(path)
errors += 1
assert errors == 0, 'error count = %d' % errors
diff --git a/grpc/tools/distrib/check_copyright.py b/grpc/tools/distrib/check_copyright.py
index b8cc7a87..a7bcc308 100755
--- a/grpc/tools/distrib/check_copyright.py
+++ b/grpc/tools/distrib/check_copyright.py
@@ -18,8 +18,8 @@ import argparse
import datetime
import os
import re
-import sys
import subprocess
+import sys
# find our home
ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
@@ -33,7 +33,8 @@ argp.add_argument('-o',
choices=['list', 'details'])
argp.add_argument('-s', '--skips', default=0, action='store_const', const=1)
argp.add_argument('-a', '--ancient', default=0, action='store_const', const=1)
-argp.add_argument('--precommit', default=False, action='store_true')
+argp.add_argument('--precommit', action='store_true')
+argp.add_argument('--fix', action='store_true')
args = argp.parse_args()
# open the license text
@@ -44,7 +45,7 @@ with open('NOTICE.txt') as f:
# key is the file extension, value is a format string
# that given a line of license text, returns what should
# be in the file
-LICENSE_PREFIX = {
+LICENSE_PREFIX_RE = {
'.bat': r'@rem\s*',
'.c': r'\s*(?://|\*)\s*',
'.cc': r'\s*(?://|\*)\s*',
@@ -62,11 +63,44 @@ LICENSE_PREFIX = {
'.proto': r'//\s*',
'.cs': r'//\s*',
'.mak': r'#\s*',
+ '.bazel': r'#\s*',
+ '.bzl': r'#\s*',
'Makefile': r'#\s*',
'Dockerfile': r'#\s*',
'BUILD': r'#\s*',
}
+# The key is the file extension, while the value is a tuple of fields
+# (header, prefix, footer).
+# For example, for javascript multi-line comments, the header will be '/*', the
+# prefix will be '*' and the footer will be '*/'.
+# If header and footer are irrelevant for a specific file extension, they are
+# set to None.
+LICENSE_PREFIX_TEXT = {
+ '.bat': (None, '@rem', None),
+ '.c': (None, '//', None),
+ '.cc': (None, '//', None),
+ '.h': (None, '//', None),
+ '.m': ('/**', ' *', ' */'),
+ '.mm': ('/**', ' *', ' */'),
+ '.php': ('/**', ' *', ' */'),
+ '.js': ('/**', ' *', ' */'),
+ '.py': (None, '#', None),
+ '.pyx': (None, '#', None),
+ '.pxd': (None, '#', None),
+ '.pxi': (None, '#', None),
+ '.rb': (None, '#', None),
+ '.sh': (None, '#', None),
+ '.proto': (None, '//', None),
+ '.cs': (None, '//', None),
+ '.mak': (None, '#', None),
+ '.bazel': (None, '#', None),
+ '.bzl': (None, '#', None),
+ 'Makefile': (None, '#', None),
+ 'Dockerfile': (None, '#', None),
+ 'BUILD': (None, '#', None),
+}
+
_EXEMPT = frozenset((
# Generated protocol compiler output.
'examples/python/helloworld/helloworld_pb2.py',
@@ -103,10 +137,38 @@ _EXEMPT = frozenset((
RE_YEAR = r'Copyright (?P<first_year>[0-9]+\-)?(?P<last_year>[0-9]+) ([Tt]he )?gRPC [Aa]uthors(\.|)'
RE_LICENSE = dict(
- (k, r'\n'.join(LICENSE_PREFIX[k] +
+ (k, r'\n'.join(LICENSE_PREFIX_RE[k] +
(RE_YEAR if re.search(RE_YEAR, line) else re.escape(line))
for line in LICENSE_NOTICE))
- for k, v in LICENSE_PREFIX.items())
+ for k, v in list(LICENSE_PREFIX_RE.items()))
+
+YEAR = datetime.datetime.now().year
+
+LICENSE_YEAR = f'Copyright {YEAR} gRPC authors.'
+
+
+def join_license_text(header, prefix, footer, notice):
+ text = (header + '\n') if header else ""
+
+ def add_prefix(prefix, line):
+ # Don't put whitespace between prefix and empty line to avoid having
+ # trailing whitespaces.
+ return prefix + ('' if len(line) == 0 else ' ') + line
+
+ text += '\n'.join(
+ add_prefix(prefix, (LICENSE_YEAR if re.search(RE_YEAR, line) else line))
+ for line in LICENSE_NOTICE)
+ text += '\n'
+ if footer:
+ text += footer + '\n'
+ return text
+
+
+LICENSE_TEXT = dict(
+ (k,
+ join_license_text(LICENSE_PREFIX_TEXT[k][0], LICENSE_PREFIX_TEXT[k][1],
+ LICENSE_PREFIX_TEXT[k][2], LICENSE_NOTICE))
+ for k, v in list(LICENSE_PREFIX_TEXT.items()))
if args.precommit:
FILE_LIST_COMMAND = 'git status -z | grep -Poz \'(?<=^[MARC][MARCD ] )[^\s]+\''
@@ -133,11 +195,23 @@ def log(cond, why, filename):
if not cond:
return
if args.output == 'details':
- print('%s: %s' % (why, filename))
+ print(('%s: %s' % (why, filename)))
else:
print(filename)
+def write_copyright(license_text, file_text, filename):
+ shebang = ""
+ lines = file_text.split("\n")
+ if lines and lines[0].startswith("#!"):
+ shebang = lines[0] + "\n"
+ file_text = file_text[len(shebang):]
+
+ rewritten_text = shebang + license_text + "\n" + file_text
+ with open(filename, 'w') as f:
+ f.write(rewritten_text)
+
+
# scan files, validate the text
ok = True
filename_list = []
@@ -158,8 +232,10 @@ for filename in filename_list:
base = os.path.basename(filename)
if ext in RE_LICENSE:
re_license = RE_LICENSE[ext]
+ license_text = LICENSE_TEXT[ext]
elif base in RE_LICENSE:
re_license = RE_LICENSE[base]
+ license_text = LICENSE_TEXT[base]
else:
log(args.skips, 'skip', filename)
continue
@@ -171,7 +247,16 @@ for filename in filename_list:
if m:
pass
elif 'DO NOT EDIT' not in text:
- log(1, 'copyright missing', filename)
+ if args.fix:
+ write_copyright(license_text, text, filename)
+ log(1, 'copyright missing (fixed)', filename)
+ else:
+ log(1, 'copyright missing', filename)
ok = False
+if not ok and not args.fix:
+ print(
+ 'You may use following command to automatically fix copyright headers:')
+ print(' tools/distrib/check_copyright.py --fix')
+
sys.exit(0 if ok else 1)
diff --git a/grpc/tools/distrib/check_include_guards.py b/grpc/tools/distrib/check_include_guards.py
index d34251c2..058cba1b 100755
--- a/grpc/tools/distrib/check_include_guards.py
+++ b/grpc/tools/distrib/check_include_guards.py
@@ -18,8 +18,8 @@ import argparse
import os
import os.path
import re
-import sys
import subprocess
+import sys
def build_valid_guard(fpath):
@@ -66,15 +66,15 @@ class GuardValidator(object):
if c_core_header else '#endif // {2}')
if not match_txt:
print(
- invalid_guards_msg_template.format(fpath, regexp.pattern,
- build_valid_guard(fpath)))
+ (invalid_guards_msg_template.format(fpath, regexp.pattern,
+ build_valid_guard(fpath))))
return fcontents
- print(('{}: Wrong preprocessor guards (RE {}):'
- '\n\tFound {}, expected {}').format(fpath, regexp.pattern,
- match_txt, correct))
+ print((('{}: Wrong preprocessor guards (RE {}):'
+ '\n\tFound {}, expected {}').format(fpath, regexp.pattern,
+ match_txt, correct)))
if fix:
- print('Fixing {}...\n'.format(fpath))
+ print(('Fixing {}...\n'.format(fpath)))
fixed_fcontents = re.sub(match_txt, correct, fcontents)
if fixed_fcontents:
self.failed = False
@@ -91,7 +91,7 @@ class GuardValidator(object):
match = self.ifndef_re.search(fcontents)
if not match:
- print('something drastically wrong with: %s' % fpath)
+ print(('something drastically wrong with: %s' % fpath))
return False # failed
if match.lastindex is None:
# No ifndef. Request manual addition with hints
diff --git a/grpc/tools/distrib/check_naked_includes.py b/grpc/tools/distrib/check_naked_includes.py
new file mode 100755
index 00000000..5af510a4
--- /dev/null
+++ b/grpc/tools/distrib/check_naked_includes.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Check for includes of the form `#include "bar.h"` - i.e. not including the subdirectory. We require instead `#include "foo/bar.h"`.
+
+import argparse
+import os
+import re
+import sys
+
+# find our home
+ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
+os.chdir(ROOT)
+
+# parse command line
+argp = argparse.ArgumentParser(description='include guard checker')
+argp.add_argument('-f', '--fix', default=False, action='store_true')
+args = argp.parse_args()
+
+# error count
+errors = 0
+
+CHECK_SUBDIRS = [
+ 'src/core',
+ 'src/cpp',
+ 'test/core',
+ 'test/cpp',
+]
+
+for subdir in CHECK_SUBDIRS:
+ for root, dirs, files in os.walk(subdir):
+ for f in files:
+ if f.endswith('.h') or f.endswith('.cc'):
+ fpath = os.path.join(root, f)
+ output = open(fpath, 'r').readlines()
+ changed = False
+ for (i, line) in enumerate(output):
+ m = re.match(r'^#include "([^"]*)"(.*)', line)
+ if not m:
+ continue
+ include = m.group(1)
+ if '/' in include:
+ continue
+ expect_path = os.path.join(root, include)
+ trailing = m.group(2)
+ if not os.path.exists(expect_path):
+ continue
+ changed = True
+ errors += 1
+ output[i] = '#include "{0}"{1}\n'.format(
+ expect_path, trailing)
+ print("Found naked include '{0}' in {1}".format(
+ include, fpath))
+ if changed and args.fix:
+ open(fpath, 'w').writelines(output)
+
+if errors > 0:
+ print('{} errors found.'.format(errors))
+ sys.exit(1)
diff --git a/grpc/tools/distrib/check_namespace_qualification.py b/grpc/tools/distrib/check_namespace_qualification.py
new file mode 100755
index 00000000..a1ca0820
--- /dev/null
+++ b/grpc/tools/distrib/check_namespace_qualification.py
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 os
+import os.path
+import re
+import subprocess
+import sys
+
+# TODO(hork): dedupe args/load/validate/save code with other check scripts.
+
+
+def load(fpath):
+ with open(fpath, 'r') as f:
+ return f.readlines()
+
+
+def save(fpath, contents):
+ with open(fpath, 'w') as f:
+ f.write(contents)
+
+
+class QualificationValidator(object):
+
+ def __init__(self):
+ self.fully_qualified_re = re.compile(r'([ (<])::(grpc[A-Za-z_:])')
+ self.using_re = re.compile(
+ r'(using +|using +[A-Za-z_]+ *= *|namespace [A-Za-z_]+ *= *)::')
+ self.define_re = re.compile(r'^#define')
+
+ def check(self, fpath, fix):
+ fcontents = load(fpath)
+ failed = False
+ for (i, line) in enumerate(fcontents):
+ if not self.fully_qualified_re.search(line):
+ continue
+ # skip `using` statements
+ if self.using_re.search(line):
+ continue
+ # skip `#define` statements
+ if self.define_re.search(line):
+ continue
+ # fully-qualified namespace found, which may be unnecessary
+ if fix:
+ fcontents[i] = self.fully_qualified_re.sub(r'\1\2', line)
+ else:
+ print("Found in %s:%d - %s" % (fpath, i, line.strip()))
+ failed = True
+ if fix:
+ save(fpath, ''.join(fcontents))
+ return not failed
+
+
+IGNORED_FILES = [
+ # TODO(hork): rename symbols to avoid the need for fully-qualified names
+ "src/cpp/common/core_codegen.cc",
+ # TODO(hork): This could be a breaking change for users that define their
+ # own (possibly nested) `grpc.*` namespaces that contain conflicting
+ # symbols. It may be worth trying to land this change at some point, as
+ # users would be better off using unique namespaces.
+ "src/compiler/cpp_generator.cc",
+ # multi-line #define statements are not handled
+ "src/core/lib/gprpp/global_config_env.h",
+ "src/core/lib/profiling/timers.h",
+]
+
+# find our home
+ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
+os.chdir(ROOT)
+
+# parse command line
+argp = argparse.ArgumentParser(
+ description='c++ namespace full qualification checker')
+argp.add_argument('-f', '--fix', default=False, action='store_true')
+argp.add_argument('--precommit', default=False, action='store_true')
+args = argp.parse_args()
+
+grep_filter = r"grep -E '^(include|src|test).*\.(h|cc)$'"
+if args.precommit:
+ git_command = 'git diff --name-only HEAD'
+else:
+ git_command = 'git ls-tree -r --name-only -r HEAD'
+
+FILE_LIST_COMMAND = ' | '.join((git_command, grep_filter))
+
+# scan files
+ok = True
+filename_list = []
+try:
+ filename_list = subprocess.check_output(FILE_LIST_COMMAND,
+ shell=True).decode().splitlines()
+ # Filter out non-existent files (ie, file removed or renamed)
+ filename_list = (f for f in filename_list if os.path.isfile(f))
+except subprocess.CalledProcessError:
+ sys.exit(0)
+
+validator = QualificationValidator()
+
+for filename in filename_list:
+ # Skip check for upb generated code and ignored files.
+ if (filename.endswith('.upb.h') or filename.endswith('.upb.c') or
+ filename.endswith('.upbdefs.h') or
+ filename.endswith('.upbdefs.c') or filename in IGNORED_FILES):
+ continue
+ ok = validator.check(filename, args.fix) and ok
+
+sys.exit(0 if ok else 1)
diff --git a/grpc/tools/distrib/check_redundant_namespace_qualifiers.py b/grpc/tools/distrib/check_redundant_namespace_qualifiers.py
new file mode 100755
index 00000000..f8f1cb41
--- /dev/null
+++ b/grpc/tools/distrib/check_redundant_namespace_qualifiers.py
@@ -0,0 +1,169 @@
+#!/usr/bin/env python3
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Eliminate the kind of redundant namespace qualifiers that tend to
+# creep in when converting C to C++.
+
+import collections
+import os
+import re
+import sys
+
+
+def find_closing_mustache(contents, initial_depth):
+ """Find the closing mustache for a given number of open mustaches."""
+ depth = initial_depth
+ start_len = len(contents)
+ while contents:
+ # Skip over strings.
+ if contents[0] == '"':
+ contents = contents[1:]
+ while contents[0] != '"':
+ if contents.startswith('\\\\'):
+ contents = contents[2:]
+ elif contents.startswith('\\"'):
+ contents = contents[2:]
+ else:
+ contents = contents[1:]
+ contents = contents[1:]
+ # And characters that might confuse us.
+ elif contents.startswith("'{'") or contents.startswith(
+ "'\"'") or contents.startswith("'}'"):
+ contents = contents[3:]
+ # Skip over comments.
+ elif contents.startswith("//"):
+ contents = contents[contents.find('\n'):]
+ elif contents.startswith("/*"):
+ contents = contents[contents.find('*/') + 2:]
+ # Count up or down if we see a mustache.
+ elif contents[0] == '{':
+ contents = contents[1:]
+ depth += 1
+ elif contents[0] == '}':
+ contents = contents[1:]
+ depth -= 1
+ if depth == 0:
+ return start_len - len(contents)
+ # Skip over everything else.
+ else:
+ contents = contents[1:]
+ return None
+
+
+def is_a_define_statement(match, body):
+ """See if the matching line begins with #define"""
+ # This does not yet help with multi-line defines
+ m = re.search(r"^#define.*{}$".format(match.group(0)), body[:match.end()],
+ re.MULTILINE)
+ return m is not None
+
+
+def update_file(contents, namespaces):
+ """Scan the contents of a file, and for top-level namespaces in namespaces remove redundant usages."""
+ output = ''
+ while contents:
+ m = re.search(r'namespace ([a-zA-Z0-9_]*) {', contents)
+ if not m:
+ output += contents
+ break
+ output += contents[:m.end()]
+ contents = contents[m.end():]
+ end = find_closing_mustache(contents, 1)
+ if end is None:
+ print('Failed to find closing mustache for namespace {}'.format(
+ m.group(1)))
+ print('Remaining text:')
+ print(contents)
+ sys.exit(1)
+ body = contents[:end]
+ namespace = m.group(1)
+ if namespace in namespaces:
+ while body:
+ # Find instances of 'namespace::'
+ m = re.search(r'\b' + namespace + r'::\b', body)
+ if not m:
+ break
+ # Ignore instances of '::namespace::' -- these are usually meant to be there.
+ if m.start() >= 2 and body[m.start() - 2:].startswith('::'):
+ output += body[:m.end()]
+ # Ignore #defines, since they may be used anywhere
+ elif is_a_define_statement(m, body):
+ output += body[:m.end()]
+ else:
+ output += body[:m.start()]
+ body = body[m.end():]
+ output += body
+ contents = contents[end:]
+ return output
+
+
+# self check before doing anything
+_TEST = """
+namespace bar {
+ namespace baz {
+ }
+}
+namespace foo {}
+namespace foo {
+ foo::a;
+}
+"""
+_TEST_EXPECTED = """
+namespace bar {
+ namespace baz {
+ }
+}
+namespace foo {}
+namespace foo {
+ a;
+}
+"""
+output = update_file(_TEST, ['foo'])
+if output != _TEST_EXPECTED:
+ import difflib
+ print('FAILED: self check')
+ print('\n'.join(
+ difflib.ndiff(_TEST_EXPECTED.splitlines(1), output.splitlines(1))))
+ sys.exit(1)
+
+# Main loop.
+Config = collections.namedtuple('Config', ['dirs', 'namespaces'])
+
+_CONFIGURATION = (Config(['src/core', 'test/core'], ['grpc_core']),)
+
+changed = []
+
+for config in _CONFIGURATION:
+ for dir in config.dirs:
+ for root, dirs, files in os.walk(dir):
+ for file in files:
+ if file.endswith('.cc') or file.endswith('.h'):
+ path = os.path.join(root, file)
+ try:
+ with open(path) as f:
+ contents = f.read()
+ except IOError:
+ continue
+ updated = update_file(contents, config.namespaces)
+ if updated != contents:
+ changed.append(path)
+ with open(os.path.join(root, file), 'w') as f:
+ f.write(updated)
+
+if changed:
+ print('The following files were changed:')
+ for path in changed:
+ print(' ' + path)
+ sys.exit(1)
diff --git a/grpc/tools/distrib/docgen/_generate_python_doc.sh b/grpc/tools/distrib/docgen/_generate_python_doc.sh
index febc3188..7f9c6c9d 100755
--- a/grpc/tools/distrib/docgen/_generate_python_doc.sh
+++ b/grpc/tools/distrib/docgen/_generate_python_doc.sh
@@ -26,6 +26,6 @@ export HOME
pip install -r requirements.bazel.txt
tools/run_tests/run_tests.py -c opt -l python --compiler python3.8 --newline_on_success -j 8 --build_only
# shellcheck disable=SC1091
-source py38_native/bin/activate
+source py38/bin/activate
pip install --upgrade Sphinx
python setup.py doc
diff --git a/grpc/tools/distrib/docgen/all_lang_docgen.sh b/grpc/tools/distrib/docgen/all_lang_docgen.sh
index 1eb1cd74..d41fee99 100755
--- a/grpc/tools/distrib/docgen/all_lang_docgen.sh
+++ b/grpc/tools/distrib/docgen/all_lang_docgen.sh
@@ -62,7 +62,7 @@ cd "${dir}/../../.."
# Clones the API reference GitHub Pages branch
PAGES_PATH="/tmp/gh-pages"
rm -rf "${PAGES_PATH}"
-git clone --single-branch https://github.com/grpc/grpc -b gh-pages "${PAGES_PATH}"
+git clone -o upstream --single-branch https://github.com/grpc/grpc -b gh-pages "${PAGES_PATH}"
# Generates Core / C++ / ObjC / PHP documents
rm -rf "${PAGES_PATH}/core" "${PAGES_PATH}/cpp" "${PAGES_PATH}/objc" "${PAGES_PATH}/php"
@@ -101,20 +101,4 @@ echo "================================================================="
echo " Successfully generated documents for version ${GRPC_VERSION}."
echo "================================================================="
-# Uploads to GitHub
-if [[ -n "${GITHUB_USER}" ]]; then
- BRANCH_NAME="doc-${GRPC_VERSION}"
-
- (cd "${PAGES_PATH}"
- git remote add "${GITHUB_USER}" "git@github.com:${GITHUB_USER}/grpc.git"
- git checkout -b "${BRANCH_NAME}"
- git add --all
- git commit -m "Auto-update documentation for gRPC ${GRPC_VERSION}"
- git push --set-upstream "${GITHUB_USER}" "${BRANCH_NAME}"
- )
-
- echo "Please check https://github.com/${GITHUB_USER}/grpc/tree/${BRANCH_NAME} for generated documents."
- echo "Click https://github.com/grpc/grpc/compare/gh-pages...${GITHUB_USER}:${BRANCH_NAME} to create a PR."
-else
- echo "Please check ${PAGES_PATH} for generated documents."
-fi
+echo "Generated docs are in ${PAGES_PATH}, use the internal release script to create a PR."
diff --git a/grpc/tools/distrib/gen_compilation_database.py b/grpc/tools/distrib/gen_compilation_database.py
index d8d2761b..88f9538e 100755
--- a/grpc/tools/distrib/gen_compilation_database.py
+++ b/grpc/tools/distrib/gen_compilation_database.py
@@ -22,10 +22,10 @@ import glob
import json
import logging
import os
+from pathlib import Path
import re
import shlex
import subprocess
-from pathlib import Path
RE_INCLUDE_SYSTEM = re.compile("\s*-I\s+/usr/[^ ]+")
diff --git a/grpc/tools/distrib/isort_code.sh b/grpc/tools/distrib/isort_code.sh
new file mode 100755
index 00000000..08b4e5a1
--- /dev/null
+++ b/grpc/tools/distrib/isort_code.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+ACTION=${1:---overwrite-in-place}
+[[ $ACTION == '--overwrite-in-place' ]] || [[ $ACTION == '--diff' ]]
+
+if [[ $ACTION == '--diff' ]]; then
+ ACTION="--diff --check"
+fi
+
+# Change to root
+cd "$(dirname "${0}")/../.."
+
+DIRS=(
+ 'examples/python'
+ 'src/python'
+ 'test'
+ 'tools'
+ 'setup.py'
+)
+
+VIRTUALENV=isort_virtual_environment
+
+python3 -m virtualenv $VIRTUALENV
+PYTHON=${VIRTUALENV}/bin/python
+"$PYTHON" -m pip install isort==5.9.2
+
+$PYTHON -m isort $ACTION \
+ --force-sort-within-sections \
+ --force-single-line-imports --single-line-exclusions=typing \
+ --src "examples/python/data_transmission" \
+ --src "examples/python/async_streaming" \
+ --src "tools/run_tests/xds_k8s_test_driver" \
+ --src "src/python/grpcio_tests" \
+ --src "tools/run_tests" \
+ --project "examples" \
+ --project "src" \
+ --thirdparty "grpc" \
+ --skip-glob "third_party/*" \
+ --skip-glob "*/env/*" \
+ --skip-glob "*pb2*.py" \
+ --skip-glob "**/site-packages/**/*" \
+ --dont-follow-links \
+ "${DIRS[@]}"
diff --git a/grpc/tools/distrib/iwyu.sh b/grpc/tools/distrib/iwyu.sh
new file mode 100755
index 00000000..6ca9b7c2
--- /dev/null
+++ b/grpc/tools/distrib/iwyu.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+echo "NOTE: to automagically apply fixes, invoke with --fix"
+
+set -ex
+
+# change to root directory
+cd $(dirname $0)/../..
+REPO_ROOT=$(pwd)
+
+# grep targets with manual tag, which is not included in a result of bazel build using ...
+# let's get a list of them using query command and pass it to gen_compilation_database.py
+export MANUAL_TARGETS=$(bazel query 'attr("tags", "manual", tests(//test/cpp/...))' | grep -v _on_ios)
+
+# generate a clang compilation database for all C/C++ sources in the repo.
+tools/distrib/gen_compilation_database.py \
+ --include_headers \
+ --ignore_system_headers \
+ --dedup_targets \
+ "//:*" \
+ "//src/core/..." \
+ "//src/compiler/..." \
+ "//test/core/..." \
+ "//test/cpp/..." \
+ $MANUAL_TARGETS
+
+# build clang-tidy docker image
+docker build -t grpc_iwyu tools/dockerfile/grpc_iwyu
+
+# run clang-tidy against the checked out codebase
+# when modifying the checked-out files, the current user will be impersonated
+# so that the updated files don't end up being owned by "root".
+docker run \
+ -e TEST="$TEST" \
+ -e CHANGED_FILES="$CHANGED_FILES" \
+ -e IWYU_ROOT="/local-code" \
+ --rm=true \
+ -v "${REPO_ROOT}":/local-code \
+ -v "${HOME/.cache/bazel}":"${HOME/.cache/bazel}" \
+ --user "$(id -u):$(id -g)" \
+ -t grpc_iwyu /iwyu.sh "$@"
+
diff --git a/grpc/tools/distrib/pylint_code.sh b/grpc/tools/distrib/pylint_code.sh
index 060c2b7f..83faa932 100755
--- a/grpc/tools/distrib/pylint_code.sh
+++ b/grpc/tools/distrib/pylint_code.sh
@@ -32,6 +32,7 @@ DIRS=(
TEST_DIRS=(
'src/python/grpcio_tests/tests'
+ 'src/python/grpcio_tests/tests_gevent'
)
VIRTUALENV=python_pylint_venv
diff --git a/grpc/tools/distrib/python/.gitignore b/grpc/tools/distrib/python/.gitignore
index 266a2301..5cd990ac 100644
--- a/grpc/tools/distrib/python/.gitignore
+++ b/grpc/tools/distrib/python/.gitignore
@@ -7,3 +7,5 @@ validate/
google/
opencensus/
xds/
+build/
+opentelemetry/
diff --git a/grpc/tools/distrib/python/check_grpcio_tools.py b/grpc/tools/distrib/python/check_grpcio_tools.py
index 25751ca4..376ea55d 100755
--- a/grpc/tools/distrib/python/check_grpcio_tools.py
+++ b/grpc/tools/distrib/python/check_grpcio_tools.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
diff --git a/grpc/tools/distrib/python/docgen.py b/grpc/tools/distrib/python/docgen.py
index d5bd4a1a..9cbd6bba 100755
--- a/grpc/tools/distrib/python/docgen.py
+++ b/grpc/tools/distrib/python/docgen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,7 @@ import shutil
import subprocess
import sys
import tempfile
+
import grpc_version
parser = argparse.ArgumentParser()
diff --git a/grpc/tools/distrib/python/grpc_prefixed/templates/setup.py.template b/grpc/tools/distrib/python/grpc_prefixed/templates/setup.py.template
index 2d62270d..27ae518b 100644
--- a/grpc/tools/distrib/python/grpc_prefixed/templates/setup.py.template
+++ b/grpc/tools/distrib/python/grpc_prefixed/templates/setup.py.template
@@ -20,7 +20,6 @@ import setuptools
CLASSIFIERS = [
'Development Status :: 7 - Inactive',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]
diff --git a/grpc/tools/distrib/python/grpc_version.py b/grpc/tools/distrib/python/grpc_version.py
index 8a17e74e..d4edc169 100644
--- a/grpc/tools/distrib/python/grpc_version.py
+++ b/grpc/tools/distrib/python/grpc_version.py
@@ -14,5 +14,5 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
-VERSION = '1.38.0'
-PROTOBUF_VERSION = '3.15.8'
+VERSION = '1.46.5'
+PROTOBUF_VERSION = '3.19.5'
diff --git a/grpc/tools/distrib/python/grpcio_tools/BUILD.bazel b/grpc/tools/distrib/python/grpcio_tools/BUILD.bazel
index e85ea461..c397e823 100644
--- a/grpc/tools/distrib/python/grpcio_tools/BUILD.bazel
+++ b/grpc/tools/distrib/python/grpcio_tools/BUILD.bazel
@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+load("//bazel:cython_library.bzl", "pyx_library")
+load("grpcio_tools.bzl", "internal_copied_filegroup")
+
package(default_visibility = [
"//examples/python:__subpackages__",
"//src/python:__subpackages__",
"//tools/distrib/python/grpcio_tools:__subpackages__",
])
-load("//bazel:cython_library.bzl", "pyx_library")
-load("grpcio_tools.bzl", "internal_copied_filegroup")
-
cc_library(
name = "protoc_lib",
srcs = ["grpc_tools/main.cc"],
diff --git a/grpc/tools/distrib/python/grpcio_tools/README.rst b/grpc/tools/distrib/python/grpcio_tools/README.rst
index 15a76416..c3c5ccc4 100644
--- a/grpc/tools/distrib/python/grpcio_tools/README.rst
+++ b/grpc/tools/distrib/python/grpcio_tools/README.rst
@@ -5,17 +5,12 @@ Package for gRPC Python tools.
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Installation
------------
-The gRPC Python tools package is available for Linux, Mac OS X, and Windows
-running Python 2.7.
+The gRPC Python tools package is available for Linux, Mac OS X, and Windows.
Installing From PyPI
~~~~~~~~~~~~~~~~~~~~
@@ -144,7 +139,7 @@ Given protobuf include directories :code:`$INCLUDE`, an output directory
::
- $ python -m grpc.tools.protoc -I$INCLUDE --python_out=$OUTPUT --grpc_python_out=$OUTPUT $PROTO_FILES
+ $ python -m grpc_tools.protoc -I$INCLUDE --python_out=$OUTPUT --grpc_python_out=$OUTPUT $PROTO_FILES
To use as a build step in distutils-based projects, you may use the provided
command class in your :code:`setup.py`:
@@ -154,7 +149,7 @@ command class in your :code:`setup.py`:
setuptools.setup(
# ...
cmdclass={
- 'build_proto_modules': grpc.tools.command.BuildPackageProtos,
+ 'build_proto_modules': grpc_tools.command.BuildPackageProtos,
}
# ...
)
@@ -165,7 +160,7 @@ Invocation of the command will walk the project tree and transpile every
Note that this particular approach requires :code:`grpcio-tools` to be
installed on the machine before the setup script is invoked (i.e. no
combination of :code:`setup_requires` or :code:`install_requires` will provide
-access to :code:`grpc.tools.command.BuildPackageProtos` if it isn't already
+access to :code:`grpc_tools.command.BuildPackageProtos` if it isn't already
installed). One way to work around this can be found in our
:code:`grpcio-health-checking`
`package <https://pypi.python.org/pypi/grpcio-health-checking>`_:
@@ -176,7 +171,7 @@ installed). One way to work around this can be found in our
"""Command to generate project *_pb2.py modules from proto files."""
# ...
def run(self):
- from grpc.tools import command
+ from grpc_tools import command
command.build_package_protos(self.distribution.package_dir[''])
Now including :code:`grpcio-tools` in :code:`setup_requires` will provide the
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx
index e0c11baa..ff68565d 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/_protoc_compiler.pyx
@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from cython.operator cimport dereference
from libc cimport stdlib
-from libcpp.vector cimport vector
-from libcpp.utility cimport pair
from libcpp.string cimport string
-
-from cython.operator cimport dereference
+from libcpp.utility cimport pair
+from libcpp.vector cimport vector
import warnings
+
cdef extern from "grpc_tools/main.h" namespace "grpc_tools":
cppclass cProtocError "::grpc_tools::ProtocError":
string filename
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/command.py b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/command.py
index b1669db3..4aa22443 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/command.py
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/command.py
@@ -13,12 +13,11 @@
# limitations under the License.
import os
-import pkg_resources
import sys
-import setuptools
-
from grpc_tools import protoc
+import pkg_resources
+import setuptools
def build_package_protos(package_root, strict_mode=False):
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/main.cc b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/main.cc
index d407f40e..2f1c70ff 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/main.cc
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/main.cc
@@ -12,18 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <google/protobuf/compiler/command_line_interface.h>
-#include <google/protobuf/compiler/python/python_generator.h>
-
-#include "src/compiler/python_generator.h"
-
#include "grpc_tools/main.h"
-#include <google/protobuf/compiler/code_generator.h>
-#include <google/protobuf/compiler/importer.h>
-#include <google/protobuf/descriptor.h>
-#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
-
#include <algorithm>
#include <map>
#include <string>
@@ -31,6 +21,15 @@
#include <unordered_set>
#include <vector>
+#include <google/protobuf/compiler/code_generator.h>
+#include <google/protobuf/compiler/command_line_interface.h>
+#include <google/protobuf/compiler/importer.h>
+#include <google/protobuf/compiler/python/python_generator.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
+
+#include "src/compiler/python_generator.h"
+
using ::google::protobuf::FileDescriptor;
using ::google::protobuf::compiler::CodeGenerator;
using ::google::protobuf::compiler::DiskSourceTree;
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py
index 09824511..ce7b8248 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
@@ -14,12 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import pkg_resources
-import sys
-
import os
+import sys
from grpc_tools import _protoc_compiler
+import pkg_resources
_PROTO_MODULE_SUFFIX = "_pb2"
_SERVICE_MODULE_SUFFIX = "_pb2_grpc"
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel
index 53dae10a..3104d303 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel
@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-package(default_testonly = 1)
+load("//bazel:python_rules.bzl", "py_proto_library")
-load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")
+package(default_testonly = 1)
proto_library(
name = "simplest_proto",
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/protoc_test.py b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/protoc_test.py
index e5147840..1b72568f 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/protoc_test.py
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_tools/test/protoc_test.py
@@ -103,7 +103,7 @@ def _test_proto_module_imported_once():
def _test_static_dynamic_combo():
with _augmented_syspath(
("tools/distrib/python/grpcio_tools/grpc_tools/test/",)):
- from grpc_tools import protoc
+ from grpc_tools import protoc # isort:skip
import complicated_pb2
protos = protoc._protos("simple.proto")
static_message = complicated_pb2.ComplicatedMessage()
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpc_version.py b/grpc/tools/distrib/python/grpcio_tools/grpc_version.py
index 0b3c4c87..a2a56ba5 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpc_version.py
+++ b/grpc/tools/distrib/python/grpcio_tools/grpc_version.py
@@ -14,5 +14,5 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!!
-VERSION = '1.38.0'
-PROTOBUF_VERSION = '3.15.8'
+VERSION = '1.46.5'
+PROTOBUF_VERSION = '3.19.5'
diff --git a/grpc/tools/distrib/python/grpcio_tools/grpcio_tools.bzl b/grpc/tools/distrib/python/grpcio_tools/grpcio_tools.bzl
index 603556c9..59e8e878 100644
--- a/grpc/tools/distrib/python/grpcio_tools/grpcio_tools.bzl
+++ b/grpc/tools/distrib/python/grpcio_tools/grpcio_tools.bzl
@@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Houses utility rules for grpcio-tools.
+"""
+
def _generate_copied_files_impl(ctx):
srcs = ctx.attr.srcs[0]
strip_prefix = ctx.attr.strip_prefix
diff --git a/grpc/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/grpc/tools/distrib/python/grpcio_tools/protoc_lib_deps.py
index 66b5270e..688a52f6 100644
--- a/grpc/tools/distrib/python/grpcio_tools/protoc_lib_deps.py
+++ b/grpc/tools/distrib/python/grpcio_tools/protoc_lib_deps.py
@@ -14,10 +14,10 @@
# limitations under the License.
# AUTO-GENERATED BY make_grpcio_tools.py!
-CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/well_known_types_embed.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_padding_optimizer.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info_test_helper.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/util/delimited_message_util.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_table_driven.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/parse_context.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/map.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/io_win32.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/implicit_weak_message.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/generated_message_table_driven_lite.cc', 'google/protobuf/generated_enum_util.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc', 'google/protobuf/any_lite.cc']
+CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/well_known_types_embed.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_kotlin_generator.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_parse_function_generator.cc', 'google/protobuf/compiler/cpp/cpp_padding_optimizer.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/util/delimited_message_util.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_tctable_full.cc', 'google/protobuf/generated_message_table_driven.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/generated_message_bases.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/repeated_ptr_field.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/parse_context.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/map.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/io_win32.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/inlined_string_field.cc', 'google/protobuf/implicit_weak_message.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/generated_message_tctable_lite.cc', 'google/protobuf/generated_message_table_driven_lite.cc', 'google/protobuf/generated_enum_util.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc', 'google/protobuf/any_lite.cc']
PROTO_FILES=['google/protobuf/wrappers.proto', 'google/protobuf/type.proto', 'google/protobuf/timestamp.proto', 'google/protobuf/struct.proto', 'google/protobuf/source_context.proto', 'google/protobuf/field_mask.proto', 'google/protobuf/empty.proto', 'google/protobuf/duration.proto', 'google/protobuf/descriptor.proto', 'google/protobuf/compiler/plugin.proto', 'google/protobuf/api.proto', 'google/protobuf/any.proto']
CC_INCLUDE='third_party/protobuf/src'
PROTO_INCLUDE='third_party/protobuf/src'
-PROTOBUF_SUBMODULE_VERSION="436bd7880e458532901c58f4d9d1ea23fa7edd52"
+PROTOBUF_SUBMODULE_VERSION="b464cfbee18c71c40e761a5273ad369f3547294b"
diff --git a/grpc/tools/distrib/python/grpcio_tools/setup.py b/grpc/tools/distrib/python/grpcio_tools/setup.py
index c64f7777..ed43a663 100644
--- a/grpc/tools/distrib/python/grpcio_tools/setup.py
+++ b/grpc/tools/distrib/python/grpcio_tools/setup.py
@@ -18,20 +18,19 @@ from distutils import util
import errno
import os
import os.path
-import pkg_resources
import platform
import re
import shlex
import shutil
+import subprocess
+from subprocess import PIPE
import sys
import sysconfig
+import pkg_resources
import setuptools
from setuptools.command import build_ext
-import subprocess
-from subprocess import PIPE
-
# TODO(atash) add flag to disable Cython use
_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
@@ -42,6 +41,7 @@ sys.path.insert(0, os.path.abspath('.'))
import _parallel_compile_patch
import protoc_lib_deps
+
import grpc_version
_EXT_INIT_SYMBOL = None
@@ -55,12 +55,7 @@ _parallel_compile_patch.monkeypatch_compile_maybe()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License',
]
@@ -82,7 +77,7 @@ BUILD_WITH_CYTHON = _env_bool_value('GRPC_PYTHON_BUILD_WITH_CYTHON', 'False')
# without statically linking libstdc++ (which leads to a slight increase in the wheel size).
# This option is useful when crosscompiling wheels for aarch64 where
# it's difficult to ensure that the crosscompilation toolchain has a high-enough version
-# of GCC (we require >4.9) but still uses old-enough libstdc++ symbols.
+# of GCC (we require >=5.1) but still uses old-enough libstdc++ symbols.
# TODO(jtattermusch): remove this workaround once issues with crosscompiler version are resolved.
BUILD_WITH_STATIC_LIBSTDCXX = _env_bool_value(
'GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX', 'False')
@@ -103,7 +98,7 @@ def check_linker_need_libatomic():
# Double-check to see if -latomic actually can solve the problem.
# https://github.com/grpc/grpc/issues/22491
cpp_test = subprocess.Popen(
- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'],
+ [cxx, '-x', 'c++', '-std=c++11', '-', '-latomic'],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
@@ -293,8 +288,9 @@ setuptools.setup(name='grpcio-tools',
classifiers=CLASSIFIERS,
ext_modules=extension_modules(),
packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
install_requires=[
- 'protobuf>=3.5.0.post1, < 4.0dev',
+ 'protobuf>=3.12.0, < 4.0dev',
'grpcio>={version}'.format(version=grpc_version.VERSION),
'setuptools',
],
diff --git a/grpc/tools/distrib/python/make_grpcio_tools.py b/grpc/tools/distrib/python/make_grpcio_tools.py
index a6fdae28..8b0d26b0 100755
--- a/grpc/tools/distrib/python/make_grpcio_tools.py
+++ b/grpc/tools/distrib/python/make_grpcio_tools.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
@@ -94,13 +94,13 @@ def protobuf_submodule_commit_hash():
os.chdir(GRPC_PROTOBUF_SUBMODULE_ROOT)
output = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
os.chdir(cwd)
- return output.splitlines()[0].strip()
+ return output.decode("ascii").splitlines()[0].strip()
def bazel_query(query):
print('Running "bazel query %s"' % query)
output = subprocess.check_output([BAZEL_DEPS, query])
- return output.splitlines()
+ return output.decode("ascii").splitlines()
def get_deps():
diff --git a/grpc/tools/distrib/python/submit.py b/grpc/tools/distrib/python/submit.py
deleted file mode 100755
index 6ce6462b..00000000
--- a/grpc/tools/distrib/python/submit.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python2.7
-# 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.
-
-import argparse
-import os
-import shutil
-import subprocess
-
-parser = argparse.ArgumentParser(
- description='Submit the package to a PyPI repository.')
-parser.add_argument('--repository',
- '-r',
- metavar='r',
- type=str,
- default='pypi',
- help='The repository to push the package to. '
- 'Ensure the value appears in your .pypirc file. '
- 'Defaults to "pypi".')
-parser.add_argument('--identity',
- '-i',
- metavar='i',
- type=str,
- help='GPG identity to sign the files with.')
-parser.add_argument(
- '--username',
- '-u',
- metavar='u',
- type=str,
- help='Username to authenticate with the repository. Not needed if you have '
- 'configured your .pypirc to include your username.')
-parser.add_argument(
- '--password',
- '-p',
- metavar='p',
- type=str,
- help='Password to authenticate with the repository. Not needed if you have '
- 'configured your .pypirc to include your password.')
-parser.add_argument(
- '--bdist',
- '-b',
- action='store_true',
- help='Generate a binary distribution (wheel) for the current OS.')
-parser.add_argument(
- '--dist-args',
- type=str,
- help='Additional arguments to pass to the *dist setup.py command.')
-args = parser.parse_args()
-
-# Move to the root directory of Python GRPC.
-pkgdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../')
-# Remove previous distributions; they somehow confuse twine.
-try:
- shutil.rmtree(os.path.join(pkgdir, 'dist/'))
-except:
- pass
-
-# Build the Cython C files
-build_env = os.environ.copy()
-build_env['GRPC_PYTHON_BUILD_WITH_CYTHON'] = "1"
-cmd = ['python', 'setup.py', 'build_ext', '--inplace']
-subprocess.call(cmd, cwd=pkgdir, env=build_env)
-
-# Make the push.
-if args.bdist:
- cmd = ['python', 'setup.py', 'bdist_wheel']
-else:
- cmd = ['python', 'setup.py', 'sdist']
-if args.dist_args:
- cmd += args.dist_args.split()
-subprocess.call(cmd, cwd=pkgdir)
-
-cmd = ['twine', 'upload', '-r', args.repository]
-if args.identity is not None:
- cmd.extend(['-i', args.identity])
-if args.username is not None:
- cmd.extend(['-u', args.username])
-if args.password is not None:
- cmd.extend(['-p', args.password])
-cmd.append('dist/*')
-
-subprocess.call(cmd, cwd=pkgdir)
diff --git a/grpc/tools/distrib/python/xds_protos/build.py b/grpc/tools/distrib/python/xds_protos/build.py
index 8b793f2b..6434272b 100644
--- a/grpc/tools/distrib/python/xds_protos/build.py
+++ b/grpc/tools/distrib/python/xds_protos/build.py
@@ -15,8 +15,9 @@
"""Builds the content of xds-protos package"""
import os
-import pkg_resources
+
from grpc_tools import protoc
+import pkg_resources
# We might not want to compile all the protos
EXCLUDE_PROTO_PACKAGES_LIST = [
@@ -35,6 +36,8 @@ GOOGLEAPIS_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'googleapis')
VALIDATE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protoc-gen-validate')
OPENCENSUS_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
'opencensus-proto', 'src')
+OPENTELEMETRY_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
+ 'opentelemetry')
WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename(
'grpc_tools', '_proto')
OUTPUT_PATH = WORK_DIR
@@ -67,6 +70,7 @@ COMPILE_PROTO_ONLY = [
'--proto_path={}'.format(VALIDATE_ROOT),
'--proto_path={}'.format(WELL_KNOWN_PROTOS_INCLUDE),
'--proto_path={}'.format(OPENCENSUS_PROTO_ROOT),
+ '--proto_path={}'.format(OPENTELEMETRY_PROTO_ROOT),
'--python_out={}'.format(OUTPUT_PATH),
]
COMPILE_BOTH = COMPILE_PROTO_ONLY + ['--grpc_python_out={}'.format(OUTPUT_PATH)]
@@ -120,11 +124,13 @@ def main():
compile_protos(GOOGLEAPIS_ROOT, os.path.join('google', 'type'))
compile_protos(VALIDATE_ROOT, 'validate')
compile_protos(OPENCENSUS_PROTO_ROOT)
+ compile_protos(OPENTELEMETRY_PROTO_ROOT)
# Generate __init__.py files for all modules
create_init_file(WORK_DIR)
for proto_root_module in [
- 'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds'
+ 'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds',
+ 'opentelemetry'
]:
for root, _, _ in os.walk(os.path.join(WORK_DIR, proto_root_module)):
package_path = os.path.relpath(root, WORK_DIR)
diff --git a/grpc/tools/distrib/python/xds_protos/build_validate_upload.sh b/grpc/tools/distrib/python/xds_protos/build_validate_upload.sh
index 4218940e..00135fca 100755
--- a/grpc/tools/distrib/python/xds_protos/build_validate_upload.sh
+++ b/grpc/tools/distrib/python/xds_protos/build_validate_upload.sh
@@ -23,21 +23,13 @@ rm -rf ${WORK_DIR}/dist
# Generate the package content then build the source wheel
python3 build.py
-python3 setup.py sdist
-python2 setup.py bdist_wheel
python3 setup.py bdist_wheel
# Run the tests to ensure all protos are importable, also avoid confusing normal
# imports with relative imports
pushd $(mktemp -d '/tmp/test_xds_protos.XXXXXX')
-python2 -m virtualenv env
-env/bin/python -m pip install ${WORK_DIR}/dist/xds-protos-*.tar.gz
-cp ${WORK_DIR}/generated_file_import_test.py generated_file_import_test.py
-env/bin/python generated_file_import_test.py
-popd
-pushd $(mktemp -d '/tmp/test_xds_protos.XXXXXX')
python3 -m virtualenv env
-env/bin/python -m pip install ${WORK_DIR}/dist/xds-protos-*.tar.gz
+env/bin/python -m pip install ${WORK_DIR}/dist/*.whl
cp ${WORK_DIR}/generated_file_import_test.py generated_file_import_test.py
env/bin/python generated_file_import_test.py
popd
diff --git a/grpc/tools/distrib/python/xds_protos/setup.py b/grpc/tools/distrib/python/xds_protos/setup.py
index 2ed04c42..4f6fbf9c 100644
--- a/grpc/tools/distrib/python/xds_protos/setup.py
+++ b/grpc/tools/distrib/python/xds_protos/setup.py
@@ -15,6 +15,7 @@
"""A PyPI package for xDS protos generated Python code."""
import os
+
import setuptools
WORK_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -27,7 +28,6 @@ PACKAGES = setuptools.find_packages(where=".", exclude=EXCLUDE_PYTHON_FILES)
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
]
@@ -38,7 +38,7 @@ INSTALL_REQUIRES = [
SETUP_REQUIRES = INSTALL_REQUIRES + ['grpcio-tools']
setuptools.setup(
name='xds-protos',
- version='0.0.8',
+ version='0.0.11',
packages=PACKAGES,
description='Generated Python code from envoyproxy/data-plane-api',
long_description_content_type='text/x-rst',
@@ -47,6 +47,7 @@ setuptools.setup(
author_email='grpc-io@googlegroups.com',
url='https://grpc.io',
license='Apache License 2.0',
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
classifiers=CLASSIFIERS)
diff --git a/grpc/tools/distrib/python_wrapper.sh b/grpc/tools/distrib/python_wrapper.sh
index a099b2f1..f9e61daf 100755
--- a/grpc/tools/distrib/python_wrapper.sh
+++ b/grpc/tools/distrib/python_wrapper.sh
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-for p in python2.7 python2.6 python2 python not_found ; do
+for p in python3 python not_found ; do
python=$(which $p || echo not_found)
diff --git a/grpc/tools/distrib/run_clang_tidy.py b/grpc/tools/distrib/run_clang_tidy.py
index e9565369..7305c785 100755
--- a/grpc/tools/distrib/run_clang_tidy.py
+++ b/grpc/tools/distrib/run_clang_tidy.py
@@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys
-import os
-import subprocess
import argparse
import multiprocessing
+import os
+import subprocess
+import sys
sys.path.append(
os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests',
@@ -34,7 +34,8 @@ argp.add_argument('-j',
type=int,
default=multiprocessing.cpu_count(),
help='Number of CPUs to use')
-argp.set_defaults(fix=False)
+argp.add_argument('--only-changed', dest='only_changed', action='store_true')
+argp.set_defaults(fix=False, only_changed=False)
args = argp.parse_args()
# Explicitly passing the .clang-tidy config by reading it.
@@ -49,7 +50,20 @@ cmdline = [
]
if args.fix:
- cmdline.append('--fix')
+ cmdline.append('--fix-errors')
+
+if args.only_changed:
+ orig_files = set(args.files)
+ actual_files = []
+ output = subprocess.check_output(
+ ['git', 'diff', 'origin/master', 'HEAD', '--name-only'])
+ for line in output.decode('ascii').splitlines(False):
+ if line in orig_files:
+ print(("check: %s" % line))
+ actual_files.append(line)
+ else:
+ print(("skip: %s - not in the build" % line))
+ args.files = actual_files
jobs = []
for filename in args.files:
diff --git a/grpc/tools/distrib/sanitize.sh b/grpc/tools/distrib/sanitize.sh
index a06f148d..037e3284 100755
--- a/grpc/tools/distrib/sanitize.sh
+++ b/grpc/tools/distrib/sanitize.sh
@@ -18,7 +18,17 @@ set -ex
cd $(dirname $0)/../..
tools/buildgen/generate_projects.sh
-tools/distrib/clang_format_code.sh
-tools/distrib/check_copyright.py
+tools/distrib/check_include_guards.py --fix
+tools/distrib/check_naked_includes.py --fix || true
+tools/distrib/check_copyright.py --fix
+tools/distrib/add-iwyu.py
tools/distrib/check_trailing_newlines.sh --fix
-
+tools/run_tests/sanity/check_port_platform.py --fix
+tools/run_tests/sanity/check_include_style.py --fix || true
+tools/distrib/check_namespace_qualification.py --fix
+tools/distrib/yapf_code.sh
+tools/distrib/isort_code.sh
+tools/distrib/clang_format_code.sh
+tools/distrib/buildifier_format_code_strict.sh || true
+tools/distrib/check_redundant_namespace_qualifiers.py || true
+tools/codegen/core/gen_grpc_tls_credentials_options.py
diff --git a/grpc/tools/distrib/yapf_code.sh b/grpc/tools/distrib/yapf_code.sh
index 4e3767a6..c1b60d12 100755
--- a/grpc/tools/distrib/yapf_code.sh
+++ b/grpc/tools/distrib/yapf_code.sh
@@ -35,4 +35,4 @@ python3 -m virtualenv $VIRTUALENV -p $(which python3)
PYTHON=${VIRTUALENV}/bin/python
"$PYTHON" -m pip install yapf==0.30.0
-$PYTHON -m yapf $ACTION --parallel --recursive --style=setup.cfg "${DIRS[@]}"
+$PYTHON -m yapf $ACTION --parallel --recursive --style=setup.cfg "${DIRS[@]}" -e "**/site-packages/**/*"
diff --git a/grpc/tools/docker_runners/examples/bazel_test_in_docker.sh b/grpc/tools/docker_runners/examples/bazel_test_in_docker.sh
new file mode 100755
index 00000000..14d5ca35
--- /dev/null
+++ b/grpc/tools/docker_runners/examples/bazel_test_in_docker.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# TODO(jtattermusch): make sure bazel cache is persisted between runs
+
+# Note that the port server must be running so that the bazel tests can pass.
+
+# use the default docker image used for bazel builds
+export DOCKERFILE_DIR=tools/dockerfile/test/bazel
+# TODO(jtattermusch): interestingly, the bazel build fails when "--privileged" docker arg is used (it probably has to do with sandboxing)
+export DOCKER_EXTRA_ARGS="--privileged=false"
+tools/docker_runners/run_in_docker.sh bazel test //test/...
diff --git a/grpc/tools/docker_runners/examples/coredump_in_docker.sh b/grpc/tools/docker_runners/examples/coredump_in_docker.sh
new file mode 100755
index 00000000..28b82f60
--- /dev/null
+++ b/grpc/tools/docker_runners/examples/coredump_in_docker.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# use the docker image used as the default for C++ by run_tests.py
+# TODO(jtattermusch): document how to get the right docker image name
+# for given run_tests.py --compiler/--arch params.
+export DOCKERFILE_DIR=tools/dockerfile/test/cxx_debian9_x64
+
+# add extra docker args if needed
+export DOCKER_EXTRA_ARGS=""
+
+# start the docker container with interactive shell
+tools/docker_runners/run_in_docker.sh bash
+
+# Run these commands under the docker container
+#
+# Install gdb (or similar command for non-debian based distros)
+# $ apt-get update && apt-get install -y gdb
+#
+# No limit for coredump size
+# $ ulimit -c unlimited
+#
+# Coredumps will be stored to /tmp/coredumps (inside the docker container)
+# mkdir /tmp/coredumps
+# echo "/tmp/coredumps/core.%p" | tee /proc/sys/kernel/core_pattern
+#
+# Build e.g. the C tests
+# $ ./tools/run_tests/run_tests.py -l c -c dbg --build_only
+#
+# Run a test that crashes, it will create a coredump.
+# $ cmake/build/foo_bar_test
+#
+# Open coredump under gdb
+# $ gdb cmake/build/foo_bar_test /tmp/coredumps/core.XYZ
diff --git a/grpc/tools/docker_runners/examples/gdb_in_docker.sh b/grpc/tools/docker_runners/examples/gdb_in_docker.sh
new file mode 100755
index 00000000..6db4d9d1
--- /dev/null
+++ b/grpc/tools/docker_runners/examples/gdb_in_docker.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# use the docker image used as the default for C++ by run_tests.py
+# TODO(jtattermusch): document how to get the right docker image name
+# for given run_tests.py --compiler/--arch params.
+export DOCKERFILE_DIR=tools/dockerfile/test/cxx_debian9_x64
+
+# add extra docker args if needed
+export DOCKER_EXTRA_ARGS=""
+
+# start the docker container with interactive shell
+tools/docker_runners/run_in_docker.sh bash
+
+# Run these commands under the docker container
+#
+# Install gdb (or similar command for non-debian based distros)
+# $ apt-get update && apt-get install -y gdb
+#
+# Build e.g. the C tests
+# $ ./tools/run_tests/run_tests.py -l c -c dbg --build_only
+#
+# Run a test under gdb
+# NOTE: Some old distros (e.g. debian 8 "jessie") might have a gdb version
+# that doesn't work with C++11 symbols properly and crashes when
+# loading the symbols.
+# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61233
+# $ gdb cmake/build/histogram_test
diff --git a/grpc/tools/docker_runners/examples/run_tests_c_cpp_in_docker.sh b/grpc/tools/docker_runners/examples/run_tests_c_cpp_in_docker.sh
new file mode 100755
index 00000000..466b5a0b
--- /dev/null
+++ b/grpc/tools/docker_runners/examples/run_tests_c_cpp_in_docker.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# use the docker image used as the default for C++ by run_tests.py
+# TODO(jtattermusch): document how to get the right docker image name
+# for given run_tests.py --compiler/--arch params.
+export DOCKERFILE_DIR=tools/dockerfile/test/cxx_debian9_x64
+tools/docker_runners/run_in_docker.sh tools/run_tests/run_tests.py -l c c++ -c dbg
diff --git a/grpc/tools/docker_runners/examples/run_tests_csharp_in_docker.sh b/grpc/tools/docker_runners/examples/run_tests_csharp_in_docker.sh
new file mode 100755
index 00000000..7252f7d2
--- /dev/null
+++ b/grpc/tools/docker_runners/examples/run_tests_csharp_in_docker.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# use the docker image used as the default for C# by run_tests.py
+export DOCKERFILE_DIR=tools/dockerfile/test/csharp_buster_x64
+tools/docker_runners/run_in_docker.sh tools/run_tests/run_tests.py -l csharp -c dbg --compiler coreclr
diff --git a/grpc/tools/docker_runners/run_in_docker.sh b/grpc/tools/docker_runners/run_in_docker.sh
new file mode 100755
index 00000000..9c34e5e6
--- /dev/null
+++ b/grpc/tools/docker_runners/run_in_docker.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+# Runs C# build in a docker container, but using the local workspace.
+# Example usage:
+# src/csharp/run_in_docker.sh tools/run_tests/run_tests.py -l csharp
+
+set -e
+
+# Environment variable used as inputs:
+# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
+# DOCKER_EXTRA_ARGS - Extra arguments to pass to the "docker run" command.
+
+readonly grpc_rootdir="$(dirname "$(readlink -f "$0")")/../.."
+cd ${grpc_rootdir}
+
+if [ "${DOCKERFILE_DIR}" == "" ]
+then
+ echo "You need to specify the docker image to use by setting DOCKERFILE_DIR env variable."
+ echo "See docker image definitions under tools/dockerfile."
+ echo ""
+ echo "You likely want to set DOCKERFILE_DIR to one of these values:"
+ find tools/dockerfile/test -name Dockerfile | xargs -n1 dirname
+ exit 1
+fi
+
+# Use image name based on Dockerfile location checksum
+# For simplicity, currently only testing docker images that have already been pushed
+# to dockerhub are supported (see tools/dockerfile/push_testing_images.sh)
+# TODO(jtattermusch): add support for building dockerimages locally.
+DOCKER_IMAGE=grpctesting/$(basename "$DOCKERFILE_DIR"):$(sha1sum "$DOCKERFILE_DIR/Dockerfile" | cut -f1 -d\ )
+
+# TODO: support building dockerimage locally / pulling it from dockerhub
+
+# If TTY is available, the running container can be conveniently terminated with Ctrl+C.
+if [[ -t 0 ]]; then
+ DOCKER_TTY_ARGS=("-it")
+else
+ # The input device on kokoro is not a TTY, so -it does not work.
+ DOCKER_TTY_ARGS=()
+fi
+
+# args required to be able to run gdb/strace under the docker container
+DOCKER_PRIVILEGED_ARGS=(
+ "--privileged"
+ "--cap-add=SYS_PTRACE"
+ "--security-opt=seccomp=unconfined"
+)
+
+DOCKER_NETWORK_ARGS=(
+ # enable IPv6
+ "--sysctl=net.ipv6.conf.all.disable_ipv6=0"
+ # use host network, required for the port server to work correctly
+ "--network=host"
+)
+
+DOCKER_CLEANUP_ARGS=(
+ # delete the container when the containers exits
+ # (otherwise the container will not release the disk space it used)
+ "--rm=true"
+)
+
+DOCKER_PROPAGATE_ENV_ARGS=(
+ "--env-file=tools/run_tests/dockerize/docker_propagate_env.list" \
+)
+
+# Uncomment to run the docker container as current user's UID and GID.
+# That way, the files written by the container won't be owned by root (=you won't end up with polluted workspace),
+# but it can have some other disadvantages. E.g.:
+# - you won't be able install stuff inside the container
+# - the home directory inside the container will be broken (you won't be able to write in it).
+# That may actually break some language runtimes completely (e.g. grpc python might not build)
+# DOCKER_NONROOT_ARGS=(
+# # run under current user's UID and GID
+# "--user=$(id -u):$(id -g)"
+# )
+
+# Enable command echo just before running the final docker command to make the docker args visible.
+set -ex
+
+# Run command inside C# docker container.
+# - the local clone of grpc repository will be mounted as /workspace.
+exec docker run "${DOCKER_TTY_ARGS[@]}" "${DOCKER_PRIVILEGED_ARGS[@]}" "${DOCKER_NETWORK_ARGS[@]}" "${DOCKER_CLEANUP_ARGS[@]}" "${DOCKER_PROPAGATE_ENV_ARGS[@]}" ${DOCKER_EXTRA_ARGS} -v "${grpc_rootdir}":/workspace -w /workspace "${DOCKER_IMAGE}" bash -c "$*"
diff --git a/grpc/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile
deleted file mode 100644
index aeedec81..00000000
--- a/grpc/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,38 +0,0 @@
-# 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.
-
-FROM debian:jessie
-RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
-
-# Install packages needed for gRPC and protobuf
-RUN apt-get update && apt-get install -y \
- autoconf \
- automake \
- build-essential \
- curl \
- git \
- g++ \
- libtool \
- make \
- pkg-config \
- unzip && apt-get clean
-
-RUN apt-get update && apt-get install -y golang && apt-get clean
-
-RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
-RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
-RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
-RUN apt-get update && apt-get install -t jessie-backports -y cmake && apt-get clean
-
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
deleted file mode 100644
index e95d781d..00000000
--- a/grpc/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-RUN apt-get update && apt-get install -y apt-transport-https && apt-get clean
-
-RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb https://download.mono-project.com/repo/debian stable-jessie main" | tee /etc/apt/sources.list.d/mono-official-stable.list
-
-RUN apt-get update && apt-get install -y \
- mono-devel \
- nuget \
- && apt-get clean
-
-RUN apt-get update && apt-get install -y unzip && apt-get clean
-
-# Make sure the mono certificate store is up-to-date to prevent issues with nuget restore
-RUN apt-get update && apt-get install -y curl && apt-get clean
-RUN curl https://curl.haxx.se/ca/cacert.pem > ~/cacert.pem && cert-sync ~/cacert.pem && rm -f ~/cacert.pem
diff --git a/grpc/tools/dockerfile/distribtest/python_alpine_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_alpine_x64/Dockerfile
new file mode 100644
index 00000000..f119281d
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_alpine_x64/Dockerfile
@@ -0,0 +1,20 @@
+# Copyright 2021 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 python:3.10-alpine3.14
+
+# Our test infrastructure demands bash
+RUN apk update && apk add bash
+
+RUN pip3 install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
index 9e43d00b..ab94ce7c 100644
--- a/grpc/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM base/archlinux
+FROM archlinux:base
RUN pacman --noconfirm -Syy
RUN pacman --noconfirm -S openssl
-RUN pacman --noconfirm -S python2
-RUN pacman --noconfirm -S python2-pip
-RUN pip2 install virtualenv
+RUN pacman --noconfirm -S python
+RUN pacman --noconfirm -S python-pip
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_buster_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_buster_x64/Dockerfile
new file mode 100644
index 00000000..bc509e7e
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_buster_x64/Dockerfile
@@ -0,0 +1,18 @@
+# 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.
+
+FROM debian:buster
+
+RUN apt-get update && apt-get install -y python3 python3-pip
+RUN python3 -m pip install virtualenv==16.7.9
diff --git a/grpc/tools/dockerfile/distribtest/python_buster_x86/Dockerfile b/grpc/tools/dockerfile/distribtest/python_buster_x86/Dockerfile
new file mode 100644
index 00000000..aa220533
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_buster_x86/Dockerfile
@@ -0,0 +1,24 @@
+# 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.
+
+FROM i386/debian:buster
+
+RUN apt-get update && apt-get install -y python3 python3-pip
+
+RUN python3 -m pip install virtualenv==16.7.9
+
+# docker is running on a 64-bit machine, so we need to
+# override "uname -m" to report i686 instead of x86_64, otherwise
+# python will choose a wrong binary package to install.
+ENTRYPOINT ["linux32"]
diff --git a/grpc/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
deleted file mode 100644
index e71f6557..00000000
--- a/grpc/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-
-FROM centos:6
-
-RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
-
-# Vanilla CentOS6 only has python 2.6 and we don't support that.
-RUN yum -y install yum -y install https://centos6.iuscommunity.org/ius-release.rpm
-RUN yum install -y python27
-
-# Override python2.6
-RUN ln -s /usr/bin/python2.7 /usr/local/bin/python
-RUN ln -s /usr/bin/python2.7 /usr/local/bin/python2
-
-# Install pip
-RUN curl https://bootstrap.pypa.io/get-pip.py | python -
-
-# "which" command required by python's run_distrib_test.sh
-RUN yum install -y which
-
-RUN pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
index 4375a3f6..7650b622 100644
--- a/grpc/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
@@ -17,4 +17,5 @@ FROM centos:7
RUN yum install -y python
RUN yum install -y epel-release
RUN yum install -y python-pip
-RUN pip install virtualenv
+RUN yum install -y python3
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile
index b51cad93..30850cd3 100644
--- a/grpc/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile
@@ -14,11 +14,11 @@
FROM alpine:3.11
-RUN apk add --update build-base linux-headers python python2-dev py2-pip
+RUN apk add --update build-base linux-headers python3 python3-dev py3-pip
-RUN pip install --upgrade pip==19.3.1
+RUN python3 -m pip install --upgrade pip==19.3.1
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile
index 7f09fd64..f4366bb9 100644
--- a/grpc/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile
@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM base/archlinux
+FROM archlinux:base
RUN pacman --noconfirm -Syy
RUN pacman --noconfirm -S openssl
-RUN pacman --noconfirm -S python2
-RUN pacman --noconfirm -S python2-pip
-RUN pip2 install virtualenv
+RUN pacman --noconfirm -S python
+RUN pacman --noconfirm -S python-pip
+RUN python3 -m pip install virtualenv
RUN pacman --noconfirm -S base-devel
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile
new file mode 100644
index 00000000..75420816
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile
@@ -0,0 +1,21 @@
+# 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.
+
+FROM debian:buster
+
+RUN apt-get update && apt-get install -y python3 python3-pip
+RUN python3 -m pip install virtualenv==16.7.9
+
+RUN apt-get install -y build-essential
+RUN apt-get install -y python3-dev
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile
new file mode 100644
index 00000000..a3b9cbc7
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile
@@ -0,0 +1,27 @@
+# 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.
+
+FROM i386/debian:buster
+
+RUN apt-get update && apt-get install -y python3 python3-pip
+
+RUN python3 -m pip install virtualenv==16.7.9
+
+RUN apt-get install -y build-essential
+RUN apt-get install -y python3-dev
+
+# docker is running on a 64-bit machine, so we need to
+# override "uname -m" to report i686 instead of x86_64, otherwise
+# python will choose a wrong binary package to install.
+ENTRYPOINT ["linux32"]
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile
index df5ca648..13bf1844 100644
--- a/grpc/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile
@@ -14,14 +14,14 @@
FROM centos:7
-RUN yum install -y python
-RUN yum install -y python-devel
+RUN yum install -y python3
+RUN yum install -y python3-devel
RUN yum install -y epel-release
-RUN yum install -y python-pip
-RUN pip install --upgrade pip==19.3.1
-RUN pip install -U virtualenv
+RUN yum install -y python3-pip
+RUN python3 -m pip install --upgrade pip==19.3.1
+RUN python3 -m pip install -U virtualenv
-# The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 4.9,
+# The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 5.1,
# the minimum supported gcc version for gRPC Core so let's upgrade to
# the oldest one that can build gRPC on Centos 7.
RUN yum install -y centos-release-scl
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile
deleted file mode 100644
index 0dbf5e4c..00000000
--- a/grpc/tools/dockerfile/distribtest/python_dev_fedora23_x64/Dockerfile
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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.
-
-FROM fedora:23
-
-RUN yum clean all && yum update -y && yum install -y python python-pip
-RUN pip install virtualenv
-
-RUN yum groupinstall -y "Development Tools"
-RUN yum install -y redhat-rpm-config
-RUN yum install -y gcc-c++
-RUN yum install -y python2-devel
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile
new file mode 100644
index 00000000..0fbfb26c
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile
@@ -0,0 +1,25 @@
+# Copyright 2021 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 fedora:34
+
+RUN yum clean all && yum update -y && yum install -y python3 python3-pip
+RUN python3 -m pip install virtualenv==16.7.9
+
+RUN yum groupinstall -y "Development Tools"
+RUN yum install -y redhat-rpm-config
+RUN yum install -y gcc-c++
+RUN yum install -y python3-devel
+
+RUN yum install -y findutils
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile
deleted file mode 100644
index c2228989..00000000
--- a/grpc/tools/dockerfile/distribtest/python_dev_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-RUN apt-get update && apt-get install -y python python-pip
-RUN pip install virtualenv
-
-RUN apt-get install -y build-essential
-RUN apt-get install -y python-dev
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile
deleted file mode 100644
index b1d1a310..00000000
--- a/grpc/tools/dockerfile/distribtest/python_dev_jessie_x86/Dockerfile
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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.
-
-FROM i386/debian:jessie
-
-RUN apt-get update && apt-get install -y python python-pip
-
-RUN pip install virtualenv
-
-RUN apt-get install -y build-essential
-RUN apt-get install -y python-dev
-
-# docker is running on a 64-bit machine, so we need to
-# override "uname -m" to report i686 instead of x86_64, otherwise
-# python will choose a wrong binary package to install.
-ENTRYPOINT ["linux32"]
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile
index 1ff1e0a1..add7b329 100644
--- a/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile
@@ -14,9 +14,9 @@
FROM ubuntu:16.04
-RUN apt-get update -y && apt-get install -y python python-pip
+RUN apt-get update -y && apt-get install -y python3 python3-pip
RUN apt-get install -y build-essential
-RUN apt-get install -y python-dev
+RUN apt-get install -y python3-dev
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv==16.7.9
diff --git a/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile
index a7c48dd2..8b15fdce 100644
--- a/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile
@@ -14,9 +14,9 @@
FROM ubuntu:18.04
-RUN apt-get update -y && apt-get install -y python python-pip
+RUN apt-get update -y && apt-get install -y python3 python3-pip
RUN apt-get install -y build-essential
-RUN apt-get install -y python-dev
+RUN apt-get install -y python3-dev
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
deleted file mode 100644
index 60f788df..00000000
--- a/grpc/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-FROM fedora:23
-
-RUN yum clean all && yum update -y && yum install -y python python-pip
-RUN pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile
new file mode 100644
index 00000000..8c40a5f2
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile
@@ -0,0 +1,20 @@
+# 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.
+
+FROM fedora:34
+
+RUN yum clean all && yum update -y && yum install -y python3 python3-pip
+RUN python3 -m pip install virtualenv
+
+RUN yum install -y findutils
diff --git a/grpc/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
deleted file mode 100644
index 2c8ce8ec..00000000
--- a/grpc/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-RUN apt-get update && apt-get install -y python python-pip
-RUN pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile b/grpc/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
deleted file mode 100644
index d5b63421..00000000
--- a/grpc/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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.
-
-FROM i386/debian:jessie
-
-RUN apt-get update && apt-get install -y python python-pip
-
-RUN pip install virtualenv
-
-# docker is running on a 64-bit machine, so we need to
-# override "uname -m" to report i686 instead of x86_64, otherwise
-# python will choose a wrong binary package to install.
-ENTRYPOINT ["linux32"]
diff --git a/grpc/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
index 4a74fe51..d0a4fcbd 100644
--- a/grpc/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
@@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM opensuse:42.1
+FROM opensuse/leap:latest
-RUN zypper --non-interactive install python
-RUN zypper --non-interactive install python-pip
+RUN zypper --non-interactive install python3
+RUN zypper --non-interactive install python3-pip
# "which" command required by python's run_distrib_test.sh
RUN zypper --non-interactive install which
@@ -24,4 +24,4 @@ RUN zypper --non-interactive install which
# https://pypi.python.org/simple/
RUN zypper --non-interactive install ca-certificates-mozilla
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile
index 8b14a439..78021383 100644
--- a/grpc/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile
@@ -15,4 +15,4 @@
# this an aarch64 image, qemu emulator will be used to run the tests
FROM arm64v8/python:3.8-buster
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
index d00c7b45..af925d84 100644
--- a/grpc/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
@@ -14,10 +14,10 @@
FROM ubuntu:16.04
-RUN apt-get update -y && apt-get install -y python python-pip
+RUN apt-get update -y && apt-get install -y python3 python3-pip
# Necessary to fix virtualenv compatibility problems with python2.7
-RUN pip install --upgrade pip==19.3.1
+RUN python3 -m pip install --upgrade pip==19.3.1
# Ubuntu's python-pip package installs pip to /usr/bin, whereas the upgraded
# pip lives at /usr/local/bin/pip. We'll use the absolute path for now, since
diff --git a/grpc/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile
index ac71663a..30337403 100644
--- a/grpc/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile
@@ -14,6 +14,6 @@
FROM ubuntu:18.04
-RUN apt-get update -y && apt-get install -y python python-pip
+RUN apt-get update -y && apt-get install -y python3 python3-pip
-RUN pip install virtualenv
+RUN python3 -m pip install virtualenv
diff --git a/grpc/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
index b781e92a..dc55a8c5 100644
--- a/grpc/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
@@ -17,15 +17,15 @@ FROM centos:7
RUN yum update -y && yum install -y curl tar which
# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN curl -sSL https://get.rvm.io | bash -s stable
# Install Ruby 2.3
-RUN /bin/bash -l -c "rvm install ruby-2.4.9"
-RUN /bin/bash -l -c "rvm use --default ruby-2.4.9"
+RUN /bin/bash -l -c "rvm install ruby-2.5.7"
+RUN /bin/bash -l -c "rvm use --default ruby-2.5.7"
RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.4.9' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5.7' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
RUN mkdir /var/local/jenkins
diff --git a/grpc/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
deleted file mode 100644
index 56c564f5..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
+++ /dev/null
@@ -1,39 +0,0 @@
-# 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.
-
-FROM fedora:23
-
-# Make yum work properly under docker when using overlay storage driver.
-# https://bugzilla.redhat.com/show_bug.cgi?id=1213602#c9
-# https://github.com/docker/docker/issues/10180
-RUN yum install -y yum-plugin-ovl
-
-# distro-sync and install openssl, per https://github.com/fedora-cloud/docker-brew-fedora/issues/19
-RUN yum clean all && yum update -y && yum distro-sync -y && yum install -y openssl gnupg which findutils tar procps
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.3
-RUN /bin/bash -l -c "rvm install ruby-2.4.9"
-RUN /bin/bash -l -c "rvm use --default ruby-2.4.9"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.4.9' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
-
-RUN mkdir /var/local/jenkins
-
-RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.bashrc"
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
deleted file mode 100644
index 077aa16a..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-RUN apt-get update && apt-get install -y ruby-full
-
-RUN gem install bundler -v 1.17.3 --no-document
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_4/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_4/Dockerfile
deleted file mode 100644
index a645b180..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_4/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- curl \
- gcc && apt-get clean
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.4
-RUN /bin/bash -l -c "rvm install ruby-2.4.9"
-RUN /bin/bash -l -c "rvm use --default ruby-2.4.9"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.4.9' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_5/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_5/Dockerfile
deleted file mode 100644
index 44b36e55..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_5/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- curl \
- gcc && apt-get clean
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.5
-RUN /bin/bash -l -c "rvm install ruby-2.5.7"
-RUN /bin/bash -l -c "rvm use --default ruby-2.5.7"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5.7' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_6/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_6/Dockerfile
deleted file mode 100644
index fab8d53b..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_6/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- curl \
- gcc && apt-get clean
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.6
-RUN /bin/bash -l -c "rvm install ruby-2.6.5"
-RUN /bin/bash -l -c "rvm use --default ruby-2.6.5"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6.5' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler --no-document"
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_7/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_7/Dockerfile
deleted file mode 100644
index d5aeb9f2..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_2_7/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- curl \
- gcc && apt-get clean
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.7
-RUN /bin/bash -l -c "rvm install ruby-2.7.0"
-RUN /bin/bash -l -c "rvm use --default ruby-2.7.0"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.7.0' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler --no-document"
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_3_0/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_3_0/Dockerfile
deleted file mode 100644
index fbcacfda..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x64_ruby_3_0/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- curl \
- gcc && apt-get clean
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 3.0
-RUN /bin/bash -l -c "rvm install ruby-3.0.0"
-RUN /bin/bash -l -c "rvm use --default ruby-3.0.0"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-3.0.0' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler --no-document"
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
deleted file mode 100644
index 48fba1fc..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-FROM i386/debian:jessie
-
-RUN apt-get update && apt-get install -y ruby-full
-
-RUN gem install bundler -v 1.17.3 --no-document
diff --git a/grpc/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
deleted file mode 100644
index 74ddf5ce..00000000
--- a/grpc/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-FROM opensuse:42.1
-
-RUN zypper --non-interactive install curl
-
-RUN zypper --non-interactive install tar which
-
-RUN zypper --non-interactive install ca-certificates-mozilla
-
-# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
-RUN \curl -sSL https://get.rvm.io | bash -s stable --ruby
-
-# OpenSUSE is a bit crazy and ignores .bashrc for login shell.
-RUN /bin/bash -l -c "echo '. /etc/profile.d/rvm.sh' >> ~/.profile"
-
-RUN /bin/bash -l -c 'gem install --update bundler'
diff --git a/grpc/tools/dockerfile/distribtest/ruby_stretch_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64/Dockerfile
new file mode 100644
index 00000000..fd487453
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64/Dockerfile
@@ -0,0 +1,19 @@
+# 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.
+
+FROM debian:stretch
+
+RUN apt-get update && apt-get install -y ruby-full
+
+RUN gem install bundler -v 1.17.3 --no-document
diff --git a/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_5/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_5/Dockerfile
new file mode 100644
index 00000000..5d029008
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_5/Dockerfile
@@ -0,0 +1,42 @@
+# 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.
+
+FROM debian:stretch
+
+# Install Git and basic packages.
+RUN apt-get update && apt-get install -y \
+ gnupg2 \
+ procps \
+ curl \
+ gcc && apt-get clean
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.5
+RUN /bin/bash -l -c "rvm install ruby-2.5.7"
+RUN /bin/bash -l -c "rvm use --default ruby-2.5.7"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5.7' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6/Dockerfile
new file mode 100644
index 00000000..eea189f3
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_6/Dockerfile
@@ -0,0 +1,42 @@
+# 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.
+
+FROM debian:stretch
+
+# Install Git and basic packages.
+RUN apt-get update && apt-get install -y \
+ gnupg2 \
+ procps \
+ curl \
+ gcc && apt-get clean
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.6
+RUN /bin/bash -l -c "rvm install ruby-2.6.5"
+RUN /bin/bash -l -c "rvm use --default ruby-2.6.5"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6.5' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-document"
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7/Dockerfile
new file mode 100644
index 00000000..1325fb3d
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_2_7/Dockerfile
@@ -0,0 +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.
+
+FROM debian:stretch
+
+# Install Git and basic packages.
+RUN apt-get update && apt-get install -y \
+ gnupg2 \
+ procps \
+ curl \
+ gcc && apt-get clean
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.7
+RUN /bin/bash -l -c "rvm install ruby-2.7.0"
+RUN /bin/bash -l -c "rvm use --default ruby-2.7.0"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.7.0' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-document"
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0/Dockerfile
new file mode 100644
index 00000000..e883c8e1
--- /dev/null
+++ b/grpc/tools/dockerfile/distribtest/ruby_stretch_x64_ruby_3_0/Dockerfile
@@ -0,0 +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.
+
+FROM debian:stretch
+
+# Install Git and basic packages.
+RUN apt-get update && apt-get install -y \
+ gnupg2 \
+ procps \
+ curl \
+ gcc && apt-get clean
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 3.0
+RUN /bin/bash -l -c "rvm install ruby-3.0.0"
+RUN /bin/bash -l -c "rvm use --default ruby-3.0.0"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-3.0.0' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-document"
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile b/grpc/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
index 3d3b04b3..7640b0be 100644
--- a/grpc/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
+++ b/grpc/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
@@ -23,13 +23,13 @@ RUN apt-get update -y && apt-get install -y \
# Ruby dependencies
# Install rvm
-RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN \curl -sSL https://get.rvm.io | bash -s stable
# Install Ruby 2.4
-RUN /bin/bash -l -c "rvm install ruby-2.4.9"
-RUN /bin/bash -l -c "rvm use --default ruby-2.4.9"
+RUN /bin/bash -l -c "rvm install ruby-2.5.7"
+RUN /bin/bash -l -c "rvm use --default ruby-2.5.7"
RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.4.9' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5.7' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
diff --git a/grpc/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile
index be96f131..39edbe0a 100644
--- a/grpc/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile
@@ -1,4 +1,4 @@
-# Copyright 2016 gRPC authors.
+# Copyright 2021 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.
@@ -12,62 +12,96 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Docker file for building gRPC artifacts for Android.
+FROM debian:stretch
-FROM debian:sid
+#=================
+# Basic C core dependencies
-RUN apt-get update && apt-get install -y debian-keyring && apt-key update
-
-# Install Git and basic packages.
-RUN apt-get update && apt-key update && apt-get install -y \
- autoconf \
- autotools-dev \
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
build-essential \
- bzip2 \
- clang \
- curl \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
gcc \
- gcc-multilib \
- git \
- golang \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
libc6 \
libc6-dbg \
libc6-dev \
- libgtest-dev \
- libtool \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+
+RUN mkdir /var/local/jenkins
-# golang needed to build BoringSSL with cmake
-RUN apt-get update && apt-get install -y golang && apt-get clean
# Java required by Android SDK
RUN apt-get update && apt-get -y install openjdk-8-jdk && apt-get clean
# Install Android SDK
ENV ANDROID_SDK_VERSION 4333796
-RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \
- wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \
- unzip -q sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \
- rm sdk-tools-linux-${ANDROID_SDK_VERSION}.zip
+RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && wget -q https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_VERSION.zip && unzip -q sdk-tools-linux-$ANDROID_SDK_VERSION.zip && rm sdk-tools-linux-$ANDROID_SDK_VERSION.zip
ENV ANDROID_SDK_PATH /opt/android-sdk
# Install Android NDK and cmake using sdkmanager
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
-RUN yes | ${ANDROID_SDK_PATH}/tools/bin/sdkmanager --licenses # accept all licenses
-RUN ${ANDROID_SDK_PATH}/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459'
-ENV ANDROID_NDK_PATH ${ANDROID_SDK_PATH}/ndk-bundle
-ENV ANDROID_SDK_CMAKE ${ANDROID_SDK_PATH}/cmake/3.6.4111459/bin/cmake
-
-RUN mkdir /var/local/jenkins
+RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses
+RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459'
+ENV ANDROID_NDK_PATH $ANDROID_SDK_PATH/ndk-bundle
+ENV ANDROID_SDK_CMAKE $ANDROID_SDK_PATH/cmake/3.6.4111459/bin/cmake
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile
index 4c9e4804..b8c44f3f 100644
--- a/grpc/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile
@@ -13,23 +13,24 @@
# limitations under the License.
# Docker file for building gRPC artifacts.
-# Updated: 2020-10-08
+# Updated: 2021-08-23
##################
# Base
-FROM dockcross/manylinux2010-x64
+FROM dockcross/manylinux2010-x64:20210210-84c47e5
# Install essential packages.
-RUN yum -y install golang strace
-
+RUN yum -y install strace && yum clean all
##################
# Ruby dependencies
# Install rvm
-RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
+RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import -
+RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
+# Use "--insecure" to avoid cert expiration error
+RUN curl -sSL --insecure https://get.rvm.io | bash -s stable
# Install Ruby 2.6
RUN /bin/bash -l -c "rvm install ruby-2.6"
@@ -39,9 +40,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler"
-# Clean yum
-RUN yum clean all
-
# Create default work directory.
RUN mkdir /var/local/jenkins
diff --git a/grpc/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile
index 96effec9..aa20bb80 100644
--- a/grpc/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile
@@ -13,7 +13,7 @@
# limitations under the License.
# Docker file for building gRPC artifacts.
-# Updated: 2020-10-08
+# Updated: 2021-08-23
##################
# Base
@@ -21,15 +21,16 @@
FROM dockcross/manylinux2010-x86
# Install essential packages.
-RUN yum -y install golang strace
-
+RUN yum -y install strace && yum clean all
##################
# Ruby dependencies
# Install rvm
-RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
+RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import -
+RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
+# Use "--insecure" to avoid cert expiration error
+RUN curl -sSL --insecure https://get.rvm.io | bash -s stable
# Install Ruby 2.6
RUN /bin/bash -l -c "rvm install ruby-2.6 --32"
@@ -39,9 +40,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler"
-# Clean yum
-RUN yum clean all
-
# Create default work directory.
RUN mkdir /var/local/jenkins
diff --git a/grpc/tools/dockerfile/grpc_artifact_protoc_aarch64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_protoc_aarch64/Dockerfile
new file mode 100644
index 00000000..1f871ed2
--- /dev/null
+++ b/grpc/tools/dockerfile/grpc_artifact_protoc_aarch64/Dockerfile
@@ -0,0 +1,16 @@
+# Copyright 2021 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.
+
+# On aarch64 the protoc and codegen plugins are built via crosscompilation.
+FROM dockcross/linux-arm64
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile
index 9af7874b..b06af3b3 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile
@@ -22,10 +22,40 @@ RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libg
ADD install_python_for_wheel_crosscompilation.sh /scripts/install_python_for_wheel_crosscompilation.sh
-RUN /scripts/install_python_for_wheel_crosscompilation.sh 3.6.13 /opt/python/cp36-cp36m
-RUN /scripts/install_python_for_wheel_crosscompilation.sh 3.7.10 /opt/python/cp37-cp37m
-RUN /scripts/install_python_for_wheel_crosscompilation.sh 3.8.8 /opt/python/cp38-cp38
-RUN /scripts/install_python_for_wheel_crosscompilation.sh 3.9.2 /opt/python/cp39-cp39
+RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.6.13" "3.6.13" /opt/python/cp36-cp36m
+RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.7.10" "3.7.10" /opt/python/cp37-cp37m
+RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.8.8" "3.8.8" /opt/python/cp38-cp38
+RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.9.2" "3.9.2" /opt/python/cp39-cp39
+RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.10.0" "3.10.0rc1" /opt/python/cp310-cp310
ENV AUDITWHEEL_ARCH armv7l
ENV AUDITWHEEL_PLAT linux_armv7l
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
+ && curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
+# to ccache via a symlink. Use relative paths instead.
+ENV CC ${CROSS_TRIPLE}-gcc
+ENV CXX ${CROSS_TRIPLE}-g++
+
+# For historical reasons, task_runner.py the script under docker container using "bash -l"
+# which loads /etc/profile on startup. dockcross/linux-armv7 is based on an image where
+# /etc/profile overwrites contents of PATH (for security reasons) when run as root.
+# That causes the crosscompiler binaries located under /usr/xcc/armv7-unknown-linux-gnueabi/bin
+# to be removed from PATH. Since in our builds we don't need the /etc/profile for anything, we can just
+# truncate it.
+# TODO(jtattermusch): Remove this hack when possible.
+RUN echo "# file contents removed to avoid resetting PATH set by the docker image" >/etc/profile
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh b/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh
index cc7349bb..b5f9a56a 100755
--- a/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh
+++ b/grpc/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh
@@ -19,11 +19,12 @@ set -ex
# $1 - python version in "3.X.Y" format
# $2 - python tags (as in manylinx images) e.g. "/opt/python/cp37-cp37m"
PYTHON_VERSION="$1"
-PYTHON_PREFIX="$2"
+PYTHON_RELEASE="$2"
+PYTHON_PREFIX="$3"
-curl -O "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz"
-tar -xf "Python-${PYTHON_VERSION}.tar.xz"
-pushd "Python-${PYTHON_VERSION}"
+curl -O "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_RELEASE}.tar.xz"
+tar -xf "Python-${PYTHON_RELEASE}.tar.xz"
+pushd "Python-${PYTHON_RELEASE}"
# In this step, we are building python that can run on the architecture where the build runs (x64).
# Since the CC, CXX and other env vars are set by default to point to the crosscompilation toolchain,
@@ -43,4 +44,4 @@ popd
rm -rf "Python-${PYTHON_VERSION}"
# install cython and wheel
-"${PYTHON_PREFIX}/bin/pip3" install --upgrade cython wheel
+"${PYTHON_PREFIX}/bin/python3" -m pip install --upgrade cython wheel
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile
index ff31e315..51a67583 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x64/Dockerfile
@@ -14,20 +14,32 @@
# Docker file for building gRPC manylinux Python artifacts.
-# python2.7 was removed from the manylinux2010 image.
-# Use the latest version that still has python2.7
-# TODO(jtattermusch): Stop building python2.7 wheels.
-FROM quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5
+FROM quay.io/pypa/manylinux2010_x86_64:2022-01-22-72ab18b
+
+# manylinux_2_12 is the preferred alias of manylinux2010
+ENV AUDITWHEEL_PLAT manylinux_2_12_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel linux-headers openssl-devel zlib-devel gcc
###################################
# Install Python build requirements
-RUN /opt/python/cp27-cp27m/bin/pip install --upgrade cython
-RUN /opt/python/cp27-cp27mu/bin/pip install --upgrade cython
-RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x86/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x86/Dockerfile
index 0896ac4e..a7e1815e 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x86/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2010_x86/Dockerfile
@@ -14,20 +14,32 @@
# Docker file for building gRPC manylinux Python artifacts.
-# python2.7 was removed from the manylinux2010 image.
-# Use the latest version that still has python2.7
-# TODO(jtattermusch): Stop building python2.7 wheels.
-FROM quay.io/pypa/manylinux2010_i686:2021-02-06-3d322a5
+FROM quay.io/pypa/manylinux2010_i686:2022-01-22-72ab18b
+
+# manylinux_2_12 is the preferred alias of manylinux2010
+ENV AUDITWHEEL_PLAT manylinux_2_12_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel linux-headers openssl-devel zlib-devel gcc
###################################
# Install Python build requirements
-RUN /opt/python/cp27-cp27m/bin/pip install --upgrade cython
-RUN /opt/python/cp27-cp27mu/bin/pip install --upgrade cython
-RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile
index db984437..d249c03c 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64/Dockerfile
@@ -12,20 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# The aarch64 wheels are being crosscompiled to allow running the build
-# on x64 machine. The dockcross/manylinux2014-aarch64 image is a x86_64
-# image with crosscompilation toolchain installed.
-# Use an older version of dockcross image that has gcc4.9.4 because it was built
-# before https://github.com/dockcross/dockcross/pull/449
-FROM dockcross/manylinux2014-aarch64:20200929-608e6ac
+FROM dockcross/manylinux2014-aarch64:20210826-19322ba
+
+# manylinux_2_17 is the preferred alias of manylinux2014
+ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
###################################
# Install Python build requirements
-RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
+ && curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
# the dockcross docker image sets variables like CC, CXX etc.
# to point to the crosscompilation toolchain, but doesn't set corresponding
@@ -33,3 +46,8 @@ RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
# see https://github.com/dockcross/dockcross/blob/4349cb4999401cbf22a90f46f5052d29be240e50/manylinux2014-aarch64/Dockerfile.in#L23
ENV STRIP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip \
OBJCOPY=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-objcopy
+
+# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
+# to ccache via a symlink. Use relative paths instead.
+ENV CC ${CROSS_TRIPLE}-gcc
+ENV CXX ${CROSS_TRIPLE}-g++
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile
index 77475529..f90a46e8 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x64/Dockerfile
@@ -13,17 +13,33 @@
# limitations under the License.
# Docker file for building gRPC manylinux Python artifacts.
-# Updated: 2020-10-08
-FROM quay.io/pypa/manylinux2014_x86_64
+FROM quay.io/pypa/manylinux2014_x86_64:2021-08-26-12e5da0
+
+# manylinux_2_17 is the preferred alias of manylinux2014
+ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
###################################
# Install Python build requirements
-RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile
index 45f64aca..3de8fb18 100644
--- a/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile
@@ -13,17 +13,33 @@
# limitations under the License.
# Docker file for building gRPC manylinux Python artifacts.
-# Updated: 2020-10-08
-FROM quay.io/pypa/manylinux2014_i686
+FROM quay.io/pypa/manylinux2014_i686:2021-08-26-12e5da0
+
+# manylinux_2_17 is the preferred alias of manylinux2014
+ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
###################################
# Install Python build requirements
-RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz \ No newline at end of file
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile
new file mode 100644
index 00000000..290f252d
--- /dev/null
+++ b/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x64/Dockerfile
@@ -0,0 +1,37 @@
+# Copyright 2021 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 quay.io/pypa/musllinux_1_1_x86_64:2021-11-15-a808c18
+
+###################################
+# Install Python build requirements
+RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
+RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
+RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
+RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile b/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile
new file mode 100644
index 00000000..7a408b6a
--- /dev/null
+++ b/grpc/tools/dockerfile/grpc_artifact_python_musllinux_1_1_x86/Dockerfile
@@ -0,0 +1,37 @@
+# Copyright 2021 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 quay.io/pypa/musllinux_1_1_i686:2021-11-15-a808c18
+
+###################################
+# Install Python build requirements
+RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
+RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
+RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
+RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
+RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
diff --git a/grpc/tools/dockerfile/grpc_clang/Dockerfile b/grpc/tools/dockerfile/grpc_clang/Dockerfile
deleted file mode 100644
index 8f838ea1..00000000
--- a/grpc/tools/dockerfile/grpc_clang/Dockerfile
+++ /dev/null
@@ -1,46 +0,0 @@
-# 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.
-
-FROM ubuntu:latest
-
-RUN apt-get update && apt-get install -y \
- cmake \
- g++ \
- gcc \
- git \
- make \
- python \
- && apt-get clean
-
-RUN git clone -b release_36 http://llvm.org/git/llvm.git
-RUN git clone -b release_36 http://llvm.org/git/clang.git
-RUN git clone -b release_36 http://llvm.org/git/compiler-rt.git
-RUN git clone -b release_36 http://llvm.org/git/clang-tools-extra.git
-RUN git clone -b release_36 http://llvm.org/git/libcxx.git
-RUN git clone -b release_36 http://llvm.org/git/libcxxabi.git
-
-RUN mv clang llvm/tools
-RUN mv compiler-rt llvm/projects
-RUN mv clang-tools-extra llvm/tools/clang/tools
-RUN mv libcxx llvm/projects
-RUN mv libcxxabi llvm/projects
-
-RUN mkdir llvm-build
-RUN cd llvm-build && cmake \
- -DCMAKE_BUILD_TYPE:STRING=Release \
- -DLLVM_TARGETS_TO_BUILD:STRING=X86 \
- ../llvm
-RUN make -C llvm-build && make -C llvm-build install && rm -rf llvm-build
-
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/grpc_clang_format/Dockerfile b/grpc/tools/dockerfile/grpc_clang_format/Dockerfile
index bb8979ed..7f19e50d 100644
--- a/grpc/tools/dockerfile/grpc_clang_format/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_clang_format/Dockerfile
@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:bullseye
-
-# Install clang-format
-RUN apt-get update && apt-get install -y clang-format-11
-ENV CLANG_FORMAT=clang-format-11
+FROM silkeh/clang:13
ADD clang_format_all_the_things.sh /
diff --git a/grpc/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/grpc/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
index ff6f2f5a..87970b53 100755
--- a/grpc/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
+++ b/grpc/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
@@ -16,7 +16,7 @@
set -e
# directories to run against
-DIRS="examples/cpp src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/csharp src/ruby third_party/address_sorting src/objective-c tools/distrib/python"
+DIRS="examples/cpp examples/android/binder src/core/lib src/core/tsi src/core/ext src/cpp test/core test/cpp include src/compiler src/csharp src/ruby src/objective-c tools/distrib/python"
# file matching patterns to check
GLOB="*.h *.c *.cc *.m *.mm"
@@ -24,12 +24,15 @@ GLOB="*.h *.c *.cc *.m *.mm"
# clang format command
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
+# number of CPUs available
+CPU_COUNT=`nproc`
+
files=
for dir in $DIRS
do
for glob in $GLOB
do
- files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.upb.h' -and -not -name '*.upb.c' -and -not -name '*.upbdefs.h' -and -not -name '*.upbdefs.c' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name '*.pbobjc.h' -and -not -name '*.pbobjc.m' -and -not -name '*.pbrpc.h' -and -not -name '*.pbrpc.m' -and -not -name end2end_tests.cc -and -not -name end2end_nosec_tests.cc -and -not -name public_headers_must_be_c89.c -and -not -name grpc_shadow_boringssl.h`"
+ files="$files `find ${CLANG_FORMAT_ROOT}/$dir -name $glob -and -not -name '*.generated.*' -and -not -name '*.upb.h' -and -not -name '*.upb.c' -and -not -name '*.upbdefs.h' -and -not -name '*.upbdefs.c' -and -not -name '*.pb.h' -and -not -name '*.pb.c' -and -not -name '*.pb.cc' -and -not -name '*.pbobjc.h' -and -not -name '*.pbobjc.m' -and -not -name '*.pbrpc.h' -and -not -name '*.pbrpc.m' -and -not -name end2end_tests.cc -and -not -name public_headers_must_be_c89.c -and -not -name grpc_shadow_boringssl.h -and -not -name grpc_tls_credentials_options.h -and -not -name grpc_tls_credentials_options_comparator_test.cc`"
done
done
@@ -41,7 +44,7 @@ fi
if [ "$TEST" == "" ]
then
- echo $files | xargs $CLANG_FORMAT -i
+ echo $files | xargs -P $CPU_COUNT -n 10 $CLANG_FORMAT -i
else
ok=yes
for file in $files
diff --git a/grpc/tools/dockerfile/grpc_clang_tidy/Dockerfile b/grpc/tools/dockerfile/grpc_clang_tidy/Dockerfile
index adc91d16..804e20d5 100644
--- a/grpc/tools/dockerfile/grpc_clang_tidy/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_clang_tidy/Dockerfile
@@ -12,11 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:bullseye
+FROM silkeh/clang:13
-# Install clang-tidy 11
-RUN apt-get update && apt-get install -y clang-tidy-11 jq
-ENV CLANG_TIDY=clang-tidy-11
+# Install prerequisites for the clang-tidy script
+RUN apt-get update && apt-get install -y python3 jq git && apt-get clean
+
+# otherwise clang-tidy will report missing <gtest/gtest.h> header
+RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean
ADD clang_tidy_all_the_things.sh /
diff --git a/grpc/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh b/grpc/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh
index 1127679d..1e606638 100755
--- a/grpc/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh
+++ b/grpc/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh
@@ -23,6 +23,7 @@ cd ${CLANG_TIDY_ROOT}
# run clang tidy for all source files
cat compile_commands.json | jq -r '.[].file' \
| grep -E "(^include/|^src/core/|^src/cpp/|^test/core/|^test/cpp/)" \
+ | grep -v -E "src/core/lib/debug/stats_data" \
| grep -v -E "/upb-generated/|/upbdefs-generated/" \
| sort \
| xargs tools/distrib/run_clang_tidy.py "$@"
diff --git a/grpc/tools/dockerfile/grpc_dist_proto/Dockerfile b/grpc/tools/dockerfile/grpc_dist_proto/Dockerfile
index 71d76fca..009cb8e5 100644
--- a/grpc/tools/dockerfile/grpc_dist_proto/Dockerfile
+++ b/grpc/tools/dockerfile/grpc_dist_proto/Dockerfile
@@ -23,7 +23,7 @@ RUN apt-get update && apt-get -y install libgtest-dev
# Get the protobuf source from GitHub.
RUN mkdir -p /var/local/git
-RUN git clone https://github.com/google/protobuf.git /var/local/git/protobuf
+RUN git clone https://github.com/protocolbuffers/protobuf.git /var/local/git/protobuf
# Build the protobuf library statically and install to /tmp/protoc_static.
WORKDIR /var/local/git/protobuf
diff --git a/grpc/tools/dockerfile/grpc_iwyu/Dockerfile b/grpc/tools/dockerfile/grpc_iwyu/Dockerfile
new file mode 100644
index 00000000..8b845965
--- /dev/null
+++ b/grpc/tools/dockerfile/grpc_iwyu/Dockerfile
@@ -0,0 +1,33 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 silkeh/clang:13
+
+# Install prerequisites for the iwyu script
+RUN apt-get update && apt-get install -y python3 jq git cmake python zlib1g-dev libtinfo-dev && apt-get clean
+
+# Install IWYU for Clang 13
+RUN git clone https://github.com/include-what-you-use/include-what-you-use.git /iwyu
+RUN cd /iwyu && git checkout fbd921d6640bf1b18fe5a8a895636215367eb6b9
+RUN mkdir /iwyu_build && cd /iwyu_build \
+ && cmake -G "Unix Makefiles" /iwyu \
+ && make
+
+ADD iwyu.sh /
+
+# When running locally, we'll be impersonating the current user, so we need
+# to make the script runnable by everyone.
+RUN chmod a+rx /iwyu.sh
+
+CMD ["echo 'Run with tools/distrib/iwyu.sh'"]
diff --git a/grpc/tools/dockerfile/grpc_iwyu/iwyu.sh b/grpc/tools/dockerfile/grpc_iwyu/iwyu.sh
new file mode 100755
index 00000000..0278035b
--- /dev/null
+++ b/grpc/tools/dockerfile/grpc_iwyu/iwyu.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+cd ${IWYU_ROOT}
+
+export PATH=${PATH}:/iwyu_build/bin
+
+cat compile_commands.json | sed "s,\"file\": \",\"file\": \"${IWYU_ROOT}/,g" > compile_commands_for_iwyu.json
+
+# figure out which files to include
+cat compile_commands.json | jq -r '.[].file' \
+ | grep -E "^src/core/lib/promise/" \
+ | grep -v -E "/upb-generated/|/upbdefs-generated/" \
+ | sort \
+ | tee iwyu_files.txt
+
+# run iwyu, filtering out changes to port_platform.h
+xargs -a iwyu_files.txt /iwyu/iwyu_tool.py -p compile_commands_for_iwyu.json -j 16 \
+ | grep -v -E "port_platform.h" \
+ | tee iwyu.out
+
+# apply the suggested changes
+/iwyu/fix_includes.py --nocomments < iwyu.out || true
+
+# reformat sources, since iwyu gets this wrong
+xargs -a iwyu_files.txt ${CLANG_FORMAT:-clang-format} -i
+
+# TODO(ctiller): expand this to match the clang-tidy directories:
+# | grep -E "(^include/|^src/core/|^src/cpp/|^test/core/|^test/cpp/)"
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile
index 89a4261f..1d3cc501 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile
@@ -12,58 +12,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:stretch
+FROM debian:11
-# Install Git and basic packages.
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+ zip \
+ && apt-get clean
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
#================
# C# dependencies
@@ -74,30 +87,31 @@ RUN apt-get update && apt-get install -y cmake && apt-get clean
# Install mono
RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update && apt-get install -y \
mono-devel \
ca-certificates-mono \
nuget \
&& apt-get clean
-# Install dotnet SDK
-ENV DOTNET_SDK_VERSION 2.1.500
-RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
+# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
+RUN DOTNET_DOWNLOAD_VERSION=3.1.415 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
- && rm dotnet.tar.gz \
- && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
-
+ && rm dotnet.tar.gz
-# Install .NET Core 1.1.10 runtime (required to run netcoreapp1.1)
-RUN curl -sSL -o dotnet_old.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/1.1.10/dotnet-debian.9-x64.1.1.10.tar.gz \
- && mkdir -p dotnet_old \
- && tar zxf dotnet_old.tar.gz -C dotnet_old \
- && cp -r dotnet_old/shared/Microsoft.NETCore.App/1.1.10/ /usr/share/dotnet/shared/Microsoft.NETCore.App/ \
- && rm -rf dotnet_old/ dotnet_old.tar.gz
-RUN apt-get update && apt-get install -y libunwind8 && apt-get clean
+# Install .NET 6
+RUN DOTNET_DOWNLOAD_VERSION=6.0.100 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+# Make sure "dotnet" is on PATH
+RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
@@ -107,8 +121,23 @@ RUN mkdir warmup \
&& cd .. \
&& rm -rf warmup
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
RUN mkdir /var/local/jenkins
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
index 89a4261f..1d3cc501 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
@@ -12,58 +12,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:stretch
+FROM debian:11
-# Install Git and basic packages.
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+ zip \
+ && apt-get clean
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
#================
# C# dependencies
@@ -74,30 +87,31 @@ RUN apt-get update && apt-get install -y cmake && apt-get clean
# Install mono
RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update && apt-get install -y \
mono-devel \
ca-certificates-mono \
nuget \
&& apt-get clean
-# Install dotnet SDK
-ENV DOTNET_SDK_VERSION 2.1.500
-RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
+# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
+RUN DOTNET_DOWNLOAD_VERSION=3.1.415 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
- && rm dotnet.tar.gz \
- && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
-
+ && rm dotnet.tar.gz
-# Install .NET Core 1.1.10 runtime (required to run netcoreapp1.1)
-RUN curl -sSL -o dotnet_old.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/1.1.10/dotnet-debian.9-x64.1.1.10.tar.gz \
- && mkdir -p dotnet_old \
- && tar zxf dotnet_old.tar.gz -C dotnet_old \
- && cp -r dotnet_old/shared/Microsoft.NETCore.App/1.1.10/ /usr/share/dotnet/shared/Microsoft.NETCore.App/ \
- && rm -rf dotnet_old/ dotnet_old.tar.gz
-RUN apt-get update && apt-get install -y libunwind8 && apt-get clean
+# Install .NET 6
+RUN DOTNET_DOWNLOAD_VERSION=6.0.100 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+# Make sure "dotnet" is on PATH
+RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip
@@ -107,8 +121,23 @@ RUN mkdir warmup \
&& cd .. \
&& rm -rf warmup
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
RUN mkdir /var/local/jenkins
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile
index e256ae9a..29ed6fc3 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile
@@ -12,75 +12,99 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:jessie
+FROM debian:11
+#=================
+# Basic C core dependencies
-# Install Git and basic packages.
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+ zip \
+ && apt-get clean
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
#=================
# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
#=================
-# Use cmake 3.6 from jessie-backports
-# should only be used for images based on debian jessie.
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
-RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
-RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
-RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
-RUN apt-get update && apt-get install -t jessie-backports -y cmake && apt-get clean
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
RUN mkdir /var/local/jenkins
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client
index f0796a4c..6f1195c3 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client
@@ -35,4 +35,7 @@ RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/
FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750
COPY --from=0 /artifacts ./
+ENV GRPC_VERBOSITY="DEBUG"
+ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,eds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,lrs_lb,xds_server_config_fetcher"
+
ENTRYPOINT ["/xds_interop_client"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server
index cd081e14..9f90cbde 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server
@@ -35,4 +35,7 @@ RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/
FROM phusion/baseimage:master@sha256:65ea10d5f757e5e86272625f8675d437dd83d8db64bdb429e2354d58f5462750
COPY --from=0 /artifacts ./
+ENV GRPC_VERBOSITY="DEBUG"
+ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,eds_lb,xds_cluster_resolver_lb,priority_lb,weighted_target_lb,lrs_lb,xds_cluster_impl_lb,xds_server_config_fetcher"
+
ENTRYPOINT ["/xds_interop_server"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile
index 3863cde6..c3b4a9a2 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile
@@ -18,20 +18,29 @@ FROM golang:1.16
RUN ln -s /usr/local/go/bin/go /usr/local/bin
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile
index e067d316..adc0b063 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile
@@ -18,20 +18,29 @@ FROM golang:1.11
RUN ln -s /usr/local/go/bin/go /usr/local/bin
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile
index 3863cde6..c3b4a9a2 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile
@@ -18,20 +18,29 @@ FROM golang:1.16
RUN ln -s /usr/local/go/bin/go /usr/local/bin
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile
index 4ceff253..ea621c90 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile
@@ -18,20 +18,29 @@ FROM golang:1.8
RUN ln -s /usr/local/go/bin/go /usr/local/bin
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile
index 30bf79eb..0a7fbccb 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile
@@ -18,22 +18,18 @@ FROM golang:latest
RUN ln -s /usr/local/go/bin/go /usr/local/bin
#====================
-# Python dependencies
+# Python dependencies to run tools/run_tests scripts
# Install dependencies
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+RUN apt-get update && apt-get install -y python3-all-dev python3-pip
# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+RUN python3 -m pip install --upgrade pip==19.3.1
+RUN python3 -m pip install virtualenv==16.7.9
+RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0
-RUN pip install twisted h2==2.6.1 hyper
+RUN python3 -m pip install twisted h2==2.6.1 hyper
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile
index b7664b3c..1ca33d5d 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile
@@ -14,7 +14,6 @@
FROM debian:jessie
-
RUN echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" > /etc/apt/sources.list.d/jessie-backports.list && \
echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until && \
apt-get update && \
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile
index d71f43c1..57614926 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile
@@ -14,74 +14,85 @@
FROM debian:jessie
+#=================
+# Basic C core dependencies
-# Install Git and basic packages.
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+ zip \
+ && apt-get clean
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+
+RUN mkdir /var/local/jenkins
#==================
# Node dependencies
# Install nvm
-RUN touch .profile
-RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
+RUN groupadd -g 999 appuser && useradd -r -u 999 -g appuser appuser
+RUN mkdir -p /home/appuser && chown appuser /home/appuser
+RUN chmod 777 /root
+USER appuser
+RUN touch ~/.profile
+RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 9 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 10 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 10"
-
-RUN mkdir /var/local/jenkins
-
+RUN /bin/bash -l -c "nvm install 16 && npm config set cache /tmp/npm-cache"
+RUN /bin/bash -l -c "nvm alias default 16"
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/grpc/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh
index aeb82e0c..ff3a7460 100755
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh
@@ -16,17 +16,16 @@
# Builds Node interop server and client in a base image.
set -e
-mkdir -p /var/local/git
-git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node
+git clone /var/local/jenkins/grpc-node ~/grpc-node
# clone gRPC submodules, use data from locally cloned submodules where possible
-(cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \
+(cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd ~/grpc-node \
&& git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \
${name}')
# copy service account keys if available
-cp -r /var/local/jenkins/service_account $HOME || true
+cp -r /var/local/jenkins/service_account /root/ || true
-cd /var/local/git/grpc-node
+cd ~/grpc-node
# build Node interop client & server
./setup_interop.sh
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile
index fd089f1b..acb7e03a 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile
@@ -14,58 +14,60 @@
FROM debian:jessie
+#=================
+# Basic C core dependencies
-# Install Git and basic packages.
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
+ zip \
+ && apt-get clean
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+
+RUN mkdir /var/local/jenkins
#==================
# Node dependencies
# Install nvm
-RUN touch .profile
-RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
+RUN groupadd -g 999 appuser && useradd -r -u 999 -g appuser appuser
+RUN mkdir -p /home/appuser && chown appuser /home/appuser
+RUN chmod 777 /root
+USER appuser
+RUN touch ~/.profile
+RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 9 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 10 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 10"
-
-RUN mkdir /var/local/jenkins
-
+RUN /bin/bash -l -c "nvm install 16 && npm config set cache /tmp/npm-cache"
+RUN /bin/bash -l -c "nvm alias default 16"
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/build_interop.sh b/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/build_interop.sh
index db55f5a1..e659f46a 100755
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/build_interop.sh
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_nodepurejs/build_interop.sh
@@ -16,17 +16,16 @@
# Builds Node interop server and client in a base image.
set -e
-mkdir -p /var/local/git
-git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node
+git clone /var/local/jenkins/grpc-node ~/grpc-node
# clone gRPC submodules, use data from locally cloned submodules where possible
-(cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \
+(cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd ~/grpc-node \
&& git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \
${name}')
# copy service account keys if available
-cp -r /var/local/jenkins/service_account $HOME || true
+cp -r /var/local/jenkins/service_account /root/ || true
-cd /var/local/git/grpc-node
+cd ~/grpc-node
# build Node interop client & server
./setup_interop_purejs.sh
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile
index 77d79278..ff97f110 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile
@@ -12,62 +12,123 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:jessie
-
+FROM debian:11
#=================
-# PHP7 dependencies
+# Basic C core dependencies
-# Install Git and basic packages.
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- automake \
build-essential \
- ccache \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
curl \
+ dnsutils \
git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# PHP7 dependencies
+
+# PHP specific dependencies
+RUN apt-get update && apt-get install -y \
+ libbison-dev \
libcurl4-openssl-dev \
libgmp-dev \
libgmp3-dev \
libssl-dev \
- libtool \
libxml2-dev \
- pkg-config \
re2c \
- time \
- unzip \
- wget \
- zip && apt-get clean
-
-# Install other dependencies
-RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
-RUN wget http://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.gz -O /var/local/bison-3.4.2.tar.gz
-RUN cd /var/local \
- && tar -zxvf bison-3.4.2.tar.gz \
- && cd /var/local/bison-3.4.2 \
- && ./configure \
- && make \
- && make install
+ zlib1g-dev \
+ && apt-get clean
# Compile PHP7 from source
RUN git clone https://github.com/php/php-src /var/local/git/php-src
RUN cd /var/local/git/php-src \
- && git checkout PHP-7.2.22 \
+ && git checkout PHP-7.2.34 \
&& ./buildconf --force \
&& ./configure \
--with-gmp \
--with-openssl \
--with-zlib \
- && make \
+ && make -j$(nproc) \
&& make install
-
-RUN mkdir /var/local/jenkins
-
# Install composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
-# Define the default command.
-CMD ["bash"]
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile
index 90ba56c9..b801ce6a 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile
@@ -12,57 +12,76 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:stretch
-
-# Install Git and basic packages.
+FROM debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
+ zip \
+ && apt-get clean
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
+RUN mkdir /var/local/jenkins
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
+RUN apt-get update && apt-get install -y python3 python3-all-dev python3-pip
+RUN ln -s $(which python3) /usr/bin/python
-RUN mkdir /var/local/jenkins
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+#=================
+# Install ccache
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
-RUN apt-get update && apt-get -t stable install -y python3.7 python3-all-dev
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/grpc/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
index 468aa20e..c6818285 100755
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh
@@ -28,5 +28,5 @@ cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc
-# interop tests only run using python3.7 currently (and python build is slow)
-tools/run_tests/run_tests.py -l python --compiler python3.7 -c opt --build_only
+# interop tests only run using python3.9 currently (and python build is slow)
+tools/run_tests/run_tests.py -l python --compiler python3.9 -c opt --build_only
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile
index 90ba56c9..c9869f62 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile
@@ -12,57 +12,76 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:stretch
-
-# Install Git and basic packages.
+FROM debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
+ zip \
+ && apt-get clean
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
+RUN mkdir /var/local/jenkins
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
+RUN apt-get update && apt-get install -y python3 python3-pip python3-all-dev
+RUN ln -s $(which python3) /usr/bin/python
-RUN mkdir /var/local/jenkins
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+#=================
+# Install ccache
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
-RUN apt-get update && apt-get -t stable install -y python3.7 python3-all-dev
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/build_interop.sh b/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/build_interop.sh
index 468aa20e..c6818285 100755
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/build_interop.sh
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/build_interop.sh
@@ -28,5 +28,5 @@ cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc
-# interop tests only run using python3.7 currently (and python build is slow)
-tools/run_tests/run_tests.py -l python --compiler python3.7 -c opt --build_only
+# interop tests only run using python3.9 currently (and python build is slow)
+tools/run_tests/run_tests.py -l python --compiler python3.9 -c opt --build_only
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile
index 6db1f565..26be2d0e 100644
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile
@@ -12,65 +12,78 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:buster
+FROM debian:11
-# Install Git and basic packages.
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
+ zip \
+ && apt-get clean
#====================
-# Python dependencies
-
-# Install dependencies
+# run_tests.py python dependencies
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
#==================
# Ruby dependencies
# Install rvm
RUN apt-get update && apt-get install -y gnupg2 && apt-get clean
-RUN gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN \curl -sSL https://get.rvm.io | bash -s stable
# Install Ruby 2.5
@@ -82,8 +95,29 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-document -v 1.9"
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
RUN mkdir /var/local/jenkins
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh
index e71ad914..8cbdf6c0 100755
--- a/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh
+++ b/grpc/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh
@@ -30,4 +30,4 @@ cd /var/local/git/grpc
rvm --default use ruby-2.5
# build Ruby interop client and server
-(cd src/ruby && gem install bundler -v 1.17.3 && bundle && rake compile)
+(cd src/ruby && gem install bundler -v 1.17.3 && bundle && bundle exec rake compile)
diff --git a/grpc/tools/dockerfile/interoptest/lb_interop_fake_servers/Dockerfile b/grpc/tools/dockerfile/interoptest/lb_interop_fake_servers/Dockerfile
index f317b5bc..3ca9ebdd 100644
--- a/grpc/tools/dockerfile/interoptest/lb_interop_fake_servers/Dockerfile
+++ b/grpc/tools/dockerfile/interoptest/lb_interop_fake_servers/Dockerfile
@@ -28,7 +28,7 @@ RUN ln -s /usr/local/go/bin/go /usr/local/bin
# Install Python packages from PyPI
RUN pip install --upgrade pip==19.3.1
RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
+RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/push_testing_images.sh b/grpc/tools/dockerfile/push_testing_images.sh
index 3c9ad50d..e10337cc 100755
--- a/grpc/tools/dockerfile/push_testing_images.sh
+++ b/grpc/tools/dockerfile/push_testing_images.sh
@@ -27,6 +27,19 @@ cd $(dirname $0)/../..
git_root=$(pwd)
cd -
+# Check that docker is installed and sudoless docker works.
+docker run -it debian:11 bash -c 'echo "sudoless docker run works!"' || \
+ (echo "Error: docker not installed or sudoless docker doesn't work?" && exit 1)
+
+# Some of the images we build are for arm64 architecture and the easiest
+# way of allowing them to build locally on x64 machine is to use
+# qemu binfmt-misc hook that automatically runs arm64 binaries under
+# an emulator.
+# Perform a check that "qemu-user-static" with binfmt-misc hook
+# is installed, to give an early warning (otherwise building arm64 images won't work)
+docker run -it arm64v8/debian:11 bash -c 'echo "able to run arm64 docker images with an emulator!"' || \
+ (echo "Error: can't run arm64 images under an emulator. Have you run 'sudo apt-get install qemu-user-static'?" && exit 1)
+
DOCKERHUB_ORGANIZATION=grpctesting
for DOCKERFILE_DIR in tools/dockerfile/test/* tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/* tools/dockerfile/distribtest/* third_party/rake-compiler-dock/*/
diff --git a/grpc/tools/dockerfile/test/bazel/Dockerfile b/grpc/tools/dockerfile/test/bazel/Dockerfile
index b333d854..4600d0b2 100644
--- a/grpc/tools/dockerfile/test/bazel/Dockerfile
+++ b/grpc/tools/dockerfile/test/bazel/Dockerfile
@@ -15,10 +15,8 @@
# Pinned version of the base image is used to avoid regressions caused
# by rebuilding of this docker image. To see available versions, you can run
# "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder"
-# TODO(jtattermusch): with the latest version we'd get clang12+
-# which makes our build fail due to new warnings being treated
-# as errors.
-FROM gcr.io/oss-fuzz-base/base-builder@sha256:de220fd2433cd53bd06b215770dcd14a5e74632e0215acea7401fee8cafb18da
+# Image(5eceb81f5759) is built on Jan 31, 2022
+FROM gcr.io/oss-fuzz-base/base-builder@sha256:5eceb81f57599d63ca7c9a70c8968b23b128119699626ca749017019eb0b523f
# -------------------------- WARNING --------------------------------------
# If you are making changes to this file, consider changing
@@ -26,70 +24,38 @@ FROM gcr.io/oss-fuzz-base/base-builder@sha256:de220fd2433cd53bd06b215770dcd14a5e
# accordingly.
# -------------------------------------------------------------------------
-# Install basic packages and Bazel dependencies.
-RUN apt-get update && apt-get install -y software-properties-common python-software-properties
-RUN add-apt-repository ppa:webupd8team/java
+# Install basic packages
RUN apt-get update && apt-get -y install \
autoconf \
build-essential \
curl \
- wget \
libtool \
make \
- openjdk-8-jdk \
- vim
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-
-#=================
-# Compile CPython 3.6.9 from source
-
-RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev
-RUN apt-get update && apt-get install -y jq build-essential libffi-dev
-
-RUN cd /tmp && \
- wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \
- tar xzvf Python-3.6.9.tgz && \
- cd Python-3.6.9 && \
- ./configure && \
- make install
-
-RUN cd /tmp && \
- echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \
- md5sum -c checksum.md5
-
-RUN python3.6 -m ensurepip && \
- python3.6 -m pip install coverage
-
+ vim \
+ wget
#========================
# Bazel installation
# Must be in sync with tools/bazel
-ENV BAZEL_VERSION 3.7.1
+ENV BAZEL_VERSION 4.2.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1
-RUN apt-get update && apt-get install -y wget && apt-get clean
-RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
- bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
- rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
+# Download the correct bazel version and make sure it's on path.
+RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
+ && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
+ && chmod a+x /usr/local/bin/bazel
+
+# Normally we would run "bazel --version" here to make sure bazel
+# was correctly installed, but we can't do that because
+# of # https://github.com/bazelbuild/bazel/issues/11379.
+# We want to keep the arm64 version of the image buildable
+# on x64 with use of qemu-user-static & binfmt emulation,
+# but the self-extraction is broken for bazel currently.
+# The binary will work correctly when run on real arm64
+# hardware, when qemu-user-static isn't getting into the way.
RUN mkdir -p /var/local/jenkins
diff --git a/grpc/tools/dockerfile/test/bazel_arm64/Dockerfile b/grpc/tools/dockerfile/test/bazel_arm64/Dockerfile
new file mode 100644
index 00000000..e8137ab7
--- /dev/null
+++ b/grpc/tools/dockerfile/test/bazel_arm64/Dockerfile
@@ -0,0 +1,112 @@
+# Copyright 2022 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 arm64v8/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+
+# Install bazel
+#========================
+# Bazel installation
+
+# Must be in sync with tools/bazel
+ENV BAZEL_VERSION 4.2.1
+
+# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
+ENV DISABLE_BAZEL_WRAPPER 1
+
+# Download the correct bazel version and make sure it's on path.
+RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
+ && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
+ && chmod a+x /usr/local/bin/bazel
+
+# Normally we would run "bazel --version" here to make sure bazel
+# was correctly installed, but we can't do that because
+# of # https://github.com/bazelbuild/bazel/issues/11379.
+# We want to keep the arm64 version of the image buildable
+# on x64 with use of qemu-user-static & binfmt emulation,
+# but the self-extraction is broken for bazel currently.
+# The binary will work correctly when run on real arm64
+# hardware, when qemu-user-static isn't getting into the way.
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/binder_transport_apk/Dockerfile b/grpc/tools/dockerfile/test/binder_transport_apk/Dockerfile
new file mode 100644
index 00000000..10e624ce
--- /dev/null
+++ b/grpc/tools/dockerfile/test/binder_transport_apk/Dockerfile
@@ -0,0 +1,78 @@
+# Copyright 2021 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.
+
+# Pinned version of the base image is used to avoid regressions caused
+# by rebuilding of this docker image. To see available versions, you can run
+# "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder"
+# Image(5eceb81f5759) is built on Jan 31, 2022
+FROM gcr.io/oss-fuzz-base/base-builder@sha256:5eceb81f57599d63ca7c9a70c8968b23b128119699626ca749017019eb0b523f
+
+# -------------------------- WARNING --------------------------------------
+# If you are making changes to this file, consider changing
+# https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile
+# accordingly.
+# -------------------------------------------------------------------------
+
+# Install basic packages
+RUN apt-get update && apt-get -y install \
+ autoconf \
+ build-essential \
+ curl \
+ libtool \
+ make \
+ vim \
+ wget
+
+#========================
+# Bazel installation
+
+# Must be in sync with tools/bazel
+ENV BAZEL_VERSION 4.2.1
+
+# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
+ENV DISABLE_BAZEL_WRAPPER 1
+
+# Download the correct bazel version and make sure it's on path.
+RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
+ && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
+ && chmod a+x /usr/local/bin/bazel
+
+# Normally we would run "bazel --version" here to make sure bazel
+# was correctly installed, but we can't do that because
+# of # https://github.com/bazelbuild/bazel/issues/11379.
+# We want to keep the arm64 version of the image buildable
+# on x64 with use of qemu-user-static & binfmt emulation,
+# but the self-extraction is broken for bazel currently.
+# The binary will work correctly when run on real arm64
+# hardware, when qemu-user-static isn't getting into the way.
+
+
+#========================
+# Java
+RUN apt-get install -y openjdk-8-jdk
+
+#========================
+# Android SDK/NDK installation
+ENV SDK_ROOT=/opt/android-sdk
+RUN mkdir -p $SDK_ROOT
+RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && unzip cmd.zip && rm cmd.zip && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529'
+
+# Set environment variables for Bazel rules
+ENV ANDROID_HOME=/opt/android-sdk
+ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529
+
+RUN mkdir -p /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/csharp_debian11_arm64/Dockerfile b/grpc/tools/dockerfile/test/csharp_debian11_arm64/Dockerfile
new file mode 100644
index 00000000..0fba8e1d
--- /dev/null
+++ b/grpc/tools/dockerfile/test/csharp_debian11_arm64/Dockerfile
@@ -0,0 +1,143 @@
+# Copyright 2022 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 arm64v8/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#================
+# C# dependencies
+
+# cmake >=3.6 needed to build grpc_csharp_ext
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+# Install mono
+RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
+RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+RUN apt-get update && apt-get install -y \
+ mono-devel \
+ ca-certificates-mono \
+ nuget \
+ && apt-get clean
+
+# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
+RUN DOTNET_DOWNLOAD_VERSION=3.1.415 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+
+# Install .NET 6
+RUN DOTNET_DOWNLOAD_VERSION=6.0.100 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+
+# Make sure "dotnet" is on PATH
+RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
+
+# Trigger the population of the local package cache
+ENV NUGET_XMLDOC_MODE skip
+RUN mkdir warmup \
+ && cd warmup \
+ && dotnet new \
+ && cd .. \
+ && rm -rf warmup
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/csharp_debian11_x64/Dockerfile b/grpc/tools/dockerfile/test/csharp_debian11_x64/Dockerfile
new file mode 100644
index 00000000..fe730e19
--- /dev/null
+++ b/grpc/tools/dockerfile/test/csharp_debian11_x64/Dockerfile
@@ -0,0 +1,143 @@
+# Copyright 2018 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 debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#================
+# C# dependencies
+
+# cmake >=3.6 needed to build grpc_csharp_ext
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+# Install mono
+RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
+RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+RUN apt-get update && apt-get install -y \
+ mono-devel \
+ ca-certificates-mono \
+ nuget \
+ && apt-get clean
+
+# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
+RUN DOTNET_DOWNLOAD_VERSION=3.1.415 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+
+# Install .NET 6
+RUN DOTNET_DOWNLOAD_VERSION=6.0.100 \
+ && DOTNET_DOWNLOAD_ARCH="$(uname -m | sed s/x86_64/x64/ | sed s/aarch64/arm64/)" \
+ && curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_DOWNLOAD_VERSION/dotnet-sdk-$DOTNET_DOWNLOAD_VERSION-linux-$DOTNET_DOWNLOAD_ARCH.tar.gz \
+ && mkdir -p /usr/share/dotnet \
+ && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
+ && rm dotnet.tar.gz
+
+# Make sure "dotnet" is on PATH
+RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
+
+# Trigger the population of the local package cache
+ENV NUGET_XMLDOC_MODE skip
+RUN mkdir warmup \
+ && cd warmup \
+ && dotnet new \
+ && cd .. \
+ && rm -rf warmup
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/csharp_stretch_x64/Dockerfile b/grpc/tools/dockerfile/test/csharp_stretch_x64/Dockerfile
deleted file mode 100644
index 892be06b..00000000
--- a/grpc/tools/dockerfile/test/csharp_stretch_x64/Dockerfile
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#================
-# C# dependencies
-
-# cmake >=3.6 needed to build grpc_csharp_ext
-RUN apt-get update && apt-get install -y cmake && apt-get clean
-
-# Install mono
-RUN apt-get update && apt-get install -y apt-transport-https dirmngr && apt-get clean
-RUN apt-key adv --no-tty --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
-RUN echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list
-RUN apt-get update && apt-get install -y \
- mono-devel \
- ca-certificates-mono \
- nuget \
- && apt-get clean
-
-# Install dotnet SDK
-ENV DOTNET_SDK_VERSION 2.1.500
-RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
- && mkdir -p /usr/share/dotnet \
- && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
- && rm dotnet.tar.gz \
- && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
-
-
-# Install .NET Core 1.1.10 runtime (required to run netcoreapp1.1)
-RUN curl -sSL -o dotnet_old.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/1.1.10/dotnet-debian.9-x64.1.1.10.tar.gz \
- && mkdir -p dotnet_old \
- && tar zxf dotnet_old.tar.gz -C dotnet_old \
- && cp -r dotnet_old/shared/Microsoft.NETCore.App/1.1.10/ /usr/share/dotnet/shared/Microsoft.NETCore.App/ \
- && rm -rf dotnet_old/ dotnet_old.tar.gz
-RUN apt-get update && apt-get install -y libunwind8 && apt-get clean
-
-
-# Trigger the population of the local package cache
-ENV NUGET_XMLDOC_MODE skip
-RUN mkdir warmup \
- && cd warmup \
- && dotnet new \
- && cd .. \
- && rm -rf warmup
-
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile
index 7bd7eede..819c986d 100644
--- a/grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile
+++ b/grpc/tools/dockerfile/test/cxx_alpine_x64/Dockerfile
@@ -30,24 +30,42 @@ RUN apk update && apk add \
make \
perl \
strace \
- python2-dev \
- py2-pip \
+ python3 \
+ py3-pip \
unzip \
wget \
zip
-# Install Python packages from PyPI
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-RUN pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-RUN mkdir /var/local/jenkins
+RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+RUN mkdir /var/local/jenkins
+
+
# Define the default command.
CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_buster_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_buster_x64/Dockerfile
deleted file mode 100644
index c26c5a5d..00000000
--- a/grpc/tools/dockerfile/test/cxx_buster_x64/Dockerfile
+++ /dev/null
@@ -1,86 +0,0 @@
-# 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.
-
-FROM debian:buster
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-#=================
-# Install cmake
-# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
-
-RUN apt-get update && apt-get install -y cmake && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_clang_13_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_clang_13_x64/Dockerfile
new file mode 100644
index 00000000..c54962ae
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_clang_13_x64/Dockerfile
@@ -0,0 +1,72 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 silkeh/clang:13
+
+RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile
new file mode 100644
index 00000000..75ac65ea
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile
@@ -0,0 +1,72 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 silkeh/clang:4
+
+RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile
new file mode 100644
index 00000000..95df5063
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_debian11_openssl102_x64/Dockerfile
@@ -0,0 +1,122 @@
+# Copyright 2021 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 debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Install openssl 1.0.2 from source
+RUN apt-get update && apt-get install -y build-essential zlib1g-dev
+RUN cd /tmp && \
+ wget --no-check-certificate https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz && \
+ tar -xf openssl-1.0.2u.tar.gz && \
+ cd openssl-1.0.2u && \
+ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \
+ make -j 4 && \
+ make install && \
+ rm -rf /tmp/openssl-1.0.2u*
+ENV OPENSSL_ROOT_DIR=/usr/local/ssl
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_debian11_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_debian11_x64/Dockerfile
new file mode 100644
index 00000000..29ed6fc3
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_debian11_x64/Dockerfile
@@ -0,0 +1,110 @@
+# 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.
+
+FROM debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_debian11_x86/Dockerfile b/grpc/tools/dockerfile/test/cxx_debian11_x86/Dockerfile
new file mode 100644
index 00000000..f8d7dedd
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_debian11_x86/Dockerfile
@@ -0,0 +1,110 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 i386/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile
new file mode 100644
index 00000000..93e0e1f4
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile
@@ -0,0 +1,68 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 gcc:11
+
+RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_gcc_5_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_gcc_5_x64/Dockerfile
new file mode 100644
index 00000000..bcbad5af
--- /dev/null
+++ b/grpc/tools/dockerfile/test/cxx_gcc_5_x64/Dockerfile
@@ -0,0 +1,57 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 gcc:5
+
+RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Use cmake 3.6 from jessie-backports
+# should only be used for images based on debian jessie.
+
+RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
+RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
+RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
+RUN apt-get update && apt-get install -t jessie-backports -y cmake && apt-get clean
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_jessie_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_jessie_x64/Dockerfile
deleted file mode 100644
index bd59939f..00000000
--- a/grpc/tools/dockerfile/test/cxx_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,96 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-#=================
-# Use cmake 3.6 from jessie-backports
-# should only be used for images based on debian jessie.
-
-RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
-RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
-RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
-RUN apt-get update && apt-get install -t jessie-backports -y cmake && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-#================
-# libuv
-RUN cd /tmp && wget http://dist.libuv.org/dist/v1.9.1/libuv-v1.9.1.tar.gz && tar -xf libuv-v1.9.1.tar.gz && cd libuv-v1.9.1 && sh autogen.sh && ./configure --prefix=/usr && make && make install
-
-# Install gcc-4.9 and other relevant items
-RUN apt-get update && apt-get -y install gcc gcc-multilib g++ g++-multilib && apt-get clean
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_jessie_x86/Dockerfile b/grpc/tools/dockerfile/test/cxx_jessie_x86/Dockerfile
deleted file mode 100644
index d5291bf2..00000000
--- a/grpc/tools/dockerfile/test/cxx_jessie_x86/Dockerfile
+++ /dev/null
@@ -1,93 +0,0 @@
-# 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.
-
-FROM i386/debian:jessie
-RUN sed -i '/deb http:\/\/http.debian.net\/debian jessie-updates main/d' /etc/apt/sources.list
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-#=================
-# Use cmake 3.6 from jessie-backports
-# should only be used for images based on debian jessie.
-
-RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
-RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf
-RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
-RUN apt-get update && apt-get install -t jessie-backports -y cmake && apt-get clean
-
-
-# Install gcc-4.9 and other relevant items
-RUN apt-get update && apt-get -y install gcc gcc-multilib g++ g++-multilib && apt-get clean
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile
deleted file mode 100644
index b5dfa6d2..00000000
--- a/grpc/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile
+++ /dev/null
@@ -1,89 +0,0 @@
-# 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.
-
-FROM ubuntu:16.04
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-#=================
-# Install cmake
-# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
-
-RUN apt-get update && apt-get install -y cmake && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-
-# Installs clang 4.0 and 5.0, the clang++ is included in clang packages
-RUN apt-get update && apt-get -y install clang-4.0 clang-5.0 && apt-get clean
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/cxx_ubuntu1804_x64/Dockerfile b/grpc/tools/dockerfile/test/cxx_ubuntu1804_x64/Dockerfile
deleted file mode 100644
index db927f8c..00000000
--- a/grpc/tools/dockerfile/test/cxx_ubuntu1804_x64/Dockerfile
+++ /dev/null
@@ -1,86 +0,0 @@
-# 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.
-
-FROM ubuntu:18.04
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-#=================
-# Install cmake
-# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
-
-RUN apt-get update && apt-get install -y cmake && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/node_jessie_x64/Dockerfile b/grpc/tools/dockerfile/test/node_jessie_x64/Dockerfile
deleted file mode 100644
index 35e07a88..00000000
--- a/grpc/tools/dockerfile/test/node_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,104 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-
-# Install Electron apt dependencies
-RUN apt-get update && apt-get install -y \
- libasound2 \
- libgconf-2-4 \
- libgtk2.0-0 \
- libnss3 \
- libxss1 \
- libxtst6 \
- xvfb
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#==================
-# Node dependencies
-
-# Install nvm
-RUN touch .profile
-RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
-# Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 9 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 10 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 10"
-
-RUN mkdir /var/local/jenkins
-
-# Install Mako to generate files in grpc/grpc-node
-RUN pip install Mako
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile b/grpc/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile
new file mode 100644
index 00000000..f157b24d
--- /dev/null
+++ b/grpc/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile
@@ -0,0 +1,91 @@
+# 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.
+
+# debian 11 = "bullseye"
+FROM php:7.3-zts-bullseye
+
+RUN apt-get update && apt-get install -y \
+ autoconf automake build-essential git libtool curl \
+ zlib1g-dev \
+ && apt-get clean
+
+# install php pthreads from source
+# TODO(jtattermusch): is this really needed?
+# See https://github.com/grpc/grpc/pull/23056
+WORKDIR /tmp
+RUN git clone https://github.com/krakjoe/pthreads
+RUN cd pthreads && \
+ phpize && \
+ ./configure && \
+ make && \
+ make install
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+# Install composer
+RUN curl -sS https://getcomposer.org/installer | php
+RUN mv composer.phar /usr/local/bin/composer
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Seems required by XDS interop tests.
+RUN python3 -m pip install virtualenv==16.7.9
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile b/grpc/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile
deleted file mode 100644
index 446e2872..00000000
--- a/grpc/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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.
-
-FROM php:7.3-zts-stretch
-
-RUN apt-get -qq update && apt-get -qq install -y \
- autoconf automake build-essential git libtool curl \
- zlib1g-dev \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-WORKDIR /tmp
-
-RUN git clone https://github.com/krakjoe/pthreads
-
-RUN cd pthreads && \
- phpize && \
- ./configure && \
- make && \
- make install
-
-RUN curl https://bootstrap.pypa.io/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-RUN curl -sS https://getcomposer.org/installer | php
-RUN mv composer.phar /usr/local/bin/composer
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/php7_debian11_arm64/Dockerfile b/grpc/tools/dockerfile/test/php7_debian11_arm64/Dockerfile
new file mode 100644
index 00000000..9b8f5a2b
--- /dev/null
+++ b/grpc/tools/dockerfile/test/php7_debian11_arm64/Dockerfile
@@ -0,0 +1,137 @@
+# 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.
+
+FROM arm64v8/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# PHP7 dependencies
+
+# PHP specific dependencies
+RUN apt-get update && apt-get install -y \
+ libbison-dev \
+ libcurl4-openssl-dev \
+ libgmp-dev \
+ libgmp3-dev \
+ libssl-dev \
+ libxml2-dev \
+ re2c \
+ zlib1g-dev \
+ && apt-get clean
+
+# Compile PHP7 from source
+RUN git clone https://github.com/php/php-src /var/local/git/php-src
+RUN cd /var/local/git/php-src \
+ && git checkout PHP-7.2.34 \
+ && ./buildconf --force \
+ && ./configure \
+ --with-gmp \
+ --with-openssl \
+ --with-zlib \
+ && make -j$(nproc) \
+ && make install
+
+#=================
+# PHP Test dependencies
+
+ RUN apt-get update && apt-get install -y \
+ valgrind
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/php7_debian11_x64/Dockerfile b/grpc/tools/dockerfile/test/php7_debian11_x64/Dockerfile
new file mode 100644
index 00000000..939f81b7
--- /dev/null
+++ b/grpc/tools/dockerfile/test/php7_debian11_x64/Dockerfile
@@ -0,0 +1,137 @@
+# 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.
+
+FROM debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# PHP7 dependencies
+
+# PHP specific dependencies
+RUN apt-get update && apt-get install -y \
+ libbison-dev \
+ libcurl4-openssl-dev \
+ libgmp-dev \
+ libgmp3-dev \
+ libssl-dev \
+ libxml2-dev \
+ re2c \
+ zlib1g-dev \
+ && apt-get clean
+
+# Compile PHP7 from source
+RUN git clone https://github.com/php/php-src /var/local/git/php-src
+RUN cd /var/local/git/php-src \
+ && git checkout PHP-7.2.34 \
+ && ./buildconf --force \
+ && ./configure \
+ --with-gmp \
+ --with-openssl \
+ --with-zlib \
+ && make -j$(nproc) \
+ && make install
+
+#=================
+# PHP Test dependencies
+
+ RUN apt-get update && apt-get install -y \
+ valgrind
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/php7_jessie_x64/Dockerfile b/grpc/tools/dockerfile/test/php7_jessie_x64/Dockerfile
deleted file mode 100644
index 2d6021ce..00000000
--- a/grpc/tools/dockerfile/test/php7_jessie_x64/Dockerfile
+++ /dev/null
@@ -1,93 +0,0 @@
-# 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.
-
-FROM debian:jessie
-
-
-#=================
-# PHP7 dependencies
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- automake \
- build-essential \
- ccache \
- curl \
- git \
- libcurl4-openssl-dev \
- libgmp-dev \
- libgmp3-dev \
- libssl-dev \
- libtool \
- libxml2-dev \
- pkg-config \
- re2c \
- time \
- unzip \
- wget \
- zip && apt-get clean
-
-# Install other dependencies
-RUN ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
-RUN wget http://ftp.gnu.org/gnu/bison/bison-3.4.2.tar.gz -O /var/local/bison-3.4.2.tar.gz
-RUN cd /var/local \
- && tar -zxvf bison-3.4.2.tar.gz \
- && cd /var/local/bison-3.4.2 \
- && ./configure \
- && make \
- && make install
-
-# Compile PHP7 from source
-RUN git clone https://github.com/php/php-src /var/local/git/php-src
-RUN cd /var/local/git/php-src \
- && git checkout PHP-7.2.22 \
- && ./buildconf --force \
- && ./configure \
- --with-gmp \
- --with-openssl \
- --with-zlib \
- && make \
- && make install
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#=================
-# PHP Test dependencies
-
- RUN apt-get update && apt-get install -y \
- valgrind
-
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile b/grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile
index bf5f07a0..70254d6e 100644
--- a/grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile
+++ b/grpc/tools/dockerfile/test/python_alpine_x64/Dockerfile
@@ -1,4 +1,4 @@
-# Copyright 2015 gRPC authors.
+# Copyright 2018 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.
@@ -15,36 +15,32 @@
FROM alpine:3.11
# Install Git and basic packages.
-RUN apk update && apk add \
- autoconf \
- automake \
- bzip2 \
- build-base \
- cmake \
- ccache \
- curl \
- gcc \
- git \
- libtool \
- linux-headers \
- make \
- perl \
- strace \
- python2-dev \
- py2-pip \
- unzip \
- wget \
- zip
+RUN apk update && apk add autoconf automake bzip2 build-base cmake ccache curl gcc git libtool linux-headers make perl strace python3-dev py3-pip unzip wget zip
+
+RUN ln -s /usr/bin/pip3 /usr/bin/pip
+RUN ln -s /usr/bin/python3 /usr/bin/python
# Install Python packages from PyPI
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0
+RUN python3 -m pip install --upgrade pip==19.3.1
+RUN python3 -m pip install virtualenv
+RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+#=================
+# Install ccache
-RUN mkdir -p /var/local/jenkins
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile b/grpc/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile
new file mode 100644
index 00000000..977de6aa
--- /dev/null
+++ b/grpc/tools/dockerfile/test/python_debian11_default_arm64/Dockerfile
@@ -0,0 +1,90 @@
+# Copyright 2022 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 arm64v8/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+
+RUN mkdir /var/local/jenkins
+
+
+# 3.9 is the default python3 version on debian11
+RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip
+
+# for Python test coverage reporting
+RUN python3.9 -m pip install coverage
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
diff --git a/grpc/tools/dockerfile/test/python_debian11_default_x64/Dockerfile b/grpc/tools/dockerfile/test/python_debian11_default_x64/Dockerfile
new file mode 100644
index 00000000..67a3acf1
--- /dev/null
+++ b/grpc/tools/dockerfile/test/python_debian11_default_x64/Dockerfile
@@ -0,0 +1,175 @@
+# Copyright 2018 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 debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+
+RUN mkdir /var/local/jenkins
+
+
+#=================
+# Compile CPython 3.6.15 from source
+
+RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
+RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
+
+RUN cd /tmp && \
+ wget -q https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz && \
+ tar xzvf Python-3.6.15.tgz && \
+ cd Python-3.6.15 && \
+ ./configure && \
+ make -j4 && \
+ make install
+
+RUN cd /tmp && \
+ echo "f9e6f91c754a604f4fc6f6c7683723fb Python-3.6.15.tgz" > checksum.md5 && \
+ md5sum -c checksum.md5
+
+RUN python3.6 -m ensurepip && \
+ python3.6 -m pip install coverage
+
+#=================
+# Compile CPython 3.7.13 from source
+
+RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
+RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
+
+RUN cd /tmp && \
+ wget -q https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz && \
+ tar xzvf Python-3.7.13.tgz && \
+ cd Python-3.7.13 && \
+ ./configure && \
+ make -j4 && \
+ make install
+
+RUN cd /tmp && \
+ echo "e0d3321026d4a5f3a3890b5d821ad762 Python-3.7.13.tgz" > checksum.md5 && \
+ md5sum -c checksum.md5
+
+RUN python3.7 -m ensurepip && \
+ python3.7 -m pip install coverage
+
+#=================
+# Compile CPython 3.8.13 from source
+
+RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
+RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
+
+RUN cd /tmp && \
+ wget -q https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \
+ tar xzvf Python-3.8.13.tgz && \
+ cd Python-3.8.13 && \
+ ./configure && \
+ make -j4 && \
+ make install
+
+RUN cd /tmp && \
+ echo "3c49180c6b43df3519849b7e390af0b9 Python-3.8.13.tgz" > checksum.md5 && \
+ md5sum -c checksum.md5
+
+RUN python3.8 -m ensurepip && \
+ python3.8 -m pip install coverage
+
+#=================
+# Compile CPython 3.10.3 from source
+
+RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean
+RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean
+
+RUN cd /tmp && \
+ wget -q https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz && \
+ tar xzvf Python-3.10.3.tgz && \
+ cd Python-3.10.3 && \
+ ./configure && \
+ make -j4 && \
+ make install
+
+RUN cd /tmp && \
+ echo "f276ffcd05bccafe46da023d0a5bb04a Python-3.10.3.tgz" > checksum.md5 && \
+ md5sum -c checksum.md5
+
+RUN python3.10 -m ensurepip && \
+ python3.10 -m pip install coverage
+
+
+# 3.9 is the default python3 version on debian11
+RUN apt-get update && apt-get install -y python3.9 python3.9-dev python3-pip
+
+# for Python test coverage reporting
+RUN python3.9 -m pip install coverage
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
diff --git a/grpc/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile
deleted file mode 100644
index eb618dae..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
diff --git a/grpc/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile
deleted file mode 100644
index 0871723b..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
-
-RUN apt-get update && apt-get install -y python3.5 python3-all-dev
-RUN curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5
diff --git a/grpc/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile
deleted file mode 100644
index 6efa2b87..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
-#=================
-# Compile CPython 3.6.9 from source
-
-RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev
-RUN apt-get update && apt-get install -y jq build-essential libffi-dev
-
-RUN cd /tmp && \
- wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \
- tar xzvf Python-3.6.9.tgz && \
- cd Python-3.6.9 && \
- ./configure && \
- make install
-
-RUN cd /tmp && \
- echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \
- md5sum -c checksum.md5
-
-RUN python3.6 -m ensurepip && \
- python3.6 -m pip install coverage
-
diff --git a/grpc/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile
deleted file mode 100644
index 9f518446..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
-
-RUN apt-get update && apt-get -t buster install -y python3.7 python3-all-dev
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
-
-# for Python test coverage reporting
-RUN pip install coverage
diff --git a/grpc/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile
deleted file mode 100644
index 4060deaf..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile
+++ /dev/null
@@ -1,85 +0,0 @@
-# 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
-#=================
-# Compile CPython 3.8.0b4 from source
-
-RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev
-RUN apt-get update && apt-get install -y jq build-essential libffi-dev
-
-RUN cd /tmp && \
- wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && \
- tar xzvf Python-3.8.0b4.tgz && \
- cd Python-3.8.0b4 && \
- ./configure && \
- make install
-
-RUN cd /tmp && \
- echo "b8f4f897df967014ddb42033b90c3058 Python-3.8.0b4.tgz" > checksum.md5 && \
- md5sum -c checksum.md5
-
-RUN python3.8 -m ensurepip && \
- python3.8 -m pip install coverage
-
diff --git a/grpc/tools/dockerfile/test/python_stretch_default_x64/Dockerfile b/grpc/tools/dockerfile/test/python_stretch_default_x64/Dockerfile
deleted file mode 100644
index e9de0958..00000000
--- a/grpc/tools/dockerfile/test/python_stretch_default_x64/Dockerfile
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 2018 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 debian:stretch
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2.7 python-all-dev
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-# Add Debian 'buster' repository, we will need it for installing newer versions of python
-RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list
-RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local
-
-RUN mkdir /var/local/jenkins
-
-
-#=================
-# Compile CPython 3.6.9 from source
-
-RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev
-RUN apt-get update && apt-get install -y jq build-essential libffi-dev
-
-RUN cd /tmp && \
- wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \
- tar xzvf Python-3.6.9.tgz && \
- cd Python-3.6.9 && \
- ./configure && \
- make install
-
-RUN cd /tmp && \
- echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \
- md5sum -c checksum.md5
-
-RUN python3.6 -m ensurepip && \
- python3.6 -m pip install coverage
-
-#=================
-# Compile CPython 3.8.0b4 from source
-
-RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev
-RUN apt-get update && apt-get install -y jq build-essential libffi-dev
-
-RUN cd /tmp && \
- wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && \
- tar xzvf Python-3.8.0b4.tgz && \
- cd Python-3.8.0b4 && \
- ./configure && \
- make install
-
-RUN cd /tmp && \
- echo "b8f4f897df967014ddb42033b90c3058 Python-3.8.0b4.tgz" > checksum.md5 && \
- md5sum -c checksum.md5
-
-RUN python3.8 -m ensurepip && \
- python3.8 -m pip install coverage
-
-
-RUN apt-get update && apt-get install -y python3.5 python3.5-dev
-RUN curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5
-
-RUN apt-get update && apt-get -t buster install -y python3.7 python3-all-dev
-RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
-
-# for Python test coverage reporting
-RUN python3.7 -m pip install coverage
diff --git a/grpc/tools/dockerfile/test/ruby_buster_x64/Dockerfile b/grpc/tools/dockerfile/test/ruby_buster_x64/Dockerfile
deleted file mode 100644
index 80b9c33e..00000000
--- a/grpc/tools/dockerfile/test/ruby_buster_x64/Dockerfile
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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.
-
-FROM debian:buster
-
-# Install Git and basic packages.
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- dnsutils \
- gcc \
- gcc-multilib \
- git \
- golang \
- gyp \
- lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- perl \
- strace \
- python-dev \
- python-setuptools \
- python-yaml \
- telnet \
- unzip \
- wget \
- zip && apt-get clean
-
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
-
-#====================
-# Python dependencies
-
-# Install dependencies
-
-RUN apt-get update && apt-get install -y \
- python-all-dev \
- python3-all-dev \
- python-setuptools
-
-# Install Python packages from PyPI
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7
-RUN pip install --upgrade pip==19.3.1
-RUN pip install virtualenv==16.7.9
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.15.0 twisted==17.5.0
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
-
-#==================
-# Ruby dependencies
-
-# Install rvm
-RUN apt-get update && apt-get install -y gnupg2 && apt-get clean
-RUN gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-RUN \curl -sSL https://get.rvm.io | bash -s stable
-
-# Install Ruby 2.5
-RUN apt-get update && apt-get install -y procps && apt-get clean
-RUN /bin/bash -l -c "rvm install ruby-2.5"
-RUN /bin/bash -l -c "rvm use --default ruby-2.5"
-RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
-RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
-RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5' >> ~/.bashrc"
-RUN /bin/bash -l -c "gem install bundler --no-document -v 1.9"
-
-#=================
-# Install cmake
-# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
-
-RUN apt-get update && apt-get install -y cmake && apt-get clean
-
-
-RUN mkdir /var/local/jenkins
-
-# Define the default command.
-CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile b/grpc/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile
new file mode 100644
index 00000000..279bf7d1
--- /dev/null
+++ b/grpc/tools/dockerfile/test/ruby_debian11_arm64/Dockerfile
@@ -0,0 +1,126 @@
+# Copyright 2022 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 arm64v8/debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN apt-get update && apt-get install -y gnupg2 && apt-get clean
+RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.5
+RUN apt-get update && apt-get install -y procps && apt-get clean
+RUN /bin/bash -l -c "rvm install ruby-2.5"
+RUN /bin/bash -l -c "rvm use --default ruby-2.5"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-document -v 1.9"
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Seems required by XDS interop tests.
+RUN python3 -m pip install virtualenv==16.7.9
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/ruby_debian11_x64/Dockerfile b/grpc/tools/dockerfile/test/ruby_debian11_x64/Dockerfile
new file mode 100644
index 00000000..4f180854
--- /dev/null
+++ b/grpc/tools/dockerfile/test/ruby_debian11_x64/Dockerfile
@@ -0,0 +1,126 @@
+# 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.
+
+FROM debian:11
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
+RUN apt-get update && apt-get install -y \
+ build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
+ bzip2 \
+ curl \
+ dnsutils \
+ git \
+ lcov \
+ make \
+ strace \
+ time \
+ unzip \
+ wget \
+ zip \
+ && apt-get clean
+
+#====================
+# run_tests.py python dependencies
+
+# Basic python dependencies to be able to run tools/run_tests python scripts
+# These dependencies are not sufficient to build gRPC Python, gRPC Python
+# deps are defined elsewhere (e.g. python_deps.include)
+RUN apt-get update && apt-get install -y \
+ python3 \
+ python3-pip \
+ python3-setuptools \
+ python3-yaml \
+ && apt-get clean
+
+# use pinned version of pip to avoid sudden breakages
+RUN python3 -m pip install --upgrade pip==19.3.1
+
+# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
+# but since our python2 usage is deprecated, we should get rid of it.
+RUN python3 -m pip install six==1.16.0
+
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+
+
+#==================
+# Ruby dependencies
+
+# Install rvm
+RUN apt-get update && apt-get install -y gnupg2 && apt-get clean
+RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.5
+RUN apt-get update && apt-get install -y procps && apt-get clean
+RUN /bin/bash -l -c "rvm install ruby-2.5"
+RUN /bin/bash -l -c "rvm use --default ruby-2.5"
+RUN /bin/bash -l -c "echo 'gem: --no-document' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.5' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-document -v 1.9"
+
+#=================
+# Install cmake
+# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.
+
+RUN apt-get update && apt-get install -y cmake && apt-get clean
+
+#=================
+# Install ccache
+
+# Install ccache from source since ccache 3.x packaged with most linux distributions
+# does not support Redis backend for caching.
+RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
+ && tar -zxf ccache.tar.gz \
+ && cd ccache-4.5.1 \
+ && mkdir build && cd build \
+ && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
+ && make -j4 && make install \
+ && cd ../.. \
+ && rm -rf ccache-4.5.1 ccache.tar.gz
+
+
+RUN mkdir /var/local/jenkins
+
+
+# Seems required by XDS interop tests.
+RUN python3 -m pip install virtualenv==16.7.9
+
+# Define the default command.
+CMD ["bash"]
diff --git a/grpc/tools/dockerfile/test/sanity/Dockerfile b/grpc/tools/dockerfile/test/sanity/Dockerfile
index a0bbbb42..e129bf00 100644
--- a/grpc/tools/dockerfile/test/sanity/Dockerfile
+++ b/grpc/tools/dockerfile/test/sanity/Dockerfile
@@ -12,69 +12,72 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM debian:bullseye
-
-# Install Git and basic packages.
+FROM silkeh/clang:13
+
+#=================
+# Basic C core dependencies
+
+# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
build-essential \
+ autoconf \
+ libtool \
+ pkg-config \
+ && apt-get clean
+
+# GCC
+RUN apt-get update && apt-get install -y \
+ gcc \
+ g++ \
+ && apt-get clean
+
+# libc6
+RUN apt-get update && apt-get install -y \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ && apt-get clean
+
+# Tools
+RUN apt-get update && apt-get install -y \
bzip2 \
- ccache \
curl \
dnsutils \
- gcc \
- gcc-multilib \
git \
- golang \
- gyp \
lcov \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
make \
- perl \
strace \
- telnet \
+ time \
unzip \
wget \
- zip && apt-get clean
+ zip \
+ && apt-get clean
+
+#=================
+# C++ dependencies
+RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean
-#================
-# Build profiling
-RUN apt-get update && apt-get install -y time && apt-get clean
# Install Python 3.7 from source (and installed as a default python3)
# (Bullseye comes with Python 3.9 which isn't supported by pytype yet)
RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
- libnss3-dev libssl-dev libreadline-dev libffi-dev
+ libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev
RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \
- tar -xf Python-3.7.9.tar.xz && \
- cd Python-3.7.9 && \
- ./configure && \
- make -j 4 && \
- make install
+tar -xf Python-3.7.9.tar.xz && \
+cd Python-3.7.9 && \
+./configure && \
+make -j 4 && \
+make install
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
-# Install Python 2.7
-RUN apt-get update && apt-get install -y python2 python2-dev
-RUN ln -s /usr/bin/python2 /usr/bin/python
-RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
-
-# Google Cloud platform API libraries
-RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0
+# Google Cloud Platform API libraries
+# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
+RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
RUN mkdir /var/local/jenkins
-#=================
-# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean
-
-
#========================
# Sanity test dependencies
@@ -84,32 +87,40 @@ RUN apt-get update && apt-get install -y \
libtool \
curl \
shellcheck
-RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml
+
+# otherwise clang-tidy will report missing <gtest/gtest.h> header
+RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean
+
RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six
# Upgrade Python's YAML library
-RUN python2 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user
-# Install clang, clang-format, and clang-tidy
-RUN apt-get update && apt-get install -y clang clang-format-11 clang-tidy-11 jq
-ENV CLANG_FORMAT=clang-format-11
-ENV CLANG_TIDY=clang-tidy-11
-
+# Install prerequisites for the clang-tidy script
+RUN apt-get update && apt-get install -y jq git
#========================
# Bazel installation
# Must be in sync with tools/bazel
-ENV BAZEL_VERSION 3.7.1
+ENV BAZEL_VERSION 4.2.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1
-RUN apt-get update && apt-get install -y wget && apt-get clean
-RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" && \
- bash ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
- rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
+# Download the correct bazel version and make sure it's on path.
+RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \
+ && curl -sSL --fail -o /usr/local/bin/bazel "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-$BAZEL_ARCH_SUFFIX" \
+ && chmod a+x /usr/local/bin/bazel
+
+# Normally we would run "bazel --version" here to make sure bazel
+# was correctly installed, but we can't do that because
+# of # https://github.com/bazelbuild/bazel/issues/11379.
+# We want to keep the arm64 version of the image buildable
+# on x64 with use of qemu-user-static & binfmt emulation,
+# but the self-extraction is broken for bazel currently.
+# The binary will work correctly when run on real arm64
+# hardware, when qemu-user-static isn't getting into the way.
# Install buildifier v0.29.0
RUN wget https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier
diff --git a/grpc/tools/doxygen/Doxyfile.c++ b/grpc/tools/doxygen/Doxyfile.c++
index 2ce385e3..b2e4ea6f 100644
--- a/grpc/tools/doxygen/Doxyfile.c++
+++ b/grpc/tools/doxygen/Doxyfile.c++
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.38.0
+PROJECT_NUMBER = 1.46.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
@@ -881,10 +882,12 @@ include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \
include/grpc/census.h \
include/grpc/compression.h \
-include/grpc/event_engine/channel_args.h \
+include/grpc/event_engine/endpoint_config.h \
include/grpc/event_engine/event_engine.h \
+include/grpc/event_engine/internal/memory_allocator_impl.h \
+include/grpc/event_engine/memory_allocator.h \
+include/grpc/event_engine/memory_request.h \
include/grpc/event_engine/port.h \
-include/grpc/event_engine/slice_allocator.h \
include/grpc/fork.h \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
@@ -941,6 +944,7 @@ include/grpcpp/channel.h \
include/grpcpp/client_context.h \
include/grpcpp/completion_queue.h \
include/grpcpp/create_channel.h \
+include/grpcpp/create_channel_binder.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
@@ -1013,9 +1017,13 @@ include/grpcpp/impl/service_type.h \
include/grpcpp/resource_quota.h \
include/grpcpp/security/auth_context.h \
include/grpcpp/security/auth_metadata_processor.h \
+include/grpcpp/security/authorization_policy_provider.h \
+include/grpcpp/security/binder_credentials.h \
+include/grpcpp/security/binder_security_policy.h \
include/grpcpp/security/credentials.h \
include/grpcpp/security/server_credentials.h \
include/grpcpp/security/tls_certificate_provider.h \
+include/grpcpp/security/tls_certificate_verifier.h \
include/grpcpp/security/tls_credentials_options.h \
include/grpcpp/server.h \
include/grpcpp/server_builder.h \
diff --git a/grpc/tools/doxygen/Doxyfile.c++.internal b/grpc/tools/doxygen/Doxyfile.c++.internal
index 0e0fdbd9..3f93f981 100644
--- a/grpc/tools/doxygen/Doxyfile.c++.internal
+++ b/grpc/tools/doxygen/Doxyfile.c++.internal
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.38.0
+PROJECT_NUMBER = 1.46.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
@@ -881,10 +882,12 @@ include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \
include/grpc/census.h \
include/grpc/compression.h \
-include/grpc/event_engine/channel_args.h \
+include/grpc/event_engine/endpoint_config.h \
include/grpc/event_engine/event_engine.h \
+include/grpc/event_engine/internal/memory_allocator_impl.h \
+include/grpc/event_engine/memory_allocator.h \
+include/grpc/event_engine/memory_request.h \
include/grpc/event_engine/port.h \
-include/grpc/event_engine/slice_allocator.h \
include/grpc/fork.h \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
@@ -941,6 +944,7 @@ include/grpcpp/channel.h \
include/grpcpp/client_context.h \
include/grpcpp/completion_queue.h \
include/grpcpp/create_channel.h \
+include/grpcpp/create_channel_binder.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
@@ -1013,9 +1017,13 @@ include/grpcpp/impl/service_type.h \
include/grpcpp/resource_quota.h \
include/grpcpp/security/auth_context.h \
include/grpcpp/security/auth_metadata_processor.h \
+include/grpcpp/security/authorization_policy_provider.h \
+include/grpcpp/security/binder_credentials.h \
+include/grpcpp/security/binder_security_policy.h \
include/grpcpp/security/credentials.h \
include/grpcpp/security/server_credentials.h \
include/grpcpp/security/tls_certificate_provider.h \
+include/grpcpp/security/tls_certificate_verifier.h \
include/grpcpp/security/tls_credentials_options.h \
include/grpcpp/server.h \
include/grpcpp/server_builder.h \
@@ -1045,6 +1053,10 @@ include/grpcpp/support/time.h \
include/grpcpp/support/validate_service_config.h \
include/grpcpp/xds_server_builder.h \
src/core/ext/filters/census/grpc_context.cc \
+src/core/ext/filters/channel_idle/channel_idle_filter.cc \
+src/core/ext/filters/channel_idle/channel_idle_filter.h \
+src/core/ext/filters/channel_idle/idle_filter_state.cc \
+src/core/ext/filters/channel_idle/idle_filter_state.h \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backend_metric.h \
src/core/ext/filters/client_channel/backup_poller.cc \
@@ -1082,8 +1094,6 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h \
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.h \
-src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h \
-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/grpclb_client_stats.h \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
@@ -1092,6 +1102,7 @@ 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/ring_hash/ring_hash.cc \
src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h \
+src/core/ext/filters/client_channel/lb_policy/rls/rls.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \
src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc \
@@ -1109,16 +1120,15 @@ src/core/ext/filters/client_channel/local_subchannel_pool.h \
src/core/ext/filters/client_channel/proxy_mapper.h \
src/core/ext/filters/client_channel/proxy_mapper_registry.cc \
src/core/ext/filters/client_channel/proxy_mapper_registry.h \
-src/core/ext/filters/client_channel/resolver.cc \
-src/core/ext/filters/client_channel/resolver.h \
+src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h \
-src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc \
+src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h \
-src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc \
+src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
@@ -1127,12 +1137,11 @@ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
+src/core/ext/filters/client_channel/resolver/polling_resolver.cc \
+src/core/ext/filters/client_channel/resolver/polling_resolver.h \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h \
-src/core/ext/filters/client_channel/resolver_factory.h \
-src/core/ext/filters/client_channel/resolver_registry.cc \
-src/core/ext/filters/client_channel/resolver_registry.h \
src/core/ext/filters/client_channel/resolver_result_parsing.cc \
src/core/ext/filters/client_channel/resolver_result_parsing.h \
src/core/ext/filters/client_channel/retry_filter.cc \
@@ -1141,20 +1150,14 @@ src/core/ext/filters/client_channel/retry_service_config.cc \
src/core/ext/filters/client_channel/retry_service_config.h \
src/core/ext/filters/client_channel/retry_throttle.cc \
src/core/ext/filters/client_channel/retry_throttle.h \
-src/core/ext/filters/client_channel/server_address.cc \
-src/core/ext/filters/client_channel/server_address.h \
-src/core/ext/filters/client_channel/service_config.cc \
-src/core/ext/filters/client_channel/service_config.h \
-src/core/ext/filters/client_channel/service_config_call_data.h \
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_parser.h \
src/core/ext/filters/client_channel/subchannel.cc \
src/core/ext/filters/client_channel/subchannel.h \
src/core/ext/filters/client_channel/subchannel_interface.h \
src/core/ext/filters/client_channel/subchannel_pool_interface.cc \
src/core/ext/filters/client_channel/subchannel_pool_interface.h \
-src/core/ext/filters/client_idle/client_idle_filter.cc \
+src/core/ext/filters/client_channel/subchannel_stream_client.cc \
+src/core/ext/filters/client_channel/subchannel_stream_client.h \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/deadline/deadline_filter.h \
src/core/ext/filters/fault_injection/fault_injection_filter.cc \
@@ -1172,33 +1175,64 @@ src/core/ext/filters/http/message_compress/message_decompress_filter.cc \
src/core/ext/filters/http/message_compress/message_decompress_filter.h \
src/core/ext/filters/http/server/http_server_filter.cc \
src/core/ext/filters/http/server/http_server_filter.h \
-src/core/ext/filters/max_age/max_age_filter.cc \
-src/core/ext/filters/max_age/max_age_filter.h \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/ext/filters/message_size/message_size_filter.h \
-src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
-src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h \
-src/core/ext/filters/workarounds/workaround_utils.cc \
-src/core/ext/filters/workarounds/workaround_utils.h \
+src/core/ext/filters/rbac/rbac_filter.cc \
+src/core/ext/filters/rbac/rbac_filter.h \
+src/core/ext/filters/rbac/rbac_service_config_parser.cc \
+src/core/ext/filters/rbac/rbac_service_config_parser.h \
+src/core/ext/filters/server_config_selector/server_config_selector.cc \
+src/core/ext/filters/server_config_selector/server_config_selector.h \
+src/core/ext/filters/server_config_selector/server_config_selector_filter.cc \
+src/core/ext/filters/server_config_selector/server_config_selector_filter.h \
+src/core/ext/transport/binder/client/binder_connector.cc \
+src/core/ext/transport/binder/client/binder_connector.h \
+src/core/ext/transport/binder/client/channel_create.cc \
+src/core/ext/transport/binder/client/channel_create_impl.cc \
+src/core/ext/transport/binder/client/channel_create_impl.h \
+src/core/ext/transport/binder/client/connection_id_generator.cc \
+src/core/ext/transport/binder/client/connection_id_generator.h \
+src/core/ext/transport/binder/client/endpoint_binder_pool.cc \
+src/core/ext/transport/binder/client/endpoint_binder_pool.h \
+src/core/ext/transport/binder/client/jni_utils.cc \
+src/core/ext/transport/binder/client/jni_utils.h \
+src/core/ext/transport/binder/client/security_policy_setting.cc \
+src/core/ext/transport/binder/client/security_policy_setting.h \
+src/core/ext/transport/binder/security_policy/binder_security_policy.cc \
+src/core/ext/transport/binder/server/binder_server.cc \
+src/core/ext/transport/binder/server/binder_server.h \
+src/core/ext/transport/binder/server/binder_server_credentials.cc \
+src/core/ext/transport/binder/transport/binder_stream.h \
+src/core/ext/transport/binder/transport/binder_transport.cc \
+src/core/ext/transport/binder/transport/binder_transport.h \
+src/core/ext/transport/binder/utils/binder_auto_utils.h \
+src/core/ext/transport/binder/utils/ndk_binder.cc \
+src/core/ext/transport/binder/utils/ndk_binder.h \
+src/core/ext/transport/binder/utils/transport_stream_receiver.h \
+src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc \
+src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h \
+src/core/ext/transport/binder/wire_format/binder.h \
+src/core/ext/transport/binder/wire_format/binder_android.cc \
+src/core/ext/transport/binder/wire_format/binder_android.h \
+src/core/ext/transport/binder/wire_format/binder_constants.cc \
+src/core/ext/transport/binder/wire_format/binder_constants.h \
+src/core/ext/transport/binder/wire_format/transaction.cc \
+src/core/ext/transport/binder/wire_format/transaction.h \
+src/core/ext/transport/binder/wire_format/wire_reader.h \
+src/core/ext/transport/binder/wire_format/wire_reader_impl.cc \
+src/core/ext/transport/binder/wire_format/wire_reader_impl.h \
+src/core/ext/transport/binder/wire_format/wire_writer.cc \
+src/core/ext/transport/binder/wire_format/wire_writer.h \
src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/alpn/alpn.h \
-src/core/ext/transport/chttp2/client/authority.cc \
-src/core/ext/transport/chttp2/client/authority.h \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.h \
-src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
-src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
-src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
src/core/ext/transport/chttp2/server/chttp2_server.h \
-src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc \
-src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc \
-src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc \
src/core/ext/transport/chttp2/transport/bin_decoder.cc \
src/core/ext/transport/chttp2/transport/bin_decoder.h \
src/core/ext/transport/chttp2/transport/bin_encoder.cc \
src/core/ext/transport/chttp2/transport/bin_encoder.h \
-src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \
src/core/ext/transport/chttp2/transport/chttp2_transport.cc \
src/core/ext/transport/chttp2/transport/chttp2_transport.h \
src/core/ext/transport/chttp2/transport/context_list.cc \
@@ -1218,18 +1252,19 @@ src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_settings.h \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.h \
+src/core/ext/transport/chttp2/transport/hpack_constants.h \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.h \
+src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc \
+src/core/ext/transport/chttp2/transport/hpack_encoder_table.h \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.h \
-src/core/ext/transport/chttp2/transport/hpack_table.cc \
-src/core/ext/transport/chttp2/transport/hpack_table.h \
+src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \
+src/core/ext/transport/chttp2/transport/hpack_parser_table.h \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
src/core/ext/transport/chttp2/transport/http2_settings.h \
src/core/ext/transport/chttp2/transport/huffsyms.cc \
src/core/ext/transport/chttp2/transport/huffsyms.h \
-src/core/ext/transport/chttp2/transport/incoming_metadata.cc \
-src/core/ext/transport/chttp2/transport/incoming_metadata.h \
src/core/ext/transport/chttp2/transport/internal.h \
src/core/ext/transport/chttp2/transport/parsing.cc \
src/core/ext/transport/chttp2/transport/stream_lists.cc \
@@ -1241,8 +1276,26 @@ 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/transport/inproc/inproc_transport.h \
+src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h \
src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c \
src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h \
src/core/ext/upb-generated/envoy/annotations/resource.upb.c \
@@ -1259,6 +1312,8 @@ src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c \
src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h \
src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c \
src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h \
+src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c \
+src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c \
@@ -1271,6 +1326,8 @@ src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c \
@@ -1281,10 +1338,14 @@ src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c \
@@ -1297,8 +1358,12 @@ src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h \
src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h \
+src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c \
+src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h \
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h \
+src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c \
+src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h \
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c \
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h \
src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c \
@@ -1311,14 +1376,36 @@ src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h \
+src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c \
+src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h \
+src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c \
+src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
@@ -1331,24 +1418,22 @@ src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h \
-src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c \
-src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h \
+src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c \
+src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h \
src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c \
src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h \
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c \
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h \
-src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c \
-src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h \
-src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c \
-src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h \
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c \
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h \
-src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c \
-src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h \
-src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c \
-src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h \
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c \
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h \
+src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c \
+src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h \
+src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c \
+src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h \
+src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c \
+src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h \
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c \
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h \
src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c \
@@ -1369,14 +1454,22 @@ src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c \
src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h \
src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c \
src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h \
src/core/ext/upb-generated/envoy/type/v3/http.upb.c \
src/core/ext/upb-generated/envoy/type/v3/http.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h \
src/core/ext/upb-generated/envoy/type/v3/percent.upb.c \
src/core/ext/upb-generated/envoy/type/v3/percent.upb.h \
src/core/ext/upb-generated/envoy/type/v3/range.upb.c \
src/core/ext/upb-generated/envoy/type/v3/range.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h \
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c \
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.h \
src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c \
@@ -1385,8 +1478,12 @@ src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c \
src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/api/http.upb.h \
+src/core/ext/upb-generated/google/api/httpbody.upb.c \
+src/core/ext/upb-generated/google/api/httpbody.upb.h \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.h \
+src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
+src/core/ext/upb-generated/google/protobuf/descriptor.upb.h \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.h \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
@@ -1399,6 +1496,8 @@ src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.h \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.h \
+src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c \
+src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h \
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h \
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \
@@ -1409,6 +1508,10 @@ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h \
src/core/ext/upb-generated/udpa/annotations/migrate.upb.c \
src/core/ext/upb-generated/udpa/annotations/migrate.upb.h \
src/core/ext/upb-generated/udpa/annotations/security.upb.c \
@@ -1419,26 +1522,62 @@ src/core/ext/upb-generated/udpa/annotations/status.upb.c \
src/core/ext/upb-generated/udpa/annotations/status.upb.h \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.h \
-src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
-src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h \
-src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
-src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/validate/validate.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/security.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/security.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/status.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/status.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
src/core/ext/upb-generated/xds/core/v3/authority.upb.h \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h \
src/core/ext/upb-generated/xds/core/v3/context_params.upb.c \
src/core/ext/upb-generated/xds/core/v3/context_params.upb.h \
+src/core/ext/upb-generated/xds/core/v3/extension.upb.c \
+src/core/ext/upb-generated/xds/core/v3/extension.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h \
+src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c \
+src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h \
+src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c \
+src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c \
@@ -1455,6 +1594,8 @@ src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c \
@@ -1467,6 +1608,8 @@ src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs
src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c \
@@ -1477,10 +1620,14 @@ src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c \
@@ -1493,26 +1640,54 @@ src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
@@ -1525,24 +1700,22 @@ src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c \
@@ -1563,20 +1736,36 @@ src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h \
+src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \
+src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c \
@@ -1589,6 +1778,10 @@ src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h \
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c \
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h \
+src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c \
+src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h \
+src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c \
+src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c \
@@ -1599,22 +1792,40 @@ src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h \
-src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
-src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h \
src/core/ext/xds/certificate_provider_factory.h \
src/core/ext/xds/certificate_provider_registry.cc \
src/core/ext/xds/certificate_provider_registry.h \
@@ -1622,6 +1833,7 @@ src/core/ext/xds/certificate_provider_store.cc \
src/core/ext/xds/certificate_provider_store.h \
src/core/ext/xds/file_watcher_certificate_provider_factory.cc \
src/core/ext/xds/file_watcher_certificate_provider_factory.h \
+src/core/ext/xds/upb_utils.h \
src/core/ext/xds/xds_api.cc \
src/core/ext/xds/xds_api.h \
src/core/ext/xds/xds_bootstrap.cc \
@@ -1629,29 +1841,55 @@ src/core/ext/xds/xds_bootstrap.h \
src/core/ext/xds/xds_certificate_provider.cc \
src/core/ext/xds/xds_certificate_provider.h \
src/core/ext/xds/xds_channel_args.h \
+src/core/ext/xds/xds_channel_stack_modifier.cc \
+src/core/ext/xds/xds_channel_stack_modifier.h \
src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client.h \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_client_stats.h \
+src/core/ext/xds/xds_cluster.cc \
+src/core/ext/xds/xds_cluster.h \
+src/core/ext/xds/xds_cluster_specifier_plugin.cc \
+src/core/ext/xds/xds_cluster_specifier_plugin.h \
+src/core/ext/xds/xds_common_types.cc \
+src/core/ext/xds/xds_common_types.h \
+src/core/ext/xds/xds_endpoint.cc \
+src/core/ext/xds/xds_endpoint.h \
src/core/ext/xds/xds_http_fault_filter.cc \
src/core/ext/xds/xds_http_fault_filter.h \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_http_filters.h \
+src/core/ext/xds/xds_http_rbac_filter.cc \
+src/core/ext/xds/xds_http_rbac_filter.h \
+src/core/ext/xds/xds_listener.cc \
+src/core/ext/xds/xds_listener.h \
+src/core/ext/xds/xds_resource_type.cc \
+src/core/ext/xds/xds_resource_type.h \
+src/core/ext/xds/xds_resource_type_impl.h \
+src/core/ext/xds/xds_route_config.cc \
+src/core/ext/xds/xds_route_config.h \
+src/core/ext/xds/xds_routing.cc \
+src/core/ext/xds/xds_routing.h \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/parse_address.h \
src/core/lib/address_utils/sockaddr_utils.cc \
src/core/lib/address_utils/sockaddr_utils.h \
-src/core/lib/avl/avl.cc \
src/core/lib/avl/avl.h \
src/core/lib/backoff/backoff.cc \
src/core/lib/backoff/backoff.h \
+src/core/lib/channel/call_finalization.h \
+src/core/lib/channel/call_tracer.h \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_args.h \
+src/core/lib/channel/channel_args_preconditioning.cc \
+src/core/lib/channel/channel_args_preconditioning.h \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack.h \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_stack_builder.h \
+src/core/lib/channel/channel_stack_builder_impl.cc \
+src/core/lib/channel/channel_stack_builder_impl.h \
src/core/lib/channel/channel_trace.cc \
src/core/lib/channel/channel_trace.h \
src/core/lib/channel/channelz.cc \
@@ -1666,33 +1904,34 @@ src/core/lib/channel/handshaker.h \
src/core/lib/channel/handshaker_factory.h \
src/core/lib/channel/handshaker_registry.cc \
src/core/lib/channel/handshaker_registry.h \
+src/core/lib/channel/promise_based_filter.cc \
+src/core/lib/channel/promise_based_filter.h \
src/core/lib/channel/status_util.cc \
src/core/lib/channel/status_util.h \
-src/core/lib/compression/algorithm_metadata.h \
src/core/lib/compression/compression.cc \
-src/core/lib/compression/compression_args.cc \
-src/core/lib/compression/compression_args.h \
src/core/lib/compression/compression_internal.cc \
src/core/lib/compression/compression_internal.h \
src/core/lib/compression/message_compress.cc \
src/core/lib/compression/message_compress.h \
-src/core/lib/compression/stream_compression.cc \
-src/core/lib/compression/stream_compression.h \
-src/core/lib/compression/stream_compression_gzip.cc \
-src/core/lib/compression/stream_compression_gzip.h \
-src/core/lib/compression/stream_compression_identity.cc \
-src/core/lib/compression/stream_compression_identity.h \
+src/core/lib/config/core_configuration.cc \
+src/core/lib/config/core_configuration.h \
src/core/lib/debug/stats.cc \
src/core/lib/debug/stats.h \
src/core/lib/debug/stats_data.cc \
src/core/lib/debug/stats_data.h \
src/core/lib/debug/trace.cc \
src/core/lib/debug/trace.h \
-src/core/lib/event_engine/slice_allocator.cc \
+src/core/lib/event_engine/channel_args_endpoint_config.cc \
+src/core/lib/event_engine/channel_args_endpoint_config.h \
+src/core/lib/event_engine/default_event_engine_factory.cc \
+src/core/lib/event_engine/event_engine.cc \
+src/core/lib/event_engine/event_engine_factory.h \
+src/core/lib/event_engine/memory_allocator.cc \
+src/core/lib/event_engine/resolved_address.cc \
src/core/lib/event_engine/sockaddr.cc \
+src/core/lib/event_engine/sockaddr.h \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/alloc.h \
-src/core/lib/gpr/arena.h \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/cpu_iphone.cc \
src/core/lib/gpr/cpu_linux.cc \
@@ -1726,20 +1965,18 @@ src/core/lib/gpr/time_precise.cc \
src/core/lib/gpr/time_precise.h \
src/core/lib/gpr/time_windows.cc \
src/core/lib/gpr/tls.h \
-src/core/lib/gpr/tls_gcc.h \
-src/core/lib/gpr/tls_msvc.h \
-src/core/lib/gpr/tls_pthread.cc \
-src/core/lib/gpr/tls_pthread.h \
-src/core/lib/gpr/tls_stdcpp.h \
src/core/lib/gpr/tmpfile.h \
src/core/lib/gpr/tmpfile_msys.cc \
src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/useful.h \
src/core/lib/gpr/wrap_memcpy.cc \
-src/core/lib/gprpp/arena.cc \
-src/core/lib/gprpp/arena.h \
-src/core/lib/gprpp/atomic.h \
+src/core/lib/gprpp/atomic_utils.h \
+src/core/lib/gprpp/bitset.h \
+src/core/lib/gprpp/capture.h \
+src/core/lib/gprpp/chunked_vector.h \
+src/core/lib/gprpp/construct_destruct.h \
+src/core/lib/gprpp/cpp_impl_of.h \
src/core/lib/gprpp/debug_location.h \
src/core/lib/gprpp/dual_ref_counted.h \
src/core/lib/gprpp/examine_stack.cc \
@@ -1754,21 +1991,27 @@ src/core/lib/gprpp/global_config_generic.h \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/host_port.h \
src/core/lib/gprpp/manual_constructor.h \
+src/core/lib/gprpp/match.h \
src/core/lib/gprpp/memory.h \
src/core/lib/gprpp/mpscq.cc \
src/core/lib/gprpp/mpscq.h \
src/core/lib/gprpp/orphanable.h \
+src/core/lib/gprpp/overload.h \
src/core/lib/gprpp/ref_counted.h \
src/core/lib/gprpp/ref_counted_ptr.h \
+src/core/lib/gprpp/single_set_ptr.h \
src/core/lib/gprpp/stat.h \
src/core/lib/gprpp/stat_posix.cc \
src/core/lib/gprpp/stat_windows.cc \
src/core/lib/gprpp/status_helper.cc \
src/core/lib/gprpp/status_helper.h \
src/core/lib/gprpp/sync.h \
+src/core/lib/gprpp/table.h \
src/core/lib/gprpp/thd.h \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
+src/core/lib/gprpp/time.cc \
+src/core/lib/gprpp/time.h \
src/core/lib/gprpp/time_util.cc \
src/core/lib/gprpp/time_util.h \
src/core/lib/http/format_request.cc \
@@ -1776,6 +2019,7 @@ src/core/lib/http/format_request.h \
src/core/lib/http/httpcli.cc \
src/core/lib/http/httpcli.h \
src/core/lib/http/httpcli_security_connector.cc \
+src/core/lib/http/httpcli_ssl_credentials.h \
src/core/lib/http/parser.cc \
src/core/lib/http/parser.h \
src/core/lib/iomgr/block_annotate.h \
@@ -1795,8 +2039,8 @@ src/core/lib/iomgr/endpoint.h \
src/core/lib/iomgr/endpoint_cfstream.cc \
src/core/lib/iomgr/endpoint_cfstream.h \
src/core/lib/iomgr/endpoint_pair.h \
+src/core/lib/iomgr/endpoint_pair_event_engine.cc \
src/core/lib/iomgr/endpoint_pair_posix.cc \
-src/core/lib/iomgr/endpoint_pair_uv.cc \
src/core/lib/iomgr/endpoint_pair_windows.cc \
src/core/lib/iomgr/error.cc \
src/core/lib/iomgr/error.h \
@@ -1807,13 +2051,25 @@ src/core/lib/iomgr/ev_apple.cc \
src/core/lib/iomgr/ev_apple.h \
src/core/lib/iomgr/ev_epoll1_linux.cc \
src/core/lib/iomgr/ev_epoll1_linux.h \
-src/core/lib/iomgr/ev_epollex_linux.cc \
-src/core/lib/iomgr/ev_epollex_linux.h \
src/core/lib/iomgr/ev_poll_posix.cc \
src/core/lib/iomgr/ev_poll_posix.h \
src/core/lib/iomgr/ev_posix.cc \
src/core/lib/iomgr/ev_posix.h \
src/core/lib/iomgr/ev_windows.cc \
+src/core/lib/iomgr/event_engine/closure.cc \
+src/core/lib/iomgr/event_engine/closure.h \
+src/core/lib/iomgr/event_engine/endpoint.cc \
+src/core/lib/iomgr/event_engine/endpoint.h \
+src/core/lib/iomgr/event_engine/iomgr.cc \
+src/core/lib/iomgr/event_engine/pollset.cc \
+src/core/lib/iomgr/event_engine/pollset.h \
+src/core/lib/iomgr/event_engine/promise.h \
+src/core/lib/iomgr/event_engine/resolved_address_internal.cc \
+src/core/lib/iomgr/event_engine/resolved_address_internal.h \
+src/core/lib/iomgr/event_engine/resolver.cc \
+src/core/lib/iomgr/event_engine/resolver.h \
+src/core/lib/iomgr/event_engine/tcp.cc \
+src/core/lib/iomgr/event_engine/timer.cc \
src/core/lib/iomgr/exec_ctx.cc \
src/core/lib/iomgr/exec_ctx.h \
src/core/lib/iomgr/executor.cc \
@@ -1837,16 +2093,11 @@ src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iocp_windows.h \
src/core/lib/iomgr/iomgr.cc \
src/core/lib/iomgr/iomgr.h \
-src/core/lib/iomgr/iomgr_custom.cc \
-src/core/lib/iomgr/iomgr_custom.h \
src/core/lib/iomgr/iomgr_internal.cc \
src/core/lib/iomgr/iomgr_internal.h \
src/core/lib/iomgr/iomgr_posix.cc \
src/core/lib/iomgr/iomgr_posix_cfstream.cc \
-src/core/lib/iomgr/iomgr_uv.cc \
src/core/lib/iomgr/iomgr_windows.cc \
-src/core/lib/iomgr/is_epollexclusive_available.cc \
-src/core/lib/iomgr/is_epollexclusive_available.h \
src/core/lib/iomgr/load_file.cc \
src/core/lib/iomgr/load_file.h \
src/core/lib/iomgr/lockfree_event.cc \
@@ -1856,31 +2107,25 @@ src/core/lib/iomgr/polling_entity.cc \
src/core/lib/iomgr/polling_entity.h \
src/core/lib/iomgr/pollset.cc \
src/core/lib/iomgr/pollset.h \
-src/core/lib/iomgr/pollset_custom.cc \
-src/core/lib/iomgr/pollset_custom.h \
src/core/lib/iomgr/pollset_set.cc \
src/core/lib/iomgr/pollset_set.h \
-src/core/lib/iomgr/pollset_set_custom.cc \
-src/core/lib/iomgr/pollset_set_custom.h \
src/core/lib/iomgr/pollset_set_windows.cc \
src/core/lib/iomgr/pollset_set_windows.h \
-src/core/lib/iomgr/pollset_uv.cc \
-src/core/lib/iomgr/pollset_uv.h \
src/core/lib/iomgr/pollset_windows.cc \
src/core/lib/iomgr/pollset_windows.h \
src/core/lib/iomgr/port.h \
src/core/lib/iomgr/python_util.h \
src/core/lib/iomgr/resolve_address.cc \
src/core/lib/iomgr/resolve_address.h \
-src/core/lib/iomgr/resolve_address_custom.cc \
-src/core/lib/iomgr/resolve_address_custom.h \
+src/core/lib/iomgr/resolve_address_impl.h \
src/core/lib/iomgr/resolve_address_posix.cc \
+src/core/lib/iomgr/resolve_address_posix.h \
src/core/lib/iomgr/resolve_address_windows.cc \
-src/core/lib/iomgr/resource_quota.cc \
-src/core/lib/iomgr/resource_quota.h \
+src/core/lib/iomgr/resolve_address_windows.h \
+src/core/lib/iomgr/resolved_address.h \
src/core/lib/iomgr/sockaddr.h \
-src/core/lib/iomgr/sockaddr_custom.h \
src/core/lib/iomgr/sockaddr_posix.h \
+src/core/lib/iomgr/sockaddr_utils_posix.cc \
src/core/lib/iomgr/sockaddr_windows.h \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_factory_posix.h \
@@ -1891,49 +2136,37 @@ src/core/lib/iomgr/socket_utils_common_posix.cc \
src/core/lib/iomgr/socket_utils_linux.cc \
src/core/lib/iomgr/socket_utils_posix.cc \
src/core/lib/iomgr/socket_utils_posix.h \
-src/core/lib/iomgr/socket_utils_uv.cc \
src/core/lib/iomgr/socket_utils_windows.cc \
src/core/lib/iomgr/socket_windows.cc \
src/core/lib/iomgr/socket_windows.h \
-src/core/lib/iomgr/sys_epoll_wrapper.h \
src/core/lib/iomgr/tcp_client.cc \
src/core/lib/iomgr/tcp_client.h \
src/core/lib/iomgr/tcp_client_cfstream.cc \
-src/core/lib/iomgr/tcp_client_custom.cc \
src/core/lib/iomgr/tcp_client_posix.cc \
src/core/lib/iomgr/tcp_client_posix.h \
src/core/lib/iomgr/tcp_client_windows.cc \
-src/core/lib/iomgr/tcp_custom.cc \
-src/core/lib/iomgr/tcp_custom.h \
src/core/lib/iomgr/tcp_posix.cc \
src/core/lib/iomgr/tcp_posix.h \
src/core/lib/iomgr/tcp_server.cc \
src/core/lib/iomgr/tcp_server.h \
-src/core/lib/iomgr/tcp_server_custom.cc \
src/core/lib/iomgr/tcp_server_posix.cc \
src/core/lib/iomgr/tcp_server_utils_posix.h \
src/core/lib/iomgr/tcp_server_utils_posix_common.cc \
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc \
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc \
src/core/lib/iomgr/tcp_server_windows.cc \
-src/core/lib/iomgr/tcp_uv.cc \
src/core/lib/iomgr/tcp_windows.cc \
src/core/lib/iomgr/tcp_windows.h \
src/core/lib/iomgr/time_averaged_stats.cc \
src/core/lib/iomgr/time_averaged_stats.h \
src/core/lib/iomgr/timer.cc \
src/core/lib/iomgr/timer.h \
-src/core/lib/iomgr/timer_custom.cc \
-src/core/lib/iomgr/timer_custom.h \
src/core/lib/iomgr/timer_generic.cc \
src/core/lib/iomgr/timer_generic.h \
src/core/lib/iomgr/timer_heap.cc \
src/core/lib/iomgr/timer_heap.h \
src/core/lib/iomgr/timer_manager.cc \
src/core/lib/iomgr/timer_manager.h \
-src/core/lib/iomgr/timer_uv.cc \
-src/core/lib/iomgr/udp_server.cc \
-src/core/lib/iomgr/udp_server.h \
src/core/lib/iomgr/unix_sockets_posix.cc \
src/core/lib/iomgr/unix_sockets_posix.h \
src/core/lib/iomgr/unix_sockets_posix_noop.cc \
@@ -1955,6 +2188,60 @@ src/core/lib/matchers/matchers.h \
src/core/lib/profiling/basic_timers.cc \
src/core/lib/profiling/stap_timers.cc \
src/core/lib/profiling/timers.h \
+src/core/lib/promise/activity.cc \
+src/core/lib/promise/activity.h \
+src/core/lib/promise/arena_promise.h \
+src/core/lib/promise/call_push_pull.h \
+src/core/lib/promise/context.h \
+src/core/lib/promise/detail/basic_seq.h \
+src/core/lib/promise/detail/promise_factory.h \
+src/core/lib/promise/detail/promise_like.h \
+src/core/lib/promise/detail/status.h \
+src/core/lib/promise/detail/switch.h \
+src/core/lib/promise/exec_ctx_wakeup_scheduler.h \
+src/core/lib/promise/intra_activity_waiter.h \
+src/core/lib/promise/latch.h \
+src/core/lib/promise/loop.h \
+src/core/lib/promise/map.h \
+src/core/lib/promise/poll.h \
+src/core/lib/promise/promise.h \
+src/core/lib/promise/race.h \
+src/core/lib/promise/seq.h \
+src/core/lib/promise/sleep.cc \
+src/core/lib/promise/sleep.h \
+src/core/lib/promise/try_seq.h \
+src/core/lib/resolver/resolver.cc \
+src/core/lib/resolver/resolver.h \
+src/core/lib/resolver/resolver_factory.h \
+src/core/lib/resolver/resolver_registry.cc \
+src/core/lib/resolver/resolver_registry.h \
+src/core/lib/resolver/server_address.cc \
+src/core/lib/resolver/server_address.h \
+src/core/lib/resource_quota/api.cc \
+src/core/lib/resource_quota/api.h \
+src/core/lib/resource_quota/arena.cc \
+src/core/lib/resource_quota/arena.h \
+src/core/lib/resource_quota/memory_quota.cc \
+src/core/lib/resource_quota/memory_quota.h \
+src/core/lib/resource_quota/resource_quota.cc \
+src/core/lib/resource_quota/resource_quota.h \
+src/core/lib/resource_quota/thread_quota.cc \
+src/core/lib/resource_quota/thread_quota.h \
+src/core/lib/resource_quota/trace.cc \
+src/core/lib/resource_quota/trace.h \
+src/core/lib/security/authorization/authorization_engine.h \
+src/core/lib/security/authorization/authorization_policy_provider.h \
+src/core/lib/security/authorization/authorization_policy_provider_vtable.cc \
+src/core/lib/security/authorization/evaluate_args.cc \
+src/core/lib/security/authorization/evaluate_args.h \
+src/core/lib/security/authorization/grpc_authorization_engine.cc \
+src/core/lib/security/authorization/grpc_authorization_engine.h \
+src/core/lib/security/authorization/grpc_server_authz_filter.cc \
+src/core/lib/security/authorization/grpc_server_authz_filter.h \
+src/core/lib/security/authorization/matchers.cc \
+src/core/lib/security/authorization/matchers.h \
+src/core/lib/security/authorization/rbac_policy.cc \
+src/core/lib/security/authorization/rbac_policy.h \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/context/security_context.h \
src/core/lib/security/credentials/alts/alts_credentials.cc \
@@ -1968,11 +2255,14 @@ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h \
src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \
+src/core/lib/security/credentials/call_creds_util.cc \
+src/core/lib/security/credentials/call_creds_util.h \
+src/core/lib/security/credentials/channel_creds_registry.h \
+src/core/lib/security/credentials/channel_creds_registry_init.cc \
src/core/lib/security/credentials/composite/composite_credentials.cc \
src/core/lib/security/credentials/composite/composite_credentials.h \
src/core/lib/security/credentials/credentials.cc \
src/core/lib/security/credentials/credentials.h \
-src/core/lib/security/credentials/credentials_metadata.cc \
src/core/lib/security/credentials/external/aws_external_account_credentials.cc \
src/core/lib/security/credentials/external/aws_external_account_credentials.h \
src/core/lib/security/credentials/external/aws_request_signer.cc \
@@ -1991,6 +2281,7 @@ src/core/lib/security/credentials/google_default/google_default_credentials.h \
src/core/lib/security/credentials/iam/iam_credentials.cc \
src/core/lib/security/credentials/iam/iam_credentials.h \
src/core/lib/security/credentials/insecure/insecure_credentials.cc \
+src/core/lib/security/credentials/insecure/insecure_credentials.h \
src/core/lib/security/credentials/jwt/json_token.cc \
src/core/lib/security/credentials/jwt/json_token.h \
src/core/lib/security/credentials/jwt/jwt_credentials.cc \
@@ -2009,6 +2300,8 @@ src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc \
src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h \
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc \
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h \
+src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc \
+src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h \
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc \
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h \
src/core/lib/security/credentials/tls/tls_credentials.cc \
@@ -2050,19 +2343,32 @@ src/core/lib/security/transport/tsi_error.cc \
src/core/lib/security/transport/tsi_error.h \
src/core/lib/security/util/json_util.cc \
src/core/lib/security/util/json_util.h \
+src/core/lib/service_config/service_config.h \
+src/core/lib/service_config/service_config_call_data.h \
+src/core/lib/service_config/service_config_impl.cc \
+src/core/lib/service_config/service_config_impl.h \
+src/core/lib/service_config/service_config_parser.cc \
+src/core/lib/service_config/service_config_parser.h \
src/core/lib/slice/b64.cc \
src/core/lib/slice/b64.h \
src/core/lib/slice/percent_encoding.cc \
src/core/lib/slice/percent_encoding.h \
src/core/lib/slice/slice.cc \
+src/core/lib/slice/slice.h \
+src/core/lib/slice/slice_api.cc \
src/core/lib/slice/slice_buffer.cc \
-src/core/lib/slice/slice_intern.cc \
src/core/lib/slice/slice_internal.h \
+src/core/lib/slice/slice_refcount.cc \
+src/core/lib/slice/slice_refcount.h \
+src/core/lib/slice/slice_refcount_base.h \
+src/core/lib/slice/slice_split.cc \
+src/core/lib/slice/slice_split.h \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/slice/slice_string_helpers.h \
-src/core/lib/slice/slice_utils.h \
src/core/lib/surface/api_trace.cc \
src/core/lib/surface/api_trace.h \
+src/core/lib/surface/builtins.cc \
+src/core/lib/surface/builtins.h \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
@@ -2085,7 +2391,6 @@ src/core/lib/surface/event_string.cc \
src/core/lib/surface/event_string.h \
src/core/lib/surface/init.cc \
src/core/lib/surface/init.h \
-src/core/lib/surface/init_secure.cc \
src/core/lib/surface/lame_client.cc \
src/core/lib/surface/lame_client.h \
src/core/lib/surface/metadata_array.cc \
@@ -2094,8 +2399,6 @@ src/core/lib/surface/server.h \
src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/validate_metadata.h \
src/core/lib/surface/version.cc \
-src/core/lib/transport/authority_override.cc \
-src/core/lib/transport/authority_override.h \
src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/bdp_estimator.h \
src/core/lib/transport/byte_stream.cc \
@@ -2105,18 +2408,13 @@ src/core/lib/transport/connectivity_state.h \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/error_utils.h \
src/core/lib/transport/http2_errors.h \
-src/core/lib/transport/metadata.cc \
-src/core/lib/transport/metadata.h \
-src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/metadata_batch.h \
+src/core/lib/transport/parsed_metadata.cc \
+src/core/lib/transport/parsed_metadata.h \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/pid_controller.h \
-src/core/lib/transport/static_metadata.cc \
-src/core/lib/transport/static_metadata.h \
src/core/lib/transport/status_conversion.cc \
src/core/lib/transport/status_conversion.h \
-src/core/lib/transport/status_metadata.cc \
-src/core/lib/transport/status_metadata.h \
src/core/lib/transport/timeout_encoding.cc \
src/core/lib/transport/timeout_encoding.h \
src/core/lib/transport/transport.cc \
@@ -2126,6 +2424,7 @@ src/core/lib/transport/transport_op_string.cc \
src/core/lib/uri/uri_parser.cc \
src/core/lib/uri/uri_parser.h \
src/core/plugin_registry/grpc_plugin_registry.cc \
+src/core/plugin_registry/grpc_plugin_registry_extra.cc \
src/core/tsi/alts/crypt/aes_gcm.cc \
src/core/tsi/alts/crypt/gsec.cc \
src/core/tsi/alts/crypt/gsec.h \
@@ -2167,6 +2466,8 @@ src/core/tsi/fake_transport_security.cc \
src/core/tsi/fake_transport_security.h \
src/core/tsi/local_transport_security.cc \
src/core/tsi/local_transport_security.h \
+src/core/tsi/ssl/key_logging/ssl_key_logging.cc \
+src/core/tsi/ssl/key_logging/ssl_key_logging.h \
src/core/tsi/ssl/session_cache/ssl_session.h \
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \
src/core/tsi/ssl/session_cache/ssl_session_cache.cc \
@@ -2209,9 +2510,8 @@ src/cpp/common/secure_auth_context.h \
src/cpp/common/secure_channel_arguments.cc \
src/cpp/common/secure_create_auth_context.cc \
src/cpp/common/tls_certificate_provider.cc \
+src/cpp/common/tls_certificate_verifier.cc \
src/cpp/common/tls_credentials_options.cc \
-src/cpp/common/tls_credentials_options_util.cc \
-src/cpp/common/tls_credentials_options_util.h \
src/cpp/common/validate_service_config.cc \
src/cpp/common/version_cc.cc \
src/cpp/server/async_generic_service.cc \
diff --git a/grpc/tools/doxygen/Doxyfile.core b/grpc/tools/doxygen/Doxyfile.core
index 1db9688b..5457a2e0 100644
--- a/grpc/tools/doxygen/Doxyfile.core
+++ b/grpc/tools/doxygen/Doxyfile.core
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 16.0.0
+PROJECT_NUMBER = 24.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
@@ -811,10 +812,12 @@ include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \
include/grpc/census.h \
include/grpc/compression.h \
-include/grpc/event_engine/channel_args.h \
+include/grpc/event_engine/endpoint_config.h \
include/grpc/event_engine/event_engine.h \
+include/grpc/event_engine/internal/memory_allocator_impl.h \
+include/grpc/event_engine/memory_allocator.h \
+include/grpc/event_engine/memory_request.h \
include/grpc/event_engine/port.h \
-include/grpc/event_engine/slice_allocator.h \
include/grpc/fork.h \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
diff --git a/grpc/tools/doxygen/Doxyfile.core.internal b/grpc/tools/doxygen/Doxyfile.core.internal
index ebf1a4d9..e9af1106 100644
--- a/grpc/tools/doxygen/Doxyfile.core.internal
+++ b/grpc/tools/doxygen/Doxyfile.core.internal
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 16.0.0
+PROJECT_NUMBER = 24.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
@@ -811,10 +812,12 @@ include/grpc/byte_buffer.h \
include/grpc/byte_buffer_reader.h \
include/grpc/census.h \
include/grpc/compression.h \
-include/grpc/event_engine/channel_args.h \
+include/grpc/event_engine/endpoint_config.h \
include/grpc/event_engine/event_engine.h \
+include/grpc/event_engine/internal/memory_allocator_impl.h \
+include/grpc/event_engine/memory_allocator.h \
+include/grpc/event_engine/memory_request.h \
include/grpc/event_engine/port.h \
-include/grpc/event_engine/slice_allocator.h \
include/grpc/fork.h \
include/grpc/grpc.h \
include/grpc/grpc_posix.h \
@@ -869,6 +872,10 @@ include/grpc/support/workaround_list.h \
src/core/README.md \
src/core/ext/README.md \
src/core/ext/filters/census/grpc_context.cc \
+src/core/ext/filters/channel_idle/channel_idle_filter.cc \
+src/core/ext/filters/channel_idle/channel_idle_filter.h \
+src/core/ext/filters/channel_idle/idle_filter_state.cc \
+src/core/ext/filters/channel_idle/idle_filter_state.h \
src/core/ext/filters/client_channel/README.md \
src/core/ext/filters/client_channel/backend_metric.cc \
src/core/ext/filters/client_channel/backend_metric.h \
@@ -907,8 +914,6 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h \
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.h \
-src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h \
-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/grpclb_client_stats.h \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \
@@ -917,6 +922,7 @@ 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/ring_hash/ring_hash.cc \
src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h \
+src/core/ext/filters/client_channel/lb_policy/rls/rls.cc \
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \
src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \
src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc \
@@ -934,17 +940,17 @@ src/core/ext/filters/client_channel/local_subchannel_pool.h \
src/core/ext/filters/client_channel/proxy_mapper.h \
src/core/ext/filters/client_channel/proxy_mapper_registry.cc \
src/core/ext/filters/client_channel/proxy_mapper_registry.h \
-src/core/ext/filters/client_channel/resolver.cc \
-src/core/ext/filters/client_channel/resolver.h \
src/core/ext/filters/client_channel/resolver/README.md \
+src/core/ext/filters/client_channel/resolver/binder/README.md \
+src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h \
-src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc \
+src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h \
-src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc \
+src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
@@ -954,13 +960,12 @@ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
+src/core/ext/filters/client_channel/resolver/polling_resolver.cc \
+src/core/ext/filters/client_channel/resolver/polling_resolver.h \
src/core/ext/filters/client_channel/resolver/sockaddr/README.md \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h \
-src/core/ext/filters/client_channel/resolver_factory.h \
-src/core/ext/filters/client_channel/resolver_registry.cc \
-src/core/ext/filters/client_channel/resolver_registry.h \
src/core/ext/filters/client_channel/resolver_result_parsing.cc \
src/core/ext/filters/client_channel/resolver_result_parsing.h \
src/core/ext/filters/client_channel/retry_filter.cc \
@@ -969,20 +974,14 @@ src/core/ext/filters/client_channel/retry_service_config.cc \
src/core/ext/filters/client_channel/retry_service_config.h \
src/core/ext/filters/client_channel/retry_throttle.cc \
src/core/ext/filters/client_channel/retry_throttle.h \
-src/core/ext/filters/client_channel/server_address.cc \
-src/core/ext/filters/client_channel/server_address.h \
-src/core/ext/filters/client_channel/service_config.cc \
-src/core/ext/filters/client_channel/service_config.h \
-src/core/ext/filters/client_channel/service_config_call_data.h \
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_parser.h \
src/core/ext/filters/client_channel/subchannel.cc \
src/core/ext/filters/client_channel/subchannel.h \
src/core/ext/filters/client_channel/subchannel_interface.h \
src/core/ext/filters/client_channel/subchannel_pool_interface.cc \
src/core/ext/filters/client_channel/subchannel_pool_interface.h \
-src/core/ext/filters/client_idle/client_idle_filter.cc \
+src/core/ext/filters/client_channel/subchannel_stream_client.cc \
+src/core/ext/filters/client_channel/subchannel_stream_client.h \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/deadline/deadline_filter.h \
src/core/ext/filters/fault_injection/fault_injection_filter.cc \
@@ -1000,40 +999,30 @@ src/core/ext/filters/http/message_compress/message_decompress_filter.cc \
src/core/ext/filters/http/message_compress/message_decompress_filter.h \
src/core/ext/filters/http/server/http_server_filter.cc \
src/core/ext/filters/http/server/http_server_filter.h \
-src/core/ext/filters/max_age/max_age_filter.cc \
-src/core/ext/filters/max_age/max_age_filter.h \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/ext/filters/message_size/message_size_filter.h \
-src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
-src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h \
-src/core/ext/filters/workarounds/workaround_utils.cc \
-src/core/ext/filters/workarounds/workaround_utils.h \
+src/core/ext/filters/rbac/rbac_filter.cc \
+src/core/ext/filters/rbac/rbac_filter.h \
+src/core/ext/filters/rbac/rbac_service_config_parser.cc \
+src/core/ext/filters/rbac/rbac_service_config_parser.h \
+src/core/ext/filters/server_config_selector/server_config_selector.cc \
+src/core/ext/filters/server_config_selector/server_config_selector.h \
+src/core/ext/filters/server_config_selector/server_config_selector_filter.cc \
+src/core/ext/filters/server_config_selector/server_config_selector_filter.h \
src/core/ext/transport/README.md \
+src/core/ext/transport/binder/README.md \
src/core/ext/transport/chttp2/README.md \
src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/alpn/alpn.h \
-src/core/ext/transport/chttp2/client/authority.cc \
-src/core/ext/transport/chttp2/client/authority.h \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.h \
-src/core/ext/transport/chttp2/client/insecure/README.md \
-src/core/ext/transport/chttp2/client/insecure/channel_create.cc \
-src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \
-src/core/ext/transport/chttp2/client/secure/README.md \
-src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
src/core/ext/transport/chttp2/server/chttp2_server.h \
-src/core/ext/transport/chttp2/server/insecure/README.md \
-src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc \
-src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc \
-src/core/ext/transport/chttp2/server/secure/README.md \
-src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc \
src/core/ext/transport/chttp2/transport/README.md \
src/core/ext/transport/chttp2/transport/bin_decoder.cc \
src/core/ext/transport/chttp2/transport/bin_decoder.h \
src/core/ext/transport/chttp2/transport/bin_encoder.cc \
src/core/ext/transport/chttp2/transport/bin_encoder.h \
-src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \
src/core/ext/transport/chttp2/transport/chttp2_transport.cc \
src/core/ext/transport/chttp2/transport/chttp2_transport.h \
src/core/ext/transport/chttp2/transport/context_list.cc \
@@ -1053,18 +1042,19 @@ src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_settings.h \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.h \
+src/core/ext/transport/chttp2/transport/hpack_constants.h \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.h \
+src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc \
+src/core/ext/transport/chttp2/transport/hpack_encoder_table.h \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.h \
-src/core/ext/transport/chttp2/transport/hpack_table.cc \
-src/core/ext/transport/chttp2/transport/hpack_table.h \
+src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \
+src/core/ext/transport/chttp2/transport/hpack_parser_table.h \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
src/core/ext/transport/chttp2/transport/http2_settings.h \
src/core/ext/transport/chttp2/transport/huffsyms.cc \
src/core/ext/transport/chttp2/transport/huffsyms.h \
-src/core/ext/transport/chttp2/transport/incoming_metadata.cc \
-src/core/ext/transport/chttp2/transport/incoming_metadata.h \
src/core/ext/transport/chttp2/transport/internal.h \
src/core/ext/transport/chttp2/transport/parsing.cc \
src/core/ext/transport/chttp2/transport/stream_lists.cc \
@@ -1076,8 +1066,26 @@ 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/transport/inproc/inproc_transport.h \
+src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c \
src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h \
+src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c \
+src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h \
src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c \
src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h \
src/core/ext/upb-generated/envoy/annotations/resource.upb.c \
@@ -1094,6 +1102,8 @@ src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c \
src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h \
src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c \
src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h \
+src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c \
+src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c \
@@ -1106,6 +1116,8 @@ src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c \
@@ -1116,10 +1128,14 @@ src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h \
src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c \
src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h \
+src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c \
+src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h \
src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c \
@@ -1132,8 +1148,12 @@ src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h \
src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h \
+src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c \
+src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h \
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c \
src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h \
+src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c \
+src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h \
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c \
src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h \
src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c \
@@ -1146,14 +1166,36 @@ src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h \
+src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c \
+src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h \
+src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c \
+src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h \
+src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c \
+src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
@@ -1166,24 +1208,22 @@ src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h \
-src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c \
-src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h \
+src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c \
+src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h \
src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c \
src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h \
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c \
src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h \
-src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c \
-src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h \
-src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c \
-src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h \
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c \
src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h \
-src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c \
-src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h \
-src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c \
-src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h \
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c \
src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h \
+src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c \
+src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h \
+src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c \
+src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h \
+src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c \
+src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h \
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c \
src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h \
src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c \
@@ -1204,14 +1244,22 @@ src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c \
src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h \
src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c \
src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h \
src/core/ext/upb-generated/envoy/type/v3/http.upb.c \
src/core/ext/upb-generated/envoy/type/v3/http.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h \
src/core/ext/upb-generated/envoy/type/v3/percent.upb.c \
src/core/ext/upb-generated/envoy/type/v3/percent.upb.h \
src/core/ext/upb-generated/envoy/type/v3/range.upb.c \
src/core/ext/upb-generated/envoy/type/v3/range.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h \
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c \
src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h \
+src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c \
+src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h \
src/core/ext/upb-generated/google/api/annotations.upb.c \
src/core/ext/upb-generated/google/api/annotations.upb.h \
src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c \
@@ -1220,8 +1268,12 @@ src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c \
src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h \
src/core/ext/upb-generated/google/api/http.upb.c \
src/core/ext/upb-generated/google/api/http.upb.h \
+src/core/ext/upb-generated/google/api/httpbody.upb.c \
+src/core/ext/upb-generated/google/api/httpbody.upb.h \
src/core/ext/upb-generated/google/protobuf/any.upb.c \
src/core/ext/upb-generated/google/protobuf/any.upb.h \
+src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \
+src/core/ext/upb-generated/google/protobuf/descriptor.upb.h \
src/core/ext/upb-generated/google/protobuf/duration.upb.c \
src/core/ext/upb-generated/google/protobuf/duration.upb.h \
src/core/ext/upb-generated/google/protobuf/empty.upb.c \
@@ -1234,6 +1286,8 @@ src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \
src/core/ext/upb-generated/google/protobuf/wrappers.upb.h \
src/core/ext/upb-generated/google/rpc/status.upb.c \
src/core/ext/upb-generated/google/rpc/status.upb.h \
+src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c \
+src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h \
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \
src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h \
src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \
@@ -1244,6 +1298,10 @@ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \
src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \
src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c \
+src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h \
src/core/ext/upb-generated/udpa/annotations/migrate.upb.c \
src/core/ext/upb-generated/udpa/annotations/migrate.upb.h \
src/core/ext/upb-generated/udpa/annotations/security.upb.c \
@@ -1254,26 +1312,62 @@ src/core/ext/upb-generated/udpa/annotations/status.upb.c \
src/core/ext/upb-generated/udpa/annotations/status.upb.h \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.h \
-src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
-src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h \
-src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
-src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/validate/validate.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/security.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/security.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/status.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/status.upb.h \
+src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c \
+src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
src/core/ext/upb-generated/xds/core/v3/authority.upb.h \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h \
src/core/ext/upb-generated/xds/core/v3/context_params.upb.c \
src/core/ext/upb-generated/xds/core/v3/context_params.upb.h \
+src/core/ext/upb-generated/xds/core/v3/extension.upb.c \
+src/core/ext/upb-generated/xds/core/v3/extension.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h \
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c \
src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h \
+src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c \
+src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h \
+src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c \
+src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h \
+src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c \
+src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c \
@@ -1290,6 +1384,8 @@ src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c \
@@ -1302,6 +1398,8 @@ src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs
src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c \
@@ -1312,10 +1410,14 @@ src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c \
@@ -1328,26 +1430,54 @@ src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
@@ -1360,24 +1490,22 @@ src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c \
-src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c \
@@ -1398,20 +1526,36 @@ src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h \
+src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c \
+src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.c \
src/core/ext/upbdefs-generated/google/api/http.upbdefs.h \
+src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c \
+src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h \
+src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c \
+src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h \
src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c \
@@ -1424,6 +1568,10 @@ src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c \
src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h \
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c \
src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h \
+src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c \
+src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h \
+src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c \
+src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c \
@@ -1434,22 +1582,40 @@ src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h \
-src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
-src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h \
+src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c \
+src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h \
src/core/ext/xds/certificate_provider_factory.h \
src/core/ext/xds/certificate_provider_registry.cc \
src/core/ext/xds/certificate_provider_registry.h \
@@ -1457,6 +1623,7 @@ src/core/ext/xds/certificate_provider_store.cc \
src/core/ext/xds/certificate_provider_store.h \
src/core/ext/xds/file_watcher_certificate_provider_factory.cc \
src/core/ext/xds/file_watcher_certificate_provider_factory.h \
+src/core/ext/xds/upb_utils.h \
src/core/ext/xds/xds_api.cc \
src/core/ext/xds/xds_api.h \
src/core/ext/xds/xds_bootstrap.cc \
@@ -1464,31 +1631,57 @@ src/core/ext/xds/xds_bootstrap.h \
src/core/ext/xds/xds_certificate_provider.cc \
src/core/ext/xds/xds_certificate_provider.h \
src/core/ext/xds/xds_channel_args.h \
+src/core/ext/xds/xds_channel_stack_modifier.cc \
+src/core/ext/xds/xds_channel_stack_modifier.h \
src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client.h \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_client_stats.h \
+src/core/ext/xds/xds_cluster.cc \
+src/core/ext/xds/xds_cluster.h \
+src/core/ext/xds/xds_cluster_specifier_plugin.cc \
+src/core/ext/xds/xds_cluster_specifier_plugin.h \
+src/core/ext/xds/xds_common_types.cc \
+src/core/ext/xds/xds_common_types.h \
+src/core/ext/xds/xds_endpoint.cc \
+src/core/ext/xds/xds_endpoint.h \
src/core/ext/xds/xds_http_fault_filter.cc \
src/core/ext/xds/xds_http_fault_filter.h \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_http_filters.h \
+src/core/ext/xds/xds_http_rbac_filter.cc \
+src/core/ext/xds/xds_http_rbac_filter.h \
+src/core/ext/xds/xds_listener.cc \
+src/core/ext/xds/xds_listener.h \
+src/core/ext/xds/xds_resource_type.cc \
+src/core/ext/xds/xds_resource_type.h \
+src/core/ext/xds/xds_resource_type_impl.h \
+src/core/ext/xds/xds_route_config.cc \
+src/core/ext/xds/xds_route_config.h \
+src/core/ext/xds/xds_routing.cc \
+src/core/ext/xds/xds_routing.h \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/README.md \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/parse_address.h \
src/core/lib/address_utils/sockaddr_utils.cc \
src/core/lib/address_utils/sockaddr_utils.h \
-src/core/lib/avl/avl.cc \
src/core/lib/avl/avl.h \
src/core/lib/backoff/backoff.cc \
src/core/lib/backoff/backoff.h \
src/core/lib/channel/README.md \
+src/core/lib/channel/call_finalization.h \
+src/core/lib/channel/call_tracer.h \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_args.h \
+src/core/lib/channel/channel_args_preconditioning.cc \
+src/core/lib/channel/channel_args_preconditioning.h \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack.h \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/channel_stack_builder.h \
+src/core/lib/channel/channel_stack_builder_impl.cc \
+src/core/lib/channel/channel_stack_builder_impl.h \
src/core/lib/channel/channel_trace.cc \
src/core/lib/channel/channel_trace.h \
src/core/lib/channel/channelz.cc \
@@ -1503,34 +1696,35 @@ src/core/lib/channel/handshaker.h \
src/core/lib/channel/handshaker_factory.h \
src/core/lib/channel/handshaker_registry.cc \
src/core/lib/channel/handshaker_registry.h \
+src/core/lib/channel/promise_based_filter.cc \
+src/core/lib/channel/promise_based_filter.h \
src/core/lib/channel/status_util.cc \
src/core/lib/channel/status_util.h \
-src/core/lib/compression/algorithm_metadata.h \
src/core/lib/compression/compression.cc \
-src/core/lib/compression/compression_args.cc \
-src/core/lib/compression/compression_args.h \
src/core/lib/compression/compression_internal.cc \
src/core/lib/compression/compression_internal.h \
src/core/lib/compression/message_compress.cc \
src/core/lib/compression/message_compress.h \
-src/core/lib/compression/stream_compression.cc \
-src/core/lib/compression/stream_compression.h \
-src/core/lib/compression/stream_compression_gzip.cc \
-src/core/lib/compression/stream_compression_gzip.h \
-src/core/lib/compression/stream_compression_identity.cc \
-src/core/lib/compression/stream_compression_identity.h \
+src/core/lib/config/core_configuration.cc \
+src/core/lib/config/core_configuration.h \
src/core/lib/debug/stats.cc \
src/core/lib/debug/stats.h \
src/core/lib/debug/stats_data.cc \
src/core/lib/debug/stats_data.h \
src/core/lib/debug/trace.cc \
src/core/lib/debug/trace.h \
-src/core/lib/event_engine/slice_allocator.cc \
+src/core/lib/event_engine/channel_args_endpoint_config.cc \
+src/core/lib/event_engine/channel_args_endpoint_config.h \
+src/core/lib/event_engine/default_event_engine_factory.cc \
+src/core/lib/event_engine/event_engine.cc \
+src/core/lib/event_engine/event_engine_factory.h \
+src/core/lib/event_engine/memory_allocator.cc \
+src/core/lib/event_engine/resolved_address.cc \
src/core/lib/event_engine/sockaddr.cc \
+src/core/lib/event_engine/sockaddr.h \
src/core/lib/gpr/README.md \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/alloc.h \
-src/core/lib/gpr/arena.h \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/cpu_iphone.cc \
src/core/lib/gpr/cpu_linux.cc \
@@ -1564,11 +1758,6 @@ src/core/lib/gpr/time_precise.cc \
src/core/lib/gpr/time_precise.h \
src/core/lib/gpr/time_windows.cc \
src/core/lib/gpr/tls.h \
-src/core/lib/gpr/tls_gcc.h \
-src/core/lib/gpr/tls_msvc.h \
-src/core/lib/gpr/tls_pthread.cc \
-src/core/lib/gpr/tls_pthread.h \
-src/core/lib/gpr/tls_stdcpp.h \
src/core/lib/gpr/tmpfile.h \
src/core/lib/gpr/tmpfile_msys.cc \
src/core/lib/gpr/tmpfile_posix.cc \
@@ -1576,9 +1765,12 @@ src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/useful.h \
src/core/lib/gpr/wrap_memcpy.cc \
src/core/lib/gprpp/README.md \
-src/core/lib/gprpp/arena.cc \
-src/core/lib/gprpp/arena.h \
-src/core/lib/gprpp/atomic.h \
+src/core/lib/gprpp/atomic_utils.h \
+src/core/lib/gprpp/bitset.h \
+src/core/lib/gprpp/capture.h \
+src/core/lib/gprpp/chunked_vector.h \
+src/core/lib/gprpp/construct_destruct.h \
+src/core/lib/gprpp/cpp_impl_of.h \
src/core/lib/gprpp/debug_location.h \
src/core/lib/gprpp/dual_ref_counted.h \
src/core/lib/gprpp/examine_stack.cc \
@@ -1593,21 +1785,27 @@ src/core/lib/gprpp/global_config_generic.h \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/host_port.h \
src/core/lib/gprpp/manual_constructor.h \
+src/core/lib/gprpp/match.h \
src/core/lib/gprpp/memory.h \
src/core/lib/gprpp/mpscq.cc \
src/core/lib/gprpp/mpscq.h \
src/core/lib/gprpp/orphanable.h \
+src/core/lib/gprpp/overload.h \
src/core/lib/gprpp/ref_counted.h \
src/core/lib/gprpp/ref_counted_ptr.h \
+src/core/lib/gprpp/single_set_ptr.h \
src/core/lib/gprpp/stat.h \
src/core/lib/gprpp/stat_posix.cc \
src/core/lib/gprpp/stat_windows.cc \
src/core/lib/gprpp/status_helper.cc \
src/core/lib/gprpp/status_helper.h \
src/core/lib/gprpp/sync.h \
+src/core/lib/gprpp/table.h \
src/core/lib/gprpp/thd.h \
src/core/lib/gprpp/thd_posix.cc \
src/core/lib/gprpp/thd_windows.cc \
+src/core/lib/gprpp/time.cc \
+src/core/lib/gprpp/time.h \
src/core/lib/gprpp/time_util.cc \
src/core/lib/gprpp/time_util.h \
src/core/lib/http/format_request.cc \
@@ -1615,6 +1813,7 @@ src/core/lib/http/format_request.h \
src/core/lib/http/httpcli.cc \
src/core/lib/http/httpcli.h \
src/core/lib/http/httpcli_security_connector.cc \
+src/core/lib/http/httpcli_ssl_credentials.h \
src/core/lib/http/parser.cc \
src/core/lib/http/parser.h \
src/core/lib/iomgr/README.md \
@@ -1635,8 +1834,8 @@ src/core/lib/iomgr/endpoint.h \
src/core/lib/iomgr/endpoint_cfstream.cc \
src/core/lib/iomgr/endpoint_cfstream.h \
src/core/lib/iomgr/endpoint_pair.h \
+src/core/lib/iomgr/endpoint_pair_event_engine.cc \
src/core/lib/iomgr/endpoint_pair_posix.cc \
-src/core/lib/iomgr/endpoint_pair_uv.cc \
src/core/lib/iomgr/endpoint_pair_windows.cc \
src/core/lib/iomgr/error.cc \
src/core/lib/iomgr/error.h \
@@ -1647,13 +1846,25 @@ src/core/lib/iomgr/ev_apple.cc \
src/core/lib/iomgr/ev_apple.h \
src/core/lib/iomgr/ev_epoll1_linux.cc \
src/core/lib/iomgr/ev_epoll1_linux.h \
-src/core/lib/iomgr/ev_epollex_linux.cc \
-src/core/lib/iomgr/ev_epollex_linux.h \
src/core/lib/iomgr/ev_poll_posix.cc \
src/core/lib/iomgr/ev_poll_posix.h \
src/core/lib/iomgr/ev_posix.cc \
src/core/lib/iomgr/ev_posix.h \
src/core/lib/iomgr/ev_windows.cc \
+src/core/lib/iomgr/event_engine/closure.cc \
+src/core/lib/iomgr/event_engine/closure.h \
+src/core/lib/iomgr/event_engine/endpoint.cc \
+src/core/lib/iomgr/event_engine/endpoint.h \
+src/core/lib/iomgr/event_engine/iomgr.cc \
+src/core/lib/iomgr/event_engine/pollset.cc \
+src/core/lib/iomgr/event_engine/pollset.h \
+src/core/lib/iomgr/event_engine/promise.h \
+src/core/lib/iomgr/event_engine/resolved_address_internal.cc \
+src/core/lib/iomgr/event_engine/resolved_address_internal.h \
+src/core/lib/iomgr/event_engine/resolver.cc \
+src/core/lib/iomgr/event_engine/resolver.h \
+src/core/lib/iomgr/event_engine/tcp.cc \
+src/core/lib/iomgr/event_engine/timer.cc \
src/core/lib/iomgr/exec_ctx.cc \
src/core/lib/iomgr/exec_ctx.h \
src/core/lib/iomgr/executor.cc \
@@ -1677,16 +1888,11 @@ src/core/lib/iomgr/iocp_windows.cc \
src/core/lib/iomgr/iocp_windows.h \
src/core/lib/iomgr/iomgr.cc \
src/core/lib/iomgr/iomgr.h \
-src/core/lib/iomgr/iomgr_custom.cc \
-src/core/lib/iomgr/iomgr_custom.h \
src/core/lib/iomgr/iomgr_internal.cc \
src/core/lib/iomgr/iomgr_internal.h \
src/core/lib/iomgr/iomgr_posix.cc \
src/core/lib/iomgr/iomgr_posix_cfstream.cc \
-src/core/lib/iomgr/iomgr_uv.cc \
src/core/lib/iomgr/iomgr_windows.cc \
-src/core/lib/iomgr/is_epollexclusive_available.cc \
-src/core/lib/iomgr/is_epollexclusive_available.h \
src/core/lib/iomgr/load_file.cc \
src/core/lib/iomgr/load_file.h \
src/core/lib/iomgr/lockfree_event.cc \
@@ -1696,31 +1902,25 @@ src/core/lib/iomgr/polling_entity.cc \
src/core/lib/iomgr/polling_entity.h \
src/core/lib/iomgr/pollset.cc \
src/core/lib/iomgr/pollset.h \
-src/core/lib/iomgr/pollset_custom.cc \
-src/core/lib/iomgr/pollset_custom.h \
src/core/lib/iomgr/pollset_set.cc \
src/core/lib/iomgr/pollset_set.h \
-src/core/lib/iomgr/pollset_set_custom.cc \
-src/core/lib/iomgr/pollset_set_custom.h \
src/core/lib/iomgr/pollset_set_windows.cc \
src/core/lib/iomgr/pollset_set_windows.h \
-src/core/lib/iomgr/pollset_uv.cc \
-src/core/lib/iomgr/pollset_uv.h \
src/core/lib/iomgr/pollset_windows.cc \
src/core/lib/iomgr/pollset_windows.h \
src/core/lib/iomgr/port.h \
src/core/lib/iomgr/python_util.h \
src/core/lib/iomgr/resolve_address.cc \
src/core/lib/iomgr/resolve_address.h \
-src/core/lib/iomgr/resolve_address_custom.cc \
-src/core/lib/iomgr/resolve_address_custom.h \
+src/core/lib/iomgr/resolve_address_impl.h \
src/core/lib/iomgr/resolve_address_posix.cc \
+src/core/lib/iomgr/resolve_address_posix.h \
src/core/lib/iomgr/resolve_address_windows.cc \
-src/core/lib/iomgr/resource_quota.cc \
-src/core/lib/iomgr/resource_quota.h \
+src/core/lib/iomgr/resolve_address_windows.h \
+src/core/lib/iomgr/resolved_address.h \
src/core/lib/iomgr/sockaddr.h \
-src/core/lib/iomgr/sockaddr_custom.h \
src/core/lib/iomgr/sockaddr_posix.h \
+src/core/lib/iomgr/sockaddr_utils_posix.cc \
src/core/lib/iomgr/sockaddr_windows.h \
src/core/lib/iomgr/socket_factory_posix.cc \
src/core/lib/iomgr/socket_factory_posix.h \
@@ -1731,49 +1931,37 @@ src/core/lib/iomgr/socket_utils_common_posix.cc \
src/core/lib/iomgr/socket_utils_linux.cc \
src/core/lib/iomgr/socket_utils_posix.cc \
src/core/lib/iomgr/socket_utils_posix.h \
-src/core/lib/iomgr/socket_utils_uv.cc \
src/core/lib/iomgr/socket_utils_windows.cc \
src/core/lib/iomgr/socket_windows.cc \
src/core/lib/iomgr/socket_windows.h \
-src/core/lib/iomgr/sys_epoll_wrapper.h \
src/core/lib/iomgr/tcp_client.cc \
src/core/lib/iomgr/tcp_client.h \
src/core/lib/iomgr/tcp_client_cfstream.cc \
-src/core/lib/iomgr/tcp_client_custom.cc \
src/core/lib/iomgr/tcp_client_posix.cc \
src/core/lib/iomgr/tcp_client_posix.h \
src/core/lib/iomgr/tcp_client_windows.cc \
-src/core/lib/iomgr/tcp_custom.cc \
-src/core/lib/iomgr/tcp_custom.h \
src/core/lib/iomgr/tcp_posix.cc \
src/core/lib/iomgr/tcp_posix.h \
src/core/lib/iomgr/tcp_server.cc \
src/core/lib/iomgr/tcp_server.h \
-src/core/lib/iomgr/tcp_server_custom.cc \
src/core/lib/iomgr/tcp_server_posix.cc \
src/core/lib/iomgr/tcp_server_utils_posix.h \
src/core/lib/iomgr/tcp_server_utils_posix_common.cc \
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc \
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc \
src/core/lib/iomgr/tcp_server_windows.cc \
-src/core/lib/iomgr/tcp_uv.cc \
src/core/lib/iomgr/tcp_windows.cc \
src/core/lib/iomgr/tcp_windows.h \
src/core/lib/iomgr/time_averaged_stats.cc \
src/core/lib/iomgr/time_averaged_stats.h \
src/core/lib/iomgr/timer.cc \
src/core/lib/iomgr/timer.h \
-src/core/lib/iomgr/timer_custom.cc \
-src/core/lib/iomgr/timer_custom.h \
src/core/lib/iomgr/timer_generic.cc \
src/core/lib/iomgr/timer_generic.h \
src/core/lib/iomgr/timer_heap.cc \
src/core/lib/iomgr/timer_heap.h \
src/core/lib/iomgr/timer_manager.cc \
src/core/lib/iomgr/timer_manager.h \
-src/core/lib/iomgr/timer_uv.cc \
-src/core/lib/iomgr/udp_server.cc \
-src/core/lib/iomgr/udp_server.h \
src/core/lib/iomgr/unix_sockets_posix.cc \
src/core/lib/iomgr/unix_sockets_posix.h \
src/core/lib/iomgr/unix_sockets_posix_noop.cc \
@@ -1795,6 +1983,60 @@ src/core/lib/matchers/matchers.h \
src/core/lib/profiling/basic_timers.cc \
src/core/lib/profiling/stap_timers.cc \
src/core/lib/profiling/timers.h \
+src/core/lib/promise/activity.cc \
+src/core/lib/promise/activity.h \
+src/core/lib/promise/arena_promise.h \
+src/core/lib/promise/call_push_pull.h \
+src/core/lib/promise/context.h \
+src/core/lib/promise/detail/basic_seq.h \
+src/core/lib/promise/detail/promise_factory.h \
+src/core/lib/promise/detail/promise_like.h \
+src/core/lib/promise/detail/status.h \
+src/core/lib/promise/detail/switch.h \
+src/core/lib/promise/exec_ctx_wakeup_scheduler.h \
+src/core/lib/promise/intra_activity_waiter.h \
+src/core/lib/promise/latch.h \
+src/core/lib/promise/loop.h \
+src/core/lib/promise/map.h \
+src/core/lib/promise/poll.h \
+src/core/lib/promise/promise.h \
+src/core/lib/promise/race.h \
+src/core/lib/promise/seq.h \
+src/core/lib/promise/sleep.cc \
+src/core/lib/promise/sleep.h \
+src/core/lib/promise/try_seq.h \
+src/core/lib/resolver/resolver.cc \
+src/core/lib/resolver/resolver.h \
+src/core/lib/resolver/resolver_factory.h \
+src/core/lib/resolver/resolver_registry.cc \
+src/core/lib/resolver/resolver_registry.h \
+src/core/lib/resolver/server_address.cc \
+src/core/lib/resolver/server_address.h \
+src/core/lib/resource_quota/api.cc \
+src/core/lib/resource_quota/api.h \
+src/core/lib/resource_quota/arena.cc \
+src/core/lib/resource_quota/arena.h \
+src/core/lib/resource_quota/memory_quota.cc \
+src/core/lib/resource_quota/memory_quota.h \
+src/core/lib/resource_quota/resource_quota.cc \
+src/core/lib/resource_quota/resource_quota.h \
+src/core/lib/resource_quota/thread_quota.cc \
+src/core/lib/resource_quota/thread_quota.h \
+src/core/lib/resource_quota/trace.cc \
+src/core/lib/resource_quota/trace.h \
+src/core/lib/security/authorization/authorization_engine.h \
+src/core/lib/security/authorization/authorization_policy_provider.h \
+src/core/lib/security/authorization/authorization_policy_provider_vtable.cc \
+src/core/lib/security/authorization/evaluate_args.cc \
+src/core/lib/security/authorization/evaluate_args.h \
+src/core/lib/security/authorization/grpc_authorization_engine.cc \
+src/core/lib/security/authorization/grpc_authorization_engine.h \
+src/core/lib/security/authorization/grpc_server_authz_filter.cc \
+src/core/lib/security/authorization/grpc_server_authz_filter.h \
+src/core/lib/security/authorization/matchers.cc \
+src/core/lib/security/authorization/matchers.h \
+src/core/lib/security/authorization/rbac_policy.cc \
+src/core/lib/security/authorization/rbac_policy.h \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/context/security_context.h \
src/core/lib/security/credentials/alts/alts_credentials.cc \
@@ -1808,11 +2050,14 @@ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \
src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h \
src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \
+src/core/lib/security/credentials/call_creds_util.cc \
+src/core/lib/security/credentials/call_creds_util.h \
+src/core/lib/security/credentials/channel_creds_registry.h \
+src/core/lib/security/credentials/channel_creds_registry_init.cc \
src/core/lib/security/credentials/composite/composite_credentials.cc \
src/core/lib/security/credentials/composite/composite_credentials.h \
src/core/lib/security/credentials/credentials.cc \
src/core/lib/security/credentials/credentials.h \
-src/core/lib/security/credentials/credentials_metadata.cc \
src/core/lib/security/credentials/external/aws_external_account_credentials.cc \
src/core/lib/security/credentials/external/aws_external_account_credentials.h \
src/core/lib/security/credentials/external/aws_request_signer.cc \
@@ -1831,6 +2076,7 @@ src/core/lib/security/credentials/google_default/google_default_credentials.h \
src/core/lib/security/credentials/iam/iam_credentials.cc \
src/core/lib/security/credentials/iam/iam_credentials.h \
src/core/lib/security/credentials/insecure/insecure_credentials.cc \
+src/core/lib/security/credentials/insecure/insecure_credentials.h \
src/core/lib/security/credentials/jwt/json_token.cc \
src/core/lib/security/credentials/jwt/json_token.h \
src/core/lib/security/credentials/jwt/jwt_credentials.cc \
@@ -1849,6 +2095,8 @@ src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc \
src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h \
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc \
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h \
+src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc \
+src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h \
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc \
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h \
src/core/lib/security/credentials/tls/tls_credentials.cc \
@@ -1890,20 +2138,33 @@ src/core/lib/security/transport/tsi_error.cc \
src/core/lib/security/transport/tsi_error.h \
src/core/lib/security/util/json_util.cc \
src/core/lib/security/util/json_util.h \
+src/core/lib/service_config/service_config.h \
+src/core/lib/service_config/service_config_call_data.h \
+src/core/lib/service_config/service_config_impl.cc \
+src/core/lib/service_config/service_config_impl.h \
+src/core/lib/service_config/service_config_parser.cc \
+src/core/lib/service_config/service_config_parser.h \
src/core/lib/slice/b64.cc \
src/core/lib/slice/b64.h \
src/core/lib/slice/percent_encoding.cc \
src/core/lib/slice/percent_encoding.h \
src/core/lib/slice/slice.cc \
+src/core/lib/slice/slice.h \
+src/core/lib/slice/slice_api.cc \
src/core/lib/slice/slice_buffer.cc \
-src/core/lib/slice/slice_intern.cc \
src/core/lib/slice/slice_internal.h \
+src/core/lib/slice/slice_refcount.cc \
+src/core/lib/slice/slice_refcount.h \
+src/core/lib/slice/slice_refcount_base.h \
+src/core/lib/slice/slice_split.cc \
+src/core/lib/slice/slice_split.h \
src/core/lib/slice/slice_string_helpers.cc \
src/core/lib/slice/slice_string_helpers.h \
-src/core/lib/slice/slice_utils.h \
src/core/lib/surface/README.md \
src/core/lib/surface/api_trace.cc \
src/core/lib/surface/api_trace.h \
+src/core/lib/surface/builtins.cc \
+src/core/lib/surface/builtins.h \
src/core/lib/surface/byte_buffer.cc \
src/core/lib/surface/byte_buffer_reader.cc \
src/core/lib/surface/call.cc \
@@ -1926,7 +2187,6 @@ src/core/lib/surface/event_string.cc \
src/core/lib/surface/event_string.h \
src/core/lib/surface/init.cc \
src/core/lib/surface/init.h \
-src/core/lib/surface/init_secure.cc \
src/core/lib/surface/lame_client.cc \
src/core/lib/surface/lame_client.h \
src/core/lib/surface/metadata_array.cc \
@@ -1936,8 +2196,6 @@ src/core/lib/surface/validate_metadata.cc \
src/core/lib/surface/validate_metadata.h \
src/core/lib/surface/version.cc \
src/core/lib/transport/README.md \
-src/core/lib/transport/authority_override.cc \
-src/core/lib/transport/authority_override.h \
src/core/lib/transport/bdp_estimator.cc \
src/core/lib/transport/bdp_estimator.h \
src/core/lib/transport/byte_stream.cc \
@@ -1947,18 +2205,13 @@ src/core/lib/transport/connectivity_state.h \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/error_utils.h \
src/core/lib/transport/http2_errors.h \
-src/core/lib/transport/metadata.cc \
-src/core/lib/transport/metadata.h \
-src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/metadata_batch.h \
+src/core/lib/transport/parsed_metadata.cc \
+src/core/lib/transport/parsed_metadata.h \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/pid_controller.h \
-src/core/lib/transport/static_metadata.cc \
-src/core/lib/transport/static_metadata.h \
src/core/lib/transport/status_conversion.cc \
src/core/lib/transport/status_conversion.h \
-src/core/lib/transport/status_metadata.cc \
-src/core/lib/transport/status_metadata.h \
src/core/lib/transport/timeout_encoding.cc \
src/core/lib/transport/timeout_encoding.h \
src/core/lib/transport/transport.cc \
@@ -1968,6 +2221,7 @@ src/core/lib/transport/transport_op_string.cc \
src/core/lib/uri/uri_parser.cc \
src/core/lib/uri/uri_parser.h \
src/core/plugin_registry/grpc_plugin_registry.cc \
+src/core/plugin_registry/grpc_plugin_registry_extra.cc \
src/core/tsi/README.md \
src/core/tsi/alts/crypt/aes_gcm.cc \
src/core/tsi/alts/crypt/gsec.cc \
@@ -2010,6 +2264,8 @@ src/core/tsi/fake_transport_security.cc \
src/core/tsi/fake_transport_security.h \
src/core/tsi/local_transport_security.cc \
src/core/tsi/local_transport_security.h \
+src/core/tsi/ssl/key_logging/ssl_key_logging.cc \
+src/core/tsi/ssl/key_logging/ssl_key_logging.h \
src/core/tsi/ssl/session_cache/ssl_session.h \
src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \
src/core/tsi/ssl/session_cache/ssl_session_cache.cc \
diff --git a/grpc/tools/doxygen/Doxyfile.objc b/grpc/tools/doxygen/Doxyfile.objc
index d137440e..720a955d 100644
--- a/grpc/tools/doxygen/Doxyfile.objc
+++ b/grpc/tools/doxygen/Doxyfile.objc
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.38.0
+PROJECT_NUMBER = 1.46.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
diff --git a/grpc/tools/doxygen/Doxyfile.objc.internal b/grpc/tools/doxygen/Doxyfile.objc.internal
index 6e72d915..2b738caa 100644
--- a/grpc/tools/doxygen/Doxyfile.objc.internal
+++ b/grpc/tools/doxygen/Doxyfile.objc.internal
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.38.0
+PROJECT_NUMBER = 1.46.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
diff --git a/grpc/tools/doxygen/Doxyfile.php b/grpc/tools/doxygen/Doxyfile.php
index 09797baf..3b57ef95 100644
--- a/grpc/tools/doxygen/Doxyfile.php
+++ b/grpc/tools/doxygen/Doxyfile.php
@@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC PHP"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.38.0
+PROJECT_NUMBER = 1.46.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -762,6 +762,7 @@ WARN_LOGFILE =
INPUT = doc/PROTOCOL-HTTP2.md \
doc/PROTOCOL-WEB.md \
+doc/bazel_support.md \
doc/binary-logging.md \
doc/c-style-guide.md \
doc/command_line_tool.md \
diff --git a/grpc/tools/fuzzer/build_and_run_fuzzer.sh b/grpc/tools/fuzzer/build_and_run_fuzzer.sh
deleted file mode 100755
index 392998fb..00000000
--- a/grpc/tools/fuzzer/build_and_run_fuzzer.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-set -ex
-
-cd $(dirname $0)/../..
-make CONFIG=$config $1 -j3
-mkdir -p fuzzer_output
-export ASAN_OPTIONS=handle_abort=1
-. tools/fuzzer/runners/$1.sh
diff --git a/grpc/tools/fuzzer/options/client_fuzzer.options b/grpc/tools/fuzzer/options/client_fuzzer.options
deleted file mode 100644
index fd2eebf7..00000000
--- a/grpc/tools/fuzzer/options/client_fuzzer.options
+++ /dev/null
@@ -1,3 +0,0 @@
-[libfuzzer]
-max_len = 2048
-dict = hpack.dictionary
diff --git a/grpc/tools/fuzzer/options/fuzzer.options b/grpc/tools/fuzzer/options/fuzzer.options
deleted file mode 100644
index 5d468bc6..00000000
--- a/grpc/tools/fuzzer/options/fuzzer.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 512
diff --git a/grpc/tools/fuzzer/options/fuzzer_response.options b/grpc/tools/fuzzer/options/fuzzer_response.options
deleted file mode 100644
index 5dcdfac7..00000000
--- a/grpc/tools/fuzzer/options/fuzzer_response.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 128
diff --git a/grpc/tools/fuzzer/options/fuzzer_serverlist.options b/grpc/tools/fuzzer/options/fuzzer_serverlist.options
deleted file mode 100644
index 5dcdfac7..00000000
--- a/grpc/tools/fuzzer/options/fuzzer_serverlist.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 128
diff --git a/grpc/tools/fuzzer/options/hpack_parser_fuzzer_test.options b/grpc/tools/fuzzer/options/hpack_parser_fuzzer_test.options
deleted file mode 100644
index 584487fa..00000000
--- a/grpc/tools/fuzzer/options/hpack_parser_fuzzer_test.options
+++ /dev/null
@@ -1,3 +0,0 @@
-[libfuzzer]
-max_len = 512
-dict = hpack.dictionary
diff --git a/grpc/tools/fuzzer/options/percent_decode_fuzzer.options b/grpc/tools/fuzzer/options/percent_decode_fuzzer.options
deleted file mode 100644
index ea2785e1..00000000
--- a/grpc/tools/fuzzer/options/percent_decode_fuzzer.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 32
diff --git a/grpc/tools/fuzzer/options/percent_encode_fuzzer.options b/grpc/tools/fuzzer/options/percent_encode_fuzzer.options
deleted file mode 100644
index ea2785e1..00000000
--- a/grpc/tools/fuzzer/options/percent_encode_fuzzer.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 32
diff --git a/grpc/tools/fuzzer/options/request_fuzzer.options b/grpc/tools/fuzzer/options/request_fuzzer.options
deleted file mode 100644
index fd32ac16..00000000
--- a/grpc/tools/fuzzer/options/request_fuzzer.options
+++ /dev/null
@@ -1,3 +0,0 @@
-[libfuzzer]
-max_len = 2048
-
diff --git a/grpc/tools/fuzzer/options/response_fuzzer.options b/grpc/tools/fuzzer/options/response_fuzzer.options
deleted file mode 100644
index fd32ac16..00000000
--- a/grpc/tools/fuzzer/options/response_fuzzer.options
+++ /dev/null
@@ -1,3 +0,0 @@
-[libfuzzer]
-max_len = 2048
-
diff --git a/grpc/tools/fuzzer/options/server_fuzzer.options b/grpc/tools/fuzzer/options/server_fuzzer.options
deleted file mode 100644
index fd2eebf7..00000000
--- a/grpc/tools/fuzzer/options/server_fuzzer.options
+++ /dev/null
@@ -1,3 +0,0 @@
-[libfuzzer]
-max_len = 2048
-dict = hpack.dictionary
diff --git a/grpc/tools/fuzzer/options/ssl_server_fuzzer.options b/grpc/tools/fuzzer/options/ssl_server_fuzzer.options
deleted file mode 100644
index 60bd9b0b..00000000
--- a/grpc/tools/fuzzer/options/ssl_server_fuzzer.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 2048
diff --git a/grpc/tools/fuzzer/options/uri_fuzzer_test.options b/grpc/tools/fuzzer/options/uri_fuzzer_test.options
deleted file mode 100644
index 5dcdfac7..00000000
--- a/grpc/tools/fuzzer/options/uri_fuzzer_test.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 128
diff --git a/grpc/tools/fuzzer/runners/alts_credentials_fuzzer.sh b/grpc/tools/fuzzer/runners/alts_credentials_fuzzer.sh
deleted file mode 100644
index 3aaff6b5..00000000
--- a/grpc/tools/fuzzer/runners/alts_credentials_fuzzer.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/alts_credentials_fuzzer $flags fuzzer_output test/core/security/corpus/alts_credentials_corpus
diff --git a/grpc/tools/fuzzer/runners/client_fuzzer.sh b/grpc/tools/fuzzer/runners/client_fuzzer.sh
deleted file mode 100644
index 680e6650..00000000
--- a/grpc/tools/fuzzer/runners/client_fuzzer.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-flags="$flags -dict=test/core/end2end/fuzzers/hpack.dictionary"
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/client_fuzzer $flags fuzzer_output test/core/end2end/fuzzers/client_fuzzer_corpus
diff --git a/grpc/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh b/grpc/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
deleted file mode 100644
index 53f0f8d7..00000000
--- a/grpc/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=512 -timeout=120"
-
-flags="$flags -dict=test/core/end2end/fuzzers/hpack.dictionary"
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/hpack_parser_fuzzer_test $flags fuzzer_output test/core/transport/chttp2/hpack_parser_corpus
diff --git a/grpc/tools/fuzzer/runners/http_request_fuzzer_test.sh b/grpc/tools/fuzzer/runners/http_request_fuzzer_test.sh
deleted file mode 100644
index e39b271e..00000000
--- a/grpc/tools/fuzzer/runners/http_request_fuzzer_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/http_request_fuzzer_test $flags fuzzer_output test/core/http/request_corpus
diff --git a/grpc/tools/fuzzer/runners/http_response_fuzzer_test.sh b/grpc/tools/fuzzer/runners/http_response_fuzzer_test.sh
deleted file mode 100644
index df49ac19..00000000
--- a/grpc/tools/fuzzer/runners/http_response_fuzzer_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/http_response_fuzzer_test $flags fuzzer_output test/core/http/response_corpus
diff --git a/grpc/tools/fuzzer/runners/json_fuzzer_test.sh b/grpc/tools/fuzzer/runners/json_fuzzer_test.sh
deleted file mode 100644
index 57109834..00000000
--- a/grpc/tools/fuzzer/runners/json_fuzzer_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=512 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/json_fuzzer_test $flags fuzzer_output test/core/json/corpus
diff --git a/grpc/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh b/grpc/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh
deleted file mode 100644
index d5890198..00000000
--- a/grpc/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/nanopb_fuzzer_response_test $flags fuzzer_output test/core/nanopb/corpus_response
diff --git a/grpc/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh b/grpc/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh
deleted file mode 100644
index 942a093c..00000000
--- a/grpc/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/nanopb_fuzzer_serverlist_test $flags fuzzer_output test/core/nanopb/corpus_serverlist
diff --git a/grpc/tools/fuzzer/runners/percent_decode_fuzzer.sh b/grpc/tools/fuzzer/runners/percent_decode_fuzzer.sh
deleted file mode 100644
index 96510b76..00000000
--- a/grpc/tools/fuzzer/runners/percent_decode_fuzzer.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=32 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/percent_decode_fuzzer $flags fuzzer_output test/core/slice/percent_decode_corpus
diff --git a/grpc/tools/fuzzer/runners/percent_encode_fuzzer.sh b/grpc/tools/fuzzer/runners/percent_encode_fuzzer.sh
deleted file mode 100644
index dc1b5962..00000000
--- a/grpc/tools/fuzzer/runners/percent_encode_fuzzer.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=32 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/percent_encode_fuzzer $flags fuzzer_output test/core/slice/percent_encode_corpus
diff --git a/grpc/tools/fuzzer/runners/server_fuzzer.sh b/grpc/tools/fuzzer/runners/server_fuzzer.sh
deleted file mode 100644
index 410cf5c1..00000000
--- a/grpc/tools/fuzzer/runners/server_fuzzer.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-flags="$flags -dict=test/core/end2end/fuzzers/hpack.dictionary"
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/server_fuzzer $flags fuzzer_output test/core/end2end/fuzzers/server_fuzzer_corpus
diff --git a/grpc/tools/fuzzer/runners/ssl_server_fuzzer.sh b/grpc/tools/fuzzer/runners/ssl_server_fuzzer.sh
deleted file mode 100644
index 3a23f2d9..00000000
--- a/grpc/tools/fuzzer/runners/ssl_server_fuzzer.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/ssl_server_fuzzer $flags fuzzer_output test/core/security/corpus/ssl_server_corpus
diff --git a/grpc/tools/fuzzer/runners/uri_fuzzer_test.sh b/grpc/tools/fuzzer/runners/uri_fuzzer_test.sh
deleted file mode 100644
index 467b72ad..00000000
--- a/grpc/tools/fuzzer/runners/uri_fuzzer_test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# 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.
-#
-
-flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128 -timeout=120"
-
-
-if [ "$jobs" != "1" ]
-then
- flags="-jobs=$jobs -workers=$jobs $flags"
-fi
-
-if [ "$config" == "asan-trace-cmp" ]
-then
- flags="-use_traces=1 $flags"
-fi
-
-bins/$config/uri_fuzzer_test $flags fuzzer_output test/core/uri/uri_corpus
diff --git a/grpc/tools/gcp/github_stats_tracking/app.yaml b/grpc/tools/gcp/github_stats_tracking/app.yaml
deleted file mode 100644
index b0fa5573..00000000
--- a/grpc/tools/gcp/github_stats_tracking/app.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-runtime: python27
-api_version: 1
-threadsafe: true
-
-service: github-stats-tracking
-
-handlers:
-- url: /.*
- script: main.app
-
-libraries:
-- name: ssl
- version: latest
diff --git a/grpc/tools/gcp/github_stats_tracking/appengine_config.py b/grpc/tools/gcp/github_stats_tracking/appengine_config.py
deleted file mode 100644
index 086be2ae..00000000
--- a/grpc/tools/gcp/github_stats_tracking/appengine_config.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# appengine_config.py
-from google.appengine.ext import vendor
-
-# Add any libraries install in the "lib" folder.
-vendor.add('lib')
diff --git a/grpc/tools/gcp/github_stats_tracking/cron.yaml b/grpc/tools/gcp/github_stats_tracking/cron.yaml
deleted file mode 100644
index b5b36be9..00000000
--- a/grpc/tools/gcp/github_stats_tracking/cron.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-cron:
-- description: "daily github stats tracking job"
- url: /daily
- schedule: every 24 hours
diff --git a/grpc/tools/gcp/github_stats_tracking/fetch_data.py b/grpc/tools/gcp/github_stats_tracking/fetch_data.py
deleted file mode 100644
index 9cae50f4..00000000
--- a/grpc/tools/gcp/github_stats_tracking/fetch_data.py
+++ /dev/null
@@ -1,93 +0,0 @@
-# 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.
-
-from github import Github, Label
-from datetime import datetime, timedelta
-from time import time
-from google.cloud import bigquery
-
-ACCESS_TOKEN = ""
-
-
-def get_stats_from_github():
- # Please set the access token properly before deploying.
- assert ACCESS_TOKEN
- g = Github(ACCESS_TOKEN)
- print g.rate_limiting
- repo = g.get_repo('grpc/grpc')
-
- LABEL_LANG = set(label for label in repo.get_labels()
- if label.name.split('/')[0] == 'lang')
- LABEL_KIND_BUG = repo.get_label('kind/bug')
- LABEL_PRIORITY_P0 = repo.get_label('priority/P0')
- LABEL_PRIORITY_P1 = repo.get_label('priority/P1')
- LABEL_PRIORITY_P2 = repo.get_label('priority/P2')
-
- def is_untriaged(issue):
- key_labels = set()
- for label in issue.labels:
- label_kind = label.name.split('/')[0]
- if label_kind in ('lang', 'kind', 'priority'):
- key_labels.add(label_kind)
- return len(key_labels) < 3
-
- untriaged_open_issues = [
- issue for issue in repo.get_issues(state='open')
- if issue.pull_request is None and is_untriaged(issue)
- ]
- total_bugs = [
- issue for issue in repo.get_issues(state='all', labels=[LABEL_KIND_BUG])
- if issue.pull_request is None
- ]
-
- lang_to_stats = {}
- for lang in LABEL_LANG:
- lang_bugs = filter(lambda bug: lang in bug.labels, total_bugs)
- closed_bugs = filter(lambda bug: bug.state == 'closed', lang_bugs)
- open_bugs = filter(lambda bug: bug.state == 'open', lang_bugs)
- open_p0_bugs = filter(lambda bug: LABEL_PRIORITY_P0 in bug.labels,
- open_bugs)
- open_p1_bugs = filter(lambda bug: LABEL_PRIORITY_P1 in bug.labels,
- open_bugs)
- open_p2_bugs = filter(lambda bug: LABEL_PRIORITY_P2 in bug.labels,
- open_bugs)
- lang_to_stats[lang] = [
- len(lang_bugs),
- len(closed_bugs),
- len(open_bugs),
- len(open_p0_bugs),
- len(open_p1_bugs),
- len(open_p2_bugs)
- ]
- return len(untriaged_open_issues), lang_to_stats
-
-
-def insert_stats_to_db(untriaged_open_issues, lang_to_stats):
- timestamp = time()
- client = bigquery.Client()
- dataset_ref = client.dataset('github_issues')
- table_ref = dataset_ref.table('untriaged_issues')
- table = client.get_table(table_ref)
- errors = client.insert_rows(table, [(timestamp, untriaged_open_issues)])
- table_ref = dataset_ref.table('bug_stats')
- table = client.get_table(table_ref)
- rows = []
- for lang, stats in lang_to_stats.iteritems():
- rows.append((timestamp, lang.name[5:]) + tuple(stats))
- errors = client.insert_rows(table, rows)
-
-
-def fetch():
- untriaged_open_issues, lang_to_stats = get_stats_from_github()
- insert_stats_to_db(untriaged_open_issues, lang_to_stats)
diff --git a/grpc/tools/gcp/github_stats_tracking/main.py b/grpc/tools/gcp/github_stats_tracking/main.py
deleted file mode 100644
index d71ea8f9..00000000
--- a/grpc/tools/gcp/github_stats_tracking/main.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-
-import webapp2
-from fetch_data import fetch
-
-
-class DailyCron(webapp2.RequestHandler):
-
- def get(self):
- fetch()
- self.response.status = 204
-
-
-app = webapp2.WSGIApplication([
- ('/daily', DailyCron),
-], debug=True)
diff --git a/grpc/tools/gcp/utils/big_query_utils.py b/grpc/tools/gcp/utils/big_query_utils.py
index 6b617565..1853e626 100755
--- a/grpc/tools/gcp/utils/big_query_utils.py
+++ b/grpc/tools/gcp/utils/big_query_utils.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python2.7
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,10 +17,10 @@ from __future__ import print_function
import argparse
import json
import uuid
-import httplib2
from apiclient import discovery
from apiclient.errors import HttpError
+import httplib2
from oauth2client.client import GoogleCredentials
# 30 days in milliseconds
diff --git a/grpc/tools/github/pr_latency.py b/grpc/tools/github/pr_latency.py
deleted file mode 100644
index efd57f93..00000000
--- a/grpc/tools/github/pr_latency.py
+++ /dev/null
@@ -1,210 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Measure the time between PR creation and completion of all tests.
-
-You'll need a github API token to avoid being rate-limited. See
-https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
-
-This script goes over the most recent 100 pull requests. For PRs with a single
-commit, it uses the PR's creation as the initial time; otherwise, it uses the
-date of the last commit. This is somewhat fragile, and imposed by the fact that
-GitHub reports a PR's updated timestamp for any event that modifies the PR (e.g.
-comments), not just the addition of new commits.
-
-In addition, it ignores latencies greater than five hours, as that's likely due
-to a manual re-run of tests.
-"""
-
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
-import json
-import logging
-import pprint
-import urllib2
-
-from datetime import datetime, timedelta
-
-logging.basicConfig(format='%(asctime)s %(message)s')
-
-PRS = 'https://api.github.com/repos/grpc/grpc/pulls?state=open&per_page=100'
-COMMITS = 'https://api.github.com/repos/grpc/grpc/pulls/{pr_number}/commits'
-
-
-def gh(url):
- request = urllib2.Request(url)
- if TOKEN:
- request.add_header('Authorization', 'token {}'.format(TOKEN))
- response = urllib2.urlopen(request)
- return response.read()
-
-
-def print_csv_header():
- print('pr,base_time,test_time,latency_seconds,successes,failures,errors')
-
-
-def output(pr,
- base_time,
- test_time,
- diff_time,
- successes,
- failures,
- errors,
- mode='human'):
- if mode == 'human':
- print(
- "PR #{} base time: {} UTC, Tests completed at: {} UTC. Latency: {}."
- "\n\tSuccesses: {}, Failures: {}, Errors: {}".format(
- pr, base_time, test_time, diff_time, successes, failures,
- errors))
- elif mode == 'csv':
- print(','.join([
- str(pr),
- str(base_time),
- str(test_time),
- str(int((test_time - base_time).total_seconds())),
- str(successes),
- str(failures),
- str(errors)
- ]))
-
-
-def parse_timestamp(datetime_str):
- return datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%SZ')
-
-
-def to_posix_timestamp(dt):
- return str((dt - datetime(1970, 1, 1)).total_seconds())
-
-
-def get_pr_data():
- latest_prs = json.loads(gh(PRS))
- res = [{
- 'number': pr['number'],
- 'created_at': parse_timestamp(pr['created_at']),
- 'updated_at': parse_timestamp(pr['updated_at']),
- 'statuses_url': pr['statuses_url']
- } for pr in latest_prs]
- return res
-
-
-def get_commits_data(pr_number):
- commits = json.loads(gh(COMMITS.format(pr_number=pr_number)))
- return {
- 'num_commits':
- len(commits),
- 'most_recent_date':
- parse_timestamp(commits[-1]['commit']['author']['date'])
- }
-
-
-def get_status_data(statuses_url, system):
- status_url = statuses_url.replace('statuses', 'status')
- statuses = json.loads(gh(status_url + '?per_page=100'))
- successes = 0
- failures = 0
- errors = 0
- latest_datetime = None
- if not statuses:
- return None
- if system == 'kokoro':
- string_in_target_url = 'kokoro'
- elif system == 'jenkins':
- string_in_target_url = 'grpc-testing'
- for status in statuses['statuses']:
- if not status['target_url'] or string_in_target_url not in status[
- 'target_url']:
- continue # Ignore jenkins
- if status['state'] == 'pending':
- return None
- elif status['state'] == 'success':
- successes += 1
- elif status['state'] == 'failure':
- failures += 1
- elif status['state'] == 'error':
- errors += 1
- if not latest_datetime:
- latest_datetime = parse_timestamp(status['updated_at'])
- else:
- latest_datetime = max(latest_datetime,
- parse_timestamp(status['updated_at']))
- # First status is the most recent one.
- if any([successes, failures, errors
- ]) and sum([successes, failures, errors]) > 15:
- return {
- 'latest_datetime': latest_datetime,
- 'successes': successes,
- 'failures': failures,
- 'errors': errors
- }
- else:
- return None
-
-
-def build_args_parser():
- import argparse
- parser = argparse.ArgumentParser()
- parser.add_argument('--format',
- type=str,
- choices=['human', 'csv'],
- default='human',
- help='Output format: are you a human or a machine?')
- parser.add_argument('--system',
- type=str,
- choices=['jenkins', 'kokoro'],
- required=True,
- help='Consider only the given CI system')
- parser.add_argument(
- '--token',
- type=str,
- default='',
- help='GitHub token to use its API with a higher rate limit')
- return parser
-
-
-def main():
- import sys
- global TOKEN
- args_parser = build_args_parser()
- args = args_parser.parse_args()
- TOKEN = args.token
- if args.format == 'csv':
- print_csv_header()
- for pr_data in get_pr_data():
- commit_data = get_commits_data(pr_data['number'])
- # PR with a single commit -> use the PRs creation time.
- # else -> use the latest commit's date.
- base_timestamp = pr_data['updated_at']
- if commit_data['num_commits'] > 1:
- base_timestamp = commit_data['most_recent_date']
- else:
- base_timestamp = pr_data['created_at']
- last_status = get_status_data(pr_data['statuses_url'], args.system)
- if last_status:
- diff = last_status['latest_datetime'] - base_timestamp
- if diff < timedelta(hours=5):
- output(pr_data['number'],
- base_timestamp,
- last_status['latest_datetime'],
- diff,
- last_status['successes'],
- last_status['failures'],
- last_status['errors'],
- mode=args.format)
-
-
-if __name__ == '__main__':
- main()
diff --git a/grpc/tools/internal_ci/helper_scripts/delete_nonartifacts.sh b/grpc/tools/internal_ci/helper_scripts/delete_nonartifacts.sh
deleted file mode 100755
index 01e9427e..00000000
--- a/grpc/tools/internal_ci/helper_scripts/delete_nonartifacts.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2018 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.
-
-set -ex
-
-# change to grpc repo root
-cd "$(dirname "$0")/../../.."
-
-# After kokoro build finishes, the workspace gets rsync'ed to another machine,
-# from where the artifacts and reports are processed.
-# Especially on Windows, the rsync can take long time, so we cleanup the workspace
-# after finishing each build. We only leave files we want to keep:
-# - reports and artifacts
-# - directory containing the kokoro scripts to prevent deleting a script while being executed.
-time find . -type f -not -iname "*sponge_log.*" -not -path "./reports/*" -not -path "./artifacts/*" -not -path "./tools/internal_ci/*" -exec rm -f {} +
diff --git a/grpc/tools/internal_ci/helper_scripts/install_python_interpreters.ps1 b/grpc/tools/internal_ci/helper_scripts/install_python_interpreters.ps1
index 9885adc3..262f93b4 100644
--- a/grpc/tools/internal_ci/helper_scripts/install_python_interpreters.ps1
+++ b/grpc/tools/internal_ci/helper_scripts/install_python_interpreters.ps1
@@ -63,34 +63,51 @@ function Install-Python {
# Python 3.8
$Python38x86Config = @{
- PythonVersion = "3.8.0"
- PythonInstaller = "python-3.8.0"
+ PythonVersion = "3.8.10"
+ PythonInstaller = "python-3.8.10"
PythonInstallPath = "C:\Python38_32bit"
- PythonInstallerHash = "412a649d36626d33b8ca5593cf18318c"
+ PythonInstallerHash = "b355cfc84b681ace8908ae50908e8761"
}
Install-Python @Python38x86Config
$Python38x64Config = @{
- PythonVersion = "3.8.0"
- PythonInstaller = "python-3.8.0-amd64"
+ PythonVersion = "3.8.10"
+ PythonInstaller = "python-3.8.10-amd64"
PythonInstallPath = "C:\Python38"
- PythonInstallerHash = "29ea87f24c32f5e924b7d63f8a08ee8d"
+ PythonInstallerHash = "62cf1a12a5276b0259e8761d4cf4fe42"
}
Install-Python @Python38x64Config
# Python 3.9
$Python39x86Config = @{
- PythonVersion = "3.9.0"
- PythonInstaller = "python-3.9.0"
+ PythonVersion = "3.9.11"
+ PythonInstaller = "python-3.9.11"
PythonInstallPath = "C:\Python39_32bit"
- PythonInstallerHash = "4a2812db8ab9f2e522c96c7728cfcccb"
+ PythonInstallerHash = "4210652b14a030517046cdf111c09c1e"
}
Install-Python @Python39x86Config
$Python39x64Config = @{
- PythonVersion = "3.9.0"
- PythonInstaller = "python-3.9.0-amd64"
+ PythonVersion = "3.9.11"
+ PythonInstaller = "python-3.9.11-amd64"
PythonInstallPath = "C:\Python39"
- PythonInstallerHash = "b61a33dc28f13b561452f3089c87eb63"
+ PythonInstallerHash = "fef52176a572efd48b7148f006b25801"
}
Install-Python @Python39x64Config
+
+# Python 3.10
+$Python310x86Config = @{
+ PythonVersion = "3.10.3"
+ PythonInstaller = "python-3.10.3"
+ PythonInstallPath = "C:\Python310_32bit"
+ PythonInstallerHash = "6a336cb2aca62dd05805316ab3aaf2b5"
+}
+Install-Python @Python310x86Config
+
+$Python310x64Config = @{
+ PythonVersion = "3.10.3"
+ PythonInstaller = "python-3.10.3-amd64"
+ PythonInstallPath = "C:\Python310"
+ PythonInstallerHash = "9ea305690dbfd424a632b6a659347c1e"
+}
+Install-Python @Python310x64Config
diff --git a/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself.bat b/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself.bat
new file mode 100644
index 00000000..8566ff0e
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself.bat
@@ -0,0 +1,66 @@
+@rem Copyright 2021 The gRPC Authors
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+@rem Call this script at the beginning of your CI script to move
+@rem the entire source tree to a different directory.
+@rem That avoids slow finalization (and a number of other problems)
+@rem caused by kokoro rsyncing the entire /tmpfs/src directory
+@rem back to the agent.
+@rem Since batch scripts don't support the "source" unix command,
+@rem invoking this script is a bit trickier than on unix.
+@rem This script should be invoked from the CI script like this:
+@rem Note that honoring the pattern (including e.g. EnableDelayedExpansion)
+@rem is critical for correctly propagating the exitcode.
+@rem TODO(jtattermusch): find a way to simplify the invocation of the respawn script.
+@rem
+@rem setlocal EnableDelayedExpansion
+@rem IF "%cd%"=="T:\src" (
+@rem call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+@rem echo respawn script has finished with exitcode !errorlevel!
+@rem exit /b !errorlevel!
+@rem )
+@rem endlocal
+
+
+@echo off
+
+@rem CI script path needs to be passed as arg1.
+set CI_SCRIPT_RELATIVE_TO_SRC=%1
+
+@rem Check that this script was invoked under correct circumstances.
+IF NOT "%cd%"=="T:\src" (
+ @echo "Error: Current directory must be T:\src when invoking move_src_tree_and_respawn_itself.bat"
+ exit /b 1
+)
+
+@rem T:\ is equivalent to /tmpfs on kokoro linux.
+echo "Moving workspace from T:\src to T:\altsrc and respawning the CI script."
+cd /d T:\
+@rem We cannot simply rename "src" to "altsrc" as on linux since the currently running batch file is in it
+@rem and windows holds a lock that prevents moving the dir.
+bash -c "set -ex; mkdir -p altsrc; time cp -r src/github altsrc;"
+@rem Delete files we can under the original "src/github" directory, skipping the directory that contains CI scripts
+@rem (as on of the scripts is currently running and cannot be deleted)
+@rem We don't want to delete files in "src" outside of "src/github" since they contain e.g kokoro input artifacts.
+bash -c "set -ex; cd src/github; time find . -type f -not -path './grpc/tools/internal_ci/*' -exec rm -f {} +; ls grpc"
+cd altsrc
+
+@rem scripts in tools/run_tests generate test reports and we need to make sure these reports
+@rem land in a directory that is going to be rsynced back to the kokoro agent.
+set GRPC_TEST_REPORT_BASE_DIR=T:\src\github\grpc
+
+echo "Invoking original CI script now."
+@echo on
+call "%CI_SCRIPT_RELATIVE_TO_SRC%"
+exit /b %errorlevel%
diff --git a/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc b/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
new file mode 100644
index 00000000..ad915d68
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+# Source this rc script at the beginning of your CI script to move
+# the entire source tree to a different directory.
+# That avoids slow finalization (and a number of other problems)
+# caused by kokoro rsyncing the entire /tmpfs/src directory
+# back to the agent.
+# See b/74837748 for more context.
+
+set -ex
+
+CURRENT_DIR="$(pwd)"
+CI_SCRIPT_RELATIVE_TO_SRC="$0"
+
+if [ "${CURRENT_DIR}" == "/tmpfs/altsrc" ]
+then
+ # we already respawned under /tmpfs/altsrc, no need to do anything
+ echo "Successfully respawned the CI script ${CI_SCRIPT_RELATIVE_TO_SRC} under ${CURRENT_DIR}."
+ # scripts in tools/run_tests generate test reports and we need to make sure these reports
+ # land in a directory that is going to be rsynced back to the kokoro agent.
+ export GRPC_TEST_REPORT_BASE_DIR="/tmpfs/src/github/grpc"
+elif [ "${CURRENT_DIR}" == "/tmpfs/src" ]
+then
+ # we need to respawn now
+ # - step out of current directory
+ # - rename src/github to altsrc/github (/tmpfs/src is the directory that gets rsynced back to kokoro agent once the CI script finishes).
+ # Note that we don't want to move the entire /tmpfs/src tree (which contains e.g. the input artifacts as well,
+ # and their path is referenced by kokoro env variables), just /tmpfs/src/github
+ # which contains all the cloned github repositories (=our workspace in which the build happens)
+ echo "Moving workspace from /tmpfs/src to /tmpfs/altsrc and respawning the CI script."
+ # once "exec bash" starts, the CI script in the original location will no longer be in use and it will be safe to move
+ # the entire "/tmpfs/src/github" tree (moving the bash script file while running is probably safe anyway on unix, but it doesn't
+ # hurt to be extra careful)
+ exec bash -c "set -ex; cd /tmpfs; mkdir -p altsrc; mv src/github altsrc; cd altsrc; exec '${CI_SCRIPT_RELATIVE_TO_SRC}'"
+else
+ # avoid messing with the workspace if we don't see the directory layout
+ # that's standard on kokoro (in case this script gets accidentally invoked outside of kokoro)
+ echo "Looks the script is currently not running on kokoro, skipping respawn and continuing the original CI script."
+fi
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_interop_rc b/grpc/tools/internal_ci/helper_scripts/prepare_build_interop_rc
index 03105d9a..75a95406 100644
--- a/grpc/tools/internal_ci/helper_scripts/prepare_build_interop_rc
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_interop_rc
@@ -23,12 +23,13 @@ export DOCKERHUB_ORGANIZATION=grpctesting
git submodule update --init
-# Set up gRPC-Go and gRPC-Java to test
-git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
-git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
-git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node
-git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart
-git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet
+# Clone repositories for languages tested by the interop test suite
+# Also show the current commit SHA that will be tested.
+git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go && (cd ../grpc-go; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java && (cd ../grpc-java; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node && (cd ../grpc-node; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart && (cd ../grpc-dart; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet && (cd ../grpc-dotnet; git rev-parse HEAD)
# Grab the service account key to run interop tests against prod backends.
mkdir ~/service_account
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_rc b/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_rc
index 0a4a8491..01e9dd71 100644
--- a/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_rc
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_rc
@@ -40,3 +40,5 @@ fi
export DOCKERHUB_ORGANIZATION=grpctesting
git submodule update --init
+
+python3 -m pip install six
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc b/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc
new file mode 100644
index 00000000..fc9910a0
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc
@@ -0,0 +1,46 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+# Source this rc script to load RVM and prepare the ruby environment
+# for building ruby artifacts.
+
+# sourcing rvm can generate a failure and we don't want to quit there
+set +ex
+# Look for rvm either in /etc/profile.d or in $HOME
+# shellcheck disable=SC1091
+[[ -s /etc/profile.d/rvm.sh ]] && source /etc/profile.d/rvm.sh
+# shellcheck disable=SC1090
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
+
+# rvm commands are very verbose and we dont want to pollute the log by echo,
+# but we want to exit if there's a failure
+set -e
+
+echo "rvm install ruby-2.5.7"
+time rvm install ruby-2.5.7
+echo "rvm --default use ruby-2.5.7"
+rvm --default use ruby-2.5.7
+
+# restore the original echo and exit on failure behavior
+set -ex
+
+# print current ruby version to log
+ruby --version
+
+# Bundler is required for grpc ruby artifact build.
+gem install bundler -v 1.17.3
+
+# log gem versions for easier debugging if things go wrong
+gem list || true
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc b/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
index cbc3ef2d..995f4856 100644
--- a/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
@@ -17,9 +17,9 @@
# builds. This rc script must be used in the root directory of gRPC
# and is expected to be used before prepare_build_macos_rc
-# Set up gRPC-Go and gRPC-Java to test
-git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
-git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
-git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node
-git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart
-git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet
+# Clone repositories for languages tested by the interop test suite
+git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go && (cd ../grpc-go; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java && (cd ../grpc-java; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node && (cd ../grpc-node; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart && (cd ../grpc-dart; git rev-parse HEAD)
+git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet && (cd ../grpc-dotnet; git rev-parse HEAD)
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_rc
index 6ea523cb..8e68b31b 100644
--- a/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_rc
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_macos_rc
@@ -1,4 +1,4 @@
-#!/bin/bash -ex
+#!/bin/bash
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +14,19 @@
# limitations under the License.
# Source this rc script to prepare the environment for macos builds
+# Print basic info about the mac worker
+echo "kokoro pool: \"$KOKORO_JOB_POOL\""
+echo "OS: $(sw_vers -productName) $(sw_vers -productVersion) $(sw_vers -buildVersion)"
+echo "CPU type: $(sysctl -n machdep.cpu.brand_string)"
+echo "CPU: $(sysctl -n machdep.cpu.vendor) $(uname -m) Family $(sysctl -n machdep.cpu.family) Model $(sysctl -n machdep.cpu.brand_string)"
+echo "CPU Cores: $(sysctl -n hw.ncpu)"
+echo "Memory: $(sysctl -n hw.memsize)"
+echo "Kokoro image version: $(cat /VERSION)"
+
+# Info on disk usage and mounted volumes
+mount
+df -h /tmpfs /
+
# show original open file limit values
launchctl limit maxfiles
ulimit -a
@@ -35,7 +48,7 @@ export HOMEBREW_NO_AUTO_UPDATE=1
brew config
# Add GCP credentials for BQ access
-pip install --user google-api-python-client oauth2client six==1.15.0
+pip install --user google-api-python-client oauth2client six==1.16.0
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
@@ -46,28 +59,39 @@ fi
if [ "${PREPARE_BUILD_INSTALL_DEPS_RUBY}" == "true" ]
then
+ # Workaround for https://github.com/rvm/rvm/issues/5133
+ export CURL_CA_BUNDLE=$(pwd)/etc/roots.pem
+
# Fetch keys per https://rvm.io/rvm/install
- # Force use of an IPv4 key server to avoid running into https://github.com/rvm/rvm/issues/4215
gpg_recv_keys_success=0
for ((i=0;i<5;i++)); do
- KEYSERVER_IPV4_ADDRESS="$(host pool.sks-keyservers.net | grep 'has address' | head -n1 | awk '{print $4}')"
- gpg --keyserver "hkp://${KEYSERVER_IPV4_ADDRESS}" --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
+ # Use the Ubuntu keyserver instead of pool.sks-keyservers.net because sks-keyservers is now deprecated.
+ GPG_KEYSERVER_ADDRESS="keyserver.ubuntu.com"
+ gpg --keyserver "hkp://${GPG_KEYSERVER_ADDRESS}" --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
&& gpg_recv_keys_success=1
[[ "$gpg_recv_keys_success" == 1 ]] && break
sleep 3
done
[[ "$gpg_recv_keys_success" == 1 ]] || exit 1
rvm get stable # Per https://stackoverflow.com/questions/65477613/rvm-where-is-ruby-3-0-0
+ # stop echoing bash commands temporarily to prevent rvm from polluting the logs
+ set +x
source $HOME/.rvm/scripts/rvm
- for RUBY_VERSION in 2.5.0 2.7.0 3.0.0; do
+
+ for RUBY_VERSION in 2.5.0 2.7.0 3.0.0 3.1.0; do
+ echo "Installing ruby-${RUBY_VERSION}"
time rvm install "ruby-${RUBY_VERSION}"
- time gem install bundler -v 1.17.3 --no-document
- time gem install rake-compiler --no-document
done;
+ echo "Setting default ruby version."
rvm use 2.5.0 --default
+ echo "Installing cocoapods."
time gem install cocoapods --version 1.3.1 --no-document
+ echo "Updating osx-ssl-certs."
rvm osx-ssl-certs status all
rvm osx-ssl-certs update all
+
+ # restore echo
+ set -x
fi
if [ "${PREPARE_BUILD_INSTALL_DEPS_OBJC}" == "true" ]
@@ -100,28 +124,40 @@ then
time pip install --user -r $DIR/requirements.macos.txt
time pip install --user --upgrade virtualenv Mako tox setuptools==44.1.1 twisted
- # Install Python 3.7 if it doesn't exist
- if [ ! -f "/usr/local/bin/python3.7" ]; then
- time curl -O https://www.python.org/ftp/python/3.7.0/python-3.7.0-macosx10.9.pkg
- echo "ee4ad46ab8cd226ffc8df56d48acfdf7daa2714a9c51e6dc6262fc0b25519578 python-3.7.0-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
- shasum -c /tmp/python_installer_checksum.sha256
- time sudo installer -pkg ./python-3.7.0-macosx10.9.pkg -target /
- fi
+ # Force reinstall of python3.7 to upgrade its patch version.
+ # Kokoro mac workers come with python 3.7.3 and that version
+ # suffers from https://bugs.python.org/issue22490.
+ # See https://github.com/grpc/grpc/pull/28963.
+ time curl -O https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg
+ echo "bf54a14eef23467991e8c7a88c7307762e484c024a94ec1ee292ac1db3d41fc9 python-3.7.9-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
+ shasum -c /tmp/python_installer_checksum.sha256
+ time sudo installer -pkg ./python-3.7.9-macosx10.9.pkg -target /
+ python3.7 --version
+
+ # Force reinstall of python3.8 to upgrade its patch version.
+ # Kokoro mac workers come with python 3.8.2 and that version
+ # suffers from https://bugs.python.org/issue22490.
+ # See https://github.com/grpc/grpc/pull/28963.
+ time curl -O https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg
+ echo "4c65bc7534d5f07edacbe0fbd609b5734dbf3ac02f5444f9bd97963d589d8afd python-3.8.10-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
+ shasum -c /tmp/python_installer_checksum.sha256
+ time sudo installer -pkg ./python-3.8.10-macosx10.9.pkg -target /
+ python3.8 --version
- # Install Python 3.8 if it doesn't exist
- if [ ! -f "/usr/local/bin/python3.8" ]; then
- time curl -O https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg
- echo "30961fe060da9dc5afdc4e789a57fe9bcc0d20244474e9f095d7bfc89d2e1869 python-3.8.0-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
+ # Install Python 3.9 if it doesn't exist
+ if [ ! -f "/usr/local/bin/python3.9" ]; then
+ time curl -O https://www.python.org/ftp/python/3.9.10/python-3.9.10-macosx10.9.pkg
+ echo "732bc5c95ae127dfb6fb1bcf683509ad20c558152b63b8d5f651246f6bdfc8da python-3.9.10-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
shasum -c /tmp/python_installer_checksum.sha256
- time sudo installer -pkg ./python-3.8.0-macosx10.9.pkg -target /
+ time sudo installer -pkg ./python-3.9.10-macosx10.9.pkg -target /
fi
- # Install Python 3.9 if it doesn't exist
- if [ ! -f "/usr/local/bin/python3.9" ]; then
- time curl -O https://www.python.org/ftp/python/3.9.0/python-3.9.0-macosx10.9.pkg
- echo "dadee1d10c1a8ed58bb64ec7409a48c9fe38599791eaaea29303ee59fb95dfeb python-3.9.0-macosx10.9.pkg" > /tmp/python_installer_checksum.sha256
+ # Install Python 3.10 if it doesn't exist
+ if [ ! -f "/usr/local/bin/python3.10" ]; then
+ time curl -O https://www.python.org/ftp/python/3.10.2/python-3.10.2-macos11.pkg
+ echo "22dd9a45718a99d77398312da6ac720c4968bae7a854da4da3a3986f6d3478f8 python-3.10.2-macos11.pkg" > /tmp/python_installer_checksum.sha256
shasum -c /tmp/python_installer_checksum.sha256
- time sudo installer -pkg ./python-3.9.0-macosx10.9.pkg -target /
+ time sudo installer -pkg ./python-3.10.2-macos11.pkg -target /
fi
fi
@@ -131,16 +167,36 @@ then
export NUGET_XMLDOC_MODE=skip
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
export DOTNET_CLI_TELEMETRY_OPTOUT=true
+
+ # Installed versions should be kept in sync with
+ # templates/tools/dockerfile/csharp_dotnetcli_deps.include
+ time curl -O https://download.visualstudio.microsoft.com/download/pr/e0fe8c99-e33c-4d75-bd4e-2478ed3ee35a/ff06e47afc7c13bdbbaa50a9713ac772/dotnet-sdk-3.1.415-osx-x64.pkg
+ time sudo installer -pkg ./dotnet-sdk-3.1.415-osx-x64.pkg -target /
+
+ time curl -O https://download.visualstudio.microsoft.com/download/pr/14a45451-4cc9-48e1-af69-0aff75891d09/ff6e83986a2a9a535015fb3104a90a1b/dotnet-sdk-6.0.100-osx-x64.pkg
+ time sudo installer -pkg ./dotnet-sdk-6.0.100-osx-x64.pkg -target /
fi
if [ "${PREPARE_BUILD_INSTALL_DEPS_PHP}" == "true" ]
then
- # Install PHP 7.2 explictly to address missing php header files and
- # to work well with the pre-installed phpunit 8.4
- brew install php@7.2
- export LDFLAGS="-L/usr/local/opt/php@7.2/lib $(LDFLAGS)"
- export CPPFLAGS="-I/usr/local/opt/php@7.2/include $(CPPFLAGS)"
- export PATH="/usr/local/opt/php@7.2/bin:/usr/local/opt/php@7.2/sbin:$PATH"
+ # It's required to update homebrew because it won't work with the default version Kokoro has.
+ # This can be fragile though because the future version of brew can break - consider pinning
+ # the formulas if that happens (see https://github.com/grpc/grpc/pull/24837).
+ brew update || true
+ # macos mojave support for php7.3 brew formula removed MacOS Mojave support here: https://github.com/Homebrew/homebrew-core/commit/d8496609d310a233bfb46272ec7948845f32d7c5#diff-df64282b6e4230b6f35468dfbbd500fcd62b0f93b01b2b161e92f512b7feb1a3
+ # so we need earlier version of the formulata than that. See https://github.com/grpc/grpc/pull/24837 for an example of pinning homebrew formulas to a specific commit.
+ (cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core; git checkout 10b1944581fbbdc216057fd70e89dbbe3d04161e)
+ brew config
+
+ brew install php@7.3 || true
+ export LDFLAGS="-L/usr/local/opt/php@7.3/lib ${LDFLAGS}"
+ export CPPFLAGS="-I/usr/local/opt/php@7.3/include ${CPPFLAGS}"
+ export PATH="/usr/local/opt/php@7.3/bin:/usr/local/opt/php@7.3/sbin:${PATH}"
+
+ # the exit code from "brew install php@7.3" is useless
+ # so instead we check if PHP was indeed installed successfully.
+ # Failing early is better than cryptic errors later in the build process.
+ /usr/local/opt/php@7.3/bin/php --version
# Workaround for https://github.com/Homebrew/homebrew-core/issues/41081
mkdir -p /usr/local/lib/php/pecl
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_build_windows.bat b/grpc/tools/internal_ci/helper_scripts/prepare_build_windows.bat
index fdc7b096..2a4ab062 100644
--- a/grpc/tools/internal_ci/helper_scripts/prepare_build_windows.bat
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_build_windows.bat
@@ -12,10 +12,20 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
+@rem allow timing of how long the script takes to run.
+echo "!TIME!: prepare_build_windows.bat started"
+
@rem make sure msys binaries are preferred over cygwin binaries
-@rem set path to python 2.7
+@rem set path to python3.7
@rem set path to CMake
-set PATH=C:\tools\msys64\usr\bin;C:\Python27;C:\Program Files\CMake\bin;%PATH%
+set PATH=C:\tools\msys64\usr\bin;C:\Python37;C:\Program Files\CMake\bin;%PATH%
+
+@rem create "python3" link that normally doesn't exist
+dir C:\Python37\
+mklink C:\Python37\python3.exe C:\Python37\python.exe
+
+python --version
+python3 --version
@rem If this is a PR using RUN_TESTS_FLAGS var, then add flags to filter tests
if defined KOKORO_GITHUB_PULL_REQUEST_NUMBER if defined RUN_TESTS_FLAGS (
@@ -29,26 +39,59 @@ netsh interface ip set dns "Local Area Connection 8" static 169.254.169.254 prim
netsh interface ip add dnsservers "Local Area Connection 8" 8.8.8.8 index=2
netsh interface ip add dnsservers "Local Area Connection 8" 8.8.4.4 index=3
-@rem Needed for big_query_utils
-python -m pip install google-api-python-client || goto :error
+@rem Uninstall protoc so that it doesn't clash with C++ distribtests.
+@rem (on grpc-win2016 kokoro workers it can result in GOOGLE_PROTOBUF_MIN_PROTOC_VERSION violation)
+choco uninstall protoc -y --limit-output
-@rem C# prerequisites: Install dotnet SDK
-powershell -File src\csharp\install_dotnet_sdk.ps1 || goto :error
-set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
+@rem Install nasm (required for boringssl assembly optimized build as boringssl no long supports yasm)
+@rem Downloading from GCS should be very reliables when on a GCP VM.
+mkdir C:\nasm
+curl -sSL --fail -o C:\nasm\nasm.exe https://storage.googleapis.com/grpc-build-helper/nasm-2.15.05/nasm.exe || goto :error
+set PATH=C:\nasm;%PATH%
+nasm
+
+@rem Install ccache
+mkdir C:\ccache
+curl -sSL --fail -o C:\ccache\ccache.exe https://storage.googleapis.com/grpc-build-helper/ccache-4.6-windows-64/ccache.exe || goto :error
+set PATH=C:\ccache;%PATH%
+ccache --version
-@rem Disable some unwanted dotnet options
+@rem Only install C# dependencies if we are running C# tests
+If "%PREPARE_BUILD_INSTALL_DEPS_CSHARP%" == "true" (
+ @rem C# prerequisites: Install dotnet SDK
+ powershell -File src\csharp\install_dotnet_sdk.ps1 || goto :error
+
+ @rem Explicitly add default nuget source.
+ @rem (on Kokoro grpc-win2016 workers, the default nuget source is not configured,
+ @rem which results in errors when "dotnet restore" is run)
+ %LOCALAPPDATA%\Microsoft\dotnet\dotnet nuget add source https://api.nuget.org/v3/index.json -n "nuget.org"
+)
+
+@rem Add dotnet on path and disable some unwanted dotnet
+@rem option regardless of PREPARE_BUILD_INSTALL_DEPS_CSHARP value.
+@rem Always setting the env vars is fine since its instantaneous,
+@rem it can't fail and it avoids possible issues with
+@rem "setlocal" and "EnableDelayedExpansion" which would be required if
+@rem we wanted to do the same under the IF block.
+set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
set NUGET_XMLDOC_MODE=skip
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
set DOTNET_CLI_TELEMETRY_OPTOUT=true
@rem Only install Python interpreters if we are running Python tests
If "%PREPARE_BUILD_INSTALL_DEPS_PYTHON%" == "true" (
- powershell -File tools\internal_ci\helper_scripts\install_python_interpreters.ps1 || goto :error
+ echo "!TIME!: invoking install_python_interpreters.ps1"
+ powershell -File tools\internal_ci\helper_scripts\install_python_interpreters.ps1 || goto :error
)
+@rem Needed for uploading test results to bigquery
+python -m pip install google-api-python-client oauth2client six==1.16.0 || goto :error
+
git submodule update --init || goto :error
+echo "!TIME!: prepare_build_windows.bat exiting with success"
goto :EOF
:error
+echo "!TIME!: prepare_build_windows.bat exiting with error"
exit /b 1
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_ccache.bat b/grpc/tools/internal_ci/helper_scripts/prepare_ccache.bat
new file mode 100644
index 00000000..f52aeb44
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_ccache.bat
@@ -0,0 +1,21 @@
+@rem Copyright 2022 The gRPC Authors
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+@rem Call this script to configure ccache (compiler cache to speed up builds)
+
+@rem Allow use of ccache in builds that support that.
+set GRPC_BUILD_ENABLE_CCACHE=true
+
+@rem Redis instance housed in grpc-testing cloud project serves as the main compiler cache
+set CCACHE_SECONDARY_STORAGE=redis://10.76.145.84:6379
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_ccache_rc b/grpc/tools/internal_ci/helper_scripts/prepare_ccache_rc
new file mode 100644
index 00000000..031df5e5
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_ccache_rc
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Copyright 2022 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.
+
+# Source this rc script to configure ccache (compiler cache to speed up builds)
+
+# Allow use of ccache in builds that support that.
+export GRPC_BUILD_ENABLE_CCACHE=true
+
+# Redis instance housed in grpc-testing cloud project serves as the main compiler cache
+export CCACHE_SECONDARY_STORAGE=redis://10.76.145.84:6379
diff --git a/grpc/tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc b/grpc/tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc
new file mode 100644
index 00000000..ec06363c
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Copyright 2022 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.
+
+# Source this rc script to create symlinks to ccache
+
+if [ "${GRPC_BUILD_ENABLE_CCACHE}" != "" ] && [ "${GRPC_BUILD_ENABLE_CCACHE}" != "false" ] && [ "${GRPC_BUILD_ENABLE_CCACHE}" != "0" ]
+then
+ if [ -x "$(command -v ccache)" ]
+ then
+ SUPPORTED_COMPILERS=(
+ # common compiler binaries
+ "gcc"
+ "g++"
+ "clang"
+ "clang++"
+ "cc"
+ "c++"
+ # ruby artifacts: rake-compiler-dock crosscompilers
+ # TODO(jtattermusch): ensure that the list of ruby crosscompilers stays up to date.
+ "x86_64-redhat-linux-gcc"
+ "x86_64-redhat-linux-g++"
+ "i686-redhat-linux-gcc"
+ "i686-redhat-linux-g++"
+ "x86_64-w64-mingw32-gcc"
+ "x86_64-w64-mingw32-g++"
+ "i686-w64-mingw32-gcc"
+ "i686-w64-mingw32-g++"
+ "x86_64-apple-darwin-clang"
+ "x86_64-apple-darwin-clang++"
+ "aarch64-apple-darwin-clang"
+ "aarch64-apple-darwin-clang++"
+ # python artifacts: dockcross crosscompilers
+ "aarch64-unknown-linux-gnueabi-gcc"
+ "aarch64-unknown-linux-gnueabi-g++"
+ "armv7-unknown-linux-gnueabi-gcc"
+ "armv7-unknown-linux-gnueabi-g++"
+ )
+ CCACHE_BINARY_PATH="$(command -v ccache)"
+ TEMP_CCACHE_BINDIR="$(mktemp -d)"
+
+ for compiler in "${SUPPORTED_COMPILERS[@]}"
+ do
+ # create a symlink pointing to ccache if compiler binary exists
+ if [ -x "$(command -v $compiler)" ]
+ then
+ ln -s "${CCACHE_BINARY_PATH}" "${TEMP_CCACHE_BINDIR}/${compiler}"
+ echo "Creating symlink $compiler pointing to ${CCACHE_BINARY_PATH}"
+ fi
+ done
+ echo "Adding ${TEMP_CCACHE_BINDIR} to PATH"
+ export PATH="${TEMP_CCACHE_BINDIR}:$PATH"
+ fi
+fi
diff --git a/grpc/tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh b/grpc/tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
new file mode 100755
index 00000000..858e3cbc
--- /dev/null
+++ b/grpc/tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+# If you have used "move_src_tree_and_respawn_itself_rc" in a CI script
+# and the script produces artifacts to be stored by kokoro, run this
+# at the end of the script.
+
+set -ex
+
+if [ "${GRPC_TEST_REPORT_BASE_DIR}" == "" ]
+then
+ # looks like the move_src_tree_and_respawn_itself_rc hasn't been used
+ # and we're not running under a moved source tree
+ exit 0
+fi
+
+# change to grpc repo root
+cd "$(dirname "$0")/../../.."
+
+# If running under a moved source tree (see grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc),
+# we need to copy the artifacts produced by the build to a location that's stored by kokoro.
+
+# artifacts in this directory will be stored by kokoro
+mkdir -p "${GRPC_TEST_REPORT_BASE_DIR}/artifacts"
+time cp -r artifacts/* "${GRPC_TEST_REPORT_BASE_DIR}/artifacts" || true
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_basictests_csharp.cfg b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_csharp.cfg
new file mode 100644
index 00000000..dfd3e27c
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_csharp.cfg
@@ -0,0 +1,30 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
+timeout_mins: 60
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
+
+env_vars {
+ key: "RUN_TESTS_FLAGS"
+ value: "-f basictests_arm64 linux csharp --inner_jobs 4 -j 1 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg
new file mode 100644
index 00000000..cda33bc6
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg
@@ -0,0 +1,30 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
+timeout_mins: 60
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
+
+env_vars {
+ key: "RUN_TESTS_FLAGS"
+ value: "-f basictests_arm64 linux php7 --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_basictests_python.cfg b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_python.cfg
new file mode 100644
index 00000000..f3038d8f
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_python.cfg
@@ -0,0 +1,30 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
+timeout_mins: 60
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
+
+env_vars {
+ key: "RUN_TESTS_FLAGS"
+ value: "-f basictests_arm64 linux python --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_basictests_ruby.cfg b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_ruby.cfg
new file mode 100644
index 00000000..4b6c9d28
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_basictests_ruby.cfg
@@ -0,0 +1,30 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
+timeout_mins: 60
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
+
+env_vars {
+ key: "RUN_TESTS_FLAGS"
+ value: "-f basictests_arm64 linux ruby --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
+}
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_bazel.sh b/grpc/tools/internal_ci/linux/arm64/grpc_bazel.sh
new file mode 100755
index 00000000..0503692a
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_bazel.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Copyright 2022 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.
+
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/bazel_arm64
+export DOCKER_RUN_SCRIPT=$BAZEL_SCRIPT
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp.cfg b/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp.cfg
new file mode 100644
index 00000000..38308432
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp.cfg
@@ -0,0 +1,23 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/arm64/grpc_bazel.sh"
+timeout_mins: 120
+env_vars {
+ key: "BAZEL_SCRIPT"
+ value: "tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp_in_docker.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp_in_docker.sh b/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp_in_docker.sh
new file mode 100755
index 00000000..f2fe8a72
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/arm64/grpc_bazel_test_c_cpp_in_docker.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Copyright 2022 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.
+
+set -ex
+
+mkdir -p /var/local/git
+git clone /var/local/jenkins/grpc /var/local/git/grpc
+(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
+&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
+${name}')
+cd /var/local/git/grpc
+
+# tests require port server to be running
+python3 tools/run_tests/start_port_server.py
+
+# test gRPC C/C++ with bazel
+tools/bazel test --config=opt --test_output=errors --test_tag_filters=-no_linux,-no_arm64 --build_tag_filters=-no_linux,-no_arm64 --flaky_test_attempts=1 --runs_per_test=1 //test/...
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_csharp.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_csharp.cfg
new file mode 100644
index 00000000..40b0745c
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_csharp.cfg
@@ -0,0 +1,36 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh"
+timeout_mins: 90
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
+env_vars {
+ key: "REMOTE_WORKLOAD_SCRIPT"
+ value: "tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_php.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_php.cfg
new file mode 100644
index 00000000..7ea04322
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_php.cfg
@@ -0,0 +1,36 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh"
+timeout_mins: 90
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
+env_vars {
+ key: "REMOTE_WORKLOAD_SCRIPT"
+ value: "tools/internal_ci/linux/aws/grpc_run_basictests_php_aarch64.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_python.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_python.cfg
new file mode 100644
index 00000000..b3360597
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_python.cfg
@@ -0,0 +1,36 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh"
+timeout_mins: 90
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
+env_vars {
+ key: "REMOTE_WORKLOAD_SCRIPT"
+ value: "tools/internal_ci/linux/aws/grpc_run_basictests_python_aarch64.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_ruby.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_ruby.cfg
new file mode 100644
index 00000000..46c47a9c
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_basictests_ruby.cfg
@@ -0,0 +1,36 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh"
+timeout_mins: 90
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
+env_vars {
+ key: "REMOTE_WORKLOAD_SCRIPT"
+ value: "tools/internal_ci/linux/aws/grpc_run_basictests_ruby_aarch64.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_bazel_test_c_cpp.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_bazel_test_c_cpp.cfg
new file mode 100644
index 00000000..58b7e94b
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_bazel_test_c_cpp.cfg
@@ -0,0 +1,36 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test_8core.sh"
+timeout_mins: 120
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
+env_vars {
+ key: "REMOTE_WORKLOAD_SCRIPT"
+ value: "tools/internal_ci/linux/aws/grpc_bazel_test_c_cpp_aarch64.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment.cfg b/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment.cfg
new file mode 100644
index 00000000..d6a9e24d
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment.cfg
@@ -0,0 +1,32 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh"
+timeout_mins: 90
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_aws_ec2_credentials"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment_remote.sh b/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment_remote.sh
new file mode 100755
index 00000000..a50811c9
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_experiment_remote.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python3 python3-pip clang
+
+python3 --version
+
+cd grpc
+
+# tests require port server to be running
+python3 tools/run_tests/start_port_server.py
+
+# build with bazel
+tools/bazel build --config=opt //test/...
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh b/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh
new file mode 100755
index 00000000..ad95eae2
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test.sh
@@ -0,0 +1,147 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+# WARNING: this script has been reviewed by the security team, so
+# any changes need to be made with great care.
+# Contact @jtattermusch or @amidlash if in doubt.
+
+# This script is responsible for remotely running tests on an ARM instance.
+# At the start, it provisions a new AWS ARM64 instance and then uses
+# it to execute a test script (and cleans up afterwards).
+# It should return a status code useful to the kokoro infrastructure.
+
+# TODO(jtattermusch): make the script safe to run under "set -ex"
+set -e
+
+if [ -z "$KOKORO_KEYSTORE_DIR" ]; then
+ echo "KOKORO_KEYSTORE_DIR is unset. This must be run from kokoro"
+ exit 1
+fi
+
+AWS_CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73836_grpc_aws_ec2_credentials
+
+# Setup aws cli
+curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
+unzip -q awscliv2.zip
+sudo ./aws/install
+aws --version
+
+# authenticate with aws cli
+mkdir ~/.aws/
+echo "[default]" >> ~/.aws/config
+ln -s $AWS_CREDENTIALS ~/.aws/credentials
+
+# setup instance
+sudo apt update && sudo apt install -y jq
+
+# ubuntu 18.04 lts(arm64)
+# https://aws.amazon.com/amazon-linux-ami/
+AWS_MACHINE_IMAGE=ami-026141f3d5c6d2d0c
+# use 4-core instance by default
+AWS_INSTANCE_TYPE=${AWS_INSTANCE_TYPE:-t4g.xlarge}
+AWS_SECURITY_GROUP=sg-021240e886feba750
+# Max allowed lifespan of the AWS instance. After this period of time, the instance will
+# self-terminate (delete itself). This is very important to ensure that there will
+# be no orphaned AWS instances if the initiating kokoro job fails / gets cancelled etc.
+AWS_INSTANCE_MAX_LIFESPAN_MINS=120
+# increase the size of the root volume so that builds don't run out of disk space
+AWS_STORAGE_SIZE_GB=75
+AWS_DEVICE_MAPPING="DeviceName='/dev/sda1',Ebs={VolumeSize=${AWS_STORAGE_SIZE_GB}}"
+AWS_INSTANCE_TAGS="ResourceType='instance',Tags=[{Key='kokoro_job_name',Value='${KOKORO_JOB_NAME}'},{Key='kokoro_build_number',Value='${KOKORO_BUILD_NUMBER}'},{Key='kokoro_aws_integration',Value='true'}]"
+
+ssh-keygen -N '' -t rsa -b 4096 -f ~/.ssh/temp_client_key
+ssh-keygen -N '' -t ecdsa -b 256 -f ~/.ssh/temp_server_key
+SERVER_PRIVATE_KEY=$(cat ~/.ssh/temp_server_key | sed 's/\(.*\)/ \1/')
+SERVER_PUBLIC_KEY=$(cat ~/.ssh/temp_server_key.pub | awk '{print $1 " " $2 " root@localhost"}')
+SERVER_HOST_KEY_ENTRY=$(cat ~/.ssh/temp_server_key.pub | awk '{print $1 " " $2}')
+CLIENT_PUBLIC_KEY=$(cat ~/.ssh/temp_client_key.pub)
+
+echo '#cloud-config' > userdata
+echo 'ssh_authorized_keys:' >> userdata
+echo " - $CLIENT_PUBLIC_KEY" >> userdata
+echo 'ssh_keys:' >> userdata
+echo ' ecdsa_private: |' >> userdata
+echo "$SERVER_PRIVATE_KEY" >> userdata
+echo " ecdsa_public: $SERVER_PUBLIC_KEY" >> userdata
+echo '' >> userdata
+echo 'runcmd:' >> userdata
+echo " - sleep ${AWS_INSTANCE_MAX_LIFESPAN_MINS}m" >> userdata
+echo ' - shutdown' >> userdata
+
+ID=$(aws ec2 run-instances --image-id $AWS_MACHINE_IMAGE --instance-initiated-shutdown-behavior=terminate \
+ --instance-type $AWS_INSTANCE_TYPE \
+ --security-group-ids $AWS_SECURITY_GROUP \
+ --user-data file://userdata \
+ --block-device-mapping "$AWS_DEVICE_MAPPING" \
+ --tag-specifications "$AWS_INSTANCE_TAGS" \
+ --region us-east-2 | jq .Instances[0].InstanceId | sed 's/"//g')
+echo "instance-id=$ID"
+echo "Waiting 1m for instance ip..."
+sleep 1m
+IP=$(aws ec2 describe-instances \
+ --instance-id=$ID \
+ --region us-east-2 | jq .Reservations[0].Instances[0].NetworkInterfaces[0].Association.PublicIp | sed 's/"//g')
+SERVER_HOST_KEY_ENTRY="$IP $SERVER_HOST_KEY_ENTRY"
+echo $SERVER_HOST_KEY_ENTRY >> ~/.ssh/known_hosts
+echo "Waiting 2m for instance to initialize..."
+sleep 2m
+
+echo "Copying workspace to remote instance..."
+# use rsync over ssh since it's much faster than scp
+time rsync -e "ssh -i ~/.ssh/temp_client_key" -a github/grpc ubuntu@$IP:~/workspace
+echo "Beginning CI workload..."
+
+# filename of the test script to execute remotely, relative to gRPC repository root
+# use a default value if the env variable is not set
+REMOTE_WORKLOAD_SCRIPT=${REMOTE_WORKLOAD_SCRIPT:-tools/internal_ci/linux/aws/grpc_aws_experiment_remote.sh}
+
+# run remote workload script in the background, with redirected stdout and stderr
+# to avoid problems with ssh session not closing after the remote script finishes
+# but stdout and stderr are still open because the remote has spawned subprocesses
+# that keep stdout and stderr open.
+# * PID of the process that executes the remote script will be stored in aws_build.pid
+# * stderr and stdout will be streamed to aws_build.log
+# * once done, the exitcode of the remote script will be in aws_build.exitcode
+REMOTE_WORKLOAD_COMMAND="nohup bash -c '(bash grpc/${REMOTE_WORKLOAD_SCRIPT}; echo \$? >/tmp/aws_build.exitcode) >>/tmp/aws_build.log 2>&1' >/dev/null 2>&1 & echo \$! >/tmp/aws_build.pid"
+
+# the tail command simply streams the contents of aws_build.log as they become available
+# and stops when the remote workload exits (determined based on the PID)
+SSH_COMMAND='uname -a; rm -f /tmp/aws_build.log /tmp/aws_build.exitcode /tmp/aws_build.pid; touch /tmp/aws_build.log; cd ~/workspace; '"${REMOTE_WORKLOAD_COMMAND};"' tail -f /tmp/aws_build.log --pid $(cat /tmp/aws_build.pid); exit $(cat /tmp/aws_build.exitcode)'
+
+REMOTE_SCRIPT_EXITCODE=0
+time ssh -i ~/.ssh/temp_client_key ubuntu@$IP "${SSH_COMMAND}" || REMOTE_SCRIPT_EXITCODE=$?
+
+echo "Copying artifacts from the remote instance..."
+ARTIFACT_RSYNC_PATTERN="**/*sponge_log.*"
+# NOTE: the include "*/" rule and --prune-empty-dirs are important for not
+# excluding parent directories that contain artifacts before they have
+# get a chance to be examined (see man rsync)
+COPY_ARTIFACTS_EXITCODE=0
+time rsync -av -e "ssh -i ~/.ssh/temp_client_key" --include="${ARTIFACT_RSYNC_PATTERN}" --include="*/" --exclude="*" --prune-empty-dirs ubuntu@$IP:~/workspace/grpc github || COPY_ARTIFACTS_EXITCODE=$?
+
+# Regardless of the remote script's result (success or failure), initiate shutdown of AWS instance a minute from now.
+# The small delay is useful to make sure the ssh session doesn't hang up on us if shutdown happens too quickly.
+echo "Shutting down instance $ID."
+ssh -i ~/.ssh/temp_client_key ubuntu@$IP "sudo shutdown +1" || echo "WARNING: Failed to initiate AWS instance shutdown."
+
+if [ "$REMOTE_SCRIPT_EXITCODE" == "0" ] && [ "$COPY_ARTIFACTS_EXITCODE" != "0" ]
+then
+ echo "Exiting with exitcode $COPY_ARTIFACTS_EXITCODE since remote script has passed, but copying artifacts has failed."
+ exit $COPY_ARTIFACTS_EXITCODE
+fi
+
+# Match exitcode
+echo "Exiting with exitcode $REMOTE_SCRIPT_EXITCODE based on remote script output."
+exit $REMOTE_SCRIPT_EXITCODE
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test_8core.sh b/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test_8core.sh
new file mode 100755
index 00000000..257d0831
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_aws_run_remote_test_8core.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -e
+
+AWS_INSTANCE_TYPE="t4g.2xlarge" "$(dirname $0)/grpc_aws_run_remote_test.sh"
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_bazel_test_c_cpp_aarch64.sh b/grpc/tools/internal_ci/linux/aws/grpc_bazel_test_c_cpp_aarch64.sh
new file mode 100755
index 00000000..ac33d715
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_bazel_test_c_cpp_aarch64.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python3 python3-pip clang
+
+python3 --version
+
+cd grpc
+
+# tests require port server to be running
+python3 tools/run_tests/start_port_server.py
+
+# test gRPC C/C++ with bazel
+tools/bazel test --config=opt --test_output=errors --test_tag_filters=-no_linux,-no_arm64 --build_tag_filters=-no_linux,-no_arm64 --flaky_test_attempts=1 --runs_per_test=1 //test/...
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh
new file mode 100755
index 00000000..6e58f554
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python python-pip clang
+sudo pip install six
+
+# install gRPC C# pre-requisites
+curl -sSL -o dotnet-install.sh https://dot.net/v1/dotnet-install.sh
+chmod u+x dotnet-install.sh
+# Installed .NET versions should be kept in sync with
+# templates/tools/dockerfile/csharp_dotnetcli_deps.include
+./dotnet-install.sh --channel 3.1
+./dotnet-install.sh --channel 6.0
+export PATH="$HOME/.dotnet:$PATH"
+
+# Disable some unwanted dotnet options
+export NUGET_XMLDOC_MODE=skip
+export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
+export DOTNET_CLI_TELEMETRY_OPTOUT=true
+
+dotnet --list-sdks
+
+cd grpc
+
+git submodule update --init
+
+# build and test C#
+tools/run_tests/run_tests.py -l csharp -c opt --compiler coreclr -t -x run_tests/csharp_linux_aarch64_opt_native/sponge_log.xml --report_suite_name csharp_linux_aarch64_opt_native --report_multi_target
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_php_aarch64.sh b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_php_aarch64.sh
new file mode 100755
index 00000000..6c98881b
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_php_aarch64.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python python-pip clang
+sudo pip install six
+
+# install gRPC Ruby pre-requisites
+sudo apt install -y php7.2-cli php7.2-dev
+sudo apt install -y composer phpunit
+sudo apt install -y php-bcmath # required by protobuf PHP, is it really needed for gRPC?
+
+cd grpc
+
+git submodule update --init
+
+# build and test php
+tools/run_tests/run_tests.py -l php7 -c opt -t -x run_tests/php7_linux_aarch64_opt_native/sponge_log.xml --report_suite_name php7_linux_aarch64_opt_native --report_multi_target
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_python_aarch64.sh b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_python_aarch64.sh
new file mode 100755
index 00000000..3e6c9a52
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_python_aarch64.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python python-pip clang
+sudo pip install six
+
+# install python3.6 and pip
+sudo apt install -y python3 python3-pip
+python3 --version
+
+cd grpc
+
+git submodule update --init
+
+# build and test python (currently we only test with python3.6, but that's ok since our aarch64 testing resources are limited)
+tools/run_tests/run_tests.py -l python --compiler python3.6 -c opt -t -x run_tests/python_linux_opt_native/sponge_log.xml --report_suite_name python_linux_opt_native --report_multi_target || FAILED=true
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_ruby_aarch64.sh b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_ruby_aarch64.sh
new file mode 100755
index 00000000..54707e2e
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/aws/grpc_run_basictests_ruby_aarch64.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# install pre-requisites for gRPC C core build
+sudo apt update
+sudo apt install -y build-essential autoconf libtool pkg-config cmake python python-pip clang
+sudo pip install six
+
+# install gRPC Ruby pre-requisites
+sudo apt install -y ruby ruby-dev
+sudo gem install bundler
+ruby --version
+
+cd grpc
+
+git submodule update --init
+
+# build and test ruby
+tools/run_tests/run_tests.py -l ruby -c opt -t -x run_tests/ruby_linux_aarch64_opt_native/sponge_log.xml --report_suite_name ruby_linux_aarch64_opt_native --report_multi_target
diff --git a/grpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh b/grpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh
deleted file mode 100755
index 87ec60c7..00000000
--- a/grpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=asan --cache_test_results=no
-
diff --git a/grpc/tools/internal_ci/linux/grpc_basictests_csharp.cfg b/grpc/tools/internal_ci/linux/grpc_basictests_csharp.cfg
index 017e929b..d6c23760 100644
--- a/grpc/tools/internal_ci/linux/grpc_basictests_csharp.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_basictests_csharp.cfg
@@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux csharp --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
+ value: "-f basictests linux csharp --inner_jobs 4 -j 1 --internal_ci --bq_result_table aggregate_results"
}
diff --git a/grpc/tools/internal_ci/linux/grpc_basictests_multilang.cfg b/grpc/tools/internal_ci/linux/grpc_basictests_multilang.cfg
deleted file mode 100644
index f8a5a4ae..00000000
--- a/grpc/tools/internal_ci/linux/grpc_basictests_multilang.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux multilang --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_basictests_node.cfg b/grpc/tools/internal_ci/linux/grpc_basictests_node.cfg
deleted file mode 100644
index d7b35a04..00000000
--- a/grpc/tools/internal_ci/linux/grpc_basictests_node.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 60
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux grpc-node --inner_jobs 16 -j 2 --internal_ci --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh
index 623086ae..77fb9931 100755
--- a/grpc/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh
@@ -27,12 +27,23 @@ cd /var/local/git/grpc
# Build all basic targets using the strict warning option which leverages the
# clang compiler to check if sources can pass a set of warning options.
+# For now //examples/android/binder/ are excluded because it needs Android
+# SDK/NDK to be installed to build
bazel build --define=use_strict_warning=true \
+ -- \
:all \
//src/core/... \
//src/compiler/... \
//test/... \
- //examples/...
+ //examples/... \
+ -//examples/android/binder/...
+
+# TODO(veblush): Remove this test after migration to abseil-status is done.
+bazel build --define=use_strict_warning=true --define=use_abseil_status=true \
+ -- \
+ //src/core/... \
+ //src/compiler/... \
+ //test/...
# TODO(jtattersmusch): Adding a build here for --define=grpc_no_xds is not ideal
# and we should find a better place for this. Refer
@@ -42,7 +53,7 @@ bazel build --define=use_strict_warning=true \
bazel build //test/cpp/end2end:end2end_test --define=grpc_no_xds=true
# Test that builds that need xDS do not build with --define=grpc_no_xds=true
EXIT_CODE=0
-bazel build //test/cpp/end2end:xds_end2end_test --define=grpc_no_xds=true || EXIT_CODE=$?
+bazel build //test/cpp/end2end/xds:xds_end2end_test --define=grpc_no_xds=true || EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]
then
echo "Building xds_end2end_test succeeded even with --define=grpc_no_xds=true"
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.cfg
new file mode 100644
index 00000000..84a2ab35
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.cfg
@@ -0,0 +1,25 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_distribtest.sh"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.sh b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.sh
new file mode 100755
index 00000000..34a99454
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+# Build portability tests with an updated submodule
+
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/bazel
+export DOCKER_RUN_SCRIPT=test/distrib/bazel/run_bazel_distrib_test.sh
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.cfg
new file mode 100644
index 00000000..04b51a8f
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.cfg
@@ -0,0 +1,25 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh
new file mode 100755
index 00000000..11de6638
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+# Build portability tests with an updated submodule
+
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/bazel
+export DOCKER_RUN_SCRIPT=/test/distrib/bazel/test_latest_bazel_version.sh
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh
deleted file mode 100755
index d5b38de3..00000000
--- a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-
-# make sure bazel is available
-tools/bazel version
-
-# to get "bazel" link for kokoro build, we need to generate
-# invocation UUID, set a flag for bazel to use it
-# and upload "bazel_invocation_ids" file as artifact.
-BAZEL_INVOCATION_ID="$(uuidgen)"
-echo "${BAZEL_INVOCATION_ID}" >"${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids"
-
-tools/bazel \
- --bazelrc=tools/remote_build/kokoro.bazelrc \
- test \
- --invocation_id="${BAZEL_INVOCATION_ID}" \
- --workspace_status_command=tools/remote_build/workspace_status_kokoro.sh \
- $@ \
- -- //test/... || FAILED="true"
-
-if [ "$UPLOAD_TEST_RESULTS" != "" ]
-then
- # Sleep to let ResultStore finish writing results before querying
- sleep 60
- python ./tools/run_tests/python_utils/upload_rbe_results.py
-fi
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh b/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh
deleted file mode 100644
index 06b93f3d..00000000
--- a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-EXTRA_FLAGS="--config=dbg --cache_test_results=no"
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh
deleted file mode 100644
index 66effabf..00000000
--- a/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-EXTRA_FLAGS="--config=opt --cache_test_results=no"
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh b/grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh
new file mode 100755
index 00000000..c7c7f3ba
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# make sure bazel is available
+tools/bazel version
+
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_rbe
+
+bazel_rbe/bazel_wrapper \
+ --bazelrc=tools/remote_build/linux_kokoro.bazelrc \
+ test \
+ $BAZEL_FLAGS \
+ "$@" \
+ -- //test/...
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg
index 4ed1036b..46daecdf 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_asan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_asan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,14 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=asan"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg
index 4af3b7e7..d1957bfc 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_dbg.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,14 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=dbg"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg
index 172cc158..322fac2e 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.cfg
@@ -17,6 +17,12 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh
index 85b82443..3018b264 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_incompatible_changes.sh
@@ -24,5 +24,4 @@ export USE_BAZEL_VERSION=latest
# Use bazelisk instead of our usual //tools/bazel wrapper
mv bazelisk-linux-amd64 github/grpc/tools/bazel
-EXTRA_FLAGS="--config=opt --cache_test_results=no"
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
+github/grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh --config=opt --cache_test_results=no
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg
index 88776701..77900110 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_msan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,15 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=msan"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
+
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg
index 615536cd..6eedfae2 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_opt.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -26,4 +32,15 @@ bazel_setting {
# set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
-} \ No newline at end of file
+}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=opt"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg
index 92852ff1..3dd98fac 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_tsan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,14 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=tsan"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg
index 21cdbff4..9269a6e2 100644
--- a/grpc/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_bazel_rbe_ubsan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,14 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no --config=ubsan"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_test.cfg b/grpc/tools/internal_ci/linux/grpc_bazel_test.cfg
deleted file mode 100644
index 6b03be95..00000000
--- a/grpc/tools/internal_ci/linux/grpc_bazel_test.cfg
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_bazel.sh"
-timeout_mins: 240
-env_vars {
- key: "BAZEL_SCRIPT"
- value: "tools/internal_ci/linux/grpc_bazel_test_in_docker.sh"
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_bazel_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_bazel_test_in_docker.sh
deleted file mode 100755
index 639a0855..00000000
--- a/grpc/tools/internal_ci/linux/grpc_bazel_test_in_docker.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 full Bazel
-#
-# NOTE: No empty lines should appear in this file before igncr is set!
-set -ex -o igncr || set -ex
-
-mkdir -p /var/local/git
-git clone /var/local/jenkins/grpc /var/local/git/grpc
-(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
-&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
-${name}')
-cd /var/local/git/grpc
-
-bazel test //test/...
-bazel test //test/cpp/end2end:admin_services_end2end_test --define=grpc_no_xds=true
diff --git a/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.cfg b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.cfg
new file mode 100644
index 00000000..1c2b38c6
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.cfg
@@ -0,0 +1,23 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh"
+timeout_mins: 60
+env_vars {
+ key: "BAZEL_SCRIPT"
+ value: "tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh
new file mode 100755
index 00000000..d85474a5
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/binder_transport_apk
+export DOCKER_RUN_SCRIPT=$BAZEL_SCRIPT
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh
new file mode 100644
index 00000000..454e2fe1
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh
@@ -0,0 +1,44 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#!/usr/bin/env bash
+#
+# NOTE: No empty lines should appear in this file before igncr is set!
+set -ex -o igncr || set -ex
+
+mkdir -p /var/local/git
+git clone /var/local/jenkins/grpc /var/local/git/grpc
+(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
+&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
+${name}')
+cd /var/local/git/grpc
+
+echo $ANDROID_HOME
+echo $ANDROID_NDK_HOME
+
+# Build all targets using the strict warning option which leverages the
+# clang compiler to check if sources can pass a set of warning options.
+# CPU are specified because gRPC does not build with 32bit NDK (which has socklen_t
+# defined as int due to an accident).
+# The python option is for disabling python2 enforcement when packing APK
+bazel build --define=use_strict_warning=true \
+ --fat_apk_cpu=x86_64,arm64-v8a \
+ --extra_toolchains=@rules_python//python:autodetecting_toolchain_nonstrict \
+ //examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app \
+ //examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app
+
+# Make sure the Java code that will be invoked by binder transport
+# implementation builds
+bazel build --define=use_strict_warning=true \
+ @binder_transport_android_helper//io/grpc/binder/cpp:connection_helper
diff --git a/grpc/tools/internal_ci/linux/grpc_bloat_diff.sh b/grpc/tools/internal_ci/linux/grpc_bloat_diff.sh
new file mode 100755
index 00000000..1d8f49ca
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bloat_diff.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+# Enter the gRPC repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/cxx_debian11_x64
+export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_bloat_diff_in_docker.sh
+# The check_on_pr.py needs access to the key to post status on github PRs,
+# so we mount the keystore dir to the docker container.
+export EXTRA_DOCKER_ARGS="-v ${KOKORO_KEYSTORE_DIR}:/kokoro_keystore -e KOKORO_KEYSTORE_DIR=/kokoro_keystore"
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_bloat_diff_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_bloat_diff_in_docker.sh
new file mode 100755
index 00000000..e5968f52
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_bloat_diff_in_docker.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Copyright 2022 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.
+
+set -ex
+
+# Enter the gRPC repo root
+cd $(dirname $0)/../../..
+
+# some extra pip packages are needed for the check_on_pr.py script to work
+# TODO(jtattermusch): avoid needing to install these pip packages each time
+time python3 -m pip install --user -r tools/internal_ci/helper_scripts/requirements.linux_perf.txt
+
+tools/internal_ci/linux/run_if_c_cpp_modified.sh tools/profiling/bloat/bloat_diff.py \
+ -d "origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH"
diff --git a/grpc/tools/internal_ci/linux/grpc_build_artifacts.sh b/grpc/tools/internal_ci/linux/grpc_build_artifacts.sh
index 985243e9..29694e70 100755
--- a/grpc/tools/internal_ci/linux/grpc_build_artifacts.sh
+++ b/grpc/tools/internal_ci/linux/grpc_build_artifacts.sh
@@ -15,15 +15,25 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-set +ex
-[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
-set -e # rvm commands are very verbose
-rvm --default use ruby-2.4.1
-set -ex
+# prerequisites for ruby artifact build on linux
+source tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc
+
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
+tools/run_tests/task_runner.py -f artifact linux ${TASK_RUNNER_EXTRA_FILTERS} -j 6 --inner_jobs 6 || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
-tools/run_tests/task_runner.py -f artifact linux -j 6
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.cfg b/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.cfg
deleted file mode 100644
index ea9f9bd7..00000000
--- a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh"
-timeout_mins: 480
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- regex: "github/grpc/artifacts/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh b/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh
deleted file mode 100755
index 718123d7..00000000
--- a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-
-set +ex
-[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
-set -e # rvm commands are very verbose
-rvm --default use ruby-2.4.1
-set -ex
-
-tools/run_tests/task_runner.py -f artifact linux_extra armv7 -j 6
diff --git a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra_release.cfg b/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra_release.cfg
deleted file mode 100644
index ea9f9bd7..00000000
--- a/grpc/tools/internal_ci/linux/grpc_build_artifacts_extra_release.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_build_artifacts_extra.sh"
-timeout_mins: 480
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- regex: "github/grpc/artifacts/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_build_packages.sh b/grpc/tools/internal_ci/linux/grpc_build_packages.sh
index ff71298a..75966049 100644
--- a/grpc/tools/internal_ci/linux/grpc_build_packages.sh
+++ b/grpc/tools/internal_ci/linux/grpc_build_packages.sh
@@ -15,17 +15,14 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-set +ex
-[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
-set -e # rvm commands are very verbose
-rvm --default use ruby-2.4.1
-set -ex
-
# Move artifacts generated by the previous step in the build chain to a place
# where they can be accessed from within a docker container that builds
# the packages
@@ -33,4 +30,12 @@ mv ${KOKORO_GFILE_DIR}/github/grpc/artifacts input_artifacts || true
chmod +x input_artifacts/protoc*/* || true
ls -R input_artifacts || true
-tools/run_tests/task_runner.py -f package linux -j 6
+tools/run_tests/task_runner.py -f package linux -j 6 || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
+
diff --git a/grpc/tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg b/grpc/tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg
index 75f0dae2..fdb8192f 100644
--- a/grpc/tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg
@@ -29,3 +29,8 @@ env_vars {
key: "RUN_TESTS_FLAGS"
value: "protobuf"
}
+
+env_vars {
+ key: "BAZEL_FLAGS"
+ value: "main"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_build_submodule_at_head.sh b/grpc/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
index 58aa5e7a..25274dd8 100755
--- a/grpc/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
+++ b/grpc/tools/internal_ci/linux/grpc_build_submodule_at_head.sh
@@ -55,4 +55,4 @@ fi
# commit so that changes are passed to Docker
git -c user.name='foo' -c user.email='foo@google.com' commit -a -m 'Update submodule' --allow-empty
-tools/run_tests/run_tests_matrix.py -f linux --inner_jobs 8 -j 4 --internal_ci --build_only
+tools/run_tests/run_tests_matrix.py -f linux --exclude basictests_arm64 --inner_jobs 8 -j 4 --internal_ci --build_only
diff --git a/grpc/tools/internal_ci/linux/grpc_coverage.sh b/grpc/tools/internal_ci/linux/grpc_coverage.sh
index a91cffdf..367d4235 100755
--- a/grpc/tools/internal_ci/linux/grpc_coverage.sh
+++ b/grpc/tools/internal_ci/linux/grpc_coverage.sh
@@ -20,19 +20,19 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-python tools/run_tests/run_tests.py \
+python3 tools/run_tests/run_tests.py \
-l c c++ -x coverage_cpp/sponge_log.xml \
--use_docker -t -c gcov -j 2 || FAILED="true"
-python tools/run_tests/run_tests.py \
+python3 tools/run_tests/run_tests.py \
-l python -x coverage_python/sponge_log.xml \
--use_docker -t -c gcov -j 2 || FAILED="true"
-python tools/run_tests/run_tests.py \
+python3 tools/run_tests/run_tests.py \
-l ruby -x coverage_ruby/sponge_log.xml \
--use_docker -t -c gcov -j 2 || FAILED="true"
-python tools/run_tests/run_tests.py \
+python3 tools/run_tests/run_tests.py \
-l php -x coverage_php/sponge_log.xml \
--use_docker -t -c gcov -j 2 || FAILED="true"
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests.sh b/grpc/tools/internal_ci/linux/grpc_distribtests.sh
index b2ec2bf3..776e2c8e 100644
--- a/grpc/tools/internal_ci/linux/grpc_distribtests.sh
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -25,16 +28,10 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# under qemu emulator.
source tools/internal_ci/helper_scripts/prepare_qemu_rc
-set +ex
-[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
-set -e # rvm commands are very verbose
-rvm --default use ruby-2.4.1
-set -ex
-
# Move packages generated by the previous step in the build chain to a place
# where they can be accessed from within a docker container that run the
# distribtests
mv ${KOKORO_GFILE_DIR}/github/grpc/artifacts input_artifacts || true
ls -R input_artifacts || true
-tools/run_tests/task_runner.py -f distribtest linux -j 6
+tools/run_tests/task_runner.py -f distribtest linux -j 6 --inner_jobs 6
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..cff345af
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh
new file mode 100755
index 00000000..011d62d2
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# some distribtests use a pre-registered binfmt_misc hook
+# to automatically execute foreign binaries (such as aarch64)
+# under qemu emulator.
+source tools/internal_ci/helper_scripts/prepare_qemu_rc
+
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
+# Build all C# linux artifacts
+tools/run_tests/task_runner.py -f artifact linux csharp ${TASK_RUNNER_EXTRA_FILTERS} -j 4 --inner_jobs 8 -x build_artifacts_csharp/sponge_log.xml || FAILED="true"
+
+# Build all protoc linux artifacts
+tools/run_tests/task_runner.py -f artifact linux protoc ${TASK_RUNNER_EXTRA_FILTERS} -j 4 --inner_jobs 8 -x build_artifacts_protoc/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# This step builds the nuget packages from input_artifacts
+# Set env variable option to build single platform version of the nugets.
+# (this is required as we only have the linux artifacts at hand)
+GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET=1 tools/run_tests/task_runner.py -f package linux csharp nuget -j 2 -x build_packages/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# Run all C# linux distribtests
+# We run the distribtests even if some of the artifacts have failed to build, since that gives
+# a better signal about which distribtest are affected by the currently broken artifact builds.
+tools/run_tests/task_runner.py -f distribtest linux csharp ${TASK_RUNNER_EXTRA_FILTERS} -j 12 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.cfg b/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.cfg
new file mode 100644
index 00000000..6df7d470
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.sh
new file mode 100755
index 00000000..883739cb
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_gcp_python.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# some distribtests use a pre-registered binfmt_misc hook
+# to automatically execute foreign binaries (such as aarch64)
+# under qemu emulator.
+source tools/internal_ci/helper_scripts/prepare_qemu_rc
+
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
+# Build all python linux artifacts (this step actually builds all the binary wheels and source archives)
+tools/run_tests/task_runner.py -f artifact linux python latest-manylinux ${TASK_RUNNER_EXTRA_FILTERS} -j 12 -x build_artifacts/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+rm -rf artifacts_from_build_artifacts_step
+mv artifacts artifacts_from_build_artifacts_step || true
+
+# This step simply collects python artifacts from subdirectories of input_artifacts/ and copies them to artifacts/
+tools/run_tests/task_runner.py -f package linux python -x build_packages/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+INPUT_ARTIFACTS=$(realpath input_artifacts)
+
+(yes || true) | gcloud components update
+
+# TODO(rbellevi): Run in a docker image.
+test/distrib/gcf/python/run.sh "$INPUT_ARTIFACTS"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_php.cfg b/grpc/tools/internal_ci/linux/grpc_distribtests_php.cfg
new file mode 100644
index 00000000..bdf31484
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_php.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_php.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_php.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_php.sh
new file mode 100755
index 00000000..969c93d0
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_php.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# Build all PHP linux artifacts
+tools/run_tests/task_runner.py -f artifact linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+rm -rf artifacts_from_build_artifacts_step
+mv artifacts artifacts_from_build_artifacts_step || true
+
+# This step simply collects php artifacts from subdirectories of input_artifacts/ and copies them to artifacts/
+tools/run_tests/task_runner.py -f package linux php -x build_packages/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# Run all PHP linux distribtests
+# We run the distribtests even if some of the artifacts have failed to build, since that gives
+# a better signal about which distribtest are affected by the currently broken artifact builds.
+tools/run_tests/task_runner.py -f distribtest linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_python.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_python.sh
index aef91811..ddb01bab 100755
--- a/grpc/tools/internal_ci/linux/grpc_distribtests_python.sh
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_python.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -25,8 +28,11 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# under qemu emulator.
source tools/internal_ci/helper_scripts/prepare_qemu_rc
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
# Build all python linux artifacts (this step actually builds all the binary wheels and source archives)
-tools/run_tests/task_runner.py -f artifact linux python -j 6 -x build_artifacts/sponge_log.xml || FAILED="true"
+tools/run_tests/task_runner.py -f artifact linux python ${TASK_RUNNER_EXTRA_FILTERS} -j 12 -x build_artifacts/sponge_log.xml || FAILED="true"
# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
rm -rf input_artifacts
@@ -35,7 +41,7 @@ cp -r artifacts/* input_artifacts/ || true
rm -rf artifacts_from_build_artifacts_step
mv artifacts artifacts_from_build_artifacts_step || true
-# This step mostly just copies artifacts from input_artifacts (but it also does some wheel stripping)
+# This step simply collects python artifacts from subdirectories of input_artifacts/ and copies them to artifacts/
tools/run_tests/task_runner.py -f package linux python -x build_packages/sponge_log.xml || FAILED="true"
# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
@@ -48,7 +54,9 @@ cp -r artifacts/* input_artifacts/ || true
# Run all python linux distribtests
# We run the distribtests even if some of the artifacts have failed to build, since that gives
# a better signal about which distribtest are affected by the currently broken artifact builds.
-tools/run_tests/task_runner.py -f distribtest linux python -j 6 -x distribtests/sponge_log.xml || FAILED="true"
+tools/run_tests/task_runner.py -f distribtest linux python ${TASK_RUNNER_EXTRA_FILTERS} -j 12 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
if [ "$FAILED" != "" ]
then
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.cfg b/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.cfg
new file mode 100644
index 00000000..4a3d83c4
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh
new file mode 100755
index 00000000..3d6ac6fc
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# prerequisites for ruby artifact build on linux
+source tools/internal_ci/helper_scripts/prepare_build_linux_ruby_artifact_rc
+
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
+# Build all ruby linux artifacts (this step actually builds all the native and source gems)
+tools/run_tests/task_runner.py -f artifact linux ruby ${TASK_RUNNER_EXTRA_FILTERS} -j 6 --inner_jobs 6 -x build_artifacts/sponge_log.xml || FAILED="true"
+
+# Ruby "build_package" step is basically just a passthough for the "grpc" gems, so it's enough to just
+# copy the native gems directly to the "distribtests" step and skip the "build_package" phase entirely.
+# Note that by skipping the "build_package" step, we are also skipping the build of "grpc-tools" gem
+# but that's fine since the distribtests only test the "grpc" native gems.
+
+# The next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/ruby_native_gem_*/* input_artifacts/ || true
+
+# Run all ruby linux distribtests
+# We run the distribtests even if some of the artifacts have failed to build, since that gives
+# a better signal about which distribtest are affected by the currently broken artifact builds.
+tools/run_tests/task_runner.py -f distribtest linux ruby ${TASK_RUNNER_EXTRA_FILTERS} -j 12 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh b/grpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh
index 084daa9b..982ede1d 100755
--- a/grpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh
+++ b/grpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh
@@ -15,9 +15,12 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-tools/run_tests/task_runner.py -f distribtest linux cpp -j 6
+tools/run_tests/task_runner.py -f distribtest linux cpp ${TASK_RUNNER_EXTRA_FILTERS} -j 6 --inner_jobs 6
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.cfg b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.cfg
new file mode 100644
index 00000000..f646f6b7
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.cfg
@@ -0,0 +1,25 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "**/github/grpc/runner/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.sh
new file mode 100755
index 00000000..53126467
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke.sh
@@ -0,0 +1,136 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+set -ex
+
+# Enter the gRPC repo root.
+cd "$(dirname "$0")/../../.."
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# This is to ensure we can push and pull images from gcr.io. We do not
+# necessarily need it to run load tests, but will need it when we employ
+# pre-built images in the optimization.
+gcloud auth configure-docker
+
+# Connect to benchmarks-prod2 cluster.
+gcloud config set project grpc-testing
+gcloud container clusters get-credentials benchmarks-prod2 \
+ --zone us-central1-b --project grpc-testing
+
+# Set up environment variables.
+LOAD_TEST_PREFIX="${KOKORO_BUILD_INITIATOR}"
+# BEGIN differentiate experimental configuration from master configuration.
+if [[ "${KOKORO_BUILD_INITIATOR%%-*}" == kokoro ]]; then
+ LOAD_TEST_PREFIX=kokoro
+fi
+# Use the "official" BQ tables so that the measurements will show up in the
+# "official" public dashboard.
+BIGQUERY_TABLE_8CORE=e2e_benchmarks.ci_master_results_8core
+BIGQUERY_TABLE_32CORE=e2e_benchmarks.ci_master_results_32core
+# END differentiate experimental configuration from master configuration.
+CLOUD_LOGGING_URL="https://source.cloud.google.com/results/invocations/${KOKORO_BUILD_ID}"
+PREBUILT_IMAGE_PREFIX="gcr.io/grpc-testing/e2etest/prebuilt/${LOAD_TEST_PREFIX}"
+UNIQUE_IDENTIFIER="$(date +%Y%m%d%H%M%S)"
+ROOT_DIRECTORY_OF_DOCKERFILES="../test-infra/containers/pre_built_workers/"
+# Head of the workspace checked out by Kokoro.
+GRPC_GITREF="$(git show --format="%H" --no-patch)"
+# Prebuilt workers for core languages are always built from grpc/grpc.
+if [[ "${KOKORO_GITHUB_COMMIT_URL%/*}" == "https://github.com/grpc/grpc/commit" ]]; then
+ GRPC_CORE_GITREF="${KOKORO_GIT_COMMIT}"
+else
+ GRPC_CORE_GITREF="$(git ls-remote https://github.com/grpc/grpc.git master | cut -f1)"
+fi
+GRPC_DOTNET_GITREF="$(git ls-remote https://github.com/grpc/grpc-dotnet.git master | cut -f1)"
+GRPC_GO_GITREF="$(git ls-remote https://github.com/grpc/grpc-go.git master | cut -f1)"
+GRPC_JAVA_GITREF="$(git ls-remote https://github.com/grpc/grpc-java.git master | cut -f1)"
+# Kokoro jobs run on dedicated pools.
+DRIVER_POOL=drivers-ci
+WORKER_POOL_8CORE=workers-c2-8core-ci
+# c2-standard-30 is the closest machine spec to 32 core there is
+WORKER_POOL_32CORE=workers-c2-30core-ci
+
+# Update go version.
+TEST_INFRA_GOVERSION=go1.17.1
+go get "golang.org/dl/${TEST_INFRA_GOVERSION}"
+"${TEST_INFRA_GOVERSION}" download
+
+# Clone test-infra repository and build all tools.
+pushd ..
+git clone https://github.com/grpc/test-infra.git
+cd test-infra
+# Tools are built from HEAD.
+git checkout --detach
+make GOCMD="${TEST_INFRA_GOVERSION}" all-tools
+popd
+
+# Build test configurations.
+buildConfigs() {
+ local -r pool="$1"
+ local -r table="$2"
+ shift 2
+ tools/run_tests/performance/loadtest_config.py "$@" \
+ -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \
+ -s driver_pool="${DRIVER_POOL}" -s driver_image= \
+ -s client_pool="${pool}" -s server_pool="${pool}" \
+ -s big_query_table="${table}" -s timeout_seconds=900 \
+ -s prebuilt_image_prefix="${PREBUILT_IMAGE_PREFIX}" \
+ -a ci_buildNumber="${KOKORO_BUILD_NUMBER}" \
+ -a ci_buildUrl="${CLOUD_LOGGING_URL}" \
+ -a ci_jobName="${KOKORO_JOB_NAME}" \
+ -a ci_gitCommit="${GRPC_GITREF}" \
+ -a ci_gitCommit_go="${GRPC_GO_GITREF}" \
+ -a ci_gitCommit_java="${GRPC_JAVA_GITREF}" \
+ -a ci_gitActualCommit="${KOKORO_GIT_COMMIT}" \
+ -s prebuilt_image_tag="${UNIQUE_IDENTIFIER}" \
+ --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \
+ -a pool="${pool}" --category=scalable \
+ --allow_client_language=c++ --allow_server_language=c++ \
+ -o "loadtest_with_prebuilt_workers_${pool}.yaml"
+}
+
+buildConfigs "${WORKER_POOL_8CORE}" "${BIGQUERY_TABLE_8CORE}" -l c++ -l csharp -l dotnet -l go -l java -l php7 -l php7_protobuf_c -l python -l ruby
+buildConfigs "${WORKER_POOL_32CORE}" "${BIGQUERY_TABLE_32CORE}" -l c++ -l csharp -l dotnet -l go -l java
+
+# Delete prebuilt images on exit.
+deleteImages() {
+ echo "deleting images on exit"
+ ../test-infra/bin/delete_prebuilt_workers \
+ -p "${PREBUILT_IMAGE_PREFIX}" \
+ -t "${UNIQUE_IDENTIFIER}"
+}
+trap deleteImages EXIT
+
+# Build and push prebuilt images for running tests.
+time ../test-infra/bin/prepare_prebuilt_workers \
+ -l "cxx:${GRPC_CORE_GITREF}" \
+ -l "csharp:${GRPC_CORE_GITREF}" \
+ -l "dotnet:${GRPC_DOTNET_GITREF}" \
+ -l "go:${GRPC_GO_GITREF}" \
+ -l "java:${GRPC_JAVA_GITREF}" \
+ -l "php7:${GRPC_CORE_GITREF}" \
+ -l "python:${GRPC_CORE_GITREF}" \
+ -l "ruby:${GRPC_CORE_GITREF}" \
+ -p "${PREBUILT_IMAGE_PREFIX}" \
+ -t "${UNIQUE_IDENTIFIER}" \
+ -r "${ROOT_DIRECTORY_OF_DOCKERFILES}"
+
+# Run tests.
+time ../test-infra/bin/runner \
+ -i "loadtest_with_prebuilt_workers_${WORKER_POOL_8CORE}.yaml" \
+ -i "loadtest_with_prebuilt_workers_${WORKER_POOL_32CORE}.yaml" \
+ -polling-interval 5s \
+ -delete-successful-tests \
+ -c "${WORKER_POOL_8CORE}:2" -c "${WORKER_POOL_32CORE}:2" \
+ -o "runner/sponge_log.xml"
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.cfg b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.cfg
new file mode 100644
index 00000000..4b49380a
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.cfg
@@ -0,0 +1,25 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh"
+timeout_mins: 720
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "**/github/grpc/runner/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh
new file mode 100755
index 00000000..c5583403
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh
@@ -0,0 +1,134 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+set -ex
+
+# Enter the gRPC repo root.
+cd "$(dirname "$0")/../../.."
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+# This is to ensure we can push and pull images from gcr.io. We do not
+# necessarily need it to run load tests, but will need it when we employ
+# pre-built images in the optimization.
+gcloud auth configure-docker
+
+# Connect to benchmarks-prod2 cluster.
+gcloud config set project grpc-testing
+gcloud container clusters get-credentials benchmarks-prod2 \
+ --zone us-central1-b --project grpc-testing
+
+# Set up environment variables.
+LOAD_TEST_PREFIX="${KOKORO_BUILD_INITIATOR}"
+# BEGIN differentiate experimental configuration from master configuration.
+if [[ "${KOKORO_BUILD_INITIATOR%%-*}" == kokoro ]]; then
+ LOAD_TEST_PREFIX=kokoro-test
+fi
+BIGQUERY_TABLE_8CORE=e2e_benchmarks.experimental_results
+BIGQUERY_TABLE_32CORE=e2e_benchmarks.experimental_results_32core
+# END differentiate experimental configuration from master configuration.
+CLOUD_LOGGING_URL="https://source.cloud.google.com/results/invocations/${KOKORO_BUILD_ID}"
+PREBUILT_IMAGE_PREFIX="gcr.io/grpc-testing/e2etest/prebuilt/${LOAD_TEST_PREFIX}"
+UNIQUE_IDENTIFIER="$(date +%Y%m%d%H%M%S)"
+ROOT_DIRECTORY_OF_DOCKERFILES="../test-infra/containers/pre_built_workers/"
+# Head of the workspace checked out by Kokoro.
+GRPC_GITREF="$(git show --format="%H" --no-patch)"
+# Prebuilt workers for core languages are always built from grpc/grpc.
+if [[ "${KOKORO_GITHUB_COMMIT_URL%/*}" == "https://github.com/grpc/grpc/commit" ]]; then
+ GRPC_CORE_GITREF="${KOKORO_GIT_COMMIT}"
+else
+ GRPC_CORE_GITREF="$(git ls-remote https://github.com/grpc/grpc.git master | cut -f1)"
+fi
+GRPC_DOTNET_GITREF="$(git ls-remote https://github.com/grpc/grpc-dotnet.git master | cut -f1)"
+GRPC_GO_GITREF="$(git ls-remote https://github.com/grpc/grpc-go.git master | cut -f1)"
+GRPC_JAVA_GITREF="$(git ls-remote https://github.com/grpc/grpc-java.git master | cut -f1)"
+# Kokoro jobs run on dedicated pools.
+DRIVER_POOL=drivers-ci
+WORKER_POOL_8CORE=workers-c2-8core-ci
+# c2-standard-30 is the closest machine spec to 32 core there is
+WORKER_POOL_32CORE=workers-c2-30core-ci
+
+# Update go version.
+TEST_INFRA_GOVERSION=go1.17.1
+go get "golang.org/dl/${TEST_INFRA_GOVERSION}"
+"${TEST_INFRA_GOVERSION}" download
+
+# Clone test-infra repository and build all tools.
+pushd ..
+git clone https://github.com/grpc/test-infra.git
+cd test-infra
+# Tools are built from HEAD.
+git checkout --detach
+make GOCMD="${TEST_INFRA_GOVERSION}" all-tools
+popd
+
+# Build test configurations.
+buildConfigs() {
+ local -r pool="$1"
+ local -r table="$2"
+ shift 2
+ tools/run_tests/performance/loadtest_config.py "$@" \
+ -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \
+ -s driver_pool="${DRIVER_POOL}" -s driver_image= \
+ -s client_pool="${pool}" -s server_pool="${pool}" \
+ -s big_query_table="${table}" -s timeout_seconds=900 \
+ -s prebuilt_image_prefix="${PREBUILT_IMAGE_PREFIX}" \
+ -s prebuilt_image_tag="${UNIQUE_IDENTIFIER}" \
+ -a ci_buildNumber="${KOKORO_BUILD_NUMBER}" \
+ -a ci_buildUrl="${CLOUD_LOGGING_URL}" \
+ -a ci_jobName="${KOKORO_JOB_NAME}" \
+ -a ci_gitCommit="${GRPC_GITREF}" \
+ -a ci_gitCommit_go="${GRPC_GO_GITREF}" \
+ -a ci_gitCommit_java="${GRPC_JAVA_GITREF}" \
+ -a ci_gitActualCommit="${KOKORO_GIT_COMMIT}" \
+ --prefix="${LOAD_TEST_PREFIX}" -u "${UNIQUE_IDENTIFIER}" -u "${pool}" \
+ -a pool="${pool}" --category=scalable \
+ --allow_client_language=c++ --allow_server_language=c++ \
+ -o "loadtest_with_prebuilt_workers_${pool}.yaml"
+}
+
+buildConfigs "${WORKER_POOL_8CORE}" "${BIGQUERY_TABLE_8CORE}" -l c++ -l csharp -l dotnet -l go -l java -l php7 -l php7_protobuf_c -l python -l ruby
+buildConfigs "${WORKER_POOL_32CORE}" "${BIGQUERY_TABLE_32CORE}" -l c++ -l csharp -l dotnet -l go -l java
+
+# Delete prebuilt images on exit.
+deleteImages() {
+ echo "deleting images on exit"
+ ../test-infra/bin/delete_prebuilt_workers \
+ -p "${PREBUILT_IMAGE_PREFIX}" \
+ -t "${UNIQUE_IDENTIFIER}"
+}
+trap deleteImages EXIT
+
+# Build and push prebuilt images for running tests.
+time ../test-infra/bin/prepare_prebuilt_workers \
+ -l "cxx:${GRPC_CORE_GITREF}" \
+ -l "csharp:${GRPC_CORE_GITREF}" \
+ -l "dotnet:${GRPC_DOTNET_GITREF}" \
+ -l "go:${GRPC_GO_GITREF}" \
+ -l "java:${GRPC_JAVA_GITREF}" \
+ -l "php7:${GRPC_CORE_GITREF}" \
+ -l "python:${GRPC_CORE_GITREF}" \
+ -l "ruby:${GRPC_CORE_GITREF}" \
+ -p "${PREBUILT_IMAGE_PREFIX}" \
+ -t "${UNIQUE_IDENTIFIER}" \
+ -r "${ROOT_DIRECTORY_OF_DOCKERFILES}"
+
+# Run tests.
+time ../test-infra/bin/runner \
+ -i "loadtest_with_prebuilt_workers_${WORKER_POOL_8CORE}.yaml" \
+ -i "loadtest_with_prebuilt_workers_${WORKER_POOL_32CORE}.yaml" \
+ -polling-interval 5s \
+ -delete-successful-tests \
+ -c "${WORKER_POOL_8CORE}:2" -c "${WORKER_POOL_32CORE}:2" \
+ -o "runner/sponge_log.xml"
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.cfg b/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.cfg
deleted file mode 100644
index 8974fb2d..00000000
--- a/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2021 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.sh"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "**/perf_reports/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.sh b/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.sh
deleted file mode 100755
index 63d2650e..00000000
--- a/grpc/tools/internal_ci/linux/grpc_e2e_performance_v2.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2021 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.
-set -ex
-
-# Enter the gRPC repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-
-# This is to ensure we can push and pull images from gcr.io. We do not
-# necessarily need it to run load tests, but will need it when we employ
-# pre-built images in the optimization.
-gcloud auth configure-docker
-
-# Connect to benchmarks-prod cluster.
-gcloud config set project grpc-testing
-gcloud container clusters get-credentials benchmarks-prod \
- --zone us-central1-b --project grpc-testing
-
-# This is subject to change. Runs a single test and does not wait for the
-# result.
-tools/run_tests/performance/loadtest_config.py -l c++ -l go \
- -t ./tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml \
- -s client_pool=workers-8core -s server_pool=workers-8core \
- -s big_query_table=e2e_benchmarks.experimental_results \
- -s timeout_seconds=900 --prefix="kokoro-test" -u "$(date +%Y%m%d%H%M%S)" \
- -r '(go_generic_sync_streaming_ping_pong_secure|go_protobuf_sync_unary_ping_pong_secure|cpp_protobuf_async_streaming_qps_unconstrained_secure)$' \
- -o ./loadtest.yaml
-
-# Dump the contents of the loadtest.yaml (since loadtest_config.py doesn't
-# list the scenarios that will be run).
-cat ./loadtest.yaml
-
-# The original version of the client is a bit old, update to the latest release
-# version v1.21.0.
-kubectl version --client
-curl -sSL -O https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl
-sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
-chmod +x kubectl
-sudo mv kubectl $(which kubectl)
-kubectl version --client
-
-kubectl apply -f ./loadtest.yaml
diff --git a/grpc/tools/internal_ci/linux/grpc_feature_example_tests.sh b/grpc/tools/internal_ci/linux/grpc_feature_example_tests.sh
new file mode 100755
index 00000000..0103cf4e
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_feature_example_tests.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Copyright 2021 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.
+#!/usr/bin/env bash
+#
+# NOTE: No empty lines should appear in this file before igncr is set!
+set -ex -o igncr || set -ex
+
+mkdir -p /var/local/git
+git clone /var/local/jenkins/grpc /var/local/git/grpc
+(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
+&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
+${name}')
+cd /var/local/git/grpc
+
+apt-get install -y lsof
+
+./examples/cpp/features/run_tests.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_flaky_network_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_flaky_network_in_docker.sh
index ce8e21c7..b8616270 100755
--- a/grpc/tools/internal_ci/linux/grpc_flaky_network_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_flaky_network_in_docker.sh
@@ -26,6 +26,6 @@ ${name}')
cd /var/local/git/grpc/test/cpp/end2end
# iptables is used to drop traffic between client and server
-apt-get install -y iptables
+apt-get install -y iptables iproute2
bazel test --test_output=all --test_timeout=1200 :flaky_network_test --test_env=GRPC_TRACE=http --test_env=GRPC_VERBOSITY=DEBUG
diff --git a/grpc/tools/internal_ci/linux/grpc_line_count.cfg b/grpc/tools/internal_ci/linux/grpc_line_count.cfg
deleted file mode 100644
index 5854d9c9..00000000
--- a/grpc/tools/internal_ci/linux/grpc_line_count.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_line_count.sh"
-timeout_mins: 30
diff --git a/grpc/tools/internal_ci/linux/grpc_line_count.sh b/grpc/tools/internal_ci/linux/grpc_line_count.sh
deleted file mode 100755
index 22e484ba..00000000
--- a/grpc/tools/internal_ci/linux/grpc_line_count.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 script counts the numbers of line in gRPC's repo and uploads to BQ
-set -ex
-
-# Enter the gRPC repo root
-cd $(dirname $0)/../../..
-
-git submodule update --init
-
-# Install cloc
-git clone -b v1.72 https://github.com/AlDanial/cloc/ ~/cloc
-PERL_MM_USE_DEFAULT=1 sudo perl -MCPAN -e 'install Regexp::Common; install Algorithm::Diff'
-sudo make install -C ~/cloc/Unix
-
-./tools/line_count/collect-now.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_memory_diff.sh b/grpc/tools/internal_ci/linux/grpc_memory_diff.sh
new file mode 100755
index 00000000..e3db68bb
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_memory_diff.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+# Enter the gRPC repo root
+cd $(dirname $0)/../../..
+
+source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+
+export DOCKERFILE_DIR=tools/dockerfile/test/cxx_debian11_x64
+export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_memory_diff_in_docker.sh
+# The check_on_pr.py needs access to the key to post status on github PRs,
+# so we mount the keystore dir to the docker container.
+export EXTRA_DOCKER_ARGS="-v ${KOKORO_KEYSTORE_DIR}:/kokoro_keystore -e KOKORO_KEYSTORE_DIR=/kokoro_keystore"
+exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_memory_diff_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_memory_diff_in_docker.sh
new file mode 100755
index 00000000..bd4e0fc8
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_memory_diff_in_docker.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Copyright 2022 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.
+
+set -ex
+
+# Enter the gRPC repo root
+cd $(dirname $0)/../../..
+
+# some extra pip packages are needed for the check_on_pr.py script to work
+# TODO(jtattermusch): avoid needing to install these pip packages each time
+time python3 -m pip install --user -r tools/internal_ci/helper_scripts/requirements.linux_perf.txt
+
+tools/run_tests/start_port_server.py
+
+tools/internal_ci/linux/run_if_c_cpp_modified.sh tools/profiling/memory/memory_diff.py \
+ -d "origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH"
diff --git a/grpc/tools/internal_ci/linux/grpc_microbenchmark_diff.sh b/grpc/tools/internal_ci/linux/grpc_microbenchmark_diff.sh
index 580c184b..96742404 100755
--- a/grpc/tools/internal_ci/linux/grpc_microbenchmark_diff.sh
+++ b/grpc/tools/internal_ci/linux/grpc_microbenchmark_diff.sh
@@ -12,12 +12,12 @@
# WITHOUT 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 script is invoked by Jenkins and runs a diff on the microbenchmarks
+
+# This script is invoked by Kokoro and runs a diff on the microbenchmarks
set -ex
# List of benchmarks that provide good signal for analyzing performance changes in pull requests
-BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong bm_fullstack_streaming_pump bm_closure bm_cq bm_call_create bm_error bm_chttp2_hpack bm_chttp2_transport bm_pollset bm_metadata"
+BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong bm_fullstack_streaming_pump bm_closure bm_cq bm_call_create bm_chttp2_hpack bm_chttp2_transport bm_pollset"
# Enter the gRPC repo root
cd $(dirname $0)/../../..
@@ -25,16 +25,6 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_perf_rc
tools/run_tests/start_port_server.py
-tools/internal_ci/linux/run_if_c_cpp_modified.sh tools/profiling/bloat/bloat_diff.py \
- -d "origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH" || FAILED="true"
tools/internal_ci/linux/run_if_c_cpp_modified.sh tools/profiling/microbenchmarks/bm_diff/bm_main.py \
-d "origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH" \
- -b $BENCHMARKS_TO_RUN || FAILED="true"
-
-# kill port_server.py to prevent the build from freezing
-ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
+ -b $BENCHMARKS_TO_RUN
diff --git a/grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh b/grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh
deleted file mode 100644
index c7e4b1fa..00000000
--- a/grpc/tools/internal_ci/linux/grpc_msan_on_foundry.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=msan --cache_test_results=no
diff --git a/grpc/tools/internal_ci/linux/grpc_performance_profile_daily.sh b/grpc/tools/internal_ci/linux/grpc_performance_profile_daily.sh
index 013f1ab8..15f7eea5 100755
--- a/grpc/tools/internal_ci/linux/grpc_performance_profile_daily.sh
+++ b/grpc/tools/internal_ci/linux/grpc_performance_profile_daily.sh
@@ -24,12 +24,4 @@ CPUS=`python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())'`
./tools/run_tests/start_port_server.py || true
-tools/run_tests/run_microbenchmark.py --collect summary --bigquery_upload || FAILED="true"
-
-# kill port_server.py to prevent the build from freezing
-ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
+tools/run_tests/run_microbenchmark.py --collect summary --bq_result_table microbenchmarks.microbenchmarks
diff --git a/grpc/tools/internal_ci/linux/grpc_performance_profile_master.sh b/grpc/tools/internal_ci/linux/grpc_performance_profile_master.sh
index 93454b7f..15f7eea5 100755
--- a/grpc/tools/internal_ci/linux/grpc_performance_profile_master.sh
+++ b/grpc/tools/internal_ci/linux/grpc_performance_profile_master.sh
@@ -20,13 +20,8 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_perf_rc
-tools/internal_ci/linux/run_performance_profile_hourly.sh || FAILED="true"
+CPUS=`python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())'`
-# kill port_server.py to prevent the build from freezing
-ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
+./tools/run_tests/start_port_server.py || true
+tools/run_tests/run_microbenchmark.py --collect summary --bq_result_table microbenchmarks.microbenchmarks
diff --git a/grpc/tools/internal_ci/linux/grpc_portability_build_only.cfg b/grpc/tools/internal_ci/linux/grpc_portability_build_only.cfg
index c4fa6c60..8d76e5bc 100644
--- a/grpc/tools/internal_ci/linux/grpc_portability_build_only.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_portability_build_only.cfg
@@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "-f portability linux --inner_jobs 8 -j 4 --internal_ci --build_only"
+ value: "-f portability linux c++ --inner_jobs 8 -j 4 --internal_ci --build_only"
}
diff --git a/grpc/tools/internal_ci/linux/grpc_python_bazel_test.cfg b/grpc/tools/internal_ci/linux/grpc_python_bazel_test.cfg
index feae9243..6dd7a376 100644
--- a/grpc/tools/internal_ci/linux/grpc_python_bazel_test.cfg
+++ b/grpc/tools/internal_ci/linux/grpc_python_bazel_test.cfg
@@ -17,6 +17,13 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_bazel.sh"
timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
+
env_vars {
key: "BAZEL_SCRIPT"
value: "tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh"
diff --git a/grpc/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh
index 7724ca66..a36cd416 100755
--- a/grpc/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh
@@ -14,25 +14,23 @@
# limitations under the License.
#
# Test full Bazel
-#
-# NOTE: No empty lines should appear in this file before igncr is set!
-set -ex -o igncr || set -ex
+
+set -ex
mkdir -p /var/local/git
git clone /var/local/jenkins/grpc /var/local/git/grpc
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
${name}')
-cd /var/local/git/grpc/test
+cd /var/local/git/grpc
TEST_TARGETS="//src/python/... //tools/distrib/python/grpcio_tools/... //examples/python/..."
BAZEL_FLAGS="--test_output=errors"
-bazel test ${BAZEL_FLAGS} ${TEST_TARGETS}
-bazel test --config=python_single_threaded_unary_stream ${BAZEL_FLAGS} ${TEST_TARGETS}
-bazel test --config=python_poller_engine ${BAZEL_FLAGS} ${TEST_TARGETS}
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path python_bazel_tests
+python_bazel_tests/bazel_wrapper test ${BAZEL_FLAGS} ${TEST_TARGETS}
+
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path python_bazel_tests_single_threaded_unary_streams
+python_bazel_tests_single_threaded_unary_streams/bazel_wrapper test --config=python_single_threaded_unary_stream ${BAZEL_FLAGS} ${TEST_TARGETS}
-# TODO(https://github.com/grpc/grpc/issues/19854): Move this to a new Kokoro
-# job.
-(cd /var/local/git/grpc/bazel/test/python_test_repo;
- bazel test --test_output=errors //...
-)
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path python_bazel_tests_poller_engine
+python_bazel_tests_poller_engine/bazel_wrapper test --config=python_poller_engine ${BAZEL_FLAGS} ${TEST_TARGETS}
diff --git a/grpc/tools/internal_ci/linux/grpc_run_interop_tests.sh b/grpc/tools/internal_ci/linux/grpc_run_interop_tests.sh
index 1f4eda2d..0ebcf384 100755
--- a/grpc/tools/internal_ci/linux/grpc_run_interop_tests.sh
+++ b/grpc/tools/internal_ci/linux/grpc_run_interop_tests.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
export LANG=en_US.UTF-8
# Enter the gRPC repo root
@@ -23,4 +26,7 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
source tools/internal_ci/helper_scripts/prepare_build_interop_rc
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
tools/run_tests/run_interop_tests.py $RUN_TESTS_FLAGS
diff --git a/grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh b/grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh
index a0ce71ae..da208fc1 100755
--- a/grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh
+++ b/grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh
@@ -15,14 +15,20 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
+# configure ccache
+source tools/internal_ci/helper_scripts/prepare_ccache_rc
+
# If this is a PR using RUN_TESTS_FLAGS var, then add flags to filter tests
if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ] && [ -n "$RUN_TESTS_FLAGS" ]; then
- export RUN_TESTS_FLAGS="$RUN_TESTS_FLAGS --filter_pr_tests --base_branch origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH"
+ export RUN_TESTS_FLAGS="--filter_pr_tests --base_branch origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH $RUN_TESTS_FLAGS"
fi
tools/run_tests/run_tests_matrix.py $RUN_TESTS_FLAGS || FAILED="true"
diff --git a/grpc/tools/internal_ci/linux/grpc_trickle_diff.sh b/grpc/tools/internal_ci/linux/grpc_trickle_diff.sh
deleted file mode 100755
index a7640956..00000000
--- a/grpc/tools/internal_ci/linux/grpc_trickle_diff.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 script is invoked by Jenkins and runs a diff on the microbenchmarks
-set -ex
-
-# List of benchmarks that provide good signal for analyzing performance changes in pull requests
-BENCHMARKS_TO_RUN="cli_transport_stalls_per_iteration cli_stream_stalls_per_iteration svr_transport_stalls_per_iteration svr_stream_stalls_per_iteration"
-
-# Enter the gRPC repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_perf_rc
-
-tools/run_tests/start_port_server.py
-tools/internal_ci/linux/run_if_c_cpp_modified.sh tools/profiling/microbenchmarks/bm_diff/bm_main.py \
- -d "origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH" \
- -b bm_fullstack_trickle \
- -l 4 \
- -t $BENCHMARKS_TO_RUN \
- --no-counters \
- --pr_comment_name trickle || FAILED="true"
-
-# kill port_server.py to prevent the build from freezing
-ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
diff --git a/grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh
deleted file mode 100644
index fcf3095d..00000000
--- a/grpc/tools/internal_ci/linux/grpc_tsan_on_foundry.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=tsan --cache_test_results=no
diff --git a/grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh b/grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh
deleted file mode 100644
index f45be4d1..00000000
--- a/grpc/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-export UPLOAD_TEST_RESULTS=true
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=ubsan --cache_test_results=no
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh
index 6fb22b85..d6a4d1b9 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_bazel_python_test_in_docker.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+trap 'date' DEBUG
set -ex -o igncr || set -ex
mkdir -p /var/local/git
@@ -22,8 +23,9 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc
${name}')
cd /var/local/git/grpc
+python3 -m pip install virtualenv
VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV" -p python3
+python3 -m virtualenv "$VIRTUAL_ENV" -p python3
PYTHON="$VIRTUAL_ENV"/bin/python
"$PYTHON" -m pip install --upgrade pip==19.3.1
"$PYTHON" -m pip install --upgrade grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos
@@ -62,14 +64,16 @@ bazel build //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client
# Test cases "path_matching" and "header_matching" are not included in "all",
# because not all interop clients in all languages support these new tests.
+export PYTHONUNBUFFERED=true
GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
tools/run_tests/run_xds_tests.py \
- --test_case="all,circuit_breaking,timeout,fault_injection" \
+ --halt_after_fail \
+ --test_case="ping_pong" \
--project_id=grpc-testing \
--project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-4 \
+ --source_image=projects/grpc-testing/global/images/xds-test-server-5 \
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
${XDS_V3_OPT-} \
- --client_cmd='bazel run --test_env="PYTHONUNBUFFERED=true" //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client -- --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {rpcs_to_send} {metadata_to_send}'
+ --client_cmd='bazel run //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client -- --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {rpcs_to_send} {metadata_to_send}'
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh
index 88257198..c3a4b91f 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+trap 'date' DEBUG
set -ex -o igncr || set -ex
mkdir -p /var/local/git
@@ -22,8 +23,9 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc
${name}')
cd /var/local/git/grpc
+python3 -m pip install virtualenv
VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV" -p python3
+python3 -m virtualenv "$VIRTUAL_ENV" -p python3
PYTHON="$VIRTUAL_ENV"/bin/python
"$PYTHON" -m pip install --upgrade pip==19.3.1
"$PYTHON" -m pip install --upgrade grpcio grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos
@@ -67,10 +69,11 @@ bazel build test/cpp/interop:xds_interop_client
# they are added into "all".
GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
tools/run_tests/run_xds_tests.py \
- --test_case="all,circuit_breaking,timeout,fault_injection,csds" \
+ --halt_after_fail \
+ --test_case="ping_pong" \
--project_id=grpc-testing \
--project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-4 \
+ --source_image=projects/grpc-testing/global/images/xds-test-server-5 \
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_csharp.cfg b/grpc/tools/internal_ci/linux/grpc_xds_csharp.cfg
deleted file mode 100644
index 0208f9b8..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_csharp.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_xds_csharp.sh"
-timeout_mins: 360
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_csharp.sh b/grpc/tools/internal_ci/linux/grpc_xds_csharp.sh
deleted file mode 100755
index 26bb7e35..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_csharp.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-
-export DOCKERFILE_DIR=tools/dockerfile/test/csharp_stretch_x64
-export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh
-export OUTPUT_DIR=reports
-exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh
deleted file mode 100755
index 21b0d4e0..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_csharp_test_in_docker.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env bash
-# 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.
-
-set -ex -o igncr || set -ex
-
-mkdir -p /var/local/git
-git clone /var/local/jenkins/grpc /var/local/git/grpc
-(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
-&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
-${name}')
-cd /var/local/git/grpc
-
-VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV" -p python3
-PYTHON="$VIRTUAL_ENV"/bin/python
-"$PYTHON" -m pip install --upgrade pip==19.3.1
-"$PYTHON" -m pip install --upgrade grpcio grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos
-
-# Prepare generated Python code.
-TOOLS_DIR=tools/run_tests
-PROTO_SOURCE_DIR=src/proto/grpc/testing
-PROTO_DEST_DIR="$TOOLS_DIR"/"$PROTO_SOURCE_DIR"
-mkdir -p "$PROTO_DEST_DIR"
-touch "$TOOLS_DIR"/src/__init__.py
-touch "$TOOLS_DIR"/src/proto/__init__.py
-touch "$TOOLS_DIR"/src/proto/grpc/__init__.py
-touch "$TOOLS_DIR"/src/proto/grpc/testing/__init__.py
-
-"$PYTHON" -m grpc_tools.protoc \
- --proto_path=. \
- --python_out="$TOOLS_DIR" \
- --grpc_python_out="$TOOLS_DIR" \
- "$PROTO_SOURCE_DIR"/test.proto \
- "$PROTO_SOURCE_DIR"/messages.proto \
- "$PROTO_SOURCE_DIR"/empty.proto
-
-HEALTH_PROTO_SOURCE_DIR=src/proto/grpc/health/v1
-HEALTH_PROTO_DEST_DIR=${TOOLS_DIR}/${HEALTH_PROTO_SOURCE_DIR}
-mkdir -p ${HEALTH_PROTO_DEST_DIR}
-touch "$TOOLS_DIR"/src/proto/grpc/health/__init__.py
-touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py
-
-"$PYTHON" -m grpc_tools.protoc \
- --proto_path=. \
- --python_out=${TOOLS_DIR} \
- --grpc_python_out=${TOOLS_DIR} \
- ${HEALTH_PROTO_SOURCE_DIR}/health.proto
-
-python tools/run_tests/run_tests.py -l csharp -c opt --build_only
-
-# Test cases "path_matching" and "header_matching" are not included in "all",
-# because not all interop clients in all languages support these new tests.
-#
-# TODO(jtattermusch): remove "path_matching" and "header_matching" from
-# --test_case after they are added into "all".
-GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
- tools/run_tests/run_xds_tests.py \
- --test_case="all,path_matching,header_matching" \
- --project_id=grpc-testing \
- --project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-2 \
- --path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
- --gcp_suffix=$(date '+%s') \
- --verbose \
- ${XDS_V3_OPT-} \
- --client_cmd='dotnet exec src/csharp/Grpc.IntegrationTesting.XdsClient/bin/Release/netcoreapp2.1/Grpc.IntegrationTesting.XdsClient.dll -- --server=xds:///{server_uri} --stats_port={stats_port} --qps={qps} {rpcs_to_send} {metadata_to_send}'
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s.cfg b/grpc/tools/internal_ci/linux/grpc_xds_k8s.cfg
deleted file mode 100644
index c59a3572..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_k8s.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s.sh"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "artifacts/**/*sponge_log.xml"
- regex: "artifacts/**/*sponge_log.log"
- strip_prefix: "artifacts"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s.sh
deleted file mode 100755
index a8cbf5d6..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_k8s.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex -o igncr || set -ex
-
-# Constants
-readonly GITHUB_REPOSITORY_NAME="grpc"
-# GKE Cluster
-readonly GKE_CLUSTER_NAME="interop-test-psm-sec-v2-us-central1-a"
-readonly GKE_CLUSTER_ZONE="us-central1-a"
-## xDS test server/client Docker images
-readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
-readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
-readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
-readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
-
-#######################################
-# Builds test app Docker images and pushes them to GCR
-# Globals:
-# BUILD_APP_PATH
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# Arguments:
-# None
-# Outputs:
-# Writes the output of `gcloud builds submit` to stdout, stderr
-#######################################
-build_test_app_docker_images() {
- echo "Building C++ xDS interop test app Docker images"
- docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
- docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
- gcloud -q auth configure-docker
- docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
- docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
-}
-
-#######################################
-# Builds test app and its docker images unless they already exist
-# Globals:
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# FORCE_IMAGE_BUILD
-# Arguments:
-# None
-# Outputs:
-# Writes the output to stdout, stderr
-#######################################
-build_docker_images_if_needed() {
- # Check if images already exist
- server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
- printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
- echo "${server_tags:-Server image not found}"
-
- client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
- printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
- echo "${client_tags:-Client image not found}"
-
- # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
- if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
- build_test_app_docker_images
- else
- echo "Skipping C++ test app build"
- fi
-}
-
-#######################################
-# Executes the test case
-# Globals:
-# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
-# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
-# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# Arguments:
-# Test case name
-# Outputs:
-# Writes the output of test execution to stdout, stderr
-# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
-#######################################
-run_test() {
- # Test driver usage:
- # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
- local test_name="${1:?Usage: run_test test_name}"
- set -x
- python -m "tests.${test_name}" \
- --flagfile="${TEST_DRIVER_FLAGFILE}" \
- --kube_context="${KUBE_CONTEXT}" \
- --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
- --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
- --xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml" \
- --force_cleanup \
- --nocheck_local_certs
- set +x
-}
-
-#######################################
-# Main function: provision software necessary to execute tests, and run them
-# Globals:
-# KOKORO_ARTIFACTS_DIR
-# GITHUB_REPOSITORY_NAME
-# SRC_DIR: Populated with absolute path to the source repo
-# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
-# the test driver
-# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
-# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
-# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
-# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
-# GIT_COMMIT: Populated with the SHA-1 of git commit being built
-# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
-# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
-# Arguments:
-# None
-# Outputs:
-# Writes the output of test execution to stdout, stderr
-#######################################
-main() {
- local script_dir
- script_dir="$(dirname "$0")"
- # shellcheck source=tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh
- source "${script_dir}/grpc_xds_k8s_install_test_driver.sh"
- set -x
- if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
- kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
- else
- local_setup_test_driver "${script_dir}"
- fi
- build_docker_images_if_needed
- # Run tests
- cd "${TEST_DRIVER_FULL_DIR}"
- run_test baseline_test
- run_test security_test
-}
-
-main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh
index d7f50fb7..77ab0d51 100644
--- a/grpc/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh
@@ -19,11 +19,77 @@ set -eo pipefail
readonly PYTHON_VERSION="3.6"
# Test driver
readonly TEST_DRIVER_REPO_NAME="grpc"
-readonly TEST_DRIVER_REPO_URL="https://github.com/grpc/grpc.git"
+readonly TEST_DRIVER_REPO_URL="https://github.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc.git"
readonly TEST_DRIVER_BRANCH="${TEST_DRIVER_BRANCH:-master}"
readonly TEST_DRIVER_PATH="tools/run_tests/xds_k8s_test_driver"
readonly TEST_DRIVER_PROTOS_PATH="src/proto/grpc/testing"
+# GKE cluster identifiers.
+readonly GKE_CLUSTER_PSM_LB="psm-lb"
+readonly GKE_CLUSTER_PSM_SECURITY="psm-security"
+readonly GKE_CLUSTER_PSM_BASIC="psm-basic"
+
+#######################################
+# Determines the cluster name and zone based on the given cluster identifier.
+# Globals:
+# GKE_CLUSTER_NAME: Set to reflect the cluster name to use
+# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use.
+# Arguments:
+# The cluster identifier
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+activate_gke_cluster() {
+ case $1 in
+ GKE_CLUSTER_PSM_LB)
+ GKE_CLUSTER_NAME="interop-test-psm-lb-v1-us-central1-a"
+ GKE_CLUSTER_ZONE="us-central1-a"
+ ;;
+ GKE_CLUSTER_PSM_SECURITY)
+ GKE_CLUSTER_NAME="interop-test-psm-sec-v2-us-central1-a"
+ GKE_CLUSTER_ZONE="us-central1-a"
+ ;;
+ GKE_CLUSTER_PSM_BASIC)
+ GKE_CLUSTER_NAME="interop-test-psm-basic"
+ GKE_CLUSTER_ZONE="us-central1-c"
+ ;;
+ *)
+ echo "Unknown GKE cluster: ${1}"
+ exit 1
+ ;;
+ esac
+ echo "Activated GKE cluster: GKE_CLUSTER_NAME=${GKE_CLUSTER_NAME} GKE_CLUSTER_ZONE=${GKE_CLUSTER_ZONE}"
+}
+
+#######################################
+# Determines the secondary cluster name and zone based on the given cluster
+# identifier.
+# Globals:
+# GKE_CLUSTER_NAME: Set to reflect the cluster name to use
+# GKE_CLUSTER_ZONE: Set to reflect the cluster zone to use.
+# Arguments:
+# The cluster identifier
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+activate_secondary_gke_cluster() {
+ case $1 in
+ GKE_CLUSTER_PSM_LB)
+ SECONDARY_GKE_CLUSTER_NAME="interop-test-psm-lb-v1-us-west1-b"
+ SECONDARY_GKE_CLUSTER_ZONE="us-west1-b"
+ ;;
+ GKE_CLUSTER_PSM_SECURITY)
+ SECONDARY_GKE_CLUSTER_NAME="interop-test-psm-sec-v2-us-west1-b"
+ SECONDARY_GKE_CLUSTER_ZONE="us-west1-b"
+ ;;
+ *)
+ echo "Unknown secondary GKE cluster: ${1}"
+ exit 1
+ ;;
+ esac
+ echo "Activated secondary GKE cluster: GKE_CLUSTER_NAME=${GKE_CLUSTER_NAME} GKE_CLUSTER_ZONE=${GKE_CLUSTER_ZONE}"
+}
+
#######################################
# Run command end report its exit code. Doesn't exit on non-zero exit code.
# Globals:
@@ -55,6 +121,29 @@ parse_src_repo_git_info() {
readonly GIT_COMMIT_SHORT=$(git -C "${src_dir}" rev-parse --short HEAD)
}
+
+#######################################
+# Checks if the given string is a version branch.
+# Version branches: "master", "v1.47.x"
+# NOT version branches: "v1.47.0", "1.47.x", "", "dev", "main"
+# Arguments:
+# Version to test
+#######################################
+is_version_branch() {
+ if [ $# -eq 0 ]; then
+ echo "Usage is_version_branch VERSION"
+ false
+ return
+ fi
+ if [[ $1 == "master" ]]; then
+ true
+ return
+ fi
+ # Do not inline version_regex: keep it a string to avoid issues with escaping chars in ~= expr.
+ local version_regex='^v[0-9]+\.[0-9]+\.x$'
+ [[ "${1}" =~ $version_regex ]]
+}
+
#######################################
# List GCR image tags matching given tag name.
# Arguments:
@@ -87,6 +176,7 @@ gcloud_update() {
# GKE_CLUSTER_NAME
# GKE_CLUSTER_ZONE
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
# Arguments:
# None
# Outputs:
@@ -94,6 +184,12 @@ gcloud_update() {
# Writes authorization info $HOME/.kube/config
#######################################
gcloud_get_cluster_credentials() {
+ if [[ -n "${SECONDARY_GKE_CLUSTER_NAME}" && -n "${SECONDARY_GKE_CLUSTER_ZONE}" ]]; then
+ gcloud container clusters get-credentials "${SECONDARY_GKE_CLUSTER_NAME}" --zone "${SECONDARY_GKE_CLUSTER_ZONE}"
+ readonly SECONDARY_KUBE_CONTEXT="$(kubectl config current-context)"
+ else
+ readonly SECONDARY_KUBE_CONTEXT=""
+ fi
gcloud container clusters get-credentials "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}"
readonly KUBE_CONTEXT="$(kubectl config current-context)"
}
@@ -146,16 +242,16 @@ test_driver_pip_install() {
echo "Found python virtual environment directory: ${venv_dir}"
else
echo "Creating python virtual environment: ${venv_dir}"
- "python${PYTHON_VERSION} -m venv ${venv_dir}"
+ "python${PYTHON_VERSION}" -m venv "${venv_dir}"
fi
# Intentional: No need to check python venv activate script.
# shellcheck source=/dev/null
source "${venv_dir}/bin/activate"
fi
- pip install -r requirements.txt
+ python3 -m pip install -r requirements.txt
echo "Installed Python packages:"
- pip list
+ python3 -m pip list
}
#######################################
@@ -181,7 +277,7 @@ test_driver_compile_protos() {
)
echo "Generate python code from grpc.testing protos: ${protos[*]}"
cd "${TEST_DRIVER_REPO_DIR}"
- python -m grpc_tools.protoc \
+ python3 -m grpc_tools.protoc \
--proto_path=. \
--python_out="${TEST_DRIVER_FULL_DIR}" \
--grpc_python_out="${TEST_DRIVER_FULL_DIR}" \
@@ -272,19 +368,21 @@ kokoro_setup_python_virtual_environment() {
pyenv virtualenv --no-pip "${py_latest_patch}" k8s_xds_test_runner
pyenv local k8s_xds_test_runner
pyenv activate k8s_xds_test_runner
- python -m ensurepip
+ python3 -m ensurepip
# pip is fixed to 21.0.1 due to issue https://github.com/pypa/pip/pull/9835
# internal details: b/186411224
# TODO(sergiitk): revert https://github.com/grpc/grpc/pull/26087 when 21.1.1 released
- python -m pip install -U pip==21.0.1
- pip --version
+ python3 -m pip install -U pip==21.0.1
+ python3 -m pip --version
}
#######################################
# Installs and configures the test driver on Kokoro VM.
# Globals:
# KOKORO_ARTIFACTS_DIR
+# KOKORO_JOB_NAME
# TEST_DRIVER_REPO_NAME
+# TESTING_VERSION: Populated with the version branch under test, f.e. v1.42.x, master
# SRC_DIR: Populated with absolute path to the source repo on Kokoro VM
# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
# the test driver
@@ -292,6 +390,7 @@ kokoro_setup_python_virtual_environment() {
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
@@ -305,6 +404,14 @@ kokoro_setup_test_driver() {
# Capture Kokoro VM version info in the log.
kokoro_print_version
+ # All grpc kokoro jobs names structured to have the version identifier in the third position:
+ # - grpc/core/master/linux/...
+ # - grpc/core/v1.42.x/branch/linux/...
+ # - grpc/java/v1.47.x/branch/...
+ # - grpc/go/v1.47.x/branch/...
+ # - grpc/node/v1.6.x/...
+ readonly TESTING_VERSION=$(echo "${KOKORO_JOB_NAME}" | cut -d '/' -f3)
+
# Kokoro clones repo to ${KOKORO_ARTIFACTS_DIR}/github/${GITHUB_REPOSITORY}
local github_root="${KOKORO_ARTIFACTS_DIR}/github"
readonly SRC_DIR="${github_root}/${src_repository_name}"
@@ -334,13 +441,13 @@ kokoro_setup_test_driver() {
# TEST_DRIVER_REPO_DIR: Unless provided, populated with a temporary dir with
# the path to the test driver repo
# SRC_DIR: Populated with absolute path to the source repo
-# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
# GIT_COMMIT: Populated with the SHA-1 of git commit being built
# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
-# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
# Arguments:
# The path to the folder containing the build script
# Outputs:
@@ -349,11 +456,14 @@ kokoro_setup_test_driver() {
local_setup_test_driver() {
local script_dir="${1:?Usage: local_setup_test_driver SCRIPT_DIR}"
readonly SRC_DIR="$(git -C "${script_dir}" rev-parse --show-toplevel)"
- parse_src_repo_git_info SRC_DIR
+ parse_src_repo_git_info "${SRC_DIR}"
readonly KUBE_CONTEXT="${KUBE_CONTEXT:-$(kubectl config current-context)}"
+ readonly SECONDARY_KUBE_CONTEXT="${SECONDARY_KUBE_CONTEXT}"
+
local test_driver_repo_dir
test_driver_repo_dir="${TEST_DRIVER_REPO_DIR:-$(mktemp -d)/${TEST_DRIVER_REPO_NAME}}"
test_driver_install "${test_driver_repo_dir}"
+
# shellcheck disable=SC2034 # Used in the main script
readonly TEST_DRIVER_FLAGFILE="config/local-dev.cfg"
# Test out
@@ -361,3 +471,20 @@ local_setup_test_driver() {
mkdir -p "${TEST_XML_OUTPUT_DIR}"
}
+#######################################
+# Tag and push the given Docker image
+# Arguments:
+# The Docker image name
+# The Docker image original tag name
+# The Docker image new tag name
+# Outputs:
+# Writes the output to stdout, stderr, files
+#######################################
+tag_and_push_docker_image() {
+ local image_name="$1"
+ local from_tag="$2"
+ local to_tag="$3"
+
+ docker tag "${image_name}:${from_tag}" "${image_name}:${to_tag}"
+ docker push "${image_name}:${to_tag}"
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg
new file mode 100644
index 00000000..2bfb18d5
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh"
+timeout_mins: 180
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh
new file mode 100755
index 00000000..7c753777
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb.sh
@@ -0,0 +1,182 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test client Docker images
+readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building C++ xDS interop test app Docker images"
+ docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
+ docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
+ gcloud -q auth configure-docker
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${server_tags:-Server image not found}"
+
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping C++ test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: The name of kubectl context with secondary GKE cluster access, if any
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --secondary_kube_context="${SECONDARY_KUBE_CONTEXT}" \
+ --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --force_cleanup \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ ${@:2} \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+run_alpha_test() {
+ local test_name=$1
+ run_test ${test_name} \
+ --compute_api_version="v1alpha"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test captured from the master branch.
+ echo "Sourcing test driver install captured from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_LB
+ activate_secondary_gke_cluster GKE_CLUSTER_PSM_LB
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ local failed_tests=0
+ run_alpha_test subsetting_test || (( failed_tests++ ))
+ test_suites=("api_listener_test" "change_backend_service_test" "failover_test" "remove_neg_test" "round_robin_test" "affinity_test")
+ for test in "${test_suites[@]}"; do
+ run_test $test || (( failed_tests++ ))
+ done
+ echo "Failed test suites: ${failed_tests}"
+ if (( failed_tests > 0 )); then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.cfg b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.cfg
new file mode 100644
index 00000000..b511c8b6
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh
new file mode 100755
index 00000000..6105cf9f
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh
@@ -0,0 +1,187 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test client Docker images
+readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-server"
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+readonly LANGUAGE_NAME="Python"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
+
+ pushd "${SRC_DIR}"
+ docker build \
+ -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
+ -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ .
+
+ docker build \
+ -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server \
+ -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ .
+
+ popd
+
+ gcloud -q auth configure-docker
+
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
+
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${server_tags:-Server image not found}"
+
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping ${LANGUAGE_NAME} test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: The name of kubectl context with secondary GKE cluster access, if any
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --secondary_kube_context="${SECONDARY_KUBE_CONTEXT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --force_cleanup \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# SECONDARY_KUBE_CONTEXT: Populated with name of kubectl context with secondary GKE cluster access, if any
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_LB
+ activate_secondary_gke_cluster GKE_CLUSTER_PSM_LB
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ local failed_tests=0
+ test_suites=("api_listener_test" "change_backend_service_test" "failover_test" "remove_neg_test" "round_robin_test")
+ for test in "${test_suites[@]}"; do
+ run_test $test || (( failed_tests++ ))
+ done
+ echo "Failed test suites: ${failed_tests}"
+ if (( failed_tests > 0 )); then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.cfg b/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.cfg
deleted file mode 100644
index 82826f19..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_python.sh"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "artifacts/**/*sponge_log.xml"
- regex: "artifacts/**/*sponge_log.log"
- strip_prefix: "artifacts"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.sh
deleted file mode 100755
index b6bbfc2b..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_k8s_python.sh
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex -o igncr || set -ex
-
-# Constants
-readonly GITHUB_REPOSITORY_NAME="grpc"
-# GKE Cluster
-readonly GKE_CLUSTER_NAME="interop-test-psm-sec-v2-us-central1-a"
-readonly GKE_CLUSTER_ZONE="us-central1-a"
-## xDS test server/client Docker images
-readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-server"
-readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
-readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
-readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
-readonly LANGUAGE_NAME="Python"
-
-#######################################
-# Builds test app Docker images and pushes them to GCR
-# Globals:
-# BUILD_APP_PATH
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# Arguments:
-# None
-# Outputs:
-# Writes the output of `gcloud builds submit` to stdout, stderr
-#######################################
-build_test_app_docker_images() {
- echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
-
- pushd "${SRC_DIR}"
- docker build \
- -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
- -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
- .
-
- docker build \
- -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server \
- -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
- .
-
- popd
-
- gcloud -q auth configure-docker
-
- docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
- docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
-}
-
-#######################################
-# Builds test app and its docker images unless they already exist
-# Globals:
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# FORCE_IMAGE_BUILD
-# Arguments:
-# None
-# Outputs:
-# Writes the output to stdout, stderr
-#######################################
-build_docker_images_if_needed() {
- # Check if images already exist
- server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
- printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
- echo "${server_tags:-Server image not found}"
-
- client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
- printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
- echo "${client_tags:-Client image not found}"
-
- # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
- if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
- build_test_app_docker_images
- else
- echo "Skipping ${LANGUAGE_NAME} test app build"
- fi
-}
-
-#######################################
-# Executes the test case
-# Globals:
-# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
-# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
-# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
-# SERVER_IMAGE_NAME: Test server Docker image name
-# CLIENT_IMAGE_NAME: Test client Docker image name
-# GIT_COMMIT: SHA-1 of git commit being built
-# Arguments:
-# Test case name
-# Outputs:
-# Writes the output of test execution to stdout, stderr
-# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
-#######################################
-run_test() {
- # Test driver usage:
- # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
- local test_name="${1:?Usage: run_test test_name}"
- set -x
- python -m "tests.${test_name}" \
- --flagfile="${TEST_DRIVER_FLAGFILE}" \
- --kube_context="${KUBE_CONTEXT}" \
- --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
- --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
- --xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml" \
- --force_cleanup \
- --nocheck_local_certs
- set +x
-}
-
-#######################################
-# Main function: provision software necessary to execute tests, and run them
-# Globals:
-# KOKORO_ARTIFACTS_DIR
-# GITHUB_REPOSITORY_NAME
-# SRC_DIR: Populated with absolute path to the source repo
-# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
-# the test driver
-# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
-# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
-# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
-# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
-# GIT_COMMIT: Populated with the SHA-1 of git commit being built
-# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
-# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
-# Arguments:
-# None
-# Outputs:
-# Writes the output of test execution to stdout, stderr
-#######################################
-main() {
- local script_dir
- script_dir="$(dirname "$0")"
- # shellcheck source=tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh
- source "${script_dir}/grpc_xds_k8s_install_test_driver.sh"
- set -x
- if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
- kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
- else
- local_setup_test_driver "${script_dir}"
- fi
- build_docker_images_if_needed
- # Run tests
- cd "${TEST_DRIVER_FULL_DIR}"
- run_test baseline_test
- run_test security_test
-}
-
-main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.cfg b/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.cfg
new file mode 100644
index 00000000..f84589bc
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh"
+timeout_mins: 540
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh b/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh
new file mode 100755
index 00000000..a147a570
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_k8s_xlang.sh
@@ -0,0 +1,139 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test server/client Docker images
+readonly IMAGE_REPO="gcr.io/grpc-testing/xds-interop"
+readonly SERVER_LANG="cpp go java"
+readonly CLIENT_LANG="cpp go java"
+readonly VERSION_TAG="v1.41.x"
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local tag="${1:?Usage: run_test tag server_lang client_lang}"
+ local slang="${2:?Usage: run_test tag server_lang client_lang}"
+ local clang="${3:?Usage: run_test tag server_lang client_lang}"
+ local server_image_name="${IMAGE_REPO}/${slang}-server:${tag}"
+ local client_image_name="${IMAGE_REPO}/${clang}-client:${tag}"
+ # TODO(sanjaypujare): skip test if image not found (by using gcloud_gcr_list_image_tags)
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${tag}/${clang}-${slang}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python -m "tests.security_test" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --server_image="${server_image_name}" \
+ --client_image="${client_image_name}" \
+ --testing_version="${TESTING_VERSION}" \
+ --nocheck_local_certs \
+ --force_cleanup \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ cd "${TEST_DRIVER_FULL_DIR}"
+ else
+ local_setup_test_driver "${script_dir}"
+ cd "${SRC_DIR}/${TEST_DRIVER_PATH}"
+ fi
+
+ local failed_tests=0
+ local successful_string
+ local failed_string
+ # Run tests
+ for TAG in ${VERSION_TAG}
+ do
+ for CLANG in ${CLIENT_LANG}
+ do
+ for SLANG in ${SERVER_LANG}
+ do
+ if [ "${CLANG}" != "${SLANG}" ]; then
+ if run_test "${TAG}" "${SLANG}" "${CLANG}"; then
+ successful_string="${successful_string} ${TAG}/${CLANG}-${SLANG}"
+ else
+ failed_tests=$((failed_tests+1))
+ failed_string="${failed_string} ${TAG}/${CLANG}-${SLANG}"
+ fi
+ fi
+ done
+ echo "Failed test suites: ${failed_tests}"
+ done
+ done
+ set +x
+ echo "Failed test suites list: ${failed_string}"
+ echo "Successful test suites list: ${successful_string}"
+ if (( failed_tests > 0 )); then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_php.sh b/grpc/tools/internal_ci/linux/grpc_xds_php.sh
index 8b643430..543eeff5 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_php.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_php.sh
@@ -20,7 +20,7 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_stretch_x64
+export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_debian11_x64
export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh
export OUTPUT_DIR=reports
exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh
index 9d879202..37f833e7 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_php_test_in_docker.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+trap 'date' DEBUG
set -ex -o igncr || set -ex
mkdir -p /var/local/git
@@ -22,8 +23,9 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc
${name}')
cd /var/local/git/grpc
+python3 -m pip install virtualenv
VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV" -p python3
+python3 -m virtualenv "$VIRTUAL_ENV" -p python3
PYTHON="$VIRTUAL_ENV"/bin/python
"$PYTHON" -m pip install --upgrade pip==19.3.1
"$PYTHON" -m pip install --upgrade grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos
@@ -72,10 +74,11 @@ export CC=/usr/bin/gcc
GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
tools/run_tests/run_xds_tests.py \
+ --halt_after_fail \
--test_case="timeout,fault_injection" \
--project_id=grpc-testing \
--project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-4 \
+ --source_image=projects/grpc-testing/global/images/xds-test-server-5 \
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
@@ -85,10 +88,11 @@ GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,c
GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
tools/run_tests/run_xds_tests.py \
+ --halt_after_fail \
--test_case="all,path_matching,header_matching" \
--project_id=grpc-testing \
--project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-4 \
+ --source_image=projects/grpc-testing/global/images/xds-test-server-5 \
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.cfg b/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.cfg
new file mode 100644
index 00000000..862273e7
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.cfg
@@ -0,0 +1,25 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.sh"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.sh b/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.sh
new file mode 100644
index 00000000..634ce511
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_resource_cleanup.sh
@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+# Copyright 2021 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.
+
+set -ex
+
+# consts
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+
+cd "$(dirname "$0")/../../.."
+
+# Source the test driver from the master branch.
+echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
+kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+
+cd "${TEST_DRIVER_FULL_DIR}"
+
+# flag resource_prefix is required by the gke test framework, but doesn't
+# matter for the cleanup script.
+python3 -m bin.cleanup.cleanup \
+ --project=grpc-testing \
+ --network=default-vpc \
+ --kube_context="${KUBE_CONTEXT}" \
+ --resource_prefix='required-but-does-not-matter' \
+ --td_bootstrap_image='required-but-does-not-matter' --server_image='required-but-does-not-matter' --client_image='required-but-does-not-matter'
+
+# The BASIC cluster is used by url-map tests. Only cleaning the GKE client
+# namespaces, which won't provide much value in debugging. The keep hours is
+# reduced to 6.
+activate_gke_cluster GKE_CLUSTER_PSM_BASIC
+# Invoking the get-crednetials directly, because the
+# gcloud_get_cluster_credentials re-sets readonly Bash variables, which is nice
+# safety mechanism to keep.
+gcloud container clusters get-credentials "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}"
+TARGET_KUBE_CONTEXT="$(kubectl config current-context)"
+python3 -m bin.cleanup.namespace \
+ --project=grpc-testing \
+ --network=default-vpc \
+ --keep_hours=6 \
+ --kube_context="${TARGET_KUBE_CONTEXT}" \
+ --resource_prefix='required-but-does-not-matter' \
+ --td_bootstrap_image='required-but-does-not-matter' --server_image='required-but-does-not-matter' --client_image='required-but-does-not-matter'
+
+# The PSM_LB cluster is used by k8s_lb tests. Only cleaning the GKE client
+# namespaces, which won't provide much value in debugging. The keep hours is
+# reduced to 6.
+activate_gke_cluster GKE_CLUSTER_PSM_LB
+gcloud container clusters get-credentials "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}"
+TARGET_KUBE_CONTEXT="$(kubectl config current-context)"
+python3 -m bin.cleanup.namespace \
+ --project=grpc-testing \
+ --network=default-vpc \
+ --keep_hours=6 \
+ --kube_context="${TARGET_KUBE_CONTEXT}" \
+ --resource_prefix='required-but-does-not-matter' \
+ --td_bootstrap_image='required-but-does-not-matter' --server_image='required-but-does-not-matter' --client_image='required-but-does-not-matter'
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_ruby.sh b/grpc/tools/internal_ci/linux/grpc_xds_ruby.sh
index e1df4971..22577328 100644
--- a/grpc/tools/internal_ci/linux/grpc_xds_ruby.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_ruby.sh
@@ -20,7 +20,7 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-export DOCKERFILE_DIR=tools/dockerfile/test/ruby_buster_x64
+export DOCKERFILE_DIR=tools/dockerfile/test/ruby_debian11_x64
export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh
export OUTPUT_DIR=reports
exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh
index 6c76f92a..23cabd3e 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_ruby_test_in_docker.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+trap 'date' DEBUG
set -ex -o igncr || set -ex
mkdir -p /var/local/git
@@ -22,8 +23,9 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc
${name}')
cd /var/local/git/grpc
+python3 -m pip install virtualenv
VIRTUAL_ENV=$(mktemp -d)
-virtualenv "$VIRTUAL_ENV" -p python3
+python3 -m virtualenv "$VIRTUAL_ENV" -p python3
PYTHON="$VIRTUAL_ENV"/bin/python
"$PYTHON" -m pip install --upgrade pip==19.3.1
"$PYTHON" -m pip install --upgrade grpcio-tools google-api-python-client google-auth-httplib2 oauth2client xds-protos
@@ -58,14 +60,15 @@ touch "$TOOLS_DIR"/src/proto/grpc/health/v1/__init__.py
--grpc_python_out=${TOOLS_DIR} \
${HEALTH_PROTO_SOURCE_DIR}/health.proto
-(cd src/ruby && bundle && rake compile)
+(cd src/ruby && bundle && bundle exec rake compile)
GRPC_VERBOSITY=debug GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb "$PYTHON" \
tools/run_tests/run_xds_tests.py \
+ --halt_after_fail \
--test_case="all,circuit_breaking,timeout,fault_injection" \
--project_id=grpc-testing \
--project_num=830293263384 \
- --source_image=projects/grpc-testing/global/images/xds-test-server-4 \
+ --source_image=projects/grpc-testing/global/images/xds-test-server-5 \
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \
--gcp_suffix=$(date '+%s') \
--verbose \
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_url_map.cfg b/grpc/tools/internal_ci/linux/grpc_xds_url_map.cfg
new file mode 100644
index 00000000..9ac47292
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_url_map.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_url_map.sh"
+timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_url_map.sh b/grpc/tools/internal_ci/linux/grpc_xds_url_map.sh
new file mode 100755
index 00000000..30de7b1d
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_url_map.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test client Docker images
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building C++ xDS interop test app Docker images"
+ docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
+ gcloud -q auth configure-docker
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping C++ test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --flagfile="config/url-map.cfg" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_BASIC
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ run_test url_map
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.cfg b/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.cfg
new file mode 100644
index 00000000..4e91dc5b
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh"
+timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh b/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh
new file mode 100755
index 00000000..ccbaa1b8
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/grpc_xds_url_map_python.sh
@@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test client Docker images
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+readonly LANGUAGE_NAME="Python"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
+
+ pushd "${SRC_DIR}"
+ docker build \
+ -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
+ -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ .
+
+ popd
+
+ gcloud -q auth configure-docker
+
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping ${LANGUAGE_NAME} test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --flagfile="config/url-map.cfg" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_BASIC
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ run_test url_map
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.cfg b/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.cfg
deleted file mode 100644
index 5ca9153b..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.sh"
-timeout_mins: 360
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.sh b/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.sh
deleted file mode 100755
index 64b986c3..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-# change to grpc repo root
-cd $(dirname $0)/../../..
-
-source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-
-export DOCKERFILE_DIR=tools/dockerfile/test/csharp_stretch_x64
-export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_v3_csharp_test_in_docker.sh
-export OUTPUT_DIR=reports
-exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp_test_in_docker.sh b/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp_test_in_docker.sh
deleted file mode 100755
index 6ea3d41b..00000000
--- a/grpc/tools/internal_ci/linux/grpc_xds_v3_csharp_test_in_docker.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2021 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-XDS_V3_OPT="--xds_v3_support" `dirname $0`/grpc_xds_csharp_test_in_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_v3_php.sh b/grpc/tools/internal_ci/linux/grpc_xds_v3_php.sh
index eebbc285..760baf50 100755
--- a/grpc/tools/internal_ci/linux/grpc_xds_v3_php.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_v3_php.sh
@@ -20,7 +20,7 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_stretch_x64
+export DOCKERFILE_DIR=tools/dockerfile/test/php73_zts_debian11_x64
export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_v3_php_test_in_docker.sh
export OUTPUT_DIR=reports
exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh b/grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh
index 32aee712..260b884c 100644
--- a/grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh
+++ b/grpc/tools/internal_ci/linux/grpc_xds_v3_ruby.sh
@@ -20,7 +20,7 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
-export DOCKERFILE_DIR=tools/dockerfile/test/ruby_buster_x64
+export DOCKERFILE_DIR=tools/dockerfile/test/ruby_debian11_x64
export DOCKER_RUN_SCRIPT=tools/internal_ci/linux/grpc_xds_v3_ruby_test_in_docker.sh
export OUTPUT_DIR=reports
exec tools/run_tests/dockerize/build_and_run_docker.sh
diff --git a/grpc/tools/internal_ci/linux/psm-security-python.cfg b/grpc/tools/internal_ci/linux/psm-security-python.cfg
new file mode 100644
index 00000000..02fe4044
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/psm-security-python.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/psm-security-python.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/psm-security-python.sh b/grpc/tools/internal_ci/linux/psm-security-python.sh
new file mode 100755
index 00000000..5781388c
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/psm-security-python.sh
@@ -0,0 +1,187 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test server/client Docker images
+readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-server"
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/python-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+readonly LANGUAGE_NAME="Python"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building ${LANGUAGE_NAME} xDS interop test app Docker images"
+
+ pushd "${SRC_DIR}"
+ docker build \
+ -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.client \
+ -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ .
+
+ docker build \
+ -f src/python/grpcio_tests/tests_py3_only/interop/Dockerfile.server \
+ -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ .
+
+ popd
+
+ gcloud -q auth configure-docker
+
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
+
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${server_tags:-Server image not found}"
+
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping ${LANGUAGE_NAME} test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --nocheck_local_certs \
+ --force_cleanup \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+ set +x
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ local failed_tests=0
+ test_suites=("baseline_test" "security_test")
+ for test in "${test_suites[@]}"; do
+ run_test $test || (( failed_tests++ ))
+ done
+ echo "Failed test suites: ${failed_tests}"
+ if (( failed_tests > 0 )); then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/psm-security.cfg b/grpc/tools/internal_ci/linux/psm-security.cfg
new file mode 100644
index 00000000..9b00aaf4
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/psm-security.cfg
@@ -0,0 +1,26 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/psm-security.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "artifacts/**/*sponge_log.xml"
+ regex: "artifacts/**/*.log"
+ strip_prefix: "artifacts"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/psm-security.sh b/grpc/tools/internal_ci/linux/psm-security.sh
new file mode 100755
index 00000000..72eb110f
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/psm-security.sh
@@ -0,0 +1,171 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+# Constants
+readonly GITHUB_REPOSITORY_NAME="grpc"
+readonly TEST_DRIVER_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${TEST_DRIVER_REPO_OWNER:-grpc}/grpc/${TEST_DRIVER_BRANCH:-master}/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
+## xDS test server/client Docker images
+readonly SERVER_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-server"
+readonly CLIENT_IMAGE_NAME="gcr.io/grpc-testing/xds-interop/cpp-client"
+readonly FORCE_IMAGE_BUILD="${FORCE_IMAGE_BUILD:-0}"
+readonly BUILD_APP_PATH="interop-testing/build/install/grpc-interop-testing"
+
+#######################################
+# Builds test app Docker images and pushes them to GCR
+# Globals:
+# BUILD_APP_PATH
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test, f.e. v1.42.x, master
+# Arguments:
+# None
+# Outputs:
+# Writes the output of `gcloud builds submit` to stdout, stderr
+#######################################
+build_test_app_docker_images() {
+ echo "Building C++ xDS interop test app Docker images"
+ docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client" -t "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
+ docker build -f "${SRC_DIR}/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server" -t "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" "${SRC_DIR}"
+ gcloud -q auth configure-docker
+ docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}"
+ docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}"
+ if is_version_branch "${TESTING_VERSION}"; then
+ tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${TESTING_VERSION}"
+ fi
+}
+
+#######################################
+# Builds test app and its docker images unless they already exist
+# Globals:
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# FORCE_IMAGE_BUILD
+# Arguments:
+# None
+# Outputs:
+# Writes the output to stdout, stderr
+#######################################
+build_docker_images_if_needed() {
+ # Check if images already exist
+ server_tags="$(gcloud_gcr_list_image_tags "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Server image: %s:%s\n" "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${server_tags:-Server image not found}"
+
+ client_tags="$(gcloud_gcr_list_image_tags "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}")"
+ printf "Client image: %s:%s\n" "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}"
+ echo "${client_tags:-Client image not found}"
+
+ # Build if any of the images are missing, or FORCE_IMAGE_BUILD=1
+ if [[ "${FORCE_IMAGE_BUILD}" == "1" || -z "${server_tags}" || -z "${client_tags}" ]]; then
+ build_test_app_docker_images
+ else
+ echo "Skipping C++ test app build"
+ fi
+}
+
+#######################################
+# Executes the test case
+# Globals:
+# TEST_DRIVER_FLAGFILE: Relative path to test driver flagfile
+# KUBE_CONTEXT: The name of kubectl context with GKE cluster access
+# TEST_XML_OUTPUT_DIR: Output directory for the test xUnit XML report
+# SERVER_IMAGE_NAME: Test server Docker image name
+# CLIENT_IMAGE_NAME: Test client Docker image name
+# GIT_COMMIT: SHA-1 of git commit being built
+# TESTING_VERSION: version branch under test: used by the framework to determine the supported PSM
+# features.
+# Arguments:
+# Test case name
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml
+#######################################
+run_test() {
+ # Test driver usage:
+ # https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
+ local test_name="${1:?Usage: run_test test_name}"
+ local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
+ mkdir -pv "${out_dir}"
+ set -x
+ python3 -m "tests.${test_name}" \
+ --flagfile="${TEST_DRIVER_FLAGFILE}" \
+ --kube_context="${KUBE_CONTEXT}" \
+ --server_image="${SERVER_IMAGE_NAME}:${GIT_COMMIT}" \
+ --client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
+ --testing_version="${TESTING_VERSION}" \
+ --nocheck_local_certs \
+ --force_cleanup \
+ --collect_app_logs \
+ --log_dir="${out_dir}" \
+ --xml_output_file="${out_dir}/sponge_log.xml" \
+ |& tee "${out_dir}/sponge_log.log"
+}
+
+#######################################
+# Main function: provision software necessary to execute tests, and run them
+# Globals:
+# KOKORO_ARTIFACTS_DIR
+# GITHUB_REPOSITORY_NAME
+# SRC_DIR: Populated with absolute path to the source repo
+# TEST_DRIVER_REPO_DIR: Populated with the path to the repo containing
+# the test driver
+# TEST_DRIVER_FULL_DIR: Populated with the path to the test driver source code
+# TEST_DRIVER_FLAGFILE: Populated with relative path to test driver flagfile
+# TEST_XML_OUTPUT_DIR: Populated with the path to test xUnit XML report
+# GIT_ORIGIN_URL: Populated with the origin URL of git repo used for the build
+# GIT_COMMIT: Populated with the SHA-1 of git commit being built
+# GIT_COMMIT_SHORT: Populated with the short SHA-1 of git commit being built
+# KUBE_CONTEXT: Populated with name of kubectl context with GKE cluster access
+# Arguments:
+# None
+# Outputs:
+# Writes the output of test execution to stdout, stderr
+#######################################
+main() {
+ local script_dir
+ script_dir="$(dirname "$0")"
+
+ # Source the test driver from the master branch.
+ echo "Sourcing test driver install script from: ${TEST_DRIVER_INSTALL_SCRIPT_URL}"
+ source /dev/stdin <<< "$(curl -s "${TEST_DRIVER_INSTALL_SCRIPT_URL}")"
+
+ activate_gke_cluster GKE_CLUSTER_PSM_SECURITY
+
+ set -x
+ if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
+ kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"
+ else
+ local_setup_test_driver "${script_dir}"
+ fi
+ build_docker_images_if_needed
+ # Run tests
+ cd "${TEST_DRIVER_FULL_DIR}"
+ local failed_tests=0
+ test_suites=("baseline_test" "security_test")
+ for test in "${test_suites[@]}"; do
+ run_test $test || (( failed_tests++ ))
+ done
+ echo "Failed test suites: ${failed_tests}"
+ if (( failed_tests > 0 )); then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh
deleted file mode 100644
index 00f92921..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=asan
-
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_dbg.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_dbg.cfg
deleted file mode 100644
index 249ecc99..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_dbg.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux c dbg --inner_jobs 16 -j 1 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_opt.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_opt.cfg
deleted file mode 100644
index 665d7f3d..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_c_opt.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux c opt --inner_jobs 16 -j 1 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_dbg.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_dbg.cfg
deleted file mode 100644
index 163274d4..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_dbg.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux c++ dbg --inner_jobs 16 -j 1 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_opt.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_opt.cfg
deleted file mode 100644
index b65cd3e0..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_cpp_opt.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux c++ opt --inner_jobs 16 -j 1 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_csharp.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_csharp.cfg
index 6a7029d9..31873ea3 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_csharp.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_csharp.cfg
@@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux csharp --inner_jobs 16 -j 2 --internal_ci --max_time=3600"
+ value: "-f basictests linux csharp --inner_jobs 4 -j 1 --internal_ci --max_time=3600"
}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_multilang.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_multilang.cfg
deleted file mode 100644
index 59f38f0d..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_multilang.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux multilang --inner_jobs 16 -j 2 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_node.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_node.cfg
deleted file mode 100644
index a0c67cc1..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_basictests_node.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_run_tests_matrix.sh"
-timeout_mins: 60
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests linux grpc-node --inner_jobs 16 -j 2 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh
deleted file mode 100644
index 6cf7a881..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-EXTRA_FLAGS="--config=dbg"
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh
deleted file mode 100644
index 76df0b24..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-EXTRA_FLAGS="--config=opt"
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}"
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg
index 5c794b8a..bd8b1c50 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_asan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_asan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,9 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=asan"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg
index c1aaf0c2..aa46e014 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_dbg.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_dbg.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -26,4 +32,10 @@ bazel_setting {
# set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
-} \ No newline at end of file
+}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=dbg"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg
index 078a6ae6..ea0f6de9 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_msan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,9 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=msan"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg
index cc6173dc..25f9376c 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_opt.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_bazel_on_foundry_opt.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -26,4 +32,10 @@ bazel_setting {
# set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
-} \ No newline at end of file
+}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=opt"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg
index 1b595b26..83dbe379 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_tsan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,9 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=tsan"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg
index b81692e8..9187af3b 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bazel_rbe_ubsan.cfg
@@ -15,8 +15,14 @@
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh"
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel_rbe.sh"
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
@@ -27,3 +33,9 @@ bazel_setting {
# command is invoked).
upsalite_frontend_address: "https://source.cloud.google.com"
}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--config=ubsan"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_bloat_diff.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_bloat_diff.cfg
new file mode 100644
index 00000000..e4b9dc1d
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_bloat_diff.cfg
@@ -0,0 +1,33 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_bloat_diff.sh"
+timeout_mins: 120
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_checks_private_key"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_build_artifacts.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_build_artifacts.cfg
new file mode 100644
index 00000000..8fcc5e77
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_build_artifacts.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_build_artifacts.sh"
+timeout_mins: 180
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..fa9cf177
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_csharp.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_csharp.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_php.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_php.cfg
new file mode 100644
index 00000000..cc5f4f74
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_php.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_php.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_python.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_python.cfg
new file mode 100644
index 00000000..de62ae1c
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_python.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_python.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_ruby.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_ruby.cfg
new file mode 100644
index 00000000..3963c5b5
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_ruby.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_ruby.sh"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_standalone.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_standalone.cfg
new file mode 100644
index 00000000..b7e27a97
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_distribtests_standalone.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_distribtests_standalone.sh"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_feature_example_tests.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_feature_example_tests.cfg
new file mode 100644
index 00000000..1c7eb6b5
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_feature_example_tests.cfg
@@ -0,0 +1,29 @@
+# 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_bazel.sh"
+timeout_mins: 30
+env_vars {
+ key: "BAZEL_SCRIPT"
+ value: "tools/internal_ci/linux/grpc_feature_example_tests.sh"
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_interop_matrix_adhoc.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_interop_matrix_adhoc.cfg
index 6726384f..3c202fdf 100644
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_interop_matrix_adhoc.cfg
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_interop_matrix_adhoc.cfg
@@ -16,7 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_interop_matrix.sh"
-timeout_mins: 300
+timeout_mins: 600
action {
define_artifacts {
regex: "**/sponge_log.xml"
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_memory_diff.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_memory_diff.cfg
new file mode 100644
index 00000000..19285d4b
--- /dev/null
+++ b/grpc/tools/internal_ci/linux/pull_request/grpc_memory_diff.cfg
@@ -0,0 +1,33 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/linux/grpc_memory_diff.sh"
+timeout_mins: 120
+before_action {
+ fetch_keystore {
+ keystore_resource {
+ keystore_config_id: 73836
+ keyname: "grpc_checks_private_key"
+ }
+ }
+}
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh
deleted file mode 100644
index c85a837a..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_msan_on_foundry.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2018 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.
-
-set -ex
-
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=msan
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_trickle_diff.cfg b/grpc/tools/internal_ci/linux/pull_request/grpc_trickle_diff.cfg
deleted file mode 100644
index 69e44276..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_trickle_diff.cfg
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/linux/grpc_trickle_diff.sh"
-timeout_mins: 120
-before_action {
- fetch_keystore {
- keystore_resource {
- keystore_config_id: 73836
- keyname: "grpc_checks_private_key"
- }
- }
-}
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh
deleted file mode 100644
index f3e98e63..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_tsan_on_foundry.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=tsan
diff --git a/grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh b/grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh
deleted file mode 100644
index b94935ea..00000000
--- a/grpc/tools/internal_ci/linux/pull_request/grpc_ubsan_on_foundry.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh --config=ubsan
diff --git a/grpc/tools/internal_ci/linux/run_performance_profile_daily.sh b/grpc/tools/internal_ci/linux/run_performance_profile_daily.sh
deleted file mode 100755
index 45c7a998..00000000
--- a/grpc/tools/internal_ci/linux/run_performance_profile_daily.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-# 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.
-
-set -ex
-
-cd $(dirname $0)/../../..
-
-# try to use pypy for generating reports
-# each trace dumps 7-8gig of text to disk, and processing this into a report is
-# heavyweight - so any speed boost is worthwhile
-# TODO(ctiller): consider rewriting report generation in C++ for performance
-if which pypy >/dev/null; then
- PYTHON=pypy
-else
- PYTHON=python2.7
-fi
-
-BENCHMARKS_TO_RUN="bm_fullstack_unary_ping_pong bm_fullstack_streaming_ping_pong bm_fullstack_streaming_pump bm_closure bm_cq bm_call_create bm_error bm_chttp2_hpack bm_chttp2_transport bm_pollset bm_metadata"
-
-./tools/run_tests/start_port_server.py || true
-
-$PYTHON tools/run_tests/run_microbenchmark.py --collect summary perf latency -b $BENCHMARKS_TO_RUN
diff --git a/grpc/tools/internal_ci/linux/run_performance_profile_hourly.sh b/grpc/tools/internal_ci/linux/run_performance_profile_hourly.sh
deleted file mode 100755
index bcb4ea23..00000000
--- a/grpc/tools/internal_ci/linux/run_performance_profile_hourly.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# 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.
-
-set -ex
-
-cd $(dirname $0)/../../..
-
-./tools/run_tests/start_port_server.py || true
-
-CPUS=`python -c 'import multiprocessing; print multiprocessing.cpu_count()'`
-
-tools/run_tests/run_microbenchmark.py --collect summary --bigquery_upload
diff --git a/grpc/tools/internal_ci/macos/grpc_basictests_node.cfg b/grpc/tools/internal_ci/macos/grpc_basictests_node.cfg
deleted file mode 100644
index b2ea7bc5..00000000
--- a/grpc/tools/internal_ci/macos/grpc_basictests_node.cfg
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh"
-gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests macos grpc-node --internal_ci -j 1 --inner_jobs 4 --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg b/grpc/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg
index ccc27e8f..62735d8b 100644
--- a/grpc/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg
+++ b/grpc/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg
@@ -17,3 +17,24 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
+
+bazel_setting {
+ # In order for Kokoro to recognize this as a bazel build and publish the bazel resultstore link,
+ # the bazel_setting section needs to be present and "upsalite_frontend_address" needs to be
+ # set. The rest of configuration from bazel_setting is unused (we configure everything when bazel
+ # command is invoked).
+ upsalite_frontend_address: "https://source.cloud.google.com"
+}
+
+env_vars {
+ # flags will be passed to bazel invocation
+ key: "BAZEL_FLAGS"
+ value: "--cache_test_results=no"
+}
+
+env_vars {
+ key: "UPLOAD_TEST_RESULTS"
+ value: "true"
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_build_artifacts.cfg b/grpc/tools/internal_ci/macos/grpc_build_artifacts.cfg
index ece18c14..ff4a05e0 100644
--- a/grpc/tools/internal_ci/macos/grpc_build_artifacts.cfg
+++ b/grpc/tools/internal_ci/macos/grpc_build_artifacts.cfg
@@ -17,7 +17,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_build_artifacts.sh"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
-timeout_mins: 150
+timeout_mins: 240
action {
define_artifacts {
regex: "**/*sponge_log.*"
diff --git a/grpc/tools/internal_ci/macos/grpc_build_artifacts.sh b/grpc/tools/internal_ci/macos/grpc_build_artifacts.sh
index 02b2331f..1011a00d 100755
--- a/grpc/tools/internal_ci/macos/grpc_build_artifacts.sh
+++ b/grpc/tools/internal_ci/macos/grpc_build_artifacts.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -24,6 +27,7 @@ export PREPARE_BUILD_INSTALL_DEPS_RUBY=true
export PREPARE_BUILD_INSTALL_DEPS_PHP=true
source tools/internal_ci/helper_scripts/prepare_build_macos_rc
+# TODO(jtattermusch): cleanup this prepare build step (needed for python artifact build)
# install cython for all python versions
python2.7 -m pip install -U cython setuptools==44.1.1 wheel --user
python3.5 -m pip install -U cython setuptools==44.1.1 wheel --user
@@ -32,15 +36,12 @@ python3.7 -m pip install -U cython setuptools==44.1.1 wheel --user
python3.8 -m pip install -U cython setuptools==44.1.1 wheel --user
python3.9 -m pip install -U cython setuptools==44.1.1 wheel --user
-# needed to build ruby artifacts
-time bash tools/distrib/build_ruby_environment_macos.sh
-
gem install rubygems-update
update_rubygems
-tools/run_tests/task_runner.py -f artifact macos || FAILED="true"
+tools/run_tests/task_runner.py -f artifact macos ${TASK_RUNNER_EXTRA_FILTERS} || FAILED="true"
-tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
if [ "$FAILED" != "" ]
then
diff --git a/grpc/tools/internal_ci/macos/grpc_cfstream.cfg b/grpc/tools/internal_ci/macos/grpc_cfstream.cfg
index fd8c7c8f..48e4a1d1 100644
--- a/grpc/tools/internal_ci/macos/grpc_cfstream.cfg
+++ b/grpc/tools/internal_ci/macos/grpc_cfstream.cfg
@@ -16,4 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh"
-
+env_vars {
+ key: "RUN_TESTS_FLAGS"
+ value: "--config=macos"
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_cfstream_tsan.cfg b/grpc/tools/internal_ci/macos/grpc_cfstream_tsan.cfg
index a72a8456..e86dc1b7 100644
--- a/grpc/tools/internal_ci/macos/grpc_cfstream_tsan.cfg
+++ b/grpc/tools/internal_ci/macos/grpc_cfstream_tsan.cfg
@@ -18,6 +18,6 @@
build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh"
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "--config=tsan"
+ value: "--config=tsan_macos"
}
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests.sh b/grpc/tools/internal_ci/macos/grpc_distribtests.sh
index cf2ba090..919121b6 100644
--- a/grpc/tools/internal_ci/macos/grpc_distribtests.sh
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -26,11 +29,4 @@ source tools/internal_ci/helper_scripts/prepare_build_macos_rc
mv ${KOKORO_GFILE_DIR}/github/grpc/artifacts input_artifacts || true
ls -R input_artifacts || true
-tools/run_tests/task_runner.py -f distribtest macos || FAILED="true"
-
-tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
+tools/run_tests/task_runner.py -f distribtest macos
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..0a84e7ce
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.cfg
@@ -0,0 +1,27 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh b/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh
new file mode 100644
index 00000000..de07fc9e
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+export PREPARE_BUILD_INSTALL_DEPS_CSHARP=true
+source tools/internal_ci/helper_scripts/prepare_build_macos_rc
+
+# Build all C# macos artifacts
+tools/run_tests/task_runner.py -f artifact macos csharp ${TASK_RUNNER_EXTRA_FILTERS} -j 2 --inner_jobs 4 -x build_artifacts_csharp/sponge_log.xml || FAILED="true"
+
+# Build all protoc macos artifacts
+tools/run_tests/task_runner.py -f artifact macos protoc ${TASK_RUNNER_EXTRA_FILTERS} -j 2 --inner_jobs 4 -x build_artifacts_protoc/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# This step builds the nuget packages from input_artifacts
+# Set env variable option to build single platform version of the nugets.
+# (this is required as we only have the macos artifacts at hand)
+GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET=1 tools/run_tests/task_runner.py -f package macos csharp nuget -j 2 -x build_packages/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# Run all C# macos distribtests
+# We run the distribtests even if some of the artifacts have failed to build, since that gives
+# a better signal about which distribtest are affected by the currently broken artifact builds.
+tools/run_tests/task_runner.py -f distribtest macos csharp ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_php.cfg b/grpc/tools/internal_ci/macos/grpc_distribtests_php.cfg
new file mode 100644
index 00000000..e06b917a
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_php.cfg
@@ -0,0 +1,27 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_php.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_php.sh b/grpc/tools/internal_ci/macos/grpc_distribtests_php.sh
new file mode 100644
index 00000000..7f2519e1
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_php.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+# Copyright 2021 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+export PREPARE_BUILD_INSTALL_DEPS_PHP=true
+source tools/internal_ci/helper_scripts/prepare_build_macos_rc
+
+# Build all PHP macos artifacts
+tools/run_tests/task_runner.py -f artifact macos php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true"
+
+# PHP's "build_package" step is basically just a passthough, so the build artifacts can be used
+# directly by the "distribtests" step (and we skip the "build_package" phase entirely on mac).
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+# to upload its contents as job output artifacts
+rm -rf input_artifacts
+mkdir -p input_artifacts
+# We could also copy the PHP artifact to artifacts/, but we intentionally don't do that
+# in order to avoid hiding the PHP .tgz artifact built on linux (which has the same filename).
+# The macos-built artifact will still show up in job's uploaded artifacts under the
+# corresponding subdirectory ("php_pecl_package_macos_*")
+cp -r artifacts/php_pecl_package_macos_*/* input_artifacts/ || true
+
+# Run all PHP macos distribtests
+# We run the distribtests even if some of the artifacts have failed to build, since that gives
+# a better signal about which distribtest are affected by the currently broken artifact builds.
+tools/run_tests/task_runner.py -f distribtest macos php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x distribtests/sponge_log.xml || FAILED="true"
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_python.cfg b/grpc/tools/internal_ci/macos/grpc_distribtests_python.cfg
new file mode 100644
index 00000000..e3d0b0c1
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_python.cfg
@@ -0,0 +1,27 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_python.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_python.sh b/grpc/tools/internal_ci/macos/grpc_distribtests_python.sh
new file mode 100644
index 00000000..5068bd19
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_python.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+# Copyright 2022 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.
+
+set -ex
+
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
+# change to grpc repo root
+cd $(dirname $0)/../../..
+
+export PREPARE_BUILD_INSTALL_DEPS_PYTHON=true
+source tools/internal_ci/helper_scripts/prepare_build_macos_rc
+
+# TODO(jtattermusch): cleanup this prepare build step (needed for python artifact build)
+# install cython for all python versions
+python2.7 -m pip install -U cython setuptools==44.1.1 wheel --user
+python3.5 -m pip install -U cython setuptools==44.1.1 wheel --user
+python3.6 -m pip install -U cython setuptools==44.1.1 wheel --user
+python3.7 -m pip install -U cython setuptools==44.1.1 wheel --user
+python3.8 -m pip install -U cython setuptools==44.1.1 wheel --user
+python3.9 -m pip install -U cython setuptools==44.1.1 wheel --user
+
+# Build all python macos artifacts (this step actually builds all the binary wheels and source archives)
+tools/run_tests/task_runner.py -f artifact macos python ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true"
+
+# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+rm -rf input_artifacts
+mkdir -p input_artifacts
+cp -r artifacts/* input_artifacts/ || true
+
+# Collect the python artifact from subdirectories of input_artifacts/ to artifacts/
+# TODO(jtattermusch): when collecting the artifacts that will later be uploaded as kokoro job artifacts,
+# potentially skip some file names that would clash with linux-created artifacts.
+cp -r input_artifacts/python_*/* artifacts/ || true
+
+# TODO(jtattermusch): Here we would normally run python macos distribtests, but currently no such tests are defined
+# in distribtest_targets.py
+
+tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if [ "$FAILED" != "" ]
+then
+ exit 1
+fi
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.cfg b/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.cfg
new file mode 100644
index 00000000..a4b6eb71
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.cfg
@@ -0,0 +1,27 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh b/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh
new file mode 100644
index 00000000..7b78ab65
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright 2022 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.
+
+set -ex
+
+echo "TODO(apolcyn): remove ruby macos distrib jobs, they don't test anything"
diff --git a/grpc/tools/internal_ci/macos/grpc_interop_toprod.sh b/grpc/tools/internal_ci/macos/grpc_interop_toprod.sh
index c4d300d4..962a37d8 100755
--- a/grpc/tools/internal_ci/macos/grpc_interop_toprod.sh
+++ b/grpc/tools/internal_ci/macos/grpc_interop_toprod.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -41,8 +44,6 @@ tools/run_tests/run_interop_tests.py -l c++ \
--default_service_account="interop-to-prod-tests@grpc-testing.iam.gserviceaccount.com" \
--skip_compute_engine_creds --internal_ci -t -j 4 || FAILED="true"
-tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true
-
if [ "$FAILED" != "" ]
then
exit 1
diff --git a/grpc/tools/internal_ci/macos/grpc_ios_binary_size.sh b/grpc/tools/internal_ci/macos/grpc_ios_binary_size.sh
index 523e3ae8..66b098df 100755
--- a/grpc/tools/internal_ci/macos/grpc_ios_binary_size.sh
+++ b/grpc/tools/internal_ci/macos/grpc_ios_binary_size.sh
@@ -16,6 +16,9 @@
# This script is invoked by Jenkins and runs a diff on the microbenchmarks
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# List of benchmarks that provide good signal for analyzing performance changes in pull requests
# Enter the gRPC repo root
diff --git a/grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh b/grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh
index bfe1c8c2..52e2d133 100644
--- a/grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh
+++ b/grpc/tools/internal_ci/macos/grpc_run_bazel_c_cpp_tests.sh
@@ -15,10 +15,12 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
-# TODO(jtattermusch): most of the prepare steps should not be needed for bazel
source tools/internal_ci/helper_scripts/prepare_build_macos_rc
# make sure bazel is available
@@ -26,32 +28,25 @@ tools/bazel version
./tools/run_tests/start_port_server.py
-# to get "bazel" link for kokoro build, we need to generate
-# invocation UUID, set a flag for bazel to use it
-# and upload "bazel_invocation_ids" file as artifact.
-# NOTE: UUID needs to be in lowercase for the result link to work
-# (on mac "uuidgen" outputs uppercase UUID)
-BAZEL_INVOCATION_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
-echo "${BAZEL_INVOCATION_ID}" >"${KOKORO_ARTIFACTS_DIR}/bazel_invocation_ids"
+# for kokoro mac workers, exact image version is store in a well-known location on disk
+KOKORO_IMAGE_VERSION="$(cat /VERSION)"
+
+BAZEL_REMOTE_CACHE_ARGS=(
+ # Enable uploading to remote cache. Requires the "roles/remotebuildexecution.actionCacheWriter" permission.
+ --remote_upload_local_results=true
+ # allow invalidating the old cache by setting to a new random key
+ --remote_default_exec_properties="grpc_cache_silo_key1=83d8e488-1ca9-40fd-929e-d37d13529c99"
+ # make sure we only get cache hits from binaries built on exact same macos image
+ --remote_default_exec_properties="grpc_cache_silo_key2=${KOKORO_IMAGE_VERSION}"
+)
+
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_c_cpp_tests
# run all C/C++ tests
-tools/bazel \
+bazel_c_cpp_tests/bazel_wrapper \
--bazelrc=tools/remote_build/mac.bazelrc \
test \
- --invocation_id="${BAZEL_INVOCATION_ID}" \
- --workspace_status_command=tools/remote_build/workspace_status_kokoro.sh \
--google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
+ "${BAZEL_REMOTE_CACHE_ARGS[@]}" \
$BAZEL_FLAGS \
- -- //test/... || FAILED="true"
-
-if [ "$UPLOAD_TEST_RESULTS" != "" ]
-then
- # Sleep to let ResultStore finish writing results before querying
- sleep 60
- PYTHONHTTPSVERIFY=0 python ./tools/run_tests/python_utils/upload_rbe_results.py
-fi
-
-if [ "$FAILED" != "" ]
-then
- exit 1
-fi
+ -- //test/...
diff --git a/grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh b/grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh
index c6523408..30c147ff 100644..100755
--- a/grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh
+++ b/grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh
@@ -15,17 +15,31 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
+source tools/internal_ci/helper_scripts/prepare_build_macos_rc
+
+# make sure bazel is available
+tools/bazel version
+
./tools/run_tests/start_port_server.py
-dirs=(end2end server client common codegen util grpclb test)
-for dir in ${dirs[*]}; do
- echo $dir
- out=`tools/bazel query "kind(ios_unit_test, tests(//test/cpp/$dir/...))" 2>/dev/null | grep '^//'`
- for test in $out; do
- echo "Running: $test"
- tools/bazel test --test_summary=detailed --test_output=all $test
- done
-done
+# only select ObjC test from the following subdirs
+# TODO(jtattermusch): start running selected tests from //test/core too.
+test_pattern="//test/cpp/end2end/... + //test/cpp/server/... + //test/cpp/client/... + //test/cpp/common/... + //test/cpp/codegen/... + //test/cpp/util/... + //test/cpp/grpclb/... + //test/cpp/test/..."
+
+# iOS tests are marked as "manual" to prevent them from running by default. To run them, we need to use "bazel query" to list them first.
+ios_tests=$(tools/bazel query "kind(ios_unit_test, tests($test_pattern))" | grep '^//')
+
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_cpp_ios_tests
+
+bazel_cpp_ios_tests/bazel_wrapper \
+ --bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \
+ test \
+ --google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
+ $BAZEL_FLAGS \
+ -- ${ios_tests}
diff --git a/grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh b/grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh
index e213105d..c137d382 100644
--- a/grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh
+++ b/grpc/tools/internal_ci/macos/grpc_run_bazel_isolated_tests.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
diff --git a/grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh b/grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh
index b74508b7..fcb27d3e 100755
--- a/grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh
+++ b/grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh
@@ -15,6 +15,9 @@
set -ex
+# avoid slow finalization after the script has exited.
+source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
+
# change to grpc repo root
cd $(dirname $0)/../../..
@@ -25,8 +28,6 @@ tools/run_tests/run_tests_matrix.py $RUN_TESTS_FLAGS || FAILED="true"
# kill port_server.py to prevent the build from freezing
ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9
-tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true
-
if [ "$FAILED" != "" ]
then
exit 1
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_dbg.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_dbg.cfg
deleted file mode 100644
index c91c0339..00000000
--- a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_dbg.cfg
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh"
-gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests macos dbg --exclude objc --internal_ci -j 1 --inner_jobs 4 --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_node.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_node.cfg
deleted file mode 100644
index e0eed76f..00000000
--- a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_node.cfg
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh"
-gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests macos grpc-node --internal_ci -j 1 --inner_jobs 4 --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_opt.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_opt.cfg
deleted file mode 100644
index 532234fa..00000000
--- a/grpc/tools/internal_ci/macos/pull_request/grpc_basictests_opt.cfg
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh"
-gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests macos opt --exclude objc --internal_ci -j 1 --inner_jobs 4 --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_build_artifacts.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_build_artifacts.cfg
new file mode 100644
index 00000000..ee61cd24
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/pull_request/grpc_build_artifacts.cfg
@@ -0,0 +1,32 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_build_artifacts.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..c49642cf
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_csharp.cfg
@@ -0,0 +1,32 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_csharp.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_php.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_php.cfg
new file mode 100644
index 00000000..192ab827
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_php.cfg
@@ -0,0 +1,32 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_php.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_python.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_python.cfg
new file mode 100644
index 00000000..4541d27a
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_python.cfg
@@ -0,0 +1,32 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_python.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_ruby.cfg b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_ruby.cfg
new file mode 100644
index 00000000..aa4557c7
--- /dev/null
+++ b/grpc/tools/internal_ci/macos/pull_request/grpc_distribtests_ruby.cfg
@@ -0,0 +1,32 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/macos/grpc_distribtests_ruby.sh"
+gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/windows/bazel_rbe.bat b/grpc/tools/internal_ci/windows/bazel_rbe.bat
index 65397a77..4bd9cb6c 100644
--- a/grpc/tools/internal_ci/windows/bazel_rbe.bat
+++ b/grpc/tools/internal_ci/windows/bazel_rbe.bat
@@ -12,25 +12,27 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
-@rem TODO(jtattermusch): make this generate less output
-@rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync
-choco install bazel -y --version 3.7.1 --limit-output
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
cd github/grpc
-set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%
-@rem Generate a random UUID and store in "bazel_invocation_ids" artifact file
-powershell -Command "[guid]::NewGuid().ToString()" >%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
-set /p BAZEL_INVOCATION_ID=<%KOKORO_ARTIFACTS_DIR%/bazel_invocation_ids
+call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
-@rem TODO(jtattermusch): windows RBE should be able to use the same credentials as Linux RBE.
-bazel --bazelrc=tools/remote_build/windows.bazelrc test --invocation_id="%BAZEL_INVOCATION_ID%" %BAZEL_FLAGS% --workspace_status_command=tools/remote_build/workspace_status_kokoro.bat //test/...
-set BAZEL_EXITCODE=%errorlevel%
+@rem Install bazel
+@rem Side effect of the tools/bazel script is that it downloads the correct version of bazel binary.
+mkdir C:\bazel
+bash -c "tools/bazel --version && cp tools/bazel-*.exe /c/bazel/bazel.exe"
+set PATH=C:\bazel;%PATH%
+bazel --version
-if not "%UPLOAD_TEST_RESULTS%"=="" (
- @rem Sleep to let ResultStore finish writing results before querying
- timeout /t 60 /nobreak
- python ./tools/run_tests/python_utils/upload_rbe_results.py
-)
+python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_rbe
-exit /b %BAZEL_EXITCODE%
+call bazel_rbe/bazel_wrapper.bat --bazelrc=tools/remote_build/windows.bazelrc --output_user_root=T:\_bazel_output test %BAZEL_FLAGS% -- //test/... || exit /b 1
diff --git a/grpc/tools/internal_ci/windows/grpc_basictests.cfg b/grpc/tools/internal_ci/windows/grpc_basictests.cfg
deleted file mode 100644
index fcf5237b..00000000
--- a/grpc/tools/internal_ci/windows/grpc_basictests.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/windows/grpc_basictests_csharp.cfg b/grpc/tools/internal_ci/windows/grpc_basictests_csharp.cfg
index 17a362fb..459f3c63 100644
--- a/grpc/tools/internal_ci/windows/grpc_basictests_csharp.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_basictests_csharp.cfg
@@ -16,7 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 60
+timeout_mins: 90
action {
define_artifacts {
regex: "**/*sponge_log.*"
diff --git a/grpc/tools/internal_ci/windows/grpc_basictests_dbg.cfg b/grpc/tools/internal_ci/windows/grpc_basictests_dbg.cfg
deleted file mode 100644
index 4e5e7b65..00000000
--- a/grpc/tools/internal_ci/windows/grpc_basictests_dbg.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows dbg -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/windows/grpc_basictests_opt.cfg b/grpc/tools/internal_ci/windows/grpc_basictests_opt.cfg
deleted file mode 100644
index f5db6a98..00000000
--- a/grpc/tools/internal_ci/windows/grpc_basictests_opt.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows opt -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
-}
diff --git a/grpc/tools/internal_ci/windows/grpc_basictests_python.cfg b/grpc/tools/internal_ci/windows/grpc_basictests_python.cfg
index c68e0ffb..2d757789 100644
--- a/grpc/tools/internal_ci/windows/grpc_basictests_python.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_basictests_python.cfg
@@ -16,7 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 90
+timeout_mins: 180
action {
define_artifacts {
regex: "**/*sponge_log.*"
diff --git a/grpc/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg b/grpc/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg
index d13b36aa..9b543085 100644
--- a/grpc/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_bazel_rbe_dbg.cfg
@@ -16,8 +16,13 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat"
-
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
diff --git a/grpc/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg b/grpc/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg
index 87cc3792..a9bfb302 100644
--- a/grpc/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_bazel_rbe_opt.cfg
@@ -16,8 +16,13 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat"
-
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
diff --git a/grpc/tools/internal_ci/windows/grpc_build_artifacts.bat b/grpc/tools/internal_ci/windows/grpc_build_artifacts.bat
index b8901e38..1fa2ed27 100644
--- a/grpc/tools/internal_ci/windows/grpc_build_artifacts.bat
+++ b/grpc/tools/internal_ci/windows/grpc_build_artifacts.bat
@@ -12,9 +12,15 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
-@rem Boringssl build no longer supports yasm
-choco uninstall yasm -y --limit-output
-choco install nasm -y --limit-output
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
@rem enter repo root
cd /d %~dp0\..\..\..
@@ -22,9 +28,14 @@ cd /d %~dp0\..\..\..
set PREPARE_BUILD_INSTALL_DEPS_PYTHON=true
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
-python tools/run_tests/task_runner.py -f artifact windows -j 4
+call tools/internal_ci/helper_scripts/prepare_ccache.bat || exit /b 1
+
+python tools/run_tests/task_runner.py -f artifact windows %TASK_RUNNER_EXTRA_FILTERS% -j 4 --inner_jobs 4
set RUNTESTS_EXITCODE=%errorlevel%
-bash tools/internal_ci/helper_scripts/delete_nonartifacts.sh
+@rem show ccache stats
+ccache --show-stats
+
+bash tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
exit /b %RUNTESTS_EXITCODE%
diff --git a/grpc/tools/internal_ci/windows/grpc_build_packages.bat b/grpc/tools/internal_ci/windows/grpc_build_packages.bat
deleted file mode 100644
index 8f1e5794..00000000
--- a/grpc/tools/internal_ci/windows/grpc_build_packages.bat
+++ /dev/null
@@ -1,29 +0,0 @@
-@rem Copyright 2017 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-@rem enter repo root
-cd /d %~dp0\..\..\..
-
-call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
-
-rem NOTHING TO DO HERE
-rem This script used to run "task_runner.py -f package windows", but
-rem currently there are no build_packages tasks that need to be run on windows.
-rem The only build_packages task that ever needed to run on windows was C#, but we switched to
-rem building C# nugets on linux (as dotnet SDK on linux does a good job)
-rem TODO(jtattermusch): remove the infrastructure for running "build_packages" kokoro job on windows.
-
-bash tools/internal_ci/helper_scripts/delete_nonartifacts.sh
-
-exit /b %RUNTESTS_EXITCODE%
diff --git a/grpc/tools/internal_ci/windows/grpc_build_packages.cfg b/grpc/tools/internal_ci/windows/grpc_build_packages.cfg
deleted file mode 100644
index b351bbb1..00000000
--- a/grpc/tools/internal_ci/windows/grpc_build_packages.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_build_packages.bat"
-timeout_mins: 120
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- regex: "github/grpc/artifacts/**"
- }
-}
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests.bat b/grpc/tools/internal_ci/windows/grpc_distribtests.bat
index 6b74972f..a890ef54 100644
--- a/grpc/tools/internal_ci/windows/grpc_distribtests.bat
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests.bat
@@ -12,9 +12,20 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
+
@rem enter repo root
cd /d %~dp0\..\..\..
+set PREPARE_BUILD_INSTALL_DEPS_CSHARP=true
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
@rem Move packages generated by the previous step in the build chain.
@@ -24,6 +35,4 @@ dir input_artifacts
python tools/run_tests/task_runner.py -f distribtest windows -j 4
set RUNTESTS_EXITCODE=%errorlevel%
-bash tools/internal_ci/helper_scripts/delete_nonartifacts.sh
-
exit /b %RUNTESTS_EXITCODE%
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat b/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat
new file mode 100644
index 00000000..8ba209c1
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat
@@ -0,0 +1,73 @@
+@rem Copyright 2022 The gRPC Authors
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
+
+@rem enter repo root
+cd /d %~dp0\..\..\..
+
+set PREPARE_BUILD_INSTALL_DEPS_CSHARP=true
+call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
+
+call tools/internal_ci/helper_scripts/prepare_ccache.bat || exit /b 1
+
+@rem Install Msys2 zip to avoid crash when using cygwin's zip on grpc-win2016 kokoro workers.
+@rem Downloading from GCS should be very reliables when on a GCP VM.
+@rem TODO(jtattermusch): find a better way of making the build_packages step work on windows workers.
+mkdir C:\zip
+curl -sSL --fail -o C:\zip\zip.exe https://storage.googleapis.com/grpc-build-helper/zip-3.0-1-x86_64/zip.exe || goto :error
+set PATH=C:\zip;%PATH%
+zip --version
+
+@rem Build all C# windows artifacts
+python tools/run_tests/task_runner.py -f artifact windows csharp %TASK_RUNNER_EXTRA_FILTERS% -j 4 --inner_jobs 4 -x build_artifacts_csharp/sponge_log.xml || set FAILED=true
+
+@rem Build all protoc windows artifacts
+python tools/run_tests/task_runner.py -f artifact windows protoc %TASK_RUNNER_EXTRA_FILTERS% -j 4 --inner_jobs 4 -x build_artifacts_protoc/sponge_log.xml || set FAILED=true
+
+@rem the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+bash -c "rm -rf input_artifacts; mkdir -p input_artifacts; cp -r artifacts/* input_artifacts/ || true"
+
+@rem This step builds the nuget packages from input_artifacts
+@rem Set env variable option to build single platform version of the nugets.
+@rem (this is required as we only have the windows artifacts at hand)
+set GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET=1
+python tools/run_tests/task_runner.py -f package windows csharp nuget -j 2 -x build_packages/sponge_log.xml || set FAILED=true
+
+@rem the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+@rem in addition to that, preserve the contents of "artifacts" directory since we want kokoro
+@rem to upload its contents as job output artifacts
+bash -c "rm -rf input_artifacts; mkdir -p input_artifacts; cp -r artifacts/* input_artifacts/ || true"
+
+@rem Run all C# windows distribtests
+@rem We run the distribtests even if some of the artifacts have failed to build, since that gives
+@rem a better signal about which distribtest are affected by the currently broken artifact builds.
+python tools/run_tests/task_runner.py -f distribtest windows csharp %TASK_RUNNER_EXTRA_FILTERS% -j 4 -x distribtests/sponge_log.xml || set FAILED=true
+
+@rem show ccache stats
+ccache --show-stats
+
+bash tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if not "%FAILED%" == "" (
+ exit /b 1
+)
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..aa26233d
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests_csharp.cfg
@@ -0,0 +1,26 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests_python.bat b/grpc/tools/internal_ci/windows/grpc_distribtests_python.bat
new file mode 100644
index 00000000..63130de5
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests_python.bat
@@ -0,0 +1,49 @@
+@rem Copyright 2022 The gRPC Authors
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
+
+@rem enter repo root
+cd /d %~dp0\..\..\..
+
+set PREPARE_BUILD_INSTALL_DEPS_PYTHON=true
+call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
+
+@rem Build all python windows artifacts
+python tools/run_tests/task_runner.py -f artifact windows python %TASK_RUNNER_EXTRA_FILTERS% -j 4 --inner_jobs 4 -x build_artifacts_python/sponge_log.xml || set FAILED=true
+
+@rem the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
+bash -c "rm -rf input_artifacts; mkdir -p input_artifacts; cp -r artifacts/* input_artifacts/ || true"
+
+@rem Collect the python artifact from subdirectories of input_artifacts/ to artifacts/
+@rem TODO(jtattermusch): when collecting the artifacts that will later be uploaded as kokoro job artifacts,
+@rem potentially skip some file names that would clash with linux-created artifacts.
+bash -c "cp -r input_artifacts/python_*/* artifacts/ || true"
+
+@rem TODO(jtattermusch): Here we would normally run python windows distribtests, but currently no such tests are defined
+@rem in distribtest_targets.py
+
+bash tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
+
+if not "%FAILED%" == "" (
+ exit /b 1
+)
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests_python.cfg b/grpc/tools/internal_ci/windows/grpc_distribtests_python.cfg
new file mode 100644
index 00000000..85fd98f6
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests_python.cfg
@@ -0,0 +1,26 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_distribtests_python.bat"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
diff --git a/grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat b/grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat
index e0722dbf..2e0497bf 100644
--- a/grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat
+++ b/grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat
@@ -12,14 +12,22 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
+
@rem enter repo root
cd /d %~dp0\..\..\..
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
-python tools/run_tests/task_runner.py -f distribtest windows cpp -j 4
+python tools/run_tests/task_runner.py -f distribtest windows cpp %TASK_RUNNER_EXTRA_FILTERS% -j 4
set RUNTESTS_EXITCODE=%errorlevel%
-bash tools/internal_ci/helper_scripts/delete_nonartifacts.sh
-
exit /b %RUNTESTS_EXITCODE%
diff --git a/grpc/tools/internal_ci/windows/grpc_portability.cfg b/grpc/tools/internal_ci/windows/grpc_portability.cfg
index aa86c066..c17dadc2 100644
--- a/grpc/tools/internal_ci/windows/grpc_portability.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_portability.cfg
@@ -16,7 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
+timeout_mins: 300
action {
define_artifacts {
regex: "**/*sponge_log.*"
@@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "-f portability windows -j 1 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
+ value: "-f portability windows -j 4 --inner_jobs 8 --internal_ci --bq_result_table aggregate_results"
}
diff --git a/grpc/tools/internal_ci/windows/grpc_portability_build_only.cfg b/grpc/tools/internal_ci/windows/grpc_portability_build_only.cfg
index 3dace627..4df367f6 100644
--- a/grpc/tools/internal_ci/windows/grpc_portability_build_only.cfg
+++ b/grpc/tools/internal_ci/windows/grpc_portability_build_only.cfg
@@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
- value: "-f portability windows --internal_ci --build_only"
+ value: "-f portability windows c++ -j 4 --inner_jobs 8 --internal_ci --build_only"
}
diff --git a/grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat b/grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat
index 01d60262..d63b9133 100644
--- a/grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat
+++ b/grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat
@@ -12,17 +12,40 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
+@rem Avoid slow finalization after the script has exited.
+@rem See the script's prologue for info on the correct invocation pattern.
+setlocal EnableDelayedExpansion
+IF "%cd%"=="T:\src" (
+ call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0
+ echo respawn script has finished with exitcode !errorlevel!
+ exit /b !errorlevel!
+)
+endlocal
+
@rem enter repo root
cd /d %~dp0\..\..\..
+@rem if RUN_TESTS_FLAGS contains the string "csharp", make sure C# deps are installed.
+If Not "%RUN_TESTS_FLAGS%"=="%RUN_TESTS_FLAGS:csharp=%" (
+ set PREPARE_BUILD_INSTALL_DEPS_CSHARP=true
+)
+@rem if RUN_TESTS_FLAGS contains the string "python", make sure python deps are installed.
If Not "%RUN_TESTS_FLAGS%"=="%RUN_TESTS_FLAGS:python=%" (
set PREPARE_BUILD_INSTALL_DEPS_PYTHON=true
)
call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1
-python tools/run_tests/run_tests_matrix.py %RUN_TESTS_FLAGS%
+call tools/internal_ci/helper_scripts/prepare_ccache.bat || exit /b 1
+
+@rem TODO(https://github.com/grpc/grpc/issues/28011): Remove once Windows Kokoro workers'
+@rem Python installs have been upgraded. Currently, removing this line will cause
+@rem run_tests.py to fail to spawn test subprocesses.
+python3 tools/run_tests/start_port_server.py || exit /b 1
+
+python3 tools/run_tests/run_tests_matrix.py %RUN_TESTS_FLAGS%
set RUNTESTS_EXITCODE=%errorlevel%
-bash tools/internal_ci/helper_scripts/delete_nonartifacts.sh
+@rem show ccache stats
+ccache --show-stats
exit /b %RUNTESTS_EXITCODE%
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_basictests.cfg
deleted file mode 100644
index a8e6f067..00000000
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows -j 1 --inner_jobs 8 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_csharp.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_csharp.cfg
index e1c5af10..e5815b3c 100644
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_csharp.cfg
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_csharp.cfg
@@ -16,7 +16,7 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 60
+timeout_mins: 90
action {
define_artifacts {
regex: "**/*sponge_log.*"
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_dbg.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_dbg.cfg
deleted file mode 100644
index ce957232..00000000
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_dbg.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows dbg -j 1 --inner_jobs 8 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_opt.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_opt.cfg
deleted file mode 100644
index 7d2abbfb..00000000
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_basictests_opt.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f basictests windows opt -j 1 --inner_jobs 8 --internal_ci --max_time=3600"
-}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg
index 116afeb7..a9292b05 100644
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_dbg.cfg
@@ -16,8 +16,13 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat"
-
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg
index b4750e18..b70fb4d8 100644
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_bazel_rbe_opt.cfg
@@ -16,8 +16,13 @@
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/windows/bazel_rbe.bat"
-
timeout_mins: 90
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ }
+}
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/resultstore_api_key"
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_build_artifacts.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_build_artifacts.cfg
new file mode 100644
index 00000000..244437a2
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_build_artifacts.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_build_artifacts.bat"
+timeout_mins: 240
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_csharp.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_csharp.cfg
new file mode 100644
index 00000000..feeed304
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_csharp.cfg
@@ -0,0 +1,31 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_distribtests_csharp.bat"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_python.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_python.cfg
new file mode 100644
index 00000000..bcff98fc
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_python.cfg
@@ -0,0 +1,31 @@
+# Copyright 2022 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_distribtests_python.bat"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_standalone.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_standalone.cfg
new file mode 100644
index 00000000..b673e13b
--- /dev/null
+++ b/grpc/tools/internal_ci/windows/pull_request/grpc_distribtests_standalone.cfg
@@ -0,0 +1,31 @@
+# Copyright 2021 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.
+
+# Config file for the internal CI (in protobuf text format)
+
+# Location of the continuous shell script in repository.
+build_file: "grpc/tools/internal_ci/windows/grpc_distribtests_standalone.bat"
+timeout_mins: 120
+action {
+ define_artifacts {
+ regex: "**/*sponge_log.*"
+ regex: "github/grpc/reports/**"
+ regex: "github/grpc/artifacts/**"
+ }
+}
+
+env_vars {
+ key: "TASK_RUNNER_EXTRA_FILTERS"
+ value: "presubmit"
+}
diff --git a/grpc/tools/internal_ci/windows/pull_request/grpc_portability.cfg b/grpc/tools/internal_ci/windows/pull_request/grpc_portability.cfg
deleted file mode 100644
index 6f332416..00000000
--- a/grpc/tools/internal_ci/windows/pull_request/grpc_portability.cfg
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Config file for the internal CI (in protobuf text format)
-
-# Location of the continuous shell script in repository.
-build_file: "grpc/tools/internal_ci/windows/grpc_run_tests_matrix.bat"
-timeout_mins: 240
-action {
- define_artifacts {
- regex: "**/*sponge_log.*"
- regex: "github/grpc/reports/**"
- }
-}
-
-env_vars {
- key: "RUN_TESTS_FLAGS"
- value: "-f portability windows -j 1 --inner_jobs 8 --internal_ci"
-}
diff --git a/grpc/tools/interop_matrix/client_matrix.py b/grpc/tools/interop_matrix/client_matrix.py
index 5cd532e6..e3bdef19 100644
--- a/grpc/tools/interop_matrix/client_matrix.py
+++ b/grpc/tools/interop_matrix/client_matrix.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python2.7
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -113,6 +112,12 @@ LANG_RELEASE_MATRIX = {
('v1.35.0', ReleaseInfo()),
('v1.36.3', ReleaseInfo()),
('v1.37.0', ReleaseInfo()),
+ ('v1.38.0', ReleaseInfo()),
+ ('v1.39.0', ReleaseInfo()),
+ ('v1.41.1', ReleaseInfo()),
+ ('v1.42.0', ReleaseInfo()),
+ ('v1.43.0', ReleaseInfo()),
+ ('v1.44.0', ReleaseInfo()),
]),
'go':
OrderedDict([
@@ -187,6 +192,12 @@ LANG_RELEASE_MATRIX = {
('v1.36.0', ReleaseInfo(runtimes=['go1.11'])),
('v1.37.0', ReleaseInfo(runtimes=['go1.11'])),
# NOTE: starting from release v1.38.0, use runtimes=['go1.16']
+ ('v1.38.1', ReleaseInfo(runtimes=['go1.16'])),
+ ('v1.39.1', ReleaseInfo(runtimes=['go1.16'])),
+ ('v1.40.0', ReleaseInfo(runtimes=['go1.16'])),
+ ('v1.41.0', ReleaseInfo(runtimes=['go1.16'])),
+ ('v1.42.0', ReleaseInfo(runtimes=['go1.16'])),
+ ('v1.43.0', ReleaseInfo(runtimes=['go1.16'])),
]),
'java':
OrderedDict([
@@ -257,71 +268,146 @@ LANG_RELEASE_MATRIX = {
('v1.34.1', ReleaseInfo()),
('v1.35.1', ReleaseInfo()),
('v1.36.1', ReleaseInfo()),
- ('v1.37.0', ReleaseInfo()),
+ ('v1.37.1', ReleaseInfo()),
+ ('v1.38.1', ReleaseInfo()),
+ ('v1.39.0', ReleaseInfo()),
+ ('v1.40.2', ReleaseInfo()),
+ ('v1.41.1', ReleaseInfo()),
+ ('v1.42.1', ReleaseInfo()),
+ ('v1.43.2', ReleaseInfo()),
+ ('v1.44.0', ReleaseInfo()),
+ ('v1.45.0', ReleaseInfo()),
]),
'python':
- OrderedDict([
- ('v1.0.x',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.1.4',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.2.5',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.3.9',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.4.2',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.6.6',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.7.2',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.8.1',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.9.1',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.10.1',
- ReleaseInfo(runtimes=['python'], testcases_file='python__v1.0.x')),
- ('v1.11.1',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.12.0',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.13.0',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.14.1',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.15.0',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.16.0',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.17.1',
- ReleaseInfo(runtimes=['python'],
- testcases_file='python__v1.11.1')),
- ('v1.18.0', ReleaseInfo(runtimes=['python'])),
- ('v1.19.0', ReleaseInfo(runtimes=['python'])),
- ('v1.20.0', ReleaseInfo(runtimes=['python'])),
- ('v1.21.4', ReleaseInfo(runtimes=['python'])),
- ('v1.22.0', ReleaseInfo(runtimes=['python'])),
- ('v1.22.1', ReleaseInfo(runtimes=['python'])),
- ('v1.23.0', ReleaseInfo(runtimes=['python'])),
- ('v1.24.0', ReleaseInfo(runtimes=['python'])),
- ('v1.25.0', ReleaseInfo(runtimes=['python'])),
- ('v1.26.0', ReleaseInfo(runtimes=['python'])),
- ('v1.27.3', ReleaseInfo(runtimes=['python'])),
- ('v1.30.0', ReleaseInfo(runtimes=['python'])),
- ('v1.31.1', ReleaseInfo(runtimes=['python'])),
- ('v1.32.0', ReleaseInfo(runtimes=['python'])),
- ('v1.33.2', ReleaseInfo(runtimes=['python'])),
- ('v1.34.0', ReleaseInfo(runtimes=['python'])),
- ('v1.35.0', ReleaseInfo(runtimes=['python'])),
- ('v1.36.3', ReleaseInfo(runtimes=['python'])),
- ('v1.37.0', ReleaseInfo(runtimes=['python'])),
- ]),
+ OrderedDict(
+ [
+ ('v1.0.x',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.1.4',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.2.5',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.3.9',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.4.2',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.6.6',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.7.2',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.8.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.9.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.10.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.0.x')),
+ ('v1.11.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.12.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.13.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.14.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.15.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.16.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.17.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.11.1')),
+ ('v1.18.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.19.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.20.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.21.4',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.22.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.22.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.23.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.24.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.25.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.26.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.27.3',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.30.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.31.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.32.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.33.2',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.34.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.35.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.36.3',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.37.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.38.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.39.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.18.0')),
+ ('v1.41.1',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.41.1')),
+ ('v1.42.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.41.1')),
+ ('v1.43.2',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__v1.41.1')),
+ ('v1.44.0',
+ ReleaseInfo(runtimes=['python'],
+ testcases_file='python__master')),
+ ]),
'node':
OrderedDict([
('v1.0.1', ReleaseInfo(testcases_file='node__v1.0.1')),
@@ -387,6 +473,12 @@ LANG_RELEASE_MATRIX = {
('v1.35.0', ReleaseInfo()),
('v1.36.3', ReleaseInfo()),
('v1.37.0', ReleaseInfo()),
+ ('v1.38.0', ReleaseInfo()),
+ ('v1.39.0', ReleaseInfo()),
+ ('v1.41.1', ReleaseInfo()),
+ ('v1.42.0', ReleaseInfo()),
+ ('v1.43.0', ReleaseInfo()),
+ ('v1.44.0', ReleaseInfo()),
]),
'php':
OrderedDict([
@@ -426,6 +518,12 @@ LANG_RELEASE_MATRIX = {
('v1.35.0', ReleaseInfo()),
('v1.36.3', ReleaseInfo()),
('v1.37.0', ReleaseInfo()),
+ ('v1.38.0', ReleaseInfo()),
+ ('v1.39.0', ReleaseInfo()),
+ ('v1.41.1', ReleaseInfo()),
+ ('v1.42.0', ReleaseInfo()),
+ ('v1.43.0', ReleaseInfo()),
+ ('v1.44.0', ReleaseInfo()),
]),
'csharp':
OrderedDict([
@@ -453,22 +551,29 @@ LANG_RELEASE_MATRIX = {
('v1.17.1', ReleaseInfo(testcases_file='csharp__v1.3.9')),
('v1.18.0', ReleaseInfo(testcases_file='csharp__v1.18.0')),
('v1.19.0', ReleaseInfo(testcases_file='csharp__v1.18.0')),
- ('v1.20.0', ReleaseInfo()),
- ('v1.21.4', ReleaseInfo()),
- ('v1.22.0', ReleaseInfo()),
- ('v1.22.1', ReleaseInfo()),
- ('v1.23.0', ReleaseInfo()),
- ('v1.24.0', ReleaseInfo()),
- ('v1.25.0', ReleaseInfo()),
- ('v1.26.0', ReleaseInfo()),
- ('v1.27.3', ReleaseInfo()),
- ('v1.30.0', ReleaseInfo()),
- ('v1.31.1', ReleaseInfo()),
- ('v1.32.0', ReleaseInfo()),
- ('v1.33.2', ReleaseInfo()),
- ('v1.34.0', ReleaseInfo()),
- ('v1.35.0', ReleaseInfo()),
- ('v1.36.3', ReleaseInfo()),
- ('v1.37.0', ReleaseInfo()),
+ ('v1.20.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.20.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.21.4', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.22.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.22.1', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.23.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.24.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.25.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.26.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.27.3', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.30.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.31.1', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.32.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.33.2', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.34.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.35.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.36.3', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.37.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.38.1', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.39.1', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.41.1', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.42.0', ReleaseInfo(testcases_file='csharp__v1.20.0')),
+ ('v1.43.0', ReleaseInfo()),
+ ('v1.44.0', ReleaseInfo()),
]),
}
diff --git a/grpc/tools/interop_matrix/create_matrix_images.py b/grpc/tools/interop_matrix/create_matrix_images.py
index b413ab4c..5ad639c3 100755
--- a/grpc/tools/interop_matrix/create_matrix_images.py
+++ b/grpc/tools/interop_matrix/create_matrix_images.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,13 +35,13 @@ import dockerjob
import jobset
_IMAGE_BUILDER = 'tools/run_tests/dockerize/build_interop_image.sh'
-_LANGUAGES = client_matrix.LANG_RUNTIME_MATRIX.keys()
+_LANGUAGES = list(client_matrix.LANG_RUNTIME_MATRIX.keys())
# All gRPC release tags, flattened, deduped and sorted.
_RELEASES = sorted(
list(
set(release
- for release_dict in client_matrix.LANG_RELEASE_MATRIX.values()
- for release in release_dict.keys())))
+ for release_dict in list(client_matrix.LANG_RELEASE_MATRIX.values())
+ for release in list(release_dict.keys()))))
# Destination directory inside docker image to keep extra info from build time.
_BUILD_INFO = '/var/local/build_info'
@@ -147,7 +147,7 @@ def build_image_jobspec(runtime, env, gcr_tag, stack_base):
"""
basename = 'grpc_interop_%s' % runtime
tag = '%s/%s:%s' % (args.gcr_path, basename, gcr_tag)
- build_env = {'INTEROP_IMAGE': tag, 'BASE_NAME': basename, 'TTY_FLAG': '-t'}
+ build_env = {'INTEROP_IMAGE': tag, 'BASE_NAME': basename}
build_env.update(env)
image_builder_path = _IMAGE_BUILDER
if client_matrix.should_build_docker_interop_image_from_release_tag(lang):
@@ -339,7 +339,7 @@ def checkout_grpc_stack(lang, release):
do_newline=True)
# Write git log to commit_log so it can be packaged with the docker image.
- with open(os.path.join(stack_base, 'commit_log'), 'w') as f:
+ with open(os.path.join(stack_base, 'commit_log'), 'wb') as f:
f.write(commit_log)
return stack_base
diff --git a/grpc/tools/interop_matrix/run_interop_matrix_tests.py b/grpc/tools/interop_matrix/run_interop_matrix_tests.py
index be92458e..42f77d38 100755
--- a/grpc/tools/interop_matrix/run_interop_matrix_tests.py
+++ b/grpc/tools/interop_matrix/run_interop_matrix_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,13 +40,13 @@ import upload_test_results
_TEST_TIMEOUT_SECONDS = 60
_PULL_IMAGE_TIMEOUT_SECONDS = 15 * 60
_MAX_PARALLEL_DOWNLOADS = 6
-_LANGUAGES = client_matrix.LANG_RUNTIME_MATRIX.keys()
+_LANGUAGES = list(client_matrix.LANG_RUNTIME_MATRIX.keys())
# All gRPC release tags, flattened, deduped and sorted.
_RELEASES = sorted(
list(
set(release
- for release_dict in client_matrix.LANG_RELEASE_MATRIX.values()
- for release in release_dict.keys())))
+ for release_dict in list(client_matrix.LANG_RELEASE_MATRIX.values())
+ for release in list(release_dict.keys()))))
argp = argparse.ArgumentParser(description='Run interop tests.')
argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int)
@@ -117,7 +117,7 @@ def _get_test_images_for_lang(lang, release_arg, image_path_prefix):
tag)
image_tuple = (tag, image_name)
- if not images.has_key(runtime):
+ if runtime not in images:
images[runtime] = []
images[runtime].append(image_tuple)
return images
@@ -166,6 +166,7 @@ def _generate_test_case_jobspecs(lang, runtime, release, suite_name):
job_spec_list = []
for line in testcase_lines:
+ print("Creating jobspec with cmdline '{}'".format(line))
# TODO(jtattermusch): revisit the logic for updating test case commands
# what it currently being done seems fragile.
diff --git a/grpc/tools/interop_matrix/testcases/csharp__master b/grpc/tools/interop_matrix/testcases/csharp__master
index e526b3c1..8ced3cb9 100755
--- a/grpc/tools/interop_matrix/testcases/csharp__master
+++ b/grpc/tools/interop_matrix/testcases/csharp__master
@@ -1,7 +1,7 @@
#!/bin/bash
# DO NOT MODIFY
# This file is generated by run_interop_tests.py/create_testcases.sh
-echo "Testing ${docker_image:=grpc_interop_csharp:9296f21a-f657-4bb0-82a7-24fc527abcbd}"
+echo "Testing ${docker_image:=grpc_interop_csharp:556faec6-de63-4493-9779-2edf51d1ef28}"
docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
diff --git a/grpc/tools/interop_matrix/testcases/csharp__v1.20.0 b/grpc/tools/interop_matrix/testcases/csharp__v1.20.0
new file mode 100755
index 00000000..e526b3c1
--- /dev/null
+++ b/grpc/tools/interop_matrix/testcases/csharp__v1.20.0
@@ -0,0 +1,22 @@
+#!/bin/bash
+# DO NOT MODIFY
+# This file is generated by run_interop_tests.py/create_testcases.sh
+echo "Testing ${docker_image:=grpc_interop_csharp:9296f21a-f657-4bb0-82a7-24fc527abcbd}"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45 --net=host $docker_image bash -c "mono Grpc.IntegrationTesting.Client.exe --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
diff --git a/grpc/tools/interop_matrix/testcases/csharpcoreclr__master b/grpc/tools/interop_matrix/testcases/csharpcoreclr__master
index e14ec047..bfc1d64e 100755
--- a/grpc/tools/interop_matrix/testcases/csharpcoreclr__master
+++ b/grpc/tools/interop_matrix/testcases/csharpcoreclr__master
@@ -1,22 +1,22 @@
#!/bin/bash
# DO NOT MODIFY
# This file is generated by run_interop_tests.py/create_testcases.sh
-echo "Testing ${docker_image:=grpc_interop_csharpcoreclr:33395965-11d7-4b12-bcd6-a272d4015207}"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
-docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
+echo "Testing ${docker_image:=grpc_interop_csharpcoreclr:69a5b092-dccd-43a6-82dd-61c100d509f5}"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
diff --git a/grpc/tools/interop_matrix/testcases/csharpcoreclr__v1.20.0 b/grpc/tools/interop_matrix/testcases/csharpcoreclr__v1.20.0
new file mode 100755
index 00000000..e14ec047
--- /dev/null
+++ b/grpc/tools/interop_matrix/testcases/csharpcoreclr__v1.20.0
@@ -0,0 +1,22 @@
+#!/bin/bash
+# DO NOT MODIFY
+# This file is generated by run_interop_tests.py/create_testcases.sh
+echo "Testing ${docker_image:=grpc_interop_csharpcoreclr:33395965-11d7-4b12-bcd6-a272d4015207}"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true"
+docker run -i --rm=true -w /var/local/git/grpc/src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1 --net=host $docker_image bash -c "dotnet exec Grpc.IntegrationTesting.Client.dll --server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true"
diff --git a/grpc/tools/interop_matrix/testcases/python__master b/grpc/tools/interop_matrix/testcases/python__master
index 0fc23810..0b9ea8d1 100755
--- a/grpc/tools/interop_matrix/testcases/python__master
+++ b/grpc/tools/interop_matrix/testcases/python__master
@@ -1,22 +1,22 @@
#!/bin/bash
# DO NOT MODIFY
# This file is generated by run_interop_tests.py/create_testcases.sh
-echo "Testing ${docker_image:=grpc_interop_python:8f586cb2-054e-4653-91a4-3ffdc94e71fc}"
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
-docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
+echo "Testing ${docker_image:=grpc_interop_python:0de8fc68-43f4-4fa0-8738-1228de6ffe8c}"
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
diff --git a/grpc/tools/interop_matrix/testcases/python__v1.18.0 b/grpc/tools/interop_matrix/testcases/python__v1.18.0
new file mode 100755
index 00000000..1c4ef8f8
--- /dev/null
+++ b/grpc/tools/interop_matrix/testcases/python__v1.18.0
@@ -0,0 +1,20 @@
+#!/bin/bash
+echo "Testing ${docker_image:=grpc_interop_python:8f586cb2-054e-4653-91a4-3ffdc94e71fc}"
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py37_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
diff --git a/grpc/tools/interop_matrix/testcases/python__v1.41.1 b/grpc/tools/interop_matrix/testcases/python__v1.41.1
new file mode 100755
index 00000000..7a07133b
--- /dev/null
+++ b/grpc/tools/interop_matrix/testcases/python__v1.41.1
@@ -0,0 +1,22 @@
+#!/bin/bash
+# DO NOT MODIFY
+# This file is generated by run_interop_tests.py/create_testcases.sh
+echo "Testing ${docker_image:=grpc_interop_python:0de8fc68-43f4-4fa0-8738-1228de6ffe8c}"
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=large_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_unary --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=ping_pong --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=empty_stream --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=client_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=server_streaming --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_begin --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=cancel_after_first_response --use_tls=true\""
+docker run -i --rm=true -e PYTHONPATH=/var/local/git/grpc/src/python/gens -e LD_LIBRARY_PATH=/var/local/git/grpc/libs/opt -w /var/local/git/grpc --net=host $docker_image bash -c "py39_native/bin/python src/python/grpcio_tests/setup.py run_interop --client --args=\"--server_host=grpc-test4.sandbox.googleapis.com --server_port=443 --test_case=timeout_on_sleeping_server --use_tls=true\""
diff --git a/grpc/tools/line_count/collect-history.py b/grpc/tools/line_count/collect-history.py
deleted file mode 100755
index c8e33c9e..00000000
--- a/grpc/tools/line_count/collect-history.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 subprocess
-import datetime
-
-# this script is only of historical interest: it's the script that was used to
-# bootstrap the dataset
-
-
-def daterange(start, end):
- for n in range(int((end - start).days)):
- yield start + datetime.timedelta(n)
-
-
-start_date = datetime.date(2017, 3, 26)
-end_date = datetime.date(2017, 3, 29)
-
-for dt in daterange(start_date, end_date):
- dmy = dt.strftime('%Y-%m-%d')
- sha1 = subprocess.check_output(
- ['git', 'rev-list', '-n', '1',
- '--before=%s' % dmy, 'master']).strip()
- subprocess.check_call(['git', 'checkout', sha1])
- subprocess.check_call(['git', 'submodule', 'update'])
- subprocess.check_call(['git', 'clean', '-f', '-x', '-d'])
- subprocess.check_call([
- 'cloc', '--vcs=git', '--by-file', '--yaml',
- '--out=../count/%s.yaml' % dmy, '.'
- ])
diff --git a/grpc/tools/line_count/collect-now.sh b/grpc/tools/line_count/collect-now.sh
deleted file mode 100755
index a5775290..00000000
--- a/grpc/tools/line_count/collect-now.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -ex
-
-cloc --vcs=git --by-file --yaml --out=cloc.yaml .
-tools/line_count/yaml2csv.py -i cloc.yaml -d `date +%Y-%m-%d` -o cloc.csv
-bq load line_counts.grpc cloc.csv
-
diff --git a/grpc/tools/line_count/summarize-history.py b/grpc/tools/line_count/summarize-history.py
deleted file mode 100755
index 4a085999..00000000
--- a/grpc/tools/line_count/summarize-history.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 subprocess
-import datetime
-
-# this script is only of historical interest: it's the script that was used to
-# bootstrap the dataset
-
-
-def daterange(start, end):
- for n in range(int((end - start).days)):
- yield start + datetime.timedelta(n)
-
-
-start_date = datetime.date(2017, 3, 26)
-end_date = datetime.date(2017, 3, 29)
-
-for dt in daterange(start_date, end_date):
- dmy = dt.strftime('%Y-%m-%d')
- print dmy
- subprocess.check_call([
- 'tools/line_count/yaml2csv.py', '-i',
- '../count/%s.yaml' % dmy, '-d', dmy, '-o',
- '../count/%s.csv' % dmy
- ])
diff --git a/grpc/tools/line_count/yaml2csv.py b/grpc/tools/line_count/yaml2csv.py
deleted file mode 100755
index bf2baf33..00000000
--- a/grpc/tools/line_count/yaml2csv.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2017 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT 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 yaml
-import argparse
-import datetime
-import csv
-
-argp = argparse.ArgumentParser(description='Convert cloc yaml to bigquery csv')
-argp.add_argument('-i', '--input', type=str)
-argp.add_argument('-d',
- '--date',
- type=str,
- default=datetime.date.today().strftime('%Y-%m-%d'))
-argp.add_argument('-o', '--output', type=str, default='out.csv')
-args = argp.parse_args()
-
-data = yaml.load(open(args.input).read())
-with open(args.output, 'w') as outf:
- writer = csv.DictWriter(
- outf, ['date', 'name', 'language', 'code', 'comment', 'blank'])
- for key, value in data.iteritems():
- if key == 'header':
- continue
- if key == 'SUM':
- continue
- if key.startswith('third_party/'):
- continue
- row = {'name': key, 'date': args.date}
- row.update(value)
- writer.writerow(row)
diff --git a/grpc/tools/mkowners/mkowners.py b/grpc/tools/mkowners/mkowners.py
index 030bbf5b..ef09a999 100755
--- a/grpc/tools/mkowners/mkowners.py
+++ b/grpc/tools/mkowners/mkowners.py
@@ -158,13 +158,13 @@ def expand_directives(root, directives):
if directive.who not in globs[glob]:
globs[glob].append(directive.who)
# expand owners for intersecting globs
- sorted_globs = sorted(globs.keys(),
+ sorted_globs = sorted(list(globs.keys()),
key=lambda g: len(git_glob(full_dir(root, g))),
reverse=True)
out_globs = collections.OrderedDict()
for glob_add in sorted_globs:
who_add = globs[glob_add]
- pre_items = [i for i in out_globs.items()]
+ pre_items = [i for i in list(out_globs.items())]
out_globs[glob_add] = who_add.copy()
for glob_have, who_have in pre_items:
files_add = git_glob(full_dir(root, glob_add))
@@ -186,8 +186,8 @@ def add_parent_to_globs(parent, globs, globs_dir):
for owners in owners_data:
if owners.dir == parent:
owners_globs = expand_directives(owners.dir, owners.directives)
- for oglob, oglob_who in owners_globs.items():
- for gglob, gglob_who in globs.items():
+ for oglob, oglob_who in list(owners_globs.items()):
+ for gglob, gglob_who in list(globs.items()):
files_parent = git_glob(full_dir(owners.dir, oglob))
files_child = git_glob(full_dir(globs_dir, gglob))
intersect = files_parent.intersection(files_child)
@@ -220,7 +220,7 @@ with open(args.out, 'w') as out:
continue
globs = expand_directives(head.dir, head.directives)
add_parent_to_globs(head.parent, globs, head.dir)
- for glob, owners in globs.items():
+ for glob, owners in list(globs.items()):
skip = False
for glob1, owners1, dir1 in reversed(written_globs):
files = git_glob(full_dir(head.dir, glob))
diff --git a/grpc/tools/profiling/bloat/bloat_diff.py b/grpc/tools/profiling/bloat/bloat_diff.py
index b6bd1de6..dc4b9665 100755
--- a/grpc/tools/profiling/bloat/bloat_diff.py
+++ b/grpc/tools/profiling/bloat/bloat_diff.py
@@ -15,9 +15,12 @@
# limitations under the License.
import argparse
+import csv
import glob
+import math
import multiprocessing
import os
+import pathlib
import shutil
import subprocess
import sys
@@ -49,18 +52,35 @@ def _build(output_dir):
"""Perform the cmake build under the output_dir."""
shutil.rmtree(output_dir, ignore_errors=True)
subprocess.check_call('mkdir -p %s' % output_dir, shell=True, cwd='.')
- subprocess.check_call(
- 'cmake -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..',
- shell=True,
- cwd=output_dir)
+ subprocess.check_call([
+ 'cmake', '-DgRPC_BUILD_TESTS=OFF', '-DBUILD_SHARED_LIBS=ON',
+ '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_C_FLAGS="-gsplit-dwarf"',
+ '-DCMAKE_CXX_FLAGS="-gsplit-dwarf"', '..'
+ ],
+ cwd=output_dir)
subprocess.check_call('make -j%d' % args.jobs, shell=True, cwd=output_dir)
+def _rank_diff_bytes(diff_bytes):
+ """Determine how significant diff_bytes is, and return a simple integer representing that"""
+ mul = 1
+ if diff_bytes < 0:
+ mul = -1
+ diff_bytes = -diff_bytes
+ if diff_bytes < 2 * 1024:
+ return 0
+ if diff_bytes < 16 * 1024:
+ return 1 * mul
+ if diff_bytes < 128 * 1024:
+ return 2 * mul
+ return 3 * mul
+
+
_build('bloat_diff_new')
if args.diff_base:
where_am_i = subprocess.check_output(
- ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode().strip()
# checkout the diff base (="old")
subprocess.check_call(['git', 'checkout', args.diff_base])
subprocess.check_call(['git', 'submodule', 'update'])
@@ -71,27 +91,58 @@ if args.diff_base:
subprocess.check_call(['git', 'checkout', where_am_i])
subprocess.check_call(['git', 'submodule', 'update'])
-subprocess.check_call('make -j%d' % args.jobs,
- shell=True,
- cwd='third_party/bloaty')
+pathlib.Path('bloaty-build').mkdir(exist_ok=True)
+subprocess.check_call(
+ ['cmake', '-G', 'Unix Makefiles', '../third_party/bloaty'],
+ cwd='bloaty-build')
+subprocess.check_call('make -j%d' % args.jobs, shell=True, cwd='bloaty-build')
text = ''
+diff_size = 0
for lib in LIBS:
text += '****************************************************************\n\n'
text += lib + '\n\n'
old_version = glob.glob('bloat_diff_old/%s' % lib)
new_version = glob.glob('bloat_diff_new/%s' % lib)
+ for filename in [old_version, new_version]:
+ if filename:
+ subprocess.check_call('strip %s -o %s.stripped' %
+ (filename[0], filename[0]),
+ shell=True)
assert len(new_version) == 1
- cmd = 'third_party/bloaty/bloaty -d compileunits,symbols'
+ cmd = 'bloaty-build/bloaty -d compileunits,symbols'
if old_version:
assert len(old_version) == 1
- text += subprocess.check_output('%s %s -- %s' %
- (cmd, new_version[0], old_version[0]),
- shell=True).decode()
+ text += subprocess.check_output(
+ '%s -n 0 --debug-file=%s --debug-file=%s %s.stripped -- %s.stripped'
+ % (cmd, new_version[0], old_version[0], new_version[0],
+ old_version[0]),
+ shell=True).decode()
+ sections = [
+ x for x in csv.reader(
+ subprocess.check_output(
+ 'bloaty-build/bloaty -n 0 --csv %s -- %s' %
+ (new_version[0], old_version[0]),
+ shell=True).decode().splitlines())
+ ]
+ print(sections)
+ for section in sections[1:]:
+ # skip debug sections for bloat severity calculation
+ if section[0].startswith(".debug"):
+ continue
+ # skip dynamic loader sections too
+ if section[0].startswith(".dyn"):
+ continue
+ diff_size += int(section[2])
else:
- text += subprocess.check_output('%s %s' % (cmd, new_version[0]),
+ text += subprocess.check_output('%s %s.stripped -n 0 --debug-file=%s' %
+ (cmd, new_version[0], new_version[0]),
shell=True).decode()
text += '\n\n'
+severity = _rank_diff_bytes(diff_size)
+print("SEVERITY: %d" % severity)
+
print(text)
check_on_pr.check_on_pr('Bloat Difference', '```\n%s\n```' % text)
+check_on_pr.label_significance_on_pr('bloat', severity)
diff --git a/grpc/tools/profiling/ios_bin/binary_size.py b/grpc/tools/profiling/ios_bin/binary_size.py
index ffb51867..880c7fcc 100755
--- a/grpc/tools/profiling/ios_bin/binary_size.py
+++ b/grpc/tools/profiling/ios_bin/binary_size.py
@@ -21,6 +21,7 @@ import os
import shutil
import subprocess
import sys
+
from parse_link_map import parse_link_map
sys.path.append(
@@ -95,7 +96,7 @@ for frameworks in [False, True]:
if args.diff_base:
old = 'old'
where_am_i = subprocess.check_output(
- ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode().strip()
subprocess.check_call(['git', 'checkout', '--', '.'])
subprocess.check_call(['git', 'checkout', args.diff_base])
subprocess.check_call(['git', 'submodule', 'update', '--force'])
diff --git a/grpc/tools/profiling/ios_bin/parse_link_map.py b/grpc/tools/profiling/ios_bin/parse_link_map.py
index 95ca153a..1b0917a0 100755
--- a/grpc/tools/profiling/ios_bin/parse_link_map.py
+++ b/grpc/tools/profiling/ios_bin/parse_link_map.py
@@ -18,8 +18,8 @@
# symbols.
# The script takes one parameter, which is the path to the link map file.
-import sys
import re
+import sys
def parse_link_map(filename):
@@ -95,11 +95,11 @@ def main():
filename = sys.argv[1]
core_size, objc_size, boringssl_size, protobuf_size, total_size = parse_link_map(
filename)
- print('Core size:{:,}'.format(core_size))
- print('ObjC size:{:,}'.format(objc_size))
- print('BoringSSL size:{:,}'.format(boringssl_size))
- print('Protobuf size:{:,}\n'.format(protobuf_size))
- print('Total size:{:,}'.format(total_size))
+ print(('Core size:{:,}'.format(core_size)))
+ print(('ObjC size:{:,}'.format(objc_size)))
+ print(('BoringSSL size:{:,}'.format(boringssl_size)))
+ print(('Protobuf size:{:,}\n'.format(protobuf_size)))
+ print(('Total size:{:,}'.format(total_size)))
if __name__ == "__main__":
diff --git a/grpc/tools/profiling/latency_profile/profile_analyzer.py b/grpc/tools/profiling/latency_profile/profile_analyzer.py
index facc024a..172568e9 100755
--- a/grpc/tools/profiling/latency_profile/profile_analyzer.py
+++ b/grpc/tools/profiling/latency_profile/profile_analyzer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -137,7 +137,7 @@ class CallStack(object):
self.signature = initial_call_stack_builder.signature
self.lines = initial_call_stack_builder.lines
for line in self.lines:
- for key, val in line.times.items():
+ for key, val in list(line.times.items()):
line.times[key] = [val]
def add(self, call_stack_builder):
@@ -146,13 +146,13 @@ class CallStack(object):
assert len(self.lines) == len(call_stack_builder.lines)
for lsum, line in zip(self.lines, call_stack_builder.lines):
assert lsum.tag == line.tag
- assert lsum.times.keys() == line.times.keys()
- for k, lst in lsum.times.items():
+ assert list(lsum.times.keys()) == list(line.times.keys())
+ for k, lst in list(lsum.times.items()):
lst.append(line.times[k])
def finish(self):
for line in self.lines:
- for lst in line.times.values():
+ for lst in list(line.times.values()):
lst.sort()
@@ -175,7 +175,7 @@ with open(args.source) as f:
del builder[thd]
time_taken = time.time() - start
-call_stacks = sorted(call_stacks.values(),
+call_stacks = sorted(list(call_stacks.values()),
key=lambda cs: cs.count,
reverse=True)
total_stacks = 0
@@ -260,7 +260,7 @@ for cs in call_stacks:
out.write(BANNER[args.fmt] % {
'count': cs.count,
})
- header, _ = zip(*FORMAT)
+ header, _ = list(zip(*FORMAT))
table = []
for line in cs.lines:
fields = []
diff --git a/grpc/tools/profiling/memory/memory_diff.py b/grpc/tools/profiling/memory/memory_diff.py
new file mode 100755
index 00000000..fd205b41
--- /dev/null
+++ b/grpc/tools/profiling/memory/memory_diff.py
@@ -0,0 +1,119 @@
+#!/usr/bin/env python3
+#
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 csv
+import glob
+import math
+import multiprocessing
+import os
+import pathlib
+import re
+import shutil
+import subprocess
+import sys
+
+sys.path.append(
+ os.path.join(os.path.dirname(sys.argv[0]), '..', '..', 'run_tests',
+ 'python_utils'))
+import check_on_pr
+
+argp = argparse.ArgumentParser(description='Perform diff on memory benchmarks')
+
+argp.add_argument('-d',
+ '--diff_base',
+ type=str,
+ help='Commit or branch to compare the current one to')
+
+argp.add_argument('-j', '--jobs', type=int, default=multiprocessing.cpu_count())
+
+args = argp.parse_args()
+
+_INTERESTING = {
+ 'client call':
+ (rb'client call memory usage: ([0-9\.]+) bytes per call', float),
+ 'server call':
+ (rb'server call memory usage: ([0-9\.]+) bytes per call', float),
+}
+
+_SCENARIOS = {
+ 'default': [],
+ 'minstack': ['--minstack'],
+}
+
+
+def _run():
+ """Build with Bazel, then run, and extract interesting lines from the output."""
+ subprocess.check_call([
+ 'tools/bazel', 'build', '-c', 'opt',
+ 'test/core/memory_usage/memory_usage_test'
+ ])
+ ret = {}
+ for scenario, extra_args in _SCENARIOS.items():
+ try:
+ output = subprocess.check_output([
+ 'bazel-bin/test/core/memory_usage/memory_usage_test',
+ '--warmup=10000',
+ '--benchmark=50000',
+ ] + extra_args)
+ except subprocess.CalledProcessError as e:
+ print('Error running benchmark:', e)
+ continue
+ for line in output.splitlines():
+ for key, (pattern, conversion) in _INTERESTING.items():
+ m = re.match(pattern, line)
+ if m:
+ ret[scenario + ': ' + key] = conversion(m.group(1))
+ return ret
+
+
+cur = _run()
+old = None
+
+if args.diff_base:
+ where_am_i = subprocess.check_output(
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode().strip()
+ # checkout the diff base (="old")
+ subprocess.check_call(['git', 'checkout', args.diff_base])
+ try:
+ old = _run()
+ finally:
+ # restore the original revision (="cur")
+ subprocess.check_call(['git', 'checkout', where_am_i])
+
+text = ''
+if old is None:
+ print(cur)
+ for key, value in sorted(cur.items()):
+ text += '{}: {}\n'.format(key, value)
+else:
+ print(cur, old)
+ diff_size = 0
+ for scenario in _SCENARIOS.keys():
+ for key, value in sorted(_INTERESTING.items()):
+ key = scenario + ': ' + key
+ if key in cur:
+ if key not in old:
+ text += '{}: {}\n'.format(key, cur[key])
+ else:
+ diff_size += cur[key] - old[key]
+ text += '{}: {} -> {}\n'.format(key, old[key], cur[key])
+
+ print("DIFF_SIZE: %f" % diff_size)
+ check_on_pr.label_increase_decrease_on_pr('per-call-memory', diff_size, 64)
+
+print(text)
+check_on_pr.check_on_pr('Memory Difference', '```\n%s\n```' % text)
diff --git a/grpc/tools/profiling/microbenchmarks/bm2bq.py b/grpc/tools/profiling/microbenchmarks/bm2bq.py
index fe2e49ab..705f1bab 100755
--- a/grpc/tools/profiling/microbenchmarks/bm2bq.py
+++ b/grpc/tools/profiling/microbenchmarks/bm2bq.py
@@ -17,16 +17,17 @@
# Convert google-benchmark json output to something that can be uploaded to
# BigQuery
-import sys
-import json
import csv
-import bm_json
import json
import subprocess
+import sys
+
+import bm_json
columns = []
for row in json.loads(
+ # TODO(jtattermusch): make sure the dataset name is not hardcoded
subprocess.check_output(
['bq', '--format=json', 'show',
'microbenchmarks.microbenchmarks']))['schema']['fields']:
@@ -40,6 +41,8 @@ SANITIZE = {
'timestamp': str,
}
+# TODO(jtattermusch): add proper argparse argument, rather than trying
+# to emulate with manual argv inspection.
if sys.argv[1] == '--schema':
print(',\n'.join('%s:%s' % (k, t.upper()) for k, t in columns))
sys.exit(0)
diff --git a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_constants.py b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
index ef608731..99b4b241 100644
--- a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
+++ b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_constants.py
@@ -16,10 +16,15 @@
""" Configurable constants for the bm_*.py family """
_AVAILABLE_BENCHMARK_TESTS = [
- 'bm_fullstack_unary_ping_pong', 'bm_fullstack_streaming_ping_pong',
- 'bm_fullstack_streaming_pump', 'bm_closure', 'bm_cq', 'bm_call_create',
- 'bm_error', 'bm_chttp2_hpack', 'bm_chttp2_transport', 'bm_pollset',
- 'bm_metadata', 'bm_fullstack_trickle'
+ 'bm_fullstack_unary_ping_pong',
+ 'bm_fullstack_streaming_ping_pong',
+ 'bm_fullstack_streaming_pump',
+ 'bm_closure',
+ 'bm_cq',
+ 'bm_call_create',
+ 'bm_chttp2_hpack',
+ 'bm_chttp2_transport',
+ 'bm_pollset',
]
_INTERESTING = ('cpu_time', 'real_time', 'locks_per_iteration',
diff --git a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
index 01b622d8..95a751a1 100755
--- a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
+++ b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
@@ -101,6 +101,7 @@ class Benchmark:
False: collections.defaultdict(list)
}
self.final = {}
+ self.speedup = {}
def add_sample(self, track, data, new):
for f in track:
@@ -117,8 +118,9 @@ class Benchmark:
_maybe_print('%s: %s=%r %s=%r mdn_diff=%r' %
(f, new_name, new, old_name, old, mdn_diff))
s = bm_speedup.speedup(new, old, 1e-5)
+ self.speedup[f] = s
if abs(s) > 3:
- if mdn_diff > 0.5 or 'trickle' in f:
+ if mdn_diff > 0.5:
self.final[f] = '%+d%%' % s
return self.final.keys()
@@ -128,6 +130,11 @@ class Benchmark:
def row(self, flds):
return [self.final[f] if f in self.final else '' for f in flds]
+ def speedup(self, name):
+ if name in self.speedup:
+ return self.speedup[name]
+ return None
+
def _read_json(filename, badjson_files, nonexistant_files):
stripped = ".".join(filename.split(".")[:-2])
@@ -204,6 +211,40 @@ def diff(bms, loops, regex, track, old, new, counters):
really_interesting.update(bm.process(track, new, old))
fields = [f for f in track if f in really_interesting]
+ # figure out the significance of the changes... right now we take the 95%-ile
+ # benchmark delta %-age, and then apply some hand chosen thresholds
+ histogram = []
+ _NOISY = ["BM_WellFlushed"]
+ for name, bm in benchmarks.items():
+ if name in _NOISY:
+ print("skipping noisy benchmark '%s' for labelling evaluation" %
+ name)
+ if bm.skip():
+ continue
+ d = bm.speedup['cpu_time']
+ if d is None:
+ continue
+ histogram.append(d)
+ histogram.sort()
+ print("histogram of speedups: ", histogram)
+ if len(histogram) == 0:
+ significance = 0
+ else:
+ delta = histogram[int(len(histogram) * 0.95)]
+ mul = 1
+ if delta < 0:
+ delta = -delta
+ mul = -1
+ if delta < 2:
+ significance = 0
+ elif delta < 5:
+ significance = 1
+ elif delta < 10:
+ significance = 2
+ else:
+ significance = 3
+ significance *= mul
+
headers = ['Benchmark'] + fields
rows = []
for name in sorted(benchmarks.keys()):
@@ -222,9 +263,10 @@ def diff(bms, loops, regex, track, old, new, counters):
note = '\n\nMissing files (indicates new benchmark): \n%s' % fmt_dict(
nonexistant_files)
if rows:
- return tabulate.tabulate(rows, headers=headers, floatfmt='+.2f'), note
+ return tabulate.tabulate(rows, headers=headers,
+ floatfmt='+.2f'), note, significance
else:
- return None, note
+ return None, note, 0
if __name__ == '__main__':
diff --git a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_main.py b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_main.py
index 816e286c..447fed7a 100755
--- a/grpc/tools/profiling/microbenchmarks/bm_diff/bm_main.py
+++ b/grpc/tools/profiling/microbenchmarks/bm_diff/bm_main.py
@@ -135,8 +135,9 @@ def main(args):
random.shuffle(jobs_list, random.SystemRandom().random)
jobset.run(jobs_list, maxjobs=args.jobs)
- diff, note = bm_diff.diff(args.benchmarks, args.loops, args.regex,
- args.track, old, 'new', args.counters)
+ diff, note, significance = bm_diff.diff(args.benchmarks, args.loops,
+ args.regex, args.track, old, 'new',
+ args.counters)
if diff:
text = '[%s] Performance differences noted:\n%s' % (
args.pr_comment_name, diff)
diff --git a/grpc/tools/profiling/microbenchmarks/bm_json.py b/grpc/tools/profiling/microbenchmarks/bm_json.py
index 0f5aab52..821b8c5f 100644
--- a/grpc/tools/profiling/microbenchmarks/bm_json.py
+++ b/grpc/tools/profiling/microbenchmarks/bm_json.py
@@ -81,7 +81,7 @@ _BM_SPECS = {
'dyn': ['end_of_stream', 'request_size'],
},
'BM_HpackParserParseHeader': {
- 'tpl': ['fixture', 'on_header'],
+ 'tpl': ['fixture'],
'dyn': [],
},
'BM_CallCreateDestroy': {
@@ -198,14 +198,23 @@ def expand_json(js, js2=None):
labels = dict(labels_list)
else:
labels = {}
+ # TODO(jtattermusch): grabbing kokoro env values shouldn't be buried
+ # deep in the JSON conversion logic.
+ # Link the data to a kokoro job run by adding
+ # well known kokoro env variables as metadata for each row
row = {
- 'jenkins_build': os.environ.get('BUILD_NUMBER', ''),
- 'jenkins_job': os.environ.get('JOB_NAME', ''),
+ 'jenkins_build': os.environ.get('KOKORO_BUILD_NUMBER', ''),
+ 'jenkins_job': os.environ.get('KOKORO_JOB_NAME', ''),
}
row.update(context)
row.update(bm)
row.update(parse_name(row['name']))
row.update(labels)
+ # TODO(jtattermusch): add a comment explaining what's the point
+ # of merging values of some of the columns js2 into the row.
+ # Empirically, the js contains data from "counters" config
+ # and js2 contains data from the "opt" config, but the point of merging
+ # really deserves further explanation.
if js2:
for bm2 in js2['benchmarks']:
if bm['name'] == bm2['name'] and 'already_used' not in bm2:
diff --git a/grpc/tools/profiling/qps/qps_diff.py b/grpc/tools/profiling/qps/qps_diff.py
index d36b96c3..68f3310b 100755
--- a/grpc/tools/profiling/qps/qps_diff.py
+++ b/grpc/tools/profiling/qps/qps_diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
#
# Copyright 2017 gRPC authors.
#
@@ -19,10 +19,11 @@ import argparse
import json
import multiprocessing
import os
-import qps_scenarios
import shutil
import subprocess
import sys
+
+import qps_scenarios
import tabulate
sys.path.append(
@@ -68,7 +69,7 @@ def build(name, jobs):
subprocess.check_call(['git', 'submodule', 'update'])
try:
subprocess.check_call(_make_cmd(jobs))
- except subprocess.CalledProcessError, e:
+ except subprocess.CalledProcessError as e:
subprocess.check_call(['make', 'clean'])
subprocess.check_call(_make_cmd(jobs))
os.rename('bins', 'qps_diff_%s' % name)
@@ -92,11 +93,11 @@ def _load_qps(fname):
try:
with open(fname) as f:
return json.loads(f.read())['qps']
- except IOError, e:
- print("IOError occurred reading file: %s" % fname)
+ except IOError as e:
+ print(("IOError occurred reading file: %s" % fname))
return None
- except ValueError, e:
- print("ValueError occurred reading file: %s" % fname)
+ except ValueError as e:
+ print(("ValueError occurred reading file: %s" % fname))
return None
@@ -127,8 +128,8 @@ def diff(scenarios, loops, old, new):
rows = []
for sn in scenarios:
mdn_diff = abs(_median(new_data[sn]) - _median(old_data[sn]))
- print('%s: %s=%r %s=%r mdn_diff=%r' %
- (sn, new, new_data[sn], old, old_data[sn], mdn_diff))
+ print(('%s: %s=%r %s=%r mdn_diff=%r' %
+ (sn, new, new_data[sn], old, old_data[sn], mdn_diff)))
s = bm_speedup.speedup(new_data[sn], old_data[sn], 10e-5)
if abs(s) > 3 and mdn_diff > 0.5:
rows.append([sn, '%+d%%' % s])
@@ -144,7 +145,7 @@ def main(args):
if args.diff_base:
where_am_i = subprocess.check_output(
- ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip()
+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode().strip()
subprocess.check_call(['git', 'checkout', args.diff_base])
try:
build('old', args.jobs)
@@ -161,7 +162,7 @@ def main(args):
text = '[qps] Performance differences noted:\n%s' % diff_output
else:
text = '[qps] No significant performance differences'
- print('%s' % text)
+ print(('%s' % text))
check_on_pr.check_on_pr('QPS', '```\n%s\n```' % text)
diff --git a/grpc/tools/release/release_notes.py b/grpc/tools/release/release_notes.py
index f2af8ed0..d16a5416 100644
--- a/grpc/tools/release/release_notes.py
+++ b/grpc/tools/release/release_notes.py
@@ -27,12 +27,16 @@ X will be v1.17.2. In both cases Y will be origin/v1.17.x.
"""
from collections import defaultdict
-import base64
import json
+import logging
+
+import urllib3
+
+logging.basicConfig(level=logging.WARNING)
content_header = """Draft Release Notes For {version}
--
-Final release notes will be generated from the PR titles that have *"release notes:yes"* label. If you have any additional notes please add them below. These will be appended to auto generated release notes. Previous releases notes are [here](https://github.com/grpc/grpc/releases).
+Final release notes will be generated from the PR titles that have *"release notes:yes"* label. If you have any additional notes please add them below. These will be appended to auto generated release notes. Previous release notes are [here](https://github.com/grpc/grpc/releases).
**Also, look at the PRs listed below against your name.** Please apply the missing labels and make necessary corrections (like fixing the title) to the PR in Github. Final release notes will be generated just before the release on {date}.
@@ -90,44 +94,36 @@ def get_commit_log(prevRelLabel, relBranch):
"git", "log", "--pretty=oneline", "--committer=GitHub",
"%s..%s" % (prevRelLabel, relBranch)
]
- print("Running ", " ".join(glg_command))
- return subprocess.check_output(glg_command)
+ print(("Running ", " ".join(glg_command)))
+ return subprocess.check_output(glg_command).decode('utf-8', 'ignore')
def get_pr_data(pr_num):
"""Get the PR data from github. Return 'error' on exception"""
-
- try:
- from urllib2 import Request, urlopen, HTTPError
- except ImportError:
- import urllib
- from urllib.request import Request, urlopen, HTTPError
+ http = urllib3.PoolManager(retries=urllib3.Retry(total=7, backoff_factor=1),
+ timeout=4.0)
url = API_URL + pr_num
- req = Request(url)
- req.add_header('Authorization', 'token %s' % TOKEN)
try:
- f = urlopen(req)
- response = json.loads(f.read().decode('utf-8'))
- #print(response)
- except HTTPError as e:
- response = json.loads(e.fp.read().decode('utf-8'))
- if 'message' in response:
- print(response['message'])
- response = "error"
- return response
+ response = http.request('GET',
+ url,
+ headers={'Authorization': 'token %s' % TOKEN})
+ except urllib3.exceptions.HTTPError as e:
+ print('Request error:', e.reason)
+ return 'error'
+ return json.loads(response.data.decode('utf-8'))
def get_pr_titles(gitLogs):
import re
error_count = 0
# PRs with merge commits
- match_merge_pr = b"Merge pull request #(\d+)"
+ match_merge_pr = "Merge pull request #(\d+)"
prlist_merge_pr = re.findall(match_merge_pr, gitLogs, re.MULTILINE)
print("\nPRs matching 'Merge pull request #<num>':")
print(prlist_merge_pr)
print("\n")
# PRs using Github's squash & merge feature
- match_sq = b"\(#(\d+)\)$"
+ match_sq = "\(#(\d+)\)$"
prlist_sq = re.findall(match_sq, gitLogs, re.MULTILINE)
print("\nPRs matching '[PR Description](#<num>)$'")
print(prlist_sq)
@@ -136,10 +132,11 @@ def get_pr_titles(gitLogs):
langs_pr = defaultdict(list)
for pr_num in prlist:
pr_num = str(pr_num)
- print("---------- getting data for PR " + pr_num)
+ print(("---------- getting data for PR " + pr_num))
pr = get_pr_data(pr_num)
if pr == "error":
- print("\n***ERROR*** Error in getting data for PR " + pr_num + "\n")
+ print(
+ ("\n***ERROR*** Error in getting data for PR " + pr_num + "\n"))
error_count += 1
continue
rl_no_found = False
@@ -158,28 +155,26 @@ def get_pr_titles(gitLogs):
if not body.endswith("."):
body = body + "."
if not pr["merged_by"]:
- print("\n***ERROR***: No merge_by found for PR " + pr_num + "\n")
+ print(("\n***ERROR***: No merge_by found for PR " + pr_num + "\n"))
error_count += 1
continue
prline = "- " + body + " ([#" + pr_num + "](" + HTML_URL + pr_num + "))"
detail = "- " + pr["merged_by"]["login"] + "@ " + prline
- prline = prline.encode('ascii', 'ignore')
- detail = detail.encode('ascii', 'ignore')
print(detail)
#if no RL label
if not rl_no_found and not rl_yes_found:
- print("Release notes label missing for " + pr_num)
+ print(("Release notes label missing for " + pr_num))
langs_pr["nolabel"].append(detail)
elif rl_yes_found and not lang_found:
- print("Lang label missing for " + pr_num)
+ print(("Lang label missing for " + pr_num))
langs_pr["nolang"].append(detail)
elif rl_no_found:
- print("'Release notes:no' found for " + pr_num)
+ print(("'Release notes:no' found for " + pr_num))
langs_pr["notinrel"].append(detail)
elif rl_yes_found:
- print("'Release notes:yes' found for " + pr_num + " with lang " +
- lang)
+ print(("'Release notes:yes' found for " + pr_num + " with lang " +
+ lang))
langs_pr["inrel"].append(detail)
langs_pr[lang].append(prline)
@@ -356,7 +351,7 @@ def main():
write_draft(langs_pr, file, version, date)
file.truncate()
file.close()
- print("\nDraft notes written to " + filename)
+ print(("\nDraft notes written to " + filename))
filename = os.path.abspath(rel_file)
if os.path.exists(filename):
@@ -368,7 +363,7 @@ def main():
write_rel_notes(langs_pr, file, version, name)
file.truncate()
file.close()
- print("\nRelease notes written to " + filename)
+ print(("\nRelease notes written to " + filename))
if error_count > 0:
print("\n\n*** Errors were encountered. See log. *********\n")
diff --git a/grpc/tools/release/update_supported_bazel_versions.sh b/grpc/tools/release/update_supported_bazel_versions.sh
new file mode 100755
index 00000000..83eecd59
--- /dev/null
+++ b/grpc/tools/release/update_supported_bazel_versions.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#Copyright 2022 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 script can be used to manually update the specific versions of Bazel
+# tested by the Bazel distribtests and advertised as supported in documentation.
+# This will update the supported_versions.txt file, which will be templated into
+# the bazel_support.md document.
+
+# This script selects the latest patch release of the two most recent major
+# versions of Bazel. If you want to include other versions in the set of
+# supported versions, then you will need to manually edit the ifle.
+
+set -xeuo pipefail
+
+cd "$(dirname "$0")/../.."
+
+# The number of most recent supported major Bazel versions.
+SUPPORT_RANGE="2"
+
+# Retrieve all git tags from the Bazel git repo.
+TAGS=$(git ls-remote --tags git@github.com:bazelbuild/bazel.git | awk '{print $2;}' | sed 's|refs/tags/||g')
+
+# Find the n most recent major versions.
+MAJOR_VERSIONS=$(echo "$TAGS" | egrep '^[0-9]+\.[0-9]+\.[0-9]+$' | cut -d'.' -f1 | sort -r | uniq | head -n"$SUPPORT_RANGE")
+
+SUPPORTED_VERSIONS=""
+
+# For each major version selected, find the most recent patch release.
+while read -r MAJOR_VERSION; do
+ LATEST_PATCH=$(echo "$TAGS" | egrep "^${MAJOR_VERSION}\.[0-9]+\.[0-9]+$" | sort -nr | head -n1)
+ SUPPORTED_VERSIONS="$SUPPORTED_VERSIONS$LATEST_PATCH\n"
+done<<<"$MAJOR_VERSIONS"
+
+printf "$SUPPORTED_VERSIONS" | tee bazel/supported_versions.txt
diff --git a/grpc/tools/release/verify_python_release.py b/grpc/tools/release/verify_python_release.py
index 7fd4fb84..d84d848a 100644
--- a/grpc/tools/release/verify_python_release.py
+++ b/grpc/tools/release/verify_python_release.py
@@ -30,9 +30,10 @@ import argparse
import collections
import hashlib
import os
-import requests
import sys
+import requests
+
_DEFAULT_PACKAGES = [
"grpcio",
"grpcio-tools",
@@ -41,6 +42,8 @@ _DEFAULT_PACKAGES = [
"grpcio-reflection",
"grpcio-channelz",
"grpcio-testing",
+ "grpcio-admin",
+ "grpcio-csds",
]
Artifact = collections.namedtuple("Artifact", ("filename", "checksum"))
diff --git a/grpc/tools/remote_build/README.md b/grpc/tools/remote_build/README.md
index 849ceb4f..aa3a780a 100644
--- a/grpc/tools/remote_build/README.md
+++ b/grpc/tools/remote_build/README.md
@@ -24,13 +24,13 @@ IMPORTANT: The OS from which you run the bazel command needs to always match you
For `opt` or `dbg` run this command:
```
# manual run of bazel tests remotely on Foundry
-bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=opt //test/...
+bazel --bazelrc=tools/remote_build/linux.bazelrc test --config=opt //test/...
```
This also works for sanitizer runs (`asan`, `msan`, `tsan`, `ubsan`):
```
# manual run of bazel tests remotely on Foundry with given sanitizer
-bazel --bazelrc=tools/remote_build/manual.bazelrc test --config=asan //test/...
+bazel --bazelrc=tools/remote_build/linux.bazelrc test --config=asan //test/...
```
### Windows
diff --git a/grpc/tools/remote_build/include/rbe_base_config.bazelrc b/grpc/tools/remote_build/include/rbe_base_config.bazelrc
new file mode 100644
index 00000000..89f1fca1
--- /dev/null
+++ b/grpc/tools/remote_build/include/rbe_base_config.bazelrc
@@ -0,0 +1,43 @@
+#@IgnoreInspection BashAddShebang
+# Copyright 2022 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.
+
+# bazelrc to configure bazel to use gRPC's main RBE instance for remote cache
+# and to upload build results to build event service (for bazel build UI results).
+# Note that remote build and test execution is left unconfigured.
+
+startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
+
+# the RBE instance to use
+build --remote_instance_name=projects/grpc-testing/instances/default_instance
+
+# Enable authentication (to be able access the RBE service)
+# Bazel will use application default credentials
+# unless overridden by --google_credentials=service_account_credentials.json
+# How to setup credentials to be able to use bazel RBE locally:
+# https://cloud.google.com/remote-build-execution/docs/results-ui/getting-started-results-ui
+build --auth_enabled=true
+
+# use remote cache (remote execution needs to be configured separately)
+# Note that remote cache is needed
+# not only for build speedup, but also for the test logs
+# to become available in ResultStore.
+build --remote_cache=grpcs://remotebuildexecution.googleapis.com
+
+# Set flags for uploading to BES in order to view results in the Bazel Build
+# Results UI.
+build --bes_backend=grpcs://buildeventservice.googleapis.com
+build --bes_timeout=600s
+build --bes_results_url="https://source.cloud.google.com/results/invocations/"
+build --project_id=grpc-testing
diff --git a/grpc/tools/remote_build/include/rbe_remote_execution.bazelrc b/grpc/tools/remote_build/include/rbe_remote_execution.bazelrc
new file mode 100644
index 00000000..9436c4a4
--- /dev/null
+++ b/grpc/tools/remote_build/include/rbe_remote_execution.bazelrc
@@ -0,0 +1,35 @@
+#@IgnoreInspection BashAddShebang
+# Copyright 2022 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.
+
+# bazelrc to configure bazel to use RBE remote executors to build and run tests.
+
+import %workspace%/tools/remote_build/include/rbe_base_config.bazelrc
+
+# configure backend for remote execution
+build --remote_executor=grpcs://remotebuildexecution.googleapis.com
+
+build --spawn_strategy=remote
+build --strategy=Javac=remote
+build --strategy=Closure=remote
+build --genrule_strategy=remote
+build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777
+
+# In the remote execution environment, each test gets its own docker containers
+# and port server won't be available.
+build --define GRPC_PORT_ISOLATED_RUNTIME=1
+
+# TODO(jtattermusch): is this still required for remote execution to work?
+build --experimental_strict_action_env=true
+build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
diff --git a/grpc/tools/remote_build/include/test_config_common.bazelrc b/grpc/tools/remote_build/include/test_config_common.bazelrc
new file mode 100644
index 00000000..2ee79da7
--- /dev/null
+++ b/grpc/tools/remote_build/include/test_config_common.bazelrc
@@ -0,0 +1,24 @@
+#@IgnoreInspection BashAddShebang
+# Copyright 2022 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.
+
+# bazelrc for common configuration of gRPC tests
+
+build --verbose_failures=true
+
+# without verbose gRPC logs the test outputs are not very useful
+test --test_env=GRPC_VERBOSITY=debug
+
+# print output for tests that fail (default is "summary")
+build --test_output=errors
diff --git a/grpc/tools/remote_build/include/test_locally_with_resultstore_results.bazelrc b/grpc/tools/remote_build/include/test_locally_with_resultstore_results.bazelrc
new file mode 100644
index 00000000..c39d173e
--- /dev/null
+++ b/grpc/tools/remote_build/include/test_locally_with_resultstore_results.bazelrc
@@ -0,0 +1,15 @@
+# Run tests locally, but configure bazel to upload
+# the results to resultstore UI.
+# Also easily extended to use remote cache for
+# locally run builds and tests (but not on by default for safety)
+
+import %workspace%/tools/remote_build/include/rbe_base_config.bazelrc
+
+# Disable uploading to build cache by default. This is to prevent
+# polluting the build cache with local build and test results.
+# When running on CI, we will override this setting along
+# with cache silo keys that prevent the build from being broken
+# by unintentional cache hits.
+build --remote_upload_local_results=false
+
+import %workspace%/tools/remote_build/include/test_config_common.bazelrc
diff --git a/grpc/tools/remote_build/kokoro.bazelrc b/grpc/tools/remote_build/kokoro.bazelrc
deleted file mode 100644
index 5c1b061b..00000000
--- a/grpc/tools/remote_build/kokoro.bazelrc
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2018 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.
-
-# bazelrc file for running gRPC tests on Kokoro using Foundry
-
-import %workspace%/tools/remote_build/rbe_common.bazelrc
-
-build --remote_cache=grpcs://remotebuildexecution.googleapis.com
-build --remote_executor=grpcs://remotebuildexecution.googleapis.com
-
-build --auth_enabled=true
-
-build --bes_backend=grpcs://buildeventservice.googleapis.com
-build --bes_timeout=600s
-build --project_id=grpc-testing
-
-# required by kokoro for some reason
-build --test_env=USER=anon
-
-build --jobs=200
-build --test_output=errors
-build --keep_going=true
diff --git a/grpc/tools/remote_build/linux.bazelrc b/grpc/tools/remote_build/linux.bazelrc
new file mode 100644
index 00000000..67e79ca7
--- /dev/null
+++ b/grpc/tools/remote_build/linux.bazelrc
@@ -0,0 +1,82 @@
+#@IgnoreInspection BashAddShebang
+# Copyright 2018 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.
+
+# bazelrc file for running gRPC tests with RBE (on Linux)
+
+import %workspace%/tools/remote_build/include/rbe_remote_execution.bazelrc
+
+# Next section is linux-specific RBE configuration
+build --crosstool_top=@rbe_default//cc:toolchain
+build --extra_toolchains=@rbe_default//config:cc-toolchain
+# Use custom execution platforms defined in third_party/toolchains
+build --extra_execution_platforms=@rbe_default//config:platform
+build --host_platform=@rbe_default//config:platform
+build --platforms=@rbe_default//config:platform
+
+# we assume the default bazel RBE build is on linux,
+# so filter out stuff that should not be built or run there.
+build --test_tag_filters=-no_linux
+build --build_tag_filters=-no_linux
+
+import %workspace%/tools/remote_build/include/test_config_common.bazelrc
+
+build --jobs=100
+
+# address sanitizer: most settings are already in %workspace%/.bazelrc
+# we only need a few additional ones that are Foundry specific
+build:asan --copt=-gmlt
+# use double the default value for "moderate" and "long" timeout as sanitizer
+# tests tend to be slower
+build:asan --test_timeout=60,600,1800,3600
+build:asan --test_tag_filters=-no_linux,-noasan,-qps_json_driver
+
+# memory sanitizer: most settings are already in %workspace%/.bazelrc
+# we only need a few additional ones that are Foundry specific
+build:msan --copt=-gmlt
+# "moderate" timeout 3x the default, "long" timeout 2x the default
+build:msan --test_timeout=60,900,1800,3600
+# TODO(jtattermusch): revisit the disabled tests
+build:msan --test_tag_filters=-no_linux,-nomsan,-json_run_localhost
+build:msan --cxxopt=--stdlib=libc++
+# setting LD_LIBRARY_PATH is necessary
+# to avoid "libc++.so.1: cannot open shared object file"
+build:msan --action_env=LD_LIBRARY_PATH=/usr/local/lib
+build:msan --host_crosstool_top=@rbe_default//cc:toolchain
+# override the config-agnostic crosstool_top
+build:msan --crosstool_top=@rbe_msan//cc:toolchain
+
+# thread sanitizer: most settings are already in %workspace%/.bazelrc
+# we only need a few additional ones that are Foundry specific
+build:tsan --copt=-gmlt
+# use double the default value for "moderate" and "long" timeout as sanitizer
+# tests tend to be slower
+build:tsan --test_timeout=60,600,1800,3600
+build:tsan --test_tag_filters=-no_linux,-notsan,-qps_json_driver
+
+# undefined behavior sanitizer: most settings are already in %workspace%/.bazelrc
+# we only need a few additional ones that are Foundry specific
+build:ubsan --copt=-gmlt
+# use double the default value for "moderate" and "long" timeout as sanitizer
+# tests tend to be slower
+build:ubsan --test_timeout=60,600,1800,3600
+# RBE docker image only has a msan specific version of libc++, so to be able to link against it,
+# we need to involuntarily enable msan as well to be able to build. See b/200667821
+# TODO(jtattermusch): disable memory sanitizer for ubsan build as soon as possible.
+build:ubsan --copt=-fsanitize=memory
+build:ubsan --copt=-fsanitize-recover=memory
+build:ubsan --linkopt=-fsanitize=memory
+build:ubsan --cxxopt=--stdlib=libc++
+build:ubsan --action_env=MSAN_OPTIONS=halt_on_error=0
+build:ubsan --test_tag_filters=-no_linux,-noubsan
diff --git a/grpc/tools/remote_build/linux_kokoro.bazelrc b/grpc/tools/remote_build/linux_kokoro.bazelrc
new file mode 100644
index 00000000..8641f3c5
--- /dev/null
+++ b/grpc/tools/remote_build/linux_kokoro.bazelrc
@@ -0,0 +1,24 @@
+# Copyright 2018 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.
+
+# bazelrc file for running gRPC tests on Kokoro using RBE (on Linux)
+# This file has extra settings for tests that run on CI (kokoro).
+
+import %workspace%/tools/remote_build/linux.bazelrc
+
+# required by kokoro for some reason
+# TODO(jtattermusch): is this still actually required?
+build --test_env=USER=anon
+
+build --jobs=200
diff --git a/grpc/tools/remote_build/mac.bazelrc b/grpc/tools/remote_build/mac.bazelrc
index 4ff71d80..c39e2446 100644
--- a/grpc/tools/remote_build/mac.bazelrc
+++ b/grpc/tools/remote_build/mac.bazelrc
@@ -1,38 +1,27 @@
# Configuration for mac bazel test runs on CI
# Bazel RBE doesn't currently support MacOS platform,
-# so we configure tests to build and run locally,
-# but try to use RBE build cache and upload results
-# to ResultStore
+# so we configure actions to execute locally,
+# but we still use RBE for build cache and to upload
+# results to ResultStore.
-startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
+import %workspace%/tools/remote_build/include/rbe_base_config.bazelrc
-# remote cache is needed not only for build speedup,
-# but also for the test logs to be available in ResultStore
-# for now, don't upload results to cache, only the test logs.
-# TODO(jtattermusch): setup a "cache-silo-key" before enabling uploads to build cache
-build --remote_cache=grpcs://remotebuildexecution.googleapis.com
-build --remote_instance_name=projects/grpc-testing/instances/default_instance
+# Disable uploading to build cache by default. This is to prevent
+# polluting the build cache with locally-started builds.
+# When running on CI, we will override this setting along
+# with cache silo keys that prevent the build from being broken
+# by unintentional cache hits.
build --remote_upload_local_results=false
-build --auth_enabled=true
-
-build --verbose_failures=true
-
build --test_tag_filters=-no_mac
build --build_tag_filters=-no_mac
-# without verbose gRPC logs the test outputs are not very useful
-test --test_env=GRPC_VERBOSITY=debug
-
-# Set flags for uploading to BES in order to view results in the Bazel Build
-# Results UI.
-build --bes_backend=grpcs://buildeventservice.googleapis.com
-build --bes_timeout=600s
-build --bes_results_url="https://source.cloud.google.com/results/invocations/"
-build --project_id=grpc-testing
-
-# print output for tests that fail (default is "summary")
-build --test_output=errors
-
# Enable strict warnings to keep it warning-free.
+# TODO(jtattermusch): this option is only used on mac. Is it actually useful?
build --define=use_strict_warning=true
+
+# Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768`
+# https://github.com/bazelbuild/bazel/issues/9190
+build --dynamic_mode=off
+
+import %workspace%/tools/remote_build/include/test_config_common.bazelrc
diff --git a/grpc/tools/remote_build/manual.bazelrc b/grpc/tools/remote_build/manual.bazelrc
deleted file mode 100644
index bc20be1b..00000000
--- a/grpc/tools/remote_build/manual.bazelrc
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2018 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.
-
-# bazelrc file for running gRPC tests with Foundry (remote build execution)
-# manually from developer's workstation
-
-import %workspace%/tools/remote_build/rbe_common.bazelrc
-
-build --remote_cache=grpcs://remotebuildexecution.googleapis.com
-build --remote_executor=grpcs://remotebuildexecution.googleapis.com
-
-# Enable authentication. Bazel will use application default credentials
-# unless overridden by --google_credentials=service_account_credentials.json
-# How to setup credentials:
-# https://cloud.google.com/remote-build-execution/docs/results-ui/getting-started-results-ui
-build --auth_enabled=true
-
-# Set flags for uploading to BES in order to view results in the Bazel Build
-# Results UI.
-build --bes_backend=grpcs://buildeventservice.googleapis.com
-build --bes_timeout=600s
-build --bes_results_url="https://source.cloud.google.com/results/invocations/"
-build --project_id=grpc-testing
-
-build --jobs=100
-
-# print output for tests that fail (default is "summary")
-build --test_output=errors
diff --git a/grpc/tools/remote_build/rbe_common.bazelrc b/grpc/tools/remote_build/rbe_common.bazelrc
deleted file mode 100644
index 5b5dcdf9..00000000
--- a/grpc/tools/remote_build/rbe_common.bazelrc
+++ /dev/null
@@ -1,94 +0,0 @@
-#@IgnoreInspection BashAddShebang
-# Copyright 2018 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.
-
-# bazelrc with Foundry setting common to both manual run and runs started by Kokoro
-# see https://github.com/bazelbuild/bazel-toolchains/tree/master/bazelrc
-# for examples and more documentation
-
-startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
-
-build --crosstool_top=@rbe_default//cc:toolchain
-build --extra_toolchains=@rbe_default//config:cc-toolchain
-# Use custom execution platforms defined in third_party/toolchains
-build --extra_execution_platforms=@rbe_default//config:platform
-build --host_platform=@rbe_default//config:platform
-build --platforms=@rbe_default//config:platform
-
-build --spawn_strategy=remote
-build --strategy=Javac=remote
-build --strategy=Closure=remote
-build --genrule_strategy=remote
-build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777
-
-build --remote_instance_name=projects/grpc-testing/instances/default_instance
-
-build --verbose_failures=true
-
-build --experimental_strict_action_env=true
-build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
-
-# don't use port server
-build --define GRPC_PORT_ISOLATED_RUNTIME=1
-# without verbose gRPC logs the test outputs are not very useful
-test --test_env=GRPC_VERBOSITY=debug
-
-# we assume the default bazel RBE build is on linux,
-# so filter out stuff that should not be built or run there.
-build --test_tag_filters=-no_linux
-build --build_tag_filters=-no_linux
-
-# address sanitizer: most settings are already in %workspace%/.bazelrc
-# we only need a few additional ones that are Foundry specific
-build:asan --copt=-gmlt
-# use double the default value for "moderate" and "long" timeout as sanitizer
-# tests tend to be slower
-build:asan --test_timeout=60,600,1800,3600
-build:asan --test_tag_filters=-no_linux,-noasan,-qps_json_driver
-
-# memory sanitizer: most settings are already in %workspace%/.bazelrc
-# we only need a few additional ones that are Foundry specific
-build:msan --copt=-gmlt
-# "moderate" timeout 3x the default, "long" timeout 2x the default
-build:msan --test_timeout=60,900,1800,3600
-# TODO(jtattermusch): revisit the disabled tests
-build:msan --test_tag_filters=-no_linux,-nomsan,-json_run_localhost
-build:msan --cxxopt=--stdlib=libc++
-# setting LD_LIBRARY_PATH is necessary
-# to avoid "libc++.so.1: cannot open shared object file"
-build:msan --action_env=LD_LIBRARY_PATH=/usr/local/lib
-build:msan --host_crosstool_top=@rbe_default//cc:toolchain
-# override the config-agnostic crosstool_top
-build:msan --crosstool_top=@rbe_msan//cc:toolchain
-
-# thread sanitizer: most settings are already in %workspace%/.bazelrc
-# we only need a few additional ones that are Foundry specific
-build:tsan --copt=-gmlt
-# use double the default value for "moderate" and "long" timeout as sanitizer
-# tests tend to be slower
-build:tsan --test_timeout=60,600,1800,3600
-build:tsan --test_tag_filters=-no_linux,-notsan,-qps_json_driver
-build:tsan --extra_execution_platforms=@rbe_default//config:platform
-
-# undefined behavior sanitizer: most settings are already in %workspace%/.bazelrc
-# we only need a few additional ones that are Foundry specific
-build:ubsan --copt=-gmlt
-# use double the default value for "moderate" and "long" timeout as sanitizer
-# tests tend to be slower
-build:ubsan --test_timeout=60,600,1800,3600
-# override the config-agnostic crosstool_top
-# how to update the bazel toolchain for ubsan:
-# - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang
-# - you might need to update the bazel_toolchains dependency in grpc_deps.bzl
-build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.3/bazel_0.29.1/ubsan:toolchain
diff --git a/grpc/tools/remote_build/windows.bazelrc b/grpc/tools/remote_build/windows.bazelrc
index c260670f..ceef31cf 100644
--- a/grpc/tools/remote_build/windows.bazelrc
+++ b/grpc/tools/remote_build/windows.bazelrc
@@ -1,10 +1,6 @@
-startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
-
-build --remote_cache=grpcs://remotebuildexecution.googleapis.com
-build --remote_executor=grpcs://remotebuildexecution.googleapis.com
-
-build --auth_enabled=true
+import %workspace%/tools/remote_build/include/rbe_remote_execution.bazelrc
+# Next section is windows-specific RBE configuration
build --host_crosstool_top=//third_party/toolchains/bazel_0.26.0_rbe_windows:toolchain
build --crosstool_top=//third_party/toolchains/bazel_0.26.0_rbe_windows:toolchain
build --extra_toolchains=//third_party/toolchains/bazel_0.26.0_rbe_windows:cc-toolchain-x64_windows
@@ -16,35 +12,9 @@ build --platforms=//third_party/toolchains:rbe_windows
build --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe
build --python_path=C:\\Python27\\python.exe
-build --spawn_strategy=remote
-build --strategy=Javac=remote
-build --strategy=Closure=remote
-build --genrule_strategy=remote
-build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777
-
-build --remote_instance_name=projects/grpc-testing/instances/default_instance
-
-build --verbose_failures=true
-
-build --experimental_strict_action_env=true
-build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
-
-# don't use port server
-build --define GRPC_PORT_ISOLATED_RUNTIME=1
build --test_tag_filters=-no_windows
build --build_tag_filters=-no_windows
-# without verbose gRPC logs the test outputs are not very useful
-test --test_env=GRPC_VERBOSITY=debug
-
-# Set flags for uploading to BES in order to view results in the Bazel Build
-# Results UI.
-build --bes_backend=grpcs://buildeventservice.googleapis.com
-build --bes_timeout=600s
-build --bes_results_url="https://source.cloud.google.com/results/invocations/"
-build --project_id=grpc-testing
-
build --jobs=100
-# print output for tests that fail (default is "summary")
-build --test_output=errors
+import %workspace%/tools/remote_build/include/test_config_common.bazelrc
diff --git a/grpc/tools/run_tests/artifacts/artifact_targets.py b/grpc/tools/run_tests/artifacts/artifact_targets.py
index 7ba32699..048fe25c 100644
--- a/grpc/tools/run_tests/artifacts/artifact_targets.py
+++ b/grpc/tools/run_tests/artifacts/artifact_targets.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,8 @@ import sys
sys.path.insert(0, os.path.abspath('..'))
import python_utils.jobset as jobset
+_LATEST_MANYLINUX = "manylinux2014"
+
def create_docker_jobspec(name,
dockerfile_dir,
@@ -34,15 +36,15 @@ def create_docker_jobspec(name,
verbose_success=False):
"""Creates jobspec for a task running under docker."""
environ = environ.copy()
- environ['RUN_COMMAND'] = shell_command
environ['ARTIFACTS_OUT'] = 'artifacts/%s' % name
docker_args = []
- for k, v in environ.items():
+ for k, v in list(environ.items()):
docker_args += ['-e', '%s=%s' % (k, v)]
docker_env = {
'DOCKERFILE_DIR': dockerfile_dir,
'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh',
+ 'DOCKER_RUN_SCRIPT_COMMAND': shell_command,
'OUTPUT_DIR': 'artifacts'
}
if extra_docker_args is not None:
@@ -99,20 +101,36 @@ _ARCH_FLAG_MAP = {'x86': '-m32', 'x64': '-m64'}
class PythonArtifact:
"""Builds Python artifacts."""
- def __init__(self, platform, arch, py_version):
+ def __init__(self, platform, arch, py_version, presubmit=False):
self.name = 'python_%s_%s_%s' % (platform, arch, py_version)
self.platform = platform
self.arch = arch
self.labels = ['artifact', 'python', platform, arch, py_version]
+ if presubmit:
+ self.labels.append('presubmit')
self.py_version = py_version
+ if platform == _LATEST_MANYLINUX:
+ self.labels.append('latest-manylinux')
if 'manylinux' in platform:
self.labels.append('linux')
+ if 'linux_extra' in platform:
+ # linux_extra wheels used to be built by a separate kokoro job.
+ # Their build is now much faster, so they can be included
+ # in the regular artifact build.
+ self.labels.append('linux')
+ if 'musllinux' in platform:
+ self.labels.append('linux')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
environ = {}
+ if inner_jobs is not None:
+ # set number of parallel jobs when building native extension
+ # building the native extension is the most time-consuming part of the build
+ environ['GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS'] = str(inner_jobs)
+
if self.platform == 'linux_extra':
# Crosscompilation build for armv7 (e.g. Raspberry Pi)
environ['PYTHON'] = '/opt/python/{}/bin/python3'.format(
@@ -120,14 +138,6 @@ class PythonArtifact:
environ['PIP'] = '/opt/python/{}/bin/pip3'.format(self.py_version)
environ['GRPC_SKIP_PIP_CYTHON_UPGRADE'] = 'TRUE'
environ['GRPC_SKIP_TWINE_CHECK'] = 'TRUE'
- # when crosscompiling, we need to force statically linking libstdc++
- # otherwise libstdc++ symbols would be too new and the resulting
- # wheel wouldn't pass the auditwheel check.
- # This is needed because C core won't build with GCC 4.8 that's
- # included in the default dockcross toolchain and we needed
- # to opt into using a slighly newer version of GCC.
- environ['GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX'] = 'TRUE'
-
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_python_linux_{}'.format(
@@ -146,14 +156,6 @@ class PythonArtifact:
environ['GRPC_SKIP_PIP_CYTHON_UPGRADE'] = 'TRUE'
if self.arch == 'aarch64':
environ['GRPC_SKIP_TWINE_CHECK'] = 'TRUE'
- # when crosscompiling, we need to force statically linking libstdc++
- # otherwise libstdc++ symbols would be too new and the resulting
- # wheel wouldn't pass the auditwheel check.
- # This is needed because C core won't build with GCC 4.8 that's
- # included in the default dockcross toolchain and we needed
- # to opt into using a slighly newer version of GCC.
- environ['GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX'] = 'TRUE'
-
else:
# only run auditwheel if we're not crosscompiling
environ['GRPC_RUN_AUDITWHEEL_REPAIR'] = 'TRUE'
@@ -169,11 +171,22 @@ class PythonArtifact:
'tools/run_tests/artifacts/build_artifact_python.sh',
environ=environ,
timeout_seconds=60 * 60 * 2)
+ elif 'musllinux' in self.platform:
+ environ['PYTHON'] = '/opt/python/{}/bin/python'.format(
+ self.py_version)
+ environ['PIP'] = '/opt/python/{}/bin/pip'.format(self.py_version)
+ environ['GRPC_SKIP_PIP_CYTHON_UPGRADE'] = 'TRUE'
+ environ['GRPC_RUN_AUDITWHEEL_REPAIR'] = 'TRUE'
+ environ['GRPC_PYTHON_BUILD_WITH_STATIC_LIBSTDCXX'] = 'TRUE'
+ return create_docker_jobspec(
+ self.name,
+ 'tools/dockerfile/grpc_artifact_python_%s_%s' %
+ (self.platform, self.arch),
+ 'tools/run_tests/artifacts/build_artifact_python.sh',
+ environ=environ,
+ timeout_seconds=60 * 60 * 2)
elif self.platform == 'windows':
- if 'Python27' in self.py_version:
- environ['EXT_COMPILER'] = 'mingw32'
- else:
- environ['EXT_COMPILER'] = 'msvc'
+ environ['EXT_COMPILER'] = 'msvc'
# For some reason, the batch script %random% always runs with the same
# seed. We create a random temp-dir here
dir = ''.join(
@@ -202,28 +215,37 @@ class PythonArtifact:
class RubyArtifact:
"""Builds ruby native gem."""
- def __init__(self, platform, arch):
- self.name = 'ruby_native_gem_%s_%s' % (platform, arch)
+ def __init__(self, platform, gem_platform, presubmit=False):
+ self.name = 'ruby_native_gem_%s_%s' % (platform, gem_platform)
self.platform = platform
- self.arch = arch
- self.labels = ['artifact', 'ruby', platform, arch]
+ self.gem_platform = gem_platform
+ self.labels = ['artifact', 'ruby', platform, gem_platform]
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ environ = {}
+ if inner_jobs is not None:
+ # set number of parallel jobs when building native extension
+ environ['GRPC_RUBY_BUILD_PROCS'] = str(inner_jobs)
# Ruby build uses docker internally and docker cannot be nested.
# We are using a custom workspace instead.
- return create_jobspec(
- self.name, ['tools/run_tests/artifacts/build_artifact_ruby.sh'],
- use_workspace=True,
- timeout_seconds=60 * 60)
+ return create_jobspec(self.name, [
+ 'tools/run_tests/artifacts/build_artifact_ruby.sh',
+ self.gem_platform
+ ],
+ use_workspace=True,
+ timeout_seconds=90 * 60,
+ environ=environ)
class CSharpExtArtifact:
"""Builds C# native extension library"""
- def __init__(self, platform, arch, arch_abi=None):
+ def __init__(self, platform, arch, arch_abi=None, presubmit=False):
self.name = 'csharp_ext_%s_%s' % (platform, arch)
self.platform = platform
self.arch = arch
@@ -232,30 +254,40 @@ class CSharpExtArtifact:
if arch_abi:
self.name += '_%s' % arch_abi
self.labels.append(arch_abi)
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ environ = {}
+ if inner_jobs is not None:
+ # set number of parallel jobs when building native extension
+ environ['GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS'] = str(inner_jobs)
+
if self.arch == 'android':
+ environ['ANDROID_ABI'] = self.arch_abi
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_android_ndk',
'tools/run_tests/artifacts/build_artifact_csharp_android.sh',
- environ={'ANDROID_ABI': self.arch_abi})
+ environ=environ)
elif self.arch == 'ios':
return create_jobspec(
self.name,
['tools/run_tests/artifacts/build_artifact_csharp_ios.sh'],
timeout_seconds=60 * 60,
- use_workspace=True)
+ use_workspace=True,
+ environ=environ)
elif self.platform == 'windows':
return create_jobspec(self.name, [
'tools\\run_tests\\artifacts\\build_artifact_csharp.bat',
self.arch
],
timeout_seconds=45 * 60,
- use_workspace=True)
+ use_workspace=True,
+ environ=environ)
else:
if self.platform == 'linux':
dockerfile_dir = 'tools/dockerfile/grpc_artifact_centos6_{}'.format(
@@ -265,14 +297,17 @@ class CSharpExtArtifact:
# give us both ready to use crosscompiler and sufficient backward compatibility
dockerfile_dir = 'tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64'
return create_docker_jobspec(
- self.name, dockerfile_dir,
- 'tools/run_tests/artifacts/build_artifact_csharp.sh')
+ self.name,
+ dockerfile_dir,
+ 'tools/run_tests/artifacts/build_artifact_csharp.sh',
+ environ=environ)
else:
return create_jobspec(
self.name,
['tools/run_tests/artifacts/build_artifact_csharp.sh'],
timeout_seconds=45 * 60,
- use_workspace=True)
+ use_workspace=True,
+ environ=environ)
def __str__(self):
return self.name
@@ -281,44 +316,60 @@ class CSharpExtArtifact:
class PHPArtifact:
"""Builds PHP PECL package"""
- def __init__(self, platform, arch):
+ def __init__(self, platform, arch, presubmit=False):
self.name = 'php_pecl_package_{0}_{1}'.format(platform, arch)
self.platform = platform
self.arch = arch
self.labels = ['artifact', 'php', platform, arch]
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
- return create_docker_jobspec(
- self.name,
- 'tools/dockerfile/test/php73_zts_stretch_{}'.format(self.arch),
- 'tools/run_tests/artifacts/build_artifact_php.sh')
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as PHP artifact build is basically just packing an archive
+ if self.platform == 'linux':
+ return create_docker_jobspec(
+ self.name,
+ 'tools/dockerfile/test/php73_zts_debian11_{}'.format(self.arch),
+ 'tools/run_tests/artifacts/build_artifact_php.sh')
+ else:
+ return create_jobspec(
+ self.name, ['tools/run_tests/artifacts/build_artifact_php.sh'],
+ use_workspace=True)
class ProtocArtifact:
"""Builds protoc and protoc-plugin artifacts"""
- def __init__(self, platform, arch):
+ def __init__(self, platform, arch, presubmit=False):
self.name = 'protoc_%s_%s' % (platform, arch)
self.platform = platform
self.arch = arch
self.labels = ['artifact', 'protoc', platform, arch]
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ environ = {}
+ if inner_jobs is not None:
+ # set number of parallel jobs when building protoc
+ environ['GRPC_PROTOC_BUILD_COMPILER_JOBS'] = str(inner_jobs)
+
if self.platform != 'windows':
- environ = {'CXXFLAGS': '', 'LDFLAGS': ''}
+ environ['CXXFLAGS'] = ''
+ environ['LDFLAGS'] = ''
if self.platform == 'linux':
dockerfile_dir = 'tools/dockerfile/grpc_artifact_centos6_{}'.format(
self.arch)
if self.arch == 'aarch64':
# for aarch64, use a dockcross manylinux image that will
# give us both ready to use crosscompiler and sufficient backward compatibility
- dockerfile_dir = 'tools/dockerfile/grpc_artifact_python_manylinux2014_aarch64'
+ dockerfile_dir = 'tools/dockerfile/grpc_artifact_protoc_aarch64'
environ['LDFLAGS'] += ' -static-libgcc -static-libstdc++ -s'
return create_docker_jobspec(
self.name,
@@ -335,86 +386,112 @@ class ProtocArtifact:
timeout_seconds=60 * 60,
use_workspace=True)
else:
- generator = 'Visual Studio 14 2015 Win64' if self.arch == 'x64' else 'Visual Studio 14 2015'
+ vs_tools_architecture = self.arch # architecture selector passed to vcvarsall.bat
+ environ['ARCHITECTURE'] = vs_tools_architecture
return create_jobspec(
self.name,
['tools\\run_tests\\artifacts\\build_artifact_protoc.bat'],
- environ={'generator': generator},
+ environ=environ,
use_workspace=True)
def __str__(self):
return self.name
+def _reorder_targets_for_build_speed(targets):
+ """Reorder targets to achieve optimal build speed"""
+ # ruby artifact build builds multiple artifacts at once, so make sure
+ # we start building ruby artifacts first, so that they don't end up
+ # being a long tail once everything else finishes.
+ return list(
+ sorted(targets,
+ key=lambda target: 0 if target.name.startswith('ruby_') else 1))
+
+
def targets():
"""Gets list of supported targets"""
- return [
- ProtocArtifact('linux', 'x64'),
- ProtocArtifact('linux', 'x86'),
- ProtocArtifact('linux', 'aarch64'),
- ProtocArtifact('macos', 'x64'),
- ProtocArtifact('windows', 'x64'),
- ProtocArtifact('windows', 'x86'),
- CSharpExtArtifact('linux', 'x64'),
- CSharpExtArtifact('linux', 'aarch64'),
- CSharpExtArtifact('macos', 'x64'),
- CSharpExtArtifact('windows', 'x64'),
- CSharpExtArtifact('windows', 'x86'),
- CSharpExtArtifact('linux', 'android', arch_abi='arm64-v8a'),
- CSharpExtArtifact('linux', 'android', arch_abi='armeabi-v7a'),
- CSharpExtArtifact('linux', 'android', arch_abi='x86'),
- CSharpExtArtifact('macos', 'ios'),
- PythonArtifact('manylinux2014', 'x64', 'cp35-cp35m'),
- PythonArtifact('manylinux2014', 'x64', 'cp36-cp36m'),
+ return _reorder_targets_for_build_speed([
+ ProtocArtifact('linux', 'x64', presubmit=True),
+ ProtocArtifact('linux', 'x86', presubmit=True),
+ ProtocArtifact('linux', 'aarch64', presubmit=True),
+ ProtocArtifact('macos', 'x64', presubmit=True),
+ ProtocArtifact('windows', 'x64', presubmit=True),
+ ProtocArtifact('windows', 'x86', presubmit=True),
+ CSharpExtArtifact('linux', 'x64', presubmit=True),
+ CSharpExtArtifact('linux', 'aarch64', presubmit=True),
+ CSharpExtArtifact('macos', 'x64', presubmit=True),
+ CSharpExtArtifact('windows', 'x64', presubmit=True),
+ CSharpExtArtifact('windows', 'x86', presubmit=True),
+ CSharpExtArtifact('linux',
+ 'android',
+ arch_abi='arm64-v8a',
+ presubmit=True),
+ CSharpExtArtifact('linux',
+ 'android',
+ arch_abi='armeabi-v7a',
+ presubmit=True),
+ CSharpExtArtifact('linux', 'android', arch_abi='x86', presubmit=True),
+ CSharpExtArtifact('macos', 'ios', presubmit=True),
+ PythonArtifact('manylinux2014', 'x64', 'cp36-cp36m', presubmit=True),
PythonArtifact('manylinux2014', 'x64', 'cp37-cp37m'),
PythonArtifact('manylinux2014', 'x64', 'cp38-cp38'),
PythonArtifact('manylinux2014', 'x64', 'cp39-cp39'),
- PythonArtifact('manylinux2014', 'x86', 'cp35-cp35m'),
- PythonArtifact('manylinux2014', 'x86', 'cp36-cp36m'),
+ PythonArtifact('manylinux2014', 'x64', 'cp310-cp310', presubmit=True),
+ PythonArtifact('manylinux2014', 'x86', 'cp36-cp36m', presubmit=True),
PythonArtifact('manylinux2014', 'x86', 'cp37-cp37m'),
PythonArtifact('manylinux2014', 'x86', 'cp38-cp38'),
PythonArtifact('manylinux2014', 'x86', 'cp39-cp39'),
- PythonArtifact('manylinux2010', 'x64', 'cp27-cp27m'),
- PythonArtifact('manylinux2010', 'x64', 'cp27-cp27mu'),
- PythonArtifact('manylinux2010', 'x64', 'cp35-cp35m'),
+ PythonArtifact('manylinux2014', 'x86', 'cp310-cp310', presubmit=True),
PythonArtifact('manylinux2010', 'x64', 'cp36-cp36m'),
- PythonArtifact('manylinux2010', 'x64', 'cp37-cp37m'),
+ PythonArtifact('manylinux2010', 'x64', 'cp37-cp37m', presubmit=True),
PythonArtifact('manylinux2010', 'x64', 'cp38-cp38'),
PythonArtifact('manylinux2010', 'x64', 'cp39-cp39'),
- PythonArtifact('manylinux2010', 'x86', 'cp27-cp27m'),
- PythonArtifact('manylinux2010', 'x86', 'cp27-cp27mu'),
- PythonArtifact('manylinux2010', 'x86', 'cp35-cp35m'),
PythonArtifact('manylinux2010', 'x86', 'cp36-cp36m'),
- PythonArtifact('manylinux2010', 'x86', 'cp37-cp37m'),
+ PythonArtifact('manylinux2010', 'x86', 'cp37-cp37m', presubmit=True),
PythonArtifact('manylinux2010', 'x86', 'cp38-cp38'),
PythonArtifact('manylinux2010', 'x86', 'cp39-cp39'),
- PythonArtifact('manylinux2014', 'aarch64', 'cp36-cp36m'),
+ PythonArtifact('manylinux2014', 'aarch64', 'cp36-cp36m',
+ presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp37-cp37m'),
- PythonArtifact('manylinux2014', 'aarch64', 'cp38-cp38'),
+ PythonArtifact('manylinux2014', 'aarch64', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp39-cp39'),
- PythonArtifact('linux_extra', 'armv7', 'cp36-cp36m'),
+ PythonArtifact('manylinux2014', 'aarch64', 'cp310-cp310'),
+ PythonArtifact('linux_extra', 'armv7', 'cp36-cp36m', presubmit=True),
PythonArtifact('linux_extra', 'armv7', 'cp37-cp37m'),
PythonArtifact('linux_extra', 'armv7', 'cp38-cp38'),
PythonArtifact('linux_extra', 'armv7', 'cp39-cp39'),
- PythonArtifact('macos', 'x64', 'python2.7'),
- PythonArtifact('macos', 'x64', 'python3.5'),
- PythonArtifact('macos', 'x64', 'python3.6'),
+ PythonArtifact('linux_extra', 'armv7', 'cp310-cp310', presubmit=True),
+ PythonArtifact('musllinux_1_1', 'x64', 'cp310-cp310', presubmit=True),
+ PythonArtifact('musllinux_1_1', 'x64', 'cp36-cp36m', presubmit=True),
+ PythonArtifact('musllinux_1_1', 'x64', 'cp37-cp37m'),
+ PythonArtifact('musllinux_1_1', 'x64', 'cp38-cp38'),
+ PythonArtifact('musllinux_1_1', 'x64', 'cp39-cp39'),
+ PythonArtifact('musllinux_1_1', 'x86', 'cp310-cp310', presubmit=True),
+ PythonArtifact('musllinux_1_1', 'x86', 'cp36-cp36m', presubmit=True),
+ PythonArtifact('musllinux_1_1', 'x86', 'cp37-cp37m'),
+ PythonArtifact('musllinux_1_1', 'x86', 'cp38-cp38'),
+ PythonArtifact('musllinux_1_1', 'x86', 'cp39-cp39'),
+ PythonArtifact('macos', 'x64', 'python3.6', presubmit=True),
PythonArtifact('macos', 'x64', 'python3.7'),
PythonArtifact('macos', 'x64', 'python3.8'),
PythonArtifact('macos', 'x64', 'python3.9'),
- PythonArtifact('windows', 'x86', 'Python27_32bit'),
- PythonArtifact('windows', 'x86', 'Python35_32bit'),
- PythonArtifact('windows', 'x86', 'Python36_32bit'),
+ PythonArtifact('macos', 'x64', 'python3.10', presubmit=True),
+ PythonArtifact('windows', 'x86', 'Python36_32bit', presubmit=True),
PythonArtifact('windows', 'x86', 'Python37_32bit'),
PythonArtifact('windows', 'x86', 'Python38_32bit'),
PythonArtifact('windows', 'x86', 'Python39_32bit'),
- PythonArtifact('windows', 'x64', 'Python27'),
- PythonArtifact('windows', 'x64', 'Python35'),
- PythonArtifact('windows', 'x64', 'Python36'),
+ PythonArtifact('windows', 'x86', 'Python310_32bit', presubmit=True),
+ PythonArtifact('windows', 'x64', 'Python36', presubmit=True),
PythonArtifact('windows', 'x64', 'Python37'),
PythonArtifact('windows', 'x64', 'Python38'),
PythonArtifact('windows', 'x64', 'Python39'),
- RubyArtifact('linux', 'x64'),
- RubyArtifact('macos', 'x64'),
- PHPArtifact('linux', 'x64')
- ]
+ PythonArtifact('windows', 'x64', 'Python310', presubmit=True),
+ RubyArtifact('linux', 'x86-mingw32', presubmit=True),
+ RubyArtifact('linux', 'x64-mingw32', presubmit=True),
+ RubyArtifact('linux', 'x86_64-linux', presubmit=True),
+ RubyArtifact('linux', 'x86-linux', presubmit=True),
+ RubyArtifact('linux', 'x86_64-darwin', presubmit=True),
+ RubyArtifact('linux', 'arm64-darwin', presubmit=True),
+ PHPArtifact('linux', 'x64', presubmit=True),
+ PHPArtifact('macos', 'x64', presubmit=True),
+ ])
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_csharp.bat b/grpc/tools/run_tests/artifacts/build_artifact_csharp.bat
index 713e480f..45ddabef 100644
--- a/grpc/tools/run_tests/artifacts/build_artifact_csharp.bat
+++ b/grpc/tools/run_tests/artifacts/build_artifact_csharp.bat
@@ -26,17 +26,22 @@ cd build
mkdir %ARCHITECTURE%
cd %ARCHITECTURE%
-@rem TODO(jtattermusch): is there a better way to force using MSVC?
-@rem select the MSVC compiler explicitly to avoid using gcc from mingw or cygwin
-@rem (both are on path)
-set "MSVC_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe"
-if "%ARCHITECTURE%" == "x64" (
- set "MSVC_COMPILER=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"
+@rem Use externally provided env to determine build parallelism, otherwise use default.
+if "%GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS%"=="" (
+ set GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS=2
)
+@rem set cl.exe build environment to build with VS2015 tooling
+@rem this is required for Ninja build to work
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCHITECTURE%
-cmake -G Ninja -DCMAKE_C_COMPILER="%MSVC_COMPILER%" -DCMAKE_CXX_COMPILER="%MSVC_COMPILER%" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../.. || goto :error
-cmake --build . --target grpc_csharp_ext
+@rem restore command echo
+echo on
+
+@rem Select MSVC compiler (cl.exe) explicitly to make sure we don't end up gcc from mingw or cygwin
+@rem (both are on path in kokoro win workers)
+cmake -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON -DgRPC_XDS_USER_AGENT_IS_CSHARP=ON ../../.. || goto :error
+
+ninja -j%GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS% grpc_csharp_ext || goto :error
cd ..\..\..
mkdir -p %ARTIFACTS_OUT%
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_csharp.sh b/grpc/tools/run_tests/artifacts/build_artifact_csharp.sh
index 3ea389fe..a1ac653d 100755
--- a/grpc/tools/run_tests/artifacts/build_artifact_csharp.sh
+++ b/grpc/tools/run_tests/artifacts/build_artifact_csharp.sh
@@ -23,9 +23,13 @@ cd cmake/build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
-DgRPC_BUILD_TESTS=OFF \
+ -DgRPC_XDS_USER_AGENT_IS_CSHARP=ON \
../..
-make grpc_csharp_ext -j2
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS=${GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS:-2}
+
+make grpc_csharp_ext "-j${GRPC_CSHARP_BUILD_EXT_COMPILER_JOBS}"
if [ -f "libgrpc_csharp_ext.so" ]
then
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_php.sh b/grpc/tools/run_tests/artifacts/build_artifact_php.sh
index 629718e1..dd242d1c 100755
--- a/grpc/tools/run_tests/artifacts/build_artifact_php.sh
+++ b/grpc/tools/run_tests/artifacts/build_artifact_php.sh
@@ -21,12 +21,5 @@ mkdir -p "${ARTIFACTS_OUT}"
# Build the PHP extension archive (this just zips all the files up)
pear package
-# Note: the extension compiled by this step is not being used in any
-# way, i.e. they are not the pacakge being distributed.
-# This is done here to get an early signal for compiling the PHP
-# extension in some form.
-find . -name "grpc-*.tgz" | cut -b3- | xargs pecl install
-# Verified that the grpc extension is built properly.
-php -d extension=grpc.so --re grpc | head -1
cp -r grpc-*.tgz "${ARTIFACTS_OUT}"/
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_protoc.bat b/grpc/tools/run_tests/artifacts/build_artifact_protoc.bat
index 1d5bf034..5d7feb89 100644
--- a/grpc/tools/run_tests/artifacts/build_artifact_protoc.bat
+++ b/grpc/tools/run_tests/artifacts/build_artifact_protoc.bat
@@ -22,13 +22,26 @@ cd cmake
mkdir build
cd build
-cmake -G "%generator%" -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../.. || goto :error
-cmake --build . --target protoc --config Release || goto :error
-cmake --build . --target plugins --config Release || goto :error
+@rem Use externally provided env to determine build parallelism, otherwise use default.
+if "%GRPC_PROTOC_BUILD_COMPILER_JOBS%"=="" (
+ set GRPC_PROTOC_BUILD_COMPILER_JOBS=2
+)
+
+@rem set cl.exe build environment to build with VS2015 tooling
+@rem this is required for Ninja build to work
+call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCHITECTURE%
+@rem restore command echo
+echo on
+
+@rem Select MSVC compiler (cl.exe) explicitly to make sure we don't end up gcc from mingw or cygwin
+@rem (both are on path in kokoro win workers)
+cmake -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../.. || goto :error
+
+ninja -j%GRPC_PROTOC_BUILD_COMPILER_JOBS% protoc plugins || goto :error
cd ..\..
-xcopy /Y cmake\build\third_party\protobuf\Release\protoc.exe %ARTIFACTS_OUT%\ || goto :error
-xcopy /Y cmake\build\Release\*_plugin.exe %ARTIFACTS_OUT%\ || goto :error
+xcopy /Y cmake\build\third_party\protobuf\protoc.exe %ARTIFACTS_OUT%\ || goto :error
+xcopy /Y cmake\build\*_plugin.exe %ARTIFACTS_OUT%\ || goto :error
goto :EOF
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_protoc.sh b/grpc/tools/run_tests/artifacts/build_artifact_protoc.sh
index 12714717..4462a62f 100755
--- a/grpc/tools/run_tests/artifacts/build_artifact_protoc.sh
+++ b/grpc/tools/run_tests/artifacts/build_artifact_protoc.sh
@@ -21,7 +21,11 @@ mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ../..
-make protoc plugins -j2
+
+# Use externally provided env to determine build parallelism, otherwise use default.
+GRPC_PROTOC_BUILD_COMPILER_JOBS=${GRPC_PROTOC_BUILD_COMPILER_JOBS:-2}
+
+make protoc plugins "-j${GRPC_PROTOC_BUILD_COMPILER_JOBS}"
popd
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_python.bat b/grpc/tools/run_tests/artifacts/build_artifact_python.bat
index b9b058bb..a74c39f9 100644
--- a/grpc/tools/run_tests/artifacts/build_artifact_python.bat
+++ b/grpc/tools/run_tests/artifacts/build_artifact_python.bat
@@ -15,8 +15,6 @@
@rem set path to python
set PATH=C:\%1;C:\%1\scripts;%PATH%
-if "%1" == "Python27" goto :install_mingw64_with_msvcr90
-if "%1" == "Python27_32bit" goto :install_mingw64_with_msvcr90
@rem set path to the existed mingw compiler
set PATH=C:\msys64\mingw%2\bin;C:\tools\msys64\mingw%2\bin;%PATH%
:end_mingw64_installation
@@ -32,7 +30,10 @@ set GRPC_PYTHON_BUILD_WITH_CYTHON=1
@rem Allow build_ext to build C/C++ files in parallel
@rem by enabling a monkeypatch. It speeds up the build a lot.
-set GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=4
+@rem Use externally provided GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS value if set.
+if "%GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS%"=="" (
+ set GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=4
+)
mkdir -p %ARTIFACTS_OUT%
set ARTIFACT_DIR=%cd%\%ARTIFACTS_OUT%
@@ -55,7 +56,7 @@ python setup.py bdist_wheel || goto :error
popd
@rem Ensure the generate artifacts are valid.
-python -m pip install "twine<=2.0"
+python -m pip install packaging==21.3 twine==3.8.0
python -m twine check dist\* tools\distrib\python\grpcio_tools\dist\* || goto :error
xcopy /Y /I /S dist\* %ARTIFACT_DIR% || goto :error
@@ -66,13 +67,3 @@ goto :EOF
:error
popd
exit /b 1
-
-:install_mingw64_with_msvcr90
-set MSYS64_DOWNLOAD_URL=https://storage.googleapis.com/grpc-build-helper/msys64.zip
-set MSYS64_PATH=C:\tools\msys64_win7
-set PATH=%MSYS64_PATH%\mingw%2\bin;%PATH%
-@rem Skip the installation if the directory exists
-if exist "%MSYS64_PATH%" goto :end_mingw64_installation
-python -m pip install requests || goto :error
-python tools\run_tests\python_utils\download_and_unzip.py "%MSYS64_DOWNLOAD_URL%" "%MSYS64_PATH%" || goto :error
-goto :end_mingw64_installation
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_python.sh b/grpc/tools/run_tests/artifacts/build_artifact_python.sh
index 64f68cf3..c380ab85 100755
--- a/grpc/tools/run_tests/artifacts/build_artifact_python.sh
+++ b/grpc/tools/run_tests/artifacts/build_artifact_python.sh
@@ -19,9 +19,15 @@ cd "$(dirname "$0")/../../.."
export GRPC_PYTHON_BUILD_WITH_CYTHON=1
export PYTHON=${PYTHON:-python}
-export PIP=${PIP:-pip}
export AUDITWHEEL=${AUDITWHEEL:-auditwheel}
+# activate ccache if desired
+# shellcheck disable=SC1091
+source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc
+
+# Needed for building binary distribution wheels -- bdist_wheel
+"${PYTHON}" -m pip install --upgrade wheel
+
if [ "$GRPC_SKIP_PIP_CYTHON_UPGRADE" == "" ]
then
# Install Cython to avoid source wheel build failure.
@@ -31,7 +37,7 @@ then
# Any installation step is a potential source of breakages,
# so we are trying to perform as few download-and-install operations
# as possible.
- "${PIP}" install --upgrade cython
+ "${PYTHON}" -m pip install --upgrade cython
fi
# Allow build_ext to build C/C++ files in parallel
@@ -88,7 +94,7 @@ ${SETARCH_CMD} "${PYTHON}" setup.py bdist_wheel $WHEEL_PLAT_NAME_FLAG
GRPCIO_STRIP_TEMPDIR=$(mktemp -d)
GRPCIO_TAR_GZ_LIST=( dist/grpcio-*.tar.gz )
GRPCIO_TAR_GZ=${GRPCIO_TAR_GZ_LIST[0]}
-GRPCIO_STRIPPED_TAR_GZ=$(mktemp -t "XXXXXXXXXX.tar.gz")
+GRPCIO_STRIPPED_TAR_GZ=$(mktemp -t "TAR_GZ_XXXXXXXXXX")
clean_non_source_files() {
( cd "$1"
@@ -124,35 +130,56 @@ ${SETARCH_CMD} "${PYTHON}" tools/distrib/python/grpcio_tools/setup.py sdist
# shellcheck disable=SC2086
${SETARCH_CMD} "${PYTHON}" tools/distrib/python/grpcio_tools/setup.py bdist_wheel $WHEEL_PLAT_NAME_FLAG
+# run twine check before auditwheel, because auditwheel puts the repaired wheels into
+# the artifacts output dir.
+if [ "$GRPC_SKIP_TWINE_CHECK" == "" ]
+then
+ # Ensure the generated artifacts are valid.
+ # TODO(jtattermusch): avoid the need for always re-installing virtualenv and twine
+ "${PYTHON}" -m pip install virtualenv
+ "${PYTHON}" -m virtualenv venv || { "${PYTHON}" -m pip install virtualenv==16.7.9 && "${PYTHON}" -m virtualenv venv; }
+ venv/bin/python -m pip install "twine<=2.0"
+ venv/bin/python -m twine check dist/* tools/distrib/python/grpcio_tools/dist/*
+ rm -rf venv/
+fi
+
if [ "$GRPC_RUN_AUDITWHEEL_REPAIR" != "" ]
then
for wheel in dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w "$AUDITWHEEL_PLAT"
- "${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR"
+ "${AUDITWHEEL}" repair "$wheel" --strip --wheel-dir "$ARTIFACT_DIR"
rm "$wheel"
done
for wheel in tools/distrib/python/grpcio_tools/dist/*.whl; do
"${AUDITWHEEL}" show "$wheel" | tee /dev/stderr | grep -E -w "$AUDITWHEEL_PLAT"
- "${AUDITWHEEL}" repair "$wheel" -w "$ARTIFACT_DIR"
+ "${AUDITWHEEL}" repair "$wheel" --strip --wheel-dir "$ARTIFACT_DIR"
rm "$wheel"
done
+else
+ cp -r dist/*.whl "$ARTIFACT_DIR"
+ cp -r tools/distrib/python/grpcio_tools/dist/*.whl "$ARTIFACT_DIR"
fi
+# grpcio and grpcio-tools wheels have already been copied to artifact_dir
+# by "auditwheel repair", now copy the .tar.gz source archives as well.
+cp -r dist/*.tar.gz "$ARTIFACT_DIR"
+cp -r tools/distrib/python/grpcio_tools/dist/*.tar.gz "$ARTIFACT_DIR"
+
# We need to use the built grpcio-tools/grpcio to compile the health proto
# Wheels are not supported by setup_requires/dependency_links, so we
# manually install the dependency. Note we should only do this if we
# are in a docker image or in a virtualenv.
if [ "$GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS" != "" ]
then
- "${PIP}" install -rrequirements.txt
+ "${PYTHON}" -m pip install -rrequirements.txt
if [ "$("$PYTHON" -c "import sys; print(sys.version_info[0])")" == "2" ]
then
- "${PIP}" install futures>=2.2.0 enum34>=1.0.4
+ "${PYTHON}" -m pip install futures>=2.2.0 enum34>=1.0.4
fi
- "${PIP}" install grpcio --no-index --find-links "file://$ARTIFACT_DIR/"
- "${PIP}" install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/"
+ "${PYTHON}" -m pip install grpcio --no-index --find-links "file://$ARTIFACT_DIR/"
+ "${PYTHON}" -m pip install grpcio-tools --no-index --find-links "file://$ARTIFACT_DIR/"
# Note(lidiz) setuptools's "sdist" command creates a source tarball, which
# demands an extra step of building the wheel. The building step is merely ran
@@ -191,23 +218,10 @@ then
# Build grpcio_admin source distribution and it needs the cutting-edge version
# of Channelz and CSDS to be installed.
- "${PIP}" install --upgrade xds-protos==0.0.8
- "${PIP}" install grpcio-channelz --no-index --find-links "file://$ARTIFACT_DIR/"
- "${PIP}" install grpcio-csds --no-index --find-links "file://$ARTIFACT_DIR/"
+ "${PYTHON}" -m pip install --upgrade xds-protos==0.0.8
+ "${PYTHON}" -m pip install grpcio-channelz --no-index --find-links "file://$ARTIFACT_DIR/"
+ "${PYTHON}" -m pip install grpcio-csds --no-index --find-links "file://$ARTIFACT_DIR/"
${SETARCH_CMD} "${PYTHON}" src/python/grpcio_admin/setup.py \
sdist bdist_wheel
cp -r src/python/grpcio_admin/dist/* "$ARTIFACT_DIR"
fi
-
-if [ "$GRPC_SKIP_TWINE_CHECK" == "" ]
-then
- # Ensure the generated artifacts are valid.
- "${PYTHON}" -m pip install virtualenv
- "${PYTHON}" -m virtualenv venv || { "${PYTHON}" -m pip install virtualenv==16.7.9 && "${PYTHON}" -m virtualenv venv; }
- venv/bin/python -m pip install "twine<=2.0"
- venv/bin/python -m twine check dist/* tools/distrib/python/grpcio_tools/dist/*
- rm -rf venv/
-fi
-
-cp -r dist/* "$ARTIFACT_DIR"
-cp -r tools/distrib/python/grpcio_tools/dist/* "$ARTIFACT_DIR"
diff --git a/grpc/tools/run_tests/artifacts/build_artifact_ruby.sh b/grpc/tools/run_tests/artifacts/build_artifact_ruby.sh
index b0eecf25..39617375 100755
--- a/grpc/tools/run_tests/artifacts/build_artifact_ruby.sh
+++ b/grpc/tools/run_tests/artifacts/build_artifact_ruby.sh
@@ -14,15 +14,12 @@
# limitations under the License.
set -ex
+# the platform for which we wanna build the native gem
+GEM_PLATFORM="$1"
+
SYSTEM=$(uname | cut -f 1 -d_)
cd "$(dirname "$0")/../../.."
-set +ex
-# shellcheck disable=SC1091
-[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
-# shellcheck disable=SC1090
-[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
-set -ex
if [ "$SYSTEM" == "MSYS" ] ; then
SYSTEM=MINGW32
@@ -36,22 +33,24 @@ if [ "$SYSTEM" == "MINGW32" ] ; then
exit 1
fi
-set +ex
-
-# To workaround the problem with bundler 2.1.0 and rubygems-bundler 1.4.5
-# https://github.com/bundler/bundler/issues/7488
-rvm @global
-gem uninstall rubygems-bundler
+# log ruby version for easier debugging if things go wrong
+# we assume that the current ruby version has already been selected
+# (e.g. by the top-level CI script or with rvm locally)
+ruby --version
-rvm use default
-gem install bundler -v 1.17.3
+# log gem versions for easier debugging if things go wrong
+gem list || true
+# avoid polluting the global gem diretory
+# by configuring "bundle install" to install all the gems
+# into a project-local directory
+export BUNDLE_PATH=bundle_local_gems
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
-set -ex
-
+# set the dockerhub org under which all the gRPC's ruby-compiler-dock docker images
+# are available.
export DOCKERHUB_ORGANIZATION=grpctesting
-rake gem:native
+bundle exec rake "gem:native[${GEM_PLATFORM}]"
if [ "$SYSTEM" == "Darwin" ] ; then
# TODO: consider rewriting this to pass shellcheck
diff --git a/grpc/tools/run_tests/artifacts/build_package_php.sh b/grpc/tools/run_tests/artifacts/build_package_php.sh
index e263e09a..46c3d5b8 100755
--- a/grpc/tools/run_tests/artifacts/build_package_php.sh
+++ b/grpc/tools/run_tests/artifacts/build_package_php.sh
@@ -20,4 +20,4 @@ cd "$(dirname "$0")/../../.."
# All the PHP packages have been built in the artifact phase already
# and we only collect them here to deliver them to the distribtest phase.
mkdir -p artifacts/
-cp -r "${EXTERNAL_GIT_ROOT}"/input_artifacts/php_*/* artifacts/ || true
+cp -r "${EXTERNAL_GIT_ROOT}"/input_artifacts/php_pecl_package_linux_*/* artifacts/ || true
diff --git a/grpc/tools/run_tests/artifacts/build_package_python.sh b/grpc/tools/run_tests/artifacts/build_package_python.sh
index 623eae7a..29801a5b 100755
--- a/grpc/tools/run_tests/artifacts/build_package_python.sh
+++ b/grpc/tools/run_tests/artifacts/build_package_python.sh
@@ -23,26 +23,6 @@ mkdir -p artifacts/
# and we only collect them here to deliver them to the distribtest phase.
cp -r "${EXTERNAL_GIT_ROOT}"/input_artifacts/python_*/* artifacts/ || true
-export PYTHON=${PYTHON:-python}
-
-strip_binary_wheel() {
- WHEEL_PATH="$1"
- TEMP_WHEEL_DIR=$(mktemp -d)
- ${PYTHON} -m wheel unpack "$WHEEL_PATH" -d "$TEMP_WHEEL_DIR"
- find "$TEMP_WHEEL_DIR" -name "_protoc_compiler*.so" -exec strip --strip-debug {} ";"
- find "$TEMP_WHEEL_DIR" -name "cygrpc*.so" -exec strip --strip-debug {} ";"
-
- WHEEL_FILE=$(basename "$WHEEL_PATH")
- DISTRIBUTION_NAME=$(basename "$WHEEL_PATH" | cut -d '-' -f 1)
- VERSION=$(basename "$WHEEL_PATH" | cut -d '-' -f 2)
- ${PYTHON} -m wheel pack "$TEMP_WHEEL_DIR/$DISTRIBUTION_NAME-$VERSION" -d "$TEMP_WHEEL_DIR"
- mv "$TEMP_WHEEL_DIR/$WHEEL_FILE" "$WHEEL_PATH"
-}
-
-for wheel in artifacts/*.whl; do
- strip_binary_wheel "$wheel"
-done
-
# TODO: all the artifact builder configurations generate a grpcio-VERSION.tar.gz
# source distribution package, and only one of them will end up
# in the artifacts/ directory. They should be all equivalent though.
diff --git a/grpc/tools/run_tests/artifacts/build_package_ruby.sh b/grpc/tools/run_tests/artifacts/build_package_ruby.sh
index 14faab4b..6a6a514b 100755
--- a/grpc/tools/run_tests/artifacts/build_package_ruby.sh
+++ b/grpc/tools/run_tests/artifacts/build_package_ruby.sh
@@ -21,16 +21,18 @@ base=$(pwd)
mkdir -p artifacts/
-# All the ruby packages have been built in the artifact phase already
+# All the "grpc" gems have been built in the artifact phase already
# and we only collect them here to deliver them to the distribtest phase.
+# NOTE: Besides the platform-specific native gems, all the artifact build
+# jobs will generate a grpc-X.Y.Z.gem source package, and only one of them
+# will end up in the artifacts/ directory. They should be all equivalent
+# though.
cp -r "${EXTERNAL_GIT_ROOT}"/input_artifacts/ruby_native_gem_*/* artifacts/ || true
+# Next, build the "grpc-tools" gem by collecting the protoc and grpc_ruby_plugin binaries
+# that have been built by the the artifact build phase previously.
well_known_protos=( any api compiler/plugin descriptor duration empty field_mask source_context struct timestamp type wrappers )
-# TODO: all the artifact builder configurations generate a grpc-VERSION.gem
-# source distribution package, and only one of them will end up
-# in the artifacts/ directory. They should be all equivalent though.
-
for arch in {x86,x64}; do
case $arch in
x64)
diff --git a/grpc/tools/run_tests/artifacts/distribtest_targets.py b/grpc/tools/run_tests/artifacts/distribtest_targets.py
index a2c8d6b1..cae8eb38 100644
--- a/grpc/tools/run_tests/artifacts/distribtest_targets.py
+++ b/grpc/tools/run_tests/artifacts/distribtest_targets.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,17 +31,17 @@ def create_docker_jobspec(name,
timeout_seconds=30 * 60):
"""Creates jobspec for a task running under docker."""
environ = environ.copy()
- environ['RUN_COMMAND'] = shell_command
# the entire repo will be cloned if copy_rel_path is not set.
if copy_rel_path:
environ['RELATIVE_COPY_PATH'] = copy_rel_path
docker_args = []
- for k, v in environ.items():
+ for k, v in list(environ.items()):
docker_args += ['-e', '%s=%s' % (k, v)]
docker_env = {
'DOCKERFILE_DIR': dockerfile_dir,
- 'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh'
+ 'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh',
+ 'DOCKER_RUN_SCRIPT_COMMAND': shell_command,
}
jobspec = jobset.JobSpec(
cmdline=['tools/run_tests/dockerize/build_and_run_docker.sh'] +
@@ -85,12 +85,15 @@ class CSharpDistribTest(object):
platform,
arch,
docker_suffix=None,
- use_dotnet_cli=False):
+ use_dotnet_cli=False,
+ presubmit=False):
self.name = 'csharp_%s_%s' % (platform, arch)
self.platform = platform
self.arch = arch
self.docker_suffix = docker_suffix
self.labels = ['distribtest', 'csharp', platform, arch]
+ if presubmit:
+ self.labels.append('presubmit')
self.script_suffix = ''
if docker_suffix:
self.name += '_%s' % docker_suffix
@@ -105,7 +108,8 @@ class CSharpDistribTest(object):
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as there is little opportunity for parallelizing whats inside the distribtests
if self.platform == 'linux':
return create_docker_jobspec(
self.name,
@@ -146,7 +150,12 @@ class CSharpDistribTest(object):
class PythonDistribTest(object):
"""Tests Python package"""
- def __init__(self, platform, arch, docker_suffix, source=False):
+ def __init__(self,
+ platform,
+ arch,
+ docker_suffix,
+ source=False,
+ presubmit=False):
self.source = source
if source:
self.name = 'python_dev_%s_%s_%s' % (platform, arch, docker_suffix)
@@ -156,11 +165,15 @@ class PythonDistribTest(object):
self.arch = arch
self.docker_suffix = docker_suffix
self.labels = ['distribtest', 'python', platform, arch, docker_suffix]
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ # TODO(jtattermusch): honor inner_jobs arg for this task.
+ del inner_jobs
if not self.platform == 'linux':
raise Exception("Not supported yet.")
@@ -191,7 +204,8 @@ class RubyDistribTest(object):
arch,
docker_suffix,
ruby_version=None,
- source=False):
+ source=False,
+ presubmit=False):
self.package_type = 'binary'
if source:
self.package_type = 'source'
@@ -203,11 +217,15 @@ class RubyDistribTest(object):
self.docker_suffix = docker_suffix
self.ruby_version = ruby_version
self.labels = ['distribtest', 'ruby', platform, arch, docker_suffix]
+ if presubmit:
+ self.labels.append('presubmit')
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ # TODO(jtattermusch): honor inner_jobs arg for this task.
+ del inner_jobs
arch_to_gem_arch = {
'x64': 'x86_64',
'x86': 'x86',
@@ -233,19 +251,23 @@ class RubyDistribTest(object):
class PHP7DistribTest(object):
"""Tests PHP7 package"""
- def __init__(self, platform, arch, docker_suffix=None):
+ def __init__(self, platform, arch, docker_suffix=None, presubmit=False):
self.name = 'php7_%s_%s_%s' % (platform, arch, docker_suffix)
self.platform = platform
self.arch = arch
self.docker_suffix = docker_suffix
- self.labels = ['distribtest', 'php7', platform, arch]
+ self.labels = ['distribtest', 'php', 'php7', platform, arch]
+ if presubmit:
+ self.labels.append('presubmit')
if docker_suffix:
self.labels.append(docker_suffix)
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ # TODO(jtattermusch): honor inner_jobs arg for this task.
+ del inner_jobs
if self.platform == 'linux':
return create_docker_jobspec(
self.name,
@@ -269,7 +291,12 @@ class PHP7DistribTest(object):
class CppDistribTest(object):
"""Tests Cpp make install by building examples."""
- def __init__(self, platform, arch, docker_suffix=None, testcase=None):
+ def __init__(self,
+ platform,
+ arch,
+ docker_suffix=None,
+ testcase=None,
+ presubmit=False):
if platform == 'linux':
self.name = 'cpp_%s_%s_%s_%s' % (platform, arch, docker_suffix,
testcase)
@@ -286,13 +313,21 @@ class CppDistribTest(object):
arch,
testcase,
]
+ if presubmit:
+ self.labels.append('presubmit')
if docker_suffix:
self.labels.append(docker_suffix)
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ environ = {}
+ if inner_jobs is not None:
+ # set number of parallel jobs for the C++ build
+ environ['GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS'] = str(
+ inner_jobs)
+
if self.platform == 'linux':
return create_docker_jobspec(
self.name,
@@ -318,67 +353,118 @@ def targets():
"""Gets list of supported targets"""
return [
# C++
- CppDistribTest('linux', 'x64', 'jessie', 'cmake_as_submodule'),
- CppDistribTest('linux', 'x64', 'stretch', 'cmake'),
- CppDistribTest('linux', 'x64', 'stretch', 'cmake_as_externalproject'),
- CppDistribTest('linux', 'x64', 'stretch', 'cmake_fetchcontent'),
- CppDistribTest('linux', 'x64', 'stretch', 'cmake_module_install'),
- CppDistribTest('linux', 'x64', 'stretch',
- 'cmake_module_install_pkgconfig'),
- CppDistribTest('linux', 'x64', 'stretch', 'cmake_pkgconfig'),
- CppDistribTest('linux', 'x64', 'stretch_aarch64_cross',
- 'cmake_aarch64_cross'),
- CppDistribTest('windows', 'x86', testcase='cmake'),
- CppDistribTest('windows', 'x86', testcase='cmake_as_externalproject'),
+ CppDistribTest('linux', 'x64', 'stretch', 'cmake', presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_as_submodule',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_as_externalproject',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_fetchcontent',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_module_install',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_module_install_pkgconfig',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch',
+ 'cmake_pkgconfig',
+ presubmit=True),
+ CppDistribTest('linux',
+ 'x64',
+ 'stretch_aarch64_cross',
+ 'cmake_aarch64_cross',
+ presubmit=True),
+ CppDistribTest('windows', 'x86', testcase='cmake', presubmit=True),
+ CppDistribTest('windows',
+ 'x86',
+ testcase='cmake_as_externalproject',
+ presubmit=True),
# C#
- CSharpDistribTest('linux', 'x64', 'jessie'),
- CSharpDistribTest('linux', 'x64', 'stretch'),
- CSharpDistribTest('linux', 'x64', 'stretch', use_dotnet_cli=True),
+ CSharpDistribTest('linux', 'x64', 'stretch', presubmit=True),
+ CSharpDistribTest('linux',
+ 'x64',
+ 'stretch',
+ use_dotnet_cli=True,
+ presubmit=True),
CSharpDistribTest('linux', 'x64', 'centos7'),
CSharpDistribTest('linux', 'x64', 'ubuntu1604'),
CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True),
- CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True),
- CSharpDistribTest('linux', 'x64', 'dotnet31', use_dotnet_cli=True),
- CSharpDistribTest('linux', 'x64', 'dotnet5', use_dotnet_cli=True),
- CSharpDistribTest('macos', 'x64'),
- CSharpDistribTest('windows', 'x86'),
- CSharpDistribTest('windows', 'x64'),
+ CSharpDistribTest('linux',
+ 'x64',
+ 'alpine',
+ use_dotnet_cli=True,
+ presubmit=True),
+ CSharpDistribTest('linux',
+ 'x64',
+ 'dotnet31',
+ use_dotnet_cli=True,
+ presubmit=True),
+ CSharpDistribTest('linux',
+ 'x64',
+ 'dotnet5',
+ use_dotnet_cli=True,
+ presubmit=True),
+ CSharpDistribTest('macos', 'x64', presubmit=True),
+ CSharpDistribTest('windows', 'x86', presubmit=True),
+ CSharpDistribTest('windows', 'x64', presubmit=True),
# Python
- PythonDistribTest('linux', 'x64', 'jessie'),
- PythonDistribTest('linux', 'x86', 'jessie'),
- PythonDistribTest('linux', 'x64', 'centos6'),
+ PythonDistribTest('linux', 'x64', 'buster', presubmit=True),
+ PythonDistribTest('linux', 'x86', 'buster', presubmit=True),
PythonDistribTest('linux', 'x64', 'centos7'),
- PythonDistribTest('linux', 'x64', 'fedora23'),
+ PythonDistribTest('linux', 'x64', 'fedora34'),
PythonDistribTest('linux', 'x64', 'opensuse'),
PythonDistribTest('linux', 'x64', 'arch'),
- PythonDistribTest('linux', 'x64', 'ubuntu1604'),
+ PythonDistribTest('linux', 'x64', 'alpine'),
PythonDistribTest('linux', 'x64', 'ubuntu1804'),
- PythonDistribTest('linux', 'aarch64', 'python38_buster'),
- PythonDistribTest('linux', 'x64', 'alpine3.7', source=True),
- PythonDistribTest('linux', 'x64', 'jessie', source=True),
- PythonDistribTest('linux', 'x86', 'jessie', source=True),
+ PythonDistribTest('linux', 'aarch64', 'python38_buster',
+ presubmit=True),
+ PythonDistribTest('linux',
+ 'x64',
+ 'alpine3.7',
+ source=True,
+ presubmit=True),
+ PythonDistribTest('linux', 'x64', 'buster', source=True,
+ presubmit=True),
+ PythonDistribTest('linux', 'x86', 'buster', source=True,
+ presubmit=True),
PythonDistribTest('linux', 'x64', 'centos7', source=True),
- PythonDistribTest('linux', 'x64', 'fedora23', source=True),
+ PythonDistribTest('linux', 'x64', 'fedora34', source=True),
PythonDistribTest('linux', 'x64', 'arch', source=True),
- PythonDistribTest('linux', 'x64', 'ubuntu1604', source=True),
PythonDistribTest('linux', 'x64', 'ubuntu1804', source=True),
# Ruby
- RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_4'),
- RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_5'),
- RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_6'),
- RubyDistribTest('linux', 'x64', 'jessie', ruby_version='ruby_2_7'),
+ RubyDistribTest('linux', 'x64', 'stretch', ruby_version='ruby_2_5'),
+ RubyDistribTest('linux', 'x64', 'stretch', ruby_version='ruby_2_6'),
+ RubyDistribTest('linux',
+ 'x64',
+ 'stretch',
+ ruby_version='ruby_2_7',
+ presubmit=True),
# TODO(apolcyn): add a ruby 3.0 test once protobuf adds support
RubyDistribTest('linux',
'x64',
- 'jessie',
- ruby_version='ruby_2_4',
- source=True),
+ 'stretch',
+ ruby_version='ruby_2_5',
+ source=True,
+ presubmit=True),
RubyDistribTest('linux', 'x64', 'centos7'),
- RubyDistribTest('linux', 'x64', 'fedora23'),
- RubyDistribTest('linux', 'x64', 'opensuse'),
RubyDistribTest('linux', 'x64', 'ubuntu1604'),
- RubyDistribTest('linux', 'x64', 'ubuntu1804'),
+ RubyDistribTest('linux', 'x64', 'ubuntu1804', presubmit=True),
# PHP7
- PHP7DistribTest('linux', 'x64', 'stretch'),
- PHP7DistribTest('macos', 'x64'),
+ PHP7DistribTest('linux', 'x64', 'stretch', presubmit=True),
+ PHP7DistribTest('macos', 'x64', presubmit=True),
]
diff --git a/grpc/tools/run_tests/artifacts/package_targets.py b/grpc/tools/run_tests/artifacts/package_targets.py
index 7123d180..6dfd24b2 100644
--- a/grpc/tools/run_tests/artifacts/package_targets.py
+++ b/grpc/tools/run_tests/artifacts/package_targets.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,14 +29,14 @@ def create_docker_jobspec(name,
timeout_retries=0):
"""Creates jobspec for a task running under docker."""
environ = environ.copy()
- environ['RUN_COMMAND'] = shell_command
docker_args = []
- for k, v in environ.items():
+ for k, v in list(environ.items()):
docker_args += ['-e', '%s=%s' % (k, v)]
docker_env = {
'DOCKERFILE_DIR': dockerfile_dir,
'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh',
+ 'DOCKER_RUN_SCRIPT_COMMAND': shell_command,
'OUTPUT_DIR': 'artifacts'
}
jobspec = jobset.JobSpec(
@@ -74,28 +74,41 @@ def create_jobspec(name,
class CSharpPackage:
"""Builds C# packages."""
- def __init__(self, unity=False):
+ def __init__(self, platform, unity=False):
+ self.platform = platform
self.unity = unity
- self.labels = ['package', 'csharp', 'linux']
+ self.labels = ['package', 'csharp', self.platform]
if unity:
- self.name = 'csharp_package_unity_linux'
+ self.name = 'csharp_package_unity_%s' % self.platform
self.labels += ['unity']
else:
- self.name = 'csharp_package_nuget_linux'
+ self.name = 'csharp_package_nuget_%s' % self.platform
self.labels += ['nuget']
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
- if self.unity:
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as there is little opportunity for parallelizing
+ environ = {
+ 'GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET':
+ os.getenv('GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET', '')
+ }
+
+ build_script = 'src/csharp/build_unitypackage.sh' if self.unity else 'src/csharp/build_nuget.sh'
+
+ if self.platform == 'linux':
return create_docker_jobspec(
- self.name, 'tools/dockerfile/test/csharp_stretch_x64',
- 'src/csharp/build_unitypackage.sh')
+ self.name,
+ 'tools/dockerfile/test/csharp_debian11_x64',
+ build_script,
+ environ=environ)
else:
- return create_docker_jobspec(
- self.name, 'tools/dockerfile/test/csharp_stretch_x64',
- 'src/csharp/build_nuget.sh')
+ repo_root = os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ '..', '..', '..')
+ environ['EXTERNAL_GIT_ROOT'] = repo_root
+ return create_jobspec(self.name, ['bash', build_script],
+ environ=environ)
def __str__(self):
return self.name
@@ -111,7 +124,8 @@ class RubyPackage:
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as this step simply collects preexisting artifacts
return create_docker_jobspec(
self.name, 'tools/dockerfile/grpc_artifact_centos6_x64',
'tools/run_tests/artifacts/build_package_ruby.sh')
@@ -127,7 +141,8 @@ class PythonPackage:
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as this step simply collects preexisting artifacts
# since the python package build does very little, we can use virtually
# any image that has new-enough python, so reusing one of the images used
# for artifact building seems natural.
@@ -148,7 +163,8 @@ class PHPPackage:
def pre_build_jobspecs(self):
return []
- def build_jobspec(self):
+ def build_jobspec(self, inner_jobs=None):
+ del inner_jobs # arg unused as this step simply collects preexisting artifacts
return create_docker_jobspec(
self.name, 'tools/dockerfile/grpc_artifact_centos6_x64',
'tools/run_tests/artifacts/build_package_php.sh')
@@ -157,8 +173,10 @@ class PHPPackage:
def targets():
"""Gets list of supported targets"""
return [
- CSharpPackage(),
- CSharpPackage(unity=True),
+ CSharpPackage('linux'),
+ CSharpPackage('linux', unity=True),
+ CSharpPackage('macos'),
+ CSharpPackage('windows'),
RubyPackage(),
PythonPackage(),
PHPPackage()
diff --git a/grpc/tools/run_tests/dockerize/build_and_run_docker.sh b/grpc/tools/run_tests/dockerize/build_and_run_docker.sh
index 3f129ce0..50d3b8fd 100755
--- a/grpc/tools/run_tests/dockerize/build_and_run_docker.sh
+++ b/grpc/tools/run_tests/dockerize/build_and_run_docker.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2016 gRPC authors.
+# Copyright 2016 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.
@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# Builds docker image and runs a command under it.
-# You should never need to call this script on your own.
+# This script is invoked by run_tests.py to accommodate "test under docker"
+# scenario. You should never need to call this script on your own.
# shellcheck disable=SC2103
@@ -27,9 +27,9 @@ cd -
# Inputs
# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
# DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root)
-# OUTPUT_DIR - Directory that will be copied from inside docker after finishing.
+# OUTPUT_DIR - Directory (relatively to git repo root) that will be copied from inside docker container after finishing.
# DOCKERHUB_ORGANIZATION - If set, pull a prebuilt image from given dockerhub org.
-# $@ - Extra args to pass to docker run
+# $@ - Extra args to pass to the "docker run" command.
# Use image name based on Dockerfile location checksum
DOCKER_IMAGE_NAME=$(basename "$DOCKERFILE_DIR"):$(sha1sum "$DOCKERFILE_DIR/Dockerfile" | cut -f1 -d\ )
@@ -43,47 +43,61 @@ else
docker build -t "$DOCKER_IMAGE_NAME" "$DOCKERFILE_DIR"
fi
-# Choose random name for docker container
-CONTAINER_NAME="build_and_run_docker_$(uuidgen)"
+if [[ -t 0 ]]; then
+ DOCKER_TTY_ARGS="-it"
+else
+ # The input device on kokoro is not a TTY, so -it does not work.
+ DOCKER_TTY_ARGS=
+fi
+
+# Git root as seen by the docker instance
+# TODO(jtattermusch): rename to a more descriptive directory name
+# currently that's nontrivial because the name is hardcoded in many places.
+EXTERNAL_GIT_ROOT=/var/local/jenkins/grpc
+
+# temporary directory that will be mounted to the docker container
+# as a way to persist output files.
+# use unique name for the output directory to prevent clash between concurrent
+# runs of multiple docker containers
+TEMP_REPORT_DIR="$(mktemp -d)"
+TEMP_OUTPUT_DIR="$(mktemp -d)"
-# Run command inside docker
-# TODO: use a proper array instead of $EXTRA_DOCKER_ARGS
-# shellcheck disable=SC2086
+# Run tests inside docker
+DOCKER_EXIT_CODE=0
+# TODO: silence complaint about $DOCKER_TTY_ARGS expansion in some other way
+# shellcheck disable=SC2086,SC2154
docker run \
"$@" \
+ ${DOCKER_TTY_ARGS} \
+ ${EXTRA_DOCKER_ARGS} \
--cap-add SYS_PTRACE \
- -e EXTERNAL_GIT_ROOT="/var/local/jenkins/grpc" \
- -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \
- -e "KOKORO_BUILD_ID=$KOKORO_BUILD_ID" \
- -e "KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER" \
- -e "KOKORO_BUILD_URL=$KOKORO_BUILD_URL" \
- -e "KOKORO_JOB_NAME=$KOKORO_JOB_NAME" \
- -e "KOKORO_ARTIFACTS_DIR=$KOKORO_ARTIFACTS_DIR" \
- -e "GIT_ORIGIN_URL=$(git -C $git_root remote get-url origin)" \
- -e "GIT_COMMIT_SHORT=$(git -C $git_root rev-parse --short HEAD)" \
- -e "TESTGRID_EXCLUDE=$TESTGRID_EXCLUDE" \
- -v "$git_root:/var/local/jenkins/grpc:ro" \
- -v "$KOKORO_ARTIFACTS_DIR:$KOKORO_ARTIFACTS_DIR" \
- -w /var/local/git/grpc \
- --name="$CONTAINER_NAME" \
- $EXTRA_DOCKER_ARGS \
- "$DOCKER_IMAGE_NAME" \
- /bin/bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || FAILED="true"
+ -e "DOCKER_RUN_SCRIPT_COMMAND=${DOCKER_RUN_SCRIPT_COMMAND}" \
+ -e "EXTERNAL_GIT_ROOT=${EXTERNAL_GIT_ROOT}" \
+ -e "OUTPUT_DIR=${OUTPUT_DIR}" \
+ --env-file tools/run_tests/dockerize/docker_propagate_env.list \
+ --rm \
+ --sysctl net.ipv6.conf.all.disable_ipv6=0 \
+ -v "${git_root}:${EXTERNAL_GIT_ROOT}" \
+ -v "${TEMP_REPORT_DIR}:/var/local/report_dir" \
+ -v "${TEMP_OUTPUT_DIR}:/var/local/output_dir" \
+ "${DOCKER_IMAGE_NAME}" \
+ bash -l "/var/local/jenkins/grpc/${DOCKER_RUN_SCRIPT}" || DOCKER_EXIT_CODE=$?
-# Copy output artifacts
-if [ "$OUTPUT_DIR" != "" ]
+# Copy reports stored by the container (if any)
+if [ "${GRPC_TEST_REPORT_BASE_DIR}" != "" ]
then
- # Create the artifact directory in advance to avoid a race in "docker cp" if tasks
- # that were running in parallel finish at the same time.
- # see https://github.com/grpc/grpc/issues/16155
- mkdir -p "$git_root/$OUTPUT_DIR"
- docker cp "$CONTAINER_NAME:/var/local/git/grpc/$OUTPUT_DIR" "$git_root" || FAILED="true"
+ mkdir -p "${GRPC_TEST_REPORT_BASE_DIR}"
+ cp -r "${TEMP_REPORT_DIR}"/* "${GRPC_TEST_REPORT_BASE_DIR}" || true
+else
+ cp -r "${TEMP_REPORT_DIR}"/* "${git_root}" || true
fi
-# remove the container, possibly killing it first
-docker rm -f "$CONTAINER_NAME" || true
-
-if [ "$FAILED" != "" ]
+# Copy contents of OUTPUT_DIR back under the git repo root
+if [ "${OUTPUT_DIR}" != "" ]
then
- exit 1
+ # create the directory if it doesn't exist yet.
+ mkdir -p "${TEMP_OUTPUT_DIR}/${OUTPUT_DIR}"
+ cp -r "${TEMP_OUTPUT_DIR}/${OUTPUT_DIR}" "${git_root}" || DOCKER_EXIT_CODE=$?
fi
+
+exit $DOCKER_EXIT_CODE
diff --git a/grpc/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/grpc/tools/run_tests/dockerize/build_docker_and_run_tests.sh
deleted file mode 100755
index 4a7908b0..00000000
--- a/grpc/tools/run_tests/dockerize/build_docker_and_run_tests.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-# 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.
-#
-# This script is invoked by run_tests.py to accommodate "test under docker"
-# scenario. You should never need to call this script on your own.
-
-# shellcheck disable=SC2103
-
-set -ex
-
-cd "$(dirname "$0")/../../.."
-git_root=$(pwd)
-cd -
-
-# Inputs
-# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
-# DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root)
-# DOCKERHUB_ORGANIZATION - If set, pull a prebuilt image from given dockerhub org.
-
-# Use image name based on Dockerfile location checksum
-DOCKER_IMAGE_NAME=$(basename "$DOCKERFILE_DIR"):$(sha1sum "$DOCKERFILE_DIR/Dockerfile" | cut -f1 -d\ )
-
-if [ "$DOCKERHUB_ORGANIZATION" != "" ]
-then
- DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME
- time docker pull "$DOCKER_IMAGE_NAME"
-else
- # Make sure docker image has been built. Should be instantaneous if so.
- docker build -t "$DOCKER_IMAGE_NAME" "$DOCKERFILE_DIR"
-fi
-
-# Choose random name for docker container
-CONTAINER_NAME="run_tests_$(uuidgen)"
-
-# Git root as seen by the docker instance
-docker_instance_git_root=/var/local/jenkins/grpc
-
-# Run tests inside docker
-DOCKER_EXIT_CODE=0
-# TODO: silence complaint about $TTY_FLAG expansion in some other way
-# shellcheck disable=SC2086,SC2154
-docker run \
- --cap-add SYS_PTRACE \
- -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \
- -e "config=$config" \
- -e "arch=$arch" \
- -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \
- -e HOST_GIT_ROOT="$git_root" \
- -e LOCAL_GIT_ROOT=$docker_instance_git_root \
- -e "BUILD_ID=$BUILD_ID" \
- -e "BUILD_URL=$BUILD_URL" \
- -e "JOB_BASE_NAME=$JOB_BASE_NAME" \
- -e "KOKORO_BUILD_ID=$KOKORO_BUILD_ID" \
- -e "KOKORO_BUILD_NUMBER=$KOKORO_BUILD_NUMBER" \
- -e "KOKORO_BUILD_URL=$KOKORO_BUILD_URL" \
- -e "KOKORO_JOB_NAME=$KOKORO_JOB_NAME" \
- -i \
- $TTY_FLAG \
- --sysctl net.ipv6.conf.all.disable_ipv6=0 \
- -v ~/.config/gcloud:/root/.config/gcloud \
- -v "$git_root:$docker_instance_git_root" \
- -v /tmp/npm-cache:/tmp/npm-cache \
- -w /var/local/git/grpc \
- --name="$CONTAINER_NAME" \
- "$DOCKER_IMAGE_NAME" \
- bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_EXIT_CODE=$?
-
-# use unique name for reports.zip to prevent clash between concurrent
-# run_tests.py runs
-TEMP_REPORTS_ZIP=$(mktemp)
-docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" "${TEMP_REPORTS_ZIP}" || true
-unzip -o "${TEMP_REPORTS_ZIP}" -d "$git_root" || true
-rm -f "${TEMP_REPORTS_ZIP}"
-
-# remove the container, possibly killing it first
-docker rm -f "$CONTAINER_NAME" || true
-
-exit $DOCKER_EXIT_CODE
diff --git a/grpc/tools/run_tests/dockerize/build_interop_image.sh b/grpc/tools/run_tests/dockerize/build_interop_image.sh
index 5b5bfb65..f2bacae0 100755
--- a/grpc/tools/run_tests/dockerize/build_interop_image.sh
+++ b/grpc/tools/run_tests/dockerize/build_interop_image.sh
@@ -21,7 +21,6 @@ set -ex
# Params:
# INTEROP_IMAGE - name of tag of the final interop image
# BASE_NAME - base name used to locate the base Dockerfile and build script
-# TTY_FLAG - optional -t flag to make docker allocate tty
# BUILD_INTEROP_DOCKER_EXTRA_ARGS - optional args to be passed to the
# docker run command
# GRPC_ROOT - grpc base directory, default to top of this tree.
@@ -98,20 +97,24 @@ else
docker build -t "$BASE_IMAGE" --force-rm=true "tools/dockerfile/interoptest/$BASE_NAME" || exit $?
fi
+if [[ -t 0 ]]; then
+ DOCKER_TTY_ARGS="-it"
+else
+ # The input device on kokoro is not a TTY, so -it does not work.
+ DOCKER_TTY_ARGS=
+fi
+
CONTAINER_NAME="build_${BASE_NAME}_$(uuidgen)"
# Prepare image for interop tests, commit it on success.
# TODO: Figure out if is safe to eliminate the suppression. It's currently here
# because $MOUNT_ARGS and $BUILD_INTEROP_DOCKER_EXTRA_ARGS can have legitimate
# spaces, but the "correct" way to do this is to utilize proper arrays.
-# Same for $TTY_FLAG
# shellcheck disable=SC2086
(docker run \
--cap-add SYS_PTRACE \
- -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \
- -e THIS_IS_REALLY_NEEDED_ONCE_AGAIN='For issue 4835. See https://github.com/docker/docker/issues/14203 for why docker is awful' \
- -i \
- $TTY_FLAG \
+ --env-file "tools/run_tests/dockerize/docker_propagate_env.list" \
+ $DOCKER_TTY_ARGS \
$MOUNT_ARGS \
$BUILD_INTEROP_DOCKER_EXTRA_ARGS \
--name="$CONTAINER_NAME" \
diff --git a/grpc/tools/run_tests/dockerize/docker_propagate_env.list b/grpc/tools/run_tests/dockerize/docker_propagate_env.list
new file mode 100644
index 00000000..5ea24a2b
--- /dev/null
+++ b/grpc/tools/run_tests/dockerize/docker_propagate_env.list
@@ -0,0 +1,21 @@
+# Pass this file to "docker run" using --env-file argument.
+# Variables listed in this file will be set or propagated
+# to the docker container.
+
+# TODO(jtattermusch): revisit whether this very old hack is still needed.
+THIS_IS_REALLY_NEEDED="see https://github.com/docker/docker/issues/14203 for why docker is awful"
+
+# Kokoro sets environment variables for each build and we want them to be
+# available inside the test docker containers.
+KOKORO_BUILD_ID
+KOKORO_BUILD_INITIATOR
+KOKORO_BUILD_NUMBER
+KOKORO_BUILD_URL
+KOKORO_GIT_COMMIT
+KOKORO_JOB_NAME
+KOKORO_GITHUB_PULL_REQUEST_NUMBER
+KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH
+
+# Propagate ccache configuration to the docker containers.
+GRPC_BUILD_ENABLE_CCACHE
+CCACHE_SECONDARY_STORAGE
diff --git a/grpc/tools/run_tests/dockerize/docker_run.sh b/grpc/tools/run_tests/dockerize/docker_run.sh
index e525019c..aa77a911 100755
--- a/grpc/tools/run_tests/dockerize/docker_run.sh
+++ b/grpc/tools/run_tests/dockerize/docker_run.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2016 gRPC authors.
+# Copyright 2016 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.
@@ -13,32 +13,54 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# This script is invoked by build_docker_* inside a docker
+# This script is invoked by build_and_run_docker.sh inside a docker
# container. You should never need to call this script on your own.
-set -ex
+set -e
-if [ "$RELATIVE_COPY_PATH" == "" ]
+if [ "${RELATIVE_COPY_PATH}" == "" ]
then
mkdir -p /var/local/git
- git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc
+ git clone "${EXTERNAL_GIT_ROOT}" /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
# TODO: figure out a way to eliminate this following shellcheck suppressions
# shellcheck disable=SC2016,SC1004
(cd "${EXTERNAL_GIT_ROOT}" && git submodule foreach 'git clone ${EXTERNAL_GIT_ROOT}/${name} /var/local/git/grpc/${name}')
(cd /var/local/git/grpc && git submodule init)
else
- mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
- cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
+ mkdir -p "/var/local/git/grpc/${RELATIVE_COPY_PATH}"
+ cp -r "${EXTERNAL_GIT_ROOT}/${RELATIVE_COPY_PATH}"/* "/var/local/git/grpc/${RELATIVE_COPY_PATH}"
fi
-$POST_GIT_STEP
+cd /var/local/git/grpc
+
+# ensure the "reports" directory exists
+mkdir -p reports
+
+exit_code=0
+${DOCKER_RUN_SCRIPT_COMMAND} || exit_code=$?
+
+# copy reports/ dir and files matching one of the patterns to the well-known
+# location of report dir mounted to the docker container.
+# --parents preserves the directory structure for files matched by find.
+cp -r reports/ /var/local/report_dir
+find . -name report.xml -exec cp --parents {} /var/local/report_dir \;
+find . -name sponge_log.xml -exec cp --parents {} /var/local/report_dir \;
+find . -name 'report_*.xml' -exec cp --parents {} /var/local/report_dir \;
+chmod -R ugo+r /var/local/report_dir || true
-if [ -x "$(command -v rvm)" ]
+# Move contents of OUTPUT_DIR from under the workspace to a directory that will be visible to the docker host.
+if [ "${OUTPUT_DIR}" != "" ]
then
- rvm use ruby-2.1
+ # create the directory if it doesn't exist yet.
+ mkdir -p "${OUTPUT_DIR}"
+ mv "${OUTPUT_DIR}" /var/local/output_dir || exit_code=$?
+ chmod -R ugo+r /var/local/output_dir || true
fi
-cd /var/local/git/grpc
+if [ -x "$(command -v ccache)" ]
+then
+ ccache --show-stats || true
+fi
-$RUN_COMMAND
+exit $exit_code
diff --git a/grpc/tools/run_tests/dockerize/docker_run_tests.sh b/grpc/tools/run_tests/dockerize/docker_run_tests.sh
deleted file mode 100755
index 2a3b6f53..00000000
--- a/grpc/tools/run_tests/dockerize/docker_run_tests.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-# 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.
-#
-# This script is invoked by build_docker_and_run_tests.sh inside a docker
-# container. You should never need to call this script on your own.
-
-set -e
-
-export CONFIG=${config:-opt}
-export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
-export PATH=$PATH:/usr/bin/llvm-symbolizer
-
-mkdir -p /var/local/git
-git clone /var/local/jenkins/grpc /var/local/git/grpc
-# clone gRPC submodules, use data from locally cloned submodules where possible
-# TODO: figure out a way to eliminate this shellcheck suppression:
-# shellcheck disable=SC2016
-(cd /var/local/jenkins/grpc/ && git submodule foreach 'git clone /var/local/jenkins/grpc/${name} /var/local/git/grpc/${name}')
-(cd /var/local/git/grpc/ && git submodule init)
-
-mkdir -p reports
-
-$POST_GIT_STEP
-
-exit_code=0
-
-$RUN_TESTS_COMMAND || exit_code=$?
-
-# The easiest way to copy all the reports files from inside of
-# the docker container is to zip them and then copy the zip.
-zip -r reports.zip reports
-find . -name report.xml -print0 | xargs -0 -r zip reports.zip
-find . -name sponge_log.xml -print0 | xargs -0 -r zip reports.zip
-find . -name 'report_*.xml' -print0 | xargs -0 -r zip reports.zip
-
-exit $exit_code
diff --git a/grpc/tools/run_tests/helper_scripts/build_csharp.bat b/grpc/tools/run_tests/helper_scripts/build_csharp.bat
index 7721d80f..12c6270a 100644
--- a/grpc/tools/run_tests/helper_scripts/build_csharp.bat
+++ b/grpc/tools/run_tests/helper_scripts/build_csharp.bat
@@ -14,7 +14,31 @@
setlocal
-cd /d %~dp0\..\..\..\src\csharp
+cd /d %~dp0\..\..\..
+
+mkdir cmake
+cd cmake
+mkdir build
+cd build
+
+@rem use setlocal/endlocal to prevent the C++ build env variables from polluting the environment for "dotnet build"
+setlocal
+
+@rem set cl.exe build environment to build with VS2015 tooling
+@rem this is required for Ninja build to work
+call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %ARCHITECTURE%
+@rem restore command echo
+echo on
+
+@rem Select MSVC compiler (cl.exe) explicitly to make sure we don't end up gcc from mingw or cygwin
+@rem (both are on path in kokoro win workers)
+cmake -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=%MSBUILD_CONFIG% -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON -DgRPC_XDS_USER_AGENT_IS_CSHARP=ON ../.. || goto :error
+
+ninja -j%GRPC_RUN_TESTS_JOBS% grpc_csharp_ext || goto :error
+
+endlocal
+
+cd ..\..\src\csharp
dotnet build --configuration %MSBUILD_CONFIG% Grpc.sln || goto :error
diff --git a/grpc/tools/run_tests/helper_scripts/build_csharp.sh b/grpc/tools/run_tests/helper_scripts/build_csharp.sh
index c6bee82b..56e6c533 100755
--- a/grpc/tools/run_tests/helper_scripts/build_csharp.sh
+++ b/grpc/tools/run_tests/helper_scripts/build_csharp.sh
@@ -15,12 +15,15 @@
set -ex
-cd "$(dirname "$0")/../../../src/csharp"
+cd "$(dirname "$0")/../../.."
-if [ "$CONFIG" == "gcov" ]
-then
- # overriding NativeDependenciesConfigurationUnix makes C# project pick up the gcov flavor of grpc_csharp_ext
- dotnet build --configuration "$MSBUILD_CONFIG" /p:NativeDependenciesConfigurationUnix=gcov Grpc.sln
-else
- dotnet build --configuration "$MSBUILD_CONFIG" Grpc.sln
-fi
+mkdir -p cmake/build
+pushd cmake/build
+
+cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" -DgRPC_XDS_USER_AGENT_IS_CSHARP=ON ../..
+make -j"${GRPC_RUN_TESTS_JOBS}" grpc_csharp_ext
+
+popd
+pushd src/csharp
+
+dotnet build --configuration "$MSBUILD_CONFIG" Grpc.sln
diff --git a/grpc/tools/run_tests/helper_scripts/build_cxx.bat b/grpc/tools/run_tests/helper_scripts/build_cxx.bat
new file mode 100644
index 00000000..e6e727a7
--- /dev/null
+++ b/grpc/tools/run_tests/helper_scripts/build_cxx.bat
@@ -0,0 +1,68 @@
+@rem Copyright 2022 The gRPC Authors
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem http://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+
+setlocal
+
+cd /d %~dp0\..\..\..
+
+mkdir cmake
+cd cmake
+mkdir build
+cd build
+
+If "%GRPC_BUILD_ACTIVATE_VS_TOOLS%" == "2015" (
+ @rem set cl.exe build environment to build with VS2015 tooling
+ @rem this is required for Ninja build to work
+ call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" %GRPC_BUILD_VS_TOOLS_ARCHITECTURE%
+ @rem restore command echo
+ echo on
+)
+
+@rem Workaround a bug where VS150COMNTOOLS is not set due to a bug in VS 2017 installer
+@rem see https://developercommunity.visualstudio.com/t/installing-visualstudio-build-tools-doesnt-add-env/17435
+set "VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
+
+If "%GRPC_BUILD_ACTIVATE_VS_TOOLS%" == "2017" (
+ @rem set cl.exe build environment to build with VS2017 tooling
+ @rem this is required for Ninja build to work
+ call "%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %GRPC_BUILD_VS_TOOLS_ARCHITECTURE%
+ @rem restore command echo
+ echo on
+)
+
+If "%GRPC_CMAKE_GENERATOR%" == "Ninja" (
+ @rem Use ninja
+
+ @rem Select MSVC compiler (cl.exe) explicitly to make sure we don't end up gcc from mingw or cygwin
+ @rem (both are on path in kokoro win workers)
+ cmake -G "%GRPC_CMAKE_GENERATOR%" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="%MSBUILD_CONFIG%" %* ../.. || goto :error
+
+ ninja -j%GRPC_RUN_TESTS_JOBS% buildtests_%GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX% || goto :error
+
+) else (
+ @rem Use one of the Visual Studio generators.
+
+ cmake -G "%GRPC_CMAKE_GENERATOR%" -A "%GRPC_CMAKE_ARCHITECTURE%" -DgRPC_BUILD_TESTS=ON -DgRPC_BUILD_MSVC_MP_COUNT=%GRPC_RUN_TESTS_JOBS% %* ../.. || goto :error
+
+ @rem GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX will be set to either "c" or "cxx"
+ cmake --build . --target buildtests_%GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX% --config %MSBUILD_CONFIG% || goto :error
+)
+
+endlocal
+
+goto :EOF
+
+:error
+echo Failed!
+exit /b %errorlevel%
diff --git a/grpc/tools/run_tests/helper_scripts/build_cxx.sh b/grpc/tools/run_tests/helper_scripts/build_cxx.sh
new file mode 100755
index 00000000..310da2e9
--- /dev/null
+++ b/grpc/tools/run_tests/helper_scripts/build_cxx.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright 2022 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.
+
+set -ex
+
+cd "$(dirname "$0")/../../.."
+
+mkdir -p cmake/build
+cd cmake/build
+
+# MSBUILD_CONFIG's values are suitable for cmake as well
+cmake -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" "$@" ../..
+
+# GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX will be set to either "c" or "cxx"
+make -j"${GRPC_RUN_TESTS_JOBS}" "buildtests_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}" "tools_${GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX}"
diff --git a/grpc/tools/run_tests/helper_scripts/build_php.sh b/grpc/tools/run_tests/helper_scripts/build_php.sh
index 4add0366..782a6c16 100755
--- a/grpc/tools/run_tests/helper_scripts/build_php.sh
+++ b/grpc/tools/run_tests/helper_scripts/build_php.sh
@@ -20,7 +20,10 @@ CONFIG=${CONFIG:-opt}
# change to grpc repo root
cd "$(dirname "$0")/../../.."
-root=$(pwd)
+# build C core first
+make -j"${GRPC_RUN_TESTS_JOBS}" EMBED_OPENSSL=true EMBED_ZLIB=true static_c shared_c
+
+repo_root="$(pwd)"
export GRPC_LIB_SUBDIR=libs/$CONFIG
export CFLAGS="-Wno-parentheses-equality"
@@ -30,8 +33,8 @@ cd src/php
cd ext/grpc
phpize
if [ "$CONFIG" != "gcov" ] ; then
- ./configure --enable-grpc="$root" --enable-tests
+ ./configure --enable-grpc="${repo_root}" --enable-tests
else
- ./configure --enable-grpc="$root" --enable-coverage --enable-tests
+ ./configure --enable-grpc="${repo_root}" --enable-coverage --enable-tests
fi
-make
+make -j"${GRPC_RUN_TESTS_JOBS}"
diff --git a/grpc/tools/run_tests/helper_scripts/build_python.sh b/grpc/tools/run_tests/helper_scripts/build_python.sh
index 7b928d14..b45a5074 100755
--- a/grpc/tools/run_tests/helper_scripts/build_python.sh
+++ b/grpc/tools/run_tests/helper_scripts/build_python.sh
@@ -125,17 +125,9 @@ export LANG=en_US.UTF-8
DEFAULT_PARALLEL_JOBS=$(nproc) || DEFAULT_PARALLEL_JOBS=4
export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=${GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS:-$DEFAULT_PARALLEL_JOBS}
-# If ccache is available on Linux, use it.
-if [ "$(is_linux)" ]; then
- # We're not on Darwin (Mac OS X)
- if [ -x "$(command -v ccache)" ]; then
- if [ -x "$(command -v gcc)" ]; then
- export CC='ccache gcc'
- elif [ -x "$(command -v clang)" ]; then
- export CC='ccache clang'
- fi
- fi
-fi
+# activate ccache if desired
+# shellcheck disable=SC1091
+source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc
############################
# Perform build operations #
@@ -150,10 +142,21 @@ else
VENV_PYTHON=$(script_realpath "$VENV/$VENV_RELATIVE_PYTHON")
fi
-# See https://github.com/grpc/grpc/issues/14815 for more context. We cannot rely
-# on pip to upgrade itself because if pip is too old, it may not have the required
-# TLS version to run `pip install`.
-curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | $VENV_PYTHON
+
+# On library/version/platforms combo that do not have a binary
+# published, we may end up building a dependency from source. In that
+# case, several of our build environment variables may disrupt the
+# third-party build process. This function pipes through only the
+# minimal environment necessary.
+pip_install() {
+ /usr/bin/env -i PATH="$PATH" "$VENV_PYTHON" -m pip install "$@"
+}
+
+# Pin setuptools to < 60.0.0 to restore the distutil installation, see:
+# https://github.com/pypa/setuptools/pull/2896
+export SETUPTOOLS_USE_DISTUTILS=stdlib
+pip_install --upgrade pip==21.3.1
+pip_install --upgrade setuptools==59.6.0
# pip-installs the directory specified. Used because on MSYS the vanilla Windows
# Python gets confused when parsing paths.
@@ -165,28 +168,14 @@ pip_install_dir() {
cd "$PWD"
}
-# On library/version/platforms combo that do not have a binary
-# published, we may end up building a dependency from source. In that
-# case, several of our build environment variables may disrupt the
-# third-party build process. This function pipes through only the
-# minimal environment necessary.
-pip_install() {
- /usr/bin/env -i PATH="$PATH" "$VENV_PYTHON" -m pip install "$@"
-}
-
-case "$VENV" in
- *py36_gevent*)
+# Install gevent
+if [[ "$VENV" == "py36" ]]; then
# TODO(https://github.com/grpc/grpc/issues/15411) unpin this
pip_install gevent==1.3.b1
- ;;
- *gevent*)
+else
pip_install -U gevent
- ;;
-esac
-
+fi
-pip_install --upgrade setuptools==44.1.1
-pip_install --upgrade pip==19.3.1
pip_install --upgrade cython
pip_install --upgrade six protobuf
diff --git a/grpc/tools/run_tests/helper_scripts/build_ruby.sh b/grpc/tools/run_tests/helper_scripts/build_ruby.sh
index cc1fe928..48a5bb50 100755
--- a/grpc/tools/run_tests/helper_scripts/build_ruby.sh
+++ b/grpc/tools/run_tests/helper_scripts/build_ruby.sh
@@ -28,7 +28,7 @@ fi
cd "$(dirname "$0")/../../.."
rm -rf ./tmp
-rake compile
+bundle exec rake compile
# build grpc_ruby_plugin
mkdir -p cmake/build
diff --git a/grpc/tools/run_tests/helper_scripts/bundle_install_wrapper.sh b/grpc/tools/run_tests/helper_scripts/bundle_install_wrapper.sh
index ab31dd5c..690239f1 100755
--- a/grpc/tools/run_tests/helper_scripts/bundle_install_wrapper.sh
+++ b/grpc/tools/run_tests/helper_scripts/bundle_install_wrapper.sh
@@ -26,6 +26,13 @@ if [ "$SYSTEM" == "Darwin" ] ; then
# See suggestion in https://github.com/bundler/bundler/issues/3692
BUNDLE_SPECIFIC_PLATFORM=true bundle install
else
- bundle install
+ # TODO(jtattermusch): remove the retry hack
+ # on linux artifact build, multiple instances of "bundle install" run in parallel
+ # in different workspaces. That should work fine since the workspaces
+ # are isolated, but causes occasional
+ # failures (builder/gem bug?). Retrying fixes the issue.
+ # Note that using bundle install --retry is not enough because
+ # that only retries downloading, not installation.
+ bundle install || (sleep 10; bundle install)
fi
diff --git a/grpc/tools/run_tests/helper_scripts/pre_build_cmake.bat b/grpc/tools/run_tests/helper_scripts/pre_build_cmake.bat
deleted file mode 100644
index aea18c9f..00000000
--- a/grpc/tools/run_tests/helper_scripts/pre_build_cmake.bat
+++ /dev/null
@@ -1,32 +0,0 @@
-@rem Copyright 2017 gRPC authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem http://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-
-setlocal
-
-cd /d %~dp0\..\..\..
-
-mkdir cmake
-cd cmake
-mkdir build
-cd build
-
-cmake -DgRPC_BUILD_TESTS=ON %* ../.. || goto :error
-
-endlocal
-
-goto :EOF
-
-:error
-echo Failed!
-exit /b %errorlevel%
diff --git a/grpc/tools/run_tests/helper_scripts/pre_build_cmake.sh b/grpc/tools/run_tests/helper_scripts/pre_build_cmake.sh
deleted file mode 100755
index 62eaf1f4..00000000
--- a/grpc/tools/run_tests/helper_scripts/pre_build_cmake.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# 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.
-
-set -ex
-
-cd "$(dirname "$0")/../../.."
-
-mkdir -p cmake/build
-cd cmake/build
-
-# MSBUILD_CONFIG's values are suitable for cmake as well
-cmake -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" "$@" ../..
diff --git a/grpc/tools/run_tests/helper_scripts/pre_build_csharp.bat b/grpc/tools/run_tests/helper_scripts/pre_build_csharp.bat
index 05c6cf0f..d0b0ab45 100644
--- a/grpc/tools/run_tests/helper_scripts/pre_build_csharp.bat
+++ b/grpc/tools/run_tests/helper_scripts/pre_build_csharp.bat
@@ -16,21 +16,10 @@
setlocal
-set ARCHITECTURE=%1
-
@rem enter repo root
cd /d %~dp0\..\..\..
-mkdir cmake
-cd cmake
-mkdir build
-cd build
-mkdir %ARCHITECTURE%
-cd %ARCHITECTURE%
-
-cmake -G "Visual Studio 14 2015" -A %ARCHITECTURE% -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON ../../.. || goto :error
-
-cd ..\..\..\src\csharp
+cd src\csharp
dotnet restore Grpc.sln || goto :error
diff --git a/grpc/tools/run_tests/helper_scripts/pre_build_csharp.sh b/grpc/tools/run_tests/helper_scripts/pre_build_csharp.sh
index 7d83986f..eb98db2e 100755
--- a/grpc/tools/run_tests/helper_scripts/pre_build_csharp.sh
+++ b/grpc/tools/run_tests/helper_scripts/pre_build_csharp.sh
@@ -18,11 +18,6 @@ set -ex
# cd to repository root
cd "$(dirname "$0")/../../.."
-mkdir -p cmake/build
-cd cmake/build
-
-cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" ../..
-
-cd ../../src/csharp
+cd src/csharp
dotnet restore Grpc.sln
diff --git a/grpc/tools/run_tests/helper_scripts/prep_xds.sh b/grpc/tools/run_tests/helper_scripts/prep_xds.sh
index 6187c88b..64e7c40e 100755
--- a/grpc/tools/run_tests/helper_scripts/prep_xds.sh
+++ b/grpc/tools/run_tests/helper_scripts/prep_xds.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+trap 'date' DEBUG
set -ex
# change to grpc repo root
diff --git a/grpc/tools/run_tests/helper_scripts/run_python.sh b/grpc/tools/run_tests/helper_scripts/run_python.sh
index 2b7321e5..72e65912 100755
--- a/grpc/tools/run_tests/helper_scripts/run_python.sh
+++ b/grpc/tools/run_tests/helper_scripts/run_python.sh
@@ -18,7 +18,7 @@ set -ex
# change to grpc repo root
cd "$(dirname "$0")/../../.."
-PYTHON=$(realpath "${1:-py27/bin/python}")
+PYTHON=$(realpath "${1:-py36/bin/python}")
ROOT=$(pwd)
@@ -27,4 +27,3 @@ $PYTHON "$ROOT/src/python/grpcio_tests/setup.py" "$2"
mkdir -p "$ROOT/reports"
rm -rf "$ROOT/reports/python-coverage"
(mv -T "$ROOT/htmlcov" "$ROOT/reports/python-coverage") || true
-
diff --git a/grpc/tools/run_tests/helper_scripts/run_tests_in_workspace.sh b/grpc/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
index fa7a7aac..37ac0af6 100755
--- a/grpc/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
+++ b/grpc/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
@@ -30,5 +30,5 @@ git clone . "${WORKSPACE_NAME}"
git submodule foreach 'cd "${repo_root}/${WORKSPACE_NAME}" \
&& git submodule update --init --reference ${repo_root}/${name} ${name}'
-echo "Running run_tests.py in workspace ${WORKSPACE_NAME}"
-python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" "$@"
+echo "Running run_tests.py in workspace ${WORKSPACE_NAME}"
+python3 "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" "$@"
diff --git a/grpc/tools/run_tests/lb_interop_tests/gen_build_yaml.py b/grpc/tools/run_tests/lb_interop_tests/gen_build_yaml.py
index 1a36e1e3..c80835d7 100755
--- a/grpc/tools/run_tests/lb_interop_tests/gen_build_yaml.py
+++ b/grpc/tools/run_tests/lb_interop_tests/gen_build_yaml.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,6 +16,7 @@
import json
import os
+
import yaml
all_scenarios = []
@@ -340,6 +341,6 @@ def generate_client_referred_to_backend_multiple_balancers():
all_scenarios += generate_client_referred_to_backend_multiple_balancers()
-print(yaml.dump({
+print((yaml.dump({
'lb_interop_test_scenarios': all_scenarios,
-}))
+})))
diff --git a/grpc/tools/run_tests/performance/README.md b/grpc/tools/run_tests/performance/README.md
index 8e3ab27a..ecf02842 100644
--- a/grpc/tools/run_tests/performance/README.md
+++ b/grpc/tools/run_tests/performance/README.md
@@ -1,169 +1,26 @@
-# Overview of performance test suite, with steps for manual runs:
+# Overview of performance test suite
For design of the tests, see https://grpc.io/docs/guides/benchmarking.
-For scripts related to the GKE-based performance test suite (in development),
-see [gRPC OSS benchmarks](#grpc-oss-benchmarks).
+This document contains documentation of on how to run gRPC end-to-end benchmarks
+using the gRPC OSS benchmarks framework (recommended) or how to run them
+manually (for experts only).
-## Pre-reqs for running these manually:
+## Approach 1: Use gRPC OSS benchmarks framework (Recommended)
-In general the benchmark workers and driver build scripts expect
-[linux_performance_worker_init.sh](../../gce/linux_performance_worker_init.sh)
-to have been ran already.
-
-### To run benchmarks locally:
-
-- From the grpc repo root, start the
- [run_performance_tests.py](../run_performance_tests.py) runner script.
-
-### On remote machines, to start the driver and workers manually:
-
-The [run_performance_test.py](../run_performance_tests.py) top-level runner
-script can also be used with remote machines, but for e.g., profiling the
-server, it might be useful to run workers manually.
-
-1. You'll need a "driver" and separate "worker" machines. For example, you might
- use one GCE "driver" machine and 3 other GCE "worker" machines that are in
- the same zone.
-
-2. Connect to each worker machine and start up a benchmark worker with a
- "driver_port".
-
-- For example, to start the grpc-go benchmark worker:
- [grpc-go worker main.go](https://github.com/grpc/grpc-go/blob/master/benchmark/worker/main.go)
- --driver_port <driver_port>
-
-#### Commands to start workers in different languages:
-
-- Note that these commands are what the top-level
- [run_performance_test.py](../run_performance_tests.py) script uses to build
- and run different workers through the
- [build_performance.sh](./build_performance.sh) script and "run worker" scripts
- (such as the [run_worker_java.sh](./run_worker_java.sh)).
-
-##### Running benchmark workers for C-core wrapped languages (C++, Python, C#, Node, Ruby):
-
-- These are more simple since they all live in the main grpc repo.
-
-```
-$ cd <grpc_repo_root>
-$ tools/run_tests/performance/build_performance.sh
-$ tools/run_tests/performance/run_worker_<language>.sh
-```
-
-- Note that there is one "run_worker" script per language, e.g.,
- [run_worker_csharp.sh](./run_worker_csharp.sh) for c#.
-
-##### Running benchmark workers for gRPC-Java:
-
-- You'll need the [grpc-java](https://github.com/grpc/grpc-java) repo.
-
-```
-$ cd <grpc-java-repo>
-$ ./gradlew -PskipCodegen=true -PskipAndroid=true :grpc-benchmarks:installDist
-$ benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker --driver_port <driver_port>
-```
-
-##### Running benchmark workers for gRPC-Go:
-
-- You'll need the [grpc-go repo](https://github.com/grpc/grpc-go)
-
-```
-$ cd <grpc-go-repo>/benchmark/worker && go install
-$ # if profiling, it might be helpful to turn off inlining by building with "-gcflags=-l"
-$ $GOPATH/bin/worker --driver_port <driver_port>
-```
-
-#### Build the driver:
-
-- Connect to the driver machine (if using a remote driver) and from the grpc
- repo root:
-
-```
-$ tools/run_tests/performance/build_performance.sh
-```
-
-#### Run the driver:
-
-1. Get the 'scenario_json' relevant for the scenario to run. Note that "scenario
- json" configs are generated from [scenario_config.py](./scenario_config.py).
- The [driver](../../../test/cpp/qps/qps_json_driver.cc) takes a list of these
- configs as a json string of the form: `{scenario: <json_list_of_scenarios> }`
- in its `--scenarios_json` command argument. One quick way to get a valid json
- string to pass to the driver is by running the
- [run_performance_tests.py](./run_performance_tests.py) locally and copying
- the logged scenario json command arg.
-
-2. From the grpc repo root:
-
-- Set `QPS_WORKERS` environment variable to a comma separated list of worker
- machines. Note that the driver will start the "benchmark server" on the first
- entry in the list, and the rest will be told to run as clients against the
- benchmark server.
-
-Example running and profiling of go benchmark server:
-
-```
-$ export QPS_WORKERS=<host1>:<10000>,<host2>,10000,<host3>:10000
-$ bins/opt/qps_json_driver --scenario_json='<scenario_json_scenario_config_string>'
-```
-
-### Example profiling commands
-
-While running the benchmark, a profiler can be attached to the server.
-
-Example to count syscalls in grpc-go server during a benchmark:
-
-- Connect to server machine and run:
-
-```
-$ netstat -tulpn | grep <driver_port> # to get pid of worker
-$ perf stat -p <worker_pid> -e syscalls:sys_enter_write # stop after test complete
-```
-
-Example memory profile of grpc-go server, with `go tools pprof`:
-
-- After a run is done on the server, see its alloc profile with:
-
-```
-$ go tool pprof --text --alloc_space http://localhost:<pprof_port>/debug/heap
-```
-
-### Configuration environment variables:
-
-- QPS_WORKER_CHANNEL_CONNECT_TIMEOUT
-
- Consuming process: qps_worker
-
- Type: integer (number of seconds)
-
- This can be used to configure the amount of time that benchmark clients wait
- for channels to the benchmark server to become ready. This is useful in
- certain benchmark environments in which the server can take a long time to
- become ready. Note: if setting this to a high value, then the scenario config
- under test should probably also have a large "warmup_seconds".
-
-- QPS_WORKERS
-
- Consuming process: qps_json_driver
-
- Type: comma separated list of host:port
-
- Set this to a comma separated list of QPS worker processes/machines. Each
- scenario in a scenario config has specifies a certain number of servers,
- `num_servers`, and the driver will start "benchmark servers"'s on the first
- `num_server` `host:port` pairs in the comma separated list. The rest will be
- told to run as clients against the benchmark server.
-
-## gRPC OSS benchmarks
+### gRPC OSS benchmarks
The scripts in this section generate LoadTest configurations for the GKE-based
gRPC OSS benchmarks framework. This framework is stored in a separate
-repository, [grpc/test-infra](https://github.com/grpc/test-infra).
+repository, [grpc/test-infra].
+
+These scripts, together with tools defined in [grpc/test-infra], are used in the
+continuous integration setup defined in [grpc_e2e_performance_gke.sh] and
+[grpc_e2e_performance_gke_experiment.sh].
-### Generating scenarios
+#### Generating scenarios
-The benchmarks framework uses the same test scenarios as the legacy one. These
+The benchmarks framework uses the same test scenarios as the legacy one. The
script [scenario_config_exporter.py](./scenario_config_exporter.py) can be used
to export these scenarios to files, and also to count and analyze existing
scenarios.
@@ -200,7 +57,7 @@ Count Language Client Server Categories
Client and server languages are only set for cross-language scenarios, where the
client or server language do not match the scenario language.
-### Generating load test configurations
+#### Generating load test configurations
The benchmarks framework uses LoadTest resources configured by YAML files. Each
LoadTest resource specifies a driver, a server, and one or more clients to run
@@ -231,6 +88,9 @@ run by applying the test to a cluster running the LoadTest controller with
$ kubectl apply -f loadtest_config.yaml
```
+> Note: The most common way of running tests generated by this script is to use
+> a _test runner_. For details, see [running tests](#running-tests).
+
A basic template for generating tests in various languages can be found here:
[loadtest_template_basic_all_languages.yaml](./templates/loadtest_template_basic_all_languages.yaml).
The following example generates configurations for C# and Java tests using this
@@ -240,8 +100,9 @@ twice:
```
$ ./tools/run_tests/performance/loadtest_config.py -l go -l java \
-t ./tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml \
- -s client_pool=workers-8core -s server_pool=workers-8core \
- -s big_query_table=grpc-testing.e2e_benchmarks.experimental_results \
+ -s client_pool=workers-8core -s driver_pool=drivers \
+ -s server_pool=workers-8core \
+ -s big_query_table=e2e_benchmarks.experimental_results \
-s timeout_seconds=3600 --category=scalable \
-d --allow_client_language=c++ --allow_server_language=c++ \
--runs_per_test=2 -o ./loadtest.yaml
@@ -253,7 +114,12 @@ The script `loadtest_config.py` takes the following options:
- `-t`, `--template`<br> Template file. A template is a configuration file that
may contain multiple client and server configuration, and may also include
substitution keys.
-- `p`, `--prefix`<br> Test names consist of a prefix_joined with a uuid with a
+- `-s`, `--substitution` Substitution keys, in the format `key=value`. These
+ keys are substituted while processing the template. Environment variables that
+ are set by the load test controller at runtime are ignored by default
+ (`DRIVER_PORT`, `KILL_AFTER`, `POD_TIMEOUT`). The user can override this
+ behavior by specifying these variables as keys.
+- `-p`, `--prefix`<br> Test names consist of a prefix_joined with a uuid with a
dash. Test names are stored in `metadata.name`. The prefix is also added as
the `prefix` label in `metadata.labels`. The prefix defaults to the user name
if not set.
@@ -280,6 +146,13 @@ The script `loadtest_config.py` takes the following options:
- `--allow_server_language`<br> Allows cross-language scenarios where the server
is of a specified language, different from the scenario language. This is
typically `node` or `c++`. This flag may be repeated.
+- `--instances_per_client`<br> This option generates multiple instances of the
+ clients for each test. The instances are named with the name of the client
+ combined with an index (or only an index, if no name is specified). If the
+ template specifies more than one client for a given language, it must also
+ specify unique names for each client. In the most common case, the template
+ contains only one unnamed client for each language, and the instances will be
+ named `0`, `1`, ...
- `--runs_per_test`<br> This option specifies that each test should be repeated
`n` times, where `n` is the value of the flag. If `n` > 1, the index of each
test run is added as a uniquifier element for that run.
@@ -312,7 +185,7 @@ script) but is not indexed and cannot be used to select objects. Scenario name
and uniquifier are added to provide the elements of the LoadTest name uuid in
human-readable form. Additional annotations may be added later for automation.
-### Concatenating load test configurations
+#### Concatenating load test configurations
The LoadTest configuration generator can process multiple languages at a time,
assuming that they are supported by the template. The convenience script
@@ -325,7 +198,19 @@ script can be invoked as follows:
$ loadtest_concat_yaml.py -i infile1.yaml infile2.yaml -o outfile.yaml
```
-### Generating configuration templates
+#### Generating load test examples
+
+The script [loadtest_examples.sh](./loadtest_examples.sh) is provided to
+generate example load test configurations in all supported languages. This
+script takes only one argument, which is the output directory where the
+configurations will be created. The script produces a set of basic
+configurations, as well as a set of template configurations intended to be used
+with prebuilt images.
+
+The [examples](https://github.com/grpc/test-infra/tree/master/config/samples) in
+the repository [grpc/test-infra] are generated by this script.
+
+#### Generating configuration templates
The script [loadtest_template.py](./loadtest_template.py) generates a load test
configuration template from a set of load test configurations. The source files
@@ -335,18 +220,31 @@ configurations or templates.
The example template in
[loadtest_template_basic_template_all_languages.yaml](./templates/loadtest_template_basic_all_languages.yaml)
-was generated from the example configurations in
-[grpc/test-infra](https://github.com/grpc/test-infra) by the following command:
+was generated from the example configurations in [grpc/test-infra] by the
+following command:
```
$ ./tools/run_tests/performance/loadtest_template.py \
- -i ../test-infra/config/samples/*.yaml \
- --inject_client_pool --inject_server_pool --inject_big_query_table \
- --inject_timeout_seconds \
+ -i ../test-infra/config/samples/*_example_loadtest.yaml \
+ --inject_client_pool --inject_server_pool \
+ --inject_big_query_table --inject_timeout_seconds \
-o ./tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml \
--name basic_all_languages
```
+The example template with prebuilt images in
+[loadtest_template_prebuilt_all_languages.yaml](./templates/loadtest_template_prebuilt_all_languages.yaml)
+was generated by the following command:
+
+```
+$ ./tools/run_tests/performance/loadtest_template.py \
+ -i ../test-infra/config/samples/templates/*_example_loadtest_with_prebuilt_workers.yaml \
+ --inject_client_pool --inject_driver_image --inject_driver_pool \
+ --inject_server_pool --inject_big_query_table --inject_timeout_seconds \
+ -o ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \
+ --name prebuilt_all_languages
+```
+
The script `loadtest_template.py` takes the following options:
- `-i`, `--inputs`<br> Space-separated list of the names of input files
@@ -354,6 +252,11 @@ The script `loadtest_template.py` takes the following options:
- `-o`, `--output`<br> Output file name. Outputs to `sys.stdout` if not set.
- `--inject_client_pool`<br> If this option is set, the pool attribute of all
clients in `spec.clients` is set to `${client_pool}`, for later substitution.
+- `--inject_driver_image`<br> If this option is set, the image attribute of the
+ driver(s) in `spec.drivers` is set to `${driver_image}`, for later
+ substitution.
+- `--inject_driver_pool`<br> If this attribute is set, the pool attribute of the
+ driver(s) is set to `${driver_pool}`, for later substitution.
- `--inject_server_pool`<br> If this option is set, the pool attribute of all
servers in `spec.servers` is set to `${server_pool}`, for later substitution.
- `--inject_big_query_table`<br> If this option is set,
@@ -366,7 +269,7 @@ The script `loadtest_template.py` takes the following options:
- `-a`, `--annotation`<br> Metadata annotation to be stored in
`metadata.annotations`, in the form key=value. May be repeated.
-The four options that inject substitution keys are the most useful for template
+The options that inject substitution keys are the most useful for template
reuse. When running tests on different node pools, it becomes necessary to set
the pool, and usually also to store the data on a different table. When running
as part of a larger collection of tests, it may also be necessary to adjust test
@@ -379,3 +282,181 @@ Annotations, on the other hand, are passed on to the test configurations, and
may be set to values or to substitution keys in themselves, allowing future
automation scripts to process the tests generated from these configurations in
different ways.
+
+#### Running tests
+
+Collections of tests generated by `loadtest_config.py` are intended to be run
+with a test runner. The code for the test runner is stored in a separate
+repository, [grpc/test-infra].
+
+The test runner applies the tests to the cluster, and monitors the tests for
+completion while they are running. The test runner can also be set up to run
+collections of tests in parallel on separate node pools, and to limit the number
+of tests running in parallel on each pool.
+
+For more information, see the
+[tools README](https://github.com/grpc/test-infra/blob/master/tools/README.md)
+in [grpc/test-infra].
+
+For usage examples, see the continuous integration setup defined in
+[grpc_e2e_performance_gke.sh] and [grpc_e2e_performance_gke_experiment.sh].
+
+[grpc/test-infra]: https://github.com/grpc/test-infra
+[grpc_e2e_performance_gke.sh]: ../../internal_ci/linux/grpc_e2e_performance_gke.sh
+[grpc_e2e_performance_gke_experiment.sh]: ../../internal_ci/linux/grpc_e2e_performance_gke_experiment.sh
+
+## Approach 2: Running benchmarks locally via legacy tooling (still useful sometimes)
+
+This approach is much more involved than using the gRPC OSS benchmarks framework
+(see above), but can still be useful for hands-on low-level experiments
+(especially when you know what you are doing).
+
+### Prerequisites for running benchmarks manually:
+
+In general the benchmark workers and driver build scripts expect
+[linux_performance_worker_init.sh](../../gce/linux_performance_worker_init.sh)
+to have been ran already.
+
+### To run benchmarks locally:
+
+- From the grpc repo root, start the
+ [run_performance_tests.py](../run_performance_tests.py) runner script.
+
+### On remote machines, to start the driver and workers manually:
+
+The [run_performance_test.py](../run_performance_tests.py) top-level runner
+script can also be used with remote machines, but for e.g., profiling the
+server, it might be useful to run workers manually.
+
+1. You'll need a "driver" and separate "worker" machines. For example, you might
+ use one GCE "driver" machine and 3 other GCE "worker" machines that are in
+ the same zone.
+
+2. Connect to each worker machine and start up a benchmark worker with a
+ "driver_port".
+
+- For example, to start the grpc-go benchmark worker:
+ [grpc-go worker main.go](https://github.com/grpc/grpc-go/blob/master/benchmark/worker/main.go)
+ --driver_port <driver_port>
+
+#### Commands to start workers in different languages:
+
+- Note that these commands are what the top-level
+ [run_performance_test.py](../run_performance_tests.py) script uses to build
+ and run different workers through the
+ [build_performance.sh](./build_performance.sh) script and "run worker" scripts
+ (such as the [run_worker_java.sh](./run_worker_java.sh)).
+
+##### Running benchmark workers for C-core wrapped languages (C++, Python, C#, Node, Ruby):
+
+- These are more simple since they all live in the main grpc repo.
+
+```
+$ cd <grpc_repo_root>
+$ tools/run_tests/performance/build_performance.sh
+$ tools/run_tests/performance/run_worker_<language>.sh
+```
+
+- Note that there is one "run_worker" script per language, e.g.,
+ [run_worker_csharp.sh](./run_worker_csharp.sh) for c#.
+
+##### Running benchmark workers for gRPC-Java:
+
+- You'll need the [grpc-java](https://github.com/grpc/grpc-java) repo.
+
+```
+$ cd <grpc-java-repo>
+$ ./gradlew -PskipCodegen=true -PskipAndroid=true :grpc-benchmarks:installDist
+$ benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker --driver_port <driver_port>
+```
+
+##### Running benchmark workers for gRPC-Go:
+
+- You'll need the [grpc-go repo](https://github.com/grpc/grpc-go)
+
+```
+$ cd <grpc-go-repo>/benchmark/worker && go install
+$ # if profiling, it might be helpful to turn off inlining by building with "-gcflags=-l"
+$ $GOPATH/bin/worker --driver_port <driver_port>
+```
+
+#### Build the driver:
+
+- Connect to the driver machine (if using a remote driver) and from the grpc
+ repo root:
+
+```
+$ tools/run_tests/performance/build_performance.sh
+```
+
+#### Run the driver:
+
+1. Get the 'scenario_json' relevant for the scenario to run. Note that "scenario
+ json" configs are generated from [scenario_config.py](./scenario_config.py).
+ The [driver](../../../test/cpp/qps/qps_json_driver.cc) takes a list of these
+ configs as a json string of the form: `{scenario: <json_list_of_scenarios> }`
+ in its `--scenarios_json` command argument. One quick way to get a valid json
+ string to pass to the driver is by running the
+ [run_performance_tests.py](./run_performance_tests.py) locally and copying
+ the logged scenario json command arg.
+
+2. From the grpc repo root:
+
+- Set `QPS_WORKERS` environment variable to a comma separated list of worker
+ machines. Note that the driver will start the "benchmark server" on the first
+ entry in the list, and the rest will be told to run as clients against the
+ benchmark server.
+
+Example running and profiling of go benchmark server:
+
+```
+$ export QPS_WORKERS=<host1>:<10000>,<host2>,10000,<host3>:10000
+$ bins/opt/qps_json_driver --scenario_json='<scenario_json_scenario_config_string>'
+```
+
+### Example profiling commands
+
+While running the benchmark, a profiler can be attached to the server.
+
+Example to count syscalls in grpc-go server during a benchmark:
+
+- Connect to server machine and run:
+
+```
+$ netstat -tulpn | grep <driver_port> # to get pid of worker
+$ perf stat -p <worker_pid> -e syscalls:sys_enter_write # stop after test complete
+```
+
+Example memory profile of grpc-go server, with `go tools pprof`:
+
+- After a run is done on the server, see its alloc profile with:
+
+```
+$ go tool pprof --text --alloc_space http://localhost:<pprof_port>/debug/heap
+```
+
+### Configuration environment variables:
+
+- QPS_WORKER_CHANNEL_CONNECT_TIMEOUT
+
+ Consuming process: qps_worker
+
+ Type: integer (number of seconds)
+
+ This can be used to configure the amount of time that benchmark clients wait
+ for channels to the benchmark server to become ready. This is useful in
+ certain benchmark environments in which the server can take a long time to
+ become ready. Note: if setting this to a high value, then the scenario config
+ under test should probably also have a large "warmup_seconds".
+
+- QPS_WORKERS
+
+ Consuming process: qps_json_driver
+
+ Type: comma separated list of host:port
+
+ Set this to a comma separated list of QPS worker processes/machines. Each
+ scenario in a scenario config has specifies a certain number of servers,
+ `num_servers`, and the driver will start "benchmark servers"'s on the first
+ `num_server` `host:port` pairs in the comma separated list. The rest will be
+ told to run as clients against the benchmark server.
diff --git a/grpc/tools/run_tests/performance/bq_upload_result.py b/grpc/tools/run_tests/performance/bq_upload_result.py
index be1e0c3f..b449e105 100755
--- a/grpc/tools/run_tests/performance/bq_upload_result.py
+++ b/grpc/tools/run_tests/performance/bq_upload_result.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,8 @@ import os
import sys
import time
import uuid
+
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import massage_qps_stats
gcp_utils_dir = os.path.abspath(
@@ -61,14 +63,18 @@ def _upload_netperf_latency_csv_to_bigquery(dataset_id, table_id, result_file):
sys.exit(1)
-def _upload_scenario_result_to_bigquery(dataset_id, table_id, result_file):
+def _upload_scenario_result_to_bigquery(dataset_id, table_id, result_file,
+ metadata_file, node_info_file,
+ prometheus_query_results_file):
with open(result_file, 'r') as f:
scenario_result = json.loads(f.read())
bq = big_query_utils.create_big_query()
_create_results_table(bq, dataset_id, table_id)
- if not _insert_result(bq, dataset_id, table_id, scenario_result):
+ if not _insert_scenario_result(bq, dataset_id, table_id, scenario_result,
+ metadata_file, node_info_file,
+ prometheus_query_results_file):
print('Error uploading result to bigquery.')
sys.exit(1)
@@ -82,6 +88,25 @@ def _insert_result(bq, dataset_id, table_id, scenario_result, flatten=True):
[row])
+def _insert_scenario_result(bq,
+ dataset_id,
+ table_id,
+ scenario_result,
+ test_metadata_file,
+ node_info_file,
+ prometheus_query_results_file,
+ flatten=True):
+ if flatten:
+ _flatten_result_inplace(scenario_result)
+ _populate_metadata_from_file(scenario_result, test_metadata_file)
+ _populate_node_metadata_from_file(scenario_result, node_info_file)
+ _populate_prometheus_query_results_from_file(scenario_result,
+ prometheus_query_results_file)
+ row = big_query_utils.make_row(str(uuid.uuid4()), scenario_result)
+ return big_query_utils.insert_rows(bq, _PROJECT_ID, dataset_id, table_id,
+ [row])
+
+
def _create_results_table(bq, dataset_id, table_id):
with open(os.path.dirname(__file__) + '/scenario_result_schema.json',
'r') as f:
@@ -157,6 +182,118 @@ def _populate_metadata_inplace(scenario_result):
scenario_result['metadata'] = metadata
+def _populate_metadata_from_file(scenario_result, test_metadata_file):
+ utc_timestamp = str(calendar.timegm(time.gmtime()))
+ metadata = {'created': utc_timestamp}
+
+ _annotation_to_bq_metadata_key_map = {
+ 'ci_' + key: key for key in (
+ 'buildNumber',
+ 'buildUrl',
+ 'jobName',
+ 'gitCommit',
+ 'gitActualCommit',
+ )
+ }
+
+ if os.access(test_metadata_file, os.R_OK):
+ with open(test_metadata_file, 'r') as f:
+ test_metadata = json.loads(f.read())
+
+ # eliminate managedFields from metadata set
+ if 'managedFields' in test_metadata:
+ del test_metadata['managedFields']
+
+ annotations = test_metadata.get('annotations', {})
+
+ # if use kubectl apply ..., kubectl will append current configuration to
+ # annotation, the field is deleted since it includes a lot of irrelevant
+ # information
+ if 'kubectl.kubernetes.io/last-applied-configuration' in annotations:
+ del annotations['kubectl.kubernetes.io/last-applied-configuration']
+
+ # dump all metadata as JSON to testMetadata field
+ scenario_result['testMetadata'] = json.dumps(test_metadata)
+ for key, value in _annotation_to_bq_metadata_key_map.items():
+ if key in annotations:
+ metadata[value] = annotations[key]
+
+ scenario_result['metadata'] = metadata
+
+
+def _populate_node_metadata_from_file(scenario_result, node_info_file):
+ node_metadata = {'driver': {}, 'servers': [], 'clients': []}
+ _node_info_to_bq_node_metadata_key_map = {
+ 'Name': 'name',
+ 'PodIP': 'podIP',
+ 'NodeName': 'nodeName',
+ }
+
+ if os.access(node_info_file, os.R_OK):
+ with open(node_info_file, 'r') as f:
+ file_metadata = json.loads(f.read())
+ for key, value in _node_info_to_bq_node_metadata_key_map.items():
+ node_metadata['driver'][value] = file_metadata['Driver'][key]
+ for clientNodeInfo in file_metadata['Clients']:
+ node_metadata['clients'].append({
+ value: clientNodeInfo[key] for key, value in
+ _node_info_to_bq_node_metadata_key_map.items()
+ })
+ for serverNodeInfo in file_metadata['Servers']:
+ node_metadata['servers'].append({
+ value: serverNodeInfo[key] for key, value in
+ _node_info_to_bq_node_metadata_key_map.items()
+ })
+
+ scenario_result['nodeMetadata'] = node_metadata
+
+
+def _populate_prometheus_query_results_from_file(scenario_result,
+ prometheus_query_result_file):
+ """Populate the results from Prometheus query to Bigquery table """
+ if os.access(prometheus_query_result_file, os.R_OK):
+ with open(prometheus_query_result_file, 'r', encoding='utf8') as f:
+ file_query_results = json.loads(f.read())
+
+ scenario_result['testDurationSeconds'] = file_query_results[
+ 'testDurationSeconds']
+ clientsPrometheusData = []
+ if 'clients' in file_query_results:
+ for client_name, client_data in file_query_results[
+ 'clients'].items():
+ clientPrometheusData = {'name': client_name}
+ containersPrometheusData = []
+ for container_name, container_data in client_data.items():
+ containerPrometheusData = {
+ 'name': container_name,
+ 'cpuSeconds': container_data['cpuSeconds'],
+ 'memoryMean': container_data['memoryMean'],
+ }
+ containersPrometheusData.append(containerPrometheusData)
+ clientPrometheusData[
+ 'containers'] = containersPrometheusData
+ clientsPrometheusData.append(clientPrometheusData)
+ scenario_result['clientsPrometheusData'] = clientsPrometheusData
+
+ serversPrometheusData = []
+ if 'servers' in file_query_results:
+ for server_name, server_data in file_query_results[
+ 'servers'].items():
+ serverPrometheusData = {'name': server_name}
+ containersPrometheusData = []
+ for container_name, container_data in server_data.items():
+ containerPrometheusData = {
+ 'name': container_name,
+ 'cpuSeconds': container_data['cpuSeconds'],
+ 'memoryMean': container_data['memoryMean'],
+ }
+ containersPrometheusData.append(containerPrometheusData)
+ serverPrometheusData[
+ 'containers'] = containersPrometheusData
+ serversPrometheusData.append(serverPrometheusData)
+ scenario_result['serversPrometheusData'] = serversPrometheusData
+
+
argp = argparse.ArgumentParser(description='Upload result to big query.')
argp.add_argument('--bq_result_table',
required=True,
@@ -167,6 +304,18 @@ argp.add_argument('--file_to_upload',
default='scenario_result.json',
type=str,
help='Report file to upload.')
+argp.add_argument('--metadata_file_to_upload',
+ default='metadata.json',
+ type=str,
+ help='Metadata file to upload.')
+argp.add_argument('--node_info_file_to_upload',
+ default='node_info.json',
+ type=str,
+ help='Node information file to upload.')
+argp.add_argument('--prometheus_query_results_to_upload',
+ default='prometheus_query_result.json',
+ type=str,
+ help='Prometheus query result file to upload.')
argp.add_argument('--file_format',
choices=['scenario_result', 'netperf_latency_csv'],
default='scenario_result',
@@ -181,5 +330,10 @@ if args.file_format == 'netperf_latency_csv':
args.file_to_upload)
else:
_upload_scenario_result_to_bigquery(dataset_id, table_id,
- args.file_to_upload)
-print('Successfully uploaded %s to BigQuery.\n' % args.file_to_upload)
+ args.file_to_upload,
+ args.metadata_file_to_upload,
+ args.node_info_file_to_upload,
+ args.prometheus_query_results_to_upload)
+print('Successfully uploaded %s, %s, %s and %s to BigQuery.\n' %
+ (args.file_to_upload, args.metadata_file_to_upload,
+ args.node_info_file_to_upload, args.prometheus_query_results_to_upload))
diff --git a/grpc/tools/run_tests/performance/loadtest_concat_yaml.py b/grpc/tools/run_tests/performance/loadtest_concat_yaml.py
index bf64fdc6..a6ab10dc 100755
--- a/grpc/tools/run_tests/performance/loadtest_concat_yaml.py
+++ b/grpc/tools/run_tests/performance/loadtest_concat_yaml.py
@@ -22,7 +22,6 @@
import argparse
import sys
-
from typing import Iterable
diff --git a/grpc/tools/run_tests/performance/loadtest_config.py b/grpc/tools/run_tests/performance/loadtest_config.py
index b91b2ca7..ca7d453d 100755
--- a/grpc/tools/run_tests/performance/loadtest_config.py
+++ b/grpc/tools/run_tests/performance/loadtest_config.py
@@ -22,19 +22,19 @@
# https://github.com/grpc/grpc/blob/master/tools/run_tests/performance/README.md#grpc-oss-benchmarks
import argparse
+import collections
import copy
import datetime
import itertools
+import json
import os
import string
import sys
-import uuid
-
from typing import Any, Dict, Iterable, Mapping, Optional, Type
-import json
import yaml
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import scenario_config
import scenario_config_exporter
@@ -44,29 +44,10 @@ CONFIGURATION_FILE_HEADER_COMMENT = """
# https://github.com/grpc/grpc/blob/master/tools/run_tests/performance/README.md#grpc-oss-benchmarks
"""
-# TODO(paulosjca): Merge label_language and image_language into one function.
-# These functions are necessary because 'c++' is not allowed as a label value in
-# kubernetes, and because languages share images in the existing templates. Once
-# the templates are reorganized and most image mapping is removed, the two
-# functions can be merged into one.
-
-def label_language(language: str) -> str:
- """Convert scenario language to place in a resource label."""
- return {
- 'c++': 'cxx',
- }.get(language, language)
-
-
-def image_language(language: str) -> str:
- """Convert scenario languages to image languages."""
- return {
- 'c++': 'cxx',
- 'node_purejs': 'node',
- 'php7': 'php',
- 'php7_protobuf_c': 'php',
- 'python_asyncio': 'python',
- }.get(language, language)
+def safe_name(language: str) -> str:
+ """Returns a name that is safe to use in labels and file names."""
+ return scenario_config.LANGUAGES[language].safename
def default_prefix() -> str:
@@ -81,11 +62,13 @@ def now_string() -> str:
def validate_loadtest_name(name: str) -> None:
"""Validates that a LoadTest name is in the expected format."""
- if len(name) > 63:
+ if len(name) > 253:
raise ValueError(
- 'LoadTest name must be less than 63 characters long: %s' % name)
- if not all((s.isalnum() for s in name.split('-'))):
- raise ValueError('Invalid elements in LoadTest name: %s' % name)
+ 'LoadTest name must be less than 253 characters long: %s' % name)
+ if not all(c.isalnum() and not c.isupper() for c in name if c != '-'):
+ raise ValueError('Invalid characters in LoadTest name: %s' % name)
+ if not name or not name[0].isalpha() or name[-1] == '-':
+ raise ValueError('Invalid format for LoadTest name: %s' % name)
def loadtest_base_name(scenario_name: str,
@@ -93,7 +76,7 @@ def loadtest_base_name(scenario_name: str,
"""Constructs and returns the base name for a LoadTest resource."""
name_elements = scenario_name.split('_')
name_elements.extend(uniquifier_elements)
- return '-'.join(name_elements)
+ return '-'.join(element.lower() for element in name_elements)
def loadtest_name(prefix: str, scenario_name: str,
@@ -103,12 +86,17 @@ def loadtest_name(prefix: str, scenario_name: str,
name_elements = []
if prefix:
name_elements.append(prefix)
- name_elements.append(str(uuid.uuid5(uuid.NAMESPACE_DNS, base_name)))
+ name_elements.append(base_name)
name = '-'.join(name_elements)
validate_loadtest_name(name)
return name
+def component_name(elements: Iterable[str]) -> str:
+ """Constructs a component name from possibly empty elements."""
+ return '-'.join((e for e in elements if e))
+
+
def validate_annotations(annotations: Dict[str, str]) -> None:
"""Validates that annotations do not contain reserved names.
@@ -124,10 +112,10 @@ def gen_run_indices(runs_per_test: int) -> Iterable[str]:
if runs_per_test < 2:
yield ''
return
- prefix_length = len('{:d}'.format(runs_per_test - 1))
- prefix_fmt = '{{:{:d}d}}'.format(prefix_length)
+ index_length = len('{:d}'.format(runs_per_test - 1))
+ index_fmt = '{{:0{:d}d}}'.format(index_length)
for i in range(runs_per_test):
- yield prefix_fmt.format(i)
+ yield index_fmt.format(i)
def gen_loadtest_configs(
@@ -139,6 +127,7 @@ def gen_loadtest_configs(
loadtest_name_prefix: str,
uniquifier_elements: Iterable[str],
annotations: Mapping[str, str],
+ instances_per_client: int = 1,
runs_per_test: int = 1) -> Iterable[Dict[str, Any]]:
"""Generates LoadTest configurations for a given language config.
@@ -146,10 +135,8 @@ def gen_loadtest_configs(
"""
validate_annotations(annotations)
prefix = loadtest_name_prefix or default_prefix()
- cl = image_language(language_config.client_language or
- language_config.language)
- sl = image_language(language_config.server_language or
- language_config.language)
+ cl = safe_name(language_config.client_language or language_config.language)
+ sl = safe_name(language_config.server_language or language_config.language)
scenario_filter = scenario_config_exporter.scenario_filter(
scenario_name_regex=scenario_name_regex,
category=language_config.category,
@@ -172,8 +159,7 @@ def gen_loadtest_configs(
metadata['name'] = name
if 'labels' not in metadata:
metadata['labels'] = dict()
- metadata['labels']['language'] = label_language(
- language_config.language)
+ metadata['labels']['language'] = safe_name(language_config.language)
metadata['labels']['prefix'] = prefix
if 'annotations' not in metadata:
metadata['annotations'] = dict()
@@ -186,23 +172,68 @@ def gen_loadtest_configs(
spec = config['spec']
# Select clients with the required language.
- spec['clients'] = [
+ clients = [
client for client in base_config_clients
if client['language'] == cl
]
- if not spec['clients']:
+ if not clients:
raise IndexError('Client language not found in template: %s' %
cl)
+ # Validate config for additional client instances.
+ if instances_per_client > 1:
+ c = collections.Counter(
+ (client.get('name', '') for client in clients))
+ if max(c.values()) > 1:
+ raise ValueError(
+ ('Multiple instances of multiple clients requires '
+ 'unique names, name counts for language %s: %s') %
+ (cl, c.most_common()))
+
+ # Name client instances with an index starting from zero.
+ client_instances = []
+ for i in range(instances_per_client):
+ client_instances.extend(copy.deepcopy(clients))
+ for client in client_instances[-len(clients):]:
+ client['name'] = component_name((client.get('name',
+ ''), str(i)))
+
+ # Set clients to named instances.
+ spec['clients'] = client_instances
+
# Select servers with the required language.
- spec['servers'] = [
+ servers = copy.deepcopy([
server for server in base_config_servers
if server['language'] == sl
- ]
- if not spec['servers']:
+ ])
+ if not servers:
raise IndexError('Server language not found in template: %s' %
sl)
+ # Name servers with an index for consistency with clients.
+ for i, server in enumerate(servers):
+ server['name'] = component_name((server.get('name',
+ ''), str(i)))
+
+ # Set servers to named instances.
+ spec['servers'] = servers
+
+ # Add driver, if needed.
+ if 'driver' not in spec:
+ spec['driver'] = dict()
+
+ # Ensure driver has language and run fields.
+ driver = spec['driver']
+ if 'language' not in driver:
+ driver['language'] = safe_name('c++')
+ if 'run' not in driver:
+ driver['run'] = dict()
+
+ # Name the driver with an index for consistency with workers.
+ # There is only one driver, so the index is zero.
+ if 'name' not in driver or not driver['name']:
+ driver['name'] = '0'
+
spec['scenariosJSON'] = scenario_str
yield config
@@ -221,6 +252,29 @@ def parse_key_value_args(args: Optional[Iterable[str]]) -> Dict[str, str]:
return d
+def clear_empty_fields(config: Dict[str, Any]) -> None:
+ """Clears fields set to empty values by string substitution."""
+ spec = config['spec']
+ if 'clients' in spec:
+ for client in spec['clients']:
+ if 'pool' in client and not client['pool']:
+ del client['pool']
+ if 'servers' in spec:
+ for server in spec['servers']:
+ if 'pool' in server and not server['pool']:
+ del server['pool']
+ if 'driver' in spec:
+ driver = spec['driver']
+ if 'pool' in driver and not driver['pool']:
+ del driver['pool']
+ if ('run' in driver and 'image' in driver['run'] and
+ not driver['run']['image']):
+ del driver['run']['image']
+ if 'results' in spec and not ('bigQueryTable' in spec['results'] and
+ spec['results']['bigQueryTable']):
+ del spec['results']
+
+
def config_dumper(header_comment: str) -> Type[yaml.SafeDumper]:
"""Returns a custom dumper to dump configurations in the expected format."""
@@ -232,15 +286,6 @@ def config_dumper(header_comment: str) -> Type[yaml.SafeDumper]:
self.write_indent()
self.write_indicator(header_comment, need_whitespace=False)
- def expect_block_sequence(self):
- super().expect_block_sequence()
- self.increase_indent()
-
- def expect_block_sequence_item(self, first=False):
- if isinstance(self.event, yaml.SequenceEndEvent):
- self.indent = self.indents.pop()
- super().expect_block_sequence_item(first)
-
def str_presenter(dumper, data):
if '\n' in data:
return dumper.represent_scalar('tag:yaml.org,2002:str',
@@ -321,6 +366,10 @@ def main() -> None:
default=[],
help='Allow cross-language scenarios with this server language.',
dest='allow_server_languages')
+ argp.add_argument('--instances_per_client',
+ default=1,
+ type=int,
+ help="Number of instances to generate for each client.")
argp.add_argument('--runs_per_test',
default=1,
type=int,
@@ -331,7 +380,23 @@ def main() -> None:
help='Output file name. Output to stdout if not set.')
args = argp.parse_args()
- substitutions = parse_key_value_args(args.substitutions)
+ if args.instances_per_client < 1:
+ argp.error('instances_per_client must be greater than zero.')
+
+ if args.runs_per_test < 1:
+ argp.error('runs_per_test must be greater than zero.')
+
+ # Config generation ignores environment variables that are passed by the
+ # controller at runtime.
+ substitutions = {
+ 'DRIVER_PORT': '${DRIVER_PORT}',
+ 'KILL_AFTER': '${KILL_AFTER}',
+ 'POD_TIMEOUT': '${POD_TIMEOUT}',
+ }
+
+ # The user can override the ignored variables above by passing them in as
+ # substitution keys.
+ substitutions.update(parse_key_value_args(args.substitutions))
uniquifier_elements = args.uniquifier_elements
if args.d:
@@ -343,6 +408,8 @@ def main() -> None:
base_config = yaml.safe_load(
string.Template(f.read()).substitute(substitutions))
+ clear_empty_fields(base_config)
+
spec = base_config['spec']
base_config_clients = spec['clients']
del spec['clients']
@@ -368,6 +435,7 @@ def main() -> None:
loadtest_name_prefix=args.prefix,
uniquifier_elements=uniquifier_elements,
annotations=annotations,
+ instances_per_client=args.instances_per_client,
runs_per_test=args.runs_per_test))
configs = (config for config in itertools.chain(*config_generators))
diff --git a/grpc/tools/run_tests/performance/loadtest_examples.sh b/grpc/tools/run_tests/performance/loadtest_examples.sh
new file mode 100755
index 00000000..d544f9c6
--- /dev/null
+++ b/grpc/tools/run_tests/performance/loadtest_examples.sh
@@ -0,0 +1,130 @@
+#!/bin/bash
+# Copyright 2021 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 script generates a set of load test examples from templates.
+
+LOADTEST_CONFIG=tools/run_tests/performance/loadtest_config.py
+
+if (( $# < 1 )); then
+ echo "Usage: ${0} <output directory>" >&2
+ exit 1
+fi
+
+if [[ ! -x "${LOADTEST_CONFIG}" ]]; then
+ echo "${LOADTEST_CONFIG} not found." >&2
+ exit 1
+fi
+
+outputbasedir="${1}"
+
+mkdir -p "${outputbasedir}/templates"
+
+example_file() {
+ local scenario="${1}"
+ local suffix="${2}"
+ if [[ "${scenario#cpp_}" != "${scenario}" ]]; then
+ echo "cxx${suffix}"
+ return
+ fi
+ if [[ "${scenario#python_asyncio_}" != "${scenario}" ]]; then
+ echo "python_asyncio${suffix}"
+ return
+ fi
+ if [[ "${scenario#php7_protobuf_c_}" != "${scenario}" ]]; then
+ echo "php7_protobuf_c${suffix}"
+ return
+ fi
+ echo "${scenario%%_*}${suffix}"
+}
+
+example_language() {
+ local filename="${1}"
+ if [[ "${filename#cxx_}" != "${filename}" ]]; then
+ echo "c++"
+ return
+ fi
+ if [[ "${filename#python_asyncio_}" != "${filename}" ]]; then
+ echo "python_asyncio"
+ return
+ fi
+ if [[ "${filename#php7_protobuf_c_}" != "${filename}" ]]; then
+ echo "php7_protobuf_c"
+ return
+ fi
+ echo "${filename%%_*}"
+}
+
+scenarios=(
+ "cpp_generic_async_streaming_ping_pong_secure"
+ "csharp_protobuf_async_unary_ping_pong"
+ "dotnet_protobuf_async_unary_ping_pong"
+ "go_generic_sync_streaming_ping_pong_secure"
+ "java_generic_async_streaming_ping_pong_secure"
+ "node_to_node_generic_async_streaming_ping_pong_secure"
+ "php7_protobuf_php_extension_to_cpp_protobuf_sync_unary_ping_pong"
+ "php7_protobuf_c_extension_to_cpp_protobuf_sync_unary_ping_pong"
+ "python_generic_sync_streaming_ping_pong"
+ "python_asyncio_generic_async_streaming_ping_pong"
+ "ruby_protobuf_sync_streaming_ping_pong"
+)
+
+# Basic examples are intended to be runnable _as is_, so substitution keys
+# are stripped. Fields can be inserted manually following the pattern of the
+# prebuilt examples.
+basic_example() {
+ local -r scenario="${1}"
+ local -r outputdir="${2}"
+ local -r outputfile="$(example_file "${scenario}" _example_loadtest.yaml)"
+ local -r language="$(example_language "${outputfile}")"
+ ${LOADTEST_CONFIG} \
+ -l "${language}" \
+ -t ./tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml \
+ -s client_pool= -s server_pool= -s big_query_table= \
+ -s timeout_seconds=900 --prefix=examples -u basic -r "^${scenario}$" \
+ --allow_client_language=c++ --allow_server_language=c++ \
+ --allow_server_language=node \
+ -o "${outputdir}/${outputfile}"
+ echo "Created example: ${outputdir}/${outputfile}"
+}
+
+# Prebuilt examples contain substitution keys, so must be processed before
+# running.
+prebuilt_example() {
+ local -r scenario="${1}"
+ local -r outputdir="${2}"
+ local -r outputfile="$(example_file "${scenario}" _example_loadtest_with_prebuilt_workers.yaml)"
+ local -r language="$(example_language "${outputfile}")"
+ ${LOADTEST_CONFIG} \
+ -l "${language}" \
+ -t ./tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml \
+ -s driver_pool="\${driver_pool}" -s driver_image="\${driver_image}" \
+ -s client_pool="\${workers_pool}" -s server_pool="\${workers_pool}" \
+ -s big_query_table="\${big_query_table}" -s timeout_seconds=900 \
+ -s prebuilt_image_prefix="\${prebuilt_image_prefix}" \
+ -s prebuilt_image_tag="\${prebuilt_image_tag}" --prefix=examples -u prebuilt \
+ -a pool="\${workers_pool}" -r "^${scenario}$" \
+ --allow_client_language=c++ --allow_server_language=c++ \
+ --allow_server_language=node \
+ -o "${outputdir}/${outputfile}"
+ echo "Created example: ${outputdir}/${outputfile}"
+}
+
+for scenario in "${scenarios[@]}"; do
+ basic_example "${scenario}" "${outputbasedir}"
+done
+
+for scenario in "${scenarios[@]}"; do
+ prebuilt_example "${scenario}" "${outputbasedir}/templates"
+done
diff --git a/grpc/tools/run_tests/performance/loadtest_template.py b/grpc/tools/run_tests/performance/loadtest_template.py
index 9684bb9a..16461e3c 100755
--- a/grpc/tools/run_tests/performance/loadtest_template.py
+++ b/grpc/tools/run_tests/performance/loadtest_template.py
@@ -26,12 +26,13 @@
# https://github.com/grpc/grpc/blob/master/tools/run_tests/performance/README.md
import argparse
+import os
import sys
-
-from typing import Any, Dict, Iterable, Mapping, Type
+from typing import Any, Dict, Iterable, List, Mapping, Type
import yaml
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import loadtest_config
TEMPLATE_FILE_HEADER_COMMENT = """
@@ -48,20 +49,42 @@ TEMPLATE_FILE_HEADER_COMMENT = """
"""
+def insert_worker(worker: Dict[str, Any], workers: List[Dict[str,
+ Any]]) -> None:
+ """Inserts client or server into a list, without inserting duplicates."""
+
+ def dump(w):
+ return yaml.dump(w, Dumper=yaml.SafeDumper, default_flow_style=False)
+
+ worker_str = dump(worker)
+ if any((worker_str == dump(w) for w in workers)):
+ return
+ workers.append(worker)
+
+
+def uniquify_workers(workermap: Dict[str, List[Dict[str, Any]]]) -> None:
+ """Name workers if there is more than one for the same map key."""
+ for workers in list(workermap.values()):
+ if len(workers) <= 1:
+ continue
+ for i, worker in enumerate(workers):
+ worker['name'] = str(i)
+
+
def loadtest_template(
input_file_names: Iterable[str],
metadata: Mapping[str, Any],
inject_client_pool: bool,
+ inject_driver_image: bool,
+ inject_driver_pool: bool,
inject_server_pool: bool,
inject_big_query_table: bool,
inject_timeout_seconds: bool,
inject_ttl_seconds: bool) -> Dict[str, Any]: # yapf: disable
"""Generates the load test template."""
- clients = list()
- servers = list()
- spec = dict()
- client_languages = set()
- server_languages = set()
+ spec = dict() # type: Dict[str, Any]
+ clientmap = dict() # Dict[str, List[Dict[str, Any]]]
+ servermap = dict() # Dict[Str, List[Dict[str, Any]]]
template = {
'apiVersion': 'e2etest.grpc.io/v1',
'kind': 'LoadTest',
@@ -79,20 +102,20 @@ def loadtest_template(
input_file_name, input_config.get('kind')))
for client in input_config['spec']['clients']:
- if client['language'] in client_languages:
- continue
+ del client['name']
if inject_client_pool:
client['pool'] = '${client_pool}'
- clients.append(client)
- client_languages.add(client['language'])
+ if client['language'] not in clientmap:
+ clientmap[client['language']] = []
+ insert_worker(client, clientmap[client['language']])
for server in input_config['spec']['servers']:
- if server['language'] in server_languages:
- continue
+ del server['name']
if inject_server_pool:
server['pool'] = '${server_pool}'
- servers.append(server)
- server_languages.add(server['language'])
+ if server['language'] not in servermap:
+ servermap[server['language']] = []
+ insert_worker(server, servermap[server['language']])
input_spec = input_config['spec']
del input_spec['clients']
@@ -100,14 +123,36 @@ def loadtest_template(
del input_spec['scenariosJSON']
spec.update(input_config['spec'])
- clients.sort(key=lambda x: x['language'])
- servers.sort(key=lambda x: x['language'])
+ uniquify_workers(clientmap)
+ uniquify_workers(servermap)
spec.update({
- 'clients': clients,
- 'servers': servers,
+ 'clients':
+ sum((clientmap[language] for language in sorted(clientmap)),
+ start=[]),
+ 'servers':
+ sum((servermap[language] for language in sorted(servermap)),
+ start=[]),
})
+ if 'driver' not in spec:
+ spec['driver'] = {'language': 'cxx'}
+
+ driver = spec['driver']
+ if 'name' in driver:
+ del driver['name']
+ if inject_driver_image:
+ if 'run' not in driver:
+ driver['run'] = [{'name': 'main'}]
+ driver['run'][0]['image'] = '${driver_image}'
+ if inject_driver_pool:
+ driver['pool'] = '${driver_pool}'
+
+ if 'run' not in driver:
+ if inject_driver_pool:
+ raise ValueError('Cannot inject driver.pool: missing driver.run.')
+ del spec['driver']
+
if inject_big_query_table:
if 'results' not in spec:
spec['results'] = dict()
@@ -133,14 +178,14 @@ def template_dumper(header_comment: str) -> Type[yaml.SafeDumper]:
self.write_indent()
self.write_indicator(header_comment, need_whitespace=False)
- def expect_block_sequence(self):
- super().expect_block_sequence()
- self.increase_indent()
+ def str_presenter(dumper, data):
+ if '\n' in data:
+ return dumper.represent_scalar('tag:yaml.org,2002:str',
+ data,
+ style='|')
+ return dumper.represent_scalar('tag:yaml.org,2002:str', data)
- def expect_block_sequence_item(self, first=False):
- if isinstance(self.event, yaml.SequenceEndEvent):
- self.indent = self.indents.pop()
- super().expect_block_sequence_item(first)
+ TemplateDumper.add_representer(str, str_presenter)
return TemplateDumper
@@ -164,6 +209,14 @@ def main() -> None:
action='store_true',
help='Set spec.client(s).pool values to \'${client_pool}\'.')
argp.add_argument(
+ '--inject_driver_image',
+ action='store_true',
+ help='Set spec.driver(s).image values to \'${driver_image}\'.')
+ argp.add_argument(
+ '--inject_driver_pool',
+ action='store_true',
+ help='Set spec.driver(s).pool values to \'${driver_pool}\'.')
+ argp.add_argument(
'--inject_server_pool',
action='store_true',
help='Set spec.server(s).pool values to \'${server_pool}\'.')
@@ -200,6 +253,8 @@ def main() -> None:
input_file_names=args.inputs,
metadata=metadata,
inject_client_pool=args.inject_client_pool,
+ inject_driver_image=args.inject_driver_image,
+ inject_driver_pool=args.inject_driver_pool,
inject_server_pool=args.inject_server_pool,
inject_big_query_table=args.inject_big_query_table,
inject_timeout_seconds=args.inject_timeout_seconds,
diff --git a/grpc/tools/run_tests/performance/massage_qps_stats.py b/grpc/tools/run_tests/performance/massage_qps_stats.py
index 57de77a7..77c02f62 100644
--- a/grpc/tools/run_tests/performance/massage_qps_stats.py
+++ b/grpc/tools/run_tests/performance/massage_qps_stats.py
@@ -62,11 +62,6 @@ def massage_qps_stats(scenario_result):
stats[
"core_pollset_kick_own_thread"] = massage_qps_stats_helpers.counter(
core_stats, "pollset_kick_own_thread")
- stats["core_syscall_epoll_ctl"] = massage_qps_stats_helpers.counter(
- core_stats, "syscall_epoll_ctl")
- stats[
- "core_pollset_fd_cache_hits"] = massage_qps_stats_helpers.counter(
- core_stats, "pollset_fd_cache_hits")
stats[
"core_histogram_slow_lookups"] = massage_qps_stats_helpers.counter(
core_stats, "histogram_slow_lookups")
@@ -163,6 +158,9 @@ def massage_qps_stats(scenario_result):
"core_http2_initiate_write_due_to_send_settings"] = massage_qps_stats_helpers.counter(
core_stats, "http2_initiate_write_due_to_send_settings")
stats[
+ "core_http2_initiate_write_due_to_settings_ack"] = massage_qps_stats_helpers.counter(
+ core_stats, "http2_initiate_write_due_to_settings_ack")
+ stats[
"core_http2_initiate_write_due_to_bdp_estimator_ping"] = massage_qps_stats_helpers.counter(
core_stats,
"http2_initiate_write_due_to_bdp_estimator_ping")
diff --git a/grpc/tools/run_tests/performance/patch_scenario_results_schema.py b/grpc/tools/run_tests/performance/patch_scenario_results_schema.py
index 694e16af..5d38550e 100755
--- a/grpc/tools/run_tests/performance/patch_scenario_results_schema.py
+++ b/grpc/tools/run_tests/performance/patch_scenario_results_schema.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/grpc/tools/run_tests/performance/prometheus.py b/grpc/tools/run_tests/performance/prometheus.py
new file mode 100644
index 00000000..810f318d
--- /dev/null
+++ b/grpc/tools/run_tests/performance/prometheus.py
@@ -0,0 +1,300 @@
+#!/usr/bin/env python3
+
+# Copyright 2022 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 script to fetch total cpu seconds and memory data from prometheus.
+# example usage: python3 prometheus.py
+# --url=http://prometheus.prometheus.svc.cluster.local:9090
+# --pod_type=driver --pod_type=clients --container_name=main
+# --container_name=sidecar
+"""Perform Prometheus range queries to obtain cpu and memory data.
+
+This module performs range queries through Prometheus API to obtain
+total cpu seconds and memory during a test run for given container
+in given pods. The cpu data obtained is total cpu second used within
+given period of time. The memory data was instant memory usage at
+the query time.
+"""
+import argparse
+import json
+import logging
+import statistics
+from typing import Any, Dict, List
+
+from dateutil import parser
+import requests
+
+
+class Prometheus:
+ """Objects which holds the start time, end time and query URL."""
+
+ def __init__(
+ self,
+ url: str,
+ start: str,
+ end: str,
+ ):
+ self.url = url
+ self.start = start
+ self.end = end
+
+ def _fetch_by_query(self, query: str) -> Dict[str, Any]:
+ """Fetches the given query with time range.
+
+ Fetch the given query within a time range. The pulling
+ interval is every 5s, the actual data from the query is
+ a time series.
+ """
+ resp = requests.get(
+ self.url + '/api/v1/query_range',
+ {
+ 'query': query,
+ 'start': self.start,
+ 'end': self.end,
+ 'step': 5
+ },
+ )
+ resp.raise_for_status()
+ return resp.json()
+
+ def _fetch_cpu_for_pod(self, container_matcher: str,
+ pod_name: str) -> Dict[str, List[float]]:
+ """Fetches the cpu data for each pod.
+
+ Fetch total cpu seconds during the time range specified in the Prometheus instance
+ for a pod. After obtain the cpu seconds, the data are trimmed from time series to
+ a data list and saved in the Dict that keyed by the container names.
+
+ Args:
+ container_matcher: A string consist one or more container name separated by |.
+ """
+ query = (
+ 'container_cpu_usage_seconds_total{job="kubernetes-cadvisor",pod="'
+ + pod_name + '",container=' + container_matcher + '}')
+ logging.debug('running prometheus query for cpu: %s', query)
+ cpu_data = self._fetch_by_query(query)
+ logging.debug('raw cpu data: %s', str(cpu_data))
+ cpu_container_name_to_data_list = get_data_list_from_timeseries(
+ cpu_data)
+ return cpu_container_name_to_data_list
+
+ def _fetch_memory_for_pod(self, container_matcher: str,
+ pod_name: str) -> Dict[str, List[float]]:
+ """Fetches memory data for each pod.
+
+ Fetch total memory data during the time range specified in the Prometheus instance
+ for a pod. After obtain the memory data, the data are trimmed from time series to
+ a data list and saved in the Dict that keyed by the container names.
+
+ Args:
+ container_matcher: A string consist one or more container name separated by |.
+ """
+ query = (
+ 'container_memory_usage_bytes{job="kubernetes-cadvisor",pod="' +
+ pod_name + '",container=' + container_matcher + "}")
+
+ logging.debug('running prometheus query for memory: %s', query)
+ memory_data = self._fetch_by_query(query)
+
+ logging.debug('raw memory data: %s', str(memory_data))
+ memory_container_name_to_data_list = get_data_list_from_timeseries(
+ memory_data)
+
+ return memory_container_name_to_data_list
+
+ def fetch_cpu_and_memory_data(
+ self, container_list: List[str],
+ pod_dict: Dict[str, List[str]]) -> Dict[str, Any]:
+ """Fetch total cpu seconds and memory data for multiple pods.
+
+ Args:
+ container_list: A list of container names to fetch the data for.
+ pod_dict: the pods to fetch data for, the pod_dict is keyed by
+ role of the pod: clients, driver and servers. The values
+ for the pod_dict are the list of pod names that consist
+ the same role specified in the key.
+ """
+ container_matcher = construct_container_matcher(container_list)
+ processed_data = {}
+ for role, pod_names in pod_dict.items():
+ pod_data = {}
+ for pod in pod_names:
+ container_data = {}
+ for container, data in self._fetch_cpu_for_pod(
+ container_matcher, pod).items():
+ container_data[container] = {}
+ container_data[container][
+ 'cpuSeconds'] = compute_total_cpu_seconds(data)
+
+ for container, data in self._fetch_memory_for_pod(
+ container_matcher, pod).items():
+ container_data[container][
+ 'memoryMean'] = compute_average_memory_usage(data)
+
+ pod_data[pod] = container_data
+ processed_data[role] = pod_data
+ return processed_data
+
+
+def construct_container_matcher(container_list: List[str]) -> str:
+ """Constructs the container matching string used in the
+ prometheus query."""
+ if len(container_list) == 0:
+ raise Exception('no container name provided')
+
+ containers_to_fetch = '"'
+ if len(container_list) == 1:
+ containers_to_fetch = container_list[0]
+ else:
+ containers_to_fetch = '~"' + container_list[0]
+ for container in container_list[1:]:
+ containers_to_fetch = containers_to_fetch + '|' + container
+ containers_to_fetch = containers_to_fetch + '"'
+ return containers_to_fetch
+
+
+def get_data_list_from_timeseries(data: Any) -> Dict[str, List[float]]:
+ """Constructs a Dict as keys are the container names and
+ values are a list of data taken from given timeseries data."""
+ if data['status'] != 'success':
+ raise Exception('command failed: ' + data['status'] + str(data))
+ if data['data']['resultType'] != 'matrix':
+ raise Exception('resultType is not matrix: ' +
+ data['data']['resultType'])
+
+ container_name_to_data_list = {}
+ for res in data["data"]["result"]:
+ container_name = res["metric"]["container"]
+ container_data_timeseries = res["values"]
+
+ container_data = []
+ for d in container_data_timeseries:
+ container_data.append(float(d[1]))
+ container_name_to_data_list[container_name] = container_data
+ return container_name_to_data_list
+
+
+def compute_total_cpu_seconds(cpu_data_list: List[float]) -> float:
+ """Computes the total cpu seconds by CPUs[end]-CPUs[start]."""
+ return cpu_data_list[len(cpu_data_list) - 1] - cpu_data_list[0]
+
+
+def compute_average_memory_usage(memory_data_list: List[float]) -> float:
+ """Computes the mean and for a given list of data."""
+ return statistics.mean(memory_data_list)
+
+
+def construct_pod_dict(node_info_file: str,
+ pod_types: List[str]) -> Dict[str, List[str]]:
+ """Constructs a dict of pod names to be queried.
+
+ Args:
+ node_info_file: The file path contains the pod names to query.
+ The pods' names are put into a Dict of list that keyed by the
+ role name: clients, servers and driver.
+ """
+ with open(node_info_file, 'r') as f:
+ pod_names = json.load(f)
+ pod_type_to_name = {'clients': [], 'driver': [], 'servers': []}
+
+ for client in pod_names['Clients']:
+ pod_type_to_name['clients'].append(client['Name'])
+ for server in pod_names['Servers']:
+ pod_type_to_name['servers'].append(server['Name'])
+
+ pod_type_to_name["driver"].append(pod_names['Driver']['Name'])
+
+ pod_names_to_query = {}
+ for pod_type in pod_types:
+ pod_names_to_query[pod_type] = pod_type_to_name[pod_type]
+ return pod_names_to_query
+
+
+def convert_UTC_to_epoch(utc_timestamp: str) -> str:
+ """Converts a utc timestamp string to epoch time string."""
+ parsed_time = parser.parse(utc_timestamp)
+ epoch = parsed_time.strftime('%s')
+ return epoch
+
+
+def main() -> None:
+ argp = argparse.ArgumentParser(
+ description='Fetch cpu and memory stats from prometheus')
+ argp.add_argument('--url', help='Prometheus base url', required=True)
+ argp.add_argument(
+ '--scenario_result_file',
+ default='scenario_result.json',
+ type=str,
+ help='File contains epoch seconds for start and end time',
+ )
+ argp.add_argument(
+ '--node_info_file',
+ default='/var/data/qps_workers/node_info.json',
+ help='File contains pod name to query the metrics for',
+ )
+ argp.add_argument(
+ '--pod_type',
+ action='append',
+ help=
+ 'Pod type to query the metrics for, the options are driver, client and server',
+ choices=['driver', 'clients', 'servers'],
+ required=True,
+ )
+ argp.add_argument(
+ '--container_name',
+ action='append',
+ help='The container names to query the metrics for',
+ required=True,
+ )
+ argp.add_argument(
+ '--export_file_name',
+ default='prometheus_query_result.json',
+ type=str,
+ help='Name of exported JSON file.',
+ )
+ argp.add_argument(
+ '--quiet',
+ default=False,
+ help='Suppress informative output',
+ )
+ args = argp.parse_args()
+
+ if not args.quiet:
+ logging.getLogger().setLevel(logging.DEBUG)
+
+ with open(args.scenario_result_file, 'r') as q:
+ scenario_result = json.load(q)
+ start_time = convert_UTC_to_epoch(
+ scenario_result['summary']['startTime'])
+ end_time = convert_UTC_to_epoch(scenario_result['summary']['endTime'])
+ p = Prometheus(
+ url=args.url,
+ start=start_time,
+ end=end_time,
+ )
+
+ pod_dict = construct_pod_dict(args.node_info_file, args.pod_type)
+ processed_data = p.fetch_cpu_and_memory_data(
+ container_list=args.container_name, pod_dict=pod_dict)
+ processed_data['testDurationSeconds'] = float(end_time) - float(start_time)
+
+ logging.debug(json.dumps(processed_data, sort_keys=True, indent=4))
+
+ with open(args.export_file_name, 'w', encoding='utf8') as export_file:
+ json.dump(processed_data, export_file, sort_keys=True, indent=4)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/grpc/tools/run_tests/performance/run_worker_csharp.sh b/grpc/tools/run_tests/performance/run_worker_csharp.sh
index af944f9f..e242c5a0 100755
--- a/grpc/tools/run_tests/performance/run_worker_csharp.sh
+++ b/grpc/tools/run_tests/performance/run_worker_csharp.sh
@@ -18,6 +18,6 @@ set -ex
cd "$(dirname "$0")/../../.."
# needed to correctly locate testca
-cd src/csharp/Grpc.IntegrationTesting.QpsWorker/bin/Release/netcoreapp2.1
+cd src/csharp/Grpc.IntegrationTesting.QpsWorker/bin/Release/netcoreapp3.1
dotnet exec Grpc.IntegrationTesting.QpsWorker.dll "$@"
diff --git a/grpc/tools/run_tests/performance/scenario_config.py b/grpc/tools/run_tests/performance/scenario_config.py
index 52d63f36..9e536d82 100644
--- a/grpc/tools/run_tests/performance/scenario_config.py
+++ b/grpc/tools/run_tests/performance/scenario_config.py
@@ -24,7 +24,7 @@ SMOKETEST = 'smoketest'
SCALABLE = 'scalable'
INPROC = 'inproc'
SWEEP = 'sweep'
-DEFAULT_CATEGORIES = [SCALABLE, SMOKETEST]
+DEFAULT_CATEGORIES = (SCALABLE, SMOKETEST)
SECURE_SECARGS = {
'use_test_ca': True,
@@ -127,13 +127,13 @@ def _ping_pong_scenario(name,
server_threads_per_cq=0,
client_threads_per_cq=0,
warmup_seconds=WARMUP_SECONDS,
- categories=DEFAULT_CATEGORIES,
+ categories=None,
channels=None,
outstanding=None,
num_clients=None,
resource_quota_size=None,
messages_per_stream=None,
- excluded_poll_engines=[],
+ excluded_poll_engines=None,
minimal_stack=False,
offered_load=None):
"""Creates a basic ping pong scenario."""
@@ -162,7 +162,9 @@ def _ping_pong_scenario(name,
'channel_args': [],
},
'warmup_seconds': warmup_seconds,
- 'benchmark_seconds': BENCHMARK_SECONDS
+ 'benchmark_seconds': BENCHMARK_SECONDS,
+ 'CATEGORIES': list(DEFAULT_CATEGORIES),
+ 'EXCLUDED_POLL_ENGINES': [],
}
if resource_quota_size:
scenario['server_config']['resource_quota_size'] = resource_quota_size
@@ -232,10 +234,18 @@ def _ping_pong_scenario(name,
return scenario
-class CXXLanguage:
+class Language(object):
- def __init__(self):
- self.safename = 'cxx'
+ @property
+ def safename(self):
+ return str(self)
+
+
+class CXXLanguage(Language):
+
+ @property
+ def safename(self):
+ return 'cxx'
def worker_cmdline(self):
return ['cmake/build/qps_worker']
@@ -257,7 +267,7 @@ class CXXLanguage:
channels=1,
num_clients=1,
secure=False,
- categories=[INPROC] + [SCALABLE])
+ categories=[SWEEP])
yield _ping_pong_scenario(
'cpp_protobuf_async_streaming_from_client_1channel_1MB',
@@ -271,8 +281,10 @@ class CXXLanguage:
channels=1,
num_clients=1,
secure=False,
- categories=[SMOKETEST] + [INPROC] + [SCALABLE])
+ categories=[SWEEP])
+ # Scenario was added in https://github.com/grpc/grpc/pull/12987, but its purpose is unclear
+ # (beyond excercising some params that other scenarios don't)
yield _ping_pong_scenario(
'cpp_protobuf_async_unary_75Kqps_600channel_60Krpcs_300Breq_50Bresp',
rpc_type='UNARY',
@@ -313,11 +325,13 @@ class CXXLanguage:
unconstrained_client='async',
use_generic_payload=True,
secure=secure,
+ client_threads_per_cq=2,
+ server_threads_per_cq=2,
minimal_stack=not secure,
categories=smoketest_categories + inproc_categories +
[SCALABLE])
- for mps in geometric_progression(1, 20, 10):
+ for mps in geometric_progression(10, 20, 10):
yield _ping_pong_scenario(
'cpp_generic_async_streaming_qps_unconstrained_%smps_%s' %
(mps, secstr),
@@ -385,21 +399,7 @@ class CXXLanguage:
secure=secure,
client_threads_per_cq=1000000,
server_threads_per_cq=1000000,
- categories=smoketest_categories + inproc_categories +
- [SCALABLE])
-
- yield _ping_pong_scenario(
- 'cpp_generic_async_streaming_qps_unconstrained_2waysharedcq_%s'
- % secstr,
- rpc_type='STREAMING',
- client_type='ASYNC_CLIENT',
- server_type='ASYNC_GENERIC_SERVER',
- unconstrained_client='async',
- use_generic_payload=True,
- secure=secure,
- client_threads_per_cq=2,
- server_threads_per_cq=2,
- categories=inproc_categories + [SCALABLE])
+ categories=[SWEEP])
yield _ping_pong_scenario(
'cpp_protobuf_async_streaming_qps_unconstrained_1cq_%s' %
@@ -414,18 +414,6 @@ class CXXLanguage:
categories=inproc_categories + [SCALABLE])
yield _ping_pong_scenario(
- 'cpp_protobuf_async_streaming_qps_unconstrained_2waysharedcq_%s'
- % secstr,
- rpc_type='STREAMING',
- client_type='ASYNC_CLIENT',
- server_type='ASYNC_SERVER',
- unconstrained_client='async',
- secure=secure,
- client_threads_per_cq=2,
- server_threads_per_cq=2,
- categories=inproc_categories + [SCALABLE])
-
- yield _ping_pong_scenario(
'cpp_protobuf_async_unary_qps_unconstrained_1cq_%s' % secstr,
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
@@ -434,19 +422,6 @@ class CXXLanguage:
secure=secure,
client_threads_per_cq=1000000,
server_threads_per_cq=1000000,
- categories=smoketest_categories + inproc_categories +
- [SCALABLE])
-
- yield _ping_pong_scenario(
- 'cpp_protobuf_async_unary_qps_unconstrained_2waysharedcq_%s' %
- secstr,
- rpc_type='UNARY',
- client_type='ASYNC_CLIENT',
- server_type='ASYNC_SERVER',
- unconstrained_client='async',
- secure=secure,
- client_threads_per_cq=2,
- server_threads_per_cq=2,
categories=inproc_categories + [SCALABLE])
yield _ping_pong_scenario(
@@ -458,7 +433,8 @@ class CXXLanguage:
use_generic_payload=True,
async_server_threads=1,
minimal_stack=not secure,
- secure=secure)
+ secure=secure,
+ categories=[SWEEP])
yield _ping_pong_scenario(
'cpp_protobuf_async_client_sync_server_unary_qps_unconstrained_%s'
@@ -495,8 +471,7 @@ class CXXLanguage:
unconstrained_client='async',
secure=secure,
minimal_stack=not secure,
- categories=smoketest_categories + inproc_categories +
- [SCALABLE])
+ categories=[SWEEP])
yield _ping_pong_scenario(
'cpp_protobuf_async_unary_ping_pong_%s_1MB' % secstr,
@@ -540,6 +515,13 @@ class CXXLanguage:
minimal_stack=not secure,
categories=[SWEEP])
+ maybe_scalable = [SCALABLE]
+ if rpc_type == 'streaming_from_server' and synchronicity == 'async' and secure:
+ # protobuf_async_streaming_from_server_qps_unconstrained_secure is very flaky
+ # and has extremely high variance so running it isn't really useful.
+ # see b/198275705
+ maybe_scalable = [SWEEP]
+
yield _ping_pong_scenario(
'cpp_protobuf_%s_%s_qps_unconstrained_%s' %
(synchronicity, rpc_type, secstr),
@@ -549,9 +531,9 @@ class CXXLanguage:
unconstrained_client=synchronicity,
secure=secure,
minimal_stack=not secure,
- server_threads_per_cq=3,
- client_threads_per_cq=3,
- categories=inproc_categories + [SCALABLE])
+ server_threads_per_cq=2,
+ client_threads_per_cq=2,
+ categories=inproc_categories + maybe_scalable)
# TODO(vjpai): Re-enable this test. It has a lot of timeouts
# and hasn't yet been conclusively identified as a test failure
@@ -567,7 +549,7 @@ class CXXLanguage:
# resource_quota_size=500*1024)
if rpc_type == 'streaming':
- for mps in geometric_progression(1, 20, 10):
+ for mps in geometric_progression(10, 20, 10):
yield _ping_pong_scenario(
'cpp_protobuf_%s_%s_qps_unconstrained_%smps_%s'
% (synchronicity, rpc_type, mps, secstr),
@@ -619,10 +601,8 @@ class CXXLanguage:
return 'c++'
-class CSharpLanguage:
-
- def __init__(self):
- self.safename = str(self)
+class CSharpLanguage(Language):
+ """The legacy Grpc.Core implementation from grpc/grpc."""
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_csharp.sh']
@@ -747,10 +727,135 @@ class CSharpLanguage:
return 'csharp'
-class PythonLanguage:
+class DotnetLanguage(Language):
+ """The pure C# implementation from grpc/grpc-dotnet."""
+
+ def worker_cmdline(self):
+ # grpc-dotnet worker is only supported by the new GKE based OSS benchmark
+ # framework, and the worker_cmdline() is only used by run_performance_tests.py
+ return ['grpc_dotnet_not_supported_by_legacy_performance_runner.sh']
+
+ def worker_port_offset(self):
+ return 1100
+
+ def scenarios(self):
+ yield _ping_pong_scenario('dotnet_generic_async_streaming_ping_pong',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_GENERIC_SERVER',
+ use_generic_payload=True,
+ categories=[SMOKETEST, SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'dotnet_generic_async_streaming_ping_pong_insecure_1MB',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_GENERIC_SERVER',
+ req_size=1024 * 1024,
+ resp_size=1024 * 1024,
+ use_generic_payload=True,
+ secure=False,
+ categories=[SMOKETEST, SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'dotnet_generic_async_streaming_qps_unconstrained_insecure',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_GENERIC_SERVER',
+ unconstrained_client='async',
+ use_generic_payload=True,
+ secure=False,
+ categories=[SMOKETEST, SCALABLE])
+
+ yield _ping_pong_scenario('dotnet_protobuf_async_streaming_ping_pong',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER')
+
+ yield _ping_pong_scenario('dotnet_protobuf_async_unary_ping_pong',
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ categories=[SMOKETEST, SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'dotnet_protobuf_sync_to_async_unary_ping_pong',
+ rpc_type='UNARY',
+ client_type='SYNC_CLIENT',
+ server_type='ASYNC_SERVER')
+
+ yield _ping_pong_scenario(
+ 'dotnet_protobuf_async_unary_qps_unconstrained',
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ unconstrained_client='async',
+ categories=[SMOKETEST, SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'dotnet_protobuf_async_streaming_qps_unconstrained',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ unconstrained_client='async',
+ categories=[SCALABLE])
+
+ yield _ping_pong_scenario('dotnet_to_cpp_protobuf_sync_unary_ping_pong',
+ rpc_type='UNARY',
+ client_type='SYNC_CLIENT',
+ server_type='SYNC_SERVER',
+ server_language='c++',
+ async_server_threads=1,
+ categories=[SMOKETEST, SCALABLE])
- def __init__(self):
- self.safename = 'python'
+ yield _ping_pong_scenario(
+ 'dotnet_to_cpp_protobuf_async_streaming_ping_pong',
+ rpc_type='STREAMING',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ server_language='c++',
+ async_server_threads=1)
+
+ yield _ping_pong_scenario(
+ 'dotnet_to_cpp_protobuf_async_unary_qps_unconstrained',
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ unconstrained_client='async',
+ server_language='c++',
+ categories=[SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'dotnet_to_cpp_protobuf_sync_to_async_unary_qps_unconstrained',
+ rpc_type='UNARY',
+ client_type='SYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ unconstrained_client='sync',
+ server_language='c++',
+ categories=[SCALABLE])
+
+ yield _ping_pong_scenario(
+ 'cpp_to_dotnet_protobuf_async_unary_qps_unconstrained',
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ unconstrained_client='async',
+ client_language='c++',
+ categories=[SCALABLE])
+
+ yield _ping_pong_scenario('dotnet_protobuf_async_unary_ping_pong_1MB',
+ rpc_type='UNARY',
+ client_type='ASYNC_CLIENT',
+ server_type='ASYNC_SERVER',
+ req_size=1024 * 1024,
+ resp_size=1024 * 1024,
+ categories=[SMOKETEST, SCALABLE])
+
+ def __str__(self):
+ return 'dotnet'
+
+
+class PythonLanguage(Language):
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_python.sh']
@@ -824,10 +929,7 @@ class PythonLanguage:
return 'python'
-class PythonAsyncIOLanguage:
-
- def __init__(self):
- self.safename = 'python_asyncio'
+class PythonAsyncIOLanguage(Language):
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_python_asyncio.sh']
@@ -972,11 +1074,7 @@ class PythonAsyncIOLanguage:
return 'python_asyncio'
-class RubyLanguage:
-
- def __init__(self):
- pass
- self.safename = str(self)
+class RubyLanguage(Language):
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_ruby.sh']
@@ -1037,12 +1135,11 @@ class RubyLanguage:
return 'ruby'
-class Php7Language:
+class Php7Language(Language):
def __init__(self, php7_protobuf_c=False):
- pass
+ super().__init__()
self.php7_protobuf_c = php7_protobuf_c
- self.safename = str(self)
def worker_cmdline(self):
if self.php7_protobuf_c:
@@ -1108,11 +1205,7 @@ class Php7Language:
return 'php7'
-class JavaLanguage:
-
- def __init__(self):
- pass
- self.safename = str(self)
+class JavaLanguage(Language):
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_java.sh']
@@ -1212,11 +1305,7 @@ class JavaLanguage:
return 'java'
-class GoLanguage:
-
- def __init__(self):
- pass
- self.safename = str(self)
+class GoLanguage(Language):
def worker_cmdline(self):
return ['tools/run_tests/performance/run_worker_go.sh']
@@ -1297,12 +1386,11 @@ class GoLanguage:
return 'go'
-class NodeLanguage:
+class NodeLanguage(Language):
def __init__(self, node_purejs=False):
- pass
+ super().__init__()
self.node_purejs = node_purejs
- self.safename = str(self)
def worker_cmdline(self):
fixture = 'native_js' if self.node_purejs else 'native_native'
@@ -1519,6 +1607,7 @@ class RustLanguage:
LANGUAGES = {
'c++': CXXLanguage(),
'csharp': CSharpLanguage(),
+ 'dotnet': DotnetLanguage(),
'ruby': RubyLanguage(),
'rust': RustLanguage(),
'php7': Php7Language(),
diff --git a/grpc/tools/run_tests/performance/scenario_config_exporter.py b/grpc/tools/run_tests/performance/scenario_config_exporter.py
index d8837fdb..a5becefc 100755
--- a/grpc/tools/run_tests/performance/scenario_config_exporter.py
+++ b/grpc/tools/run_tests/performance/scenario_config_exporter.py
@@ -42,23 +42,18 @@ import collections
import json
import re
import sys
-
from typing import Any, Callable, Dict, Iterable, NamedTuple
import scenario_config
# Language parameters for load test config generation.
+
LanguageConfig = NamedTuple('LanguageConfig', [('category', str),
('language', str),
('client_language', str),
('server_language', str)])
-def as_dict_no_empty_values(self):
- """Returns the parameters as a dictionary, ignoring empty values."""
- return dict((item for item in self._asdict().items() if item[1]))
-
-
def category_string(categories: Iterable[str], category: str) -> str:
"""Converts a list of categories into a single string for counting."""
if category != 'all':
diff --git a/grpc/tools/run_tests/performance/scenario_result_schema.json b/grpc/tools/run_tests/performance/scenario_result_schema.json
index 8b8ebb9b..50cc0acb 100644
--- a/grpc/tools/run_tests/performance/scenario_result_schema.json
+++ b/grpc/tools/run_tests/performance/scenario_result_schema.json
@@ -2,1898 +2,2051 @@
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "buildNumber",
+ "mode": "NULLABLE",
+ "name": "buildNumber",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "buildUrl",
+ "mode": "NULLABLE",
+ "name": "buildUrl",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "jobName",
+ "mode": "NULLABLE",
+ "name": "jobName",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "gitCommit",
+ "mode": "NULLABLE",
+ "name": "gitCommit",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "gitActualCommit",
+ "mode": "NULLABLE",
+ "name": "gitActualCommit",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "created",
+ "mode": "NULLABLE",
+ "name": "created",
"type": "TIMESTAMP"
}
- ],
- "mode": "NULLABLE",
- "name": "metadata",
+ ],
+ "mode": "NULLABLE",
+ "name": "metadata",
"type": "RECORD"
- },
+ },
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "name",
+ "mode": "NULLABLE",
+ "name": "name",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientConfig",
+ "mode": "NULLABLE",
+ "name": "clientConfig",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "numClients",
+ "mode": "NULLABLE",
+ "name": "numClients",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverConfig",
+ "mode": "NULLABLE",
+ "name": "serverConfig",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "numServers",
+ "mode": "NULLABLE",
+ "name": "numServers",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "warmupSeconds",
+ "mode": "NULLABLE",
+ "name": "warmupSeconds",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "benchmarkSeconds",
+ "mode": "NULLABLE",
+ "name": "benchmarkSeconds",
"type": "INTEGER"
}
- ],
- "mode": "NULLABLE",
- "name": "scenario",
+ ],
+ "mode": "NULLABLE",
+ "name": "scenario",
"type": "RECORD"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latencies",
+ "mode": "NULLABLE",
+ "name": "latencies",
"type": "STRING"
- },
+ },
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "latencies",
+ "mode": "NULLABLE",
+ "name": "latencies",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "timeElapsed",
+ "mode": "NULLABLE",
+ "name": "timeElapsed",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "timeUser",
+ "mode": "NULLABLE",
+ "name": "timeUser",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "timeSystem",
+ "mode": "NULLABLE",
+ "name": "timeSystem",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "cqPollCount",
+ "mode": "NULLABLE",
+ "name": "cqPollCount",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_calls_created",
+ "mode": "NULLABLE",
+ "name": "core_client_calls_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_calls_created",
+ "mode": "NULLABLE",
+ "name": "core_server_calls_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cqs_created",
+ "mode": "NULLABLE",
+ "name": "core_cqs_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_channels_created",
+ "mode": "NULLABLE",
+ "name": "core_client_channels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_subchannels_created",
+ "mode": "NULLABLE",
+ "name": "core_client_subchannels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_channels_created",
+ "mode": "NULLABLE",
+ "name": "core_server_channels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_poll",
+ "mode": "NULLABLE",
+ "name": "core_syscall_poll",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_wait",
+ "mode": "NULLABLE",
+ "name": "core_syscall_wait",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kicked_without_poller",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kicked_without_poller",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kicked_again",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kicked_again",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_wakeup_fd",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_wakeup_fd",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_wakeup_cv",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_wakeup_cv",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_own_thread",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_own_thread",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_epoll_ctl",
+ "mode": "NULLABLE",
+ "name": "core_histogram_slow_lookups",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_fd_cache_hits",
+ "mode": "NULLABLE",
+ "name": "core_syscall_write",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_histogram_slow_lookups",
+ "mode": "NULLABLE",
+ "name": "core_syscall_read",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_write",
+ "mode": "NULLABLE",
+ "name": "core_tcp_backup_pollers_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_read",
+ "mode": "NULLABLE",
+ "name": "core_tcp_backup_poller_polls",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_backup_pollers_created",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_batches",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_backup_poller_polls",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_cancel",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_batches",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_cancel",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_settings_writes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_pings_sent",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_settings_writes",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_begun",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_pings_sent",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_offloaded",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_begun",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_continued",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_offloaded",
+ "mode": "NULLABLE",
+ "name": "core_http2_partial_writes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_continued",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_initial_write",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_partial_writes",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_start_new_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_initial_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_start_new_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_retry_send_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_continue_pings",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_retry_send_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_goaway_sent",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_continue_pings",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_rst_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_goaway_sent",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_close_from_api",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_rst_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_stream_flow_control",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_close_from_api",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_transport_flow_control",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_stream_flow_control",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_settings",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_transport_flow_control",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_settings_ack",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_settings",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_bdp_estimator_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_bdp_estimator_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_application_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_application_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_keepalive_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_keepalive_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_ping_response",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_ping_response",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_force_rst_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_force_rst_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_spurious_writes_begun",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_spurious_writes_begun",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_indexed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_indexed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_incidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_incidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_incidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_incidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_notidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_notidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_notidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_notidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_nvridx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_nvridx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_nvridx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_nvridx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_uncompressed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_uncompressed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_huffman",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_huffman",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_binary",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_binary",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_binary_base64",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_binary_base64",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_indexed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_indexed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_incidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_incidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_incidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_incidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_notidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_notidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_notidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_notidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_nvridx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_nvridx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_nvridx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_nvridx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_uncompressed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_uncompressed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_huffman",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_huffman",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_binary",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_binary",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_binary_base64",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_binary_base64",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_initiated",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_scheduled_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_scheduled_items",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_scheduled_final_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_scheduled_final_items",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_offloaded",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_offloaded",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_locks_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_locks_initiated",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_locks_scheduled_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_locks_scheduled_items",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_set_notify_on_cancel",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_set_notify_on_cancel",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_cancelled",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_cancelled",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_short_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_short_items",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_long_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_long_items",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_to_self",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_to_self",
+ "mode": "NULLABLE",
+ "name": "core_executor_wakeup_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_wakeup_initiated",
+ "mode": "NULLABLE",
+ "name": "core_executor_queue_drained",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_queue_drained",
+ "mode": "NULLABLE",
+ "name": "core_executor_push_retries",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_push_retries",
+ "mode": "NULLABLE",
+ "name": "core_server_requested_calls",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_requested_calls",
+ "mode": "NULLABLE",
+ "name": "core_server_slowpath_requests_queued",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_slowpath_requests_queued",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_trylock_failures",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_trylock_failures",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_trylock_successes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_trylock_successes",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_transient_pop_failures",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_transient_pop_failures",
- "type": "INTEGER"
- },
- {
- "mode": "NULLABLE",
- "name": "core_call_initial_size",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_bkts",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_50p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_95p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_99p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_bkts",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_50p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_95p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_99p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_99p",
"type": "FLOAT"
}
- ],
- "mode": "REPEATED",
- "name": "clientStats",
+ ],
+ "mode": "REPEATED",
+ "name": "clientStats",
"type": "RECORD"
- },
+ },
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "timeElapsed",
+ "mode": "NULLABLE",
+ "name": "timeElapsed",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "timeUser",
+ "mode": "NULLABLE",
+ "name": "timeUser",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "timeSystem",
+ "mode": "NULLABLE",
+ "name": "timeSystem",
"type": "FLOAT"
- },
- {
- "mode": "NULLABLE",
- "name": "cqPollCount",
- "type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_calls_created",
+ "mode": "NULLABLE",
+ "name": "cqPollCount",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_calls_created",
+ "mode": "NULLABLE",
+ "name": "core_client_calls_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cqs_created",
+ "mode": "NULLABLE",
+ "name": "core_server_calls_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_channels_created",
+ "mode": "NULLABLE",
+ "name": "core_cqs_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_client_subchannels_created",
+ "mode": "NULLABLE",
+ "name": "core_client_channels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_channels_created",
+ "mode": "NULLABLE",
+ "name": "core_client_subchannels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_poll",
+ "mode": "NULLABLE",
+ "name": "core_server_channels_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_wait",
+ "mode": "NULLABLE",
+ "name": "core_syscall_poll",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick",
+ "mode": "NULLABLE",
+ "name": "core_syscall_wait",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kicked_without_poller",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kicked_again",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kicked_without_poller",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_wakeup_fd",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kicked_again",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_wakeup_cv",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_wakeup_fd",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_kick_own_thread",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_wakeup_cv",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_epoll_ctl",
+ "mode": "NULLABLE",
+ "name": "core_pollset_kick_own_thread",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_pollset_fd_cache_hits",
+ "mode": "NULLABLE",
+ "name": "core_histogram_slow_lookups",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_histogram_slow_lookups",
+ "mode": "NULLABLE",
+ "name": "core_syscall_write",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_write",
+ "mode": "NULLABLE",
+ "name": "core_syscall_read",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_syscall_read",
+ "mode": "NULLABLE",
+ "name": "core_tcp_backup_pollers_created",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_backup_pollers_created",
+ "mode": "NULLABLE",
+ "name": "core_tcp_backup_poller_polls",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_backup_poller_polls",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_batches",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_batches",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_cancel",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_cancel",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_send_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_send_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_op_recv_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_op_recv_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_settings_writes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_settings_writes",
+ "mode": "NULLABLE",
+ "name": "core_http2_pings_sent",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_pings_sent",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_begun",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_begun",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_offloaded",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_offloaded",
+ "mode": "NULLABLE",
+ "name": "core_http2_writes_continued",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_writes_continued",
+ "mode": "NULLABLE",
+ "name": "core_http2_partial_writes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_partial_writes",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_initial_write",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_initial_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_start_new_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_start_new_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_message",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_message",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_initial_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_initial_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_trailing_metadata",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_trailing_metadata",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_retry_send_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_retry_send_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_continue_pings",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_continue_pings",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_goaway_sent",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_goaway_sent",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_rst_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_rst_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_close_from_api",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_close_from_api",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_stream_flow_control",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_stream_flow_control",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_transport_flow_control",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_transport_flow_control",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_send_settings",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_send_settings",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_settings_ack",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_bdp_estimator_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_bdp_estimator_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_setting",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_flow_control_unstalled_by_update",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_application_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_application_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_keepalive_ping",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_keepalive_ping",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_transport_flow_control_unstalled",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_ping_response",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_ping_response",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_initiate_write_due_to_force_rst_stream",
+ "mode": "NULLABLE",
+ "name": "core_http2_initiate_write_due_to_force_rst_stream",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_spurious_writes_begun",
+ "mode": "NULLABLE",
+ "name": "core_http2_spurious_writes_begun",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_indexed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_indexed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_incidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_incidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_incidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_incidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_notidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_notidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_notidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_notidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_nvridx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_nvridx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_lithdr_nvridx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_lithdr_nvridx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_uncompressed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_uncompressed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_huffman",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_huffman",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_binary",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_binary",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_recv_binary_base64",
+ "mode": "NULLABLE",
+ "name": "core_hpack_recv_binary_base64",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_indexed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_indexed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_incidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_incidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_incidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_incidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_notidx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_notidx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_notidx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_notidx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_nvridx",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_nvridx",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_lithdr_nvridx_v",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_lithdr_nvridx_v",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_uncompressed",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_uncompressed",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_huffman",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_huffman",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_binary",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_binary",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_hpack_send_binary_base64",
+ "mode": "NULLABLE",
+ "name": "core_hpack_send_binary_base64",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_initiated",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_scheduled_items",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_scheduled_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_scheduled_final_items",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_scheduled_final_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_combiner_locks_offloaded",
+ "mode": "NULLABLE",
+ "name": "core_combiner_locks_offloaded",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_locks_initiated",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_locks_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_locks_scheduled_items",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_locks_scheduled_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_set_notify_on_cancel",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_set_notify_on_cancel",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_combiner_cancelled",
+ "mode": "NULLABLE",
+ "name": "core_call_combiner_cancelled",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_short_items",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_short_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_long_items",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_long_items",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_scheduled_to_self",
+ "mode": "NULLABLE",
+ "name": "core_executor_scheduled_to_self",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_wakeup_initiated",
+ "mode": "NULLABLE",
+ "name": "core_executor_wakeup_initiated",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_queue_drained",
+ "mode": "NULLABLE",
+ "name": "core_executor_queue_drained",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_executor_push_retries",
+ "mode": "NULLABLE",
+ "name": "core_executor_push_retries",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_requested_calls",
+ "mode": "NULLABLE",
+ "name": "core_server_requested_calls",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_slowpath_requests_queued",
+ "mode": "NULLABLE",
+ "name": "core_server_slowpath_requests_queued",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_trylock_failures",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_trylock_failures",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_trylock_successes",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_trylock_successes",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_cq_ev_queue_transient_pop_failures",
+ "mode": "NULLABLE",
+ "name": "core_cq_ev_queue_transient_pop_failures",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_call_initial_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_call_initial_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_bkts",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_50p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_95p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_poll_events_returned_99p",
+ "mode": "NULLABLE",
+ "name": "core_poll_events_returned_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_write_iov_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_write_iov_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_tcp_read_offer_iov_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_tcp_read_offer_iov_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_size_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_size_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_initial_metadata_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_initial_metadata_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_message_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_message_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_trailing_metadata_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_trailing_metadata_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_bkts",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_50p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_95p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_http2_send_flowctl_per_write_99p",
+ "mode": "NULLABLE",
+ "name": "core_http2_send_flowctl_per_write_99p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_bkts",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_bkts",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_50p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_50p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_95p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_95p",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "core_server_cqs_checked_99p",
+ "mode": "NULLABLE",
+ "name": "core_server_cqs_checked_99p",
"type": "FLOAT"
}
- ],
- "mode": "REPEATED",
- "name": "serverStats",
+ ],
+ "mode": "REPEATED",
+ "name": "serverStats",
"type": "RECORD"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverCores",
+ "mode": "NULLABLE",
+ "name": "serverCores",
"type": "STRING"
- },
+ },
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "qps",
+ "mode": "NULLABLE",
+ "name": "qps",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "qpsPerServerCore",
+ "mode": "NULLABLE",
+ "name": "qpsPerServerCore",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverSystemTime",
+ "mode": "NULLABLE",
+ "name": "serverSystemTime",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverUserTime",
+ "mode": "NULLABLE",
+ "name": "serverUserTime",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientSystemTime",
+ "mode": "NULLABLE",
+ "name": "clientSystemTime",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientUserTime",
+ "mode": "NULLABLE",
+ "name": "clientUserTime",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latency50",
+ "mode": "NULLABLE",
+ "name": "latency50",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latency90",
+ "mode": "NULLABLE",
+ "name": "latency90",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latency95",
+ "mode": "NULLABLE",
+ "name": "latency95",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latency99",
+ "mode": "NULLABLE",
+ "name": "latency99",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "latency999",
+ "mode": "NULLABLE",
+ "name": "latency999",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientPollsPerRequest",
+ "mode": "NULLABLE",
+ "name": "clientPollsPerRequest",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverPollsPerRequest",
+ "mode": "NULLABLE",
+ "name": "serverPollsPerRequest",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverQueriesPerCpuSec",
+ "mode": "NULLABLE",
+ "name": "serverQueriesPerCpuSec",
"type": "FLOAT"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientQueriesPerCpuSec",
+ "mode": "NULLABLE",
+ "name": "clientQueriesPerCpuSec",
"type": "FLOAT"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "startTime",
+ "type": "TIMESTAMP"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "endTime",
+ "type": "TIMESTAMP"
}
- ],
- "mode": "NULLABLE",
- "name": "summary",
+ ],
+ "mode": "NULLABLE",
+ "name": "summary",
"type": "RECORD"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "clientSuccess",
+ "mode": "NULLABLE",
+ "name": "clientSuccess",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverSuccess",
+ "mode": "NULLABLE",
+ "name": "serverSuccess",
"type": "STRING"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "requestResults",
+ "mode": "NULLABLE",
+ "name": "requestResults",
"type": "STRING"
- },
+ },
{
"fields": [
{
- "mode": "NULLABLE",
- "name": "totalCpuTime",
+ "mode": "NULLABLE",
+ "name": "totalCpuTime",
"type": "INTEGER"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "idleCpuTime",
+ "mode": "NULLABLE",
+ "name": "idleCpuTime",
"type": "INTEGER"
}
- ],
- "mode": "REPEATED",
- "name": "serverCpuStats",
+ ],
+ "mode": "REPEATED",
+ "name": "serverCpuStats",
+ "type": "RECORD"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "serverCpuUsage",
+ "type": "FLOAT"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "testMetadata",
+ "type": "STRING"
+ },
+ {
+ "fields": [
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "podIP",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "nodeName",
+ "type": "STRING"
+ }
+ ],
+ "mode": "NULLABLE",
+ "name": "driver",
+ "type": "RECORD"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "podIP",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "nodeName",
+ "type": "STRING"
+ }
+ ],
+ "mode": "REPEATED",
+ "name": "servers",
+ "type": "RECORD"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "podIP",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "nodeName",
+ "type": "STRING"
+ }
+ ],
+ "mode": "REPEATED",
+ "name": "clients",
+ "type": "RECORD"
+ }
+ ],
+ "mode": "NULLABLE",
+ "name": "nodeMetadata",
+ "type": "RECORD"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "cpuSeconds",
+ "type": "FLOAT"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "memoryMean",
+ "type": "FLOAT"
+ }
+
+ ],
+ "mode": "REPEATED",
+ "name": "containers",
+ "type": "RECORD"
+ }
+ ],
+ "mode": "REPEATED",
+ "name": "clientsPrometheusData",
+ "type": "RECORD"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "fields": [
+ {
+ "mode": "NULLABLE",
+ "name": "name",
+ "type": "STRING"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "cpuSeconds",
+ "type": "FLOAT"
+ },
+ {
+ "mode": "NULLABLE",
+ "name": "memoryMean",
+ "type": "FLOAT"
+ }
+
+ ],
+ "mode": "REPEATED",
+ "name": "containers",
+ "type": "RECORD"
+ }
+ ],
+ "mode": "REPEATED",
+ "name": "serversPrometheusData",
"type": "RECORD"
- },
+ },
{
- "mode": "NULLABLE",
- "name": "serverCpuUsage",
+ "mode": "NULLABLE",
+ "name": "testDurationSeconds",
"type": "FLOAT"
}
-] \ No newline at end of file
+]
diff --git a/grpc/tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml b/grpc/tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml
index fb1d6337..bf804e70 100644
--- a/grpc/tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml
+++ b/grpc/tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml
@@ -14,246 +14,419 @@ metadata:
name: basic_all_languages
spec:
clients:
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: csharp
- pool: ${client_pool}
- run:
- args:
- - exec
- - qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
- command:
- - dotnet
- - build:
- args:
- - build
- - //test/cpp/qps:qps_worker
- command:
- - bazel
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: cxx
- pool: ${client_pool}
- run:
- command:
- - bazel-bin/test/cpp/qps/qps_worker
- - build:
- args:
- - build
- - -o
- - /src/workspace/bin/worker
- - ./benchmark/worker
- command:
- - go
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-go.git
- language: go
- pool: ${client_pool}
- run:
- command:
- - /src/workspace/bin/worker
- - build:
- args:
- - -PskipAndroid=true
- - -PskipCodegen=true
- - :grpc-benchmarks:installDist
- command:
- - gradle
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-java.git
- language: java
- pool: ${client_pool}
- run:
- command:
- - benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-node.git
- language: node
- pool: ${client_pool}
- run:
- args:
- - -r
- - ./test/fixtures/native_native.js
- - test/performance/worker.js
- - --benchmark_impl=grpc
- command:
- - node
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: php
- pool: ${client_pool}
- run:
- command:
- - bash
- - /run_scripts/run_worker.sh
- - build:
- args:
- - build
- - //src/python/grpcio_tests/tests/qps:qps_worker
- command:
- - bazel
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: python
- pool: ${client_pool}
- run:
- command:
- - bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc
- language: ruby
- pool: ${client_pool}
- run:
- args:
- - src/ruby/qps/worker.rb
- command:
- - ruby
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: csharp
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" dotnet exec \
+ qps_worker/Grpc.IntegrationTesting.QpsWorker.dll \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-dotnet.git
+ language: dotnet
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ # TODO(jtattermusch): why is the extra "--" in cmdline needed?
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ qps_worker/QpsWorker -- --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --config
+ - opt
+ - //test/cpp/qps:qps_worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: cxx
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/test/cpp/qps/qps_worker --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - -o
+ - /src/workspace/bin/worker
+ - ./benchmark/worker
+ command:
+ - go
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-go.git
+ language: go
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /src/workspace/bin/worker --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - -PskipAndroid=true
+ - -PskipCodegen=true
+ - :grpc-benchmarks:installDist
+ command:
+ - gradle
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-java.git
+ language: java
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-node.git
+ language: node
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" node -r \
+ ./test/fixtures/native_native.js test/performance/worker.js \
+ --benchmark_impl=grpc --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: php7
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: php7_protobuf_c
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_protobuf_c_worker.sh
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --compilation_mode
+ - opt
+ - //src/python/grpcio_tests/tests/qps:qps_worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: python
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --compilation_mode
+ - opt
+ - //src/python/grpcio_tests/tests_aio/benchmark:worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: python_asyncio
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/src/python/grpcio_tests/tests_aio/benchmark/worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc
+ language: ruby
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" ruby \
+ src/ruby/qps/worker.rb --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ driver:
+ language: cxx
+ run: []
results:
bigQueryTable: ${big_query_table}
servers:
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: csharp
- pool: ${server_pool}
- run:
- args:
- - exec
- - qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
- command:
- - dotnet
- - build:
- args:
- - build
- - //test/cpp/qps:qps_worker
- command:
- - bazel
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: cxx
- pool: ${server_pool}
- run:
- args:
- - --server_port=10010
- command:
- - bazel-bin/test/cpp/qps/qps_worker
- - build:
- args:
- - build
- - -o
- - /src/workspace/bin/worker
- - ./benchmark/worker
- command:
- - go
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-go.git
- language: go
- pool: ${server_pool}
- run:
- command:
- - /src/workspace/bin/worker
- - build:
- args:
- - -PskipAndroid=true
- - -PskipCodegen=true
- - :grpc-benchmarks:installDist
- command:
- - gradle
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-java.git
- language: java
- pool: ${server_pool}
- run:
- command:
- - benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc-node.git
- language: node
- pool: ${server_pool}
- run:
- args:
- - -r
- - ./test/fixtures/native_native.js
- - test/performance/worker.js
- - --benchmark_impl=grpc
- command:
- - node
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: php
- pool: ${server_pool}
- run:
- command:
- - bash
- - /run_scripts/run_worker.sh
- - build:
- args:
- - build
- - //src/python/grpcio_tests/tests/qps:qps_worker
- command:
- - bazel
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc.git
- language: python
- pool: ${server_pool}
- run:
- command:
- - bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- - build:
- command:
- - bash
- - /build_scripts/build_qps_worker.sh
- clone:
- gitRef: master
- repo: https://github.com/grpc/grpc
- language: ruby
- pool: ${server_pool}
- run:
- args:
- - src/ruby/qps/worker.rb
- command:
- - ruby
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: csharp
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" dotnet exec \
+ qps_worker/Grpc.IntegrationTesting.QpsWorker.dll \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-dotnet.git
+ language: dotnet
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ qps_worker/QpsWorker -- --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --config
+ - opt
+ - //test/cpp/qps:qps_worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: cxx
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/test/cpp/qps/qps_worker --driver_port="${DRIVER_PORT}" \
+ --server_port=10010
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - -o
+ - /src/workspace/bin/worker
+ - ./benchmark/worker
+ command:
+ - go
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-go.git
+ language: go
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /src/workspace/bin/worker --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - -PskipAndroid=true
+ - -PskipCodegen=true
+ - :grpc-benchmarks:installDist
+ command:
+ - gradle
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-java.git
+ language: java
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc-node.git
+ language: node
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" node -r \
+ ./test/fixtures/native_native.js test/performance/worker.js \
+ --benchmark_impl=grpc --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --compilation_mode
+ - opt
+ - //src/python/grpcio_tests/tests/qps:qps_worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: python
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ args:
+ - build
+ - --compilation_mode
+ - opt
+ - //src/python/grpcio_tests/tests_aio/benchmark:worker
+ command:
+ - bazel
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc.git
+ language: python_asyncio
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ bazel-bin/src/python/grpcio_tests/tests_aio/benchmark/worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
+ - build:
+ command:
+ - bash
+ - /build_scripts/build_qps_worker.sh
+ clone:
+ gitRef: master
+ repo: https://github.com/grpc/grpc
+ language: ruby
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" ruby \
+ src/ruby/qps/worker.rb --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ name: main
timeoutSeconds: ${timeout_seconds}
ttlSeconds: 86400
diff --git a/grpc/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml b/grpc/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml
new file mode 100644
index 00000000..fcc8170a
--- /dev/null
+++ b/grpc/tools/run_tests/performance/templates/loadtest_template_prebuilt_all_languages.yaml
@@ -0,0 +1,282 @@
+# Template generated from load test configurations by loadtest_template.py.
+#
+# Configuration templates contain client and server configurations for multiple
+# languages, and may contain template substitution keys. These templates are
+# used to generate load test configurations by selecting clients and servers for
+# the required languages. The source files for template generation may be load
+# test configurations or load test configuration templates. Load test
+# configuration generation is performed by loadtest_config.py. See documentation
+# below:
+# https://github.com/grpc/grpc/blob/master/tools/run_tests/performance/README.md
+apiVersion: e2etest.grpc.io/v1
+kind: LoadTest
+metadata:
+ name: prebuilt_all_languages
+spec:
+ clients:
+ - language: csharp
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" dotnet exec \
+ /execute/qps_worker/Grpc.IntegrationTesting.QpsWorker.dll \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/csharp:${prebuilt_image_tag}
+ name: main
+ - language: dotnet
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ # TODO(jtattermusch): why is the extra "--" in cmdline needed?
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/qps_worker/QpsWorker -- --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/dotnet:${prebuilt_image_tag}
+ name: main
+ - language: cxx
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /source/code/bazel-bin/test/cpp/qps/qps_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/cxx:${prebuilt_image_tag}
+ name: main
+ - language: go
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /executable/bin/worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/go:${prebuilt_image_tag}
+ name: main
+ - language: java
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/java:${prebuilt_image_tag}
+ name: main
+ - language: node
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/worker-linux --benchmark_impl=grpc \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/node:${prebuilt_image_tag}
+ name: main
+ - language: php7
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/php7:${prebuilt_image_tag}
+ name: main
+ - language: php7_protobuf_c
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_protobuf_c_worker.sh
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/php7:${prebuilt_image_tag}
+ name: main
+ - language: python
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/qps_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/python:${prebuilt_image_tag}
+ name: main
+ - language: python_asyncio
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/benchmark_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/python:${prebuilt_image_tag}
+ name: main
+ - language: ruby
+ pool: ${client_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/src/ruby/qps/worker.rb \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/ruby:${prebuilt_image_tag}
+ name: main
+ driver:
+ language: cxx
+ pool: ${driver_pool}
+ run:
+ - image: ${driver_image}
+ name: main
+ results:
+ bigQueryTable: ${big_query_table}
+ servers:
+ - language: csharp
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" dotnet exec \
+ /execute/qps_worker/Grpc.IntegrationTesting.QpsWorker.dll \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/csharp:${prebuilt_image_tag}
+ name: main
+ - language: dotnet
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/qps_worker/QpsWorker -- --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/dotnet:${prebuilt_image_tag}
+ name: main
+ - language: cxx
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /source/code/bazel-bin/test/cpp/qps/qps_worker \
+ --driver_port="${DRIVER_PORT}" --server_port=10010
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/cxx:${prebuilt_image_tag}
+ name: main
+ - language: go
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /executable/bin/worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/go:${prebuilt_image_tag}
+ name: main
+ - language: java
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /run_scripts/run_worker.sh
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/java:${prebuilt_image_tag}
+ name: main
+ - language: node
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/worker-linux --benchmark_impl=grpc \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/node:${prebuilt_image_tag}
+ name: main
+ - language: python
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/qps_worker \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/python:${prebuilt_image_tag}
+ name: main
+ - language: python_asyncio
+ pool: ${server_pool}
+ run:
+ - command:
+ - bash
+ image: ${prebuilt_image_prefix}/python:${prebuilt_image_tag}
+ name: main
+ rgs:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/benchmark_worker \
+ --driver_port="${DRIVER_PORT}"
+ - language: ruby
+ pool: ${server_pool}
+ run:
+ - args:
+ - -c
+ - |
+ timeout --kill-after="${KILL_AFTER}" "${POD_TIMEOUT}" \
+ /execute/src/ruby/qps/worker.rb \
+ --driver_port="${DRIVER_PORT}"
+ command:
+ - bash
+ image: ${prebuilt_image_prefix}/ruby:${prebuilt_image_tag}
+ name: main
+ timeoutSeconds: ${timeout_seconds}
+ ttlSeconds: 86400
diff --git a/grpc/tools/run_tests/python_utils/antagonist.py b/grpc/tools/run_tests/python_utils/antagonist.py
index a928a4cb..321f2af1 100755
--- a/grpc/tools/run_tests/python_utils/antagonist.py
+++ b/grpc/tools/run_tests/python_utils/antagonist.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/grpc/tools/run_tests/python_utils/bazel_report_helper.py b/grpc/tools/run_tests/python_utils/bazel_report_helper.py
new file mode 100755
index 00000000..c62807a5
--- /dev/null
+++ b/grpc/tools/run_tests/python_utils/bazel_report_helper.py
@@ -0,0 +1,258 @@
+#!/usr/bin/env python3
+# Copyright 2022 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.
+"""Helps with running bazel with extra settings to generate structured test reports in CI."""
+
+import argparse
+import os
+import platform
+import sys
+import uuid
+
+_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
+os.chdir(_ROOT)
+
+# How long to sleep before querying Resultstore API and uploading to bigquery
+# (to let ResultStore finish writing results from the bazel invocation that has
+# just finished).
+_UPLOAD_RBE_RESULTS_DELAY_SECONDS = 60
+
+
+def _platform_string():
+ """Detect current platform"""
+ if platform.system() == 'Windows':
+ return 'windows'
+ elif platform.system()[:7] == 'MSYS_NT':
+ return 'windows'
+ elif platform.system() == 'Darwin':
+ return 'mac'
+ elif platform.system() == 'Linux':
+ return 'linux'
+ else:
+ return 'posix'
+
+
+def _append_to_kokoro_bazel_invocations(invocation_id: str) -> None:
+ """Kokoro can display "Bazel" result link on kokoro jobs if told so."""
+ # to get "bazel" link for kokoro build, we need to upload
+ # the "bazel_invocation_ids" file with bazel invocation ID as artifact.
+ kokoro_artifacts_dir = os.getenv('KOKORO_ARTIFACTS_DIR')
+ if kokoro_artifacts_dir:
+ # append the bazel invocation UUID to the bazel_invocation_ids file.
+ with open(os.path.join(kokoro_artifacts_dir, 'bazel_invocation_ids'),
+ 'a') as f:
+ f.write(invocation_id + '\n')
+ print(
+ 'Added invocation ID %s to kokoro "bazel_invocation_ids" artifact' %
+ invocation_id,
+ file=sys.stderr)
+ else:
+ print(
+ 'Skipped adding invocation ID %s to kokoro "bazel_invocation_ids" artifact'
+ % invocation_id,
+ file=sys.stderr)
+ pass
+
+
+def _generate_junit_report_string(report_suite_name: str, invocation_id: str,
+ success: bool) -> None:
+ """Generate sponge_log.xml formatted report, that will make the bazel invocation reachable as a target in resultstore UI / sponge."""
+ bazel_invocation_url = 'https://source.cloud.google.com/results/invocations/%s' % invocation_id
+ package_name = report_suite_name
+ # set testcase name to invocation URL. That way, the link will be displayed in some form
+ # resultstore UI and sponge even in case the bazel invocation succeeds.
+ testcase_name = bazel_invocation_url
+ if success:
+ # unfortunately, neither resultstore UI nor sponge display the "system-err" output (or any other tags)
+ # on a passing test case. But at least we tried.
+ test_output_tag = '<system-err>PASSED. See invocation results here: %s</system-err>' % bazel_invocation_url
+ else:
+ # The failure output will be displayes in both resultstore UI and sponge when clicking on the failing testcase.
+ test_output_tag = '<failure message="Failure">FAILED. See bazel invocation results here: %s</failure>' % bazel_invocation_url
+
+ lines = [
+ '<testsuites>',
+ '<testsuite id="1" name="%s" package="%s">' %
+ (report_suite_name, package_name),
+ '<testcase name="%s">' % testcase_name,
+ test_output_tag,
+ '</testcase>'
+ '</testsuite>',
+ '</testsuites>',
+ ]
+ return '\n'.join(lines)
+
+
+def _create_bazel_wrapper(report_path: str, report_suite_name: str,
+ invocation_id: str, upload_results: bool) -> None:
+ """Create a "bazel wrapper" script that will execute bazel with extra settings and postprocessing."""
+
+ os.makedirs(report_path, exist_ok=True)
+
+ bazel_wrapper_filename = os.path.join(report_path, 'bazel_wrapper')
+ bazel_wrapper_bat_filename = bazel_wrapper_filename + '.bat'
+ bazel_rc_filename = os.path.join(report_path, 'bazel_wrapper.bazelrc')
+
+ # put xml reports in a separate directory if requested by GRPC_TEST_REPORT_BASE_DIR
+ report_base_dir = os.getenv('GRPC_TEST_REPORT_BASE_DIR', None)
+ xml_report_path = os.path.abspath(
+ os.path.join(report_base_dir, report_path
+ ) if report_base_dir else report_path)
+ os.makedirs(xml_report_path, exist_ok=True)
+
+ failing_report_filename = os.path.join(xml_report_path, 'sponge_log.xml')
+ success_report_filename = os.path.join(xml_report_path,
+ 'success_log_to_rename.xml')
+
+ if _platform_string() == 'windows':
+ workspace_status_command = 'tools/remote_build/workspace_status_kokoro.bat'
+ else:
+ workspace_status_command = 'tools/remote_build/workspace_status_kokoro.sh'
+
+ # generate RC file with the bazel flags we want to use apply.
+ # Using an RC file solves problems with flag ordering in the wrapper.
+ # (e.g. some flags need to come after the build/test command)
+ with open(bazel_rc_filename, 'w') as f:
+ f.write('build --invocation_id="%s"\n' % invocation_id)
+ f.write('build --workspace_status_command="%s"\n' %
+ workspace_status_command)
+
+ # generate "failing" and "success" report
+ # the "failing" is named as "sponge_log.xml", which is the name picked up by sponge/resultstore
+ # so the failing report will be used by default (unless we later replace the report with
+ # one that says "success"). That way if something goes wrong before bazel is run,
+ # there will at least be a "failing" target that indicates that (we really don't want silent failures).
+ with open(failing_report_filename, 'w') as f:
+ f.write(
+ _generate_junit_report_string(report_suite_name,
+ invocation_id,
+ success=False))
+ with open(success_report_filename, 'w') as f:
+ f.write(
+ _generate_junit_report_string(report_suite_name,
+ invocation_id,
+ success=True))
+
+ # generate the bazel wrapper for linux/macos
+ with open(bazel_wrapper_filename, 'w') as f:
+ intro_lines = [
+ '#!/bin/bash',
+ 'set -ex',
+ '',
+ 'tools/bazel --bazelrc="%s" "$@" || FAILED=true' %
+ bazel_rc_filename,
+ '',
+ ]
+
+ if upload_results:
+ upload_results_lines = [
+ 'sleep %s' % _UPLOAD_RBE_RESULTS_DELAY_SECONDS,
+ 'PYTHONHTTPSVERIFY=0 python3 ./tools/run_tests/python_utils/upload_rbe_results.py --invocation_id="%s"'
+ % invocation_id,
+ '',
+ ]
+ else:
+ upload_results_lines = []
+
+ outro_lines = [
+ 'if [ "$FAILED" != "" ]',
+ 'then',
+ ' exit 1',
+ 'else',
+ ' # success: plant the pre-generated xml report that says "success"',
+ ' mv -f %s %s' %
+ (success_report_filename, failing_report_filename),
+ 'fi',
+ ]
+
+ lines = [
+ line + '\n'
+ for line in intro_lines + upload_results_lines + outro_lines
+ ]
+ f.writelines(lines)
+ os.chmod(bazel_wrapper_filename, 0o775) # make the unix wrapper executable
+
+ # generate bazel wrapper for windows
+ with open(bazel_wrapper_bat_filename, 'w') as f:
+ intro_lines = [
+ '@echo on',
+ '',
+ 'bazel --bazelrc="%s" %%*' % bazel_rc_filename,
+ 'set BAZEL_EXITCODE=%errorlevel%',
+ '',
+ ]
+
+ if upload_results:
+ upload_results_lines = [
+ 'sleep %s' % _UPLOAD_RBE_RESULTS_DELAY_SECONDS,
+ 'python3 tools/run_tests/python_utils/upload_rbe_results.py --invocation_id="%s" || exit /b 1'
+ % invocation_id,
+ '',
+ ]
+ else:
+ upload_results_lines = []
+
+ outro_lines = [
+ 'if %BAZEL_EXITCODE% == 0 (',
+ ' @rem success: plant the pre-generated xml report that says "success"',
+ ' mv -f %s %s' %
+ (success_report_filename, failing_report_filename),
+ ')',
+ 'exit /b %BAZEL_EXITCODE%',
+ ]
+
+ lines = [
+ line + '\n'
+ for line in intro_lines + upload_results_lines + outro_lines
+ ]
+ f.writelines(lines)
+
+ print('Bazel invocation ID: %s' % invocation_id, file=sys.stderr)
+ print('Upload test results to BigQuery after bazel runs: %s' %
+ upload_results,
+ file=sys.stderr)
+ print('Generated bazel wrapper: %s' % bazel_wrapper_filename,
+ file=sys.stderr)
+ print('Generated bazel wrapper: %s' % bazel_wrapper_bat_filename,
+ file=sys.stderr)
+
+
+if __name__ == '__main__':
+ # parse command line
+ argp = argparse.ArgumentParser(
+ description=
+ 'Generate bazel wrapper to help with bazel test reports in CI.')
+ argp.add_argument(
+ '--report_path',
+ required=True,
+ type=str,
+ help=
+ 'Path under which the bazel wrapper and other files are going to be generated'
+ )
+ argp.add_argument('--report_suite_name',
+ default='bazel_invocations',
+ type=str,
+ help='Test suite name to use in generated XML report')
+ args = argp.parse_args()
+
+ # generate new bazel invocation ID
+ invocation_id = str(uuid.uuid4())
+
+ report_path = args.report_path
+ report_suite_name = args.report_suite_name
+ upload_results = True if os.getenv('UPLOAD_TEST_RESULTS') else False
+
+ _append_to_kokoro_bazel_invocations(invocation_id)
+ _create_bazel_wrapper(report_path, report_suite_name, invocation_id,
+ upload_results)
diff --git a/grpc/tools/run_tests/python_utils/check_on_pr.py b/grpc/tools/run_tests/python_utils/check_on_pr.py
index 7dd0b258..5bf58f94 100644
--- a/grpc/tools/run_tests/python_utils/check_on_pr.py
+++ b/grpc/tools/run_tests/python_utils/check_on_pr.py
@@ -13,15 +13,16 @@
# limitations under the License.
from __future__ import print_function
+
+import datetime
+import json
import os
import sys
-import json
import time
-import datetime
import traceback
-import requests
import jwt
+import requests
_GITHUB_API_PREFIX = 'https://api.github.com'
_GITHUB_REPO = 'grpc/grpc'
@@ -32,6 +33,20 @@ _ACCESS_TOKEN_CACHE = None
_ACCESS_TOKEN_FETCH_RETRIES = 6
_ACCESS_TOKEN_FETCH_RETRIES_INTERVAL_S = 15
+_CHANGE_LABELS = {
+ -1: 'improvement',
+ 0: 'none',
+ 1: 'low',
+ 2: 'medium',
+ 3: 'high',
+}
+
+_INCREASE_DECREASE = {
+ -1: 'decrease',
+ 0: 'neutral',
+ 1: 'increase',
+}
+
def _jwt_token():
github_app_key = open(
@@ -121,6 +136,12 @@ def check_on_pr(name, summary, success=True):
if 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' not in os.environ:
print('Missing KOKORO_GITHUB_PULL_REQUEST_NUMBER env var: not checking')
return
+ MAX_SUMMARY_LEN = 65400
+ if len(summary) > MAX_SUMMARY_LEN:
+ # Drop some hints to the log should someone come looking for what really happened!
+ print('Clipping too long summary')
+ print(summary)
+ summary = summary[:MAX_SUMMARY_LEN] + '\n\n\n... CLIPPED (too long)'
completion_time = str(
datetime.datetime.utcnow().replace(microsecond=0).isoformat()) + 'Z'
resp = _call('/repos/%s/check-runs' % _GITHUB_REPO,
@@ -138,3 +159,51 @@ def check_on_pr(name, summary, success=True):
})
print('Result of Creating/Updating Check on PR:',
json.dumps(resp.json(), indent=2))
+
+
+def label_significance_on_pr(name, change, labels=_CHANGE_LABELS):
+ """Add a label to the PR indicating the significance of the check.
+
+ Requires environment variable 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' to indicate which pull request
+ should be updated.
+
+ Args:
+ name: The name of the label.
+ value: A str in Markdown to be used as the detail information of the label.
+ """
+ if change < min(list(labels.keys())):
+ change = min(list(labels.keys()))
+ if change > max(list(labels.keys())):
+ change = max(list(labels.keys()))
+ value = labels[change]
+ if 'KOKORO_GIT_COMMIT' not in os.environ:
+ print('Missing KOKORO_GIT_COMMIT env var: not checking')
+ return
+ if 'KOKORO_KEYSTORE_DIR' not in os.environ:
+ print('Missing KOKORO_KEYSTORE_DIR env var: not checking')
+ return
+ if 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' not in os.environ:
+ print('Missing KOKORO_GITHUB_PULL_REQUEST_NUMBER env var: not checking')
+ return
+ existing = _call(
+ '/repos/%s/issues/%s/labels' %
+ (_GITHUB_REPO, os.environ['KOKORO_GITHUB_PULL_REQUEST_NUMBER']),
+ method='GET').json()
+ print('Result of fetching labels on PR:', existing)
+ new = [x['name'] for x in existing if not x['name'].startswith(name + '/')]
+ new.append(name + '/' + value)
+ resp = _call(
+ '/repos/%s/issues/%s/labels' %
+ (_GITHUB_REPO, os.environ['KOKORO_GITHUB_PULL_REQUEST_NUMBER']),
+ method='PUT',
+ json=new)
+ print('Result of setting labels on PR:', resp.text)
+
+
+def label_increase_decrease_on_pr(name, change, significant):
+ if change <= -significant:
+ label_significance_on_pr(name, -1, _INCREASE_DECREASE)
+ elif change >= significant:
+ label_significance_on_pr(name, 1, _INCREASE_DECREASE)
+ else:
+ label_significance_on_pr(name, 0, _INCREASE_DECREASE)
diff --git a/grpc/tools/run_tests/python_utils/dockerjob.py b/grpc/tools/run_tests/python_utils/dockerjob.py
index 206a6cd3..310a733a 100755
--- a/grpc/tools/run_tests/python_utils/dockerjob.py
+++ b/grpc/tools/run_tests/python_utils/dockerjob.py
@@ -15,13 +15,15 @@
from __future__ import print_function
+import json
+import os
+import subprocess
+import sys
import tempfile
import time
import uuid
-import os
-import subprocess
-import json
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import jobset
_DEVNULL = open(os.devnull, 'w')
@@ -47,7 +49,7 @@ def docker_mapped_port(cid, port, timeout_seconds=15):
try:
output = subprocess.check_output('docker port %s %s' % (cid, port),
stderr=_DEVNULL,
- shell=True)
+ shell=True).decode()
return int(output.split(':', 2)[1])
except subprocess.CalledProcessError as e:
pass
@@ -61,7 +63,8 @@ def docker_ip_address(cid, timeout_seconds=15):
while time.time() - started < timeout_seconds:
cmd = 'docker inspect %s' % cid
try:
- output = subprocess.check_output(cmd, stderr=_DEVNULL, shell=True)
+ output = subprocess.check_output(cmd, stderr=_DEVNULL,
+ shell=True).decode()
json_info = json.loads(output)
assert len(json_info) == 1
out = json_info[0]['NetworkSettings']['IPAddress']
@@ -82,7 +85,7 @@ def wait_for_healthy(cid, shortname, timeout_seconds):
output = subprocess.check_output([
'docker', 'inspect', '--format="{{.State.Health.Status}}"', cid
],
- stderr=_DEVNULL)
+ stderr=_DEVNULL).decode()
if output.strip('\n') == 'healthy':
return
except subprocess.CalledProcessError as e:
diff --git a/grpc/tools/run_tests/python_utils/download_and_unzip.py b/grpc/tools/run_tests/python_utils/download_and_unzip.py
index e4b574fa..44057269 100644
--- a/grpc/tools/run_tests/python_utils/download_and_unzip.py
+++ b/grpc/tools/run_tests/python_utils/download_and_unzip.py
@@ -17,9 +17,10 @@ from __future__ import print_function
import os
import sys
+import tempfile
import zipfile
+
import requests
-import tempfile
def main():
diff --git a/grpc/tools/run_tests/python_utils/filter_pull_request_tests.py b/grpc/tools/run_tests/python_utils/filter_pull_request_tests.py
index c8574ad6..13039588 100644
--- a/grpc/tools/run_tests/python_utils/filter_pull_request_tests.py
+++ b/grpc/tools/run_tests/python_utils/filter_pull_request_tests.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,9 +16,10 @@
from __future__ import print_function
import re
-import six
import subprocess
+import six
+
class TestSuite:
"""
@@ -113,7 +113,7 @@ _ALLOWLIST_DICT = {
}
# Regex that combines all keys in _ALLOWLIST_DICT
-_ALL_TRIGGERS = "(" + ")|(".join(_ALLOWLIST_DICT.keys()) + ")"
+_ALL_TRIGGERS = "(" + ")|(".join(list(_ALLOWLIST_DICT.keys())) + ")"
# Add all triggers to their respective test suites
for trigger, test_suites in six.iteritems(_ALLOWLIST_DICT):
diff --git a/grpc/tools/run_tests/python_utils/jobset.py b/grpc/tools/run_tests/python_utils/jobset.py
index 552d16cc..2174c00e 100755
--- a/grpc/tools/run_tests/python_utils/jobset.py
+++ b/grpc/tools/run_tests/python_utils/jobset.py
@@ -13,6 +13,7 @@
# limitations under the License.
"""Run a group of subprocesses and then finish."""
+import errno
import logging
import multiprocessing
import os
@@ -23,7 +24,6 @@ import subprocess
import sys
import tempfile
import time
-import errno
# cpu cost measurement
measure_cpu_costs = False
@@ -44,7 +44,7 @@ def strip_non_ascii_chars(s):
def sanitized_environment(env):
sanitized = {}
- for key, value in env.items():
+ for key, value in list(env.items()):
sanitized[strip_non_ascii_chars(key)] = strip_non_ascii_chars(value)
return sanitized
@@ -126,19 +126,22 @@ def message(tag, msg, explanatory_text=None, do_newline=False):
return
message.old_tag = tag
message.old_msg = msg
+ if explanatory_text:
+ if isinstance(explanatory_text, bytes):
+ explanatory_text = explanatory_text.decode('utf8', errors='replace')
while True:
try:
if platform_string() == 'windows' or not sys.stdout.isatty():
if explanatory_text:
- logging.info(explanatory_text.decode('utf8'))
+ logging.info(explanatory_text)
logging.info('%s: %s', tag, msg)
else:
sys.stdout.write(
'%s%s%s\x1b[%d;%dm%s\x1b[0m: %s%s' %
(_BEGINNING_OF_LINE, _CLEAR_LINE, '\n%s' %
- explanatory_text.decode('utf8') if explanatory_text
- is not None else '', _COLORS[_TAG_COLOR[tag]][1],
- _COLORS[_TAG_COLOR[tag]][0], tag, msg, '\n'
+ explanatory_text if explanatory_text is not None else '',
+ _COLORS[_TAG_COLOR[tag]][1], _COLORS[_TAG_COLOR[tag]][0],
+ tag, msg, '\n'
if do_newline or explanatory_text is not None else ''))
sys.stdout.flush()
return
@@ -221,7 +224,7 @@ class JobSpec(object):
def __str__(self):
return '%s: %s %s' % (self.shortname, ' '.join(
- '%s=%s' % kv for kv in self.environ.items()), ' '.join(
+ '%s=%s' % kv for kv in list(self.environ.items())), ' '.join(
self.cmdline))
@@ -357,7 +360,7 @@ class Job(object):
if measure_cpu_costs:
m = re.search(
r'real\s+([0-9.]+)\nuser\s+([0-9.]+)\nsys\s+([0-9.]+)',
- stdout())
+ (stdout()).decode('utf8', errors='replace'))
real = float(m.group(1))
user = float(m.group(2))
sys = float(m.group(3))
diff --git a/grpc/tools/run_tests/python_utils/port_server.py b/grpc/tools/run_tests/python_utils/port_server.py
index c934f832..a5301651 100755
--- a/grpc/tools/run_tests/python_utils/port_server.py
+++ b/grpc/tools/run_tests/python_utils/port_server.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,16 +17,18 @@
from __future__ import print_function
import argparse
-from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
-from six.moves.socketserver import ThreadingMixIn
import hashlib
import os
+import platform
+import random
import socket
import sys
-import time
-import random
import threading
-import platform
+import time
+
+from six.moves.BaseHTTPServer import BaseHTTPRequestHandler
+from six.moves.BaseHTTPServer import HTTPServer
+from six.moves.socketserver import ThreadingMixIn
# increment this number whenever making a change to ensure that
# the changes are picked up by running CI servers
@@ -191,7 +193,7 @@ class Handler(BaseHTTPRequestHandler):
now = time.time()
out = yaml.dump({
'pool': pool,
- 'in_use': dict((k, now - v) for k, v in in_use.items())
+ 'in_use': dict((k, now - v) for k, v in list(in_use.items()))
})
mu.release()
self.wfile.write(out.encode('ascii'))
diff --git a/grpc/tools/run_tests/python_utils/report_utils.py b/grpc/tools/run_tests/python_utils/report_utils.py
index 666edbf6..5cf7851b 100644
--- a/grpc/tools/run_tests/python_utils/report_utils.py
+++ b/grpc/tools/run_tests/python_utils/report_utils.py
@@ -14,26 +14,31 @@
"""Generate XML and HTML test reports."""
try:
+ from mako import exceptions
from mako.runtime import Context
from mako.template import Template
- from mako import exceptions
except (ImportError):
pass # Mako not installed but it is ok.
import datetime
import os
import string
import xml.etree.cElementTree as ET
+
import six
def _filter_msg(msg, output_format):
"""Filters out nonprintable and illegal characters from the message."""
if output_format in ['XML', 'HTML']:
+ if isinstance(msg, bytes):
+ decoded_msg = msg.decode('UTF-8', 'ignore')
+ else:
+ decoded_msg = msg
# keep whitespaces but remove formfeed and vertical tab characters
# that make XML report unparsable.
filtered_msg = ''.join(
filter(lambda x: x in string.printable and x != '\f' and x != '\v',
- msg.decode('UTF-8', 'ignore')))
+ decoded_msg))
if output_format == 'HTML':
filtered_msg = filtered_msg.replace('"', '&quot;')
return filtered_msg
@@ -75,6 +80,10 @@ def render_junit_xml_report(resultset,
def create_xml_report_file(tree, report_file):
"""Generate JUnit-like report file from xml tree ."""
+ # env variable can be used to override the base location for the reports
+ base_dir = os.getenv('GRPC_TEST_REPORT_BASE_DIR', None)
+ if base_dir:
+ report_file = os.path.join(base_dir, report_file)
# ensure the report directory exists
report_dir = os.path.dirname(os.path.abspath(report_file))
if not os.path.exists(report_dir):
@@ -135,7 +144,7 @@ def render_interop_html_report(client_langs, server_langs, test_cases,
'Mako template is not installed. Skipping HTML report generation.')
return
except IOError as e:
- print('Failed to find the template %s: %s' % (template_file, e))
+ print(('Failed to find the template %s: %s' % (template_file, e)))
return
sorted_test_cases = sorted(test_cases)
@@ -168,7 +177,7 @@ def render_interop_html_report(client_langs, server_langs, test_cases,
with open(html_file_path, 'w') as output_file:
mytemplate.render_context(Context(output_file, **args))
except:
- print(exceptions.text_error_template().render())
+ print((exceptions.text_error_template().render()))
raise
diff --git a/grpc/tools/run_tests/python_utils/start_port_server.py b/grpc/tools/run_tests/python_utils/start_port_server.py
index 5915f440..15eada44 100644
--- a/grpc/tools/run_tests/python_utils/start_port_server.py
+++ b/grpc/tools/run_tests/python_utils/start_port_server.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,9 +14,6 @@
from __future__ import print_function
-from . import jobset
-
-import six.moves.urllib.request as request
import logging
import os
import socket
@@ -26,6 +22,11 @@ import sys
import tempfile
import time
+import six.moves.urllib.request as request
+
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+import jobset
+
# must be synchronized with test/core/util/port_server_client.h
_PORT_SERVER_PORT = 32766
@@ -50,7 +51,7 @@ def start_port_server():
sys.executable, # use the same python binary as this process
os.path.abspath('tools/run_tests/python_utils/port_server.py'),
'dump_version'
- ]))
+ ]).decode())
logging.info('my port server is version %d', current_version)
running = (version >= current_version)
if not running:
diff --git a/grpc/tools/run_tests/python_utils/upload_rbe_results.py b/grpc/tools/run_tests/python_utils/upload_rbe_results.py
index 93fec98c..4dd6b138 100755
--- a/grpc/tools/run_tests/python_utils/upload_rbe_results.py
+++ b/grpc/tools/run_tests/python_utils/upload_rbe_results.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +15,13 @@
"""Uploads RBE results to BigQuery"""
import argparse
-import os
import json
+import os
+import ssl
import sys
-import urllib2
+import urllib.error
+import urllib.parse
+import urllib.request
import uuid
gcp_utils_dir = os.path.abspath(
@@ -120,12 +123,21 @@ def _get_resultstore_data(api_key, invocation_id):
# that limit, the 'nextPageToken' field is included in the request to get
# subsequent data, so keep requesting until 'nextPageToken' field is omitted.
while True:
- req = urllib2.Request(
+ req = urllib.request.Request(
url=
'https://resultstore.googleapis.com/v2/invocations/%s/targets/-/configuredTargets/-/actions?key=%s&pageToken=%s&fields=next_page_token,actions.id,actions.status_attributes,actions.timing,actions.test_action'
% (invocation_id, api_key, page_token),
headers={'Content-Type': 'application/json'})
- results = json.loads(urllib2.urlopen(req).read())
+ ctx_dict = {}
+ if os.getenv("PYTHONHTTPSVERIFY") == "0":
+ ctx = ssl.create_default_context()
+ ctx.check_hostname = False
+ ctx.verify_mode = ssl.CERT_NONE
+ ctx_dict = {"context": ctx}
+ raw_resp = urllib.request.urlopen(req, **ctx_dict).read()
+ decoded_resp = raw_resp if isinstance(
+ raw_resp, str) else raw_resp.decode('utf-8', 'ignore')
+ results = json.loads(decoded_resp)
all_actions.extend(results['actions'])
if 'nextPageToken' not in results:
break
@@ -169,7 +181,8 @@ if __name__ == "__main__":
if args.resultstore_dump_file:
with open(args.resultstore_dump_file, 'w') as f:
json.dump(resultstore_actions, f, indent=4, sort_keys=True)
- print('Dumped resultstore data to file %s' % args.resultstore_dump_file)
+ print(
+ ('Dumped resultstore data to file %s' % args.resultstore_dump_file))
# google.devtools.resultstore.v2.Action schema:
# https://github.com/googleapis/googleapis/blob/master/google/devtools/resultstore/v2/action.proto
@@ -255,8 +268,8 @@ if __name__ == "__main__":
}
})
except Exception as e:
- print('Failed to parse test result. Error: %s' % str(e))
- print(json.dumps(test_case, indent=4))
+ print(('Failed to parse test result. Error: %s' % str(e)))
+ print((json.dumps(test_case, indent=4)))
bq_rows.append({
'insertId': str(uuid.uuid4()),
'json': {
@@ -283,7 +296,7 @@ if __name__ == "__main__":
if args.bq_dump_file:
with open(args.bq_dump_file, 'w') as f:
json.dump(bq_rows, f, indent=4, sort_keys=True)
- print('Dumped BQ data to file %s' % args.bq_dump_file)
+ print(('Dumped BQ data to file %s' % args.bq_dump_file))
if not args.skip_upload:
# BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time.
diff --git a/grpc/tools/run_tests/python_utils/upload_test_results.py b/grpc/tools/run_tests/python_utils/upload_test_results.py
index 0e4a26dd..c18ad6b9 100644
--- a/grpc/tools/run_tests/python_utils/upload_test_results.py
+++ b/grpc/tools/run_tests/python_utils/upload_test_results.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,11 +17,12 @@
from __future__ import print_function
import os
-import six
import sys
import time
import uuid
+import six
+
gcp_utils_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), '../../gcp/utils'))
sys.path.append(gcp_utils_dir)
@@ -87,7 +88,7 @@ def _get_build_metadata(test_results):
def _insert_rows_with_retries(bq, bq_table, bq_rows):
"""Insert rows to bq table. Retry on error."""
# BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time.
- for i in range((len(bq_rows) / 1000) + 1):
+ for i in range((len(bq_rows) // 1000) + 1):
max_retries = 3
for attempt in range(max_retries):
if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,
diff --git a/grpc/tools/run_tests/python_utils/watch_dirs.py b/grpc/tools/run_tests/python_utils/watch_dirs.py
index 7befcca5..b9e2cfa0 100755
--- a/grpc/tools/run_tests/python_utils/watch_dirs.py
+++ b/grpc/tools/run_tests/python_utils/watch_dirs.py
@@ -15,6 +15,7 @@
import os
import time
+
from six import string_types
diff --git a/grpc/tools/run_tests/run_grpclb_interop_tests.py b/grpc/tools/run_tests/run_grpclb_interop_tests.py
index dc2a70be..376574b2 100755
--- a/grpc/tools/run_tests/run_grpclb_interop_tests.py
+++ b/grpc/tools/run_tests/run_grpclb_interop_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,9 +27,10 @@ import subprocess
import sys
import tempfile
import time
+import traceback
import uuid
+
import six
-import traceback
import python_utils.dockerjob as dockerjob
import python_utils.jobset as jobset
@@ -170,7 +171,7 @@ def docker_run_cmdline(cmdline, image, docker_args, cwd, environ=None):
# turn environ into -e docker args
docker_cmdline = 'docker run -i --rm=true'.split()
if environ:
- for k, v in environ.items():
+ for k, v in list(environ.items()):
docker_cmdline += ['-e', '%s=%s' % (k, v)]
return docker_cmdline + ['-w', cwd] + docker_args + [image] + cmdline
@@ -402,7 +403,7 @@ docker_images = {}
build_jobs = []
if len(args.language) and args.language[0] == 'all':
- languages = _LANGUAGES.keys()
+ languages = list(_LANGUAGES.keys())
else:
languages = args.language
for lang_name in languages:
@@ -500,7 +501,7 @@ def run_one_scenario(scenario_config):
grpclb_ips = []
shortname_prefix = scenario_config['name']
# Start backends
- for i in xrange(len(scenario_config['backend_configs'])):
+ for i in range(len(scenario_config['backend_configs'])):
backend_config = scenario_config['backend_configs'][i]
backend_shortname = shortname(shortname_prefix, 'backend_server', i)
backend_spec = backend_server_jobspec(
@@ -510,7 +511,7 @@ def run_one_scenario(scenario_config):
backend_addrs.append(
'%s:%d' % (backend_job.ip_address(), _BACKEND_SERVER_PORT))
# Start fallbacks
- for i in xrange(len(scenario_config['fallback_configs'])):
+ for i in range(len(scenario_config['fallback_configs'])):
fallback_config = scenario_config['fallback_configs'][i]
fallback_shortname = shortname(shortname_prefix, 'fallback_server',
i)
@@ -520,7 +521,7 @@ def run_one_scenario(scenario_config):
server_jobs[fallback_shortname] = fallback_job
fallback_ips.append(fallback_job.ip_address())
# Start balancers
- for i in xrange(len(scenario_config['balancer_configs'])):
+ for i in range(len(scenario_config['balancer_configs'])):
balancer_config = scenario_config['balancer_configs'][i]
grpclb_shortname = shortname(shortname_prefix, 'grpclb_server', i)
grpclb_spec = grpclb_jobspec(balancer_config['transport_sec'],
@@ -581,7 +582,7 @@ def run_one_scenario(scenario_config):
return num_failures
finally:
# Check if servers are still running.
- for server, job in server_jobs.items():
+ for server, job in list(server_jobs.items()):
if not job.is_running():
print('Server "%s" has exited prematurely.' % server)
suppress_failure = suppress_server_logs and not args.verbose
diff --git a/grpc/tools/run_tests/run_interop_tests.py b/grpc/tools/run_tests/run_interop_tests.py
index 4f525d55..c96e24a3 100755
--- a/grpc/tools/run_tests/run_interop_tests.py
+++ b/grpc/tools/run_tests/run_interop_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,13 +27,15 @@ import subprocess
import sys
import tempfile
import time
+import traceback
import uuid
+
import six
-import traceback
import python_utils.dockerjob as dockerjob
import python_utils.jobset as jobset
import python_utils.report_utils as report_utils
+
# It's ok to not import because this is only necessary to upload results to BQ.
try:
from python_utils.upload_test_results import upload_interop_results_to_bq
@@ -158,8 +160,8 @@ class CSharpLanguage:
class CSharpCoreCLRLanguage:
def __init__(self):
- self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1'
- self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug/netcoreapp2.1'
+ self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1'
+ self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug/netcoreapp3.1'
self.safename = str(self)
def client_cmd(self, args):
@@ -413,8 +415,8 @@ class Http2Client:
class NodeLanguage:
def __init__(self):
- self.client_cwd = '../grpc-node'
- self.server_cwd = '../grpc-node'
+ self.client_cwd = '../../../../home/appuser/grpc-node'
+ self.server_cwd = '../../../../home/appuser/grpc-node'
self.safename = str(self)
def client_cmd(self, args):
@@ -453,8 +455,8 @@ class NodeLanguage:
class NodePureJSLanguage:
def __init__(self):
- self.client_cwd = '../grpc-node'
- self.server_cwd = '../grpc-node'
+ self.client_cwd = '../../../../home/appuser/grpc-node'
+ self.server_cwd = '../../../../home/appuser/grpc-node'
self.safename = str(self)
def client_cmd(self, args):
@@ -487,6 +489,7 @@ class PHP7Language:
def __init__(self):
self.client_cwd = None
+ self.server_cwd = None
self.safename = str(self)
def client_cmd(self, args):
@@ -495,6 +498,9 @@ class PHP7Language:
def cloud_to_prod_env(self):
return {}
+ def server_cmd(self, args):
+ return ['src/php/bin/interop_server.sh'] + args
+
def global_env(self):
return {}
@@ -505,7 +511,7 @@ class PHP7Language:
_SKIP_COMPUTE_ENGINE_CHANNEL_CREDS
def unimplemented_test_cases_server(self):
- return []
+ return _SKIP_COMPRESSION
def __str__(self):
return 'php7'
@@ -590,6 +596,9 @@ class RubyLanguage:
return 'ruby'
+_PYTHON_BINARY = 'py39/bin/python'
+
+
class PythonLanguage:
def __init__(self):
@@ -600,13 +609,13 @@ class PythonLanguage:
def client_cmd(self, args):
return [
- 'py37_native/bin/python', 'src/python/grpcio_tests/setup.py',
- 'run_interop', '--client', '--args="{}"'.format(' '.join(args))
+ _PYTHON_BINARY, 'src/python/grpcio_tests/setup.py', 'run_interop',
+ '--client', '--args="{}"'.format(' '.join(args))
]
def client_cmd_http2interop(self, args):
return [
- 'py37_native/bin/python',
+ _PYTHON_BINARY,
'src/python/grpcio_tests/tests/http2/negative_http2_client.py',
] + args
@@ -615,8 +624,8 @@ class PythonLanguage:
def server_cmd(self, args):
return [
- 'py37_native/bin/python', 'src/python/grpcio_tests/setup.py',
- 'run_interop', '--server', '--args="{}"'.format(' '.join(args))
+ _PYTHON_BINARY, 'src/python/grpcio_tests/setup.py', 'run_interop',
+ '--server', '--args="{}"'.format(' '.join(args))
]
def global_env(self):
@@ -648,14 +657,13 @@ class PythonAsyncIOLanguage:
def client_cmd(self, args):
return [
- 'py37_native/bin/python', 'src/python/grpcio_tests/setup.py',
- 'run_interop', '--use-asyncio', '--client',
- '--args="{}"'.format(' '.join(args))
+ _PYTHON_BINARY, 'src/python/grpcio_tests/setup.py', 'run_interop',
+ '--use-asyncio', '--client', '--args="{}"'.format(' '.join(args))
]
def client_cmd_http2interop(self, args):
return [
- 'py37_native/bin/python',
+ _PYTHON_BINARY,
'src/python/grpcio_tests/tests/http2/negative_http2_client.py',
] + args
@@ -664,8 +672,8 @@ class PythonAsyncIOLanguage:
def server_cmd(self, args):
return [
- 'py37_native/bin/python', 'src/python/grpcio_tests/setup.py',
- 'run_interop', '--use-asyncio', '--server',
+ _PYTHON_BINARY, 'src/python/grpcio_tests/setup.py',
+ 'py39/bin/python', 'src/python/grpcio_tests/setup.py',
'--args="{}"'.format(' '.join(args))
]
@@ -714,7 +722,7 @@ _LANGUAGES = {
# languages supported as cloud_to_cloud servers
_SERVERS = [
'c++', 'node', 'csharp', 'csharpcoreclr', 'aspnetcore', 'java', 'go',
- 'ruby', 'python', 'dart', 'pythonasyncio'
+ 'ruby', 'python', 'dart', 'pythonasyncio', 'php7'
]
_TEST_CASES = [
@@ -748,8 +756,8 @@ _GRPC_CLIENT_TEST_CASES_FOR_HTTP2_SERVER_TEST_CASES = {
'no_df_padding_sanity_test': 'large_unary'
}
-_HTTP2_SERVER_TEST_CASES_THAT_USE_GRPC_CLIENTS = _GRPC_CLIENT_TEST_CASES_FOR_HTTP2_SERVER_TEST_CASES.keys(
-)
+_HTTP2_SERVER_TEST_CASES_THAT_USE_GRPC_CLIENTS = list(
+ _GRPC_CLIENT_TEST_CASES_FOR_HTTP2_SERVER_TEST_CASES.keys())
_LANGUAGES_WITH_HTTP2_CLIENTS_FOR_HTTP2_SERVER_TEST_CASES = [
'java', 'go', 'python', 'c++'
@@ -770,11 +778,14 @@ DOCKER_WORKDIR_ROOT = '/var/local/git/grpc'
def docker_run_cmdline(cmdline, image, docker_args=[], cwd=None, environ=None):
"""Wraps given cmdline array to create 'docker run' cmdline from it."""
+
+ # don't use '-t' even when TTY is available, since that would break
+ # the testcases generated by tools/interop_matrix/create_testcases.sh
docker_cmdline = ['docker', 'run', '-i', '--rm=true']
# turn environ into -e docker args
if environ:
- for k, v in environ.items():
+ for k, v in list(environ.items()):
docker_cmdline += ['-e', '%s=%s' % (k, v)]
# set working directory
@@ -1128,8 +1139,6 @@ def build_interop_image_jobspec(language, tag=None):
'INTEROP_IMAGE': tag,
'BASE_NAME': 'grpc_interop_%s' % language.safename
}
- if not args.travis:
- env['TTY_FLAG'] = '-t'
build_job = jobset.JobSpec(
cmdline=['tools/run_tests/dockerize/build_interop_image.sh'],
environ=env,
@@ -1200,7 +1209,7 @@ argp.add_argument('--google_default_creds_use_key_file',
'google_default_credentials test case, e.g. by '
'setting env var GOOGLE_APPLICATION_CREDENTIALS.'))
argp.add_argument('--prod_servers',
- choices=prod_servers.keys(),
+ choices=list(prod_servers.keys()),
default=['default'],
nargs='+',
help=('The servers to run cloud_to_prod and '
@@ -1231,11 +1240,14 @@ argp.add_argument(
type=str,
help='Default GCE service account email to use for some auth interop tests.',
default='830293263384-compute@developer.gserviceaccount.com')
-argp.add_argument('-t',
- '--travis',
- default=False,
- action='store_const',
- const=True)
+argp.add_argument(
+ '-t',
+ '--travis',
+ default=False,
+ action='store_const',
+ const=True,
+ help='When set, indicates that the script is running on CI (= not locally).'
+)
argp.add_argument('-v',
'--verbose',
default=False,
@@ -1541,7 +1553,7 @@ try:
(server_host, server_port) = server[1].split(':')
server_addresses[server_name] = (server_host, server_port)
- for server_name, server_address in server_addresses.items():
+ for server_name, server_address in list(server_addresses.items()):
(server_host, server_port) = server_address
server_language = _LANGUAGES.get(server_name, None)
skip_server = [] # test cases unimplemented by server
@@ -1655,7 +1667,7 @@ try:
report_utils.render_junit_xml_report(resultset, _TESTS_XML_REPORT)
- for name, job in resultset.items():
+ for name, job in list(resultset.items()):
if "http2" in name:
job[0].http2results = aggregate_http2_results(job[0].message)
@@ -1668,7 +1680,7 @@ try:
sys.exit(0)
finally:
# Check if servers are still running.
- for server, job in server_jobs.items():
+ for server, job in list(server_jobs.items()):
if not job.is_running():
print('Server "%s" has exited prematurely.' % server)
diff --git a/grpc/tools/run_tests/run_microbenchmark.py b/grpc/tools/run_tests/run_microbenchmark.py
index 7cd4b966..7249dab6 100755
--- a/grpc/tools/run_tests/run_microbenchmark.py
+++ b/grpc/tools/run_tests/run_microbenchmark.py
@@ -203,11 +203,25 @@ def run_summary(bm_name, cfg, base_json_name):
def collect_summary(bm_name, args):
- heading('Summary: %s [no counters]' % bm_name)
- text(run_summary(bm_name, 'opt', bm_name))
- heading('Summary: %s [with counters]' % bm_name)
- text(run_summary(bm_name, 'counters', bm_name))
- if args.bigquery_upload:
+ # no counters, run microbenchmark and add summary
+ # both to HTML report and to console.
+ nocounters_heading = 'Summary: %s [no counters]' % bm_name
+ nocounters_summary = run_summary(bm_name, 'opt', bm_name)
+ heading(nocounters_heading)
+ text(nocounters_summary)
+ print(nocounters_heading)
+ print(nocounters_summary)
+
+ # with counters, run microbenchmark and add summary
+ # both to HTML report and to console.
+ counters_heading = 'Summary: %s [with counters]' % bm_name
+ counters_summary = run_summary(bm_name, 'counters', bm_name)
+ heading(counters_heading)
+ text(counters_summary)
+ print(counters_heading)
+ print(counters_summary)
+
+ if args.bq_result_table:
with open('%s.csv' % bm_name, 'w') as f:
f.write(
subprocess.check_output([
@@ -215,10 +229,10 @@ def collect_summary(bm_name, args):
'%s.counters.json' % bm_name,
'%s.opt.json' % bm_name
]).decode('UTF-8'))
- subprocess.check_call([
- 'bq', 'load', 'microbenchmarks.microbenchmarks',
- '%s.csv' % bm_name
- ])
+ subprocess.check_call(
+ ['bq', 'load',
+ '%s' % args.bq_result_table,
+ '%s.csv' % bm_name])
collectors = {
@@ -241,11 +255,12 @@ argp.add_argument('-b',
nargs='+',
type=str,
help='Which microbenchmarks should be run')
-argp.add_argument('--bigquery_upload',
- default=False,
- action='store_const',
- const=True,
- help='Upload results from summary collection to bigquery')
+argp.add_argument(
+ '--bq_result_table',
+ default='',
+ type=str,
+ help='Upload results from summary collection to a specified bigquery table.'
+)
argp.add_argument(
'--summary_time',
default=None,
diff --git a/grpc/tools/run_tests/run_performance_tests.py b/grpc/tools/run_tests/run_performance_tests.py
index 0845a712..869d5826 100755
--- a/grpc/tools/run_tests/run_performance_tests.py
+++ b/grpc/tools/run_tests/run_performance_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,6 +30,7 @@ import tempfile
import time
import traceback
import uuid
+
import six
import performance.scenario_config as scenario_config
@@ -168,12 +169,12 @@ def create_netperf_jobspec(server_host='localhost',
# If netperf is running remotely, the env variables populated by Jenkins
# won't be available on the client, but we need them for uploading results
# to BigQuery.
- jenkins_job_name = os.getenv('JOB_NAME')
+ jenkins_job_name = os.getenv('KOKORO_JOB_NAME')
if jenkins_job_name:
- cmd += 'JOB_NAME="%s" ' % jenkins_job_name
- jenkins_build_number = os.getenv('BUILD_NUMBER')
+ cmd += 'KOKORO_JOB_NAME="%s" ' % jenkins_job_name
+ jenkins_build_number = os.getenv('KOKORO_BUILD_NUMBER')
if jenkins_build_number:
- cmd += 'BUILD_NUMBER="%s" ' % jenkins_build_number
+ cmd += 'KOKORO_BUILD_NUMBER="%s" ' % jenkins_build_number
cmd += 'tools/run_tests/performance/run_netperf.sh'
if client_host:
@@ -252,7 +253,7 @@ def prepare_remote_hosts(hosts, prepare_local=False):
def build_on_remote_hosts(hosts,
- languages=scenario_config.LANGUAGES.keys(),
+ languages=list(scenario_config.LANGUAGES.keys()),
build_local=False):
"""Builds performance worker on remote hosts (and maybe also locally)."""
build_timeout = 45 * 60
@@ -354,7 +355,8 @@ def create_scenarios(languages,
server_cpu_load=0):
"""Create jobspecs for scenarios to run."""
all_workers = [
- worker for workers in workers_by_lang.values() for worker in workers
+ worker for workers in list(workers_by_lang.values())
+ for worker in workers
]
scenarios = []
_NO_WORKERS = []
diff --git a/grpc/tools/run_tests/run_tests.py b/grpc/tools/run_tests/run_tests.py
index 5176331c..bf1b8d0e 100755
--- a/grpc/tools/run_tests/run_tests.py
+++ b/grpc/tools/run_tests/run_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,16 +34,18 @@ import socket
import subprocess
import sys
import tempfile
-import traceback
import time
-from six.moves import urllib
+import traceback
import uuid
+
import six
+from six.moves import urllib
import python_utils.jobset as jobset
import python_utils.report_utils as report_utils
-import python_utils.watch_dirs as watch_dirs
import python_utils.start_port_server as start_port_server
+import python_utils.watch_dirs as watch_dirs
+
try:
from python_utils.upload_test_results import upload_results_to_bq
except (ImportError):
@@ -61,7 +63,7 @@ _FORCE_ENVIRON_FOR_WRAPPERS = {
}
_POLLING_STRATEGIES = {
- 'linux': ['epollex', 'epoll1', 'poll'],
+ 'linux': ['epoll1', 'poll'],
'mac': ['poll'],
}
@@ -92,6 +94,19 @@ def max_parallel_tests_for_current_platform():
return 1024
+def _print_debug_info_epilogue(dockerfile_dir=None):
+ """Use to print useful info for debug/repro just before exiting."""
+ print('')
+ print('=== run_tests.py DEBUG INFO ===')
+ print('command: \"%s\"' % ' '.join(sys.argv))
+ if dockerfile_dir:
+ print('dockerfile: %s' % dockerfile_dir)
+ kokoro_job_name = os.getenv('KOKORO_JOB_NAME')
+ if kokoro_job_name:
+ print('kokoro job name: %s' % kokoro_job_name)
+ print('===============================')
+
+
# SimpleConfig: just compile with CONFIG=config, and run the binary to test
class Config(object):
@@ -166,7 +181,7 @@ def _check_arch(arch, supported_archs):
def _is_use_docker_child():
"""Returns True if running running as a --use_docker child."""
- return True if os.getenv('RUN_TESTS_COMMAND') else False
+ return True if os.getenv('DOCKER_RUN_SCRIPT_COMMAND') else False
_PythonConfigVars = collections.namedtuple('_ConfigVars', [
@@ -176,22 +191,18 @@ _PythonConfigVars = collections.namedtuple('_ConfigVars', [
'venv_relative_python',
'toolchain',
'runner',
- 'test_name',
- 'iomgr_platform',
])
def _python_config_generator(name, major, minor, bits, config_vars):
- name += '_' + config_vars.iomgr_platform
- return PythonConfig(
- name, config_vars.shell + config_vars.builder +
- config_vars.builder_prefix_arguments +
- [_python_pattern_function(major=major, minor=minor, bits=bits)] +
- [name] + config_vars.venv_relative_python + config_vars.toolchain,
- config_vars.shell + config_vars.runner + [
- os.path.join(name, config_vars.venv_relative_python[0]),
- config_vars.test_name
- ])
+ build = (config_vars.shell + config_vars.builder +
+ config_vars.builder_prefix_arguments +
+ [_python_pattern_function(major=major, minor=minor, bits=bits)] +
+ [name] + config_vars.venv_relative_python + config_vars.toolchain)
+ run = (config_vars.shell + config_vars.runner + [
+ os.path.join(name, config_vars.venv_relative_python[0]),
+ ])
+ return PythonConfig(name, build, run)
def _pypy_config_generator(name, major, config_vars):
@@ -229,37 +240,58 @@ def _pypy_pattern_function(major):
class CLanguage(object):
- def __init__(self, make_target, test_lang):
- self.make_target = make_target
+ def __init__(self, lang_suffix, test_lang):
+ self.lang_suffix = lang_suffix
self.platform = platform_string()
self.test_lang = test_lang
def configure(self, config, args):
self.config = config
self.args = args
- self._make_options = []
- self._use_cmake = True
if self.platform == 'windows':
_check_compiler(self.args.compiler, [
- 'default', 'cmake', 'cmake_vs2015', 'cmake_vs2017',
- 'cmake_vs2019'
+ 'default',
+ 'cmake',
+ 'cmake_ninja_vs2015',
+ 'cmake_ninja_vs2017',
+ 'cmake_vs2015',
+ 'cmake_vs2017',
+ 'cmake_vs2019',
])
_check_arch(self.args.arch, ['default', 'x64', 'x86'])
- if self.args.compiler == 'cmake_vs2019':
- cmake_generator_option = 'Visual Studio 16 2019'
+
+ activate_vs_tools = ''
+ if self.args.compiler == 'cmake_ninja_vs2015' or self.args.compiler == 'cmake' or self.args.compiler == 'default':
+ # cmake + ninja build is the default because it is faster and supports boringssl assembly optimizations
+ # the compiler used is exactly the same as for cmake_vs2015
+ cmake_generator = 'Ninja'
+ activate_vs_tools = '2015'
+ elif self.args.compiler == 'cmake_ninja_vs2017':
+ cmake_generator = 'Ninja'
+ activate_vs_tools = '2017'
+ elif self.args.compiler == 'cmake_vs2015':
+ cmake_generator = 'Visual Studio 14 2015'
elif self.args.compiler == 'cmake_vs2017':
- cmake_generator_option = 'Visual Studio 15 2017'
+ cmake_generator = 'Visual Studio 15 2017'
+ elif self.args.compiler == 'cmake_vs2019':
+ cmake_generator = 'Visual Studio 16 2019'
else:
- cmake_generator_option = 'Visual Studio 14 2015'
- cmake_arch_option = 'x64' if self.args.arch == 'x64' else 'Win32'
- self._cmake_configure_extra_args = [
- '-G', cmake_generator_option, '-A', cmake_arch_option
- ]
+ print('should never reach here.')
+ sys.exit(1)
+
+ self._cmake_configure_extra_args = []
+ self._cmake_generator_windows = cmake_generator
+ # required to pass as cmake "-A" configuration for VS builds (but not for Ninja)
+ self._cmake_architecture_windows = 'x64' if self.args.arch == 'x64' else 'Win32'
+ # when builing with Ninja, the VS common tools need to be activated first
+ self._activate_vs_tools_windows = activate_vs_tools
+ self._vs_tools_architecture_windows = 'x64' if self.args.arch == 'x64' else 'x86'
+
else:
if self.platform == 'linux':
# Allow all the known architectures. _check_arch_option has already checked that we're not doing
# something illegal when not running under docker.
- _check_arch(self.args.arch, ['default', 'x64', 'x86'])
+ _check_arch(self.args.arch, ['default', 'x64', 'x86', 'arm64'])
else:
_check_arch(self.args.arch, ['default'])
@@ -271,36 +303,17 @@ class CLanguage(object):
# see https://github.com/grpc/grpc/blob/b5b8578b3f8b4a9ce61ed6677e19d546e43c5c68/tools/run_tests/artifacts/artifact_targets.py#L253
self._cmake_configure_extra_args.append('-DOPENSSL_NO_ASM=ON')
- if args.iomgr_platform == "uv":
- cflags = '-DGRPC_UV -DGRPC_CUSTOM_IOMGR_THREAD_CHECK -DGRPC_CUSTOM_SOCKET '
- try:
- cflags += subprocess.check_output(
- ['pkg-config', '--cflags', 'libuv']).strip() + ' '
- except (subprocess.CalledProcessError, OSError):
- pass
- try:
- ldflags = subprocess.check_output(
- ['pkg-config', '--libs', 'libuv']).strip() + ' '
- except (subprocess.CalledProcessError, OSError):
- ldflags = '-luv '
- self._make_options += [
- 'EXTRA_CPPFLAGS={}'.format(cflags),
- 'EXTRA_LDLIBS={}'.format(ldflags)
- ]
-
def test_specs(self):
out = []
binaries = get_c_tests(self.args.travis, self.test_lang)
for target in binaries:
- if self._use_cmake and target.get('boringssl', False):
+ if target.get('boringssl', False):
# cmake doesn't build boringssl tests
continue
auto_timeout_scaling = target.get('auto_timeout_scaling', True)
polling_strategies = (_POLLING_STRATEGIES.get(
self.platform, ['all']) if target.get('uses_polling', True) else
['none'])
- if self.args.iomgr_platform == 'uv':
- polling_strategies = ['all']
for polling_strategy in polling_strategies:
env = {
'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH':
@@ -335,11 +348,8 @@ class CLanguage(object):
binary = 'cmake/build/%s/%s.exe' % (_MSBUILD_CONFIG[
self.config.build_config], target['name'])
else:
- if self._use_cmake:
- binary = 'cmake/build/%s' % target['name']
- else:
- binary = 'bins/%s/%s' % (self.config.build_config,
- target['name'])
+ binary = 'cmake/build/%s' % target['name']
+
cpu_cost = target['cpu_cost']
if cpu_cost == 'capacity':
cpu_cost = multiprocessing.cpu_count()
@@ -427,30 +437,31 @@ class CLanguage(object):
print('\nWARNING: binary not found, skipping', binary)
return sorted(out)
- def make_targets(self):
- if self.platform == 'windows':
- # don't build tools on windows just yet
- return ['buildtests_%s' % self.make_target]
- return [
- 'buildtests_%s' % self.make_target,
- 'tools_%s' % self.make_target, 'check_epollexclusive'
- ]
-
- def make_options(self):
- return self._make_options
-
def pre_build_steps(self):
+ return []
+
+ def build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\helper_scripts\\pre_build_cmake.bat'] +
- self._cmake_configure_extra_args]
- elif self._use_cmake:
- return [['tools/run_tests/helper_scripts/pre_build_cmake.sh'] +
- self._cmake_configure_extra_args]
+ return [[
+ 'tools\\run_tests\\helper_scripts\\build_cxx.bat',
+ '-DgRPC_BUILD_MSVC_MP_COUNT=%d' % self.args.jobs
+ ] + self._cmake_configure_extra_args]
else:
- return []
+ return [['tools/run_tests/helper_scripts/build_cxx.sh'] +
+ self._cmake_configure_extra_args]
- def build_steps(self):
- return []
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ environ = {'GRPC_RUN_TESTS_CXX_LANGUAGE_SUFFIX': self.lang_suffix}
+ if self.platform == 'windows':
+ environ['GRPC_CMAKE_GENERATOR'] = self._cmake_generator_windows
+ environ[
+ 'GRPC_CMAKE_ARCHITECTURE'] = self._cmake_architecture_windows
+ environ[
+ 'GRPC_BUILD_ACTIVATE_VS_TOOLS'] = self._activate_vs_tools_windows
+ environ[
+ 'GRPC_BUILD_VS_TOOLS_ARCHITECTURE'] = self._vs_tools_architecture_windows
+ return environ
def post_tests_steps(self):
if self.platform == 'windows':
@@ -458,12 +469,6 @@ class CLanguage(object):
else:
return [['tools/run_tests/helper_scripts/post_tests_c.sh']]
- def makefile_name(self):
- if self._use_cmake:
- return 'cmake/build/Makefile'
- else:
- return 'Makefile'
-
def _clang_cmake_configure_extra_args(self, version_suffix=''):
return [
'-DCMAKE_C_COMPILER=clang%s' % version_suffix,
@@ -477,24 +482,24 @@ class CLanguage(object):
# so we only allow the non-specific choices.
_check_compiler(compiler, ['default', 'cmake'])
- if compiler == 'gcc4.9' or compiler == 'default' or compiler == 'cmake':
- return ('jessie', [])
- elif compiler == 'gcc5.3':
- return ('ubuntu1604', [])
- elif compiler == 'gcc7.4':
- return ('ubuntu1804', [])
- elif compiler == 'gcc8.3':
- return ('buster', [])
+ if compiler == 'default' or compiler == 'cmake':
+ return ('debian11', [])
+ elif compiler == 'gcc5':
+ return ('gcc_5', [])
+ elif compiler == 'gcc10.2':
+ return ('debian11', [])
+ elif compiler == 'gcc10.2_openssl102':
+ return ('debian11_openssl102', [
+ "-DgRPC_SSL_PROVIDER=package",
+ ])
+ elif compiler == 'gcc11':
+ return ('gcc_11', [])
elif compiler == 'gcc_musl':
return ('alpine', [])
- elif compiler == 'clang4.0':
- return ('ubuntu1604',
- self._clang_cmake_configure_extra_args(
- version_suffix='-4.0'))
- elif compiler == 'clang5.0':
- return ('ubuntu1604',
- self._clang_cmake_configure_extra_args(
- version_suffix='-5.0'))
+ elif compiler == 'clang4':
+ return ('clang_4', self._clang_cmake_configure_extra_args())
+ elif compiler == 'clang13':
+ return ('clang_13', self._clang_cmake_configure_extra_args())
else:
raise Exception('Compiler %s not supported.' % compiler)
@@ -503,7 +508,7 @@ class CLanguage(object):
self._docker_distro, _docker_arch_suffix(self.args.arch))
def __str__(self):
- return self.make_target
+ return self.lang_suffix
# This tests Node on grpc/grpc-node and will become the standard for Node testing
@@ -551,21 +556,16 @@ class RemoteNodeLanguage(object):
def pre_build_steps(self):
return []
- def make_targets(self):
- return []
-
- def make_options(self):
- return []
-
def build_steps(self):
return []
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
return []
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
return 'tools/dockerfile/test/node_jessie_%s' % _docker_arch_suffix(
self.args.arch)
@@ -580,7 +580,6 @@ class Php7Language(object):
self.config = config
self.args = args
_check_compiler(self.args.compiler, ['default'])
- self._make_options = ['EMBED_OPENSSL=true', 'EMBED_ZLIB=true']
def test_specs(self):
return [
@@ -591,23 +590,18 @@ class Php7Language(object):
def pre_build_steps(self):
return []
- def make_targets(self):
- return ['static_c', 'shared_c']
-
- def make_options(self):
- return self._make_options
-
def build_steps(self):
return [['tools/run_tests/helper_scripts/build_php.sh']]
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
return [['tools/run_tests/helper_scripts/post_tests_php.sh']]
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
- return 'tools/dockerfile/test/php7_jessie_%s' % _docker_arch_suffix(
+ return 'tools/dockerfile/test/php7_debian11_%s' % _docker_arch_suffix(
self.args.arch)
def __str__(self):
@@ -622,13 +616,17 @@ class PythonConfig(
class PythonLanguage(object):
_TEST_SPECS_FILE = {
- 'native': 'src/python/grpcio_tests/tests/tests.json',
- 'gevent': 'src/python/grpcio_tests/tests/tests.json',
- 'asyncio': 'src/python/grpcio_tests/tests_aio/tests.json',
+ 'native': ['src/python/grpcio_tests/tests/tests.json'],
+ 'gevent': [
+ 'src/python/grpcio_tests/tests/tests.json',
+ 'src/python/grpcio_tests/tests_gevent/tests.json',
+ ],
+ 'asyncio': ['src/python/grpcio_tests/tests_aio/tests.json'],
}
- _TEST_FOLDER = {
- 'native': 'test',
- 'gevent': 'test',
+
+ _TEST_COMMAND = {
+ 'native': 'test_lite',
+ 'gevent': 'test_gevent',
'asyncio': 'test_aio',
}
@@ -639,65 +637,72 @@ class PythonLanguage(object):
def test_specs(self):
# load list of known test suites
- with open(self._TEST_SPECS_FILE[
- self.args.iomgr_platform]) as tests_json_file:
- tests_json = json.load(tests_json_file)
- environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS)
- # TODO(https://github.com/grpc/grpc/issues/21401) Fork handlers is not
- # designed for non-native IO manager. It has a side-effect that
- # overrides threading settings in C-Core.
- if args.iomgr_platform != 'native':
- environment['GRPC_ENABLE_FORK_SUPPORT'] = '0'
- return [
- self.config.job_spec(
- config.run,
- timeout_seconds=8 * 60,
- environ=dict(GRPC_PYTHON_TESTRUNNER_FILTER=str(suite_name),
- **environment),
- shortname='%s.%s.%s' %
- (config.name, self._TEST_FOLDER[self.args.iomgr_platform],
- suite_name),
- ) for suite_name in tests_json for config in self.pythons
- ]
+ jobs = []
+ for io_platform in self._TEST_SPECS_FILE:
+ test_cases = []
+ for tests_json_file_name in self._TEST_SPECS_FILE[io_platform]:
+ with open(tests_json_file_name) as tests_json_file:
+ test_cases.extend(json.load(tests_json_file))
+
+ environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS)
+ # TODO(https://github.com/grpc/grpc/issues/21401) Fork handlers is not
+ # designed for non-native IO manager. It has a side-effect that
+ # overrides threading settings in C-Core.
+ if io_platform != 'native':
+ environment['GRPC_ENABLE_FORK_SUPPORT'] = '0'
+ for python_config in self.pythons:
+ # TODO(https://github.com/grpc/grpc/issues/23784) allow gevent
+ # to run on later version once issue solved.
+ if io_platform == 'gevent' and python_config.name != 'py36':
+ continue
+ jobs.extend([
+ self.config.job_spec(
+ python_config.run + [self._TEST_COMMAND[io_platform]],
+ timeout_seconds=8 * 60,
+ environ=dict(
+ GRPC_PYTHON_TESTRUNNER_FILTER=str(test_case),
+ **environment),
+ shortname='%s.%s.%s' %
+ (python_config.name, io_platform, test_case),
+ ) for test_case in test_cases
+ ])
+ return jobs
def pre_build_steps(self):
return []
- def make_targets(self):
- return []
-
- def make_options(self):
- return []
-
def build_steps(self):
return [config.build for config in self.pythons]
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
if self.config.build_config != 'gcov':
return []
else:
return [['tools/run_tests/helper_scripts/post_tests_python.sh']]
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
return 'tools/dockerfile/test/python_%s_%s' % (
- self._python_manager_name(), _docker_arch_suffix(self.args.arch))
+ self._python_docker_distro_name(),
+ _docker_arch_suffix(self.args.arch))
- def _python_manager_name(self):
+ def _python_docker_distro_name(self):
"""Choose the docker image to use based on python version."""
- if self.args.compiler in [
- 'python2.7', 'python3.5', 'python3.6', 'python3.7', 'python3.8'
- ]:
- return 'stretch_' + self.args.compiler[len('python'):]
- elif self.args.compiler == 'python_alpine':
+ if self.args.compiler == 'python_alpine':
return 'alpine'
else:
- return 'stretch_default'
+ return 'debian11_default'
def _get_pythons(self, args):
"""Get python runtimes to test with, based on current platform, architecture, compiler etc."""
+ if args.iomgr_platform != 'native':
+ raise ValueError(
+ 'Python builds no longer differentiate IO Manager platforms, please use "native"'
+ )
+
if args.arch == 'x86':
bits = '32'
else:
@@ -722,35 +727,13 @@ class PythonLanguage(object):
venv_relative_python = ['bin/python']
toolchain = ['unix']
- # Selects the corresponding testing mode.
- # See src/python/grpcio_tests/commands.py for implementation details.
- if args.iomgr_platform == 'native':
- test_command = 'test_lite'
- elif args.iomgr_platform == 'gevent':
- test_command = 'test_gevent'
- elif args.iomgr_platform == 'asyncio':
- test_command = 'test_aio'
- else:
- raise ValueError('Unsupported IO Manager platform: %s' %
- args.iomgr_platform)
runner = [
os.path.abspath('tools/run_tests/helper_scripts/run_python.sh')
]
config_vars = _PythonConfigVars(shell, builder,
builder_prefix_arguments,
- venv_relative_python, toolchain, runner,
- test_command, args.iomgr_platform)
- python27_config = _python_config_generator(name='py27',
- major='2',
- minor='7',
- bits=bits,
- config_vars=config_vars)
- python35_config = _python_config_generator(name='py35',
- major='3',
- minor='5',
- bits=bits,
- config_vars=config_vars)
+ venv_relative_python, toolchain, runner)
python36_config = _python_config_generator(name='py36',
major='3',
minor='6',
@@ -766,6 +749,16 @@ class PythonLanguage(object):
minor='8',
bits=bits,
config_vars=config_vars)
+ python39_config = _python_config_generator(name='py39',
+ major='3',
+ minor='9',
+ bits=bits,
+ config_vars=config_vars)
+ python310_config = _python_config_generator(name='py310',
+ major='3',
+ minor='10',
+ bits=bits,
+ config_vars=config_vars)
pypy27_config = _pypy_config_generator(name='pypy',
major='2',
config_vars=config_vars)
@@ -773,62 +766,47 @@ class PythonLanguage(object):
major='3',
config_vars=config_vars)
- if args.iomgr_platform == 'asyncio':
- if args.compiler not in ('default', 'python3.6', 'python3.7',
- 'python3.8'):
- raise Exception(
- 'Compiler %s not supported with IO Manager platform: %s' %
- (args.compiler, args.iomgr_platform))
-
if args.compiler == 'default':
if os.name == 'nt':
- if args.iomgr_platform == 'gevent':
- # TODO(https://github.com/grpc/grpc/issues/23784) allow
- # gevent to run on later version once issue solved.
- return (python36_config,)
- else:
- return (python38_config,)
+ return (python38_config,)
+ elif os.uname()[0] == 'Darwin':
+ # NOTE(rbellevi): Testing takes significantly longer on
+ # MacOS, so we restrict the number of interpreter versions
+ # tested.
+ return (python38_config,)
+ elif platform.machine() == 'aarch64':
+ # Currently the python_debian11_default_arm64 docker image
+ # only has python3.9 installed (and that seems sufficient
+ # for arm64 testing)
+ return (python39_config,)
else:
- if args.iomgr_platform == 'asyncio':
- return (python36_config, python38_config)
- elif os.uname()[0] == 'Darwin':
- # NOTE(rbellevi): Testing takes significantly longer on
- # MacOS, so we restrict the number of interpreter versions
- # tested.
- return (
- python27_config,
- python38_config,
- )
- else:
- return (
- python27_config,
- python35_config,
- python37_config,
- python38_config,
- )
- elif args.compiler == 'python2.7':
- return (python27_config,)
- elif args.compiler == 'python3.5':
- return (python35_config,)
+ return (
+ python36_config,
+ python38_config,
+ )
elif args.compiler == 'python3.6':
return (python36_config,)
elif args.compiler == 'python3.7':
return (python37_config,)
elif args.compiler == 'python3.8':
return (python38_config,)
+ elif args.compiler == 'python3.9':
+ return (python39_config,)
+ elif args.compiler == 'python3.10':
+ return (python310_config,)
elif args.compiler == 'pypy':
return (pypy27_config,)
elif args.compiler == 'pypy3':
return (pypy32_config,)
elif args.compiler == 'python_alpine':
- return (python27_config,)
+ return (python38_config,)
elif args.compiler == 'all_the_cpythons':
return (
- python27_config,
- python35_config,
python36_config,
python37_config,
python38_config,
+ python39_config,
+ python310_config,
)
else:
raise Exception('Compiler %s not supported.' % args.compiler)
@@ -880,23 +858,18 @@ class RubyLanguage(object):
def pre_build_steps(self):
return [['tools/run_tests/helper_scripts/pre_build_ruby.sh']]
- def make_targets(self):
- return []
-
- def make_options(self):
- return []
-
def build_steps(self):
return [['tools/run_tests/helper_scripts/build_ruby.sh']]
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
return [['tools/run_tests/helper_scripts/post_tests_ruby.sh']]
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
- return 'tools/dockerfile/test/ruby_buster_%s' % _docker_arch_suffix(
+ return 'tools/dockerfile/test/ruby_debian11_%s' % _docker_arch_suffix(
self.args.arch)
def __str__(self):
@@ -911,13 +884,19 @@ class CSharpLanguage(object):
def configure(self, config, args):
self.config = config
self.args = args
+ _check_compiler(self.args.compiler, ['default', 'coreclr', 'mono'])
+ if self.args.compiler == 'default':
+ # test both runtimes by default
+ self.test_runtimes = ['coreclr', 'mono']
+ else:
+ # only test the specified runtime
+ self.test_runtimes = [self.args.compiler]
+
if self.platform == 'windows':
- _check_compiler(self.args.compiler, ['default', 'coreclr'])
_check_arch(self.args.arch, ['default'])
self._cmake_arch_option = 'x64'
else:
- _check_compiler(self.args.compiler, ['default', 'coreclr'])
- self._docker_distro = 'stretch'
+ self._docker_distro = 'debian11'
def test_specs(self):
with open('src/csharp/tests.json') as f:
@@ -925,28 +904,30 @@ class CSharpLanguage(object):
msbuild_config = _MSBUILD_CONFIG[self.config.build_config]
nunit_args = ['--labels=All', '--noresult', '--workers=1']
- assembly_subdir = 'bin/%s' % msbuild_config
- assembly_extension = '.exe'
- if self.args.compiler == 'coreclr':
- assembly_subdir += '/netcoreapp2.1'
- runtime_cmd = ['dotnet', 'exec']
- assembly_extension = '.dll'
- else:
- assembly_subdir += '/net45'
- if self.platform == 'windows':
- runtime_cmd = []
- elif self.platform == 'mac':
- # mono before version 5.2 on MacOS defaults to 32bit runtime
- runtime_cmd = ['mono', '--arch=64']
+ specs = []
+ for test_runtime in self.test_runtimes:
+ if test_runtime == 'coreclr':
+ assembly_extension = '.dll'
+ assembly_subdir = 'bin/%s/netcoreapp3.1' % msbuild_config
+ runtime_cmd = ['dotnet', 'exec']
+ elif test_runtime == 'mono':
+ assembly_extension = '.exe'
+ assembly_subdir = 'bin/%s/net45' % msbuild_config
+ if self.platform == 'windows':
+ runtime_cmd = []
+ elif self.platform == 'mac':
+ # mono before version 5.2 on MacOS defaults to 32bit runtime
+ runtime_cmd = ['mono', '--arch=64']
+ else:
+ runtime_cmd = ['mono']
else:
- runtime_cmd = ['mono']
+ raise Exception('Illegal runtime "%s" was specified.')
+
+ for assembly in six.iterkeys(tests_by_assembly):
+ assembly_file = 'src/csharp/%s/%s/%s%s' % (
+ assembly, assembly_subdir, assembly, assembly_extension)
- specs = []
- for assembly in six.iterkeys(tests_by_assembly):
- assembly_file = 'src/csharp/%s/%s/%s%s' % (
- assembly, assembly_subdir, assembly, assembly_extension)
- if self.config.build_config != 'gcov' or self.platform != 'windows':
# normally, run each test as a separate process
for test in tests_by_assembly[assembly]:
cmdline = runtime_cmd + [assembly_file,
@@ -954,64 +935,34 @@ class CSharpLanguage(object):
specs.append(
self.config.job_spec(
cmdline,
- shortname='csharp.%s' % test,
+ shortname='csharp.%s.%s' % (test_runtime, test),
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
- else:
- # For C# test coverage, run all tests from the same assembly at once
- # using OpenCover.Console (only works on Windows).
- cmdline = [
- 'src\\csharp\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe',
- '-target:%s' % assembly_file, '-targetdir:src\\csharp',
- '-targetargs:%s' % ' '.join(nunit_args),
- '-filter:+[Grpc.Core]*', '-register:user',
- '-output:src\\csharp\\coverage_csharp_%s.xml' % assembly
- ]
-
- # set really high cpu_cost to make sure instances of OpenCover.Console run exclusively
- # to prevent problems with registering the profiler.
- run_exclusive = 1000000
- specs.append(
- self.config.job_spec(cmdline,
- shortname='csharp.coverage.%s' %
- assembly,
- cpu_cost=run_exclusive,
- environ=_FORCE_ENVIRON_FOR_WRAPPERS))
return specs
def pre_build_steps(self):
if self.platform == 'windows':
- return [[
- 'tools\\run_tests\\helper_scripts\\pre_build_csharp.bat',
- self._cmake_arch_option
- ]]
+ return [['tools\\run_tests\\helper_scripts\\pre_build_csharp.bat']]
else:
return [['tools/run_tests/helper_scripts/pre_build_csharp.sh']]
- def make_targets(self):
- return ['grpc_csharp_ext']
-
- def make_options(self):
- return []
-
def build_steps(self):
if self.platform == 'windows':
return [['tools\\run_tests\\helper_scripts\\build_csharp.bat']]
else:
return [['tools/run_tests/helper_scripts/build_csharp.sh']]
- def post_tests_steps(self):
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
if self.platform == 'windows':
- return [['tools\\run_tests\\helper_scripts\\post_tests_csharp.bat']]
+ return {'ARCHITECTURE': self._cmake_arch_option}
else:
- return [['tools/run_tests/helper_scripts/post_tests_csharp.sh']]
+ return {}
- def makefile_name(self):
+ def post_tests_steps(self):
if self.platform == 'windows':
- return 'cmake/build/%s/Makefile' % self._cmake_arch_option
+ return [['tools\\run_tests\\helper_scripts\\post_tests_csharp.bat']]
else:
- # no need to set x86 specific flags as run_tests.py
- # currently forbids x86 C# builds on both Linux and MacOS.
- return 'cmake/build/Makefile'
+ return [['tools/run_tests/helper_scripts/post_tests_csharp.sh']]
def dockerfile_dir(self):
return 'tools/dockerfile/test/csharp_%s_%s' % (
@@ -1107,6 +1058,13 @@ class ObjCLanguage(object):
shortname='ios-test-cfstream-tests',
cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
+ out.append(
+ self.config.job_spec(
+ ['src/objective-c/tests/CoreTests/build_and_run_tests.sh'],
+ timeout_seconds=60 * 60,
+ shortname='ios-test-core-tests',
+ cpu_cost=1e6,
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS))
# TODO: replace with run_one_test_bazel.sh when Bazel-Xcode is stable
out.append(
self.config.job_spec(['src/objective-c/tests/run_one_test.sh'],
@@ -1168,21 +1126,16 @@ class ObjCLanguage(object):
def pre_build_steps(self):
return []
- def make_targets(self):
- return []
-
- def make_options(self):
- return []
-
def build_steps(self):
return []
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
return []
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
return None
@@ -1220,21 +1173,16 @@ class Sanity(object):
def pre_build_steps(self):
return []
- def make_targets(self):
- return ['run_dep_checks']
-
- def make_options(self):
- return []
-
def build_steps(self):
return []
+ def build_steps_environ(self):
+ """Extra environment variables set for pre_build_steps and build_steps jobs."""
+ return {}
+
def post_tests_steps(self):
return []
- def makefile_name(self):
- return 'Makefile'
-
def dockerfile_dir(self):
return 'tools/dockerfile/test/sanity'
@@ -1266,6 +1214,16 @@ _MSBUILD_CONFIG = {
}
+def _build_step_environ(cfg, extra_env={}):
+ """Environment variables set for each build step."""
+ environ = {'CONFIG': cfg, 'GRPC_RUN_TESTS_JOBS': str(args.jobs)}
+ msbuild_cfg = _MSBUILD_CONFIG.get(cfg)
+ if msbuild_cfg:
+ environ['MSBUILD_CONFIG'] = msbuild_cfg
+ environ.update(extra_env)
+ return environ
+
+
def _windows_arch_option(arch):
"""Returns msbuild cmdline option for selected architecture."""
if arch == 'default' or arch == 'x86':
@@ -1283,12 +1241,15 @@ def _check_arch_option(arch):
_windows_arch_option(arch)
elif platform_string() == 'linux':
# On linux, we need to be running under docker with the right architecture.
+ runtime_machine = platform.machine()
runtime_arch = platform.architecture()[0]
if arch == 'default':
return
- elif runtime_arch == '64bit' and arch == 'x64':
+ elif runtime_machine == 'x86_64' and runtime_arch == '64bit' and arch == 'x64':
+ return
+ elif runtime_machine == 'x86_64' and runtime_arch == '32bit' and arch == 'x86':
return
- elif runtime_arch == '32bit' and arch == 'x86':
+ elif runtime_machine == 'aarch64' and runtime_arch == '64bit' and arch == 'arm64':
return
else:
print(
@@ -1308,6 +1269,8 @@ def _docker_arch_suffix(arch):
return 'x64'
elif arch == 'x86':
return 'x86'
+ elif arch == 'arm64':
+ return 'arm64'
else:
print('Architecture %s not supported with current settings.' % arch)
sys.exit(1)
@@ -1348,6 +1311,175 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
+def _shut_down_legacy_server(legacy_server_port):
+ """Shut down legacy version of port server."""
+ try:
+ version = int(
+ urllib.request.urlopen('http://localhost:%d/version_number' %
+ legacy_server_port,
+ timeout=10).read())
+ except:
+ pass
+ else:
+ urllib.request.urlopen('http://localhost:%d/quitquitquit' %
+ legacy_server_port).read()
+
+
+def _calculate_num_runs_failures(list_of_results):
+ """Calculate number of runs and failures for a particular test.
+
+ Args:
+ list_of_results: (List) of JobResult object.
+ Returns:
+ A tuple of total number of runs and failures.
+ """
+ num_runs = len(list_of_results) # By default, there is 1 run per JobResult.
+ num_failures = 0
+ for jobresult in list_of_results:
+ if jobresult.retries > 0:
+ num_runs += jobresult.retries
+ if jobresult.num_failures > 0:
+ num_failures += jobresult.num_failures
+ return num_runs, num_failures
+
+
+class BuildAndRunError(object):
+ """Represents error type in _build_and_run."""
+
+ BUILD = object()
+ TEST = object()
+ POST_TEST = object()
+
+
+# returns a list of things that failed (or an empty list on success)
+def _build_and_run(check_cancelled,
+ newline_on_success,
+ xml_report=None,
+ build_only=False):
+ """Do one pass of building & running tests."""
+ # build latest sequentially
+ num_failures, resultset = jobset.run(build_steps,
+ maxjobs=1,
+ stop_on_failure=True,
+ newline_on_success=newline_on_success,
+ travis=args.travis)
+ if num_failures:
+ return [BuildAndRunError.BUILD]
+
+ if build_only:
+ if xml_report:
+ report_utils.render_junit_xml_report(
+ resultset, xml_report, suite_name=args.report_suite_name)
+ return []
+
+ # start antagonists
+ antagonists = [
+ subprocess.Popen(['tools/run_tests/python_utils/antagonist.py'])
+ for _ in range(0, args.antagonists)
+ ]
+ start_port_server.start_port_server()
+ resultset = None
+ num_test_failures = 0
+ try:
+ infinite_runs = runs_per_test == 0
+ one_run = set(spec for language in languages
+ for spec in language.test_specs()
+ if (re.search(args.regex, spec.shortname) and
+ (args.regex_exclude == '' or
+ not re.search(args.regex_exclude, spec.shortname))))
+ # When running on travis, we want out test runs to be as similar as possible
+ # for reproducibility purposes.
+ if args.travis and args.max_time <= 0:
+ massaged_one_run = sorted(one_run, key=lambda x: x.cpu_cost)
+ else:
+ # whereas otherwise, we want to shuffle things up to give all tests a
+ # chance to run.
+ massaged_one_run = list(
+ one_run) # random.sample needs an indexable seq.
+ num_jobs = len(massaged_one_run)
+ # for a random sample, get as many as indicated by the 'sample_percent'
+ # argument. By default this arg is 100, resulting in a shuffle of all
+ # jobs.
+ sample_size = int(num_jobs * args.sample_percent / 100.0)
+ massaged_one_run = random.sample(massaged_one_run, sample_size)
+ if not isclose(args.sample_percent, 100.0):
+ assert args.runs_per_test == 1, "Can't do sampling (-p) over multiple runs (-n)."
+ print("Running %d tests out of %d (~%d%%)" %
+ (sample_size, num_jobs, args.sample_percent))
+ if infinite_runs:
+ assert len(massaged_one_run
+ ) > 0, 'Must have at least one test for a -n inf run'
+ runs_sequence = (itertools.repeat(massaged_one_run) if infinite_runs
+ else itertools.repeat(massaged_one_run, runs_per_test))
+ all_runs = itertools.chain.from_iterable(runs_sequence)
+
+ if args.quiet_success:
+ jobset.message(
+ 'START',
+ 'Running tests quietly, only failing tests will be reported',
+ do_newline=True)
+ num_test_failures, resultset = jobset.run(
+ all_runs,
+ check_cancelled,
+ newline_on_success=newline_on_success,
+ travis=args.travis,
+ maxjobs=args.jobs,
+ maxjobs_cpu_agnostic=max_parallel_tests_for_current_platform(),
+ stop_on_failure=args.stop_on_failure,
+ quiet_success=args.quiet_success,
+ max_time=args.max_time)
+ if resultset:
+ for k, v in sorted(resultset.items()):
+ num_runs, num_failures = _calculate_num_runs_failures(v)
+ if num_failures > 0:
+ if num_failures == num_runs: # what about infinite_runs???
+ jobset.message('FAILED', k, do_newline=True)
+ else:
+ jobset.message('FLAKE',
+ '%s [%d/%d runs flaked]' %
+ (k, num_failures, num_runs),
+ do_newline=True)
+ finally:
+ for antagonist in antagonists:
+ antagonist.kill()
+ if args.bq_result_table and resultset:
+ upload_extra_fields = {
+ 'compiler': args.compiler,
+ 'config': args.config,
+ 'iomgr_platform': args.iomgr_platform,
+ 'language': args.language[
+ 0
+ ], # args.language is a list but will always have one element when uploading to BQ is enabled.
+ 'platform': platform_string()
+ }
+ try:
+ upload_results_to_bq(resultset, args.bq_result_table,
+ upload_extra_fields)
+ except NameError as e:
+ logging.warning(
+ e) # It's fine to ignore since this is not critical
+ if xml_report and resultset:
+ report_utils.render_junit_xml_report(
+ resultset,
+ xml_report,
+ suite_name=args.report_suite_name,
+ multi_target=args.report_multi_target)
+
+ number_failures, _ = jobset.run(post_tests_steps,
+ maxjobs=1,
+ stop_on_failure=False,
+ newline_on_success=newline_on_success,
+ travis=args.travis)
+
+ out = []
+ if number_failures:
+ out.append(BuildAndRunError.POST_TEST)
+ if num_test_failures:
+ out.append(BuildAndRunError.TEST)
+
+ return out
+
+
# parse command line
argp = argparse.ArgumentParser(description='Run grpc tests.')
argp.add_argument('-c',
@@ -1370,16 +1502,14 @@ argp.add_argument('-p',
default=100.0,
type=percent_type,
help='Run a random sample with that percentage of tests')
-argp.add_argument('-f',
- '--forever',
- default=False,
- action='store_const',
- const=True)
-argp.add_argument('-t',
- '--travis',
- default=False,
- action='store_const',
- const=True)
+argp.add_argument(
+ '-t',
+ '--travis',
+ default=False,
+ action='store_const',
+ const=True,
+ help='When set, indicates that the script is running on CI (= not locally).'
+)
argp.add_argument('--newline_on_success',
default=False,
action='store_const',
@@ -1411,7 +1541,7 @@ argp.add_argument(
)
argp.add_argument(
'--arch',
- choices=['default', 'x86', 'x64'],
+ choices=['default', 'x86', 'x64', 'arm64'],
default='default',
help=
'Selects architecture to target. For some platforms "default" is the only supported choice.'
@@ -1420,18 +1550,19 @@ argp.add_argument(
'--compiler',
choices=[
'default',
- 'gcc4.9',
- 'gcc5.3',
- 'gcc7.4',
- 'gcc8.3',
+ 'gcc5',
+ 'gcc10.2',
+ 'gcc10.2_openssl102',
+ 'gcc11',
'gcc_musl',
- 'clang4.0',
- 'clang5.0',
+ 'clang4',
+ 'clang13',
'python2.7',
'python3.5',
'python3.6',
'python3.7',
'python3.8',
+ 'python3.9',
'pypy',
'pypy3',
'python_alpine',
@@ -1440,16 +1571,19 @@ argp.add_argument(
'electron1.6',
'coreclr',
'cmake',
+ 'cmake_ninja_vs2015',
+ 'cmake_ninja_vs2017',
'cmake_vs2015',
'cmake_vs2017',
'cmake_vs2019',
+ 'mono',
],
default='default',
help=
'Selects compiler to use. Allowed values depend on the platform and language.'
)
argp.add_argument('--iomgr_platform',
- choices=['native', 'uv', 'gevent', 'asyncio'],
+ choices=['native', 'gevent', 'asyncio'],
default='native',
help='Selects iomgr platform to build on')
argp.add_argument('--build_only',
@@ -1462,15 +1596,6 @@ argp.add_argument('--measure_cpu_costs',
action='store_const',
const=True,
help='Measure the cpu costs of tests')
-argp.add_argument(
- '--update_submodules',
- default=[],
- nargs='*',
- help=
- 'Update some submodules before building. If any are updated, also run generate_projects. '
- +
- 'Submodules are specified as SUBMODULE_NAME:BRANCH; if BRANCH is omitted, master is assumed.'
-)
argp.add_argument('-a', '--antagonists', default=0, type=int)
argp.add_argument('-x',
'--xml_report',
@@ -1530,40 +1655,11 @@ elif args.force_use_pollers:
jobset.measure_cpu_costs = args.measure_cpu_costs
-# update submodules if necessary
-need_to_regenerate_projects = False
-for spec in args.update_submodules:
- spec = spec.split(':', 1)
- if len(spec) == 1:
- submodule = spec[0]
- branch = 'master'
- elif len(spec) == 2:
- submodule = spec[0]
- branch = spec[1]
- cwd = 'third_party/%s' % submodule
-
- def git(cmd, cwd=cwd):
- print('in %s: git %s' % (cwd, cmd))
- run_shell_command('git %s' % cmd, cwd=cwd)
-
- git('fetch')
- git('checkout %s' % branch)
- git('pull origin %s' % branch)
- if os.path.exists('src/%s/gen_build_yaml.py' % submodule):
- need_to_regenerate_projects = True
-if need_to_regenerate_projects:
- if jobset.platform_string() == 'linux':
- run_shell_command('tools/buildgen/generate_projects.sh')
- else:
- print(
- 'WARNING: may need to regenerate projects, but since we are not on')
- print(
- ' Linux this step is being skipped. Compilation MAY fail.')
-
# grab config
run_config = _CONFIGS[args.config]
build_config = run_config.build_config
+# TODO(jtattermusch): is this setting applied/being used?
if args.travis:
_FORCE_ENVIRON_FOR_WRAPPERS = {'GRPC_TRACE': 'api'}
@@ -1571,22 +1667,12 @@ languages = set(_LANGUAGES[l] for l in args.language)
for l in languages:
l.configure(run_config, args)
-language_make_options = []
-if any(language.make_options() for language in languages):
- if not 'gcov' in args.config and len(languages) != 1:
- print(
- 'languages with custom make options cannot be built simultaneously with other languages'
- )
- sys.exit(1)
- else:
- # Combining make options is not clean and just happens to work. It allows C & C++ to build
- # together, and is only used under gcov. All other configs should build languages individually.
- language_make_options = list(
- set([
- make_option for lang in languages
- for make_option in lang.make_options()
- ]))
+if len(languages) != 1:
+ print('Building multiple languages simultaneously is not supported!')
+ sys.exit(1)
+# If --use_docker was used, respawn the run_tests.py script under a docker container
+# instead of continuing.
if args.use_docker:
if not args.travis:
print('Seen --use_docker flag, will run tests under docker.')
@@ -1608,328 +1694,74 @@ if args.use_docker:
dockerfile_dir = next(iter(dockerfile_dirs))
child_argv = [arg for arg in sys.argv if not arg == '--use_docker']
- run_tests_cmd = 'python tools/run_tests/run_tests.py %s' % ' '.join(
+ run_tests_cmd = 'python3 tools/run_tests/run_tests.py %s' % ' '.join(
child_argv[1:])
env = os.environ.copy()
- env['RUN_TESTS_COMMAND'] = run_tests_cmd
env['DOCKERFILE_DIR'] = dockerfile_dir
- env['DOCKER_RUN_SCRIPT'] = 'tools/run_tests/dockerize/docker_run_tests.sh'
- if args.xml_report:
- env['XML_REPORT'] = args.xml_report
- if not args.travis:
- env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins.
+ env['DOCKER_RUN_SCRIPT'] = 'tools/run_tests/dockerize/docker_run.sh'
+ env['DOCKER_RUN_SCRIPT_COMMAND'] = run_tests_cmd
- subprocess.check_call(
- 'tools/run_tests/dockerize/build_docker_and_run_tests.sh',
+ retcode = subprocess.call(
+ 'tools/run_tests/dockerize/build_and_run_docker.sh',
shell=True,
env=env)
- sys.exit(0)
+ _print_debug_info_epilogue(dockerfile_dir=dockerfile_dir)
+ sys.exit(retcode)
_check_arch_option(args.arch)
-
-def make_jobspec(cfg, targets, makefile='Makefile'):
- if platform_string() == 'windows':
- return [
- jobset.JobSpec([
- 'cmake', '--build', '.', '--target',
- '%s' % target, '--config', _MSBUILD_CONFIG[cfg]
- ],
- cwd=os.path.dirname(makefile),
- timeout_seconds=None) for target in targets
- ]
- else:
- if targets and makefile.startswith('cmake/build/'):
- # With cmake, we've passed all the build configuration in the pre-build step already
- return [
- jobset.JobSpec(
- [os.getenv('MAKE', 'make'), '-j',
- '%d' % args.jobs] + targets,
- cwd='cmake/build',
- timeout_seconds=None)
- ]
- if targets:
- return [
- jobset.JobSpec(
- [
- os.getenv('MAKE', 'make'), '-f', makefile, '-j',
- '%d' % args.jobs,
- 'EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f' %
- args.slowdown,
- 'CONFIG=%s' % cfg, 'Q='
- ] + language_make_options +
- ([] if not args.travis else ['JENKINS_BUILD=1']) + targets,
- timeout_seconds=None)
- ]
- else:
- return []
-
-
-make_targets = {}
-for l in languages:
- makefile = l.makefile_name()
- make_targets[makefile] = make_targets.get(makefile, set()).union(
- set(l.make_targets()))
-
-
-def build_step_environ(cfg):
- environ = {'CONFIG': cfg}
- msbuild_cfg = _MSBUILD_CONFIG.get(cfg)
- if msbuild_cfg:
- environ['MSBUILD_CONFIG'] = msbuild_cfg
- return environ
-
-
+# collect pre-build steps (which get retried if they fail, e.g. to avoid
+# flakes on downloading dependencies etc.)
build_steps = list(
set(
jobset.JobSpec(cmdline,
- environ=build_step_environ(build_config),
+ environ=_build_step_environ(
+ build_config, extra_env=l.build_steps_environ()),
timeout_seconds=_PRE_BUILD_STEP_TIMEOUT_SECONDS,
flake_retries=2)
for l in languages
for cmdline in l.pre_build_steps()))
-if make_targets:
- make_commands = itertools.chain.from_iterable(
- make_jobspec(build_config, list(targets), makefile)
- for (makefile, targets) in make_targets.items())
- build_steps.extend(set(make_commands))
+
+# collect build steps
build_steps.extend(
set(
jobset.JobSpec(cmdline,
- environ=build_step_environ(build_config),
+ environ=_build_step_environ(
+ build_config, extra_env=l.build_steps_environ()),
timeout_seconds=None)
for l in languages
for cmdline in l.build_steps()))
+# collect post test steps
post_tests_steps = list(
set(
- jobset.JobSpec(cmdline, environ=build_step_environ(build_config))
+ jobset.JobSpec(cmdline,
+ environ=_build_step_environ(
+ build_config, extra_env=l.build_steps_environ()))
for l in languages
for cmdline in l.post_tests_steps()))
runs_per_test = args.runs_per_test
-forever = args.forever
-
-
-def _shut_down_legacy_server(legacy_server_port):
- try:
- version = int(
- urllib.request.urlopen('http://localhost:%d/version_number' %
- legacy_server_port,
- timeout=10).read())
- except:
- pass
- else:
- urllib.request.urlopen('http://localhost:%d/quitquitquit' %
- legacy_server_port).read()
-
-
-def _calculate_num_runs_failures(list_of_results):
- """Calculate number of runs and failures for a particular test.
-
- Args:
- list_of_results: (List) of JobResult object.
- Returns:
- A tuple of total number of runs and failures.
- """
- num_runs = len(list_of_results) # By default, there is 1 run per JobResult.
- num_failures = 0
- for jobresult in list_of_results:
- if jobresult.retries > 0:
- num_runs += jobresult.retries
- if jobresult.num_failures > 0:
- num_failures += jobresult.num_failures
- return num_runs, num_failures
-
-
-# _build_and_run results
-class BuildAndRunError(object):
-
- BUILD = object()
- TEST = object()
- POST_TEST = object()
-
-
-def _has_epollexclusive():
- binary = 'bins/%s/check_epollexclusive' % args.config
- if not os.path.exists(binary):
- return False
- try:
- subprocess.check_call(binary)
- return True
- except subprocess.CalledProcessError as e:
- return False
- except OSError as e:
- # For languages other than C and Windows the binary won't exist
- return False
-
-
-# returns a list of things that failed (or an empty list on success)
-def _build_and_run(check_cancelled,
- newline_on_success,
- xml_report=None,
- build_only=False):
- """Do one pass of building & running tests."""
- # build latest sequentially
- num_failures, resultset = jobset.run(build_steps,
- maxjobs=1,
- stop_on_failure=True,
- newline_on_success=newline_on_success,
- travis=args.travis)
- if num_failures:
- return [BuildAndRunError.BUILD]
-
- if build_only:
- if xml_report:
- report_utils.render_junit_xml_report(
- resultset, xml_report, suite_name=args.report_suite_name)
- return []
-
- if not args.travis and not _has_epollexclusive() and platform_string(
- ) in _POLLING_STRATEGIES and 'epollex' in _POLLING_STRATEGIES[
- platform_string()]:
- print('\n\nOmitting EPOLLEXCLUSIVE tests\n\n')
- _POLLING_STRATEGIES[platform_string()].remove('epollex')
-
- # start antagonists
- antagonists = [
- subprocess.Popen(['tools/run_tests/python_utils/antagonist.py'])
- for _ in range(0, args.antagonists)
- ]
- start_port_server.start_port_server()
- resultset = None
- num_test_failures = 0
- try:
- infinite_runs = runs_per_test == 0
- one_run = set(spec for language in languages
- for spec in language.test_specs()
- if (re.search(args.regex, spec.shortname) and
- (args.regex_exclude == '' or
- not re.search(args.regex_exclude, spec.shortname))))
- # When running on travis, we want out test runs to be as similar as possible
- # for reproducibility purposes.
- if args.travis and args.max_time <= 0:
- massaged_one_run = sorted(one_run, key=lambda x: x.cpu_cost)
- else:
- # whereas otherwise, we want to shuffle things up to give all tests a
- # chance to run.
- massaged_one_run = list(
- one_run) # random.sample needs an indexable seq.
- num_jobs = len(massaged_one_run)
- # for a random sample, get as many as indicated by the 'sample_percent'
- # argument. By default this arg is 100, resulting in a shuffle of all
- # jobs.
- sample_size = int(num_jobs * args.sample_percent / 100.0)
- massaged_one_run = random.sample(massaged_one_run, sample_size)
- if not isclose(args.sample_percent, 100.0):
- assert args.runs_per_test == 1, "Can't do sampling (-p) over multiple runs (-n)."
- print("Running %d tests out of %d (~%d%%)" %
- (sample_size, num_jobs, args.sample_percent))
- if infinite_runs:
- assert len(massaged_one_run
- ) > 0, 'Must have at least one test for a -n inf run'
- runs_sequence = (itertools.repeat(massaged_one_run) if infinite_runs
- else itertools.repeat(massaged_one_run, runs_per_test))
- all_runs = itertools.chain.from_iterable(runs_sequence)
-
- if args.quiet_success:
- jobset.message(
- 'START',
- 'Running tests quietly, only failing tests will be reported',
- do_newline=True)
- num_test_failures, resultset = jobset.run(
- all_runs,
- check_cancelled,
- newline_on_success=newline_on_success,
- travis=args.travis,
- maxjobs=args.jobs,
- maxjobs_cpu_agnostic=max_parallel_tests_for_current_platform(),
- stop_on_failure=args.stop_on_failure,
- quiet_success=args.quiet_success,
- max_time=args.max_time)
- if resultset:
- for k, v in sorted(resultset.items()):
- num_runs, num_failures = _calculate_num_runs_failures(v)
- if num_failures > 0:
- if num_failures == num_runs: # what about infinite_runs???
- jobset.message('FAILED', k, do_newline=True)
- else:
- jobset.message('FLAKE',
- '%s [%d/%d runs flaked]' %
- (k, num_failures, num_runs),
- do_newline=True)
- finally:
- for antagonist in antagonists:
- antagonist.kill()
- if args.bq_result_table and resultset:
- upload_extra_fields = {
- 'compiler': args.compiler,
- 'config': args.config,
- 'iomgr_platform': args.iomgr_platform,
- 'language': args.language[
- 0
- ], # args.language is a list but will always have one element when uploading to BQ is enabled.
- 'platform': platform_string()
- }
- try:
- upload_results_to_bq(resultset, args.bq_result_table,
- upload_extra_fields)
- except NameError as e:
- logging.warning(
- e) # It's fine to ignore since this is not critical
- if xml_report and resultset:
- report_utils.render_junit_xml_report(
- resultset,
- xml_report,
- suite_name=args.report_suite_name,
- multi_target=args.report_multi_target)
- number_failures, _ = jobset.run(post_tests_steps,
- maxjobs=1,
- stop_on_failure=False,
- newline_on_success=newline_on_success,
- travis=args.travis)
-
- out = []
- if number_failures:
- out.append(BuildAndRunError.POST_TEST)
- if num_test_failures:
- out.append(BuildAndRunError.TEST)
-
- return out
-
-
-if forever:
- success = True
- while True:
- dw = watch_dirs.DirWatcher(['src', 'include', 'test', 'examples'])
- initial_time = dw.most_recent_change()
- have_files_changed = lambda: dw.most_recent_change() != initial_time
- previous_success = success
- errors = _build_and_run(check_cancelled=have_files_changed,
- newline_on_success=False,
- build_only=args.build_only) == 0
- if not previous_success and not errors:
- jobset.message('SUCCESS',
- 'All tests are now passing properly',
- do_newline=True)
- jobset.message('IDLE', 'No change detected')
- while not have_files_changed():
- time.sleep(1)
+errors = _build_and_run(check_cancelled=lambda: False,
+ newline_on_success=args.newline_on_success,
+ xml_report=args.xml_report,
+ build_only=args.build_only)
+if not errors:
+ jobset.message('SUCCESS', 'All tests passed', do_newline=True)
else:
- errors = _build_and_run(check_cancelled=lambda: False,
- newline_on_success=args.newline_on_success,
- xml_report=args.xml_report,
- build_only=args.build_only)
- if not errors:
- jobset.message('SUCCESS', 'All tests passed', do_newline=True)
- else:
- jobset.message('FAILED', 'Some tests failed', do_newline=True)
- exit_code = 0
- if BuildAndRunError.BUILD in errors:
- exit_code |= 1
- if BuildAndRunError.TEST in errors:
- exit_code |= 2
- if BuildAndRunError.POST_TEST in errors:
- exit_code |= 4
- sys.exit(exit_code)
+ jobset.message('FAILED', 'Some tests failed', do_newline=True)
+
+if not _is_use_docker_child():
+ # if --use_docker was used, the outer invocation of run_tests.py will
+ # print the debug info instead.
+ _print_debug_info_epilogue()
+
+exit_code = 0
+if BuildAndRunError.BUILD in errors:
+ exit_code |= 1
+if BuildAndRunError.TEST in errors:
+ exit_code |= 2
+if BuildAndRunError.POST_TEST in errors:
+ exit_code |= 4
+sys.exit(exit_code)
diff --git a/grpc/tools/run_tests/run_tests_matrix.py b/grpc/tools/run_tests/run_tests_matrix.py
index 951229db..f3e357a2 100755
--- a/grpc/tools/run_tests/run_tests_matrix.py
+++ b/grpc/tools/run_tests/run_tests_matrix.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,9 +21,9 @@ import multiprocessing
import os
import sys
+from python_utils.filter_pull_request_tests import filter_tests
import python_utils.jobset as jobset
import python_utils.report_utils as report_utils
-from python_utils.filter_pull_request_tests import filter_tests
_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
os.chdir(_ROOT)
@@ -34,7 +34,7 @@ _DEFAULT_RUNTESTS_TIMEOUT = 1 * 60 * 60
_CPP_RUNTESTS_TIMEOUT = 4 * 60 * 60
# Set timeout high for ObjC for Cocoapods to install pods
-_OBJC_RUNTESTS_TIMEOUT = 90 * 60
+_OBJC_RUNTESTS_TIMEOUT = 2 * 60 * 60
# Number of jobs assigned to each run_tests.py instance
_DEFAULT_INNER_JOBS = 2
@@ -62,8 +62,14 @@ def _matrix_job_logfilename(shortname_for_multi_target):
# for the corresponding 'sponge_log.xml' report.
# the shortname_for_multi_target component must be set to match the sponge_log.xml location
# because the top-level render_junit_xml_report is called with multi_target=True
- return '%s/%s/%s' % (_MATRIX_REPORT_NAME, shortname_for_multi_target,
- 'sponge_log.log')
+ sponge_log_name = '%s/%s/%s' % (
+ _MATRIX_REPORT_NAME, shortname_for_multi_target, 'sponge_log.log')
+ # env variable can be used to override the base location for the reports
+ # so we need to match that behavior here too
+ base_dir = os.getenv('GRPC_TEST_REPORT_BASE_DIR', None)
+ if base_dir:
+ sponge_log_name = os.path.join(base_dir, sponge_log_name)
+ return sponge_log_name
def _docker_jobspec(name,
@@ -76,7 +82,7 @@ def _docker_jobspec(name,
timeout_seconds = _DEFAULT_RUNTESTS_TIMEOUT
shortname = 'run_tests_%s' % name
test_job = jobset.JobSpec(cmdline=[
- 'python', 'tools/run_tests/run_tests.py', '--use_docker', '-t', '-j',
+ 'python3', 'tools/run_tests/run_tests.py', '--use_docker', '-t', '-j',
str(inner_jobs), '-x',
'run_tests/%s' % _report_filename(name), '--report_suite_name',
'%s' % _safe_report_name(name)
@@ -102,11 +108,15 @@ def _workspace_jobspec(name,
shortname = 'run_tests_%s' % name
env = {'WORKSPACE_NAME': workspace_name}
env.update(runtests_envs)
+ # if report base dir is set, we don't need to ".." to come out of the workspace dir
+ report_dir_prefix = '' if os.getenv('GRPC_TEST_REPORT_BASE_DIR',
+ None) else '../'
test_job = jobset.JobSpec(cmdline=[
'bash', 'tools/run_tests/helper_scripts/run_tests_in_workspace.sh',
'-t', '-j',
str(inner_jobs), '-x',
- '../run_tests/%s' % _report_filename(name), '--report_suite_name',
+ '%srun_tests/%s' %
+ (report_dir_prefix, _report_filename(name)), '--report_suite_name',
'%s' % _safe_report_name(name)
] + runtests_args,
environ=env,
@@ -191,7 +201,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
inner_jobs=inner_jobs,
timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
- # C# tests on .NET desktop/mono
+ # C# tests (both on .NET desktop/mono and .NET core)
test_jobs += _generate_jobs(languages=['csharp'],
configs=['dbg', 'opt'],
platforms=['linux', 'macos', 'windows'],
@@ -199,13 +209,14 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
extra_args=extra_args +
['--report_multi_target'],
inner_jobs=inner_jobs)
- # C# tests on .NET core
+
+ # ARM64 Linux C# tests
test_jobs += _generate_jobs(languages=['csharp'],
configs=['dbg', 'opt'],
- platforms=['linux', 'macos', 'windows'],
- arch='default',
- compiler='coreclr',
- labels=['basictests', 'multilang'],
+ platforms=['linux'],
+ arch='arm64',
+ compiler='default',
+ labels=['basictests_arm64'],
extra_args=extra_args +
['--report_multi_target'],
inner_jobs=inner_jobs)
@@ -213,12 +224,24 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
test_jobs += _generate_jobs(languages=['python'],
configs=['opt'],
platforms=['linux', 'macos', 'windows'],
- iomgr_platforms=['native', 'gevent', 'asyncio'],
+ iomgr_platforms=['native'],
labels=['basictests', 'multilang'],
extra_args=extra_args +
['--report_multi_target'],
inner_jobs=inner_jobs)
+ # ARM64 Linux Python tests
+ test_jobs += _generate_jobs(languages=['python'],
+ configs=['opt'],
+ platforms=['linux'],
+ arch='arm64',
+ compiler='default',
+ iomgr_platforms=['native'],
+ labels=['basictests_arm64'],
+ extra_args=extra_args +
+ ['--report_multi_target'],
+ inner_jobs=inner_jobs)
+
# supported on linux and mac.
test_jobs += _generate_jobs(
languages=['c++'],
@@ -230,7 +253,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
inner_jobs=inner_jobs,
timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
- test_jobs += _generate_jobs(languages=['grpc-node', 'ruby', 'php7'],
+ test_jobs += _generate_jobs(languages=['ruby', 'php7'],
configs=['dbg', 'opt'],
platforms=['linux', 'macos'],
labels=['basictests', 'multilang'],
@@ -238,6 +261,17 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
['--report_multi_target'],
inner_jobs=inner_jobs)
+ # ARM64 Linux Ruby and PHP tests
+ test_jobs += _generate_jobs(languages=['ruby', 'php7'],
+ configs=['dbg', 'opt'],
+ platforms=['linux'],
+ arch='arm64',
+ compiler='default',
+ labels=['basictests_arm64'],
+ extra_args=extra_args +
+ ['--report_multi_target'],
+ inner_jobs=inner_jobs)
+
# supported on mac only.
test_jobs += _generate_jobs(languages=['objc'],
configs=['opt'],
@@ -266,8 +300,8 @@ def _create_portability_test_jobs(extra_args=[],
# portability C and C++ on x64
for compiler in [
- 'gcc4.9', 'gcc5.3', 'gcc7.4', 'gcc8.3', 'gcc_musl', 'clang4.0',
- 'clang5.0'
+ 'gcc5', 'gcc10.2_openssl102', 'gcc11', 'gcc_musl', 'clang4',
+ 'clang13'
]:
test_jobs += _generate_jobs(languages=['c', 'c++'],
configs=['dbg'],
@@ -289,6 +323,17 @@ def _create_portability_test_jobs(extra_args=[],
extra_args=extra_args,
inner_jobs=inner_jobs)
+ # portability C on Windows with the "Visual Studio" cmake
+ # generator, i.e. not using Ninja (to verify that we can still build with msbuild)
+ test_jobs += _generate_jobs(languages=['c'],
+ configs=['dbg'],
+ platforms=['windows'],
+ arch='default',
+ compiler='cmake_vs2015',
+ labels=['portability', 'corelang'],
+ extra_args=extra_args,
+ inner_jobs=inner_jobs)
+
# portability C++ on Windows
# TODO(jtattermusch): some of the tests are failing, so we force --build_only
test_jobs += _generate_jobs(languages=['c++'],
@@ -307,27 +352,19 @@ def _create_portability_test_jobs(extra_args=[],
configs=['dbg'],
platforms=['windows'],
arch='x64',
- compiler='cmake_vs2017',
+ compiler='cmake_ninja_vs2017',
labels=['portability', 'corelang'],
extra_args=extra_args + ['--build_only'],
inner_jobs=inner_jobs,
timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
- # C and C++ with the c-ares DNS resolver on Linux
- test_jobs += _generate_jobs(languages=['c', 'c++'],
- configs=['dbg'],
- platforms=['linux'],
- labels=['portability', 'corelang'],
- extra_args=extra_args,
- extra_envs={'GRPC_DNS_RESOLVER': 'ares'},
- timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
-
# C and C++ with no-exceptions on Linux
test_jobs += _generate_jobs(languages=['c', 'c++'],
configs=['noexcept'],
platforms=['linux'],
labels=['portability', 'corelang'],
extra_args=extra_args,
+ inner_jobs=inner_jobs,
timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
test_jobs += _generate_jobs(languages=['python'],
@@ -340,19 +377,6 @@ def _create_portability_test_jobs(extra_args=[],
['--report_multi_target'],
inner_jobs=inner_jobs)
- # TODO(jtattermusch): a large portion of the libuv tests is failing,
- # which can end up killing the kokoro job due to gigabytes of error logs
- # generated. Remove the --build_only flag
- # once https://github.com/grpc/grpc/issues/17556 is fixed.
- test_jobs += _generate_jobs(languages=['c'],
- configs=['dbg'],
- platforms=['linux'],
- iomgr_platforms=['uv'],
- labels=['portability', 'corelang'],
- extra_args=extra_args + ['--build_only'],
- inner_jobs=inner_jobs,
- timeout_seconds=_CPP_RUNTESTS_TIMEOUT)
-
return test_jobs
diff --git a/grpc/tools/run_tests/run_xds_tests.py b/grpc/tools/run_tests/run_xds_tests.py
index 7743df1b..84dedd37 100755
--- a/grpc/tools/run_tests/run_xds_tests.py
+++ b/grpc/tools/run_tests/run_xds_tests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +16,11 @@
import argparse
import datetime
-import googleapiclient.discovery
-import grpc
import json
import logging
import os
import random
+import re
import shlex
import socket
import subprocess
@@ -30,12 +29,13 @@ import tempfile
import time
import uuid
-from oauth2client.client import GoogleCredentials
from google.protobuf import json_format
+import googleapiclient.discovery
+import grpc
+from oauth2client.client import GoogleCredentials
import python_utils.jobset as jobset
import python_utils.report_utils as report_utils
-
from src.proto.grpc.health.v1 import health_pb2
from src.proto.grpc.health.v1 import health_pb2_grpc
from src.proto.grpc.testing import empty_pb2
@@ -45,12 +45,13 @@ from src.proto.grpc.testing import test_pb2_grpc
# Envoy protos provided by PyPI package xds-protos
# Needs to import the generated Python file to load descriptors
try:
- from envoy.service.status.v3 import csds_pb2
- from envoy.service.status.v3 import csds_pb2_grpc
- from envoy.extensions.filters.network.http_connection_manager.v3 import http_connection_manager_pb2
from envoy.extensions.filters.common.fault.v3 import fault_pb2
from envoy.extensions.filters.http.fault.v3 import fault_pb2
from envoy.extensions.filters.http.router.v3 import router_pb2
+ from envoy.extensions.filters.network.http_connection_manager.v3 import \
+ http_connection_manager_pb2
+ from envoy.service.status.v3 import csds_pb2
+ from envoy.service.status.v3 import csds_pb2_grpc
except ImportError:
# These protos are required by CSDS test. We should not fail the entire
# script for one test case.
@@ -84,6 +85,7 @@ _TEST_CASES = [
'traffic_splitting',
'path_matching',
'header_matching',
+ 'api_listener',
'forwarding_rule_port_match',
'forwarding_rule_default_port',
'metadata_filter',
@@ -98,7 +100,6 @@ _ADDITIONAL_TEST_CASES = [
'timeout',
'fault_injection',
'csds',
- 'api_listener', # TODO(b/187352987) Relieve quota pressure
]
# Test cases that require the V3 API. Skipped in older runs.
@@ -128,10 +129,10 @@ def parse_test_cases(arg):
def parse_port_range(port_arg):
try:
port = int(port_arg)
- return range(port, port + 1)
+ return list(range(port, port + 1))
except:
port_min, port_max = port_arg.split(':')
- return range(int(port_min), int(port_max) + 1)
+ return list(range(int(port_min), int(port_max) + 1))
argp = argparse.ArgumentParser(description='Run xDS interop tests on GCP')
@@ -202,6 +203,9 @@ argp.add_argument(
help=
'Leave GCP VMs and configuration running after test. Default behavior is '
'to delete when tests complete.')
+argp.add_argument('--halt_after_fail',
+ action='store_true',
+ help='Halt and save the resources when test failed.')
argp.add_argument(
'--compute_discovery_document',
default=None,
@@ -577,7 +581,7 @@ def compare_distributions(actual_distribution, expected_distribution,
The similarity between the distributions as a boolean. Returns true if the
actual distribution lies within the threshold of the expected
distribution, false otherwise.
-
+
Raises:
ValueError: if threshold is not with in [0,100].
Exception: containing detailed error messages.
@@ -610,7 +614,7 @@ def compare_expected_instances(stats, expected_instances):
Returns:
Returns true if the instances are expected. False if not.
"""
- for rpc_type, expected_peers in expected_instances.items():
+ for rpc_type, expected_peers in list(expected_instances.items()):
rpcs_by_peer_for_type = stats.rpcs_by_method[rpc_type]
rpcs_by_peer = rpcs_by_peer_for_type.rpcs_by_peer if rpcs_by_peer_for_type else None
logger.debug('rpc: %s, by_peer: %s', rpc_type, rpcs_by_peer)
@@ -655,13 +659,18 @@ def test_change_backend_service(gcp, original_backend_service, instance_group,
same_zone_instance_group)
wait_until_all_rpcs_go_to_given_backends(original_backend_instances,
_WAIT_FOR_STATS_SEC)
+ passed = True
try:
patch_url_map_backend_service(gcp, alternate_backend_service)
wait_until_all_rpcs_go_to_given_backends(alternate_backend_instances,
_WAIT_FOR_URL_MAP_PATCH_SEC)
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- patch_backend_service(gcp, alternate_backend_service, [])
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ patch_backend_service(gcp, alternate_backend_service, [])
def test_gentle_failover(gcp,
@@ -672,6 +681,7 @@ def test_gentle_failover(gcp,
logger.info('Running test_gentle_failover')
num_primary_instances = len(get_instance_names(gcp, primary_instance_group))
min_instances_for_gentle_failover = 3 # Need >50% failure to start failover
+ passed = True
try:
if num_primary_instances < min_instances_for_gentle_failover:
resize_instance_group(gcp, primary_instance_group,
@@ -710,20 +720,27 @@ def test_gentle_failover(gcp,
primary_instance_group,
swapped_primary_and_secondary=True)
else:
+ passed = False
raise e
+ except Exception:
+ passed = False
+ raise
finally:
- patch_backend_service(gcp, backend_service, [primary_instance_group])
- resize_instance_group(gcp, primary_instance_group,
- num_primary_instances)
- instance_names = get_instance_names(gcp, primary_instance_group)
- wait_until_all_rpcs_go_to_given_backends(instance_names,
- _WAIT_FOR_BACKEND_SEC)
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, backend_service,
+ [primary_instance_group])
+ resize_instance_group(gcp, primary_instance_group,
+ num_primary_instances)
+ instance_names = get_instance_names(gcp, primary_instance_group)
+ wait_until_all_rpcs_go_to_given_backends(instance_names,
+ _WAIT_FOR_BACKEND_SEC)
def test_load_report_based_failover(gcp, backend_service,
primary_instance_group,
secondary_instance_group):
logger.info('Running test_load_report_based_failover')
+ passed = True
try:
patch_backend_service(
gcp, backend_service,
@@ -763,11 +780,16 @@ def test_load_report_based_failover(gcp, backend_service,
wait_until_all_rpcs_go_to_given_backends(primary_instance_names,
_WAIT_FOR_BACKEND_SEC)
logger.info("success")
+ except Exception:
+ passed = False
+ raise
finally:
- patch_backend_service(gcp, backend_service, [primary_instance_group])
- instance_names = get_instance_names(gcp, primary_instance_group)
- wait_until_all_rpcs_go_to_given_backends(instance_names,
- _WAIT_FOR_BACKEND_SEC)
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, backend_service,
+ [primary_instance_group])
+ instance_names = get_instance_names(gcp, primary_instance_group)
+ wait_until_all_rpcs_go_to_given_backends(instance_names,
+ _WAIT_FOR_BACKEND_SEC)
def test_ping_pong(gcp, backend_service, instance_group):
@@ -781,6 +803,7 @@ def test_ping_pong(gcp, backend_service, instance_group):
def test_remove_instance_group(gcp, backend_service, instance_group,
same_zone_instance_group):
logger.info('Running test_remove_instance_group')
+ passed = True
try:
patch_backend_service(gcp,
backend_service,
@@ -817,10 +840,14 @@ def test_remove_instance_group(gcp, backend_service, instance_group,
balancing_mode='RATE')
wait_until_all_rpcs_go_to_given_backends(remaining_instance_names,
_WAIT_FOR_BACKEND_SEC)
+ except Exception:
+ passed = False
+ raise
finally:
- patch_backend_service(gcp, backend_service, [instance_group])
- wait_until_all_rpcs_go_to_given_backends(instance_names,
- _WAIT_FOR_BACKEND_SEC)
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, backend_service, [instance_group])
+ wait_until_all_rpcs_go_to_given_backends(instance_names,
+ _WAIT_FOR_BACKEND_SEC)
def test_round_robin(gcp, backend_service, instance_group):
@@ -864,6 +891,7 @@ def test_secondary_locality_gets_no_requests_on_partial_primary_failure(
logger.info(
'Running secondary_locality_gets_no_requests_on_partial_primary_failure'
)
+ passed = True
try:
patch_backend_service(
gcp, backend_service,
@@ -897,9 +925,12 @@ def test_secondary_locality_gets_no_requests_on_partial_primary_failure(
primary_instance_group,
swapped_primary_and_secondary=True)
else:
+ passed = False
raise e
finally:
- patch_backend_service(gcp, backend_service, [primary_instance_group])
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, backend_service,
+ [primary_instance_group])
def test_secondary_locality_gets_requests_on_primary_failure(
@@ -909,6 +940,7 @@ def test_secondary_locality_gets_requests_on_primary_failure(
secondary_instance_group,
swapped_primary_and_secondary=False):
logger.info('Running secondary_locality_gets_requests_on_primary_failure')
+ passed = True
try:
patch_backend_service(
gcp, backend_service,
@@ -942,9 +974,12 @@ def test_secondary_locality_gets_requests_on_primary_failure(
primary_instance_group,
swapped_primary_and_secondary=True)
else:
+ passed = False
raise e
finally:
- patch_backend_service(gcp, backend_service, [primary_instance_group])
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, backend_service,
+ [primary_instance_group])
def prepare_services_for_urlmap_tests(gcp, original_backend_service,
@@ -991,11 +1026,12 @@ def test_metadata_filter(gcp, original_backend_service, instance_group,
[same_zone_instance_group])
wait_for_healthy_backends(gcp, alternate_backend_service,
same_zone_instance_group)
+ passed = True
try:
with open(bootstrap_path) as f:
md = json.load(f)['node']['metadata']
match_labels = []
- for k, v in md.items():
+ for k, v in list(md.items()):
match_labels.append({'name': k, 'value': v})
not_match_labels = [{'name': 'fake', 'value': 'fail'}]
@@ -1122,13 +1158,18 @@ def test_metadata_filter(gcp, original_backend_service, instance_group,
wait_until_all_rpcs_go_to_given_backends(
alternate_backend_instances, _WAIT_FOR_STATS_SEC)
patch_url_map_backend_service(gcp, original_backend_service)
+ except Exception:
+ passed = False
+ raise
finally:
- patch_backend_service(gcp, alternate_backend_service, [])
+ if passed or not args.halt_after_fail:
+ patch_backend_service(gcp, alternate_backend_service, [])
def test_api_listener(gcp, backend_service, instance_group,
alternate_backend_service):
logger.info("Running api_listener")
+ passed = True
try:
wait_for_healthy_backends(gcp, backend_service, instance_group)
backend_instances = get_instance_names(gcp, instance_group)
@@ -1139,9 +1180,10 @@ def test_api_listener(gcp, backend_service, instance_group,
# ip address in fr for proxyless and also we violate ip:port uniqueness
# for test purpose. See https://github.com/grpc/grpc-java/issues/8009
new_config_suffix = '2'
- create_url_map(gcp, url_map_name + new_config_suffix, backend_service,
- service_host_name)
- create_target_proxy(gcp, target_proxy_name + new_config_suffix, False)
+ url_map_2 = create_url_map(gcp, url_map_name + new_config_suffix,
+ backend_service, service_host_name)
+ target_proxy_2 = create_target_proxy(
+ gcp, target_proxy_name + new_config_suffix, False, url_map_2)
if not gcp.service_port:
raise Exception(
'Faied to find a valid port for the forwarding rule')
@@ -1153,7 +1195,7 @@ def test_api_listener(gcp, backend_service, instance_group,
create_global_forwarding_rule(gcp,
forwarding_rule_name + new_config_suffix,
[gcp.service_port],
- potential_ip_addresses)
+ potential_ip_addresses, target_proxy_2)
if gcp.service_port != _DEFAULT_SERVICE_PORT:
patch_url_map_host_rule_with_port(gcp,
url_map_name + new_config_suffix,
@@ -1162,9 +1204,9 @@ def test_api_listener(gcp, backend_service, instance_group,
wait_until_all_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
- delete_global_forwarding_rule(gcp, forwarding_rule_name)
- delete_target_proxy(gcp, target_proxy_name)
- delete_url_map(gcp, url_map_name)
+ delete_global_forwarding_rule(gcp, gcp.global_forwarding_rules[0])
+ delete_target_proxy(gcp, gcp.target_proxies[0])
+ delete_url_map(gcp, gcp.url_maps[0])
verify_attempts = int(_WAIT_FOR_URL_MAP_PATCH_SEC / _NUM_TEST_RPCS *
args.qps)
for i in range(verify_attempts):
@@ -1175,62 +1217,72 @@ def test_api_listener(gcp, backend_service, instance_group,
wait_until_no_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
+ except Exception:
+ passed = False
+ raise
finally:
- delete_global_forwarding_rule(gcp,
- forwarding_rule_name + new_config_suffix)
- delete_target_proxy(gcp, target_proxy_name + new_config_suffix)
- delete_url_map(gcp, url_map_name + new_config_suffix)
- create_url_map(gcp, url_map_name, backend_service, service_host_name)
- create_target_proxy(gcp, target_proxy_name)
- create_global_forwarding_rule(gcp, forwarding_rule_name,
- potential_service_ports)
- if gcp.service_port != _DEFAULT_SERVICE_PORT:
- patch_url_map_host_rule_with_port(gcp, url_map_name,
- backend_service,
- service_host_name)
- server_uri = service_host_name + ':' + str(gcp.service_port)
- else:
- server_uri = service_host_name
- return server_uri
+ if passed or not args.halt_after_fail:
+ delete_global_forwarding_rules(gcp)
+ delete_target_proxies(gcp)
+ delete_url_maps(gcp)
+ create_url_map(gcp, url_map_name, backend_service,
+ service_host_name)
+ create_target_proxy(gcp, target_proxy_name)
+ create_global_forwarding_rule(gcp, forwarding_rule_name,
+ potential_service_ports)
+ if gcp.service_port != _DEFAULT_SERVICE_PORT:
+ patch_url_map_host_rule_with_port(gcp, url_map_name,
+ backend_service,
+ service_host_name)
+ server_uri = service_host_name + ':' + str(gcp.service_port)
+ else:
+ server_uri = service_host_name
+ return server_uri
def test_forwarding_rule_port_match(gcp, backend_service, instance_group):
logger.info("Running test_forwarding_rule_port_match")
+ passed = True
try:
wait_for_healthy_backends(gcp, backend_service, instance_group)
backend_instances = get_instance_names(gcp, instance_group)
wait_until_all_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
- delete_global_forwarding_rule(gcp)
+ delete_global_forwarding_rules(gcp)
create_global_forwarding_rule(gcp, forwarding_rule_name, [
x for x in parse_port_range(_DEFAULT_PORT_RANGE)
if x != gcp.service_port
])
wait_until_no_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
+ except Exception:
+ passed = False
+ raise
finally:
- delete_global_forwarding_rule(gcp)
- create_global_forwarding_rule(gcp, forwarding_rule_name,
- potential_service_ports)
- if gcp.service_port != _DEFAULT_SERVICE_PORT:
- patch_url_map_host_rule_with_port(gcp, url_map_name,
- backend_service,
- service_host_name)
- server_uri = service_host_name + ':' + str(gcp.service_port)
- else:
- server_uri = service_host_name
- return server_uri
+ if passed or not args.halt_after_fail:
+ delete_global_forwarding_rules(gcp)
+ create_global_forwarding_rule(gcp, forwarding_rule_name,
+ potential_service_ports)
+ if gcp.service_port != _DEFAULT_SERVICE_PORT:
+ patch_url_map_host_rule_with_port(gcp, url_map_name,
+ backend_service,
+ service_host_name)
+ server_uri = service_host_name + ':' + str(gcp.service_port)
+ else:
+ server_uri = service_host_name
+ return server_uri
def test_forwarding_rule_default_port(gcp, backend_service, instance_group):
logger.info("Running test_forwarding_rule_default_port")
+ passed = True
try:
wait_for_healthy_backends(gcp, backend_service, instance_group)
backend_instances = get_instance_names(gcp, instance_group)
if gcp.service_port == _DEFAULT_SERVICE_PORT:
wait_until_all_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
- delete_global_forwarding_rule(gcp)
+ delete_global_forwarding_rules(gcp)
create_global_forwarding_rule(gcp, forwarding_rule_name,
parse_port_range(_DEFAULT_PORT_RANGE))
patch_url_map_host_rule_with_port(gcp, url_map_name,
@@ -1239,11 +1291,11 @@ def test_forwarding_rule_default_port(gcp, backend_service, instance_group):
wait_until_no_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
# expect success when no port in client request service uri, and no port in url-map
- delete_global_forwarding_rule(gcp)
- delete_target_proxy(gcp)
- delete_url_map(gcp)
+ delete_global_forwarding_rule(gcp, gcp.global_forwarding_rules[0])
+ delete_target_proxy(gcp, gcp.target_proxies[0])
+ delete_url_map(gcp, gcp.url_maps[0])
create_url_map(gcp, url_map_name, backend_service, service_host_name)
- create_target_proxy(gcp, gcp.target_proxy.name, False)
+ create_target_proxy(gcp, target_proxy_name, False)
potential_ip_addresses = []
max_attempts = 10
for i in range(max_attempts):
@@ -1259,22 +1311,27 @@ def test_forwarding_rule_default_port(gcp, backend_service, instance_group):
service_host_name)
wait_until_no_rpcs_go_to_given_backends(backend_instances,
_WAIT_FOR_STATS_SEC)
+ except Exception:
+ passed = False
+ raise
finally:
- delete_global_forwarding_rule(gcp)
- delete_target_proxy(gcp)
- delete_url_map(gcp)
- create_url_map(gcp, url_map_name, backend_service, service_host_name)
- create_target_proxy(gcp, target_proxy_name)
- create_global_forwarding_rule(gcp, forwarding_rule_name,
- potential_service_ports)
- if gcp.service_port != _DEFAULT_SERVICE_PORT:
- patch_url_map_host_rule_with_port(gcp, url_map_name,
- backend_service,
- service_host_name)
- server_uri = service_host_name + ':' + str(gcp.service_port)
- else:
- server_uri = service_host_name
- return server_uri
+ if passed or not args.halt_after_fail:
+ delete_global_forwarding_rules(gcp)
+ delete_target_proxies(gcp)
+ delete_url_maps(gcp)
+ create_url_map(gcp, url_map_name, backend_service,
+ service_host_name)
+ create_target_proxy(gcp, target_proxy_name)
+ create_global_forwarding_rule(gcp, forwarding_rule_name,
+ potential_service_ports)
+ if gcp.service_port != _DEFAULT_SERVICE_PORT:
+ patch_url_map_host_rule_with_port(gcp, url_map_name,
+ backend_service,
+ service_host_name)
+ server_uri = service_host_name + ':' + str(gcp.service_port)
+ else:
+ server_uri = service_host_name
+ return server_uri
def test_traffic_splitting(gcp, original_backend_service, instance_group,
@@ -1289,6 +1346,7 @@ def test_traffic_splitting(gcp, original_backend_service, instance_group,
gcp, original_backend_service, instance_group,
alternate_backend_service, same_zone_instance_group)
+ passed = True
try:
# Patch urlmap, change route action to traffic splitting between
# original and alternate.
@@ -1345,9 +1403,13 @@ def test_traffic_splitting(gcp, original_backend_service, instance_group,
else:
logger.info("success")
break
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- patch_backend_service(gcp, alternate_backend_service, [])
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ patch_backend_service(gcp, alternate_backend_service, [])
def test_path_matching(gcp, original_backend_service, instance_group,
@@ -1365,6 +1427,7 @@ def test_path_matching(gcp, original_backend_service, instance_group,
gcp, original_backend_service, instance_group,
alternate_backend_service, same_zone_instance_group)
+ passed = True
try:
# A list of tuples (route_rules, expected_instances).
test_cases = [
@@ -1485,9 +1548,13 @@ def test_path_matching(gcp, original_backend_service, instance_group,
raise Exception(
'timeout waiting for RPCs to the expected instances: %s'
% expected_instances)
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- patch_backend_service(gcp, alternate_backend_service, [])
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ patch_backend_service(gcp, alternate_backend_service, [])
def test_header_matching(gcp, original_backend_service, instance_group,
@@ -1505,6 +1572,7 @@ def test_header_matching(gcp, original_backend_service, instance_group,
gcp, original_backend_service, instance_group,
alternate_backend_service, same_zone_instance_group)
+ passed = True
try:
# A list of tuples (route_rules, expected_instances).
test_cases = [
@@ -1683,9 +1751,13 @@ def test_header_matching(gcp, original_backend_service, instance_group,
raise Exception(
'timeout waiting for RPCs to the expected instances: %s'
% expected_instances)
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- patch_backend_service(gcp, alternate_backend_service, [])
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ patch_backend_service(gcp, alternate_backend_service, [])
def test_circuit_breaking(gcp, original_backend_service, instance_group,
@@ -1718,6 +1790,7 @@ def test_circuit_breaking(gcp, original_backend_service, instance_group,
'''
logger.info('Running test_circuit_breaking')
additional_backend_services = []
+ passed = True
try:
# TODO(chengyuanzhang): Dedicated backend services created for circuit
# breaking test. Once the issue for unsetting backend service circuit
@@ -1835,12 +1908,17 @@ def test_circuit_breaking(gcp, original_backend_service, instance_group,
# for sending RPCs) after restoring backend services.
configure_client(
[messages_pb2.ClientConfigureRequest.RpcType.UNARY_CALL])
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- patch_backend_service(gcp, original_backend_service, [instance_group])
- for backend_service in additional_backend_services:
- delete_backend_service(gcp, backend_service)
- set_validate_for_proxyless(gcp, True)
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ patch_backend_service(gcp, original_backend_service,
+ [instance_group])
+ for backend_service in additional_backend_services:
+ delete_backend_service(gcp, backend_service)
+ set_validate_for_proxyless(gcp, True)
def test_timeout(gcp, original_backend_service, instance_group):
@@ -1919,6 +1997,7 @@ def test_timeout(gcp, original_backend_service, instance_group):
)
]
+ passed = True
try:
first_case = True
for (testcase_name, client_config, expected_results) in test_cases:
@@ -1948,7 +2027,7 @@ def test_timeout(gcp, original_backend_service, instance_group):
after_stats = get_client_accumulated_stats()
success = True
- for rpc, status in expected_results.items():
+ for rpc, status in list(expected_results.items()):
qty = (after_stats.stats_per_method[rpc].result[status] -
before_stats.stats_per_method[rpc].result[status])
want = test_runtime_secs * args.qps
@@ -1967,8 +2046,12 @@ def test_timeout(gcp, original_backend_service, instance_group):
'%s: timeout waiting for expected results: %s; got %s' %
(testcase_name, expected_results,
after_stats.stats_per_method))
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
def test_fault_injection(gcp, original_backend_service, instance_group):
@@ -2039,20 +2122,6 @@ def test_fault_injection(gcp, original_backend_service, instance_group):
# to the appropriate config for the case, defined above.
test_cases = [
(
- 'zero_percent_fault_injection',
- {},
- {
- 0: 1
- }, # OK
- ),
- (
- 'non_matching_fault_injection', # Not in route_rules, above.
- {},
- {
- 0: 1
- }, # OK
- ),
- (
'always_delay',
{
'timeout_sec': 2
@@ -2085,9 +2154,24 @@ def test_fault_injection(gcp, original_backend_service, instance_group):
16: .5,
0: .5
}, # UNAUTHENTICATED / OK: 50% / 50%
- )
+ ),
+ (
+ 'zero_percent_fault_injection',
+ {},
+ {
+ 0: 1
+ }, # OK
+ ),
+ (
+ 'non_matching_fault_injection', # Not in route_rules, above.
+ {},
+ {
+ 0: 1
+ }, # OK
+ ),
]
+ passed = True
try:
first_case = True
for (testcase_name, client_config, expected_results) in test_cases:
@@ -2106,12 +2190,15 @@ def test_fault_injection(gcp, original_backend_service, instance_group):
# but this improves confidence that the test is valid if the
# previous client_config would lead to the same results.
time.sleep(1)
- # Each attempt takes 10 seconds; 20 attempts is equivalent to 200
- # second timeout.
- attempt_count = 20
+ # Each attempt takes 10 seconds
if first_case:
- attempt_count = 120
+ # Give the first test case 600s for xDS config propagation.
+ attempt_count = 60
first_case = False
+ else:
+ # The accumulated stats might include previous sub-test, running
+ # the test multiple times to deflake
+ attempt_count = 10
before_stats = get_client_accumulated_stats()
if not before_stats.stats_per_method:
raise ValueError(
@@ -2125,7 +2212,7 @@ def test_fault_injection(gcp, original_backend_service, instance_group):
after_stats = get_client_accumulated_stats()
success = True
- for status, pct in expected_results.items():
+ for status, pct in list(expected_results.items()):
rpc = 'UNARY_CALL'
qty = (after_stats.stats_per_method[rpc].result[status] -
before_stats.stats_per_method[rpc].result[status])
@@ -2146,9 +2233,13 @@ def test_fault_injection(gcp, original_backend_service, instance_group):
'%s: timeout waiting for expected results: %s; got %s' %
(testcase_name, expected_results,
after_stats.stats_per_method))
+ except Exception:
+ passed = False
+ raise
finally:
- patch_url_map_backend_service(gcp, original_backend_service)
- set_validate_for_proxyless(gcp, True)
+ if passed or not args.halt_after_fail:
+ patch_url_map_backend_service(gcp, original_backend_service)
+ set_validate_for_proxyless(gcp, True)
def test_csds(gcp, original_backend_service, instance_group, server_uri):
@@ -2177,7 +2268,7 @@ def test_csds(gcp, original_backend_service, instance_group, server_uri):
args.zone)
ok = False
seen = set()
- for xds_config in client_config['xds_config']:
+ for xds_config in client_config.get('xds_config', []):
if 'listener_config' in xds_config:
listener_name = xds_config['listener_config'][
'dynamic_listeners'][0]['active_state']['listener'][
@@ -2217,6 +2308,41 @@ def test_csds(gcp, original_backend_service, instance_group, server_uri):
ok = False
else:
seen.add('eds')
+ for generic_xds_config in client_config.get(
+ 'generic_xds_configs', []):
+ if re.search(r'\.Listener$',
+ generic_xds_config['type_url']):
+ seen.add('lds')
+ listener = generic_xds_config["xds_config"]
+ if listener['name'] != server_uri:
+ logger.info('Invalid Listener name %s != %s',
+ listener_name, server_uri)
+ ok = False
+ elif re.search(r'\.RouteConfiguration$',
+ generic_xds_config['type_url']):
+ seen.add('rds')
+ route_config = generic_xds_config["xds_config"]
+ if not len(route_config['virtual_hosts']):
+ logger.info('Invalid number of VirtualHosts %s',
+ num_vh)
+ ok = False
+ elif re.search(r'\.Cluster$',
+ generic_xds_config['type_url']):
+ seen.add('cds')
+ cluster = generic_xds_config["xds_config"]
+ if cluster['type'] != 'EDS':
+ logger.info('Invalid cluster type %s != EDS',
+ cluster_type)
+ ok = False
+ elif re.search(r'\.ClusterLoadAssignment$',
+ generic_xds_config['type_url']):
+ seen.add('eds')
+ endpoint = generic_xds_config["xds_config"]
+ if args.zone not in endpoint["endpoints"][0][
+ "locality"]["sub_zone"]:
+ logger.info('Invalid endpoint sub_zone %s',
+ sub_zone)
+ ok = False
want = {'lds', 'rds', 'cds', 'eds'}
if seen != want:
logger.info('Incomplete xDS config dump, seen=%s', seen)
@@ -2238,44 +2364,23 @@ def test_csds(gcp, original_backend_service, instance_group, server_uri):
test_csds_timeout_s)
-def maybe_write_sponge_properties():
- """Writing test infos to enable more advanced testgrid searches."""
- if 'KOKORO_ARTIFACTS_DIR' not in os.environ:
- return
- if 'GIT_ORIGIN_URL' not in os.environ:
- return
- if 'GIT_COMMIT_SHORT' not in os.environ:
- return
- properties = [
- # Technically, 'TESTS_FORMAT_VERSION' is not required for run_xds_tests.
- # We keep it here so one day we may merge the process of writing sponge
- # properties.
- 'TESTS_FORMAT_VERSION,2',
- 'TESTGRID_EXCLUDE,%s' % os.environ.get('TESTGRID_EXCLUDE', 0),
- 'GIT_ORIGIN_URL,%s' % os.environ['GIT_ORIGIN_URL'],
- 'GIT_COMMIT_SHORT,%s' % os.environ['GIT_COMMIT_SHORT'],
- ]
- logger.info('Writing Sponge configs: %s', properties)
- with open(
- os.path.join(os.environ['KOKORO_ARTIFACTS_DIR'],
- "custom_sponge_config.csv"), 'w') as f:
- f.write("\n".join(properties))
- f.write("\n")
-
-
def set_validate_for_proxyless(gcp, validate_for_proxyless):
if not gcp.alpha_compute:
logger.debug(
'Not setting validateForProxy because alpha is not enabled')
return
+ if len(gcp.global_forwarding_rules) != 1 or len(
+ gcp.target_proxies) != 1 or len(gcp.url_maps) != 1:
+ logger.debug(
+ "Global forwarding rule, target proxy or url map not found.")
+ return
# This function deletes global_forwarding_rule and target_proxy, then
# recreate target_proxy with validateForProxyless=False. This is necessary
# because patching target_grpc_proxy isn't supported.
- delete_global_forwarding_rule(gcp)
- delete_target_proxy(gcp)
- create_target_proxy(gcp, gcp.target_proxy.name, validate_for_proxyless)
- create_global_forwarding_rule(gcp, gcp.global_forwarding_rule.name,
- [gcp.service_port])
+ delete_global_forwarding_rule(gcp, gcp.global_forwarding_rules[0])
+ delete_target_proxy(gcp, gcp.target_proxies[0])
+ create_target_proxy(gcp, target_proxy_name, validate_for_proxyless)
+ create_global_forwarding_rule(gcp, forwarding_rule_name, [gcp.service_port])
def get_serving_status(instance, service_port):
@@ -2314,7 +2419,8 @@ def is_primary_instance_group(gcp, instance_group):
# the client's actual locality.
instance_names = get_instance_names(gcp, instance_group)
stats = get_client_stats(_NUM_TEST_RPCS, _WAIT_FOR_STATS_SEC)
- return all(peer in instance_names for peer in stats.rpcs_by_peer.keys())
+ return all(
+ peer in instance_names for peer in list(stats.rpcs_by_peer.keys()))
def get_startup_script(path_to_server_binary, service_port):
@@ -2359,7 +2465,8 @@ def create_instance_template(gcp, name, network, source_image, machine_type,
'boot': True,
'initializeParams': {
'sourceImage': source_image
- }
+ },
+ 'autoDelete': True
}],
'metadata': {
'items': [{
@@ -2489,7 +2596,9 @@ def create_url_map(gcp, name, backend_service, host_name):
result = gcp.compute.urlMaps().insert(
project=gcp.project, body=config).execute(num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
- gcp.url_map = GcpResource(config['name'], result['targetLink'])
+ url_map = GcpResource(config['name'], result['targetLink'])
+ gcp.url_maps.append(url_map)
+ return url_map
def patch_url_map_host_rule_with_port(gcp, name, backend_service, host_name):
@@ -2506,11 +2615,15 @@ def patch_url_map_host_rule_with_port(gcp, name, backend_service, host_name):
wait_for_global_operation(gcp, result['name'])
-def create_target_proxy(gcp, name, validate_for_proxyless=True):
+def create_target_proxy(gcp, name, validate_for_proxyless=True, url_map=None):
+ if url_map:
+ arg_url_map_url = url_map.url
+ else:
+ arg_url_map_url = gcp.url_maps[0].url
if gcp.alpha_compute:
config = {
'name': name,
- 'url_map': gcp.url_map.url,
+ 'url_map': arg_url_map_url,
'validate_for_proxyless': validate_for_proxyless
}
logger.debug('Sending GCP request with body=%s', config)
@@ -2520,20 +2633,27 @@ def create_target_proxy(gcp, name, validate_for_proxyless=True):
else:
config = {
'name': name,
- 'url_map': gcp.url_map.url,
+ 'url_map': arg_url_map_url,
}
logger.debug('Sending GCP request with body=%s', config)
result = gcp.compute.targetHttpProxies().insert(
project=gcp.project,
body=config).execute(num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
- gcp.target_proxy = GcpResource(config['name'], result['targetLink'])
+ target_proxy = GcpResource(config['name'], result['targetLink'])
+ gcp.target_proxies.append(target_proxy)
+ return target_proxy
def create_global_forwarding_rule(gcp,
name,
potential_ports,
- potential_ip_addresses=['0.0.0.0']):
+ potential_ip_addresses=['0.0.0.0'],
+ target_proxy=None):
+ if target_proxy:
+ arg_target_proxy_url = target_proxy.url
+ else:
+ arg_target_proxy_url = gcp.target_proxies[0].url
if gcp.alpha_compute:
compute_to_use = gcp.alpha_compute
else:
@@ -2547,15 +2667,16 @@ def create_global_forwarding_rule(gcp,
'portRange': str(port),
'IPAddress': ip_address,
'network': args.network,
- 'target': gcp.target_proxy.url,
+ 'target': arg_target_proxy_url,
}
logger.debug('Sending GCP request with body=%s', config)
result = compute_to_use.globalForwardingRules().insert(
project=gcp.project,
body=config).execute(num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
- gcp.global_forwarding_rule = GcpResource(
- config['name'], result['targetLink'])
+ global_forwarding_rule = GcpResource(config['name'],
+ result['targetLink'])
+ gcp.global_forwarding_rules.append(global_forwarding_rule)
gcp.service_port = port
return
except googleapiclient.errors.HttpError as http_error:
@@ -2566,116 +2687,190 @@ def create_global_forwarding_rule(gcp,
def get_health_check(gcp, health_check_name):
- result = gcp.compute.healthChecks().get(
- project=gcp.project, healthCheck=health_check_name).execute()
- gcp.health_check = GcpResource(health_check_name, result['selfLink'])
+ try:
+ result = gcp.compute.healthChecks().get(
+ project=gcp.project, healthCheck=health_check_name).execute()
+ gcp.health_check = GcpResource(health_check_name, result['selfLink'])
+ except Exception as e:
+ gcp.errors.append(e)
+ gcp.health_check = GcpResource(health_check_name, None)
def get_health_check_firewall_rule(gcp, firewall_name):
- result = gcp.compute.firewalls().get(project=gcp.project,
- firewall=firewall_name).execute()
- gcp.health_check_firewall_rule = GcpResource(firewall_name,
- result['selfLink'])
+ try:
+ result = gcp.compute.firewalls().get(project=gcp.project,
+ firewall=firewall_name).execute()
+ gcp.health_check_firewall_rule = GcpResource(firewall_name,
+ result['selfLink'])
+ except Exception as e:
+ gcp.errors.append(e)
+ gcp.health_check_firewall_rule = GcpResource(firewall_name, None)
-def get_backend_service(gcp, backend_service_name):
- result = gcp.compute.backendServices().get(
- project=gcp.project, backendService=backend_service_name).execute()
- backend_service = GcpResource(backend_service_name, result['selfLink'])
+def get_backend_service(gcp, backend_service_name, record_error=True):
+ try:
+ result = gcp.compute.backendServices().get(
+ project=gcp.project, backendService=backend_service_name).execute()
+ backend_service = GcpResource(backend_service_name, result['selfLink'])
+ except Exception as e:
+ if record_error:
+ gcp.errors.append(e)
+ backend_service = GcpResource(backend_service_name, None)
gcp.backend_services.append(backend_service)
return backend_service
-def get_url_map(gcp, url_map_name):
- result = gcp.compute.urlMaps().get(project=gcp.project,
- urlMap=url_map_name).execute()
- gcp.url_map = GcpResource(url_map_name, result['selfLink'])
+def get_url_map(gcp, url_map_name, record_error=True):
+ try:
+ result = gcp.compute.urlMaps().get(project=gcp.project,
+ urlMap=url_map_name).execute()
+ url_map = GcpResource(url_map_name, result['selfLink'])
+ gcp.url_maps.append(url_map)
+ except Exception as e:
+ if record_error:
+ gcp.errors.append(e)
-def get_target_proxy(gcp, target_proxy_name):
- if gcp.alpha_compute:
- result = gcp.alpha_compute.targetGrpcProxies().get(
- project=gcp.project, targetGrpcProxy=target_proxy_name).execute()
- else:
- result = gcp.compute.targetHttpProxies().get(
- project=gcp.project, targetHttpProxy=target_proxy_name).execute()
- gcp.target_proxy = GcpResource(target_proxy_name, result['selfLink'])
+def get_target_proxy(gcp, target_proxy_name, record_error=True):
+ try:
+ if gcp.alpha_compute:
+ result = gcp.alpha_compute.targetGrpcProxies().get(
+ project=gcp.project,
+ targetGrpcProxy=target_proxy_name).execute()
+ else:
+ result = gcp.compute.targetHttpProxies().get(
+ project=gcp.project,
+ targetHttpProxy=target_proxy_name).execute()
+ target_proxy = GcpResource(target_proxy_name, result['selfLink'])
+ gcp.target_proxies.append(target_proxy)
+ except Exception as e:
+ if record_error:
+ gcp.errors.append(e)
-def get_global_forwarding_rule(gcp, forwarding_rule_name):
- result = gcp.compute.globalForwardingRules().get(
- project=gcp.project, forwardingRule=forwarding_rule_name).execute()
- gcp.global_forwarding_rule = GcpResource(forwarding_rule_name,
+def get_global_forwarding_rule(gcp, forwarding_rule_name, record_error=True):
+ try:
+ result = gcp.compute.globalForwardingRules().get(
+ project=gcp.project, forwardingRule=forwarding_rule_name).execute()
+ global_forwarding_rule = GcpResource(forwarding_rule_name,
result['selfLink'])
+ gcp.global_forwarding_rules.append(global_forwarding_rule)
+ except Exception as e:
+ if record_error:
+ gcp.errors.append(e)
def get_instance_template(gcp, template_name):
- result = gcp.compute.instanceTemplates().get(
- project=gcp.project, instanceTemplate=template_name).execute()
- gcp.instance_template = GcpResource(template_name, result['selfLink'])
+ try:
+ result = gcp.compute.instanceTemplates().get(
+ project=gcp.project, instanceTemplate=template_name).execute()
+ gcp.instance_template = GcpResource(template_name, result['selfLink'])
+ except Exception as e:
+ gcp.errors.append(e)
+ gcp.instance_template = GcpResource(template_name, None)
def get_instance_group(gcp, zone, instance_group_name):
- result = gcp.compute.instanceGroups().get(
- project=gcp.project, zone=zone,
- instanceGroup=instance_group_name).execute()
- gcp.service_port = result['namedPorts'][0]['port']
- instance_group = InstanceGroup(instance_group_name, result['selfLink'],
- zone)
+ try:
+ result = gcp.compute.instanceGroups().get(
+ project=gcp.project, zone=zone,
+ instanceGroup=instance_group_name).execute()
+ gcp.service_port = result['namedPorts'][0]['port']
+ instance_group = InstanceGroup(instance_group_name, result['selfLink'],
+ zone)
+ except Exception as e:
+ gcp.errors.append(e)
+ instance_group = InstanceGroup(instance_group_name, None, zone)
gcp.instance_groups.append(instance_group)
return instance_group
-def delete_global_forwarding_rule(gcp, name=None):
- if name:
- forwarding_rule_to_delete = name
- else:
- forwarding_rule_to_delete = gcp.global_forwarding_rule.name
+def delete_global_forwarding_rule(gcp, forwarding_rule_to_delete=None):
+ if not forwarding_rule_to_delete:
+ return
try:
+ logger.debug('Deleting forwarding rule %s',
+ forwarding_rule_to_delete.name)
result = gcp.compute.globalForwardingRules().delete(
project=gcp.project,
- forwardingRule=forwarding_rule_to_delete).execute(
+ forwardingRule=forwarding_rule_to_delete.name).execute(
num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
+ if forwarding_rule_to_delete in gcp.global_forwarding_rules:
+ gcp.global_forwarding_rules.remove(forwarding_rule_to_delete)
+ else:
+ logger.debug(
+ 'Forwarding rule %s does not exist in gcp.global_forwarding_rules',
+ forwarding_rule_to_delete.name)
except googleapiclient.errors.HttpError as http_error:
logger.info('Delete failed: %s', http_error)
-def delete_target_proxy(gcp, name=None):
- if name:
- proxy_to_delete = name
- else:
- proxy_to_delete = gcp.target_proxy.name
+def delete_global_forwarding_rules(gcp):
+ forwarding_rules_to_delete = gcp.global_forwarding_rules.copy()
+ for forwarding_rule in forwarding_rules_to_delete:
+ delete_global_forwarding_rule(gcp, forwarding_rule)
+
+
+def delete_target_proxy(gcp, proxy_to_delete=None):
+ if not proxy_to_delete:
+ return
try:
if gcp.alpha_compute:
+ logger.debug('Deleting grpc proxy %s', proxy_to_delete.name)
result = gcp.alpha_compute.targetGrpcProxies().delete(
- project=gcp.project, targetGrpcProxy=proxy_to_delete).execute(
+ project=gcp.project,
+ targetGrpcProxy=proxy_to_delete.name).execute(
num_retries=_GCP_API_RETRIES)
else:
+ logger.debug('Deleting http proxy %s', proxy_to_delete.name)
result = gcp.compute.targetHttpProxies().delete(
- project=gcp.project, targetHttpProxy=proxy_to_delete).execute(
+ project=gcp.project,
+ targetHttpProxy=proxy_to_delete.name).execute(
num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
+ if proxy_to_delete in gcp.target_proxies:
+ gcp.target_proxies.remove(proxy_to_delete)
+ else:
+ logger.debug('Gcp proxy %s does not exist in gcp.target_proxies',
+ proxy_to_delete.name)
except googleapiclient.errors.HttpError as http_error:
logger.info('Delete failed: %s', http_error)
-def delete_url_map(gcp, name=None):
- if name:
- url_map_to_delete = name
- else:
- url_map_to_delete = gcp.url_map.name
+def delete_target_proxies(gcp):
+ target_proxies_to_delete = gcp.target_proxies.copy()
+ for target_proxy in target_proxies_to_delete:
+ delete_target_proxy(gcp, target_proxy)
+
+
+def delete_url_map(gcp, url_map_to_delete=None):
+ if not url_map_to_delete:
+ return
try:
+ logger.debug('Deleting url map %s', url_map_to_delete.name)
result = gcp.compute.urlMaps().delete(
project=gcp.project,
- urlMap=url_map_to_delete).execute(num_retries=_GCP_API_RETRIES)
+ urlMap=url_map_to_delete.name).execute(num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
+ if url_map_to_delete in gcp.url_maps:
+ gcp.url_maps.remove(url_map_to_delete)
+ else:
+ logger.debug('Url map %s does not exist in gcp.url_maps',
+ url_map_to_delete.name)
except googleapiclient.errors.HttpError as http_error:
logger.info('Delete failed: %s', http_error)
+def delete_url_maps(gcp):
+ url_maps_to_delete = gcp.url_maps.copy()
+ for url_map in url_maps_to_delete:
+ delete_url_map(gcp, url_map)
+
+
def delete_backend_service(gcp, backend_service):
try:
+ logger.debug('Deleting backend service %s', backend_service.name)
result = gcp.compute.backendServices().delete(
project=gcp.project, backendService=backend_service.name).execute(
num_retries=_GCP_API_RETRIES)
@@ -2691,6 +2886,8 @@ def delete_backend_services(gcp):
def delete_firewall(gcp):
try:
+ logger.debug('Deleting firewall %s',
+ gcp.health_check_firewall_rule.name)
result = gcp.compute.firewalls().delete(
project=gcp.project,
firewall=gcp.health_check_firewall_rule.name).execute(
@@ -2702,6 +2899,7 @@ def delete_firewall(gcp):
def delete_health_check(gcp):
try:
+ logger.debug('Deleting health check %s', gcp.health_check.name)
result = gcp.compute.healthChecks().delete(
project=gcp.project, healthCheck=gcp.health_check.name).execute(
num_retries=_GCP_API_RETRIES)
@@ -2713,6 +2911,8 @@ def delete_health_check(gcp):
def delete_instance_groups(gcp):
for instance_group in gcp.instance_groups:
try:
+ logger.debug('Deleting instance group %s %s', instance_group.name,
+ instance_group.zone)
result = gcp.compute.instanceGroupManagers().delete(
project=gcp.project,
zone=instance_group.zone,
@@ -2728,6 +2928,8 @@ def delete_instance_groups(gcp):
def delete_instance_template(gcp):
try:
+ logger.debug('Deleting instance template %s',
+ gcp.instance_template.name)
result = gcp.compute.instanceTemplates().delete(
project=gcp.project,
instanceTemplate=gcp.instance_template.name).execute(
@@ -2784,7 +2986,12 @@ def resize_instance_group(gcp,
def patch_url_map_backend_service(gcp,
backend_service=None,
services_with_weights=None,
- route_rules=None):
+ route_rules=None,
+ url_map=None):
+ if url_map:
+ url_map_name = url_map.name
+ else:
+ url_map_name = gcp.url_maps[0].name
'''change url_map's backend service
Only one of backend_service and service_with_weights can be not None.
@@ -2803,7 +3010,7 @@ def patch_url_map_backend_service(gcp,
'weightedBackendServices': [{
'backendService': service.url,
'weight': w,
- } for service, w in services_with_weights.items()]
+ } for service, w in list(services_with_weights.items())]
} if services_with_weights else None
config = {
@@ -2816,7 +3023,7 @@ def patch_url_map_backend_service(gcp,
}
logger.debug('Sending GCP request with body=%s', config)
result = compute_to_use.urlMaps().patch(
- project=gcp.project, urlMap=gcp.url_map.name,
+ project=gcp.project, urlMap=url_map_name,
body=config).execute(num_retries=_GCP_API_RETRIES)
wait_for_global_operation(gcp, result['name'])
@@ -2930,12 +3137,9 @@ def get_instance_names(gcp, instance_group):
def clean_up(gcp):
- if gcp.global_forwarding_rule:
- delete_global_forwarding_rule(gcp)
- if gcp.target_proxy:
- delete_target_proxy(gcp)
- if gcp.url_map:
- delete_url_map(gcp)
+ delete_global_forwarding_rules(gcp)
+ delete_target_proxies(gcp)
+ delete_url_maps(gcp)
delete_backend_services(gcp)
if gcp.health_check_firewall_rule:
delete_firewall(gcp)
@@ -2971,15 +3175,21 @@ class GcpState(object):
self.health_check = None
self.health_check_firewall_rule = None
self.backend_services = []
- self.url_map = None
- self.target_proxy = None
- self.global_forwarding_rule = None
+ self.url_maps = []
+ self.target_proxies = []
+ self.global_forwarding_rules = []
self.service_port = None
self.instance_template = None
self.instance_groups = []
+ self.errors = []
-maybe_write_sponge_properties()
+logging.debug(
+ "script start time: %s",
+ datetime.datetime.now(
+ datetime.timezone.utc).astimezone().strftime("%Y-%m-%dT%H:%M:%S %Z"))
+logging.debug("logging local timezone: %s",
+ datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo)
alpha_compute = None
if args.compute_discovery_document:
with open(args.compute_discovery_document, 'r') as discovery_doc:
@@ -2994,6 +3204,8 @@ else:
if not args.only_stable_gcp_apis:
alpha_compute = googleapiclient.discovery.build('compute', 'alpha')
+test_results = {}
+failed_tests = []
try:
gcp = GcpState(compute, alpha_compute, args.project_id, args.project_num)
gcp_suffix = args.gcp_suffix
@@ -3021,36 +3233,49 @@ try:
firewall_name = _BASE_FIREWALL_RULE_NAME + gcp_suffix
backend_service_name = _BASE_BACKEND_SERVICE_NAME + gcp_suffix
alternate_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-alternate' + gcp_suffix
+ extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-extra' + gcp_suffix
+ more_extra_backend_service_name = _BASE_BACKEND_SERVICE_NAME + '-more-extra' + gcp_suffix
url_map_name = _BASE_URL_MAP_NAME + gcp_suffix
+ url_map_name_2 = url_map_name + '2'
service_host_name = _BASE_SERVICE_HOST + gcp_suffix
target_proxy_name = _BASE_TARGET_PROXY_NAME + gcp_suffix
+ target_proxy_name_2 = target_proxy_name + '2'
forwarding_rule_name = _BASE_FORWARDING_RULE_NAME + gcp_suffix
+ forwarding_rule_name_2 = forwarding_rule_name + '2'
template_name = _BASE_TEMPLATE_NAME + gcp_suffix
instance_group_name = _BASE_INSTANCE_GROUP_NAME + gcp_suffix
same_zone_instance_group_name = _BASE_INSTANCE_GROUP_NAME + '-same-zone' + gcp_suffix
secondary_zone_instance_group_name = _BASE_INSTANCE_GROUP_NAME + '-secondary-zone' + gcp_suffix
+ potential_service_ports = list(args.service_port_range)
+ random.shuffle(potential_service_ports)
if args.use_existing_gcp_resources:
logger.info('Reusing existing GCP resources')
get_health_check(gcp, health_check_name)
- try:
- get_health_check_firewall_rule(gcp, firewall_name)
- except googleapiclient.errors.HttpError as http_error:
- # Firewall rule may be auto-deleted periodically depending on GCP
- # project settings.
- logger.exception('Failed to find firewall rule, recreating')
- create_health_check_firewall_rule(gcp, firewall_name)
+ get_health_check_firewall_rule(gcp, firewall_name)
backend_service = get_backend_service(gcp, backend_service_name)
alternate_backend_service = get_backend_service(
gcp, alternate_backend_service_name)
+ extra_backend_service = get_backend_service(gcp,
+ extra_backend_service_name,
+ record_error=False)
+ more_extra_backend_service = get_backend_service(
+ gcp, more_extra_backend_service_name, record_error=False)
get_url_map(gcp, url_map_name)
get_target_proxy(gcp, target_proxy_name)
get_global_forwarding_rule(gcp, forwarding_rule_name)
+ get_url_map(gcp, url_map_name_2, record_error=False)
+ get_target_proxy(gcp, target_proxy_name_2, record_error=False)
+ get_global_forwarding_rule(gcp,
+ forwarding_rule_name_2,
+ record_error=False)
get_instance_template(gcp, template_name)
instance_group = get_instance_group(gcp, args.zone, instance_group_name)
same_zone_instance_group = get_instance_group(
gcp, args.zone, same_zone_instance_group_name)
secondary_zone_instance_group = get_instance_group(
gcp, args.secondary_zone, secondary_zone_instance_group_name)
+ if gcp.errors:
+ raise Exception(gcp.errors)
else:
create_health_check_firewall_rule(gcp, firewall_name)
backend_service = add_backend_service(gcp, backend_service_name)
@@ -3058,8 +3283,6 @@ try:
gcp, alternate_backend_service_name)
create_url_map(gcp, url_map_name, backend_service, service_host_name)
create_target_proxy(gcp, target_proxy_name)
- potential_service_ports = list(args.service_port_range)
- random.shuffle(potential_service_ports)
create_global_forwarding_rule(gcp, forwarding_rule_name,
potential_service_ports)
if not gcp.service_port:
@@ -3116,8 +3339,6 @@ try:
client_env['GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING'] = 'true'
client_env['GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT'] = 'true'
client_env['GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION'] = 'true'
- test_results = {}
- failed_tests = []
for test_case in args.test_case:
if test_case in _V3_TEST_CASES and not args.xds_v3_support:
logger.info('skipping test %s due to missing v3 support',
@@ -3276,6 +3497,9 @@ try:
failed_tests.append(test_case)
result.state = 'FAILED'
result.message = str(e)
+ if args.halt_after_fail:
+ # Stop the test suite if one case failed.
+ raise
finally:
if client_process:
if client_process.returncode:
@@ -3304,6 +3528,11 @@ try:
logger.error('Test case(s) %s failed', failed_tests)
sys.exit(1)
finally:
- if not args.keep_gcp_resources:
+ keep_resources = args.keep_gcp_resources
+ if args.halt_after_fail and failed_tests:
+ logger.info(
+ 'Halt after fail triggered, exiting without cleaning up resources')
+ keep_resources = True
+ if not keep_resources:
logger.info('Cleaning up GCP resources. This may take some time.')
clean_up(gcp)
diff --git a/grpc/tools/run_tests/sanity/build_banned_constructs.sh b/grpc/tools/run_tests/sanity/build_banned_constructs.sh
new file mode 100755
index 00000000..9286fbcc
--- /dev/null
+++ b/grpc/tools/run_tests/sanity/build_banned_constructs.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# 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.
+
+set -e
+
+cd "$(dirname "$0")/../../.."
+
+#
+# Prevent the use of single line comments after license clauses, since this
+# chokes the internal import process.
+#
+
+regex='^licenses\(.*#'
+for dir in bazel examples src test tools; do
+ for file in BUILD BUILD.bazel; do
+ git grep -EIrn "$regex" "$dir/**$file" | diff - /dev/null
+ done
+done
+
diff --git a/grpc/tools/run_tests/sanity/check_bazel_workspace.py b/grpc/tools/run_tests/sanity/check_bazel_workspace.py
index c87892ae..4965a15e 100755
--- a/grpc/tools/run_tests/sanity/check_bazel_workspace.py
+++ b/grpc/tools/run_tests/sanity/check_bazel_workspace.py
@@ -48,9 +48,11 @@ _GRPC_DEP_NAMES = [
_TWISTED_TWISTED_DEP_NAME, _YAML_PYYAML_DEP_NAME,
_TWISTED_INCREMENTAL_DEP_NAME, _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME,
_TWISTED_CONSTANTLY_DEP_NAME, 'io_bazel_rules_go',
- 'build_bazel_rules_apple', 'build_bazel_apple_support', 'libuv',
- 'com_googlesource_code_re2', 'bazel_gazelle', 'opencensus_proto',
- 'com_envoyproxy_protoc_gen_validate', 'com_google_googleapis'
+ 'build_bazel_rules_apple', 'build_bazel_apple_support',
+ 'com_github_libuv_libuv', 'com_googlesource_code_re2', 'bazel_gazelle',
+ 'opencensus_proto', 'com_envoyproxy_protoc_gen_validate',
+ 'com_google_googleapis', 'com_google_libprotobuf_mutator',
+ 'com_github_cncf_udpa'
]
_GRPC_BAZEL_ONLY_DEPS = [
@@ -74,6 +76,7 @@ _GRPC_BAZEL_ONLY_DEPS = [
'opencensus_proto',
'com_envoyproxy_protoc_gen_validate',
'com_google_googleapis',
+ 'com_google_libprotobuf_mutator'
]
@@ -163,10 +166,10 @@ if len(workspace_git_hashes - git_submodule_hashes) > 0:
print(
"Found discrepancies between git submodules and Bazel WORKSPACE dependencies"
)
- print("workspace_git_hashes: %s" % workspace_git_hashes)
- print("git_submodule_hashes: %s" % git_submodule_hashes)
- print("workspace_git_hashes - git_submodule_hashes: %s" %
- (workspace_git_hashes - git_submodule_hashes))
+ print(("workspace_git_hashes: %s" % workspace_git_hashes))
+ print(("git_submodule_hashes: %s" % git_submodule_hashes))
+ print(("workspace_git_hashes - git_submodule_hashes: %s" %
+ (workspace_git_hashes - git_submodule_hashes)))
sys.exit(1)
# Also check that we can override each dependency
diff --git a/grpc/tools/run_tests/sanity/check_buildifier.sh b/grpc/tools/run_tests/sanity/check_buildifier.sh
index bb183711..c0e81176 100755
--- a/grpc/tools/run_tests/sanity/check_buildifier.sh
+++ b/grpc/tools/run_tests/sanity/check_buildifier.sh
@@ -16,14 +16,14 @@
# The script to check if Bazel files need to be formatted.
GIT_ROOT="$(dirname "$0")/../../.."
-"$GIT_ROOT/tools/distrib/buildifier_format_code.sh" -mode=diff
+"$GIT_ROOT/tools/distrib/buildifier_format_code.sh" -mode=diff -lint warn
result=$?
if [[ ${result} != 0 ]]; then
echo "==========BUILDIFIER CHECK FAILED=========="
echo "Please try using the following script to fix automatically:"
echo ""
- echo " tools/distrib/buildifier_format_code.sh"
+ echo " tools/distrib/buildifier_format_code_strict.sh"
echo ""
exit 1
else
diff --git a/grpc/tools/run_tests/sanity/check_deprecated_grpc++.py b/grpc/tools/run_tests/sanity/check_deprecated_grpc++.py
index 64e2080d..17bffc5f 100755
--- a/grpc/tools/run_tests/sanity/check_deprecated_grpc++.py
+++ b/grpc/tools/run_tests/sanity/check_deprecated_grpc++.py
@@ -134,9 +134,9 @@ if path_files.sort() != expected_files.sort():
diff_plus = [file for file in path_files if file not in expected_files]
diff_minus = [file for file in expected_files if file not in path_files]
for file in diff_minus:
- print('- ', file)
+ print(('- ', file))
for file in diff_plus:
- print('+ ', file)
+ print(('+ ', file))
errors += 1
if errors > 0:
@@ -161,7 +161,7 @@ for path_file in expected_files:
fo.write(expected_content)
if 0 != os.system('diff %s %s' % (path_file_expected, path_file)):
- print('Difference found in file:', path_file)
+ print(('Difference found in file:', path_file))
errors += 1
os.remove(path_file_expected)
@@ -177,9 +177,9 @@ for root, dirs, files in os.walk('src'):
with open(path_file, "r") as fi:
content = fi.read()
if '#include <grpc++/' in content:
- print(
+ print((
'Failed: invalid include of deprecated headers in include/grpc++ in %s'
- % path_file)
+ % path_file))
errors += 1
except IOError:
pass
diff --git a/grpc/tools/run_tests/sanity/check_do_not_submit.sh b/grpc/tools/run_tests/sanity/check_do_not_submit.sh
new file mode 100755
index 00000000..6e0438cd
--- /dev/null
+++ b/grpc/tools/run_tests/sanity/check_do_not_submit.sh
@@ -0,0 +1,23 @@
+#! /bin/bash
+# Copyright 2021 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.
+#
+# Checks if any file contains "DO NOT SUBMIT"
+
+cd "$(dirname "$0")/../../.." || exit 1
+git grep -Irn 'DO NOT SUBMIT' -- \
+ './*' \
+ ':!*check_do_not_submit.sh' \
+ ':!third_party/'
+test $? -eq 1 || exit 1
diff --git a/grpc/tools/run_tests/sanity/check_include_style.py b/grpc/tools/run_tests/sanity/check_include_style.py
new file mode 100755
index 00000000..602176bd
--- /dev/null
+++ b/grpc/tools/run_tests/sanity/check_include_style.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python3
+
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 os
+import re
+import sys
+
+os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
+
+BAD_REGEXES = [
+ (r'\n#include "include/(.*)"', r'\n#include <\1>'),
+ (r'\n#include "grpc(.*)"', r'\n#include <grpc\1>'),
+]
+
+fix = sys.argv[1:] == ['--fix']
+if fix:
+ print("FIXING!")
+
+
+def check_include_style(directory_root):
+ bad_files = []
+ for root, dirs, files in os.walk(directory_root):
+ for filename in files:
+ path = os.path.join(root, filename)
+ if os.path.splitext(path)[1] not in ['.c', '.cc', '.h']:
+ continue
+ if filename.endswith('.pb.h') or filename.endswith('.pb.c'):
+ continue
+ # Skip check for upb generated code.
+ if (filename.endswith('.upb.h') or filename.endswith('.upb.c') or
+ filename.endswith('.upbdefs.h') or
+ filename.endswith('.upbdefs.c')):
+ continue
+ with open(path) as f:
+ text = f.read()
+ original = text
+ for regex, replace in BAD_REGEXES:
+ text = re.sub(regex, replace, text)
+ if text != original:
+ bad_files.append(path)
+ if fix:
+ with open(path, 'w') as f:
+ f.write(text)
+ return bad_files
+
+
+all_bad_files = []
+all_bad_files += check_include_style(os.path.join('src', 'core'))
+all_bad_files += check_include_style(os.path.join('src', 'cpp'))
+all_bad_files += check_include_style(os.path.join('test', 'core'))
+all_bad_files += check_include_style(os.path.join('test', 'cpp'))
+all_bad_files += check_include_style(os.path.join('include', 'grpc'))
+all_bad_files += check_include_style(os.path.join('include', 'grpcpp'))
+
+if all_bad_files:
+ for f in all_bad_files:
+ print("%s has badly formed grpc system header files" % f)
+ sys.exit(1)
diff --git a/grpc/tools/run_tests/sanity/check_package_name.py b/grpc/tools/run_tests/sanity/check_package_name.py
new file mode 100755
index 00000000..addca8b8
--- /dev/null
+++ b/grpc/tools/run_tests/sanity/check_package_name.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 os
+import sys
+
+os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
+
+# Allowance for overrides for specific files
+EXPECTED_NAMES = {
+ 'src/proto/grpc/channelz': 'channelz',
+ 'src/proto/grpc/status': 'status',
+ 'src/proto/grpc/testing': 'testing',
+ 'src/proto/grpc/testing/duplicate': 'duplicate',
+ 'src/proto/grpc/lb/v1': 'lb',
+ 'src/proto/grpc/testing/xds': 'xds',
+ 'src/proto/grpc/testing/xds/v3': 'xds_v3',
+ 'src/proto/grpc/core': 'core',
+ 'src/proto/grpc/health/v1': 'health',
+ 'src/proto/grpc/reflection/v1alpha': 'reflection',
+ 'src/proto/grpc/reflection/v1': 'reflection_v1',
+}
+
+errors = 0
+for root, dirs, files in os.walk('.'):
+ if root.startswith('./'):
+ root = root[len('./'):]
+ # don't check third party
+ if root.startswith('third_party/'):
+ continue
+ # only check BUILD files
+ if 'BUILD' not in files:
+ continue
+ text = open('%s/BUILD' % root).read()
+ # find a grpc_package clause
+ pkg_start = text.find('grpc_package(')
+ if pkg_start == -1:
+ continue
+ # parse it, taking into account nested parens
+ pkg_end = pkg_start + len('grpc_package(')
+ level = 1
+ while level == 1:
+ if text[pkg_end] == ')':
+ level -= 1
+ elif text[pkg_end] == '(':
+ level += 1
+ pkg_end += 1
+ # it's a python statement, so evaluate it to pull out the name of the package
+ name = eval(text[pkg_start:pkg_end],
+ {'grpc_package': lambda name, **kwargs: name})
+ # the name should be the path within the source tree, excepting some special
+ # BUILD files (really we should normalize them too at some point)
+ # TODO(ctiller): normalize all package names
+ expected_name = EXPECTED_NAMES.get(root, root)
+ if name != expected_name:
+ print("%s/BUILD should define a grpc_package with name=%r, not %r" %
+ (root, expected_name, name))
+ errors += 1
+
+if errors != 0:
+ sys.exit(1)
diff --git a/grpc/tools/run_tests/sanity/check_port_platform.py b/grpc/tools/run_tests/sanity/check_port_platform.py
index a3e8e03b..fb6b68c5 100755
--- a/grpc/tools/run_tests/sanity/check_port_platform.py
+++ b/grpc/tools/run_tests/sanity/check_port_platform.py
@@ -20,7 +20,7 @@ import sys
os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
-def check_port_platform_inclusion(directory_root):
+def check_port_platform_inclusion(directory_root, legal_list):
bad_files = []
for root, dirs, files in os.walk(directory_root):
for filename in files:
@@ -45,10 +45,7 @@ def check_port_platform_inclusion(directory_root):
all_lines_in_file = f.readlines()
for index, l in enumerate(all_lines_in_file):
if '#include' in l:
- if l not in [
- '#include <grpc/support/port_platform.h>\n',
- '#include <grpc/impl/codegen/port_platform.h>\n'
- ]:
+ if l not in legal_list:
bad_files.append(path)
elif all_lines_in_file[index + 1] != '\n':
# Require a blank line after including port_platform.h in
@@ -60,11 +57,30 @@ def check_port_platform_inclusion(directory_root):
all_bad_files = []
-all_bad_files += check_port_platform_inclusion(os.path.join('src', 'core'))
-all_bad_files += check_port_platform_inclusion(os.path.join('include', 'grpc'))
+all_bad_files += check_port_platform_inclusion(os.path.join('src', 'core'), [
+ '#include <grpc/support/port_platform.h>\n',
+])
+all_bad_files += check_port_platform_inclusion(os.path.join(
+ 'include', 'grpc'), [
+ '#include <grpc/support/port_platform.h>\n',
+ '#include <grpc/impl/codegen/port_platform.h>\n',
+ ])
-if len(all_bad_files) > 0:
- for f in all_bad_files:
- print((('port_platform.h is not the first included header or there '
- 'is not a blank line following its inclusion in %s') % f))
- sys.exit(1)
+if sys.argv[1:] == ['--fix']:
+ for path in all_bad_files:
+ text = ''
+ found = False
+ with open(path) as f:
+ for l in f.readlines():
+ if not found and '#include' in l:
+ text += '#include <grpc/support/port_platform.h>\n\n'
+ found = True
+ text += l
+ with open(path, 'w') as f:
+ f.write(text)
+else:
+ if len(all_bad_files) > 0:
+ for f in all_bad_files:
+ print((('port_platform.h is not the first included header or there '
+ 'is not a blank line following its inclusion in %s') % f))
+ sys.exit(1)
diff --git a/grpc/tools/run_tests/sanity/check_qps_scenario_changes.py b/grpc/tools/run_tests/sanity/check_qps_scenario_changes.py
index fffa813c..ce3de84e 100755
--- a/grpc/tools/run_tests/sanity/check_qps_scenario_changes.py
+++ b/grpc/tools/run_tests/sanity/check_qps_scenario_changes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2018 gRPC authors.
#
@@ -15,15 +15,15 @@
# limitations under the License.
import os
-import sys
import subprocess
+import sys
os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../../test/cpp/qps'))
-subprocess.call(['./json_run_localhost_scenario_gen.py'])
-subprocess.call(['./qps_json_driver_scenario_gen.py'])
-subprocess.call(['buildifier', '-v', '-r', '.'])
+subprocess.check_call(['./json_run_localhost_scenario_gen.py'])
+subprocess.check_call(['./qps_json_driver_scenario_gen.py'])
+subprocess.check_call(['buildifier', '-v', '-r', '.'])
-output = subprocess.check_output(['git', 'status', '--porcelain'])
+output = subprocess.check_output(['git', 'status', '--porcelain']).decode()
qps_json_driver_bzl = 'test/cpp/qps/qps_json_driver_scenarios.bzl'
json_run_localhost_bzl = 'test/cpp/qps/json_run_localhost_scenarios.bzl'
diff --git a/grpc/tools/run_tests/sanity/check_submodules.sh b/grpc/tools/run_tests/sanity/check_submodules.sh
index 530c5bf0..cbc24540 100755
--- a/grpc/tools/run_tests/sanity/check_submodules.sh
+++ b/grpc/tools/run_tests/sanity/check_submodules.sh
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
set -e
export TEST=true
@@ -24,23 +23,23 @@ cd "$(dirname "$0")/../../.."
submodules=$(mktemp /tmp/submXXXXXX)
want_submodules=$(mktemp /tmp/submXXXXXX)
-git submodule | awk '{ print $2 " " $1 }' | sort > "$submodules"
-cat << EOF | sort > "$want_submodules"
-third_party/abseil-cpp 997aaf3a28308eba1b9156aa35ab7bca9688e9f6
-third_party/benchmark 73d4d5e8d6d449fc8663765a42aa8aeeee844489
-third_party/bloaty 73594cde8c9a52a102c4341c244c833aa61b9c06
-third_party/boringssl-with-bazel 688fc5cf5428868679d2ae1072cad81055752068
-third_party/cares/cares e982924acee7f7313b4baa4ee5ec000c5e373c30
-third_party/envoy-api 18b54850c9b7ba29a4ab67cbd7ed7eab7b0bbdb2
-third_party/googleapis 82944da21578a53b74e547774cf62ed31a05b841
-third_party/googletest c9ccac7cb7345901884aabf5d1a786cfa6e2f397
-third_party/libuv 15ae750151ac9341e5945eb38f8982d59fb99201
+git submodule | awk '{ print $2 " " $1 }' | sort >"$submodules"
+cat <<EOF | sort >"$want_submodules"
+third_party/abseil-cpp 215105818dfde3174fe799600bb0f3cae233d0bf
+third_party/benchmark 0baacde3618ca617da95375e0af13ce1baadea47
+third_party/bloaty 60209eb1ccc34d5deefb002d1b7f37545204f7f2
+third_party/boringssl-with-bazel b9232f9e27e5668bc0414879dcdedb2a59ea75f2
+third_party/cares/cares 6654436a307a5a686b008c1d4c93b0085da6e6d8
+third_party/envoy-api 9c42588c956220b48eb3099d186487c2f04d32ec
+third_party/googleapis 2f9af297c84c55c8b871ba4495e01ade42476c92
+third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45
+third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809
third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89
-third_party/protobuf 436bd7880e458532901c58f4d9d1ea23fa7edd52
-third_party/protoc-gen-validate 872b28c457822ed9c2a5405da3c33f386ac0e86f
-third_party/re2 aecba11114cf1fac5497aeb844b6966106de3eb6
-third_party/udpa cc1b757b3eddccaaaf0743cbb107742bb7e3ee4f
-third_party/zlib cacf7f1d4e3d44d871b605da3b647f07d718623f
+third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df
+third_party/protobuf b464cfbee18c71c40e761a5273ad369f3547294b
+third_party/re2 8e08f47b11b413302749c0d8b17a1c94777495d5
+third_party/xds cb28da3451f158a947dfc45090fe92b07b243bc1
+third_party/zlib 21767c654d31d2dccdde4330529775c6c5fd5389
EOF
diff -u "$submodules" "$want_submodules"
diff --git a/grpc/tools/run_tests/sanity/check_test_filtering.py b/grpc/tools/run_tests/sanity/check_test_filtering.py
index f287864f..01c830a3 100755
--- a/grpc/tools/run_tests/sanity/check_test_filtering.py
+++ b/grpc/tools/run_tests/sanity/check_test_filtering.py
@@ -15,14 +15,15 @@
# limitations under the License.
import os
+import re
import sys
import unittest
-import re
# hack import paths to pick up extra code
sys.path.insert(0, os.path.abspath('tools/run_tests/'))
-from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs
import python_utils.filter_pull_request_tests as filter_pull_request_tests
+from run_tests_matrix import _create_portability_test_jobs
+from run_tests_matrix import _create_test_jobs
_LIST_OF_LANGUAGE_LABELS = [
'c', 'c++', 'csharp', 'grpc-node', 'objc', 'php', 'php7', 'python', 'ruby'
diff --git a/grpc/tools/run_tests/sanity/check_tracer_sanity.py b/grpc/tools/run_tests/sanity/check_tracer_sanity.py
index 8d5635bb..040e0852 100755
--- a/grpc/tools/run_tests/sanity/check_tracer_sanity.py
+++ b/grpc/tools/run_tests/sanity/check_tracer_sanity.py
@@ -15,8 +15,8 @@
# limitations under the License.
import os
-import sys
import re
+import sys
os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
@@ -38,9 +38,9 @@ with open('doc/environment_variables.md') as f:
for t in tracers:
if t not in text:
- print(
+ print((
"ERROR: tracer \"%s\" is not mentioned in doc/environment_variables.md"
- % t)
+ % t))
errors += 1
assert errors == 0
diff --git a/grpc/tools/run_tests/sanity/check_version.py b/grpc/tools/run_tests/sanity/check_version.py
index 5e963c48..0afd00d1 100755
--- a/grpc/tools/run_tests/sanity/check_version.py
+++ b/grpc/tools/run_tests/sanity/check_version.py
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys
-import yaml
import os
import re
import subprocess
+import sys
+
+import yaml
errors = 0
@@ -30,7 +31,7 @@ from expand_version import Version
try:
branch_name = subprocess.check_output('git rev-parse --abbrev-ref HEAD',
- shell=True)
+ shell=True).decode()
except:
print('WARNING: not a git repository')
branch_name = None
@@ -62,22 +63,22 @@ settings = build_yaml['settings']
top_version = Version(settings['version'])
if not check_version(top_version):
errors += 1
- print(warning % ('version', top_version))
+ print((warning % ('version', top_version)))
-for tag, value in settings.items():
+for tag, value in list(settings.items()):
if re.match(r'^[a-z]+_version$', tag):
value = Version(value)
if tag != 'core_version':
if value.major != top_version.major:
errors += 1
- print('major version mismatch on %s: %d vs %d' %
- (tag, value.major, top_version.major))
+ print(('major version mismatch on %s: %d vs %d' %
+ (tag, value.major, top_version.major)))
if value.minor != top_version.minor:
errors += 1
- print('minor version mismatch on %s: %d vs %d' %
- (tag, value.minor, top_version.minor))
+ print(('minor version mismatch on %s: %d vs %d' %
+ (tag, value.minor, top_version.minor)))
if not check_version(value):
errors += 1
- print(warning % (tag, value))
+ print((warning % (tag, value)))
sys.exit(errors)
diff --git a/grpc/tools/run_tests/sanity/core_banned_functions.py b/grpc/tools/run_tests/sanity/core_banned_functions.py
index aa18806e..cd18fe48 100755
--- a/grpc/tools/run_tests/sanity/core_banned_functions.py
+++ b/grpc/tools/run_tests/sanity/core_banned_functions.py
@@ -25,16 +25,16 @@ os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
# map of banned function signature to allowlist
BANNED_EXCEPT = {
'grpc_slice_from_static_buffer(': ['src/core/lib/slice/slice.cc'],
- 'grpc_resource_quota_ref(': ['src/core/lib/iomgr/resource_quota.cc'],
+ 'grpc_resource_quota_ref(': ['src/core/lib/resource_quota/api.cc'],
'grpc_resource_quota_unref(': [
- 'src/core/lib/iomgr/resource_quota.cc', 'src/core/lib/surface/server.cc'
+ 'src/core/lib/resource_quota/api.cc', 'src/core/lib/surface/server.cc'
],
'grpc_slice_buffer_destroy(': ['src/core/lib/slice/slice_buffer.cc'],
'grpc_slice_buffer_reset_and_unref(': [
'src/core/lib/slice/slice_buffer.cc'
],
- 'grpc_slice_ref(': ['src/core/lib/slice/slice.cc'],
- 'grpc_slice_unref(': ['src/core/lib/slice/slice.cc'],
+ 'grpc_slice_ref(': ['src/core/lib/slice/slice_api.cc'],
+ 'grpc_slice_unref(': ['src/core/lib/slice/slice_api.cc'],
'grpc_error_create(': [
'src/core/lib/iomgr/error.cc', 'src/core/lib/iomgr/error_cfstream.cc'
],
@@ -50,6 +50,14 @@ BANNED_EXCEPT = {
'grpc_closure_sched(': ['src/core/lib/iomgr/closure.cc'],
'grpc_closure_run(': ['src/core/lib/iomgr/closure.cc'],
'grpc_closure_list_sched(': ['src/core/lib/iomgr/closure.cc'],
+ 'grpc_error*': ['src/core/lib/iomgr/error.cc'],
+ 'grpc_error_string': ['src/core/lib/iomgr/error.cc'],
+ # std::random_device needs /dev/random which is not available on all linuxes that we support.
+ # Any usage must be optional and opt-in, so that those platforms can use gRPC without problem.
+ 'std::random_device': [
+ 'src/core/ext/filters/client_channel/lb_policy/rls/rls.cc',
+ 'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
+ ]
}
errors = 0
@@ -64,11 +72,11 @@ for root, dirs, files in os.walk('src/core'):
continue
with open(path) as f:
text = f.read()
- for banned, exceptions in BANNED_EXCEPT.items():
+ for banned, exceptions in list(BANNED_EXCEPT.items()):
if path in exceptions:
continue
if banned in text:
- print('Illegal use of "%s" in %s' % (banned, path))
+ print(('Illegal use of "%s" in %s' % (banned, path)))
errors += 1
assert errors == 0
diff --git a/grpc/tools/run_tests/sanity/sanity_tests.yaml b/grpc/tools/run_tests/sanity/sanity_tests.yaml
index f6954c42..7f2bd01e 100644
--- a/grpc/tools/run_tests/sanity/sanity_tests.yaml
+++ b/grpc/tools/run_tests/sanity/sanity_tests.yaml
@@ -4,9 +4,11 @@
- script: tools/run_tests/sanity/check_buildifier.sh
- script: tools/run_tests/sanity/check_cache_mk.sh
- script: tools/run_tests/sanity/check_deprecated_grpc++.py
+- script: tools/run_tests/sanity/check_do_not_submit.sh
- script: tools/run_tests/sanity/check_illegal_terms.sh
- script: tools/run_tests/sanity/check_owners.sh
- script: tools/run_tests/sanity/check_port_platform.py
+- script: tools/run_tests/sanity/check_include_style.py
- script: tools/run_tests/sanity/check_qps_scenario_changes.py
- script: tools/run_tests/sanity/check_shellcheck.sh
- script: tools/run_tests/sanity/check_submodules.sh
@@ -16,13 +18,16 @@
- script: tools/run_tests/sanity/core_banned_functions.py
- script: tools/run_tests/sanity/core_untyped_structs.sh
- script: tools/run_tests/sanity/cpp_banned_constructs.sh
+- script: tools/run_tests/sanity/check_package_name.py
- script: tools/buildgen/generate_projects.sh -j 3
cpu_cost: 3
- script: tools/distrib/check_copyright.py
- script: tools/distrib/check_include_guards.py
+- script: tools/distrib/check_naked_includes.py
- script: tools/distrib/check_trailing_newlines.sh
- script: tools/distrib/check_upb_output.sh
- script: tools/distrib/check_pytype.sh
+- script: tools/codegen/core/gen_grpc_tls_credentials_options.py --test
- script: tools/distrib/clang_format_code.sh
- script: tools/distrib/clang_tidy_code.sh
# ClangTidy needs to run exclusively because it uses files under the bazel output
@@ -32,5 +37,10 @@
- script: tools/distrib/python/check_grpcio_tools.py
- script: tools/distrib/yapf_code.sh --diff
cpu_cost: 1000
+- script: tools/distrib/isort_code.sh --diff
+ cpu_cost: 1000
- script: tools/distrib/check_protobuf_pod_version.sh
- script: tools/distrib/check_boringssl_prefix_symbol.sh
+- script: tools/run_tests/sanity/build_banned_constructs.sh
+- script: tools/distrib/check_redundant_namespace_qualifiers.py
+- script: tools/distrib/check_namespace_qualification.py
diff --git a/grpc/tools/run_tests/task_runner.py b/grpc/tools/run_tests/task_runner.py
index d54a5c5e..6b227e21 100755
--- a/grpc/tools/run_tests/task_runner.py
+++ b/grpc/tools/run_tests/task_runner.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,7 +35,7 @@ _TARGETS += package_targets.targets()
def _create_build_map():
"""Maps task names and labels to list of tasks to be built."""
target_build_map = dict([(target.name, [target]) for target in _TARGETS])
- if len(_TARGETS) > len(target_build_map.keys()):
+ if len(_TARGETS) > len(list(target_build_map.keys())):
raise Exception('Target names need to be unique')
label_build_map = {}
@@ -47,7 +47,7 @@ def _create_build_map():
else:
label_build_map[label] = [target]
- if set(target_build_map.keys()).intersection(label_build_map.keys()):
+ if set(target_build_map.keys()).intersection(list(label_build_map.keys())):
raise Exception('Target names need to be distinct from label names')
return dict(list(target_build_map.items()) + list(label_build_map.items()))
@@ -68,16 +68,23 @@ argp.add_argument('-f',
default=[],
help='Filter targets to build with AND semantics.')
argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int)
-argp.add_argument('-t',
- '--travis',
- default=False,
- action='store_const',
- const=True)
argp.add_argument('-x',
'--xml_report',
default='report_taskrunner_sponge_log.xml',
type=str,
help='Filename for the JUnit-compatible XML report')
+argp.add_argument('--dry_run',
+ default=False,
+ action='store_const',
+ const=True,
+ help='Only print what would be run.')
+argp.add_argument(
+ '--inner_jobs',
+ default=None,
+ type=int,
+ help=
+ 'Number of parallel jobs to use by each target. Passed as build_jobspec(inner_jobs=N) to each target.'
+)
args = argp.parse_args()
@@ -88,7 +95,15 @@ for label in args.build:
# Among targets selected by -b, filter out those that don't match the filter
targets = [t for t in targets if all(f in t.labels for f in args.filter)]
-targets = sorted(set(targets), key=lambda target: target.name)
+
+print('Will build %d targets:' % len(targets))
+for target in targets:
+ print(' %s, labels %s' % (target.name, target.labels))
+print()
+
+if args.dry_run:
+ print('--dry_run was used, exiting')
+ sys.exit(1)
# Execute pre-build phase
prebuild_jobs = []
@@ -104,7 +119,7 @@ if prebuild_jobs:
build_jobs = []
for target in targets:
- build_jobs.append(target.build_jobspec())
+ build_jobs.append(target.build_jobspec(inner_jobs=args.inner_jobs))
if not build_jobs:
print('Nothing to build.')
sys.exit(1)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/README.md b/grpc/tools/run_tests/xds_k8s_test_driver/README.md
index ebacd4b3..2cd0238d 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/README.md
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/README.md
@@ -8,47 +8,160 @@ changes to this codebase at the moment.
### Stabilization roadmap
- [ ] Replace retrying with tenacity
-- [ ] Generate namespace for each test to prevent resource name conflicts and
+- [x] Generate namespace for each test to prevent resource name conflicts and
allow running tests in parallel
-- [ ] Security: run server and client in separate namespaces
+- [x] Security: run server and client in separate namespaces
- [ ] Make framework.infrastructure.gcp resources [first-class
citizen](https://en.wikipedia.org/wiki/First-class_citizen), support
simpler CRUD
-- [ ] Security: manage `roles/iam.workloadIdentityUser` role grant lifecycle for
+- [x] Security: manage `roles/iam.workloadIdentityUser` role grant lifecycle for
dynamically-named namespaces
- [ ] Restructure `framework.test_app` and `framework.xds_k8s*` into a module
containing xDS-interop-specific logic
- [ ] Address inline TODOs in code
-- [ ] Improve README.md documentation, explain helpers in bin/ folder
+- [x] Improve README.md documentation, explain helpers in bin/ folder
## Installation
#### Requirements
1. Python v3.6+
2. [Google Cloud SDK](https://cloud.google.com/sdk/docs/install)
-3. A GKE cluster (must enable "Enable VPC-native traffic routing" to use it with
- the Traffic Director)
- * Otherwise, you will see error logs when you inspect Kubernetes virtual
- service
- * (In `grpc-testing`, you will need a metadata tag
- `--tags=allow-health-checks` to allow UHC to reach your resources.)
+3. `kubectl`
-#### Configure GKE cluster access
+`kubectl` can be installed via `gcloud components install kubectl`, or system package manager: https://kubernetes.io/docs/tasks/tools/#kubectl
-```sh
-# Update gloud sdk
+#### Configure GKE cluster
+This is an example outlining minimal requirements to run `tests.baseline_test`.
+For more details, and for the setup for security tests, see
+["Setting up Traffic Director service security with proxyless gRPC"](https://cloud.google.com/traffic-director/docs/security-proxyless-setup)
+ user guide.
+
+Update gloud sdk:
+```shell
gcloud -q components update
+```
+
+Pre-populate environment variables for convenience. To find project id, refer to
+[Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects).
+```shell
+export PROJECT_ID="your-project-id"
+export PROJECT_NUMBER=$(gcloud projects describe "${PROJECT_ID}" --format="value(projectNumber)")
+# Compute Engine default service account
+export GCE_SA="${PROJECT_NUMBER}-compute@developer.gserviceaccount.com"
+# The prefix to name GCP resources used by the framework
+export RESOURCE_PREFIX="xds-k8s-interop-tests"
+
+# The zone name your cluster, f.e. xds-k8s-test-cluster
+export CLUSTER_NAME="${RESOURCE_PREFIX}-cluster"
+# The zone of your cluster, f.e. us-central1-a
+export ZONE="us-central1-a"
+# Dedicated GCP Service Account to use with workload identity.
+export WORKLOAD_SA_NAME="${RESOURCE_PREFIX}"
+export WORKLOAD_SA_EMAIL="${WORKLOAD_SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com"
+```
+
+##### Create the cluster
+Minimal requirements: [VPC-native](https://cloud.google.com/traffic-director/docs/security-proxyless-setup)
+cluster with [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) enabled.
+```shell
+gcloud container clusters create "${CLUSTER_NAME}" \
+ --scopes=cloud-platform \
+ --zone="${ZONE}" \
+ --enable-ip-alias \
+ --workload-pool="${PROJECT_ID}.svc.id.goog" \
+ --enable-mesh-certificates \
+ --workload-metadata=GKE_METADATA \
+ --tags=allow-health-checks
+```
+
+For security tests you also need to create CAs and configure the cluster to use those CAs
+as described
+[here](https://cloud.google.com/traffic-director/docs/security-proxyless-setup#configure-cas).
+
+##### Create the firewall rule
+Allow [health checking mechanisms](https://cloud.google.com/traffic-director/docs/set-up-proxyless-gke#creating_the_health_check_firewall_rule_and_backend_service)
+to query the workloads health.
+This step can be skipped, if the driver is executed with `--ensure_firewall`.
+```shell
+gcloud compute firewall-rules create "${RESOURCE_PREFIX}-allow-health-checks" \
+ --network=default --action=allow --direction=INGRESS \
+ --source-ranges="35.191.0.0/16,130.211.0.0/22" \
+ --target-tags=allow-health-checks \
+ --rules=tcp:8080-8100
+```
+
+##### Setup GCP Service Account
+
+Create dedicated GCP Service Account to use
+with [workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity).
+
+```shell
+gcloud iam service-accounts create "${WORKLOAD_SA_NAME}" \
+ --display-name="xDS K8S Interop Tests Workload Identity Service Account"
+```
+
+Enable the service account to [access the Traffic Director API](https://cloud.google.com/traffic-director/docs/prepare-for-envoy-setup#enable-service-account).
+```shell
+gcloud projects add-iam-policy-binding "${PROJECT_ID}" \
+ --member="serviceAccount:${WORKLOAD_SA_EMAIL}" \
+ --role="roles/trafficdirector.client"
+```
+
+##### Allow access to images
+The test framework needs read access to the client and server images and the bootstrap
+generator image. You may have these images in your project but if you want to use these
+from the grpc-testing project you will have to grant the necessary access to these images
+using https://cloud.google.com/container-registry/docs/access-control#grant or a
+gsutil command. For example, to grant access to images stored in `grpc-testing` project GCR, run:
+
+```sh
+gsutil iam ch "serviceAccount:${GCE_SA}:objectViewer" gs://artifacts.grpc-testing.appspot.com/
+```
+
+##### Allow test driver to configure workload identity automatically
+Test driver will automatically grant `roles/iam.workloadIdentityUser` to
+allow the Kubernetes service account to impersonate the dedicated GCP workload
+service account (corresponds to the step 5
+of [Authenticating to Google Cloud](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#authenticating_to)).
+This action requires the test framework to have `iam.serviceAccounts.create`
+permission on the project.
+
+If you're running test framework locally, and you have `roles/owner` to your
+project, **you can skip this step**.
+If you're configuring the test framework to run on a CI: use `roles/owner`
+account once to allow test framework to grant `roles/iam.workloadIdentityUser`.
+
+```shell
+# Assuming CI is using Compute Engine default service account.
+gcloud projects add-iam-policy-binding "${PROJECT_ID}" \
+ --member="serviceAccount:${GCE_SA}" \
+ --role="roles/iam.serviceAccountAdmin" \
+ --condition-from-file=<(cat <<-END
+---
+title: allow_workload_identity_only
+description: Restrict serviceAccountAdmin to granting role iam.workloadIdentityUser
+expression: |-
+ api.getAttribute('iam.googleapis.com/modifiedGrantsByRole', [])
+ .hasOnly(['roles/iam.workloadIdentityUser'])
+END
+)
+```
+
+##### Configure GKE cluster access
+```shell
+# Unless you're using GCP VM with preconfigured Application Default Credentials, acquire them for your user
+gcloud auth application-default login
# Configuring GKE cluster access for kubectl
gcloud container clusters get-credentials "your_gke_cluster_name" --zone "your_gke_cluster_zone"
# Save generated kube context name
-KUBE_CONTEXT="$(kubectl config current-context)"
+export KUBE_CONTEXT="$(kubectl config current-context)"
```
#### Install python dependencies
-```sh
+```shell
# Create python virtual environment
python3.6 -m venv venv
@@ -80,10 +193,10 @@ every single one of them. It is triggered nightly and per-release. For example,
the commit we are using below (`d22f93e1ade22a1e026b57210f6fc21f7a3ca0cf`) comes
from branch `v1.37.x` in `grpc-java` repo.
-```sh
+```shell
# Help
python -m tests.baseline_test --help
-python -m tests.baseline_test --helpful
+python -m tests.baseline_test --helpfull
# Run on grpc-testing cluster
python -m tests.baseline_test \
@@ -94,10 +207,10 @@ python -m tests.baseline_test \
```
### xDS Security Tests
-```sh
+```shell
# Help
python -m tests.security_test --help
-python -m tests.security_test --helpful
+python -m tests.security_test --helpfull
# Run on grpc-testing cluster
python -m tests.security_test \
@@ -107,40 +220,197 @@ python -m tests.security_test \
--client_image="gcr.io/grpc-testing/xds-interop/java-client:d22f93e1ade22a1e026b57210f6fc21f7a3ca0cf"
```
-### Test namespace
+## Local development
+This test driver allows running tests locally against remote GKE clusters, right
+from your dev environment. You need:
-It's possible to run multiple xDS interop test workloads in the same project.
-But we need to ensure the name of the global resources won't conflict. This can
-be solved by supplying `--namespace` and `--server_xds_port`. The xDS port needs
-to be unique across the entire project (default port range is [8080, 8280],
-avoid if possible). Here is an example:
+1. Follow [installation](#installation) instructions
+2. Authenticated `gcloud`
+3. `kubectl` context (see [Configure GKE cluster access](#configure-gke-cluster-access))
+4. Run tests with `--debug_use_port_forwarding` argument. The test driver
+ will automatically start and stop port forwarding using
+ `kubectl` subprocesses. (experimental)
-```shell
-python3 -m tests.baseline_test \
- --flagfile="config/grpc-testing.cfg" \
- --kube_context="${KUBE_CONTEXT}" \
- --server_image="gcr.io/grpc-testing/xds-interop/java-server:d22f93e1ade22a1e026b57210f6fc21f7a3ca0cf" \
- --client_image="gcr.io/grpc-testing/xds-interop/java-client:d22f93e1ade22a1e026b57210f6fc21f7a3ca0cf" \
- --namespace="box-$(date +"%F-%R")" \
- --server_xds_port="$(($RANDOM%1000 + 34567))"
-```
+### Making changes to the driver
+1. Install additional dev packages: `pip install -r requirements-dev.txt`
+2. Use `./bin/yapf.sh` and `./bin/isort.sh` helpers to auto-format code.
### Setup test configuration
There are many arguments to be passed into the test run. You can save the
-arguments to a config file for your development environment. Please take a look
-at
-https://github.com/grpc/grpc/blob/master/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example.
-You can create your own config by:
+arguments to a config file ("flagfile") for your development environment.
+Use [`config/local-dev.cfg.example`](https://github.com/grpc/grpc/blob/master/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example)
+as a starting point:
```shell
cp config/local-dev.cfg.example config/local-dev.cfg
```
-### Clean-up resources
+Learn more about flagfiles in [abseil documentation](https://abseil.io/docs/python/guides/flags#a-note-about---flagfile).
+
+### Helper scripts
+You can use interop xds-k8s [`bin/`](https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver/bin)
+scripts to configure TD, start k8s instances step-by-step, and keep them alive
+for as long as you need.
+
+* To run helper scripts using local config:
+ * `python -m bin.script_name --flagfile=config/local-dev.cfg`
+ * `./run.sh bin/script_name.py` automatically appends the flagfile
+* Use `--help` to see script-specific argument
+* Use `--helpfull` to see all available argument
+
+#### Overview
+```shell
+# Helper tool to configure Traffic Director with different security options
+python -m bin.run_td_setup --help
+
+# Helper tools to run the test server, client (with or without security)
+python -m bin.run_test_server --help
+python -m bin.run_test_client --help
+
+# Helper tool to verify different security configurations via channelz
+python -m bin.run_channelz --help
+```
+
+#### `./run.sh` helper
+Use `./run.sh` to execute helper scripts and tests with `config/local-dev.cfg`.
+
+```sh
+USAGE: ./run.sh script_path [arguments]
+ script_path: path to python script to execute, relative to driver root folder
+ arguments ...: arguments passed to program in sys.argv
+
+ENVIRONMENT:
+ XDS_K8S_CONFIG: file path to the config flagfile, relative to
+ driver root folder. Default: config/local-dev.cfg
+ Will be appended as --flagfile="config_absolute_path" argument
+ XDS_K8S_DRIVER_VENV_DIR: the path to python virtual environment directory
+ Default: $XDS_K8S_DRIVER_DIR/venv
+DESCRIPTION:
+This tool performs the following:
+1) Ensures python virtual env installed and activated
+2) Exports test driver root in PYTHONPATH
+3) Automatically appends --flagfile="\$XDS_K8S_CONFIG" argument
+
+EXAMPLES:
+./run.sh bin/run_td_setup.py --help
+./run.sh bin/run_td_setup.py --helpfull
+XDS_K8S_CONFIG=./path-to-flagfile.cfg ./run.sh bin/run_td_setup.py --resource_suffix=override-suffix
+./run.sh tests/baseline_test.py
+./run.sh tests/security_test.py --verbosity=1 --logger_levels=__main__:DEBUG,framework:DEBUG
+./run.sh tests/security_test.py SecurityTest.test_mtls --nocheck_local_certs
+```
+
+### Regular workflow
+```shell
+# Setup Traffic Director
+./run.sh bin/run_td_setup.py
+
+# Start test server
+./run.sh bin/run_test_server.py
+
+# Add test server to the backend service
+./run.sh bin/run_td_setup.py --cmd=backends-add
+
+# Start test client
+./run.sh bin/run_test_client.py
+```
+
+### Secure workflow
+```shell
+# Setup Traffic Director in mtls. See --help for all options
+./run.sh bin/run_td_setup.py --security=mtls
+
+# Start test server in a secure mode
+./run.sh bin/run_test_server.py --secure
+
+# Add test server to the backend service
+./run.sh bin/run_td_setup.py --cmd=backends-add
+
+# Start test client in a secure more --secure
+./run.sh bin/run_test_client.py --secure
+```
+
+### Sending RPCs
+#### Start port forwarding
+```shell
+# Client: all services always on port 8079
+kubectl port-forward deployment.apps/psm-grpc-client 8079
+
+# Server regular mode: all grpc services on port 8080
+kubectl port-forward deployment.apps/psm-grpc-server 8080
+# OR
+# Server secure mode: TestServiceImpl is on 8080,
+kubectl port-forward deployment.apps/psm-grpc-server 8080
+# everything else (channelz, healthcheck, CSDS) on 8081
+kubectl port-forward deployment.apps/psm-grpc-server 8081
+```
+
+#### Send RPCs with grpccurl
+```shell
+# 8081 if security enabled
+export SERVER_ADMIN_PORT=8080
+
+# List server services using reflection
+grpcurl --plaintext 127.0.0.1:$SERVER_ADMIN_PORT list
+# List client services using reflection
+grpcurl --plaintext 127.0.0.1:8079 list
+
+# List channels via channelz
+grpcurl --plaintext 127.0.0.1:$SERVER_ADMIN_PORT grpc.channelz.v1.Channelz.GetTopChannels
+grpcurl --plaintext 127.0.0.1:8079 grpc.channelz.v1.Channelz.GetTopChannels
+
+# Send GetClientStats to the client
+grpcurl --plaintext -d '{"num_rpcs": 10, "timeout_sec": 30}' 127.0.0.1:8079 \
+ grpc.testing.LoadBalancerStatsService.GetClientStats
+```
+
+### Cleanup
+* First, make sure to stop port forwarding, if any
+* Run `./bin/cleanup.sh`
+
+##### Partial cleanup
+You can run commands below to stop/start, create/delete resources however you want.
+Generally, it's better to remove resources in the opposite order of their creation.
+Cleanup regular resources:
```shell
-python -m bin.run_td_setup --cmd=cleanup --flagfile=config/local-dev.cfg && \
-python -m bin.run_test_client --cmd=cleanup --flagfile=config/local-dev.cfg && \
-python -m bin.run_test_server --cmd=cleanup --cleanup_namespace --flagfile=config/local-dev.cfg
+# Cleanup TD resources
+./run.sh bin/run_td_setup.py --cmd=cleanup
+# Stop test client
+./run.sh bin/run_test_client.py --cmd=cleanup
+# Stop test server, and remove the namespace
+./run.sh bin/run_test_server.py --cmd=cleanup --cleanup_namespace
```
+
+Cleanup regular and security-specific resources:
+```shell
+# Cleanup TD resources, with security
+./run.sh bin/run_td_setup.py --cmd=cleanup --security=mtls
+# Stop test client (secure)
+./run.sh bin/run_test_client.py --cmd=cleanup --secure
+# Stop test server (secure), and remove the namespace
+./run.sh bin/run_test_server.py --cmd=cleanup --cleanup_namespace --secure
+```
+
+In addition, here's some other helpful partial cleanup commands:
+```shell
+# Remove all backends from the backend services
+./run.sh bin/run_td_setup.py --cmd=backends-cleanup
+
+# Stop the server, but keep the namespace
+./run.sh bin/run_test_server.py --cmd=cleanup --nocleanup_namespace
+```
+
+### Known errors
+#### Error forwarding port
+If you stopped a test with `ctrl+c`, while using `--debug_use_port_forwarding`,
+you might see an error like this:
+
+> `framework.infrastructure.k8s.PortForwardingError: Error forwarding port, unexpected output Unable to listen on port 8081: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:8081: bind: address already in use]`
+
+Unless you're running `kubectl port-forward` manually, it's likely that `ctrl+c`
+interrupted python before it could clean up subprocesses.
+
+You can do `ps aux | grep port-forward` and then kill the processes by id,
+or with `killall kubectl`
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup.sh b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup.sh
new file mode 100755
index 00000000..3b4bf270
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+display_usage() {
+ cat <<EOF >/dev/stderr
+Performs full TD and K8S resource cleanup
+
+USAGE: $0 [--nosecure] [arguments]
+ --nosecure: Skip cleanup for the resources specific for PSM Security
+ arguments ...: additional arguments passed to ./run.sh
+
+ENVIRONMENT:
+ XDS_K8S_CONFIG: file path to the config flagfile, relative to
+ driver root folder. Default: config/local-dev.cfg
+ Will be appended as --flagfile="config_absolute_path" argument
+ XDS_K8S_DRIVER_VENV_DIR: the path to python virtual environment directory
+ Default: $XDS_K8S_DRIVER_DIR/venv
+EXAMPLES:
+$0
+$0 --secure
+XDS_K8S_CONFIG=./path-to-flagfile.cfg $0 --resource_suffix=override-suffix
+EOF
+ exit 1
+}
+
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_usage
+fi
+
+SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+readonly SCRIPT_DIR
+readonly XDS_K8S_DRIVER_DIR="${SCRIPT_DIR}/.."
+
+cd "${XDS_K8S_DRIVER_DIR}"
+
+if [[ "$1" == "--nosecure" ]]; then
+ shift
+ ./run.sh bin/run_td_setup.py --cmd=cleanup "$@" && \
+ ./run.sh bin/run_test_client.py --cmd=cleanup --cleanup_namespace "$@" && \
+ ./run.sh bin/run_test_server.py --cmd=cleanup --cleanup_namespace "$@"
+else
+ ./run.sh bin/run_td_setup.py --cmd=cleanup --security=mtls "$@" && \
+ ./run.sh bin/run_test_client.py --cmd=cleanup --cleanup_namespace --secure "$@" && \
+ ./run.sh bin/run_test_server.py --cmd=cleanup --cleanup_namespace --secure "$@"
+fi
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/README.md b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/README.md
new file mode 100644
index 00000000..d6f636f3
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/README.md
@@ -0,0 +1,2 @@
+# This folder contains scripts to delete leaked resources from test runs
+
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/cleanup.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/cleanup.py
new file mode 100755
index 00000000..c26c8147
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/cleanup.py
@@ -0,0 +1,390 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Clean up resources created by the tests.
+
+This is intended as a tool to delete leaked resources from old tests.
+
+Typical usage examples:
+
+python3 tools/run_tests/xds_k8s_test_driver/bin/cleanup/cleanup.py\
+ --project=grpc-testing\
+ --network=default-vpc\
+ --kube_context=gke_grpc-testing_us-central1-a_interop-test-psm-sec-v2-us-central1-a\
+ --resource_prefix='required-but-does-not-matter'\
+ --td_bootstrap_image='required-but-does-not-matter' --server_image='required-but-does-not-matter' --client_image='required-but-does-not-matter'
+"""
+import datetime
+import functools
+import json
+import logging
+import os
+import re
+import subprocess
+from typing import Any, List
+
+from absl import app
+from absl import flags
+import dateutil
+
+from framework import xds_flags
+from framework import xds_k8s_flags
+from framework.infrastructure import gcp
+from framework.infrastructure import k8s
+from framework.infrastructure import traffic_director
+from framework.test_app import client_app
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+Json = Any
+KubernetesClientRunner = client_app.KubernetesClientRunner
+KubernetesServerRunner = server_app.KubernetesServerRunner
+
+GCLOUD = os.environ.get('GCLOUD', 'gcloud')
+GCLOUD_CMD_TIMEOUT_S = datetime.timedelta(seconds=5).total_seconds()
+ZONE = 'us-central1-a'
+SECONDARY_ZONE = 'us-west1-b'
+
+PSM_SECURITY_PREFIX = 'xds-k8s-security' # Prefix for gke resources to delete.
+URL_MAP_TEST_PREFIX = 'interop-psm-url-map' # Prefix for url-map test resources to delete.
+
+KEEP_PERIOD_HOURS = flags.DEFINE_integer(
+ "keep_hours",
+ default=168,
+ help=
+ "number of hours for a resource to keep. Resources older than this will be deleted. Default is 168 (7 days)"
+)
+DRY_RUN = flags.DEFINE_bool(
+ "dry_run",
+ default=False,
+ help="dry run, print resources but do not perform deletion")
+TD_RESOURCE_PREFIXES = flags.DEFINE_list(
+ "td_resource_prefixes",
+ default=[PSM_SECURITY_PREFIX],
+ help=
+ "a comma-separated list of prefixes for which the leaked TD resources will be deleted",
+)
+SERVER_PREFIXES = flags.DEFINE_list(
+ "server_prefixes",
+ default=[PSM_SECURITY_PREFIX],
+ help=
+ "a comma-separated list of prefixes for which the leaked servers will be deleted",
+)
+CLIENT_PREFIXES = flags.DEFINE_list(
+ "client_prefixes",
+ default=[PSM_SECURITY_PREFIX, URL_MAP_TEST_PREFIX],
+ help=
+ "a comma-separated list of prefixes for which the leaked clients will be deleted",
+)
+
+
+def load_keep_config() -> None:
+ global KEEP_CONFIG
+ json_path = os.path.realpath(
+ os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ 'keep_xds_interop_resources.json'))
+ with open(json_path, 'r') as f:
+ KEEP_CONFIG = json.load(f)
+ logging.debug('Resource keep config loaded: %s',
+ json.dumps(KEEP_CONFIG, indent=2))
+
+
+def is_marked_as_keep_gce(suffix: str) -> bool:
+ return suffix in KEEP_CONFIG["gce_framework"]["suffix"]
+
+
+def is_marked_as_keep_gke(suffix: str) -> bool:
+ return suffix in KEEP_CONFIG["gke_framework"]["suffix"]
+
+
+@functools.lru_cache()
+def get_expire_timestamp() -> datetime.datetime:
+ return datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(
+ hours=KEEP_PERIOD_HOURS.value)
+
+
+def exec_gcloud(project: str, *cmds: List[str]) -> Json:
+ cmds = [GCLOUD, '--project', project, '--quiet'] + list(cmds)
+ if 'list' in cmds:
+ # Add arguments to shape the list output
+ cmds.extend([
+ '--format', 'json', '--filter',
+ f'creationTimestamp <= {get_expire_timestamp().isoformat()}'
+ ])
+ # Executing the gcloud command
+ logging.debug('Executing: %s', " ".join(cmds))
+ proc = subprocess.Popen(cmds,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ # NOTE(lidiz) the gcloud subprocess won't return unless its output is read
+ stdout = proc.stdout.read()
+ stderr = proc.stderr.read()
+ try:
+ returncode = proc.wait(timeout=GCLOUD_CMD_TIMEOUT_S)
+ except subprocess.TimeoutExpired:
+ logging.error('> Timeout executing cmd [%s]', " ".join(cmds))
+ return None
+ if returncode:
+ logging.error('> Failed to execute cmd [%s], returned %d, stderr: %s',
+ " ".join(cmds), returncode, stderr)
+ return None
+ if stdout:
+ return json.loads(stdout)
+ return None
+
+
+def remove_relative_resources_run_xds_tests(project: str, network: str,
+ prefix: str, suffix: str):
+ """Removing GCP resources created by run_xds_tests.py."""
+ logging.info('----- Removing run_xds_tests.py resources with suffix [%s]',
+ suffix)
+ exec_gcloud(project, 'compute', 'forwarding-rules', 'delete',
+ f'test-forwarding-rule{suffix}', '--global')
+ exec_gcloud(project, 'compute', 'target-http-proxies', 'delete',
+ f'test-target-proxy{suffix}')
+ exec_gcloud(project, 'alpha', 'compute', 'target-grpc-proxies', 'delete',
+ f'test-target-proxy{suffix}')
+ exec_gcloud(project, 'compute', 'url-maps', 'delete', f'test-map{suffix}')
+ exec_gcloud(project, 'compute', 'backend-services', 'delete',
+ f'test-backend-service{suffix}', '--global')
+ exec_gcloud(project, 'compute', 'backend-services', 'delete',
+ f'test-backend-service-alternate{suffix}', '--global')
+ exec_gcloud(project, 'compute', 'backend-services', 'delete',
+ f'test-backend-service-extra{suffix}', '--global')
+ exec_gcloud(project, 'compute', 'backend-services', 'delete',
+ f'test-backend-service-more-extra{suffix}', '--global')
+ exec_gcloud(project, 'compute', 'firewall-rules', 'delete',
+ f'test-fw-rule{suffix}')
+ exec_gcloud(project, 'compute', 'health-checks', 'delete',
+ f'test-hc{suffix}')
+ exec_gcloud(project, 'compute', 'instance-groups', 'managed', 'delete',
+ f'test-ig{suffix}', '--zone', ZONE)
+ exec_gcloud(project, 'compute', 'instance-groups', 'managed', 'delete',
+ f'test-ig-same-zone{suffix}', '--zone', ZONE)
+ exec_gcloud(project, 'compute', 'instance-groups', 'managed', 'delete',
+ f'test-ig-secondary-zone{suffix}', '--zone', SECONDARY_ZONE)
+ exec_gcloud(project, 'compute', 'instance-templates', 'delete',
+ f'test-template{suffix}')
+
+
+# cleanup_td creates TrafficDirectorManager (and its varients for security and
+# AppNet), and then calls the cleanup() methods.
+#
+# Note that the varients are all based on the basic TrafficDirectorManager, so
+# their `cleanup()` might do duplicate work. But deleting an non-exist resource
+# returns 404, and is OK.
+def cleanup_td_for_gke(project, network, resource_prefix, resource_suffix):
+ gcp_api_manager = gcp.api.GcpApiManager()
+ plain_td = traffic_director.TrafficDirectorManager(
+ gcp_api_manager,
+ project=project,
+ network=network,
+ resource_prefix=resource_prefix,
+ resource_suffix=resource_suffix)
+ security_td = traffic_director.TrafficDirectorSecureManager(
+ gcp_api_manager,
+ project=project,
+ network=network,
+ resource_prefix=resource_prefix,
+ resource_suffix=resource_suffix)
+ # TODO: cleanup appnet resources.
+ # appnet_td = traffic_director.TrafficDirectorAppNetManager(
+ # gcp_api_manager,
+ # project=project,
+ # network=network,
+ # resource_prefix=resource_prefix,
+ # resource_suffix=resource_suffix)
+
+ logger.info('----- Removing traffic director for gke, prefix %s, suffix %s',
+ resource_prefix, resource_suffix)
+ security_td.cleanup(force=True)
+ # appnet_td.cleanup(force=True)
+ plain_td.cleanup(force=True)
+
+
+# cleanup_client creates a client runner, and calls its cleanup() method.
+def cleanup_client(project, network, k8s_api_manager, resource_prefix,
+ resource_suffix, gcp_service_account):
+ runner_kwargs = dict(
+ deployment_name=xds_flags.CLIENT_NAME.value,
+ image_name=xds_k8s_flags.CLIENT_IMAGE.value,
+ td_bootstrap_image=xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value,
+ gcp_project=project,
+ gcp_api_manager=gcp.api.GcpApiManager(),
+ gcp_service_account=gcp_service_account,
+ xds_server_uri=xds_flags.XDS_SERVER_URI.value,
+ network=network,
+ stats_port=xds_flags.CLIENT_PORT.value)
+
+ client_namespace = KubernetesClientRunner.make_namespace_name(
+ resource_prefix, resource_suffix)
+ client_runner = KubernetesClientRunner(
+ k8s.KubernetesNamespace(k8s_api_manager, client_namespace),
+ **runner_kwargs)
+
+ logger.info('Cleanup client')
+ client_runner.cleanup(force=True, force_namespace=True)
+
+
+# cleanup_server creates a server runner, and calls its cleanup() method.
+def cleanup_server(project, network, k8s_api_manager, resource_prefix,
+ resource_suffix, gcp_service_account):
+ runner_kwargs = dict(
+ deployment_name=xds_flags.SERVER_NAME.value,
+ image_name=xds_k8s_flags.SERVER_IMAGE.value,
+ td_bootstrap_image=xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value,
+ gcp_project=project,
+ gcp_api_manager=gcp.api.GcpApiManager(),
+ gcp_service_account=gcp_service_account,
+ network=network)
+
+ server_namespace = KubernetesServerRunner.make_namespace_name(
+ resource_prefix, resource_suffix)
+ server_runner = KubernetesServerRunner(
+ k8s.KubernetesNamespace(k8s_api_manager, server_namespace),
+ **runner_kwargs)
+
+ logger.info('Cleanup server')
+ server_runner.cleanup(force=True, force_namespace=True)
+
+
+def delete_leaked_td_resources(dry_run, td_resource_rules, project, network,
+ resources):
+ for resource in resources:
+ logger.info('-----')
+ logger.info('----- Cleaning up resource %s', resource['name'])
+ if dry_run:
+ # Skip deletion for dry-runs
+ logging.info('----- Skipped [Dry Run]: %s', resource['name'])
+ continue
+ matched = False
+ for (regex, resource_prefix, keep, remove) in td_resource_rules:
+ result = re.search(regex, resource['name'])
+ if result is not None:
+ matched = True
+ if keep(result.group(1)):
+ logging.info('Skipped [keep]:')
+ break # break inner loop, continue outer loop
+ remove(project, network, resource_prefix, result.group(1))
+ break
+ if not matched:
+ logging.info(
+ '----- Skipped [does not matching resource name templates]')
+
+
+def delete_k8s_resources(dry_run, k8s_resource_rules, project, network,
+ k8s_api_manager, gcp_service_account, namespaces):
+ for ns in namespaces:
+ logger.info('-----')
+ logger.info('----- Cleaning up k8s namespaces %s', ns.metadata.name)
+ if ns.metadata.creation_timestamp <= get_expire_timestamp():
+ if dry_run:
+ # Skip deletion for dry-runs
+ logging.info('----- Skipped [Dry Run]: %s', ns.metadata.name)
+ continue
+
+ matched = False
+ for (regex, resource_prefix, remove) in k8s_resource_rules:
+ result = re.search(regex, ns.metadata.name)
+ if result is not None:
+ matched = True
+ remove(project, network, k8s_api_manager, resource_prefix,
+ result.group(1), gcp_service_account)
+ break
+ if not matched:
+ logging.info(
+ '----- Skipped [does not matching resource name templates]')
+ else:
+ logging.info('----- Skipped [resource is within expiry date]')
+
+
+def find_and_remove_leaked_k8s_resources(dry_run, project, network,
+ gcp_service_account):
+ k8s_resource_rules = [
+ # items in each tuple, in order
+ # - regex to match
+ # - prefix of the resources
+ # - function to delete the resource
+ ]
+ for prefix in CLIENT_PREFIXES.value:
+ k8s_resource_rules.append(
+ (f'{prefix}-client-(.*)', prefix, cleanup_client),)
+ for prefix in SERVER_PREFIXES.value:
+ k8s_resource_rules.append(
+ (f'{prefix}-server-(.*)', prefix, cleanup_server),)
+
+ # Delete leaked k8s namespaces, those usually mean there are leaked testing
+ # client/servers from the gke framework.
+ k8s_api_manager = k8s.KubernetesApiManager(xds_k8s_flags.KUBE_CONTEXT.value)
+ nss = k8s_api_manager.core.list_namespace()
+ delete_k8s_resources(dry_run, k8s_resource_rules, project, network,
+ k8s_api_manager, gcp_service_account, nss.items)
+
+
+def main(argv):
+ if len(argv) > 1:
+ raise app.UsageError('Too many command-line arguments.')
+ load_keep_config()
+
+ project: str = xds_flags.PROJECT.value
+ network: str = xds_flags.NETWORK.value
+ gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value
+ dry_run: bool = DRY_RUN.value
+
+ td_resource_rules = [
+ # itmes in each tuple, in order
+ # - regex to match
+ # - prefix of the resource (only used by gke resources)
+ # - function to check of the resource should be kept
+ # - function to delete the resource
+ (r'test-hc(.*)', '', is_marked_as_keep_gce,
+ remove_relative_resources_run_xds_tests),
+ (r'test-template(.*)', '', is_marked_as_keep_gce,
+ remove_relative_resources_run_xds_tests),
+ ]
+ for prefix in TD_RESOURCE_PREFIXES.value:
+ td_resource_rules.append((f'{prefix}-health-check-(.*)', prefix,
+ is_marked_as_keep_gke, cleanup_td_for_gke),)
+
+ # List resources older than KEEP_PERIOD. We only list health-checks and
+ # instance templates because these are leaves in the resource dependency tree.
+ #
+ # E.g. forwarding-rule depends on the target-proxy. So leaked
+ # forwarding-rule indicates there's a leaked target-proxy (because this
+ # target proxy cannot deleted unless the forwarding rule is deleted). The
+ # leaked target-proxy is guaranteed to be a super set of leaked
+ # forwarding-rule.
+ compute = gcp.compute.ComputeV1(gcp.api.GcpApiManager(), project)
+ leakedHealthChecks = []
+ for item in compute.list_health_check()['items']:
+ if dateutil.parser.isoparse(
+ item['creationTimestamp']) <= get_expire_timestamp():
+ leakedHealthChecks.append(item)
+
+ delete_leaked_td_resources(dry_run, td_resource_rules, project, network,
+ leakedHealthChecks)
+
+ # Delete leaked instance templates, those usually mean there are leaked VMs
+ # from the gce framework. Also note that this is only needed for the gce
+ # resources.
+ leakedInstanceTemplates = exec_gcloud(project, 'compute',
+ 'instance-templates', 'list')
+ delete_leaked_td_resources(dry_run, td_resource_rules, project, network,
+ leakedInstanceTemplates)
+
+ find_and_remove_leaked_k8s_resources(dry_run, project, network,
+ gcp_service_account)
+
+
+if __name__ == '__main__':
+ app.run(main)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/keep_xds_interop_resources.json b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/keep_xds_interop_resources.json
new file mode 100644
index 00000000..b55a7699
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/keep_xds_interop_resources.json
@@ -0,0 +1,8 @@
+{
+ "gce_framework": {
+ "suffix": []
+ },
+ "gke_framework": {
+ "suffix": []
+ }
+} \ No newline at end of file
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/namespace.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/namespace.py
new file mode 100644
index 00000000..beffded2
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/cleanup/namespace.py
@@ -0,0 +1,38 @@
+# Copyright 2022 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Clean up GKE namespaces leaked by the tests."""
+
+from absl import app
+
+from bin.cleanup import cleanup
+from framework import xds_flags
+from framework import xds_k8s_flags
+
+
+def main(argv):
+ if len(argv) > 1:
+ raise app.UsageError('Too many command-line arguments.')
+ cleanup.load_keep_config()
+
+ project: str = xds_flags.PROJECT.value
+ network: str = xds_flags.NETWORK.value
+ gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value
+ dry_run: bool = cleanup.DRY_RUN.value
+
+ cleanup.find_and_remove_leaked_k8s_resources(dry_run, project, network,
+ gcp_service_account)
+
+
+if __name__ == '__main__':
+ app.run(main)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/ensure_venv.sh b/grpc/tools/run_tests/xds_k8s_test_driver/bin/ensure_venv.sh
new file mode 100755
index 00000000..288c3fac
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/ensure_venv.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Expected $XDS_K8S_DRIVER_DIR to be set by the file sourcing this.
+readonly XDS_K8S_DRIVER_VENV_DIR="${XDS_K8S_DRIVER_VENV_DIR:-$XDS_K8S_DRIVER_DIR/venv}"
+
+if [[ -z "${VIRTUAL_ENV}" ]]; then
+ if [[ -d "${XDS_K8S_DRIVER_VENV_DIR}" ]]; then
+ # Intentional: No need to check python venv activate script.
+ # shellcheck source=/dev/null
+ source "${XDS_K8S_DRIVER_VENV_DIR}/bin/activate"
+ else
+ echo "Missing python virtual environment directory: ${XDS_K8S_DRIVER_VENV_DIR}" >&2
+ echo "Follow README.md installation steps first." >&2
+ exit 1
+ fi
+fi
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/isort.sh b/grpc/tools/run_tests/xds_k8s_test_driver/bin/isort.sh
new file mode 100755
index 00000000..5fe812dc
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/isort.sh
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+display_usage() {
+ cat <<EOF >/dev/stderr
+A helper to run isort import sorter.
+
+USAGE: $0 [--diff]
+ --diff: Do not apply changes, only show the diff
+
+ENVIRONMENT:
+ XDS_K8S_DRIVER_VENV_DIR: the path to python virtual environment directory
+ Default: $XDS_K8S_DRIVER_DIR/venv
+EXAMPLES:
+$0
+$0 --diff
+EOF
+ exit 1
+}
+
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_usage
+fi
+
+SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+readonly SCRIPT_DIR
+readonly XDS_K8S_DRIVER_DIR="${SCRIPT_DIR}/.."
+
+cd "${XDS_K8S_DRIVER_DIR}"
+
+# Relative paths not yet supported by shellcheck.
+# shellcheck source=/dev/null
+source "${XDS_K8S_DRIVER_DIR}/bin/ensure_venv.sh"
+
+if [[ "$1" == "--diff" ]]; then
+ readonly MODE="--diff"
+else
+ readonly MODE="--overwrite-in-place"
+fi
+
+# typing is the only module allowed to put imports on the same line:
+# https://google.github.io/styleguide/pyguide.html#313-imports-formatting
+exec python -m isort "${MODE}" \
+ --force-sort-within-sections \
+ --force-single-line-imports --single-line-exclusions=typing \
+ framework bin tests
+
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_channelz.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_channelz.py
index a3a341a1..5c2c0ac0 100755
--- a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_channelz.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_channelz.py
@@ -26,7 +26,7 @@ Typical usage examples:
python -m bin.run_channelz --flagfile=config/local-dev.cfg --security=mtls_error
# More information and usage options
- python -m bin.run_channelz --helpful
+ python -m bin.run_channelz --helpfull
"""
import hashlib
import logging
@@ -58,6 +58,8 @@ _SECURITY = flags.DEFINE_enum('security',
help='Show info for a security setup')
flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
+# Running outside of a test suite, so require explicit resource_suffix.
+flags.mark_flag_as_required("resource_suffix")
# Type aliases
_Channel = grpc_channelz.Channel
@@ -174,9 +176,13 @@ def main(argv):
k8s_api_manager = k8s.KubernetesApiManager(xds_k8s_flags.KUBE_CONTEXT.value)
+ # Resource names.
+ resource_prefix: str = xds_flags.RESOURCE_PREFIX.value
+ resource_suffix: str = xds_flags.RESOURCE_SUFFIX.value
+
# Server
server_name = xds_flags.SERVER_NAME.value
- server_namespace = xds_flags.NAMESPACE.value
+ server_namespace = resource_prefix
server_k8s_ns = k8s.KubernetesNamespace(k8s_api_manager, server_namespace)
server_pod_ip = get_deployment_pod_ips(server_k8s_ns, server_name)[0]
test_server: _XdsTestServer = _XdsTestServer(
@@ -188,7 +194,7 @@ def main(argv):
# Client
client_name = xds_flags.CLIENT_NAME.value
- client_namespace = xds_flags.NAMESPACE.value
+ client_namespace = resource_prefix
client_k8s_ns = k8s.KubernetesNamespace(k8s_api_manager, client_namespace)
client_pod_ip = get_deployment_pod_ips(client_k8s_ns, client_name)[0]
test_client: _XdsTestClient = _XdsTestClient(
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_td_setup.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_td_setup.py
index 049493a6..efcb5916 100755
--- a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_td_setup.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_td_setup.py
@@ -28,16 +28,16 @@ Typical usage examples:
python -m bin.run_td_setup --flagfile=config/local-dev.cfg --security=mtls
# More information and usage options
- python -m bin.run_td_setup --helpful
+ python -m bin.run_td_setup --helpfull
"""
import logging
-import uuid
from absl import app
from absl import flags
from framework import xds_flags
from framework import xds_k8s_flags
+from framework.helpers import rand
from framework.infrastructure import gcp
from framework.infrastructure import k8s
from framework.infrastructure import traffic_director
@@ -49,7 +49,7 @@ _CMD = flags.DEFINE_enum('cmd',
default='create',
enum_values=[
'cycle', 'create', 'cleanup', 'backends-add',
- 'backends-cleanup'
+ 'backends-cleanup', 'unused-xds-port'
],
help='Command')
_SECURITY = flags.DEFINE_enum('security',
@@ -61,9 +61,10 @@ _SECURITY = flags.DEFINE_enum('security',
help='Configure TD with security')
flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
+# Running outside of a test suite, so require explicit resource_suffix.
+flags.mark_flag_as_required("resource_suffix")
-_DEFAULT_SECURE_MODE_MAINTENANCE_PORT = \
- server_app.KubernetesServerRunner.DEFAULT_SECURE_MODE_MAINTENANCE_PORT
+KubernetesServerRunner = server_app.KubernetesServerRunner
def main(argv):
@@ -75,7 +76,10 @@ def main(argv):
project: str = xds_flags.PROJECT.value
network: str = xds_flags.NETWORK.value
- namespace = xds_flags.NAMESPACE.value
+
+ # Resource names.
+ resource_prefix: str = xds_flags.RESOURCE_PREFIX.value
+ resource_suffix: str = xds_flags.RESOURCE_SUFFIX.value
# Test server
server_name = xds_flags.SERVER_NAME.value
@@ -83,22 +87,27 @@ def main(argv):
server_maintenance_port = xds_flags.SERVER_MAINTENANCE_PORT.value
server_xds_host = xds_flags.SERVER_XDS_HOST.value
server_xds_port = xds_flags.SERVER_XDS_PORT.value
+ server_namespace = KubernetesServerRunner.make_namespace_name(
+ resource_prefix, resource_suffix)
gcp_api_manager = gcp.api.GcpApiManager()
if security_mode is None:
- td = traffic_director.TrafficDirectorManager(gcp_api_manager,
- project=project,
- resource_prefix=namespace,
- network=network)
+ td = traffic_director.TrafficDirectorManager(
+ gcp_api_manager,
+ project=project,
+ network=network,
+ resource_prefix=resource_prefix,
+ resource_suffix=resource_suffix)
else:
td = traffic_director.TrafficDirectorSecureManager(
gcp_api_manager,
project=project,
- resource_prefix=namespace,
- network=network)
+ network=network,
+ resource_prefix=resource_prefix,
+ resource_suffix=resource_suffix)
if server_maintenance_port is None:
- server_maintenance_port = _DEFAULT_SECURE_MODE_MAINTENANCE_PORT
+ server_maintenance_port = KubernetesServerRunner.DEFAULT_SECURE_MODE_MAINTENANCE_PORT
try:
if command in ('create', 'cycle'):
@@ -114,12 +123,12 @@ def main(argv):
td.setup_for_grpc(server_xds_host,
server_xds_port,
health_check_port=server_maintenance_port)
- td.setup_server_security(server_namespace=namespace,
+ td.setup_server_security(server_namespace=server_namespace,
server_name=server_name,
server_port=server_port,
tls=True,
mtls=True)
- td.setup_client_security(server_namespace=namespace,
+ td.setup_client_security(server_namespace=server_namespace,
server_name=server_name,
tls=True,
mtls=True)
@@ -129,12 +138,12 @@ def main(argv):
td.setup_for_grpc(server_xds_host,
server_xds_port,
health_check_port=server_maintenance_port)
- td.setup_server_security(server_namespace=namespace,
+ td.setup_server_security(server_namespace=server_namespace,
server_name=server_name,
server_port=server_port,
tls=True,
mtls=False)
- td.setup_client_security(server_namespace=namespace,
+ td.setup_client_security(server_namespace=server_namespace,
server_name=server_name,
tls=True,
mtls=False)
@@ -144,12 +153,12 @@ def main(argv):
td.setup_for_grpc(server_xds_host,
server_xds_port,
health_check_port=server_maintenance_port)
- td.setup_server_security(server_namespace=namespace,
+ td.setup_server_security(server_namespace=server_namespace,
server_name=server_name,
server_port=server_port,
tls=False,
mtls=False)
- td.setup_client_security(server_namespace=namespace,
+ td.setup_client_security(server_namespace=server_namespace,
server_name=server_name,
tls=False,
mtls=False)
@@ -161,12 +170,12 @@ def main(argv):
td.setup_for_grpc(server_xds_host,
server_xds_port,
health_check_port=server_maintenance_port)
- td.setup_server_security(server_namespace=namespace,
+ td.setup_server_security(server_namespace=server_namespace,
server_name=server_name,
server_port=server_port,
tls=True,
mtls=True)
- td.setup_client_security(server_namespace=namespace,
+ td.setup_client_security(server_namespace=server_namespace,
server_name=server_name,
tls=True,
mtls=False)
@@ -180,16 +189,16 @@ def main(argv):
health_check_port=server_maintenance_port)
# Regular TLS setup, but with client policy configured using
# intentionality incorrect server_namespace.
- td.setup_server_security(server_namespace=namespace,
+ td.setup_server_security(server_namespace=server_namespace,
server_name=server_name,
server_port=server_port,
tls=True,
mtls=False)
- incorrect_namespace = f'incorrect-namespace-{uuid.uuid4().hex}'
- td.setup_client_security(server_namespace=incorrect_namespace,
- server_name=server_name,
- tls=True,
- mtls=False)
+ td.setup_client_security(
+ server_namespace=f'incorrect-namespace-{rand.rand_string()}',
+ server_name=server_name,
+ tls=True,
+ mtls=False)
logger.info('Works!')
except Exception: # noqa pylint: disable=broad-except
@@ -203,7 +212,8 @@ def main(argv):
logger.info('Adding backends')
k8s_api_manager = k8s.KubernetesApiManager(
xds_k8s_flags.KUBE_CONTEXT.value)
- k8s_namespace = k8s.KubernetesNamespace(k8s_api_manager, namespace)
+ k8s_namespace = k8s.KubernetesNamespace(k8s_api_manager,
+ server_namespace)
neg_name, neg_zones = k8s_namespace.get_service_neg(
server_name, server_port)
@@ -211,10 +221,16 @@ def main(argv):
td.load_backend_service()
td.backend_service_add_neg_backends(neg_name, neg_zones)
td.wait_for_backends_healthy_status()
- # TODO(sergiitk): wait until client reports rpc health
elif command == 'backends-cleanup':
td.load_backend_service()
td.backend_service_remove_all_backends()
+ elif command == 'unused-xds-port':
+ try:
+ unused_xds_port = td.find_unused_forwarding_rule_port()
+ logger.info('Found unused forwarding rule port: %s',
+ unused_xds_port)
+ except Exception: # noqa pylint: disable=broad-except
+ logger.exception("Couldn't find unused forwarding rule port")
if __name__ == '__main__':
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_client.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_client.py
index 18faa876..bd035e1d 100755
--- a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_client.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_client.py
@@ -18,6 +18,7 @@ from absl import flags
from framework import xds_flags
from framework import xds_k8s_flags
+from framework.infrastructure import gcp
from framework.infrastructure import k8s
from framework.test_app import client_app
@@ -43,23 +44,32 @@ _CLEANUP_NAMESPACE = flags.DEFINE_bool(
help="Delete namespace during resource cleanup")
flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
+# Running outside of a test suite, so require explicit resource_suffix.
+flags.mark_flag_as_required("resource_suffix")
+
+# Type aliases
+KubernetesClientRunner = client_app.KubernetesClientRunner
def main(argv):
if len(argv) > 1:
raise app.UsageError('Too many command-line arguments.')
- # Base namespace
- namespace = xds_flags.NAMESPACE.value
- client_namespace = namespace
+ project: str = xds_flags.PROJECT.value
+ # GCP Service Account email
+ gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value
+ # KubernetesClientRunner arguments.
runner_kwargs = dict(
deployment_name=xds_flags.CLIENT_NAME.value,
image_name=xds_k8s_flags.CLIENT_IMAGE.value,
- gcp_service_account=xds_k8s_flags.GCP_SERVICE_ACCOUNT.value,
td_bootstrap_image=xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value,
+ gcp_project=project,
+ gcp_api_manager=gcp.api.GcpApiManager(),
+ gcp_service_account=gcp_service_account,
xds_server_uri=xds_flags.XDS_SERVER_URI.value,
network=xds_flags.NETWORK.value,
+ config_scope=xds_flags.CONFIG_SCOPE.value,
stats_port=xds_flags.CLIENT_PORT.value,
reuse_namespace=_REUSE_NAMESPACE.value)
@@ -68,7 +78,9 @@ def main(argv):
deployment_template='client-secure.deployment.yaml')
k8s_api_manager = k8s.KubernetesApiManager(xds_k8s_flags.KUBE_CONTEXT.value)
- client_runner = client_app.KubernetesClientRunner(
+ client_namespace = KubernetesClientRunner.make_namespace_name(
+ xds_flags.RESOURCE_PREFIX.value, xds_flags.RESOURCE_SUFFIX.value)
+ client_runner = KubernetesClientRunner(
k8s.KubernetesNamespace(k8s_api_manager, client_namespace),
**runner_kwargs)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_server.py b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_server.py
index a1e45b33..af44d467 100755
--- a/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_server.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/run_test_server.py
@@ -18,6 +18,7 @@ from absl import flags
from framework import xds_flags
from framework import xds_k8s_flags
+from framework.infrastructure import gcp
from framework.infrastructure import k8s
from framework.test_app import server_app
@@ -39,31 +40,44 @@ _CLEANUP_NAMESPACE = flags.DEFINE_bool(
help="Delete namespace during resource cleanup")
flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
+# Running outside of a test suite, so require explicit resource_suffix.
+flags.mark_flag_as_required("resource_suffix")
+
+KubernetesServerRunner = server_app.KubernetesServerRunner
def main(argv):
if len(argv) > 1:
raise app.UsageError('Too many command-line arguments.')
- # Base namespace
- namespace = xds_flags.NAMESPACE.value
- server_namespace = namespace
+ project: str = xds_flags.PROJECT.value
+ # GCP Service Account email
+ gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value
+
+ # Resource names.
+ resource_prefix: str = xds_flags.RESOURCE_PREFIX.value
+ resource_suffix: str = xds_flags.RESOURCE_SUFFIX.value
+ # KubernetesServerRunner arguments.
runner_kwargs = dict(
deployment_name=xds_flags.SERVER_NAME.value,
image_name=xds_k8s_flags.SERVER_IMAGE.value,
- gcp_service_account=xds_k8s_flags.GCP_SERVICE_ACCOUNT.value,
+ td_bootstrap_image=xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value,
+ gcp_project=project,
+ gcp_api_manager=gcp.api.GcpApiManager(),
+ gcp_service_account=gcp_service_account,
network=xds_flags.NETWORK.value,
reuse_namespace=_REUSE_NAMESPACE.value)
if _SECURE.value:
runner_kwargs.update(
- td_bootstrap_image=xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value,
xds_server_uri=xds_flags.XDS_SERVER_URI.value,
deployment_template='server-secure.deployment.yaml')
k8s_api_manager = k8s.KubernetesApiManager(xds_k8s_flags.KUBE_CONTEXT.value)
- server_runner = server_app.KubernetesServerRunner(
+ server_namespace = KubernetesServerRunner.make_namespace_name(
+ resource_prefix, resource_suffix)
+ server_runner = KubernetesServerRunner(
k8s.KubernetesNamespace(k8s_api_manager, server_namespace),
**runner_kwargs)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/bin/yapf.sh b/grpc/tools/run_tests/xds_k8s_test_driver/bin/yapf.sh
new file mode 100755
index 00000000..0b6d2ce1
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/bin/yapf.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+display_usage() {
+ cat <<EOF >/dev/stderr
+A helper to run yapf formatter.
+
+USAGE: $0 [--diff]
+ --diff: Do not apply changes, only show the diff
+
+ENVIRONMENT:
+ XDS_K8S_DRIVER_VENV_DIR: the path to python virtual environment directory
+ Default: $XDS_K8S_DRIVER_DIR/venv
+EXAMPLES:
+$0
+$0 --diff
+EOF
+ exit 1
+}
+
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ display_usage
+fi
+
+SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+readonly SCRIPT_DIR
+readonly XDS_K8S_DRIVER_DIR="${SCRIPT_DIR}/.."
+
+cd "${XDS_K8S_DRIVER_DIR}"
+
+# Relative paths not yet supported by shellcheck.
+# shellcheck source=/dev/null
+source "${XDS_K8S_DRIVER_DIR}/bin/ensure_venv.sh"
+
+if [[ "$1" == "--diff" ]]; then
+ readonly MODE="--diff"
+else
+ readonly MODE="--in-place"
+ readonly VERBOSE="--verbose" # print out file names while processing
+fi
+
+exec python -m yapf "${MODE}" ${VERBOSE:-} \
+ --parallel --recursive --style=../../../setup.cfg \
+ framework bin tests
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/config/common.cfg b/grpc/tools/run_tests/xds_k8s_test_driver/config/common.cfg
index e4c80901..827e292e 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/config/common.cfg
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/config/common.cfg
@@ -1,4 +1,7 @@
---namespace=interop-psm-security
+--resource_prefix=xds-k8s-security
--td_bootstrap_image=gcr.io/grpc-testing/td-grpc-bootstrap:2558ec79df06984ed0d37e9e69f34688ffe301bb
--logger_levels=__main__:DEBUG,framework:INFO
--verbosity=0
+# Google projects: remove if console.cloud.google.com redirects to Logs Explorer
+# ref: https://github.com/grpc/grpc/pull/26844#discussion_r680224772
+--gcp_ui_url=pantheon.corp.google.com
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/config/grpc-testing.cfg b/grpc/tools/run_tests/xds_k8s_test_driver/config/grpc-testing.cfg
index 7a362a84..2e89c7eb 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/config/grpc-testing.cfg
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/config/grpc-testing.cfg
@@ -1,5 +1,9 @@
--flagfile=config/common.cfg
--project=grpc-testing
--network=default-vpc
---gcp_service_account=830293263384-compute@developer.gserviceaccount.com
+--gcp_service_account=xds-k8s-interop-tests@grpc-testing.iam.gserviceaccount.com
--private_api_key_secret_name=projects/830293263384/secrets/xds-interop-tests-private-api-access-key
+# Randomize xds port.
+--server_xds_port=0
+# ResultStore UI doesn't support 256 colors.
+--color_style=ansi16
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example b/grpc/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example
index 2b31024b..2afb091a 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/config/local-dev.cfg.example
@@ -8,6 +8,15 @@
--project=your_project_id
--gcp_service_account=project_number-compute@developer.gserviceaccount.com
--private_api_key_secret_name=projects/project_number/secrets/xds-interop-tests-private-api-access-key
+# Uncomment to ensure the allow health check firewall exists before test case runs
+# --ensure_firewall
+
+# Use a resource prefix to describe usage and ownership
+--resource_prefix=xds-k8s-test
+
+# Use predictable resource suffix to simplify debugging
+# If left blank, the framework will randomly generate one
+--resource_suffix=dev
# The name of kube context to use. See `gcloud container clusters get-credentials` and `kubectl config`
--kube_context=context_name
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/config/url-map.cfg b/grpc/tools/run_tests/xds_k8s_test_driver/config/url-map.cfg
new file mode 100644
index 00000000..5a31dae3
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/config/url-map.cfg
@@ -0,0 +1,12 @@
+--resource_prefix=interop-psm-url-map
+--strategy=reuse
+--server_xds_port=8848
+# NOTE(lidiz) we pin the server image to java-server because:
+# 1. Only Java server understands the rpc-behavior metadata.
+# 2. All UrlMap tests today are testing client-side logic.
+# grpc-java master: 438f8d9e7880b2f6ae2b376a35a9f5f32b4dbeaa TODO: use v1.40.0
+--server_image=gcr.io/grpc-testing/xds-interop/java-server:438f8d9e7880b2f6ae2b376a35a9f5f32b4dbeaa
+# Disables the GCP Workload Identity feature to simplify permission control
+--gcp_service_account=None
+--private_api_key_secret_name=None
+--noenable_workload_identity
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/datetime.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/datetime.py
new file mode 100644
index 00000000..a4b27849
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/datetime.py
@@ -0,0 +1,52 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 contains common helpers for working with dates and time."""
+import datetime
+import re
+from typing import Pattern
+
+RE_ZERO_OFFSET: Pattern[str] = re.compile(r'[+\-]00:?00$')
+
+
+def utc_now() -> datetime.datetime:
+ """Construct a datetime from current time in UTC timezone."""
+ return datetime.datetime.now(datetime.timezone.utc)
+
+
+def shorten_utc_zone(utc_datetime_str: str) -> str:
+ """Replace ±00:00 timezone designator with Z (zero offset AKA Zulu time)."""
+ return RE_ZERO_OFFSET.sub('Z', utc_datetime_str)
+
+
+def iso8601_utc_time(timedelta: datetime.timedelta = None) -> str:
+ """Return datetime relative to current in ISO-8601 format, UTC tz."""
+ time: datetime.datetime = utc_now()
+ if timedelta:
+ time += timedelta
+ return shorten_utc_zone(time.isoformat())
+
+
+def datetime_suffix(*, seconds: bool = False) -> str:
+ """Return current UTC date, and time in a format useful for resource naming.
+
+ Examples:
+ - 20210626-1859 (seconds=False)
+ - 20210626-185942 (seconds=True)
+ Use in resources names incompatible with ISO 8601, e.g. some GCP resources
+ that only allow lowercase alphanumeric chars and dashes.
+
+ Hours and minutes are joined together for better readability, so time is
+ visually distinct from dash-separated date.
+ """
+ return utc_now().strftime('%Y%m%d-%H%M' + ('%S' if seconds else ''))
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/highlighter.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/highlighter.py
new file mode 100644
index 00000000..0c9f0112
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/highlighter.py
@@ -0,0 +1,99 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 module contains helpers to enable color output in terminals.
+
+Use this to log resources dumped as a structured document (f.e. YAML),
+and enable colorful syntax highlighting.
+
+TODO(sergiitk): This can be used to output protobuf responses formatted as JSON.
+"""
+import logging
+from typing import Optional
+
+from absl import flags
+import pygments
+import pygments.formatter
+import pygments.formatters.other
+import pygments.formatters.terminal
+import pygments.formatters.terminal256
+import pygments.lexer
+import pygments.lexers.data
+import pygments.styles
+
+# The style for terminals supporting 8/16 colors.
+STYLE_ANSI_16 = 'ansi16'
+# Join with pygments styles for terminals supporting 88/256 colors.
+ALL_COLOR_STYLES = [STYLE_ANSI_16] + list(pygments.styles.get_all_styles())
+
+# Flags.
+COLOR = flags.DEFINE_bool("color", default=True, help='Colorize the output')
+COLOR_STYLE = flags.DEFINE_enum(
+ "color_style",
+ default='material',
+ enum_values=ALL_COLOR_STYLES,
+ help=('Color styles for terminals supporting 256 colors. '
+ f'Use {STYLE_ANSI_16} style for terminals supporting 8/16 colors'))
+
+logger = logging.getLogger(__name__)
+
+# Type aliases.
+Lexer = pygments.lexer.Lexer
+YamlLexer = pygments.lexers.data.YamlLexer
+Formatter = pygments.formatter.Formatter
+NullFormatter = pygments.formatters.other.NullFormatter
+TerminalFormatter = pygments.formatters.terminal.TerminalFormatter
+Terminal256Formatter = pygments.formatters.terminal256.Terminal256Formatter
+
+
+class Highlighter:
+ formatter: Formatter
+ lexer: Lexer
+ color: bool
+ color_style: Optional[str] = None
+
+ def __init__(self,
+ *,
+ lexer: Lexer,
+ color: Optional[bool] = None,
+ color_style: Optional[str] = None):
+ self.lexer = lexer
+ self.color = color if color is not None else COLOR.value
+
+ if self.color:
+ color_style = color_style if color_style else COLOR_STYLE.value
+ if color_style not in ALL_COLOR_STYLES:
+ raise ValueError(f'Unrecognized color style {color_style}, '
+ f'valid styles: {ALL_COLOR_STYLES}')
+ if color_style == STYLE_ANSI_16:
+ # 8/16 colors support only.
+ self.formatter = TerminalFormatter()
+ else:
+ # 88/256 colors.
+ self.formatter = Terminal256Formatter(style=color_style)
+ else:
+ self.formatter = NullFormatter()
+
+ def highlight(self, code: str) -> str:
+ return pygments.highlight(code, self.lexer, self.formatter)
+
+
+class HighlighterYaml(Highlighter):
+
+ def __init__(self,
+ *,
+ color: Optional[bool] = None,
+ color_style: Optional[str] = None):
+ super().__init__(lexer=YamlLexer(encoding='utf-8'),
+ color=color,
+ color_style=color_style)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/rand.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/rand.py
new file mode 100644
index 00000000..dedf2143
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/rand.py
@@ -0,0 +1,49 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 contains common helpers for generating randomized data."""
+import random
+import string
+
+import framework.helpers.datetime
+
+# Alphanumeric characters, similar to regex [:alnum:] class, [a-zA-Z0-9]
+ALPHANUM = string.ascii_letters + string.digits
+# Lowercase alphanumeric characters: [a-z0-9]
+# Use ALPHANUM_LOWERCASE alphabet when case-sensitivity is a concern.
+ALPHANUM_LOWERCASE = string.ascii_lowercase + string.digits
+
+
+def rand_string(length: int = 8, *, lowercase: bool = False) -> str:
+ """Return random alphanumeric string of given length.
+
+ Space for default arguments: alphabet^length
+ lowercase and uppercase = (26*2 + 10)^8 = 2.18e14 = 218 trillion.
+ lowercase only = (26 + 10)^8 = 2.8e12 = 2.8 trillion.
+ """
+ alphabet = ALPHANUM_LOWERCASE if lowercase else ALPHANUM
+ return ''.join(random.choices(population=alphabet, k=length))
+
+
+def random_resource_suffix() -> str:
+ """Return a ready-to-use resource suffix with datetime and nonce."""
+ # Date and time suffix for debugging. Seconds skipped, not as relevant
+ # Format example: 20210626-1859
+ datetime_suffix: str = framework.helpers.datetime.datetime_suffix()
+ # Use lowercase chars because some resource names won't allow uppercase.
+ # For len 5, total (26 + 10)^5 = 60,466,176 combinations.
+ # Approx. number of test runs needed to start at the same minute to
+ # produce a collision: math.sqrt(math.pi/2 * (26+10)**5) ≈ 9745.
+ # https://en.wikipedia.org/wiki/Birthday_attack#Mathematics
+ unique_hash: str = rand_string(5, lowercase=True)
+ return f'{datetime_suffix}-{unique_hash}'
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py
index 4ea4e905..94c7cf1c 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/retryers.py
@@ -22,7 +22,7 @@ We use tenacity as a general-purpose retrying library.
"""
import datetime
import logging
-from typing import Any, List, Optional
+from typing import Any, Optional, Sequence
import tenacity
@@ -41,7 +41,7 @@ _wait_exponential = tenacity.wait_exponential
_wait_fixed = tenacity.wait_fixed
-def _retry_on_exceptions(retry_on_exceptions: Optional[List[Any]] = None):
+def _retry_on_exceptions(retry_on_exceptions: Optional[Sequence[Any]] = None):
# Retry on all exceptions by default
if retry_on_exceptions is None:
retry_on_exceptions = (Exception,)
@@ -53,7 +53,7 @@ def exponential_retryer_with_timeout(
wait_min: timedelta,
wait_max: timedelta,
timeout: timedelta,
- retry_on_exceptions: Optional[List[Any]] = None,
+ retry_on_exceptions: Optional[Sequence[Any]] = None,
logger: Optional[logging.Logger] = None,
log_level: Optional[int] = logging.DEBUG) -> Retrying:
if logger is None:
@@ -71,7 +71,7 @@ def constant_retryer(*,
wait_fixed: timedelta,
attempts: int = 0,
timeout: timedelta = None,
- retry_on_exceptions: Optional[List[Any]] = None,
+ retry_on_exceptions: Optional[Sequence[Any]] = None,
logger: Optional[logging.Logger] = None,
log_level: Optional[int] = logging.DEBUG) -> Retrying:
if logger is None:
@@ -84,7 +84,7 @@ def constant_retryer(*,
if attempts > 0:
stops.append(_stop_after_attempt(attempts))
if timeout is not None:
- stops.append(_stop_after_delay.total_seconds())
+ stops.append(_stop_after_delay(timeout.total_seconds()))
return Retrying(retry=_retry_on_exceptions(retry_on_exceptions),
wait=_wait_fixed(wait_fixed.total_seconds()),
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/skips.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/skips.py
new file mode 100644
index 00000000..efea6b07
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/helpers/skips.py
@@ -0,0 +1,67 @@
+# Copyright 2022 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 classes and predicates to assist validate test config for test cases."""
+from dataclasses import dataclass
+import re
+from typing import Callable
+import unittest
+
+from packaging import version as pkg_version
+
+from framework import xds_flags
+from framework import xds_k8s_flags
+
+
+def _get_lang(image_name: str) -> str:
+ return re.search(r'/(\w+)-(client|server):', image_name).group(1)
+
+
+def _parse_version(s: str) -> pkg_version.Version:
+ if s.endswith(".x"):
+ s = s[:-2]
+ return pkg_version.Version(s)
+
+
+@dataclass
+class TestConfig:
+ """Describes the config for the test suite."""
+ client_lang: str
+ server_lang: str
+ version: str
+
+ def version_ge(self, another: str) -> bool:
+ """Returns a bool for whether the version is >= another one.
+
+ A version is greater than or equal to another version means its version
+ number is greater than or equal to another version's number. Version
+ "master" is always considered latest. E.g., master >= v1.41.x >= v1.40.x
+ >= v1.9.x.
+ """
+ if self.version == 'master':
+ return True
+ return _parse_version(self.version) >= _parse_version(another)
+
+
+def evaluate_test_config(check: Callable[[TestConfig], bool]) -> None:
+ """Evaluates the test config check against Abseil flags."""
+ # NOTE(lidiz) a manual skip mechanism is needed because absl/flags
+ # cannot be used in the built-in test-skipping decorators. See the
+ # official FAQs:
+ # https://abseil.io/docs/python/guides/flags#faqs
+ test_config = TestConfig(
+ client_lang=_get_lang(xds_k8s_flags.CLIENT_IMAGE.value),
+ server_lang=_get_lang(xds_k8s_flags.SERVER_IMAGE.value),
+ version=xds_flags.TESTING_VERSION.value)
+ if not check(test_config):
+ raise unittest.SkipTest(f'Unsupported test config: {test_config}')
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/__init__.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/__init__.py
index 02d8fadf..127ce04e 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/__init__.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/__init__.py
@@ -13,5 +13,6 @@
# limitations under the License.
from framework.infrastructure.gcp import api
from framework.infrastructure.gcp import compute
+from framework.infrastructure.gcp import iam
from framework.infrastructure.gcp import network_security
from framework.infrastructure.gcp import network_services
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/api.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/api.py
index 25458bc3..475dfd69 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/api.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/api.py
@@ -14,23 +14,25 @@
import abc
import contextlib
import functools
+import json
import logging
-from typing import Optional, List
+from typing import Any, Dict, List, Optional
-# Workaround: `grpc` must be imported before `google.protobuf.json_format`,
-# to prevent "Segmentation fault". Ref https://github.com/grpc/grpc/issues/24897
-# TODO(sergiitk): Remove after #24897 is solved
-import grpc # noqa pylint: disable=unused-import
from absl import flags
from google.cloud import secretmanager_v1
from google.longrunning import operations_pb2
from google.protobuf import json_format
from google.rpc import code_pb2
+from google.rpc import error_details_pb2
+from google.rpc import status_pb2
from googleapiclient import discovery
import googleapiclient.errors
+import googleapiclient.http
import tenacity
import yaml
+import framework.helpers.highlighter
+
logger = logging.getLogger(__name__)
PRIVATE_API_KEY_SECRET_NAME = flags.DEFINE_string(
"private_api_key_secret_name",
@@ -47,9 +49,16 @@ COMPUTE_V1_DISCOVERY_FILE = flags.DEFINE_string(
"compute_v1_discovery_file",
default=None,
help="Load compute v1 from discovery file")
+GCP_UI_URL = flags.DEFINE_string("gcp_ui_url",
+ default="console.cloud.google.com",
+ help="Override GCP UI URL.")
# Type aliases
+_HttpError = googleapiclient.errors.HttpError
+_HttpLib2Error = googleapiclient.http.httplib2.HttpLib2Error
+_HighlighterYaml = framework.helpers.highlighter.HighlighterYaml
Operation = operations_pb2.Operation
+HttpRequest = googleapiclient.http.HttpRequest
class GcpApiManager:
@@ -59,13 +68,15 @@ class GcpApiManager:
v1_discovery_uri=None,
v2_discovery_uri=None,
compute_v1_discovery_file=None,
- private_api_key_secret_name=None):
+ private_api_key_secret_name=None,
+ gcp_ui_url=None):
self.v1_discovery_uri = v1_discovery_uri or V1_DISCOVERY_URI.value
self.v2_discovery_uri = v2_discovery_uri or V2_DISCOVERY_URI.value
self.compute_v1_discovery_file = (compute_v1_discovery_file or
COMPUTE_V1_DISCOVERY_FILE.value)
self.private_api_key_secret_name = (private_api_key_secret_name or
PRIVATE_API_KEY_SECRET_NAME.value)
+ self.gcp_ui_url = gcp_ui_url or GCP_UI_URL.value
# TODO(sergiitk): add options to pass google Credentials
self._exit_stack = contextlib.ExitStack()
@@ -80,10 +91,10 @@ class GcpApiManager:
Return API key credential that identifies a GCP project allow-listed for
accessing private API discovery documents.
- https://pantheon.corp.google.com/apis/credentials
+ https://console.cloud.google.com/apis/credentials
This method lazy-loads the content of the key from the Secret Manager.
- https://pantheon.corp.google.com/security/secret-manager
+ https://console.cloud.google.com/security/secret-manager
"""
if not self.private_api_key_secret_name:
raise ValueError('private_api_key_secret_name must be set to '
@@ -105,6 +116,8 @@ class GcpApiManager:
return self._build_from_file(self.compute_v1_discovery_file)
else:
return self._build_from_discovery_v1(api_name, version)
+ elif version == 'v1alpha':
+ return self._build_from_discovery_v1(api_name, 'alpha')
raise NotImplementedError(f'Compute {version} not supported')
@@ -117,6 +130,8 @@ class GcpApiManager:
version,
api_key=self.private_api_key,
visibility_labels=['NETWORKSECURITY_ALPHA'])
+ elif version == 'v1beta1':
+ return self._build_from_discovery_v2(api_name, version)
raise NotImplementedError(f'Network Security {version} not supported')
@@ -129,6 +144,8 @@ class GcpApiManager:
version,
api_key=self.private_api_key,
visibility_labels=['NETWORKSERVICES_ALPHA'])
+ elif version == 'v1beta1':
+ return self._build_from_discovery_v2(api_name, version)
raise NotImplementedError(f'Network Services {version} not supported')
@@ -139,6 +156,20 @@ class GcpApiManager:
raise NotImplementedError(f'Secret Manager {version} not supported')
+ @functools.lru_cache(None)
+ def iam(self, version: str) -> discovery.Resource:
+ """Identity and Access Management (IAM) API.
+
+ https://cloud.google.com/iam/docs/reference/rest
+ https://googleapis.github.io/google-api-python-client/docs/dyn/iam_v1.html
+ """
+ api_name = 'iam'
+ if version == 'v1':
+ return self._build_from_discovery_v1(api_name, version)
+
+ raise NotImplementedError(
+ f'Identity and Access Management (IAM) {version} not supported')
+
def _build_from_discovery_v1(self, api_name, version):
api = discovery.build(api_name,
version,
@@ -180,7 +211,46 @@ class GcpApiManager:
class Error(Exception):
- """Base error class for GCP API errors"""
+ """Base error class for GCP API errors."""
+
+
+class ResponseError(Error):
+ """The response was not a 2xx."""
+ reason: str
+ uri: str
+ error_details: Optional[str]
+ status: Optional[int]
+ cause: _HttpError
+
+ def __init__(self, cause: _HttpError):
+ # TODO(sergiitk): cleanup when we upgrade googleapiclient:
+ # - remove _get_reason()
+ # - remove error_details note
+ # - use status_code()
+ self.reason = cause._get_reason().strip() # noqa
+ self.uri = cause.uri
+ self.error_details = cause.error_details # NOTE: Must after _get_reason
+ self.status = None
+ if cause.resp and cause.resp.status:
+ self.status = cause.resp.status
+ self.cause = cause
+ super().__init__()
+
+ def __repr__(self):
+ return (f'<ResponseError {self.status} when requesting {self.uri} '
+ f'returned "{self.reason}". Details: "{self.error_details}">')
+
+
+class TransportError(Error):
+ """A transport error has occurred."""
+ cause: _HttpLib2Error
+
+ def __init__(self, cause: _HttpLib2Error):
+ self.cause = cause
+ super().__init__()
+
+ def __repr__(self):
+ return f'<TransportError cause: {self.cause!r}>'
class OperationError(Error):
@@ -191,19 +261,68 @@ class OperationError(Error):
https://cloud.google.com/apis/design/design_patterns#long_running_operations
https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto
"""
+ api_name: str
+ name: str
+ metadata: str
+ code_name: code_pb2.Code
+ error: status_pb2.Status
- def __init__(self, api_name, operation_response, message=None):
+ def __init__(self, api_name: str, response: dict):
self.api_name = api_name
- operation = json_format.ParseDict(operation_response, Operation())
+
+ # Operation.metadata field is Any specific to the API. It may not be
+ # present in the default descriptor pool, and that's expected.
+ # To avoid json_format.ParseError, handle it separately.
+ self.metadata = response.pop('metadata', {})
+
+ # Must be after removing metadata field.
+ operation: Operation = self._parse_operation_response(response)
self.name = operation.name or 'unknown'
- self.error = operation.error
self.code_name = code_pb2.Code.Name(operation.error.code)
- if message is None:
- message = (f'{api_name} operation "{self.name}" failed. Error '
- f'code: {self.error.code} ({self.code_name}), '
- f'message: {self.error.message}')
- self.message = message
- super().__init__(message)
+ self.error = operation.error
+ super().__init__()
+
+ @staticmethod
+ def _parse_operation_response(operation_response: dict) -> Operation:
+ try:
+ return json_format.ParseDict(
+ operation_response,
+ Operation(),
+ ignore_unknown_fields=True,
+ descriptor_pool=error_details_pb2.DESCRIPTOR.pool)
+ except (json_format.Error, TypeError) as e:
+ # Swallow parsing errors if any. Building correct OperationError()
+ # is more important than losing debug information. Details still
+ # can be extracted from the warning.
+ logger.warning(
+ ("Can't parse response while processing OperationError: '%r', "
+ "error %r"), operation_response, e)
+ return Operation()
+
+ def __str__(self):
+ indent_l1 = ' ' * 2
+ indent_l2 = indent_l1 * 2
+
+ result = (f'{self.api_name} operation "{self.name}" failed.\n'
+ f'{indent_l1}code: {self.error.code} ({self.code_name})\n'
+ f'{indent_l1}message: "{self.error.message}"')
+
+ if self.error.details:
+ result += f'\n{indent_l1}details: [\n'
+ for any_error in self.error.details:
+ error_str = json_format.MessageToJson(any_error)
+ for line in error_str.splitlines():
+ result += indent_l2 + line + '\n'
+ result += f'{indent_l1}]'
+
+ if self.metadata:
+ result += f'\n metadata: \n'
+ metadata_str = json.dumps(self.metadata, indent=2)
+ for line in metadata_str.splitlines():
+ result += indent_l2 + line + '\n'
+ result = result.rstrip()
+
+ return result
class GcpProjectApiResource:
@@ -215,6 +334,37 @@ class GcpProjectApiResource:
def __init__(self, api: discovery.Resource, project: str):
self.api: discovery.Resource = api
self.project: str = project
+ self._highlighter = _HighlighterYaml()
+
+ # TODO(sergiitk): in upcoming GCP refactoring, differentiate between
+ # _execute for LRO (Long Running Operations), and immediate operations.
+ def _execute(
+ self,
+ request: HttpRequest,
+ *,
+ num_retries: Optional[int] = _GCP_API_RETRIES) -> Dict[str, Any]:
+ """Execute the immediate request.
+
+ Returns:
+ Unmarshalled response as a dictionary.
+
+ Raises:
+ ResponseError if the response was not a 2xx.
+ TransportError if a transport error has occurred.
+ """
+ if num_retries is None:
+ num_retries = self._GCP_API_RETRIES
+ try:
+ return request.execute(num_retries=num_retries)
+ except _HttpError as error:
+ raise ResponseError(error)
+ except _HttpLib2Error as error:
+ raise TransportError(error)
+
+ def resource_pretty_format(self, body: dict) -> str:
+ """Return a string with pretty-printed resource body."""
+ yaml_out: str = yaml.dump(body, explicit_start=True, explicit_end=True)
+ return self._highlighter.highlight(yaml_out)
@staticmethod
def wait_for_operation(operation_request,
@@ -230,11 +380,6 @@ class GcpProjectApiResource:
reraise=True)
return retryer(operation_request.execute)
- @staticmethod
- def _resource_pretty_format(body: dict) -> str:
- """Return a string with pretty-printed resource body."""
- return yaml.dump(body, explicit_start=True, explicit_end=True)
-
class GcpStandardCloudApiResource(GcpProjectApiResource, metaclass=abc.ABCMeta):
GLOBAL_LOCATION = 'global'
@@ -250,7 +395,7 @@ class GcpStandardCloudApiResource(GcpProjectApiResource, metaclass=abc.ABCMeta):
def _create_resource(self, collection: discovery.Resource, body: dict,
**kwargs):
logger.info("Creating %s resource:\n%s", self.api_name,
- self._resource_pretty_format(body))
+ self.resource_pretty_format(body))
create_req = collection.create(parent=self.parent(),
body=body,
**kwargs)
@@ -269,7 +414,7 @@ class GcpStandardCloudApiResource(GcpProjectApiResource, metaclass=abc.ABCMeta):
def _get_resource(self, collection: discovery.Resource, full_name):
resource = collection.get(name=full_name).execute()
logger.info('Loaded %s:\n%s', full_name,
- self._resource_pretty_format(resource))
+ self.resource_pretty_format(resource))
return resource
def _delete_resource(self, collection: discovery.Resource,
@@ -278,15 +423,16 @@ class GcpStandardCloudApiResource(GcpProjectApiResource, metaclass=abc.ABCMeta):
try:
self._execute(collection.delete(name=full_name))
return True
- except googleapiclient.errors.HttpError as error:
+ except _HttpError as error:
if error.resp and error.resp.status == 404:
logger.info('%s not deleted since it does not exist', full_name)
else:
logger.warning('Failed to delete %s, %r', full_name, error)
return False
+ # TODO(sergiitk): Use ResponseError and TransportError
def _execute(self,
- request,
+ request: HttpRequest,
timeout_sec=GcpProjectApiResource._WAIT_FOR_OPERATION_SEC):
operation = request.execute(num_retries=self._GCP_API_RETRIES)
self._wait(operation, timeout_sec)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py
index 838aed07..700c9c07 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/compute.py
@@ -14,7 +14,7 @@
import dataclasses
import enum
import logging
-from typing import Any, Dict, Optional
+from typing import Any, Dict, List, Optional
from googleapiclient import discovery
import googleapiclient.errors
@@ -29,7 +29,7 @@ logger = logging.getLogger(__name__)
class ComputeV1(gcp.api.GcpProjectApiResource):
# TODO(sergiitk): move someplace better
_WAIT_FOR_BACKEND_SEC = 60 * 10
- _WAIT_FOR_OPERATION_SEC = 60 * 5
+ _WAIT_FOR_OPERATION_SEC = 60 * 10
@dataclasses.dataclass(frozen=True)
class GcpResource:
@@ -40,8 +40,11 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
class ZonalGcpResource(GcpResource):
zone: str
- def __init__(self, api_manager: gcp.api.GcpApiManager, project: str):
- super().__init__(api_manager.compute('v1'), project)
+ def __init__(self,
+ api_manager: gcp.api.GcpApiManager,
+ project: str,
+ version: str = 'v1'):
+ super().__init__(api_manager.compute(version), project)
class HealthCheckProtocol(enum.Enum):
TCP = enum.auto()
@@ -77,25 +80,69 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
health_check_field: health_check_settings,
})
+ def list_health_check(self):
+ return self._list_resource(self.api.healthChecks())
+
def delete_health_check(self, name):
self._delete_resource(self.api.healthChecks(), 'healthCheck', name)
+ def create_firewall_rule(self, name: str, network_url: str,
+ source_ranges: List[str],
+ ports: List[str]) -> Optional[GcpResource]:
+ try:
+ return self._insert_resource(
+ self.api.firewalls(), {
+ "allowed": [{
+ "IPProtocol": "tcp",
+ "ports": ports
+ }],
+ "direction": "INGRESS",
+ "name": name,
+ "network": network_url,
+ "priority": 1000,
+ "sourceRanges": source_ranges,
+ "targetTags": ["allow-health-checks"]
+ })
+ except googleapiclient.errors.HttpError as http_error:
+ # TODO(lidiz) use status_code() when we upgrade googleapiclient
+ if http_error.resp.status == 409:
+ logger.debug('Firewall rule %s already existed', name)
+ return
+ else:
+ raise
+
+ def delete_firewall_rule(self, name):
+ self._delete_resource(self.api.firewalls(), 'firewall', name)
+
def create_backend_service_traffic_director(
self,
name: str,
health_check: GcpResource,
- protocol: Optional[BackendServiceProtocol] = None) -> GcpResource:
+ affinity_header: str = None,
+ protocol: Optional[BackendServiceProtocol] = None,
+ subset_size: Optional[int] = None) -> GcpResource:
if not isinstance(protocol, self.BackendServiceProtocol):
raise TypeError(f'Unexpected Backend Service protocol: {protocol}')
- return self._insert_resource(
- self.api.backendServices(),
- {
- 'name': name,
- 'loadBalancingScheme':
- 'INTERNAL_SELF_MANAGED', # Traffic Director
- 'healthChecks': [health_check.url],
- 'protocol': protocol.name,
- })
+ body = {
+ 'name': name,
+ 'loadBalancingScheme': 'INTERNAL_SELF_MANAGED', # Traffic Director
+ 'healthChecks': [health_check.url],
+ 'protocol': protocol.name,
+ }
+ # If affinity header is specified, config the backend service to support
+ # affinity, and set affinity header to the one given.
+ if affinity_header:
+ body['sessionAffinity'] = 'HEADER_FIELD'
+ body['localityLbPolicy'] = 'RING_HASH'
+ body['consistentHash'] = {
+ 'httpHeaderName': affinity_header,
+ }
+ if subset_size:
+ body['subsetting'] = {
+ 'policy': 'CONSISTENT_HASH_SUBSETTING',
+ 'subsetSize': subset_size
+ }
+ return self._insert_resource(self.api.backendServices(), body)
def get_backend_service_traffic_director(self, name: str) -> GcpResource:
return self._get_resource(self.api.backendServices(),
@@ -107,11 +154,17 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
body=body,
**kwargs)
- def backend_service_add_backends(self, backend_service, backends):
+ def backend_service_patch_backends(
+ self,
+ backend_service,
+ backends,
+ max_rate_per_endpoint: Optional[int] = None):
+ if max_rate_per_endpoint is None:
+ max_rate_per_endpoint = 5
backend_list = [{
'group': backend.url,
'balancingMode': 'RATE',
- 'maxRatePerEndpoint': 5
+ 'maxRatePerEndpoint': max_rate_per_endpoint
} for backend in backends]
self._patch_resource(collection=self.api.backendServices(),
@@ -153,6 +206,15 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
}],
})
+ def create_url_map_with_content(self, url_map_body: Any) -> GcpResource:
+ return self._insert_resource(self.api.urlMaps(), url_map_body)
+
+ def patch_url_map(self, url_map: GcpResource, body, **kwargs):
+ self._patch_resource(collection=self.api.urlMaps(),
+ urlMap=url_map.name,
+ body=body,
+ **kwargs)
+
def delete_url_map(self, name):
self._delete_resource(self.api.urlMaps(), 'urlMap', name)
@@ -160,12 +222,14 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
self,
name: str,
url_map: GcpResource,
+ validate_for_proxyless: bool = True,
) -> GcpResource:
- return self._insert_resource(self.api.targetGrpcProxies(), {
- 'name': name,
- 'url_map': url_map.url,
- 'validate_for_proxyless': True,
- })
+ return self._insert_resource(
+ self.api.targetGrpcProxies(), {
+ 'name': name,
+ 'url_map': url_map.url,
+ 'validate_for_proxyless': validate_for_proxyless,
+ })
def delete_target_grpc_proxy(self, name):
self._delete_resource(self.api.targetGrpcProxies(), 'targetGrpcProxy',
@@ -185,13 +249,13 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
self._delete_resource(self.api.targetHttpProxies(), 'targetHttpProxy',
name)
- def create_forwarding_rule(
- self,
- name: str,
- src_port: int,
- target_proxy: GcpResource,
- network_url: str,
- ) -> GcpResource:
+ def create_forwarding_rule(self,
+ name: str,
+ src_port: int,
+ target_proxy: GcpResource,
+ network_url: str,
+ *,
+ ip_address: str = '0.0.0.0') -> GcpResource:
return self._insert_resource(
self.api.globalForwardingRules(),
{
@@ -199,11 +263,22 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
'loadBalancingScheme':
'INTERNAL_SELF_MANAGED', # Traffic Director
'portRange': src_port,
- 'IPAddress': '0.0.0.0',
+ 'IPAddress': ip_address,
'network': network_url,
'target': target_proxy.url,
})
+ def exists_forwarding_rule(self, src_port) -> bool:
+ # TODO(sergiitk): Better approach for confirming the port is available.
+ # It's possible a rule allocates actual port range, e.g 8000-9000,
+ # and this wouldn't catch it. For now, we assume there's no
+ # port ranges used in the project.
+ filter_str = (f'(portRange eq "{src_port}-{src_port}") '
+ f'(IPAddress eq "0.0.0.0")'
+ f'(loadBalancingScheme eq "INTERNAL_SELF_MANAGED")')
+ return self._exists_resource(self.api.globalForwardingRules(),
+ filter=filter_str)
+
def delete_forwarding_rule(self, name):
self._delete_resource(self.api.globalForwardingRules(),
'forwardingRule', name)
@@ -295,22 +370,36 @@ class ComputeV1(gcp.api.GcpProjectApiResource):
**kwargs) -> GcpResource:
resp = collection.get(project=self.project, **kwargs).execute()
logger.info('Loaded compute resource:\n%s',
- self._resource_pretty_format(resp))
+ self.resource_pretty_format(resp))
return self.GcpResource(resp['name'], resp['selfLink'])
+ def _exists_resource(self, collection: discovery.Resource,
+ filter: str) -> bool:
+ resp = collection.list(
+ project=self.project, filter=filter,
+ maxResults=1).execute(num_retries=self._GCP_API_RETRIES)
+ if 'kind' not in resp:
+ # TODO(sergiitk): better error
+ raise ValueError('List response "kind" is missing')
+ return 'items' in resp and resp['items']
+
def _insert_resource(self, collection: discovery.Resource,
body: Dict[str, Any]) -> GcpResource:
logger.info('Creating compute resource:\n%s',
- self._resource_pretty_format(body))
+ self.resource_pretty_format(body))
resp = self._execute(collection.insert(project=self.project, body=body))
return self.GcpResource(body['name'], resp['targetLink'])
def _patch_resource(self, collection, body, **kwargs):
logger.info('Patching compute resource:\n%s',
- self._resource_pretty_format(body))
+ self.resource_pretty_format(body))
self._execute(
collection.patch(project=self.project, body=body, **kwargs))
+ def _list_resource(self, collection: discovery.Resource):
+ return collection.list(project=self.project).execute(
+ num_retries=self._GCP_API_RETRIES)
+
def _delete_resource(self, collection: discovery.Resource,
resource_type: str, resource_name: str) -> bool:
try:
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py
new file mode 100644
index 00000000..b1f6ed4e
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/iam.py
@@ -0,0 +1,312 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 dataclasses
+import datetime
+import functools
+import logging
+from typing import Any, Dict, FrozenSet, Optional
+
+from framework.helpers import retryers
+from framework.infrastructure import gcp
+
+logger = logging.getLogger(__name__)
+
+# Type aliases
+_timedelta = datetime.timedelta
+_HttpRequest = gcp.api.HttpRequest
+
+
+class EtagConflict(gcp.api.Error):
+ """
+ Indicates concurrent policy changes.
+
+ https://cloud.google.com/iam/docs/policies#etag
+ """
+ pass
+
+
+def handle_etag_conflict(func):
+
+ def wrap_retry_on_etag_conflict(*args, **kwargs):
+ retryer = retryers.exponential_retryer_with_timeout(
+ retry_on_exceptions=(EtagConflict, gcp.api.TransportError),
+ wait_min=_timedelta(seconds=1),
+ wait_max=_timedelta(seconds=10),
+ timeout=_timedelta(minutes=2))
+ return retryer(func, *args, **kwargs)
+
+ return wrap_retry_on_etag_conflict
+
+
+def _replace_binding(policy: 'Policy', binding: 'Policy.Binding',
+ new_binding: 'Policy.Binding') -> 'Policy':
+ new_bindings = set(policy.bindings)
+ new_bindings.discard(binding)
+ new_bindings.add(new_binding)
+ return dataclasses.replace(policy, bindings=frozenset(new_bindings))
+
+
+@dataclasses.dataclass(frozen=True)
+class ServiceAccount:
+ """An IAM service account.
+
+ https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts
+ Note: "etag" field is skipped because it's deprecated
+ """
+ name: str
+ projectId: str
+ uniqueId: str
+ email: str
+ oauth2ClientId: str
+ displayName: str = ''
+ description: str = ''
+ disabled: bool = False
+
+ @classmethod
+ def from_response(cls, response: Dict[str, Any]) -> 'ServiceAccount':
+ return cls(name=response['name'],
+ projectId=response['projectId'],
+ uniqueId=response['uniqueId'],
+ email=response['email'],
+ oauth2ClientId=response['oauth2ClientId'],
+ description=response.get('description', ''),
+ displayName=response.get('displayName', ''),
+ disabled=response.get('disabled', False))
+
+ def as_dict(self) -> Dict[str, Any]:
+ return dataclasses.asdict(self)
+
+
+@dataclasses.dataclass(frozen=True)
+class Expr:
+ """
+ Represents a textual expression in the Common Expression Language syntax.
+
+ https://cloud.google.com/iam/docs/reference/rest/v1/Expr
+ """
+ expression: str
+ title: str = ''
+ description: str = ''
+ location: str = ''
+
+ @classmethod
+ def from_response(cls, response: Dict[str, Any]) -> 'Expr':
+ return cls(**response)
+
+ def as_dict(self) -> Dict[str, Any]:
+ return dataclasses.asdict(self)
+
+
+@dataclasses.dataclass(frozen=True)
+class Policy:
+ """An Identity and Access Management (IAM) policy, which specifies
+ access controls for Google Cloud resources.
+
+ https://cloud.google.com/iam/docs/reference/rest/v1/Policy
+ Note: auditConfigs not supported by this implementation.
+ """
+
+ @dataclasses.dataclass(frozen=True)
+ class Binding:
+ """Policy Binding. Associates members with a role.
+
+ https://cloud.google.com/iam/docs/reference/rest/v1/Policy#binding
+ """
+ role: str
+ members: FrozenSet[str]
+ condition: Optional[Expr] = None
+
+ @classmethod
+ def from_response(cls, response: Dict[str, Any]) -> 'Policy.Binding':
+ fields = {
+ 'role': response['role'],
+ 'members': frozenset(response.get('members', [])),
+ }
+ if 'condition' in response:
+ fields['condition'] = Expr.from_response(response['condition'])
+
+ return cls(**fields)
+
+ def as_dict(self) -> Dict[str, Any]:
+ result = {
+ 'role': self.role,
+ 'members': list(self.members),
+ }
+ if self.condition is not None:
+ result['condition'] = self.condition.as_dict()
+ return result
+
+ bindings: FrozenSet[Binding]
+ etag: str
+ version: Optional[int] = None
+
+ @functools.lru_cache(maxsize=128)
+ def find_binding_for_role(
+ self,
+ role: str,
+ condition: Optional[Expr] = None) -> Optional['Policy.Binding']:
+ results = (binding for binding in self.bindings
+ if binding.role == role and binding.condition == condition)
+ return next(results, None)
+
+ @classmethod
+ def from_response(cls, response: Dict[str, Any]) -> 'Policy':
+ bindings = frozenset(
+ cls.Binding.from_response(b) for b in response.get('bindings', []))
+ return cls(bindings=bindings,
+ etag=response['etag'],
+ version=response.get('version'))
+
+ def as_dict(self) -> Dict[str, Any]:
+ result = {
+ 'bindings': [binding.as_dict() for binding in self.bindings],
+ 'etag': self.etag,
+ }
+ if self.version is not None:
+ result['version'] = self.version
+ return result
+
+
+class IamV1(gcp.api.GcpProjectApiResource):
+ """
+ Identity and Access Management (IAM) API.
+
+ https://cloud.google.com/iam/docs/reference/rest
+ """
+ _service_accounts: gcp.api.discovery.Resource
+
+ # Operations that affect conditional role bindings must specify version 3.
+ # Otherwise conditions are omitted, and role names returned with a suffix,
+ # f.e. roles/iam.workloadIdentityUser_withcond_f1ec33c9beb41857dbf0
+ # https://cloud.google.com/iam/docs/reference/rest/v1/Policy#FIELDS.version
+ POLICY_VERSION: str = 3
+
+ def __init__(self, api_manager: gcp.api.GcpApiManager, project: str):
+ super().__init__(api_manager.iam('v1'), project)
+ # Shortcut to projects/*/serviceAccounts/ endpoints
+ self._service_accounts = self.api.projects().serviceAccounts()
+
+ def service_account_resource_name(self, account) -> str:
+ """
+ Returns full resource name of the service account.
+
+ The resource name of the service account in the following format:
+ projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}.
+ The ACCOUNT value can be the email address or the uniqueId of the
+ service account.
+ Ref https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/get
+
+ Args:
+ account: The ACCOUNT value
+ """
+ return f'projects/{self.project}/serviceAccounts/{account}'
+
+ def get_service_account(self, account: str) -> ServiceAccount:
+ resource_name = self.service_account_resource_name(account)
+ request: _HttpRequest = self._service_accounts.get(name=resource_name)
+ response: Dict[str, Any] = self._execute(request)
+ logger.debug('Loaded Service Account:\n%s',
+ self.resource_pretty_format(response))
+ return ServiceAccount.from_response(response)
+
+ def get_service_account_iam_policy(self, account: str) -> Policy:
+ resource_name = self.service_account_resource_name(account)
+ request: _HttpRequest = self._service_accounts.getIamPolicy(
+ resource=resource_name,
+ options_requestedPolicyVersion=self.POLICY_VERSION)
+ response: Dict[str, Any] = self._execute(request)
+ logger.debug('Loaded Service Account Policy:\n%s',
+ self.resource_pretty_format(response))
+ return Policy.from_response(response)
+
+ def set_service_account_iam_policy(self, account: str,
+ policy: Policy) -> Policy:
+ """Sets the IAM policy that is attached to a service account.
+
+ https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/setIamPolicy
+ """
+ resource_name = self.service_account_resource_name(account)
+ body = {'policy': policy.as_dict()}
+ logger.debug('Updating Service Account %s policy:\n%s', account,
+ self.resource_pretty_format(body))
+ try:
+ request: _HttpRequest = self._service_accounts.setIamPolicy(
+ resource=resource_name, body=body)
+ response: Dict[str, Any] = self._execute(request)
+ return Policy.from_response(response)
+ except gcp.api.ResponseError as error:
+ if error.status == 409:
+ # https://cloud.google.com/iam/docs/policies#etag
+ logger.debug(error)
+ raise EtagConflict from error
+ raise
+
+ @handle_etag_conflict
+ def add_service_account_iam_policy_binding(self, account: str, role: str,
+ member: str) -> None:
+ """Add an IAM policy binding to an IAM service account.
+
+ See for details on updating policy bindings:
+ https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/setIamPolicy
+ """
+ policy: Policy = self.get_service_account_iam_policy(account)
+ binding: Optional[Policy.Binding] = policy.find_binding_for_role(role)
+ if binding and member in binding.members:
+ logger.debug('Member %s already has role %s for Service Account %s',
+ member, role, account)
+ return
+
+ if binding is None:
+ updated_binding = Policy.Binding(role, frozenset([member]))
+ else:
+ updated_members: FrozenSet[str] = binding.members.union({member})
+ updated_binding: Policy.Binding = dataclasses.replace(
+ binding, members=updated_members)
+
+ updated_policy: Policy = _replace_binding(policy, binding,
+ updated_binding)
+ self.set_service_account_iam_policy(account, updated_policy)
+ logger.debug('Role %s granted to member %s for Service Account %s',
+ role, member, account)
+
+ @handle_etag_conflict
+ def remove_service_account_iam_policy_binding(self, account: str, role: str,
+ member: str) -> None:
+ """Remove an IAM policy binding from the IAM policy of a service
+ account.
+
+ See for details on updating policy bindings:
+ https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/setIamPolicy
+ """
+ policy: Policy = self.get_service_account_iam_policy(account)
+ binding: Optional[Policy.Binding] = policy.find_binding_for_role(role)
+
+ if binding is None:
+ logger.debug('Noop: Service Account %s has no bindings for role %s',
+ account, role)
+ return
+ if member not in binding.members:
+ logger.debug(
+ 'Noop: Service Account %s binding for role %s has no member %s',
+ account, role, member)
+ return
+
+ updated_members: FrozenSet[str] = binding.members.difference({member})
+ updated_binding: Policy.Binding = dataclasses.replace(
+ binding, members=updated_members)
+ updated_policy: Policy = _replace_binding(policy, binding,
+ updated_binding)
+ self.set_service_account_iam_policy(account, updated_policy)
+ logger.debug('Role %s revoked from member %s for Service Account %s',
+ role, member, account)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_security.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_security.py
index cb60840b..225969f9 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_security.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_security.py
@@ -11,9 +11,12 @@
# WITHOUT 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 abc
import dataclasses
+import logging
+from typing import Any, Dict
+
from google.rpc import code_pb2
import tenacity
@@ -21,28 +24,73 @@ from framework.infrastructure import gcp
logger = logging.getLogger(__name__)
-
-class NetworkSecurityV1Alpha1(gcp.api.GcpStandardCloudApiResource):
- SERVER_TLS_POLICIES = 'serverTlsPolicies'
- CLIENT_TLS_POLICIES = 'clientTlsPolicies'
-
- @dataclasses.dataclass(frozen=True)
- class ServerTlsPolicy:
- url: str
- name: str
- server_certificate: dict
- mtls_policy: dict
- update_time: str
- create_time: str
-
- @dataclasses.dataclass(frozen=True)
- class ClientTlsPolicy:
- url: str
- name: str
- client_certificate: dict
- server_validation_ca: list
- update_time: str
- create_time: str
+# Type aliases
+GcpResource = gcp.compute.ComputeV1.GcpResource
+
+
+@dataclasses.dataclass(frozen=True)
+class ServerTlsPolicy:
+ url: str
+ name: str
+ server_certificate: dict
+ mtls_policy: dict
+ update_time: str
+ create_time: str
+
+ @classmethod
+ def from_response(cls, name: str, response: Dict[str,
+ Any]) -> 'ServerTlsPolicy':
+ return cls(name=name,
+ url=response['name'],
+ server_certificate=response.get('serverCertificate', {}),
+ mtls_policy=response.get('mtlsPolicy', {}),
+ create_time=response['createTime'],
+ update_time=response['updateTime'])
+
+
+@dataclasses.dataclass(frozen=True)
+class ClientTlsPolicy:
+ url: str
+ name: str
+ client_certificate: dict
+ server_validation_ca: list
+ update_time: str
+ create_time: str
+
+ @classmethod
+ def from_response(cls, name: str, response: Dict[str,
+ Any]) -> 'ClientTlsPolicy':
+ return cls(name=name,
+ url=response['name'],
+ client_certificate=response.get('clientCertificate', {}),
+ server_validation_ca=response.get('serverValidationCa', []),
+ create_time=response['createTime'],
+ update_time=response['updateTime'])
+
+
+@dataclasses.dataclass(frozen=True)
+class AuthorizationPolicy:
+ url: str
+ name: str
+ update_time: str
+ create_time: str
+ action: str
+ rules: list
+
+ @classmethod
+ def from_response(cls, name: str,
+ response: Dict[str, Any]) -> 'AuthorizationPolicy':
+ return cls(name=name,
+ url=response['name'],
+ create_time=response['createTime'],
+ update_time=response['updateTime'],
+ action=response['action'],
+ rules=response.get('rules', []))
+
+
+class _NetworkSecurityBase(gcp.api.GcpStandardCloudApiResource,
+ metaclass=abc.ABCMeta):
+ """Base class for NetworkSecurity APIs."""
def __init__(self, api_manager: gcp.api.GcpApiManager, project: str):
super().__init__(api_manager.networksecurity(self.api_version), project)
@@ -53,68 +101,94 @@ class NetworkSecurityV1Alpha1(gcp.api.GcpStandardCloudApiResource):
def api_name(self) -> str:
return 'networksecurity'
+ def _execute(self, *args, **kwargs): # pylint: disable=signature-differs
+ # Workaround TD bug: throttled operations are reported as internal.
+ # Ref b/175345578
+ retryer = tenacity.Retrying(
+ retry=tenacity.retry_if_exception(self._operation_internal_error),
+ wait=tenacity.wait_fixed(10),
+ stop=tenacity.stop_after_delay(5 * 60),
+ before_sleep=tenacity.before_sleep_log(logger, logging.DEBUG),
+ reraise=True)
+ retryer(super()._execute, *args, **kwargs)
+
+ @staticmethod
+ def _operation_internal_error(exception):
+ return (isinstance(exception, gcp.api.OperationError) and
+ exception.error.code == code_pb2.INTERNAL)
+
+
+class NetworkSecurityV1Beta1(_NetworkSecurityBase):
+ """NetworkSecurity API v1beta1."""
+
+ SERVER_TLS_POLICIES = 'serverTlsPolicies'
+ CLIENT_TLS_POLICIES = 'clientTlsPolicies'
+ AUTHZ_POLICIES = 'authorizationPolicies'
+
@property
def api_version(self) -> str:
- return 'v1alpha1'
+ return 'v1beta1'
- def create_server_tls_policy(self, name, body: dict):
- return self._create_resource(self._api_locations.serverTlsPolicies(),
- body,
- serverTlsPolicyId=name)
+ def create_server_tls_policy(self, name: str, body: dict) -> GcpResource:
+ return self._create_resource(
+ collection=self._api_locations.serverTlsPolicies(),
+ body=body,
+ serverTlsPolicyId=name)
def get_server_tls_policy(self, name: str) -> ServerTlsPolicy:
- result = self._get_resource(
+ response = self._get_resource(
collection=self._api_locations.serverTlsPolicies(),
full_name=self.resource_full_name(name, self.SERVER_TLS_POLICIES))
+ return ServerTlsPolicy.from_response(name, response)
- return self.ServerTlsPolicy(name=name,
- url=result['name'],
- server_certificate=result.get(
- 'serverCertificate', {}),
- mtls_policy=result.get('mtlsPolicy', {}),
- create_time=result['createTime'],
- update_time=result['updateTime'])
-
- def delete_server_tls_policy(self, name):
+ def delete_server_tls_policy(self, name: str) -> bool:
return self._delete_resource(
collection=self._api_locations.serverTlsPolicies(),
full_name=self.resource_full_name(name, self.SERVER_TLS_POLICIES))
- def create_client_tls_policy(self, name, body: dict):
- return self._create_resource(self._api_locations.clientTlsPolicies(),
- body,
- clientTlsPolicyId=name)
+ def create_client_tls_policy(self, name: str, body: dict) -> GcpResource:
+ return self._create_resource(
+ collection=self._api_locations.clientTlsPolicies(),
+ body=body,
+ clientTlsPolicyId=name)
def get_client_tls_policy(self, name: str) -> ClientTlsPolicy:
- result = self._get_resource(
+ response = self._get_resource(
collection=self._api_locations.clientTlsPolicies(),
full_name=self.resource_full_name(name, self.CLIENT_TLS_POLICIES))
+ return ClientTlsPolicy.from_response(name, response)
- return self.ClientTlsPolicy(
- name=name,
- url=result['name'],
- client_certificate=result.get('clientCertificate', {}),
- server_validation_ca=result.get('serverValidationCa', []),
- create_time=result['createTime'],
- update_time=result['updateTime'])
-
- def delete_client_tls_policy(self, name):
+ def delete_client_tls_policy(self, name: str) -> bool:
return self._delete_resource(
collection=self._api_locations.clientTlsPolicies(),
full_name=self.resource_full_name(name, self.CLIENT_TLS_POLICIES))
- def _execute(self, *args, **kwargs): # pylint: disable=signature-differs
- # Workaround TD bug: throttled operations are reported as internal.
- # Ref b/175345578
- retryer = tenacity.Retrying(
- retry=tenacity.retry_if_exception(self._operation_internal_error),
- wait=tenacity.wait_fixed(10),
- stop=tenacity.stop_after_delay(5 * 60),
- before_sleep=tenacity.before_sleep_log(logger, logging.DEBUG),
- reraise=True)
- retryer(super()._execute, *args, **kwargs)
+ def create_authz_policy(self, name: str, body: dict) -> GcpResource:
+ return self._create_resource(
+ collection=self._api_locations.authorizationPolicies(),
+ body=body,
+ authorizationPolicyId=name)
- @staticmethod
- def _operation_internal_error(exception):
- return (isinstance(exception, gcp.api.OperationError) and
- exception.error.code == code_pb2.INTERNAL)
+ def get_authz_policy(self, name: str) -> ClientTlsPolicy:
+ response = self._get_resource(
+ collection=self._api_locations.authorizationPolicies(),
+ full_name=self.resource_full_name(name, self.AUTHZ_POLICIES))
+ return ClientTlsPolicy.from_response(name, response)
+
+ def delete_authz_policy(self, name: str) -> bool:
+ return self._delete_resource(
+ collection=self._api_locations.authorizationPolicies(),
+ full_name=self.resource_full_name(name, self.AUTHZ_POLICIES))
+
+
+class NetworkSecurityV1Alpha1(NetworkSecurityV1Beta1):
+ """NetworkSecurity API v1alpha1.
+
+ Note: extending v1beta1 class presumes that v1beta1 is just a v1alpha1 API
+ graduated into a more stable version. This is true in most cases. However,
+ v1alpha1 class can always override and reimplement incompatible methods.
+ """
+
+ @property
+ def api_version(self) -> str:
+ return 'v1alpha1'
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_services.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_services.py
index b331ade6..80cdf6e9 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_services.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/gcp/network_services.py
@@ -11,10 +11,12 @@
# WITHOUT 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
-from typing import Optional
+import abc
import dataclasses
+import logging
+from typing import Any, Dict, List, Optional, Tuple
+
from google.rpc import code_pb2
import tenacity
@@ -22,21 +24,167 @@ from framework.infrastructure import gcp
logger = logging.getLogger(__name__)
+# Type aliases
+GcpResource = gcp.compute.ComputeV1.GcpResource
+
+
+@dataclasses.dataclass(frozen=True)
+class EndpointPolicy:
+ url: str
+ name: str
+ type: str
+ traffic_port_selector: dict
+ endpoint_matcher: dict
+ update_time: str
+ create_time: str
+ http_filters: Optional[dict] = None
+ server_tls_policy: Optional[str] = None
+
+ @classmethod
+ def from_response(cls, name: str, response: Dict[str,
+ Any]) -> 'EndpointPolicy':
+ return cls(name=name,
+ url=response['name'],
+ type=response['type'],
+ server_tls_policy=response.get('serverTlsPolicy', None),
+ traffic_port_selector=response['trafficPortSelector'],
+ endpoint_matcher=response['endpointMatcher'],
+ http_filters=response.get('httpFilters', None),
+ update_time=response['updateTime'],
+ create_time=response['createTime'])
+
+
+@dataclasses.dataclass(frozen=True)
+class Mesh:
+
+ name: str
+ url: str
+ type: str
+ scope: Optional[str]
+ network: Optional[str]
+ routes: Optional[List[str]]
+
+ @classmethod
+ def from_response(cls, name: str, d: Dict[str, Any]) -> 'Mesh':
+ return cls(
+ name=name,
+ url=d["name"],
+ type=d["type"],
+ scope=d.get("scope"),
+ network=d.get("network"),
+ routes=list(d["routes"]) if "routes" in d else None,
+ )
+
+
+@dataclasses.dataclass(frozen=True)
+class GrpcRoute:
+
+ @dataclasses.dataclass(frozen=True)
+ class MethodMatch:
+ type: Optional[str]
+ grpc_service: Optional[str]
+ grpc_method: Optional[str]
+ case_sensitive: Optional[bool]
+
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'MethodMatch':
+ return cls(
+ type=d.get("type"),
+ grpc_service=d.get("grpcService"),
+ grpc_method=d.get("grpcMethod"),
+ case_sensitive=d.get("caseSensitive"),
+ )
+
+ @dataclasses.dataclass(frozen=True)
+ class HeaderMatch:
+ type: Optional[str]
+ key: str
+ value: str
-class NetworkServicesV1Alpha1(gcp.api.GcpStandardCloudApiResource):
- ENDPOINT_CONFIG_SELECTORS = 'endpointConfigSelectors'
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'HeaderMatch':
+ return cls(
+ type=d.get("type"),
+ key=d["key"],
+ value=d["value"],
+ )
@dataclasses.dataclass(frozen=True)
- class EndpointConfigSelector:
- url: str
- name: str
- type: str
- server_tls_policy: Optional[str]
- traffic_port_selector: dict
- endpoint_matcher: dict
- http_filters: dict
- update_time: str
- create_time: str
+ class RouteMatch:
+ method: Optional['MethodMatch']
+ headers: Tuple['HeaderMatch']
+
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'RouteMatch':
+ return cls(
+ method=MethodMatch.from_response(d["method"])
+ if "method" in d else None,
+ headers=tuple(
+ HeaderMatch.from_response(h) for h in d["headers"])
+ if "headers" in d else (),
+ )
+
+ @dataclasses.dataclass(frozen=True)
+ class Destination:
+ service_name: str
+ weight: Optional[int]
+
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'Destination':
+ return cls(
+ service_name=d["serviceName"],
+ weight=d.get("weight"),
+ )
+
+ @dataclasses.dataclass(frozen=True)
+ class RouteAction:
+ destinations: List['Destination']
+ drop: Optional[int]
+
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'RouteAction':
+ destinations = [
+ Destination.from_response(dest) for dest in d["destinations"]
+ ] if "destinations" in d else []
+ return cls(
+ destinations=destinations,
+ drop=d.get("drop"),
+ )
+
+ @dataclasses.dataclass(frozen=True)
+ class RouteRule:
+ matches: List['RouteMatch']
+ action: 'RouteAction'
+
+ @classmethod
+ def from_response(cls, d: Dict[str, Any]) -> 'RouteRule':
+ matches = [RouteMatch.from_response(m) for m in d["matches"]
+ ] if "matches" in d else []
+ return cls(
+ matches=matches,
+ action=RouteAction.from_response(d["action"]),
+ )
+
+ name: str
+ url: str
+ hostnames: Tuple[str]
+ rules: Tuple['RouteRule']
+ meshes: Optional[Tuple[str]]
+
+ @classmethod
+ def from_response(cls, name: str, d: Dict[str, Any]) -> 'RouteRule':
+ return cls(
+ name=name,
+ url=d["name"],
+ hostnames=tuple(d["hostnames"]),
+ rules=tuple(d["rules"]),
+ meshes=None if d.get("meshes") is None else tuple(d["meshes"]),
+ )
+
+
+class _NetworkServicesBase(gcp.api.GcpStandardCloudApiResource,
+ metaclass=abc.ABCMeta):
+ """Base class for NetworkServices APIs."""
def __init__(self, api_manager: gcp.api.GcpApiManager, project: str):
super().__init__(api_manager.networkservices(self.api_version), project)
@@ -47,38 +195,6 @@ class NetworkServicesV1Alpha1(gcp.api.GcpStandardCloudApiResource):
def api_name(self) -> str:
return 'networkservices'
- @property
- def api_version(self) -> str:
- return 'v1alpha1'
-
- def create_endpoint_config_selector(self, name, body: dict):
- return self._create_resource(
- self._api_locations.endpointConfigSelectors(),
- body,
- endpointConfigSelectorId=name)
-
- def get_endpoint_config_selector(self, name: str) -> EndpointConfigSelector:
- result = self._get_resource(
- collection=self._api_locations.endpointConfigSelectors(),
- full_name=self.resource_full_name(name,
- self.ENDPOINT_CONFIG_SELECTORS))
- return self.EndpointConfigSelector(
- name=name,
- url=result['name'],
- type=result['type'],
- server_tls_policy=result.get('serverTlsPolicy', None),
- traffic_port_selector=result['trafficPortSelector'],
- endpoint_matcher=result['endpointMatcher'],
- http_filters=result['httpFilters'],
- update_time=result['updateTime'],
- create_time=result['createTime'])
-
- def delete_endpoint_config_selector(self, name):
- return self._delete_resource(
- collection=self._api_locations.endpointConfigSelectors(),
- full_name=self.resource_full_name(name,
- self.ENDPOINT_CONFIG_SELECTORS))
-
def _execute(self, *args, **kwargs): # pylint: disable=signature-differs
# Workaround TD bug: throttled operations are reported as internal.
# Ref b/175345578
@@ -94,3 +210,78 @@ class NetworkServicesV1Alpha1(gcp.api.GcpStandardCloudApiResource):
def _operation_internal_error(exception):
return (isinstance(exception, gcp.api.OperationError) and
exception.error.code == code_pb2.INTERNAL)
+
+
+class NetworkServicesV1Beta1(_NetworkServicesBase):
+ """NetworkServices API v1beta1."""
+ ENDPOINT_POLICIES = 'endpointPolicies'
+
+ @property
+ def api_version(self) -> str:
+ return 'v1beta1'
+
+ def create_endpoint_policy(self, name, body: dict) -> GcpResource:
+ return self._create_resource(
+ collection=self._api_locations.endpointPolicies(),
+ body=body,
+ endpointPolicyId=name)
+
+ def get_endpoint_policy(self, name: str) -> EndpointPolicy:
+ response = self._get_resource(
+ collection=self._api_locations.endpointPolicies(),
+ full_name=self.resource_full_name(name, self.ENDPOINT_POLICIES))
+ return EndpointPolicy.from_response(name, response)
+
+ def delete_endpoint_policy(self, name: str) -> bool:
+ return self._delete_resource(
+ collection=self._api_locations.endpointPolicies(),
+ full_name=self.resource_full_name(name, self.ENDPOINT_POLICIES))
+
+
+class NetworkServicesV1Alpha1(NetworkServicesV1Beta1):
+ """NetworkServices API v1alpha1.
+
+ Note: extending v1beta1 class presumes that v1beta1 is just a v1alpha1 API
+ graduated into a more stable version. This is true in most cases. However,
+ v1alpha1 class can always override and reimplement incompatible methods.
+ """
+
+ GRPC_ROUTES = 'grpcRoutes'
+ MESHES = 'meshes'
+
+ @property
+ def api_version(self) -> str:
+ return 'v1alpha1'
+
+ def create_mesh(self, name: str, body: dict) -> GcpResource:
+ return self._create_resource(collection=self._api_locations.meshes(),
+ body=body,
+ meshId=name)
+
+ def get_mesh(self, name: str) -> Mesh:
+ full_name = self.resource_full_name(name, self.MESHES)
+ result = self._get_resource(collection=self._api_locations.meshes(),
+ full_name=full_name)
+ return Mesh.from_response(name, result)
+
+ def delete_mesh(self, name: str) -> bool:
+ return self._delete_resource(collection=self._api_locations.meshes(),
+ full_name=self.resource_full_name(
+ name, self.MESHES))
+
+ def create_grpc_route(self, name: str, body: dict) -> GcpResource:
+ return self._create_resource(
+ collection=self._api_locations.grpcRoutes(),
+ body=body,
+ grpcRouteId=name)
+
+ def get_grpc_route(self, name: str) -> GrpcRoute:
+ full_name = self.resource_full_name(name, self.GRPC_ROUTES)
+ result = self._get_resource(collection=self._api_locations.grpcRoutes(),
+ full_name=full_name)
+ return GrpcRoute.from_response(name, result)
+
+ def delete_grpc_route(self, name: str) -> bool:
+ return self._delete_resource(
+ collection=self._api_locations.grpcRoutes(),
+ full_name=self.resource_full_name(name, self.GRPC_ROUTES))
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py
index 557c424f..3d389696 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/k8s.py
@@ -14,15 +14,16 @@
import functools
import json
import logging
+import re
import subprocess
import time
-from typing import Optional, List, Tuple
+from typing import List, Optional, Tuple
-# TODO(sergiitk): replace with tenacity
-import retrying
-import kubernetes.config
from kubernetes import client
from kubernetes import utils
+import kubernetes.config
+# TODO(sergiitk): replace with tenacity
+import retrying
logger = logging.getLogger(__name__)
# Type aliases
@@ -78,9 +79,96 @@ class PortForwardingError(Exception):
"""Error forwarding port"""
+class PortForwarder:
+ PORT_FORWARD_LOCAL_ADDRESS: str = '127.0.0.1'
+
+ def __init__(self,
+ context: str,
+ namespace: str,
+ destination: str,
+ remote_port: int,
+ local_port: Optional[int] = None,
+ local_address: Optional[str] = None):
+ self.context = context
+ self.namespace = namespace
+ self.destination = destination
+ self.remote_port = remote_port
+ self.local_address = local_address or self.PORT_FORWARD_LOCAL_ADDRESS
+ self.local_port: Optional[int] = local_port
+ self.subprocess: Optional[subprocess.Popen] = None
+
+ def connect(self) -> None:
+ port_mapping = f"{self.local_port}:{self.remote_port}" if self.local_port else f":{self.remote_port}"
+ cmd = [
+ "kubectl", "--context", self.context, "--namespace", self.namespace,
+ "port-forward", "--address", self.local_address, self.destination,
+ port_mapping
+ ]
+ self.subprocess = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ universal_newlines=True)
+ # Wait for stdout line indicating successful start.
+ if self.local_port:
+ local_port_expected = (
+ f"Forwarding from {self.local_address}:{self.local_port}"
+ f" -> {self.remote_port}")
+ else:
+ local_port_re = re.compile(
+ f"Forwarding from {self.local_address}:([0-9]+) -> {self.remote_port}"
+ )
+ try:
+ while True:
+ time.sleep(0.05)
+ output = self.subprocess.stdout.readline().strip()
+ if not output:
+ return_code = self.subprocess.poll()
+ if return_code is not None:
+ errors = [
+ error
+ for error in self.subprocess.stdout.readlines()
+ ]
+ raise PortForwardingError(
+ 'Error forwarding port, kubectl return '
+ f'code {return_code}, output {errors}')
+ # If there is no output, and the subprocess is not exiting,
+ # continue waiting for the log line.
+ continue
+
+ # Validate output log
+ if self.local_port:
+ if output != local_port_expected:
+ raise PortForwardingError(
+ f'Error forwarding port, unexpected output {output}'
+ )
+ else:
+ groups = local_port_re.search(output)
+ if groups is None:
+ raise PortForwardingError(
+ f'Error forwarding port, unexpected output {output}'
+ )
+ # Update local port to the randomly picked one
+ self.local_port = int(groups[1])
+
+ logger.info(output)
+ break
+ except Exception:
+ self.close()
+ raise
+
+ def close(self) -> None:
+ if self.subprocess is not None:
+ logger.info('Shutting down port forwarding, pid %s',
+ self.subprocess.pid)
+ self.subprocess.kill()
+ stdout, _ = self.subprocess.communicate(timeout=5)
+ logger.info('Port forwarding stopped')
+ logger.debug('Port forwarding remaining stdout: %s', stdout)
+ self.subprocess = None
+
+
class KubernetesNamespace:
NEG_STATUS_META = 'cloud.google.com/neg-status'
- PORT_FORWARD_LOCAL_ADDRESS: str = '127.0.0.1'
DELETE_GRACE_PERIOD_SEC: int = 5
WAIT_SHORT_TIMEOUT_SEC: int = 60
WAIT_SHORT_SLEEP_SEC: int = 1
@@ -302,55 +390,14 @@ class KubernetesNamespace:
remote_port: int,
local_port: Optional[int] = None,
local_address: Optional[str] = None,
- ) -> subprocess.Popen:
- """Experimental"""
- local_address = local_address or self.PORT_FORWARD_LOCAL_ADDRESS
- local_port = local_port or remote_port
- cmd = [
- "kubectl", "--context", self.api.context, "--namespace", self.name,
- "port-forward", "--address", local_address,
- f"pod/{pod.metadata.name}", f"{local_port}:{remote_port}"
- ]
- pf = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- universal_newlines=True)
- # Wait for stdout line indicating successful start.
- expected = (f"Forwarding from {local_address}:{local_port}"
- f" -> {remote_port}")
- try:
- while True:
- time.sleep(0.05)
- output = pf.stdout.readline().strip()
- if not output:
- return_code = pf.poll()
- if return_code is not None:
- errors = [error for error in pf.stdout.readlines()]
- raise PortForwardingError(
- 'Error forwarding port, kubectl return '
- f'code {return_code}, output {errors}')
- elif output != expected:
- raise PortForwardingError(
- f'Error forwarding port, unexpected output {output}')
- else:
- logger.info(output)
- break
- except Exception:
- self.port_forward_stop(pf)
- raise
-
- # TODO(sergiitk): return new PortForwarder object
+ ) -> PortForwarder:
+ pf = PortForwarder(self.api.context, self.name,
+ f"pod/{pod.metadata.name}", remote_port, local_port,
+ local_address)
+ pf.connect()
return pf
@staticmethod
- def port_forward_stop(pf):
- logger.info('Shutting down port forwarding, pid %s', pf.pid)
- pf.kill()
- stdout, _stderr = pf.communicate(timeout=5)
- logger.info('Port forwarding stopped')
- logger.debug('Port forwarding remaining stdout: %s', stdout)
-
- @staticmethod
def _pod_started(pod: V1Pod):
return pod.status.phase not in ('Pending', 'Unknown')
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py
index 531c0c2b..121922f1 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/infrastructure/traffic_director.py
@@ -11,9 +11,12 @@
# WITHOUT 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 functools
import logging
-from typing import Optional, Set
+import random
+from typing import Any, Dict, List, Optional, Set
+from framework import xds_flags
from framework.infrastructure import gcp
logger = logging.getLogger(__name__)
@@ -29,23 +32,37 @@ _BackendGRPC = BackendServiceProtocol.GRPC
_HealthCheckGRPC = HealthCheckProtocol.GRPC
# Network Security
-_NetworkSecurityV1Alpha1 = gcp.network_security.NetworkSecurityV1Alpha1
-ServerTlsPolicy = _NetworkSecurityV1Alpha1.ServerTlsPolicy
-ClientTlsPolicy = _NetworkSecurityV1Alpha1.ClientTlsPolicy
+_NetworkSecurityV1Beta1 = gcp.network_security.NetworkSecurityV1Beta1
+ServerTlsPolicy = gcp.network_security.ServerTlsPolicy
+ClientTlsPolicy = gcp.network_security.ClientTlsPolicy
+AuthorizationPolicy = gcp.network_security.AuthorizationPolicy
# Network Services
_NetworkServicesV1Alpha1 = gcp.network_services.NetworkServicesV1Alpha1
-EndpointConfigSelector = _NetworkServicesV1Alpha1.EndpointConfigSelector
+_NetworkServicesV1Beta1 = gcp.network_services.NetworkServicesV1Beta1
+EndpointPolicy = gcp.network_services.EndpointPolicy
+
+# Testing metadata consts
+TEST_AFFINITY_METADATA_KEY = 'xds_md'
class TrafficDirectorManager:
compute: _ComputeV1
+ resource_prefix: str
+ resource_suffix: str
+
BACKEND_SERVICE_NAME = "backend-service"
+ ALTERNATIVE_BACKEND_SERVICE_NAME = "backend-service-alt"
+ AFFINITY_BACKEND_SERVICE_NAME = "backend-service-affinity"
HEALTH_CHECK_NAME = "health-check"
URL_MAP_NAME = "url-map"
+ ALTERNATIVE_URL_MAP_NAME = "url-map-alt"
URL_MAP_PATH_MATCHER_NAME = "path-matcher"
TARGET_PROXY_NAME = "target-proxy"
+ ALTERNATIVE_TARGET_PROXY_NAME = "target-proxy-alt"
FORWARDING_RULE_NAME = "forwarding-rule"
+ ALTERNATIVE_FORWARDING_RULE_NAME = "forwarding-rule-alt"
+ FIREWALL_RULE_NAME = "allow-health-checks"
def __init__(
self,
@@ -53,15 +70,20 @@ class TrafficDirectorManager:
project: str,
*,
resource_prefix: str,
+ resource_suffix: str,
network: str = 'default',
+ compute_api_version: str = 'v1',
):
# API
- self.compute = _ComputeV1(gcp_api_manager, project)
+ self.compute = _ComputeV1(gcp_api_manager,
+ project,
+ version=compute_api_version)
# Settings
self.project: str = project
self.network: str = network
self.resource_prefix: str = resource_prefix
+ self.resource_suffix: str = resource_suffix
# Managed resources
self.health_check: Optional[GcpResource] = None
@@ -69,11 +91,25 @@ class TrafficDirectorManager:
# TODO(sergiitk): remove this flag once backend service resource loaded
self.backend_service_protocol: Optional[BackendServiceProtocol] = None
self.url_map: Optional[GcpResource] = None
+ self.alternative_url_map: Optional[GcpResource] = None
+ self.firewall_rule: Optional[GcpResource] = None
self.target_proxy: Optional[GcpResource] = None
# TODO(sergiitk): remove this flag once target proxy resource loaded
self.target_proxy_is_http: bool = False
+ self.alternative_target_proxy: Optional[GcpResource] = None
self.forwarding_rule: Optional[GcpResource] = None
+ self.alternative_forwarding_rule: Optional[GcpResource] = None
self.backends: Set[ZonalGcpResource] = set()
+ self.alternative_backend_service: Optional[GcpResource] = None
+ # TODO(sergiitk): remove this flag once backend service resource loaded
+ self.alternative_backend_service_protocol: Optional[
+ BackendServiceProtocol] = None
+ self.alternative_backends: Set[ZonalGcpResource] = set()
+ self.affinity_backend_service: Optional[GcpResource] = None
+ # TODO(sergiitk): remove this flag once backend service resource loaded
+ self.affinity_backend_service_protocol: Optional[
+ BackendServiceProtocol] = None
+ self.affinity_backends: Set[ZonalGcpResource] = set()
@property
def network_url(self):
@@ -106,16 +142,25 @@ class TrafficDirectorManager:
def cleanup(self, *, force=False):
# Cleanup in the reverse order of creation
self.delete_forwarding_rule(force=force)
- if self.target_proxy_is_http:
- self.delete_target_http_proxy(force=force)
- else:
- self.delete_target_grpc_proxy(force=force)
+ self.delete_alternative_forwarding_rule(force=force)
+ self.delete_target_http_proxy(force=force)
+ self.delete_target_grpc_proxy(force=force)
+ self.delete_alternative_target_grpc_proxy(force=force)
self.delete_url_map(force=force)
+ self.delete_alternative_url_map(force=force)
self.delete_backend_service(force=force)
+ self.delete_alternative_backend_service(force=force)
+ self.delete_affinity_backend_service(force=force)
self.delete_health_check(force=force)
- def _ns_name(self, name):
- return f'{self.resource_prefix}-{name}'
+ @functools.lru_cache(None)
+ def make_resource_name(self, name: str) -> str:
+ """Make dash-separated resource name with resource prefix and suffix."""
+ parts = [self.resource_prefix, name]
+ # Avoid trailing dash when the suffix is empty.
+ if self.resource_suffix:
+ parts.append(self.resource_suffix)
+ return '-'.join(parts)
def create_health_check(
self,
@@ -128,14 +173,14 @@ class TrafficDirectorManager:
if protocol is None:
protocol = _HealthCheckGRPC
- name = self._ns_name(self.HEALTH_CHECK_NAME)
+ name = self.make_resource_name(self.HEALTH_CHECK_NAME)
logger.info('Creating %s Health Check "%s"', protocol.name, name)
resource = self.compute.create_health_check(name, protocol, port=port)
self.health_check = resource
def delete_health_check(self, force=False):
if force:
- name = self._ns_name(self.HEALTH_CHECK_NAME)
+ name = self.make_resource_name(self.HEALTH_CHECK_NAME)
elif self.health_check:
name = self.health_check.name
else:
@@ -145,25 +190,32 @@ class TrafficDirectorManager:
self.health_check = None
def create_backend_service(
- self, protocol: Optional[BackendServiceProtocol] = _BackendGRPC):
+ self,
+ protocol: Optional[BackendServiceProtocol] = _BackendGRPC,
+ subset_size: Optional[int] = None,
+ affinity_header: Optional[str] = None):
if protocol is None:
protocol = _BackendGRPC
- name = self._ns_name(self.BACKEND_SERVICE_NAME)
+ name = self.make_resource_name(self.BACKEND_SERVICE_NAME)
logger.info('Creating %s Backend Service "%s"', protocol.name, name)
resource = self.compute.create_backend_service_traffic_director(
- name, health_check=self.health_check, protocol=protocol)
+ name,
+ health_check=self.health_check,
+ protocol=protocol,
+ subset_size=subset_size,
+ affinity_header=affinity_header)
self.backend_service = resource
self.backend_service_protocol = protocol
def load_backend_service(self):
- name = self._ns_name(self.BACKEND_SERVICE_NAME)
+ name = self.make_resource_name(self.BACKEND_SERVICE_NAME)
resource = self.compute.get_backend_service_traffic_director(name)
self.backend_service = resource
def delete_backend_service(self, force=False):
if force:
- name = self._ns_name(self.BACKEND_SERVICE_NAME)
+ name = self.make_resource_name(self.BACKEND_SERVICE_NAME)
elif self.backend_service:
name = self.backend_service.name
else:
@@ -172,20 +224,35 @@ class TrafficDirectorManager:
self.compute.delete_backend_service(name)
self.backend_service = None
- def backend_service_add_neg_backends(self, name, zones):
+ def backend_service_add_neg_backends(self,
+ name,
+ zones,
+ max_rate_per_endpoint: Optional[
+ int] = None):
logger.info('Waiting for Network Endpoint Groups to load endpoints.')
for zone in zones:
backend = self.compute.wait_for_network_endpoint_group(name, zone)
logger.info('Loaded NEG "%s" in zone %s', backend.name,
backend.zone)
self.backends.add(backend)
- self.backend_service_add_backends()
+ self.backend_service_patch_backends(max_rate_per_endpoint)
- def backend_service_add_backends(self):
+ def backend_service_remove_neg_backends(self, name, zones):
+ logger.info('Waiting for Network Endpoint Groups to load endpoints.')
+ for zone in zones:
+ backend = self.compute.wait_for_network_endpoint_group(name, zone)
+ logger.info('Loaded NEG "%s" in zone %s', backend.name,
+ backend.zone)
+ self.backends.remove(backend)
+ self.backend_service_patch_backends()
+
+ def backend_service_patch_backends(
+ self, max_rate_per_endpoint: Optional[int] = None):
logging.info('Adding backends to Backend Service %s: %r',
self.backend_service.name, self.backends)
- self.compute.backend_service_add_backends(self.backend_service,
- self.backends)
+ self.compute.backend_service_patch_backends(self.backend_service,
+ self.backends,
+ max_rate_per_endpoint)
def backend_service_remove_all_backends(self):
logging.info('Removing backends from Backend Service %s',
@@ -199,25 +266,181 @@ class TrafficDirectorManager:
self.compute.wait_for_backends_healthy_status(self.backend_service,
self.backends)
- def create_url_map(
+ def create_alternative_backend_service(
+ self, protocol: Optional[BackendServiceProtocol] = _BackendGRPC):
+ if protocol is None:
+ protocol = _BackendGRPC
+ name = self.make_resource_name(self.ALTERNATIVE_BACKEND_SERVICE_NAME)
+ logger.info('Creating %s Alternative Backend Service "%s"',
+ protocol.name, name)
+ resource = self.compute.create_backend_service_traffic_director(
+ name, health_check=self.health_check, protocol=protocol)
+ self.alternative_backend_service = resource
+ self.alternative_backend_service_protocol = protocol
+
+ def load_alternative_backend_service(self):
+ name = self.make_resource_name(self.ALTERNATIVE_BACKEND_SERVICE_NAME)
+ resource = self.compute.get_backend_service_traffic_director(name)
+ self.alternative_backend_service = resource
+
+ def delete_alternative_backend_service(self, force=False):
+ if force:
+ name = self.make_resource_name(
+ self.ALTERNATIVE_BACKEND_SERVICE_NAME)
+ elif self.alternative_backend_service:
+ name = self.alternative_backend_service.name
+ else:
+ return
+ logger.info('Deleting Alternative Backend Service "%s"', name)
+ self.compute.delete_backend_service(name)
+ self.alternative_backend_service = None
+
+ def alternative_backend_service_add_neg_backends(self, name, zones):
+ logger.info('Waiting for Network Endpoint Groups to load endpoints.')
+ for zone in zones:
+ backend = self.compute.wait_for_network_endpoint_group(name, zone)
+ logger.info('Loaded NEG "%s" in zone %s', backend.name,
+ backend.zone)
+ self.alternative_backends.add(backend)
+ self.alternative_backend_service_patch_backends()
+
+ def alternative_backend_service_patch_backends(self):
+ logging.info('Adding backends to Backend Service %s: %r',
+ self.alternative_backend_service.name,
+ self.alternative_backends)
+ self.compute.backend_service_patch_backends(
+ self.alternative_backend_service, self.alternative_backends)
+
+ def alternative_backend_service_remove_all_backends(self):
+ logging.info('Removing backends from Backend Service %s',
+ self.alternative_backend_service.name)
+ self.compute.backend_service_remove_all_backends(
+ self.alternative_backend_service)
+
+ def wait_for_alternative_backends_healthy_status(self):
+ logger.debug(
+ "Waiting for Backend Service %s to report all backends healthy %r",
+ self.alternative_backend_service, self.alternative_backends)
+ self.compute.wait_for_backends_healthy_status(
+ self.alternative_backend_service, self.alternative_backends)
+
+ def create_affinity_backend_service(
+ self, protocol: Optional[BackendServiceProtocol] = _BackendGRPC):
+ if protocol is None:
+ protocol = _BackendGRPC
+ name = self.make_resource_name(self.AFFINITY_BACKEND_SERVICE_NAME)
+ logger.info('Creating %s Affinity Backend Service "%s"', protocol.name,
+ name)
+ resource = self.compute.create_backend_service_traffic_director(
+ name,
+ health_check=self.health_check,
+ protocol=protocol,
+ affinity_header=TEST_AFFINITY_METADATA_KEY)
+ self.affinity_backend_service = resource
+ self.affinity_backend_service_protocol = protocol
+
+ def load_affinity_backend_service(self):
+ name = self.make_resource_name(self.AFFINITY_BACKEND_SERVICE_NAME)
+ resource = self.compute.get_backend_service_traffic_director(name)
+ self.affinity_backend_service = resource
+
+ def delete_affinity_backend_service(self, force=False):
+ if force:
+ name = self.make_resource_name(self.AFFINITY_BACKEND_SERVICE_NAME)
+ elif self.affinity_backend_service:
+ name = self.affinity_backend_service.name
+ else:
+ return
+ logger.info('Deleting Affinity Backend Service "%s"', name)
+ self.compute.delete_backend_service(name)
+ self.affinity_backend_service = None
+
+ def affinity_backend_service_add_neg_backends(self, name, zones):
+ logger.info('Waiting for Network Endpoint Groups to load endpoints.')
+ for zone in zones:
+ backend = self.compute.wait_for_network_endpoint_group(name, zone)
+ logger.info('Loaded NEG "%s" in zone %s', backend.name,
+ backend.zone)
+ self.affinity_backends.add(backend)
+ self.affinity_backend_service_patch_backends()
+
+ def affinity_backend_service_patch_backends(self):
+ logging.info('Adding backends to Backend Service %s: %r',
+ self.affinity_backend_service.name, self.affinity_backends)
+ self.compute.backend_service_patch_backends(
+ self.affinity_backend_service, self.affinity_backends)
+
+ def affinity_backend_service_remove_all_backends(self):
+ logging.info('Removing backends from Backend Service %s',
+ self.affinity_backend_service.name)
+ self.compute.backend_service_remove_all_backends(
+ self.affinity_backend_service)
+
+ def wait_for_affinity_backends_healthy_status(self):
+ logger.debug(
+ "Waiting for Backend Service %s to report all backends healthy %r",
+ self.affinity_backend_service, self.affinity_backends)
+ self.compute.wait_for_backends_healthy_status(
+ self.affinity_backend_service, self.affinity_backends)
+
+ def _generate_url_map_body(
self,
- src_host: str,
- src_port: int,
- ) -> GcpResource:
+ name: str,
+ matcher_name: str,
+ src_hosts,
+ dst_default_backend_service: GcpResource,
+ dst_host_rule_match_backend_service: Optional[GcpResource] = None,
+ ) -> Dict[str, Any]:
+ if dst_host_rule_match_backend_service is None:
+ dst_host_rule_match_backend_service = dst_default_backend_service
+ return {
+ 'name':
+ name,
+ 'defaultService':
+ dst_default_backend_service.url,
+ 'hostRules': [{
+ 'hosts': src_hosts,
+ 'pathMatcher': matcher_name,
+ }],
+ 'pathMatchers': [{
+ 'name': matcher_name,
+ 'defaultService': dst_host_rule_match_backend_service.url,
+ }],
+ }
+
+ def create_url_map(self, src_host: str, src_port: int) -> GcpResource:
src_address = f'{src_host}:{src_port}'
- name = self._ns_name(self.URL_MAP_NAME)
- matcher_name = self._ns_name(self.URL_MAP_PATH_MATCHER_NAME)
+ name = self.make_resource_name(self.URL_MAP_NAME)
+ matcher_name = self.make_resource_name(self.URL_MAP_PATH_MATCHER_NAME)
logger.info('Creating URL map "%s": %s -> %s', name, src_address,
self.backend_service.name)
- resource = self.compute.create_url_map(name, matcher_name,
- [src_address],
- self.backend_service)
+ resource = self.compute.create_url_map_with_content(
+ self._generate_url_map_body(name, matcher_name, [src_address],
+ self.backend_service))
+ self.url_map = resource
+ return resource
+
+ def patch_url_map(self, src_host: str, src_port: int,
+ backend_service: GcpResource):
+ src_address = f'{src_host}:{src_port}'
+ name = self.make_resource_name(self.URL_MAP_NAME)
+ matcher_name = self.make_resource_name(self.URL_MAP_PATH_MATCHER_NAME)
+ logger.info('Patching URL map "%s": %s -> %s', name, src_address,
+ backend_service.name)
+ self.compute.patch_url_map(
+ self.url_map,
+ self._generate_url_map_body(name, matcher_name, [src_address],
+ backend_service))
+
+ def create_url_map_with_content(self, url_map_body: Any) -> GcpResource:
+ logger.info('Creating URL map: %s', url_map_body)
+ resource = self.compute.create_url_map_with_content(url_map_body)
self.url_map = resource
return resource
def delete_url_map(self, force=False):
if force:
- name = self._ns_name(self.URL_MAP_NAME)
+ name = self.make_resource_name(self.URL_MAP_NAME)
elif self.url_map:
name = self.url_map.name
else:
@@ -226,8 +449,37 @@ class TrafficDirectorManager:
self.compute.delete_url_map(name)
self.url_map = None
+ def create_alternative_url_map(
+ self,
+ src_host: str,
+ src_port: int,
+ backend_service: Optional[GcpResource] = None) -> GcpResource:
+ name = self.make_resource_name(self.ALTERNATIVE_URL_MAP_NAME)
+ src_address = f'{src_host}:{src_port}'
+ matcher_name = self.make_resource_name(self.URL_MAP_PATH_MATCHER_NAME)
+ if backend_service is None:
+ backend_service = self.alternative_backend_service
+ logger.info('Creating alternative URL map "%s": %s -> %s', name,
+ src_address, backend_service.name)
+ resource = self.compute.create_url_map_with_content(
+ self._generate_url_map_body(name, matcher_name, [src_address],
+ backend_service))
+ self.alternative_url_map = resource
+ return resource
+
+ def delete_alternative_url_map(self, force=False):
+ if force:
+ name = self.make_resource_name(self.ALTERNATIVE_URL_MAP_NAME)
+ elif self.alternative_url_map:
+ name = self.alternative_url_map.name
+ else:
+ return
+ logger.info('Deleting alternative URL Map "%s"', name)
+ self.compute.delete_url_map(name)
+ self.url_map = None
+
def create_target_proxy(self):
- name = self._ns_name(self.TARGET_PROXY_NAME)
+ name = self.make_resource_name(self.TARGET_PROXY_NAME)
if self.backend_service_protocol is BackendServiceProtocol.GRPC:
target_proxy_type = 'GRPC'
create_proxy_fn = self.compute.create_target_grpc_proxy
@@ -245,7 +497,7 @@ class TrafficDirectorManager:
def delete_target_grpc_proxy(self, force=False):
if force:
- name = self._ns_name(self.TARGET_PROXY_NAME)
+ name = self.make_resource_name(self.TARGET_PROXY_NAME)
elif self.target_proxy:
name = self.target_proxy.name
else:
@@ -257,8 +509,8 @@ class TrafficDirectorManager:
def delete_target_http_proxy(self, force=False):
if force:
- name = self._ns_name(self.TARGET_PROXY_NAME)
- elif self.target_proxy:
+ name = self.make_resource_name(self.TARGET_PROXY_NAME)
+ elif self.target_proxy and self.target_proxy_is_http:
name = self.target_proxy.name
else:
return
@@ -267,8 +519,43 @@ class TrafficDirectorManager:
self.target_proxy = None
self.target_proxy_is_http = False
+ def create_alternative_target_proxy(self):
+ name = self.make_resource_name(self.ALTERNATIVE_TARGET_PROXY_NAME)
+ if self.backend_service_protocol is BackendServiceProtocol.GRPC:
+ logger.info(
+ 'Creating alternative target GRPC proxy "%s" to URL map %s',
+ name, self.alternative_url_map.name)
+ self.alternative_target_proxy = self.compute.create_target_grpc_proxy(
+ name, self.alternative_url_map, False)
+ else:
+ raise TypeError('Unexpected backend service protocol')
+
+ def delete_alternative_target_grpc_proxy(self, force=False):
+ if force:
+ name = self.make_resource_name(self.ALTERNATIVE_TARGET_PROXY_NAME)
+ elif self.alternative_target_proxy:
+ name = self.alternative_target_proxy.name
+ else:
+ return
+ logger.info('Deleting alternative Target GRPC proxy "%s"', name)
+ self.compute.delete_target_grpc_proxy(name)
+ self.alternative_target_proxy = None
+
+ def find_unused_forwarding_rule_port(
+ self,
+ *,
+ lo: int = 1024, # To avoid confusion, skip well-known ports.
+ hi: int = 65535,
+ attempts: int = 25) -> int:
+ for attempts in range(attempts):
+ src_port = random.randint(lo, hi)
+ if not (self.compute.exists_forwarding_rule(src_port)):
+ return src_port
+ # TODO(sergiitk): custom exception
+ raise RuntimeError("Couldn't find unused forwarding rule port")
+
def create_forwarding_rule(self, src_port: int):
- name = self._ns_name(self.FORWARDING_RULE_NAME)
+ name = self.make_resource_name(self.FORWARDING_RULE_NAME)
src_port = int(src_port)
logging.info(
'Creating forwarding rule "%s" in network "%s": 0.0.0.0:%s -> %s',
@@ -281,7 +568,7 @@ class TrafficDirectorManager:
def delete_forwarding_rule(self, force=False):
if force:
- name = self._ns_name(self.FORWARDING_RULE_NAME)
+ name = self.make_resource_name(self.FORWARDING_RULE_NAME)
elif self.forwarding_rule:
name = self.forwarding_rule.name
else:
@@ -290,35 +577,198 @@ class TrafficDirectorManager:
self.compute.delete_forwarding_rule(name)
self.forwarding_rule = None
+ def create_alternative_forwarding_rule(self,
+ src_port: int,
+ ip_address='0.0.0.0'):
+ name = self.make_resource_name(self.ALTERNATIVE_FORWARDING_RULE_NAME)
+ src_port = int(src_port)
+ logging.info(
+ 'Creating alternative forwarding rule "%s" in network "%s": %s:%s -> %s',
+ name, self.network, ip_address, src_port,
+ self.alternative_target_proxy.url)
+ resource = self.compute.create_forwarding_rule(
+ name,
+ src_port,
+ self.alternative_target_proxy,
+ self.network_url,
+ ip_address=ip_address)
+ self.alternative_forwarding_rule = resource
+ return resource
+
+ def delete_alternative_forwarding_rule(self, force=False):
+ if force:
+ name = self.make_resource_name(
+ self.ALTERNATIVE_FORWARDING_RULE_NAME)
+ elif self.alternative_forwarding_rule:
+ name = self.alternative_forwarding_rule.name
+ else:
+ return
+ logger.info('Deleting alternative Forwarding rule "%s"', name)
+ self.compute.delete_forwarding_rule(name)
+ self.alternative_forwarding_rule = None
+
+ def create_firewall_rule(self, allowed_ports: List[str]):
+ name = self.make_resource_name(self.FIREWALL_RULE_NAME)
+ logging.info(
+ 'Creating firewall rule "%s" in network "%s" with allowed ports %s',
+ name, self.network, allowed_ports)
+ resource = self.compute.create_firewall_rule(
+ name, self.network_url, xds_flags.FIREWALL_SOURCE_RANGE.value,
+ allowed_ports)
+ self.firewall_rule = resource
+
+ def delete_firewall_rule(self, force=False):
+ """The firewall rule won't be automatically removed."""
+ if force:
+ name = self.make_resource_name(self.FIREWALL_RULE_NAME)
+ elif self.firewall_rule:
+ name = self.firewall_rule.name
+ else:
+ return
+ logger.info('Deleting Firewall Rule "%s"', name)
+ self.compute.delete_firewall_rule(name)
+ self.firewall_rule = None
+
+
+class TrafficDirectorAppNetManager(TrafficDirectorManager):
+
+ GRPC_ROUTE_NAME = "grpc-route"
+ MESH_NAME = "mesh"
+
+ netsvc: _NetworkServicesV1Alpha1
+
+ def __init__(self,
+ gcp_api_manager: gcp.api.GcpApiManager,
+ project: str,
+ *,
+ resource_prefix: str,
+ config_scope: str,
+ resource_suffix: Optional[str] = None,
+ network: str = 'default',
+ compute_api_version: str = 'v1'):
+ super().__init__(gcp_api_manager,
+ project,
+ resource_prefix=resource_prefix,
+ resource_suffix=resource_suffix,
+ network=network,
+ compute_api_version=compute_api_version)
+
+ self.config_scope = config_scope
+
+ # API
+ self.netsvc = _NetworkServicesV1Alpha1(gcp_api_manager, project)
+
+ # Managed resources
+ self.grpc_route: Optional[_NetworkServicesV1Alpha1.GrpcRoute] = None
+ self.mesh: Optional[_NetworkServicesV1Alpha1.Mesh] = None
+
+ def create_mesh(self) -> GcpResource:
+ name = self.make_resource_name(self.MESH_NAME)
+ logger.info("Creating Mesh %s", name)
+ body = {
+ "type": "PROXYLESS_GRPC",
+ "scope": self.config_scope,
+ }
+ resource = self.netsvc.create_mesh(name, body)
+ self.mesh = self.netsvc.get_mesh(name)
+ logger.debug("Loaded Mesh: %s", self.mesh)
+ return resource
+
+ def delete_mesh(self, force=False):
+ if force:
+ name = self.make_resource_name(self.MESH_NAME)
+ elif self.mesh:
+ name = self.mesh.name
+ else:
+ return
+ logger.info('Deleting Mesh %s', name)
+ self.netsvc.delete_mesh(name)
+ self.mesh = None
+
+ def create_grpc_route(self, src_host: str, src_port: int) -> GcpResource:
+ host = f'{src_host}:{src_port}'
+ service_name = self.netsvc.resource_full_name(self.backend_service.name,
+ "backendServices")
+ body = {
+ "meshes": [self.mesh.url],
+ "hostnames":
+ host,
+ "rules": [{
+ "action": {
+ "destinations": [{
+ "serviceName": service_name
+ }]
+ }
+ }],
+ }
+ name = self.make_resource_name(self.GRPC_ROUTE_NAME)
+ logger.info("Creating GrpcRoute %s", name)
+ resource = self.netsvc.create_grpc_route(name, body)
+ self.grpc_route = self.netsvc.get_grpc_route(name)
+ logger.debug("Loaded GrpcRoute: %s", self.grpc_route)
+ return resource
+
+ def create_grpc_route_with_content(self, body: Any) -> GcpResource:
+ name = self.make_resource_name(self.GRPC_ROUTE_NAME)
+ logger.info("Creating GrpcRoute %s", name)
+ resource = self.netsvc.create_grpc_route(name, body)
+ self.grpc_route = self.netsvc.get_grpc_route(name)
+ logger.debug("Loaded GrpcRoute: %s", self.grpc_route)
+ return resource
+
+ def delete_grpc_route(self, force=False):
+ if force:
+ name = self.make_resource_name(self.GRPC_ROUTE_NAME)
+ elif self.grpc_route:
+ name = self.grpc_route.name
+ else:
+ return
+ logger.info('Deleting GrpcRoute %s', name)
+ self.netsvc.delete_grpc_route(name)
+ self.grpc_route = None
+
+ def cleanup(self, *, force=False):
+ self.delete_grpc_route(force=force)
+ self.delete_mesh(force=force)
+ super().cleanup(force=force)
+
class TrafficDirectorSecureManager(TrafficDirectorManager):
- netsec: Optional[_NetworkSecurityV1Alpha1]
SERVER_TLS_POLICY_NAME = "server-tls-policy"
CLIENT_TLS_POLICY_NAME = "client-tls-policy"
- ENDPOINT_CONFIG_SELECTOR_NAME = "endpoint-config-selector"
+ AUTHZ_POLICY_NAME = "authz-policy"
+ ENDPOINT_POLICY = "endpoint-policy"
CERTIFICATE_PROVIDER_INSTANCE = "google_cloud_private_spiffe"
+ netsec: _NetworkSecurityV1Beta1
+ netsvc: _NetworkServicesV1Beta1
+
def __init__(
self,
gcp_api_manager: gcp.api.GcpApiManager,
project: str,
*,
resource_prefix: str,
+ resource_suffix: Optional[str] = None,
network: str = 'default',
+ compute_api_version: str = 'v1',
):
super().__init__(gcp_api_manager,
project,
resource_prefix=resource_prefix,
- network=network)
+ resource_suffix=resource_suffix,
+ network=network,
+ compute_api_version=compute_api_version)
# API
- self.netsec = _NetworkSecurityV1Alpha1(gcp_api_manager, project)
- self.netsvc = _NetworkServicesV1Alpha1(gcp_api_manager, project)
+ self.netsec = _NetworkSecurityV1Beta1(gcp_api_manager, project)
+ self.netsvc = _NetworkServicesV1Beta1(gcp_api_manager, project)
# Managed resources
self.server_tls_policy: Optional[ServerTlsPolicy] = None
- self.ecs: Optional[EndpointConfigSelector] = None
self.client_tls_policy: Optional[ClientTlsPolicy] = None
+ self.authz_policy: Optional[AuthorizationPolicy] = None
+ self.endpoint_policy: Optional[EndpointPolicy] = None
def setup_server_security(self,
*,
@@ -328,9 +778,9 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
tls=True,
mtls=True):
self.create_server_tls_policy(tls=tls, mtls=mtls)
- self.create_endpoint_config_selector(server_namespace=server_namespace,
- server_name=server_name,
- server_port=server_port)
+ self.create_endpoint_policy(server_namespace=server_namespace,
+ server_name=server_name,
+ server_port=server_port)
def setup_client_security(self,
*,
@@ -345,12 +795,13 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
def cleanup(self, *, force=False):
# Cleanup in the reverse order of creation
super().cleanup(force=force)
- self.delete_endpoint_config_selector(force=force)
+ self.delete_endpoint_policy(force=force)
self.delete_server_tls_policy(force=force)
self.delete_client_tls_policy(force=force)
+ self.delete_authz_policy(force=force)
def create_server_tls_policy(self, *, tls, mtls):
- name = self._ns_name(self.SERVER_TLS_POLICY_NAME)
+ name = self.make_resource_name(self.SERVER_TLS_POLICY_NAME)
logger.info('Creating Server TLS Policy %s', name)
if not tls and not mtls:
logger.warning(
@@ -373,7 +824,7 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
def delete_server_tls_policy(self, force=False):
if force:
- name = self._ns_name(self.SERVER_TLS_POLICY_NAME)
+ name = self.make_resource_name(self.SERVER_TLS_POLICY_NAME)
elif self.server_tls_policy:
name = self.server_tls_policy.name
else:
@@ -382,10 +833,33 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
self.netsec.delete_server_tls_policy(name)
self.server_tls_policy = None
- def create_endpoint_config_selector(self, server_namespace, server_name,
- server_port):
- name = self._ns_name(self.ENDPOINT_CONFIG_SELECTOR_NAME)
- logger.info('Creating Endpoint Config Selector %s', name)
+ def create_authz_policy(self, *, action: str, rules: list):
+ name = self.make_resource_name(self.AUTHZ_POLICY_NAME)
+ logger.info('Creating Authz Policy %s', name)
+ policy = {
+ "action": action,
+ "rules": rules,
+ }
+
+ self.netsec.create_authz_policy(name, policy)
+ self.authz_policy = self.netsec.get_authz_policy(name)
+ logger.debug('Authz Policy loaded: %r', self.authz_policy)
+
+ def delete_authz_policy(self, force=False):
+ if force:
+ name = self.make_resource_name(self.AUTHZ_POLICY_NAME)
+ elif self.authz_policy:
+ name = self.authz_policy.name
+ else:
+ return
+ logger.info('Deleting Authz Policy %s', name)
+ self.netsec.delete_authz_policy(name)
+ self.authz_policy = None
+
+ def create_endpoint_policy(self, *, server_namespace: str, server_name: str,
+ server_port: int) -> None:
+ name = self.make_resource_name(self.ENDPOINT_POLICY)
+ logger.info('Creating Endpoint Policy %s', name)
endpoint_matcher_labels = [{
"labelName": "app",
"labelValue": f"{server_namespace}-{server_name}"
@@ -393,40 +867,41 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
port_selector = {"ports": [str(server_port)]}
label_matcher_all = {
"metadataLabelMatchCriteria": "MATCH_ALL",
- "metadataLabels": endpoint_matcher_labels
+ "metadataLabels": endpoint_matcher_labels,
}
config = {
"type": "GRPC_SERVER",
- "httpFilters": {},
"trafficPortSelector": port_selector,
"endpointMatcher": {
- "metadataLabelMatcher": label_matcher_all
+ "metadataLabelMatcher": label_matcher_all,
},
}
if self.server_tls_policy:
config["serverTlsPolicy"] = self.server_tls_policy.name
else:
logger.warning(
- 'Creating Endpoint Config Selector %s with '
+ 'Creating Endpoint Policy %s with '
'no Server TLS policy attached', name)
+ if self.authz_policy:
+ config["authorizationPolicy"] = self.authz_policy.name
- self.netsvc.create_endpoint_config_selector(name, config)
- self.ecs = self.netsvc.get_endpoint_config_selector(name)
- logger.debug('Loaded Endpoint Config Selector: %r', self.ecs)
+ self.netsvc.create_endpoint_policy(name, config)
+ self.endpoint_policy = self.netsvc.get_endpoint_policy(name)
+ logger.debug('Loaded Endpoint Policy: %r', self.endpoint_policy)
- def delete_endpoint_config_selector(self, force=False):
+ def delete_endpoint_policy(self, force: bool = False) -> None:
if force:
- name = self._ns_name(self.ENDPOINT_CONFIG_SELECTOR_NAME)
- elif self.ecs:
- name = self.ecs.name
+ name = self.make_resource_name(self.ENDPOINT_POLICY)
+ elif self.endpoint_policy:
+ name = self.endpoint_policy.name
else:
return
- logger.info('Deleting Endpoint Config Selector %s', name)
- self.netsvc.delete_endpoint_config_selector(name)
- self.ecs = None
+ logger.info('Deleting Endpoint Policy %s', name)
+ self.netsvc.delete_endpoint_policy(name)
+ self.endpoint_policy = None
def create_client_tls_policy(self, *, tls, mtls):
- name = self._ns_name(self.CLIENT_TLS_POLICY_NAME)
+ name = self.make_resource_name(self.CLIENT_TLS_POLICY_NAME)
logger.info('Creating Client TLS Policy %s', name)
if not tls and not mtls:
logger.warning(
@@ -447,7 +922,7 @@ class TrafficDirectorSecureManager(TrafficDirectorManager):
def delete_client_tls_policy(self, force=False):
if force:
- name = self._ns_name(self.CLIENT_TLS_POLICY_NAME)
+ name = self.make_resource_name(self.CLIENT_TLS_POLICY_NAME)
elif self.client_tls_policy:
name = self.client_tls_policy.name
else:
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py
index 3e155532..c93a8f41 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc.py
@@ -15,11 +15,9 @@ import logging
import re
from typing import ClassVar, Dict, Optional
-# Workaround: `grpc` must be imported before `google.protobuf.json_format`,
-# to prevent "Segmentation fault". Ref https://github.com/grpc/grpc/issues/24897
-import grpc
from google.protobuf import json_format
import google.protobuf.message
+import grpc
logger = logging.getLogger(__name__)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_csds.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_csds.py
new file mode 100644
index 00000000..2278c5bc
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_csds.py
@@ -0,0 +1,59 @@
+# Copyright 2021 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 contains helpers for gRPC services defined in
+https://github.com/envoyproxy/envoy/blob/main/api/envoy/service/status/v3/csds.proto
+"""
+
+import logging
+import queue
+from typing import Callable, Optional
+
+from envoy.extensions.filters.common.fault.v3 import fault_pb2
+from envoy.extensions.filters.http.fault.v3 import fault_pb2
+from envoy.extensions.filters.http.router.v3 import router_pb2
+# Envoy protos provided by PyPI package xds-protos
+# Needs to import the generated Python file to load descriptors
+from envoy.extensions.filters.network.http_connection_manager.v3 import \
+ http_connection_manager_pb2
+from envoy.service.status.v3 import csds_pb2
+from envoy.service.status.v3 import csds_pb2_grpc
+import grpc
+
+import framework.rpc
+
+logger = logging.getLogger(__name__)
+
+# Type aliases
+ClientConfig = csds_pb2.ClientConfig
+_ClientStatusRequest = csds_pb2.ClientStatusRequest
+
+
+class CsdsClient(framework.rpc.grpc.GrpcClientHelper):
+ stub: csds_pb2_grpc.ClientStatusDiscoveryServiceStub
+
+ def __init__(self, channel: grpc.Channel):
+ super().__init__(channel,
+ csds_pb2_grpc.ClientStatusDiscoveryServiceStub)
+
+ def fetch_client_status(self, **kwargs) -> Optional[ClientConfig]:
+ """Fetches the active xDS configurations."""
+ response = self.call_unary_with_deadline(rpc='FetchClientStatus',
+ req=_ClientStatusRequest(),
+ **kwargs)
+ if len(response.config) != 1:
+ logger.debug('Unexpected number of client configs: %s',
+ len(response.config))
+ return None
+ return response.config[0]
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py
index 31485f9d..7d010b33 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/rpc/grpc_testing.py
@@ -16,22 +16,28 @@ This contains helpers for gRPC services defined in
https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/test.proto
"""
import logging
-from typing import Optional
+from typing import Iterable, Optional, Tuple
import grpc
+from grpc_health.v1 import health_pb2
+from grpc_health.v1 import health_pb2_grpc
import framework.rpc
-from src.proto.grpc.testing import test_pb2_grpc
+from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
# Type aliases
_LoadBalancerStatsRequest = messages_pb2.LoadBalancerStatsRequest
LoadBalancerStatsResponse = messages_pb2.LoadBalancerStatsResponse
+_LoadBalancerAccumulatedStatsRequest = messages_pb2.LoadBalancerAccumulatedStatsRequest
+LoadBalancerAccumulatedStatsResponse = messages_pb2.LoadBalancerAccumulatedStatsResponse
class LoadBalancerStatsServiceClient(framework.rpc.grpc.GrpcClientHelper):
stub: test_pb2_grpc.LoadBalancerStatsServiceStub
STATS_PARTIAL_RESULTS_TIMEOUT_SEC = 1200
+ STATS_ACCUMULATED_RESULTS_TIMEOUT_SEC = 600
def __init__(self, channel: grpc.Channel):
super().__init__(channel, test_pb2_grpc.LoadBalancerStatsServiceStub)
@@ -51,3 +57,86 @@ class LoadBalancerStatsServiceClient(framework.rpc.grpc.GrpcClientHelper):
timeout_sec=timeout_sec),
deadline_sec=timeout_sec,
log_level=logging.INFO)
+
+ def get_client_accumulated_stats(
+ self,
+ *,
+ timeout_sec: Optional[int] = None
+ ) -> LoadBalancerAccumulatedStatsResponse:
+ if timeout_sec is None:
+ timeout_sec = self.STATS_ACCUMULATED_RESULTS_TIMEOUT_SEC
+
+ return self.call_unary_with_deadline(
+ rpc='GetClientAccumulatedStats',
+ req=_LoadBalancerAccumulatedStatsRequest(),
+ deadline_sec=timeout_sec,
+ log_level=logging.INFO)
+
+
+class XdsUpdateClientConfigureServiceClient(framework.rpc.grpc.GrpcClientHelper
+ ):
+ stub: test_pb2_grpc.XdsUpdateClientConfigureServiceStub
+ CONFIGURE_TIMEOUT_SEC: int = 5
+
+ def __init__(self, channel: grpc.Channel):
+ super().__init__(channel,
+ test_pb2_grpc.XdsUpdateClientConfigureServiceStub)
+
+ def configure(
+ self,
+ *,
+ rpc_types: Iterable[str],
+ metadata: Optional[Iterable[Tuple[str, str, str]]] = None,
+ app_timeout: Optional[int] = None,
+ timeout_sec: int = CONFIGURE_TIMEOUT_SEC,
+ ) -> None:
+ request = messages_pb2.ClientConfigureRequest()
+ for rpc_type in rpc_types:
+ request.types.append(
+ messages_pb2.ClientConfigureRequest.RpcType.Value(rpc_type))
+ if metadata:
+ for entry in metadata:
+ request.metadata.append(
+ messages_pb2.ClientConfigureRequest.Metadata(
+ type=messages_pb2.ClientConfigureRequest.RpcType.Value(
+ entry[0]),
+ key=entry[1],
+ value=entry[2],
+ ))
+ if app_timeout:
+ request.timeout_sec = app_timeout
+ # Configure's response is empty
+ self.call_unary_with_deadline(rpc='Configure',
+ req=request,
+ deadline_sec=timeout_sec,
+ log_level=logging.INFO)
+
+
+class XdsUpdateHealthServiceClient(framework.rpc.grpc.GrpcClientHelper):
+ stub: test_pb2_grpc.XdsUpdateHealthServiceStub
+
+ def __init__(self, channel: grpc.Channel):
+ super().__init__(channel, test_pb2_grpc.XdsUpdateHealthServiceStub)
+
+ def set_serving(self):
+ self.call_unary_with_deadline(rpc='SetServing',
+ req=empty_pb2.Empty(),
+ log_level=logging.INFO)
+
+ def set_not_serving(self):
+ self.call_unary_with_deadline(rpc='SetNotServing',
+ req=empty_pb2.Empty(),
+ log_level=logging.INFO)
+
+
+class HealthClient(framework.rpc.grpc.GrpcClientHelper):
+ stub: health_pb2_grpc.HealthStub
+
+ def __init__(self, channel: grpc.Channel):
+ super().__init__(channel, health_pb2_grpc.HealthStub)
+
+ def check_health(self):
+ return self.call_unary_with_deadline(
+ rpc='Check',
+ req=health_pb2.HealthCheckRequest(),
+ log_level=logging.INFO)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py
index 58a73d44..5c9e32c8 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py
@@ -12,17 +12,39 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import contextlib
+import datetime
import logging
import pathlib
-from typing import Optional
+from typing import Dict, Optional
+import urllib.parse
import mako.template
import yaml
+import framework.helpers.datetime
+import framework.helpers.highlighter
+from framework.infrastructure import gcp
from framework.infrastructure import k8s
logger = logging.getLogger(__name__)
+# Type aliases
+_HighlighterYaml = framework.helpers.highlighter.HighlighterYaml
+_helper_datetime = framework.helpers.datetime
+timedelta = datetime.timedelta
+
+
+def _logs_explorer_query(query: Dict[str, str]) -> str:
+ return '\n'.join(f'{k}="{v}"' for k, v in query.items())
+
+
+def _logs_explorer_request(req: Dict[str, str]) -> str:
+ return ';'.join(f'{k}={_logs_explorer_quote(v)}' for k, v in req.items())
+
+
+def _logs_explorer_quote(value: str):
+ return urllib.parse.quote_plus(value, safe=':')
+
class RunnerError(Exception):
"""Error running app"""
@@ -31,11 +53,14 @@ class RunnerError(Exception):
class KubernetesBaseRunner:
TEMPLATE_DIR_NAME = 'kubernetes-manifests'
TEMPLATE_DIR_RELATIVE_PATH = f'../../{TEMPLATE_DIR_NAME}'
+ ROLE_WORKLOAD_IDENTITY_USER = 'roles/iam.workloadIdentityUser'
def __init__(self,
k8s_namespace,
namespace_template=None,
reuse_namespace=False):
+ self._highlighter = _HighlighterYaml()
+
# Kubernetes namespaced resources manager
self.k8s_namespace: k8s.KubernetesNamespace = k8s_namespace
self.reuse_namespace = reuse_namespace
@@ -53,7 +78,7 @@ class KubernetesBaseRunner:
def cleanup(self, *, force=False):
if (self.namespace and not self.reuse_namespace) or force:
- self._delete_namespace()
+ self.delete_namespace()
self.namespace = None
@staticmethod
@@ -86,7 +111,7 @@ class KubernetesBaseRunner:
yaml_doc = self._render_template(template_file, **kwargs)
logger.info("Rendered template %s/%s:\n%s", self.TEMPLATE_DIR_NAME,
- template_name, yaml_doc)
+ template_name, self._highlighter.highlight(yaml_doc))
manifests = self._manifests_from_str(yaml_doc)
manifest = next(manifests)
@@ -129,6 +154,46 @@ class KubernetesBaseRunner:
namespace.metadata.creation_timestamp)
return namespace
+ @staticmethod
+ def _get_workload_identity_member_name(project, namespace_name,
+ service_account_name):
+ """
+ Returns workload identity member name used to authenticate Kubernetes
+ service accounts.
+
+ https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
+ """
+ return (f'serviceAccount:{project}.svc.id.goog'
+ f'[{namespace_name}/{service_account_name}]')
+
+ def _grant_workload_identity_user(self, *, gcp_iam, gcp_service_account,
+ service_account_name):
+ workload_identity_member = self._get_workload_identity_member_name(
+ gcp_iam.project, self.k8s_namespace.name, service_account_name)
+ logger.info('Granting %s to %s for GCP Service Account %s',
+ self.ROLE_WORKLOAD_IDENTITY_USER, workload_identity_member,
+ gcp_service_account)
+
+ gcp_iam.add_service_account_iam_policy_binding(
+ gcp_service_account, self.ROLE_WORKLOAD_IDENTITY_USER,
+ workload_identity_member)
+
+ def _revoke_workload_identity_user(self, *, gcp_iam, gcp_service_account,
+ service_account_name):
+ workload_identity_member = self._get_workload_identity_member_name(
+ gcp_iam.project, self.k8s_namespace.name, service_account_name)
+ logger.info('Revoking %s from %s for GCP Service Account %s',
+ self.ROLE_WORKLOAD_IDENTITY_USER, workload_identity_member,
+ gcp_service_account)
+ try:
+ gcp_iam.remove_service_account_iam_policy_binding(
+ gcp_service_account, self.ROLE_WORKLOAD_IDENTITY_USER,
+ workload_identity_member)
+ except gcp.api.Error as error:
+ logger.warning('Failed %s from %s for Service Account %s: %r',
+ self.ROLE_WORKLOAD_IDENTITY_USER,
+ workload_identity_member, gcp_service_account, error)
+
def _create_service_account(self, template,
**kwargs) -> k8s.V1ServiceAccount:
resource = self._create_from_template(template, **kwargs)
@@ -207,7 +272,7 @@ class KubernetesBaseRunner:
self.k8s_namespace.wait_for_service_account_deleted(name)
logger.debug('Service account %s deleted', name)
- def _delete_namespace(self, wait_for_deletion=True):
+ def delete_namespace(self, wait_for_deletion=True):
logger.info('Deleting namespace %s', self.k8s_namespace.name)
try:
self.k8s_namespace.delete()
@@ -244,3 +309,41 @@ class KubernetesBaseRunner:
name, service_port)
logger.info("Service %s: detected NEG=%s in zones=%s", name, neg_name,
neg_zones)
+
+ @staticmethod
+ def _logs_explorer_link(*,
+ deployment_name: str,
+ namespace_name: str,
+ gcp_project: str,
+ gcp_ui_url: str,
+ end_delta: timedelta = None) -> None:
+ """Output the link to test server/client logs in GCP Logs Explorer."""
+ if end_delta is None:
+ end_delta = timedelta(hours=1)
+
+ time_now = _helper_datetime.iso8601_utc_time()
+ time_end = _helper_datetime.iso8601_utc_time(end_delta)
+ query = _logs_explorer_query({
+ 'resource.type': 'k8s_container',
+ 'resource.labels.project_id': gcp_project,
+ 'resource.labels.container_name': deployment_name,
+ 'resource.labels.namespace_name': namespace_name,
+ })
+ req = _logs_explorer_request({
+ 'query': query,
+ 'timeRange': f'{time_now}/{time_end}',
+ })
+
+ link = f'https://{gcp_ui_url}/logs/query;{req}?project={gcp_project}'
+ logger.info("GCP Logs Explorer link to %s:\n%s", deployment_name, link)
+
+ @staticmethod
+ def _make_namespace_name(resource_prefix: str, resource_suffix: str,
+ name: str) -> str:
+ """A helper to make consistent test app kubernetes namespace name
+ for given resource prefix and suffix."""
+ parts = [resource_prefix, name]
+ # Avoid trailing dash when the suffix is empty.
+ if resource_suffix:
+ parts.append(resource_suffix)
+ return '-'.join(parts)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py
index 23dddf95..c5d8c040 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/client_app.py
@@ -20,12 +20,14 @@ modules.
import datetime
import functools
import logging
-from typing import Iterator, Optional
+from typing import Iterable, List, Optional
from framework.helpers import retryers
+from framework.infrastructure import gcp
from framework.infrastructure import k8s
import framework.rpc
from framework.rpc import grpc_channelz
+from framework.rpc import grpc_csds
from framework.rpc import grpc_testing
from framework.test_app import base_runner
@@ -34,11 +36,13 @@ logger = logging.getLogger(__name__)
# Type aliases
_timedelta = datetime.timedelta
_LoadBalancerStatsServiceClient = grpc_testing.LoadBalancerStatsServiceClient
+_XdsUpdateClientConfigureServiceClient = grpc_testing.XdsUpdateClientConfigureServiceClient
_ChannelzServiceClient = grpc_channelz.ChannelzServiceClient
_ChannelzChannel = grpc_channelz.Channel
_ChannelzChannelState = grpc_channelz.ChannelState
_ChannelzSubchannel = grpc_channelz.Subchannel
_ChannelzSocket = grpc_channelz.Socket
+_CsdsClient = grpc_csds.CsdsClient
class XdsTestClient(framework.rpc.grpc.GrpcApp):
@@ -68,9 +72,20 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp):
@property
@functools.lru_cache(None)
+ def update_config(self):
+ return _XdsUpdateClientConfigureServiceClient(
+ self._make_channel(self.rpc_port))
+
+ @property
+ @functools.lru_cache(None)
def channelz(self) -> _ChannelzServiceClient:
return _ChannelzServiceClient(self._make_channel(self.maintenance_port))
+ @property
+ @functools.lru_cache(None)
+ def csds(self) -> _CsdsClient:
+ return _CsdsClient(self._make_channel(self.maintenance_port))
+
def get_load_balancer_stats(
self,
*,
@@ -83,6 +98,15 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp):
return self.load_balancer_stats.get_client_stats(
num_rpcs=num_rpcs, timeout_sec=timeout_sec)
+ def get_load_balancer_accumulated_stats(
+ self,
+ *,
+ timeout_sec: Optional[int] = None,
+ ) -> grpc_testing.LoadBalancerAccumulatedStatsResponse:
+ """Shortcut to LoadBalancerStatsServiceClient.get_client_accumulated_stats()"""
+ return self.load_balancer_stats.get_client_accumulated_stats(
+ timeout_sec=timeout_sec)
+
def wait_for_active_server_channel(self) -> _ChannelzChannel:
"""Wait for the channel to the server to transition to READY.
@@ -173,7 +197,7 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp):
f'Client has no {_ChannelzChannelState.Name(state)} channel with '
'the server')
- def get_server_channels(self, **kwargs) -> Iterator[_ChannelzChannel]:
+ def get_server_channels(self, **kwargs) -> Iterable[_ChannelzChannel]:
return self.channelz.find_channels_for_target(self.server_target,
**kwargs)
@@ -189,6 +213,17 @@ class XdsTestClient(framework.rpc.grpc.GrpcApp):
f'Not found a {_ChannelzChannelState.Name(state)} '
f'subchannel for channel_id {channel.ref.channel_id}')
+ def find_subchannels_with_state(self, state: _ChannelzChannelState,
+ **kwargs) -> List[_ChannelzSubchannel]:
+ subchannels = []
+ for channel in self.channelz.find_channels_for_target(
+ self.server_target, **kwargs):
+ for subchannel in self.channelz.list_channel_subchannels(
+ channel, **kwargs):
+ if subchannel.data.state.state is state:
+ subchannels.append(subchannel)
+ return subchannels
+
class KubernetesClientRunner(base_runner.KubernetesBaseRunner):
@@ -197,54 +232,92 @@ class KubernetesClientRunner(base_runner.KubernetesBaseRunner):
*,
deployment_name,
image_name,
- gcp_service_account,
td_bootstrap_image,
+ gcp_api_manager: gcp.api.GcpApiManager,
+ gcp_project: str,
+ gcp_service_account: str,
xds_server_uri=None,
network='default',
+ config_scope=None,
service_account_name=None,
stats_port=8079,
deployment_template='client.deployment.yaml',
service_account_template='service-account.yaml',
reuse_namespace=False,
namespace_template=None,
- debug_use_port_forwarding=False):
+ debug_use_port_forwarding=False,
+ enable_workload_identity=True):
super().__init__(k8s_namespace, namespace_template, reuse_namespace)
# Settings
self.deployment_name = deployment_name
self.image_name = image_name
- self.gcp_service_account = gcp_service_account
- self.service_account_name = service_account_name or deployment_name
self.stats_port = stats_port
# xDS bootstrap generator
self.td_bootstrap_image = td_bootstrap_image
self.xds_server_uri = xds_server_uri
self.network = network
+ self.config_scope = config_scope
self.deployment_template = deployment_template
- self.service_account_template = service_account_template
self.debug_use_port_forwarding = debug_use_port_forwarding
+ self.enable_workload_identity = enable_workload_identity
+ # Service account settings:
+ # Kubernetes service account
+ if self.enable_workload_identity:
+ self.service_account_name = service_account_name or deployment_name
+ self.service_account_template = service_account_template
+ else:
+ self.service_account_name = None
+ self.service_account_template = None
+ # GCP.
+ self.gcp_project = gcp_project
+ self.gcp_ui_url = gcp_api_manager.gcp_ui_url
+ # GCP service account to map to Kubernetes service account
+ self.gcp_service_account = gcp_service_account
+ # GCP IAM API used to grant allow workload service accounts permission
+ # to use GCP service account identity.
+ self.gcp_iam = gcp.iam.IamV1(gcp_api_manager, gcp_project)
# Mutable state
self.deployment: Optional[k8s.V1Deployment] = None
self.service_account: Optional[k8s.V1ServiceAccount] = None
- self.port_forwarder = None
+ self.port_forwarder: Optional[k8s.PortForwarder] = None
+ # TODO(sergiitk): make rpc UnaryCall enum or get it from proto
def run(self,
*,
server_target,
rpc='UnaryCall',
qps=25,
+ metadata='',
secure_mode=False,
print_response=False) -> XdsTestClient:
+ logger.info(
+ 'Deploying xDS test client "%s" to k8s namespace %s: '
+ 'server_target=%s rpc=%s qps=%s metadata=%r secure_mode=%s '
+ 'print_response=%s', self.deployment_name, self.k8s_namespace.name,
+ server_target, rpc, qps, metadata, secure_mode, print_response)
+ self._logs_explorer_link(deployment_name=self.deployment_name,
+ namespace_name=self.k8s_namespace.name,
+ gcp_project=self.gcp_project,
+ gcp_ui_url=self.gcp_ui_url)
+
super().run()
- # TODO(sergiitk): make rpc UnaryCall enum or get it from proto
- # Create service account
- self.service_account = self._create_service_account(
- self.service_account_template,
- service_account_name=self.service_account_name,
- namespace_name=self.k8s_namespace.name,
- gcp_service_account=self.gcp_service_account)
+ if self.enable_workload_identity:
+ # Allow Kubernetes service account to use the GCP service account
+ # identity.
+ self._grant_workload_identity_user(
+ gcp_iam=self.gcp_iam,
+ gcp_service_account=self.gcp_service_account,
+ service_account_name=self.service_account_name)
+
+ # Create service account
+ self.service_account = self._create_service_account(
+ self.service_account_template,
+ service_account_name=self.service_account_name,
+ namespace_name=self.k8s_namespace.name,
+ gcp_service_account=self.gcp_service_account)
# Always create a new deployment
self.deployment = self._create_deployment(
@@ -256,10 +329,12 @@ class KubernetesClientRunner(base_runner.KubernetesBaseRunner):
td_bootstrap_image=self.td_bootstrap_image,
xds_server_uri=self.xds_server_uri,
network=self.network,
+ config_scope=self.config_scope,
stats_port=self.stats_port,
server_target=server_target,
rpc=rpc,
qps=qps,
+ metadata=metadata,
secure_mode=secure_mode,
print_response=print_response)
@@ -269,6 +344,7 @@ class KubernetesClientRunner(base_runner.KubernetesBaseRunner):
pod = self.k8s_namespace.list_deployment_pods(self.deployment)[0]
self._wait_pod_started(pod.metadata.name)
pod_ip = pod.status.pod_ip
+ rpc_port = self.stats_port
rpc_host = None
# Experimental, for local debugging.
@@ -277,21 +353,40 @@ class KubernetesClientRunner(base_runner.KubernetesBaseRunner):
pod_ip, self.stats_port)
self.port_forwarder = self.k8s_namespace.port_forward_pod(
pod, remote_port=self.stats_port)
- rpc_host = self.k8s_namespace.PORT_FORWARD_LOCAL_ADDRESS
+ rpc_port = self.port_forwarder.local_port
+ rpc_host = self.port_forwarder.local_address
return XdsTestClient(ip=pod_ip,
- rpc_port=self.stats_port,
+ rpc_port=rpc_port,
server_target=server_target,
rpc_host=rpc_host)
def cleanup(self, *, force=False, force_namespace=False):
if self.port_forwarder:
- self.k8s_namespace.port_forward_stop(self.port_forwarder)
+ self.port_forwarder.close()
self.port_forwarder = None
if self.deployment or force:
self._delete_deployment(self.deployment_name)
self.deployment = None
- if self.service_account or force:
+ if self.enable_workload_identity and (self.service_account or force):
+ self._revoke_workload_identity_user(
+ gcp_iam=self.gcp_iam,
+ gcp_service_account=self.gcp_service_account,
+ service_account_name=self.service_account_name)
self._delete_service_account(self.service_account_name)
self.service_account = None
super().cleanup(force=force_namespace and force)
+
+ @classmethod
+ def make_namespace_name(cls,
+ resource_prefix: str,
+ resource_suffix: str,
+ name: str = 'client') -> str:
+ """A helper to make consistent XdsTestClient kubernetes namespace name
+ for given resource prefix and suffix.
+
+ Note: the idea is to intentionally produce different namespace name for
+ the test server, and the test client, as that closely mimics real-world
+ deployments.
+ """
+ return cls._make_namespace_name(resource_prefix, resource_suffix, name)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/server_app.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/server_app.py
index 2b258af3..3d583f66 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/server_app.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/test_app/server_app.py
@@ -19,17 +19,22 @@ modules.
"""
import functools
import logging
-from typing import Iterator, Optional
+import threading
+from typing import Iterator, List, Optional
+from framework.infrastructure import gcp
from framework.infrastructure import k8s
import framework.rpc
from framework.rpc import grpc_channelz
+from framework.rpc import grpc_testing
from framework.test_app import base_runner
logger = logging.getLogger(__name__)
# Type aliases
_ChannelzServiceClient = grpc_channelz.ChannelzServiceClient
+_XdsUpdateHealthServiceClient = grpc_testing.XdsUpdateHealthServiceClient
+_HealthClient = grpc_testing.HealthClient
class XdsTestServer(framework.rpc.grpc.GrpcApp):
@@ -47,7 +52,8 @@ class XdsTestServer(framework.rpc.grpc.GrpcApp):
server_id: Optional[str] = None,
xds_host: Optional[str] = None,
xds_port: Optional[int] = None,
- rpc_host: Optional[str] = None):
+ rpc_host: Optional[str] = None,
+ pod_name: Optional[str] = None):
super().__init__(rpc_host=(rpc_host or ip))
self.ip = ip
self.rpc_port = rpc_port
@@ -55,12 +61,34 @@ class XdsTestServer(framework.rpc.grpc.GrpcApp):
self.secure_mode = secure_mode
self.server_id = server_id
self.xds_host, self.xds_port = xds_host, xds_port
+ self.pod_name = pod_name
@property
@functools.lru_cache(None)
def channelz(self) -> _ChannelzServiceClient:
return _ChannelzServiceClient(self._make_channel(self.maintenance_port))
+ @property
+ @functools.lru_cache(None)
+ def update_health_service_client(self) -> _XdsUpdateHealthServiceClient:
+ return _XdsUpdateHealthServiceClient(
+ self._make_channel(self.maintenance_port))
+
+ @property
+ @functools.lru_cache(None)
+ def health_client(self) -> _HealthClient:
+ return _HealthClient(self._make_channel(self.maintenance_port))
+
+ def set_serving(self):
+ logger.info('Setting health status to serving')
+ self.update_health_service_client.set_serving()
+ logger.info('Server reports %s', self.health_client.check_health())
+
+ def set_not_serving(self):
+ logger.info('Setting health status to not serving')
+ self.update_health_service_client.set_not_serving()
+ logger.info('Server reports %s', self.health_client.check_health())
+
def set_xds_address(self, xds_host, xds_port: Optional[int] = None):
self.xds_host, self.xds_port = xds_host, xds_port
@@ -135,11 +163,13 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
*,
deployment_name,
image_name,
- gcp_service_account,
+ td_bootstrap_image,
+ gcp_api_manager: gcp.api.GcpApiManager,
+ gcp_project: str,
+ gcp_service_account: str,
service_account_name=None,
service_name=None,
neg_name=None,
- td_bootstrap_image=None,
xds_server_uri=None,
network='default',
deployment_template='server.deployment.yaml',
@@ -148,14 +178,13 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
reuse_service=False,
reuse_namespace=False,
namespace_template=None,
- debug_use_port_forwarding=False):
+ debug_use_port_forwarding=False,
+ enable_workload_identity=True):
super().__init__(k8s_namespace, namespace_template, reuse_namespace)
# Settings
self.deployment_name = deployment_name
self.image_name = image_name
- self.gcp_service_account = gcp_service_account
- self.service_account_name = service_account_name or deployment_name
self.service_name = service_name or deployment_name
# xDS bootstrap generator
self.td_bootstrap_image = td_bootstrap_image
@@ -166,16 +195,33 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
f'{self.service_name}')
self.network = network
self.deployment_template = deployment_template
- self.service_account_template = service_account_template
self.service_template = service_template
self.reuse_service = reuse_service
self.debug_use_port_forwarding = debug_use_port_forwarding
+ self.enable_workload_identity = enable_workload_identity
+ # Service account settings:
+ # Kubernetes service account
+ if self.enable_workload_identity:
+ self.service_account_name = service_account_name or deployment_name
+ self.service_account_template = service_account_template
+ else:
+ self.service_account_name = None
+ self.service_account_template = None
+
+ # GCP.
+ self.gcp_project = gcp_project
+ self.gcp_ui_url = gcp_api_manager.gcp_ui_url
+ # GCP service account to map to Kubernetes service account
+ self.gcp_service_account = gcp_service_account
+ # GCP IAM API used to grant allow workload service accounts permission
+ # to use GCP service account identity.
+ self.gcp_iam = gcp.iam.IamV1(gcp_api_manager, gcp_project)
# Mutable state
self.deployment: Optional[k8s.V1Deployment] = None
self.service_account: Optional[k8s.V1ServiceAccount] = None
self.service: Optional[k8s.V1Service] = None
- self.port_forwarder = None
+ self.port_forwarders: List[k8s.PortForwarder] = []
def run(self,
*,
@@ -183,11 +229,7 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
maintenance_port=None,
secure_mode=False,
server_id=None,
- replica_count=1) -> XdsTestServer:
- # TODO(sergiitk): multiple replicas
- if replica_count != 1:
- raise NotImplementedError("Multiple replicas not yet supported")
-
+ replica_count=1) -> List[XdsTestServer]:
# Implementation detail: in secure mode, maintenance ("backchannel")
# port must be different from the test port so communication with
# maintenance services can be reached independently from the security
@@ -206,6 +248,19 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
isinstance(maintenance_port, int)):
raise TypeError('Port numbers must be integer')
+ if secure_mode and not self.enable_workload_identity:
+ raise ValueError('Secure mode requires Workload Identity enabled.')
+
+ logger.info(
+ 'Deploying xDS test server "%s" to k8s namespace %s: test_port=%s '
+ 'maintenance_port=%s secure_mode=%s server_id=%s replica_count=%s',
+ self.deployment_name, self.k8s_namespace.name, test_port,
+ maintenance_port, secure_mode, server_id, replica_count)
+ self._logs_explorer_link(deployment_name=self.deployment_name,
+ namespace_name=self.k8s_namespace.name,
+ gcp_project=self.gcp_project,
+ gcp_ui_url=self.gcp_ui_url)
+
# Create namespace.
super().run()
@@ -223,12 +278,20 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
test_port=test_port)
self._wait_service_neg(self.service_name, test_port)
- # Create service account
- self.service_account = self._create_service_account(
- self.service_account_template,
- service_account_name=self.service_account_name,
- namespace_name=self.k8s_namespace.name,
- gcp_service_account=self.gcp_service_account)
+ if self.enable_workload_identity:
+ # Allow Kubernetes service account to use the GCP service account
+ # identity.
+ self._grant_workload_identity_user(
+ gcp_iam=self.gcp_iam,
+ gcp_service_account=self.gcp_service_account,
+ service_account_name=self.service_account_name)
+
+ # Create service account
+ self.service_account = self._create_service_account(
+ self.service_account_template,
+ service_account_name=self.service_account_name,
+ namespace_name=self.k8s_namespace.name,
+ gcp_service_account=self.gcp_service_account)
# Always create a new deployment
self.deployment = self._create_deployment(
@@ -251,39 +314,66 @@ class KubernetesServerRunner(base_runner.KubernetesBaseRunner):
# Wait for pods running
pods = self.k8s_namespace.list_deployment_pods(self.deployment)
+
+ servers = []
for pod in pods:
- self._wait_pod_started(pod.metadata.name)
-
- # TODO(sergiitk): This is why multiple replicas not yet supported
- pod = pods[0]
- pod_ip = pod.status.pod_ip
- rpc_host = None
- # Experimental, for local debugging.
- if self.debug_use_port_forwarding:
- logger.info('LOCAL DEV MODE: Enabling port forwarding to %s:%s',
- pod_ip, maintenance_port)
- self.port_forwarder = self.k8s_namespace.port_forward_pod(
- pod, remote_port=maintenance_port)
- rpc_host = self.k8s_namespace.PORT_FORWARD_LOCAL_ADDRESS
-
- return XdsTestServer(ip=pod_ip,
- rpc_port=test_port,
- maintenance_port=maintenance_port,
- secure_mode=secure_mode,
- server_id=server_id,
- rpc_host=rpc_host)
+ pod_name = pod.metadata.name
+ self._wait_pod_started(pod_name)
+
+ pod_ip = pod.status.pod_ip
+ rpc_host = None
+ # Experimental, for local debugging.
+ local_port = maintenance_port
+ if self.debug_use_port_forwarding:
+ logger.info('LOCAL DEV MODE: Enabling port forwarding to %s:%s',
+ pod_ip, maintenance_port)
+ port_forwarder = self.k8s_namespace.port_forward_pod(
+ pod, remote_port=maintenance_port)
+ self.port_forwarders.append(port_forwarder)
+ local_port = port_forwarder.local_port
+ rpc_host = port_forwarder.local_address
+
+ servers.append(
+ XdsTestServer(ip=pod_ip,
+ rpc_port=test_port,
+ maintenance_port=local_port,
+ secure_mode=secure_mode,
+ server_id=server_id,
+ rpc_host=rpc_host,
+ pod_name=pod_name))
+ return servers
def cleanup(self, *, force=False, force_namespace=False):
- if self.port_forwarder:
- self.k8s_namespace.port_forward_stop(self.port_forwarder)
- self.port_forwarder = None
+ if self.port_forwarders:
+ for port_forwarder in self.port_forwarders:
+ port_forwarder.close()
+ self.port_forwarders = []
if self.deployment or force:
self._delete_deployment(self.deployment_name)
self.deployment = None
if (self.service and not self.reuse_service) or force:
self._delete_service(self.service_name)
self.service = None
- if self.service_account or force:
+ if self.enable_workload_identity and (self.service_account or force):
+ self._revoke_workload_identity_user(
+ gcp_iam=self.gcp_iam,
+ gcp_service_account=self.gcp_service_account,
+ service_account_name=self.service_account_name)
self._delete_service_account(self.service_account_name)
self.service_account = None
super().cleanup(force=(force_namespace and force))
+
+ @classmethod
+ def make_namespace_name(cls,
+ resource_prefix: str,
+ resource_suffix: str,
+ name: str = 'server') -> str:
+ """A helper to make consistent XdsTestServer kubernetes namespace name
+ for given resource prefix and suffix.
+
+ Note: the idea is to intentionally produce different namespace name for
+ the test server, and the test client, as that closely mimics real-world
+ deployments.
+ :rtype: object
+ """
+ return cls._make_namespace_name(resource_prefix, resource_suffix, name)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py
index 65ebc842..7c728859 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_flags.py
@@ -12,57 +12,125 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from absl import flags
-import googleapiclient.discovery
+
+from framework.helpers import highlighter
# GCP
PROJECT = flags.DEFINE_string("project",
default=None,
- help="GCP Project ID. Required")
-NAMESPACE = flags.DEFINE_string(
- "namespace",
+ help="(required) GCP Project ID.")
+RESOURCE_PREFIX = flags.DEFINE_string(
+ "resource_prefix",
+ default=None,
+ help=("(required) The prefix used to name GCP resources.\n"
+ "Together with `resource_suffix` used to create unique "
+ "resource names."))
+RESOURCE_SUFFIX = flags.DEFINE_string(
+ "resource_suffix",
default=None,
- help="Isolate GCP resources using given namespace / name prefix. Required")
+ help=("The suffix used to name GCP resources.\n"
+ "Together with `resource_prefix` used to create unique "
+ "resource names.\n"
+ "(default: test suite will generate a random suffix, based on suite "
+ "resource management preferences)"))
NETWORK = flags.DEFINE_string("network",
default="default",
help="GCP Network ID")
+CONFIG_SCOPE = flags.DEFINE_string(
+ "config_scope",
+ default=None,
+ help="Scope specified in mesh if using AppNet APIs")
+COMPUTE_API_VERSION = flags.DEFINE_string(
+ "compute_api_version",
+ default='v1',
+ help="The version of the GCP Compute API, e.g., v1, v1alpha")
# Mirrors --xds-server-uri argument of Traffic Director gRPC Bootstrap
XDS_SERVER_URI = flags.DEFINE_string(
"xds_server_uri",
default=None,
- help="Override Traffic Director server uri, for testing")
+ help="Override Traffic Director server URI.")
+ENSURE_FIREWALL = flags.DEFINE_bool(
+ "ensure_firewall",
+ default=False,
+ help="Ensure the allow-health-check firewall exists before each test case")
+FIREWALL_SOURCE_RANGE = flags.DEFINE_list(
+ "firewall_source_range",
+ default=['35.191.0.0/16', '130.211.0.0/22'],
+ help="Update the source range of the firewall rule.")
+FIREWALL_ALLOWED_PORTS = flags.DEFINE_list(
+ "firewall_allowed_ports",
+ default=['8080-8100'],
+ help="Update the allowed ports of the firewall rule.")
# Test server
-SERVER_NAME = flags.DEFINE_string("server_name",
- default="psm-grpc-server",
- help="Server deployment and service name")
-SERVER_PORT = flags.DEFINE_integer("server_port",
- default=8080,
- lower_bound=0,
- upper_bound=65535,
- help="Server test port")
+SERVER_NAME = flags.DEFINE_string(
+ "server_name",
+ default="psm-grpc-server",
+ help="The name to use for test server deployments.")
+SERVER_PORT = flags.DEFINE_integer(
+ "server_port",
+ default=8080,
+ lower_bound=1,
+ upper_bound=65535,
+ help="Server test port.\nMust be within --firewall_allowed_ports.")
SERVER_MAINTENANCE_PORT = flags.DEFINE_integer(
"server_maintenance_port",
+ default=None,
+ lower_bound=1,
+ upper_bound=65535,
+ help=("Server port running maintenance services: Channelz, CSDS, Health, "
+ "XdsUpdateHealth, and ProtoReflection (optional).\n"
+ "Must be within --firewall_allowed_ports.\n"
+ "(default: the port is chosen automatically based on "
+ "the security configuration)"))
+SERVER_XDS_HOST = flags.DEFINE_string(
+ "server_xds_host",
+ default="xds-test-server",
+ help=("The xDS hostname of the test server.\n"
+ "Together with `server_xds_port` makes test server target URI, "
+ "xds:///hostname:port"))
+# Note: port 0 known to represent a request for dynamically-allocated port
+# https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports
+SERVER_XDS_PORT = flags.DEFINE_integer(
+ "server_xds_port",
+ default=8080,
lower_bound=0,
upper_bound=65535,
- default=None,
- help="Server port running maintenance services: health check, channelz, etc"
-)
-SERVER_XDS_HOST = flags.DEFINE_string("server_xds_host",
- default='xds-test-server',
- help="Test server xDS hostname")
-SERVER_XDS_PORT = flags.DEFINE_integer("server_xds_port",
- default=8000,
- help="Test server xDS port")
+ help=("The xDS port of the test server.\n"
+ "Together with `server_xds_host` makes test server target URI, "
+ "xds:///hostname:port\n"
+ "Must be unique within a GCP project.\n"
+ "Set to 0 to select any unused port."))
# Test client
-CLIENT_NAME = flags.DEFINE_string("client_name",
- default="psm-grpc-client",
- help="Client deployment and service name")
-CLIENT_PORT = flags.DEFINE_integer("client_port",
- default=8079,
- help="Client test port")
+CLIENT_NAME = flags.DEFINE_string(
+ "client_name",
+ default="psm-grpc-client",
+ help="The name to use for test client deployments")
+CLIENT_PORT = flags.DEFINE_integer(
+ "client_port",
+ default=8079,
+ lower_bound=1,
+ upper_bound=65535,
+ help=(
+ "The port test client uses to run gRPC services: Channelz, CSDS, "
+ "XdsStats, XdsUpdateClientConfigure, and ProtoReflection (optional).\n"
+ "Doesn't have to be within --firewall_allowed_ports."))
+
+# Testing metadata
+TESTING_VERSION = flags.DEFINE_string(
+ "testing_version",
+ default="master",
+ help="The testing gRPC version branch name. Like master, v1.41.x, v1.37.x")
+
+FORCE_CLEANUP = flags.DEFINE_bool(
+ "force_cleanup",
+ default=False,
+ help="Force resource cleanup, even if not created by this test run")
+
+flags.adopt_module_key_flags(highlighter)
flags.mark_flags_as_required([
"project",
- "namespace",
+ "resource_prefix",
])
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_flags.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_flags.py
index d7f3f0b4..e259de8b 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_flags.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_flags.py
@@ -17,6 +17,10 @@ from absl import flags
KUBE_CONTEXT = flags.DEFINE_string("kube_context",
default=None,
help="Kubectl context to use")
+SECONDARY_KUBE_CONTEXT = flags.DEFINE_string(
+ "secondary_kube_context",
+ default=None,
+ help="Secondary kubectl context to use for cluster in another region")
GCP_SERVICE_ACCOUNT = flags.DEFINE_string(
"gcp_service_account",
default=None,
@@ -37,9 +41,12 @@ DEBUG_USE_PORT_FORWARDING = flags.DEFINE_bool(
"debug_use_port_forwarding",
default=False,
help="Development only: use kubectl port-forward to connect to test app")
+ENABLE_WORKLOAD_IDENTITY = flags.DEFINE_bool(
+ "enable_workload_identity",
+ default=True,
+ help="Enable the WorkloadIdentity feature")
flags.mark_flags_as_required([
- "gcp_service_account",
"kube_context",
"td_bootstrap_image",
"server_image",
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py
index 0606ba97..82a451ca 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py
@@ -11,19 +11,26 @@
# WITHOUT 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 abc
import datetime
import enum
import hashlib
import logging
+import re
import time
-from typing import Optional, Tuple
+from typing import List, Optional, Tuple
from absl import flags
from absl.testing import absltest
+from google.protobuf import json_format
+import grpc
from framework import xds_flags
from framework import xds_k8s_flags
+from framework import xds_url_map_testcase
from framework.helpers import retryers
+from framework.helpers import skips
+import framework.helpers.rand
from framework.infrastructure import gcp
from framework.infrastructure import k8s
from framework.infrastructure import traffic_director
@@ -33,10 +40,6 @@ from framework.test_app import client_app
from framework.test_app import server_app
logger = logging.getLogger(__name__)
-_FORCE_CLEANUP = flags.DEFINE_bool(
- "force_cleanup",
- default=False,
- help="Force resource cleanup, even if not created by this test run")
# TODO(yashkt): We will no longer need this flag once Core exposes local certs
# from channelz
_CHECK_LOCAL_CERTS = flags.DEFINE_bool(
@@ -47,31 +50,68 @@ flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
# Type aliases
+TrafficDirectorManager = traffic_director.TrafficDirectorManager
+TrafficDirectorAppNetManager = traffic_director.TrafficDirectorAppNetManager
+TrafficDirectorSecureManager = traffic_director.TrafficDirectorSecureManager
XdsTestServer = server_app.XdsTestServer
XdsTestClient = client_app.XdsTestClient
+KubernetesServerRunner = server_app.KubernetesServerRunner
+KubernetesClientRunner = client_app.KubernetesClientRunner
LoadBalancerStatsResponse = grpc_testing.LoadBalancerStatsResponse
_ChannelState = grpc_channelz.ChannelState
_timedelta = datetime.timedelta
-_DEFAULT_SECURE_MODE_MAINTENANCE_PORT = \
- server_app.KubernetesServerRunner.DEFAULT_SECURE_MODE_MAINTENANCE_PORT
+ClientConfig = framework.rpc.grpc_csds.ClientConfig
+_TD_CONFIG_MAX_WAIT_SEC = 600
-class XdsKubernetesTestCase(absltest.TestCase):
- k8s_api_manager: k8s.KubernetesApiManager
+
+class XdsKubernetesTestCase(absltest.TestCase, metaclass=abc.ABCMeta):
+ _resource_suffix_randomize: bool = True
+ client_namespace: str
+ client_runner: KubernetesClientRunner
gcp_api_manager: gcp.api.GcpApiManager
+ k8s_api_manager: k8s.KubernetesApiManager
+ resource_prefix: str
+ resource_suffix: str = ''
+ server_namespace: str
+ server_runner: KubernetesServerRunner
+ server_xds_port: int
+ td: TrafficDirectorManager
+ config_scope: str
+
+ @staticmethod
+ def isSupported(config: skips.TestConfig) -> bool:
+ """Overrided by the test class to decide if the config is supported.
+
+ Returns:
+ A bool indicates if the given config is supported.
+ """
+ return True
@classmethod
def setUpClass(cls):
+ """Hook method for setting up class fixture before running tests in
+ the class.
+ """
+ # Raises unittest.SkipTest if given client/server/version does not
+ # support current test case.
+ skips.evaluate_test_config(cls.isSupported)
+
# GCP
cls.project: str = xds_flags.PROJECT.value
cls.network: str = xds_flags.NETWORK.value
cls.gcp_service_account: str = xds_k8s_flags.GCP_SERVICE_ACCOUNT.value
cls.td_bootstrap_image = xds_k8s_flags.TD_BOOTSTRAP_IMAGE.value
cls.xds_server_uri = xds_flags.XDS_SERVER_URI.value
+ cls.ensure_firewall = xds_flags.ENSURE_FIREWALL.value
+ cls.firewall_allowed_ports = xds_flags.FIREWALL_ALLOWED_PORTS.value
+ cls.compute_api_version = xds_flags.COMPUTE_API_VERSION.value
- # Base namespace
- # TODO(sergiitk): generate for each test
- cls.namespace: str = xds_flags.NAMESPACE.value
+ # Resource names.
+ cls.resource_prefix = xds_flags.RESOURCE_PREFIX.value
+ if xds_flags.RESOURCE_SUFFIX.value is not None:
+ cls._resource_suffix_randomize = False
+ cls.resource_suffix = xds_flags.RESOURCE_SUFFIX.value
# Test server
cls.server_image = xds_k8s_flags.SERVER_IMAGE.value
@@ -87,30 +127,79 @@ class XdsKubernetesTestCase(absltest.TestCase):
cls.client_port = xds_flags.CLIENT_PORT.value
# Test suite settings
- cls.force_cleanup = _FORCE_CLEANUP.value
+ cls.force_cleanup = xds_flags.FORCE_CLEANUP.value
cls.debug_use_port_forwarding = \
xds_k8s_flags.DEBUG_USE_PORT_FORWARDING.value
+ cls.enable_workload_identity = xds_k8s_flags.ENABLE_WORKLOAD_IDENTITY.value
cls.check_local_certs = _CHECK_LOCAL_CERTS.value
# Resource managers
cls.k8s_api_manager = k8s.KubernetesApiManager(
xds_k8s_flags.KUBE_CONTEXT.value)
+ cls.secondary_k8s_api_manager = k8s.KubernetesApiManager(
+ xds_k8s_flags.SECONDARY_KUBE_CONTEXT.value)
cls.gcp_api_manager = gcp.api.GcpApiManager()
def setUp(self):
- # TODO(sergiitk): generate namespace with run id for each test
- self.server_namespace = self.namespace
- self.client_namespace = self.namespace
+ """Hook method for setting up the test fixture before exercising it."""
+ super().setUp()
- # Init this in child class
- # TODO(sergiitk): consider making a method to be less error-prone
- self.server_runner = None
- self.client_runner = None
- self.td = None
+ if self._resource_suffix_randomize:
+ self.resource_suffix = framework.helpers.rand.random_resource_suffix(
+ )
+ logger.info('Test run resource prefix: %s, suffix: %s',
+ self.resource_prefix, self.resource_suffix)
+
+ if xds_flags.CONFIG_SCOPE.value is not None:
+ self.config_scope = xds_flags.CONFIG_SCOPE.value + "-" + framework.helpers.rand.random_resource_suffix(
+ )
+ else:
+ self.config_scope = None
+
+ # TD Manager
+ self.td = self.initTrafficDirectorManager()
+
+ # Test Server runner
+ self.server_namespace = KubernetesServerRunner.make_namespace_name(
+ self.resource_prefix, self.resource_suffix)
+ self.server_runner = self.initKubernetesServerRunner()
+
+ # Test Client runner
+ self.client_namespace = KubernetesClientRunner.make_namespace_name(
+ self.resource_prefix, self.resource_suffix)
+ self.client_runner = self.initKubernetesClientRunner()
+
+ # Ensures the firewall exist
+ if self.ensure_firewall:
+ self.td.create_firewall_rule(
+ allowed_ports=self.firewall_allowed_ports)
+
+ # Randomize xds port, when it's set to 0
+ if self.server_xds_port == 0:
+ # TODO(sergiitk): this is prone to race conditions:
+ # The port might not me taken now, but there's not guarantee
+ # it won't be taken until the tests get to creating
+ # forwarding rule. This check is better than nothing,
+ # but we should find a better approach.
+ self.server_xds_port = self.td.find_unused_forwarding_rule_port()
+ logger.info('Found unused xds port: %s', self.server_xds_port)
+
+ @abc.abstractmethod
+ def initTrafficDirectorManager(self) -> TrafficDirectorManager:
+ raise NotImplementedError
+
+ @abc.abstractmethod
+ def initKubernetesServerRunner(self) -> KubernetesServerRunner:
+ raise NotImplementedError
+
+ @abc.abstractmethod
+ def initKubernetesClientRunner(self) -> KubernetesClientRunner:
+ raise NotImplementedError
@classmethod
def tearDownClass(cls):
cls.k8s_api_manager.close()
+ cls.secondary_k8s_api_manager.close()
cls.gcp_api_manager.close()
def tearDown(self):
@@ -134,20 +223,37 @@ class XdsKubernetesTestCase(absltest.TestCase):
self.server_xds_port,
health_check_port=self.server_maintenance_port)
- def setupServerBackends(self, *, wait_for_healthy_status=True):
+ def setupServerBackends(self,
+ *,
+ wait_for_healthy_status=True,
+ server_runner=None,
+ max_rate_per_endpoint: Optional[int] = None):
+ if server_runner is None:
+ server_runner = self.server_runner
# Load Backends
- neg_name, neg_zones = self.server_runner.k8s_namespace.get_service_neg(
- self.server_runner.service_name, self.server_port)
+ neg_name, neg_zones = server_runner.k8s_namespace.get_service_neg(
+ server_runner.service_name, self.server_port)
# Add backends to the Backend Service
- self.td.backend_service_add_neg_backends(neg_name, neg_zones)
+ self.td.backend_service_add_neg_backends(
+ neg_name, neg_zones, max_rate_per_endpoint=max_rate_per_endpoint)
if wait_for_healthy_status:
self.td.wait_for_backends_healthy_status()
+ def removeServerBackends(self, *, server_runner=None):
+ if server_runner is None:
+ server_runner = self.server_runner
+ # Load Backends
+ neg_name, neg_zones = server_runner.k8s_namespace.get_service_neg(
+ server_runner.service_name, self.server_port)
+
+ # Remove backends from the Backend Service
+ self.td.backend_service_remove_neg_backends(neg_name, neg_zones)
+
def assertSuccessfulRpcs(self,
test_client: XdsTestClient,
num_rpcs: int = 100):
- lb_stats = self.sendRpcs(test_client, num_rpcs)
+ lb_stats = self.getClientRpcStats(test_client, num_rpcs)
self.assertAllBackendsReceivedRpcs(lb_stats)
failed = int(lb_stats.num_failures)
self.assertLessEqual(
@@ -155,10 +261,147 @@ class XdsKubernetesTestCase(absltest.TestCase):
0,
msg=f'Expected all RPCs to succeed: {failed} of {num_rpcs} failed')
+ @staticmethod
+ def diffAccumulatedStatsPerMethod(
+ before: grpc_testing.LoadBalancerAccumulatedStatsResponse,
+ after: grpc_testing.LoadBalancerAccumulatedStatsResponse):
+ """Only diffs stats_per_method, as the other fields are deprecated."""
+ diff = grpc_testing.LoadBalancerAccumulatedStatsResponse()
+ for method, method_stats in after.stats_per_method.items():
+ for status, count in method_stats.result.items():
+ count -= before.stats_per_method[method].result[status]
+ if count < 0:
+ raise AssertionError("Diff of count shouldn't be negative")
+ if count > 0:
+ diff.stats_per_method[method].result[status] = count
+ return diff
+
+ def assertRpcStatusCodes(self, test_client: XdsTestClient, *,
+ status_code: grpc.StatusCode, duration: _timedelta,
+ method: str) -> None:
+ """Assert all RPCs for a method are completing with a certain status."""
+ # Sending with pre-set QPS for a period of time
+ before_stats = test_client.get_load_balancer_accumulated_stats()
+ logging.info(
+ 'Received LoadBalancerAccumulatedStatsResponse from test client %s: before:\n%s',
+ test_client.ip, before_stats)
+ time.sleep(duration.total_seconds())
+ after_stats = test_client.get_load_balancer_accumulated_stats()
+ logging.info(
+ 'Received LoadBalancerAccumulatedStatsResponse from test client %s: after:\n%s',
+ test_client.ip, after_stats)
+
+ diff_stats = self.diffAccumulatedStatsPerMethod(before_stats,
+ after_stats)
+ stats = diff_stats.stats_per_method[method]
+ status = status_code.value[0]
+ for found_status, count in stats.result.items():
+ if found_status != status and count > 0:
+ self.fail(f"Expected only status {status} but found status "
+ f"{found_status} for method {method}:\n{diff_stats}")
+ self.assertGreater(stats.result[status_code.value[0]], 0)
+
+ def assertRpcsEventuallyGoToGivenServers(self,
+ test_client: XdsTestClient,
+ servers: List[XdsTestServer],
+ num_rpcs: int = 100):
+ retryer = retryers.constant_retryer(
+ wait_fixed=datetime.timedelta(seconds=1),
+ timeout=datetime.timedelta(seconds=_TD_CONFIG_MAX_WAIT_SEC),
+ log_level=logging.INFO)
+ try:
+ retryer(self._assertRpcsEventuallyGoToGivenServers, test_client,
+ servers, num_rpcs)
+ except retryers.RetryError:
+ logger.exception(
+ 'Rpcs did not go to expected servers before timeout %s',
+ _TD_CONFIG_MAX_WAIT_SEC)
+
+ def _assertRpcsEventuallyGoToGivenServers(self, test_client: XdsTestClient,
+ servers: List[XdsTestServer],
+ num_rpcs: int):
+ server_names = [server.pod_name for server in servers]
+ logger.info(f'Verifying RPCs go to {server_names}')
+ lb_stats = self.getClientRpcStats(test_client, num_rpcs)
+ failed = int(lb_stats.num_failures)
+ self.assertLessEqual(
+ failed,
+ 0,
+ msg=f'Expected all RPCs to succeed: {failed} of {num_rpcs} failed')
+ for server_name in server_names:
+ self.assertIn(server_name, lb_stats.rpcs_by_peer,
+ f'{server_name} did not receive RPCs')
+ for peer in lb_stats.rpcs_by_peer.keys():
+ self.assertIn(peer, server_names,
+ f'Unexpected server {peer} received RPCs')
+
+ def assertXdsConfigExists(self, test_client: XdsTestClient):
+ config = test_client.csds.fetch_client_status(log_level=logging.INFO)
+ self.assertIsNotNone(config)
+ seen = set()
+ want = frozenset([
+ 'listener_config',
+ 'cluster_config',
+ 'route_config',
+ 'endpoint_config',
+ ])
+ for xds_config in config.xds_config:
+ seen.add(xds_config.WhichOneof('per_xds_config'))
+ for generic_xds_config in config.generic_xds_configs:
+ if re.search(r'\.Listener$', generic_xds_config.type_url):
+ seen.add('listener_config')
+ elif re.search(r'\.RouteConfiguration$',
+ generic_xds_config.type_url):
+ seen.add('route_config')
+ elif re.search(r'\.Cluster$', generic_xds_config.type_url):
+ seen.add('cluster_config')
+ elif re.search(r'\.ClusterLoadAssignment$',
+ generic_xds_config.type_url):
+ seen.add('endpoint_config')
+ logger.debug('Received xDS config dump: %s',
+ json_format.MessageToJson(config, indent=2))
+ self.assertSameElements(want, seen)
+
+ def assertRouteConfigUpdateTrafficHandoff(
+ self, test_client: XdsTestClient,
+ previous_route_config_version: str, retry_wait_second: int,
+ timeout_second: int):
+ retryer = retryers.constant_retryer(
+ wait_fixed=datetime.timedelta(seconds=retry_wait_second),
+ timeout=datetime.timedelta(seconds=timeout_second),
+ retry_on_exceptions=(TdPropagationRetryableError,),
+ logger=logger,
+ log_level=logging.INFO)
+ try:
+ for attempt in retryer:
+ with attempt:
+ self.assertSuccessfulRpcs(test_client)
+ raw_config = test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ dumped_config = xds_url_map_testcase.DumpedXdsConfig(
+ json_format.MessageToDict(raw_config))
+ route_config_version = dumped_config.rds_version
+ if previous_route_config_version == route_config_version:
+ logger.info(
+ 'Routing config not propagated yet. Retrying.')
+ raise TdPropagationRetryableError(
+ "CSDS not get updated routing config corresponding"
+ " to the second set of url maps")
+ else:
+ self.assertSuccessfulRpcs(test_client)
+ logger.info(
+ '[SUCCESS] Confirmed successful RPC with the updated routing config, version=%s',
+ route_config_version)
+ except retryers.RetryError as retry_error:
+ logger.info(
+ 'Retry exhausted. TD routing config propagation failed after timeout %ds. Last seen client config dump: %s',
+ timeout_second, dumped_config)
+ raise retry_error
+
def assertFailedRpcs(self,
test_client: XdsTestClient,
num_rpcs: Optional[int] = 100):
- lb_stats = self.sendRpcs(test_client, num_rpcs)
+ lb_stats = self.getClientRpcStats(test_client, num_rpcs)
failed = int(lb_stats.num_failures)
self.assertEqual(
failed,
@@ -166,8 +409,8 @@ class XdsKubernetesTestCase(absltest.TestCase):
msg=f'Expected all RPCs to fail: {failed} of {num_rpcs} failed')
@staticmethod
- def sendRpcs(test_client: XdsTestClient,
- num_rpcs: int) -> LoadBalancerStatsResponse:
+ def getClientRpcStats(test_client: XdsTestClient,
+ num_rpcs: int) -> LoadBalancerStatsResponse:
lb_stats = test_client.get_load_balancer_stats(num_rpcs=num_rpcs)
logger.info(
'Received LoadBalancerStatsResponse from test client %s:\n%s',
@@ -183,51 +426,78 @@ class XdsKubernetesTestCase(absltest.TestCase):
msg=f'Backend {backend} did not receive a single RPC')
+class TdPropagationRetryableError(Exception):
+ pass
+
+
class RegularXdsKubernetesTestCase(XdsKubernetesTestCase):
- def setUp(self):
- super().setUp()
+ @classmethod
+ def setUpClass(cls):
+ """Hook method for setting up class fixture before running tests in
+ the class.
+ """
+ super().setUpClass()
+ if cls.server_maintenance_port is None:
+ cls.server_maintenance_port = KubernetesServerRunner.DEFAULT_MAINTENANCE_PORT
- # Traffic Director Configuration
- self.td = traffic_director.TrafficDirectorManager(
+ def initTrafficDirectorManager(self) -> TrafficDirectorManager:
+ return TrafficDirectorManager(
self.gcp_api_manager,
project=self.project,
- resource_prefix=self.namespace,
- network=self.network)
+ resource_prefix=self.resource_prefix,
+ resource_suffix=self.resource_suffix,
+ network=self.network,
+ compute_api_version=self.compute_api_version)
- # Test Server Runner
- self.server_runner = server_app.KubernetesServerRunner(
+ def initKubernetesServerRunner(self) -> KubernetesServerRunner:
+ return KubernetesServerRunner(
k8s.KubernetesNamespace(self.k8s_api_manager,
self.server_namespace),
deployment_name=self.server_name,
image_name=self.server_image,
- gcp_service_account=self.gcp_service_account,
td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
xds_server_uri=self.xds_server_uri,
- network=self.network)
+ network=self.network,
+ debug_use_port_forwarding=self.debug_use_port_forwarding,
+ enable_workload_identity=self.enable_workload_identity)
- # Test Client Runner
- self.client_runner = client_app.KubernetesClientRunner(
+ def initKubernetesClientRunner(self) -> KubernetesClientRunner:
+ return KubernetesClientRunner(
k8s.KubernetesNamespace(self.k8s_api_manager,
self.client_namespace),
deployment_name=self.client_name,
image_name=self.client_image,
- gcp_service_account=self.gcp_service_account,
td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
xds_server_uri=self.xds_server_uri,
network=self.network,
+ config_scope=self.config_scope,
debug_use_port_forwarding=self.debug_use_port_forwarding,
+ enable_workload_identity=self.enable_workload_identity,
stats_port=self.client_port,
reuse_namespace=self.server_namespace == self.client_namespace)
- def startTestServer(self, replica_count=1, **kwargs) -> XdsTestServer:
- test_server = self.server_runner.run(
+ def startTestServers(self,
+ replica_count=1,
+ server_runner=None,
+ **kwargs) -> List[XdsTestServer]:
+ if server_runner is None:
+ server_runner = self.server_runner
+ test_servers = server_runner.run(
replica_count=replica_count,
test_port=self.server_port,
maintenance_port=self.server_maintenance_port,
**kwargs)
- test_server.set_xds_address(self.server_xds_host, self.server_xds_port)
- return test_server
+ for test_server in test_servers:
+ test_server.set_xds_address(self.server_xds_host,
+ self.server_xds_port)
+ return test_servers
def startTestClient(self, test_server: XdsTestServer,
**kwargs) -> XdsTestClient:
@@ -237,7 +507,22 @@ class RegularXdsKubernetesTestCase(XdsKubernetesTestCase):
return test_client
+class AppNetXdsKubernetesTestCase(RegularXdsKubernetesTestCase):
+ td: TrafficDirectorAppNetManager
+
+ def initTrafficDirectorManager(self) -> TrafficDirectorAppNetManager:
+ return TrafficDirectorAppNetManager(
+ self.gcp_api_manager,
+ project=self.project,
+ resource_prefix=self.resource_prefix,
+ resource_suffix=self.resource_suffix,
+ network=self.network,
+ config_scope=self.config_scope,
+ compute_api_version=self.compute_api_version)
+
+
class SecurityXdsKubernetesTestCase(XdsKubernetesTestCase):
+ td: TrafficDirectorSecureManager
class SecurityMode(enum.Enum):
MTLS = enum.auto()
@@ -246,6 +531,9 @@ class SecurityXdsKubernetesTestCase(XdsKubernetesTestCase):
@classmethod
def setUpClass(cls):
+ """Hook method for setting up class fixture before running tests in
+ the class.
+ """
super().setUpClass()
if cls.server_maintenance_port is None:
# In secure mode, the maintenance port is different from
@@ -253,41 +541,45 @@ class SecurityXdsKubernetesTestCase(XdsKubernetesTestCase):
# Health Checks and Channelz tests available.
# When not provided, use explicit numeric port value, so
# Backend Health Checks are created on a fixed port.
- cls.server_maintenance_port = _DEFAULT_SECURE_MODE_MAINTENANCE_PORT
+ cls.server_maintenance_port = KubernetesServerRunner.DEFAULT_SECURE_MODE_MAINTENANCE_PORT
- def setUp(self):
- super().setUp()
-
- # Traffic Director Configuration
- self.td = traffic_director.TrafficDirectorSecureManager(
+ def initTrafficDirectorManager(self) -> TrafficDirectorSecureManager:
+ return TrafficDirectorSecureManager(
self.gcp_api_manager,
project=self.project,
- resource_prefix=self.namespace,
- network=self.network)
+ resource_prefix=self.resource_prefix,
+ resource_suffix=self.resource_suffix,
+ network=self.network,
+ compute_api_version=self.compute_api_version)
- # Test Server Runner
- self.server_runner = server_app.KubernetesServerRunner(
+ def initKubernetesServerRunner(self) -> KubernetesServerRunner:
+ return KubernetesServerRunner(
k8s.KubernetesNamespace(self.k8s_api_manager,
self.server_namespace),
deployment_name=self.server_name,
image_name=self.server_image,
+ td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
gcp_service_account=self.gcp_service_account,
network=self.network,
- td_bootstrap_image=self.td_bootstrap_image,
xds_server_uri=self.xds_server_uri,
deployment_template='server-secure.deployment.yaml',
debug_use_port_forwarding=self.debug_use_port_forwarding)
- # Test Client Runner
- self.client_runner = client_app.KubernetesClientRunner(
+ def initKubernetesClientRunner(self) -> KubernetesClientRunner:
+ return KubernetesClientRunner(
k8s.KubernetesNamespace(self.k8s_api_manager,
self.client_namespace),
deployment_name=self.client_name,
image_name=self.client_image,
- gcp_service_account=self.gcp_service_account,
td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
xds_server_uri=self.xds_server_uri,
network=self.network,
+ config_scope=self.config_scope,
deployment_template='client-secure.deployment.yaml',
stats_port=self.client_port,
reuse_namespace=self.server_namespace == self.client_namespace,
@@ -299,7 +591,7 @@ class SecurityXdsKubernetesTestCase(XdsKubernetesTestCase):
test_port=self.server_port,
maintenance_port=self.server_maintenance_port,
secure_mode=True,
- **kwargs)
+ **kwargs)[0]
test_server.set_xds_address(self.server_xds_host, self.server_xds_port)
return test_server
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_test_resources.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_test_resources.py
new file mode 100644
index 00000000..17b64eee
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_test_resources.py
@@ -0,0 +1,332 @@
+# Copyright 2021 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 test framework built for urlMap related xDS test cases."""
+
+import functools
+import inspect
+import time
+from typing import Any, Iterable, List, Mapping, Tuple
+
+from absl import flags
+from absl import logging
+
+from framework import xds_flags
+from framework import xds_k8s_flags
+import framework.helpers.rand
+from framework.infrastructure import gcp
+from framework.infrastructure import k8s
+from framework.infrastructure import traffic_director
+from framework.test_app import client_app
+from framework.test_app import server_app
+
+flags.adopt_module_key_flags(xds_flags)
+flags.adopt_module_key_flags(xds_k8s_flags)
+
+STRATEGY = flags.DEFINE_enum('strategy',
+ default='reuse',
+ enum_values=['create', 'keep', 'reuse'],
+ help='Strategy of GCP resources management')
+
+# Type alias
+UrlMapType = Any
+HostRule = Any
+PathMatcher = Any
+
+
+class _UrlMapChangeAggregator:
+ """Where all the urlMap change happens."""
+
+ def __init__(self, url_map_name: str):
+ self._map = {
+ "name": url_map_name,
+ "defaultService": GcpResourceManager().default_backend_service(),
+ "hostRules": [],
+ "pathMatchers": [],
+ }
+
+ def get_map(self) -> UrlMapType:
+ return self._map
+
+ def apply_change(self, test_case: 'XdsUrlMapTestCase') -> None:
+ logging.info('Apply urlMap change for test case: %s.%s',
+ test_case.short_module_name, test_case.__name__)
+ url_map_parts = test_case.url_map_change(
+ *self._get_test_case_url_map(test_case))
+ self._set_test_case_url_map(*url_map_parts)
+
+ def _get_test_case_url_map(
+ self,
+ test_case: 'XdsUrlMapTestCase') -> Tuple[HostRule, PathMatcher]:
+ host_rule = {
+ "hosts": [test_case.hostname()],
+ "pathMatcher": test_case.path_matcher_name(),
+ }
+ path_matcher = {
+ "name": test_case.path_matcher_name(),
+ "defaultService": GcpResourceManager().default_backend_service(),
+ }
+ return host_rule, path_matcher
+
+ def _set_test_case_url_map(self, host_rule: HostRule,
+ path_matcher: PathMatcher) -> None:
+ self._map["hostRules"].append(host_rule)
+ self._map["pathMatchers"].append(path_matcher)
+
+
+def _package_flags() -> Mapping[str, Any]:
+ """Automatically parse Abseil flags into a dictionary.
+
+ Abseil flag is only available after the Abseil app initialization. If we use
+ __new__ in our metaclass, the flag value parse will happen during the
+ initialization of modules, hence will fail. That's why we are using __call__
+ to inject metaclass magics, and the flag parsing will be delayed until the
+ class is about to be instantiated.
+ """
+ res = {}
+ for flag_module in [xds_flags, xds_k8s_flags]:
+ for key, value in inspect.getmembers(flag_module):
+ if isinstance(value, flags.FlagHolder):
+ res[key.lower()] = value.value
+ res['strategy'] = STRATEGY.value
+ return res
+
+
+class _MetaSingletonAndAbslFlags(type):
+ """Ensures singleton and injects flag values."""
+
+ # Allow different subclasses to create different singletons.
+ _instances = {}
+ # But we only parse Abseil flags once.
+ _flags = None
+
+ def __call__(cls, *args, **kwargs):
+ if cls not in cls._instances:
+ if cls._flags is None:
+ cls._flags = _package_flags()
+ obj = super().__call__(cls._flags, *args, **kwargs)
+ cls._instances[cls] = obj
+ return obj
+ return cls._instances[cls]
+
+
+class GcpResourceManager(metaclass=_MetaSingletonAndAbslFlags):
+ """Manages the lifecycle of GCP resources.
+
+ The GCP resources including:
+ - 3 K8s deployment (client, default backends, alternative backends)
+ - Full set of the Traffic Director stuff
+ - Merged gigantic urlMap from all imported test cases
+
+ All resources are intended to be used across test cases and multiple runs
+ (except the client K8s deployment).
+ """
+
+ # This class dynamically set, so disable "no-member" check.
+ # pylint: disable=no-member
+
+ def __init__(self, absl_flags: Mapping[str, Any] = None):
+ if absl_flags is not None:
+ for key in absl_flags:
+ setattr(self, key, absl_flags[key])
+ # Pick a client_namespace_suffix if not set
+ if self.resource_suffix is None:
+ self.resource_suffix = ""
+ else:
+ raise NotImplementedError(
+ 'Predefined resource_suffix is not supported for UrlMap tests')
+ logging.info('GcpResourceManager: resource prefix=%s, suffix=%s',
+ self.resource_prefix, self.resource_suffix)
+ # API managers
+ self.k8s_api_manager = k8s.KubernetesApiManager(self.kube_context)
+ self.gcp_api_manager = gcp.api.GcpApiManager()
+ self.td = traffic_director.TrafficDirectorManager(
+ self.gcp_api_manager,
+ self.project,
+ resource_prefix=self.resource_prefix,
+ resource_suffix=(self.resource_suffix or ""),
+ network=self.network,
+ compute_api_version=self.compute_api_version,
+ )
+ # Kubernetes namespace
+ self.k8s_namespace = k8s.KubernetesNamespace(self.k8s_api_manager,
+ self.resource_prefix)
+ # Kubernetes Test Servers
+ self.test_server_runner = server_app.KubernetesServerRunner(
+ self.k8s_namespace,
+ deployment_name=self.server_name,
+ image_name=self.server_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ enable_workload_identity=self.enable_workload_identity)
+ self.test_server_alternative_runner = server_app.KubernetesServerRunner(
+ self.k8s_namespace,
+ deployment_name=self.server_name + '-alternative',
+ image_name=self.server_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ enable_workload_identity=self.enable_workload_identity,
+ reuse_namespace=True)
+ self.test_server_affinity_runner = server_app.KubernetesServerRunner(
+ self.k8s_namespace,
+ deployment_name=self.server_name + '-affinity',
+ image_name=self.server_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ enable_workload_identity=self.enable_workload_identity,
+ reuse_namespace=True)
+ logging.info('Strategy of GCP resources management: %s', self.strategy)
+
+ def create_test_client_runner(self):
+ if self.resource_suffix:
+ client_namespace_suffix = self.resource_suffix
+ else:
+ client_namespace_suffix = framework.helpers.rand.random_resource_suffix(
+ )
+ logging.info('GcpResourceManager: client_namespace_suffix=%s',
+ client_namespace_suffix)
+ # Kubernetes Test Client
+ return client_app.KubernetesClientRunner(
+ k8s.KubernetesNamespace(
+ self.k8s_api_manager,
+ client_app.KubernetesClientRunner.make_namespace_name(
+ self.resource_prefix, client_namespace_suffix)),
+ deployment_name=self.client_name,
+ image_name=self.client_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ debug_use_port_forwarding=self.debug_use_port_forwarding,
+ enable_workload_identity=self.enable_workload_identity,
+ stats_port=self.client_port)
+
+ def _pre_cleanup(self):
+ # Cleanup existing debris
+ logging.info('GcpResourceManager: pre clean-up')
+ self.td.cleanup(force=True)
+ self.test_server_runner.delete_namespace()
+
+ def setup(self, test_case_classes: Iterable['XdsUrlMapTestCase']) -> None:
+ if self.strategy not in ['create', 'keep']:
+ logging.info('GcpResourceManager: skipping setup for strategy [%s]',
+ self.strategy)
+ return
+ # Clean up debris from previous runs
+ self._pre_cleanup()
+ # Start creating GCP resources
+ logging.info('GcpResourceManager: start setup')
+ # Firewall
+ if self.ensure_firewall:
+ self.td.create_firewall_rule(
+ allowed_ports=self.firewall_allowed_ports)
+ # Health Checks
+ self.td.create_health_check()
+ # Backend Services
+ self.td.create_backend_service()
+ self.td.create_alternative_backend_service()
+ self.td.create_affinity_backend_service()
+ # Construct UrlMap from test classes
+ aggregator = _UrlMapChangeAggregator(
+ url_map_name=self.td.make_resource_name(self.td.URL_MAP_NAME))
+ for test_case_class in test_case_classes:
+ aggregator.apply_change(test_case_class)
+ final_url_map = aggregator.get_map()
+ # UrlMap
+ self.td.create_url_map_with_content(final_url_map)
+ # Target Proxy
+ self.td.create_target_proxy()
+ # Forwarding Rule
+ self.td.create_forwarding_rule(self.server_xds_port)
+ # Kubernetes Test Server
+ self.test_server_runner.run(
+ test_port=self.server_port,
+ maintenance_port=self.server_maintenance_port)
+ # Kubernetes Test Server Alternative
+ self.test_server_alternative_runner.run(
+ test_port=self.server_port,
+ maintenance_port=self.server_maintenance_port)
+ # Kubernetes Test Server Affinity. 3 endpoints to test that only the
+ # picked sub-channel is connected.
+ self.test_server_affinity_runner.run(
+ test_port=self.server_port,
+ maintenance_port=self.server_maintenance_port,
+ replica_count=3)
+ # Add backend to default backend service
+ neg_name, neg_zones = self.k8s_namespace.get_service_neg(
+ self.test_server_runner.service_name, self.server_port)
+ self.td.backend_service_add_neg_backends(neg_name, neg_zones)
+ # Add backend to alternative backend service
+ neg_name_alt, neg_zones_alt = self.k8s_namespace.get_service_neg(
+ self.test_server_alternative_runner.service_name, self.server_port)
+ self.td.alternative_backend_service_add_neg_backends(
+ neg_name_alt, neg_zones_alt)
+ # Add backend to affinity backend service
+ neg_name_affinity, neg_zones_affinity = self.k8s_namespace.get_service_neg(
+ self.test_server_affinity_runner.service_name, self.server_port)
+ self.td.affinity_backend_service_add_neg_backends(
+ neg_name_affinity, neg_zones_affinity)
+ # Wait for healthy backends
+ self.td.wait_for_backends_healthy_status()
+ self.td.wait_for_alternative_backends_healthy_status()
+ self.td.wait_for_affinity_backends_healthy_status()
+
+ def cleanup(self) -> None:
+ if self.strategy not in ['create']:
+ logging.info(
+ 'GcpResourceManager: skipping tear down for strategy [%s]',
+ self.strategy)
+ return
+ logging.info('GcpResourceManager: start tear down')
+ if hasattr(self, 'td'):
+ self.td.cleanup(force=True)
+ if hasattr(self, 'test_server_runner'):
+ self.test_server_runner.cleanup(force=True)
+ if hasattr(self, 'test_server_alternative_runner'):
+ self.test_server_alternative_runner.cleanup(force=True,
+ force_namespace=True)
+ if hasattr(self, 'test_server_affinity_runner'):
+ self.test_server_affinity_runner.cleanup(force=True,
+ force_namespace=True)
+
+ @functools.lru_cache(None)
+ def default_backend_service(self) -> str:
+ """Returns default backend service URL."""
+ self.td.load_backend_service()
+ return self.td.backend_service.url
+
+ @functools.lru_cache(None)
+ def alternative_backend_service(self) -> str:
+ """Returns alternative backend service URL."""
+ self.td.load_alternative_backend_service()
+ return self.td.alternative_backend_service.url
+
+ @functools.lru_cache(None)
+ def affinity_backend_service(self) -> str:
+ """Returns affinity backend service URL."""
+ self.td.load_affinity_backend_service()
+ return self.td.affinity_backend_service.url
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py
new file mode 100644
index 00000000..2d9ca9f7
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py
@@ -0,0 +1,473 @@
+# Copyright 2021 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 test framework built for urlMap related xDS test cases."""
+
+import abc
+from dataclasses import dataclass
+import datetime
+import json
+import os
+import re
+import sys
+import time
+from typing import Any, Iterable, Mapping, Optional, Tuple
+import unittest
+
+from absl import flags
+from absl import logging
+from absl.testing import absltest
+from google.protobuf import json_format
+import grpc
+
+from framework import xds_k8s_testcase
+from framework import xds_url_map_test_resources
+from framework.helpers import retryers
+from framework.helpers import skips
+from framework.test_app import client_app
+
+# Load existing flags
+flags.adopt_module_key_flags(xds_k8s_testcase)
+flags.adopt_module_key_flags(xds_url_map_test_resources)
+
+# Define urlMap specific flags
+QPS = flags.DEFINE_integer('qps', default=25, help='The QPS client is sending')
+
+# Test configs
+_URL_MAP_PROPAGATE_TIMEOUT_SEC = 600
+# With the per-run IAM change, the first xDS response has a several minutes
+# delay. We want to increase the interval, reduce the log spam.
+_URL_MAP_PROPAGATE_CHECK_INTERVAL_SEC = 15
+URL_MAP_TESTCASE_FILE_SUFFIX = '_test.py'
+_CLIENT_CONFIGURE_WAIT_SEC = 2
+
+# Type aliases
+XdsTestClient = client_app.XdsTestClient
+GcpResourceManager = xds_url_map_test_resources.GcpResourceManager
+HostRule = xds_url_map_test_resources.HostRule
+PathMatcher = xds_url_map_test_resources.PathMatcher
+JsonType = Any
+
+# ProtoBuf translatable RpcType enums
+RpcTypeUnaryCall = 'UNARY_CALL'
+RpcTypeEmptyCall = 'EMPTY_CALL'
+
+
+def _split_camel(s: str, delimiter: str = '-') -> str:
+ """Turn camel case name to snake-case-like name."""
+ return ''.join(delimiter + c.lower() if c.isupper() else c
+ for c in s).lstrip(delimiter)
+
+
+class DumpedXdsConfig(dict):
+ """A convenience class to check xDS config.
+
+ Feel free to add more pre-compute fields.
+ """
+
+ def __init__(self, xds_json: JsonType):
+ super().__init__(xds_json)
+ self.json_config = xds_json
+ self.lds = None
+ self.rds = None
+ self.rds_version = None
+ self.cds = []
+ self.eds = []
+ self.endpoints = []
+ for xds_config in self.get('xdsConfig', []):
+ try:
+ if 'listenerConfig' in xds_config:
+ self.lds = xds_config['listenerConfig']['dynamicListeners'][
+ 0]['activeState']['listener']
+ elif 'routeConfig' in xds_config:
+ self.rds = xds_config['routeConfig']['dynamicRouteConfigs'][
+ 0]['routeConfig']
+ self.rds_version = xds_config['routeConfig'][
+ 'dynamicRouteConfigs'][0]['versionInfo']
+ elif 'clusterConfig' in xds_config:
+ for cluster in xds_config['clusterConfig'][
+ 'dynamicActiveClusters']:
+ self.cds.append(cluster['cluster'])
+ elif 'endpointConfig' in xds_config:
+ for endpoint in xds_config['endpointConfig'][
+ 'dynamicEndpointConfigs']:
+ self.eds.append(endpoint['endpointConfig'])
+ except Exception as e:
+ logging.debug('Parsing dumped xDS config failed with %s: %s',
+ type(e), e)
+ for generic_xds_config in self.get('genericXdsConfigs', []):
+ try:
+ if re.search(r'\.Listener$', generic_xds_config['typeUrl']):
+ self.lds = generic_xds_config["xdsConfig"]
+ elif re.search(r'\.RouteConfiguration$',
+ generic_xds_config['typeUrl']):
+ self.rds = generic_xds_config["xdsConfig"]
+ self.rds_version = generic_xds_config["versionInfo"]
+ elif re.search(r'\.Cluster$', generic_xds_config['typeUrl']):
+ self.cds.append(generic_xds_config["xdsConfig"])
+ elif re.search(r'\.ClusterLoadAssignment$',
+ generic_xds_config['typeUrl']):
+ self.eds.append(generic_xds_config["xdsConfig"])
+ except Exception as e:
+ logging.debug('Parsing dumped xDS config failed with %s: %s',
+ type(e), e)
+ for endpoint_config in self.eds:
+ for endpoint in endpoint_config.get('endpoints', {}):
+ for lb_endpoint in endpoint.get('lbEndpoints', {}):
+ try:
+ if lb_endpoint['healthStatus'] == 'HEALTHY':
+ self.endpoints.append(
+ '%s:%s' % (lb_endpoint['endpoint']['address']
+ ['socketAddress']['address'],
+ lb_endpoint['endpoint']['address']
+ ['socketAddress']['portValue']))
+ except Exception as e:
+ logging.debug('Parse endpoint failed with %s: %s',
+ type(e), e)
+
+ def __str__(self) -> str:
+ return json.dumps(self, indent=2)
+
+
+class RpcDistributionStats:
+ """A convenience class to check RPC distribution.
+
+ Feel free to add more pre-compute fields.
+ """
+ num_failures: int
+ num_oks: int
+ default_service_rpc_count: int
+ alternative_service_rpc_count: int
+ unary_call_default_service_rpc_count: int
+ empty_call_default_service_rpc_count: int
+ unary_call_alternative_service_rpc_count: int
+ empty_call_alternative_service_rpc_count: int
+
+ def __init__(self, json_lb_stats: JsonType):
+ self.num_failures = json_lb_stats.get('numFailures', 0)
+
+ self.num_peers = 0
+ self.num_oks = 0
+ self.default_service_rpc_count = 0
+ self.alternative_service_rpc_count = 0
+ self.unary_call_default_service_rpc_count = 0
+ self.empty_call_default_service_rpc_count = 0
+ self.unary_call_alternative_service_rpc_count = 0
+ self.empty_call_alternative_service_rpc_count = 0
+ self.raw = json_lb_stats
+
+ if 'rpcsByPeer' in json_lb_stats:
+ self.num_peers = len(json_lb_stats['rpcsByPeer'])
+ if 'rpcsByMethod' in json_lb_stats:
+ for rpc_type in json_lb_stats['rpcsByMethod']:
+ for peer in json_lb_stats['rpcsByMethod'][rpc_type][
+ 'rpcsByPeer']:
+ count = json_lb_stats['rpcsByMethod'][rpc_type][
+ 'rpcsByPeer'][peer]
+ self.num_oks += count
+ if rpc_type == 'UnaryCall':
+ if 'alternative' in peer:
+ self.unary_call_alternative_service_rpc_count = count
+ self.alternative_service_rpc_count += count
+ else:
+ self.unary_call_default_service_rpc_count = count
+ self.default_service_rpc_count += count
+ else:
+ if 'alternative' in peer:
+ self.empty_call_alternative_service_rpc_count = count
+ self.alternative_service_rpc_count += count
+ else:
+ self.empty_call_default_service_rpc_count = count
+ self.default_service_rpc_count += count
+
+
+@dataclass
+class ExpectedResult:
+ """Describes the expected result of assertRpcStatusCode method below."""
+ rpc_type: str = RpcTypeUnaryCall
+ status_code: grpc.StatusCode = grpc.StatusCode.OK
+ ratio: float = 1
+
+
+class _MetaXdsUrlMapTestCase(type):
+ """Tracking test case subclasses."""
+
+ # Automatic discover of all subclasses
+ _test_case_classes = []
+ _test_case_names = set()
+ # Keep track of started and finished test cases, so we know when to setup
+ # and tear down GCP resources.
+ _started_test_cases = set()
+ _finished_test_cases = set()
+
+ def __new__(cls, name: str, bases: Iterable[Any],
+ attrs: Mapping[str, Any]) -> Any:
+ # Hand over the tracking objects
+ attrs['test_case_classes'] = cls._test_case_classes
+ attrs['test_case_names'] = cls._test_case_names
+ attrs['started_test_cases'] = cls._started_test_cases
+ attrs['finished_test_cases'] = cls._finished_test_cases
+ # Handle the test name reflection
+ module_name = os.path.split(
+ sys.modules[attrs['__module__']].__file__)[-1]
+ if module_name.endswith(URL_MAP_TESTCASE_FILE_SUFFIX):
+ module_name = module_name.replace(URL_MAP_TESTCASE_FILE_SUFFIX, '')
+ attrs['short_module_name'] = module_name.replace('_', '-')
+ # Create the class and track
+ new_class = type.__new__(cls, name, bases, attrs)
+ if name.startswith('Test'):
+ cls._test_case_names.add(name)
+ cls._test_case_classes.append(new_class)
+ else:
+ logging.debug('Skipping test case class: %s', name)
+ return new_class
+
+
+class XdsUrlMapTestCase(absltest.TestCase, metaclass=_MetaXdsUrlMapTestCase):
+ """XdsUrlMapTestCase is the base class for urlMap related tests.
+
+ The subclass is expected to implement 3 methods:
+
+ - url_map_change: Updates the urlMap components for this test case
+ - xds_config_validate: Validates if the client received legit xDS configs
+ - rpc_distribution_validate: Validates if the routing behavior is correct
+ """
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ """Allow the test case to decide whether it supports the given config.
+
+ Returns:
+ A bool indicates if the given config is supported.
+ """
+ return True
+
+ @staticmethod
+ def client_init_config(rpc: str, metadata: str) -> Tuple[str, str]:
+ """Updates the initial RPC configs for this test case.
+
+ Each test case will start a test client. The client takes RPC configs
+ and starts to send RPCs immediately. The config returned by this
+ function will be used to replace the default configs.
+
+ The default configs are passed in as arguments, so this method can
+ modify part of them.
+
+ Args:
+ rpc: The default rpc config, specifying RPCs to send, format
+ 'UnaryCall,EmptyCall'
+ metadata: The metadata config, specifying metadata to send with each
+ RPC, format 'EmptyCall:key1:value1,UnaryCall:key2:value2'.
+
+ Returns:
+ A tuple contains the updated rpc and metadata config.
+ """
+ return rpc, metadata
+
+ @staticmethod
+ @abc.abstractmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ """Updates the dedicated urlMap components for this test case.
+
+ Each test case will have a dedicated HostRule, where the hostname is
+ generated from the test case name. The HostRule will be linked to a
+ PathMatcher, where stores the routing logic.
+
+ Args:
+ host_rule: A HostRule GCP resource as a JSON dict.
+ path_matcher: A PathMatcher GCP resource as a JSON dict.
+
+ Returns:
+ A tuple contains the updated version of given HostRule and
+ PathMatcher.
+ """
+ pass
+
+ @abc.abstractmethod
+ def xds_config_validate(self, xds_config: DumpedXdsConfig) -> None:
+ """Validates received xDS config, if anything is wrong, raise.
+
+ This stage only ends when the control plane failed to send a valid
+ config within a given time range, like 600s.
+
+ Args:
+ xds_config: A DumpedXdsConfig instance can be used as a JSON dict,
+ but also provides helper fields for commonly checked xDS config.
+ """
+ pass
+
+ @abc.abstractmethod
+ def rpc_distribution_validate(self, client: XdsTestClient) -> None:
+ """Validates the routing behavior, if any is wrong, raise.
+
+ Args:
+ client: A XdsTestClient instance for all sorts of end2end testing.
+ """
+ pass
+
+ @classmethod
+ def hostname(cls):
+ return "%s.%s:%s" % (cls.short_module_name, _split_camel(
+ cls.__name__), GcpResourceManager().server_xds_port)
+
+ @classmethod
+ def path_matcher_name(cls):
+ # Path matcher name must match r'(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'
+ return "%s-%s-pm" % (cls.short_module_name, _split_camel(cls.__name__))
+
+ @classmethod
+ def setUpClass(cls):
+ # Raises unittest.SkipTest if given client/server/version does not
+ # support current test case.
+ skips.evaluate_test_config(cls.is_supported)
+
+ if not cls.started_test_cases:
+ # Create the GCP resource once before the first test start
+ GcpResourceManager().setup(cls.test_case_classes)
+ cls.started_test_cases.add(cls.__name__)
+
+ # Create the test case's own client runner with it's own namespace,
+ # enables concurrent running with other test cases.
+ cls.test_client_runner = GcpResourceManager().create_test_client_runner(
+ )
+ # Start the client, and allow the test to override the initial RPC config.
+ rpc, metadata = cls.client_init_config(rpc="UnaryCall,EmptyCall",
+ metadata="")
+ cls.test_client = cls.test_client_runner.run(
+ server_target=f'xds:///{cls.hostname()}',
+ rpc=rpc,
+ metadata=metadata,
+ qps=QPS.value,
+ print_response=True)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.test_client_runner.cleanup(force=True, force_namespace=True)
+ cls.finished_test_cases.add(cls.__name__)
+ if cls.finished_test_cases == cls.test_case_names:
+ # Tear down the GCP resource after all tests finished
+ GcpResourceManager().cleanup()
+
+ def _fetch_and_check_xds_config(self):
+ # Cleanup state for this attempt
+ self._xds_json_config = None
+ # Fetch client config
+ config = self.test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ self.assertIsNotNone(config)
+ # Found client config, test it.
+ self._xds_json_config = json_format.MessageToDict(config)
+ # Execute the child class provided validation logic
+ self.xds_config_validate(DumpedXdsConfig(self._xds_json_config))
+
+ def run(self, result: unittest.TestResult = None) -> None:
+ """Abort this test case if CSDS check is failed.
+
+ This prevents the test runner to waste time on RPC distribution test,
+ and yields clearer signal.
+ """
+ if result.failures or result.errors:
+ logging.info('Aborting %s', self.__class__.__name__)
+ else:
+ super().run(result)
+
+ def test_client_config(self):
+ retryer = retryers.constant_retryer(
+ wait_fixed=datetime.timedelta(
+ seconds=_URL_MAP_PROPAGATE_CHECK_INTERVAL_SEC),
+ timeout=datetime.timedelta(seconds=_URL_MAP_PROPAGATE_TIMEOUT_SEC),
+ logger=logging,
+ log_level=logging.INFO)
+ try:
+ retryer(self._fetch_and_check_xds_config)
+ finally:
+ logging.info(
+ 'latest xDS config:\n%s',
+ GcpResourceManager().td.compute.resource_pretty_format(
+ self._xds_json_config))
+
+ def test_rpc_distribution(self):
+ self.rpc_distribution_validate(self.test_client)
+
+ @staticmethod
+ def configure_and_send(test_client: XdsTestClient,
+ *,
+ rpc_types: Iterable[str],
+ metadata: Optional[Iterable[Tuple[str, str,
+ str]]] = None,
+ app_timeout: Optional[int] = None,
+ num_rpcs: int) -> RpcDistributionStats:
+ test_client.update_config.configure(rpc_types=rpc_types,
+ metadata=metadata,
+ app_timeout=app_timeout)
+ # Configure RPC might race with get stats RPC on slower machines.
+ time.sleep(_CLIENT_CONFIGURE_WAIT_SEC)
+ json_lb_stats = json_format.MessageToDict(
+ test_client.get_load_balancer_stats(num_rpcs=num_rpcs))
+ logging.info(
+ 'Received LoadBalancerStatsResponse from test client %s:\n%s',
+ test_client.ip, json.dumps(json_lb_stats, indent=2))
+ return RpcDistributionStats(json_lb_stats)
+
+ def assertNumEndpoints(self, xds_config: DumpedXdsConfig, k: int) -> None:
+ self.assertLen(
+ xds_config.endpoints, k,
+ f'insufficient endpoints in EDS: want={k} seen={xds_config.endpoints}'
+ )
+
+ def assertRpcStatusCode(self, test_client: XdsTestClient, *,
+ expected: Iterable[ExpectedResult], length: int,
+ tolerance: float) -> None:
+ """Assert the distribution of RPC statuses over a period of time."""
+ # Sending with pre-set QPS for a period of time
+ before_stats = test_client.get_load_balancer_accumulated_stats()
+ logging.info(
+ 'Received LoadBalancerAccumulatedStatsResponse from test client %s: before:\n%s',
+ test_client.ip, before_stats)
+ time.sleep(length)
+ after_stats = test_client.get_load_balancer_accumulated_stats()
+ logging.info(
+ 'Received LoadBalancerAccumulatedStatsResponse from test client %s: after: \n%s',
+ test_client.ip, after_stats)
+
+ # Validate the diff
+ for expected_result in expected:
+ rpc = expected_result.rpc_type
+ status = expected_result.status_code.value[0]
+ # Compute observation
+ # ProtoBuf messages has special magic dictionary that we don't need
+ # to catch exceptions:
+ # https://developers.google.com/protocol-buffers/docs/reference/python-generated#undefined
+ seen_after = after_stats.stats_per_method[rpc].result[status]
+ seen_before = before_stats.stats_per_method[rpc].result[status]
+ seen = seen_after - seen_before
+ # Compute total number of RPC started
+ stats_per_method_after = after_stats.stats_per_method.get(
+ rpc, {}).result.items()
+ total_after = sum(
+ x[1] for x in stats_per_method_after) # (status_code, count)
+ stats_per_method_before = before_stats.stats_per_method.get(
+ rpc, {}).result.items()
+ total_before = sum(
+ x[1] for x in stats_per_method_before) # (status_code, count)
+ total = total_after - total_before
+ # Compute and validate the number
+ want = total * expected_result.ratio
+ diff_ratio = abs(seen - want) / total
+ self.assertLessEqual(
+ diff_ratio, tolerance,
+ 'Expect rpc [%s] to return [%s] at %.2f ratio: seen=%d want=%d total=%d diff_ratio=%.4f > %.2f'
+ % (rpc, expected_result.status_code, expected_result.ratio,
+ seen, want, total, diff_ratio, tolerance))
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client-secure.deployment.yaml b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client-secure.deployment.yaml
index 6db4192e..3aa5c67d 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client-secure.deployment.yaml
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client-secure.deployment.yaml
@@ -25,6 +25,7 @@ spec:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
+ restartPolicy: Never
args:
- "--server=${server_target}"
- "--stats_port=${stats_port}"
@@ -62,6 +63,9 @@ spec:
% if xds_server_uri:
- "--xds-server-uri=${xds_server_uri}"
% endif
+ % if config_scope:
+ - "--config-scope-experimental=${config_scope_experimental}"
+ % endif
- "--include-v3-features-experimental"
- "--include-psm-security-experimental"
resources:
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client.deployment.yaml b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client.deployment.yaml
index 9449e513..268cc1ca 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client.deployment.yaml
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/client.deployment.yaml
@@ -18,22 +18,30 @@ spec:
app: ${deployment_name}
owner: xds-k8s-interop-test
spec:
+ % if service_account_name:
serviceAccountName: ${service_account_name}
+ % endif
containers:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
+ restartPolicy: Never
args:
- "--server=${server_target}"
- "--stats_port=${stats_port}"
- "--qps=${qps}"
- "--rpc=${rpc}"
+ - "--metadata=${metadata}"
- "--print_response=${print_response}"
ports:
- containerPort: ${stats_port}
env:
- name: GRPC_XDS_BOOTSTRAP
value: "/tmp/grpc-xds/td-grpc-bootstrap.json"
+ - name: GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH
+ value: "true"
+ - name: GRPC_XDS_EXPERIMENTAL_ENABLE_RETRY
+ value: "true"
volumeMounts:
- mountPath: /tmp/grpc-xds/
name: grpc-td-conf
@@ -55,6 +63,9 @@ spec:
% if xds_server_uri:
- "--xds-server-uri=${xds_server_uri}"
% endif
+ % if config_scope:
+ - "--config-scope-experimental=${config_scope}"
+ % endif
resources:
limits:
cpu: 100m
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server-secure.deployment.yaml b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server-secure.deployment.yaml
index 151aede4..1cad2037 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server-secure.deployment.yaml
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server-secure.deployment.yaml
@@ -25,6 +25,7 @@ spec:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
+ restartPolicy: Never
args:
- "--port=${test_port}"
- "--maintenance_port=${maintenance_port}"
@@ -42,6 +43,8 @@ spec:
# TODO(sergiitk): this should be conditional for if version < v1.37.x
- name: GRPC_XDS_EXPERIMENTAL_NEW_SERVER_API
value: "true"
+ - name: GRPC_XDS_EXPERIMENTAL_RBAC
+ value: "true"
volumeMounts:
- mountPath: /tmp/grpc-xds/
name: grpc-td-conf
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml
index e3ace2eb..75877400 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/kubernetes-manifests/server.deployment.yaml
@@ -16,16 +16,29 @@ spec:
metadata:
labels:
app: ${deployment_name}
+ owner: xds-k8s-interop-test
spec:
+ % if service_account_name:
serviceAccountName: ${service_account_name}
+ % endif
containers:
- name: ${deployment_name}
image: ${image_name}
imagePullPolicy: Always
+ restartPolicy: Never
args:
- "--port=${test_port}"
ports:
- containerPort: ${test_port}
+ env:
+ - name: GRPC_XDS_BOOTSTRAP
+ value: "/tmp/grpc-xds/td-grpc-bootstrap.json"
+ - name: GRPC_XDS_EXPERIMENTAL_V3_SUPPORT
+ value: "true"
+ volumeMounts:
+ - mountPath: /tmp/grpc-xds/
+ name: grpc-td-conf
+ readOnly: true
resources:
limits:
cpu: 800m
@@ -33,4 +46,30 @@ spec:
requests:
cpu: 100m
memory: 512Mi
+ initContainers:
+ - name: grpc-td-init
+ image: ${td_bootstrap_image}
+ imagePullPolicy: Always
+ args:
+ - "--output=/tmp/bootstrap/td-grpc-bootstrap.json"
+ - "--vpc-network-name=${network}"
+ % if xds_server_uri:
+ - "--xds-server-uri=${xds_server_uri}"
+ % endif
+ - "--include-v3-features-experimental"
+ - "--node-metadata-experimental=app=${namespace_name}-${deployment_name}"
+ resources:
+ limits:
+ cpu: 100m
+ memory: 100Mi
+ requests:
+ cpu: 10m
+ memory: 100Mi
+ volumeMounts:
+ - mountPath: /tmp/bootstrap/
+ name: grpc-td-conf
+ volumes:
+ - name: grpc-td-conf
+ emptyDir:
+ medium: Memory
...
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/requirements-dev.txt b/grpc/tools/run_tests/xds_k8s_test_driver/requirements-dev.txt
new file mode 100644
index 00000000..27dc27bd
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/requirements-dev.txt
@@ -0,0 +1,4 @@
+-r requirements.txt
+yapf==0.30.0 # Mirrors yapf version set in https://github.com/grpc/grpc/blob/master/tools/distrib/yapf_code.sh
+isort~=5.9
+# TODO(https://github.com/grpc/grpc/pull/25872): mypy
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/requirements.txt b/grpc/tools/run_tests/xds_k8s_test_driver/requirements.txt
index bf7fb6bd..ba785fcb 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/requirements.txt
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/requirements.txt
@@ -1,15 +1,21 @@
Mako~=1.1
PyYAML~=5.3
absl-py~=0.11
-dataclasses~=0.8
+dataclasses~=0.8; python_version < '3.7'
google-api-python-client~=1.12
google-cloud-secret-manager~=2.1
grpcio~=1.34
+grpcio-health-checking~=1.34
grpcio-tools~=1.34
grpcio-channelz~=1.34
kubernetes~=12.0
# TODO(sergiitk): remove retrying when replaced with tenacity in code.
# Context: https://github.com/grpc/grpc/pull/24983#discussion_r543017022
retrying~=1.3
+six~=1.13
tenacity~=6.2
+packaging~=21.3
+Pygments~=2.9
+python-dateutil~=2.8
protobuf~=3.14
+xds-protos~=0.0.8
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/run.sh b/grpc/tools/run_tests/xds_k8s_test_driver/run.sh
new file mode 100755
index 00000000..a4dde337
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/run.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+XDS_K8S_DRIVER_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+readonly XDS_K8S_DRIVER_DIR
+readonly XDS_K8S_CONFIG="${XDS_K8S_CONFIG:-$XDS_K8S_DRIVER_DIR/config/local-dev.cfg}"
+
+display_usage() {
+ cat <<EOF >/dev/stderr
+Convenience script to execute tests/ and helper bin/ scripts.
+
+USAGE: $0 script_path [arguments]
+ script_path: path to python script to execute, relative to driver root folder
+ arguments ...: arguments passed to program in sys.argv
+
+ENVIRONMENT:
+ XDS_K8S_CONFIG: file path to the config flagfile, relative to
+ driver root folder. Default: config/local-dev.cfg
+ Will be appended as --flagfile="config_absolute_path" argument
+ XDS_K8S_DRIVER_VENV_DIR: the path to python virtual environment directory
+ Default: $XDS_K8S_DRIVER_DIR/venv
+DESCRIPTION:
+This tool performs the following:
+1) Ensures python virtual env installed and activated
+2) Exports test driver root in PYTHONPATH
+3) Automatically appends --flagfile="\$XDS_K8S_CONFIG" argument
+
+EXAMPLES:
+$0 bin/run_td_setup.py --help # list script-specific options
+$0 bin/run_td_setup.py --helpfull # list all available options
+XDS_K8S_CONFIG=./path-to-flagfile.cfg ./run.sh bin/run_td_setup.py --resource_suffix=override-suffix
+$0 tests/baseline_test.py
+$0 tests/security_test.py --verbosity=1 --logger_levels=__main__:DEBUG,framework:DEBUG
+$0 tests/security_test.py SecurityTest.test_mtls --nocheck_local_certs
+EOF
+ exit 1
+}
+
+if [[ "$#" -eq 0 || "$1" = "-h" || "$1" = "--help" ]]; then
+ display_usage
+fi
+
+# Relative paths not yet supported by shellcheck.
+# shellcheck source=/dev/null
+source "${XDS_K8S_DRIVER_DIR}/bin/ensure_venv.sh"
+
+cd "${XDS_K8S_DRIVER_DIR}"
+export PYTHONPATH="${XDS_K8S_DRIVER_DIR}"
+# Split path to python file from the rest of the args.
+readonly PY_FILE="$1"
+shift
+# Append args after --flagfile, so they take higher priority.
+exec python "${PY_FILE}" --flagfile="${XDS_K8S_CONFIG}" "$@"
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py
new file mode 100644
index 00000000..6032eb3d
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/affinity_test.py
@@ -0,0 +1,164 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 time
+from typing import List, Optional
+
+from absl import flags
+from absl.testing import absltest
+from google.protobuf import json_format
+
+from framework import xds_k8s_testcase
+from framework import xds_url_map_testcase
+from framework.helpers import skips
+from framework.infrastructure import k8s
+from framework.rpc import grpc_channelz
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+_ChannelzChannelState = grpc_channelz.ChannelState
+
+# Testing consts
+_TEST_AFFINITY_METADATA_KEY = 'xds_md'
+_TD_PROPAGATE_CHECK_INTERVAL_SEC = 10
+_TD_PROPAGATE_TIMEOUT = 600
+_REPLICA_COUNT = 3
+_RPC_COUNT = 100
+
+
+class AffinityTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ @staticmethod
+ def isSupported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'java', 'python', 'go']:
+ return config.version_ge('v1.40.x')
+ return False
+
+ def test_affinity(self) -> None:
+
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service(
+ affinity_header=_TEST_AFFINITY_METADATA_KEY)
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.test_servers: List[_XdsTestServer] = self.startTestServers(
+ replica_count=_REPLICA_COUNT)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+
+ with self.subTest('07_start_test_client'):
+ self.test_client: _XdsTestClient = self.startTestClient(
+ self.test_servers[0],
+ rpc='EmptyCall',
+ metadata='EmptyCall:%s:123' % _TEST_AFFINITY_METADATA_KEY)
+ # Validate the number of received endpoints and affinity configs.
+ config = self.test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ self.assertIsNotNone(config)
+ json_config = json_format.MessageToDict(config)
+ parsed = xds_url_map_testcase.DumpedXdsConfig(json_config)
+ logging.info('Client received CSDS response: %s', parsed)
+ self.assertLen(parsed.endpoints, _REPLICA_COUNT)
+ self.assertEqual(
+ parsed.rds['virtualHosts'][0]['routes'][0]['route']
+ ['hashPolicy'][0]['header']['headerName'],
+ _TEST_AFFINITY_METADATA_KEY)
+ self.assertEqual(parsed.cds[0]['lbPolicy'], 'RING_HASH')
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(self.test_client)
+
+ with self.subTest('09_test_server_received_rpcs_from_test_client'):
+ self.assertSuccessfulRpcs(self.test_client)
+
+ with self.subTest('10_first_100_affinity_rpcs_pick_same_backend'):
+ rpc_stats = self.getClientRpcStats(self.test_client, _RPC_COUNT)
+ json_lb_stats = json_format.MessageToDict(rpc_stats)
+ rpc_distribution = xds_url_map_testcase.RpcDistributionStats(
+ json_lb_stats)
+ self.assertEqual(1, rpc_distribution.num_peers)
+ self.assertLen(
+ self.test_client.find_subchannels_with_state(
+ _ChannelzChannelState.READY),
+ 1,
+ )
+ self.assertLen(
+ self.test_client.find_subchannels_with_state(
+ _ChannelzChannelState.IDLE),
+ 2,
+ )
+ # Remember the backend inuse, and turn it down later.
+ self.first_backend_inuse = list(
+ rpc_distribution.raw['rpcsByPeer'].keys())[0]
+
+ with self.subTest('11_turn_down_server_in_use'):
+ for s in self.test_servers:
+ if s.pod_name == self.first_backend_inuse:
+ logging.info('setting backend %s to NOT_SERVING',
+ s.pod_name)
+ s.set_not_serving()
+
+ with self.subTest('12_wait_for_unhealth_status_propagation'):
+ deadline = time.time() + _TD_PROPAGATE_TIMEOUT
+ parsed = None
+ try:
+ while time.time() < deadline:
+ config = self.test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ self.assertIsNotNone(config)
+ json_config = json_format.MessageToDict(config)
+ parsed = xds_url_map_testcase.DumpedXdsConfig(json_config)
+ if len(parsed.endpoints) == _REPLICA_COUNT - 1:
+ break
+ logging.info(
+ 'CSDS got unexpected endpoints, will retry after %d seconds',
+ _TD_PROPAGATE_CHECK_INTERVAL_SEC)
+ time.sleep(_TD_PROPAGATE_CHECK_INTERVAL_SEC)
+ else:
+ self.fail(
+ 'unhealthy status did not propagate after 600 seconds')
+ finally:
+ logging.info('Client received CSDS response: %s', parsed)
+
+ with self.subTest('12_next_100_affinity_rpcs_pick_different_backend'):
+ rpc_stats = self.getClientRpcStats(self.test_client, _RPC_COUNT)
+ json_lb_stats = json_format.MessageToDict(rpc_stats)
+ rpc_distribution = xds_url_map_testcase.RpcDistributionStats(
+ json_lb_stats)
+ self.assertEqual(1, rpc_distribution.num_peers)
+ new_backend_inuse = list(
+ rpc_distribution.raw['rpcsByPeer'].keys())[0]
+ self.assertNotEqual(new_backend_inuse, self.first_backend_inuse)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/api_listener_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/api_listener_test.py
new file mode 100644
index 00000000..ace26688
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/api_listener_test.py
@@ -0,0 +1,111 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+
+from absl import flags
+from absl.testing import absltest
+from google.protobuf import json_format
+
+from framework import xds_k8s_testcase
+from framework import xds_url_map_testcase
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+_DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+
+_TD_CONFIG_RETRY_WAIT_SEC = 2
+
+
+class ApiListenerTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ def test_api_listener(self) -> None:
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service()
+
+ with self.subTest('02_create_default_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_default_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_default_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_server'):
+ test_server: _XdsTestServer = self.startTestServers()[0]
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+
+ with self.subTest('07_start_test_client'):
+ test_client: _XdsTestClient = self.startTestClient(test_server)
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(test_client)
+
+ with self.subTest('09_test_server_received_rpcs'):
+ self.assertSuccessfulRpcs(test_client)
+
+ with self.subTest('10_create_alternate_url_map'):
+ self.td.create_alternative_url_map(self.server_xds_host,
+ self.server_xds_port,
+ self.td.backend_service)
+
+ # Create alternate target proxy pointing to alternate url_map with the same
+ # host name in host rule. The port is fixed because they point to the same backend service.
+ # Therefore we have to choose a non-`0.0.0.0` ip because ip:port needs to be unique.
+ # We also have to set validate_for_proxyless=false because requires `0.0.0.0` ip.
+ # See https://github.com/grpc/grpc-java/issues/8009
+ with self.subTest('11_create_alternate_target_proxy'):
+ self.td.create_alternative_target_proxy()
+
+ # Create a second suite of map+tp+fr with the same host name in host rule.
+ # We set fr ip_address to be different from `0.0.0.0` and then set
+ # validate_for_proxyless=false because ip:port needs to be unique.
+ with self.subTest('12_create_alternate_forwarding_rule'):
+ self.td.create_alternative_forwarding_rule(self.server_xds_port,
+ ip_address='10.10.10.10')
+
+ with self.subTest('13_test_server_received_rpcs_with_two_url_maps'):
+ self.assertSuccessfulRpcs(test_client)
+ raw_config = test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ dumped_config = _DumpedXdsConfig(
+ json_format.MessageToDict(raw_config))
+ previous_route_config_version = dumped_config.rds_version
+ logger.info(
+ 'received client config from CSDS with two url maps, dump config: %s, rds version: %s',
+ dumped_config, previous_route_config_version)
+
+ with self.subTest('14_delete_one_url_map_target_proxy_forwarding_rule'):
+ self.td.delete_forwarding_rule()
+ self.td.delete_target_grpc_proxy()
+ self.td.delete_url_map()
+
+ with self.subTest('15_test_server_continues_to_receive_rpcs'):
+ self.assertRouteConfigUpdateTrafficHandoff(
+ test_client, previous_route_config_version,
+ _TD_CONFIG_RETRY_WAIT_SEC,
+ xds_k8s_testcase._TD_CONFIG_MAX_WAIT_SEC)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/app_net_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/app_net_test.py
new file mode 100644
index 00000000..8d395895
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/app_net_test.py
@@ -0,0 +1,62 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_k8s_testcase
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+
+class AppNetTest(xds_k8s_testcase.AppNetXdsKubernetesTestCase):
+
+ def test_ping_pong(self):
+ with self.subTest('0_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('1_create_backend_service'):
+ self.td.create_backend_service()
+
+ with self.subTest('2_create_mesh'):
+ self.td.create_mesh()
+
+ with self.subTest('3_create_grpc_route'):
+ self.td.create_grpc_route(self.server_xds_host,
+ self.server_xds_port)
+
+ with self.subTest('4_start_test_server'):
+ test_server: _XdsTestServer = self.startTestServers(
+ replica_count=1)[0]
+
+ with self.subTest('5_setup_server_backends'):
+ self.setupServerBackends()
+
+ with self.subTest('6_start_test_client'):
+ test_client: _XdsTestClient = self.startTestClient(test_server)
+
+ with self.subTest('7_assert_xds_config_exists'):
+ self.assertXdsConfigExists(test_client)
+
+ with self.subTest('8_assert_successful_rpcs'):
+ self.assertSuccessfulRpcs(test_client)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py
new file mode 100644
index 00000000..47efa439
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/authz_test.py
@@ -0,0 +1,338 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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 datetime
+import time
+from typing import Optional
+
+from absl import flags
+from absl.testing import absltest
+import grpc
+
+from framework import xds_k8s_testcase
+from framework.helpers import skips
+
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+_SecurityMode = xds_k8s_testcase.SecurityXdsKubernetesTestCase.SecurityMode
+
+# The client generates QPS even when it is still loading information from xDS.
+# Once it finally connects there will be an outpouring of the bufferred RPCs and
+# the server needs time to chew through the backlog, especially since it is
+# still a new process and so probably interpreted. The server on one run
+# processed 225 RPCs a second, so with the client configured for 25 qps this is
+# 40 seconds worth of buffering before starting to drain the backlog.
+_SETTLE_DURATION = datetime.timedelta(seconds=5)
+_SAMPLE_DURATION = datetime.timedelta(seconds=0.5)
+
+
+class AuthzTest(xds_k8s_testcase.SecurityXdsKubernetesTestCase):
+ RPC_TYPE_CYCLE = {
+ 'UNARY_CALL': 'EMPTY_CALL',
+ 'EMPTY_CALL': 'UNARY_CALL',
+ }
+
+ @staticmethod
+ def isSupported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'python']:
+ return config.version_ge('v1.44.x')
+ elif config.client_lang in ['java', 'go']:
+ return config.version_ge('v1.42.x')
+ return False
+
+ def setUp(self):
+ super().setUp()
+ self.next_rpc_type: Optional[int] = None
+
+ def authz_rules(self):
+ return [
+ {
+ "destinations": {
+ "hosts": [f"*:{self.server_xds_port}"],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "host-wildcard",
+ },
+ },
+ },
+ {
+ "destinations": {
+ "hosts": [f"*:{self.server_xds_port}"],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "header-regex-a+",
+ },
+ },
+ },
+ {
+ "destinations": [{
+ "hosts": [f"{self.server_xds_host}:{self.server_xds_port}"],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "host-match1",
+ },
+ }, {
+ "hosts": [
+ f"a-not-it.com:{self.server_xds_port}",
+ f"{self.server_xds_host}:{self.server_xds_port}",
+ "z-not-it.com:1",
+ ],
+ "ports": [1, self.server_port, 65535],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "host-match2",
+ },
+ }],
+ },
+ {
+ "destinations": {
+ "hosts": [
+ f"not-the-host:{self.server_xds_port}",
+ "not-the-host",
+ ],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "never-match-host",
+ },
+ },
+ },
+ {
+ "destinations": {
+ "hosts": [f"*:{self.server_xds_port}"],
+ "ports": [1],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "never-match-port",
+ },
+ },
+ },
+ # b/202058316. The wildcard principal is generating invalid config
+ # {
+ # "sources": {
+ # "principals": ["*"],
+ # },
+ # "destinations": {
+ # "hosts": [f"*:{self.server_xds_port}"],
+ # "ports": [self.server_port],
+ # "httpHeaderMatch": {
+ # "headerName": "test",
+ # "regexMatch": "principal-present",
+ # },
+ # },
+ # },
+ {
+ "sources": [{
+ "principals": [
+ f"spiffe://{self.project}.svc.id.goog/not/the/client",
+ ],
+ }, {
+ "principals": [
+ f"spiffe://{self.project}.svc.id.goog/not/the/client",
+ f"spiffe://{self.project}.svc.id.goog/ns/"
+ f"{self.client_namespace}/sa/{self.client_name}",
+ ],
+ }],
+ "destinations": {
+ "hosts": [f"*:{self.server_xds_port}"],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "match-principal",
+ },
+ },
+ },
+ {
+ "sources": {
+ "principals": [
+ f"spiffe://{self.project}.svc.id.goog/not/the/client",
+ ],
+ },
+ "destinations": {
+ "hosts": [f"*:{self.server_xds_port}"],
+ "ports": [self.server_port],
+ "httpHeaderMatch": {
+ "headerName": "test",
+ "regexMatch": "never-match-principal",
+ },
+ },
+ },
+ ]
+
+ def configure_and_assert(self, test_client: _XdsTestClient,
+ test_metadata_val: Optional[str],
+ status_code: grpc.StatusCode) -> None:
+ # Swap method type every sub-test to avoid mixing results
+ rpc_type = self.next_rpc_type
+ if rpc_type is None:
+ stats = test_client.get_load_balancer_accumulated_stats()
+ for t in self.RPC_TYPE_CYCLE:
+ if not stats.stats_per_method[t].rpcs_started:
+ rpc_type = t
+ self.assertIsNotNone(rpc_type, "All RPC types already used")
+ self.next_rpc_type = self.RPC_TYPE_CYCLE[rpc_type]
+
+ metadata = None
+ if test_metadata_val is not None:
+ metadata = ((rpc_type, "test", test_metadata_val),)
+ test_client.update_config.configure(rpc_types=[rpc_type],
+ metadata=metadata)
+ self.assertRpcStatusCodes(test_client,
+ status_code=status_code,
+ duration=_SAMPLE_DURATION,
+ method=rpc_type)
+
+ def test_plaintext_allow(self) -> None:
+ self.setupTrafficDirectorGrpc()
+ self.td.create_authz_policy(action='ALLOW', rules=self.authz_rules())
+ self.setupSecurityPolicies(server_tls=False,
+ server_mtls=False,
+ client_tls=False,
+ client_mtls=False)
+
+ test_server: _XdsTestServer = self.startSecureTestServer()
+ self.setupServerBackends()
+ test_client: _XdsTestClient = self.startSecureTestClient(test_server)
+ time.sleep(_SETTLE_DURATION.total_seconds())
+
+ with self.subTest('01_host_wildcard'):
+ self.configure_and_assert(test_client, 'host-wildcard',
+ grpc.StatusCode.OK)
+
+ with self.subTest('02_no_match'):
+ self.configure_and_assert(test_client, 'no-such-rule',
+ grpc.StatusCode.PERMISSION_DENIED)
+ self.configure_and_assert(test_client, None,
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ with self.subTest('03_header_regex'):
+ self.configure_and_assert(test_client, 'header-regex-a',
+ grpc.StatusCode.OK)
+ self.configure_and_assert(test_client, 'header-regex-aa',
+ grpc.StatusCode.OK)
+ self.configure_and_assert(test_client, 'header-regex-',
+ grpc.StatusCode.PERMISSION_DENIED)
+ self.configure_and_assert(test_client, 'header-regex-ab',
+ grpc.StatusCode.PERMISSION_DENIED)
+ self.configure_and_assert(test_client, 'aheader-regex-a',
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ with self.subTest('04_host_match'):
+ self.configure_and_assert(test_client, 'host-match1',
+ grpc.StatusCode.OK)
+ self.configure_and_assert(test_client, 'host-match2',
+ grpc.StatusCode.OK)
+
+ with self.subTest('05_never_match_host'):
+ self.configure_and_assert(test_client, 'never-match-host',
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ with self.subTest('06_never_match_port'):
+ self.configure_and_assert(test_client, 'never-match-port',
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ # b/202058316
+ # with self.subTest('07_principal_present'):
+ # self.configure_and_assert(test_client, 'principal-present',
+ # grpc.StatusCode.PERMISSION_DENIED)
+
+ def test_tls_allow(self) -> None:
+ self.setupTrafficDirectorGrpc()
+ self.td.create_authz_policy(action='ALLOW', rules=self.authz_rules())
+ self.setupSecurityPolicies(server_tls=True,
+ server_mtls=False,
+ client_tls=True,
+ client_mtls=False)
+
+ test_server: _XdsTestServer = self.startSecureTestServer()
+ self.setupServerBackends()
+ test_client: _XdsTestClient = self.startSecureTestClient(test_server)
+ time.sleep(_SETTLE_DURATION.total_seconds())
+
+ with self.subTest('01_host_wildcard'):
+ self.configure_and_assert(test_client, 'host-wildcard',
+ grpc.StatusCode.OK)
+
+ with self.subTest('02_no_match'):
+ self.configure_and_assert(test_client, None,
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ # b/202058316
+ # with self.subTest('03_principal_present'):
+ # self.configure_and_assert(test_client, 'principal-present',
+ # grpc.StatusCode.PERMISSION_DENIED)
+
+ def test_mtls_allow(self) -> None:
+ self.setupTrafficDirectorGrpc()
+ self.td.create_authz_policy(action='ALLOW', rules=self.authz_rules())
+ self.setupSecurityPolicies(server_tls=True,
+ server_mtls=True,
+ client_tls=True,
+ client_mtls=True)
+
+ test_server: _XdsTestServer = self.startSecureTestServer()
+ self.setupServerBackends()
+ test_client: _XdsTestClient = self.startSecureTestClient(test_server)
+ time.sleep(_SETTLE_DURATION.total_seconds())
+
+ with self.subTest('01_host_wildcard'):
+ self.configure_and_assert(test_client, 'host-wildcard',
+ grpc.StatusCode.OK)
+
+ with self.subTest('02_no_match'):
+ self.configure_and_assert(test_client, None,
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ # b/202058316
+ # with self.subTest('03_principal_present'):
+ # self.configure_and_assert(test_client, 'principal-present',
+ # grpc.StatusCode.OK)
+
+ with self.subTest('04_match_principal'):
+ self.configure_and_assert(test_client, 'match-principal',
+ grpc.StatusCode.OK)
+
+ with self.subTest('05_never_match_principal'):
+ self.configure_and_assert(test_client, 'never-match-principal',
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ def test_plaintext_deny(self) -> None:
+ self.setupTrafficDirectorGrpc()
+ self.td.create_authz_policy(action='DENY', rules=self.authz_rules())
+ self.setupSecurityPolicies(server_tls=False,
+ server_mtls=False,
+ client_tls=False,
+ client_mtls=False)
+
+ test_server: _XdsTestServer = self.startSecureTestServer()
+ self.setupServerBackends()
+ test_client: _XdsTestClient = self.startSecureTestClient(test_server)
+ time.sleep(_SETTLE_DURATION.total_seconds())
+
+ with self.subTest('01_host_wildcard'):
+ self.configure_and_assert(test_client, 'host-wildcard',
+ grpc.StatusCode.PERMISSION_DENIED)
+
+ with self.subTest('02_no_match'):
+ self.configure_and_assert(test_client, None, grpc.StatusCode.OK)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/baseline_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/baseline_test.py
index 2a61e694..8ea018a2 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/tests/baseline_test.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/baseline_test.py
@@ -45,15 +45,18 @@ class BaselineTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
self.td.create_forwarding_rule(self.server_xds_port)
with self.subTest('5_start_test_server'):
- test_server: _XdsTestServer = self.startTestServer()
+ test_servers: _XdsTestServer = self.startTestServers()
with self.subTest('6_add_server_backends_to_backend_service'):
self.setupServerBackends()
with self.subTest('7_start_test_client'):
- test_client: _XdsTestClient = self.startTestClient(test_server)
+ test_client: _XdsTestClient = self.startTestClient(test_servers[0])
- with self.subTest('8_test_server_received_rpcs_from_test_client'):
+ with self.subTest('8_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(test_client)
+
+ with self.subTest('9_test_server_received_rpcs_from_test_client'):
self.assertSuccessfulRpcs(test_client)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/change_backend_service_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/change_backend_service_test.py
new file mode 100644
index 00000000..419a134e
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/change_backend_service_test.py
@@ -0,0 +1,106 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+from typing import List, Optional
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_k8s_testcase
+from framework.infrastructure import k8s
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+
+class ChangeBackendServiceTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ def setUp(self):
+ super().setUp()
+ self.alternate_k8s_namespace = k8s.KubernetesNamespace(
+ self.k8s_api_manager, self.server_namespace)
+ self.alternate_server_runner = server_app.KubernetesServerRunner(
+ self.alternate_k8s_namespace,
+ deployment_name=self.server_name + '-alt',
+ image_name=self.server_image,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ debug_use_port_forwarding=self.debug_use_port_forwarding,
+ reuse_namespace=True)
+
+ def tearDown(self):
+ if hasattr(self, 'alternate_server_runner'):
+ self.alternate_server_runner.cleanup()
+ super().tearDown()
+
+ def test_change_backend_service(self) -> None:
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service()
+ self.td.create_alternative_backend_service()
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.default_test_servers: List[
+ _XdsTestServer] = self.startTestServers()
+ self.same_zone_test_servers: List[
+ _XdsTestServer] = self.startTestServers(
+ server_runner=self.alternate_server_runner)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+ # Add backend to alternative backend service
+ neg_name_alt, neg_zones_alt = self.alternate_k8s_namespace.get_service_neg(
+ self.alternate_server_runner.service_name, self.server_port)
+ self.td.alternative_backend_service_add_neg_backends(
+ neg_name_alt, neg_zones_alt)
+
+ with self.subTest('07_start_test_client'):
+ self.test_client: _XdsTestClient = self.startTestClient(
+ self.default_test_servers[0])
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(self.test_client)
+
+ with self.subTest('09_test_server_received_rpcs_from_test_client'):
+ self.assertSuccessfulRpcs(self.test_client)
+
+ with self.subTest('10_change_backend_service'):
+ self.td.patch_url_map(self.server_xds_host, self.server_xds_port,
+ self.td.alternative_backend_service)
+ self.assertRpcsEventuallyGoToGivenServers(
+ self.test_client, self.same_zone_test_servers)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/failover_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/failover_test.py
new file mode 100644
index 00000000..5c429488
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/failover_test.py
@@ -0,0 +1,127 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+from typing import List
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_k8s_testcase
+from framework.infrastructure import k8s
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+
+class FailoverTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+ REPLICA_COUNT = 3
+ MAX_RATE_PER_ENDPOINT = 100
+
+ def setUp(self):
+ super().setUp()
+ self.secondary_server_runner = server_app.KubernetesServerRunner(
+ k8s.KubernetesNamespace(self.secondary_k8s_api_manager,
+ self.server_namespace),
+ deployment_name=self.server_name + '-alt',
+ image_name=self.server_image,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ debug_use_port_forwarding=self.debug_use_port_forwarding,
+ reuse_namespace=True)
+
+ def tearDown(self):
+ if hasattr(self, 'secondary_server_runner'):
+ self.secondary_server_runner.cleanup()
+ super().tearDown()
+
+ def test_failover(self) -> None:
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service()
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.default_test_servers: List[
+ _XdsTestServer] = self.startTestServers(
+ replica_count=self.REPLICA_COUNT)
+
+ self.alternate_test_servers: List[
+ _XdsTestServer] = self.startTestServers(
+ server_runner=self.secondary_server_runner)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends(
+ max_rate_per_endpoint=self.MAX_RATE_PER_ENDPOINT)
+ self.setupServerBackends(
+ server_runner=self.secondary_server_runner,
+ max_rate_per_endpoint=self.MAX_RATE_PER_ENDPOINT)
+
+ with self.subTest('07_start_test_client'):
+ self.test_client: _XdsTestClient = self.startTestClient(
+ self.default_test_servers[0])
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(self.test_client)
+
+ with self.subTest('09_primary_locality_receives_requests'):
+ self.assertRpcsEventuallyGoToGivenServers(self.test_client,
+ self.default_test_servers)
+
+ with self.subTest(
+ '10_secondary_locality_receives_no_requests_on_partial_primary_failure'
+ ):
+ self.default_test_servers[0].set_not_serving()
+ self.assertRpcsEventuallyGoToGivenServers(
+ self.test_client, self.default_test_servers[1:])
+
+ with self.subTest('11_gentle_failover'):
+ self.default_test_servers[1].set_not_serving()
+ self.assertRpcsEventuallyGoToGivenServers(
+ self.test_client,
+ self.default_test_servers[2:] + self.alternate_test_servers)
+
+ with self.subTest(
+ '12_secondary_locality_receives_requests_on_primary_failure'):
+ self.default_test_servers[2].set_not_serving()
+ self.assertRpcsEventuallyGoToGivenServers(
+ self.test_client, self.alternate_test_servers)
+
+ with self.subTest('13_traffic_resumes_to_healthy_backends'):
+ for i in range(self.REPLICA_COUNT):
+ self.default_test_servers[i].set_serving()
+ self.assertRpcsEventuallyGoToGivenServers(self.test_client,
+ self.default_test_servers)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/remove_neg_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/remove_neg_test.py
new file mode 100644
index 00000000..b7201026
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/remove_neg_test.py
@@ -0,0 +1,103 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+from typing import List, Optional
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_k8s_testcase
+from framework.infrastructure import k8s
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+
+class RemoveNegTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ def setUp(self):
+ super().setUp()
+ self.alternate_server_runner = server_app.KubernetesServerRunner(
+ k8s.KubernetesNamespace(self.k8s_api_manager,
+ self.server_namespace),
+ deployment_name=self.server_name + '-alt',
+ image_name=self.server_image,
+ gcp_service_account=self.gcp_service_account,
+ td_bootstrap_image=self.td_bootstrap_image,
+ gcp_project=self.project,
+ gcp_api_manager=self.gcp_api_manager,
+ xds_server_uri=self.xds_server_uri,
+ network=self.network,
+ debug_use_port_forwarding=self.debug_use_port_forwarding,
+ reuse_namespace=True)
+
+ def tearDown(self):
+ if hasattr(self, 'alternate_server_runner'):
+ self.alternate_server_runner.cleanup()
+ super().tearDown()
+
+ def test_remove_neg(self) -> None:
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service()
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.default_test_servers: List[
+ _XdsTestServer] = self.startTestServers()
+ self.same_zone_test_servers: List[
+ _XdsTestServer] = self.startTestServers(
+ server_runner=self.alternate_server_runner)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+ self.setupServerBackends(server_runner=self.alternate_server_runner)
+
+ with self.subTest('07_start_test_client'):
+ self.test_client: _XdsTestClient = self.startTestClient(
+ self.default_test_servers[0])
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(self.test_client)
+
+ with self.subTest('09_test_server_received_rpcs_from_test_client'):
+ self.assertSuccessfulRpcs(self.test_client)
+
+ with self.subTest('10_remove_neg'):
+ self.assertRpcsEventuallyGoToGivenServers(
+ self.test_client,
+ self.default_test_servers + self.same_zone_test_servers)
+ self.removeServerBackends(
+ server_runner=self.alternate_server_runner)
+ self.assertRpcsEventuallyGoToGivenServers(self.test_client,
+ self.default_test_servers)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/round_robin_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/round_robin_test.py
new file mode 100644
index 00000000..0daa095d
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/round_robin_test.py
@@ -0,0 +1,88 @@
+# Copyright 2021 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT 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
+from typing import List, Optional
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_k8s_testcase
+from framework.infrastructure import k8s
+from framework.test_app import server_app
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+
+class RoundRobinTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ def test_round_robin(self) -> None:
+ REPLICA_COUNT = 2
+
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service()
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.test_servers: List[_XdsTestServer] = self.startTestServers(
+ replica_count=REPLICA_COUNT)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+
+ with self.subTest('07_start_test_client'):
+ self.test_client: _XdsTestClient = self.startTestClient(
+ self.test_servers[0])
+
+ with self.subTest('08_test_client_xds_config_exists'):
+ self.assertXdsConfigExists(self.test_client)
+
+ with self.subTest('09_test_server_received_rpcs_from_test_client'):
+ self.assertSuccessfulRpcs(self.test_client)
+
+ with self.subTest('10_round_robin'):
+ num_rpcs = 100
+ expected_rpcs_per_replica = num_rpcs / REPLICA_COUNT
+
+ rpcs_by_peer = self.getClientRpcStats(self.test_client,
+ num_rpcs).rpcs_by_peer
+ total_requests_received = sum(rpcs_by_peer[x] for x in rpcs_by_peer)
+ self.assertEqual(total_requests_received, num_rpcs,
+ 'Wrong number of RPCS')
+ for server in self.test_servers:
+ pod_name = server.pod_name
+ self.assertIn(pod_name, rpcs_by_peer,
+ f'pod {pod_name} did not receive RPCs')
+ self.assertLessEqual(
+ abs(rpcs_by_peer[pod_name] - expected_rpcs_per_replica), 1,
+ f'Wrong number of RPCs for {pod_name}')
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/security_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/security_test.py
index 2c19d337..0d70f308 100644
--- a/grpc/tools/run_tests/xds_k8s_test_driver/tests/security_test.py
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/security_test.py
@@ -12,12 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
-import uuid
from absl import flags
from absl.testing import absltest
from framework import xds_k8s_testcase
+from framework.helpers import rand
+from framework.helpers import skips
logger = logging.getLogger(__name__)
flags.adopt_module_key_flags(xds_k8s_testcase)
@@ -30,6 +31,12 @@ _SecurityMode = xds_k8s_testcase.SecurityXdsKubernetesTestCase.SecurityMode
class SecurityTest(xds_k8s_testcase.SecurityXdsKubernetesTestCase):
+ @staticmethod
+ def isSupported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'python', 'go']:
+ return config.version_ge('v1.41.x')
+ return False
+
def test_mtls(self):
"""mTLS test.
@@ -161,7 +168,7 @@ class SecurityTest(xds_k8s_testcase.SecurityXdsKubernetesTestCase):
server_port=self.server_port,
tls=True,
mtls=False)
- incorrect_namespace = f'incorrect-namespace-{uuid.uuid4().hex}'
+ incorrect_namespace = f'incorrect-namespace-{rand.rand_string()}'
self.td.setup_client_security(server_namespace=incorrect_namespace,
server_name=self.server_name,
tls=True,
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/subsetting_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/subsetting_test.py
new file mode 100644
index 00000000..2b652240
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/subsetting_test.py
@@ -0,0 +1,104 @@
+# Copyright 2021 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 collections
+from typing import List, Optional
+
+from absl import flags
+from absl import logging
+from absl.testing import absltest
+from google.protobuf import json_format
+
+from framework import xds_k8s_testcase
+from framework import xds_url_map_testcase
+from framework.infrastructure import k8s
+from framework.test_app import server_app
+
+flags.adopt_module_key_flags(xds_k8s_testcase)
+
+# Type aliases
+_XdsTestServer = xds_k8s_testcase.XdsTestServer
+_XdsTestClient = xds_k8s_testcase.XdsTestClient
+
+_SUBSET_SIZE = 4
+_NUM_BACKENDS = 8
+_NUM_CLIENTS = 3
+
+
+class SubsettingTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
+
+ def test_subsetting_basic(self) -> None:
+ with self.subTest('00_create_health_check'):
+ self.td.create_health_check()
+
+ with self.subTest('01_create_backend_services'):
+ self.td.create_backend_service(subset_size=_SUBSET_SIZE)
+
+ with self.subTest('02_create_url_map'):
+ self.td.create_url_map(self.server_xds_host, self.server_xds_port)
+
+ with self.subTest('03_create_target_proxy'):
+ self.td.create_target_proxy()
+
+ with self.subTest('04_create_forwarding_rule'):
+ self.td.create_forwarding_rule(self.server_xds_port)
+
+ with self.subTest('05_start_test_servers'):
+ self.test_servers: List[_XdsTestServer] = self.startTestServers(
+ replica_count=_NUM_BACKENDS)
+
+ with self.subTest('06_add_server_backends_to_backend_services'):
+ self.setupServerBackends()
+
+ rpc_distribution = collections.defaultdict(int)
+ with self.subTest('07_start_test_client'):
+ for i in range(_NUM_CLIENTS):
+ # Clean created client pods if there is any
+ self.client_runner.cleanup(force=True)
+ # Create a test client
+ test_client: _XdsTestClient = self.startTestClient(
+ self.test_servers[0])
+ # Validate the number of received endpoints
+ config = test_client.csds.fetch_client_status(
+ log_level=logging.INFO)
+ self.assertIsNotNone(config)
+ json_config = json_format.MessageToDict(config)
+ parsed = xds_url_map_testcase.DumpedXdsConfig(json_config)
+ logging.info('Client %d received endpoints (len=%s): %s', i,
+ len(parsed.endpoints), parsed.endpoints)
+ self.assertLen(parsed.endpoints, _SUBSET_SIZE)
+ # Record RPC stats
+ lb_stats = self.getClientRpcStats(test_client,
+ _NUM_BACKENDS * 25)
+ for key, value in lb_stats.rpcs_by_peer.items():
+ rpc_distribution[key] += value
+
+ with self.subTest('08_log_rpc_distribution'):
+ server_entries = sorted(rpc_distribution.items(),
+ key=lambda x: -x[1])
+ # Validate if clients are receiving different sets of backends (3
+ # client received a total of 4 unique backends == FAIL, a total of 5
+ # unique backends == PASS)
+ self.assertGreater(len(server_entries), _SUBSET_SIZE)
+ logging.info('RPC distribution (len=%s): %s', len(server_entries),
+ server_entries)
+ peak = server_entries[0][1]
+ mean = sum(map(lambda x: x[1],
+ server_entries)) / len(server_entries)
+ logging.info('Peak=%d Mean=%.1f Peak-to-Mean-Ratio=%.2f', peak,
+ mean, peak / mean)
+
+
+if __name__ == '__main__':
+ absltest.main(failfast=True)
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__init__.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__init__.py
new file mode 100644
index 00000000..712a2e1d
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2021 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/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__main__.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__main__.py
new file mode 100644
index 00000000..c89f6ec3
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/__main__.py
@@ -0,0 +1,31 @@
+# Copyright 2021 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 os
+
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase # Needed for xDS flags
+
+_TEST_CASE_FOLDER = os.path.dirname(__file__)
+
+
+def load_tests(loader: absltest.TestLoader, unused_tests, unused_pattern):
+ return loader.discover(_TEST_CASE_FOLDER,
+ pattern='*' +
+ xds_url_map_testcase.URL_MAP_TESTCASE_FILE_SUFFIX)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/affinity_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/affinity_test.py
new file mode 100644
index 00000000..7eefa2d2
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/affinity_test.py
@@ -0,0 +1,229 @@
+# Copyright 2021 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
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase
+from framework.helpers import skips
+from framework.infrastructure import traffic_director
+from framework.rpc import grpc_channelz
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+_NUM_RPCS = 150
+_TEST_METADATA_KEY = traffic_director.TEST_AFFINITY_METADATA_KEY
+_TEST_METADATA_VALUE_UNARY = 'unary_yranu'
+_TEST_METADATA_VALUE_EMPTY = 'empty_ytpme'
+_TEST_METADATA_NUMERIC_KEY = 'xds_md_numeric'
+_TEST_METADATA_NUMERIC_VALUE = '159'
+
+_TEST_METADATA = (
+ (RpcTypeUnaryCall, _TEST_METADATA_KEY, _TEST_METADATA_VALUE_UNARY),
+ (RpcTypeEmptyCall, _TEST_METADATA_KEY, _TEST_METADATA_VALUE_EMPTY),
+ (RpcTypeUnaryCall, _TEST_METADATA_NUMERIC_KEY,
+ _TEST_METADATA_NUMERIC_VALUE),
+)
+
+_ChannelzChannelState = grpc_channelz.ChannelState
+
+
+class TestHeaderBasedAffinity(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'java']:
+ return config.version_ge('v1.40.x')
+ if config.client_lang in ['go']:
+ return config.version_ge('v1.41.x')
+ return False
+
+ @staticmethod
+ def client_init_config(rpc: str, metadata: str):
+ # Config the init RPCs to send with the same set of metadata. Without
+ # this, the init RPCs will not have headers, and will pick random
+ # backends (behavior of RING_HASH). This is necessary to only one
+ # sub-channel is picked and used from the beginning, thus the channel
+ # will only create this one sub-channel.
+ return 'EmptyCall', 'EmptyCall:%s:%s' % (_TEST_METADATA_KEY,
+ _TEST_METADATA_VALUE_EMPTY)
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ # Update default service to the affinity service.
+ path_matcher["defaultService"] = GcpResourceManager(
+ ).affinity_backend_service()
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ # 3 endpoints in the affinity backend service.
+ self.assertNumEndpoints(xds_config, 3)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['route']
+ ['hashPolicy'][0]['header']['headerName'], _TEST_METADATA_KEY)
+ self.assertEqual(xds_config.cds[0]['lbPolicy'], 'RING_HASH')
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ # Only one backend should receive traffic, even though there are 3
+ # backends.
+ self.assertEqual(1, rpc_distribution.num_peers)
+ self.assertLen(
+ test_client.find_subchannels_with_state(
+ _ChannelzChannelState.READY),
+ 1,
+ )
+ self.assertLen(
+ test_client.find_subchannels_with_state(_ChannelzChannelState.IDLE),
+ 2,
+ )
+ # Send 150 RPCs without headers. RPCs without headers will pick random
+ # backends. After this, we expect to see all backends to be connected.
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeEmptyCall, RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(3, rpc_distribution.num_peers)
+ self.assertLen(
+ test_client.find_subchannels_with_state(
+ _ChannelzChannelState.READY),
+ 3,
+ )
+
+
+class TestHeaderBasedAffinityMultipleHeaders(
+ xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'java']:
+ return config.version_ge('v1.40.x')
+ if config.client_lang in ['go']:
+ return config.version_ge('v1.41.x')
+ return False
+
+ @staticmethod
+ def client_init_config(rpc: str, metadata: str):
+ # Config the init RPCs to send with the same set of metadata. Without
+ # this, the init RPCs will not have headers, and will pick random
+ # backends (behavior of RING_HASH). This is necessary to only one
+ # sub-channel is picked and used from the beginning, thus the channel
+ # will only create this one sub-channel.
+ return 'EmptyCall', 'EmptyCall:%s:%s' % (_TEST_METADATA_KEY,
+ _TEST_METADATA_VALUE_EMPTY)
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ # Update default service to the affinity service.
+ path_matcher["defaultService"] = GcpResourceManager(
+ ).affinity_backend_service()
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ # 3 endpoints in the affinity backend service.
+ self.assertNumEndpoints(xds_config, 3)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['route']
+ ['hashPolicy'][0]['header']['headerName'], _TEST_METADATA_KEY)
+ self.assertEqual(xds_config.cds[0]['lbPolicy'], 'RING_HASH')
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ # Only one backend should receive traffic, even though there are 3
+ # backends.
+ self.assertEqual(1, rpc_distribution.num_peers)
+ self.assertLen(
+ test_client.find_subchannels_with_state(
+ _ChannelzChannelState.READY),
+ 1,
+ )
+ self.assertLen(
+ test_client.find_subchannels_with_state(_ChannelzChannelState.IDLE),
+ 2,
+ )
+ empty_call_peer = list(rpc_distribution.raw['rpcsByMethod']['EmptyCall']
+ ['rpcsByPeer'].keys())[0]
+ # Send RPCs with a different metadata value, try different values to
+ # verify that the client will pick a different backend.
+ #
+ # EmptyCalls will be sent with the same metadata as before, and
+ # UnaryCalls will be sent with headers from ["0".."29"]. We check the
+ # endpoint picked for UnaryCall, and stop as soon as one different from
+ # the EmptyCall peer is picked.
+ #
+ # Note that there's a small chance all the headers would still pick the
+ # same backend used by EmptyCall. But there will be over a thousand
+ # nodes on the ring (default min size is 1024), and the probability of
+ # picking the same backend should be fairly small.
+ different_peer_picked = False
+ for i in range(30):
+ new_metadata = (
+ (RpcTypeEmptyCall, _TEST_METADATA_KEY,
+ _TEST_METADATA_VALUE_EMPTY),
+ (RpcTypeUnaryCall, _TEST_METADATA_KEY, str(i)),
+ )
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeEmptyCall, RpcTypeUnaryCall],
+ metadata=new_metadata,
+ num_rpcs=_NUM_RPCS)
+ unary_call_peer = list(rpc_distribution.raw['rpcsByMethod']
+ ['UnaryCall']['rpcsByPeer'].keys())[0]
+ if unary_call_peer != empty_call_peer:
+ different_peer_picked = True
+ break
+ self.assertTrue(
+ different_peer_picked,
+ "the same endpoint was picked for all the headers, expect a different endpoint to be picked"
+ )
+ self.assertLen(
+ test_client.find_subchannels_with_state(
+ _ChannelzChannelState.READY),
+ 2,
+ )
+ self.assertLen(
+ test_client.find_subchannels_with_state(_ChannelzChannelState.IDLE),
+ 1,
+ )
+
+
+# TODO: add more test cases
+# 1. based on the basic test, turn down the backend in use, then verify that all
+# RPCs are sent to another backend
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/csds_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/csds_test.py
new file mode 100644
index 00000000..15d15d13
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/csds_test.py
@@ -0,0 +1,70 @@
+# Copyright 2021 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
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+_NUM_RPCS = 50
+
+
+class TestBasicCsds(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ # Validate Endpoint Configs
+ self.assertNumEndpoints(xds_config, 1)
+ # Validate Node
+ self.assertEqual(self.test_client.ip,
+ xds_config['node']['metadata']['INSTANCE_IP'])
+ # Validate Listeners
+ self.assertIsNotNone(xds_config.lds)
+ self.assertEqual(self.hostname(), xds_config.lds['name'])
+ # Validate Route Configs
+ self.assertTrue(xds_config.rds['virtualHosts'])
+ # Validate Clusters
+ self.assertEqual(1, len(xds_config.cds))
+ self.assertEqual('EDS', xds_config.cds[0]['type'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall, RpcTypeEmptyCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(_NUM_RPCS, rpc_distribution.num_oks)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/fault_injection_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/fault_injection_test.py
new file mode 100644
index 00000000..f866020f
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/fault_injection_test.py
@@ -0,0 +1,367 @@
+# Copyright 2021 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 time
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+import grpc
+
+from framework import xds_url_map_testcase
+from framework.rpc import grpc_testing
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+ExpectedResult = xds_url_map_testcase.ExpectedResult
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+# The first batch of RPCs don't count towards the result of test case. They are
+# meant to prove the communication between driver and client is fine.
+_NUM_RPCS = 10
+_LENGTH_OF_RPC_SENDING_SEC = 16
+# We are using sleep to synchronize test driver and the client... Even though
+# the client is sending at QPS rate, we can't assert that exactly QPS *
+# SLEEP_DURATION number of RPC is finished. The final completed RPC might be
+# slightly more or less.
+_NON_RANDOM_ERROR_TOLERANCE = 0.01
+# For random generator involved test cases, we want to be more loose about the
+# final result. Otherwise, we will need more test duration (sleep duration) and
+# more accurate communication mechanism. The accurate of random number
+# generation is not the intention of this test.
+_ERROR_TOLERANCE = 0.2
+_DELAY_CASE_APPLICATION_TIMEOUT_SEC = 1
+_BACKLOG_WAIT_TIME_SEC = 20
+
+
+def _build_fault_injection_route_rule(abort_percentage: int = 0,
+ delay_percentage: int = 0):
+ return {
+ 'priority': 0,
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall'
+ }],
+ 'service': GcpResourceManager().default_backend_service(),
+ 'routeAction': {
+ 'faultInjectionPolicy': {
+ 'abort': {
+ 'httpStatus': 401,
+ 'percentage': abort_percentage,
+ },
+ 'delay': {
+ 'fixedDelay': {
+ 'seconds': '20'
+ },
+ 'percentage': delay_percentage,
+ }
+ }
+ },
+ }
+
+
+def _wait_until_backlog_cleared(test_client: XdsTestClient,
+ timeout: int = _BACKLOG_WAIT_TIME_SEC):
+ """ Wait until the completed RPC is close to started RPC.
+
+ For delay injected test cases, there might be a backlog of RPCs due to slow
+ initialization of the client. E.g., if initialization took 20s and qps is
+ 25, then there will be a backlog of 500 RPCs. In normal test cases, this is
+ fine, because RPCs will fail immediately. But for delay injected test cases,
+ the RPC might linger much longer and affect the stability of test results.
+ """
+ logger.info('Waiting for RPC backlog to clear for %d seconds', timeout)
+ deadline = time.time() + timeout
+ while time.time() < deadline:
+ stats = test_client.get_load_balancer_accumulated_stats()
+ ok = True
+ for rpc_type in [RpcTypeUnaryCall, RpcTypeEmptyCall]:
+ started = stats.num_rpcs_started_by_method.get(rpc_type, 0)
+ completed = stats.num_rpcs_succeeded_by_method.get(
+ rpc_type, 0) + stats.num_rpcs_failed_by_method.get(rpc_type, 0)
+ # We consider the backlog is healthy, if the diff between started
+ # RPCs and completed RPCs is less than 1.5 QPS.
+ if abs(started - completed) > xds_url_map_testcase.QPS.value * 1.1:
+ logger.info(
+ 'RPC backlog exist: rpc_type=%s started=%s completed=%s',
+ rpc_type, started, completed)
+ time.sleep(_DELAY_CASE_APPLICATION_TIMEOUT_SEC)
+ ok = False
+ else:
+ logger.info(
+ 'RPC backlog clear: rpc_type=%s started=%s completed=%s',
+ rpc_type, started, completed)
+ if ok:
+ # Both backlog of both types of RPCs is clear, success, return.
+ return
+
+ raise RuntimeError('failed to clear RPC backlog in %s seconds', timeout)
+
+
+class TestZeroPercentFaultInjection(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=0,
+ delay_percentage=0)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual('20s', filter_config['delay']['fixedDelay'])
+ self.assertEqual(
+ 0, filter_config['delay']['percentage'].get('numerator', 0))
+ self.assertEqual('MILLION',
+ filter_config['delay']['percentage']['denominator'])
+ self.assertEqual(401, filter_config['abort']['httpStatus'])
+ self.assertEqual(
+ 0, filter_config['abort']['percentage'].get('numerator', 0))
+ self.assertEqual('MILLION',
+ filter_config['abort']['percentage']['denominator'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.OK,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+class TestNonMatchingFaultInjection(xds_url_map_testcase.XdsUrlMapTestCase):
+ """EMPTY_CALL is not fault injected, so it should succeed."""
+
+ @staticmethod
+ def client_init_config(rpc: str, metadata: str):
+ # Python interop client will stuck if the traffic is slow (in this case,
+ # 20s injected). The purpose of this test is examining the un-injected
+ # traffic is not impacted, so it's fine to just send un-injected
+ # traffic.
+ return 'EmptyCall', metadata
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=100,
+ delay_percentage=100)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ # The first route rule for UNARY_CALL is fault injected
+ self.assertEqual(
+ "/grpc.testing.TestService/UnaryCall",
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['path'])
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual('20s', filter_config['delay']['fixedDelay'])
+ self.assertEqual(1000000,
+ filter_config['delay']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['delay']['percentage']['denominator'])
+ self.assertEqual(401, filter_config['abort']['httpStatus'])
+ self.assertEqual(1000000,
+ filter_config['abort']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['abort']['percentage']['denominator'])
+ # The second route rule for all other RPCs is untouched
+ self.assertNotIn(
+ 'envoy.filters.http.fault',
+ xds_config.rds['virtualHosts'][0]['routes'][1].get(
+ 'typedPerFilterConfig', {}))
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ self.assertRpcStatusCode(test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeEmptyCall,
+ status_code=grpc.StatusCode.OK,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+@absltest.skip('20% RPC might pass immediately, reason unknown')
+class TestAlwaysDelay(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=0,
+ delay_percentage=100)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual('20s', filter_config['delay']['fixedDelay'])
+ self.assertEqual(1000000,
+ filter_config['delay']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['delay']['percentage']['denominator'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS,
+ app_timeout=_DELAY_CASE_APPLICATION_TIMEOUT_SEC)
+ _wait_until_backlog_cleared(test_client)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.DEADLINE_EXCEEDED,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+class TestAlwaysAbort(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=100,
+ delay_percentage=0)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual(401, filter_config['abort']['httpStatus'])
+ self.assertEqual(1000000,
+ filter_config['abort']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['abort']['percentage']['denominator'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.UNAUTHENTICATED,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+class TestDelayHalf(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=0,
+ delay_percentage=50)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual('20s', filter_config['delay']['fixedDelay'])
+ self.assertEqual(500000,
+ filter_config['delay']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['delay']['percentage']['denominator'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS,
+ app_timeout=_DELAY_CASE_APPLICATION_TIMEOUT_SEC)
+ _wait_until_backlog_cleared(test_client)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.DEADLINE_EXCEEDED,
+ ratio=0.5),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_ERROR_TOLERANCE)
+
+
+class TestAbortHalf(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_fault_injection_route_rule(abort_percentage=50,
+ delay_percentage=0)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ filter_config = xds_config.rds['virtualHosts'][0]['routes'][0][
+ 'typedPerFilterConfig']['envoy.filters.http.fault']
+ self.assertEqual(401, filter_config['abort']['httpStatus'])
+ self.assertEqual(500000,
+ filter_config['abort']['percentage']['numerator'])
+ self.assertEqual('MILLION',
+ filter_config['abort']['percentage']['denominator'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.UNAUTHENTICATED,
+ ratio=0.5),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_ERROR_TOLERANCE)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/header_matching_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/header_matching_test.py
new file mode 100644
index 00000000..9eb3439a
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/header_matching_test.py
@@ -0,0 +1,357 @@
+# Copyright 2021 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
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+_NUM_RPCS = 150
+_TEST_METADATA_KEY = 'xds_md'
+_TEST_METADATA_VALUE_UNARY = 'unary_yranu'
+_TEST_METADATA_VALUE_EMPTY = 'empty_ytpme'
+_TEST_METADATA_NUMERIC_KEY = 'xds_md_numeric'
+_TEST_METADATA_NUMERIC_VALUE = '159'
+
+_TEST_METADATA = (
+ (RpcTypeUnaryCall, _TEST_METADATA_KEY, _TEST_METADATA_VALUE_UNARY),
+ (RpcTypeEmptyCall, _TEST_METADATA_KEY, _TEST_METADATA_VALUE_EMPTY),
+ (RpcTypeUnaryCall, _TEST_METADATA_NUMERIC_KEY,
+ _TEST_METADATA_NUMERIC_VALUE),
+)
+
+
+class TestExactMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header ExactMatch -> alternate_backend_service.
+ # EmptyCall is sent with the metadata.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'exactMatch': _TEST_METADATA_VALUE_EMPTY
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['exactMatch'], _TEST_METADATA_VALUE_EMPTY)
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+@absltest.skip('the xDS config is good, but distribution is wrong.')
+class TestPrefixMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header PrefixMatch -> alternate_backend_service.
+ # UnaryCall is sent with the metadata.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'prefixMatch': _TEST_METADATA_VALUE_UNARY[:2]
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['prefixMatch'], _TEST_METADATA_VALUE_UNARY[:2])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestSuffixMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header SuffixMatch -> alternate_backend_service.
+ # EmptyCall is sent with the metadata.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'suffixMatch': _TEST_METADATA_VALUE_EMPTY[-2:]
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['suffixMatch'], _TEST_METADATA_VALUE_EMPTY[-2:])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+class TestPresentMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header 'xds_md_numeric' present -> alternate_backend_service.
+ # UnaryCall is sent with the metadata, so will be sent to alternative.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_NUMERIC_KEY,
+ 'presentMatch': True
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_NUMERIC_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['presentMatch'], True)
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestInvertMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header invert ExactMatch -> alternate_backend_service.
+ # UnaryCall is sent with the metadata, so will be sent to
+ # default. EmptyCall will be sent to alternative.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'exactMatch': _TEST_METADATA_VALUE_UNARY,
+ 'invertMatch': True
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['invertMatch'], True)
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall, RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(_NUM_RPCS, rpc_distribution.num_oks)
+ self.assertEqual(
+ 0, rpc_distribution.unary_call_alternative_service_rpc_count)
+ self.assertEqual(0,
+ rpc_distribution.empty_call_default_service_rpc_count)
+
+
+class TestRangeMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header 'xds_md_numeric' range [100,200] -> alternate_backend_service.
+ # UnaryCall is sent with the metadata in range.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_NUMERIC_KEY,
+ 'rangeMatch': {
+ 'rangeStart': '100',
+ 'rangeEnd': '200'
+ }
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_NUMERIC_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['rangeMatch']['start'], '100')
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['rangeMatch']['end'], '200')
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall, RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(_NUM_RPCS, rpc_distribution.num_oks)
+ self.assertEqual(0,
+ rpc_distribution.unary_call_default_service_rpc_count)
+ self.assertEqual(
+ 0, rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+class TestRegexMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Header RegexMatch -> alternate_backend_service.
+ # EmptyCall is sent with the metadata.
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName':
+ _TEST_METADATA_KEY,
+ 'regexMatch':
+ "^%s.*%s$" % (_TEST_METADATA_VALUE_EMPTY[:2],
+ _TEST_METADATA_VALUE_EMPTY[-2:])
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }],
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['safeRegexMatch']['regex'], "^%s.*%s$" %
+ (_TEST_METADATA_VALUE_EMPTY[:2], _TEST_METADATA_VALUE_EMPTY[-2:]))
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/metadata_filter_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/metadata_filter_test.py
new file mode 100644
index 00000000..615cff61
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/metadata_filter_test.py
@@ -0,0 +1,277 @@
+# Copyright 2022 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 json
+import logging
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+_NUM_RPCS = 150
+_TEST_METADATA_KEY = 'xds_md'
+_TEST_METADATA_VALUE_EMPTY = 'empty_ytpme'
+_TEST_METADATA = ((RpcTypeEmptyCall, _TEST_METADATA_KEY,
+ _TEST_METADATA_VALUE_EMPTY),)
+match_labels = [{
+ 'name': 'TRAFFICDIRECTOR_NETWORK_NAME',
+ 'value': 'default-vpc'
+}]
+not_match_labels = [{'name': 'fake', 'value': 'fail'}]
+
+
+class TestMetadataFilterMatchAll(xds_url_map_testcase.XdsUrlMapTestCase):
+ """" The test url-map has two routeRules: the higher priority routes to
+ the default backends, but is supposed to be filtered out by TD because
+ of non-matching metadata filters. The lower priority routes to alternative
+ backends and metadata filter matches. Thus, it verifies that TD evaluates
+ metadata filters correctly."""
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ALL',
+ 'filterLabels': not_match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().default_backend_service()
+ }, {
+ 'priority': 1,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/grpc.testing.TestService/Empty',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'exactMatch': _TEST_METADATA_VALUE_EMPTY
+ }],
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ALL',
+ 'filterLabels': match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(len(xds_config.rds['virtualHosts'][0]['routes']), 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['prefix'],
+ "/grpc.testing.TestService/Empty")
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['exactMatch'], _TEST_METADATA_VALUE_EMPTY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][1]['match']['prefix'],
+ "")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+class TestMetadataFilterMatchAny(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ANY',
+ 'filterLabels': not_match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().default_backend_service()
+ }, {
+ 'priority': 1,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/grpc.testing.TestService/Unary',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ANY',
+ 'filterLabels': not_match_labels + match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(len(xds_config.rds['virtualHosts'][0]['routes']), 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['prefix'],
+ "/grpc.testing.TestService/Unary")
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][1]['match']['prefix'],
+ "")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestMetadataFilterMatchAnyAndAll(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ALL',
+ 'filterLabels': not_match_labels + match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().default_backend_service()
+ }, {
+ 'priority': 1,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/grpc.testing.TestService/Unary',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ANY',
+ 'filterLabels': not_match_labels + match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(len(xds_config.rds['virtualHosts'][0]['routes']), 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['prefix'],
+ "/grpc.testing.TestService/Unary")
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][1]['match']['prefix'],
+ "")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestMetadataFilterMatchMultipleRules(
+ xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/',
+ 'headerMatches': [{
+ 'headerName': _TEST_METADATA_KEY,
+ 'exactMatch': _TEST_METADATA_VALUE_EMPTY
+ }],
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ANY',
+ 'filterLabels': match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }, {
+ 'priority': 1,
+ 'matchRules': [{
+ 'prefixMatch':
+ '/grpc.testing.TestService/Unary',
+ 'metadataFilters': [{
+ 'filterMatchCriteria': 'MATCH_ALL',
+ 'filterLabels': match_labels
+ }]
+ }],
+ 'service': GcpResourceManager().default_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(len(xds_config.rds['virtualHosts'][0]['routes']), 3)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['name'], _TEST_METADATA_KEY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['headers']
+ [0]['exactMatch'], _TEST_METADATA_VALUE_EMPTY)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][1]['match']['prefix'],
+ "/grpc.testing.TestService/Unary")
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][2]['match']['prefix'],
+ "")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ metadata=_TEST_METADATA,
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/path_matching_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/path_matching_test.py
new file mode 100644
index 00000000..9b64b324
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/path_matching_test.py
@@ -0,0 +1,220 @@
+# Copyright 2021 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
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+
+from framework import xds_url_map_testcase
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+XdsTestClient = client_app.XdsTestClient
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+_NUM_RPCS = 150
+
+
+class TestFullPathMatchEmptyCall(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # FullPath EmptyCall -> alternate_backend_service.
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/EmptyCall'
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['path'],
+ "/grpc.testing.TestService/EmptyCall")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+class TestFullPathMatchUnaryCall(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # FullPath EmptyCall -> alternate_backend_service.
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall'
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['path'],
+ "/grpc.testing.TestService/UnaryCall")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestTwoRoutesAndPrefixMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+ """This test case is similar to the one above (but with route services
+ swapped). This test has two routes (full_path and the default) to match
+ EmptyCall, and both routes set alternative_backend_service as the action.
+ This forces the client to handle duplicate Clusters in the RDS response."""
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ {
+ 'priority': 0,
+ # Prefix UnaryCall -> default_backend_service.
+ 'matchRules': [{
+ 'prefixMatch': '/grpc.testing.TestService/Unary'
+ }],
+ 'service': GcpResourceManager().default_backend_service()
+ },
+ {
+ 'priority': 1,
+ # FullPath EmptyCall -> alternate_backend_service.
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/EmptyCall'
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['prefix'],
+ "/grpc.testing.TestService/Unary")
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][1]['match']['path'],
+ "/grpc.testing.TestService/EmptyCall")
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall, RpcTypeEmptyCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(0, rpc_distribution.num_failures)
+ self.assertEqual(
+ 0, rpc_distribution.unary_call_alternative_service_rpc_count)
+ self.assertEqual(0,
+ rpc_distribution.empty_call_default_service_rpc_count)
+
+
+class TestRegexMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # Regex UnaryCall -> alternate_backend_service.
+ 'matchRules': [{
+ 'regexMatch':
+ '^\/.*\/UnaryCall$' # Unary methods with any services.
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['safeRegex']
+ ['regex'], '^\/.*\/UnaryCall$')
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.unary_call_alternative_service_rpc_count)
+
+
+class TestCaseInsensitiveMatch(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [{
+ 'priority': 0,
+ # ignoreCase EmptyCall -> alternate_backend_service.
+ 'matchRules': [{
+ # Case insensitive matching.
+ 'fullPathMatch': '/gRpC.tEsTinG.tEstseRvice/empTycaLl',
+ 'ignoreCase': True,
+ }],
+ 'service': GcpResourceManager().alternative_backend_service()
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 2)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']['path'],
+ '/gRpC.tEsTinG.tEstseRvice/empTycaLl')
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['match']
+ ['caseSensitive'], False)
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(test_client,
+ rpc_types=[RpcTypeEmptyCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertEqual(
+ _NUM_RPCS,
+ rpc_distribution.empty_call_alternative_service_rpc_count)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/retry_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/retry_test.py
new file mode 100644
index 00000000..28c28739
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/retry_test.py
@@ -0,0 +1,153 @@
+# Copyright 2021 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 time
+from typing import Tuple
+
+from absl import flags
+from absl.testing import absltest
+import grpc
+
+from framework import xds_url_map_testcase
+from framework.helpers import skips
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+XdsTestClient = client_app.XdsTestClient
+ExpectedResult = xds_url_map_testcase.ExpectedResult
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+# The first batch of RPCs don't count towards the result of test case. They are
+# meant to prove the communication between driver and client is fine.
+_NUM_RPCS = 10
+_LENGTH_OF_RPC_SENDING_SEC = 16
+# We are using sleep to synchronize test driver and the client... Even though
+# the client is sending at QPS rate, we can't assert that exactly QPS *
+# SLEEP_DURATION number of RPC is finished. The final completed RPC might be
+# slightly more or less.
+_NON_RANDOM_ERROR_TOLERANCE = 0.01
+_RPC_BEHAVIOR_HEADER_NAME = 'rpc-behavior'
+
+
+def _build_retry_route_rule(retryConditions, num_retries):
+ return {
+ 'priority': 0,
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall'
+ }],
+ 'service': GcpResourceManager().default_backend_service(),
+ 'routeAction': {
+ 'retryPolicy': {
+ 'retryConditions': retryConditions,
+ 'numRetries': num_retries,
+ }
+ },
+ }
+
+
+class TestRetryUpTo3AttemptsAndFail(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'java', 'python']:
+ return config.version_ge('v1.40.x')
+ elif config.client_lang == 'go':
+ return config.version_ge('v1.41.x')
+ return False
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_retry_route_rule(retryConditions=["unavailable"],
+ num_retries=3)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ retry_config = xds_config.rds['virtualHosts'][0]['routes'][0]['route'][
+ 'retryPolicy']
+ self.assertEqual(3, retry_config['numRetries'])
+ self.assertEqual('unavailable', retry_config['retryOn'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ metadata=[(RpcTypeUnaryCall, _RPC_BEHAVIOR_HEADER_NAME,
+ 'error-code-14,succeed-on-retry-attempt-4')],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.UNAVAILABLE,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+class TestRetryUpTo4AttemptsAndSucceed(xds_url_map_testcase.XdsUrlMapTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ if config.client_lang in ['cpp', 'java', 'python']:
+ return config.version_ge('v1.40.x')
+ elif config.client_lang == 'go':
+ return config.version_ge('v1.41.x')
+ return False
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher["routeRules"] = [
+ _build_retry_route_rule(retryConditions=["unavailable"],
+ num_retries=4)
+ ]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ retry_config = xds_config.rds['virtualHosts'][0]['routes'][0]['route'][
+ 'retryPolicy']
+ self.assertEqual(4, retry_config['numRetries'])
+ self.assertEqual('unavailable', retry_config['retryOn'])
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ metadata=[(RpcTypeUnaryCall, _RPC_BEHAVIOR_HEADER_NAME,
+ 'error-code-14,succeed-on-retry-attempt-4')],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.OK,
+ ratio=1),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_NON_RANDOM_ERROR_TOLERANCE)
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/timeout_test.py b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/timeout_test.py
new file mode 100644
index 00000000..70c580d6
--- /dev/null
+++ b/grpc/tools/run_tests/xds_k8s_test_driver/tests/url_map/timeout_test.py
@@ -0,0 +1,162 @@
+# Copyright 2021 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
+from typing import Tuple
+import unittest
+
+from absl import flags
+from absl.testing import absltest
+import grpc
+
+from framework import xds_url_map_testcase
+from framework.helpers import skips
+from framework.test_app import client_app
+
+# Type aliases
+HostRule = xds_url_map_testcase.HostRule
+PathMatcher = xds_url_map_testcase.PathMatcher
+GcpResourceManager = xds_url_map_testcase.GcpResourceManager
+DumpedXdsConfig = xds_url_map_testcase.DumpedXdsConfig
+RpcTypeUnaryCall = xds_url_map_testcase.RpcTypeUnaryCall
+RpcTypeEmptyCall = xds_url_map_testcase.RpcTypeEmptyCall
+ExpectedResult = xds_url_map_testcase.ExpectedResult
+XdsTestClient = client_app.XdsTestClient
+XdsUrlMapTestCase = xds_url_map_testcase.XdsUrlMapTestCase
+
+logger = logging.getLogger(__name__)
+flags.adopt_module_key_flags(xds_url_map_testcase)
+
+# The first batch of RPCs don't count towards the result of test case. They are
+# meant to prove the communication between driver and client is fine.
+_NUM_RPCS = 25
+_LENGTH_OF_RPC_SENDING_SEC = 10
+_ERROR_TOLERANCE = 0.1
+
+
+class _BaseXdsTimeOutTestCase(XdsUrlMapTestCase):
+
+ @staticmethod
+ def url_map_change(
+ host_rule: HostRule,
+ path_matcher: PathMatcher) -> Tuple[HostRule, PathMatcher]:
+ path_matcher['routeRules'] = [{
+ 'priority': 0,
+ 'matchRules': [{
+ 'fullPathMatch': '/grpc.testing.TestService/UnaryCall'
+ }],
+ 'service': GcpResourceManager().default_backend_service(),
+ 'routeAction': {
+ 'maxStreamDuration': {
+ 'seconds': 3,
+ },
+ },
+ }]
+ return host_rule, path_matcher
+
+ def xds_config_validate(self, xds_config: DumpedXdsConfig):
+ self.assertNumEndpoints(xds_config, 1)
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['route']
+ ['maxStreamDuration']['maxStreamDuration'], '3s')
+ self.assertEqual(
+ xds_config.rds['virtualHosts'][0]['routes'][0]['route']
+ ['maxStreamDuration']['grpcTimeoutHeaderMax'], '3s')
+
+ def rpc_distribution_validate(self, unused_test_client):
+ raise NotImplementedError()
+
+
+class TestTimeoutInRouteRule(_BaseXdsTimeOutTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ # TODO(lidiz) either add support for rpc-behavior to other languages, or we
+ # should always use Java server as backend.
+ return config.server_lang == 'java'
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall, RpcTypeEmptyCall],
+ # UnaryCall and EmptyCall both sleep-4.
+ # UnaryCall timeouts, EmptyCall succeeds.
+ metadata=(
+ (RpcTypeUnaryCall, 'rpc-behavior', 'sleep-4'),
+ (RpcTypeEmptyCall, 'rpc-behavior', 'sleep-4'),
+ ),
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(
+ ExpectedResult(rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.DEADLINE_EXCEEDED),
+ ExpectedResult(rpc_type=RpcTypeEmptyCall,
+ status_code=grpc.StatusCode.OK),
+ ),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_ERROR_TOLERANCE)
+
+
+class TestTimeoutInApplication(_BaseXdsTimeOutTestCase):
+
+ @staticmethod
+ def is_supported(config: skips.TestConfig) -> bool:
+ return config.server_lang == 'java'
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ rpc_types=[RpcTypeUnaryCall],
+ # UnaryCall only with sleep-2; timeout=1s; calls timeout.
+ metadata=((RpcTypeUnaryCall, 'rpc-behavior', 'sleep-2'),),
+ app_timeout=1,
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(
+ test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.DEADLINE_EXCEEDED),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_ERROR_TOLERANCE)
+
+
+class TestTimeoutNotExceeded(_BaseXdsTimeOutTestCase):
+
+ def rpc_distribution_validate(self, test_client: XdsTestClient):
+ rpc_distribution = self.configure_and_send(
+ test_client,
+ # UnaryCall only with no sleep; calls succeed.
+ rpc_types=[RpcTypeUnaryCall],
+ num_rpcs=_NUM_RPCS)
+ self.assertRpcStatusCode(test_client,
+ expected=(ExpectedResult(
+ rpc_type=RpcTypeUnaryCall,
+ status_code=grpc.StatusCode.OK),),
+ length=_LENGTH_OF_RPC_SENDING_SEC,
+ tolerance=_ERROR_TOLERANCE)
+
+
+def load_tests(loader: absltest.TestLoader, unused_tests, unused_pattern):
+ suite = unittest.TestSuite()
+ test_cases = [
+ TestTimeoutInRouteRule, TestTimeoutInApplication, TestTimeoutNotExceeded
+ ]
+ for test_class in test_cases:
+ tests = loader.loadTestsFromTestCase(test_class)
+ suite.addTests(tests)
+ return suite
+
+
+if __name__ == '__main__':
+ absltest.main()
diff --git a/grpc_wrap.cc b/grpc_wrap.cc
index 00d5ebf1..e37872a9 100644
--- a/grpc_wrap.cc
+++ b/grpc_wrap.cc
@@ -37,12 +37,13 @@
// (rust-lang/rust#32836),
// so we need to wrap the type and expose more safer interfaces.
+#include <grpc/support/port_platform.h>
+
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include <grpc/support/thd_id.h>
@@ -87,6 +88,7 @@ typedef struct grpcwrap_batch_context {
grpc_metadata_array trailing_metadata;
grpc_status_code status;
grpc_slice status_details;
+ const char* error_string;
} recv_status_on_client;
int recv_close_on_server_cancelled;
} grpcwrap_batch_context;
@@ -117,7 +119,8 @@ grpcwrap_request_call_context_create() {
* Destroys array->metadata.
* The array pointer itself is not freed.
*/
-void grpcwrap_metadata_array_destroy_metadata_only(grpc_metadata_array* array) {
+GPR_EXPORT void grpcwrap_metadata_array_destroy_metadata_only(
+ grpc_metadata_array* array) {
gpr_free(array->metadata);
}
@@ -125,7 +128,7 @@ void grpcwrap_metadata_array_destroy_metadata_only(grpc_metadata_array* array) {
* Destroys keys, values and array->metadata.
* The array pointer itself is not freed.
*/
-void grpcwrap_metadata_array_destroy_metadata_including_entries(
+GPR_EXPORT void grpcwrap_metadata_array_destroy_metadata_including_entries(
grpc_metadata_array* array) {
size_t i;
if (array->metadata) {
@@ -220,8 +223,8 @@ grpcwrap_metadata_array_shrink_to_fit(grpc_metadata_array* array) {
}
/* Move contents of metadata array */
-void grpcwrap_metadata_array_move(grpc_metadata_array* dest,
- grpc_metadata_array* src) {
+GPR_EXPORT void grpcwrap_metadata_array_move(grpc_metadata_array* dest,
+ grpc_metadata_array* src) {
if (!src) {
dest->capacity = 0;
dest->count = 0;
@@ -258,6 +261,7 @@ grpcwrap_batch_context_destroy(grpcwrap_batch_context* ctx) {
grpcwrap_metadata_array_destroy_metadata_only(
&(ctx->recv_status_on_client.trailing_metadata));
grpc_slice_unref(ctx->recv_status_on_client.status_details);
+ gpr_free((void*)ctx->recv_status_on_client.error_string);
gpr_free(ctx);
}
@@ -278,10 +282,16 @@ grpcwrap_request_call_context_destroy(grpcwrap_request_call_context* ctx) {
gpr_free(ctx);
}
-GPR_EXPORT const grpc_metadata_array* GPR_CALLTYPE
-grpcwrap_batch_context_recv_initial_metadata(
- const grpcwrap_batch_context* ctx) {
- return &(ctx->recv_initial_metadata);
+GPR_EXPORT void GPR_CALLTYPE grpcwrap_batch_context_take_recv_initial_metadata(
+ grpcwrap_batch_context* ctx, grpc_metadata_array* res) {
+ grpcwrap_metadata_array_move(res, &(ctx->recv_initial_metadata));
+}
+
+GPR_EXPORT void GPR_CALLTYPE
+grpcwrap_batch_context_take_recv_status_on_client_trailing_metadata(
+ grpcwrap_batch_context* ctx, grpc_metadata_array* res) {
+ grpcwrap_metadata_array_move(res,
+ &(ctx->recv_status_on_client.trailing_metadata));
}
GPR_EXPORT const char* GPR_CALLTYPE
@@ -337,6 +347,12 @@ grpcwrap_batch_context_recv_status_on_client_trailing_metadata(
return &(ctx->recv_status_on_client.trailing_metadata);
}
+GPR_EXPORT const char* GPR_CALLTYPE
+grpcwrap_batch_context_recv_status_on_client_error_string(
+ const grpcwrap_batch_context* ctx) {
+ return ctx->recv_status_on_client.error_string;
+}
+
GPR_EXPORT grpc_call* GPR_CALLTYPE
grpcwrap_request_call_context_ref_call(grpcwrap_request_call_context* ctx) {
grpc_call* call = ctx->call;
@@ -510,6 +526,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_start_unary(
&(ctx->recv_status_on_client.status);
ops[5].data.recv_status_on_client.status_details =
&(ctx->recv_status_on_client.status_details);
+ ops[5].data.recv_status_on_client.error_string =
+ &(ctx->recv_status_on_client.error_string);
ops[5].flags = 0;
ops[5].reserved = nullptr;
@@ -550,6 +568,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_start_client_streaming(
&(ctx->recv_status_on_client.status);
ops[3].data.recv_status_on_client.status_details =
&(ctx->recv_status_on_client.status_details);
+ ops[3].data.recv_status_on_client.error_string =
+ &(ctx->recv_status_on_client.error_string);
ops[3].flags = 0;
ops[3].reserved = nullptr;
@@ -589,6 +609,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_start_server_streaming(
&(ctx->recv_status_on_client.status);
ops[3].data.recv_status_on_client.status_details =
&(ctx->recv_status_on_client.status_details);
+ ops[3].data.recv_status_on_client.error_string =
+ &(ctx->recv_status_on_client.error_string);
ops[3].flags = 0;
ops[3].reserved = nullptr;
@@ -618,6 +640,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_start_duplex_streaming(
&(ctx->recv_status_on_client.status);
ops[1].data.recv_status_on_client.status_details =
&(ctx->recv_status_on_client.status_details);
+ ops[1].data.recv_status_on_client.error_string =
+ &(ctx->recv_status_on_client.error_string);
ops[1].flags = 0;
ops[1].reserved = nullptr;
@@ -641,20 +665,31 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_recv_initial_metadata(
GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_send_message(
grpc_call* call, grpcwrap_batch_context* ctx, grpc_slice* send_buffer,
- uint32_t write_flags, int32_t send_empty_initial_metadata, void* tag) {
+ uint32_t write_flags, grpc_metadata_array* initial_metadata,
+ uint32_t initial_metadata_flags, void* tag) {
/* TODO: don't use magic number */
grpc_op ops[2];
memset(ops, 0, sizeof(ops));
- size_t nops = send_empty_initial_metadata ? 2 : 1;
+ size_t nops = 1;
+
ops[0].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = grpc_raw_byte_buffer_create(send_buffer, 1);
ops[0].data.send_message.send_message = ctx->send_message;
ops[0].flags = write_flags;
ops[0].reserved = nullptr;
- ops[1].op = GRPC_OP_SEND_INITIAL_METADATA;
- ops[1].flags = 0;
- ops[1].reserved = nullptr;
+ if (initial_metadata) {
+ ops[nops].op = GRPC_OP_SEND_INITIAL_METADATA;
+ grpcwrap_metadata_array_move(&(ctx->send_initial_metadata),
+ initial_metadata);
+ ops[nops].data.send_initial_metadata.count =
+ ctx->send_initial_metadata.count;
+ ops[nops].data.send_initial_metadata.metadata =
+ ctx->send_initial_metadata.metadata;
+ ops[nops].flags = initial_metadata_flags;
+ ops[nops].reserved = nullptr;
+ nops++;
+ }
return grpc_call_start_batch(call, ops, nops, tag, nullptr);
}
@@ -673,14 +708,17 @@ grpcwrap_call_send_close_from_client(grpc_call* call, void* tag) {
GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_send_status_from_server(
grpc_call* call, grpcwrap_batch_context* ctx, grpc_status_code status_code,
const char* status_details, size_t status_details_len,
- grpc_metadata_array* trailing_metadata, int32_t send_empty_initial_metadata,
- grpc_slice* optional_send_buffer, uint32_t write_flags, void* tag) {
+ grpc_metadata_array* initial_metadata, uint32_t initial_metadata_flags,
+ grpc_metadata_array* trailing_metadata, grpc_slice* optional_send_buffer,
+ uint32_t write_flags, void* tag) {
/* TODO: don't use magic number */
grpc_op ops[3];
memset(ops, 0, sizeof(ops));
size_t nops = 1;
+
grpc_slice status_details_slice =
grpc_slice_from_copied_buffer(status_details, status_details_len);
+
ops[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER;
ops[0].data.send_status_from_server.status = status_code;
ops[0].data.send_status_from_server.status_details = &status_details_slice;
@@ -692,6 +730,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_send_status_from_server(
ctx->send_status_from_server.trailing_metadata.metadata;
ops[0].flags = 0;
ops[0].reserved = nullptr;
+
if (optional_send_buffer) {
ops[nops].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = grpc_raw_byte_buffer_create(optional_send_buffer, 1);
@@ -700,12 +739,19 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcwrap_call_send_status_from_server(
ops[nops].reserved = nullptr;
nops++;
}
- if (send_empty_initial_metadata) {
+ if (initial_metadata) {
ops[nops].op = GRPC_OP_SEND_INITIAL_METADATA;
- ops[nops].flags = 0;
+ grpcwrap_metadata_array_move(&(ctx->send_initial_metadata),
+ initial_metadata);
+ ops[nops].data.send_initial_metadata.count =
+ ctx->send_initial_metadata.count;
+ ops[nops].data.send_initial_metadata.metadata =
+ ctx->send_initial_metadata.metadata;
+ ops[nops].flags = initial_metadata_flags;
ops[nops].reserved = nullptr;
nops++;
}
+
grpc_call_error ret = grpc_call_start_batch(call, ops, nops, tag, nullptr);
grpc_slice_unref(status_details_slice);
return ret;
diff --git a/link-deps.rs b/link-deps.rs
new file mode 100644
index 00000000..7b068dc3
--- /dev/null
+++ b/link-deps.rs
@@ -0,0 +1,56 @@
+/// Following two arrays are generated by running pkg-config manually. We can
+/// also choose to run pkg-config at build time, but it will requires pkg-config
+/// in path, which is unfriendly for platforms like Windows.
+const COMMON_DEPS: &[&str] = &[
+ "absl_bad_optional_access",
+ "absl_bad_variant_access",
+ "absl_base",
+ "absl_city",
+ "absl_civil_time",
+ "absl_cord",
+ "absl_cord_internal",
+ "absl_cordz_functions",
+ "absl_cordz_handle",
+ "absl_cordz_info",
+ "absl_debugging_internal",
+ "absl_demangle_internal",
+ "absl_exponential_biased",
+ "absl_graphcycles_internal",
+ "absl_hash",
+ "absl_hashtablez_sampler",
+ "absl_int128",
+ "absl_log_severity",
+ "absl_low_level_hash",
+ "absl_malloc_internal",
+ "absl_random_distributions",
+ "absl_random_internal_platform",
+ "absl_random_internal_pool_urbg",
+ "absl_random_internal_randen",
+ "absl_random_internal_randen_hwaes",
+ "absl_random_internal_randen_hwaes_impl",
+ "absl_random_internal_randen_slow",
+ "absl_random_internal_seed_material",
+ "absl_random_seed_gen_exception",
+ "absl_random_seed_sequences",
+ "absl_raw_hash_set",
+ "absl_raw_logging_internal",
+ "absl_spinlock_wait",
+ "absl_stacktrace",
+ "absl_status",
+ "absl_statusor",
+ "absl_str_format_internal",
+ "absl_strings",
+ "absl_strings_internal",
+ "absl_symbolize",
+ "absl_synchronization",
+ "absl_throw_delegate",
+ "absl_time",
+ "absl_time_zone",
+ "address_sorting",
+ "cares",
+ "gpr",
+ "upb",
+ "z",
+];
+const GRPC_DEPS: &[&str] = &["grpc", "re2"];
+const GRPC_UNSECURE_DEPS: &[&str] = &["grpc_unsecure"];
diff --git a/patches/Android.bp.patch b/patches/Android.bp.patch
index 38f7cca4..2b849d8d 100644
--- a/patches/Android.bp.patch
+++ b/patches/Android.bp.patch
@@ -1,134 +1,13 @@
diff --git a/Android.bp b/Android.bp
-index 45707bc..d0369e6 100644
+index 6f8fdea..c629c0d 100644
--- a/Android.bp
+++ b/Android.bp
-@@ -40,7 +40,10 @@
+@@ -39,7 +39,7 @@ rust_library {
host_supported: true,
crate_name: "grpcio_sys",
cargo_env_compat: true,
- srcs: ["src/lib.rs"],
-+ srcs: [
-+ "src/lib.rs",
-+ ":libgrpc_bindgen",
-+ ],
++ srcs: ["src/lib.rs", ":libgrpc_bindgen"],
edition: "2018",
features: [
- "bindgen",
-@@ -55,52 +55,75 @@
- "liblibc",
- "liblibz_sys",
- ],
-- static_libs: [
-- "libabsl_bad_optional_access",
-- "libabsl_bad_variant_access",
-- "libabsl_base",
-- "libabsl_city",
-- "libabsl_civil_time",
-- "libabsl_cord",
-- "libabsl_debugging_internal",
-- "libabsl_demangle_internal",
-- "libabsl_exponential_biased",
-- "libabsl_graphcycles_internal",
-- "libabsl_hash",
-- "libabsl_hashtablez_sampler",
-- "libabsl_int128",
-- "libabsl_log_severity",
-- "libabsl_malloc_internal",
-- "libabsl_raw_hash_set",
-- "libabsl_raw_logging_internal",
-- "libabsl_spinlock_wait",
-- "libabsl_stacktrace",
-- "libabsl_status",
-- "libabsl_statusor",
-- "libabsl_str_format_internal",
-- "libabsl_strings",
-- "libabsl_strings_internal",
-- "libabsl_symbolize",
-- "libabsl_synchronization",
-- "libabsl_throw_delegate",
-- "libabsl_time",
-- "libabsl_time_zone",
-- "libabsl_wyhash",
-- "libaddress_sorting",
-- "libcares",
-- "libcrypto",
-- "libgpr",
-- "libgrpc",
-- "libgrpc_wrap",
-- "libre2",
-- "libssl",
-- "libupb",
-- "libz",
-+ shared_libs: [
-+ "libgrpc++",
-+ "libgrpc_wrap"
- ],
-- shared_libs: ["libstdc++"],
- apex_available: [
- "//apex_available:platform",
- "com.android.btservices",
- ],
- min_sdk_version: "29",
- }
-+
-+cc_defaults {
-+ name: "libgrpcio_sys_defaults",
-+ cflags: [
-+ "-DGRPC_SYS_SECURE",
-+ ],
-+ cpp_std: "c++11",
-+ shared_libs: ["libgrpc++"],
-+ apex_available: [
-+ "//apex_available:platform",
-+ "com.android.btservices",
-+ ],
-+ min_sdk_version: "29",
-+}
-+
-+cc_library {
-+ name: "libgrpc_wrap",
-+ defaults: ["libgrpcio_sys_defaults"],
-+ host_supported: true,
-+ srcs: ["grpc_wrap.cc"],
-+}
-+
-+rust_bindgen {
-+ name: "libgrpc_bindgen",
-+ defaults: ["libgrpcio_sys_defaults"],
-+ host_supported: true,
-+ wrapper_src: "android/bindgen_wrapper.hpp",
-+ source_stem: "grpc-bindings",
-+ crate_name: "grpc_bindgen",
-+ bindgen_flags: [
-+ "--size_t-is-usize",
-+ "--constified-enum-module grpc_status_code",
-+ "--default-enum-style rust",
-+ "--allowlist-function=\\bgrpc_.*",
-+ "--allowlist-function=\\bgpr_.*",
-+ "--allowlist-function=\\bgrpcwrap_.*",
-+ "--allowlist-var=\\bGRPC_.*",
-+ "--allowlist-type=\\bgrpc_.*",
-+ "--allowlist-type=\\bgpr_.*",
-+ "--allowlist-type=\\bgrpcwrap_.*",
-+ "--allowlist-type=\\bcensus_context.*",
-+ "--allowlist-type=\\bverify_peer_options.*",
-+ "--blocklist-type=(__)?pthread.*",
-+ "--blocklist-function=\\bgpr_mu_.*",
-+ "--blocklist-function=\\bgpr_cv_.*",
-+ "--blocklist-function=\\bgpr_once_.*",
-+ "--blocklist-type=gpr_mu",
-+ "--blocklist-type=gpr_cv",
-+ "--blocklist-type=gpr_once",
-+ ],
-+ min_sdk_version: "29",
-+}
-+
-+rust_test {
-+ name: "libgrpc_bindgen_test",
-+ srcs: [":libgrpc_bindgen"],
-+ crate_name: "grpc_bindgen_test",
-+ test_suites: ["general-tests"],
-+ auto_gen_config: true,
-+ clippy_lints: "none",
-+ lints: "none",
-+}
+ "_gen-bindings",